summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.editorconfig3
-rw-r--r--.gitattributes1
-rw-r--r--.gitignore34
-rw-r--r--.travis.yml9
-rw-r--r--AUTHORS.md94
-rw-r--r--CONTRIBUTING.md127
-rw-r--r--COPYRIGHT.txt1179
-rw-r--r--LICENSE.md27
-rw-r--r--LICENSE.txt22
-rw-r--r--LOGO_LICENSE.md5
-rw-r--r--README.md8
-rw-r--r--SConstruct85
-rw-r--r--core/SCsub77
-rw-r--r--core/allocators.h1
-rw-r--r--core/array.cpp1
-rw-r--r--core/array.h1
-rw-r--r--core/bind/core_bind.cpp138
-rw-r--r--core/bind/core_bind.h27
-rw-r--r--core/class_db.cpp65
-rw-r--r--core/class_db.h31
-rw-r--r--core/color.cpp1
-rw-r--r--core/color.h45
-rw-r--r--core/command_queue_mt.cpp1
-rw-r--r--core/command_queue_mt.h128
-rw-r--r--core/compressed_translation.cpp214
-rw-r--r--core/compressed_translation.h1
-rw-r--r--core/core_string_names.cpp30
-rw-r--r--core/core_string_names.h5
-rw-r--r--core/dictionary.cpp22
-rw-r--r--core/dictionary.h1
-rw-r--r--core/dvector.cpp1
-rw-r--r--core/dvector.h26
-rw-r--r--core/engine.cpp7
-rw-r--r--core/engine.h5
-rw-r--r--core/error_list.h1
-rw-r--r--core/error_macros.cpp1
-rw-r--r--core/error_macros.h55
-rw-r--r--core/event_queue.cpp1
-rw-r--r--core/event_queue.h1
-rw-r--r--core/func_ref.cpp5
-rw-r--r--core/func_ref.h1
-rw-r--r--core/global_constants.cpp15
-rw-r--r--core/global_constants.h1
-rw-r--r--core/hash_map.h10
-rw-r--r--core/hashfuncs.h19
-rw-r--r--core/helper/math_fieldwise.cpp11
-rw-r--r--core/helper/math_fieldwise.h1
-rw-r--r--core/helper/value_evaluator.h1
-rw-r--r--core/image.cpp1310
-rw-r--r--core/image.h141
-rw-r--r--core/input_map.cpp147
-rw-r--r--core/input_map.h19
-rw-r--r--core/int_types.h1
-rw-r--r--core/io/SCsub2
-rw-r--r--core/io/compression.cpp53
-rw-r--r--core/io/compression.h16
-rw-r--r--core/io/config_file.cpp7
-rw-r--r--core/io/config_file.h1
-rw-r--r--core/io/file_access_buffered.cpp13
-rw-r--r--core/io/file_access_buffered.h3
-rw-r--r--core/io/file_access_buffered_fa.h1
-rw-r--r--core/io/file_access_compressed.cpp3
-rw-r--r--core/io/file_access_compressed.h3
-rw-r--r--core/io/file_access_encrypted.cpp12
-rw-r--r--core/io/file_access_encrypted.h1
-rw-r--r--core/io/file_access_memory.cpp7
-rw-r--r--core/io/file_access_memory.h3
-rw-r--r--core/io/file_access_network.cpp3
-rw-r--r--core/io/file_access_network.h1
-rw-r--r--core/io/file_access_pack.cpp17
-rw-r--r--core/io/file_access_pack.h1
-rw-r--r--core/io/file_access_zip.cpp16
-rw-r--r--core/io/file_access_zip.h5
-rw-r--r--core/io/http_client.cpp25
-rw-r--r--core/io/http_client.h1
-rw-r--r--core/io/image_loader.cpp6
-rw-r--r--core/io/image_loader.h5
-rw-r--r--core/io/ip.cpp68
-rw-r--r--core/io/ip.h1
-rw-r--r--core/io/ip_address.cpp1
-rw-r--r--core/io/ip_address.h3
-rw-r--r--core/io/json.cpp61
-rw-r--r--core/io/json.h1
-rw-r--r--core/io/marshalls.cpp349
-rw-r--r--core/io/marshalls.h3
-rw-r--r--core/io/networked_multiplayer_peer.cpp1
-rw-r--r--core/io/networked_multiplayer_peer.h1
-rw-r--r--core/io/packet_peer.cpp61
-rw-r--r--core/io/packet_peer.h10
-rw-r--r--core/io/packet_peer_udp.cpp5
-rw-r--r--core/io/packet_peer_udp.h3
-rw-r--r--core/io/pck_packer.cpp2
-rw-r--r--core/io/pck_packer.h1
-rw-r--r--core/io/resource_format_binary.cpp267
-rw-r--r--core/io/resource_format_binary.h11
-rw-r--r--core/io/resource_import.cpp54
-rw-r--r--core/io/resource_import.h9
-rw-r--r--core/io/resource_loader.cpp173
-rw-r--r--core/io/resource_loader.h15
-rw-r--r--core/io/resource_saver.cpp5
-rw-r--r--core/io/resource_saver.h1
-rw-r--r--core/io/sha-README.md5
-rw-r--r--core/io/stream_peer.cpp12
-rw-r--r--core/io/stream_peer.h1
-rw-r--r--core/io/stream_peer_ssl.cpp5
-rw-r--r--core/io/stream_peer_ssl.h1
-rw-r--r--core/io/stream_peer_tcp.cpp1
-rw-r--r--core/io/stream_peer_tcp.h1
-rw-r--r--core/io/tcp_server.cpp1
-rw-r--r--core/io/tcp_server.h3
-rw-r--r--core/io/translation_loader_po.cpp22
-rw-r--r--core/io/translation_loader_po.h1
-rw-r--r--core/io/xml_parser.cpp1
-rw-r--r--core/io/xml_parser.h1
-rw-r--r--core/io/zip_io.h6
-rw-r--r--core/list.h15
-rw-r--r--core/make_binders.py24
-rw-r--r--core/map.h7
-rw-r--r--core/math/a_star.cpp45
-rw-r--r--core/math/a_star.h7
-rw-r--r--core/math/audio_frame.cpp1
-rw-r--r--core/math/audio_frame.h11
-rw-r--r--core/math/bsp_tree.cpp18
-rw-r--r--core/math/bsp_tree.h1
-rw-r--r--core/math/camera_matrix.cpp133
-rw-r--r--core/math/camera_matrix.h3
-rw-r--r--core/math/face3.cpp37
-rw-r--r--core/math/face3.h79
-rw-r--r--core/math/geometry.cpp7
-rw-r--r--core/math/geometry.h22
-rw-r--r--core/math/math_2d.cpp32
-rw-r--r--core/math/math_2d.h290
-rw-r--r--core/math/math_defs.h5
-rw-r--r--core/math/math_funcs.cpp7
-rw-r--r--core/math/math_funcs.h33
-rw-r--r--core/math/matrix3.cpp230
-rw-r--r--core/math/matrix3.h32
-rw-r--r--core/math/octree.h39
-rw-r--r--core/math/plane.cpp5
-rw-r--r--core/math/plane.h22
-rw-r--r--core/math/quat.cpp60
-rw-r--r--core/math/quat.h15
-rw-r--r--core/math/quick_hull.cpp5
-rw-r--r--core/math/quick_hull.h1
-rw-r--r--core/math/rect3.cpp93
-rw-r--r--core/math/rect3.h153
-rw-r--r--core/math/transform.cpp21
-rw-r--r--core/math/transform.h72
-rw-r--r--core/math/triangle_mesh.cpp9
-rw-r--r--core/math/triangle_mesh.h1
-rw-r--r--core/math/triangulate.cpp1
-rw-r--r--core/math/triangulate.h1
-rw-r--r--core/math/vector3.cpp11
-rw-r--r--core/math/vector3.h38
-rw-r--r--core/message_queue.cpp36
-rw-r--r--core/message_queue.h1
-rw-r--r--core/method_bind.cpp35
-rw-r--r--core/method_bind.h26
-rw-r--r--core/method_ptrcall.h117
-rw-r--r--core/node_path.cpp (renamed from core/path_db.cpp)5
-rw-r--r--core/node_path.h (renamed from core/path_db.h)7
-rw-r--r--core/object.cpp295
-rw-r--r--core/object.h76
-rw-r--r--core/os/copymem.h1
-rw-r--r--core/os/dir_access.cpp9
-rw-r--r--core/os/dir_access.h1
-rw-r--r--core/os/file_access.cpp40
-rw-r--r--core/os/file_access.h4
-rw-r--r--core/os/input.cpp9
-rw-r--r--core/os/input.h7
-rw-r--r--core/os/input_event.cpp1029
-rw-r--r--core/os/input_event.h317
-rw-r--r--core/os/keyboard.cpp7
-rw-r--r--core/os/keyboard.h8
-rw-r--r--core/os/main_loop.cpp5
-rw-r--r--core/os/main_loop.h3
-rw-r--r--core/os/memory.cpp41
-rw-r--r--core/os/memory.h13
-rw-r--r--core/os/mutex.cpp1
-rw-r--r--core/os/mutex.h1
-rw-r--r--core/os/os.cpp41
-rw-r--r--core/os/os.h33
-rw-r--r--core/os/power.h1
-rw-r--r--core/os/rw_lock.cpp1
-rw-r--r--core/os/rw_lock.h1
-rw-r--r--core/os/semaphore.cpp1
-rw-r--r--core/os/semaphore.h1
-rw-r--r--core/os/shell.cpp1
-rw-r--r--core/os/shell.h1
-rw-r--r--core/os/thread.cpp9
-rw-r--r--core/os/thread.h9
-rw-r--r--core/os/thread_dummy.cpp1
-rw-r--r--core/os/thread_dummy.h3
-rw-r--r--core/os/thread_safe.cpp1
-rw-r--r--core/os/thread_safe.h1
-rw-r--r--core/packed_data_container.cpp5
-rw-r--r--core/packed_data_container.h1
-rw-r--r--core/pair.h7
-rw-r--r--core/path_remap.cpp1
-rw-r--r--core/path_remap.h1
-rw-r--r--core/pool_allocator.cpp1
-rw-r--r--core/pool_allocator.h1
-rw-r--r--core/print_string.cpp1
-rw-r--r--core/print_string.h1
-rw-r--r--core/project_settings.cpp (renamed from core/global_config.cpp)455
-rw-r--r--core/project_settings.h (renamed from core/global_config.h)66
-rw-r--r--core/ref_ptr.cpp1
-rw-r--r--core/ref_ptr.h1
-rw-r--r--core/reference.cpp10
-rw-r--r--core/reference.h27
-rw-r--r--core/register_core_types.cpp43
-rw-r--r--core/register_core_types.h1
-rw-r--r--core/resource.cpp41
-rw-r--r--core/resource.h12
-rw-r--r--core/rid.cpp1
-rw-r--r--core/rid.h1
-rw-r--r--core/ring_buffer.h27
-rw-r--r--core/safe_refcount.cpp230
-rw-r--r--core/safe_refcount.h11
-rw-r--r--core/script_debugger_local.cpp1
-rw-r--r--core/script_debugger_local.h1
-rw-r--r--core/script_debugger_remote.cpp94
-rw-r--r--core/script_debugger_remote.h1
-rw-r--r--core/script_language.cpp55
-rw-r--r--core/script_language.h15
-rw-r--r--core/self_list.h20
-rw-r--r--core/set.h1
-rw-r--r--core/simple_type.h1
-rw-r--r--core/sort.h11
-rw-r--r--core/string_db.cpp1
-rw-r--r--core/string_db.h1
-rw-r--r--core/translation.cpp33
-rw-r--r--core/translation.h3
-rw-r--r--core/type_info.h203
-rw-r--r--core/typedefs.h12
-rw-r--r--core/ucaps.h1
-rw-r--r--core/undo_redo.cpp17
-rw-r--r--core/undo_redo.h1
-rw-r--r--core/ustring.cpp97
-rw-r--r--core/ustring.h18
-rw-r--r--core/variant.cpp94
-rw-r--r--core/variant.h36
-rw-r--r--core/variant_call.cpp203
-rw-r--r--core/variant_construct_string.cpp63
-rw-r--r--core/variant_op.cpp868
-rw-r--r--core/variant_parser.cpp560
-rw-r--r--core/variant_parser.h1
-rw-r--r--core/vector.h20
-rw-r--r--core/version.h37
-rw-r--r--core/vmap.h7
-rw-r--r--core/vset.h1
-rw-r--r--doc/Makefile19
-rw-r--r--doc/base/classes.xml24257
-rw-r--r--[-rwxr-xr-x]doc/tools/doc_status.py17
-rw-r--r--doc/tools/locales/es/LC_MESSAGES/makedocs.mobin2321 -> 0 bytes
-rw-r--r--doc/tools/locales/es/LC_MESSAGES/makedocs.po142
-rw-r--r--doc/tools/main.css146
-rw-r--r--doc/tools/makedocs.pot108
-rw-r--r--doc/tools/makedocs.py382
-rw-r--r--doc/tools/makedoku.py499
-rw-r--r--doc/tools/makehtml.py689
-rw-r--r--doc/tools/makemd.py6
-rw-r--r--doc/tools/makerst.py31
-rw-r--r--drivers/alsa/audio_driver_alsa.cpp3
-rw-r--r--drivers/alsa/audio_driver_alsa.h1
-rw-r--r--drivers/convex_decomp/SCsub9
-rw-r--r--drivers/convex_decomp/b2d_decompose.cpp4
-rw-r--r--drivers/convex_decomp/b2d_decompose.h1
-rw-r--r--drivers/gl_context/context_gl.cpp1
-rw-r--r--drivers/gl_context/context_gl.h1
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp91
-rw-r--r--drivers/gles2/rasterizer_gles2.h13
-rw-r--r--drivers/gles2/rasterizer_instance_gles2.cpp1
-rw-r--r--drivers/gles2/rasterizer_instance_gles2.h1
-rw-r--r--drivers/gles2/shader_compiler_gles2.cpp1
-rw-r--r--drivers/gles2/shader_compiler_gles2.h1
-rw-r--r--drivers/gles2/shader_gles2.cpp5
-rw-r--r--drivers/gles2/shader_gles2.h9
-rw-r--r--drivers/gles2/shaders/canvas.glsl19
-rw-r--r--drivers/gles2/shaders/copy.glsl30
-rw-r--r--drivers/gles3/SCsub2
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp834
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.h35
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp109
-rw-r--r--drivers/gles3/rasterizer_gles3.h6
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp1397
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.h218
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp1596
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.h238
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp125
-rw-r--r--drivers/gles3/shader_compiler_gles3.h2
-rw-r--r--drivers/gles3/shader_gles3.cpp70
-rw-r--r--drivers/gles3/shader_gles3.h9
-rw-r--r--drivers/gles3/shaders/SCsub38
-rw-r--r--drivers/gles3/shaders/canvas.glsl248
-rw-r--r--drivers/gles3/shaders/copy.glsl112
-rw-r--r--drivers/gles3/shaders/cubemap_filter.glsl80
-rw-r--r--drivers/gles3/shaders/effect_blur.glsl18
-rw-r--r--drivers/gles3/shaders/particles.glsl153
-rw-r--r--drivers/gles3/shaders/resolve.glsl5
-rw-r--r--drivers/gles3/shaders/scene.glsl819
-rw-r--r--drivers/gles3/shaders/screen_space_reflection.glsl61
-rw-r--r--drivers/gles3/shaders/ssao.glsl16
-rw-r--r--drivers/gles3/shaders/ssao_blur.glsl2
-rw-r--r--drivers/gles3/shaders/subsurf_scattering.glsl4
-rw-r--r--drivers/gles3/shaders/tonemap.glsl157
-rw-r--r--drivers/png/image_loader_png.cpp44
-rw-r--r--drivers/png/image_loader_png.h5
-rw-r--r--drivers/png/resource_saver_png.cpp64
-rw-r--r--drivers/png/resource_saver_png.h4
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.cpp4
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.h1
-rw-r--r--drivers/register_driver_types.cpp1
-rw-r--r--drivers/register_driver_types.h1
-rw-r--r--drivers/rtaudio/audio_driver_rtaudio.cpp23
-rw-r--r--drivers/rtaudio/audio_driver_rtaudio.h1
-rw-r--r--drivers/unix/SCsub2
-rw-r--r--drivers/unix/dir_access_unix.cpp1
-rw-r--r--drivers/unix/dir_access_unix.h5
-rw-r--r--drivers/unix/file_access_unix.cpp1
-rw-r--r--drivers/unix/file_access_unix.h1
-rw-r--r--drivers/unix/ip_unix.cpp17
-rw-r--r--drivers/unix/ip_unix.h1
-rw-r--r--drivers/unix/mutex_posix.cpp1
-rw-r--r--drivers/unix/mutex_posix.h1
-rw-r--r--drivers/unix/os_unix.cpp53
-rw-r--r--drivers/unix/os_unix.h13
-rw-r--r--drivers/unix/packet_peer_udp_posix.cpp9
-rw-r--r--drivers/unix/packet_peer_udp_posix.h3
-rw-r--r--drivers/unix/rw_lock_posix.cpp1
-rw-r--r--drivers/unix/rw_lock_posix.h1
-rw-r--r--drivers/unix/semaphore_posix.cpp1
-rw-r--r--drivers/unix/semaphore_posix.h1
-rw-r--r--drivers/unix/socket_helpers.h11
-rw-r--r--drivers/unix/stream_peer_tcp_posix.cpp1
-rw-r--r--drivers/unix/stream_peer_tcp_posix.h1
-rw-r--r--drivers/unix/tcp_server_posix.cpp3
-rw-r--r--drivers/unix/tcp_server_posix.h3
-rw-r--r--drivers/unix/thread_posix.cpp7
-rw-r--r--drivers/unix/thread_posix.h5
-rw-r--r--drivers/windows/dir_access_windows.cpp1
-rw-r--r--drivers/windows/dir_access_windows.h5
-rw-r--r--drivers/windows/file_access_windows.cpp5
-rw-r--r--drivers/windows/file_access_windows.h1
-rw-r--r--drivers/windows/mutex_windows.cpp1
-rw-r--r--drivers/windows/mutex_windows.h1
-rw-r--r--drivers/windows/rw_lock_windows.cpp1
-rw-r--r--drivers/windows/rw_lock_windows.h1
-rw-r--r--drivers/windows/semaphore_windows.cpp1
-rw-r--r--drivers/windows/semaphore_windows.h1
-rw-r--r--drivers/windows/shell_windows.cpp1
-rw-r--r--drivers/windows/shell_windows.h1
-rw-r--r--drivers/windows/thread_windows.cpp7
-rw-r--r--drivers/windows/thread_windows.h5
-rw-r--r--drivers/xaudio2/audio_driver_xaudio2.cpp3
-rw-r--r--drivers/xaudio2/audio_driver_xaudio2.h2
-rw-r--r--editor/SCsub230
-rw-r--r--editor/animation_editor.cpp1643
-rw-r--r--editor/animation_editor.h6
-rw-r--r--editor/array_property_edit.cpp3
-rw-r--r--editor/array_property_edit.h1
-rw-r--r--editor/asset_library_editor_plugin.cpp255
-rw-r--r--editor/asset_library_editor_plugin.h7
-rw-r--r--editor/call_dialog.cpp25
-rw-r--r--editor/call_dialog.h1
-rw-r--r--editor/code_editor.cpp45
-rw-r--r--editor/code_editor.h5
-rw-r--r--editor/collada/collada.cpp10
-rw-r--r--editor/collada/collada.h5
-rw-r--r--editor/connections_dialog.cpp11
-rw-r--r--editor/connections_dialog.h1
-rw-r--r--editor/create_dialog.cpp18
-rw-r--r--editor/create_dialog.h3
-rw-r--r--editor/dependency_editor.cpp1
-rw-r--r--editor/dependency_editor.h3
-rw-r--r--editor/doc/doc_data.cpp151
-rw-r--r--editor/doc/doc_data.h1
-rw-r--r--editor/doc/doc_dump.cpp16
-rw-r--r--editor/doc/doc_dump.h1
-rw-r--r--editor/doc_code_font.h1
-rw-r--r--editor/doc_font.h1
-rw-r--r--editor/doc_title_font.h1
-rw-r--r--editor/editor_about.cpp209
-rw-r--r--editor/editor_about.h (renamed from platform/osx/context_gl_osx.h)51
-rw-r--r--editor/editor_asset_installer.cpp7
-rw-r--r--editor/editor_asset_installer.h1
-rw-r--r--editor/editor_audio_buses.cpp77
-rw-r--r--editor/editor_audio_buses.h5
-rw-r--r--editor/editor_autoload_settings.cpp77
-rw-r--r--editor/editor_autoload_settings.h9
-rw-r--r--editor/editor_data.cpp46
-rw-r--r--editor/editor_data.h25
-rw-r--r--editor/editor_dir_dialog.cpp11
-rw-r--r--editor/editor_dir_dialog.h1
-rw-r--r--editor/editor_export.cpp344
-rw-r--r--editor/editor_export.h34
-rw-r--r--editor/editor_file_dialog.cpp36
-rw-r--r--editor/editor_file_dialog.h3
-rw-r--r--editor/editor_file_system.cpp74
-rw-r--r--editor/editor_file_system.h3
-rw-r--r--editor/editor_fonts.cpp7
-rw-r--r--editor/editor_fonts.h1
-rw-r--r--editor/editor_help.cpp96
-rw-r--r--editor/editor_help.h16
-rw-r--r--editor/editor_icons.h1
-rw-r--r--editor/editor_initialize_ssl.cpp3
-rw-r--r--editor/editor_initialize_ssl.h1
-rw-r--r--editor/editor_log.cpp46
-rw-r--r--editor/editor_log.h1
-rw-r--r--editor/editor_name_dialog.cpp22
-rw-r--r--editor/editor_name_dialog.h4
-rw-r--r--editor/editor_node.cpp1383
-rw-r--r--editor/editor_node.h80
-rw-r--r--editor/editor_path.cpp10
-rw-r--r--editor/editor_path.h3
-rw-r--r--editor/editor_plugin.cpp137
-rw-r--r--editor/editor_plugin.h32
-rw-r--r--editor/editor_plugin_settings.cpp14
-rw-r--r--editor/editor_plugin_settings.h1
-rw-r--r--editor/editor_profiler.cpp28
-rw-r--r--editor/editor_profiler.h3
-rw-r--r--editor/editor_reimport_dialog.cpp1
-rw-r--r--editor/editor_reimport_dialog.h1
-rw-r--r--editor/editor_resource_preview.cpp35
-rw-r--r--editor/editor_resource_preview.h5
-rw-r--r--editor/editor_run.cpp31
-rw-r--r--editor/editor_run.h1
-rw-r--r--editor/editor_run_native.cpp12
-rw-r--r--editor/editor_run_native.h1
-rw-r--r--editor/editor_run_script.cpp1
-rw-r--r--editor/editor_run_script.h1
-rw-r--r--editor/editor_scale.cpp1
-rw-r--r--editor/editor_scale.h1
-rw-r--r--editor/editor_settings.cpp186
-rw-r--r--editor/editor_settings.h7
-rw-r--r--editor/editor_sub_scene.cpp1
-rw-r--r--editor/editor_sub_scene.h1
-rw-r--r--editor/editor_themes.cpp506
-rw-r--r--editor/editor_themes.h1
-rw-r--r--editor/export_template_manager.cpp33
-rw-r--r--editor/export_template_manager.h29
-rw-r--r--editor/file_type_cache.cpp7
-rw-r--r--editor/file_type_cache.h1
-rw-r--r--editor/fileserver/editor_file_server.cpp1
-rw-r--r--editor/fileserver/editor_file_server.h1
-rw-r--r--editor/filesystem_dock.cpp36
-rw-r--r--editor/filesystem_dock.h6
-rw-r--r--editor/groups_editor.cpp1
-rw-r--r--editor/groups_editor.h1
-rw-r--r--editor/icons/2x/icon_2_d.pngbin0 -> 366 bytes
-rw-r--r--editor/icons/2x/icon_3_d.pngbin0 -> 571 bytes
-rw-r--r--editor/icons/2x/icon_GUI_checked.pngbin0 -> 516 bytes
-rw-r--r--editor/icons/2x/icon_GUI_dropdown.pngbin0 -> 198 bytes
-rw-r--r--editor/icons/2x/icon_GUI_hslider_bg.pngbin0 -> 124 bytes
-rw-r--r--editor/icons/2x/icon_GUI_hsplitter.pngbin0 -> 190 bytes
-rw-r--r--editor/icons/2x/icon_GUI_mini_tab_menu.pngbin0 -> 206 bytes
-rw-r--r--editor/icons/2x/icon_GUI_option_arrow.pngbin0 -> 304 bytes
-rw-r--r--editor/icons/2x/icon_GUI_play_button_group.pngbin0 -> 886 bytes
-rw-r--r--editor/icons/2x/icon_GUI_progress_bar.pngbin0 -> 289 bytes
-rw-r--r--editor/icons/2x/icon_GUI_progress_fill.pngbin0 -> 196 bytes
-rw-r--r--editor/icons/2x/icon_GUI_radio_checked.pngbin0 -> 946 bytes
-rw-r--r--editor/icons/2x/icon_GUI_radio_unchecked.pngbin0 -> 799 bytes
-rw-r--r--editor/icons/2x/icon_GUI_scroll_bg.pngbin0 -> 99 bytes
-rw-r--r--editor/icons/2x/icon_GUI_scroll_grabber.pngbin0 -> 193 bytes
-rw-r--r--editor/icons/2x/icon_GUI_scroll_grabber_hl.pngbin0 -> 297 bytes
-rw-r--r--editor/icons/2x/icon_GUI_slider_grabber.pngbin0 -> 260 bytes
-rw-r--r--editor/icons/2x/icon_GUI_slider_grabber_hl.pngbin0 -> 1040 bytes
-rw-r--r--editor/icons/2x/icon_GUI_spinbox_updown.pngbin0 -> 516 bytes
-rw-r--r--editor/icons/2x/icon_GUI_tab_menu.pngbin0 -> 221 bytes
-rw-r--r--editor/icons/2x/icon_GUI_toggle_off.pngbin0 -> 2606 bytes
-rw-r--r--editor/icons/2x/icon_GUI_toggle_on.pngbin0 -> 2178 bytes
-rw-r--r--editor/icons/2x/icon_GUI_tree_arrow_down.pngbin0 -> 256 bytes
-rw-r--r--editor/icons/2x/icon_GUI_tree_arrow_right.pngbin0 -> 263 bytes
-rw-r--r--editor/icons/2x/icon_GUI_unchecked.pngbin0 -> 369 bytes
-rw-r--r--editor/icons/2x/icon_GUI_vslider_bg.pngbin0 -> 131 bytes
-rw-r--r--editor/icons/2x/icon_GUI_vsplit_bg.pngbin0 -> 104 bytes
-rw-r--r--editor/icons/2x/icon_GUI_vsplitter.pngbin0 -> 168 bytes
-rw-r--r--editor/icons/2x/icon_animation_player.pngbin174 -> 173 bytes
-rw-r--r--editor/icons/2x/icon_animation_tree.pngbin471 -> 264 bytes
-rw-r--r--editor/icons/2x/icon_animation_tree_player.pngbin471 -> 264 bytes
-rw-r--r--editor/icons/2x/icon_arrow_left.pngbin333 -> 354 bytes
-rw-r--r--editor/icons/2x/icon_arrow_right.pngbin308 -> 349 bytes
-rw-r--r--editor/icons/2x/icon_arrow_up.pngbin293 -> 382 bytes
-rw-r--r--editor/icons/2x/icon_asset_lib.pngbin0 -> 367 bytes
-rw-r--r--editor/icons/2x/icon_audio_bus_bypass.pngbin0 -> 368 bytes
-rw-r--r--editor/icons/2x/icon_audio_bus_layout.pngbin0 -> 565 bytes
-rw-r--r--editor/icons/2x/icon_audio_bus_mute.pngbin0 -> 527 bytes
-rw-r--r--editor/icons/2x/icon_audio_bus_solo.pngbin0 -> 479 bytes
-rw-r--r--editor/icons/2x/icon_audio_effect_amplify.pngbin0 -> 462 bytes
-rw-r--r--editor/icons/2x/icon_audio_stream_player.pngbin0 -> 769 bytes
-rw-r--r--editor/icons/2x/icon_audio_stream_player_2_d.pngbin0 -> 782 bytes
-rw-r--r--editor/icons/2x/icon_audio_stream_player_3_d.pngbin0 -> 763 bytes
-rw-r--r--editor/icons/2x/icon_audio_stream_sample.pngbin0 -> 712 bytes
-rw-r--r--editor/icons/2x/icon_back.pngbin323 -> 410 bytes
-rw-r--r--editor/icons/2x/icon_baked_light.pngbin267 -> 264 bytes
-rw-r--r--editor/icons/2x/icon_bit_map.pngbin148 -> 152 bytes
-rw-r--r--editor/icons/2x/icon_bool.pngbin171 -> 422 bytes
-rw-r--r--editor/icons/2x/icon_bus_vu_db.pngbin0 -> 7645 bytes
-rw-r--r--editor/icons/2x/icon_bus_vu_empty.pngbin0 -> 2241 bytes
-rw-r--r--editor/icons/2x/icon_bus_vu_frozen.pngbin0 -> 1945 bytes
-rw-r--r--editor/icons/2x/icon_bus_vu_full.pngbin0 -> 1839 bytes
-rw-r--r--editor/icons/2x/icon_button.pngbin186 -> 456 bytes
-rw-r--r--editor/icons/2x/icon_button_group.pngbin251 -> 529 bytes
-rw-r--r--editor/icons/2x/icon_capsule_mesh.pngbin0 -> 767 bytes
-rw-r--r--editor/icons/2x/icon_checked.pngbin0 -> 534 bytes
-rw-r--r--editor/icons/2x/icon_color_rect.pngbin289 -> 285 bytes
-rw-r--r--editor/icons/2x/icon_confirmation_dialog.pngbin694 -> 614 bytes
-rw-r--r--editor/icons/2x/icon_connect.pngbin251 -> 876 bytes
-rw-r--r--editor/icons/2x/icon_copy_node_path.pngbin356 -> 358 bytes
-rw-r--r--editor/icons/2x/icon_cube_mesh.pngbin0 -> 681 bytes
-rw-r--r--editor/icons/2x/icon_curve.pngbin0 -> 607 bytes
-rw-r--r--editor/icons/2x/icon_curve_texture.pngbin0 -> 728 bytes
-rw-r--r--editor/icons/2x/icon_cylinder_mesh.pngbin0 -> 650 bytes
-rw-r--r--editor/icons/2x/icon_debug.pngbin0 -> 900 bytes
-rw-r--r--editor/icons/2x/icon_dropdown.pngbin0 -> 327 bytes
-rw-r--r--editor/icons/2x/icon_edit_resource.pngbin396 -> 311 bytes
-rw-r--r--editor/icons/2x/icon_editor_control_anchor.pngbin0 -> 855 bytes
-rw-r--r--editor/icons/2x/icon_environment.pngbin1270 -> 1193 bytes
-rw-r--r--editor/icons/2x/icon_error.pngbin155 -> 346 bytes
-rw-r--r--editor/icons/2x/icon_file.pngbin196 -> 242 bytes
-rw-r--r--editor/icons/2x/icon_file_big.pngbin505 -> 934 bytes
-rw-r--r--editor/icons/2x/icon_file_dialog.pngbin342 -> 397 bytes
-rw-r--r--editor/icons/2x/icon_forward.pngbin326 -> 410 bytes
-rw-r--r--editor/icons/2x/icon_g_d_native_library.pngbin0 -> 677 bytes
-rw-r--r--editor/icons/2x/icon_g_d_native_script.pngbin0 -> 698 bytes
-rw-r--r--editor/icons/2x/icon_godot.pngbin1842 -> 1743 bytes
-rw-r--r--editor/icons/2x/icon_godot_docs.pngbin0 -> 1840 bytes
-rw-r--r--editor/icons/2x/icon_gradient.pngbin0 -> 249 bytes
-rw-r--r--editor/icons/2x/icon_gradient_texture.pngbin0 -> 330 bytes
-rw-r--r--editor/icons/2x/icon_graph_scalars_to_vec.pngbin255 -> 565 bytes
-rw-r--r--editor/icons/2x/icon_graph_vec_to_scalars.pngbin257 -> 575 bytes
-rw-r--r--editor/icons/2x/icon_graph_vecs_to_xform.pngbin282 -> 549 bytes
-rw-r--r--editor/icons/2x/icon_graph_xform_to_vecs.pngbin277 -> 560 bytes
-rw-r--r--editor/icons/2x/icon_grid_map.pngbin138 -> 378 bytes
-rw-r--r--editor/icons/2x/icon_gui_close_dark.pngbin0 -> 371 bytes
-rw-r--r--editor/icons/2x/icon_gui_close_light.pngbin0 -> 366 bytes
-rw-r--r--editor/icons/2x/icon_h_button_array.pngbin224 -> 470 bytes
-rw-r--r--editor/icons/2x/icon_h_scroll_bar.pngbin324 -> 688 bytes
-rw-r--r--editor/icons/2x/icon_h_slider.pngbin360 -> 424 bytes
-rw-r--r--editor/icons/2x/icon_help.pngbin1126 -> 654 bytes
-rw-r--r--editor/icons/2x/icon_help_search.pngbin0 -> 881 bytes
-rw-r--r--editor/icons/2x/icon_hslider_bg.pngbin0 -> 233 bytes
-rw-r--r--editor/icons/2x/icon_key_hover.pngbin376 -> 191 bytes
-rw-r--r--editor/icons/2x/icon_key_selected.pngbin353 -> 255 bytes
-rw-r--r--editor/icons/2x/icon_key_value.pngbin380 -> 244 bytes
-rw-r--r--editor/icons/2x/icon_key_xform.pngbin388 -> 261 bytes
-rw-r--r--editor/icons/2x/icon_line_2d.pngbin795 -> 739 bytes
-rw-r--r--editor/icons/2x/icon_line_edit.pngbin323 -> 223 bytes
-rw-r--r--editor/icons/2x/icon_mini_basis.pngbin0 -> 472 bytes
-rw-r--r--editor/icons/2x/icon_mini_matrix3.pngbin391 -> 472 bytes
-rw-r--r--editor/icons/2x/icon_mini_transform2D.pngbin0 -> 602 bytes
-rw-r--r--editor/icons/2x/icon_mirror_x.pngbin247 -> 361 bytes
-rw-r--r--editor/icons/2x/icon_mirror_y.pngbin240 -> 406 bytes
-rw-r--r--editor/icons/2x/icon_move_down.pngbin357 -> 553 bytes
-rw-r--r--editor/icons/2x/icon_move_up.pngbin346 -> 505 bytes
-rw-r--r--editor/icons/2x/icon_multi_script.pngbin0 -> 586 bytes
-rw-r--r--editor/icons/2x/icon_native_script.pngbin0 -> 698 bytes
-rw-r--r--editor/icons/2x/icon_new.pngbin196 -> 242 bytes
-rw-r--r--editor/icons/2x/icon_nine_patch_rect.pngbin162 -> 163 bytes
-rw-r--r--editor/icons/2x/icon_open.pngbin228 -> 523 bytes
-rw-r--r--editor/icons/2x/icon_option_arrow.pngbin0 -> 360 bytes
-rw-r--r--editor/icons/2x/icon_option_button.pngbin366 -> 527 bytes
-rw-r--r--editor/icons/2x/icon_panorama_sky.pngbin0 -> 661 bytes
-rw-r--r--editor/icons/2x/icon_particles_material.pngbin0 -> 657 bytes
-rw-r--r--editor/icons/2x/icon_plane_mesh.pngbin0 -> 535 bytes
-rw-r--r--editor/icons/2x/icon_play_button_group.pngbin0 -> 942 bytes
-rw-r--r--editor/icons/2x/icon_prism_mesh.pngbin0 -> 612 bytes
-rw-r--r--editor/icons/2x/icon_procedural_sky.pngbin0 -> 639 bytes
-rw-r--r--editor/icons/2x/icon_quad_mesh.pngbin0 -> 291 bytes
-rw-r--r--editor/icons/2x/icon_reference_rect.pngbin160 -> 151 bytes
-rw-r--r--editor/icons/2x/icon_remote_transform.pngbin1140 -> 1003 bytes
-rw-r--r--editor/icons/2x/icon_remote_transform_2d.pngbin1197 -> 1044 bytes
-rw-r--r--editor/icons/2x/icon_search.pngbin0 -> 762 bytes
-rw-r--r--editor/icons/2x/icon_slider_grabber.pngbin0 -> 686 bytes
-rw-r--r--editor/icons/2x/icon_slider_grabber_hl.pngbin0 -> 672 bytes
-rw-r--r--editor/icons/2x/icon_slider_joint.pngbin180 -> 393 bytes
-rw-r--r--editor/icons/2x/icon_spatial_material.pngbin0 -> 704 bytes
-rw-r--r--editor/icons/2x/icon_sphere_mesh.pngbin0 -> 979 bytes
-rw-r--r--editor/icons/2x/icon_spinbox_updown.pngbin0 -> 562 bytes
-rw-r--r--editor/icons/2x/icon_stream_texture.pngbin0 -> 247 bytes
-rw-r--r--editor/icons/2x/icon_tab_menu.pngbin0 -> 277 bytes
-rw-r--r--editor/icons/2x/icon_tabs.pngbin222 -> 366 bytes
-rw-r--r--editor/icons/2x/icon_texture_rect.pngbin201 -> 203 bytes
-rw-r--r--editor/icons/2x/icon_timer.pngbin909 -> 765 bytes
-rw-r--r--editor/icons/2x/icon_tool_button.pngbin425 -> 753 bytes
-rw-r--r--editor/icons/2x/icon_tools.pngbin759 -> 544 bytes
-rw-r--r--editor/icons/2x/icon_tree.pngbin417 -> 211 bytes
-rw-r--r--editor/icons/2x/icon_tree_arrow_down.pngbin0 -> 312 bytes
-rw-r--r--editor/icons/2x/icon_tree_arrow_right.pngbin0 -> 319 bytes
-rw-r--r--editor/icons/2x/icon_tween.pngbin315 -> 320 bytes
-rw-r--r--editor/icons/2x/icon_unchecked.pngbin0 -> 404 bytes
-rw-r--r--editor/icons/2x/icon_v_button_array.pngbin231 -> 461 bytes
-rw-r--r--editor/icons/2x/icon_v_scroll_bar.pngbin328 -> 791 bytes
-rw-r--r--editor/icons/2x/icon_v_slider.pngbin391 -> 442 bytes
-rw-r--r--editor/icons/2x/icon_variant.pngbin0 -> 398 bytes
-rw-r--r--editor/icons/2x/icon_video_player.pngbin501 -> 380 bytes
-rw-r--r--editor/icons/2x/icon_visual_script.pngbin707 -> 728 bytes
-rw-r--r--editor/icons/2x/icon_vslider_bg.pngbin0 -> 236 bytes
-rw-r--r--editor/icons/2x/icon_warning.pngbin154 -> 350 bytes
-rw-r--r--editor/icons/2x/icon_world_environment.pngbin1371 -> 1297 bytes
-rw-r--r--editor/icons/2x/icon_zoom.pngbin762 -> 718 bytes
-rw-r--r--editor/icons/SCsub10
-rw-r--r--editor/icons/icon_2_d.pngbin0 -> 252 bytes
-rw-r--r--editor/icons/icon_3_d.pngbin0 -> 363 bytes
-rw-r--r--editor/icons/icon_GUI_checked.pngbin0 -> 341 bytes
-rw-r--r--editor/icons/icon_GUI_dropdown.pngbin0 -> 136 bytes
-rw-r--r--editor/icons/icon_GUI_hslider_bg.pngbin0 -> 105 bytes
-rw-r--r--editor/icons/icon_GUI_hsplitter.pngbin0 -> 132 bytes
-rw-r--r--editor/icons/icon_GUI_mini_tab_menu.pngbin0 -> 139 bytes
-rw-r--r--editor/icons/icon_GUI_option_arrow.pngbin0 -> 205 bytes
-rw-r--r--editor/icons/icon_GUI_play_button_group.pngbin0 -> 427 bytes
-rw-r--r--editor/icons/icon_GUI_progress_bar.pngbin0 -> 183 bytes
-rw-r--r--editor/icons/icon_GUI_progress_fill.pngbin0 -> 139 bytes
-rw-r--r--editor/icons/icon_GUI_radio_checked.pngbin0 -> 457 bytes
-rw-r--r--editor/icons/icon_GUI_radio_unchecked.pngbin0 -> 420 bytes
-rw-r--r--editor/icons/icon_GUI_scroll_bg.pngbin0 -> 90 bytes
-rw-r--r--editor/icons/icon_GUI_scroll_grabber.pngbin0 -> 147 bytes
-rw-r--r--editor/icons/icon_GUI_scroll_grabber_hl.pngbin0 -> 176 bytes
-rw-r--r--editor/icons/icon_GUI_scroll_grabber_pressed.pngbin0 -> 233 bytes
-rw-r--r--editor/icons/icon_GUI_slider_grabber.pngbin0 -> 168 bytes
-rw-r--r--editor/icons/icon_GUI_slider_grabber_hl.pngbin0 -> 477 bytes
-rw-r--r--editor/icons/icon_GUI_spinbox_updown.pngbin0 -> 345 bytes
-rw-r--r--editor/icons/icon_GUI_tab_menu.pngbin0 -> 146 bytes
-rw-r--r--editor/icons/icon_GUI_toggle_off.pngbin0 -> 1143 bytes
-rw-r--r--editor/icons/icon_GUI_toggle_on.pngbin0 -> 1030 bytes
-rw-r--r--editor/icons/icon_GUI_tree_arrow_down.pngbin0 -> 170 bytes
-rw-r--r--editor/icons/icon_GUI_tree_arrow_right.pngbin0 -> 189 bytes
-rw-r--r--editor/icons/icon_GUI_unchecked.pngbin0 -> 231 bytes
-rw-r--r--editor/icons/icon_GUI_vslider_bg.pngbin0 -> 108 bytes
-rw-r--r--editor/icons/icon_GUI_vsplit_bg.pngbin0 -> 96 bytes
-rw-r--r--editor/icons/icon_GUI_vsplitter.pngbin0 -> 122 bytes
-rw-r--r--editor/icons/icon_animation_player.pngbin153 -> 151 bytes
-rw-r--r--editor/icons/icon_animation_tree.pngbin279 -> 218 bytes
-rw-r--r--editor/icons/icon_animation_tree_player.pngbin279 -> 218 bytes
-rw-r--r--editor/icons/icon_arrow_left.pngbin211 -> 269 bytes
-rw-r--r--editor/icons/icon_arrow_right.pngbin215 -> 262 bytes
-rw-r--r--editor/icons/icon_arrow_up.pngbin223 -> 259 bytes
-rw-r--r--editor/icons/icon_asset_lib.pngbin0 -> 224 bytes
-rw-r--r--editor/icons/icon_audio_bus_bypass.pngbin0 -> 242 bytes
-rw-r--r--editor/icons/icon_audio_bus_layout.pngbin0 -> 319 bytes
-rw-r--r--editor/icons/icon_audio_bus_mute.pngbin0 -> 292 bytes
-rw-r--r--editor/icons/icon_audio_bus_solo.pngbin0 -> 309 bytes
-rw-r--r--editor/icons/icon_audio_effect_amplify.pngbin379 -> 300 bytes
-rw-r--r--editor/icons/icon_audio_stream_player.pngbin0 -> 443 bytes
-rw-r--r--editor/icons/icon_audio_stream_player_2_d.pngbin0 -> 445 bytes
-rw-r--r--editor/icons/icon_audio_stream_player_3_d.pngbin0 -> 433 bytes
-rw-r--r--editor/icons/icon_audio_stream_sample.pngbin0 -> 425 bytes
-rw-r--r--editor/icons/icon_back.pngbin223 -> 290 bytes
-rw-r--r--editor/icons/icon_baked_light.pngbin180 -> 179 bytes
-rw-r--r--editor/icons/icon_bit_map.pngbin113 -> 119 bytes
-rw-r--r--editor/icons/icon_bool.pngbin154 -> 250 bytes
-rw-r--r--editor/icons/icon_bus_vu_db.pngbin1136 -> 3410 bytes
-rw-r--r--editor/icons/icon_bus_vu_empty.pngbin1631 -> 938 bytes
-rw-r--r--editor/icons/icon_bus_vu_frozen.pngbin267 -> 925 bytes
-rw-r--r--editor/icons/icon_bus_vu_full.pngbin2463 -> 894 bytes
-rw-r--r--editor/icons/icon_button.pngbin163 -> 274 bytes
-rw-r--r--editor/icons/icon_button_group.pngbin165 -> 283 bytes
-rw-r--r--editor/icons/icon_capsule_mesh.pngbin0 -> 408 bytes
-rw-r--r--editor/icons/icon_checked.pngbin0 -> 377 bytes
-rw-r--r--editor/icons/icon_color_rect.pngbin214 -> 232 bytes
-rw-r--r--editor/icons/icon_confirmation_dialog.pngbin330 -> 343 bytes
-rw-r--r--editor/icons/icon_connect.pngbin170 -> 445 bytes
-rw-r--r--editor/icons/icon_copy_node_path.pngbin248 -> 241 bytes
-rw-r--r--editor/icons/icon_cube_mesh.pngbin0 -> 447 bytes
-rw-r--r--editor/icons/icon_curve.pngbin315 -> 339 bytes
-rw-r--r--editor/icons/icon_curve_texture.pngbin0 -> 391 bytes
-rw-r--r--editor/icons/icon_cylinder_mesh.pngbin0 -> 364 bytes
-rw-r--r--editor/icons/icon_debug.pngbin659 -> 455 bytes
-rw-r--r--editor/icons/icon_default_project_icon.pngbin2713 -> 3480 bytes
-rw-r--r--editor/icons/icon_dropdown.pngbin0 -> 179 bytes
-rw-r--r--editor/icons/icon_edit_resource.pngbin232 -> 202 bytes
-rw-r--r--editor/icons/icon_editor_control_anchor.pngbin0 -> 472 bytes
-rw-r--r--editor/icons/icon_environment.pngbin588 -> 506 bytes
-rw-r--r--editor/icons/icon_error.pngbin121 -> 195 bytes
-rw-r--r--editor/icons/icon_file.pngbin157 -> 203 bytes
-rw-r--r--editor/icons/icon_file_big.pngbin317 -> 509 bytes
-rw-r--r--editor/icons/icon_file_dialog.pngbin220 -> 241 bytes
-rw-r--r--editor/icons/icon_forward.pngbin224 -> 292 bytes
-rw-r--r--editor/icons/icon_g_d_native_library.pngbin0 -> 360 bytes
-rw-r--r--editor/icons/icon_g_d_native_script.pngbin0 -> 392 bytes
-rw-r--r--editor/icons/icon_godot.pngbin769 -> 739 bytes
-rw-r--r--editor/icons/icon_godot_docs.pngbin0 -> 722 bytes
-rw-r--r--editor/icons/icon_gradient.pngbin0 -> 180 bytes
-rw-r--r--editor/icons/icon_gradient_texture.pngbin0 -> 250 bytes
-rw-r--r--editor/icons/icon_graph_scalars_to_vec.pngbin172 -> 355 bytes
-rw-r--r--editor/icons/icon_graph_vec_to_scalars.pngbin181 -> 358 bytes
-rw-r--r--editor/icons/icon_graph_vecs_to_xform.pngbin178 -> 347 bytes
-rw-r--r--editor/icons/icon_graph_xform_to_vecs.pngbin195 -> 352 bytes
-rw-r--r--editor/icons/icon_grid_map.pngbin122 -> 268 bytes
-rw-r--r--editor/icons/icon_gui_close_dark.pngbin0 -> 171 bytes
-rw-r--r--editor/icons/icon_gui_close_light.pngbin0 -> 216 bytes
-rw-r--r--editor/icons/icon_h_button_array.pngbin163 -> 298 bytes
-rw-r--r--editor/icons/icon_h_scroll_bar.pngbin205 -> 381 bytes
-rw-r--r--editor/icons/icon_h_slider.pngbin204 -> 224 bytes
-rw-r--r--editor/icons/icon_help.pngbin578 -> 353 bytes
-rw-r--r--editor/icons/icon_help_search.pngbin0 -> 431 bytes
-rw-r--r--editor/icons/icon_hslider_bg.pngbin0 -> 233 bytes
-rw-r--r--editor/icons/icon_hsplit_bg.pngbin0 -> 96 bytes
-rw-r--r--editor/icons/icon_hsplitter.pngbin0 -> 132 bytes
-rw-r--r--editor/icons/icon_key_hover.pngbin206 -> 138 bytes
-rw-r--r--editor/icons/icon_key_selected.pngbin203 -> 181 bytes
-rw-r--r--editor/icons/icon_key_value.pngbin210 -> 182 bytes
-rw-r--r--editor/icons/icon_key_xform.pngbin213 -> 192 bytes
-rw-r--r--editor/icons/icon_line_2d.pngbin474 -> 418 bytes
-rw-r--r--editor/icons/icon_line_edit.pngbin201 -> 152 bytes
-rw-r--r--editor/icons/icon_logo.pngbin6211 -> 11594 bytes
-rw-r--r--editor/icons/icon_logo_small.pngbin1825 -> 1465 bytes
-rw-r--r--editor/icons/icon_mini_basis.pngbin0 -> 270 bytes
-rw-r--r--editor/icons/icon_mini_matrix3.pngbin236 -> 270 bytes
-rw-r--r--editor/icons/icon_mini_transform2D.pngbin0 -> 330 bytes
-rw-r--r--editor/icons/icon_mirror_x.pngbin166 -> 247 bytes
-rw-r--r--editor/icons/icon_mirror_y.pngbin168 -> 277 bytes
-rw-r--r--editor/icons/icon_move_down.pngbin268 -> 309 bytes
-rw-r--r--editor/icons/icon_move_up.pngbin269 -> 296 bytes
-rw-r--r--editor/icons/icon_multi_script.pngbin0 -> 318 bytes
-rw-r--r--editor/icons/icon_native_script.pngbin0 -> 392 bytes
-rw-r--r--editor/icons/icon_new.pngbin157 -> 203 bytes
-rw-r--r--editor/icons/icon_nine_patch_rect.pngbin128 -> 142 bytes
-rw-r--r--editor/icons/icon_open.pngbin170 -> 271 bytes
-rw-r--r--editor/icons/icon_option_arrow.pngbin0 -> 205 bytes
-rw-r--r--editor/icons/icon_option_button.pngbin218 -> 324 bytes
-rw-r--r--editor/icons/icon_panorama_sky.pngbin0 -> 354 bytes
-rw-r--r--editor/icons/icon_particles_material.pngbin0 -> 367 bytes
-rw-r--r--editor/icons/icon_plane_mesh.pngbin0 -> 328 bytes
-rw-r--r--editor/icons/icon_play_button_group.pngbin0 -> 427 bytes
-rw-r--r--editor/icons/icon_prism_mesh.pngbin0 -> 448 bytes
-rw-r--r--editor/icons/icon_procedural_sky.pngbin0 -> 339 bytes
-rw-r--r--editor/icons/icon_quad_mesh.pngbin0 -> 244 bytes
-rw-r--r--editor/icons/icon_reference_rect.pngbin128 -> 141 bytes
-rw-r--r--editor/icons/icon_remote_transform.pngbin530 -> 506 bytes
-rw-r--r--editor/icons/icon_remote_transform_2d.pngbin552 -> 542 bytes
-rw-r--r--editor/icons/icon_scroll_bg.pngbin0 -> 90 bytes
-rw-r--r--editor/icons/icon_scroll_grabber.pngbin0 -> 147 bytes
-rw-r--r--editor/icons/icon_scroll_grabber_hl.pngbin0 -> 268 bytes
-rw-r--r--editor/icons/icon_search.pngbin0 -> 404 bytes
-rw-r--r--editor/icons/icon_slider_grabber.pngbin0 -> 384 bytes
-rw-r--r--editor/icons/icon_slider_grabber_hl.pngbin0 -> 354 bytes
-rw-r--r--editor/icons/icon_slider_joint.pngbin150 -> 247 bytes
-rw-r--r--editor/icons/icon_spatial_material.pngbin0 -> 483 bytes
-rw-r--r--editor/icons/icon_sphere_mesh.pngbin0 -> 495 bytes
-rw-r--r--editor/icons/icon_spinbox_updown.pngbin0 -> 345 bytes
-rw-r--r--editor/icons/icon_stream_texture.pngbin0 -> 180 bytes
-rw-r--r--editor/icons/icon_tab_menu.pngbin251 -> 146 bytes
-rw-r--r--editor/icons/icon_tabs.pngbin146 -> 232 bytes
-rw-r--r--editor/icons/icon_texture_rect.pngbin158 -> 166 bytes
-rw-r--r--editor/icons/icon_timer.pngbin447 -> 378 bytes
-rw-r--r--editor/icons/icon_tool_button.pngbin263 -> 400 bytes
-rw-r--r--editor/icons/icon_tools.pngbin392 -> 298 bytes
-rw-r--r--editor/icons/icon_tree.pngbin243 -> 151 bytes
-rw-r--r--editor/icons/icon_tree_arrow_down.pngbin0 -> 170 bytes
-rw-r--r--editor/icons/icon_tree_arrow_right.pngbin0 -> 189 bytes
-rw-r--r--editor/icons/icon_tween.pngbin248 -> 247 bytes
-rw-r--r--editor/icons/icon_unchecked.pngbin0 -> 267 bytes
-rw-r--r--editor/icons/icon_v_button_array.pngbin147 -> 278 bytes
-rw-r--r--editor/icons/icon_v_scroll_bar.pngbin218 -> 416 bytes
-rw-r--r--editor/icons/icon_v_slider.pngbin231 -> 244 bytes
-rw-r--r--editor/icons/icon_variant.pngbin240 -> 237 bytes
-rw-r--r--editor/icons/icon_video_player.pngbin302 -> 241 bytes
-rw-r--r--editor/icons/icon_visual_script.pngbin388 -> 386 bytes
-rw-r--r--editor/icons/icon_vslider_bg.pngbin0 -> 236 bytes
-rw-r--r--editor/icons/icon_vsplit_bg.pngbin0 -> 96 bytes
-rw-r--r--editor/icons/icon_vsplitter.pngbin0 -> 122 bytes
-rw-r--r--editor/icons/icon_warning.pngbin120 -> 204 bytes
-rw-r--r--editor/icons/icon_world_environment.pngbin578 -> 534 bytes
-rw-r--r--editor/icons/icon_zoom.pngbin404 -> 410 bytes
-rw-r--r--editor/icons/source/icon_2_d.svg93
-rw-r--r--editor/icons/source/icon_3_d.svg105
-rw-r--r--editor/icons/source/icon_GUI_checked.svg79
-rw-r--r--editor/icons/source/icon_GUI_dropdown.svg93
-rw-r--r--editor/icons/source/icon_GUI_hslider_bg.svg83
-rw-r--r--editor/icons/source/icon_GUI_hsplitter.svg79
-rw-r--r--editor/icons/source/icon_GUI_mini_tab_menu.svg93
-rw-r--r--editor/icons/source/icon_GUI_option_arrow.svg80
-rw-r--r--editor/icons/source/icon_GUI_play_button_group.svg78
-rw-r--r--editor/icons/source/icon_GUI_progress_bar.svg81
-rw-r--r--editor/icons/source/icon_GUI_progress_fill.svg83
-rw-r--r--editor/icons/source/icon_GUI_radio_checked.svg87
-rw-r--r--editor/icons/source/icon_GUI_radio_unchecked.svg81
-rw-r--r--editor/icons/source/icon_GUI_scroll_bg.svg71
-rw-r--r--editor/icons/source/icon_GUI_scroll_grabber.svg78
-rw-r--r--editor/icons/source/icon_GUI_scroll_grabber_hl.svg82
-rw-r--r--editor/icons/source/icon_GUI_scroll_grabber_pressed.svg83
-rw-r--r--editor/icons/source/icon_GUI_slider_grabber.svg81
-rw-r--r--editor/icons/source/icon_GUI_slider_grabber_hl.svg86
-rw-r--r--editor/icons/source/icon_GUI_spinbox_updown.svg83
-rw-r--r--editor/icons/source/icon_GUI_tab_menu.svg92
-rw-r--r--editor/icons/source/icon_GUI_toggle_off.svg80
-rw-r--r--editor/icons/source/icon_GUI_toggle_on.svg80
-rw-r--r--editor/icons/source/icon_GUI_tree_arrow_down.svg80
-rw-r--r--editor/icons/source/icon_GUI_tree_arrow_right.svg80
-rw-r--r--editor/icons/source/icon_GUI_unchecked.svg77
-rw-r--r--editor/icons/source/icon_GUI_vslider_bg.svg83
-rw-r--r--editor/icons/source/icon_GUI_vsplit_bg.svg79
-rw-r--r--editor/icons/source/icon_GUI_vsplitter.svg79
-rw-r--r--editor/icons/source/icon_animation_player.svg16
-rw-r--r--editor/icons/source/icon_animation_tree_player.svg20
-rw-r--r--editor/icons/source/icon_arrow_left.svg25
-rw-r--r--editor/icons/source/icon_arrow_right.svg26
-rw-r--r--editor/icons/source/icon_arrow_up.svg16
-rw-r--r--editor/icons/source/icon_asset_lib.svg80
-rw-r--r--editor/icons/source/icon_audio_bus_bypass.svg295
-rw-r--r--editor/icons/source/icon_audio_bus_layout.svg107
-rw-r--r--editor/icons/source/icon_audio_bus_mute.svg301
-rw-r--r--editor/icons/source/icon_audio_bus_solo.svg315
-rw-r--r--editor/icons/source/icon_audio_effect_amplify.svg110
-rw-r--r--editor/icons/source/icon_audio_stream_player.svg113
-rw-r--r--editor/icons/source/icon_audio_stream_player_2_d.svg114
-rw-r--r--editor/icons/source/icon_audio_stream_player_3_d.svg114
-rw-r--r--editor/icons/source/icon_audio_stream_sample.svg108
-rw-r--r--editor/icons/source/icon_back.svg21
-rw-r--r--editor/icons/source/icon_baked_light.svg10
-rw-r--r--editor/icons/source/icon_bit_map.svg12
-rw-r--r--editor/icons/source/icon_bool.svg80
-rw-r--r--editor/icons/source/icon_bus_vu_db.svg111
-rw-r--r--editor/icons/source/icon_bus_vu_empty.svg115
-rw-r--r--editor/icons/source/icon_bus_vu_frozen.svg111
-rw-r--r--editor/icons/source/icon_bus_vu_full.svg110
-rw-r--r--editor/icons/source/icon_button.svg66
-rw-r--r--editor/icons/source/icon_button_group.svg118
-rw-r--r--editor/icons/source/icon_capsule_mesh.svg93
-rw-r--r--editor/icons/source/icon_color_rect.svg44
-rw-r--r--editor/icons/source/icon_confirmation_dialog.svg16
-rw-r--r--editor/icons/source/icon_connect.svg46
-rw-r--r--editor/icons/source/icon_copy_node_path.svg14
-rw-r--r--editor/icons/source/icon_cube_mesh.svg87
-rw-r--r--editor/icons/source/icon_curve.svg (renamed from editor/icons/source/icon_sample_player_2d.svg)27
-rw-r--r--editor/icons/source/icon_curve_texture.svg81
-rw-r--r--editor/icons/source/icon_cylinder_mesh.svg89
-rw-r--r--editor/icons/source/icon_debug.svg143
-rw-r--r--editor/icons/source/icon_edit_resource.svg18
-rw-r--r--editor/icons/source/icon_editor_control_anchor.svg98
-rw-r--r--editor/icons/source/icon_environment.svg41
-rw-r--r--editor/icons/source/icon_error.svg14
-rw-r--r--editor/icons/source/icon_file_big.svg28
-rw-r--r--editor/icons/source/icon_file_dialog.svg20
-rw-r--r--editor/icons/source/icon_forward.svg19
-rw-r--r--editor/icons/source/icon_g_d_native_library.svg83
-rw-r--r--editor/icons/source/icon_godot.svg164
-rw-r--r--editor/icons/source/icon_gradient.svg (renamed from editor/icons/source/icon_image_sky_box.svg)139
-rw-r--r--editor/icons/source/icon_gradient_texture.svg (renamed from editor/icons/source/icon_texture.svg)37
-rw-r--r--editor/icons/source/icon_graph_scalars_to_vec.svg58
-rw-r--r--editor/icons/source/icon_graph_vec_to_scalars.svg55
-rw-r--r--editor/icons/source/icon_graph_vecs_to_xform.svg45
-rw-r--r--editor/icons/source/icon_graph_xform_to_vecs.svg45
-rw-r--r--editor/icons/source/icon_grid_map.svg82
-rw-r--r--editor/icons/source/icon_gui_close_dark.svg79
-rw-r--r--editor/icons/source/icon_gui_close_light.svg79
-rw-r--r--editor/icons/source/icon_h_button_array.svg54
-rw-r--r--editor/icons/source/icon_h_scroll_bar.svg32
-rw-r--r--editor/icons/source/icon_h_slider.svg65
-rw-r--r--editor/icons/source/icon_help.svg50
-rw-r--r--editor/icons/source/icon_help_search.svg91
-rw-r--r--editor/icons/source/icon_key_hover.svg28
-rw-r--r--editor/icons/source/icon_key_selected.svg26
-rw-r--r--editor/icons/source/icon_key_value.svg26
-rw-r--r--editor/icons/source/icon_key_xform.svg26
-rw-r--r--editor/icons/source/icon_line_edit.svg30
-rw-r--r--editor/icons/source/icon_mini_basis.svg204
-rw-r--r--editor/icons/source/icon_mini_matrix3.svg176
-rw-r--r--editor/icons/source/icon_mini_transform2D.svg (renamed from editor/icons/source/icon_mini_matrix32.svg)86
-rw-r--r--editor/icons/source/icon_mirror_x.svg34
-rw-r--r--editor/icons/source/icon_mirror_y.svg21
-rw-r--r--editor/icons/source/icon_move_down.svg25
-rw-r--r--editor/icons/source/icon_move_up.svg27
-rw-r--r--editor/icons/source/icon_multi_script.svg83
-rw-r--r--editor/icons/source/icon_native_script.svg77
-rw-r--r--editor/icons/source/icon_new.svg26
-rw-r--r--editor/icons/source/icon_nine_patch_rect.svg44
-rw-r--r--editor/icons/source/icon_option_button.svg18
-rw-r--r--editor/icons/source/icon_panorama_sky.svg131
-rw-r--r--editor/icons/source/icon_particles_material.svg (renamed from editor/icons/source/icon_particles_shader.svg)0
-rw-r--r--editor/icons/source/icon_patch_9_rect.svg130
-rw-r--r--editor/icons/source/icon_plane_mesh.svg (renamed from editor/icons/source/icon_sample_player.svg)21
-rw-r--r--editor/icons/source/icon_prism_mesh.svg79
-rw-r--r--editor/icons/source/icon_procedural_sky.svg129
-rw-r--r--editor/icons/source/icon_quad_mesh.svg79
-rw-r--r--editor/icons/source/icon_reference_rect.svg84
-rw-r--r--editor/icons/source/icon_remote_transform.svg94
-rw-r--r--editor/icons/source/icon_remote_transform_2d.svg88
-rw-r--r--editor/icons/source/icon_sample.svg128
-rw-r--r--editor/icons/source/icon_search.svg87
-rw-r--r--editor/icons/source/icon_slider_joint.svg45
-rw-r--r--editor/icons/source/icon_spatial_material.svg (renamed from editor/icons/source/icon_spatial_shader.svg)0
-rw-r--r--editor/icons/source/icon_sphere_mesh.svg79
-rw-r--r--editor/icons/source/icon_stream_texture.svg81
-rw-r--r--editor/icons/source/icon_tabs.svg83
-rw-r--r--editor/icons/source/icon_texture_rect.svg43
-rw-r--r--editor/icons/source/icon_timer.svg69
-rw-r--r--editor/icons/source/icon_tool_button.svg66
-rw-r--r--editor/icons/source/icon_tools.svg22
-rw-r--r--editor/icons/source/icon_tree.svg83
-rw-r--r--editor/icons/source/icon_tween.svg33
-rw-r--r--editor/icons/source/icon_v_button_array.svg47
-rw-r--r--editor/icons/source/icon_v_scroll_bar.svg35
-rw-r--r--editor/icons/source/icon_v_slider.svg52
-rw-r--r--editor/icons/source/icon_variant.svg146
-rw-r--r--editor/icons/source/icon_video_player.svg49
-rw-r--r--editor/icons/source/icon_visual_script.svg28
-rw-r--r--editor/icons/source/icon_warning.svg10
-rw-r--r--editor/icons/source/icon_world_environment.svg59
-rw-r--r--editor/icons/source/icon_zoom.svg30
-rw-r--r--editor/import/editor_import_collada.cpp96
-rw-r--r--editor/import/editor_import_collada.h1
-rw-r--r--editor/import/editor_import_plugin.cpp152
-rw-r--r--editor/import/editor_import_plugin.h (renamed from scene/3d/quad.h)59
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp2108
-rw-r--r--editor/import/editor_scene_importer_gltf.h304
-rw-r--r--editor/import/resource_importer_csv_translation.cpp5
-rw-r--r--editor/import/resource_importer_csv_translation.h1
-rw-r--r--editor/import/resource_importer_obj.cpp350
-rw-r--r--editor/import/resource_importer_obj.h26
-rw-r--r--editor/import/resource_importer_scene.cpp177
-rw-r--r--editor/import/resource_importer_scene.h17
-rw-r--r--editor/import/resource_importer_texture.cpp160
-rw-r--r--editor/import/resource_importer_texture.h9
-rw-r--r--editor/import/resource_importer_wav.cpp72
-rw-r--r--editor/import/resource_importer_wav.h1
-rw-r--r--editor/import_dock.cpp71
-rw-r--r--editor/import_dock.h8
-rw-r--r--editor/inspector_dock.cpp1
-rw-r--r--editor/inspector_dock.h1
-rw-r--r--editor/io_plugins/editor_atlas.cpp1
-rw-r--r--editor/io_plugins/editor_atlas.h1
-rw-r--r--editor/io_plugins/editor_bitmask_import_plugin.cpp1
-rw-r--r--editor/io_plugins/editor_bitmask_import_plugin.h1
-rw-r--r--editor/io_plugins/editor_export_scene.cpp5
-rw-r--r--editor/io_plugins/editor_export_scene.h1
-rw-r--r--editor/io_plugins/editor_font_import_plugin.cpp15
-rw-r--r--editor/io_plugins/editor_font_import_plugin.h1
-rw-r--r--editor/io_plugins/editor_mesh_import_plugin.cpp3
-rw-r--r--editor/io_plugins/editor_mesh_import_plugin.h1
-rw-r--r--editor/io_plugins/editor_sample_import_plugin.cpp7
-rw-r--r--editor/io_plugins/editor_sample_import_plugin.h1
-rw-r--r--editor/io_plugins/editor_scene_import_plugin.cpp75
-rw-r--r--editor/io_plugins/editor_scene_import_plugin.h1
-rw-r--r--editor/io_plugins/editor_scene_importer_fbxconv.cpp25
-rw-r--r--editor/io_plugins/editor_scene_importer_fbxconv.h1
-rw-r--r--editor/io_plugins/editor_texture_import_plugin.cpp17
-rw-r--r--editor/io_plugins/editor_texture_import_plugin.h1
-rw-r--r--editor/io_plugins/editor_translation_import_plugin.cpp5
-rw-r--r--editor/io_plugins/editor_translation_import_plugin.h1
-rw-r--r--editor/multi_node_edit.cpp1
-rw-r--r--editor/multi_node_edit.h1
-rw-r--r--editor/node_dock.cpp1
-rw-r--r--editor/node_dock.h1
-rw-r--r--editor/output_strings.cpp7
-rw-r--r--editor/output_strings.h1
-rw-r--r--editor/pane_drag.cpp8
-rw-r--r--editor/pane_drag.h5
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp49
-rw-r--r--editor/plugins/animation_player_editor_plugin.h12
-rw-r--r--editor/plugins/animation_tree_editor_plugin.cpp288
-rw-r--r--editor/plugins/animation_tree_editor_plugin.h9
-rw-r--r--editor/plugins/baked_light_baker.cpp11
-rw-r--r--editor/plugins/baked_light_baker.h3
-rw-r--r--editor/plugins/baked_light_baker_cmpxchg.cpp1
-rw-r--r--editor/plugins/baked_light_editor_plugin.cpp1
-rw-r--r--editor/plugins/baked_light_editor_plugin.h1
-rw-r--r--editor/plugins/camera_editor_plugin.cpp3
-rw-r--r--editor/plugins/camera_editor_plugin.h5
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp1164
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h36
-rw-r--r--editor/plugins/collision_polygon_2d_editor_plugin.cpp288
-rw-r--r--editor/plugins/collision_polygon_2d_editor_plugin.h9
-rw-r--r--editor/plugins/collision_polygon_editor_plugin.cpp639
-rw-r--r--editor/plugins/collision_polygon_editor_plugin.h27
-rw-r--r--editor/plugins/collision_shape_2d_editor_plugin.cpp91
-rw-r--r--editor/plugins/collision_shape_2d_editor_plugin.h5
-rw-r--r--editor/plugins/cube_grid_theme_editor_plugin.cpp346
-rw-r--r--editor/plugins/cube_grid_theme_editor_plugin.h19
-rw-r--r--editor/plugins/curve_editor_plugin.cpp920
-rw-r--r--editor/plugins/curve_editor_plugin.h153
-rw-r--r--editor/plugins/editor_preview_plugins.cpp543
-rw-r--r--editor/plugins/editor_preview_plugins.h61
-rw-r--r--editor/plugins/gi_probe_editor_plugin.cpp1
-rw-r--r--editor/plugins/gi_probe_editor_plugin.h5
-rw-r--r--editor/plugins/gradient_editor_plugin.cpp (renamed from editor/plugins/color_ramp_editor_plugin.cpp)52
-rw-r--r--editor/plugins/gradient_editor_plugin.h (renamed from editor/plugins/color_ramp_editor_plugin.h)22
-rw-r--r--editor/plugins/item_list_editor_plugin.cpp41
-rw-r--r--editor/plugins/item_list_editor_plugin.h42
-rw-r--r--editor/plugins/light_occluder_2d_editor_plugin.cpp303
-rw-r--r--editor/plugins/light_occluder_2d_editor_plugin.h9
-rw-r--r--editor/plugins/line_2d_editor_plugin.cpp132
-rw-r--r--editor/plugins/line_2d_editor_plugin.h9
-rw-r--r--editor/plugins/material_editor_plugin.cpp1
-rw-r--r--editor/plugins/material_editor_plugin.h1
-rw-r--r--editor/plugins/mesh_editor_plugin.cpp166
-rw-r--r--editor/plugins/mesh_editor_plugin.h28
-rw-r--r--editor/plugins/mesh_instance_editor_plugin.cpp3
-rw-r--r--editor/plugins/mesh_instance_editor_plugin.h5
-rw-r--r--editor/plugins/multimesh_editor_plugin.cpp3
-rw-r--r--editor/plugins/multimesh_editor_plugin.h5
-rw-r--r--editor/plugins/navigation_polygon_editor_plugin.cpp362
-rw-r--r--editor/plugins/navigation_polygon_editor_plugin.h9
-rw-r--r--editor/plugins/particles_2d_editor_plugin.cpp309
-rw-r--r--editor/plugins/particles_2d_editor_plugin.h23
-rw-r--r--editor/plugins/particles_editor_plugin.cpp394
-rw-r--r--editor/plugins/particles_editor_plugin.h29
-rw-r--r--editor/plugins/path_2d_editor_plugin.cpp518
-rw-r--r--editor/plugins/path_2d_editor_plugin.h9
-rw-r--r--editor/plugins/path_editor_plugin.cpp432
-rw-r--r--editor/plugins/path_editor_plugin.h41
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp338
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.h11
-rw-r--r--editor/plugins/resource_preloader_editor_plugin.cpp7
-rw-r--r--editor/plugins/resource_preloader_editor_plugin.h7
-rw-r--r--editor/plugins/rich_text_editor_plugin.cpp1
-rw-r--r--editor/plugins/rich_text_editor_plugin.h5
-rw-r--r--editor/plugins/sample_editor_plugin.cpp15
-rw-r--r--editor/plugins/sample_editor_plugin.h1
-rw-r--r--editor/plugins/sample_library_editor_plugin.cpp11
-rw-r--r--editor/plugins/sample_library_editor_plugin.h1
-rw-r--r--editor/plugins/sample_player_editor_plugin.cpp19
-rw-r--r--editor/plugins/sample_player_editor_plugin.h1
-rw-r--r--editor/plugins/script_editor_plugin.cpp552
-rw-r--r--editor/plugins/script_editor_plugin.h60
-rw-r--r--editor/plugins/script_text_editor.cpp253
-rw-r--r--editor/plugins/script_text_editor.h22
-rw-r--r--editor/plugins/shader_editor_plugin.cpp42
-rw-r--r--editor/plugins/shader_editor_plugin.h9
-rw-r--r--editor/plugins/shader_graph_editor_plugin.cpp37
-rw-r--r--editor/plugins/shader_graph_editor_plugin.h1
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp2533
-rw-r--r--editor/plugins/spatial_editor_plugin.h121
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp7
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.h7
-rw-r--r--editor/plugins/stream_editor_plugin.cpp3
-rw-r--r--editor/plugins/stream_editor_plugin.h1
-rw-r--r--editor/plugins/style_box_editor_plugin.cpp5
-rw-r--r--editor/plugins/style_box_editor_plugin.h1
-rw-r--r--editor/plugins/texture_editor_plugin.cpp35
-rw-r--r--editor/plugins/texture_editor_plugin.h8
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp184
-rw-r--r--editor/plugins/texture_region_editor_plugin.h7
-rw-r--r--editor/plugins/theme_editor_plugin.cpp74
-rw-r--r--editor/plugins/theme_editor_plugin.h4
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp771
-rw-r--r--editor/plugins/tile_map_editor_plugin.h12
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp72
-rw-r--r--editor/plugins/tile_set_editor_plugin.h2
-rw-r--r--editor/progress_dialog.cpp1
-rw-r--r--editor/progress_dialog.h1
-rw-r--r--editor/project_export.cpp97
-rw-r--r--editor/project_export.h11
-rw-r--r--editor/project_manager.cpp163
-rw-r--r--editor/project_manager.h6
-rw-r--r--editor/project_settings_editor.cpp (renamed from editor/project_settings.cpp)855
-rw-r--r--editor/project_settings_editor.h (renamed from editor/project_settings.h)37
-rw-r--r--editor/property_editor.cpp462
-rw-r--r--editor/property_editor.h28
-rw-r--r--editor/property_selector.cpp51
-rw-r--r--editor/property_selector.h6
-rw-r--r--editor/pvrtc_compress.cpp5
-rw-r--r--editor/pvrtc_compress.h1
-rw-r--r--editor/quick_open.cpp10
-rw-r--r--editor/quick_open.h3
-rw-r--r--editor/register_exporters.h1
-rw-r--r--editor/reparent_dialog.cpp3
-rw-r--r--editor/reparent_dialog.h1
-rw-r--r--editor/resources_dock.cpp7
-rw-r--r--editor/resources_dock.h3
-rw-r--r--editor/run_settings_dialog.cpp1
-rw-r--r--editor/run_settings_dialog.h1
-rw-r--r--editor/scene_tree_dock.cpp236
-rw-r--r--editor/scene_tree_dock.h26
-rw-r--r--editor/scene_tree_editor.cpp213
-rw-r--r--editor/scene_tree_editor.h17
-rw-r--r--editor/script_create_dialog.cpp642
-rw-r--r--editor/script_create_dialog.h30
-rw-r--r--editor/script_editor_debugger.cpp133
-rw-r--r--editor/script_editor_debugger.h10
-rw-r--r--editor/settings_config_dialog.cpp51
-rw-r--r--editor/settings_config_dialog.h5
-rw-r--r--editor/spatial_editor_gizmos.cpp519
-rw-r--r--editor/spatial_editor_gizmos.h136
-rw-r--r--editor/translations/ar.po922
-rw-r--r--editor/translations/bg.po941
-rw-r--r--editor/translations/bn.po1195
-rw-r--r--editor/translations/ca.po1005
-rw-r--r--editor/translations/cs.po1070
-rw-r--r--editor/translations/da.po937
-rw-r--r--editor/translations/de.po1252
-rw-r--r--editor/translations/de_CH.po969
-rw-r--r--editor/translations/editor.pot894
-rw-r--r--editor/translations/el.po7433
-rw-r--r--editor/translations/es.po1196
-rw-r--r--editor/translations/es_AR.po1383
-rwxr-xr-xeditor/translations/extract.py3
-rw-r--r--editor/translations/fa.po952
-rw-r--r--editor/translations/fi.po7260
-rw-r--r--editor/translations/fr.po1433
-rw-r--r--editor/translations/hu.po891
-rw-r--r--editor/translations/id.po974
-rw-r--r--editor/translations/it.po1368
-rw-r--r--editor/translations/ja.po963
-rw-r--r--editor/translations/ko.po1176
-rw-r--r--editor/translations/nb.po1046
-rw-r--r--editor/translations/nl.po7254
-rw-r--r--editor/translations/pl.po1748
-rw-r--r--editor/translations/pr.po1048
-rw-r--r--editor/translations/pt_BR.po1228
-rw-r--r--editor/translations/pt_PT.po905
-rw-r--r--editor/translations/ru.po1504
-rw-r--r--editor/translations/sk.po903
-rw-r--r--editor/translations/sl.po905
-rw-r--r--editor/translations/th.po7477
-rw-r--r--editor/translations/tr.po1200
-rw-r--r--editor/translations/ur_PK.po897
-rw-r--r--editor/translations/zh_CN.po1832
-rw-r--r--editor/translations/zh_HK.po963
-rw-r--r--editor/translations/zh_TW.po1221
-rw-r--r--icon.pngbin12675 -> 11155 bytes
-rw-r--r--icon.svg161
-rw-r--r--logo.pngbin2486 -> 19339 bytes
-rw-r--r--logo.svg335
-rw-r--r--main/SCsub46
-rw-r--r--main/app_icon.pngbin0 -> 5569 bytes
-rw-r--r--main/input_default.cpp355
-rw-r--r--main/input_default.h21
-rw-r--r--main/main.cpp294
-rw-r--r--main/main.h1
-rw-r--r--main/performance.cpp7
-rw-r--r--main/performance.h1
-rw-r--r--main/splash.h1423
-rw-r--r--main/splash.pngbin0 -> 29867 bytes
-rw-r--r--main/tests/test_containers.cpp13
-rw-r--r--main/tests/test_containers.h1
-rw-r--r--main/tests/test_gdscript.cpp13
-rw-r--r--main/tests/test_gdscript.h1
-rw-r--r--main/tests/test_gui.cpp50
-rw-r--r--main/tests/test_gui.h1
-rw-r--r--main/tests/test_image.cpp8
-rw-r--r--main/tests/test_image.h1
-rw-r--r--main/tests/test_io.cpp11
-rw-r--r--main/tests/test_io.h1
-rw-r--r--main/tests/test_main.cpp1
-rw-r--r--main/tests/test_main.h1
-rw-r--r--main/tests/test_math.cpp56
-rw-r--r--main/tests/test_math.h1
-rw-r--r--main/tests/test_physics.cpp29
-rw-r--r--main/tests/test_physics.h1
-rw-r--r--main/tests/test_physics_2d.cpp36
-rw-r--r--main/tests/test_physics_2d.h1
-rw-r--r--main/tests/test_render.cpp5
-rw-r--r--main/tests/test_render.h1
-rw-r--r--main/tests/test_shader_lang.cpp5
-rw-r--r--main/tests/test_shader_lang.h1
-rw-r--r--main/tests/test_sound.cpp1
-rw-r--r--main/tests/test_sound.h1
-rw-r--r--main/tests/test_string.cpp1
-rw-r--r--main/tests/test_string.h1
-rw-r--r--methods.py191
-rw-r--r--misc/dist/html_fs/godotfs.js12
-rw-r--r--misc/dist/ios_xcode/data.pck (renamed from misc/dist/ios_xcode/godot_xcode/data.pck)0
-rwxr-xr-xmisc/dist/ios_xcode/godot_debug.iphone (renamed from misc/dist/ios_xcode/godot_xcode/godot_debug.iphone)0
-rw-r--r--misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.pbxproj)0
-rw-r--r--misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata)0
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-568h@2x~iphone.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default-568h@2x~iphone.png)bin564 -> 564 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-667h.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h.png)bin683 -> 683 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-667h@2x.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h@2x.png)bin817 -> 817 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-736h.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h.png)bin1676 -> 1676 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-736h@3x.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h@3x.png)bin2582 -> 2582 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Landscape-736h.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape-736h.png)bin2582 -> 2582 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Landscape@2x~ipad.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape@2x~ipad.png)bin3131 -> 3131 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Landscape~ipad.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape~ipad.png)bin634 -> 634 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Portrait@2x~ipad.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait@2x~ipad.png)bin3070 -> 3070 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Portrait~ipad.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait~ipad.png)bin589 -> 589 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default@2x~iphone.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default@2x~iphone.png)bin515 -> 515 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default~iphone.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Default~iphone.png)bin309 -> 309 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json)0
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png)bin250 -> 250 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png)bin253 -> 253 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png)bin253 -> 253 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png)bin259 -> 259 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png)bin260 -> 260 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png)bin265 -> 265 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png)bin242 -> 242 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png)bin240 -> 240 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png)bin243 -> 243 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png)bin243 -> 243 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png)bin243 -> 243 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png)bin244 -> 244 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png)bin244 -> 244 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png)bin246 -> 246 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png)bin245 -> 245 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png)bin262 -> 262 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png)bin247 -> 247 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes)0
-rw-r--r--misc/dist/ios_xcode/godot_ios/en.lproj/InfoPlist.strings (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/en.lproj/InfoPlist.strings)0
-rw-r--r--misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/godot_ios-Info.plist)0
-rw-r--r--misc/dist/ios_xcode/godot_ios/main.m (renamed from misc/dist/ios_xcode/godot_xcode/godot_ios/main.m)10
-rwxr-xr-xmisc/dist/ios_xcode/godot_opt.iphone (renamed from misc/dist/ios_xcode/godot_xcode/godot_opt.iphone)0
-rw-r--r--misc/dist/osx_template.app/Contents/Resources/icon.icnsbin120942 -> 67500 bytes
-rw-r--r--misc/dist/osx_tools.app/Contents/Resources/Godot.icnsbin120942 -> 67500 bytes
-rw-r--r--misc/dist/project_icon.svg138
-rw-r--r--misc/dist/uwp_template/Assets/Square150x150Logo.scale-100.pngbin7001 -> 5645 bytes
-rw-r--r--misc/dist/uwp_template/Assets/Square310x310Logo.scale-100.pngbin14490 -> 16169 bytes
-rw-r--r--misc/dist/uwp_template/Assets/Square44x44Logo.scale-100.pngbin2067 -> 1619 bytes
-rw-r--r--misc/dist/uwp_template/Assets/Square71x71Logo.scale-100.pngbin3369 -> 2483 bytes
-rw-r--r--misc/dist/uwp_template/Assets/StoreLogo.scale-100.pngbin2339 -> 1792 bytes
-rw-r--r--misc/dist/uwp_template/Assets/Wide310x150Logo.scale-100.pngbin7390 -> 6772 bytes
-rwxr-xr-xmisc/hooks/pre-commit-clang-format7
-rw-r--r--misc/scripts/addheader.py1
-rw-r--r--misc/scripts/makeargs.py12
-rw-r--r--misc/scripts/sort-demos.sh4
-rw-r--r--misc/scripts/svgs_2_pngs.py6
-rwxr-xr-xmisc/travis/clang-format.sh2
-rw-r--r--modules/SCsub2
-rw-r--r--modules/cscript/godot_c.h567
-rw-r--r--modules/dds/register_types.cpp1
-rw-r--r--modules/dds/register_types.h1
-rw-r--r--modules/dds/texture_loader_dds.cpp15
-rw-r--r--modules/dds/texture_loader_dds.h1
-rw-r--r--modules/enet/networked_multiplayer_enet.cpp14
-rw-r--r--modules/enet/networked_multiplayer_enet.h6
-rw-r--r--modules/enet/register_types.cpp1
-rw-r--r--modules/enet/register_types.h1
-rw-r--r--modules/etc/SCsub37
-rw-r--r--modules/etc/config.py11
-rw-r--r--modules/etc/image_etc.cpp203
-rw-r--r--modules/etc/image_etc.h (renamed from modules/etc1/image_etc.h)3
-rw-r--r--modules/etc/register_types.cpp (renamed from modules/etc1/register_types.cpp)7
-rw-r--r--modules/etc/register_types.h (renamed from modules/etc1/register_types.h)5
-rw-r--r--modules/etc/texture_loader_pkm.cpp (renamed from modules/etc1/texture_loader_pkm.cpp)3
-rw-r--r--modules/etc/texture_loader_pkm.h (renamed from modules/etc1/texture_loader_pkm.h)1
-rw-r--r--modules/etc1/SCsub20
-rw-r--r--modules/etc1/image_etc.cpp181
-rw-r--r--modules/freetype/SCsub7
-rw-r--r--modules/freetype/register_types.cpp1
-rw-r--r--modules/freetype/register_types.h1
-rw-r--r--modules/freetype/uwpdef.h1
-rw-r--r--modules/gdnative/SCsub13
-rw-r--r--modules/gdnative/config.py8
-rw-r--r--modules/gdnative/gdnative.cpp340
-rw-r--r--modules/gdnative/gdnative.h144
-rw-r--r--modules/gdnative/godot/array.cpp309
-rw-r--r--modules/gdnative/godot/array.h122
-rw-r--r--modules/gdnative/godot/basis.cpp272
-rw-r--r--modules/gdnative/godot/basis.h121
-rw-r--r--modules/gdnative/godot/color.cpp182
-rw-r--r--modules/gdnative/godot/color.h96
-rw-r--r--modules/gdnative/godot/dictionary.cpp155
-rw-r--r--modules/gdnative/godot/dictionary.h89
-rw-r--r--modules/gdnative/godot/gdnative.cpp190
-rw-r--r--modules/gdnative/godot/gdnative.h303
-rw-r--r--modules/gdnative/godot/icon.png.import23
-rw-r--r--modules/gdnative/godot/node_path.cpp116
-rw-r--r--modules/gdnative/godot/node_path.h (renamed from platform/osx/context_gl_osx.cpp)89
-rw-r--r--modules/gdnative/godot/plane.cpp178
-rw-r--r--modules/gdnative/godot/plane.h93
-rw-r--r--modules/gdnative/godot/pool_arrays.cpp633
-rw-r--r--modules/gdnative/godot/pool_arrays.h316
-rw-r--r--modules/gdnative/godot/quat.cpp219
-rw-r--r--modules/gdnative/godot/quat.h104
-rw-r--r--modules/gdnative/godot/rect2.cpp157
-rw-r--r--modules/gdnative/godot/rect2.h86
-rw-r--r--modules/gdnative/godot/rect3.cpp219
-rw-r--r--modules/gdnative/godot/rect3.h108
-rw-r--r--modules/gdnative/godot/rid.cpp75
-rw-r--r--modules/gdnative/godot/rid.h (renamed from platform/bb10/payment_service.h)47
-rw-r--r--modules/gdnative/godot/string.cpp1267
-rw-r--r--modules/gdnative/godot/string.h228
-rw-r--r--modules/gdnative/godot/transform.cpp223
-rw-r--r--modules/gdnative/godot/transform.h100
-rw-r--r--modules/gdnative/godot/transform2d.cpp210
-rw-r--r--modules/gdnative/godot/transform2d.h99
-rw-r--r--modules/gdnative/godot/variant.cpp481
-rw-r--r--modules/gdnative/godot/variant.h201
-rw-r--r--modules/gdnative/godot/vector2.cpp297
-rw-r--r--modules/gdnative/godot/vector2.h128
-rw-r--r--modules/gdnative/godot/vector3.cpp304
-rw-r--r--modules/gdnative/godot/vector3.h135
-rw-r--r--modules/gdnative/register_types.cpp101
-rw-r--r--modules/gdnative/register_types.h31
-rw-r--r--modules/gdscript/gd_compiler.cpp3
-rw-r--r--modules/gdscript/gd_compiler.h1
-rw-r--r--modules/gdscript/gd_editor.cpp171
-rw-r--r--modules/gdscript/gd_function.cpp71
-rw-r--r--modules/gdscript/gd_function.h3
-rw-r--r--modules/gdscript/gd_functions.cpp68
-rw-r--r--modules/gdscript/gd_functions.h2
-rw-r--r--modules/gdscript/gd_parser.cpp127
-rw-r--r--modules/gdscript/gd_parser.h4
-rw-r--r--modules/gdscript/gd_script.cpp36
-rw-r--r--modules/gdscript/gd_script.h12
-rw-r--r--modules/gdscript/gd_tokenizer.cpp322
-rw-r--r--modules/gdscript/gd_tokenizer.h5
-rw-r--r--modules/gdscript/register_types.cpp1
-rw-r--r--modules/gdscript/register_types.h1
-rw-r--r--modules/gridmap/grid_map.cpp32
-rw-r--r--modules/gridmap/grid_map.h3
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp227
-rw-r--r--modules/gridmap/grid_map_editor_plugin.h15
-rw-r--r--modules/gridmap/register_types.cpp1
-rw-r--r--modules/gridmap/register_types.h1
-rw-r--r--modules/hdr/SCsub9
-rw-r--r--modules/hdr/config.py (renamed from modules/etc1/config.py)0
-rw-r--r--modules/hdr/image_loader_hdr.cpp161
-rw-r--r--modules/hdr/image_loader_hdr.h (renamed from scene/3d/test_cube.h)24
-rw-r--r--modules/hdr/register_types.cpp (renamed from scene/3d/test_cube.cpp)24
-rw-r--r--modules/hdr/register_types.h (renamed from modules/cscript/register_types.h)5
-rw-r--r--modules/jpg/image_loader_jpegd.cpp12
-rw-r--r--modules/jpg/image_loader_jpegd.h3
-rw-r--r--modules/jpg/register_types.cpp1
-rw-r--r--modules/jpg/register_types.h1
-rw-r--r--modules/nativescript/SCsub10
-rw-r--r--modules/nativescript/api_generator.cpp444
-rw-r--r--modules/nativescript/api_generator.h (renamed from platform/osx/godot_osx.h)15
-rw-r--r--modules/nativescript/config.py8
-rw-r--r--modules/nativescript/godot_nativescript.cpp205
-rw-r--r--modules/nativescript/godot_nativescript.h227
-rw-r--r--modules/nativescript/nativescript.cpp1213
-rw-r--r--modules/nativescript/nativescript.h325
-rw-r--r--modules/nativescript/register_types.cpp118
-rw-r--r--modules/nativescript/register_types.h31
-rw-r--r--modules/ogg/register_types.cpp1
-rw-r--r--modules/ogg/register_types.h1
-rw-r--r--modules/openssl/SCsub11
-rw-r--r--modules/openssl/register_types.cpp1
-rw-r--r--modules/openssl/register_types.h1
-rw-r--r--modules/openssl/stream_peer_openssl.cpp5
-rw-r--r--modules/openssl/stream_peer_openssl.h9
-rw-r--r--modules/opus/audio_stream_opus.cpp1
-rw-r--r--modules/opus/audio_stream_opus.h1
-rw-r--r--modules/opus/register_types.cpp1
-rw-r--r--modules/opus/register_types.h1
-rw-r--r--modules/pbm/bitmap_loader_pbm.cpp1
-rw-r--r--modules/pbm/bitmap_loader_pbm.h1
-rw-r--r--modules/pbm/register_types.cpp1
-rw-r--r--modules/pbm/register_types.h1
-rw-r--r--modules/pvr/register_types.cpp1
-rw-r--r--modules/pvr/register_types.h1
-rw-r--r--modules/pvr/texture_loader_pvr.cpp44
-rw-r--r--modules/pvr/texture_loader_pvr.h1
-rw-r--r--modules/regex/regex.cpp27
-rw-r--r--modules/regex/regex.h1
-rw-r--r--modules/regex/register_types.cpp1
-rw-r--r--modules/regex/register_types.h1
-rw-r--r--modules/register_module_types.h1
-rw-r--r--modules/squish/image_compress_squish.cpp161
-rw-r--r--modules/squish/image_compress_squish.h4
-rw-r--r--modules/squish/register_types.cpp2
-rw-r--r--modules/squish/register_types.h1
-rw-r--r--modules/stb_vorbis/audio_stream_ogg_vorbis.cpp16
-rw-r--r--modules/stb_vorbis/audio_stream_ogg_vorbis.h5
-rw-r--r--modules/stb_vorbis/register_types.cpp1
-rw-r--r--modules/stb_vorbis/register_types.h1
-rw-r--r--modules/stb_vorbis/resource_importer_ogg_vorbis.cpp5
-rw-r--r--modules/stb_vorbis/resource_importer_ogg_vorbis.h1
-rw-r--r--modules/tga/SCsub9
-rw-r--r--modules/tga/config.py (renamed from modules/cscript/config.py)1
-rw-r--r--modules/tga/image_loader_tga.cpp314
-rw-r--r--modules/tga/image_loader_tga.h83
-rw-r--r--modules/tga/register_types.cpp (renamed from platform/bb10/godot_bb10.cpp)24
-rw-r--r--modules/tga/register_types.h (renamed from modules/cscript/register_types.cpp)11
-rw-r--r--modules/theora/register_types.cpp1
-rw-r--r--modules/theora/register_types.h1
-rw-r--r--modules/theora/video_stream_theora.cpp10
-rw-r--r--modules/theora/video_stream_theora.h1
-rw-r--r--modules/tinyexr/SCsub20
-rw-r--r--modules/tinyexr/config.py11
-rw-r--r--modules/tinyexr/image_loader_tinyexr.cpp168
-rw-r--r--modules/tinyexr/image_loader_tinyexr.h46
-rw-r--r--modules/tinyexr/register_types.cpp45
-rw-r--r--modules/tinyexr/register_types.h (renamed from modules/cscript/godot_c.cpp)6
-rw-r--r--modules/visual_script/register_types.cpp4
-rw-r--r--modules/visual_script/register_types.h1
-rw-r--r--modules/visual_script/visual_script.cpp72
-rw-r--r--modules/visual_script/visual_script.h18
-rw-r--r--modules/visual_script/visual_script_builtin_funcs.cpp1
-rw-r--r--modules/visual_script/visual_script_builtin_funcs.h1
-rw-r--r--modules/visual_script/visual_script_editor.cpp405
-rw-r--r--modules/visual_script/visual_script_editor.h31
-rw-r--r--modules/visual_script/visual_script_expression.cpp17
-rw-r--r--modules/visual_script/visual_script_expression.h1
-rw-r--r--modules/visual_script/visual_script_flow_control.cpp331
-rw-r--r--modules/visual_script/visual_script_flow_control.h7
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp477
-rw-r--r--modules/visual_script/visual_script_func_nodes.h41
-rw-r--r--modules/visual_script/visual_script_nodes.cpp316
-rw-r--r--modules/visual_script/visual_script_nodes.h56
-rw-r--r--modules/visual_script/visual_script_yield_nodes.cpp17
-rw-r--r--modules/visual_script/visual_script_yield_nodes.h1
-rw-r--r--modules/vorbis/audio_stream_ogg_vorbis.cpp1
-rw-r--r--modules/vorbis/audio_stream_ogg_vorbis.h1
-rw-r--r--modules/vorbis/register_types.cpp1
-rw-r--r--modules/vorbis/register_types.h1
-rw-r--r--modules/webm/libvpx/SCsub2
-rw-r--r--modules/webm/register_types.cpp1
-rw-r--r--modules/webm/register_types.h1
-rw-r--r--modules/webm/video_stream_webm.cpp8
-rw-r--r--modules/webm/video_stream_webm.h1
-rw-r--r--modules/webp/image_loader_webp.cpp46
-rw-r--r--modules/webp/image_loader_webp.h3
-rw-r--r--modules/webp/register_types.cpp1
-rw-r--r--modules/webp/register_types.h1
-rw-r--r--platform/android/SCsub20
-rw-r--r--platform/android/audio_driver_jandroid.cpp3
-rw-r--r--platform/android/audio_driver_jandroid.h3
-rw-r--r--platform/android/audio_driver_opensl.cpp1
-rw-r--r--platform/android/audio_driver_opensl.h1
-rw-r--r--platform/android/build.gradle.template11
-rw-r--r--platform/android/detect.py182
-rw-r--r--platform/android/dir_access_android.cpp1
-rw-r--r--platform/android/dir_access_android.h1
-rw-r--r--platform/android/dir_access_jandroid.cpp1
-rw-r--r--platform/android/dir_access_jandroid.h3
-rw-r--r--platform/android/export/export.cpp118
-rw-r--r--platform/android/export/export.h1
-rw-r--r--platform/android/file_access_android.cpp1
-rw-r--r--platform/android/file_access_android.h1
-rw-r--r--platform/android/file_access_jandroid.cpp1
-rw-r--r--platform/android/file_access_jandroid.h3
-rw-r--r--platform/android/globals/global_defaults.cpp5
-rw-r--r--platform/android/globals/global_defaults.h1
-rw-r--r--platform/android/godot_android.cpp33
-rw-r--r--platform/android/java/gradle.properties17
-rw-r--r--platform/android/java/gradle/wrapper/gradle-wrapper.jarbin49896 -> 53636 bytes
-rw-r--r--platform/android/java/gradle/wrapper/gradle-wrapper.properties4
-rwxr-xr-xplatform/android/java/gradlew10
-rw-r--r--platform/android/java/res/drawable/icon.pngbin12675 -> 11155 bytes
-rw-r--r--platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.java16
-rw-r--r--platform/android/java/src/com/android/vending/licensing/ILicensingService.java16
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java6
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java4
-rw-r--r--platform/android/java/src/org/godotengine/godot/Dictionary.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/Godot.java3
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotIO.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotLib.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotView.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/input/GodotEditText.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java48
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/utils/Crypt.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java1
-rw-r--r--platform/android/java/src/org/godotengine/godot/utils/RequestParams.java1
-rw-r--r--platform/android/java_class_wrapper.cpp15
-rw-r--r--platform/android/java_class_wrapper.h1
-rw-r--r--platform/android/java_glue.cpp58
-rw-r--r--platform/android/java_glue.h5
-rw-r--r--platform/android/os_android.cpp193
-rw-r--r--platform/android/os_android.h9
-rw-r--r--platform/android/platform_config.h1
-rw-r--r--platform/android/power_android.cpp28
-rw-r--r--platform/android/power_android.h1
-rw-r--r--platform/android/run_icon.pngbin0 -> 636 bytes
-rw-r--r--platform/android/thread_jandroid.cpp7
-rw-r--r--platform/android/thread_jandroid.h5
-rw-r--r--platform/bb10/SCsub23
-rw-r--r--platform/bb10/audio_driver_bb10.cpp253
-rw-r--r--platform/bb10/audio_driver_bb10.h76
-rw-r--r--platform/bb10/bar/bar-descriptor.xml53
-rw-r--r--platform/bb10/bar/icon.pngbin8809 -> 0 bytes
-rw-r--r--platform/bb10/bbutil.c513
-rw-r--r--platform/bb10/bbutil.h72
-rw-r--r--platform/bb10/detect.py92
-rw-r--r--platform/bb10/export/export.cpp828
-rw-r--r--platform/bb10/logo.pngbin1244 -> 0 bytes
-rw-r--r--platform/bb10/os_bb10.cpp613
-rw-r--r--platform/bb10/os_bb10.h154
-rw-r--r--platform/bb10/payment_service.cpp148
-rw-r--r--platform/bb10/platform_config.h29
-rw-r--r--platform/haiku/audio_driver_media_kit.cpp3
-rw-r--r--platform/haiku/audio_driver_media_kit.h1
-rw-r--r--platform/haiku/context_gl_haiku.cpp1
-rw-r--r--platform/haiku/context_gl_haiku.h1
-rw-r--r--platform/haiku/detect.py51
-rw-r--r--platform/haiku/godot_haiku.cpp1
-rw-r--r--platform/haiku/haiku_application.cpp1
-rw-r--r--platform/haiku/haiku_application.h1
-rw-r--r--platform/haiku/haiku_direct_window.cpp81
-rw-r--r--platform/haiku/haiku_direct_window.h2
-rw-r--r--platform/haiku/haiku_gl_view.cpp1
-rw-r--r--platform/haiku/haiku_gl_view.h1
-rw-r--r--platform/haiku/key_mapping_haiku.cpp3
-rw-r--r--platform/haiku/key_mapping_haiku.h1
-rw-r--r--platform/haiku/os_haiku.cpp8
-rw-r--r--platform/haiku/os_haiku.h5
-rw-r--r--platform/haiku/platform_config.h1
-rw-r--r--platform/haiku/power_haiku.cpp1
-rw-r--r--platform/haiku/power_haiku.h1
-rw-r--r--platform/iphone/SCsub10
-rw-r--r--platform/iphone/app_delegate.h1
-rw-r--r--platform/iphone/app_delegate.mm797
-rw-r--r--platform/iphone/audio_driver_iphone.cpp6
-rw-r--r--platform/iphone/audio_driver_iphone.h1
-rw-r--r--platform/iphone/detect.py196
-rw-r--r--platform/iphone/export/export.cpp366
-rw-r--r--platform/iphone/export/export.h (renamed from platform/bb10/export/export.h)3
-rw-r--r--platform/iphone/game_center.h1
-rw-r--r--platform/iphone/game_center.mm172
-rw-r--r--platform/iphone/gl_view.h1
-rw-r--r--[-rwxr-xr-x]platform/iphone/gl_view.mm349
-rw-r--r--platform/iphone/globals/global_defaults.cpp5
-rw-r--r--platform/iphone/globals/global_defaults.h1
-rw-r--r--platform/iphone/godot_iphone.cpp1
-rw-r--r--platform/iphone/icloud.h1
-rw-r--r--platform/iphone/icloud.mm271
-rw-r--r--platform/iphone/in_app_store.h1
-rw-r--r--platform/iphone/in_app_store.mm261
-rw-r--r--platform/iphone/ios.h3
-rw-r--r--platform/iphone/ios.mm21
-rw-r--r--platform/iphone/main.m12
-rw-r--r--platform/iphone/os_iphone.cpp155
-rw-r--r--platform/iphone/os_iphone.h20
-rw-r--r--platform/iphone/platform_config.h1
-rw-r--r--platform/iphone/platform_refcount.h1
-rw-r--r--platform/iphone/power_iphone.cpp1
-rw-r--r--platform/iphone/power_iphone.h1
-rw-r--r--platform/iphone/rasterizer_iphone.cpp2584
-rw-r--r--platform/iphone/rasterizer_iphone.h880
-rw-r--r--platform/iphone/sem_iphone.cpp1
-rw-r--r--platform/iphone/sem_iphone.h1
-rw-r--r--platform/iphone/view_controller.h1
-rw-r--r--platform/iphone/view_controller.mm83
-rw-r--r--platform/javascript/SCsub41
-rw-r--r--platform/javascript/audio_driver_javascript.cpp1
-rw-r--r--platform/javascript/audio_driver_javascript.h1
-rw-r--r--platform/javascript/audio_server_javascript.cpp1
-rw-r--r--platform/javascript/audio_server_javascript.h1
-rw-r--r--platform/javascript/detect.py62
-rw-r--r--platform/javascript/dom_keys.h3
-rw-r--r--platform/javascript/export/export.cpp488
-rw-r--r--platform/javascript/export/export.h1
-rw-r--r--platform/javascript/godot_shell.html203
-rw-r--r--platform/javascript/javascript_eval.cpp1
-rw-r--r--platform/javascript/javascript_eval.h1
-rw-r--r--platform/javascript/javascript_main.cpp154
-rw-r--r--platform/javascript/os_javascript.cpp796
-rw-r--r--platform/javascript/os_javascript.h40
-rw-r--r--platform/javascript/platform_config.h1
-rw-r--r--platform/javascript/power_javascript.cpp1
-rw-r--r--platform/javascript/power_javascript.h1
-rw-r--r--platform/javascript/run_icon.pngbin0 -> 471 bytes
-rw-r--r--platform/osx/SCsub1
-rw-r--r--platform/osx/audio_driver_osx.cpp176
-rw-r--r--platform/osx/audio_driver_osx.h9
-rw-r--r--platform/osx/detect.py70
-rw-r--r--platform/osx/dir_access_osx.h1
-rw-r--r--platform/osx/dir_access_osx.mm8
-rw-r--r--platform/osx/export/export.cpp813
-rw-r--r--platform/osx/export/export.h1
-rw-r--r--platform/osx/godot_main_osx.mm39
-rw-r--r--platform/osx/godot_osx.mm215
-rw-r--r--platform/osx/joypad_osx.cpp10
-rw-r--r--platform/osx/joypad_osx.h3
-rw-r--r--platform/osx/os_osx.h39
-rw-r--r--platform/osx/os_osx.mm1914
-rw-r--r--platform/osx/platform_config.h1
-rw-r--r--platform/osx/power_osx.cpp27
-rw-r--r--platform/osx/power_osx.h1
-rw-r--r--platform/osx/sem_osx.cpp1
-rw-r--r--platform/osx/sem_osx.h1
-rw-r--r--platform/server/detect.py78
-rw-r--r--platform/server/godot_server.cpp1
-rw-r--r--platform/server/os_server.cpp3
-rw-r--r--platform/server/os_server.h3
-rw-r--r--platform/server/platform_config.h1
-rw-r--r--platform/uwp/SCsub1
-rw-r--r--platform/uwp/app.cpp108
-rw-r--r--platform/uwp/app.h3
-rw-r--r--platform/uwp/detect.py114
-rw-r--r--platform/uwp/export/export.cpp2193
-rw-r--r--platform/uwp/export/export.h1
-rw-r--r--platform/uwp/gl_context_egl.cpp3
-rw-r--r--platform/uwp/gl_context_egl.h1
-rw-r--r--platform/uwp/joypad_uwp.cpp80
-rw-r--r--platform/uwp/joypad_uwp.h11
-rw-r--r--platform/uwp/os_uwp.cpp112
-rw-r--r--platform/uwp/os_uwp.h17
-rw-r--r--platform/uwp/platform_config.h1
-rw-r--r--platform/uwp/power_uwp.cpp (renamed from platform/bb10/power_bb10.cpp)32
-rw-r--r--platform/uwp/power_uwp.h (renamed from platform/bb10/power_bb10.h)20
-rw-r--r--platform/uwp/thread_uwp.cpp7
-rw-r--r--platform/uwp/thread_uwp.h5
-rw-r--r--platform/windows/context_gl_win.cpp1
-rw-r--r--platform/windows/context_gl_win.h1
-rw-r--r--platform/windows/ctxgl_procaddr.cpp1
-rw-r--r--platform/windows/ctxgl_procaddr.h1
-rw-r--r--platform/windows/detect.py281
-rw-r--r--platform/windows/export/export.cpp35
-rw-r--r--platform/windows/export/export.h1
-rw-r--r--platform/windows/godot.icobin370070 -> 110755 bytes
-rw-r--r--platform/windows/godot_win.cpp1
-rw-r--r--platform/windows/joypad.cpp39
-rw-r--r--platform/windows/joypad.h5
-rw-r--r--platform/windows/key_mapping_win.cpp3
-rw-r--r--platform/windows/key_mapping_win.h1
-rw-r--r--platform/windows/lang_table.h1
-rw-r--r--platform/windows/os_windows.cpp610
-rw-r--r--platform/windows/os_windows.h28
-rw-r--r--platform/windows/packet_peer_udp_winsock.cpp5
-rw-r--r--platform/windows/packet_peer_udp_winsock.h3
-rw-r--r--platform/windows/platform_config.h1
-rw-r--r--platform/windows/power_windows.cpp26
-rw-r--r--platform/windows/power_windows.h1
-rw-r--r--platform/windows/stream_peer_winsock.cpp1
-rw-r--r--platform/windows/stream_peer_winsock.h1
-rw-r--r--platform/windows/tcp_server_winsock.cpp3
-rw-r--r--platform/windows/tcp_server_winsock.h3
-rw-r--r--platform/x11/context_gl_x11.cpp3
-rw-r--r--platform/x11/context_gl_x11.h1
-rw-r--r--platform/x11/detect.py160
-rw-r--r--platform/x11/export/export.cpp6
-rw-r--r--platform/x11/export/export.h1
-rw-r--r--platform/x11/godot_x11.cpp4
-rw-r--r--platform/x11/joypad_linux.cpp16
-rw-r--r--platform/x11/joypad_linux.h13
-rw-r--r--platform/x11/key_mapping_x11.cpp6
-rw-r--r--platform/x11/key_mapping_x11.h1
-rw-r--r--platform/x11/os_x11.cpp409
-rw-r--r--platform/x11/os_x11.h17
-rw-r--r--platform/x11/platform_config.h1
-rw-r--r--platform/x11/power_x11.cpp37
-rw-r--r--platform/x11/power_x11.h1
-rw-r--r--scene/2d/animated_sprite.cpp15
-rw-r--r--scene/2d/animated_sprite.h17
-rw-r--r--scene/2d/area_2d.cpp102
-rw-r--r--scene/2d/area_2d.h21
-rw-r--r--scene/2d/audio_stream_player_2d.cpp463
-rw-r--r--scene/2d/audio_stream_player_2d.h96
-rw-r--r--scene/2d/back_buffer_copy.cpp1
-rw-r--r--scene/2d/back_buffer_copy.h1
-rw-r--r--scene/2d/camera_2d.cpp201
-rw-r--r--scene/2d/camera_2d.h14
-rw-r--r--scene/2d/canvas_item.cpp343
-rw-r--r--scene/2d/canvas_item.h119
-rw-r--r--scene/2d/canvas_modulate.cpp1
-rw-r--r--scene/2d/canvas_modulate.h1
-rw-r--r--scene/2d/collision_object_2d.cpp381
-rw-r--r--scene/2d/collision_object_2d.h66
-rw-r--r--scene/2d/collision_polygon_2d.cpp192
-rw-r--r--scene/2d/collision_polygon_2d.h33
-rw-r--r--scene/2d/collision_shape_2d.cpp177
-rw-r--r--scene/2d/collision_shape_2d.h27
-rw-r--r--scene/2d/joints_2d.cpp1
-rw-r--r--scene/2d/joints_2d.h3
-rw-r--r--scene/2d/light_2d.cpp19
-rw-r--r--scene/2d/light_2d.h5
-rw-r--r--scene/2d/light_occluder_2d.cpp5
-rw-r--r--scene/2d/light_occluder_2d.h1
-rw-r--r--scene/2d/line_2d.cpp10
-rw-r--r--scene/2d/line_2d.h7
-rw-r--r--scene/2d/line_builder.cpp11
-rw-r--r--scene/2d/line_builder.h3
-rw-r--r--scene/2d/navigation2d.cpp6
-rw-r--r--scene/2d/navigation2d.h7
-rw-r--r--scene/2d/navigation_polygon.cpp9
-rw-r--r--scene/2d/navigation_polygon.h1
-rw-r--r--scene/2d/node_2d.cpp48
-rw-r--r--scene/2d/node_2d.h8
-rw-r--r--scene/2d/parallax_background.cpp1
-rw-r--r--scene/2d/parallax_background.h3
-rw-r--r--scene/2d/parallax_layer.cpp1
-rw-r--r--scene/2d/parallax_layer.h5
-rw-r--r--scene/2d/particles_2d.cpp1202
-rw-r--r--scene/2d/particles_2d.h252
-rw-r--r--scene/2d/path_2d.cpp5
-rw-r--r--scene/2d/path_2d.h3
-rw-r--r--scene/2d/path_texture.cpp1
-rw-r--r--scene/2d/path_texture.h1
-rw-r--r--scene/2d/physics_body_2d.cpp526
-rw-r--r--scene/2d/physics_body_2d.h100
-rw-r--r--scene/2d/polygon_2d.cpp13
-rw-r--r--scene/2d/polygon_2d.h5
-rw-r--r--scene/2d/position_2d.cpp1
-rw-r--r--scene/2d/position_2d.h1
-rw-r--r--scene/2d/ray_cast_2d.cpp27
-rw-r--r--scene/2d/ray_cast_2d.h7
-rw-r--r--scene/2d/remote_transform_2d.cpp104
-rw-r--r--scene/2d/remote_transform_2d.h18
-rw-r--r--scene/2d/screen_button.cpp176
-rw-r--r--scene/2d/screen_button.h10
-rw-r--r--scene/2d/sprite.cpp64
-rw-r--r--scene/2d/sprite.h9
-rw-r--r--scene/2d/tile_map.cpp129
-rw-r--r--scene/2d/tile_map.h8
-rw-r--r--scene/2d/visibility_notifier_2d.cpp2
-rw-r--r--scene/2d/visibility_notifier_2d.h1
-rw-r--r--scene/2d/y_sort.cpp1
-rw-r--r--scene/2d/y_sort.h1
-rw-r--r--scene/3d/area.cpp170
-rw-r--r--scene/3d/area.h39
-rw-r--r--scene/3d/arvr_nodes.cpp426
-rw-r--r--scene/3d/arvr_nodes.h157
-rw-r--r--scene/3d/audio_stream_player_3d.cpp930
-rw-r--r--scene/3d/audio_stream_player_3d.h175
-rw-r--r--scene/3d/baked_light_instance.cpp1753
-rw-r--r--scene/3d/baked_light_instance.h198
-rw-r--r--scene/3d/body_shape.cpp919
-rw-r--r--scene/3d/bone_attachment.cpp1
-rw-r--r--scene/3d/bone_attachment.h1
-rw-r--r--scene/3d/camera.cpp47
-rw-r--r--scene/3d/camera.h23
-rw-r--r--scene/3d/character_camera.cpp1
-rw-r--r--scene/3d/character_camera.h1
-rw-r--r--scene/3d/collision_object.cpp326
-rw-r--r--scene/3d/collision_object.h61
-rw-r--r--scene/3d/collision_polygon.cpp238
-rw-r--r--scene/3d/collision_polygon.h30
-rw-r--r--scene/3d/collision_shape.cpp207
-rw-r--r--scene/3d/collision_shape.h (renamed from scene/3d/body_shape.h)39
-rw-r--r--scene/3d/gi_probe.cpp103
-rw-r--r--scene/3d/gi_probe.h12
-rw-r--r--scene/3d/immediate_geometry.cpp5
-rw-r--r--scene/3d/immediate_geometry.h5
-rw-r--r--scene/3d/interpolated_camera.cpp3
-rw-r--r--scene/3d/interpolated_camera.h1
-rw-r--r--scene/3d/light.cpp37
-rw-r--r--scene/3d/light.h3
-rw-r--r--scene/3d/listener.cpp3
-rw-r--r--scene/3d/listener.h1
-rw-r--r--scene/3d/mesh_instance.cpp119
-rw-r--r--scene/3d/mesh_instance.h3
-rw-r--r--scene/3d/multimesh_instance.cpp1
-rw-r--r--scene/3d/multimesh_instance.h1
-rw-r--r--scene/3d/navigation.cpp3
-rw-r--r--scene/3d/navigation.h7
-rw-r--r--scene/3d/navigation_mesh.cpp9
-rw-r--r--scene/3d/navigation_mesh.h3
-rw-r--r--scene/3d/particles.cpp1724
-rw-r--r--scene/3d/particles.h401
-rw-r--r--scene/3d/path.cpp71
-rw-r--r--scene/3d/path.h1
-rw-r--r--scene/3d/physics_body.cpp527
-rw-r--r--scene/3d/physics_body.h95
-rw-r--r--scene/3d/physics_joint.cpp27
-rw-r--r--scene/3d/physics_joint.h9
-rw-r--r--scene/3d/portal.cpp3
-rw-r--r--scene/3d/portal.h1
-rw-r--r--scene/3d/position_3d.cpp1
-rw-r--r--scene/3d/position_3d.h1
-rw-r--r--scene/3d/proximity_group.cpp5
-rw-r--r--scene/3d/proximity_group.h1
-rw-r--r--scene/3d/quad.cpp225
-rw-r--r--scene/3d/ray_cast.cpp105
-rw-r--r--scene/3d/ray_cast.h14
-rw-r--r--scene/3d/reflection_probe.cpp5
-rw-r--r--scene/3d/reflection_probe.h1
-rw-r--r--scene/3d/remote_transform.cpp99
-rw-r--r--scene/3d/remote_transform.h18
-rw-r--r--scene/3d/room_instance.cpp7
-rw-r--r--scene/3d/room_instance.h1
-rw-r--r--scene/3d/scenario_fx.cpp40
-rw-r--r--scene/3d/scenario_fx.h5
-rw-r--r--scene/3d/skeleton.cpp15
-rw-r--r--scene/3d/skeleton.h7
-rw-r--r--scene/3d/spatial.cpp68
-rw-r--r--scene/3d/spatial.h12
-rw-r--r--scene/3d/spatial_indexer.cpp1
-rw-r--r--scene/3d/spatial_indexer.h1
-rw-r--r--scene/3d/spatial_velocity_tracker.cpp104
-rw-r--r--scene/3d/spatial_velocity_tracker.h31
-rw-r--r--scene/3d/sprite_3d.cpp70
-rw-r--r--scene/3d/sprite_3d.h4
-rw-r--r--scene/3d/vehicle_body.cpp23
-rw-r--r--scene/3d/vehicle_body.h8
-rw-r--r--scene/3d/visibility_notifier.cpp3
-rw-r--r--scene/3d/visibility_notifier.h1
-rw-r--r--scene/3d/visual_instance.cpp11
-rw-r--r--scene/3d/visual_instance.h4
-rw-r--r--scene/SCsub19
-rw-r--r--scene/animation/animation_cache.cpp1
-rw-r--r--scene/animation/animation_cache.h1
-rw-r--r--scene/animation/animation_player.cpp14
-rw-r--r--scene/animation/animation_player.h3
-rw-r--r--scene/animation/animation_tree_player.cpp7
-rw-r--r--scene/animation/animation_tree_player.h9
-rw-r--r--scene/animation/tween.cpp36
-rw-r--r--scene/animation/tween.h23
-rw-r--r--scene/animation/tween_interpolaters.cpp1
-rw-r--r--scene/audio/audio_player.cpp86
-rw-r--r--scene/audio/audio_player.h13
-rw-r--r--scene/gui/base_button.cpp256
-rw-r--r--scene/gui/base_button.h5
-rw-r--r--scene/gui/box_container.cpp2
-rw-r--r--scene/gui/box_container.h1
-rw-r--r--scene/gui/button.cpp28
-rw-r--r--scene/gui/button.h1
-rw-r--r--scene/gui/button_array.cpp541
-rw-r--r--scene/gui/button_array.h130
-rw-r--r--scene/gui/button_group.cpp7
-rw-r--r--scene/gui/button_group.h1
-rw-r--r--scene/gui/center_container.cpp1
-rw-r--r--scene/gui/center_container.h1
-rw-r--r--scene/gui/check_box.cpp1
-rw-r--r--scene/gui/check_box.h1
-rw-r--r--scene/gui/check_button.cpp1
-rw-r--r--scene/gui/check_button.h1
-rw-r--r--scene/gui/color_picker.cpp224
-rw-r--r--scene/gui/color_picker.h12
-rw-r--r--scene/gui/color_rect.cpp1
-rw-r--r--scene/gui/color_rect.h1
-rw-r--r--scene/gui/container.cpp23
-rw-r--r--scene/gui/container.h1
-rw-r--r--scene/gui/control.cpp464
-rw-r--r--scene/gui/control.h78
-rw-r--r--scene/gui/dialogs.cpp136
-rw-r--r--scene/gui/dialogs.h3
-rw-r--r--scene/gui/file_dialog.cpp26
-rw-r--r--scene/gui/file_dialog.h3
-rw-r--r--scene/gui/gradient_edit.cpp (renamed from scene/gui/color_ramp_edit.cpp)90
-rw-r--r--scene/gui/gradient_edit.h (renamed from scene/gui/color_ramp_edit.h)17
-rw-r--r--scene/gui/graph_edit.cpp154
-rw-r--r--scene/gui/graph_edit.h7
-rw-r--r--scene/gui/graph_node.cpp28
-rw-r--r--scene/gui/graph_node.h7
-rw-r--r--scene/gui/grid_container.cpp1
-rw-r--r--scene/gui/grid_container.h1
-rw-r--r--scene/gui/input_action.cpp72
-rw-r--r--scene/gui/input_action.h10
-rw-r--r--scene/gui/item_list.cpp229
-rw-r--r--scene/gui/item_list.h18
-rw-r--r--scene/gui/label.cpp32
-rw-r--r--scene/gui/label.h1
-rw-r--r--scene/gui/line_edit.cpp715
-rw-r--r--scene/gui/line_edit.h8
-rw-r--r--scene/gui/link_button.cpp1
-rw-r--r--scene/gui/link_button.h1
-rw-r--r--scene/gui/margin_container.cpp1
-rw-r--r--scene/gui/margin_container.h1
-rw-r--r--scene/gui/menu_button.cpp21
-rw-r--r--scene/gui/menu_button.h5
-rw-r--r--scene/gui/option_button.cpp60
-rw-r--r--scene/gui/option_button.h7
-rw-r--r--scene/gui/panel.cpp1
-rw-r--r--scene/gui/panel.h1
-rw-r--r--scene/gui/panel_container.cpp1
-rw-r--r--scene/gui/panel_container.h1
-rw-r--r--scene/gui/patch_9_rect.cpp70
-rw-r--r--scene/gui/patch_9_rect.h20
-rw-r--r--scene/gui/popup.cpp47
-rw-r--r--scene/gui/popup.h3
-rw-r--r--scene/gui/popup_menu.cpp329
-rw-r--r--scene/gui/popup_menu.h16
-rw-r--r--scene/gui/progress_bar.cpp1
-rw-r--r--scene/gui/progress_bar.h1
-rw-r--r--scene/gui/range.cpp15
-rw-r--r--scene/gui/range.h1
-rw-r--r--scene/gui/reference_rect.cpp1
-rw-r--r--scene/gui/reference_rect.h1
-rw-r--r--scene/gui/rich_text_label.cpp271
-rw-r--r--scene/gui/rich_text_label.h11
-rw-r--r--scene/gui/scroll_bar.cpp414
-rw-r--r--scene/gui/scroll_bar.h17
-rw-r--r--scene/gui/scroll_container.cpp159
-rw-r--r--scene/gui/scroll_container.h3
-rw-r--r--scene/gui/separator.cpp1
-rw-r--r--scene/gui/separator.h1
-rw-r--r--scene/gui/slider.cpp77
-rw-r--r--scene/gui/slider.h7
-rw-r--r--scene/gui/spin_box.cpp34
-rw-r--r--scene/gui/spin_box.h5
-rw-r--r--scene/gui/split_container.cpp49
-rw-r--r--scene/gui/split_container.h5
-rw-r--r--scene/gui/tab_container.cpp45
-rw-r--r--scene/gui/tab_container.h5
-rw-r--r--scene/gui/tabs.cpp300
-rw-r--r--scene/gui/tabs.h25
-rw-r--r--scene/gui/text_edit.cpp2069
-rw-r--r--scene/gui/text_edit.h34
-rw-r--r--scene/gui/texture_button.cpp31
-rw-r--r--scene/gui/texture_button.h5
-rw-r--r--scene/gui/texture_progress.cpp1
-rw-r--r--scene/gui/texture_progress.h1
-rw-r--r--scene/gui/texture_rect.cpp1
-rw-r--r--scene/gui/texture_rect.h1
-rw-r--r--scene/gui/tool_button.cpp1
-rw-r--r--scene/gui/tool_button.h1
-rw-r--r--scene/gui/tree.cpp1224
-rw-r--r--scene/gui/tree.h59
-rw-r--r--scene/gui/video_player.cpp7
-rw-r--r--scene/gui/video_player.h5
-rw-r--r--scene/gui/viewport_container.cpp1
-rw-r--r--scene/gui/viewport_container.h1
-rw-r--r--scene/io/resource_format_image.cpp5
-rw-r--r--scene/io/resource_format_image.h1
-rw-r--r--scene/io/resource_format_wav.cpp3
-rw-r--r--scene/io/resource_format_wav.h1
-rw-r--r--scene/main/canvas_layer.cpp9
-rw-r--r--scene/main/canvas_layer.h3
-rw-r--r--scene/main/http_request.cpp3
-rw-r--r--scene/main/http_request.h1
-rw-r--r--scene/main/instance_placeholder.cpp3
-rw-r--r--scene/main/instance_placeholder.h1
-rwxr-xr-xscene/main/node.cpp271
-rw-r--r--scene/main/node.h32
-rw-r--r--scene/main/resource_preloader.cpp1
-rw-r--r--scene/main/resource_preloader.h1
-rw-r--r--scene/main/scene_tree.cpp (renamed from scene/main/scene_main_loop.cpp)267
-rw-r--r--scene/main/scene_tree.h (renamed from scene/main/scene_main_loop.h)37
-rwxr-xr-xscene/main/timer.cpp7
-rwxr-xr-xscene/main/timer.h1
-rw-r--r--scene/main/viewport.cpp999
-rw-r--r--scene/main/viewport.h69
-rw-r--r--scene/register_scene_types.cpp103
-rw-r--r--scene/register_scene_types.h1
-rw-r--r--scene/resources/SCsub1
-rw-r--r--scene/resources/animation.cpp29
-rw-r--r--scene/resources/animation.h5
-rw-r--r--scene/resources/audio_stream_resampled.cpp3
-rw-r--r--scene/resources/audio_stream_resampled.h1
-rw-r--r--scene/resources/audio_stream_sample.cpp8
-rw-r--r--scene/resources/audio_stream_sample.h4
-rw-r--r--scene/resources/baked_light.cpp30
-rw-r--r--scene/resources/baked_light.h35
-rw-r--r--scene/resources/bit_mask.cpp19
-rw-r--r--scene/resources/bit_mask.h4
-rw-r--r--scene/resources/bounds.cpp1
-rw-r--r--scene/resources/bounds.h1
-rw-r--r--scene/resources/box_shape.cpp5
-rw-r--r--scene/resources/box_shape.h1
-rw-r--r--scene/resources/canvas.cpp1
-rw-r--r--scene/resources/canvas.h1
-rw-r--r--scene/resources/capsule_shape.cpp1
-rw-r--r--scene/resources/capsule_shape.h1
-rw-r--r--scene/resources/capsule_shape_2d.cpp3
-rw-r--r--scene/resources/capsule_shape_2d.h1
-rw-r--r--scene/resources/circle_shape_2d.cpp3
-rw-r--r--scene/resources/circle_shape_2d.h1
-rw-r--r--scene/resources/color_ramp.cpp57
-rw-r--r--scene/resources/color_ramp.h17
-rw-r--r--scene/resources/concave_polygon_shape.cpp1
-rw-r--r--scene/resources/concave_polygon_shape.h1
-rw-r--r--scene/resources/concave_polygon_shape_2d.cpp3
-rw-r--r--scene/resources/concave_polygon_shape_2d.h1
-rw-r--r--scene/resources/convex_polygon_shape.cpp1
-rw-r--r--scene/resources/convex_polygon_shape.h1
-rw-r--r--scene/resources/convex_polygon_shape_2d.cpp3
-rw-r--r--scene/resources/convex_polygon_shape_2d.h1
-rw-r--r--scene/resources/curve.cpp490
-rw-r--r--scene/resources/curve.h120
-rw-r--r--scene/resources/default_theme/default_theme.cpp867
-rw-r--r--scene/resources/default_theme/default_theme.h1
-rw-r--r--scene/resources/default_theme/hslider_grabber_disabled.pngbin0 -> 386 bytes
-rwxr-xr-xscene/resources/default_theme/make_header.py21
-rw-r--r--scene/resources/default_theme/scroll_grabber_pressed.pngbin0 -> 233 bytes
-rw-r--r--scene/resources/default_theme/theme_data.h583
-rw-r--r--scene/resources/default_theme/vslider_grabber_disabled.pngbin0 -> 335 bytes
-rw-r--r--scene/resources/dynamic_font.cpp27
-rw-r--r--scene/resources/dynamic_font.h3
-rw-r--r--scene/resources/dynamic_font_stb.cpp6
-rw-r--r--scene/resources/dynamic_font_stb.h4
-rw-r--r--scene/resources/environment.cpp490
-rw-r--r--scene/resources/environment.h101
-rw-r--r--scene/resources/font.cpp23
-rw-r--r--scene/resources/font.h3
-rw-r--r--scene/resources/gibberish_stream.cpp1
-rw-r--r--scene/resources/gibberish_stream.h1
-rw-r--r--scene/resources/material.cpp1303
-rw-r--r--scene/resources/material.h285
-rw-r--r--scene/resources/mesh.cpp972
-rw-r--r--scene/resources/mesh.h56
-rw-r--r--scene/resources/mesh_data_tool.cpp13
-rw-r--r--scene/resources/mesh_data_tool.h5
-rw-r--r--scene/resources/mesh_library.cpp13
-rw-r--r--scene/resources/mesh_library.h3
-rw-r--r--scene/resources/multimesh.cpp5
-rw-r--r--scene/resources/multimesh.h3
-rw-r--r--scene/resources/packed_scene.cpp64
-rw-r--r--scene/resources/packed_scene.h1
-rw-r--r--scene/resources/plane_shape.cpp1
-rw-r--r--scene/resources/plane_shape.h1
-rw-r--r--scene/resources/polygon_path_finder.cpp3
-rw-r--r--scene/resources/polygon_path_finder.h1
-rw-r--r--scene/resources/primitive_meshes.cpp1478
-rw-r--r--scene/resources/primitive_meshes.h310
-rw-r--r--scene/resources/ray_shape.cpp1
-rw-r--r--scene/resources/ray_shape.h1
-rw-r--r--scene/resources/rectangle_shape_2d.cpp1
-rw-r--r--scene/resources/rectangle_shape_2d.h1
-rw-r--r--scene/resources/room.cpp1
-rw-r--r--scene/resources/room.h3
-rw-r--r--scene/resources/scene_format_text.cpp41
-rw-r--r--scene/resources/scene_format_text.h4
-rw-r--r--scene/resources/segment_shape_2d.cpp7
-rw-r--r--scene/resources/segment_shape_2d.h1
-rw-r--r--scene/resources/shader.cpp24
-rw-r--r--scene/resources/shader.h30
-rw-r--r--scene/resources/shader_graph.cpp13
-rw-r--r--scene/resources/shader_graph.h3
-rw-r--r--scene/resources/shape.cpp7
-rw-r--r--scene/resources/shape.h9
-rw-r--r--scene/resources/shape_2d.cpp9
-rw-r--r--scene/resources/shape_2d.h5
-rw-r--r--scene/resources/shape_line_2d.cpp3
-rw-r--r--scene/resources/shape_line_2d.h1
-rw-r--r--scene/resources/sky_box.cpp503
-rw-r--r--scene/resources/sky_box.h143
-rw-r--r--scene/resources/space_2d.cpp1
-rw-r--r--scene/resources/space_2d.h1
-rw-r--r--scene/resources/sphere_shape.cpp1
-rw-r--r--scene/resources/sphere_shape.h1
-rw-r--r--scene/resources/style_box.cpp659
-rw-r--r--scene/resources/style_box.h133
-rw-r--r--scene/resources/surface_tool.cpp118
-rw-r--r--scene/resources/surface_tool.h13
-rw-r--r--scene/resources/texture.cpp541
-rw-r--r--scene/resources/texture.h149
-rw-r--r--scene/resources/theme.cpp19
-rw-r--r--scene/resources/theme.h9
-rw-r--r--scene/resources/tile_set.cpp246
-rw-r--r--scene/resources/tile_set.h57
-rw-r--r--scene/resources/video_stream.cpp1
-rw-r--r--scene/resources/video_stream.h1
-rw-r--r--scene/resources/world.cpp31
-rw-r--r--scene/resources/world.h10
-rw-r--r--scene/resources/world_2d.cpp21
-rw-r--r--scene/resources/world_2d.h7
-rw-r--r--scene/scene_string_names.cpp14
-rw-r--r--scene/scene_string_names.h10
-rw-r--r--servers/SCsub3
-rw-r--r--servers/arvr/SCsub (renamed from modules/cscript/SCsub)2
-rw-r--r--servers/arvr/arvr_interface.cpp82
-rw-r--r--servers/arvr/arvr_interface.h89
-rw-r--r--servers/arvr/arvr_positional_tracker.cpp171
-rw-r--r--servers/arvr/arvr_positional_tracker.h87
-rw-r--r--servers/arvr/arvr_script_interface.cpp127
-rw-r--r--servers/arvr/arvr_script_interface.h47
-rw-r--r--servers/arvr_server.cpp313
-rw-r--r--servers/arvr_server.h167
-rw-r--r--servers/audio/audio_driver_dummy.cpp3
-rw-r--r--servers/audio/audio_driver_dummy.h1
-rw-r--r--servers/audio/audio_effect.cpp1
-rw-r--r--servers/audio/audio_effect.h1
-rw-r--r--servers/audio/audio_filter_sw.cpp38
-rw-r--r--servers/audio/audio_filter_sw.h34
-rw-r--r--servers/audio/audio_rb_resampler.cpp1
-rw-r--r--servers/audio/audio_rb_resampler.h1
-rw-r--r--servers/audio/audio_stream.cpp132
-rw-r--r--servers/audio/audio_stream.h58
-rw-r--r--servers/audio/effects/audio_effect_amplify.cpp1
-rw-r--r--servers/audio/effects/audio_effect_amplify.h1
-rw-r--r--servers/audio/effects/audio_effect_chorus.cpp1
-rw-r--r--servers/audio/effects/audio_effect_chorus.h1
-rw-r--r--servers/audio/effects/audio_effect_compressor.cpp21
-rw-r--r--servers/audio/effects/audio_effect_compressor.h7
-rw-r--r--servers/audio/effects/audio_effect_delay.cpp1
-rw-r--r--servers/audio/effects/audio_effect_delay.h1
-rw-r--r--servers/audio/effects/audio_effect_distortion.cpp1
-rw-r--r--servers/audio/effects/audio_effect_distortion.h9
-rw-r--r--servers/audio/effects/audio_effect_eq.cpp1
-rw-r--r--servers/audio/effects/audio_effect_eq.h1
-rw-r--r--servers/audio/effects/audio_effect_filter.cpp1
-rw-r--r--servers/audio/effects/audio_effect_filter.h1
-rw-r--r--servers/audio/effects/audio_effect_limiter.cpp21
-rw-r--r--servers/audio/effects/audio_effect_limiter.h7
-rw-r--r--servers/audio/effects/audio_effect_panner.cpp1
-rw-r--r--servers/audio/effects/audio_effect_panner.h3
-rw-r--r--servers/audio/effects/audio_effect_phaser.cpp1
-rw-r--r--servers/audio/effects/audio_effect_phaser.h1
-rw-r--r--servers/audio/effects/audio_effect_pitch_shift.cpp1
-rw-r--r--servers/audio/effects/audio_effect_pitch_shift.h1
-rw-r--r--servers/audio/effects/audio_effect_reverb.cpp1
-rw-r--r--servers/audio/effects/audio_effect_reverb.h1
-rw-r--r--servers/audio/effects/audio_effect_stereo_enhance.cpp1
-rw-r--r--servers/audio/effects/audio_effect_stereo_enhance.h1
-rw-r--r--servers/audio/effects/eq.cpp1
-rw-r--r--servers/audio/effects/eq.h1
-rw-r--r--servers/audio/effects/reverb.cpp1
-rw-r--r--servers/audio/effects/reverb.h1
-rw-r--r--servers/audio/reverb_sw.cpp1
-rw-r--r--servers/audio/reverb_sw.h1
-rw-r--r--servers/audio/voice_rb_sw.h1
-rw-r--r--servers/audio_server.cpp36
-rw-r--r--servers/audio_server.h4
-rw-r--r--servers/physics/area_pair_sw.cpp23
-rw-r--r--servers/physics/area_pair_sw.h1
-rw-r--r--servers/physics/area_sw.cpp1
-rw-r--r--servers/physics/area_sw.h2
-rw-r--r--servers/physics/body_pair_sw.cpp12
-rw-r--r--servers/physics/body_pair_sw.h1
-rw-r--r--servers/physics/body_sw.cpp10
-rw-r--r--servers/physics/body_sw.h2
-rw-r--r--servers/physics/broad_phase_basic.cpp25
-rw-r--r--servers/physics/broad_phase_basic.h2
-rw-r--r--servers/physics/broad_phase_octree.cpp8
-rw-r--r--servers/physics/broad_phase_octree.h4
-rw-r--r--servers/physics/broad_phase_sw.cpp1
-rw-r--r--servers/physics/broad_phase_sw.h2
-rw-r--r--servers/physics/collision_object_sw.cpp5
-rw-r--r--servers/physics/collision_object_sw.h19
-rw-r--r--servers/physics/collision_solver_sat.cpp3
-rw-r--r--servers/physics/collision_solver_sat.h1
-rw-r--r--servers/physics/collision_solver_sw.cpp7
-rw-r--r--servers/physics/collision_solver_sw.h1
-rw-r--r--servers/physics/constraint_sw.h1
-rw-r--r--servers/physics/gjk_epa.cpp26
-rw-r--r--servers/physics/gjk_epa.h1
-rw-r--r--servers/physics/joints/cone_twist_joint_sw.cpp30
-rw-r--r--servers/physics/joints/cone_twist_joint_sw.h5
-rw-r--r--servers/physics/joints/generic_6dof_joint_sw.cpp30
-rw-r--r--servers/physics/joints/generic_6dof_joint_sw.h5
-rw-r--r--servers/physics/joints/hinge_joint_sw.cpp17
-rw-r--r--servers/physics/joints/hinge_joint_sw.h1
-rw-r--r--servers/physics/joints/jacobian_entry_sw.h1
-rw-r--r--servers/physics/joints/pin_joint_sw.cpp17
-rw-r--r--servers/physics/joints/pin_joint_sw.h9
-rw-r--r--servers/physics/joints/slider_joint_sw.cpp23
-rw-r--r--servers/physics/joints/slider_joint_sw.h1
-rw-r--r--servers/physics/joints_sw.h1
-rw-r--r--servers/physics/physics_server_sw.cpp115
-rw-r--r--servers/physics/physics_server_sw.h42
-rw-r--r--servers/physics/shape_sw.cpp256
-rw-r--r--servers/physics/shape_sw.h27
-rw-r--r--servers/physics/space_sw.cpp458
-rw-r--r--servers/physics/space_sw.h23
-rw-r--r--servers/physics/step_sw.cpp1
-rw-r--r--servers/physics/step_sw.h1
-rw-r--r--servers/physics_2d/area_2d_sw.cpp1
-rw-r--r--servers/physics_2d/area_2d_sw.h2
-rw-r--r--servers/physics_2d/area_pair_2d_sw.cpp16
-rw-r--r--servers/physics_2d/area_pair_2d_sw.h1
-rw-r--r--servers/physics_2d/body_2d_sw.cpp5
-rw-r--r--servers/physics_2d/body_2d_sw.h17
-rw-r--r--servers/physics_2d/body_pair_2d_sw.cpp16
-rw-r--r--servers/physics_2d/body_pair_2d_sw.h1
-rw-r--r--servers/physics_2d/broad_phase_2d_basic.cpp5
-rw-r--r--servers/physics_2d/broad_phase_2d_basic.h1
-rw-r--r--servers/physics_2d/broad_phase_2d_hash_grid.cpp23
-rw-r--r--servers/physics_2d/broad_phase_2d_hash_grid.h3
-rw-r--r--servers/physics_2d/broad_phase_2d_sw.cpp1
-rw-r--r--servers/physics_2d/broad_phase_2d_sw.h1
-rw-r--r--servers/physics_2d/collision_object_2d_sw.cpp8
-rw-r--r--servers/physics_2d/collision_object_2d_sw.h26
-rw-r--r--servers/physics_2d/collision_solver_2d_sat.cpp1
-rw-r--r--servers/physics_2d/collision_solver_2d_sat.h1
-rw-r--r--servers/physics_2d/collision_solver_2d_sw.cpp3
-rw-r--r--servers/physics_2d/collision_solver_2d_sw.h1
-rw-r--r--servers/physics_2d/constraint_2d_sw.h1
-rw-r--r--servers/physics_2d/joints_2d_sw.cpp1
-rw-r--r--servers/physics_2d/joints_2d_sw.h1
-rw-r--r--servers/physics_2d/physics_2d_server_sw.cpp122
-rw-r--r--servers/physics_2d/physics_2d_server_sw.h35
-rw-r--r--servers/physics_2d/physics_2d_server_wrap_mt.cpp19
-rw-r--r--servers/physics_2d/physics_2d_server_wrap_mt.h42
-rw-r--r--servers/physics_2d/shape_2d_sw.cpp25
-rw-r--r--servers/physics_2d/shape_2d_sw.h11
-rw-r--r--servers/physics_2d/space_2d_sw.cpp340
-rw-r--r--servers/physics_2d/space_2d_sw.h23
-rw-r--r--servers/physics_2d/step_2d_sw.cpp1
-rw-r--r--servers/physics_2d/step_2d_sw.h1
-rw-r--r--servers/physics_2d_server.cpp82
-rw-r--r--servers/physics_2d_server.h54
-rw-r--r--servers/physics_server.cpp71
-rw-r--r--servers/physics_server.h87
-rw-r--r--servers/register_server_types.cpp29
-rw-r--r--servers/register_server_types.h1
-rw-r--r--servers/server_wrap_mt_common.h151
-rw-r--r--servers/visual/rasterizer.cpp103
-rw-r--r--servers/visual/rasterizer.h232
-rw-r--r--servers/visual/shader_language.cpp397
-rw-r--r--servers/visual/shader_language.h22
-rw-r--r--servers/visual/shader_types.cpp57
-rw-r--r--servers/visual/shader_types.h4
-rw-r--r--servers/visual/visual_server_canvas.cpp149
-rw-r--r--servers/visual/visual_server_canvas.h24
-rw-r--r--servers/visual/visual_server_global.cpp1
-rw-r--r--servers/visual/visual_server_global.h1
-rw-r--r--servers/visual/visual_server_light_baker.cpp1
-rw-r--r--servers/visual/visual_server_light_baker.h1
-rw-r--r--servers/visual/visual_server_raster.cpp113
-rw-r--r--servers/visual/visual_server_raster.h106
-rw-r--r--servers/visual/visual_server_scene.cpp173
-rw-r--r--servers/visual/visual_server_scene.h11
-rw-r--r--servers/visual/visual_server_viewport.cpp215
-rw-r--r--servers/visual/visual_server_viewport.h25
-rw-r--r--servers/visual/visual_server_wrap_mt.cpp193
-rw-r--r--servers/visual/visual_server_wrap_mt.h590
-rw-r--r--servers/visual_server.cpp112
-rw-r--r--servers/visual_server.h139
-rw-r--r--signal_renames.txt21
-rw-r--r--thirdparty/README.md178
-rw-r--r--thirdparty/b2d_convexdecomp/b2Glue.h (renamed from drivers/convex_decomp/b2Glue.h)0
-rw-r--r--thirdparty/b2d_convexdecomp/b2Polygon.cpp (renamed from drivers/convex_decomp/b2Polygon.cpp)0
-rw-r--r--thirdparty/b2d_convexdecomp/b2Polygon.h (renamed from drivers/convex_decomp/b2Polygon.h)0
-rw-r--r--thirdparty/b2d_convexdecomp/b2Triangle.cpp (renamed from drivers/convex_decomp/b2Triangle.cpp)0
-rw-r--r--thirdparty/b2d_convexdecomp/b2Triangle.h (renamed from drivers/convex_decomp/b2Triangle.h)0
-rw-r--r--thirdparty/enet/enet/godot.h1
-rw-r--r--thirdparty/enet/godot.cpp1
-rw-r--r--thirdparty/etc2comp/AUTHORS7
-rw-r--r--thirdparty/etc2comp/Etc.cpp128
-rw-r--r--thirdparty/etc2comp/Etc.h71
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4.cpp425
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4.h172
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding.cpp261
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding.h148
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4EncodingBits.h315
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_ETC1.cpp1281
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_ETC1.h186
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_R11.cpp429
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_R11.h122
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_RG11.cpp447
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_RG11.h86
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp1730
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.h96
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp1819
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.h129
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_RGBA8.cpp474
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_RGBA8.h121
-rw-r--r--thirdparty/etc2comp/EtcColor.h64
-rw-r--r--thirdparty/etc2comp/EtcColorFloatRGBA.h321
-rw-r--r--thirdparty/etc2comp/EtcConfig.h67
-rw-r--r--thirdparty/etc2comp/EtcDifferentialTrys.cpp173
-rw-r--r--thirdparty/etc2comp/EtcDifferentialTrys.h97
-rw-r--r--thirdparty/etc2comp/EtcErrorMetric.h54
-rw-r--r--thirdparty/etc2comp/EtcFile.cpp390
-rw-r--r--thirdparty/etc2comp/EtcFile.h136
-rw-r--r--thirdparty/etc2comp/EtcFileHeader.cpp185
-rw-r--r--thirdparty/etc2comp/EtcFileHeader.h146
-rw-r--r--thirdparty/etc2comp/EtcFilter.cpp401
-rw-r--r--thirdparty/etc2comp/EtcFilter.h244
-rw-r--r--thirdparty/etc2comp/EtcImage.cpp685
-rw-r--r--thirdparty/etc2comp/EtcImage.h249
-rw-r--r--thirdparty/etc2comp/EtcIndividualTrys.cpp85
-rw-r--r--thirdparty/etc2comp/EtcIndividualTrys.h95
-rw-r--r--thirdparty/etc2comp/EtcMath.cpp64
-rw-r--r--thirdparty/etc2comp/EtcMath.h40
-rw-r--r--thirdparty/etc2comp/EtcSortedBlockList.cpp228
-rw-r--r--thirdparty/etc2comp/EtcSortedBlockList.h124
-rw-r--r--thirdparty/etc2comp/LICENSE202
-rw-r--r--thirdparty/etc2comp/README.md197
-rw-r--r--thirdparty/freetype/include/freetype/config/ftconfig.h28
-rw-r--r--thirdparty/freetype/include/freetype/config/ftheader.h15
-rw-r--r--thirdparty/freetype/include/freetype/config/ftoption.h128
-rw-r--r--thirdparty/freetype/include/freetype/config/ftstdlib.h5
-rw-r--r--thirdparty/freetype/include/freetype/freetype.h1064
-rw-r--r--thirdparty/freetype/include/freetype/ftadvanc.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftautoh.h34
-rw-r--r--thirdparty/freetype/include/freetype/ftbbox.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftbdf.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftbitmap.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftbzip2.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftcache.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftcffdrv.h61
-rw-r--r--thirdparty/freetype/include/freetype/ftchapters.h1
-rw-r--r--thirdparty/freetype/include/freetype/ftcid.h2
-rw-r--r--thirdparty/freetype/include/freetype/fterrdef.h4
-rw-r--r--thirdparty/freetype/include/freetype/fterrors.h4
-rw-r--r--thirdparty/freetype/include/freetype/ftfntfmt.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftgasp.h16
-rw-r--r--thirdparty/freetype/include/freetype/ftglyph.h4
-rw-r--r--thirdparty/freetype/include/freetype/ftgxval.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftgzip.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftimage.h15
-rw-r--r--thirdparty/freetype/include/freetype/ftincrem.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftlcdfil.h37
-rw-r--r--thirdparty/freetype/include/freetype/ftlist.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftlzw.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftmac.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftmm.h210
-rw-r--r--thirdparty/freetype/include/freetype/ftmodapi.h49
-rw-r--r--thirdparty/freetype/include/freetype/ftmoderr.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftotval.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftoutln.h10
-rw-r--r--thirdparty/freetype/include/freetype/ftpcfdrv.h105
-rw-r--r--thirdparty/freetype/include/freetype/ftpfr.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftrender.h3
-rw-r--r--thirdparty/freetype/include/freetype/ftsizes.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftsnames.h147
-rw-r--r--thirdparty/freetype/include/freetype/ftstroke.h4
-rw-r--r--thirdparty/freetype/include/freetype/ftsynth.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftsystem.h2
-rw-r--r--thirdparty/freetype/include/freetype/fttrigon.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftttdrv.h13
-rw-r--r--thirdparty/freetype/include/freetype/fttypes.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftwinfnt.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/autohint.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftcalc.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftdebug.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftdriver.h11
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftgloadr.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftmemory.h11
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftobjs.h80
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftpic.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftrfork.h7
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftserv.h202
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftstream.h4
-rw-r--r--thirdparty/freetype/include/freetype/internal/fttrace.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftvalid.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/internal.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/psaux.h4
-rw-r--r--thirdparty/freetype/include/freetype/internal/pshints.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svbdf.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svcid.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svfntfmt.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svgldict.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svgxval.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svkern.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svmetric.h153
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svmm.h94
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svotval.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svpfr.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svpostnm.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svprop.h5
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svpscmap.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svpsinfo.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svsfnt.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svttcmap.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svtteng.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svttglyf.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svwinfnt.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/sfnt.h42
-rw-r--r--thirdparty/freetype/include/freetype/internal/t1types.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/tttypes.h263
-rw-r--r--thirdparty/freetype/include/freetype/t1tables.h6
-rw-r--r--thirdparty/freetype/include/freetype/ttnameid.h627
-rw-r--r--thirdparty/freetype/include/freetype/tttables.h363
-rw-r--r--thirdparty/freetype/include/freetype/tttags.h6
-rw-r--r--thirdparty/freetype/include/freetype/ttunpat.h4
-rw-r--r--thirdparty/freetype/include/ft2build.h3
-rw-r--r--thirdparty/freetype/src/autofit/afangles.c2
-rw-r--r--thirdparty/freetype/src/autofit/afblue.c290
-rw-r--r--thirdparty/freetype/src/autofit/afblue.cin2
-rw-r--r--thirdparty/freetype/src/autofit/afblue.dat366
-rw-r--r--thirdparty/freetype/src/autofit/afblue.h370
-rw-r--r--thirdparty/freetype/src/autofit/afblue.hin2
-rw-r--r--thirdparty/freetype/src/autofit/afcjk.c34
-rw-r--r--thirdparty/freetype/src/autofit/afcjk.h2
-rw-r--r--thirdparty/freetype/src/autofit/afcover.h2
-rw-r--r--thirdparty/freetype/src/autofit/afdummy.c14
-rw-r--r--thirdparty/freetype/src/autofit/afdummy.h2
-rw-r--r--thirdparty/freetype/src/autofit/aferrors.h2
-rw-r--r--thirdparty/freetype/src/autofit/afglobal.c22
-rw-r--r--thirdparty/freetype/src/autofit/afglobal.h2
-rw-r--r--thirdparty/freetype/src/autofit/afhints.c47
-rw-r--r--thirdparty/freetype/src/autofit/afhints.h3
-rw-r--r--thirdparty/freetype/src/autofit/afindic.c28
-rw-r--r--thirdparty/freetype/src/autofit/afindic.h2
-rw-r--r--thirdparty/freetype/src/autofit/aflatin.c160
-rw-r--r--thirdparty/freetype/src/autofit/aflatin.h2
-rw-r--r--thirdparty/freetype/src/autofit/aflatin2.c36
-rw-r--r--thirdparty/freetype/src/autofit/aflatin2.h2
-rw-r--r--thirdparty/freetype/src/autofit/afloader.c559
-rw-r--r--thirdparty/freetype/src/autofit/afloader.h2
-rw-r--r--thirdparty/freetype/src/autofit/afmodule.c164
-rw-r--r--thirdparty/freetype/src/autofit/afmodule.h2
-rw-r--r--thirdparty/freetype/src/autofit/afpic.c2
-rw-r--r--thirdparty/freetype/src/autofit/afpic.h4
-rw-r--r--thirdparty/freetype/src/autofit/afranges.c382
-rw-r--r--thirdparty/freetype/src/autofit/afranges.h2
-rw-r--r--thirdparty/freetype/src/autofit/afscript.h161
-rw-r--r--thirdparty/freetype/src/autofit/afshaper.c2
-rw-r--r--thirdparty/freetype/src/autofit/afshaper.h2
-rw-r--r--thirdparty/freetype/src/autofit/afstyles.h178
-rw-r--r--thirdparty/freetype/src/autofit/aftypes.h5
-rw-r--r--thirdparty/freetype/src/autofit/afwarp.c3
-rw-r--r--thirdparty/freetype/src/autofit/afwarp.h2
-rw-r--r--thirdparty/freetype/src/autofit/afwrtsys.h2
-rw-r--r--thirdparty/freetype/src/autofit/autofit.c25
-rw-r--r--thirdparty/freetype/src/autofit/module.mk2
-rw-r--r--thirdparty/freetype/src/autofit/rules.mk2
-rw-r--r--thirdparty/freetype/src/base/basepic.c2
-rw-r--r--thirdparty/freetype/src/base/basepic.h2
-rw-r--r--thirdparty/freetype/src/base/ftadvanc.c15
-rw-r--r--thirdparty/freetype/src/base/ftapi.c4
-rw-r--r--thirdparty/freetype/src/base/ftbase.c9
-rw-r--r--thirdparty/freetype/src/base/ftbase.h2
-rw-r--r--thirdparty/freetype/src/base/ftbbox.c28
-rw-r--r--thirdparty/freetype/src/base/ftbdf.c2
-rw-r--r--thirdparty/freetype/src/base/ftbitmap.c4
-rw-r--r--thirdparty/freetype/src/base/ftcalc.c10
-rw-r--r--thirdparty/freetype/src/base/ftcid.c2
-rw-r--r--thirdparty/freetype/src/base/ftdbgmem.c30
-rw-r--r--thirdparty/freetype/src/base/ftdebug.c2
-rw-r--r--thirdparty/freetype/src/base/ftfntfmt.c2
-rw-r--r--thirdparty/freetype/src/base/ftfstype.c2
-rw-r--r--thirdparty/freetype/src/base/ftgasp.c2
-rw-r--r--thirdparty/freetype/src/base/ftgloadr.c2
-rw-r--r--thirdparty/freetype/src/base/ftglyph.c38
-rw-r--r--thirdparty/freetype/src/base/ftgxval.c4
-rw-r--r--thirdparty/freetype/src/base/ftinit.c92
-rw-r--r--thirdparty/freetype/src/base/ftlcdfil.c54
-rw-r--r--thirdparty/freetype/src/base/ftmac.c42
-rw-r--r--thirdparty/freetype/src/base/ftmm.c187
-rw-r--r--thirdparty/freetype/src/base/ftobjs.c413
-rw-r--r--thirdparty/freetype/src/base/ftotval.c2
-rw-r--r--thirdparty/freetype/src/base/ftoutln.c4
-rw-r--r--thirdparty/freetype/src/base/ftpatent.c4
-rw-r--r--thirdparty/freetype/src/base/ftpfr.c2
-rw-r--r--thirdparty/freetype/src/base/ftpic.c2
-rw-r--r--thirdparty/freetype/src/base/ftrfork.c117
-rw-r--r--thirdparty/freetype/src/base/ftsnames.c60
-rw-r--r--thirdparty/freetype/src/base/ftstream.c2
-rw-r--r--thirdparty/freetype/src/base/ftstroke.c2
-rw-r--r--thirdparty/freetype/src/base/ftsynth.c4
-rw-r--r--thirdparty/freetype/src/base/ftsystem.c2
-rw-r--r--thirdparty/freetype/src/base/fttrigon.c2
-rw-r--r--thirdparty/freetype/src/base/fttype1.c2
-rw-r--r--thirdparty/freetype/src/base/ftutil.c8
-rw-r--r--thirdparty/freetype/src/base/ftwinfnt.c2
-rw-r--r--thirdparty/freetype/src/base/rules.mk2
-rw-r--r--thirdparty/freetype/src/bdf/bdf.c3
-rw-r--r--thirdparty/freetype/src/bdf/bdfdrivr.c26
-rw-r--r--thirdparty/freetype/src/bdf/bdflib.c6
-rw-r--r--thirdparty/freetype/src/bzip2/ftbzip2.c525
-rw-r--r--thirdparty/freetype/src/bzip2/rules.mk64
-rw-r--r--thirdparty/freetype/src/cache/ftcache.c11
-rw-r--r--thirdparty/freetype/src/cache/ftcbasic.c53
-rw-r--r--thirdparty/freetype/src/cache/ftccache.c16
-rw-r--r--thirdparty/freetype/src/cache/ftccache.h8
-rw-r--r--thirdparty/freetype/src/cache/ftccback.h2
-rw-r--r--thirdparty/freetype/src/cache/ftccmap.c16
-rw-r--r--thirdparty/freetype/src/cache/ftcerror.h2
-rw-r--r--thirdparty/freetype/src/cache/ftcglyph.c2
-rw-r--r--thirdparty/freetype/src/cache/ftcglyph.h2
-rw-r--r--thirdparty/freetype/src/cache/ftcimage.c2
-rw-r--r--thirdparty/freetype/src/cache/ftcimage.h2
-rw-r--r--thirdparty/freetype/src/cache/ftcmanag.c23
-rw-r--r--thirdparty/freetype/src/cache/ftcmanag.h2
-rw-r--r--thirdparty/freetype/src/cache/ftcmru.c12
-rw-r--r--thirdparty/freetype/src/cache/ftcmru.h4
-rw-r--r--thirdparty/freetype/src/cache/ftcsbits.c4
-rw-r--r--thirdparty/freetype/src/cache/ftcsbits.h2
-rw-r--r--thirdparty/freetype/src/cache/rules.mk2
-rw-r--r--thirdparty/freetype/src/cff/cf2arrst.c20
-rw-r--r--thirdparty/freetype/src/cff/cf2error.c2
-rw-r--r--thirdparty/freetype/src/cff/cf2error.h2
-rw-r--r--thirdparty/freetype/src/cff/cf2fixed.h4
-rw-r--r--thirdparty/freetype/src/cff/cf2font.c54
-rw-r--r--thirdparty/freetype/src/cff/cf2font.h8
-rw-r--r--thirdparty/freetype/src/cff/cf2ft.c57
-rw-r--r--thirdparty/freetype/src/cff/cf2ft.h12
-rw-r--r--thirdparty/freetype/src/cff/cf2hints.c4
-rw-r--r--thirdparty/freetype/src/cff/cf2intrp.c987
-rw-r--r--thirdparty/freetype/src/cff/cf2stack.c77
-rw-r--r--thirdparty/freetype/src/cff/cf2stack.h14
-rw-r--r--thirdparty/freetype/src/cff/cff.c10
-rw-r--r--thirdparty/freetype/src/cff/cffcmap.c39
-rw-r--r--thirdparty/freetype/src/cff/cffcmap.h2
-rw-r--r--thirdparty/freetype/src/cff/cffdrivr.c399
-rw-r--r--thirdparty/freetype/src/cff/cffdrivr.h2
-rw-r--r--thirdparty/freetype/src/cff/cfferrs.h2
-rw-r--r--thirdparty/freetype/src/cff/cffgload.c60
-rw-r--r--thirdparty/freetype/src/cff/cffgload.h2
-rw-r--r--thirdparty/freetype/src/cff/cffload.c1042
-rw-r--r--thirdparty/freetype/src/cff/cffload.h57
-rw-r--r--thirdparty/freetype/src/cff/cffobjs.c124
-rw-r--r--thirdparty/freetype/src/cff/cffobjs.h10
-rw-r--r--thirdparty/freetype/src/cff/cffparse.c327
-rw-r--r--thirdparty/freetype/src/cff/cffparse.h35
-rw-r--r--thirdparty/freetype/src/cff/cffpic.c2
-rw-r--r--thirdparty/freetype/src/cff/cffpic.h32
-rw-r--r--thirdparty/freetype/src/cff/cfftoken.h51
-rw-r--r--thirdparty/freetype/src/cff/cfftypes.h128
-rw-r--r--thirdparty/freetype/src/cff/module.mk2
-rw-r--r--thirdparty/freetype/src/cff/rules.mk2
-rw-r--r--thirdparty/freetype/src/cid/ciderrs.h2
-rw-r--r--thirdparty/freetype/src/cid/cidgload.c2
-rw-r--r--thirdparty/freetype/src/cid/cidgload.h2
-rw-r--r--thirdparty/freetype/src/cid/cidload.c18
-rw-r--r--thirdparty/freetype/src/cid/cidload.h2
-rw-r--r--thirdparty/freetype/src/cid/cidobjs.c12
-rw-r--r--thirdparty/freetype/src/cid/cidobjs.h2
-rw-r--r--thirdparty/freetype/src/cid/cidparse.c14
-rw-r--r--thirdparty/freetype/src/cid/cidparse.h2
-rw-r--r--thirdparty/freetype/src/cid/cidriver.c12
-rw-r--r--thirdparty/freetype/src/cid/cidriver.h2
-rw-r--r--thirdparty/freetype/src/cid/cidtoken.h2
-rw-r--r--thirdparty/freetype/src/cid/module.mk2
-rw-r--r--thirdparty/freetype/src/cid/rules.mk2
-rw-r--r--thirdparty/freetype/src/cid/type1cid.c8
-rw-r--r--thirdparty/freetype/src/gxvalid/README4
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvalid.c16
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvalid.h4
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvbsln.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvcommn.c20
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvcommn.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxverror.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvfeat.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvfeat.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvfgen.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvjust.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvkern.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvlcar.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmod.c10
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmod.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort.c4
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort0.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort1.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort2.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort4.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort5.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx.c4
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx0.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx1.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx2.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx4.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx5.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvopbd.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvprop.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvtrak.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/module.mk2
-rw-r--r--thirdparty/freetype/src/gxvalid/rules.mk2
-rw-r--r--thirdparty/freetype/src/gzip/adler32.c48
-rw-r--r--thirdparty/freetype/src/gzip/ftgzip.c816
-rw-r--r--thirdparty/freetype/src/gzip/ftzconf.h284
-rw-r--r--thirdparty/freetype/src/gzip/infblock.c387
-rw-r--r--thirdparty/freetype/src/gzip/infblock.h36
-rw-r--r--thirdparty/freetype/src/gzip/infcodes.c250
-rw-r--r--thirdparty/freetype/src/gzip/infcodes.h31
-rw-r--r--thirdparty/freetype/src/gzip/inffixed.h151
-rw-r--r--thirdparty/freetype/src/gzip/inflate.c273
-rw-r--r--thirdparty/freetype/src/gzip/inftrees.c468
-rw-r--r--thirdparty/freetype/src/gzip/inftrees.h63
-rw-r--r--thirdparty/freetype/src/gzip/infutil.c86
-rw-r--r--thirdparty/freetype/src/gzip/infutil.h98
-rw-r--r--thirdparty/freetype/src/gzip/rules.mk83
-rw-r--r--thirdparty/freetype/src/gzip/zlib.h830
-rw-r--r--thirdparty/freetype/src/gzip/zutil.c181
-rw-r--r--thirdparty/freetype/src/gzip/zutil.h215
-rw-r--r--thirdparty/freetype/src/lzw/ftlzw.c420
-rw-r--r--thirdparty/freetype/src/lzw/ftzopen.c424
-rw-r--r--thirdparty/freetype/src/lzw/ftzopen.h172
-rw-r--r--thirdparty/freetype/src/lzw/rules.mk72
-rw-r--r--thirdparty/freetype/src/otvalid/module.mk2
-rw-r--r--thirdparty/freetype/src/otvalid/otvalid.c5
-rw-r--r--thirdparty/freetype/src/otvalid/otvalid.h2
-rw-r--r--thirdparty/freetype/src/otvalid/otvbase.c2
-rw-r--r--thirdparty/freetype/src/otvalid/otvcommn.c4
-rw-r--r--thirdparty/freetype/src/otvalid/otvcommn.h2
-rw-r--r--thirdparty/freetype/src/otvalid/otverror.h2
-rw-r--r--thirdparty/freetype/src/otvalid/otvgdef.c2
-rw-r--r--thirdparty/freetype/src/otvalid/otvgpos.c2
-rw-r--r--thirdparty/freetype/src/otvalid/otvgpos.h2
-rw-r--r--thirdparty/freetype/src/otvalid/otvgsub.c2
-rw-r--r--thirdparty/freetype/src/otvalid/otvjstf.c2
-rw-r--r--thirdparty/freetype/src/otvalid/otvmath.c22
-rw-r--r--thirdparty/freetype/src/otvalid/otvmod.c10
-rw-r--r--thirdparty/freetype/src/otvalid/otvmod.h2
-rw-r--r--thirdparty/freetype/src/otvalid/rules.mk2
-rw-r--r--thirdparty/freetype/src/pcf/pcf.c8
-rw-r--r--thirdparty/freetype/src/pcf/pcf.h9
-rw-r--r--thirdparty/freetype/src/pcf/pcfdrivr.c223
-rw-r--r--thirdparty/freetype/src/pcf/pcfread.c350
-rw-r--r--thirdparty/freetype/src/pfr/module.mk2
-rw-r--r--thirdparty/freetype/src/pfr/pfr.c11
-rw-r--r--thirdparty/freetype/src/pfr/pfrcmap.c16
-rw-r--r--thirdparty/freetype/src/pfr/pfrcmap.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrdrivr.c20
-rw-r--r--thirdparty/freetype/src/pfr/pfrdrivr.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrerror.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrgload.c2
-rw-r--r--thirdparty/freetype/src/pfr/pfrgload.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrload.c6
-rw-r--r--thirdparty/freetype/src/pfr/pfrload.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrobjs.c12
-rw-r--r--thirdparty/freetype/src/pfr/pfrobjs.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrsbit.c8
-rw-r--r--thirdparty/freetype/src/pfr/pfrsbit.h5
-rw-r--r--thirdparty/freetype/src/pfr/pfrtypes.h2
-rw-r--r--thirdparty/freetype/src/pfr/rules.mk2
-rw-r--r--thirdparty/freetype/src/psaux/afmparse.c11
-rw-r--r--thirdparty/freetype/src/psaux/afmparse.h2
-rw-r--r--thirdparty/freetype/src/psaux/module.mk2
-rw-r--r--thirdparty/freetype/src/psaux/psaux.c14
-rw-r--r--thirdparty/freetype/src/psaux/psauxerr.h2
-rw-r--r--thirdparty/freetype/src/psaux/psauxmod.c74
-rw-r--r--thirdparty/freetype/src/psaux/psauxmod.h2
-rw-r--r--thirdparty/freetype/src/psaux/psconv.c2
-rw-r--r--thirdparty/freetype/src/psaux/psconv.h2
-rw-r--r--thirdparty/freetype/src/psaux/psobjs.c42
-rw-r--r--thirdparty/freetype/src/psaux/psobjs.h2
-rw-r--r--thirdparty/freetype/src/psaux/rules.mk2
-rw-r--r--thirdparty/freetype/src/psaux/t1cmap.c64
-rw-r--r--thirdparty/freetype/src/psaux/t1cmap.h2
-rw-r--r--thirdparty/freetype/src/psaux/t1decode.c74
-rw-r--r--thirdparty/freetype/src/psaux/t1decode.h2
-rw-r--r--thirdparty/freetype/src/pshinter/module.mk2
-rw-r--r--thirdparty/freetype/src/pshinter/pshalgo.c12
-rw-r--r--thirdparty/freetype/src/pshinter/pshalgo.h2
-rw-r--r--thirdparty/freetype/src/pshinter/pshglob.c2
-rw-r--r--thirdparty/freetype/src/pshinter/pshglob.h2
-rw-r--r--thirdparty/freetype/src/pshinter/pshinter.c10
-rw-r--r--thirdparty/freetype/src/pshinter/pshmod.c14
-rw-r--r--thirdparty/freetype/src/pshinter/pshmod.h2
-rw-r--r--thirdparty/freetype/src/pshinter/pshnterr.h2
-rw-r--r--thirdparty/freetype/src/pshinter/pshpic.c2
-rw-r--r--thirdparty/freetype/src/pshinter/pshpic.h2
-rw-r--r--thirdparty/freetype/src/pshinter/pshrec.c8
-rw-r--r--thirdparty/freetype/src/pshinter/pshrec.h2
-rw-r--r--thirdparty/freetype/src/pshinter/rules.mk2
-rw-r--r--thirdparty/freetype/src/psnames/module.mk2
-rw-r--r--thirdparty/freetype/src/psnames/psmodule.c22
-rw-r--r--thirdparty/freetype/src/psnames/psmodule.h2
-rw-r--r--thirdparty/freetype/src/psnames/psnamerr.h2
-rw-r--r--thirdparty/freetype/src/psnames/psnames.c6
-rw-r--r--thirdparty/freetype/src/psnames/pspic.c2
-rw-r--r--thirdparty/freetype/src/psnames/pspic.h2
-rw-r--r--thirdparty/freetype/src/psnames/pstables.h94
-rw-r--r--thirdparty/freetype/src/psnames/rules.mk2
-rw-r--r--thirdparty/freetype/src/raster/ftmisc.h2
-rw-r--r--thirdparty/freetype/src/raster/ftraster.c33
-rw-r--r--thirdparty/freetype/src/raster/ftraster.h2
-rw-r--r--thirdparty/freetype/src/raster/ftrend1.c26
-rw-r--r--thirdparty/freetype/src/raster/ftrend1.h2
-rw-r--r--thirdparty/freetype/src/raster/module.mk2
-rw-r--r--thirdparty/freetype/src/raster/raster.c6
-rw-r--r--thirdparty/freetype/src/raster/rasterrs.h2
-rw-r--r--thirdparty/freetype/src/raster/rastpic.c2
-rw-r--r--thirdparty/freetype/src/raster/rastpic.h2
-rw-r--r--thirdparty/freetype/src/raster/rules.mk2
-rw-r--r--thirdparty/freetype/src/sfnt/module.mk2
-rw-r--r--thirdparty/freetype/src/sfnt/pngshim.c41
-rw-r--r--thirdparty/freetype/src/sfnt/pngshim.h5
-rw-r--r--thirdparty/freetype/src/sfnt/rules.mk2
-rw-r--r--thirdparty/freetype/src/sfnt/sfdriver.c968
-rw-r--r--thirdparty/freetype/src/sfnt/sfdriver.h2
-rw-r--r--thirdparty/freetype/src/sfnt/sferrors.h2
-rw-r--r--thirdparty/freetype/src/sfnt/sfnt.c26
-rw-r--r--thirdparty/freetype/src/sfnt/sfntpic.c2
-rw-r--r--thirdparty/freetype/src/sfnt/sfntpic.h2
-rw-r--r--thirdparty/freetype/src/sfnt/sfobjs.c321
-rw-r--r--thirdparty/freetype/src/sfnt/sfobjs.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttbdf.c15
-rw-r--r--thirdparty/freetype/src/sfnt/ttbdf.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttcmap.c340
-rw-r--r--thirdparty/freetype/src/sfnt/ttcmap.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttcmapc.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttkern.c9
-rw-r--r--thirdparty/freetype/src/sfnt/ttkern.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttload.c160
-rw-r--r--thirdparty/freetype/src/sfnt/ttload.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttmtx.c48
-rw-r--r--thirdparty/freetype/src/sfnt/ttmtx.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttpost.c17
-rw-r--r--thirdparty/freetype/src/sfnt/ttpost.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttsbit.c228
-rw-r--r--thirdparty/freetype/src/sfnt/ttsbit.h2
-rw-r--r--thirdparty/freetype/src/smooth/ftgrays.c576
-rw-r--r--thirdparty/freetype/src/smooth/ftgrays.h2
-rw-r--r--thirdparty/freetype/src/smooth/ftsmerrs.h2
-rw-r--r--thirdparty/freetype/src/smooth/ftsmooth.c152
-rw-r--r--thirdparty/freetype/src/smooth/ftsmooth.h11
-rw-r--r--thirdparty/freetype/src/smooth/ftspic.c2
-rw-r--r--thirdparty/freetype/src/smooth/ftspic.h2
-rw-r--r--thirdparty/freetype/src/smooth/module.mk2
-rw-r--r--thirdparty/freetype/src/smooth/rules.mk2
-rw-r--r--thirdparty/freetype/src/smooth/smooth.c6
-rw-r--r--thirdparty/freetype/src/truetype/module.mk2
-rw-r--r--thirdparty/freetype/src/truetype/rules.mk2
-rw-r--r--thirdparty/freetype/src/truetype/truetype.c18
-rw-r--r--thirdparty/freetype/src/truetype/ttdriver.c153
-rw-r--r--thirdparty/freetype/src/truetype/ttdriver.h2
-rw-r--r--thirdparty/freetype/src/truetype/tterrors.h2
-rw-r--r--thirdparty/freetype/src/truetype/ttgload.c309
-rw-r--r--thirdparty/freetype/src/truetype/ttgload.h2
-rw-r--r--thirdparty/freetype/src/truetype/ttgxvar.c2068
-rw-r--r--thirdparty/freetype/src/truetype/ttgxvar.h289
-rw-r--r--thirdparty/freetype/src/truetype/ttinterp.c399
-rw-r--r--thirdparty/freetype/src/truetype/ttinterp.h23
-rw-r--r--thirdparty/freetype/src/truetype/ttobjs.c260
-rw-r--r--thirdparty/freetype/src/truetype/ttobjs.h10
-rw-r--r--thirdparty/freetype/src/truetype/ttpic.c2
-rw-r--r--thirdparty/freetype/src/truetype/ttpic.h23
-rw-r--r--thirdparty/freetype/src/truetype/ttpload.c69
-rw-r--r--thirdparty/freetype/src/truetype/ttpload.h2
-rw-r--r--thirdparty/freetype/src/truetype/ttsubpix.c13
-rw-r--r--thirdparty/freetype/src/truetype/ttsubpix.h2
-rw-r--r--thirdparty/freetype/src/type1/module.mk2
-rw-r--r--thirdparty/freetype/src/type1/rules.mk2
-rw-r--r--thirdparty/freetype/src/type1/t1afm.c17
-rw-r--r--thirdparty/freetype/src/type1/t1afm.h2
-rw-r--r--thirdparty/freetype/src/type1/t1driver.c17
-rw-r--r--thirdparty/freetype/src/type1/t1driver.h2
-rw-r--r--thirdparty/freetype/src/type1/t1errors.h2
-rw-r--r--thirdparty/freetype/src/type1/t1gload.c2
-rw-r--r--thirdparty/freetype/src/type1/t1gload.h2
-rw-r--r--thirdparty/freetype/src/type1/t1load.c108
-rw-r--r--thirdparty/freetype/src/type1/t1load.h16
-rw-r--r--thirdparty/freetype/src/type1/t1objs.c15
-rw-r--r--thirdparty/freetype/src/type1/t1objs.h2
-rw-r--r--thirdparty/freetype/src/type1/t1parse.c4
-rw-r--r--thirdparty/freetype/src/type1/t1parse.h2
-rw-r--r--thirdparty/freetype/src/type1/t1tokens.h2
-rw-r--r--thirdparty/freetype/src/type1/type1.c15
-rw-r--r--thirdparty/freetype/src/type42/module.mk2
-rw-r--r--thirdparty/freetype/src/type42/rules.mk2
-rw-r--r--thirdparty/freetype/src/type42/t42drivr.c13
-rw-r--r--thirdparty/freetype/src/type42/t42drivr.h2
-rw-r--r--thirdparty/freetype/src/type42/t42error.h2
-rw-r--r--thirdparty/freetype/src/type42/t42objs.c9
-rw-r--r--thirdparty/freetype/src/type42/t42objs.h2
-rw-r--r--thirdparty/freetype/src/type42/t42parse.c6
-rw-r--r--thirdparty/freetype/src/type42/t42parse.h2
-rw-r--r--thirdparty/freetype/src/type42/t42types.h2
-rw-r--r--thirdparty/freetype/src/type42/type42.c8
-rw-r--r--thirdparty/freetype/src/winfonts/fnterrs.h2
-rw-r--r--thirdparty/freetype/src/winfonts/module.mk2
-rw-r--r--thirdparty/freetype/src/winfonts/rules.mk2
-rw-r--r--thirdparty/freetype/src/winfonts/winfnt.c79
-rw-r--r--thirdparty/freetype/src/winfonts/winfnt.h2
-rw-r--r--thirdparty/glad/glad.c14
-rw-r--r--thirdparty/glad/glad/glad.h175
-rw-r--r--thirdparty/libpng/arm/filter_neon.S6
-rw-r--r--thirdparty/libpng/png.c124
-rw-r--r--thirdparty/libpng/png.h53
-rw-r--r--thirdparty/libpng/pngconf.h2
-rw-r--r--thirdparty/libpng/pngerror.c8
-rw-r--r--thirdparty/libpng/pngget.c18
-rw-r--r--thirdparty/libpng/pnginfo.h5
-rw-r--r--thirdparty/libpng/pnglibconf.h11
-rw-r--r--thirdparty/libpng/pngpriv.h140
-rw-r--r--thirdparty/libpng/pngread.c15
-rw-r--r--thirdparty/libpng/pngrtran.c21
-rw-r--r--thirdparty/libpng/pngrutil.c65
-rw-r--r--thirdparty/libpng/pngset.c48
-rw-r--r--thirdparty/libpng/pngstruct.h3
-rw-r--r--thirdparty/libpng/pngtrans.c38
-rw-r--r--thirdparty/libpng/pngwrite.c10
-rw-r--r--thirdparty/libpng/pngwutil.c56
-rw-r--r--thirdparty/minizip/LICENSE-InfoZip.txt (renamed from core/io/LICENSE-InfoZip.txt)0
-rw-r--r--thirdparty/minizip/LICENSE-MiniZip.txt (renamed from core/io/LICENSE-MiniZip.txt)0
-rw-r--r--thirdparty/minizip/crypt.h (renamed from core/io/crypt.h)0
-rw-r--r--thirdparty/minizip/ioapi.c (renamed from core/io/ioapi.c)0
-rw-r--r--thirdparty/minizip/ioapi.h (renamed from core/io/ioapi.h)0
-rw-r--r--thirdparty/minizip/unzip.c (renamed from core/io/unzip.c)0
-rw-r--r--thirdparty/minizip/unzip.h (renamed from core/io/unzip.h)0
-rw-r--r--thirdparty/minizip/zip.c (renamed from core/io/zip.c)0
-rw-r--r--thirdparty/minizip/zip.h (renamed from core/io/zip.h)0
-rw-r--r--thirdparty/misc/aes256.cpp (renamed from core/io/aes256.cpp)0
-rw-r--r--thirdparty/misc/aes256.h (renamed from core/io/aes256.h)0
-rw-r--r--thirdparty/misc/base64.c (renamed from core/io/base64.c)0
-rw-r--r--thirdparty/misc/base64.h (renamed from core/io/base64.h)5
-rw-r--r--thirdparty/misc/curl_hostcheck.c (renamed from modules/openssl/curl_hostcheck.c)0
-rw-r--r--thirdparty/misc/curl_hostcheck.h (renamed from modules/openssl/curl_hostcheck.h)0
-rw-r--r--thirdparty/misc/fastlz.c (renamed from core/io/fastlz.c)0
-rw-r--r--thirdparty/misc/fastlz.h (renamed from core/io/fastlz.h)0
-rw-r--r--thirdparty/misc/hq2x.cpp (renamed from core/hq2x.cpp)0
-rw-r--r--thirdparty/misc/hq2x.h (renamed from core/hq2x.h)0
-rw-r--r--thirdparty/misc/md5.cpp (renamed from core/io/md5.cpp)4
-rw-r--r--thirdparty/misc/md5.h (renamed from core/io/md5.h)0
-rw-r--r--thirdparty/misc/mikktspace.c (renamed from scene/resources/mikktspace.c)0
-rw-r--r--thirdparty/misc/mikktspace.h (renamed from scene/resources/mikktspace.h)0
-rw-r--r--thirdparty/misc/pcg.cpp (renamed from core/math/pcg.cpp)0
-rw-r--r--thirdparty/misc/pcg.h (renamed from core/math/pcg.h)0
-rw-r--r--thirdparty/misc/sha256.c (renamed from core/io/sha256.c)0
-rw-r--r--thirdparty/misc/sha256.h (renamed from core/io/sha256.h)0
-rw-r--r--thirdparty/misc/smaz.c207
-rw-r--r--thirdparty/misc/smaz.h20
-rw-r--r--thirdparty/misc/stb_truetype.h (renamed from scene/resources/stb_truetype.h)0
-rw-r--r--thirdparty/misc/stb_vorbis.c (renamed from thirdparty/stb_vorbis/stb_vorbis.c)0
-rw-r--r--thirdparty/misc/triangulator.cpp (renamed from core/math/triangulator.cpp)0
-rw-r--r--thirdparty/misc/triangulator.h (renamed from core/math/triangulator.h)0
-rw-r--r--thirdparty/misc/yuv2rgb.h (renamed from modules/theora/yuv2rgb.h)25
-rw-r--r--thirdparty/openssl/crypto/LPdir_nyi.c3
-rw-r--r--thirdparty/openssl/crypto/LPdir_unix.c4
-rw-r--r--thirdparty/openssl/crypto/LPdir_win32.c4
-rw-r--r--thirdparty/openssl/crypto/LPdir_wince.c4
-rw-r--r--thirdparty/openssl/crypto/asn1/a_bitstr.c7
-rw-r--r--thirdparty/openssl/crypto/asn1/a_bytes.c58
-rw-r--r--thirdparty/openssl/crypto/asn1/a_digest.c8
-rw-r--r--thirdparty/openssl/crypto/asn1/a_gentm.c2
-rw-r--r--thirdparty/openssl/crypto/asn1/a_object.c10
-rw-r--r--thirdparty/openssl/crypto/asn1/a_set.c9
-rw-r--r--thirdparty/openssl/crypto/asn1/a_strex.c2
-rw-r--r--thirdparty/openssl/crypto/asn1/a_strnid.c4
-rw-r--r--thirdparty/openssl/crypto/asn1/a_time.c26
-rw-r--r--thirdparty/openssl/crypto/asn1/a_utctm.c2
-rw-r--r--thirdparty/openssl/crypto/asn1/ameth_lib.c2
-rw-r--r--thirdparty/openssl/crypto/asn1/asn1_lib.c32
-rw-r--r--thirdparty/openssl/crypto/asn1/asn_mime.c4
-rw-r--r--thirdparty/openssl/crypto/asn1/bio_asn1.c6
-rw-r--r--thirdparty/openssl/crypto/asn1/bio_ndef.c1
-rw-r--r--thirdparty/openssl/crypto/asn1/d2i_pr.c8
-rw-r--r--thirdparty/openssl/crypto/asn1/f_enum.c6
-rw-r--r--thirdparty/openssl/crypto/asn1/f_int.c6
-rw-r--r--thirdparty/openssl/crypto/asn1/f_string.c4
-rw-r--r--thirdparty/openssl/crypto/asn1/i2d_pr.c9
-rw-r--r--thirdparty/openssl/crypto/asn1/p5_pbe.c2
-rw-r--r--thirdparty/openssl/crypto/asn1/p5_pbev2.c12
-rw-r--r--thirdparty/openssl/crypto/asn1/t_req.c1
-rw-r--r--thirdparty/openssl/crypto/asn1/tasn_dec.c9
-rw-r--r--thirdparty/openssl/crypto/asn1/tasn_enc.c26
-rw-r--r--thirdparty/openssl/crypto/asn1/tasn_new.c11
-rw-r--r--thirdparty/openssl/crypto/asn1/tasn_prn.c16
-rw-r--r--thirdparty/openssl/crypto/asn1/tasn_utl.c2
-rw-r--r--thirdparty/openssl/crypto/asn1/x_bignum.c15
-rw-r--r--thirdparty/openssl/crypto/asn1/x_crl.c3
-rw-r--r--thirdparty/openssl/crypto/asn1/x_long.c38
-rw-r--r--thirdparty/openssl/crypto/asn1/x_name.c41
-rw-r--r--thirdparty/openssl/crypto/asn1/x_x509.c54
-rw-r--r--thirdparty/openssl/crypto/bio/b_print.c14
-rw-r--r--thirdparty/openssl/crypto/bio/bf_nbio.c4
-rw-r--r--thirdparty/openssl/crypto/bio/bio_cb.c3
-rw-r--r--thirdparty/openssl/crypto/bio/bss_bio.c19
-rw-r--r--thirdparty/openssl/crypto/bio/bss_file.c26
-rw-r--r--thirdparty/openssl/crypto/bio/bss_rtcp.c2
-rw-r--r--thirdparty/openssl/crypto/bn/asm/x86_64-gcc.c2
-rw-r--r--thirdparty/openssl/crypto/bn/bn_div.c4
-rw-r--r--thirdparty/openssl/crypto/bn/bn_exp.c5
-rw-r--r--thirdparty/openssl/crypto/bn/bn_lib.c2
-rw-r--r--thirdparty/openssl/crypto/bn/bn_mul.c5
-rw-r--r--thirdparty/openssl/crypto/bn/bn_prime.c23
-rw-r--r--thirdparty/openssl/crypto/bn/bn_prime.h514
-rw-r--r--thirdparty/openssl/crypto/bn/bn_print.c37
-rw-r--r--thirdparty/openssl/crypto/bn/bn_rand.c23
-rw-r--r--thirdparty/openssl/crypto/bn/bn_sqr.c5
-rw-r--r--thirdparty/openssl/crypto/bn/bn_word.c22
-rw-r--r--thirdparty/openssl/crypto/cms/cms_enc.c12
-rw-r--r--thirdparty/openssl/crypto/cms/cms_ess.c3
-rw-r--r--thirdparty/openssl/crypto/cms/cms_kari.c5
-rw-r--r--thirdparty/openssl/crypto/cms/cms_lib.c4
-rw-r--r--thirdparty/openssl/crypto/cms/cms_pwri.c4
-rw-r--r--thirdparty/openssl/crypto/comp/c_rle.c25
-rw-r--r--thirdparty/openssl/crypto/conf/conf_def.c16
-rw-r--r--thirdparty/openssl/crypto/conf/conf_def.h44
-rw-r--r--thirdparty/openssl/crypto/conf/conf_err.c2
-rw-r--r--thirdparty/openssl/crypto/conf/conf_mod.c4
-rw-r--r--thirdparty/openssl/crypto/conf/ssleay.cnf78
-rw-r--r--thirdparty/openssl/crypto/crypto-lib.com1537
-rw-r--r--thirdparty/openssl/crypto/des/asm/des_enc.m42101
-rw-r--r--thirdparty/openssl/crypto/des/des-lib.com1005
-rw-r--r--thirdparty/openssl/crypto/des/des.c2
-rw-r--r--thirdparty/openssl/crypto/des/enc_writ.c2
-rw-r--r--thirdparty/openssl/crypto/des/makefile.bc50
-rw-r--r--thirdparty/openssl/crypto/des/set_key.c2
-rw-r--r--thirdparty/openssl/crypto/des/t/test27
-rw-r--r--thirdparty/openssl/crypto/des/times/486-50.sol16
-rw-r--r--thirdparty/openssl/crypto/des/times/586-100.lnx20
-rw-r--r--thirdparty/openssl/crypto/des/times/686-200.fre18
-rw-r--r--thirdparty/openssl/crypto/des/times/sparc.gcc17
-rw-r--r--thirdparty/openssl/crypto/dh/dh_ameth.c2
-rw-r--r--thirdparty/openssl/crypto/dh/dh_key.c2
-rw-r--r--thirdparty/openssl/crypto/dsa/dsa_ameth.c2
-rw-r--r--thirdparty/openssl/crypto/dsa/dsa_gen.c7
-rw-r--r--thirdparty/openssl/crypto/dsa/dsa_ossl.c7
-rw-r--r--thirdparty/openssl/crypto/dsa/dsa_pmeth.c2
-rw-r--r--thirdparty/openssl/crypto/ec/ec2_mult.c20
-rw-r--r--thirdparty/openssl/crypto/ec/ec_ameth.c36
-rw-r--r--thirdparty/openssl/crypto/ec/ec_asn1.c11
-rw-r--r--thirdparty/openssl/crypto/ec/ec_key.c13
-rw-r--r--thirdparty/openssl/crypto/ec/ec_mult.c12
-rw-r--r--thirdparty/openssl/crypto/ec/eck_prn.c2
-rw-r--r--thirdparty/openssl/crypto/ec/ecp_nistz256.c125
-rw-r--r--thirdparty/openssl/crypto/ecdh/ech_ossl.c4
-rw-r--r--thirdparty/openssl/crypto/engine/eng_cryptodev.c34
-rw-r--r--thirdparty/openssl/crypto/err/err.c4
-rw-r--r--thirdparty/openssl/crypto/err/openssl.ec98
-rw-r--r--thirdparty/openssl/crypto/evp/bio_enc.c21
-rw-r--r--thirdparty/openssl/crypto/evp/bio_ok.c2
-rw-r--r--thirdparty/openssl/crypto/evp/c_all.c5
-rw-r--r--thirdparty/openssl/crypto/evp/digest.c16
-rw-r--r--thirdparty/openssl/crypto/evp/e_aes.c13
-rw-r--r--thirdparty/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c2
-rw-r--r--thirdparty/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c6
-rw-r--r--thirdparty/openssl/crypto/evp/e_des3.c2
-rw-r--r--thirdparty/openssl/crypto/evp/e_rc4_hmac_md5.c6
-rw-r--r--thirdparty/openssl/crypto/evp/e_seed.c3
-rw-r--r--thirdparty/openssl/crypto/evp/evp_enc.c11
-rw-r--r--thirdparty/openssl/crypto/evp/evp_err.c3
-rw-r--r--thirdparty/openssl/crypto/evp/evptests.txt401
-rw-r--r--thirdparty/openssl/crypto/evp/openbsd_hw.c22
-rw-r--r--thirdparty/openssl/crypto/evp/p_lib.c8
-rw-r--r--thirdparty/openssl/crypto/evp/pmeth_fn.c30
-rw-r--r--thirdparty/openssl/crypto/evp/pmeth_gn.c4
-rw-r--r--thirdparty/openssl/crypto/evp/pmeth_lib.c32
-rw-r--r--thirdparty/openssl/crypto/ex_data.c41
-rw-r--r--thirdparty/openssl/crypto/hmac/hm_pmeth.c11
-rw-r--r--thirdparty/openssl/crypto/hmac/hmac.c2
-rw-r--r--thirdparty/openssl/crypto/include/internal/bn_conf.h28
-rw-r--r--thirdparty/openssl/crypto/include/internal/dso_conf.h16
-rwxr-xr-xthirdparty/openssl/crypto/install-crypto.com196
-rw-r--r--thirdparty/openssl/crypto/jpake/jpake.c4
-rw-r--r--thirdparty/openssl/crypto/lhash/lhash.c2
-rw-r--r--thirdparty/openssl/crypto/md2/md2_dgst.c2
-rw-r--r--thirdparty/openssl/crypto/md32_common.h10
-rw-r--r--thirdparty/openssl/crypto/mdc2/mdc2dgst.c2
-rw-r--r--thirdparty/openssl/crypto/mem.c48
-rw-r--r--thirdparty/openssl/crypto/mem_clr.c24
-rw-r--r--thirdparty/openssl/crypto/modes/ctr128.c2
-rw-r--r--thirdparty/openssl/crypto/o_dir.c3
-rw-r--r--thirdparty/openssl/crypto/o_init.c3
-rw-r--r--thirdparty/openssl/crypto/o_str.c9
-rwxr-xr-x[-rw-r--r--]thirdparty/openssl/crypto/o_time.c80
-rw-r--r--thirdparty/openssl/crypto/objects/o_names.c7
-rw-r--r--thirdparty/openssl/crypto/ocsp/ocsp_cl.c4
-rw-r--r--thirdparty/openssl/crypto/ocsp/ocsp_ext.c2
-rw-r--r--thirdparty/openssl/crypto/ocsp/ocsp_lib.c12
-rw-r--r--thirdparty/openssl/crypto/opensslconf.h.in154
-rw-r--r--thirdparty/openssl/crypto/pem/pem_err.c3
-rw-r--r--thirdparty/openssl/crypto/pem/pem_lib.c14
-rw-r--r--thirdparty/openssl/crypto/pem/pvkfmt.c7
-rw-r--r--thirdparty/openssl/crypto/pkcs12/p12_mutl.c7
-rw-r--r--thirdparty/openssl/crypto/pkcs12/p12_npas.c113
-rw-r--r--thirdparty/openssl/crypto/pkcs12/p12_utl.c4
-rw-r--r--thirdparty/openssl/crypto/pkcs7/pk7_doit.c4
-rw-r--r--thirdparty/openssl/crypto/ppccap.c24
-rw-r--r--thirdparty/openssl/crypto/rand/md_rand.c78
-rw-r--r--thirdparty/openssl/crypto/rand/rand_unix.c2
-rwxr-xr-x[-rw-r--r--]thirdparty/openssl/crypto/rand/rand_vms.c123
-rw-r--r--thirdparty/openssl/crypto/rand/rand_win.c12
-rw-r--r--thirdparty/openssl/crypto/rand/randfile.c53
-rw-r--r--thirdparty/openssl/crypto/rsa/rsa_ameth.c8
-rw-r--r--thirdparty/openssl/crypto/rsa/rsa_chk.c89
-rw-r--r--thirdparty/openssl/crypto/rsa/rsa_gen.c3
-rw-r--r--thirdparty/openssl/crypto/rsa/rsa_lib.c1
-rw-r--r--thirdparty/openssl/crypto/rsa/rsa_oaep.c8
-rw-r--r--thirdparty/openssl/crypto/rsa/rsa_pmeth.c17
-rw-r--r--thirdparty/openssl/crypto/rsa/rsa_pss.c13
-rw-r--r--thirdparty/openssl/crypto/s390xcap.c1
-rw-r--r--thirdparty/openssl/crypto/srp/srp_lib.c24
-rw-r--r--thirdparty/openssl/crypto/srp/srp_vfy.c50
-rw-r--r--thirdparty/openssl/crypto/threads/netware.bat79
-rw-r--r--thirdparty/openssl/crypto/threads/profile.sh4
-rwxr-xr-xthirdparty/openssl/crypto/threads/ptest.bat4
-rw-r--r--thirdparty/openssl/crypto/threads/pthread.sh9
-rwxr-xr-xthirdparty/openssl/crypto/threads/pthread2.sh6
-rw-r--r--thirdparty/openssl/crypto/threads/pthreads-vms.com14
-rw-r--r--thirdparty/openssl/crypto/threads/purify.sh4
-rw-r--r--thirdparty/openssl/crypto/threads/solaris.sh4
-rwxr-xr-xthirdparty/openssl/crypto/threads/win32.bat4
-rw-r--r--thirdparty/openssl/crypto/ts/ts_lib.c5
-rw-r--r--thirdparty/openssl/crypto/ts/ts_rsp_verify.c27
-rw-r--r--thirdparty/openssl/crypto/txt_db/txt_db.c32
-rw-r--r--thirdparty/openssl/crypto/ui/ui_lib.c141
-rw-r--r--thirdparty/openssl/crypto/ui/ui_openssl.c59
-rw-r--r--thirdparty/openssl/crypto/whrlpool/wp_dgst.c3
-rw-r--r--thirdparty/openssl/crypto/x509/by_dir.c4
-rw-r--r--thirdparty/openssl/crypto/x509/x509_att.c12
-rw-r--r--thirdparty/openssl/crypto/x509/x509_err.c3
-rw-r--r--thirdparty/openssl/crypto/x509/x509_lu.c41
-rw-r--r--thirdparty/openssl/crypto/x509/x509_obj.c2
-rw-r--r--thirdparty/openssl/crypto/x509/x509_r2x.c14
-rw-r--r--thirdparty/openssl/crypto/x509/x509_txt.c7
-rw-r--r--thirdparty/openssl/crypto/x509/x509_vfy.c168
-rw-r--r--thirdparty/openssl/crypto/x509/x509spki.c2
-rw-r--r--thirdparty/openssl/crypto/x509v3/v3_addr.c6
-rw-r--r--thirdparty/openssl/crypto/x509v3/v3_alt.c34
-rw-r--r--thirdparty/openssl/crypto/x509v3/v3_conf.c4
-rw-r--r--thirdparty/openssl/crypto/x509v3/v3_cpols.c14
-rw-r--r--thirdparty/openssl/crypto/x509v3/v3_info.c37
-rw-r--r--thirdparty/openssl/crypto/x509v3/v3_purp.c1
-rw-r--r--thirdparty/openssl/openssl/bio.h6
-rw-r--r--thirdparty/openssl/openssl/bn.h2
-rw-r--r--thirdparty/openssl/openssl/comp.h4
-rw-r--r--thirdparty/openssl/openssl/conf.h1
-rw-r--r--thirdparty/openssl/openssl/dh.h29
-rw-r--r--thirdparty/openssl/openssl/dtls1.h7
-rw-r--r--thirdparty/openssl/openssl/err.h1
-rw-r--r--thirdparty/openssl/openssl/evp.h6
-rw-r--r--thirdparty/openssl/openssl/md5.h15
-rw-r--r--thirdparty/openssl/openssl/opensslconf.h75
-rw-r--r--thirdparty/openssl/openssl/opensslv.h6
-rw-r--r--thirdparty/openssl/openssl/ossl_typ.h2
-rw-r--r--thirdparty/openssl/openssl/pem.h6
-rw-r--r--thirdparty/openssl/openssl/pkcs12.h2
-rw-r--r--thirdparty/openssl/openssl/rand.h18
-rw-r--r--thirdparty/openssl/openssl/ssl.h10
-rw-r--r--thirdparty/openssl/openssl/ts.h3
-rw-r--r--thirdparty/openssl/openssl/x509.h6
-rw-r--r--thirdparty/openssl/openssl/x509_vfy.h9
-rw-r--r--thirdparty/openssl/patches/config_windows.patch49
-rw-r--r--thirdparty/openssl/patches/uwp_fix.patch (renamed from thirdparty/openssl/uwp_fix.patch)34
-rw-r--r--thirdparty/openssl/ssl/d1_both.c68
-rw-r--r--thirdparty/openssl/ssl/d1_clnt.c8
-rw-r--r--thirdparty/openssl/ssl/d1_lib.c37
-rw-r--r--thirdparty/openssl/ssl/d1_pkt.c171
-rw-r--r--thirdparty/openssl/ssl/d1_srvr.c31
-rwxr-xr-xthirdparty/openssl/ssl/install-ssl.com136
-rw-r--r--thirdparty/openssl/ssl/s23_clnt.c13
-rw-r--r--thirdparty/openssl/ssl/s23_pkt.c12
-rw-r--r--thirdparty/openssl/ssl/s23_srvr.c5
-rw-r--r--thirdparty/openssl/ssl/s2_clnt.c4
-rw-r--r--thirdparty/openssl/ssl/s2_lib.c2
-rw-r--r--thirdparty/openssl/ssl/s2_pkt.c10
-rw-r--r--thirdparty/openssl/ssl/s2_srvr.c12
-rw-r--r--thirdparty/openssl/ssl/s3_both.c41
-rw-r--r--thirdparty/openssl/ssl/s3_clnt.c86
-rw-r--r--thirdparty/openssl/ssl/s3_enc.c98
-rw-r--r--thirdparty/openssl/ssl/s3_lib.c41
-rw-r--r--thirdparty/openssl/ssl/s3_pkt.c45
-rw-r--r--thirdparty/openssl/ssl/s3_srvr.c157
-rw-r--r--thirdparty/openssl/ssl/ssl-lib.com1229
-rw-r--r--thirdparty/openssl/ssl/ssl_asn1.c3
-rw-r--r--thirdparty/openssl/ssl/ssl_cert.c5
-rw-r--r--thirdparty/openssl/ssl/ssl_ciph.c24
-rw-r--r--thirdparty/openssl/ssl/ssl_err.c5
-rw-r--r--thirdparty/openssl/ssl/ssl_lib.c31
-rw-r--r--thirdparty/openssl/ssl/ssl_locl.h21
-rw-r--r--thirdparty/openssl/ssl/ssl_rsa.c15
-rw-r--r--thirdparty/openssl/ssl/ssl_sess.c22
-rw-r--r--thirdparty/openssl/ssl/t1_enc.c1
-rw-r--r--thirdparty/openssl/ssl/t1_ext.c35
-rw-r--r--thirdparty/openssl/ssl/t1_lib.c418
-rw-r--r--thirdparty/opus/celt/arch.h13
-rw-r--r--thirdparty/opus/celt/arm/arm_celt_map.c24
-rw-r--r--thirdparty/opus/celt/arm/armcpu.c49
-rw-r--r--thirdparty/opus/celt/arm/armcpu.h6
-rw-r--r--thirdparty/opus/celt/arm/celt_neon_intr.c61
-rw-r--r--thirdparty/opus/celt/arm/pitch_arm.h68
-rw-r--r--thirdparty/opus/celt/bands.c4
-rw-r--r--thirdparty/opus/celt/celt.h2
-rw-r--r--thirdparty/opus/celt/celt_decoder.c10
-rw-r--r--thirdparty/opus/celt/celt_encoder.c13
-rw-r--r--thirdparty/opus/celt/celt_lpc.c3
-rw-r--r--thirdparty/opus/celt/cwrs.c2
-rw-r--r--thirdparty/opus/celt/fixed_generic.h16
-rw-r--r--thirdparty/opus/celt/kiss_fft.c2
-rw-r--r--thirdparty/opus/celt/mathops.c2
-rw-r--r--thirdparty/opus/celt/pitch.c67
-rw-r--r--thirdparty/opus/celt/pitch.h20
-rw-r--r--thirdparty/opus/celt/rate.c2
-rw-r--r--thirdparty/opus/celt/vq.c2
-rw-r--r--thirdparty/opus/celt/x86/pitch_sse.h34
-rw-r--r--thirdparty/opus/celt/x86/x86_celt_map.c2
-rw-r--r--thirdparty/opus/celt/x86/x86cpu.c2
-rw-r--r--thirdparty/opus/opus_multistream_encoder.c2
-rw-r--r--thirdparty/opus/silk/CNG.c61
-rw-r--r--thirdparty/opus/silk/NLSF_del_dec_quant.c14
-rw-r--r--thirdparty/opus/silk/NLSF_encode.c5
-rw-r--r--thirdparty/opus/silk/NLSF_stabilize.c2
-rw-r--r--thirdparty/opus/silk/NSQ.c58
-rw-r--r--thirdparty/opus/silk/NSQ_del_dec.c40
-rw-r--r--thirdparty/opus/silk/PLC.c3
-rw-r--r--thirdparty/opus/silk/decode_core.c2
-rw-r--r--thirdparty/opus/silk/fixed/burg_modified_FIX.c21
-rw-r--r--thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse.c14
-rw-r--r--thirdparty/opus/silk/macros.h22
-rw-r--r--thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h6
-rw-r--r--thirdparty/opus/silk/process_NLSFs.c6
-rw-r--r--thirdparty/opus/silk/sort.c2
-rw-r--r--thirdparty/opus/silk/stereo_LR_to_MS.c8
-rw-r--r--thirdparty/opus/silk/x86/NSQ_sse.c2
-rw-r--r--thirdparty/opus/silk/x86/main_sse.h3
-rw-r--r--thirdparty/rg-etc1/rg_etc1.cpp2446
-rw-r--r--thirdparty/rg-etc1/rg_etc1.h76
-rw-r--r--thirdparty/squish/squish.cpp24
-rw-r--r--thirdparty/squish/squish.h9
-rw-r--r--thirdparty/tinyexr/tinyexr.cc2
-rw-r--r--thirdparty/tinyexr/tinyexr.h12419
-rw-r--r--thirdparty/zstd/LICENSE30
-rw-r--r--thirdparty/zstd/PATENTS33
-rw-r--r--thirdparty/zstd/README.md153
-rw-r--r--thirdparty/zstd/common/bitstream.h460
-rw-r--r--thirdparty/zstd/common/entropy_common.c221
-rw-r--r--thirdparty/zstd/common/error_private.c47
-rw-r--r--thirdparty/zstd/common/error_private.h76
-rw-r--r--thirdparty/zstd/common/fse.h698
-rw-r--r--thirdparty/zstd/common/fse_decompress.c328
-rw-r--r--thirdparty/zstd/common/huf.h303
-rw-r--r--thirdparty/zstd/common/mem.h359
-rw-r--r--thirdparty/zstd/common/pool.c206
-rw-r--r--thirdparty/zstd/common/pool.h61
-rw-r--r--thirdparty/zstd/common/threading.c79
-rw-r--r--thirdparty/zstd/common/threading.h104
-rw-r--r--thirdparty/zstd/common/xxhash.c869
-rw-r--r--thirdparty/zstd/common/xxhash.h305
-rw-r--r--thirdparty/zstd/common/zstd_common.c80
-rw-r--r--thirdparty/zstd/common/zstd_errors.h83
-rw-r--r--thirdparty/zstd/common/zstd_internal.h346
-rw-r--r--thirdparty/zstd/compress/fse_compress.c857
-rw-r--r--thirdparty/zstd/compress/huf_compress.c688
-rw-r--r--thirdparty/zstd/compress/zstd_compress.c4193
-rw-r--r--thirdparty/zstd/compress/zstd_opt.h936
-rw-r--r--thirdparty/zstd/compress/zstdmt_compress.c955
-rw-r--r--thirdparty/zstd/compress/zstdmt_compress.h114
-rw-r--r--thirdparty/zstd/decompress/huf_decompress.c1012
-rw-r--r--thirdparty/zstd/decompress/zstd_decompress.c2491
-rw-r--r--thirdparty/zstd/zstd.h1136
3073 files changed, 224833 insertions, 89824 deletions
diff --git a/.editorconfig b/.editorconfig
index e19057f0e8..b7ef43c340 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -5,6 +5,9 @@ charset = utf-8
end_of_line = lf
indent_style = tab
+[*.{cpp,hpp,c,h,mm}]
+trim_trailing_whitespace = true
+
[.travis.yml]
indent_style = space
indent_size = 2
diff --git a/.gitattributes b/.gitattributes
index 1df99d85bf..f8959dd2d1 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -4,6 +4,7 @@
drivers/* linguist-vendored
*.cpp eol=lf
+*.mm eol=lf
*.h eol=lf
*.py eol=lf
*.hpp eol=lf
diff --git a/.gitignore b/.gitignore
index cdf277dd71..497d8b50d2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,30 +1,5 @@
# Godot auto generated files
-platform/server/logo.h
-platform/android/logo.h
-platform/bb10/logo.h
-platform/iphone/logo.h
-platform/javascript/logo.h
-platform/osx/logo.h
-platform/windows/logo.h
-platform/x11/logo.h
-drivers/gles2/shaders/*.h
-drivers/gles3/shaders/*.h
-modules/register_module_types.cpp
-core/version.h
-core/method_bind.inc
-core/method_bind_ext.inc
-core/script_encryption_key.cpp
-core/global_defaults.cpp
-drivers/unix/os_unix_global_settings_path.cpp
-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
+*.gen.*
# Documentation generated by doxygen or from classes.xml
doc/_build/
@@ -306,6 +281,9 @@ godot.creator.*
projects/
platform/windows/godot_res.res
-# Visual Studio Code folder (and files) that are created
-# when the C/C++ extension (https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) is used
+# Visual Studio 2017 and Visual Studio Code workspace folder
+/.vs
/.vscode
+
+# Scons progress indicator
+.scons_node_count
diff --git a/.travis.yml b/.travis.yml
index 6be9f1f603..371c965db4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,7 @@
language: cpp
+dist: trusty
+
sudo: false
compiler:
@@ -73,7 +75,6 @@ addons:
# For style checks.
- clang-format-3.9
-
before_script:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install scons; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$GODOT_TARGET" = "android" ]; then
@@ -86,5 +87,9 @@ script:
- if [ "$STATIC_CHECKS" = "yes" ]; then
sh ./misc/travis/clang-format.sh;
else
- scons platform=$GODOT_TARGET CXX=$CXX openssl=builtin;
+ if [ "$TRAVIS_OS_NAME" = "windows" ]; then
+ scons -j 2 platform=$GODOT_TARGET progress=no verbose=yes CXX=$CXX openssl=builtin;
+ else
+ scons -j 2 platform=$GODOT_TARGET progress=no verbose=yes bits=64 CXX=$CXX openssl=builtin;
+ fi
fi
diff --git a/AUTHORS.md b/AUTHORS.md
new file mode 100644
index 0000000000..84b0754929
--- /dev/null
+++ b/AUTHORS.md
@@ -0,0 +1,94 @@
+# Godot Engine authors
+
+Godot Engine is developed by a community of voluntary contributors who
+contribute code, bug reports, documentation, artwork, support, etc.
+
+It is impossible to list them all; nevertheless, this file aims at listing
+the developers who contributed significant patches to this MIT licensed
+source code. "Significant" is arbitrarily decided, but should be fair :)
+
+GitHub usernames are indicated in parentheses, or as sole entry when no other
+name is available.
+
+## Project Founders
+
+ Juan Linietsky (reduz)
+ Ariel Manzur (punto-)
+
+## Lead Developer
+
+ Juan Linietsky (reduz)
+
+## Project Manager
+
+ Rémi Verschelde (akien-mga)
+
+## Developers
+
+(in alphabetical order, with 10 commits or more excluding merges)
+
+ Alexander Holland (AlexHolly)
+ Alexey Velikiy (jonyrock)
+ Alket Rexhepi (alketii)
+ Andreas Haas (Hinsbart)
+ Anton Yabchinskiy (a12n)
+ Aren Villanueva (kurikaesu)
+ Ariel Manzur (punto-)
+ Bastiaan Olij (BastiaanOlij)
+ Bojidar Marinov (bojidar-bg)
+ Błażej Szczygieł (zaps166)
+ Carl Olsson (not-surt)
+ Dana Olson (adolson)
+ Daniel J. Ramirez (djrm)
+ Emmanuel Leblond (touilleMan)
+ Fabio Alessandrelli (Faless)
+ Ferenc Arn (tagcup)
+ Franklin Sobrinho (TheHX)
+ Geequlim
+ Gen (dbsGen)
+ George Marques (vnen)
+ Guilherme Felipe (guilhermefelipecgs)
+ Hein-Pieter van Braam (hpvb)
+ Hubert Jarosz (Marqin)
+ Hugo Locurcio (Calinou)
+ Ignacio Etcheverry (neikeq)
+ J08nY
+ Jakub Grzesik (kubecz3k)
+ Johan Manuel (29jm)
+ Joshua Grams (JoshuaGrams)
+ Juan Linietsky (reduz)
+ Julian Murgia (StraToN)
+ Kostadin Damyanov (Max-Might)
+ L. Krause (eska014)
+ Marc Gilleron (Zylann)
+ Marcelo Fernandez (marcelofg55)
+ Mariano Javier Suligoy (MarianoGnu)
+ Mario Schlack (hurikhan)
+ Masoud BH (masoudbh3)
+ Nathan Warden (NathanWarden)
+ Nuno Donato (nunodonato)
+ Ovnuniarchos
+ Patrick (firefly2442)
+ Paul Batty (Paulb23)
+ Pawel Kowal (pkowal1982)
+ Pedro J. Estébanez (RandomShaper)
+ Poommetee Ketson (Noshyaar)
+ Ralf Hölzemer (rollenrolm)
+ Ramesh Ravone (RameshRavone)
+ Ray Koopa (RayKoopa)
+ Rémi Verschelde (akien-mga)
+ SaracenOne
+ Theo Hallenius (TheoXD)
+ Thomas Herzog (karroffel)
+ Timo (toger5)
+ V. Vamsi Krishna (vkbsb)
+ Vinzenz Feenstra (vinzenz)
+ Zher Huei Lee (leezh)
+ ZuBsPaCe
+ 박한얼 (volzhs)
+ est31
+ marynate
+ mrezai
+ romulox-x
+ sanikoyes
+ yg2f (SuperUserNameMan)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 21ce52d6e3..a9ada58e64 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,69 +4,110 @@ Sections covered in this file:
* [Reporting bugs or proposing features](#reporting-bugs-or-proposing-features)
* [Contributing pull requests](#contributing-pull-requests)
+* [Contributing to Godot's translation](#contributing-to-godots-translation)
* [Communicating with developers](#communicating-with-developers)
**Please read the first section before reporting a bug!**
## Reporting bugs or proposing features
-The golden rule is to **always open *one* issue for *one* bug**. If you notice several bugs and want to report them, make sure to create one new issue for each of them.
+The golden rule is to **always open *one* issue for *one* bug**. If you notice
+several bugs and want to report them, make sure to create one new issue for
+each of them.
Everything referred to hereafter as "bug" also applies for feature requests.
-If you are reporting a new issue, you will make our life much simpler (and the fix come much sooner) by following those guidelines:
+If you are reporting a new issue, you will make our life much simpler (and the
+fix come much sooner) by following those guidelines:
#### Search first in the existing database
-Issues are often reported several times by various users. It's a good practice to **search first** in the issues database before reporting your issue. If you don't find a relevant match or if you are unsure, don't hesitate to **open a new issue**. The bugsquad will handle it from there if it's a duplicate.
+Issues are often reported several times by various users. It's a good practice
+to **search first** in the issues database before reporting your issue. If you
+don't find a relevant match or if you are unsure, don't hesitate to **open a
+new issue**. The bugsquad will handle it from there if it's a duplicate.
-#### Specify the platform
-
-Godot runs on a large variety of platforms and operating systems and devices. If you believe your issue is device/platform dependent (for example if it is related to the rendering, crashes or compilation errors), please specify:
+#### Specify the platform
+
+Godot runs on a large variety of platforms and operating systems and devices.
+If you believe your issue is device/platform dependent (for example if it is
+related to the rendering, crashes or compilation errors), please specify:
* Operating system
* Device (including architecture, e.g. x86, x86_64, arm, etc.)
* GPU model (and driver in use if you know it)
#### Specify steps to reproduce
-Many bugs can't be reproduced unless specific steps are taken. Please **specify the exact steps** that must be taken to reproduce the condition, and try to keep them as minimal as possible.
+Many bugs can't be reproduced unless specific steps are taken. Please **specify
+the exact steps** that must be taken to reproduce the condition, and try to
+keep them as minimal as possible.
#### Provide a simple, example project
-Sometimes an unexpected behavior happens in your project. In such case, understand that:
-
+Sometimes an unexpected behavior happens in your project. In such case,
+understand that:
* What happens to you may not happen to other users.
-* We can't take the time to look at your project, understand how it is set up and then figure out why it's failing.
-
-To speed up our work, please prepare for us **a simple project** that isolates and reproduces the issue. This is always the **the best way for us to fix it**. You can attach a zip file with the minimal project directly to the bug report, by drag and dropping the file in the GitHub edition field.
+* We can't take the time to look at your project, understand how it is set up
+ and then figure out why it's failing.
+
+To speed up our work, please prepare for us **a simple project** that isolates
+and reproduces the issue. This is always the **the best way for us to fix it**.
+You can attach a zip file with the minimal project directly to the bug report,
+by drag and dropping the file in the GitHub edition field.
## Contributing pull requests
If you want to add new engine functionalities, please make sure that:
* This functionality is desired.
-* You talked to other developers on how to implement it best (on either communication channel, and maybe in a GitHub issue first before making your PR).
-* Even if it does not get merged, your PR is useful for future work by another developer.
+* You talked to other developers on how to implement it best (on either
+ communication channel, and maybe in a GitHub issue first before making your
+ PR).
+* Even if it does not get merged, your PR is useful for future work by another
+ developer.
-Similar rules can be applied when contributing bug fixes - it's always best to discuss the implementation in the bug report first if you are not 100% about what would be the best fix.
+Similar rules can be applied when contributing bug fixes - it's always best to
+discuss the implementation in the bug report first if you are not 100% about
+what would be the best fix.
#### Be nice to the git history
-Try to make simple PRs with that handle one specific topic. Just like for reporting issues, it's better to open 3 different PRs that each address a different issue than one big PR with three commits.
+Try to make simple PRs with that handle one specific topic. Just like for
+reporting issues, it's better to open 3 different PRs that each address a
+different issue than one big PR with three commits.
-When updating your fork with upstream changes, please use ``git pull --rebase`` to avoid creating "merge commits". Those commits unnecessarily pollute the git history when coming from PRs.
+When updating your fork with upstream changes, please use ``git pull --rebase``
+to avoid creating "merge commits". Those commits unnecessarily pollute the git
+history when coming from PRs.
-Also try to make commits that bring the engine from one stable state to another stable state, i.e. if your first commit has a bug that you fixed in the second commit, try to merge them together before making your pull request (see ``git rebase -i`` and relevant help about rebasing or ammending commits on the Internet).
+Also try to make commits that bring the engine from one stable state to another
+stable state, i.e. if your first commit has a bug that you fixed in the second
+commit, try to merge them together before making your pull request (see ``git
+rebase -i`` and relevant help about rebasing or ammending commits on the
+Internet).
-This git style guide has some good practices to have in mind: https://github.com/agis-/git-style-guide
+This git style guide has some good practices to have in mind:
+https://github.com/agis-/git-style-guide
#### Format your commit logs with readability in mind
-The way you format your commit logs is quite important to ensure that the commit history and changelog will be easy to read and understand. A git commit log is formatted as a short title (first line) and an extended description (everything after the first line and an empty separation line).
+The way you format your commit logs is quite important to ensure that the
+commit history and changelog will be easy to read and understand. A git commit
+log is formatted as a short title (first line) and an extended description
+(everything after the first line and an empty separation line).
-The short title is the most important part, as it is what will appear in the `shortlog` changelog (one line per commit, so no description shown) or in the GitHub interface unless you click the "expand" button. As the name tells it, try to keep that first line relatively short (ideally <= 50 chars, though it's rare to be able to tell enough in so few characters, so you can go a bit higher) - it should describe what the commit does globally, while details would go in the description. Typically, if you can't keep the title short because you have too much stuff to mention, it means that you should probably split your changes in several commits :)
+The short title is the most important part, as it is what will appear in the
+`shortlog` changelog (one line per commit, so no description shown) or in the
+GitHub interface unless you click the "expand" button. As the name tells it,
+try to keep that first line relatively short (ideally <= 50 chars, though it's
+rare to be able to tell enough in so few characters, so you can go a bit
+higher) - it should describe what the commit does globally, while details would
+go in the description. Typically, if you can't keep the title short because you
+have too much stuff to mention, it means that you should probably split your
+changes in several commits :)
-Here's an example of a well-formatted commit log (note how the extended description is also manually wrapped at 80 chars for readability):
+Here's an example of a well-formatted commit log (note how the extended
+description is also manually wrapped at 80 chars for readability):
```
Prevent French fries carbonization by fixing heat regulation
@@ -82,16 +123,44 @@ of cooking oil under normal atmospheric conditions.
Fixes #1789, long live the Realm!
```
-*Note:* When using the GitHub online editor (or worse, the drag and drop feature), *please* edit the commit title to something meaningful. Commits named "Update my_file.cpp" will not be accepted.
+*Note:* When using the GitHub online editor (or worse, the drag and drop
+feature), *please* edit the commit title to something meaningful. Commits named
+"Update my_file.cpp" will not be accepted.
-## Communicating with developers
+## Contributing to Godot's translation
+
+You can contribute to Godot's translation from the [Hosted
+Weblate](https://hosted.weblate.org/projects/godot-engine/godot), an open
+source and web-based translation platform. Please refer to the [translation
+readme](editor/translations/README.md) for more information.
-The Godot Engine community has [many communication channels](https://godotengine.org/community), some used more for user-level discussions and support, others more for development discussions.
+## Communicating with developers
-To communicate with developers (e.g. to discuss a feature you want to implement or a bug you want to fix), the following channels can be used:
-- [GitHub issues](https://github.com/godotengine/godot/issues): If there is an existing issue about a topic you want to discuss, just add a comment to it - all developers watch the repository and will get an email notification. You can also create a new issue - please keep in mind to create issues only to discuss quite specific points about the development, and not general user feedback or support requests.
-- [#godotengine-devel IRC channel on Freenode](http://webchat.freenode.net/?channels=godotengine-devel): You will find most core developers there, so it's the go-to channel for direct chat about Godot Engine development. Feel free to start discussing something there to get some early feedback before writing up a detailed proposal in a GitHub issue.
-- [devel@godotengine.org mailing list](https://listengine.tuxfamily.org/godotengine.org/devel/): Mailing list for Godot developers, used primarily to announce developer meetings on IRC and other important discussions that need to reach people directly in their mailbox. See the [index page](https://listengine.tuxfamily.org/godotengine.org/devel/) for subscription instructions.
+The Godot Engine community has [many communication
+channels](https://godotengine.org/community), some used more for user-level
+discussions and support, others more for development discussions.
+
+To communicate with developers (e.g. to discuss a feature you want to implement
+or a bug you want to fix), the following channels can be used:
+- [GitHub issues](https://github.com/godotengine/godot/issues): If there is an
+ existing issue about a topic you want to discuss, just add a comment to it -
+ all developers watch the repository and will get an email notification. You
+ can also create a new issue - please keep in mind to create issues only to
+ discuss quite specific points about the development, and not general user
+ feedback or support requests.
+- [#godotengine-devel IRC channel on
+ Freenode](https://webchat.freenode.net/?channels=godotengine-devel): You will
+ find most core developers there, so it's the go-to channel for direct chat
+ about Godot Engine development. Feel free to start discussing something there
+ to get some early feedback before writing up a detailed proposal in a GitHub
+ issue.
+- [devel@godotengine.org mailing
+ list](https://listengine.tuxfamily.org/godotengine.org/devel/): Mailing list
+ for Godot developers, used primarily to announce developer meetings on IRC
+ and other important discussions that need to reach people directly in their
+ mailbox. See the [index
+ page](https://listengine.tuxfamily.org/godotengine.org/devel/) for
+ subscription instructions.
Thanks!
diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt
new file mode 100644
index 0000000000..b36f2b1134
--- /dev/null
+++ b/COPYRIGHT.txt
@@ -0,0 +1,1179 @@
+# Exhaustive licensing information for files in the Godot Engine repository
+# =========================================================================
+#
+# This file aims at documenting the copyright and license for every source
+# file in the Godot Engine repository, and especially outline the files
+# whose license differs from the MIT/Expat license used by Godot Engine.
+#
+# It is written as a machine-readable format following the debian/copyright
+# specification. Globbing patterns (e.g. "Files: *") mean that they affect
+# all corresponding files (also recursively in subfolders), apart from those
+# with a more explicit copyright statement.
+#
+# Licenses are given with their SPDX identifier, and are all included in
+# plain text at the end of this file (in alphabetical order).
+#
+# Disclaimer for thirdparty libraries:
+# ------------------------------------
+#
+# Licensing details for thirdparty libraries in the 'thirdparty/' directory
+# are given in summarized form, i.e. with only the "main" license described
+# in the library's license statement. Different licenses of single files or
+# code snippets in thirdparty libraries are not documented here.
+# For example:
+# Files: ./thirdparty/zlib/
+# Copyright: 1995-2017, Jean-loup Gailly and Mark Adler
+# License: Zlib
+# The exact copyright for each file in that library *may* differ, and some
+# files or code snippets might be distributed under other compatible licenses
+# (e.g. a public domain dedication), but as far as Godot Engine is concerned
+# the library is considered as a whole under the Zlib license.
+#
+# Nota: When linking dynamically against thirdparty libraries instead of
+# building them into the Godot binary, you may remove the corresponding
+# license details from this file.
+
+-----------------------------------------------------------------------
+
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Godot Engine
+Upstream-Contact: Rémi Verschelde <contact@godotengine.org>
+Source: https://github.com/godotengine/godot
+
+Files: *
+Comment: Godot Engine
+Copyright: 2007-2017, Juan Linietsky, Ariel Manzur.
+ 2014-2017, Godot Engine contributors (cf. AUTHORS.md)
+License: Expat
+
+Files: ./icon.png
+ ./icon.svg
+ ./logo.png
+ ./logo.svg
+Comment: Godot Engine logo
+Copyright: Andrea Calabró
+License: CC-BY-3.0
+
+Files: ./platform/android/android_native_app_glue.c
+ ./platform/android/android_native_app_glue.h
+ ./platform/android/java/aidl/com/android/vending/billing/IInAppBillingService.aidl
+ ./platform/android/java/res/layout/status_bar_ongoing_event_progress_bar.xml
+ ./platform/android/java/src/com/android/vending/licensing/*
+ ./platform/android/java/src/com/google/android/vending/expansion/downloader/*
+ ./platform/android/java/src/org/godotengine/godot/input/InputManagerCompat.java
+ ./platform/android/java/src/org/godotengine/godot/input/InputManagerV16.java
+ ./platform/android/java/src/org/godotengine/godot/input/InputManagerV9.java
+Comment: The Android Open Source Project
+Copyright: 2008-2013, The Android Open Source Project
+License: Apache-2.0
+
+Files: ./platform/android/cpu-features.c
+ ./platform/android/cpu-features.h
+Comment: The Android Open Source Project
+Copyright: 2010, The Android Open Source Project
+License: BSD-2-clause
+
+Files: ./platform/android/ifaddrs_android.cpp
+ ./platform/android/ifaddrs_android.h
+Comment: The Android Open Source Project
+Copyright: 2012-2013, Google Inc.
+License: BSD-3-clause
+
+Files: ./platform/android/java/src/com/android/vending/licensing/util/Base64.java
+ ./platform/android/java/src/com/android/vending/licensing/util/Base64DecoderException.java
+Comment: The Android Open Source Project
+Copyright: 2002, Google Inc.
+License: Apache-2.0
+
+Files: ./platform/android/power_android.cpp
+ ./platform/osx/power_osx.cpp
+ ./platform/windows/power_windows.cpp
+ ./platform/x11/power_x11.cpp
+Comment: Simple DirectMedia Layer
+Copyright: 1997-2017, Sam Lantinga
+ 2007-2017, Juan Linietsky, Ariel Manzur.
+ 2014-2017, Godot Engine contributors (cf. AUTHORS.md)
+License: Expat and Zlib
+
+Files: ./servers/physics/gjk_epa.cpp
+ ./servers/physics/joints/generic_6dof_joint_sw.cpp
+ ./servers/physics/joints/generic_6dof_joint_sw.h
+ ./servers/physics/joints/hinge_joint_sw.cpp
+ ./servers/physics/joints/hinge_joint_sw.h
+ ./servers/physics/joints/jacobian_entry_sw.h
+ ./servers/physics/joints/pin_joint_sw.cpp
+ ./servers/physics/joints/pin_joint_sw.h
+ ./servers/physics/joints/slider_joint_sw.cpp
+ ./servers/physics/joints/slider_joint_sw.h
+Comment: Bullet Continuous Collision Detection and Physics Library
+Copyright: 2003-2008, Erwin Coumans
+ 2007-2017, Juan Linietsky, Ariel Manzur.
+ 2014-2017, Godot Engine contributors (cf. AUTHORS.md)
+License: Expat and Zlib
+
+Files: ./servers/physics/joints/cone_twist_joint_sw.cpp
+ ./servers/physics/joints/cone_twist_joint_sw.h
+Comment: Bullet Continuous Collision Detection and Physics Library
+Copyright: 2007, Starbreeze Studios
+ 2007-2017, Juan Linietsky, Ariel Manzur.
+ 2014-2017, Godot Engine contributors (cf. AUTHORS.md)
+License: Expat and Zlib
+
+Files: ./thirdparty/b2d_convexdecomp/
+Comment: Box2D (ConvexDecomp)
+Copyright: 2007, Eric Jordan
+Copyright: 2006-2009, Erin Catto
+License: Zlib
+
+Files: ./thirdparty/certs/ca-certificates.crt
+Comment: FIXME
+Copyright: FIXME
+License: FIXME
+
+Files: ./thirdparty/enet/
+Comment: ENet
+Copyright: 2002-2016, Lee Salzman
+License: Expat
+
+Files: ./thirdparty/fonts/DroidSans*.ttf
+Comment: DroidSans font
+Copyright: 2008, The Android Open Source Project
+License: Apache-2.0
+
+Files: ./thirdparty/fonts/source_code_pro.otf
+Comment: Source Code Pro font
+Copyright: 2010, 2012, Adobe Systems Incorporated
+License: OFL-1.1
+
+Files: ./thirdparty/freetype/
+Comment: The FreeType Project
+Copyright: 1996-2016, David Turner, Robert Wilhelm, and Werner Lemberg.
+License: FTL
+
+Files: ./thirdparty/glad/
+Comment: glad
+Copyright: 2013, David Herberth
+License: Expat
+
+Files: ./thirdparty/jpeg_compressor/
+Comment: jpeg-compressor
+Copyright: 2012, Rich Geldreich
+License: public-domain
+
+Files: ./thirdparty/libogg/
+Comment: OggVorbis
+Copyright: 2002, Xiph.org Foundation
+License: BSD-3-clause
+
+Files: ./thirdparty/libpng/
+Comment: libpng
+Copyright: 1995-1996, Guy Eric Schalnat, Group 42, Inc.
+ 1996-1997, Andreas Dilger
+ 1998-2016, Glenn Randers-Pehrson
+License: Zlib
+
+Files: ./thirdparty/libsimplewebm/
+Comment: libsimplewebm
+Copyright: 2016, Błażej Szczygieł
+License: Expat
+
+Files: ./thirdparty/libsimplewebm/libwebm/
+Comment: The WebM Project
+Copyright: 2010, Google Inc.
+License: BSD-3-clause
+
+Files: ./thirdparty/libtheora/
+Comment: OggTheora
+Copyright: 2002-2009, Xiph.org Foundation
+License: BSD-3-clause
+
+Files: ./thirdparty/libvorbis/
+Comment: OggVorbis
+Copyright: 2002-2015, Xiph.org Foundation
+License: BSD-3-clause
+
+Files: ./thirdparty/libvpx/
+Comment: The WebM Project
+Copyright: 2010, The WebM Project authors.
+License: BSD-3-clause
+
+Files: ./thirdparty/libwebp/
+Comment: WebP codec
+Copyright: 2010, Google Inc.
+License: BSD-3-clause
+
+Files: ./thirdparty/minizip/
+Comment: MiniZip
+Copyright: 1998-2010, Gilles Vollant
+ 2007-2008, Even Rouault
+ 2009-2010, Mathias Svensson
+License: Zlib
+
+Files: ./thirdparty/misc/aes256.cpp
+ ./thirdparty/misc/aes256.h
+ ./thirdparty/misc/sha256.c
+ ./thirdparty/misc/sha256.h
+Comment: AES-256 and SHA-256 implementation
+Copyright: 2007-2011, Ilya O. Levin
+License: ISC
+
+Files: ./thirdparty/misc/base64.c
+ ./thirdparty/misc/base64.h
+Comment: BASE64 conversion methods
+Copyright: Ari Edelkind
+License: public-domain
+
+Files: ./thirdparty/misc/curl_hostcheck.c
+ ./thirdparty/misc/curl_hostcheck.h
+Comment: curl
+Copyright: 1998-2012, Daniel Stenberg et al.
+License: curl
+
+Files: ./thirdparty/misc/fastlz.c
+ ./thirdparty/misc/fastlz.h
+Comment: FastLZ
+Copyright: 2005-2007, Ariya Hidayat
+License: Expat
+
+Files: ./thirdparty/misc/hq2x.cpp
+ ./thirdparty/misc/hq2x.h
+Comment: hq2x implementation
+Copyright: 2016, Bruno Ribeiro
+License: Apache-2.0
+
+Files: ./thirdparty/misc/md5.cpp
+ ./thirdparty/misc/md5.h
+Comment: MD5 Message Digest Algorithm
+Copyright: 1990, RSA Data Security, Inc.
+License: RSA-MD
+
+Files: ./thirdparty/misc/mikktspace.c
+ ./thirdparty/misc/mikktspace.h
+Comment: Tangent Space Normal Maps implementation
+Copyright: 2011, Morten S. Mikkelsen
+License: Zlib
+
+Files: ./thirdparty/misc/pcg.cpp
+ ./thirdparty/misc/pcg.h
+Comment: Minimal PCG32 implementation
+Copyright: 2014, M.E. O'Neill
+License: Apache-2.0
+
+Files: ./thirdparty/misc/smaz.c
+ ./thirdparty/misc/smaz.h
+Comment: SMAZ
+Copyright: 2006-2009, Salvatore Sanfilippo
+License: BSD-3-clause
+
+Files: ./thirdparty/misc/stb_truetype.h
+ ./thirdparty/misc/stb_vorbis.c
+Comment: stb libraries
+Copyright: 2007-2015, Sean Barrett
+License: public-domain
+
+Files: ./thirdparty/misc/triangulator.cpp
+ ./thirdparty/misc/triangulator.h
+Comment: PolyPartition
+Copyright: 2011, Ivan Fratric
+License: Expat
+
+Files: ./thirdparty/misc/yuv2rgb.h
+Comment: YUV2RGB
+Copyright: 2008-2011, Robin Watts
+License: BSD-2-clause
+
+Files: ./thirdparty/openssl/
+Comment: The OpenSSL Project
+Copyright: 1998-2016, The OpenSSL Project.
+License: OpenSSL
+
+Files: ./thirdparty/opus/
+Comment: Opus
+Copyright: 2001-2011, Xiph.Org, Skype Limited, Octasic,
+ Jean-Marc Valin, Timothy B. Terriberry,
+ CSIRO, Gregory Maxwell, Mark Borgerding,
+ Erik de Castro Lopo
+License: BSD-3-clause
+
+Files: ./thirdparty/pvrtccompressor/
+Comment: PvrTcCompressor
+Copyright: 2014, Jeffrey Lim.
+License: BSD-3-clause
+
+Files: ./thirdparty/rtaudio/
+Comment: RtAudio
+Copyright: 2001-2016, Gary P. Scavone
+License: Expat
+
+Files: ./thirdparty/squish/
+Comment: libSquish
+Copyright: 2006, Simon Brown
+License: Expat
+
+Files: ./thirdparty/tinyexr/
+Comment: TinyEXR
+Copyright: 2014-2017, Syoyo Fujita
+ 2002, Industrial Light & Magic, a division of Lucas Digital Ltd. LLC
+License: BSD-3-Clause
+
+Files: ./thirdparty/zlib/
+Comment: zlib
+Copyright: 1995-2017, Jean-loup Gailly and Mark Adler
+License: Zlib
+
+
+
+License: Apache-2.0
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ .
+ http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+License: BSD-2-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ .
+ Redistributions in binary form must reproduce the above copyright notice, this
+ list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution. Neither the name of the author
+ nor the names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ .
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+License: CC-BY-3.0
+ Creative Commons Attribution 3.0 Unported
+ .
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+ LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION
+ ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE
+ INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+ ITS USE.
+ .
+ License
+ .
+ THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
+ COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
+ COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+ AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+ .
+ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
+ TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
+ BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
+ CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
+ CONDITIONS.
+ .
+ 1. Definitions
+ .
+ a. "Adaptation" means a work based upon the Work, or upon the Work and
+ other pre-existing works, such as a translation, adaptation, derivative
+ work, arrangement of music or other alterations of a literary or
+ artistic work, or phonogram or performance and includes cinematographic
+ adaptations or any other form in which the Work may be recast,
+ transformed, or adapted including in any form recognizably derived from
+ the original, except that a work that constitutes a Collection will not
+ be considered an Adaptation for the purpose of this License. For the
+ avoidance of doubt, where the Work is a musical work, performance or
+ phonogram, the synchronization of the Work in timed-relation with a
+ moving image ("synching") will be considered an Adaptation for the
+ purpose of this License.
+ .
+ b. "Collection" means a collection of literary or artistic works, such
+ as encyclopedias and anthologies, or performances, phonograms or
+ broadcasts, or other works or subject matter other than works listed in
+ Section 1(f) below, which, by reason of the selection and arrangement of
+ their contents, constitute intellectual creations, in which the Work is
+ included in its entirety in unmodified form along with one or more other
+ contributions, each constituting separate and independent works in
+ themselves, which together are assembled into a collective whole. A work
+ that constitutes a Collection will not be considered an Adaptation (as
+ defined above) for the purposes of this License.
+ .
+ c. "Distribute" means to make available to the public the original and
+ copies of the Work or Adaptation, as appropriate, through sale or other
+ transfer of ownership.
+ .
+ d. "Licensor" means the individual, individuals, entity or entities that
+ offer(s) the Work under the terms of this License.
+ .
+ e. "Original Author" means, in the case of a literary or artistic work,
+ the individual, individuals, entity or entities who created the Work or
+ if no individual or entity can be identified, the publisher; and in
+ addition (i) in the case of a performance the actors, singers,
+ musicians, dancers, and other persons who act, sing, deliver, declaim,
+ play in, interpret or otherwise perform literary or artistic works or
+ expressions of folklore; (ii) in the case of a phonogram the producer
+ being the person or legal entity who first fixes the sounds of a
+ performance or other sounds; and, (iii) in the case of broadcasts, the
+ organization that transmits the broadcast.
+ .
+ f. "Work" means the literary and/or artistic work offered under the
+ terms of this License including without limitation any production in the
+ literary, scientific and artistic domain, whatever may be the mode or
+ form of its expression including digital form, such as a book, pamphlet
+ and other writing; a lecture, address, sermon or other work of the same
+ nature; a dramatic or dramatico-musical work; a choreographic work or
+ entertainment in dumb show; a musical composition with or without words;
+ a cinematographic work to which are assimilated works expressed by a
+ process analogous to cinematography; a work of drawing, painting,
+ architecture, sculpture, engraving or lithography; a photographic work
+ to which are assimilated works expressed by a process analogous to
+ photography; a work of applied art; an illustration, map, plan, sketch
+ or three-dimensional work relative to geography, topography,
+ architecture or science; a performance; a broadcast; a phonogram; a
+ compilation of data to the extent it is protected as a copyrightable
+ work; or a work performed by a variety or circus performer to the extent
+ it is not otherwise considered a literary or artistic work.
+ .
+ g. "You" means an individual or entity exercising rights under this
+ License who has not previously violated the terms of this License with
+ respect to the Work, or who has received express permission from the
+ Licensor to exercise rights under this License despite a previous
+ violation.
+ .
+ h. "Publicly Perform" means to perform public recitations of the Work
+ and to communicate to the public those public recitations, by any means
+ or process, including by wire or wireless means or public digital
+ performances; to make available to the public Works in such a way that
+ members of the public may access these Works from a place and at a place
+ individually chosen by them; to perform the Work to the public by any
+ means or process and the communication to the public of the performances
+ of the Work, including by public digital performance; to broadcast and
+ rebroadcast the Work by any means including signs, sounds or images.
+ .
+ i. "Reproduce" means to make copies of the Work by any means including
+ without limitation by sound or visual recordings and the right of
+ fixation and reproducing fixations of the Work, including storage of a
+ protected performance or phonogram in digital form or other electronic
+ medium.
+ .
+ 2. Fair Dealing Rights. Nothing in this License is intended to reduce,
+ limit, or restrict any uses free from copyright or rights arising from
+ limitations or exceptions that are provided for in connection with the
+ copyright protection under copyright law or other applicable laws.
+ .
+ 3. License Grant. Subject to the terms and conditions of this License,
+ Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
+ perpetual (for the duration of the applicable copyright) license to
+ exercise the rights in the Work as stated below:
+ .
+ a. to Reproduce the Work, to incorporate the Work into one or more
+ Collections, and to Reproduce the Work as incorporated in the
+ Collections;
+ .
+ b. to create and Reproduce Adaptations provided that any such
+ Adaptation, including any translation in any medium, takes reasonable
+ steps to clearly label, demarcate or otherwise identify that changes
+ were made to the original Work. For example, a translation could be
+ marked "The original work was translated from English to Spanish," or a
+ modification could indicate "The original work has been modified.";
+ .
+ c. to Distribute and Publicly Perform the Work including as incorporated
+ in Collections; and,
+ .
+ d. to Distribute and Publicly Perform Adaptations.
+ .
+ e. For the avoidance of doubt:
+ .
+ i. Non-waivable Compulsory License Schemes. In those jurisdictions in
+ which the right to collect royalties through any statutory or compulsory
+ licensing scheme cannot be waived, the Licensor reserves the exclusive
+ right to collect such royalties for any exercise by You of the rights
+ granted under this License;
+ .
+ ii. Waivable Compulsory License Schemes. In those jurisdictions in which
+ the right to collect royalties through any statutory or compulsory
+ licensing scheme can be waived, the Licensor waives the exclusive right
+ to collect such royalties for any exercise by You of the rights granted
+ under this License; and,
+ .
+ iii. Voluntary License Schemes. The Licensor waives the right to collect
+ royalties, whether individually or, in the event that the Licensor is a
+ member of a collecting society that administers voluntary licensing
+ schemes, via that society, from any exercise by You of the rights
+ granted under this License.
+ .
+ The above rights may be exercised in all media and formats whether now
+ known or hereafter devised. The above rights include the right to make
+ such modifications as are technically necessary to exercise the rights
+ in other media and formats. Subject to Section 8(f), all rights not
+ expressly granted by Licensor are hereby reserved.
+ .
+ 4. Restrictions. The license granted in Section 3 above is expressly
+ made subject to and limited by the following restrictions:
+ .
+ a. You may Distribute or Publicly Perform the Work only under the terms
+ of this License. You must include a copy of, or the Uniform Resource
+ Identifier (URI) for, this License with every copy of the Work You
+ Distribute or Publicly Perform. You may not offer or impose any terms on
+ the Work that restrict the terms of this License or the ability of the
+ recipient of the Work to exercise the rights granted to that recipient
+ under the terms of the License. You may not sublicense the Work. You
+ must keep intact all notices that refer to this License and to the
+ disclaimer of warranties with every copy of the Work You Distribute or
+ Publicly Perform. When You Distribute or Publicly Perform the Work, You
+ may not impose any effective technological measures on the Work that
+ restrict the ability of a recipient of the Work from You to exercise the
+ rights granted to that recipient under the terms of the License. This
+ Section 4(a) applies to the Work as incorporated in a Collection, but
+ this does not require the Collection apart from the Work itself to be
+ made subject to the terms of this License. If You create a Collection,
+ upon notice from any Licensor You must, to the extent practicable,
+ remove from the Collection any credit as required by Section 4(b), as
+ requested. If You create an Adaptation, upon notice from any Licensor
+ You must, to the extent practicable, remove from the Adaptation any
+ credit as required by Section 4(b), as requested.
+ .
+ b. If You Distribute, or Publicly Perform the Work or any Adaptations or
+ Collections, You must, unless a request has been made pursuant to
+ Section 4(a), keep intact all copyright notices for the Work and
+ provide, reasonable to the medium or means You are utilizing: (i) the
+ name of the Original Author (or pseudonym, if applicable) if supplied,
+ and/or if the Original Author and/or Licensor designate another party or
+ parties (e.g., a sponsor institute, publishing entity, journal) for
+ attribution ("Attribution Parties") in Licensor's copyright notice,
+ terms of service or by other reasonable means, the name of such party or
+ parties; (ii) the title of the Work if supplied; (iii) to the extent
+ reasonably practicable, the URI, if any, that Licensor specifies to be
+ associated with the Work, unless such URI does not refer to the
+ copyright notice or licensing information for the Work; and (iv) ,
+ consistent with Section 3(b), in the case of an Adaptation, a credit
+ identifying the use of the Work in the Adaptation (e.g., "French
+ translation of the Work by Original Author," or "Screenplay based on
+ original Work by Original Author"). The credit required by this Section
+ 4 (b) may be implemented in any reasonable manner; provided, however,
+ that in the case of a Adaptation or Collection, at a minimum such credit
+ will appear, if a credit for all contributing authors of the Adaptation
+ or Collection appears, then as part of these credits and in a manner at
+ least as prominent as the credits for the other contributing authors.
+ For the avoidance of doubt, You may only use the credit required by this
+ Section for the purpose of attribution in the manner set out above and,
+ by exercising Your rights under this License, You may not implicitly or
+ explicitly assert or imply any connection with, sponsorship or
+ endorsement by the Original Author, Licensor and/or Attribution Parties,
+ as appropriate, of You or Your use of the Work, without the separate,
+ express prior written permission of the Original Author, Licensor and/or
+ Attribution Parties.
+ .
+ c. Except as otherwise agreed in writing by the Licensor or as may be
+ otherwise permitted by applicable law, if You Reproduce, Distribute or
+ Publicly Perform the Work either by itself or as part of any Adaptations
+ or Collections, You must not distort, mutilate, modify or take other
+ derogatory action in relation to the Work which would be prejudicial to
+ the Original Author's honor or reputation. Licensor agrees that in those
+ jurisdictions (e.g. Japan), in which any exercise of the right granted
+ in Section 3(b) of this License (the right to make Adaptations) would be
+ deemed to be a distortion, mutilation, modification or other derogatory
+ action prejudicial to the Original Author's honor and reputation, the
+ Licensor will waive or not assert, as appropriate, this Section, to the
+ fullest extent permitted by the applicable national law, to enable You
+ to reasonably exercise Your right under Section 3(b) of this License
+ (right to make Adaptations) but not otherwise.
+ .
+ 5. Representations, Warranties and Disclaimer
+ .
+ UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
+ OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
+ KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
+ INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
+ FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
+ LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
+ WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE
+ EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+ .
+ 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
+ LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
+ ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
+ ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
+ BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ .
+ 7. Termination
+ .
+ a. This License and the rights granted hereunder will terminate
+ automatically upon any breach by You of the terms of this License.
+ Individuals or entities who have received Adaptations or Collections
+ from You under this License, however, will not have their licenses
+ terminated provided such individuals or entities remain in full
+ compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
+ survive any termination of this License.
+ .
+ b. Subject to the above terms and conditions, the license granted here
+ is perpetual (for the duration of the applicable copyright in the Work).
+ Notwithstanding the above, Licensor reserves the right to release the
+ Work under different license terms or to stop distributing the Work at
+ any time; provided, however that any such election will not serve to
+ withdraw this License (or any other license that has been, or is
+ required to be, granted under the terms of this License), and this
+ License will continue in full force and effect unless terminated as
+ stated above.
+ .
+ 8. Miscellaneous
+ .
+ a. Each time You Distribute or Publicly Perform the Work or a
+ Collection, the Licensor offers to the recipient a license to the Work
+ on the same terms and conditions as the license granted to You under
+ this License.
+ .
+ b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
+ offers to the recipient a license to the original Work on the same terms
+ and conditions as the license granted to You under this License.
+ .
+ c. If any provision of this License is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability of
+ the remainder of the terms of this License, and without further action
+ by the parties to this agreement, such provision shall be reformed to
+ the minimum extent necessary to make such provision valid and
+ enforceable.
+ .
+ d. No term or provision of this License shall be deemed waived and no
+ breach consented to unless such waiver or consent shall be in writing
+ and signed by the party to be charged with such waiver or consent. This
+ License constitutes the entire agreement between the parties with
+ respect to the Work licensed here. There are no understandings,
+ agreements or representations with respect to the Work not specified
+ here. Licensor shall not be bound by any additional provisions that may
+ appear in any communication from You.
+ .
+ e. This License may not be modified without the mutual written agreement
+ of the Licensor and You.
+ .
+ f. The rights granted under, and the subject matter referenced, in this
+ License were drafted utilizing the terminology of the Berne Convention
+ for the Protection of Literary and Artistic Works (as amended on
+ September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
+ Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and
+ the Universal Copyright Convention (as revised on July 24, 1971). These
+ rights and subject matter take effect in the relevant jurisdiction in
+ which the License terms are sought to be enforced according to the
+ corresponding provisions of the implementation of those treaty
+ provisions in the applicable national law. If the standard suite of
+ rights granted under applicable copyright law includes additional rights
+ not granted under this License, such additional rights are deemed to be
+ included in the License; this License is not intended to restrict the
+ license of any rights under applicable law.
+ .
+ Creative Commons Notice
+ .
+ Creative Commons is not a party to this License, and makes no warranty
+ whatsoever in connection with the Work. Creative Commons will not be
+ liable to You or any party on any legal theory for any damages
+ whatsoever, including without limitation any general, special,
+ incidental or consequential damages arising in connection to this
+ license. Notwithstanding the foregoing two (2) sentences, if Creative
+ Commons has expressly identified itself as the Licensor hereunder, it
+ shall have all rights and obligations of Licensor.
+ .
+ Except for the limited purpose of indicating to the public that the Work
+ is licensed under the CCPL, Creative Commons does not authorize the use
+ by either party of the trademark "Creative Commons" or any related
+ trademark or logo of Creative Commons without the prior written consent
+ of Creative Commons. Any permitted use will be in compliance with
+ Creative Commons' then-current trademark usage guidelines, as may be
+ published on its website or otherwise made available upon request from
+ time to time. For the avoidance of doubt, this trademark restriction
+ does not form part of this License.
+ .
+ Creative Commons may be contacted at http://creativecommons.org/.
+
+License: curl
+ All rights reserved.
+ .
+ Permission to use, copy, modify, and distribute this software for any purpose
+ with or without fee is hereby granted, provided that the above copyright
+ notice and this permission notice appear in all copies.
+ .
+ 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 OF THIRD PARTY RIGHTS. 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.
+ .
+ Except as contained in this notice, the name of a copyright holder shall not
+ be used in advertising or otherwise to promote the sale, use or other dealings
+ in this Software without prior written authorization of the copyright holder.
+
+License: Expat
+ 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.
+
+License: FTL
+ The FreeType Project LICENSE
+ ----------------------------
+ .
+ 2000-Feb-08
+ .
+ Copyright 1996-2000 by
+ David Turner, Robert Wilhelm, and Werner Lemberg
+ .
+ .
+ .
+ Introduction
+ ============
+ .
+ The FreeType Project is distributed in several archive packages;
+ some of them may contain, in addition to the FreeType font engine,
+ various tools and contributions which rely on, or relate to, the
+ FreeType Project.
+ .
+ This license applies to all files found in such packages, and
+ which do not fall under their own explicit license. The license
+ affects thus the FreeType font engine, the test programs,
+ documentation and makefiles, at the very least.
+ .
+ This license was inspired by the BSD, Artistic, and IJG
+ (Independent JPEG Group) licenses, which all encourage inclusion
+ and use of free software in commercial and freeware products
+ alike. As a consequence, its main points are that:
+ .
+ o We don't promise that this software works. However, we will be
+ interested in any kind of bug reports. (`as is' distribution)
+ .
+ o You can use this software for whatever you want, in parts or
+ full form, without having to pay us. (`royalty-free' usage)
+ .
+ o You may not pretend that you wrote this software. If you use
+ it, or only parts of it, in a program, you must acknowledge
+ somewhere in your documentation that you have used the
+ FreeType code. (`credits')
+ .
+ We specifically permit and encourage the inclusion of this
+ software, with or without modifications, in commercial products.
+ We disclaim all warranties covering The FreeType Project and
+ assume no liability related to The FreeType Project.
+ .
+ .
+ Legal Terms
+ ===========
+ .
+ 0. Definitions
+ --------------
+ .
+ Throughout this license, the terms `package', `FreeType Project',
+ and `FreeType archive' refer to the set of files originally
+ distributed by the authors (David Turner, Robert Wilhelm, and
+ Werner Lemberg) as the `FreeType Project', be they named as alpha,
+ beta or final release.
+ .
+ `You' refers to the licensee, or person using the project, where
+ `using' is a generic term including compiling the project's source
+ code as well as linking it to form a `program' or `executable'.
+ This program is referred to as `a program using the FreeType
+ engine'.
+ .
+ This license applies to all files distributed in the original
+ FreeType Project, including all source code, binaries and
+ documentation, unless otherwise stated in the file in its
+ original, unmodified form as distributed in the original archive.
+ If you are unsure whether or not a particular file is covered by
+ this license, you must contact us to verify this.
+ .
+ The FreeType Project is copyright (C) 1996-2000 by David Turner,
+ Robert Wilhelm, and Werner Lemberg. All rights reserved except as
+ specified below.
+ .
+ 1. No Warranty
+ --------------
+ .
+ THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO
+ USE, OF THE FREETYPE PROJECT.
+ .
+ 2. Redistribution
+ -----------------
+ .
+ This license grants a worldwide, royalty-free, perpetual and
+ irrevocable right and license to use, execute, perform, compile,
+ display, copy, create derivative works of, distribute and
+ sublicense the FreeType Project (in both source and object code
+ forms) and derivative works thereof for any purpose; and to
+ authorize others to exercise some or all of the rights granted
+ herein, subject to the following conditions:
+ .
+ o Redistribution of source code must retain this license file
+ (`LICENSE.TXT') unaltered; any additions, deletions or changes
+ to the original files must be clearly indicated in
+ accompanying documentation. The copyright notices of the
+ unaltered, original files must be preserved in all copies of
+ source files.
+ .
+ o Redistribution in binary form must provide a disclaimer that
+ states that the software is based in part of the work of the
+ FreeType Team, in the distribution documentation. We also
+ encourage you to put an URL to the FreeType web page in your
+ documentation, though this isn't mandatory.
+ .
+ These conditions apply to any software derived from or based on
+ the FreeType Project, not just the unmodified files. If you use
+ our work, you must acknowledge us. However, no fee need be paid
+ to us.
+ .
+ 3. Advertising
+ --------------
+ .
+ Neither the FreeType authors and contributors nor you shall use
+ the name of the other for commercial, advertising, or promotional
+ purposes without specific prior written permission.
+ .
+ We suggest, but do not require, that you use one or more of the
+ following phrases to refer to this software in your documentation
+ or advertising materials: `FreeType Project', `FreeType Engine',
+ `FreeType library', or `FreeType Distribution'.
+ .
+ As you have not signed this license, you are not required to
+ accept it. However, as the FreeType Project is copyrighted
+ material, only this license, or another one contracted with the
+ authors, grants you the right to use, distribute, and modify it.
+ Therefore, by using, distributing, or modifying the FreeType
+ Project, you indicate that you understand and accept all the terms
+ of this license.
+ .
+ 4. Contacts
+ -----------
+ .
+ There are two mailing lists related to FreeType:
+ .
+ o freetype@freetype.org
+ .
+ Discusses general use and applications of FreeType, as well as
+ future and wanted additions to the library and distribution.
+ If you are looking for support, start in this list if you
+ haven't found anything to help you in the documentation.
+ .
+ o devel@freetype.org
+ .
+ Discusses bugs, as well as engine internals, design issues,
+ specific licenses, porting, etc.
+ .
+ o http://www.freetype.org
+ .
+ Holds the current FreeType web page, which will allow you to
+ download our latest development version and read online
+ documentation.
+ .
+ You can also contact us individually at:
+ .
+ David Turner <david.turner@freetype.org>
+ Robert Wilhelm <robert.wilhelm@freetype.org>
+ Werner Lemberg <werner.lemberg@freetype.org>
+
+License: ISC
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+License: OFL-1.1
+ PREAMBLE
+ The goals of the Open Font License (OFL) are to stimulate worldwide
+ development of collaborative font projects, to support the font creation
+ efforts of academic and linguistic communities, and to provide a free and
+ open framework in which fonts may be shared and improved in partnership
+ with others.
+ .
+ The OFL allows the licensed fonts to be used, studied, modified and
+ redistributed freely as long as they are not sold by themselves. The
+ fonts, including any derivative works, can be bundled, embedded,
+ redistributed and/or sold with any software provided that any reserved
+ names are not used by derivative works. The fonts and derivatives,
+ however, cannot be released under any other type of license. The
+ requirement for fonts to remain under this license does not apply
+ to any document created using the fonts or their derivatives.
+ .
+ DEFINITIONS
+ "Font Software" refers to the set of files released by the Copyright
+ Holder(s) under this license and clearly marked as such. This may
+ include source files, build scripts and documentation.
+ .
+ "Reserved Font Name" refers to any names specified as such after the
+ copyright statement(s).
+ .
+ "Original Version" refers to the collection of Font Software components as
+ distributed by the Copyright Holder(s).
+ .
+ "Modified Version" refers to any derivative made by adding to, deleting,
+ or substituting -- in part or in whole -- any of the components of the
+ Original Version, by changing formats or by porting the Font Software to a
+ new environment.
+ .
+ "Author" refers to any designer, engineer, programmer, technical
+ writer or other person who contributed to the Font Software.
+ .
+ PERMISSION & CONDITIONS
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
+ redistribute, and sell modified and unmodified copies of the Font
+ Software, subject to the following conditions:
+ .
+ 1) Neither the Font Software nor any of its individual components,
+ in Original or Modified Versions, may be sold by itself.
+ .
+ 2) Original or Modified Versions of the Font Software may be bundled,
+ redistributed and/or sold with any software, provided that each copy
+ contains the above copyright notice and this license. These can be
+ included either as stand-alone text files, human-readable headers or
+ in the appropriate machine-readable metadata fields within text or
+ binary files as long as those fields can be easily viewed by the user.
+ .
+ 3) No Modified Version of the Font Software may use the Reserved Font
+ Name(s) unless explicit written permission is granted by the corresponding
+ Copyright Holder. This restriction only applies to the primary font name as
+ presented to the users.
+ .
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+ Software shall not be used to promote, endorse or advertise any
+ Modified Version, except to acknowledge the contribution(s) of the
+ Copyright Holder(s) and the Author(s) or with their explicit written
+ permission.
+ .
+ 5) The Font Software, modified or unmodified, in part or in whole,
+ must be distributed entirely under this license, and must not be
+ distributed under any other license. The requirement for fonts to
+ remain under this license does not apply to any document created
+ using the Font Software.
+ .
+ TERMINATION
+ This license becomes null and void if any of the above conditions are
+ not met.
+ .
+ DISCLAIMER
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE.
+
+License: OpenSSL
+ LICENSE ISSUES
+ ==============
+ .
+ The OpenSSL toolkit stays under a double license, i.e. both the conditions of
+ the OpenSSL License and the original SSLeay license apply to the toolkit.
+ See below for the actual license texts.
+ .
+ OpenSSL License
+ ---------------
+ .
+ ====================================================================
+ Copyright (c) 1998-2017 The OpenSSL Project. All rights reserved.
+ .
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+ software must display the following acknowledgment:
+ "This product includes software developed by the OpenSSL Project
+ for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ .
+ 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ endorse or promote products derived from this software without
+ prior written permission. For written permission, please contact
+ openssl-core@openssl.org.
+ .
+ 5. Products derived from this software may not be called "OpenSSL"
+ nor may "OpenSSL" appear in their names without prior written
+ permission of the OpenSSL Project.
+ .
+ 6. Redistributions of any form whatsoever must retain the following
+ acknowledgment:
+ "This product includes software developed by the OpenSSL Project
+ for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ .
+ THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+ ====================================================================
+ .
+ This product includes cryptographic software written by Eric Young
+ (eay@cryptsoft.com). This product includes software written by Tim
+ Hudson (tjh@cryptsoft.com).
+ .
+ Original SSLeay License
+ -----------------------
+ .
+ Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ All rights reserved.
+ .
+ This package is an SSL implementation written
+ by Eric Young (eay@cryptsoft.com).
+ The implementation was written so as to conform with Netscapes SSL.
+ .
+ This library is free for commercial and non-commercial use as long as
+ the following conditions are aheared to. The following conditions
+ apply to all code found in this distribution, be it the RC4, RSA,
+ lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ included with this distribution is covered by the same copyright terms
+ except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ .
+ Copyright remains Eric Young's, and as such any Copyright notices in
+ the code are not to be removed.
+ If this package is used in a product, Eric Young should be given attribution
+ as the author of the parts of the library used.
+ This can be in the form of a textual message at program startup or
+ in documentation (online or textual) provided with the package.
+ .
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. All advertising materials mentioning features or use of this software
+ must display the following acknowledgement:
+ "This product includes cryptographic software written by
+ Eric Young (eay@cryptsoft.com)"
+ The word 'cryptographic' can be left out if the rouines from the library
+ being used are not cryptographic related :-).
+ 4. If you include any Windows specific code (or a derivative thereof) from
+ the apps directory (application code) you must include an acknowledgement:
+ "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ .
+ THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ .
+ The licence and distribution terms for any publically available version or
+ derivative of this code cannot be changed. i.e. this code cannot simply be
+ copied and put under another distribution licence
+ [including the GNU Public Licence.]
+
+License: RSA-MD
+ License to copy and use this software is granted provided that it is
+ identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm"
+ in all material mentioning or referencing this software or this function.
+ .
+ License is also granted to make and use derivative works provided that such
+ works are identified as "derived from the RSA Data Security, Inc. MD5
+ Message-Digest Algorithm" in all material mentioning or referencing the
+ derived work.
+ .
+ RSA Data Security, Inc. makes no representations concerning either the
+ merchantability of this software or the suitability of this software for
+ any particular purpose. It is provided "as is" without express or implied
+ warranty of any kind.
+ .
+ These notices must be retained in any copies of any part of this
+ documentation and/or software.
+
+License: Zlib
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+ .
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+ .
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
diff --git a/LICENSE.md b/LICENSE.md
deleted file mode 100644
index a983b20863..0000000000
--- a/LICENSE.md
+++ /dev/null
@@ -1,27 +0,0 @@
- 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.
-
-************************************************************************
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000000..0b5b0c341f
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur.
+Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+
+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.
+
+-- Godot Engine <https://godotengine.org>
diff --git a/LOGO_LICENSE.md b/LOGO_LICENSE.md
index 2858712f18..b357c49664 100644
--- a/LOGO_LICENSE.md
+++ b/LOGO_LICENSE.md
@@ -1,2 +1,3 @@
-Godot Logo (c) Andrea Calabró, distributed under the terms of the CC By License:
-https://creativecommons.org/licenses/by/3.0/legalcode \ No newline at end of file
+Godot Logo (C) Andrea Calabró
+Distributed under the terms of the Creative Commons Attribution License
+version 3.0 (CC-BY 3.0) <https://creativecommons.org/licenses/by/3.0/legalcode>.
diff --git a/README.md b/README.md
index 935170479d..dc0dad6b90 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[![GODOT](/logo.png)](https://godotengine.org)
+[![Godot Engine logo](/logo.png)](https://godotengine.org)
## Godot Engine
@@ -35,7 +35,7 @@ Official binaries for the Godot editor and the export templates can be found
#### Compiling from source
-[See the official docs](http://docs.godotengine.org/en/latest/reference/_compiling.html)
+[See the official docs](http://docs.godotengine.org/en/latest/development/compiling/)
for compilation instructions for every supported platform.
### Community
@@ -52,7 +52,7 @@ on Freenode.
The official documentation is hosted on [ReadTheDocs](http://docs.godotengine.org).
It is maintained by the Godot community in its own [GitHub repository](https://github.com/godotengine/godot-docs).
-The [class reference](http://docs.godotengine.org/en/latest/classes/_classes.html)
+The [class reference](http://docs.godotengine.org/en/latest/classes/)
is also accessible from within the engine.
The official demos are maintained in their own [GitHub repository](https://github.com/godotengine/godot-demo-projects)
@@ -63,4 +63,4 @@ such as text and video tutorials, demos, etc. Consult the [community channels](h
for more info.
[![Build Status](https://travis-ci.org/godotengine/godot.svg?branch=master)](https://travis-ci.org/godotengine/godot)
-[![Code Triagers Badge](http://www.codetriage.com/godotengine/godot/badges/users.svg)](http://www.codetriage.com/godotengine/godot)
+[![Code Triagers Badge](https://www.codetriage.com/godotengine/godot/badges/users.svg)](https://www.codetriage.com/godotengine/godot)
diff --git a/SConstruct b/SConstruct
index 35401194ef..45765976cd 100644
--- a/SConstruct
+++ b/SConstruct
@@ -62,7 +62,7 @@ platform_arg = ARGUMENTS.get("platform", ARGUMENTS.get("p", False))
if (os.name == "posix"):
pass
elif (os.name == "nt"):
- if (os.getenv("VCINSTALLDIR") == None or platform_arg == "android"):
+ if (os.getenv("VCINSTALLDIR") == None or platform_arg == "android" or platform_arg == "javascript"):
custom_tools = ['mingw']
env_base = Environment(tools=custom_tools)
@@ -87,6 +87,13 @@ env_base.disabled_modules = []
env_base.use_ptrcall = False
env_base.split_drivers = False
+# To decide whether to rebuild a file, use the MD5 sum only if the timestamp has changed.
+# http://scons.org/doc/production/HTML/scons-user/ch06.html#idm139837621851792
+env_base.Decider('MD5-timestamp')
+# Use cached implicit dependencies by default. Can be overridden by specifying `--implicit-deps-changed` in the command line.
+# http://scons.org/doc/production/HTML/scons-user/ch06s04.html
+env_base.SetOption('implicit_cache', 1)
+
env_base.__class__.android_add_maven_repository = methods.android_add_maven_repository
env_base.__class__.android_add_dependency = methods.android_add_dependency
@@ -143,8 +150,11 @@ opts.Add('disable_3d', "Disable 3D nodes for smaller executable (yes/no)", 'no')
opts.Add('disable_advanced_gui', "Disable advance 3D gui nodes and behaviors (yes/no)", 'no')
opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all generated binary files", '')
opts.Add('unix_global_settings_path', "UNIX-specific path to system-wide settings. Currently only used for templates", '')
-opts.Add('verbose', "Enable verbose output for the compilation (yes/no)", 'yes')
+opts.Add('verbose', "Enable verbose output for the compilation (yes/no)", 'no')
opts.Add('vsproj', "Generate Visual Studio Project. (yes/no)", 'no')
+opts.Add('warnings', "Set the level of warnings emitted during compilation (extra/all/moderate/no)", 'no')
+opts.Add('progress', "Show a progress indicator during build (yes/no)", 'yes')
+opts.Add('dev', "If yes, alias for verbose=yes warnings=all (yes/no)", 'no')
# Thirdparty libraries
opts.Add('builtin_enet', "Use the builtin enet library (yes/no)", 'yes')
@@ -200,8 +210,8 @@ if (env_base['target'] == 'debug'):
env_base.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC'])
env_base.Append(CPPFLAGS=['-DSCI_NAMESPACE'])
-if (env_base['deprecated'] != 'no'):
- env_base.Append(CPPFLAGS=['-DENABLE_DEPRECATED'])
+if (env_base['deprecated'] == 'no'):
+ env_base.Append(CPPFLAGS=['-DDISABLE_DEPRECATED'])
env_base.platforms = {}
@@ -223,6 +233,10 @@ if selected_platform in platform_list:
env = detect.create(env_base)
else:
env = env_base.Clone()
+
+ if (env["dev"] == "yes"):
+ env["warnings"] = "all"
+ env["verbose"] = "yes"
if env['vsproj'] == "yes":
env.vs_incs = []
@@ -271,6 +285,30 @@ if selected_platform in platform_list:
# must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11)
detect.configure(env)
+ if (env["warnings"] == 'yes'):
+ print("WARNING: warnings=yes is deprecated; assuming warnings=all")
+
+ if (os.name == "nt" and os.getenv("VCINSTALLDIR") and (platform_arg == "windows" or platform_arg == "uwp")): # MSVC, needs to stand out of course
+ disable_nonessential_warnings = ['/wd4267', '/wd4244', '/wd4305', '/wd4800'] # Truncations, narrowing conversions...
+ if (env["warnings"] == 'extra'):
+ env.Append(CCFLAGS=['/Wall']) # Implies /W4
+ elif (env["warnings"] == 'all' or env["warnings"] == 'yes'):
+ env.Append(CCFLAGS=['/W3'] + disable_nonessential_warnings)
+ elif (env["warnings"] == 'moderate'):
+ # C4244 shouldn't be needed here being a level-3 warning, but it is
+ env.Append(CCFLAGS=['/W2'] + disable_nonessential_warnings)
+ else: # 'no'
+ env.Append(CCFLAGS=['/w'])
+ else: # Rest of the world
+ if (env["warnings"] == 'extra'):
+ env.Append(CCFLAGS=['-Wall', '-Wextra'])
+ elif (env["warnings"] == 'all' or env["warnings"] == 'yes'):
+ env.Append(CCFLAGS=['-Wall'])
+ elif (env["warnings"] == 'moderate'):
+ env.Append(CCFLAGS=['-Wall', '-Wno-unused'])
+ else: # 'no'
+ env.Append(CCFLAGS=['-w'])
+
#env['platform_libsuffix'] = env['LIBSUFFIX']
suffix = "." + selected_platform
@@ -280,7 +318,6 @@ if selected_platform in platform_list:
print("Tools can only be built with targets 'debug' and 'release_debug'.")
sys.exit(255)
suffix += ".opt"
-
env.Append(CCFLAGS=['-DNDEBUG'])
elif (env["target"] == "release_debug"):
@@ -353,7 +390,7 @@ if selected_platform in platform_list:
methods.no_verbose(sys, env)
if (True): # FIXME: detect GLES3
- env.Append( BUILDERS = { 'GLES3_GLSL' : env.Builder(action = methods.build_gles3_headers, suffix = 'glsl.h',src_suffix = '.glsl') } )
+ env.Append( BUILDERS = { 'GLES3_GLSL' : env.Builder(action = methods.build_gles3_headers, suffix = 'glsl.gen.h',src_suffix = '.glsl') } )
Export('env')
@@ -418,3 +455,39 @@ else:
for x in platform_list:
print("\t" + x)
print("\nPlease run scons again with argument: platform=<string>")
+
+
+screen = sys.stdout
+node_count = 0
+node_count_max = 0
+node_count_interval = 1
+if ('env' in locals()):
+ node_count_fname = str(env.Dir('#')) + '/.scons_node_count'
+
+def progress_function(node):
+ global node_count, node_count_max, node_count_interval, node_count_fname
+ node_count += node_count_interval
+ if (node_count_max > 0 and node_count <= node_count_max):
+ screen.write('\r[%3d%%] ' % (node_count * 100 / node_count_max))
+ screen.flush()
+ elif (node_count_max > 0 and node_count > node_count_max):
+ screen.write('\r[100%] ')
+ screen.flush()
+ else:
+ screen.write('\r[Initial build] ')
+ screen.flush()
+
+def progress_finish(target, source, env):
+ global node_count
+ with open(node_count_fname, 'w') as f:
+ f.write('%d\n' % node_count)
+
+if ('env' in locals() and env["progress"] == "yes"):
+ try:
+ with open(node_count_fname) as f:
+ node_count_max = int(f.readline())
+ except:
+ pass
+ Progress(progress_function, interval = node_count_interval)
+ progress_finish_command = Command('progress_finish', [], progress_finish)
+ AlwaysBuild(progress_finish_command)
diff --git a/core/SCsub b/core/SCsub
index 77c8288846..4c541d7269 100644
--- a/core/SCsub
+++ b/core/SCsub
@@ -5,6 +5,7 @@ Import('env')
env.core_sources = []
+# Generate global defaults
gd_call = ""
gd_inc = ""
@@ -13,14 +14,16 @@ 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 "global_config.h"\n'
+gd_cpp = '#include "project_settings.h"\n'
gd_cpp += gd_inc
-gd_cpp += "void GlobalConfig::register_global_defaults() {\n" + gd_call + "\n}\n"
+gd_cpp += "void ProjectSettings::register_global_defaults() {\n" + gd_call + "\n}\n"
-f = open("global_defaults.cpp", "wb")
+f = open("global_defaults.gen.cpp", "wb")
f.write(gd_cpp)
f.close()
+
+# Generate AES256 script encryption key
import os
txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0"
if ("SCRIPT_AES256_ENCRYPTION_KEY" in os.environ):
@@ -44,25 +47,81 @@ if ("SCRIPT_AES256_ENCRYPTION_KEY" in os.environ):
txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0"
print("Invalid AES256 encryption key, not 64 bits hex: " + e)
-f = open("script_encryption_key.cpp", "wb")
-f.write("#include \"global_config.h\"\nuint8_t script_encryption_key[32]={" + txt + "};\n")
+f = open("script_encryption_key.gen.cpp", "wb")
+f.write("#include \"project_settings.h\"\nuint8_t script_encryption_key[32]={" + txt + "};\n")
f.close()
+# Add required thirdparty code. Header paths are hardcoded, we don't need to append
+# to the include path (saves a few chars on the compiler invocation for touchy MSVC...)
+thirdparty_dir = "#thirdparty/misc/"
+thirdparty_sources = [
+ # C sources
+ "base64.c",
+ "fastlz.c",
+ "sha256.c",
+ "smaz.c",
+
+ # C++ sources
+ "aes256.cpp",
+ "hq2x.cpp",
+ "md5.cpp",
+ "pcg.cpp",
+ "triangulator.cpp",
+]
+thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+env.add_source_files(env.core_sources, thirdparty_sources)
+
+# Minizip library, can be unbundled in theory
+# However, our version has some custom modifications, so it won't compile with the system one
+thirdparty_minizip_dir = "#thirdparty/minizip/"
+thirdparty_minizip_sources = [
+ "ioapi.c",
+ "unzip.c",
+ "zip.c",
+]
+thirdparty_minizip_sources = [thirdparty_minizip_dir + file for file in thirdparty_minizip_sources]
+env.add_source_files(env.core_sources, thirdparty_minizip_sources)
+
+thirdparty_zstd_dir = "#thirdparty/zstd/"
+thirdparty_zstd_sources = [
+ "common/entropy_common.c",
+ "common/error_private.c",
+ "common/fse_decompress.c",
+ "common/pool.c",
+ "common/threading.c",
+ "common/xxhash.c",
+ "common/zstd_common.c",
+ "compress/fse_compress.c",
+ "compress/huf_compress.c",
+ "compress/zstd_compress.c",
+ "compress/zstdmt_compress.c",
+ "decompress/huf_decompress.c",
+ "decompress/zstd_decompress.c",
+]
+thirdparty_zstd_sources = [thirdparty_zstd_dir + file for file in thirdparty_zstd_sources]
+env.add_source_files(env.core_sources, thirdparty_zstd_sources)
+
+
+# Godot's own sources
env.add_source_files(env.core_sources, "*.cpp")
-Export('env')
-
+# Make binders
import make_binders
-env.Command(['method_bind.inc', 'method_bind_ext.inc'], 'make_binders.py', make_binders.run)
+env.Command(['method_bind.gen.inc', 'method_bind_ext.gen.inc'], 'make_binders.py', make_binders.run)
+
+# Chain load SCsubs
SConscript('os/SCsub')
SConscript('math/SCsub')
SConscript('io/SCsub')
SConscript('bind/SCsub')
SConscript('helper/SCsub')
-lib = env.Library("core", env.core_sources)
+# Build it all as a library
+lib = env.Library("core", env.core_sources)
env.Prepend(LIBS=[lib])
+env.Append(CPPPATH=["#thirdparty/zstd", "#thirdparty/zstd/common"])
+Export('env')
diff --git a/core/allocators.h b/core/allocators.h
index de92d02226..3735a7746e 100644
--- a/core/allocators.h
+++ b/core/allocators.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/array.cpp b/core/array.cpp
index 80aca6f850..21dab2ba90 100644
--- a/core/array.cpp
+++ b/core/array.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/array.h b/core/array.h
index f9ba9f7706..589d52886f 100644
--- a/core/array.h
+++ b/core/array.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index c9c74094d3..273ef78669 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,14 +28,17 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "core_bind.h"
-#include "core/global_config.h"
+
+#include "core/project_settings.h"
#include "geometry.h"
-#include "io/base64.h"
+#include "io/file_access_compressed.h"
#include "io/file_access_encrypted.h"
#include "io/marshalls.h"
#include "os/keyboard.h"
#include "os/os.h"
+#include "thirdparty/misc/base64.h"
+
/**
* Time constants borrowed from loc_time.h
*/
@@ -102,14 +106,14 @@ PoolStringArray _ResourceLoader::get_dependencies(const String &p_path) {
bool _ResourceLoader::has(const String &p_path) {
- String local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ String local_path = ProjectSettings::get_singleton()->localize_path(p_path);
return ResourceCache::has(local_path);
};
void _ResourceLoader::_bind_methods() {
- 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("load_interactive", "path", "type_hint"), &_ResourceLoader::load_interactive, DEFVAL(""));
+ ClassDB::bind_method(D_METHOD("load", "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);
@@ -144,7 +148,7 @@ _ResourceSaver *_ResourceSaver::singleton = NULL;
void _ResourceSaver::_bind_methods() {
- ClassDB::bind_method(D_METHOD("save", "path", "resource:Resource", "flags"), &_ResourceSaver::save, DEFVAL(0));
+ ClassDB::bind_method(D_METHOD("save", "path", "resource", "flags"), &_ResourceSaver::save, DEFVAL(0));
ClassDB::bind_method(D_METHOD("get_recognized_extensions", "type"), &_ResourceSaver::get_recognized_extensions);
BIND_CONSTANT(FLAG_RELATIVE_PATHS);
@@ -162,9 +166,9 @@ _ResourceSaver::_ResourceSaver() {
/////////////////OS
-Point2 _OS::get_mouse_pos() const {
+Point2 _OS::get_mouse_position() const {
- return OS::get_singleton()->get_mouse_pos();
+ return OS::get_singleton()->get_mouse_position();
}
void _OS::set_window_title(const String &p_title) {
@@ -176,8 +180,8 @@ int _OS::get_mouse_button_state() const {
return OS::get_singleton()->get_mouse_button_state();
}
-String _OS::get_unique_ID() const {
- return OS::get_singleton()->get_unique_ID();
+String _OS::get_unique_id() const {
+ return OS::get_singleton()->get_unique_id();
}
bool _OS::has_touchscreen_ui_hint() const {
@@ -296,6 +300,11 @@ bool _OS::get_borderless_window() const {
return OS::get_singleton()->get_borderless_window();
}
+void _OS::set_ime_position(const Point2 &p_pos) {
+
+ return OS::get_singleton()->set_ime_position(p_pos);
+}
+
void _OS::set_use_file_access_save_and_swap(bool p_enable) {
FileAccess::set_backup_save(p_enable);
@@ -360,9 +369,9 @@ Error _OS::kill(int p_pid) {
return OS::get_singleton()->kill(p_pid);
}
-int _OS::get_process_ID() const {
+int _OS::get_process_id() const {
- return OS::get_singleton()->get_process_ID();
+ return OS::get_singleton()->get_process_id();
};
bool _OS::has_environment(const String &p_var) const {
@@ -502,7 +511,7 @@ int _OS::get_dynamic_memory_usage() const {
return OS::get_singleton()->get_dynamic_memory_usage();
}
-void _OS::set_icon(const Image &p_icon) {
+void _OS::set_icon(const Ref<Image> &p_icon) {
OS::get_singleton()->set_icon(p_icon);
}
@@ -791,7 +800,7 @@ void _OS::print_all_textures_by_size() {
img.fmt = fmt;
img.path = E->get()->get_path();
img.vram = Image::get_image_data_size(img.size.width, img.size.height, Image::Format(img.fmt));
- img.id = E->get()->get_instance_ID();
+ img.id = E->get()->get_instance_id();
total += img.vram;
imgs.push_back(img);
}
@@ -953,7 +962,7 @@ _OS *_OS::singleton = NULL;
void _OS::_bind_methods() {
- //ClassDB::bind_method(D_METHOD("get_mouse_pos"),&_OS::get_mouse_pos);
+ //ClassDB::bind_method(D_METHOD("get_mouse_position"),&_OS::get_mouse_position);
//ClassDB::bind_method(D_METHOD("is_mouse_grab_enabled"),&_OS::is_mouse_grab_enabled);
ClassDB::bind_method(D_METHOD("set_clipboard", "clipboard"), &_OS::set_clipboard);
@@ -989,6 +998,8 @@ void _OS::_bind_methods() {
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_ime_position", "position"), &_OS::set_ime_position);
+
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);
@@ -1008,7 +1019,7 @@ void _OS::_bind_methods() {
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_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);
@@ -1063,7 +1074,7 @@ void _OS::_bind_methods() {
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(D_METHOD("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);
@@ -1392,6 +1403,24 @@ Error _File::open_encrypted_pass(const String &p_path, int p_mode_flags, const S
return OK;
}
+Error _File::open_compressed(const String &p_path, int p_mode_flags, int p_compress_mode) {
+
+ FileAccessCompressed *fac = memnew(FileAccessCompressed);
+ Error err = OK;
+
+ fac->configure("GCPF", (Compression::Mode)p_compress_mode);
+
+ err = fac->_open(p_path, p_mode_flags);
+
+ if (err) {
+ memdelete(fac);
+ return err;
+ }
+
+ f = fac;
+ return OK;
+}
+
Error _File::open(const String &p_path, int p_mode_flags) {
close();
@@ -1697,6 +1726,7 @@ void _File::_bind_methods() {
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_compressed", "path", "mode_flags", "compression_mode"), &_File::open_compressed, DEFVAL(0));
ClassDB::bind_method(D_METHOD("open", "path", "flags"), &_File::open);
ClassDB::bind_method(D_METHOD("close"), &_File::close);
@@ -1720,7 +1750,7 @@ void _File::_bind_methods() {
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_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(","));
@@ -1746,6 +1776,11 @@ void _File::_bind_methods() {
BIND_CONSTANT(WRITE);
BIND_CONSTANT(READ_WRITE);
BIND_CONSTANT(WRITE_READ);
+
+ BIND_CONSTANT(COMPRESSION_FASTLZ);
+ BIND_CONSTANT(COMPRESSION_DEFLATE);
+ BIND_CONSTANT(COMPRESSION_ZSTD);
+ BIND_CONSTANT(COMPRESSION_GZIP);
}
_File::_File() {
@@ -1919,7 +1954,7 @@ Error _Directory::remove(String p_name) {
void _Directory::_bind_methods() {
- ClassDB::bind_method(D_METHOD("open:Error", "path"), &_Directory::open);
+ ClassDB::bind_method(D_METHOD("open", "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);
@@ -1927,17 +1962,17 @@ void _Directory::_bind_methods() {
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("change_dir", "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("make_dir", "path"), &_Directory::make_dir);
+ ClassDB::bind_method(D_METHOD("make_dir_recursive", "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);
+ ClassDB::bind_method(D_METHOD("copy", "from", "to"), &_Directory::copy);
+ ClassDB::bind_method(D_METHOD("rename", "from", "to"), &_Directory::rename);
+ ClassDB::bind_method(D_METHOD("remove", "path"), &_Directory::remove);
}
_Directory::_Directory() {
@@ -2074,14 +2109,14 @@ String _Marshalls::base64_to_utf8(const String &p_str) {
void _Marshalls::_bind_methods() {
- 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(D_METHOD("variant_to_base64", "variant"), &_Marshalls::variant_to_base64);
+ ClassDB::bind_method(D_METHOD("base64_to_variant", "base64_str"), &_Marshalls::base64_to_variant);
- ClassDB::bind_method(D_METHOD("raw_to_base64:String", "array"), &_Marshalls::raw_to_base64);
- ClassDB::bind_method(D_METHOD("base64_to_raw:PoolByteArray", "base64_str"), &_Marshalls::base64_to_raw);
+ ClassDB::bind_method(D_METHOD("raw_to_base64", "array"), &_Marshalls::raw_to_base64);
+ ClassDB::bind_method(D_METHOD("base64_to_raw", "base64_str"), &_Marshalls::base64_to_raw);
- 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);
+ ClassDB::bind_method(D_METHOD("utf8_to_base64", "utf8_str"), &_Marshalls::utf8_to_base64);
+ ClassDB::bind_method(D_METHOD("base64_to_utf8", "base64_str"), &_Marshalls::base64_to_utf8);
};
////////////////
@@ -2098,8 +2133,8 @@ Error _Semaphore::post() {
void _Semaphore::_bind_methods() {
- ClassDB::bind_method(D_METHOD("wait:Error"), &_Semaphore::wait);
- ClassDB::bind_method(D_METHOD("post:Error"), &_Semaphore::post);
+ ClassDB::bind_method(D_METHOD("wait"), &_Semaphore::wait);
+ ClassDB::bind_method(D_METHOD("post"), &_Semaphore::post);
}
_Semaphore::_Semaphore() {
@@ -2132,7 +2167,7 @@ void _Mutex::unlock() {
void _Mutex::_bind_methods() {
ClassDB::bind_method(D_METHOD("lock"), &_Mutex::lock);
- ClassDB::bind_method(D_METHOD("try_lock:Error"), &_Mutex::try_lock);
+ ClassDB::bind_method(D_METHOD("try_lock"), &_Mutex::try_lock);
ClassDB::bind_method(D_METHOD("unlock"), &_Mutex::unlock);
}
@@ -2221,7 +2256,7 @@ String _Thread::get_id() const {
if (!thread)
return String();
- return itos(thread->get_ID());
+ return itos(thread->get_id());
}
bool _Thread::is_active() const {
@@ -2245,10 +2280,10 @@ Variant _Thread::wait_to_finish() {
void _Thread::_bind_methods() {
- ClassDB::bind_method(D_METHOD("start:Error", "instance", "method", "userdata", "priority"), &_Thread::start, DEFVAL(Variant()), DEFVAL(PRIORITY_NORMAL));
+ ClassDB::bind_method(D_METHOD("start", "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);
+ ClassDB::bind_method(D_METHOD("wait_to_finish"), &_Thread::wait_to_finish);
BIND_CONSTANT(PRIORITY_LOW);
BIND_CONSTANT(PRIORITY_NORMAL);
@@ -2366,6 +2401,23 @@ Array _ClassDB::get_property_list(StringName p_class, bool p_no_inheritance) con
return ret;
}
+Variant _ClassDB::get_property(Object *p_object, const StringName &p_property) const {
+ Variant ret;
+ ClassDB::get_property(p_object, p_property, ret);
+ return ret;
+}
+
+Error _ClassDB::set_property(Object *p_object, const StringName &p_property, const Variant &p_value) const {
+ Variant ret;
+ bool valid;
+ if (!ClassDB::set_property(p_object, p_property, p_value, &valid)) {
+ return ERR_UNAVAILABLE;
+ } else if (!valid) {
+ return ERR_INVALID_DATA;
+ }
+ return OK;
+}
+
bool _ClassDB::has_method(StringName p_class, StringName p_method, bool p_no_inheritance) const {
return ClassDB::has_method(p_class, p_method, p_no_inheritance);
@@ -2431,13 +2483,15 @@ void _ClassDB::_bind_methods() {
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(D_METHOD("instance", "class"), &_ClassDB::instance);
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(D_METHOD("class_get_property_list", "class", "no_inheritance"), &_ClassDB::get_property_list, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("class_get_property", "object", "property"), &_ClassDB::get_property);
+ ClassDB::bind_method(D_METHOD("class_set_property", "object", "property", "value"), &_ClassDB::set_property);
ClassDB::bind_method(D_METHOD("class_has_method", "class", "method", "no_inheritance"), &_ClassDB::has_method, DEFVAL(false));
@@ -2510,6 +2564,10 @@ Dictionary _Engine::get_version_info() const {
return Engine::get_singleton()->get_version_info();
}
+bool _Engine::is_in_fixed_frame() const {
+ return Engine::get_singleton()->is_in_fixed_frame();
+}
+
void _Engine::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_iterations_per_second", "iterations_per_second"), &_Engine::set_iterations_per_second);
@@ -2525,9 +2583,11 @@ void _Engine::_bind_methods() {
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(D_METHOD("get_main_loop:MainLoop"), &_Engine::get_main_loop);
+ ClassDB::bind_method(D_METHOD("get_main_loop"), &_Engine::get_main_loop);
ClassDB::bind_method(D_METHOD("get_version_info"), &_Engine::get_version_info);
+
+ ClassDB::bind_method(D_METHOD("is_in_fixed_frame"), &_Engine::is_in_fixed_frame);
}
_Engine *_Engine::singleton = NULL;
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 1d231ff033..61c80aaba3 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,8 @@
#ifndef CORE_BIND_H
#define CORE_BIND_H
+#include "image.h"
+#include "io/compression.h"
#include "io/resource_loader.h"
#include "io/resource_saver.h"
#include "os/dir_access.h"
@@ -119,7 +122,7 @@ public:
MONTH_DECEMBER
};
- Point2 get_mouse_pos() const;
+ Point2 get_mouse_position() const;
void set_window_title(const String &p_title);
int get_mouse_button_state() const;
@@ -155,6 +158,8 @@ public:
virtual void set_borderless_window(bool p_borderless);
virtual bool get_borderless_window() const;
+ virtual void set_ime_position(const Point2 &p_pos);
+
Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track);
bool native_video_is_playing();
void native_video_pause();
@@ -170,7 +175,7 @@ public:
Error kill(int p_pid);
Error shell_open(String p_uri);
- int get_process_ID() const;
+ int get_process_id() const;
bool has_environment(const String &p_var) const;
String get_environment(const String &p_var) const;
@@ -199,7 +204,7 @@ public:
bool is_debug_build() const;
- String get_unique_ID() const;
+ String get_unique_id() const;
String get_scancode_string(uint32_t p_code) const;
bool is_scancode_unicode(uint32_t p_unicode) const;
@@ -225,7 +230,7 @@ public:
void set_use_file_access_save_and_swap(bool p_enable);
- void set_icon(const Image &p_icon);
+ void set_icon(const Ref<Image> &p_icon);
int get_exit_code() const;
void set_exit_code(int p_code);
@@ -364,8 +369,16 @@ public:
WRITE_READ = 7,
};
+ enum CompressionMode {
+ COMPRESSION_FASTLZ = Compression::MODE_FASTLZ,
+ COMPRESSION_DEFLATE = Compression::MODE_DEFLATE,
+ COMPRESSION_ZSTD = Compression::MODE_ZSTD,
+ COMPRESSION_GZIP = Compression::MODE_GZIP
+ };
+
Error open_encrypted(const String &p_path, int p_mode_flags, const Vector<uint8_t> &p_key);
Error open_encrypted_pass(const String &p_path, int p_mode_flags, const String &p_pass);
+ Error open_compressed(const String &p_path, int p_mode_flags, int p_compress_mode = 0);
Error open(const String &p_path, int p_mode_flags); ///< open a file
void close(); ///< close a file
@@ -445,7 +458,7 @@ protected:
public:
Error open(const String &p_path);
- Error list_dir_begin(bool p_skip_internal = false, bool p_skip_hidden = false); ///< This starts dir listing
+ Error list_dir_begin(bool p_skip_navigational = false, bool p_skip_hidden = false); ///< This starts dir listing
String get_next();
bool current_is_dir() const;
@@ -586,6 +599,8 @@ public:
Array get_signal_list(StringName p_class, bool p_no_inheritance = false) const;
Array get_property_list(StringName p_class, bool p_no_inheritance = false) const;
+ Variant get_property(Object *p_object, const StringName &p_property) const;
+ Error set_property(Object *p_object, const StringName &p_property, const Variant &p_value) const;
bool has_method(StringName p_class, StringName p_method, bool p_no_inheritance = false) const;
@@ -630,6 +645,8 @@ public:
Dictionary get_version_info() const;
+ bool is_in_fixed_frame() const;
+
_Engine();
};
diff --git a/core/class_db.cpp b/core/class_db.cpp
index 3c376f7451..0503f7c6fc 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,7 @@
#include "class_db.h"
#include "os/mutex.h"
+#include "version.h"
#ifdef NO_THREADS
@@ -44,9 +46,9 @@
#ifdef DEBUG_METHODS_ENABLED
-ParamDef::ParamDef(const Variant &p_variant) {
- used = true;
- val = p_variant;
+ParamDef::ParamDef(const Variant &p_variant)
+ : used(true),
+ val(p_variant) {
}
MethodDefinition D_METHOD(const char *p_name) {
@@ -495,7 +497,7 @@ void ClassDB::_add_class2(const StringName &p_class, const StringName &p_inherit
}
}
-void ClassDB::get_method_list(StringName p_class, List<MethodInfo> *p_methods, bool p_no_inheritance) {
+void ClassDB::get_method_list(StringName p_class, List<MethodInfo> *p_methods, bool p_no_inheritance, bool p_exclude_from_properties) {
OBJTYPE_RLOCK;
@@ -526,6 +528,9 @@ void ClassDB::get_method_list(StringName p_class, List<MethodInfo> *p_methods, b
minfo.name = E->get();
minfo.id = method->get_method_id();
+ if (p_exclude_from_properties && type->methods_in_properties.has(minfo.name))
+ continue;
+
for (int i = 0; i < method->get_argument_count(); i++) {
//Variant::Type t=method->get_argument_type(i);
@@ -800,7 +805,14 @@ void ClassDB::add_property(StringName p_class, const PropertyInfo &p_pinfo, cons
OBJTYPE_WLOCK
type->property_list.push_back(p_pinfo);
-
+#ifdef DEBUG_METHODS_ENABLED
+ if (mb_get) {
+ type->methods_in_properties.insert(p_getter);
+ }
+ if (mb_set) {
+ type->methods_in_properties.insert(p_setter);
+ }
+#endif
PropertySetGet psg;
psg.setter = p_setter;
psg.getter = p_getter;
@@ -925,6 +937,28 @@ bool ClassDB::get_property(Object *p_object, const StringName &p_property, Varia
return false;
}
+int ClassDB::get_property_index(const StringName &p_class, const StringName &p_property, bool *r_is_valid) {
+
+ ClassInfo *type = classes.getptr(p_class);
+ ClassInfo *check = type;
+ while (check) {
+ const PropertySetGet *psg = check->property_setget.getptr(p_property);
+ if (psg) {
+
+ if (r_is_valid)
+ *r_is_valid = true;
+
+ return psg->index;
+ }
+
+ check = check->inherits_ptr;
+ }
+ if (r_is_valid)
+ *r_is_valid = false;
+
+ return -1;
+}
+
Variant::Type ClassDB::get_property_type(const StringName &p_class, const StringName &p_property, bool *r_is_valid) {
ClassInfo *type = classes.getptr(p_class);
@@ -1048,12 +1082,6 @@ MethodBind *ClassDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind, const c
StringName mdname = StaticCString::create(method_name);
#endif
- StringName rettype;
- if (mdname.operator String().find(":") != -1) {
- rettype = mdname.operator String().get_slice(":", 1);
- mdname = mdname.operator String().get_slice(":", 0);
- }
-
OBJTYPE_WLOCK;
ERR_FAIL_COND_V(!p_bind, NULL);
p_bind->set_name(mdname);
@@ -1072,7 +1100,7 @@ MethodBind *ClassDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind, const c
if (!type) {
ERR_PRINTS("Couldn't bind method '" + mdname + "' for instance: " + instance_type);
memdelete(p_bind);
- ERR_FAIL_COND_V(!type, NULL);
+ ERR_FAIL_V(NULL);
}
if (type->method_map.has(mdname)) {
@@ -1081,11 +1109,20 @@ MethodBind *ClassDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind, const c
ERR_EXPLAIN("Method already bound: " + instance_type + "::" + mdname);
ERR_FAIL_V(NULL);
}
+
#ifdef DEBUG_METHODS_ENABLED
+
+ if (method_name.args.size() > p_bind->get_argument_count()) {
+ memdelete(p_bind);
+ ERR_EXPLAIN("Method definition provides more arguments than the method actually has: " + instance_type + "::" + mdname);
+ ERR_FAIL_V(NULL);
+ }
+
p_bind->set_argument_names(method_name.args);
- p_bind->set_return_type(rettype);
+
type->method_order.push_back(mdname);
#endif
+
type->method_map[mdname] = p_bind;
Vector<Variant> defvals;
@@ -1194,7 +1231,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(p_class, cmp))
+ if (is_parent_class(p_class, cmp) || is_parent_class(cmp, p_class))
p_extensions->push_back(*K);
}
}
diff --git a/core/class_db.h b/core/class_db.h
index 6966183cfa..4287c5990f 100644
--- a/core/class_db.h
+++ b/core/class_db.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -44,12 +45,11 @@ struct ParamHint {
String hint_text;
Variant default_val;
- ParamHint(const String &p_name = "", PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_text = "", Variant p_default_val = Variant()) {
-
- name = p_name;
- hint = p_hint;
- hint_text = p_hint_text;
- default_val = p_default_val;
+ ParamHint(const String &p_name = "", PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_text = "", const Variant &p_default_val = Variant())
+ : name(p_name),
+ hint(p_hint),
+ hint_text(p_hint_text),
+ default_val(p_default_val) {
}
};
@@ -72,8 +72,10 @@ struct MethodDefinition {
StringName name;
Vector<StringName> args;
MethodDefinition() {}
- MethodDefinition(const char *p_name) { name = p_name; }
- MethodDefinition(const StringName &p_name) { name = p_name; }
+ MethodDefinition(const char *p_name)
+ : name(p_name) {}
+ MethodDefinition(const StringName &p_name)
+ : name(p_name) {}
};
MethodDefinition D_METHOD(const char *p_name);
@@ -138,6 +140,7 @@ public:
#ifdef DEBUG_METHODS_ENABLED
List<StringName> constant_order;
List<StringName> method_order;
+ Set<StringName> methods_in_properties;
List<MethodInfo> virtual_methods;
StringName category;
#endif
@@ -434,12 +437,6 @@ public:
MethodBind *bind = create_vararg_method_bind(p_method, p_info);
ERR_FAIL_COND_V(!bind, NULL);
- String rettype;
- if (p_name.operator String().find(":") != -1) {
- rettype = p_name.operator String().get_slice(":", 1);
- p_name = p_name.operator String().get_slice(":", 0);
- }
-
bind->set_name(p_name);
bind->set_default_arguments(p_default_args);
@@ -459,8 +456,7 @@ public:
}
type->method_map[p_name] = bind;
#ifdef DEBUG_METHODS_ENABLED
- if (!rettype.empty())
- bind->set_return_type(rettype);
+ bind->set_return_type("Variant");
type->method_order.push_back(p_name);
#endif
@@ -478,6 +474,7 @@ public:
static bool set_property(Object *p_object, const StringName &p_property, const Variant &p_value, bool *r_valid = NULL);
static bool get_property(Object *p_object, const StringName &p_property, Variant &r_value);
static bool has_property(const StringName &p_class, const StringName &p_property, bool p_no_inheritance = false);
+ static int get_property_index(const StringName &p_class, const StringName &p_property, bool *r_is_valid = NULL);
static Variant::Type get_property_type(const StringName &p_class, const StringName &p_property, bool *r_is_valid = NULL);
static StringName get_property_setter(StringName p_class, const StringName p_property);
static StringName get_property_getter(StringName p_class, const StringName p_property);
@@ -485,7 +482,7 @@ public:
static bool has_method(StringName p_class, StringName p_method, bool p_no_inheritance = false);
static void set_method_flags(StringName p_class, StringName p_method, int p_flags);
- static void get_method_list(StringName p_class, List<MethodInfo> *p_methods, bool p_no_inheritance = false);
+ static void get_method_list(StringName p_class, List<MethodInfo> *p_methods, bool p_no_inheritance = false, bool p_exclude_from_properties = false);
static MethodBind *get_method(StringName p_class, StringName p_name);
static void add_virtual_method(const StringName &p_class, const MethodInfo &p_method, bool p_virtual = true);
diff --git a/core/color.cpp b/core/color.cpp
index f052ddea8a..22a5504431 100644
--- a/core/color.cpp
+++ b/core/color.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/color.h b/core/color.h
index 2339cd6cd7..9074a0e6d6 100644
--- a/core/color.h
+++ b/core/color.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -82,6 +83,40 @@ struct Color {
return res;
}
+ _FORCE_INLINE_ uint32_t to_rgbe9995() const {
+
+ const float pow2to9 = 512.0f;
+ const float B = 15.0f;
+ //const float Emax = 31.0f;
+ const float N = 9.0f;
+
+ float sharedexp = 65408.000f; //(( pow2to9 - 1.0f)/ pow2to9)*powf( 2.0f, 31.0f - 15.0f);
+
+ float cRed = MAX(0.0f, MIN(sharedexp, r));
+ float cGreen = MAX(0.0f, MIN(sharedexp, g));
+ float cBlue = MAX(0.0f, MIN(sharedexp, b));
+
+ float cMax = MAX(cRed, MAX(cGreen, cBlue));
+
+ // expp = MAX(-B - 1, log2(maxc)) + 1 + B
+
+ float expp = MAX(-B - 1.0f, floor(Math::log(cMax) / Math_LN2)) + 1.0f + B;
+
+ float sMax = (float)floor((cMax / Math::pow(2.0f, expp - B - N)) + 0.5f);
+
+ float exps = expp + 1.0f;
+
+ if (0.0 <= sMax && sMax < pow2to9) {
+ exps = expp;
+ }
+
+ float sRed = Math::floor((cRed / pow(2.0f, exps - B - N)) + 0.5f);
+ float sGreen = Math::floor((cGreen / pow(2.0f, exps - B - N)) + 0.5f);
+ float sBlue = Math::floor((cBlue / pow(2.0f, exps - B - N)) + 0.5f);
+
+ return (uint32_t(Math::fast_ftoi(sRed)) & 0x1FF) | ((uint32_t(Math::fast_ftoi(sGreen)) & 0x1FF) << 9) | ((uint32_t(Math::fast_ftoi(sBlue)) & 0x1FF) << 18) | ((uint32_t(Math::fast_ftoi(exps)) & 0x1F) << 27);
+ }
+
_FORCE_INLINE_ Color blend(const Color &p_over) const {
Color res;
@@ -105,8 +140,16 @@ struct Color {
b < 0.04045 ? b * (1.0 / 12.92) : Math::pow((b + 0.055) * (1.0 / (1 + 0.055)), 2.4),
a);
}
+ _FORCE_INLINE_ Color to_srgb() const {
+
+ return Color(
+ r < 0.0031308 ? 12.92 * r : (1.0 + 0.055) * Math::pow(r, 1.0f / 2.4f) - 0.055,
+ g < 0.0031308 ? 12.92 * g : (1.0 + 0.055) * Math::pow(g, 1.0f / 2.4f) - 0.055,
+ b < 0.0031308 ? 12.92 * b : (1.0 + 0.055) * Math::pow(b, 1.0f / 2.4f) - 0.055, a);
+ }
- static Color hex(uint32_t p_hex);
+ static Color
+ hex(uint32_t p_hex);
static Color html(const String &p_color);
static bool html_is_valid(const String &p_color);
static Color named(const String &p_name);
diff --git a/core/command_queue_mt.cpp b/core/command_queue_mt.cpp
index c66177261b..823494ff67 100644
--- a/core/command_queue_mt.cpp
+++ b/core/command_queue_mt.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/command_queue_mt.h b/core/command_queue_mt.h
index d8c05ab782..2e0c478108 100644
--- a/core/command_queue_mt.h
+++ b/core/command_queue_mt.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -169,6 +170,63 @@ class CommandQueueMT {
virtual void call() { (instance->*method)(p1, p2, p3, p4, p5, p6, p7, p8); }
};
+ template <class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>
+ struct Command9 : public CommandBase {
+
+ T *instance;
+ M method;
+ typename GetSimpleTypeT<P1>::type_t p1;
+ typename GetSimpleTypeT<P2>::type_t p2;
+ typename GetSimpleTypeT<P3>::type_t p3;
+ typename GetSimpleTypeT<P4>::type_t p4;
+ typename GetSimpleTypeT<P5>::type_t p5;
+ typename GetSimpleTypeT<P6>::type_t p6;
+ typename GetSimpleTypeT<P7>::type_t p7;
+ typename GetSimpleTypeT<P8>::type_t p8;
+ typename GetSimpleTypeT<P9>::type_t p9;
+
+ virtual void call() { (instance->*method)(p1, p2, p3, p4, p5, p6, p7, p8, p9); }
+ };
+
+ template <class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10>
+ struct Command10 : public CommandBase {
+
+ T *instance;
+ M method;
+ typename GetSimpleTypeT<P1>::type_t p1;
+ typename GetSimpleTypeT<P2>::type_t p2;
+ typename GetSimpleTypeT<P3>::type_t p3;
+ typename GetSimpleTypeT<P4>::type_t p4;
+ typename GetSimpleTypeT<P5>::type_t p5;
+ typename GetSimpleTypeT<P6>::type_t p6;
+ typename GetSimpleTypeT<P7>::type_t p7;
+ typename GetSimpleTypeT<P8>::type_t p8;
+ typename GetSimpleTypeT<P9>::type_t p9;
+ typename GetSimpleTypeT<P10>::type_t p10;
+
+ virtual void call() { (instance->*method)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); }
+ };
+
+ template <class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11>
+ struct Command11 : public CommandBase {
+
+ T *instance;
+ M method;
+ typename GetSimpleTypeT<P1>::type_t p1;
+ typename GetSimpleTypeT<P2>::type_t p2;
+ typename GetSimpleTypeT<P3>::type_t p3;
+ typename GetSimpleTypeT<P4>::type_t p4;
+ typename GetSimpleTypeT<P5>::type_t p5;
+ typename GetSimpleTypeT<P6>::type_t p6;
+ typename GetSimpleTypeT<P7>::type_t p7;
+ typename GetSimpleTypeT<P8>::type_t p8;
+ typename GetSimpleTypeT<P9>::type_t p9;
+ typename GetSimpleTypeT<P10>::type_t p10;
+ typename GetSimpleTypeT<P11>::type_t p11;
+
+ virtual void call() { (instance->*method)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); }
+ };
+
/* comands that return */
template <class T, class M, class R>
@@ -778,6 +836,76 @@ public:
if (sync) sync->post();
}
+
+ template <class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>
+ void push(T *p_instance, M p_method, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) {
+
+ Command9<T, M, P1, P2, P3, P4, P5, P6, P7, P8, P9> *cmd = allocate_and_lock<Command9<T, M, P1, P2, P3, P4, P5, P6, P7, P8, P9> >();
+
+ cmd->instance = p_instance;
+ cmd->method = p_method;
+ cmd->p1 = p1;
+ cmd->p2 = p2;
+ cmd->p3 = p3;
+ cmd->p4 = p4;
+ cmd->p5 = p5;
+ cmd->p6 = p6;
+ cmd->p7 = p7;
+ cmd->p8 = p8;
+ cmd->p9 = p9;
+
+ unlock();
+
+ if (sync) sync->post();
+ }
+
+ template <class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10>
+ void push(T *p_instance, M p_method, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) {
+
+ Command10<T, M, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> *cmd = allocate_and_lock<Command10<T, M, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> >();
+
+ cmd->instance = p_instance;
+ cmd->method = p_method;
+ cmd->p1 = p1;
+ cmd->p2 = p2;
+ cmd->p3 = p3;
+ cmd->p4 = p4;
+ cmd->p5 = p5;
+ cmd->p6 = p6;
+ cmd->p7 = p7;
+ cmd->p8 = p8;
+ cmd->p9 = p9;
+ cmd->p10 = p10;
+
+ unlock();
+
+ if (sync) sync->post();
+ }
+
+ template <class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11>
+ void push(T *p_instance, M p_method, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) {
+
+ Command11<T, M, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> *cmd = allocate_and_lock<Command11<T, M, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> >();
+
+ cmd->instance = p_instance;
+ cmd->method = p_method;
+ cmd->p1 = p1;
+ cmd->p2 = p2;
+ cmd->p3 = p3;
+ cmd->p4 = p4;
+ cmd->p5 = p5;
+ cmd->p6 = p6;
+ cmd->p7 = p7;
+ cmd->p8 = p8;
+ cmd->p9 = p9;
+ cmd->p10 = p10;
+ cmd->p11 = p11;
+
+ unlock();
+
+ if (sync) sync->post();
+ }
+
/*** PUSH AND RET COMMANDS ***/
template <class T, class M, class R>
diff --git a/core/compressed_translation.cpp b/core/compressed_translation.cpp
index 75c24a5aba..172249c5d7 100644
--- a/core/compressed_translation.cpp
+++ b/core/compressed_translation.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,218 +30,11 @@
#include "compressed_translation.h"
#include "pair.h"
-#include <string.h>
-
-/////////// SMAZ /////////////
-
-/*
-Copyright (c) 2006-2009, Salvatore Sanfilippo
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- * Neither the name of Smaz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/* Our compression codebook, used for compression */
-static const char *Smaz_cb[241] = {
- "\002s,\266", "\003had\232\002leW", "\003on \216", "", "\001yS",
- "\002ma\255\002li\227", "\003or \260", "", "\002ll\230\003s t\277",
- "\004fromg\002mel", "", "\003its\332", "\001z\333", "\003ingF", "\001>\336",
- "\001 \000\003 (\002nc\344", "\002nd=\003 on\312",
- "\002ne\213\003hat\276\003re q", "", "\002ngT\003herz\004have\306\003s o\225",
- "", "\003ionk\003s a\254\002ly\352", "\003hisL\003 inN\003 be\252", "",
- "\003 fo\325\003 of \003 ha\311", "", "\002of\005",
- "\003 co\241\002no\267\003 ma\370", "", "", "\003 cl\356\003enta\003 an7",
- "\002ns\300\001\"e", "\003n t\217\002ntP\003s, \205",
- "\002pe\320\003 we\351\002om\223", "\002on\037", "", "\002y G", "\003 wa\271",
- "\003 re\321\002or*", "", "\002=\"\251\002ot\337", "\003forD\002ou[",
- "\003 toR", "\003 th\r", "\003 it\366",
- "\003but\261\002ra\202\003 wi\363\002</\361", "\003 wh\237", "\002 4",
- "\003nd ?", "\002re!", "", "\003ng c", "",
- "\003ly \307\003ass\323\001a\004\002rir", "", "", "", "\002se_", "\003of \"",
- "\003div\364\002ros\003ere\240", "", "\002ta\310\001bZ\002si\324", "",
- "\003and\a\002rs\335", "\002rt\362", "\002teE", "\003ati\316", "\002so\263",
- "\002th\021", "\002tiJ\001c\034\003allp", "\003ate\345", "\002ss\246",
- "\002stM", "", "\002><\346", "\002to\024", "\003arew", "\001d\030",
- "\002tr\303", "", "\001\n1\003 a \222", "\003f tv\002veo", "\002un\340", "",
- "\003e o\242", "\002a \243\002wa\326\001e\002", "\002ur\226\003e a\274",
- "\002us\244\003\n\r\n\247", "\002ut\304\003e c\373", "\002we\221", "", "",
- "\002wh\302", "\001f,", "", "", "", "\003d t\206", "", "", "\003th \343",
- "\001g;", "", "", "\001\r9\003e s\265", "\003e t\234", "", "\003to Y",
- "\003e\r\n\236", "\002d \036\001h\022", "", "\001,Q", "\002 a\031", "\002 b^",
- "\002\r\n\025\002 cI", "\002 d\245", "\002 e\253", "\002 fh\001i\b\002e \v",
- "", "\002 hU\001-\314", "\002 i8", "", "", "\002 l\315", "\002 m{",
- "\002f :\002 n\354", "\002 o\035", "\002 p}\001.n\003\r\n\r\250", "",
- "\002 r\275", "\002 s>", "\002 t\016", "", "\002g \235\005which+\003whi\367",
- "\002 w5", "\001/\305", "\003as \214", "\003at \207", "", "\003who\331", "",
- "\001l\026\002h \212", "", "\002, $", "", "\004withV", "", "", "", "\001m-", "",
- "", "\002ac\357", "\002ad\350", "\003TheH", "", "", "\004this\233\001n\t",
- "", "\002. y", "", "\002alX\003e, \365", "\003tio\215\002be\\",
- "\002an\032\003ver\347", "", "\004that0\003tha\313\001o\006", "\003was2",
- "\002arO", "\002as.", "\002at'\003the\001\004they\200\005there\322\005theird",
- "\002ce\210", "\004were]", "", "\002ch\231\002l \264\001p<", "", "",
- "\003one\256", "", "\003he \023\002dej", "\003ter\270", "\002cou", "",
- "\002by\177\002di\201\002eax", "", "\002ec\327", "\002edB", "\002ee\353", "",
- "", "\001r\f\002n )", "", "", "", "\002el\262", "", "\003in i\002en3", "",
- "\002o `\001s\n", "", "\002er\033", "\003is t\002es6", "", "\002ge\371",
- "\004.com\375", "\002fo\334\003our\330", "\003ch \301\001t\003", "\002hab", "",
- "\003men\374", "", "\002he\020", "", "", "\001u&", "\002hif", "",
- "\003not\204\002ic\203", "\003ed @\002id\355", "", "", "\002ho\273",
- "\002r K\001vm", "", "", "", "\003t t\257\002il\360", "\002im\342",
- "\003en \317\002in\017", "\002io\220", "\002s \027\001wA", "", "\003er |",
- "\003es ~\002is%", "\002it/", "", "\002iv\272", "",
- "\002t #\ahttp://C\001x\372", "\002la\211", "\001<\341", "\003, a\224"
-};
-
-/* Reverse compression codebook, used for decompression */
-static const char *Smaz_rcb[254] = {
- " ", "the", "e", "t", "a", "of", "o", "and", "i", "n", "s", "e ", "r", " th",
- " t", "in", "he", "th", "h", "he ", "to", "\r\n", "l", "s ", "d", " a", "an",
- "er", "c", " o", "d ", "on", " of", "re", "of ", "t ", ", ", "is", "u", "at",
- " ", "n ", "or", "which", "f", "m", "as", "it", "that", "\n", "was", "en",
- " ", " w", "es", " an", " i", "\r", "f ", "g", "p", "nd", " s", "nd ", "ed ",
- "w", "ed", "http://", "for", "te", "ing", "y ", "The", " c", "ti", "r ", "his",
- "st", " in", "ar", "nt", ",", " to", "y", "ng", " h", "with", "le", "al", "to ",
- "b", "ou", "be", "were", " b", "se", "o ", "ent", "ha", "ng ", "their", "\"",
- "hi", "from", " f", "in ", "de", "ion", "me", "v", ".", "ve", "all", "re ",
- "ri", "ro", "is ", "co", "f t", "are", "ea", ". ", "her", " m", "er ", " p",
- "es ", "by", "they", "di", "ra", "ic", "not", "s, ", "d t", "at ", "ce", "la",
- "h ", "ne", "as ", "tio", "on ", "n t", "io", "we", " a ", "om", ", a", "s o",
- "ur", "li", "ll", "ch", "had", "this", "e t", "g ", "e\r\n", " wh", "ere",
- " co", "e o", "a ", "us", " d", "ss", "\n\r\n", "\r\n\r", "=\"", " be", " e",
- "s a", "ma", "one", "t t", "or ", "but", "el", "so", "l ", "e s", "s,", "no",
- "ter", " wa", "iv", "ho", "e a", " r", "hat", "s t", "ns", "ch ", "wh", "tr",
- "ut", "/", "have", "ly ", "ta", " ha", " on", "tha", "-", " l", "ati", "en ",
- "pe", " re", "there", "ass", "si", " fo", "wa", "ec", "our", "who", "its", "z",
- "fo", "rs", ">", "ot", "un", "<", "im", "th ", "nc", "ate", "><", "ver", "ad",
- " we", "ly", "ee", " n", "id", " cl", "ac", "il", "</", "rt", " wi", "div",
- "e, ", " it", "whi", " ma", "ge", "x", "e c", "men", ".com"
-};
-static int smaz_compress(const char *in, int inlen, char *out, int outlen) {
- unsigned int h1, h2, h3 = 0;
- int verblen = 0, _outlen = outlen;
- char verb[256], *_out = out;
-
- while (inlen) {
- int j = 7, needed;
- char *flush = NULL;
- const char *slot;
-
- h1 = h2 = in[0] << 3;
- if (inlen > 1) h2 += in[1];
- if (inlen > 2) h3 = h2 ^ in[2];
- if (j > inlen) j = inlen;
-
- /* Try to lookup substrings into the hash table, starting from the
-* longer to the shorter substrings */
- for (; j > 0; j--) {
- switch (j) {
- case 1: slot = Smaz_cb[h1 % 241]; break;
- case 2: slot = Smaz_cb[h2 % 241]; break;
- default: slot = Smaz_cb[h3 % 241]; break;
- }
- while (slot[0]) {
- if (slot[0] == j && memcmp(slot + 1, in, j) == 0) {
- /* Match found in the hash table,
-* prepare a verbatim bytes flush if needed */
- if (verblen) {
- needed = (verblen == 1) ? 2 : 2 + verblen;
- flush = out;
- out += needed;
- outlen -= needed;
- }
- /* Emit the byte */
- if (outlen <= 0) return _outlen + 1;
- out[0] = slot[slot[0] + 1];
- out++;
- outlen--;
- inlen -= j;
- in += j;
- goto out;
- } else {
- slot += slot[0] + 2;
- }
- }
- }
- /* Match not found - add the byte to the verbatim buffer */
- verb[verblen] = in[0];
- verblen++;
- inlen--;
- in++;
- out:
- /* Prepare a flush if we reached the flush length limit, and there
-* is not already a pending flush operation. */
- if (!flush && (verblen == 256 || (verblen > 0 && inlen == 0))) {
- needed = (verblen == 1) ? 2 : 2 + verblen;
- flush = out;
- out += needed;
- outlen -= needed;
- if (outlen < 0) return _outlen + 1;
- }
- /* Perform a verbatim flush if needed */
- if (flush) {
- if (verblen == 1) {
- flush[0] = (signed char)254;
- flush[1] = verb[0];
- } else {
- flush[0] = (signed char)255;
- flush[1] = (signed char)(verblen - 1);
- memcpy(flush + 2, verb, verblen);
- }
- flush = NULL;
- verblen = 0;
- }
- }
- return out - _out;
-}
-
-static int smaz_decompress(const char *in, int inlen, char *out, int outlen) {
- unsigned char *c = (unsigned char *)in;
- char *_out = out;
- int _outlen = outlen;
-
- while (inlen) {
- if (*c == 254) {
- /* Verbatim byte */
- if (outlen < 1) return _outlen + 1;
- *out = *(c + 1);
- out++;
- outlen--;
- c += 2;
- inlen -= 2;
- } else if (*c == 255) {
- /* Verbatim string */
- int len = (*(c + 1)) + 1;
- if (outlen < len) return _outlen + 1;
- memcpy(out, c + 2, len);
- out += len;
- outlen -= len;
- c += 2 + len;
- inlen -= 2 + len;
- } else {
- /* Codebook entry */
- const char *s = Smaz_rcb[*c];
- int len = strlen(s);
-
- if (outlen < len) return _outlen + 1;
- memcpy(out, s, len);
- out += len;
- outlen -= len;
- c++;
- inlen--;
- }
- }
- return out - _out;
+extern "C" {
+#include "thirdparty/misc/smaz.h"
}
-/////////// END OF SMAZ /////////////
-
struct _PHashTranslationCmp {
int orig_len;
@@ -512,7 +306,7 @@ void PHashTranslation::_get_property_list(List<PropertyInfo> *p_list) const {
}
void PHashTranslation::_bind_methods() {
- ClassDB::bind_method(D_METHOD("generate", "from:Translation"), &PHashTranslation::generate);
+ ClassDB::bind_method(D_METHOD("generate", "from"), &PHashTranslation::generate);
}
PHashTranslation::PHashTranslation() {
diff --git a/core/compressed_translation.h b/core/compressed_translation.h
index abaa4ebe2c..c010491b3a 100644
--- a/core/compressed_translation.h
+++ b/core/compressed_translation.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp
index cbb3060f13..2f5a684373 100644
--- a/core/core_string_names.cpp
+++ b/core/core_string_names.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,17 +31,20 @@
CoreStringNames *CoreStringNames::singleton = NULL;
-CoreStringNames::CoreStringNames() {
-
- _free = StaticCString::create("free");
- changed = StaticCString::create("changed");
- _meta = StaticCString::create("__meta__");
- _script = StaticCString::create("script");
- script_changed = StaticCString::create("script_changed");
- ___pdcdata = StaticCString::create("___pdcdata");
- __getvar = StaticCString::create("__getvar");
- _iter_init = StaticCString::create("_iter_init");
- _iter_next = StaticCString::create("_iter_next");
- _iter_get = StaticCString::create("_iter_get");
- get_rid = StaticCString::create("get_rid");
+CoreStringNames::CoreStringNames()
+ : _free(StaticCString::create("free")),
+ changed(StaticCString::create("changed")),
+ _meta(StaticCString::create("__meta__")),
+ _script(StaticCString::create("script")),
+ script_changed(StaticCString::create("script_changed")),
+ ___pdcdata(StaticCString::create("___pdcdata")),
+ __getvar(StaticCString::create("__getvar")),
+ _iter_init(StaticCString::create("_iter_init")),
+ _iter_next(StaticCString::create("_iter_next")),
+ _iter_get(StaticCString::create("_iter_get")),
+ get_rid(StaticCString::create("get_rid")),
+#ifdef TOOLS_ENABLED
+ _sections_unfolded(StaticCString::create("_sections_unfolded")),
+#endif
+ _custom_features(StaticCString::create("_custom_features")) {
}
diff --git a/core/core_string_names.h b/core/core_string_names.h
index f6542be290..40f76aa9c0 100644
--- a/core/core_string_names.h
+++ b/core/core_string_names.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -60,6 +61,10 @@ public:
StringName _iter_next;
StringName _iter_get;
StringName get_rid;
+#ifdef TOOLS_ENABLED
+ StringName _sections_unfolded;
+#endif
+ StringName _custom_features;
};
#endif // SCENE_STRING_NAMES_H
diff --git a/core/dictionary.cpp b/core/dictionary.cpp
index 3663bb1a4f..1fe45aff94 100644
--- a/core/dictionary.cpp
+++ b/core/dictionary.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -199,6 +200,7 @@ uint32_t Dictionary::hash() const {
Array Dictionary::keys() const {
+#if 0
Array karr;
karr.resize(size());
const Variant *K = NULL;
@@ -207,6 +209,26 @@ Array Dictionary::keys() const {
karr[idx++] = (*K);
}
return karr;
+#else
+
+ Array varr;
+ varr.resize(size());
+ if (_p->variant_map.empty())
+ return varr;
+
+ int count = _p->variant_map.size();
+ const HashMap<Variant, DictionaryPrivate::Data, _DictionaryVariantHash>::Pair **pairs = (const HashMap<Variant, DictionaryPrivate::Data, _DictionaryVariantHash>::Pair **)alloca(count * sizeof(HashMap<Variant, DictionaryPrivate::Data, _DictionaryVariantHash>::Pair *));
+ _p->variant_map.get_key_value_ptr_array(pairs);
+
+ SortArray<const HashMap<Variant, DictionaryPrivate::Data, _DictionaryVariantHash>::Pair *, DictionaryPrivateSort> sort;
+ sort.sort(pairs, count);
+
+ for (int i = 0; i < count; i++) {
+ varr[i] = pairs[i]->key;
+ }
+
+ return varr;
+#endif
}
Array Dictionary::values() const {
diff --git a/core/dictionary.h b/core/dictionary.h
index 588e33a95f..27caba916f 100644
--- a/core/dictionary.h
+++ b/core/dictionary.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/dvector.cpp b/core/dvector.cpp
index 5930a1220b..4bbe1aafd9 100644
--- a/core/dvector.cpp
+++ b/core/dvector.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/dvector.h b/core/dvector.h
index 3f4318216d..66af42f7e2 100644
--- a/core/dvector.h
+++ b/core/dvector.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -91,6 +92,7 @@ class PoolVector {
// ERR_FAIL_COND(alloc->lock>0); should not be illegal to lock this for copy on write, as it's a copy on write after all
+ // Refcount should not be zero, otherwise it's a misuse of COW
if (alloc->refcount.get() == 1)
return; //nothing to do
@@ -215,7 +217,12 @@ class PoolVector {
{
int cur_elements = alloc->size / sizeof(T);
- Write w = write();
+
+ // Don't use write() here because it could otherwise provoke COW,
+ // which is not desirable here because we are destroying the last reference anyways
+ Write w;
+ // Reference to still prevent other threads from touching the alloc
+ w._ref(alloc);
for (int i = 0; i < cur_elements; i++) {
@@ -402,14 +409,9 @@ public:
if (p_to < 0) {
p_to = size() + p_to;
}
- if (p_from < 0 || p_from >= size()) {
- PoolVector<T> &aux = *((PoolVector<T> *)0); // nullreturn
- ERR_FAIL_COND_V(p_from < 0 || p_from >= size(), aux)
- }
- if (p_to < 0 || p_to >= size()) {
- PoolVector<T> &aux = *((PoolVector<T> *)0); // nullreturn
- ERR_FAIL_COND_V(p_to < 0 || p_to >= size(), aux)
- }
+
+ CRASH_BAD_INDEX(p_from, size());
+ CRASH_BAD_INDEX(p_to, size());
PoolVector<T> slice;
int span = 1 + p_to - p_from;
@@ -499,13 +501,9 @@ void PoolVector<T>::push_back(const T &p_val) {
template <class T>
const T PoolVector<T>::operator[](int p_index) const {
- if (p_index < 0 || p_index >= size()) {
- T &aux = *((T *)0); //nullreturn
- ERR_FAIL_COND_V(p_index < 0 || p_index >= size(), aux);
- }
+ CRASH_BAD_INDEX(p_index, size());
Read r = read();
-
return r[p_index];
}
diff --git a/core/engine.cpp b/core/engine.cpp
index 1e46117bd6..c16a2903d3 100644
--- a/core/engine.cpp
+++ b/core/engine.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,7 @@
#include "engine.h"
#include "version.h"
+#include "version_hash.gen.h"
void Engine::set_iterations_per_second(int p_ips) {
@@ -86,6 +88,9 @@ Dictionary Engine::get_version_info() const {
dict["revision"] = _MKSTR(VERSION_REVISION);
dict["year"] = VERSION_YEAR;
+ String hash = String(VERSION_HASH);
+ dict["hash"] = hash.length() == 0 ? String("unknown") : hash;
+
String stringver = String(dict["major"]) + "." + String(dict["minor"]);
if ((int)dict["patch"] != 0)
stringver += "." + String(dict["patch"]);
@@ -114,4 +119,6 @@ Engine::Engine() {
_fixed_frames = 0;
_idle_frames = 0;
_in_fixed = false;
+ _frame_ticks = 0;
+ _frame_step = 0;
}
diff --git a/core/engine.h b/core/engine.h
index 346e9538d6..16dfb77593 100644
--- a/core/engine.h
+++ b/core/engine.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,6 +42,8 @@ class Engine {
String _custom_level;
uint64_t frames_drawn;
uint32_t _frame_delay;
+ uint64_t _frame_ticks;
+ float _frame_step;
int ips;
float _fps;
@@ -71,6 +74,8 @@ public:
uint64_t get_fixed_frames() const { return _fixed_frames; }
uint64_t get_idle_frames() const { return _idle_frames; }
bool is_in_fixed_frame() const { return _in_fixed; }
+ uint64_t get_idle_frame_ticks() const { return _frame_ticks; }
+ float get_idle_frame_step() const { return _frame_step; }
void set_time_scale(float p_scale);
float get_time_scale() const;
diff --git a/core/error_list.h b/core/error_list.h
index 7e4249886b..14ef7bbc18 100644
--- a/core/error_list.h
+++ b/core/error_list.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/error_macros.cpp b/core/error_macros.cpp
index 530e209dd8..afbff6c52d 100644
--- a/core/error_macros.cpp
+++ b/core/error_macros.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/error_macros.h b/core/error_macros.h
index 02a15de067..6c803951a1 100644
--- a/core/error_macros.h
+++ b/core/error_macros.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -114,6 +115,19 @@ extern bool _err_error_exists;
#define FUNCTION_STR __FUNCTION__
#endif
+// Don't use this directly; instead, use any of the CRASH_* macros
+#ifdef _MSC_VER
+#define GENERATE_TRAP \
+ __debugbreak(); \
+ /* Avoid warning about control paths */ \
+ for (;;) { \
+ }
+#else
+#define GENERATE_TRAP __builtin_trap();
+#endif
+
+// (*): See https://stackoverflow.com/questions/257418/do-while-0-what-is-it-good-for
+
#define ERR_FAIL_INDEX(m_index, m_size) \
do { \
if ((m_index) < 0 || (m_index) >= (m_size)) { \
@@ -121,12 +135,12 @@ extern bool _err_error_exists;
return; \
} else \
_err_error_exists = false; \
- } while (0);
+ } while (0); // (*)
/** An index has failed if m_index<0 or m_index >=m_size, the function exists.
- * This function returns an error value, if returning Error, please select the most
- * appropriate error condition from error_macros.h
- */
+* This function returns an error value, if returning Error, please select the most
+* appropriate error condition from error_macros.h
+*/
#define ERR_FAIL_INDEX_V(m_index, m_size, m_retval) \
do { \
@@ -135,7 +149,18 @@ extern bool _err_error_exists;
return m_retval; \
} else \
_err_error_exists = false; \
- } while (0);
+ } while (0); // (*)
+
+/** Use this one if there is no sensible fallback, that is, the error is unrecoverable.
+* We'll return a null reference and try to keep running.
+*/
+#define CRASH_BAD_INDEX(m_index, m_size) \
+ do { \
+ if ((m_index) < 0 || (m_index) >= (m_size)) { \
+ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "FATAL: Index " _STR(m_index) " out of size (" _STR(m_size) ")."); \
+ GENERATE_TRAP \
+ } \
+ } while (0); // (*)
/** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert().
* the function will exit.
@@ -172,6 +197,17 @@ extern bool _err_error_exists;
_err_error_exists = false; \
}
+/** Use this one if there is no sensible fallback, that is, the error is unrecoverable.
+ */
+
+#define CRASH_COND(m_cond) \
+ { \
+ if (m_cond) { \
+ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "FATAL: Condition ' " _STR(m_cond) " ' is true."); \
+ GENERATE_TRAP \
+ } \
+ }
+
/** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert().
* the function will exit.
* This function returns an error value, if returning Error, please select the most
@@ -233,6 +269,15 @@ extern bool _err_error_exists;
return m_value; \
}
+/** Use this one if there is no sensible fallback, that is, the error is unrecoverable.
+ */
+
+#define CRASH_NOW() \
+ { \
+ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "FATAL: Method/Function Failed."); \
+ GENERATE_TRAP \
+ }
+
/** Print an error string.
*/
diff --git a/core/event_queue.cpp b/core/event_queue.cpp
index f9ebc82e40..c5257d5f6b 100644
--- a/core/event_queue.cpp
+++ b/core/event_queue.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/event_queue.h b/core/event_queue.h
index 8e35445b68..a6c436909d 100644
--- a/core/event_queue.h
+++ b/core/event_queue.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/func_ref.cpp b/core/func_ref.cpp
index 1589be996e..5622a03665 100644
--- a/core/func_ref.cpp
+++ b/core/func_ref.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -47,7 +48,7 @@ Variant FuncRef::call_func(const Variant **p_args, int p_argcount, Variant::Call
void FuncRef::set_instance(Object *p_obj) {
ERR_FAIL_NULL(p_obj);
- id = p_obj->get_instance_ID();
+ id = p_obj->get_instance_id();
}
void FuncRef::set_function(const StringName &p_func) {
@@ -60,7 +61,7 @@ void FuncRef::_bind_methods() {
MethodInfo mi;
mi.name = "call_func";
Vector<Variant> defargs;
- ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_func:Variant", &FuncRef::call_func, mi, defargs);
+ ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_func", &FuncRef::call_func, mi, defargs);
}
ClassDB::bind_method(D_METHOD("set_instance", "instance"), &FuncRef::set_instance);
diff --git a/core/func_ref.h b/core/func_ref.h
index 1179c98e29..e60d5bd771 100644
--- a/core/func_ref.h
+++ b/core/func_ref.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/global_constants.cpp b/core/global_constants.cpp
index 02655993a4..9e745ecb98 100644
--- a/core/global_constants.cpp
+++ b/core/global_constants.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,7 @@
#include "global_constants.h"
#include "object.h"
+#include "os/input_event.h"
#include "os/keyboard.h"
#include "variant.h"
@@ -65,8 +67,8 @@ static _GlobalConstant _global_constants[] = {
BIND_GLOBAL_CONSTANT(KEY_TAB),
BIND_GLOBAL_CONSTANT(KEY_BACKTAB),
BIND_GLOBAL_CONSTANT(KEY_BACKSPACE),
- BIND_GLOBAL_CONSTANT(KEY_RETURN),
BIND_GLOBAL_CONSTANT(KEY_ENTER),
+ BIND_GLOBAL_CONSTANT(KEY_KP_ENTER),
BIND_GLOBAL_CONSTANT(KEY_INSERT),
BIND_GLOBAL_CONSTANT(KEY_DELETE),
BIND_GLOBAL_CONSTANT(KEY_PAUSE),
@@ -104,7 +106,6 @@ static _GlobalConstant _global_constants[] = {
BIND_GLOBAL_CONSTANT(KEY_F14),
BIND_GLOBAL_CONSTANT(KEY_F15),
BIND_GLOBAL_CONSTANT(KEY_F16),
- BIND_GLOBAL_CONSTANT(KEY_KP_ENTER),
BIND_GLOBAL_CONSTANT(KEY_KP_MULTIPLY),
BIND_GLOBAL_CONSTANT(KEY_KP_DIVIDE),
BIND_GLOBAL_CONSTANT(KEY_KP_SUBTRACT),
@@ -505,22 +506,20 @@ static _GlobalConstant _global_constants[] = {
{ "TYPE_TRANSFORM2D", Variant::TRANSFORM2D },
{ "TYPE_PLANE", Variant::PLANE },
{ "TYPE_QUAT", Variant::QUAT }, // 10
- { "TYPE_RECT3", Variant::RECT3 }, //sorry naming convention fail :( not like it's used often
+ { "TYPE_RECT3", Variant::RECT3 },
{ "TYPE_BASIS", Variant::BASIS },
{ "TYPE_TRANSFORM", Variant::TRANSFORM },
{ "TYPE_COLOR", Variant::COLOR },
- { "TYPE_IMAGE", Variant::IMAGE }, // 15
- { "TYPE_NODE_PATH", Variant::NODE_PATH },
+ { "TYPE_NODE_PATH", Variant::NODE_PATH }, // 15
{ "TYPE_RID", Variant::_RID },
{ "TYPE_OBJECT", Variant::OBJECT },
- { "TYPE_INPUT_EVENT", Variant::INPUT_EVENT },
{ "TYPE_DICTIONARY", Variant::DICTIONARY }, // 20
{ "TYPE_ARRAY", Variant::ARRAY },
{ "TYPE_RAW_ARRAY", Variant::POOL_BYTE_ARRAY },
{ "TYPE_INT_ARRAY", Variant::POOL_INT_ARRAY },
{ "TYPE_REAL_ARRAY", Variant::POOL_REAL_ARRAY },
- { "TYPE_STRING_ARRAY", Variant::POOL_STRING_ARRAY }, // 25
- { "TYPE_VECTOR2_ARRAY", Variant::POOL_VECTOR2_ARRAY },
+ { "TYPE_STRING_ARRAY", Variant::POOL_STRING_ARRAY },
+ { "TYPE_VECTOR2_ARRAY", Variant::POOL_VECTOR2_ARRAY }, // 25
{ "TYPE_VECTOR3_ARRAY", Variant::POOL_VECTOR3_ARRAY },
{ "TYPE_COLOR_ARRAY", Variant::POOL_COLOR_ARRAY },
{ "TYPE_MAX", Variant::VARIANT_MAX },
diff --git a/core/global_constants.h b/core/global_constants.h
index 8823ebf3b0..f298fc31c7 100644
--- a/core/global_constants.h
+++ b/core/global_constants.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/hash_map.h b/core/hash_map.h
index 86646b825c..2d7249e2fc 100644
--- a/core/hash_map.h
+++ b/core/hash_map.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -95,9 +96,9 @@ public:
TData data;
Pair() {}
- Pair(const TKey &p_key, const TData &p_data) {
- key = p_key;
- data = p_data;
+ Pair(const TKey &p_key, const TData &p_data)
+ : key(p_key),
+ data(p_data) {
}
};
@@ -472,8 +473,7 @@ public:
if (!e) {
e = create_entry(p_key);
- if (!e)
- return *(TData *)NULL; /* panic! */
+ CRASH_COND(!e);
check_hash_table(); // perform mantenience routine
}
diff --git a/core/hashfuncs.h b/core/hashfuncs.h
index aff6772d68..8392984565 100644
--- a/core/hashfuncs.h
+++ b/core/hashfuncs.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -80,24 +81,6 @@ static inline uint32_t hash_one_uint64(const uint64_t p_int) {
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;
-
- // 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;
diff --git a/core/helper/math_fieldwise.cpp b/core/helper/math_fieldwise.cpp
index 377a3f8234..5545c2d642 100644
--- a/core/helper/math_fieldwise.cpp
+++ b/core/helper/math_fieldwise.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -62,8 +63,8 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const
SETUP_TYPE(Rect2)
- /**/ TRY_TRANSFER_FIELD("x", pos.x)
- else TRY_TRANSFER_FIELD("y", pos.y)
+ /**/ TRY_TRANSFER_FIELD("x", position.x)
+ else TRY_TRANSFER_FIELD("y", position.y)
else TRY_TRANSFER_FIELD("w", size.x)
else TRY_TRANSFER_FIELD("h", size.y)
@@ -109,9 +110,9 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const
SETUP_TYPE(Rect3)
- /**/ TRY_TRANSFER_FIELD("px", pos.x)
- else TRY_TRANSFER_FIELD("py", pos.y)
- else TRY_TRANSFER_FIELD("pz", pos.z)
+ /**/ TRY_TRANSFER_FIELD("px", position.x)
+ else TRY_TRANSFER_FIELD("py", position.y)
+ else TRY_TRANSFER_FIELD("pz", position.z)
else TRY_TRANSFER_FIELD("sx", size.x)
else TRY_TRANSFER_FIELD("sy", size.y)
else TRY_TRANSFER_FIELD("sz", size.z)
diff --git a/core/helper/math_fieldwise.h b/core/helper/math_fieldwise.h
index e73227f148..58489fd3bb 100644
--- a/core/helper/math_fieldwise.h
+++ b/core/helper/math_fieldwise.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/helper/value_evaluator.h b/core/helper/value_evaluator.h
index e001e1646a..e32697ca95 100644
--- a/core/helper/value_evaluator.h
+++ b/core/helper/value_evaluator.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/image.cpp b/core/image.cpp
index 649a51c174..2db9cb1571 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,9 +32,10 @@
#include "core/io/image_loader.h"
#include "core/os/copymem.h"
#include "hash_map.h"
-#include "hq2x.h"
#include "print_string.h"
+#include "thirdparty/misc/hq2x.h"
+
#include <stdio.h>
const char *Image::format_names[Image::FORMAT_MAX] = {
@@ -43,7 +45,6 @@ const char *Image::format_names[Image::FORMAT_MAX] = {
"RedGreen",
"RGB8",
"RGBA8",
- "RGB565", //16 bit
"RGBA4444",
"RGBA5551",
"RFloat", //float
@@ -54,11 +55,12 @@ const char *Image::format_names[Image::FORMAT_MAX] = {
"RGHalf",
"RGBHalf",
"RGBAHalf",
- "DXT1", //s3tc
- "DXT3",
- "DXT5",
- "ATI1",
- "ATI2",
+ "RGBE9995",
+ "DXT1 RGB8", //s3tc
+ "DXT3 RGBA8",
+ "DXT5 RGBA8",
+ "RGTC Red8",
+ "RGTC RedGreen8",
"BPTC_RGBA",
"BPTC_RGBF",
"BPTC_RGBFU",
@@ -79,21 +81,21 @@ const char *Image::format_names[Image::FORMAT_MAX] = {
SavePNGFunc Image::save_png_func = NULL;
-void Image::_put_pixelb(int p_x, int p_y, uint32_t p_pixelsize, uint8_t *p_dst, const uint8_t *p_src) {
+void Image::_put_pixelb(int p_x, int p_y, uint32_t p_pixelsize, uint8_t *p_data, const uint8_t *p_pixel) {
uint32_t ofs = (p_y * width + p_x) * p_pixelsize;
for (uint32_t i = 0; i < p_pixelsize; i++) {
- p_dst[ofs + i] = p_src[i];
+ p_data[ofs + i] = p_pixel[i];
}
}
-void Image::_get_pixelb(int p_x, int p_y, uint32_t p_pixelsize, const uint8_t *p_src, uint8_t *p_dst) {
+void Image::_get_pixelb(int p_x, int p_y, uint32_t p_pixelsize, const uint8_t *p_data, uint8_t *p_pixel) {
uint32_t ofs = (p_y * width + p_x) * p_pixelsize;
for (uint32_t i = 0; i < p_pixelsize; i++) {
- p_dst[ofs] = p_src[ofs + i];
+ p_pixel[i] = p_data[ofs + i];
}
}
@@ -108,8 +110,6 @@ int Image::get_format_pixel_size(Format p_format) {
case FORMAT_RG8: return 2;
case FORMAT_RGB8: return 3;
case FORMAT_RGBA8: return 4;
- case FORMAT_RGB565:
- return 2; //16 bit
case FORMAT_RGBA4444: return 2;
case FORMAT_RGBA5551: return 2;
case FORMAT_RF:
@@ -120,17 +120,18 @@ int Image::get_format_pixel_size(Format p_format) {
case FORMAT_RH:
return 2; //half float
case FORMAT_RGH: return 4;
- case FORMAT_RGBH: return 8;
- case FORMAT_RGBAH: return 12;
+ case FORMAT_RGBH: return 6;
+ case FORMAT_RGBAH: return 8;
+ case FORMAT_RGBE9995: return 4;
case FORMAT_DXT1:
return 1; //s3tc bc1
case FORMAT_DXT3:
return 1; //bc2
case FORMAT_DXT5:
return 1; //bc3
- case FORMAT_ATI1:
+ case FORMAT_RGTC_R:
return 1; //bc4
- case FORMAT_ATI2:
+ case FORMAT_RGTC_RG:
return 1; //bc5
case FORMAT_BPTC_RGBA:
return 1; //btpc bc6h
@@ -166,8 +167,8 @@ void Image::get_format_min_pixel_size(Format p_format, int &r_w, int &r_h) {
case FORMAT_DXT1: //s3tc bc1
case FORMAT_DXT3: //bc2
case FORMAT_DXT5: //bc3
- case FORMAT_ATI1: //bc4
- case FORMAT_ATI2: { //bc5 case case FORMAT_DXT1:
+ case FORMAT_RGTC_R: //bc4
+ case FORMAT_RGTC_RG: { //bc5 case case FORMAT_DXT1:
r_w = 4;
r_h = 4;
@@ -218,7 +219,7 @@ void Image::get_format_min_pixel_size(Format p_format, int &r_w, int &r_h) {
int Image::get_format_pixel_rshift(Format p_format) {
- if (p_format == FORMAT_DXT1 || p_format == FORMAT_ATI1 || p_format == FORMAT_PVRTC4 || p_format == FORMAT_PVRTC4A || p_format == FORMAT_ETC || p_format == FORMAT_ETC2_R11 || p_format == FORMAT_ETC2_R11S || p_format == FORMAT_ETC2_RGB8 || p_format == FORMAT_ETC2_RGB8A1)
+ if (p_format == FORMAT_DXT1 || p_format == FORMAT_RGTC_R || p_format == FORMAT_PVRTC4 || p_format == FORMAT_PVRTC4A || p_format == FORMAT_ETC || p_format == FORMAT_ETC2_R11 || p_format == FORMAT_ETC2_R11S || p_format == FORMAT_ETC2_RGB8 || p_format == FORMAT_ETC2_RGB8A1)
return 1;
else if (p_format == FORMAT_PVRTC2 || p_format == FORMAT_PVRTC2A)
return 2;
@@ -226,6 +227,54 @@ int Image::get_format_pixel_rshift(Format p_format) {
return 0;
}
+int Image::get_format_block_size(Format p_format) {
+
+ switch (p_format) {
+ case FORMAT_DXT1: //s3tc bc1
+ case FORMAT_DXT3: //bc2
+ case FORMAT_DXT5: //bc3
+ case FORMAT_RGTC_R: //bc4
+ case FORMAT_RGTC_RG: { //bc5 case case FORMAT_DXT1:
+
+ return 4;
+ } break;
+ case FORMAT_PVRTC2:
+ case FORMAT_PVRTC2A: {
+
+ return 4;
+ } break;
+ case FORMAT_PVRTC4A:
+ case FORMAT_PVRTC4: {
+
+ return 4;
+ } break;
+ case FORMAT_ETC: {
+
+ return 4;
+ } break;
+ case FORMAT_BPTC_RGBA:
+ case FORMAT_BPTC_RGBF:
+ case FORMAT_BPTC_RGBFU: {
+
+ return 4;
+ } break;
+ case FORMAT_ETC2_R11: //etc2
+ case FORMAT_ETC2_R11S: //signed: NOT srgb.
+ case FORMAT_ETC2_RG11:
+ case FORMAT_ETC2_RG11S:
+ case FORMAT_ETC2_RGB8:
+ case FORMAT_ETC2_RGBA8:
+ case FORMAT_ETC2_RGB8A1: {
+
+ return 4;
+ } break;
+ default: {
+ }
+ }
+
+ return 1;
+}
+
void Image::_get_mipmap_offset_and_size(int p_mipmap, int &r_offset, int &r_width, int &r_height) const {
int w = width;
@@ -234,11 +283,16 @@ void Image::_get_mipmap_offset_and_size(int p_mipmap, int &r_offset, int &r_widt
int pixel_size = get_format_pixel_size(format);
int pixel_rshift = get_format_pixel_rshift(format);
+ int block = get_format_block_size(format);
int minw, minh;
get_format_min_pixel_size(format, minw, minh);
for (int i = 0; i < p_mipmap; i++) {
- int s = w * h;
+ int bw = w % block != 0 ? w + (block - w % block) : w;
+ int bh = h % block != 0 ? h + (block - h % block) : h;
+
+ int s = bw * bh;
+
s *= pixel_size;
s >>= pixel_rshift;
ofs += s;
@@ -354,10 +408,35 @@ void Image::convert(Format p_new_format) {
if (p_new_format == format)
return;
- if (format >= FORMAT_RGB565 || p_new_format >= FORMAT_RGB565) {
+ if (format > FORMAT_RGBE9995 || p_new_format > FORMAT_RGBE9995) {
- ERR_EXPLAIN("Cannot convert to <-> from non byte formats.");
+ ERR_EXPLAIN("Cannot convert to <-> from compressed formats. Use compress() and decompress() instead.");
ERR_FAIL();
+
+ } else if (format > FORMAT_RGBA8 || p_new_format > FORMAT_RGBA8) {
+
+ //use put/set pixel which is slower but works with non byte formats
+ Image new_img(width, height, 0, p_new_format);
+ lock();
+ new_img.lock();
+
+ for (int i = 0; i < width; i++) {
+ for (int j = 0; j < height; j++) {
+
+ new_img.set_pixel(i, j, get_pixel(i, j));
+ }
+ }
+
+ unlock();
+ new_img.unlock();
+
+ if (has_mipmaps()) {
+ new_img.generate_mipmaps();
+ }
+
+ _copy_internals_from(new_img);
+
+ return;
}
Image new_img(width, height, 0, p_new_format);
@@ -413,7 +492,7 @@ void Image::convert(Format p_new_format) {
//mipmaps=false;
- *this = new_img;
+ _copy_internals_from(new_img);
if (gen_mipmaps)
generate_mipmaps();
@@ -609,14 +688,6 @@ void Image::resize_to_po2(bool p_square) {
resize(w, h);
}
-Image Image::resized(int p_width, int p_height, int p_interpolation) {
-
- Image ret = *this;
- ret.resize(p_width, p_height, (Interpolation)p_interpolation);
-
- return ret;
-};
-
void Image::resize(int p_width, int p_height, Interpolation p_interpolation) {
if (!_can_modify(format)) {
@@ -679,7 +750,7 @@ void Image::resize(int p_width, int p_height, Interpolation p_interpolation) {
if (mipmaps > 0)
dst.generate_mipmaps();
- *this = dst;
+ _copy_internals_from(dst);
}
void Image::crop(int p_width, int p_height) {
@@ -726,7 +797,7 @@ void Image::crop(int p_width, int p_height) {
if (mipmaps > 0)
dst.generate_mipmaps();
- *this = dst;
+ _copy_internals_from(dst);
}
void Image::flip_y() {
@@ -747,7 +818,7 @@ void Image::flip_y() {
uint8_t down[16];
uint32_t pixel_size = get_format_pixel_size(format);
- for (int y = 0; y < height; y++) {
+ for (int y = 0; y < height / 2; y++) {
for (int x = 0; x < width; x++) {
@@ -783,7 +854,7 @@ void Image::flip_x() {
for (int y = 0; y < height; y++) {
- for (int x = 0; x < width; x++) {
+ for (int x = 0; x < width / 2; x++) {
_get_pixelb(x, y, pixel_size, w.ptr(), up);
_get_pixelb(width - x - 1, y, pixel_size, w.ptr(), down);
@@ -807,12 +878,17 @@ int Image::_get_dst_image_size(int p_width, int p_height, Format p_format, int &
int pixsize = get_format_pixel_size(p_format);
int pixshift = get_format_pixel_rshift(p_format);
+ int block = get_format_block_size(p_format);
int minw, minh;
get_format_min_pixel_size(p_format, minw, minh);
while (true) {
- int s = w * h;
+ int bw = w % block != 0 ? w + (block - w % block) : w;
+ int bh = h % block != 0 ? h + (block - h % block) : h;
+
+ int s = bw * bh;
+
s *= pixsize;
s >>= pixshift;
@@ -840,7 +916,7 @@ int Image::_get_dst_image_size(int p_width, int p_height, Format p_format, int &
bool Image::_can_modify(Format p_format) const {
- return p_format < FORMAT_RGB565;
+ return p_format <= FORMAT_RGBE9995;
}
template <int CC>
@@ -1249,19 +1325,19 @@ void Image::create(const char **p_xpm) {
line++;
}
}
-#define DETECT_ALPHA_MAX_TRESHOLD 254
-#define DETECT_ALPHA_MIN_TRESHOLD 2
-
-#define DETECT_ALPHA(m_value) \
- { \
- uint8_t value = m_value; \
- if (value < DETECT_ALPHA_MIN_TRESHOLD) \
- bit = true; \
- else if (value < DETECT_ALPHA_MAX_TRESHOLD) { \
- \
- detected = true; \
- break; \
- } \
+#define DETECT_ALPHA_MAX_THRESHOLD 254
+#define DETECT_ALPHA_MIN_THRESHOLD 2
+
+#define DETECT_ALPHA(m_value) \
+ { \
+ uint8_t value = m_value; \
+ if (value < DETECT_ALPHA_MIN_THRESHOLD) \
+ bit = true; \
+ else if (value < DETECT_ALPHA_MAX_THRESHOLD) { \
+ \
+ detected = true; \
+ break; \
+ } \
}
#define DETECT_NON_ALPHA(m_value) \
@@ -1376,22 +1452,12 @@ Error Image::load(const String &p_path) {
return ImageLoader::load_image(p_path, this);
}
-Error Image::save_png(const String &p_path) {
+Error Image::save_png(const String &p_path) const {
if (save_png_func == NULL)
return ERR_UNAVAILABLE;
- return save_png_func(p_path, *this);
-}
-
-bool Image::operator==(const Image &p_image) const {
-
- if (data.size() == 0 && p_image.data.size() == 0)
- return true;
- PoolVector<uint8_t>::Read r = data.read();
- PoolVector<uint8_t>::Read pr = p_image.data.read();
-
- return r.ptr() == pr.ptr();
+ return save_png_func(p_path, Ref<Image>((Image *)this));
}
int Image::get_image_data_size(int p_width, int p_height, Format p_format, int p_mipmaps) {
@@ -1407,368 +1473,33 @@ int Image::get_image_required_mipmaps(int p_width, int p_height, Format p_format
return mm;
}
-Error Image::_decompress_bc() {
-
- int wd = width, ht = height;
- if (wd % 4 != 0) {
- wd += 4 - (wd % 4);
- }
- if (ht % 4 != 0) {
- ht += 4 - (ht % 4);
- }
-
- int mm;
- int size = _get_dst_image_size(wd, ht, FORMAT_RGBA8, mm);
-
- PoolVector<uint8_t> newdata;
- newdata.resize(size);
-
- PoolVector<uint8_t>::Write w = newdata.write();
- PoolVector<uint8_t>::Read r = data.read();
-
- int rofs = 0;
- int wofs = 0;
-
- //print_line("width: "+itos(wd)+" height: "+itos(ht));
-
- for (int i = 0; i <= mm; i++) {
-
- switch (format) {
-
- case FORMAT_DXT1: {
-
- int len = (wd * ht) / 16;
- uint8_t *dst = &w[wofs];
-
- uint32_t ofs_table[16];
- for (int x = 0; x < 4; x++) {
-
- for (int y = 0; y < 4; y++) {
-
- ofs_table[15 - (y * 4 + (3 - x))] = (x + y * wd) * 4;
- }
- }
-
- for (int j = 0; j < len; j++) {
-
- const uint8_t *src = &r[rofs + j * 8];
- uint16_t col_a = src[1];
- col_a <<= 8;
- col_a |= src[0];
- uint16_t col_b = src[3];
- col_b <<= 8;
- col_b |= src[2];
-
- uint8_t table[4][4] = {
- { uint8_t((col_a >> 11) << 3), uint8_t(((col_a >> 5) & 0x3f) << 2), uint8_t(((col_a)&0x1f) << 3), 255 },
- { uint8_t((col_b >> 11) << 3), uint8_t(((col_b >> 5) & 0x3f) << 2), uint8_t(((col_b)&0x1f) << 3), 255 },
- { 0, 0, 0, 255 },
- { 0, 0, 0, 255 }
- };
-
- if (col_a < col_b) {
- //punchrough
- table[2][0] = (int(table[0][0]) + int(table[1][0])) >> 1;
- table[2][1] = (int(table[0][1]) + int(table[1][1])) >> 1;
- table[2][2] = (int(table[0][2]) + int(table[1][2])) >> 1;
- table[3][3] = 0; //premul alpha black
- } else {
- //gradient
- table[2][0] = (int(table[0][0]) * 2 + int(table[1][0])) / 3;
- table[2][1] = (int(table[0][1]) * 2 + int(table[1][1])) / 3;
- table[2][2] = (int(table[0][2]) * 2 + int(table[1][2])) / 3;
- table[3][0] = (int(table[0][0]) + int(table[1][0]) * 2) / 3;
- table[3][1] = (int(table[0][1]) + int(table[1][1]) * 2) / 3;
- table[3][2] = (int(table[0][2]) + int(table[1][2]) * 2) / 3;
- }
-
- uint32_t block = src[4];
- block <<= 8;
- block |= src[5];
- block <<= 8;
- block |= src[6];
- block <<= 8;
- block |= src[7];
-
- int y = (j / (wd / 4)) * 4;
- int x = (j % (wd / 4)) * 4;
- int pixofs = (y * wd + x) * 4;
-
- for (int k = 0; k < 16; k++) {
- int idx = pixofs + ofs_table[k];
- dst[idx + 0] = table[block & 0x3][0];
- dst[idx + 1] = table[block & 0x3][1];
- dst[idx + 2] = table[block & 0x3][2];
- dst[idx + 3] = table[block & 0x3][3];
- block >>= 2;
- }
- }
-
- rofs += len * 8;
- wofs += wd * ht * 4;
-
- wd /= 2;
- ht /= 2;
-
- } break;
- case FORMAT_DXT3: {
-
- int len = (wd * ht) / 16;
- uint8_t *dst = &w[wofs];
-
- uint32_t ofs_table[16];
- for (int x = 0; x < 4; x++) {
-
- for (int y = 0; y < 4; y++) {
-
- ofs_table[15 - (y * 4 + (3 - x))] = (x + y * wd) * 4;
- }
- }
-
- for (int j = 0; j < len; j++) {
-
- const uint8_t *src = &r[rofs + j * 16];
-
- uint64_t ablock = src[1];
- ablock <<= 8;
- ablock |= src[0];
- ablock <<= 8;
- ablock |= src[3];
- ablock <<= 8;
- ablock |= src[2];
- ablock <<= 8;
- ablock |= src[5];
- ablock <<= 8;
- ablock |= src[4];
- ablock <<= 8;
- ablock |= src[7];
- ablock <<= 8;
- ablock |= src[6];
-
- uint16_t col_a = src[8 + 1];
- col_a <<= 8;
- col_a |= src[8 + 0];
- uint16_t col_b = src[8 + 3];
- col_b <<= 8;
- col_b |= src[8 + 2];
-
- uint8_t table[4][4] = {
- { uint8_t((col_a >> 11) << 3), uint8_t(((col_a >> 5) & 0x3f) << 2), uint8_t(((col_a)&0x1f) << 3), 255 },
- { uint8_t((col_b >> 11) << 3), uint8_t(((col_b >> 5) & 0x3f) << 2), uint8_t(((col_b)&0x1f) << 3), 255 },
-
- { 0, 0, 0, 255 },
- { 0, 0, 0, 255 }
- };
-
- //always gradient
- table[2][0] = (int(table[0][0]) * 2 + int(table[1][0])) / 3;
- table[2][1] = (int(table[0][1]) * 2 + int(table[1][1])) / 3;
- table[2][2] = (int(table[0][2]) * 2 + int(table[1][2])) / 3;
- table[3][0] = (int(table[0][0]) + int(table[1][0]) * 2) / 3;
- table[3][1] = (int(table[0][1]) + int(table[1][1]) * 2) / 3;
- table[3][2] = (int(table[0][2]) + int(table[1][2]) * 2) / 3;
-
- uint32_t block = src[4 + 8];
- block <<= 8;
- block |= src[5 + 8];
- block <<= 8;
- block |= src[6 + 8];
- block <<= 8;
- block |= src[7 + 8];
-
- int y = (j / (wd / 4)) * 4;
- int x = (j % (wd / 4)) * 4;
- int pixofs = (y * wd + x) * 4;
-
- for (int k = 0; k < 16; k++) {
- uint8_t alpha = ablock & 0xf;
- alpha = int(alpha) * 255 / 15; //right way for alpha
- int idx = pixofs + ofs_table[k];
- dst[idx + 0] = table[block & 0x3][0];
- dst[idx + 1] = table[block & 0x3][1];
- dst[idx + 2] = table[block & 0x3][2];
- dst[idx + 3] = alpha;
- block >>= 2;
- ablock >>= 4;
- }
- }
-
- rofs += len * 16;
- wofs += wd * ht * 4;
-
- wd /= 2;
- ht /= 2;
-
- } break;
- case FORMAT_DXT5: {
-
- int len = (wd * ht) / 16;
- uint8_t *dst = &w[wofs];
-
- uint32_t ofs_table[16];
- for (int x = 0; x < 4; x++) {
-
- for (int y = 0; y < 4; y++) {
-
- ofs_table[15 - (y * 4 + (3 - x))] = (x + y * wd) * 4;
- }
- }
-
- for (int j = 0; j < len; j++) {
-
- const uint8_t *src = &r[rofs + j * 16];
-
- uint8_t a_start = src[1];
- uint8_t a_end = src[0];
-
- uint64_t ablock = src[3];
- ablock <<= 8;
- ablock |= src[2];
- ablock <<= 8;
- ablock |= src[5];
- ablock <<= 8;
- ablock |= src[4];
- ablock <<= 8;
- ablock |= src[7];
- ablock <<= 8;
- ablock |= src[6];
-
- uint8_t atable[8];
-
- if (a_start > a_end) {
-
- atable[0] = (int(a_start) * 7 + int(a_end) * 0) / 7;
- atable[1] = (int(a_start) * 6 + int(a_end) * 1) / 7;
- atable[2] = (int(a_start) * 5 + int(a_end) * 2) / 7;
- atable[3] = (int(a_start) * 4 + int(a_end) * 3) / 7;
- atable[4] = (int(a_start) * 3 + int(a_end) * 4) / 7;
- atable[5] = (int(a_start) * 2 + int(a_end) * 5) / 7;
- atable[6] = (int(a_start) * 1 + int(a_end) * 6) / 7;
- atable[7] = (int(a_start) * 0 + int(a_end) * 7) / 7;
- } else {
-
- atable[0] = (int(a_start) * 5 + int(a_end) * 0) / 5;
- atable[1] = (int(a_start) * 4 + int(a_end) * 1) / 5;
- atable[2] = (int(a_start) * 3 + int(a_end) * 2) / 5;
- atable[3] = (int(a_start) * 2 + int(a_end) * 3) / 5;
- atable[4] = (int(a_start) * 1 + int(a_end) * 4) / 5;
- atable[5] = (int(a_start) * 0 + int(a_end) * 5) / 5;
- atable[6] = 0;
- atable[7] = 255;
- }
-
- uint16_t col_a = src[8 + 1];
- col_a <<= 8;
- col_a |= src[8 + 0];
- uint16_t col_b = src[8 + 3];
- col_b <<= 8;
- col_b |= src[8 + 2];
-
- uint8_t table[4][4] = {
- { uint8_t((col_a >> 11) << 3), uint8_t(((col_a >> 5) & 0x3f) << 2), uint8_t(((col_a)&0x1f) << 3), 255 },
- { uint8_t((col_b >> 11) << 3), uint8_t(((col_b >> 5) & 0x3f) << 2), uint8_t(((col_b)&0x1f) << 3), 255 },
-
- { 0, 0, 0, 255 },
- { 0, 0, 0, 255 }
- };
-
- //always gradient
- table[2][0] = (int(table[0][0]) * 2 + int(table[1][0])) / 3;
- table[2][1] = (int(table[0][1]) * 2 + int(table[1][1])) / 3;
- table[2][2] = (int(table[0][2]) * 2 + int(table[1][2])) / 3;
- table[3][0] = (int(table[0][0]) + int(table[1][0]) * 2) / 3;
- table[3][1] = (int(table[0][1]) + int(table[1][1]) * 2) / 3;
- table[3][2] = (int(table[0][2]) + int(table[1][2]) * 2) / 3;
-
- uint32_t block = src[4 + 8];
- block <<= 8;
- block |= src[5 + 8];
- block <<= 8;
- block |= src[6 + 8];
- block <<= 8;
- block |= src[7 + 8];
-
- int y = (j / (wd / 4)) * 4;
- int x = (j % (wd / 4)) * 4;
- int pixofs = (y * wd + x) * 4;
-
- for (int k = 0; k < 16; k++) {
- uint8_t alpha = ablock & 0x7;
- int idx = pixofs + ofs_table[k];
- dst[idx + 0] = table[block & 0x3][0];
- dst[idx + 1] = table[block & 0x3][1];
- dst[idx + 2] = table[block & 0x3][2];
- dst[idx + 3] = atable[alpha];
- block >>= 2;
- ablock >>= 3;
- }
- }
-
- rofs += len * 16;
- wofs += wd * ht * 4;
-
- wd /= 2;
- ht /= 2;
-
- } break;
- default: {}
- }
- }
-
- w = PoolVector<uint8_t>::Write();
- r = PoolVector<uint8_t>::Read();
-
- data = newdata;
- format = FORMAT_RGBA8;
- if (wd != width || ht != height) {
-
- SWAP(width, wd);
- SWAP(height, ht);
- crop(wd, ht);
- }
-
- return OK;
-}
-
bool Image::is_compressed() const {
- return format >= FORMAT_RGB565;
-}
-
-Image Image::decompressed() const {
-
- Image img = *this;
- img.decompress();
- return img;
+ return format > FORMAT_RGBE9995;
}
Error Image::decompress() {
- if (format >= FORMAT_DXT1 && format <= FORMAT_ATI2)
- _decompress_bc(); //_image_decompress_bc(this);
+ if (format >= FORMAT_DXT1 && format <= FORMAT_BPTC_RGBFU && _image_decompress_bc)
+ _image_decompress_bc(this);
else if (format >= FORMAT_PVRTC2 && format <= FORMAT_PVRTC4A && _image_decompress_pvrtc)
_image_decompress_pvrtc(this);
- else if (format == FORMAT_ETC && _image_decompress_etc)
- _image_decompress_etc(this);
- else if (format >= FORMAT_ETC2_R11 && format <= FORMAT_ETC2_RGB8A1 && _image_decompress_etc)
+ else if (format == FORMAT_ETC && _image_decompress_etc1)
+ _image_decompress_etc1(this);
+ else if (format >= FORMAT_ETC2_R11 && format <= FORMAT_ETC2_RGB8A1 && _image_decompress_etc1)
_image_decompress_etc2(this);
else
return ERR_UNAVAILABLE;
return OK;
}
-Error Image::compress(CompressMode p_mode) {
+Error Image::compress(CompressMode p_mode, CompressSource p_source, float p_lossy_quality) {
switch (p_mode) {
- case COMPRESS_16BIT: {
-
- //ERR_FAIL_COND_V(!_image_compress_bc_func, ERR_UNAVAILABLE);
- //_image_compress_bc_func(this);
- } break;
case COMPRESS_S3TC: {
ERR_FAIL_COND_V(!_image_compress_bc_func, ERR_UNAVAILABLE);
- _image_compress_bc_func(this);
+ _image_compress_bc_func(this, p_source);
} break;
case COMPRESS_PVRTC2: {
@@ -1782,27 +1513,19 @@ Error Image::compress(CompressMode p_mode) {
} break;
case COMPRESS_ETC: {
- ERR_FAIL_COND_V(!_image_compress_etc_func, ERR_UNAVAILABLE);
- _image_compress_etc_func(this);
+ ERR_FAIL_COND_V(!_image_compress_etc1_func, ERR_UNAVAILABLE);
+ _image_compress_etc1_func(this, p_lossy_quality);
} break;
case COMPRESS_ETC2: {
- ERR_FAIL_COND_V(!_image_compress_etc_func, ERR_UNAVAILABLE);
- _image_compress_etc_func(this);
+ ERR_FAIL_COND_V(!_image_compress_etc2_func, ERR_UNAVAILABLE);
+ _image_compress_etc2_func(this, p_lossy_quality, p_source);
} break;
}
return OK;
}
-Image Image::compressed(int p_mode) {
-
- Image ret = *this;
- ret.compress((Image::CompressMode)p_mode);
-
- return ret;
-}
-
Image::Image(const char **p_xpm) {
width = 0;
@@ -1873,47 +1596,47 @@ Rect2 Image::get_used_rect() const {
return Rect2(minx, miny, maxx - minx + 1, maxy - miny + 1);
}
-Image Image::get_rect(const Rect2 &p_area) const {
-
- Image img(p_area.size.x, p_area.size.y, mipmaps, format);
- img.blit_rect(*this, p_area, Point2(0, 0));
+Ref<Image> Image::get_rect(const Rect2 &p_area) const {
+ Ref<Image> img = memnew(Image(p_area.size.x, p_area.size.y, mipmaps, format));
+ img->blit_rect(Ref<Image>((Image *)this), p_area, Point2(0, 0));
return img;
}
-void Image::blit_rect(const Image &p_src, const Rect2 &p_src_rect, const Point2 &p_dest) {
+void Image::blit_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const Point2 &p_dest) {
+ ERR_FAIL_COND(p_src.is_null());
int dsize = data.size();
- int srcdsize = p_src.data.size();
+ int srcdsize = p_src->data.size();
ERR_FAIL_COND(dsize == 0);
ERR_FAIL_COND(srcdsize == 0);
- ERR_FAIL_COND(format != p_src.format);
-
- Rect2i local_src_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest + p_src_rect.pos, p_src_rect.size));
+ ERR_FAIL_COND(format != p_src->format);
- if (local_src_rect.size.x <= 0 || local_src_rect.size.y <= 0)
+ Rect2i clipped_src_rect = Rect2i(0, 0, p_src->width, p_src->height).clip(p_src_rect);
+ if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
return;
- Rect2i src_rect(p_src_rect.pos + (local_src_rect.pos - p_dest), local_src_rect.size);
+
+ Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest, clipped_src_rect.size));
PoolVector<uint8_t>::Write wp = data.write();
uint8_t *dst_data_ptr = wp.ptr();
- PoolVector<uint8_t>::Read rp = p_src.data.read();
+ PoolVector<uint8_t>::Read rp = p_src->data.read();
const uint8_t *src_data_ptr = rp.ptr();
int pixel_size = get_format_pixel_size(format);
- for (int i = 0; i < src_rect.size.y; i++) {
+ for (int i = 0; i < dest_rect.size.y; i++) {
- for (int j = 0; j < src_rect.size.x; j++) {
+ for (int j = 0; j < dest_rect.size.x; j++) {
- int src_x = src_rect.pos.x + j;
- int src_y = src_rect.pos.y + i;
+ int src_x = clipped_src_rect.position.x + j;
+ int src_y = clipped_src_rect.position.y + i;
- int dst_x = local_src_rect.pos.x + j;
- int dst_y = local_src_rect.pos.y + i;
+ int dst_x = dest_rect.position.x + j;
+ int dst_y = dest_rect.position.y + i;
- const uint8_t *src = &src_data_ptr[(src_y * p_src.width + src_x) * pixel_size];
+ const uint8_t *src = &src_data_ptr[(src_y * p_src->width + src_x) * pixel_size];
uint8_t *dst = &dst_data_ptr[(dst_y * width + dst_x) * pixel_size];
for (int k = 0; k < pixel_size; k++) {
@@ -1923,25 +1646,694 @@ void Image::blit_rect(const Image &p_src, const Rect2 &p_src_rect, const Point2
}
}
-Image (*Image::_png_mem_loader_func)(const uint8_t *, int) = NULL;
-Image (*Image::_jpg_mem_loader_func)(const uint8_t *, int) = NULL;
+void Image::blit_rect_mask(const Ref<Image> &p_src, const Ref<Image> &p_mask, const Rect2 &p_src_rect, const Point2 &p_dest) {
+
+ ERR_FAIL_COND(p_src.is_null());
+ ERR_FAIL_COND(p_mask.is_null());
+ int dsize = data.size();
+ int srcdsize = p_src->data.size();
+ int maskdsize = p_mask->data.size();
+ ERR_FAIL_COND(dsize == 0);
+ ERR_FAIL_COND(srcdsize == 0);
+ ERR_FAIL_COND(maskdsize == 0);
+ ERR_FAIL_COND(p_src->width != p_mask->width);
+ ERR_FAIL_COND(p_src->height != p_mask->height);
+ ERR_FAIL_COND(format != p_src->format);
+
+ Rect2i clipped_src_rect = Rect2i(0, 0, p_src->width, p_src->height).clip(p_src_rect);
+ if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
+ return;
+
+ Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest, clipped_src_rect.size));
+
+ PoolVector<uint8_t>::Write wp = data.write();
+ uint8_t *dst_data_ptr = wp.ptr();
-void (*Image::_image_compress_bc_func)(Image *) = NULL;
+ PoolVector<uint8_t>::Read rp = p_src->data.read();
+ const uint8_t *src_data_ptr = rp.ptr();
+
+ int pixel_size = get_format_pixel_size(format);
+
+ Ref<Image> msk = p_mask;
+ msk->lock();
+
+ for (int i = 0; i < dest_rect.size.y; i++) {
+
+ for (int j = 0; j < dest_rect.size.x; j++) {
+
+ int src_x = clipped_src_rect.position.x + j;
+ int src_y = clipped_src_rect.position.y + i;
+
+ if (msk->get_pixel(src_x, src_y).a != 0) {
+
+ int dst_x = dest_rect.position.x + j;
+ int dst_y = dest_rect.position.y + i;
+
+ const uint8_t *src = &src_data_ptr[(src_y * p_src->width + src_x) * pixel_size];
+ uint8_t *dst = &dst_data_ptr[(dst_y * width + dst_x) * pixel_size];
+
+ for (int k = 0; k < pixel_size; k++) {
+ dst[k] = src[k];
+ }
+ }
+ }
+ }
+
+ msk->unlock();
+}
+
+void Image::blend_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const Point2 &p_dest) {
+
+ ERR_FAIL_COND(p_src.is_null());
+ int dsize = data.size();
+ int srcdsize = p_src->data.size();
+ ERR_FAIL_COND(dsize == 0);
+ ERR_FAIL_COND(srcdsize == 0);
+ ERR_FAIL_COND(format != p_src->format);
+
+ Rect2i clipped_src_rect = Rect2i(0, 0, p_src->width, p_src->height).clip(p_src_rect);
+ if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
+ return;
+
+ Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest, clipped_src_rect.size));
+
+ lock();
+ Ref<Image> img = p_src;
+ img->lock();
+
+ for (int i = 0; i < dest_rect.size.y; i++) {
+
+ for (int j = 0; j < dest_rect.size.x; j++) {
+
+ int src_x = clipped_src_rect.position.x + j;
+ int src_y = clipped_src_rect.position.y + i;
+
+ int dst_x = dest_rect.position.x + j;
+ int dst_y = dest_rect.position.y + i;
+
+ Color sc = img->get_pixel(src_x, src_y);
+ Color dc = get_pixel(dst_x, dst_y);
+ dc.r = (double)(sc.a * sc.r + dc.a * (1.0 - sc.a) * dc.r);
+ dc.g = (double)(sc.a * sc.g + dc.a * (1.0 - sc.a) * dc.g);
+ dc.b = (double)(sc.a * sc.b + dc.a * (1.0 - sc.a) * dc.b);
+ dc.a = (double)(sc.a + dc.a * (1.0 - sc.a));
+ set_pixel(dst_x, dst_y, dc);
+ }
+ }
+
+ img->unlock();
+ unlock();
+}
+
+void Image::blend_rect_mask(const Ref<Image> &p_src, const Ref<Image> &p_mask, const Rect2 &p_src_rect, const Point2 &p_dest) {
+
+ ERR_FAIL_COND(p_src.is_null());
+ ERR_FAIL_COND(p_mask.is_null());
+ int dsize = data.size();
+ int srcdsize = p_src->data.size();
+ int maskdsize = p_mask->data.size();
+ ERR_FAIL_COND(dsize == 0);
+ ERR_FAIL_COND(srcdsize == 0);
+ ERR_FAIL_COND(maskdsize == 0);
+ ERR_FAIL_COND(p_src->width != p_mask->width);
+ ERR_FAIL_COND(p_src->height != p_mask->height);
+ ERR_FAIL_COND(format != p_src->format);
+
+ Rect2i clipped_src_rect = Rect2i(0, 0, p_src->width, p_src->height).clip(p_src_rect);
+ if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
+ return;
+
+ Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest, clipped_src_rect.size));
+
+ lock();
+ Ref<Image> img = p_src;
+ Ref<Image> msk = p_mask;
+ img->lock();
+ msk->lock();
+
+ for (int i = 0; i < dest_rect.size.y; i++) {
+
+ for (int j = 0; j < dest_rect.size.x; j++) {
+
+ int src_x = clipped_src_rect.position.x + j;
+ int src_y = clipped_src_rect.position.y + i;
+
+ // If the mask's pixel is transparent then we skip it
+ //Color c = msk->get_pixel(src_x, src_y);
+ //if (c.a == 0) continue;
+ if (msk->get_pixel(src_x, src_y).a != 0) {
+
+ int dst_x = dest_rect.position.x + j;
+ int dst_y = dest_rect.position.y + i;
+
+ Color sc = img->get_pixel(src_x, src_y);
+ Color dc = get_pixel(dst_x, dst_y);
+ dc.r = (double)(sc.a * sc.r + dc.a * (1.0 - sc.a) * dc.r);
+ dc.g = (double)(sc.a * sc.g + dc.a * (1.0 - sc.a) * dc.g);
+ dc.b = (double)(sc.a * sc.b + dc.a * (1.0 - sc.a) * dc.b);
+ dc.a = (double)(sc.a + dc.a * (1.0 - sc.a));
+ set_pixel(dst_x, dst_y, dc);
+ }
+ }
+ }
+
+ msk->unlock();
+ img->unlock();
+ unlock();
+}
+
+void Image::fill(const Color &c) {
+
+ lock();
+
+ PoolVector<uint8_t>::Write wp = data.write();
+ uint8_t *dst_data_ptr = wp.ptr();
+
+ int pixel_size = get_format_pixel_size(format);
+
+ // put first pixel with the format-aware API
+ set_pixel(0, 0, c);
+
+ for (int y = 0; y < height; y++) {
+
+ for (int x = 0; x < width; x++) {
+
+ uint8_t *dst = &dst_data_ptr[(y * width + x) * pixel_size];
+
+ for (int k = 0; k < pixel_size; k++) {
+ dst[k] = dst_data_ptr[k];
+ }
+ }
+ }
+
+ unlock();
+}
+
+Ref<Image> (*Image::_png_mem_loader_func)(const uint8_t *, int) = NULL;
+Ref<Image> (*Image::_jpg_mem_loader_func)(const uint8_t *, int) = NULL;
+
+void (*Image::_image_compress_bc_func)(Image *, Image::CompressSource) = NULL;
void (*Image::_image_compress_pvrtc2_func)(Image *) = NULL;
void (*Image::_image_compress_pvrtc4_func)(Image *) = NULL;
-void (*Image::_image_compress_etc_func)(Image *) = NULL;
-void (*Image::_image_compress_etc2_func)(Image *) = NULL;
+void (*Image::_image_compress_etc1_func)(Image *, float) = NULL;
+void (*Image::_image_compress_etc2_func)(Image *, float, Image::CompressSource) = NULL;
void (*Image::_image_decompress_pvrtc)(Image *) = NULL;
void (*Image::_image_decompress_bc)(Image *) = NULL;
-void (*Image::_image_decompress_etc)(Image *) = NULL;
+void (*Image::_image_decompress_etc1)(Image *) = NULL;
void (*Image::_image_decompress_etc2)(Image *) = NULL;
-PoolVector<uint8_t> (*Image::lossy_packer)(const Image &, float) = NULL;
-Image (*Image::lossy_unpacker)(const PoolVector<uint8_t> &) = NULL;
-PoolVector<uint8_t> (*Image::lossless_packer)(const Image &) = NULL;
-Image (*Image::lossless_unpacker)(const PoolVector<uint8_t> &) = NULL;
+PoolVector<uint8_t> (*Image::lossy_packer)(const Ref<Image> &, float) = NULL;
+Ref<Image> (*Image::lossy_unpacker)(const PoolVector<uint8_t> &) = NULL;
+PoolVector<uint8_t> (*Image::lossless_packer)(const Ref<Image> &) = NULL;
+Ref<Image> (*Image::lossless_unpacker)(const PoolVector<uint8_t> &) = NULL;
+
+void Image::_set_data(const Dictionary &p_data) {
+
+ ERR_FAIL_COND(!p_data.has("width"));
+ ERR_FAIL_COND(!p_data.has("height"));
+ ERR_FAIL_COND(!p_data.has("format"));
+ ERR_FAIL_COND(!p_data.has("mipmaps"));
+ ERR_FAIL_COND(!p_data.has("data"));
+
+ int dwidth = p_data["width"];
+ int dheight = p_data["height"];
+ String dformat = p_data["format"];
+ bool dmipmaps = p_data["mipmaps"];
+ PoolVector<uint8_t> ddata = p_data["data"];
+ Format ddformat = FORMAT_MAX;
+ for (int i = 0; i < FORMAT_MAX; i++) {
+ if (dformat == get_format_name(Format(i))) {
+ ddformat = Format(i);
+ break;
+ }
+ }
+
+ ERR_FAIL_COND(ddformat == FORMAT_MAX);
+
+ create(dwidth, dheight, dmipmaps, ddformat, ddata);
+}
+
+Dictionary Image::_get_data() const {
+
+ Dictionary d;
+ d["width"] = width;
+ d["height"] = height;
+ d["format"] = get_format_name(format);
+ d["mipmaps"] = mipmaps;
+ d["data"] = data;
+ return d;
+}
+
+void Image::lock() {
+
+ ERR_FAIL_COND(data.size() == 0);
+ write_lock = data.write();
+}
+
+void Image::unlock() {
+
+ write_lock = PoolVector<uint8_t>::Write();
+}
-void Image::set_compress_bc_func(void (*p_compress_func)(Image *)) {
+Color Image::get_pixel(int p_x, int p_y) const {
+
+ uint8_t *ptr = write_lock.ptr();
+#ifdef DEBUG_ENABLED
+ if (!ptr) {
+ ERR_EXPLAIN("Image must be locked with 'lock()' before using get_pixel()");
+ ERR_FAIL_COND_V(!ptr, Color());
+ }
+
+ ERR_FAIL_INDEX_V(p_x, width, Color());
+ ERR_FAIL_INDEX_V(p_y, height, Color());
+
+#endif
+
+ uint32_t ofs = p_y * width + p_x;
+
+ switch (format) {
+ case FORMAT_L8: {
+ float l = ptr[ofs] / 255.0;
+ return Color(l, l, l, 1);
+ } break;
+ case FORMAT_LA8: {
+ float l = ptr[ofs * 2 + 0] / 255.0;
+ float a = ptr[ofs * 2 + 1] / 255.0;
+ return Color(l, l, l, a);
+ } break;
+ case FORMAT_R8: {
+
+ float r = ptr[ofs] / 255.0;
+ return Color(r, 0, 0, 1);
+ } break;
+ case FORMAT_RG8: {
+
+ float r = ptr[ofs * 2 + 0] / 255.0;
+ float g = ptr[ofs * 2 + 1] / 255.0;
+ return Color(r, g, 0, 1);
+ } break;
+ case FORMAT_RGB8: {
+ float r = ptr[ofs * 3 + 0] / 255.0;
+ float g = ptr[ofs * 3 + 1] / 255.0;
+ float b = ptr[ofs * 3 + 2] / 255.0;
+ return Color(r, g, b, 1);
+
+ } break;
+ case FORMAT_RGBA8: {
+ float r = ptr[ofs * 4 + 0] / 255.0;
+ float g = ptr[ofs * 4 + 1] / 255.0;
+ float b = ptr[ofs * 4 + 2] / 255.0;
+ float a = ptr[ofs * 4 + 3] / 255.0;
+ return Color(r, g, b, a);
+
+ } break;
+ case FORMAT_RGBA4444: {
+ uint16_t u = ((uint16_t *)ptr)[ofs];
+ float r = (u & 0xF) / 15.0;
+ float g = ((u >> 4) & 0xF) / 15.0;
+ float b = ((u >> 8) & 0xF) / 15.0;
+ float a = ((u >> 12) & 0xF) / 15.0;
+ return Color(r, g, b, a);
+
+ } break;
+ case FORMAT_RGBA5551: {
+
+ uint16_t u = ((uint16_t *)ptr)[ofs];
+ float r = (u & 0x1F) / 15.0;
+ float g = ((u >> 5) & 0x1F) / 15.0;
+ float b = ((u >> 10) & 0x1F) / 15.0;
+ float a = ((u >> 15) & 0x1) / 1.0;
+ return Color(r, g, b, a);
+ } break;
+ case FORMAT_RF: {
+
+ float r = ((float *)ptr)[ofs];
+ return Color(r, 0, 0, 1);
+ } break;
+ case FORMAT_RGF: {
+
+ float r = ((float *)ptr)[ofs * 2 + 0];
+ float g = ((float *)ptr)[ofs * 2 + 1];
+ return Color(r, g, 0, 1);
+ } break;
+ case FORMAT_RGBF: {
+
+ float r = ((float *)ptr)[ofs * 3 + 0];
+ float g = ((float *)ptr)[ofs * 3 + 1];
+ float b = ((float *)ptr)[ofs * 3 + 2];
+ return Color(r, g, b, 1);
+ } break;
+ case FORMAT_RGBAF: {
+
+ float r = ((float *)ptr)[ofs * 4 + 0];
+ float g = ((float *)ptr)[ofs * 4 + 1];
+ float b = ((float *)ptr)[ofs * 4 + 2];
+ float a = ((float *)ptr)[ofs * 4 + 3];
+ return Color(r, g, b, a);
+ } break;
+ case FORMAT_RH: {
+
+ uint16_t r = ((uint16_t *)ptr)[ofs];
+ return Color(Math::half_to_float(r), 0, 0, 1);
+ } break;
+ case FORMAT_RGH: {
+
+ uint16_t r = ((uint16_t *)ptr)[ofs * 2 + 0];
+ uint16_t g = ((uint16_t *)ptr)[ofs * 2 + 1];
+ return Color(Math::half_to_float(r), Math::half_to_float(g), 0, 1);
+ } break;
+ case FORMAT_RGBH: {
+
+ uint16_t r = ((uint16_t *)ptr)[ofs * 3 + 0];
+ uint16_t g = ((uint16_t *)ptr)[ofs * 3 + 1];
+ uint16_t b = ((uint16_t *)ptr)[ofs * 3 + 2];
+ return Color(Math::half_to_float(r), Math::half_to_float(g), Math::half_to_float(b), 1);
+ } break;
+ case FORMAT_RGBAH: {
+
+ uint16_t r = ((uint16_t *)ptr)[ofs * 4 + 0];
+ uint16_t g = ((uint16_t *)ptr)[ofs * 4 + 1];
+ uint16_t b = ((uint16_t *)ptr)[ofs * 4 + 2];
+ uint16_t a = ((uint16_t *)ptr)[ofs * 4 + 3];
+ return Color(Math::half_to_float(r), Math::half_to_float(g), Math::half_to_float(b), Math::half_to_float(a));
+ } break;
+ case FORMAT_RGBE9995: {
+ uint32_t rgbe = ((uint32_t *)ptr)[ofs];
+ float r = rgbe & 0x1ff;
+ float g = (rgbe >> 9) & 0x1ff;
+ float b = (rgbe >> 18) & 0x1ff;
+ float e = (rgbe >> 27);
+ float m = Math::pow(2, e - 15.0 - 9.0);
+ ;
+ float rd = r * m;
+ float gd = g * m;
+ float bd = b * m;
+
+ return Color(rd, gd, bd, 1.0);
+
+ } break;
+ default: {
+ ERR_EXPLAIN("Can't get_pixel() on compressed image, sorry.");
+ ERR_FAIL_V(Color());
+ }
+ }
+
+ return Color();
+}
+
+void Image::set_pixel(int p_x, int p_y, const Color &p_color) {
+
+ uint8_t *ptr = write_lock.ptr();
+#ifdef DEBUG_ENABLED
+ if (!ptr) {
+ ERR_EXPLAIN("Image must be locked with 'lock()' before using set_pixel()");
+ ERR_FAIL_COND(!ptr);
+ }
+
+ ERR_FAIL_INDEX(p_x, width);
+ ERR_FAIL_INDEX(p_y, height);
+
+#endif
+
+ uint32_t ofs = p_y * width + p_x;
+
+ switch (format) {
+ case FORMAT_L8: {
+ ptr[ofs] = uint8_t(CLAMP(p_color.gray() * 255.0, 0, 255));
+ } break;
+ case FORMAT_LA8: {
+ ptr[ofs * 2 + 0] = uint8_t(CLAMP(p_color.gray() * 255.0, 0, 255));
+ ptr[ofs * 2 + 1] = uint8_t(CLAMP(p_color.a * 255.0, 0, 255));
+ } break;
+ case FORMAT_R8: {
+
+ ptr[ofs] = uint8_t(CLAMP(p_color.r * 255.0, 0, 255));
+ } break;
+ case FORMAT_RG8: {
+
+ ptr[ofs * 2 + 0] = uint8_t(CLAMP(p_color.r * 255.0, 0, 255));
+ ptr[ofs * 2 + 1] = uint8_t(CLAMP(p_color.g * 255.0, 0, 255));
+ } break;
+ case FORMAT_RGB8: {
+ ptr[ofs * 3 + 0] = uint8_t(CLAMP(p_color.r * 255.0, 0, 255));
+ ptr[ofs * 3 + 1] = uint8_t(CLAMP(p_color.g * 255.0, 0, 255));
+ ptr[ofs * 3 + 2] = uint8_t(CLAMP(p_color.b * 255.0, 0, 255));
+ } break;
+ case FORMAT_RGBA8: {
+ ptr[ofs * 4 + 0] = uint8_t(CLAMP(p_color.r * 255.0, 0, 255));
+ ptr[ofs * 4 + 1] = uint8_t(CLAMP(p_color.g * 255.0, 0, 255));
+ ptr[ofs * 4 + 2] = uint8_t(CLAMP(p_color.b * 255.0, 0, 255));
+ ptr[ofs * 4 + 3] = uint8_t(CLAMP(p_color.a * 255.0, 0, 255));
+
+ } break;
+ case FORMAT_RGBA4444: {
+
+ uint16_t rgba = 0;
+
+ rgba = uint16_t(CLAMP(p_color.r * 15.0, 0, 15));
+ rgba |= uint16_t(CLAMP(p_color.g * 15.0, 0, 15)) << 4;
+ rgba |= uint16_t(CLAMP(p_color.b * 15.0, 0, 15)) << 8;
+ rgba |= uint16_t(CLAMP(p_color.a * 15.0, 0, 15)) << 12;
+
+ ((uint16_t *)ptr)[ofs] = rgba;
+
+ } break;
+ case FORMAT_RGBA5551: {
+
+ uint16_t rgba = 0;
+
+ rgba = uint16_t(CLAMP(p_color.r * 31.0, 0, 31));
+ rgba |= uint16_t(CLAMP(p_color.g * 31.0, 0, 31)) << 5;
+ rgba |= uint16_t(CLAMP(p_color.b * 31.0, 0, 31)) << 10;
+ rgba |= uint16_t(p_color.a > 0.5 ? 1 : 0) << 15;
+
+ ((uint16_t *)ptr)[ofs] = rgba;
+
+ } break;
+ case FORMAT_RF: {
+
+ ((float *)ptr)[ofs] = p_color.r;
+ } break;
+ case FORMAT_RGF: {
+
+ ((float *)ptr)[ofs * 2 + 0] = p_color.r;
+ ((float *)ptr)[ofs * 2 + 1] = p_color.g;
+ } break;
+ case FORMAT_RGBF: {
+
+ ((float *)ptr)[ofs * 3 + 0] = p_color.r;
+ ((float *)ptr)[ofs * 3 + 1] = p_color.g;
+ ((float *)ptr)[ofs * 3 + 2] = p_color.b;
+ } break;
+ case FORMAT_RGBAF: {
+
+ ((float *)ptr)[ofs * 4 + 0] = p_color.r;
+ ((float *)ptr)[ofs * 4 + 1] = p_color.g;
+ ((float *)ptr)[ofs * 4 + 2] = p_color.b;
+ ((float *)ptr)[ofs * 4 + 3] = p_color.a;
+ } break;
+ case FORMAT_RH: {
+
+ ((uint16_t *)ptr)[ofs] = Math::make_half_float(p_color.r);
+ } break;
+ case FORMAT_RGH: {
+
+ ((uint16_t *)ptr)[ofs * 2 + 0] = Math::make_half_float(p_color.r);
+ ((uint16_t *)ptr)[ofs * 2 + 1] = Math::make_half_float(p_color.g);
+ } break;
+ case FORMAT_RGBH: {
+
+ ((uint16_t *)ptr)[ofs * 3 + 0] = Math::make_half_float(p_color.r);
+ ((uint16_t *)ptr)[ofs * 3 + 1] = Math::make_half_float(p_color.g);
+ ((uint16_t *)ptr)[ofs * 3 + 2] = Math::make_half_float(p_color.b);
+ } break;
+ case FORMAT_RGBAH: {
+
+ ((uint16_t *)ptr)[ofs * 4 + 0] = Math::make_half_float(p_color.r);
+ ((uint16_t *)ptr)[ofs * 4 + 1] = Math::make_half_float(p_color.g);
+ ((uint16_t *)ptr)[ofs * 4 + 2] = Math::make_half_float(p_color.b);
+ ((uint16_t *)ptr)[ofs * 4 + 3] = Math::make_half_float(p_color.a);
+ } break;
+ case FORMAT_RGBE9995: {
+
+ ((uint32_t *)ptr)[ofs] = p_color.to_rgbe9995();
+
+ } break;
+ default: {
+ ERR_EXPLAIN("Can't set_pixel() on compressed image, sorry.");
+ ERR_FAIL();
+ }
+ }
+}
+
+Image::DetectChannels Image::get_detected_channels() {
+
+ ERR_FAIL_COND_V(data.size() == 0, DETECTED_RGBA);
+ ERR_FAIL_COND_V(is_compressed(), DETECTED_RGBA);
+ bool r = false, g = false, b = false, a = false, c = false;
+ lock();
+ for (int i = 0; i < width; i++) {
+ for (int j = 0; j < height; j++) {
+
+ Color col = get_pixel(i, j);
+
+ if (col.r > 0.001)
+ r = true;
+ if (col.g > 0.001)
+ g = true;
+ if (col.b > 0.001)
+ b = true;
+ if (col.a < 0.999)
+ a = true;
+
+ if (col.r != col.b || col.r != col.g || col.b != col.g) {
+ c = true;
+ }
+ }
+ }
+
+ unlock();
+
+ if (!c && !a)
+ return DETECTED_L;
+ if (!c && a)
+ return DETECTED_LA;
+
+ if (r && !g && !b && !a)
+ return DETECTED_R;
+
+ if (r && g && !b && !a)
+ return DETECTED_RG;
+
+ if (r && g && b && !a)
+ return DETECTED_RGB;
+
+ return DETECTED_RGBA;
+}
+
+void Image::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("get_width"), &Image::get_width);
+ ClassDB::bind_method(D_METHOD("get_height"), &Image::get_height);
+ ClassDB::bind_method(D_METHOD("has_mipmaps"), &Image::has_mipmaps);
+ ClassDB::bind_method(D_METHOD("get_format"), &Image::get_format);
+ ClassDB::bind_method(D_METHOD("get_data"), &Image::get_data);
+
+ ClassDB::bind_method(D_METHOD("convert", "format"), &Image::convert);
+
+ ClassDB::bind_method(D_METHOD("get_mipmap_offset", "mipmap"), &Image::get_mipmap_offset);
+
+ ClassDB::bind_method(D_METHOD("resize_to_po2", "square"), &Image::resize_to_po2, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("resize", "width", "height", "interpolation"), &Image::resize, DEFVAL(INTERPOLATE_BILINEAR));
+ ClassDB::bind_method(D_METHOD("shrink_x2"), &Image::shrink_x2);
+ ClassDB::bind_method(D_METHOD("expand_x2_hq2x"), &Image::expand_x2_hq2x);
+
+ ClassDB::bind_method(D_METHOD("crop", "width", "height"), &Image::crop);
+ ClassDB::bind_method(D_METHOD("flip_x"), &Image::flip_x);
+ ClassDB::bind_method(D_METHOD("flip_y"), &Image::flip_y);
+ ClassDB::bind_method(D_METHOD("generate_mipmaps"), &Image::generate_mipmaps);
+ ClassDB::bind_method(D_METHOD("clear_mipmaps"), &Image::clear_mipmaps);
+
+ ClassDB::bind_method(D_METHOD("create", "width", "height", "use_mipmaps", "format"), &Image::_create_empty);
+ ClassDB::bind_method(D_METHOD("create_from_data", "width", "height", "use_mipmaps", "format", "data"), &Image::_create_from_data);
+
+ ClassDB::bind_method(D_METHOD("is_empty"), &Image::empty);
+
+ ClassDB::bind_method(D_METHOD("load", "path"), &Image::load);
+ ClassDB::bind_method(D_METHOD("save_png", "path"), &Image::save_png);
+
+ ClassDB::bind_method(D_METHOD("detect_alpha"), &Image::detect_alpha);
+ ClassDB::bind_method(D_METHOD("is_invisible"), &Image::is_invisible);
+
+ ClassDB::bind_method(D_METHOD("compress", "mode", "source", "lossy_quality"), &Image::compress);
+ ClassDB::bind_method(D_METHOD("decompress"), &Image::decompress);
+ ClassDB::bind_method(D_METHOD("is_compressed"), &Image::is_compressed);
+
+ ClassDB::bind_method(D_METHOD("fix_alpha_edges"), &Image::fix_alpha_edges);
+ ClassDB::bind_method(D_METHOD("premultiply_alpha"), &Image::premultiply_alpha);
+ ClassDB::bind_method(D_METHOD("srgb_to_linear"), &Image::srgb_to_linear);
+ ClassDB::bind_method(D_METHOD("normalmap_to_xy"), &Image::normalmap_to_xy);
+
+ ClassDB::bind_method(D_METHOD("blit_rect", "src", "src_rect", "dst"), &Image::blit_rect);
+ ClassDB::bind_method(D_METHOD("blit_rect_mask", "src", "mask", "src_rect", "dst"), &Image::blit_rect_mask);
+ ClassDB::bind_method(D_METHOD("blend_rect", "src", "src_rect", "dst"), &Image::blend_rect);
+ ClassDB::bind_method(D_METHOD("blend_rect_mask", "src", "mask", "src_rect", "dst"), &Image::blend_rect_mask);
+ ClassDB::bind_method(D_METHOD("fill", "color"), &Image::fill);
+
+ ClassDB::bind_method(D_METHOD("get_used_rect"), &Image::get_used_rect);
+ ClassDB::bind_method(D_METHOD("get_rect", "rect"), &Image::get_rect);
+
+ ClassDB::bind_method(D_METHOD("copy_from", "src"), &Image::copy_internals_from);
+
+ ClassDB::bind_method(D_METHOD("_set_data", "data"), &Image::_set_data);
+ ClassDB::bind_method(D_METHOD("_get_data"), &Image::_get_data);
+
+ ClassDB::bind_method(D_METHOD("lock"), &Image::lock);
+ ClassDB::bind_method(D_METHOD("unlock"), &Image::unlock);
+ ClassDB::bind_method(D_METHOD("set_pixel", "x", "y", "color"), &Image::set_pixel);
+ ClassDB::bind_method(D_METHOD("get_pixel", "x", "y"), &Image::get_pixel);
+
+ ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "_set_data", "_get_data");
+
+ BIND_CONSTANT(FORMAT_L8); //luminance
+ BIND_CONSTANT(FORMAT_LA8); //luminance-alpha
+ BIND_CONSTANT(FORMAT_R8);
+ BIND_CONSTANT(FORMAT_RG8);
+ BIND_CONSTANT(FORMAT_RGB8);
+ BIND_CONSTANT(FORMAT_RGBA8);
+ BIND_CONSTANT(FORMAT_RGBA4444);
+ BIND_CONSTANT(FORMAT_RGBA5551);
+ BIND_CONSTANT(FORMAT_RF); //float
+ BIND_CONSTANT(FORMAT_RGF);
+ BIND_CONSTANT(FORMAT_RGBF);
+ BIND_CONSTANT(FORMAT_RGBAF);
+ BIND_CONSTANT(FORMAT_RH); //half float
+ BIND_CONSTANT(FORMAT_RGH);
+ BIND_CONSTANT(FORMAT_RGBH);
+ BIND_CONSTANT(FORMAT_RGBAH);
+ BIND_CONSTANT(FORMAT_RGBE9995);
+ BIND_CONSTANT(FORMAT_DXT1); //s3tc bc1
+ BIND_CONSTANT(FORMAT_DXT3); //bc2
+ BIND_CONSTANT(FORMAT_DXT5); //bc3
+ BIND_CONSTANT(FORMAT_RGTC_R);
+ BIND_CONSTANT(FORMAT_RGTC_RG);
+ BIND_CONSTANT(FORMAT_BPTC_RGBA); //btpc bc6h
+ BIND_CONSTANT(FORMAT_BPTC_RGBF); //float /
+ BIND_CONSTANT(FORMAT_BPTC_RGBFU); //unsigned float
+ BIND_CONSTANT(FORMAT_PVRTC2); //pvrtc
+ BIND_CONSTANT(FORMAT_PVRTC2A);
+ BIND_CONSTANT(FORMAT_PVRTC4);
+ BIND_CONSTANT(FORMAT_PVRTC4A);
+ BIND_CONSTANT(FORMAT_ETC); //etc1
+ BIND_CONSTANT(FORMAT_ETC2_R11); //etc2
+ BIND_CONSTANT(FORMAT_ETC2_R11S); //signed ); NOT srgb.
+ BIND_CONSTANT(FORMAT_ETC2_RG11);
+ BIND_CONSTANT(FORMAT_ETC2_RG11S);
+ BIND_CONSTANT(FORMAT_ETC2_RGB8);
+ BIND_CONSTANT(FORMAT_ETC2_RGBA8);
+ BIND_CONSTANT(FORMAT_ETC2_RGB8A1);
+ BIND_CONSTANT(FORMAT_MAX);
+
+ BIND_CONSTANT(INTERPOLATE_NEAREST);
+ BIND_CONSTANT(INTERPOLATE_BILINEAR);
+ BIND_CONSTANT(INTERPOLATE_CUBIC);
+
+ BIND_CONSTANT(ALPHA_NONE);
+ BIND_CONSTANT(ALPHA_BIT);
+ BIND_CONSTANT(ALPHA_BLEND);
+
+ BIND_CONSTANT(COMPRESS_S3TC);
+ BIND_CONSTANT(COMPRESS_PVRTC2);
+ BIND_CONSTANT(COMPRESS_PVRTC4);
+ BIND_CONSTANT(COMPRESS_ETC);
+ BIND_CONSTANT(COMPRESS_ETC2);
+
+ BIND_CONSTANT(COMPRESS_SOURCE_GENERIC);
+ BIND_CONSTANT(COMPRESS_SOURCE_SRGB);
+ BIND_CONSTANT(COMPRESS_SOURCE_NORMAL);
+}
+
+void Image::set_compress_bc_func(void (*p_compress_func)(Image *, CompressSource)) {
_image_compress_bc_func = p_compress_func;
}
@@ -2042,7 +2434,7 @@ void Image::fix_alpha_edges() {
unsigned char *data_ptr = wp.ptr();
const int max_radius = 4;
- const int alpha_treshold = 20;
+ const int alpha_threshold = 20;
const int max_dist = 0x7FFFFFFF;
for (int i = 0; i < height; i++) {
@@ -2051,7 +2443,7 @@ void Image::fix_alpha_edges() {
const uint8_t *rptr = &srcptr[(i * width + j) * 4];
uint8_t *wptr = &data_ptr[(i * width + j) * 4];
- if (rptr[3] >= alpha_treshold)
+ if (rptr[3] >= alpha_threshold)
continue;
int closest_dist = max_dist;
@@ -2073,7 +2465,7 @@ void Image::fix_alpha_edges() {
const uint8_t *rp = &srcptr[(k * width + l) << 2];
- if (rp[3] < alpha_treshold)
+ if (rp[3] < alpha_threshold)
continue;
closest_color[0] = rp[0];
@@ -2106,14 +2498,22 @@ Image::Image(const uint8_t *p_mem_png_jpg, int p_len) {
format = FORMAT_L8;
if (_png_mem_loader_func) {
- *this = _png_mem_loader_func(p_mem_png_jpg, p_len);
+ copy_internals_from(_png_mem_loader_func(p_mem_png_jpg, p_len));
}
if (empty() && _jpg_mem_loader_func) {
- *this = _jpg_mem_loader_func(p_mem_png_jpg, p_len);
+ copy_internals_from(_jpg_mem_loader_func(p_mem_png_jpg, p_len));
}
}
+Ref<Resource> Image::duplicate(bool p_subresources) const {
+
+ Ref<Image> copy;
+ copy.instance();
+ copy->_copy_internals_from(*this);
+ return copy;
+}
+
Image::Image() {
width = 0;
@@ -2123,4 +2523,8 @@ Image::Image() {
}
Image::~Image() {
+
+ if (write_lock.ptr()) {
+ unlock();
+ }
}
diff --git a/core/image.h b/core/image.h
index 300ac11e04..7acc4744e9 100644
--- a/core/image.h
+++ b/core/image.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,6 +33,8 @@
#include "color.h"
#include "dvector.h"
#include "math_2d.h"
+#include "resource.h"
+
/**
* @author Juan Linietsky <reduzio@gmail.com>
*
@@ -42,9 +45,10 @@
class Image;
-typedef Error (*SavePNGFunc)(const String &p_path, Image &p_img);
+typedef Error (*SavePNGFunc)(const String &p_path, const Ref<Image> &p_img);
-class Image {
+class Image : public Resource {
+ GDCLASS(Image, Resource);
enum {
MAX_WIDTH = 16384, // force a limit somehow
@@ -62,7 +66,6 @@ public:
FORMAT_RG8,
FORMAT_RGB8,
FORMAT_RGBA8,
- FORMAT_RGB565, //16 bit
FORMAT_RGBA4444,
FORMAT_RGBA5551,
FORMAT_RF, //float
@@ -73,14 +76,15 @@ public:
FORMAT_RGH,
FORMAT_RGBH,
FORMAT_RGBAH,
+ FORMAT_RGBE9995,
FORMAT_DXT1, //s3tc bc1
FORMAT_DXT3, //bc2
FORMAT_DXT5, //bc3
- FORMAT_ATI1, //bc4
- FORMAT_ATI2, //bc5
- FORMAT_BPTC_RGBA, //btpc bc6h
- FORMAT_BPTC_RGBF, //float /
- FORMAT_BPTC_RGBFU, //unsigned float
+ FORMAT_RGTC_R,
+ FORMAT_RGTC_RG,
+ FORMAT_BPTC_RGBA, //btpc bc7
+ FORMAT_BPTC_RGBF, //float bc6h
+ FORMAT_BPTC_RGBFU, //unsigned float bc6hu
FORMAT_PVRTC2, //pvrtc
FORMAT_PVRTC2A,
FORMAT_PVRTC4,
@@ -105,42 +109,70 @@ public:
/* INTERPOLATE GAUSS */
};
+ enum CompressSource {
+ COMPRESS_SOURCE_GENERIC,
+ COMPRESS_SOURCE_SRGB,
+ COMPRESS_SOURCE_NORMAL
+ };
+
//some functions provided by something else
- static Image (*_png_mem_loader_func)(const uint8_t *p_png, int p_size);
- static Image (*_jpg_mem_loader_func)(const uint8_t *p_png, int p_size);
+ static Ref<Image> (*_png_mem_loader_func)(const uint8_t *p_png, int p_size);
+ static Ref<Image> (*_jpg_mem_loader_func)(const uint8_t *p_png, int p_size);
- static void (*_image_compress_bc_func)(Image *);
+ static void (*_image_compress_bc_func)(Image *, CompressSource p_source);
static void (*_image_compress_pvrtc2_func)(Image *);
static void (*_image_compress_pvrtc4_func)(Image *);
- static void (*_image_compress_etc_func)(Image *);
- static void (*_image_compress_etc2_func)(Image *);
+ static void (*_image_compress_etc1_func)(Image *, float);
+ static void (*_image_compress_etc2_func)(Image *, float, CompressSource p_source);
static void (*_image_decompress_pvrtc)(Image *);
static void (*_image_decompress_bc)(Image *);
- static void (*_image_decompress_etc)(Image *);
+ static void (*_image_decompress_etc1)(Image *);
static void (*_image_decompress_etc2)(Image *);
- Error _decompress_bc();
+ static PoolVector<uint8_t> (*lossy_packer)(const Ref<Image> &p_image, float p_quality);
+ static Ref<Image> (*lossy_unpacker)(const PoolVector<uint8_t> &p_buffer);
+ static PoolVector<uint8_t> (*lossless_packer)(const Ref<Image> &p_image);
+ static Ref<Image> (*lossless_unpacker)(const PoolVector<uint8_t> &p_buffer);
- static PoolVector<uint8_t> (*lossy_packer)(const Image &p_image, float p_quality);
- static Image (*lossy_unpacker)(const PoolVector<uint8_t> &p_buffer);
- static PoolVector<uint8_t> (*lossless_packer)(const Image &p_image);
- static Image (*lossless_unpacker)(const PoolVector<uint8_t> &p_buffer);
+ PoolVector<uint8_t>::Write write_lock;
+
+protected:
+ static void _bind_methods();
private:
+ void _create_empty(int p_width, int p_height, bool p_use_mipmaps, Format p_format) {
+ create(p_width, p_height, p_use_mipmaps, p_format);
+ }
+
+ void _create_from_data(int p_width, int p_height, bool p_use_mipmaps, Format p_format, const PoolVector<uint8_t> &p_data) {
+ create(p_width, p_height, p_use_mipmaps, p_format, p_data);
+ }
+
Format format;
PoolVector<uint8_t> data;
int width, height;
bool mipmaps;
+ void _copy_internals_from(const Image &p_image) {
+ format = p_image.format;
+ width = p_image.width;
+ height = p_image.height;
+ mipmaps = p_image.mipmaps;
+ data = p_image.data;
+ }
+
_FORCE_INLINE_ void _get_mipmap_offset_and_size(int p_mipmap, int &r_offset, int &r_width, int &r_height) const; //get where the mipmap begins in data
static int _get_dst_image_size(int p_width, int p_height, Format p_format, int &r_mipmaps, int p_mipmaps = -1);
bool _can_modify(Format p_format) const;
- _FORCE_INLINE_ void _put_pixelb(int p_x, int p_y, uint32_t p_pixelsize, uint8_t *p_dst, const uint8_t *p_src);
- _FORCE_INLINE_ void _get_pixelb(int p_x, int p_y, uint32_t p_pixelsize, const uint8_t *p_src, uint8_t *p_dst);
+ _FORCE_INLINE_ void _put_pixelb(int p_x, int p_y, uint32_t p_pixelsize, uint8_t *p_data, const uint8_t *p_pixel);
+ _FORCE_INLINE_ void _get_pixelb(int p_x, int p_y, uint32_t p_pixelsize, const uint8_t *p_data, uint8_t *p_pixel);
+
+ void _set_data(const Dictionary &p_data);
+ Dictionary _get_data() const;
public:
int get_width() const; ///< Get image width
@@ -153,14 +185,6 @@ public:
*/
void convert(Format p_new_format);
- Image converted(int p_new_format) {
- ERR_FAIL_INDEX_V(p_new_format, FORMAT_MAX, Image());
-
- Image ret = *this;
- ret.convert((Format)p_new_format);
- return ret;
- };
-
/**
* Get the current image format.
*/
@@ -177,7 +201,6 @@ public:
void resize_to_po2(bool p_square = false);
void resize(int p_width, int p_height, Interpolation p_interpolation = INTERPOLATE_BILINEAR);
- Image resized(int p_width, int p_height, int p_interpolation = INTERPOLATE_BILINEAR);
void shrink_x2();
void expand_x2_hq2x();
/**
@@ -210,7 +233,7 @@ public:
PoolVector<uint8_t> get_data() const;
Error load(const String &p_path);
- Error save_png(const String &p_path);
+ Error save_png(const String &p_path) const;
/**
* create an empty image
@@ -236,26 +259,22 @@ public:
static int get_format_pixel_size(Format p_format);
static int get_format_pixel_rshift(Format p_format);
+ static int get_format_block_size(Format p_format);
static void get_format_min_pixel_size(Format p_format, int &r_w, int &r_h);
static int get_image_data_size(int p_width, int p_height, Format p_format, int p_mipmaps = 0);
static int get_image_required_mipmaps(int p_width, int p_height, Format p_format);
- bool operator==(const Image &p_image) const;
-
enum CompressMode {
- COMPRESS_16BIT,
COMPRESS_S3TC,
COMPRESS_PVRTC2,
COMPRESS_PVRTC4,
COMPRESS_ETC,
- COMPRESS_ETC2
+ COMPRESS_ETC2,
};
- Error compress(CompressMode p_mode = COMPRESS_S3TC);
- Image compressed(int p_mode); /* from the Image::CompressMode enum */
+ Error compress(CompressMode p_mode = COMPRESS_S3TC, CompressSource p_source = COMPRESS_SOURCE_GENERIC, float p_lossy_quality = 0.7);
Error decompress();
- Image decompressed() const;
bool is_compressed() const;
void fix_alpha_edges();
@@ -263,17 +282,57 @@ public:
void srgb_to_linear();
void normalmap_to_xy();
- void blit_rect(const Image &p_src, const Rect2 &p_src_rect, const Point2 &p_dest);
+ void blit_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const Point2 &p_dest);
+ void blit_rect_mask(const Ref<Image> &p_src, const Ref<Image> &p_mask, const Rect2 &p_src_rect, const Point2 &p_dest);
+ void blend_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const Point2 &p_dest);
+ void blend_rect_mask(const Ref<Image> &p_src, const Ref<Image> &p_mask, const Rect2 &p_src_rect, const Point2 &p_dest);
+ void fill(const Color &c);
Rect2 get_used_rect() const;
- Image get_rect(const Rect2 &p_area) const;
+ Ref<Image> get_rect(const Rect2 &p_area) const;
- static void set_compress_bc_func(void (*p_compress_func)(Image *));
+ static void set_compress_bc_func(void (*p_compress_func)(Image *, CompressSource));
static String get_format_name(Format p_format);
Image(const uint8_t *p_mem_png_jpg, int p_len = -1);
Image(const char **p_xpm);
+
+ virtual Ref<Resource> duplicate(bool p_subresources = false) const;
+
+ void lock();
+ void unlock();
+
+ //this is used for compression
+ enum DetectChannels {
+ DETECTED_L,
+ DETECTED_LA,
+ DETECTED_R,
+ DETECTED_RG,
+ DETECTED_RGB,
+ DETECTED_RGBA,
+ };
+
+ DetectChannels get_detected_channels();
+
+ Color get_pixel(int p_x, int p_y) const;
+ void set_pixel(int p_x, int p_y, const Color &p_color);
+
+ void copy_internals_from(const Ref<Image> &p_image) {
+ ERR_FAIL_COND(p_image.is_null());
+ format = p_image->format;
+ width = p_image->width;
+ height = p_image->height;
+ mipmaps = p_image->mipmaps;
+ data = p_image->data;
+ }
+
~Image();
};
+VARIANT_ENUM_CAST(Image::Format)
+VARIANT_ENUM_CAST(Image::Interpolation)
+VARIANT_ENUM_CAST(Image::CompressMode)
+VARIANT_ENUM_CAST(Image::CompressSource)
+VARIANT_ENUM_CAST(Image::AlphaMode)
+
#endif
diff --git a/core/input_map.cpp b/core/input_map.cpp
index b2b4246d6a..8435882325 100644
--- a/core/input_map.cpp
+++ b/core/input_map.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,16 +29,14 @@
/*************************************************************************/
#include "input_map.h"
-#include "global_config.h"
#include "os/keyboard.h"
+#include "project_settings.h"
InputMap *InputMap::singleton = NULL;
void InputMap::_bind_methods() {
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);
@@ -56,23 +55,15 @@ void InputMap::add_action(const StringName &p_action) {
input_map[p_action] = Action();
static int last_id = 1;
input_map[p_action].id = last_id;
- input_id_map[last_id] = p_action;
last_id++;
}
void InputMap::erase_action(const StringName &p_action) {
ERR_FAIL_COND(!input_map.has(p_action));
- input_id_map.erase(input_map[p_action].id);
input_map.erase(p_action);
}
-StringName InputMap::get_action_from_id(int p_id) const {
-
- ERR_FAIL_COND_V(!input_id_map.has(p_id), StringName());
- return input_id_map[p_id];
-}
-
Array InputMap::_get_actions() {
Array ret;
@@ -102,49 +93,18 @@ List<StringName> InputMap::get_actions() const {
return actions;
}
-List<InputEvent>::Element *InputMap::_find_event(List<InputEvent> &p_list, const InputEvent &p_event, bool p_action_test) const {
-
- for (List<InputEvent>::Element *E = p_list.front(); E; E = E->next()) {
-
- const InputEvent &e = E->get();
- if (e.type != p_event.type)
- continue;
- if (e.type != InputEvent::KEY && e.device != p_event.device)
- continue;
-
- bool same = false;
-
- switch (p_event.type) {
-
- case InputEvent::KEY: {
-
- if (p_action_test) {
- uint32_t code = e.key.get_scancode_with_modifiers();
- uint32_t event_code = p_event.key.get_scancode_with_modifiers();
- same = (e.key.scancode == p_event.key.scancode && (!p_event.key.pressed || ((code & event_code) == code)));
- } else {
- same = (e.key.scancode == p_event.key.scancode && e.key.mod == p_event.key.mod);
- }
-
- } break;
- case InputEvent::JOYPAD_BUTTON: {
+List<Ref<InputEvent> >::Element *InputMap::_find_event(List<Ref<InputEvent> > &p_list, const Ref<InputEvent> &p_event, bool p_action_test) const {
- same = (e.joy_button.button_index == p_event.joy_button.button_index);
+ for (List<Ref<InputEvent> >::Element *E = p_list.front(); E; E = E->next()) {
- } break;
- case InputEvent::MOUSE_BUTTON: {
+ const Ref<InputEvent> e = E->get();
- same = (e.mouse_button.button_index == p_event.mouse_button.button_index);
+ //if (e.type != Ref<InputEvent>::KEY && e.device != p_event.device) -- unsure about the KEY comparison, why is this here?
+ // continue;
- } break;
- case InputEvent::JOYPAD_MOTION: {
-
- same = (e.joy_motion.axis == p_event.joy_motion.axis && (e.joy_motion.axis_value < 0) == (p_event.joy_motion.axis_value < 0));
-
- } break;
- }
-
- if (same)
+ if (e->get_device() != p_event->get_device())
+ continue;
+ if (e->action_match(p_event))
return E;
}
@@ -156,9 +116,9 @@ bool InputMap::has_action(const StringName &p_action) const {
return input_map.has(p_action);
}
-void InputMap::action_add_event(const StringName &p_action, const InputEvent &p_event) {
+void InputMap::action_add_event(const StringName &p_action, const Ref<InputEvent> &p_event) {
- ERR_FAIL_COND(p_event.type == InputEvent::ACTION);
+ ERR_FAIL_COND(p_event.is_null());
ERR_FAIL_COND(!input_map.has(p_action));
if (_find_event(input_map[p_action].inputs, p_event))
return; //already gots
@@ -166,23 +126,17 @@ void InputMap::action_add_event(const StringName &p_action, const InputEvent &p_
input_map[p_action].inputs.push_back(p_event);
}
-int InputMap::get_action_id(const StringName &p_action) const {
-
- ERR_FAIL_COND_V(!input_map.has(p_action), -1);
- return input_map[p_action].id;
-}
-
-bool InputMap::action_has_event(const StringName &p_action, const InputEvent &p_event) {
+bool InputMap::action_has_event(const StringName &p_action, const Ref<InputEvent> &p_event) {
ERR_FAIL_COND_V(!input_map.has(p_action), false);
return (_find_event(input_map[p_action].inputs, p_event) != NULL);
}
-void InputMap::action_erase_event(const StringName &p_action, const InputEvent &p_event) {
+void InputMap::action_erase_event(const StringName &p_action, const Ref<InputEvent> &p_event) {
ERR_FAIL_COND(!input_map.has(p_action));
- List<InputEvent>::Element *E = _find_event(input_map[p_action].inputs, p_event);
+ List<Ref<InputEvent> >::Element *E = _find_event(input_map[p_action].inputs, p_event);
if (E)
input_map[p_action].inputs.erase(E);
}
@@ -190,9 +144,9 @@ void InputMap::action_erase_event(const StringName &p_action, const InputEvent &
Array InputMap::_get_action_list(const StringName &p_action) {
Array ret;
- const List<InputEvent> *al = get_action_list(p_action);
+ const List<Ref<InputEvent> > *al = get_action_list(p_action);
if (al) {
- for (const List<InputEvent>::Element *E = al->front(); E; E = E->next()) {
+ for (const List<Ref<InputEvent> >::Element *E = al->front(); E; E = E->next()) {
ret.push_back(E->get());
}
@@ -201,7 +155,7 @@ Array InputMap::_get_action_list(const StringName &p_action) {
return ret;
}
-const List<InputEvent> *InputMap::get_action_list(const StringName &p_action) {
+const List<Ref<InputEvent> > *InputMap::get_action_list(const StringName &p_action) {
const Map<StringName, Action>::Element *E = input_map.find(p_action);
if (!E)
@@ -210,7 +164,7 @@ const List<InputEvent> *InputMap::get_action_list(const StringName &p_action) {
return &E->get().inputs;
}
-bool InputMap::event_is_action(const InputEvent &p_event, const StringName &p_action) const {
+bool InputMap::event_is_action(const Ref<InputEvent> &p_event, const StringName &p_action) const {
Map<StringName, Action>::Element *E = input_map.find(p_action);
if (!E) {
@@ -218,9 +172,9 @@ bool InputMap::event_is_action(const InputEvent &p_event, const StringName &p_ac
ERR_FAIL_COND_V(!E, false);
}
- if (p_event.type == InputEvent::ACTION) {
-
- return p_event.action.action == E->get().id;
+ Ref<InputEventAction> iea = p_event;
+ if (iea.is_valid()) {
+ return iea->get_action() == p_action;
}
return _find_event(E->get().inputs, p_event, true) != NULL;
@@ -235,7 +189,7 @@ void InputMap::load_from_globals() {
input_map.clear();
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
const PropertyInfo &pi = E->get();
@@ -247,12 +201,12 @@ void InputMap::load_from_globals() {
add_action(name);
- Array va = GlobalConfig::get_singleton()->get(pi.name);
+ Array va = ProjectSettings::get_singleton()->get(pi.name);
for (int i = 0; i < va.size(); i++) {
- InputEvent ie = va[i];
- if (ie.type == InputEvent::NONE)
+ Ref<InputEvent> ie = va[i];
+ if (ie.is_null())
continue;
action_add_event(name, ie);
}
@@ -261,60 +215,73 @@ void InputMap::load_from_globals() {
void InputMap::load_default() {
- InputEvent key;
- key.type = InputEvent::KEY;
+ Ref<InputEventKey> key;
add_action("ui_accept");
- key.key.scancode = KEY_RETURN;
+ key.instance();
+ key->set_scancode(KEY_ENTER);
action_add_event("ui_accept", key);
- key.key.scancode = KEY_ENTER;
+
+ key.instance();
+ key->set_scancode(KEY_KP_ENTER);
action_add_event("ui_accept", key);
- key.key.scancode = KEY_SPACE;
+
+ key.instance();
+ key->set_scancode(KEY_SPACE);
action_add_event("ui_accept", key);
add_action("ui_select");
- key.key.scancode = KEY_SPACE;
+ key.instance();
+ key->set_scancode(KEY_SPACE);
action_add_event("ui_select", key);
add_action("ui_cancel");
- key.key.scancode = KEY_ESCAPE;
+ key.instance();
+ key->set_scancode(KEY_ESCAPE);
action_add_event("ui_cancel", key);
add_action("ui_focus_next");
- key.key.scancode = KEY_TAB;
+ key.instance();
+ key->set_scancode(KEY_TAB);
action_add_event("ui_focus_next", key);
add_action("ui_focus_prev");
- key.key.scancode = KEY_TAB;
- key.key.mod.shift = true;
+ key.instance();
+ key->set_scancode(KEY_TAB);
+ key->set_shift(true);
action_add_event("ui_focus_prev", key);
- key.key.mod.shift = false;
add_action("ui_left");
- key.key.scancode = KEY_LEFT;
+ key.instance();
+ key->set_scancode(KEY_LEFT);
action_add_event("ui_left", key);
add_action("ui_right");
- key.key.scancode = KEY_RIGHT;
+ key.instance();
+ key->set_scancode(KEY_RIGHT);
action_add_event("ui_right", key);
add_action("ui_up");
- key.key.scancode = KEY_UP;
+ key.instance();
+ key->set_scancode(KEY_UP);
action_add_event("ui_up", key);
add_action("ui_down");
- key.key.scancode = KEY_DOWN;
+ key.instance();
+ key->set_scancode(KEY_DOWN);
action_add_event("ui_down", key);
add_action("ui_page_up");
- key.key.scancode = KEY_PAGEUP;
+ key.instance();
+ key->set_scancode(KEY_PAGEUP);
action_add_event("ui_page_up", key);
add_action("ui_page_down");
- key.key.scancode = KEY_PAGEDOWN;
+ key.instance();
+ key->set_scancode(KEY_PAGEDOWN);
action_add_event("ui_page_down", key);
- //set("display/handheld/orientation", "landscape");
+ //set("display/window/handheld/orientation", "landscape");
}
InputMap::InputMap() {
diff --git a/core/input_map.h b/core/input_map.h
index 25d0c3e1b9..ba93e61f5f 100644
--- a/core/input_map.h
+++ b/core/input_map.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,6 +31,7 @@
#define INPUT_MAP_H
#include "object.h"
+#include "os/input_event.h"
class InputMap : public Object {
@@ -38,16 +40,15 @@ class InputMap : public Object {
public:
struct Action {
int id;
- List<InputEvent> inputs;
+ List<Ref<InputEvent> > inputs;
};
private:
static InputMap *singleton;
mutable Map<StringName, Action> input_map;
- mutable Map<int, StringName> input_id_map;
- List<InputEvent>::Element *_find_event(List<InputEvent> &p_list, const InputEvent &p_event, bool p_action_test = false) const;
+ List<Ref<InputEvent> >::Element *_find_event(List<Ref<InputEvent> > &p_list, const Ref<InputEvent> &p_event, bool p_action_test = false) const;
Array _get_action_list(const StringName &p_action);
Array _get_actions();
@@ -59,18 +60,16 @@ public:
static _FORCE_INLINE_ InputMap *get_singleton() { return singleton; }
bool has_action(const StringName &p_action) const;
- int get_action_id(const StringName &p_action) const;
- StringName get_action_from_id(int p_id) const;
List<StringName> get_actions() const;
void add_action(const StringName &p_action);
void erase_action(const StringName &p_action);
- void action_add_event(const StringName &p_action, const InputEvent &p_event);
- bool action_has_event(const StringName &p_action, const InputEvent &p_event);
- void action_erase_event(const StringName &p_action, const InputEvent &p_event);
+ void action_add_event(const StringName &p_action, const Ref<InputEvent> &p_event);
+ bool action_has_event(const StringName &p_action, const Ref<InputEvent> &p_event);
+ void action_erase_event(const StringName &p_action, const Ref<InputEvent> &p_event);
- const List<InputEvent> *get_action_list(const StringName &p_action);
- bool event_is_action(const InputEvent &p_event, const StringName &p_action) const;
+ const List<Ref<InputEvent> > *get_action_list(const StringName &p_action);
+ bool event_is_action(const Ref<InputEvent> &p_event, const StringName &p_action) const;
const Map<StringName, Action> &get_action_map() const;
void load_from_globals();
diff --git a/core/int_types.h b/core/int_types.h
index 50ce38a3ba..973e0c749d 100644
--- a/core/int_types.h
+++ b/core/int_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/SCsub b/core/io/SCsub
index 6789aa8bc6..4efc902717 100644
--- a/core/io/SCsub
+++ b/core/io/SCsub
@@ -3,7 +3,5 @@
Import('env')
env.add_source_files(env.core_sources, "*.cpp")
-env.add_source_files(env.core_sources, "*.c")
-# env.core_sources.append("io/fastlz.c")
Export('env')
diff --git a/core/io/compression.cpp b/core/io/compression.cpp
index 25fd2ad2ee..139383710c 100644
--- a/core/io/compression.cpp
+++ b/core/io/compression.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,11 +29,14 @@
/*************************************************************************/
#include "compression.h"
#include "os/copymem.h"
-#include "zlib.h"
-
-#include "fastlz.h"
+#include "project_settings.h"
#include "zip_io.h"
+#include "thirdparty/misc/fastlz.h"
+#include "thirdparty/zstd/zstd.h"
+
+#include <zlib.h>
+
int Compression::compress(uint8_t *p_dst, const uint8_t *p_src, int p_src_size, Mode p_mode) {
switch (p_mode) {
@@ -48,22 +52,22 @@ int Compression::compress(uint8_t *p_dst, const uint8_t *p_src, int p_src_size,
}
} break;
- case MODE_DEFLATE: {
+ case MODE_DEFLATE:
+ case MODE_GZIP: {
+
+ int window_bits = p_mode == MODE_DEFLATE ? 15 : 15 + 16;
z_stream strm;
strm.zalloc = zipio_alloc;
strm.zfree = zipio_free;
strm.opaque = Z_NULL;
- int err = deflateInit(&strm, Z_DEFAULT_COMPRESSION);
+ int level = p_mode == MODE_DEFLATE ? zlib_level : gzip_level;
+ int err = deflateInit2(&strm, level, Z_DEFLATED, window_bits, 8, Z_DEFAULT_STRATEGY);
if (err != Z_OK)
return -1;
strm.avail_in = p_src_size;
int aout = deflateBound(&strm, p_src_size);
- /*if (aout>p_src_size) {
- deflateEnd(&strm);
- return -1;
- }*/
strm.avail_out = aout;
strm.next_in = (Bytef *)p_src;
strm.next_out = p_dst;
@@ -73,6 +77,11 @@ int Compression::compress(uint8_t *p_dst, const uint8_t *p_src, int p_src_size,
return aout;
} break;
+ case MODE_ZSTD: {
+
+ int max_dst_size = get_max_compressed_buffer_size(p_src_size, MODE_ZSTD);
+ return ZSTD_compress(p_dst, max_dst_size, p_src, p_src_size, zstd_level);
+ } break;
}
ERR_FAIL_V(-1);
@@ -89,19 +98,26 @@ int Compression::get_max_compressed_buffer_size(int p_src_size, Mode p_mode) {
return ss;
} break;
- case MODE_DEFLATE: {
+ case MODE_DEFLATE:
+ case MODE_GZIP: {
+
+ int window_bits = p_mode == MODE_DEFLATE ? 15 : 15 + 16;
z_stream strm;
strm.zalloc = zipio_alloc;
strm.zfree = zipio_free;
strm.opaque = Z_NULL;
- int err = deflateInit(&strm, Z_DEFAULT_COMPRESSION);
+ int err = deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, window_bits, 8, Z_DEFAULT_STRATEGY);
if (err != Z_OK)
return -1;
int aout = deflateBound(&strm, p_src_size);
deflateEnd(&strm);
return aout;
} break;
+ case MODE_ZSTD: {
+
+ return ZSTD_compressBound(p_src_size);
+ } break;
}
ERR_FAIL_V(-1);
@@ -123,7 +139,10 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_max_size, const uint8_t *p
}
return ret_size;
} break;
- case MODE_DEFLATE: {
+ case MODE_DEFLATE:
+ case MODE_GZIP: {
+
+ int window_bits = p_mode == MODE_DEFLATE ? 15 : 15 + 16;
z_stream strm;
strm.zalloc = zipio_alloc;
@@ -131,7 +150,7 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_max_size, const uint8_t *p
strm.opaque = Z_NULL;
strm.avail_in = 0;
strm.next_in = Z_NULL;
- int err = inflateInit(&strm);
+ int err = inflateInit2(&strm, window_bits);
ERR_FAIL_COND_V(err != Z_OK, -1);
strm.avail_in = p_src_size;
@@ -145,7 +164,15 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_max_size, const uint8_t *p
ERR_FAIL_COND_V(err != Z_STREAM_END, -1);
return total;
} break;
+ case MODE_ZSTD: {
+
+ return ZSTD_decompress(p_dst, p_dst_max_size, p_src, p_src_size);
+ } break;
}
ERR_FAIL_V(-1);
}
+
+int Compression::zlib_level = Z_DEFAULT_COMPRESSION;
+int Compression::gzip_level = Z_DEFAULT_COMPRESSION;
+int Compression::zstd_level = 3;
diff --git a/core/io/compression.h b/core/io/compression.h
index 5156919867..5eb7806d7b 100644
--- a/core/io/compression.h
+++ b/core/io/compression.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,15 +33,22 @@
#include "typedefs.h"
class Compression {
+
public:
+ static int zlib_level;
+ static int gzip_level;
+ static int zstd_level;
+
enum Mode {
MODE_FASTLZ,
- MODE_DEFLATE
+ MODE_DEFLATE,
+ MODE_ZSTD,
+ MODE_GZIP
};
- static int compress(uint8_t *p_dst, const uint8_t *p_src, int p_src_size, Mode p_mode = MODE_FASTLZ);
- static int get_max_compressed_buffer_size(int p_src_size, Mode p_mode = MODE_FASTLZ);
- static int decompress(uint8_t *p_dst, int p_dst_max_size, const uint8_t *p_src, int p_src_size, Mode p_mode = MODE_FASTLZ);
+ static int compress(uint8_t *p_dst, const uint8_t *p_src, int p_src_size, Mode p_mode = MODE_ZSTD);
+ static int get_max_compressed_buffer_size(int p_src_size, Mode p_mode = MODE_ZSTD);
+ static int decompress(uint8_t *p_dst, int p_dst_max_size, const uint8_t *p_src, int p_src_size, Mode p_mode = MODE_ZSTD);
Compression();
};
diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp
index 6560302083..edd090adf2 100644
--- a/core/io/config_file.cpp
+++ b/core/io/config_file.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -204,7 +205,7 @@ Error ConfigFile::load(const String &p_path) {
void ConfigFile::_bind_methods() {
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(D_METHOD("get_value", "section", "key", "default"), &ConfigFile::get_value, DEFVAL(Variant()));
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);
@@ -214,8 +215,8 @@ void ConfigFile::_bind_methods() {
ClassDB::bind_method(D_METHOD("erase_section", "section"), &ConfigFile::erase_section);
- ClassDB::bind_method(D_METHOD("load:Error", "path"), &ConfigFile::load);
- ClassDB::bind_method(D_METHOD("save:Error", "path"), &ConfigFile::save);
+ ClassDB::bind_method(D_METHOD("load", "path"), &ConfigFile::load);
+ ClassDB::bind_method(D_METHOD("save", "path"), &ConfigFile::save);
}
ConfigFile::ConfigFile() {
diff --git a/core/io/config_file.h b/core/io/config_file.h
index 4d179bd137..75a3a519a6 100644
--- a/core/io/config_file.h
+++ b/core/io/config_file.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/file_access_buffered.cpp b/core/io/file_access_buffered.cpp
index dd4d3e6e8f..126ec7575e 100644
--- a/core/io/file_access_buffered.cpp
+++ b/core/io/file_access_buffered.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -105,11 +106,11 @@ uint8_t FileAccessBuffered::get_8() const {
return byte;
};
-int FileAccessBuffered::get_buffer(uint8_t *p_dest, int p_elements) const {
+int FileAccessBuffered::get_buffer(uint8_t *p_dest, int p_length) const {
ERR_FAIL_COND_V(!file.open, -1);
- if (p_elements > cache_size) {
+ if (p_length > cache_size) {
int total_read = 0;
@@ -121,12 +122,12 @@ int FileAccessBuffered::get_buffer(uint8_t *p_dest, int p_elements) const {
//memcpy(p_dest, read.ptr() + (file.offset - cache.offset), size);
memcpy(p_dest, cache.buffer.ptr() + (file.offset - cache.offset), size);
p_dest += size;
- p_elements -= size;
+ p_length -= size;
file.offset += size;
total_read += size;
};
- int err = read_data_block(file.offset, p_elements, p_dest);
+ int err = read_data_block(file.offset, p_length, p_dest);
if (err >= 0) {
total_read += err;
file.offset += err;
@@ -135,7 +136,7 @@ int FileAccessBuffered::get_buffer(uint8_t *p_dest, int p_elements) const {
return total_read;
};
- int to_read = p_elements;
+ int to_read = p_length;
int total_read = 0;
while (to_read > 0) {
@@ -160,7 +161,7 @@ int FileAccessBuffered::get_buffer(uint8_t *p_dest, int p_elements) const {
to_read -= r;
};
- return p_elements;
+ return p_length;
};
bool FileAccessBuffered::is_open() const {
diff --git a/core/io/file_access_buffered.h b/core/io/file_access_buffered.h
index 964152af5e..0ad2d0e929 100644
--- a/core/io/file_access_buffered.h
+++ b/core/io/file_access_buffered.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -80,7 +81,7 @@ public:
virtual bool eof_reached() const;
virtual uint8_t get_8() const;
- virtual int get_buffer(uint8_t *p_dst, int p_length) const; ///< get an array of bytes
+ virtual int get_buffer(uint8_t *p_dest, int p_length) const; ///< get an array of bytes
virtual bool is_open() const;
diff --git a/core/io/file_access_buffered_fa.h b/core/io/file_access_buffered_fa.h
index dd1e99f8f6..362589adf1 100644
--- a/core/io/file_access_buffered_fa.h
+++ b/core/io/file_access_buffered_fa.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp
index d8ae3e6ff1..4e802579c6 100644
--- a/core/io/file_access_compressed.cpp
+++ b/core/io/file_access_compressed.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -368,7 +369,7 @@ FileAccessCompressed::FileAccessCompressed() {
f = NULL;
magic = "GCMP";
block_size = 16384;
- cmode = Compression::MODE_DEFLATE;
+ cmode = Compression::MODE_ZSTD;
writing = false;
write_ptr = 0;
write_buffer_size = 0;
diff --git a/core/io/file_access_compressed.h b/core/io/file_access_compressed.h
index ea45c110d2..340c298a0f 100644
--- a/core/io/file_access_compressed.h
+++ b/core/io/file_access_compressed.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -63,7 +64,7 @@ class FileAccessCompressed : public FileAccess {
FileAccess *f;
public:
- void configure(const String &p_magic, Compression::Mode p_mode = Compression::MODE_FASTLZ, int p_block_size = 4096);
+ void configure(const String &p_magic, Compression::Mode p_mode = Compression::MODE_ZSTD, int p_block_size = 4096);
Error open_after_magic(FileAccess *p_base);
diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp
index 03700cad48..f2b33a01bb 100644
--- a/core/io/file_access_encrypted.cpp
+++ b/core/io/file_access_encrypted.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,15 +28,18 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "file_access_encrypted.h"
-#include "aes256.h"
-#include "md5.h"
+
+#include "core/variant.h"
#include "os/copymem.h"
#include "print_string.h"
-#define COMP_MAGIC 0x43454447
-#include "core/variant.h"
+#include "thirdparty/misc/aes256.h"
+#include "thirdparty/misc/md5.h"
+
#include <stdio.h>
+#define COMP_MAGIC 0x43454447
+
Error FileAccessEncrypted::open_and_parse(FileAccess *p_base, const Vector<uint8_t> &p_key, Mode p_mode) {
//print_line("open and parse!");
diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h
index ac4d2bd1c7..2bd3c52661 100644
--- a/core/io/file_access_encrypted.h
+++ b/core/io/file_access_encrypted.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp
index 966109bfe1..8e719568e5 100644
--- a/core/io/file_access_memory.cpp
+++ b/core/io/file_access_memory.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,10 +29,10 @@
/*************************************************************************/
#include "file_access_memory.h"
-#include "global_config.h"
#include "map.h"
#include "os/copymem.h"
#include "os/dir_access.h"
+#include "project_settings.h"
static Map<String, Vector<uint8_t> > *files = NULL;
@@ -42,8 +43,8 @@ void FileAccessMemory::register_file(String p_name, Vector<uint8_t> p_data) {
}
String name;
- if (GlobalConfig::get_singleton())
- name = GlobalConfig::get_singleton()->globalize_path(p_name);
+ if (ProjectSettings::get_singleton())
+ name = ProjectSettings::get_singleton()->globalize_path(p_name);
else
name = p_name;
//name = DirAccess::normalize_path(name);
diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h
index 687e3e9bee..ea858c547e 100644
--- a/core/io/file_access_memory.h
+++ b/core/io/file_access_memory.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -61,7 +62,7 @@ public:
virtual Error get_error() const; ///< get last error
- virtual void store_8(uint8_t p_dest); ///< store a byte
+ virtual void store_8(uint8_t p_byte); ///< store a byte
virtual void store_buffer(const uint8_t *p_src, int p_length); ///< store an array of bytes
virtual bool file_exists(const String &p_name); ///< return true if a file exists
diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp
index 9120b55565..aa67479d7e 100644
--- a/core/io/file_access_network.cpp
+++ b/core/io/file_access_network.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,10 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "file_access_network.h"
-#include "global_config.h"
#include "io/ip.h"
#include "marshalls.h"
#include "os/os.h"
+#include "project_settings.h"
//#define DEBUG_PRINT(m_p) print_line(m_p)
//#define DEBUG_TIME(m_what) printf("MS: %s - %lli\n",m_what,OS::get_singleton()->get_ticks_usec());
diff --git a/core/io/file_access_network.h b/core/io/file_access_network.h
index bb3d22c1e9..1e85756122 100644
--- a/core/io/file_access_network.h
+++ b/core/io/file_access_network.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp
index 91d256ee2b..c3bcfc840b 100644
--- a/core/io/file_access_pack.cpp
+++ b/core/io/file_access_pack.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -307,10 +308,9 @@ bool FileAccessPack::file_exists(const String &p_name) {
return false;
}
-FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file) {
-
- pf = p_file;
- f = FileAccess::open(pf.pack, FileAccess::READ);
+FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file)
+ : pf(p_file),
+ f(FileAccess::open(pf.pack, FileAccess::READ)) {
if (!f) {
ERR_EXPLAIN("Can't open pack-referenced file: " + String(pf.pack));
ERR_FAIL_COND(!f);
@@ -439,13 +439,12 @@ Error DirAccessPack::change_dir(String p_dir) {
String DirAccessPack::get_current_dir() {
- String p;
PackedData::PackedDir *pd = current;
- while (pd->parent) {
+ String p = current->name;
- if (pd != current)
- p = "/" + p;
- p = p + pd->name;
+ while (pd->parent) {
+ pd = pd->parent;
+ p = pd->name + "/" + p;
}
return "res://" + p;
diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h
index d16f5c461e..25473131d6 100644
--- a/core/io/file_access_pack.h
+++ b/core/io/file_access_pack.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp
index 4cc2edd1c3..d748d5c773 100644
--- a/core/io/file_access_zip.cpp
+++ b/core/io/file_access_zip.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -149,8 +150,7 @@ unzFile ZipArchive::get_file_handle(String p_file) const {
unzFile pkg = unzOpen2(packages[file.package].filename.utf8().get_data(), &io);
ERR_FAIL_COND_V(!pkg, NULL);
int unz_err = unzGoToFilePos(pkg, &file.file_pos);
- ERR_FAIL_COND_V(unz_err != UNZ_OK, NULL);
- if (unzOpenCurrentFile(pkg) != UNZ_OK) {
+ if (unz_err != UNZ_OK || unzOpenCurrentFile(pkg) != UNZ_OK) {
unzClose(pkg);
ERR_FAIL_V(NULL);
@@ -159,15 +159,15 @@ unzFile ZipArchive::get_file_handle(String p_file) const {
return pkg;
};
-bool ZipArchive::try_open_pack(const String &p_name) {
+bool ZipArchive::try_open_pack(const String &p_path) {
//printf("opening zip pack %ls, %i, %i\n", p_name.c_str(), p_name.extension().nocasecmp_to("zip"), p_name.extension().nocasecmp_to("pcz"));
- if (p_name.get_extension().nocasecmp_to("zip") != 0 && p_name.get_extension().nocasecmp_to("pcz") != 0)
+ if (p_path.get_extension().nocasecmp_to("zip") != 0 && p_path.get_extension().nocasecmp_to("pcz") != 0)
return false;
zlib_filefunc_def io;
- FileAccess *f = FileAccess::open(p_name, FileAccess::READ);
+ FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
if (!f)
return false;
io.opaque = f;
@@ -180,7 +180,7 @@ bool ZipArchive::try_open_pack(const String &p_name) {
io.zclose_file = godot_close;
io.zerror_file = godot_testerror;
- unzFile zfile = unzOpen2(p_name.utf8().get_data(), &io);
+ unzFile zfile = unzOpen2(p_path.utf8().get_data(), &io);
ERR_FAIL_COND_V(!zfile, false);
unz_global_info64 gi;
@@ -188,7 +188,7 @@ bool ZipArchive::try_open_pack(const String &p_name) {
ERR_FAIL_COND_V(err != UNZ_OK, false);
Package pkg;
- pkg.filename = p_name;
+ pkg.filename = p_path;
pkg.zfile = zfile;
packages.push_back(pkg);
int pkg_num = packages.size() - 1;
@@ -209,7 +209,7 @@ bool ZipArchive::try_open_pack(const String &p_name) {
files[fname] = f;
uint8_t md5[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- PackedData::get_singleton()->add_path(p_name, fname, 1, 0, md5, this);
+ PackedData::get_singleton()->add_path(p_path, fname, 1, 0, md5, this);
//printf("packed data add path %ls, %ls\n", p_name.c_str(), fname.c_str());
if ((i + 1) < gi.number_entry) {
diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h
index 7d5be8678d..c9cc2dac79 100644
--- a/core/io/file_access_zip.h
+++ b/core/io/file_access_zip.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,7 +34,9 @@
#include "core/io/file_access_pack.h"
#include "map.h"
-#include "unzip.h"
+
+#include "thirdparty/minizip/unzip.h"
+
#include <stdlib.h>
class ZipArchive : public PackSource {
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index be5309ddfa..4d5b88cfa1 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -95,7 +96,12 @@ Error HTTPClient::request_raw(Method p_method, const String &p_url, const Vector
};
String request = String(_methods[p_method]) + " " + p_url + " HTTP/1.1\r\n";
- request += "Host: " + conn_host + ":" + itos(conn_port) + "\r\n";
+ if ((ssl && conn_port == 443) || (!ssl && conn_port == 80)) {
+ // don't append the standard ports
+ request += "Host: " + conn_host + "\r\n";
+ } else {
+ request += "Host: " + conn_host + ":" + itos(conn_port) + "\r\n";
+ }
bool add_clen = p_body.size() > 0;
for (int i = 0; i < p_headers.size(); i++) {
request += p_headers[i] + "\r\n";
@@ -150,7 +156,12 @@ Error HTTPClient::request(Method p_method, const String &p_url, const Vector<Str
};
String request = String(_methods[p_method]) + " " + p_url + " HTTP/1.1\r\n";
- request += "Host: " + conn_host + ":" + itos(conn_port) + "\r\n";
+ if ((ssl && conn_port == 443) || (!ssl && conn_port == 80)) {
+ // don't append the standard ports
+ request += "Host: " + conn_host + "\r\n";
+ } else {
+ request += "Host: " + conn_host + ":" + itos(conn_port) + "\r\n";
+ }
bool add_clen = p_body.length() > 0;
for (int i = 0; i < p_headers.size(); i++) {
request += p_headers[i] + "\r\n";
@@ -613,9 +624,9 @@ Error HTTPClient::_get_http_data(uint8_t *p_buffer, int p_bytes, int &r_received
void HTTPClient::_bind_methods() {
- 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("connect_to_host", "host", "port", "use_ssl", "verify_host"), &HTTPClient::connect_to_host, DEFVAL(false), DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("set_connection", "connection"), &HTTPClient::set_connection);
+ ClassDB::bind_method(D_METHOD("get_connection"), &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);
@@ -635,9 +646,9 @@ void HTTPClient::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_blocking_mode_enabled"), &HTTPClient::is_blocking_mode_enabled);
ClassDB::bind_method(D_METHOD("get_status"), &HTTPClient::get_status);
- ClassDB::bind_method(D_METHOD("poll:Error"), &HTTPClient::poll);
+ ClassDB::bind_method(D_METHOD("poll"), &HTTPClient::poll);
- ClassDB::bind_method(D_METHOD("query_string_from_dict:String", "fields"), &HTTPClient::query_string_from_dict);
+ ClassDB::bind_method(D_METHOD("query_string_from_dict", "fields"), &HTTPClient::query_string_from_dict);
BIND_CONSTANT(METHOD_GET);
BIND_CONSTANT(METHOD_HEAD);
diff --git a/core/io/http_client.h b/core/io/http_client.h
index e2b0e9ccea..3cee1e0c6b 100644
--- a/core/io/http_client.h
+++ b/core/io/http_client.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp
index 5f88ca65e3..23719940be 100644
--- a/core/io/image_loader.cpp
+++ b/core/io/image_loader.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -42,7 +43,8 @@ bool ImageFormatLoader::recognize(const String &p_extension) const {
return false;
}
-Error ImageLoader::load_image(String p_file, Image *p_image, FileAccess *p_custom) {
+Error ImageLoader::load_image(String p_file, Ref<Image> p_image, FileAccess *p_custom, bool p_force_linear) {
+ ERR_FAIL_COND_V(p_image.is_null(), ERR_INVALID_PARAMETER);
FileAccess *f = p_custom;
if (!f) {
@@ -60,7 +62,7 @@ Error ImageLoader::load_image(String p_file, Image *p_image, FileAccess *p_custo
if (!loader[i]->recognize(extension))
continue;
- Error err = loader[i]->load_image(p_image, f);
+ Error err = loader[i]->load_image(p_image, f, p_force_linear);
if (err != ERR_FILE_UNRECOGNIZED) {
diff --git a/core/io/image_loader.h b/core/io/image_loader.h
index b70170303d..e528d1423b 100644
--- a/core/io/image_loader.h
+++ b/core/io/image_loader.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -55,7 +56,7 @@ class ImageFormatLoader {
friend class ImageLoader;
protected:
- virtual Error load_image(Image *p_image, FileAccess *p_fileaccess) = 0;
+ virtual Error load_image(Ref<Image> p_image, FileAccess *p_fileaccess, bool p_force_linear) = 0;
virtual void get_recognized_extensions(List<String> *p_extensions) const = 0;
bool recognize(const String &p_extension) const;
@@ -74,7 +75,7 @@ class ImageLoader {
protected:
public:
- static Error load_image(String p_file, Image *p_image, FileAccess *p_custom = NULL);
+ static Error load_image(String p_file, Ref<Image> p_image, FileAccess *p_custom = NULL, bool p_force_linear = false);
static void get_recognized_extensions(List<String> *p_extensions);
static bool recognize(const String &p_extension);
diff --git a/core/io/ip.cpp b/core/io/ip.cpp
index 6713963495..c869bdad9b 100644
--- a/core/io/ip.cpp
+++ b/core/io/ip.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -67,6 +68,7 @@ struct _IP_ResolverPrivate {
return IP::RESOLVER_INVALID_ID;
}
+ Mutex *mutex;
Semaphore *sem;
Thread *thread;
@@ -95,8 +97,10 @@ struct _IP_ResolverPrivate {
while (!ipr->thread_abort) {
ipr->sem->wait();
- GLOBAL_LOCK_FUNCTION;
+
+ ipr->mutex->lock();
ipr->resolve_queues();
+ ipr->mutex->unlock();
}
}
@@ -109,24 +113,30 @@ struct _IP_ResolverPrivate {
IP_Address IP::resolve_hostname(const String &p_hostname, IP::Type p_type) {
- GLOBAL_LOCK_FUNCTION;
+ resolver->mutex->lock();
String key = _IP_ResolverPrivate::get_cache_key(p_hostname, p_type);
- if (resolver->cache.has(key))
- return resolver->cache[key];
+ if (resolver->cache.has(key)) {
+ IP_Address res = resolver->cache[key];
+ resolver->mutex->unlock();
+ return res;
+ }
IP_Address res = _resolve_hostname(p_hostname, p_type);
resolver->cache[key] = res;
+ resolver->mutex->unlock();
return res;
}
+
IP::ResolverID IP::resolve_hostname_queue_item(const String &p_hostname, IP::Type p_type) {
- GLOBAL_LOCK_FUNCTION;
+ resolver->mutex->lock();
ResolverID id = resolver->find_empty_id();
if (id == RESOLVER_INVALID_ID) {
WARN_PRINT("Out of resolver queries");
+ resolver->mutex->unlock();
return id;
}
@@ -145,6 +155,7 @@ IP::ResolverID IP::resolve_hostname_queue_item(const String &p_hostname, IP::Typ
resolver->resolve_queues();
}
+ resolver->mutex->unlock();
return id;
}
@@ -152,35 +163,51 @@ IP::ResolverStatus IP::get_resolve_item_status(ResolverID p_id) const {
ERR_FAIL_INDEX_V(p_id, IP::RESOLVER_MAX_QUERIES, IP::RESOLVER_STATUS_NONE);
- GLOBAL_LOCK_FUNCTION;
- ERR_FAIL_COND_V(resolver->queue[p_id].status == IP::RESOLVER_STATUS_NONE, IP::RESOLVER_STATUS_NONE);
+ resolver->mutex->lock();
+ if (resolver->queue[p_id].status == IP::RESOLVER_STATUS_NONE) {
+ ERR_PRINT("Condition status == IP::RESOLVER_STATUS_NONE");
+ resolver->mutex->unlock();
+ return IP::RESOLVER_STATUS_NONE;
+ }
+ IP::ResolverStatus res = resolver->queue[p_id].status;
- return resolver->queue[p_id].status;
+ resolver->mutex->unlock();
+ return res;
}
+
IP_Address IP::get_resolve_item_address(ResolverID p_id) const {
ERR_FAIL_INDEX_V(p_id, IP::RESOLVER_MAX_QUERIES, IP_Address());
- GLOBAL_LOCK_FUNCTION;
+ resolver->mutex->lock();
if (resolver->queue[p_id].status != IP::RESOLVER_STATUS_DONE) {
- ERR_EXPLAIN("Resolve of '" + resolver->queue[p_id].hostname + "'' didn't complete yet.");
- ERR_FAIL_COND_V(resolver->queue[p_id].status != IP::RESOLVER_STATUS_DONE, IP_Address());
+ ERR_PRINTS("Resolve of '" + resolver->queue[p_id].hostname + "'' didn't complete yet.");
+ resolver->mutex->unlock();
+ return IP_Address();
}
- return resolver->queue[p_id].response;
+ IP_Address res = resolver->queue[p_id].response;
+
+ resolver->mutex->unlock();
+ return res;
}
+
void IP::erase_resolve_item(ResolverID p_id) {
ERR_FAIL_INDEX(p_id, IP::RESOLVER_MAX_QUERIES);
- GLOBAL_LOCK_FUNCTION;
+ resolver->mutex->lock();
resolver->queue[p_id].status = IP::RESOLVER_STATUS_NONE;
+
+ resolver->mutex->unlock();
}
void IP::clear_cache(const String &p_hostname) {
+ resolver->mutex->lock();
+
if (p_hostname.empty()) {
resolver->cache.clear();
} else {
@@ -189,7 +216,9 @@ void IP::clear_cache(const String &p_hostname) {
resolver->cache.erase(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_IPV6));
resolver->cache.erase(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_ANY));
}
-};
+
+ resolver->mutex->unlock();
+}
Array IP::_get_local_addresses() const {
@@ -211,7 +240,7 @@ void IP::_bind_methods() {
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(""));
+ ClassDB::bind_method(D_METHOD("clear_cache", "hostname"), &IP::clear_cache, DEFVAL(""));
BIND_CONSTANT(RESOLVER_STATUS_NONE);
BIND_CONSTANT(RESOLVER_STATUS_WAITING);
@@ -248,12 +277,11 @@ IP::IP() {
singleton = this;
resolver = memnew(_IP_ResolverPrivate);
resolver->sem = NULL;
+ resolver->mutex = Mutex::create();
#ifndef NO_THREADS
- //resolver->sem = Semaphore::create();
-
- resolver->sem = NULL;
+ resolver->sem = Semaphore::create();
if (resolver->sem) {
resolver->thread_abort = false;
@@ -280,7 +308,9 @@ IP::~IP() {
memdelete(resolver->thread);
memdelete(resolver->sem);
}
- memdelete(resolver);
#endif
+
+ memdelete(resolver->mutex);
+ memdelete(resolver);
}
diff --git a/core/io/ip.h b/core/io/ip.h
index 052a0e08cc..66a4a48da2 100644
--- a/core/io/ip.h
+++ b/core/io/ip.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/ip_address.cpp b/core/io/ip_address.cpp
index fa0eab4f0d..ea3041945c 100644
--- a/core/io/ip_address.cpp
+++ b/core/io/ip_address.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/ip_address.h b/core/io/ip_address.h
index 52d6974d5e..da16622a9b 100644
--- a/core/io/ip_address.h
+++ b/core/io/ip_address.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -74,7 +75,7 @@ public:
void set_ipv4(const uint8_t *p_ip);
const uint8_t *get_ipv6() const;
- void set_ipv6(const uint8_t *buf);
+ void set_ipv6(const uint8_t *p_buf);
operator String() const;
IP_Address(const String &p_string);
diff --git a/core/io/json.cpp b/core/io/json.cpp
index 98d48ce4ae..d537061c5b 100644
--- a/core/io/json.cpp
+++ b/core/io/json.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -93,15 +94,15 @@ String JSON::print(const Variant &p_var) {
return _print_var(p_var);
}
-Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_token, int &line, String &r_err_str) {
+Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_token, int &line, String &r_err_str) {
while (p_len > 0) {
- switch (p_str[idx]) {
+ switch (p_str[index]) {
case '\n': {
line++;
- idx++;
+ index++;
break;
};
case 0: {
@@ -111,54 +112,54 @@ Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_toke
case '{': {
r_token.type = TK_CURLY_BRACKET_OPEN;
- idx++;
+ index++;
return OK;
};
case '}': {
r_token.type = TK_CURLY_BRACKET_CLOSE;
- idx++;
+ index++;
return OK;
};
case '[': {
r_token.type = TK_BRACKET_OPEN;
- idx++;
+ index++;
return OK;
};
case ']': {
r_token.type = TK_BRACKET_CLOSE;
- idx++;
+ index++;
return OK;
};
case ':': {
r_token.type = TK_COLON;
- idx++;
+ index++;
return OK;
};
case ',': {
r_token.type = TK_COMMA;
- idx++;
+ index++;
return OK;
};
case '"': {
- idx++;
+ index++;
String str;
while (true) {
- if (p_str[idx] == 0) {
+ if (p_str[index] == 0) {
r_err_str = "Unterminated String";
return ERR_PARSE_ERROR;
- } else if (p_str[idx] == '"') {
- idx++;
+ } else if (p_str[index] == '"') {
+ index++;
break;
- } else if (p_str[idx] == '\\') {
+ } else if (p_str[index] == '\\') {
//escaped characters...
- idx++;
- CharType next = p_str[idx];
+ index++;
+ CharType next = p_str[index];
if (next == 0) {
r_err_str = "Unterminated String";
return ERR_PARSE_ERROR;
@@ -176,7 +177,7 @@ Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_toke
//hexnumbarh - oct is deprecated
for (int j = 0; j < 4; j++) {
- CharType c = p_str[idx + j + 1];
+ CharType c = p_str[index + j + 1];
if (c == 0) {
r_err_str = "Unterminated String";
return ERR_PARSE_ERROR;
@@ -203,7 +204,7 @@ Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_toke
res <<= 4;
res |= v;
}
- idx += 4; //will add at the end anyway
+ index += 4; //will add at the end anyway
} break;
//case '\"': res='\"'; break;
@@ -219,11 +220,11 @@ Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_toke
str += res;
} else {
- if (p_str[idx] == '\n')
+ if (p_str[index] == '\n')
line++;
- str += p_str[idx];
+ str += p_str[index];
}
- idx++;
+ index++;
}
r_token.type = TK_STRING;
@@ -233,28 +234,28 @@ Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_toke
} break;
default: {
- if (p_str[idx] <= 32) {
- idx++;
+ if (p_str[index] <= 32) {
+ index++;
break;
}
- if (p_str[idx] == '-' || (p_str[idx] >= '0' && p_str[idx] <= '9')) {
+ if (p_str[index] == '-' || (p_str[index] >= '0' && p_str[index] <= '9')) {
//a number
const CharType *rptr;
- double number = String::to_double(&p_str[idx], &rptr);
- idx += (rptr - &p_str[idx]);
+ double number = String::to_double(&p_str[index], &rptr);
+ index += (rptr - &p_str[index]);
r_token.type = TK_NUMBER;
r_token.value = number;
return OK;
- } else if ((p_str[idx] >= 'A' && p_str[idx] <= 'Z') || (p_str[idx] >= 'a' && p_str[idx] <= 'z')) {
+ } else if ((p_str[index] >= 'A' && p_str[index] <= 'Z') || (p_str[index] >= 'a' && p_str[index] <= 'z')) {
String id;
- while ((p_str[idx] >= 'A' && p_str[idx] <= 'Z') || (p_str[idx] >= 'a' && p_str[idx] <= 'z')) {
+ while ((p_str[index] >= 'A' && p_str[index] <= 'Z') || (p_str[index] >= 'a' && p_str[index] <= 'z')) {
- id += p_str[idx];
- idx++;
+ id += p_str[index];
+ index++;
}
r_token.type = TK_IDENTIFIER;
diff --git a/core/io/json.h b/core/io/json.h
index afd97c85b5..75df15a077 100644
--- a/core/io/json.h
+++ b/core/io/json.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 927ce31744..8eb40b61d7 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,12 +30,40 @@
#include "marshalls.h"
#include "os/keyboard.h"
#include "print_string.h"
+#include "reference.h"
#include <stdio.h>
#define ENCODE_MASK 0xFF
#define ENCODE_FLAG_64 1 << 16
-Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int *r_len) {
+static Error _decode_string(const uint8_t *&buf, int &len, int *r_len, String &r_string) {
+ ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
+
+ uint32_t strlen = decode_uint32(buf);
+ buf += 4;
+ len -= 4;
+ ERR_FAIL_COND_V((int)strlen > len, ERR_FILE_EOF);
+
+ String str;
+ str.parse_utf8((const char *)buf, strlen);
+ r_string = str;
+
+ //handle padding
+ if (strlen % 4) {
+ strlen += 4 - strlen % 4;
+ }
+
+ buf += strlen;
+ len -= strlen;
+
+ if (r_len) {
+ (*r_len) += 4 + strlen;
+ }
+
+ return OK;
+}
+
+Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int *r_len, bool p_allow_objects) {
const uint8_t *buf = p_buffer;
int len = p_len;
@@ -103,22 +132,12 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
} break;
case Variant::STRING: {
- ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
- uint32_t strlen = decode_uint32(buf);
- buf += 4;
- len -= 4;
- ERR_FAIL_COND_V((int)strlen > len, ERR_INVALID_DATA);
-
String str;
- str.parse_utf8((const char *)buf, strlen);
+ Error err = _decode_string(buf, len, r_len, str);
+ if (err)
+ return err;
r_variant = str;
- if (r_len) {
- if (strlen % 4)
- (*r_len) += 4 - strlen % 4;
- (*r_len) += 4 + strlen;
- }
-
} break;
// math types
@@ -138,8 +157,8 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
ERR_FAIL_COND_V(len < (int)4 * 4, ERR_INVALID_DATA);
Rect2 val;
- val.pos.x = decode_float(&buf[0]);
- val.pos.y = decode_float(&buf[4]);
+ val.position.x = decode_float(&buf[0]);
+ val.position.y = decode_float(&buf[4]);
val.size.x = decode_float(&buf[8]);
val.size.y = decode_float(&buf[12]);
r_variant = val;
@@ -210,9 +229,9 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
ERR_FAIL_COND_V(len < (int)4 * 6, ERR_INVALID_DATA);
Rect3 val;
- val.pos.x = decode_float(&buf[0]);
- val.pos.y = decode_float(&buf[4]);
- val.pos.z = decode_float(&buf[8]);
+ val.position.x = decode_float(&buf[0]);
+ val.position.y = decode_float(&buf[4]);
+ val.position.z = decode_float(&buf[8]);
val.size.x = decode_float(&buf[12]);
val.size.y = decode_float(&buf[16]);
val.size.z = decode_float(&buf[20]);
@@ -275,38 +294,6 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
(*r_len) += 4 * 4;
} break;
- case Variant::IMAGE: {
-
- ERR_FAIL_COND_V(len < (int)5 * 4, ERR_INVALID_DATA);
- Image::Format fmt = (Image::Format)decode_uint32(&buf[0]);
- ERR_FAIL_INDEX_V(fmt, Image::FORMAT_MAX, ERR_INVALID_DATA);
- uint32_t mipmaps = decode_uint32(&buf[4]);
- uint32_t w = decode_uint32(&buf[8]);
- uint32_t h = decode_uint32(&buf[12]);
- uint32_t datalen = decode_uint32(&buf[16]);
-
- Image img;
- if (datalen > 0) {
- len -= 5 * 4;
- ERR_FAIL_COND_V(len < datalen, ERR_INVALID_DATA);
- PoolVector<uint8_t> data;
- data.resize(datalen);
- PoolVector<uint8_t>::Write wr = data.write();
- copymem(&wr[0], &buf[20], datalen);
- wr = PoolVector<uint8_t>::Write();
-
- img = Image(w, h, mipmaps, fmt, data);
- }
-
- r_variant = img;
- if (r_len) {
- if (datalen % 4)
- (*r_len) += 4 - datalen % 4;
-
- (*r_len) += 4 * 5 + datalen;
- }
-
- } break;
case Variant::NODE_PATH: {
ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
@@ -394,67 +381,59 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
} break;
case Variant::OBJECT: {
- r_variant = (Object *)NULL;
- } break;
- case Variant::INPUT_EVENT: {
-
- InputEvent ie;
-
- ie.type = decode_uint32(&buf[0]);
- ie.device = decode_uint32(&buf[4]);
+ ERR_FAIL_COND_V(!p_allow_objects, ERR_UNAUTHORIZED);
- if (r_len)
- (*r_len) += 12;
+ String str;
+ Error err = _decode_string(buf, len, r_len, str);
+ if (err)
+ return err;
- switch (ie.type) {
+ if (str == String()) {
+ r_variant = (Object *)NULL;
+ } else {
- case InputEvent::KEY: {
+ Object *obj = ClassDB::instance(str);
- uint32_t mods = decode_uint32(&buf[12]);
- if (mods & KEY_MASK_SHIFT)
- ie.key.mod.shift = true;
- if (mods & KEY_MASK_CTRL)
- ie.key.mod.control = true;
- if (mods & KEY_MASK_ALT)
- ie.key.mod.alt = true;
- if (mods & KEY_MASK_META)
- ie.key.mod.meta = true;
- ie.key.scancode = decode_uint32(&buf[16]);
+ ERR_FAIL_COND_V(!obj, ERR_UNAVAILABLE);
+ ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
- if (r_len)
- (*r_len) += 8;
+ int32_t count = decode_uint32(buf);
+ buf += 4;
+ len -= 4;
+ if (r_len) {
+ (*r_len) += 4;
+ }
- } break;
- case InputEvent::MOUSE_BUTTON: {
+ for (int i = 0; i < count; i++) {
- ie.mouse_button.button_index = decode_uint32(&buf[12]);
- if (r_len)
- (*r_len) += 4;
+ str = String();
+ err = _decode_string(buf, len, r_len, str);
+ if (err)
+ return err;
- } break;
- case InputEvent::JOYPAD_BUTTON: {
+ Variant value;
+ int used;
+ err = decode_variant(value, buf, len, &used, p_allow_objects);
+ if (err)
+ return err;
- ie.joy_button.button_index = decode_uint32(&buf[12]);
- if (r_len)
- (*r_len) += 4;
- } break;
- case InputEvent::SCREEN_TOUCH: {
+ buf += used;
+ len -= used;
+ if (r_len) {
+ (*r_len) += used;
+ }
- ie.screen_touch.index = decode_uint32(&buf[12]);
- if (r_len)
- (*r_len) += 4;
- } break;
- case InputEvent::JOYPAD_MOTION: {
+ obj->set(str, value);
+ }
- ie.joy_motion.axis = decode_uint32(&buf[12]);
- ie.joy_motion.axis_value = decode_float(&buf[16]);
- if (r_len)
- (*r_len) += 8;
- } break;
+ if (obj->cast_to<Reference>()) {
+ REF ref = REF(obj->cast_to<Reference>());
+ r_variant = ref;
+ } else {
+ r_variant = obj;
+ }
}
- r_variant = ie;
-
} break;
case Variant::DICTIONARY: {
@@ -477,7 +456,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
Variant key, value;
int used;
- Error err = decode_variant(key, buf, len, &used);
+ Error err = decode_variant(key, buf, len, &used, p_allow_objects);
ERR_FAIL_COND_V(err, err);
buf += used;
@@ -486,7 +465,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
(*r_len) += used;
}
- err = decode_variant(value, buf, len, &used);
+ err = decode_variant(value, buf, len, &used, p_allow_objects);
ERR_FAIL_COND_V(err, err);
buf += used;
@@ -521,7 +500,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
int used = 0;
Variant v;
- Error err = decode_variant(v, buf, len, &used);
+ Error err = decode_variant(v, buf, len, &used, p_allow_objects);
ERR_FAIL_COND_V(err, err);
buf += used;
len -= used;
@@ -782,6 +761,21 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
return OK;
}
+static void _encode_string(const String &p_string, uint8_t *&buf, int &r_len) {
+
+ CharString utf8 = p_string.utf8();
+
+ if (buf) {
+ encode_uint32(utf8.length(), buf);
+ buf += 4;
+ copymem(buf, utf8.get_data(), utf8.length());
+ }
+
+ r_len += 4 + utf8.length();
+ while (r_len % 4)
+ r_len++; //pad
+}
+
Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len) {
uint8_t *buf = r_buffer;
@@ -861,7 +855,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len) {
} else {
if (buf) {
- encode_double(p_variant.operator float(), buf);
+ encode_float(p_variant.operator float(), buf);
}
r_len += 4;
@@ -922,17 +916,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len) {
} break;
case Variant::STRING: {
- CharString utf8 = p_variant.operator String().utf8();
-
- if (buf) {
- encode_uint32(utf8.length(), buf);
- buf += 4;
- copymem(buf, utf8.get_data(), utf8.length());
- }
-
- r_len += 4 + utf8.length();
- while (r_len % 4)
- r_len++; //pad
+ _encode_string(p_variant, buf, r_len);
} break;
// math types
@@ -952,8 +936,8 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len) {
if (buf) {
Rect2 r2 = p_variant;
- encode_float(r2.pos.x, &buf[0]);
- encode_float(r2.pos.y, &buf[4]);
+ encode_float(r2.position.x, &buf[0]);
+ encode_float(r2.position.y, &buf[4]);
encode_float(r2.size.x, &buf[8]);
encode_float(r2.size.y, &buf[12]);
}
@@ -1017,9 +1001,9 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len) {
if (buf) {
Rect3 aabb = p_variant;
- encode_float(aabb.pos.x, &buf[0]);
- encode_float(aabb.pos.y, &buf[4]);
- encode_float(aabb.pos.z, &buf[8]);
+ encode_float(aabb.position.x, &buf[0]);
+ encode_float(aabb.position.y, &buf[4]);
+ encode_float(aabb.position.z, &buf[8]);
encode_float(aabb.size.x, &buf[12]);
encode_float(aabb.size.y, &buf[16]);
encode_float(aabb.size.z, &buf[20]);
@@ -1077,115 +1061,62 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len) {
r_len += 4 * 4;
} break;
- case Variant::IMAGE: {
-
- Image image = p_variant;
- PoolVector<uint8_t> data = image.get_data();
-
- if (buf) {
-
- encode_uint32(image.get_format(), &buf[0]);
- encode_uint32(image.has_mipmaps(), &buf[4]);
- encode_uint32(image.get_width(), &buf[8]);
- encode_uint32(image.get_height(), &buf[12]);
- int ds = data.size();
- encode_uint32(ds, &buf[16]);
- PoolVector<uint8_t>::Read r = data.read();
- copymem(&buf[20], &r[0], ds);
- }
-
- int pad = 0;
- if (data.size() % 4)
- pad = 4 - data.size() % 4;
-
- r_len += data.size() + 5 * 4 + pad;
-
- } break;
/*case Variant::RESOURCE: {
ERR_EXPLAIN("Can't marshallize resources");
ERR_FAIL_V(ERR_INVALID_DATA); //no, i'm sorry, no go
} break;*/
- case Variant::_RID:
- case Variant::OBJECT: {
+ case Variant::_RID: {
} break;
- case Variant::INPUT_EVENT: {
-
- InputEvent ie = p_variant;
-
- if (buf) {
-
- encode_uint32(ie.type, &buf[0]);
- encode_uint32(ie.device, &buf[4]);
- encode_uint32(0, &buf[8]);
- }
-
- int llen = 12;
-
- switch (ie.type) {
-
- case InputEvent::KEY: {
-
- if (buf) {
-
- uint32_t mods = 0;
- if (ie.key.mod.shift)
- mods |= KEY_MASK_SHIFT;
- if (ie.key.mod.control)
- mods |= KEY_MASK_CTRL;
- if (ie.key.mod.alt)
- mods |= KEY_MASK_ALT;
- if (ie.key.mod.meta)
- mods |= KEY_MASK_META;
+ case Variant::OBJECT: {
- encode_uint32(mods, &buf[llen]);
- encode_uint32(ie.key.scancode, &buf[llen + 4]);
- }
- llen += 8;
+ Object *obj = p_variant;
+ if (!obj) {
+ if (buf) {
+ encode_uint32(0, buf);
+ buf += 4;
+ r_len += 4;
+ }
+ } else {
+ _encode_string(obj->get_class(), buf, r_len);
- } break;
- case InputEvent::MOUSE_BUTTON: {
+ List<PropertyInfo> props;
+ obj->get_property_list(&props);
- if (buf) {
+ int pc = 0;
+ for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
- encode_uint32(ie.mouse_button.button_index, &buf[llen]);
- }
- llen += 4;
- } break;
- case InputEvent::JOYPAD_BUTTON: {
+ if (!(E->get().usage & PROPERTY_USAGE_STORAGE))
+ continue;
+ pc++;
+ }
- if (buf) {
+ if (buf) {
+ encode_uint32(pc, buf);
+ buf += 4;
+ }
- encode_uint32(ie.joy_button.button_index, &buf[llen]);
- }
- llen += 4;
- } break;
- case InputEvent::SCREEN_TOUCH: {
+ r_len += 4;
- if (buf) {
+ for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
- encode_uint32(ie.screen_touch.index, &buf[llen]);
- }
- llen += 4;
- } break;
- case InputEvent::JOYPAD_MOTION: {
+ if (!(E->get().usage & PROPERTY_USAGE_STORAGE))
+ continue;
- if (buf) {
+ _encode_string(E->get().name, buf, r_len);
- int axis = ie.joy_motion.axis;
- encode_uint32(axis, &buf[llen]);
- encode_float(ie.joy_motion.axis_value, &buf[llen + 4]);
- }
- llen += 8;
- } break;
+ int len;
+ Error err = encode_variant(obj->get(E->get().name), buf, len);
+ if (err)
+ return err;
+ ERR_FAIL_COND_V(len % 4, ERR_BUG);
+ r_len += len;
+ if (buf)
+ buf += len;
+ }
}
- if (buf)
- encode_uint32(llen, &buf[8]);
- r_len += llen;
-
- // not supported
} break;
case Variant::DICTIONARY: {
diff --git a/core/io/marshalls.h b/core/io/marshalls.h
index b322410929..a6cc72b691 100644
--- a/core/io/marshalls.h
+++ b/core/io/marshalls.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -182,7 +183,7 @@ static inline double decode_double(const uint8_t *p_arr) {
return md.d;
}
-Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int *r_len = NULL);
+Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int *r_len = NULL, bool p_allow_objects=true);
Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len);
#endif
diff --git a/core/io/networked_multiplayer_peer.cpp b/core/io/networked_multiplayer_peer.cpp
index da661d0981..105b8dce44 100644
--- a/core/io/networked_multiplayer_peer.cpp
+++ b/core/io/networked_multiplayer_peer.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/networked_multiplayer_peer.h b/core/io/networked_multiplayer_peer.h
index 1324a61c72..bd951912f9 100644
--- a/core/io/networked_multiplayer_peer.h
+++ b/core/io/networked_multiplayer_peer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp
index 8115673d46..f62ffd7183 100644
--- a/core/io/packet_peer.cpp
+++ b/core/io/packet_peer.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,15 +29,26 @@
/*************************************************************************/
#include "packet_peer.h"
-#include "global_config.h"
#include "io/marshalls.h"
+#include "project_settings.h"
/* helpers / binders */
PacketPeer::PacketPeer() {
+ allow_object_decoding = false;
last_get_error = OK;
}
+void PacketPeer::set_allow_object_decoding(bool p_enable) {
+
+ allow_object_decoding = p_enable;
+}
+
+bool PacketPeer::is_object_decoding_allowed() const {
+
+ return allow_object_decoding;
+}
+
Error PacketPeer::get_packet_buffer(PoolVector<uint8_t> &r_buffer) const {
const uint8_t *buffer;
@@ -74,7 +86,7 @@ Error PacketPeer::get_var(Variant &r_variant) const {
if (err)
return err;
- return decode_variant(r_variant, buffer, buffer_size);
+ return decode_variant(r_variant, buffer, buffer_size, NULL, allow_object_decoding);
}
Error PacketPeer::put_var(const Variant &p_packet) {
@@ -119,12 +131,15 @@ Error PacketPeer::_get_packet_error() const {
void PacketPeer::_bind_methods() {
- 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_var"), &PacketPeer::_bnd_get_var);
+ ClassDB::bind_method(D_METHOD("put_var", "var"), &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("put_packet", "buffer"), &PacketPeer::_put_packet);
+ ClassDB::bind_method(D_METHOD("get_packet_error"), &PacketPeer::_get_packet_error);
ClassDB::bind_method(D_METHOD("get_available_packet_count"), &PacketPeer::get_available_packet_count);
+
+ ClassDB::bind_method(D_METHOD("set_allow_object_decoding", "enable"), &PacketPeer::set_allow_object_decoding);
+ ClassDB::bind_method(D_METHOD("is_object_decoding_allowed"), &PacketPeer::is_object_decoding_allowed);
};
/***************/
@@ -137,7 +152,9 @@ void PacketPeerStream::_set_stream_peer(REF p_peer) {
void PacketPeerStream::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_stream_peer", "peer:StreamPeer"), &PacketPeerStream::_set_stream_peer);
+ ClassDB::bind_method(D_METHOD("set_stream_peer", "peer"), &PacketPeerStream::_set_stream_peer);
+ ClassDB::bind_method(D_METHOD("set_input_buffer_max_size", "max_size_bytes"), &PacketPeerStream::set_input_buffer_max_size);
+ ClassDB::bind_method(D_METHOD("set_output_buffer_max_size", "max_size_bytes"), &PacketPeerStream::set_output_buffer_max_size);
}
Error PacketPeerStream::_poll_buffer() const {
@@ -145,13 +162,13 @@ Error PacketPeerStream::_poll_buffer() const {
ERR_FAIL_COND_V(peer.is_null(), ERR_UNCONFIGURED);
int read = 0;
- Error err = peer->get_partial_data(&temp_buffer[0], ring_buffer.space_left(), read);
+ Error err = peer->get_partial_data(&input_buffer[0], ring_buffer.space_left(), read);
if (err)
return err;
if (read == 0)
return OK;
- int w = ring_buffer.write(&temp_buffer[0], read);
+ int w = ring_buffer.write(&input_buffer[0], read);
ERR_FAIL_COND_V(w != read, ERR_BUG);
return OK;
@@ -197,9 +214,9 @@ Error PacketPeerStream::get_packet(const uint8_t **r_buffer, int &r_buffer_size)
ERR_FAIL_COND_V(remaining < (int)len, ERR_UNAVAILABLE);
ring_buffer.read(lbuf, 4); //get rid of first 4 bytes
- ring_buffer.read(&temp_buffer[0], len); // read packet
+ ring_buffer.read(&input_buffer[0], len); // read packet
- *r_buffer = &temp_buffer[0];
+ *r_buffer = &input_buffer[0];
r_buffer_size = len;
return OK;
}
@@ -216,19 +233,19 @@ Error PacketPeerStream::put_packet(const uint8_t *p_buffer, int p_buffer_size) {
return OK;
ERR_FAIL_COND_V(p_buffer_size < 0, ERR_INVALID_PARAMETER);
- ERR_FAIL_COND_V(p_buffer_size + 4 > temp_buffer.size(), ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(p_buffer_size + 4 > output_buffer.size(), ERR_INVALID_PARAMETER);
- encode_uint32(p_buffer_size, &temp_buffer[0]);
- uint8_t *dst = &temp_buffer[4];
+ encode_uint32(p_buffer_size, &output_buffer[0]);
+ uint8_t *dst = &output_buffer[4];
for (int i = 0; i < p_buffer_size; i++)
dst[i] = p_buffer[i];
- return peer->put_data(&temp_buffer[0], p_buffer_size + 4);
+ return peer->put_data(&output_buffer[0], p_buffer_size + 4);
}
int PacketPeerStream::get_max_packet_size() const {
- return temp_buffer.size();
+ return output_buffer.size();
}
void PacketPeerStream::set_stream_peer(const Ref<StreamPeer> &p_peer) {
@@ -248,13 +265,19 @@ void PacketPeerStream::set_input_buffer_max_size(int p_max_size) {
ERR_EXPLAIN("Buffer in use, resizing would cause loss of data");
ERR_FAIL_COND(ring_buffer.data_left());
ring_buffer.resize(nearest_shift(p_max_size + 4));
- temp_buffer.resize(nearest_power_of_2(p_max_size + 4));
+ input_buffer.resize(nearest_power_of_2(p_max_size + 4));
+}
+
+void PacketPeerStream::set_output_buffer_max_size(int p_max_size) {
+
+ output_buffer.resize(nearest_power_of_2(p_max_size + 4));
}
PacketPeerStream::PacketPeerStream() {
- int rbsize = GLOBAL_GET("network/packets/packet_stream_peer_max_buffer_po2");
+ int rbsize = GLOBAL_GET("network/limits/packet_peer_stream/max_buffer_po2");
ring_buffer.resize(rbsize);
- temp_buffer.resize(1 << rbsize);
+ input_buffer.resize(1 << rbsize);
+ output_buffer.resize(1 << rbsize);
}
diff --git a/core/io/packet_peer.h b/core/io/packet_peer.h
index 5f8d63f8c8..3bd6876aa7 100644
--- a/core/io/packet_peer.h
+++ b/core/io/packet_peer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -47,6 +48,8 @@ class PacketPeer : public Reference {
mutable Error last_get_error;
+ bool allow_object_decoding;
+
public:
virtual int get_available_packet_count() const = 0;
virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) const = 0; ///< buffer is GONE after next get_packet
@@ -62,6 +65,9 @@ public:
virtual Error get_var(Variant &r_variant) const;
virtual Error put_var(const Variant &p_packet);
+ void set_allow_object_decoding(bool p_enable);
+ bool is_object_decoding_allowed() const;
+
PacketPeer();
~PacketPeer() {}
};
@@ -74,7 +80,8 @@ class PacketPeerStream : public PacketPeer {
mutable Ref<StreamPeer> peer;
mutable RingBuffer<uint8_t> ring_buffer;
- mutable Vector<uint8_t> temp_buffer;
+ mutable Vector<uint8_t> input_buffer;
+ mutable Vector<uint8_t> output_buffer;
Error _poll_buffer() const;
@@ -91,6 +98,7 @@ public:
void set_stream_peer(const Ref<StreamPeer> &p_peer);
void set_input_buffer_max_size(int p_max_size);
+ void set_output_buffer_max_size(int p_max_size);
PacketPeerStream();
};
diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp
index 3bc116f1b6..d1729819a8 100644
--- a/core/io/packet_peer_udp.cpp
+++ b/core/io/packet_peer_udp.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -58,9 +59,9 @@ Error PacketPeerUDP::_set_dest_address(const String &p_address, int p_port) {
void PacketPeerUDP::_bind_methods() {
- ClassDB::bind_method(D_METHOD("listen:Error", "port", "bind_address", "recv_buf_size"), &PacketPeerUDP::listen, DEFVAL("*"), DEFVAL(65536));
+ ClassDB::bind_method(D_METHOD("listen", "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("wait"), &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);
diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h
index c486f443fb..007b810b67 100644
--- a/core/io/packet_peer_udp.h
+++ b/core/io/packet_peer_udp.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -48,7 +49,7 @@ protected:
public:
void set_blocking_mode(bool p_enable);
- virtual Error listen(int p_port, IP_Address p_bind_address = IP_Address("*"), int p_recv_buffer_size = 65536) = 0;
+ virtual Error listen(int p_port, const 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 9dd9b044a2..28382ab419 100644
--- a/core/io/pck_packer.cpp
+++ b/core/io/pck_packer.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -172,6 +173,7 @@ Error PCKPacker::flush(bool p_verbose) {
printf("\n");
file->close();
+ memdelete(buf);
return OK;
};
diff --git a/core/io/pck_packer.h b/core/io/pck_packer.h
index 1edb14ab27..ddfa093a6b 100644
--- a/core/io/pck_packer.h
+++ b/core/io/pck_packer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 60dccebebf..fd8928b8a0 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "resource_format_binary.h"
-#include "global_config.h"
+#include "image.h"
#include "io/file_access_compressed.h"
#include "io/marshalls.h"
#include "os/dir_access.h"
+#include "project_settings.h"
#include "version.h"
//#define print_bl(m_what) print_line(m_what)
#define print_bl(m_what)
@@ -48,12 +50,11 @@ enum {
VARIANT_VECTOR3 = 12,
VARIANT_PLANE = 13,
VARIANT_QUAT = 14,
- VARIANT_AABB = 15,
+ VARIANT_RECT3 = 15,
VARIANT_MATRIX3 = 16,
VARIANT_TRANSFORM = 17,
VARIANT_MATRIX32 = 18,
VARIANT_COLOR = 20,
- VARIANT_IMAGE = 21,
VARIANT_NODE_PATH = 22,
VARIANT_RID = 23,
VARIANT_OBJECT = 24,
@@ -69,12 +70,13 @@ enum {
VARIANT_VECTOR2_ARRAY = 37,
VARIANT_INT64 = 40,
VARIANT_DOUBLE = 41,
-
+#ifndef DISABLE_DEPRECATED
+ VARIANT_IMAGE = 21, // - no longer variant type
IMAGE_ENCODING_EMPTY = 0,
IMAGE_ENCODING_RAW = 1,
IMAGE_ENCODING_LOSSLESS = 2,
IMAGE_ENCODING_LOSSY = 3,
-
+#endif
OBJECT_EMPTY = 0,
OBJECT_EXTERNAL_RESOURCE = 1,
OBJECT_INTERNAL_RESOURCE = 2,
@@ -159,8 +161,8 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
case VARIANT_RECT2: {
Rect2 v;
- v.pos.x = f->get_real();
- v.pos.y = f->get_real();
+ v.position.x = f->get_real();
+ v.position.y = f->get_real();
v.size.x = f->get_real();
v.size.y = f->get_real();
r_v = v;
@@ -192,12 +194,12 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
r_v = v;
} break;
- case VARIANT_AABB: {
+ case VARIANT_RECT3: {
Rect3 v;
- v.pos.x = f->get_real();
- v.pos.y = f->get_real();
- v.pos.z = f->get_real();
+ v.position.x = f->get_real();
+ v.position.y = f->get_real();
+ v.position.z = f->get_real();
v.size.x = f->get_real();
v.size.y = f->get_real();
v.size.z = f->get_real();
@@ -258,74 +260,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
r_v = v;
} break;
- case VARIANT_IMAGE: {
-
- uint32_t encoding = f->get_32();
- if (encoding == IMAGE_ENCODING_EMPTY) {
- r_v = Variant();
- break;
- } else if (encoding == IMAGE_ENCODING_RAW) {
- uint32_t width = f->get_32();
- uint32_t height = f->get_32();
- uint32_t mipmaps = f->get_32();
- uint32_t format = f->get_32();
- const uint32_t format_version_shift = 24;
- const uint32_t format_version_mask = format_version_shift - 1;
-
- uint32_t format_version = format >> format_version_shift;
-
- const uint32_t current_version = 0;
- if (format_version > current_version) {
-
- ERR_PRINT("Format version for encoded binary image is too new");
- return ERR_PARSE_ERROR;
- }
-
- 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);
- PoolVector<uint8_t>::Write w = imgdata.write();
- f->get_buffer(w.ptr(), datalen);
- _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 {
- //compressed
- PoolVector<uint8_t> data;
- data.resize(f->get_32());
- PoolVector<uint8_t>::Write w = data.write();
- f->get_buffer(w.ptr(), data.size());
- w = PoolVector<uint8_t>::Write();
-
- Image img;
-
- if (encoding == IMAGE_ENCODING_LOSSY && Image::lossy_unpacker) {
-
- img = Image::lossy_unpacker(data);
- } else if (encoding == IMAGE_ENCODING_LOSSLESS && Image::lossless_unpacker) {
-
- img = Image::lossless_unpacker(data);
- }
- _advance_padding(data.size());
-
- r_v = img;
- }
- } break;
case VARIANT_NODE_PATH: {
Vector<StringName> names;
@@ -382,7 +317,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
- path = GlobalConfig::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
+ path = ProjectSettings::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
}
if (remaps.find(path)) {
@@ -411,7 +346,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
- path = GlobalConfig::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
+ path = ProjectSettings::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
}
RES res = ResourceLoader::load(path, type);
@@ -430,13 +365,6 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
}
} break;
- case VARIANT_INPUT_EVENT: {
-
- InputEvent ev;
- ev.type = f->get_32(); //will only work for null though.
- r_v = ev;
-
- } break;
case VARIANT_DICTIONARY: {
uint32_t len = f->get_32();
@@ -619,7 +547,69 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
w = PoolVector<Color>::Write();
r_v = array;
} break;
+#ifndef DISABLE_DEPRECATED
+ case VARIANT_IMAGE: {
+ uint32_t encoding = f->get_32();
+ if (encoding == IMAGE_ENCODING_EMPTY) {
+ r_v = Ref<Image>();
+ break;
+ } else if (encoding == IMAGE_ENCODING_RAW) {
+ uint32_t width = f->get_32();
+ uint32_t height = f->get_32();
+ uint32_t mipmaps = f->get_32();
+ uint32_t format = f->get_32();
+ const uint32_t format_version_shift = 24;
+ const uint32_t format_version_mask = format_version_shift - 1;
+ uint32_t format_version = format >> format_version_shift;
+
+ const uint32_t current_version = 0;
+ if (format_version > current_version) {
+
+ ERR_PRINT("Format version for encoded binary image is too new");
+ return ERR_PARSE_ERROR;
+ }
+
+ 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();
+
+ PoolVector<uint8_t> imgdata;
+ imgdata.resize(datalen);
+ PoolVector<uint8_t>::Write w = imgdata.write();
+ f->get_buffer(w.ptr(), datalen);
+ _advance_padding(datalen);
+ w = PoolVector<uint8_t>::Write();
+
+ Ref<Image> image;
+ image.instance();
+ image->create(width, height, mipmaps, fmt, imgdata);
+ r_v = image;
+
+ } else {
+ //compressed
+ PoolVector<uint8_t> data;
+ data.resize(f->get_32());
+ PoolVector<uint8_t>::Write w = data.write();
+ f->get_buffer(w.ptr(), data.size());
+ w = PoolVector<uint8_t>::Write();
+
+ Ref<Image> image;
+
+ if (encoding == IMAGE_ENCODING_LOSSY && Image::lossy_unpacker) {
+
+ image = Image::lossy_unpacker(data);
+ } else if (encoding == IMAGE_ENCODING_LOSSLESS && Image::lossless_unpacker) {
+
+ image = Image::lossless_unpacker(data);
+ }
+ _advance_padding(data.size());
+
+ r_v = image;
+ }
+
+ } break;
+#endif
default: {
ERR_FAIL_V(ERR_FILE_CORRUPT);
} break;
@@ -727,7 +717,7 @@ Error ResourceInteractiveLoaderBinary::poll() {
if (!r) {
error = ERR_FILE_CORRUPT;
memdelete(obj); //bye
- ERR_EXPLAIN(local_path + ":Resoucre type in resource field not a resource, type is: " + obj->get_class());
+ ERR_EXPLAIN(local_path + ":Resource type in resource field not a resource, type is: " + obj->get_class());
ERR_FAIL_COND_V(!r, ERR_FILE_CORRUPT);
}
@@ -767,6 +757,7 @@ Error ResourceInteractiveLoaderBinary::poll() {
f->close();
resource = res;
+ resource->set_as_translation_remapped(translation_remapped);
error = ERR_FILE_EOF;
} else {
@@ -784,6 +775,11 @@ int ResourceInteractiveLoaderBinary::get_stage_count() const {
return external_resources.size() + internal_resources.size();
}
+void ResourceInteractiveLoaderBinary::set_translation_remapped(bool p_remapped) {
+
+ translation_remapped = p_remapped;
+}
+
static void save_ustring(FileAccess *f, const String &p_string) {
CharString utf8 = p_string.utf8();
@@ -905,7 +901,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) {
uint32_t ext_resources_size = f->get_32();
for (uint32_t i = 0; i < ext_resources_size; i++) {
- ExtResoucre er;
+ ExtResource er;
er.type = get_unicode_string();
er.path = get_unicode_string();
external_resources.push_back(er);
@@ -930,7 +926,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) {
for (uint32_t i = 0; i < int_resources_size; i++) {
- IntResoucre ir;
+ IntResource ir;
ir.path = get_unicode_string();
ir.offset = f->get_64();
internal_resources.push_back(ir);
@@ -998,6 +994,7 @@ ResourceInteractiveLoaderBinary::ResourceInteractiveLoaderBinary() {
endian_swap = false;
use_real64 = false;
error = OK;
+ translation_remapped = false;
}
ResourceInteractiveLoaderBinary::~ResourceInteractiveLoaderBinary() {
@@ -1020,7 +1017,7 @@ Ref<ResourceInteractiveLoader> ResourceFormatLoaderBinary::load_interactive(cons
}
Ref<ResourceInteractiveLoaderBinary> ria = memnew(ResourceInteractiveLoaderBinary);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
//ria->set_local_path( Globals::get_singleton()->localize_path(p_path) );
ria->open(f);
@@ -1068,7 +1065,7 @@ void ResourceFormatLoaderBinary::get_dependencies(const String &p_path, List<Str
ERR_FAIL_COND(!f);
Ref<ResourceInteractiveLoaderBinary> ria = memnew(ResourceInteractiveLoaderBinary);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
//ria->set_local_path( Globals::get_singleton()->localize_path(p_path) );
ria->get_dependencies(f, p_dependencies, p_add_types);
@@ -1155,7 +1152,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
}
Ref<ResourceInteractiveLoaderBinary> ria = memnew(ResourceInteractiveLoaderBinary);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
ria->remaps = p_map;
//ria->set_local_path( Globals::get_singleton()->localize_path(p_path) );
@@ -1284,7 +1281,7 @@ String ResourceFormatLoaderBinary::get_resource_type(const String &p_path) const
}
Ref<ResourceInteractiveLoaderBinary> ria = memnew(ResourceInteractiveLoaderBinary);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
//ria->set_local_path( Globals::get_singleton()->localize_path(p_path) );
String r = ria->recognize(f);
@@ -1366,8 +1363,8 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant &p_property,
f->store_32(VARIANT_RECT2);
Rect2 val = p_property;
- f->store_real(val.pos.x);
- f->store_real(val.pos.y);
+ f->store_real(val.position.x);
+ f->store_real(val.position.y);
f->store_real(val.size.x);
f->store_real(val.size.y);
@@ -1403,11 +1400,11 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant &p_property,
} break;
case Variant::RECT3: {
- f->store_32(VARIANT_AABB);
+ f->store_32(VARIANT_RECT3);
Rect3 val = p_property;
- f->store_real(val.pos.x);
- f->store_real(val.pos.y);
- f->store_real(val.pos.z);
+ f->store_real(val.position.x);
+ f->store_real(val.position.y);
+ f->store_real(val.position.z);
f->store_real(val.size.x);
f->store_real(val.size.y);
f->store_real(val.size.z);
@@ -1468,67 +1465,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant &p_property,
f->store_real(val.a);
} break;
- case Variant::IMAGE: {
-
- f->store_32(VARIANT_IMAGE);
- Image val = p_property;
- if (val.empty()) {
- f->store_32(IMAGE_ENCODING_EMPTY);
- break;
- }
-
- int encoding = IMAGE_ENCODING_RAW;
- float quality = 0.7;
-
- if (!val.is_compressed()) {
- //can only compress uncompressed stuff
-
- if (p_hint.hint == PROPERTY_HINT_IMAGE_COMPRESS_LOSSY && Image::lossy_packer) {
- encoding = IMAGE_ENCODING_LOSSY;
- float qs = p_hint.hint_string.to_double();
- if (qs != 0.0)
- quality = qs;
-
- } else if (p_hint.hint == PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS && Image::lossless_packer) {
- encoding = IMAGE_ENCODING_LOSSLESS;
- }
- }
-
- f->store_32(encoding); //raw encoding
- if (encoding == IMAGE_ENCODING_RAW) {
-
- f->store_32(val.get_width());
- f->store_32(val.get_height());
- f->store_32(val.has_mipmaps());
- f->store_32(val.get_format()); //if format changes we can add a compatibility version bit
-
- int dlen = val.get_data().size();
- f->store_32(dlen);
- PoolVector<uint8_t>::Read r = val.get_data().read();
- f->store_buffer(r.ptr(), dlen);
- _pad_buffer(dlen);
- } else {
-
- PoolVector<uint8_t> data;
- if (encoding == IMAGE_ENCODING_LOSSY) {
- data = Image::lossy_packer(val, quality);
-
- } else if (encoding == IMAGE_ENCODING_LOSSLESS) {
- data = Image::lossless_packer(val);
- }
-
- int ds = data.size();
- f->store_32(ds);
- if (ds > 0) {
- PoolVector<uint8_t>::Read r = data.read();
- f->store_buffer(r.ptr(), ds);
-
- _pad_buffer(ds);
- }
- }
-
- } break;
case Variant::NODE_PATH: {
f->store_32(VARIANT_NODE_PATH);
NodePath np = p_property;
@@ -1577,13 +1514,6 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant &p_property,
}
} break;
- case Variant::INPUT_EVENT: {
-
- f->store_32(VARIANT_INPUT_EVENT);
- InputEvent event = p_property;
- f->store_32(0); //event type none, nothing else suported for now.
-
- } break;
case Variant::DICTIONARY: {
f->store_32(VARIANT_DICTIONARY);
@@ -1782,7 +1712,6 @@ void ResourceFormatSaverBinaryInstance::_find_resources(const Variant &p_variant
get_string_index(np.get_property());
} break;
-
default: {}
}
}
@@ -2055,7 +1984,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p
Error ResourceFormatSaverBinary::save(const String &p_path, const RES &p_resource, uint32_t p_flags) {
- String local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ String local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ResourceFormatSaverBinaryInstance saver;
return saver.save(local_path, p_resource, p_flags);
}
diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h
index f378d0eae9..1c66344e3e 100644
--- a/core/io/resource_format_binary.h
+++ b/core/io/resource_format_binary.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,6 +36,7 @@
class ResourceInteractiveLoaderBinary : public ResourceInteractiveLoader {
+ bool translation_remapped;
String local_path;
String res_path;
String type;
@@ -54,19 +56,19 @@ class ResourceInteractiveLoaderBinary : public ResourceInteractiveLoader {
StringName _get_string();
- struct ExtResoucre {
+ struct ExtResource {
String path;
String type;
};
- Vector<ExtResoucre> external_resources;
+ Vector<ExtResource> external_resources;
- struct IntResoucre {
+ struct IntResource {
String path;
uint64_t offset;
};
- Vector<IntResoucre> internal_resources;
+ Vector<IntResource> internal_resources;
String get_unicode_string();
void _advance_padding(uint32_t p_len);
@@ -86,6 +88,7 @@ public:
virtual Error poll();
virtual int get_stage() const;
virtual int get_stage_count() const;
+ virtual void set_translation_remapped(bool p_remapped);
void set_remaps(const Map<String, String> &p_remaps) { remaps = p_remaps; }
void open(FileAccess *p_f);
diff --git a/core/io/resource_import.cpp b/core/io/resource_import.cpp
index 27173a721d..7033dbe5fb 100644
--- a/core/io/resource_import.cpp
+++ b/core/io/resource_import.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -48,6 +49,7 @@ Error ResourceFormatImporter::_get_path_and_type(const String &p_path, PathAndTy
int lines = 0;
String error_text;
+ bool path_found = false; //first match must have priority
while (true) {
assign = Variant();
@@ -65,14 +67,16 @@ Error ResourceFormatImporter::_get_path_and_type(const String &p_path, PathAndTy
}
if (assign != String()) {
- if (assign.begins_with("path.") && r_path_and_type.path == String()) {
+ if (!path_found && assign.begins_with("path.") && r_path_and_type.path == String()) {
String feature = assign.get_slicec('.', 1);
if (OS::get_singleton()->check_feature_support(feature)) {
r_path_and_type.path = value;
+ path_found = true; //first match must have priority
}
- } else if (assign == "path") {
+ } else if (!path_found && assign == "path") {
r_path_and_type.path = value;
+ path_found = true; //first match must have priority
} else if (assign == "type") {
r_path_and_type.type = value;
}
@@ -195,6 +199,52 @@ String ResourceFormatImporter::get_internal_resource_path(const String &p_path)
return pat.path;
}
+void ResourceFormatImporter::get_internal_resource_path_list(const String &p_path, List<String> *r_paths) {
+
+ Error err;
+ FileAccess *f = FileAccess::open(p_path + ".import", FileAccess::READ, &err);
+
+ if (!f)
+ return;
+
+ VariantParser::StreamFile stream;
+ stream.f = f;
+
+ String assign;
+ Variant value;
+ VariantParser::Tag next_tag;
+
+ int lines = 0;
+ String error_text;
+ while (true) {
+
+ assign = Variant();
+ next_tag.fields.clear();
+ next_tag.name = String();
+
+ err = VariantParser::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, NULL, true);
+ if (err == ERR_FILE_EOF) {
+ memdelete(f);
+ return;
+ } else if (err != OK) {
+ ERR_PRINTS("ResourceFormatImporter::get_internal_resource_path_list - " + p_path + ".import:" + itos(lines) + " error: " + error_text);
+ memdelete(f);
+ return;
+ }
+
+ if (assign != String()) {
+ if (assign.begins_with("path.")) {
+ r_paths->push_back(value);
+ } else if (assign == "path") {
+ r_paths->push_back(value);
+ }
+ } else if (next_tag.name != "remap") {
+ break;
+ }
+ }
+ memdelete(f);
+}
+
String ResourceFormatImporter::get_resource_type(const String &p_path) const {
PathAndType pat;
diff --git a/core/io/resource_import.h b/core/io/resource_import.h
index f4349a9c61..67fd870178 100644
--- a/core/io/resource_import.h
+++ b/core/io/resource_import.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -58,8 +59,10 @@ public:
virtual bool can_be_imported(const String &p_path) const;
String get_internal_resource_path(const String &p_path) const;
+ void get_internal_resource_path_list(const String &p_path, List<String> *r_paths);
void add_importer(const Ref<ResourceImporter> &p_importer) { importers.insert(p_importer); }
+ void remove_importer(const Ref<ResourceImporter> &p_importer) { importers.erase(p_importer); }
Ref<ResourceImporter> get_importer_by_name(const String &p_name);
Ref<ResourceImporter> get_importer_by_extension(const String &p_extension);
void get_importers_for_extension(const String &p_extension, List<Ref<ResourceImporter> > *r_importers);
@@ -83,9 +86,9 @@ public:
PropertyInfo option;
Variant default_value;
- ImportOption(const PropertyInfo &p_info, const Variant &p_default) {
- option = p_info;
- default_value = p_default;
+ ImportOption(const PropertyInfo &p_info, const Variant &p_default)
+ : option(p_info),
+ default_value(p_default) {
}
ImportOption() {}
};
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index 5d8ec57ee0..5347cd6ee1 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,11 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "resource_loader.h"
-#include "global_config.h"
+#include "io/resource_import.h"
#include "os/file_access.h"
#include "os/os.h"
#include "path_remap.h"
#include "print_string.h"
+#include "project_settings.h"
+#include "translation.h"
ResourceFormatLoader *ResourceLoader::loader[MAX_LOADERS];
int ResourceLoader::loader_count = 0;
@@ -101,6 +104,7 @@ public:
virtual Error poll() { return ERR_FILE_EOF; }
virtual int get_stage() const { return 1; }
virtual int get_stage_count() const { return 1; }
+ virtual void set_translation_remapped(bool p_remapped) { resource->set_as_translation_remapped(p_remapped); }
ResourceInteractiveLoaderDefault() {}
};
@@ -162,40 +166,47 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p
if (p_path.is_rel_path())
local_path = "res://" + p_path;
else
- local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ local_path = ProjectSettings::get_singleton()->localize_path(p_path);
- ERR_FAIL_COND_V(local_path == "", RES());
+ bool xl_remapped = false;
+ String path = _path_remap(local_path, &xl_remapped);
- if (!p_no_cache && ResourceCache::has(local_path)) {
+ ERR_FAIL_COND_V(path == "", RES());
+
+ if (!p_no_cache && ResourceCache::has(path)) {
if (OS::get_singleton()->is_stdout_verbose())
- print_line("load resource: " + local_path + " (cached)");
+ print_line("load resource: " + path + " (cached)");
- return RES(ResourceCache::get(local_path));
+ return RES(ResourceCache::get(path));
}
if (OS::get_singleton()->is_stdout_verbose())
- print_line("load resource: " + local_path);
+ print_line("load resource: " + path);
bool found = false;
+ // Try all loaders and pick the first match for the type hint
for (int i = 0; i < loader_count; i++) {
- if (!loader[i]->recognize_path(local_path, p_type_hint)) {
- print_line("path not recognized");
+ if (!loader[i]->recognize_path(path, p_type_hint)) {
continue;
}
found = true;
- RES res = loader[i]->load(local_path, local_path, r_error);
+ RES res = loader[i]->load(path, path, r_error);
if (res.is_null()) {
continue;
}
if (!p_no_cache)
res->set_path(local_path);
+
+ if (xl_remapped)
+ res->set_as_translation_remapped(true);
+
#ifdef TOOLS_ENABLED
res->set_edited(false);
if (timestamp_on_load) {
- uint64_t mt = FileAccess::get_modified_time(local_path);
+ uint64_t mt = FileAccess::get_modified_time(path);
//printf("mt %s: %lli\n",remapped_path.utf8().get_data(),mt);
res->set_last_modified_time(mt);
}
@@ -205,9 +216,9 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p
}
if (found) {
- ERR_EXPLAIN("Failed loading resource: " + p_path);
+ ERR_EXPLAIN("Failed loading resource: " + path);
} else {
- ERR_EXPLAIN("No loader found for resource: " + p_path);
+ ERR_EXPLAIN("No loader found for resource: " + path);
}
ERR_FAIL_V(RES());
return RES();
@@ -222,16 +233,19 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_
if (p_path.is_rel_path())
local_path = "res://" + p_path;
else
- local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ local_path = ProjectSettings::get_singleton()->localize_path(p_path);
+
+ bool xl_remapped = false;
+ String path = _path_remap(local_path, &xl_remapped);
- ERR_FAIL_COND_V(local_path == "", Ref<ResourceInteractiveLoader>());
+ ERR_FAIL_COND_V(path == "", Ref<ResourceInteractiveLoader>());
- if (!p_no_cache && ResourceCache::has(local_path)) {
+ if (!p_no_cache && ResourceCache::has(path)) {
if (OS::get_singleton()->is_stdout_verbose())
- print_line("load resource: " + local_path + " (cached)");
+ print_line("load resource: " + path + " (cached)");
- Ref<Resource> res_cached = ResourceCache::get(local_path);
+ Ref<Resource> res_cached = ResourceCache::get(path);
Ref<ResourceInteractiveLoaderDefault> ril = Ref<ResourceInteractiveLoaderDefault>(memnew(ResourceInteractiveLoaderDefault));
ril->resource = res_cached;
@@ -245,22 +259,24 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_
for (int i = 0; i < loader_count; i++) {
- if (!loader[i]->recognize_path(local_path, p_type_hint))
+ if (!loader[i]->recognize_path(path, p_type_hint))
continue;
found = true;
- Ref<ResourceInteractiveLoader> ril = loader[i]->load_interactive(local_path, r_error);
+ Ref<ResourceInteractiveLoader> ril = loader[i]->load_interactive(path, r_error);
if (ril.is_null())
continue;
if (!p_no_cache)
ril->set_local_path(local_path);
+ if (xl_remapped)
+ ril->set_translation_remapped(true);
return ril;
}
if (found) {
- ERR_EXPLAIN("Failed loading resource: " + p_path);
+ ERR_EXPLAIN("Failed loading resource: " + path);
} else {
- ERR_EXPLAIN("No loader found for resource: " + p_path);
+ ERR_EXPLAIN("No loader found for resource: " + path);
}
ERR_FAIL_V(Ref<ResourceInteractiveLoader>());
return Ref<ResourceInteractiveLoader>();
@@ -282,11 +298,13 @@ void ResourceLoader::add_resource_format_loader(ResourceFormatLoader *p_format_l
void ResourceLoader::get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types) {
+ String path = _path_remap(p_path);
+
String local_path;
- if (p_path.is_rel_path())
- local_path = "res://" + p_path;
+ if (path.is_rel_path())
+ local_path = "res://" + path;
else
- local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ local_path = ProjectSettings::get_singleton()->localize_path(path);
for (int i = 0; i < loader_count; i++) {
@@ -303,11 +321,13 @@ void ResourceLoader::get_dependencies(const String &p_path, List<String> *p_depe
Error ResourceLoader::rename_dependencies(const String &p_path, const Map<String, String> &p_map) {
+ String path = _path_remap(p_path);
+
String local_path;
- if (p_path.is_rel_path())
- local_path = "res://" + p_path;
+ if (path.is_rel_path())
+ local_path = "res://" + path;
else
- local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ local_path = ProjectSettings::get_singleton()->localize_path(path);
for (int i = 0; i < loader_count; i++) {
@@ -330,7 +350,7 @@ String ResourceLoader::get_resource_type(const String &p_path) {
if (p_path.is_rel_path())
local_path = "res://" + p_path;
else
- local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ local_path = ProjectSettings::get_singleton()->localize_path(p_path);
for (int i = 0; i < loader_count; i++) {
@@ -341,6 +361,98 @@ String ResourceLoader::get_resource_type(const String &p_path) {
return "";
}
+
+String ResourceLoader::_path_remap(const String &p_path, bool *r_translation_remapped) {
+
+ if (translation_remaps.has(p_path)) {
+
+ Vector<String> &v = *translation_remaps.getptr(p_path);
+ String locale = TranslationServer::get_singleton()->get_locale();
+ if (r_translation_remapped) {
+ *r_translation_remapped = true;
+ }
+ for (int i = 0; i < v.size(); i++) {
+
+ int split = v[i].find_last(":");
+ if (split == -1)
+ continue;
+ String l = v[i].right(split + 1).strip_edges();
+ if (l == String())
+ continue;
+
+ if (l.begins_with(locale)) {
+ return v[i].left(split);
+ }
+ }
+ }
+
+ return p_path;
+}
+
+String ResourceLoader::import_remap(const String &p_path) {
+
+ if (ResourceFormatImporter::get_singleton()->recognize_path(p_path)) {
+
+ return ResourceFormatImporter::get_singleton()->get_internal_resource_path(p_path);
+ }
+
+ return p_path;
+}
+
+String ResourceLoader::path_remap(const String &p_path) {
+ return _path_remap(p_path);
+}
+
+void ResourceLoader::reload_translation_remaps() {
+
+ if (ResourceCache::lock) {
+ ResourceCache::lock->read_lock();
+ }
+
+ List<Resource *> to_reload;
+ SelfList<Resource> *E = remapped_list.first();
+
+ while (E) {
+ to_reload.push_back(E->self());
+ E = E->next();
+ }
+
+ if (ResourceCache::lock) {
+ ResourceCache::lock->read_unlock();
+ }
+
+ //now just make sure to not delete any of these resources while changing locale..
+ while (to_reload.front()) {
+ to_reload.front()->get()->reload_from_file();
+ to_reload.pop_front();
+ }
+}
+
+void ResourceLoader::load_translation_remaps() {
+
+ if (!ProjectSettings::get_singleton()->has("locale/translation_remaps"))
+ return;
+
+ Dictionary remaps = ProjectSettings::get_singleton()->get("locale/translation_remaps");
+ List<Variant> keys;
+ remaps.get_key_list(&keys);
+ for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
+
+ Array langs = remaps[E->get()];
+ Vector<String> lang_remaps;
+ lang_remaps.resize(langs.size());
+ for (int i = 0; i < langs.size(); i++) {
+ lang_remaps[i] = langs[i];
+ }
+
+ translation_remaps[String(E->get())] = lang_remaps;
+ }
+}
+
+void ResourceLoader::clear_translation_remaps() {
+ translation_remaps.clear();
+}
+
ResourceLoadErrorNotify ResourceLoader::err_notify = NULL;
void *ResourceLoader::err_notify_ud = NULL;
@@ -349,3 +461,6 @@ void *ResourceLoader::dep_err_notify_ud = NULL;
bool ResourceLoader::abort_on_missing_resource = true;
bool ResourceLoader::timestamp_on_load = false;
+
+SelfList<Resource>::List ResourceLoader::remapped_list;
+HashMap<String, Vector<String> > ResourceLoader::translation_remaps;
diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h
index 0d51b07414..e6687800d7 100644
--- a/core/io/resource_loader.h
+++ b/core/io/resource_loader.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -48,6 +49,7 @@ public:
virtual Error poll() = 0;
virtual int get_stage() const = 0;
virtual int get_stage_count() const = 0;
+ virtual void set_translation_remapped(bool p_remapped) = 0;
virtual Error wait();
ResourceInteractiveLoader() {}
@@ -86,6 +88,12 @@ class ResourceLoader {
static void *dep_err_notify_ud;
static DependencyErrorNotify dep_err_notify;
static bool abort_on_missing_resource;
+ static HashMap<String, Vector<String> > translation_remaps;
+
+ static String _path_remap(const String &p_path, bool *r_translation_remapped = NULL);
+ friend class Resource;
+
+ static SelfList<Resource>::List remapped_list;
public:
static Ref<ResourceInteractiveLoader> load_interactive(const String &p_path, const String &p_type_hint = "", bool p_no_cache = false, Error *r_error = NULL);
@@ -117,6 +125,13 @@ public:
static void set_abort_on_missing_resources(bool p_abort) { abort_on_missing_resource = p_abort; }
static bool get_abort_on_missing_resources() { return abort_on_missing_resource; }
+
+ static String path_remap(const String &p_path);
+ static String import_remap(const String &p_path);
+
+ static void reload_translation_remaps();
+ static void load_translation_remaps();
+ static void clear_translation_remaps();
};
#endif
diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp
index e4548b16ff..314259b2e9 100644
--- a/core/io/resource_saver.cpp
+++ b/core/io/resource_saver.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "resource_saver.h"
-#include "global_config.h"
#include "os/file_access.h"
+#include "project_settings.h"
#include "resource_loader.h"
#include "script_language.h"
@@ -63,7 +64,7 @@ Error ResourceSaver::save(const String &p_path, const RES &p_resource, uint32_t
String old_path = p_resource->get_path();
- String local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ String local_path = ProjectSettings::get_singleton()->localize_path(p_path);
RES rwcopy = p_resource;
if (p_flags & FLAG_CHANGE_PATH)
diff --git a/core/io/resource_saver.h b/core/io/resource_saver.h
index b9bb2aafae..f7fbcc1fb8 100644
--- a/core/io/resource_saver.h
+++ b/core/io/resource_saver.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/sha-README.md b/core/io/sha-README.md
deleted file mode 100644
index 27a73cffe7..0000000000
--- a/core/io/sha-README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-SHA256
-======
-
-SHA-256 implementation to compliment a portable byte-oriented AES-256
-implementation in C at http://www.literatecode.com/aes256
diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp
index 07df47f8c0..7042700d92 100644
--- a/core/io/stream_peer.cpp
+++ b/core/io/stream_peer.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -209,7 +210,7 @@ void StreamPeer::put_double(double p_val) {
void StreamPeer::put_utf8_string(const String &p_string) {
CharString cs = p_string.utf8();
- put_u32(p_string.length());
+ put_u32(cs.length());
put_data((const uint8_t *)cs.get_data(), cs.length());
}
void StreamPeer::put_var(const Variant &p_variant) {
@@ -384,7 +385,7 @@ void StreamPeer::_bind_methods() {
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("put_var", "val"), &StreamPeer::put_var);
ClassDB::bind_method(D_METHOD("get_8"), &StreamPeer::get_8);
ClassDB::bind_method(D_METHOD("get_u8"), &StreamPeer::get_u8);
@@ -398,7 +399,7 @@ void StreamPeer::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("get_var"), &StreamPeer::get_var);
}
////////////////////////////////
@@ -411,7 +412,7 @@ void StreamPeerBuffer::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("duplicate"), &StreamPeerBuffer::duplicate);
}
Error StreamPeerBuffer::put_data(const uint8_t *p_data, int p_bytes) {
@@ -458,8 +459,9 @@ Error StreamPeerBuffer::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r_
}
PoolVector<uint8_t>::Read r = data.read();
- copymem(p_buffer, r.ptr(), r_received);
+ copymem(p_buffer, r.ptr() + pointer, r_received);
+ pointer += r_received;
// FIXME: return what? OK or ERR_*
}
diff --git a/core/io/stream_peer.h b/core/io/stream_peer.h
index 7c20d10b10..d0748a8c9e 100644
--- a/core/io/stream_peer.h
+++ b/core/io/stream_peer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp
index 6db6eb30ed..ef3c264375 100644
--- a/core/io/stream_peer_ssl.cpp
+++ b/core/io/stream_peer_ssl.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -50,8 +51,8 @@ bool StreamPeerSSL::is_available() {
void StreamPeerSSL::_bind_methods() {
- 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("accept_stream", "stream"), &StreamPeerSSL::accept_stream);
+ ClassDB::bind_method(D_METHOD("connect_to_stream", "stream", "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);
diff --git a/core/io/stream_peer_ssl.h b/core/io/stream_peer_ssl.h
index 468cef66a2..a81ae24e4a 100644
--- a/core/io/stream_peer_ssl.h
+++ b/core/io/stream_peer_ssl.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp
index db5952e16f..5c859ea7c0 100644
--- a/core/io/stream_peer_tcp.cpp
+++ b/core/io/stream_peer_tcp.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/stream_peer_tcp.h b/core/io/stream_peer_tcp.h
index 1733619a1c..53c21a93fd 100644
--- a/core/io/stream_peer_tcp.h
+++ b/core/io/stream_peer_tcp.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp
index f602b569ad..29a80ecc19 100644
--- a/core/io/tcp_server.cpp
+++ b/core/io/tcp_server.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/tcp_server.h b/core/io/tcp_server.h
index 736aa16f99..b4ff3246ad 100644
--- a/core/io/tcp_server.h
+++ b/core/io/tcp_server.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -44,7 +45,7 @@ protected:
static void _bind_methods();
public:
- virtual Error listen(uint16_t p_port, const IP_Address p_bind_address = IP_Address("*")) = 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/translation_loader_po.cpp b/core/io/translation_loader_po.cpp
index 4da661e675..1a670b0ab0 100644
--- a/core/io/translation_loader_po.cpp
+++ b/core/io/translation_loader_po.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -50,6 +51,8 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
Ref<Translation> translation = Ref<Translation>(memnew(Translation));
int line = 1;
+ bool skip_this;
+ bool skip_next;
while (true) {
@@ -59,9 +62,10 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
if (status == STATUS_READING_STRING) {
- if (msg_id != "")
- translation->add_message(msg_id, msg_str);
- else if (config == "")
+ if (msg_id != "") {
+ if (!skip_this)
+ translation->add_message(msg_id, msg_str);
+ } else if (config == "")
config = msg_str;
break;
@@ -84,15 +88,18 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
ERR_FAIL_V(RES());
}
- if (msg_id != "")
- translation->add_message(msg_id, msg_str);
- else if (config == "")
+ if (msg_id != "") {
+ if (!skip_this)
+ translation->add_message(msg_id, msg_str);
+ } else if (config == "")
config = msg_str;
l = l.substr(5, l.length()).strip_edges();
status = STATUS_READING_ID;
msg_id = "";
msg_str = "";
+ skip_this = skip_next;
+ skip_next = false;
}
if (l.begins_with("msgstr")) {
@@ -109,6 +116,9 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
}
if (l == "" || l.begins_with("#")) {
+ if (l.find("fuzzy") != -1) {
+ skip_next = true;
+ }
line++;
continue; //nothing to read or comment
}
diff --git a/core/io/translation_loader_po.h b/core/io/translation_loader_po.h
index fe0440cb2a..a731e4e0d6 100644
--- a/core/io/translation_loader_po.h
+++ b/core/io/translation_loader_po.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp
index c5929617c9..e5f4433b8f 100644
--- a/core/io/xml_parser.cpp
+++ b/core/io/xml_parser.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/xml_parser.h b/core/io/xml_parser.h
index 631d77a41e..297211ecc6 100644
--- a/core/io/xml_parser.h
+++ b/core/io/xml_parser.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/io/zip_io.h b/core/io/zip_io.h
index 4da9fc9c8d..88e680c0e0 100644
--- a/core/io/zip_io.h
+++ b/core/io/zip_io.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,11 +30,12 @@
#ifndef ZIP_IO_H
#define ZIP_IO_H
-#include "io/unzip.h"
-#include "io/zip.h"
#include "os/copymem.h"
#include "os/file_access.h"
+#include "thirdparty/minizip/unzip.h"
+#include "thirdparty/minizip/zip.h"
+
static void *zipio_open(void *data, const char *p_fname, int mode) {
FileAccess *&f = *(FileAccess **)data;
diff --git a/core/list.h b/core/list.h
index b6f2df867f..df69b1dc40 100644
--- a/core/list.h
+++ b/core/list.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -397,10 +398,7 @@ public:
T &operator[](int p_index) {
- if (p_index < 0 || p_index >= size()) {
- T &aux = *((T *)0); //nullreturn
- ERR_FAIL_COND_V(p_index < 0 || p_index >= size(), aux);
- }
+ CRASH_BAD_INDEX(p_index, size());
Element *I = front();
int c = 0;
@@ -414,15 +412,12 @@ public:
c++;
}
- ERR_FAIL_V(*((T *)0)); // bug!!
+ CRASH_NOW(); // bug!!
}
const T &operator[](int p_index) const {
- if (p_index < 0 || p_index >= size()) {
- T &aux = *((T *)0); //nullreturn
- ERR_FAIL_COND_V(p_index < 0 || p_index >= size(), aux);
- }
+ CRASH_BAD_INDEX(p_index, size());
const Element *I = front();
int c = 0;
@@ -436,7 +431,7 @@ public:
c++;
}
- ERR_FAIL_V(*((T *)0)); // bug!
+ CRASH_NOW(); // bug!!
}
void move_to_back(Element *p_I) {
diff --git a/core/make_binders.py b/core/make_binders.py
index 74b5e9fda3..a5cdb78443 100644
--- a/core/make_binders.py
+++ b/core/make_binders.py
@@ -11,11 +11,18 @@ public:
#ifdef DEBUG_METHODS_ENABLED
virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); }
Variant::Type _get_argument_type(int p_argument) const {
- $ifret if (p_argument==-1) return Variant::get_type_for<R>();$
- $arg if (p_argument==(@-1)) return Variant::get_type_for<P@>();
+ $ifret if (p_argument==-1) return (Variant::Type)GetTypeInfo<R>::VARIANT_TYPE;$
+ $arg if (p_argument==(@-1)) return (Variant::Type)GetTypeInfo<P@>::VARIANT_TYPE;
$
return Variant::NIL;
}
+ virtual StringName _gen_argument_type_name(int p_arg) const { return _gen_argument_type_hint(p_arg); }
+ StringName _gen_argument_type_hint(int p_argument) const {
+ $ifret if (p_argument==-1) return GetTypeInfo<R>::get_class_name();$
+ $arg if (p_argument==(@-1)) return GetTypeInfo<P@>::get_class_name();
+ $
+ return StringName();
+ }
#endif
virtual String get_instance_class() const {
return T::get_class_static();
@@ -91,11 +98,20 @@ public:
virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); }
Variant::Type _get_argument_type(int p_argument) const {
- $ifret if (p_argument==-1) return Variant::get_type_for<R>();$
- $arg if (p_argument==(@-1)) return Variant::get_type_for<P@>();
+ $ifret if (p_argument==-1) return (Variant::Type)GetTypeInfo<R>::VARIANT_TYPE;$
+ $arg if (p_argument==(@-1)) return (Variant::Type)GetTypeInfo<P@>::VARIANT_TYPE;
$
return Variant::NIL;
}
+
+ virtual StringName _gen_argument_type_name(int p_arg) const { return _gen_argument_type_hint(p_arg); }
+
+ StringName _gen_argument_type_hint(int p_argument) const {
+ $ifret if (p_argument==-1) return GetTypeInfo<R>::get_class_name();$
+ $arg if (p_argument==(@-1)) return GetTypeInfo<P@>::get_class_name();
+ $
+ return StringName();
+ }
#endif
virtual String get_instance_class() const {
return type_name;
diff --git a/core/map.h b/core/map.h
index e9700ff371..ef0f75fc9b 100644
--- a/core/map.h
+++ b/core/map.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -598,9 +599,9 @@ public:
const V &operator[](const K &p_key) const {
- ERR_FAIL_COND_V(!_data._root, *(V *)NULL); // crash on purpose
+ CRASH_COND(!_data._root);
const Element *e = find(p_key);
- ERR_FAIL_COND_V(!e, *(V *)NULL); // crash on purpose
+ CRASH_COND(!e);
return e->_value;
}
V &operator[](const K &p_key) {
@@ -612,7 +613,7 @@ public:
if (!e)
e = insert(p_key, V());
- ERR_FAIL_COND_V(!e, *(V *)NULL); // crash on purpose
+ CRASH_COND(!e);
return e->_value;
}
diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp
index 110185c2d2..04e4383f03 100644
--- a/core/math/a_star.cpp
+++ b/core/math/a_star.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,6 +29,8 @@
/*************************************************************************/
#include "a_star.h"
#include "geometry.h"
+#include "scene/scene_string_names.h"
+#include "script_language.h"
int AStar::get_available_point_id() const {
@@ -40,6 +43,7 @@ int AStar::get_available_point_id() const {
void AStar::add_point(int p_id, const Vector3 &p_pos, real_t p_weight_scale) {
ERR_FAIL_COND(p_id < 0);
+ ERR_FAIL_COND(p_weight_scale < 1);
if (!points.has(p_id)) {
Point *pt = memnew(Point);
pt->id = p_id;
@@ -83,7 +87,7 @@ void AStar::remove_point(int p_id) {
points.erase(p_id);
}
-void AStar::connect_points(int p_id, int p_with_id) {
+void AStar::connect_points(int p_id, int p_with_id, bool bidirectional) {
ERR_FAIL_COND(!points.has(p_id));
ERR_FAIL_COND(!points.has(p_with_id));
@@ -92,7 +96,9 @@ void AStar::connect_points(int p_id, int p_with_id) {
Point *a = points[p_id];
Point *b = points[p_with_id];
a->neighbours.push_back(b);
- b->neighbours.push_back(a);
+
+ if (bidirectional)
+ b->neighbours.push_back(a);
Segment s(p_id, p_with_id);
if (s.from == p_id) {
@@ -117,6 +123,12 @@ void AStar::disconnect_points(int p_id, int p_with_id) {
a->neighbours.erase(b);
b->neighbours.erase(a);
}
+
+bool AStar::has_point(int p_id) const {
+
+ return points.has(p_id);
+}
+
bool AStar::are_points_connected(int p_id, int p_with_id) const {
Segment s(p_id, p_with_id);
@@ -187,8 +199,7 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
Point *n = begin_point->neighbours[i];
n->prev_point = begin_point;
- n->distance = n->pos.distance_to(begin_point->pos);
- n->distance *= n->weight_scale;
+ n->distance = _compute_cost(begin_point->id, n->id) * n->weight_scale;
n->last_pass = pass;
open_list.add(&n->list);
@@ -215,8 +226,7 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
Point *p = E->self();
real_t cost = p->distance;
- cost += p->pos.distance_to(end_point->pos);
- cost *= p->weight_scale;
+ cost += _estimate_cost(p->id, end_point->id);
if (cost < least_cost) {
@@ -233,8 +243,7 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
Point *e = p->neighbours[i];
- real_t distance = p->pos.distance_to(e->pos) + p->distance;
- distance *= e->weight_scale;
+ real_t distance = _compute_cost(p->id, e->id) * e->weight_scale + p->distance;
if (e->last_pass == pass) {
//oh this was visited already, can we win the cost?
@@ -274,6 +283,20 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
return found_route;
}
+float AStar::_estimate_cost(int p_from_id, int p_to_id) {
+ if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_estimate_cost))
+ return get_script_instance()->call(SceneStringNames::get_singleton()->_estimate_cost, p_from_id, p_to_id);
+
+ return points[p_from_id]->pos.distance_to(points[p_to_id]->pos);
+}
+
+float AStar::_compute_cost(int p_from_id, int p_to_id) {
+ if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_compute_cost))
+ return get_script_instance()->call(SceneStringNames::get_singleton()->_compute_cost, p_from_id, p_to_id);
+
+ return points[p_from_id]->pos.distance_to(points[p_to_id]->pos);
+}
+
PoolVector<Vector3> AStar::get_point_path(int p_from_id, int p_to_id) {
ERR_FAIL_COND_V(!points.has(p_from_id), PoolVector<Vector3>());
@@ -383,8 +406,9 @@ void AStar::_bind_methods() {
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(D_METHOD("has_point", "id"), &AStar::has_point);
- ClassDB::bind_method(D_METHOD("connect_points", "id", "to_id"), &AStar::connect_points);
+ ClassDB::bind_method(D_METHOD("connect_points", "id", "to_id", "bidirectional"), &AStar::connect_points, DEFVAL(true));
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);
@@ -395,6 +419,9 @@ void AStar::_bind_methods() {
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);
+
+ BIND_VMETHOD(MethodInfo("_estimate_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id")));
+ BIND_VMETHOD(MethodInfo("_compute_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id")));
}
AStar::AStar() {
diff --git a/core/math/a_star.h b/core/math/a_star.h
index 2ac855737c..ebf1407c17 100644
--- a/core/math/a_star.h
+++ b/core/math/a_star.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -93,6 +94,9 @@ class AStar : public Reference {
protected:
static void _bind_methods();
+ virtual float _estimate_cost(int p_from_id, int p_to_id);
+ virtual float _compute_cost(int p_from_id, int p_to_id);
+
public:
int get_available_point_id() const;
@@ -100,8 +104,9 @@ public:
Vector3 get_point_pos(int p_id) const;
real_t get_point_weight_scale(int p_id) const;
void remove_point(int p_id);
+ bool has_point(int p_id) const;
- void connect_points(int p_id, int p_with_id);
+ void connect_points(int p_id, int p_with_id, bool bidirectional = true);
void disconnect_points(int p_id, int p_with_id);
bool are_points_connected(int p_id, int p_with_id) const;
diff --git a/core/math/audio_frame.cpp b/core/math/audio_frame.cpp
index e56157ffef..30a50c8add 100644
--- a/core/math/audio_frame.cpp
+++ b/core/math/audio_frame.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/math/audio_frame.h b/core/math/audio_frame.h
index dd43f48df4..d54f622197 100644
--- a/core/math/audio_frame.h
+++ b/core/math/audio_frame.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -101,6 +102,16 @@ struct AudioFrame {
r = ::undenormalise(r);
}
+ _FORCE_INLINE_ AudioFrame linear_interpolate(const AudioFrame &p_b, float p_t) const {
+
+ AudioFrame res = *this;
+
+ res.l += (p_t * (p_b.l - l));
+ res.r += (p_t * (p_b.r - r));
+
+ return res;
+ }
+
_ALWAYS_INLINE_ AudioFrame(float p_l, float p_r) {
l = p_l;
r = p_r;
diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp
index ef229a0553..e22bc2b05e 100644
--- a/core/math/bsp_tree.cpp
+++ b/core/math/bsp_tree.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,8 +39,8 @@ void BSP_Tree::from_aabb(const Rect3 &p_aabb) {
Vector3 n;
n[i] = 1;
- planes.push_back(Plane(n, p_aabb.pos[i] + p_aabb.size[i]));
- planes.push_back(Plane(-n, -p_aabb.pos[i]));
+ planes.push_back(Plane(n, p_aabb.position[i] + p_aabb.size[i]));
+ planes.push_back(Plane(-n, -p_aabb.position[i]));
}
nodes.clear();
@@ -551,7 +552,7 @@ BSP_Tree::BSP_Tree(const PoolVector<Face3> &p_faces, real_t p_error_radius) {
if (first) {
- aabb.pos = f.vertex[0];
+ aabb.position = f.vertex[0];
first = false;
} else {
@@ -576,12 +577,11 @@ BSP_Tree::BSP_Tree(const PoolVector<Face3> &p_faces, real_t p_error_radius) {
error_radius = p_error_radius;
}
-BSP_Tree::BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const Rect3 &p_aabb, real_t p_error_radius) {
-
- nodes = p_nodes;
- planes = p_planes;
- aabb = p_aabb;
- error_radius = p_error_radius;
+BSP_Tree::BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const Rect3 &p_aabb, real_t p_error_radius)
+ : nodes(p_nodes),
+ planes(p_planes),
+ aabb(p_aabb),
+ error_radius(p_error_radius) {
}
BSP_Tree::~BSP_Tree() {
diff --git a/core/math/bsp_tree.h b/core/math/bsp_tree.h
index 4cfac35a2c..8296e57943 100644
--- a/core/math/bsp_tree.h
+++ b/core/math/bsp_tree.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp
index 227f586c43..a1666ccd8b 100644
--- a/core/math/camera_matrix.cpp
+++ b/core/math/camera_matrix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -90,6 +91,72 @@ void CameraMatrix::set_perspective(real_t p_fovy_degrees, real_t p_aspect, real_
matrix[3][3] = 0;
}
+void CameraMatrix::set_perspective(real_t p_fovy_degrees, real_t p_aspect, real_t p_z_near, real_t p_z_far, bool p_flip_fov, int p_eye, real_t p_intraocular_dist, real_t p_convergence_dist) {
+ if (p_flip_fov) {
+ p_fovy_degrees = get_fovy(p_fovy_degrees, 1.0 / p_aspect);
+ }
+
+ real_t left, right, modeltranslation, ymax, xmax, frustumshift;
+
+ ymax = p_z_near * tan(p_fovy_degrees * Math_PI / 360.0f);
+ xmax = ymax * p_aspect;
+ frustumshift = (p_intraocular_dist / 2.0) * p_z_near / p_convergence_dist;
+
+ switch (p_eye) {
+ case 1: { // left eye
+ left = -xmax + frustumshift;
+ right = xmax + frustumshift;
+ modeltranslation = p_intraocular_dist / 2.0;
+ }; break;
+ case 2: { // right eye
+ left = -xmax - frustumshift;
+ right = xmax - frustumshift;
+ modeltranslation = -p_intraocular_dist / 2.0;
+ }; break;
+ default: { // mono, should give the same result as set_perspective(p_fovy_degrees,p_aspect,p_z_near,p_z_far,p_flip_fov)
+ left = -xmax;
+ right = xmax;
+ modeltranslation = 0.0;
+ }; break;
+ };
+
+ set_frustum(left, right, -ymax, ymax, p_z_near, p_z_far);
+
+ // translate matrix by (modeltranslation, 0.0, 0.0)
+ CameraMatrix cm;
+ cm.set_identity();
+ cm.matrix[3][0] = modeltranslation;
+ *this = *this * cm;
+}
+
+void CameraMatrix::set_for_hmd(int p_eye, real_t p_aspect, real_t p_intraocular_dist, real_t p_display_width, real_t p_display_to_lens, real_t p_oversample, real_t p_z_near, real_t p_z_far) {
+ // we first calculate our base frustum on our values without taking our lens magnification into account.
+ real_t display_to_eye = 2.0 * p_display_to_lens;
+ real_t f1 = (p_intraocular_dist * 0.5) / p_display_to_lens;
+ real_t f2 = ((p_display_width - p_intraocular_dist) * 0.5) / p_display_to_lens;
+ real_t f3 = (p_display_width / 4.0) / p_display_to_lens;
+
+ // now we apply our oversample factor to increase our FOV. how much we oversample is always a balance we strike between performance and how much
+ // we're willing to sacrifice in FOV.
+ real_t add = ((f1 + f2) * (p_oversample - 1.0)) / 2.0;
+ f1 += add;
+ f2 += add;
+
+ // always apply KEEP_WIDTH aspect ratio
+ f3 *= p_aspect;
+
+ switch (p_eye) {
+ case 1: { // left eye
+ set_frustum(-f2 * p_z_near, f1 * p_z_near, -f3 * p_z_near, f3 * p_z_near, p_z_near, p_z_far);
+ }; break;
+ case 2: { // right eye
+ set_frustum(-f1 * p_z_near, f2 * p_z_near, -f3 * p_z_near, f3 * p_z_near, p_z_near, p_z_far);
+ }; break;
+ default: { // mono, does not apply here!
+ }; break;
+ };
+};
+
void CameraMatrix::set_orthogonal(real_t p_left, real_t p_right, real_t p_bottom, real_t p_top, real_t p_znear, real_t p_zfar) {
set_identity();
@@ -242,23 +309,44 @@ bool CameraMatrix::get_endpoints(const Transform &p_transform, Vector3 *p_8point
-matrix[15] + matrix[13]);
top_plane.normalize();
- Vector3 near_endpoint;
- Vector3 far_endpoint;
+ Vector3 near_endpoint_left, near_endpoint_right;
+ Vector3 far_endpoint_left, far_endpoint_right;
- bool res = near_plane.intersect_3(right_plane, top_plane, &near_endpoint);
+ bool res = near_plane.intersect_3(right_plane, top_plane, &near_endpoint_right);
ERR_FAIL_COND_V(!res, false);
- res = far_plane.intersect_3(right_plane, top_plane, &far_endpoint);
+ res = far_plane.intersect_3(right_plane, top_plane, &far_endpoint_right);
ERR_FAIL_COND_V(!res, false);
- p_8points[0] = p_transform.xform(Vector3(near_endpoint.x, near_endpoint.y, near_endpoint.z));
- p_8points[1] = p_transform.xform(Vector3(near_endpoint.x, -near_endpoint.y, near_endpoint.z));
- p_8points[2] = p_transform.xform(Vector3(-near_endpoint.x, near_endpoint.y, near_endpoint.z));
- p_8points[3] = p_transform.xform(Vector3(-near_endpoint.x, -near_endpoint.y, near_endpoint.z));
- p_8points[4] = p_transform.xform(Vector3(far_endpoint.x, far_endpoint.y, far_endpoint.z));
- p_8points[5] = p_transform.xform(Vector3(far_endpoint.x, -far_endpoint.y, far_endpoint.z));
- p_8points[6] = p_transform.xform(Vector3(-far_endpoint.x, far_endpoint.y, far_endpoint.z));
- p_8points[7] = p_transform.xform(Vector3(-far_endpoint.x, -far_endpoint.y, far_endpoint.z));
+ if ((matrix[8] == 0) && (matrix[9] == 0)) {
+ near_endpoint_left = near_endpoint_right;
+ near_endpoint_left.x = -near_endpoint_left.x;
+
+ far_endpoint_left = far_endpoint_right;
+ far_endpoint_left.x = -far_endpoint_left.x;
+ } else {
+ ///////--- Left Plane ---///////
+ Plane left_plane = Plane(matrix[0] + matrix[3],
+ matrix[4] + matrix[7],
+ matrix[8] + matrix[11],
+ -matrix[15] - matrix[12]);
+ left_plane.normalize();
+
+ res = near_plane.intersect_3(left_plane, top_plane, &near_endpoint_left);
+ ERR_FAIL_COND_V(!res, false);
+
+ res = far_plane.intersect_3(left_plane, top_plane, &far_endpoint_left);
+ ERR_FAIL_COND_V(!res, false);
+ }
+
+ p_8points[0] = p_transform.xform(Vector3(near_endpoint_right.x, near_endpoint_right.y, near_endpoint_right.z));
+ p_8points[1] = p_transform.xform(Vector3(near_endpoint_right.x, -near_endpoint_right.y, near_endpoint_right.z));
+ p_8points[2] = p_transform.xform(Vector3(near_endpoint_left.x, near_endpoint_left.y, near_endpoint_left.z));
+ p_8points[3] = p_transform.xform(Vector3(near_endpoint_left.x, -near_endpoint_left.y, near_endpoint_left.z));
+ p_8points[4] = p_transform.xform(Vector3(far_endpoint_right.x, far_endpoint_right.y, far_endpoint_right.z));
+ p_8points[5] = p_transform.xform(Vector3(far_endpoint_right.x, -far_endpoint_right.y, far_endpoint_right.z));
+ p_8points[6] = p_transform.xform(Vector3(far_endpoint_left.x, far_endpoint_left.y, far_endpoint_left.z));
+ p_8points[7] = p_transform.xform(Vector3(far_endpoint_left.x, -far_endpoint_left.y, far_endpoint_left.z));
return true;
}
@@ -506,8 +594,8 @@ void CameraMatrix::set_light_atlas_rect(const Rect2 &p_rect) {
m[9] = 0.0,
m[10] = 1.0,
m[11] = 0.0,
- m[12] = p_rect.pos.x,
- m[13] = p_rect.pos.y,
+ m[12] = p_rect.position.x,
+ m[13] = p_rect.position.y,
m[14] = 0.0,
m[15] = 1.0;
}
@@ -545,7 +633,18 @@ real_t CameraMatrix::get_fov() const {
-matrix[15] + matrix[12]);
right_plane.normalize();
- return Math::rad2deg(Math::acos(Math::abs(right_plane.normal.x))) * 2.0;
+ if ((matrix[8] == 0) && (matrix[9] == 0)) {
+ return Math::rad2deg(Math::acos(Math::abs(right_plane.normal.x))) * 2.0;
+ } else {
+ // our frustum is asymetrical need to calculate the left planes angle seperately..
+ Plane left_plane = Plane(matrix[3] + matrix[0],
+ matrix[7] + matrix[4],
+ matrix[11] + matrix[8],
+ matrix[15] + matrix[12]);
+ left_plane.normalize();
+
+ return Math::rad2deg(Math::acos(Math::abs(left_plane.normal.x))) + Math::rad2deg(Math::acos(Math::abs(right_plane.normal.x)));
+ }
}
void CameraMatrix::make_scale(const Vector3 &p_scale) {
@@ -558,8 +657,8 @@ void CameraMatrix::make_scale(const Vector3 &p_scale) {
void CameraMatrix::scale_translate_to_fit(const Rect3 &p_aabb) {
- Vector3 min = p_aabb.pos;
- Vector3 max = p_aabb.pos + p_aabb.size;
+ Vector3 min = p_aabb.position;
+ Vector3 max = p_aabb.position + p_aabb.size;
matrix[0][0] = 2 / (max.x - min.x);
matrix[1][0] = 0;
diff --git a/core/math/camera_matrix.h b/core/math/camera_matrix.h
index 857628c703..4be8ffab8c 100644
--- a/core/math/camera_matrix.h
+++ b/core/math/camera_matrix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -53,6 +54,8 @@ struct CameraMatrix {
void set_light_bias();
void set_light_atlas_rect(const Rect2 &p_rect);
void set_perspective(real_t p_fovy_degrees, real_t p_aspect, real_t p_z_near, real_t p_z_far, bool p_flip_fov = false);
+ void set_perspective(real_t p_fovy_degrees, real_t p_aspect, real_t p_z_near, real_t p_z_far, bool p_flip_fov, int p_eye, real_t p_intraocular_dist, real_t p_convergence_dist);
+ void set_for_hmd(int p_eye, real_t p_aspect, real_t p_intraocular_dist, real_t p_display_width, real_t p_display_to_lens, real_t p_oversample, real_t p_z_near, real_t p_z_far);
void set_orthogonal(real_t p_left, real_t p_right, real_t p_bottom, real_t p_top, real_t p_znear, real_t p_zfar);
void set_orthogonal(real_t p_size, real_t p_aspect, real_t p_znear, real_t p_zfar, bool p_flip_fov = false);
void set_frustum(real_t p_left, real_t p_right, real_t p_bottom, real_t p_top, real_t p_near, real_t p_far);
diff --git a/core/math/face3.cpp b/core/math/face3.cpp
index 6a15feefe1..0e292500bf 100644
--- a/core/math/face3.cpp
+++ b/core/math/face3.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -196,20 +197,20 @@ bool Face3::intersects_aabb(const Rect3 &p_aabb) const {
/** TEST FACE AXIS */
-#define TEST_AXIS(m_ax) \
- { \
- real_t aabb_min = p_aabb.pos.m_ax; \
- real_t aabb_max = p_aabb.pos.m_ax + p_aabb.size.m_ax; \
- real_t tri_min, tri_max; \
- for (int i = 0; i < 3; i++) { \
- if (i == 0 || vertex[i].m_ax > tri_max) \
- tri_max = vertex[i].m_ax; \
- if (i == 0 || vertex[i].m_ax < tri_min) \
- tri_min = vertex[i].m_ax; \
- } \
- \
- if (tri_max < aabb_min || aabb_max < tri_min) \
- return false; \
+#define TEST_AXIS(m_ax) \
+ { \
+ real_t aabb_min = p_aabb.position.m_ax; \
+ real_t aabb_max = p_aabb.position.m_ax + p_aabb.size.m_ax; \
+ real_t tri_min, tri_max; \
+ for (int i = 0; i < 3; i++) { \
+ if (i == 0 || vertex[i].m_ax > tri_max) \
+ tri_max = vertex[i].m_ax; \
+ if (i == 0 || vertex[i].m_ax < tri_min) \
+ tri_min = vertex[i].m_ax; \
+ } \
+ \
+ if (tri_max < aabb_min || aabb_max < tri_min) \
+ return false; \
}
TEST_AXIS(x);
@@ -271,8 +272,8 @@ void Face3::project_range(const Vector3 &p_normal, const Transform &p_transform,
void Face3::get_support(const Vector3 &p_normal, const Transform &p_transform, Vector3 *p_vertices, int *p_count, int p_max) const {
-#define _FACE_IS_VALID_SUPPORT_TRESHOLD 0.98
-#define _EDGE_IS_VALID_SUPPORT_TRESHOLD 0.05
+#define _FACE_IS_VALID_SUPPORT_THRESHOLD 0.98
+#define _EDGE_IS_VALID_SUPPORT_THRESHOLD 0.05
if (p_max <= 0)
return;
@@ -280,7 +281,7 @@ void Face3::get_support(const Vector3 &p_normal, const Transform &p_transform, V
Vector3 n = p_transform.basis.xform_inv(p_normal);
/** TEST FACE AS SUPPORT **/
- if (get_plane().normal.dot(n) > _FACE_IS_VALID_SUPPORT_TRESHOLD) {
+ if (get_plane().normal.dot(n) > _FACE_IS_VALID_SUPPORT_THRESHOLD) {
*p_count = MIN(3, p_max);
@@ -317,7 +318,7 @@ void Face3::get_support(const Vector3 &p_normal, const Transform &p_transform, V
// check if edge is valid as a support
real_t dot = (vertex[i] - vertex[(i + 1) % 3]).normalized().dot(n);
dot = ABS(dot);
- if (dot < _EDGE_IS_VALID_SUPPORT_TRESHOLD) {
+ if (dot < _EDGE_IS_VALID_SUPPORT_THRESHOLD) {
*p_count = MIN(2, p_max);
diff --git a/core/math/face3.h b/core/math/face3.h
index 6d15c60e3b..3d02ae4014 100644
--- a/core/math/face3.h
+++ b/core/math/face3.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -100,7 +101,7 @@ bool Face3::intersects_aabb2(const Rect3 &p_aabb) const {
Vector3 perp = (vertex[0] - vertex[2]).cross(vertex[0] - vertex[1]);
Vector3 half_extents = p_aabb.size * 0.5;
- Vector3 ofs = p_aabb.pos + half_extents;
+ Vector3 ofs = p_aabb.position + half_extents;
Vector3 sup = Vector3(
(perp.x > 0) ? -half_extents.x : half_extents.x,
@@ -114,20 +115,20 @@ bool Face3::intersects_aabb2(const Rect3 &p_aabb) const {
if (dist_a * dist_b > 0)
return false; //does not intersect the plane
-#define TEST_AXIS(m_ax) \
- { \
- real_t aabb_min = p_aabb.pos.m_ax; \
- real_t aabb_max = p_aabb.pos.m_ax + p_aabb.size.m_ax; \
- real_t tri_min, tri_max; \
- for (int i = 0; i < 3; i++) { \
- if (i == 0 || vertex[i].m_ax > tri_max) \
- tri_max = vertex[i].m_ax; \
- if (i == 0 || vertex[i].m_ax < tri_min) \
- tri_min = vertex[i].m_ax; \
- } \
- \
- if (tri_max < aabb_min || aabb_max < tri_min) \
- return false; \
+#define TEST_AXIS(m_ax) \
+ { \
+ real_t aabb_min = p_aabb.position.m_ax; \
+ real_t aabb_max = p_aabb.position.m_ax + p_aabb.size.m_ax; \
+ real_t tri_min, tri_max; \
+ for (int i = 0; i < 3; i++) { \
+ if (i == 0 || vertex[i].m_ax > tri_max) \
+ tri_max = vertex[i].m_ax; \
+ if (i == 0 || vertex[i].m_ax < tri_min) \
+ tri_min = vertex[i].m_ax; \
+ } \
+ \
+ if (tri_max < aabb_min || aabb_max < tri_min) \
+ return false; \
}
TEST_AXIS(x);
@@ -149,68 +150,68 @@ bool Face3::intersects_aabb2(const Rect3 &p_aabb) const {
case 0: {
- from = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y, p_aabb.pos.z);
- to = Vector3(p_aabb.pos.x, p_aabb.pos.y, p_aabb.pos.z);
+ from = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z);
+ to = Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z);
} break;
case 1: {
- from = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y, p_aabb.pos.z + p_aabb.size.z);
- to = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y, p_aabb.pos.z);
+ from = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z);
+ to = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z);
} break;
case 2: {
- from = Vector3(p_aabb.pos.x, p_aabb.pos.y, p_aabb.pos.z + p_aabb.size.z);
- to = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y, p_aabb.pos.z + p_aabb.size.z);
+ from = Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z);
+ to = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z);
} break;
case 3: {
- from = Vector3(p_aabb.pos.x, p_aabb.pos.y, p_aabb.pos.z);
- to = Vector3(p_aabb.pos.x, p_aabb.pos.y, p_aabb.pos.z + p_aabb.size.z);
+ from = Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z);
+ to = Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z);
} break;
case 4: {
- from = Vector3(p_aabb.pos.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z);
- to = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z);
+ from = Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z);
+ to = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z);
} break;
case 5: {
- from = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z);
- to = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z + p_aabb.size.z);
+ from = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z);
+ to = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z);
} break;
case 6: {
- from = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z + p_aabb.size.z);
- to = Vector3(p_aabb.pos.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z + p_aabb.size.z);
+ from = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z);
+ to = Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z);
} break;
case 7: {
- from = Vector3(p_aabb.pos.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z + p_aabb.size.z);
- to = Vector3(p_aabb.pos.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z);
+ from = Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z);
+ to = Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z);
} break;
case 8: {
- from = Vector3(p_aabb.pos.x, p_aabb.pos.y, p_aabb.pos.z + p_aabb.size.z);
- to = Vector3(p_aabb.pos.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z + p_aabb.size.z);
+ from = Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z);
+ to = Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z);
} break;
case 9: {
- from = Vector3(p_aabb.pos.x, p_aabb.pos.y, p_aabb.pos.z);
- to = Vector3(p_aabb.pos.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z);
+ from = Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z);
+ to = Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z);
} break;
case 10: {
- from = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y, p_aabb.pos.z);
- to = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z);
+ from = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z);
+ to = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z);
} break;
case 11: {
- from = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y, p_aabb.pos.z + p_aabb.size.z);
- to = Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z + p_aabb.size.z);
+ from = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z);
+ to = Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z);
} break;
}
diff --git a/core/math/geometry.cpp b/core/math/geometry.cpp
index 97579e41ef..2bea514d37 100644
--- a/core/math/geometry.cpp
+++ b/core/math/geometry.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -300,7 +301,7 @@ enum _CellFlags {
static inline void _plot_face(uint8_t ***p_cell_status, int x, int y, int z, int len_x, int len_y, int len_z, const Vector3 &voxelsize, const Face3 &p_face) {
Rect3 aabb(Vector3(x, y, z), Vector3(len_x, len_y, len_z));
- aabb.pos = aabb.pos * voxelsize;
+ aabb.position = aabb.position * voxelsize;
aabb.size = aabb.size * voxelsize;
if (!p_face.intersects_aabb(aabb))
@@ -639,7 +640,7 @@ PoolVector<Face3> Geometry::wrap_geometry(PoolVector<Face3> p_array, real_t *p_e
Face3 f = faces[i];
for (int j = 0; j < 3; j++) {
- f.vertex[j] -= global_aabb.pos;
+ f.vertex[j] -= global_aabb.position;
}
_plot_face(cell_status, 0, 0, 0, div_x, div_y, div_z, voxelsize, f);
}
@@ -706,7 +707,7 @@ PoolVector<Face3> Geometry::wrap_geometry(PoolVector<Face3> p_array, real_t *p_e
Vector3 &v = wrapped_faces_ptr[i].vertex[j];
v = v * voxelsize;
- v += global_aabb.pos;
+ v += global_aabb.position;
}
}
diff --git a/core/math/geometry.h b/core/math/geometry.h
index 26f977e6eb..909d8164c3 100644
--- a/core/math/geometry.h
+++ b/core/math/geometry.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -104,23 +105,23 @@ 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
+#if 1
+//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))
//calculate the parametric position on the 2 curves, mua and mub
- real_t mua = ( d_of(p1,q1,q2,q1) * d_of(q2,q1,p2,p1) - d_of(p1,q1,p2,p1) * d_of(q2,q1,q2,q1) ) / ( d_of(p2,p1,p2,p1) * d_of(q2,q1,q2,q1) - d_of(q2,q1,p2,p1) * d_of(q2,q1,p2,p1) );
- real_t mub = ( d_of(p1,q1,q2,q1) + mua * d_of(q2,q1,p2,p1) ) / d_of(q2,q1,q2,q1);
+ real_t mua = (d_of(p1, q1, q2, q1) * d_of(q2, q1, p2, p1) - d_of(p1, q1, p2, p1) * d_of(q2, q1, q2, q1)) / (d_of(p2, p1, p2, p1) * d_of(q2, q1, q2, q1) - d_of(q2, q1, p2, p1) * d_of(q2, q1, p2, p1));
+ real_t mub = (d_of(p1, q1, q2, q1) + mua * d_of(q2, q1, p2, p1)) / d_of(q2, q1, q2, q1);
//clip the value between [0..1] constraining the solution to lie on the original curves
if (mua < 0) mua = 0;
if (mub < 0) mub = 0;
if (mua > 1) mua = 1;
if (mub > 1) mub = 1;
- c1 = p1.linear_interpolate(p2,mua);
- c2 = q1.linear_interpolate(q2,mub);
-#endif
-
+ c1 = p1.linear_interpolate(p2, mua);
+ c2 = q1.linear_interpolate(q2, mub);
+#else
+ //this is broken do not use
Vector3 u = p2 - p1;
Vector3 v = q2 - q1;
Vector3 w = p1 - q1;
@@ -143,8 +144,9 @@ public:
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)
+// get the difference of the two closest points
+//Vector dP = w + (sc * u) - (tc * v); // = L1(sc) - L2(tc)
+#endif
}
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_2d.cpp b/core/math/math_2d.cpp
index 021b1fbf55..956cfe5258 100644
--- a/core/math/math_2d.cpp
+++ b/core/math/math_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -61,6 +62,11 @@ Vector2 Vector2::normalized() const {
return v;
}
+bool Vector2::is_normalized() const {
+ // use length_squared() instead of length() to avoid sqrt(), makes it more stringent.
+ return Math::is_equal_approx(length_squared(), 1.0);
+}
+
real_t Vector2::distance_to(const Vector2 &p_vector2) const {
return Math::sqrt((x - p_vector2.x) * (x - p_vector2.x) + (y - p_vector2.y) * (y - p_vector2.y));
@@ -274,13 +280,23 @@ Vector2 Vector2::cubic_interpolate(const Vector2 &p_b, const Vector2 &p_pre_a, c
*/
}
-Vector2 Vector2::slide(const Vector2 &p_vec) const {
+// slide returns the component of the vector along the given plane, specified by its normal vector.
+Vector2 Vector2::slide(const Vector2 &p_normal) const {
+#ifdef MATH_CHECKS
+ ERR_FAIL_COND_V(p_normal.is_normalized() == false, Vector2());
+#endif
+ return *this - p_normal * this->dot(p_normal);
+}
- return p_vec - *this * this->dot(p_vec);
+Vector2 Vector2::bounce(const Vector2 &p_normal) const {
+ return -reflect(p_normal);
}
-Vector2 Vector2::reflect(const Vector2 &p_vec) const {
- return p_vec - *this * this->dot(p_vec) * 2.0;
+Vector2 Vector2::reflect(const Vector2 &p_normal) const {
+#ifdef MATH_CHECKS
+ ERR_FAIL_COND_V(p_normal.is_normalized() == false, Vector2());
+#endif
+ return 2.0 * p_normal * this->dot(p_normal) - *this;
}
bool Rect2::intersects_segment(const Point2 &p_from, const Point2 &p_to, Point2 *r_pos, Point2 *r_normal) const {
@@ -292,7 +308,7 @@ bool Rect2::intersects_segment(const Point2 &p_from, const Point2 &p_to, Point2
for (int i = 0; i < 2; i++) {
real_t seg_from = p_from[i];
real_t seg_to = p_to[i];
- real_t box_begin = pos[i];
+ real_t box_begin = position[i];
real_t box_end = box_begin + size[i];
real_t cmin, cmax;
real_t csign;
@@ -424,7 +440,9 @@ Transform2D Transform2D::inverse() const {
void Transform2D::affine_invert() {
real_t det = basis_determinant();
+#ifdef MATH_CHECKS
ERR_FAIL_COND(det == 0);
+#endif
real_t idet = 1.0 / det;
SWAP(elements[0][0], elements[1][1]);
@@ -449,7 +467,7 @@ real_t Transform2D::get_rotation() const {
real_t det = basis_determinant();
Transform2D m = orthonormalized();
if (det < 0) {
- m.scale_basis(Size2(-1, -1));
+ m.scale_basis(Size2(1, -1)); // convention to separate rotation and reflection for 2D is to absorb a flip along y into scaling.
}
return Math::atan2(m[0].y, m[0].x);
}
@@ -477,7 +495,7 @@ Transform2D::Transform2D(real_t p_rot, const Vector2 &p_pos) {
Size2 Transform2D::get_scale() const {
real_t det_sign = basis_determinant() > 0 ? 1 : -1;
- return det_sign * Size2(elements[0].length(), elements[1].length());
+ return Size2(elements[0].length(), det_sign * elements[1].length());
}
void Transform2D::scale(const Size2 &p_scale) {
diff --git a/core/math/math_2d.h b/core/math/math_2d.h
index af6437d7f1..6fea6c8adb 100644
--- a/core/math/math_2d.h
+++ b/core/math/math_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -42,6 +43,14 @@ enum Margin {
MARGIN_BOTTOM
};
+enum Corner {
+
+ CORNER_TOP_LEFT,
+ CORNER_TOP_RIGHT,
+ CORNER_BOTTOM_RIGHT,
+ CORNER_BOTTOM_LEFT
+};
+
enum Orientation {
HORIZONTAL,
@@ -82,6 +91,7 @@ struct Vector2 {
void normalize();
Vector2 normalized() const;
+ bool is_normalized() const;
real_t length() const;
real_t length_squared() const;
@@ -105,8 +115,9 @@ struct Vector2 {
Vector2 cubic_interpolate(const Vector2 &p_b, const Vector2 &p_pre_a, const Vector2 &p_post_b, real_t p_t) const;
Vector2 cubic_interpolate_soft(const Vector2 &p_b, const Vector2 &p_pre_a, const Vector2 &p_post_b, real_t p_t) const;
- Vector2 slide(const Vector2 &p_vec) const;
- Vector2 reflect(const Vector2 &p_vec) const;
+ Vector2 slide(const Vector2 &p_normal) const;
+ Vector2 bounce(const Vector2 &p_normal) const;
+ Vector2 reflect(const Vector2 &p_normal) const;
Vector2 operator+(const Vector2 &p_v) const;
void operator+=(const Vector2 &p_v);
@@ -204,24 +215,24 @@ struct Transform2D;
struct Rect2 {
- Point2 pos;
+ Point2 position;
Size2 size;
- const Vector2 &get_pos() const { return pos; }
- void set_pos(const Vector2 &p_pos) { pos = p_pos; }
+ const Vector2 &get_position() const { return position; }
+ void set_position(const Vector2 &p_pos) { position = p_pos; }
const Vector2 &get_size() const { return size; }
void set_size(const Vector2 &p_size) { size = p_size; }
real_t get_area() const { return size.width * size.height; }
inline bool intersects(const Rect2 &p_rect) const {
- if (pos.x >= (p_rect.pos.x + p_rect.size.width))
+ if (position.x >= (p_rect.position.x + p_rect.size.width))
return false;
- if ((pos.x + size.width) <= p_rect.pos.x)
+ if ((position.x + size.width) <= p_rect.position.x)
return false;
- if (pos.y >= (p_rect.pos.y + p_rect.size.height))
+ if (position.y >= (p_rect.position.y + p_rect.size.height))
return false;
- if ((pos.y + size.height) <= p_rect.pos.y)
+ if ((position.y + size.height) <= p_rect.position.y)
return false;
return true;
@@ -231,17 +242,17 @@ struct Rect2 {
real_t dist = 1e20;
- if (p_point.x < pos.x) {
- dist = MIN(dist, pos.x - p_point.x);
+ if (p_point.x < position.x) {
+ dist = MIN(dist, position.x - p_point.x);
}
- if (p_point.y < pos.y) {
- dist = MIN(dist, pos.y - p_point.y);
+ if (p_point.y < position.y) {
+ dist = MIN(dist, position.y - p_point.y);
}
- if (p_point.x >= (pos.x + size.x)) {
- dist = MIN(p_point.x - (pos.x + size.x), dist);
+ if (p_point.x >= (position.x + size.x)) {
+ dist = MIN(p_point.x - (position.x + size.x), dist);
}
- if (p_point.y >= (pos.y + size.y)) {
- dist = MIN(p_point.y - (pos.y + size.y), dist);
+ if (p_point.y >= (position.y + size.y)) {
+ dist = MIN(p_point.y - (position.y + size.y), dist);
}
if (dist == 1e20)
@@ -256,9 +267,9 @@ struct Rect2 {
inline bool encloses(const Rect2 &p_rect) const {
- return (p_rect.pos.x >= pos.x) && (p_rect.pos.y >= pos.y) &&
- ((p_rect.pos.x + p_rect.size.x) < (pos.x + size.x)) &&
- ((p_rect.pos.y + p_rect.size.y) < (pos.y + size.y));
+ return (p_rect.position.x >= position.x) && (p_rect.position.y >= position.y) &&
+ ((p_rect.position.x + p_rect.size.x) < (position.x + size.x)) &&
+ ((p_rect.position.y + p_rect.size.y) < (position.y + size.y));
}
inline bool has_no_area() const {
@@ -272,14 +283,14 @@ struct Rect2 {
if (!intersects(new_rect))
return Rect2();
- new_rect.pos.x = MAX(p_rect.pos.x, pos.x);
- new_rect.pos.y = MAX(p_rect.pos.y, pos.y);
+ new_rect.position.x = MAX(p_rect.position.x, position.x);
+ new_rect.position.y = MAX(p_rect.position.y, position.y);
- Point2 p_rect_end = p_rect.pos + p_rect.size;
- Point2 end = pos + size;
+ Point2 p_rect_end = p_rect.position + p_rect.size;
+ Point2 end = position + size;
- new_rect.size.x = MIN(p_rect_end.x, end.x) - new_rect.pos.x;
- new_rect.size.y = MIN(p_rect_end.y, end.y) - new_rect.pos.y;
+ new_rect.size.x = MIN(p_rect_end.x, end.x) - new_rect.position.x;
+ new_rect.size.y = MIN(p_rect_end.y, end.y) - new_rect.position.y;
return new_rect;
}
@@ -288,25 +299,25 @@ struct Rect2 {
Rect2 new_rect;
- new_rect.pos.x = MIN(p_rect.pos.x, pos.x);
- new_rect.pos.y = MIN(p_rect.pos.y, pos.y);
+ new_rect.position.x = MIN(p_rect.position.x, position.x);
+ new_rect.position.y = MIN(p_rect.position.y, position.y);
- new_rect.size.x = MAX(p_rect.pos.x + p_rect.size.x, pos.x + size.x);
- new_rect.size.y = MAX(p_rect.pos.y + p_rect.size.y, pos.y + size.y);
+ new_rect.size.x = MAX(p_rect.position.x + p_rect.size.x, position.x + size.x);
+ new_rect.size.y = MAX(p_rect.position.y + p_rect.size.y, position.y + size.y);
- new_rect.size = new_rect.size - new_rect.pos; //make relative again
+ new_rect.size = new_rect.size - new_rect.position; //make relative again
return new_rect;
};
inline bool has_point(const Point2 &p_point) const {
- if (p_point.x < pos.x)
+ if (p_point.x < position.x)
return false;
- if (p_point.y < pos.y)
+ if (p_point.y < position.y)
return false;
- if (p_point.x >= (pos.x + size.x))
+ if (p_point.x >= (position.x + size.x))
return false;
- if (p_point.y >= (pos.y + size.y))
+ if (p_point.y >= (position.y + size.y))
return false;
return true;
@@ -314,18 +325,37 @@ struct Rect2 {
inline bool no_area() const { return (size.width <= 0 || size.height <= 0); }
- bool operator==(const Rect2 &p_rect) const { return pos == p_rect.pos && size == p_rect.size; }
- bool operator!=(const Rect2 &p_rect) const { return pos != p_rect.pos || size != p_rect.size; }
+ bool operator==(const Rect2 &p_rect) const { return position == p_rect.position && size == p_rect.size; }
+ bool operator!=(const Rect2 &p_rect) const { return position != p_rect.position || size != p_rect.size; }
inline Rect2 grow(real_t p_by) const {
Rect2 g = *this;
- g.pos.x -= p_by;
- g.pos.y -= p_by;
+ g.position.x -= p_by;
+ g.position.y -= p_by;
g.size.width += p_by * 2;
g.size.height += p_by * 2;
return g;
}
+ inline Rect2 grow_margin(Margin p_margin, real_t p_amount) const {
+ Rect2 g = *this;
+ g.grow_individual((MARGIN_LEFT == p_margin) ? p_amount : 0,
+ (MARGIN_TOP == p_margin) ? p_amount : 0,
+ (MARGIN_RIGHT == p_margin) ? p_amount : 0,
+ (MARGIN_BOTTOM == p_margin) ? p_amount : 0);
+ return g;
+ }
+
+ inline Rect2 grow_individual(real_t p_left, real_t p_top, real_t p_right, real_t p_bottom) const {
+
+ Rect2 g = *this;
+ g.position.x -= p_left;
+ g.position.y -= p_top;
+ g.size.width += p_left + p_right;
+ g.size.height += p_top + p_bottom;
+
+ return g;
+ }
inline Rect2 expand(const Vector2 &p_vector) const {
@@ -336,8 +366,8 @@ struct Rect2 {
inline void expand_to(const Vector2 &p_vector) { //in place function for speed
- Vector2 begin = pos;
- Vector2 end = pos + size;
+ Vector2 begin = position;
+ Vector2 end = position + size;
if (p_vector.x < begin.x)
begin.x = p_vector.x;
@@ -349,20 +379,20 @@ struct Rect2 {
if (p_vector.y > end.y)
end.y = p_vector.y;
- pos = begin;
+ position = begin;
size = end - begin;
}
- operator String() const { return String(pos) + ", " + String(size); }
+ operator String() const { return String(position) + ", " + String(size); }
Rect2() {}
- Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height) {
- pos = Point2(p_x, p_y);
- size = Size2(p_width, p_height);
+ Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height)
+ : position(Point2(p_x, p_y)),
+ size(Size2(p_width, p_height)) {
}
- Rect2(const Point2 &p_pos, const Size2 &p_size) {
- pos = p_pos;
- size = p_size;
+ Rect2(const Point2 &p_pos, const Size2 &p_size)
+ : position(p_pos),
+ size(p_size) {
}
};
@@ -431,24 +461,24 @@ typedef Point2i Size2i;
struct Rect2i {
- Point2i pos;
+ Point2i position;
Size2i size;
- const Point2i &get_pos() const { return pos; }
- void set_pos(const Point2i &p_pos) { pos = p_pos; }
+ const Point2i &get_position() const { return position; }
+ void set_position(const Point2i &p_pos) { position = p_pos; }
const Point2i &get_size() const { return size; }
void set_size(const Point2i &p_size) { size = p_size; }
int get_area() const { return size.width * size.height; }
inline bool intersects(const Rect2i &p_rect) const {
- if (pos.x > (p_rect.pos.x + p_rect.size.width))
+ if (position.x > (p_rect.position.x + p_rect.size.width))
return false;
- if ((pos.x + size.width) < p_rect.pos.x)
+ if ((position.x + size.width) < p_rect.position.x)
return false;
- if (pos.y > (p_rect.pos.y + p_rect.size.height))
+ if (position.y > (p_rect.position.y + p_rect.size.height))
return false;
- if ((pos.y + size.height) < p_rect.pos.y)
+ if ((position.y + size.height) < p_rect.position.y)
return false;
return true;
@@ -456,9 +486,9 @@ struct Rect2i {
inline bool encloses(const Rect2i &p_rect) const {
- return (p_rect.pos.x >= pos.x) && (p_rect.pos.y >= pos.y) &&
- ((p_rect.pos.x + p_rect.size.x) < (pos.x + size.x)) &&
- ((p_rect.pos.y + p_rect.size.y) < (pos.y + size.y));
+ return (p_rect.position.x >= position.x) && (p_rect.position.y >= position.y) &&
+ ((p_rect.position.x + p_rect.size.x) < (position.x + size.x)) &&
+ ((p_rect.position.y + p_rect.size.y) < (position.y + size.y));
}
inline bool has_no_area() const {
@@ -472,14 +502,14 @@ struct Rect2i {
if (!intersects(new_rect))
return Rect2i();
- new_rect.pos.x = MAX(p_rect.pos.x, pos.x);
- new_rect.pos.y = MAX(p_rect.pos.y, pos.y);
+ new_rect.position.x = MAX(p_rect.position.x, position.x);
+ new_rect.position.y = MAX(p_rect.position.y, position.y);
- Point2 p_rect_end = p_rect.pos + p_rect.size;
- Point2 end = pos + size;
+ Point2 p_rect_end = p_rect.position + p_rect.size;
+ Point2 end = position + size;
- new_rect.size.x = (int)(MIN(p_rect_end.x, end.x) - new_rect.pos.x);
- new_rect.size.y = (int)(MIN(p_rect_end.y, end.y) - new_rect.pos.y);
+ new_rect.size.x = (int)(MIN(p_rect_end.x, end.x) - new_rect.position.x);
+ new_rect.size.y = (int)(MIN(p_rect_end.y, end.y) - new_rect.position.y);
return new_rect;
}
@@ -488,25 +518,25 @@ struct Rect2i {
Rect2i new_rect;
- new_rect.pos.x = MIN(p_rect.pos.x, pos.x);
- new_rect.pos.y = MIN(p_rect.pos.y, pos.y);
+ new_rect.position.x = MIN(p_rect.position.x, position.x);
+ new_rect.position.y = MIN(p_rect.position.y, position.y);
- new_rect.size.x = MAX(p_rect.pos.x + p_rect.size.x, pos.x + size.x);
- new_rect.size.y = MAX(p_rect.pos.y + p_rect.size.y, pos.y + size.y);
+ new_rect.size.x = MAX(p_rect.position.x + p_rect.size.x, position.x + size.x);
+ new_rect.size.y = MAX(p_rect.position.y + p_rect.size.y, position.y + size.y);
- new_rect.size = new_rect.size - new_rect.pos; //make relative again
+ new_rect.size = new_rect.size - new_rect.position; //make relative again
return new_rect;
};
bool has_point(const Point2 &p_point) const {
- if (p_point.x < pos.x)
+ if (p_point.x < position.x)
return false;
- if (p_point.y < pos.y)
+ if (p_point.y < position.y)
return false;
- if (p_point.x >= (pos.x + size.x))
+ if (p_point.x >= (position.x + size.x))
return false;
- if (p_point.y >= (pos.y + size.y))
+ if (p_point.y >= (position.y + size.y))
return false;
return true;
@@ -514,14 +544,14 @@ struct Rect2i {
bool no_area() { return (size.width <= 0 || size.height <= 0); }
- bool operator==(const Rect2i &p_rect) const { return pos == p_rect.pos && size == p_rect.size; }
- bool operator!=(const Rect2i &p_rect) const { return pos != p_rect.pos || size != p_rect.size; }
+ bool operator==(const Rect2i &p_rect) const { return position == p_rect.position && size == p_rect.size; }
+ bool operator!=(const Rect2i &p_rect) const { return position != p_rect.position || size != p_rect.size; }
Rect2i grow(int p_by) const {
Rect2i g = *this;
- g.pos.x -= p_by;
- g.pos.y -= p_by;
+ g.position.x -= p_by;
+ g.position.y -= p_by;
g.size.width += p_by * 2;
g.size.height += p_by * 2;
return g;
@@ -529,8 +559,8 @@ struct Rect2i {
inline void expand_to(const Point2i &p_vector) {
- Point2i begin = pos;
- Point2i end = pos + size;
+ Point2i begin = position;
+ Point2i end = position + size;
if (p_vector.x < begin.x)
begin.x = p_vector.x;
@@ -542,25 +572,25 @@ struct Rect2i {
if (p_vector.y > end.y)
end.y = p_vector.y;
- pos = begin;
+ position = begin;
size = end - begin;
}
- operator String() const { return String(pos) + ", " + String(size); }
+ operator String() const { return String(position) + ", " + String(size); }
- operator Rect2() const { return Rect2(pos, size); }
- Rect2i(const Rect2 &p_r2) {
- pos = p_r2.pos;
- size = p_r2.size;
+ operator Rect2() const { return Rect2(position, size); }
+ Rect2i(const Rect2 &p_r2)
+ : position(p_r2.position),
+ size(p_r2.size) {
}
Rect2i() {}
- Rect2i(int p_x, int p_y, int p_width, int p_height) {
- pos = Point2(p_x, p_y);
- size = Size2(p_width, p_height);
+ Rect2i(int p_x, int p_y, int p_width, int p_height)
+ : position(Point2(p_x, p_y)),
+ size(Size2(p_width, p_height)) {
}
- Rect2i(const Point2 &p_pos, const Size2 &p_size) {
- pos = p_pos;
- size = p_size;
+ Rect2i(const Point2 &p_pos, const Size2 &p_size)
+ : position(p_pos),
+ size(p_size) {
}
};
@@ -599,9 +629,9 @@ struct Transform2D {
void affine_invert();
Transform2D affine_inverse() const;
- void set_rotation(real_t p_phi);
+ void set_rotation(real_t p_rot);
real_t get_rotation() const;
- _FORCE_INLINE_ void set_rotation_and_scale(real_t p_phi, const Size2 &p_scale);
+ _FORCE_INLINE_ void set_rotation_and_scale(real_t p_rot, const Size2 &p_scale);
void rotate(real_t p_phi);
void scale(const Size2 &p_scale);
@@ -638,8 +668,8 @@ struct Transform2D {
_FORCE_INLINE_ Vector2 basis_xform_inv(const Vector2 &p_vec) const;
_FORCE_INLINE_ Vector2 xform(const Vector2 &p_vec) const;
_FORCE_INLINE_ Vector2 xform_inv(const Vector2 &p_vec) const;
- _FORCE_INLINE_ Rect2 xform(const Rect2 &p_vec) const;
- _FORCE_INLINE_ Rect2 xform_inv(const Rect2 &p_vec) const;
+ _FORCE_INLINE_ Rect2 xform(const Rect2 &p_rect) const;
+ _FORCE_INLINE_ Rect2 xform_inv(const Rect2 &p_rect) const;
operator String() const;
@@ -665,30 +695,30 @@ bool Rect2::intersects_transformed(const Transform2D &p_xform, const Rect2 &p_re
//SAT intersection between local and transformed rect2
Vector2 xf_points[4] = {
- p_xform.xform(p_rect.pos),
- p_xform.xform(Vector2(p_rect.pos.x + p_rect.size.x, p_rect.pos.y)),
- p_xform.xform(Vector2(p_rect.pos.x, p_rect.pos.y + p_rect.size.y)),
- p_xform.xform(Vector2(p_rect.pos.x + p_rect.size.x, p_rect.pos.y + p_rect.size.y)),
+ p_xform.xform(p_rect.position),
+ p_xform.xform(Vector2(p_rect.position.x + p_rect.size.x, p_rect.position.y)),
+ p_xform.xform(Vector2(p_rect.position.x, p_rect.position.y + p_rect.size.y)),
+ p_xform.xform(Vector2(p_rect.position.x + p_rect.size.x, p_rect.position.y + p_rect.size.y)),
};
real_t low_limit;
//base rect2 first (faster)
- if (xf_points[0].y > pos.y)
+ if (xf_points[0].y > position.y)
goto next1;
- if (xf_points[1].y > pos.y)
+ if (xf_points[1].y > position.y)
goto next1;
- if (xf_points[2].y > pos.y)
+ if (xf_points[2].y > position.y)
goto next1;
- if (xf_points[3].y > pos.y)
+ if (xf_points[3].y > position.y)
goto next1;
return false;
next1:
- low_limit = pos.y + size.y;
+ low_limit = position.y + size.y;
if (xf_points[0].y < low_limit)
goto next2;
@@ -703,20 +733,20 @@ next1:
next2:
- if (xf_points[0].x > pos.x)
+ if (xf_points[0].x > position.x)
goto next3;
- if (xf_points[1].x > pos.x)
+ if (xf_points[1].x > position.x)
goto next3;
- if (xf_points[2].x > pos.x)
+ if (xf_points[2].x > position.x)
goto next3;
- if (xf_points[3].x > pos.x)
+ if (xf_points[3].x > position.x)
goto next3;
return false;
next3:
- low_limit = pos.x + size.x;
+ low_limit = position.x + size.x;
if (xf_points[0].x < low_limit)
goto next4;
@@ -732,10 +762,10 @@ next3:
next4:
Vector2 xf_points2[4] = {
- pos,
- Vector2(pos.x + size.x, pos.y),
- Vector2(pos.x, pos.y + size.y),
- Vector2(pos.x + size.x, pos.y + size.y),
+ position,
+ Vector2(position.x + size.x, position.y),
+ Vector2(position.x, position.y + size.y),
+ Vector2(position.x + size.x, position.y + size.y),
};
real_t maxa = p_xform.elements[0].dot(xf_points2[0]);
@@ -811,25 +841,25 @@ next4:
return true;
}
-Vector2 Transform2D::basis_xform(const Vector2 &v) const {
+Vector2 Transform2D::basis_xform(const Vector2 &p_vec) const {
return Vector2(
- tdotx(v),
- tdoty(v));
+ tdotx(p_vec),
+ tdoty(p_vec));
}
-Vector2 Transform2D::basis_xform_inv(const Vector2 &v) const {
+Vector2 Transform2D::basis_xform_inv(const Vector2 &p_vec) const {
return Vector2(
- elements[0].dot(v),
- elements[1].dot(v));
+ elements[0].dot(p_vec),
+ elements[1].dot(p_vec));
}
-Vector2 Transform2D::xform(const Vector2 &v) const {
+Vector2 Transform2D::xform(const Vector2 &p_vec) const {
return Vector2(
- tdotx(v),
- tdoty(v)) +
+ tdotx(p_vec),
+ tdoty(p_vec)) +
elements[2];
}
Vector2 Transform2D::xform_inv(const Vector2 &p_vec) const {
@@ -844,10 +874,10 @@ Rect2 Transform2D::xform(const Rect2 &p_rect) const {
Vector2 x = elements[0] * p_rect.size.x;
Vector2 y = elements[1] * p_rect.size.y;
- Vector2 pos = xform(p_rect.pos);
+ Vector2 pos = xform(p_rect.position);
Rect2 new_rect;
- new_rect.pos = pos;
+ new_rect.position = pos;
new_rect.expand_to(pos + x);
new_rect.expand_to(pos + y);
new_rect.expand_to(pos + x + y);
@@ -865,14 +895,14 @@ void Transform2D::set_rotation_and_scale(real_t p_rot, const Size2 &p_scale) {
Rect2 Transform2D::xform_inv(const Rect2 &p_rect) const {
Vector2 ends[4] = {
- xform_inv(p_rect.pos),
- xform_inv(Vector2(p_rect.pos.x, p_rect.pos.y + p_rect.size.y)),
- xform_inv(Vector2(p_rect.pos.x + p_rect.size.x, p_rect.pos.y + p_rect.size.y)),
- xform_inv(Vector2(p_rect.pos.x + p_rect.size.x, p_rect.pos.y))
+ xform_inv(p_rect.position),
+ xform_inv(Vector2(p_rect.position.x, p_rect.position.y + p_rect.size.y)),
+ xform_inv(Vector2(p_rect.position.x + p_rect.size.x, p_rect.position.y + p_rect.size.y)),
+ xform_inv(Vector2(p_rect.position.x + p_rect.size.x, p_rect.position.y))
};
Rect2 new_rect;
- new_rect.pos = ends[0];
+ new_rect.position = ends[0];
new_rect.expand_to(ends[1]);
new_rect.expand_to(ends[2]);
new_rect.expand_to(ends[3]);
diff --git a/core/math/math_defs.h b/core/math/math_defs.h
index 08f4e27e64..3d9eb63e11 100644
--- a/core/math/math_defs.h
+++ b/core/math/math_defs.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,6 +35,10 @@
#define CMP_NORMALIZE_TOLERANCE 0.000001
#define CMP_POINT_IN_PLANE_EPSILON 0.00001
+#ifdef DEBUG_ENABLED
+#define MATH_CHECKS
+#endif
+
#define USEC_TO_SEC(m_usec) ((m_usec) / 1000000.0)
/**
* "Real" is a type that will be translated to either floats or fixed depending
diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp
index ccc463c114..9f5a9c193a 100644
--- a/core/math/math_funcs.cpp
+++ b/core/math/math_funcs.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,7 @@
#include "math_funcs.h"
#include "core/os/os.h"
-pcg32_random_t Math::default_pcg = { 1, PCG_DEFAULT_INC_64 };
+pcg32_random_t Math::default_pcg = { 12047754176567800795ULL, PCG_DEFAULT_INC_64 };
#define PHI 0x9e3779b9
@@ -50,9 +51,7 @@ void Math::seed(uint64_t x) {
}
void Math::randomize() {
-
- OS::Time time = OS::get_singleton()->get_time();
- seed(OS::get_singleton()->get_ticks_usec() * (time.hour + 1) * (time.min + 1) * (time.sec + 1) * rand()); // TODO: can be simplified.
+ seed(OS::get_singleton()->get_ticks_usec() * default_pcg.state + PCG_DEFAULT_INC_64);
}
uint32_t Math::rand() {
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h
index 3e02ac0bb8..45509a0808 100644
--- a/core/math/math_funcs.h
+++ b/core/math/math_funcs.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,9 +31,10 @@
#define MATH_FUNCS_H
#include "math_defs.h"
-#include "pcg.h"
#include "typedefs.h"
+#include "thirdparty/misc/pcg.h"
+
#include <float.h>
#include <math.h>
@@ -49,9 +51,7 @@ class Math {
public:
Math() {} // useless to instance
- enum {
- RANDOM_MAX = 4294967295L
- };
+ static const uint64_t RANDOM_MAX = 4294967295;
static _ALWAYS_INLINE_ double sin(double p_x) { return ::sin(p_x); }
static _ALWAYS_INLINE_ float sin(float p_x) { return ::sinf(p_x); }
@@ -110,6 +110,15 @@ public:
static _ALWAYS_INLINE_ bool is_inf(double p_val) {
#ifdef _MSC_VER
return !_finite(p_val);
+// use an inline implementation of isinf as a workaround for problematic libstdc++ versions from gcc 5.x era
+#elif defined(__GNUC__) && __GNUC__ < 6
+ union {
+ uint64_t u;
+ double f;
+ } ieee754;
+ ieee754.f = p_val;
+ return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) == 0x7ff00000 &&
+ ((unsigned)ieee754.u == 0);
#else
return isinf(p_val);
#endif
@@ -118,6 +127,14 @@ public:
static _ALWAYS_INLINE_ bool is_inf(float p_val) {
#ifdef _MSC_VER
return !_finite(p_val);
+// use an inline implementation of isinf as a workaround for problematic libstdc++ versions from gcc 5.x era
+#elif defined(__GNUC__) && __GNUC__ < 6
+ union {
+ uint32_t u;
+ float f;
+ } ieee754;
+ ieee754.f = p_val;
+ return (ieee754.u & 0x7fffffff) == 0x7f800000;
#else
return isinf(p_val);
#endif
@@ -156,7 +173,7 @@ public:
static uint32_t larger_prime(uint32_t p_val);
- static void seed(uint64_t x = 0);
+ static void seed(uint64_t x);
static void randomize();
static uint32_t rand_from_seed(uint64_t *seed);
static uint32_t rand();
@@ -167,7 +184,7 @@ public:
static float random(float from, float to);
static real_t random(int from, int to) { return (real_t)random((real_t)from, (real_t)to); }
- static _ALWAYS_INLINE_ bool isequal_approx(real_t a, real_t b) {
+ static _ALWAYS_INLINE_ bool is_equal_approx(real_t a, real_t b) {
// TODO: Comparing floats for approximate-equality is non-trivial.
// Using epsilon should cover the typical cases in Godot (where a == b is used to compare two reals), such as matrix and vector comparison operators.
// A proper implementation in terms of ULPs should eventually replace the contents of this function.
@@ -276,6 +293,10 @@ public:
return u.f32;
}
+ static _ALWAYS_INLINE_ float half_to_float(const uint16_t h) {
+ return halfptr_to_float(&h);
+ }
+
static _ALWAYS_INLINE_ uint16_t make_half_float(float f) {
union {
diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp
index b31df2fadb..f2f6ff93cf 100644
--- a/core/math/matrix3.cpp
+++ b/core/math/matrix3.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,7 @@
#include "matrix3.h"
#include "math_funcs.h"
#include "os/copymem.h"
-
+#include "print_string.h"
#define cofac(row1, col1, row2, col2) \
(elements[row1][col1] * elements[row2][col2] - elements[row1][col2] * elements[row2][col1])
@@ -61,8 +62,9 @@ void Basis::invert() {
real_t det = elements[0][0] * co[0] +
elements[0][1] * co[1] +
elements[0][2] * co[2];
-
+#ifdef MATH_CHECKS
ERR_FAIL_COND(det == 0);
+#endif
real_t s = 1.0 / det;
set(co[0] * s, cofac(0, 2, 2, 1) * s, cofac(0, 1, 1, 2) * s,
@@ -71,8 +73,9 @@ void Basis::invert() {
}
void Basis::orthonormalize() {
+#ifdef MATH_CHECKS
ERR_FAIL_COND(determinant() == 0);
-
+#endif
// Gram-Schmidt Process
Vector3 x = get_axis(0);
@@ -101,20 +104,20 @@ bool Basis::is_orthogonal() const {
Basis id;
Basis m = (*this) * transposed();
- return isequal_approx(id, m);
+ return is_equal_approx(id, m);
}
bool Basis::is_rotation() const {
- return Math::isequal_approx(determinant(), 1) && is_orthogonal();
+ return Math::is_equal_approx(determinant(), 1) && is_orthogonal();
}
bool Basis::is_symmetric() const {
- if (Math::abs(elements[0][1] - elements[1][0]) > CMP_EPSILON)
+ if (!Math::is_equal_approx(elements[0][1], elements[1][0]))
return false;
- if (Math::abs(elements[0][2] - elements[2][0]) > CMP_EPSILON)
+ if (!Math::is_equal_approx(elements[0][2], elements[2][0]))
return false;
- if (Math::abs(elements[1][2] - elements[2][1]) > CMP_EPSILON)
+ if (!Math::is_equal_approx(elements[1][2], elements[2][1]))
return false;
return true;
@@ -122,11 +125,11 @@ bool Basis::is_symmetric() const {
Basis Basis::diagonalize() {
- //NOTE: only implemented for symmetric matrices
- //with the Jacobi iterative method method
-
+//NOTE: only implemented for symmetric matrices
+//with the Jacobi iterative method method
+#ifdef MATH_CHECKS
ERR_FAIL_COND_V(!is_symmetric(), Basis());
-
+#endif
const int ite_max = 1024;
real_t off_matrix_norm_2 = elements[0][1] * elements[0][1] + elements[0][2] * elements[0][2] + elements[1][2] * elements[1][2];
@@ -159,7 +162,7 @@ Basis Basis::diagonalize() {
// Compute the rotation angle
real_t angle;
- if (Math::abs(elements[j][j] - elements[i][i]) < CMP_EPSILON) {
+ if (Math::is_equal_approx(elements[j][j], elements[i][i])) {
angle = Math_PI / 4;
} else {
angle = 0.5 * Math::atan(2 * elements[i][j] / (elements[j][j] - elements[i][i]));
@@ -225,11 +228,25 @@ Basis Basis::scaled(const Vector3 &p_scale) const {
}
Vector3 Basis::get_scale() const {
- // We are assuming M = R.S, and performing a polar decomposition to extract R and S.
- // FIXME: We eventually need a proper polar decomposition.
- // As a cheap workaround until then, to ensure that R is a proper rotation matrix with determinant +1
- // (such that it can be represented by a Quat or Euler angles), we absorb the sign flip into the scaling matrix.
- // As such, it works in conjunction with get_rotation().
+ // FIXME: We are assuming M = R.S (R is rotation and S is scaling), and use polar decomposition to extract R and S.
+ // A polar decomposition is M = O.P, where O is an orthogonal matrix (meaning rotation and reflection) and
+ // P is a positive semi-definite matrix (meaning it contains absolute values of scaling along its diagonal).
+ //
+ // Despite being different from what we want to achieve, we can nevertheless make use of polar decomposition
+ // here as follows. We can split O into a rotation and a reflection as O = R.Q, and obtain M = R.S where
+ // we defined S = Q.P. Now, R is a proper rotation matrix and S is a (signed) scaling matrix,
+ // which can involve negative scalings. However, there is a catch: unlike the polar decomposition of M = O.P,
+ // the decomposition of O into a rotation and reflection matrix as O = R.Q is not unique.
+ // Therefore, we are going to do this decomposition by sticking to a particular convention.
+ // This may lead to confusion for some users though.
+ //
+ // The convention we use here is to absorb the sign flip into the scaling matrix.
+ // The same convention is also used in other similar functions such as set_scale,
+ // get_rotation_axis_angle, get_rotation, set_rotation_axis_angle, set_rotation_euler, ...
+ //
+ // A proper way to get rid of this issue would be to store the scaling values (or at least their signs)
+ // as a part of Basis. However, if we go that path, we need to disable direct (write) access to the
+ // matrix elements.
real_t det_sign = determinant() > 0 ? 1 : -1;
return det_sign * Vector3(
Vector3(elements[0][0], elements[1][0], elements[2][0]).length(),
@@ -237,6 +254,17 @@ Vector3 Basis::get_scale() const {
Vector3(elements[0][2], elements[1][2], elements[2][2]).length());
}
+// Sets scaling while preserving rotation.
+// This requires some care when working with matrices with negative determinant,
+// since we're using a particular convention for "polar" decomposition in get_scale and get_rotation.
+// For details, see the explanation in get_scale.
+void Basis::set_scale(const Vector3 &p_scale) {
+ Vector3 e = get_euler();
+ Basis(); // reset to identity
+ scale(p_scale);
+ rotate(e);
+}
+
// Multiplies the matrix from left by the rotation matrix: M -> R.M
// Note that this does *not* rotate the matrix itself.
//
@@ -259,6 +287,7 @@ void Basis::rotate(const Vector3 &p_euler) {
*this = rotated(p_euler);
}
+// TODO: rename this to get_rotation_euler
Vector3 Basis::get_rotation() const {
// Assumes that the matrix can be decomposed into a proper rotation and scaling matrix as M = R.S,
// and returns the Euler angles corresponding to the rotation part, complementing get_scale().
@@ -273,7 +302,43 @@ Vector3 Basis::get_rotation() const {
return m.get_euler();
}
-// get_euler returns a vector containing the Euler angles in the format
+void Basis::get_rotation_axis_angle(Vector3 &p_axis, real_t &p_angle) const {
+ // Assumes that the matrix can be decomposed into a proper rotation and scaling matrix as M = R.S,
+ // and returns the Euler angles corresponding to the rotation part, complementing get_scale().
+ // See the comment in get_scale() for further information.
+ Basis m = orthonormalized();
+ real_t det = m.determinant();
+ if (det < 0) {
+ // Ensure that the determinant is 1, such that result is a proper rotation matrix which can be represented by Euler angles.
+ m.scale(Vector3(-1, -1, -1));
+ }
+
+ m.get_axis_angle(p_axis, p_angle);
+}
+
+// Sets rotation while preserving scaling.
+// This requires some care when working with matrices with negative determinant,
+// since we're using a particular convention for "polar" decomposition in get_scale and get_rotation.
+// For details, see the explanation in get_scale.
+void Basis::set_rotation_euler(const Vector3 &p_euler) {
+ Vector3 s = get_scale();
+ Basis(); // reset to identity
+ scale(s);
+ rotate(p_euler);
+}
+
+// Sets rotation while preserving scaling.
+// This requires some care when working with matrices with negative determinant,
+// since we're using a particular convention for "polar" decomposition in get_scale and get_rotation.
+// For details, see the explanation in get_scale.
+void Basis::set_rotation_axis_angle(const Vector3 &p_axis, real_t p_angle) {
+ Vector3 s = get_scale();
+ Basis(); // reset to identity
+ scale(s);
+ rotate(p_axis, p_angle);
+}
+
+// get_euler_xyz returns a vector containing the Euler angles in the format
// (a1,a2,a3), where a3 is the angle of the first rotation, and a1 is the last
// (following the convention they are commonly defined in the literature).
//
@@ -283,7 +348,7 @@ Vector3 Basis::get_rotation() const {
// And thus, assuming the matrix is a rotation matrix, this function returns
// the angles in the decomposition R = X(a1).Y(a2).Z(a3) where Z(a) rotates
// around the z-axis by a and so on.
-Vector3 Basis::get_euler() const {
+Vector3 Basis::get_euler_xyz() const {
// Euler angles in XYZ convention.
// See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
@@ -293,14 +358,25 @@ Vector3 Basis::get_euler() const {
// -cx*cz*sy+sx*sz cz*sx+cx*sy*sz cx*cy
Vector3 euler;
-
+#ifdef MATH_CHECKS
ERR_FAIL_COND_V(is_rotation() == false, euler);
-
+#endif
euler.y = Math::asin(elements[0][2]);
if (euler.y < Math_PI * 0.5) {
if (euler.y > -Math_PI * 0.5) {
- euler.x = Math::atan2(-elements[1][2], elements[2][2]);
- euler.z = Math::atan2(-elements[0][1], elements[0][0]);
+ //if rotation is Y-only, return a proper -pi,pi range like in x or z for the same case.
+ if (elements[1][0] == 0.0 && elements[0][1] == 0.0 && elements[0][0] < 0.0) {
+ euler.x = 0;
+ euler.z = 0;
+
+ if (euler.y > 0.0)
+ euler.y = Math_PI - euler.y;
+ else
+ euler.y = -(Math_PI + euler.y);
+ } else {
+ euler.x = Math::atan2(-elements[1][2], elements[2][2]);
+ euler.z = Math::atan2(-elements[0][1], elements[0][0]);
+ }
} else {
real_t r = Math::atan2(elements[1][0], elements[1][1]);
@@ -316,10 +392,11 @@ Vector3 Basis::get_euler() const {
return euler;
}
-// set_euler expects a vector containing the Euler angles in the format
-// (c,b,a), where a is the angle of the first rotation, and c is the last.
+// set_euler_xyz expects a vector containing the Euler angles in the format
+// (ax,ay,az), where ax is the angle of rotation around x axis,
+// and similar for other axes.
// The current implementation uses XYZ convention (Z is the first rotation).
-void Basis::set_euler(const Vector3 &p_euler) {
+void Basis::set_euler_xyz(const Vector3 &p_euler) {
real_t c, s;
@@ -339,11 +416,83 @@ void Basis::set_euler(const Vector3 &p_euler) {
*this = xmat * (ymat * zmat);
}
-bool Basis::isequal_approx(const Basis &a, const Basis &b) const {
+// get_euler_yxz returns a vector containing the Euler angles in the YXZ convention,
+// as in first-Z, then-X, last-Y. The angles for X, Y, and Z rotations are returned
+// as the x, y, and z components of a Vector3 respectively.
+Vector3 Basis::get_euler_yxz() const {
+
+ // Euler angles in YXZ convention.
+ // See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
+ //
+ // rot = cy*cz+sy*sx*sz cz*sy*sx-cy*sz cx*sy
+ // cx*sz cx*cz -sx
+ // cy*sx*sz-cz*sy cy*cz*sx+sy*sz cy*cx
+
+ Vector3 euler;
+#ifdef MATH_CHECKS
+ ERR_FAIL_COND_V(is_rotation() == false, euler);
+#endif
+ real_t m12 = elements[1][2];
+
+ if (m12 < 1) {
+ if (m12 > -1) {
+ if (elements[1][0] == 0 && elements[0][1] == 0 && elements[2][2] < 0) { // use pure x rotation
+ real_t x = asin(-m12);
+ euler.y = 0;
+ euler.z = 0;
+
+ if (x > 0.0)
+ euler.x = Math_PI - x;
+ else
+ euler.x = -(Math_PI + x);
+ } else {
+ euler.x = asin(-m12);
+ euler.y = atan2(elements[0][2], elements[2][2]);
+ euler.z = atan2(elements[1][0], elements[1][1]);
+ }
+ } else { // m12 == -1
+ euler.x = Math_PI * 0.5;
+ euler.y = -atan2(-elements[0][1], elements[0][0]);
+ euler.z = 0;
+ }
+ } else { // m12 == 1
+ euler.x = -Math_PI * 0.5;
+ euler.y = -atan2(-elements[0][1], elements[0][0]);
+ euler.z = 0;
+ }
+
+ return euler;
+}
+
+// set_euler_yxz expects a vector containing the Euler angles in the format
+// (ax,ay,az), where ax is the angle of rotation around x axis,
+// and similar for other axes.
+// The current implementation uses YXZ convention (Z is the first rotation).
+void Basis::set_euler_yxz(const Vector3 &p_euler) {
+
+ real_t c, s;
+
+ c = Math::cos(p_euler.x);
+ s = Math::sin(p_euler.x);
+ Basis xmat(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c);
+
+ c = Math::cos(p_euler.y);
+ s = Math::sin(p_euler.y);
+ Basis ymat(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c);
+
+ c = Math::cos(p_euler.z);
+ s = Math::sin(p_euler.z);
+ Basis zmat(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0);
+
+ //optimizer will optimize away all this anyway
+ *this = ymat * xmat * zmat;
+}
+
+bool Basis::is_equal_approx(const Basis &a, const Basis &b) const {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
- if (Math::isequal_approx(a.elements[i][j], b.elements[i][j]) == false)
+ if (Math::is_equal_approx(a.elements[i][j], b.elements[i][j]) == false)
return false;
}
}
@@ -386,8 +535,10 @@ Basis::operator String() const {
}
Basis::operator Quat() const {
- ERR_FAIL_COND_V(is_rotation() == false, Quat());
-
+ //commenting this check because precision issues cause it to fail when it shouldn't
+ //#ifdef MATH_CHECKS
+ //ERR_FAIL_COND_V(is_rotation() == false, Quat());
+ //#endif
real_t trace = elements[0][0] + elements[1][1] + elements[2][2];
real_t temp[4];
@@ -481,9 +632,10 @@ void Basis::set_orthogonal_index(int p_index) {
*this = _ortho_bases[p_index];
}
-void Basis::get_axis_and_angle(Vector3 &r_axis, real_t &r_angle) const {
+void Basis::get_axis_angle(Vector3 &r_axis, real_t &r_angle) const {
+#ifdef MATH_CHECKS
ERR_FAIL_COND(is_rotation() == false);
-
+#endif
real_t angle, x, y, z; // variables for result
real_t epsilon = 0.01; // margin to allow for rounding errors
real_t epsilon2 = 0.1; // margin to distinguish between 0 and 180 degrees
@@ -572,11 +724,11 @@ Basis::Basis(const Quat &p_quat) {
xz - wy, yz + wx, 1.0 - (xx + yy));
}
-Basis::Basis(const Vector3 &p_axis, real_t p_phi) {
- // Rotation matrix from axis and angle, see https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle
-
+void Basis::set_axis_angle(const Vector3 &p_axis, real_t p_phi) {
+// Rotation matrix from axis and angle, see https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_angle
+#ifdef MATH_CHECKS
ERR_FAIL_COND(p_axis.is_normalized() == false);
-
+#endif
Vector3 axis_sq(p_axis.x * p_axis.x, p_axis.y * p_axis.y, p_axis.z * p_axis.z);
real_t cosine = Math::cos(p_phi);
@@ -594,3 +746,7 @@ Basis::Basis(const Vector3 &p_axis, real_t p_phi) {
elements[2][1] = p_axis.y * p_axis.z * (1.0 - cosine) + p_axis.x * sine;
elements[2][2] = axis_sq.z + cosine * (1.0 - axis_sq.z);
}
+
+Basis::Basis(const Vector3 &p_axis, real_t p_phi) {
+ set_axis_angle(p_axis, p_phi);
+}
diff --git a/core/math/matrix3.h b/core/math/matrix3.h
index 0240bc8610..74e6564578 100644
--- a/core/math/matrix3.h
+++ b/core/math/matrix3.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -76,14 +77,29 @@ public:
void rotate(const Vector3 &p_euler);
Basis rotated(const Vector3 &p_euler) const;
+
Vector3 get_rotation() const;
+ void get_rotation_axis_angle(Vector3 &p_axis, real_t &p_angle) const;
+
+ void set_rotation_euler(const Vector3 &p_euler);
+ void set_rotation_axis_angle(const Vector3 &p_axis, real_t p_angle);
+
+ Vector3 get_euler_xyz() const;
+ void set_euler_xyz(const Vector3 &p_euler);
+ Vector3 get_euler_yxz() const;
+ void set_euler_yxz(const Vector3 &p_euler);
+
+ Vector3 get_euler() const { return get_euler_yxz(); };
+ void set_euler(const Vector3 &p_euler) { set_euler_yxz(p_euler); };
+
+ void get_axis_angle(Vector3 &r_axis, real_t &r_angle) const;
+ void set_axis_angle(const Vector3 &p_axis, real_t p_phi);
void scale(const Vector3 &p_scale);
Basis scaled(const Vector3 &p_scale) const;
- Vector3 get_scale() const;
- Vector3 get_euler() const;
- void set_euler(const Vector3 &p_euler);
+ Vector3 get_scale() const;
+ void set_scale(const Vector3 &p_scale);
// transposed dot products
_FORCE_INLINE_ real_t tdotx(const Vector3 &v) const {
@@ -96,7 +112,7 @@ public:
return elements[0][2] * v[0] + elements[1][2] * v[1] + elements[2][2] * v[2];
}
- bool isequal_approx(const Basis &a, const Basis &b) const;
+ bool is_equal_approx(const Basis &a, const Basis &b) const;
bool operator==(const Basis &p_matrix) const;
bool operator!=(const Basis &p_matrix) const;
@@ -120,8 +136,6 @@ public:
operator String() const;
- void get_axis_and_angle(Vector3 &r_axis, real_t &r_angle) const;
-
/* create / set */
_FORCE_INLINE_ void set(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz) {
@@ -136,6 +150,12 @@ public:
elements[2][1] = zy;
elements[2][2] = zz;
}
+ _FORCE_INLINE_ void set(const Vector3 &p_x, const Vector3 &p_y, const Vector3 &p_z) {
+
+ set_axis(0, p_x);
+ set_axis(1, p_y);
+ set_axis(2, p_z);
+ }
_FORCE_INLINE_ Vector3 get_column(int i) const {
return Vector3(elements[0][i], elements[1][i], elements[2][i]);
diff --git a/core/math/octree.h b/core/math/octree.h
index 06c5791b11..2e37056030 100644
--- a/core/math/octree.h
+++ b/core/math/octree.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -350,7 +351,7 @@ private:
};
void _cull_convex(Octant *p_octant, _CullConvexData *p_cull);
- void _cull_AABB(Octant *p_octant, const Rect3 &p_aabb, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask);
+ void _cull_aabb(Octant *p_octant, const Rect3 &p_aabb, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask);
void _cull_segment(Octant *p_octant, const Vector3 &p_from, const Vector3 &p_to, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask);
void _cull_point(Octant *p_octant, const Vector3 &p_point, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask);
@@ -379,7 +380,7 @@ public:
int get_subindex(OctreeElementID p_id) const;
int cull_convex(const Vector<Plane> &p_convex, T **p_result_array, int p_result_max, uint32_t p_mask = 0xFFFFFFFF);
- int cull_AABB(const Rect3 &p_aabb, T **p_result_array, int p_result_max, int *p_subindex_array = NULL, uint32_t p_mask = 0xFFFFFFFF);
+ int cull_aabb(const Rect3 &p_aabb, T **p_result_array, int p_result_max, int *p_subindex_array = NULL, uint32_t p_mask = 0xFFFFFFFF);
int cull_segment(const Vector3 &p_from, const Vector3 &p_to, T **p_result_array, int p_result_max, int *p_subindex_array = NULL, uint32_t p_mask = 0xFFFFFFFF);
int cull_point(const Vector3 &p_point, T **p_result_array, int p_result_max, int *p_subindex_array = NULL, uint32_t p_mask = 0xFFFFFFFF);
@@ -482,11 +483,11 @@ void Octree<T, use_pairs, AL>::_insert_element(Element *p_element, Octant *p_oct
aabb.size *= 0.5;
if (i & 1)
- aabb.pos.x += aabb.size.x;
+ aabb.position.x += aabb.size.x;
if (i & 2)
- aabb.pos.y += aabb.size.y;
+ aabb.position.y += aabb.size.y;
if (i & 4)
- aabb.pos.z += aabb.size.z;
+ aabb.position.z += aabb.size.z;
if (aabb.intersects_inclusive(p_element->aabb)) {
/* if actually intersects, create the child */
@@ -543,11 +544,11 @@ void Octree<T, use_pairs, AL>::_ensure_valid_root(const Rect3 &p_aabb) {
while (!base.encloses(p_aabb)) {
- if (ABS(base.pos.x + base.size.x) <= ABS(base.pos.x)) {
+ if (ABS(base.position.x + base.size.x) <= ABS(base.position.x)) {
/* grow towards positive */
base.size *= 2.0;
} else {
- base.pos -= base.size;
+ base.position -= base.size;
base.size *= 2.0;
}
}
@@ -575,14 +576,14 @@ void Octree<T, use_pairs, AL>::_ensure_valid_root(const Rect3 &p_aabb) {
octant_count++;
root->parent = gp;
- if (ABS(base.pos.x + base.size.x) <= ABS(base.pos.x)) {
+ if (ABS(base.position.x + base.size.x) <= ABS(base.position.x)) {
/* grow towards positive */
base.size *= 2.0;
gp->aabb = base;
gp->children[0] = root;
root->parent_index = 0;
} else {
- base.pos -= base.size;
+ base.position -= base.size;
base.size *= 2.0;
gp->aabb = base;
gp->children[(1 << 0) | (1 << 1) | (1 << 2)] = root; // add at all-positive
@@ -796,9 +797,9 @@ OctreeElementID Octree<T, use_pairs, AL>::create(T *p_userdata, const Rect3 &p_a
// check for AABB validity
#ifdef DEBUG_ENABLED
- ERR_FAIL_COND_V(p_aabb.pos.x > 1e15 || p_aabb.pos.x < -1e15, 0);
- ERR_FAIL_COND_V(p_aabb.pos.y > 1e15 || p_aabb.pos.y < -1e15, 0);
- ERR_FAIL_COND_V(p_aabb.pos.z > 1e15 || p_aabb.pos.z < -1e15, 0);
+ ERR_FAIL_COND_V(p_aabb.position.x > 1e15 || p_aabb.position.x < -1e15, 0);
+ ERR_FAIL_COND_V(p_aabb.position.y > 1e15 || p_aabb.position.y < -1e15, 0);
+ ERR_FAIL_COND_V(p_aabb.position.z > 1e15 || p_aabb.position.z < -1e15, 0);
ERR_FAIL_COND_V(p_aabb.size.x > 1e15 || p_aabb.size.x < 0.0, 0);
ERR_FAIL_COND_V(p_aabb.size.y > 1e15 || p_aabb.size.y < 0.0, 0);
ERR_FAIL_COND_V(p_aabb.size.z > 1e15 || p_aabb.size.z < 0.0, 0);
@@ -836,9 +837,9 @@ void Octree<T, use_pairs, AL>::move(OctreeElementID p_id, const Rect3 &p_aabb) {
#ifdef DEBUG_ENABLED
// check for AABB validity
- ERR_FAIL_COND(p_aabb.pos.x > 1e15 || p_aabb.pos.x < -1e15);
- ERR_FAIL_COND(p_aabb.pos.y > 1e15 || p_aabb.pos.y < -1e15);
- ERR_FAIL_COND(p_aabb.pos.z > 1e15 || p_aabb.pos.z < -1e15);
+ ERR_FAIL_COND(p_aabb.position.x > 1e15 || p_aabb.position.x < -1e15);
+ ERR_FAIL_COND(p_aabb.position.y > 1e15 || p_aabb.position.y < -1e15);
+ ERR_FAIL_COND(p_aabb.position.z > 1e15 || p_aabb.position.z < -1e15);
ERR_FAIL_COND(p_aabb.size.x > 1e15 || p_aabb.size.x < 0.0);
ERR_FAIL_COND(p_aabb.size.y > 1e15 || p_aabb.size.y < 0.0);
ERR_FAIL_COND(p_aabb.size.z > 1e15 || p_aabb.size.z < 0.0);
@@ -1094,7 +1095,7 @@ void Octree<T, use_pairs, AL>::_cull_convex(Octant *p_octant, _CullConvexData *p
}
template <class T, bool use_pairs, class AL>
-void Octree<T, use_pairs, AL>::_cull_AABB(Octant *p_octant, const Rect3 &p_aabb, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask) {
+void Octree<T, use_pairs, AL>::_cull_aabb(Octant *p_octant, const Rect3 &p_aabb, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask) {
if (*p_result_idx == p_result_max)
return; //pointless
@@ -1159,7 +1160,7 @@ void Octree<T, use_pairs, AL>::_cull_AABB(Octant *p_octant, const Rect3 &p_aabb,
for (int i = 0; i < 8; i++) {
if (p_octant->children[i] && p_octant->children[i]->aabb.intersects_inclusive(p_aabb)) {
- _cull_AABB(p_octant->children[i], p_aabb, p_result_array, p_result_idx, p_result_max, p_subindex_array, p_mask);
+ _cull_aabb(p_octant->children[i], p_aabb, p_result_array, p_result_idx, p_result_max, p_subindex_array, p_mask);
}
}
}
@@ -1335,14 +1336,14 @@ int Octree<T, use_pairs, AL>::cull_convex(const Vector<Plane> &p_convex, T **p_r
}
template <class T, bool use_pairs, class AL>
-int Octree<T, use_pairs, AL>::cull_AABB(const Rect3 &p_aabb, T **p_result_array, int p_result_max, int *p_subindex_array, uint32_t p_mask) {
+int Octree<T, use_pairs, AL>::cull_aabb(const Rect3 &p_aabb, T **p_result_array, int p_result_max, int *p_subindex_array, uint32_t p_mask) {
if (!root)
return 0;
int result_count = 0;
pass++;
- _cull_AABB(root, p_aabb, p_result_array, &result_count, p_result_max, p_subindex_array, p_mask);
+ _cull_aabb(root, p_aabb, p_result_array, &result_count, p_result_max, p_subindex_array, p_mask);
return result_count;
}
diff --git a/core/math/plane.cpp b/core/math/plane.cpp
index bef5c3ab06..17928d07c3 100644
--- a/core/math/plane.cpp
+++ b/core/math/plane.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -102,7 +103,7 @@ bool Plane::intersect_3(const Plane &p_plane1, const Plane &p_plane2, Vector3 *r
return true;
}
-bool Plane::intersects_ray(Vector3 p_from, Vector3 p_dir, Vector3 *p_intersection) const {
+bool Plane::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *p_intersection) const {
Vector3 segment = p_dir;
real_t den = normal.dot(segment);
@@ -127,7 +128,7 @@ bool Plane::intersects_ray(Vector3 p_from, Vector3 p_dir, Vector3 *p_intersectio
return true;
}
-bool Plane::intersects_segment(Vector3 p_begin, Vector3 p_end, Vector3 *p_intersection) const {
+bool Plane::intersects_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 *p_intersection) const {
Vector3 segment = p_begin - p_end;
real_t den = normal.dot(segment);
diff --git a/core/math/plane.h b/core/math/plane.h
index 380452f6d2..73d584e553 100644
--- a/core/math/plane.h
+++ b/core/math/plane.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -55,8 +56,8 @@ public:
/* intersections */
bool intersect_3(const Plane &p_plane1, const Plane &p_plane2, Vector3 *r_result = 0) const;
- bool intersects_ray(Vector3 p_from, Vector3 p_dir, Vector3 *p_intersection) const;
- bool intersects_segment(Vector3 p_begin, Vector3 p_end, Vector3 *p_intersection) const;
+ bool intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *p_intersection) const;
+ bool intersects_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 *p_intersection) const;
_FORCE_INLINE_ Vector3 project(const Vector3 &p_point) const {
@@ -74,7 +75,8 @@ public:
_FORCE_INLINE_ Plane() { d = 0; }
_FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d)
- : normal(p_a, p_b, p_c), d(p_d){};
+ : normal(p_a, p_b, p_c),
+ d(p_d){};
_FORCE_INLINE_ Plane(const Vector3 &p_normal, real_t p_d);
_FORCE_INLINE_ Plane(const Vector3 &p_point, const Vector3 &p_normal);
@@ -98,16 +100,14 @@ bool Plane::has_point(const Vector3 &p_point, real_t _epsilon) const {
return (dist <= _epsilon);
}
-Plane::Plane(const Vector3 &p_normal, real_t p_d) {
-
- normal = p_normal;
- d = p_d;
+Plane::Plane(const Vector3 &p_normal, real_t p_d)
+ : normal(p_normal),
+ d(p_d) {
}
-Plane::Plane(const Vector3 &p_point, const Vector3 &p_normal) {
-
- normal = p_normal;
- d = p_normal.dot(p_point);
+Plane::Plane(const Vector3 &p_point, const Vector3 &p_normal)
+ : normal(p_normal),
+ d(p_normal.dot(p_point)) {
}
Plane::Plane(const Vector3 &p_point1, const Vector3 &p_point2, const Vector3 &p_point3, ClockDirection p_dir) {
diff --git a/core/math/quat.cpp b/core/math/quat.cpp
index b990e9184f..5984cdf657 100644
--- a/core/math/quat.cpp
+++ b/core/math/quat.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,10 +31,11 @@
#include "matrix3.h"
#include "print_string.h"
-// set_euler expects a vector containing the Euler angles in the format
-// (c,b,a), where a is the angle of the first rotation, and c is the last.
-// The current implementation uses XYZ convention (Z is the first rotation).
-void Quat::set_euler(const Vector3 &p_euler) {
+// set_euler_xyz expects a vector containing the Euler angles in the format
+// (ax,ay,az), where ax is the angle of rotation around x axis,
+// and similar for other axes.
+// This implementation uses XYZ convention (Z is the first rotation).
+void Quat::set_euler_xyz(const Vector3 &p_euler) {
real_t half_a1 = p_euler.x * 0.5;
real_t half_a2 = p_euler.y * 0.5;
real_t half_a3 = p_euler.z * 0.5;
@@ -55,12 +57,48 @@ void Quat::set_euler(const Vector3 &p_euler) {
-sin_a1 * sin_a2 * sin_a3 + cos_a1 * cos_a2 * cos_a3);
}
-// get_euler returns a vector containing the Euler angles in the format
-// (a1,a2,a3), where a3 is the angle of the first rotation, and a1 is the last.
-// The current implementation uses XYZ convention (Z is the first rotation).
-Vector3 Quat::get_euler() const {
+// get_euler_xyz returns a vector containing the Euler angles in the format
+// (ax,ay,az), where ax is the angle of rotation around x axis,
+// and similar for other axes.
+// This implementation uses XYZ convention (Z is the first rotation).
+Vector3 Quat::get_euler_xyz() const {
Basis m(*this);
- return m.get_euler();
+ return m.get_euler_xyz();
+}
+
+// set_euler_yxz expects a vector containing the Euler angles in the format
+// (ax,ay,az), where ax is the angle of rotation around x axis,
+// and similar for other axes.
+// This implementation uses YXZ convention (Z is the first rotation).
+void Quat::set_euler_yxz(const Vector3 &p_euler) {
+ real_t half_a1 = p_euler.y * 0.5;
+ real_t half_a2 = p_euler.x * 0.5;
+ real_t half_a3 = p_euler.z * 0.5;
+
+ // R = Y(a1).X(a2).Z(a3) convention for Euler angles.
+ // Conversion to quaternion as listed in https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770024290.pdf (page A-6)
+ // a3 is the angle of the first rotation, following the notation in this reference.
+
+ real_t cos_a1 = Math::cos(half_a1);
+ real_t sin_a1 = Math::sin(half_a1);
+ real_t cos_a2 = Math::cos(half_a2);
+ real_t sin_a2 = Math::sin(half_a2);
+ real_t cos_a3 = Math::cos(half_a3);
+ real_t sin_a3 = Math::sin(half_a3);
+
+ set(sin_a1 * cos_a2 * sin_a3 + cos_a1 * sin_a2 * cos_a3,
+ sin_a1 * cos_a2 * cos_a3 - cos_a1 * sin_a2 * sin_a3,
+ -sin_a1 * sin_a2 * cos_a3 + cos_a1 * sin_a2 * sin_a3,
+ sin_a1 * sin_a2 * sin_a3 + cos_a1 * cos_a2 * cos_a3);
+}
+
+// get_euler_yxz returns a vector containing the Euler angles in the format
+// (ax,ay,az), where ax is the angle of rotation around x axis,
+// and similar for other axes.
+// This implementation uses YXZ convention (Z is the first rotation).
+Vector3 Quat::get_euler_yxz() const {
+ Basis m(*this);
+ return m.get_euler_yxz();
}
void Quat::operator*=(const Quat &q) {
@@ -91,6 +129,10 @@ Quat Quat::normalized() const {
return *this / length();
}
+bool Quat::is_normalized() const {
+ return Math::is_equal_approx(length(), 1.0);
+}
+
Quat Quat::inverse() const {
return Quat(-x, -y, -z, w);
}
diff --git a/core/math/quat.h b/core/math/quat.h
index 3fc843b83a..0e378eb4e4 100644
--- a/core/math/quat.h
+++ b/core/math/quat.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -47,15 +48,23 @@ public:
real_t length() const;
void normalize();
Quat normalized() const;
+ bool is_normalized() const;
Quat inverse() const;
_FORCE_INLINE_ real_t dot(const Quat &q) const;
- void set_euler(const Vector3 &p_euler);
- Vector3 get_euler() const;
+
+ void set_euler_xyz(const Vector3 &p_euler);
+ Vector3 get_euler_xyz() const;
+ void set_euler_yxz(const Vector3 &p_euler);
+ Vector3 get_euler_yxz() const;
+
+ void set_euler(const Vector3 &p_euler) { set_euler_yxz(p_euler); };
+ Vector3 get_euler() const { return get_euler_yxz(); };
+
Quat slerp(const Quat &q, const real_t &t) const;
Quat slerpni(const Quat &q, const real_t &t) const;
Quat cubic_slerp(const Quat &q, const Quat &prep, const Quat &postq, const real_t &t) const;
- _FORCE_INLINE_ void get_axis_and_angle(Vector3 &r_axis, real_t &r_angle) const {
+ _FORCE_INLINE_ void get_axis_angle(Vector3 &r_axis, real_t &r_angle) const {
r_angle = 2 * Math::acos(w);
r_axis.x = x / Math::sqrt(1 - w * w);
r_axis.y = y / Math::sqrt(1 - w * w);
diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp
index a235d1cf32..54b97ac38c 100644
--- a/core/math/quick_hull.cpp
+++ b/core/math/quick_hull.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,7 +42,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me
for (int i = 0; i < p_points.size(); i++) {
if (i == 0) {
- aabb.pos = p_points[i];
+ aabb.position = p_points[i];
} else {
aabb.expand_to(p_points[i]);
}
@@ -57,7 +58,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me
for (int i = 0; i < p_points.size(); i++) {
- Vector3 sp = p_points[i].snapped(0.0001);
+ Vector3 sp = p_points[i].snapped(Vector3(0.0001, 0.0001, 0.0001));
if (valid_cache.has(sp)) {
valid_points[i] = false;
//print_line("INVALIDATED: "+itos(i));
diff --git a/core/math/quick_hull.h b/core/math/quick_hull.h
index 43a802e6bd..49600649e3 100644
--- a/core/math/quick_hull.h
+++ b/core/math/quick_hull.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/math/rect3.cpp b/core/math/rect3.cpp
index c0cd66d9bb..973607f565 100644
--- a/core/math/rect3.cpp
+++ b/core/math/rect3.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,11 +38,11 @@ real_t Rect3::get_area() const {
bool Rect3::operator==(const Rect3 &p_rval) const {
- return ((pos == p_rval.pos) && (size == p_rval.size));
+ return ((position == p_rval.position) && (size == p_rval.size));
}
bool Rect3::operator!=(const Rect3 &p_rval) const {
- return ((pos != p_rval.pos) || (size != p_rval.size));
+ return ((position != p_rval.position) || (size != p_rval.size));
}
void Rect3::merge_with(const Rect3 &p_aabb) {
@@ -50,8 +51,8 @@ void Rect3::merge_with(const Rect3 &p_aabb) {
Vector3 end_1, end_2;
Vector3 min, max;
- beg_1 = pos;
- beg_2 = p_aabb.pos;
+ beg_1 = position;
+ beg_2 = p_aabb.position;
end_1 = Vector3(size.x, size.y, size.z) + beg_1;
end_2 = Vector3(p_aabb.size.x, p_aabb.size.y, p_aabb.size.z) + beg_2;
@@ -63,16 +64,16 @@ void Rect3::merge_with(const Rect3 &p_aabb) {
max.y = (end_1.y > end_2.y) ? end_1.y : end_2.y;
max.z = (end_1.z > end_2.z) ? end_1.z : end_2.z;
- pos = min;
+ position = min;
size = max - min;
}
Rect3 Rect3::intersection(const Rect3 &p_aabb) const {
- Vector3 src_min = pos;
- Vector3 src_max = pos + size;
- Vector3 dst_min = p_aabb.pos;
- Vector3 dst_max = p_aabb.pos + p_aabb.size;
+ Vector3 src_min = position;
+ Vector3 src_max = position + size;
+ Vector3 dst_min = p_aabb.position;
+ Vector3 dst_max = p_aabb.position + p_aabb.size;
Vector3 min, max;
@@ -106,18 +107,18 @@ Rect3 Rect3::intersection(const Rect3 &p_aabb) const {
bool Rect3::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *r_clip, Vector3 *r_normal) const {
Vector3 c1, c2;
- Vector3 end = pos + size;
+ Vector3 end = position + size;
real_t near = -1e20;
real_t far = 1e20;
int axis = 0;
for (int i = 0; i < 3; i++) {
if (p_dir[i] == 0) {
- if ((p_from[i] < pos[i]) || (p_from[i] > end[i])) {
+ if ((p_from[i] < position[i]) || (p_from[i] > end[i])) {
return false;
}
} else { // ray not parallel to planes in this direction
- c1[i] = (pos[i] - p_from[i]) / p_dir[i];
+ c1[i] = (position[i] - p_from[i]) / p_dir[i];
c2[i] = (end[i] - p_from[i]) / p_dir[i];
if (c1[i] > c2[i]) {
@@ -155,7 +156,7 @@ bool Rect3::intersects_segment(const Vector3 &p_from, const Vector3 &p_to, Vecto
for (int i = 0; i < 3; i++) {
real_t seg_from = p_from[i];
real_t seg_to = p_to[i];
- real_t box_begin = pos[i];
+ real_t box_begin = position[i];
real_t box_end = box_begin + size[i];
real_t cmin, cmax;
real_t csign;
@@ -207,14 +208,14 @@ bool Rect3::intersects_segment(const Vector3 &p_from, const Vector3 &p_to, Vecto
bool Rect3::intersects_plane(const Plane &p_plane) const {
Vector3 points[8] = {
- Vector3(pos.x, pos.y, pos.z),
- Vector3(pos.x, pos.y, pos.z + size.z),
- Vector3(pos.x, pos.y + size.y, pos.z),
- Vector3(pos.x, pos.y + size.y, pos.z + size.z),
- Vector3(pos.x + size.x, pos.y, pos.z),
- Vector3(pos.x + size.x, pos.y, pos.z + size.z),
- Vector3(pos.x + size.x, pos.y + size.y, pos.z),
- Vector3(pos.x + size.x, pos.y + size.y, pos.z + size.z),
+ Vector3(position.x, position.y, position.z),
+ Vector3(position.x, position.y, position.z + size.z),
+ Vector3(position.x, position.y + size.y, position.z),
+ Vector3(position.x, position.y + size.y, position.z + size.z),
+ Vector3(position.x + size.x, position.y, position.z),
+ Vector3(position.x + size.x, position.y, position.z + size.z),
+ Vector3(position.x + size.x, position.y + size.y, position.z),
+ Vector3(position.x + size.x, position.y + size.y, position.z + size.z),
};
bool over = false;
@@ -326,68 +327,68 @@ void Rect3::get_edge(int p_edge, Vector3 &r_from, Vector3 &r_to) const {
case 0: {
- r_from = Vector3(pos.x + size.x, pos.y, pos.z);
- r_to = Vector3(pos.x, pos.y, pos.z);
+ r_from = Vector3(position.x + size.x, position.y, position.z);
+ r_to = Vector3(position.x, position.y, position.z);
} break;
case 1: {
- r_from = Vector3(pos.x + size.x, pos.y, pos.z + size.z);
- r_to = Vector3(pos.x + size.x, pos.y, pos.z);
+ r_from = Vector3(position.x + size.x, position.y, position.z + size.z);
+ r_to = Vector3(position.x + size.x, position.y, position.z);
} break;
case 2: {
- r_from = Vector3(pos.x, pos.y, pos.z + size.z);
- r_to = Vector3(pos.x + size.x, pos.y, pos.z + size.z);
+ r_from = Vector3(position.x, position.y, position.z + size.z);
+ r_to = Vector3(position.x + size.x, position.y, position.z + size.z);
} break;
case 3: {
- r_from = Vector3(pos.x, pos.y, pos.z);
- r_to = Vector3(pos.x, pos.y, pos.z + size.z);
+ r_from = Vector3(position.x, position.y, position.z);
+ r_to = Vector3(position.x, position.y, position.z + size.z);
} break;
case 4: {
- r_from = Vector3(pos.x, pos.y + size.y, pos.z);
- r_to = Vector3(pos.x + size.x, pos.y + size.y, pos.z);
+ r_from = Vector3(position.x, position.y + size.y, position.z);
+ r_to = Vector3(position.x + size.x, position.y + size.y, position.z);
} break;
case 5: {
- r_from = Vector3(pos.x + size.x, pos.y + size.y, pos.z);
- r_to = Vector3(pos.x + size.x, pos.y + size.y, pos.z + size.z);
+ r_from = Vector3(position.x + size.x, position.y + size.y, position.z);
+ r_to = Vector3(position.x + size.x, position.y + size.y, position.z + size.z);
} break;
case 6: {
- r_from = Vector3(pos.x + size.x, pos.y + size.y, pos.z + size.z);
- r_to = Vector3(pos.x, pos.y + size.y, pos.z + size.z);
+ r_from = Vector3(position.x + size.x, position.y + size.y, position.z + size.z);
+ r_to = Vector3(position.x, position.y + size.y, position.z + size.z);
} break;
case 7: {
- r_from = Vector3(pos.x, pos.y + size.y, pos.z + size.z);
- r_to = Vector3(pos.x, pos.y + size.y, pos.z);
+ r_from = Vector3(position.x, position.y + size.y, position.z + size.z);
+ r_to = Vector3(position.x, position.y + size.y, position.z);
} break;
case 8: {
- r_from = Vector3(pos.x, pos.y, pos.z + size.z);
- r_to = Vector3(pos.x, pos.y + size.y, pos.z + size.z);
+ r_from = Vector3(position.x, position.y, position.z + size.z);
+ r_to = Vector3(position.x, position.y + size.y, position.z + size.z);
} break;
case 9: {
- r_from = Vector3(pos.x, pos.y, pos.z);
- r_to = Vector3(pos.x, pos.y + size.y, pos.z);
+ r_from = Vector3(position.x, position.y, position.z);
+ r_to = Vector3(position.x, position.y + size.y, position.z);
} break;
case 10: {
- r_from = Vector3(pos.x + size.x, pos.y, pos.z);
- r_to = Vector3(pos.x + size.x, pos.y + size.y, pos.z);
+ r_from = Vector3(position.x + size.x, position.y, position.z);
+ r_to = Vector3(position.x + size.x, position.y + size.y, position.z);
} break;
case 11: {
- r_from = Vector3(pos.x + size.x, pos.y, pos.z + size.z);
- r_to = Vector3(pos.x + size.x, pos.y + size.y, pos.z + size.z);
+ r_from = Vector3(position.x + size.x, position.y, position.z + size.z);
+ r_to = Vector3(position.x + size.x, position.y + size.y, position.z + size.z);
} break;
}
@@ -395,5 +396,5 @@ void Rect3::get_edge(int p_edge, Vector3 &r_from, Vector3 &r_to) const {
Rect3::operator String() const {
- return String() + pos + " - " + size;
+ return String() + position + " - " + size;
}
diff --git a/core/math/rect3.h b/core/math/rect3.h
index 0b11cd7b52..7c971f5ac7 100644
--- a/core/math/rect3.h
+++ b/core/math/rect3.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,12 +36,12 @@
/**
* AABB / AABB (Axis Aligned Bounding Box)
- * This is implemented by a point (pos) and the box size
+ * This is implemented by a point (position) and the box size
*/
class Rect3 {
public:
- Vector3 pos;
+ Vector3 position;
Vector3 size;
real_t get_area() const; /// get area
@@ -54,8 +55,8 @@ public:
return (size.x <= CMP_EPSILON && size.y <= CMP_EPSILON && size.z <= CMP_EPSILON);
}
- const Vector3 &get_pos() const { return pos; }
- void set_pos(const Vector3 &p_pos) { pos = p_pos; }
+ const Vector3 &get_position() const { return position; }
+ void set_position(const Vector3 &p_pos) { position = p_pos; }
const Vector3 &get_size() const { return size; }
void set_size(const Vector3 &p_size) { size = p_size; }
@@ -71,9 +72,9 @@ public:
Rect3 intersection(const Rect3 &p_aabb) const; ///get box where two intersect, empty if no intersection occurs
bool intersects_segment(const Vector3 &p_from, const Vector3 &p_to, Vector3 *r_clip = NULL, Vector3 *r_normal = NULL) const;
bool intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *r_clip = NULL, Vector3 *r_normal = NULL) const;
- _FORCE_INLINE_ bool smits_intersect_ray(const Vector3 &from, const Vector3 &p_dir, real_t t0, real_t t1) const;
+ _FORCE_INLINE_ bool smits_intersect_ray(const Vector3 &p_from, const Vector3 &p_dir, real_t t0, real_t t1) const;
- _FORCE_INLINE_ bool intersects_convex_shape(const Plane *p_plane, int p_plane_count) const;
+ _FORCE_INLINE_ bool intersects_convex_shape(const Plane *p_planes, int p_plane_count) const;
bool intersects_plane(const Plane &p_plane) const;
_FORCE_INLINE_ bool has_point(const Vector3 &p_point) const;
@@ -100,25 +101,25 @@ public:
operator String() const;
_FORCE_INLINE_ Rect3() {}
- inline Rect3(const Vector3 &p_pos, const Vector3 &p_size) {
- pos = p_pos;
- size = p_size;
+ inline Rect3(const Vector3 &p_pos, const Vector3 &p_size)
+ : position(p_pos),
+ size(p_size) {
}
};
inline bool Rect3::intersects(const Rect3 &p_aabb) const {
- if (pos.x >= (p_aabb.pos.x + p_aabb.size.x))
+ if (position.x >= (p_aabb.position.x + p_aabb.size.x))
return false;
- if ((pos.x + size.x) <= p_aabb.pos.x)
+ if ((position.x + size.x) <= p_aabb.position.x)
return false;
- if (pos.y >= (p_aabb.pos.y + p_aabb.size.y))
+ if (position.y >= (p_aabb.position.y + p_aabb.size.y))
return false;
- if ((pos.y + size.y) <= p_aabb.pos.y)
+ if ((position.y + size.y) <= p_aabb.position.y)
return false;
- if (pos.z >= (p_aabb.pos.z + p_aabb.size.z))
+ if (position.z >= (p_aabb.position.z + p_aabb.size.z))
return false;
- if ((pos.z + size.z) <= p_aabb.pos.z)
+ if ((position.z + size.z) <= p_aabb.position.z)
return false;
return true;
@@ -126,17 +127,17 @@ inline bool Rect3::intersects(const Rect3 &p_aabb) const {
inline bool Rect3::intersects_inclusive(const Rect3 &p_aabb) const {
- if (pos.x > (p_aabb.pos.x + p_aabb.size.x))
+ if (position.x > (p_aabb.position.x + p_aabb.size.x))
return false;
- if ((pos.x + size.x) < p_aabb.pos.x)
+ if ((position.x + size.x) < p_aabb.position.x)
return false;
- if (pos.y > (p_aabb.pos.y + p_aabb.size.y))
+ if (position.y > (p_aabb.position.y + p_aabb.size.y))
return false;
- if ((pos.y + size.y) < p_aabb.pos.y)
+ if ((position.y + size.y) < p_aabb.position.y)
return false;
- if (pos.z > (p_aabb.pos.z + p_aabb.size.z))
+ if (position.z > (p_aabb.position.z + p_aabb.size.z))
return false;
- if ((pos.z + size.z) < p_aabb.pos.z)
+ if ((position.z + size.z) < p_aabb.position.z)
return false;
return true;
@@ -144,10 +145,10 @@ inline bool Rect3::intersects_inclusive(const Rect3 &p_aabb) const {
inline bool Rect3::encloses(const Rect3 &p_aabb) const {
- Vector3 src_min = pos;
- Vector3 src_max = pos + size;
- Vector3 dst_min = p_aabb.pos;
- Vector3 dst_max = p_aabb.pos + p_aabb.size;
+ Vector3 src_min = position;
+ Vector3 src_max = position + size;
+ Vector3 dst_min = p_aabb.position;
+ Vector3 dst_max = p_aabb.position + p_aabb.size;
return (
(src_min.x <= dst_min.x) &&
@@ -161,7 +162,7 @@ inline bool Rect3::encloses(const Rect3 &p_aabb) const {
Vector3 Rect3::get_support(const Vector3 &p_normal) const {
Vector3 half_extents = size * 0.5;
- Vector3 ofs = pos + half_extents;
+ Vector3 ofs = position + half_extents;
return Vector3(
(p_normal.x > 0) ? -half_extents.x : half_extents.x,
@@ -173,14 +174,14 @@ Vector3 Rect3::get_support(const Vector3 &p_normal) const {
Vector3 Rect3::get_endpoint(int p_point) const {
switch (p_point) {
- case 0: return Vector3(pos.x, pos.y, pos.z);
- case 1: return Vector3(pos.x, pos.y, pos.z + size.z);
- case 2: return Vector3(pos.x, pos.y + size.y, pos.z);
- case 3: return Vector3(pos.x, pos.y + size.y, pos.z + size.z);
- case 4: return Vector3(pos.x + size.x, pos.y, pos.z);
- case 5: return Vector3(pos.x + size.x, pos.y, pos.z + size.z);
- case 6: return Vector3(pos.x + size.x, pos.y + size.y, pos.z);
- case 7: return Vector3(pos.x + size.x, pos.y + size.y, pos.z + size.z);
+ case 0: return Vector3(position.x, position.y, position.z);
+ case 1: return Vector3(position.x, position.y, position.z + size.z);
+ case 2: return Vector3(position.x, position.y + size.y, position.z);
+ case 3: return Vector3(position.x, position.y + size.y, position.z + size.z);
+ case 4: return Vector3(position.x + size.x, position.y, position.z);
+ case 5: return Vector3(position.x + size.x, position.y, position.z + size.z);
+ case 6: return Vector3(position.x + size.x, position.y + size.y, position.z);
+ case 7: return Vector3(position.x + size.x, position.y + size.y, position.z + size.z);
};
ERR_FAIL_V(Vector3());
@@ -191,7 +192,7 @@ bool Rect3::intersects_convex_shape(const Plane *p_planes, int p_plane_count) co
#if 1
Vector3 half_extents = size * 0.5;
- Vector3 ofs = pos + half_extents;
+ Vector3 ofs = position + half_extents;
for (int i = 0; i < p_plane_count; i++) {
const Plane &p = p_planes[i];
@@ -209,14 +210,14 @@ bool Rect3::intersects_convex_shape(const Plane *p_planes, int p_plane_count) co
//cache all points to check against!
// #warning should be easy to optimize, just use the same as when taking the support and use only that point
Vector3 points[8] = {
- Vector3(pos.x, pos.y, pos.z),
- Vector3(pos.x, pos.y, pos.z + size.z),
- Vector3(pos.x, pos.y + size.y, pos.z),
- Vector3(pos.x, pos.y + size.y, pos.z + size.z),
- Vector3(pos.x + size.x, pos.y, pos.z),
- Vector3(pos.x + size.x, pos.y, pos.z + size.z),
- Vector3(pos.x + size.x, pos.y + size.y, pos.z),
- Vector3(pos.x + size.x, pos.y + size.y, pos.z + size.z),
+ Vector3(position.x, position.y, position.z),
+ Vector3(position.x, position.y, position.z + size.z),
+ Vector3(position.x, position.y + size.y, position.z),
+ Vector3(position.x, position.y + size.y, position.z + size.z),
+ Vector3(position.x + size.x, position.y, position.z),
+ Vector3(position.x + size.x, position.y, position.z + size.z),
+ Vector3(position.x + size.x, position.y + size.y, position.z),
+ Vector3(position.x + size.x, position.y + size.y, position.z + size.z),
};
for (int i = 0; i < p_plane_count; i++) { //for each plane
@@ -245,17 +246,17 @@ bool Rect3::intersects_convex_shape(const Plane *p_planes, int p_plane_count) co
bool Rect3::has_point(const Vector3 &p_point) const {
- if (p_point.x < pos.x)
+ if (p_point.x < position.x)
return false;
- if (p_point.y < pos.y)
+ if (p_point.y < position.y)
return false;
- if (p_point.z < pos.z)
+ if (p_point.z < position.z)
return false;
- if (p_point.x > pos.x + size.x)
+ if (p_point.x > position.x + size.x)
return false;
- if (p_point.y > pos.y + size.y)
+ if (p_point.y > position.y + size.y)
return false;
- if (p_point.z > pos.z + size.z)
+ if (p_point.z > position.z + size.z)
return false;
return true;
@@ -263,8 +264,8 @@ bool Rect3::has_point(const Vector3 &p_point) const {
inline void Rect3::expand_to(const Vector3 &p_vector) {
- Vector3 begin = pos;
- Vector3 end = pos + size;
+ Vector3 begin = position;
+ Vector3 end = position + size;
if (p_vector.x < begin.x)
begin.x = p_vector.x;
@@ -280,14 +281,14 @@ inline void Rect3::expand_to(const Vector3 &p_vector) {
if (p_vector.z > end.z)
end.z = p_vector.z;
- pos = begin;
+ position = begin;
size = end - begin;
}
void Rect3::project_range_in_plane(const Plane &p_plane, real_t &r_min, real_t &r_max) const {
Vector3 half_extents(size.x * 0.5, size.y * 0.5, size.z * 0.5);
- Vector3 center(pos.x + half_extents.x, pos.y + half_extents.y, pos.z + half_extents.z);
+ Vector3 center(position.x + half_extents.x, position.y + half_extents.y, position.z + half_extents.z);
real_t length = p_plane.normal.abs().dot(half_extents);
real_t distance = p_plane.distance_to(center);
@@ -325,27 +326,27 @@ inline real_t Rect3::get_shortest_axis_size() const {
return max_size;
}
-bool Rect3::smits_intersect_ray(const Vector3 &from, const Vector3 &dir, real_t t0, real_t t1) const {
+bool Rect3::smits_intersect_ray(const Vector3 &p_from, const Vector3 &p_dir, real_t t0, real_t t1) const {
- real_t divx = 1.0 / dir.x;
- real_t divy = 1.0 / dir.y;
- real_t divz = 1.0 / dir.z;
+ real_t divx = 1.0 / p_dir.x;
+ real_t divy = 1.0 / p_dir.y;
+ real_t divz = 1.0 / p_dir.z;
- Vector3 upbound = pos + size;
+ Vector3 upbound = position + size;
real_t tmin, tmax, tymin, tymax, tzmin, tzmax;
- if (dir.x >= 0) {
- tmin = (pos.x - from.x) * divx;
- tmax = (upbound.x - from.x) * divx;
+ if (p_dir.x >= 0) {
+ tmin = (position.x - p_from.x) * divx;
+ tmax = (upbound.x - p_from.x) * divx;
} else {
- tmin = (upbound.x - from.x) * divx;
- tmax = (pos.x - from.x) * divx;
+ tmin = (upbound.x - p_from.x) * divx;
+ tmax = (position.x - p_from.x) * divx;
}
- if (dir.y >= 0) {
- tymin = (pos.y - from.y) * divy;
- tymax = (upbound.y - from.y) * divy;
+ if (p_dir.y >= 0) {
+ tymin = (position.y - p_from.y) * divy;
+ tymax = (upbound.y - p_from.y) * divy;
} else {
- tymin = (upbound.y - from.y) * divy;
- tymax = (pos.y - from.y) * divy;
+ tymin = (upbound.y - p_from.y) * divy;
+ tymax = (position.y - p_from.y) * divy;
}
if ((tmin > tymax) || (tymin > tmax))
return false;
@@ -353,12 +354,12 @@ bool Rect3::smits_intersect_ray(const Vector3 &from, const Vector3 &dir, real_t
tmin = tymin;
if (tymax < tmax)
tmax = tymax;
- if (dir.z >= 0) {
- tzmin = (pos.z - from.z) * divz;
- tzmax = (upbound.z - from.z) * divz;
+ if (p_dir.z >= 0) {
+ tzmin = (position.z - p_from.z) * divz;
+ tzmax = (upbound.z - p_from.z) * divz;
} else {
- tzmin = (upbound.z - from.z) * divz;
- tzmax = (pos.z - from.z) * divz;
+ tzmin = (upbound.z - p_from.z) * divz;
+ tzmax = (position.z - p_from.z) * divz;
}
if ((tmin > tzmax) || (tzmin > tmax))
return false;
@@ -371,9 +372,9 @@ bool Rect3::smits_intersect_ray(const Vector3 &from, const Vector3 &dir, real_t
void Rect3::grow_by(real_t p_amount) {
- pos.x -= p_amount;
- pos.y -= p_amount;
- pos.z -= p_amount;
+ position.x -= p_amount;
+ position.y -= p_amount;
+ position.z -= p_amount;
size.x += 2.0 * p_amount;
size.y += 2.0 * p_amount;
size.z += 2.0 * p_amount;
diff --git a/core/math/transform.cpp b/core/math/transform.cpp
index d35938e559..3a86fbfc6c 100644
--- a/core/math/transform.cpp
+++ b/core/math/transform.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -81,7 +82,10 @@ Transform Transform::looking_at(const Vector3 &p_target, const Vector3 &p_up) co
}
void Transform::set_look_at(const Vector3 &p_eye, const Vector3 &p_target, const Vector3 &p_up) {
-
+#ifdef MATH_CHECKS
+ ERR_FAIL_COND(p_eye == p_target);
+ ERR_FAIL_COND(p_up.length() == 0);
+#endif
// Reference: MESA source code
Vector3 v_x, v_y, v_z;
@@ -95,6 +99,9 @@ void Transform::set_look_at(const Vector3 &p_eye, const Vector3 &p_target, const
v_y = p_up;
v_x = v_y.cross(v_z);
+#ifdef MATH_CHECKS
+ ERR_FAIL_COND(v_x.length() == 0);
+#endif
/* Recompute Y = Z cross X */
v_y = v_z.cross(v_x);
@@ -102,9 +109,8 @@ void Transform::set_look_at(const Vector3 &p_eye, const Vector3 &p_target, const
v_x.normalize();
v_y.normalize();
- basis.set_axis(0, v_x);
- basis.set_axis(1, v_y);
- basis.set_axis(2, v_z);
+ basis.set(v_x, v_y, v_z);
+
origin = p_eye;
}
@@ -202,8 +208,7 @@ Transform::operator String() const {
return basis.operator String() + " - " + origin.operator String();
}
-Transform::Transform(const Basis &p_basis, const Vector3 &p_origin) {
-
- basis = p_basis;
- origin = p_origin;
+Transform::Transform(const Basis &p_basis, const Vector3 &p_origin)
+ : basis(p_basis),
+ origin(p_origin) {
}
diff --git a/core/math/transform.h b/core/math/transform.h
index e307aba129..48467f2ed7 100644
--- a/core/math/transform.h
+++ b/core/math/transform.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -96,15 +97,7 @@ public:
void set(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz, real_t tx, real_t ty, real_t tz) {
- basis.elements[0][0] = xx;
- basis.elements[0][1] = xy;
- basis.elements[0][2] = xz;
- basis.elements[1][0] = yx;
- basis.elements[1][1] = yy;
- basis.elements[1][2] = yz;
- basis.elements[2][0] = zx;
- basis.elements[2][1] = zy;
- basis.elements[2][2] = zz;
+ basis.set(xx, xy, xz, yx, yy, yz, zx, zy, zz);
origin.x = tx;
origin.y = ty;
origin.z = tz;
@@ -166,10 +159,10 @@ _FORCE_INLINE_ Rect3 Transform::xform(const Rect3 &p_aabb) const {
Vector3 x = basis.get_axis(0) * p_aabb.size.x;
Vector3 y = basis.get_axis(1) * p_aabb.size.y;
Vector3 z = basis.get_axis(2) * p_aabb.size.z;
- Vector3 pos = xform(p_aabb.pos);
+ Vector3 pos = xform(p_aabb.position);
//could be even further optimized
Rect3 new_aabb;
- new_aabb.pos = pos;
+ new_aabb.position = pos;
new_aabb.expand_to(pos + x);
new_aabb.expand_to(pos + y);
new_aabb.expand_to(pos + z);
@@ -181,14 +174,14 @@ _FORCE_INLINE_ Rect3 Transform::xform(const Rect3 &p_aabb) const {
#else
Vector3 vertices[8] = {
- Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z + p_aabb.size.z),
- Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z),
- Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y, p_aabb.pos.z + p_aabb.size.z),
- Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y, p_aabb.pos.z),
- Vector3(p_aabb.pos.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z + p_aabb.size.z),
- Vector3(p_aabb.pos.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z),
- Vector3(p_aabb.pos.x, p_aabb.pos.y, p_aabb.pos.z + p_aabb.size.z),
- Vector3(p_aabb.pos.x, p_aabb.pos.y, p_aabb.pos.z)
+ Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z),
+ Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z),
+ Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z),
+ Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z),
+ Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z),
+ Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z),
+ Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z),
+ Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z)
};
AABB ret;
@@ -207,19 +200,19 @@ _FORCE_INLINE_ Rect3 Transform::xform_inv(const Rect3 &p_aabb) const {
/* define vertices */
Vector3 vertices[8] = {
- Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z + p_aabb.size.z),
- Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z),
- Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y, p_aabb.pos.z + p_aabb.size.z),
- Vector3(p_aabb.pos.x + p_aabb.size.x, p_aabb.pos.y, p_aabb.pos.z),
- Vector3(p_aabb.pos.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z + p_aabb.size.z),
- Vector3(p_aabb.pos.x, p_aabb.pos.y + p_aabb.size.y, p_aabb.pos.z),
- Vector3(p_aabb.pos.x, p_aabb.pos.y, p_aabb.pos.z + p_aabb.size.z),
- Vector3(p_aabb.pos.x, p_aabb.pos.y, p_aabb.pos.z)
+ Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z),
+ Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z),
+ Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z),
+ Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z),
+ Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z),
+ Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z),
+ Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z),
+ Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z)
};
Rect3 ret;
- ret.pos = xform_inv(vertices[0]);
+ ret.position = xform_inv(vertices[0]);
for (int i = 1; i < 8; i++) {
@@ -229,27 +222,4 @@ _FORCE_INLINE_ Rect3 Transform::xform_inv(const Rect3 &p_aabb) const {
return ret;
}
-#ifdef OPTIMIZED_TRANSFORM_IMPL_OVERRIDE
-
-#else
-
-struct OptimizedTransform {
-
- Transform transform;
-
- _FORCE_INLINE_ void invert() { transform.invert(); }
- _FORCE_INLINE_ void affine_invert() { transform.affine_invert(); }
- _FORCE_INLINE_ Vector3 xform(const Vector3 &p_vec) const { return transform.xform(p_vec); };
- _FORCE_INLINE_ Vector3 xform_inv(const Vector3 &p_vec) const { return transform.xform_inv(p_vec); };
- _FORCE_INLINE_ OptimizedTransform operator*(const OptimizedTransform &p_ot) const { return OptimizedTransform(transform * p_ot.transform); }
- _FORCE_INLINE_ Transform get_transform() const { return transform; }
- _FORCE_INLINE_ void set_transform(const Transform &p_transform) { transform = p_transform; }
-
- OptimizedTransform(const Transform &p_transform) {
- transform = p_transform;
- }
-};
-
-#endif
-
#endif
diff --git a/core/math/triangle_mesh.cpp b/core/math/triangle_mesh.cpp
index 93c6b2786e..1df3c8c298 100644
--- a/core/math/triangle_mesh.cpp
+++ b/core/math/triangle_mesh.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -78,7 +79,7 @@ int TriangleMesh::_create_bvh(BVH *p_bvh, BVH **p_bb, int p_from, int p_size, in
int index = max_alloc++;
BVH *_new = &p_bvh[index];
_new->aabb = aabb;
- _new->center = aabb.pos + aabb.size * 0.5;
+ _new->center = aabb.position + aabb.size * 0.5;
_new->face_index = -1;
_new->left = left;
_new->right = right;
@@ -116,7 +117,7 @@ void TriangleMesh::create(const PoolVector<Vector3> &p_faces) {
for (int j = 0; j < 3; j++) {
int vidx = -1;
- Vector3 vs = v[j].snapped(0.0001);
+ Vector3 vs = v[j].snapped(Vector3(0.0001, 0.0001, 0.0001));
Map<Vector3, int>::Element *E = db.find(vs);
if (E) {
vidx = E->get();
@@ -127,7 +128,7 @@ void TriangleMesh::create(const PoolVector<Vector3> &p_faces) {
f.indices[j] = vidx;
if (j == 0)
- bw[i].aabb.pos = vs;
+ bw[i].aabb.position = vs;
else
bw[i].aabb.expand_to(vs);
}
@@ -137,7 +138,7 @@ void TriangleMesh::create(const PoolVector<Vector3> &p_faces) {
bw[i].left = -1;
bw[i].right = -1;
bw[i].face_index = i;
- bw[i].center = bw[i].aabb.pos + bw[i].aabb.size * 0.5;
+ bw[i].center = bw[i].aabb.position + bw[i].aabb.size * 0.5;
}
vertices.resize(db.size());
diff --git a/core/math/triangle_mesh.h b/core/math/triangle_mesh.h
index 7f81e54613..166f10c577 100644
--- a/core/math/triangle_mesh.h
+++ b/core/math/triangle_mesh.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/math/triangulate.cpp b/core/math/triangulate.cpp
index 8568a963ab..4a5d0a078e 100644
--- a/core/math/triangulate.cpp
+++ b/core/math/triangulate.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/math/triangulate.h b/core/math/triangulate.h
index c23d3ba27d..3f0ad00033 100644
--- a/core/math/triangulate.h
+++ b/core/math/triangulate.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp
index 235840e06a..efffacb36e 100644
--- a/core/math/vector3.cpp
+++ b/core/math/vector3.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -60,13 +61,13 @@ int Vector3::max_axis() const {
return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0);
}
-void Vector3::snap(real_t p_val) {
+void Vector3::snap(Vector3 p_val) {
- x = Math::stepify(x, p_val);
- y = Math::stepify(y, p_val);
- z = Math::stepify(z, p_val);
+ x = Math::stepify(x, p_val.x);
+ y = Math::stepify(y, p_val.y);
+ z = Math::stepify(z, p_val.z);
}
-Vector3 Vector3::snapped(real_t p_val) const {
+Vector3 Vector3::snapped(Vector3 p_val) const {
Vector3 v = *this;
v.snap(p_val);
diff --git a/core/math/vector3.h b/core/math/vector3.h
index 951380e898..c58a86fbdb 100644
--- a/core/math/vector3.h
+++ b/core/math/vector3.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -80,8 +81,8 @@ struct Vector3 {
_FORCE_INLINE_ void zero();
- void snap(real_t p_val);
- Vector3 snapped(real_t p_val) const;
+ void snap(Vector3 p_val);
+ Vector3 snapped(Vector3 p_val) const;
void rotate(const Vector3 &p_axis, real_t p_phi);
Vector3 rotated(const Vector3 &p_axis, real_t p_phi) const;
@@ -99,6 +100,7 @@ struct Vector3 {
_FORCE_INLINE_ Vector3 abs() const;
_FORCE_INLINE_ Vector3 floor() const;
+ _FORCE_INLINE_ Vector3 sign() const;
_FORCE_INLINE_ Vector3 ceil() const;
_FORCE_INLINE_ real_t distance_to(const Vector3 &p_b) const;
@@ -106,8 +108,9 @@ struct Vector3 {
_FORCE_INLINE_ real_t angle_to(const Vector3 &p_b) const;
- _FORCE_INLINE_ Vector3 slide(const Vector3 &p_vec) const;
- _FORCE_INLINE_ Vector3 reflect(const Vector3 &p_vec) const;
+ _FORCE_INLINE_ Vector3 slide(const Vector3 &p_normal) const;
+ _FORCE_INLINE_ Vector3 bounce(const Vector3 &p_normal) const;
+ _FORCE_INLINE_ Vector3 reflect(const Vector3 &p_normal) const;
/* Operators */
@@ -185,6 +188,11 @@ Vector3 Vector3::abs() const {
return Vector3(Math::abs(x), Math::abs(y), Math::abs(z));
}
+Vector3 Vector3::sign() const {
+
+ return Vector3(SGN(x), SGN(y), SGN(z));
+}
+
Vector3 Vector3::floor() const {
return Vector3(Math::floor(x), Math::floor(y), Math::floor(z));
@@ -387,7 +395,8 @@ Vector3 Vector3::normalized() const {
}
bool Vector3::is_normalized() const {
- return Math::isequal_approx(length(), (real_t)1.0);
+ // use length_squared() instead of length() to avoid sqrt(), makes it more stringent.
+ return Math::is_equal_approx(length_squared(), 1.0);
}
Vector3 Vector3::inverse() const {
@@ -400,14 +409,23 @@ void Vector3::zero() {
x = y = z = 0;
}
-Vector3 Vector3::slide(const Vector3 &p_vec) const {
-
- return p_vec - *this * this->dot(p_vec);
+// slide returns the component of the vector along the given plane, specified by its normal vector.
+Vector3 Vector3::slide(const Vector3 &p_normal) const {
+#ifdef MATH_CHECKS
+ ERR_FAIL_COND_V(p_normal.is_normalized() == false, Vector3());
+#endif
+ return *this - p_normal * this->dot(p_normal);
}
-Vector3 Vector3::reflect(const Vector3 &p_vec) const {
+Vector3 Vector3::bounce(const Vector3 &p_normal) const {
+ return -reflect(p_normal);
+}
- return p_vec - *this * this->dot(p_vec) * 2.0;
+Vector3 Vector3::reflect(const Vector3 &p_normal) const {
+#ifdef MATH_CHECKS
+ ERR_FAIL_COND_V(p_normal.is_normalized() == false, Vector3());
+#endif
+ return 2.0 * p_normal * this->dot(p_normal) - *this;
}
#endif
diff --git a/core/message_queue.cpp b/core/message_queue.cpp
index 56c944081a..564069d8bb 100644
--- a/core/message_queue.cpp
+++ b/core/message_queue.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,7 +29,7 @@
/*************************************************************************/
#include "message_queue.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "script_language.h"
MessageQueue *MessageQueue::singleton = NULL;
@@ -50,9 +51,10 @@ Error MessageQueue::push_call(ObjectID p_id, const StringName &p_method, const V
type = ObjectDB::get_instance(p_id)->get_class();
print_line("failed method: " + type + ":" + p_method + " target ID: " + itos(p_id));
statistics();
+ ERR_EXPLAIN("Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings");
+ ERR_FAIL_V(ERR_OUT_OF_MEMORY);
}
- ERR_FAIL_COND_V((buffer_end + room_needed) >= buffer_size, ERR_OUT_OF_MEMORY);
Message *msg = memnew_placement(&buffer[buffer_end], Message);
msg->args = p_argcount;
msg->instance_ID = p_id;
@@ -100,10 +102,10 @@ Error MessageQueue::push_set(ObjectID p_id, const StringName &p_prop, const Vari
type = ObjectDB::get_instance(p_id)->get_class();
print_line("failed set: " + type + ":" + p_prop + " target ID: " + itos(p_id));
statistics();
+ ERR_EXPLAIN("Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings");
+ ERR_FAIL_V(ERR_OUT_OF_MEMORY);
}
- ERR_FAIL_COND_V((buffer_end + room_needed) >= buffer_size, ERR_OUT_OF_MEMORY);
-
Message *msg = memnew_placement(&buffer[buffer_end], Message);
msg->args = 1;
msg->instance_ID = p_id;
@@ -133,9 +135,10 @@ Error MessageQueue::push_notification(ObjectID p_id, int p_notification) {
type = ObjectDB::get_instance(p_id)->get_class();
print_line("failed notification: " + itos(p_notification) + " target ID: " + itos(p_id));
statistics();
+ ERR_EXPLAIN("Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings");
+ ERR_FAIL_V(ERR_OUT_OF_MEMORY);
}
- ERR_FAIL_COND_V((buffer_end + room_needed) >= buffer_size, ERR_OUT_OF_MEMORY);
Message *msg = memnew_placement(&buffer[buffer_end], Message);
msg->type = TYPE_NOTIFICATION;
@@ -150,16 +153,16 @@ Error MessageQueue::push_notification(ObjectID p_id, int p_notification) {
Error MessageQueue::push_call(Object *p_object, const StringName &p_method, VARIANT_ARG_DECLARE) {
- return push_call(p_object->get_instance_ID(), p_method, VARIANT_ARG_PASS);
+ return push_call(p_object->get_instance_id(), p_method, VARIANT_ARG_PASS);
}
Error MessageQueue::push_notification(Object *p_object, int p_notification) {
- return push_notification(p_object->get_instance_ID(), p_notification);
+ return push_notification(p_object->get_instance_id(), p_notification);
}
Error MessageQueue::push_set(Object *p_object, const StringName &p_prop, const Variant &p_value) {
- return push_set(p_object->get_instance_ID(), p_prop, p_value);
+ return push_set(p_object->get_instance_id(), p_prop, p_value);
}
void MessageQueue::statistics() {
@@ -315,12 +318,19 @@ void MessageQueue::flush() {
while (read_pos < buffer_end) {
- _THREAD_SAFE_UNLOCK_
-
//lock on each interation, so a call can re-add itself to the message queue
Message *message = (Message *)&buffer[read_pos];
+ uint32_t advance = sizeof(Message);
+ if ((message->type & FLAG_MASK) != TYPE_NOTIFICATION)
+ advance += sizeof(Variant) * message->args;
+
+ //pre-advance so this function is reentrant
+ read_pos += advance;
+
+ _THREAD_SAFE_UNLOCK_
+
Object *target = ObjectDB::get_instance(message->instance_ID);
if (target != NULL) {
@@ -356,13 +366,9 @@ void MessageQueue::flush() {
}
}
- uint32_t advance = sizeof(Message);
- if ((message->type & FLAG_MASK) != TYPE_NOTIFICATION)
- advance += sizeof(Variant) * message->args;
message->~Message();
_THREAD_SAFE_LOCK_
- read_pos += advance;
}
buffer_end = 0; // reset buffer
@@ -376,7 +382,7 @@ MessageQueue::MessageQueue() {
buffer_end = 0;
buffer_max_used = 0;
- buffer_size = GLOBAL_DEF("memory/buffers/message_queue_max_size_kb", DEFAULT_QUEUE_SIZE_KB);
+ buffer_size = GLOBAL_DEF("memory/limits/message_queue/max_size_kb", DEFAULT_QUEUE_SIZE_KB);
buffer_size *= 1024;
buffer = memnew_arr(uint8_t, buffer_size);
}
diff --git a/core/message_queue.h b/core/message_queue.h
index e04530f24c..843ab17d94 100644
--- a/core/message_queue.h
+++ b/core/message_queue.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/method_bind.cpp b/core/method_bind.cpp
index 0f192a3b8a..6792b62703 100644
--- a/core/method_bind.cpp
+++ b/core/method_bind.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,12 +38,16 @@ PropertyInfo MethodBind::get_argument_info(int p_argument) const {
if (p_argument >= 0) {
- String name = (p_argument < arg_names.size()) ? String(arg_names[p_argument]) : String("arg" + itos(p_argument));
+ String name = p_argument < arg_names.size() ? String(arg_names[p_argument]) : String("arg" + itos(p_argument));
PropertyInfo pi(get_argument_type(p_argument), name);
- if ((pi.type == Variant::OBJECT) && name.find(":") != -1) {
- pi.hint = PROPERTY_HINT_RESOURCE_TYPE;
- pi.hint_string = name.get_slicec(':', 1);
- pi.name = name.get_slicec(':', 0);
+
+ if (!is_vararg() && pi.type == Variant::OBJECT) {
+ StringName type_hint = arg_type_hints[p_argument];
+
+ if (type_hint != StringName()) {
+ pi.hint = PROPERTY_HINT_RESOURCE_TYPE;
+ pi.hint_string = type_hint.operator String();
+ }
}
return pi;
@@ -86,6 +91,16 @@ Vector<StringName> MethodBind::get_argument_names() const {
return arg_names;
}
+void MethodBind::set_argument_type_hints(const Vector<StringName> &p_type_hints) {
+
+ arg_type_hints = p_type_hints;
+}
+
+Vector<StringName> MethodBind::get_argument_type_hints() const {
+
+ return arg_type_hints;
+}
+
#endif
void MethodBind::set_default_arguments(const Vector<Variant> &p_defargs) {
@@ -97,11 +112,19 @@ void MethodBind::set_default_arguments(const Vector<Variant> &p_defargs) {
void MethodBind::_generate_argument_types(int p_count) {
set_argument_count(p_count);
+
Variant::Type *argt = memnew_arr(Variant::Type, p_count + 1);
- argt[0] = _gen_argument_type(-1);
+
+ arg_type_hints.resize(p_count);
+
+ argt[0] = _gen_argument_type(-1); // return type
+ set_return_type(_gen_argument_type_hint(-1));
+
for (int i = 0; i < p_count; i++) {
argt[i + 1] = _gen_argument_type(i);
+ arg_type_hints[i] = _gen_argument_type_hint(i);
}
+
set_argument_types(argt);
}
diff --git a/core/method_bind.h b/core/method_bind.h
index f915a7563e..9bf0323733 100644
--- a/core/method_bind.h
+++ b/core/method_bind.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,6 +44,8 @@
#define DEBUG_METHODS_ENABLED
#endif
+#include "type_info.h"
+
enum MethodFlags {
METHOD_FLAG_NORMAL = 1,
@@ -86,12 +89,10 @@ struct VariantCaster<const T &> {
#define _VC(m_idx) \
(VariantCaster<P##m_idx>::cast((m_idx - 1) >= p_arg_count ? get_default_argument(m_idx - 1) : *p_args[m_idx - 1]))
-//SIMPLE_NUMERIC_TYPE is used to avoid a warning on Variant::get_type_for
-
#ifdef PTRCALL_ENABLED
#define VARIANT_ENUM_CAST(m_enum) \
- SIMPLE_NUMERIC_TYPE(m_enum); \
+ MAKE_ENUM_TYPE_INFO(m_enum) \
template <> \
struct VariantCaster<m_enum> { \
\
@@ -112,7 +113,7 @@ struct VariantCaster<const T &> {
#else
#define VARIANT_ENUM_CAST(m_enum) \
- SIMPLE_NUMERIC_TYPE(m_enum); \
+ MAKE_ENUM_TYPE_INFO(m_enum) \
template <> \
struct VariantCaster<m_enum> { \
\
@@ -145,15 +146,15 @@ struct VariantCaster<const T &> {
// some helpers
VARIANT_ENUM_CAST(Vector3::Axis);
-VARIANT_ENUM_CAST(Image::Format);
+
VARIANT_ENUM_CAST(Error);
VARIANT_ENUM_CAST(wchar_t);
VARIANT_ENUM_CAST(Margin);
+VARIANT_ENUM_CAST(Corner);
VARIANT_ENUM_CAST(Orientation);
VARIANT_ENUM_CAST(HAlign);
VARIANT_ENUM_CAST(Variant::Type);
VARIANT_ENUM_CAST(Variant::Operator);
-VARIANT_ENUM_CAST(InputEvent::Type);
class MethodBind {
@@ -165,6 +166,7 @@ class MethodBind {
int argument_count;
#ifdef DEBUG_METHODS_ENABLED
Vector<StringName> arg_names;
+ Vector<StringName> arg_type_hints;
Variant::Type *argument_types;
StringName ret_type;
#endif
@@ -176,6 +178,7 @@ protected:
void _set_returns(bool p_returns);
#ifdef DEBUG_METHODS_ENABLED
virtual Variant::Type _gen_argument_type(int p_arg) const = 0;
+ virtual StringName _gen_argument_type_hint(int p_arg) const = 0;
void _generate_argument_types(int p_count);
void set_argument_types(Variant::Type *p_types) { argument_types = p_types; }
#endif
@@ -220,6 +223,9 @@ public:
void set_argument_names(const Vector<StringName> &p_names);
Vector<StringName> get_argument_names() const;
+
+ void set_argument_type_hints(const Vector<StringName> &p_type_hints);
+ Vector<StringName> get_argument_type_hints() const;
#endif
void set_hint_flags(uint32_t p_hint) { hint_flags = p_hint; }
uint32_t get_hint_flags() const { return hint_flags | (is_const() ? METHOD_FLAG_CONST : 0) | (is_vararg() ? METHOD_FLAG_VARARG : 0); }
@@ -282,11 +288,17 @@ public:
return Variant::NIL;
}
+ virtual StringName _gen_argument_type_hint(int p_arg) const {
+
+ return "Variant";
+ }
+
virtual Variant call(Object *p_object, const Variant **p_args, int p_arg_count, Variant::CallError &r_error) {
T *instance = static_cast<T *>(p_object);
return (instance->*call_method)(p_args, p_arg_count, r_error);
}
+
void set_method_info(const MethodInfo &p_info) {
set_argument_count(p_info.arguments.size());
@@ -343,6 +355,6 @@ MethodBind *create_vararg_method_bind(Variant (T::*p_method)(const Variant **, i
// if you declare an nonexistent class..
class __UnexistingClass;
-#include "method_bind.inc"
+#include "method_bind.gen.inc"
#endif
diff --git a/core/method_ptrcall.h b/core/method_ptrcall.h
index 26d7538bf8..d8755fd98b 100644
--- a/core/method_ptrcall.h
+++ b/core/method_ptrcall.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -59,53 +60,71 @@ struct PtrToArg {
} \
}
-#define MAKE_PTRARGR(m_type, m_ret) \
- template <> \
- struct PtrToArg<m_type> { \
- _FORCE_INLINE_ static m_type convert(const void *p_ptr) { \
- return *reinterpret_cast<const m_type *>(p_ptr); \
- } \
- _FORCE_INLINE_ static void encode(m_type p_val, void *p_ptr) { \
- *((m_ret *)p_ptr) = p_val; \
- } \
- }; \
- template <> \
- struct PtrToArg<const m_type &> { \
- _FORCE_INLINE_ static m_type convert(const void *p_ptr) { \
- return *reinterpret_cast<const m_type *>(p_ptr); \
- } \
- _FORCE_INLINE_ static void encode(m_type p_val, void *p_ptr) { \
- *((m_ret *)p_ptr) = p_val; \
- } \
+#define MAKE_PTRARGCONV(m_type, m_conv) \
+ template <> \
+ struct PtrToArg<m_type> { \
+ _FORCE_INLINE_ static m_type convert(const void *p_ptr) { \
+ return static_cast<m_type>(*reinterpret_cast<const m_conv *>(p_ptr)); \
+ } \
+ _FORCE_INLINE_ static void encode(m_type p_val, void *p_ptr) { \
+ *((m_conv *)p_ptr) = static_cast<m_conv>(p_val); \
+ } \
+ }; \
+ template <> \
+ struct PtrToArg<const m_type &> { \
+ _FORCE_INLINE_ static m_type convert(const void *p_ptr) { \
+ return static_cast<m_type>(*reinterpret_cast<const m_conv *>(p_ptr)); \
+ } \
+ _FORCE_INLINE_ static void encode(m_type p_val, void *p_ptr) { \
+ *((m_conv *)p_ptr) = static_cast<m_conv>(p_val); \
+ } \
+ }
+
+#define MAKE_PTRARG_BY_REFERENCE(m_type) \
+ template <> \
+ struct PtrToArg<m_type> { \
+ _FORCE_INLINE_ static m_type convert(const void *p_ptr) { \
+ return *reinterpret_cast<const m_type *>(p_ptr); \
+ } \
+ _FORCE_INLINE_ static void encode(const m_type &p_val, void *p_ptr) { \
+ *((m_type *)p_ptr) = p_val; \
+ } \
+ }; \
+ template <> \
+ struct PtrToArg<const m_type &> { \
+ _FORCE_INLINE_ static m_type convert(const void *p_ptr) { \
+ return *reinterpret_cast<const m_type *>(p_ptr); \
+ } \
+ _FORCE_INLINE_ static void encode(const m_type &p_val, void *p_ptr) { \
+ *((m_type *)p_ptr) = p_val; \
+ } \
}
MAKE_PTRARG(bool);
-MAKE_PTRARGR(uint8_t, int);
-MAKE_PTRARGR(int8_t, int);
-MAKE_PTRARGR(uint16_t, int);
-MAKE_PTRARGR(int16_t, int);
-MAKE_PTRARGR(uint32_t, int);
-MAKE_PTRARGR(int32_t, int);
-MAKE_PTRARGR(int64_t, int);
-MAKE_PTRARGR(uint64_t, int);
-MAKE_PTRARG(float);
-MAKE_PTRARGR(double, float);
+MAKE_PTRARGCONV(uint8_t, int64_t);
+MAKE_PTRARGCONV(int8_t, int64_t);
+MAKE_PTRARGCONV(uint16_t, int64_t);
+MAKE_PTRARGCONV(int16_t, int64_t);
+MAKE_PTRARGCONV(uint32_t, int64_t);
+MAKE_PTRARGCONV(int32_t, int64_t);
+MAKE_PTRARG(int64_t);
+MAKE_PTRARG(uint64_t);
+MAKE_PTRARGCONV(float, double);
+MAKE_PTRARG(double);
MAKE_PTRARG(String);
MAKE_PTRARG(Vector2);
MAKE_PTRARG(Rect2);
-MAKE_PTRARG(Vector3);
+MAKE_PTRARG_BY_REFERENCE(Vector3);
MAKE_PTRARG(Transform2D);
-MAKE_PTRARG(Plane);
+MAKE_PTRARG_BY_REFERENCE(Plane);
MAKE_PTRARG(Quat);
-MAKE_PTRARG(Rect3);
-MAKE_PTRARG(Basis);
-MAKE_PTRARG(Transform);
-MAKE_PTRARG(Color);
-MAKE_PTRARG(Image);
+MAKE_PTRARG_BY_REFERENCE(Rect3);
+MAKE_PTRARG_BY_REFERENCE(Basis);
+MAKE_PTRARG_BY_REFERENCE(Transform);
+MAKE_PTRARG_BY_REFERENCE(Color);
MAKE_PTRARG(NodePath);
MAKE_PTRARG(RID);
-MAKE_PTRARG(InputEvent);
MAKE_PTRARG(Dictionary);
MAKE_PTRARG(Array);
MAKE_PTRARG(PoolByteArray);
@@ -115,8 +134,7 @@ MAKE_PTRARG(PoolStringArray);
MAKE_PTRARG(PoolVector2Array);
MAKE_PTRARG(PoolVector3Array);
MAKE_PTRARG(PoolColorArray);
-MAKE_PTRARG(Variant);
-MAKE_PTRARG(PowerState);
+MAKE_PTRARG_BY_REFERENCE(Variant);
//this is for Object
@@ -313,8 +331,29 @@ MAKE_DVECARR(Plane);
} \
}
+#define MAKE_STRINGCONV_BY_REFERENCE(m_type) \
+ template <> \
+ struct PtrToArg<m_type> { \
+ _FORCE_INLINE_ static m_type convert(const void *p_ptr) { \
+ m_type s = *reinterpret_cast<const String *>(p_ptr); \
+ return s; \
+ } \
+ _FORCE_INLINE_ static void encode(const m_type &p_vec, void *p_ptr) { \
+ String *arr = reinterpret_cast<String *>(p_ptr); \
+ *arr = p_vec; \
+ } \
+ }; \
+ \
+ template <> \
+ struct PtrToArg<const m_type &> { \
+ _FORCE_INLINE_ static m_type convert(const void *p_ptr) { \
+ m_type s = *reinterpret_cast<const String *>(p_ptr); \
+ return s; \
+ } \
+ }
+
MAKE_STRINGCONV(StringName);
-MAKE_STRINGCONV(IP_Address);
+MAKE_STRINGCONV_BY_REFERENCE(IP_Address);
template <>
struct PtrToArg<PoolVector<Face3> > {
diff --git a/core/path_db.cpp b/core/node_path.cpp
index 239a2d7654..ad2eae859d 100644
--- a/core/path_db.cpp
+++ b/core/node_path.cpp
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* path_db.cpp */
+/* node_path.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "path_db.h"
+#include "node_path.h"
#include "print_string.h"
diff --git a/core/path_db.h b/core/node_path.h
index eec29676e2..31446ab9b4 100644
--- a/core/path_db.h
+++ b/core/node_path.h
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* path_db.h */
+/* node_path.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,8 +27,8 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef PATH_DB_H
-#define PATH_DB_H
+#ifndef NODE_PATH_H
+#define NODE_PATH_H
#include "string_db.h"
#include "ustring.h"
diff --git a/core/object.cpp b/core/object.cpp
index fe6f120c17..62b2b5d545 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -121,10 +122,9 @@ MethodInfo::operator Dictionary() const {
return d;
}
-MethodInfo::MethodInfo() {
-
- id = 0;
- flags = METHOD_FLAG_NORMAL;
+MethodInfo::MethodInfo()
+ : flags(METHOD_FLAG_NORMAL),
+ id(0) {
}
MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) {
@@ -160,125 +160,114 @@ MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) {
return mi;
}
-MethodInfo::MethodInfo(const String &p_name) {
-
- id = 0;
- name = p_name;
- flags = METHOD_FLAG_NORMAL;
+MethodInfo::MethodInfo(const String &p_name)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
}
-MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1) {
-
- id = 0;
- name = p_name;
+MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
arguments.push_back(p_param1);
- flags = METHOD_FLAG_NORMAL;
}
-MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) {
-
- id = 0;
- name = p_name;
+MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
- flags = METHOD_FLAG_NORMAL;
}
-MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) {
-
- id = 0;
- name = p_name;
+MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
- flags = METHOD_FLAG_NORMAL;
}
-MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) {
-
- id = 0;
- name = p_name;
+MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
arguments.push_back(p_param4);
- flags = METHOD_FLAG_NORMAL;
}
-MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) {
- id = 0;
- name = p_name;
+MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
arguments.push_back(p_param4);
arguments.push_back(p_param5);
- flags = METHOD_FLAG_NORMAL;
}
-MethodInfo::MethodInfo(Variant::Type ret) {
-
- id = 0;
- flags = METHOD_FLAG_NORMAL;
+MethodInfo::MethodInfo(Variant::Type ret)
+ : flags(METHOD_FLAG_NORMAL),
+ id(0) {
return_val.type = ret;
}
-MethodInfo::MethodInfo(Variant::Type ret, const String &p_name) {
-
- id = 0;
- name = p_name;
- flags = METHOD_FLAG_NORMAL;
+MethodInfo::MethodInfo(Variant::Type ret, const String &p_name)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
return_val.type = ret;
}
-MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1) {
-
- id = 0;
- name = p_name;
- arguments.push_back(p_param1);
- flags = METHOD_FLAG_NORMAL;
+MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
return_val.type = ret;
+ arguments.push_back(p_param1);
}
-MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) {
-
- id = 0;
- name = p_name;
+MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
+ return_val.type = ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
- flags = METHOD_FLAG_NORMAL;
- return_val.type = ret;
}
-MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) {
-
- id = 0;
- name = p_name;
+MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
+ return_val.type = ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
- flags = METHOD_FLAG_NORMAL;
- return_val.type = ret;
}
-MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) {
-
- id = 0;
- name = p_name;
+MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
+ return_val.type = ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
arguments.push_back(p_param4);
- flags = METHOD_FLAG_NORMAL;
- return_val.type = ret;
}
-MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) {
- id = 0;
- name = p_name;
+MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5)
+ : name(p_name),
+ flags(METHOD_FLAG_NORMAL),
+ id(0) {
+ return_val.type = ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
arguments.push_back(p_param4);
arguments.push_back(p_param5);
- flags = METHOD_FLAG_NORMAL;
- return_val.type = ret;
}
Object::Connection::operator Variant() const {
@@ -418,6 +407,16 @@ void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid
if (r_valid)
*r_valid = true;
return;
+#ifdef TOOLS_ENABLED
+ } else if (p_name == CoreStringNames::get_singleton()->_sections_unfolded) {
+ Array arr = p_value;
+ for (int i = 0; i < arr.size(); i++) {
+ editor_section_folding.insert(arr[i]);
+ }
+ if (r_valid)
+ *r_valid = true;
+ return;
+#endif
} else {
//something inside the object... :|
bool success = _setv(p_name, p_value);
@@ -463,6 +462,16 @@ Variant Object::get(const StringName &p_name, bool *r_valid) const {
if (r_valid)
*r_valid = true;
return ret;
+#ifdef TOOLS_ENABLED
+ } else if (p_name == CoreStringNames::get_singleton()->_sections_unfolded) {
+ Array array;
+ for (Set<String>::Element *E = editor_section_folding.front(); E; E = E->next()) {
+ array.push_back(E->get());
+ }
+ if (r_valid)
+ *r_valid = true;
+ return array;
+#endif
} else {
//something inside the object... :|
bool success = _getv(p_name, ret);
@@ -515,6 +524,11 @@ void Object::get_property_list(List<PropertyInfo> *p_list, bool p_reversed) cons
if (!is_class("Script")) // can still be set, but this is for userfriendlyness
p_list->push_back(PropertyInfo(Variant::OBJECT, "script", PROPERTY_HINT_RESOURCE_TYPE, "Script", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_STORE_IF_NONZERO));
+#ifdef TOOLS_ENABLED
+ if (editor_section_folding.size()) {
+ p_list->push_back(PropertyInfo(Variant::ARRAY, CoreStringNames::get_singleton()->_sections_unfolded, PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR));
+ }
+#endif
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) {
@@ -573,7 +587,7 @@ Variant Object::_call_deferred_bind(const Variant **p_args, int p_argcount, Vari
StringName method = *p_args[0];
- MessageQueue::get_singleton()->push_call(get_instance_ID(), method, &p_args[1], p_argcount - 1);
+ MessageQueue::get_singleton()->push_call(get_instance_id(), method, &p_args[1], p_argcount - 1);
return Variant();
}
@@ -967,6 +981,17 @@ void Object::cancel_delete() {
_predelete_ok = true;
}
+void Object::set_script_and_instance(const RefPtr &p_script, ScriptInstance *p_instance) {
+
+ //this function is not meant to be used in any of these ways
+ ERR_FAIL_COND(p_script.is_null());
+ ERR_FAIL_COND(!p_instance);
+ ERR_FAIL_COND(script_instance != NULL || !script.is_null());
+
+ script = p_script;
+ script_instance = p_instance;
+}
+
void Object::set_script(const RefPtr &p_script) {
if (script == p_script)
@@ -1145,10 +1170,10 @@ Variant Object::_emit_signal(const Variant **p_args, int p_argcount, Variant::Ca
return Variant();
}
-void Object::emit_signal(const StringName &p_name, const Variant **p_args, int p_argcount) {
+Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int p_argcount) {
if (_block_signals)
- return; //no emit, signals blocked
+ return ERR_CANT_AQUIRE_RESOURCE; //no emit, signals blocked
Signal *s = signal_map.getptr(p_name);
if (!s) {
@@ -1157,11 +1182,11 @@ void Object::emit_signal(const StringName &p_name, const Variant **p_args, int p
//check in script
if (!signal_is_valid && !script.is_null() && !Ref<Script>(script)->has_script_signal(p_name)) {
ERR_EXPLAIN("Can't emit non-existing signal " + String("\"") + p_name + "\".");
- ERR_FAIL();
+ ERR_FAIL_V(ERR_UNAVAILABLE);
}
#endif
//not connected? just return
- return;
+ return ERR_UNAVAILABLE;
}
List<_ObjectSignalDisconnectData> disconnect_data;
@@ -1177,6 +1202,8 @@ void Object::emit_signal(const StringName &p_name, const Variant **p_args, int p
Vector<const Variant *> bind_mem;
+ Error err = OK;
+
for (int i = 0; i < ssize; i++) {
const Connection &c = slot_map.getv(i).conn;
@@ -1208,16 +1235,18 @@ void Object::emit_signal(const StringName &p_name, const Variant **p_args, int p
}
if (c.flags & CONNECT_DEFERRED) {
- MessageQueue::get_singleton()->push_call(target->get_instance_ID(), c.method, args, argc, true);
+ MessageQueue::get_singleton()->push_call(target->get_instance_id(), c.method, args, argc, true);
} else {
Variant::CallError ce;
target->call(c.method, args, argc, ce);
+
if (ce.error != Variant::CallError::CALL_OK) {
if (ce.error == Variant::CallError::CALL_ERROR_INVALID_METHOD && !ClassDB::class_exists(target->get_class_name())) {
//most likely object is not initialized yet, do not throw error.
} else {
ERR_PRINTS("Error calling method from signal '" + String(p_name) + "': " + Variant::get_call_error_text(target, c.method, args, argc, ce));
+ err = ERR_METHOD_NOT_FOUND;
}
}
}
@@ -1237,21 +1266,24 @@ void Object::emit_signal(const StringName &p_name, const Variant **p_args, int p
disconnect(dd.signal, dd.target, dd.method);
disconnect_data.pop_front();
}
+
+ return err;
}
-void Object::emit_signal(const StringName &p_name, VARIANT_ARG_DECLARE) {
+Error Object::emit_signal(const StringName &p_name, VARIANT_ARG_DECLARE) {
VARIANT_ARGPTRS;
int argc = 0;
for (int i = 0; i < VARIANT_ARG_MAX; i++) {
+
if (argptr[i]->get_type() == Variant::NIL)
break;
argc++;
}
- emit_signal(p_name, argptr, argc);
+ return emit_signal(p_name, argptr, argc);
}
void Object::_add_user_signal(const String &p_name, const Array &p_args) {
@@ -1331,6 +1363,21 @@ Array Object::_get_signal_connection_list(const String &p_signal) const {
return ret;
}
+Array Object::_get_incoming_connections() const {
+
+ Array ret;
+ int connections_amount = connections.size();
+ for (int idx_conn = 0; idx_conn < connections_amount; idx_conn++) {
+ Dictionary conn_data;
+ conn_data["source"] = connections[idx_conn].source;
+ conn_data["signal_name"] = connections[idx_conn].signal;
+ conn_data["method_name"] = connections[idx_conn].method;
+ ret.push_back(conn_data);
+ }
+
+ return ret;
+}
+
void Object::get_signal_list(List<MethodInfo> *p_signals) const {
if (!script.is_null()) {
@@ -1419,7 +1466,7 @@ Error Object::connect(const StringName &p_signal, Object *p_to_object, const Str
s = &signal_map[p_signal];
}
- Signal::Target target(p_to_object->get_instance_ID(), p_to_method);
+ Signal::Target target(p_to_object->get_instance_id(), p_to_method);
if (s->slot_map.has(target)) {
ERR_EXPLAIN("Signal '" + p_signal + "'' already connected to given method '" + p_to_method + "' in that object.");
ERR_FAIL_COND_V(s->slot_map.has(target), ERR_INVALID_PARAMETER);
@@ -1457,7 +1504,7 @@ bool Object::is_connected(const StringName &p_signal, Object *p_to_object, const
ERR_FAIL_COND_V(!s, false);
}
- Signal::Target target(p_to_object->get_instance_ID(), p_to_method);
+ Signal::Target target(p_to_object->get_instance_id(), p_to_method);
return s->slot_map.has(target);
//const Map<Signal::Target,Signal::Slot>::Element *E = s->slot_map.find(target);
@@ -1477,7 +1524,7 @@ void Object::disconnect(const StringName &p_signal, Object *p_to_object, const S
ERR_FAIL_COND(s->lock > 0);
}
- Signal::Target target(p_to_object->get_instance_ID(), p_to_method);
+ Signal::Target target(p_to_object->get_instance_id(), p_to_method);
if (!s->slot_map.has(target)) {
ERR_EXPLAIN("Disconnecting nonexistent signal '" + p_signal + "', slot: " + itos(target._id) + ":" + target.method);
@@ -1570,6 +1617,23 @@ void Object::_clear_internal_resource_paths(const Variant &p_var) {
}
}
+#ifdef TOOLS_ENABLED
+void Object::editor_set_section_unfold(const String &p_section, bool p_unfolded) {
+
+ set_edited(true);
+ if (p_unfolded)
+ editor_section_folding.insert(p_section);
+ else
+ editor_section_folding.erase(p_section);
+}
+
+bool Object::editor_is_section_unfolded(const String &p_section) {
+
+ return editor_section_folding.has(p_section);
+}
+
+#endif
+
void Object::clear_internal_resource_paths() {
List<PropertyInfo> pinfo;
@@ -1587,17 +1651,17 @@ void Object::_bind_methods() {
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:Variant", "property"), &Object::_get_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(D_METHOD("get_instance_id"), &Object::get_instance_id);
- 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(D_METHOD("set_script", "script"), &Object::set_script);
+ ClassDB::bind_method(D_METHOD("get_script"), &Object::get_script);
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("get_meta", "name"), &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);
@@ -1623,7 +1687,7 @@ void Object::_bind_methods() {
mi.name = "call";
mi.arguments.push_back(PropertyInfo(Variant::STRING, "method"));
- ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call:Variant", &Object::_call_bind, mi);
+ ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call", &Object::_call_bind, mi);
}
{
@@ -1634,16 +1698,17 @@ void Object::_bind_methods() {
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_deferred", &Object::_call_deferred_bind, mi);
}
- ClassDB::bind_method(D_METHOD("callv:Variant", "method", "arg_array"), &Object::callv);
+ ClassDB::bind_method(D_METHOD("callv", "method", "arg_array"), &Object::callv);
ClassDB::bind_method(D_METHOD("has_method", "method"), &Object::has_method);
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(D_METHOD("get_incoming_connections"), &Object::_get_incoming_connections);
- 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(D_METHOD("connect", "signal", "target", "method", "binds", "flags"), &Object::connect, DEFVAL(Array()), DEFVAL(0));
+ ClassDB::bind_method(D_METHOD("disconnect", "signal", "target", "method"), &Object::disconnect);
+ ClassDB::bind_method(D_METHOD("is_connected", "signal", "target", "method"), &Object::is_connected);
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);
@@ -1661,10 +1726,10 @@ void Object::_bind_methods() {
ADD_SIGNAL(MethodInfo("script_changed"));
BIND_VMETHOD(MethodInfo("_notification", PropertyInfo(Variant::INT, "what")));
- BIND_VMETHOD(MethodInfo("_set", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::NIL, "value")));
+ BIND_VMETHOD(MethodInfo("_set:bool", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::NIL, "value")));
#ifdef TOOLS_ENABLED
MethodInfo miget("_get", PropertyInfo(Variant::STRING, "property"));
- miget.return_val.name = "var";
+ miget.return_val.name = "Variant";
BIND_VMETHOD(miget);
MethodInfo plget("_get_property_list");
@@ -1758,6 +1823,23 @@ uint32_t Object::get_edited_version() const {
}
#endif
+void *Object::get_script_instance_binding(int p_script_language_index) {
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_INDEX_V(p_script_language_index, MAX_SCRIPT_INSTANCE_BINDINGS, NULL);
+#endif
+
+ //it's up to the script language to make this thread safe, if the function is called twice due to threads being out of syncro
+ //just return the same pointer.
+ //if you want to put a big lock in the entire function and keep allocated pointers in a map or something, feel free to do it
+ //as it should not really affect performance much (won't be called too often), as in far most caes the condition below will be false afterwards
+
+ if (!_script_instance_bindings[p_script_language_index]) {
+ _script_instance_bindings[p_script_language_index] = ScriptServer::get_language(p_script_language_index)->alloc_instance_binding_data(this);
+ }
+
+ return _script_instance_bindings[p_script_language_index];
+}
+
Object::Object() {
_class_ptr = NULL;
@@ -1767,6 +1849,7 @@ Object::Object() {
_instance_ID = ObjectDB::add_instance(this);
_can_translate = true;
_is_queued_for_deletion = false;
+ memset(_script_instance_bindings, 0, sizeof(void *) * MAX_SCRIPT_INSTANCE_BINDINGS);
script_instance = NULL;
#ifdef TOOLS_ENABLED
@@ -1818,6 +1901,12 @@ Object::~Object() {
ObjectDB::remove_instance(this);
_instance_ID = 0;
_predelete_ok = 2;
+
+ for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) {
+ if (_script_instance_bindings[i]) {
+ ScriptServer::get_language(i)->free_instance_binding_data(_script_instance_bindings[i]);
+ }
+ }
}
bool predelete_handler(Object *p_object) {
@@ -1830,12 +1919,12 @@ void postinitialize_handler(Object *p_object) {
p_object->_postinitialize();
}
-HashMap<uint32_t, Object *> ObjectDB::instances;
-uint32_t ObjectDB::instance_counter = 1;
+HashMap<ObjectID, Object *> ObjectDB::instances;
+ObjectID ObjectDB::instance_counter = 1;
HashMap<Object *, ObjectID, ObjectDB::ObjectPtrHash> ObjectDB::instance_checks;
-uint32_t ObjectDB::add_instance(Object *p_object) {
+ObjectID ObjectDB::add_instance(Object *p_object) {
- ERR_FAIL_COND_V(p_object->get_instance_ID() != 0, 0);
+ ERR_FAIL_COND_V(p_object->get_instance_id() != 0, 0);
rw_lock->write_lock();
instances[++instance_counter] = p_object;
@@ -1851,14 +1940,14 @@ void ObjectDB::remove_instance(Object *p_object) {
rw_lock->write_lock();
- instances.erase(p_object->get_instance_ID());
+ instances.erase(p_object->get_instance_id());
#ifdef DEBUG_ENABLED
instance_checks.erase(p_object);
#endif
rw_lock->write_unlock();
}
-Object *ObjectDB::get_instance(uint32_t p_instance_ID) {
+Object *ObjectDB::get_instance(ObjectID p_instance_ID) {
rw_lock->read_lock();
Object **obj = instances.getptr(p_instance_ID);
@@ -1873,7 +1962,7 @@ void ObjectDB::debug_objects(DebugFunc p_func) {
rw_lock->read_lock();
- const uint32_t *K = NULL;
+ const ObjectID *K = NULL;
while ((K = instances.next(K))) {
p_func(instances[*K]);
@@ -1908,13 +1997,13 @@ void ObjectDB::cleanup() {
WARN_PRINT("ObjectDB Instances still exist!");
if (OS::get_singleton()->is_stdout_verbose()) {
- const uint32_t *K = NULL;
+ const ObjectID *K = NULL;
while ((K = instances.next(K))) {
String node_name;
if (instances[*K]->is_class("Node"))
node_name = " - Node Name: " + String(instances[*K]->call("get_name"));
- if (instances[*K]->is_class("Resoucre"))
+ if (instances[*K]->is_class("Resource"))
node_name = " - Resource Name: " + String(instances[*K]->call("get_name")) + " Path: " + String(instances[*K]->call("get_path"));
print_line("Leaked Instance: " + String(instances[*K]->get_class()) + ":" + itos(*K) + node_name);
}
diff --git a/core/object.h b/core/object.h
index f4a622f5f7..4648d9d90e 100644
--- a/core/object.h
+++ b/core/object.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -104,6 +105,7 @@ enum PropertyUsageFlags {
PROPERTY_USAGE_STORE_IF_NULL = 16384,
PROPERTY_USAGE_ANIMATE_AS_TRIGGER = 32768,
PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED = 65536,
+ PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE = 1 << 17,
PROPERTY_USAGE_DEFAULT = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK,
PROPERTY_USAGE_DEFAULT_INTL = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK | PROPERTY_USAGE_INTERNATIONALIZED,
@@ -137,17 +139,17 @@ struct PropertyInfo {
static PropertyInfo from_dict(const Dictionary &p_dict);
- PropertyInfo() {
- type = Variant::NIL;
- hint = PROPERTY_HINT_NONE;
- usage = PROPERTY_USAGE_DEFAULT;
+ PropertyInfo()
+ : type(Variant::NIL),
+ hint(PROPERTY_HINT_NONE),
+ usage(PROPERTY_USAGE_DEFAULT) {
}
- PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT) {
- type = p_type;
- name = p_name;
- hint = p_hint;
- hint_string = p_hint_string;
- usage = p_usage;
+ PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT)
+ : type(p_type),
+ name(p_name),
+ hint(p_hint),
+ hint_string(p_hint_string),
+ usage(p_usage) {
}
bool operator<(const PropertyInfo &p_info) const {
return name < p_info.name;
@@ -349,7 +351,7 @@ public: \
private:
class ScriptInstance;
-typedef uint32_t ObjectID;
+typedef uint64_t ObjectID;
class Object {
public:
@@ -380,6 +382,10 @@ public:
};
private:
+ enum {
+ MAX_SCRIPT_INSTANCE_BINDINGS = 8
+ };
+
#ifdef DEBUG_ENABLED
friend class _ObjectDebugLock;
#endif
@@ -395,9 +401,9 @@ private:
_FORCE_INLINE_ bool operator<(const Target &p_target) const { return (_id == p_target._id) ? (method < p_target.method) : (_id < p_target._id); }
- Target(const ObjectID &p_id, const StringName &p_method) {
- _id = p_id;
- method = p_method;
+ Target(const ObjectID &p_id, const StringName &p_method)
+ : _id(p_id),
+ method(p_method) {
}
Target() { _id = 0; }
};
@@ -422,13 +428,14 @@ private:
bool _block_signals;
int _predelete_ok;
Set<Object *> change_receptors;
- uint32_t _instance_ID;
+ ObjectID _instance_ID;
bool _predelete();
void _postinitialize();
bool _can_translate;
#ifdef TOOLS_ENABLED
bool _edited;
uint32_t _edited_version;
+ Set<String> editor_section_folding;
#endif
ScriptInstance *script_instance;
RefPtr script;
@@ -436,14 +443,17 @@ private:
mutable StringName _class_name;
mutable const StringName *_class_ptr;
- void _add_user_signal(const String &p_name, const Array &p_pargs = Array());
+ void _add_user_signal(const String &p_name, const Array &p_args = Array());
bool _has_user_signal(const StringName &p_name) const;
Variant _emit_signal(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
Array _get_signal_list() const;
Array _get_signal_connection_list(const String &p_signal) const;
+ Array _get_incoming_connections() const;
void _set_bind(const String &p_set, const Variant &p_value);
Variant _get_bind(const String &p_name) const;
+ void *_script_instance_bindings[MAX_SCRIPT_INSTANCE_BINDINGS];
+
void property_list_changed_notify();
protected:
@@ -524,12 +534,18 @@ public:
bool _is_gpl_reversed() const { return false; }
- _FORCE_INLINE_ ObjectID get_instance_ID() const { return _instance_ID; }
+ _FORCE_INLINE_ ObjectID get_instance_id() const { return _instance_ID; }
// this is used for editors
void add_change_receptor(Object *p_receptor);
void remove_change_receptor(Object *p_receptor);
+// TODO: ensure 'this' is never NULL since it's UB, but by now, avoid warning flood
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wundefined-bool-conversion"
+#endif
+
template <class T>
T *cast_to() {
@@ -560,6 +576,10 @@ public:
#endif
}
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
enum {
NOTIFICATION_POSTINITIALIZE = 0,
@@ -632,9 +652,11 @@ public:
void set_script_instance(ScriptInstance *p_instance);
_FORCE_INLINE_ ScriptInstance *get_script_instance() const { return script_instance; }
+ void set_script_and_instance(const RefPtr &p_script, ScriptInstance *p_instance); //some script languages can't control instance creation, so this function eases the process
+
void add_user_signal(const MethodInfo &p_signal);
- void emit_signal(const StringName &p_name, VARIANT_ARG_LIST);
- void emit_signal(const StringName &p_name, const Variant **p_args, int p_argcount);
+ Error emit_signal(const StringName &p_name, VARIANT_ARG_LIST);
+ Error emit_signal(const StringName &p_name, const Variant **p_args, int p_argcount);
void get_signal_list(List<MethodInfo> *p_signals) const;
void get_signal_connection_list(const StringName &p_signal, List<Connection> *p_connections) const;
void get_all_signal_connections(List<Connection> *p_connections) const;
@@ -665,6 +687,14 @@ public:
_FORCE_INLINE_ void set_message_translation(bool p_enable) { _can_translate = p_enable; }
_FORCE_INLINE_ bool can_translate_messages() const { return _can_translate; }
+#ifdef TOOLS_ENABLED
+ void editor_set_section_unfold(const String &p_section, bool p_unfolded);
+ bool editor_is_section_unfolded(const String &p_section);
+#endif
+
+ //used by script languages to store binding data
+ void *get_script_instance_binding(int p_script_language_index);
+
void clear_internal_resource_paths();
Object();
@@ -689,16 +719,16 @@ class ObjectDB {
}
};
- static HashMap<uint32_t, Object *> instances;
+ static HashMap<ObjectID, Object *> instances;
static HashMap<Object *, ObjectID, ObjectPtrHash> instance_checks;
- static uint32_t instance_counter;
+ static ObjectID instance_counter;
friend class Object;
friend void unregister_core_types();
static RWLock *rw_lock;
static void cleanup();
- static uint32_t add_instance(Object *p_object);
+ static ObjectID add_instance(Object *p_object);
static void remove_instance(Object *p_object);
friend void register_core_types();
static void setup();
@@ -706,7 +736,7 @@ class ObjectDB {
public:
typedef void (*DebugFunc)(Object *p_obj);
- static Object *get_instance(uint32_t p_instance_ID);
+ static Object *get_instance(ObjectID p_instance_ID);
static void debug_objects(DebugFunc p_func);
static int get_object_count();
diff --git a/core/os/copymem.h b/core/os/copymem.h
index 9b13d6c731..3ad2403f9c 100644
--- a/core/os/copymem.h
+++ b/core/os/copymem.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index 6f7255372f..391ae78c85 100644
--- a/core/os/dir_access.cpp
+++ b/core/os/dir_access.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,16 +28,16 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "dir_access.h"
-#include "global_config.h"
#include "os/file_access.h"
#include "os/memory.h"
#include "os/os.h"
+#include "project_settings.h"
String DirAccess::_get_root_path() const {
switch (_access_type) {
- case ACCESS_RESOURCES: return GlobalConfig::get_singleton()->get_resource_path();
+ case ACCESS_RESOURCES: return ProjectSettings::get_singleton()->get_resource_path();
case ACCESS_USERDATA: return OS::get_singleton()->get_data_dir();
default: return "";
}
@@ -199,10 +200,10 @@ String DirAccess::fix_path(String p_path) const {
case ACCESS_RESOURCES: {
- if (GlobalConfig::get_singleton()) {
+ if (ProjectSettings::get_singleton()) {
if (p_path.begins_with("res://")) {
- String resource_path = GlobalConfig::get_singleton()->get_resource_path();
+ String resource_path = ProjectSettings::get_singleton()->get_resource_path();
if (resource_path != "") {
return p_path.replace_first("res:/", resource_path);
diff --git a/core/os/dir_access.h b/core/os/dir_access.h
index 1ac2d0e03a..4bee229555 100644
--- a/core/os/dir_access.h
+++ b/core/os/dir_access.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp
index 3aac1f6f21..9d1fefc925 100644
--- a/core/os/file_access.cpp
+++ b/core/os/file_access.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,12 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "file_access.h"
+
#include "core/io/file_access_pack.h"
#include "core/io/marshalls.h"
-#include "global_config.h"
-#include "io/md5.h"
-#include "io/sha256.h"
#include "os/os.h"
+#include "project_settings.h"
+
+#include "thirdparty/misc/md5.h"
+#include "thirdparty/misc/sha256.h"
FileAccess::CreateFunc FileAccess::create_func[ACCESS_MAX] = { 0, 0 };
@@ -132,10 +135,10 @@ String FileAccess::fix_path(const String &p_path) const {
case ACCESS_RESOURCES: {
- if (GlobalConfig::get_singleton()) {
+ if (ProjectSettings::get_singleton()) {
if (r_path.begins_with("res://")) {
- String resource_path = GlobalConfig::get_singleton()->get_resource_path();
+ String resource_path = ProjectSettings::get_singleton()->get_resource_path();
if (resource_path != "") {
return r_path.replace("res:/", resource_path);
@@ -249,6 +252,27 @@ double FileAccess::get_double() const {
return m.d;
};
+String FileAccess::get_token() const {
+
+ CharString token;
+
+ CharType c = get_8();
+
+ while (!eof_reached()) {
+
+ if (c <= ' ') {
+ if (!token.empty())
+ break;
+ } else {
+ token.push_back(c);
+ }
+ c = get_8();
+ }
+
+ token.push_back(0);
+ return String::utf8(token.get_data());
+}
+
String FileAccess::get_line() const {
CharString line;
@@ -276,6 +300,8 @@ Vector<String> FileAccess::get_csv_line(String delim) const {
String l;
int qc = 0;
do {
+ ERR_FAIL_COND_V(eof_reached(), Vector<String>());
+
l += get_line() + "\n";
qc = 0;
for (int i = 0; i < l.length(); i++) {
@@ -449,9 +475,9 @@ void FileAccess::store_buffer(const uint8_t *p_src, int p_length) {
store_8(p_src[i]);
}
-Vector<uint8_t> FileAccess::get_file_as_array(const String &p_file) {
+Vector<uint8_t> FileAccess::get_file_as_array(const String &p_path) {
- FileAccess *f = FileAccess::open(p_file, READ);
+ FileAccess *f = FileAccess::open(p_path, READ);
ERR_FAIL_COND_V(!f, Vector<uint8_t>());
Vector<uint8_t> data;
data.resize(f->get_len());
diff --git a/core/os/file_access.h b/core/os/file_access.h
index 10d3ffebbb..beed7551fb 100644
--- a/core/os/file_access.h
+++ b/core/os/file_access.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -105,6 +106,7 @@ public:
virtual int get_buffer(uint8_t *p_dst, int p_length) const; ///< get an array of bytes
virtual String get_line() const;
+ virtual String get_token() const;
virtual Vector<String> get_csv_line(String delim = ",") const;
/**< use this for files WRITTEN in _big_ endian machines (ie, amiga/mac)
@@ -127,7 +129,7 @@ public:
virtual void store_real(real_t p_real);
virtual void store_string(const String &p_string);
- virtual void store_line(const String &p_string);
+ virtual void store_line(const String &p_line);
virtual void store_pascal_string(const String &p_string);
virtual String get_pascal_string();
diff --git a/core/os/input.cpp b/core/os/input.cpp
index 22ca94d449..c7b32b939a 100644
--- a/core/os/input.cpp
+++ b/core/os/input.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,9 +28,9 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "input.h"
-#include "global_config.h"
#include "input_map.h"
#include "os/os.h"
+#include "project_settings.h"
Input *Input::singleton = NULL;
Input *Input::get_singleton() {
@@ -74,7 +75,7 @@ void Input::_bind_methods() {
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_mouse_position"),&Input::get_mouse_position); - 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);
@@ -82,7 +83,7 @@ void Input::_bind_methods() {
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()));
+ ClassDB::bind_method(D_METHOD("set_custom_mouse_cursor", "image", "hotspot"), &Input::set_custom_mouse_cursor, DEFVAL(Vector2()));
ClassDB::bind_method(D_METHOD("parse_input_event", "event"), &Input::parse_input_event);
BIND_CONSTANT(MOUSE_MODE_VISIBLE);
@@ -100,7 +101,7 @@ void Input::get_argument_options(const StringName &p_function, int p_idx, List<S
if (p_idx == 0 && (pf == "is_action_pressed" || pf == "action_press" || pf == "action_release" || pf == "is_action_just_pressed" || pf == "is_action_just_released")) {
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
const PropertyInfo &pi = E->get();
diff --git a/core/os/input.h b/core/os/input.h
index 3c33c46eba..6759c624e3 100644
--- a/core/os/input.h
+++ b/core/os/input.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -76,12 +77,12 @@ public:
virtual void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration = 0) = 0;
virtual void stop_joy_vibration(int p_device) = 0;
- virtual Point2 get_mouse_pos() const = 0;
+ virtual Point2 get_mouse_position() const = 0;
virtual Point2 get_last_mouse_speed() const = 0;
virtual int get_mouse_button_mask() const = 0;
virtual void warp_mouse_pos(const Vector2 &p_to) = 0;
- virtual Point2i warp_mouse_motion(const InputEventMouseMotion &p_motion, const Rect2 &p_rect) = 0;
+ virtual Point2i warp_mouse_motion(const Ref<InputEventMouseMotion> &p_motion, const Rect2 &p_rect) = 0;
virtual Vector3 get_gravity() const = 0;
virtual Vector3 get_accelerometer() const = 0;
@@ -103,7 +104,7 @@ public:
virtual int get_joy_button_index_from_string(String p_button) = 0;
virtual int get_joy_axis_index_from_string(String p_axis) = 0;
- virtual void parse_input_event(const InputEvent &p_event) = 0;
+ virtual void parse_input_event(const Ref<InputEvent> &p_event) = 0;
Input();
};
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index ebb1f4ed01..cb38eb67b6 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,275 +34,843 @@
*
*/
-bool InputEvent::operator==(const InputEvent &p_event) const {
- if (type != p_event.type) {
- return false;
- }
+void InputEvent::set_id(uint32_t p_id) {
+ id = p_id;
+}
- switch (type) {
- /** Current clang-format style doesn't play well with the aligned return values of that switch. */
- /* clang-format off */
- case NONE:
- return true;
- case KEY:
- return key.unicode == p_event.key.unicode
- && key.scancode == p_event.key.scancode
- && key.echo == p_event.key.echo
- && key.pressed == p_event.key.pressed
- && key.mod == p_event.key.mod;
- case MOUSE_MOTION:
- return mouse_motion.x == p_event.mouse_motion.x
- && mouse_motion.y == p_event.mouse_motion.y
- && mouse_motion.relative_x == p_event.mouse_motion.relative_x
- && mouse_motion.relative_y == p_event.mouse_motion.relative_y
- && mouse_motion.button_mask == p_event.mouse_motion.button_mask
- && key.mod == p_event.key.mod;
- case MOUSE_BUTTON:
- return mouse_button.pressed == p_event.mouse_button.pressed
- && mouse_button.x == p_event.mouse_button.x
- && mouse_button.y == p_event.mouse_button.y
- && mouse_button.button_index == p_event.mouse_button.button_index
- && mouse_button.button_mask == p_event.mouse_button.button_mask
- && key.mod == p_event.key.mod;
- case JOYPAD_MOTION:
- return joy_motion.axis == p_event.joy_motion.axis
- && joy_motion.axis_value == p_event.joy_motion.axis_value;
- case JOYPAD_BUTTON:
- return joy_button.pressed == p_event.joy_button.pressed
- && joy_button.button_index == p_event.joy_button.button_index
- && joy_button.pressure == p_event.joy_button.pressure;
- case SCREEN_TOUCH:
- return screen_touch.pressed == p_event.screen_touch.pressed
- && screen_touch.index == p_event.screen_touch.index
- && screen_touch.x == p_event.screen_touch.x
- && screen_touch.y == p_event.screen_touch.y;
- case SCREEN_DRAG:
- return screen_drag.index == p_event.screen_drag.index
- && screen_drag.x == p_event.screen_drag.x
- && screen_drag.y == p_event.screen_drag.y;
- case ACTION:
- return action.action == p_event.action.action
- && action.pressed == p_event.action.pressed;
- /* clang-format on */
- default:
- ERR_PRINT("No logic to compare InputEvents of this type, this shouldn't happen.");
- }
+uint32_t InputEvent::get_id() const {
+ return id;
+}
+
+void InputEvent::set_device(int p_device) {
+ device = p_device;
+}
+
+int InputEvent::get_device() const {
+ return device;
+}
+
+bool InputEvent::is_pressed() const {
return false;
}
-InputEvent::operator String() const {
-
- String str = "Device " + itos(device) + " ID " + itos(ID) + " ";
-
- switch (type) {
-
- case NONE: {
-
- return "Event: None";
- } break;
- case KEY: {
-
- str += "Event: Key ";
- str = str + "Unicode: " + String::chr(key.unicode) + " Scan: " + itos(key.scancode) + " Echo: " + String(key.echo ? "True" : "False") + " Pressed" + String(key.pressed ? "True" : "False") + " Mod: ";
- if (key.mod.shift)
- str += "S";
- if (key.mod.control)
- str += "C";
- if (key.mod.alt)
- str += "A";
- if (key.mod.meta)
- str += "M";
-
- return str;
- } break;
- case MOUSE_MOTION: {
-
- str += "Event: Motion ";
- str = str + " Pos: " + itos(mouse_motion.x) + "," + itos(mouse_motion.y) + " Rel: " + itos(mouse_motion.relative_x) + "," + itos(mouse_motion.relative_y) + " Mask: ";
- for (int i = 0; i < 8; i++) {
-
- if ((1 << i) & mouse_motion.button_mask)
- str += itos(i + 1);
- }
- str += " Mod: ";
- if (key.mod.shift)
- str += "S";
- if (key.mod.control)
- str += "C";
- if (key.mod.alt)
- str += "A";
- if (key.mod.meta)
- str += "M";
-
- return str;
- } break;
- case MOUSE_BUTTON: {
- str += "Event: Button ";
- str = str + "Pressed: " + itos(mouse_button.pressed) + " Pos: " + itos(mouse_button.x) + "," + itos(mouse_button.y) + " Button: " + itos(mouse_button.button_index) + " Mask: ";
- for (int i = 0; i < 8; i++) {
-
- if ((1 << i) & mouse_button.button_mask)
- str += itos(i + 1);
- }
- str += " Mod: ";
- if (key.mod.shift)
- str += "S";
- if (key.mod.control)
- str += "C";
- if (key.mod.alt)
- str += "A";
- if (key.mod.meta)
- str += "M";
-
- str += String(" DoubleClick: ") + (mouse_button.doubleclick ? "Yes" : "No");
-
- return str;
-
- } break;
- case JOYPAD_MOTION: {
- str += "Event: JoypadMotion ";
- str = str + "Axis: " + itos(joy_motion.axis) + " Value: " + rtos(joy_motion.axis_value);
- return str;
-
- } break;
- case JOYPAD_BUTTON: {
- str += "Event: JoypadButton ";
- str = str + "Pressed: " + itos(joy_button.pressed) + " Index: " + itos(joy_button.button_index) + " pressure " + rtos(joy_button.pressure);
- return str;
-
- } break;
- case SCREEN_TOUCH: {
- str += "Event: ScreenTouch ";
- str = str + "Pressed: " + itos(screen_touch.pressed) + " Index: " + itos(screen_touch.index) + " pos " + rtos(screen_touch.x) + "," + rtos(screen_touch.y);
- return str;
-
- } break;
- case SCREEN_DRAG: {
- str += "Event: ScreenDrag ";
- str = str + " Index: " + itos(screen_drag.index) + " pos " + rtos(screen_drag.x) + "," + rtos(screen_drag.y);
- return str;
-
- } break;
- case ACTION: {
- str += "Event: Action: " + InputMap::get_singleton()->get_action_from_id(action.action) + " Pressed: " + itos(action.pressed);
- return str;
-
- } break;
- }
- return "";
+bool InputEvent::is_action(const StringName &p_action) const {
+
+ return InputMap::get_singleton()->event_is_action(Ref<InputEvent>((InputEvent *)this), p_action);
}
-void InputEvent::set_as_action(const String &p_action, bool p_pressed) {
+bool InputEvent::is_action_pressed(const StringName &p_action) const {
- type = ACTION;
- action.action = InputMap::get_singleton()->get_action_id(p_action);
- action.pressed = p_pressed;
+ return (is_pressed() && !is_echo() && is_action(p_action));
}
+bool InputEvent::is_action_released(const StringName &p_action) const {
-bool InputEvent::is_pressed() const {
+ return (!is_pressed() && is_action(p_action));
+}
- switch (type) {
+bool InputEvent::is_echo() const {
- case KEY: return key.pressed;
- case MOUSE_BUTTON: return mouse_button.pressed;
- case JOYPAD_BUTTON: return joy_button.pressed;
- case SCREEN_TOUCH: return screen_touch.pressed;
- case JOYPAD_MOTION: return ABS(joy_motion.axis_value) > 0.5;
- case ACTION: return action.pressed;
- default: {}
- }
+ return false;
+}
+
+Ref<InputEvent> InputEvent::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
+
+ return Ref<InputEvent>((InputEvent *)this);
+}
+
+String InputEvent::as_text() const {
+
+ return String();
+}
+
+bool InputEvent::action_match(const Ref<InputEvent> &p_event) const {
return false;
}
-bool InputEvent::is_echo() const {
+bool InputEvent::shortcut_match(const Ref<InputEvent> &p_event) const {
+
+ return false;
+}
+
+bool InputEvent::is_action_type() const {
+
+ return false;
+}
+
+#if 0
+if (String(p_method) == "is_action" && p_argidx == 0) {
+
+ List<PropertyInfo> pinfo;
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
+
+ for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
+ const PropertyInfo &pi = E->get();
+
+ if (!pi.name.begins_with("input/"))
+ continue;
+
+ String name = pi.name.substr(pi.name.find("/") + 1, pi.name.length());
+ result.insert("\"" + name + "\"");
+ }
+
+} else
+#endif
+
+void InputEvent::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_id", "id"), &InputEvent::set_id);
+ ClassDB::bind_method(D_METHOD("get_id"), &InputEvent::get_id);
+
+ ClassDB::bind_method(D_METHOD("set_device", "device"), &InputEvent::set_device);
+ ClassDB::bind_method(D_METHOD("get_device"), &InputEvent::get_device);
+
+ ClassDB::bind_method(D_METHOD("is_pressed"), &InputEvent::is_pressed);
+ ClassDB::bind_method(D_METHOD("is_action", "action"), &InputEvent::is_action);
+ ClassDB::bind_method(D_METHOD("is_action_pressed", "action"), &InputEvent::is_action_pressed);
+ ClassDB::bind_method(D_METHOD("is_action_released", "action"), &InputEvent::is_action_released);
+ ClassDB::bind_method(D_METHOD("is_echo"), &InputEvent::is_echo);
+
+ ClassDB::bind_method(D_METHOD("as_text"), &InputEvent::as_text);
+
+ ClassDB::bind_method(D_METHOD("action_match", "event"), &InputEvent::action_match);
+ ClassDB::bind_method(D_METHOD("shortcut_match", "event"), &InputEvent::shortcut_match);
+
+ ClassDB::bind_method(D_METHOD("is_action_type"), &InputEvent::is_action_type);
+
+ ClassDB::bind_method(D_METHOD("xformed_by", "xform", "local_ofs"), &InputEvent::xformed_by, DEFVAL(Vector2()));
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "device"), "set_device", "get_device");
+}
+
+InputEvent::InputEvent() {
+
+ id = 0;
+ device = 0;
+}
+
+//////////////////
+
+void InputEventWithModifiers::set_shift(bool p_enabled) {
+
+ shift = p_enabled;
+}
+
+bool InputEventWithModifiers::get_shift() const {
+
+ return shift;
+}
+
+void InputEventWithModifiers::set_alt(bool p_enabled) {
+
+ alt = p_enabled;
+}
+bool InputEventWithModifiers::get_alt() const {
+
+ return alt;
+}
+
+void InputEventWithModifiers::set_control(bool p_enabled) {
+
+ control = p_enabled;
+}
+bool InputEventWithModifiers::get_control() const {
+
+ return control;
+}
+
+void InputEventWithModifiers::set_metakey(bool p_enabled) {
+
+ meta = p_enabled;
+}
+bool InputEventWithModifiers::get_metakey() const {
+
+ return meta;
+}
+
+void InputEventWithModifiers::set_command(bool p_enabled) {
+
+ command = p_enabled;
+}
+bool InputEventWithModifiers::get_command() const {
+
+ return command;
+}
+
+void InputEventWithModifiers::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_alt", "enable"), &InputEventWithModifiers::set_alt);
+ ClassDB::bind_method(D_METHOD("get_alt"), &InputEventWithModifiers::get_alt);
+
+ ClassDB::bind_method(D_METHOD("set_shift", "enable"), &InputEventWithModifiers::set_shift);
+ ClassDB::bind_method(D_METHOD("get_shift"), &InputEventWithModifiers::get_shift);
+
+ ClassDB::bind_method(D_METHOD("set_control", "enable"), &InputEventWithModifiers::set_control);
+ ClassDB::bind_method(D_METHOD("get_control"), &InputEventWithModifiers::get_control);
+
+ ClassDB::bind_method(D_METHOD("set_metakey", "enable"), &InputEventWithModifiers::set_metakey);
+ ClassDB::bind_method(D_METHOD("get_metakey"), &InputEventWithModifiers::get_metakey);
+
+ ClassDB::bind_method(D_METHOD("set_command", "enable"), &InputEventWithModifiers::set_command);
+ ClassDB::bind_method(D_METHOD("get_command"), &InputEventWithModifiers::get_command);
+
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "alt"), "set_alt", "get_alt");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shift"), "set_shift", "get_shift");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "control"), "set_control", "get_control");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "meta"), "set_metakey", "get_metakey");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "command"), "set_command", "get_command");
+}
+
+InputEventWithModifiers::InputEventWithModifiers() {
+
+ alt = false;
+ shift = false;
+ control = false;
+ meta = false;
+}
+
+//////////////////////////////////
+
+void InputEventKey::set_pressed(bool p_pressed) {
- return (type == KEY && key.echo);
+ pressed = p_pressed;
}
-bool InputEvent::is_action(const String &p_action) const {
+bool InputEventKey::is_pressed() const {
- return InputMap::get_singleton()->event_is_action(*this, p_action);
+ return pressed;
}
-bool InputEvent::is_action_pressed(const String &p_action) const {
+void InputEventKey::set_scancode(uint32_t p_scancode) {
- return is_action(p_action) && is_pressed() && !is_echo();
+ scancode = p_scancode;
}
+uint32_t InputEventKey::get_scancode() const {
-bool InputEvent::is_action_released(const String &p_action) const {
+ return scancode;
+}
+
+void InputEventKey::set_unicode(uint32_t p_unicode) {
+
+ unicode = p_unicode;
+}
+uint32_t InputEventKey::get_unicode() const {
+
+ return unicode;
+}
- return is_action(p_action) && !is_pressed();
+void InputEventKey::set_echo(bool p_enable) {
+
+ echo = p_enable;
+}
+bool InputEventKey::is_echo() const {
+
+ return echo;
}
uint32_t InputEventKey::get_scancode_with_modifiers() const {
uint32_t sc = scancode;
- if (mod.control)
+ if (get_control())
sc |= KEY_MASK_CTRL;
- if (mod.alt)
+ if (get_alt())
sc |= KEY_MASK_ALT;
- if (mod.shift)
+ if (get_shift())
sc |= KEY_MASK_SHIFT;
- if (mod.meta)
+ if (get_metakey())
sc |= KEY_MASK_META;
return sc;
}
-InputEvent InputEvent::xform_by(const Transform2D &p_xform) const {
-
- InputEvent ev = *this;
-
- switch (ev.type) {
-
- case InputEvent::MOUSE_BUTTON: {
-
- Vector2 g = p_xform.xform(Vector2(ev.mouse_button.global_x, ev.mouse_button.global_y));
- Vector2 l = p_xform.xform(Vector2(ev.mouse_button.x, ev.mouse_button.y));
- ev.mouse_button.x = l.x;
- ev.mouse_button.y = l.y;
- ev.mouse_button.global_x = g.x;
- ev.mouse_button.global_y = g.y;
-
- } break;
- case InputEvent::MOUSE_MOTION: {
-
- Vector2 g = p_xform.xform(Vector2(ev.mouse_motion.global_x, ev.mouse_motion.global_y));
- Vector2 l = p_xform.xform(Vector2(ev.mouse_motion.x, ev.mouse_motion.y));
- Vector2 r = p_xform.basis_xform(Vector2(ev.mouse_motion.relative_x, ev.mouse_motion.relative_y));
- Vector2 s = p_xform.basis_xform(Vector2(ev.mouse_motion.speed_x, ev.mouse_motion.speed_y));
- ev.mouse_motion.x = l.x;
- ev.mouse_motion.y = l.y;
- ev.mouse_motion.global_x = g.x;
- ev.mouse_motion.global_y = g.y;
- ev.mouse_motion.relative_x = r.x;
- ev.mouse_motion.relative_y = r.y;
- ev.mouse_motion.speed_x = s.x;
- ev.mouse_motion.speed_y = s.y;
-
- } break;
- case InputEvent::SCREEN_TOUCH: {
-
- Vector2 t = p_xform.xform(Vector2(ev.screen_touch.x, ev.screen_touch.y));
- ev.screen_touch.x = t.x;
- ev.screen_touch.y = t.y;
-
- } break;
- case InputEvent::SCREEN_DRAG: {
-
- Vector2 t = p_xform.xform(Vector2(ev.screen_drag.x, ev.screen_drag.y));
- Vector2 r = p_xform.basis_xform(Vector2(ev.screen_drag.relative_x, ev.screen_drag.relative_y));
- Vector2 s = p_xform.basis_xform(Vector2(ev.screen_drag.speed_x, ev.screen_drag.speed_y));
- ev.screen_drag.x = t.x;
- ev.screen_drag.y = t.y;
- ev.screen_drag.relative_x = r.x;
- ev.screen_drag.relative_y = r.y;
- ev.screen_drag.speed_x = s.x;
- ev.screen_drag.speed_y = s.y;
- } break;
+String InputEventKey::as_text() const {
+
+ String kc = keycode_get_string(scancode);
+ if (kc == String())
+ return kc;
+
+ if (get_metakey()) {
+ kc = "Meta+" + kc;
+ }
+ if (get_alt()) {
+ kc = "Alt+" + kc;
}
+ if (get_shift()) {
+ kc = "Shift+" + kc;
+ }
+ if (get_control()) {
+ kc = "Ctrl+" + kc;
+ }
+ return kc;
+}
+
+bool InputEventKey::action_match(const Ref<InputEvent> &p_event) const {
+
+ Ref<InputEventKey> key = p_event;
+ if (key.is_null())
+ return false;
+
+ uint32_t code = get_scancode_with_modifiers();
+ uint32_t event_code = key->get_scancode_with_modifiers();
+
+ return get_scancode() == key->get_scancode() && (!key->is_pressed() || (code & event_code) == code);
+}
+
+bool InputEventKey::shortcut_match(const Ref<InputEvent> &p_event) const {
+
+ Ref<InputEventKey> key = p_event;
+ if (key.is_null())
+ return false;
+
+ uint32_t code = get_scancode_with_modifiers();
+ uint32_t event_code = key->get_scancode_with_modifiers();
+
+ return code == event_code;
+}
+
+void InputEventKey::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_pressed", "pressed"), &InputEventKey::set_pressed);
+
+ ClassDB::bind_method(D_METHOD("set_scancode", "scancode"), &InputEventKey::set_scancode);
+ ClassDB::bind_method(D_METHOD("get_scancode"), &InputEventKey::get_scancode);
+
+ ClassDB::bind_method(D_METHOD("set_unicode", "unicode"), &InputEventKey::set_unicode);
+ ClassDB::bind_method(D_METHOD("get_unicode"), &InputEventKey::get_unicode);
+
+ ClassDB::bind_method(D_METHOD("set_echo", "echo"), &InputEventKey::set_echo);
+
+ ClassDB::bind_method(D_METHOD("get_scancode_with_modifiers"), &InputEventKey::get_scancode_with_modifiers);
+
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "scancode"), "set_scancode", "get_scancode");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "unicode"), "set_unicode", "get_unicode");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "echo"), "set_echo", "is_echo");
+}
+
+InputEventKey::InputEventKey() {
+
+ pressed = false;
+ scancode = 0;
+ unicode = 0; ///unicode
+ echo = false;
+}
+
+////////////////////////////////////////
+
+void InputEventMouse::set_button_mask(int p_mask) {
+
+ button_mask = p_mask;
+}
+int InputEventMouse::get_button_mask() const {
+
+ return button_mask;
+}
+
+void InputEventMouse::set_position(const Vector2 &p_pos) {
+
+ pos = p_pos;
+}
+Vector2 InputEventMouse::get_position() const {
+
+ return pos;
+}
+
+void InputEventMouse::set_global_position(const Vector2 &p_global_pos) {
+
+ global_pos = p_global_pos;
+}
+Vector2 InputEventMouse::get_global_position() const {
+
+ return global_pos;
+}
+
+void InputEventMouse::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_button_mask", "button_mask"), &InputEventMouse::set_button_mask);
+ ClassDB::bind_method(D_METHOD("get_button_mask"), &InputEventMouse::get_button_mask);
+
+ ClassDB::bind_method(D_METHOD("set_position", "position"), &InputEventMouse::set_position);
+ ClassDB::bind_method(D_METHOD("get_position"), &InputEventMouse::get_position);
+
+ ClassDB::bind_method(D_METHOD("set_global_position", "global_position"), &InputEventMouse::set_global_position);
+ ClassDB::bind_method(D_METHOD("get_global_position"), &InputEventMouse::get_global_position);
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "button_mask"), "set_button_mask", "get_button_mask");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "position"), "set_position", "get_position");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_position"), "set_global_position", "get_global_position");
+}
+
+InputEventMouse::InputEventMouse() {
+
+ button_mask = 0;
+}
+
+///////////////////////////////////////
+
+void InputEventMouseButton::set_factor(float p_factor) {
+
+ factor = p_factor;
+}
+
+float InputEventMouseButton::get_factor() {
+
+ return factor;
+}
+
+void InputEventMouseButton::set_button_index(int p_index) {
+
+ button_index = p_index;
+}
+int InputEventMouseButton::get_button_index() const {
+
+ return button_index;
+}
+
+void InputEventMouseButton::set_pressed(bool p_pressed) {
+
+ pressed = p_pressed;
+}
+bool InputEventMouseButton::is_pressed() const {
+
+ return pressed;
+}
+
+void InputEventMouseButton::set_doubleclick(bool p_doubleclick) {
+
+ doubleclick = p_doubleclick;
+}
+bool InputEventMouseButton::is_doubleclick() const {
+
+ return doubleclick;
+}
+
+Ref<InputEvent> InputEventMouseButton::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
+
+ Vector2 g = p_xform.xform(get_global_position());
+ Vector2 l = p_xform.xform(get_position() + p_local_ofs);
+
+ Ref<InputEventMouseButton> mb;
+ mb.instance();
+
+ mb->set_id(get_id());
+ mb->set_device(get_device());
+
+ mb->set_alt(get_alt());
+ mb->set_shift(get_shift());
+ mb->set_control(get_control());
+ mb->set_metakey(get_metakey());
+
+ mb->set_position(l);
+ mb->set_global_position(g);
+
+ mb->set_button_mask(get_button_mask());
+ mb->set_pressed(pressed);
+ mb->set_doubleclick(doubleclick);
+ mb->set_factor(factor);
+ mb->set_button_index(button_index);
+
+ return mb;
+}
+
+bool InputEventMouseButton::action_match(const Ref<InputEvent> &p_event) const {
+
+ Ref<InputEventMouseButton> mb = p_event;
+ if (mb.is_null())
+ return false;
+
+ return mb->button_index == button_index;
+}
+
+void InputEventMouseButton::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_factor", "factor"), &InputEventMouseButton::set_factor);
+ ClassDB::bind_method(D_METHOD("get_factor"), &InputEventMouseButton::get_factor);
+
+ ClassDB::bind_method(D_METHOD("set_button_index", "button_index"), &InputEventMouseButton::set_button_index);
+ ClassDB::bind_method(D_METHOD("get_button_index"), &InputEventMouseButton::get_button_index);
+
+ ClassDB::bind_method(D_METHOD("set_pressed", "pressed"), &InputEventMouseButton::set_pressed);
+ // ClassDB::bind_method(D_METHOD("is_pressed"), &InputEventMouseButton::is_pressed);
+
+ ClassDB::bind_method(D_METHOD("set_doubleclick", "doubleclick"), &InputEventMouseButton::set_doubleclick);
+ ClassDB::bind_method(D_METHOD("is_doubleclick"), &InputEventMouseButton::is_doubleclick);
+
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "factor"), "set_factor", "get_factor");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "button_index"), "set_button_index", "get_button_index");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "doubleclick"), "set_doubleclick", "is_doubleclick");
+}
+
+InputEventMouseButton::InputEventMouseButton() {
+
+ factor = 1;
+ button_index = 0;
+ pressed = false;
+ doubleclick = false;
+}
+
+////////////////////////////////////////////
+
+void InputEventMouseMotion::set_relative(const Vector2 &p_relative) {
+
+ relative = p_relative;
+}
+Vector2 InputEventMouseMotion::get_relative() const {
+
+ return relative;
+}
+
+void InputEventMouseMotion::set_speed(const Vector2 &p_speed) {
+
+ speed = p_speed;
+}
+Vector2 InputEventMouseMotion::get_speed() const {
+
+ return speed;
+}
+
+Ref<InputEvent> InputEventMouseMotion::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
+
+ Vector2 g = p_xform.xform(get_global_position());
+ Vector2 l = p_xform.xform(get_position() + p_local_ofs);
+ Vector2 r = p_xform.basis_xform(get_relative());
+ Vector2 s = p_xform.basis_xform(get_speed());
+
+ Ref<InputEventMouseMotion> mm;
+ mm.instance();
+
+ mm->set_id(get_id());
+ mm->set_device(get_device());
+
+ mm->set_alt(get_alt());
+ mm->set_shift(get_shift());
+ mm->set_control(get_control());
+ mm->set_metakey(get_metakey());
+
+ mm->set_position(l);
+ mm->set_global_position(g);
+
+ mm->set_button_mask(get_button_mask());
+ mm->set_relative(r);
+ mm->set_speed(s);
+
+ return mm;
+}
+
+void InputEventMouseMotion::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_relative", "relative"), &InputEventMouseMotion::set_relative);
+ ClassDB::bind_method(D_METHOD("get_relative"), &InputEventMouseMotion::get_relative);
+
+ ClassDB::bind_method(D_METHOD("set_speed", "speed"), &InputEventMouseMotion::set_speed);
+ ClassDB::bind_method(D_METHOD("get_speed"), &InputEventMouseMotion::get_speed);
+
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "relative"), "set_relative", "get_relative");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "speed"), "set_speed", "get_speed");
+}
+
+InputEventMouseMotion::InputEventMouseMotion() {
+}
+
+////////////////////////////////////////
+
+void InputEventJoypadMotion::set_axis(int p_axis) {
+
+ axis = p_axis;
+}
+
+int InputEventJoypadMotion::get_axis() const {
+
+ return axis;
+}
+
+void InputEventJoypadMotion::set_axis_value(float p_value) {
+
+ axis_value = p_value;
+}
+float InputEventJoypadMotion::get_axis_value() const {
+
+ return axis_value;
+}
+
+bool InputEventJoypadMotion::is_pressed() const {
+
+ return Math::abs(axis_value) > 0.5f;
+}
+
+bool InputEventJoypadMotion::action_match(const Ref<InputEvent> &p_event) const {
+
+ Ref<InputEventJoypadMotion> jm = p_event;
+ if (jm.is_null())
+ return false;
+
+ return (axis == jm->axis && (axis_value < 0) == (jm->axis_value < 0));
+}
+
+void InputEventJoypadMotion::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_axis", "axis"), &InputEventJoypadMotion::set_axis);
+ ClassDB::bind_method(D_METHOD("get_axis"), &InputEventJoypadMotion::get_axis);
+
+ ClassDB::bind_method(D_METHOD("set_axis_value", "axis_value"), &InputEventJoypadMotion::set_axis_value);
+ ClassDB::bind_method(D_METHOD("get_axis_value"), &InputEventJoypadMotion::get_axis_value);
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "axis"), "set_axis", "get_axis");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "axis_value"), "set_axis_value", "get_axis_value");
+}
+
+InputEventJoypadMotion::InputEventJoypadMotion() {
+
+ axis = 0;
+ axis_value = 0;
+}
+/////////////////////////////////
+
+void InputEventJoypadButton::set_button_index(int p_index) {
+
+ button_index = p_index;
+}
+
+int InputEventJoypadButton::get_button_index() const {
+
+ return button_index;
+}
+
+void InputEventJoypadButton::set_pressed(bool p_pressed) {
+
+ pressed = p_pressed;
+}
+bool InputEventJoypadButton::is_pressed() const {
+
+ return pressed;
+}
+
+void InputEventJoypadButton::set_pressure(float p_pressure) {
+
+ pressure = p_pressure;
+}
+float InputEventJoypadButton::get_pressure() const {
+
+ return pressure;
+}
+
+bool InputEventJoypadButton::action_match(const Ref<InputEvent> &p_event) const {
+
+ Ref<InputEventJoypadButton> jb = p_event;
+ if (jb.is_null())
+ return false;
+
+ return button_index == jb->button_index;
+}
+
+void InputEventJoypadButton::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_button_index", "button_index"), &InputEventJoypadButton::set_button_index);
+ ClassDB::bind_method(D_METHOD("get_button_index"), &InputEventJoypadButton::get_button_index);
+
+ ClassDB::bind_method(D_METHOD("set_pressure", "pressure"), &InputEventJoypadButton::set_pressure);
+ ClassDB::bind_method(D_METHOD("get_pressure"), &InputEventJoypadButton::get_pressure);
+
+ ClassDB::bind_method(D_METHOD("set_pressed", "pressed"), &InputEventJoypadButton::set_pressed);
+ // ClassDB::bind_method(D_METHOD("is_pressed"), &InputEventJoypadButton::is_pressed);
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "button_index"), "set_button_index", "get_button_index");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "pressure"), "set_pressure", "get_pressure");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
+}
+
+InputEventJoypadButton::InputEventJoypadButton() {
+
+ button_index = 0;
+ pressure = 0;
+ pressed = false;
+}
+
+//////////////////////////////////////////////
+
+void InputEventScreenTouch::set_index(int p_index) {
+
+ index = p_index;
+}
+int InputEventScreenTouch::get_index() const {
+
+ return index;
+}
+
+void InputEventScreenTouch::set_position(const Vector2 &p_pos) {
+
+ pos = p_pos;
+}
+Vector2 InputEventScreenTouch::get_position() const {
+
+ return pos;
+}
+
+void InputEventScreenTouch::set_pressed(bool p_pressed) {
+
+ pressed = p_pressed;
+}
+bool InputEventScreenTouch::is_pressed() const {
+
+ return pressed;
+}
+
+Ref<InputEvent> InputEventScreenTouch::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
+
+ Ref<InputEventScreenTouch> st;
+ st.instance();
+ st->set_id(get_id());
+ st->set_device(get_device());
+ st->set_index(index);
+ st->set_position(p_xform.xform(pos + p_local_ofs));
+ st->set_pressed(pressed);
+
+ return st;
+}
+
+void InputEventScreenTouch::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_index", "index"), &InputEventScreenTouch::set_index);
+ ClassDB::bind_method(D_METHOD("get_index"), &InputEventScreenTouch::get_index);
+
+ ClassDB::bind_method(D_METHOD("set_position", "pos"), &InputEventScreenTouch::set_position);
+ ClassDB::bind_method(D_METHOD("get_position"), &InputEventScreenTouch::get_position);
+
+ ClassDB::bind_method(D_METHOD("set_pressed", "pressed"), &InputEventScreenTouch::set_pressed);
+ //ClassDB::bind_method(D_METHOD("is_pressed"),&InputEventScreenTouch::is_pressed);
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "index"), "set_index", "get_index");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "position"), "set_position", "get_position");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
+}
+
+InputEventScreenTouch::InputEventScreenTouch() {
+
+ index = 0;
+ pressed = false;
+}
+
+/////////////////////////////
+
+void InputEventScreenDrag::set_index(int p_index) {
+
+ index = p_index;
+}
+
+int InputEventScreenDrag::get_index() const {
+
+ return index;
+}
+
+void InputEventScreenDrag::set_position(const Vector2 &p_pos) {
+
+ pos = p_pos;
+}
+Vector2 InputEventScreenDrag::get_position() const {
+
+ return pos;
+}
+
+void InputEventScreenDrag::set_relative(const Vector2 &p_relative) {
+
+ relative = p_relative;
+}
+Vector2 InputEventScreenDrag::get_relative() const {
+
+ return relative;
+}
+
+void InputEventScreenDrag::set_speed(const Vector2 &p_speed) {
+
+ speed = p_speed;
+}
+Vector2 InputEventScreenDrag::get_speed() const {
+
+ return speed;
+}
+
+Ref<InputEvent> InputEventScreenDrag::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
+
+ Ref<InputEventScreenDrag> sd;
+
+ sd.instance();
+
+ sd->set_id(get_id());
+ sd->set_device(get_device());
+
+ sd->set_index(index);
+ sd->set_position(p_xform.xform(pos + p_local_ofs));
+ sd->set_relative(p_xform.basis_xform(relative));
+ sd->set_speed(p_xform.basis_xform(speed));
+
+ return sd;
+}
+
+void InputEventScreenDrag::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_index", "index"), &InputEventScreenDrag::set_index);
+ ClassDB::bind_method(D_METHOD("get_index"), &InputEventScreenDrag::get_index);
+
+ ClassDB::bind_method(D_METHOD("set_position", "position"), &InputEventScreenDrag::set_position);
+ ClassDB::bind_method(D_METHOD("get_position"), &InputEventScreenDrag::get_position);
+
+ ClassDB::bind_method(D_METHOD("set_relative", "relative"), &InputEventScreenDrag::set_relative);
+ ClassDB::bind_method(D_METHOD("get_relative"), &InputEventScreenDrag::get_relative);
+
+ ClassDB::bind_method(D_METHOD("set_speed", "speed"), &InputEventScreenDrag::set_speed);
+ ClassDB::bind_method(D_METHOD("get_speed"), &InputEventScreenDrag::get_speed);
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "index"), "set_index", "get_index");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "position"), "set_position", "get_position");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "relative"), "set_relative", "get_relative");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "speed"), "set_speed", "get_speed");
+}
+
+InputEventScreenDrag::InputEventScreenDrag() {
+
+ index = 0;
+}
+/////////////////////////////
+
+void InputEventAction::set_action(const StringName &p_action) {
+
+ action = p_action;
+}
+StringName InputEventAction::get_action() const {
+
+ return action;
+}
+
+void InputEventAction::set_pressed(bool p_pressed) {
+
+ pressed = p_pressed;
+}
+bool InputEventAction::is_pressed() const {
+
+ return pressed;
+}
+
+bool InputEventAction::is_action(const StringName &p_action) const {
+
+ return action == p_action;
+}
+
+void InputEventAction::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_action", "action"), &InputEventAction::set_action);
+ ClassDB::bind_method(D_METHOD("get_action"), &InputEventAction::get_action);
+
+ ClassDB::bind_method(D_METHOD("set_pressed", "pressed"), &InputEventAction::set_pressed);
+ //ClassDB::bind_method(D_METHOD("is_pressed"), &InputEventAction::is_pressed);
+
+ // ClassDB::bind_method(D_METHOD("is_action", "name"), &InputEventAction::is_action);
+
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "action"), "set_action", "get_action");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
+}
- return ev;
+InputEventAction::InputEventAction() {
+ pressed = false;
}
diff --git a/core/os/input_event.h b/core/os/input_event.h
index 17b9f8abc1..d1fd7cc90f 100644
--- a/core/os/input_event.h
+++ b/core/os/input_event.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,6 +32,7 @@
#include "math_2d.h"
#include "os/copymem.h"
+#include "resource.h"
#include "typedefs.h"
#include "ustring.h"
/**
@@ -136,7 +138,41 @@ enum {
* Input Modifier Status
* for keyboard/mouse events.
*/
-struct InputModifierState {
+
+class InputEvent : public Resource {
+ GDCLASS(InputEvent, Resource)
+
+ uint32_t id;
+ int device;
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_id(uint32_t p_id);
+ uint32_t get_id() const;
+
+ void set_device(int p_device);
+ int get_device() const;
+
+ virtual bool is_pressed() const;
+ virtual bool is_action(const StringName &p_action) const;
+ virtual bool is_action_pressed(const StringName &p_action) const;
+ virtual bool is_action_released(const StringName &p_action) const;
+ virtual bool is_echo() const;
+ virtual String as_text() const;
+
+ virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
+
+ virtual bool action_match(const Ref<InputEvent> &p_event) const;
+ virtual bool shortcut_match(const Ref<InputEvent> &p_event) const;
+ virtual bool is_action_type() const;
+
+ InputEvent();
+};
+
+class InputEventWithModifiers : public InputEvent {
+ GDCLASS(InputEventWithModifiers, InputEvent)
bool shift;
bool alt;
@@ -156,122 +192,271 @@ struct InputModifierState {
#endif
- bool operator==(const InputModifierState &rvalue) const {
+protected:
+ static void _bind_methods();
+
+public:
+ void set_shift(bool p_enabled);
+ bool get_shift() const;
+
+ void set_alt(bool p_enabled);
+ bool get_alt() const;
+
+ void set_control(bool p_enabled);
+ bool get_control() const;
+
+ void set_metakey(bool p_enabled);
+ bool get_metakey() const;
- return ((shift == rvalue.shift) && (alt == rvalue.alt) && (control == rvalue.control) && (meta == rvalue.meta));
- }
+ void set_command(bool p_enabled);
+ bool get_command() const;
+
+ InputEventWithModifiers();
};
-struct InputEventKey {
+class InputEventKey : public InputEventWithModifiers {
- InputModifierState mod;
+ GDCLASS(InputEventKey, InputEventWithModifiers)
bool pressed; /// otherwise release
uint32_t scancode; ///< check keyboard.h , KeyCode enum, without modifier masks
uint32_t unicode; ///unicode
+ bool echo; /// true if this is an echo key
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_pressed(bool p_pressed);
+ virtual bool is_pressed() const;
+
+ void set_scancode(uint32_t p_scancode);
+ uint32_t get_scancode() const;
+
+ void set_unicode(uint32_t p_unicode);
+ uint32_t get_unicode() const;
+
+ void set_echo(bool p_enable);
+ virtual bool is_echo() const;
+
uint32_t get_scancode_with_modifiers() const;
- bool echo; /// true if this is an echo key
+ virtual bool action_match(const Ref<InputEvent> &p_event) const;
+ virtual bool shortcut_match(const Ref<InputEvent> &p_event) const;
+
+ virtual bool is_action_type() const { return true; }
+
+ virtual String as_text() const;
+
+ InputEventKey();
};
-struct InputEventMouse {
+class InputEventMouse : public InputEventWithModifiers {
+
+ GDCLASS(InputEventMouse, InputEventWithModifiers)
- InputModifierState mod;
int button_mask;
- float x, y;
- float global_x, global_y;
- int pointer_index;
+
+ Vector2 pos;
+ Vector2 global_pos;
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_button_mask(int p_mask);
+ int get_button_mask() const;
+
+ void set_position(const Vector2 &p_pos);
+ Vector2 get_position() const;
+
+ void set_global_position(const Vector2 &p_global_pos);
+ Vector2 get_global_position() const;
+
+ InputEventMouse();
};
-struct InputEventMouseButton : public InputEventMouse {
+class InputEventMouseButton : public InputEventMouse {
+ GDCLASS(InputEventMouseButton, InputEventMouse)
+
+ float factor;
int button_index;
bool pressed; //otherwise released
bool doubleclick; //last even less than doubleclick time
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_factor(float p_factor);
+ float get_factor();
+
+ void set_button_index(int p_index);
+ int get_button_index() const;
+
+ void set_pressed(bool p_pressed);
+ virtual bool is_pressed() const;
+
+ void set_doubleclick(bool p_doubleclick);
+ bool is_doubleclick() const;
+
+ virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
+ virtual bool action_match(const Ref<InputEvent> &p_event) const;
+
+ virtual bool is_action_type() const { return true; }
+
+ InputEventMouseButton();
};
-struct InputEventMouseMotion : public InputEventMouse {
+class InputEventMouseMotion : public InputEventMouse {
+
+ GDCLASS(InputEventMouseMotion, InputEventMouse)
+ Vector2 relative;
+ Vector2 speed;
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_relative(const Vector2 &p_relative);
+ Vector2 get_relative() const;
+
+ void set_speed(const Vector2 &p_speed);
+ Vector2 get_speed() const;
- float relative_x, relative_y;
- float speed_x, speed_y;
+ virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
+
+ InputEventMouseMotion();
};
-struct InputEventJoypadMotion {
+class InputEventJoypadMotion : public InputEvent {
+ GDCLASS(InputEventJoypadMotion, InputEvent)
int axis; ///< Joypad axis
float axis_value; ///< -1 to 1
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_axis(int p_axis);
+ int get_axis() const;
+
+ void set_axis_value(float p_value);
+ float get_axis_value() const;
+
+ virtual bool is_pressed() const;
+ virtual bool action_match(const Ref<InputEvent> &p_event) const;
+
+ virtual bool is_action_type() const { return true; }
+
+ InputEventJoypadMotion();
};
-struct InputEventJoypadButton {
+class InputEventJoypadButton : public InputEvent {
+ GDCLASS(InputEventJoypadButton, InputEvent)
int button_index;
bool pressed;
float pressure; //0 to 1
-};
+protected:
+ static void _bind_methods();
+
+public:
+ void set_button_index(int p_index);
+ int get_button_index() const;
+
+ void set_pressed(bool p_pressed);
+ virtual bool is_pressed() const;
-struct InputEventScreenTouch {
+ void set_pressure(float p_pressure);
+ float get_pressure() const;
+ virtual bool action_match(const Ref<InputEvent> &p_event) const;
+
+ virtual bool is_action_type() const { return true; }
+
+ InputEventJoypadButton();
+};
+
+class InputEventScreenTouch : public InputEvent {
+ GDCLASS(InputEventScreenTouch, InputEvent)
int index;
- float x, y;
+ Vector2 pos;
bool pressed;
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_index(int p_index);
+ int get_index() const;
+
+ void set_position(const Vector2 &p_pos);
+ Vector2 get_position() const;
+
+ void set_pressed(bool p_pressed);
+ virtual bool is_pressed() const;
+
+ virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
+
+ InputEventScreenTouch();
};
-struct InputEventScreenDrag {
+class InputEventScreenDrag : public InputEvent {
+
+ GDCLASS(InputEventScreenDrag, InputEvent)
int index;
- float x, y;
- float relative_x, relative_y;
- float speed_x, speed_y;
+ Vector2 pos;
+ Vector2 relative;
+ Vector2 speed;
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_index(int p_index);
+ int get_index() const;
+
+ void set_position(const Vector2 &p_pos);
+ Vector2 get_position() const;
+
+ void set_relative(const Vector2 &p_relative);
+ Vector2 get_relative() const;
+
+ void set_speed(const Vector2 &p_speed);
+ Vector2 get_speed() const;
+
+ virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
+
+ InputEventScreenDrag();
};
-struct InputEventAction {
+class InputEventAction : public InputEvent {
+
+ GDCLASS(InputEventAction, InputEvent)
- int action;
+ StringName action;
bool pressed;
-};
-struct InputEvent {
-
- enum Type {
- NONE,
- KEY,
- MOUSE_MOTION,
- MOUSE_BUTTON,
- JOYPAD_MOTION,
- JOYPAD_BUTTON,
- SCREEN_TOUCH,
- SCREEN_DRAG,
- ACTION,
- TYPE_MAX
- };
+protected:
+ static void _bind_methods();
- uint32_t ID;
- int type;
- int device;
+public:
+ void set_action(const StringName &p_action);
+ StringName get_action() const;
- union {
- InputEventMouseMotion mouse_motion;
- InputEventMouseButton mouse_button;
- InputEventJoypadMotion joy_motion;
- InputEventJoypadButton joy_button;
- InputEventKey key;
- InputEventScreenTouch screen_touch;
- InputEventScreenDrag screen_drag;
- InputEventAction action;
- };
+ void set_pressed(bool p_pressed);
+ virtual bool is_pressed() const;
+
+ virtual bool is_action(const StringName &p_action) const;
+
+ virtual bool is_action_type() const { return true; }
- bool is_pressed() const;
- bool is_action(const String &p_action) const;
- bool is_action_pressed(const String &p_action) const;
- bool is_action_released(const String &p_action) const;
- bool is_echo() const;
- void set_as_action(const String &p_action, bool p_pressed);
-
- InputEvent xform_by(const Transform2D &p_xform) const;
- bool operator==(const InputEvent &p_event) const;
- operator String() const;
- InputEvent() { zeromem(this, sizeof(InputEvent)); }
+ InputEventAction();
};
#endif
diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp
index a5f8bfa144..9b3e376ea6 100644
--- a/core/os/keyboard.cpp
+++ b/core/os/keyboard.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,8 +42,8 @@ static const _KeyCodeText _keycodes[] = {
{KEY_TAB ,"Tab"},
{KEY_BACKTAB ,"BackTab"},
{KEY_BACKSPACE ,"BackSpace"},
- {KEY_RETURN ,"Return"},
{KEY_ENTER ,"Enter"},
+ {KEY_KP_ENTER ,"Kp Enter"},
{KEY_INSERT ,"Insert"},
{KEY_DELETE ,"Delete"},
{KEY_PAUSE ,"Pause"},
@@ -80,7 +81,6 @@ static const _KeyCodeText _keycodes[] = {
{KEY_F14 ,"F14"},
{KEY_F15 ,"F15"},
{KEY_F16 ,"F16"},
- {KEY_KP_ENTER ,"Kp Enter"},
{KEY_KP_MULTIPLY ,"Kp Multiply"},
{KEY_KP_DIVIDE ,"Kp Divide"},
{KEY_KP_SUBTRACT ,"Kp Subtract"},
@@ -294,8 +294,8 @@ bool keycode_has_unicode(uint32_t p_keycode) {
case KEY_TAB:
case KEY_BACKTAB:
case KEY_BACKSPACE:
- case KEY_RETURN:
case KEY_ENTER:
+ case KEY_KP_ENTER:
case KEY_INSERT:
case KEY_DELETE:
case KEY_PAUSE:
@@ -333,7 +333,6 @@ bool keycode_has_unicode(uint32_t p_keycode) {
case KEY_F14:
case KEY_F15:
case KEY_F16:
- case KEY_KP_ENTER:
case KEY_SUPER_L:
case KEY_SUPER_R:
case KEY_MENU:
diff --git a/core/os/keyboard.h b/core/os/keyboard.h
index 1f6bc77334..1ef26de183 100644
--- a/core/os/keyboard.h
+++ b/core/os/keyboard.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -56,8 +57,8 @@ enum KeyList {
KEY_TAB = SPKEY | 0x02,
KEY_BACKTAB = SPKEY | 0x03,
KEY_BACKSPACE = SPKEY | 0x04,
- KEY_RETURN = SPKEY | 0x05,
- KEY_ENTER = SPKEY | 0x06,
+ KEY_ENTER = SPKEY | 0x05,
+ KEY_KP_ENTER = SPKEY | 0x06,
KEY_INSERT = SPKEY | 0x07,
KEY_DELETE = SPKEY | 0x08,
KEY_PAUSE = SPKEY | 0x09,
@@ -95,7 +96,6 @@ enum KeyList {
KEY_F14 = SPKEY | 0x29,
KEY_F15 = SPKEY | 0x2A,
KEY_F16 = SPKEY | 0x2B,
- KEY_KP_ENTER = SPKEY | 0x80,
KEY_KP_MULTIPLY = SPKEY | 0x81,
KEY_KP_DIVIDE = SPKEY | 0x82,
KEY_KP_SUBTRACT = SPKEY | 0x83,
@@ -324,7 +324,7 @@ enum KeyModifierMask {
};
String keycode_get_string(uint32_t p_code);
-bool keycode_has_unicode(uint32_t p_unicode);
+bool keycode_has_unicode(uint32_t p_keycode);
int find_keycode(const String &p_code);
int keycode_get_count();
int keycode_get_value_by_index(int p_index);
diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp
index 644536d940..248f5537c6 100644
--- a/core/os/main_loop.cpp
+++ b/core/os/main_loop.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,7 +39,7 @@ void MainLoop::_bind_methods() {
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_event", PropertyInfo(Variant::OBJECT, "ev", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
BIND_VMETHOD(MethodInfo("_input_text", PropertyInfo(Variant::STRING, "text")));
BIND_VMETHOD(MethodInfo("_initialize"));
BIND_VMETHOD(MethodInfo("_iteration", PropertyInfo(Variant::REAL, "delta")));
@@ -72,7 +73,7 @@ void MainLoop::input_text(const String &p_text) {
get_script_instance()->call("_input_text", p_text);
}
-void MainLoop::input_event(const InputEvent &p_event) {
+void MainLoop::input_event(const Ref<InputEvent> &p_event) {
if (get_script_instance())
get_script_instance()->call("_input_event", p_event);
diff --git a/core/os/main_loop.h b/core/os/main_loop.h
index a33aeb9762..23b352468e 100644
--- a/core/os/main_loop.h
+++ b/core/os/main_loop.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -58,7 +59,7 @@ public:
NOTIFICATION_TRANSLATION_CHANGED = 10,
};
- virtual void input_event(const InputEvent &p_event);
+ virtual void input_event(const Ref<InputEvent> &p_event);
virtual void input_text(const String &p_text);
virtual void init();
diff --git a/core/os/memory.cpp b/core/os/memory.cpp
index b6866561fc..acc960acd9 100644
--- a/core/os/memory.cpp
+++ b/core/os/memory.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,6 +29,7 @@
/*************************************************************************/
#include "memory.h"
#include "copymem.h"
+#include "core/safe_refcount.h"
#include "error_macros.h"
#include <stdio.h>
#include <stdlib.h>
@@ -42,14 +44,12 @@ void *operator new(size_t p_size, void *(*p_allocfunc)(size_t p_size)) {
return p_allocfunc(p_size);
}
-#include <stdio.h>
-
#ifdef DEBUG_ENABLED
-size_t Memory::mem_usage = 0;
-size_t Memory::max_usage = 0;
+uint64_t Memory::mem_usage = 0;
+uint64_t Memory::max_usage = 0;
#endif
-size_t Memory::alloc_count = 0;
+uint64_t Memory::alloc_count = 0;
void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
@@ -61,10 +61,10 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
void *mem = malloc(p_bytes + (prepad ? PAD_ALIGN : 0));
- alloc_count++;
-
ERR_FAIL_COND_V(!mem, NULL);
+ atomic_increment(&alloc_count);
+
if (prepad) {
uint64_t *s = (uint64_t *)mem;
*s = p_bytes;
@@ -72,10 +72,8 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
uint8_t *s8 = (uint8_t *)mem;
#ifdef DEBUG_ENABLED
- mem_usage += p_bytes;
- if (mem_usage > max_usage) {
- max_usage = mem_usage;
- }
+ atomic_add(&mem_usage, p_bytes);
+ atomic_exchange_if_greater(&max_usage, mem_usage);
#endif
return s8 + PAD_ALIGN;
} else {
@@ -102,8 +100,12 @@ void *Memory::realloc_static(void *p_memory, size_t p_bytes, bool p_pad_align) {
uint64_t *s = (uint64_t *)mem;
#ifdef DEBUG_ENABLED
- mem_usage -= *s;
- mem_usage += p_bytes;
+ if (p_bytes > *s) {
+ atomic_add(&mem_usage, p_bytes - *s);
+ atomic_exchange_if_greater(&max_usage, mem_usage);
+ } else {
+ atomic_sub(&mem_usage, *s - p_bytes);
+ }
#endif
if (p_bytes == 0) {
@@ -143,14 +145,14 @@ void Memory::free_static(void *p_ptr, bool p_pad_align) {
bool prepad = p_pad_align;
#endif
- alloc_count--;
+ atomic_decrement(&alloc_count);
if (prepad) {
mem -= PAD_ALIGN;
uint64_t *s = (uint64_t *)mem;
#ifdef DEBUG_ENABLED
- mem_usage -= *s;
+ atomic_sub(&mem_usage, *s);
#endif
free(mem);
@@ -160,19 +162,20 @@ void Memory::free_static(void *p_ptr, bool p_pad_align) {
}
}
-size_t Memory::get_mem_available() {
+uint64_t Memory::get_mem_available() {
- return 0xFFFFFFFFFFFFF;
+ return -1; // 0xFFFF...
}
-size_t Memory::get_mem_usage() {
+uint64_t Memory::get_mem_usage() {
#ifdef DEBUG_ENABLED
return mem_usage;
#else
return 0;
#endif
}
-size_t Memory::get_mem_max_usage() {
+
+uint64_t Memory::get_mem_max_usage() {
#ifdef DEBUG_ENABLED
return max_usage;
#else
diff --git a/core/os/memory.h b/core/os/memory.h
index b788068f53..e1d7138ad5 100644
--- a/core/os/memory.h
+++ b/core/os/memory.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -44,20 +45,20 @@ class Memory {
Memory();
#ifdef DEBUG_ENABLED
- static size_t mem_usage;
- static size_t max_usage;
+ static uint64_t mem_usage;
+ static uint64_t max_usage;
#endif
- static size_t alloc_count;
+ static uint64_t alloc_count;
public:
static void *alloc_static(size_t p_bytes, bool p_pad_align = false);
static void *realloc_static(void *p_memory, size_t p_bytes, bool p_pad_align = false);
static void free_static(void *p_ptr, bool p_pad_align = false);
- static size_t get_mem_available();
- static size_t get_mem_usage();
- static size_t get_mem_max_usage();
+ static uint64_t get_mem_available();
+ static uint64_t get_mem_usage();
+ static uint64_t get_mem_max_usage();
};
class DefaultAllocator {
diff --git a/core/os/mutex.cpp b/core/os/mutex.cpp
index cdc18effdd..134d313bdf 100644
--- a/core/os/mutex.cpp
+++ b/core/os/mutex.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/mutex.h b/core/os/mutex.h
index 8ec4f573b7..80a30b0b26 100644
--- a/core/os/mutex.h
+++ b/core/os/mutex.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 03b48f4554..3a06a3fa8f 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,9 +30,9 @@
#include "os.h"
#include "dir_access.h"
-#include "global_config.h"
#include "input.h"
#include "os/file_access.h"
+#include "project_settings.h"
#include <stdarg.h>
@@ -128,7 +129,7 @@ String OS::get_executable_path() const {
return _execpath;
}
-int OS::get_process_ID() const {
+int OS::get_process_id() const {
return -1;
};
@@ -174,7 +175,7 @@ static void _OS_printres(Object *p_obj) {
if (!res)
return;
- String str = itos(res->get_instance_ID()) + String(res->get_class()) + ":" + String(res->get_name()) + " - " + res->get_path();
+ String str = itos(res->get_instance_id()) + String(res->get_class()) + ":" + String(res->get_name()) + " - " + res->get_path();
if (_OSPRF)
_OSPRF->store_line(str);
else
@@ -259,7 +260,7 @@ String OS::get_locale() const {
String OS::get_resource_dir() const {
- return GlobalConfig::get_singleton()->get_resource_path();
+ return ProjectSettings::get_singleton()->get_resource_path();
}
String OS::get_system_dir(SystemDir p_dir) const {
@@ -268,7 +269,7 @@ String OS::get_system_dir(SystemDir p_dir) const {
}
String OS::get_safe_application_name() const {
- String an = GlobalConfig::get_singleton()->get("application/name");
+ String an = ProjectSettings::get_singleton()->get("application/config/name");
Vector<String> invalid_char = String("\\ / : * ? \" < > |").split(" ");
for (int i = 0; i < invalid_char.size(); i++) {
an = an.replace(invalid_char[i], "-");
@@ -388,7 +389,7 @@ void OS::_ensure_data_dir() {
memdelete(da);
}
-void OS::set_icon(const Image &p_icon) {
+void OS::set_icon(const Ref<Image> &p_icon) {
}
String OS::get_model_name() const {
@@ -411,7 +412,7 @@ void OS::make_rendering_thread() {
void OS::swap_buffers() {
}
-String OS::get_unique_ID() const {
+String OS::get_unique_id() const {
ERR_FAIL_V("");
}
@@ -493,7 +494,31 @@ int OS::get_power_percent_left() {
return -1;
}
+bool OS::check_feature_support(const String &p_feature) {
+
+ if (p_feature == get_name())
+ return true;
+#ifdef DEBUG_ENABLED
+ if (p_feature == "debug")
+ return true;
+#else
+ if (p_feature == "release")
+ return true;
+#endif
+
+ if (_check_internal_feature_support(p_feature))
+ return true;
+
+ return false;
+}
+
+void *OS::get_stack_bottom() const {
+ return _stack_bottom;
+}
+
OS::OS() {
+ void *volatile stack_bottom;
+
last_error = NULL;
singleton = this;
_keep_screen_on = true; // set default value to true, because this had been true before godot 2.0.
@@ -506,7 +531,7 @@ OS::OS() {
_render_thread_mode = RENDER_THREAD_SAFE;
_allow_hidpi = true;
- Math::seed(1234567);
+ _stack_bottom = (void *)(&stack_bottom);
}
OS::~OS() {
diff --git a/core/os/os.h b/core/os/os.h
index 46e57e5186..4d64e4a9f0 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,6 +31,7 @@
#define OS_H
#include "engine.h"
+#include "image.h"
#include "list.h"
#include "os/main_loop.h"
#include "power.h"
@@ -58,7 +60,11 @@ class OS {
char *last_error;
+ void *_stack_bottom;
+
public:
+ typedef void (*ImeCallback)(void *p_inp, String p_text, Point2 p_selection);
+
enum RenderThreadMode {
RENDER_THREAD_UNSAFE,
@@ -107,6 +113,7 @@ protected:
virtual void set_cmdline(const char *p_execpath, const List<String> &p_args);
void _ensure_data_dir();
+ virtual bool _check_internal_feature_support(const String &p_feature) = 0;
public:
typedef int64_t ProcessID;
@@ -143,7 +150,7 @@ public:
virtual MouseMode get_mouse_mode() const;
virtual void warp_mouse_pos(const Point2 &p_to) {}
- virtual Point2 get_mouse_pos() const = 0;
+ virtual Point2 get_mouse_position() const = 0;
virtual int get_mouse_button_state() const = 0;
virtual void set_window_title(const String &p_title) = 0;
@@ -177,6 +184,13 @@ public:
virtual void set_borderless_window(int p_borderless) {}
virtual bool get_borderless_window() { return 0; }
+ virtual void set_ime_position(const Point2 &p_pos) {}
+ virtual void set_ime_intermediate_text_callback(ImeCallback p_callback, void *p_inp) {}
+
+ virtual Error open_dynamic_library(const String p_path, void *&p_library_handle) { return ERR_UNAVAILABLE; }
+ virtual Error close_dynamic_library(void *p_library_handle) { return ERR_UNAVAILABLE; }
+ virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false) { return ERR_UNAVAILABLE; }
+
virtual void set_keep_screen_on(bool p_enabled);
virtual bool is_keep_screen_on() const;
virtual void set_low_processor_usage_mode(bool p_enabled);
@@ -186,7 +200,7 @@ public:
virtual String get_executable_path() const;
virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL) = 0;
virtual Error kill(const ProcessID &p_pid) = 0;
- virtual int get_process_ID() const;
+ virtual int get_process_id() const;
virtual Error shell_open(String p_uri);
virtual Error set_cwd(const String &p_cwd);
@@ -352,14 +366,14 @@ public:
virtual void make_rendering_thread();
virtual void swap_buffers();
- virtual void set_icon(const Image &p_icon);
+ virtual void set_icon(const Ref<Image> &p_icon);
virtual int get_exit_code() const;
virtual void set_exit_code(int p_code);
virtual int get_processor_count() const;
- virtual String get_unique_ID() const;
+ virtual String get_unique_id() const;
virtual Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track);
virtual bool native_video_is_playing() const;
@@ -400,11 +414,20 @@ public:
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
- virtual bool check_feature_support(const String &p_feature) = 0;
+ bool check_feature_support(const String &p_feature);
+
+ /**
+ * Returns the stack bottom of the main thread of the application.
+ * This may be of use when integrating languages with garbage collectors that
+ * need to check whether a pointer is on the stack.
+ */
+ virtual void *get_stack_bottom() const;
bool is_hidpi_allowed() const { return _allow_hidpi; }
OS();
virtual ~OS();
};
+VARIANT_ENUM_CAST(PowerState);
+
#endif
diff --git a/core/os/power.h b/core/os/power.h
index 9e70e82f5d..dbf4c75c59 100644
--- a/core/os/power.h
+++ b/core/os/power.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/rw_lock.cpp b/core/os/rw_lock.cpp
index 83f8a9ffde..0427374de4 100644
--- a/core/os/rw_lock.cpp
+++ b/core/os/rw_lock.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/rw_lock.h b/core/os/rw_lock.h
index 6d3079df51..253bd260ee 100644
--- a/core/os/rw_lock.h
+++ b/core/os/rw_lock.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/semaphore.cpp b/core/os/semaphore.cpp
index 6bbae72f63..ce75186001 100644
--- a/core/os/semaphore.cpp
+++ b/core/os/semaphore.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/semaphore.h b/core/os/semaphore.h
index 8956fb7c39..f2be966979 100644
--- a/core/os/semaphore.h
+++ b/core/os/semaphore.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/shell.cpp b/core/os/shell.cpp
index 77726afd9d..9bf2d4466d 100644
--- a/core/os/shell.cpp
+++ b/core/os/shell.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/shell.h b/core/os/shell.h
index b2b0aa2260..33044ee10e 100644
--- a/core/os/shell.h
+++ b/core/os/shell.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/thread.cpp b/core/os/thread.cpp
index 1c6ccaa504..bd565334c3 100644
--- a/core/os/thread.cpp
+++ b/core/os/thread.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,16 +30,16 @@
#include "thread.h"
Thread *(*Thread::create_func)(ThreadCreateCallback, void *, const Settings &) = NULL;
-Thread::ID (*Thread::get_thread_ID_func)() = NULL;
+Thread::ID (*Thread::get_thread_id_func)() = NULL;
void (*Thread::wait_to_finish_func)(Thread *) = NULL;
Error (*Thread::set_name_func)(const String &) = NULL;
Thread::ID Thread::_main_thread_id = 0;
-Thread::ID Thread::get_caller_ID() {
+Thread::ID Thread::get_caller_id() {
- if (get_thread_ID_func)
- return get_thread_ID_func();
+ if (get_thread_id_func)
+ return get_thread_id_func();
return 0;
}
diff --git a/core/os/thread.h b/core/os/thread.h
index 9e0ab93cb9..1103f67ff2 100644
--- a/core/os/thread.h
+++ b/core/os/thread.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -57,7 +58,7 @@ public:
protected:
static Thread *(*create_func)(ThreadCreateCallback p_callback, void *, const Settings &);
- static ID (*get_thread_ID_func)();
+ static ID (*get_thread_id_func)();
static void (*wait_to_finish_func)(Thread *);
static Error (*set_name_func)(const String &);
@@ -68,11 +69,11 @@ protected:
Thread();
public:
- virtual ID get_ID() const = 0;
+ virtual ID get_id() const = 0;
static Error set_name(const String &p_name);
- _FORCE_INLINE_ static ID get_main_ID() { return _main_thread_id; } ///< get the ID of the main thread
- static ID get_caller_ID(); ///< get the ID of the caller function ID
+ _FORCE_INLINE_ static ID get_main_id() { return _main_thread_id; } ///< get the ID of the main thread
+ static ID get_caller_id(); ///< get the ID of the caller function ID
static void wait_to_finish(Thread *p_thread); ///< waits until thread is finished, and deallocates it.
static Thread *create(ThreadCreateCallback p_callback, void *p_user, const Settings &p_settings = Settings()); ///< Static function to create a thread, will call p_callback
diff --git a/core/os/thread_dummy.cpp b/core/os/thread_dummy.cpp
index a17f7f09a8..88c111297d 100644
--- a/core/os/thread_dummy.cpp
+++ b/core/os/thread_dummy.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/thread_dummy.h b/core/os/thread_dummy.h
index 8d0ca0340d..64941a71f8 100644
--- a/core/os/thread_dummy.h
+++ b/core/os/thread_dummy.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,7 +39,7 @@ class ThreadDummy : public Thread {
static Thread *create(ThreadCreateCallback p_callback, void *p_user, const Settings &p_settings = Settings());
public:
- virtual ID get_ID() const { return 0; };
+ virtual ID get_id() const { return 0; };
static void make_default();
};
diff --git a/core/os/thread_safe.cpp b/core/os/thread_safe.cpp
index ebdf86733c..486e072985 100644
--- a/core/os/thread_safe.cpp
+++ b/core/os/thread_safe.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/os/thread_safe.h b/core/os/thread_safe.h
index a60773e8ed..0cecf33cc2 100644
--- a/core/os/thread_safe.h
+++ b/core/os/thread_safe.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/packed_data_container.cpp b/core/packed_data_container.cpp
index b2922a6173..eb4aeb758a 100644
--- a/core/packed_data_container.cpp
+++ b/core/packed_data_container.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -236,8 +237,6 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd
case Variant::RECT3:
case Variant::BASIS:
case Variant::TRANSFORM:
- case Variant::IMAGE:
- case Variant::INPUT_EVENT:
case Variant::POOL_BYTE_ARRAY:
case Variant::POOL_INT_ARRAY:
case Variant::POOL_REAL_ARRAY:
@@ -369,7 +368,7 @@ void PackedDataContainer::_bind_methods() {
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("pack", "value"), &PackedDataContainer::pack);
ClassDB::bind_method(D_METHOD("size"), &PackedDataContainer::size);
ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY, "__data__"), "_set_data", "_get_data");
diff --git a/core/packed_data_container.h b/core/packed_data_container.h
index b7ce505836..bab994fc94 100644
--- a/core/packed_data_container.h
+++ b/core/packed_data_container.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/pair.h b/core/pair.h
index faa3febfd4..d517339ddf 100644
--- a/core/pair.h
+++ b/core/pair.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,9 +37,9 @@ struct Pair {
S second;
Pair() {}
- Pair(F p_first, S p_second) {
- first = p_first;
- second = p_second;
+ Pair(F p_first, const S &p_second)
+ : first(p_first),
+ second(p_second) {
}
};
diff --git a/core/path_remap.cpp b/core/path_remap.cpp
index bd76790b85..c5961213e8 100644
--- a/core/path_remap.cpp
+++ b/core/path_remap.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/path_remap.h b/core/path_remap.h
index 966bb10ea5..95249c6334 100644
--- a/core/path_remap.h
+++ b/core/path_remap.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp
index df55a5f615..d563925f3b 100644
--- a/core/pool_allocator.cpp
+++ b/core/pool_allocator.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/pool_allocator.h b/core/pool_allocator.h
index 1dc6167ceb..f62e410e66 100644
--- a/core/pool_allocator.h
+++ b/core/pool_allocator.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/print_string.cpp b/core/print_string.cpp
index 1cb07802c5..4a4c8093ca 100644
--- a/core/print_string.cpp
+++ b/core/print_string.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/print_string.h b/core/print_string.h
index ddbe55f8ed..c4cd610856 100644
--- a/core/print_string.h
+++ b/core/print_string.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/global_config.cpp b/core/project_settings.cpp
index 9ee49180f1..4a1b35ea4a 100644
--- a/core/global_config.cpp
+++ b/core/project_settings.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,9 +27,10 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "global_config.h"
+#include "project_settings.h"
#include "bind/core_bind.h"
+#include "core_string_names.h"
#include "io/file_access_network.h"
#include "io/file_access_pack.h"
#include "io/marshalls.h"
@@ -37,22 +39,23 @@
#include "os/keyboard.h"
#include "os/os.h"
#include "variant_parser.h"
+#include <zlib.h>
#define FORMAT_VERSION 3
-GlobalConfig *GlobalConfig::singleton = NULL;
+ProjectSettings *ProjectSettings::singleton = NULL;
-GlobalConfig *GlobalConfig::get_singleton() {
+ProjectSettings *ProjectSettings::get_singleton() {
return singleton;
}
-String GlobalConfig::get_resource_path() const {
+String ProjectSettings::get_resource_path() const {
return resource_path;
};
-String GlobalConfig::localize_path(const String &p_path) const {
+String ProjectSettings::localize_path(const String &p_path) const {
if (resource_path == "")
return p_path; //not initialied yet
@@ -96,13 +99,13 @@ String GlobalConfig::localize_path(const String &p_path) const {
};
}
-void GlobalConfig::set_initial_value(const String &p_name, const Variant &p_value) {
+void ProjectSettings::set_initial_value(const String &p_name, const Variant &p_value) {
ERR_FAIL_COND(!props.has(p_name));
props[p_name].initial = p_value;
}
-String GlobalConfig::globalize_path(const String &p_path) const {
+String ProjectSettings::globalize_path(const String &p_path) const {
if (p_path.begins_with("res://")) {
@@ -116,58 +119,68 @@ String GlobalConfig::globalize_path(const String &p_path) const {
return p_path;
}
-bool GlobalConfig::_set(const StringName &p_name, const Variant &p_value) {
+bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
_THREAD_SAFE_METHOD_
if (p_value.get_type() == Variant::NIL)
props.erase(p_name);
else {
- if (props.has(p_name)) {
- if (!props[p_name].overrided)
- props[p_name].variant = p_value;
- if (props[p_name].order >= NO_ORDER_BASE && registering_order) {
- props[p_name].order = last_order++;
+ if (p_name == CoreStringNames::get_singleton()->_custom_features) {
+ Vector<String> custom_feature_array = p_value;
+ for (int i = 0; i < custom_feature_array.size(); i++) {
+
+ custom_features.insert(custom_feature_array[i]);
}
- } else {
- props[p_name] = VariantContainer(p_value, last_order++ + (registering_order ? 0 : NO_ORDER_BASE));
+ return true;
}
- }
-
- if (!disable_platform_override) {
-
- String s = String(p_name);
- int sl = s.find("/");
- int p = s.find(".");
- if (p != -1 && sl != -1 && p < sl) {
- Vector<String> ps = s.substr(0, sl).split(".");
- String prop = s.substr(sl, s.length() - sl);
- for (int i = 1; i < ps.size(); i++) {
-
- if (ps[i] == OS::get_singleton()->get_name()) {
+ if (!disable_feature_overrides) {
+ int dot = p_name.operator String().find(".");
+ if (dot != -1) {
+ Vector<String> s = p_name.operator String().split(".");
+
+ bool override_valid = false;
+ for (int i = 1; i < s.size(); i++) {
+ String feature = s[i].strip_edges();
+ if (OS::get_singleton()->check_feature_support(feature) || custom_features.has(feature)) {
+ override_valid = true;
+ break;
+ }
+ }
- String fullprop = ps[0] + prop;
+ if (override_valid) {
- set(fullprop, p_value);
- props[fullprop].overrided = true;
+ feature_overrides[s[0]] = p_name;
}
}
}
+
+ if (props.has(p_name)) {
+ if (!props[p_name].overrided)
+ props[p_name].variant = p_value;
+
+ } else {
+ props[p_name] = VariantContainer(p_value, last_order++);
+ }
}
return true;
}
-bool GlobalConfig::_get(const StringName &p_name, Variant &r_ret) const {
+bool ProjectSettings::_get(const StringName &p_name, Variant &r_ret) const {
_THREAD_SAFE_METHOD_
- if (!props.has(p_name)) {
- print_line("WARNING: not found: " + String(p_name));
+ StringName name = p_name;
+ if (!disable_feature_overrides && feature_overrides.has(name)) {
+ name = feature_overrides[name];
+ }
+ if (!props.has(name)) {
+ print_line("WARNING: not found: " + String(name));
return false;
}
- r_ret = props[p_name].variant;
+ r_ret = props[name].variant;
return true;
}
@@ -181,7 +194,7 @@ struct _VCSort {
bool operator<(const _VCSort &p_vcs) const { return order == p_vcs.order ? name < p_vcs.name : order < p_vcs.order; }
};
-void GlobalConfig::_get_property_list(List<PropertyInfo> *p_list) const {
+void ProjectSettings::_get_property_list(List<PropertyInfo> *p_list) const {
_THREAD_SAFE_METHOD_
@@ -208,8 +221,13 @@ void GlobalConfig::_get_property_list(List<PropertyInfo> *p_list) const {
for (Set<_VCSort>::Element *E = vclist.front(); E; E = E->next()) {
- if (custom_prop_info.has(E->get().name)) {
- PropertyInfo pi = custom_prop_info[E->get().name];
+ String prop_info_name = E->get().name;
+ int dot = prop_info_name.find(".");
+ if (dot != -1)
+ prop_info_name = prop_info_name.substr(0, dot);
+
+ if (custom_prop_info.has(prop_info_name)) {
+ PropertyInfo pi = custom_prop_info[prop_info_name];
pi.name = E->get().name;
pi.usage = E->get().flags;
p_list->push_back(pi);
@@ -218,7 +236,7 @@ void GlobalConfig::_get_property_list(List<PropertyInfo> *p_list) const {
}
}
-bool GlobalConfig::_load_resource_pack(const String &p_pack) {
+bool ProjectSettings::_load_resource_pack(const String &p_pack) {
if (PackedData::get_singleton()->is_disabled())
return false;
@@ -235,13 +253,13 @@ bool GlobalConfig::_load_resource_pack(const String &p_pack) {
return true;
}
-Error GlobalConfig::setup(const String &p_path, const String &p_main_pack) {
+Error ProjectSettings::setup(const String &p_path, const String &p_main_pack) {
//If looking for files in network, just use network!
if (FileAccessNetworkClient::get_singleton()) {
- if (_load_settings("res://godot.cfg") == OK || _load_settings_binary("res://godot.cfb") == OK) {
+ if (_load_settings("res://project.godot") == OK || _load_settings_binary("res://project.binary") == OK) {
_load_settings("res://override.cfg");
}
@@ -258,7 +276,7 @@ Error GlobalConfig::setup(const String &p_path, const String &p_main_pack) {
bool ok = _load_resource_pack(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) {
+ if (_load_settings("res://project.godot") == OK || _load_settings_binary("res://project.binary") == OK) {
//load override from location of the main pack
_load_settings(p_main_pack.get_base_dir().plus_file("override.cfg"));
}
@@ -271,7 +289,7 @@ Error GlobalConfig::setup(const String &p_path, const String &p_main_pack) {
if (_load_resource_pack(exec_path.get_basename() + ".pck")) {
- if (_load_settings("res://godot.cfg") == OK || _load_settings_binary("res://godot.cfb") == OK) {
+ if (_load_settings("res://project.godot") == OK || _load_settings_binary("res://project.binary") == OK) {
//load override from location of executable
_load_settings(exec_path.get_base_dir().plus_file("override.cfg"));
}
@@ -292,14 +310,14 @@ Error GlobalConfig::setup(const String &p_path, const String &p_main_pack) {
// 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) {
+ if (_load_settings("res://project.godot") == OK || _load_settings_binary("res://project.binary") == OK) {
_load_settings("res://override.cfg");
}
return OK;
}
- //Nothing was found, try to find a godot.cfg somewhere!
+ //Nothing was found, try to find a project.godot somewhere!
DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
ERR_FAIL_COND_V(!d, ERR_CANT_CREATE);
@@ -313,7 +331,7 @@ Error GlobalConfig::setup(const String &p_path, const String &p_main_pack) {
while (true) {
//try to load settings in ascending through dirs shape!
- if (_load_settings(current_dir + "/godot.cfg") == OK || _load_settings_binary(current_dir + "/godot.cfb") == OK) {
+ if (_load_settings(current_dir + "/project.godot") == OK || _load_settings_binary(current_dir + "/project.binary") == OK) {
_load_settings(current_dir + "/override.cfg");
candidate = current_dir;
@@ -340,19 +358,19 @@ Error GlobalConfig::setup(const String &p_path, const String &p_main_pack) {
return OK;
}
-bool GlobalConfig::has(String p_var) const {
+bool ProjectSettings::has(String p_var) const {
_THREAD_SAFE_METHOD_
return props.has(p_var);
}
-void GlobalConfig::set_registering_order(bool p_enable) {
+void ProjectSettings::set_registering_order(bool p_enable) {
registering_order = p_enable;
}
-Error GlobalConfig::_load_settings_binary(const String p_path) {
+Error ProjectSettings::_load_settings_binary(const String p_path) {
Error err;
FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err);
@@ -365,12 +383,10 @@ Error GlobalConfig::_load_settings_binary(const String p_path) {
if (hdr[0] != 'E' || hdr[1] != 'C' || hdr[2] != 'F' || hdr[3] != 'G') {
memdelete(f);
- ERR_EXPLAIN("Corrupted header in binary godot.cfb (not ECFG)");
+ ERR_EXPLAIN("Corrupted header in binary project.binary (not ECFG)");
ERR_FAIL_V(ERR_FILE_CORRUPT;)
}
- set_registering_order(false);
-
uint32_t count = f->get_32();
for (uint32_t i = 0; i < count; i++) {
@@ -394,11 +410,9 @@ Error GlobalConfig::_load_settings_binary(const String p_path) {
set(key, value);
}
- set_registering_order(true);
-
return OK;
}
-Error GlobalConfig::_load_settings(const String p_path) {
+Error ProjectSettings::_load_settings(const String p_path) {
Error err;
FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err);
@@ -429,7 +443,7 @@ Error GlobalConfig::_load_settings(const String p_path) {
memdelete(f);
return OK;
} else if (err != OK) {
- ERR_PRINTS("GlobalConfig::load - " + p_path + ":" + itos(lines) + " error: " + error_text);
+ ERR_PRINTS("ProjectSettings::load - " + p_path + ":" + itos(lines) + " error: " + error_text);
memdelete(f);
return err;
}
@@ -441,8 +455,10 @@ Error GlobalConfig::_load_settings(const String p_path) {
memdelete(f);
ERR_FAIL_COND_V(config_version > FORMAT_VERSION, ERR_FILE_CANT_OPEN);
}
+ } else {
+ // config_version is checked and dropped
+ set(section + "/" + assign, value);
}
- set(section + "/" + assign, value);
} else if (next_tag.name != String()) {
section = next_tag.name;
}
@@ -453,36 +469,44 @@ Error GlobalConfig::_load_settings(const String p_path) {
return OK;
}
-int GlobalConfig::get_order(const String &p_name) const {
+int ProjectSettings::get_order(const String &p_name) const {
ERR_FAIL_COND_V(!props.has(p_name), -1);
return props[p_name].order;
}
-void GlobalConfig::set_order(const String &p_name, int p_order) {
+void ProjectSettings::set_order(const String &p_name, int p_order) {
ERR_FAIL_COND(!props.has(p_name));
props[p_name].order = p_order;
}
-void GlobalConfig::clear(const String &p_name) {
+void ProjectSettings::set_builtin_order(const String &p_name) {
+
+ ERR_FAIL_COND(!props.has(p_name));
+ if (props[p_name].order >= NO_BUILTIN_ORDER_BASE) {
+ props[p_name].order = last_builtin_order++;
+ }
+}
+
+void ProjectSettings::clear(const String &p_name) {
ERR_FAIL_COND(!props.has(p_name));
props.erase(p_name);
}
-Error GlobalConfig::save() {
+Error ProjectSettings::save() {
- return save_custom(get_resource_path() + "/godot.cfg");
+ return save_custom(get_resource_path() + "/project.godot");
}
-Error GlobalConfig::_save_settings_binary(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom) {
+Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom, const String &p_custom_features) {
Error err;
FileAccess *file = FileAccess::open(p_file, FileAccess::WRITE, &err);
if (err != OK) {
- ERR_EXPLAIN("Coudln't save godot.cfb at " + p_file);
+ ERR_EXPLAIN("Couldn't save project.binary at " + p_file);
ERR_FAIL_COND_V(err, err)
}
@@ -499,7 +523,34 @@ Error GlobalConfig::_save_settings_binary(const String &p_file, const Map<String
}
}
- file->store_32(count); //store how many properties are saved
+ if (p_custom_features != String()) {
+ file->store_32(count + 1);
+ //store how many properties are saved, add one for custom featuers, which must always go first
+ String key = CoreStringNames::get_singleton()->_custom_features;
+ file->store_32(key.length());
+ file->store_string(key);
+
+ int len;
+ Error err = encode_variant(p_custom_features, NULL, len);
+ if (err != OK) {
+ memdelete(file);
+ ERR_FAIL_V(err);
+ }
+
+ Vector<uint8_t> buff;
+ buff.resize(len);
+
+ err = encode_variant(p_custom_features, &buff[0], len);
+ if (err != OK) {
+ memdelete(file);
+ ERR_FAIL_V(err);
+ }
+ file->store_32(len);
+ file->store_buffer(buff.ptr(), buff.size());
+
+ } else {
+ file->store_32(count); //store how many properties are saved
+ }
for (Map<String, List<String> >::Element *E = props.front(); E; E = E->next()) {
@@ -541,17 +592,29 @@ Error GlobalConfig::_save_settings_binary(const String &p_file, const Map<String
return OK;
}
-Error GlobalConfig::_save_settings_text(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom) {
+Error ProjectSettings::_save_settings_text(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom, const String &p_custom_features) {
Error err;
FileAccess *file = FileAccess::open(p_file, FileAccess::WRITE, &err);
if (err) {
- ERR_EXPLAIN("Coudln't save godot.cfg - " + p_file);
+ ERR_EXPLAIN("Couldn't save project.godot - " + p_file);
ERR_FAIL_COND_V(err, err)
}
+ file->store_line("; Engine configuration file.");
+ file->store_line("; It's best edited using the editor UI and not directly,");
+ file->store_line("; since the parameters that go here are not all obvious.");
+ file->store_line("; ");
+ file->store_line("; Format: ");
+ file->store_line("; [section] ; section goes between []");
+ file->store_line("; param=value ; assign values to parameters");
+ file->store_line("");
+
file->store_string("config_version=" + itos(FORMAT_VERSION) + "\n");
+ if (p_custom_features != String())
+ file->store_string("custom_features=\"" + p_custom_features + "\"\n");
+ file->store_string("\n");
for (Map<String, List<String> >::Element *E = props.front(); E; E = E->next()) {
@@ -583,56 +646,48 @@ Error GlobalConfig::_save_settings_text(const String &p_file, const Map<String,
return OK;
}
-Error GlobalConfig::_save_custom_bnd(const String &p_file) { // add other params as dictionary and array?
+Error ProjectSettings::_save_custom_bnd(const String &p_file) { // add other params as dictionary and array?
return save_custom(p_file);
};
-Error GlobalConfig::save_custom(const String &p_path, const CustomMap &p_custom, const Set<String> &p_ignore_masks) {
+Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_custom, const Vector<String> &p_custom_features, bool p_merge_with_current) {
ERR_FAIL_COND_V(p_path == "", ERR_INVALID_PARAMETER);
Set<_VCSort> vclist;
- for (Map<StringName, VariantContainer>::Element *G = props.front(); G; G = G->next()) {
+ if (p_merge_with_current) {
+ for (Map<StringName, VariantContainer>::Element *G = props.front(); G; G = G->next()) {
- const VariantContainer *v = &G->get();
+ const VariantContainer *v = &G->get();
- if (v->hide_from_editor)
- continue;
-
- if (p_custom.has(G->key()))
- continue;
+ if (v->hide_from_editor)
+ continue;
- bool discard = false;
+ if (p_custom.has(G->key()))
+ continue;
- for (const Set<String>::Element *E = p_ignore_masks.front(); E; E = E->next()) {
+ _VCSort vc;
+ vc.name = G->key(); //*k;
+ vc.order = v->order;
+ vc.type = v->variant.get_type();
+ vc.flags = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE;
+ if (v->variant == v->initial)
+ continue;
- if (String(G->key()).match(E->get())) {
- discard = true;
- break;
- }
+ vclist.insert(vc);
}
-
- if (discard)
- continue;
-
- _VCSort vc;
- vc.name = G->key(); //*k;
- vc.order = v->order;
- vc.type = v->variant.get_type();
- vc.flags = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE;
- if (v->variant == v->initial)
- continue;
-
- vclist.insert(vc);
}
for (const Map<String, Variant>::Element *E = p_custom.front(); E; E = E->next()) {
+ // Lookup global prop to store in the same order
+ Map<StringName, VariantContainer>::Element *global_prop = props.find(E->key());
+
_VCSort vc;
vc.name = E->key();
- vc.order = 0xFFFFFFF;
+ vc.order = global_prop ? global_prop->get().order : 0xFFFFFFF;
vc.type = E->get().get_type();
vc.flags = PROPERTY_USAGE_STORAGE;
vclist.insert(vc);
@@ -657,10 +712,20 @@ Error GlobalConfig::save_custom(const String &p_path, const CustomMap &p_custom,
props[category].push_back(name);
}
- if (p_path.ends_with(".cfg"))
- return _save_settings_text(p_path, props, p_custom);
- else if (p_path.ends_with(".cfb"))
- return _save_settings_binary(p_path, props, p_custom);
+ String custom_features;
+
+ for (int i = 0; i < p_custom_features.size(); i++) {
+ if (i > 0)
+ custom_features += ",";
+
+ String f = p_custom_features[i].strip_edges().replace("\"", "");
+ custom_features += f;
+ }
+
+ if (p_path.ends_with(".godot"))
+ return _save_settings_text(p_path, props, p_custom, custom_features);
+ else if (p_path.ends_with(".binary"))
+ return _save_settings_binary(p_path, props, p_custom, custom_features);
else {
ERR_EXPLAIN("Unknown config file format: " + p_path);
@@ -673,7 +738,7 @@ Error GlobalConfig::save_custom(const String &p_path, const CustomMap &p_custom,
Error err = file->open(dst_file,FileAccess::WRITE);
if (err) {
memdelete(file);
- ERR_EXPLAIN("Coudln't save godot.cfg");
+ ERR_EXPLAIN("Couldn't save project.godot");
ERR_FAIL_COND_V(err,err)
}
@@ -712,22 +777,25 @@ Error GlobalConfig::save_custom(const String &p_path, const CustomMap &p_custom,
Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default) {
- if (GlobalConfig::get_singleton()->has(p_var)) {
- GlobalConfig::get_singleton()->set_initial_value(p_var, p_default);
- return GlobalConfig::get_singleton()->get(p_var);
+ Variant ret;
+ if (ProjectSettings::get_singleton()->has(p_var)) {
+ ret = ProjectSettings::get_singleton()->get(p_var);
+ } else {
+ ProjectSettings::get_singleton()->set(p_var, p_default);
+ ret = p_default;
}
- GlobalConfig::get_singleton()->set(p_var, p_default);
- GlobalConfig::get_singleton()->set_initial_value(p_var, p_default);
- return p_default;
+ ProjectSettings::get_singleton()->set_initial_value(p_var, p_default);
+ ProjectSettings::get_singleton()->set_builtin_order(p_var);
+ return ret;
}
-void GlobalConfig::add_singleton(const Singleton &p_singleton) {
+void ProjectSettings::add_singleton(const Singleton &p_singleton) {
singletons.push_back(p_singleton);
singleton_ptrs[p_singleton.name] = p_singleton.ptr;
}
-Object *GlobalConfig::get_singleton_object(const String &p_name) const {
+Object *ProjectSettings::get_singleton_object(const String &p_name) const {
const Map<StringName, Object *>::Element *E = singleton_ptrs.find(p_name);
if (!E)
@@ -736,21 +804,21 @@ Object *GlobalConfig::get_singleton_object(const String &p_name) const {
return E->get();
};
-bool GlobalConfig::has_singleton(const String &p_name) const {
+bool ProjectSettings::has_singleton(const String &p_name) const {
return get_singleton_object(p_name) != NULL;
};
-void GlobalConfig::get_singletons(List<Singleton> *p_singletons) {
+void ProjectSettings::get_singletons(List<Singleton> *p_singletons) {
for (List<Singleton>::Element *E = singletons.front(); E; E = E->next())
p_singletons->push_back(E->get());
}
-Vector<String> GlobalConfig::get_optimizer_presets() const {
+Vector<String> ProjectSettings::get_optimizer_presets() const {
List<PropertyInfo> pi;
- GlobalConfig::get_singleton()->get_property_list(&pi);
+ ProjectSettings::get_singleton()->get_property_list(&pi);
Vector<String> names;
for (List<PropertyInfo>::Element *E = pi.front(); E; E = E->next()) {
@@ -765,7 +833,7 @@ Vector<String> GlobalConfig::get_optimizer_presets() const {
return names;
}
-void GlobalConfig::_add_property_info_bind(const Dictionary &p_info) {
+void ProjectSettings::_add_property_info_bind(const Dictionary &p_info) {
ERR_FAIL_COND(!p_info.has("name"));
ERR_FAIL_COND(!p_info.has("type"));
@@ -784,24 +852,24 @@ void GlobalConfig::_add_property_info_bind(const Dictionary &p_info) {
set_custom_property_info(pinfo.name, pinfo);
}
-void GlobalConfig::set_custom_property_info(const String &p_prop, const PropertyInfo &p_info) {
+void ProjectSettings::set_custom_property_info(const String &p_prop, const PropertyInfo &p_info) {
ERR_FAIL_COND(!props.has(p_prop));
custom_prop_info[p_prop] = p_info;
custom_prop_info[p_prop].name = p_prop;
}
-void GlobalConfig::set_disable_platform_override(bool p_disable) {
+void ProjectSettings::set_disable_feature_overrides(bool p_disable) {
- disable_platform_override = p_disable;
+ disable_feature_overrides = p_disable;
}
-bool GlobalConfig::is_using_datapack() const {
+bool ProjectSettings::is_using_datapack() const {
return using_datapack;
}
-bool GlobalConfig::property_can_revert(const String &p_name) {
+bool ProjectSettings::property_can_revert(const String &p_name) {
if (!props.has(p_name))
return false;
@@ -809,7 +877,7 @@ bool GlobalConfig::property_can_revert(const String &p_name) {
return props[p_name].initial != props[p_name].variant;
}
-Variant GlobalConfig::property_get_revert(const String &p_name) {
+Variant ProjectSettings::property_get_revert(const String &p_name) {
if (!props.has(p_name))
return Variant();
@@ -817,142 +885,171 @@ Variant GlobalConfig::property_get_revert(const String &p_name) {
return props[p_name].initial;
}
-void GlobalConfig::_bind_methods() {
-
- 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);
+void ProjectSettings::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("has", "name"), &ProjectSettings::has);
+ ClassDB::bind_method(D_METHOD("set_order", "name", "pos"), &ProjectSettings::set_order);
+ ClassDB::bind_method(D_METHOD("get_order", "name"), &ProjectSettings::get_order);
+ ClassDB::bind_method(D_METHOD("set_initial_value", "name", "value"), &ProjectSettings::set_initial_value);
+ ClassDB::bind_method(D_METHOD("add_property_info", "hint"), &ProjectSettings::_add_property_info_bind);
+ ClassDB::bind_method(D_METHOD("clear", "name"), &ProjectSettings::clear);
+ ClassDB::bind_method(D_METHOD("localize_path", "path"), &ProjectSettings::localize_path);
+ ClassDB::bind_method(D_METHOD("globalize_path", "path"), &ProjectSettings::globalize_path);
+ ClassDB::bind_method(D_METHOD("save"), &ProjectSettings::save);
+ ClassDB::bind_method(D_METHOD("has_singleton", "name"), &ProjectSettings::has_singleton);
+ ClassDB::bind_method(D_METHOD("get_singleton", "name"), &ProjectSettings::get_singleton_object);
+ ClassDB::bind_method(D_METHOD("load_resource_pack", "pack"), &ProjectSettings::_load_resource_pack);
+ ClassDB::bind_method(D_METHOD("property_can_revert", "name"), &ProjectSettings::property_can_revert);
+ ClassDB::bind_method(D_METHOD("property_get_revert", "name"), &ProjectSettings::property_get_revert);
+
+ ClassDB::bind_method(D_METHOD("save_custom", "file"), &ProjectSettings::_save_custom_bnd);
}
-GlobalConfig::GlobalConfig() {
+ProjectSettings::ProjectSettings() {
singleton = this;
- last_order = 0;
- disable_platform_override = false;
+ last_order = NO_BUILTIN_ORDER_BASE;
+ last_builtin_order = 0;
+ disable_feature_overrides = false;
registering_order = true;
Array va;
- InputEvent key;
- key.type = InputEvent::KEY;
- InputEvent joyb;
- joyb.type = InputEvent::JOYPAD_BUTTON;
-
- GLOBAL_DEF("application/name", "");
- GLOBAL_DEF("application/main_scene", "");
- custom_prop_info["application/main_scene"] = PropertyInfo(Variant::STRING, "application/main_scene", PROPERTY_HINT_FILE, "tscn,scn,xscn,xml,res");
- GLOBAL_DEF("application/disable_stdout", false);
- GLOBAL_DEF("application/disable_stderr", false);
- GLOBAL_DEF("application/use_shared_user_dir", true);
-
- key.key.scancode = KEY_RETURN;
+ Ref<InputEventKey> key;
+ Ref<InputEventJoypadButton> joyb;
+
+ GLOBAL_DEF("application/config/name", "");
+ GLOBAL_DEF("application/run/main_scene", "");
+ custom_prop_info["application/run/main_scene"] = PropertyInfo(Variant::STRING, "application/run/main_scene", PROPERTY_HINT_FILE, "tscn,scn,res");
+ GLOBAL_DEF("application/run/disable_stdout", false);
+ GLOBAL_DEF("application/run/disable_stderr", false);
+ GLOBAL_DEF("application/config/use_shared_user_dir", true);
+
+ key.instance();
+ key->set_scancode(KEY_ENTER);
va.push_back(key);
- key.key.scancode = KEY_ENTER;
+ key.instance();
+ key->set_scancode(KEY_KP_ENTER);
va.push_back(key);
- key.key.scancode = KEY_SPACE;
+ key.instance();
+ key->set_scancode(KEY_SPACE);
va.push_back(key);
- joyb.joy_button.button_index = JOY_BUTTON_0;
+ joyb.instance();
+ joyb->set_button_index(JOY_BUTTON_0);
va.push_back(joyb);
GLOBAL_DEF("input/ui_accept", va);
input_presets.push_back("input/ui_accept");
va = Array();
- key.key.scancode = KEY_SPACE;
+ key.instance();
+ key->set_scancode(KEY_SPACE);
va.push_back(key);
- joyb.joy_button.button_index = JOY_BUTTON_3;
+ joyb.instance();
+ joyb->set_button_index(JOY_BUTTON_3);
va.push_back(joyb);
GLOBAL_DEF("input/ui_select", va);
input_presets.push_back("input/ui_select");
va = Array();
- key.key.scancode = KEY_ESCAPE;
+ key.instance();
+ key->set_scancode(KEY_ESCAPE);
va.push_back(key);
- joyb.joy_button.button_index = JOY_BUTTON_1;
+ joyb.instance();
+ joyb->set_button_index(JOY_BUTTON_1);
va.push_back(joyb);
GLOBAL_DEF("input/ui_cancel", va);
input_presets.push_back("input/ui_cancel");
va = Array();
- key.key.scancode = KEY_TAB;
+ key.instance();
+ key->set_scancode(KEY_TAB);
va.push_back(key);
GLOBAL_DEF("input/ui_focus_next", va);
input_presets.push_back("input/ui_focus_next");
va = Array();
- key.key.scancode = KEY_TAB;
- key.key.mod.shift = true;
+ key.instance();
+ key->set_scancode(KEY_TAB);
+ key->set_shift(true);
va.push_back(key);
GLOBAL_DEF("input/ui_focus_prev", va);
input_presets.push_back("input/ui_focus_prev");
- key.key.mod.shift = false;
va = Array();
- key.key.scancode = KEY_LEFT;
+ key.instance();
+ key->set_scancode(KEY_LEFT);
va.push_back(key);
- joyb.joy_button.button_index = JOY_DPAD_LEFT;
+ joyb.instance();
+ joyb->set_button_index(JOY_DPAD_LEFT);
va.push_back(joyb);
GLOBAL_DEF("input/ui_left", va);
input_presets.push_back("input/ui_left");
va = Array();
- key.key.scancode = KEY_RIGHT;
+ key.instance();
+ key->set_scancode(KEY_RIGHT);
va.push_back(key);
- joyb.joy_button.button_index = JOY_DPAD_RIGHT;
+ joyb.instance();
+ joyb->set_button_index(JOY_DPAD_RIGHT);
va.push_back(joyb);
GLOBAL_DEF("input/ui_right", va);
input_presets.push_back("input/ui_right");
va = Array();
- key.key.scancode = KEY_UP;
+ key.instance();
+ key->set_scancode(KEY_UP);
va.push_back(key);
- joyb.joy_button.button_index = JOY_DPAD_UP;
+ joyb.instance();
+ joyb->set_button_index(JOY_DPAD_UP);
va.push_back(joyb);
GLOBAL_DEF("input/ui_up", va);
input_presets.push_back("input/ui_up");
va = Array();
- key.key.scancode = KEY_DOWN;
+ key.instance();
+ key->set_scancode(KEY_DOWN);
va.push_back(key);
- joyb.joy_button.button_index = JOY_DPAD_DOWN;
+ joyb.instance();
+ joyb->set_button_index(JOY_DPAD_DOWN);
va.push_back(joyb);
GLOBAL_DEF("input/ui_down", va);
input_presets.push_back("input/ui_down");
va = Array();
- key.key.scancode = KEY_PAGEUP;
+ key.instance();
+ key->set_scancode(KEY_PAGEUP);
va.push_back(key);
GLOBAL_DEF("input/ui_page_up", va);
input_presets.push_back("input/ui_page_up");
va = Array();
- key.key.scancode = KEY_PAGEDOWN;
+ key.instance();
+ key->set_scancode(KEY_PAGEDOWN);
va.push_back(key);
GLOBAL_DEF("input/ui_page_down", va);
input_presets.push_back("input/ui_page_down");
- //GLOBAL_DEF("display/handheld/orientation", "landscape");
+ //GLOBAL_DEF("display/window/handheld/orientation", "landscape");
- custom_prop_info["display/handheld/orientation"] = PropertyInfo(Variant::STRING, "display/handheld/orientation", PROPERTY_HINT_ENUM, "landscape,portrait,reverse_landscape,reverse_portrait,sensor_landscape,sensor_portrait,sensor");
+ custom_prop_info["display/window/handheld/orientation"] = PropertyInfo(Variant::STRING, "display/window/handheld/orientation", PROPERTY_HINT_ENUM, "landscape,portrait,reverse_landscape,reverse_portrait,sensor_landscape,sensor_portrait,sensor");
custom_prop_info["rendering/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/threads/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded");
custom_prop_info["physics/2d/thread_model"] = PropertyInfo(Variant::INT, "physics/2d/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded");
+ custom_prop_info["rendering/quality/intended_usage/framebuffer_allocation"] = PropertyInfo(Variant::INT, "rendering/quality/intended_usage/framebuffer_allocation", PROPERTY_HINT_ENUM, "2D,2D Without Sampling,3D,3D Without Effects");
+ GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_mode", 2);
+
+ GLOBAL_DEF("debug/settings/profiler/max_functions", 16384);
+
+ //assigning here, because using GLOBAL_GET on every block for compressing can be slow
+ Compression::zstd_level = GLOBAL_DEF("compression/formats/zstd/compression_level", 3);
+ custom_prop_info["compression/formats/zstd/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/zstd/compression_level", PROPERTY_HINT_RANGE, "1,22,1");
+ Compression::zlib_level = GLOBAL_DEF("compression/formats/zlib/compression_level", Z_DEFAULT_COMPRESSION);
+ custom_prop_info["compression/formats/zlib/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/zlib/compression_level", PROPERTY_HINT_RANGE, "-1,9,1");
+ Compression::gzip_level = GLOBAL_DEF("compression/formats/gzip/compression_level", Z_DEFAULT_COMPRESSION);
+ custom_prop_info["compression/formats/gzip/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/gzip/compression_level", PROPERTY_HINT_RANGE, "-1,9,1");
- GLOBAL_DEF("debug/profiler/max_functions", 16384);
using_datapack = false;
}
-GlobalConfig::~GlobalConfig() {
+ProjectSettings::~ProjectSettings() {
singleton = NULL;
}
diff --git a/core/global_config.h b/core/project_settings.h
index 7bdf356129..cee3b3b5f3 100644
--- a/core/global_config.h
+++ b/core/project_settings.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,9 +37,9 @@
@author Juan Linietsky <reduzio@gmail.com>
*/
-class GlobalConfig : public Object {
+class ProjectSettings : public Object {
- GDCLASS(GlobalConfig, Object);
+ GDCLASS(ProjectSettings, Object);
_THREAD_SAFE_CLASS_
public:
@@ -47,17 +48,17 @@ public:
struct Singleton {
StringName name;
Object *ptr;
- Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL) {
- name = p_name;
- ptr = p_ptr;
+ Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL)
+ : name(p_name),
+ ptr(p_ptr) {
}
};
-
-protected:
enum {
- NO_ORDER_BASE = 1 << 18
+ //properties that are not for built in values begin from this value, so builtin ones are displayed first
+ NO_BUILTIN_ORDER_BASE = 1 << 16
};
+protected:
struct VariantContainer {
int order;
bool persist;
@@ -65,41 +66,45 @@ protected:
Variant initial;
bool hide_from_editor;
bool overrided;
- VariantContainer() {
- order = 0;
- hide_from_editor = false;
- persist = false;
- overrided = false;
+ VariantContainer()
+ : order(0),
+ persist(false),
+ hide_from_editor(false),
+ overrided(false) {
}
- VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false) {
- variant = p_variant;
- order = p_order;
- hide_from_editor = false;
- persist = p_persist;
- overrided = false;
+ VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false)
+ : order(p_order),
+ persist(p_persist),
+ variant(p_variant),
+ hide_from_editor(false),
+ overrided(false) {
}
};
bool registering_order;
int last_order;
+ int last_builtin_order;
Map<StringName, VariantContainer> props;
String resource_path;
Map<StringName, PropertyInfo> custom_prop_info;
- bool disable_platform_override;
+ bool disable_feature_overrides;
bool using_datapack;
List<String> input_presets;
+ Set<String> custom_features;
+ Map<StringName, StringName> feature_overrides;
+
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;
- static GlobalConfig *singleton;
+ static ProjectSettings *singleton;
Error _load_settings(const String p_path);
Error _load_settings_binary(const String p_path);
- Error _save_settings_text(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom = CustomMap());
- Error _save_settings_binary(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom = CustomMap());
+ Error _save_settings_text(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String());
+ Error _save_settings_binary(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String());
List<Singleton> singletons;
Map<StringName, Object *> singleton_ptrs;
@@ -124,15 +129,16 @@ public:
String get_resource_path() const;
- static GlobalConfig *get_singleton();
+ static ProjectSettings *get_singleton();
void clear(const String &p_name);
int get_order(const String &p_name) const;
void set_order(const String &p_name, int p_order);
+ void set_builtin_order(const String &p_name);
Error setup(const String &p_path, const String &p_main_pack);
- Error save_custom(const String &p_path = "", const CustomMap &p_custom = CustomMap(), const Set<String> &p_ignore_masks = Set<String>());
+ Error save_custom(const String &p_path = "", const CustomMap &p_custom = CustomMap(), const Vector<String> &p_custom_features = Vector<String>(), bool p_merge_with_current = true);
Error save();
void set_custom_property_info(const String &p_prop, const PropertyInfo &p_info);
@@ -145,22 +151,22 @@ public:
List<String> get_input_presets() const { return input_presets; }
- void set_disable_platform_override(bool p_disable);
+ void set_disable_feature_overrides(bool p_disable);
Object *get_singleton_object(const String &p_name) const;
void register_global_defaults();
bool is_using_datapack() const;
- void set_registering_order(bool p_registering);
+ void set_registering_order(bool p_enable);
- GlobalConfig();
- ~GlobalConfig();
+ ProjectSettings();
+ ~ProjectSettings();
};
//not a macro any longer
Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default);
#define GLOBAL_DEF(m_var, m_value) _GLOBAL_DEF(m_var, m_value)
-#define GLOBAL_GET(m_var) GlobalConfig::get_singleton()->get(m_var)
+#define GLOBAL_GET(m_var) ProjectSettings::get_singleton()->get(m_var)
#endif
diff --git a/core/ref_ptr.cpp b/core/ref_ptr.cpp
index 867d0b9246..c2128fd45d 100644
--- a/core/ref_ptr.cpp
+++ b/core/ref_ptr.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/ref_ptr.h b/core/ref_ptr.h
index 04c7bb51ed..b76bbab7fa 100644
--- a/core/ref_ptr.h
+++ b/core/ref_ptr.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/reference.cpp b/core/reference.cpp
index 5285888f78..e9629ee7c0 100644
--- a/core/reference.cpp
+++ b/core/reference.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -73,7 +74,8 @@ bool Reference::unreference() {
bool die = refcount.unref();
if (get_script_instance()) {
- die = die && get_script_instance()->refcount_decremented();
+ bool script_ret = get_script_instance()->refcount_decremented();
+ die = die && script_ret;
}
return die;
@@ -106,12 +108,12 @@ Variant WeakRef::get_ref() const {
}
void WeakRef::set_obj(Object *p_object) {
- ref = p_object ? p_object->get_instance_ID() : 0;
+ ref = p_object ? p_object->get_instance_id() : 0;
}
void WeakRef::set_ref(const REF &p_ref) {
- ref = p_ref.is_valid() ? p_ref->get_instance_ID() : 0;
+ ref = p_ref.is_valid() ? p_ref->get_instance_id() : 0;
}
WeakRef::WeakRef() {
@@ -120,7 +122,7 @@ WeakRef::WeakRef() {
void WeakRef::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_ref:Object"), &WeakRef::get_ref);
+ ClassDB::bind_method(D_METHOD("get_ref"), &WeakRef::get_ref);
}
#if 0
diff --git a/core/reference.h b/core/reference.h
index af7071a198..7f48f8323e 100644
--- a/core/reference.h
+++ b/core/reference.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -329,7 +330,7 @@ struct PtrToArg<Ref<T> > {
_FORCE_INLINE_ static Ref<T> convert(const void *p_ptr) {
- return Ref<T>(reinterpret_cast<const T *>(p_ptr));
+ return Ref<T>(const_cast<T *>(reinterpret_cast<const T *>(p_ptr)));
}
_FORCE_INLINE_ static void encode(Ref<T> p_val, const void *p_ptr) {
@@ -343,7 +344,7 @@ struct PtrToArg<const Ref<T> &> {
_FORCE_INLINE_ static Ref<T> convert(const void *p_ptr) {
- return Ref<T>(reinterpret_cast<const T *>(p_ptr));
+ return Ref<T>((T *)p_ptr);
}
};
@@ -354,7 +355,7 @@ struct PtrToArg<RefPtr> {
_FORCE_INLINE_ static RefPtr convert(const void *p_ptr) {
- return Ref<Reference>(reinterpret_cast<const Reference *>(p_ptr)).get_ref_ptr();
+ return Ref<Reference>(const_cast<Reference *>(reinterpret_cast<const Reference *>(p_ptr))).get_ref_ptr();
}
_FORCE_INLINE_ static void encode(RefPtr p_val, const void *p_ptr) {
@@ -369,7 +370,25 @@ struct PtrToArg<const RefPtr &> {
_FORCE_INLINE_ static RefPtr convert(const void *p_ptr) {
- return Ref<Reference>(reinterpret_cast<const Reference *>(p_ptr)).get_ref_ptr();
+ return Ref<Reference>(const_cast<Reference *>(reinterpret_cast<const Reference *>(p_ptr))).get_ref_ptr();
+ }
+};
+
+template <class T>
+struct GetTypeInfo<Ref<T> > {
+ enum { VARIANT_TYPE = Variant::OBJECT };
+
+ static inline StringName get_class_name() {
+ return T::get_class_static();
+ }
+};
+
+template <class T>
+struct GetTypeInfo<const Ref<T> &> {
+ enum { VARIANT_TYPE = Variant::OBJECT };
+
+ static inline StringName get_class_name() {
+ return T::get_class_static();
}
};
diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp
index 7ebacb5b5d..43f781af55 100644
--- a/core/register_core_types.cpp
+++ b/core/register_core_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,7 +36,6 @@
#include "core_string_names.h"
#include "func_ref.h"
#include "geometry.h"
-#include "global_config.h"
#include "input_map.h"
#include "io/config_file.h"
#include "io/http_client.h"
@@ -53,6 +53,7 @@
#include "os/main_loop.h"
#include "packed_data_container.h"
#include "path_remap.h"
+#include "project_settings.h"
#include "translation.h"
#include "undo_redo.h"
@@ -107,6 +108,20 @@ void register_core_types() {
ClassDB::register_class<Reference>();
ClassDB::register_class<WeakRef>();
ClassDB::register_class<Resource>();
+ ClassDB::register_class<Image>();
+
+ ClassDB::register_virtual_class<InputEvent>();
+ ClassDB::register_virtual_class<InputEventWithModifiers>();
+ ClassDB::register_class<InputEventKey>();
+ ClassDB::register_virtual_class<InputEventMouse>();
+ ClassDB::register_class<InputEventMouseButton>();
+ ClassDB::register_class<InputEventMouseMotion>();
+ ClassDB::register_class<InputEventJoypadButton>();
+ ClassDB::register_class<InputEventJoypadMotion>();
+ ClassDB::register_class<InputEventScreenDrag>();
+ ClassDB::register_class<InputEventScreenTouch>();
+ ClassDB::register_class<InputEventAction>();
+
ClassDB::register_class<FuncRef>();
ClassDB::register_virtual_class<StreamPeer>();
ClassDB::register_class<StreamPeerBuffer>();
@@ -157,23 +172,23 @@ void register_core_types() {
void register_core_settings() {
//since in register core types, globals may not e present
- GLOBAL_DEF("network/packets/packet_stream_peer_max_buffer_po2", (16));
+ GLOBAL_DEF("network/limits/packet_peer_stream/max_buffer_po2", (16));
}
void register_core_singletons() {
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("GlobalConfig", GlobalConfig::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("IP", IP::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("Geometry", _Geometry::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("ResourceLoader", _ResourceLoader::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("ResourceSaver", _ResourceSaver::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("OS", _OS::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("Engine", _Engine::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("ClassDB", _classdb));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("Marshalls", _Marshalls::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("TranslationServer", TranslationServer::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("Input", Input::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("InputMap", InputMap::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ProjectSettings", ProjectSettings::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("IP", IP::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Geometry", _Geometry::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ResourceLoader", _ResourceLoader::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ResourceSaver", _ResourceSaver::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("OS", _OS::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Engine", _Engine::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ClassDB", _classdb));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Marshalls", _Marshalls::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("TranslationServer", TranslationServer::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Input", Input::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("InputMap", InputMap::get_singleton()));
}
void unregister_core_types() {
diff --git a/core/register_core_types.h b/core/register_core_types.h
index c664d0ebf4..794c45dff0 100644
--- a/core/register_core_types.h
+++ b/core/register_core_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/resource.cpp b/core/resource.cpp
index e9ce4038d9..a0b0fd24e1 100644
--- a/core/resource.cpp
+++ b/core/resource.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,8 +32,8 @@
#include "core_string_names.h"
#include "io/resource_loader.h"
#include "os/file_access.h"
+#include "scene/main/node.h" //only so casting works
#include "script_language.h"
-
#include <stdio.h>
void Resource::emit_changed() {
@@ -126,7 +127,7 @@ void Resource::reload_from_file() {
if (!path.is_resource_file())
return;
- Ref<Resource> s = ResourceLoader::load(path, get_class(), true);
+ Ref<Resource> s = ResourceLoader::load(ResourceLoader::path_remap(path), get_class(), true);
if (!s.is_valid())
return;
@@ -184,7 +185,7 @@ Ref<Resource> Resource::duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Res
return Ref<Resource>(r);
}
-Ref<Resource> Resource::duplicate(bool p_subresources) {
+Ref<Resource> Resource::duplicate(bool p_subresources) const {
List<PropertyInfo> plist;
get_property_list(&plist);
@@ -227,12 +228,12 @@ RID Resource::get_rid() const {
void Resource::register_owner(Object *p_owner) {
- owners.insert(p_owner->get_instance_ID());
+ owners.insert(p_owner->get_instance_id());
}
void Resource::unregister_owner(Object *p_owner) {
- owners.erase(p_owner->get_instance_ID());
+ owners.erase(p_owner->get_instance_id());
}
void Resource::notify_change_to_owners() {
@@ -301,6 +302,31 @@ void Resource::setup_local_to_scene() {
Node *(*Resource::_get_local_scene_func)() = NULL;
+void Resource::set_as_translation_remapped(bool p_remapped) {
+
+ if (remapped_list.in_list() == p_remapped)
+ return;
+
+ if (ResourceCache::lock) {
+ ResourceCache::lock->write_lock();
+ }
+
+ if (p_remapped) {
+ ResourceLoader::remapped_list.add(&remapped_list);
+ } else {
+ ResourceLoader::remapped_list.remove(&remapped_list);
+ }
+
+ if (ResourceCache::lock) {
+ ResourceCache::lock->write_unlock();
+ }
+}
+
+bool Resource::is_translation_remapped() const {
+
+ return remapped_list.in_list();
+}
+
void Resource::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_path", "path"), &Resource::_set_path);
@@ -311,7 +337,7 @@ void Resource::_bind_methods() {
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("get_local_scene"), &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));
@@ -324,7 +350,8 @@ void Resource::_bind_methods() {
BIND_VMETHOD(MethodInfo("_setup_local_to_scene"));
}
-Resource::Resource() {
+Resource::Resource()
+ : remapped_list(this) {
#ifdef TOOLS_ENABLED
last_modified_time = 0;
diff --git a/core/resource.h b/core/resource.h
index 96a3a16fc5..bbf233d53e 100644
--- a/core/resource.h
+++ b/core/resource.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,6 +35,7 @@
#include "ref_ptr.h"
#include "reference.h"
#include "safe_refcount.h"
+#include "self_list.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
@@ -73,6 +75,8 @@ class Resource : public Reference {
friend class SceneState;
Node *local_scene;
+ SelfList<Resource> remapped_list;
+
protected:
void emit_changed();
@@ -102,8 +106,8 @@ public:
void set_subindex(int p_sub_index);
int get_subindex() const;
- Ref<Resource> duplicate(bool p_subresources = false);
- Ref<Resource> duplicate_for_local_scene(Node *p_scene, Map<Ref<Resource>, Ref<Resource> > &remap_cache);
+ virtual Ref<Resource> duplicate(bool p_subresources = false) const;
+ Ref<Resource> duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Resource>, Ref<Resource> > &remap_cache);
void set_local_to_scene(bool p_enable);
bool is_local_to_scene() const;
@@ -126,6 +130,9 @@ public:
#endif
+ void set_as_translation_remapped(bool p_remapped);
+ bool is_translation_remapped() const;
+
virtual RID get_rid() const; // some resources may offer conversion to RID
Resource();
@@ -136,6 +143,7 @@ typedef Ref<Resource> RES;
class ResourceCache {
friend class Resource;
+ friend class ResourceLoader; //need the lock
static RWLock *lock;
static HashMap<String, Resource *> resources;
friend void unregister_core_types();
diff --git a/core/rid.cpp b/core/rid.cpp
index 1c673f8ba2..ca1d2be421 100644
--- a/core/rid.cpp
+++ b/core/rid.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/rid.h b/core/rid.h
index 2711ac6598..a93d7d912e 100644
--- a/core/rid.h
+++ b/core/rid.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/ring_buffer.h b/core/ring_buffer.h
index 3c13cb8d1e..8b32bb5e10 100644
--- a/core/ring_buffer.h
+++ b/core/ring_buffer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -100,6 +101,32 @@ public:
return p_size;
};
+ int find(const T &t, int p_offset, int p_max_size) {
+
+ int left = data_left();
+ if ((p_offset + p_max_size) > left) {
+ p_max_size -= left - p_offset;
+ if (p_max_size <= 0)
+ return 0;
+ }
+ p_max_size = MIN(left, p_max_size);
+ int pos = read_pos;
+ inc(pos, p_offset);
+ int to_read = p_max_size;
+ while (to_read) {
+ int end = pos + to_read;
+ end = MIN(end, size());
+ int total = end - pos;
+ for (int i = 0; i < total; i++) {
+ if (data[pos + i] == t)
+ return i + (p_max_size - to_read);
+ };
+ to_read -= total;
+ pos = 0;
+ }
+ return -1;
+ }
+
inline int advance_read(int p_n) {
p_n = MIN(p_n, data_left());
inc(read_pos, p_n);
diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp
index cbd79a322f..971e9ad1d5 100644
--- a/core/safe_refcount.cpp
+++ b/core/safe_refcount.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,7 +33,10 @@
#ifdef NO_THREADS
-uint32_t atomic_conditional_increment(register uint32_t *pw) {
+/* Bogus implementation unaware of multiprocessing */
+
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_conditional_increment_impl(register T *pw) {
if (*pw == 0)
return 0;
@@ -42,53 +46,59 @@ uint32_t atomic_conditional_increment(register uint32_t *pw) {
return *pw;
}
-uint32_t atomic_increment(register uint32_t *pw) {
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_decrement_impl(register T *pw) {
- (*pw)++;
+ (*pw)--;
return *pw;
}
-uint32_t atomic_decrement(register uint32_t *pw) {
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_increment_impl(register T *pw) {
- (*pw)--;
+ (*pw)++;
return *pw;
}
-#else
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_sub_impl(register T *pw, register T val) {
-#ifdef _MSC_VER
+ (*pw) -= val;
-// don't pollute my namespace!
-#include <windows.h>
-uint32_t atomic_conditional_increment(register uint32_t *pw) {
+ return *pw;
+}
- /* try to increment until it actually works */
- // taken from boost
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_add_impl(register T *pw, register T val) {
- while (true) {
- uint32_t tmp = static_cast<uint32_t const volatile &>(*pw);
- if (tmp == 0)
- return 0; // if zero, can't add to it anymore
- if (InterlockedCompareExchange((LONG volatile *)pw, tmp + 1, tmp) == tmp)
- return tmp + 1;
- }
-}
+ (*pw) += val;
-uint32_t atomic_decrement(register uint32_t *pw) {
- return InterlockedDecrement((LONG volatile *)pw);
+ return *pw;
}
-uint32_t atomic_increment(register uint32_t *pw) {
- return InterlockedIncrement((LONG volatile *)pw);
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_exchange_if_greater_impl(register T *pw, register T val) {
+
+ if (val > *pw)
+ *pw = val;
+
+ return *pw;
}
+
#elif defined(__GNUC__)
-uint32_t atomic_conditional_increment(register uint32_t *pw) {
+/* Implementation for GCC & Clang */
+
+// GCC guarantees atomic intrinsics for sizes of 1, 2, 4 and 8 bytes.
+// Clang states it supports GCC atomic builtins.
+
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_conditional_increment_impl(register T *pw) {
while (true) {
- uint32_t tmp = static_cast<uint32_t const volatile &>(*pw);
+ T tmp = static_cast<T const volatile &>(*pw);
if (tmp == 0)
return 0; // if zero, can't add to it anymore
if (__sync_val_compare_and_swap(pw, tmp, tmp + 1) == tmp)
@@ -96,20 +106,182 @@ uint32_t atomic_conditional_increment(register uint32_t *pw) {
}
}
-uint32_t atomic_decrement(register uint32_t *pw) {
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_decrement_impl(register T *pw) {
return __sync_sub_and_fetch(pw, 1);
}
-uint32_t atomic_increment(register uint32_t *pw) {
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_increment_impl(register T *pw) {
return __sync_add_and_fetch(pw, 1);
}
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_sub_impl(register T *pw, register T val) {
+
+ return __sync_sub_and_fetch(pw, val);
+}
+
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_add_impl(register T *pw, register T val) {
+
+ return __sync_add_and_fetch(pw, val);
+}
+
+template <class T>
+static _ALWAYS_INLINE_ T _atomic_exchange_if_greater_impl(register T *pw, register T val) {
+
+ while (true) {
+ T tmp = static_cast<T const volatile &>(*pw);
+ if (tmp >= val)
+ return tmp; // already greater, or equal
+ if (__sync_val_compare_and_swap(pw, tmp, val) == tmp)
+ return val;
+ }
+}
+
+#elif defined(_MSC_VER)
+
+/* Implementation for MSVC-Windows */
+
+// don't pollute my namespace!
+#include <windows.h>
+
+#define ATOMIC_CONDITIONAL_INCREMENT_BODY(m_pw, m_win_type, m_win_cmpxchg, m_cpp_type) \
+ /* try to increment until it actually works */ \
+ /* taken from boost */ \
+ while (true) { \
+ m_cpp_type tmp = static_cast<m_cpp_type const volatile &>(*(m_pw)); \
+ if (tmp == 0) \
+ return 0; /* if zero, can't add to it anymore */ \
+ if (m_win_cmpxchg((m_win_type volatile *)(m_pw), tmp + 1, tmp) == tmp) \
+ return tmp + 1; \
+ }
+
+#define ATOMIC_EXCHANGE_IF_GREATER_BODY(m_pw, m_val, m_win_type, m_win_cmpxchg, m_cpp_type) \
+ while (true) { \
+ m_cpp_type tmp = static_cast<m_cpp_type const volatile &>(*(m_pw)); \
+ if (tmp >= m_val) \
+ return tmp; /* already greater, or equal */ \
+ if (m_win_cmpxchg((m_win_type volatile *)(m_pw), m_val, tmp) == tmp) \
+ return m_val; \
+ }
+
+static _ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(register uint32_t *pw) {
+
+ ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONG, InterlockedCompareExchange, uint32_t)
+}
+
+static _ALWAYS_INLINE_ uint32_t _atomic_decrement_impl(register uint32_t *pw) {
+
+ return InterlockedDecrement((LONG volatile *)pw);
+}
+
+static _ALWAYS_INLINE_ uint32_t _atomic_increment_impl(register uint32_t *pw) {
+
+ return InterlockedIncrement((LONG volatile *)pw);
+}
+
+static _ALWAYS_INLINE_ uint32_t _atomic_sub_impl(register uint32_t *pw, register uint32_t val) {
+
+ return InterlockedExchangeAdd((LONG volatile *)pw, -(int32_t)val) - val;
+}
+
+static _ALWAYS_INLINE_ uint32_t _atomic_add_impl(register uint32_t *pw, register uint32_t val) {
+
+ return InterlockedAdd((LONG volatile *)pw, val);
+}
+
+static _ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(register uint32_t *pw, register uint32_t val) {
+
+ ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONG, InterlockedCompareExchange, uint32_t)
+}
+
+static _ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(register uint64_t *pw) {
+
+ ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONGLONG, InterlockedCompareExchange64, uint64_t)
+}
+
+static _ALWAYS_INLINE_ uint64_t _atomic_decrement_impl(register uint64_t *pw) {
+
+ return InterlockedDecrement64((LONGLONG volatile *)pw);
+}
+
+static _ALWAYS_INLINE_ uint64_t _atomic_increment_impl(register uint64_t *pw) {
+
+ return InterlockedIncrement64((LONGLONG volatile *)pw);
+}
+
+static _ALWAYS_INLINE_ uint64_t _atomic_sub_impl(register uint64_t *pw, register uint64_t val) {
+
+ return InterlockedExchangeAdd64((LONGLONG volatile *)pw, -(int64_t)val) - val;
+}
+
+static _ALWAYS_INLINE_ uint64_t _atomic_add_impl(register uint64_t *pw, register uint64_t val) {
+
+ return InterlockedAdd64((LONGLONG volatile *)pw, val);
+}
+
+static _ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(register uint64_t *pw, register uint64_t val) {
+
+ ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONGLONG, InterlockedCompareExchange64, uint64_t)
+}
+
#else
+
//no threads supported?
#error Must provide atomic functions for this platform or compiler!
#endif
-#endif
+// The actual advertised functions; they'll call the right implementation
+
+uint32_t atomic_conditional_increment(register uint32_t *counter) {
+ return _atomic_conditional_increment_impl(counter);
+}
+
+uint32_t atomic_decrement(register uint32_t *pw) {
+ return _atomic_decrement_impl(pw);
+}
+
+uint32_t atomic_increment(register uint32_t *pw) {
+ return _atomic_increment_impl(pw);
+}
+
+uint32_t atomic_sub(register uint32_t *pw, register uint32_t val) {
+ return _atomic_sub_impl(pw, val);
+}
+
+uint32_t atomic_add(register uint32_t *pw, register uint32_t val) {
+ return _atomic_add_impl(pw, val);
+}
+
+uint32_t atomic_exchange_if_greater(register uint32_t *pw, register uint32_t val) {
+ return _atomic_exchange_if_greater_impl(pw, val);
+}
+
+uint64_t atomic_conditional_increment(register uint64_t *counter) {
+ return _atomic_conditional_increment_impl(counter);
+}
+
+uint64_t atomic_decrement(register uint64_t *pw) {
+ return _atomic_decrement_impl(pw);
+}
+
+uint64_t atomic_increment(register uint64_t *pw) {
+ return _atomic_increment_impl(pw);
+}
+
+uint64_t atomic_sub(register uint64_t *pw, register uint64_t val) {
+ return _atomic_sub_impl(pw, val);
+}
+
+uint64_t atomic_add(register uint64_t *pw, register uint64_t val) {
+ return _atomic_add_impl(pw, val);
+}
+
+uint64_t atomic_exchange_if_greater(register uint64_t *pw, register uint64_t val) {
+ return _atomic_exchange_if_greater_impl(pw, val);
+}
diff --git a/core/safe_refcount.h b/core/safe_refcount.h
index eeadeea8cf..ed0620c777 100644
--- a/core/safe_refcount.h
+++ b/core/safe_refcount.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,6 +39,16 @@
uint32_t atomic_conditional_increment(register uint32_t *counter);
uint32_t atomic_decrement(register uint32_t *pw);
uint32_t atomic_increment(register uint32_t *pw);
+uint32_t atomic_sub(register uint32_t *pw, register uint32_t val);
+uint32_t atomic_add(register uint32_t *pw, register uint32_t val);
+uint32_t atomic_exchange_if_greater(register uint32_t *pw, register uint32_t val);
+
+uint64_t atomic_conditional_increment(register uint64_t *counter);
+uint64_t atomic_decrement(register uint64_t *pw);
+uint64_t atomic_increment(register uint64_t *pw);
+uint64_t atomic_sub(register uint64_t *pw, register uint64_t val);
+uint64_t atomic_add(register uint64_t *pw, register uint64_t val);
+uint64_t atomic_exchange_if_greater(register uint64_t *pw, register uint64_t val);
struct SafeRefCount {
diff --git a/core/script_debugger_local.cpp b/core/script_debugger_local.cpp
index b5ed9773f0..d2ccf495ae 100644
--- a/core/script_debugger_local.cpp
+++ b/core/script_debugger_local.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/script_debugger_local.h b/core/script_debugger_local.h
index b3b323c7a6..d32edb503b 100644
--- a/core/script_debugger_local.h
+++ b/core/script_debugger_local.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp
index 35e7f03f0e..44e86bca6a 100644
--- a/core/script_debugger_remote.cpp
+++ b/core/script_debugger_remote.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,10 +29,10 @@
/*************************************************************************/
#include "script_debugger_remote.h"
-#include "global_config.h"
#include "io/ip.h"
#include "os/input.h"
#include "os/os.h"
+#include "project_settings.h"
void ScriptDebuggerRemote::_send_video_memory() {
@@ -73,7 +74,7 @@ Error ScriptDebuggerRemote::connect_to_host(const String &p_host, uint16_t p_por
} else {
OS::get_singleton()->delay_usec(1000000);
- print_line("Remote Debugger: Connection failed with status: " + String::num(tcp_client->get_status()) + "'', retrying in 1 sec.");
+ print_line("Remote Debugger: Connection failed with status: '" + String::num(tcp_client->get_status()) + "', retrying in 1 sec.");
};
};
@@ -94,7 +95,7 @@ static Object *_ScriptDebuggerRemote_find = NULL;
static void _ScriptDebuggerRemote_debug_func(Object *p_obj) {
if (_ScriptDebuggerRemote_find == p_obj) {
- _ScriptDebuggerRemote_found_id = p_obj->get_instance_ID();
+ _ScriptDebuggerRemote_found_id = p_obj->get_instance_id();
}
}
@@ -108,7 +109,7 @@ static ObjectID safe_get_instance_id(const Variant &p_v) {
REF r = p_v;
if (r.is_valid()) {
- return r->get_instance_ID();
+ return r->get_instance_id();
} else {
_ScriptDebuggerRemote_found_id = 0;
@@ -129,7 +130,7 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue)
ERR_FAIL();
}
- OS::get_singleton()->enable_for_stealing_focus(GlobalConfig::get_singleton()->get("editor_pid"));
+ OS::get_singleton()->enable_for_stealing_focus(ProjectSettings::get_singleton()->get("editor_pid"));
packet_peer_stream->put_var("debug_enter");
packet_peer_stream->put_var(2);
@@ -428,9 +429,9 @@ void ScriptDebuggerRemote::_err_handler(void *ud, const char *p_func, const char
sdr->mutex->unlock();
}
-bool ScriptDebuggerRemote::_parse_live_edit(const Array &cmd) {
+bool ScriptDebuggerRemote::_parse_live_edit(const Array &p_command) {
- String cmdstr = cmd[0];
+ String cmdstr = p_command[0];
if (!live_edit_funcs || !cmdstr.begins_with("live_"))
return false;
@@ -440,7 +441,7 @@ bool ScriptDebuggerRemote::_parse_live_edit(const Array &cmd) {
if (!live_edit_funcs->root_func)
return true;
//print_line("root: "+Variant(cmd).get_construct_string());
- live_edit_funcs->root_func(live_edit_funcs->udata, cmd[1], cmd[2]);
+ live_edit_funcs->root_func(live_edit_funcs->udata, p_command[1], p_command[2]);
} else if (cmdstr == "live_node_path") {
@@ -448,75 +449,75 @@ bool ScriptDebuggerRemote::_parse_live_edit(const Array &cmd) {
return true;
//print_line("path: "+Variant(cmd).get_construct_string());
- live_edit_funcs->node_path_func(live_edit_funcs->udata, cmd[1], cmd[2]);
+ live_edit_funcs->node_path_func(live_edit_funcs->udata, p_command[1], p_command[2]);
} else if (cmdstr == "live_res_path") {
if (!live_edit_funcs->res_path_func)
return true;
- live_edit_funcs->res_path_func(live_edit_funcs->udata, cmd[1], cmd[2]);
+ live_edit_funcs->res_path_func(live_edit_funcs->udata, p_command[1], p_command[2]);
} else if (cmdstr == "live_node_prop_res") {
if (!live_edit_funcs->node_set_res_func)
return true;
- live_edit_funcs->node_set_res_func(live_edit_funcs->udata, cmd[1], cmd[2], cmd[3]);
+ live_edit_funcs->node_set_res_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]);
} else if (cmdstr == "live_node_prop") {
if (!live_edit_funcs->node_set_func)
return true;
- live_edit_funcs->node_set_func(live_edit_funcs->udata, cmd[1], cmd[2], cmd[3]);
+ live_edit_funcs->node_set_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]);
} else if (cmdstr == "live_res_prop_res") {
if (!live_edit_funcs->res_set_res_func)
return true;
- live_edit_funcs->res_set_res_func(live_edit_funcs->udata, cmd[1], cmd[2], cmd[3]);
+ live_edit_funcs->res_set_res_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]);
} else if (cmdstr == "live_res_prop") {
if (!live_edit_funcs->res_set_func)
return true;
- live_edit_funcs->res_set_func(live_edit_funcs->udata, cmd[1], cmd[2], cmd[3]);
+ live_edit_funcs->res_set_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]);
} else if (cmdstr == "live_node_call") {
if (!live_edit_funcs->node_call_func)
return true;
- live_edit_funcs->node_call_func(live_edit_funcs->udata, cmd[1], cmd[2], cmd[3], cmd[4], cmd[5], cmd[6], cmd[7]);
+ live_edit_funcs->node_call_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3], p_command[4], p_command[5], p_command[6], p_command[7]);
} else if (cmdstr == "live_res_call") {
if (!live_edit_funcs->res_call_func)
return true;
- live_edit_funcs->res_call_func(live_edit_funcs->udata, cmd[1], cmd[2], cmd[3], cmd[4], cmd[5], cmd[6], cmd[7]);
+ live_edit_funcs->res_call_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3], p_command[4], p_command[5], p_command[6], p_command[7]);
} else if (cmdstr == "live_create_node") {
- live_edit_funcs->tree_create_node_func(live_edit_funcs->udata, cmd[1], cmd[2], cmd[3]);
+ live_edit_funcs->tree_create_node_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]);
} else if (cmdstr == "live_instance_node") {
- live_edit_funcs->tree_instance_node_func(live_edit_funcs->udata, cmd[1], cmd[2], cmd[3]);
+ live_edit_funcs->tree_instance_node_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]);
} else if (cmdstr == "live_remove_node") {
- live_edit_funcs->tree_remove_node_func(live_edit_funcs->udata, cmd[1]);
+ live_edit_funcs->tree_remove_node_func(live_edit_funcs->udata, p_command[1]);
} else if (cmdstr == "live_remove_and_keep_node") {
- live_edit_funcs->tree_remove_and_keep_node_func(live_edit_funcs->udata, cmd[1], cmd[2]);
+ live_edit_funcs->tree_remove_and_keep_node_func(live_edit_funcs->udata, p_command[1], p_command[2]);
} else if (cmdstr == "live_restore_node") {
- live_edit_funcs->tree_restore_node_func(live_edit_funcs->udata, cmd[1], cmd[2], cmd[3]);
+ live_edit_funcs->tree_restore_node_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]);
} else if (cmdstr == "live_duplicate_node") {
- live_edit_funcs->tree_duplicate_node_func(live_edit_funcs->udata, cmd[1], cmd[2]);
+ live_edit_funcs->tree_duplicate_node_func(live_edit_funcs->udata, p_command[1], p_command[2]);
} else if (cmdstr == "live_reparent_node") {
- live_edit_funcs->tree_reparent_node_func(live_edit_funcs->udata, cmd[1], cmd[2], cmd[3], cmd[4]);
+ live_edit_funcs->tree_reparent_node_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3], p_command[4]);
} else {
@@ -571,7 +572,7 @@ void ScriptDebuggerRemote::_send_object_id(ObjectID p_id) {
ObjectID id2;
Object *obj = var;
if (obj) {
- id2 = obj->get_instance_ID();
+ id2 = obj->get_instance_id();
} else {
id2 = 0;
}
@@ -585,9 +586,7 @@ void ScriptDebuggerRemote::_send_object_id(ObjectID p_id) {
packet_peer_stream->put_var(E->get().hint);
packet_peer_stream->put_var(E->get().hint_string);
//only send information that can be sent..
- if (var.get_type() == Variant::IMAGE) {
- var = Image();
- }
+
if (var.get_type() >= Variant::DICTIONARY) {
var = Array(); //send none for now, may be to big
}
@@ -941,38 +940,39 @@ void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p
ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL;
-ScriptDebuggerRemote::ScriptDebuggerRemote() {
+ScriptDebuggerRemote::ScriptDebuggerRemote()
+ : profiling(false),
+ max_frame_functions(16),
+ skip_profile_frame(false),
+ reload_all_scripts(false),
+ tcp_client(StreamPeerTCP::create_ref()),
+ packet_peer_stream(Ref<PacketPeerStream>(memnew(PacketPeerStream))),
+ last_perf_time(0),
+ performance(ProjectSettings::get_singleton()->get_singleton_object("Performance")),
+ requested_quit(false),
+ mutex(Mutex::create()),
+ max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")),
+ char_count(0),
+ last_msec(0),
+ msec_count(0),
+ locking(false),
+ poll_every(0),
+ request_scene_tree(NULL),
+ live_edit_funcs(NULL) {
- tcp_client = StreamPeerTCP::create_ref();
- packet_peer_stream = Ref<PacketPeerStream>(memnew(PacketPeerStream));
packet_peer_stream->set_stream_peer(tcp_client);
- mutex = Mutex::create();
- locking = false;
+ packet_peer_stream->set_output_buffer_max_size(1024 * 1024 * 8); //8mb should be way more than enough
phl.printfunc = _print_handler;
phl.userdata = this;
add_print_handler(&phl);
- requested_quit = false;
- performance = GlobalConfig::get_singleton()->get_singleton_object("Performance");
- last_perf_time = 0;
- poll_every = 0;
- request_scene_tree = NULL;
- live_edit_funcs = NULL;
- max_cps = GLOBAL_DEF("network/debug/max_remote_stdout_chars_per_second", 2048);
- char_count = 0;
- msec_count = 0;
- last_msec = 0;
- skip_profile_frame = false;
eh.errfunc = _err_handler;
eh.userdata = this;
add_error_handler(&eh);
- profile_info.resize(CLAMP(int(GlobalConfig::get_singleton()->get("debug/profiler/max_functions")), 128, 65535));
+ profile_info.resize(CLAMP(int(ProjectSettings::get_singleton()->get("debug/settings/profiler/max_functions")), 128, 65535));
profile_info_ptrs.resize(profile_info.size());
- profiling = false;
- max_frame_functions = 16;
- reload_all_scripts = false;
}
ScriptDebuggerRemote::~ScriptDebuggerRemote() {
diff --git a/core/script_debugger_remote.h b/core/script_debugger_remote.h
index 9bdf116495..924e3774a2 100644
--- a/core/script_debugger_remote.h
+++ b/core/script_debugger_remote.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/script_language.cpp b/core/script_language.cpp
index 2d565571a7..4664049145 100644
--- a/core/script_language.cpp
+++ b/core/script_language.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -65,11 +66,6 @@ bool ScriptServer::is_scripting_enabled() {
return scripting_enabled;
}
-int ScriptServer::get_language_count() {
-
- return _language_count;
-}
-
ScriptLanguage *ScriptServer::get_language(int p_idx) {
ERR_FAIL_INDEX_V(p_idx, _language_count, NULL);
@@ -103,6 +99,13 @@ void ScriptServer::init_languages() {
}
}
+void ScriptServer::finish_languages() {
+
+ for (int i = 0; i < _language_count; i++) {
+ _languages[i]->finish();
+ }
+}
+
void ScriptServer::set_reload_scripts_on_save(bool p_enable) {
reload_scripts_on_save = p_enable;
@@ -277,8 +280,23 @@ ScriptDebugger::ScriptDebugger() {
bool PlaceHolderScriptInstance::set(const StringName &p_name, const Variant &p_value) {
if (values.has(p_name)) {
+ Variant defval;
+ if (script->get_property_default_value(p_name, defval)) {
+ if (defval == p_value) {
+ values.erase(p_name);
+ return true;
+ }
+ }
values[p_name] = p_value;
return true;
+ } else {
+ Variant defval;
+ if (script->get_property_default_value(p_name, defval)) {
+ if (defval != p_value) {
+ values[p_name] = p_value;
+ }
+ return true;
+ }
}
return false;
}
@@ -288,12 +306,22 @@ bool PlaceHolderScriptInstance::get(const StringName &p_name, Variant &r_ret) co
r_ret = values[p_name];
return true;
}
+
+ Variant defval;
+ if (script->get_property_default_value(p_name, defval)) {
+ r_ret = defval;
+ return true;
+ }
return false;
}
void PlaceHolderScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const {
for (const List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
+ PropertyInfo pinfo = E->get();
+ if (!values.has(pinfo.name)) {
+ pinfo.usage |= PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE;
+ }
p_properties->push_back(E->get());
}
}
@@ -333,6 +361,14 @@ void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, c
if (!new_values.has(E->key()))
to_remove.push_back(E->key());
+
+ Variant defval;
+ if (script->get_property_default_value(E->key(), defval)) {
+ //remove because it's the same as the default value
+ if (defval == E->get()) {
+ to_remove.push_back(E->key());
+ }
+ }
}
while (to_remove.size()) {
@@ -348,11 +384,10 @@ void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, c
//change notify
}
-PlaceHolderScriptInstance::PlaceHolderScriptInstance(ScriptLanguage *p_language, Ref<Script> p_script, Object *p_owner) {
-
- language = p_language;
- script = p_script;
- owner = p_owner;
+PlaceHolderScriptInstance::PlaceHolderScriptInstance(ScriptLanguage *p_language, Ref<Script> p_script, Object *p_owner)
+ : owner(p_owner),
+ language(p_language),
+ script(p_script) {
}
PlaceHolderScriptInstance::~PlaceHolderScriptInstance() {
diff --git a/core/script_language.h b/core/script_language.h
index 6c37074639..7aba3ec0f1 100644
--- a/core/script_language.h
+++ b/core/script_language.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,7 +44,7 @@ typedef void (*ScriptEditRequestFunction)(const String &p_path);
class ScriptServer {
enum {
- MAX_LANGUAGES = 4
+ MAX_LANGUAGES = 16
};
static ScriptLanguage *_languages[MAX_LANGUAGES];
@@ -56,7 +57,7 @@ public:
static void set_scripting_enabled(bool p_enabled);
static bool is_scripting_enabled();
- static int get_language_count();
+ _FORCE_INLINE_ static int get_language_count() { return _language_count; }
static ScriptLanguage *get_language(int p_idx);
static void register_language(ScriptLanguage *p_language);
static void unregister_language(ScriptLanguage *p_language);
@@ -68,6 +69,7 @@ public:
static void thread_exit();
static void init_languages();
+ static void finish_languages();
};
class ScriptInstance;
@@ -118,7 +120,7 @@ public:
virtual void get_script_method_list(List<MethodInfo> *p_list) const = 0;
virtual void get_script_property_list(List<PropertyInfo> *p_list) const = 0;
- virtual int get_member_line(const StringName &p_member) const { return 0; }
+ virtual int get_member_line(const StringName &p_member) const { return -1; }
Script() {}
};
@@ -195,11 +197,15 @@ public:
virtual void get_comment_delimiters(List<String> *p_delimiters) const = 0;
virtual void get_string_delimiters(List<String> *p_delimiters) const = 0;
virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const = 0;
+ virtual void make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script) {}
+ virtual bool is_using_templates() { return false; }
virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List<String> *r_functions = NULL) const = 0;
virtual Script *create_script() const = 0;
virtual bool has_named_classes() const = 0;
+ virtual bool can_inherit_from_file() { return false; }
virtual int find_function(const String &p_function, const String &p_code) const = 0;
virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const = 0;
+ virtual Error open_in_external_editor(const Ref<Script> &p_script, int p_line, int p_col) { return ERR_UNAVAILABLE; }
virtual Error complete_code(const String &p_code, const String &p_base_path, Object *p_owner, List<String> *r_options, String &r_call_hint) { return ERR_UNAVAILABLE; }
@@ -269,6 +275,9 @@ public:
virtual int profiling_get_accumulated_data(ProfilingInfo *p_info_arr, int p_info_max) = 0;
virtual int profiling_get_frame_data(ProfilingInfo *p_info_arr, int p_info_max) = 0;
+ virtual void *alloc_instance_binding_data(Object *p_object) { return NULL; } //optional, not used by all languages
+ virtual void free_instance_binding_data(void *p_data) {} //optional, not used by all languages
+
virtual void frame();
virtual ~ScriptLanguage(){};
diff --git a/core/self_list.h b/core/self_list.h
index 45986d77e9..e229d5bf8e 100644
--- a/core/self_list.h
+++ b/core/self_list.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -50,6 +51,25 @@ public:
_first->_prev = p_elem;
_first = p_elem;
}
+ void add_last(SelfList<T> *p_elem) {
+
+ ERR_FAIL_COND(p_elem->_root);
+
+ if (!_first) {
+ add(p_elem);
+ return;
+ }
+
+ SelfList<T> *e = _first;
+
+ while (e->next()) {
+ e = e->next();
+ }
+
+ e->_next = p_elem;
+ p_elem->_prev = e->_next;
+ p_elem->_root = this;
+ }
void remove(SelfList<T> *p_elem) {
diff --git a/core/set.h b/core/set.h
index e6ec64e787..6e6f07508c 100644
--- a/core/set.h
+++ b/core/set.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/simple_type.h b/core/simple_type.h
index b5182559d7..6003bd393f 100644
--- a/core/simple_type.h
+++ b/core/simple_type.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/sort.h b/core/sort.h
index 8ec1cc6bd1..06c427f61e 100644
--- a/core/sort.h
+++ b/core/sort.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -45,7 +46,7 @@ class SortArray {
enum {
- INTROSORT_TRESHOLD = 16
+ INTROSORT_THRESHOLD = 16
};
public:
@@ -179,7 +180,7 @@ public:
inline void introsort(int p_first, int p_last, T *p_array, int p_max_depth) const {
- while (p_last - p_first > INTROSORT_TRESHOLD) {
+ while (p_last - p_first > INTROSORT_THRESHOLD) {
if (p_max_depth == 0) {
partial_sort(p_first, p_last, p_last, p_array);
@@ -272,9 +273,9 @@ public:
inline void final_insertion_sort(int p_first, int p_last, T *p_array) const {
- if (p_last - p_first > INTROSORT_TRESHOLD) {
- insertion_sort(p_first, p_first + INTROSORT_TRESHOLD, p_array);
- unguarded_insertion_sort(p_first + INTROSORT_TRESHOLD, p_last, p_array);
+ if (p_last - p_first > INTROSORT_THRESHOLD) {
+ insertion_sort(p_first, p_first + INTROSORT_THRESHOLD, p_array);
+ unguarded_insertion_sort(p_first + INTROSORT_THRESHOLD, p_last, p_array);
} else {
insertion_sort(p_first, p_last, p_array);
diff --git a/core/string_db.cpp b/core/string_db.cpp
index 54535fa06b..c61fbba9b5 100644
--- a/core/string_db.cpp
+++ b/core/string_db.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/string_db.h b/core/string_db.h
index b8f8d6f3dc..18af9fb3a7 100644
--- a/core/string_db.h
+++ b/core/string_db.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/translation.cpp b/core/translation.cpp
index 013f46f54f..c38d5d8b4d 100644
--- a/core/translation.cpp
+++ b/core/translation.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,9 +29,9 @@
/*************************************************************************/
#include "translation.h"
-#include "global_config.h"
#include "io/resource_loader.h"
#include "os/os.h"
+#include "project_settings.h"
static const char *locale_list[] = {
"aa", // Afar
@@ -869,6 +870,10 @@ void Translation::set_locale(const String &p_locale) {
} else {
locale = univ_locale;
}
+
+ if (OS::get_singleton()->get_main_loop()) {
+ OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_TRANSLATION_CHANGED);
+ }
}
void Translation::add_message(const StringName &p_src_text, const StringName &p_xlated_text) {
@@ -918,9 +923,8 @@ void Translation::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::STRING, "locale"), "set_locale", "get_locale");
}
-Translation::Translation() {
-
- locale = "en";
+Translation::Translation()
+ : locale("en") {
}
///////////////////////////////////////////////
@@ -944,6 +948,8 @@ void TranslationServer::set_locale(const String &p_locale) {
if (OS::get_singleton()->get_main_loop()) {
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_TRANSLATION_CHANGED);
}
+
+ ResourceLoader::reload_translation_remaps();
}
String TranslationServer::get_locale() const {
@@ -1046,8 +1052,8 @@ TranslationServer *TranslationServer::singleton = NULL;
bool TranslationServer::_load_translations(const String &p_from) {
- if (GlobalConfig::get_singleton()->has(p_from)) {
- PoolVector<String> translations = GlobalConfig::get_singleton()->get(p_from);
+ if (ProjectSettings::get_singleton()->has(p_from)) {
+ PoolVector<String> translations = ProjectSettings::get_singleton()->get(p_from);
int tcount = translations.size();
@@ -1084,11 +1090,11 @@ void TranslationServer::setup() {
int idx = 0;
while (locale_list[idx]) {
if (idx > 0)
- options += ", ";
+ options += ",";
options += locale_list[idx];
idx++;
}
- GlobalConfig::get_singleton()->set_custom_property_info("locale/fallback", PropertyInfo(Variant::STRING, "locale/fallback", PROPERTY_HINT_ENUM, options));
+ ProjectSettings::get_singleton()->set_custom_property_info("locale/fallback", PropertyInfo(Variant::STRING, "locale/fallback", PROPERTY_HINT_ENUM, options));
}
#endif
//load translations
@@ -1118,8 +1124,8 @@ void TranslationServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("translate", "message"), &TranslationServer::translate);
- 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(D_METHOD("add_translation", "translation"), &TranslationServer::add_translation);
+ ClassDB::bind_method(D_METHOD("remove_translation", "translation"), &TranslationServer::remove_translation);
ClassDB::bind_method(D_METHOD("clear"), &TranslationServer::clear);
}
@@ -1137,9 +1143,8 @@ void TranslationServer::load_translations() {
}
}
-TranslationServer::TranslationServer() {
-
+TranslationServer::TranslationServer()
+ : locale("en"),
+ enabled(true) {
singleton = this;
- locale = "en";
- enabled = true;
}
diff --git a/core/translation.h b/core/translation.h
index 90ec3fddce..8630b8a478 100644
--- a/core/translation.h
+++ b/core/translation.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,7 +36,7 @@ class Translation : public Resource {
GDCLASS(Translation, Resource);
OBJ_SAVE_TYPE(Translation);
- RES_BASE_EXTENSION("xl");
+ RES_BASE_EXTENSION("translation");
String locale;
Map<StringName, StringName> translation_map;
diff --git a/core/type_info.h b/core/type_info.h
new file mode 100644
index 0000000000..10912fd074
--- /dev/null
+++ b/core/type_info.h
@@ -0,0 +1,203 @@
+#ifndef GET_TYPE_INFO_H
+#define GET_TYPE_INFO_H
+
+template <bool C, typename T = void>
+struct EnableIf {
+
+ typedef T type;
+};
+
+template <typename T>
+struct EnableIf<false, T> {
+};
+
+template <typename, typename>
+struct TypesAreSame {
+
+ static bool const value = false;
+};
+
+template <typename A>
+struct TypesAreSame<A, A> {
+
+ static bool const value = true;
+};
+
+template <typename B, typename D>
+struct TypeInherits {
+
+ static D *get_d();
+
+ static char (&test(B *))[1];
+ static char (&test(...))[2];
+
+ static bool const value = sizeof(test(get_d())) == sizeof(char) &&
+ !TypesAreSame<B volatile const, void volatile const>::value;
+};
+
+template <class T, typename = void>
+struct GetTypeInfo {
+ enum { VARIANT_TYPE = Variant::NIL };
+
+ static inline StringName get_class_name() {
+ ERR_PRINT("Fallback type info. Bug!");
+ return ""; // Not "Nil", this is an error
+ }
+};
+
+#define MAKE_TYPE_INFO(m_type, m_var_type) \
+ template <> \
+ struct GetTypeInfo<m_type> { \
+ enum { VARIANT_TYPE = m_var_type }; \
+ static inline StringName get_class_name() { \
+ return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \
+ } \
+ }; \
+ template <> \
+ struct GetTypeInfo<const m_type &> { \
+ enum { VARIANT_TYPE = m_var_type }; \
+ static inline StringName get_class_name() { \
+ return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \
+ } \
+ };
+
+MAKE_TYPE_INFO(bool, Variant::BOOL)
+MAKE_TYPE_INFO(uint8_t, Variant::INT)
+MAKE_TYPE_INFO(int8_t, Variant::INT)
+MAKE_TYPE_INFO(uint16_t, Variant::INT)
+MAKE_TYPE_INFO(int16_t, Variant::INT)
+MAKE_TYPE_INFO(uint32_t, Variant::INT)
+MAKE_TYPE_INFO(int32_t, Variant::INT)
+MAKE_TYPE_INFO(int64_t, Variant::INT)
+MAKE_TYPE_INFO(uint64_t, Variant::INT)
+MAKE_TYPE_INFO(float, Variant::REAL)
+MAKE_TYPE_INFO(double, Variant::REAL)
+
+MAKE_TYPE_INFO(String, Variant::STRING)
+MAKE_TYPE_INFO(Vector2, Variant::VECTOR2)
+MAKE_TYPE_INFO(Rect2, Variant::RECT2)
+MAKE_TYPE_INFO(Vector3, Variant::VECTOR3)
+MAKE_TYPE_INFO(Transform2D, Variant::TRANSFORM2D)
+MAKE_TYPE_INFO(Plane, Variant::PLANE)
+MAKE_TYPE_INFO(Quat, Variant::QUAT)
+MAKE_TYPE_INFO(Rect3, Variant::RECT3)
+MAKE_TYPE_INFO(Basis, Variant::BASIS)
+MAKE_TYPE_INFO(Transform, Variant::TRANSFORM)
+MAKE_TYPE_INFO(Color, Variant::COLOR)
+MAKE_TYPE_INFO(NodePath, Variant::NODE_PATH)
+MAKE_TYPE_INFO(RID, Variant::_RID)
+MAKE_TYPE_INFO(Dictionary, Variant::DICTIONARY)
+MAKE_TYPE_INFO(Array, Variant::ARRAY)
+MAKE_TYPE_INFO(PoolByteArray, Variant::POOL_BYTE_ARRAY)
+MAKE_TYPE_INFO(PoolIntArray, Variant::POOL_INT_ARRAY)
+MAKE_TYPE_INFO(PoolRealArray, Variant::POOL_REAL_ARRAY)
+MAKE_TYPE_INFO(PoolStringArray, Variant::POOL_STRING_ARRAY)
+MAKE_TYPE_INFO(PoolVector2Array, Variant::POOL_VECTOR2_ARRAY)
+MAKE_TYPE_INFO(PoolVector3Array, Variant::POOL_VECTOR3_ARRAY)
+MAKE_TYPE_INFO(PoolColorArray, Variant::POOL_COLOR_ARRAY)
+
+MAKE_TYPE_INFO(StringName, Variant::STRING)
+MAKE_TYPE_INFO(IP_Address, Variant::STRING)
+
+class BSP_Tree;
+MAKE_TYPE_INFO(BSP_Tree, Variant::DICTIONARY)
+
+#define MAKE_TYPE_INFO_WITH_NAME(m_type, m_var_type, m_class_name) \
+ template <> \
+ struct GetTypeInfo<m_type> { \
+ enum { VARIANT_TYPE = m_var_type }; \
+ static inline StringName get_class_name() { \
+ return m_class_name; \
+ } \
+ }; \
+ template <> \
+ struct GetTypeInfo<const m_type &> { \
+ enum { VARIANT_TYPE = m_var_type }; \
+ static inline StringName get_class_name() { \
+ return m_class_name; \
+ } \
+ };
+
+MAKE_TYPE_INFO_WITH_NAME(RefPtr, Variant::OBJECT, "Reference")
+MAKE_TYPE_INFO_WITH_NAME(Variant, Variant::NIL, "Variant")
+
+#define MAKE_TEMPLATE_TYPE_INFO(m_template, m_type, m_var_type) \
+ template <> \
+ struct GetTypeInfo<m_template<m_type> > { \
+ enum { VARIANT_TYPE = m_var_type }; \
+ static inline StringName get_class_name() { \
+ return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \
+ } \
+ }; \
+ template <> \
+ struct GetTypeInfo<const m_template<m_type> &> { \
+ enum { VARIANT_TYPE = m_var_type }; \
+ static inline StringName get_class_name() { \
+ return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \
+ } \
+ };
+
+MAKE_TEMPLATE_TYPE_INFO(Vector, uint8_t, Variant::POOL_BYTE_ARRAY)
+MAKE_TEMPLATE_TYPE_INFO(Vector, int, Variant::POOL_INT_ARRAY)
+MAKE_TEMPLATE_TYPE_INFO(Vector, float, Variant::POOL_REAL_ARRAY)
+MAKE_TEMPLATE_TYPE_INFO(Vector, String, Variant::POOL_STRING_ARRAY)
+MAKE_TEMPLATE_TYPE_INFO(Vector, Vector2, Variant::POOL_VECTOR2_ARRAY)
+MAKE_TEMPLATE_TYPE_INFO(Vector, Vector3, Variant::POOL_VECTOR3_ARRAY)
+MAKE_TEMPLATE_TYPE_INFO(Vector, Color, Variant::POOL_COLOR_ARRAY)
+
+MAKE_TEMPLATE_TYPE_INFO(Vector, Variant, Variant::ARRAY)
+MAKE_TEMPLATE_TYPE_INFO(Vector, RID, Variant::ARRAY)
+MAKE_TEMPLATE_TYPE_INFO(Vector, Plane, Variant::ARRAY)
+
+MAKE_TEMPLATE_TYPE_INFO(PoolVector, Plane, Variant::ARRAY)
+MAKE_TEMPLATE_TYPE_INFO(PoolVector, Face3, Variant::POOL_VECTOR3_ARRAY)
+
+#define MAKE_ENUM_TYPE_INFO(m_enum) \
+ template <> \
+ struct GetTypeInfo<m_enum> { \
+ enum { VARIANT_TYPE = Variant::INT }; \
+ static inline StringName get_class_name() { \
+ return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \
+ } \
+ }; \
+ template <> \
+ struct GetTypeInfo<m_enum const> { \
+ enum { VARIANT_TYPE = Variant::INT }; \
+ static inline StringName get_class_name() { \
+ return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \
+ } \
+ }; \
+ template <> \
+ struct GetTypeInfo<m_enum &> { \
+ enum { VARIANT_TYPE = Variant::INT }; \
+ static inline StringName get_class_name() { \
+ return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \
+ } \
+ }; \
+ template <> \
+ struct GetTypeInfo<const m_enum &> { \
+ enum { VARIANT_TYPE = Variant::INT }; \
+ static inline StringName get_class_name() { \
+ return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \
+ } \
+ };
+
+template <typename T>
+struct GetTypeInfo<T *, typename EnableIf<TypeInherits<Object, T>::value>::type> {
+ enum { VARIANT_TYPE = Variant::OBJECT };
+
+ static inline StringName get_class_name() {
+ return T::get_class_static();
+ }
+};
+
+template <typename T>
+struct GetTypeInfo<const T *, typename EnableIf<TypeInherits<Object, T>::value>::type> {
+ enum { VARIANT_TYPE = Variant::OBJECT };
+
+ static inline StringName get_class_name() {
+ return T::get_class_static();
+ }
+};
+
+#endif // GET_TYPE_INFO_H
diff --git a/core/typedefs.h b/core/typedefs.h
index 469c9ebd95..40d9ea37b5 100644
--- a/core/typedefs.h
+++ b/core/typedefs.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,17 +42,6 @@
#define _MKSTR(m_x) _STR(m_x)
#endif
-/**
- * Version macros - it is necessary to include "version.h" for those to work.
- * Include it in the .cpp file, not the header.
- */
-#ifdef VERSION_PATCH
-#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." _MKSTR(VERSION_PATCH) "." _MKSTR(VERSION_STATUS) "." _MKSTR(VERSION_REVISION)
-#else
-#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." _MKSTR(VERSION_STATUS) "." _MKSTR(VERSION_REVISION)
-#endif // VERSION_PATCH
-#define VERSION_FULL_NAME "" _MKSTR(VERSION_NAME) " v" VERSION_MKSTRING
-
#ifndef _ALWAYS_INLINE_
#if defined(__GNUC__) && (__GNUC__ >= 4)
diff --git a/core/ucaps.h b/core/ucaps.h
index 0e4b5709e6..cd4a581a49 100644
--- a/core/ucaps.h
+++ b/core/ucaps.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp
index 76eee40b9c..19b9f161b7 100644
--- a/core/undo_redo.cpp
+++ b/core/undo_redo.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -109,7 +110,7 @@ void UndoRedo::add_do_method(Object *p_object, const String &p_method, VARIANT_A
ERR_FAIL_COND(action_level <= 0);
ERR_FAIL_COND((current_action + 1) >= actions.size());
Operation do_op;
- do_op.object = p_object->get_instance_ID();
+ do_op.object = p_object->get_instance_id();
if (p_object->cast_to<Resource>())
do_op.resref = Ref<Resource>(p_object->cast_to<Resource>());
@@ -133,7 +134,7 @@ void UndoRedo::add_undo_method(Object *p_object, const String &p_method, VARIANT
return;
Operation undo_op;
- undo_op.object = p_object->get_instance_ID();
+ undo_op.object = p_object->get_instance_id();
if (p_object->cast_to<Resource>())
undo_op.resref = Ref<Resource>(p_object->cast_to<Resource>());
@@ -150,7 +151,7 @@ void UndoRedo::add_do_property(Object *p_object, const String &p_property, const
ERR_FAIL_COND(action_level <= 0);
ERR_FAIL_COND((current_action + 1) >= actions.size());
Operation do_op;
- do_op.object = p_object->get_instance_ID();
+ do_op.object = p_object->get_instance_id();
if (p_object->cast_to<Resource>())
do_op.resref = Ref<Resource>(p_object->cast_to<Resource>());
@@ -169,7 +170,7 @@ void UndoRedo::add_undo_property(Object *p_object, const String &p_property, con
return;
Operation undo_op;
- undo_op.object = p_object->get_instance_ID();
+ undo_op.object = p_object->get_instance_id();
if (p_object->cast_to<Resource>())
undo_op.resref = Ref<Resource>(p_object->cast_to<Resource>());
@@ -183,7 +184,7 @@ void UndoRedo::add_do_reference(Object *p_object) {
ERR_FAIL_COND(action_level <= 0);
ERR_FAIL_COND((current_action + 1) >= actions.size());
Operation do_op;
- do_op.object = p_object->get_instance_ID();
+ do_op.object = p_object->get_instance_id();
if (p_object->cast_to<Resource>())
do_op.resref = Ref<Resource>(p_object->cast_to<Resource>());
@@ -200,7 +201,7 @@ void UndoRedo::add_undo_reference(Object *p_object) {
return;
Operation undo_op;
- undo_op.object = p_object->get_instance_ID();
+ undo_op.object = p_object->get_instance_id();
if (p_object->cast_to<Resource>())
undo_op.resref = Ref<Resource>(p_object->cast_to<Resource>());
@@ -495,8 +496,8 @@ void UndoRedo::_bind_methods() {
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "add_undo_method", &UndoRedo::_add_undo_method, mi);
}
- 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_property", "object", "property", "value"), &UndoRedo::add_do_property);
+ ClassDB::bind_method(D_METHOD("add_undo_property", "object", "property", "value"), &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);
diff --git a/core/undo_redo.h b/core/undo_redo.h
index 30601fa321..5b79f957da 100644
--- a/core/undo_redo.h
+++ b/core/undo_redo.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/ustring.cpp b/core/ustring.cpp
index db85db28ef..0521966943 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,14 +30,15 @@
#include "ustring.h"
#include "color.h"
-#include "io/md5.h"
-#include "io/sha256.h"
#include "math_funcs.h"
#include "os/memory.h"
#include "print_string.h"
#include "ucaps.h"
#include "variant.h"
+#include "thirdparty/misc/md5.h"
+#include "thirdparty/misc/sha256.h"
+
#include <wchar.h>
#ifndef NO_USE_STDLIB
@@ -51,6 +53,8 @@
#define MAX_DIGITS 6
#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))
+#define IS_DIGIT(m_d) ((m_d) >= '0' && (m_d) <= '9')
+#define IS_HEX_DIGIT(m_d) (((m_d) >= '0' && (m_d) <= '9') || ((m_d) >= 'a' && (m_d) <= 'f') || ((m_d) >= 'A' && (m_d) <= 'F'))
/** STRING **/
@@ -61,7 +65,7 @@ bool CharString::operator<(const CharString &p_right) const {
}
const char *this_str = get_data();
- const char *that_str = get_data();
+ const char *that_str = p_right.get_data();
while (true) {
if (*that_str == 0 && *this_str == 0)
@@ -92,6 +96,12 @@ const char *CharString::get_data() const {
void String::copy_from(const char *p_cstr) {
+ if (!p_cstr) {
+
+ resize(0);
+ return;
+ }
+
int len = 0;
const char *ptr = p_cstr;
while (*(ptr++) != 0)
@@ -115,6 +125,12 @@ void String::copy_from(const char *p_cstr) {
void String::copy_from(const CharType *p_cstr, int p_clip_to) {
+ if (!p_cstr) {
+
+ resize(0);
+ return;
+ }
+
int len = 0;
const CharType *ptr = p_cstr;
while (*(ptr++) != 0)
@@ -263,16 +279,16 @@ void String::operator=(const CharType *p_str) {
copy_from(p_str);
}
-bool String::operator==(const StrRange &p_range) const {
+bool String::operator==(const StrRange &p_str_range) const {
- int len = p_range.len;
+ int len = p_str_range.len;
if (length() != len)
return false;
if (empty())
return true;
- const CharType *c_str = p_range.c_str;
+ const CharType *c_str = p_str_range.c_str;
const CharType *dst = &operator[](0);
/* Compare char by char */
@@ -479,6 +495,68 @@ signed char String::casecmp_to(const String &p_str) const {
return 0; //should never reach anyway
}
+signed char String::naturalnocasecmp_to(const String &p_str) const {
+
+ const CharType *this_str = c_str();
+ const CharType *that_str = p_str.c_str();
+
+ if (this_str && that_str) {
+
+ while (*this_str == '.' || *that_str == '.') {
+ if (*this_str++ != '.')
+ return 1;
+ if (*that_str++ != '.')
+ return -1;
+ if (!*that_str)
+ return 1;
+ if (!*this_str)
+ return -1;
+ }
+
+ while (*this_str) {
+
+ if (!*that_str)
+ return 1;
+ else if (IS_DIGIT(*this_str)) {
+
+ int64_t this_int, that_int;
+
+ if (!IS_DIGIT(*that_str))
+ return -1;
+
+ /* Compare the numbers */
+ this_int = to_int(this_str);
+ that_int = to_int(that_str);
+
+ if (this_int < that_int)
+ return -1;
+ else if (this_int > that_int)
+ return 1;
+
+ /* Skip */
+ while (IS_DIGIT(*this_str))
+ this_str++;
+ while (IS_DIGIT(*that_str))
+ that_str++;
+ } else if (IS_DIGIT(*that_str))
+ return 1;
+ else {
+ if (_find_upper(*this_str) < _find_upper(*that_str)) //more than
+ return -1;
+ else if (_find_upper(*this_str) > _find_upper(*that_str)) //less than
+ return 1;
+
+ this_str++;
+ that_str++;
+ }
+ }
+ if (*that_str)
+ return -1;
+ }
+
+ return 0;
+}
+
void String::erase(int p_pos, int p_chars) {
*this = left(p_pos) + substr(p_pos + p_chars, length() - ((p_pos + p_chars)));
@@ -512,14 +590,16 @@ String String::camelcase_to_underscore(bool lowercase) const {
for (size_t i = 1; i < this->size(); i++) {
bool is_upper = cstr[i] >= A && cstr[i] <= Z;
+ bool is_number = cstr[i] >= '0' && cstr[i] <= '9';
bool are_next_2_lower = false;
bool was_precedent_upper = cstr[i - 1] >= A && cstr[i - 1] <= Z;
+ bool was_precedent_number = cstr[i - 1] >= '0' && cstr[i - 1] <= '9';
if (i + 2 < this->size()) {
are_next_2_lower = cstr[i + 1] >= a && cstr[i + 1] <= z && cstr[i + 2] >= a && cstr[i + 2] <= z;
}
- bool should_split = ((is_upper && !was_precedent_upper) || (was_precedent_upper && is_upper && are_next_2_lower));
+ bool should_split = ((is_upper && !was_precedent_upper && !was_precedent_number) || (was_precedent_upper && is_upper && are_next_2_lower) || (is_number && !was_precedent_number));
if (should_split) {
new_string += this->substr(start_index, i - start_index) + "_";
start_index = i;
@@ -1694,9 +1774,6 @@ bool String::is_numeric() const {
return true; // TODO: Use the parser below for this instead
};
-#define IS_DIGIT(m_d) ((m_d) >= '0' && (m_d) <= '9')
-#define IS_HEX_DIGIT(m_d) (((m_d) >= '0' && (m_d) <= '9') || ((m_d) >= 'a' && (m_d) <= 'f') || ((m_d) >= 'A' && (m_d) <= 'F'))
-
template <class C>
static double built_in_strtod(const C *string, /* A decimal ASCII floating-point number,
* optionally preceded by white space. Must
diff --git a/core/ustring.h b/core/ustring.h
index 6a69d8b147..1c61e12e85 100644
--- a/core/ustring.h
+++ b/core/ustring.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -77,7 +78,7 @@ public:
//String operator+(CharType p_char) const;
String &operator+=(const String &);
- String &operator+=(CharType p_str);
+ String &operator+=(CharType p_char);
String &operator+=(const char *p_str);
String &operator+=(const CharType *p_str);
@@ -97,6 +98,7 @@ public:
signed char casecmp_to(const String &p_str) const;
signed char nocasecmp_to(const String &p_str) const;
+ signed char naturalnocasecmp_to(const String &p_str) const;
const CharType *c_str() const;
/* standard size stuff */
@@ -154,7 +156,7 @@ public:
int get_slice_count(String p_splitter) const;
String get_slice(String p_splitter, int p_slice) const;
- String get_slicec(CharType splitter, int p_slice) const;
+ String get_slicec(CharType p_splitter, int p_slice) const;
Vector<String> split(const String &p_splitter, bool p_allow_empty = true) const;
Vector<String> split_spaces() const;
@@ -184,8 +186,8 @@ public:
bool parse_utf8(const char *p_utf8, int p_len = -1); //return true on error
static String utf8(const char *p_utf8, int p_len = -1);
- static uint32_t hash(const CharType *p_str, int p_len); /* hash the string */
- static uint32_t hash(const CharType *p_str); /* hash the string */
+ static uint32_t hash(const CharType *p_cstr, int p_len); /* hash the string */
+ static uint32_t hash(const CharType *p_cstr); /* hash the string */
static uint32_t hash(const char *p_cstr, int p_len); /* hash the string */
static uint32_t hash(const char *p_cstr); /* hash the string */
uint32_t hash() const; /* hash the string */
@@ -255,6 +257,14 @@ struct NoCaseComparator {
}
};
+struct NaturalNoCaseComparator {
+
+ bool operator()(const String &p_a, const String &p_b) const {
+
+ return p_a.naturalnocasecmp_to(p_b) < 0;
+ }
+};
+
/* end of namespace */
//tool translate
diff --git a/core/variant.cpp b/core/variant.cpp
index 6d98ba7306..51c4b70bdc 100644
--- a/core/variant.cpp
+++ b/core/variant.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -119,11 +120,6 @@ String Variant::get_type_name(Variant::Type p_type) {
return "Color";
} break;
- case IMAGE: {
-
- return "Image";
-
- } break;
case _RID: {
return "RID";
@@ -137,11 +133,6 @@ String Variant::get_type_name(Variant::Type p_type) {
return "NodePath";
} break;
- case INPUT_EVENT: {
-
- return "InputEvent";
-
- } break;
case DICTIONARY: {
return "Dictionary";
@@ -248,7 +239,6 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) {
static const Type invalid[] = {
OBJECT,
- IMAGE,
NIL
};
@@ -790,11 +780,6 @@ bool Variant::is_zero() const {
return *reinterpret_cast<const Color *>(_data._mem) == Color();
} break;
- case IMAGE: {
-
- return _data._image->empty();
-
- } break;
case _RID: {
return *reinterpret_cast<const RID *>(_data._mem) == RID();
@@ -808,11 +793,6 @@ bool Variant::is_zero() const {
return reinterpret_cast<const NodePath *>(_data._mem)->is_empty();
} break;
- case INPUT_EVENT: {
-
- return _data._input_event->type == InputEvent::NONE;
-
- } break;
case DICTIONARY: {
return reinterpret_cast<const Dictionary *>(_data._mem)->empty();
@@ -1015,11 +995,6 @@ void Variant::reference(const Variant &p_variant) {
memnew_placement(_data._mem, Color(*reinterpret_cast<const Color *>(p_variant._data._mem)));
} break;
- case IMAGE: {
-
- _data._image = memnew(Image(*p_variant._data._image));
-
- } break;
case _RID: {
memnew_placement(_data._mem, RID(*reinterpret_cast<const RID *>(p_variant._data._mem)));
@@ -1033,11 +1008,6 @@ void Variant::reference(const Variant &p_variant) {
memnew_placement(_data._mem, NodePath(*reinterpret_cast<const NodePath *>(p_variant._data._mem)));
} break;
- case INPUT_EVENT: {
-
- _data._input_event = memnew(InputEvent(*p_variant._data._input_event));
-
- } break;
case DICTIONARY: {
memnew_placement(_data._mem, Dictionary(*reinterpret_cast<const Dictionary *>(p_variant._data._mem)));
@@ -1140,11 +1110,6 @@ void Variant::clear() {
} break;
// misc types
- case IMAGE: {
-
- memdelete(_data._image);
-
- } break;
case NODE_PATH: {
reinterpret_cast<NodePath *>(_data._mem)->~NodePath();
@@ -1169,12 +1134,6 @@ void Variant::clear() {
reinterpret_cast<Array *>(_data._mem)->~Array();
} break;
- case INPUT_EVENT: {
-
- memdelete(_data._input_event);
-
- } break;
-
// arrays
case POOL_BYTE_ARRAY: {
@@ -1523,7 +1482,6 @@ Variant::operator String() const {
} break;
case TRANSFORM: return operator Transform();
case NODE_PATH: return operator NodePath();
- case INPUT_EVENT: return operator InputEvent();
case COLOR: return String::num(operator Color().r) + "," + String::num(operator Color().g) + "," + String::num(operator Color().b) + "," + String::num(operator Color().a);
case DICTIONARY: {
@@ -1642,7 +1600,7 @@ Variant::operator String() const {
};
};
#endif
- return "[" + _get_obj().obj->get_class() + ":" + itos(_get_obj().obj->get_instance_ID()) + "]";
+ return "[" + _get_obj().obj->get_class() + ":" + itos(_get_obj().obj->get_instance_id()) + "]";
} else
return "[Object:null]";
@@ -1759,13 +1717,6 @@ Variant::operator Color() const {
else
return Color();
}
-Variant::operator Image() const {
-
- if (type == IMAGE)
- return *_data._image;
- else
- return Image();
-}
Variant::operator NodePath() const {
@@ -1825,14 +1776,6 @@ Variant::operator Control *() const {
return NULL;
}
-Variant::operator InputEvent() const {
-
- if (type == INPUT_EVENT)
- return *reinterpret_cast<const InputEvent *>(_data._input_event);
- else
- return InputEvent();
-}
-
Variant::operator Dictionary() const {
if (type == DICTIONARY)
@@ -2305,11 +2248,6 @@ Variant::Variant(const Color &p_color) {
type = COLOR;
memnew_placement(_data._mem, Color(p_color));
}
-Variant::Variant(const Image &p_image) {
-
- type = IMAGE;
- _data._image = memnew(Image(p_image));
-}
Variant::Variant(const NodePath &p_node_path) {
@@ -2317,12 +2255,6 @@ Variant::Variant(const NodePath &p_node_path) {
memnew_placement(_data._mem, NodePath(p_node_path));
}
-Variant::Variant(const InputEvent &p_input_event) {
-
- type = INPUT_EVENT;
- _data._input_event = memnew(InputEvent(p_input_event));
-}
-
Variant::Variant(const RefPtr &p_resource) {
type = OBJECT;
@@ -2617,8 +2549,8 @@ uint32_t Variant::hash() const {
} break;
case RECT2: {
- uint32_t hash = hash_djb2_one_float(reinterpret_cast<const Rect2 *>(_data._mem)->pos.x);
- hash = hash_djb2_one_float(reinterpret_cast<const Rect2 *>(_data._mem)->pos.y, hash);
+ uint32_t hash = hash_djb2_one_float(reinterpret_cast<const Rect2 *>(_data._mem)->position.x);
+ hash = hash_djb2_one_float(reinterpret_cast<const Rect2 *>(_data._mem)->position.y, hash);
hash = hash_djb2_one_float(reinterpret_cast<const Rect2 *>(_data._mem)->size.x, hash);
return hash_djb2_one_float(reinterpret_cast<const Rect2 *>(_data._mem)->size.y, hash);
} break;
@@ -2658,7 +2590,7 @@ uint32_t Variant::hash() const {
uint32_t hash = 5831;
for (int i = 0; i < 3; i++) {
- hash = hash_djb2_one_float(_data._rect3->pos[i], hash);
+ hash = hash_djb2_one_float(_data._rect3->position[i], hash);
hash = hash_djb2_one_float(_data._rect3->size[i], hash);
}
@@ -2710,11 +2642,6 @@ uint32_t Variant::hash() const {
return hash_djb2_one_float(reinterpret_cast<const Color *>(_data._mem)->a, hash);
} break;
- case IMAGE: {
-
- return 0;
-
- } break;
case _RID: {
return hash_djb2_one_64(reinterpret_cast<const RID *>(_data._mem)->get_id());
@@ -2727,11 +2654,6 @@ uint32_t Variant::hash() const {
return reinterpret_cast<const NodePath *>(_data._mem)->hash();
} break;
- case INPUT_EVENT: {
-
- return hash_djb2_buffer((uint8_t *)_data._input_event, sizeof(InputEvent));
-
- } break;
case DICTIONARY: {
return reinterpret_cast<const Dictionary *>(_data._mem)->hash();
@@ -2838,7 +2760,7 @@ 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))
+ ((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)) && \
@@ -2898,7 +2820,7 @@ bool Variant::hash_compare(const Variant &p_variant) const {
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)) &&
+ return (hash_compare_vector2(l->position, r->position)) &&
(hash_compare_vector2(l->size, r->size));
} break;
@@ -2933,7 +2855,7 @@ bool Variant::hash_compare(const Variant &p_variant) const {
const Rect3 *l = _data._rect3;
const Rect3 *r = p_variant._data._rect3;
- return (hash_compare_vector3(l->pos, r->pos) &&
+ return (hash_compare_vector3(l->position, r->position) &&
(hash_compare_vector3(l->size, r->size)));
} break;
diff --git a/core/variant.h b/core/variant.h
index c9f7ada3ac..40de1a9bce 100644
--- a/core/variant.h
+++ b/core/variant.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,19 +39,16 @@
#include "dictionary.h"
#include "dvector.h"
#include "face3.h"
-#include "image.h"
#include "io/ip_address.h"
#include "math_2d.h"
#include "matrix3.h"
-#include "os/input_event.h"
+#include "node_path.h"
#include "os/power.h"
-#include "path_db.h"
#include "plane.h"
#include "quat.h"
#include "rect3.h"
#include "ref_ptr.h"
#include "rid.h"
-#include "simple_type.h"
#include "transform.h"
#include "ustring.h"
#include "vector3.h"
@@ -91,26 +89,24 @@ public:
TRANSFORM2D,
PLANE,
QUAT, // 10
- RECT3, //sorry naming convention fail :( not like it's used often
+ RECT3,
BASIS,
TRANSFORM,
// misc types
COLOR,
- IMAGE, // 15
- NODE_PATH,
+ NODE_PATH, // 15
_RID,
OBJECT,
- INPUT_EVENT,
- DICTIONARY, // 20
- ARRAY,
+ DICTIONARY,
+ ARRAY, // 20
// arrays
POOL_BYTE_ARRAY,
POOL_INT_ARRAY,
POOL_REAL_ARRAY,
- POOL_STRING_ARRAY, // 25
- POOL_VECTOR2_ARRAY,
+ POOL_STRING_ARRAY,
+ POOL_VECTOR2_ARRAY, // 25
POOL_VECTOR3_ARRAY,
POOL_COLOR_ARRAY,
@@ -144,8 +140,6 @@ private:
Basis *_basis;
Transform *_transform;
RefPtr *_resource;
- InputEvent *_input_event;
- Image *_image;
void *_ptr; //generic pointer
uint8_t _mem[sizeof(ObjData) > (sizeof(real_t) * 4) ? sizeof(ObjData) : (sizeof(real_t) * 4)];
} _data;
@@ -159,15 +153,6 @@ public:
static bool can_convert(Type p_type_from, Type p_type_to);
static bool can_convert_strict(Type p_type_from, Type p_type_to);
- template <class T>
- static Type get_type_for() {
-
- GetSimpleType<T> t;
- Variant v(t.type);
- Type r = v.get_type();
- return r;
- }
-
bool is_ref() const;
_FORCE_INLINE_ bool is_num() const { return type == INT || type == REAL; };
_FORCE_INLINE_ bool is_array() const { return type >= ARRAY; };
@@ -206,11 +191,10 @@ public:
operator Transform2D() const;
operator Color() const;
- operator Image() const;
operator NodePath() const;
operator RefPtr() const;
operator RID() const;
- operator InputEvent() const;
+
operator Object *() const;
operator Node *() const;
operator Control *() const;
@@ -275,12 +259,10 @@ public:
Variant(const Transform2D &p_transform);
Variant(const Transform &p_transform);
Variant(const Color &p_color);
- Variant(const Image &p_image);
Variant(const NodePath &p_path);
Variant(const RefPtr &p_resource);
Variant(const RID &p_rid);
Variant(const Object *p_object);
- Variant(const InputEvent &p_input_event);
Variant(const Dictionary &p_dictionary);
Variant(const Array &p_array);
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 758500a873..aabc2546bc 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,7 @@
#include "variant.h"
#include "core_string_names.h"
+#include "io/compression.h"
#include "object.h"
#include "os/os.h"
#include "script_language.h"
@@ -36,9 +38,6 @@
typedef void (*VariantFunc)(Variant &r_ret, Variant &p_self, const Variant **p_args);
typedef void (*VariantConstructFunc)(Variant &r_ret, const Variant **p_args);
-VARIANT_ENUM_CAST(Image::CompressMode);
-//VARIANT_ENUM_CAST(Image::Format);
-
struct _VariantCall {
static void Vector3_dot(Variant &r_ret, Variant &p_self, const Variant **p_args) {
@@ -131,9 +130,9 @@ struct _VariantCall {
StringName name;
Variant::Type type;
Arg() { type = Variant::NIL; }
- Arg(Variant::Type p_type, const StringName &p_name) {
- name = p_name;
- type = p_type;
+ Arg(Variant::Type p_type, const StringName &p_name)
+ : name(p_name),
+ type(p_type) {
}
};
@@ -327,6 +326,7 @@ struct _VariantCall {
VCALL_LOCALMEM0R(Vector2, normalized);
VCALL_LOCALMEM0R(Vector2, length);
VCALL_LOCALMEM0R(Vector2, length_squared);
+ VCALL_LOCALMEM0R(Vector2, is_normalized);
VCALL_LOCALMEM1R(Vector2, distance_to);
VCALL_LOCALMEM1R(Vector2, distance_squared_to);
VCALL_LOCALMEM1R(Vector2, angle_to);
@@ -340,6 +340,7 @@ struct _VariantCall {
VCALL_LOCALMEM0R(Vector2, aspect);
VCALL_LOCALMEM1R(Vector2, dot);
VCALL_LOCALMEM1R(Vector2, slide);
+ VCALL_LOCALMEM1R(Vector2, bounce);
VCALL_LOCALMEM1R(Vector2, reflect);
VCALL_LOCALMEM0R(Vector2, angle);
//VCALL_LOCALMEM1R(Vector2,cross);
@@ -354,12 +355,15 @@ struct _VariantCall {
VCALL_LOCALMEM1R(Rect2, merge);
VCALL_LOCALMEM1R(Rect2, has_point);
VCALL_LOCALMEM1R(Rect2, grow);
+ VCALL_LOCALMEM2R(Rect2, grow_margin);
+ VCALL_LOCALMEM4R(Rect2, grow_individual);
VCALL_LOCALMEM1R(Rect2, expand);
VCALL_LOCALMEM0R(Vector3, min_axis);
VCALL_LOCALMEM0R(Vector3, max_axis);
VCALL_LOCALMEM0R(Vector3, length);
VCALL_LOCALMEM0R(Vector3, length_squared);
+ VCALL_LOCALMEM0R(Vector3, is_normalized);
VCALL_LOCALMEM0R(Vector3, normalized);
VCALL_LOCALMEM0R(Vector3, inverse);
VCALL_LOCALMEM1R(Vector3, snapped);
@@ -377,6 +381,7 @@ struct _VariantCall {
VCALL_LOCALMEM1R(Vector3, distance_squared_to);
VCALL_LOCALMEM1R(Vector3, angle_to);
VCALL_LOCALMEM1R(Vector3, slide);
+ VCALL_LOCALMEM1R(Vector3, bounce);
VCALL_LOCALMEM1R(Vector3, reflect);
VCALL_LOCALMEM0R(Plane, normalized);
@@ -415,6 +420,7 @@ struct _VariantCall {
VCALL_LOCALMEM0R(Quat, length);
VCALL_LOCALMEM0R(Quat, length_squared);
VCALL_LOCALMEM0R(Quat, normalized);
+ VCALL_LOCALMEM0R(Quat, is_normalized);
VCALL_LOCALMEM0R(Quat, inverse);
VCALL_LOCALMEM1R(Quat, dot);
VCALL_LOCALMEM1R(Quat, xform);
@@ -504,6 +510,44 @@ struct _VariantCall {
r_ret = s;
}
+ static void _call_PoolByteArray_compress(Variant &r_ret, Variant &p_self, const Variant **p_args) {
+
+ PoolByteArray *ba = reinterpret_cast<PoolByteArray *>(p_self._data._mem);
+ PoolByteArray compressed;
+ Compression::Mode mode = (Compression::Mode)(int)(*p_args[0]);
+
+ compressed.resize(Compression::get_max_compressed_buffer_size(ba->size(), mode));
+ int result = Compression::compress(compressed.write().ptr(), ba->read().ptr(), ba->size(), mode);
+
+ result = result >= 0 ? result : 0;
+ compressed.resize(result);
+
+ r_ret = compressed;
+ }
+
+ static void _call_PoolByteArray_decompress(Variant &r_ret, Variant &p_self, const Variant **p_args) {
+
+ PoolByteArray *ba = reinterpret_cast<PoolByteArray *>(p_self._data._mem);
+ PoolByteArray decompressed;
+ Compression::Mode mode = (Compression::Mode)(int)(*p_args[1]);
+
+ int buffer_size = (int)(*p_args[0]);
+
+ if (buffer_size < 0) {
+ r_ret = decompressed;
+ ERR_EXPLAIN("Decompression buffer size is less than zero");
+ ERR_FAIL();
+ }
+
+ decompressed.resize(buffer_size);
+ int result = Compression::decompress(decompressed.write().ptr(), buffer_size, ba->read().ptr(), ba->size(), mode);
+
+ result = result >= 0 ? result : 0;
+ decompressed.resize(result);
+
+ r_ret = decompressed;
+ }
+
VCALL_LOCALMEM0R(PoolByteArray, size);
VCALL_LOCALMEM2(PoolByteArray, set);
VCALL_LOCALMEM1R(PoolByteArray, get);
@@ -608,22 +652,6 @@ struct _VariantCall {
#define VCALL_PTR5R(m_type, m_method) \
static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { r_ret = reinterpret_cast<m_type *>(p_self._data._ptr)->m_method(*p_args[0], *p_args[1], *p_args[2], *p_args[3], *p_args[4]); }
- VCALL_PTR0R(Image, get_format);
- VCALL_PTR0R(Image, get_width);
- VCALL_PTR0R(Image, get_height);
- VCALL_PTR0R(Image, empty);
- VCALL_PTR0R(Image, get_used_rect);
- VCALL_PTR1R(Image, load);
- VCALL_PTR1R(Image, save_png);
- VCALL_PTR1R(Image, get_rect);
- VCALL_PTR1R(Image, compressed);
- VCALL_PTR0R(Image, decompressed);
- VCALL_PTR3R(Image, resized);
- VCALL_PTR0R(Image, get_data);
- VCALL_PTR3(Image, blit_rect);
- VCALL_PTR1R(Image, converted);
- VCALL_PTR0(Image, fix_alpha_edges);
-
VCALL_PTR0R(Rect3, get_area);
VCALL_PTR0R(Rect3, has_no_area);
VCALL_PTR0R(Rect3, has_no_surface);
@@ -701,6 +729,9 @@ struct _VariantCall {
VCALL_PTR1R(Basis, scaled);
VCALL_PTR0R(Basis, get_scale);
VCALL_PTR0R(Basis, get_euler);
+ VCALL_PTR1(Basis, set_scale);
+ VCALL_PTR1(Basis, set_rotation_euler);
+ VCALL_PTR2(Basis, set_rotation_axis_angle);
VCALL_PTR1R(Basis, tdotx);
VCALL_PTR1R(Basis, tdoty);
VCALL_PTR1R(Basis, tdotz);
@@ -747,13 +778,6 @@ struct _VariantCall {
VCALL_PTR1( Transform, translate );
VCALL_PTR0( Transform, orthonormalize ); */
- VCALL_PTR0R(InputEvent, is_pressed);
- VCALL_PTR1R(InputEvent, is_action);
- VCALL_PTR1R(InputEvent, is_action_pressed);
- VCALL_PTR1R(InputEvent, is_action_released);
- VCALL_PTR0R(InputEvent, is_echo);
- VCALL_PTR2(InputEvent, set_as_action);
-
struct ConstructData {
int arg_count;
@@ -872,6 +896,11 @@ struct _VariantCall {
r_ret = Basis(p_args[0]->operator Vector3(), p_args[1]->operator real_t());
}
+ static void Basis_init3(Variant &r_ret, const Variant **p_args) {
+
+ r_ret = Basis(p_args[0]->operator Vector3());
+ }
+
static void Transform_init1(Variant &r_ret, const Variant **p_args) {
Transform t;
@@ -887,11 +916,6 @@ struct _VariantCall {
r_ret = Transform(p_args[0]->operator Basis(), p_args[1]->operator Vector3());
}
- static void Image_init1(Variant &r_ret, const Variant **p_args) {
-
- r_ret = Image(*p_args[0], *p_args[1], *p_args[2], Image::Format(p_args[3]->operator int()));
- }
-
static void add_constructor(VariantConstructFunc p_func, const Variant::Type p_type,
const String &p_name1 = "", const Variant::Type p_type1 = Variant::NIL,
const String &p_name2 = "", const Variant::Type p_type2 = Variant::NIL,
@@ -1042,12 +1066,10 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
// misc types
case COLOR: return Color();
- case IMAGE: return Image();
case NODE_PATH:
return NodePath(); // 15
case _RID: return RID();
case OBJECT: return (Object *)NULL;
- case INPUT_EVENT: return InputEvent();
case DICTIONARY: return Dictionary();
case ARRAY:
return Array(); // 20
@@ -1124,12 +1146,10 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
// misc types
case COLOR: return p_args[0]->type == Variant::STRING ? Color::html(*p_args[0]) : Color::hex(*p_args[0]);
- case IMAGE: return (Image(*p_args[0]));
case NODE_PATH:
return (NodePath(p_args[0]->operator NodePath())); // 15
case _RID: return (RID(*p_args[0]));
case OBJECT: return ((Object *)(p_args[0]->operator Object *()));
- case INPUT_EVENT: return (InputEvent(*p_args[0]));
case DICTIONARY: return p_args[0]->operator Dictionary();
case ARRAY:
return p_args[0]->operator Array(); // 20
@@ -1426,6 +1446,7 @@ void register_variant_methods() {
ADDFUNC0(VECTOR2, REAL, Vector2, length, varray());
ADDFUNC0(VECTOR2, REAL, Vector2, angle, varray());
ADDFUNC0(VECTOR2, REAL, Vector2, length_squared, varray());
+ ADDFUNC0(VECTOR2, BOOL, Vector2, is_normalized, varray());
ADDFUNC1(VECTOR2, REAL, Vector2, distance_to, VECTOR2, "to", varray());
ADDFUNC1(VECTOR2, REAL, Vector2, distance_squared_to, VECTOR2, "to", varray());
ADDFUNC1(VECTOR2, REAL, Vector2, angle_to, VECTOR2, "to", varray());
@@ -1438,8 +1459,9 @@ void register_variant_methods() {
ADDFUNC1(VECTOR2, VECTOR2, Vector2, snapped, VECTOR2, "by", varray());
ADDFUNC0(VECTOR2, REAL, Vector2, aspect, varray());
ADDFUNC1(VECTOR2, REAL, Vector2, dot, VECTOR2, "with", varray());
- ADDFUNC1(VECTOR2, VECTOR2, Vector2, slide, VECTOR2, "vec", varray());
- ADDFUNC1(VECTOR2, VECTOR2, Vector2, reflect, VECTOR2, "vec", varray());
+ ADDFUNC1(VECTOR2, VECTOR2, Vector2, slide, VECTOR2, "n", varray());
+ ADDFUNC1(VECTOR2, VECTOR2, Vector2, bounce, VECTOR2, "n", varray());
+ ADDFUNC1(VECTOR2, VECTOR2, Vector2, reflect, VECTOR2, "n", varray());
//ADDFUNC1(VECTOR2,REAL,Vector2,cross,VECTOR2,"with",varray());
ADDFUNC0(VECTOR2, VECTOR2, Vector2, abs, varray());
ADDFUNC1(VECTOR2, VECTOR2, Vector2, clamped, REAL, "length", varray());
@@ -1452,12 +1474,15 @@ void register_variant_methods() {
ADDFUNC1(RECT2, RECT2, Rect2, merge, RECT2, "b", varray());
ADDFUNC1(RECT2, BOOL, Rect2, has_point, VECTOR2, "point", varray());
ADDFUNC1(RECT2, RECT2, Rect2, grow, REAL, "by", varray());
+ ADDFUNC2(RECT2, RECT2, Rect2, grow_margin, INT, "margin", REAL, "by", varray());
+ ADDFUNC4(RECT2, RECT2, Rect2, grow_individual, REAL, "left", REAL, "top", REAL, "right", REAL, " bottom", varray());
ADDFUNC1(RECT2, RECT2, Rect2, expand, VECTOR2, "to", varray());
ADDFUNC0(VECTOR3, INT, Vector3, min_axis, varray());
ADDFUNC0(VECTOR3, INT, Vector3, max_axis, varray());
ADDFUNC0(VECTOR3, REAL, Vector3, length, varray());
ADDFUNC0(VECTOR3, REAL, Vector3, length_squared, varray());
+ ADDFUNC0(VECTOR3, BOOL, Vector3, is_normalized, varray());
ADDFUNC0(VECTOR3, VECTOR3, Vector3, normalized, varray());
ADDFUNC0(VECTOR3, VECTOR3, Vector3, inverse, varray());
ADDFUNC1(VECTOR3, VECTOR3, Vector3, snapped, REAL, "by", varray());
@@ -1469,14 +1494,14 @@ void register_variant_methods() {
ADDFUNC1(VECTOR3, BASIS, Vector3, outer, VECTOR3, "b", varray());
ADDFUNC0(VECTOR3, BASIS, Vector3, to_diagonal_matrix, varray());
ADDFUNC0(VECTOR3, VECTOR3, Vector3, abs, varray());
- ADDFUNC0(VECTOR3, VECTOR3, Vector3, abs, varray());
ADDFUNC0(VECTOR3, VECTOR3, Vector3, floor, varray());
ADDFUNC0(VECTOR3, VECTOR3, Vector3, ceil, varray());
ADDFUNC1(VECTOR3, REAL, Vector3, distance_to, VECTOR3, "b", varray());
ADDFUNC1(VECTOR3, REAL, Vector3, distance_squared_to, VECTOR3, "b", varray());
ADDFUNC1(VECTOR3, REAL, Vector3, angle_to, VECTOR3, "to", varray());
- ADDFUNC1(VECTOR3, VECTOR3, Vector3, slide, VECTOR3, "by", varray());
- ADDFUNC1(VECTOR3, VECTOR3, Vector3, reflect, VECTOR3, "by", varray());
+ ADDFUNC1(VECTOR3, VECTOR3, Vector3, slide, VECTOR3, "n", varray());
+ ADDFUNC1(VECTOR3, VECTOR3, Vector3, bounce, VECTOR3, "n", varray());
+ ADDFUNC1(VECTOR3, VECTOR3, Vector3, reflect, VECTOR3, "n", varray());
ADDFUNC0(PLANE, PLANE, Plane, normalized, varray());
ADDFUNC0(PLANE, VECTOR3, Plane, center, varray());
@@ -1492,6 +1517,7 @@ void register_variant_methods() {
ADDFUNC0(QUAT, REAL, Quat, length, varray());
ADDFUNC0(QUAT, REAL, Quat, length_squared, varray());
ADDFUNC0(QUAT, QUAT, Quat, normalized, varray());
+ ADDFUNC0(QUAT, BOOL, Quat, is_normalized, varray());
ADDFUNC0(QUAT, QUAT, Quat, inverse, varray());
ADDFUNC1(QUAT, REAL, Quat, dot, QUAT, "b", varray());
ADDFUNC1(QUAT, VECTOR3, Quat, xform, VECTOR3, "v", varray());
@@ -1508,22 +1534,6 @@ void register_variant_methods() {
ADDFUNC1(COLOR, COLOR, Color, blend, COLOR, "over", varray());
ADDFUNC1(COLOR, STRING, Color, to_html, BOOL, "with_alpha", varray(true));
- ADDFUNC0(IMAGE, INT, Image, get_format, varray());
- ADDFUNC0(IMAGE, INT, Image, get_width, varray());
- ADDFUNC0(IMAGE, INT, Image, get_height, varray());
- ADDFUNC0(IMAGE, BOOL, Image, empty, varray());
- ADDFUNC1(IMAGE, INT, Image, load, STRING, "path", varray(0));
- ADDFUNC1(IMAGE, INT, Image, save_png, STRING, "path", varray(0));
- ADDFUNC0(IMAGE, RECT2, Image, get_used_rect, varray(0));
- ADDFUNC1(IMAGE, IMAGE, Image, get_rect, RECT2, "area", varray(0));
- ADDFUNC1(IMAGE, IMAGE, Image, compressed, INT, "format", varray(0));
- ADDFUNC0(IMAGE, IMAGE, Image, decompressed, varray(0));
- ADDFUNC3(IMAGE, IMAGE, Image, resized, INT, "x", INT, "y", INT, "interpolation", varray(((int)Image::INTERPOLATE_BILINEAR)));
- ADDFUNC0(IMAGE, POOL_BYTE_ARRAY, Image, get_data, varray());
- ADDFUNC3(IMAGE, NIL, Image, blit_rect, IMAGE, "src", RECT2, "src_rect", VECTOR2, "dest", varray(0));
- ADDFUNC1(IMAGE, IMAGE, Image, converted, INT, "format", varray(0));
- ADDFUNC0(IMAGE, NIL, Image, fix_alpha_edges, varray());
-
ADDFUNC0(_RID, INT, RID, get_id, varray());
ADDFUNC0(NODE_PATH, BOOL, NodePath, is_absolute, varray());
@@ -1581,6 +1591,8 @@ void register_variant_methods() {
ADDFUNC0(POOL_BYTE_ARRAY, STRING, PoolByteArray, get_string_from_ascii, varray());
ADDFUNC0(POOL_BYTE_ARRAY, STRING, PoolByteArray, get_string_from_utf8, varray());
+ ADDFUNC1(POOL_BYTE_ARRAY, POOL_BYTE_ARRAY, PoolByteArray, compress, INT, "compression_mode", varray(0));
+ ADDFUNC2(POOL_BYTE_ARRAY, POOL_BYTE_ARRAY, PoolByteArray, decompress, INT, "buffer_size", INT, "compression_mode", varray(0));
ADDFUNC0(POOL_INT_ARRAY, INT, PoolIntArray, size, varray());
ADDFUNC2(POOL_INT_ARRAY, NIL, PoolIntArray, set, INT, "idx", INT, "integer", varray());
@@ -1687,6 +1699,9 @@ void register_variant_methods() {
ADDFUNC0(BASIS, REAL, Basis, determinant, varray());
ADDFUNC2(BASIS, BASIS, Basis, rotated, VECTOR3, "axis", REAL, "phi", varray());
ADDFUNC1(BASIS, BASIS, Basis, scaled, VECTOR3, "scale", varray());
+ ADDFUNC1(BASIS, NIL, Basis, set_scale, VECTOR3, "scale", varray());
+ ADDFUNC1(BASIS, NIL, Basis, set_rotation_euler, VECTOR3, "euler", varray());
+ ADDFUNC2(BASIS, NIL, Basis, set_rotation_axis_angle, VECTOR3, "axis", REAL, "angle", varray());
ADDFUNC0(BASIS, VECTOR3, Basis, get_scale, varray());
ADDFUNC0(BASIS, VECTOR3, Basis, get_euler, varray());
ADDFUNC1(BASIS, REAL, Basis, tdotx, VECTOR3, "with", varray());
@@ -1711,13 +1726,6 @@ void register_variant_methods() {
_VariantCall::type_funcs[Variant::TRANSFORM].functions["xform_inv"].returns = true;
#endif
- ADDFUNC0(INPUT_EVENT, BOOL, InputEvent, is_pressed, varray());
- ADDFUNC1(INPUT_EVENT, BOOL, InputEvent, is_action, STRING, "action", varray());
- ADDFUNC1(INPUT_EVENT, BOOL, InputEvent, is_action_pressed, STRING, "action", varray());
- ADDFUNC1(INPUT_EVENT, BOOL, InputEvent, is_action_released, STRING, "action", varray());
- ADDFUNC0(INPUT_EVENT, BOOL, InputEvent, is_echo, varray());
- ADDFUNC2(INPUT_EVENT, NIL, InputEvent, set_as_action, STRING, "action", BOOL, "pressed", varray());
-
/* REGISTER CONSTRUCTORS */
_VariantCall::add_constructor(_VariantCall::Vector2_init1, Variant::VECTOR2, "x", Variant::REAL, "y", Variant::REAL);
@@ -1744,77 +1752,16 @@ void register_variant_methods() {
_VariantCall::add_constructor(_VariantCall::Basis_init1, Variant::BASIS, "x_axis", Variant::VECTOR3, "y_axis", Variant::VECTOR3, "z_axis", Variant::VECTOR3);
_VariantCall::add_constructor(_VariantCall::Basis_init2, Variant::BASIS, "axis", Variant::VECTOR3, "phi", Variant::REAL);
+ _VariantCall::add_constructor(_VariantCall::Basis_init3, Variant::BASIS, "euler", Variant::VECTOR3);
_VariantCall::add_constructor(_VariantCall::Transform_init1, Variant::TRANSFORM, "x_axis", Variant::VECTOR3, "y_axis", Variant::VECTOR3, "z_axis", Variant::VECTOR3, "origin", Variant::VECTOR3);
_VariantCall::add_constructor(_VariantCall::Transform_init2, Variant::TRANSFORM, "basis", Variant::BASIS, "origin", Variant::VECTOR3);
- _VariantCall::add_constructor(_VariantCall::Image_init1, Variant::IMAGE, "width", Variant::INT, "height", Variant::INT, "mipmaps", Variant::BOOL, "format", Variant::INT);
-
/* REGISTER CONSTANTS */
_VariantCall::add_constant(Variant::VECTOR3, "AXIS_X", Vector3::AXIS_X);
_VariantCall::add_constant(Variant::VECTOR3, "AXIS_Y", Vector3::AXIS_Y);
_VariantCall::add_constant(Variant::VECTOR3, "AXIS_Z", Vector3::AXIS_Z);
-
- _VariantCall::add_constant(Variant::INPUT_EVENT, "NONE", InputEvent::NONE);
- _VariantCall::add_constant(Variant::INPUT_EVENT, "KEY", InputEvent::KEY);
- _VariantCall::add_constant(Variant::INPUT_EVENT, "MOUSE_MOTION", InputEvent::MOUSE_MOTION);
- _VariantCall::add_constant(Variant::INPUT_EVENT, "MOUSE_BUTTON", InputEvent::MOUSE_BUTTON);
- _VariantCall::add_constant(Variant::INPUT_EVENT, "JOYPAD_MOTION", InputEvent::JOYPAD_MOTION);
- _VariantCall::add_constant(Variant::INPUT_EVENT, "JOYPAD_BUTTON", InputEvent::JOYPAD_BUTTON);
- _VariantCall::add_constant(Variant::INPUT_EVENT, "SCREEN_TOUCH", InputEvent::SCREEN_TOUCH);
- _VariantCall::add_constant(Variant::INPUT_EVENT, "SCREEN_DRAG", InputEvent::SCREEN_DRAG);
- _VariantCall::add_constant(Variant::INPUT_EVENT, "ACTION", InputEvent::ACTION);
-
- _VariantCall::add_constant(Variant::IMAGE, "COMPRESS_16BIT", Image::COMPRESS_16BIT);
- _VariantCall::add_constant(Variant::IMAGE, "COMPRESS_S3TC", Image::COMPRESS_S3TC);
- _VariantCall::add_constant(Variant::IMAGE, "COMPRESS_PVRTC2", Image::COMPRESS_PVRTC2);
- _VariantCall::add_constant(Variant::IMAGE, "COMPRESS_PVRTC4", Image::COMPRESS_PVRTC4);
- _VariantCall::add_constant(Variant::IMAGE, "COMPRESS_ETC", Image::COMPRESS_ETC);
- _VariantCall::add_constant(Variant::IMAGE, "COMPRESS_ETC2", Image::COMPRESS_ETC2);
-
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_L8", Image::FORMAT_L8);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_LA8", Image::FORMAT_LA8);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_R8", Image::FORMAT_R8);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RG8", Image::FORMAT_RG8);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RGB8", Image::FORMAT_RGB8);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RGBA8", Image::FORMAT_RGBA8);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RGB565", Image::FORMAT_RGB565);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RGBA4444", Image::FORMAT_RGBA4444);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RGBA5551", Image::FORMAT_DXT1);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RF", Image::FORMAT_RF);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RGF", Image::FORMAT_RGF);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RGBF", Image::FORMAT_RGBF);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RGBAF", Image::FORMAT_RGBAF);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RH", Image::FORMAT_RH);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RGH", Image::FORMAT_RGH);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RGBH", Image::FORMAT_RGBH);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_RGBAH", Image::FORMAT_RGBAH);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_DXT1", Image::FORMAT_DXT1);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_DXT3", Image::FORMAT_DXT3);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_DXT5", Image::FORMAT_DXT5);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_ATI1", Image::FORMAT_ATI1);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_ATI2", Image::FORMAT_ATI2);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_BPTC_RGBA", Image::FORMAT_BPTC_RGBA);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_BPTC_RGBF", Image::FORMAT_BPTC_RGBF);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_BPTC_RGBFU", Image::FORMAT_BPTC_RGBFU);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_PVRTC2", Image::FORMAT_PVRTC2);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_PVRTC2A", Image::FORMAT_PVRTC2A);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_PVRTC4", Image::FORMAT_PVRTC4);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_PVRTC4A", Image::FORMAT_PVRTC4A);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_ETC", Image::FORMAT_ETC);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_ETC2_R11", Image::FORMAT_ETC2_R11);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_ETC2_R11S", Image::FORMAT_ETC2_R11S);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_ETC2_RG11", Image::FORMAT_ETC2_RG11);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_ETC2_RG11S", Image::FORMAT_ETC2_RG11S);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_ETC2_RGB8", Image::FORMAT_ETC2_RGB8);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_ETC2_RGBA8", Image::FORMAT_ETC2_RGBA8);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_ETC2_RGB8A1", Image::FORMAT_ETC2_RGB8A1);
- _VariantCall::add_constant(Variant::IMAGE, "FORMAT_MAX", Image::FORMAT_MAX);
-
- _VariantCall::add_constant(Variant::IMAGE, "INTERPOLATE_NEAREST", Image::INTERPOLATE_NEAREST);
- _VariantCall::add_constant(Variant::IMAGE, "INTERPOLATE_BILINEAR", Image::INTERPOLATE_BILINEAR);
- _VariantCall::add_constant(Variant::IMAGE, "INTERPOLATE_CUBIC", Image::INTERPOLATE_CUBIC);
}
void unregister_variant_methods() {
diff --git a/core/variant_construct_string.cpp b/core/variant_construct_string.cpp
index 7f176749d3..fa8a393d08 100644
--- a/core/variant_construct_string.cpp
+++ b/core/variant_construct_string.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -65,7 +66,7 @@ class VariantConstruct {
static Error _get_token(const CharType *p_str, int &index, int p_len, Token &r_token, int &line, String &r_err_str);
static Error _parse_value(Variant &value, Token &token, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str, Variant::ObjectConstruct *p_construct, void *p_ud);
static Error _parse_array(Array &array, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str, Variant::ObjectConstruct *p_construct, void *p_ud);
- static Error _parse_dict(Dictionary &object, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str, Variant::ObjectConstruct *p_construct, void *p_ud);
+ static Error _parse_dict(Dictionary &dict, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str, Variant::ObjectConstruct *p_construct, void *p_ud);
public:
static Error parse(const String &p_string, Variant &r_ret, String &r_err_str, int &r_err_line, Variant::ObjectConstruct *p_construct, void *p_ud);
@@ -84,15 +85,15 @@ const char *VariantConstruct::tk_name[TK_MAX] = {
"EOF",
};
-Error VariantConstruct::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_token, int &line, String &r_err_str) {
+Error VariantConstruct::_get_token(const CharType *p_str, int &index, int p_len, Token &r_token, int &line, String &r_err_str) {
while (true) {
- switch (p_str[idx]) {
+ switch (p_str[index]) {
case '\n': {
line++;
- idx++;
+ index++;
break;
};
case 0: {
@@ -102,54 +103,54 @@ Error VariantConstruct::_get_token(const CharType *p_str, int &idx, int p_len, T
case '{': {
r_token.type = TK_CURLY_BRACKET_OPEN;
- idx++;
+ index++;
return OK;
};
case '}': {
r_token.type = TK_CURLY_BRACKET_CLOSE;
- idx++;
+ index++;
return OK;
};
case '[': {
r_token.type = TK_BRACKET_OPEN;
- idx++;
+ index++;
return OK;
};
case ']': {
r_token.type = TK_BRACKET_CLOSE;
- idx++;
+ index++;
return OK;
};
case ':': {
r_token.type = TK_COLON;
- idx++;
+ index++;
return OK;
};
case ',': {
r_token.type = TK_COMMA;
- idx++;
+ index++;
return OK;
};
case '"': {
- idx++;
+ index++;
String str;
while (true) {
- if (p_str[idx] == 0) {
+ if (p_str[index] == 0) {
r_err_str = "Unterminated String";
return ERR_PARSE_ERROR;
- } else if (p_str[idx] == '"') {
- idx++;
+ } else if (p_str[index] == '"') {
+ index++;
break;
- } else if (p_str[idx] == '\\') {
+ } else if (p_str[index] == '\\') {
//escaped characters...
- idx++;
- CharType next = p_str[idx];
+ index++;
+ CharType next = p_str[index];
if (next == 0) {
r_err_str = "Unterminated String";
return ERR_PARSE_ERROR;
@@ -170,7 +171,7 @@ Error VariantConstruct::_get_token(const CharType *p_str, int &idx, int p_len, T
//hexnumbarh - oct is deprecated
for (int j = 0; j < 4; j++) {
- CharType c = p_str[idx + j + 1];
+ CharType c = p_str[index + j + 1];
if (c == 0) {
r_err_str = "Unterminated String";
return ERR_PARSE_ERROR;
@@ -197,7 +198,7 @@ Error VariantConstruct::_get_token(const CharType *p_str, int &idx, int p_len, T
res <<= 4;
res |= v;
}
- idx += 4; //will add at the end anyway
+ index += 4; //will add at the end anyway
} break;
default: {
@@ -210,11 +211,11 @@ Error VariantConstruct::_get_token(const CharType *p_str, int &idx, int p_len, T
str += res;
} else {
- if (p_str[idx] == '\n')
+ if (p_str[index] == '\n')
line++;
- str += p_str[idx];
+ str += p_str[index];
}
- idx++;
+ index++;
}
r_token.type = TK_STRING;
@@ -224,28 +225,28 @@ Error VariantConstruct::_get_token(const CharType *p_str, int &idx, int p_len, T
} break;
default: {
- if (p_str[idx] <= 32) {
- idx++;
+ if (p_str[index] <= 32) {
+ index++;
break;
}
- if (p_str[idx] == '-' || (p_str[idx] >= '0' && p_str[idx] <= '9')) {
+ if (p_str[index] == '-' || (p_str[index] >= '0' && p_str[index] <= '9')) {
//a number
const CharType *rptr;
- double number = String::to_double(&p_str[idx], &rptr);
- idx += (rptr - &p_str[idx]);
+ double number = String::to_double(&p_str[index], &rptr);
+ index += (rptr - &p_str[index]);
r_token.type = TK_NUMBER;
r_token.value = number;
return OK;
- } else if ((p_str[idx] >= 'A' && p_str[idx] <= 'Z') || (p_str[idx] >= 'a' && p_str[idx] <= 'z')) {
+ } else if ((p_str[index] >= 'A' && p_str[index] <= 'Z') || (p_str[index] >= 'a' && p_str[index] <= 'z')) {
String id;
- while ((p_str[idx] >= 'A' && p_str[idx] <= 'Z') || (p_str[idx] >= 'a' && p_str[idx] <= 'z')) {
+ while ((p_str[index] >= 'A' && p_str[index] <= 'Z') || (p_str[index] >= 'a' && p_str[index] <= 'z')) {
- id += p_str[idx];
- idx++;
+ id += p_str[index];
+ index++;
}
r_token.type = TK_IDENTIFIER;
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index 71d03b159e..5fda6b1473 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -57,11 +58,9 @@ bool Variant::booleanize(bool &r_valid) const {
case BASIS:
case TRANSFORM:
case COLOR:
- case IMAGE: r_valid = false; return false;
case _RID: return (*reinterpret_cast<const RID *>(_data._mem)).is_valid();
case OBJECT: return _get_obj().obj;
case NODE_PATH: return (*reinterpret_cast<const NodePath *>(_data._mem)) != NodePath();
- case INPUT_EVENT:
case DICTIONARY:
case ARRAY:
case POOL_BYTE_ARRAY:
@@ -282,7 +281,6 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
DEFAULT_OP_PTRREF(==, TRANSFORM, _transform);
DEFAULT_OP_LOCALMEM(==, COLOR, Color);
- DEFAULT_OP_PTRREF(==, IMAGE, _image);
DEFAULT_OP_STR(==, NODE_PATH, NodePath);
DEFAULT_OP_LOCALMEM(==, _RID, RID);
case OBJECT: {
@@ -292,7 +290,6 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
if (p_b.type == NIL)
_RETURN(!p_a._get_obj().obj);
} break;
- DEFAULT_OP_PTRREF(==, INPUT_EVENT, _input_event);
case DICTIONARY: {
@@ -371,7 +368,7 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
DEFAULT_OP_FAIL(TRANSFORM);
DEFAULT_OP_FAIL(COLOR);
- DEFAULT_OP_FAIL(IMAGE);
+
DEFAULT_OP_FAIL(NODE_PATH);
DEFAULT_OP_LOCALMEM(<, _RID, RID);
case OBJECT: {
@@ -379,7 +376,6 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
if (p_b.type == OBJECT)
_RETURN((p_a._get_obj().obj < p_b._get_obj().obj));
} break;
- DEFAULT_OP_FAIL(INPUT_EVENT);
DEFAULT_OP_FAIL(DICTIONARY);
case ARRAY: {
@@ -436,7 +432,7 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
DEFAULT_OP_FAIL(TRANSFORM);
DEFAULT_OP_FAIL(COLOR);
- DEFAULT_OP_FAIL(IMAGE);
+
DEFAULT_OP_FAIL(NODE_PATH);
DEFAULT_OP_LOCALMEM(<=, _RID, RID);
case OBJECT: {
@@ -444,7 +440,6 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
if (p_b.type == OBJECT)
_RETURN((p_a._get_obj().obj <= p_b._get_obj().obj));
} break;
- DEFAULT_OP_FAIL(INPUT_EVENT);
DEFAULT_OP_FAIL(DICTIONARY);
DEFAULT_OP_FAIL(ARRAY);
DEFAULT_OP_FAIL(POOL_BYTE_ARRAY);
@@ -499,11 +494,10 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
DEFAULT_OP_FAIL(TRANSFORM);
DEFAULT_OP_FAIL(COLOR);
- DEFAULT_OP_FAIL(IMAGE);
+
DEFAULT_OP_FAIL(NODE_PATH);
DEFAULT_OP_FAIL(_RID);
DEFAULT_OP_FAIL(OBJECT);
- DEFAULT_OP_FAIL(INPUT_EVENT);
DEFAULT_OP_FAIL(DICTIONARY);
case ARRAY: {
@@ -556,11 +550,10 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
DEFAULT_OP_FAIL(TRANSFORM);
DEFAULT_OP_FAIL(COLOR);
- DEFAULT_OP_FAIL(IMAGE);
+
DEFAULT_OP_FAIL(NODE_PATH);
DEFAULT_OP_FAIL(_RID);
DEFAULT_OP_FAIL(OBJECT);
- DEFAULT_OP_FAIL(INPUT_EVENT);
DEFAULT_OP_FAIL(DICTIONARY);
DEFAULT_OP_FAIL(ARRAY);
DEFAULT_OP_FAIL(POOL_BYTE_ARRAY);
@@ -653,11 +646,10 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
return;
} break;
DEFAULT_OP_FAIL(COLOR);
- DEFAULT_OP_FAIL(IMAGE);
+
DEFAULT_OP_FAIL(NODE_PATH);
DEFAULT_OP_FAIL(_RID);
DEFAULT_OP_FAIL(OBJECT);
- DEFAULT_OP_FAIL(INPUT_EVENT);
DEFAULT_OP_FAIL(DICTIONARY);
DEFAULT_OP_FAIL(ARRAY);
DEFAULT_OP_FAIL(POOL_BYTE_ARRAY);
@@ -726,11 +718,10 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
DEFAULT_OP_FAIL(TRANSFORM);
DEFAULT_OP_FAIL(COLOR);
- DEFAULT_OP_FAIL(IMAGE);
+
DEFAULT_OP_FAIL(NODE_PATH);
DEFAULT_OP_FAIL(_RID);
DEFAULT_OP_FAIL(OBJECT);
- DEFAULT_OP_FAIL(INPUT_EVENT);
DEFAULT_OP_FAIL(DICTIONARY);
DEFAULT_OP_FAIL(ARRAY);
DEFAULT_OP_FAIL(POOL_BYTE_ARRAY);
@@ -768,11 +759,10 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
DEFAULT_OP_LOCALMEM_POS(VECTOR2, Vector2);
DEFAULT_OP_FAIL(COLOR);
- DEFAULT_OP_FAIL(IMAGE);
+
DEFAULT_OP_FAIL(NODE_PATH);
DEFAULT_OP_FAIL(_RID);
DEFAULT_OP_FAIL(OBJECT);
- DEFAULT_OP_FAIL(INPUT_EVENT);
DEFAULT_OP_FAIL(DICTIONARY);
DEFAULT_OP_FAIL(ARRAY);
DEFAULT_OP_FAIL(POOL_BYTE_ARRAY);
@@ -808,11 +798,10 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant &
DEFAULT_OP_FAIL(TRANSFORM);
DEFAULT_OP_FAIL(COLOR);
- DEFAULT_OP_FAIL(IMAGE);
+
DEFAULT_OP_FAIL(NODE_PATH);
DEFAULT_OP_FAIL(_RID);
DEFAULT_OP_FAIL(OBJECT);
- DEFAULT_OP_FAIL(INPUT_EVENT);
DEFAULT_OP_FAIL(DICTIONARY);
DEFAULT_OP_FAIL(ARRAY);
DEFAULT_OP_FAIL(POOL_BYTE_ARRAY);
@@ -1120,11 +1109,11 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
const String *str = reinterpret_cast<const String *>(p_index._data._mem);
Vector2 *v = reinterpret_cast<Vector2 *>(_data._mem);
- if (*str == "x" || *str == "width") {
+ if (*str == "x") {
valid = true;
v->x = p_value;
return;
- } else if (*str == "y" || *str == "height") {
+ } else if (*str == "y") {
valid = true;
v->y = p_value;
return;
@@ -1142,9 +1131,9 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
const String *str = reinterpret_cast<const String *>(p_index._data._mem);
Rect2 *v = reinterpret_cast<Rect2 *>(_data._mem);
- if (*str == "pos") {
+ if (*str == "position") {
valid = true;
- v->pos = p_value;
+ v->position = p_value;
return;
} else if (*str == "size") {
valid = true;
@@ -1152,7 +1141,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
return;
} else if (*str == "end") {
valid = true;
- v->size = Vector2(p_value) - v->pos;
+ v->size = Vector2(p_value) - v->position;
return;
}
}
@@ -1188,7 +1177,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
valid = true;
v->elements[1] = p_value;
return;
- } else if (*str == "o") {
+ } else if (*str == "origin") {
valid = true;
v->elements[2] = p_value;
return;
@@ -1304,7 +1293,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
}
}
- } break;
+ } break; // 10
case RECT3: {
if (p_value.type != Variant::VECTOR3)
@@ -1315,9 +1304,9 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
const String *str = reinterpret_cast<const String *>(p_index._data._mem);
Rect3 *v = _data._rect3;
- if (*str == "pos") {
+ if (*str == "position") {
valid = true;
- v->pos = p_value;
+ v->position = p_value;
return;
} else if (*str == "size") {
valid = true;
@@ -1325,11 +1314,11 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
return;
} else if (*str == "end") {
valid = true;
- v->size = Vector3(p_value) - v->pos;
+ v->size = Vector3(p_value) - v->position;
return;
}
}
- } break; //sorry naming convention fail :( not like it's used often // 10
+ } break;
case BASIS: {
if (p_value.type != Variant::VECTOR3)
@@ -1479,8 +1468,6 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
}
} break;
- case IMAGE: {
- } break;
case NODE_PATH: {
} break; // 15
case _RID: {
@@ -1510,402 +1497,19 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
return obj->set(p_index, p_value, r_valid);
}
} break;
- case INPUT_EVENT: {
-
- InputEvent &ie = *_data._input_event;
-
- if (p_index.get_type() != Variant::STRING)
- return;
-
- const String &str = *reinterpret_cast<const String *>(p_index._data._mem);
-
- if (str == "type") {
-
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
-
- int type = p_value;
- if (type < 0 || type >= InputEvent::TYPE_MAX)
- return; //fail
- valid = true;
- ie.type = InputEvent::Type(type);
- return;
- } else if (str == "device") {
-
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
-
- valid = true;
- ie.device = p_value;
- return;
- } else if (str == "ID") {
-
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
-
- valid = true;
- ie.ID = p_value;
- return;
- }
-
- if (ie.type == InputEvent::KEY || ie.type == InputEvent::MOUSE_BUTTON || ie.type == InputEvent::MOUSE_MOTION) {
-
- if (str == "shift") {
-
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL && p_value.type != Variant::BOOL)
- return;
-
- valid = true;
- ie.key.mod.shift = p_value;
- return;
- }
- if (str == "alt") {
-
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL && p_value.type != Variant::BOOL)
- return;
-
- valid = true;
- ie.key.mod.alt = p_value;
- return;
- }
- if (str == "control") {
-
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL && p_value.type != Variant::BOOL)
- return;
-
- valid = true;
- ie.key.mod.control = p_value;
- return;
- }
- if (str == "meta") {
-
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL && p_value.type != Variant::BOOL)
- return;
-
- valid = true;
- ie.key.mod.meta = p_value;
- return;
- }
- }
-
- if (ie.type == InputEvent::KEY) {
-
- if (str == "pressed") {
-
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL && p_value.type != Variant::BOOL)
- return;
-
- valid = true;
- ie.key.pressed = p_value;
- return;
- } else if (str == "scancode") {
-
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
-
- valid = true;
- ie.key.scancode = p_value;
- return;
- } else if (str == "unicode") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
- valid = true;
- ie.key.unicode = p_value;
- return;
- } else if (str == "echo") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL && p_value.type != Variant::BOOL)
- return;
-
- valid = true;
- ie.key.echo = p_value;
- return;
- }
- }
-
- if (ie.type == InputEvent::MOUSE_MOTION || ie.type == InputEvent::MOUSE_BUTTON) {
-
- if (str == "button_mask") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
- valid = true;
- ie.mouse_button.button_mask = p_value;
- return;
- } else if (str == "x") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
- valid = true;
- ie.mouse_button.x = p_value;
- return;
- } else if (str == "y") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
- valid = true;
- ie.mouse_button.y = p_value;
- return;
- } else if (str == "pos") {
- if (p_value.type != Variant::VECTOR2)
- return;
- valid = true;
- Point2 value = p_value;
- ie.mouse_button.x = value.x;
- ie.mouse_button.y = value.y;
- return;
- } else if (str == "global_x") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
- valid = true;
- ie.mouse_button.global_x = p_value;
- return;
- } else if (str == "global_y") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
- valid = true;
- ie.mouse_button.global_y = p_value;
- return;
- } else if (str == "global_pos") {
- if (p_value.type != Variant::VECTOR2)
- return;
- valid = true;
- Point2 value = p_value;
- ie.mouse_button.global_x = value.x;
- ie.mouse_button.global_y = value.y;
- return;
- } /*else if (str=="pointer_index") {
- valid=true;
- return ie.mouse_button.pointer_index;
- }*/
-
- if (ie.type == InputEvent::MOUSE_MOTION) {
-
- if (str == "relative_x") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
- valid = true;
- ie.mouse_motion.relative_x = p_value;
- return;
- } else if (str == "relative_y") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
- valid = true;
- ie.mouse_motion.relative_y = p_value;
- return;
- } else if (str == "relative_pos") {
- if (p_value.type != Variant::VECTOR2)
- return;
- valid = true;
- Point2 value = p_value;
- ie.mouse_motion.relative_x = value.x;
- ie.mouse_motion.relative_y = value.y;
- return;
- }
-
- if (str == "speed_x") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
- valid = true;
- ie.mouse_motion.speed_x = p_value;
- return;
- } else if (str == "speed_y") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
- valid = true;
- ie.mouse_motion.speed_y = p_value;
- return;
- } else if (str == "speed") {
- if (p_value.type != Variant::VECTOR2)
- return;
- valid = true;
- Point2 value = p_value;
- ie.mouse_motion.speed_x = value.x;
- ie.mouse_motion.speed_y = value.y;
- return;
- }
-
- } else if (ie.type == InputEvent::MOUSE_BUTTON) {
-
- if (str == "button_index") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL)
- return;
- valid = true;
- ie.mouse_button.button_index = p_value;
- return;
- } else if (str == "pressed") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL && p_value.type != Variant::BOOL)
- return;
- valid = true;
- ie.mouse_button.pressed = p_value;
- return;
- } else if (str == "doubleclick") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL && p_value.type != Variant::BOOL)
- return;
- valid = true;
- ie.mouse_button.doubleclick = p_value;
- return;
- }
- }
- }
-
- if (ie.type == InputEvent::JOYPAD_BUTTON) {
-
- if (str == "button_index") {
- if (p_value.type != Variant::REAL && p_value.type != Variant::INT)
- return;
- valid = true;
- ie.joy_button.button_index = p_value;
- return;
- }
- if (str == "pressed") {
- if (p_value.type != Variant::INT && p_value.type != Variant::REAL && p_value.type != Variant::BOOL)
- return;
-
- valid = true;
- ie.joy_button.pressed = p_value;
- return;
- }
- if (str == "pressure") {
- if (p_value.type != Variant::REAL && p_value.type != Variant::INT)
- return;
- valid = true;
- ie.joy_button.pressure = p_value;
- return;
- }
- }
-
- if (ie.type == InputEvent::JOYPAD_MOTION) {
-
- if (str == "axis") {
- if (p_value.type != Variant::REAL && p_value.type != Variant::INT)
- return;
- valid = true;
- ie.joy_motion.axis = p_value;
- return;
- }
- if (str == "value") {
- if (p_value.type != Variant::REAL && p_value.type != Variant::INT)
- return;
- valid = true;
- ie.joy_motion.axis_value = p_value;
- return;
- }
- }
-
- if (ie.type == InputEvent::SCREEN_TOUCH) {
-
- if (str == "index") {
- valid = true;
- ie.screen_touch.index = p_value;
- return;
- }
- if (str == "x") {
- valid = true;
- ie.screen_touch.x = p_value;
- return;
- }
- if (str == "y") {
- valid = true;
- ie.screen_touch.y = p_value;
- return;
- }
- if (str == "pos") {
- valid = true;
- Vector2 v = p_value;
- ie.screen_touch.x = v.x;
- ie.screen_touch.y = v.y;
- return;
- }
- if (str == "pressed") {
- valid = true;
- ie.screen_touch.pressed = p_value;
- return;
- }
- }
-
- if (ie.type == InputEvent::SCREEN_DRAG) {
-
- if (str == "index") {
- valid = true;
- ie.screen_drag.index = p_value;
- return;
- }
- if (str == "x") {
- valid = true;
- ie.screen_drag.x = p_value;
- return;
- }
- if (str == "y") {
- valid = true;
- ie.screen_drag.y = p_value;
- return;
- }
- if (str == "pos") {
- valid = true;
- Vector2 v = p_value;
- ie.screen_drag.x = v.x;
- ie.screen_drag.y = v.y;
- return;
- }
- if (str == "relative_x") {
- valid = true;
- ie.screen_drag.relative_x = p_value;
- return;
- }
- if (str == "relative_y") {
- valid = true;
- ie.screen_drag.relative_y = p_value;
- return;
- }
- if (str == "relative_pos") {
- valid = true;
- Vector2 v = p_value;
- ie.screen_drag.relative_x = v.x;
- ie.screen_drag.relative_y = v.y;
- return;
- }
- if (str == "speed_x") {
- valid = true;
- ie.screen_drag.speed_x = p_value;
- return;
- }
- if (str == "speed_y") {
- valid = true;
- ie.screen_drag.speed_y = p_value;
- return;
- }
- if (str == "speed") {
- valid = true;
- Vector2 v = p_value;
- ie.screen_drag.speed_x = v.x;
- ie.screen_drag.speed_y = v.y;
- return;
- }
- }
- if (ie.type == InputEvent::ACTION) {
-
- if (str == "action") {
- valid = true;
- ie.action.action = p_value;
- return;
- } else if (str == "pressed") {
- valid = true;
- ie.action.pressed = p_value;
- return;
- }
- }
-
- } break;
case DICTIONARY: {
Dictionary *dic = reinterpret_cast<Dictionary *>(_data._mem);
dic->operator[](p_index) = p_value;
valid = true; //always valid, i guess? should this really be ok?
return;
- } break; // 20
- DEFAULT_OP_ARRAY_CMD(ARRAY, Array, ;, (*arr)[index] = p_value; return )
+ } break;
+ DEFAULT_OP_ARRAY_CMD(ARRAY, Array, ;, (*arr)[index] = p_value; return ) // 20
DEFAULT_OP_DVECTOR_SET(POOL_BYTE_ARRAY, uint8_t, p_value.type != Variant::REAL && p_value.type != Variant::INT)
DEFAULT_OP_DVECTOR_SET(POOL_INT_ARRAY, int, p_value.type != Variant::REAL && p_value.type != Variant::INT)
DEFAULT_OP_DVECTOR_SET(POOL_REAL_ARRAY, real_t, p_value.type != Variant::REAL && p_value.type != Variant::INT)
- DEFAULT_OP_DVECTOR_SET(POOL_STRING_ARRAY, String, p_value.type != Variant::STRING) // 25
- DEFAULT_OP_DVECTOR_SET(POOL_VECTOR2_ARRAY, Vector2, p_value.type != Variant::VECTOR2)
+ DEFAULT_OP_DVECTOR_SET(POOL_STRING_ARRAY, String, p_value.type != Variant::STRING)
+ DEFAULT_OP_DVECTOR_SET(POOL_VECTOR2_ARRAY, Vector2, p_value.type != Variant::VECTOR2) // 25
DEFAULT_OP_DVECTOR_SET(POOL_VECTOR3_ARRAY, Vector3, p_value.type != Variant::VECTOR3)
DEFAULT_OP_DVECTOR_SET(POOL_COLOR_ARRAY, Color, p_value.type != Variant::COLOR)
default: return;
@@ -1968,10 +1572,10 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
const String *str = reinterpret_cast<const String *>(p_index._data._mem);
const Vector2 *v = reinterpret_cast<const Vector2 *>(_data._mem);
- if (*str == "x" || *str == "width") {
+ if (*str == "x") {
valid = true;
return v->x;
- } else if (*str == "y" || *str == "height") {
+ } else if (*str == "y") {
valid = true;
return v->y;
}
@@ -1985,15 +1589,15 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
const String *str = reinterpret_cast<const String *>(p_index._data._mem);
const Rect2 *v = reinterpret_cast<const Rect2 *>(_data._mem);
- if (*str == "pos") {
+ if (*str == "position") {
valid = true;
- return v->pos;
+ return v->position;
} else if (*str == "size") {
valid = true;
return v->size;
} else if (*str == "end") {
valid = true;
- return v->size + v->pos;
+ return v->size + v->position;
}
}
} break;
@@ -2053,7 +1657,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
} else if (*str == "y") {
valid = true;
return v->elements[1];
- } else if (*str == "o") {
+ } else if (*str == "origin") {
valid = true;
return v->elements[2];
}
@@ -2106,7 +1710,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
}
}
- } break;
+ } break; // 10
case RECT3: {
if (p_index.get_type() == Variant::STRING) {
@@ -2114,18 +1718,18 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
const String *str = reinterpret_cast<const String *>(p_index._data._mem);
const Rect3 *v = _data._rect3;
- if (*str == "pos") {
+ if (*str == "position") {
valid = true;
- return v->pos;
+ return v->position;
} else if (*str == "size") {
valid = true;
return v->size;
} else if (*str == "end") {
valid = true;
- return v->size + v->pos;
+ return v->size + v->position;
}
}
- } break; //sorry naming convention fail :( not like it's used often // 10
+ } break;
case BASIS: {
if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) {
@@ -2238,8 +1842,6 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
}
} break;
- case IMAGE: {
- } break;
case NODE_PATH: {
} break; // 15
case _RID: {
@@ -2266,235 +1868,6 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
}
} break;
- case INPUT_EVENT: {
-
- InputEvent ie = operator InputEvent();
-
- if (p_index.get_type() != Variant::STRING)
- break;
-
- const String &str = *reinterpret_cast<const String *>(p_index._data._mem);
-
- if (str == "type") {
- valid = true;
- return ie.type;
- } else if (str == "device") {
- valid = true;
- return ie.device;
- } else if (str == "ID") {
- valid = true;
- return ie.ID;
- }
-
- if (ie.type == InputEvent::KEY || ie.type == InputEvent::MOUSE_BUTTON || ie.type == InputEvent::MOUSE_MOTION) {
-
- if (str == "shift") {
- valid = true;
- return ie.key.mod.shift;
- }
- if (str == "alt") {
- valid = true;
- return ie.key.mod.alt;
- }
- if (str == "control") {
- valid = true;
- return ie.key.mod.control;
- }
- if (str == "meta") {
- valid = true;
- return ie.key.mod.meta;
- }
- }
-
- if (ie.type == InputEvent::KEY) {
-
- if (str == "pressed") {
- valid = true;
- return ie.key.pressed;
- } else if (str == "scancode") {
- valid = true;
- return ie.key.scancode;
- } else if (str == "unicode") {
- valid = true;
- return ie.key.unicode;
- } else if (str == "echo") {
- valid = true;
- return ie.key.echo;
- }
- }
-
- if (ie.type == InputEvent::MOUSE_MOTION || ie.type == InputEvent::MOUSE_BUTTON) {
-
- if (str == "button_mask") {
- valid = true;
- return ie.mouse_button.button_mask;
- } else if (str == "x") {
- valid = true;
- return ie.mouse_button.x;
- } else if (str == "y") {
- valid = true;
- return ie.mouse_button.y;
- } else if (str == "pos") {
- valid = true;
- return Point2(ie.mouse_button.x, ie.mouse_button.y);
- } else if (str == "global_x") {
- valid = true;
- return ie.mouse_button.global_x;
- } else if (str == "global_y") {
- valid = true;
- return ie.mouse_button.global_y;
- } else if (str == "global_pos") {
- valid = true;
- return Point2(ie.mouse_button.global_x, ie.mouse_button.global_y);
- } /*else if (str=="pointer_index") {
- valid=true;
- return ie.mouse_button.pointer_index;
- }*/
-
- if (ie.type == InputEvent::MOUSE_MOTION) {
-
- if (str == "relative_x") {
- valid = true;
- return ie.mouse_motion.relative_x;
- } else if (str == "relative_y") {
- valid = true;
- return ie.mouse_motion.relative_y;
- } else if (str == "relative_pos") {
- valid = true;
- return Point2(ie.mouse_motion.relative_x, ie.mouse_motion.relative_y);
- } else if (str == "speed_x") {
- valid = true;
- return ie.mouse_motion.speed_x;
- } else if (str == "speed_y") {
- valid = true;
- return ie.mouse_motion.speed_y;
- } else if (str == "speed") {
- valid = true;
- return Point2(ie.mouse_motion.speed_x, ie.mouse_motion.speed_y);
- }
-
- } else if (ie.type == InputEvent::MOUSE_BUTTON) {
-
- if (str == "button_index") {
- valid = true;
- return ie.mouse_button.button_index;
- } else if (str == "pressed") {
- valid = true;
- return ie.mouse_button.pressed;
- } else if (str == "doubleclick") {
- valid = true;
- return ie.mouse_button.doubleclick;
- }
- }
- }
-
- if (ie.type == InputEvent::JOYPAD_BUTTON) {
-
- if (str == "button_index") {
- valid = true;
- return ie.joy_button.button_index;
- }
- if (str == "pressed") {
- valid = true;
- return ie.joy_button.pressed;
- }
- if (str == "pressure") {
- valid = true;
- return ie.joy_button.pressure;
- }
- }
-
- if (ie.type == InputEvent::JOYPAD_MOTION) {
-
- if (str == "axis") {
- valid = true;
- return ie.joy_motion.axis;
- }
- if (str == "value") {
- valid = true;
- return ie.joy_motion.axis_value;
- }
- }
-
- if (ie.type == InputEvent::SCREEN_TOUCH) {
-
- if (str == "index") {
- valid = true;
- return ie.screen_touch.index;
- }
- if (str == "x") {
- valid = true;
- return ie.screen_touch.x;
- }
- if (str == "y") {
- valid = true;
- return ie.screen_touch.y;
- }
- if (str == "pos") {
- valid = true;
- return Vector2(ie.screen_touch.x, ie.screen_touch.y);
- }
- if (str == "pressed") {
- valid = true;
- return ie.screen_touch.pressed;
- }
- }
-
- if (ie.type == InputEvent::SCREEN_DRAG) {
-
- if (str == "index") {
- valid = true;
- return ie.screen_drag.index;
- }
- if (str == "x") {
- valid = true;
- return ie.screen_drag.x;
- }
- if (str == "y") {
- valid = true;
- return ie.screen_drag.y;
- }
- if (str == "pos") {
- valid = true;
- return Vector2(ie.screen_drag.x, ie.screen_drag.y);
- }
- if (str == "relative_x") {
- valid = true;
- return ie.screen_drag.relative_x;
- }
- if (str == "relative_y") {
- valid = true;
- return ie.screen_drag.relative_y;
- }
- if (str == "relative_pos") {
- valid = true;
- return Vector2(ie.screen_drag.relative_x, ie.screen_drag.relative_y);
- }
- if (str == "speed_x") {
- valid = true;
- return ie.screen_drag.speed_x;
- }
- if (str == "speed_y") {
- valid = true;
- return ie.screen_drag.speed_y;
- }
- if (str == "speed") {
- valid = true;
- return Vector2(ie.screen_drag.speed_x, ie.screen_drag.speed_y);
- }
- }
- if (ie.type == InputEvent::ACTION) {
-
- if (str == "action") {
- valid = true;
- return ie.action.action;
- } else if (str == "pressed") {
- valid = true;
- return ie.action.pressed;
- }
- }
-
- } break;
case DICTIONARY: {
const Dictionary *dic = reinterpret_cast<const Dictionary *>(_data._mem);
@@ -2503,13 +1876,13 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
valid = true;
return *res;
}
- } break; // 20
- DEFAULT_OP_ARRAY_CMD(ARRAY, const Array, ;, return (*arr)[index])
+ } break;
+ DEFAULT_OP_ARRAY_CMD(ARRAY, const Array, ;, return (*arr)[index]) // 20
DEFAULT_OP_DVECTOR_GET(POOL_BYTE_ARRAY, uint8_t)
DEFAULT_OP_DVECTOR_GET(POOL_INT_ARRAY, int)
DEFAULT_OP_DVECTOR_GET(POOL_REAL_ARRAY, real_t)
DEFAULT_OP_DVECTOR_GET(POOL_STRING_ARRAY, String)
- DEFAULT_OP_DVECTOR_GET(POOL_VECTOR2_ARRAY, Vector2)
+ DEFAULT_OP_DVECTOR_GET(POOL_VECTOR2_ARRAY, Vector2) // 25
DEFAULT_OP_DVECTOR_GET(POOL_VECTOR3_ARRAY, Vector3)
DEFAULT_OP_DVECTOR_GET(POOL_COLOR_ARRAY, Color)
default: return Variant();
@@ -2732,13 +2105,11 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::REAL, "x"));
p_list->push_back(PropertyInfo(Variant::REAL, "y"));
- p_list->push_back(PropertyInfo(Variant::REAL, "width"));
- p_list->push_back(PropertyInfo(Variant::REAL, "height"));
} break; // 5
case RECT2: {
- p_list->push_back(PropertyInfo(Variant::VECTOR2, "pos"));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2, "position"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "size"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "end"));
@@ -2754,7 +2125,7 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::VECTOR2, "x"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "y"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2, "o"));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2, "origin"));
} break;
case PLANE: {
@@ -2773,12 +2144,12 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::REAL, "z"));
p_list->push_back(PropertyInfo(Variant::REAL, "w"));
- } break;
+ } break; // 10
case RECT3: {
- p_list->push_back(PropertyInfo(Variant::VECTOR3, "pos"));
+ p_list->push_back(PropertyInfo(Variant::VECTOR3, "position"));
p_list->push_back(PropertyInfo(Variant::VECTOR3, "size"));
p_list->push_back(PropertyInfo(Variant::VECTOR3, "end"));
- } break; //sorry naming convention fail :( not like it's used often // 10
+ } break;
case BASIS: {
p_list->push_back(PropertyInfo(Variant::VECTOR3, "x"));
@@ -2806,8 +2177,6 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::INT, "a8"));
} break;
- case IMAGE: {
- } break;
case NODE_PATH: {
} break; // 15
case _RID: {
@@ -2830,94 +2199,6 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
}
} break;
- case INPUT_EVENT: {
-
- InputEvent ie = operator InputEvent();
-
- p_list->push_back(PropertyInfo(Variant::INT, "type"));
- p_list->push_back(PropertyInfo(Variant::INT, "device"));
- p_list->push_back(PropertyInfo(Variant::INT, "ID"));
-
- if (ie.type == InputEvent::KEY || ie.type == InputEvent::MOUSE_BUTTON || ie.type == InputEvent::MOUSE_MOTION) {
-
- p_list->push_back(PropertyInfo(Variant::BOOL, "shift"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "alt"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "control"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "meta"));
- }
-
- if (ie.type == InputEvent::KEY) {
-
- p_list->push_back(PropertyInfo(Variant::BOOL, "pressed"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "echo"));
- p_list->push_back(PropertyInfo(Variant::INT, "scancode"));
- p_list->push_back(PropertyInfo(Variant::INT, "unicode"));
- }
-
- if (ie.type == InputEvent::MOUSE_MOTION || ie.type == InputEvent::MOUSE_BUTTON) {
-
- p_list->push_back(PropertyInfo(Variant::INT, "button_mask"));
- p_list->push_back(PropertyInfo(Variant::REAL, "x"));
- p_list->push_back(PropertyInfo(Variant::REAL, "y"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2, "pos"));
- p_list->push_back(PropertyInfo(Variant::REAL, "global_x"));
- p_list->push_back(PropertyInfo(Variant::REAL, "global_y"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2, "global_pos"));
-
- if (ie.type == InputEvent::MOUSE_MOTION) {
-
- p_list->push_back(PropertyInfo(Variant::REAL, "relative_x"));
- p_list->push_back(PropertyInfo(Variant::REAL, "relative_y"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2, "relative_pos"));
- p_list->push_back(PropertyInfo(Variant::REAL, "speed_x"));
- p_list->push_back(PropertyInfo(Variant::REAL, "speed_y"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2, "speed"));
-
- } else if (ie.type == InputEvent::MOUSE_BUTTON) {
-
- p_list->push_back(PropertyInfo(Variant::INT, "button_index"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "pressed"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "doubleclick"));
- }
- }
-
- if (ie.type == InputEvent::JOYPAD_BUTTON) {
-
- p_list->push_back(PropertyInfo(Variant::INT, "button_index"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "pressed"));
- p_list->push_back(PropertyInfo(Variant::REAL, "pressure"));
- }
-
- if (ie.type == InputEvent::JOYPAD_MOTION) {
-
- p_list->push_back(PropertyInfo(Variant::INT, "axis"));
- p_list->push_back(PropertyInfo(Variant::REAL, "value"));
- }
-
- if (ie.type == InputEvent::SCREEN_TOUCH) {
-
- p_list->push_back(PropertyInfo(Variant::INT, "index"));
- p_list->push_back(PropertyInfo(Variant::REAL, "x"));
- p_list->push_back(PropertyInfo(Variant::REAL, "y"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2, "pos"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "pressed"));
- }
-
- if (ie.type == InputEvent::SCREEN_DRAG) {
-
- p_list->push_back(PropertyInfo(Variant::INT, "index"));
- p_list->push_back(PropertyInfo(Variant::REAL, "x"));
- p_list->push_back(PropertyInfo(Variant::REAL, "y"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2, "pos"));
- p_list->push_back(PropertyInfo(Variant::REAL, "relative_x"));
- p_list->push_back(PropertyInfo(Variant::REAL, "relative_y"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2, "relative_pos"));
- p_list->push_back(PropertyInfo(Variant::REAL, "speed_x"));
- p_list->push_back(PropertyInfo(Variant::REAL, "speed_y"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2, "speed"));
- }
-
- } break;
case DICTIONARY: {
const Dictionary *dic = reinterpret_cast<const Dictionary *>(_data._mem);
@@ -2928,12 +2209,13 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::STRING, E->get()));
}
}
- } break; // 20
- case ARRAY:
+ } break;
+ case ARRAY: // 20
case POOL_BYTE_ARRAY:
case POOL_INT_ARRAY:
case POOL_REAL_ARRAY:
case POOL_STRING_ARRAY:
+ case POOL_VECTOR2_ARRAY: // 25
case POOL_VECTOR3_ARRAY:
case POOL_COLOR_ARRAY: {
@@ -2952,30 +2234,30 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const {
return _data._int > 0;
} break;
case REAL: {
- r_iter = 0.0;
+ r_iter = 0;
return _data._real > 0.0;
} break;
case VECTOR2: {
- real_t from = reinterpret_cast<const Vector2 *>(_data._mem)->x;
- real_t to = reinterpret_cast<const Vector2 *>(_data._mem)->y;
+ int64_t from = reinterpret_cast<const Vector2 *>(_data._mem)->x;
+ int64_t to = reinterpret_cast<const Vector2 *>(_data._mem)->y;
r_iter = from;
return from < to;
} break;
case VECTOR3: {
- real_t from = reinterpret_cast<const Vector3 *>(_data._mem)->x;
- real_t to = reinterpret_cast<const Vector3 *>(_data._mem)->y;
- real_t step = reinterpret_cast<const Vector3 *>(_data._mem)->z;
+ int64_t from = reinterpret_cast<const Vector3 *>(_data._mem)->x;
+ int64_t to = reinterpret_cast<const Vector3 *>(_data._mem)->y;
+ int64_t step = reinterpret_cast<const Vector3 *>(_data._mem)->z;
r_iter = from;
if (from == to) {
return false;
} else if (from < to) {
- return step > 0.0;
+ return step > 0;
} else {
- return step < 0.0;
+ return step < 0;
}
//return true;
} break;
@@ -3103,7 +2385,6 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const {
valid = true;
switch (type) {
case INT: {
-
int64_t idx = r_iter;
idx++;
if (idx >= _data._int)
@@ -3112,33 +2393,36 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const {
return true;
} break;
case REAL: {
-
- double idx = r_iter;
- idx += 1.0;
+ int64_t idx = r_iter;
+ idx++;
if (idx >= _data._real)
return false;
r_iter = idx;
return true;
} break;
case VECTOR2: {
- real_t idx = r_iter;
- idx += 1.0;
- if (idx >= reinterpret_cast<const Vector2 *>(_data._mem)->y)
+ int64_t to = reinterpret_cast<const Vector3 *>(_data._mem)->y;
+
+ int64_t idx = r_iter;
+ idx++;
+
+ if (idx >= to)
return false;
+
r_iter = idx;
return true;
} break;
case VECTOR3: {
- real_t to = reinterpret_cast<const Vector3 *>(_data._mem)->y;
- real_t step = reinterpret_cast<const Vector3 *>(_data._mem)->z;
+ int64_t to = reinterpret_cast<const Vector3 *>(_data._mem)->y;
+ int64_t step = reinterpret_cast<const Vector3 *>(_data._mem)->z;
- real_t idx = r_iter;
+ int64_t idx = r_iter;
idx += step;
- if (step < 0.0 && idx <= to)
+ if (step < 0 && idx <= to)
return false;
- if (step > 0.0 && idx >= to)
+ if (step > 0 && idx >= to)
return false;
r_iter = idx;
@@ -3475,7 +2759,7 @@ void Variant::blend(const Variant &a, const Variant &b, float c, Variant &r_dst)
case RECT2: {
const Rect2 *ra = reinterpret_cast<const Rect2 *>(a._data._mem);
const Rect2 *rb = reinterpret_cast<const Rect2 *>(b._data._mem);
- r_dst = Rect2(ra->pos + rb->pos * c, ra->size + rb->size * c);
+ r_dst = Rect2(ra->position + rb->position * c, ra->size + rb->size * c);
}
return;
case VECTOR3: {
@@ -3485,7 +2769,7 @@ void Variant::blend(const Variant &a, const Variant &b, float c, Variant &r_dst)
case RECT3: {
const Rect3 *ra = reinterpret_cast<const Rect3 *>(a._data._mem);
const Rect3 *rb = reinterpret_cast<const Rect3 *>(b._data._mem);
- r_dst = Rect3(ra->pos + rb->pos * c, ra->size + rb->size * c);
+ r_dst = Rect3(ra->position + rb->position * c, ra->size + rb->size * c);
}
return;
case QUAT: {
@@ -3595,7 +2879,7 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant &
}
return;
case RECT2: {
- r_dst = Rect2(reinterpret_cast<const Rect2 *>(a._data._mem)->pos.linear_interpolate(reinterpret_cast<const Rect2 *>(b._data._mem)->pos, c), reinterpret_cast<const Rect2 *>(a._data._mem)->size.linear_interpolate(reinterpret_cast<const Rect2 *>(b._data._mem)->size, c));
+ r_dst = Rect2(reinterpret_cast<const Rect2 *>(a._data._mem)->position.linear_interpolate(reinterpret_cast<const Rect2 *>(b._data._mem)->position, c), reinterpret_cast<const Rect2 *>(a._data._mem)->size.linear_interpolate(reinterpret_cast<const Rect2 *>(b._data._mem)->size, c));
}
return;
case VECTOR3: {
@@ -3615,7 +2899,7 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant &
}
return;
case RECT3: {
- r_dst = Rect3(a._data._rect3->pos.linear_interpolate(b._data._rect3->pos, c), a._data._rect3->size.linear_interpolate(b._data._rect3->size, c));
+ r_dst = Rect3(a._data._rect3->position.linear_interpolate(b._data._rect3->position, c), a._data._rect3->size.linear_interpolate(b._data._rect3->size, c));
}
return;
case BASIS: {
@@ -3630,10 +2914,6 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant &
r_dst = reinterpret_cast<const Color *>(a._data._mem)->linear_interpolate(*reinterpret_cast<const Color *>(b._data._mem), c);
}
return;
- case IMAGE: {
- r_dst = a;
- }
- return;
case NODE_PATH: {
r_dst = a;
}
@@ -3646,10 +2926,6 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant &
r_dst = a;
}
return;
- case INPUT_EVENT: {
- r_dst = a;
- }
- return;
case DICTIONARY: {
}
return;
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp
index 67e4673ad6..398f20caf3 100644
--- a/core/variant_parser.cpp
+++ b/core/variant_parser.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,7 @@
#include "variant_parser.h"
#include "io/resource_loader.h"
+#include "os/input_event.h"
#include "os/keyboard.h"
CharType VariantParser::StreamFile::get_char() {
@@ -408,7 +410,7 @@ Error VariantParser::_parse_enginecfg(Stream *p_stream, Vector<String> &strings,
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";
+ r_err_str = "Expected '(' in old-style project.godot construct";
return ERR_PARSE_ERROR;
}
@@ -419,7 +421,7 @@ Error VariantParser::_parse_enginecfg(Stream *p_stream, Vector<String> &strings,
CharType c = p_stream->get_char();
if (p_stream->is_eof()) {
- r_err_str = "Unexpected EOF while parsing old-style godot.cfg construct";
+ r_err_str = "Unexpected EOF while parsing old-style project.godot construct";
return ERR_PARSE_ERROR;
}
@@ -503,39 +505,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
return OK;
} else if (token.type == TK_IDENTIFIER) {
- /*
- VECTOR2, // 5
- RECT2,
- VECTOR3,
- MATRIX32,
- PLANE,
- QUAT, // 10
- _AABB, //sorry naming convention fail :( not like it's used often
- MATRIX3,
- TRANSFORM,
- // misc types
- COLOR,
- IMAGE, // 15
- NODE_PATH,
- _RID,
- OBJECT,
- INPUT_EVENT,
- DICTIONARY, // 20
- ARRAY,
-
- // arrays
- RAW_ARRAY,
- INT_ARRAY,
- REAL_ARRAY,
- STRING_ARRAY, // 25
- VECTOR2_ARRAY,
- VECTOR3_ARRAY,
- COLOR_ARRAY,
-
- VARIANT_MAX
-
-*/
String id = token.value;
if (id == "true")
value = true;
@@ -680,9 +650,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
value = Color(args[0], args[1], args[2], args[3]);
return OK;
- } else if (id == "Image") {
-
- //:|
+ } else if (id == "NodePath") {
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_PARENTHESIS_OPEN) {
@@ -691,157 +659,143 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
}
get_token(p_stream, token, line, r_err_str);
- if (token.type == TK_PARENTHESIS_CLOSE) {
- value = Image(); // just an Image()
- return OK;
- } else if (token.type != TK_NUMBER) {
- r_err_str = "Expected number (width)";
+ if (token.type != TK_STRING) {
+ r_err_str = "Expected string as argument for NodePath()";
return ERR_PARSE_ERROR;
}
- get_token(p_stream, token, line, r_err_str);
-
- int width = token.value;
- if (token.type != TK_COMMA) {
- r_err_str = "Expected ','";
- return ERR_PARSE_ERROR;
- }
+ value = NodePath(String(token.value));
get_token(p_stream, token, line, r_err_str);
- if (token.type != TK_NUMBER) {
- r_err_str = "Expected number (height)";
+ if (token.type != TK_PARENTHESIS_CLOSE) {
+ r_err_str = "Expected ')'";
return ERR_PARSE_ERROR;
}
- int height = token.value;
+ } else if (id == "RID") {
get_token(p_stream, token, line, r_err_str);
- if (token.type != TK_COMMA) {
- r_err_str = "Expected ','";
+ if (token.type != TK_PARENTHESIS_OPEN) {
+ r_err_str = "Expected '('";
return ERR_PARSE_ERROR;
}
get_token(p_stream, token, line, r_err_str);
+ if (token.type != TK_NUMBER) {
+ r_err_str = "Expected number as argument";
+ return ERR_PARSE_ERROR;
+ }
- bool has_mipmaps = false;
+ value = token.value;
- if (token.type == TK_NUMBER) {
- has_mipmaps = bool(token.value);
- } else if (token.type == TK_IDENTIFIER && String(token.value) == "true") {
- has_mipmaps = true;
- } else if (token.type == TK_IDENTIFIER && String(token.value) == "false") {
- has_mipmaps = false;
- } else {
- r_err_str = "Expected number/true/false (mipmaps)";
+ get_token(p_stream, token, line, r_err_str);
+ if (token.type != TK_PARENTHESIS_CLOSE) {
+ r_err_str = "Expected ')'";
return ERR_PARSE_ERROR;
}
- int mipmaps = token.value;
+ return OK;
+ } else if (id == "Object") {
get_token(p_stream, token, line, r_err_str);
- if (token.type != TK_COMMA) {
- r_err_str = "Expected ','";
+ if (token.type != TK_PARENTHESIS_OPEN) {
+ r_err_str = "Expected '('";
return ERR_PARSE_ERROR;
}
get_token(p_stream, token, line, r_err_str);
+
if (token.type != TK_IDENTIFIER) {
- r_err_str = "Expected identifier (format)";
+ r_err_str = "Expected identifier with type of object";
return ERR_PARSE_ERROR;
}
- String sformat = token.value;
+ String type = token.value;
- Image::Format format = Image::FORMAT_MAX;
-
- for (int i = 0; i < Image::FORMAT_MAX; i++) {
- if (Image::get_format_name(format) == sformat) {
- format = Image::Format(i);
- }
- }
+ Object *obj = ClassDB::instance(type);
- if (format == Image::FORMAT_MAX) {
- r_err_str = "Unknown image format: " + String(sformat);
+ if (!obj) {
+ r_err_str = "Can't instance Object() of type: " + type;
return ERR_PARSE_ERROR;
}
- int len = Image::get_image_data_size(width, height, format, mipmaps);
-
- PoolVector<uint8_t> buffer;
- buffer.resize(len);
-
- if (buffer.size() != len) {
- r_err_str = "Couldn't allocate image buffer of size: " + itos(len);
+ get_token(p_stream, token, line, r_err_str);
+ if (token.type != TK_COMMA) {
+ r_err_str = "Expected ',' after object type";
+ return ERR_PARSE_ERROR;
}
- {
- PoolVector<uint8_t>::Write w = buffer.write();
-
- for (int i = 0; i < len; i++) {
- get_token(p_stream, token, line, r_err_str);
- if (token.type != TK_COMMA) {
- r_err_str = "Expected ','";
- return ERR_PARSE_ERROR;
- }
+ bool at_key = true;
+ String key;
+ Token token;
+ bool need_comma = false;
- get_token(p_stream, token, line, r_err_str);
- if (token.type != TK_NUMBER) {
- r_err_str = "Expected number";
- return ERR_PARSE_ERROR;
- }
+ while (true) {
- w[i] = int(token.value);
+ if (p_stream->is_eof()) {
+ r_err_str = "Unexpected End of File while parsing Object()";
+ return ERR_FILE_CORRUPT;
}
- }
- Image img(width, height, mipmaps, format, buffer);
+ if (at_key) {
- value = img;
+ Error err = get_token(p_stream, token, line, r_err_str);
+ if (err != OK)
+ return err;
- return OK;
+ if (token.type == TK_PARENTHESIS_CLOSE) {
+ Reference *reference = obj->cast_to<Reference>();
+ if (reference) {
+ value = REF(reference);
+ } else {
+ value = obj;
+ }
+ return OK;
+ }
- } else if (id == "NodePath") {
+ if (need_comma) {
- get_token(p_stream, token, line, r_err_str);
- if (token.type != TK_PARENTHESIS_OPEN) {
- r_err_str = "Expected '('";
- return ERR_PARSE_ERROR;
- }
-
- get_token(p_stream, token, line, r_err_str);
- if (token.type != TK_STRING) {
- r_err_str = "Expected string as argument for NodePath()";
- return ERR_PARSE_ERROR;
- }
+ if (token.type != TK_COMMA) {
- value = NodePath(String(token.value));
+ r_err_str = "Expected '}' or ','";
+ return ERR_PARSE_ERROR;
+ } else {
+ need_comma = false;
+ continue;
+ }
+ }
- get_token(p_stream, token, line, r_err_str);
- if (token.type != TK_PARENTHESIS_CLOSE) {
- r_err_str = "Expected ')'";
- return ERR_PARSE_ERROR;
- }
+ if (token.type != TK_STRING) {
+ r_err_str = "Expected property name as string";
+ return ERR_PARSE_ERROR;
+ }
- } else if (id == "RID") {
+ key = token.value;
- get_token(p_stream, token, line, r_err_str);
- if (token.type != TK_PARENTHESIS_OPEN) {
- r_err_str = "Expected '('";
- return ERR_PARSE_ERROR;
- }
+ err = get_token(p_stream, token, line, r_err_str);
- get_token(p_stream, token, line, r_err_str);
- if (token.type != TK_NUMBER) {
- r_err_str = "Expected number as argument";
- return ERR_PARSE_ERROR;
- }
+ if (err != OK)
+ return err;
+ if (token.type != TK_COLON) {
- value = token.value;
+ r_err_str = "Expected ':'";
+ return ERR_PARSE_ERROR;
+ }
+ at_key = false;
+ } else {
- get_token(p_stream, token, line, r_err_str);
- if (token.type != TK_PARENTHESIS_CLOSE) {
- r_err_str = "Expected ')'";
- return ERR_PARSE_ERROR;
+ Error err = get_token(p_stream, token, line, r_err_str);
+ if (err != OK)
+ return err;
+
+ Variant v;
+ err = parse_value(token, v, p_stream, line, r_err_str, p_res_parser);
+ if (err)
+ return err;
+ obj->set(key, v);
+ need_comma = true;
+ at_key = true;
+ }
}
return OK;
@@ -911,7 +865,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
}
return OK;
-
+#ifndef DISABLE_DEPRECATED
} else if (id == "InputEvent") {
get_token(p_stream, token, line, r_err_str);
@@ -929,12 +883,10 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
String id = token.value;
- InputEvent ie;
+ Ref<InputEvent> ie;
if (id == "NONE") {
- ie.type = InputEvent::NONE;
-
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_PARENTHESIS_CLOSE) {
@@ -944,21 +896,23 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
} else if (id == "KEY") {
+ Ref<InputEventKey> key;
+ key.instance();
+ ie = key;
+
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_COMMA) {
r_err_str = "Expected ','";
return ERR_PARSE_ERROR;
}
- ie.type = InputEvent::KEY;
-
get_token(p_stream, token, line, r_err_str);
if (token.type == TK_IDENTIFIER) {
String name = token.value;
- ie.key.scancode = find_keycode(name);
+ key->set_scancode(find_keycode(name));
} else if (token.type == TK_NUMBER) {
- ie.key.scancode = token.value;
+ key->set_scancode(token.value);
} else {
r_err_str = "Expected string or integer for keycode";
@@ -979,13 +933,13 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
String mods = token.value;
if (mods.findn("C") != -1)
- ie.key.mod.control = true;
+ key->set_control(true);
if (mods.findn("A") != -1)
- ie.key.mod.alt = true;
+ key->set_alt(true);
if (mods.findn("S") != -1)
- ie.key.mod.shift = true;
+ key->set_shift(true);
if (mods.findn("M") != -1)
- ie.key.mod.meta = true;
+ key->set_metakey(true);
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_PARENTHESIS_CLOSE) {
@@ -1001,21 +955,23 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
} else if (id == "MBUTTON") {
+ Ref<InputEventMouseButton> mb;
+ mb.instance();
+ ie = mb;
+
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_COMMA) {
r_err_str = "Expected ','";
return ERR_PARSE_ERROR;
}
- ie.type = InputEvent::MOUSE_BUTTON;
-
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_NUMBER) {
r_err_str = "Expected button index";
return ERR_PARSE_ERROR;
}
- ie.mouse_button.button_index = token.value;
+ mb->set_button_index(token.value);
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_PARENTHESIS_CLOSE) {
@@ -1025,21 +981,23 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
} else if (id == "JBUTTON") {
+ Ref<InputEventJoypadButton> jb;
+ jb.instance();
+ ie = jb;
+
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_COMMA) {
r_err_str = "Expected ','";
return ERR_PARSE_ERROR;
}
- ie.type = InputEvent::JOYPAD_BUTTON;
-
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_NUMBER) {
r_err_str = "Expected button index";
return ERR_PARSE_ERROR;
}
- ie.joy_button.button_index = token.value;
+ jb->set_button_index(token.value);
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_PARENTHESIS_CLOSE) {
@@ -1049,21 +1007,23 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
} else if (id == "JAXIS") {
+ Ref<InputEventJoypadMotion> jm;
+ jm.instance();
+ ie = jm;
+
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_COMMA) {
r_err_str = "Expected ','";
return ERR_PARSE_ERROR;
}
- ie.type = InputEvent::JOYPAD_MOTION;
-
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_NUMBER) {
r_err_str = "Expected axis index";
return ERR_PARSE_ERROR;
}
- ie.joy_motion.axis = token.value;
+ jm->set_axis(token.value);
get_token(p_stream, token, line, r_err_str);
@@ -1078,7 +1038,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
return ERR_PARSE_ERROR;
}
- ie.joy_motion.axis_value = token.value;
+ jm->set_axis_value(token.value);
get_token(p_stream, token, line, r_err_str);
@@ -1096,7 +1056,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
value = ie;
return OK;
-
+#endif
} else if (id == "PoolByteArray" || id == "ByteArray") {
Vector<uint8_t> args;
@@ -1139,7 +1099,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
return OK;
- } else if (id == "PoolFloatArray" || id == "FloatArray") {
+ } else if (id == "PoolRealArray" || id == "FloatArray") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
@@ -1272,152 +1232,11 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
value = arr;
return OK;
- } else if (id == "key") { // compatibility with godot.cfg
-
- Vector<String> params;
- Error err = _parse_enginecfg(p_stream, params, line, r_err_str);
- if (err)
- return err;
- ERR_FAIL_COND_V(params.size() != 1 && params.size() != 2, ERR_PARSE_ERROR);
-
- int scode = 0;
-
- if (params[0].is_numeric()) {
- scode = params[0].to_int();
- if (scode < 10) {
- scode = KEY_0 + scode;
- }
- } else
- scode = find_keycode(params[0]);
-
- InputEvent ie;
- ie.type = InputEvent::KEY;
- ie.key.scancode = scode;
-
- if (params.size() == 2) {
- String mods = params[1];
- if (mods.findn("C") != -1)
- ie.key.mod.control = true;
- if (mods.findn("A") != -1)
- ie.key.mod.alt = true;
- if (mods.findn("S") != -1)
- ie.key.mod.shift = true;
- if (mods.findn("M") != -1)
- ie.key.mod.meta = true;
- }
- value = ie;
- return OK;
-
- } else if (id == "mbutton") { // compatibility with godot.cfg
-
- Vector<String> params;
- Error err = _parse_enginecfg(p_stream, params, line, r_err_str);
- if (err)
- return err;
- ERR_FAIL_COND_V(params.size() != 2, ERR_PARSE_ERROR);
-
- InputEvent ie;
- ie.type = InputEvent::MOUSE_BUTTON;
- ie.device = params[0].to_int();
- ie.mouse_button.button_index = params[1].to_int();
-
- value = ie;
- return OK;
- } else if (id == "jbutton") { // compatibility with godot.cfg
-
- Vector<String> params;
- Error err = _parse_enginecfg(p_stream, params, line, r_err_str);
- if (err)
- return err;
- ERR_FAIL_COND_V(params.size() != 2, ERR_PARSE_ERROR);
- InputEvent ie;
- ie.type = InputEvent::JOYPAD_BUTTON;
- ie.device = params[0].to_int();
- ie.joy_button.button_index = params[1].to_int();
-
- value = ie;
-
- return OK;
- } else if (id == "jaxis") { // compatibility with godot.cfg
-
- Vector<String> params;
- Error err = _parse_enginecfg(p_stream, params, line, r_err_str);
- if (err)
- return err;
- ERR_FAIL_COND_V(params.size() != 2, ERR_PARSE_ERROR);
-
- InputEvent ie;
- ie.type = InputEvent::JOYPAD_MOTION;
- ie.device = params[0].to_int();
- int axis = params[1].to_int();
- ie.joy_motion.axis = axis >> 1;
- ie.joy_motion.axis_value = axis & 1 ? 1 : -1;
-
- value = ie;
-
- return OK;
- } else if (id == "img") { // compatibility with godot.cfg
-
- 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";
- return ERR_PARSE_ERROR;
- }
-
- while (true) {
- CharType c = p_stream->get_char();
- if (p_stream->is_eof()) {
- r_err_str = "Unexpected EOF in old style godot.cfg img()";
- return ERR_PARSE_ERROR;
- }
- if (c == ')')
- break;
- }
-
- value = Image();
-
- return OK;
-
} else {
r_err_str = "Unexpected identifier: '" + id + "'.";
return ERR_PARSE_ERROR;
}
- /*
- VECTOR2, // 5
- RECT2,
- VECTOR3,
- MATRIX32,
- PLANE,
- QUAT, // 10
- _AABB, //sorry naming convention fail :( not like it's used often
- MATRIX3,
- TRANSFORM,
-
- // misc types
- COLOR,
- IMAGE, // 15
- NODE_PATH,
- _RID,
- OBJECT,
- INPUT_EVENT,
- DICTIONARY, // 20
- ARRAY,
-
- // arrays
- RAW_ARRAY,
- INT_ARRAY,
- REAL_ARRAY,
- STRING_ARRAY, // 25
- VECTOR2_ARRAY,
- VECTOR3_ARRAY,
- COLOR_ARRAY,
-
- VARIANT_MAX
-
- */
-
return OK;
} else if (token.type == TK_NUMBER) {
@@ -1801,7 +1620,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
case Variant::RECT2: {
Rect2 aabb = p_variant;
- p_store_string_func(p_store_string_ud, "Rect2( " + rtosfix(aabb.pos.x) + ", " + rtosfix(aabb.pos.y) + ", " + rtosfix(aabb.size.x) + ", " + rtosfix(aabb.size.y) + " )");
+ p_store_string_func(p_store_string_ud, "Rect2( " + rtosfix(aabb.position.x) + ", " + rtosfix(aabb.position.y) + ", " + rtosfix(aabb.size.x) + ", " + rtosfix(aabb.size.y) + " )");
} break;
case Variant::VECTOR3: {
@@ -1818,7 +1637,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
case Variant::RECT3: {
Rect3 aabb = p_variant;
- p_store_string_func(p_store_string_ud, "Rect3( " + rtosfix(aabb.pos.x) + ", " + rtosfix(aabb.pos.y) + ", " + rtosfix(aabb.pos.z) + ", " + rtosfix(aabb.size.x) + ", " + rtosfix(aabb.size.y) + ", " + rtosfix(aabb.size.z) + " )");
+ p_store_string_func(p_store_string_ud, "Rect3( " + rtosfix(aabb.position.x) + ", " + rtosfix(aabb.position.y) + ", " + rtosfix(aabb.position.z) + ", " + rtosfix(aabb.size.x) + ", " + rtosfix(aabb.size.y) + ", " + rtosfix(aabb.size.z) + " )");
} break;
case Variant::QUAT: {
@@ -1885,39 +1704,6 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
p_store_string_func(p_store_string_ud, "Color( " + rtosfix(c.r) + ", " + rtosfix(c.g) + ", " + rtosfix(c.b) + ", " + rtosfix(c.a) + " )");
} break;
- case Variant::IMAGE: {
-
- Image img = p_variant;
-
- if (img.empty()) {
- p_store_string_func(p_store_string_ud, "Image()");
- break;
- }
-
- String imgstr = "Image( ";
- imgstr += itos(img.get_width());
- imgstr += ", " + itos(img.get_height());
- imgstr += ", " + String(img.has_mipmaps() ? "true" : "false");
- imgstr += ", " + Image::get_format_name(img.get_format());
-
- String s;
-
- PoolVector<uint8_t> data = img.get_data();
- int len = data.size();
- PoolVector<uint8_t>::Read r = data.read();
- const uint8_t *ptr = r.ptr();
- for (int i = 0; i < len; i++) {
-
- if (i > 0)
- s += ", ";
- s += itos(ptr[i]);
- }
-
- imgstr += ", ";
- p_store_string_func(p_store_string_ud, imgstr);
- p_store_string_func(p_store_string_ud, s);
- p_store_string_func(p_store_string_ud, " )");
- } break;
case Variant::NODE_PATH: {
String str = p_variant;
@@ -1929,76 +1715,66 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
case Variant::OBJECT: {
- RES res = p_variant;
- if (res.is_null()) {
+ Object *obj = p_variant;
+
+ if (!obj) {
p_store_string_func(p_store_string_ud, "null");
break; // don't save it
}
- String res_text;
+ RES res = p_variant;
+ if (res.is_valid()) {
+ //is resource
+ String res_text;
- if (p_encode_res_func) {
+ //try external function
+ if (p_encode_res_func) {
- res_text = p_encode_res_func(p_encode_res_ud, res);
- }
+ res_text = p_encode_res_func(p_encode_res_ud, res);
+ }
- if (res_text == String() && res->get_path().is_resource_file()) {
+ //try path because it's a file
+ if (res_text == String() && res->get_path().is_resource_file()) {
- //external resource
- String path = res->get_path();
- res_text = "Resource( \"" + path + "\")";
+ //external resource
+ String path = res->get_path();
+ res_text = "Resource( \"" + path + "\")";
+ }
+
+ //could come up with some sort of text
+ if (res_text != String()) {
+ p_store_string_func(p_store_string_ud, res_text);
+ break;
+ }
}
- if (res_text == String())
- res_text = "null";
+ //store as generic object
- p_store_string_func(p_store_string_ud, res_text);
+ p_store_string_func(p_store_string_ud, "Object(" + obj->get_class() + ",");
- } break;
- case Variant::INPUT_EVENT: {
-
- String str = "InputEvent(";
-
- InputEvent ev = p_variant;
- switch (ev.type) {
- case InputEvent::KEY: {
-
- str += "KEY," + itos(ev.key.scancode);
- String mod;
- if (ev.key.mod.alt)
- mod += "A";
- if (ev.key.mod.shift)
- mod += "S";
- if (ev.key.mod.control)
- mod += "C";
- if (ev.key.mod.meta)
- mod += "M";
-
- if (mod != String())
- str += "," + mod;
- } break;
- case InputEvent::MOUSE_BUTTON: {
-
- str += "MBUTTON," + itos(ev.mouse_button.button_index);
- } break;
- case InputEvent::JOYPAD_BUTTON: {
- str += "JBUTTON," + itos(ev.joy_button.button_index);
-
- } break;
- case InputEvent::JOYPAD_MOTION: {
- str += "JAXIS," + itos(ev.joy_motion.axis) + "," + itos(ev.joy_motion.axis_value);
- } break;
- case InputEvent::NONE: {
- str += "NONE";
- } break;
- default: {}
- }
+ List<PropertyInfo> props;
+ obj->get_property_list(&props);
+ bool first = true;
+ for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
+
+ if (E->get().usage & PROPERTY_USAGE_STORAGE || E->get().usage & PROPERTY_USAGE_SCRIPT_VARIABLE) {
+ //must be serialized
+
+ if (first) {
+ first = false;
+ } else {
+ p_store_string_func(p_store_string_ud, ",");
+ }
- str += ")";
+ p_store_string_func(p_store_string_ud, "\"" + E->get().name + "\":");
+ write(obj->get(E->get().name), p_store_string_func, p_store_string_ud, p_encode_res_func, p_encode_res_ud);
+ }
+ }
- p_store_string_func(p_store_string_ud, str); //will be added later
+ p_store_string_func(p_store_string_ud, ")\n");
} break;
+
case Variant::DICTIONARY: {
Dictionary dict = p_variant;
@@ -2079,7 +1855,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
} break;
case Variant::POOL_REAL_ARRAY: {
- p_store_string_func(p_store_string_ud, "PoolFloatArray( ");
+ p_store_string_func(p_store_string_ud, "PoolRealArray( ");
PoolVector<real_t> data = p_variant;
int len = data.size();
PoolVector<real_t>::Read r = data.read();
diff --git a/core/variant_parser.h b/core/variant_parser.h
index 20cc72f20d..acbe0e967f 100644
--- a/core/variant_parser.h
+++ b/core/variant_parser.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/core/vector.h b/core/vector.h
index b7b6b92ed0..9f523c567c 100644
--- a/core/vector.h
+++ b/core/vector.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -116,7 +117,7 @@ public:
}
_FORCE_INLINE_ bool empty() const { return _ptr == 0; }
Error resize(int p_size);
- bool push_back(T p_elem);
+ bool push_back(const T &p_elem);
void remove(int p_index);
void erase(const T &p_val) {
@@ -128,15 +129,12 @@ public:
template <class T_val>
int find(const T_val &p_val, int p_from = 0) const;
- void set(int p_index, T p_elem);
+ void set(int p_index, const T &p_elem);
T get(int p_index) const;
inline T &operator[](int p_index) {
- if (p_index < 0 || p_index >= size()) {
- T &aux = *((T *)0); //nullreturn
- ERR_FAIL_COND_V(p_index < 0 || p_index >= size(), aux);
- }
+ CRASH_BAD_INDEX(p_index, size());
_copy_on_write(); // wants to write, so copy on write.
@@ -145,10 +143,8 @@ public:
inline const T &operator[](int p_index) const {
- if (p_index < 0 || p_index >= size()) {
- const T &aux = *((T *)0); //nullreturn
- ERR_FAIL_COND_V(p_index < 0 || p_index >= size(), aux);
- }
+ CRASH_BAD_INDEX(p_index, size());
+
// no cow needed, since it's reading
return _get_data()[p_index];
}
@@ -340,7 +336,7 @@ void Vector<T>::invert() {
}
template <class T>
-void Vector<T>::set(int p_index, T p_elem) {
+void Vector<T>::set(int p_index, const T &p_elem) {
operator[](p_index) = p_elem;
}
@@ -352,7 +348,7 @@ T Vector<T>::get(int p_index) const {
}
template <class T>
-bool Vector<T>::push_back(T p_elem) {
+bool Vector<T>::push_back(const T &p_elem) {
Error err = resize(size() + 1);
ERR_FAIL_COND_V(err, true)
diff --git a/core/version.h b/core/version.h
new file mode 100644
index 0000000000..43f6f1bbf9
--- /dev/null
+++ b/core/version.h
@@ -0,0 +1,37 @@
+/*************************************************************************/
+/* version.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "version_generated.gen.h"
+
+#ifdef VERSION_PATCH
+#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." _MKSTR(VERSION_PATCH) "." _MKSTR(VERSION_STATUS) "." _MKSTR(VERSION_REVISION)
+#else
+#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." _MKSTR(VERSION_STATUS) "." _MKSTR(VERSION_REVISION)
+#endif // VERSION_PATCH
+#define VERSION_FULL_NAME "" _MKSTR(VERSION_NAME) " v" VERSION_MKSTRING
diff --git a/core/vmap.h b/core/vmap.h
index 8446015568..66f935f58d 100644
--- a/core/vmap.h
+++ b/core/vmap.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -179,10 +180,8 @@ public:
inline const V &operator[](const T &p_key) const {
int pos = _find_exact(p_key);
- if (pos < 0) {
- const T &aux = *((T *)0); //nullreturn
- ERR_FAIL_COND_V(pos < 1, aux);
- }
+
+ CRASH_COND(pos < 0);
return _data[pos].value;
}
diff --git a/core/vset.h b/core/vset.h
index e7e204115f..73062e064c 100644
--- a/core/vset.h
+++ b/core/vset.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/doc/Makefile b/doc/Makefile
index d59c77063b..4914c657d2 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -8,25 +8,11 @@ TOOLSDIR = $(BASEDIR)/tools
clean:
rm -rf $(OUTPUTDIR)
-doku:
- rm -rf $(OUTPUTDIR)/doku
- mkdir -p $(OUTPUTDIR)/doku
- pushd $(OUTPUTDIR)/doku
- python2 $(TOOLSDIR)/makedoku.py $(CLASSES)
- popd
-
doxygen:
rm -rf $(OUTPUTDIR)/doxygen
mkdir -p $(OUTPUTDIR)/doxygen
doxygen Doxyfile
-html:
- rm -rf $(OUTPUTDIR)/html
- mkdir -p $(OUTPUTDIR)/html
- pushd $(OUTPUTDIR)/html
- python2 $(TOOLSDIR)/makehtml.py -multipage $(CLASSES)
- popd
-
markdown:
rm -rf $(OUTPUTDIR)/markdown
mkdir -p $(OUTPUTDIR)/markdown
@@ -40,8 +26,3 @@ rst:
pushd $(OUTPUTDIR)/rst
python2 $(TOOLSDIR)/makerst.py $(CLASSES)
popd
-
-textile:
- rm -rf $(OUTPUTDIR)/textile
- mkdir -p $(OUTPUTDIR)/textile
- python3 $(TOOLSDIR)/makedocs.py --input $(CLASSES) --output $(OUTPUTDIR)/textile
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index 3881197ec9..e9902badea 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<doc version="2.2.alpha.custom_build" name="Engine Types">
+<doc version="3.0.alpha.custom_build" name="Engine Types">
<class name="@GDScript" category="Core">
<brief_description>
Built-in GDScript functions.
@@ -23,13 +23,23 @@
Make a color from red, green, blue and alpha. Arguments can range from 0 to 255.
</description>
</method>
+ <method name="ColorN">
+ <return type="Color">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <argument index="1" name="alpha" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="abs">
<return type="float">
</return>
<argument index="0" name="s" type="float">
</argument>
<description>
- Remove sign (works for integer and float).
+ Returns the absolute value of parameter s (i.e. unsigned value, works for integer and float).
</description>
</method>
<method name="acos">
@@ -38,7 +48,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Arc-cosine.
+ Returns the principal value of the arc cosine of s, expressed in radians. In trigonometrics, arc cosine is the inverse operation of cosine.
</description>
</method>
<method name="asin">
@@ -47,7 +57,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Arc-sine.
+ Returns the principal value of the arc sine of s, expressed in radians. In trigonometrics, arc sine is the inverse operation of sine.
</description>
</method>
<method name="assert">
@@ -65,7 +75,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Arc-tangent.
+ Returns the principal value of the arc tangent of s, expressed in radians. In trigonometrics, arc tangent is the inverse operation of tangent. Notice that because of the sign ambiguity, the function cannot determine with certainty in which quadrant the angle falls only by its tangent value. See [method atan2] for an alternative that takes a fractional argument instead.
</description>
</method>
<method name="atan2">
@@ -76,13 +86,13 @@
<argument index="1" name="y" type="float">
</argument>
<description>
- Arc-tangent that takes a 2D vector as argument, returns the full -pi to +pi range.
+ Returns the principal value of the arc tangent of y/x, expressed in radians. To compute the value, the function takes into account the sign of both arguments in order to determine the quadrant.
</description>
</method>
<method name="bytes2var">
<return type="Variant">
</return>
- <argument index="0" name="bytes" type="RawArray">
+ <argument index="0" name="bytes" type="PoolByteArray">
</argument>
<description>
Decode a byte array back to a value.
@@ -94,7 +104,15 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Ceiling (rounds up to nearest integer).
+ Rounds s upward, returning the smallest integral value that is not less than s.
+ </description>
+ </method>
+ <method name="char">
+ <return type="String">
+ </return>
+ <argument index="0" name="ascii" type="int">
+ </argument>
+ <description>
</description>
</method>
<method name="clamp">
@@ -107,7 +125,7 @@
<argument index="2" name="max" type="float">
</argument>
<description>
- Clamp both values to a range.
+ Clamps a value between a minimum and maximum value.
</description>
</method>
<method name="convert">
@@ -127,7 +145,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Standard cosine function.
+ Returns the cosine of an angle of s radians.
</description>
</method>
<method name="cosh">
@@ -136,7 +154,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Hyperbolic cosine.
+ Returns the hyperbolic cosine of s.
</description>
</method>
<method name="db2linear">
@@ -205,7 +223,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Exponential logarithm.
+ Returns the base-e exponential function of s, which is e raised to the power s: e^s.
</description>
</method>
<method name="floor">
@@ -214,7 +232,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Floor (rounds down to nearest integer).
+ Rounds s downward, returning the largest integral value that is not greater than s.
</description>
</method>
<method name="fmod">
@@ -225,7 +243,11 @@
<argument index="1" name="y" type="float">
</argument>
<description>
- Module (remainder of x/y).
+ Returns the floating-point remainder of x/y (rounded towards zero):
+ [codeblock]
+ fmod = x - tquot * y
+ [/codeblock]
+ Where tquot is the truncated (i.e., rounded towards zero) result of: x/y.
</description>
</method>
<method name="fposmod">
@@ -283,6 +305,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
+ Returns whether s is an infinity value (either positive infinity or negative infinity).
</description>
</method>
<method name="is_nan">
@@ -291,6 +314,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
+ Returns whether s is a NaN (Not-A-Number) value.
</description>
</method>
<method name="lerp">
@@ -364,6 +388,16 @@
Return the nearest larger power of 2 for an integer.
</description>
</method>
+ <method name="parse_json">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="json" type="String">
+ </argument>
+ <description>
+ Parse JSON text to a Variant (use [method typeof] to check if it is what you expect).
+ Be aware that the JSON specification does not define integer or float types, but only a number type. Therefore, parsing a JSON text will convert every numerical values to [float] types.
+ </description>
+ </method>
<method name="pow">
<return type="float">
</return>
@@ -511,7 +545,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Round to nearest integer.
+ Returns the integral value that is nearest to s, with halfway cases rounded away from zero.
</description>
</method>
<method name="seed">
@@ -538,7 +572,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Standard sine function.
+ Returns the sine of an angle of s radians.
</description>
</method>
<method name="sinh">
@@ -547,7 +581,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Hyperbolic sine.
+ Returns the hyperbolic sine of s.
</description>
</method>
<method name="sqrt">
@@ -556,7 +590,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Square root.
+ Returns the square root of s.
</description>
</method>
<method name="stepify">
@@ -578,7 +612,7 @@
<argument index="1" name="..." type="Variant">
</argument>
<description>
- Convert one or more arguments to strings in the best way possible.
+ Convert one or more arguments to string in the best way possible.
</description>
</method>
<method name="str2var">
@@ -596,7 +630,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Standard tangent function.
+ Returns the tangent of an angle of s radians.
</description>
</method>
<method name="tanh">
@@ -605,7 +639,16 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Hyperbolic tangent.
+ Returns the hyperbolic tangent of s.
+ </description>
+ </method>
+ <method name="to_json">
+ <return type="String">
+ </return>
+ <argument index="0" name="var:Variant" type="Variant">
+ </argument>
+ <description>
+ Convert a Variant to json text.
</description>
</method>
<method name="type_exists">
@@ -625,8 +668,17 @@
Return the internal type of the given Variant object, using the TYPE_* enum in [@Global Scope].
</description>
</method>
+ <method name="validate_json">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="json" type="String">
+ </argument>
+ <description>
+ This method is used to validate the structure and data types of a piece of JSON, similar to XML Schema for XML.
+ </description>
+ </method>
<method name="var2bytes">
- <return type="RawArray">
+ <return type="PoolByteArray">
</return>
<argument index="0" name="var" type="Variant">
</argument>
@@ -650,6 +702,7 @@
</argument>
<description>
Return a weak reference to an object.
+ A weak reference to an object is not enough to keep the object alive: when the only remaining references to a referent are weak references, garbage collection is free to destroy the referent and reuse its memory for something else. However, until the object is actually destroyed the weak reference may return the object even if there are no strong references to it.
</description>
</method>
<method name="yield">
@@ -669,6 +722,13 @@
<constant name="PI" value="3.141593">
Constant that represents how many times the diameter of a circumference fits around its perimeter.
</constant>
+ <constant name="INF" value="inf">
+ A positive infinity. (For negative infinity, use -INF).
+ </constant>
+ <constant name="NAN" value="nan">
+ Macro constant that expands to an expression of type float that represents a NaN.
+ The NaN values are used to identify undefined or non-representable values for floating-point elements, such as the square root of negative numbers or the result of 0/0.
+ </constant>
</constants>
</class>
<class name="@Global Scope" category="Core">
@@ -682,79 +742,55 @@
<methods>
</methods>
<members>
- <member name="AS" type="AudioServer">
+ <member name="AudioServer" type="AudioServer" setter="" getter="" brief="">
[AudioServer] singleton
</member>
- <member name="AudioServer" type="AudioServer">
- [AudioServer] singleton
+ <member name="ClassDB" type="ClassDB" setter="" getter="" brief="">
+ [ClassDB] singleton
</member>
- <member name="Geometry" type="Geometry">
+ <member name="Engine" type="Engine" setter="" getter="" brief="">
+ [Engine] singleton
+ </member>
+ <member name="Geometry" type="Geometry" setter="" getter="" brief="">
[Geometry] singleton
</member>
- <member name="Globals" type="Globals">
- [Globals] singleton
+ <member name="ProjectSettings" type="ProjectSettings" setter="" getter="" brief="">
+ [ProjectSettings] singleton
</member>
- <member name="IP" type="IP">
+ <member name="IP" type="IP" setter="" getter="" brief="">
[IP] singleton
</member>
- <member name="Input" type="Input">
+ <member name="Input" type="Input" setter="" getter="" brief="">
[Input] singleton
</member>
- <member name="InputMap" type="InputMap">
+ <member name="InputMap" type="InputMap" setter="" getter="" brief="">
[InputMap] singleton
</member>
- <member name="Marshalls" type="Reference">
+ <member name="Marshalls" type="Reference" setter="" getter="" brief="">
[Marshalls] singleton
</member>
- <member name="OS" type="OS">
+ <member name="OS" type="OS" setter="" getter="" brief="">
[OS] singleton
</member>
- <member name="PS" type="PhysicsServer">
- [PhysicsServer] singleton
- </member>
- <member name="PS2D" type="Physics2DServer">
- [Physics2DServer] singleton
- </member>
- <member name="PathRemap" type="PathRemap">
- [PathRemap] singleton
- </member>
- <member name="Performance" type="Performance">
+ <member name="Performance" type="Performance" setter="" getter="" brief="">
[Performance] singleton
</member>
- <member name="Physics2DServer" type="Physics2DServer">
+ <member name="Physics2DServer" type="Physics2DServer" setter="" getter="" brief="">
[Physics2DServer] singleton
</member>
- <member name="PhysicsServer" type="PhysicsServer">
+ <member name="PhysicsServer" type="PhysicsServer" setter="" getter="" brief="">
[PhysicsServer] singleton
</member>
- <member name="ResourceLoader" type="ResourceLoader">
+ <member name="ResourceLoader" type="ResourceLoader" setter="" getter="" brief="">
[ResourceLoader] singleton
</member>
- <member name="ResourceSaver" type="ResourceSaver">
+ <member name="ResourceSaver" type="ResourceSaver" setter="" getter="" brief="">
[ResourceSaver] singleton
</member>
- <member name="SS" type="SpatialSoundServer">
- [SpatialSoundServer] singleton
- </member>
- <member name="SS2D" type="SpatialSound2DServer">
- [SpatialSound2DServer] singleton
- </member>
- <member name="SpatialSound2DServer" type="SpatialSound2DServer">
- [SpatialSound2DServer] singleton
- </member>
- <member name="SpatialSoundServer" type="SpatialSoundServer">
- [SpatialSoundServer] singleton
- </member>
- <member name="TS" type="TranslationServer">
+ <member name="TranslationServer" type="TranslationServer" setter="" getter="" brief="">
[TranslationServer] singleton
</member>
- <member name="TranslationServer" type="TranslationServer">
- [TranslationServer] singleton
- </member>
- <member name="VS" type="VisualServer">
- [VisualServer] singleton
- </member>
- <member name="VisualServer" type="VisualServer">
+ <member name="VisualServer" type="VisualServer" setter="" getter="" brief="">
[VisualServer] singleton
</member>
</members>
@@ -810,10 +846,10 @@
<constant name="KEY_BACKSPACE" value="16777220">
Backspace Key
</constant>
- <constant name="KEY_RETURN" value="16777221">
+ <constant name="KEY_ENTER" value="16777221">
Return Key (On Main Keyboard)
</constant>
- <constant name="KEY_ENTER" value="16777222">
+ <constant name="KEY_KP_ENTER" value="16777222">
Enter Key (On Numpad)
</constant>
<constant name="KEY_INSERT" value="16777223">
@@ -924,9 +960,6 @@
<constant name="KEY_F16" value="16777259">
F16 Key
</constant>
- <constant name="KEY_KP_ENTER" value="16777344">
- Enter Key on Numpad
- </constant>
<constant name="KEY_KP_MULTIPLY" value="16777345">
Multiply Key on Numpad
</constant>
@@ -1491,67 +1524,55 @@
<constant name="BUTTON_MASK_MIDDLE" value="4">
</constant>
<constant name="JOY_BUTTON_0" value="0">
- Joystick Button 0
+ Joypad Button 0
</constant>
<constant name="JOY_BUTTON_1" value="1">
- Joystick Button 1
+ Joypad Button 1
</constant>
<constant name="JOY_BUTTON_2" value="2">
- Joystick Button 2
+ Joypad Button 2
</constant>
<constant name="JOY_BUTTON_3" value="3">
- Joystick Button 3
+ Joypad Button 3
</constant>
<constant name="JOY_BUTTON_4" value="4">
- Joystick Button 4
+ Joypad Button 4
</constant>
<constant name="JOY_BUTTON_5" value="5">
- Joystick Button 5
+ Joypad Button 5
</constant>
<constant name="JOY_BUTTON_6" value="6">
- Joystick Button 6
+ Joypad Button 6
</constant>
<constant name="JOY_BUTTON_7" value="7">
- Joystick Button 7
+ Joypad Button 7
</constant>
<constant name="JOY_BUTTON_8" value="8">
- Joystick Button 8
+ Joypad Button 8
</constant>
<constant name="JOY_BUTTON_9" value="9">
- Joystick Button 9
+ Joypad Button 9
</constant>
<constant name="JOY_BUTTON_10" value="10">
- Joystick Button 10
+ Joypad Button 10
</constant>
<constant name="JOY_BUTTON_11" value="11">
- Joystick Button 11
+ Joypad Button 11
</constant>
<constant name="JOY_BUTTON_12" value="12">
- Joystick Button 12
+ Joypad Button 12
</constant>
<constant name="JOY_BUTTON_13" value="13">
- Joystick Button 13
+ Joypad Button 13
</constant>
<constant name="JOY_BUTTON_14" value="14">
- Joystick Button 14
+ Joypad Button 14
</constant>
<constant name="JOY_BUTTON_15" value="15">
- Joystick Button 15
+ Joypad Button 15
</constant>
<constant name="JOY_BUTTON_MAX" value="16">
- Joystick Button 16
- </constant>
- <constant name="JOY_SNES_A" value="1">
- Super Nintendo Entertaiment System controller A button
- </constant>
- <constant name="JOY_SNES_B" value="0">
- Super Nintendo Entertaiment System controller B button
- </constant>
- <constant name="JOY_SNES_X" value="3">
- Super Nintendo Entertaiment System controller X button
- </constant>
- <constant name="JOY_SNES_Y" value="2">
- Super Nintendo Entertaiment System controller Y button
+ Joypad Button 16
</constant>
<constant name="JOY_SONY_CIRCLE" value="1">
DUALSHOCK circle button
@@ -1565,18 +1586,6 @@
<constant name="JOY_SONY_TRIANGLE" value="3">
DUALSHOCK triangle button
</constant>
- <constant name="JOY_SEGA_B" value="1">
- SEGA controller B button
- </constant>
- <constant name="JOY_SEGA_A" value="0">
- SEGA controller A button
- </constant>
- <constant name="JOY_SEGA_X" value="2">
- SEGA controller X button
- </constant>
- <constant name="JOY_SEGA_Y" value="3">
- SEGA controller Y button
- </constant>
<constant name="JOY_XBOX_B" value="1">
XBOX controller B button
</constant>
@@ -1598,80 +1607,76 @@
<constant name="JOY_DS_Y" value="2">
</constant>
<constant name="JOY_SELECT" value="10">
- Joystick Button Select
+ Joypad Button Select
</constant>
<constant name="JOY_START" value="11">
- Joystick Button Start
+ Joypad Button Start
</constant>
<constant name="JOY_DPAD_UP" value="12">
- Joystick DPad Up
+ Joypad DPad Up
</constant>
<constant name="JOY_DPAD_DOWN" value="13">
- Joystick DPad Down
+ Joypad DPad Down
</constant>
<constant name="JOY_DPAD_LEFT" value="14">
- Joystick DPad Left
+ Joypad DPad Left
</constant>
<constant name="JOY_DPAD_RIGHT" value="15">
- Joystick DPad Right
+ Joypad DPad Right
</constant>
<constant name="JOY_L" value="4">
- Joystick Left Shoulder Button
+ Joypad Left Shoulder Button
</constant>
<constant name="JOY_L2" value="6">
- Joystick Left Trigger
+ Joypad Left Trigger
</constant>
<constant name="JOY_L3" value="8">
- Joystick Left Stick Click
+ Joypad Left Stick Click
</constant>
<constant name="JOY_R" value="5">
- Joystick Right Shoulder Button
+ Joypad Right Shoulder Button
</constant>
<constant name="JOY_R2" value="7">
- Joystick Right Trigger
+ Joypad Right Trigger
</constant>
<constant name="JOY_R3" value="9">
- Joystick Right Stick Click
+ Joypad Right Stick Click
</constant>
<constant name="JOY_AXIS_0" value="0">
- Joystick Left Stick Horizontal Axis
+ Joypad Left Stick Horizontal Axis
</constant>
<constant name="JOY_AXIS_1" value="1">
- Joystick Left Stick Vertical Axis
+ Joypad Left Stick Vertical Axis
</constant>
<constant name="JOY_AXIS_2" value="2">
- Joystick Right Stick Horizontal Axis
+ Joypad Right Stick Horizontal Axis
</constant>
<constant name="JOY_AXIS_3" value="3">
- Joystick Right Stick Vertical Axis
+ Joypad Right Stick Vertical Axis
</constant>
<constant name="JOY_AXIS_4" value="4">
</constant>
<constant name="JOY_AXIS_5" value="5">
</constant>
<constant name="JOY_AXIS_6" value="6">
- Joystick Left Trigger Analog Axis
+ Joypad Left Trigger Analog Axis
</constant>
<constant name="JOY_AXIS_7" value="7">
- Joystick Right Trigger Analog Axis
+ Joypad Right Trigger Analog Axis
</constant>
<constant name="JOY_AXIS_MAX" value="8">
</constant>
- <constant name="JOY_ANALOG_0_X" value="0">
- Joystick Left Stick Horizontal Axis
- </constant>
- <constant name="JOY_ANALOG_0_Y" value="1">
- Joystick Left Stick Vertical Axis
+ <constant name="JOY_ANALOG_LX" value="0">
+ Joypad Left Stick Horizontal Axis
</constant>
- <constant name="JOY_ANALOG_1_X" value="2">
- Joystick Right Stick Horizontal Axis
+ <constant name="JOY_ANALOG_LY" value="1">
+ Joypad Left Stick Vertical Axis
</constant>
- <constant name="JOY_ANALOG_1_Y" value="3">
- Joystick Right Stick Vertical Axis
+ <constant name="JOY_ANALOG_RX" value="2">
+ Joypad Right Stick Horizontal Axis
</constant>
- <constant name="JOY_ANALOG_2_X" value="4">
- </constant>
- <constant name="JOY_ANALOG_2_Y" value="5">
+ <constant name="JOY_ANALOG_RY" value="3">
+ Joypad Right Stick Vertical Axis
</constant>
<constant name="JOY_ANALOG_L2" value="6">
</constant>
@@ -1723,7 +1728,7 @@
</constant>
<constant name="ERR_PARSE_ERROR" value="43">
</constant>
- <constant name="ERROR_QUERY_FAILED" value="21">
+ <constant name="ERR_QUERY_FAILED" value="21">
</constant>
<constant name="ERR_ALREADY_IN_USE" value="22">
</constant>
@@ -1784,29 +1789,34 @@
<constant name="PROPERTY_HINT_FLAGS" value="8">
Property hint for a bitmask description, for bits 0,1,2,3 and 5 the hint would be like "Bit0,Bit1,Bit2,Bit3,,Bit5". Valid only for integers.
</constant>
- <constant name="PROPERTY_HINT_ALL_FLAGS" value="9">
- Property hint for a bitmask description that covers all 32 bits. Valid only for integers.
+ <constant name="PROPERTY_HINT_LAYERS_2D_RENDER" value="9">
+ </constant>
+ <constant name="PROPERTY_HINT_LAYERS_2D_PHYSICS" value="10">
</constant>
- <constant name="PROPERTY_HINT_FILE" value="10">
+ <constant name="PROPERTY_HINT_LAYERS_3D_RENDER" value="11">
+ </constant>
+ <constant name="PROPERTY_HINT_LAYERS_3D_PHYSICS" value="12">
+ </constant>
+ <constant name="PROPERTY_HINT_FILE" value="13">
String property is a file (so pop up a file dialog when edited). Hint string can be a set of wildcards like "*.doc".
</constant>
- <constant name="PROPERTY_HINT_DIR" value="11">
+ <constant name="PROPERTY_HINT_DIR" value="14">
String property is a directory (so pop up a file dialog when edited).
</constant>
- <constant name="PROPERTY_HINT_GLOBAL_FILE" value="12">
+ <constant name="PROPERTY_HINT_GLOBAL_FILE" value="15">
</constant>
- <constant name="PROPERTY_HINT_GLOBAL_DIR" value="13">
+ <constant name="PROPERTY_HINT_GLOBAL_DIR" value="16">
</constant>
- <constant name="PROPERTY_HINT_RESOURCE_TYPE" value="14">
+ <constant name="PROPERTY_HINT_RESOURCE_TYPE" value="17">
String property is a resource, so open the resource popup menu when edited.
</constant>
- <constant name="PROPERTY_HINT_MULTILINE_TEXT" value="15">
+ <constant name="PROPERTY_HINT_MULTILINE_TEXT" value="18">
</constant>
- <constant name="PROPERTY_HINT_COLOR_NO_ALPHA" value="16">
+ <constant name="PROPERTY_HINT_COLOR_NO_ALPHA" value="19">
</constant>
- <constant name="PROPERTY_HINT_IMAGE_COMPRESS_LOSSY" value="17">
+ <constant name="PROPERTY_HINT_IMAGE_COMPRESS_LOSSY" value="20">
</constant>
- <constant name="PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS" value="18">
+ <constant name="PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS" value="21">
</constant>
<constant name="PROPERTY_USAGE_STORAGE" value="1">
Property will be used as storage (default).
@@ -1824,7 +1834,7 @@
</constant>
<constant name="PROPERTY_USAGE_INTERNATIONALIZED" value="64">
</constant>
- <constant name="PROPERTY_USAGE_BUNDLE" value="128">
+ <constant name="PROPERTY_USAGE_GROUP" value="128">
</constant>
<constant name="PROPERTY_USAGE_CATEGORY" value="256">
</constant>
@@ -1885,8 +1895,8 @@
<constant name="TYPE_VECTOR3" value="7">
Variable is of type [Vector3].
</constant>
- <constant name="TYPE_MATRIX32" value="8">
- Variable is of type [Matrix32].
+ <constant name="TYPE_TRANSFORM2D" value="8">
+ Variable is of type [Transform2D].
</constant>
<constant name="TYPE_PLANE" value="9">
Variable is of type [Plane].
@@ -1894,11 +1904,11 @@
<constant name="TYPE_QUAT" value="10">
Variable is of type [Quat].
</constant>
- <constant name="TYPE_AABB" value="11">
- Variable is of type [AABB].
+ <constant name="TYPE_RECT3" value="11">
+ Variable is of type [Rect3].
</constant>
- <constant name="TYPE_MATRIX3" value="12">
- Variable is of type [Matrix3].
+ <constant name="TYPE_BASIS" value="12">
+ Variable is of type [Basis].
</constant>
<constant name="TYPE_TRANSFORM" value="13">
Variable is of type [Transform].
@@ -1906,45 +1916,49 @@
<constant name="TYPE_COLOR" value="14">
Variable is of type [Color].
</constant>
- <constant name="TYPE_IMAGE" value="15">
- Variable is of type [Image].
- </constant>
- <constant name="TYPE_NODE_PATH" value="16">
+ <constant name="TYPE_NODE_PATH" value="15">
Variable is of type [NodePath].
</constant>
- <constant name="TYPE_RID" value="17">
+ <constant name="TYPE_RID" value="16">
Variable is of type [RID].
</constant>
- <constant name="TYPE_OBJECT" value="18">
+ <constant name="TYPE_OBJECT" value="17">
Variable is of type [Object].
</constant>
- <constant name="TYPE_INPUT_EVENT" value="19">
- Variable is of type [InputEvent].
- </constant>
- <constant name="TYPE_DICTIONARY" value="20">
+ <constant name="TYPE_DICTIONARY" value="18">
Variable is of type [Dictionary].
</constant>
- <constant name="TYPE_ARRAY" value="21">
+ <constant name="TYPE_ARRAY" value="19">
Variable is of type [Array].
</constant>
- <constant name="TYPE_RAW_ARRAY" value="22">
+ <constant name="TYPE_RAW_ARRAY" value="20">
</constant>
- <constant name="TYPE_INT_ARRAY" value="23">
+ <constant name="TYPE_INT_ARRAY" value="21">
</constant>
- <constant name="TYPE_REAL_ARRAY" value="24">
+ <constant name="TYPE_REAL_ARRAY" value="22">
</constant>
- <constant name="TYPE_STRING_ARRAY" value="25">
+ <constant name="TYPE_STRING_ARRAY" value="23">
</constant>
- <constant name="TYPE_VECTOR2_ARRAY" value="26">
+ <constant name="TYPE_VECTOR2_ARRAY" value="24">
</constant>
- <constant name="TYPE_VECTOR3_ARRAY" value="27">
+ <constant name="TYPE_VECTOR3_ARRAY" value="25">
</constant>
- <constant name="TYPE_COLOR_ARRAY" value="28">
+ <constant name="TYPE_COLOR_ARRAY" value="26">
</constant>
- <constant name="TYPE_MAX" value="29">
+ <constant name="TYPE_MAX" value="27">
</constant>
</constants>
</class>
+<class name="@Native" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
<class name="@VisualScript" category="Core">
<brief_description>
</brief_description>
@@ -1955,210 +1969,31 @@
<constants>
</constants>
</class>
-<class name="AABB" category="Built-In Types">
+<class name="AStar" inherits="Reference" category="Core">
<brief_description>
- Axis-Aligned Bounding Box.
+ AStar class representation that uses vectors as edges.
</brief_description>
<description>
- AABB provides an 3D Axis-Aligned Bounding Box. It consists of a position, a size, and several utility functions. It is typically used for simple (fast) overlap tests.
+ A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting an efficiently directed path between multiple points. It enjoys widespread use due to its performance and accuracy. Godot's A* implementation make use of vectors as points.
+ You must add points manually with [method AStar.add_point] and create segments manually with [method AStar.connect_points]. So you can test if there is a path between two points with the [method AStar.are_points_connected] function, get the list of existing ids in the found path with [method AStar.get_id_path], or the points list with [method AStar.get_point_path].
</description>
<methods>
- <method name="AABB">
- <return type="AABB">
- </return>
- <argument index="0" name="pos" type="Vector3">
- </argument>
- <argument index="1" name="size" type="Vector3">
- </argument>
- <description>
- Optional constructor, accepts position and size.
- </description>
- </method>
- <method name="encloses">
- <return type="bool">
- </return>
- <argument index="0" name="with" type="AABB">
- </argument>
- <description>
- Return true if this [AABB] completely encloses another one.
- </description>
- </method>
- <method name="expand">
- <return type="AABB">
- </return>
- <argument index="0" name="to_point" type="Vector3">
- </argument>
- <description>
- Return this [AABB] expanded to include a given point.
- </description>
- </method>
- <method name="get_area">
- <return type="float">
- </return>
- <description>
- Get the area of the [AABB].
- </description>
- </method>
- <method name="get_endpoint">
- <return type="Vector3">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Get the position of the 8 endpoints of the [AABB] in space.
- </description>
- </method>
- <method name="get_longest_axis">
- <return type="Vector3">
- </return>
- <description>
- Return the normalized longest axis of the [AABB].
- </description>
- </method>
- <method name="get_longest_axis_index">
- <return type="int">
- </return>
- <description>
- Return the index of the longest axis of the [AABB] (according to [Vector3]::AXIS* enum).
- </description>
- </method>
- <method name="get_longest_axis_size">
- <return type="float">
- </return>
- <description>
- Return the scalar length of the longest axis of the [AABB].
- </description>
- </method>
- <method name="get_shortest_axis">
- <return type="Vector3">
- </return>
- <description>
- Return the normalized shortest axis of the [AABB].
- </description>
- </method>
- <method name="get_shortest_axis_index">
- <return type="int">
- </return>
- <description>
- Return the index of the shortest axis of the [AABB] (according to [Vector3]::AXIS* enum).
- </description>
- </method>
- <method name="get_shortest_axis_size">
- <return type="float">
- </return>
- <description>
- Return the scalar length of the shortest axis of the [AABB].
- </description>
- </method>
- <method name="get_support">
- <return type="Vector3">
- </return>
- <argument index="0" name="dir" type="Vector3">
- </argument>
- <description>
- Return the support point in a given direction. This is useful for collision detection algorithms.
- </description>
- </method>
- <method name="grow">
- <return type="AABB">
- </return>
- <argument index="0" name="by" type="float">
- </argument>
- <description>
- Return a copy of the [AABB] grown a given amount of units towards all the sides.
- </description>
- </method>
- <method name="has_no_area">
- <return type="bool">
- </return>
- <description>
- Return true if the [AABB] is flat or empty.
- </description>
- </method>
- <method name="has_no_surface">
- <return type="bool">
- </return>
- <description>
- Return true if the [AABB] is empty.
- </description>
- </method>
- <method name="has_point">
- <return type="bool">
- </return>
- <argument index="0" name="point" type="Vector3">
- </argument>
- <description>
- Return true if the [AABB] contains a point.
- </description>
- </method>
- <method name="intersection">
- <return type="AABB">
- </return>
- <argument index="0" name="with" type="AABB">
- </argument>
- <description>
- Return the intersection between two [AABB]. An empty AABB (size 0,0,0) is returned on failure.
- </description>
- </method>
- <method name="intersects">
- <return type="bool">
- </return>
- <argument index="0" name="with" type="AABB">
+ <method name="_compute_cost" qualifiers="virtual">
+ <argument index="0" name="from_id" type="int">
</argument>
- <description>
- Return true if the [AABB] overlaps with another.
- </description>
- </method>
- <method name="intersects_plane">
- <return type="bool">
- </return>
- <argument index="0" name="plane" type="Plane">
+ <argument index="1" name="to_id" type="int">
</argument>
<description>
- Return true if the [AABB] is at both sides of a plane.
</description>
</method>
- <method name="intersects_segment">
- <return type="bool">
- </return>
- <argument index="0" name="from" type="Vector3">
- </argument>
- <argument index="1" name="to" type="Vector3">
+ <method name="_estimate_cost" qualifiers="virtual">
+ <argument index="0" name="from_id" type="int">
</argument>
- <description>
- Return true if the [AABB] intersects the line segment between from and to
- </description>
- </method>
- <method name="merge">
- <return type="AABB">
- </return>
- <argument index="0" name="with" type="AABB">
+ <argument index="1" name="to_id" type="int">
</argument>
<description>
- Combine this [AABB] with another, a larger one is returned that contains both.
</description>
</method>
- </methods>
- <members>
- <member name="end" type="Vector3">
- Ending corner.
- </member>
- <member name="pos" type="Vector3">
- Position (starting corner).
- </member>
- <member name="size" type="Vector3">
- Size from position to end.
- </member>
- </members>
- <constants>
- </constants>
-</class>
-<class name="AStar" inherits="Reference" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
<method name="add_point">
<argument index="0" name="id" type="int">
</argument>
@@ -2167,6 +2002,7 @@
<argument index="2" name="weight_scale" type="float" default="1">
</argument>
<description>
+ Add a new point at the given position [code]pos[/code] with the given identifier [code]id[/code]. The [code]weight_scale[/code] has to be 1 or larger.
</description>
</method>
<method name="are_points_connected" qualifiers="const">
@@ -2177,10 +2013,12 @@
<argument index="1" name="to_id" type="int">
</argument>
<description>
+ Returns if there is a connection/segment between points [code]id[/code] and [code]from_id[/code]
</description>
</method>
<method name="clear">
<description>
+ Clear all the points and segments from AStar instance.
</description>
</method>
<method name="connect_points">
@@ -2188,7 +2026,10 @@
</argument>
<argument index="1" name="to_id" type="int">
</argument>
+ <argument index="2" name="bidirectional" type="bool" default="true">
+ </argument>
<description>
+ Create a segment between points [code]id[/code] and [code]to_id[/code].
</description>
</method>
<method name="disconnect_points">
@@ -2197,6 +2038,7 @@
<argument index="1" name="to_id" type="int">
</argument>
<description>
+ Deletes a segment between points [code]id[/code] and [code]to_id[/code].
</description>
</method>
<method name="get_available_point_id" qualifiers="const">
@@ -2211,6 +2053,7 @@
<argument index="0" name="to_pos" type="Vector3">
</argument>
<description>
+ Returns the id of closest point of given point. -1 is returned if there are no points on AStar.
</description>
</method>
<method name="get_closest_pos_in_segment" qualifiers="const">
@@ -2219,26 +2062,29 @@
<argument index="0" name="to_pos" type="Vector3">
</argument>
<description>
+ Returns the position of closest point that has segments.
</description>
</method>
<method name="get_id_path">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<argument index="0" name="from_id" type="int">
</argument>
<argument index="1" name="to_id" type="int">
</argument>
<description>
+ Returns an array with the point ids of path found by AStar between two given points.
</description>
</method>
<method name="get_point_path">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<argument index="0" name="from_id" type="int">
</argument>
<argument index="1" name="to_id" type="int">
</argument>
<description>
+ Returns an array with the points of path found by AStar between two given points.
</description>
</method>
<method name="get_point_pos" qualifiers="const">
@@ -2247,6 +2093,7 @@
<argument index="0" name="id" type="int">
</argument>
<description>
+ Returns the position of point with given id.
</description>
</method>
<method name="get_point_weight_scale" qualifiers="const">
@@ -2255,12 +2102,23 @@
<argument index="0" name="id" type="int">
</argument>
<description>
+ Returns the weight scale of point with given id.
+ </description>
+ </method>
+ <method name="has_point" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ Returns if the point with given id exists on AStar;
</description>
</method>
<method name="remove_point">
<argument index="0" name="id" type="int">
</argument>
<description>
+ Removes the point with given id.
</description>
</method>
</methods>
@@ -2335,12 +2193,6 @@
Register a [LineEdit] in the dialog. When the enter key is pressed, the dialog will be accepted.
</description>
</method>
- <method name="set_child_rect">
- <argument index="0" name="child" type="Control">
- </argument>
- <description>
- </description>
- </method>
<method name="set_hide_on_ok">
<argument index="0" name="enabled" type="bool">
</argument>
@@ -2356,6 +2208,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="dialog_hide_on_ok" type="bool" setter="set_hide_on_ok" getter="get_hide_on_ok" brief="">
+ </member>
+ <member name="dialog_text" type="String" setter="set_text" getter="get_text" brief="">
+ </member>
+ </members>
<signals>
<signal name="confirmed">
<description>
@@ -2395,13 +2253,6 @@
Return the visible frame index.
</description>
</method>
- <method name="get_modulate" qualifiers="const">
- <return type="Color">
- </return>
- <description>
- Return the color modulation for this sprite.
- </description>
- </method>
<method name="get_offset" qualifiers="const">
<return type="Vector2">
</return>
@@ -2486,13 +2337,6 @@
Set the visible sprite frame index (from the list of frames inside the [SpriteFrames] resource).
</description>
</method>
- <method name="set_modulate">
- <argument index="0" name="modulate" type="Color">
- </argument>
- <description>
- Change the color modulation (multiplication) for this sprite.
- </description>
- </method>
<method name="set_offset">
<argument index="0" name="offset" type="Vector2">
</argument>
@@ -2513,15 +2357,33 @@
</description>
</method>
</methods>
+ <members>
+ <member name="animation" type="String" setter="set_animation" getter="get_animation" brief="">
+ </member>
+ <member name="centered" type="bool" setter="set_centered" getter="is_centered" brief="">
+ </member>
+ <member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h" brief="">
+ </member>
+ <member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v" brief="">
+ </member>
+ <member name="frame" type="int" setter="set_frame" getter="get_frame" brief="">
+ </member>
+ <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames" brief="">
+ </member>
+ <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" brief="">
+ </member>
+ <member name="playing" type="bool" setter="_set_playing" getter="_is_playing" brief="">
+ </member>
+ </members>
<signals>
- <signal name="frame_changed">
+ <signal name="animation_finished">
<description>
- Emitted when frame is changed.
+ Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn, before looping.
</description>
</signal>
- <signal name="finished">
+ <signal name="frame_changed">
<description>
- Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn, before looping.
+ Emitted when frame is changed.
</description>
</signal>
</signals>
@@ -2596,6 +2458,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="animation" type="String" setter="set_animation" getter="get_animation" brief="">
+ </member>
+ <member name="frame" type="int" setter="set_frame" getter="get_frame" brief="">
+ </member>
+ <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames" brief="">
+ </member>
+ <member name="playing" type="bool" setter="_set_playing" getter="_is_playing" brief="">
+ </member>
+ </members>
<signals>
<signal name="frame_changed">
<description>
@@ -2669,7 +2541,7 @@
</description>
</method>
<method name="method_track_get_key_indices" qualifiers="const">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<argument index="0" name="idx" type="int">
</argument>
@@ -2744,6 +2616,14 @@
Find the key index by time in a given track. Optionally, only find it if the exact time is given.
</description>
</method>
+ <method name="track_get_interpolation_loop_wrap" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="track_get_interpolation_type" qualifiers="const">
<return type="int">
</return>
@@ -2874,6 +2754,14 @@
Set the given track as imported or not.
</description>
</method>
+ <method name="track_set_interpolation_loop_wrap">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="interpolation" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="track_set_interpolation_type">
<argument index="0" name="idx" type="int">
</argument>
@@ -2943,7 +2831,7 @@
</description>
</method>
<method name="value_track_get_key_indices" qualifiers="const">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<argument index="0" name="idx" type="int">
</argument>
@@ -3070,7 +2958,7 @@
</description>
</method>
<method name="get_animation_list" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
Get the list of names of the animations stored in the player.
@@ -3143,7 +3031,7 @@
Return path to root node (see [method set_root]).
</description>
</method>
- <method name="get_speed" qualifiers="const">
+ <method name="get_speed_scale" qualifiers="const">
<return type="float">
</return>
<description>
@@ -3280,7 +3168,7 @@
AnimationPlayer resolves animation track paths from this node (which is relative to itself), by default root is "..", but it can be changed.
</description>
</method>
- <method name="set_speed">
+ <method name="set_speed_scale">
<argument index="0" name="speed" type="float">
</argument>
<description>
@@ -3300,6 +3188,14 @@
</description>
</method>
</methods>
+ <members>
+ <member name="playback_default_blend_time" type="float" setter="set_default_blend_time" getter="get_default_blend_time" brief="">
+ </member>
+ <member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" brief="">
+ </member>
+ <member name="root_node" type="NodePath" setter="set_root" getter="get_root" brief="">
+ </member>
+ </members>
<signals>
<signal name="animation_changed">
<argument index="0" name="old_name" type="String">
@@ -3310,16 +3206,18 @@
If the currently being played animation changes, this signal will notify of such change.
</description>
</signal>
- <signal name="animation_started">
+ <signal name="animation_finished">
<argument index="0" name="name" type="String">
</argument>
<description>
- Notifies when an animation starts playing.
+ Notifies when an animation finished playing.
</description>
</signal>
- <signal name="finished">
+ <signal name="animation_started">
+ <argument index="0" name="name" type="String">
+ </argument>
<description>
- Notifies when an animation finished playing.
+ Notifies when an animation starts playing.
</description>
</signal>
</signals>
@@ -3398,6 +3296,18 @@
<description>
</description>
</method>
+ <method name="are_nodes_connected" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="id" type="String">
+ </argument>
+ <argument index="1" name="dst_id" type="String">
+ </argument>
+ <argument index="2" name="dst_input_idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="blend2_node_get_amount" qualifiers="const">
<return type="float">
</return>
@@ -3456,7 +3366,7 @@
<description>
</description>
</method>
- <method name="connect">
+ <method name="connect_nodes">
<return type="int">
</return>
<argument index="0" name="id" type="String">
@@ -3468,7 +3378,7 @@
<description>
</description>
</method>
- <method name="disconnect">
+ <method name="disconnect_nodes">
<argument index="0" name="id" type="String">
</argument>
<argument index="1" name="dst_input_idx" type="int">
@@ -3495,7 +3405,7 @@
</description>
</method>
<method name="get_node_list">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
</description>
@@ -3506,18 +3416,6 @@
<description>
</description>
</method>
- <method name="is_connected" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="id" type="String">
- </argument>
- <argument index="1" name="dst_id" type="String">
- </argument>
- <argument index="2" name="dst_input_idx" type="int">
- </argument>
- <description>
- </description>
- </method>
<method name="mix_node_get_amount" qualifiers="const">
<return type="float">
</return>
@@ -3848,6 +3746,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" brief="">
+ </member>
+ </members>
<constants>
<constant name="NODE_OUTPUT" value="0">
</constant>
@@ -3886,6 +3788,28 @@
Return the angular damp rate.
</description>
</method>
+ <method name="get_audio_bus" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_collision_layer" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Return the physics layer this area is in.
+ </description>
+ </method>
+ <method name="get_collision_layer_bit" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <description>
+ Return an individual bit on the layer mask.
+ </description>
+ </method>
<method name="get_collision_mask" qualifiers="const">
<return type="int">
</return>
@@ -3923,22 +3847,6 @@
Return the gravity vector. If gravity is a point (see [method is_gravity_a_point]), this will be the attraction center.
</description>
</method>
- <method name="get_layer_mask" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the physics layer this area is in.
- </description>
- </method>
- <method name="get_layer_mask_bit" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="bit" type="int">
- </argument>
- <description>
- Return an individual bit on the layer mask.
- </description>
- </method>
<method name="get_linear_damp" qualifiers="const">
<return type="float">
</return>
@@ -3967,6 +3875,24 @@
Return the processing order of this area.
</description>
</method>
+ <method name="get_reverb_amount" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_reverb_bus" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_reverb_uniformity" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_space_override_mode" qualifiers="const">
<return type="int">
</return>
@@ -3988,13 +3914,25 @@
Return whether this area can be detected by other, monitoring, areas.
</description>
</method>
- <method name="is_monitoring_enabled" qualifiers="const">
+ <method name="is_monitoring" qualifiers="const">
<return type="bool">
</return>
<description>
Return whether this area detects bodies/areas entering/exiting it.
</description>
</method>
+ <method name="is_overriding_audio_bus" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_using_reverb_bus" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="overlaps_area" qualifiers="const">
<return type="bool">
</return>
@@ -4021,6 +3959,36 @@
In practice, as the fraction of speed lost gets smaller with each frame, a value of 1.0 does not mean the object will stop in exactly one second. Only when the physics calculations are done at 1 frame per second, it does stop in a second.
</description>
</method>
+ <method name="set_audio_bus">
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_audio_bus_override">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_collision_layer">
+ <argument index="0" name="collision_layer" type="int">
+ </argument>
+ <description>
+ Set the physics layers this area is in.
+ Collidable objects can exist in any of 32 different layers. These layers are not visual, but more of a tagging system instead. A collidable can use these layers/tags to select with which objects it can collide, using [method set_collision_mask].
+ A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.
+ </description>
+ </method>
+ <method name="set_collision_layer_bit">
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <argument index="1" name="value" type="bool">
+ </argument>
+ <description>
+ Set/clear individual bits on the layer mask. This makes getting an area in/out of only one layer easier.
+ </description>
+ </method>
<method name="set_collision_mask">
<argument index="0" name="collision_mask" type="int">
</argument>
@@ -4037,13 +4005,6 @@
Set/clear individual bits on the collision mask. This makes selecting the areas scanned easier.
</description>
</method>
- <method name="set_enable_monitoring">
- <argument index="0" name="enable" type="bool">
- </argument>
- <description>
- Set whether this area can detect bodies/areas entering/exiting it.
- </description>
- </method>
<method name="set_gravity">
<argument index="0" name="gravity" type="float">
</argument>
@@ -4074,24 +4035,6 @@
If gravity is a point (see [method is_gravity_a_point]), this will be the attraction center.
</description>
</method>
- <method name="set_layer_mask">
- <argument index="0" name="layer_mask" type="int">
- </argument>
- <description>
- Set the physics layers this area is in.
- Collidable objects can exist in any of 32 different layers. These layers are not visual, but more of a tagging system instead. A collidable can use these layers/tags to select with which objects it can collide, using [method set_collision_mask].
- A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.
- </description>
- </method>
- <method name="set_layer_mask_bit">
- <argument index="0" name="bit" type="int">
- </argument>
- <argument index="1" name="value" type="bool">
- </argument>
- <description>
- Set/clear individual bits on the layer mask. This makes getting an area in/out of only one layer easier.
- </description>
- </method>
<method name="set_linear_damp">
<argument index="0" name="linear_damp" type="float">
</argument>
@@ -4107,6 +4050,13 @@
Set whether this area can be detected by other, monitoring, areas. Only areas need to be marked as monitorable. Bodies are always so.
</description>
</method>
+ <method name="set_monitoring">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ Set whether this area can detect bodies/areas entering/exiting it.
+ </description>
+ </method>
<method name="set_priority">
<argument index="0" name="priority" type="float">
</argument>
@@ -4115,6 +4065,24 @@
Areas with the same priority value get evaluated in an unpredictable order, and should be differentiated if evaluation order is to be important.
</description>
</method>
+ <method name="set_reverb_amount">
+ <argument index="0" name="amount" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_reverb_bus">
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_reverb_uniformity">
+ <argument index="0" name="amount" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_space_override_mode">
<argument index="0" name="enable" type="int">
</argument>
@@ -4127,16 +4095,67 @@
AREA_SPACE_OVERRIDE_REPLACE_COMBINE: This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
</description>
</method>
+ <method name="set_use_reverb_bus">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief="">
+ </member>
+ <member name="audio_bus_name" type="String" setter="set_audio_bus" getter="get_audio_bus" brief="">
+ </member>
+ <member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus" brief="">
+ </member>
+ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief="">
+ </member>
+ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief="">
+ </member>
+ <member name="gravity" type="float" setter="set_gravity" getter="get_gravity" brief="">
+ </member>
+ <member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale" brief="">
+ </member>
+ <member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point" brief="">
+ </member>
+ <member name="gravity_vec" type="Vector3" setter="set_gravity_vector" getter="get_gravity_vector" brief="">
+ </member>
+ <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" brief="">
+ </member>
+ <member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" brief="">
+ </member>
+ <member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring" brief="">
+ </member>
+ <member name="priority" type="int" setter="set_priority" getter="get_priority" brief="">
+ </member>
+ <member name="reverb_bus_amount" type="float" setter="set_reverb_amount" getter="get_reverb_amount" brief="">
+ </member>
+ <member name="reverb_bus_enable" type="bool" setter="set_use_reverb_bus" getter="is_using_reverb_bus" brief="">
+ </member>
+ <member name="reverb_bus_name" type="String" setter="set_reverb_bus" getter="get_reverb_bus" brief="">
+ </member>
+ <member name="reverb_bus_uniformity" type="float" setter="set_reverb_uniformity" getter="get_reverb_uniformity" brief="">
+ </member>
+ <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" brief="">
+ </member>
+ </members>
<signals>
- <signal name="area_enter">
+ <signal name="area_entered">
<argument index="0" name="area" type="Object">
</argument>
<description>
This signal is triggered only once when an area enters this area. The only parameter passed is the area that entered this area.
</description>
</signal>
- <signal name="area_enter_shape">
+ <signal name="area_exited">
+ <argument index="0" name="area" type="Object">
+ </argument>
+ <description>
+ This signal is triggered only once when an area exits this area. The only parameter passed is the area that exited this area.
+ </description>
+ </signal>
+ <signal name="area_shape_entered">
<argument index="0" name="area_id" type="int">
</argument>
<argument index="1" name="area" type="Object">
@@ -4149,14 +4168,7 @@
This signal triggers only once when an area enters this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
</description>
</signal>
- <signal name="area_exit">
- <argument index="0" name="area" type="Object">
- </argument>
- <description>
- This signal is triggered only once when an area exits this area. The only parameter passed is the area that exited this area.
- </description>
- </signal>
- <signal name="area_exit_shape">
+ <signal name="area_shape_exited">
<argument index="0" name="area_id" type="int">
</argument>
<argument index="1" name="area" type="Object">
@@ -4169,14 +4181,21 @@
This signal triggers only once when an area exits this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
</description>
</signal>
- <signal name="body_enter">
+ <signal name="body_entered">
<argument index="0" name="body" type="Object">
</argument>
<description>
This signal is triggered only once when a body enters this area. The only parameter passed is the body that entered this area.
</description>
</signal>
- <signal name="body_enter_shape">
+ <signal name="body_exited">
+ <argument index="0" name="body" type="Object">
+ </argument>
+ <description>
+ This signal is triggered only once when a body exits this area. The only parameter passed is the body that exited this area.
+ </description>
+ </signal>
+ <signal name="body_shape_entered">
<argument index="0" name="body_id" type="int">
</argument>
<argument index="1" name="body" type="Object">
@@ -4189,14 +4208,7 @@
This signal triggers only once when a body enters this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape of the body that entered this area, and the fourth one is the index of the shape in this area that reported the entering.
</description>
</signal>
- <signal name="body_exit">
- <argument index="0" name="body" type="Object">
- </argument>
- <description>
- This signal is triggered only once when a body exits this area. The only parameter passed is the body that exited this area.
- </description>
- </signal>
- <signal name="body_exit_shape">
+ <signal name="body_shape_exited">
<argument index="0" name="body_id" type="int">
</argument>
<argument index="1" name="body" type="Object">
@@ -4228,6 +4240,28 @@
Return the angular damp rate.
</description>
</method>
+ <method name="get_audio_bus" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_collision_layer" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Return the physics layer this area is in.
+ </description>
+ </method>
+ <method name="get_collision_layer_bit" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <description>
+ Return an individual bit on the layer mask.
+ </description>
+ </method>
<method name="get_collision_mask" qualifiers="const">
<return type="int">
</return>
@@ -4265,22 +4299,6 @@
Return the gravity vector. If gravity is a point (see [method is_gravity_a_point]), this will be the attraction center.
</description>
</method>
- <method name="get_layer_mask" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the physics layer this area is in.
- </description>
- </method>
- <method name="get_layer_mask_bit" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="bit" type="int">
- </argument>
- <description>
- Return an individual bit on the layer mask.
- </description>
- </method>
<method name="get_linear_damp" qualifiers="const">
<return type="float">
</return>
@@ -4330,13 +4348,19 @@
Return whether this area can be detected by other, monitoring, areas.
</description>
</method>
- <method name="is_monitoring_enabled" qualifiers="const">
+ <method name="is_monitoring" qualifiers="const">
<return type="bool">
</return>
<description>
Return whether this area detects bodies/areas entering/exiting it.
</description>
</method>
+ <method name="is_overriding_audio_bus" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="overlaps_area" qualifiers="const">
<return type="bool">
</return>
@@ -4363,6 +4387,36 @@
In practice, as the fraction of speed lost gets smaller with each frame, a value of 1.0 does not mean the object will stop in exactly one second. Only when the physics calculations are done at 1 frame per second, it does stop in a second.
</description>
</method>
+ <method name="set_audio_bus">
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_audio_bus_override">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_collision_layer">
+ <argument index="0" name="collision_layer" type="int">
+ </argument>
+ <description>
+ Set the physics layers this area is in.
+ Collidable objects can exist in any of 32 different layers. These layers are not visual, but more of a tagging system instead. A collidable can use these layers/tags to select with which objects it can collide, using [method set_collision_mask].
+ A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.
+ </description>
+ </method>
+ <method name="set_collision_layer_bit">
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <argument index="1" name="value" type="bool">
+ </argument>
+ <description>
+ Set/clear individual bits on the layer mask. This makes getting an area in/out of only one layer easier.
+ </description>
+ </method>
<method name="set_collision_mask">
<argument index="0" name="collision_mask" type="int">
</argument>
@@ -4379,13 +4433,6 @@
Set/clear individual bits on the collision mask. This makes selecting the areas scanned easier.
</description>
</method>
- <method name="set_enable_monitoring">
- <argument index="0" name="enable" type="bool">
- </argument>
- <description>
- Set whether this area can detect bodies/areas entering/exiting it.
- </description>
- </method>
<method name="set_gravity">
<argument index="0" name="gravity" type="float">
</argument>
@@ -4416,24 +4463,6 @@
If gravity is a point (see [method is_gravity_a_point]), this will be the attraction center.
</description>
</method>
- <method name="set_layer_mask">
- <argument index="0" name="layer_mask" type="int">
- </argument>
- <description>
- Set the physics layers this area is in.
- Collidable objects can exist in any of 32 different layers. These layers are not visual, but more of a tagging system instead. A collidable can use these layers/tags to select with which objects it can collide, using [method set_collision_mask].
- A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.
- </description>
- </method>
- <method name="set_layer_mask_bit">
- <argument index="0" name="bit" type="int">
- </argument>
- <argument index="1" name="value" type="bool">
- </argument>
- <description>
- Set/clear individual bits on the layer mask. This makes getting an area in/out of only one layer easier.
- </description>
- </method>
<method name="set_linear_damp">
<argument index="0" name="linear_damp" type="float">
</argument>
@@ -4449,6 +4478,13 @@
Set whether this area can be detected by other, monitoring, areas. Only areas need to be marked as monitorable. Bodies are always so.
</description>
</method>
+ <method name="set_monitoring">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ Set whether this area can detect bodies/areas entering/exiting it.
+ </description>
+ </method>
<method name="set_priority">
<argument index="0" name="priority" type="float">
</argument>
@@ -4470,15 +4506,52 @@
</description>
</method>
</methods>
+ <members>
+ <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief="">
+ </member>
+ <member name="audio_bus_name" type="String" setter="set_audio_bus" getter="get_audio_bus" brief="">
+ </member>
+ <member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus" brief="">
+ </member>
+ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief="">
+ </member>
+ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief="">
+ </member>
+ <member name="gravity" type="float" setter="set_gravity" getter="get_gravity" brief="">
+ </member>
+ <member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale" brief="">
+ </member>
+ <member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point" brief="">
+ </member>
+ <member name="gravity_vec" type="Vector2" setter="set_gravity_vector" getter="get_gravity_vector" brief="">
+ </member>
+ <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" brief="">
+ </member>
+ <member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" brief="">
+ </member>
+ <member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring" brief="">
+ </member>
+ <member name="priority" type="int" setter="set_priority" getter="get_priority" brief="">
+ </member>
+ <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" brief="">
+ </member>
+ </members>
<signals>
- <signal name="area_enter">
+ <signal name="area_entered">
<argument index="0" name="area" type="Object">
</argument>
<description>
This signal is triggered only once when an area enters this area. The only parameter passed is the area that entered this area.
</description>
</signal>
- <signal name="area_enter_shape">
+ <signal name="area_exited">
+ <argument index="0" name="area" type="Object">
+ </argument>
+ <description>
+ This signal is triggered only once when an area exits this area. The only parameter passed is the area that exited this area.
+ </description>
+ </signal>
+ <signal name="area_shape_entered">
<argument index="0" name="area_id" type="int">
</argument>
<argument index="1" name="area" type="Object">
@@ -4491,14 +4564,7 @@
This signal triggers only once when an area enters this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
</description>
</signal>
- <signal name="area_exit">
- <argument index="0" name="area" type="Object">
- </argument>
- <description>
- This signal is triggered only once when an area exits this area. The only parameter passed is the area that exited this area.
- </description>
- </signal>
- <signal name="area_exit_shape">
+ <signal name="area_shape_exited">
<argument index="0" name="area_id" type="int">
</argument>
<argument index="1" name="area" type="Object">
@@ -4511,14 +4577,21 @@
This signal triggers only once when an area exits this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
</description>
</signal>
- <signal name="body_enter">
+ <signal name="body_entered">
<argument index="0" name="body" type="Object">
</argument>
<description>
This signal is triggered only once when a body enters this area. The only parameter passed is the body that entered this area.
</description>
</signal>
- <signal name="body_enter_shape">
+ <signal name="body_exited">
+ <argument index="0" name="body" type="Object">
+ </argument>
+ <description>
+ This signal is triggered only once when a body exits this area. The only parameter passed is the body that exited this area.
+ </description>
+ </signal>
+ <signal name="body_shape_entered">
<argument index="0" name="body_id" type="int">
</argument>
<argument index="1" name="body" type="Object">
@@ -4531,14 +4604,7 @@
This signal triggers only once when a body enters this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape of the body that entered this area, and the fourth one is the index of the shape in this area that reported the entering.
</description>
</signal>
- <signal name="body_exit">
- <argument index="0" name="body" type="Object">
- </argument>
- <description>
- This signal is triggered only once when a body exits this area. The only parameter passed is the body that exited this area.
- </description>
- </signal>
- <signal name="body_exit_shape">
+ <signal name="body_shape_exited">
<argument index="0" name="body_id" type="int">
</argument>
<argument index="1" name="body" type="Object">
@@ -4566,64 +4632,64 @@
<method name="Array">
<return type="Array">
</return>
- <argument index="0" name="from" type="ColorArray">
+ <argument index="0" name="from" type="PoolColorArray">
</argument>
<description>
- Construct an array from a [RawArray].
+ Construct an array from a [PoolColorArray].
</description>
</method>
<method name="Array">
<return type="Array">
</return>
- <argument index="0" name="from" type="Vector3Array">
+ <argument index="0" name="from" type="PoolVector3Array">
</argument>
<description>
- Construct an array from a [RawArray].
+ Construct an array from a [PoolVector3Array].
</description>
</method>
<method name="Array">
<return type="Array">
</return>
- <argument index="0" name="from" type="Vector2Array">
+ <argument index="0" name="from" type="PoolVector2Array">
</argument>
<description>
- Construct an array from a [RawArray].
+ Construct an array from a [PoolVector2Array].
</description>
</method>
<method name="Array">
<return type="Array">
</return>
- <argument index="0" name="from" type="StringArray">
+ <argument index="0" name="from" type="PoolStringArray">
</argument>
<description>
- Construct an array from a [RawArray].
+ Construct an array from a [PoolStringArray].
</description>
</method>
<method name="Array">
<return type="Array">
</return>
- <argument index="0" name="from" type="RealArray">
+ <argument index="0" name="from" type="PoolRealArray">
</argument>
<description>
- Construct an array from a [RawArray].
+ Construct an array from a [PoolRealArray].
</description>
</method>
<method name="Array">
<return type="Array">
</return>
- <argument index="0" name="from" type="IntArray">
+ <argument index="0" name="from" type="PoolIntArray">
</argument>
<description>
- Construct an array from a [RawArray].
+ Construct an array from a [PoolIntArray].
</description>
</method>
<method name="Array">
<return type="Array">
</return>
- <argument index="0" name="from" type="RawArray">
+ <argument index="0" name="from" type="PoolByteArray">
</argument>
<description>
- Construct an array from a [RawArray].
+ Construct an array from a [PoolByteArray].
</description>
</method>
<method name="append">
@@ -4633,6 +4699,11 @@
Append an element at the end of the array (alias of [method push_back]).
</description>
</method>
+ <method name="back">
+ <description>
+ Returns the last element of the array if the array is not empty (size&gt;0).
+ </description>
+ </method>
<method name="clear">
<description>
Clear the array (resize to 0).
@@ -4661,20 +4732,6 @@
Remove the first occurrence of a value from the array.
</description>
</method>
- <method name="front">
- <return type="Variant">
- </return>
- <description>
- Returns the first element of the array if the array is not empty (size>0).
- </description>
- </method>
- <method name="back">
- <return type="Variant">
- </return>
- <description>
- Returns the last element of the array if the array is not empty (size>0).
- </description>
- </method>
<method name="find">
<return type="int">
</return>
@@ -4695,13 +4752,24 @@
Searches the array in reverse order for a value and returns its index or -1 if not found.
</description>
</method>
+ <method name="front">
+ <description>
+ Returns the first element of the array if the array is not empty (size&gt;0).
+ </description>
+ </method>
<method name="has">
<return type="bool">
</return>
<argument index="0" name="value" type="var">
</argument>
<description>
- Return true if the array contains given value. [code][ "inside", 7 ].has("inside") == true, [ "inside", 7 ].has("outside") == false, [ "inside", 7 ].has(7) == true, [ "inside", 7 ].has("7") == false[/code]
+ Return true if the array contains given value.
+ [codeblock]
+ [ "inside", 7 ].has("inside") == true
+ [ "inside", 7 ].has("outside") == false
+ [ "inside", 7 ].has(7) == true
+ [ "inside", 7 ].has("7") == false
+ [/codeblock]
</description>
</method>
<method name="hash">
@@ -4725,13 +4793,6 @@
Reverse the order of the elements in the array (so first element will now be the last).
</description>
</method>
- <method name="is_shared">
- <return type="bool">
- </return>
- <description>
- Get whether this is a shared array instance.
- </description>
- </method>
<method name="pop_back">
<description>
Remove the last element of the array.
@@ -4806,6 +4867,230 @@
<constants>
</constants>
</class>
+<class name="ArrayMesh" inherits="Mesh" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="add_blend_shape">
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="add_surface_from_arrays">
+ <argument index="0" name="primitive" type="int">
+ </argument>
+ <argument index="1" name="arrays" type="Array">
+ </argument>
+ <argument index="2" name="blend_shapes" type="Array" default="[]">
+ </argument>
+ <argument index="3" name="compress_flags" type="int" default="97792">
+ </argument>
+ <description>
+ Create a new surface ([method get_surface_count] that will become surf_idx for this.
+ Surfaces are created to be rendered using a "primitive", which may be PRIMITIVE_POINTS, PRIMITIVE_LINES, PRIMITIVE_LINE_STRIP, PRIMITIVE_LINE_LOOP, PRIMITIVE_TRIANGLES, PRIMITIVE_TRIANGLE_STRIP, PRIMITIVE_TRIANGLE_FAN. (As a note, when using indices, it is recommended to only use just points, lines or triangles).
+ </description>
+ </method>
+ <method name="center_geometry">
+ <description>
+ </description>
+ </method>
+ <method name="clear_blend_shapes">
+ <description>
+ </description>
+ </method>
+ <method name="get_blend_shape_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_blend_shape_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_blend_shape_name" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_custom_aabb" qualifiers="const">
+ <return type="Rect3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_surface_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Return the amount of surfaces that the [ArrayMesh] holds.
+ </description>
+ </method>
+ <method name="regen_normalmaps">
+ <description>
+ </description>
+ </method>
+ <method name="set_blend_shape_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_custom_aabb">
+ <argument index="0" name="aabb" type="Rect3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="surface_get_array_index_len" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="surf_idx" type="int">
+ </argument>
+ <description>
+ Return the length in indices of the index array in the requested surface (see [method add_surface]).
+ </description>
+ </method>
+ <method name="surface_get_array_len" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="surf_idx" type="int">
+ </argument>
+ <description>
+ Return the length in vertices of the vertex array in the requested surface (see [method add_surface]).
+ </description>
+ </method>
+ <method name="surface_get_format" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="surf_idx" type="int">
+ </argument>
+ <description>
+ Return the format mask of the requested surface (see [method add_surface]).
+ </description>
+ </method>
+ <method name="surface_get_material" qualifiers="const">
+ <return type="Material">
+ </return>
+ <argument index="0" name="surf_idx" type="int">
+ </argument>
+ <description>
+ Return a [Material] in a given surface. Surface is rendered using this material.
+ </description>
+ </method>
+ <method name="surface_get_name" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="surf_idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="surface_get_primitive_type" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="surf_idx" type="int">
+ </argument>
+ <description>
+ Return the primitive type of the requested surface (see [method add_surface]).
+ </description>
+ </method>
+ <method name="surface_remove">
+ <argument index="0" name="surf_idx" type="int">
+ </argument>
+ <description>
+ Remove a surface at position surf_idx, shifting greater surfaces one surf_idx slot down.
+ </description>
+ </method>
+ <method name="surface_set_material">
+ <argument index="0" name="surf_idx" type="int">
+ </argument>
+ <argument index="1" name="material" type="Material">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="surface_set_name">
+ <argument index="0" name="surf_idx" type="int">
+ </argument>
+ <argument index="1" name="name" type="String">
+ </argument>
+ <description>
+ Set a [Material] for a given surface. Surface will be rendered using this material.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ <constant name="NO_INDEX_ARRAY" value="-1">
+ Default value used for index_array_len when no indices are present.
+ </constant>
+ <constant name="ARRAY_WEIGHTS_SIZE" value="4">
+ Amount of weights/bone indices per vertex (always 4).
+ </constant>
+ <constant name="ARRAY_VERTEX" value="0">
+ Vertex array (array of [Vector3] vertices).
+ </constant>
+ <constant name="ARRAY_NORMAL" value="1">
+ Normal array (array of [Vector3] normals).
+ </constant>
+ <constant name="ARRAY_TANGENT" value="2">
+ Tangent array, array of groups of 4 floats. first 3 floats determine the tangent, and the last the binormal direction as -1 or 1.
+ </constant>
+ <constant name="ARRAY_COLOR" value="3">
+ Vertex array (array of [Color] colors).
+ </constant>
+ <constant name="ARRAY_TEX_UV" value="4">
+ UV array (array of [Vector3] UVs or float array of groups of 2 floats (u,v)).
+ </constant>
+ <constant name="ARRAY_TEX_UV2" value="5">
+ Second UV array (array of [Vector3] UVs or float array of groups of 2 floats (u,v)).
+ </constant>
+ <constant name="ARRAY_BONES" value="6">
+ Array of bone indices, as a float array. Each element in groups of 4 floats.
+ </constant>
+ <constant name="ARRAY_WEIGHTS" value="7">
+ Array of bone weights, as a float array. Each element in groups of 4 floats.
+ </constant>
+ <constant name="ARRAY_INDEX" value="8">
+ Array of integers, used as indices referencing vertices. No index can be beyond the vertex array size.
+ </constant>
+ <constant name="ARRAY_FORMAT_VERTEX" value="1">
+ Array format will include vertices (mandatory).
+ </constant>
+ <constant name="ARRAY_FORMAT_NORMAL" value="2">
+ Array format will include normals
+ </constant>
+ <constant name="ARRAY_FORMAT_TANGENT" value="4">
+ Array format will include tangents
+ </constant>
+ <constant name="ARRAY_FORMAT_COLOR" value="8">
+ Array format will include a color array.
+ </constant>
+ <constant name="ARRAY_FORMAT_TEX_UV" value="16">
+ Array format will include UVs.
+ </constant>
+ <constant name="ARRAY_FORMAT_TEX_UV2" value="32">
+ Array format will include another set of UVs.
+ </constant>
+ <constant name="ARRAY_FORMAT_BONES" value="64">
+ Array format will include bone indices.
+ </constant>
+ <constant name="ARRAY_FORMAT_WEIGHTS" value="128">
+ Array format will include bone weights.
+ </constant>
+ <constant name="ARRAY_FORMAT_INDEX" value="256">
+ Index array will be used.
+ </constant>
+ </constants>
+</class>
<class name="AtlasTexture" inherits="Texture" category="Core">
<brief_description>
</brief_description>
@@ -4849,6 +5134,14 @@
</description>
</method>
</methods>
+ <members>
+ <member name="atlas" type="Texture" setter="set_atlas" getter="get_atlas" brief="">
+ </member>
+ <member name="margin" type="Rect2" setter="set_margin" getter="get_margin" brief="">
+ </member>
+ <member name="region" type="Rect2" setter="set_region" getter="get_region" brief="">
+ </member>
+ </members>
<signals>
<signal name="atlas_changed">
<description>
@@ -4858,1076 +5151,2290 @@
<constants>
</constants>
</class>
-<class name="AudioServer" inherits="Object" category="Core">
+<class name="AudioBusLayout" inherits="Resource" category="Core">
<brief_description>
- Server interface for low level audio access.
</brief_description>
<description>
- AudioServer is a low level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface.
</description>
<methods>
- <method name="free_rid">
- <argument index="0" name="rid" type="RID">
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffect" inherits="Resource" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectAmplify" inherits="AudioEffect" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_volume_db" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_volume_db">
+ <argument index="0" name="volume" type="float">
</argument>
<description>
- Free a [RID] resource.
</description>
</method>
- <method name="get_event_voice_global_volume_scale" qualifiers="const">
+ </methods>
+ <members>
+ <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectBandLimitFilter" inherits="AudioEffectFilter" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectBandPassFilter" inherits="AudioEffectFilter" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectChorus" inherits="AudioEffect" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_dry" qualifiers="const">
<return type="float">
</return>
<description>
- Return the global scale for event-based stream playback.
</description>
</method>
- <method name="get_fx_global_volume_scale" qualifiers="const">
- <return type="float">
+ <method name="get_voice_count" qualifiers="const">
+ <return type="int">
</return>
<description>
- Return the global scale for all voices.
</description>
</method>
- <method name="get_stream_global_volume_scale" qualifiers="const">
+ <method name="get_voice_cutoff_hz" qualifiers="const">
<return type="float">
</return>
+ <argument index="0" name="voice_idx" type="int">
+ </argument>
<description>
- Return the global scale for stream playback.
</description>
</method>
- <method name="sample_create">
- <return type="RID">
+ <method name="get_voice_delay_ms" qualifiers="const">
+ <return type="float">
</return>
- <argument index="0" name="format" type="int">
- </argument>
- <argument index="1" name="stereo" type="bool">
- </argument>
- <argument index="2" name="length" type="int">
+ <argument index="0" name="voice_idx" type="int">
</argument>
<description>
- Create an audio sample, return a [RID] referencing it. The sample will be created with a given format (from the SAMPLE_FORMAT_* enum), a total length (in samples, not bytes), in either stereo or mono.
- Even if a stereo sample consists of a left sample and a right sample, it still counts as one sample for length purposes.
</description>
</method>
- <method name="sample_get_data" qualifiers="const">
- <return type="RawArray">
+ <method name="get_voice_depth_ms" qualifiers="const">
+ <return type="float">
</return>
- <argument index="0" name="sample" type="RID">
+ <argument index="0" name="voice_idx" type="int">
</argument>
<description>
- Return the sample data as an array of bytes. The length will be the expected length in bytes.
</description>
</method>
- <method name="sample_get_description" qualifiers="const">
- <return type="String">
+ <method name="get_voice_level_db" qualifiers="const">
+ <return type="float">
</return>
- <argument index="0" name="sample" type="RID">
+ <argument index="0" name="voice_idx" type="int">
</argument>
<description>
- Return the description of an audio sample. Mainly used for organization.
</description>
</method>
- <method name="sample_get_format" qualifiers="const">
- <return type="int">
+ <method name="get_voice_pan" qualifiers="const">
+ <return type="float">
</return>
- <argument index="0" name="sample" type="RID">
+ <argument index="0" name="voice_idx" type="int">
</argument>
<description>
- Return the format of the audio sample, in the form of the SAMPLE_FORMAT_* enum.
</description>
</method>
- <method name="sample_get_length" qualifiers="const">
- <return type="int">
+ <method name="get_voice_rate_hz" qualifiers="const">
+ <return type="float">
</return>
- <argument index="0" name="sample" type="RID">
+ <argument index="0" name="voice_idx" type="int">
</argument>
<description>
- Return the length in samples (not bytes) of the audio sample. Even if a stereo sample consists of a left sample and a right sample, it still counts as one sample for length purposes.
</description>
</method>
- <method name="sample_get_loop_begin" qualifiers="const">
- <return type="int">
+ <method name="get_wet" qualifiers="const">
+ <return type="float">
</return>
- <argument index="0" name="sample" type="RID">
- </argument>
<description>
- Return the initial loop point of a sample. Only has effect if sample loop is enabled. See [method sample_set_loop_format].
</description>
</method>
- <method name="sample_get_loop_end" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="sample" type="RID">
+ <method name="set_dry">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
- Return the final loop point of a sample. Only has effect if sample loop is enabled. See [method sample_set_loop_format].
</description>
</method>
- <method name="sample_get_loop_format" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="sample" type="RID">
+ <method name="set_voice_count">
+ <argument index="0" name="voices" type="int">
</argument>
<description>
- Return the loop format for a sample, as a value from the SAMPLE_LOOP_* enum.
</description>
</method>
- <method name="sample_get_mix_rate" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="sample" type="RID">
+ <method name="set_voice_cutoff_hz">
+ <argument index="0" name="voice_idx" type="int">
+ </argument>
+ <argument index="1" name="cutoff_hz" type="float">
</argument>
<description>
- Return the mix rate of the given sample.
</description>
</method>
- <method name="sample_is_stereo" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="sample" type="RID">
+ <method name="set_voice_delay_ms">
+ <argument index="0" name="voice_idx" type="int">
+ </argument>
+ <argument index="1" name="delay_ms" type="float">
</argument>
<description>
- Return whether the sample is stereo (2 channels).
</description>
</method>
- <method name="sample_set_data">
- <argument index="0" name="sample" type="RID">
+ <method name="set_voice_depth_ms">
+ <argument index="0" name="voice_idx" type="int">
</argument>
- <argument index="1" name="data" type="RawArray">
+ <argument index="1" name="depth_ms" type="float">
</argument>
<description>
- Set the sample data for a given sample as an array of bytes. The length must be equal to the sample length expected in bytes or an error will be produced. The byte length can be calculated as follows:
- Get the sample length ([method sample_get_length]).
- If the sample format is SAMPLE_FORMAT_PCM16, multiply it by 2.
- If the sample format is SAMPLE_FORMAT_IMA_ADPCM, divide it by 2 (rounding any fraction up), then add 4.
- If the sample is stereo ([method sample_is_stereo]), multiply it by 2.
</description>
</method>
- <method name="sample_set_description">
- <argument index="0" name="sample" type="RID">
+ <method name="set_voice_level_db">
+ <argument index="0" name="voice_idx" type="int">
</argument>
- <argument index="1" name="description" type="String">
+ <argument index="1" name="level_db" type="float">
</argument>
<description>
- Set the description of an audio sample. Mainly used for organization.
</description>
</method>
- <method name="sample_set_loop_begin">
- <argument index="0" name="sample" type="RID">
+ <method name="set_voice_pan">
+ <argument index="0" name="voice_idx" type="int">
</argument>
- <argument index="1" name="pos" type="int">
+ <argument index="1" name="pan" type="float">
</argument>
<description>
- Set the initial loop point of a sample. Only has effect if sample loop is enabled. See [method sample_set_loop_format].
</description>
</method>
- <method name="sample_set_loop_end">
- <argument index="0" name="sample" type="RID">
+ <method name="set_voice_rate_hz">
+ <argument index="0" name="voice_idx" type="int">
</argument>
- <argument index="1" name="pos" type="int">
+ <argument index="1" name="rate_hz" type="float">
</argument>
<description>
- Set the final loop point of a sample. Only has effect if sample loop is enabled. See [method sample_set_loop_format].
</description>
</method>
- <method name="sample_set_loop_format">
- <argument index="0" name="sample" type="RID">
- </argument>
- <argument index="1" name="loop_format" type="int">
+ <method name="set_wet">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
- Set the loop format for a sample from the SAMPLE_LOOP_* enum. As a warning, Ping Pong loops may not be available on some hardware-mixing platforms.
</description>
</method>
- <method name="sample_set_mix_rate">
- <argument index="0" name="sample" type="RID">
+ </methods>
+ <members>
+ <member name="dry" type="float" setter="set_dry" getter="get_dry" brief="">
+ </member>
+ <member name="voice/1/cutoff_hz" type="float" setter="set_voice_cutoff_hz" getter="get_voice_cutoff_hz" brief="">
+ </member>
+ <member name="voice/1/delay_ms" type="float" setter="set_voice_delay_ms" getter="get_voice_delay_ms" brief="">
+ </member>
+ <member name="voice/1/depth_ms" type="float" setter="set_voice_depth_ms" getter="get_voice_depth_ms" brief="">
+ </member>
+ <member name="voice/1/level_db" type="float" setter="set_voice_level_db" getter="get_voice_level_db" brief="">
+ </member>
+ <member name="voice/1/pan" type="float" setter="set_voice_pan" getter="get_voice_pan" brief="">
+ </member>
+ <member name="voice/1/rate_hz" type="float" setter="set_voice_rate_hz" getter="get_voice_rate_hz" brief="">
+ </member>
+ <member name="voice/2/cutoff_hz" type="float" setter="set_voice_cutoff_hz" getter="get_voice_cutoff_hz" brief="">
+ </member>
+ <member name="voice/2/delay_ms" type="float" setter="set_voice_delay_ms" getter="get_voice_delay_ms" brief="">
+ </member>
+ <member name="voice/2/depth_ms" type="float" setter="set_voice_depth_ms" getter="get_voice_depth_ms" brief="">
+ </member>
+ <member name="voice/2/level_db" type="float" setter="set_voice_level_db" getter="get_voice_level_db" brief="">
+ </member>
+ <member name="voice/2/pan" type="float" setter="set_voice_pan" getter="get_voice_pan" brief="">
+ </member>
+ <member name="voice/2/rate_hz" type="float" setter="set_voice_rate_hz" getter="get_voice_rate_hz" brief="">
+ </member>
+ <member name="voice/3/cutoff_hz" type="float" setter="set_voice_cutoff_hz" getter="get_voice_cutoff_hz" brief="">
+ </member>
+ <member name="voice/3/delay_ms" type="float" setter="set_voice_delay_ms" getter="get_voice_delay_ms" brief="">
+ </member>
+ <member name="voice/3/depth_ms" type="float" setter="set_voice_depth_ms" getter="get_voice_depth_ms" brief="">
+ </member>
+ <member name="voice/3/level_db" type="float" setter="set_voice_level_db" getter="get_voice_level_db" brief="">
+ </member>
+ <member name="voice/3/pan" type="float" setter="set_voice_pan" getter="get_voice_pan" brief="">
+ </member>
+ <member name="voice/3/rate_hz" type="float" setter="set_voice_rate_hz" getter="get_voice_rate_hz" brief="">
+ </member>
+ <member name="voice/4/cutoff_hz" type="float" setter="set_voice_cutoff_hz" getter="get_voice_cutoff_hz" brief="">
+ </member>
+ <member name="voice/4/delay_ms" type="float" setter="set_voice_delay_ms" getter="get_voice_delay_ms" brief="">
+ </member>
+ <member name="voice/4/depth_ms" type="float" setter="set_voice_depth_ms" getter="get_voice_depth_ms" brief="">
+ </member>
+ <member name="voice/4/level_db" type="float" setter="set_voice_level_db" getter="get_voice_level_db" brief="">
+ </member>
+ <member name="voice/4/pan" type="float" setter="set_voice_pan" getter="get_voice_pan" brief="">
+ </member>
+ <member name="voice/4/rate_hz" type="float" setter="set_voice_rate_hz" getter="get_voice_rate_hz" brief="">
+ </member>
+ <member name="voice_count" type="int" setter="set_voice_count" getter="get_voice_count" brief="">
+ </member>
+ <member name="wet" type="float" setter="set_wet" getter="get_wet" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectCompressor" inherits="AudioEffect" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_attack_us" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_gain" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_mix" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ratio" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_release_ms" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sidechain" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_threshold" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_attack_us">
+ <argument index="0" name="attack_us" type="float">
</argument>
- <argument index="1" name="mix_rate" type="int">
+ <description>
+ </description>
+ </method>
+ <method name="set_gain">
+ <argument index="0" name="gain" type="float">
</argument>
<description>
- Change the default mix rate of a given sample.
</description>
</method>
- <method name="sample_set_signed_data">
- <argument index="0" name="sample" type="RID">
+ <method name="set_mix">
+ <argument index="0" name="mix" type="float">
</argument>
- <argument index="1" name="data" type="RealArray">
+ <description>
+ </description>
+ </method>
+ <method name="set_ratio">
+ <argument index="0" name="ratio" type="float">
</argument>
<description>
- Set the sample data for a given sample as an array of floats. The length must be equal to the sample length or an error will be produced.
- For this method, a stereo sample is made from two samples. Thus, in case of a stereo sample, the array length must be twice the length returned by [method sample_get_length].
- Trying to alter a SAMPLE_FORMAT_IMA_ADPCM sample is not supported. It will throw an error to the console, but will not alter the sample data.
</description>
</method>
- <method name="set_event_voice_global_volume_scale">
- <argument index="0" name="scale" type="float">
+ <method name="set_release_ms">
+ <argument index="0" name="release_ms" type="float">
</argument>
<description>
- Set global scale for event-based stream ([EventStream]) playback. Default is 1.0.
</description>
</method>
- <method name="set_fx_global_volume_scale">
- <argument index="0" name="scale" type="float">
+ <method name="set_sidechain">
+ <argument index="0" name="sidechain" type="String">
</argument>
<description>
- Set global scale for all voices (not including streams). Default is 1.0.
</description>
</method>
- <method name="set_stream_global_volume_scale">
- <argument index="0" name="scale" type="float">
+ <method name="set_threshold">
+ <argument index="0" name="threshold" type="float">
</argument>
<description>
- Set global scale for stream playback. Default is 1.0.
</description>
</method>
- <method name="voice_create">
- <return type="RID">
+ </methods>
+ <members>
+ <member name="attack_us" type="float" setter="set_attack_us" getter="get_attack_us" brief="">
+ </member>
+ <member name="gain" type="float" setter="set_gain" getter="get_gain" brief="">
+ </member>
+ <member name="mix" type="float" setter="set_mix" getter="get_mix" brief="">
+ </member>
+ <member name="ratio" type="float" setter="set_ratio" getter="get_ratio" brief="">
+ </member>
+ <member name="release_ms" type="float" setter="set_release_ms" getter="get_release_ms" brief="">
+ </member>
+ <member name="sidechain" type="float" setter="set_sidechain" getter="get_sidechain" brief="">
+ </member>
+ <member name="threshold" type="float" setter="set_threshold" getter="get_threshold" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectDelay" inherits="AudioEffect" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_dry">
+ <return type="float">
</return>
<description>
- Allocate a voice for playback. Voices are persistent. A voice can play a single sample at the same time. See [method sample_create].
</description>
</method>
- <method name="voice_get_chorus" qualifiers="const">
+ <method name="get_feedback_delay_ms" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="voice" type="RID">
- </argument>
<description>
- Return the current chorus send for a given voice (0 to 1).
</description>
</method>
- <method name="voice_get_filter_cutoff" qualifiers="const">
+ <method name="get_feedback_level_db" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="voice" type="RID">
- </argument>
<description>
- Return the current filter cutoff (in hz) for a given voice.
</description>
</method>
- <method name="voice_get_filter_resonance" qualifiers="const">
+ <method name="get_feedback_lowpass" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="voice" type="RID">
- </argument>
<description>
- Return the current filter resonance for a given voice.
</description>
</method>
- <method name="voice_get_filter_type" qualifiers="const">
- <return type="int">
+ <method name="get_tap1_delay_ms" qualifiers="const">
+ <return type="float">
</return>
- <argument index="0" name="voice" type="RID">
- </argument>
<description>
- Return the current selected filter type for a given voice, from the FILTER_* enum.
</description>
</method>
- <method name="voice_get_mix_rate" qualifiers="const">
- <return type="int">
+ <method name="get_tap1_level_db" qualifiers="const">
+ <return type="float">
</return>
- <argument index="0" name="voice" type="RID">
- </argument>
<description>
- Return the current mix rate for a given voice.
</description>
</method>
- <method name="voice_get_pan" qualifiers="const">
+ <method name="get_tap1_pan" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="voice" type="RID">
- </argument>
<description>
- Return the current pan for a given voice (-1 to +1 range).
</description>
</method>
- <method name="voice_get_pan_depth" qualifiers="const">
+ <method name="get_tap2_delay_ms" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="voice" type="RID">
- </argument>
<description>
- Return the current pan depth for a given voice (-1 to +1 range).
</description>
</method>
- <method name="voice_get_pan_height" qualifiers="const">
+ <method name="get_tap2_level_db" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="voice" type="RID">
- </argument>
<description>
- Return the current pan height for a given voice (-1 to +1 range).
</description>
</method>
- <method name="voice_get_reverb" qualifiers="const">
+ <method name="get_tap2_pan" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="voice" type="RID">
- </argument>
<description>
- Return the current reverb send for a given voice (0 to 1).
</description>
</method>
- <method name="voice_get_reverb_type" qualifiers="const">
- <return type="int">
+ <method name="is_feedback_active" qualifiers="const">
+ <return type="bool">
</return>
- <argument index="0" name="voice" type="RID">
- </argument>
<description>
- Return the current reverb type for a given voice from the REVERB_* enum.
</description>
</method>
- <method name="voice_get_volume" qualifiers="const">
- <return type="float">
+ <method name="is_tap1_active" qualifiers="const">
+ <return type="bool">
</return>
- <argument index="0" name="voice" type="RID">
- </argument>
<description>
- Return the current volume for a given voice.
</description>
</method>
- <method name="voice_is_positional" qualifiers="const">
+ <method name="is_tap2_active" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="voice" type="RID">
+ <description>
+ </description>
+ </method>
+ <method name="set_dry">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
- Return whether the current voice is positional. See [method voice_set_positional].
</description>
</method>
- <method name="voice_play">
- <argument index="0" name="voice" type="RID">
+ <method name="set_feedback_active">
+ <argument index="0" name="amount" type="bool">
</argument>
- <argument index="1" name="sample" type="RID">
+ <description>
+ </description>
+ </method>
+ <method name="set_feedback_delay_ms">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
- Start playback of a given voice using a given sample. If the voice was already playing it will be restarted.
</description>
</method>
- <method name="voice_set_chorus">
- <argument index="0" name="voice" type="RID">
+ <method name="set_feedback_level_db">
+ <argument index="0" name="amount" type="float">
</argument>
- <argument index="1" name="chorus" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="set_feedback_lowpass">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
- Set chorus send post processing for the voice (from 0 to 1).
</description>
</method>
- <method name="voice_set_filter">
- <argument index="0" name="voice" type="RID">
+ <method name="set_tap1_active">
+ <argument index="0" name="amount" type="bool">
</argument>
- <argument index="1" name="type" type="int">
+ <description>
+ </description>
+ </method>
+ <method name="set_tap1_delay_ms">
+ <argument index="0" name="amount" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_tap1_level_db">
+ <argument index="0" name="amount" type="float">
</argument>
- <argument index="2" name="cutoff" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="set_tap1_pan">
+ <argument index="0" name="amount" type="float">
</argument>
- <argument index="3" name="resonance" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="set_tap2_active">
+ <argument index="0" name="amount" type="bool">
</argument>
- <argument index="4" name="gain" type="float" default="0">
+ <description>
+ </description>
+ </method>
+ <method name="set_tap2_delay_ms">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
- Set a resonant filter post processing for the voice. Filter type is a value from the FILTER_* enum.
</description>
</method>
- <method name="voice_set_mix_rate">
- <argument index="0" name="voice" type="RID">
+ <method name="set_tap2_level_db">
+ <argument index="0" name="amount" type="float">
</argument>
- <argument index="1" name="rate" type="int">
+ <description>
+ </description>
+ </method>
+ <method name="set_tap2_pan">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
- Set a different playback mix rate for the given voice.
</description>
</method>
- <method name="voice_set_pan">
- <argument index="0" name="voice" type="RID">
+ </methods>
+ <members>
+ <member name="dry" type="float" setter="set_dry" getter="get_dry" brief="">
+ </member>
+ <member name="feedback/active" type="bool" setter="set_feedback_active" getter="is_feedback_active" brief="">
+ </member>
+ <member name="feedback/delay_ms" type="float" setter="set_feedback_delay_ms" getter="get_feedback_delay_ms" brief="">
+ </member>
+ <member name="feedback/level_db" type="float" setter="set_feedback_level_db" getter="get_feedback_level_db" brief="">
+ </member>
+ <member name="feedback/lowpass" type="float" setter="set_feedback_lowpass" getter="get_feedback_lowpass" brief="">
+ </member>
+ <member name="tap1/active" type="bool" setter="set_tap1_active" getter="is_tap1_active" brief="">
+ </member>
+ <member name="tap1/delay_ms" type="float" setter="set_tap1_delay_ms" getter="get_tap1_delay_ms" brief="">
+ </member>
+ <member name="tap1/level_db" type="float" setter="set_tap1_level_db" getter="get_tap1_level_db" brief="">
+ </member>
+ <member name="tap1/pan" type="float" setter="set_tap1_pan" getter="get_tap1_pan" brief="">
+ </member>
+ <member name="tap2/active" type="bool" setter="set_tap2_active" getter="is_tap2_active" brief="">
+ </member>
+ <member name="tap2/delay_ms" type="float" setter="set_tap2_delay_ms" getter="get_tap2_delay_ms" brief="">
+ </member>
+ <member name="tap2/level_db" type="float" setter="set_tap2_level_db" getter="get_tap2_level_db" brief="">
+ </member>
+ <member name="tap2/pan" type="float" setter="set_tap2_pan" getter="get_tap2_pan" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectDistortion" inherits="AudioEffect" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_drive" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_keep_hf_hz" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_post_gain" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_pre_gain" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_drive">
+ <argument index="0" name="drive" type="float">
</argument>
- <argument index="1" name="pan" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="set_keep_hf_hz">
+ <argument index="0" name="keep_hf_hz" type="float">
</argument>
- <argument index="2" name="depth" type="float" default="0">
+ <description>
+ </description>
+ </method>
+ <method name="set_mode">
+ <argument index="0" name="mode" type="int">
</argument>
- <argument index="3" name="height" type="float" default="0">
+ <description>
+ </description>
+ </method>
+ <method name="set_post_gain">
+ <argument index="0" name="post_gain" type="float">
</argument>
<description>
- Change the pan of a currently playing voice and, optionally, the depth and height for a positional/3D sound. Panning values are expressed within the -1 to +1 range.
</description>
</method>
- <method name="voice_set_positional">
- <argument index="0" name="voice" type="RID">
+ <method name="set_pre_gain">
+ <argument index="0" name="pre_gain" type="float">
</argument>
- <argument index="1" name="enabled" type="bool">
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="drive" type="float" setter="set_drive" getter="get_drive" brief="">
+ </member>
+ <member name="keep_hf_hz" type="float" setter="set_keep_hf_hz" getter="get_keep_hf_hz" brief="">
+ </member>
+ <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="">
+ </member>
+ <member name="post_gain" type="float" setter="set_post_gain" getter="get_post_gain" brief="">
+ </member>
+ <member name="pre_gain" type="float" setter="set_pre_gain" getter="get_pre_gain" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectEQ" inherits="AudioEffect" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_band_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_band_gain_db" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="band_idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_band_gain_db">
+ <argument index="0" name="band_idx" type="int">
+ </argument>
+ <argument index="1" name="volume_db" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectEQ10" inherits="AudioEffectEQ" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectEQ21" inherits="AudioEffectEQ" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectEQ6" inherits="AudioEffectEQ" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectFilter" inherits="AudioEffect" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_cutoff" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_db" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_gain" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_resonance" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_cutoff">
+ <argument index="0" name="freq" type="float">
</argument>
<description>
- Set whether a given voice is positional. This is only interpreted as a hint and used for backends that may support binaural encoding.
</description>
</method>
- <method name="voice_set_reverb">
- <argument index="0" name="voice" type="RID">
+ <method name="set_db">
+ <argument index="0" name="amount" type="int">
</argument>
- <argument index="1" name="room" type="int">
+ <description>
+ </description>
+ </method>
+ <method name="set_gain">
+ <argument index="0" name="amount" type="float">
</argument>
- <argument index="2" name="reverb" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="set_resonance">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
- Set the reverb send post processing for the voice (from 0 to 1) and the reverb type, from the REVERB_* enum.
</description>
</method>
- <method name="voice_set_volume">
- <argument index="0" name="voice" type="RID">
+ </methods>
+ <members>
+ <member name="cutoff_hz" type="float" setter="set_cutoff" getter="get_cutoff" brief="">
+ </member>
+ <member name="dB" type="int" setter="set_db" getter="get_db" brief="">
+ </member>
+ <member name="gain" type="float" setter="set_gain" getter="get_gain" brief="">
+ </member>
+ <member name="resonance" type="float" setter="set_resonance" getter="get_resonance" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectHighPassFilter" inherits="AudioEffectFilter" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectHighShelfFilter" inherits="AudioEffectFilter" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectLimiter" inherits="AudioEffect" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_ceiling_db" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_soft_clip_db" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_soft_clip_ratio" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_threshold_db" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_ceiling_db">
+ <argument index="0" name="ceiling" type="float">
</argument>
- <argument index="1" name="volume" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="set_soft_clip_db">
+ <argument index="0" name="soft_clip" type="float">
</argument>
<description>
- Change the volume of a currently playing voice. Volume is expressed as linear gain where 0.0 is mute and 1.0 is default.
</description>
</method>
- <method name="voice_stop">
- <argument index="0" name="voice" type="RID">
+ <method name="set_soft_clip_ratio">
+ <argument index="0" name="soft_clip" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_threshold_db">
+ <argument index="0" name="threshold" type="float">
</argument>
<description>
- Stop a given voice.
</description>
</method>
</methods>
+ <members>
+ <member name="ceiling_db" type="float" setter="set_ceiling_db" getter="get_ceiling_db" brief="">
+ </member>
+ <member name="soft_clip_db" type="float" setter="set_soft_clip_db" getter="get_soft_clip_db" brief="">
+ </member>
+ <member name="soft_clip_ratio" type="float" setter="set_soft_clip_ratio" getter="get_soft_clip_ratio" brief="">
+ </member>
+ <member name="threshold_db" type="float" setter="set_threshold_db" getter="get_threshold_db" brief="">
+ </member>
+ </members>
<constants>
- <constant name="SAMPLE_FORMAT_PCM8" value="0">
- Sample format is 8 bits, signed.
- </constant>
- <constant name="SAMPLE_FORMAT_PCM16" value="1">
- Sample format is 16 bits, little-endian, signed.
- </constant>
- <constant name="SAMPLE_FORMAT_IMA_ADPCM" value="2">
- Sample format is IMA-ADPCM compressed.
- </constant>
- <constant name="SAMPLE_LOOP_NONE" value="0">
- Sample does not loop.
- </constant>
- <constant name="SAMPLE_LOOP_FORWARD" value="1">
- Sample loops in forward mode.
- </constant>
- <constant name="SAMPLE_LOOP_PING_PONG" value="2">
- Sample loops in a bidirectional way.
- </constant>
- <constant name="FILTER_NONE" value="0">
- Filter is disabled.
- </constant>
- <constant name="FILTER_LOWPASS" value="1">
- Filter is a resonant lowpass.
- </constant>
- <constant name="FILTER_BANDPASS" value="2">
- Filter is a resonant bandpass.
- </constant>
- <constant name="FILTER_HIPASS" value="3">
- Filter is a resonant highpass.
- </constant>
- <constant name="FILTER_NOTCH" value="4">
- Filter is a notch (band reject).
- </constant>
- <constant name="FILTER_BANDLIMIT" value="6">
- Filter is a bandlimit (resonance used as highpass).
- </constant>
- <constant name="REVERB_SMALL" value="0">
- Small reverb room (closet, bathroom, etc).
- </constant>
- <constant name="REVERB_MEDIUM" value="1">
- Medium reverb room (living room)
- </constant>
- <constant name="REVERB_LARGE" value="2">
- Large reverb room (warehouse).
- </constant>
- <constant name="REVERB_HALL" value="3">
- Large reverb room with long decay.
- </constant>
</constants>
</class>
-<class name="AudioServerSW" inherits="AudioServer" category="Core">
+<class name="AudioEffectLowPassFilter" inherits="AudioEffectFilter" category="Core">
<brief_description>
- Software implementation of [AudioServer].
</brief_description>
<description>
- This is a software audio server. It does not use any kind of hardware acceleration.
- This class does not expose any new method.
</description>
<methods>
</methods>
<constants>
</constants>
</class>
-<class name="AudioStream" inherits="Resource" category="Core">
+<class name="AudioEffectLowShelfFilter" inherits="AudioEffectFilter" category="Core">
<brief_description>
- Base class for audio streams.
</brief_description>
<description>
- Base class for audio streams. Audio streams are used for music playback, or other types of streamed sounds that don't fit or require more flexibility than a [Sample].
</description>
<methods>
</methods>
<constants>
</constants>
</class>
-<class name="AudioStreamMPC" inherits="AudioStream" category="Core">
+<class name="AudioEffectNotchFilter" inherits="AudioEffectFilter" category="Core">
<brief_description>
- MusePack audio stream driver.
</brief_description>
<description>
- MusePack audio stream driver.
</description>
<methods>
</methods>
<constants>
</constants>
</class>
-<class name="AudioStreamOGGVorbis" inherits="AudioStream" category="Core">
+<class name="AudioEffectPanner" inherits="AudioEffect" category="Core">
<brief_description>
- OGG Vorbis audio stream driver.
</brief_description>
<description>
- OGG Vorbis audio stream driver.
</description>
<methods>
+ <method name="get_pan" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_pan">
+ <argument index="0" name="cpanume" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="pan" type="float" setter="set_pan" getter="get_pan" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
-<class name="AudioStreamOpus" inherits="AudioStream" category="Core">
+<class name="AudioEffectPhaser" inherits="AudioEffect" category="Core">
<brief_description>
- Opus Codec audio stream driver.
</brief_description>
<description>
- Opus Codec audio stream driver.
</description>
<methods>
+ <method name="get_depth" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_feedback" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_range_max_hz" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_range_min_hz" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_rate_hz" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_depth">
+ <argument index="0" name="depth" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_feedback">
+ <argument index="0" name="fbk" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_range_max_hz">
+ <argument index="0" name="hz" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_range_min_hz">
+ <argument index="0" name="hz" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_rate_hz">
+ <argument index="0" name="hz" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="depth" type="float" setter="set_depth" getter="get_depth" brief="">
+ </member>
+ <member name="feedback" type="float" setter="set_feedback" getter="get_feedback" brief="">
+ </member>
+ <member name="range_max_hz" type="float" setter="set_range_max_hz" getter="get_range_max_hz" brief="">
+ </member>
+ <member name="range_min_hz" type="float" setter="set_range_min_hz" getter="get_range_min_hz" brief="">
+ </member>
+ <member name="rate_hz" type="float" setter="set_rate_hz" getter="get_rate_hz" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
-<class name="AudioStreamPlayback" inherits="Reference" category="Core">
+<class name="AudioEffectPitchShift" inherits="AudioEffect" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="get_channels" qualifiers="const">
- <return type="int">
+ <method name="get_pitch_scale" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="get_length" qualifiers="const">
+ <method name="set_pitch_scale">
+ <argument index="0" name="rate" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="AudioEffectReverb" inherits="AudioEffect" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_damping" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_loop_count" qualifiers="const">
- <return type="int">
+ <method name="get_dry" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="get_minimum_buffer_size" qualifiers="const">
- <return type="int">
+ <method name="get_hpf" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="get_mix_rate" qualifiers="const">
- <return type="int">
+ <method name="get_predelay_feedback" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="get_pos" qualifiers="const">
+ <method name="get_predelay_msec" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="has_loop" qualifiers="const">
- <return type="bool">
+ <method name="get_room_size" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="is_playing" qualifiers="const">
- <return type="bool">
+ <method name="get_spread" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="play">
- <argument index="0" name="from_pos_sec" type="float" default="0">
+ <method name="get_wet" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_damping">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
</description>
</method>
- <method name="seek_pos">
- <argument index="0" name="pos" type="float">
+ <method name="set_dry">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_loop">
- <argument index="0" name="enabled" type="bool">
+ <method name="set_hpf">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
</description>
</method>
- <method name="stop">
+ <method name="set_predelay_feedback">
+ <argument index="0" name="feedback" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_predelay_msec">
+ <argument index="0" name="msec" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_room_size">
+ <argument index="0" name="size" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_spread">
+ <argument index="0" name="amount" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_wet">
+ <argument index="0" name="amount" type="float">
+ </argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="damping" type="float" setter="set_damping" getter="get_damping" brief="">
+ </member>
+ <member name="dry" type="float" setter="set_dry" getter="get_dry" brief="">
+ </member>
+ <member name="hipass" type="float" setter="set_hpf" getter="get_hpf" brief="">
+ </member>
+ <member name="predelay_feedback" type="float" setter="set_predelay_msec" getter="get_predelay_msec" brief="">
+ </member>
+ <member name="predelay_msec" type="float" setter="set_predelay_msec" getter="get_predelay_msec" brief="">
+ </member>
+ <member name="room_size" type="float" setter="set_room_size" getter="get_room_size" brief="">
+ </member>
+ <member name="spread" type="float" setter="set_spread" getter="get_spread" brief="">
+ </member>
+ <member name="wet" type="float" setter="set_wet" getter="get_wet" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
-<class name="BackBufferCopy" inherits="Node2D" category="Core">
+<class name="AudioEffectStereoEnhance" inherits="AudioEffect" category="Core">
<brief_description>
- Copies a region of the screen (or the whole screen) to a buffer so it can be accessed with the texscreen() shader instruction.
</brief_description>
<description>
- Node for back-buffering the currently displayed screen. The region defined in the BackBufferCopy node is bufferized with the content of the screen it covers, or the entire screen according to the copy mode set. Accessing this buffer is done with the texscreen() shader instruction.
</description>
<methods>
- <method name="get_copy_mode" qualifiers="const">
- <return type="int">
+ <method name="get_pan_pullout" qualifiers="const">
+ <return type="float">
</return>
<description>
- Return the copy mode currently applied to the BackBufferCopy (refer to constants section).
</description>
</method>
- <method name="get_rect" qualifiers="const">
- <return type="Rect2">
+ <method name="get_surround" qualifiers="const">
+ <return type="float">
</return>
<description>
- Return the area covered by the BackBufferCopy.
</description>
</method>
- <method name="set_copy_mode">
- <argument index="0" name="copy_mode" type="int">
+ <method name="get_time_pullout" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_pan_pullout">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
- Set the copy mode of the BackBufferCopy (refer to constants section).
</description>
</method>
- <method name="set_rect">
- <argument index="0" name="rect" type="Rect2">
+ <method name="set_surround">
+ <argument index="0" name="amount" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_time_pullout">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
- Defines the area covered by the BackBufferCopy.
</description>
</method>
</methods>
+ <members>
+ <member name="pan_pullout" type="float" setter="set_pan_pullout" getter="get_pan_pullout" brief="">
+ </member>
+ <member name="surround" type="float" setter="set_surround" getter="get_surround" brief="">
+ </member>
+ <member name="time_pullout_ms" type="float" setter="set_time_pullout" getter="get_time_pullout" brief="">
+ </member>
+ </members>
<constants>
- <constant name="COPY_MODE_DISABLED" value="0">
- Disables the buffering mode. This means the BackBufferCopy node will directly use the portion of screen it covers.
- </constant>
- <constant name="COPY_MODE_RECT" value="1">
- Sets the copy mode to a region.
- </constant>
- <constant name="COPY_MODE_VIEWPORT" value="2">
- Sets the copy mode to the entire screen.
- </constant>
</constants>
</class>
-<class name="BakedLight" inherits="Resource" category="Core">
+<class name="AudioServer" inherits="Object" category="Core">
<brief_description>
+ Server interface for low level audio access.
</brief_description>
<description>
+ AudioServer is a low level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface.
</description>
<methods>
- <method name="add_lightmap">
- <argument index="0" name="texture" type="Texture">
+ <method name="add_bus">
+ <argument index="0" name="at_pos" type="int" default="-1">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="add_bus_effect">
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="effect" type="AudioEffect">
</argument>
- <argument index="1" name="gen_size" type="Vector2">
+ <argument index="2" name="arg2" type="int" default="-1">
</argument>
<description>
</description>
</method>
- <method name="clear_lightmaps">
+ <method name="generate_bus_layout" qualifiers="const">
+ <return type="AudioBusLayout">
+ </return>
<description>
</description>
</method>
- <method name="erase_lightmap">
- <argument index="0" name="id" type="int">
+ <method name="get_bus_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_bus_effect">
+ <return type="AudioEffect">
+ </return>
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="effect_idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_bus_effect_count">
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="arg1" type="Object">
+ </argument>
+ <argument index="2" name="arg2" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_bus_index" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="bus_name" type="String">
</argument>
<description>
</description>
</method>
- <method name="get_ao_radius" qualifiers="const">
+ <method name="get_bus_name" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_bus_peak_volume_left_db" qualifiers="const">
<return type="float">
</return>
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="channel" type="int">
+ </argument>
<description>
</description>
</method>
- <method name="get_ao_strength" qualifiers="const">
+ <method name="get_bus_peak_volume_right_db" qualifiers="const">
<return type="float">
</return>
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="channel" type="int">
+ </argument>
<description>
</description>
</method>
- <method name="get_bake_flag" qualifiers="const">
- <return type="bool">
+ <method name="get_bus_send" qualifiers="const">
+ <return type="String">
</return>
- <argument index="0" name="flag" type="int">
+ <argument index="0" name="bus_idx" type="int">
</argument>
<description>
</description>
</method>
- <method name="get_bounces" qualifiers="const">
- <return type="int">
+ <method name="get_bus_volume_db" qualifiers="const">
+ <return type="float">
</return>
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
<description>
</description>
</method>
- <method name="get_cell_extra_margin" qualifiers="const">
+ <method name="get_mix_rate" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_cell_subdivision" qualifiers="const">
+ <method name="get_speaker_mode" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="get_edge_damp" qualifiers="const">
- <return type="float">
+ <method name="is_bus_bypassing_effects" qualifiers="const">
+ <return type="bool">
</return>
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
<description>
</description>
</method>
- <method name="get_energy_multiplier" qualifiers="const">
- <return type="float">
+ <method name="is_bus_effect_enabled" qualifiers="const">
+ <return type="bool">
</return>
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="effect_idx" type="int">
+ </argument>
<description>
</description>
</method>
- <method name="get_format" qualifiers="const">
- <return type="int">
+ <method name="is_bus_mute" qualifiers="const">
+ <return type="bool">
</return>
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
<description>
</description>
</method>
- <method name="get_gamma_adjust" qualifiers="const">
- <return type="float">
+ <method name="is_bus_solo" qualifiers="const">
+ <return type="bool">
</return>
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
<description>
</description>
</method>
- <method name="get_initial_lattice_subdiv" qualifiers="const">
- <return type="int">
+ <method name="lock">
+ <description>
+ </description>
+ </method>
+ <method name="move_bus">
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="to_index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="remove_bus">
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="remove_bus_effect">
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="effect_idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bus_bypass_effects">
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bus_count">
+ <argument index="0" name="amount" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bus_effect_enabled">
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="effect_idx" type="int">
+ </argument>
+ <argument index="2" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bus_layout">
+ <argument index="0" name="bus_layout" type="AudioBusLayout">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bus_mute">
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bus_name">
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bus_send">
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="send" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bus_solo">
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bus_volume_db">
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="volume_db" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="swap_bus_effects">
+ <argument index="0" name="bus_idx" type="int">
+ </argument>
+ <argument index="1" name="effect_idx" type="int">
+ </argument>
+ <argument index="2" name="by_effect_idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="unlock">
+ <description>
+ </description>
+ </method>
+ </methods>
+ <signals>
+ <signal name="bus_layout_changed">
+ <description>
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+</class>
+<class name="AudioStream" inherits="Resource" category="Core">
+ <brief_description>
+ Base class for audio streams.
+ </brief_description>
+ <description>
+ Base class for audio streams. Audio streams are used for music playback, or other types of streamed sounds that don't fit or require more flexibility than a [Sample].
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioStreamOGGVorbis" inherits="AudioStream" category="Core">
+ <brief_description>
+ OGG Vorbis audio stream driver.
+ </brief_description>
+ <description>
+ OGG Vorbis audio stream driver.
+ </description>
+ <methods>
+ <method name="get_data" qualifiers="const">
+ <return type="PoolByteArray">
</return>
<description>
</description>
</method>
- <method name="get_light" qualifiers="const">
- <return type="RawArray">
+ <method name="has_loop" qualifiers="const">
+ <return type="bool">
</return>
<description>
</description>
</method>
- <method name="get_mode" qualifiers="const">
+ <method name="set_data">
+ <argument index="0" name="data" type="PoolByteArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_loop">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="data" type="PoolByteArray" setter="set_data" getter="get_data" brief="">
+ </member>
+ <member name="loop" type="bool" setter="set_loop" getter="has_loop" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="AudioStreamPlayback" inherits="Reference" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="AudioStreamPlayer" inherits="Node" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_bus" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_mix_target" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="get_normal_damp" qualifiers="const">
+ <method name="get_pos">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_octree" qualifiers="const">
- <return type="RawArray">
+ <method name="get_stream" qualifiers="const">
+ <return type="Object">
</return>
<description>
</description>
</method>
- <method name="get_plot_size" qualifiers="const">
+ <method name="get_volume_db" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_realtime_color" qualifiers="const">
- <return type="Color">
+ <method name="is_autoplay_enabled">
+ <return type="bool">
</return>
<description>
</description>
</method>
- <method name="get_realtime_color_enabled" qualifiers="const">
+ <method name="is_playing" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="get_realtime_energy" qualifiers="const">
+ <method name="play">
+ <argument index="0" name="from_pos" type="float" default="0">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="seek">
+ <argument index="0" name="to_pos" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_autoplay">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bus">
+ <argument index="0" name="bus" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_mix_target">
+ <argument index="0" name="mix_target" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_stream">
+ <argument index="0" name="stream" type="AudioStream">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_volume_db">
+ <argument index="0" name="volume_db" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="stop">
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" brief="">
+ </member>
+ <member name="bus" type="String" setter="set_bus" getter="get_bus" brief="">
+ </member>
+ <member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" brief="">
+ </member>
+ <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief="">
+ </member>
+ <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" brief="">
+ </member>
+ <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="AudioStreamPlayer2D" inherits="Node2D" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_area_mask" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_attenuation" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_sampler_octree" qualifiers="const">
- <return type="IntArray">
+ <method name="get_bus" qualifiers="const">
+ <return type="String">
</return>
<description>
</description>
</method>
- <method name="get_saturation" qualifiers="const">
+ <method name="get_max_distance" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_tint" qualifiers="const">
+ <method name="get_pos">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_transfer_lightmaps_only_to_uv2" qualifiers="const">
+ <method name="get_stream" qualifiers="const">
+ <return type="Object">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_volume_db" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_autoplay_enabled">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="set_ao_radius">
- <argument index="0" name="ao_radius" type="float">
+ <method name="is_playing" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="play">
+ <argument index="0" name="from_pos" type="float" default="0">
</argument>
<description>
</description>
</method>
- <method name="set_ao_strength">
- <argument index="0" name="ao_strength" type="float">
+ <method name="seek">
+ <argument index="0" name="to_pos" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_bake_flag">
- <argument index="0" name="flag" type="int">
+ <method name="set_area_mask">
+ <argument index="0" name="mask" type="int">
</argument>
- <argument index="1" name="enabled" type="bool">
+ <description>
+ </description>
+ </method>
+ <method name="set_attenuation">
+ <argument index="0" name="curve" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_bounces">
- <argument index="0" name="bounces" type="int">
+ <method name="set_autoplay">
+ <argument index="0" name="enable" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_cell_extra_margin">
- <argument index="0" name="cell_extra_margin" type="float">
+ <method name="set_bus">
+ <argument index="0" name="bus" type="String">
</argument>
<description>
</description>
</method>
- <method name="set_cell_subdivision">
- <argument index="0" name="cell_subdivision" type="int">
+ <method name="set_max_distance">
+ <argument index="0" name="pixels" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_edge_damp">
- <argument index="0" name="edge_damp" type="float">
+ <method name="set_stream">
+ <argument index="0" name="stream" type="AudioStream">
</argument>
<description>
</description>
</method>
- <method name="set_energy_multiplier">
- <argument index="0" name="energy_multiplier" type="float">
+ <method name="set_volume_db">
+ <argument index="0" name="volume_db" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_format">
- <argument index="0" name="format" type="int">
+ <method name="stop">
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="area_mask" type="int" setter="set_area_mask" getter="get_area_mask" brief="">
+ </member>
+ <member name="attenuation" type="float" setter="set_attenuation" getter="get_attenuation" brief="">
+ </member>
+ <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" brief="">
+ </member>
+ <member name="bus" type="String" setter="set_bus" getter="get_bus" brief="">
+ </member>
+ <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" brief="">
+ </member>
+ <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief="">
+ </member>
+ <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" brief="">
+ </member>
+ <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="AudioStreamPlayer3D" inherits="Spatial" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_area_mask" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_attenuation_filter_cutoff_hz" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_attenuation_filter_db" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_attenuation_model" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_bus" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_doppler_tracking" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_emission_angle" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_emission_angle_filter_attenuation_db" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_max_db" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_max_distance" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_out_of_range_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_pos">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_stream" qualifiers="const">
+ <return type="Object">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_unit_db" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_unit_size" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_autoplay_enabled">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_emission_angle_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_playing" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="play">
+ <argument index="0" name="from_pos" type="float" default="0">
</argument>
<description>
</description>
</method>
- <method name="set_gamma_adjust">
- <argument index="0" name="gamma_adjust" type="float">
+ <method name="seek">
+ <argument index="0" name="to_pos" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_initial_lattice_subdiv">
- <argument index="0" name="cell_subdivision" type="int">
+ <method name="set_area_mask">
+ <argument index="0" name="mask" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_light">
- <argument index="0" name="light" type="RawArray">
+ <method name="set_attenuation_filter_cutoff_hz">
+ <argument index="0" name="degrees" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_mode">
- <argument index="0" name="mode" type="int">
+ <method name="set_attenuation_filter_db">
+ <argument index="0" name="db" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_attenuation_model">
+ <argument index="0" name="model" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_normal_damp">
- <argument index="0" name="normal_damp" type="float">
+ <method name="set_autoplay">
+ <argument index="0" name="enable" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_octree">
- <argument index="0" name="octree" type="RawArray">
+ <method name="set_bus">
+ <argument index="0" name="bus" type="String">
</argument>
<description>
</description>
</method>
- <method name="set_plot_size">
- <argument index="0" name="plot_size" type="float">
+ <method name="set_doppler_tracking">
+ <argument index="0" name="mode" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_realtime_color">
- <argument index="0" name="tint" type="Color">
+ <method name="set_emission_angle">
+ <argument index="0" name="degrees" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_realtime_color_enabled">
+ <method name="set_emission_angle_enabled">
<argument index="0" name="enabled" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_realtime_energy">
- <argument index="0" name="energy" type="float">
+ <method name="set_emission_angle_filter_attenuation_db">
+ <argument index="0" name="db" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_sampler_octree">
- <argument index="0" name="sampler_octree" type="IntArray">
+ <method name="set_max_db">
+ <argument index="0" name="max_db" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_saturation">
- <argument index="0" name="saturation" type="float">
+ <method name="set_max_distance">
+ <argument index="0" name="metres" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_tint">
- <argument index="0" name="tint" type="float">
+ <method name="set_out_of_range_mode">
+ <argument index="0" name="mode" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_transfer_lightmaps_only_to_uv2">
- <argument index="0" name="enable" type="bool">
+ <method name="set_stream">
+ <argument index="0" name="stream" type="AudioStream">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_unit_db">
+ <argument index="0" name="unit_db" type="float">
</argument>
<description>
</description>
</method>
+ <method name="set_unit_size">
+ <argument index="0" name="unit_size" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="stop">
+ <description>
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="area_mask" type="int" setter="set_area_mask" getter="get_area_mask" brief="">
+ </member>
+ <member name="attenuation_filter_cutoff_hz" type="float" setter="set_attenuation_filter_cutoff_hz" getter="get_attenuation_filter_cutoff_hz" brief="">
+ </member>
+ <member name="attenuation_filter_db" type="float" setter="set_attenuation_filter_db" getter="get_attenuation_filter_db" brief="">
+ </member>
+ <member name="attenuation_model" type="int" setter="set_attenuation_model" getter="get_attenuation_model" brief="">
+ </member>
+ <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" brief="">
+ </member>
+ <member name="bus" type="String" setter="set_bus" getter="get_bus" brief="">
+ </member>
+ <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" brief="">
+ </member>
+ <member name="emission_angle_degrees" type="float" setter="set_emission_angle" getter="get_emission_angle" brief="">
+ </member>
+ <member name="emission_angle_enabled" type="bool" setter="set_emission_angle_enabled" getter="is_emission_angle_enabled" brief="">
+ </member>
+ <member name="emission_angle_filter_attenuation_db" type="float" setter="set_emission_angle_filter_attenuation_db" getter="get_emission_angle_filter_attenuation_db" brief="">
+ </member>
+ <member name="max_db" type="float" setter="set_max_db" getter="get_max_db" brief="">
+ </member>
+ <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" brief="">
+ </member>
+ <member name="out_of_range_mode" type="int" setter="set_out_of_range_mode" getter="get_out_of_range_mode" brief="">
+ </member>
+ <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief="">
+ </member>
+ <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" brief="">
+ </member>
+ <member name="unit_db" type="float" setter="set_unit_db" getter="get_unit_db" brief="">
+ </member>
+ <member name="unit_size" type="float" setter="set_unit_size" getter="get_unit_size" brief="">
+ </member>
+ </members>
<constants>
- <constant name="MODE_OCTREE" value="0">
+ <constant name="ATTENUATION_INVERSE_DISTANCE" value="0">
+ </constant>
+ <constant name="ATTENUATION_INVERSE_SQUARE_DISTANCE" value="1">
</constant>
- <constant name="MODE_LIGHTMAPS" value="1">
+ <constant name="ATTENUATION_LOGARITHMIC" value="2">
</constant>
- <constant name="BAKE_DIFFUSE" value="0">
+ <constant name="OUT_OF_RANGE_MIX" value="0">
</constant>
- <constant name="BAKE_SPECULAR" value="1">
+ <constant name="OUT_OF_RANGE_PAUSE" value="1">
</constant>
- <constant name="BAKE_TRANSLUCENT" value="2">
+ <constant name="DOPPLER_TRACKING_DISABLED" value="0">
</constant>
- <constant name="BAKE_CONSERVE_ENERGY" value="3">
+ <constant name="DOPPLER_TRACKING_IDLE_STEP" value="1">
</constant>
- <constant name="BAKE_MAX" value="5">
+ <constant name="DOPPLER_TRACKING_FIXED_STEP" value="2">
</constant>
</constants>
</class>
-<class name="BakedLightInstance" inherits="VisualInstance" category="Core">
+<class name="AudioStreamRandomPitch" inherits="AudioStream" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="get_baked_light" qualifiers="const">
+ <method name="get_audio_stream" qualifiers="const">
<return type="Object">
</return>
<description>
</description>
</method>
- <method name="get_baked_light_instance" qualifiers="const">
- <return type="RID">
+ <method name="get_random_pitch" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="set_baked_light">
- <argument index="0" name="baked_light" type="Object">
+ <method name="set_audio_stream">
+ <argument index="0" name="stream" type="Object">
</argument>
<description>
</description>
</method>
- </methods>
- <signals>
- <signal name="baked_light_changed">
+ <method name="set_random_pitch">
+ <argument index="0" name="scale" type="float">
+ </argument>
<description>
</description>
- </signal>
- </signals>
+ </method>
+ </methods>
+ <members>
+ <member name="audio_stream" type="AudioStream" setter="set_audio_stream" getter="get_audio_stream" brief="">
+ </member>
+ <member name="random_pitch" type="float" setter="set_random_pitch" getter="get_random_pitch" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
-<class name="BakedLightSampler" inherits="VisualInstance" category="Core">
+<class name="AudioStreamSample" inherits="AudioStream" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="get_param" qualifiers="const">
- <return type="float">
+ <method name="get_data" qualifiers="const">
+ <return type="PoolByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_format" qualifiers="const">
+ <return type="int">
</return>
- <argument index="0" name="param" type="int">
- </argument>
<description>
</description>
</method>
- <method name="get_resolution" qualifiers="const">
+ <method name="get_loop_begin" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="set_param">
- <argument index="0" name="param" type="int">
+ <method name="get_loop_end" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_loop_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_mix_rate" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_stereo" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_data">
+ <argument index="0" name="data" type="PoolByteArray">
</argument>
- <argument index="1" name="value" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="set_format">
+ <argument index="0" name="format" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_resolution">
- <argument index="0" name="resolution" type="int">
+ <method name="set_loop_begin">
+ <argument index="0" name="loop_begin" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_loop_end">
+ <argument index="0" name="loop_end" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_loop_mode">
+ <argument index="0" name="loop_mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_mix_rate">
+ <argument index="0" name="mix_rate" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_stereo">
+ <argument index="0" name="stereo" type="bool">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="data" type="PoolByteArray" setter="set_data" getter="get_data" brief="">
+ </member>
+ <member name="format" type="int" setter="set_format" getter="get_format" brief="">
+ </member>
+ <member name="loop_begin" type="int" setter="set_loop_begin" getter="get_loop_begin" brief="">
+ </member>
+ <member name="loop_end" type="int" setter="set_loop_end" getter="get_loop_end" brief="">
+ </member>
+ <member name="loop_mode" type="int" setter="set_loop_mode" getter="get_loop_mode" brief="">
+ </member>
+ <member name="mix_rate" type="int" setter="set_mix_rate" getter="get_mix_rate" brief="">
+ </member>
+ <member name="stereo" type="bool" setter="set_stereo" getter="is_stereo" brief="">
+ </member>
+ </members>
<constants>
- <constant name="PARAM_RADIUS" value="0">
- </constant>
- <constant name="PARAM_STRENGTH" value="1">
- </constant>
- <constant name="PARAM_ATTENUATION" value="2">
+ </constants>
+</class>
+<class name="BackBufferCopy" inherits="Node2D" category="Core">
+ <brief_description>
+ Copies a region of the screen (or the whole screen) to a buffer so it can be accessed with the texscreen() shader instruction.
+ </brief_description>
+ <description>
+ Node for back-buffering the currently displayed screen. The region defined in the BackBufferCopy node is bufferized with the content of the screen it covers, or the entire screen according to the copy mode set. Accessing this buffer is done with the texscreen() shader instruction.
+ </description>
+ <methods>
+ <method name="get_copy_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Return the copy mode currently applied to the BackBufferCopy (refer to constants section).
+ </description>
+ </method>
+ <method name="get_rect" qualifiers="const">
+ <return type="Rect2">
+ </return>
+ <description>
+ Return the area covered by the BackBufferCopy.
+ </description>
+ </method>
+ <method name="set_copy_mode">
+ <argument index="0" name="copy_mode" type="int">
+ </argument>
+ <description>
+ Set the copy mode of the BackBufferCopy (refer to constants section).
+ </description>
+ </method>
+ <method name="set_rect">
+ <argument index="0" name="rect" type="Rect2">
+ </argument>
+ <description>
+ Defines the area covered by the BackBufferCopy.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="copy_mode" type="int" setter="set_copy_mode" getter="get_copy_mode" brief="">
+ </member>
+ <member name="rect" type="Rect2" setter="set_rect" getter="get_rect" brief="">
+ </member>
+ </members>
+ <constants>
+ <constant name="COPY_MODE_DISABLED" value="0">
+ Disables the buffering mode. This means the BackBufferCopy node will directly use the portion of screen it covers.
</constant>
- <constant name="PARAM_DETAIL_RATIO" value="3">
+ <constant name="COPY_MODE_RECT" value="1">
+ Sets the copy mode to a region.
</constant>
- <constant name="PARAM_MAX" value="4">
+ <constant name="COPY_MODE_VIEWPORT" value="2">
+ Sets the copy mode to the entire screen.
</constant>
</constants>
</class>
@@ -5951,11 +7458,17 @@
Called when button is toggled (only if toggle_mode is active).
</description>
</method>
- <method name="get_click_on_press" qualifiers="const">
- <return type="bool">
+ <method name="get_action_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Return the current mode of action (see [method set_action_mode]) (one of the ACTION_MODE_* constants).
+ </description>
+ </method>
+ <method name="get_button_group" qualifiers="const">
+ <return type="Object">
</return>
<description>
- Return the state of the click_on_press property (see [method set_click_on_press]).
</description>
</method>
<method name="get_draw_mode" qualifiers="const">
@@ -6006,11 +7519,17 @@
Return the toggle_mode property (see [method set_toggle_mode]).
</description>
</method>
- <method name="set_click_on_press">
- <argument index="0" name="enable" type="bool">
+ <method name="set_action_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ Set the current mode of action, determining when the button is considered clicked (see the ACTION_MODE_* constants).
+ </description>
+ </method>
+ <method name="set_button_group">
+ <argument index="0" name="button_group" type="Object">
</argument>
<description>
- Set the button click_on_press mode. This mode generates click events when a mouse button or key is just pressed (by default events are generated when the button/keys are released and both press and release occur in the visual area of the Button).
</description>
</method>
<method name="set_disabled">
@@ -6048,6 +7567,22 @@
</description>
</method>
</methods>
+ <members>
+ <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" brief="">
+ </member>
+ <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief="">
+ </member>
+ <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" brief="">
+ </member>
+ <member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group" brief="">
+ </member>
+ <member name="is_pressed" type="bool" setter="set_pressed" getter="is_pressed" brief="">
+ </member>
+ <member name="shortcut" type="ShortCut" setter="set_shortcut" getter="get_shortcut" brief="">
+ </member>
+ <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" brief="">
+ </member>
+ </members>
<signals>
<signal name="button_down">
<description>
@@ -6064,11 +7599,6 @@
This signal is emitted every time the button is toggled or pressed (i.e. activated, so on [code]button_down[/code] if "Click on press" is active and on [code]button_up[/code] otherwise).
</description>
</signal>
- <signal name="released">
- <description>
- Emitted when the button was released. This is only emitted by non-toggle buttons and if "Click on press" is active.
- </description>
- </signal>
<signal name="toggled">
<argument index="0" name="pressed" type="bool">
</argument>
@@ -6090,6 +7620,212 @@
<constant name="DRAW_DISABLED" value="3">
The state of buttons are disabled.
</constant>
+ <constant name="ACTION_MODE_BUTTON_PRESS" value="0">
+ Require just a press to consider the button clicked.
+ </constant>
+ <constant name="ACTION_MODE_BUTTON_RELEASE" value="1">
+ Require a press and a subsequent release before considering the button clicked.
+ </constant>
+ </constants>
+</class>
+<class name="Basis" category="Built-In Types">
+ <brief_description>
+ 3x3 matrix datatype.
+ </brief_description>
+ <description>
+ 3x3 matrix used for 3D rotation and scale. Contains 3 vector fields x,y and z as its columns, which can be interpreted as the local basis vectors of a transformation. Can also be accessed as array of 3D vectors. These vectors are orthogonal to each other, but are not necessarily normalized. Almost always used as orthogonal basis for a [Transform].
+ For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S).
+ </description>
+ <methods>
+ <method name="Basis">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="from" type="Quat">
+ </argument>
+ <description>
+ Create a rotation matrix from the given quaternion.
+ </description>
+ </method>
+ <method name="Basis">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="euler" type="Vector3">
+ </argument>
+ <description>
+ Create a rotation matrix (in the YXZ convention: first Z, then X, and Y last) from the specified Euler angles, given in the vector format as (X-angle, Y-angle, Z-angle).
+ </description>
+ </method>
+ <method name="Basis">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="axis" type="Vector3">
+ </argument>
+ <argument index="1" name="phi" type="float">
+ </argument>
+ <description>
+ Create a rotation matrix which rotates around the given axis by the specified angle. The axis must be a normalized vector.
+ </description>
+ </method>
+ <method name="Basis">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="x_axis" type="Vector3">
+ </argument>
+ <argument index="1" name="y_axis" type="Vector3">
+ </argument>
+ <argument index="2" name="z_axis" type="Vector3">
+ </argument>
+ <description>
+ Create a matrix from 3 axis vectors.
+ </description>
+ </method>
+ <method name="determinant">
+ <return type="float">
+ </return>
+ <description>
+ Return the determinant of the matrix.
+ </description>
+ </method>
+ <method name="get_euler">
+ <return type="Vector3">
+ </return>
+ <description>
+ Assuming that the matrix is a proper rotation matrix (orthonormal matrix with determinant +1), return Euler angles (in the YXZ convention: first Z, then X, and Y last). Returned vector contains the rotation angles in the format (X-angle, Y-angle, Z-angle).
+ </description>
+ </method>
+ <method name="get_orthogonal_index">
+ <return type="int">
+ </return>
+ <description>
+ This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x,y,z) with each component being either -1,0 or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the grid map editor. For further details, refer to Godot source code.
+ </description>
+ </method>
+ <method name="get_scale">
+ <return type="Vector3">
+ </return>
+ <description>
+ Assuming that the matrix is the combination of a rotation and scaling, return the absolute value of scaling factors along each axis.
+ </description>
+ </method>
+ <method name="inverse">
+ <return type="Basis">
+ </return>
+ <description>
+ Return the inverse of the matrix.
+ </description>
+ </method>
+ <method name="orthonormalized">
+ <return type="Basis">
+ </return>
+ <description>
+ Return the orthonormalized version of the matrix (useful to call from time to time to avoid rounding error for orthogonal matrices). This performs a Gram-Schmidt orthonormalization on the basis of the matrix.
+ </description>
+ </method>
+ <method name="rotated">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="axis" type="Vector3">
+ </argument>
+ <argument index="1" name="phi" type="float">
+ </argument>
+ <description>
+ Introduce an additional rotation around the given axis by phi (radians). Only relevant when the matrix is being used as a part of [Transform]. The axis must be a normalized vector.
+ </description>
+ </method>
+ <method name="scaled">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="scale" type="Vector3">
+ </argument>
+ <description>
+ Introduce an additional scaling specified by the given 3D scaling factor. Only relevant when the matrix is being used as a part of [Transform].
+ </description>
+ </method>
+ <method name="set_rotation_axis_angle">
+ <argument index="0" name="axis" type="Vector3">
+ </argument>
+ <argument index="1" name="angle" type="float">
+ </argument>
+ <description>
+ Changes only the rotation part of the [Basis] to a rotation around given axis by phi, while preserving the scaling part (as determined by get_scale).
+ </description>
+ </method>
+ <method name="set_rotation_euler">
+ <argument index="0" name="euler" type="Vector3">
+ </argument>
+ <description>
+ Changes only the rotation part of the [Basis] to a rotation corresponding to given Euler angles, while preserving the scaling part (as determined by get_scale).
+ </description>
+ </method>
+ <method name="set_scale">
+ <argument index="0" name="scale" type="Vector3">
+ </argument>
+ <description>
+ Changes only the scaling part of the Basis to the specified scaling, while preserving the rotation part (as determined by get_rotation).
+ </description>
+ </method>
+ <method name="tdotx">
+ <return type="float">
+ </return>
+ <argument index="0" name="with" type="Vector3">
+ </argument>
+ <description>
+ Transposed dot product with the x axis of the matrix.
+ </description>
+ </method>
+ <method name="tdoty">
+ <return type="float">
+ </return>
+ <argument index="0" name="with" type="Vector3">
+ </argument>
+ <description>
+ Transposed dot product with the y axis of the matrix.
+ </description>
+ </method>
+ <method name="tdotz">
+ <return type="float">
+ </return>
+ <argument index="0" name="with" type="Vector3">
+ </argument>
+ <description>
+ Transposed dot product with the z axis of the matrix.
+ </description>
+ </method>
+ <method name="transposed">
+ <return type="Basis">
+ </return>
+ <description>
+ Return the transposed version of the matrix.
+ </description>
+ </method>
+ <method name="xform">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="v" type="Vector3">
+ </argument>
+ <description>
+ Return a vector transformed (multiplied) by the matrix.
+ </description>
+ </method>
+ <method name="xform_inv">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="v" type="Vector3">
+ </argument>
+ <description>
+ Return a vector transformed (multiplied) by the transposed matrix. Note that this results in a multiplication by the inverse of the matrix only if it represents a rotation-reflection.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="x" type="Vector3" setter="" getter="" brief="">
+ </member>
+ <member name="y" type="Vector3" setter="" getter="" brief="">
+ </member>
+ <member name="z" type="Vector3" setter="" getter="" brief="">
+ </member>
+ </members>
+ <constants>
</constants>
</class>
<class name="BitMap" inherits="Resource" category="Core">
@@ -6105,7 +7841,7 @@
</description>
</method>
<method name="create_from_image_alpha">
- <argument index="0" name="image" type="Image">
+ <argument index="0" name="image" type="Object">
</argument>
<description>
</description>
@@ -6147,6 +7883,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -6271,6 +8011,22 @@
</description>
</method>
</methods>
+ <members>
+ <member name="ascent" type="float" setter="set_ascent" getter="get_ascent" brief="">
+ </member>
+ <member name="chars" type="PoolIntArray" setter="_set_chars" getter="_get_chars" brief="">
+ </member>
+ <member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint" brief="">
+ </member>
+ <member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback" brief="">
+ </member>
+ <member name="height" type="float" setter="set_height" getter="get_height" brief="">
+ </member>
+ <member name="kernings" type="PoolIntArray" setter="_set_kernings" getter="_get_kernings" brief="">
+ </member>
+ <member name="textures" type="Array" setter="_set_textures" getter="_get_textures" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -6282,6 +8038,18 @@
This node must be the child of a [Skeleton] node. You can then select a bone for this node to attach to. The BoneAttachment node will copy the transform of the selected bone.
</description>
<methods>
+ <method name="get_bone_name" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_bone_name">
+ <argument index="0" name="bone_name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
@@ -6317,6 +8085,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="alignment" type="int" setter="set_alignment" getter="get_alignment" brief="">
+ </member>
+ </members>
<constants>
<constant name="ALIGN_BEGIN" value="0">
Align children with beginning of the container.
@@ -6352,6 +8124,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -6434,6 +8210,18 @@
</description>
</method>
</methods>
+ <members>
+ <member name="align" type="int" setter="set_text_align" getter="get_text_align" brief="">
+ </member>
+ <member name="clip_text" type="bool" setter="set_clip_text" getter="get_clip_text" brief="">
+ </member>
+ <member name="flat" type="bool" setter="set_flat" getter="is_flat" brief="">
+ </member>
+ <member name="icon" type="Texture" setter="set_button_icon" getter="get_button_icon" brief="">
+ </member>
+ <member name="text" type="String" setter="set_text" getter="get_text" brief="">
+ </member>
+ </members>
<constants>
<constant name="ALIGN_LEFT" value="0">
Align the text to the left.
@@ -6470,136 +8258,7 @@
</theme_item>
</theme_items>
</class>
-<class name="ButtonArray" inherits="Control" category="Core">
- <brief_description>
- Array of Buttons.
- </brief_description>
- <description>
- Array of Buttons. A ButtonArray is useful to have an array of buttons laid out vertically or horizontally. Only one button can be selected, and is referenced by its index in the array (first button is 0, second button is 1, etc.).
- This is useful [i]e.g.[/i] for joypad-friendly interfaces and option menus.
- </description>
- <methods>
- <method name="add_button">
- <argument index="0" name="text" type="String">
- </argument>
- <description>
- Append a new button to the array, with the specified text.
- </description>
- </method>
- <method name="add_icon_button">
- <argument index="0" name="icon" type="Texture">
- </argument>
- <argument index="1" name="text" type="String" default="&quot;&quot;">
- </argument>
- <description>
- Append a new button to the array, with the specified icon and text.
- </description>
- </method>
- <method name="clear">
- <description>
- Remove all buttons from the array.
- </description>
- </method>
- <method name="erase_button">
- <argument index="0" name="button_idx" type="int">
- </argument>
- <description>
- Remove the specified button in the array.
- </description>
- </method>
- <method name="get_button_count" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the amount of buttons in the array.
- </description>
- </method>
- <method name="get_button_icon" qualifiers="const">
- <return type="Texture">
- </return>
- <argument index="0" name="button_idx" type="int">
- </argument>
- <description>
- Return the icon of the specified button.
- </description>
- </method>
- <method name="get_button_text" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="button_idx" type="int">
- </argument>
- <description>
- Return the text of the specified button.
- </description>
- </method>
- <method name="get_hovered" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the index of the currently hovered button in the array.
- </description>
- </method>
- <method name="get_selected" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the index of the currently selected button in the array.
- </description>
- </method>
- <method name="set_button_icon">
- <argument index="0" name="button_idx" type="int">
- </argument>
- <argument index="1" name="icon" type="Texture">
- </argument>
- <description>
- Set the icon of the specified button.
- </description>
- </method>
- <method name="set_button_text">
- <argument index="0" name="button_idx" type="int">
- </argument>
- <argument index="1" name="text" type="String">
- </argument>
- <description>
- Define the text of the specified button.
- </description>
- </method>
- <method name="set_selected">
- <argument index="0" name="button_idx" type="int">
- </argument>
- <description>
- Select a button in the array based on the given index.
- </description>
- </method>
- </methods>
- <signals>
- <signal name="button_selected">
- <argument index="0" name="button_idx" type="int">
- </argument>
- <description>
- A button has been selected, its index is given as the argument.
- </description>
- </signal>
- </signals>
- <constants>
- <constant name="ALIGN_BEGIN" value="0">
- Align buttons at the beginning.
- </constant>
- <constant name="ALIGN_CENTER" value="1">
- Align buttons in the middle.
- </constant>
- <constant name="ALIGN_END" value="2">
- Align buttons at the end.
- </constant>
- <constant name="ALIGN_FILL" value="3">
- Spread the buttons, but keep them small.
- </constant>
- <constant name="ALIGN_EXPAND_FILL" value="4">
- Spread the buttons, but expand them.
- </constant>
- </constants>
-</class>
-<class name="ButtonGroup" inherits="BoxContainer" category="Core">
+<class name="ButtonGroup" inherits="Resource" category="Core">
<brief_description>
Group of Buttons.
</brief_description>
@@ -6607,41 +8266,13 @@
Group of [Button]. All direct and indirect children buttons become radios. Only one allows being pressed.
</description>
<methods>
- <method name="get_button_list" qualifiers="const">
- <return type="Array">
- </return>
- <description>
- Return the list of all the buttons in the group.
- </description>
- </method>
- <method name="get_focused_button" qualifiers="const">
- <return type="BaseButton">
- </return>
- <description>
- Return the focused button.
- </description>
- </method>
- <method name="get_pressed_button" qualifiers="const">
+ <method name="get_pressed_button">
<return type="BaseButton">
</return>
<description>
Return the pressed button.
</description>
</method>
- <method name="get_pressed_button_index" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the index of the pressed button (by tree order).
- </description>
- </method>
- <method name="set_pressed_button">
- <argument index="0" name="button" type="BaseButton">
- </argument>
- <description>
- Set the button to be pressed.
- </description>
- </method>
</methods>
<constants>
</constants>
@@ -6669,6 +8300,18 @@
Get the camera transform. Subclassed cameras (such as CharacterCamera) may provide different transforms than the [Node] transform.
</description>
</method>
+ <method name="get_cull_mask" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_doppler_tracking" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_environment" qualifiers="const">
<return type="Environment">
</return>
@@ -6681,6 +8324,12 @@
<description>
</description>
</method>
+ <method name="get_h_offset" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_keep_aspect_mode" qualifiers="const">
<return type="int">
</return>
@@ -6699,8 +8348,8 @@
<description>
</description>
</method>
- <method name="get_visible_layers" qualifiers="const">
- <return type="int">
+ <method name="get_v_offset" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
@@ -6771,12 +8420,30 @@
Return a 3D position in worldspace, that is the result of projecting a point on the [Viewport] rectangle by the camera projection. This is useful for casting rays in the form of (origin,normal) for object intersection or picking.
</description>
</method>
+ <method name="set_cull_mask">
+ <argument index="0" name="mask" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_doppler_tracking">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_environment">
<argument index="0" name="env" type="Environment">
</argument>
<description>
</description>
</method>
+ <method name="set_h_offset">
+ <argument index="0" name="ofs" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_keep_aspect_mode">
<argument index="0" name="mode" type="int">
</argument>
@@ -6805,8 +8472,8 @@
Set the camera projection to perspective mode, by specifying a [i]FOV[/i] Y angle in degrees (FOV means Field of View), and the [i]near[/i] and [i]far[/i] clip planes in worldspace units.
</description>
</method>
- <method name="set_visible_layers">
- <argument index="0" name="mask" type="int">
+ <method name="set_v_offset">
+ <argument index="0" name="ofs" type="float">
</argument>
<description>
</description>
@@ -6832,6 +8499,12 @@
</constant>
<constant name="KEEP_HEIGHT" value="1">
</constant>
+ <constant name="DOPPLER_TRACKING_DISABLED" value="0">
+ </constant>
+ <constant name="DOPPLER_TRACKING_IDLE_STEP" value="1">
+ </constant>
+ <constant name="DOPPLER_TRACKING_FIXED_STEP" value="2">
+ </constant>
</constants>
</class>
<class name="Camera2D" inherits="Node2D" category="Core">
@@ -6950,18 +8623,36 @@
<description>
</description>
</method>
+ <method name="is_limit_drawing_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_limit_smoothing_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
+ <method name="is_margin_drawing_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_rotating" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
+ <method name="is_screen_drawing_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_v_drag_enabled" qualifiers="const">
<return type="bool">
</return>
@@ -7033,6 +8724,12 @@
Set the scrolling limit in pixels.
</description>
</method>
+ <method name="set_limit_drawing_enabled">
+ <argument index="0" name="limit_drawing_enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_limit_smoothing_enabled">
<argument index="0" name="limit_smoothing_enabled" type="bool">
</argument>
@@ -7041,6 +8738,12 @@
This requires camera smoothing being enabled to have a noticeable effect.
</description>
</method>
+ <method name="set_margin_drawing_enabled">
+ <argument index="0" name="margin_drawing_enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_offset">
<argument index="0" name="offset" type="Vector2">
</argument>
@@ -7054,6 +8757,12 @@
<description>
</description>
</method>
+ <method name="set_screen_drawing_enabled">
+ <argument index="0" name="screen_drawing_enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_v_drag_enabled">
<argument index="0" name="enabled" type="bool">
</argument>
@@ -7073,6 +8782,50 @@
</description>
</method>
</methods>
+ <members>
+ <member name="anchor_mode" type="int" setter="set_anchor_mode" getter="get_anchor_mode" brief="">
+ </member>
+ <member name="current" type="bool" setter="_set_current" getter="is_current" brief="">
+ </member>
+ <member name="drag_margin_bottom" type="float" setter="set_drag_margin" getter="get_drag_margin" brief="">
+ </member>
+ <member name="drag_margin_h_enabled" type="bool" setter="set_h_drag_enabled" getter="is_h_drag_enabled" brief="">
+ </member>
+ <member name="drag_margin_left" type="float" setter="set_drag_margin" getter="get_drag_margin" brief="">
+ </member>
+ <member name="drag_margin_right" type="float" setter="set_drag_margin" getter="get_drag_margin" brief="">
+ </member>
+ <member name="drag_margin_top" type="float" setter="set_drag_margin" getter="get_drag_margin" brief="">
+ </member>
+ <member name="drag_margin_v_enabled" type="bool" setter="set_v_drag_enabled" getter="is_v_drag_enabled" brief="">
+ </member>
+ <member name="editor_draw_drag_margin" type="bool" setter="set_margin_drawing_enabled" getter="is_margin_drawing_enabled" brief="">
+ </member>
+ <member name="editor_draw_limits" type="bool" setter="set_limit_drawing_enabled" getter="is_limit_drawing_enabled" brief="">
+ </member>
+ <member name="editor_draw_screen" type="bool" setter="set_screen_drawing_enabled" getter="is_screen_drawing_enabled" brief="">
+ </member>
+ <member name="limit_bottom" type="int" setter="set_limit" getter="get_limit" brief="">
+ </member>
+ <member name="limit_left" type="int" setter="set_limit" getter="get_limit" brief="">
+ </member>
+ <member name="limit_right" type="int" setter="set_limit" getter="get_limit" brief="">
+ </member>
+ <member name="limit_smoothed" type="bool" setter="set_limit_smoothing_enabled" getter="is_limit_smoothing_enabled" brief="">
+ </member>
+ <member name="limit_top" type="int" setter="set_limit" getter="get_limit" brief="">
+ </member>
+ <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" brief="">
+ </member>
+ <member name="rotating" type="bool" setter="set_rotating" getter="is_rotating" brief="">
+ </member>
+ <member name="smoothing_enabled" type="bool" setter="set_enable_follow_smoothing" getter="is_follow_smoothing_enabled" brief="">
+ </member>
+ <member name="smoothing_speed" type="float" setter="set_follow_smoothing" getter="get_follow_smoothing" brief="">
+ </member>
+ <member name="zoom" type="Vector2" setter="set_zoom" getter="get_zoom" brief="">
+ </member>
+ </members>
<constants>
<constant name="ANCHOR_MODE_DRAG_CENTER" value="1">
</constant>
@@ -7126,14 +8879,16 @@
</description>
</method>
<method name="draw_colored_polygon">
- <argument index="0" name="points" type="Vector2Array">
+ <argument index="0" name="points" type="PoolVector2Array">
</argument>
<argument index="1" name="color" type="Color">
</argument>
- <argument index="2" name="uvs" type="Vector2Array" default="Vector2Array([])">
+ <argument index="2" name="uvs" type="PoolVector2Array" default="PoolVector2Array([])">
</argument>
<argument index="3" name="texture" type="Texture" default="NULL">
</argument>
+ <argument index="4" name="normal_map" type="Texture" default="NULL">
+ </argument>
<description>
Draw a colored polygon of any amount of points, convex or concave.
</description>
@@ -7154,29 +8909,57 @@
</description>
</method>
<method name="draw_polygon">
- <argument index="0" name="points" type="Vector2Array">
+ <argument index="0" name="points" type="PoolVector2Array">
</argument>
- <argument index="1" name="colors" type="ColorArray">
+ <argument index="1" name="colors" type="PoolColorArray">
</argument>
- <argument index="2" name="uvs" type="Vector2Array" default="Vector2Array([])">
+ <argument index="2" name="uvs" type="PoolVector2Array" default="PoolVector2Array([])">
</argument>
<argument index="3" name="texture" type="Texture" default="NULL">
</argument>
+ <argument index="4" name="normal_map" type="Texture" default="NULL">
+ </argument>
<description>
Draw a polygon of any amount of points, convex or concave.
</description>
</method>
+ <method name="draw_polyline">
+ <argument index="0" name="points" type="PoolVector2Array">
+ </argument>
+ <argument index="1" name="color" type="Color">
+ </argument>
+ <argument index="2" name="width" type="float" default="1">
+ </argument>
+ <argument index="3" name="antialiased" type="bool" default="false">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="draw_polyline_colors">
+ <argument index="0" name="points" type="PoolVector2Array">
+ </argument>
+ <argument index="1" name="colors" type="PoolColorArray">
+ </argument>
+ <argument index="2" name="width" type="float" default="1">
+ </argument>
+ <argument index="3" name="antialiased" type="bool" default="false">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="draw_primitive">
- <argument index="0" name="points" type="Vector2Array">
+ <argument index="0" name="points" type="PoolVector2Array">
</argument>
- <argument index="1" name="colors" type="ColorArray">
+ <argument index="1" name="colors" type="PoolColorArray">
</argument>
- <argument index="2" name="uvs" type="Vector2Array">
+ <argument index="2" name="uvs" type="PoolVector2Array">
</argument>
<argument index="3" name="texture" type="Texture" default="NULL">
</argument>
<argument index="4" name="width" type="float" default="1">
</argument>
+ <argument index="5" name="normal_map" type="Texture" default="NULL">
+ </argument>
<description>
Draw a custom primitive, 1 point for a point, 2 points for a line, 3 points for a triangle and 4 points for a quad.
</description>
@@ -7186,6 +8969,8 @@
</argument>
<argument index="1" name="color" type="Color">
</argument>
+ <argument index="2" name="filled" type="bool" default="true">
+ </argument>
<description>
Draw a colored rectangle.
</description>
@@ -7202,7 +8987,7 @@
</description>
</method>
<method name="draw_set_transform_matrix">
- <argument index="0" name="xform" type="Matrix32">
+ <argument index="0" name="xform" type="Transform2D">
</argument>
<description>
</description>
@@ -7238,6 +9023,8 @@
</argument>
<argument index="2" name="modulate" type="Color" default="Color(1,1,1,1)">
</argument>
+ <argument index="3" name="normal_map" type="Texture" default="NULL">
+ </argument>
<description>
Draw a texture at a given position.
</description>
@@ -7253,6 +9040,8 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
+ <argument index="5" name="normal_map" type="Texture" default="NULL">
+ </argument>
<description>
Draw a textured rectangle at a given position, optionally modulated by a color. Transpose swaps the x and y coordinates when reading the texture.
</description>
@@ -7268,6 +9057,10 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
+ <argument index="5" name="normal_map" type="Texture" default="NULL">
+ </argument>
+ <argument index="6" name="clip_uv" type="bool" default="true">
+ </argument>
<description>
Draw a textured rectangle region at a given position, optionally modulated by a color. Transpose swaps the x and y coordinates when reading the texture.
</description>
@@ -7296,14 +9089,7 @@
<argument index="0" name="state" type="Variant">
</argument>
<description>
- Set the transform state of this CanvasItem. For [Node2D], this is an [Array] with (in order) a [Vector2] for position, a float for rotation and another [Vector2] for scale. For [Control] this is a [Rect2] with the position and size.
- </description>
- </method>
- <method name="get_blend_mode" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the current blending mode from enum BLEND_MODE_*.
+ Set the transform state of this CanvasItem. For [Node2D], this is an [Array] with (in order) a [Vector2] for position, a float for rotation (radians) and another [Vector2] for scale. For [Control] this is a [Rect2] with the position and size.
</description>
</method>
<method name="get_canvas" qualifiers="const">
@@ -7321,13 +9107,13 @@
</description>
</method>
<method name="get_canvas_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Get the transform matrix of this item's canvas.
</description>
</method>
- <method name="get_global_mouse_pos" qualifiers="const">
+ <method name="get_global_mouse_position" qualifiers="const">
<return type="Vector2">
</return>
<description>
@@ -7335,14 +9121,14 @@
</description>
</method>
<method name="get_global_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Get the global transform matrix of this item.
</description>
</method>
<method name="get_global_transform_with_canvas" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Get the global transform matrix of this item in relation to the canvas.
@@ -7377,28 +9163,28 @@
</description>
</method>
<method name="get_material" qualifiers="const">
- <return type="CanvasItemMaterial">
+ <return type="Material">
</return>
<description>
Get the material of this item.
</description>
</method>
- <method name="get_opacity" qualifiers="const">
- <return type="float">
+ <method name="get_modulate" qualifiers="const">
+ <return type="Color">
</return>
<description>
- Return the canvas item opacity. This affects the canvas item and all the children.
+ Get the modulate of the CanvasItem, which affects children items too.
</description>
</method>
- <method name="get_self_opacity" qualifiers="const">
- <return type="float">
+ <method name="get_self_modulate" qualifiers="const">
+ <return type="Color">
</return>
<description>
- Return the canvas item self-opacity.
+ Get the self-modulate of the CanvasItem.
</description>
</method>
<method name="get_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Get the transform matrix of this item.
@@ -7419,7 +9205,7 @@
</description>
</method>
<method name="get_viewport_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Get this item's transform in relation to the viewport.
@@ -7444,11 +9230,10 @@
Return whether the item is drawn behind its parent.
</description>
</method>
- <method name="is_hidden" qualifiers="const">
+ <method name="is_local_transform_notification_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
- Return true if this CanvasItem is hidden. Note that the CanvasItem may not be visible, but as long as it's not hidden ([method hide] called) the function will return false.
</description>
</method>
<method name="is_set_as_toplevel" qualifiers="const">
@@ -7458,6 +9243,12 @@
Return if set as toplevel. See [method set_as_toplevel].
</description>
</method>
+ <method name="is_transform_notification_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_visible" qualifiers="const">
<return type="bool">
</return>
@@ -7465,6 +9256,12 @@
Return true if this CanvasItem is visible. It may be invisible because itself or a parent canvas item is hidden.
</description>
</method>
+ <method name="is_visible_in_tree" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="make_canvas_pos_local" qualifiers="const">
<return type="Vector2">
</return>
@@ -7474,12 +9271,11 @@
</description>
</method>
<method name="make_input_local" qualifiers="const">
- <return type="InputEvent">
+ <return type="Object">
</return>
- <argument index="0" name="event" type="InputEvent">
+ <argument index="0" name="event" type="Object">
</argument>
<description>
- Takes a global input event and convert to this item's coordinate system.
</description>
</method>
<method name="set_as_toplevel">
@@ -7489,13 +9285,6 @@
Set as top level. This means that it will not inherit transform from parent canvas items.
</description>
</method>
- <method name="set_blend_mode">
- <argument index="0" name="blend_mode" type="int">
- </argument>
- <description>
- Set the blending mode from enum BLEND_MODE_*.
- </description>
- </method>
<method name="set_draw_behind_parent">
<argument index="0" name="enable" type="bool">
</argument>
@@ -7503,13 +9292,6 @@
Set whether the canvas item is drawn behind its parent.
</description>
</method>
- <method name="set_hidden">
- <argument index="0" name="hidden" type="bool">
- </argument>
- <description>
- Set whether this item should be hidden or not. Note that no matter what is set here this item won't be shown if its parent or grandparents nodes are also hidden. A hidden CanvasItem make all children hidden too.
- </description>
- </method>
<method name="set_light_mask">
<argument index="0" name="light_mask" type="int">
</argument>
@@ -7518,24 +9300,36 @@
</description>
</method>
<method name="set_material">
- <argument index="0" name="material" type="CanvasItemMaterial">
+ <argument index="0" name="material" type="Material">
</argument>
<description>
Set the material of this item.
</description>
</method>
- <method name="set_opacity">
- <argument index="0" name="opacity" type="float">
+ <method name="set_modulate">
+ <argument index="0" name="modulate" type="Color">
+ </argument>
+ <description>
+ Set the modulate of the CanvasItem. This [i]affects[/i] the modulation of children items.
+ </description>
+ </method>
+ <method name="set_notify_local_transform">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_notify_transform">
+ <argument index="0" name="enable" type="bool">
</argument>
<description>
- Set canvas item opacity. This will affect the canvas item and all the children.
</description>
</method>
- <method name="set_self_opacity">
- <argument index="0" name="self_opacity" type="float">
+ <method name="set_self_modulate">
+ <argument index="0" name="self_modulate" type="Color">
</argument>
<description>
- Set canvas item self-opacity. This does not affect the opacity of children items.
+ Set the self-modulate of the CanvasItem. This does not affect the modulation of children items.
</description>
</method>
<method name="set_use_parent_material">
@@ -7545,6 +9339,14 @@
Set whether or not this item should use its parent's material.
</description>
</method>
+ <method name="set_visible">
+ <argument index="0" name="arg0" type="bool">
+ </argument>
+ <description>
+ Set whether this item should be visible or not.
+ Note that a hidden CanvasItem will make all children hidden too, so no matter what is set here this item won't be shown if its parent or grandparents nodes are hidden.
+ </description>
+ </method>
<method name="show">
<description>
Show the CanvasItem currently hidden.
@@ -7556,6 +9358,24 @@
</description>
</method>
</methods>
+ <members>
+ <member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask" brief="">
+ </member>
+ <member name="material" type="ShaderMaterial,CanvasItemMaterial" setter="set_material" getter="get_material" brief="">
+ </member>
+ <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" brief="">
+ </member>
+ <member name="self_modulate" type="Color" setter="set_self_modulate" getter="get_self_modulate" brief="">
+ </member>
+ <member name="show_behind_parent" type="bool" setter="set_draw_behind_parent" getter="is_draw_behind_parent_enabled" brief="">
+ </member>
+ <member name="show_on_top" type="bool" setter="_set_on_top" getter="_is_on_top" brief="">
+ </member>
+ <member name="use_parent_material" type="bool" setter="set_use_parent_material" getter="get_use_parent_material" brief="">
+ </member>
+ <member name="visible" type="bool" setter="set_visible" getter="is_visible" brief="">
+ </member>
+ </members>
<signals>
<signal name="draw">
<description>
@@ -7611,78 +9431,60 @@
</constant>
</constants>
</class>
-<class name="CanvasItemMaterial" inherits="Resource" category="Core">
+<class name="CanvasItemMaterial" inherits="Material" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="get_shader" qualifiers="const">
- <return type="Shader">
+ <method name="get_blend_mode" qualifiers="const">
+ <return type="int">
</return>
<description>
</description>
</method>
- <method name="get_shader_param" qualifiers="const">
- <argument index="0" name="param" type="String">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_shading_mode" qualifiers="const">
+ <method name="get_light_mode" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="set_shader">
- <argument index="0" name="shader" type="Shader">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_shader_param">
- <argument index="0" name="param" type="String">
- </argument>
- <argument index="1" name="value" type="Variant">
+ <method name="set_blend_mode">
+ <argument index="0" name="blend_mode" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_shading_mode">
- <argument index="0" name="mode" type="int">
+ <method name="set_light_mode">
+ <argument index="0" name="light_mode" type="int">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" brief="">
+ </member>
+ <member name="light_mode" type="int" setter="set_light_mode" getter="get_light_mode" brief="">
+ </member>
+ </members>
<constants>
- <constant name="SHADING_NORMAL" value="0">
+ <constant name="BLEND_MODE_MIX" value="0">
+ </constant>
+ <constant name="BLEND_MODE_ADD" value="1">
</constant>
- <constant name="SHADING_UNSHADED" value="1">
+ <constant name="BLEND_MODE_SUB" value="2">
</constant>
- <constant name="SHADING_ONLY_LIGHT" value="2">
+ <constant name="BLEND_MODE_MUL" value="3">
+ </constant>
+ <constant name="BLEND_MODE_PREMULT_ALPHA" value="4">
+ </constant>
+ <constant name="LIGHT_MODE_NORMAL" value="0">
+ </constant>
+ <constant name="LIGHT_MODE_UNSHADED" value="1">
+ </constant>
+ <constant name="LIGHT_MODE_LIGHT_ONLY" value="2">
</constant>
- </constants>
-</class>
-<class name="CanvasItemShader" inherits="Shader" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="CanvasItemShaderGraph" inherits="ShaderGraph" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
- <constants>
</constants>
</class>
<class name="CanvasLayer" inherits="Node" category="Core">
@@ -7717,14 +9519,14 @@
<return type="float">
</return>
<description>
- Return the base rotation for this layer (helper).
+ Return the base rotation for this layer in radians (helper).
</description>
</method>
<method name="get_rotationd" qualifiers="const">
<return type="float">
</return>
<description>
- Get rotation of the layer in degree.
+ Return the base rotation for this layer in degrees.
</description>
</method>
<method name="get_scale" qualifiers="const">
@@ -7735,7 +9537,7 @@
</description>
</method>
<method name="get_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Return the base transform for this layer.
@@ -7772,14 +9574,14 @@
<argument index="0" name="radians" type="float">
</argument>
<description>
- Set the base rotation for this layer (helper).
+ Set the base rotation for this layer in radians (helper).
</description>
</method>
<method name="set_rotationd">
<argument index="0" name="degrees" type="float">
</argument>
<description>
- Set rotation of the layer in degree.
+ Set the base rotation for this layer in degrees (helper).
</description>
</method>
<method name="set_scale">
@@ -7790,13 +9592,23 @@
</description>
</method>
<method name="set_transform">
- <argument index="0" name="transform" type="Matrix32">
+ <argument index="0" name="transform" type="Transform2D">
</argument>
<description>
Set the base transform for this layer.
</description>
</method>
</methods>
+ <members>
+ <member name="layer" type="int" setter="set_layer" getter="get_layer" brief="">
+ </member>
+ <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" brief="">
+ </member>
+ <member name="rotation" type="float" setter="set_rotationd" getter="get_rotationd" brief="">
+ </member>
+ <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -7823,6 +9635,78 @@
</description>
</method>
</methods>
+ <members>
+ <member name="color" type="Color" setter="set_color" getter="get_color" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="CapsuleMesh" inherits="PrimitiveMesh" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_mid_height" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_radial_segments" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_radius" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_rings" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_mid_height">
+ <argument index="0" name="mid_height" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_radial_segments">
+ <argument index="0" name="segments" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_radius">
+ <argument index="0" name="radius" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_rings">
+ <argument index="0" name="rings" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="mid_height" type="float" setter="set_mid_height" getter="get_mid_height" brief="">
+ </member>
+ <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" brief="">
+ </member>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius" brief="">
+ </member>
+ <member name="rings" type="int" setter="set_rings" getter="get_rings" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -7863,6 +9747,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="height" type="float" setter="set_height" getter="get_height" brief="">
+ </member>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -7903,6 +9793,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="height" type="float" setter="set_height" getter="get_height" brief="">
+ </member>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -7929,6 +9825,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="use_top_left" type="bool" setter="set_use_top_left" getter="is_using_top_left" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -8043,137 +9943,332 @@
</description>
</method>
</methods>
+ <members>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
-<class name="CollisionObject" inherits="Spatial" category="Core">
+<class name="ClassDB" inherits="Object" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="_input_event" qualifiers="virtual">
- <argument index="0" name="camera" type="Object">
+ <method name="can_instance" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="class" type="String">
</argument>
- <argument index="1" name="event" type="InputEvent">
+ <description>
+ </description>
+ </method>
+ <method name="class_exists" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="class" type="String">
</argument>
- <argument index="2" name="click_pos" type="Vector3">
+ <description>
+ </description>
+ </method>
+ <method name="class_get_category" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="class" type="String">
</argument>
- <argument index="3" name="click_normal" type="Vector3">
+ <description>
+ </description>
+ </method>
+ <method name="class_get_integer_constant" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="class" type="String">
</argument>
- <argument index="4" name="shape_idx" type="int">
+ <argument index="1" name="name" type="String">
</argument>
<description>
</description>
</method>
- <method name="add_shape">
- <argument index="0" name="shape" type="Shape">
+ <method name="class_get_integer_constant_list" qualifiers="const">
+ <return type="PoolStringArray">
+ </return>
+ <argument index="0" name="class" type="String">
</argument>
- <argument index="1" name="transform" type="Transform" default="Transform()">
+ <argument index="1" name="no_inheritance" type="bool" default="false">
</argument>
<description>
</description>
</method>
- <method name="clear_shapes">
+ <method name="class_get_method_list" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="class" type="String">
+ </argument>
+ <argument index="1" name="no_inheritance" type="bool" default="false">
+ </argument>
<description>
</description>
</method>
- <method name="get_capture_input_on_drag" qualifiers="const">
+ <method name="class_get_property" qualifiers="const">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="object" type="Object">
+ </argument>
+ <argument index="1" name="property" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="class_get_property_list" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="class" type="String">
+ </argument>
+ <argument index="1" name="no_inheritance" type="bool" default="false">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="class_get_signal" qualifiers="const">
+ <return type="Dictionary">
+ </return>
+ <argument index="0" name="class" type="String">
+ </argument>
+ <argument index="1" name="signal" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="class_get_signal_list" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="class" type="String">
+ </argument>
+ <argument index="1" name="no_inheritance" type="bool" default="false">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="class_has_integer_constant" qualifiers="const">
<return type="bool">
</return>
+ <argument index="0" name="class" type="String">
+ </argument>
+ <argument index="1" name="name" type="String">
+ </argument>
<description>
</description>
</method>
- <method name="get_rid" qualifiers="const">
- <return type="RID">
+ <method name="class_has_method" qualifiers="const">
+ <return type="bool">
</return>
+ <argument index="0" name="class" type="String">
+ </argument>
+ <argument index="1" name="method" type="String">
+ </argument>
+ <argument index="2" name="no_inheritance" type="bool" default="false">
+ </argument>
<description>
</description>
</method>
- <method name="get_shape" qualifiers="const">
- <return type="Shape">
+ <method name="class_has_signal" qualifiers="const">
+ <return type="bool">
</return>
- <argument index="0" name="shape_idx" type="int">
+ <argument index="0" name="class" type="String">
+ </argument>
+ <argument index="1" name="signal" type="String">
</argument>
<description>
</description>
</method>
- <method name="get_shape_count" qualifiers="const">
- <return type="int">
+ <method name="class_set_property" qualifiers="const">
+ <return type="Error">
</return>
+ <argument index="0" name="object" type="Object">
+ </argument>
+ <argument index="1" name="property" type="String">
+ </argument>
+ <argument index="2" name="value" type="Variant">
+ </argument>
<description>
</description>
</method>
- <method name="get_shape_transform" qualifiers="const">
- <return type="Transform">
+ <method name="get_class_list" qualifiers="const">
+ <return type="PoolStringArray">
</return>
- <argument index="0" name="shape_idx" type="int">
+ <description>
+ </description>
+ </method>
+ <method name="get_inheriters_from_class" qualifiers="const">
+ <return type="PoolStringArray">
+ </return>
+ <argument index="0" name="class" type="String">
</argument>
<description>
</description>
</method>
- <method name="is_ray_pickable" qualifiers="const">
+ <method name="get_parent_class" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="class" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="instance" qualifiers="const">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="class" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="is_class_enabled" qualifiers="const">
<return type="bool">
</return>
+ <argument index="0" name="class" type="String">
+ </argument>
<description>
</description>
</method>
- <method name="is_shape_set_as_trigger" qualifiers="const">
+ <method name="is_parent_class" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="shape_idx" type="int">
+ <argument index="0" name="class" type="String">
+ </argument>
+ <argument index="1" name="inherits" type="String">
</argument>
<description>
</description>
</method>
- <method name="remove_shape">
- <argument index="0" name="shape_idx" type="int">
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="CollisionObject" inherits="Spatial" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="_input_event" qualifiers="virtual">
+ <argument index="0" name="camera" type="Object">
+ </argument>
+ <argument index="1" name="event" type="InputEvent">
+ </argument>
+ <argument index="2" name="click_pos" type="Vector3">
+ </argument>
+ <argument index="3" name="click_normal" type="Vector3">
+ </argument>
+ <argument index="4" name="shape_idx" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_capture_input_on_drag">
- <argument index="0" name="enable" type="bool">
+ <method name="get_capture_input_on_drag" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="create_shape_owner">
+ <return type="int">
+ </return>
+ <argument index="0" name="owner" type="Object">
</argument>
<description>
+ Creates new holder for the shapes. Argument is a [CollisionShape] node. It will return owner_id which usually you will want to save for later use.
</description>
</method>
- <method name="set_ray_pickable">
- <argument index="0" name="ray_pickable" type="bool">
+ <method name="get_rid" qualifiers="const">
+ <return type="RID">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_shape_owners">
+ <return type="Array">
+ </return>
+ <description>
+ Shape owner is a node which is holding concrete shape resources. This method will return an array which is holding an integer numbers that are representing unique ID of each owner. You can use those ids when you are using others shape_owner methods.
+ </description>
+ </method>
+ <method name="shape_owner_clear_shapes">
+ <argument index="0" name="owner_id" type="int">
</argument>
<description>
+ Will remove all the shapes associated with given owner.
</description>
</method>
- <method name="set_shape">
- <argument index="0" name="shape_idx" type="int">
+ <method name="shape_owner_get_shape">
+ <return type="Shape">
+ </return>
+ <argument index="0" name="owner_id" type="int">
</argument>
- <argument index="1" name="shape" type="Shape">
+ <argument index="1" name="shape_id" type="int">
</argument>
<description>
+ Will return a [Shape]. First argument owner_id is an integer that can be obtained from [method get_shape_owners]. Shape_id is a position of the shape inside owner; it's a value in range from 0 to [method shape_owner_get_shape_count].
</description>
</method>
- <method name="set_shape_as_trigger">
- <argument index="0" name="shape_idx" type="int">
+ <method name="shape_owner_get_shape_count">
+ <return type="int">
+ </return>
+ <argument index="0" name="owner_id" type="int">
</argument>
- <argument index="1" name="enable" type="bool">
+ <description>
+ Returns number of shapes to which given owner is associated to.
+ </description>
+ </method>
+ <method name="shape_owner_get_transform">
+ <return type="Transform">
+ </return>
+ <argument index="0" name="owner_id" type="int">
</argument>
<description>
+ Will return [Transform] of an owner node.
</description>
</method>
- <method name="set_shape_transform">
- <argument index="0" name="shape_idx" type="int">
+ <method name="shape_owner_remove_shape">
+ <argument index="0" name="owner_id" type="int">
</argument>
- <argument index="1" name="transform" type="Transform">
+ <argument index="1" name="shape_id" type="int">
+ </argument>
+ <description>
+ Removes related shape from the owner.
+ </description>
+ </method>
+ <method name="is_ray_pickable" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_capture_input_on_drag">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ray_pickable">
+ <argument index="0" name="ray_pickable" type="bool">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="input_capture_on_drag" type="bool" setter="set_capture_input_on_drag" getter="get_capture_input_on_drag" brief="">
+ </member>
+ <member name="input_ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable" brief="">
+ </member>
+ </members>
<signals>
<signal name="input_event">
<argument index="0" name="camera" type="Object">
</argument>
- <argument index="1" name="event" type="InputEvent">
+ <argument index="1" name="event" type="Object">
</argument>
<argument index="2" name="click_pos" type="Vector3">
</argument>
@@ -8184,11 +10279,11 @@
<description>
</description>
</signal>
- <signal name="mouse_enter">
+ <signal name="mouse_entered">
<description>
</description>
</signal>
- <signal name="mouse_exit">
+ <signal name="mouse_exited">
<description>
</description>
</signal>
@@ -8212,21 +10307,15 @@
<argument index="2" name="shape_idx" type="int">
</argument>
<description>
- This method can be used to override normal input processing. The first parameter is the viewport where the event took place. The second holds the input event received, and the third the shape of this object where it happened.
</description>
</method>
- <method name="add_shape">
- <argument index="0" name="shape" type="Shape2D">
- </argument>
- <argument index="1" name="transform" type="Matrix32" default="((1, 0), (0, 1), (0, 0))">
+ <method name="create_shape_owner">
+ <return type="int">
+ </return>
+ <argument index="0" name="owner" type="Object">
</argument>
<description>
- Add a [Shape2D] to the collision body, with a given custom transform.
- </description>
- </method>
- <method name="clear_shapes">
- <description>
- Remove all shapes.
+ Creates new holder for the shapes. Argument is a [CollisionShape2D] node. It will return owner_id which usually you will want to save for later use.
</description>
</method>
<method name="get_rid" qualifiers="const">
@@ -8236,107 +10325,94 @@
Return the RID of this object.
</description>
</method>
- <method name="get_shape" qualifiers="const">
- <return type="Shape2D">
- </return>
- <argument index="0" name="shape_idx" type="int">
- </argument>
- <description>
- Return the shape in the given index.
- </description>
- </method>
- <method name="get_shape_count" qualifiers="const">
- <return type="int">
+ <method name="get_shape_owners">
+ <return type="Array">
</return>
<description>
- Return the amount of shapes in the collision body. Because a [CollisionPolygon2D] can generate more than one [Shape2D], the amount returned does not have to match the sum of [CollisionShape2D] and [CollisionPolygon2D].
+ Shape owner is a node which is holding concrete shape resources. This method will return an array which is holding an integer numbers that are representing unique ID of each owner. You can use those ids when you are using others shape_owner methods.
</description>
</method>
- <method name="get_shape_transform" qualifiers="const">
- <return type="Matrix32">
- </return>
- <argument index="0" name="shape_idx" type="int">
+ <method name="shape_owner_clear_shapes">
+ <argument index="0" name="owner_id" type="int">
</argument>
<description>
- Return the shape transform in the given index.
- </description>
- </method>
- <method name="is_pickable" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Return whether this object is pickable.
+ Will remove all the shapes associated with given owner.
</description>
</method>
- <method name="is_shape_set_as_trigger" qualifiers="const">
- <return type="bool">
+ <method name="shape_owner_get_shape">
+ <return type="Shape2D">
</return>
- <argument index="0" name="shape_idx" type="int">
+ <argument index="0" name="owner_id" type="int">
+ </argument>
+ <argument index="1" name="shape_id" type="int">
</argument>
<description>
- Return whether a shape is a trigger. A trigger shape detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked).
+ Will return a [Shape2D]. First argument owner_id is an integer that can be obtained from [method get_shape_owners]. Shape_id is a position of the shape inside owner; it's a value in range from 0 to [method shape_owner_get_shape_count].
</description>
</method>
- <method name="remove_shape">
- <argument index="0" name="shape_idx" type="int">
+ <method name="shape_owner_get_shape_count">
+ <return type="int">
+ </return>
+ <argument index="0" name="owner_id" type="int">
</argument>
<description>
- Remove the shape in the given index.
+ Returns number of shapes to which given owner is associated to.
</description>
</method>
- <method name="set_pickable">
- <argument index="0" name="enabled" type="bool">
+ <method name="shape_owner_get_transform">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="owner_id" type="int">
</argument>
<description>
- Set whether this object is pickable. A pickable object can detect the mouse pointer enter/leave it and, if the mouse is inside it, report input events.
+ Will return [Transform2D] of an owner node.
</description>
</method>
- <method name="set_shape">
- <argument index="0" name="shape_idx" type="int">
+ <method name="shape_owner_remove_shape">
+ <argument index="0" name="owner_id" type="int">
</argument>
- <argument index="1" name="shape" type="Shape">
+ <argument index="1" name="shape_id" type="int">
</argument>
<description>
- Change a shape in the collision body.
+ Removes related shape from the owner.
</description>
</method>
- <method name="set_shape_as_trigger">
- <argument index="0" name="shape_idx" type="int">
- </argument>
- <argument index="1" name="enable" type="bool">
- </argument>
+ <method name="is_pickable" qualifiers="const">
+ <return type="bool">
+ </return>
<description>
- Set whether a shape is a trigger. A trigger shape detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked).
+ Return whether this object is pickable.
</description>
</method>
- <method name="set_shape_transform">
- <argument index="0" name="shape_idx" type="int">
- </argument>
- <argument index="1" name="transform" type="Matrix32">
+ <method name="set_pickable">
+ <argument index="0" name="enabled" type="bool">
</argument>
<description>
- Change the shape transform in the collision body.
+ Set whether this object is pickable. A pickable object can detect the mouse pointer enter/leave it and, if the mouse is inside it, report input events.
</description>
</method>
</methods>
+ <members>
+ <member name="input_pickable" type="bool" setter="set_pickable" getter="is_pickable" brief="">
+ </member>
+ </members>
<signals>
<signal name="input_event">
<argument index="0" name="viewport" type="Object">
</argument>
- <argument index="1" name="event" type="InputEvent">
+ <argument index="1" name="event" type="Object">
</argument>
<argument index="2" name="shape_idx" type="int">
</argument>
<description>
- This signal triggers when an input event fires over a shape. The first parameter is the viewport where the event took place. The second holds the input event received, and the third the shape of this object where it happened.
</description>
</signal>
- <signal name="mouse_enter">
+ <signal name="mouse_entered">
<description>
This event fires only once when the mouse pointer enters any shape of this object.
</description>
</signal>
- <signal name="mouse_exit">
+ <signal name="mouse_exited">
<description>
This event fires only once when the mouse pointer exits all shapes of this object.
</description>
@@ -8351,24 +10427,6 @@
<description>
</description>
<methods>
- <method name="get_build_mode" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="get_collision_object_first_shape" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="get_collision_object_last_shape" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
<method name="get_depth" qualifiers="const">
<return type="float">
</return>
@@ -8376,14 +10434,14 @@
</description>
</method>
<method name="get_polygon" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<description>
</description>
</method>
- <method name="set_build_mode">
- <argument index="0" name="build_mode" type="int">
- </argument>
+ <method name="is_disabled" qualifiers="const">
+ <return type="bool">
+ </return>
<description>
</description>
</method>
@@ -8393,13 +10451,27 @@
<description>
</description>
</method>
+ <method name="set_disabled">
+ <argument index="0" name="disabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_polygon">
- <argument index="0" name="polygon" type="Vector2Array">
+ <argument index="0" name="polygon" type="PoolVector2Array">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="depth" type="float" setter="set_depth" getter="get_depth" brief="">
+ </member>
+ <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief="">
+ </member>
+ <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -8418,34 +10490,23 @@
Return whether the polygon is a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]).
</description>
</method>
- <method name="get_collision_object_first_shape" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the index of the first shape generated by the editor.
- When [code]build_mode[/code] is set to generate convex polygons, the shape shown in the editor may be decomposed into many convex polygons. In that case, a range of indexes is needed to directly access the [Shape2D].
- When [code]build_mode[/code] is set to generate concave polygons, there is only one [Shape2D] generated, so the start index and the end index are the same.
- </description>
- </method>
- <method name="get_collision_object_last_shape" qualifiers="const">
- <return type="int">
+ <method name="get_polygon" qualifiers="const">
+ <return type="PoolVector2Array">
</return>
<description>
- Return the index of the last shape generated by the editor.
+ Return the list of points that define the polygon.
</description>
</method>
- <method name="get_polygon" qualifiers="const">
- <return type="Vector2Array">
+ <method name="is_disabled" qualifiers="const">
+ <return type="bool">
</return>
<description>
- Return the list of points that define the polygon.
</description>
</method>
- <method name="is_trigger" qualifiers="const">
+ <method name="is_one_way_collision_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
- Return whether this polygon is a trigger.
</description>
</method>
<method name="set_build_mode">
@@ -8455,22 +10516,37 @@
Set whether the polygon is to be a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]).
</description>
</method>
- <method name="set_polygon">
- <argument index="0" name="polygon" type="Vector2Array">
+ <method name="set_disabled">
+ <argument index="0" name="disabled" type="bool">
</argument>
<description>
- Set the array of points forming the polygon.
- When editing the point list via the editor, depending on [method get_build_mode], it has to be a list of points (for [code]build_mode==0[/code]), or a list of lines (for [code]build_mode==1[/code]). In the second case, the even elements of the array define the start point of the line, and the odd elements the end point.
</description>
</method>
- <method name="set_trigger">
- <argument index="0" name="trigger" type="bool">
+ <method name="set_one_way_collision">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_polygon">
+ <argument index="0" name="polygon" type="PoolVector2Array">
</argument>
<description>
- Set whether this polygon is a trigger. A trigger polygon detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked).
+ Set the array of points forming the polygon.
+ When editing the point list via the editor, depending on [method get_build_mode], it has to be a list of points (for [code]build_mode==0[/code]), or a list of lines (for [code]build_mode==1[/code]). In the second case, the even elements of the array define the start point of the line, and the odd elements the end point.
</description>
</method>
</methods>
+ <members>
+ <member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" brief="">
+ </member>
+ <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief="">
+ </member>
+ <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" brief="">
+ </member>
+ <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -8480,19 +10556,13 @@
<description>
</description>
<methods>
- <method name="get_collision_object_shape_index" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
<method name="get_shape" qualifiers="const">
<return type="Object">
</return>
<description>
</description>
</method>
- <method name="is_trigger" qualifiers="const">
+ <method name="is_disabled" qualifiers="const">
<return type="bool">
</return>
<description>
@@ -8508,19 +10578,25 @@
<description>
</description>
</method>
- <method name="set_shape">
- <argument index="0" name="shape" type="Object">
+ <method name="set_disabled">
+ <argument index="0" name="enable" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_trigger">
- <argument index="0" name="enable" type="bool">
+ <method name="set_shape">
+ <argument index="0" name="shape" type="Object">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief="">
+ </member>
+ <member name="shape" type="Shape" setter="set_shape" getter="get_shape" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -8532,42 +10608,53 @@
Editor-only class. This is not present when running the game. It's used in the editor to properly edit and position collision shapes in [CollisionObject2D]. This is not accessible from regular code.
</description>
<methods>
- <method name="get_collision_object_shape_index" qualifiers="const">
- <return type="int">
+ <method name="get_shape" qualifiers="const">
+ <return type="Object">
</return>
<description>
- Return the index of this shape inside its container [CollisionObject2D]. This can be used to directly access the underlying [Shape2D].
+ Return this shape's [Shape2D].
</description>
</method>
- <method name="get_shape" qualifiers="const">
- <return type="Object">
+ <method name="is_disabled" qualifiers="const">
+ <return type="bool">
</return>
<description>
- Return this shape's [Shape2D].
</description>
</method>
- <method name="is_trigger" qualifiers="const">
+ <method name="is_one_way_collision_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
- Return whether this shape is a trigger.
</description>
</method>
- <method name="set_shape">
- <argument index="0" name="shape" type="Object">
+ <method name="set_disabled">
+ <argument index="0" name="disabled" type="bool">
</argument>
<description>
- Set this shape's [Shape2D]. This will not appear as a node, but can be directly edited as a property.
</description>
</method>
- <method name="set_trigger">
- <argument index="0" name="enable" type="bool">
+ <method name="set_one_way_collision">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_shape">
+ <argument index="0" name="shape" type="Object">
</argument>
<description>
- Set whether this shape is a trigger. A trigger shape detects collisions, but is otherwise unaffected by physics (i.e. will not block movement of colliding objects).
+ Set this shape's [Shape2D]. This will not appear as a node, but can be directly edited as a property.
</description>
</method>
</methods>
+ <members>
+ <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief="">
+ </member>
+ <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" brief="">
+ </member>
+ <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -8691,153 +10778,43 @@
</method>
</methods>
<members>
- <member name="a" type="float">
+ <member name="a" type="float" setter="" getter="" brief="">
Alpha (0 to 1)
</member>
- <member name="a8" type="int">
+ <member name="a8" type="int" setter="" getter="" brief="">
Alpha (0 to 255)
</member>
- <member name="b" type="float">
+ <member name="b" type="float" setter="" getter="" brief="">
Blue (0 to 1)
</member>
- <member name="b8" type="int">
+ <member name="b8" type="int" setter="" getter="" brief="">
Blue (0 to 255)
</member>
- <member name="g" type="float">
+ <member name="g" type="float" setter="" getter="" brief="">
Green (0 to 1)
</member>
- <member name="g8" type="int">
+ <member name="g8" type="int" setter="" getter="" brief="">
Green (0 to 255)
</member>
- <member name="h" type="float">
+ <member name="h" type="float" setter="" getter="" brief="">
Hue (0 to 1)
</member>
- <member name="r" type="float">
+ <member name="r" type="float" setter="" getter="" brief="">
Red (0 to 1)
</member>
- <member name="r8" type="int">
+ <member name="r8" type="int" setter="" getter="" brief="">
Red (0 to 255)
</member>
- <member name="s" type="float">
+ <member name="s" type="float" setter="" getter="" brief="">
Saturation (0 to 1)
</member>
- <member name="v" type="float">
+ <member name="v" type="float" setter="" getter="" brief="">
Value (0 to 1)
</member>
</members>
<constants>
</constants>
</class>
-<class name="ColorArray" category="Built-In Types">
- <brief_description>
- Array of Colors
- </brief_description>
- <description>
- Array of Color, can only contains colors. Optimized for memory usage, can't fragment the memory.
- </description>
- <methods>
- <method name="ColorArray">
- <return type="ColorArray">
- </return>
- <argument index="0" name="from" type="Array">
- </argument>
- <description>
- Create from a generic array.
- </description>
- </method>
- <method name="append">
- <argument index="0" name="color" type="Color">
- </argument>
- <description>
- Append an element at the end of the array (alias of [method push_back]).
- </description>
- </method>
- <method name="append_array">
- <argument index="0" name="array" type="ColorArray">
- </argument>
- <description>
- Append an [ColorArray] at the end of this array.
- </description>
- </method>
- <method name="insert">
- <return type="int">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="color" type="Color">
- </argument>
- <description>
- Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
- </description>
- </method>
- <method name="invert">
- <description>
- Reverse the order of the elements in the array (so first element will now be the last).
- </description>
- </method>
- <method name="push_back">
- <argument index="0" name="color" type="Color">
- </argument>
- <description>
- Append a value to the array.
- </description>
- </method>
- <method name="remove">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Remove an element from the array by index.
- </description>
- </method>
- <method name="resize">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Set the size of the [ColorArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
- </description>
- </method>
- <method name="set">
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="color" type="Color">
- </argument>
- <description>
- Change the [Color] at the given index.
- </description>
- </method>
- <method name="size">
- <return type="int">
- </return>
- <description>
- Return the array size.
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="ColorRect" inherits="Control" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- <method name="get_frame_color" qualifiers="const">
- <return type="Color">
- </return>
- <description>
- </description>
- </method>
- <method name="set_frame_color">
- <argument index="0" name="color" type="Color">
- </argument>
- <description>
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
<class name="ColorPicker" inherits="BoxContainer" category="Core">
<brief_description>
Color picker control.
@@ -8853,11 +10830,11 @@
Adds the current selected to color to a list of colors (presets), the presets will be displayed in the color picker and the user will be able to select them, notice that the presets list is only for this color picker.
</description>
</method>
- <method name="get_color" qualifiers="const">
+ <method name="get_pick_color" qualifiers="const">
<return type="Color">
</return>
<description>
- Return the current (edited) color.
+ Gets the current color.
</description>
</method>
<method name="is_editing_alpha" qualifiers="const">
@@ -8874,18 +10851,18 @@
Returns whether this color picker is in raw mode or not, raw mode will allow the color R, G, B component values to go beyond 1, you have to consider that the max value for color components is 1, going beyond that value will not have effect in the color, but can be used for special operations that require it (like tinting without darkening or rendering sprites in HDR).
</description>
</method>
- <method name="set_color">
- <argument index="0" name="color" type="Color">
+ <method name="set_edit_alpha">
+ <argument index="0" name="show" type="bool">
</argument>
<description>
- Select the current color.
+ Set true if you want the color to have an alpha channel (transparency), or false if you want a solid color.
</description>
</method>
- <method name="set_edit_alpha">
- <argument index="0" name="show" type="bool">
+ <method name="set_pick_color">
+ <argument index="0" name="color" type="Color">
</argument>
<description>
- Set true if you want the color to have an alpha channel (transparency), or false if you want a solid color.
+ Select the current color.
</description>
</method>
<method name="set_raw_mode">
@@ -8910,17 +10887,21 @@
<theme_items>
<theme_item name="add_preset" type="Texture">
</theme_item>
- <theme_item name="color_width" type="int">
+ <theme_item name="color_hue" type="Texture">
</theme_item>
- <theme_item name="hseparator" type="int">
+ <theme_item name="color_sample" type="Texture">
+ </theme_item>
+ <theme_item name="h_width" type="int">
</theme_item>
<theme_item name="label_width" type="int">
</theme_item>
+ <theme_item name="margin" type="int">
+ </theme_item>
<theme_item name="screen_picker" type="Texture">
</theme_item>
- <theme_item name="value_height" type="int">
+ <theme_item name="sv_height" type="int">
</theme_item>
- <theme_item name="value_width" type="int">
+ <theme_item name="sv_width" type="int">
</theme_item>
</theme_items>
</class>
@@ -8932,11 +10913,10 @@
Encapsulates a [ColorPicker] making it accesible by pressing a button, pressing the button will toggle the [ColorPicker] visibility
</description>
<methods>
- <method name="get_color" qualifiers="const">
+ <method name="get_pick_color" qualifiers="const">
<return type="Color">
</return>
<description>
- Gets the current color
</description>
</method>
<method name="get_picker">
@@ -8952,21 +10932,26 @@
See [method ColorPicker.is_edit_alpha]
</description>
</method>
- <method name="set_color">
- <argument index="0" name="color" type="Color">
+ <method name="set_edit_alpha">
+ <argument index="0" name="show" type="bool">
</argument>
<description>
- Sets the current color
+ See [method ColorPicker.set_edit_alpha]
</description>
</method>
- <method name="set_edit_alpha">
- <argument index="0" name="show" type="bool">
+ <method name="set_pick_color">
+ <argument index="0" name="color" type="Color">
</argument>
<description>
- See [method ColorPicker.set_edit_alpha]
</description>
</method>
</methods>
+ <members>
+ <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" brief="">
+ </member>
+ <member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" brief="">
+ </member>
+ </members>
<signals>
<signal name="color_changed">
<argument index="0" name="color" type="Color">
@@ -9003,111 +10988,29 @@
</theme_item>
</theme_items>
</class>
-<class name="ColorRamp" inherits="Resource" category="Core">
+<class name="ColorRect" inherits="Control" category="Core">
<brief_description>
- Color interpolator node
</brief_description>
<description>
- Given a set of colors, this node will interpolate them in order, meaning, that if you have color 1, color 2 and color3, the ramp will interpolate (generate the colors between two colors) from color 1 to color 2 and from color 2 to color 3. Initially the ramp will have 2 colors (black and white), one (black) at ramp lower offset offset 0 and the other (white) at the ramp higher offset 1.
</description>
<methods>
- <method name="add_point">
- <argument index="0" name="offset" type="float">
- </argument>
- <argument index="1" name="color" type="Color">
- </argument>
- <description>
- Adds the specified color to the end of the ramp, with the specified offset
- </description>
- </method>
- <method name="get_color" qualifiers="const">
- <return type="Color">
- </return>
- <argument index="0" name="point" type="int">
- </argument>
- <description>
- Returns the color of the ramp color at index [i]point[/i]
- </description>
- </method>
- <method name="get_colors" qualifiers="const">
- <return type="ColorArray">
- </return>
- <description>
- Returns the colors in the ramp
- </description>
- </method>
- <method name="get_offset" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="point" type="int">
- </argument>
- <description>
- Returns the offset of the ramp color at index [i]point[/i]
- </description>
- </method>
- <method name="get_offsets" qualifiers="const">
- <return type="RealArray">
- </return>
- <description>
- Returns the offsets for the colors in this ramp
- </description>
- </method>
- <method name="get_point_count" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the number of colors in the ramp
- </description>
- </method>
- <method name="interpolate">
+ <method name="get_frame_color" qualifiers="const">
<return type="Color">
</return>
- <argument index="0" name="offset" type="float">
- </argument>
- <description>
- Returns the interpolated color specified by [i]offset[/i]
- </description>
- </method>
- <method name="remove_point">
- <argument index="0" name="offset" type="int">
- </argument>
- <description>
- Removes the color at the index [i]offset[/i]
- </description>
- </method>
- <method name="set_color">
- <argument index="0" name="point" type="int">
- </argument>
- <argument index="1" name="color" type="Color">
- </argument>
- <description>
- Sets the color of the ramp color at index [i]point[/i]
- </description>
- </method>
- <method name="set_colors">
- <argument index="0" name="colors" type="ColorArray">
- </argument>
- <description>
- Sets the colors for the specified amount of elements. Calling this function with a different number of elements than previously defined causes the ramp to resize its colors and offsets array to accommodate the new elements.
- </description>
- </method>
- <method name="set_offset">
- <argument index="0" name="point" type="int">
- </argument>
- <argument index="1" name="offset" type="float">
- </argument>
<description>
- Sets the offset for the ramp color at index [i]point[/i]
</description>
</method>
- <method name="set_offsets">
- <argument index="0" name="offsets" type="RealArray">
+ <method name="set_frame_color">
+ <argument index="0" name="color" type="Color">
</argument>
<description>
- Sets the offset for the specified amount of elements. Calling this function with a different number of elements than previously defined causes the ramp to resize its colors and offsets array to accommodate the new elements, all new colors will be black by default.
</description>
</method>
</methods>
+ <members>
+ <member name="color" type="Color" setter="set_frame_color" getter="get_frame_color" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -9120,14 +11023,14 @@
</description>
<methods>
<method name="get_faces" qualifiers="const">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<description>
Return the faces (an array of triangles).
</description>
</method>
<method name="set_faces">
- <argument index="0" name="faces" type="Vector3Array">
+ <argument index="0" name="faces" type="PoolVector3Array">
</argument>
<description>
Set the faces (an array of triangles).
@@ -9147,20 +11050,24 @@
</description>
<methods>
<method name="get_segments" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<description>
Return the array of segments.
</description>
</method>
<method name="set_segments">
- <argument index="0" name="segments" type="Vector2Array">
+ <argument index="0" name="segments" type="PoolVector2Array">
</argument>
<description>
Set the array of segments.
</description>
</method>
</methods>
+ <members>
+ <member name="segments" type="PoolVector2Array" setter="set_segments" getter="get_segments" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -9187,6 +11094,18 @@
</description>
</method>
</methods>
+ <members>
+ <member name="bias" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="relaxation" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="softness" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="swing_span" type="float" setter="_set_swing_span" getter="_get_swing_span" brief="">
+ </member>
+ <member name="twist_span" type="float" setter="_set_twist_span" getter="_get_twist_span" brief="">
+ </member>
+ </members>
<constants>
<constant name="PARAM_SWING_SPAN" value="0">
</constant>
@@ -9223,8 +11142,14 @@
[/codeblock]
</description>
<methods>
+ <method name="erase_section">
+ <argument index="0" name="section" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_section_keys" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="section" type="String">
</argument>
@@ -9233,7 +11158,7 @@
</description>
</method>
<method name="get_sections" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
Return an array of all defined section identifiers.
@@ -9370,17 +11295,23 @@
Control is the base class Node for all the GUI components. Every GUI component inherits from it, directly or indirectly. In this way, sections of the scene tree made of contiguous control nodes, become user interfaces.
Controls are relative to the parent position and size by using anchors and margins. This ensures that they can adapt easily in most situation to changing dialog and screen sizes. When more flexibility is desired, [Container] derived nodes can be used.
Anchors work by defining which margin do they follow, and a value relative to it. Allowed anchoring modes are ANCHOR_BEGIN, where the margin is relative to the top or left margins of the parent (in pixels), ANCHOR_END for the right and bottom margins of the parent and ANCHOR_RATIO, which is a ratio from 0 to 1 in the parent range.
- Input device events ([InputEvent]) are first sent to the root controls via the [method Node._input], which distribute it through the tree, then delivers them to the adequate one (under cursor or keyboard focus based) by calling [method MainLoop._input_event]. There is no need to enable input processing on controls to receive such events. To ensure that no one else will receive the event (not even [method Node._unhandled_input]), the control can accept it by calling [method accept_event].
+ Input device events are first sent to the root controls via the [method Node._input], which distribute it through the tree, then delivers them to the adequate one (under cursor or keyboard focus based) by calling [method MainLoop._input_event]. There is no need to enable input processing on controls to receive such events. To ensure that no one else will receive the event (not even [method Node._unhandled_input]), the control can accept it by calling [method accept_event].
Only one control can hold the keyboard focus (receiving keyboard events), for that the control must define the focus mode with [method set_focus_mode]. Focus is lost when another control gains it, or the current focus owner is hidden.
It is sometimes desired for a control to ignore mouse/pointer events. This is often the case when placing other controls on top of a button, in such cases. Calling [method set_ignore_mouse] enables this function.
Finally, controls are skinned according to a [Theme]. Setting a [Theme] on a control will propagate all the skinning down the tree. Optionally, skinning can be overridden per each control by calling the add_*_override functions, or from the editor.
</description>
<methods>
- <method name="_input_event" qualifiers="virtual">
+ <method name="_get_minimum_size" qualifiers="virtual">
+ <return type="Vector2">
+ </return>
+ <description>
+ Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size.
+ </description>
+ </method>
+ <method name="_gui_input" qualifiers="virtual">
<argument index="0" name="event" type="InputEvent">
</argument>
<description>
- Called when an input event reaches the control.
</description>
</method>
<method name="accept_event">
@@ -9577,7 +11508,7 @@
<description>
</description>
</method>
- <method name="get_global_pos" qualifiers="const">
+ <method name="get_global_position" qualifiers="const">
<return type="Vector2">
</return>
<description>
@@ -9588,7 +11519,13 @@
<return type="Rect2">
</return>
<description>
- Return position and size of the Control, relative to the top-left corner of the [i]window[/i] Control. This is a helper (see [method get_global_pos], [method get_size]).
+ Return position and size of the Control, relative to the top-left corner of the [i]window[/i] Control. This is a helper (see [method get_global_position], [method get_size]).
+ </description>
+ </method>
+ <method name="get_h_grow_direction" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
</description>
</method>
<method name="get_h_size_flags" qualifiers="const">
@@ -9624,11 +11561,11 @@
Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size.
</description>
</method>
- <method name="get_minimum_size" qualifiers="virtual">
- <return type="Vector2">
+ <method name="get_mouse_filter" qualifiers="const">
+ <return type="int">
</return>
<description>
- Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size.
+ Return when the control is ignoring mouse events (even touchpad events send mouse events).
</description>
</method>
<method name="get_parent_area_size" qualifiers="const">
@@ -9643,7 +11580,13 @@
<description>
</description>
</method>
- <method name="get_pos" qualifiers="const">
+ <method name="get_pivot_offset" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_position" qualifiers="const">
<return type="Vector2">
</return>
<description>
@@ -9654,19 +11597,21 @@
<return type="Rect2">
</return>
<description>
- Return position and size of the Control, relative to the top-left corner of the parent Control. This is a helper (see [method get_pos], [method get_size]).
+ Return position and size of the Control, relative to the top-left corner of the parent Control. This is a helper (see [method get_position], [method get_size]).
</description>
</method>
<method name="get_rotation" qualifiers="const">
<return type="float">
</return>
<description>
+ Return the rotation (in radians)
</description>
</method>
<method name="get_rotation_deg" qualifiers="const">
<return type="float">
</return>
<description>
+ Return the rotation (in degrees)
</description>
</method>
<method name="get_scale" qualifiers="const">
@@ -9679,7 +11624,7 @@
<return type="Vector2">
</return>
<description>
- Returns the size of the Control, computed from all margins, however the size returned will [b]never be smaller than the minimum size reported by [method get_minimum_size][/b]. This means that even if end position of the Control rectangle is smaller than the begin position, the Control will still display and interact correctly. (see description, [method get_minimum_size], [method set_margin], [method set_anchor]).
+ Returns the size of the Control, computed from all margins, however the size returned will [b]never be smaller than the minimum size reported by[/b] [method get_minimum_size]. This means that even if end position of the Control rectangle is smaller than the begin position, the Control will still display and interact correctly. (see description, [method get_minimum_size], [method set_margin], [method set_anchor]).
</description>
</method>
<method name="get_stretch_ratio" qualifiers="const">
@@ -9715,6 +11660,12 @@
Return the tooltip, which will appear when the cursor is resting over this control.
</description>
</method>
+ <method name="get_v_grow_direction" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_v_size_flags" qualifiers="const">
<return type="int">
</return>
@@ -9811,8 +11762,6 @@
</description>
</method>
<method name="has_point" qualifiers="virtual">
- <return type="bool">
- </return>
<argument index="0" name="point" type="Vector2">
</argument>
<description>
@@ -9836,14 +11785,7 @@
<description>
</description>
</method>
- <method name="is_ignoring_mouse" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Return if the control is ignoring mouse events (even touchpad events send mouse events).
- </description>
- </method>
- <method name="is_stopping_mouse" qualifiers="const">
+ <method name="is_clipping_contents">
<return type="bool">
</return>
<description>
@@ -9895,6 +11837,12 @@
Sets MARGIN_LEFT and MARGIN_TOP at the same time. This is a helper (see [method set_margin]).
</description>
</method>
+ <method name="set_clip_contents">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_custom_minimum_size">
<argument index="0" name="size" type="Vector2">
</argument>
@@ -9943,25 +11891,24 @@
Force a neighbour for moving the input focus to. When pressing TAB or directional/joypad directions focus is moved to the next control in that direction. However, the neighbour to move to can be forced with this function.
</description>
</method>
- <method name="set_global_pos">
+ <method name="set_global_position">
<argument index="0" name="pos" type="Vector2">
</argument>
<description>
Move the Control to a new position, relative to the top-left corner of the [i]window[/i] Control, and without changing current anchor mode. (see [method set_margin]).
</description>
</method>
- <method name="set_h_size_flags">
- <argument index="0" name="flags" type="int">
+ <method name="set_h_grow_direction">
+ <argument index="0" name="direction" type="int">
</argument>
<description>
- Hint for containers, set horizontal positioning flags.
</description>
</method>
- <method name="set_ignore_mouse">
- <argument index="0" name="ignore" type="bool">
+ <method name="set_h_size_flags">
+ <argument index="0" name="flags" type="int">
</argument>
<description>
- Ignore mouse events on this control (even touchpad events send mouse events).
+ Hint for containers, set horizontal positioning flags.
</description>
</method>
<method name="set_margin">
@@ -9973,7 +11920,20 @@
Set a margin offset. Margin can be one of (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). Offset value being set depends on the anchor mode.
</description>
</method>
- <method name="set_pos">
+ <method name="set_mouse_filter">
+ <argument index="0" name="filter" type="int">
+ </argument>
+ <description>
+ Set when the control is ignoring mouse events (even touchpad events send mouse events). (see the MOUSE_FILTER_* constants)
+ </description>
+ </method>
+ <method name="set_pivot_offset">
+ <argument index="0" name="pivot_offset" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_position">
<argument index="0" name="pos" type="Vector2">
</argument>
<description>
@@ -9984,12 +11944,14 @@
<argument index="0" name="radians" type="float">
</argument>
<description>
+ Set the rotation (in radians).
</description>
</method>
<method name="set_rotation_deg">
<argument index="0" name="degrees" type="float">
</argument>
<description>
+ Set the rotation (in degrees).
</description>
</method>
<method name="set_scale">
@@ -10005,12 +11967,6 @@
Changes MARGIN_RIGHT and MARGIN_BOTTOM to fit a given size. This is a helper (see [method set_margin]).
</description>
</method>
- <method name="set_stop_mouse">
- <argument index="0" name="stop" type="bool">
- </argument>
- <description>
- </description>
- </method>
<method name="set_stretch_ratio">
<argument index="0" name="ratio" type="float">
</argument>
@@ -10032,6 +11988,12 @@
Set a tooltip, which will appear when the cursor is resting over this control.
</description>
</method>
+ <method name="set_v_grow_direction">
+ <argument index="0" name="direction" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_v_size_flags">
<argument index="0" name="flags" type="int">
</argument>
@@ -10053,22 +12015,77 @@
</description>
</method>
</methods>
+ <members>
+ <member name="anchor_bottom" type="int" setter="_set_anchor" getter="get_anchor" brief="">
+ </member>
+ <member name="anchor_left" type="int" setter="_set_anchor" getter="get_anchor" brief="">
+ </member>
+ <member name="anchor_right" type="int" setter="_set_anchor" getter="get_anchor" brief="">
+ </member>
+ <member name="anchor_top" type="int" setter="_set_anchor" getter="get_anchor" brief="">
+ </member>
+ <member name="focus_neighbour_bottom" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" brief="">
+ </member>
+ <member name="focus_neighbour_left" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" brief="">
+ </member>
+ <member name="focus_neighbour_right" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" brief="">
+ </member>
+ <member name="focus_neighbour_top" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" brief="">
+ </member>
+ <member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" brief="">
+ </member>
+ <member name="grow_vertical" type="int" setter="set_v_grow_direction" getter="get_v_grow_direction" brief="">
+ </member>
+ <member name="hint_tooltip" type="String" setter="set_tooltip" getter="_get_tooltip" brief="">
+ </member>
+ <member name="margin_bottom" type="int" setter="set_margin" getter="get_margin" brief="">
+ </member>
+ <member name="margin_left" type="int" setter="set_margin" getter="get_margin" brief="">
+ </member>
+ <member name="margin_right" type="int" setter="set_margin" getter="get_margin" brief="">
+ </member>
+ <member name="margin_top" type="int" setter="set_margin" getter="get_margin" brief="">
+ </member>
+ <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" brief="">
+ </member>
+ <member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" brief="">
+ </member>
+ <member name="rect_min_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" brief="">
+ </member>
+ <member name="rect_pivot_offset" type="Vector2" setter="set_pivot_offset" getter="get_pivot_offset" brief="">
+ </member>
+ <member name="rect_position" type="Vector2" setter="set_position" getter="get_position" brief="">
+ </member>
+ <member name="rect_rotation" type="float" setter="set_rotation_deg" getter="get_rotation_deg" brief="">
+ </member>
+ <member name="rect_scale" type="Vector2" setter="set_scale" getter="get_scale" brief="">
+ </member>
+ <member name="rect_size" type="Vector2" setter="set_size" getter="get_size" brief="">
+ </member>
+ <member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" brief="">
+ </member>
+ <member name="size_flags_stretch_ratio" type="int" setter="set_stretch_ratio" getter="get_stretch_ratio" brief="">
+ </member>
+ <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" brief="">
+ </member>
+ <member name="theme" type="Theme" setter="set_theme" getter="get_theme" brief="">
+ </member>
+ </members>
<signals>
- <signal name="focus_enter">
+ <signal name="focus_entered">
<description>
Emitted when keyboard focus is gained.
</description>
</signal>
- <signal name="focus_exit">
+ <signal name="focus_exited">
<description>
Emitted when the keyboard focus is lost.
</description>
</signal>
- <signal name="input_event">
- <argument index="0" name="ev" type="InputEvent">
+ <signal name="gui_input">
+ <argument index="0" name="ev" type="Object">
</argument>
<description>
- Emitted when an input event is received. Connecting in realtime is recommended for accepting the events.
</description>
</signal>
<signal name="minimum_size_changed">
@@ -10076,16 +12093,16 @@
Emitted when the minimum size of the control changed.
</description>
</signal>
- <signal name="modal_close">
+ <signal name="modal_closed">
<description>
</description>
</signal>
- <signal name="mouse_enter">
+ <signal name="mouse_entered">
<description>
Emitted when the mouse enters the control area.
</description>
</signal>
- <signal name="mouse_exit">
+ <signal name="mouse_exited">
<description>
Emitted when the mouse left the control area.
</description>
@@ -10108,10 +12125,7 @@
<constant name="ANCHOR_END" value="1">
X is relative to -MARGIN_RIGHT, Y is relative to -MARGIN_BOTTOM.
</constant>
- <constant name="ANCHOR_RATIO" value="2">
- X and Y are a ratio (0 to 1) relative to the parent size 0 is left/top, 1 is right/bottom.
- </constant>
- <constant name="ANCHOR_CENTER" value="3">
+ <constant name="ANCHOR_CENTER" value="2">
</constant>
<constant name="FOCUS_NONE" value="0">
Control can't acquire focus.
@@ -10177,12 +12191,26 @@
</constant>
<constant name="CURSOR_HELP" value="16">
</constant>
- <constant name="SIZE_EXPAND" value="1">
+ <constant name="SIZE_EXPAND" value="2">
</constant>
- <constant name="SIZE_FILL" value="2">
+ <constant name="SIZE_FILL" value="1">
</constant>
<constant name="SIZE_EXPAND_FILL" value="3">
</constant>
+ <constant name="SIZE_SHRINK_CENTER" value="4">
+ </constant>
+ <constant name="SIZE_SHRINK_END" value="8">
+ </constant>
+ <constant name="MOUSE_FILTER_STOP" value="0">
+ </constant>
+ <constant name="MOUSE_FILTER_PASS" value="1">
+ </constant>
+ <constant name="MOUSE_FILTER_IGNORE" value="2">
+ </constant>
+ <constant name="GROW_DIRECTION_BEGIN" value="0">
+ </constant>
+ <constant name="GROW_DIRECTION_END" value="1">
+ </constant>
</constants>
</class>
<class name="ConvexPolygonShape" inherits="Shape" category="Core">
@@ -10194,18 +12222,22 @@
</description>
<methods>
<method name="get_points" qualifiers="const">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<description>
</description>
</method>
<method name="set_points">
- <argument index="0" name="points" type="Vector3Array">
+ <argument index="0" name="points" type="PoolVector3Array">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="points" type="Array" setter="set_points" getter="get_points" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -10219,27 +12251,31 @@
</description>
<methods>
<method name="get_points" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<description>
Return a list of points in either clockwise or counter clockwise order, forming a convex polygon.
</description>
</method>
<method name="set_point_cloud">
- <argument index="0" name="point_cloud" type="Vector2Array">
+ <argument index="0" name="point_cloud" type="PoolVector2Array">
</argument>
<description>
Currently, this method does nothing.
</description>
</method>
<method name="set_points">
- <argument index="0" name="points" type="Vector2Array">
+ <argument index="0" name="points" type="PoolVector2Array">
</argument>
<description>
Set a list of points in either clockwise or counter clockwise order, forming a convex polygon.
</description>
</method>
</methods>
+ <members>
+ <member name="points" type="PoolVector2Array" setter="set_points" getter="get_points" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -10267,14 +12303,8 @@
<description>
</description>
</method>
- <method name="get_rid" qualifiers="const">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
<method name="get_side" qualifiers="const">
- <return type="Image">
+ <return type="Object">
</return>
<argument index="0" name="side" type="int">
</argument>
@@ -10308,7 +12338,7 @@
<method name="set_side">
<argument index="0" name="side" type="int">
</argument>
- <argument index="1" name="image" type="Image">
+ <argument index="1" name="image" type="Object">
</argument>
<description>
</description>
@@ -10349,6 +12379,274 @@
</constant>
</constants>
</class>
+<class name="CubeMesh" inherits="PrimitiveMesh" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_size" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_subdivide_depth" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_subdivide_height" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_subdivide_width" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_size">
+ <argument index="0" name="size" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_subdivide_depth">
+ <argument index="0" name="divisions" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_subdivide_height">
+ <argument index="0" name="divisions" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_subdivide_width">
+ <argument index="0" name="subdivide" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="size" type="Vector2" setter="set_size" getter="get_size" brief="">
+ </member>
+ <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" brief="">
+ </member>
+ <member name="subdivide_height" type="int" setter="set_subdivide_height" getter="get_subdivide_height" brief="">
+ </member>
+ <member name="subdivide_width" type="int" setter="set_subdivide_width" getter="get_subdivide_width" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="Curve" inherits="Resource" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="add_point">
+ <return type="int">
+ </return>
+ <argument index="0" name="pos" type="Vector2">
+ </argument>
+ <argument index="1" name="left_tangent" type="float" default="0">
+ </argument>
+ <argument index="2" name="right_tangent" type="float" default="0">
+ </argument>
+ <argument index="3" name="left_mode" type="int" default="0">
+ </argument>
+ <argument index="4" name="right_mode" type="int" default="0">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="bake">
+ <description>
+ </description>
+ </method>
+ <method name="clean_dupes">
+ <description>
+ </description>
+ </method>
+ <method name="clear_points">
+ <description>
+ </description>
+ </method>
+ <method name="get_bake_resolution" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_max_value" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_min_value" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_point_left_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_point_left_tangent" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_point_pos" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_point_right_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_point_right_tangent" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="interpolate" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="offset" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="interpolate_baked">
+ <return type="float">
+ </return>
+ <argument index="0" name="offset" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="remove_point">
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bake_resolution">
+ <argument index="0" name="resolution" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_max_value">
+ <argument index="0" name="max" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_min_value">
+ <argument index="0" name="min" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_point_left_mode">
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_point_left_tangent">
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="tangent" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_point_offset">
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="offset" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_point_right_mode">
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_point_right_tangent">
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="tangent" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_point_value">
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="y" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="_data" type="int" setter="_set_data" getter="_get_data" brief="">
+ </member>
+ <member name="bake_resolution" type="int" setter="set_bake_resolution" getter="get_bake_resolution" brief="">
+ </member>
+ <member name="max_value" type="float" setter="set_max_value" getter="get_max_value" brief="">
+ </member>
+ <member name="min_value" type="float" setter="set_min_value" getter="get_min_value" brief="">
+ </member>
+ </members>
+ <signals>
+ <signal name="range_changed">
+ <description>
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+</class>
<class name="Curve2D" inherits="Resource" category="Core">
<brief_description>
Describes a Bezier curve in 2D space.
@@ -10372,6 +12670,10 @@
If "atpos" is given, the point is inserted before the point number "atpos", moving that point (and every point after) after the inserted point. If "atpos" is not given, or is an illegal value (atpos &lt;0 or atpos &gt;= [method get_point_count]), the point will be appended at the end of the point list.
</description>
</method>
+ <method name="clear_points">
+ <description>
+ </description>
+ </method>
<method name="get_bake_interval" qualifiers="const">
<return type="float">
</return>
@@ -10387,10 +12689,10 @@
</description>
</method>
<method name="get_baked_points" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<description>
- Returns the cache of points as a [Vector2Array].
+ Returns the cache of points as a [PoolVector2Array].
</description>
</method>
<method name="get_point_count" qualifiers="const">
@@ -10503,7 +12805,7 @@
</description>
</method>
<method name="tesselate" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<argument index="0" name="max_stages" type="int" default="5">
</argument>
@@ -10517,6 +12819,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="_data" type="int" setter="_set_data" getter="_get_data" brief="">
+ </member>
+ <member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -10543,6 +12851,10 @@
If "atpos" is given, the point is inserted before the point number "atpos", moving that point (and every point after) after the inserted point. If "atpos" is not given, or is an illegal value (atpos &lt;0 or atpos &gt;= [method get_point_count]), the point will be appended at the end of the point list.
</description>
</method>
+ <method name="clear_points">
+ <description>
+ </description>
+ </method>
<method name="get_bake_interval" qualifiers="const">
<return type="float">
</return>
@@ -10558,14 +12870,14 @@
</description>
</method>
<method name="get_baked_points" qualifiers="const">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<description>
- Returns the cache of points as a [Vector3Array].
+ Returns the cache of points as a [PoolVector3Array].
</description>
</method>
<method name="get_baked_tilts" qualifiers="const">
- <return type="RealArray">
+ <return type="PoolRealArray">
</return>
<description>
Returns the cache of tilts as a [RealArray].
@@ -10700,7 +13012,7 @@
</description>
</method>
<method name="tesselate" qualifiers="const">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<argument index="0" name="max_stages" type="int" default="5">
</argument>
@@ -10714,6 +13026,128 @@
</description>
</method>
</methods>
+ <members>
+ <member name="_data" type="int" setter="_set_data" getter="_get_data" brief="">
+ </member>
+ <member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="CurveTexture" inherits="Texture" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_curve" qualifiers="const">
+ <return type="Curve">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_curve">
+ <argument index="0" name="curve" type="Curve">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_width">
+ <argument index="0" name="width" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="curve" type="Curve" setter="set_curve" getter="get_curve" brief="">
+ </member>
+ <member name="width" type="int" setter="set_width" getter="get_width" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="CylinderMesh" inherits="PrimitiveMesh" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_bottom_radius" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_height" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_radial_segments" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_rings" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_top_radius" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_bottom_radius">
+ <argument index="0" name="radius" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_height">
+ <argument index="0" name="height" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_radial_segments">
+ <argument index="0" name="segments" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_rings">
+ <argument index="0" name="rings" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_top_radius">
+ <argument index="0" name="radius" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="bottom_radius" type="float" setter="set_bottom_radius" getter="get_bottom_radius" brief="">
+ </member>
+ <member name="height" type="float" setter="set_height" getter="get_height" brief="">
+ </member>
+ <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" brief="">
+ </member>
+ <member name="rings" type="int" setter="set_rings" getter="get_rings" brief="">
+ </member>
+ <member name="top_radius" type="float" setter="set_top_radius" getter="get_top_radius" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -10782,6 +13216,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="damping" type="float" setter="set_damping" getter="get_damping" brief="">
+ </member>
+ <member name="length" type="float" setter="set_length" getter="get_length" brief="">
+ </member>
+ <member name="rest_length" type="float" setter="set_rest_length" getter="get_rest_length" brief="">
+ </member>
+ <member name="stiffness" type="float" setter="set_stiffness" getter="get_stiffness" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -10844,15 +13288,6 @@
Return the list of keys in the [Dictionary].
</description>
</method>
- <method name="parse_json">
- <return type="int">
- </return>
- <argument index="0" name="json" type="String">
- </argument>
- <description>
- Parse json text to the dictionary. Return OK when successed or the error code when failed.
- </description>
- </method>
<method name="size">
<return type="int">
</return>
@@ -10860,13 +13295,6 @@
Return the size of the dictionary (in pairs).
</description>
</method>
- <method name="to_json">
- <return type="String">
- </return>
- <description>
- Return the dictionary as json text.
- </description>
- </method>
<method name="values">
<return type="Array">
</return>
@@ -10892,43 +13320,45 @@
<description>
</description>
</method>
- <method name="get_shadow_param" qualifiers="const">
- <return type="float">
+ <method name="is_blend_splits_enabled" qualifiers="const">
+ <return type="bool">
</return>
- <argument index="0" name="param" type="int">
- </argument>
<description>
</description>
</method>
- <method name="set_shadow_mode">
- <argument index="0" name="mode" type="int">
+ <method name="set_blend_splits">
+ <argument index="0" name="enabled" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_shadow_param">
- <argument index="0" name="param" type="int">
- </argument>
- <argument index="1" name="value" type="float">
+ <method name="set_shadow_mode">
+ <argument index="0" name="mode" type="int">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="directional_shadow_blend_splits" type="bool" setter="set_blend_splits" getter="is_blend_splits_enabled" brief="">
+ </member>
+ <member name="directional_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" brief="">
+ </member>
+ <member name="directional_shadow_normal_bias" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="directional_shadow_split_1" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="directional_shadow_split_2" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="directional_shadow_split_3" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ </members>
<constants>
<constant name="SHADOW_ORTHOGONAL" value="0">
</constant>
- <constant name="SHADOW_PERSPECTIVE" value="1">
- </constant>
- <constant name="SHADOW_PARALLEL_2_SPLITS" value="2">
- </constant>
- <constant name="SHADOW_PARALLEL_4_SPLITS" value="3">
- </constant>
- <constant name="SHADOW_PARAM_MAX_DISTANCE" value="0">
+ <constant name="SHADOW_PARALLEL_2_SPLITS" value="1">
</constant>
- <constant name="SHADOW_PARAM_PSSM_SPLIT_WEIGHT" value="1">
- </constant>
- <constant name="SHADOW_PARAM_PSSM_ZOFFSET_SCALE" value="2">
+ <constant name="SHADOW_PARALLEL_4_SPLITS" value="2">
</constant>
</constants>
</class>
@@ -11010,6 +13440,12 @@
Return the absolute path to the currently opened directory (e.g. [code]res://folder[/code] or [code]C:\tmp\folder[/code]).
</description>
</method>
+ <method name="get_current_drive">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_drive">
<return type="String">
</return>
@@ -11030,7 +13466,8 @@
<return type="String">
</return>
<description>
- Return the next element (file or directory) in the current directory (including [code].[/code] and [code]..[/code]). The name of the file or directory is returned (and not its full path). Once the stream has been fully processed, the method returns an empty String and closes the stream automatically (i.e. [method list_dir_end] would not be mandatory in such a case).
+ Return the next element (file or directory) in the current directory (including [code].[/code] and [code]..[/code], unless [code]skip_navigational[/code] was given to [method list_dir_begin]).
+ The name of the file or directory is returned (and not its full path). Once the stream has been fully processed, the method returns an empty String and closes the stream automatically (i.e. [method list_dir_end] would not be mandatory in such a case).
</description>
</method>
<method name="get_space_left">
@@ -11041,11 +13478,16 @@
</description>
</method>
<method name="list_dir_begin">
- <return type="bool">
+ <return type="int">
</return>
+ <argument index="0" name="skip_navigational" type="bool" default="false">
+ </argument>
+ <argument index="1" name="skip_hidden" type="bool" default="false">
+ </argument>
<description>
Initialise the stream used to list all files and directories using the [method get_next] function, closing the current opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end].
- Return true if the stream could not be initialised.
+ If you pass [code]skip_navigational[/code], then [code].[/code] and [code]..[/code] would be filtered out.
+ If you pass [code]skip_hidden[/code], then hidden files would be filtered out.
</description>
</method>
<method name="list_dir_end">
@@ -11214,6 +13656,24 @@
</description>
</method>
</methods>
+ <members>
+ <member name="extra_spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" brief="">
+ </member>
+ <member name="extra_spacing_char" type="int" setter="set_spacing" getter="get_spacing" brief="">
+ </member>
+ <member name="extra_spacing_space" type="int" setter="set_spacing" getter="get_spacing" brief="">
+ </member>
+ <member name="extra_spacing_top" type="int" setter="set_spacing" getter="get_spacing" brief="">
+ </member>
+ <member name="font_data" type="DynamicFontData" setter="set_font_data" getter="get_font_data" brief="">
+ </member>
+ <member name="size" type="int" setter="set_size" getter="get_size" brief="">
+ </member>
+ <member name="use_filter" type="bool" setter="set_use_filter" getter="get_use_filter" brief="">
+ </member>
+ <member name="use_mipmaps" type="bool" setter="set_use_mipmaps" getter="get_use_mipmaps" brief="">
+ </member>
+ </members>
<constants>
<constant name="SPACING_TOP" value="0">
</constant>
@@ -11244,32 +13704,10 @@
</description>
</method>
</methods>
- <constants>
- </constants>
-</class>
-<class name="EditorExportPlugin" inherits="Reference" category="Core">
- <brief_description>
- Editor plugin to control the export process.
- </brief_description>
- <description>
- This plugin is added into EditorImportExport and allows to modify the behavior of the export process for individual files.
- </description>
- <methods>
- <method name="custom_export" qualifiers="virtual">
- <return type="Variant">
- </return>
- <argument index="0" name="name" type="String">
- </argument>
- <argument index="1" name="platform" type="EditorExportPlatform">
- </argument>
- <description>
- This function is called for each file exported and depending from the return value one of many things might happen.
- 1) If returned value is null, the file is exported as is.
- 2) If the returned value is a RawAray (array of bytes), the content of that array becomes the new file being exported.
- 3) If the file must also change its name when exported, then a [Dictionary] must be returned with two fields: 'name' with the new filename and 'data' with a [RawArray] containing the raw contents of the file. Even if the name is changed, the run-time will redirect the old file to the new file automatically when accessed.
- </description>
- </method>
- </methods>
+ <members>
+ <member name="font_path" type="String" setter="set_font_path" getter="get_font_path" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -11410,7 +13848,7 @@
</description>
</signal>
<signal name="files_selected">
- <argument index="0" name="paths" type="StringArray">
+ <argument index="0" name="paths" type="PoolStringArray">
</argument>
<description>
</description>
@@ -11459,7 +13897,7 @@
Get the root directory object.
</description>
</method>
- <method name="get_path">
+ <method name="get_filesystem_path">
<return type="EditorFileSystemDirectory">
</return>
<argument index="0" name="path" type="String">
@@ -11601,109 +14039,90 @@
<description>
</description>
</method>
- <method name="is_missing_sources" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- </description>
- </method>
</methods>
<constants>
</constants>
</class>
<class name="EditorImportPlugin" inherits="Reference" category="Core">
<brief_description>
- Import plugin for editor
</brief_description>
<description>
- Import plugins make it easy to handle importing of external assets into a project. They way they work is not that obvious though, so please make sure to read the documentation, tutorials and examples.
</description>
<methods>
- <method name="can_reimport_multiple_files" qualifiers="virtual">
- <return type="bool">
+ <method name="get_import_options" qualifiers="virtual">
+ <return type="Array">
</return>
+ <argument index="0" name="preset" type="int">
+ </argument>
<description>
</description>
</method>
- <method name="custom_export" qualifiers="virtual">
- <return type="RawArray">
+ <method name="get_importer_name" qualifiers="virtual">
+ <return type="String">
</return>
- <argument index="0" name="path" type="String">
- </argument>
- <argument index="1" name="platform" type="EditorExportPlatform">
- </argument>
<description>
- Generally, files that are imported stay the same when exported. The only exception is in some cases when the file must be re-imported for different platforms (ie. texture compression).
- If you want to customize the export process, it's recommended to use [method EditorExportPlugin.custom_export] instead.
</description>
</method>
- <method name="expand_source_path">
- <return type="String">
+ <method name="get_option_visibility" qualifiers="virtual">
+ <return type="bool">
</return>
- <argument index="0" name="path" type="String">
+ <argument index="0" name="option" type="String">
+ </argument>
+ <argument index="1" name="options" type="Dictionary">
</argument>
<description>
</description>
</method>
- <method name="get_name" qualifiers="virtual">
- <return type="String">
+ <method name="get_preset_count" qualifiers="virtual">
+ <return type="int">
</return>
<description>
- Get the name of the import plugin, which will be used to identify content imported by this plugin. Try to use lowercase and underscores if possible.
</description>
</method>
- <method name="get_visible_name" qualifiers="virtual">
+ <method name="get_preset_name" qualifiers="virtual">
<return type="String">
</return>
+ <argument index="0" name="preset" type="int">
+ </argument>
<description>
- Visible name for this plugin, which will be shown on the import menu.
</description>
</method>
- <method name="import" qualifiers="virtual">
- <return type="int">
+ <method name="get_recognized_extensions" qualifiers="virtual">
+ <return type="Array">
</return>
- <argument index="0" name="path" type="String">
- </argument>
- <argument index="1" name="from" type="ResourceImportMetadata">
- </argument>
<description>
- Perform an import of an external resources into the project. This function is both called on import (from the dialog) or re-import (manual or automatic when external source files changed).
- An import process generally works like this:
- 1) Check the metadata for source files and options. Metadata is either generated in the import dialog or taken from an existing resource upon reimport.
- 2) Perform the import process into a new resource. Some times the resource being re-imported may be already loaded and in use, so checking for this by using [method ResourceLoader.has] is recommended. Otherwise create a new resource.
- 3) Set the metadata from the argument into the existing or new resource being created using [method Resource.set_import_metadata].
- 4) Save the resource into 'path' (function argument)
</description>
</method>
- <method name="import_dialog" qualifiers="virtual">
- <argument index="0" name="from" type="String">
- </argument>
+ <method name="get_resource_type" qualifiers="virtual">
+ <return type="String">
+ </return>
<description>
- This function is called when either the user chooses to import a resource of this type (Import menu), or when the user chooses to re-import the resource (from filesystem). In the later case, the path for the existing file is supplied in the argument.
- If the path is supplied, it is recommended to read the import metadata with [method ResourceLoader.load_import_metadata] and fill in the fields with the values contained there.
- The dialog can be shown in any way (just use a ConfirmationDialog and pop it up). Upon confirmation, fill up a ResourceImportMetadata and call the [method EditorImportPlugin.import] function with this information.
</description>
</method>
- <method name="import_from_drop" qualifiers="virtual">
- <argument index="0" name="files" type="StringArray">
- </argument>
- <argument index="1" name="dest_path" type="String">
- </argument>
+ <method name="get_save_extension" qualifiers="virtual">
+ <return type="String">
+ </return>
<description>
</description>
</method>
- <method name="reimport_multiple_files" qualifiers="virtual">
- <argument index="0" name="files" type="StringArray">
- </argument>
+ <method name="get_visible_name" qualifiers="virtual">
+ <return type="String">
+ </return>
<description>
</description>
</method>
- <method name="validate_source_path">
- <return type="String">
+ <method name="import" qualifiers="virtual">
+ <return type="int">
</return>
- <argument index="0" name="path" type="String">
+ <argument index="0" name="source_file" type="String">
+ </argument>
+ <argument index="1" name="save_path" type="String">
+ </argument>
+ <argument index="2" name="options" type="Dictionary">
+ </argument>
+ <argument index="3" name="r_platform_variants" type="Array">
+ </argument>
+ <argument index="4" name="r_gen_files" type="Array">
</argument>
<description>
</description>
@@ -11765,23 +14184,22 @@
<description>
Add a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed.
When given node or resource is selected, the base type will be instanced (ie, "Spatial", "Control", "Resource"), then the script will be loaded and set to this object.
- You can use the [method EditorPlugin.handles] to check if your custom object is being edited by checking the script or using 'extends' keyword.
+ You can use the [method EditorPlugin.handles] to check if your custom object is being edited by checking the script or using 'is' keyword.
During run-time, this will be a simple object with a script so this function does not need to be called then.
</description>
</method>
- <method name="add_export_plugin">
- <argument index="0" name="plugin" type="EditorExportPlugin">
+ <method name="add_import_plugin">
+ <argument index="0" name="arg0" type="Object">
</argument>
<description>
- Add an export plugin. Plugins of this kind can change files being exported. On exit don't forget to call [method remove_export_plugin].
</description>
</method>
- <method name="add_import_plugin">
- <argument index="0" name="plugin" type="EditorImportPlugin">
+ <method name="add_tool_submenu_item">
+ <argument index="0" name="name" type="String">
+ </argument>
+ <argument index="1" name="submenu" type="PopupMenu">
</argument>
<description>
- Add an import plugin. These plugins manage importing external content (from outside the project) into formats the engine can understand.
- On exit, don't forget to remove the plugin by calling [method remove_import_plugin]
</description>
</method>
<method name="apply_changes" qualifiers="virtual">
@@ -11811,19 +14229,24 @@
This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object.
</description>
</method>
- <method name="forward_canvas_input_event" qualifiers="virtual">
+ <method name="edit_resource">
+ <argument index="0" name="arg0" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="forward_canvas_gui_input" qualifiers="virtual">
<return type="bool">
</return>
- <argument index="0" name="canvas_xform" type="Matrix32">
+ <argument index="0" name="canvas_xform" type="Transform2D">
</argument>
<argument index="1" name="event" type="InputEvent">
</argument>
<description>
- If your plugin is active (because handles() returned true to the object), any input interaction with the 2D canvas editor will be first forwarded here. The canvas transform (containing zoom and offset to transform to edited world coordinates) is provided, but the input supplied is in untransformed coordinates to the canvas editor. Return true if you want to eat this event and not pass it to the canvas editor.
</description>
</method>
<method name="forward_draw_over_canvas" qualifiers="virtual">
- <argument index="0" name="canvas_xform" type="Matrix32">
+ <argument index="0" name="canvas_xform" type="Transform2D">
</argument>
<argument index="1" name="canvas" type="Control">
</argument>
@@ -11831,7 +14254,7 @@
This function is called every time the 2D canvas editor draws (which overlays over the edited scene). Drawing over the supplied control will draw over the edited scene. To convert from control coordinates to edited scene coordinates (including zoom and offset), a transform is also provided. If you require this control to be redraw, call [method update_canvas].
</description>
</method>
- <method name="forward_spatial_input_event" qualifiers="virtual">
+ <method name="forward_spatial_gui_input" qualifiers="virtual">
<return type="bool">
</return>
<argument index="0" name="camera" type="Camera">
@@ -11839,9 +14262,8 @@
<argument index="1" name="event" type="InputEvent">
</argument>
<description>
- This is a low level function for plugins that edit a given objet type derived from Spatial to capture the input of the viewport. The function is only being called if your object is being edited.
- By using the [InputEvent] and the [Camera] arguments it's pretty easy to do raycasts into space using Camera functions.
- Return true if you want to capture the input, otherwise false.
+ Implement this function if you are interested in 3D view screen input events. It will be called only if currently selected node is handled by your plugin.
+ If you would like to always gets those input events then additionally use [method set_input_forwarding_always_enabled].
</description>
</method>
<method name="get_base_control">
@@ -11852,7 +14274,7 @@
</description>
</method>
<method name="get_breakpoints" qualifiers="virtual">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
This is for editors that edit script based objects. You can return a list of breakpoints in the format (script:line), for example: res://path_to_script.gd:25
@@ -11865,18 +14287,18 @@
Get the general settings for the editor (the same window that appears in the Settings menu).
</description>
</method>
- <method name="get_editor_viewport">
- <return type="Control">
+ <method name="get_edited_scene_root">
+ <return type="Node">
</return>
<description>
- Get the main editor control. Use this as a parent for main screens.
+ Returns root node of currently edited scene.
</description>
</method>
- <method name="edit_resource">
- <argument index="0" name="p_resource" type="Resource">
- </argument>
+ <method name="get_editor_viewport">
+ <return type="Control">
+ </return>
<description>
- Tells the editor to handle the edit of the given resource. Ex: If you pass a Script as a argument, the editor will open the scriptEditor.
+ Get the main editor control. Use this as a parent for main screens.
</description>
</method>
<method name="get_name" qualifiers="virtual">
@@ -11886,6 +14308,13 @@
Get the name of the editor plugin. For main scren plugins this is what will appear in the selector (which by default is 2D, 3D, Script).
</description>
</method>
+ <method name="get_open_scenes">
+ <return type="Array">
+ </return>
+ <description>
+ Will return an Array of Strings which represent file paths to currently open scenes.
+ </description>
+ </method>
<method name="get_resource_filesystem">
<return type="EditorFileSystem">
</return>
@@ -11900,6 +14329,13 @@
Get tool for generating resource previews.
</description>
</method>
+ <method name="get_script_editor">
+ <return type="ScriptEditor">
+ </return>
+ <description>
+ Will return ScriptEditor object which contains informations about state of the scripts which are currently open by the editor.
+ </description>
+ </method>
<method name="get_selection">
<return type="EditorSelection">
</return>
@@ -11971,11 +14407,25 @@
Remember that you have to manage the visibility of all your editor controls manually.
</description>
</method>
+ <method name="open_scene_from_path">
+ <argument index="0" name="scene_filepath" type="String">
+ </argument>
+ <description>
+ Opens scene in editor. Do not use during plugin initialization. If you need, then use it together with [method Object.call_deferred].
+ </description>
+ </method>
<method name="queue_save_layout" qualifiers="const">
<description>
Queue save the project's editor layout.
</description>
</method>
+ <method name="reload_scene_from_path">
+ <argument index="0" name="scene_filepath" type="String">
+ </argument>
+ <description>
+ Reloads already loaded editor scene.
+ </description>
+ </method>
<method name="remove_control_from_bottom_panel">
<argument index="0" name="control" type="Control">
</argument>
@@ -11997,18 +14447,10 @@
Remove a custom type added by [method EditorPlugin.add_custom_type]
</description>
</method>
- <method name="remove_export_plugin">
- <argument index="0" name="plugin" type="EditorExportPlugin">
- </argument>
- <description>
- Remove the export plugin, don't forget to call this on exit.
- </description>
- </method>
<method name="remove_import_plugin">
- <argument index="0" name="plugin" type="EditorImportPlugin">
+ <argument index="0" name="arg0" type="Object">
</argument>
<description>
- Remove the import plugin, don't forget to call this on exit.
</description>
</method>
<method name="save_external_data" qualifiers="virtual">
@@ -12016,6 +14458,11 @@
This method is called after the editor saves the project or when it's closed. It asks the plugin to save edited external scenes/resources.
</description>
</method>
+ <method name="set_input_event_forwarding_always_enabled">
+ <description>
+ Use this method if you always want to receive inputs from 3D view screen inside [method forward_spatial_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene.
+ </description>
+ </method>
<method name="set_state" qualifiers="virtual">
<argument index="0" name="state" type="Dictionary">
</argument>
@@ -12070,6 +14517,29 @@
<constant name="DOCK_SLOT_MAX" value="8">
</constant>
</constants>
+ <signals>
+ <signal name="main_screen_changed">
+ <argument index="0" name="screen_name" type="String">
+ </argument>
+ <description>
+ Emitted when user change main screen view (2D, 3D, Script, AssetLib). Works also with screens which are defined by plugins.
+ </description>
+ </signal>
+ <signal name="scene_changed">
+ <argument index="0" name="scene_root" type="Node">
+ </argument>
+ <description>
+ Emitted when user change scene. The argument is a root node of freshly opened scene.
+ </description>
+ </signal>
+ <signal name="scene_closed">
+ <argument index="0" name="filepath" type="String">
+ </argument>
+ <description>
+ Emitted when user close scene. The argument is file path to a closed scene.
+ </description>
+ </signal>
+ </signals>
</class>
<class name="EditorResourcePreview" inherits="Node" category="Core">
<brief_description>
@@ -12182,26 +14652,6 @@
<constants>
</constants>
</class>
-<class name="EditorScenePostImport" inherits="Reference" category="Core">
- <brief_description>
- Base script for post-processing scenes being imported.
- </brief_description>
- <description>
- These scripts can modify scenes after being imported by the 3D Scene import option of the Import menu.
- </description>
- <methods>
- <method name="post_import" qualifiers="virtual">
- <argument index="0" name="scene" type="Object">
- </argument>
- <description>
- This function is called upon import with the imported scene.
- Just do any changes desired to the scene and return it. If null is returned, import will fail and throw an error to the user.
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
<class name="EditorScript" inherits="Reference" category="Core">
<brief_description>
Simple script to perform changes in the currently edited scene.
@@ -12324,7 +14774,7 @@
</description>
</method>
<method name="get_favorite_dirs" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
Get the list of favorite directories for this project.
@@ -12338,7 +14788,7 @@
</description>
</method>
<method name="get_recent_dirs" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
Get the list of recently visited folders in the file dialog for this project.
@@ -12354,14 +14804,14 @@
</description>
</method>
<method name="set_favorite_dirs">
- <argument index="0" name="dirs" type="StringArray">
+ <argument index="0" name="dirs" type="PoolStringArray">
</argument>
<description>
Set the list of favorite directories for this project.
</description>
</method>
<method name="set_recent_dirs">
- <argument index="0" name="dirs" type="StringArray">
+ <argument index="0" name="dirs" type="PoolStringArray">
</argument>
<description>
Set the list of recently visited folders in the file dialog for this project.
@@ -12386,7 +14836,7 @@
</description>
<methods>
<method name="add_collision_segments">
- <argument index="0" name="segments" type="Vector3Array">
+ <argument index="0" name="segments" type="PoolVector3Array">
</argument>
<description>
</description>
@@ -12399,7 +14849,7 @@
</description>
</method>
<method name="add_handles">
- <argument index="0" name="handles" type="Vector3Array">
+ <argument index="0" name="handles" type="PoolVector3Array">
</argument>
<argument index="1" name="billboard" type="bool" default="false">
</argument>
@@ -12411,7 +14861,7 @@
</description>
</method>
<method name="add_lines">
- <argument index="0" name="lines" type="Vector3Array">
+ <argument index="0" name="lines" type="PoolVector3Array">
</argument>
<argument index="1" name="material" type="Material">
</argument>
@@ -12426,7 +14876,7 @@
</argument>
<argument index="1" name="billboard" type="bool" default="false">
</argument>
- <argument index="2" name="skeleton" type="RID" default="RID()">
+ <argument index="2" name="skeleton" type="RID" default="[RID]">
</argument>
<description>
Add a mesh to the gizmo, this is used for visualization. Call this function during [method redraw].
@@ -12504,422 +14954,1128 @@
<constants>
</constants>
</class>
-<class name="Environment" inherits="Resource" category="Core">
+<class name="Engine" inherits="Object" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="fx_get_param" qualifiers="const">
- <argument index="0" name="param" type="int">
- </argument>
+ <method name="get_custom_level" qualifiers="const">
+ <return type="String">
+ </return>
<description>
+ Returns the value of the commandline argument "-level".
</description>
</method>
- <method name="fx_set_param">
- <argument index="0" name="param" type="int">
- </argument>
- <argument index="1" name="value" type="Variant">
- </argument>
+ <method name="get_frames_drawn">
+ <return type="int">
+ </return>
<description>
+ Return the total amount of frames drawn.
</description>
</method>
- <method name="get_background" qualifiers="const">
+ <method name="get_frames_per_second" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns the frames per second of the running game.
+ </description>
+ </method>
+ <method name="get_iterations_per_second" qualifiers="const">
<return type="int">
</return>
<description>
+ Return the amount of fixed iterations per second (for fixed process and physics).
</description>
</method>
- <method name="get_background_param" qualifiers="const">
- <argument index="0" name="param" type="int">
- </argument>
+ <method name="get_main_loop" qualifiers="const">
+ <return type="MainLoop">
+ </return>
<description>
+ Return the main loop object (see [MainLoop] and [SceneTree]).
</description>
</method>
- <method name="is_fx_enabled" qualifiers="const">
+ <method name="get_target_fps" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_time_scale">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_version_info" qualifiers="const">
+ <return type="Dictionary">
+ </return>
+ <description>
+ Returns the current engine version information in a Dictionary.
+
+ "major" - Holds the major version number as a String
+ "minor" - Holds the minor version number as a String
+ "patch" - Holds the patch version number as a String
+ "status" - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String
+ "revision" - Holds the revision (e.g. "custom-build") as a String
+ "string" - major + minor + patch + status + revision in a single String
+ </description>
+ </method>
+ <method name="is_in_fixed_frame" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="effect" type="int">
- </argument>
<description>
</description>
</method>
- <method name="set_background">
- <argument index="0" name="bgmode" type="int">
+ <method name="set_iterations_per_second">
+ <argument index="0" name="iterations_per_second" type="int">
</argument>
<description>
+ Set the amount of fixed iterations per second (for fixed process and physics).
</description>
</method>
- <method name="set_background_param">
- <argument index="0" name="param" type="int">
- </argument>
- <argument index="1" name="value" type="Variant">
+ <method name="set_target_fps">
+ <argument index="0" name="target_fps" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_enable_fx">
- <argument index="0" name="effect" type="int">
- </argument>
- <argument index="1" name="enabled" type="bool">
+ <method name="set_time_scale">
+ <argument index="0" name="time_scale" type="float">
</argument>
<description>
</description>
</method>
</methods>
<constants>
- <constant name="BG_KEEP" value="0">
- </constant>
- <constant name="BG_DEFAULT_COLOR" value="1">
- </constant>
- <constant name="BG_COLOR" value="2">
- </constant>
- <constant name="BG_TEXTURE" value="3">
- </constant>
- <constant name="BG_CUBEMAP" value="4">
- </constant>
- <constant name="BG_CANVAS" value="5">
- </constant>
- <constant name="BG_MAX" value="6">
- </constant>
- <constant name="BG_PARAM_CANVAS_MAX_LAYER" value="0">
- </constant>
- <constant name="BG_PARAM_COLOR" value="1">
- </constant>
- <constant name="BG_PARAM_TEXTURE" value="2">
- </constant>
- <constant name="BG_PARAM_CUBEMAP" value="3">
- </constant>
- <constant name="BG_PARAM_ENERGY" value="4">
- </constant>
- <constant name="BG_PARAM_GLOW" value="6">
- </constant>
- <constant name="BG_PARAM_MAX" value="7">
- </constant>
- <constant name="FX_AMBIENT_LIGHT" value="0">
- </constant>
- <constant name="FX_FXAA" value="1">
- </constant>
- <constant name="FX_GLOW" value="2">
- </constant>
- <constant name="FX_DOF_BLUR" value="3">
- </constant>
- <constant name="FX_HDR" value="4">
- </constant>
- <constant name="FX_FOG" value="5">
- </constant>
- <constant name="FX_BCS" value="6">
- </constant>
- <constant name="FX_SRGB" value="7">
- </constant>
- <constant name="FX_MAX" value="8">
- </constant>
- <constant name="FX_BLUR_BLEND_MODE_ADDITIVE" value="0">
- </constant>
- <constant name="FX_BLUR_BLEND_MODE_SCREEN" value="1">
- </constant>
- <constant name="FX_BLUR_BLEND_MODE_SOFTLIGHT" value="2">
- </constant>
- <constant name="FX_HDR_TONE_MAPPER_LINEAR" value="0">
- </constant>
- <constant name="FX_HDR_TONE_MAPPER_LOG" value="1">
- </constant>
- <constant name="FX_HDR_TONE_MAPPER_REINHARDT" value="2">
- </constant>
- <constant name="FX_HDR_TONE_MAPPER_REINHARDT_AUTOWHITE" value="3">
- </constant>
- <constant name="FX_PARAM_AMBIENT_LIGHT_COLOR" value="0">
- </constant>
- <constant name="FX_PARAM_AMBIENT_LIGHT_ENERGY" value="1">
- </constant>
- <constant name="FX_PARAM_GLOW_BLUR_PASSES" value="2">
- </constant>
- <constant name="FX_PARAM_GLOW_BLUR_SCALE" value="3">
- </constant>
- <constant name="FX_PARAM_GLOW_BLUR_STRENGTH" value="4">
- </constant>
- <constant name="FX_PARAM_GLOW_BLUR_BLEND_MODE" value="5">
- </constant>
- <constant name="FX_PARAM_GLOW_BLOOM" value="6">
- </constant>
- <constant name="FX_PARAM_GLOW_BLOOM_TRESHOLD" value="7">
- </constant>
- <constant name="FX_PARAM_DOF_BLUR_PASSES" value="8">
- </constant>
- <constant name="FX_PARAM_DOF_BLUR_BEGIN" value="9">
- </constant>
- <constant name="FX_PARAM_DOF_BLUR_RANGE" value="10">
- </constant>
- <constant name="FX_PARAM_HDR_TONEMAPPER" value="11">
- </constant>
- <constant name="FX_PARAM_HDR_EXPOSURE" value="12">
- </constant>
- <constant name="FX_PARAM_HDR_WHITE" value="13">
- </constant>
- <constant name="FX_PARAM_HDR_GLOW_TRESHOLD" value="14">
- </constant>
- <constant name="FX_PARAM_HDR_GLOW_SCALE" value="15">
- </constant>
- <constant name="FX_PARAM_HDR_MIN_LUMINANCE" value="16">
- </constant>
- <constant name="FX_PARAM_HDR_MAX_LUMINANCE" value="17">
- </constant>
- <constant name="FX_PARAM_HDR_EXPOSURE_ADJUST_SPEED" value="18">
- </constant>
- <constant name="FX_PARAM_FOG_BEGIN" value="19">
- </constant>
- <constant name="FX_PARAM_FOG_ATTENUATION" value="22">
- </constant>
- <constant name="FX_PARAM_FOG_BEGIN_COLOR" value="20">
- </constant>
- <constant name="FX_PARAM_FOG_END_COLOR" value="21">
- </constant>
- <constant name="FX_PARAM_FOG_BG" value="23">
- </constant>
- <constant name="FX_PARAM_BCS_BRIGHTNESS" value="24">
- </constant>
- <constant name="FX_PARAM_BCS_CONTRAST" value="25">
- </constant>
- <constant name="FX_PARAM_BCS_SATURATION" value="26">
- </constant>
- <constant name="FX_PARAM_MAX" value="27">
- </constant>
</constants>
</class>
-<class name="EventPlayer" inherits="Node" category="Core">
+<class name="Environment" inherits="Resource" category="Core">
<brief_description>
- Class for event stream playback.
</brief_description>
<description>
- Class for event stream playback. Event streams are music expressed as a series of events (note on, note off, instrument change...), as opposed to audio streams, which are just audio data. Examples of event-based streams are MIDI files, or MOD music.
- Currently, only MOD, S3M, IT, and XM music is supported.
</description>
<methods>
- <method name="get_channel_last_note_time" qualifiers="const">
+ <method name="get_adjustment_brightness" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="channel" type="int">
- </argument>
<description>
- Return the time at which the last note of a given channel in the stream plays.
</description>
</method>
- <method name="get_channel_volume" qualifiers="const">
+ <method name="get_adjustment_color_correction" qualifiers="const">
+ <return type="Object">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_adjustment_contrast" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="channel" type="int">
- </argument>
<description>
- Return the volume scale for an individual channel of the stream.
</description>
</method>
- <method name="get_length" qualifiers="const">
+ <method name="get_adjustment_saturation" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ambient_light_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ambient_light_energy" qualifiers="const">
<return type="float">
</return>
<description>
- Return the song length. May be in seconds, but depends on the stream type.
</description>
</method>
- <method name="get_loop_count" qualifiers="const">
+ <method name="get_ambient_light_sky_contribution" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_background" qualifiers="const">
<return type="int">
</return>
<description>
- Return the number of times the playback has looped.
</description>
</method>
- <method name="get_pitch_scale" qualifiers="const">
+ <method name="get_bg_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_bg_energy" qualifiers="const">
<return type="float">
</return>
<description>
- Return the pitch scale factor for this player.
</description>
</method>
- <method name="get_pos" qualifiers="const">
+ <method name="get_canvas_max_layer" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_dof_blur_far_amount" qualifiers="const">
<return type="float">
</return>
<description>
- Return the playback position. May be in seconds, but depends on the stream type.
</description>
</method>
- <method name="get_stream" qualifiers="const">
- <return type="EventStream">
+ <method name="get_dof_blur_far_distance" qualifiers="const">
+ <return type="float">
</return>
<description>
- Return the currently assigned stream.
</description>
</method>
- <method name="get_stream_name" qualifiers="const">
- <return type="String">
+ <method name="get_dof_blur_far_quality" qualifiers="const">
+ <return type="int">
</return>
<description>
- Return the name of the currently assigned stream. This is not the file name, but a field inside the file. If no stream is assigned, if returns "&lt;No Stream&gt;".
</description>
</method>
- <method name="get_tempo_scale" qualifiers="const">
+ <method name="get_dof_blur_far_transition" qualifiers="const">
<return type="float">
</return>
<description>
- Return the tempo multiplier.
</description>
</method>
- <method name="get_volume" qualifiers="const">
+ <method name="get_dof_blur_near_amount" qualifiers="const">
<return type="float">
</return>
<description>
- Return the playback volume for this player.
</description>
</method>
- <method name="get_volume_db" qualifiers="const">
+ <method name="get_dof_blur_near_distance" qualifiers="const">
<return type="float">
</return>
<description>
- Return the playback volume for this player, in decibels.
</description>
</method>
- <method name="has_autoplay" qualifiers="const">
+ <method name="get_dof_blur_near_quality" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_dof_blur_near_transition" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_fog_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_fog_depth_begin" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_fog_depth_curve" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_fog_height_curve" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_fog_height_max" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_fog_height_min" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_fog_sun_amount" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_fog_sun_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_fog_transmit_curve" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_glow_blend_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_glow_bloom" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_glow_hdr_bleed_scale" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_glow_hdr_bleed_threshold" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_glow_intensity" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_glow_strength" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sky" qualifiers="const">
+ <return type="CubeMap">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sky_scale" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ssao_bias" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ssao_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ssao_direct_light_affect" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ssao_intensity" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ssao_intensity2" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ssao_radius" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ssao_radius2" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ssr_depth_tolerance" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ssr_fade_in" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ssr_fade_out" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ssr_max_steps" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_tonemap_auto_exposure" qualifiers="const">
<return type="bool">
</return>
<description>
- Return whether this player will start playing as soon as it enters the scene tree.
</description>
</method>
- <method name="has_loop" qualifiers="const">
+ <method name="get_tonemap_auto_exposure_grey" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_tonemap_auto_exposure_max" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_tonemap_auto_exposure_min" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_tonemap_auto_exposure_speed" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_tonemap_exposure" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_tonemap_white" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_tonemapper" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_adjustment_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
- Return whether this player will be restart the playback at the end.
</description>
</method>
- <method name="is_paused" qualifiers="const">
+ <method name="is_dof_blur_far_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
- Return whether the playback is currently paused.
</description>
</method>
- <method name="is_playing" qualifiers="const">
+ <method name="is_dof_blur_near_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
- Return whether this player is playing.
</description>
</method>
- <method name="play">
+ <method name="is_fog_depth_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
<description>
- Play the currently assigned stream.
</description>
</method>
- <method name="seek_pos">
- <argument index="0" name="time" type="float">
+ <method name="is_fog_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_fog_height_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_fog_transmit_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_glow_bicubic_upscale_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_glow_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_glow_level_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="idx" type="int">
</argument>
<description>
- Set the playback position. May be in seconds, but depends on the stream type.
</description>
</method>
- <method name="set_autoplay">
+ <method name="is_ssao_blur_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_ssao_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_ssr_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_ssr_rough" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_adjustment_brightness">
+ <argument index="0" name="brightness" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_adjustment_color_correction">
+ <argument index="0" name="color_correction" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_adjustment_contrast">
+ <argument index="0" name="contrast" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_adjustment_enable">
<argument index="0" name="enabled" type="bool">
</argument>
<description>
- Set whether this player will start playing as soon as it enters the scene tree.
</description>
</method>
- <method name="set_channel_volume">
- <argument index="0" name="channel" type="int">
+ <method name="set_adjustment_saturation">
+ <argument index="0" name="saturation" type="float">
</argument>
- <argument index="1" name="channel_volume" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="set_ambient_light_color">
+ <argument index="0" name="color" type="Color">
</argument>
<description>
- Set the volume scale for an individual channel of the stream, with the same value range as [method set_volume]. The channel number depends on the stream format. For example, MIDIs range from 0 to 15, and MODs from 0 to 63.
- Many stream formats are multichannel, so this allows to affect only a part of the music.
</description>
</method>
- <method name="set_loop">
+ <method name="set_ambient_light_energy">
+ <argument index="0" name="energy" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ambient_light_sky_contribution">
+ <argument index="0" name="energy" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_background">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bg_color">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bg_energy">
+ <argument index="0" name="energy" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_canvas_max_layer">
+ <argument index="0" name="layer" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_dof_blur_far_amount">
+ <argument index="0" name="intensity" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_dof_blur_far_distance">
+ <argument index="0" name="intensity" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_dof_blur_far_enabled">
<argument index="0" name="enabled" type="bool">
</argument>
<description>
- Set whether the stream will be restarted at the end.
</description>
</method>
- <method name="set_paused">
- <argument index="0" name="paused" type="bool">
+ <method name="set_dof_blur_far_quality">
+ <argument index="0" name="intensity" type="int">
</argument>
<description>
- Pause stream playback.
</description>
</method>
- <method name="set_pitch_scale">
- <argument index="0" name="pitch_scale" type="float">
+ <method name="set_dof_blur_far_transition">
+ <argument index="0" name="intensity" type="float">
</argument>
<description>
- Set the pitch multiplier for all sounds coming from this stream. A value of 2.0 shifts all pitches one octave up, and a value of 0.5 shifts pitches one octave down.
</description>
</method>
- <method name="set_stream">
- <argument index="0" name="stream" type="EventStream">
+ <method name="set_dof_blur_near_amount">
+ <argument index="0" name="intensity" type="float">
</argument>
<description>
- Set the [EventStream] this player will play.
</description>
</method>
- <method name="set_tempo_scale">
- <argument index="0" name="tempo_scale" type="float">
+ <method name="set_dof_blur_near_distance">
+ <argument index="0" name="intensity" type="float">
</argument>
<description>
- Set the tempo multiplier. This allows to slow down or speed up the music, without affecting its pitch.
</description>
</method>
- <method name="set_volume">
- <argument index="0" name="volume" type="float">
+ <method name="set_dof_blur_near_enabled">
+ <argument index="0" name="enabled" type="bool">
</argument>
<description>
- Set the playback volume for this player. This is a float between 0.0 (silent) and 1.0 (full volume). Values over 1.0 may amplify sound even more, but may introduce distortion. Negative values may just invert the output waveform, which produces no audible difference.
- The effect of these special values ultimately depends on the low-level implementation of the file format being played.
</description>
</method>
- <method name="set_volume_db">
- <argument index="0" name="db" type="float">
+ <method name="set_dof_blur_near_quality">
+ <argument index="0" name="level" type="int">
</argument>
<description>
- Set the playback volume for this player, in decibels. This is a float between -80.0 (silent) and 0.0 (full volume). Values under -79.0 get truncated to -80, but values over 0.0 do not, so the warnings for over amplifying (see [method set_volume]) still apply.
</description>
</method>
- <method name="stop">
+ <method name="set_dof_blur_near_transition">
+ <argument index="0" name="intensity" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_color">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_depth_begin">
+ <argument index="0" name="distance" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_depth_curve">
+ <argument index="0" name="curve" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_depth_enabled">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_enabled">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_height_curve">
+ <argument index="0" name="curve" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_height_enabled">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_height_max">
+ <argument index="0" name="height" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_height_min">
+ <argument index="0" name="height" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_sun_amount">
+ <argument index="0" name="amount" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_sun_color">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_transmit_curve">
+ <argument index="0" name="curve" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fog_transmit_enabled">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_glow_bicubic_upscale">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_glow_blend_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_glow_bloom">
+ <argument index="0" name="amount" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_glow_enabled">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_glow_hdr_bleed_scale">
+ <argument index="0" name="scale" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_glow_hdr_bleed_threshold">
+ <argument index="0" name="threshold" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_glow_intensity">
+ <argument index="0" name="intensity" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_glow_level">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_glow_strength">
+ <argument index="0" name="strength" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sky">
+ <argument index="0" name="sky" type="Sky">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sky_scale">
+ <argument index="0" name="scale" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssao_bias">
+ <argument index="0" name="bias" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssao_blur">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssao_color">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssao_direct_light_affect">
+ <argument index="0" name="amount" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssao_enabled">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssao_intensity">
+ <argument index="0" name="intensity" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssao_intensity2">
+ <argument index="0" name="intensity" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssao_radius">
+ <argument index="0" name="radius" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssao_radius2">
+ <argument index="0" name="radius" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssr_depth_tolerance">
+ <argument index="0" name="depth_tolerance" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssr_enabled">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssr_fade_in">
+ <argument index="0" name="fade_in" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssr_fade_out">
+ <argument index="0" name="fade_out" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssr_max_steps">
+ <argument index="0" name="max_steps" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ssr_rough">
+ <argument index="0" name="rough" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_tonemap_auto_exposure">
+ <argument index="0" name="auto_exposure" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_tonemap_auto_exposure_grey">
+ <argument index="0" name="exposure_grey" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_tonemap_auto_exposure_max">
+ <argument index="0" name="exposure_max" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_tonemap_auto_exposure_min">
+ <argument index="0" name="exposure_min" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_tonemap_auto_exposure_speed">
+ <argument index="0" name="exposure_speed" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_tonemap_exposure">
+ <argument index="0" name="exposure" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_tonemap_white">
+ <argument index="0" name="white" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_tonemapper">
+ <argument index="0" name="mode" type="int">
+ </argument>
<description>
- Stop playing.
</description>
</method>
</methods>
+ <members>
+ <member name="adjustment_brightness" type="float" setter="set_adjustment_brightness" getter="get_adjustment_brightness" brief="">
+ </member>
+ <member name="adjustment_color_correction" type="Texture" setter="set_adjustment_color_correction" getter="get_adjustment_color_correction" brief="">
+ </member>
+ <member name="adjustment_contrast" type="float" setter="set_adjustment_contrast" getter="get_adjustment_contrast" brief="">
+ </member>
+ <member name="adjustment_enabled" type="bool" setter="set_adjustment_enable" getter="is_adjustment_enabled" brief="">
+ </member>
+ <member name="adjustment_saturation" type="float" setter="set_adjustment_saturation" getter="get_adjustment_saturation" brief="">
+ </member>
+ <member name="ambient_light_color" type="Color" setter="set_ambient_light_color" getter="get_ambient_light_color" brief="">
+ </member>
+ <member name="ambient_light_energy" type="float" setter="set_ambient_light_energy" getter="get_ambient_light_energy" brief="">
+ </member>
+ <member name="ambient_light_sky_contribution" type="float" setter="set_ambient_light_sky_contribution" getter="get_ambient_light_sky_contribution" brief="">
+ </member>
+ <member name="auto_exposure_enabled" type="bool" setter="set_tonemap_auto_exposure" getter="get_tonemap_auto_exposure" brief="">
+ </member>
+ <member name="auto_exposure_max_luma" type="float" setter="set_tonemap_auto_exposure_max" getter="get_tonemap_auto_exposure_max" brief="">
+ </member>
+ <member name="auto_exposure_min_luma" type="float" setter="set_tonemap_auto_exposure_min" getter="get_tonemap_auto_exposure_min" brief="">
+ </member>
+ <member name="auto_exposure_scale" type="float" setter="set_tonemap_auto_exposure_grey" getter="get_tonemap_auto_exposure_grey" brief="">
+ </member>
+ <member name="auto_exposure_speed" type="float" setter="set_tonemap_auto_exposure_speed" getter="get_tonemap_auto_exposure_speed" brief="">
+ </member>
+ <member name="background_canvas_max_layer" type="int" setter="set_canvas_max_layer" getter="get_canvas_max_layer" brief="">
+ </member>
+ <member name="background_color" type="Color" setter="set_bg_color" getter="get_bg_color" brief="">
+ </member>
+ <member name="background_energy" type="float" setter="set_bg_energy" getter="get_bg_energy" brief="">
+ </member>
+ <member name="background_mode" type="int" setter="set_background" getter="get_background" brief="">
+ </member>
+ <member name="background_sky" type="Sky" setter="set_sky" getter="get_sky" brief="">
+ </member>
+ <member name="background_sky_scale" type="float" setter="set_sky_scale" getter="get_sky_scale" brief="">
+ </member>
+ <member name="dof_blur_far_amount" type="float" setter="set_dof_blur_far_amount" getter="get_dof_blur_far_amount" brief="">
+ </member>
+ <member name="dof_blur_far_distance" type="float" setter="set_dof_blur_far_distance" getter="get_dof_blur_far_distance" brief="">
+ </member>
+ <member name="dof_blur_far_enabled" type="bool" setter="set_dof_blur_far_enabled" getter="is_dof_blur_far_enabled" brief="">
+ </member>
+ <member name="dof_blur_far_quality" type="int" setter="set_dof_blur_far_quality" getter="get_dof_blur_far_quality" brief="">
+ </member>
+ <member name="dof_blur_far_transition" type="float" setter="set_dof_blur_far_transition" getter="get_dof_blur_far_transition" brief="">
+ </member>
+ <member name="dof_blur_near_amount" type="float" setter="set_dof_blur_near_amount" getter="get_dof_blur_near_amount" brief="">
+ </member>
+ <member name="dof_blur_near_distance" type="float" setter="set_dof_blur_near_distance" getter="get_dof_blur_near_distance" brief="">
+ </member>
+ <member name="dof_blur_near_enabled" type="bool" setter="set_dof_blur_near_enabled" getter="is_dof_blur_near_enabled" brief="">
+ </member>
+ <member name="dof_blur_near_quality" type="int" setter="set_dof_blur_near_quality" getter="get_dof_blur_near_quality" brief="">
+ </member>
+ <member name="dof_blur_near_transition" type="float" setter="set_dof_blur_near_transition" getter="get_dof_blur_near_transition" brief="">
+ </member>
+ <member name="fog_color" type="Color" setter="set_fog_color" getter="get_fog_color" brief="">
+ </member>
+ <member name="fog_depth_begin" type="float" setter="set_fog_depth_begin" getter="get_fog_depth_begin" brief="">
+ </member>
+ <member name="fog_depth_curve" type="float" setter="set_fog_depth_curve" getter="get_fog_depth_curve" brief="">
+ </member>
+ <member name="fog_depth_enabled" type="bool" setter="set_fog_depth_enabled" getter="is_fog_depth_enabled" brief="">
+ </member>
+ <member name="fog_enabled" type="bool" setter="set_fog_enabled" getter="is_fog_enabled" brief="">
+ </member>
+ <member name="fog_height_curve" type="float" setter="set_fog_height_curve" getter="get_fog_height_curve" brief="">
+ </member>
+ <member name="fog_height_enabled" type="bool" setter="set_fog_height_enabled" getter="is_fog_height_enabled" brief="">
+ </member>
+ <member name="fog_height_max" type="float" setter="set_fog_height_max" getter="get_fog_height_max" brief="">
+ </member>
+ <member name="fog_height_min" type="float" setter="set_fog_height_min" getter="get_fog_height_min" brief="">
+ </member>
+ <member name="fog_sun_amount" type="float" setter="set_fog_sun_amount" getter="get_fog_sun_amount" brief="">
+ </member>
+ <member name="fog_sun_color" type="Color" setter="set_fog_sun_color" getter="get_fog_sun_color" brief="">
+ </member>
+ <member name="fog_transmit_curve" type="float" setter="set_fog_transmit_curve" getter="get_fog_transmit_curve" brief="">
+ </member>
+ <member name="fog_transmit_enabled" type="bool" setter="set_fog_transmit_enabled" getter="is_fog_transmit_enabled" brief="">
+ </member>
+ <member name="glow_bicubic_upscale" type="bool" setter="set_glow_bicubic_upscale" getter="is_glow_bicubic_upscale_enabled" brief="">
+ </member>
+ <member name="glow_blend_mode" type="int" setter="set_glow_blend_mode" getter="get_glow_blend_mode" brief="">
+ </member>
+ <member name="glow_bloom" type="float" setter="set_glow_bloom" getter="get_glow_bloom" brief="">
+ </member>
+ <member name="glow_enabled" type="bool" setter="set_glow_enabled" getter="is_glow_enabled" brief="">
+ </member>
+ <member name="glow_hdr_scale" type="float" setter="set_glow_hdr_bleed_scale" getter="get_glow_hdr_bleed_scale" brief="">
+ </member>
+ <member name="glow_hdr_threshold" type="float" setter="set_glow_hdr_bleed_threshold" getter="get_glow_hdr_bleed_threshold" brief="">
+ </member>
+ <member name="glow_intensity" type="float" setter="set_glow_intensity" getter="get_glow_intensity" brief="">
+ </member>
+ <member name="glow_levels/1" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" brief="">
+ </member>
+ <member name="glow_levels/2" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" brief="">
+ </member>
+ <member name="glow_levels/3" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" brief="">
+ </member>
+ <member name="glow_levels/4" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" brief="">
+ </member>
+ <member name="glow_levels/5" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" brief="">
+ </member>
+ <member name="glow_levels/6" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" brief="">
+ </member>
+ <member name="glow_levels/7" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" brief="">
+ </member>
+ <member name="glow_strength" type="float" setter="set_glow_strength" getter="get_glow_strength" brief="">
+ </member>
+ <member name="ss_reflections_depth_tolerance" type="float" setter="set_ssr_depth_tolerance" getter="get_ssr_depth_tolerance" brief="">
+ </member>
+ <member name="ss_reflections_enabled" type="bool" setter="set_ssr_enabled" getter="is_ssr_enabled" brief="">
+ </member>
+ <member name="ss_reflections_fade_in" type="float" setter="set_ssr_fade_in" getter="get_ssr_fade_in" brief="">
+ </member>
+ <member name="ss_reflections_fade_out" type="float" setter="set_ssr_fade_out" getter="get_ssr_fade_out" brief="">
+ </member>
+ <member name="ss_reflections_max_steps" type="int" setter="set_ssr_max_steps" getter="get_ssr_max_steps" brief="">
+ </member>
+ <member name="ss_reflections_roughness" type="bool" setter="set_ssr_rough" getter="is_ssr_rough" brief="">
+ </member>
+ <member name="ssao_bias" type="float" setter="set_ssao_bias" getter="get_ssao_bias" brief="">
+ </member>
+ <member name="ssao_blur" type="bool" setter="set_ssao_blur" getter="is_ssao_blur_enabled" brief="">
+ </member>
+ <member name="ssao_color" type="Color" setter="set_ssao_color" getter="get_ssao_color" brief="">
+ </member>
+ <member name="ssao_enabled" type="bool" setter="set_ssao_enabled" getter="is_ssao_enabled" brief="">
+ </member>
+ <member name="ssao_intensity" type="float" setter="set_ssao_intensity" getter="get_ssao_intensity" brief="">
+ </member>
+ <member name="ssao_intensity2" type="float" setter="set_ssao_intensity2" getter="get_ssao_intensity2" brief="">
+ </member>
+ <member name="ssao_light_affect" type="float" setter="set_ssao_direct_light_affect" getter="get_ssao_direct_light_affect" brief="">
+ </member>
+ <member name="ssao_radius" type="float" setter="set_ssao_radius" getter="get_ssao_radius" brief="">
+ </member>
+ <member name="ssao_radius2" type="float" setter="set_ssao_radius2" getter="get_ssao_radius2" brief="">
+ </member>
+ <member name="tonemap_exposure" type="float" setter="set_tonemap_exposure" getter="get_tonemap_exposure" brief="">
+ </member>
+ <member name="tonemap_mode" type="int" setter="set_tonemapper" getter="get_tonemapper" brief="">
+ </member>
+ <member name="tonemap_white" type="float" setter="set_tonemap_white" getter="get_tonemap_white" brief="">
+ </member>
+ </members>
<constants>
- </constants>
-</class>
-<class name="EventStream" inherits="Resource" category="Core">
- <brief_description>
- Base class for all event-based stream drivers.
- </brief_description>
- <description>
- Base class for all event-based stream drivers. Event streams are music expressed as a series of events (note on, note off, instrument change...), as opposed to audio streams, which are just audio data. Examples of event-based streams are MIDI files, of MOD music.
- This class exposes no methods.
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="EventStreamChibi" inherits="EventStream" category="Core">
- <brief_description>
- Driver for MOD playback.
- </brief_description>
- <description>
- This driver plays MOD music. MOD music, as all event-based streams, is a music format defined by note events occurring at defined moments, instead of a stream of audio samples.
- Currently, this driver supports the MOD, S3M, IT, and XM formats.
- This class exposes no methods.
- This class can return its playback position in seconds, but does not allow to set it, failing with only a console warning.
- This class can not return its song length, returning 1.0 when queried.
- This class does not limit its volume settings, allowing for overflow/distortion and wave inversion.
- </description>
- <methods>
- </methods>
- <constants>
+ <constant name="BG_KEEP" value="4">
+ </constant>
+ <constant name="BG_CLEAR_COLOR" value="0">
+ </constant>
+ <constant name="BG_COLOR" value="1">
+ </constant>
+ <constant name="BG_SKY" value="2">
+ </constant>
+ <constant name="BG_CANVAS" value="3">
+ </constant>
+ <constant name="BG_MAX" value="5">
+ </constant>
+ <constant name="GLOW_BLEND_MODE_ADDITIVE" value="0">
+ </constant>
+ <constant name="GLOW_BLEND_MODE_SCREEN" value="1">
+ </constant>
+ <constant name="GLOW_BLEND_MODE_SOFTLIGHT" value="2">
+ </constant>
+ <constant name="GLOW_BLEND_MODE_REPLACE" value="3">
+ </constant>
+ <constant name="TONE_MAPPER_LINEAR" value="0">
+ </constant>
+ <constant name="TONE_MAPPER_REINHARDT" value="1">
+ </constant>
+ <constant name="TONE_MAPPER_FILMIC" value="2">
+ </constant>
+ <constant name="TONE_MAPPER_ACES" value="3">
+ </constant>
+ <constant name="DOF_BLUR_QUALITY_LOW" value="0">
+ </constant>
+ <constant name="DOF_BLUR_QUALITY_MEDIUM" value="1">
+ </constant>
+ <constant name="DOF_BLUR_QUALITY_HIGH" value="2">
+ </constant>
</constants>
</class>
<class name="File" inherits="Reference" category="Core">
@@ -13002,16 +16158,16 @@
</description>
</method>
<method name="get_buffer" qualifiers="const">
- <return type="RawArray">
+ <return type="PoolByteArray">
</return>
<argument index="0" name="len" type="int">
</argument>
<description>
- Get next len bytes of the file as a [RawArray].
+ Get next len bytes of the file as a [PoolByteArray].
</description>
</method>
<method name="get_csv_line" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="delim" type="String" default="&quot;,&quot;">
</argument>
@@ -13070,6 +16226,14 @@
Return a md5 String representing the file at the given path or an empty [String] on failure.
</description>
</method>
+ <method name="get_modified_time" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="file" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_pascal_string">
<return type="String">
</return>
@@ -13123,6 +16287,19 @@
Open the file for writing or reading, depending on the flags.
</description>
</method>
+ <method name="open_compressed">
+ <return type="int">
+ </return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <argument index="1" name="mode_flags" type="int">
+ </argument>
+ <argument index="2" name="compression_mode" type="int" default="0">
+ </argument>
+ <description>
+ Open a compressed file for reading or writing. The compression_mode can be set as one of the COMPRESSION_* constants.
+ </description>
+ </method>
<method name="open_encrypted">
<return type="int">
</return>
@@ -13130,7 +16307,7 @@
</argument>
<argument index="1" name="mode_flags" type="int">
</argument>
- <argument index="2" name="key" type="RawArray">
+ <argument index="2" name="key" type="PoolByteArray">
</argument>
<description>
Open an encrypted file in write or read mode. You need to pass a binary key to encrypt/decrypt it.
@@ -13200,7 +16377,7 @@
</description>
</method>
<method name="store_buffer">
- <argument index="0" name="buffer" type="RawArray">
+ <argument index="0" name="buffer" type="PoolByteArray">
</argument>
<description>
Store the given array of bytes in the file.
@@ -13269,6 +16446,17 @@
<constant name="WRITE_READ" value="7">
Open the file for reading and writing. Create it if the file not exists and truncate if it exists.
</constant>
+ <constant name="COMPRESSION_FASTLZ" value="0">
+ Use the FastLZ compression method.
+ </constant>
+ <constant name="COMPRESSION_DEFLATE" value="1">
+ Use the Deflate compression method.
+ </constant>
+ <constant name="COMPRESSION_ZSTD" value="2">
+ Use the Zstd compression method.
+ </constant>
+ <constant name="COMPRESSION_GZIP" value="3">
+ </constant>
</constants>
</class>
<class name="FileDialog" inherits="ConfirmationDialog" category="Core">
@@ -13320,7 +16508,7 @@
</description>
</method>
<method name="get_filters" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
</description>
@@ -13380,7 +16568,7 @@
</description>
</method>
<method name="set_filters">
- <argument index="0" name="filters" type="StringArray">
+ <argument index="0" name="filters" type="PoolStringArray">
</argument>
<description>
</description>
@@ -13400,6 +16588,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="access" type="int" setter="set_access" getter="get_access" brief="">
+ </member>
+ <member name="filters" type="PoolStringArray" setter="set_filters" getter="get_filters" brief="">
+ </member>
+ <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="">
+ </member>
+ <member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files" brief="">
+ </member>
+ </members>
<signals>
<signal name="dir_selected">
<argument index="0" name="dir" type="String">
@@ -13416,7 +16614,7 @@
</description>
</signal>
<signal name="files_selected">
- <argument index="0" name="paths" type="StringArray">
+ <argument index="0" name="paths" type="PoolStringArray">
</argument>
<description>
Event emitted when the user selects multiple files.
@@ -13458,177 +16656,6 @@
</theme_item>
</theme_items>
</class>
-<class name="FixedSpatialMaterial" inherits="Material" category="Core">
- <brief_description>
- Simple Material with a fixed parameter set.
- </brief_description>
- <description>
- FixedSpatialMaterial is a simple type of material [Resource], which contains a fixed amount of parameters. It is the only type of material supported in fixed-pipeline devices and APIs. It is also an often a better alternative to [ShaderMaterial] for most simple use cases.
- </description>
- <methods>
- <method name="get_fixed_flag" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="flag" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_light_shader" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="get_parameter" qualifiers="const">
- <argument index="0" name="param" type="int">
- </argument>
- <description>
- Return a parameter, parameters are defined in the PARAM_* enum. The type of each parameter may change, so it's best to check the enum.
- </description>
- </method>
- <method name="get_point_size" qualifiers="const">
- <return type="float">
- </return>
- <description>
- </description>
- </method>
- <method name="get_texcoord_mode" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="param" type="int">
- </argument>
- <description>
- Return the texture coordinate mode. Each texture param (from the PARAM_* enum) has one. It defines how the textures are mapped to the object.
- </description>
- </method>
- <method name="get_texture" qualifiers="const">
- <return type="Texture">
- </return>
- <argument index="0" name="param" type="int">
- </argument>
- <description>
- Return a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see [method set_texcoord_mode]).
- </description>
- </method>
- <method name="get_uv_transform" qualifiers="const">
- <return type="Transform">
- </return>
- <description>
- Returns the special transform used to post-transform UV coordinates of the uv_xform texcoord mode: TEXCOORD_UV_TRANSFORM.
- </description>
- </method>
- <method name="set_fixed_flag">
- <argument index="0" name="flag" type="int">
- </argument>
- <argument index="1" name="value" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_light_shader">
- <argument index="0" name="shader" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_parameter">
- <argument index="0" name="param" type="int">
- </argument>
- <argument index="1" name="value" type="Variant">
- </argument>
- <description>
- Set a parameter, parameters are defined in the PARAM_* enum. The type of each parameter may change, so it's best to check the enum.
- </description>
- </method>
- <method name="set_point_size">
- <argument index="0" name="size" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_texcoord_mode">
- <argument index="0" name="param" type="int">
- </argument>
- <argument index="1" name="mode" type="int">
- </argument>
- <description>
- Set the texture coordinate mode. Each texture param (from the PARAM_* enum) has one. It defines how the textures are mapped to the object.
- </description>
- </method>
- <method name="set_texture">
- <argument index="0" name="param" type="int">
- </argument>
- <argument index="1" name="texture" type="Texture">
- </argument>
- <description>
- Set a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see [method set_texcoord_mode]).
- </description>
- </method>
- <method name="set_uv_transform">
- <argument index="0" name="transform" type="Transform">
- </argument>
- <description>
- Sets a special transform used to post-transform UV coordinates of the uv_xform texcoord mode: TEXCOORD_UV_TRANSFORM.
- </description>
- </method>
- </methods>
- <constants>
- <constant name="PARAM_DIFFUSE" value="0">
- Diffuse Lighting (light scattered from surface).
- </constant>
- <constant name="PARAM_DETAIL" value="1">
- Detail Layer for diffuse lighting.
- </constant>
- <constant name="PARAM_SPECULAR" value="2">
- Specular Lighting (light reflected from the surface).
- </constant>
- <constant name="PARAM_EMISSION" value="3">
- Emission Lighting (light emitted from the surface).
- </constant>
- <constant name="PARAM_SPECULAR_EXP" value="4">
- Specular Exponent (size of the specular dot).
- </constant>
- <constant name="PARAM_GLOW" value="5">
- Glow (Visible emitted scattered light).
- </constant>
- <constant name="PARAM_NORMAL" value="6">
- Normal Map (irregularity map).
- </constant>
- <constant name="PARAM_SHADE_PARAM" value="7">
- </constant>
- <constant name="PARAM_MAX" value="8">
- Maximum amount of parameters.
- </constant>
- <constant name="TEXCOORD_UV" value="0">
- Read texture coordinates from the UV array.
- </constant>
- <constant name="TEXCOORD_UV_TRANSFORM" value="1">
- Read texture coordinates from the UV array and transform them by uv_xform.
- </constant>
- <constant name="TEXCOORD_UV2" value="2">
- Read texture coordinates from the UV2 array.
- </constant>
- <constant name="TEXCOORD_SPHERE" value="3">
- </constant>
- <constant name="FLAG_USE_ALPHA" value="0">
- </constant>
- <constant name="FLAG_USE_COLOR_ARRAY" value="1">
- </constant>
- <constant name="FLAG_USE_POINT_SIZE" value="2">
- </constant>
- <constant name="FLAG_DISCARD_ALPHA" value="3">
- </constant>
- <constant name="LIGHT_SHADER_LAMBERT" value="0">
- </constant>
- <constant name="LIGHT_SHADER_WRAP" value="1">
- </constant>
- <constant name="LIGHT_SHADER_VELVET" value="2">
- </constant>
- <constant name="LIGHT_SHADER_TOON" value="3">
- </constant>
- </constants>
-</class>
<class name="Font" inherits="Resource" category="Core">
<brief_description>
Internationalized font and text drawing support.
@@ -13758,8 +16785,11 @@
<method name="is_valid" qualifiers="const">
<return type="bool">
</return>
+ <argument index="0" name="extended_check" type="bool" default="false">
+ </argument>
<description>
Check whether the function call may be resumed. This is not the case if the function state was already resumed.
+ If [code]extended_check[/code] is enabled, it also checks if the associated script and object still exist. The extended check is done in debug mode as part of [method GDFunctionState.resume], but you can use this if you know you may be trying to resume without knowing for sure the object and/or script have survived up to that point.
</description>
</method>
<method name="resume">
@@ -13774,6 +16804,14 @@
</description>
</method>
</methods>
+ <signals>
+ <signal name="completed">
+ <argument index="0" name="result" type="Nil">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ </signals>
<constants>
</constants>
</class>
@@ -13791,6 +16829,78 @@
<constants>
</constants>
</class>
+<class name="GDNativeLibrary" inherits="Resource" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_platform_file" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="platform" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_platform_file">
+ <argument index="0" name="platform" type="String">
+ </argument>
+ <argument index="1" name="file" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="GDNativeScript" inherits="Script" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_library" qualifiers="const">
+ <return type="Object">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_script_name" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="new" qualifiers="vararg">
+ <return type="Object">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_library">
+ <argument index="0" name="library" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_script_name">
+ <argument index="0" name="script_name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library" brief="">
+ </member>
+ <member name="script_name" type="String" setter="set_script_name" getter="get_script_name" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
<class name="GDScript" inherits="Script" category="Core">
<brief_description>
</brief_description>
@@ -13798,7 +16908,7 @@
</description>
<methods>
<method name="get_as_byte_code" qualifiers="const">
- <return type="RawArray">
+ <return type="PoolByteArray">
</return>
<description>
</description>
@@ -13813,6 +16923,344 @@
<constants>
</constants>
</class>
+<class name="GIProbe" inherits="VisualInstance" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="bake">
+ <argument index="0" name="from_node" type="Object" default="NULL">
+ </argument>
+ <argument index="1" name="create_visual_debug" type="bool" default="false">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="debug_bake">
+ <description>
+ </description>
+ </method>
+ <method name="get_bias" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_dynamic_range" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_energy" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_extents" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_normal_bias" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_probe_data" qualifiers="const">
+ <return type="Object">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_propagation" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_subdiv" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_compressed" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_interior" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_bias">
+ <argument index="0" name="max" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_compress">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_dynamic_range">
+ <argument index="0" name="max" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_energy">
+ <argument index="0" name="max" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_extents">
+ <argument index="0" name="extents" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_interior">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_normal_bias">
+ <argument index="0" name="max" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_probe_data">
+ <argument index="0" name="data" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_propagation">
+ <argument index="0" name="max" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_subdiv">
+ <argument index="0" name="subdiv" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="bias" type="float" setter="set_bias" getter="get_bias" brief="">
+ </member>
+ <member name="compress" type="bool" setter="set_compress" getter="is_compressed" brief="">
+ </member>
+ <member name="data" type="GIProbeData" setter="set_probe_data" getter="get_probe_data" brief="">
+ </member>
+ <member name="dynamic_range" type="int" setter="set_dynamic_range" getter="get_dynamic_range" brief="">
+ </member>
+ <member name="energy" type="float" setter="set_energy" getter="get_energy" brief="">
+ </member>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" brief="">
+ </member>
+ <member name="interior" type="bool" setter="set_interior" getter="is_interior" brief="">
+ </member>
+ <member name="normal_bias" type="float" setter="set_normal_bias" getter="get_normal_bias" brief="">
+ </member>
+ <member name="propagation" type="float" setter="set_propagation" getter="get_propagation" brief="">
+ </member>
+ <member name="subdiv" type="int" setter="set_subdiv" getter="get_subdiv" brief="">
+ </member>
+ </members>
+ <constants>
+ <constant name="SUBDIV_64" value="0">
+ </constant>
+ <constant name="SUBDIV_128" value="1">
+ </constant>
+ <constant name="SUBDIV_256" value="2">
+ </constant>
+ <constant name="SUBDIV_MAX" value="4">
+ </constant>
+ </constants>
+</class>
+<class name="GIProbeData" inherits="Resource" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_bias" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_bounds" qualifiers="const">
+ <return type="Rect3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_cell_size" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_dynamic_data" qualifiers="const">
+ <return type="PoolIntArray">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_dynamic_range" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_energy" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_normal_bias" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_propagation" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_to_cell_xform" qualifiers="const">
+ <return type="Transform">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_compressed" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_interior" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_bias">
+ <argument index="0" name="bias" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bounds">
+ <argument index="0" name="bounds" type="Rect3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_cell_size">
+ <argument index="0" name="cell_size" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_compress">
+ <argument index="0" name="compress" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_dynamic_data">
+ <argument index="0" name="dynamic_data" type="PoolIntArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_dynamic_range">
+ <argument index="0" name="dynamic_range" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_energy">
+ <argument index="0" name="energy" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_interior">
+ <argument index="0" name="interior" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_normal_bias">
+ <argument index="0" name="bias" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_propagation">
+ <argument index="0" name="propagation" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_to_cell_xform">
+ <argument index="0" name="to_cell_xform" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="bias" type="float" setter="set_bias" getter="get_bias" brief="">
+ </member>
+ <member name="bounds" type="Rect3" setter="set_bounds" getter="get_bounds" brief="">
+ </member>
+ <member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" brief="">
+ </member>
+ <member name="compress" type="bool" setter="set_compress" getter="is_compressed" brief="">
+ </member>
+ <member name="dynamic_data" type="PoolIntArray" setter="set_dynamic_data" getter="get_dynamic_data" brief="">
+ </member>
+ <member name="dynamic_range" type="int" setter="set_dynamic_range" getter="get_dynamic_range" brief="">
+ </member>
+ <member name="energy" type="float" setter="set_energy" getter="get_energy" brief="">
+ </member>
+ <member name="interior" type="bool" setter="set_interior" getter="is_interior" brief="">
+ </member>
+ <member name="normal_bias" type="float" setter="set_normal_bias" getter="get_normal_bias" brief="">
+ </member>
+ <member name="propagation" type="float" setter="set_propagation" getter="get_propagation" brief="">
+ </member>
+ <member name="to_cell_xform" type="Transform" setter="set_to_cell_xform" getter="get_to_cell_xform" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
<class name="Generic6DOFJoint" inherits="Joint" category="Core">
<brief_description>
</brief_description>
@@ -13916,6 +17364,110 @@
</description>
</method>
</methods>
+ <members>
+ <member name="angular_limit_x/damping" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="angular_limit_x/enabled" type="bool" setter="set_flag_x" getter="get_flag_x" brief="">
+ </member>
+ <member name="angular_limit_x/erp" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="angular_limit_x/force_limit" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="angular_limit_x/lower_angle" type="float" setter="_set_angular_lo_limit_x" getter="_get_angular_lo_limit_x" brief="">
+ </member>
+ <member name="angular_limit_x/restitution" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="angular_limit_x/softness" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="angular_limit_x/upper_angle" type="float" setter="_set_angular_hi_limit_x" getter="_get_angular_hi_limit_x" brief="">
+ </member>
+ <member name="angular_limit_y/damping" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="angular_limit_y/enabled" type="bool" setter="set_flag_y" getter="get_flag_y" brief="">
+ </member>
+ <member name="angular_limit_y/erp" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="angular_limit_y/force_limit" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="angular_limit_y/lower_angle" type="float" setter="_set_angular_lo_limit_y" getter="_get_angular_lo_limit_y" brief="">
+ </member>
+ <member name="angular_limit_y/restitution" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="angular_limit_y/softness" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="angular_limit_y/upper_angle" type="float" setter="_set_angular_hi_limit_y" getter="_get_angular_hi_limit_y" brief="">
+ </member>
+ <member name="angular_limit_z/damping" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ <member name="angular_limit_z/enabled" type="bool" setter="set_flag_z" getter="get_flag_z" brief="">
+ </member>
+ <member name="angular_limit_z/erp" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ <member name="angular_limit_z/force_limit" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ <member name="angular_limit_z/lower_angle" type="float" setter="_set_angular_lo_limit_z" getter="_get_angular_lo_limit_z" brief="">
+ </member>
+ <member name="angular_limit_z/restitution" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ <member name="angular_limit_z/softness" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ <member name="angular_limit_z/upper_angle" type="float" setter="_set_angular_hi_limit_z" getter="_get_angular_hi_limit_z" brief="">
+ </member>
+ <member name="angular_motor_x/enabled" type="bool" setter="set_flag_x" getter="get_flag_x" brief="">
+ </member>
+ <member name="angular_motor_x/force_limit" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="angular_motor_x/target_velocity" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="angular_motor_y/enabled" type="bool" setter="set_flag_y" getter="get_flag_y" brief="">
+ </member>
+ <member name="angular_motor_y/force_limit" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="angular_motor_y/target_velocity" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="angular_motor_z/enabled" type="bool" setter="set_flag_z" getter="get_flag_z" brief="">
+ </member>
+ <member name="angular_motor_z/force_limit" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ <member name="angular_motor_z/target_velocity" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ <member name="linear_limit_x/damping" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="linear_limit_x/enabled" type="bool" setter="set_flag_x" getter="get_flag_x" brief="">
+ </member>
+ <member name="linear_limit_x/lower_distance" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="linear_limit_x/restitution" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="linear_limit_x/softness" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="linear_limit_x/upper_distance" type="float" setter="set_param_x" getter="get_param_x" brief="">
+ </member>
+ <member name="linear_limit_y/damping" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="linear_limit_y/enabled" type="bool" setter="set_flag_y" getter="get_flag_y" brief="">
+ </member>
+ <member name="linear_limit_y/lower_distance" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="linear_limit_y/restitution" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="linear_limit_y/softness" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="linear_limit_y/upper_distance" type="float" setter="set_param_y" getter="get_param_y" brief="">
+ </member>
+ <member name="linear_limit_z/damping" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ <member name="linear_limit_z/enabled" type="bool" setter="set_flag_z" getter="get_flag_z" brief="">
+ </member>
+ <member name="linear_limit_z/lower_distance" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ <member name="linear_limit_z/restitution" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ <member name="linear_limit_z/softness" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ <member name="linear_limit_z/upper_distance" type="float" setter="set_param_z" getter="get_param_z" brief="">
+ </member>
+ </members>
<constants>
<constant name="PARAM_LINEAR_LOWER_LIMIT" value="0">
</constant>
@@ -14013,8 +17565,44 @@
<description>
</description>
</method>
+ <method name="get_closest_point_to_segment_2d">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="point" type="Vector2">
+ </argument>
+ <argument index="1" name="s1" type="Vector2">
+ </argument>
+ <argument index="2" name="s2" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_closest_point_to_segment_uncapped">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="point" type="Vector3">
+ </argument>
+ <argument index="1" name="s1" type="Vector3">
+ </argument>
+ <argument index="2" name="s2" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_closest_point_to_segment_uncapped_2d">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="point" type="Vector2">
+ </argument>
+ <argument index="1" name="s1" type="Vector2">
+ </argument>
+ <argument index="2" name="s2" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_closest_points_between_segments">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<argument index="0" name="p1" type="Vector3">
</argument>
@@ -14028,7 +17616,7 @@
</description>
</method>
<method name="get_closest_points_between_segments_2d">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<argument index="0" name="p1" type="Vector2">
</argument>
@@ -14052,7 +17640,7 @@
<method name="make_atlas">
<return type="Dictionary">
</return>
- <argument index="0" name="sizes" type="Vector2Array">
+ <argument index="0" name="sizes" type="PoolVector2Array">
</argument>
<description>
</description>
@@ -14100,7 +17688,7 @@
</description>
</method>
<method name="segment_intersects_convex">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<argument index="0" name="from" type="Vector3">
</argument>
@@ -14112,7 +17700,7 @@
</description>
</method>
<method name="segment_intersects_cylinder">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<argument index="0" name="from" type="Vector3">
</argument>
@@ -14138,7 +17726,7 @@
</description>
</method>
<method name="segment_intersects_sphere">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<argument index="0" name="from" type="Vector3">
</argument>
@@ -14166,9 +17754,9 @@
</description>
</method>
<method name="triangulate_polygon">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
- <argument index="0" name="polygon" type="Vector2Array">
+ <argument index="0" name="polygon" type="PoolVector2Array">
</argument>
<description>
</description>
@@ -14185,41 +17773,47 @@
Base node for geometry based visual instances. Shares some common functionality like visibility and custom materials.
</description>
<methods>
- <method name="get_baked_light_texture_id" qualifiers="const">
+ <method name="get_cast_shadows_setting" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="get_cast_shadows_setting" qualifiers="const">
- <return type="int">
+ <method name="get_extra_cull_margin" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_flag" qualifiers="const">
+ <return type="bool">
</return>
+ <argument index="0" name="flag" type="int">
+ </argument>
<description>
</description>
</method>
- <method name="get_draw_range_begin" qualifiers="const">
+ <method name="get_lod_max_distance" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_draw_range_end" qualifiers="const">
+ <method name="get_lod_max_hysteresis" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_extra_cull_margin" qualifiers="const">
+ <method name="get_lod_min_distance" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_flag" qualifiers="const">
- <return type="bool">
+ <method name="get_lod_min_hysteresis" qualifiers="const">
+ <return type="float">
</return>
- <argument index="0" name="flag" type="int">
- </argument>
<description>
</description>
</method>
@@ -14230,40 +17824,46 @@
Return the material override for the whole geometry.
</description>
</method>
- <method name="set_baked_light_texture_id">
- <argument index="0" name="id" type="int">
+ <method name="set_cast_shadows_setting">
+ <argument index="0" name="shadow_casting_setting" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_cast_shadows_setting">
- <argument index="0" name="shadow_casting_setting" type="int">
+ <method name="set_extra_cull_margin">
+ <argument index="0" name="margin" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_draw_range_begin">
- <argument index="0" name="mode" type="float">
+ <method name="set_flag">
+ <argument index="0" name="flag" type="int">
+ </argument>
+ <argument index="1" name="value" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_draw_range_end">
+ <method name="set_lod_max_distance">
<argument index="0" name="mode" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_extra_cull_margin">
- <argument index="0" name="margin" type="float">
+ <method name="set_lod_max_hysteresis">
+ <argument index="0" name="mode" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_flag">
- <argument index="0" name="flag" type="int">
+ <method name="set_lod_min_distance">
+ <argument index="0" name="mode" type="float">
</argument>
- <argument index="1" name="value" type="bool">
+ <description>
+ </description>
+ </method>
+ <method name="set_lod_min_hysteresis">
+ <argument index="0" name="mode" type="float">
</argument>
<description>
</description>
@@ -14276,22 +17876,32 @@
</description>
</method>
</methods>
+ <members>
+ <member name="cast_shadow" type="int" setter="set_cast_shadows_setting" getter="get_cast_shadows_setting" brief="">
+ </member>
+ <member name="extra_cull_margin" type="float" setter="set_extra_cull_margin" getter="get_extra_cull_margin" brief="">
+ </member>
+ <member name="lod_max_distance" type="int" setter="set_lod_max_distance" getter="get_lod_max_distance" brief="">
+ </member>
+ <member name="lod_max_hysteresis" type="int" setter="set_lod_max_hysteresis" getter="get_lod_max_hysteresis" brief="">
+ </member>
+ <member name="lod_min_distance" type="int" setter="set_lod_min_distance" getter="get_lod_min_distance" brief="">
+ </member>
+ <member name="lod_min_hysteresis" type="int" setter="set_lod_min_hysteresis" getter="get_lod_min_hysteresis" brief="">
+ </member>
+ <member name="material_override" type="ShaderMaterial,SpatialMaterial" setter="set_material_override" getter="get_material_override" brief="">
+ </member>
+ <member name="use_in_baked_light" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="visible_in_all_rooms" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ </members>
<constants>
- <constant name="FLAG_VISIBLE" value="0">
- </constant>
- <constant name="FLAG_CAST_SHADOW" value="3">
- </constant>
- <constant name="FLAG_RECEIVE_SHADOWS" value="4">
+ <constant name="FLAG_CAST_SHADOW" value="0">
</constant>
- <constant name="FLAG_BILLBOARD" value="1">
+ <constant name="FLAG_VISIBLE_IN_ALL_ROOMS" value="1">
</constant>
- <constant name="FLAG_BILLBOARD_FIX_Y" value="2">
- </constant>
- <constant name="FLAG_DEPH_SCALE" value="5">
- </constant>
- <constant name="FLAG_VISIBLE_IN_ALL_ROOMS" value="6">
- </constant>
- <constant name="FLAG_MAX" value="8">
+ <constant name="FLAG_MAX" value="3">
</constant>
<constant name="SHADOW_CASTING_SETTING_OFF" value="0">
</constant>
@@ -14303,12 +17913,12 @@
</constant>
</constants>
</class>
-<class name="Globals" inherits="Object" category="Core">
+<class name="ProjectSettings" inherits="Object" category="Core">
<brief_description>
Contains global variables accessible from everywhere.
</brief_description>
<description>
- Contains global variables accessible from everywhere. Use the normal [Object] API, such as "Globals.get(variable)", "Globals.set(variable,value)" or "Globals.has(variable)" to access them. Variables stored in godot.cfg are also loaded into globals, making this object very useful for reading custom game configuration options.
+ Contains global variables accessible from everywhere. Use the normal [Object] API, such as "ProjectSettings.get(variable)", "ProjectSettings.set(variable,value)" or "ProjectSettings.has(variable)" to access them. Variables stored in project.godot are also loaded into ProjectSettings, making this object very useful for reading custom game configuration options.
</description>
<methods>
<method name="add_property_info">
@@ -14316,19 +17926,19 @@
</argument>
<description>
Add a custom property info to a property. The dictionary must contain: name:[String](the name of the property) and type:[int](see TYPE_* in [@Global Scope]), and optionally hint:[int](see PROPERTY_HINT_* in [@Global Scope]), hint_string:[String].
- Example:
- [codeblock]
- Globals.set("category/property_name", 0)
+ Example:
+ [codeblock]
+ ProjectSettings.set("category/property_name", 0)
- var property_info = {
- "name": "category/property_name",
- "type": TYPE_INT,
- "hint": PROPERTY_HINT_ENUM,
- "hint_string": "one,two,three"
- }
+ var property_info = {
+ "name": "category/property_name",
+ "type": TYPE_INT,
+ "hint": PROPERTY_HINT_ENUM,
+ "hint_string": "one,two,three"
+ }
- Globals.add_property_info(property_info)
- [/codeblock]
+ ProjectSettings.add_property_info(property_info)
+ [/codeblock]
</description>
</method>
<method name="clear">
@@ -14381,15 +17991,6 @@
<description>
</description>
</method>
- <method name="is_persisting" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="name" type="String">
- </argument>
- <description>
- If returns true, this value can be saved to the configuration file. This is useful for editors.
- </description>
- </method>
<method name="load_resource_pack">
<return type="bool">
</return>
@@ -14407,6 +18008,22 @@
Convert a path to a localized path (res:// path).
</description>
</method>
+ <method name="property_can_revert">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="property_get_revert">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="save">
<return type="int">
</return>
@@ -14421,6 +18038,14 @@
<description>
</description>
</method>
+ <method name="set_initial_value">
+ <argument index="0" name="name" type="String">
+ </argument>
+ <argument index="1" name="value" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_order">
<argument index="0" name="name" type="String">
</argument>
@@ -14430,16 +18055,155 @@
Set the order of a configuration value (influences when saved to the config file).
</description>
</method>
- <method name="set_persisting">
- <argument index="0" name="name" type="String">
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="Gradient" inherits="Resource" category="Core">
+ <brief_description>
+ Color interpolator node
+ </brief_description>
+ <description>
+ Given a set of colors, this node will interpolate them in order, meaning, that if you have color 1, color 2 and color3, the ramp will interpolate (generate the colors between two colors) from color 1 to color 2 and from color 2 to color 3. Initially the ramp will have 2 colors (black and white), one (black) at ramp lower offset offset 0 and the other (white) at the ramp higher offset 1.
+ </description>
+ <methods>
+ <method name="add_point">
+ <argument index="0" name="offset" type="float">
</argument>
- <argument index="1" name="enable" type="bool">
+ <argument index="1" name="color" type="Color">
+ </argument>
+ <description>
+ Adds the specified color to the end of the ramp, with the specified offset
+ </description>
+ </method>
+ <method name="get_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <argument index="0" name="point" type="int">
+ </argument>
+ <description>
+ Returns the color of the ramp color at index [i]point[/i]
+ </description>
+ </method>
+ <method name="get_colors" qualifiers="const">
+ <return type="PoolColorArray">
+ </return>
+ <description>
+ Returns the colors in the ramp
+ </description>
+ </method>
+ <method name="get_offset" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="point" type="int">
+ </argument>
+ <description>
+ Returns the offset of the ramp color at index [i]point[/i]
+ </description>
+ </method>
+ <method name="get_offsets" qualifiers="const">
+ <return type="PoolRealArray">
+ </return>
+ <description>
+ Returns the offsets for the colors in this ramp
+ </description>
+ </method>
+ <method name="get_point_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the number of colors in the ramp
+ </description>
+ </method>
+ <method name="interpolate">
+ <return type="Color">
+ </return>
+ <argument index="0" name="offset" type="float">
</argument>
<description>
- If set to true, this value can be saved to the configuration file. This is useful for editors.
+ Returns the interpolated color specified by [i]offset[/i]
+ </description>
+ </method>
+ <method name="remove_point">
+ <argument index="0" name="offset" type="int">
+ </argument>
+ <description>
+ Removes the color at the index [i]offset[/i]
+ </description>
+ </method>
+ <method name="set_color">
+ <argument index="0" name="point" type="int">
+ </argument>
+ <argument index="1" name="color" type="Color">
+ </argument>
+ <description>
+ Sets the color of the ramp color at index [i]point[/i]
+ </description>
+ </method>
+ <method name="set_colors">
+ <argument index="0" name="colors" type="PoolColorArray">
+ </argument>
+ <description>
+ Sets the colors for the specified amount of elements. Calling this function with a different number of elements than previously defined causes the ramp to resize its colors and offsets array to accommodate the new elements.
+ </description>
+ </method>
+ <method name="set_offset">
+ <argument index="0" name="point" type="int">
+ </argument>
+ <argument index="1" name="offset" type="float">
+ </argument>
+ <description>
+ Sets the offset for the ramp color at index [i]point[/i]
+ </description>
+ </method>
+ <method name="set_offsets">
+ <argument index="0" name="offsets" type="PoolRealArray">
+ </argument>
+ <description>
+ Sets the offset for the specified amount of elements. Calling this function with a different number of elements than previously defined causes the ramp to resize its colors and offsets array to accommodate the new elements, all new colors will be black by default.
</description>
</method>
</methods>
+ <members>
+ <member name="colors" type="float" setter="set_colors" getter="get_colors" brief="">
+ </member>
+ <member name="offsets" type="float" setter="set_offsets" getter="get_offsets" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="GradientTexture" inherits="Texture" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_gradient" qualifiers="const">
+ <return type="Gradient">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_gradient">
+ <argument index="0" name="gradient" type="Gradient">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_width">
+ <argument index="0" name="width" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient" brief="">
+ </member>
+ <member name="width" type="int" setter="set_width" getter="get_width" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -14762,12 +18526,6 @@
Return the type of the output connection 'idx'.
</description>
</method>
- <method name="get_modulate" qualifiers="const">
- <return type="Color">
- </return>
- <description>
- </description>
- </method>
<method name="get_offset" qualifiers="const">
<return type="Vector2">
</return>
@@ -14843,6 +18601,12 @@
<description>
</description>
</method>
+ <method name="is_selected">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_slot_enabled_left" qualifiers="const">
<return type="bool">
</return>
@@ -14867,12 +18631,6 @@
<description>
</description>
</method>
- <method name="set_modulate">
- <argument index="0" name="color" type="Color">
- </argument>
- <description>
- </description>
- </method>
<method name="set_offset">
<argument index="0" name="offset" type="Vector2">
</argument>
@@ -14892,6 +18650,12 @@
<description>
</description>
</method>
+ <method name="set_selected">
+ <argument index="0" name="selected" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_show_close_button">
<argument index="0" name="show" type="bool">
</argument>
@@ -14929,6 +18693,14 @@
</description>
</method>
</methods>
+ <members>
+ <member name="resizeable" type="bool" setter="set_resizeable" getter="is_resizeable" brief="">
+ </member>
+ <member name="show_close" type="bool" setter="set_show_close_button" getter="is_close_button_visible" brief="">
+ </member>
+ <member name="title" type="String" setter="set_title" getter="get_title" brief="">
+ </member>
+ </members>
<signals>
<signal name="close_request">
<description>
@@ -15029,6 +18801,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="columns" type="int" setter="set_columns" getter="get_columns" brief="">
+ </member>
+ </members>
<constants>
</constants>
<theme_items>
@@ -15045,7 +18821,7 @@
</description>
<methods>
<method name="area_get_bounds" qualifiers="const">
- <return type="AABB">
+ <return type="Rect3">
</return>
<argument index="0" name="area" type="int">
</argument>
@@ -15116,10 +18892,6 @@
<description>
</description>
</method>
- <method name="bake_geometry">
- <description>
- </description>
- </method>
<method name="clear">
<description>
</description>
@@ -15129,7 +18901,7 @@
</return>
<argument index="0" name="id" type="int">
</argument>
- <argument index="1" name="area" type="AABB">
+ <argument index="1" name="area" type="Rect3">
</argument>
<description>
</description>
@@ -15188,6 +18960,12 @@
<description>
</description>
</method>
+ <method name="get_meshes">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_octant_size" qualifiers="const">
<return type="int">
</return>
@@ -15206,30 +18984,12 @@
<description>
</description>
</method>
- <method name="is_baking_enabled" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
- <method name="is_using_baked_light" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
<method name="resource_changed">
<argument index="0" name="resource" type="Object">
</argument>
<description>
</description>
</method>
- <method name="set_bake">
- <argument index="0" name="enable" type="bool">
- </argument>
- <description>
- </description>
- </method>
<method name="set_cell_item">
<argument index="0" name="x" type="int">
</argument>
@@ -15292,12 +19052,6 @@
<description>
</description>
</method>
- <method name="set_use_baked_light">
- <argument index="0" name="use" type="bool">
- </argument>
- <description>
- </description>
- </method>
</methods>
<constants>
<constant name="INVALID_CELL_ITEM" value="-1">
@@ -15341,6 +19095,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="initial_offset" type="float" setter="set_initial_offset" getter="get_initial_offset" brief="">
+ </member>
+ <member name="length" type="float" setter="set_length" getter="get_length" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -15360,40 +19120,6 @@
</theme_item>
</theme_items>
</class>
-<class name="HButtonArray" inherits="ButtonArray" category="Core">
- <brief_description>
- Horizontal button array.
- </brief_description>
- <description>
- Horizontal button array. See [ButtonArray].
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
- <theme_items>
- <theme_item name="button_separator" type="int">
- </theme_item>
- <theme_item name="focus" type="StyleBox">
- </theme_item>
- <theme_item name="font" type="Font">
- </theme_item>
- <theme_item name="font_color" type="Color">
- </theme_item>
- <theme_item name="font_color_selected" type="Color">
- </theme_item>
- <theme_item name="font_selected" type="Font">
- </theme_item>
- <theme_item name="hover" type="StyleBox">
- </theme_item>
- <theme_item name="icon_separator" type="int">
- </theme_item>
- <theme_item name="normal" type="StyleBox">
- </theme_item>
- <theme_item name="selected" type="StyleBox">
- </theme_item>
- </theme_items>
-</class>
<class name="HScrollBar" inherits="ScrollBar" category="Core">
<brief_description>
Horizontal scroll bar.
@@ -15408,15 +19134,15 @@
<theme_items>
<theme_item name="decrement" type="Texture">
</theme_item>
- <theme_item name="decrement_hilite" type="Texture">
+ <theme_item name="decrement_highlight" type="Texture">
</theme_item>
<theme_item name="grabber" type="StyleBox">
</theme_item>
- <theme_item name="grabber_hilite" type="StyleBox">
+ <theme_item name="grabber_highlight" type="StyleBox">
</theme_item>
<theme_item name="increment" type="Texture">
</theme_item>
- <theme_item name="increment_hilite" type="Texture">
+ <theme_item name="increment_highlight" type="Texture">
</theme_item>
<theme_item name="scroll" type="StyleBox">
</theme_item>
@@ -15458,9 +19184,13 @@
</theme_item>
<theme_item name="grabber" type="Texture">
</theme_item>
- <theme_item name="grabber_hilite" type="Texture">
+ <theme_item name="grabber_disabled" type="Texture">
+ </theme_item>
+ <theme_item name="grabber_disabled" type="StyleBox">
</theme_item>
- <theme_item name="grabber_hilite" type="StyleBox">
+ <theme_item name="grabber_highlight" type="Texture">
+ </theme_item>
+ <theme_item name="grabber_highlight" type="StyleBox">
</theme_item>
<theme_item name="slider" type="StyleBox">
</theme_item>
@@ -15504,7 +19234,7 @@
Cloces the current connection, allows for reusal of [HTTPClient].
</description>
</method>
- <method name="connect">
+ <method name="connect_to_host">
<return type="Error">
</return>
<argument index="0" name="host" type="String">
@@ -15543,7 +19273,7 @@
</description>
</method>
<method name="get_response_headers">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
Return the response headers.
@@ -15608,7 +19338,7 @@
</description>
</method>
<method name="read_response_body_chunk">
- <return type="RawArray">
+ <return type="PoolByteArray">
</return>
<description>
Reads one chunk from the response.
@@ -15621,7 +19351,7 @@
</argument>
<argument index="1" name="url" type="String">
</argument>
- <argument index="2" name="headers" type="StringArray">
+ <argument index="2" name="headers" type="PoolStringArray">
</argument>
<argument index="3" name="body" type="String" default="&quot;&quot;">
</argument>
@@ -15644,9 +19374,9 @@
</argument>
<argument index="1" name="url" type="String">
</argument>
- <argument index="2" name="headers" type="StringArray">
+ <argument index="2" name="headers" type="PoolStringArray">
</argument>
- <argument index="3" name="body" type="RawArray">
+ <argument index="3" name="body" type="PoolByteArray">
</argument>
<description>
Sends a raw request to the connected host. The url is what is normally behind the hostname, i.e. in [code]http://somehost.com/index.php[/code], url would be "index.php".
@@ -15657,7 +19387,7 @@
<method name="send_body_data">
<return type="int">
</return>
- <argument index="0" name="body" type="RawArray">
+ <argument index="0" name="body" type="PoolByteArray">
</argument>
<description>
Stub function
@@ -15901,7 +19631,7 @@
</return>
<argument index="0" name="url" type="String">
</argument>
- <argument index="1" name="custom_headers" type="StringArray" default="StringArray([])">
+ <argument index="1" name="custom_headers" type="PoolStringArray" default="PoolStringArray([])">
</argument>
<argument index="2" name="ssl_validate_domain" type="bool" default="true">
</argument>
@@ -15941,15 +19671,23 @@
</description>
</method>
</methods>
+ <members>
+ <member name="body_size_limit" type="int" setter="set_body_size_limit" getter="get_body_size_limit" brief="">
+ </member>
+ <member name="max_redirects" type="int" setter="set_max_redirects" getter="get_max_redirects" brief="">
+ </member>
+ <member name="use_threads" type="bool" setter="set_use_threads" getter="is_using_threads" brief="">
+ </member>
+ </members>
<signals>
<signal name="request_completed">
<argument index="0" name="result" type="int">
</argument>
<argument index="1" name="response_code" type="int">
</argument>
- <argument index="2" name="headers" type="StringArray">
+ <argument index="2" name="headers" type="PoolStringArray">
</argument>
- <argument index="3" name="body" type="RawArray">
+ <argument index="3" name="body" type="PoolByteArray">
</argument>
<description>
This signal is emitted upon request completion.
@@ -16033,6 +19771,28 @@
</description>
</method>
</methods>
+ <members>
+ <member name="angular_limit/bias" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_limit/enable" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="angular_limit/lower" type="float" setter="_set_lower_limit" getter="_get_lower_limit" brief="">
+ </member>
+ <member name="angular_limit/relaxation" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_limit/softness" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_limit/upper" type="float" setter="_set_upper_limit" getter="_get_upper_limit" brief="">
+ </member>
+ <member name="motor/enable" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="motor/max_impulse" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="motor/target_velocity" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="params/bias" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ </members>
<constants>
<constant name="PARAM_BIAS" value="0">
</constant>
@@ -16068,6 +19828,12 @@
IP contains some support functions for the IPv4 protocol. TCP/IP support is in different classes (see [StreamPeerTCP] and [TCP_Server]). IP provides hostname resolution support, both blocking and threaded.
</description>
<methods>
+ <method name="clear_cache">
+ <argument index="0" name="arg0" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="erase_resolve_item">
<argument index="0" name="id" type="int">
</argument>
@@ -16104,7 +19870,7 @@
</return>
<argument index="0" name="host" type="String">
</argument>
- <argument index="1" name="ip_type" type="int" default="IP.TYPE_ANY">
+ <argument index="1" name="ip_type" type="int" default="3">
</argument>
<description>
Resolve a given hostname, blocking. Resolved hostname is returned as an IPv4 or IPv6 depending on "ip_type".
@@ -16115,7 +19881,7 @@
</return>
<argument index="0" name="host" type="String">
</argument>
- <argument index="1" name="ip_type" type="int" default="IP.TYPE_ANY">
+ <argument index="1" name="ip_type" type="int" default="3">
</argument>
<description>
Create a queue item for resolving a given hostname to an IPv4 or IPv6 depending on "ip_type". The queue ID is returned, or RESOLVER_INVALID_ID on error.
@@ -16135,6 +19901,14 @@
</constant>
<constant name="RESOLVER_INVALID_ID" value="-1">
</constant>
+ <constant name="TYPE_NONE" value="0">
+ </constant>
+ <constant name="TYPE_IPV4" value="1">
+ </constant>
+ <constant name="TYPE_IPV6" value="2">
+ </constant>
+ <constant name="TYPE_ANY" value="3">
+ </constant>
</constants>
</class>
<class name="IP_Unix" inherits="IP" category="Core">
@@ -16147,27 +19921,36 @@
<constants>
</constants>
</class>
-<class name="Image" category="Built-In Types">
+<class name="Image" inherits="Resource" category="Core">
<brief_description>
Image datatype.
</brief_description>
<description>
- Built in native image datatype. Contains image data, which can be converted to a texture, and several functions to interact with it.
+ Native image datatype. Contains image data, which can be converted to a texture, and several functions to interact with it.
</description>
<methods>
- <method name="Image">
- <return type="Image">
- </return>
- <argument index="0" name="width" type="int">
+ <method name="blend_rect">
+ <argument index="0" name="src" type="Image">
</argument>
- <argument index="1" name="height" type="int">
+ <argument index="1" name="src_rect" type="Rect2">
</argument>
- <argument index="2" name="mipmaps" type="bool">
+ <argument index="2" name="dst" type="Vector2">
</argument>
- <argument index="3" name="format" type="int">
+ <description>
+ Alpha-blends a "src_rect" [Rect2] from "src" [Image] to this [Image] on coordinates "dest".
+ </description>
+ </method>
+ <method name="blend_rect_mask">
+ <argument index="0" name="src" type="Image">
+ </argument>
+ <argument index="1" name="mask" type="Image">
+ </argument>
+ <argument index="2" name="src_rect" type="Rect2">
+ </argument>
+ <argument index="3" name="dst" type="Vector2">
</argument>
<description>
- Create an empty image of a specific size and format.
+ Alpha-blends a "src_rect" [Rect2] from "src" [Image] to this [Image] using a "mask" [Image] on coordinates "dest". Alpha channels are required for both "src" and "mask", dest pixels and src pixels will blend if the corresponding mask pixel's alpha value is not 0. "src" [Image] and "mask" [Image] *must* have the same size (width and height) but they can have different formats
</description>
</method>
<method name="blit_rect">
@@ -16175,228 +19958,364 @@
</argument>
<argument index="1" name="src_rect" type="Rect2">
</argument>
- <argument index="2" name="dest" type="Vector2" default="0">
+ <argument index="2" name="dst" type="Vector2">
</argument>
<description>
Copy a "src_rect" [Rect2] from "src" [Image] to this [Image] on coordinates "dest".
</description>
</method>
- <method name="brush_transfer">
+ <method name="blit_rect_mask">
<argument index="0" name="src" type="Image">
</argument>
- <argument index="1" name="brush" type="Image">
+ <argument index="1" name="mask" type="Image">
</argument>
- <argument index="2" name="pos" type="Vector2" default="0">
+ <argument index="2" name="src_rect" type="Rect2">
+ </argument>
+ <argument index="3" name="dst" type="Vector2">
</argument>
<description>
- Transfer data from "src" to this [Image] using a "brush" as a mask/brush on coordinates "pos".
+ Blits a "src_rect" [Rect2] from "src" [Image] to this [Image] using a "mask" [Image] on coordinates "dest". Alpha channel is required for "mask", will copy src pixel onto dest if the corresponding mask pixel's alpha value is not 0. "src" [Image] and "mask" [Image] *must* have the same size (width and height) but they can have different formats
</description>
</method>
- <method name="brushed">
- <return type="Image">
+ <method name="clear_mipmaps">
+ <description>
+ </description>
+ </method>
+ <method name="compress">
+ <return type="int">
</return>
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <argument index="1" name="arg1" type="int">
+ </argument>
+ <argument index="2" name="arg2" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="convert">
+ <argument index="0" name="format" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="copy_from">
<argument index="0" name="src" type="Image">
</argument>
- <argument index="1" name="brush" type="Image">
+ <description>
+ </description>
+ </method>
+ <method name="create">
+ <argument index="0" name="width" type="int">
+ </argument>
+ <argument index="1" name="height" type="int">
+ </argument>
+ <argument index="2" name="use_mipmaps" type="bool">
</argument>
- <argument index="2" name="pos" type="Vector2" default="0">
+ <argument index="3" name="format" type="int">
</argument>
<description>
- Return a new [Image] from this [Image] that is created by brushhing see [method brush_transfer].
+ Create an empty image of a specific size and format.
</description>
</method>
- <method name="compressed">
- <return type="Image">
- </return>
- <argument index="0" name="format" type="int" default="0">
+ <method name="create_from_data">
+ <argument index="0" name="width" type="int">
+ </argument>
+ <argument index="1" name="height" type="int">
+ </argument>
+ <argument index="2" name="use_mipmaps" type="bool">
+ </argument>
+ <argument index="3" name="format" type="int">
+ </argument>
+ <argument index="4" name="data" type="PoolByteArray">
</argument>
<description>
- Return a new compressed [Image] from this [Image] using one of [Image].COMPRESS_*.
</description>
</method>
- <method name="converted">
- <return type="Image">
- </return>
- <argument index="0" name="format" type="int" default="0">
+ <method name="crop">
+ <argument index="0" name="width" type="int">
+ </argument>
+ <argument index="1" name="height" type="int">
</argument>
<description>
- Return a new [Image] from this [Image] with a different format.
</description>
</method>
- <method name="decompressed">
- <return type="Image">
+ <method name="decompress">
+ <return type="int">
</return>
<description>
- Return a new decompressed [Image].
</description>
</method>
- <method name="empty">
- <return type="bool">
+ <method name="detect_alpha" qualifiers="const">
+ <return type="int">
</return>
<description>
- Return whether this [Image] is empty(no data).
+ </description>
+ </method>
+ <method name="expand_x2_hq2x">
+ <description>
+ </description>
+ </method>
+ <method name="fill">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ Fills an [Image] with a specified [Color]
</description>
</method>
<method name="fix_alpha_edges">
<description>
</description>
</method>
- <method name="get_data">
- <return type="RawArray">
+ <method name="flip_x">
+ <description>
+ </description>
+ </method>
+ <method name="flip_y">
+ <description>
+ </description>
+ </method>
+ <method name="generate_mipmaps">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_data" qualifiers="const">
+ <return type="PoolByteArray">
</return>
<description>
Return the raw data of the [Image].
</description>
</method>
- <method name="get_format">
+ <method name="get_format" qualifiers="const">
<return type="int">
</return>
<description>
Return the format of the [Image], one of [Image].FORMAT_*.
</description>
</method>
- <method name="get_height">
+ <method name="get_height" qualifiers="const">
<return type="int">
</return>
<description>
Return the height of the [Image].
</description>
</method>
- <method name="get_pixel">
+ <method name="get_mipmap_offset" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="mipmap" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_pixel" qualifiers="const">
<return type="Color">
</return>
<argument index="0" name="x" type="int">
</argument>
<argument index="1" name="y" type="int">
</argument>
- <argument index="2" name="mipmap_level" type="int" default="0">
- </argument>
<description>
- Return the color of the pixel in the [Image] on coordinates "x,y" on mipmap level "mipmap_level".
</description>
</method>
- <method name="get_rect">
+ <method name="get_rect" qualifiers="const">
<return type="Image">
</return>
- <argument index="0" name="area" type="Rect2" default="0">
+ <argument index="0" name="rect" type="Rect2">
</argument>
<description>
Return a new [Image] that is a copy of "area" in this [Image].
</description>
</method>
- <method name="get_used_rect">
+ <method name="get_used_rect" qualifiers="const">
<return type="Rect2">
</return>
<description>
Return the area of this [Image] that is used/visibly colored/opaque.
</description>
</method>
- <method name="get_width">
+ <method name="get_width" qualifiers="const">
<return type="int">
</return>
<description>
Return the width of the [Image].
</description>
</method>
+ <method name="has_mipmaps" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_compressed" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_empty" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_invisible" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="load">
<return type="int">
</return>
- <argument index="0" name="path" type="String" default="0">
+ <argument index="0" name="path" type="String">
</argument>
<description>
Load an [Image].
</description>
</method>
- <method name="put_pixel">
- <argument index="0" name="x" type="int">
+ <method name="lock">
+ <description>
+ </description>
+ </method>
+ <method name="normalmap_to_xy">
+ <description>
+ </description>
+ </method>
+ <method name="premultiply_alpha">
+ <description>
+ </description>
+ </method>
+ <method name="resize">
+ <argument index="0" name="width" type="int">
</argument>
- <argument index="1" name="y" type="int">
+ <argument index="1" name="height" type="int">
</argument>
- <argument index="2" name="color" type="Color">
+ <argument index="2" name="interpolation" type="int" default="1">
</argument>
- <argument index="3" name="mipmap_level" type="int" default="0">
+ <description>
+ </description>
+ </method>
+ <method name="resize_to_po2">
+ <argument index="0" name="square" type="bool" default="false">
</argument>
<description>
- Put a pixel of "color" on coordinates "x,y" on mipmap level "mipmap_level".
</description>
</method>
- <method name="resized">
- <return type="Image">
+ <method name="save_png" qualifiers="const">
+ <return type="int">
</return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <description>
+ Save this [Image] as a png.
+ </description>
+ </method>
+ <method name="set_pixel">
<argument index="0" name="x" type="int">
</argument>
<argument index="1" name="y" type="int">
</argument>
- <argument index="2" name="interpolation" type="int" default="1">
+ <argument index="2" name="color" type="Color">
</argument>
<description>
- Return a new [Image] from this [Image] that is resized to size "x,y" using [Image].INTERPOLATE_*.
</description>
</method>
- <method name="save_png">
- <return type="int">
- </return>
- <argument index="0" name="path" type="String" default="0">
- </argument>
+ <method name="shrink_x2">
+ <description>
+ </description>
+ </method>
+ <method name="srgb_to_linear">
+ <description>
+ </description>
+ </method>
+ <method name="unlock">
<description>
- Save this [Image] as a png.
</description>
</method>
</methods>
+ <members>
+ <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" brief="">
+ </member>
+ </members>
<constants>
- <constant name="COMPRESS_BC" value="0">
+ <constant name="FORMAT_L8" value="0">
</constant>
- <constant name="COMPRESS_PVRTC2" value="1">
+ <constant name="FORMAT_LA8" value="1">
</constant>
- <constant name="COMPRESS_PVRTC4" value="2">
+ <constant name="FORMAT_R8" value="2">
</constant>
- <constant name="COMPRESS_ETC" value="3">
+ <constant name="FORMAT_RG8" value="3">
</constant>
- <constant name="FORMAT_L8" value="0">
+ <constant name="FORMAT_RGB8" value="4">
+ </constant>
+ <constant name="FORMAT_RGBA8" value="5">
+ </constant>
+ <constant name="FORMAT_RGBA4444" value="6">
+ </constant>
+ <constant name="FORMAT_RGBA5551" value="7">
+ </constant>
+ <constant name="FORMAT_RF" value="8">
+ </constant>
+ <constant name="FORMAT_RGF" value="9">
+ </constant>
+ <constant name="FORMAT_RGBF" value="10">
+ </constant>
+ <constant name="FORMAT_RGBAF" value="11">
+ </constant>
+ <constant name="FORMAT_RH" value="12">
+ </constant>
+ <constant name="FORMAT_RGH" value="13">
+ </constant>
+ <constant name="FORMAT_RGBH" value="14">
</constant>
- <constant name="FORMAT_INTENSITY" value="1">
+ <constant name="FORMAT_RGBAH" value="15">
</constant>
- <constant name="FORMAT_LA8" value="2">
+ <constant name="FORMAT_RGBE9995" value="16">
</constant>
- <constant name="FORMAT_RGB8" value="3">
+ <constant name="FORMAT_DXT1" value="17">
</constant>
- <constant name="FORMAT_RGBA8" value="4">
+ <constant name="FORMAT_DXT3" value="18">
</constant>
- <constant name="FORMAT_INDEXED" value="5">
+ <constant name="FORMAT_DXT5" value="19">
</constant>
- <constant name="FORMAT_INDEXED_ALPHA" value="6">
+ <constant name="FORMAT_RGTC_R" value="20">
</constant>
- <constant name="FORMAT_YUV_422" value="7">
+ <constant name="FORMAT_RGTC_RG" value="21">
</constant>
- <constant name="FORMAT_YUV_444" value="8">
+ <constant name="FORMAT_BPTC_RGBA" value="22">
</constant>
- <constant name="FORMAT_DXT1" value="9">
+ <constant name="FORMAT_BPTC_RGBF" value="23">
</constant>
- <constant name="FORMAT_DXT3" value="10">
+ <constant name="FORMAT_BPTC_RGBFU" value="24">
</constant>
- <constant name="FORMAT_DXT5" value="11">
+ <constant name="FORMAT_PVRTC2" value="25">
</constant>
- <constant name="FORMAT_ATI1" value="12">
+ <constant name="FORMAT_PVRTC2A" value="26">
</constant>
- <constant name="FORMAT_ATI2" value="13">
+ <constant name="FORMAT_PVRTC4" value="27">
</constant>
- <constant name="FORMAT_PVRTC2" value="14">
+ <constant name="FORMAT_PVRTC4A" value="28">
</constant>
- <constant name="FORMAT_PVRTC2A" value="15">
+ <constant name="FORMAT_ETC" value="29">
</constant>
- <constant name="FORMAT_PVRTC4" value="16">
+ <constant name="FORMAT_ETC2_R11" value="30">
</constant>
- <constant name="FORMAT_PVRTC4A" value="17">
+ <constant name="FORMAT_ETC2_R11S" value="31">
</constant>
- <constant name="FORMAT_ETC" value="18">
+ <constant name="FORMAT_ETC2_RG11" value="32">
</constant>
- <constant name="FORMAT_ATC" value="19">
+ <constant name="FORMAT_ETC2_RG11S" value="33">
</constant>
- <constant name="FORMAT_ATC_ALPHA_EXPLICIT" value="20">
+ <constant name="FORMAT_ETC2_RGB8" value="34">
</constant>
- <constant name="FORMAT_ATC_ALPHA_INTERPOLATED" value="21">
+ <constant name="FORMAT_ETC2_RGBA8" value="35">
</constant>
- <constant name="FORMAT_CUSTOM" value="22">
+ <constant name="FORMAT_ETC2_RGB8A1" value="36">
+ </constant>
+ <constant name="FORMAT_MAX" value="37">
</constant>
<constant name="INTERPOLATE_NEAREST" value="0">
</constant>
@@ -16404,6 +20323,28 @@
</constant>
<constant name="INTERPOLATE_CUBIC" value="2">
</constant>
+ <constant name="ALPHA_NONE" value="0">
+ </constant>
+ <constant name="ALPHA_BIT" value="1">
+ </constant>
+ <constant name="ALPHA_BLEND" value="2">
+ </constant>
+ <constant name="COMPRESS_S3TC" value="0">
+ </constant>
+ <constant name="COMPRESS_PVRTC2" value="1">
+ </constant>
+ <constant name="COMPRESS_PVRTC4" value="2">
+ </constant>
+ <constant name="COMPRESS_ETC" value="3">
+ </constant>
+ <constant name="COMPRESS_ETC2" value="4">
+ </constant>
+ <constant name="COMPRESS_SOURCE_GENERIC" value="0">
+ </constant>
+ <constant name="COMPRESS_SOURCE_SRGB" value="1">
+ </constant>
+ <constant name="COMPRESS_SOURCE_NORMAL" value="2">
+ </constant>
</constants>
</class>
<class name="ImageTexture" inherits="Texture" category="Core">
@@ -16438,10 +20379,6 @@
Create a new [ImageTexture] from an [Image] with "flags" from [Texture].FLAG_*.
</description>
</method>
- <method name="fix_alpha_edges">
- <description>
- </description>
- </method>
<method name="get_data" qualifiers="const">
<return type="Image">
</return>
@@ -16477,14 +20414,6 @@
Load an [ImageTexure].
</description>
</method>
- <method name="normal_to_xy">
- <description>
- </description>
- </method>
- <method name="premultiply_alpha">
- <description>
- </description>
- </method>
<method name="set_data">
<argument index="0" name="image" type="Image">
</argument>
@@ -16512,10 +20441,6 @@
Set the storage type. One of [ImageTexture].STORAGE_*.
</description>
</method>
- <method name="shrink_x2_and_keep_size">
- <description>
- </description>
- </method>
</methods>
<constants>
<constant name="STORAGE_RAW" value="0">
@@ -16620,7 +20545,7 @@
A Singleton that deals with inputs.
</brief_description>
<description>
- A Singleton that deals with inputs. This includes key presses, mouse buttons and movement, joysticks, and input actions.
+ A Singleton that deals with inputs. This includes key presses, mouse buttons and movement, joypads, and input actions.
</description>
<methods>
<method name="action_press">
@@ -16653,11 +20578,17 @@
If the device has an accelerometer, this will return the movement.
</description>
</method>
- <method name="get_connected_joysticks">
+ <method name="get_connected_joypads">
<return type="Array">
</return>
<description>
- Returns an [Array] containing the device IDs of all currently connected joysticks.
+ Returns an [Array] containing the device IDs of all currently connected joypads.
+ </description>
+ </method>
+ <method name="get_gravity" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
</description>
</method>
<method name="get_gyroscope" qualifiers="const">
@@ -16675,7 +20606,7 @@
<argument index="1" name="axis" type="int">
</argument>
<description>
- Returns the current value of the joystick axis at given index (see JOY_* constants in [@Global Scope])
+ Returns the current value of the joypad axis at given index (see JOY_* constants in [@Global Scope])
</description>
</method>
<method name="get_joy_axis_index_from_string">
@@ -16725,7 +20656,7 @@
<argument index="0" name="device" type="int">
</argument>
<description>
- Returns the name of the joystick at the specified device index
+ Returns the name of the joypad at the specified device index
</description>
</method>
<method name="get_joy_vibration_duration">
@@ -16743,7 +20674,14 @@
<argument index="0" name="device" type="int">
</argument>
<description>
- Returns the strength of the joystick vibration: x is the strength of the weak motor, and y is the strength of the strong motor.
+ Returns the strength of the joypad vibration: x is the strength of the weak motor, and y is the strength of the strong motor.
+ </description>
+ </method>
+ <method name="get_last_mouse_speed" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <description>
+ Returns the mouse speed for the last time the cursor was moved, and this until the next frame where the mouse moves. This means that even if the mouse is not moving, this function will still return the value of the last motion.
</description>
</method>
<method name="get_magnetometer" qualifiers="const">
@@ -16767,13 +20705,6 @@
Return the mouse mode. See the constants for more information.
</description>
</method>
- <method name="get_mouse_speed" qualifiers="const">
- <return type="Vector2">
- </return>
- <description>
- Returns the mouse speed for the last time the cursor was moved, and this until the next frame where the mouse moves. This means that even if the mouse is not moving, this function will still return the value of the last motion.
- </description>
- </method>
<method name="is_action_just_pressed" qualifiers="const">
<return type="bool">
</return>
@@ -16807,7 +20738,7 @@
<argument index="1" name="button" type="int">
</argument>
<description>
- Returns if the joystick button at the given index is currently pressed. (see JOY_* constants in [@Global Scope])
+ Returns if the joypad button at the given index is currently pressed. (see JOY_* constants in [@Global Scope])
</description>
</method>
<method name="is_joy_known">
@@ -16816,7 +20747,7 @@
<argument index="0" name="device" type="int">
</argument>
<description>
- Returns if the specified device is known by the system. This means that it sets all button and axis indices exactly as defined in the JOY_* constants (see [@Global Scope]). Unknown joysticks are not expected to match these constants, but you can still retrieve events from them.
+ Returns if the specified device is known by the system. This means that it sets all button and axis indices exactly as defined in the JOY_* constants (see [@Global Scope]). Unknown joypads are not expected to match these constants, but you can still retrieve events from them.
</description>
</method>
<method name="is_key_pressed" qualifiers="const">
@@ -16837,6 +20768,12 @@
Returns true or false depending on whether mouse button is pressed or not. You can pass BUTTON_*, which are pre-defined constants listed in [@Global Scope].
</description>
</method>
+ <method name="parse_input_event">
+ <argument index="0" name="event" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="remove_joy_mapping">
<argument index="0" name="guid" type="String">
</argument>
@@ -16870,7 +20807,7 @@
<argument index="3" name="duration" type="float" default="0">
</argument>
<description>
- Starts to vibrate the joystick. Joysticks usually come with two rumble motors, a strong and a weak one. weak_magnitude is the strength of the weak motor (between 0 and 1) and strong_magnitude is the strength of the strong motor (between 0 and 1). duration is the duration of the effect in seconds (a duration of 0 will try to play the vibration indefinitely).
+ Starts to vibrate the joypad. Joypads usually come with two rumble motors, a strong and a weak one. weak_magnitude is the strength of the weak motor (between 0 and 1) and strong_magnitude is the strength of the strong motor (between 0 and 1). duration is the duration of the effect in seconds (a duration of 0 will try to play the vibration indefinitely).
Note that not every hardware is compatible with long effect durations, it is recommended to restart an effect if in need to play it for more than a few seconds.
</description>
</method>
@@ -16878,7 +20815,7 @@
<argument index="0" name="device" type="int">
</argument>
<description>
- Stops the vibration of the joystick.
+ Stops the vibration of the joypad.
</description>
</method>
<method name="warp_mouse_pos">
@@ -16896,7 +20833,7 @@
<argument index="1" name="connected" type="bool">
</argument>
<description>
- Emitted when a joystick device has been connected or disconnected
+ Emitted when a joypad device has been connected or disconnected
</description>
</signal>
</signals>
@@ -16910,6 +20847,8 @@
<constant name="MOUSE_MODE_CAPTURED" value="2">
Captures the mouse. The mouse will be hidden and unable to leave the game window. But it will still register movement and mouse button presses.
</constant>
+ <constant name="MOUSE_MODE_CONFINED" value="3">
+ </constant>
</constants>
</class>
<class name="InputDefault" inherits="Input" category="Core">
@@ -16924,15 +20863,39 @@
<constants>
</constants>
</class>
-<class name="InputEvent" category="Built-In Types">
+<class name="InputEvent" inherits="Resource" category="Core">
<brief_description>
- Built-in input event data.
</brief_description>
<description>
- Built-in input event data. InputEvent is a built-in engine datatype, given that it's passed around and used so much. Depending on its type, the members contained can be different, so read the documentation well! Input events can also represent actions (editable from the project settings).
</description>
<methods>
- <method name="is_action">
+ <method name="action_match" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="event" type="InputEvent">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="as_text" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_device" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_id" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_action" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="action" type="String">
@@ -16941,7 +20904,7 @@
Return if this input event matches a pre-defined action, no matter the type.
</description>
</method>
- <method name="is_action_pressed">
+ <method name="is_action_pressed" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="action" type="String">
@@ -16950,7 +20913,7 @@
Return whether the given action is being pressed (and is not an echo event for KEY events). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE.
</description>
</method>
- <method name="is_action_released">
+ <method name="is_action_released" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="action" type="String">
@@ -16959,1045 +20922,639 @@
Return whether the given action is released (i.e. not pressed). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE.
</description>
</method>
- <method name="is_echo">
+ <method name="is_action_type" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_echo" qualifiers="const">
<return type="bool">
</return>
<description>
Return if this input event is an echo event (only for events of type KEY, it will return false for other types).
</description>
</method>
- <method name="is_pressed">
+ <method name="is_pressed" qualifiers="const">
<return type="bool">
</return>
<description>
Return if this input event is pressed. Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE.
</description>
</method>
- <method name="set_as_action">
- <argument index="0" name="action" type="String">
+ <method name="set_device">
+ <argument index="0" name="device" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_id">
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="shortcut_match" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="event" type="InputEvent">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="xformed_by" qualifiers="const">
+ <return type="InputEvent">
+ </return>
+ <argument index="0" name="xform" type="Transform2D">
</argument>
- <argument index="1" name="pressed" type="bool">
+ <argument index="1" name="local_ofs" type="Vector2" default="Vector2(0, 0)">
</argument>
<description>
- Change the input event to an action event of the given name, regardless of its initial type, with the pressed status passed as argument.
</description>
</method>
</methods>
<members>
- <member name="ID" type="int">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="device" type="int">
- Device identifier.
- </member>
- <member name="type" type="int">
- Type of event (one of the [InputEvent] constants).
+ <member name="device" type="int" setter="set_device" getter="get_device" brief="">
</member>
</members>
<constants>
- <constant name="NONE" value="0">
- Empty input event.
- </constant>
- <constant name="KEY" value="1">
- Key event.
- </constant>
- <constant name="MOUSE_MOTION" value="2">
- Mouse motion event.
- </constant>
- <constant name="MOUSE_BUTTON" value="3">
- Mouse button event.
- </constant>
- <constant name="JOYSTICK_MOTION" value="4">
- Joystick motion event.
- </constant>
- <constant name="JOYSTICK_BUTTON" value="5">
- Joystick button event.
- </constant>
- <constant name="SCREEN_TOUCH" value="6">
- Screen touch event.
- </constant>
- <constant name="SCREEN_DRAG" value="7">
- Screen drag event.
- </constant>
- <constant name="ACTION" value="8">
- Pre-defined action event (see [InputMap]).
- </constant>
</constants>
</class>
-<class name="InputEventAction" category="Built-In Types">
+<class name="InputEventAction" inherits="InputEvent" category="Core">
<brief_description>
- Built-in input event type for actions.
+ Input event type for actions.
</brief_description>
<description>
- Input event type for actions that extends the global [InputEvent] type.
</description>
<methods>
- <method name="is_action">
- <return type="bool">
+ <method name="get_action" qualifiers="const">
+ <return type="String">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return if this input event matches a pre-defined action, i.e. always true for InputEventAction.
</description>
</method>
- <method name="is_action_pressed">
- <return type="bool">
- </return>
+ <method name="set_action">
<argument index="0" name="action" type="String">
</argument>
<description>
- Return whether the given action is being pressed.
</description>
</method>
- <method name="is_action_released">
- <return type="bool">
- </return>
- <argument index="0" name="action" type="String">
+ <method name="set_pressed">
+ <argument index="0" name="pressed" type="bool">
</argument>
<description>
- Return whether the given action is released (i.e. not pressed).
</description>
</method>
- <method name="is_echo">
- <return type="bool">
+ </methods>
+ <members>
+ <member name="action" type="String" setter="set_action" getter="get_action" brief="">
+ </member>
+ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="InputEventJoypadButton" inherits="InputEvent" category="Core">
+ <brief_description>
+ Input event type for joypad button events.
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_button_index" qualifiers="const">
+ <return type="int">
</return>
<description>
- Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type).
</description>
</method>
- <method name="is_pressed">
- <return type="bool">
+ <method name="get_pressure" qualifiers="const">
+ <return type="float">
</return>
<description>
- Return if this input event is pressed.
</description>
</method>
- <method name="set_as_action">
- <argument index="0" name="action" type="String">
+ <method name="set_button_index">
+ <argument index="0" name="button_index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_pressed">
+ <argument index="0" name="pressed" type="bool">
</argument>
- <argument index="1" name="pressed" type="bool">
+ <description>
+ </description>
+ </method>
+ <method name="set_pressure">
+ <argument index="0" name="pressure" type="float">
</argument>
<description>
- Change the input event to an action event of the given name with the pressed status passed as argument.
</description>
</method>
</methods>
<members>
- <member name="ID" type="int">
- Event identifier, positive integer increased at each new event.
+ <member name="button_index" type="int" setter="set_button_index" getter="get_button_index" brief="">
+ Joypad button identifier, one of the JOY_BUTTON_* constants in [@Global Scope].
</member>
- <member name="device" type="int">
- Device identifier.
+ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" brief="">
+ Pressed state of the joypad button.
</member>
- <member name="type" type="int">
- Type of event (one of the [InputEvent] constants).
+ <member name="pressure" type="float" setter="set_pressure" getter="get_pressure" brief="">
+ Intensity of the button pressure, ranges from 0 to 1.0.
</member>
</members>
<constants>
- <constant name="NONE" value="0">
- Empty input event.
- </constant>
- <constant name="KEY" value="1">
- Key event.
- </constant>
- <constant name="MOUSE_MOTION" value="2">
- Mouse motion event.
- </constant>
- <constant name="MOUSE_BUTTON" value="3">
- Mouse button event.
- </constant>
- <constant name="JOYSTICK_MOTION" value="4">
- Joystick motion event.
- </constant>
- <constant name="JOYSTICK_BUTTON" value="5">
- Joystick button event.
- </constant>
- <constant name="SCREEN_TOUCH" value="6">
- Screen touch event.
- </constant>
- <constant name="SCREEN_DRAG" value="7">
- Screen drag event.
- </constant>
- <constant name="ACTION" value="8">
- Pre-defined action event (see [InputMap]).
- </constant>
</constants>
</class>
-<class name="InputEventJoystickButton" category="Built-In Types">
+<class name="InputEventJoypadMotion" inherits="InputEvent" category="Core">
<brief_description>
- Built-in input event type for joystick button events.
+ Input event type for joypad motion/axis events.
</brief_description>
<description>
- Input event type for joystick button events that extends the global [InputEvent] type.
</description>
<methods>
- <method name="is_action">
- <return type="bool">
+ <method name="get_axis" qualifiers="const">
+ <return type="int">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return if this input event matches a pre-defined action.
</description>
</method>
- <method name="is_action_pressed">
- <return type="bool">
+ <method name="get_axis_value" qualifiers="const">
+ <return type="float">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is being pressed.
</description>
</method>
- <method name="is_action_released">
- <return type="bool">
- </return>
- <argument index="0" name="action" type="String">
+ <method name="set_axis">
+ <argument index="0" name="axis" type="int">
</argument>
<description>
- Return whether the given action is released (i.e. not pressed).
- </description>
- </method>
- <method name="is_echo">
- <return type="bool">
- </return>
- <description>
- Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type).
- </description>
- </method>
- <method name="is_pressed">
- <return type="bool">
- </return>
- <description>
- Return if this input event is pressed.
</description>
</method>
- <method name="set_as_action">
- <argument index="0" name="action" type="String">
- </argument>
- <argument index="1" name="pressed" type="bool">
+ <method name="set_axis_value">
+ <argument index="0" name="axis_value" type="float">
</argument>
<description>
- Change the input event to an action event of the given name with the pressed status passed as argument.
</description>
</method>
</methods>
<members>
- <member name="ID" type="int">
- Event identifier, positive integer increased at each new event.
+ <member name="axis" type="int" setter="set_axis" getter="get_axis" brief="">
+ Joypad axis identifier, one of the JOY_AXIS_* constants in [@Global Scope].
</member>
- <member name="button_index" type="int">
- Joystick button identifier, one of the JOY_BUTTON_* constants in [@Global Scope].
- </member>
- <member name="device" type="int">
- Device identifier.
- </member>
- <member name="pressed" type="bool">
- Pressed state of the joystick button.
- </member>
- <member name="pressure" type="float">
- Intensity of the button pressure, ranges from 0 to 1.0.
- </member>
- <member name="type" type="int">
- Type of event (one of the [InputEvent] constants).
+ <member name="axis_value" type="float" setter="set_axis_value" getter="get_axis_value" brief="">
+ Position of the axis, ranging from -1.0 to 1.0. A value of 0 means that the axis is in its neutral position.
</member>
</members>
<constants>
- <constant name="NONE" value="0">
- Empty input event.
- </constant>
- <constant name="KEY" value="1">
- Key event.
- </constant>
- <constant name="MOUSE_MOTION" value="2">
- Mouse motion event.
- </constant>
- <constant name="MOUSE_BUTTON" value="3">
- Mouse button event.
- </constant>
- <constant name="JOYSTICK_MOTION" value="4">
- Joystick motion event.
- </constant>
- <constant name="JOYSTICK_BUTTON" value="5">
- Joystick button event.
- </constant>
- <constant name="SCREEN_TOUCH" value="6">
- Screen touch event.
- </constant>
- <constant name="SCREEN_DRAG" value="7">
- Screen drag event.
- </constant>
- <constant name="ACTION" value="8">
- Pre-defined action event (see [InputMap]).
- </constant>
</constants>
</class>
-<class name="InputEventJoystickMotion" category="Built-In Types">
+<class name="InputEventKey" inherits="InputEventWithModifiers" category="Core">
<brief_description>
- Built-in input event type for joystick motion/axis events.
+ Input event type for keyboard events.
</brief_description>
<description>
- Input event type for joystick motion/axis events that extends the global [InputEvent] type.
</description>
<methods>
- <method name="is_action">
- <return type="bool">
+ <method name="get_scancode" qualifiers="const">
+ <return type="int">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
</description>
</method>
- <method name="is_action_pressed">
- <return type="bool">
+ <method name="get_scancode_with_modifiers" qualifiers="const">
+ <return type="int">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is being pressed.
</description>
</method>
- <method name="is_action_released">
- <return type="bool">
+ <method name="get_unicode" qualifiers="const">
+ <return type="int">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is released (i.e. not pressed).
</description>
</method>
- <method name="is_echo">
- <return type="bool">
- </return>
+ <method name="set_echo">
+ <argument index="0" name="echo" type="bool">
+ </argument>
<description>
- Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type).
</description>
</method>
- <method name="is_pressed">
- <return type="bool">
- </return>
+ <method name="set_pressed">
+ <argument index="0" name="pressed" type="bool">
+ </argument>
<description>
- Return if this input event is pressed.
</description>
</method>
- <method name="set_as_action">
- <argument index="0" name="action" type="String">
+ <method name="set_scancode">
+ <argument index="0" name="scancode" type="int">
</argument>
- <argument index="1" name="pressed" type="bool">
+ <description>
+ </description>
+ </method>
+ <method name="set_unicode">
+ <argument index="0" name="unicode" type="int">
</argument>
<description>
- Change the input event to an action event of the given name with the pressed status passed as argument.
</description>
</method>
</methods>
<members>
- <member name="ID" type="int">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="axis" type="int">
- Joystick axis identifier, one of the JOY_AXIS_* constants in [@Global Scope].
+ <member name="echo" type="int" setter="set_echo" getter="is_echo" brief="">
+ Echo state of the key, i.e. whether it's a repeat event or not.
</member>
- <member name="device" type="int">
- Device identifier.
+ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" brief="">
+ Pressed state of the key.
</member>
- <member name="type" type="int">
- Type of event (one of the [InputEvent] constants).
+ <member name="scancode" type="int" setter="set_scancode" getter="get_scancode" brief="">
+ Scancode of the key, one of the KEY_* constants in [@Global Scope].
</member>
- <member name="value" type="float">
- Position of the axis, ranging from -1.0 to 1.0. A value of 0 means that the axis is in its neutral position.
+ <member name="unicode" type="int" setter="set_unicode" getter="get_unicode" brief="">
+ Unicode identifier of the key (when relevant).
</member>
</members>
<constants>
- <constant name="NONE" value="0">
- Empty input event.
- </constant>
- <constant name="KEY" value="1">
- Key event.
- </constant>
- <constant name="MOUSE_MOTION" value="2">
- Mouse motion event.
- </constant>
- <constant name="MOUSE_BUTTON" value="3">
- Mouse button event.
- </constant>
- <constant name="JOYSTICK_MOTION" value="4">
- Joystick motion event.
- </constant>
- <constant name="JOYSTICK_BUTTON" value="5">
- Joystick button event.
- </constant>
- <constant name="SCREEN_TOUCH" value="6">
- Screen touch event.
- </constant>
- <constant name="SCREEN_DRAG" value="7">
- Screen drag event.
- </constant>
- <constant name="ACTION" value="8">
- Pre-defined action event (see [InputMap]).
- </constant>
</constants>
</class>
-<class name="InputEventKey" category="Built-In Types">
+<class name="InputEventMouse" inherits="InputEventWithModifiers" category="Core">
<brief_description>
- Built-in input event type for keyboard events.
+ Base input event type for mouse events.
</brief_description>
<description>
- Input event type for keyboard events that extends the global [InputEvent] type.
</description>
<methods>
- <method name="is_action">
- <return type="bool">
+ <method name="get_button_mask" qualifiers="const">
+ <return type="int">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return if this input event matches a pre-defined action.
</description>
</method>
- <method name="is_action_pressed">
- <return type="bool">
+ <method name="get_global_position" qualifiers="const">
+ <return type="Vector2">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is being pressed.
</description>
</method>
- <method name="is_action_released">
- <return type="bool">
+ <method name="get_position" qualifiers="const">
+ <return type="Vector2">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is released (i.e. not pressed).
</description>
</method>
- <method name="is_echo">
- <return type="bool">
- </return>
+ <method name="set_button_mask">
+ <argument index="0" name="button_mask" type="int">
+ </argument>
<description>
- Return if this input event is an echo event.
</description>
</method>
- <method name="is_pressed">
- <return type="bool">
- </return>
+ <method name="set_global_position">
+ <argument index="0" name="global_position" type="Vector2">
+ </argument>
<description>
- Return if this input event is pressed.
</description>
</method>
- <method name="set_as_action">
- <argument index="0" name="action" type="String">
- </argument>
- <argument index="1" name="pressed" type="bool">
+ <method name="set_position">
+ <argument index="0" name="position" type="Vector2">
</argument>
<description>
- Change the input event to an action event of the given name with the pressed status passed as argument.
</description>
</method>
</methods>
<members>
- <member name="ID" type="int">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="alt" type="bool">
- State of the Alt modifier.
- </member>
- <member name="control" type="bool">
- State of the Ctrl modifier.
- </member>
- <member name="device" type="int">
- Device identifier.
- </member>
- <member name="echo" type="bool">
- Echo state of the key, i.e. whether it's a repeat event or not.
- </member>
- <member name="meta" type="bool">
- State of the Meta modifier.
- </member>
- <member name="pressed" type="bool">
- Pressed state of the key.
- </member>
- <member name="scancode" type="int">
- Scancode of the key, one of the KEY_* constants in [@Global Scope].
- </member>
- <member name="shift" type="bool">
- State of the Shift modifier.
+ <member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" brief="">
+ Mouse button mask identifier, one of or a bitwise combination of the BUTTON_MASK_* constants in [@Global Scope].
</member>
- <member name="type" type="int">
- Type of event (one of the [InputEvent] constants).
+ <member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position" brief="">
+ Global position of the mouse click.
</member>
- <member name="unicode" type="int">
- Unicode identifier of the key (when relevant).
+ <member name="position" type="Vector2" setter="set_position" getter="get_position" brief="">
+ Local position of the mouse click.
</member>
</members>
<constants>
- <constant name="NONE" value="0">
- Empty input event.
- </constant>
- <constant name="KEY" value="1">
- Key event.
- </constant>
- <constant name="MOUSE_MOTION" value="2">
- Mouse motion event.
- </constant>
- <constant name="MOUSE_BUTTON" value="3">
- Mouse button event.
- </constant>
- <constant name="JOYSTICK_MOTION" value="4">
- Joystick motion event.
- </constant>
- <constant name="JOYSTICK_BUTTON" value="5">
- Joystick button event.
- </constant>
- <constant name="SCREEN_TOUCH" value="6">
- Screen touch event.
- </constant>
- <constant name="SCREEN_DRAG" value="7">
- Screen drag event.
- </constant>
- <constant name="ACTION" value="8">
- Pre-defined action event (see [InputMap]).
- </constant>
</constants>
</class>
-<class name="InputEventMouseButton" category="Built-In Types">
+<class name="InputEventMouseButton" inherits="InputEventMouse" category="Core">
<brief_description>
- Built-in input event type for mouse button events.
+ Input event type for mouse button events.
</brief_description>
<description>
- Input event type for mouse button events that extends the global [InputEvent] type.
</description>
<methods>
- <method name="is_action">
- <return type="bool">
+ <method name="get_button_index" qualifiers="const">
+ <return type="int">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return if this input event matches a pre-defined action.
</description>
</method>
- <method name="is_action_pressed">
- <return type="bool">
+ <method name="get_factor">
+ <return type="float">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is being pressed.
</description>
</method>
- <method name="is_action_released">
+ <method name="is_doubleclick" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is released (i.e. not pressed).
</description>
</method>
- <method name="is_echo">
- <return type="bool">
- </return>
+ <method name="set_button_index">
+ <argument index="0" name="button_index" type="int">
+ </argument>
<description>
- Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type).
</description>
</method>
- <method name="is_pressed">
- <return type="bool">
- </return>
+ <method name="set_doubleclick">
+ <argument index="0" name="doubleclick" type="bool">
+ </argument>
<description>
- Return if this input event is pressed.
</description>
</method>
- <method name="set_as_action">
- <argument index="0" name="action" type="String">
+ <method name="set_factor">
+ <argument index="0" name="factor" type="float">
</argument>
- <argument index="1" name="pressed" type="bool">
+ <description>
+ </description>
+ </method>
+ <method name="set_pressed">
+ <argument index="0" name="pressed" type="bool">
</argument>
<description>
- Change the input event to an action event of the given name with the pressed status passed as argument.
</description>
</method>
</methods>
<members>
- <member name="ID" type="int">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="alt" type="bool">
- State of the Alt modifier.
- </member>
- <member name="button_index" type="int">
+ <member name="button_index" type="int" setter="set_button_index" getter="get_button_index" brief="">
Mouse button identifier, one of the BUTTON_* or BUTTON_WHEEL_* constants in [@Global Scope].
</member>
- <member name="button_mask" type="int">
- Mouse button mask identifier, one of or a bitwise combination of the BUTTON_MASK_* constants in [@Global Scope].
- </member>
- <member name="control" type="bool">
- State of the Control modifier.
- </member>
- <member name="device" type="int">
- Device identifier.
- </member>
- <member name="doubleclick" type="bool">
+ <member name="doubleclick" type="bool" setter="set_doubleclick" getter="is_doubleclick" brief="">
Whether the event is a double-click.
</member>
- <member name="global_pos" type="Vector2">
- Global position of the mouse click.
+ <member name="factor" type="float" setter="set_factor" getter="get_factor" brief="">
</member>
- <member name="global_x" type="int">
- Global X coordinate of the mouse click.
- </member>
- <member name="global_y" type="int">
- Global Y coordinate of the mouse click.
- </member>
- <member name="meta" type="bool">
- State of the Meta modifier.
- </member>
- <member name="pos" type="Vector2">
- Local position of the mouse click.
- </member>
- <member name="pressed" type="bool">
+ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" brief="">
Pressed state of the mouse button.
</member>
- <member name="shift" type="bool">
- State of the Shift modifier.
- </member>
- <member name="type" type="int">
- Type of event (one of the [InputEvent] constants).
- </member>
- <member name="x" type="int">
- Local X coordinate of the mouse click.
- </member>
- <member name="y" type="int">
- Local Y coordinate of the mouse click.
- </member>
</members>
<constants>
- <constant name="NONE" value="0">
- Empty input event.
- </constant>
- <constant name="KEY" value="1">
- Key event.
- </constant>
- <constant name="MOUSE_MOTION" value="2">
- Mouse motion event.
- </constant>
- <constant name="MOUSE_BUTTON" value="3">
- Mouse button event.
- </constant>
- <constant name="JOYSTICK_MOTION" value="4">
- Joystick motion event.
- </constant>
- <constant name="JOYSTICK_BUTTON" value="5">
- Joystick button event.
- </constant>
- <constant name="SCREEN_TOUCH" value="6">
- Screen touch event.
- </constant>
- <constant name="SCREEN_DRAG" value="7">
- Screen drag event.
- </constant>
- <constant name="ACTION" value="8">
- Pre-defined action event (see [InputMap]).
- </constant>
</constants>
</class>
-<class name="InputEventMouseMotion" category="Built-In Types">
+<class name="InputEventMouseMotion" inherits="InputEventMouse" category="Core">
<brief_description>
- Built-in input event type for mouse motion events.
+ Input event type for mouse motion events.
</brief_description>
<description>
- Input event type for mouse motion events that extends the global [InputEvent] type.
</description>
<methods>
- <method name="is_action">
- <return type="bool">
+ <method name="get_relative" qualifiers="const">
+ <return type="Vector2">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return if this input event matches a pre-defined action.
</description>
</method>
- <method name="is_action_pressed">
- <return type="bool">
+ <method name="get_speed" qualifiers="const">
+ <return type="Vector2">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is being pressed. Not relevant for MOUSE_MOTION events, always false.
</description>
</method>
- <method name="is_action_released">
- <return type="bool">
- </return>
- <argument index="0" name="action" type="String">
+ <method name="set_relative">
+ <argument index="0" name="relative" type="Vector2">
</argument>
<description>
- Return whether the given action is released (i.e. not pressed). Not relevant for MOUSE_MOTION events, can be true or false depending on whether [method is_action] is true.
- </description>
- </method>
- <method name="is_echo">
- <return type="bool">
- </return>
- <description>
- Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type).
- </description>
- </method>
- <method name="is_pressed">
- <return type="bool">
- </return>
- <description>
- Return if this input event is pressed. Not relevant for MOUSE_MOTION events, always false.
</description>
</method>
- <method name="set_as_action">
- <argument index="0" name="action" type="String">
- </argument>
- <argument index="1" name="pressed" type="bool">
+ <method name="set_speed">
+ <argument index="0" name="speed" type="Vector2">
</argument>
<description>
- Change the input event to an action event of the given name with the (irrelevant for this type) pressed status passed as argument.
</description>
</method>
</methods>
<members>
- <member name="ID" type="int">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="alt" type="bool">
- State of the Alt modifier.
- </member>
- <member name="button_mask" type="int">
- Mouse button mask identifier, one of or a bitwise combination of the BUTTON_MASK_* constants in [@Global Scope].
- </member>
- <member name="control" type="bool">
- State of the Ctrl modifier.
- </member>
- <member name="device" type="int">
- Device identifier.
- </member>
- <member name="global_pos" type="Vector2">
- Global position of the mouse pointer.
- </member>
- <member name="global_x" type="int">
- Global X coordinate of the mouse pointer.
- </member>
- <member name="global_y" type="int">
- Global Y coordinate of the mouse pointer.
- </member>
- <member name="meta" type="bool">
- State of the Meta modifier.
- </member>
- <member name="pos" type="Vector2">
- Local position of the mouse pointer.
- </member>
- <member name="relative_pos" type="Vector2">
+ <member name="relative" type="Vector2" setter="set_relative" getter="get_relative" brief="">
Position of the mouse pointer relative to the previous mouse position.
</member>
- <member name="relative_x" type="int">
- X coordinate of the mouse pointer relative to the previous mouse position.
- </member>
- <member name="relative_y" type="int">
- Y coordinate of the mouse pointer relative to the previous mouse position.
- </member>
- <member name="shift" type="bool">
- State of the Shift modifier.
- </member>
- <member name="speed" type="Vector2">
+ <member name="speed" type="Vector2" setter="set_speed" getter="get_speed" brief="">
Speed of the mouse pointer.
</member>
- <member name="speed_x" type="float">
- Speed of the mouse pointer on the X axis.
- </member>
- <member name="speed_y" type="float">
- Speed of the mouse pointer on the Y axis.
- </member>
- <member name="type" type="int">
- Type of event (one of the [InputEvent] constants).
- </member>
- <member name="x" type="int">
- Local X coordinate of the mouse pointer.
- </member>
- <member name="y" type="int">
- Local Y coordinate of the mouse pointer.
- </member>
</members>
<constants>
- <constant name="NONE" value="0">
- Empty input event.
- </constant>
- <constant name="KEY" value="1">
- Key event.
- </constant>
- <constant name="MOUSE_MOTION" value="2">
- Mouse motion event.
- </constant>
- <constant name="MOUSE_BUTTON" value="3">
- Mouse button event.
- </constant>
- <constant name="JOYSTICK_MOTION" value="4">
- Joystick motion event.
- </constant>
- <constant name="JOYSTICK_BUTTON" value="5">
- Joystick button event.
- </constant>
- <constant name="SCREEN_TOUCH" value="6">
- Screen touch event.
- </constant>
- <constant name="SCREEN_DRAG" value="7">
- Screen drag event.
- </constant>
- <constant name="ACTION" value="8">
- Pre-defined action event (see [InputMap]).
- </constant>
</constants>
</class>
-<class name="InputEventScreenDrag" category="Built-In Types">
+<class name="InputEventScreenDrag" inherits="InputEvent" category="Core">
<brief_description>
- Built-in input event type for screen drag events.
+ Input event type for screen drag events.
</brief_description>
<description>
- Input event type for screen drag events that extends the global [InputEvent] type.
</description>
<methods>
- <method name="is_action">
- <return type="bool">
+ <method name="get_index" qualifiers="const">
+ <return type="int">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return if this input event matches a pre-defined action.
</description>
</method>
- <method name="is_action_pressed">
- <return type="bool">
+ <method name="get_position" qualifiers="const">
+ <return type="Vector2">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is being pressed. Not relevant for SCREEN_DRAG events, always false.
</description>
</method>
- <method name="is_action_released">
- <return type="bool">
+ <method name="get_relative" qualifiers="const">
+ <return type="Vector2">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is released (i.e. not pressed). Not relevant for SCREEN_DRAG events, can be true or false depending on whether [method is_action] is true.
</description>
</method>
- <method name="is_echo">
- <return type="bool">
+ <method name="get_speed" qualifiers="const">
+ <return type="Vector2">
</return>
<description>
- Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type).
</description>
</method>
- <method name="is_pressed">
- <return type="bool">
- </return>
+ <method name="set_index">
+ <argument index="0" name="index" type="int">
+ </argument>
<description>
- Return if this input event is pressed. Not relevant for SCREEN_DRAG events, always false.
</description>
</method>
- <method name="set_as_action">
- <argument index="0" name="action" type="String">
+ <method name="set_position">
+ <argument index="0" name="position" type="Vector2">
</argument>
- <argument index="1" name="pressed" type="bool">
+ <description>
+ </description>
+ </method>
+ <method name="set_relative">
+ <argument index="0" name="relative" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_speed">
+ <argument index="0" name="speed" type="Vector2">
</argument>
<description>
- Change the input event to an action event of the given name with the (irrelevant for this type) pressed status passed as argument.
</description>
</method>
</methods>
<members>
- <member name="ID" type="int">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="device" type="int">
- Device identifier.
- </member>
- <member name="index" type="int">
+ <member name="index" type="int" setter="set_index" getter="get_index" brief="">
Drag event index in the case of a multi-drag event.
</member>
- <member name="pos" type="Vector2">
+ <member name="position" type="Vector2" setter="set_position" getter="get_position" brief="">
Position of the drag event.
</member>
- <member name="relative_pos" type="Vector2">
+ <member name="relative" type="Vector2" setter="set_relative" getter="get_relative" brief="">
Position of the drag event relative to its start position.
</member>
- <member name="relative_x" type="float">
- X coordinate of the drag event relative to its start position.
- </member>
- <member name="relative_y" type="float">
- Y coordinate of the drag event relative to its start position.
- </member>
- <member name="speed" type="Vector2">
+ <member name="speed" type="Vector2" setter="set_speed" getter="get_speed" brief="">
Speed of the drag event.
</member>
- <member name="speed_x" type="float">
- Speed of the drag event on the X axis.
- </member>
- <member name="speed_y" type="float">
- Speed of the drag event on the Y axis.
- </member>
- <member name="type" type="int">
- Type of event (one of the [InputEvent] constants).
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="InputEventScreenTouch" inherits="InputEvent" category="Core">
+ <brief_description>
+ Input event type for screen touch events.
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_index" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_position" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_index">
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_position">
+ <argument index="0" name="pos" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_pressed">
+ <argument index="0" name="pressed" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="index" type="int" setter="set_index" getter="get_index" brief="">
+ Touch event index in the case of a multi-touch event.
</member>
- <member name="x" type="float">
- X coordinate of the drag event.
+ <member name="position" type="Vector2" setter="set_position" getter="get_position" brief="">
+ Position of the touch event.
</member>
- <member name="y" type="float">
- Y coordinate of the drag event.
+ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" brief="">
+ Pressed state of the touch event.
</member>
</members>
<constants>
- <constant name="NONE" value="0">
- Empty input event.
- </constant>
- <constant name="KEY" value="1">
- Key event.
- </constant>
- <constant name="MOUSE_MOTION" value="2">
- Mouse motion event.
- </constant>
- <constant name="MOUSE_BUTTON" value="3">
- Mouse button event.
- </constant>
- <constant name="JOYSTICK_MOTION" value="4">
- Joystick motion event.
- </constant>
- <constant name="JOYSTICK_BUTTON" value="5">
- Joystick button event.
- </constant>
- <constant name="SCREEN_TOUCH" value="6">
- Screen touch event.
- </constant>
- <constant name="SCREEN_DRAG" value="7">
- Screen drag event.
- </constant>
- <constant name="ACTION" value="8">
- Pre-defined action event (see [InputMap]).
- </constant>
</constants>
</class>
-<class name="InputEventScreenTouch" category="Built-In Types">
+<class name="InputEventWithModifiers" inherits="InputEvent" category="Core">
<brief_description>
- Built-in input event type for touchscreen drag events.
+ Base class for input events with modifiers.
</brief_description>
<description>
- Input event type for touchscreen drag events that extends the global [InputEvent] type.
</description>
<methods>
- <method name="is_action">
+ <method name="get_alt" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return if this input event matches a pre-defined action.
</description>
</method>
- <method name="is_action_pressed">
+ <method name="get_command" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is being pressed.
</description>
</method>
- <method name="is_action_released">
+ <method name="get_control" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="action" type="String">
- </argument>
<description>
- Return whether the given action is released (i.e. not pressed).
</description>
</method>
- <method name="is_echo">
+ <method name="get_metakey" qualifiers="const">
<return type="bool">
</return>
<description>
- Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type).
</description>
</method>
- <method name="is_pressed">
+ <method name="get_shift" qualifiers="const">
<return type="bool">
</return>
<description>
- Return if this input event is pressed.
</description>
</method>
- <method name="set_as_action">
- <argument index="0" name="action" type="String">
+ <method name="set_alt">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_command">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_control">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_metakey">
+ <argument index="0" name="enable" type="bool">
</argument>
- <argument index="1" name="pressed" type="bool">
+ <description>
+ </description>
+ </method>
+ <method name="set_shift">
+ <argument index="0" name="enable" type="bool">
</argument>
<description>
- Change the input event to an action event of the given name with the pressed status passed as argument.
</description>
</method>
</methods>
<members>
- <member name="ID" type="int">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="device" type="int">
- Device identifier.
- </member>
- <member name="index" type="int">
- Touch event index in the case of a multi-touch event.
- </member>
- <member name="pos" type="Vector2">
- Position of the touch event.
+ <member name="alt" type="bool" setter="set_alt" getter="get_alt" brief="">
+ State of the Alt modifier.
</member>
- <member name="pressed" type="bool">
- Pressed state of the touch event.
+ <member name="command" type="bool" setter="set_command" getter="get_command" brief="">
+ State of the Command modifier.
</member>
- <member name="type" type="int">
- Type of event (one of the [InputEvent] constants).
+ <member name="control" type="bool" setter="set_control" getter="get_control" brief="">
+ State of the Ctrl modifier.
</member>
- <member name="x" type="float">
- X coordinate of the touch event.
+ <member name="meta" type="bool" setter="set_metakey" getter="get_metakey" brief="">
+ State of the Meta modifier.
</member>
- <member name="y" type="float">
- Y coordinate of the touch event.
+ <member name="shift" type="bool" setter="set_shift" getter="get_shift" brief="">
+ State of the Shift modifier.
</member>
</members>
<constants>
- <constant name="NONE" value="0">
- Empty input event.
- </constant>
- <constant name="KEY" value="1">
- Key event.
- </constant>
- <constant name="MOUSE_MOTION" value="2">
- Mouse motion event.
- </constant>
- <constant name="MOUSE_BUTTON" value="3">
- Mouse button event.
- </constant>
- <constant name="JOYSTICK_MOTION" value="4">
- Joystick motion event.
- </constant>
- <constant name="JOYSTICK_BUTTON" value="5">
- Joystick button event.
- </constant>
- <constant name="SCREEN_TOUCH" value="6">
- Screen touch event.
- </constant>
- <constant name="SCREEN_DRAG" value="7">
- Screen drag event.
- </constant>
- <constant name="ACTION" value="8">
- Pre-defined action event (see [InputMap]).
- </constant>
</constants>
</class>
<class name="InputMap" inherits="Object" category="Core">
@@ -18005,13 +21562,12 @@
Singleton that manages actions.
</brief_description>
<description>
- Singleton that manages actions. InputMap has a list of the actions used in InputEvent, which can be modified.
</description>
<methods>
<method name="action_add_event">
<argument index="0" name="action" type="String">
</argument>
- <argument index="1" name="event" type="InputEvent">
+ <argument index="1" name="event" type="Object">
</argument>
<description>
Add an [InputEvent] to an action. This [InputEvent] will trigger the action.
@@ -18020,7 +21576,7 @@
<method name="action_erase_event">
<argument index="0" name="action" type="String">
</argument>
- <argument index="1" name="event" type="InputEvent">
+ <argument index="1" name="event" type="Object">
</argument>
<description>
Remove an [InputEvent] from an action.
@@ -18031,7 +21587,7 @@
</return>
<argument index="0" name="action" type="String">
</argument>
- <argument index="1" name="event" type="InputEvent">
+ <argument index="1" name="event" type="Object">
</argument>
<description>
Whether an action has an [InputEvent] associated with it.
@@ -18054,7 +21610,7 @@
<method name="event_is_action" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="event" type="InputEvent">
+ <argument index="0" name="event" type="Object">
</argument>
<argument index="1" name="action" type="String">
</argument>
@@ -18062,24 +21618,6 @@
Return whether the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior.
</description>
</method>
- <method name="get_action_from_id" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Return the action corresponding to the identifier.
- </description>
- </method>
- <method name="get_action_id" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="action" type="String">
- </argument>
- <description>
- Return the identifier of the given action.
- </description>
- </method>
<method name="get_action_list">
<return type="Array">
</return>
@@ -18107,7 +21645,7 @@
</method>
<method name="load_from_globals">
<description>
- Clear the [InputMap] and load it anew from [Globals].
+ Clear the [InputMap] and load it anew from [ProjectSettings].
</description>
</method>
</methods>
@@ -18130,99 +21668,19 @@
Retrieve the path to the [PackedScene] resource file that is loaded by default when calling [method replace_by_instance].
</description>
</method>
- <method name="replace_by_instance">
- <argument index="0" name="custom_scene" type="PackedScene" default="NULL">
- </argument>
- <description>
- Replace this placeholder by the scene handed as an argument, or the original scene if no argument is given. As for all resources, the scene is loaded only if it's not loaded already. By manually loading the scene beforehand, delays caused by this function can be avoided.
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="IntArray" category="Built-In Types">
- <brief_description>
- Integer Array.
- </brief_description>
- <description>
- Integer Array. Array of integers. Can only contain integers. Optimized for memory usage, can't fragment the memory.
- </description>
- <methods>
- <method name="IntArray">
- <return type="IntArray">
- </return>
- <argument index="0" name="from" type="Array">
- </argument>
- <description>
- Create from a generic array.
- </description>
- </method>
- <method name="append">
- <argument index="0" name="integer" type="int">
- </argument>
- <description>
- Append an element at the end of the array (alias of [method push_back]).
- </description>
- </method>
- <method name="append_array">
- <argument index="0" name="array" type="IntArray">
- </argument>
- <description>
- Append an [IntArray] at the end of this array.
- </description>
- </method>
- <method name="insert">
- <return type="int">
+ <method name="get_stored_values">
+ <return type="Dictionary">
</return>
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="integer" type="int">
- </argument>
- <description>
- Insert a new int at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
- </description>
- </method>
- <method name="invert">
- <description>
- Reverse the order of the elements in the array (so first element will now be the last).
- </description>
- </method>
- <method name="push_back">
- <argument index="0" name="integer" type="int">
- </argument>
- <description>
- Append a value to the array.
- </description>
- </method>
- <method name="remove">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Remove an element from the array by index.
- </description>
- </method>
- <method name="resize">
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="with_order" type="bool" default="false">
</argument>
<description>
- Set the size of the [IntArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description>
</method>
- <method name="set">
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="integer" type="int">
+ <method name="replace_by_instance">
+ <argument index="0" name="custom_scene" type="PackedScene" default="NULL">
</argument>
<description>
- Change the int at the given index.
- </description>
- </method>
- <method name="size">
- <return type="int">
- </return>
- <description>
- Return the array size.
+ Replace this placeholder by the scene handed as an argument, or the original scene if no argument is given. As for all resources, the scene is loaded only if it's not loaded already. By manually loading the scene beforehand, delays caused by this function can be avoided.
</description>
</method>
</methods>
@@ -18278,76 +21736,14 @@
</description>
</method>
</methods>
- <constants>
- </constants>
-</class>
-<class name="InverseKinematics" inherits="Spatial" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- <method name="get_bone_name" qualifiers="const">
- <return type="String">
- </return>
- <description>
- </description>
- </method>
- <method name="get_chain_size" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="get_iterations" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="get_precision" qualifiers="const">
- <return type="float">
- </return>
- <description>
- </description>
- </method>
- <method name="get_speed" qualifiers="const">
- <return type="float">
- </return>
- <description>
- </description>
- </method>
- <method name="set_bone_name">
- <argument index="0" name="ik_bone" type="String">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_chain_size">
- <argument index="0" name="chain_size" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_iterations">
- <argument index="0" name="iterations" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_precision">
- <argument index="0" name="precision" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_speed">
- <argument index="0" name="speed" type="float">
- </argument>
- <description>
- </description>
- </method>
- </methods>
+ <members>
+ <member name="enabled" type="bool" setter="set_interpolation_enabled" getter="is_interpolation_enabled" brief="">
+ </member>
+ <member name="speed" type="float" setter="set_speed" getter="get_speed" brief="">
+ </member>
+ <member name="target" type="NodePath" setter="set_target_path" getter="get_target_path" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -18468,6 +21864,8 @@
</description>
</method>
<method name="get_item_metadata" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="idx" type="int">
</argument>
<description>
@@ -18512,7 +21910,7 @@
</description>
</method>
<method name="get_selected_items">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<description>
Returns the list of selected indexes.
@@ -18737,6 +22135,26 @@
</description>
</method>
</methods>
+ <members>
+ <member name="allow_rmb_select" type="bool" setter="set_allow_rmb_select" getter="get_allow_rmb_select" brief="">
+ </member>
+ <member name="fixed_column_width" type="int" setter="set_fixed_column_width" getter="get_fixed_column_width" brief="">
+ </member>
+ <member name="icon_mode" type="int" setter="set_icon_mode" getter="get_icon_mode" brief="">
+ </member>
+ <member name="icon_scale" type="float" setter="set_icon_scale" getter="get_icon_scale" brief="">
+ </member>
+ <member name="items" type="Array" setter="_set_items" getter="_get_items" brief="">
+ </member>
+ <member name="max_columns" type="int" setter="set_max_columns" getter="get_max_columns" brief="">
+ </member>
+ <member name="max_text_lines" type="int" setter="set_max_text_lines" getter="get_max_text_lines" brief="">
+ </member>
+ <member name="same_column_width" type="bool" setter="set_same_column_width" getter="is_same_column_width" brief="">
+ </member>
+ <member name="select_mode" type="int" setter="set_select_mode" getter="get_select_mode" brief="">
+ </member>
+ </members>
<signals>
<signal name="item_activated">
<argument index="0" name="index" type="int">
@@ -18869,6 +22287,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="collision/exclude_nodes" type="bool" setter="set_exclude_nodes_from_collision" getter="get_exclude_nodes_from_collision" brief="">
+ </member>
+ <member name="nodes/node_a" type="NodePath" setter="set_node_a" getter="get_node_a" brief="">
+ </member>
+ <member name="nodes/node_b" type="NodePath" setter="set_node_b" getter="get_node_b" brief="">
+ </member>
+ <member name="solver/priority" type="int" setter="set_solver_priority" getter="get_solver_priority" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -18933,6 +22361,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="bias" type="float" setter="set_bias" getter="get_bias" brief="">
+ </member>
+ <member name="disable_collision" type="bool" setter="set_exclude_nodes_from_collision" getter="get_exclude_nodes_from_collision" brief="">
+ </member>
+ <member name="node_a" type="NodePath" setter="set_node_a" getter="get_node_a" brief="">
+ </member>
+ <member name="node_b" type="NodePath" setter="set_node_b" getter="get_node_b" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -18946,146 +22384,183 @@
Kinematic Characters: KinematicBody also has an api for moving objects (the [method move] method) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics.
</description>
<methods>
- <method name="can_collide_with_character_bodies" qualifiers="const">
- <return type="bool">
+ <method name="get_collision_collider" qualifiers="const">
+ <return type="Object">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return if this body can collide with character bodies.
</description>
</method>
- <method name="can_collide_with_kinematic_bodies" qualifiers="const">
- <return type="bool">
+ <method name="get_collision_collider_id" qualifiers="const">
+ <return type="int">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return if this body can collide with kinematic bodies.
</description>
</method>
- <method name="can_collide_with_rigid_bodies" qualifiers="const">
- <return type="bool">
+ <method name="get_collision_collider_metadata" qualifiers="const">
+ <argument index="0" name="collision" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_collision_collider_shape" qualifiers="const">
+ <return type="Object">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return if this body can collide with rigid bodies.
</description>
</method>
- <method name="can_collide_with_static_bodies" qualifiers="const">
- <return type="bool">
+ <method name="get_collision_collider_shape_index" qualifiers="const">
+ <return type="int">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return if this body can collide with static bodies.
</description>
</method>
- <method name="can_teleport_to">
- <return type="bool">
+ <method name="get_collision_collider_velocity" qualifiers="const">
+ <return type="Vector3">
</return>
- <argument index="0" name="position" type="Vector3">
+ <argument index="0" name="collision" type="int">
</argument>
<description>
- Returns whether the KinematicBody can be teleported to the destination given as an argument, checking all collision shapes of the body against potential colliders at the destination.
</description>
</method>
- <method name="get_collider" qualifiers="const">
+ <method name="get_collision_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_collision_local_shape" qualifiers="const">
<return type="Object">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the body that collided with this one.
</description>
</method>
- <method name="get_collider_shape" qualifiers="const">
- <return type="int">
+ <method name="get_collision_normal" qualifiers="const">
+ <return type="Vector3">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the shape index from the body that collided with this one. If there is no collision, this method will return 0, so collisions must be checked first with [method is_colliding].
</description>
</method>
- <method name="get_collider_velocity" qualifiers="const">
+ <method name="get_collision_position" qualifiers="const">
<return type="Vector3">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the velocity of the body that collided with this one.
</description>
</method>
- <method name="get_collision_margin" qualifiers="const">
- <return type="float">
+ <method name="get_collision_remainder" qualifiers="const">
+ <return type="Vector3">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the collision margin for this object.
</description>
</method>
- <method name="get_collision_normal" qualifiers="const">
+ <method name="get_collision_travel" qualifiers="const">
<return type="Vector3">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the normal of the surface the body collided with. This is useful to implement sliding along a surface.
</description>
</method>
- <method name="get_collision_pos" qualifiers="const">
+ <method name="get_floor_velocity" qualifiers="const">
<return type="Vector3">
</return>
<description>
- Return the point in space where the body is touching another. If there is no collision, this method will return (0,0,0), so collisions must be checked first with [method is_colliding].
</description>
</method>
- <method name="is_colliding" qualifiers="const">
- <return type="bool">
+ <method name="get_safe_margin" qualifiers="const">
+ <return type="float">
</return>
<description>
- Return whether the body is colliding with another.
</description>
</method>
- <method name="move">
- <return type="Vector3">
+ <method name="is_on_ceiling" qualifiers="const">
+ <return type="bool">
</return>
- <argument index="0" name="rel_vec" type="Vector3">
- </argument>
<description>
- Move the body in the given direction, stopping if there is an obstacle. The returned vector is how much movement was remaining before being stopped.
</description>
</method>
- <method name="move_to">
- <return type="Vector3">
+ <method name="is_on_floor" qualifiers="const">
+ <return type="bool">
</return>
- <argument index="0" name="position" type="Vector3">
- </argument>
<description>
- Move the body to the given position. This is not a teleport, and the body will stop if there is an obstacle. The returned vector is how much movement was remaining before being stopped.
</description>
</method>
- <method name="set_collide_with_character_bodies">
- <argument index="0" name="enable" type="bool">
- </argument>
+ <method name="is_on_wall" qualifiers="const">
+ <return type="bool">
+ </return>
<description>
- Set if this body should collide with character bodies.
</description>
</method>
- <method name="set_collide_with_kinematic_bodies">
- <argument index="0" name="enable" type="bool">
+ <method name="move">
+ <return type="Dictionary">
+ </return>
+ <argument index="0" name="rel_vec" type="Vector3">
</argument>
<description>
- Set if this body should collide with kinematic bodies.
+ Move the body in the given direction, stopping if there is an obstacle. If as a result of a movement there will be any collision then informations about this collision will be in returned dictionary. Dictionary will contains those keys:
+ - "position" - collision position
+ - "normal" - collision normal
+ - "local_shape" - id of this kinematic body shape that took part in a collision
+ - "travel" - traveled movement before being stopped
+ - "remainder" - remaining movement before being stopped
+ - "collider_id" - id of the collider, it can be used when dealing with [PhysicsServer]
+ - "collider" - colliding body
+ - "collider_shape_index" - index of the colliding shape, inside collider body "collider_metadata"
+ If the body did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead. Please note that this method is less user friendly than [method move_and_slide]. If you don't want to program each edge case manually, then it's recommended to use [method move_and_slide] instead.
</description>
</method>
- <method name="set_collide_with_rigid_bodies">
- <argument index="0" name="enable" type="bool">
+ <method name="move_and_slide">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="linear_velocity" type="Vector3">
+ </argument>
+ <argument index="1" name="floor_normal" type="Vector3" default="Vector3(0, 0, 0)">
+ </argument>
+ <argument index="2" name="slope_stop_min_velocity" type="float" default="0.05">
+ </argument>
+ <argument index="3" name="max_bounces" type="int" default="4">
+ </argument>
+ <argument index="4" name="floor_max_angle" type="float" default="0.785398">
</argument>
<description>
- Set if this body should collide with rigid bodies.
</description>
</method>
- <method name="set_collide_with_static_bodies">
- <argument index="0" name="enable" type="bool">
+ <method name="set_safe_margin">
+ <argument index="0" name="pixels" type="float">
</argument>
<description>
- Set if this body should collide with static bodies.
</description>
</method>
- <method name="set_collision_margin">
- <argument index="0" name="pixels" type="float">
+ <method name="test_move">
+ <return type="bool">
+ </return>
+ <argument index="0" name="from" type="Transform">
+ </argument>
+ <argument index="1" name="rel_vec" type="Vector3">
</argument>
<description>
- Set the collision margin for this object. A collision margin is an amount that all shapes will grow when computing collisions, to account for numerical imprecision.
</description>
</method>
</methods>
+ <members>
+ <member name="collision/safe_margin" type="float" setter="set_safe_margin" getter="get_safe_margin" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -19099,100 +22574,145 @@
Kinematic Characters: KinematicBody2D also has an api for moving objects (the [method move] method) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics.
</description>
<methods>
- <method name="get_collider" qualifiers="const">
+ <method name="get_collision_collider" qualifiers="const">
<return type="Object">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the body that collided with this one.
</description>
</method>
- <method name="get_collider_metadata" qualifiers="const">
- <return type="Variant">
+ <method name="get_collision_collider_id" qualifiers="const">
+ <return type="int">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the metadata of the shape that collided with this body. If there is no collision, it will return 0, so collisions must be checked first with [method is_colliding]. Additionally, this metadata can not be set with [method Object.set_meta], it must be set with [method Physics2DServer.body_set_shape_metadata].
</description>
</method>
- <method name="get_collider_shape" qualifiers="const">
+ <method name="get_collision_collider_metadata" qualifiers="const">
+ <argument index="0" name="collision" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_collision_collider_shape" qualifiers="const">
+ <return type="Object">
+ </return>
+ <argument index="0" name="collision" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_collision_collider_shape_index" qualifiers="const">
<return type="int">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the shape index from the body that collided with this one. If there is no collision, this method will return 0, so collisions must be checked first with [method is_colliding].
</description>
</method>
- <method name="get_collider_velocity" qualifiers="const">
+ <method name="get_collision_collider_velocity" qualifiers="const">
<return type="Vector2">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
Return the velocity of the body that collided with this one.
</description>
</method>
- <method name="get_collision_margin" qualifiers="const">
- <return type="float">
+ <method name="get_collision_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_collision_local_shape" qualifiers="const">
+ <return type="Object">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the collision margin for this object.
</description>
</method>
<method name="get_collision_normal" qualifiers="const">
<return type="Vector2">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the normal of the surface the body collided with. This is useful to implement sliding along a surface.
</description>
</method>
- <method name="get_collision_pos" qualifiers="const">
+ <method name="get_collision_position" qualifiers="const">
<return type="Vector2">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the point in space where the body is touching another. If there is no collision, this method will return (0,0), so collisions must be checked first with [method is_colliding].
</description>
</method>
- <method name="get_move_and_slide_colliders" qualifiers="const">
- <return type="Array">
+ <method name="get_collision_remainder" qualifiers="const">
+ <return type="Vector2">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
</description>
</method>
- <method name="get_travel" qualifiers="const">
+ <method name="get_collision_travel" qualifiers="const">
<return type="Vector2">
</return>
+ <argument index="0" name="collision" type="int">
+ </argument>
<description>
- Return the last movement done by the body.
</description>
</method>
- <method name="is_colliding" qualifiers="const">
- <return type="bool">
+ <method name="get_floor_velocity" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_safe_margin" qualifiers="const">
+ <return type="float">
</return>
<description>
- Return whether the body is colliding with another.
</description>
</method>
- <method name="is_move_and_slide_on_ceiling" qualifiers="const">
+ <method name="is_on_ceiling" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="is_move_and_slide_on_floor" qualifiers="const">
+ <method name="is_on_floor" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="is_move_and_slide_on_wall" qualifiers="const">
+ <method name="is_on_wall" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
<method name="move">
- <return type="Vector2">
+ <return type="Dictionary">
</return>
<argument index="0" name="rel_vec" type="Vector2">
</argument>
<description>
- Move the body in the given direction, stopping if there is an obstacle. The returned vector is how much movement was remaining before being stopped.
+ Move the body in the given direction, stopping if there is an obstacle. If as a result of a movement there will be any collision then informations about this collision will be in returned dictionary. Dictionary will contains those keys:
+ - "position" - collision position
+ - "normal" - collision normal
+ - "local_shape" - id of this kinematic body shape that took part in a collision
+ - "travel" - traveled movement before being stopped
+ - "remainder" - remaining movement before being stopped
+ - "collider_id" - id of the collider, it can be used when dealing with [Physics2DServer]
+ - "collider" - colliding body
+ - "collider_shape_index" - index of the colliding shape, inside collider body "collider_metadata"
+ If the body did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead. Please note that this method is less user friendly than [method move_and_slide]. If you don't want to program each edge case manually, then it's recommended to use [method move_and_slide] instead.
</description>
</method>
<method name="move_and_slide">
@@ -19206,34 +22726,21 @@
</argument>
<argument index="3" name="max_bounces" type="int" default="4">
</argument>
- <description>
- </description>
- </method>
- <method name="move_to">
- <return type="Vector2">
- </return>
- <argument index="0" name="position" type="Vector2">
+ <argument index="4" name="floor_max_angle" type="float" default="0.785398">
</argument>
<description>
- Move the body to the given position. This is not a teleport, and the body will stop if there is an obstacle. The returned vector is how much movement was remaining before being stopped.
- </description>
- </method>
- <method name="revert_motion">
- <description>
- Undo the last movement done by the body.
</description>
</method>
- <method name="set_collision_margin">
+ <method name="set_safe_margin">
<argument index="0" name="pixels" type="float">
</argument>
<description>
- Set the collision margin for this object. A collision margin is an amount (in pixels) that all shapes will grow when computing collisions, to account for numerical imprecision.
</description>
</method>
<method name="test_move">
<return type="bool">
</return>
- <argument index="0" name="from" type="Matrix32">
+ <argument index="0" name="from" type="Transform2D">
</argument>
<argument index="1" name="rel_vec" type="Vector2">
</argument>
@@ -19242,6 +22749,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="collision/safe_margin" type="float" setter="set_safe_margin" getter="get_safe_margin" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -19421,6 +22932,26 @@
</description>
</method>
</methods>
+ <members>
+ <member name="align" type="int" setter="set_align" getter="get_align" brief="">
+ </member>
+ <member name="autowrap" type="bool" setter="set_autowrap" getter="has_autowrap" brief="">
+ </member>
+ <member name="clip_text" type="bool" setter="set_clip_text" getter="is_clipping_text" brief="">
+ </member>
+ <member name="lines_skipped" type="int" setter="set_lines_skipped" getter="get_lines_skipped" brief="">
+ </member>
+ <member name="max_lines_visible" type="int" setter="set_max_lines_visible" getter="get_max_lines_visible" brief="">
+ </member>
+ <member name="percent_visible" type="float" setter="set_percent_visible" getter="get_percent_visible" brief="">
+ </member>
+ <member name="text" type="String" setter="set_text" getter="get_text" brief="">
+ </member>
+ <member name="uppercase" type="bool" setter="set_uppercase" getter="is_uppercase" brief="">
+ </member>
+ <member name="valign" type="int" setter="set_valign" getter="get_valign" brief="">
+ </member>
+ </members>
<constants>
<constant name="ALIGN_LEFT" value="0">
Align rows to the left (default).
@@ -19540,6 +23071,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="_data" type="Array" setter="_set_data" getter="_get_data" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -19551,41 +23086,33 @@
Light is the abstract base class for light nodes, so it shouldn't be used directly (It can't be instanced). Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting.
</description>
<methods>
- <method name="get_bake_mode" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
<method name="get_color" qualifiers="const">
<return type="Color">
</return>
- <argument index="0" name="color" type="int">
- </argument>
<description>
</description>
</method>
- <method name="get_operator" qualifiers="const">
+ <method name="get_cull_mask" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="get_parameter" qualifiers="const">
+ <method name="get_param" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="variable" type="int">
+ <argument index="0" name="param" type="int">
</argument>
<description>
</description>
</method>
- <method name="get_projector" qualifiers="const">
- <return type="Texture">
+ <method name="get_shadow_color" qualifiers="const">
+ <return type="Color">
</return>
<description>
</description>
</method>
- <method name="has_project_shadows" qualifiers="const">
+ <method name="has_shadow" qualifiers="const">
<return type="bool">
</return>
<description>
@@ -19597,22 +23124,20 @@
<description>
</description>
</method>
- <method name="is_enabled" qualifiers="const">
+ <method name="is_negative" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="set_bake_mode">
- <argument index="0" name="bake_mode" type="int">
+ <method name="set_color">
+ <argument index="0" name="color" type="Color">
</argument>
<description>
</description>
</method>
- <method name="set_color">
- <argument index="0" name="color" type="int">
- </argument>
- <argument index="1" name="value" type="Color">
+ <method name="set_cull_mask">
+ <argument index="0" name="cull_mask" type="int">
</argument>
<description>
</description>
@@ -19623,65 +23148,85 @@
<description>
</description>
</method>
- <method name="set_enabled">
+ <method name="set_negative">
<argument index="0" name="enabled" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_operator">
- <argument index="0" name="operator" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_parameter">
- <argument index="0" name="variable" type="int">
+ <method name="set_param">
+ <argument index="0" name="param" type="int">
</argument>
<argument index="1" name="value" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_project_shadows">
- <argument index="0" name="enable" type="bool">
+ <method name="set_shadow">
+ <argument index="0" name="enabled" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_projector">
- <argument index="0" name="projector" type="Texture">
+ <method name="set_shadow_color">
+ <argument index="0" name="shadow_color" type="Color">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="editor_only" type="bool" setter="set_editor_only" getter="is_editor_only" brief="">
+ </member>
+ <member name="light_color" type="Color" setter="set_color" getter="get_color" brief="">
+ </member>
+ <member name="light_cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" brief="">
+ </member>
+ <member name="light_energy" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="light_negative" type="bool" setter="set_negative" getter="is_negative" brief="">
+ </member>
+ <member name="light_specular" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="shadow_bias" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" brief="">
+ </member>
+ <member name="shadow_contact" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="shadow_enabled" type="bool" setter="set_shadow" getter="has_shadow" brief="">
+ </member>
+ <member name="shadow_max_distance" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ </members>
<constants>
- <constant name="PARAM_RADIUS" value="2">
+ <constant name="PARAM_ENERGY" value="0">
+ </constant>
+ <constant name="PARAM_SPECULAR" value="1">
</constant>
- <constant name="PARAM_ENERGY" value="3">
+ <constant name="PARAM_RANGE" value="2">
</constant>
- <constant name="PARAM_ATTENUATION" value="4">
+ <constant name="PARAM_ATTENUATION" value="3">
</constant>
- <constant name="PARAM_SPOT_ANGLE" value="1">
+ <constant name="PARAM_SPOT_ANGLE" value="4">
</constant>
- <constant name="PARAM_SPOT_ATTENUATION" value="0">
+ <constant name="PARAM_SPOT_ATTENUATION" value="5">
</constant>
- <constant name="PARAM_SHADOW_DARKENING" value="5">
+ <constant name="PARAM_CONTACT_SHADOW_SIZE" value="6">
</constant>
- <constant name="PARAM_SHADOW_Z_OFFSET" value="6">
+ <constant name="PARAM_SHADOW_MAX_DISTANCE" value="7">
</constant>
- <constant name="COLOR_DIFFUSE" value="0">
+ <constant name="PARAM_SHADOW_SPLIT_1_OFFSET" value="8">
</constant>
- <constant name="COLOR_SPECULAR" value="1">
+ <constant name="PARAM_SHADOW_SPLIT_2_OFFSET" value="9">
</constant>
- <constant name="BAKE_MODE_DISABLED" value="0">
+ <constant name="PARAM_SHADOW_SPLIT_3_OFFSET" value="10">
</constant>
- <constant name="BAKE_MODE_INDIRECT" value="1">
+ <constant name="PARAM_SHADOW_NORMAL_BIAS" value="11">
</constant>
- <constant name="BAKE_MODE_INDIRECT_AND_SHADOWS" value="2">
+ <constant name="PARAM_SHADOW_BIAS" value="12">
</constant>
- <constant name="BAKE_MODE_FULL" value="3">
+ <constant name="PARAM_MAX" value="13">
</constant>
</constants>
</class>
@@ -19714,18 +23259,16 @@
Return the height of the Light2D. Used with 2D normalmapping.
</description>
</method>
- <method name="get_item_mask" qualifiers="const">
+ <method name="get_item_cull_mask" qualifiers="const">
<return type="int">
</return>
<description>
- Return the item mask of the Light2D.
</description>
</method>
- <method name="get_item_shadow_mask" qualifiers="const">
+ <method name="get_item_shadow_cull_mask" qualifiers="const">
<return type="int">
</return>
<description>
- Return the item shadow mask of the Light2D.
</description>
</method>
<method name="get_layer_range_max" qualifiers="const">
@@ -19763,11 +23306,22 @@
Return the color of casted shadows for this Light2D.
</description>
</method>
- <method name="get_shadow_esm_multiplier" qualifiers="const">
+ <method name="get_shadow_filter" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_shadow_gradient_length" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_shadow_smooth" qualifiers="const">
<return type="float">
</return>
<description>
- Return the Exponential Shadow Multiplier (ESM) value of the Light2D.
</description>
</method>
<method name="get_texture" qualifiers="const">
@@ -19805,6 +23359,12 @@
Get the minimum Z value that objects of the scene have to be in order to be affected by the Light2D.
</description>
</method>
+ <method name="is_editor_only" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_enabled" qualifiers="const">
<return type="bool">
</return>
@@ -19826,6 +23386,12 @@
Set the color of the Light2D.
</description>
</method>
+ <method name="set_editor_only">
+ <argument index="0" name="editor_only" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_enabled">
<argument index="0" name="enabled" type="bool">
</argument>
@@ -19847,15 +23413,15 @@
Set the height of the Light2D. Used with 2D normalmapping.
</description>
</method>
- <method name="set_item_mask">
- <argument index="0" name="item_mask" type="int">
+ <method name="set_item_cull_mask">
+ <argument index="0" name="item_cull_mask" type="int">
</argument>
<description>
Set the item mask of the Light2D to 'item_mask' value.
</description>
</method>
- <method name="set_item_shadow_mask">
- <argument index="0" name="item_shadow_mask" type="int">
+ <method name="set_item_shadow_cull_mask">
+ <argument index="0" name="item_shadow_cull_mask" type="int">
</argument>
<description>
Set the item shadow mask to 'item_shadow_mask' value.
@@ -19903,11 +23469,22 @@
Enable or disable shadows casting from this Light2D according to the 'enabled' parameter.
</description>
</method>
- <method name="set_shadow_esm_multiplier">
+ <method name="set_shadow_filter">
+ <argument index="0" name="filter" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_shadow_gradient_length">
<argument index="0" name="multiplier" type="float">
</argument>
<description>
- Set the Exponential Shadow Multiplier (ESM) value of the Light2D.
+ </description>
+ </method>
+ <method name="set_shadow_smooth">
+ <argument index="0" name="smooth" type="float">
+ </argument>
+ <description>
</description>
</method>
<method name="set_texture">
@@ -19946,6 +23523,50 @@
</description>
</method>
</methods>
+ <members>
+ <member name="color" type="Color" setter="set_color" getter="get_color" brief="">
+ </member>
+ <member name="editor_only" type="bool" setter="set_editor_only" getter="is_editor_only" brief="">
+ </member>
+ <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" brief="">
+ </member>
+ <member name="energy" type="float" setter="set_energy" getter="get_energy" brief="">
+ </member>
+ <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="">
+ </member>
+ <member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" brief="">
+ </member>
+ <member name="range_height" type="float" setter="set_height" getter="get_height" brief="">
+ </member>
+ <member name="range_item_cull_mask" type="int" setter="set_item_cull_mask" getter="get_item_cull_mask" brief="">
+ </member>
+ <member name="range_layer_max" type="int" setter="set_layer_range_max" getter="get_layer_range_max" brief="">
+ </member>
+ <member name="range_layer_min" type="int" setter="set_layer_range_min" getter="get_layer_range_min" brief="">
+ </member>
+ <member name="range_z_max" type="int" setter="set_z_range_max" getter="get_z_range_max" brief="">
+ </member>
+ <member name="range_z_min" type="int" setter="set_z_range_min" getter="get_z_range_min" brief="">
+ </member>
+ <member name="scale" type="float" setter="set_texture_scale" getter="get_texture_scale" brief="">
+ </member>
+ <member name="shadow_buffer_size" type="int" setter="set_shadow_buffer_size" getter="get_shadow_buffer_size" brief="">
+ </member>
+ <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" brief="">
+ </member>
+ <member name="shadow_enabled" type="bool" setter="set_shadow_enabled" getter="is_shadow_enabled" brief="">
+ </member>
+ <member name="shadow_filter" type="float" setter="set_shadow_filter" getter="get_shadow_filter" brief="">
+ </member>
+ <member name="shadow_filter_smooth" type="float" setter="set_shadow_smooth" getter="get_shadow_smooth" brief="">
+ </member>
+ <member name="shadow_gradient_length" type="float" setter="set_shadow_gradient_length" getter="get_shadow_gradient_length" brief="">
+ </member>
+ <member name="shadow_item_cull_mask" type="int" setter="set_item_shadow_cull_mask" getter="get_item_shadow_cull_mask" brief="">
+ </member>
+ <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ </members>
<constants>
<constant name="MODE_ADD" value="0">
Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behaviour of a light.
@@ -19998,7 +23619,229 @@
</description>
</method>
</methods>
+ <members>
+ <member name="light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" brief="">
+ </member>
+ <member name="occluder" type="OccluderPolygon2D" setter="set_occluder_polygon" getter="get_occluder_polygon" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="Line2D" inherits="Node2D" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="add_point">
+ <argument index="0" name="pos" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_begin_cap_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_default_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_end_cap_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_gradient" qualifiers="const">
+ <return type="Object">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_joint_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_point_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_point_pos" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="i" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_points" qualifiers="const">
+ <return type="PoolVector2Array">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_round_precision" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sharp_limit" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_texture" qualifiers="const">
+ <return type="Object">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_texture_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_width" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="remove_point">
+ <argument index="0" name="i" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_begin_cap_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_default_color">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_end_cap_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_gradient">
+ <argument index="0" name="color" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_joint_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_point_pos">
+ <argument index="0" name="i" type="int">
+ </argument>
+ <argument index="1" name="pos" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_points">
+ <argument index="0" name="points" type="PoolVector2Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_round_precision">
+ <argument index="0" name="precision" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sharp_limit">
+ <argument index="0" name="limit" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_texture">
+ <argument index="0" name="texture" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_texture_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_width">
+ <argument index="0" name="width" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" brief="">
+ </member>
+ <member name="default_color" type="Color" setter="set_default_color" getter="get_default_color" brief="">
+ </member>
+ <member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" brief="">
+ </member>
+ <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient" brief="">
+ </member>
+ <member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" brief="">
+ </member>
+ <member name="points" type="PoolVector2Array" setter="set_points" getter="get_points" brief="">
+ </member>
+ <member name="round_precision" type="int" setter="set_round_precision" getter="get_round_precision" brief="">
+ </member>
+ <member name="sharp_limit" type="float" setter="set_sharp_limit" getter="get_sharp_limit" brief="">
+ </member>
+ <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" brief="">
+ </member>
+ <member name="width" type="float" setter="set_width" getter="get_width" brief="">
+ </member>
+ </members>
<constants>
+ <constant name="LINE_JOINT_SHARP" value="0">
+ </constant>
+ <constant name="LINE_JOINT_BEVEL" value="1">
+ </constant>
+ <constant name="LINE_JOINT_ROUND" value="2">
+ </constant>
+ <constant name="LINE_CAP_NONE" value="0">
+ </constant>
+ <constant name="LINE_CAP_BOX" value="1">
+ </constant>
+ <constant name="LINE_CAP_ROUND" value="2">
+ </constant>
+ <constant name="LINE_TEXTURE_NONE" value="0">
+ </constant>
+ <constant name="LINE_TEXTURE_TILE" value="1">
+ </constant>
</constants>
</class>
<class name="LineEdit" inherits="Control" category="Core">
@@ -20193,6 +24036,30 @@
</description>
</method>
</methods>
+ <members>
+ <member name="align" type="int" setter="set_align" getter="get_align" brief="">
+ </member>
+ <member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled" brief="">
+ </member>
+ <member name="caret_blink_speed" type="float" setter="cursor_set_blink_speed" getter="cursor_get_blink_speed" brief="">
+ </member>
+ <member name="editable" type="bool" setter="set_editable" getter="is_editable" brief="">
+ </member>
+ <member name="expand_to_len" type="bool" setter="set_expand_to_text_length" getter="get_expand_to_text_length" brief="">
+ </member>
+ <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" brief="">
+ </member>
+ <member name="max_length" type="int" setter="set_max_length" getter="get_max_length" brief="">
+ </member>
+ <member name="placeholder_alpha" type="float" setter="set_placeholder_alpha" getter="get_placeholder_alpha" brief="">
+ </member>
+ <member name="placeholder_text" type="String" setter="set_placeholder" getter="get_placeholder" brief="">
+ </member>
+ <member name="secret" type="bool" setter="set_secret" getter="is_secret" brief="">
+ </member>
+ <member name="text" type="String" setter="set_text" getter="get_text" brief="">
+ </member>
+ </members>
<signals>
<signal name="text_changed">
<argument index="0" name="text" type="String">
@@ -20291,6 +24158,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="d" type="float" setter="set_d" getter="get_d" brief="">
+ </member>
+ <member name="normal" type="Vector2" setter="set_normal" getter="get_normal" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -20331,6 +24204,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="text" type="String" setter="set_text" getter="get_text" brief="">
+ </member>
+ <member name="underline" type="int" setter="set_underline_mode" getter="get_underline_mode" brief="">
+ </member>
+ </members>
<constants>
<constant name="UNDERLINE_MODE_ALWAYS" value="0">
The LinkButton will always show an underline at the bottom of its text
@@ -20394,7 +24273,7 @@
</description>
<methods>
<method name="_drop_files" qualifiers="virtual">
- <argument index="0" name="files" type="StringArray">
+ <argument index="0" name="files" type="PoolStringArray">
</argument>
<argument index="1" name="screen" type="int">
</argument>
@@ -20450,7 +24329,7 @@
</description>
</method>
<method name="input_event">
- <argument index="0" name="ev" type="InputEvent">
+ <argument index="0" name="ev" type="Object">
</argument>
<description>
</description>
@@ -20471,15 +24350,15 @@
</method>
</methods>
<constants>
- <constant name="NOTIFICATION_WM_MOUSE_ENTER" value="3">
+ <constant name="NOTIFICATION_WM_MOUSE_ENTER" value="2">
</constant>
- <constant name="NOTIFICATION_WM_MOUSE_EXIT" value="4">
+ <constant name="NOTIFICATION_WM_MOUSE_EXIT" value="3">
</constant>
- <constant name="NOTIFICATION_WM_FOCUS_IN" value="5">
+ <constant name="NOTIFICATION_WM_FOCUS_IN" value="4">
</constant>
- <constant name="NOTIFICATION_WM_FOCUS_OUT" value="6">
+ <constant name="NOTIFICATION_WM_FOCUS_OUT" value="5">
</constant>
- <constant name="NOTIFICATION_WM_QUIT_REQUEST" value="7">
+ <constant name="NOTIFICATION_WM_QUIT_REQUEST" value="6">
</constant>
<constant name="NOTIFICATION_WM_UNFOCUS_REQUEST" value="8">
</constant>
@@ -20516,7 +24395,7 @@
</description>
<methods>
<method name="base64_to_raw">
- <return type="RawArray">
+ <return type="PoolByteArray">
</return>
<argument index="0" name="base64_str" type="String">
</argument>
@@ -20542,7 +24421,7 @@
<method name="raw_to_base64">
<return type="String">
</return>
- <argument index="0" name="array" type="RawArray">
+ <argument index="0" name="array" type="PoolByteArray">
</argument>
<description>
</description>
@@ -20575,447 +24454,21 @@
Material is a base [Resource] used for coloring and shading geometry. All materials inherit from it and almost all [VisualInstance] derived nodes carry a Material. A few flags and parameters are shared between all material types and are configured here.
</description>
<methods>
- <method name="get_blend_mode" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return blend mode for the material, which can be one of BLEND_MODE_MIX (default), BLEND_MODE_ADD, BLEND_MODE_SUB. Keep in mind that only BLEND_MODE_MIX ensures that the material [i]may[/i] be opaque, any other blend mode will render with alpha blending enabled in raster-based [VisualServer] implementations.
- </description>
- </method>
- <method name="get_depth_draw_mode" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="get_flag" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="flag" type="int">
- </argument>
- <description>
- Return a [Material] flag, which toggles on or off a behavior when rendering. See enumeration FLAG_* for a list.
- </description>
- </method>
- <method name="get_line_width" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the line width for geometry drawn with FLAG_WIREFRAME enabled, or LINE primitives. Note that not all hardware or VisualServer backends support this (like DirectX).
- </description>
- </method>
- <method name="set_blend_mode">
- <argument index="0" name="mode" type="int">
- </argument>
- <description>
- Set blend mode for the material, which can be one of BLEND_MODE_MIX (default), BLEND_MODE_ADD, BLEND_MODE_SUB. Keep in mind that only BLEND_MODE_MIX ensures that the material [i]may[/i] be opaque, any other blend mode will render with alpha blending enabled in raster-based [VisualServer] implementations.
- </description>
- </method>
- <method name="set_depth_draw_mode">
- <argument index="0" name="mode" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_flag">
- <argument index="0" name="flag" type="int">
- </argument>
- <argument index="1" name="enable" type="bool">
- </argument>
- <description>
- Set a [Material] flag, which toggles on or off a behavior when rendering. See enumeration FLAG_* for a list.
- </description>
- </method>
- <method name="set_line_width">
- <argument index="0" name="width" type="float">
- </argument>
- <description>
- Set the line width for geometry drawn with FLAG_WIREFRAME enabled, or LINE primitives. Note that not all hardware or VisualServer backends support this (like DirectX).
- </description>
- </method>
- </methods>
- <constants>
- <constant name="FLAG_VISIBLE" value="0">
- Geometry is visible when this flag is enabled (default).
- </constant>
- <constant name="FLAG_DOUBLE_SIDED" value="1">
- Both front facing and back facing triangles are rendered when this flag is enabled.
- </constant>
- <constant name="FLAG_INVERT_FACES" value="2">
- Front facing and back facing order is swapped when this flag is enabled.
- </constant>
- <constant name="FLAG_UNSHADED" value="3">
- Shading (lighting) is disabled when this flag is enabled.
- </constant>
- <constant name="FLAG_ONTOP" value="4">
- </constant>
- <constant name="FLAG_LIGHTMAP_ON_UV2" value="5">
- </constant>
- <constant name="FLAG_COLOR_ARRAY_SRGB" value="6">
- </constant>
- <constant name="FLAG_MAX" value="7">
- Maximum amount of flags.
- </constant>
- <constant name="DEPTH_DRAW_ALWAYS" value="0">
- </constant>
- <constant name="DEPTH_DRAW_OPAQUE_ONLY" value="1">
- </constant>
- <constant name="DEPTH_DRAW_OPAQUE_PRE_PASS_ALPHA" value="2">
- </constant>
- <constant name="DEPTH_DRAW_NEVER" value="3">
- </constant>
- <constant name="BLEND_MODE_MIX" value="0">
- Use the regular alpha blending equation (source and dest colors are faded) (default).
- </constant>
- <constant name="BLEND_MODE_ADD" value="1">
- Use additive blending equation, often used for particle effects such as fire or light decals.
- </constant>
- <constant name="BLEND_MODE_SUB" value="2">
- Use subtractive blending equation, often used for some smoke effects or types of glass.
- </constant>
- <constant name="BLEND_MODE_MUL" value="3">
- </constant>
- <constant name="BLEND_MODE_PREMULT_ALPHA" value="4">
- </constant>
- </constants>
-</class>
-<class name="MaterialShader" inherits="Shader" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="MaterialShaderGraph" inherits="ShaderGraph" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="Matrix3" category="Built-In Types">
- <brief_description>
- 3x3 matrix datatype.
- </brief_description>
- <description>
- 3x3 matrix used for 3D rotation and scale. Contains 3 vector fields x,y and z as its columns, which can be interpreted as the local basis vectors of a transformation. Can also be accessed as array of 3D vectors. These vectors are orthogonal to each other, but are not necessarily normalized. Almost always used as orthogonal basis for a [Transform].
- For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S).
- </description>
- <methods>
- <method name="Matrix3">
- <return type="Matrix3">
- </return>
- <argument index="0" name="from" type="Quat">
- </argument>
- <description>
- Create a rotation matrix from the given quaternion.
- </description>
- </method>
- <method name="Matrix3">
- <return type="Matrix3">
- </return>
- <argument index="0" name="axis" type="Vector3">
- </argument>
- <argument index="1" name="phi" type="float">
- </argument>
- <description>
- Create a rotation matrix which rotates around the given axis by the specified angle. The axis must be a normalized vector.
- </description>
- </method>
- <method name="Matrix3">
- <return type="Matrix3">
- </return>
- <argument index="0" name="x_axis" type="Vector3">
- </argument>
- <argument index="1" name="y_axis" type="Vector3">
- </argument>
- <argument index="2" name="z_axis" type="Vector3">
- </argument>
- <description>
- Create a matrix from 3 axis vectors.
- </description>
- </method>
- <method name="determinant">
- <return type="float">
- </return>
- <description>
- Return the determinant of the matrix.
- </description>
- </method>
- <method name="get_euler">
- <return type="Vector3">
- </return>
- <description>
- Return Euler angles (in the XYZ convention: first Z, then Y, and X last) from the matrix. Returned vector contains the rotation angles in the format (third,second,first).
- This function only works if the matrix represents a proper rotation.
- </description>
- </method>
- <method name="get_orthogonal_index">
- <return type="int">
- </return>
- <description>
- This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x,y,z) with each component being either -1,0 or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the grid map editor. For further details, refer to Godot source code.
- </description>
- </method>
- <method name="get_scale">
- <return type="Vector3">
- </return>
- <description>
- Assuming that the matrix is the combination of a rotation and scaling, return the absolute value of scaling factors along each axis.
- </description>
- </method>
- <method name="inverse">
- <return type="Matrix3">
- </return>
- <description>
- Return the inverse of the matrix.
- </description>
- </method>
- <method name="orthonormalized">
- <return type="Matrix3">
- </return>
- <description>
- Return the orthonormalized version of the matrix (useful to call from time to time to avoid rounding error for orthogonal matrices). This performs a Gram-Schmidt orthonormalization on the basis of the matrix.
- </description>
- </method>
- <method name="rotated">
- <return type="Matrix3">
- </return>
- <argument index="0" name="axis" type="Vector3">
- </argument>
- <argument index="1" name="phi" type="float">
- </argument>
- <description>
- Introduce an additional rotation around the given axis by phi. Only relevant when the matrix is being used as a part of [Transform]. The axis must be a normalized vector.
- </description>
- </method>
- <method name="scaled">
- <return type="Matrix3">
- </return>
- <argument index="0" name="scale" type="Vector3">
- </argument>
- <description>
- Introduce an additional scaling specified by the given 3D scaling factor. Only relevant when the matrix is being used as a part of [Transform].
- </description>
- </method>
- <method name="tdotx">
- <return type="float">
- </return>
- <argument index="0" name="with" type="Vector3">
- </argument>
- <description>
- Transposed dot product with the x axis of the matrix.
- </description>
- </method>
- <method name="tdoty">
- <return type="float">
- </return>
- <argument index="0" name="with" type="Vector3">
- </argument>
- <description>
- Transposed dot product with the y axis of the matrix.
- </description>
- </method>
- <method name="tdotz">
- <return type="float">
- </return>
- <argument index="0" name="with" type="Vector3">
- </argument>
- <description>
- Transposed dot product with the z axis of the matrix.
- </description>
- </method>
- <method name="transposed">
- <return type="Matrix3">
- </return>
- <description>
- Return the transposed version of the matrix.
- </description>
- </method>
- <method name="xform">
- <return type="Vector3">
- </return>
- <argument index="0" name="v" type="Vector3">
- </argument>
- <description>
- Return a vector transformed (multiplied) by the matrix and return it.
- </description>
- </method>
- <method name="xform_inv">
- <return type="Vector3">
- </return>
- <argument index="0" name="v" type="Vector3">
- </argument>
- <description>
- Return a vector transformed (multiplied) by the transposed matrix and return it. Note that this is a multiplication by inverse only when the matrix represents a rotation-reflection.
- </description>
- </method>
- </methods>
- <members>
- <member name="x" type="Vector3">
- </member>
- <member name="y" type="Vector3">
- </member>
- <member name="z" type="Vector3">
- </member>
- </members>
- <constants>
- </constants>
-</class>
-<class name="Matrix32" category="Built-In Types">
- <brief_description>
- 3x2 Matrix for 2D transforms.
- </brief_description>
- <description>
- 3x2 Matrix for 2D transforms.
- </description>
- <methods>
- <method name="Matrix32">
- <return type="Matrix32">
- </return>
- <argument index="0" name="from" type="Transform">
- </argument>
- <description>
- </description>
- </method>
- <method name="Matrix32">
- <return type="Matrix32">
- </return>
- <argument index="0" name="x_axis" type="Vector2">
- </argument>
- <argument index="1" name="y_axis" type="Vector2">
- </argument>
- <argument index="2" name="origin" type="Vector2">
- </argument>
- <description>
- </description>
- </method>
- <method name="Matrix32">
- <return type="Matrix32">
- </return>
- <argument index="0" name="rot" type="float">
- </argument>
- <argument index="1" name="pos" type="Vector2">
- </argument>
- <description>
- </description>
- </method>
- <method name="affine_inverse">
- <return type="Matrix32">
- </return>
- <description>
- Return the inverse of the matrix.
- </description>
- </method>
- <method name="basis_xform">
- <return type="Matrix32">
- </return>
- <argument index="0" name="v" type="var">
- </argument>
- <description>
- </description>
- </method>
- <method name="basis_xform_inv">
- <return type="Matrix32">
- </return>
- <argument index="0" name="v" type="var">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_origin">
- <return type="Vector2">
- </return>
- <description>
- </description>
- </method>
- <method name="get_rotation">
- <return type="float">
- </return>
- <description>
- </description>
- </method>
- <method name="get_scale">
- <return type="Vector2">
- </return>
- <description>
- </description>
- </method>
- <method name="interpolate_with">
- <return type="Matrix32">
- </return>
- <argument index="0" name="m" type="Matrix32">
- </argument>
- <argument index="1" name="c" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="inverse">
- <return type="Matrix32">
- </return>
- <description>
- </description>
- </method>
- <method name="orthonormalized">
- <return type="Matrix32">
- </return>
- <description>
- </description>
- </method>
- <method name="rotated">
- <return type="Matrix32">
- </return>
- <argument index="0" name="phi" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="scaled">
- <return type="Matrix32">
- </return>
- <argument index="0" name="scale" type="Vector2">
- </argument>
- <description>
- </description>
- </method>
- <method name="translated">
- <return type="Matrix32">
- </return>
- <argument index="0" name="offset" type="Vector2">
- </argument>
- <description>
- </description>
- </method>
- <method name="xform">
- <return type="Matrix32">
+ <method name="get_next_pass" qualifiers="const">
+ <return type="Material">
</return>
- <argument index="0" name="v" type="var">
- </argument>
<description>
</description>
</method>
- <method name="xform_inv">
- <return type="Matrix32">
- </return>
- <argument index="0" name="v" type="var">
+ <method name="set_next_pass">
+ <argument index="0" name="next_pass" type="Material">
</argument>
<description>
</description>
</method>
</methods>
<members>
- <member name="o" type="Vector2">
- </member>
- <member name="x" type="Vector2">
- </member>
- <member name="y" type="Vector2">
+ <member name="next_pass" type="Material" setter="set_next_pass" getter="get_next_pass" brief="">
</member>
</members>
<constants>
@@ -21037,6 +24490,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="items" type="Array" setter="_set_items" getter="_get_items" brief="">
+ </member>
+ </members>
<signals>
<signal name="about_to_show">
<description>
@@ -21078,223 +24535,40 @@
Mesh is a type of [Resource] that contains vertex-array based geometry, divided in [i]surfaces[/i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.
</description>
<methods>
- <method name="add_morph_target">
- <argument index="0" name="name" type="String">
- </argument>
- <description>
- </description>
- </method>
- <method name="add_surface">
- <argument index="0" name="primitive" type="int">
- </argument>
- <argument index="1" name="arrays" type="Array">
- </argument>
- <argument index="2" name="morph_arrays" type="Array" default="Array()">
- </argument>
- <argument index="3" name="alphasort" type="bool" default="false">
- </argument>
- <description>
- Create a new surface ([method get_surface_count] that will become surf_idx for this.
- Surfaces are created to be rendered using a "primitive", which may be PRIMITIVE_POINTS, PRIMITIVE_LINES, PRIMITIVE_LINE_STRIP, PRIMITIVE_LINE_LOOP, PRIMITIVE_TRIANGLES, PRIMITIVE_TRIANGLE_STRIP, PRIMITIVE_TRIANGLE_FAN. (As a note, when using indices, it is recommended to only use just points, lines or triangles).
- The format of a surface determines which arrays it will allocate and hold, so "format" is a combination of ARRAY_FORMAT_* mask constants ORed together. ARRAY_FORMAT_VERTEX must be always present. "array_len" determines the amount of vertices in the array (not primitives!). if ARRAY_FORMAT_INDEX is in the format mask, then it means that an index array will be allocated and "index_array_len" must be passed.
- </description>
- </method>
- <method name="center_geometry">
- <description>
- </description>
- </method>
- <method name="clear_morph_targets">
- <description>
- </description>
- </method>
- <method name="get_custom_aabb" qualifiers="const">
- <return type="AABB">
- </return>
- <description>
- </description>
- </method>
- <method name="get_morph_target_count" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="get_morph_target_mode" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="get_morph_target_name" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="index" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_surface_count" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the amount of surfaces that the [Mesh] holds.
- </description>
- </method>
- <method name="regen_normalmaps">
- <description>
- </description>
- </method>
- <method name="set_custom_aabb">
- <argument index="0" name="aabb" type="AABB">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_morph_target_mode">
- <argument index="0" name="mode" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="surface_get_array_index_len" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="surf_idx" type="int">
- </argument>
- <description>
- Return the length in indices of the index array in the requested surface (see [method add_surface]).
- </description>
- </method>
- <method name="surface_get_array_len" qualifiers="const">
- <return type="int">
+ <method name="create_convex_shape" qualifiers="const">
+ <return type="Shape">
</return>
- <argument index="0" name="surf_idx" type="int">
- </argument>
<description>
- Return the length in vertices of the vertex array in the requested surface (see [method add_surface]).
</description>
</method>
- <method name="surface_get_format" qualifiers="const">
- <return type="int">
+ <method name="create_outline" qualifiers="const">
+ <return type="ArrayMesh">
</return>
- <argument index="0" name="surf_idx" type="int">
+ <argument index="0" name="margin" type="float">
</argument>
<description>
- Return the format mask of the requested surface (see [method add_surface]).
</description>
</method>
- <method name="surface_get_material" qualifiers="const">
- <return type="Material">
+ <method name="create_trimesh_shape" qualifiers="const">
+ <return type="Shape">
</return>
- <argument index="0" name="surf_idx" type="int">
- </argument>
<description>
- Return a [Material] in a given surface. Surface is rendered using this material.
</description>
</method>
- <method name="surface_get_name" qualifiers="const">
- <return type="String">
+ <method name="generate_triangle_mesh" qualifiers="const">
+ <return type="TriangleMesh">
</return>
- <argument index="0" name="surf_idx" type="int">
- </argument>
<description>
</description>
</method>
- <method name="surface_get_primitive_type" qualifiers="const">
- <return type="int">
+ <method name="get_faces" qualifiers="const">
+ <return type="PoolVector3Array">
</return>
- <argument index="0" name="surf_idx" type="int">
- </argument>
- <description>
- Return the primitive type of the requested surface (see [method add_surface]).
- </description>
- </method>
- <method name="surface_remove">
- <argument index="0" name="surf_idx" type="int">
- </argument>
- <description>
- Remove a surface at position surf_idx, shifting greater surfaces one surf_idx slot down.
- </description>
- </method>
- <method name="surface_set_material">
- <argument index="0" name="surf_idx" type="int">
- </argument>
- <argument index="1" name="material" type="Material">
- </argument>
- <description>
- Set a [Material] for a given surface. Surface will be rendered using this material.
- </description>
- </method>
- <method name="surface_set_name">
- <argument index="0" name="surf_idx" type="int">
- </argument>
- <argument index="1" name="name" type="String">
- </argument>
<description>
</description>
</method>
</methods>
<constants>
- <constant name="NO_INDEX_ARRAY" value="-1">
- Default value used for index_array_len when no indices are present.
- </constant>
- <constant name="ARRAY_WEIGHTS_SIZE" value="4">
- Amount of weights/bone indices per vertex (always 4).
- </constant>
- <constant name="ARRAY_VERTEX" value="0">
- Vertex array (array of [Vector3] vertices).
- </constant>
- <constant name="ARRAY_NORMAL" value="1">
- Normal array (array of [Vector3] normals).
- </constant>
- <constant name="ARRAY_TANGENT" value="2">
- Tangent array, array of groups of 4 floats. first 3 floats determine the tangent, and the last the binormal direction as -1 or 1.
- </constant>
- <constant name="ARRAY_COLOR" value="3">
- Vertex array (array of [Color] colors).
- </constant>
- <constant name="ARRAY_TEX_UV" value="4">
- UV array (array of [Vector3] UVs or float array of groups of 2 floats (u,v)).
- </constant>
- <constant name="ARRAY_TEX_UV2" value="5">
- Second UV array (array of [Vector3] UVs or float array of groups of 2 floats (u,v)).
- </constant>
- <constant name="ARRAY_BONES" value="6">
- Array of bone indices, as a float array. Each element in groups of 4 floats.
- </constant>
- <constant name="ARRAY_WEIGHTS" value="7">
- Array of bone weights, as a float array. Each element in groups of 4 floats.
- </constant>
- <constant name="ARRAY_INDEX" value="8">
- Array of integers, used as indices referencing vertices. No index can be beyond the vertex array size.
- </constant>
- <constant name="ARRAY_FORMAT_VERTEX" value="1">
- Array format will include vertices (mandatory).
- </constant>
- <constant name="ARRAY_FORMAT_NORMAL" value="2">
- Array format will include normals
- </constant>
- <constant name="ARRAY_FORMAT_TANGENT" value="4">
- Array format will include tangents
- </constant>
- <constant name="ARRAY_FORMAT_COLOR" value="8">
- Array format will include a color array.
- </constant>
- <constant name="ARRAY_FORMAT_TEX_UV" value="16">
- Array format will include UVs.
- </constant>
- <constant name="ARRAY_FORMAT_TEX_UV2" value="32">
- Array format will include another set of UVs.
- </constant>
- <constant name="ARRAY_FORMAT_BONES" value="64">
- Array format will include bone indices.
- </constant>
- <constant name="ARRAY_FORMAT_WEIGHTS" value="128">
- Array format will include bone weights.
- </constant>
- <constant name="ARRAY_FORMAT_INDEX" value="256">
- Index array will be used.
- </constant>
<constant name="PRIMITIVE_POINTS" value="0">
Render array as points (one vertex equals one point).
</constant>
@@ -21353,7 +24627,7 @@
</description>
</method>
<method name="get_edge_faces" qualifiers="const">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<argument index="0" name="idx" type="int">
</argument>
@@ -21361,6 +24635,8 @@
</description>
</method>
<method name="get_edge_meta" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="idx" type="int">
</argument>
<description>
@@ -21393,6 +24669,8 @@
</description>
</method>
<method name="get_face_meta" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="idx" type="int">
</argument>
<description>
@@ -21437,7 +24715,7 @@
</description>
</method>
<method name="get_vertex_bones" qualifiers="const">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<argument index="0" name="idx" type="int">
</argument>
@@ -21459,7 +24737,7 @@
</description>
</method>
<method name="get_vertex_edges" qualifiers="const">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<argument index="0" name="idx" type="int">
</argument>
@@ -21467,7 +24745,7 @@
</description>
</method>
<method name="get_vertex_faces" qualifiers="const">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<argument index="0" name="idx" type="int">
</argument>
@@ -21475,6 +24753,8 @@
</description>
</method>
<method name="get_vertex_meta" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="idx" type="int">
</argument>
<description>
@@ -21513,7 +24793,7 @@
</description>
</method>
<method name="get_vertex_weights" qualifiers="const">
- <return type="RealArray">
+ <return type="PoolRealArray">
</return>
<argument index="0" name="idx" type="int">
</argument>
@@ -21553,7 +24833,7 @@
<method name="set_vertex_bones">
<argument index="0" name="idx" type="int">
</argument>
- <argument index="1" name="bones" type="IntArray">
+ <argument index="1" name="bones" type="PoolIntArray">
</argument>
<description>
</description>
@@ -21609,7 +24889,7 @@
<method name="set_vertex_weights">
<argument index="0" name="idx" type="int">
</argument>
- <argument index="1" name="weights" type="RealArray">
+ <argument index="1" name="weights" type="PoolRealArray">
</argument>
<description>
</description>
@@ -21630,16 +24910,13 @@
<description>
</description>
</method>
- <method name="create_trimesh_collision">
+ <method name="create_debug_tangents">
<description>
- This helper creates a [StaticBody] child [Node] using the mesh geometry as collision. It's mainly used for testing.
</description>
</method>
- <method name="get_aabb" qualifiers="const">
- <return type="AABB">
- </return>
+ <method name="create_trimesh_collision">
<description>
- Return the AABB of the mesh, in local coordinates.
+ This helper creates a [StaticBody] child [Node] using the mesh geometry as collision. It's mainly used for testing.
</description>
</method>
<method name="get_mesh" qualifiers="const">
@@ -21655,6 +24932,14 @@
<description>
</description>
</method>
+ <method name="get_surface_material" qualifiers="const">
+ <return type="Material">
+ </return>
+ <argument index="0" name="surface" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_mesh">
<argument index="0" name="mesh" type="Mesh">
</argument>
@@ -21668,7 +24953,21 @@
<description>
</description>
</method>
+ <method name="set_surface_material">
+ <argument index="0" name="surface" type="int">
+ </argument>
+ <argument index="1" name="material" type="Material">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" brief="">
+ </member>
+ <member name="skeleton" type="NodePath" setter="set_skeleton_path" getter="get_skeleton_path" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -21693,7 +24992,7 @@
</description>
</method>
<method name="get_item_list" qualifiers="const">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<description>
Return the list of items.
@@ -21793,19 +25092,20 @@
MultiMesh provides low level mesh instancing. If the amount of [Mesh] instances needed goes from hundreds to thousands (and most need to be visible at close proximity) creating such a large amount of [MeshInstance] nodes may affect performance by using too much CPU or video memory.
For this case a MultiMesh becomes very useful, as it can draw thousands of instances with little API overhead.
As a drawback, if the instances are too far away of each other, performance may be reduced as every single instance will always rendered (they are spatially indexed as one, for the whole object).
- Since instances may have any behavior, the AABB used for visibility must be provided by the user, or generated with [method generate_aabb].
+ Since instances may have any behavior, the Rect3 used for visibility must be provided by the user.
</description>
<methods>
- <method name="generate_aabb">
+ <method name="get_aabb" qualifiers="const">
+ <return type="Rect3">
+ </return>
<description>
- Generate a new visibility AABB, using mesh AABB and instance transforms. Since instance information is stored in the [VisualServer], this function is VERY SLOW and must NOT be used often.
+ Return the visibility Rect3.
</description>
</method>
- <method name="get_aabb" qualifiers="const">
- <return type="AABB">
+ <method name="get_color_format" qualifiers="const">
+ <return type="int">
</return>
<description>
- Return the visibility AABB.
</description>
</method>
<method name="get_instance_color" qualifiers="const">
@@ -21840,11 +25140,16 @@
Return the [Mesh] resource drawn as multiple instances.
</description>
</method>
- <method name="set_aabb">
- <argument index="0" name="visibility_aabb" type="AABB">
+ <method name="get_transform_format" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_color_format">
+ <argument index="0" name="format" type="int">
</argument>
<description>
- Set the visibility AABB. If not provided, MultiMesh will not be visible.
</description>
</method>
<method name="set_instance_color">
@@ -21879,8 +25184,38 @@
Set the [Mesh] resource to be drawn in multiple instances.
</description>
</method>
+ <method name="set_transform_format">
+ <argument index="0" name="format" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="color_array" type="PoolColorArray" setter="_set_color_array" getter="_get_color_array" brief="">
+ </member>
+ <member name="color_format" type="int" setter="set_color_format" getter="get_color_format" brief="">
+ </member>
+ <member name="instance_count" type="int" setter="set_instance_count" getter="get_instance_count" brief="">
+ </member>
+ <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" brief="">
+ </member>
+ <member name="transform_array" type="PoolVector3Array" setter="_set_transform_array" getter="_get_transform_array" brief="">
+ </member>
+ <member name="transform_format" type="int" setter="set_transform_format" getter="get_transform_format" brief="">
+ </member>
+ </members>
<constants>
+ <constant name="TRANSFORM_2D" value="0">
+ </constant>
+ <constant name="TRANSFORM_3D" value="1">
+ </constant>
+ <constant name="COLOR_NONE" value="0">
+ </constant>
+ <constant name="COLOR_8BIT" value="1">
+ </constant>
+ <constant name="COLOR_FLOAT" value="2">
+ </constant>
</constants>
</class>
<class name="MultiMeshInstance" inherits="GeometryInstance" category="Core">
@@ -21906,6 +25241,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="multimesh" type="MultiMesh" setter="set_multimesh" getter="get_multimesh" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -21981,7 +25320,7 @@
</description>
</method>
<method name="get_simple_path">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<argument index="0" name="start" type="Vector3">
</argument>
@@ -22031,6 +25370,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="up_vector" type="Vector3" setter="set_up_vector" getter="get_up_vector" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -22057,7 +25400,7 @@
</description>
</method>
<method name="get_simple_path">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<argument index="0" name="start" type="Vector2">
</argument>
@@ -22073,7 +25416,7 @@
</return>
<argument index="0" name="mesh" type="NavigationPolygon">
</argument>
- <argument index="1" name="xform" type="Matrix32">
+ <argument index="1" name="xform" type="Transform2D">
</argument>
<argument index="2" name="owner" type="Object" default="NULL">
</argument>
@@ -22089,7 +25432,7 @@
<method name="navpoly_set_transform">
<argument index="0" name="id" type="int">
</argument>
- <argument index="1" name="xform" type="Matrix32">
+ <argument index="1" name="xform" type="Transform2D">
</argument>
<description>
</description>
@@ -22105,7 +25448,7 @@
</description>
<methods>
<method name="add_polygon">
- <argument index="0" name="polygon" type="IntArray">
+ <argument index="0" name="polygon" type="PoolIntArray">
</argument>
<description>
</description>
@@ -22115,7 +25458,7 @@
</description>
</method>
<method name="get_polygon">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<argument index="0" name="idx" type="int">
</argument>
@@ -22129,18 +25472,24 @@
</description>
</method>
<method name="get_vertices" qualifiers="const">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<description>
</description>
</method>
<method name="set_vertices">
- <argument index="0" name="vertices" type="Vector3Array">
+ <argument index="0" name="vertices" type="PoolVector3Array">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="polygons" type="Array" setter="_set_polygons" getter="_get_polygons" brief="">
+ </member>
+ <member name="vertices" type="PoolVector3Array" setter="set_vertices" getter="get_vertices" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -22175,6 +25524,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" brief="">
+ </member>
+ <member name="navmesh" type="NavigationMesh" setter="set_navigation_mesh" getter="get_navigation_mesh" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -22185,13 +25540,13 @@
</description>
<methods>
<method name="add_outline">
- <argument index="0" name="outline" type="Vector2Array">
+ <argument index="0" name="outline" type="PoolVector2Array">
</argument>
<description>
</description>
</method>
<method name="add_outline_at_index">
- <argument index="0" name="outline" type="Vector2Array">
+ <argument index="0" name="outline" type="PoolVector2Array">
</argument>
<argument index="1" name="index" type="int">
</argument>
@@ -22199,7 +25554,7 @@
</description>
</method>
<method name="add_polygon">
- <argument index="0" name="polygon" type="IntArray">
+ <argument index="0" name="polygon" type="PoolIntArray">
</argument>
<description>
</description>
@@ -22213,7 +25568,7 @@
</description>
</method>
<method name="get_outline" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<argument index="0" name="idx" type="int">
</argument>
@@ -22227,7 +25582,7 @@
</description>
</method>
<method name="get_polygon">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<argument index="0" name="idx" type="int">
</argument>
@@ -22241,7 +25596,7 @@
</description>
</method>
<method name="get_vertices" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<description>
</description>
@@ -22259,18 +25614,26 @@
<method name="set_outline">
<argument index="0" name="idx" type="int">
</argument>
- <argument index="1" name="outline" type="Vector2Array">
+ <argument index="1" name="outline" type="PoolVector2Array">
</argument>
<description>
</description>
</method>
<method name="set_vertices">
- <argument index="0" name="vertices" type="Vector2Array">
+ <argument index="0" name="vertices" type="PoolVector2Array">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="outlines" type="Array" setter="_set_outlines" getter="_get_outlines" brief="">
+ </member>
+ <member name="polygons" type="Array" setter="_set_polygons" getter="_get_polygons" brief="">
+ </member>
+ <member name="vertices" type="PoolVector3Array" setter="set_vertices" getter="get_vertices" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -22305,6 +25668,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" brief="">
+ </member>
+ <member name="navpoly" type="NavigationPolygon" setter="set_navigation_polygon" getter="get_navigation_polygon" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -22376,6 +25745,8 @@
</constant>
<constant name="COMPRESS_ZLIB" value="3">
</constant>
+ <constant name="COMPRESS_ZSTD" value="4">
+ </constant>
</constants>
</class>
<class name="NetworkedMultiplayerPeer" inherits="PacketPeer" category="Core">
@@ -22483,43 +25854,43 @@
</description>
<methods>
<method name="Nil">
- <argument index="0" name="from" type="ColorArray">
+ <argument index="0" name="from" type="PoolColorArray">
</argument>
<description>
</description>
</method>
<method name="Nil">
- <argument index="0" name="from" type="Vector3Array">
+ <argument index="0" name="from" type="PoolVector3Array">
</argument>
<description>
</description>
</method>
<method name="Nil">
- <argument index="0" name="from" type="Vector2Array">
+ <argument index="0" name="from" type="PoolVector2Array">
</argument>
<description>
</description>
</method>
<method name="Nil">
- <argument index="0" name="from" type="StringArray">
+ <argument index="0" name="from" type="PoolStringArray">
</argument>
<description>
</description>
</method>
<method name="Nil">
- <argument index="0" name="from" type="RealArray">
+ <argument index="0" name="from" type="PoolRealArray">
</argument>
<description>
</description>
</method>
<method name="Nil">
- <argument index="0" name="from" type="IntArray">
+ <argument index="0" name="from" type="PoolIntArray">
</argument>
<description>
</description>
</method>
<method name="Nil">
- <argument index="0" name="from" type="RawArray">
+ <argument index="0" name="from" type="PoolByteArray">
</argument>
<description>
</description>
@@ -22537,12 +25908,6 @@
</description>
</method>
<method name="Nil">
- <argument index="0" name="from" type="InputEvent">
- </argument>
- <description>
- </description>
- </method>
- <method name="Nil">
<argument index="0" name="from" type="Object">
</argument>
<description>
@@ -22561,12 +25926,6 @@
</description>
</method>
<method name="Nil">
- <argument index="0" name="from" type="Image">
- </argument>
- <description>
- </description>
- </method>
- <method name="Nil">
<argument index="0" name="from" type="Color">
</argument>
<description>
@@ -22579,13 +25938,13 @@
</description>
</method>
<method name="Nil">
- <argument index="0" name="from" type="Matrix3">
+ <argument index="0" name="from" type="Basis">
</argument>
<description>
</description>
</method>
<method name="Nil">
- <argument index="0" name="from" type="AABB">
+ <argument index="0" name="from" type="Rect3">
</argument>
<description>
</description>
@@ -22603,7 +25962,7 @@
</description>
</method>
<method name="Nil">
- <argument index="0" name="from" type="Matrix32">
+ <argument index="0" name="from" type="Transform2D">
</argument>
<description>
</description>
@@ -22654,6 +26013,124 @@
<constants>
</constants>
</class>
+<class name="NinePatchRect" inherits="Control" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_draw_center" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_h_axis_stretch_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_patch_margin" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="margin" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_region_rect" qualifiers="const">
+ <return type="Rect2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_texture" qualifiers="const">
+ <return type="Object">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_v_axis_stretch_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_draw_center">
+ <argument index="0" name="draw_center" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_h_axis_stretch_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_patch_margin">
+ <argument index="0" name="margin" type="int">
+ </argument>
+ <argument index="1" name="value" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_region_rect">
+ <argument index="0" name="rect" type="Rect2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_texture">
+ <argument index="0" name="texture" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_v_axis_stretch_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" brief="">
+ </member>
+ <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" brief="">
+ </member>
+ <member name="draw_center" type="bool" setter="set_draw_center" getter="get_draw_center" brief="">
+ </member>
+ <member name="patch_margin_bottom" type="int" setter="set_patch_margin" getter="get_patch_margin" brief="">
+ </member>
+ <member name="patch_margin_left" type="int" setter="set_patch_margin" getter="get_patch_margin" brief="">
+ </member>
+ <member name="patch_margin_right" type="int" setter="set_patch_margin" getter="get_patch_margin" brief="">
+ </member>
+ <member name="patch_margin_top" type="int" setter="set_patch_margin" getter="get_patch_margin" brief="">
+ </member>
+ <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" brief="">
+ </member>
+ <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ </members>
+ <signals>
+ <signal name="texture_changed">
+ <description>
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ <constant name="AXIS_STRETCH_MODE_STRETCH" value="0">
+ </constant>
+ <constant name="AXIS_STRETCH_MODE_TILE" value="1">
+ </constant>
+ <constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2">
+ </constant>
+ </constants>
+</class>
<class name="Node" inherits="Object" category="Core">
<brief_description>
Base class for all the [i]scene[/i] elements.
@@ -22696,8 +26173,6 @@
<argument index="0" name="event" type="InputEvent">
</argument>
<description>
- Called for every input event.
- It has to be enabled with [method set_process_input] or the corresponding property in the inspector.
</description>
</method>
<method name="_process" qualifiers="virtual">
@@ -22719,16 +26194,12 @@
<argument index="0" name="event" type="InputEvent">
</argument>
<description>
- Called for every input event that has not already been handled by another node.
- It has to be enabled with [method set_process_unhandled_input] or the corresponding property in the inspector.
</description>
</method>
<method name="_unhandled_key_input" qualifiers="virtual">
- <argument index="0" name="key_event" type="InputEvent">
+ <argument index="0" name="event" type="InputEventKey">
</argument>
<description>
- Called for every [i]key[/i] input event that has not already been handled by another node.
- It has to be enabled with [method set_process_unhandled_key_input] or the corresponding property in the inspector.
</description>
</method>
<method name="add_child">
@@ -22760,10 +26231,11 @@
<method name="duplicate" qualifiers="const">
<return type="Node">
</return>
- <argument index="0" name="use_instancing" type="bool" default="false">
+ <argument index="0" name="flags" type="int" default="15">
</argument>
<description>
- Duplicate the node, returning a new [Node]. If [code]use_instancing[/code] is true, the duplicated node will be a new instance of the original [PackedScene], if not it will be an independent node. The duplicated node has the same group assignments and signals as the original one.
+ Duplicate the node, returning a new [Node].
+ You can fine-tune the behavior using the [code]flags[/code], which are based on the DUPLICATE_* constants.
</description>
</method>
<method name="find_node" qualifiers="const">
@@ -22837,7 +26309,7 @@
Return the name of the node. This name is unique among the siblings (other child nodes from the same parent).
</description>
</method>
- <method name="get_network_mode" qualifiers="const">
+ <method name="get_network_master" qualifiers="const">
<return type="int">
</return>
<description>
@@ -22984,6 +26456,12 @@
Return true if fixed processing is enabled (see [method set_fixed_process]).
</description>
</method>
+ <method name="is_fixed_processing_internal" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_greater_than" qualifiers="const">
<return type="bool">
</return>
@@ -23027,6 +26505,12 @@
Return true if the node is processing input (see [method set_process_input]).
</description>
</method>
+ <method name="is_processing_internal" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_processing_unhandled_input" qualifiers="const">
<return type="bool">
</return>
@@ -23102,6 +26586,10 @@
Replace a node in a scene by a given one. Subscriptions that pass through this node will be lost.
</description>
</method>
+ <method name="request_ready">
+ <description>
+ </description>
+ </method>
<method name="rpc" qualifiers="vararg">
<argument index="0" name="method" type="String">
</argument>
@@ -23212,6 +26700,12 @@
Enables or disables node fixed framerate processing. When a node is being processed, it will receive a NOTIFICATION_PROCESS at a fixed (usually 60 fps, check [OS] to change that) interval (and the [method _fixed_process] callback will be called if exists). It is common to check how much time was elapsed since the previous frame by calling [method get_fixed_process_delta_time].
</description>
</method>
+ <method name="set_fixed_process_internal">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_name">
<argument index="0" name="name" type="String">
</argument>
@@ -23219,11 +26713,12 @@
Set the name of the [Node]. Name must be unique within parent, and setting an already existing name will cause for the node to be automatically renamed.
</description>
</method>
- <method name="set_network_mode">
- <argument index="0" name="mode" type="int">
+ <method name="set_network_master">
+ <argument index="0" name="id" type="int">
+ </argument>
+ <argument index="1" name="recursive" type="bool" default="true">
</argument>
<description>
- Change the networking mode of the [Node], where [i]mode[/i] is one of the constants NETWORK_MODE_*. Master nodes will only call gdscript methods defined as [i]master func[/i] if a RPC call is received (slave nodes will only call [i]slave func[/i]; both will call [i]remote func[/i] if the call is not local, and [i]sync func[/i] in any case). Inherit mode looks at the parent node to determine the value (root node depends on the [SceneTree] having a networking peer set with [method SceneTree.set_network_peer])
</description>
</method>
<method name="set_owner">
@@ -23253,6 +26748,12 @@
Enable input processing for node. This is not required for GUI controls! It hooks up the node to receive all input (see [method _input]).
</description>
</method>
+ <method name="set_process_internal">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_process_unhandled_input">
<argument index="0" name="enable" type="bool">
</argument>
@@ -23273,18 +26774,26 @@
</description>
</method>
</methods>
+ <members>
+ <member name="_import_path" type="NodePath" setter="_set_import_path" getter="_get_import_path" brief="">
+ </member>
+ <member name="editor/display_folded" type="bool" setter="set_display_folded" getter="is_displayed_folded" brief="">
+ </member>
+ <member name="pause_mode" type="int" setter="set_pause_mode" getter="get_pause_mode" brief="">
+ </member>
+ </members>
<signals>
- <signal name="enter_tree">
+ <signal name="renamed">
<description>
+ Emitted when the node is renamed.
</description>
</signal>
- <signal name="exit_tree">
+ <signal name="tree_entered">
<description>
</description>
</signal>
- <signal name="renamed">
+ <signal name="tree_exited">
<description>
- Emitted when the node is renamed.
</description>
</signal>
</signals>
@@ -23320,11 +26829,11 @@
</constant>
<constant name="NOTIFICATION_PATH_CHANGED" value="23">
</constant>
- <constant name="NETWORK_MODE_INHERIT" value="0">
+ <constant name="NOTIFICATION_TRANSLATION_CHANGED" value="24">
</constant>
- <constant name="NETWORK_MODE_MASTER" value="1">
+ <constant name="NOTIFICATION_INTERNAL_PROCESS" value="25">
</constant>
- <constant name="NETWORK_MODE_SLAVE" value="2">
+ <constant name="NOTIFICATION_INTERNAL_FIXED_PROCESS" value="26">
</constant>
<constant name="RPC_MODE_DISABLED" value="0">
</constant>
@@ -23342,6 +26851,14 @@
</constant>
<constant name="PAUSE_MODE_PROCESS" value="2">
</constant>
+ <constant name="DUPLICATE_SIGNALS" value="1">
+ </constant>
+ <constant name="DUPLICATE_GROUPS" value="2">
+ </constant>
+ <constant name="DUPLICATE_SCRIPTS" value="4">
+ </constant>
+ <constant name="DUPLICATE_USE_INSTANCING" value="8">
+ </constant>
</constants>
</class>
<class name="Node2D" inherits="CanvasItem" category="Core">
@@ -23349,7 +26866,7 @@
Base node for 2D system.
</brief_description>
<description>
- Base node for 2D system. Node2D contains a position, rotation and scale, which is used to position and animate. It can alternatively be used with a custom 2D transform ([Matrix32]). A tree of Node2Ds allows complex hierarchies for animation and positioning.
+ Base node for 2D system. Node2D contains a position, rotation and scale, which is used to position and animate. It can alternatively be used with a custom 2D transform ([Transform2D]). A tree of Node2Ds allows complex hierarchies for animation and positioning.
</description>
<methods>
<method name="edit_set_pivot">
@@ -23368,21 +26885,21 @@
Return the rotation angle in radians needed for the 2d node to point at 'point' position.
</description>
</method>
- <method name="get_global_pos" qualifiers="const">
+ <method name="get_global_position" qualifiers="const">
<return type="Vector2">
</return>
<description>
Return the global position of the 2D node.
</description>
</method>
- <method name="get_global_rot" qualifiers="const">
+ <method name="get_global_rotation" qualifiers="const">
<return type="float">
</return>
<description>
Return the global rotation in radians of the 2D node.
</description>
</method>
- <method name="get_global_rotd" qualifiers="const">
+ <method name="get_global_rotation_in_degrees" qualifiers="const">
<return type="float">
</return>
<description>
@@ -23396,7 +26913,7 @@
Return the global scale of the 2D node.
</description>
</method>
- <method name="get_pos" qualifiers="const">
+ <method name="get_position" qualifiers="const">
<return type="Vector2">
</return>
<description>
@@ -23404,25 +26921,26 @@
</description>
</method>
<method name="get_relative_transform_to_parent" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<argument index="0" name="parent" type="Object">
</argument>
<description>
- Return the transform [Matrix32] calculated relatively to the parent of this 2D node.
+ Return the transform [Transform2D] calculated relatively to the parent of this 2D node.
</description>
</method>
- <method name="get_rot" qualifiers="const">
+ <method name="get_rotation" qualifiers="const">
<return type="float">
</return>
<description>
- Return the rotation of the 2D node.
+ Return the rotation in radians of the 2D node.
</description>
</method>
- <method name="get_rotd" qualifiers="const">
+ <method name="get_rotation_in_degrees" qualifiers="const">
<return type="float">
</return>
<description>
+ Return the rotation in degrees of the 2D node.
</description>
</method>
<method name="get_scale" qualifiers="const">
@@ -23482,7 +27000,7 @@
<argument index="0" name="radians" type="float">
</argument>
<description>
- Apply a 'radians' rotation to the 2D node, starting from its current rotation.
+ Apply a rotation (in radians) to the 2D node, starting from its current rotation.
</description>
</method>
<method name="scale">
@@ -23492,25 +27010,25 @@
Apply the 'ratio' scale to the 2D node, according to its current scale value.
</description>
</method>
- <method name="set_global_pos">
+ <method name="set_global_position">
<argument index="0" name="pos" type="Vector2">
</argument>
<description>
- Set the global position of the 2D node to 'pos'.
+ Set the global position of the 2D node.
</description>
</method>
- <method name="set_global_rot">
+ <method name="set_global_rotation">
<argument index="0" name="radians" type="float">
</argument>
<description>
- Set the global rotation in radians of the 2D node.
+ Set the global rotation in radians of the 2D node
</description>
</method>
- <method name="set_global_rotd">
+ <method name="set_global_rotation_in_degrees">
<argument index="0" name="degrees" type="float">
</argument>
<description>
- Set the global rotation in degrees of the 2D node.
+ Set the global rotation in degrees of the 2D node
</description>
</method>
<method name="set_global_scale">
@@ -23521,31 +27039,31 @@
</description>
</method>
<method name="set_global_transform">
- <argument index="0" name="xform" type="Matrix32">
+ <argument index="0" name="xform" type="Transform2D">
</argument>
<description>
- Set the global transform [Matrix32] of the 2D node.
+ Set the global transform [Transform2D] of the 2D node.
</description>
</method>
- <method name="set_pos">
+ <method name="set_position">
<argument index="0" name="pos" type="Vector2">
</argument>
<description>
Set the position of the 2D node.
</description>
</method>
- <method name="set_rot">
+ <method name="set_rotation">
<argument index="0" name="radians" type="float">
</argument>
<description>
- Set the rotation of the 2D node.
+ Set the rotation in radians of the 2D node.
</description>
</method>
- <method name="set_rotd">
+ <method name="set_rotation_in_degrees">
<argument index="0" name="degrees" type="float">
</argument>
<description>
- Set the rotation of the 2D node.
+ Set the rotation in degrees of the 2D node.
</description>
</method>
<method name="set_scale">
@@ -23556,10 +27074,10 @@
</description>
</method>
<method name="set_transform">
- <argument index="0" name="xform" type="Matrix32">
+ <argument index="0" name="xform" type="Transform2D">
</argument>
<description>
- Set the local transform [Matrix32] of the 2D node.
+ Set the local transform [Transform2D] of the 2D node.
</description>
</method>
<method name="set_z">
@@ -23584,6 +27102,32 @@
</description>
</method>
</methods>
+ <members>
+ <member name="global_position" type="float" setter="set_global_position" getter="get_global_position" brief="">
+ </member>
+ <member name="global_rotation" type="float" setter="set_global_rotation" getter="get_global_rotation" brief="">
+ </member>
+ <member name="global_rotation_deg" type="float" setter="set_global_rotation_in_degrees" getter="get_global_rotation_in_degrees" brief="">
+ </member>
+ <member name="global_scale" type="float" setter="set_global_scale" getter="get_global_scale" brief="">
+ </member>
+ <member name="global_transform" type="Transform2D" setter="set_global_transform" getter="get_global_transform" brief="">
+ </member>
+ <member name="position" type="Vector2" setter="set_position" getter="get_position" brief="">
+ </member>
+ <member name="rotation" type="float" setter="set_rotation" getter="get_rotation" brief="">
+ </member>
+ <member name="rotation_deg" type="float" setter="set_rotation_in_degrees" getter="get_rotation_in_degrees" brief="">
+ </member>
+ <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" brief="">
+ </member>
+ <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" brief="">
+ </member>
+ <member name="z" type="int" setter="set_z" getter="get_z" brief="">
+ </member>
+ <member name="z_as_relative" type="bool" setter="set_z_as_relative" getter="is_z_relative" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -23730,11 +27274,11 @@
</return>
<argument index="0" name="path" type="String">
</argument>
- <argument index="1" name="arguments" type="StringArray">
+ <argument index="1" name="arguments" type="PoolStringArray">
</argument>
<argument index="2" name="blocking" type="bool">
</argument>
- <argument index="3" name="output" type="Array" default="Array()">
+ <argument index="3" name="output" type="Array" default="[]">
</argument>
<description>
Execute the binary file in given path, optionally blocking until it returns. A process ID is returned.
@@ -23764,7 +27308,7 @@
</description>
</method>
<method name="get_cmdline_args">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
Return the commandline passed to the engine.
@@ -23777,13 +27321,6 @@
Returns the current screen index (0 padded).
</description>
</method>
- <method name="get_custom_level" qualifiers="const">
- <return type="String">
- </return>
- <description>
- Returns the value of the commandline argument "-level".
- </description>
- </method>
<method name="get_data_dir" qualifiers="const">
<return type="String">
</return>
@@ -23826,20 +27363,6 @@
Return the total amount of dynamic memory used (only works in debug).
</description>
</method>
- <method name="get_engine_version" qualifiers="const">
- <return type="Dictionary">
- </return>
- <description>
- Returns the current engine version information in a Dictionary.
-
- "major" - Holds the major version number as a String
- "minor" - Holds the minor version number as a String
- "patch" - Holds the patch version number as a String
- "status" - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String
- "revision" - Holds the revision (e.g. "custom-build") as a String
- "string" - major + minor + patch + status + revision in a single String
- </description>
- </method>
<method name="get_environment" qualifiers="const">
<return type="String">
</return>
@@ -23856,73 +27379,60 @@
Return the path to the current engine executable.
</description>
</method>
- <method name="get_frames_drawn">
+ <method name="get_exit_code" qualifiers="const">
<return type="int">
</return>
<description>
- Return the total amount of frames drawn.
- </description>
- </method>
- <method name="get_frames_per_second" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Returns the frames per second of the running game.
</description>
</method>
- <method name="get_fullscreen_mode_list" qualifiers="const">
- <return type="Array">
+ <method name="get_latin_keyboard_variant" qualifiers="const">
+ <return type="String">
</return>
- <argument index="0" name="screen" type="int" default="0">
- </argument>
<description>
- Return the list of fullscreen modes.
+ Returns the current latin keyboard variant as a String.
+ Possible return values are: "QWERTY", "AZERTY", "QZERTY", "DVORAK", "NEO" or "ERROR"
</description>
</method>
- <method name="get_iterations_per_second" qualifiers="const">
- <return type="int">
+ <method name="get_locale" qualifiers="const">
+ <return type="String">
</return>
<description>
- Return the amount of fixed iterations per second (for fixed process and physics).
+ Return the host OS locale.
</description>
</method>
- <method name="get_latin_keyboard_variant" qualifiers="const">
+ <method name="get_model_name" qualifiers="const">
<return type="String">
</return>
<description>
- Returns the current latin keyboard variant as a String.
- Possible return values are: "QWERTY", "AZERTY", "QZERTY", "DVORAK", "NEO" or "ERROR"
+ Returns the model name of the current device.
</description>
</method>
- <method name="get_locale" qualifiers="const">
+ <method name="get_name" qualifiers="const">
<return type="String">
</return>
<description>
- Return the host OS locale.
+ Return the name of the host OS. Possible values are: "Android", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "UWP", "X11".
</description>
</method>
- <method name="get_main_loop" qualifiers="const">
- <return type="Object">
+ <method name="get_power_percent_left">
+ <return type="int">
</return>
<description>
- Return the main loop object (see [MainLoop]).
</description>
</method>
- <method name="get_model_name" qualifiers="const">
- <return type="String">
+ <method name="get_power_seconds_left">
+ <return type="int">
</return>
<description>
- Returns the model name of the current device.
</description>
</method>
- <method name="get_name" qualifiers="const">
- <return type="String">
+ <method name="get_power_state">
+ <return type="int">
</return>
<description>
- Return the name of the host OS. Possible values are: "Android", "BlackBerry 10", "Flash", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "UWP", "X11"
</description>
</method>
- <method name="get_process_ID" qualifiers="const">
+ <method name="get_process_id" qualifiers="const">
<return type="int">
</return>
<description>
@@ -24026,12 +27536,6 @@
<description>
</description>
</method>
- <method name="get_target_fps" qualifiers="const">
- <return type="float">
- </return>
- <description>
- </description>
- </method>
<method name="get_ticks_msec" qualifiers="const">
<return type="int">
</return>
@@ -24048,19 +27552,13 @@
Returns current time as a dictionary of keys: hour, minute, second
</description>
</method>
- <method name="get_time_scale">
- <return type="float">
- </return>
- <description>
- </description>
- </method>
<method name="get_time_zone_info" qualifiers="const">
<return type="Dictionary">
</return>
<description>
</description>
</method>
- <method name="get_unique_ID" qualifiers="const">
+ <method name="get_unique_id" qualifiers="const">
<return type="String">
</return>
<description>
@@ -24084,15 +27582,6 @@
You can pass the output from [method get_datetime_from_unix_time] directly into this function. Daylight savings time (dst), if present, is ignored.
</description>
</method>
- <method name="get_video_mode_size" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="screen" type="int" default="0">
- </argument>
- <description>
- Return the current video mode size.
- </description>
- </method>
<method name="get_window_position" qualifiers="const">
<return type="Vector2">
</return>
@@ -24175,24 +27664,6 @@
Return true if the engine was executed with -v (verbose stdout).
</description>
</method>
- <method name="is_video_mode_fullscreen" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="screen" type="int" default="0">
- </argument>
- <description>
- Return true if the current video mode is fullscreen.
- </description>
- </method>
- <method name="is_video_mode_resizable" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="screen" type="int" default="0">
- </argument>
- <description>
- Return true if the window is resizable.
- </description>
- </method>
<method name="is_vsync_enabled" qualifiers="const">
<return type="bool">
</return>
@@ -24279,7 +27750,7 @@
</description>
</method>
<method name="print_resources_by_type">
- <argument index="0" name="types" type="StringArray">
+ <argument index="0" name="types" type="PoolStringArray">
</argument>
<description>
</description>
@@ -24314,17 +27785,22 @@
<description>
</description>
</method>
+ <method name="set_exit_code">
+ <argument index="0" name="code" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_icon">
- <argument index="0" name="icon" type="Image">
+ <argument index="0" name="icon" type="Object">
</argument>
<description>
</description>
</method>
- <method name="set_iterations_per_second">
- <argument index="0" name="iterations_per_second" type="int">
+ <method name="set_ime_position">
+ <argument index="0" name="arg0" type="Vector2">
</argument>
<description>
- Set the amount of fixed iterations per second (for fixed process and physics).
</description>
</method>
<method name="set_keep_screen_on">
@@ -24348,12 +27824,6 @@
Sets the current screen orientation, the argument value must be one of the SCREEN_ORIENTATION constants in this class.
</description>
</method>
- <method name="set_target_fps">
- <argument index="0" name="target_fps" type="int">
- </argument>
- <description>
- </description>
- </method>
<method name="set_thread_name">
<return type="int">
</return>
@@ -24362,13 +27832,6 @@
<description>
</description>
</method>
- <method name="set_time_scale">
- <argument index="0" name="time_scale" type="float">
- </argument>
- <description>
- Speeds up or slows down the physics by changing the delta variable. (delta * time_scale)
- </description>
- </method>
<method name="set_use_file_access_save_and_swap">
<argument index="0" name="enabled" type="bool">
</argument>
@@ -24381,19 +27844,6 @@
<description>
</description>
</method>
- <method name="set_video_mode">
- <argument index="0" name="size" type="Vector2">
- </argument>
- <argument index="1" name="fullscreen" type="bool">
- </argument>
- <argument index="2" name="resizable" type="bool">
- </argument>
- <argument index="3" name="screen" type="int" default="0">
- </argument>
- <description>
- Change the video mode.
- </description>
- </method>
<method name="set_window_fullscreen">
<argument index="0" name="enabled" type="bool">
</argument>
@@ -24528,6 +27978,16 @@
</constant>
<constant name="SYSTEM_DIR_RINGTONES" value="7">
</constant>
+ <constant name="POWERSTATE_UNKNOWN" value="0">
+ </constant>
+ <constant name="POWERSTATE_ON_BATTERY" value="1">
+ </constant>
+ <constant name="POWERSTATE_NO_BATTERY" value="2">
+ </constant>
+ <constant name="POWERSTATE_CHARGING" value="3">
+ </constant>
+ <constant name="POWERSTATE_CHARGED" value="4">
+ </constant>
</constants>
</class>
<class name="Object" category="Core">
@@ -24562,7 +28022,7 @@
<return type="Array">
</return>
<description>
- Return the property list, array of dictionaries, dictionaries must contain: name:String, type:int (see TYPE_* enum in globals) and optionally: hint:int (see PROPERTY_HINT_* in globals), hint_string:String, usage:int (see PROPERTY_USAGE_* in globals).
+ Return the property list, array of dictionaries, dictionaries must contain: name:String, type:int (see TYPE_* enum in [@Global Scope]) and optionally: hint:int (see PROPERTY_HINT_* in [@Global Scope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@Global Scope]).
</description>
</method>
<method name="_init" qualifiers="virtual">
@@ -24588,7 +28048,7 @@
<method name="add_user_signal">
<argument index="0" name="signal" type="String">
</argument>
- <argument index="1" name="arguments" type="Array" default="Array()">
+ <argument index="1" name="arguments" type="Array" default="[]">
</argument>
<description>
Add a user signal (can be added anytime). Arguments are optional, but can be added as an array of dictionaries, each containing "name" and "type" (from [@Global Scope] TYPE_*).
@@ -24634,7 +28094,7 @@
</argument>
<argument index="2" name="method" type="String">
</argument>
- <argument index="3" name="binds" type="Array" default="Array()">
+ <argument index="3" name="binds" type="Array" default="[]">
</argument>
<argument index="4" name="flags" type="int" default="0">
</argument>
@@ -24664,13 +28124,33 @@
</description>
</method>
<method name="get" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="property" type="String">
</argument>
<description>
Get a property from the object.
</description>
</method>
- <method name="get_instance_ID" qualifiers="const">
+ <method name="get_class" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ Return the class of the object as a string.
+ </description>
+ </method>
+ <method name="get_incoming_connections" qualifiers="const">
+ <return type="Array">
+ </return>
+ <description>
+ Returns an [Array] of dictionaries with informations about signals that are connected to this object.
+ Inside each [Dictionary] there are 3 fields:
+ - "source" is a reference to signal emitter.
+ - "signal_name" is name of connected signal.
+ - "method_name" is a name of method to which signal is connected.
+ </description>
+ </method>
+ <method name="get_instance_id" qualifiers="const">
<return type="int">
</return>
<description>
@@ -24678,6 +28158,8 @@
</description>
</method>
<method name="get_meta" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="name" type="String">
</argument>
<description>
@@ -24685,7 +28167,7 @@
</description>
</method>
<method name="get_meta_list" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
Return the list of metadata in the object.
@@ -24701,7 +28183,7 @@
<return type="Array">
</return>
<description>
- Return the list of properties as an array of dictionaries, dictionaries contain: name:String, type:int (see TYPE_* enum in globals) and optionally: hint:int (see PROPERTY_HINT_* in globals), hint_string:String, usage:int (see PROPERTY_USAGE_* in globals).
+ Return the list of properties as an array of dictionaries, dictionaries contain: name:String, type:int (see TYPE_* enum in [@Global Scope]) and optionally: hint:int (see PROPERTY_HINT_* in [@Global Scope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@Global Scope]).
</description>
</method>
<method name="get_script" qualifiers="const">
@@ -24726,13 +28208,6 @@
Return the list of signals as an array of dictionaries.
</description>
</method>
- <method name="get_type" qualifiers="const">
- <return type="String">
- </return>
- <description>
- Return the type of the object as a string.
- </description>
- </method>
<method name="has_meta" qualifiers="const">
<return type="bool">
</return>
@@ -24765,6 +28240,15 @@
Return true if signal emission blocking is enabled.
</description>
</method>
+ <method name="is_class" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="type" type="String">
+ </argument>
+ <description>
+ Check the class of the object against a string (including inheritance).
+ </description>
+ </method>
<method name="is_connected" qualifiers="const">
<return type="bool">
</return>
@@ -24784,15 +28268,6 @@
<description>
</description>
</method>
- <method name="is_type" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="type" type="String">
- </argument>
- <description>
- Check the type of the object against a string (including inheritance).
- </description>
- </method>
<method name="notification">
<argument index="0" name="what" type="int">
</argument>
@@ -24875,7 +28350,7 @@
Persisting connections are saved when the object is serialized to file.
</constant>
<constant name="CONNECT_ONESHOT" value="4">
- One short connections disconnect themselves after emission.
+ One shot connections disconnect themselves after emission.
</constant>
</constants>
</class>
@@ -24892,7 +28367,7 @@
</description>
</method>
<method name="get_polygon" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<description>
</description>
@@ -24916,12 +28391,20 @@
</description>
</method>
<method name="set_polygon">
- <argument index="0" name="polygon" type="Vector2Array">
+ <argument index="0" name="polygon" type="PoolVector2Array">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="closed" type="bool" setter="set_closed" getter="is_closed" brief="">
+ </member>
+ <member name="cull_mode" type="int" setter="set_cull_mode" getter="get_cull_mode" brief="">
+ </member>
+ <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" brief="">
+ </member>
+ </members>
<constants>
<constant name="CULL_DISABLED" value="0">
</constant>
@@ -24936,10 +28419,44 @@
OmniDirectional Light, such as a light bulb or a candle.
</brief_description>
<description>
- An OmniDirectional light is a type of [Light] node that emits lights in all directions. The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of [Light]. TODO: Image of an omnilight.
+ An OmniDirectional light is a type of [Light] node that emits lights in all directions. The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of [Light].
</description>
<methods>
+ <method name="get_shadow_detail" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_shadow_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_shadow_detail">
+ <argument index="0" name="detail" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_shadow_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="omni_attenuation" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="omni_range" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="omni_shadow_detail" type="int" setter="set_shadow_detail" getter="get_shadow_detail" brief="">
+ </member>
+ <member name="omni_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -24981,7 +28498,7 @@
Clear all the items in the [OptionButton].
</description>
</method>
- <method name="get_item_ID" qualifiers="const">
+ <method name="get_item_id" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="idx" type="int">
@@ -25007,6 +28524,8 @@
</description>
</method>
<method name="get_item_metadata" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="idx" type="int">
</argument>
<description>
@@ -25028,13 +28547,15 @@
Return the current item index
</description>
</method>
- <method name="get_selected_ID" qualifiers="const">
+ <method name="get_selected_id" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
<method name="get_selected_metadata" qualifiers="const">
+ <return type="Variant">
+ </return>
<description>
</description>
</method>
@@ -25059,7 +28580,7 @@
Select an item by index and make it the current item.
</description>
</method>
- <method name="set_item_ID">
+ <method name="set_item_id">
<argument index="0" name="idx" type="int">
</argument>
<argument index="1" name="id" type="int">
@@ -25103,6 +28624,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="items" type="Array" setter="_set_items" getter="_get_items" brief="">
+ </member>
+ <member name="selected" type="int" setter="_select_int" getter="get_selected" brief="">
+ </member>
+ </members>
<signals>
<signal name="item_selected">
<argument index="0" name="ID" type="int">
@@ -25220,6 +28747,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="__data__" type="PoolByteArray" setter="_set_data" getter="_get_data" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -25261,7 +28792,7 @@
<method name="instance" qualifiers="const">
<return type="Node">
</return>
- <argument index="0" name="gen_edit_state" type="bool" default="false">
+ <argument index="0" name="edit_state" type="int" default="0">
</argument>
<description>
</description>
@@ -25276,7 +28807,17 @@
</description>
</method>
</methods>
+ <members>
+ <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" brief="">
+ </member>
+ </members>
<constants>
+ <constant name="GEN_EDIT_STATE_DISABLED" value="0">
+ </constant>
+ <constant name="GEN_EDIT_STATE_INSTANCE" value="1">
+ </constant>
+ <constant name="GEN_EDIT_STATE_MAIN" value="2">
+ </constant>
</constants>
</class>
<class name="PacketPeer" inherits="Reference" category="Core">
@@ -25295,7 +28836,7 @@
</description>
</method>
<method name="get_packet" qualifiers="const">
- <return type="RawArray">
+ <return type="PoolByteArray">
</return>
<description>
Get a raw packet.
@@ -25318,7 +28859,7 @@
<method name="put_packet">
<return type="Error">
</return>
- <argument index="0" name="buffer" type="RawArray">
+ <argument index="0" name="buffer" type="PoolByteArray">
</argument>
<description>
Send a raw packet.
@@ -25361,7 +28902,7 @@
UDP packet peer.
</brief_description>
<description>
- UDP packet peer. Can be used to send raw UDP packets as well as [Variant]s.
+ UDP packet peer. Can be used to send raw UDP packets as well as [Variant]\ s.
</description>
<methods>
<method name="close">
@@ -25369,13 +28910,6 @@
Close the UDP socket the [PacketPeerUDP] is currently listening on.
</description>
</method>
- <method name="get_packet_address" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the address of the remote peer(as a 32bit integer) that sent the last packet(that was received with [method get_packet] or [method get_var]).
- </description>
- </method>
<method name="get_packet_ip" qualifiers="const">
<return type="String">
</return>
@@ -25402,7 +28936,7 @@
</return>
<argument index="0" name="port" type="int">
</argument>
- <argument index="1" name="bind_address" type="String" default="*">
+ <argument index="1" name="bind_address" type="String" default="&quot;*&quot;">
</argument>
<argument index="2" name="recv_buf_size" type="int" default="65536">
</argument>
@@ -25413,7 +28947,7 @@
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">
+ <method name="set_dest_address">
<return type="int">
</return>
<argument index="0" name="host" type="String">
@@ -25471,6 +29005,32 @@
</theme_item>
</theme_items>
</class>
+<class name="PanoramaSky" inherits="Sky" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_panorama" qualifiers="const">
+ <return type="Texture">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_panorama">
+ <argument index="0" name="texture" type="Texture">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="panorama" type="Texture" setter="set_panorama" getter="get_panorama" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
<class name="ParallaxBackground" inherits="CanvasLayer" category="Core">
<brief_description>
A node used to create a parallax scrolling background.
@@ -25562,6 +29122,20 @@
</description>
</method>
</methods>
+ <members>
+ <member name="scroll_base_offset" type="Vector2" setter="set_scroll_base_offset" getter="get_scroll_base_offset" brief="">
+ </member>
+ <member name="scroll_base_scale" type="Vector2" setter="set_scroll_base_scale" getter="get_scroll_base_scale" brief="">
+ </member>
+ <member name="scroll_ignore_camera_zoom" type="bool" setter="set_ignore_camera_zoom" getter="is_ignore_camera_zoom" brief="">
+ </member>
+ <member name="scroll_limit_begin" type="Vector2" setter="set_limit_begin" getter="get_limit_begin" brief="">
+ </member>
+ <member name="scroll_limit_end" type="Vector2" setter="set_limit_end" getter="get_limit_end" brief="">
+ </member>
+ <member name="scroll_offset" type="Vector2" setter="set_scroll_offset" getter="get_scroll_offset" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -25614,303 +29188,502 @@
</description>
</method>
</methods>
+ <members>
+ <member name="motion_mirroring" type="Vector2" setter="set_mirroring" getter="get_mirroring" brief="">
+ </member>
+ <member name="motion_offset" type="Vector2" setter="set_motion_offset" getter="get_motion_offset" brief="">
+ </member>
+ <member name="motion_scale" type="Vector2" setter="set_motion_scale" getter="get_motion_scale" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
-<class name="ParticleAttractor2D" inherits="Node2D" category="Core">
+<class name="Particles" inherits="GeometryInstance" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="get_absorption" qualifiers="const">
+ <method name="capture_aabb" qualifiers="const">
+ <return type="Rect3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_amount" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_draw_order" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_draw_pass_mesh" qualifiers="const">
+ <return type="Mesh">
+ </return>
+ <argument index="0" name="pass" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_draw_passes" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_explosiveness_ratio" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_disable_radius" qualifiers="const">
+ <method name="get_fixed_fps" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_fractional_delta" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_lifetime" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_gravity" qualifiers="const">
+ <method name="get_one_shot" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_pre_process_time" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_particles_path" qualifiers="const">
- <return type="NodePath">
+ <method name="get_process_material" qualifiers="const">
+ <return type="Material">
</return>
<description>
</description>
</method>
- <method name="get_radius" qualifiers="const">
+ <method name="get_randomness_ratio" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="is_enabled" qualifiers="const">
+ <method name="get_speed_scale" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_use_local_coordinates" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_visibility_aabb" qualifiers="const">
+ <return type="Rect3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_emitting" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="set_absorption">
- <argument index="0" name="absorption" type="float">
+ <method name="restart">
+ <description>
+ </description>
+ </method>
+ <method name="set_amount">
+ <argument index="0" name="amount" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_disable_radius">
- <argument index="0" name="radius" type="float">
+ <method name="set_draw_order">
+ <argument index="0" name="order" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_enabled">
- <argument index="0" name="enabled" type="bool">
+ <method name="set_draw_pass_mesh">
+ <argument index="0" name="pass" type="int">
+ </argument>
+ <argument index="1" name="mesh" type="Mesh">
</argument>
<description>
</description>
</method>
- <method name="set_gravity">
- <argument index="0" name="gravity" type="float">
+ <method name="set_draw_passes">
+ <argument index="0" name="passes" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_particles_path">
- <argument index="0" name="path" type="NodePath">
+ <method name="set_emitting">
+ <argument index="0" name="emitting" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_radius">
- <argument index="0" name="radius" type="float">
+ <method name="set_explosiveness_ratio">
+ <argument index="0" name="ratio" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fixed_fps">
+ <argument index="0" name="fps" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_fractional_delta">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_lifetime">
+ <argument index="0" name="secs" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_one_shot">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_pre_process_time">
+ <argument index="0" name="secs" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_process_material">
+ <argument index="0" name="material" type="Material">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_randomness_ratio">
+ <argument index="0" name="ratio" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_speed_scale">
+ <argument index="0" name="scale" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_use_local_coordinates">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_visibility_aabb">
+ <argument index="0" name="aabb" type="Rect3">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="amount" type="int" setter="set_amount" getter="get_amount" brief="">
+ </member>
+ <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" brief="">
+ </member>
+ <member name="draw_pass_1" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh" brief="">
+ </member>
+ <member name="draw_pass_2" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh" brief="">
+ </member>
+ <member name="draw_pass_3" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh" brief="">
+ </member>
+ <member name="draw_pass_4" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh" brief="">
+ </member>
+ <member name="draw_passes" type="int" setter="set_draw_passes" getter="get_draw_passes" brief="">
+ </member>
+ <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" brief="">
+ </member>
+ <member name="explosiveness" type="float" setter="set_explosiveness_ratio" getter="get_explosiveness_ratio" brief="">
+ </member>
+ <member name="fixed_fps" type="int" setter="set_fixed_fps" getter="get_fixed_fps" brief="">
+ </member>
+ <member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" brief="">
+ </member>
+ <member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" brief="">
+ </member>
+ <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" brief="">
+ </member>
+ <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" brief="">
+ </member>
+ <member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" brief="">
+ </member>
+ <member name="process_material" type="ShaderMaterial,ParticlesMaterial" setter="set_process_material" getter="get_process_material" brief="">
+ </member>
+ <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" brief="">
+ </member>
+ <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" brief="">
+ </member>
+ <member name="visibility_aabb" type="Rect3" setter="set_visibility_aabb" getter="get_visibility_aabb" brief="">
+ </member>
+ </members>
<constants>
+ <constant name="DRAW_ORDER_INDEX" value="0">
+ </constant>
+ <constant name="DRAW_ORDER_LIFETIME" value="1">
+ </constant>
+ <constant name="DRAW_ORDER_VIEW_DEPTH" value="2">
+ </constant>
+ <constant name="MAX_DRAW_PASSES" value="4">
+ </constant>
</constants>
</class>
-<class name="Particles" inherits="GeometryInstance" category="Core">
+<class name="Particles2D" inherits="Node2D" category="Core">
<brief_description>
- Particle system 3D Node
+ 2D Particle emitter
</brief_description>
<description>
- Particles is a particle system 3D [Node] that is used to simulate several types of particle effects, such as explosions, rain, snow, fireflies, or other magical-like shinny sparkles. Particles are drawn using impostors, and given their dynamic behavior, the user must provide a visibility AABB (although helpers to create one automatically exist).
+ Particles2D is a particle system 2D [Node] that is used to simulate several types of particle effects, such as explosions, rain, snow, fireflies, or other magical-like shinny sparkles. Particles are drawn using impostors, and given their dynamic behavior, the user must provide a visibility bounding box (although helpers to create one automatically exist).
</description>
<methods>
+ <method name="capture_rect" qualifiers="const">
+ <return type="Rect2">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_amount" qualifiers="const">
<return type="int">
</return>
<description>
- Return the total amount of particles in the system.
+ Returns the amount of particles spawned at each emission
</description>
</method>
- <method name="get_color_phase_color" qualifiers="const">
- <return type="Color">
+ <method name="get_draw_order" qualifiers="const">
+ <return type="int">
</return>
- <argument index="0" name="phase" type="int">
- </argument>
<description>
- Return the color of a color phase.
</description>
</method>
- <method name="get_color_phase_pos" qualifiers="const">
+ <method name="get_explosiveness_ratio" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="phase" type="int">
- </argument>
<description>
- Return the position of a color phase (0 to 1).
</description>
</method>
- <method name="get_color_phases" qualifiers="const">
+ <method name="get_fixed_fps" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="get_emission_base_velocity" qualifiers="const">
- <return type="Vector3">
+ <method name="get_fractional_delta" qualifiers="const">
+ <return type="bool">
</return>
<description>
</description>
</method>
- <method name="get_emission_half_extents" qualifiers="const">
- <return type="Vector3">
+ <method name="get_h_frames" qualifiers="const">
+ <return type="int">
</return>
<description>
- Return the half extents for the emission box.
</description>
</method>
- <method name="get_emission_points" qualifiers="const">
- <return type="Vector3Array">
+ <method name="get_lifetime" qualifiers="const">
+ <return type="float">
</return>
<description>
+ Gets the amount of seconds that each particle will be visible.
</description>
</method>
- <method name="get_emit_timeout" qualifiers="const">
- <return type="float">
+ <method name="get_normal_map" qualifiers="const">
+ <return type="Texture">
</return>
<description>
</description>
</method>
- <method name="get_gravity_normal" qualifiers="const">
- <return type="Vector3">
+ <method name="get_one_shot" qualifiers="const">
+ <return type="bool">
</return>
<description>
- Return the normal vector towards where gravity is pulling (by default, negative Y).
</description>
</method>
- <method name="get_material" qualifiers="const">
+ <method name="get_pre_process_time" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_process_material" qualifiers="const">
<return type="Material">
</return>
<description>
- Return the material used to draw particles.
</description>
</method>
- <method name="get_randomness" qualifiers="const">
+ <method name="get_randomness_ratio" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="variable" type="int">
- </argument>
<description>
- Return the randomness for a specific variable of the particle system. Randomness produces small changes from the default each time a particle is emitted.
</description>
</method>
- <method name="get_variable" qualifiers="const">
+ <method name="get_speed_scale" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="variable" type="int">
- </argument>
<description>
- Return a specific variable for the particle system (see VAR_* enum).
</description>
</method>
- <method name="get_visibility_aabb" qualifiers="const">
- <return type="AABB">
+ <method name="get_texture" qualifiers="const">
+ <return type="Texture">
</return>
<description>
- Return the current visibility AABB.
+ Returns the texture for emitted particles
</description>
</method>
- <method name="has_height_from_velocity" qualifiers="const">
+ <method name="get_use_local_coordinates" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="is_emitting" qualifiers="const">
- <return type="bool">
+ <method name="get_v_frames" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_visibility_rect" qualifiers="const">
+ <return type="Rect2">
</return>
<description>
- Return the "emitting" property state (see [method set_emitting]).
</description>
</method>
- <method name="is_using_local_coordinates" qualifiers="const">
+ <method name="is_emitting" qualifiers="const">
<return type="bool">
</return>
<description>
+ Returns whether this emitter is currently emitting or not
+ </description>
+ </method>
+ <method name="restart">
+ <description>
</description>
</method>
<method name="set_amount">
<argument index="0" name="amount" type="int">
</argument>
<description>
- Set total amount of particles in the system.
+ Sets the amount of particles spawned at each emission
</description>
</method>
- <method name="set_color_phase_color">
- <argument index="0" name="phase" type="int">
- </argument>
- <argument index="1" name="color" type="Color">
+ <method name="set_draw_order">
+ <argument index="0" name="order" type="int">
</argument>
<description>
- Set the color of a color phase.
</description>
</method>
- <method name="set_color_phase_pos">
- <argument index="0" name="phase" type="int">
- </argument>
- <argument index="1" name="pos" type="float">
+ <method name="set_emitting">
+ <argument index="0" name="emitting" type="bool">
</argument>
<description>
- Set the position of a color phase (0 to 1).
+ If this is set to true then the particle emitter will emit particles, if its false it will not.
</description>
</method>
- <method name="set_color_phases">
- <argument index="0" name="count" type="int">
+ <method name="set_explosiveness_ratio">
+ <argument index="0" name="ratio" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_emission_base_velocity">
- <argument index="0" name="base_velocity" type="Vector3">
+ <method name="set_fixed_fps">
+ <argument index="0" name="fps" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_emission_half_extents">
- <argument index="0" name="half_extents" type="Vector3">
+ <method name="set_fractional_delta">
+ <argument index="0" name="enable" type="bool">
</argument>
<description>
- Set the half extents for the emission box.
</description>
</method>
- <method name="set_emission_points">
- <argument index="0" name="points" type="Vector3Array">
+ <method name="set_h_frames">
+ <argument index="0" name="frames" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_emit_timeout">
- <argument index="0" name="timeout" type="float">
+ <method name="set_lifetime">
+ <argument index="0" name="secs" type="float">
</argument>
<description>
+ Sets the amount of seconds that each particle will be visible.
</description>
</method>
- <method name="set_emitting">
- <argument index="0" name="enabled" type="bool">
+ <method name="set_normal_map">
+ <argument index="0" name="texture" type="Texture">
</argument>
<description>
- Set the "emitting" property state. When emitting, the particle system generates new particles at constant rate.
</description>
</method>
- <method name="set_gravity_normal">
- <argument index="0" name="normal" type="Vector3">
+ <method name="set_one_shot">
+ <argument index="0" name="secs" type="bool">
</argument>
<description>
- Set the normal vector towards where gravity is pulling (by default, negative Y).
</description>
</method>
- <method name="set_height_from_velocity">
- <argument index="0" name="enable" type="bool">
+ <method name="set_pre_process_time">
+ <argument index="0" name="secs" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_material">
+ <method name="set_process_material">
<argument index="0" name="material" type="Material">
</argument>
<description>
- Set the material used to draw particles.
</description>
</method>
- <method name="set_randomness">
- <argument index="0" name="variable" type="int">
+ <method name="set_randomness_ratio">
+ <argument index="0" name="ratio" type="float">
</argument>
- <argument index="1" name="randomness" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="set_speed_scale">
+ <argument index="0" name="scale" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_texture">
+ <argument index="0" name="texture" type="Texture">
</argument>
<description>
- Set the randomness for a specific variable of the particle system. Randomness produces small changes from the default each time a particle is emitted.
</description>
</method>
<method name="set_use_local_coordinates">
@@ -25919,155 +29692,142 @@
<description>
</description>
</method>
- <method name="set_variable">
- <argument index="0" name="variable" type="int">
- </argument>
- <argument index="1" name="value" type="float">
+ <method name="set_v_frames">
+ <argument index="0" name="frames" type="int">
</argument>
<description>
- Set a specific variable for the particle system (see VAR_* enum).
</description>
</method>
- <method name="set_visibility_aabb">
- <argument index="0" name="aabb" type="AABB">
+ <method name="set_visibility_rect">
+ <argument index="0" name="aabb" type="Rect2">
</argument>
<description>
- Set the visibility AABB for the particle system, since the default one will not work properly most of the time.
</description>
</method>
</methods>
+ <members>
+ <member name="amount" type="int" setter="set_amount" getter="get_amount" brief="">
+ </member>
+ <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" brief="">
+ </member>
+ <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" brief="">
+ </member>
+ <member name="explosiveness" type="float" setter="set_explosiveness_ratio" getter="get_explosiveness_ratio" brief="">
+ </member>
+ <member name="fixed_fps" type="int" setter="set_fixed_fps" getter="get_fixed_fps" brief="">
+ </member>
+ <member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" brief="">
+ </member>
+ <member name="h_frames" type="int" setter="set_h_frames" getter="get_h_frames" brief="">
+ </member>
+ <member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" brief="">
+ </member>
+ <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" brief="">
+ </member>
+ <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" brief="">
+ </member>
+ <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" brief="">
+ </member>
+ <member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" brief="">
+ </member>
+ <member name="process_material" type="ShaderMaterial,ParticlesMaterial" setter="set_process_material" getter="get_process_material" brief="">
+ </member>
+ <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" brief="">
+ </member>
+ <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" brief="">
+ </member>
+ <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="v_frames" type="int" setter="set_v_frames" getter="get_v_frames" brief="">
+ </member>
+ <member name="visibility_rect" type="Rect3" setter="set_visibility_rect" getter="get_visibility_rect" brief="">
+ </member>
+ </members>
<constants>
- <constant name="VAR_LIFETIME" value="0">
+ <constant name="DRAW_ORDER_INDEX" value="0">
</constant>
- <constant name="VAR_SPREAD" value="1">
- </constant>
- <constant name="VAR_GRAVITY" value="2">
- </constant>
- <constant name="VAR_LINEAR_VELOCITY" value="3">
- </constant>
- <constant name="VAR_ANGULAR_VELOCITY" value="4">
- </constant>
- <constant name="VAR_LINEAR_ACCELERATION" value="5">
- </constant>
- <constant name="VAR_DRAG" value="6">
- </constant>
- <constant name="VAR_TANGENTIAL_ACCELERATION" value="7">
- </constant>
- <constant name="VAR_INITIAL_SIZE" value="9">
- </constant>
- <constant name="VAR_FINAL_SIZE" value="10">
- </constant>
- <constant name="VAR_INITIAL_ANGLE" value="11">
- </constant>
- <constant name="VAR_HEIGHT" value="12">
- </constant>
- <constant name="VAR_HEIGHT_SPEED_SCALE" value="13">
- </constant>
- <constant name="VAR_MAX" value="14">
+ <constant name="DRAW_ORDER_LIFETIME" value="1">
</constant>
</constants>
</class>
-<class name="Particles2D" inherits="Node2D" category="Core">
+<class name="ParticlesMaterial" inherits="Material" category="Core">
<brief_description>
- 2D Particle emitter
</brief_description>
<description>
- Particles2D is a particle system 2D [Node] that is used to simulate several types of particle effects, such as explosions, rain, snow, fireflies, or other magical-like shinny sparkles. Particles are drawn using impostors, and given their dynamic behavior, the user must provide a visibility AABB (although helpers to create one automatically exist).
</description>
<methods>
- <method name="get_amount" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the amount of particles spawned at each emission
- </description>
- </method>
<method name="get_color" qualifiers="const">
<return type="Color">
</return>
<description>
- Returns the tint color for each particle.
- </description>
- </method>
- <method name="get_color_phase_color" qualifiers="const">
- <return type="Color">
- </return>
- <argument index="0" name="phase" type="int">
- </argument>
- <description>
</description>
</method>
- <method name="get_color_phase_pos" qualifiers="const">
- <return type="float">
+ <method name="get_color_ramp" qualifiers="const">
+ <return type="Texture">
</return>
- <argument index="0" name="phase" type="int">
- </argument>
<description>
</description>
</method>
- <method name="get_color_phases" qualifiers="const">
- <return type="int">
+ <method name="get_emission_box_extents" qualifiers="const">
+ <return type="Vector3">
</return>
<description>
</description>
</method>
- <method name="get_color_ramp" qualifiers="const">
- <return type="ColorRamp">
+ <method name="get_emission_color_texture" qualifiers="const">
+ <return type="Texture">
</return>
<description>
- Returns the [ColorRamp] used to tint each particle
</description>
</method>
- <method name="get_emission_half_extents" qualifiers="const">
- <return type="Vector2">
+ <method name="get_emission_normal_texture" qualifiers="const">
+ <return type="Texture">
</return>
<description>
- Returns the half extents of the emission box.
</description>
</method>
- <method name="get_emission_points" qualifiers="const">
- <return type="Vector2Array">
+ <method name="get_emission_point_count" qualifiers="const">
+ <return type="int">
</return>
<description>
</description>
</method>
- <method name="get_emissor_offset" qualifiers="const">
- <return type="Vector2">
+ <method name="get_emission_point_texture" qualifiers="const">
+ <return type="Texture">
</return>
<description>
- Returns the particle spawn origin position relative to the emitter.
</description>
</method>
- <method name="get_emit_timeout" qualifiers="const">
- <return type="float">
+ <method name="get_emission_shape" qualifiers="const">
+ <return type="int">
</return>
<description>
- Returns the amount of seconds during which the emitter will spawn particles
</description>
</method>
- <method name="get_explosiveness" qualifiers="const">
+ <method name="get_emission_sphere_radius" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_h_frames" qualifiers="const">
- <return type="int">
+ <method name="get_flag" qualifiers="const">
+ <return type="bool">
</return>
+ <argument index="0" name="flag" type="int">
+ </argument>
<description>
</description>
</method>
- <method name="get_initial_velocity" qualifiers="const">
- <return type="Vector2">
+ <method name="get_flatness" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="get_lifetime" qualifiers="const">
- <return type="float">
+ <method name="get_gravity" qualifiers="const">
+ <return type="Vector3">
</return>
<description>
- Gets the amount of seconds that each particle will be visible.
</description>
</method>
<method name="get_param" qualifiers="const">
@@ -26076,193 +29836,120 @@
<argument index="0" name="param" type="int">
</argument>
<description>
- Returns the value of the specified emitter parameter
- </description>
- </method>
- <method name="get_pre_process_time" qualifiers="const">
- <return type="float">
- </return>
- <description>
</description>
</method>
- <method name="get_randomness" qualifiers="const">
+ <method name="get_param_randomness" qualifiers="const">
<return type="float">
</return>
<argument index="0" name="param" type="int">
</argument>
<description>
- Returns the randomness value of the specified emitter parameter
</description>
</method>
- <method name="get_texture" qualifiers="const">
- <return type="Texture">
+ <method name="get_param_texture" qualifiers="const">
+ <return type="Object">
</return>
+ <argument index="0" name="param" type="int">
+ </argument>
<description>
- Returns the texture for emitted particles
</description>
</method>
- <method name="get_time_scale" qualifiers="const">
+ <method name="get_spread" qualifiers="const">
<return type="float">
</return>
<description>
- Returns the emitter time scale
- </description>
- </method>
- <method name="get_v_frames" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="is_emitting" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Returns whether this emitter is currently emitting or not
</description>
</method>
- <method name="is_flipped_h" qualifiers="const">
- <return type="bool">
+ <method name="get_trail_color_modifier" qualifiers="const">
+ <return type="GradientTexture">
</return>
<description>
</description>
</method>
- <method name="is_flipped_v" qualifiers="const">
- <return type="bool">
+ <method name="get_trail_divisor" qualifiers="const">
+ <return type="int">
</return>
<description>
</description>
</method>
- <method name="is_using_local_space" qualifiers="const">
- <return type="bool">
+ <method name="get_trail_size_modifier" qualifiers="const">
+ <return type="CurveTexture">
</return>
<description>
</description>
</method>
- <method name="pre_process">
- <argument index="0" name="time" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="reset">
- <description>
- </description>
- </method>
- <method name="set_amount">
- <argument index="0" name="amount" type="int">
- </argument>
- <description>
- Sets the amount of particles spawned at each emission
- </description>
- </method>
<method name="set_color">
<argument index="0" name="color" type="Color">
</argument>
<description>
- Set the tint color for each particle.
- </description>
- </method>
- <method name="set_color_phase_color">
- <argument index="0" name="phase" type="int">
- </argument>
- <argument index="1" name="color" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_color_phase_pos">
- <argument index="0" name="phase" type="int">
- </argument>
- <argument index="1" name="pos" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_color_phases">
- <argument index="0" name="phases" type="int">
- </argument>
- <description>
</description>
</method>
<method name="set_color_ramp">
- <return type="ColorRamp">
- </return>
- <argument index="0" name="color_ramp" type="Object">
+ <argument index="0" name="ramp" type="Texture">
</argument>
<description>
- Sets the [ColorRamp] used to tint each particle. Particle will be tinted according to their lifetimes.
</description>
</method>
- <method name="set_emission_half_extents">
- <argument index="0" name="extents" type="Vector2">
+ <method name="set_emission_box_extents">
+ <argument index="0" name="extents" type="Vector3">
</argument>
<description>
- Sets the half extents of the emission box, particles will be spawned at random inside this box.
</description>
</method>
- <method name="set_emission_points">
- <argument index="0" name="points" type="Vector2Array">
+ <method name="set_emission_color_texture">
+ <argument index="0" name="texture" type="Texture">
</argument>
<description>
</description>
</method>
- <method name="set_emissor_offset">
- <argument index="0" name="offset" type="Vector2">
+ <method name="set_emission_normal_texture">
+ <argument index="0" name="texture" type="Texture">
</argument>
<description>
- Sets the particle spawn origin position relative to the emitter center. for example if this value is set to (50, 50), the particle will spawn 50 units to the right and 50 units to the bottom of the emitter center.
</description>
</method>
- <method name="set_emit_timeout">
- <argument index="0" name="value" type="float">
+ <method name="set_emission_point_count">
+ <argument index="0" name="point_count" type="int">
</argument>
<description>
- Sets the amount of seconds during which the emitter will spawn particles, after the specified seconds the emitter state will be set to non emitting, so calling [method is_emitting] will return false. If the timeout is 0 the emitter will spawn forever.
</description>
</method>
- <method name="set_emitting">
- <argument index="0" name="active" type="bool">
+ <method name="set_emission_point_texture">
+ <argument index="0" name="texture" type="Texture">
</argument>
<description>
- If this is set to true then the particle emitter will emit particles, if its false it will not.
</description>
</method>
- <method name="set_explosiveness">
- <argument index="0" name="amount" type="float">
+ <method name="set_emission_shape">
+ <argument index="0" name="shape" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_flip_h">
- <argument index="0" name="enable" type="bool">
+ <method name="set_emission_sphere_radius">
+ <argument index="0" name="radius" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_flip_v">
- <argument index="0" name="enable" type="bool">
+ <method name="set_flag">
+ <argument index="0" name="flag" type="int">
</argument>
- <description>
- </description>
- </method>
- <method name="set_h_frames">
- <argument index="0" name="enable" type="int">
+ <argument index="1" name="enable" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_initial_velocity">
- <argument index="0" name="velocity" type="Vector2">
+ <method name="set_flatness">
+ <argument index="0" name="amount" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_lifetime">
- <argument index="0" name="lifetime" type="float">
+ <method name="set_gravity">
+ <argument index="0" name="accel_vec" type="Vector3">
</argument>
<description>
- Sets the amount of seconds that each particle will be visible.
</description>
</method>
<method name="set_param">
@@ -26271,180 +29958,202 @@
<argument index="1" name="value" type="float">
</argument>
<description>
- Sets the value of the specified emitter parameter (see the constants secction for the list of parameters)
</description>
</method>
- <method name="set_pre_process_time">
- <argument index="0" name="time" type="float">
+ <method name="set_param_randomness">
+ <argument index="0" name="param" type="int">
+ </argument>
+ <argument index="1" name="randomness" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_randomness">
+ <method name="set_param_texture">
<argument index="0" name="param" type="int">
</argument>
- <argument index="1" name="value" type="float">
+ <argument index="1" name="texture" type="Object">
</argument>
<description>
- Sets the randomness value of the specified emitter parameter (see the constants secction for the list of parameters), 0 means no randomness, so every particle will have the parameters specified, 1 means that the parameter will be chosen at random, the closer the randomness value gets to 0 the more conservative the variation of the parameter will be.
</description>
</method>
- <method name="set_texture">
- <return type="Texture">
- </return>
- <argument index="0" name="texture" type="Object">
+ <method name="set_spread">
+ <argument index="0" name="degrees" type="float">
</argument>
<description>
- Sets the texture for each particle
</description>
</method>
- <method name="set_time_scale">
- <argument index="0" name="time_scale" type="float">
+ <method name="set_trail_color_modifier">
+ <argument index="0" name="texture" type="GradientTexture">
</argument>
<description>
- Sets the increment or decrement for the particle lifetime. for example: if the time scale is set to 2, the particles will die and move twice as fast.
</description>
</method>
- <method name="set_use_local_space">
- <argument index="0" name="enable" type="bool">
+ <method name="set_trail_divisor">
+ <argument index="0" name="divisor" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_v_frames">
- <argument index="0" name="enable" type="int">
+ <method name="set_trail_size_modifier">
+ <argument index="0" name="texture" type="CurveTexture">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="angle" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angle_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief="">
+ </member>
+ <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="angular_velocity" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_velocity_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief="">
+ </member>
+ <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="anim_loop" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="anim_offset" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="anim_offset_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief="">
+ </member>
+ <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="anim_speed" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="anim_speed_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief="">
+ </member>
+ <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="color" type="Color" setter="set_color" getter="get_color" brief="">
+ </member>
+ <member name="color_ramp" type="GradientTexture" setter="set_color_ramp" getter="get_color_ramp" brief="">
+ </member>
+ <member name="damping" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="damping_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief="">
+ </member>
+ <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="emission_box_extents" type="Vector3" setter="set_emission_box_extents" getter="get_emission_box_extents" brief="">
+ </member>
+ <member name="emission_color_texture" type="Texture" setter="set_emission_color_texture" getter="get_emission_color_texture" brief="">
+ </member>
+ <member name="emission_normal_texture" type="Texture" setter="set_emission_normal_texture" getter="get_emission_normal_texture" brief="">
+ </member>
+ <member name="emission_point_count" type="int" setter="set_emission_point_count" getter="get_emission_point_count" brief="">
+ </member>
+ <member name="emission_point_texture" type="Texture" setter="set_emission_point_texture" getter="get_emission_point_texture" brief="">
+ </member>
+ <member name="emission_shape" type="int" setter="set_emission_shape" getter="get_emission_shape" brief="">
+ </member>
+ <member name="emission_sphere_radius" type="float" setter="set_emission_sphere_radius" getter="get_emission_sphere_radius" brief="">
+ </member>
+ <member name="flag_align_y" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="flag_disable_z" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="flag_rotate_y" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="flatness" type="float" setter="set_flatness" getter="get_flatness" brief="">
+ </member>
+ <member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" brief="">
+ </member>
+ <member name="hue_variation" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="hue_variation_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief="">
+ </member>
+ <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="initial_velocity" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="initial_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="linear_accel" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_accel_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief="">
+ </member>
+ <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="orbit_velocity" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="orbit_velocity_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief="">
+ </member>
+ <member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="radial_accel" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="radial_accel_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief="">
+ </member>
+ <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="scale" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="scale_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief="">
+ </member>
+ <member name="scale_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="spread" type="float" setter="set_spread" getter="get_spread" brief="">
+ </member>
+ <member name="tangential_accel" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="tangential_accel_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief="">
+ </member>
+ <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief="">
+ </member>
+ <member name="trail_color_modifier" type="GradientTexture" setter="set_trail_color_modifier" getter="get_trail_color_modifier" brief="">
+ </member>
+ <member name="trail_divisor" type="int" setter="set_trail_divisor" getter="get_trail_divisor" brief="">
+ </member>
+ <member name="trail_size_modifier" type="CurveTexture" setter="set_trail_size_modifier" getter="get_trail_size_modifier" brief="">
+ </member>
+ </members>
<constants>
- <constant name="PARAM_DIRECTION" value="0">
- Direction in degrees at which the particles will be launched, Notice that when the direction is set to 0 the particles will be launched to the negative
+ <constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0">
</constant>
- <constant name="PARAM_SPREAD" value="1">
+ <constant name="PARAM_ANGULAR_VELOCITY" value="1">
</constant>
- <constant name="PARAM_LINEAR_VELOCITY" value="2">
- Velocity at which the particles will be launched.
+ <constant name="PARAM_ORBIT_VELOCITY" value="2">
</constant>
- <constant name="PARAM_SPIN_VELOCITY" value="3">
- The speed at which particles will spin around its own center.
+ <constant name="PARAM_LINEAR_ACCEL" value="3">
</constant>
- <constant name="PARAM_ORBIT_VELOCITY" value="4">
- Velocity at which the particles will orbit around the emitter center
+ <constant name="PARAM_RADIAL_ACCEL" value="4">
</constant>
- <constant name="PARAM_GRAVITY_DIRECTION" value="5">
- Direction in degrees at which the particles will be attracted
+ <constant name="PARAM_TANGENTIAL_ACCEL" value="5">
</constant>
- <constant name="PARAM_GRAVITY_STRENGTH" value="6">
- Strength of the gravitation attraction for each particle
+ <constant name="PARAM_DAMPING" value="6">
</constant>
- <constant name="PARAM_RADIAL_ACCEL" value="7">
+ <constant name="PARAM_ANGLE" value="7">
</constant>
- <constant name="PARAM_TANGENTIAL_ACCEL" value="8">
+ <constant name="PARAM_SCALE" value="8">
</constant>
- <constant name="PARAM_DAMPING" value="9">
- Amount of damping for each particle
+ <constant name="PARAM_HUE_VARIATION" value="9">
</constant>
- <constant name="PARAM_INITIAL_ANGLE" value="10">
- Initial angle in radians at which each particle will be spawned
+ <constant name="PARAM_ANIM_SPEED" value="10">
</constant>
- <constant name="PARAM_INITIAL_SIZE" value="11">
- Initial size of each particle
+ <constant name="PARAM_ANIM_OFFSET" value="11">
</constant>
- <constant name="PARAM_FINAL_SIZE" value="12">
- Final size of each particle, the particle size will interpolate to this value during its lifetime.
+ <constant name="PARAM_MAX" value="12">
</constant>
- <constant name="PARAM_HUE_VARIATION" value="13">
+ <constant name="FLAG_ALIGN_Y_TO_VELOCITY" value="0">
</constant>
- <constant name="PARAM_ANIM_SPEED_SCALE" value="14">
+ <constant name="FLAG_ROTATE_Y" value="1">
</constant>
- <constant name="PARAM_ANIM_INITIAL_POS" value="15">
+ <constant name="FLAG_MAX" value="4">
</constant>
- <constant name="PARAM_MAX" value="16">
+ <constant name="EMISSION_SHAPE_POINT" value="0">
</constant>
- <constant name="MAX_COLOR_PHASES" value="4">
+ <constant name="EMISSION_SHAPE_SPHERE" value="1">
+ </constant>
+ <constant name="EMISSION_SHAPE_BOX" value="2">
+ </constant>
+ <constant name="EMISSION_SHAPE_POINTS" value="3">
+ </constant>
+ <constant name="EMISSION_SHAPE_DIRECTED_POINTS" value="4">
</constant>
- </constants>
-</class>
-<class name="Patch9Rect" inherits="Control" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- <method name="get_draw_center" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
- <method name="get_modulate" qualifiers="const">
- <return type="Color">
- </return>
- <description>
- </description>
- </method>
- <method name="get_patch_margin" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="margin" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_region_rect" qualifiers="const">
- <return type="Rect2">
- </return>
- <description>
- </description>
- </method>
- <method name="get_texture" qualifiers="const">
- <return type="Object">
- </return>
- <description>
- </description>
- </method>
- <method name="set_draw_center">
- <argument index="0" name="draw_center" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_modulate">
- <argument index="0" name="modulate" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_patch_margin">
- <argument index="0" name="margin" type="int">
- </argument>
- <argument index="1" name="value" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_region_rect">
- <argument index="0" name="rect" type="Rect2">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_texture">
- <argument index="0" name="texture" type="Object">
- </argument>
- <description>
- </description>
- </method>
- </methods>
- <signals>
- <signal name="texture_changed">
- <description>
- </description>
- </signal>
- </signals>
- <constants>
</constants>
</class>
<class name="Path" inherits="Spatial" category="Core">
@@ -26470,6 +30179,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="curve" type="Curve3D" setter="set_curve" getter="get_curve" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -26496,6 +30209,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="curve" type="Curve2D" setter="set_curve" getter="get_curve" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -26739,59 +30456,6 @@
<constants>
</constants>
</class>
-<class name="PathRemap" inherits="Object" category="Core">
- <brief_description>
- Singleton containing the list of remapped resources.
- </brief_description>
- <description>
- When exporting, the types of some resources may change internally so they are converted to more optimized versions. While it's not usually necessary to access to this directly (path remapping happens automatically when opening a file), it's exported just for information.
- </description>
- <methods>
- <method name="add_remap">
- <argument index="0" name="from" type="String">
- </argument>
- <argument index="1" name="to" type="String">
- </argument>
- <argument index="2" name="locale" type="String" default="&quot;&quot;">
- </argument>
- <description>
- Add a remap from a file to another.
- </description>
- </method>
- <method name="clear_remaps">
- <description>
- Clear all remaps.
- </description>
- </method>
- <method name="erase_remap">
- <argument index="0" name="path" type="String">
- </argument>
- <description>
- Erase a remap.
- </description>
- </method>
- <method name="get_remap" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="path" type="String">
- </argument>
- <description>
- Return the remapped new path of a file.
- </description>
- </method>
- <method name="has_remap" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="path" type="String">
- </argument>
- <description>
- Return true if a file is being remapped.
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
<class name="Performance" inherits="Object" category="Core">
<brief_description>
</brief_description>
@@ -27035,7 +30699,7 @@
</description>
</method>
<method name="get_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Return the transform matrix of the body.
@@ -27075,7 +30739,7 @@
</description>
</method>
<method name="set_transform">
- <argument index="0" name="transform" type="Matrix32">
+ <argument index="0" name="transform" type="Transform2D">
</argument>
<description>
Change the transform matrix of the body.
@@ -27151,9 +30815,9 @@
</argument>
<argument index="1" name="max_results" type="int" default="32">
</argument>
- <argument index="2" name="exclude" type="Array" default="Array()">
+ <argument index="2" name="exclude" type="Array" default="[]">
</argument>
- <argument index="3" name="layer_mask" type="int" default="2147483647">
+ <argument index="3" name="collision_layer" type="int" default="2147483647">
</argument>
<argument index="4" name="type_mask" type="int" default="15">
</argument>
@@ -27164,7 +30828,7 @@
collider_id: Id of the object the point is in.
collider: Object the point is inside of.
rid: [RID] of the object the point is in.
- Additionally, the method can take an array of objects or [RID]s that are to be excluded from collisions, a bitmask representing the physics layers to check in, and another bitmask for the types of objects to check (see TYPE_MASK_* constants).
+ Additionally, the method can take an array of objects or [RID]\ s that are to be excluded from collisions, a bitmask representing the physics layers to check in, and another bitmask for the types of objects to check (see TYPE_MASK_* constants).
</description>
</method>
<method name="intersect_ray">
@@ -27174,9 +30838,9 @@
</argument>
<argument index="1" name="to" type="Vector2">
</argument>
- <argument index="2" name="exclude" type="Array" default="Array()">
+ <argument index="2" name="exclude" type="Array" default="[]">
</argument>
- <argument index="3" name="layer_mask" type="int" default="2147483647">
+ <argument index="3" name="collision_layer" type="int" default="2147483647">
</argument>
<argument index="4" name="type_mask" type="int" default="15">
</argument>
@@ -27190,7 +30854,7 @@
collider: Object against which the ray was stopped.
rid: [RID] of the object against which the ray was stopped.
If the ray did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead.
- Additionally, the method can take an array of objects or [RID]s that are to be excluded from collisions, a bitmask representing the physics layers to check in, and another bitmask for the types of objects to check (see TYPE_MASK_* constants).
+ Additionally, the method can take an array of objects or [RID]\ s that are to be excluded from collisions, a bitmask representing the physics layers to check in, and another bitmask for the types of objects to check (see TYPE_MASK_* constants).
</description>
</method>
<method name="intersect_shape">
@@ -27245,13 +30909,13 @@
</argument>
<argument index="1" name="shape" type="RID">
</argument>
- <argument index="2" name="transform" type="Matrix32" default="((1, 0), (0, 1), (0, 0))">
+ <argument index="2" name="transform" type="Transform2D" default="((1, 0), (0, 1), (0, 0))">
</argument>
<description>
Add a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
</description>
</method>
- <method name="area_attach_object_instance_ID">
+ <method name="area_attach_object_instance_id">
<argument index="0" name="area" type="RID">
</argument>
<argument index="1" name="id" type="int">
@@ -27274,7 +30938,7 @@
Create an [Area2D].
</description>
</method>
- <method name="area_get_object_instance_ID" qualifiers="const">
+ <method name="area_get_object_instance_id" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="area" type="RID">
@@ -27313,7 +30977,7 @@
</description>
</method>
<method name="area_get_shape_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<argument index="0" name="area" type="RID">
</argument>
@@ -27342,7 +31006,7 @@
</description>
</method>
<method name="area_get_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<argument index="0" name="area" type="RID">
</argument>
@@ -27359,22 +31023,22 @@
Remove a shape from an area. It does not delete the shape, so it can be reassigned later.
</description>
</method>
- <method name="area_set_collision_mask">
+ <method name="area_set_collision_layer">
<argument index="0" name="area" type="RID">
</argument>
- <argument index="1" name="mask" type="int">
+ <argument index="1" name="layer" type="int">
</argument>
<description>
- Set which physics layers the area will monitor.
+ Assign the area to one or many physics layers.
</description>
</method>
- <method name="area_set_layer_mask">
+ <method name="area_set_collision_mask">
<argument index="0" name="area" type="RID">
</argument>
<argument index="1" name="mask" type="int">
</argument>
<description>
- Assign the area to one or many physics layers.
+ Set which physics layers the area will monitor.
</description>
</method>
<method name="area_set_monitor_callback">
@@ -27415,12 +31079,22 @@
Substitute a given area shape by another. The old shape is selected by its index, the new one by its [RID].
</description>
</method>
+ <method name="area_set_shape_disabled">
+ <argument index="0" name="area" type="RID">
+ </argument>
+ <argument index="1" name="shape_idx" type="int">
+ </argument>
+ <argument index="2" name="disable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="area_set_shape_transform">
<argument index="0" name="area" type="RID">
</argument>
<argument index="1" name="shape_idx" type="int">
</argument>
- <argument index="2" name="transform" type="Matrix32">
+ <argument index="2" name="transform" type="Transform2D">
</argument>
<description>
Set the transform matrix for an area shape.
@@ -27447,7 +31121,7 @@
<method name="area_set_transform">
<argument index="0" name="area" type="RID">
</argument>
- <argument index="1" name="transform" type="Matrix32">
+ <argument index="1" name="transform" type="Transform2D">
</argument>
<description>
Set the transform matrix for an area.
@@ -27478,7 +31152,7 @@
</argument>
<argument index="1" name="shape" type="RID">
</argument>
- <argument index="2" name="transform" type="Matrix32" default="((1, 0), (0, 1), (0, 0))">
+ <argument index="2" name="transform" type="Transform2D" default="((1, 0), (0, 1), (0, 0))">
</argument>
<description>
Add a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
@@ -27495,7 +31169,7 @@
Add a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates.
</description>
</method>
- <method name="body_attach_object_instance_ID">
+ <method name="body_attach_object_instance_id">
<argument index="0" name="body" type="RID">
</argument>
<argument index="1" name="id" type="int">
@@ -27522,31 +31196,31 @@
Create a physics body. The first parameter can be any value from constants BODY_MODE*, for the type of body created. Additionally, the body can be created in sleeping state to save processing time.
</description>
</method>
- <method name="body_get_collision_mask" qualifiers="const">
+ <method name="body_get_collision_layer" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="body" type="RID">
</argument>
<description>
- Return the physics layer or layers a body can collide with.
+ Return the physics layer or layers a body belongs to.
</description>
</method>
- <method name="body_get_continuous_collision_detection_mode" qualifiers="const">
+ <method name="body_get_collision_mask" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="body" type="RID">
</argument>
<description>
- Return the continuous collision detection mode.
+ Return the physics layer or layers a body can collide with.
</description>
</method>
- <method name="body_get_layer_mask" qualifiers="const">
+ <method name="body_get_continuous_collision_detection_mode" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="body" type="RID">
</argument>
<description>
- Return the physics layer or layers a body belongs to.
+ Return the continuous collision detection mode.
</description>
</method>
<method name="body_get_max_contacts_reported" qualifiers="const">
@@ -27567,7 +31241,7 @@
Return the body mode.
</description>
</method>
- <method name="body_get_object_instance_ID" qualifiers="const">
+ <method name="body_get_object_instance_id" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="body" type="RID">
@@ -27576,24 +31250,6 @@
Get the instance ID of the object the area is assigned to.
</description>
</method>
- <method name="body_get_one_way_collision_direction" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="body" type="RID">
- </argument>
- <description>
- Return the direction used for one-way collision detection.
- </description>
- </method>
- <method name="body_get_one_way_collision_max_depth" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="body" type="RID">
- </argument>
- <description>
- Return how far a body can go through the given one, when it allows one-way collisions.
- </description>
- </method>
<method name="body_get_param" qualifiers="const">
<return type="float">
</return>
@@ -27635,7 +31291,7 @@
</description>
</method>
<method name="body_get_shape_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<argument index="0" name="body" type="RID">
</argument>
@@ -27672,17 +31328,6 @@
Return whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
</description>
</method>
- <method name="body_is_shape_set_as_trigger" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="body" type="RID">
- </argument>
- <argument index="1" name="shape_idx" type="int">
- </argument>
- <description>
- Return whether a body's shape is marked as a trigger.
- </description>
- </method>
<method name="body_remove_collision_exception">
<argument index="0" name="body" type="RID">
</argument>
@@ -27710,6 +31355,15 @@
Set an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior.
</description>
</method>
+ <method name="body_set_collision_layer">
+ <argument index="0" name="body" type="RID">
+ </argument>
+ <argument index="1" name="layer" type="int">
+ </argument>
+ <description>
+ Set the physics layer or layers a body belongs to.
+ </description>
+ </method>
<method name="body_set_collision_mask">
<argument index="0" name="body" type="RID">
</argument>
@@ -27742,15 +31396,6 @@
Set the function used to calculate physics for an object, if that object allows it (see [method body_set_omit_force integration]).
</description>
</method>
- <method name="body_set_layer_mask">
- <argument index="0" name="body" type="RID">
- </argument>
- <argument index="1" name="mask" type="int">
- </argument>
- <description>
- Set the physics layer or layers a body belongs to.
- </description>
- </method>
<method name="body_set_max_contacts_reported">
<argument index="0" name="body" type="RID">
</argument>
@@ -27778,24 +31423,6 @@
Set whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
</description>
</method>
- <method name="body_set_one_way_collision_direction">
- <argument index="0" name="body" type="RID">
- </argument>
- <argument index="1" name="normal" type="Vector2">
- </argument>
- <description>
- Set a direction in which bodies can go through the given one. If this value is different from (0,0), any movement within 90 degrees of this vector is considered a valid movement. Set this direction to (0,0) to disable one-way collisions.
- </description>
- </method>
- <method name="body_set_one_way_collision_max_depth">
- <argument index="0" name="body" type="RID">
- </argument>
- <argument index="1" name="depth" type="float">
- </argument>
- <description>
- Set how far a body can go through the given one, if it allows one-way collisions (see [method body_set_one_way_collision_direction]).
- </description>
- </method>
<method name="body_set_param">
<argument index="0" name="body" type="RID">
</argument>
@@ -27818,7 +31445,7 @@
Substitute a given body shape by another. The old shape is selected by its index, the new one by its [RID].
</description>
</method>
- <method name="body_set_shape_as_trigger">
+ <method name="body_set_shape_as_one_way_collision">
<argument index="0" name="body" type="RID">
</argument>
<argument index="1" name="shape_idx" type="int">
@@ -27826,7 +31453,16 @@
<argument index="2" name="enable" type="bool">
</argument>
<description>
- Mark a body's shape as a trigger. A trigger shape cannot affect other bodies, but detects other shapes entering and exiting it.
+ </description>
+ </method>
+ <method name="body_set_shape_disabled">
+ <argument index="0" name="body" type="RID">
+ </argument>
+ <argument index="1" name="shape_idx" type="int">
+ </argument>
+ <argument index="2" name="disable" type="bool">
+ </argument>
+ <description>
</description>
</method>
<method name="body_set_shape_metadata">
@@ -27845,7 +31481,7 @@
</argument>
<argument index="1" name="shape_idx" type="int">
</argument>
- <argument index="2" name="transform" type="Matrix32">
+ <argument index="2" name="transform" type="Transform2D">
</argument>
<description>
Set the transform matrix for a body shape.
@@ -27876,7 +31512,7 @@
</return>
<argument index="0" name="body" type="RID">
</argument>
- <argument index="1" name="from" type="Matrix32">
+ <argument index="1" name="from" type="Transform2D">
</argument>
<argument index="2" name="motion" type="Vector2">
</argument>
@@ -27897,7 +31533,7 @@
</argument>
<argument index="2" name="body_a" type="RID">
</argument>
- <argument index="3" name="body_b" type="RID" default="RID()">
+ <argument index="3" name="body_b" type="RID" default="[RID]">
</argument>
<description>
Create a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself.
@@ -27950,9 +31586,9 @@
</argument>
<argument index="2" name="anchor_b" type="Vector2">
</argument>
- <argument index="3" name="body_a" type="RID" default="RID()">
+ <argument index="3" name="body_a" type="RID" default="[RID]">
</argument>
- <argument index="4" name="body_b" type="RID" default="RID()">
+ <argument index="4" name="body_b" type="RID" default="[RID]">
</argument>
<description>
Create a groove joint between two bodies. If not specified, the bodyies are assumed to be the joint itself.
@@ -27996,7 +31632,7 @@
</argument>
<argument index="1" name="body_a" type="RID">
</argument>
- <argument index="2" name="body_b" type="RID" default="RID()">
+ <argument index="2" name="body_b" type="RID" default="[RID]">
</argument>
<description>
Create a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself.
@@ -28110,11 +31746,9 @@
<constant name="SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION" value="2">
Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision.
</constant>
- <constant name="SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD" value="3">
- Constant to set/get the linear velocity threshold. Bodies slower than this will be marked as potentially inactive.
+ <constant name="SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD" value="3">
</constant>
- <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD" value="4">
- Constant to set/get the angular velocity threshold. Bodies slower than this will be marked as potentially inactive.
+ <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD" value="4">
</constant>
<constant name="SPACE_PARAM_BODY_TIME_TO_SLEEP" value="5">
Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time.
@@ -28300,18 +31934,18 @@
This class contains the shape and other parameters for intersection/collision queries.
</description>
<methods>
- <method name="get_exclude" qualifiers="const">
- <return type="Array">
+ <method name="get_collision_layer" qualifiers="const">
+ <return type="int">
</return>
<description>
- Return the list of objects, or object [RID]s, that will be excluded from collisions.
+ Return the physics layer the shape belongs to.
</description>
</method>
- <method name="get_layer_mask" qualifiers="const">
- <return type="int">
+ <method name="get_exclude" qualifiers="const">
+ <return type="Array">
</return>
<description>
- Return the physics layer(s) the shape belongs to.
+ Return the list of objects, or object [RID]\ s, that will be excluded from collisions.
</description>
</method>
<method name="get_margin" qualifiers="const">
@@ -28343,24 +31977,24 @@
</description>
</method>
<method name="get_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Return the transform matrix of the shape queried.
</description>
</method>
- <method name="set_exclude">
- <argument index="0" name="exclude" type="Array">
+ <method name="set_collision_layer">
+ <argument index="0" name="collision_layer" type="int">
</argument>
<description>
- Set the list of objects, or object [RID]s, that will be excluded from collisions.
+ Set the physics layer the shape belongs to.
</description>
</method>
- <method name="set_layer_mask">
- <argument index="0" name="layer_mask" type="int">
+ <method name="set_exclude">
+ <argument index="0" name="exclude" type="Array">
</argument>
<description>
- Set the physics layer(s) the shape belongs to.
+ Set the list of objects, or object [RID]\ s, that will be excluded from collisions.
</description>
</method>
<method name="set_margin">
@@ -28399,7 +32033,7 @@
</description>
</method>
<method name="set_transform">
- <argument index="0" name="transform" type="Matrix32">
+ <argument index="0" name="transform" type="Transform2D">
</argument>
<description>
Set the transormation matrix of the shape. This is necessary to set its position/rotation/scale.
@@ -28535,13 +32169,13 @@
<description>
</description>
</method>
- <method name="get_collision_mask" qualifiers="const">
+ <method name="get_collision_layer" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="get_collision_mask_bit" qualifiers="const">
+ <method name="get_collision_layer_bit" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="bit" type="int">
@@ -28549,13 +32183,13 @@
<description>
</description>
</method>
- <method name="get_layer_mask" qualifiers="const">
+ <method name="get_collision_mask" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="get_layer_mask_bit" qualifiers="const">
+ <method name="get_collision_mask_bit" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="bit" type="int">
@@ -28569,13 +32203,13 @@
<description>
</description>
</method>
- <method name="set_collision_mask">
- <argument index="0" name="mask" type="int">
+ <method name="set_collision_layer">
+ <argument index="0" name="layer" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_collision_mask_bit">
+ <method name="set_collision_layer_bit">
<argument index="0" name="bit" type="int">
</argument>
<argument index="1" name="value" type="bool">
@@ -28583,13 +32217,13 @@
<description>
</description>
</method>
- <method name="set_layer_mask">
+ <method name="set_collision_mask">
<argument index="0" name="mask" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_layer_mask_bit">
+ <method name="set_collision_mask_bit">
<argument index="0" name="bit" type="int">
</argument>
<argument index="1" name="value" type="bool">
@@ -28598,6 +32232,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief="">
+ </member>
+ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -28616,14 +32256,14 @@
Adds a body to the collision exception list. This list contains bodies that this body will not collide with.
</description>
</method>
- <method name="get_collision_mask" qualifiers="const">
+ <method name="get_collision_layer" qualifiers="const">
<return type="int">
</return>
<description>
- Return the physics layers this area can scan for collisions.
+ Return the physics layer this area is in.
</description>
</method>
- <method name="get_collision_mask_bit" qualifiers="const">
+ <method name="get_collision_layer_bit" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="bit" type="int">
@@ -28632,14 +32272,14 @@
Return an individual bit on the collision mask.
</description>
</method>
- <method name="get_layer_mask" qualifiers="const">
+ <method name="get_collision_mask" qualifiers="const">
<return type="int">
</return>
<description>
- Return the physics layer this area is in.
+ Return the physics layers this area can scan for collisions.
</description>
</method>
- <method name="get_layer_mask_bit" qualifiers="const">
+ <method name="get_collision_mask_bit" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="bit" type="int">
@@ -28648,20 +32288,6 @@
Return an individual bit on the collision mask.
</description>
</method>
- <method name="get_one_way_collision_direction" qualifiers="const">
- <return type="Vector2">
- </return>
- <description>
- Return the direction used for one-way collision detection.
- </description>
- </method>
- <method name="get_one_way_collision_max_depth" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return how far a body can go through this one, when it allows one-way collisions.
- </description>
- </method>
<method name="remove_collision_exception_with">
<argument index="0" name="body" type="PhysicsBody2D">
</argument>
@@ -28669,24 +32295,8 @@
Removes a body from the collision exception list.
</description>
</method>
- <method name="set_collision_mask">
- <argument index="0" name="mask" type="int">
- </argument>
- <description>
- Set the physics layers this area can scan for collisions.
- </description>
- </method>
- <method name="set_collision_mask_bit">
- <argument index="0" name="bit" type="int">
- </argument>
- <argument index="1" name="value" type="bool">
- </argument>
- <description>
- Set/clear individual bits on the collision mask. This makes selecting the areas scanned easier.
- </description>
- </method>
- <method name="set_layer_mask">
- <argument index="0" name="mask" type="int">
+ <method name="set_collision_layer">
+ <argument index="0" name="layer" type="int">
</argument>
<description>
Set the physics layers this area is in.
@@ -28694,7 +32304,7 @@
A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.
</description>
</method>
- <method name="set_layer_mask_bit">
+ <method name="set_collision_layer_bit">
<argument index="0" name="bit" type="int">
</argument>
<argument index="1" name="value" type="bool">
@@ -28703,21 +32313,31 @@
Set/clear individual bits on the layer mask. This makes getting a body in/out of only one layer easier.
</description>
</method>
- <method name="set_one_way_collision_direction">
- <argument index="0" name="dir" type="Vector2">
+ <method name="set_collision_mask">
+ <argument index="0" name="mask" type="int">
</argument>
<description>
- Set a direction in which bodies can go through this one. If this value is different from (0,0), any movement within 90 degrees of this vector is considered a valid movement. Set this direction to (0,0) to disable one-way collisions.
+ Set the physics layers this area can scan for collisions.
</description>
</method>
- <method name="set_one_way_collision_max_depth">
- <argument index="0" name="depth" type="float">
+ <method name="set_collision_mask_bit">
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <argument index="1" name="value" type="bool">
</argument>
<description>
- Set how far a body can go through this one, when it allows one-way collisions (see [method set_one_way_collision_direction]).
+ Set/clear individual bits on the collision mask. This makes selecting the areas scanned easier.
</description>
</method>
</methods>
+ <members>
+ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief="">
+ </member>
+ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief="">
+ </member>
+ <member name="layers" type="int" setter="_set_layers" getter="_get_layers" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -28743,7 +32363,7 @@
<description>
</description>
</method>
- <method name="apply_torque_impulse">
+ <method name="apply_torqe_impulse">
<argument index="0" name="j" type="Vector3">
</argument>
<description>
@@ -28756,7 +32376,7 @@
</description>
</method>
<method name="get_center_of_mass" qualifiers="const">
- <return type="Vector3"/>
+ <return type="Vector3">
</return>
<description>
</description>
@@ -28839,7 +32459,7 @@
<description>
</description>
</method>
- <method name="get_inverse_inertia_tensor" qualifiers="const">
+ <method name="get_inverse_inertia" qualifiers="const">
<return type="Vector3">
</return>
<description>
@@ -28857,8 +32477,8 @@
<description>
</description>
</method>
- <method name="get_principal_inertia_axes">
- <return type="Matrix3">
+ <method name="get_principal_inetria_axes" qualifiers="const">
+ <return type="Basis">
</return>
<description>
</description>
@@ -28988,9 +32608,9 @@
</argument>
<argument index="1" name="to" type="Vector3">
</argument>
- <argument index="2" name="exclude" type="Array" default="Array()">
+ <argument index="2" name="exclude" type="Array" default="[]">
</argument>
- <argument index="3" name="layer_mask" type="int" default="2147483647">
+ <argument index="3" name="collision_layer" type="int" default="2147483647">
</argument>
<argument index="4" name="type_mask" type="int" default="15">
</argument>
@@ -29039,7 +32659,7 @@
<description>
</description>
</method>
- <method name="area_attach_object_instance_ID">
+ <method name="area_attach_object_instance_id">
<argument index="0" name="area" type="RID">
</argument>
<argument index="1" name="id" type="int">
@@ -29059,7 +32679,7 @@
<description>
</description>
</method>
- <method name="area_get_object_instance_ID" qualifiers="const">
+ <method name="area_get_object_instance_id" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="area" type="RID">
@@ -29143,15 +32763,15 @@
<description>
</description>
</method>
- <method name="area_set_collision_mask">
+ <method name="area_set_collision_layer">
<argument index="0" name="area" type="RID">
</argument>
- <argument index="1" name="mask" type="int">
+ <argument index="1" name="layer" type="int">
</argument>
<description>
</description>
</method>
- <method name="area_set_layer_mask">
+ <method name="area_set_collision_mask">
<argument index="0" name="area" type="RID">
</argument>
<argument index="1" name="mask" type="int">
@@ -29259,7 +32879,15 @@
<description>
</description>
</method>
- <method name="body_attach_object_instance_ID">
+ <method name="body_apply_torque_impulse">
+ <argument index="0" name="body" type="RID">
+ </argument>
+ <argument index="1" name="impulse" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="body_attach_object_instance_id">
<argument index="0" name="body" type="RID">
</argument>
<argument index="1" name="id" type="int">
@@ -29291,23 +32919,19 @@
<description>
</description>
</method>
- <method name="body_get_collision_mask" qualifiers="const">
+ <method name="body_get_collision_layer" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="body" type="RID">
</argument>
- <argument index="1" name="arg1" type="int">
- </argument>
<description>
</description>
</method>
- <method name="body_get_layer_mask" qualifiers="const">
+ <method name="body_get_collision_mask" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="body" type="RID">
</argument>
- <argument index="1" name="arg1" type="int">
- </argument>
<description>
</description>
</method>
@@ -29327,7 +32951,7 @@
<description>
</description>
</method>
- <method name="body_get_object_instance_ID" qualifiers="const">
+ <method name="body_get_object_instance_id" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="body" type="RID">
@@ -29445,6 +33069,14 @@
<description>
</description>
</method>
+ <method name="body_set_collision_layer">
+ <argument index="0" name="body" type="RID">
+ </argument>
+ <argument index="1" name="layer" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="body_set_collision_mask">
<argument index="0" name="body" type="RID">
</argument>
@@ -29473,14 +33105,6 @@
<description>
</description>
</method>
- <method name="body_set_layer_mask">
- <argument index="0" name="body" type="RID">
- </argument>
- <argument index="1" name="mask" type="int">
- </argument>
- <description>
- </description>
- </method>
<method name="body_set_max_contacts_reported">
<argument index="0" name="body" type="RID">
</argument>
@@ -29777,7 +33401,7 @@
<description>
</description>
</method>
- <method name="pin_joint_get_local_A" qualifiers="const">
+ <method name="pin_joint_get_local_a" qualifiers="const">
<return type="Vector3">
</return>
<argument index="0" name="joint" type="RID">
@@ -29785,7 +33409,7 @@
<description>
</description>
</method>
- <method name="pin_joint_get_local_B" qualifiers="const">
+ <method name="pin_joint_get_local_b" qualifiers="const">
<return type="Vector3">
</return>
<argument index="0" name="joint" type="RID">
@@ -29803,7 +33427,7 @@
<description>
</description>
</method>
- <method name="pin_joint_set_local_A">
+ <method name="pin_joint_set_local_a">
<argument index="0" name="joint" type="RID">
</argument>
<argument index="1" name="local_A" type="Vector3">
@@ -29811,7 +33435,7 @@
<description>
</description>
</method>
- <method name="pin_joint_set_local_B">
+ <method name="pin_joint_set_local_b">
<argument index="0" name="joint" type="RID">
</argument>
<argument index="1" name="local_B" type="Vector3">
@@ -30172,14 +33796,14 @@
<description>
</description>
<methods>
- <method name="get_exclude" qualifiers="const">
- <return type="Array">
+ <method name="get_collision_layer" qualifiers="const">
+ <return type="int">
</return>
<description>
</description>
</method>
- <method name="get_layer_mask" qualifiers="const">
- <return type="int">
+ <method name="get_exclude" qualifiers="const">
+ <return type="Array">
</return>
<description>
</description>
@@ -30208,14 +33832,14 @@
<description>
</description>
</method>
- <method name="set_exclude">
- <argument index="0" name="exclude" type="Array">
+ <method name="set_collision_layer">
+ <argument index="0" name="collision_layer" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_layer_mask">
- <argument index="0" name="layer_mask" type="int">
+ <method name="set_exclude">
+ <argument index="0" name="exclude" type="Array">
</argument>
<description>
</description>
@@ -30326,6 +33950,14 @@
</description>
</method>
</methods>
+ <members>
+ <member name="params/bias" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="params/damping" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="params/impulse_clamp" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ </members>
<constants>
<constant name="PARAM_BIAS" value="0">
</constant>
@@ -30356,6 +33988,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="softness" type="float" setter="set_softness" getter="get_softness" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -30500,15 +34136,69 @@
</method>
</methods>
<members>
- <member name="d" type="float">
+ <member name="d" type="float" setter="" getter="" brief="">
</member>
- <member name="normal" type="Vector3">
+ <member name="normal" type="Vector3" setter="" getter="" brief="">
</member>
- <member name="x" type="float">
+ <member name="x" type="float" setter="" getter="" brief="">
</member>
- <member name="y" type="float">
+ <member name="y" type="float" setter="" getter="" brief="">
</member>
- <member name="z" type="float">
+ <member name="z" type="float" setter="" getter="" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="PlaneMesh" inherits="PrimitiveMesh" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_size" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_subdivide_depth" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_subdivide_width" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_size">
+ <argument index="0" name="size" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_subdivide_depth">
+ <argument index="0" name="subdivide" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_subdivide_width">
+ <argument index="0" name="subdivide" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="size" type="Vector2" setter="set_size" getter="get_size" brief="">
+ </member>
+ <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" brief="">
+ </member>
+ <member name="subdivide_width" type="int" setter="set_subdivide_width" getter="get_subdivide_width" brief="">
</member>
</members>
<constants>
@@ -30533,6 +34223,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="plane" type="Plane" setter="set_plane" getter="get_plane" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -30573,7 +34267,7 @@
</description>
</method>
<method name="get_polygon" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<description>
Return the set of vertices that defines this polygon.
@@ -30608,14 +34302,14 @@
</description>
</method>
<method name="get_uv" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<description>
Return the texture coordinates associated with every vertex of the polygon.
</description>
</method>
<method name="get_vertex_colors" qualifiers="const">
- <return type="ColorArray">
+ <return type="PoolColorArray">
</return>
<description>
Return the list of vertex colors.
@@ -30650,7 +34344,7 @@
</description>
</method>
<method name="set_polygon">
- <argument index="0" name="polygon" type="Vector2Array">
+ <argument index="0" name="polygon" type="PoolVector2Array">
</argument>
<description>
Define the set of vertices that will represent the polygon.
@@ -30685,14 +34379,14 @@
</description>
</method>
<method name="set_uv">
- <argument index="0" name="uv" type="Vector2Array">
+ <argument index="0" name="uv" type="PoolVector2Array">
</argument>
<description>
Set the texture coordinates for every vertex of the polygon. There should be one uv vertex for every vertex in the polygon. If there are less, the undefined ones will be assumed to be (0,0). Extra uv vertices are ignored.
</description>
</method>
<method name="set_vertex_colors">
- <argument index="0" name="vertex_colors" type="ColorArray">
+ <argument index="0" name="vertex_colors" type="PoolColorArray">
</argument>
<description>
Set the color for each vertex of the polygon. There should be one color for every vertex in the polygon. If there are less, the undefined ones will be assumed to be [method get_color]. Extra color entries are ignored.
@@ -30700,6 +34394,30 @@
</description>
</method>
</methods>
+ <members>
+ <member name="color" type="Color" setter="set_color" getter="get_color" brief="">
+ </member>
+ <member name="invert_border" type="float" setter="set_invert_border" getter="get_invert_border" brief="">
+ </member>
+ <member name="invert_enable" type="bool" setter="set_invert" getter="get_invert" brief="">
+ </member>
+ <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" brief="">
+ </member>
+ <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" brief="">
+ </member>
+ <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="texture_offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" brief="">
+ </member>
+ <member name="texture_rotation" type="float" setter="_set_texture_rotationd" getter="_get_texture_rotationd" brief="">
+ </member>
+ <member name="texture_scale" type="Vector2" setter="set_texture_scale" getter="get_texture_scale" brief="">
+ </member>
+ <member name="uv" type="PoolVector2Array" setter="set_uv" getter="get_uv" brief="">
+ </member>
+ <member name="vertex_colors" type="PoolColorArray" setter="set_vertex_colors" getter="get_vertex_colors" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -30710,7 +34428,7 @@
</description>
<methods>
<method name="find_path">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<argument index="0" name="from" type="Vector2">
</argument>
@@ -30734,7 +34452,7 @@
</description>
</method>
<method name="get_intersections" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<argument index="0" name="from" type="Vector2">
</argument>
@@ -30768,14 +34486,686 @@
</description>
</method>
<method name="setup">
- <argument index="0" name="points" type="Vector2Array">
+ <argument index="0" name="points" type="PoolVector2Array">
</argument>
- <argument index="1" name="connections" type="IntArray">
+ <argument index="1" name="connections" type="PoolIntArray">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="PoolByteArray" category="Built-In Types">
+ <brief_description>
+ Raw byte array.
+ </brief_description>
+ <description>
+ Raw byte array. Contains bytes. Optimized for memory usage, can't fragment the memory.
+ </description>
+ <methods>
+ <method name="PoolByteArray">
+ <return type="PoolByteArray">
+ </return>
+ <argument index="0" name="from" type="Array">
+ </argument>
+ <description>
+ Create from a generic array.
+ </description>
+ </method>
+ <method name="append">
+ <argument index="0" name="byte" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="append_array">
+ <argument index="0" name="array" type="PoolByteArray">
+ </argument>
+ <description>
+ Append an [PoolByteArray] at the end of this array.
+ </description>
+ </method>
+ <method name="compress">
+ <return type="PoolByteArray">
+ </return>
+ <argument index="0" name="compression_mode" type="int" default="0">
+ </argument>
+ <description>
+ Returns a new [PoolByteArray] with the data compressed. The compression mode can be set using one of the COMPRESS_* constants of [File].
+ </description>
+ </method>
+ <method name="decompress">
+ <return type="PoolByteArray">
+ </return>
+ <argument index="0" name="buffer_size" type="int">
+ </argument>
+ <argument index="1" name="compression_mode" type="int" default="0">
+ </argument>
+ <description>
+ Returns a new [PoolByteArray] with the data decompressed. The buffer_size should be set as the size of the uncompressed data. The compression mode can be set using one of the COMPRESS_* constants of [File].
+ </description>
+ </method>
+ <method name="get_string_from_ascii">
+ <return type="String">
+ </return>
+ <description>
+ Returns a copy of the array's contents formatted as String. Fast alternative to get_string_from_utf8(), assuming the content is ASCII-only (unlike the UTF-8 function, this function maps every byte to a character in the string, so any multibyte sequence will be torn apart).
+ </description>
+ </method>
+ <method name="get_string_from_utf8">
+ <return type="String">
+ </return>
+ <description>
+ Returns a copy of the array's contents formatted as String, assuming the array is formatted as UTF-8. Slower than get_string_from_ascii(), but works for UTF-8. Usually you should prefer this function over get_string_from_ascii() to support international input.
+ </description>
+ </method>
+ <method name="insert">
+ <return type="int">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="byte" type="int">
+ </argument>
+ <description>
+ Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
+ </description>
+ </method>
+ <method name="invert">
+ <description>
+ Reverse the order of the elements in the array (so first element will now be the last).
+ </description>
+ </method>
+ <method name="push_back">
+ <argument index="0" name="byte" type="int">
+ </argument>
+ <description>
+ Append an element at the end of the array.
+ </description>
+ </method>
+ <method name="remove">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Remove an element from the array by index.
+ </description>
+ </method>
+ <method name="resize">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Set the size of the [PoolByteArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
+ </description>
+ </method>
+ <method name="set">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="byte" type="int">
+ </argument>
+ <description>
+ Change the byte at the given index.
+ </description>
+ </method>
+ <method name="size">
+ <return type="int">
+ </return>
+ <description>
+ Return the size of the array.
+ </description>
+ </method>
+ <method name="subarray">
+ <return type="PoolByteArray">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ Returns the slice of the [PoolByteArray] between indices (inclusive) as a new [PoolByteArray]. Any negative index is considered to be from the end of the array.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="PoolColorArray" category="Built-In Types">
+ <brief_description>
+ Array of Colors
+ </brief_description>
+ <description>
+ Array of Color, can only contains colors. Optimized for memory usage, can't fragment the memory.
+ </description>
+ <methods>
+ <method name="PoolColorArray">
+ <return type="PoolColorArray">
+ </return>
+ <argument index="0" name="from" type="Array">
+ </argument>
+ <description>
+ Create from a generic array.
+ </description>
+ </method>
+ <method name="append">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ Append an element at the end of the array (alias of [method push_back]).
+ </description>
+ </method>
+ <method name="append_array">
+ <argument index="0" name="array" type="PoolColorArray">
+ </argument>
+ <description>
+ Append an [PoolColorArray] at the end of this array.
+ </description>
+ </method>
+ <method name="insert">
+ <return type="int">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="color" type="Color">
+ </argument>
+ <description>
+ Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
+ </description>
+ </method>
+ <method name="invert">
+ <description>
+ Reverse the order of the elements in the array (so first element will now be the last).
+ </description>
+ </method>
+ <method name="push_back">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ Append a value to the array.
+ </description>
+ </method>
+ <method name="remove">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Remove an element from the array by index.
+ </description>
+ </method>
+ <method name="resize">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Set the size of the [PoolColorArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
+ </description>
+ </method>
+ <method name="set">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="color" type="Color">
+ </argument>
+ <description>
+ Change the [Color] at the given index.
+ </description>
+ </method>
+ <method name="size">
+ <return type="int">
+ </return>
+ <description>
+ Return the array size.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="PoolIntArray" category="Built-In Types">
+ <brief_description>
+ Integer Array.
+ </brief_description>
+ <description>
+ Integer Array. Array of integers. Can only contain integers. Optimized for memory usage, can't fragment the memory.
+ </description>
+ <methods>
+ <method name="PoolIntArray">
+ <return type="PoolIntArray">
+ </return>
+ <argument index="0" name="from" type="Array">
+ </argument>
+ <description>
+ Create from a generic array.
+ </description>
+ </method>
+ <method name="append">
+ <argument index="0" name="integer" type="int">
+ </argument>
+ <description>
+ Append an element at the end of the array (alias of [method push_back]).
+ </description>
+ </method>
+ <method name="append_array">
+ <argument index="0" name="array" type="PoolIntArray">
+ </argument>
+ <description>
+ Append an [PoolIntArray] at the end of this array.
+ </description>
+ </method>
+ <method name="insert">
+ <return type="int">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="integer" type="int">
+ </argument>
+ <description>
+ Insert a new int at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
+ </description>
+ </method>
+ <method name="invert">
+ <description>
+ Reverse the order of the elements in the array (so first element will now be the last).
+ </description>
+ </method>
+ <method name="push_back">
+ <argument index="0" name="integer" type="int">
+ </argument>
+ <description>
+ Append a value to the array.
+ </description>
+ </method>
+ <method name="remove">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Remove an element from the array by index.
+ </description>
+ </method>
+ <method name="resize">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Set the size of the [PoolIntArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
+ </description>
+ </method>
+ <method name="set">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="integer" type="int">
+ </argument>
+ <description>
+ Change the int at the given index.
+ </description>
+ </method>
+ <method name="size">
+ <return type="int">
+ </return>
+ <description>
+ Return the array size.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="PoolRealArray" category="Built-In Types">
+ <brief_description>
+ Real Array.
+ </brief_description>
+ <description>
+ Real Array. Array of floating point values. Can only contain floats. Optimized for memory usage, can't fragment the memory.
+ </description>
+ <methods>
+ <method name="PoolRealArray">
+ <return type="PoolRealArray">
+ </return>
+ <argument index="0" name="from" type="Array">
+ </argument>
+ <description>
+ Create from a generic array.
+ </description>
+ </method>
+ <method name="append">
+ <argument index="0" name="value" type="float">
+ </argument>
+ <description>
+ Append an element at the end of the array (alias of [method push_back]).
+ </description>
+ </method>
+ <method name="append_array">
+ <argument index="0" name="array" type="PoolRealArray">
+ </argument>
+ <description>
+ Append an [RealArray] at the end of this array.
+ </description>
+ </method>
+ <method name="insert">
+ <return type="int">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="value" type="float">
+ </argument>
+ <description>
+ Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
+ </description>
+ </method>
+ <method name="invert">
+ <description>
+ Reverse the order of the elements in the array (so first element will now be the last).
+ </description>
+ </method>
+ <method name="push_back">
+ <argument index="0" name="value" type="float">
+ </argument>
+ <description>
+ Append an element at the end of the array.
+ </description>
+ </method>
+ <method name="remove">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Remove an element from the array by index.
+ </description>
+ </method>
+ <method name="resize">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Set the size of the [RealArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
+ </description>
+ </method>
+ <method name="set">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="value" type="float">
+ </argument>
+ <description>
+ Change the float at the given index.
+ </description>
+ </method>
+ <method name="size">
+ <return type="int">
+ </return>
+ <description>
+ Return the size of the array.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="PoolStringArray" category="Built-In Types">
+ <brief_description>
+ String Array.
+ </brief_description>
+ <description>
+ String Array. Array of strings. Can only contain strings. Optimized for memory usage, can't fragment the memory.
+ </description>
+ <methods>
+ <method name="PoolStringArray">
+ <return type="PoolStringArray">
+ </return>
+ <argument index="0" name="from" type="Array">
+ </argument>
+ <description>
+ Create from a generic array.
+ </description>
+ </method>
+ <method name="append">
+ <argument index="0" name="string" type="String">
+ </argument>
+ <description>
+ Append an element at the end of the array (alias of [method push_back]).
+ </description>
+ </method>
+ <method name="append_array">
+ <argument index="0" name="array" type="PoolStringArray">
+ </argument>
+ <description>
+ Append an [StringArray] at the end of this array.
+ </description>
+ </method>
+ <method name="insert">
+ <return type="int">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="string" type="String">
+ </argument>
+ <description>
+ Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
+ </description>
+ </method>
+ <method name="invert">
+ <description>
+ </description>
+ </method>
+ <method name="join">
+ <return type="String">
+ </return>
+ <argument index="0" name="string" type="String">
+ </argument>
+ <description>
+ Reverse the order of the elements in the array (so first element will now be the last).
+ </description>
+ </method>
+ <method name="push_back">
+ <argument index="0" name="string" type="String">
+ </argument>
+ <description>
+ Append a string element at end of the array.
+ </description>
+ </method>
+ <method name="remove">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Remove an element from the array by index.
+ </description>
+ </method>
+ <method name="resize">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Set the size of the [StringArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
+ </description>
+ </method>
+ <method name="set">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="string" type="String">
+ </argument>
+ <description>
+ Change the [String] at the given index.
+ </description>
+ </method>
+ <method name="size">
+ <return type="int">
+ </return>
+ <description>
+ Return the size of the array.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="PoolVector2Array" category="Built-In Types">
+ <brief_description>
+ An Array of Vector2.
+ </brief_description>
+ <description>
+ An Array specifically designed to hold Vector2.
+ </description>
+ <methods>
+ <method name="PoolVector2Array">
+ <return type="PoolVector2Array">
+ </return>
+ <argument index="0" name="from" type="Array">
+ </argument>
+ <description>
+ Construct a new [PoolVector2Array]. Optionally, you can pass in an Array that will be converted.
+ </description>
+ </method>
+ <method name="append">
+ <argument index="0" name="vector2" type="Vector2">
+ </argument>
+ <description>
+ Append an element at the end of the array (alias of [method push_back]).
+ </description>
+ </method>
+ <method name="append_array">
+ <argument index="0" name="array" type="PoolVector2Array">
+ </argument>
+ <description>
+ Append an [PoolVector2Array] at the end of this array.
+ </description>
+ </method>
+ <method name="insert">
+ <return type="int">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="vector2" type="Vector2">
+ </argument>
+ <description>
+ Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
+ </description>
+ </method>
+ <method name="invert">
+ <description>
+ Reverse the order of the elements in the array (so first element will now be the last).
+ </description>
+ </method>
+ <method name="push_back">
+ <argument index="0" name="vector2" type="Vector2">
+ </argument>
+ <description>
+ Insert a [Vector2] at the end.
+ </description>
+ </method>
+ <method name="remove">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Remove an element from the array by index.
+ </description>
+ </method>
+ <method name="resize">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Set the size of the PoolVector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
+ </description>
+ </method>
+ <method name="set">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="vector2" type="Vector2">
+ </argument>
+ <description>
+ Change the [Vector2] at the given index.
+ </description>
+ </method>
+ <method name="size">
+ <return type="int">
+ </return>
+ <description>
+ Return the size of the array.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="PoolVector3Array" category="Built-In Types">
+ <brief_description>
+ An Array of Vector3.
+ </brief_description>
+ <description>
+ An Array specifically designed to hold Vector3.
+ </description>
+ <methods>
+ <method name="PoolVector3Array">
+ <return type="PoolVector3Array">
+ </return>
+ <argument index="0" name="from" type="Array">
+ </argument>
+ <description>
+ Construct a new PoolVector3Array. Optionally, you can pass in an Array that will be converted.
+ </description>
+ </method>
+ <method name="append">
+ <argument index="0" name="vector3" type="Vector3">
+ </argument>
+ <description>
+ Append an element at the end of the array (alias of [method push_back]).
+ </description>
+ </method>
+ <method name="append_array">
+ <argument index="0" name="array" type="PoolVector3Array">
+ </argument>
+ <description>
+ Append an [PoolVector3Array] at the end of this array.
+ </description>
+ </method>
+ <method name="insert">
+ <return type="int">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="vector3" type="Vector3">
+ </argument>
+ <description>
+ Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
+ </description>
+ </method>
+ <method name="invert">
+ <description>
+ Reverse the order of the elements in the array (so first element will now be the last).
+ </description>
+ </method>
+ <method name="push_back">
+ <argument index="0" name="vector3" type="Vector3">
+ </argument>
+ <description>
+ Insert a Vector3 at the end.
+ </description>
+ </method>
+ <method name="remove">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Remove an element from the array by index.
+ </description>
+ </method>
+ <method name="resize">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Set the size of the PoolVector3Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
+ </description>
+ </method>
+ <method name="set">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="vector3" type="Vector3">
+ </argument>
+ <description>
+ Change the [Vector3] at the given index.
+ </description>
+ </method>
+ <method name="size">
+ <return type="int">
+ </return>
+ <description>
+ Return the size of the array.
+ </description>
+ </method>
+ </methods>
<constants>
</constants>
</class>
@@ -30795,6 +35185,8 @@
</description>
</method>
<method name="popup">
+ <argument index="0" name="bounds" type="Rect2" default="Rect2(0, 0, 0, 0)">
+ </argument>
<description>
Popup (show the control in modal form).
</description>
@@ -30828,6 +35220,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="popup_exclusive" type="bool" setter="set_exclusive" getter="is_exclusive" brief="">
+ </member>
+ </members>
<signals>
<signal name="about_to_show">
<description>
@@ -30885,6 +35281,8 @@
</argument>
<argument index="1" name="id" type="int" default="-1">
</argument>
+ <argument index="2" name="global" type="bool" default="false">
+ </argument>
<description>
</description>
</method>
@@ -30908,6 +35306,8 @@
</argument>
<argument index="2" name="id" type="int" default="-1">
</argument>
+ <argument index="3" name="global" type="bool" default="false">
+ </argument>
<description>
</description>
</method>
@@ -30931,6 +35331,8 @@
</argument>
<argument index="2" name="id" type="int" default="-1">
</argument>
+ <argument index="3" name="global" type="bool" default="false">
+ </argument>
<description>
</description>
</method>
@@ -30955,6 +35357,8 @@
</argument>
<argument index="1" name="id" type="int" default="-1">
</argument>
+ <argument index="2" name="global" type="bool" default="false">
+ </argument>
<description>
</description>
</method>
@@ -30974,14 +35378,7 @@
Clear the popup menu, in effect removing all items.
</description>
</method>
- <method name="is_hide_on_item_selection">
- <return type="bool">
- </return>
- <description>
- Returns a boolean that indicates whether or not the PopupMenu will hide on item selection.
- </description>
- </method>
- <method name="get_item_ID" qualifiers="const">
+ <method name="get_item_id" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="idx" type="int">
@@ -31025,6 +35422,8 @@
</description>
</method>
<method name="get_item_metadata" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="idx" type="int">
</argument>
<description>
@@ -31057,6 +35456,28 @@
Return the text of the item at index "idx".
</description>
</method>
+ <method name="get_item_tooltip" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="is_hide_on_checkable_item_selection">
+ <return type="bool">
+ </return>
+ <description>
+ Returns a boolean that indicates whether or not the PopupMenu will hide on checkable item selection.
+ </description>
+ </method>
+ <method name="is_hide_on_item_selection">
+ <return type="bool">
+ </return>
+ <description>
+ Returns a boolean that indicates whether or not the PopupMenu will hide on item selection.
+ </description>
+ </method>
<method name="is_item_checkable" qualifiers="const">
<return type="bool">
</return>
@@ -31100,6 +35521,13 @@
Removes the item at index "idx" from the menu. Note that the indexes of items after the removed item are going to be shifted by one.
</description>
</method>
+ <method name="set_hide_on_checkable_item_selection">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ Sets whether or not the PopupMenu will hide on checkable item selection.
+ </description>
+ </method>
<method name="set_hide_on_item_selection">
<argument index="0" name="enable" type="bool">
</argument>
@@ -31107,7 +35535,7 @@
Sets whether or not the PopupMenu will hide on item selection.
</description>
</method>
- <method name="set_item_ID">
+ <method name="set_item_id">
<argument index="0" name="idx" type="int">
</argument>
<argument index="1" name="id" type="int">
@@ -31184,6 +35612,8 @@
</argument>
<argument index="1" name="shortcut" type="ShortCut">
</argument>
+ <argument index="2" name="global" type="bool" default="false">
+ </argument>
<description>
</description>
</method>
@@ -31205,13 +35635,42 @@
Set the text of the item at index "idx".
</description>
</method>
+ <method name="set_item_tooltip">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="tooltip" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="toggle_item_checked">
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="hide_on_checkable_item_selection" type="bool" setter="set_hide_on_checkable_item_selection" getter="is_hide_on_checkable_item_selection" brief="">
+ </member>
+ <member name="hide_on_item_selection" type="bool" setter="set_hide_on_item_selection" getter="is_hide_on_item_selection" brief="">
+ </member>
+ <member name="items" type="Array" setter="_set_items" getter="_get_items" brief="">
+ </member>
+ </members>
<signals>
- <signal name="item_pressed">
+ <signal name="id_pressed">
<argument index="0" name="ID" type="int">
</argument>
<description>
- This even is emitted when an item is pressed or its accelerator is activated. The id of the item is returned if it exists, else the index.
+ This event is emitted when an item of some id is pressed or its accelerator is activated.
+ </description>
+ </signal>
+ <signal name="index_pressed">
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ This event is emitted when an item of some index is pressed or its accelerator is activated.
</description>
</signal>
</signals>
@@ -31294,7 +35753,7 @@
</description>
</method>
<method name="get_shape" qualifiers="const">
- <return type="Vector2Array">
+ <return type="PoolVector2Array">
</return>
<description>
Return the portal shape. The shape is an array of [Vector2] points, representing a convex polygon in the X,Y plane.
@@ -31336,7 +35795,7 @@
</description>
</method>
<method name="set_shape">
- <argument index="0" name="points" type="Vector2Array">
+ <argument index="0" name="points" type="PoolVector2Array">
</argument>
<description>
Set the portal shape. The shape is an array of [Vector2] points, representing a convex polygon in the X,Y plane.
@@ -31370,6 +35829,350 @@
<constants>
</constants>
</class>
+<class name="PrimitiveMesh" inherits="Mesh" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_material" qualifiers="const">
+ <return type="Material">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_material">
+ <argument index="0" name="material" type="Material">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="material" type="Material" setter="set_material" getter="get_material" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="PrismMesh" inherits="PrimitiveMesh" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_left_to_right" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_size" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_subdivide_depth" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_subdivide_height" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_subdivide_width" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_left_to_right">
+ <argument index="0" name="left_to_right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_size">
+ <argument index="0" name="size" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_subdivide_depth">
+ <argument index="0" name="segments" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_subdivide_height">
+ <argument index="0" name="segments" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_subdivide_width">
+ <argument index="0" name="segments" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="left_to_right" type="float" setter="set_left_to_right" getter="get_left_to_right" brief="">
+ </member>
+ <member name="size" type="Vector2" setter="set_size" getter="get_size" brief="">
+ </member>
+ <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" brief="">
+ </member>
+ <member name="subdivide_height" type="int" setter="set_subdivide_height" getter="get_subdivide_height" brief="">
+ </member>
+ <member name="subdivide_width" type="int" setter="set_subdivide_width" getter="get_subdivide_width" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="ProceduralSky" inherits="Sky" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_ground_bottom_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ground_curve" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ground_energy" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_ground_horizon_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sky_curve" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sky_energy" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sky_horizon_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sky_top_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sun_angle_max" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sun_angle_min" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sun_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sun_curve" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sun_energy" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sun_latitude" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_sun_longitude" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_texture_size" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_ground_bottom_color">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ground_curve">
+ <argument index="0" name="curve" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ground_energy">
+ <argument index="0" name="energy" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_ground_horizon_color">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sky_curve">
+ <argument index="0" name="curve" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sky_energy">
+ <argument index="0" name="energy" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sky_horizon_color">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sky_top_color">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sun_angle_max">
+ <argument index="0" name="degrees" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sun_angle_min">
+ <argument index="0" name="degrees" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sun_color">
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sun_curve">
+ <argument index="0" name="curve" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sun_energy">
+ <argument index="0" name="energy" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sun_latitude">
+ <argument index="0" name="degrees" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_sun_longitude">
+ <argument index="0" name="degrees" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_texture_size">
+ <argument index="0" name="size" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="ground_bottom_color" type="Color" setter="set_ground_bottom_color" getter="get_ground_bottom_color" brief="">
+ </member>
+ <member name="ground_curve" type="float" setter="set_ground_curve" getter="get_ground_curve" brief="">
+ </member>
+ <member name="ground_energy" type="float" setter="set_ground_energy" getter="get_ground_energy" brief="">
+ </member>
+ <member name="ground_horizon_color" type="Color" setter="set_ground_horizon_color" getter="get_ground_horizon_color" brief="">
+ </member>
+ <member name="sky_curve" type="float" setter="set_sky_curve" getter="get_sky_curve" brief="">
+ </member>
+ <member name="sky_energy" type="float" setter="set_sky_energy" getter="get_sky_energy" brief="">
+ </member>
+ <member name="sky_horizon_color" type="Color" setter="set_sky_horizon_color" getter="get_sky_horizon_color" brief="">
+ </member>
+ <member name="sky_top_color" type="Color" setter="set_sky_top_color" getter="get_sky_top_color" brief="">
+ </member>
+ <member name="sun_angle_max" type="float" setter="set_sun_angle_max" getter="get_sun_angle_max" brief="">
+ </member>
+ <member name="sun_angle_min" type="float" setter="set_sun_angle_min" getter="get_sun_angle_min" brief="">
+ </member>
+ <member name="sun_color" type="Color" setter="set_sun_color" getter="get_sun_color" brief="">
+ </member>
+ <member name="sun_curve" type="float" setter="set_sun_curve" getter="get_sun_curve" brief="">
+ </member>
+ <member name="sun_energy" type="float" setter="set_sun_energy" getter="get_sun_energy" brief="">
+ </member>
+ <member name="sun_latitude" type="float" setter="set_sun_latitude" getter="get_sun_latitude" brief="">
+ </member>
+ <member name="sun_longitude" type="float" setter="set_sun_longitude" getter="get_sun_longitude" brief="">
+ </member>
+ <member name="texture_size" type="int" setter="set_texture_size" getter="get_texture_size" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
<class name="ProgressBar" inherits="Range" category="Core">
<brief_description>
General purpose progress bar.
@@ -31391,6 +36194,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="percent_visible" type="bool" setter="set_percent_visible" getter="is_percent_visible" brief="">
+ </member>
+ </members>
<constants>
</constants>
<theme_items>
@@ -31447,6 +36254,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="grid_radius" type="Vector3" setter="set_grid_radius" getter="get_grid_radius" brief="">
+ </member>
+ </members>
<signals>
<signal name="broadcast">
<argument index="0" name="name" type="String">
@@ -31460,60 +36271,12 @@
<constants>
</constants>
</class>
-<class name="Quad" inherits="GeometryInstance" category="Core">
+<class name="QuadMesh" inherits="PrimitiveMesh" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="get_axis" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="get_offset" qualifiers="const">
- <return type="Vector2">
- </return>
- <description>
- </description>
- </method>
- <method name="get_size" qualifiers="const">
- <return type="Vector2">
- </return>
- <description>
- </description>
- </method>
- <method name="is_centered" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
- <method name="set_axis">
- <argument index="0" name="axis" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_centered">
- <argument index="0" name="centered" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_offset">
- <argument index="0" name="offset" type="Vector2">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_size">
- <argument index="0" name="size" type="Vector2">
- </argument>
- <description>
- </description>
- </method>
</methods>
<constants>
</constants>
@@ -31548,13 +36311,13 @@
<argument index="1" name="angle" type="float">
</argument>
<description>
- Returns a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.
+ Returns a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.
</description>
</method>
<method name="Quat">
<return type="Quat">
</return>
- <argument index="0" name="from" type="Matrix3">
+ <argument index="0" name="from" type="Basis">
</argument>
<description>
Returns the rotation matrix corresponding to the given quaternion.
@@ -31590,6 +36353,13 @@
Returns the inverse of the quaternion.
</description>
</method>
+ <method name="is_normalized">
+ <return type="bool">
+ </return>
+ <description>
+ Returns whether the quaternion is normalized or not.
+ </description>
+ </method>
<method name="length">
<return type="float">
</return>
@@ -31642,13 +36412,13 @@
</method>
</methods>
<members>
- <member name="w" type="float">
+ <member name="w" type="float" setter="" getter="" brief="">
</member>
- <member name="x" type="float">
+ <member name="x" type="float" setter="" getter="" brief="">
</member>
- <member name="y" type="float">
+ <member name="y" type="float" setter="" getter="" brief="">
</member>
- <member name="z" type="float">
+ <member name="z" type="float" setter="" getter="" brief="">
</member>
</members>
<constants>
@@ -31690,6 +36460,13 @@
Range is a base class for [Control] nodes that change a floating point [i]value[/i] between a [i]minimum[/i] and a [i]maximum[/i], using [i]step[/i] and [i]page[/i], for example a [ScrollBar].
</description>
<methods>
+ <method name="get_as_ratio" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Return value mapped to 0 to 1 range.
+ </description>
+ </method>
<method name="get_max" qualifiers="const">
<return type="float">
</return>
@@ -31718,39 +36495,32 @@
Return the stepping, if step is 0, stepping is disabled.
</description>
</method>
- <method name="get_unit_value" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return value mapped to 0 to 1 (unit) range.
- </description>
- </method>
- <method name="get_val" qualifiers="const">
+ <method name="get_value" qualifiers="const">
<return type="float">
</return>
<description>
- Return the current value.
</description>
</method>
- <method name="get_value" qualifiers="const">
- <return type="float">
+ <method name="is_ratio_exp" qualifiers="const">
+ <return type="bool">
</return>
<description>
</description>
</method>
- <method name="is_rounded_values" qualifiers="const">
+ <method name="is_using_rounded_values" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="is_unit_value_exp" qualifiers="const">
- <return type="bool">
- </return>
+ <method name="set_as_ratio">
+ <argument index="0" name="value" type="float">
+ </argument>
<description>
+ Set value mapped to 0 to 1 (unit) range, it will then be converted to the actual value within min and max.
</description>
</method>
- <method name="set_exp_unit_value">
+ <method name="set_exp_ratio">
<argument index="0" name="enabled" type="bool">
</argument>
<description>
@@ -31776,12 +36546,6 @@
Set page size. Page is mainly used for scrollbars or anything that controls text scrolling.
</description>
</method>
- <method name="set_rounded_values">
- <argument index="0" name="enabled" type="bool">
- </argument>
- <description>
- </description>
- </method>
<method name="set_step">
<argument index="0" name="step" type="float">
</argument>
@@ -31789,15 +36553,8 @@
Set step value. If step is 0, stepping will be disabled.
</description>
</method>
- <method name="set_unit_value">
- <argument index="0" name="value" type="float">
- </argument>
- <description>
- Set value mapped to 0 to 1 (unit) range, it will then be converted to the actual value within min and max.
- </description>
- </method>
- <method name="set_val">
- <argument index="0" name="value" type="float">
+ <method name="set_use_rounded_values">
+ <argument index="0" name="enabled" type="bool">
</argument>
<description>
</description>
@@ -31819,6 +36576,22 @@
</description>
</method>
</methods>
+ <members>
+ <member name="exp_edit" type="bool" setter="set_exp_ratio" getter="is_ratio_exp" brief="">
+ </member>
+ <member name="max_value" type="float" setter="set_max" getter="get_max" brief="">
+ </member>
+ <member name="min_value" type="float" setter="set_min" getter="get_min" brief="">
+ </member>
+ <member name="page" type="float" setter="set_page" getter="get_page" brief="">
+ </member>
+ <member name="rounded" type="bool" setter="set_use_rounded_values" getter="is_using_rounded_values" brief="">
+ </member>
+ <member name="step" type="float" setter="set_step" getter="get_step" brief="">
+ </member>
+ <member name="value" type="float" setter="set_value" getter="get_value" brief="">
+ </member>
+ </members>
<signals>
<signal name="changed">
<description>
@@ -31836,118 +36609,6 @@
<constants>
</constants>
</class>
-<class name="RawArray" category="Built-In Types">
- <brief_description>
- Raw byte array.
- </brief_description>
- <description>
- Raw byte array. Contains bytes. Optimized for memory usage, can't fragment the memory.
- </description>
- <methods>
- <method name="RawArray">
- <return type="RawArray">
- </return>
- <argument index="0" name="from" type="Array">
- </argument>
- <description>
- Create from a generic array.
- </description>
- </method>
- <method name="append">
- <argument index="0" name="byte" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="append_array">
- <argument index="0" name="array" type="RawArray">
- </argument>
- <description>
- Append an [RawArray] at the end of this array.
- </description>
- </method>
- <method name="get_string_from_ascii">
- <return type="String">
- </return>
- <description>
- Returns a copy of the array's contents formatted as String. Fast alternative to get_string_from_utf8(), assuming the content is ASCII-only (unlike the UTF-8 function, this function maps every byte to a character in the string, so any multibyte sequence will be torn apart).
- </description>
- </method>
- <method name="get_string_from_utf8">
- <return type="String">
- </return>
- <description>
- Returns a copy of the array's contents formatted as String, assuming the array is formatted as UTF-8. Slower than get_string_from_ascii(), but works for UTF-8. Usually you should prefer this function over get_string_from_ascii() to support international input.
- </description>
- </method>
- <method name="insert">
- <return type="int">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="byte" type="int">
- </argument>
- <description>
- Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
- </description>
- </method>
- <method name="invert">
- <description>
- Reverse the order of the elements in the array (so first element will now be the last).
- </description>
- </method>
- <method name="push_back">
- <argument index="0" name="byte" type="int">
- </argument>
- <description>
- Append an element at the end of the array.
- </description>
- </method>
- <method name="remove">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Remove an element from the array by index.
- </description>
- </method>
- <method name="resize">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Set the size of the [RawArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
- </description>
- </method>
- <method name="set">
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="byte" type="int">
- </argument>
- <description>
- Change the byte at the given index.
- </description>
- </method>
- <method name="size">
- <return type="int">
- </return>
- <description>
- Return the size of the array.
- </description>
- </method>
- <method name="subarray">
- <return type="RawArray">
- </return>
- <argument index="0" name="from" type="int">
- </argument>
- <argument index="1" name="to" type="int">
- </argument>
- <description>
- Returns the slice of the [RawArray] between indices (inclusive) as a new [RawArray]. Any negative index is considered to be from the end of the array.
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
<class name="RayCast" inherits="Spatial" category="Core">
<brief_description>
Query the closest object intersecting a ray.
@@ -32006,6 +36667,13 @@
Returns the collision shape of the closest object the ray is pointing to.
</description>
</method>
+ <method name="get_collision_layer" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the collision layer for this ray.
+ </description>
+ </method>
<method name="get_collision_normal" qualifiers="const">
<return type="Vector3">
</return>
@@ -32020,13 +36688,6 @@
Returns collision point. This point is in [b]global[/b] coordinate system.
</description>
</method>
- <method name="get_layer_mask" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the layer mask for this ray.
- </description>
- </method>
<method name="get_type_mask" qualifiers="const">
<return type="int">
</return>
@@ -32068,18 +36729,18 @@
Sets to which point ray should be casted. This point is in [b]local[/b] coordinate system.
</description>
</method>
- <method name="set_enabled">
- <argument index="0" name="enabled" type="bool">
+ <method name="set_collision_layer">
+ <argument index="0" name="layer" type="int">
</argument>
<description>
- Enables the RayCast2D. Only enabled raycasts will be able to query the space and report collisions.
+ Set the mask to filter objects. Only objects with at least the same mask element set will be detected.
</description>
</method>
- <method name="set_layer_mask">
- <argument index="0" name="mask" type="int">
+ <method name="set_enabled">
+ <argument index="0" name="enabled" type="bool">
</argument>
<description>
- Set the mask to filter objects. Only objects with at least the same mask element set will be detected.
+ Enables the RayCast2D. Only enabled raycasts will be able to query the space and report collisions.
</description>
</method>
<method name="set_type_mask">
@@ -32090,6 +36751,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="cast_to" type="Vector3" setter="set_cast_to" getter="get_cast_to" brief="">
+ </member>
+ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief="">
+ </member>
+ <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" brief="">
+ </member>
+ <member name="type_mask" type="int" setter="set_type_mask" getter="get_type_mask" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -32151,6 +36822,13 @@
Returns the collision shape of the closest object the ray is pointing to.
</description>
</method>
+ <method name="get_collision_layer" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the collision layer for this ray.
+ </description>
+ </method>
<method name="get_collision_normal" qualifiers="const">
<return type="Vector2">
</return>
@@ -32172,13 +36850,6 @@
Returns whether this ray should hit your parent node, if it's a body.
</description>
</method>
- <method name="get_layer_mask" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the layer mask for this ray.
- </description>
- </method>
<method name="get_type_mask" qualifiers="const">
<return type="int">
</return>
@@ -32220,6 +36891,13 @@
Sets the ray destination point, so that the ray will test from the ray's origin to [code]local_point[/code]
</description>
</method>
+ <method name="set_collision_layer">
+ <argument index="0" name="layer" type="int">
+ </argument>
+ <description>
+ Set the mask to filter objects. Only objects with at least the same mask element set will be detected.
+ </description>
+ </method>
<method name="set_enabled">
<argument index="0" name="enabled" type="bool">
</argument>
@@ -32234,13 +36912,6 @@
Toggle whether this ray should hit your parent node, if it's a body.
</description>
</method>
- <method name="set_layer_mask">
- <argument index="0" name="mask" type="int">
- </argument>
- <description>
- Set the mask to filter objects. Only objects with at least the same mask element set will be detected.
- </description>
- </method>
<method name="set_type_mask">
<argument index="0" name="mask" type="int">
</argument>
@@ -32249,6 +36920,18 @@
</description>
</method>
</methods>
+ <members>
+ <member name="cast_to" type="Vector2" setter="set_cast_to" getter="get_cast_to" brief="">
+ </member>
+ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief="">
+ </member>
+ <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" brief="">
+ </member>
+ <member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" brief="">
+ </member>
+ <member name="type_mask" type="int" setter="set_type_mask" getter="get_type_mask" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -32271,6 +36954,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="length" type="float" setter="set_length" getter="get_length" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -32297,217 +36984,354 @@
</description>
</method>
</methods>
+ <members>
+ <member name="length" type="float" setter="set_length" getter="get_length" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
-<class name="RealArray" category="Built-In Types">
+<class name="Rect2" category="Built-In Types">
<brief_description>
- Real Array .
+ 2D Axis-aligned bounding box.
</brief_description>
<description>
- Real Array. Array of floating point values. Can only contain floats. Optimized for memory usage, can't fragment the memory.
+ Rect2 provides an 2D Axis-Aligned Bounding Box. It consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
</description>
<methods>
- <method name="RealArray">
- <return type="RealArray">
+ <method name="Rect2">
+ <return type="Rect2">
</return>
- <argument index="0" name="from" type="Array">
+ <argument index="0" name="pos" type="Vector2">
+ </argument>
+ <argument index="1" name="size" type="Vector2">
</argument>
<description>
- Create from a generic array.
+ Construct a [Rect2] by position and size.
</description>
</method>
- <method name="append">
- <argument index="0" name="value" type="float">
+ <method name="Rect2">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="y" type="float">
+ </argument>
+ <argument index="2" name="width" type="float">
+ </argument>
+ <argument index="3" name="height" type="float">
</argument>
<description>
- Append an element at the end of the array (alias of [method push_back]).
+ Construct a [Rect2] by x, y, width and height.
</description>
</method>
- <method name="append_array">
- <argument index="0" name="array" type="RealArray">
+ <method name="clip">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="b" type="Rect2">
</argument>
<description>
- Append an [RealArray] at the end of this array.
+ Returns the intersection of this [Rect2] and b.
</description>
</method>
- <method name="insert">
- <return type="int">
+ <method name="encloses">
+ <return type="bool">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="b" type="Rect2">
</argument>
- <argument index="1" name="value" type="float">
+ <description>
+ Returns true if this [Rect2] completely encloses another one.
+ </description>
+ </method>
+ <method name="expand">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="to" type="Vector2">
</argument>
<description>
- Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
+ Return this [Rect2] expanded to include a given point.
</description>
</method>
- <method name="invert">
+ <method name="get_area">
+ <return type="float">
+ </return>
<description>
- Reverse the order of the elements in the array (so first element will now be the last).
+ Get the area of the [Rect2].
</description>
</method>
- <method name="push_back">
- <argument index="0" name="value" type="float">
+ <method name="grow">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="by" type="float">
</argument>
<description>
- Append an element at the end of the array.
+ Return a copy of the [Rect2] grown a given amount of units towards all the sides.
</description>
</method>
- <method name="remove">
- <argument index="0" name="idx" type="int">
+ <method name="grow_individual">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="left" type="float">
+ </argument>
+ <argument index="1" name="top" type="float">
+ </argument>
+ <argument index="2" name="right" type="float">
+ </argument>
+ <argument index="3" name=" bottom" type="float">
</argument>
<description>
- Remove an element from the array by index.
</description>
</method>
- <method name="resize">
- <argument index="0" name="idx" type="int">
+ <method name="grow_margin">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="margin" type="int">
+ </argument>
+ <argument index="1" name="by" type="float">
</argument>
<description>
- Set the size of the [RealArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description>
</method>
- <method name="set">
- <argument index="0" name="idx" type="int">
+ <method name="has_no_area">
+ <return type="bool">
+ </return>
+ <description>
+ Return true if the [Rect2] is flat or empty.
+ </description>
+ </method>
+ <method name="has_point">
+ <return type="bool">
+ </return>
+ <argument index="0" name="point" type="Vector2">
</argument>
- <argument index="1" name="value" type="float">
+ <description>
+ Return true if the [Rect2] contains a point.
+ </description>
+ </method>
+ <method name="intersects">
+ <return type="bool">
+ </return>
+ <argument index="0" name="b" type="Rect2">
</argument>
<description>
- Change the float at the given index.
+ Return true if the [Rect2] overlaps with another.
</description>
</method>
- <method name="size">
- <return type="int">
+ <method name="merge">
+ <return type="Rect2">
</return>
+ <argument index="0" name="b" type="Rect2">
+ </argument>
<description>
- Return the size of the array.
+ Combine this [Rect2] with another, a larger one is returned that contains both.
</description>
</method>
</methods>
+ <members>
+ <member name="end" type="Vector2" setter="" getter="" brief="">
+ Ending corner.
+ </member>
+ <member name="position" type="Vector2" setter="" getter="" brief="">
+ Position (starting corner).
+ </member>
+ <member name="size" type="Vector2" setter="" getter="" brief="">
+ Size from position to end.
+ </member>
+ </members>
<constants>
</constants>
</class>
-<class name="Rect2" category="Built-In Types">
+<class name="Rect3" category="Built-In Types">
<brief_description>
- 2D Axis-aligned bounding box.
+ Axis-Aligned Bounding Box.
</brief_description>
<description>
- Rect2 provides an 2D Axis-Aligned Bounding Box. It consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
+ Rect3 provides an 3D Axis-Aligned Bounding Box. It consists of a position, a size, and several utility functions. It is typically used for simple (fast) overlap tests.
</description>
<methods>
- <method name="Rect2">
- <return type="Rect2">
+ <method name="Rect3">
+ <return type="Rect3">
</return>
- <argument index="0" name="pos" type="Vector2">
+ <argument index="0" name="pos" type="Vector3">
</argument>
- <argument index="1" name="size" type="Vector2">
+ <argument index="1" name="size" type="Vector3">
</argument>
<description>
- Construct a [Rect2] by position and size.
+ Optional constructor, accepts position and size.
</description>
</method>
- <method name="Rect2">
- <return type="Rect2">
+ <method name="encloses">
+ <return type="bool">
</return>
- <argument index="0" name="x" type="float">
- </argument>
- <argument index="1" name="y" type="float">
- </argument>
- <argument index="2" name="width" type="float">
- </argument>
- <argument index="3" name="height" type="float">
+ <argument index="0" name="with" type="Rect3">
</argument>
<description>
- Construct a [Rect2] by x, y, width and height.
+ Return true if this [Rect3] completely encloses another one.
</description>
</method>
- <method name="clip">
- <return type="Rect2">
+ <method name="expand">
+ <return type="Rect3">
</return>
- <argument index="0" name="b" type="Rect2">
+ <argument index="0" name="to_point" type="Vector3">
</argument>
<description>
- Returns the intersection of this [Rect2] and b.
+ Return this [Rect3] expanded to include a given point.
</description>
</method>
- <method name="encloses">
- <return type="bool">
+ <method name="get_area">
+ <return type="float">
</return>
- <argument index="0" name="b" type="Rect2">
- </argument>
<description>
- Returns true if this [Rect2] completely encloses another one.
+ Get the area of the [Rect3].
</description>
</method>
- <method name="expand">
- <return type="Rect2">
+ <method name="get_endpoint">
+ <return type="Vector3">
</return>
- <argument index="0" name="to" type="Vector2">
+ <argument index="0" name="idx" type="int">
</argument>
<description>
- Return this [Rect2] expanded to include a given point.
+ Get the position of the 8 endpoints of the [Rect3] in space.
</description>
</method>
- <method name="get_area">
+ <method name="get_longest_axis">
+ <return type="Vector3">
+ </return>
+ <description>
+ Return the normalized longest axis of the [Rect3].
+ </description>
+ </method>
+ <method name="get_longest_axis_index">
+ <return type="int">
+ </return>
+ <description>
+ Return the index of the longest axis of the [Rect3] (according to [Vector3]::AXIS* enum).
+ </description>
+ </method>
+ <method name="get_longest_axis_size">
<return type="float">
</return>
<description>
- Get the area of the [Rect2].
+ Return the scalar length of the longest axis of the [Rect3].
+ </description>
+ </method>
+ <method name="get_shortest_axis">
+ <return type="Vector3">
+ </return>
+ <description>
+ Return the normalized shortest axis of the [Rect3].
+ </description>
+ </method>
+ <method name="get_shortest_axis_index">
+ <return type="int">
+ </return>
+ <description>
+ Return the index of the shortest axis of the [Rect3] (according to [Vector3]::AXIS* enum).
+ </description>
+ </method>
+ <method name="get_shortest_axis_size">
+ <return type="float">
+ </return>
+ <description>
+ Return the scalar length of the shortest axis of the [Rect3].
+ </description>
+ </method>
+ <method name="get_support">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="dir" type="Vector3">
+ </argument>
+ <description>
+ Return the support point in a given direction. This is useful for collision detection algorithms.
</description>
</method>
<method name="grow">
- <return type="Rect2">
+ <return type="Rect3">
</return>
<argument index="0" name="by" type="float">
</argument>
<description>
- Return a copy of the [Rect2] grown a given amount of units towards all the sides.
+ Return a copy of the [Rect3] grown a given amount of units towards all the sides.
</description>
</method>
<method name="has_no_area">
<return type="bool">
</return>
<description>
- Return true if the [Rect2] is flat or empty.
+ Return true if the [Rect3] is flat or empty.
+ </description>
+ </method>
+ <method name="has_no_surface">
+ <return type="bool">
+ </return>
+ <description>
+ Return true if the [Rect3] is empty.
</description>
</method>
<method name="has_point">
<return type="bool">
</return>
- <argument index="0" name="point" type="Vector2">
+ <argument index="0" name="point" type="Vector3">
</argument>
<description>
- Return true if the [Rect2] contains a point.
+ Return true if the [Rect3] contains a point.
+ </description>
+ </method>
+ <method name="intersection">
+ <return type="Rect3">
+ </return>
+ <argument index="0" name="with" type="Rect3">
+ </argument>
+ <description>
+ Return the intersection between two [Rect3]. An empty Rect3 (size 0,0,0) is returned on failure.
</description>
</method>
<method name="intersects">
<return type="bool">
</return>
- <argument index="0" name="b" type="Rect2">
+ <argument index="0" name="with" type="Rect3">
</argument>
<description>
- Return true if the [Rect2] overlaps with another.
+ Return true if the [Rect3] overlaps with another.
+ </description>
+ </method>
+ <method name="intersects_plane">
+ <return type="bool">
+ </return>
+ <argument index="0" name="plane" type="Plane">
+ </argument>
+ <description>
+ Return true if the [Rect3] is at both sides of a plane.
+ </description>
+ </method>
+ <method name="intersects_segment">
+ <return type="bool">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <argument index="1" name="to" type="Vector3">
+ </argument>
+ <description>
+ Return true if the [Rect3] intersects the line segment between from and to
</description>
</method>
<method name="merge">
- <return type="Rect2">
+ <return type="Rect3">
</return>
- <argument index="0" name="b" type="Rect2">
+ <argument index="0" name="with" type="Rect3">
</argument>
<description>
- Combine this [Rect2] with another, a larger one is returned that contains both.
+ Combine this [Rect3] with another, a larger one is returned that contains both.
</description>
</method>
</methods>
<members>
- <member name="end" type="Vector2">
+ <member name="end" type="Vector3" setter="" getter="" brief="">
Ending corner.
</member>
- <member name="pos" type="Vector2">
- Position (starting corner).
+ <member name="position" type="Vector3" setter="" getter="" brief="">
</member>
- <member name="size" type="Vector2">
+ <member name="size" type="Vector3" setter="" getter="" brief="">
Size from position to end.
</member>
</members>
@@ -32537,6 +37361,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="extents" type="Vector2" setter="set_extents" getter="get_extents" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -32586,7 +37414,191 @@
</theme_item>
</theme_items>
</class>
-<class name="RegEx" inherits="Reference" category="Core">
+<class name="ReflectionProbe" inherits="VisualInstance" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="are_shadows_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_cull_mask" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_extents" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_intensity" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_interior_ambient" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_interior_ambient_energy" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_interior_ambient_probe_contribution" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_max_distance" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_origin_offset" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_update_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_box_projection_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_set_as_interior" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_as_interior">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_cull_mask">
+ <argument index="0" name="layers" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_enable_box_projection">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_enable_shadows">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_extents">
+ <argument index="0" name="extents" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_intensity">
+ <argument index="0" name="intensity" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_interior_ambient">
+ <argument index="0" name="ambient" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_interior_ambient_energy">
+ <argument index="0" name="ambient_energy" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_interior_ambient_probe_contribution">
+ <argument index="0" name="ambient_probe_contribution" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_max_distance">
+ <argument index="0" name="max_distance" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_origin_offset">
+ <argument index="0" name="origin_offset" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_update_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="box_projection" type="bool" setter="set_enable_box_projection" getter="is_box_projection_enabled" brief="">
+ </member>
+ <member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" brief="">
+ </member>
+ <member name="enable_shadows" type="bool" setter="set_enable_shadows" getter="are_shadows_enabled" brief="">
+ </member>
+ <member name="extents" type="Vector2" setter="set_extents" getter="get_extents" brief="">
+ </member>
+ <member name="intensity" type="float" setter="set_intensity" getter="get_intensity" brief="">
+ </member>
+ <member name="interior_ambient_color" type="Color" setter="set_interior_ambient" getter="get_interior_ambient" brief="">
+ </member>
+ <member name="interior_ambient_contrib" type="float" setter="set_interior_ambient_probe_contribution" getter="get_interior_ambient_probe_contribution" brief="">
+ </member>
+ <member name="interior_ambient_energy" type="float" setter="set_interior_ambient_energy" getter="get_interior_ambient_energy" brief="">
+ </member>
+ <member name="interior_enable" type="bool" setter="set_as_interior" getter="is_set_as_interior" brief="">
+ </member>
+ <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" brief="">
+ </member>
+ <member name="origin_offset" type="Vector2" setter="set_origin_offset" getter="get_origin_offset" brief="">
+ </member>
+ <member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" brief="">
+ </member>
+ </members>
+ <constants>
+ <constant name="UPDATE_ONCE" value="0">
+ </constant>
+ <constant name="UPDATE_ALWAYS" value="1">
+ </constant>
+ </constants>
+</class>
+<class name="RegEx" inherits="Resource" category="Core">
<brief_description>
Simple regular expression matcher.
</brief_description>
@@ -32660,7 +37672,7 @@
</description>
</method>
<method name="search" qualifiers="const">
- <return type="Object">
+ <return type="RegExMatch">
</return>
<argument index="0" name="text" type="String">
</argument>
@@ -32690,6 +37702,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="pattern" type="String" setter="compile" getter="get_pattern" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -32779,13 +37795,73 @@
<description>
</description>
</method>
+ <method name="get_update_position" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_update_rotation" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_update_scale" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_use_global_coordinates" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="set_remote_node">
<argument index="0" name="path" type="NodePath">
</argument>
<description>
</description>
</method>
+ <method name="set_update_position">
+ <argument index="0" name="update_remote_position" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_update_rotation">
+ <argument index="0" name="update_remote_rotation" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_update_scale">
+ <argument index="0" name="update_remote_scale" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_use_global_coordinates">
+ <argument index="0" name="use_global_coordinates" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="remote_path" type="NodePath" setter="set_remote_node" getter="get_remote_node" brief="">
+ </member>
+ <member name="update_position" type="bool" setter="set_update_position" getter="get_update_position" brief="">
+ </member>
+ <member name="update_rotation" type="bool" setter="set_update_rotation" getter="get_update_rotation" brief="">
+ </member>
+ <member name="update_scale" type="bool" setter="set_update_scale" getter="get_update_scale" brief="">
+ </member>
+ <member name="use_global_coordinates" type="bool" setter="set_use_global_coordinates" getter="get_use_global_coordinates" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -32801,23 +37877,73 @@
<description>
</description>
</method>
+ <method name="get_update_position" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_update_rotation" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_update_scale" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_use_global_coordinates" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="set_remote_node">
<argument index="0" name="path" type="NodePath">
</argument>
<description>
</description>
</method>
+ <method name="set_update_position">
+ <argument index="0" name="update_remote_position" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_update_rotation">
+ <argument index="0" name="update_remote_rotation" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_update_scale">
+ <argument index="0" name="update_remote_scale" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_use_global_coordinates">
+ <argument index="0" name="use_global_coordinates" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
- <constants>
- </constants>
-</class>
-<class name="RenderTargetTexture" inherits="Texture" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
+ <members>
+ <member name="remote_path" type="NodePath" setter="set_remote_node" getter="get_remote_node" brief="">
+ </member>
+ <member name="update_position" type="bool" setter="set_update_position" getter="get_update_position" brief="">
+ </member>
+ <member name="update_rotation" type="bool" setter="set_update_rotation" getter="get_update_rotation" brief="">
+ </member>
+ <member name="update_scale" type="bool" setter="set_update_scale" getter="get_update_scale" brief="">
+ </member>
+ <member name="use_global_coordinates" type="bool" setter="set_use_global_coordinates" getter="get_use_global_coordinates" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -32829,7 +37955,11 @@
Resource is the base class for all resource types. Resources are primarily data containers. They are reference counted and freed when no longer in use. They are also loaded only once from disk, and further attempts to load the resource will return the same reference (all this in contrast to a [Node], which is not reference counted and can be instanced from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a [Node] or another resource.
</description>
<methods>
- <method name="duplicate">
+ <method name="_setup_local_to_scene" qualifiers="virtual">
+ <description>
+ </description>
+ </method>
+ <method name="duplicate" qualifiers="const">
<return type="Object">
</return>
<argument index="0" name="subresources" type="bool" default="false">
@@ -32837,8 +37967,8 @@
<description>
</description>
</method>
- <method name="get_import_metadata" qualifiers="const">
- <return type="Object">
+ <method name="get_local_scene" qualifiers="const">
+ <return type="Node">
</return>
<description>
</description>
@@ -32864,8 +37994,14 @@
Return the RID of the resource (or an empty RID). Many resources (such as [Texture], [Mesh], etc) are high level abstractions of resources stored in a server, so this function will return the original RID.
</description>
</method>
- <method name="set_import_metadata">
- <argument index="0" name="metadata" type="Object">
+ <method name="is_local_to_scene" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_local_to_scene">
+ <argument index="0" name="enable" type="bool">
</argument>
<description>
</description>
@@ -32884,6 +38020,10 @@
Set the path of the resource. This is useful mainly for editors when saving/loading, and shouldn't be changed by anything else. Fails if another [Resource] already has path "path".
</description>
</method>
+ <method name="setup_local_to_scene">
+ <description>
+ </description>
+ </method>
<method name="take_over_path">
<argument index="0" name="path" type="String">
</argument>
@@ -32892,6 +38032,14 @@
</description>
</method>
</methods>
+ <members>
+ <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" brief="">
+ </member>
+ <member name="resource_name" type="String" setter="set_name" getter="get_name" brief="">
+ </member>
+ <member name="resource_path" type="String" setter="set_path" getter="get_path" brief="">
+ </member>
+ </members>
<signals>
<signal name="changed">
<description>
@@ -32901,88 +38049,22 @@
<constants>
</constants>
</class>
-<class name="ResourceImportMetadata" inherits="Reference" category="Core">
+<class name="ResourceImporter" inherits="Reference" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="ResourceImporterOGGVorbis" inherits="ResourceImporter" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="add_source">
- <argument index="0" name="path" type="String">
- </argument>
- <argument index="1" name="md5" type="String" default="&quot;&quot;">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_editor" qualifiers="const">
- <return type="String">
- </return>
- <description>
- </description>
- </method>
- <method name="get_option" qualifiers="const">
- <argument index="0" name="key" type="String">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_options" qualifiers="const">
- <return type="StringArray">
- </return>
- <description>
- </description>
- </method>
- <method name="get_source_count" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="get_source_md5" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_source_path" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="remove_source">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_editor">
- <argument index="0" name="name" type="String">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_option">
- <argument index="0" name="key" type="String">
- </argument>
- <argument index="1" name="value" type="Variant">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_source_md5">
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="md5" type="String">
- </argument>
- <description>
- </description>
- </method>
</methods>
<constants>
</constants>
@@ -33020,7 +38102,7 @@
<return type="int">
</return>
<description>
- Poll the load. If OK is returned, this means poll will have to be called again. If ERR_EOF is returned, them the load has finished and the resource can be obtained by calling [method get_resource].
+ Poll the load. If OK is returned, this means poll will have to be called again. If ERR_FILE_EOF is returned, them the load has finished and the resource can be obtained by calling [method get_resource].
</description>
</method>
<method name="wait">
@@ -33042,7 +38124,7 @@
</description>
<methods>
<method name="get_dependencies">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="path" type="String">
</argument>
@@ -33050,7 +38132,7 @@
</description>
</method>
<method name="get_recognized_extensions_for_type">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="type" type="String">
</argument>
@@ -33078,14 +38160,6 @@
<description>
</description>
</method>
- <method name="load_import_metadata">
- <return type="ResourceImportMetadata">
- </return>
- <argument index="0" name="path" type="String">
- </argument>
- <description>
- </description>
- </method>
<method name="load_interactive">
<return type="ResourceInteractiveLoader">
</return>
@@ -33135,7 +38209,7 @@
</description>
</method>
<method name="get_resource_list" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
Return the list of resources inside the preloader.
@@ -33167,6 +38241,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="resources" type="Array" setter="_set_resources" getter="_get_resources" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -33179,7 +38257,7 @@
</description>
<methods>
<method name="get_recognized_extensions">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="type" type="Object">
</argument>
@@ -33254,6 +38332,12 @@
<description>
</description>
</method>
+ <method name="get_percent_visible" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_tab_size" qualifiers="const">
<return type="int">
</return>
@@ -33274,7 +38358,7 @@
</description>
</method>
<method name="get_v_scroll">
- <return type="Object">
+ <return type="VScrollBar">
</return>
<description>
</description>
@@ -33349,7 +38433,7 @@
</description>
</method>
<method name="push_font">
- <argument index="0" name="font" type="Object">
+ <argument index="0" name="font" type="Font">
</argument>
<description>
</description>
@@ -33382,6 +38466,14 @@
<description>
</description>
</method>
+ <method name="remove_line">
+ <return type="bool">
+ </return>
+ <argument index="0" name="arg0" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="scroll_to_line">
<argument index="0" name="line" type="int">
</argument>
@@ -33400,6 +38492,12 @@
<description>
</description>
</method>
+ <method name="set_percent_visible">
+ <argument index="0" name="percent_visible" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_scroll_active">
<argument index="0" name="active" type="bool">
</argument>
@@ -33435,6 +38533,12 @@
<description>
</description>
</method>
+ <method name="set_text">
+ <argument index="0" name="text" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_use_bbcode">
<argument index="0" name="enable" type="bool">
</argument>
@@ -33448,6 +38552,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="bbcode_enabled" type="bool" setter="set_use_bbcode" getter="is_using_bbcode" brief="">
+ </member>
+ <member name="bbcode_text" type="String" setter="set_bbcode" getter="get_bbcode" brief="">
+ </member>
+ <member name="percent_visible" type="float" setter="set_percent_visible" getter="get_percent_visible" brief="">
+ </member>
+ <member name="visible_characters" type="int" setter="set_visible_characters" getter="get_visible_characters" brief="">
+ </member>
+ </members>
<signals>
<signal name="meta_clicked">
<argument index="0" name="meta" type="Nil">
@@ -33800,15 +38914,58 @@
</description>
</method>
</methods>
+ <members>
+ <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief="">
+ </member>
+ <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" brief="">
+ </member>
+ <member name="axis_lock" type="int" setter="set_axis_lock" getter="get_axis_lock" brief="">
+ </member>
+ <member name="bounce" type="float" setter="set_bounce" getter="get_bounce" brief="">
+ </member>
+ <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" brief="">
+ </member>
+ <member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" brief="">
+ </member>
+ <member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" brief="">
+ </member>
+ <member name="continuous_cd" type="bool" setter="set_use_continuous_collision_detection" getter="is_using_continuous_collision_detection" brief="">
+ </member>
+ <member name="custom_integrator" type="bool" setter="set_use_custom_integrator" getter="is_using_custom_integrator" brief="">
+ </member>
+ <member name="friction" type="float" setter="set_friction" getter="get_friction" brief="">
+ </member>
+ <member name="gravity_scale" type="float" setter="set_gravity_scale" getter="get_gravity_scale" brief="">
+ </member>
+ <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" brief="">
+ </member>
+ <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" brief="">
+ </member>
+ <member name="mass" type="float" setter="set_mass" getter="get_mass" brief="">
+ </member>
+ <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="">
+ </member>
+ <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" brief="">
+ </member>
+ <member name="weight" type="float" setter="set_weight" getter="get_weight" brief="">
+ </member>
+ </members>
<signals>
- <signal name="body_enter">
+ <signal name="body_entered">
<argument index="0" name="body" type="Object">
</argument>
<description>
Emitted when a body enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work.
</description>
</signal>
- <signal name="body_enter_shape">
+ <signal name="body_exited">
+ <argument index="0" name="body" type="Object">
+ </argument>
+ <description>
+ Emitted when a body shape exits contact with this one. Contact monitor and contacts reported must be enabled for this to work.
+ </description>
+ </signal>
+ <signal name="body_shape_entered">
<argument index="0" name="body_id" type="int">
</argument>
<argument index="1" name="body" type="Object">
@@ -33822,14 +38979,7 @@
This signal not only receives the body that collided with this one, but also its [RID] (body_id), the shape index from the colliding body (body_shape), and the shape index from this body (local_shape) the other body collided with.
</description>
</signal>
- <signal name="body_exit">
- <argument index="0" name="body" type="Object">
- </argument>
- <description>
- Emitted when a body shape exits contact with this one. Contact monitor and contacts reported must be enabled for this to work.
- </description>
- </signal>
- <signal name="body_exit_shape">
+ <signal name="body_shape_exited">
<argument index="0" name="body_id" type="int">
</argument>
<argument index="1" name="body" type="Object">
@@ -34195,15 +39345,56 @@
</description>
</method>
</methods>
+ <members>
+ <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief="">
+ </member>
+ <member name="angular_velocity" type="float" setter="set_angular_velocity" getter="get_angular_velocity" brief="">
+ </member>
+ <member name="bounce" type="float" setter="set_bounce" getter="get_bounce" brief="">
+ </member>
+ <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" brief="">
+ </member>
+ <member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" brief="">
+ </member>
+ <member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" brief="">
+ </member>
+ <member name="continuous_cd" type="int" setter="set_continuous_collision_detection_mode" getter="get_continuous_collision_detection_mode" brief="">
+ </member>
+ <member name="custom_integrator" type="bool" setter="set_use_custom_integrator" getter="is_using_custom_integrator" brief="">
+ </member>
+ <member name="friction" type="float" setter="set_friction" getter="get_friction" brief="">
+ </member>
+ <member name="gravity_scale" type="float" setter="set_gravity_scale" getter="get_gravity_scale" brief="">
+ </member>
+ <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" brief="">
+ </member>
+ <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" brief="">
+ </member>
+ <member name="mass" type="float" setter="set_mass" getter="get_mass" brief="">
+ </member>
+ <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="">
+ </member>
+ <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" brief="">
+ </member>
+ <member name="weight" type="float" setter="set_weight" getter="get_weight" brief="">
+ </member>
+ </members>
<signals>
- <signal name="body_enter">
+ <signal name="body_entered">
<argument index="0" name="body" type="Object">
</argument>
<description>
Emitted when a body enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work.
</description>
</signal>
- <signal name="body_enter_shape">
+ <signal name="body_exited">
+ <argument index="0" name="body" type="Object">
+ </argument>
+ <description>
+ Emitted when a body exits contact with this one. Contact monitor and contacts reported must be enabled for this to work.
+ </description>
+ </signal>
+ <signal name="body_shape_entered">
<argument index="0" name="body_id" type="int">
</argument>
<argument index="1" name="body" type="Object">
@@ -34217,14 +39408,7 @@
This signal not only receives the body that collided with this one, but also its [RID] (body_id), the shape index from the colliding body (body_shape), and the shape index from this body (local_shape) the other body collided with.
</description>
</signal>
- <signal name="body_exit">
- <argument index="0" name="body" type="Object">
- </argument>
- <description>
- Emitted when a body exits contact with this one. Contact monitor and contacts reported must be enabled for this to work.
- </description>
- </signal>
- <signal name="body_exit_shape">
+ <signal name="body_shape_exited">
<argument index="0" name="body_id" type="int">
</argument>
<argument index="1" name="body" type="Object">
@@ -34276,35 +39460,23 @@
Room contains the data to define the bounds of a scene (using a BSP Tree). It is instanced by a [VisualInstance] node to create rooms. See that class documentation for more information about rooms.
</description>
<methods>
- <method name="compute_room_from_subtree">
- <description>
- </description>
- </method>
<method name="get_room" qualifiers="const">
<return type="Room">
</return>
<description>
</description>
</method>
- <method name="is_simulating_acoustics" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
<method name="set_room">
<argument index="0" name="room" type="Room">
</argument>
<description>
</description>
</method>
- <method name="set_simulate_acoustics">
- <argument index="0" name="enable" type="bool">
- </argument>
- <description>
- </description>
- </method>
</methods>
+ <members>
+ <member name="room/room" type="Area" setter="set_room" getter="get_room" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -34314,870 +39486,24 @@
<description>
</description>
<methods>
- <method name="get_bounds" qualifiers="const">
- <return type="Dictionary">
- </return>
- <description>
- </description>
- </method>
<method name="get_geometry_hint" qualifiers="const">
- <return type="Vector3Array">
+ <return type="PoolVector3Array">
</return>
<description>
</description>
</method>
- <method name="regenerate_bsp">
- <description>
- </description>
- </method>
- <method name="regenerate_bsp_cubic">
- <description>
- </description>
- </method>
- <method name="set_bounds">
- <argument index="0" name="bsp_tree" type="Dictionary">
- </argument>
- <description>
- </description>
- </method>
<method name="set_geometry_hint">
- <argument index="0" name="triangles" type="Vector3Array">
- </argument>
- <description>
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="Sample" inherits="Resource" category="Core">
- <brief_description>
- Audio sample (sound) class.
- </brief_description>
- <description>
- Sample provides an audio sample class, containing audio data, together with some information for playback, such as format, mix rate and loop. It is used by sound playback routines.
- </description>
- <methods>
- <method name="create">
- <argument index="0" name="format" type="int">
- </argument>
- <argument index="1" name="stereo" type="bool">
- </argument>
- <argument index="2" name="length" type="int">
- </argument>
- <description>
- Create new data for the sample, with format (see FORMAT_* constants), stereo hint, and length in samples (not bytes).
- Calling this method overrides previously existing data. Stereo samples are interleaved pairs of left and right points (in that order), but count as one sample for length purposes.
- </description>
- </method>
- <method name="get_data" qualifiers="const">
- <return type="RawArray">
- </return>
- <description>
- Return sample data as little endian.
- </description>
- </method>
- <method name="get_format" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the sample format.
- </description>
- </method>
- <method name="get_length" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the sample length in samples. Stereo samples count as one, even if they are made of a left and a right sample.
- </description>
- </method>
- <method name="get_loop_begin" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the loop begin position.
- </description>
- </method>
- <method name="get_loop_end" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the loop end position.
- </description>
- </method>
- <method name="get_loop_format" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the loop format.
- </description>
- </method>
- <method name="get_mix_rate" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the mix rate for the sample.
- </description>
- </method>
- <method name="is_stereo" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Return whether the current sample was created as stereo.
- </description>
- </method>
- <method name="set_data">
- <argument index="0" name="data" type="RawArray">
- </argument>
- <description>
- Set sample data. Data must be little endian, no matter the host platform, and exactly as long as to fit all samples. The length of this array can be calculated as follows:
- Get the sample length ([method get_length]). If the sample format is FORMAT_PCM16, multiply it by 2. If the sample format is FORMAT_IMA_ADPCM, divide it by 2 (rounding any fraction up), then add 4. If the sample is stereo ([method is_stereo]), multiply it by 2.
- </description>
- </method>
- <method name="set_loop_begin">
- <argument index="0" name="pos" type="int">
- </argument>
- <description>
- Set the loop begin position. It must be a valid frame and less than the loop end position.
- </description>
- </method>
- <method name="set_loop_end">
- <argument index="0" name="pos" type="int">
- </argument>
- <description>
- Set the loop end position. It must be a valid frame and greater than the loop begin position.
- </description>
- </method>
- <method name="set_loop_format">
- <argument index="0" name="format" type="int">
- </argument>
- <description>
- Set the loop format (use LOOP_* constants as argument).
- </description>
- </method>
- <method name="set_mix_rate">
- <argument index="0" name="hz" type="int">
+ <argument index="0" name="triangles" type="PoolVector3Array">
</argument>
<description>
- Set the mix rate for the sample (expected playback frequency).
- </description>
- </method>
- </methods>
- <constants>
- <constant name="FORMAT_PCM8" value="0">
- 8-bits signed PCM audio.
- </constant>
- <constant name="FORMAT_PCM16" value="1">
- 16-bits signed little endian PCM audio.
- </constant>
- <constant name="FORMAT_IMA_ADPCM" value="2">
- IMA-ADPCM Audio.
- </constant>
- <constant name="LOOP_NONE" value="0">
- No loop enabled.
- </constant>
- <constant name="LOOP_FORWARD" value="1">
- Forward looping (when playback reaches loop end, goes back to loop begin).
- </constant>
- <constant name="LOOP_PING_PONG" value="2">
- Ping-pong looping (when playback reaches loop end, plays backward until loop begin). Not available in all platforms.
- </constant>
- </constants>
-</class>
-<class name="SampleLibrary" inherits="Resource" category="Core">
- <brief_description>
- Library that contains a collection of samples.
- </brief_description>
- <description>
- Library that contains a collection of [Sample], each identified by a text ID. This is used as a data container for the majority of the SamplePlayer classes and derivatives.
- </description>
- <methods>
- <method name="add_sample">
- <argument index="0" name="name" type="String">
- </argument>
- <argument index="1" name="sample" type="Sample">
- </argument>
- <description>
- Add a sample to the library, with a given text ID.
- </description>
- </method>
- <method name="get_sample" qualifiers="const">
- <return type="Sample">
- </return>
- <argument index="0" name="name" type="String">
- </argument>
- <description>
- Return the sample from the library matching the given text ID. Return null if the sample is not found.
- </description>
- </method>
- <method name="get_sample_list" qualifiers="const">
- <return type="Array">
- </return>
- <description>
- </description>
- </method>
- <method name="has_sample" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="name" type="String">
- </argument>
- <description>
- Return true if the sample text ID exists in the library.
- </description>
- </method>
- <method name="remove_sample">
- <argument index="0" name="name" type="String">
- </argument>
- <description>
- Remove the sample matching the given text ID.
- </description>
- </method>
- <method name="sample_get_pitch_scale" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="name" type="String">
- </argument>
- <description>
- Return the pitch scale for the given sample.
- </description>
- </method>
- <method name="sample_get_volume_db" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="name" type="String">
- </argument>
- <description>
- Return the volume (in dB) for the given sample.
- </description>
- </method>
- <method name="sample_set_pitch_scale">
- <argument index="0" name="name" type="String">
- </argument>
- <argument index="1" name="pitch" type="float">
- </argument>
- <description>
- Set the pitch scale for the given sample.
- </description>
- </method>
- <method name="sample_set_volume_db">
- <argument index="0" name="name" type="String">
- </argument>
- <argument index="1" name="db" type="float">
- </argument>
- <description>
- Set the volume (in dB) for the given sample.
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="SamplePlayer" inherits="Node" category="Core">
- <brief_description>
- Sample Player node.
- </brief_description>
- <description>
- SamplePlayer is a [Node] meant for simple sample playback. A library of samples is loaded and played back "as is", without positioning or anything.
- </description>
- <methods>
- <method name="get_chorus" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current chorus send level for a given voice.
- </description>
- </method>
- <method name="get_default_chorus" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the default chorus send level of the player.
- </description>
- </method>
- <method name="get_default_filter_cutoff" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the default filter cutoff frequency of the player.
- </description>
- </method>
- <method name="get_default_filter_gain" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the default filter gain of the player.
- </description>
- </method>
- <method name="get_default_filter_resonance" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the default filter resonance of the player.
- </description>
- </method>
- <method name="get_default_filter_type" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the default filter type in use (see FILTER_* constants) for the player.
- </description>
- </method>
- <method name="get_default_pan" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the default panning of the player.
- </description>
- </method>
- <method name="get_default_pan_depth" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the default pan depth of the player.
- </description>
- </method>
- <method name="get_default_pan_height" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the default pan height of the player.
- </description>
- </method>
- <method name="get_default_pitch_scale" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the default pitch scale of the player.
- </description>
- </method>
- <method name="get_default_reverb" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the default reverberation send level of the player.
- </description>
- </method>
- <method name="get_default_reverb_room" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the default reverberation room type of the player (see REVERB_* enum).
- </description>
- </method>
- <method name="get_default_volume" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the default volume (on a linear scale) of the player.
- </description>
- </method>
- <method name="get_default_volume_db" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the default volume (in dB) of the player.
- </description>
- </method>
- <method name="get_filter_cutoff" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current filter cutoff frequency for a given voice.
- </description>
- </method>
- <method name="get_filter_gain" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current filter gain for a given voice.
- </description>
- </method>
- <method name="get_filter_resonance" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current filter resonance for a given voice.
- </description>
- </method>
- <method name="get_filter_type" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current filter type in use (see FILTER_* constants) for a given voice.
- </description>
- </method>
- <method name="get_mix_rate" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current mix rate for a given voice.
- </description>
- </method>
- <method name="get_pan" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current panning for a given voice.
- </description>
- </method>
- <method name="get_pan_depth" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current pan depth for a given voice.
- </description>
- </method>
- <method name="get_pan_height" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current pan height for a given voice.
- </description>
- </method>
- <method name="get_pitch_scale" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current pitch scale for a given voice.
- </description>
- </method>
- <method name="get_polyphony" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the polyphony of the player.
- </description>
- </method>
- <method name="get_reverb" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current reverberation send level for a given voice.
- </description>
- </method>
- <method name="get_reverb_room" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current reverberation room type for a given voice (see REVERB_* enum).
- </description>
- </method>
- <method name="get_sample_library" qualifiers="const">
- <return type="SampleLibrary">
- </return>
- <description>
- Return the sample library used by the player.
- </description>
- </method>
- <method name="get_volume" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current volume (on a linear scale) for a given voice.
- </description>
- </method>
- <method name="get_volume_db" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return the current volume (in dB) for a given voice.
- </description>
- </method>
- <method name="is_active" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Return whether the player is currently active.
- </description>
- </method>
- <method name="is_voice_active" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return whether the given voice is currently active.
- </description>
- </method>
- <method name="play">
- <return type="int">
- </return>
- <argument index="0" name="name" type="String">
- </argument>
- <argument index="1" name="unique" type="bool" default="false">
- </argument>
- <description>
- Play a sample referenced by its name.
- Optionally, the playback can be made "unique" to force stopping all other samples currently played. The voices allocated for playback will then be returned.
- </description>
- </method>
- <method name="set_chorus">
- <argument index="0" name="voice" type="int">
- </argument>
- <argument index="1" name="send" type="float">
- </argument>
- <description>
- Set the chorus send level of a voice (from 0 to 1.0). For setting chorus parameters, see [AudioServer].
- </description>
- </method>
- <method name="set_default_chorus">
- <argument index="0" name="send" type="float">
- </argument>
- <description>
- Set the default chorus send level of the player (from 0 to 1.0). For setting chorus parameters, see [AudioServer].
- </description>
- </method>
- <method name="set_default_filter">
- <argument index="0" name="type" type="int">
- </argument>
- <argument index="1" name="cutoff_hz" type="float">
- </argument>
- <argument index="2" name="resonance" type="float">
- </argument>
- <argument index="3" name="gain" type="float" default="0">
- </argument>
- <description>
- Set the default filter for the player, using the given type (see FILTER_* constants), cutoff frequency (from 20 to 16,384 Hz) and resonance (from 0 to 4.0).
- Optionally, a gain can also be given (from 0 to 2.0).
- </description>
- </method>
- <method name="set_default_pan">
- <argument index="0" name="pan" type="float">
- </argument>
- <argument index="1" name="depth" type="float" default="0">
- </argument>
- <argument index="2" name="height" type="float" default="0">
- </argument>
- <description>
- Set the default panning of the player. Panning goes from -1.0 (left) to +1.0 (right).
- Optionally, for hardware than support 3D sound, one can also set depth and height (also in range -1.0 to +1.0).
- </description>
- </method>
- <method name="set_default_pitch_scale">
- <argument index="0" name="ratio" type="float">
- </argument>
- <description>
- Set the default pitch scale of the player. A ratio of 1.0 is the normal scale.
- </description>
- </method>
- <method name="set_default_reverb">
- <argument index="0" name="room_type" type="int">
- </argument>
- <argument index="1" name="send" type="float">
- </argument>
- <description>
- Set the default reverberation type (see REVERB_* constants) and send level (from 0 to 1.0) of the player.
- </description>
- </method>
- <method name="set_default_volume">
- <argument index="0" name="volume" type="float">
- </argument>
- <description>
- Set the default volume of the player using a linear scale.
- The "volume" argument should be a positive factor ranging from 0.0 (mute) up to 16.0 (i.e. 24 dB).
- A factor of 1.0 means that the voice will be played at normal system volume. Factors above 1.0 might be limited by the platform's audio output.
- </description>
- </method>
- <method name="set_default_volume_db">
- <argument index="0" name="db" type="float">
- </argument>
- <description>
- Set the default volume of the player in dB.
- The "dB" argument can range from -80 to 24 dB, 0 dB being the maximum volume. Every 6 dB (resp. -6 dB), the volume is increased (resp. reduced) by half.
- </description>
- </method>
- <method name="set_filter">
- <argument index="0" name="voice" type="int">
- </argument>
- <argument index="1" name="type" type="int">
- </argument>
- <argument index="2" name="cutoff_hz" type="float">
- </argument>
- <argument index="3" name="resonance" type="float">
- </argument>
- <argument index="4" name="gain" type="float" default="0">
- </argument>
- <description>
- Set the filter for a given voice, using the given type (see FILTER_* constants), cutoff frequency (from 20 to 16,384 Hz) and resonance (from 0 to 4.0).
- Optionally, a gain can also be given (from 0 to 2.0).
- </description>
- </method>
- <method name="set_mix_rate">
- <argument index="0" name="voice" type="int">
- </argument>
- <argument index="1" name="hz" type="int">
- </argument>
- <description>
- Set the mix rate (in Hz) of a given voice.
- </description>
- </method>
- <method name="set_pan">
- <argument index="0" name="voice" type="int">
- </argument>
- <argument index="1" name="pan" type="float">
- </argument>
- <argument index="2" name="depth" type="float" default="0">
- </argument>
- <argument index="3" name="height" type="float" default="0">
- </argument>
- <description>
- Set the panning of a voice. Panning goes from -1.0 (left) to +1.0 (right).
- Optionally, for hardware than support 3D sound, one can also set depth and height (also in range -1.0 to +1.0).
- </description>
- </method>
- <method name="set_pitch_scale">
- <argument index="0" name="voice" type="int">
- </argument>
- <argument index="1" name="ratio" type="float">
- </argument>
- <description>
- Set the pitch scale of a given voice. A ratio of 1.0 is the normal scale.
- </description>
- </method>
- <method name="set_polyphony">
- <argument index="0" name="max_voices" type="int">
- </argument>
- <description>
- Set the polyphony of the player (maximum amount of simultaneous voices).
- </description>
- </method>
- <method name="set_reverb">
- <argument index="0" name="voice" type="int">
- </argument>
- <argument index="1" name="room_type" type="int">
- </argument>
- <argument index="2" name="send" type="float">
- </argument>
- <description>
- Set the reverberation type (see REVERB_* constants) and send level (from 0 to 1.0) of a voice.
- </description>
- </method>
- <method name="set_sample_library">
- <argument index="0" name="library" type="SampleLibrary">
- </argument>
- <description>
- Set the sample library for the player.
- </description>
- </method>
- <method name="set_volume">
- <argument index="0" name="voice" type="int">
- </argument>
- <argument index="1" name="volume" type="float">
- </argument>
- <description>
- Set the volume of a given voice using a linear scale.
- The "volume" argument should be a positive factor ranging from 0.0 (mute) up to 16.0 (i.e. 24 dB).
- A factor of 1.0 means that the voice will be played at normal system volume. Factors above 1.0 might be limited by the platform's audio output.
- </description>
- </method>
- <method name="set_volume_db">
- <argument index="0" name="voice" type="int">
- </argument>
- <argument index="1" name="db" type="float">
- </argument>
- <description>
- Set the volume of a given voice in dB.
- The "dB" argument can range from -80 to 24 dB, 0 dB being the maximum volume. Every 6 dB (resp. -6 dB), the volume is increased (resp. reduced) by half.
- </description>
- </method>
- <method name="stop">
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Stop a given voice.
- </description>
- </method>
- <method name="stop_all">
- <description>
- Stop all playing voices.
- </description>
- </method>
- </methods>
- <constants>
- <constant name="FILTER_NONE" value="0">
- Filter is disabled for voice.
- </constant>
- <constant name="FILTER_LOWPASS" value="1">
- Low-pass filter is used for voice.
- </constant>
- <constant name="FILTER_BANDPASS" value="2">
- Band-pass filter is used for voice.
- </constant>
- <constant name="FILTER_HIPASS" value="3">
- High-pass filter is used for voice.
- </constant>
- <constant name="FILTER_NOTCH" value="4">
- Notch (band reject) filter is used for voice.
- </constant>
- <constant name="FILTER_PEAK" value="5">
- Peak (exclusive band) filter is used for voice.
- </constant>
- <constant name="FILTER_BANDLIMIT" value="6">
- Band-limit filter is used for voice, in this case resonance is the high-pass cutoff. A band-limit filter has a different frequency response than a notch filter, but otherwise both are band-rejecting filters.
- </constant>
- <constant name="FILTER_LOW_SHELF" value="7">
- Low-shelf filter is used for voice.
- </constant>
- <constant name="FILTER_HIGH_SHELF" value="8">
- High-shelf filter is used for voice.
- </constant>
- <constant name="REVERB_SMALL" value="0">
- Small reverberation room (house room).
- </constant>
- <constant name="REVERB_MEDIUM" value="1">
- Medium reverberation room (street)
- </constant>
- <constant name="REVERB_LARGE" value="2">
- Large reverberation room (theatre)
- </constant>
- <constant name="REVERB_HALL" value="3">
- Huge reverberation room (cathedral, warehouse).
- </constant>
- <constant name="INVALID_VOICE_ID" value="-1">
- Value returned if the voice ID is invalid.
- </constant>
- </constants>
-</class>
-<class name="SamplePlayer2D" inherits="SoundPlayer2D" category="Core">
- <brief_description>
- Sample player for positional 2D Sound.
- </brief_description>
- <description>
- Sample player for positional 2D Sound. Plays sound samples positionally, left and right depending on the distance/place on the screen.
- </description>
- <methods>
- <method name="get_polyphony" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the polyphony of the player.
- </description>
- </method>
- <method name="get_random_pitch_scale" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Return the amplitude used for random pitch scale variations.
- </description>
- </method>
- <method name="get_sample_library" qualifiers="const">
- <return type="SampleLibrary">
- </return>
- <description>
- Return the sample library used by the player.
- </description>
- </method>
- <method name="is_voice_active" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Return whether a voice is still active or has stopped playing.
- </description>
- </method>
- <method name="play">
- <return type="int">
- </return>
- <argument index="0" name="sample" type="String">
- </argument>
- <argument index="1" name="voice" type="int" default="-2">
- </argument>
- <description>
- Play a sample. An internal polyphony ID can optionally be passed, or defaults to NEXT_VOICE.
- Return a voice ID which can be used to modify the voice parameters, or INVALID_VOICE if the voice or sample are invalid.
- </description>
- </method>
- <method name="set_polyphony">
- <argument index="0" name="max_voices" type="int">
- </argument>
- <description>
- Set the polyphony of the player (maximum amount of simultaneous voices).
- </description>
- </method>
- <method name="set_random_pitch_scale">
- <argument index="0" name="val" type="float">
- </argument>
- <description>
- Set the amplitude for random pitch scale variations. If different from zero, the pitch scale will vary randomly around 1.0 in a range defined by val.
- The actual pitch scale will be, with "variation" ranging from -val to val:
- * variation &gt; 0: 1.0 + variation
- * variation &lt; 0: 1.0/(1.0 - variation)
- </description>
- </method>
- <method name="set_sample_library">
- <argument index="0" name="library" type="SampleLibrary">
- </argument>
- <description>
- Set the sample library for the player.
- </description>
- </method>
- <method name="stop_all">
- <description>
- Stop all playing voices.
- </description>
- </method>
- <method name="stop_voice">
- <argument index="0" name="voice" type="int">
- </argument>
- <description>
- Stop a given voice.
- </description>
- </method>
- <method name="voice_set_pitch_scale">
- <argument index="0" name="voice" type="int">
- </argument>
- <argument index="1" name="ratio" type="float">
- </argument>
- <description>
- Change the pitch scale of a currently playing voice.
- </description>
- </method>
- <method name="voice_set_volume_scale_db">
- <argument index="0" name="voice" type="int">
- </argument>
- <argument index="1" name="db" type="float">
- </argument>
- <description>
- Change the volume scale (in dB) of a currently playing voice.
</description>
</method>
</methods>
+ <members>
+ <member name="geometry_hint" type="PoolVector3Array" setter="set_geometry_hint" getter="get_geometry_hint" brief="">
+ </member>
+ </members>
<constants>
- <constant name="INVALID_VOICE" value="-1">
- Value returned if the voice or sample are invalid.
- </constant>
- <constant name="NEXT_VOICE" value="-2">
- Default voice for the play method. Corresponds to the first voice following the last used voice.
- </constant>
</constants>
</class>
<class name="SceneState" inherits="Reference" category="Core">
@@ -35247,7 +39573,7 @@
</description>
</method>
<method name="get_node_groups" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="idx" type="int">
</argument>
@@ -35315,6 +39641,8 @@
</description>
</method>
<method name="get_node_property_value" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="idx" type="int">
</argument>
<argument index="1" name="prop_idx" type="int">
@@ -35340,6 +39668,12 @@
</method>
</methods>
<constants>
+ <constant name="GEN_EDIT_STATE_DISABLED" value="0">
+ </constant>
+ <constant name="GEN_EDIT_STATE_INSTANCE" value="1">
+ </constant>
+ <constant name="GEN_EDIT_STATE_MAIN" value="2">
+ </constant>
</constants>
</class>
<class name="SceneTree" inherits="MainLoop" category="Core">
@@ -35349,6 +39683,14 @@
</description>
<methods>
<method name="call_group" qualifiers="vararg">
+ <argument index="0" name="group" type="String">
+ </argument>
+ <argument index="1" name="method" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="call_group_flags" qualifiers="vararg">
<argument index="0" name="flags" type="int">
</argument>
<argument index="1" name="group" type="String">
@@ -35379,6 +39721,8 @@
</return>
<argument index="0" name="time_sec" type="float">
</argument>
+ <argument index="1" name="pause_mode_process" type="bool" default="true">
+ </argument>
<description>
</description>
</method>
@@ -35400,6 +39744,12 @@
<description>
</description>
</method>
+ <method name="get_network_connected_peers" qualifiers="const">
+ <return type="PoolIntArray">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_network_unique_id" qualifiers="const">
<return type="int">
</return>
@@ -35434,6 +39784,13 @@
<description>
</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_debugging_collisions_hint" qualifiers="const">
<return type="bool">
</return>
@@ -35452,18 +39809,17 @@
<description>
</description>
</method>
- <method name="is_network_server" qualifiers="const">
+ <method name="is_input_handled">
<return type="bool">
</return>
<description>
- Returns true if this SceneTree's [NetworkedMultiplayerPeer] is in server mode (listening for connections).
</description>
</method>
- <method name="has_network_peer" qualifiers="const">
+ <method name="is_network_server" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns true if there is a [NetworkedMultiplayerPeer] set (with [method SceneTree.set_network_peer]).
+ Returns true if this SceneTree's [NetworkedMultiplayerPeer] is in server mode (listening for connections).
</description>
</method>
<method name="is_paused" qualifiers="const">
@@ -35479,6 +39835,14 @@
</description>
</method>
<method name="notify_group">
+ <argument index="0" name="call_flags" type="String">
+ </argument>
+ <argument index="1" name="group" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="notify_group_flags">
<argument index="0" name="call_flags" type="int">
</argument>
<argument index="1" name="group" type="String">
@@ -35541,6 +39905,16 @@
</description>
</method>
<method name="set_group">
+ <argument index="0" name="call_flags" type="String">
+ </argument>
+ <argument index="1" name="group" type="String">
+ </argument>
+ <argument index="2" name="property" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_group_flags">
<argument index="0" name="call_flags" type="int">
</argument>
<argument index="1" name="group" type="String">
@@ -35596,7 +39970,7 @@
</description>
</signal>
<signal name="files_dropped">
- <argument index="0" name="files" type="StringArray">
+ <argument index="0" name="files" type="PoolStringArray">
</argument>
<argument index="1" name="screen" type="int">
</argument>
@@ -35779,6 +40153,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="custom_step" type="float" setter="set_custom_step" getter="get_custom_step" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -35847,9 +40225,53 @@
</description>
</method>
</methods>
+ <members>
+ <member name="scroll_horizontal" type="bool" setter="set_enable_h_scroll" getter="is_h_scroll_enabled" brief="">
+ </member>
+ <member name="scroll_vertical" type="bool" setter="set_enable_v_scroll" getter="is_v_scroll_enabled" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
+<class name="ScriptEditor" inherits="PanelContainer" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_current_script">
+ <return type="Script">
+ </return>
+ <description>
+ Returns a [Script] that is currently active in editor.
+ </description>
+ </method>
+ <method name="get_open_scripts">
+ <return type="Array">
+ </return>
+ <description>
+ Returns an array with all [Script] objects which are currently open in editor.
+ </description>
+ </method>
+ </methods>
+ <signals>
+ <signal name="editor_script_changed">
+ <argument index="0" name="script" type="Script">
+ </argument>
+ <description>
+ Emitted when user changed active script. Argument is a freshly activated [Script].
+ </description>
+ </signal>
+ <signal name="script_close">
+ <argument index="0" name="script" type="Script">
+ </argument>
+ <description>
+ Emitted when editor is about to close the active script. Argument is a [Script] that is going to be closed.
+ </description>
+ </signal>
+ </signals>
+</class>
<class name="SegmentShape2D" inherits="Shape2D" category="Core">
<brief_description>
Segment Shape for 2D Collision Detection.
@@ -35887,6 +40309,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="a" type="Vector2" setter="set_a" getter="get_a" brief="">
+ </member>
+ <member name="b" type="Vector2" setter="set_b" getter="get_b" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -35936,23 +40364,17 @@
To be changed, ignore.
</description>
<methods>
- <method name="get_default_texture_param" qualifiers="const">
- <return type="Texture">
- </return>
- <argument index="0" name="param" type="String">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_fragment_code" qualifiers="const">
+ <method name="get_code" qualifiers="const">
<return type="String">
</return>
<description>
</description>
</method>
- <method name="get_light_code" qualifiers="const">
- <return type="String">
+ <method name="get_default_texture_param" qualifiers="const">
+ <return type="Texture">
</return>
+ <argument index="0" name="param" type="String">
+ </argument>
<description>
</description>
</method>
@@ -35962,12 +40384,6 @@
<description>
</description>
</method>
- <method name="get_vertex_code" qualifiers="const">
- <return type="String">
- </return>
- <description>
- </description>
- </method>
<method name="has_param" qualifiers="const">
<return type="bool">
</return>
@@ -35977,15 +40393,7 @@
</description>
</method>
<method name="set_code">
- <argument index="0" name="vcode" type="String">
- </argument>
- <argument index="1" name="fcode" type="String">
- </argument>
- <argument index="2" name="lcode" type="String">
- </argument>
- <argument index="3" name="fofs" type="int" default="0">
- </argument>
- <argument index="4" name="lofs" type="int" default="0">
+ <argument index="0" name="code" type="String">
</argument>
<description>
</description>
@@ -35999,882 +40407,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="code" type="String" setter="set_code" getter="get_code" brief="">
+ </member>
+ </members>
<constants>
- <constant name="MODE_MATERIAL" value="0">
+ <constant name="MODE_SPATIAL" value="0">
</constant>
<constant name="MODE_CANVAS_ITEM" value="1">
</constant>
- <constant name="MODE_POST_PROCESS" value="2">
- </constant>
- </constants>
-</class>
-<class name="ShaderGraph" inherits="Shader" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- <method name="clear">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="color_ramp_node_get_colors" qualifiers="const">
- <return type="ColorArray">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="color_ramp_node_get_offsets" qualifiers="const">
- <return type="RealArray">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="color_ramp_node_set_ramp">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="colors" type="ColorArray">
- </argument>
- <argument index="3" name="offsets" type="RealArray">
- </argument>
- <description>
- </description>
- </method>
- <method name="comment_node_get_text" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="comment_node_set_text">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="text" type="String">
- </argument>
- <description>
- </description>
- </method>
- <method name="connect_node">
- <return type="Error">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="src_id" type="int">
- </argument>
- <argument index="2" name="src_slot" type="int">
- </argument>
- <argument index="3" name="dst_id" type="int">
- </argument>
- <argument index="4" name="dst_slot" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="cubemap_input_node_get_value" qualifiers="const">
- <return type="CubeMap">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="cubemap_input_node_set_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="value" type="CubeMap">
- </argument>
- <description>
- </description>
- </method>
- <method name="curve_map_node_get_points" qualifiers="const">
- <return type="Vector2Array">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="curve_map_node_set_points">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="points" type="Vector2Array">
- </argument>
- <description>
- </description>
- </method>
- <method name="default_get_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="param_id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="default_set_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="param_id" type="int">
- </argument>
- <argument index="3" name="value" type="Variant">
- </argument>
- <description>
- </description>
- </method>
- <method name="disconnect_node">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="src_id" type="int">
- </argument>
- <argument index="2" name="src_slot" type="int">
- </argument>
- <argument index="3" name="dst_id" type="int">
- </argument>
- <argument index="4" name="dst_slot" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_node_connections" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_node_list" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="input_node_get_name">
- <return type="String">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="input_node_set_name">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="name" type="String">
- </argument>
- <description>
- </description>
- </method>
- <method name="is_node_connected" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="src_id" type="int">
- </argument>
- <argument index="2" name="src_slot" type="int">
- </argument>
- <argument index="3" name="dst_id" type="int">
- </argument>
- <argument index="4" name="dst_slot" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="node_add">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="node_type" type="int">
- </argument>
- <argument index="2" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="node_get_pos" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="node_get_state" qualifiers="const">
- <return type="Variant">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="node_get_type" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="node_remove">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="node_set_pos">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="pos" type="Vector2">
- </argument>
- <description>
- </description>
- </method>
- <method name="node_set_state">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="state" type="Variant">
- </argument>
- <description>
- </description>
- </method>
- <method name="rgb_const_node_get_value" qualifiers="const">
- <return type="Color">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="rgb_const_node_set_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="value" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="rgb_input_node_get_value" qualifiers="const">
- <return type="Color">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="rgb_input_node_set_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="value" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="rgb_op_node_get_op" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="rgb_op_node_set_op">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="float">
- </argument>
- <argument index="2" name="op" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="scalar_const_node_get_value" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="scalar_const_node_set_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="value" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="scalar_func_node_get_function" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="scalar_func_node_set_function">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="func" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="scalar_input_node_get_value" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="scalar_input_node_set_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="value" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="scalar_op_node_get_op" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="scalar_op_node_set_op">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="float">
- </argument>
- <argument index="2" name="op" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="texture_input_node_get_value" qualifiers="const">
- <return type="Texture">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="texture_input_node_set_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="value" type="Texture">
- </argument>
- <description>
- </description>
- </method>
- <method name="texture_node_get_filter_size" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="texture_node_get_filter_strength" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="texture_node_set_filter_size">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="filter_size" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="texture_node_set_filter_strength">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="float">
- </argument>
- <argument index="2" name="filter_strength" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="vec_const_node_get_value" qualifiers="const">
- <return type="Vector3">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="vec_const_node_set_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="value" type="Vector3">
- </argument>
- <description>
- </description>
- </method>
- <method name="vec_func_node_get_function" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="vec_func_node_set_function">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="func" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="vec_input_node_get_value" qualifiers="const">
- <return type="Vector3">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="vec_input_node_set_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="value" type="Vector3">
- </argument>
- <description>
- </description>
- </method>
- <method name="vec_op_node_get_op" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="vec_op_node_set_op">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="float">
- </argument>
- <argument index="2" name="op" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="vec_scalar_op_node_get_op" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="vec_scalar_op_node_set_op">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="float">
- </argument>
- <argument index="2" name="op" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="xform_const_node_get_value" qualifiers="const">
- <return type="Transform">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="xform_const_node_set_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="value" type="Transform">
- </argument>
- <description>
- </description>
- </method>
- <method name="xform_input_node_get_value" qualifiers="const">
- <return type="Transform">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="xform_input_node_set_value">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="value" type="Transform">
- </argument>
- <description>
- </description>
- </method>
- <method name="xform_vec_mult_node_get_no_translation" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="xform_vec_mult_node_set_no_translation">
- <argument index="0" name="shader_type" type="int">
- </argument>
- <argument index="1" name="id" type="int">
- </argument>
- <argument index="2" name="disable" type="bool">
- </argument>
- <description>
- </description>
- </method>
- </methods>
- <signals>
- <signal name="updated">
- <description>
- </description>
- </signal>
- </signals>
- <constants>
- <constant name="NODE_INPUT" value="0">
- </constant>
- <constant name="NODE_SCALAR_CONST" value="1">
- </constant>
- <constant name="NODE_VEC_CONST" value="2">
- </constant>
- <constant name="NODE_RGB_CONST" value="3">
- </constant>
- <constant name="NODE_XFORM_CONST" value="4">
- </constant>
- <constant name="NODE_TIME" value="5">
- </constant>
- <constant name="NODE_SCREEN_TEX" value="6">
- </constant>
- <constant name="NODE_SCALAR_OP" value="7">
- </constant>
- <constant name="NODE_VEC_OP" value="8">
- </constant>
- <constant name="NODE_VEC_SCALAR_OP" value="9">
- </constant>
- <constant name="NODE_RGB_OP" value="10">
- </constant>
- <constant name="NODE_XFORM_MULT" value="11">
- </constant>
- <constant name="NODE_XFORM_VEC_MULT" value="12">
- </constant>
- <constant name="NODE_XFORM_VEC_INV_MULT" value="13">
- </constant>
- <constant name="NODE_SCALAR_FUNC" value="14">
- </constant>
- <constant name="NODE_VEC_FUNC" value="15">
- </constant>
- <constant name="NODE_VEC_LEN" value="16">
- </constant>
- <constant name="NODE_DOT_PROD" value="17">
- </constant>
- <constant name="NODE_VEC_TO_SCALAR" value="18">
- </constant>
- <constant name="NODE_SCALAR_TO_VEC" value="19">
- </constant>
- <constant name="NODE_VEC_TO_XFORM" value="21">
- </constant>
- <constant name="NODE_XFORM_TO_VEC" value="20">
- </constant>
- <constant name="NODE_SCALAR_INTERP" value="22">
- </constant>
- <constant name="NODE_VEC_INTERP" value="23">
- </constant>
- <constant name="NODE_COLOR_RAMP" value="24">
- </constant>
- <constant name="NODE_CURVE_MAP" value="25">
- </constant>
- <constant name="NODE_SCALAR_INPUT" value="26">
- </constant>
- <constant name="NODE_VEC_INPUT" value="27">
- </constant>
- <constant name="NODE_RGB_INPUT" value="28">
- </constant>
- <constant name="NODE_XFORM_INPUT" value="29">
- </constant>
- <constant name="NODE_TEXTURE_INPUT" value="30">
- </constant>
- <constant name="NODE_CUBEMAP_INPUT" value="31">
- </constant>
- <constant name="NODE_DEFAULT_TEXTURE" value="32">
- </constant>
- <constant name="NODE_OUTPUT" value="33">
- </constant>
- <constant name="NODE_COMMENT" value="34">
- </constant>
- <constant name="NODE_TYPE_MAX" value="35">
- </constant>
- <constant name="SLOT_TYPE_SCALAR" value="0">
- </constant>
- <constant name="SLOT_TYPE_VEC" value="1">
- </constant>
- <constant name="SLOT_TYPE_XFORM" value="2">
- </constant>
- <constant name="SLOT_TYPE_TEXTURE" value="3">
- </constant>
- <constant name="SLOT_MAX" value="4">
- </constant>
- <constant name="SHADER_TYPE_VERTEX" value="0">
- </constant>
- <constant name="SHADER_TYPE_FRAGMENT" value="1">
- </constant>
- <constant name="SHADER_TYPE_LIGHT" value="2">
- </constant>
- <constant name="SHADER_TYPE_MAX" value="3">
- </constant>
- <constant name="SLOT_IN" value="0">
- </constant>
- <constant name="SLOT_OUT" value="1">
- </constant>
- <constant name="GRAPH_OK" value="0">
- </constant>
- <constant name="GRAPH_ERROR_CYCLIC" value="1">
- </constant>
- <constant name="GRAPH_ERROR_MISSING_CONNECTIONS" value="2">
- </constant>
- <constant name="SCALAR_OP_ADD" value="0">
- </constant>
- <constant name="SCALAR_OP_SUB" value="1">
- </constant>
- <constant name="SCALAR_OP_MUL" value="2">
- </constant>
- <constant name="SCALAR_OP_DIV" value="3">
- </constant>
- <constant name="SCALAR_OP_MOD" value="4">
- </constant>
- <constant name="SCALAR_OP_POW" value="5">
- </constant>
- <constant name="SCALAR_OP_MAX" value="6">
- </constant>
- <constant name="SCALAR_OP_MIN" value="7">
- </constant>
- <constant name="SCALAR_OP_ATAN2" value="8">
- </constant>
- <constant name="SCALAR_MAX_OP" value="9">
- </constant>
- <constant name="VEC_OP_ADD" value="0">
- </constant>
- <constant name="VEC_OP_SUB" value="1">
- </constant>
- <constant name="VEC_OP_MUL" value="2">
- </constant>
- <constant name="VEC_OP_DIV" value="3">
- </constant>
- <constant name="VEC_OP_MOD" value="4">
- </constant>
- <constant name="VEC_OP_POW" value="5">
- </constant>
- <constant name="VEC_OP_MAX" value="6">
- </constant>
- <constant name="VEC_OP_MIN" value="7">
- </constant>
- <constant name="VEC_OP_CROSS" value="8">
- </constant>
- <constant name="VEC_MAX_OP" value="9">
- </constant>
- <constant name="VEC_SCALAR_OP_MUL" value="0">
- </constant>
- <constant name="VEC_SCALAR_OP_DIV" value="1">
- </constant>
- <constant name="VEC_SCALAR_OP_POW" value="2">
- </constant>
- <constant name="VEC_SCALAR_MAX_OP" value="3">
- </constant>
- <constant name="RGB_OP_SCREEN" value="0">
- </constant>
- <constant name="RGB_OP_DIFFERENCE" value="1">
- </constant>
- <constant name="RGB_OP_DARKEN" value="2">
- </constant>
- <constant name="RGB_OP_LIGHTEN" value="3">
- </constant>
- <constant name="RGB_OP_OVERLAY" value="4">
- </constant>
- <constant name="RGB_OP_DODGE" value="5">
- </constant>
- <constant name="RGB_OP_BURN" value="6">
- </constant>
- <constant name="RGB_OP_SOFT_LIGHT" value="7">
- </constant>
- <constant name="RGB_OP_HARD_LIGHT" value="8">
- </constant>
- <constant name="RGB_MAX_OP" value="9">
- </constant>
- <constant name="SCALAR_FUNC_SIN" value="0">
- </constant>
- <constant name="SCALAR_FUNC_COS" value="1">
- </constant>
- <constant name="SCALAR_FUNC_TAN" value="2">
- </constant>
- <constant name="SCALAR_FUNC_ASIN" value="3">
- </constant>
- <constant name="SCALAR_FUNC_ACOS" value="4">
- </constant>
- <constant name="SCALAR_FUNC_ATAN" value="5">
- </constant>
- <constant name="SCALAR_FUNC_SINH" value="6">
- </constant>
- <constant name="SCALAR_FUNC_COSH" value="7">
- </constant>
- <constant name="SCALAR_FUNC_TANH" value="8">
- </constant>
- <constant name="SCALAR_FUNC_LOG" value="9">
- </constant>
- <constant name="SCALAR_FUNC_EXP" value="10">
- </constant>
- <constant name="SCALAR_FUNC_SQRT" value="11">
- </constant>
- <constant name="SCALAR_FUNC_ABS" value="12">
- </constant>
- <constant name="SCALAR_FUNC_SIGN" value="13">
- </constant>
- <constant name="SCALAR_FUNC_FLOOR" value="14">
- </constant>
- <constant name="SCALAR_FUNC_ROUND" value="15">
- </constant>
- <constant name="SCALAR_FUNC_CEIL" value="16">
- </constant>
- <constant name="SCALAR_FUNC_FRAC" value="17">
- </constant>
- <constant name="SCALAR_FUNC_SATURATE" value="18">
- </constant>
- <constant name="SCALAR_FUNC_NEGATE" value="19">
- </constant>
- <constant name="SCALAR_MAX_FUNC" value="20">
- </constant>
- <constant name="VEC_FUNC_NORMALIZE" value="0">
- </constant>
- <constant name="VEC_FUNC_SATURATE" value="1">
- </constant>
- <constant name="VEC_FUNC_NEGATE" value="2">
- </constant>
- <constant name="VEC_FUNC_RECIPROCAL" value="3">
- </constant>
- <constant name="VEC_FUNC_RGB2HSV" value="4">
- </constant>
- <constant name="VEC_FUNC_HSV2RGB" value="5">
- </constant>
- <constant name="VEC_MAX_FUNC" value="6">
+ <constant name="MODE_PARTICLES" value="2">
</constant>
</constants>
</class>
@@ -36937,11 +40479,11 @@
<method name="collide">
<return type="bool">
</return>
- <argument index="0" name="local_xform" type="Matrix32">
+ <argument index="0" name="local_xform" type="Transform2D">
</argument>
<argument index="1" name="with_shape" type="Shape2D">
</argument>
- <argument index="2" name="shape_xform" type="Matrix32">
+ <argument index="2" name="shape_xform" type="Transform2D">
</argument>
<description>
Return whether this shape is colliding with another.
@@ -36951,11 +40493,11 @@
<method name="collide_and_get_contacts">
<return type="Variant">
</return>
- <argument index="0" name="local_xform" type="Matrix32">
+ <argument index="0" name="local_xform" type="Transform2D">
</argument>
<argument index="1" name="with_shape" type="Shape2D">
</argument>
- <argument index="2" name="shape_xform" type="Matrix32">
+ <argument index="2" name="shape_xform" type="Transform2D">
</argument>
<description>
Return a list of the points where this shape touches another. If there are no collisions, the list is empty.
@@ -36965,13 +40507,13 @@
<method name="collide_with_motion">
<return type="bool">
</return>
- <argument index="0" name="local_xform" type="Matrix32">
+ <argument index="0" name="local_xform" type="Transform2D">
</argument>
<argument index="1" name="local_motion" type="Vector2">
</argument>
<argument index="2" name="with_shape" type="Shape2D">
</argument>
- <argument index="3" name="shape_xform" type="Matrix32">
+ <argument index="3" name="shape_xform" type="Transform2D">
</argument>
<argument index="4" name="shape_motion" type="Vector2">
</argument>
@@ -36983,13 +40525,13 @@
<method name="collide_with_motion_and_get_contacts">
<return type="Variant">
</return>
- <argument index="0" name="local_xform" type="Matrix32">
+ <argument index="0" name="local_xform" type="Transform2D">
</argument>
<argument index="1" name="local_motion" type="Vector2">
</argument>
<argument index="2" name="with_shape" type="Shape2D">
</argument>
- <argument index="3" name="shape_xform" type="Matrix32">
+ <argument index="3" name="shape_xform" type="Transform2D">
</argument>
<argument index="4" name="shape_motion" type="Vector2">
</argument>
@@ -37014,6 +40556,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -37056,6 +40602,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="shortcut" type="InputEvent" setter="set_shortcut" getter="get_shortcut" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -37253,6 +40803,42 @@
</constant>
</constants>
</class>
+<class name="Sky" inherits="Resource" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_radiance_size" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_radiance_size">
+ <argument index="0" name="size" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="radiance_size" type="int" setter="set_radiance_size" getter="get_radiance_size" brief="">
+ </member>
+ </members>
+ <constants>
+ <constant name="RADIANCE_SIZE_256" value="0">
+ </constant>
+ <constant name="RADIANCE_SIZE_512" value="1">
+ </constant>
+ <constant name="RADIANCE_SIZE_1024" value="2">
+ </constant>
+ <constant name="RADIANCE_SIZE_2048" value="3">
+ </constant>
+ <constant name="RADIANCE_SIZE_MAX" value="4">
+ </constant>
+ </constants>
+</class>
<class name="Slider" inherits="Range" category="Core">
<brief_description>
Base class for GUI Sliders.
@@ -37275,6 +40861,18 @@
Return true if ticks are visible on borders.
</description>
</method>
+ <method name="is_editable" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_editable">
+ <argument index="0" name="editable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_ticks">
<argument index="0" name="count" type="int">
</argument>
@@ -37290,6 +40888,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="editable" type="bool" setter="set_editable" getter="is_editable" brief="">
+ </member>
+ <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" brief="">
+ </member>
+ <member name="tick_count" type="int" setter="set_ticks" getter="get_ticks" brief="">
+ </member>
+ <member name="ticks_on_borders" type="bool" setter="set_ticks_on_borders" getter="get_ticks_on_borders" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -37316,6 +40924,52 @@
</description>
</method>
</methods>
+ <members>
+ <member name="angular_limit/damping" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_limit/lower_angle" type="float" setter="_set_lower_limit_angular" getter="_get_lower_limit_angular" brief="">
+ </member>
+ <member name="angular_limit/restitution" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_limit/softness" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_limit/upper_angle" type="float" setter="_set_upper_limit_angular" getter="_get_upper_limit_angular" brief="">
+ </member>
+ <member name="angular_motion/damping" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_motion/restitution" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_motion/softness" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_ortho/damping" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_ortho/restitution" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="angular_ortho/softness" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_limit/damping" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_limit/lower_distance" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_limit/restitution" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_limit/softness" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_limit/upper_distance" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_motion/damping" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_motion/restitution" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_motion/softness" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_ortho/damping" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_ortho/restitution" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="linear_ortho/softness" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ </members>
<constants>
<constant name="PARAM_LINEAR_LIMIT_UPPER" value="0">
</constant>
@@ -37365,96 +41019,6 @@
</constant>
</constants>
</class>
-<class name="SoundPlayer2D" inherits="Node2D" category="Core">
- <brief_description>
- Base class for playing spatial 2D sound.
- </brief_description>
- <description>
- Base class for playing spatial 2D sound.
- </description>
- <methods>
- <method name="get_param" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="param" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_param">
- <argument index="0" name="param" type="int">
- </argument>
- <argument index="1" name="value" type="float">
- </argument>
- <description>
- </description>
- </method>
- </methods>
- <constants>
- <constant name="PARAM_VOLUME_DB" value="0">
- </constant>
- <constant name="PARAM_PITCH_SCALE" value="1">
- </constant>
- <constant name="PARAM_ATTENUATION_MIN_DISTANCE" value="2">
- </constant>
- <constant name="PARAM_ATTENUATION_MAX_DISTANCE" value="3">
- </constant>
- <constant name="PARAM_ATTENUATION_DISTANCE_EXP" value="4">
- </constant>
- <constant name="PARAM_MAX" value="5">
- </constant>
- </constants>
-</class>
-<class name="SoundRoomParams" inherits="Node" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- <method name="get_param" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="param" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_reverb_mode" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="is_forcing_params_to_all_sources">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
- <method name="set_force_params_to_all_sources">
- <argument index="0" name="enabled" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_param">
- <argument index="0" name="param" type="int">
- </argument>
- <argument index="1" name="value" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_reverb_mode">
- <argument index="0" name="reverb_mode" type="int">
- </argument>
- <description>
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
<class name="Spatial" inherits="Node" category="Core">
<brief_description>
Base class for all 3D nodes.
@@ -37487,12 +41051,14 @@
<return type="Vector3">
</return>
<description>
+ Return the rotation (in radians).
</description>
</method>
<method name="get_rotation_deg" qualifiers="const">
<return type="Vector3">
</return>
<description>
+ Return the rotation (in degrees).
</description>
</method>
<method name="get_scale" qualifiers="const">
@@ -37538,19 +41104,19 @@
<description>
</description>
</method>
- <method name="is_hidden" qualifiers="const">
+ <method name="is_local_transform_notification_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="is_local_transform_notification_enabled" qualifiers="const">
+ <method name="is_set_as_toplevel" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="is_set_as_toplevel" qualifiers="const">
+ <method name="is_transform_notification_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
@@ -37562,6 +41128,12 @@
<description>
</description>
</method>
+ <method name="is_visible_in_tree" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="look_at">
<argument index="0" name="target" type="Vector3">
</argument>
@@ -37629,12 +41201,6 @@
Set the transform globally, relative to worldspace.
</description>
</method>
- <method name="set_hidden">
- <argument index="0" name="hidden" type="bool">
- </argument>
- <description>
- </description>
- </method>
<method name="set_identity">
<description>
</description>
@@ -37651,16 +41217,24 @@
<description>
</description>
</method>
+ <method name="set_notify_transform">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_rotation">
<argument index="0" name="rotation_rad" type="Vector3">
</argument>
<description>
+ Set the rotation (in radians).
</description>
</method>
<method name="set_rotation_deg">
<argument index="0" name="rotation_deg" type="Vector3">
</argument>
<description>
+ Set the rotation (in degrees).
</description>
</method>
<method name="set_scale">
@@ -37682,6 +41256,12 @@
<description>
</description>
</method>
+ <method name="set_visible">
+ <argument index="0" name="arg0" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="show">
<description>
</description>
@@ -37697,6 +41277,22 @@
</description>
</method>
</methods>
+ <members>
+ <member name="global_transform" type="Transform" setter="set_global_transform" getter="get_global_transform" brief="">
+ </member>
+ <member name="rotation" type="Vector3" setter="set_rotation" getter="get_rotation" brief="">
+ </member>
+ <member name="rotation_deg" type="Vector3" setter="set_rotation_deg" getter="get_rotation_deg" brief="">
+ </member>
+ <member name="scale" type="Vector3" setter="set_scale" getter="get_scale" brief="">
+ </member>
+ <member name="transform" type="Transform" setter="set_transform" getter="get_transform" brief="">
+ </member>
+ <member name="translation" type="Vector3" setter="set_translation" getter="get_translation" brief="">
+ </member>
+ <member name="visible" type="bool" setter="set_visible" getter="is_visible" brief="">
+ </member>
+ </members>
<signals>
<signal name="visibility_changed">
<description>
@@ -37725,321 +41321,925 @@
<constants>
</constants>
</class>
-<class name="SpatialPlayer" inherits="Spatial" category="Core">
+<class name="SpatialMaterial" inherits="Material" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="get_param" qualifiers="const">
+ <method name="get_albedo" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_anisotropy" qualifiers="const">
<return type="float">
</return>
- <argument index="0" name="param" type="int">
- </argument>
<description>
</description>
</method>
- <method name="set_param">
- <argument index="0" name="param" type="int">
- </argument>
- <argument index="1" name="value" type="float">
- </argument>
+ <method name="get_billboard_mode" qualifiers="const">
+ <return type="int">
+ </return>
<description>
</description>
</method>
- </methods>
- <constants>
- <constant name="PARAM_VOLUME_DB" value="0">
- </constant>
- <constant name="PARAM_PITCH_SCALE" value="1">
- </constant>
- <constant name="PARAM_ATTENUATION_MIN_DISTANCE" value="2">
- </constant>
- <constant name="PARAM_ATTENUATION_MAX_DISTANCE" value="3">
- </constant>
- <constant name="PARAM_ATTENUATION_DISTANCE_EXP" value="4">
- </constant>
- <constant name="PARAM_EMISSION_CONE_DEGREES" value="5">
- </constant>
- <constant name="PARAM_EMISSION_CONE_ATTENUATION_DB" value="6">
- </constant>
- <constant name="PARAM_MAX" value="7">
- </constant>
- </constants>
-</class>
-<class name="SpatialSamplePlayer" inherits="SpatialPlayer" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- <method name="get_polyphony" qualifiers="const">
+ <method name="get_blend_mode" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="get_sample_library" qualifiers="const">
- <return type="SampleLibrary">
+ <method name="get_clearcoat" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="is_voice_active" qualifiers="const">
- <return type="bool">
+ <method name="get_clearcoat_gloss" qualifiers="const">
+ <return type="float">
</return>
- <argument index="0" name="voice" type="int">
- </argument>
<description>
</description>
</method>
- <method name="play">
+ <method name="get_cull_mode" qualifiers="const">
<return type="int">
</return>
- <argument index="0" name="sample" type="String">
- </argument>
- <argument index="1" name="voice" type="int" default="-2">
- </argument>
<description>
</description>
</method>
- <method name="set_polyphony">
- <argument index="0" name="voices" type="int">
- </argument>
+ <method name="get_depth_deep_parallax_max_layers" qualifiers="const">
+ <return type="int">
+ </return>
<description>
</description>
</method>
- <method name="set_sample_library">
- <argument index="0" name="library" type="SampleLibrary">
- </argument>
+ <method name="get_depth_deep_parallax_min_layers" qualifiers="const">
+ <return type="int">
+ </return>
<description>
</description>
</method>
- <method name="stop_all">
+ <method name="get_depth_draw_mode" qualifiers="const">
+ <return type="int">
+ </return>
<description>
</description>
</method>
- <method name="stop_voice">
- <argument index="0" name="voice" type="int">
- </argument>
+ <method name="get_depth_scale" qualifiers="const">
+ <return type="float">
+ </return>
<description>
</description>
</method>
- <method name="voice_set_pitch_scale">
- <argument index="0" name="voice" type="int">
- </argument>
- <argument index="1" name="ratio" type="float">
- </argument>
+ <method name="get_detail_blend_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_detail_uv" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_diffuse_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_emission" qualifiers="const">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_emission_energy" qualifiers="const">
+ <return type="float">
+ </return>
<description>
</description>
</method>
- <method name="voice_set_volume_scale_db">
- <argument index="0" name="voice" type="int">
+ <method name="get_feature" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="feature" type="int">
</argument>
- <argument index="1" name="db" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="get_flag" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="arg0" type="int">
</argument>
<description>
</description>
</method>
- </methods>
- <constants>
- <constant name="INVALID_VOICE" value="-1">
- </constant>
- <constant name="NEXT_VOICE" value="-2">
- </constant>
- </constants>
-</class>
-<class name="SpatialSound2DServer" inherits="Object" category="Core">
- <brief_description>
- Server for Spatial 2D Sound.
- </brief_description>
- <description>
- Server for Spatial 2D Sound.
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="SpatialSound2DServerSW" inherits="SpatialSound2DServer" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="SpatialSoundServer" inherits="Object" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="SpatialSoundServerSW" inherits="SpatialSoundServer" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="SpatialStreamPlayer" inherits="SpatialPlayer" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- <method name="get_buffering_msec" qualifiers="const">
- <return type="int">
+ <method name="get_grow" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="get_length" qualifiers="const">
+ <method name="get_line_width" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_metallic" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_normal_scale" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_loop_count" qualifiers="const">
+ <method name="get_particles_anim_h_frames" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="get_loop_restart_time" qualifiers="const">
+ <method name="get_particles_anim_loop" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_particles_anim_v_frames" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_point_size" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_pos" qualifiers="const">
+ <method name="get_refraction" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_stream" qualifiers="const">
- <return type="AudioStream">
+ <method name="get_rim" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="get_stream_name" qualifiers="const">
- <return type="String">
+ <method name="get_rim_tint" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="get_volume" qualifiers="const">
+ <method name="get_roughness" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_volume_db" qualifiers="const">
+ <method name="get_specular" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="has_autoplay" qualifiers="const">
- <return type="bool">
+ <method name="get_specular_mode" qualifiers="const">
+ <return type="int">
</return>
<description>
</description>
</method>
- <method name="has_loop" qualifiers="const">
- <return type="bool">
+ <method name="get_subsurface_scattering_strength" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="is_paused" qualifiers="const">
+ <method name="get_texture" qualifiers="const">
+ <return type="Texture">
+ </return>
+ <argument index="0" name="param" type="Texture">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_uv1_offset" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_uv1_scale" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_uv1_triplanar_blend_sharpness" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_uv2_offset" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_uv2_scale" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_uv2_triplanar_blend_sharpness" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_depth_deep_parallax_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="is_playing" qualifiers="const">
+ <method name="is_grow_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
- <method name="play">
- <argument index="0" name="offset" type="float" default="0">
+ <method name="set_albedo">
+ <argument index="0" name="albedo" type="Color">
</argument>
<description>
</description>
</method>
- <method name="seek_pos">
- <argument index="0" name="time" type="float">
+ <method name="set_anisotropy">
+ <argument index="0" name="anisotropy" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_autoplay">
- <argument index="0" name="enabled" type="bool">
+ <method name="set_billboard_mode">
+ <argument index="0" name="mode" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_buffering_msec">
- <argument index="0" name="msec" type="int">
+ <method name="set_blend_mode">
+ <argument index="0" name="blend_mode" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_loop">
- <argument index="0" name="enabled" type="bool">
+ <method name="set_clearcoat">
+ <argument index="0" name="clearcoat" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_loop_restart_time">
- <argument index="0" name="secs" type="float">
+ <method name="set_clearcoat_gloss">
+ <argument index="0" name="clearcoat_gloss" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_paused">
- <argument index="0" name="paused" type="bool">
+ <method name="set_cull_mode">
+ <argument index="0" name="cull_mode" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_stream">
- <argument index="0" name="stream" type="AudioStream">
+ <method name="set_depth_deep_parallax">
+ <argument index="0" name="enable" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_volume">
- <argument index="0" name="volume" type="float">
+ <method name="set_depth_deep_parallax_max_layers">
+ <argument index="0" name="layer" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_volume_db">
- <argument index="0" name="db" type="float">
+ <method name="set_depth_deep_parallax_min_layers">
+ <argument index="0" name="layer" type="int">
</argument>
<description>
</description>
</method>
- <method name="stop">
+ <method name="set_depth_draw_mode">
+ <argument index="0" name="depth_draw_mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_depth_scale">
+ <argument index="0" name="depth_scale" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_detail_blend_mode">
+ <argument index="0" name="detail_blend_mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_detail_uv">
+ <argument index="0" name="detail_uv" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_diffuse_mode">
+ <argument index="0" name="diffuse_mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_emission">
+ <argument index="0" name="emission" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_emission_energy">
+ <argument index="0" name="emission_energy" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_feature">
+ <argument index="0" name="feature" type="int">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_flag">
+ <argument index="0" name="flag" type="int">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_grow">
+ <argument index="0" name="amount" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_grow_enabled">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_line_width">
+ <argument index="0" name="line_width" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_metallic">
+ <argument index="0" name="metallic" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_normal_scale">
+ <argument index="0" name="normal_scale" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_particles_anim_h_frames">
+ <argument index="0" name="frames" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_particles_anim_loop">
+ <argument index="0" name="frames" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_particles_anim_v_frames">
+ <argument index="0" name="frames" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_point_size">
+ <argument index="0" name="point_size" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_refraction">
+ <argument index="0" name="refraction" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_rim">
+ <argument index="0" name="rim" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_rim_tint">
+ <argument index="0" name="rim_tint" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_roughness">
+ <argument index="0" name="roughness" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_specular">
+ <argument index="0" name="specular" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_specular_mode">
+ <argument index="0" name="specular_mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_subsurface_scattering_strength">
+ <argument index="0" name="strength" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_texture">
+ <argument index="0" name="param" type="Texture">
+ </argument>
+ <argument index="1" name="texture" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_uv1_offset">
+ <argument index="0" name="offset" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_uv1_scale">
+ <argument index="0" name="scale" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_uv1_triplanar_blend_sharpness">
+ <argument index="0" name="sharpness" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_uv2_offset">
+ <argument index="0" name="offset" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_uv2_scale">
+ <argument index="0" name="scale" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_uv2_triplanar_blend_sharpness">
+ <argument index="0" name="sharpness" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="albedo_color" type="Color" setter="set_albedo" getter="get_albedo" brief="">
+ </member>
+ <member name="albedo_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="anisotropy" type="float" setter="set_anisotropy" getter="get_anisotropy" brief="">
+ </member>
+ <member name="anisotropy_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
+ </member>
+ <member name="anisotropy_flowmap" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="ao_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
+ </member>
+ <member name="ao_on_uv2" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="ao_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="clearcoat" type="float" setter="set_clearcoat" getter="get_clearcoat" brief="">
+ </member>
+ <member name="clearcoat_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
+ </member>
+ <member name="clearcoat_gloss" type="float" setter="set_clearcoat_gloss" getter="get_clearcoat_gloss" brief="">
+ </member>
+ <member name="clearcoat_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="depth_deep_parallax" type="bool" setter="set_depth_deep_parallax" getter="is_depth_deep_parallax_enabled" brief="">
+ </member>
+ <member name="depth_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
+ </member>
+ <member name="depth_max_layers" type="int" setter="set_depth_deep_parallax_max_layers" getter="get_depth_deep_parallax_max_layers" brief="">
+ </member>
+ <member name="depth_min_layers" type="int" setter="set_depth_deep_parallax_min_layers" getter="get_depth_deep_parallax_min_layers" brief="">
+ </member>
+ <member name="depth_scale" type="float" setter="set_depth_scale" getter="get_depth_scale" brief="">
+ </member>
+ <member name="depth_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="detail_albedo" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="detail_blend_mode" type="int" setter="set_detail_blend_mode" getter="get_detail_blend_mode" brief="">
+ </member>
+ <member name="detail_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
+ </member>
+ <member name="detail_mask" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="detail_normal" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="detail_uv_layer" type="int" setter="set_detail_uv" getter="get_detail_uv" brief="">
+ </member>
+ <member name="emission" type="Color" setter="set_emission" getter="get_emission" brief="">
+ </member>
+ <member name="emission_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
+ </member>
+ <member name="emission_energy" type="float" setter="set_emission_energy" getter="get_emission_energy" brief="">
+ </member>
+ <member name="emission_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="flags_fixed_size" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="flags_on_top" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="flags_transparent" type="bool" setter="set_feature" getter="get_feature" brief="">
+ </member>
+ <member name="flags_unshaded" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="flags_use_point_size" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="metallic" type="float" setter="set_metallic" getter="get_metallic" brief="">
+ </member>
+ <member name="metallic_specular" type="float" setter="set_specular" getter="get_specular" brief="">
+ </member>
+ <member name="metallic_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="normal_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
+ </member>
+ <member name="normal_scale" type="float" setter="set_normal_scale" getter="get_normal_scale" brief="">
+ </member>
+ <member name="normal_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="params_billboard_mode" type="int" setter="set_billboard_mode" getter="get_billboard_mode" brief="">
+ </member>
+ <member name="params_blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" brief="">
+ </member>
+ <member name="params_cull_mode" type="int" setter="set_cull_mode" getter="get_cull_mode" brief="">
+ </member>
+ <member name="params_depth_draw_mode" type="int" setter="set_depth_draw_mode" getter="get_depth_draw_mode" brief="">
+ </member>
+ <member name="params_diffuse_mode" type="int" setter="set_diffuse_mode" getter="get_diffuse_mode" brief="">
+ </member>
+ <member name="params_grow" type="bool" setter="set_grow_enabled" getter="is_grow_enabled" brief="">
+ </member>
+ <member name="params_grow_amount" type="float" setter="set_grow" getter="get_grow" brief="">
+ </member>
+ <member name="params_line_width" type="float" setter="set_line_width" getter="get_line_width" brief="">
+ </member>
+ <member name="params_point_size" type="float" setter="set_point_size" getter="get_point_size" brief="">
+ </member>
+ <member name="params_specular_mode" type="int" setter="set_specular_mode" getter="get_specular_mode" brief="">
+ </member>
+ <member name="particles_anim_h_frames" type="int" setter="set_particles_anim_h_frames" getter="get_particles_anim_h_frames" brief="">
+ </member>
+ <member name="particles_anim_loop" type="bool" setter="set_particles_anim_loop" getter="get_particles_anim_loop" brief="">
+ </member>
+ <member name="particles_anim_v_frames" type="int" setter="set_particles_anim_v_frames" getter="get_particles_anim_v_frames" brief="">
+ </member>
+ <member name="refraction_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
+ </member>
+ <member name="refraction_scale" type="float" setter="set_refraction" getter="get_refraction" brief="">
+ </member>
+ <member name="refraction_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="rim" type="float" setter="set_rim" getter="get_rim" brief="">
+ </member>
+ <member name="rim_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
+ </member>
+ <member name="rim_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="rim_tint" type="float" setter="set_rim_tint" getter="get_rim_tint" brief="">
+ </member>
+ <member name="roughness" type="float" setter="set_roughness" getter="get_roughness" brief="">
+ </member>
+ <member name="roughness_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="subsurf_scatter_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
+ </member>
+ <member name="subsurf_scatter_strength" type="float" setter="set_subsurface_scattering_strength" getter="get_subsurface_scattering_strength" brief="">
+ </member>
+ <member name="subsurf_scatter_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="uv1_offset" type="Vector3" setter="set_uv1_offset" getter="get_uv1_offset" brief="">
+ </member>
+ <member name="uv1_scale" type="Vector3" setter="set_uv1_scale" getter="get_uv1_scale" brief="">
+ </member>
+ <member name="uv1_triplanar" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="uv1_triplanar_sharpness" type="float" setter="set_uv1_triplanar_blend_sharpness" getter="get_uv1_triplanar_blend_sharpness" brief="">
+ </member>
+ <member name="uv2_offset" type="Vector3" setter="set_uv2_offset" getter="get_uv2_offset" brief="">
+ </member>
+ <member name="uv2_scale" type="Vector3" setter="set_uv2_scale" getter="get_uv2_scale" brief="">
+ </member>
+ <member name="uv2_triplanar" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="uv2_triplanar_sharpness" type="float" setter="set_uv2_triplanar_blend_sharpness" getter="get_uv2_triplanar_blend_sharpness" brief="">
+ </member>
+ <member name="vertex_color_is_srgb" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ <member name="vertex_color_use_as_albedo" type="bool" setter="set_flag" getter="get_flag" brief="">
+ </member>
+ </members>
+ <constants>
+ <constant name="TEXTURE_ALBEDO" value="0">
+ </constant>
+ <constant name="TEXTURE_METALLIC" value="1">
+ </constant>
+ <constant name="TEXTURE_ROUGHNESS" value="2">
+ </constant>
+ <constant name="TEXTURE_EMISSION" value="3">
+ </constant>
+ <constant name="TEXTURE_NORMAL" value="4">
+ </constant>
+ <constant name="TEXTURE_RIM" value="5">
+ </constant>
+ <constant name="TEXTURE_CLEARCOAT" value="6">
+ </constant>
+ <constant name="TEXTURE_FLOWMAP" value="7">
+ </constant>
+ <constant name="TEXTURE_AMBIENT_OCCLUSION" value="8">
+ </constant>
+ <constant name="TEXTURE_DEPTH" value="9">
+ </constant>
+ <constant name="TEXTURE_SUBSURFACE_SCATTERING" value="10">
+ </constant>
+ <constant name="TEXTURE_REFRACTION" value="11">
+ </constant>
+ <constant name="TEXTURE_DETAIL_MASK" value="12">
+ </constant>
+ <constant name="TEXTURE_DETAIL_ALBEDO" value="13">
+ </constant>
+ <constant name="TEXTURE_DETAIL_NORMAL" value="14">
+ </constant>
+ <constant name="TEXTURE_MAX" value="15">
+ </constant>
+ <constant name="DETAIL_UV_1" value="0">
+ </constant>
+ <constant name="DETAIL_UV_2" value="1">
+ </constant>
+ <constant name="FEATURE_TRANSPARENT" value="0">
+ </constant>
+ <constant name="FEATURE_EMISSION" value="1">
+ </constant>
+ <constant name="FEATURE_NORMAL_MAPPING" value="2">
+ </constant>
+ <constant name="FEATURE_RIM" value="3">
+ </constant>
+ <constant name="FEATURE_CLEARCOAT" value="4">
+ </constant>
+ <constant name="FEATURE_ANISOTROPY" value="5">
+ </constant>
+ <constant name="FEATURE_AMBIENT_OCCLUSION" value="6">
+ </constant>
+ <constant name="FEATURE_DEPTH_MAPPING" value="7">
+ </constant>
+ <constant name="FEATURE_SUBSURACE_SCATTERING" value="8">
+ </constant>
+ <constant name="FEATURE_REFRACTION" value="9">
+ </constant>
+ <constant name="FEATURE_DETAIL" value="10">
+ </constant>
+ <constant name="FEATURE_MAX" value="11">
+ </constant>
+ <constant name="BLEND_MODE_MIX" value="0">
+ </constant>
+ <constant name="BLEND_MODE_ADD" value="1">
+ </constant>
+ <constant name="BLEND_MODE_SUB" value="2">
+ </constant>
+ <constant name="BLEND_MODE_MUL" value="3">
+ </constant>
+ <constant name="DEPTH_DRAW_OPAQUE_ONLY" value="0">
+ </constant>
+ <constant name="DEPTH_DRAW_ALWAYS" value="1">
+ </constant>
+ <constant name="DEPTH_DRAW_DISABLED" value="2">
+ </constant>
+ <constant name="DEPTH_DRAW_ALPHA_OPAQUE_PREPASS" value="3">
+ </constant>
+ <constant name="CULL_BACK" value="0">
+ </constant>
+ <constant name="CULL_FRONT" value="1">
+ </constant>
+ <constant name="CULL_DISABLED" value="2">
+ </constant>
+ <constant name="FLAG_UNSHADED" value="0">
+ </constant>
+ <constant name="FLAG_ONTOP" value="1">
+ </constant>
+ <constant name="FLAG_ALBEDO_FROM_VERTEX_COLOR" value="2">
+ </constant>
+ <constant name="FLAG_SRGB_VERTEX_COLOR" value="3">
+ </constant>
+ <constant name="FLAG_USE_POINT_SIZE" value="4">
+ </constant>
+ <constant name="FLAG_FIXED_SIZE" value="5">
+ </constant>
+ <constant name="FLAG_MAX" value="9">
+ </constant>
+ <constant name="DIFFUSE_LAMBERT" value="0">
+ </constant>
+ <constant name="DIFFUSE_HALF_LAMBERT" value="1">
+ </constant>
+ <constant name="DIFFUSE_OREN_NAYAR" value="2">
+ </constant>
+ <constant name="DIFFUSE_BURLEY" value="3">
+ </constant>
+ <constant name="DIFFUSE_TOON" value="4">
+ </constant>
+ <constant name="SPECULAR_SCHLICK_GGX" value="0">
+ </constant>
+ <constant name="SPECULAR_BLINN" value="1">
+ </constant>
+ <constant name="SPECULAR_PHONG" value="2">
+ </constant>
+ <constant name="SPECULAR_TOON" value="3">
+ </constant>
+ <constant name="SPECULAR_DISABLED" value="4">
+ </constant>
+ <constant name="BILLBOARD_DISABLED" value="0">
+ </constant>
+ <constant name="BILLBOARD_ENABLED" value="1">
+ </constant>
+ <constant name="BILLBOARD_FIXED_Y" value="2">
+ </constant>
+ <constant name="BILLBOARD_PARTICLES" value="3">
+ </constant>
+ </constants>
+</class>
+<class name="SpatialVelocityTracker" inherits="Reference" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_tracked_linear_velocity" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_tracking_fixed_step" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="reset">
+ <argument index="0" name="position" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_track_fixed_step">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="update_position">
+ <argument index="0" name="position" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
+<class name="SphereMesh" inherits="PrimitiveMesh" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_height" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_is_hemisphere" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_radial_segments" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_radius" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_rings" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_height">
+ <argument index="0" name="height" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_is_hemisphere">
+ <argument index="0" name="is_hemisphere" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_radial_segments">
+ <argument index="0" name="radial_segments" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_radius">
+ <argument index="0" name="radius" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_rings">
+ <argument index="0" name="rings" type="int">
+ </argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="height" type="float" setter="set_height" getter="get_height" brief="">
+ </member>
+ <member name="is_hemisphere" type="bool" setter="set_is_hemisphere" getter="get_is_hemisphere" brief="">
+ </member>
+ <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" brief="">
+ </member>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius" brief="">
+ </member>
+ <member name="rings" type="int" setter="set_rings" getter="get_rings" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -38062,6 +42262,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -38121,6 +42325,14 @@
</description>
</method>
</methods>
+ <members>
+ <member name="editable" type="bool" setter="set_editable" getter="is_editable" brief="">
+ </member>
+ <member name="prefix" type="String" setter="set_prefix" getter="get_prefix" brief="">
+ </member>
+ <member name="suffix" type="String" setter="set_suffix" getter="get_suffix" brief="">
+ </member>
+ </members>
<constants>
</constants>
<theme_items>
@@ -38179,6 +42391,14 @@
</description>
</method>
</methods>
+ <members>
+ <member name="collapsed" type="bool" setter="set_collapsed" getter="is_collapsed" brief="">
+ </member>
+ <member name="dragger_visibility" type="int" setter="set_dragger_visibility" getter="get_dragger_visibility" brief="">
+ </member>
+ <member name="split_offset" type="int" setter="set_split_offset" getter="get_split_offset" brief="">
+ </member>
+ </members>
<signals>
<signal name="dragged">
<argument index="0" name="offset" type="int">
@@ -38209,6 +42429,16 @@
</description>
<methods>
</methods>
+ <members>
+ <member name="spot_angle" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="spot_angle_attenuation" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="spot_attenuation" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ <member name="spot_range" type="float" setter="set_param" getter="get_param" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -38234,11 +42464,10 @@
Return the amount of horizontal frames. See [method set_hframes].
</description>
</method>
- <method name="get_modulate" qualifiers="const">
- <return type="Color">
+ <method name="get_normal_map" qualifiers="const">
+ <return type="Texture">
</return>
<description>
- Return color modulation for the sprite. All sprite pixels are multiplied by this color.
</description>
</method>
<method name="get_offset" qualifiers="const">
@@ -38297,6 +42526,12 @@
Return if the sprite reads from a region.
</description>
</method>
+ <method name="is_region_filter_clip_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="set_centered">
<argument index="0" name="centered" type="bool">
</argument>
@@ -38332,11 +42567,10 @@
Set the amount of horizontal frames and converts the sprite into a sprite-sheet. This is useful for animation.
</description>
</method>
- <method name="set_modulate">
- <argument index="0" name="modulate" type="Color">
+ <method name="set_normal_map">
+ <argument index="0" name="normal_map" type="Texture">
</argument>
<description>
- Set color modulation for the sprite. All sprite pixels are multiplied by this color. Color may contain rgb values above 1 to achieve a highlight effect.
</description>
</method>
<method name="set_offset">
@@ -38353,6 +42587,12 @@
Set the sprite as a sub-region of a bigger texture. Useful for texture-atlases.
</description>
</method>
+ <method name="set_region_filter_clip">
+ <argument index="0" name="enabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_region_rect">
<argument index="0" name="rect" type="Rect2">
</argument>
@@ -38375,6 +42615,32 @@
</description>
</method>
</methods>
+ <members>
+ <member name="centered" type="bool" setter="set_centered" getter="is_centered" brief="">
+ </member>
+ <member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h" brief="">
+ </member>
+ <member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v" brief="">
+ </member>
+ <member name="frame" type="int" setter="set_frame" getter="get_frame" brief="">
+ </member>
+ <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" brief="">
+ </member>
+ <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" brief="">
+ </member>
+ <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" brief="">
+ </member>
+ <member name="region_enabled" type="bool" setter="set_region" getter="is_region" brief="">
+ </member>
+ <member name="region_filter_clip" type="bool" setter="set_region_filter_clip" getter="is_region_filter_clip_enabled" brief="">
+ </member>
+ <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" brief="">
+ </member>
+ <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="vframes" type="int" setter="set_vframes" getter="get_vframes" brief="">
+ </member>
+ </members>
<signals>
<signal name="frame_changed">
<description>
@@ -38467,6 +42733,20 @@
</description>
</method>
</methods>
+ <members>
+ <member name="frame" type="int" setter="set_frame" getter="get_frame" brief="">
+ </member>
+ <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" brief="">
+ </member>
+ <member name="region_enabled" type="bool" setter="set_region" getter="is_region" brief="">
+ </member>
+ <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" brief="">
+ </member>
+ <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="vframes" type="int" setter="set_vframes" getter="get_vframes" brief="">
+ </member>
+ </members>
<signals>
<signal name="frame_changed">
<description>
@@ -38613,12 +42893,40 @@
</description>
</method>
</methods>
+ <members>
+ <member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" brief="">
+ </member>
+ <member name="axis" type="int" setter="set_axis" getter="get_axis" brief="">
+ </member>
+ <member name="centered" type="bool" setter="set_centered" getter="is_centered" brief="">
+ </member>
+ <member name="double_sided" type="bool" setter="set_draw_flag" getter="get_draw_flag" brief="">
+ </member>
+ <member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h" brief="">
+ </member>
+ <member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v" brief="">
+ </member>
+ <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" brief="">
+ </member>
+ <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" brief="">
+ </member>
+ <member name="opacity" type="float" setter="set_opacity" getter="get_opacity" brief="">
+ </member>
+ <member name="pixel_size" type="float" setter="set_pixel_size" getter="get_pixel_size" brief="">
+ </member>
+ <member name="shaded" type="bool" setter="set_draw_flag" getter="get_draw_flag" brief="">
+ </member>
+ <member name="transparent" type="bool" setter="set_draw_flag" getter="get_draw_flag" brief="">
+ </member>
+ </members>
<constants>
<constant name="FLAG_TRANSPARENT" value="0">
</constant>
<constant name="FLAG_SHADED" value="1">
</constant>
- <constant name="FLAG_MAX" value="2">
+ <constant name="FLAG_DOUBLE_SIDED" value="2">
+ </constant>
+ <constant name="FLAG_MAX" value="3">
</constant>
<constant name="ALPHA_CUT_DISABLED" value="0">
</constant>
@@ -38753,6 +43061,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="animations" type="Array" setter="_set_animations" getter="_get_animations" brief="">
+ </member>
+ <member name="frames" type="Array" setter="_set_frames" getter="_get_frames" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -38823,6 +43137,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="bounce" type="float" setter="set_bounce" getter="get_bounce" brief="">
+ </member>
+ <member name="constant_angular_velocity" type="Vector3" setter="set_constant_angular_velocity" getter="get_constant_angular_velocity" brief="">
+ </member>
+ <member name="constant_linear_velocity" type="Vector3" setter="set_constant_linear_velocity" getter="get_constant_linear_velocity" brief="">
+ </member>
+ <member name="friction" type="float" setter="set_friction" getter="get_friction" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -38893,6 +43217,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="bounce" type="float" setter="set_bounce" getter="get_bounce" brief="">
+ </member>
+ <member name="constant_angular_velocity" type="float" setter="set_constant_angular_velocity" getter="get_constant_angular_velocity" brief="">
+ </member>
+ <member name="constant_linear_velocity" type="Vector2" setter="set_constant_linear_velocity" getter="get_constant_linear_velocity" brief="">
+ </member>
+ <member name="friction" type="float" setter="set_friction" getter="get_friction" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -39062,7 +43396,7 @@
<method name="put_data">
<return type="int">
</return>
- <argument index="0" name="data" type="RawArray">
+ <argument index="0" name="data" type="PoolByteArray">
</argument>
<description>
Send a chunk of data through the connection, blocking if necessary until the data is done sending. This function returns an Error code.
@@ -39085,7 +43419,7 @@
<method name="put_partial_data">
<return type="Array">
</return>
- <argument index="0" name="data" type="RawArray">
+ <argument index="0" name="data" type="PoolByteArray">
</argument>
<description>
Send a chunk of data through the connection, if all the data could not be sent at once, only part of it will. This function returns two values, an Error code and an integer, describing how much data was actually sent.
@@ -39161,7 +43495,7 @@
</description>
</method>
<method name="get_data_array" qualifiers="const">
- <return type="RawArray">
+ <return type="PoolByteArray">
</return>
<description>
</description>
@@ -39191,7 +43525,7 @@
</description>
</method>
<method name="set_data_array">
- <argument index="0" name="data" type="RawArray">
+ <argument index="0" name="data" type="PoolByteArray">
</argument>
<description>
</description>
@@ -39208,7 +43542,7 @@
SSL Stream peer. This object can be used to connect to SSL servers.
</description>
<methods>
- <method name="accept">
+ <method name="accept_stream">
<return type="Error">
</return>
<argument index="0" name="stream" type="StreamPeer">
@@ -39216,7 +43550,7 @@
<description>
</description>
</method>
- <method name="connect">
+ <method name="connect_to_stream">
<return type="Error">
</return>
<argument index="0" name="stream" type="StreamPeer">
@@ -39229,7 +43563,7 @@
Connect to a peer using an underlying [StreamPeer] "stream", when "validate_certs" is true, [StreamPeerSSL] will validate that the certificate presented by the peer matches the "for_hostname".
</description>
</method>
- <method name="disconnect">
+ <method name="disconnect_from_stream">
<description>
Disconnect from host.
</description>
@@ -39265,7 +43599,7 @@
TCP Stream peer. This object can be used to connect to TCP servers, or also is returned by a tcp server.
</description>
<methods>
- <method name="connect">
+ <method name="connect_to_host">
<return type="int">
</return>
<argument index="0" name="host" type="String">
@@ -39276,7 +43610,7 @@
Connect to the specified host:port pair. A hostname will be resolved if valid. Returns [OK] on success or [FAILED] on failure.
</description>
</method>
- <method name="disconnect">
+ <method name="disconnect_from_host">
<description>
Disconnect from host.
</description>
@@ -39302,11 +43636,10 @@
Return the status of the connection, one of STATUS_* enum.
</description>
</method>
- <method name="is_connected" qualifiers="const">
+ <method name="is_connected_to_host" qualifiers="const">
<return type="bool">
</return>
<description>
- Return whether this peer is connected. Returns true while connecting and connected.
</description>
</method>
</methods>
@@ -39325,205 +43658,232 @@
</constant>
</constants>
</class>
-<class name="StreamPlayer" inherits="Node" category="Core">
+<class name="StreamTexture" inherits="Texture" category="Core">
<brief_description>
- Base class for audio stream playback.
</brief_description>
<description>
- Base class for audio stream playback. Audio stream players inherit from it.
</description>
<methods>
- <method name="get_buffering_msec" qualifiers="const">
- <return type="int">
+ <method name="get_load_path" qualifiers="const">
+ <return type="String">
</return>
<description>
- Return the size of the audio buffer.
</description>
</method>
- <method name="get_length" qualifiers="const">
- <return type="float">
+ <method name="load">
+ <return type="int">
</return>
+ <argument index="0" name="path" type="String">
+ </argument>
<description>
- Return the length of the stream, in seconds.
</description>
</method>
- <method name="get_loop_count" qualifiers="const">
- <return type="int">
+ </methods>
+ <members>
+ <member name="load_path" type="String" setter="load" getter="get_load_path" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="String" category="Built-In Types">
+ <brief_description>
+ Built-in string class.
+ </brief_description>
+ <description>
+ This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference counted and use a copy-on-write approach, so passing them around is cheap in resources.
+ </description>
+ <methods>
+ <method name="String">
+ <return type="String">
</return>
+ <argument index="0" name="from" type="bool">
+ </argument>
<description>
- Return the number of times the playback has looped.
</description>
</method>
- <method name="get_loop_restart_time" qualifiers="const">
- <return type="float">
+ <method name="String">
+ <return type="String">
</return>
+ <argument index="0" name="from" type="int">
+ </argument>
<description>
- Return the point in time the stream will rewind to, when looping.
</description>
</method>
- <method name="get_pos" qualifiers="const">
- <return type="float">
+ <method name="String">
+ <return type="String">
</return>
+ <argument index="0" name="from" type="float">
+ </argument>
<description>
- Return the playback position, in seconds.
</description>
</method>
- <method name="get_stream" qualifiers="const">
- <return type="AudioStream">
+ <method name="String">
+ <return type="String">
</return>
+ <argument index="0" name="from" type="Vector2">
+ </argument>
<description>
- Return the currently assigned stream.
</description>
</method>
- <method name="get_stream_name" qualifiers="const">
+ <method name="String">
<return type="String">
</return>
+ <argument index="0" name="from" type="Rect2">
+ </argument>
<description>
- Return the name of the currently assigned stream. This is not the file name, but a field inside the file. If no stream is assigned, if returns "&lt;No Stream&gt;".
</description>
</method>
- <method name="get_volume" qualifiers="const">
- <return type="float">
+ <method name="String">
+ <return type="String">
</return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
<description>
- Return the playback volume for this player.
</description>
</method>
- <method name="get_volume_db" qualifiers="const">
- <return type="float">
+ <method name="String">
+ <return type="String">
</return>
+ <argument index="0" name="from" type="Transform2D">
+ </argument>
<description>
- Return the playback volume for this player, in decibels.
</description>
</method>
- <method name="has_autoplay" qualifiers="const">
- <return type="bool">
+ <method name="String">
+ <return type="String">
</return>
+ <argument index="0" name="from" type="Plane">
+ </argument>
<description>
- Return whether this player will start playing as soon as it enters the scene tree.
</description>
</method>
- <method name="has_loop" qualifiers="const">
- <return type="bool">
+ <method name="String">
+ <return type="String">
</return>
+ <argument index="0" name="from" type="Quat">
+ </argument>
<description>
- Return whether the stream will be restarted at the end.
</description>
</method>
- <method name="is_paused" qualifiers="const">
- <return type="bool">
+ <method name="String">
+ <return type="String">
</return>
+ <argument index="0" name="from" type="Rect3">
+ </argument>
<description>
- Return whether the playback is currently paused.
</description>
</method>
- <method name="is_playing" qualifiers="const">
- <return type="bool">
+ <method name="String">
+ <return type="String">
</return>
+ <argument index="0" name="from" type="Basis">
+ </argument>
<description>
- Return whether this player is playing.
</description>
</method>
- <method name="play">
- <argument index="0" name="offset" type="float" default="0">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="Transform">
</argument>
<description>
- Play the currently assigned stream, starting from a given position (in seconds).
</description>
</method>
- <method name="seek_pos">
- <argument index="0" name="time" type="float">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="Color">
</argument>
<description>
- Set the playback position, in seconds.
</description>
</method>
- <method name="set_autoplay">
- <argument index="0" name="enabled" type="bool">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="NodePath">
</argument>
<description>
- Set whether this player will start playing as soon as it enters the scene tree.
</description>
</method>
- <method name="set_buffering_msec">
- <argument index="0" name="msec" type="int">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="RID">
</argument>
<description>
- Set the size (in milliseconds) of the audio buffer. A long audio buffer protects better against slowdowns, but responds worse to changes (in volume, stream played...). A shorter buffer takes less time to respond to changes, but may stutter if the application suffers some slowdown.
- Default is 500 milliseconds.
</description>
</method>
- <method name="set_loop">
- <argument index="0" name="enabled" type="bool">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="Dictionary">
</argument>
<description>
- Set whether the stream will be restarted at the end.
</description>
</method>
- <method name="set_loop_restart_time">
- <argument index="0" name="secs" type="float">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="Array">
</argument>
<description>
- Set the point in time the stream will rewind to, when looping.
</description>
</method>
- <method name="set_paused">
- <argument index="0" name="paused" type="bool">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="PoolByteArray">
</argument>
<description>
- Pause stream playback.
</description>
</method>
- <method name="set_stream">
- <argument index="0" name="stream" type="AudioStream">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="PoolIntArray">
</argument>
<description>
- Set the [EventStream] this player will play.
</description>
</method>
- <method name="set_volume">
- <argument index="0" name="volume" type="float">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="PoolRealArray">
</argument>
<description>
- Set the playback volume for this player. This is a float between 0.0 (silent) and 1.0 (full volume). Values over 1.0 will amplify sound even more, but may introduce distortion. Negative values will just invert the output waveform, which produces no audible difference.
</description>
</method>
- <method name="set_volume_db">
- <argument index="0" name="db" type="float">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="PoolStringArray">
</argument>
<description>
- Set the playback volume for this player, in decibels. This is a float between -80.0 (silent) and 0.0 (full volume). Values under -79.0 get truncated to -80, but values over 0.0 do not, so the warnings for overamplifying (see [method set_volume]) still apply.
</description>
</method>
- <method name="stop">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="PoolVector2Array">
+ </argument>
<description>
- Stop the playback.
</description>
</method>
- </methods>
- <signals>
- <signal name="finished">
+ <method name="String">
+ <return type="String">
+ </return>
+ <argument index="0" name="from" type="PoolVector3Array">
+ </argument>
<description>
- This signal triggers when the player stops playing. It will not trigger on each loop.
</description>
- </signal>
- </signals>
- <constants>
- </constants>
-</class>
-<class name="String" category="Built-In Types">
- <brief_description>
- Built-in string class.
- </brief_description>
- <description>
- This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference counted and use a copy-on-write approach, so passing them around is cheap in resources.
- </description>
- <methods>
- <method name="basename">
+ </method>
+ <method name="String">
<return type="String">
</return>
+ <argument index="0" name="from" type="PoolColorArray">
+ </argument>
<description>
- If the string is a path to a file, return the path to the file without the extension.
</description>
</method>
<method name="begins_with">
@@ -39536,7 +43896,7 @@
</description>
</method>
<method name="bigrams">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
Return the bigrams (pairs of consecutive letters) of this string.
@@ -39597,13 +43957,6 @@
Erase [code]chars[/code] characters from the string starting from [code]pos[/code].
</description>
</method>
- <method name="extension">
- <return type="String">
- </return>
- <description>
- If the string is a path to a file, return the extension.
- </description>
- </method>
<method name="find">
<return type="int">
</return>
@@ -39635,6 +43988,16 @@
Find the first occurrence of a substring but search as case-insensitive, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
</description>
</method>
+ <method name="format">
+ <return type="String">
+ </return>
+ <argument index="0" name="values" type="var">
+ </argument>
+ <argument index="1" name="placeholder" type="String" default="{_}">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_base_dir">
<return type="String">
</return>
@@ -39642,6 +44005,20 @@
If the string is a path to a file, return the base directory.
</description>
</method>
+ <method name="get_basename">
+ <return type="String">
+ </return>
+ <description>
+ If the string is a path to a file, return the path to the file without the extension.
+ </description>
+ </method>
+ <method name="get_extension">
+ <return type="String">
+ </return>
+ <description>
+ If the string is a path to a file, return the extension.
+ </description>
+ </method>
<method name="get_file">
<return type="String">
</return>
@@ -39783,7 +44160,7 @@
</description>
</method>
<method name="md5_buffer">
- <return type="RawArray">
+ <return type="PoolByteArray">
</return>
<description>
Return the MD5 hash of the string as an array of bytes.
@@ -39909,7 +44286,7 @@
</description>
</method>
<method name="sha256_buffer">
- <return type="RawArray">
+ <return type="PoolByteArray">
</return>
<description>
</description>
@@ -39931,7 +44308,7 @@
</description>
</method>
<method name="split">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="divisor" type="String">
</argument>
@@ -39942,7 +44319,7 @@
</description>
</method>
<method name="split_floats">
- <return type="RealArray">
+ <return type="PoolRealArray">
</return>
<argument index="0" name="divisor" type="String">
</argument>
@@ -39975,10 +44352,10 @@
</description>
</method>
<method name="to_ascii">
- <return type="RawArray">
+ <return type="PoolByteArray">
</return>
<description>
- Convert the String (which is a character array) to RawArray (which is an array of bytes). The conversion is speeded up in comparison to to_utf8() with the assumption that all the characters the String contains are only ASCII characters.
+ Convert the String (which is a character array) to PoolByteArray (which is an array of bytes). The conversion is speeded up in comparison to to_utf8() with the assumption that all the characters the String contains are only ASCII characters.
</description>
</method>
<method name="to_float">
@@ -40010,10 +44387,10 @@
</description>
</method>
<method name="to_utf8">
- <return type="RawArray">
+ <return type="PoolByteArray">
</return>
<description>
- Convert the String (which is an array of characters) to RawArray (which is an array of bytes). The conversion is a bit slower than to_ascii(), but supports all UTF-8 characters. Therefore, you should prefer this function over to_ascii().
+ Convert the String (which is an array of characters) to PoolByteArray (which is an array of bytes). The conversion is a bit slower than to_ascii(), but supports all UTF-8 characters. Therefore, you should prefer this function over to_ascii().
</description>
</method>
<method name="xml_escape">
@@ -40034,94 +44411,6 @@
<constants>
</constants>
</class>
-<class name="StringArray" category="Built-In Types">
- <brief_description>
- String Array.
- </brief_description>
- <description>
- String Array. Array of strings. Can only contain strings. Optimized for memory usage, can't fragment the memory.
- </description>
- <methods>
- <method name="StringArray">
- <return type="StringArray">
- </return>
- <argument index="0" name="from" type="Array">
- </argument>
- <description>
- Create from a generic array.
- </description>
- </method>
- <method name="append">
- <argument index="0" name="string" type="String">
- </argument>
- <description>
- Append an element at the end of the array (alias of [method push_back]).
- </description>
- </method>
- <method name="append_array">
- <argument index="0" name="array" type="StringArray">
- </argument>
- <description>
- Append an [StringArray] at the end of this array.
- </description>
- </method>
- <method name="insert">
- <return type="int">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="string" type="String">
- </argument>
- <description>
- Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
- </description>
- </method>
- <method name="invert">
- <description>
- Reverse the order of the elements in the array (so first element will now be the last).
- </description>
- </method>
- <method name="push_back">
- <argument index="0" name="string" type="String">
- </argument>
- <description>
- Append a string element at end of the array.
- </description>
- </method>
- <method name="remove">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Remove an element from the array by index.
- </description>
- </method>
- <method name="resize">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Set the size of the [StringArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
- </description>
- </method>
- <method name="set">
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="string" type="String">
- </argument>
- <description>
- Change the [String] at the given index.
- </description>
- </method>
- <method name="size">
- <return type="int">
- </return>
- <description>
- Return the size of the array.
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
<class name="StyleBox" inherits="Resource" category="Core">
<brief_description>
Base class for drawing stylized boxes for the UI.
@@ -40197,6 +44486,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="content_margin_bottom" type="float" setter="set_default_margin" getter="get_default_margin" brief="">
+ </member>
+ <member name="content_margin_left" type="float" setter="set_default_margin" getter="get_default_margin" brief="">
+ </member>
+ <member name="content_margin_right" type="float" setter="set_default_margin" getter="get_default_margin" brief="">
+ </member>
+ <member name="content_margin_top" type="float" setter="set_default_margin" getter="get_default_margin" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -40293,64 +44592,20 @@
</description>
</method>
</methods>
- <constants>
- </constants>
-</class>
-<class name="StyleBoxImageMask" inherits="StyleBox" category="Core">
- <brief_description>
- Image mask based StyleBox, for mask test.
- </brief_description>
- <description>
- This StyleBox is similar to [StyleBoxTexture], but only meant to be used for mask testing. It takes an image and applies stretch rules to determine if the point clicked is masked or not.
- </description>
- <methods>
- <method name="get_expand" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Return whether the expand property is set(default). When expanding, the image will use the same rules as [StyleBoxTexture] for expand. If not expanding, the image will always be tested at its original size.
- </description>
- </method>
- <method name="get_expand_margin_size" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="margin" type="int">
- </argument>
- <description>
- Return the expand margin size (from enum MARGIN_*). Parts of the image below the size of the margin (and in the direction of the margin) will not expand.
- </description>
- </method>
- <method name="get_image" qualifiers="const">
- <return type="Image">
- </return>
- <description>
- Return the image used for mask testing. (see [method set_image]).
- </description>
- </method>
- <method name="set_expand">
- <argument index="0" name="expand" type="bool">
- </argument>
- <description>
- Set the expand property (default). When expanding, the image will use the same rules as [StyleBoxTexture] for expand. If not expanding, the image will always be tested at its original size.
- </description>
- </method>
- <method name="set_expand_margin_size">
- <argument index="0" name="margin" type="int">
- </argument>
- <argument index="1" name="size" type="float">
- </argument>
- <description>
- Set an expand margin size (from enum MARGIN_*). Parts of the image below the size of the margin (and in the direction of the margin) will not expand.
- </description>
- </method>
- <method name="set_image">
- <argument index="0" name="image" type="Image">
- </argument>
- <description>
- Set the image used for mask testing. Pixels (converted to grey) that have a value, less than 0.5 will fail the test.
- </description>
- </method>
- </methods>
+ <members>
+ <member name="bg_color" type="Color" setter="set_bg_color" getter="get_bg_color" brief="">
+ </member>
+ <member name="border_blend" type="bool" setter="set_border_blend" getter="get_border_blend" brief="">
+ </member>
+ <member name="border_size" type="int" setter="set_border_size" getter="get_border_size" brief="">
+ </member>
+ <member name="dark_color" type="Color" setter="set_dark_color" getter="get_dark_color" brief="">
+ </member>
+ <member name="draw_bg" type="bool" setter="set_draw_center" getter="get_draw_center" brief="">
+ </member>
+ <member name="light_color" type="Color" setter="set_light_color" getter="get_light_color" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -40390,6 +44645,12 @@
<description>
</description>
</method>
+ <method name="get_normal_map" qualifiers="const">
+ <return type="Texture">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_region_rect" qualifiers="const">
<return type="Rect2">
</return>
@@ -40430,6 +44691,12 @@
<description>
</description>
</method>
+ <method name="set_normal_map">
+ <argument index="0" name="normal_map" type="Texture">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_region_rect">
<argument index="0" name="region" type="Rect2">
</argument>
@@ -40443,6 +44710,34 @@
</description>
</method>
</methods>
+ <members>
+ <member name="draw_center" type="bool" setter="set_draw_center" getter="get_draw_center" brief="">
+ </member>
+ <member name="expand_margin_bottom" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" brief="">
+ </member>
+ <member name="expand_margin_left" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" brief="">
+ </member>
+ <member name="expand_margin_right" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" brief="">
+ </member>
+ <member name="expand_margin_top" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" brief="">
+ </member>
+ <member name="margin_bottom" type="float" setter="set_margin_size" getter="get_margin_size" brief="">
+ </member>
+ <member name="margin_left" type="float" setter="set_margin_size" getter="get_margin_size" brief="">
+ </member>
+ <member name="margin_right" type="float" setter="set_margin_size" getter="get_margin_size" brief="">
+ </member>
+ <member name="margin_top" type="float" setter="set_margin_size" getter="get_margin_size" brief="">
+ </member>
+ <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" brief="">
+ </member>
+ <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" brief="">
+ </member>
+ <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" brief="">
+ </member>
+ <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ </members>
<signals>
<signal name="texture_changed">
<description>
@@ -40457,93 +44752,115 @@
Helper tool to create geometry.
</brief_description>
<description>
- Helper tool to create geometry.
+ The [SurfaceTool] is used to construct a [Mesh] by specifying vertex attributes individually. It can be used to construct a [Mesh] from script. All properties except index need to be added before a call to [method add_vertex]. For example adding vertex colors and UVs looks like
+ [codeblock]
+ var st = SurfaceTool.new()
+ st.begin(Mesh.PRIMITIVE_TRIANGLES)
+ st.add_color(Color(1, 0, 0))
+ st.add_uv(Vector2(0, 0))
+ st.add_vertex(Vector3(0, 0, 0))
+ [/codeblock]
+ The [SurfaceTool] now contains one vertex of a triangle which has a UV coordinate and a specified [Color]. If another vertex were added without calls to [method add_uv] or [method add_color] then the last values would be used.
+ It is very important that vertex attributes are passed [b]before[/b] the call to [method add_vertex], failure to do this will result in an error when committing the vertex information to a mesh.
</description>
<methods>
<method name="add_bones">
- <argument index="0" name="bones" type="IntArray">
+ <argument index="0" name="bones" type="PoolIntArray">
</argument>
<description>
+ Add an array of bones for the next Vertex to use.
</description>
</method>
<method name="add_color">
<argument index="0" name="color" type="Color">
</argument>
<description>
+ Specify a [Color] for the next Vertex to use.
</description>
</method>
<method name="add_index">
<argument index="0" name="index" type="int">
</argument>
<description>
+ Adds an index to index array if you are using indexed Vertices. Does not need to be called before adding Vertex.
</description>
</method>
<method name="add_normal">
<argument index="0" name="normal" type="Vector3">
</argument>
<description>
+ Specify a normal for the next Vertex to use.
</description>
</method>
<method name="add_smooth_group">
<argument index="0" name="smooth" type="bool">
</argument>
<description>
+ Specify whether current Vertex (if using only Vertex arrays) or current index (if also using index arrays) should utilize smooth normals for normal calculation.
</description>
</method>
<method name="add_tangent">
<argument index="0" name="tangent" type="Plane">
</argument>
<description>
+ Specify a Tangent for the next Vertex to use.
</description>
</method>
<method name="add_triangle_fan">
- <argument index="0" name="vertexes" type="Vector3Array">
+ <argument index="0" name="vertexes" type="PoolVector3Array">
</argument>
- <argument index="1" name="uvs" type="Vector2Array" default="Vector2Array([])">
+ <argument index="1" name="uvs" type="PoolVector2Array" default="PoolVector2Array([])">
</argument>
- <argument index="2" name="colors" type="ColorArray" default="ColorArray([ColorArray])">
+ <argument index="2" name="colors" type="PoolColorArray" default="PoolColorArray([PoolColorArray])">
</argument>
- <argument index="3" name="uv2s" type="Vector2Array" default="Vector2Array([])">
+ <argument index="3" name="uv2s" type="PoolVector2Array" default="PoolVector2Array([])">
</argument>
- <argument index="4" name="normals" type="Vector3Array" default="Vector3Array([])">
+ <argument index="4" name="normals" type="PoolVector3Array" default="PoolVector3Array([])">
</argument>
- <argument index="5" name="tangents" type="Array" default="Array()">
+ <argument index="5" name="tangents" type="Array" default="[]">
</argument>
<description>
+ Insert a triangle fan made of array data into [Mesh] being constructed.
</description>
</method>
<method name="add_uv">
<argument index="0" name="uv" type="Vector2">
</argument>
<description>
+ Specify UV Coordinate for next Vertex to use.
</description>
</method>
<method name="add_uv2">
<argument index="0" name="uv2" type="Vector2">
</argument>
<description>
+ Specify an optional second set of UV coordinates for next Vertex to use.
</description>
</method>
<method name="add_vertex">
<argument index="0" name="vertex" type="Vector3">
</argument>
<description>
+ Specify position of current Vertex. Should be called after specifying other vertex properties (e.g. Color, UV).
</description>
</method>
<method name="add_weights">
- <argument index="0" name="weights" type="RealArray">
+ <argument index="0" name="weights" type="PoolRealArray">
</argument>
<description>
+ Specify weight value for next Vertex to use.
</description>
</method>
<method name="begin">
<argument index="0" name="primitive" type="int">
</argument>
<description>
+ Called before adding any Vertices. Takes the primitive type as an argument (e.g. Mesh.PRIMITIVE_TRIANGLES).
</description>
</method>
<method name="clear">
<description>
+ Clear all information passed into the surface tool so far.
</description>
</method>
<method name="commit">
@@ -40552,24 +44869,29 @@
<argument index="0" name="existing" type="Mesh" default="NULL">
</argument>
<description>
+ Returns a constructed [Mesh] from current information passed in. If an existing [Mesh] is passed in as an argument, will add an extra surface to the existing [Mesh].
</description>
</method>
<method name="deindex">
<description>
+ Removes index array by expanding Vertex array.
</description>
</method>
<method name="generate_normals">
<description>
+ Generates normals from Vertices so you do not have to do it manually.
</description>
</method>
<method name="index">
<description>
+ Shrinks Vertex array by creating an index array. Avoids reusing Vertices.
</description>
</method>
<method name="set_material">
<argument index="0" name="material" type="Material">
</argument>
<description>
+ Sets [Material] to be used by the [Mesh] you are constructing.
</description>
</method>
</methods>
@@ -40596,7 +44918,7 @@
</return>
<argument index="0" name="port" type="int">
</argument>
- <argument index="1" name="bind_address" type="String" default="*">
+ <argument index="1" name="bind_address" type="String" default="&quot;*&quot;">
</argument>
<description>
Listen on the "port" binding to "bind_address".
@@ -40644,13 +44966,6 @@
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>
@@ -40663,6 +44978,13 @@
<description>
</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_tab_align" qualifiers="const">
<return type="int">
</return>
@@ -40686,6 +45008,14 @@
Return the amount of tabs.
</description>
</method>
+ <method name="get_tab_disabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_tab_icon" qualifiers="const">
<return type="Texture">
</return>
@@ -40723,6 +45053,14 @@
Set tab alignment, from the ALIGN_* enum. Moves tabs to the left, right or center.
</description>
</method>
+ <method name="set_tab_disabled">
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <argument index="1" name="disabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_tab_icon">
<argument index="0" name="tab_idx" type="int">
</argument>
@@ -40749,6 +45087,14 @@
</description>
</method>
</methods>
+ <members>
+ <member name="current_tab" type="int" setter="set_current_tab" getter="get_current_tab" brief="">
+ </member>
+ <member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" brief="">
+ </member>
+ <member name="tabs_visible" type="bool" setter="set_tabs_visible" getter="are_tabs_visible" brief="">
+ </member>
+ </members>
<signals>
<signal name="pre_popup_pressed">
<description>
@@ -40761,7 +45107,7 @@
Emitted only when the current tab changes.
</description>
</signal>
- <signal name="tab_selected">
+ <signal name="tab_selected">
<argument index="0" name="tab" type="int">
</argument>
<description>
@@ -40774,19 +45120,21 @@
<theme_items>
<theme_item name="decrement" type="Texture">
</theme_item>
- <theme_item name="decrement_hilite" type="Texture">
+ <theme_item name="decrement_highlight" type="Texture">
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color_bg" type="Color">
</theme_item>
+ <theme_item name="font_color_disabled" type="Color">
+ </theme_item>
<theme_item name="font_color_fg" type="Color">
</theme_item>
<theme_item name="hseparation" type="int">
</theme_item>
<theme_item name="increment" type="Texture">
</theme_item>
- <theme_item name="increment_hilite" type="Texture">
+ <theme_item name="increment_highlight" type="Texture">
</theme_item>
<theme_item name="label_valign_bg" type="int">
</theme_item>
@@ -40794,7 +45142,7 @@
</theme_item>
<theme_item name="menu" type="Texture">
</theme_item>
- <theme_item name="menu_hilite" type="Texture">
+ <theme_item name="menu_highlight" type="Texture">
</theme_item>
<theme_item name="panel" type="StyleBox">
</theme_item>
@@ -40848,6 +45196,14 @@
<description>
</description>
</method>
+ <method name="get_tab_disabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_tab_icon" qualifiers="const">
<return type="Texture">
</return>
@@ -40856,6 +45212,15 @@
<description>
</description>
</method>
+ <method name="get_tab_rect">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <description>
+ Returns tab [Rect2] with local position and size.
+ </description>
+ </method>
<method name="get_tab_title" qualifiers="const">
<return type="String">
</return>
@@ -40864,6 +45229,15 @@
<description>
</description>
</method>
+ <method name="move_tab">
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ Rearrange tab.
+ </description>
+ </method>
<method name="remove_tab">
<argument index="0" name="tab_idx" type="int">
</argument>
@@ -40882,6 +45256,14 @@
<description>
</description>
</method>
+ <method name="set_tab_disabled">
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <argument index="1" name="disabled" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_tab_icon">
<argument index="0" name="tab_idx" type="int">
</argument>
@@ -40899,7 +45281,17 @@
</description>
</method>
</methods>
+ <members>
+ <member name="current_tab" type="int" setter="set_current_tab" getter="get_current_tab" brief="">
+ </member>
+ </members>
<signals>
+ <signal name="reposition_active_tab_request">
+ <argument index="0" name="idx_to" type="int">
+ </argument>
+ <description>
+ </description>
+ </signal>
<signal name="right_button_pressed">
<argument index="0" name="tab" type="int">
</argument>
@@ -40918,6 +45310,12 @@
<description>
</description>
</signal>
+ <signal name="tab_hover">
+ <argument index="0" name="tab" type="int">
+ </argument>
+ <description>
+ </description>
+ </signal>
</signals>
<constants>
<constant name="ALIGN_LEFT" value="0">
@@ -40942,19 +45340,21 @@
</theme_item>
<theme_item name="decrement" type="Texture">
</theme_item>
- <theme_item name="decrement_hilite" type="Texture">
+ <theme_item name="decrement_highlight" type="Texture">
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color_bg" type="Color">
</theme_item>
+ <theme_item name="font_color_disabled" type="Color">
+ </theme_item>
<theme_item name="font_color_fg" type="Color">
</theme_item>
<theme_item name="hseparation" type="int">
</theme_item>
<theme_item name="increment" type="Texture">
</theme_item>
- <theme_item name="increment_hilite" type="Texture">
+ <theme_item name="increment_highlight" type="Texture">
</theme_item>
<theme_item name="label_valign_bg" type="int">
</theme_item>
@@ -40970,18 +45370,6 @@
</theme_item>
</theme_items>
</class>
-<class name="TestCube" inherits="GeometryInstance" category="Core">
- <brief_description>
- A simple cube used for testing in 3D.
- </brief_description>
- <description>
- The TestCube is a simple 2x2x2 cube with a basic texture. It can be used as a placeholder, to verify how the lighting looks, to test shaders, or any other task you may need a textured model to test with.
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
<class name="TextEdit" inherits="Control" category="Core">
<brief_description>
Multiline text editing control.
@@ -41086,7 +45474,7 @@
<method name="cursor_set_column">
<argument index="0" name="column" type="int">
</argument>
- <argument index="1" name="adjust_viewport" type="bool" default="false">
+ <argument index="1" name="adjust_viewport" type="bool" default="true">
</argument>
<description>
</description>
@@ -41094,7 +45482,7 @@
<method name="cursor_set_line">
<argument index="0" name="line" type="int">
</argument>
- <argument index="1" name="adjust_viewport" type="bool" default="false">
+ <argument index="1" name="adjust_viewport" type="bool" default="true">
</argument>
<description>
</description>
@@ -41226,7 +45614,7 @@
</description>
</method>
<method name="search" qualifiers="const">
- <return type="IntArray">
+ <return type="PoolIntArray">
</return>
<argument index="0" name="flags" type="String">
</argument>
@@ -41258,13 +45646,6 @@
Select all the text.
</description>
</method>
- <method name="set_custom_bg_color">
- <argument index="0" name="color" type="Color">
- </argument>
- <description>
- Set a custom background color. A background color with alpha==0 disables this.
- </description>
- </method>
<method name="set_highlight_all_occurrences">
<argument index="0" name="enable" type="bool">
</argument>
@@ -41293,13 +45674,6 @@
Set to enable showing line numbers.
</description>
</method>
- <method name="set_symbol_color">
- <argument index="0" name="color" type="Color">
- </argument>
- <description>
- Set the color for symbols.
- </description>
- </method>
<method name="set_syntax_coloring">
<argument index="0" name="enable" type="bool">
</argument>
@@ -41327,6 +45701,20 @@
</description>
</method>
</methods>
+ <members>
+ <member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled" brief="">
+ </member>
+ <member name="caret_blink_speed" type="float" setter="cursor_set_blink_speed" getter="cursor_get_blink_speed" brief="">
+ </member>
+ <member name="caret_block_mode" type="bool" setter="cursor_set_block_mode" getter="cursor_is_block_mode" brief="">
+ </member>
+ <member name="highlight_all_occurrences" type="bool" setter="set_highlight_all_occurrences" getter="is_highlight_all_occurrences_enabled" brief="">
+ </member>
+ <member name="show_line_numbers" type="bool" setter="set_show_line_numbers" getter="is_show_line_numbers_enabled" brief="">
+ </member>
+ <member name="syntax_highlighting" type="bool" setter="set_syntax_coloring" getter="is_syntax_coloring_enabled" brief="">
+ </member>
+ </members>
<signals>
<signal name="breakpoint_toggled">
<argument index="0" name="row" type="int">
@@ -41386,6 +45774,8 @@
</constant>
</constants>
<theme_items>
+ <theme_item name="background_color" type="Color">
+ </theme_item>
<theme_item name="brace_mismatch_color" type="Color">
</theme_item>
<theme_item name="breakpoint_color" type="Color">
@@ -41463,6 +45853,8 @@
</argument>
<argument index="3" name="transpose" type="bool" default="false">
</argument>
+ <argument index="4" name="normal_map" type="Texture" default="NULL">
+ </argument>
<description>
</description>
</method>
@@ -41477,6 +45869,8 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
+ <argument index="5" name="normal_map" type="Texture" default="NULL">
+ </argument>
<description>
</description>
</method>
@@ -41491,6 +45885,10 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
+ <argument index="5" name="normal_map" type="Texture" default="NULL">
+ </argument>
+ <argument index="6" name="clip_uv" type="bool" default="true">
+ </argument>
<description>
</description>
</method>
@@ -41508,13 +45906,6 @@
Return the texture height.
</description>
</method>
- <method name="get_rid" qualifiers="const">
- <return type="RID">
- </return>
- <description>
- Return the texture RID as used in the [VisualServer].
- </description>
- </method>
<method name="get_size" qualifiers="const">
<return type="Vector2">
</return>
@@ -41588,20 +45979,20 @@
<description>
</description>
</method>
- <method name="get_focused_texture" qualifiers="const">
- <return type="Texture">
+ <method name="get_expand" qualifiers="const">
+ <return type="bool">
</return>
<description>
</description>
</method>
- <method name="get_hover_texture" qualifiers="const">
+ <method name="get_focused_texture" qualifiers="const">
<return type="Texture">
</return>
<description>
</description>
</method>
- <method name="get_modulate" qualifiers="const">
- <return type="Color">
+ <method name="get_hover_texture" qualifiers="const">
+ <return type="Texture">
</return>
<description>
</description>
@@ -41618,8 +46009,8 @@
<description>
</description>
</method>
- <method name="get_texture_scale" qualifiers="const">
- <return type="Vector2">
+ <method name="get_stretch_mode" qualifiers="const">
+ <return type="int">
</return>
<description>
</description>
@@ -41636,20 +46027,20 @@
<description>
</description>
</method>
- <method name="set_focused_texture">
- <argument index="0" name="texture" type="Texture">
+ <method name="set_expand">
+ <argument index="0" name="p_expand" type="bool">
</argument>
<description>
</description>
</method>
- <method name="set_hover_texture">
+ <method name="set_focused_texture">
<argument index="0" name="texture" type="Texture">
</argument>
<description>
</description>
</method>
- <method name="set_modulate">
- <argument index="0" name="color" type="Color">
+ <method name="set_hover_texture">
+ <argument index="0" name="texture" type="Texture">
</argument>
<description>
</description>
@@ -41666,87 +46057,45 @@
<description>
</description>
</method>
- <method name="set_texture_scale">
- <argument index="0" name="scale" type="Vector2">
- </argument>
- <description>
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="TextureRect" inherits="Control" category="Core">
- <brief_description>
- Control Frame that draws a texture.
- </brief_description>
- <description>
- Control frame that simply draws an assigned texture. It can stretch or not. It's a simple way to just show an image in a UI.
- </description>
- <methods>
- <method name="get_modulate" qualifiers="const">
- <return type="Color">
- </return>
- <description>
- </description>
- </method>
- <method name="get_stretch_mode" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="get_texture" qualifiers="const">
- <return type="Object">
- </return>
- <description>
- </description>
- </method>
- <method name="has_expand" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
- <method name="set_expand">
- <argument index="0" name="enable" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_modulate">
- <argument index="0" name="modulate" type="Color">
- </argument>
- <description>
- </description>
- </method>
<method name="set_stretch_mode">
- <argument index="0" name="stretch_mode" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_texture">
- <argument index="0" name="texture" type="Object">
+ <argument index="0" name="p_mode" type="int">
</argument>
<description>
</description>
</method>
</methods>
+ <members>
+ <member name="expand" type="bool" setter="set_expand" getter="get_expand" brief="">
+ </member>
+ <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" brief="">
+ </member>
+ <member name="texture_click_mask" type="BitMap" setter="set_click_mask" getter="get_click_mask" brief="">
+ </member>
+ <member name="texture_disabled" type="Texture" setter="set_disabled_texture" getter="get_disabled_texture" brief="">
+ </member>
+ <member name="texture_focused" type="Texture" setter="set_focused_texture" getter="get_focused_texture" brief="">
+ </member>
+ <member name="texture_hover" type="Texture" setter="set_hover_texture" getter="get_hover_texture" brief="">
+ </member>
+ <member name="texture_normal" type="Texture" setter="set_normal_texture" getter="get_normal_texture" brief="">
+ </member>
+ <member name="texture_pressed" type="Texture" setter="set_pressed_texture" getter="get_pressed_texture" brief="">
+ </member>
+ </members>
<constants>
- <constant name="STRETCH_SCALE_ON_EXPAND" value="0">
+ <constant name="STRETCH_SCALE" value="0">
</constant>
- <constant name="STRETCH_SCALE" value="1">
+ <constant name="STRETCH_TILE" value="1">
</constant>
- <constant name="STRETCH_TILE" value="2">
+ <constant name="STRETCH_KEEP" value="2">
</constant>
- <constant name="STRETCH_KEEP" value="3">
+ <constant name="STRETCH_KEEP_CENTERED" value="3">
</constant>
- <constant name="STRETCH_KEEP_CENTERED" value="4">
+ <constant name="STRETCH_KEEP_ASPECT" value="4">
</constant>
- <constant name="STRETCH_KEEP_ASPECT" value="5">
+ <constant name="STRETCH_KEEP_ASPECT_CENTERED" value="5">
</constant>
- <constant name="STRETCH_KEEP_ASPECT_CENTERED" value="6">
+ <constant name="STRETCH_KEEP_ASPECT_COVERED" value="6">
</constant>
</constants>
</class>
@@ -41843,6 +46192,22 @@
</description>
</method>
</methods>
+ <members>
+ <member name="fill_mode" type="int" setter="set_fill_mode" getter="get_fill_mode" brief="">
+ </member>
+ <member name="radial_center_offset" type="Vector2" setter="set_radial_center_offset" getter="get_radial_center_offset" brief="">
+ </member>
+ <member name="radial_fill_degrees" type="float" setter="set_fill_degrees" getter="get_fill_degrees" brief="">
+ </member>
+ <member name="radial_initial_angle" type="float" setter="set_radial_initial_angle" getter="get_radial_initial_angle" brief="">
+ </member>
+ <member name="texture_over" type="Texture" setter="set_over_texture" getter="get_over_texture" brief="">
+ </member>
+ <member name="texture_progress" type="Texture" setter="set_progress_texture" getter="get_progress_texture" brief="">
+ </member>
+ <member name="texture_under" type="Texture" setter="set_under_texture" getter="get_under_texture" brief="">
+ </member>
+ </members>
<constants>
<constant name="FILL_LEFT_TO_RIGHT" value="0">
</constant>
@@ -41858,6 +46223,78 @@
</constant>
</constants>
</class>
+<class name="TextureRect" inherits="Control" category="Core">
+ <brief_description>
+ Control Frame that draws a texture.
+ </brief_description>
+ <description>
+ Control frame that simply draws an assigned texture. It can stretch or not. It's a simple way to just show an image in a UI.
+ </description>
+ <methods>
+ <method name="get_stretch_mode" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_texture" qualifiers="const">
+ <return type="Object">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="has_expand" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_expand">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_stretch_mode">
+ <argument index="0" name="stretch_mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_texture">
+ <argument index="0" name="texture" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="expand" type="bool" setter="set_expand" getter="has_expand" brief="">
+ </member>
+ <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" brief="">
+ </member>
+ <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ </members>
+ <constants>
+ <constant name="STRETCH_SCALE_ON_EXPAND" value="0">
+ </constant>
+ <constant name="STRETCH_SCALE" value="1">
+ </constant>
+ <constant name="STRETCH_TILE" value="2">
+ </constant>
+ <constant name="STRETCH_KEEP" value="3">
+ </constant>
+ <constant name="STRETCH_KEEP_CENTERED" value="4">
+ </constant>
+ <constant name="STRETCH_KEEP_ASPECT" value="5">
+ </constant>
+ <constant name="STRETCH_KEEP_ASPECT_CENTERED" value="6">
+ </constant>
+ <constant name="STRETCH_KEEP_ASPECT_COVERED" value="7">
+ </constant>
+ </constants>
+</class>
<class name="Theme" inherits="Resource" category="Core">
<brief_description>
Theme for controls.
@@ -41922,7 +46359,7 @@
</description>
</method>
<method name="get_color_list" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="type" type="String">
</argument>
@@ -41940,7 +46377,7 @@
</description>
</method>
<method name="get_constant_list" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="type" type="String">
</argument>
@@ -41964,7 +46401,7 @@
</description>
</method>
<method name="get_font_list" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="type" type="String">
</argument>
@@ -41982,7 +46419,7 @@
</description>
</method>
<method name="get_icon_list" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="type" type="String">
</argument>
@@ -42000,7 +46437,7 @@
</description>
</method>
<method name="get_stylebox_list" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="type" type="String">
</argument>
@@ -42008,13 +46445,13 @@
</description>
</method>
<method name="get_stylebox_types" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
</description>
</method>
<method name="get_type_list" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<argument index="0" name="type" type="String">
</argument>
@@ -42128,6 +46565,10 @@
</description>
</method>
</methods>
+ <members>
+ <member name="default_font" type="Font" setter="set_default_font" getter="get_default_font" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -42136,7 +46577,7 @@
A unit of execution in a process.
</brief_description>
<description>
- A unit of execution in a process. Can run methods on [Object]s simultaneously. The use of synchronization via [Mutex], [Semaphore] is advised if working with shared objects.
+ A unit of execution in a process. Can run methods on [Object]\ s simultaneously. The use of synchronization via [Mutex], [Semaphore] is advised if working with shared objects.
</description>
<methods>
<method name="get_id" qualifiers="const">
@@ -42262,6 +46703,14 @@
Return the collision layer.
</description>
</method>
+ <method name="get_collision_layer_bit" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_collision_mask" qualifiers="const">
<return type="int">
</return>
@@ -42269,6 +46718,14 @@
Return the collision mask.
</description>
</method>
+ <method name="get_collision_mask_bit" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_collision_use_kinematic" qualifiers="const">
<return type="bool">
</return>
@@ -42277,7 +46734,7 @@
</description>
</method>
<method name="get_custom_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Return the custom transform matrix.
@@ -42331,6 +46788,12 @@
Return an array of all cells containing a tile from the tileset (i.e. a tile index different from -1).
</description>
</method>
+ <method name="get_used_rect">
+ <return type="Rect2">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_cell_transposed" qualifiers="const">
<return type="bool">
</return>
@@ -42455,13 +46918,21 @@
</description>
</method>
<method name="set_collision_layer">
- <argument index="0" name="mask" type="int">
+ <argument index="0" name="layer" type="int">
</argument>
<description>
Set the collision layer.
Layers are referenced by binary indexes, so allowable values to describe the 20 available layers range from 0 to 2^20-1.
</description>
</method>
+ <method name="set_collision_layer_bit">
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <argument index="1" name="value" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_collision_mask">
<argument index="0" name="mask" type="int">
</argument>
@@ -42470,6 +46941,14 @@
Masks are referenced by binary indexes, so allowable values to describe the 20 available masks range from 0 to 2^20-1.
</description>
</method>
+ <method name="set_collision_mask_bit">
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <argument index="1" name="value" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_collision_use_kinematic">
<argument index="0" name="use_kinematic" type="bool">
</argument>
@@ -42478,7 +46957,7 @@
</description>
</method>
<method name="set_custom_transform">
- <argument index="0" name="custom_transform" type="Matrix32">
+ <argument index="0" name="custom_transform" type="Transform2D">
</argument>
<description>
Set custom transform matrix, to use in combination with the custom orientation mode.
@@ -42545,6 +47024,38 @@
</description>
</method>
</methods>
+ <members>
+ <member name="cell_custom_transform" type="Transform2D" setter="set_custom_transform" getter="get_custom_transform" brief="">
+ </member>
+ <member name="cell_half_offset" type="int" setter="set_half_offset" getter="get_half_offset" brief="">
+ </member>
+ <member name="cell_quadrant_size" type="int" setter="set_quadrant_size" getter="get_quadrant_size" brief="">
+ </member>
+ <member name="cell_size" type="Vector2" setter="set_cell_size" getter="get_cell_size" brief="">
+ </member>
+ <member name="cell_tile_origin" type="int" setter="set_tile_origin" getter="get_tile_origin" brief="">
+ </member>
+ <member name="cell_y_sort" type="bool" setter="set_y_sort_mode" getter="is_y_sort_mode_enabled" brief="">
+ </member>
+ <member name="collision_bounce" type="float" setter="set_collision_bounce" getter="get_collision_bounce" brief="">
+ </member>
+ <member name="collision_friction" type="float" setter="set_collision_friction" getter="get_collision_friction" brief="">
+ </member>
+ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief="">
+ </member>
+ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief="">
+ </member>
+ <member name="collision_use_kinematic" type="bool" setter="set_collision_use_kinematic" getter="get_collision_use_kinematic" brief="">
+ </member>
+ <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="">
+ </member>
+ <member name="occluder_light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" brief="">
+ </member>
+ <member name="tile_data" type="Object" setter="_set_tile_data" getter="_get_tile_data" brief="">
+ </member>
+ <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset" brief="">
+ </member>
+ </members>
<signals>
<signal name="settings_changed">
<description>
@@ -42635,6 +47146,18 @@
Remove the tile referenced by the given ID.
</description>
</method>
+ <method name="tile_add_shape">
+ <argument index="0" name="id" type="int">
+ </argument>
+ <argument index="1" name="shape" type="Shape2D">
+ </argument>
+ <argument index="2" name="shape_transform" type="Transform2D">
+ </argument>
+ <argument index="3" name="one_way" type="bool" default="false">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="tile_get_light_occluder" qualifiers="const">
<return type="OccluderPolygon2D">
</return>
@@ -42645,7 +47168,7 @@
</description>
</method>
<method name="tile_get_material" qualifiers="const">
- <return type="CanvasItemMaterial">
+ <return type="ShaderMaterial">
</return>
<argument index="0" name="id" type="int">
</argument>
@@ -42680,6 +47203,14 @@
Return the offset of the tile's navigation polygon.
</description>
</method>
+ <method name="tile_get_normal_map" qualifiers="const">
+ <return type="Texture">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="tile_get_occluder_offset" qualifiers="const">
<return type="Vector2">
</return>
@@ -42703,17 +47234,37 @@
</return>
<argument index="0" name="id" type="int">
</argument>
+ <argument index="1" name="shape_id" type="int">
+ </argument>
<description>
- Return the shape of the tile.
</description>
</method>
- <method name="tile_get_shape_offset" qualifiers="const">
- <return type="Vector2">
+ <method name="tile_get_shape_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="tile_get_shape_one_way" qualifiers="const">
+ <return type="bool">
</return>
<argument index="0" name="id" type="int">
</argument>
+ <argument index="1" name="shape_id" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="tile_get_shape_transform" qualifiers="const">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <argument index="1" name="shape_id" type="int">
+ </argument>
<description>
- Return the shape offset of the tile.
</description>
</method>
<method name="tile_get_shapes" qualifiers="const">
@@ -42755,7 +47306,7 @@
<method name="tile_set_material">
<argument index="0" name="id" type="int">
</argument>
- <argument index="1" name="material" type="CanvasItemMaterial">
+ <argument index="1" name="material" type="ShaderMaterial">
</argument>
<description>
Set the material of the tile.
@@ -42788,6 +47339,14 @@
Set an offset for the tile's navigation polygon.
</description>
</method>
+ <method name="tile_set_normal_map">
+ <argument index="0" name="id" type="int">
+ </argument>
+ <argument index="1" name="normal_map" type="Texture">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="tile_set_occluder_offset">
<argument index="0" name="id" type="int">
</argument>
@@ -42809,19 +47368,31 @@
<method name="tile_set_shape">
<argument index="0" name="id" type="int">
</argument>
- <argument index="1" name="shape" type="Shape2D">
+ <argument index="1" name="shape_id" type="int">
+ </argument>
+ <argument index="2" name="shape" type="Shape2D">
</argument>
<description>
- Set a shape for the tile, enabling physics to collide with it.
</description>
</method>
- <method name="tile_set_shape_offset">
+ <method name="tile_set_shape_one_way">
<argument index="0" name="id" type="int">
</argument>
- <argument index="1" name="shape_offset" type="Vector2">
+ <argument index="1" name="shape_id" type="int">
+ </argument>
+ <argument index="2" name="one_way" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="tile_set_shape_transform">
+ <argument index="0" name="id" type="int">
+ </argument>
+ <argument index="1" name="shape_id" type="int">
+ </argument>
+ <argument index="2" name="shape_transform" type="Transform2D">
</argument>
<description>
- Set the shape offset of the tile.
</description>
</method>
<method name="tile_set_shapes">
@@ -42891,25 +47462,24 @@
Return true if set to automatically start when entering the scene.
</description>
</method>
- <method name="is_active" qualifiers="const">
+ <method name="is_one_shot" qualifiers="const">
<return type="bool">
</return>
<description>
- Return if the timer is active or not.
+ Return true if configured as one-shot.
</description>
</method>
- <method name="is_one_shot" qualifiers="const">
+ <method name="is_paused" qualifiers="const">
<return type="bool">
</return>
<description>
- Return true if configured as one-shot.
+ Return if the timer is paused or not.
</description>
</method>
- <method name="set_active">
- <argument index="0" name="active" type="bool">
- </argument>
+ <method name="is_stopped" qualifiers="const">
+ <return type="bool">
+ </return>
<description>
- Set whether the timer is active or not. An inactive timer will be paused until it is activated again.
</description>
</method>
<method name="set_autostart">
@@ -42926,6 +47496,13 @@
Set as one-shot. If enabled, the timer will stop after timeout, otherwise it will automatically restart.
</description>
</method>
+ <method name="set_paused">
+ <argument index="0" name="paused" type="bool">
+ </argument>
+ <description>
+ Set whether the timer is paused or not. A paused timer will be inactive until it is unpaused again.
+ </description>
+ </method>
<method name="set_timer_process_mode">
<argument index="0" name="mode" type="int">
</argument>
@@ -42951,6 +47528,16 @@
</description>
</method>
</methods>
+ <members>
+ <member name="autostart" type="bool" setter="set_autostart" getter="has_autostart" brief="">
+ </member>
+ <member name="one_shot" type="bool" setter="set_one_shot" getter="is_one_shot" brief="">
+ </member>
+ <member name="process_mode" type="int" setter="set_timer_process_mode" getter="get_timer_process_mode" brief="">
+ </member>
+ <member name="wait_time" type="float" setter="set_wait_time" getter="get_wait_time" brief="">
+ </member>
+ </members>
<signals>
<signal name="timeout">
<description>
@@ -43019,6 +47606,12 @@
<description>
</description>
</method>
+ <method name="get_shape" qualifiers="const">
+ <return type="Object">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_texture" qualifiers="const">
<return type="Object">
</return>
@@ -43049,6 +47642,18 @@
<description>
</description>
</method>
+ <method name="is_shape_centered" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_shape_visible" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="set_action">
<argument index="0" name="action" type="String">
</argument>
@@ -43067,6 +47672,24 @@
<description>
</description>
</method>
+ <method name="set_shape">
+ <argument index="0" name="shape" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_shape_centered">
+ <argument index="0" name="bool" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_shape_visible">
+ <argument index="0" name="bool" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_texture">
<argument index="0" name="texture" type="Object">
</argument>
@@ -43086,6 +47709,26 @@
</description>
</method>
</methods>
+ <members>
+ <member name="action" type="String" setter="set_action" getter="get_action" brief="">
+ </member>
+ <member name="bitmask" type="BitMap" setter="set_bitmask" getter="get_bitmask" brief="">
+ </member>
+ <member name="normal" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ </member>
+ <member name="passby_press" type="bool" setter="set_passby_press" getter="is_passby_press_enabled" brief="">
+ </member>
+ <member name="pressed" type="Texture" setter="set_texture_pressed" getter="get_texture_pressed" brief="">
+ </member>
+ <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape" brief="">
+ </member>
+ <member name="shape_centered" type="bool" setter="set_shape_centered" getter="is_shape_centered" brief="">
+ </member>
+ <member name="shape_visible" type="bool" setter="set_shape_visible" getter="is_shape_visible" brief="">
+ </member>
+ <member name="visibility_mode" type="int" setter="set_visibility_mode" getter="get_visibility_mode" brief="">
+ </member>
+ </members>
<signals>
<signal name="pressed">
<description>
@@ -43104,7 +47747,7 @@
3D Transformation.
</brief_description>
<description>
- Transform is used to store translation, rotation and scaling transformations. It consists of a Matrix3 "basis" and Vector3 "origin". Transform is used to represent transformations of objects in space, and as such, determine their position, orientation and scale. It is similar to a 3x4 matrix.
+ Transform is used to store translation, rotation and scaling transformations. It consists of a Basis "basis" and Vector3 "origin". Transform is used to represent transformations of objects in space, and as such, determine their position, orientation and scale. It is similar to a 3x4 matrix.
</description>
<methods>
<method name="Transform">
@@ -43125,21 +47768,21 @@
<method name="Transform">
<return type="Transform">
</return>
- <argument index="0" name="basis" type="Matrix3">
+ <argument index="0" name="basis" type="Basis">
</argument>
<argument index="1" name="origin" type="Vector3">
</argument>
<description>
- Construct the Transform from a Matrix3 and Vector3.
+ Construct the Transform from a Basis and Vector3.
</description>
</method>
<method name="Transform">
<return type="Transform">
</return>
- <argument index="0" name="from" type="Matrix32">
+ <argument index="0" name="from" type="Transform2D">
</argument>
<description>
- Construct the Transform from a Matrix32.
+ Construct the Transform from a Transform2D.
</description>
</method>
<method name="Transform">
@@ -43154,10 +47797,10 @@
<method name="Transform">
<return type="Transform">
</return>
- <argument index="0" name="from" type="Matrix3">
+ <argument index="0" name="from" type="Basis">
</argument>
<description>
- Construct the Transform from a Matrix3. The origin will be Vector3(0, 0, 0).
+ Construct the Transform from a Basis. The origin will be Vector3(0, 0, 0).
</description>
</method>
<method name="affine_inverse">
@@ -43241,16 +47884,170 @@
</method>
</methods>
<members>
- <member name="basis" type="Matrix3">
+ <member name="basis" type="Basis" setter="" getter="" brief="">
The basis is a matrix containing 3 [Vector3] as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system travelling with the object.
</member>
- <member name="origin" type="Vector3">
+ <member name="origin" type="Vector3" setter="" getter="" brief="">
The origin of the transform. Which is the translation offset.
</member>
</members>
<constants>
</constants>
</class>
+<class name="Transform2D" category="Built-In Types">
+ <brief_description>
+ 3x2 Matrix for 2D transforms.
+ </brief_description>
+ <description>
+ 3x2 Matrix for 2D transforms.
+ </description>
+ <methods>
+ <method name="Transform2D">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="from" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="Transform2D">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="x_axis" type="Vector2">
+ </argument>
+ <argument index="1" name="y_axis" type="Vector2">
+ </argument>
+ <argument index="2" name="origin" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="Transform2D">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="rot" type="float">
+ </argument>
+ <argument index="1" name="pos" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="affine_inverse">
+ <return type="Transform2D">
+ </return>
+ <description>
+ Return the inverse of the matrix.
+ </description>
+ </method>
+ <method name="basis_xform">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="v" type="var">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="basis_xform_inv">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="v" type="var">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_origin">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_rotation">
+ <return type="float">
+ </return>
+ <description>
+ Return the rotation (in radians).
+ </description>
+ </method>
+ <method name="get_scale">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="interpolate_with">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="m" type="Transform2D">
+ </argument>
+ <argument index="1" name="c" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="inverse">
+ <return type="Transform2D">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="orthonormalized">
+ <return type="Transform2D">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="rotated">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="phi" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="scaled">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="scale" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="translated">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="offset" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="xform">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="v" type="var">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="xform_inv">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="v" type="var">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="origin" type="Vector2" setter="" getter="" brief="">
+ </member>
+ <member name="x" type="Vector2" setter="" getter="" brief="">
+ </member>
+ <member name="y" type="Vector2" setter="" getter="" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
<class name="Translation" inherits="Resource" category="Core">
<brief_description>
Language Translation.
@@ -43298,7 +48095,7 @@
</description>
</method>
<method name="get_message_list" qualifiers="const">
- <return type="StringArray">
+ <return type="PoolStringArray">
</return>
<description>
Return all the messages (keys).
@@ -43312,6 +48109,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="locale" type="String" setter="set_locale" getter="get_locale" brief="">
+ </member>
+ <member name="messages" type="PoolStringArray" setter="_set_messages" getter="_get_messages" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -43547,12 +48350,6 @@
Get whether the editing of a cell should only happen when it is already selected.
</description>
</method>
- <method name="is_delayed_text_editor_enabled" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
<method name="is_folding_hidden" qualifiers="const">
<return type="bool">
</return>
@@ -43608,12 +48405,6 @@
Set the amount of columns.
</description>
</method>
- <method name="set_delayed_text_editor">
- <argument index="0" name="enable" type="bool">
- </argument>
- <description>
- </description>
- </method>
<method name="set_drop_mode_flags">
<argument index="0" name="flags" type="int">
</argument>
@@ -43667,6 +48458,12 @@
Emitted when a cell is selected.
</description>
</signal>
+ <signal name="column_title_pressed">
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ </description>
+ </signal>
<signal name="custom_popup_edited">
<argument index="0" name="arrow_clicked" type="bool">
</argument>
@@ -43693,6 +48490,10 @@
Emitted when an item is collapsed by a click on the folding arrow.
</description>
</signal>
+ <signal name="item_custom_button_pressed">
+ <description>
+ </description>
+ </signal>
<signal name="item_double_clicked">
<description>
</description>
@@ -43760,6 +48561,14 @@
</theme_item>
<theme_item name="cursor_unfocused" type="StyleBox">
</theme_item>
+ <theme_item name="custom_button" type="StyleBox">
+ </theme_item>
+ <theme_item name="custom_button_font_highlight" type="Color">
+ </theme_item>
+ <theme_item name="custom_button_hover" type="StyleBox">
+ </theme_item>
+ <theme_item name="custom_button_pressed" type="StyleBox">
+ </theme_item>
<theme_item name="draw_relationship_lines" type="int">
</theme_item>
<theme_item name="drop_position_color" type="Color">
@@ -43780,6 +48589,10 @@
</theme_item>
<theme_item name="relationship_line_color" type="Color">
</theme_item>
+ <theme_item name="scroll_border" type="int">
+ </theme_item>
+ <theme_item name="scroll_speed" type="int">
+ </theme_item>
<theme_item name="select_arrow" type="Texture">
</theme_item>
<theme_item name="selected" type="StyleBox">
@@ -43821,6 +48634,8 @@
</argument>
<argument index="3" name="disabled" type="bool" default="false">
</argument>
+ <argument index="4" name="tooltip" type="String" default="&quot;&quot;">
+ </argument>
<description>
</description>
</method>
@@ -43890,6 +48705,14 @@
<description>
</description>
</method>
+ <method name="get_expand_right" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_icon" qualifiers="const">
<return type="Texture">
</return>
@@ -43974,6 +48797,14 @@
<description>
</description>
</method>
+ <method name="get_text_align" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_tooltip" qualifiers="const">
<return type="String">
</return>
@@ -44006,6 +48837,14 @@
<description>
</description>
</method>
+ <method name="is_custom_set_as_button" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="is_editable">
<return type="bool">
</return>
@@ -44014,6 +48853,12 @@
<description>
</description>
</method>
+ <method name="is_folding_disabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_selectable" qualifiers="const">
<return type="bool">
</return>
@@ -44084,6 +48929,14 @@
<description>
</description>
</method>
+ <method name="set_custom_as_button">
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_custom_bg_color">
<argument index="0" name="column" type="int">
</argument>
@@ -44112,6 +48965,12 @@
<description>
</description>
</method>
+ <method name="set_disable_folding">
+ <argument index="0" name="disable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_editable">
<argument index="0" name="column" type="int">
</argument>
@@ -44120,6 +48979,14 @@
<description>
</description>
</method>
+ <method name="set_expand_right">
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_icon">
<argument index="0" name="column" type="int">
</argument>
@@ -44190,6 +49057,14 @@
<description>
</description>
</method>
+ <method name="set_text_align">
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="text_align" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_tooltip">
<argument index="0" name="column" type="int">
</argument>
@@ -44214,6 +49089,16 @@
</constant>
</constants>
</class>
+<class name="TriangleMesh" inherits="Reference" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
<class name="Tween" inherits="Node" category="Core">
<brief_description>
Node useful for animations with unknown start and end points.
@@ -44289,7 +49174,7 @@
Returns the time needed for all tweens to end in seconds, measured from the start. Thus, if you have two tweens, one ending 10 seconds after the start and the other - 20 seconds, it would return 20 seconds, as by that time all tweens would have finished.
</description>
</method>
- <method name="get_speed" qualifiers="const">
+ <method name="get_speed_scale" qualifiers="const">
<return type="float">
</return>
<description>
@@ -44488,7 +49373,7 @@
Make the tween repeat after all tweens have finished.
</description>
</method>
- <method name="set_speed">
+ <method name="set_speed_scale">
<argument index="0" name="speed" type="float">
</argument>
<description>
@@ -44587,8 +49472,12 @@
</description>
</method>
</methods>
+ <members>
+ <member name="playback_process_mode" type="int" setter="set_tween_process_mode" getter="get_tween_process_mode" brief="">
+ </member>
+ </members>
<signals>
- <signal name="tween_complete">
+ <signal name="tween_completed">
<argument index="0" name="object" type="Object">
</argument>
<argument index="1" name="key" type="String">
@@ -44597,7 +49486,7 @@
This signal is emitted when a tween ends.
</description>
</signal>
- <signal name="tween_start">
+ <signal name="tween_started">
<argument index="0" name="object" type="Object">
</argument>
<argument index="1" name="key" type="String">
@@ -44679,7 +49568,7 @@
Helper to manage UndoRedo in the editor or custom tools.
</brief_description>
<description>
- Helper to maange UndoRedo in the editor or custom tools. It works by storing calls to functions in both 'do' an 'undo' lists.
+ Helper to manage UndoRedo in the editor or custom tools. It works by storing calls to functions in both 'do' an 'undo' lists.
Common behavior is to create an action, then add do/undo calls to functions or property changes, then committing the action.
</description>
<methods>
@@ -44732,13 +49621,12 @@
<argument index="0" name="object" type="Object">
</argument>
<description>
- Add an 'undo' reference that will be erased if the 'undo' history is lost. This is useful mostly for nodes rmoved with the 'do' call (not the 'undo' call!).
+ Add an 'undo' reference that will be erased if the 'undo' history is lost. This is useful mostly for nodes removed with the 'do' call (not the 'undo' call!).
</description>
</method>
<method name="clear_history">
<description>
- Clear the undo/redo history and associated
- references.
+ Clear the undo/redo history and associated references.
</description>
</method>
<method name="commit_action">
@@ -44752,8 +49640,7 @@
<argument index="1" name="merge_mode" type="int" default="0">
</argument>
<description>
- Create a new action. After this is called, do all your calls to [method add_do_method], [method add_undo_method], [method add_do_property] and [method add_un
-do_property].
+ Create a new action. After this is called, do all your calls to [method add_do_method], [method add_undo_method], [method add_do_property] and [method add_undo_property].
</description>
</method>
<method name="get_current_action_name" qualifiers="const">
@@ -44797,40 +49684,6 @@ do_property].
</theme_item>
</theme_items>
</class>
-<class name="VButtonArray" inherits="ButtonArray" category="Core">
- <brief_description>
- Vertical button array.
- </brief_description>
- <description>
- Vertical button array. See [ButtonArray].
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
- <theme_items>
- <theme_item name="button_separator" type="int">
- </theme_item>
- <theme_item name="focus" type="StyleBox">
- </theme_item>
- <theme_item name="font" type="Font">
- </theme_item>
- <theme_item name="font_color" type="Color">
- </theme_item>
- <theme_item name="font_color_selected" type="Color">
- </theme_item>
- <theme_item name="font_selected" type="Font">
- </theme_item>
- <theme_item name="hover" type="StyleBox">
- </theme_item>
- <theme_item name="icon_separator" type="int">
- </theme_item>
- <theme_item name="normal" type="StyleBox">
- </theme_item>
- <theme_item name="selected" type="StyleBox">
- </theme_item>
- </theme_items>
-</class>
<class name="VScrollBar" inherits="ScrollBar" category="Core">
<brief_description>
Vertical version of [ScrollBar], which goes from left (min) to right (max).
@@ -44844,15 +49697,15 @@ do_property].
<theme_items>
<theme_item name="decrement" type="Texture">
</theme_item>
- <theme_item name="decrement_hilite" type="Texture">
+ <theme_item name="decrement_highlight" type="Texture">
</theme_item>
<theme_item name="grabber" type="StyleBox">
</theme_item>
- <theme_item name="grabber_hilite" type="StyleBox">
+ <theme_item name="grabber_highlight" type="StyleBox">
</theme_item>
<theme_item name="increment" type="Texture">
</theme_item>
- <theme_item name="increment_hilite" type="Texture">
+ <theme_item name="increment_highlight" type="Texture">
</theme_item>
<theme_item name="scroll" type="StyleBox">
</theme_item>
@@ -44892,9 +49745,13 @@ do_property].
<theme_items>
<theme_item name="grabber" type="Texture">
</theme_item>
- <theme_item name="grabber_hilite" type="Texture">
+ <theme_item name="grabber_disabled" type="Texture">
+ </theme_item>
+ <theme_item name="grabber_disabled" type="StyleBox">
+ </theme_item>
+ <theme_item name="grabber_highlight" type="Texture">
</theme_item>
- <theme_item name="grabber_hilite" type="StyleBox">
+ <theme_item name="grabber_highlight" type="StyleBox">
</theme_item>
<theme_item name="slider" type="StyleBox">
</theme_item>
@@ -44957,6 +49814,7 @@ do_property].
<return type="Vector2">
</return>
<description>
+ Returns a new vector with all components in absolute values (i.e. positive).
</description>
</method>
<method name="angle">
@@ -44985,12 +49843,29 @@ do_property].
Returns the angle in radians between the line connecting the two points and the x coordinate.
</description>
</method>
+ <method name="aspect">
+ <return type="float">
+ </return>
+ <description>
+ Returns the ratio of X to Y.
+ </description>
+ </method>
+ <method name="bounce">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="n" type="Vector2">
+ </argument>
+ <description>
+ Bounce returns the vector "bounced off" from the given plane, specified by its normal vector.
+ </description>
+ </method>
<method name="clamped">
<return type="Vector2">
</return>
<argument index="0" name="length" type="float">
</argument>
<description>
+ Returns the vector with a maximum length.
</description>
</method>
<method name="cubic_interpolate">
@@ -45042,11 +49917,11 @@ do_property].
Remove the fractional part of x and y.
</description>
</method>
- <method name="get_aspect">
- <return type="float">
+ <method name="is_normalized">
+ <return type="bool">
</return>
<description>
- Returns the ratio of X to Y.
+ Returns whether the vector is normalized or not.
</description>
</method>
<method name="length">
@@ -45084,10 +49959,10 @@ do_property].
<method name="reflect">
<return type="Vector2">
</return>
- <argument index="0" name="vec" type="Vector2">
+ <argument index="0" name="n" type="Vector2">
</argument>
<description>
- Like "slide", but reflects the Vector instead of continuing along the wall.
+ Reflects the vector along the given plane, specified by its normal vector.
</description>
</method>
<method name="rotated">
@@ -45102,10 +49977,10 @@ do_property].
<method name="slide">
<return type="Vector2">
</return>
- <argument index="0" name="vec" type="Vector2">
+ <argument index="0" name="n" type="Vector2">
</argument>
<description>
- Slides the vector by the other vector.
+ Slide returns the component of the vector along the given plane, specified by its normal vector.
</description>
</method>
<method name="snapped">
@@ -45126,110 +50001,16 @@ do_property].
</method>
</methods>
<members>
- <member name="height" type="float">
- Height of the vector (Same as Y).
- </member>
- <member name="width" type="float">
- Width of the vector (Same as X).
- </member>
- <member name="x" type="float">
+ <member name="x" type="float" setter="" getter="" brief="">
X component of the vector.
</member>
- <member name="y" type="float">
+ <member name="y" type="float" setter="" getter="" brief="">
Y component of the vector.
</member>
</members>
<constants>
</constants>
</class>
-<class name="Vector2Array" category="Built-In Types">
- <brief_description>
- An Array of Vector2.
- </brief_description>
- <description>
- An Array specifically designed to hold Vector2.
- </description>
- <methods>
- <method name="Vector2Array">
- <return type="Vector2Array">
- </return>
- <argument index="0" name="from" type="Array">
- </argument>
- <description>
- Construct a new [Vector2Array]. Optionally, you can pass in an Array that will be converted.
- </description>
- </method>
- <method name="append">
- <argument index="0" name="vector2" type="Vector2">
- </argument>
- <description>
- Append an element at the end of the array (alias of [method push_back]).
- </description>
- </method>
- <method name="append_array">
- <argument index="0" name="array" type="Vector2Array">
- </argument>
- <description>
- Append an [Vector2Array] at the end of this array.
- </description>
- </method>
- <method name="insert">
- <return type="int">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="vector2" type="Vector2">
- </argument>
- <description>
- Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
- </description>
- </method>
- <method name="invert">
- <description>
- Reverse the order of the elements in the array (so first element will now be the last).
- </description>
- </method>
- <method name="push_back">
- <argument index="0" name="vector2" type="Vector2">
- </argument>
- <description>
- Insert a [Vector2] at the end.
- </description>
- </method>
- <method name="remove">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Remove an element from the array by index.
- </description>
- </method>
- <method name="resize">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Set the size of the Vector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
- </description>
- </method>
- <method name="set">
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="vector2" type="Vector2">
- </argument>
- <description>
- Change the [Vector2] at the given index.
- </description>
- </method>
- <method name="size">
- <return type="int">
- </return>
- <description>
- Return the size of the array.
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
<class name="Vector3" category="Built-In Types">
<brief_description>
Vector class, which performs basic 3D vector math operations.
@@ -45255,7 +50036,24 @@ do_property].
<return type="Vector3">
</return>
<description>
- Returns a new vector with all components in absolute values (e.g. positive).
+ Returns a new vector with all components in absolute values (i.e. positive).
+ </description>
+ </method>
+ <method name="angle_to">
+ <return type="float">
+ </return>
+ <argument index="0" name="to" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="bounce">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="n" type="Vector3">
+ </argument>
+ <description>
+ Bounce returns the vector "bounced off" from the given plane, specified by its normal vector.
</description>
</method>
<method name="ceil">
@@ -45330,6 +50128,13 @@ do_property].
Returns the inverse of the vector. This is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )
</description>
</method>
+ <method name="is_normalized">
+ <return type="bool">
+ </return>
+ <description>
+ Returns whether the vector is normalized or not.
+ </description>
+ </method>
<method name="length">
<return type="float">
</return>
@@ -45377,7 +50182,7 @@ do_property].
</description>
</method>
<method name="outer">
- <return type="Matrix3">
+ <return type="Basis">
</return>
<argument index="0" name="b" type="Vector3">
</argument>
@@ -45388,10 +50193,10 @@ do_property].
<method name="reflect">
<return type="Vector3">
</return>
- <argument index="0" name="by" type="Vector3">
+ <argument index="0" name="n" type="Vector3">
</argument>
<description>
- Like "slide", but reflects the Vector instead of continuing along the wall.
+ Reflects the vector along the given plane, specified by its normal vector.
</description>
</method>
<method name="rotated">
@@ -45408,10 +50213,10 @@ do_property].
<method name="slide">
<return type="Vector3">
</return>
- <argument index="0" name="by" type="Vector3">
+ <argument index="0" name="n" type="Vector3">
</argument>
<description>
- Slides the vector along a wall.
+ Slide returns the component of the vector along the given plane, specified by its normal vector.
</description>
</method>
<method name="snapped">
@@ -45424,7 +50229,7 @@ do_property].
</description>
</method>
<method name="to_diagonal_matrix">
- <return type="Matrix3">
+ <return type="Basis">
</return>
<description>
Return a diagonal matrix with the vector as main diagonal.
@@ -45432,13 +50237,13 @@ do_property].
</method>
</methods>
<members>
- <member name="x" type="float">
+ <member name="x" type="float" setter="" getter="" brief="">
X component of the vector.
</member>
- <member name="y" type="float">
+ <member name="y" type="float" setter="" getter="" brief="">
Y component of the vector.
</member>
- <member name="z" type="float">
+ <member name="z" type="float" setter="" getter="" brief="">
Z component of the vector.
</member>
</members>
@@ -45454,94 +50259,6 @@ do_property].
</constant>
</constants>
</class>
-<class name="Vector3Array" category="Built-In Types">
- <brief_description>
- An Array of Vector3.
- </brief_description>
- <description>
- An Array specifically designed to hold Vector3.
- </description>
- <methods>
- <method name="Vector3Array">
- <return type="Vector3Array">
- </return>
- <argument index="0" name="from" type="Array">
- </argument>
- <description>
- Construct a new Vector3Array. Optionally, you can pass in an Array that will be converted.
- </description>
- </method>
- <method name="append">
- <argument index="0" name="vector3" type="Vector3">
- </argument>
- <description>
- Append an element at the end of the array (alias of [method push_back]).
- </description>
- </method>
- <method name="append_array">
- <argument index="0" name="array" type="Vector3Array">
- </argument>
- <description>
- Append an [Vector3Array] at the end of this array.
- </description>
- </method>
- <method name="insert">
- <return type="int">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="vector3" type="Vector3">
- </argument>
- <description>
- Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
- </description>
- </method>
- <method name="invert">
- <description>
- Reverse the order of the elements in the array (so first element will now be the last).
- </description>
- </method>
- <method name="push_back">
- <argument index="0" name="vector3" type="Vector3">
- </argument>
- <description>
- Insert a Vector3 at the end.
- </description>
- </method>
- <method name="remove">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Remove an element from the array by index.
- </description>
- </method>
- <method name="resize">
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Set the size of the Vector3Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
- </description>
- </method>
- <method name="set">
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="vector3" type="Vector3">
- </argument>
- <description>
- Change the [Vector3] at the given index.
- </description>
- </method>
- <method name="size">
- <return type="int">
- </return>
- <description>
- Return the size of the array.
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
<class name="VehicleBody" inherits="PhysicsBody" category="Core">
<brief_description>
</brief_description>
@@ -45587,6 +50304,7 @@ do_property].
<return type="float">
</return>
<description>
+ Return the steering angle (in radians).
</description>
</method>
<method name="set_brake">
@@ -45617,9 +50335,22 @@ do_property].
<argument index="0" name="steering" type="float">
</argument>
<description>
+ Set the steering angle (in radians).
</description>
</method>
</methods>
+ <members>
+ <member name="brake" type="float" setter="set_brake" getter="get_brake" brief="">
+ </member>
+ <member name="engine_force" type="float" setter="set_engine_force" getter="get_engine_force" brief="">
+ </member>
+ <member name="friction" type="float" setter="set_friction" getter="get_friction" brief="">
+ </member>
+ <member name="mass" type="float" setter="set_mass" getter="get_mass" brief="">
+ </member>
+ <member name="steering" type="float" setter="set_steering" getter="get_steering" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -45653,6 +50384,12 @@ do_property].
<description>
</description>
</method>
+ <method name="get_roll_influence" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_suspension_max_force" qualifiers="const">
<return type="float">
</return>
@@ -45677,6 +50414,12 @@ do_property].
<description>
</description>
</method>
+ <method name="is_in_contact" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_used_as_steering" qualifiers="const">
<return type="bool">
</return>
@@ -45713,6 +50456,12 @@ do_property].
<description>
</description>
</method>
+ <method name="set_roll_influence">
+ <argument index="0" name="roll_influence" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_suspension_max_force">
<argument index="0" name="length" type="float">
</argument>
@@ -45750,6 +50499,30 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="damping_compression" type="float" setter="set_damping_compression" getter="get_damping_compression" brief="">
+ </member>
+ <member name="damping_relaxation" type="float" setter="set_damping_relaxation" getter="get_damping_relaxation" brief="">
+ </member>
+ <member name="suspension_max_force" type="float" setter="set_suspension_max_force" getter="get_suspension_max_force" brief="">
+ </member>
+ <member name="suspension_stiffness" type="float" setter="set_suspension_stiffness" getter="get_suspension_stiffness" brief="">
+ </member>
+ <member name="suspension_travel" type="float" setter="set_suspension_travel" getter="get_suspension_travel" brief="">
+ </member>
+ <member name="use_as_steering" type="bool" setter="set_use_as_steering" getter="is_used_as_steering" brief="">
+ </member>
+ <member name="use_as_traction" type="bool" setter="set_use_as_traction" getter="is_used_as_traction" brief="">
+ </member>
+ <member name="wheel_friction_slip" type="float" setter="set_friction_slip" getter="get_friction_slip" brief="">
+ </member>
+ <member name="wheel_radius" type="float" setter="set_radius" getter="get_radius" brief="">
+ </member>
+ <member name="wheel_rest_length" type="float" setter="set_suspension_rest_length" getter="get_suspension_rest_length" brief="">
+ </member>
+ <member name="wheel_roll_influence" type="float" setter="set_roll_influence" getter="get_roll_influence" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -45912,6 +50685,20 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="audio_track" type="int" setter="set_audio_track" getter="get_audio_track" brief="">
+ </member>
+ <member name="autoplay" type="bool" setter="set_autoplay" getter="has_autoplay" brief="">
+ </member>
+ <member name="expand" type="bool" setter="set_expand" getter="has_expand" brief="">
+ </member>
+ <member name="paused" type="bool" setter="set_paused" getter="is_paused" brief="">
+ </member>
+ <member name="stream" type="VideoStream" setter="set_stream" getter="get_stream" brief="">
+ </member>
+ <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -45925,16 +50712,6 @@ do_property].
<constants>
</constants>
</class>
-<class name="VideoStreamTheora" inherits="VideoStream" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
<class name="Viewport" inherits="Node" category="Core">
<brief_description>
Creates a sub-view into the screen.
@@ -45948,6 +50725,11 @@ do_property].
Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw.
</description>
<methods>
+ <method name="clear">
+ <description>
+ Clear the viewport manually.
+ </description>
+ </method>
<method name="find_world" qualifiers="const">
<return type="World">
</return>
@@ -45970,33 +50752,59 @@ do_property].
</description>
</method>
<method name="get_canvas_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Get the canvas transform of the viewport.
</description>
</method>
+ <method name="get_clear_on_new_frame" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Return whether automatic clearing of the render target on each frame is enabled.
+ </description>
+ </method>
+ <method name="get_debug_draw" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_final_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Get the total transform of the viewport.
</description>
</method>
<method name="get_global_canvas_transform" qualifiers="const">
- <return type="Matrix32">
+ <return type="Transform2D">
</return>
<description>
Get the global canvas transform of the viewport.
</description>
</method>
- <method name="get_mouse_pos" qualifiers="const">
+ <method name="get_hdr" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Get whether the rendered texture has filters enabled.
+ </description>
+ </method>
+ <method name="get_mouse_position" qualifiers="const">
<return type="Vector2">
</return>
<description>
Get the mouse position, relative to the viewport.
</description>
</method>
+ <method name="get_msaa" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_physics_object_picking">
<return type="bool">
</return>
@@ -46004,74 +50812,74 @@ do_property].
Get whether picking for all physics objects inside the viewport is enabled.
</description>
</method>
- <method name="get_rect" qualifiers="const">
- <return type="Rect2">
+ <method name="get_render_info">
+ <return type="int">
</return>
+ <argument index="0" name="info" type="int">
+ </argument>
<description>
- Return the viewport rect. If the viewport is child of a control, it will use the same rect as the parent. Otherwise, if the rect is empty, the viewport will use all the allowed space.
</description>
</method>
- <method name="get_render_target_clear_on_new_frame" qualifiers="const">
- <return type="bool">
+ <method name="get_shadow_atlas_quadrant_subdiv" qualifiers="const">
+ <return type="int">
</return>
+ <argument index="0" name="quadrant" type="int">
+ </argument>
<description>
- Return whether automatic clearing of the render target on each frame is enabled.
</description>
</method>
- <method name="get_render_target_filter" qualifiers="const">
- <return type="bool">
+ <method name="get_shadow_atlas_size" qualifiers="const">
+ <return type="int">
</return>
<description>
- Get whether the rendered texture has filters enabled.
</description>
</method>
- <method name="get_render_target_gen_mipmaps" qualifiers="const">
- <return type="bool">
+ <method name="get_size" qualifiers="const">
+ <return type="Vector2">
</return>
<description>
- Get whether the rendered texture will have mipmaps generated.
+ Return the viewport rect. If the viewport is child of a control, it will use the same rect as the parent. Otherwise, if the rect is empty, the viewport will use all the allowed space.
</description>
</method>
- <method name="get_render_target_texture" qualifiers="const">
- <return type="RenderTargetTexture">
+ <method name="get_size_override" qualifiers="const">
+ <return type="Vector2">
</return>
<description>
- Get the render target's texture, for use with various objects that you want to texture with the viewport.
+ Get the size override set with [method set_size_override].
</description>
</method>
- <method name="get_render_target_update_mode" qualifiers="const">
- <return type="int">
+ <method name="get_texture" qualifiers="const">
+ <return type="ViewportTexture">
</return>
<description>
- Get when the render target would be updated, will be one of the [code]RENDER_TARGET_UPDATE_*[/code] constants.
+ Get the viewport's texture, for use with various objects that you want to texture with the viewport.
</description>
</method>
- <method name="get_render_target_vflip" qualifiers="const">
- <return type="bool">
+ <method name="get_update_mode" qualifiers="const">
+ <return type="int">
</return>
<description>
- Set whether the render target is flipped on the Y axis.
+ Get when the viewport would be updated, will be one of the [code]UPDATE_*[/code] constants.
</description>
</method>
- <method name="get_screen_capture" qualifiers="const">
- <return type="Image">
+ <method name="get_usage" qualifiers="const">
+ <return type="int">
</return>
<description>
- Return the captured screenshot after [method queue_screen_capture]. You might need to check more than one frame until the right image is returned.
</description>
</method>
- <method name="get_size_override" qualifiers="const">
- <return type="Vector2">
+ <method name="get_vflip" qualifiers="const">
+ <return type="bool">
</return>
<description>
- Get the size override set with [method set_size_override].
+ Set whether the render target is flipped on the Y axis.
</description>
</method>
- <method name="get_viewport" qualifiers="const">
+ <method name="get_viewport_rid" qualifiers="const">
<return type="RID">
</return>
<description>
- Get the viewport RID from the visual server.
+ Get the viewport RID from the [VisualServer].
</description>
</method>
<method name="get_visible_rect" qualifiers="const">
@@ -46092,6 +50900,7 @@ do_property].
<return type="World2D">
</return>
<description>
+ Return the 2D world of the viewport.
</description>
</method>
<method name="gui_get_drag_data" qualifiers="const">
@@ -46116,11 +50925,17 @@ do_property].
</description>
</method>
<method name="input">
- <argument index="0" name="local_event" type="InputEvent">
+ <argument index="0" name="local_event" type="Object">
</argument>
<description>
</description>
</method>
+ <method name="is_3d_disabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_audio_listener" qualifiers="const">
<return type="bool">
</return>
@@ -46142,13 +50957,6 @@ do_property].
Return whether input to the viewport is disabled.
</description>
</method>
- <method name="is_set_as_render_target" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Return whether the viewport is set as a render target by [method set_as_render_target].
- </description>
- </method>
<method name="is_size_override_enabled" qualifiers="const">
<return type="bool">
</return>
@@ -46170,16 +50978,6 @@ do_property].
Return whether the viewport is using a world separate from the parent viewport's world.
</description>
</method>
- <method name="queue_screen_capture">
- <description>
- Queue a multithreaded screenshot, you can retrive it at a later frame via [method get_screen_capture].
- </description>
- </method>
- <method name="render_target_clear">
- <description>
- Clear the render target manually.
- </description>
- </method>
<method name="set_as_audio_listener">
<argument index="0" name="enable" type="bool">
</argument>
@@ -46194,88 +50992,89 @@ do_property].
Makes the viewport send sounds from 2D emitters to the speakers.
</description>
</method>
- <method name="set_as_render_target">
- <argument index="0" name="enable" type="bool">
+ <method name="set_attach_to_screen_rect">
+ <argument index="0" name="rect" type="Rect2">
</argument>
<description>
- Set the viewport's render target mode.
</description>
</method>
<method name="set_canvas_transform">
- <argument index="0" name="xform" type="Matrix32">
+ <argument index="0" name="xform" type="Transform2D">
</argument>
<description>
- Set the canvas transform of the viewport, useful for changing the on-screen positions of all child [CanvasItem]s. This is relative to the global canvas transform of the viewport.
+ Set the canvas transform of the viewport, useful for changing the on-screen positions of all child [CanvasItem]\ s. This is relative to the global canvas transform of the viewport.
</description>
</method>
- <method name="set_disable_input">
- <argument index="0" name="disable" type="bool">
+ <method name="set_clear_on_new_frame">
+ <argument index="0" name="enable" type="bool">
</argument>
<description>
- Set whether input to the viewport is disabled.
</description>
</method>
- <method name="set_global_canvas_transform">
- <argument index="0" name="xform" type="Matrix32">
+ <method name="set_debug_draw">
+ <argument index="0" name="debug_draw" type="int">
</argument>
<description>
- Set the global canvas transform of the viewport. The canvas transform is relative to this.
</description>
</method>
- <method name="set_physics_object_picking">
- <argument index="0" name="enable" type="bool">
+ <method name="set_disable_3d">
+ <argument index="0" name="disable" type="bool">
</argument>
<description>
- Enable/disable picking for all physics objects inside the viewport.
</description>
</method>
- <method name="set_rect">
- <argument index="0" name="rect" type="Rect2">
+ <method name="set_disable_input">
+ <argument index="0" name="disable" type="bool">
+ </argument>
+ <description>
+ Set whether input to the viewport is disabled.
+ </description>
+ </method>
+ <method name="set_global_canvas_transform">
+ <argument index="0" name="xform" type="Transform2D">
</argument>
<description>
- Set the viewport rect. If the viewport is child of a control, it will use the same rect as the parent.
+ Set the global canvas transform of the viewport. The canvas transform is relative to this.
</description>
</method>
- <method name="set_render_target_clear_on_new_frame">
+ <method name="set_hdr">
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Enable/disable automatic clearing of the render target on each frame. You might find it better to disable this if you are using the viewport for rarely updated textures. To clear manually, check [method render_target_clear]
</description>
</method>
- <method name="set_render_target_filter">
- <argument index="0" name="enable" type="bool">
+ <method name="set_msaa">
+ <argument index="0" name="msaa" type="int">
</argument>
<description>
- Set whether the rendered texture should have filters enabled. Disable if you want the texture's pixels be visible.
</description>
</method>
- <method name="set_render_target_gen_mipmaps">
+ <method name="set_physics_object_picking">
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Set whether the rendered texture should have mipmaps generated. Mipmaps allow the texture to have better antialiasing from far away.
+ Enable/disable picking for all physics objects inside the viewport.
</description>
</method>
- <method name="set_render_target_to_screen_rect">
- <argument index="0" name="rect" type="Rect2">
+ <method name="set_shadow_atlas_quadrant_subdiv">
+ <argument index="0" name="quadrant" type="int">
+ </argument>
+ <argument index="1" name="subdiv" type="int">
</argument>
<description>
- Map a part of the screen to the render target directly.
</description>
</method>
- <method name="set_render_target_update_mode">
- <argument index="0" name="mode" type="int">
+ <method name="set_shadow_atlas_size">
+ <argument index="0" name="size" type="int">
</argument>
<description>
- Set when the render target should be updated, has to be one of the [code]RENDER_TARGET_UPDATE_*[/code] constants.
</description>
</method>
- <method name="set_render_target_vflip">
- <argument index="0" name="enable" type="bool">
+ <method name="set_size">
+ <argument index="0" name="size" type="Vector2">
</argument>
<description>
- Set whether the render target should be flipped on the Y axis.
+ Set the size of the viewport.
</description>
</method>
<method name="set_size_override">
@@ -46286,7 +51085,7 @@ do_property].
<argument index="2" name="margin" type="Vector2" default="Vector2(0, 0)">
</argument>
<description>
- Set the size of the viewport. If the enable parameter is true, it would use the override, otherwise it would use the default size. If the size parameter is equal to [code](-1, -1)[/code], it won't update the size.
+ Set the size override of the viewport. If the enable parameter is true, it would use the override, otherwise it would use the default size. If the size parameter is equal to [code](-1, -1)[/code], it won't update the size.
</description>
</method>
<method name="set_size_override_stretch">
@@ -46303,6 +51102,19 @@ do_property].
If this viewport is a child of another viewport, keep the previously drawn background visible.
</description>
</method>
+ <method name="set_update_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ Set when the render target would be updated, using the [code]UPDATE_*[/code] constants
+ </description>
+ </method>
+ <method name="set_usage">
+ <argument index="0" name="usage" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_use_own_world">
<argument index="0" name="enable" type="bool">
</argument>
@@ -46310,6 +51122,13 @@ do_property].
Make the viewport use a world separate from the parent viewport's world.
</description>
</method>
+ <method name="set_vflip">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ Set whether the viewport is flipped on the Y axis.
+ </description>
+ </method>
<method name="set_world">
<argument index="0" name="world" type="World">
</argument>
@@ -46324,7 +51143,7 @@ do_property].
</description>
</method>
<method name="unhandled_input">
- <argument index="0" name="local_event" type="InputEvent">
+ <argument index="0" name="local_event" type="Object">
</argument>
<description>
</description>
@@ -46342,6 +51161,50 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="audio_listener_enable_2d" type="bool" setter="set_as_audio_listener_2d" getter="is_audio_listener_2d" brief="">
+ </member>
+ <member name="audio_listener_enable_3d" type="bool" setter="set_as_audio_listener" getter="is_audio_listener" brief="">
+ </member>
+ <member name="debug_draw" type="int" setter="set_debug_draw" getter="get_debug_draw" brief="">
+ </member>
+ <member name="disable_3d" type="bool" setter="set_disable_3d" getter="is_3d_disabled" brief="">
+ </member>
+ <member name="gui_disable_input" type="bool" setter="set_disable_input" getter="is_input_disabled" brief="">
+ </member>
+ <member name="hdr" type="bool" setter="set_hdr" getter="get_hdr" brief="">
+ </member>
+ <member name="msaa" type="int" setter="set_msaa" getter="get_msaa" brief="">
+ </member>
+ <member name="own_world" type="bool" setter="set_use_own_world" getter="is_using_own_world" brief="">
+ </member>
+ <member name="physics_object_picking" type="bool" setter="set_physics_object_picking" getter="get_physics_object_picking" brief="">
+ </member>
+ <member name="render_target_clear_on_new_frame" type="bool" setter="set_clear_on_new_frame" getter="get_clear_on_new_frame" brief="">
+ </member>
+ <member name="render_target_update_mode" type="int" setter="set_update_mode" getter="get_update_mode" brief="">
+ </member>
+ <member name="render_target_v_flip" type="bool" setter="set_vflip" getter="get_vflip" brief="">
+ </member>
+ <member name="shadow_atlas_quad_0" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief="">
+ </member>
+ <member name="shadow_atlas_quad_1" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief="">
+ </member>
+ <member name="shadow_atlas_quad_2" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief="">
+ </member>
+ <member name="shadow_atlas_quad_3" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief="">
+ </member>
+ <member name="shadow_atlas_size" type="int" setter="set_shadow_atlas_size" getter="get_shadow_atlas_size" brief="">
+ </member>
+ <member name="size" type="Rect2" setter="set_size" getter="get_size" brief="">
+ </member>
+ <member name="transparent_bg" type="bool" setter="set_transparent_background" getter="has_transparent_background" brief="">
+ </member>
+ <member name="usage" type="int" setter="set_usage" getter="get_usage" brief="">
+ </member>
+ <member name="world" type="World" setter="set_world" getter="get_world" brief="">
+ </member>
+ </members>
<signals>
<signal name="size_changed">
<description>
@@ -46350,85 +51213,116 @@ do_property].
</signal>
</signals>
<constants>
- <constant name="RENDER_TARGET_UPDATE_DISABLED" value="0">
+ <constant name="UPDATE_DISABLED" value="0">
Do not update the render target.
</constant>
- <constant name="RENDER_TARGET_UPDATE_ONCE" value="1">
- Update the render target once, then switch to [code]RENDER_TARGET_UPDATE_DISABLED[/code]
+ <constant name="UPDATE_ONCE" value="1">
+ Update the render target once, then switch to [code]UPDATE_DISABLED[/code]
</constant>
- <constant name="RENDER_TARGET_UPDATE_WHEN_VISIBLE" value="2">
+ <constant name="UPDATE_WHEN_VISIBLE" value="2">
Update the render target only when it is visible. This is the default value.
</constant>
- <constant name="RENDER_TARGET_UPDATE_ALWAYS" value="3">
- Update the render target always.
+ <constant name="UPDATE_ALWAYS" value="3">
+ </constant>
+ <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED" value="0">
+ </constant>
+ <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_1" value="1">
+ </constant>
+ <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_4" value="2">
+ </constant>
+ <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_16" value="3">
+ </constant>
+ <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_64" value="4">
+ </constant>
+ <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_256" value="5">
+ </constant>
+ <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_1024" value="6">
+ </constant>
+ <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_MAX" value="7">
+ </constant>
+ <constant name="RENDER_INFO_OBJECTS_IN_FRAME" value="0">
+ </constant>
+ <constant name="RENDER_INFO_VERTICES_IN_FRAME" value="1">
+ </constant>
+ <constant name="RENDER_INFO_MATERIAL_CHANGES_IN_FRAME" value="2">
+ </constant>
+ <constant name="RENDER_INFO_SHADER_CHANGES_IN_FRAME" value="3">
+ </constant>
+ <constant name="RENDER_INFO_SURFACE_CHANGES_IN_FRAME" value="4">
+ </constant>
+ <constant name="RENDER_INFO_DRAW_CALLS_IN_FRAME" value="5">
+ </constant>
+ <constant name="RENDER_INFO_MAX" value="6">
+ </constant>
+ <constant name="DEBUG_DRAW_DISABLED" value="0">
+ </constant>
+ <constant name="DEBUG_DRAW_UNSHADED" value="1">
+ </constant>
+ <constant name="DEBUG_DRAW_OVERDRAW" value="2">
+ </constant>
+ <constant name="DEBUG_DRAW_WIREFRAME" value="3">
+ </constant>
+ <constant name="MSAA_DISABLED" value="0">
+ </constant>
+ <constant name="MSAA_2X" value="1">
+ </constant>
+ <constant name="MSAA_4X" value="2">
+ </constant>
+ <constant name="MSAA_8X" value="3">
+ </constant>
+ <constant name="MSAA_16X" value="4">
</constant>
</constants>
</class>
-<class name="ViewportSprite" inherits="Node2D" category="Core">
+<class name="ViewportContainer" inherits="Container" category="Core">
<brief_description>
- Displays a viewport as a sprite.
</brief_description>
<description>
- Used to display a [Viewport] node at some position in the world, without having to mess with [RenderTargetTexture]s.
</description>
<methods>
- <method name="get_modulate" qualifiers="const">
- <return type="Color">
- </return>
- <description>
- Get color modulation for the texture. All texture pixels are multiplied by this color.
- </description>
- </method>
- <method name="get_offset" qualifiers="const">
- <return type="Vector2">
- </return>
- <description>
- get the offset to the origin of the texture.
- </description>
- </method>
- <method name="get_viewport_path" qualifiers="const">
- <return type="NodePath">
- </return>
- <description>
- Return the path to the shown [Viewport] node.
- </description>
- </method>
- <method name="is_centered" qualifiers="const">
+ <method name="is_stretch_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
- Return whether the viewport's texture is centered on the origin.
</description>
</method>
- <method name="set_centered">
- <argument index="0" name="centered" type="bool">
- </argument>
- <description>
- Set whether the viewport's texture should be centered on the origin.
- </description>
- </method>
- <method name="set_modulate">
- <argument index="0" name="modulate" type="Color">
+ <method name="set_stretch">
+ <argument index="0" name="enable" type="bool">
</argument>
<description>
- Set color modulation for the texture. All texture pixels are multiplied by this color. Color may contain rgb values above 1 to achieve a highlight effect.
</description>
</method>
- <method name="set_offset">
- <argument index="0" name="offset" type="Vector2">
- </argument>
+ </methods>
+ <members>
+ <member name="stretch" type="bool" setter="set_stretch" getter="is_stretch_enabled" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="ViewportTexture" inherits="Texture" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_viewport_path_in_scene" qualifiers="const">
+ <return type="NodePath">
+ </return>
<description>
- Set the offset to the origin of the texture.
</description>
</method>
- <method name="set_viewport_path">
+ <method name="set_viewport_path_in_scene">
<argument index="0" name="path" type="NodePath">
</argument>
<description>
- Set the path to the shown [Viewport] node.
</description>
</method>
</methods>
+ <members>
+ <member name="viewport_path" type="NodePath" setter="set_viewport_path_in_scene" getter="get_viewport_path_in_scene" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -46459,6 +51353,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="freeze_bodies" type="bool" setter="set_enabler" getter="is_enabler_enabled" brief="">
+ </member>
+ <member name="pause_animations" type="bool" setter="set_enabler" getter="is_enabler_enabled" brief="">
+ </member>
+ </members>
<constants>
<constant name="ENABLER_FREEZE_BODIES" value="1">
This enabler will freeze [RigidBody] nodes.
@@ -46497,6 +51397,20 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="fixed_process_parent" type="bool" setter="set_enabler" getter="is_enabler_enabled" brief="">
+ </member>
+ <member name="freeze_bodies" type="bool" setter="set_enabler" getter="is_enabler_enabled" brief="">
+ </member>
+ <member name="pause_animated_sprites" type="bool" setter="set_enabler" getter="is_enabler_enabled" brief="">
+ </member>
+ <member name="pause_animations" type="bool" setter="set_enabler" getter="is_enabler_enabled" brief="">
+ </member>
+ <member name="pause_particles" type="bool" setter="set_enabler" getter="is_enabler_enabled" brief="">
+ </member>
+ <member name="process_parent" type="bool" setter="set_enabler" getter="is_enabler_enabled" brief="">
+ </member>
+ </members>
<constants>
<constant name="ENABLER_FREEZE_BODIES" value="1">
This enabler will freeze [RigidBody2D] nodes.
@@ -46528,7 +51442,7 @@ do_property].
</description>
<methods>
<method name="get_aabb" qualifiers="const">
- <return type="AABB">
+ <return type="Rect3">
</return>
<description>
Return the visibility bounding box of the VisibilityNotifier.
@@ -46542,34 +51456,38 @@ do_property].
</description>
</method>
<method name="set_aabb">
- <argument index="0" name="rect" type="AABB">
+ <argument index="0" name="rect" type="Rect3">
</argument>
<description>
Set the visibility bounding box of the VisibilityNotifier.
</description>
</method>
</methods>
+ <members>
+ <member name="aabb" type="Rect3" setter="set_aabb" getter="get_aabb" brief="">
+ </member>
+ </members>
<signals>
- <signal name="enter_camera">
+ <signal name="camera_entered">
<argument index="0" name="camera" type="Object">
</argument>
<description>
Emitted when the VisibilityNotifier enters a [Camera]'s view.
</description>
</signal>
- <signal name="enter_screen">
- <description>
- Emitted when the VisibilityNotifier enters the screen.
- </description>
- </signal>
- <signal name="exit_camera">
+ <signal name="camera_exited">
<argument index="0" name="camera" type="Object">
</argument>
<description>
Emitted when the VisibilityNotifier exits a [Camera]'s view.
</description>
</signal>
- <signal name="exit_screen">
+ <signal name="screen_entered">
+ <description>
+ Emitted when the VisibilityNotifier enters the screen.
+ </description>
+ </signal>
+ <signal name="screen_exited">
<description>
Emitted when the VisibilityNotifier exits the screen.
</description>
@@ -46608,29 +51526,33 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="rect" type="Rect2" setter="set_rect" getter="get_rect" brief="">
+ </member>
+ </members>
<signals>
- <signal name="enter_screen">
+ <signal name="screen_entered">
<description>
Emitted when the VisibilityNotifier2D enters the screen.
</description>
</signal>
- <signal name="enter_viewport">
- <argument index="0" name="viewport" type="Object">
- </argument>
+ <signal name="screen_exited">
<description>
- Emitted when the VisibilityNotifier2D enters a [Viewport].
+ Emitted when the VisibilityNotifier2D exits the screen.
</description>
</signal>
- <signal name="exit_screen">
+ <signal name="viewport_entered">
+ <argument index="0" name="viewport" type="Object">
+ </argument>
<description>
- Emitted when the VisibilityNotifier2D exits the screen.
+ Emitted when the VisibilityNotifier2D enters a [Viewport]'s view.
</description>
</signal>
- <signal name="exit_viewport">
+ <signal name="viewport_exited">
<argument index="0" name="viewport" type="Object">
</argument>
<description>
- Emitted when the VisibilityNotifier2D exits a [Viewport].
+ Emitted when the VisibilityNotifier2D exits a [Viewport]'s view.
</description>
</signal>
</signals>
@@ -46644,7 +51566,7 @@ do_property].
</description>
<methods>
<method name="get_aabb" qualifiers="const">
- <return type="AABB">
+ <return type="Rect3">
</return>
<description>
</description>
@@ -46656,7 +51578,7 @@ do_property].
</description>
</method>
<method name="get_transformed_aabb" qualifiers="const">
- <return type="AABB">
+ <return type="Rect3">
</return>
<description>
</description>
@@ -46674,6 +51596,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="layers" type="int" setter="set_layer_mask" getter="get_layer_mask" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47068,6 +51994,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" brief="">
+ </member>
+ </members>
<signals>
<signal name="node_ports_changed">
<argument index="0" name="function" type="String">
@@ -47112,6 +52042,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief="">
+ </member>
+ <member name="constant" type="String" setter="set_basic_type_constant" getter="get_basic_type_constant" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47134,6 +52070,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="function" type="int" setter="set_func" getter="get_func" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47168,6 +52108,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief="">
+ </member>
+ <member name="constant" type="String" setter="set_class_constant" getter="get_class_constant" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47214,6 +52160,14 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="description" type="String" setter="set_description" getter="get_description" brief="">
+ </member>
+ <member name="size" type="Vector2" setter="set_size" getter="get_size" brief="">
+ </member>
+ <member name="title" type="String" setter="set_title" getter="get_title" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47240,6 +52194,8 @@ do_property].
</description>
</method>
<method name="get_constant_value" qualifiers="const">
+ <return type="Variant">
+ </return>
<description>
</description>
</method>
@@ -47256,6 +52212,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="type" type="int" setter="set_constant_type" getter="get_constant_type" brief="">
+ </member>
+ <member name="value" type="Nil" setter="set_constant_value" getter="get_constant_value" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47290,6 +52252,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="constructor" type="Dictionary" setter="set_constructor" getter="get_constructor" brief="">
+ </member>
+ <member name="type" type="int" setter="set_constructor_type" getter="get_constructor_type" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47427,24 +52395,12 @@ do_property].
<description>
</description>
<methods>
- <method name="get_deconstruct_input_type" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
<method name="get_deconstruct_type" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
- <method name="set_deconstruct_input_type">
- <argument index="0" name="input_type" type="int">
- </argument>
- <description>
- </description>
- </method>
<method name="set_deconstruct_type">
<argument index="0" name="type" type="int">
</argument>
@@ -47452,6 +52408,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="elem_cache" type="Array" setter="_set_elem_cache" getter="_get_elem_cache" brief="">
+ </member>
+ <member name="type" type="int" setter="set_deconstruct_type" getter="get_deconstruct_type" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47474,6 +52436,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="signal" type="String" setter="set_signal" getter="get_signal" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47496,6 +52462,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="constant" type="String" setter="set_singleton" getter="get_singleton" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47646,6 +52616,30 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="argument_cache" type="Dictionary" setter="_set_argument_cache" getter="_get_argument_cache" brief="">
+ </member>
+ <member name="base_script" type="String" setter="set_base_script" getter="get_base_script" brief="">
+ </member>
+ <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief="">
+ </member>
+ <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief="">
+ </member>
+ <member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief="">
+ </member>
+ <member name="function" type="String" setter="set_function" getter="get_function" brief="">
+ </member>
+ <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief="">
+ </member>
+ <member name="rpc_call_mode" type="int" setter="set_rpc_call_mode" getter="get_rpc_call_mode" brief="">
+ </member>
+ <member name="singleton" type="String" setter="set_singleton" getter="get_singleton" brief="">
+ </member>
+ <member name="use_default_args" type="int" setter="set_use_default_args" getter="get_use_default_args" brief="">
+ </member>
+ <member name="validate" type="bool" setter="set_validate" getter="get_validate" brief="">
+ </member>
+ </members>
<constants>
<constant name="CALL_MODE_SELF" value="0">
</constant>
@@ -47710,6 +52704,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="constant" type="int" setter="set_global_constant" getter="get_global_constant" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47764,16 +52762,12 @@ do_property].
</description>
</method>
</methods>
- <constants>
- </constants>
-</class>
-<class name="VisualScriptInputFilter" inherits="VisualScriptNode" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
+ <members>
+ <member name="action" type="String" setter="set_action_name" getter="get_action_name" brief="">
+ </member>
+ <member name="mode" type="int" setter="set_action_mode" getter="get_action_mode" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47818,6 +52812,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="type" type="int" setter="set_var_type" getter="get_var_type" brief="">
+ </member>
+ <member name="var_name" type="String" setter="set_var_name" getter="get_var_name" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47852,6 +52852,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="type" type="int" setter="set_var_type" getter="get_var_type" brief="">
+ </member>
+ <member name="var_name" type="String" setter="set_var_name" getter="get_var_name" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47874,6 +52880,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="constant" type="int" setter="set_math_constant" getter="get_math_constant" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47906,6 +52916,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="_default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" brief="">
+ </member>
+ </members>
<signals>
<signal name="ports_changed">
<description>
@@ -47946,6 +52960,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="operator" type="int" setter="set_operator" getter="get_operator" brief="">
+ </member>
+ <member name="type" type="int" setter="set_typed" getter="get_typed" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -47968,6 +52988,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="resource" type="Resource" setter="set_preload" getter="get_preload" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -48007,8 +53031,8 @@ do_property].
<description>
</description>
</method>
- <method name="get_event_type" qualifiers="const">
- <return type="int">
+ <method name="get_index" qualifiers="const">
+ <return type="String">
</return>
<description>
</description>
@@ -48049,8 +53073,8 @@ do_property].
<description>
</description>
</method>
- <method name="set_event_type">
- <argument index="0" name="event_type" type="int">
+ <method name="set_index">
+ <argument index="0" name="index" type="String">
</argument>
<description>
</description>
@@ -48062,6 +53086,24 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="base_script" type="String" setter="set_base_script" getter="get_base_script" brief="">
+ </member>
+ <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief="">
+ </member>
+ <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief="">
+ </member>
+ <member name="index" type="String" setter="set_index" getter="get_index" brief="">
+ </member>
+ <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief="">
+ </member>
+ <member name="property" type="String" setter="set_property" getter="get_property" brief="">
+ </member>
+ <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief="">
+ </member>
+ <member name="type_cache" type="int" setter="_set_type_cache" getter="_get_type_cache" brief="">
+ </member>
+ </members>
<constants>
<constant name="CALL_MODE_SELF" value="0">
</constant>
@@ -48077,6 +53119,12 @@ do_property].
<description>
</description>
<methods>
+ <method name="get_assign_op" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_base_path" qualifiers="const">
<return type="NodePath">
</return>
@@ -48107,8 +53155,8 @@ do_property].
<description>
</description>
</method>
- <method name="get_event_type" qualifiers="const">
- <return type="int">
+ <method name="get_index" qualifiers="const">
+ <return type="String">
</return>
<description>
</description>
@@ -48119,6 +53167,12 @@ do_property].
<description>
</description>
</method>
+ <method name="set_assign_op">
+ <argument index="0" name="assign_op" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_base_path">
<argument index="0" name="base_path" type="NodePath">
</argument>
@@ -48149,8 +53203,8 @@ do_property].
<description>
</description>
</method>
- <method name="set_event_type">
- <argument index="0" name="event_type" type="int">
+ <method name="set_index">
+ <argument index="0" name="index" type="String">
</argument>
<description>
</description>
@@ -48162,6 +53216,26 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="assign_op" type="int" setter="set_assign_op" getter="get_assign_op" brief="">
+ </member>
+ <member name="base_script" type="String" setter="set_base_script" getter="get_base_script" brief="">
+ </member>
+ <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief="">
+ </member>
+ <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief="">
+ </member>
+ <member name="index" type="String" setter="set_index" getter="get_index" brief="">
+ </member>
+ <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief="">
+ </member>
+ <member name="property" type="String" setter="set_property" getter="get_property" brief="">
+ </member>
+ <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief="">
+ </member>
+ <member name="type_cache" type="int" setter="_set_type_cache" getter="_get_type_cache" brief="">
+ </member>
+ </members>
<constants>
<constant name="CALL_MODE_SELF" value="0">
</constant>
@@ -48190,6 +53264,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="path" type="String" setter="set_resource_path" getter="get_resource_path" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -48224,6 +53302,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="return_enabled" type="bool" setter="set_enable_return_value" getter="is_return_value_enabled" brief="">
+ </member>
+ <member name="return_type" type="int" setter="set_return_type" getter="get_return_type" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -48246,6 +53330,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="node_path" type="NodePath" setter="set_node_path" getter="get_node_path" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -48259,6 +53347,32 @@ do_property].
<constants>
</constants>
</class>
+<class name="VisualScriptSelect" inherits="VisualScriptNode" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_typed" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_typed">
+ <argument index="0" name="type" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="type" type="int" setter="set_typed" getter="get_typed" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
<class name="VisualScriptSelf" inherits="VisualScriptNode" category="Core">
<brief_description>
</brief_description>
@@ -48288,6 +53402,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="steps" type="int" setter="set_steps" getter="get_steps" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -48348,6 +53466,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="base_script" type="String" setter="set_base_script" getter="get_base_script" brief="">
+ </member>
+ <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -48370,6 +53494,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="var_name" type="String" setter="set_variable" getter="get_variable" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -48392,6 +53520,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="var_name" type="String" setter="set_variable" getter="get_variable" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -48436,6 +53568,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="mode" type="int" setter="set_yield_mode" getter="get_yield_mode" brief="">
+ </member>
+ <member name="wait_time" type="float" setter="set_wait_time" getter="get_wait_time" brief="">
+ </member>
+ </members>
<constants>
<constant name="YIELD_FRAME" value="1">
</constant>
@@ -48500,6 +53638,16 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief="">
+ </member>
+ <member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief="">
+ </member>
+ <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief="">
+ </member>
+ <member name="signal" type="String" setter="set_signal" getter="get_signal" brief="">
+ </member>
+ </members>
<constants>
<constant name="CALL_MODE_SELF" value="0">
</constant>
@@ -48518,1274 +53666,6 @@ do_property].
The visual server is completely opaque, the internals are entirely implementation specific and cannot be accessed.
</description>
<methods>
- <method name="black_bars_set_images">
- <argument index="0" name="left" type="RID">
- </argument>
- <argument index="1" name="top" type="RID">
- </argument>
- <argument index="2" name="right" type="RID">
- </argument>
- <argument index="3" name="bottom" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="black_bars_set_margins">
- <argument index="0" name="left" type="int">
- </argument>
- <argument index="1" name="top" type="int">
- </argument>
- <argument index="2" name="right" type="int">
- </argument>
- <argument index="3" name="bottom" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="camera_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="camera_set_orthogonal">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="float">
- </argument>
- <argument index="2" name="arg2" type="float">
- </argument>
- <argument index="3" name="arg3" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="camera_set_perspective">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="float">
- </argument>
- <argument index="2" name="arg2" type="float">
- </argument>
- <argument index="3" name="arg3" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="camera_set_transform">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Transform">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="canvas_item_add_circle">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Vector2">
- </argument>
- <argument index="2" name="arg2" type="float">
- </argument>
- <argument index="3" name="arg3" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_add_line">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Vector2">
- </argument>
- <argument index="2" name="arg2" type="Vector2">
- </argument>
- <argument index="3" name="arg3" type="Color">
- </argument>
- <argument index="4" name="arg4" type="float" default="1">
- </argument>
- <argument index="5" name="arg5" type="bool" default="false">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_add_rect">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Rect2">
- </argument>
- <argument index="2" name="arg2" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_add_style_box">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Rect2">
- </argument>
- <argument index="2" name="arg2" type="Rect2">
- </argument>
- <argument index="3" name="arg3" type="RID">
- </argument>
- <argument index="4" name="arg4" type="RealArray">
- </argument>
- <argument index="5" name="arg5" type="Color" default="Color(1,1,1,1)">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_add_texture_rect">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Rect2">
- </argument>
- <argument index="2" name="arg2" type="RID">
- </argument>
- <argument index="3" name="arg3" type="bool">
- </argument>
- <argument index="4" name="arg4" type="Color" default="Color(1,1,1,1)">
- </argument>
- <argument index="5" name="arg5" type="bool" default="false">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_add_texture_rect_region">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Rect2">
- </argument>
- <argument index="2" name="arg2" type="RID">
- </argument>
- <argument index="3" name="arg3" type="Rect2">
- </argument>
- <argument index="4" name="arg4" type="Color" default="Color(1,1,1,1)">
- </argument>
- <argument index="5" name="arg5" type="bool" default="false">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_clear">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="canvas_item_get_opacity" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_get_parent" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_get_self_opacity" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_raise">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_set_clip">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_set_custom_rect">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="bool">
- </argument>
- <argument index="2" name="arg2" type="Rect2">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_set_opacity">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_set_parent">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_set_self_opacity">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_set_transform">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Matrix32">
- </argument>
- <description>
- </description>
- </method>
- <method name="canvas_item_set_z">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="cursor_set_pos">
- <argument index="0" name="arg0" type="Vector2">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="cursor_set_rotation">
- <argument index="0" name="arg0" type="float">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="cursor_set_texture">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Vector2">
- </argument>
- <argument index="2" name="arg2" type="int">
- </argument>
- <argument index="3" name="arg3" type="Rect2">
- </argument>
- <description>
- </description>
- </method>
- <method name="cursor_set_visible">
- <argument index="0" name="arg0" type="bool">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="draw">
- <description>
- </description>
- </method>
- <method name="free_rid">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_render_info">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="get_test_cube">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="instance_attach_object_instance_ID">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_attach_skeleton">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="instance_geometry_get_material_param" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_geometry_override_material_param" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_get_base" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_get_base_aabb" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_get_object_instance_ID" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_get_room" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_get_skeleton" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_get_transform" qualifiers="const">
- <return type="Transform">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_is_exterior" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_set_exterior">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_set_room">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instance_set_transform">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Transform">
- </argument>
- <description>
- </description>
- </method>
- <method name="instances_cull_aabb" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="arg0" type="AABB">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instances_cull_convex" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="arg0" type="Array">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="instances_cull_ray" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="arg0" type="Vector3">
- </argument>
- <argument index="1" name="arg1" type="Vector3">
- </argument>
- <argument index="2" name="arg2" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_create">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_get_color" qualifiers="const">
- <return type="Color">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_get_projector" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_get_type" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_get_var" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_has_shadow" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_is_volumetric" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_set_color">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_set_projector">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_set_shadow">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_set_var">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="light_set_volumetric">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="make_sphere_mesh">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="int">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="material_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="material_get_blend_mode" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="material_get_flag" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="material_get_line_width" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="material_get_param" qualifiers="const">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="String">
- </argument>
- <description>
- </description>
- </method>
- <method name="material_get_shader" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="material_set_blend_mode">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="material_set_flag">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="material_set_line_width">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="material_set_param">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="String">
- </argument>
- <argument index="2" name="arg2" type="Variant">
- </argument>
- <description>
- </description>
- </method>
- <method name="material_set_shader">
- <argument index="0" name="shader" type="RID">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="mesh_add_surface">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="Array">
- </argument>
- <argument index="3" name="arg3" type="Array">
- </argument>
- <argument index="4" name="arg4" type="bool" default="-1">
- </argument>
- <description>
- </description>
- </method>
- <method name="mesh_add_surface_from_planes">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Array">
- </argument>
- <description>
- </description>
- </method>
- <method name="mesh_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="mesh_get_surface_count" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="mesh_remove_surface">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="mesh_surface_get_array_index_len" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="mesh_surface_get_array_len" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="mesh_surface_get_format" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="mesh_surface_get_material" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="mesh_surface_get_primitive_type" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="mesh_surface_set_material">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="RID">
- </argument>
- <argument index="3" name="arg3" type="bool" default="false">
- </argument>
- <description>
- </description>
- </method>
- <method name="multimesh_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="multimesh_get_aabb" qualifiers="const">
- <return type="AABB">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="AABB">
- </argument>
- <description>
- </description>
- </method>
- <method name="multimesh_get_mesh" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="multimesh_instance_get_color" qualifiers="const">
- <return type="Color">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="multimesh_instance_get_transform" qualifiers="const">
- <return type="Transform">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="multimesh_instance_set_color">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="multimesh_instance_set_transform">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="Transform">
- </argument>
- <description>
- </description>
- </method>
- <method name="multimesh_set_aabb">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="AABB">
- </argument>
- <description>
- </description>
- </method>
- <method name="multimesh_set_mesh">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="particles_get_amount" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_get_attractor_pos" qualifiers="const">
- <return type="Vector3">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_get_attractor_strength" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_get_attractors" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_get_color_phase_color" qualifiers="const">
- <return type="Color">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_get_color_phase_pos" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_get_color_phases" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_get_randomness" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_get_variable" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_get_visibility_aabb" qualifiers="const">
- <return type="AABB">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_has_height_from_velocity" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_is_emitting" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_amount">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_attractor_pos">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="Vector3">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_attractor_strength">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_attractors">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_color_phase_color">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_color_phase_pos">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_color_phases">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_emitting">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_height_from_velocity">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_material">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <argument index="2" name="arg2" type="bool" default="false">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_randomness">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_variable">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="particles_set_visibility_aabb">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="AABB">
- </argument>
- <description>
- </description>
- </method>
- <method name="portal_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="portal_get_disable_distance" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="portal_get_disabled_color" qualifiers="const">
- <return type="Color">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="portal_get_shape" qualifiers="const">
- <return type="Vector2Array">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="portal_is_enabled" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="portal_set_disable_distance">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="float">
- </argument>
- <description>
- </description>
- </method>
- <method name="portal_set_disabled_color">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="portal_set_enabled">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="bool">
- </argument>
- <description>
- </description>
- </method>
- <method name="portal_set_shape">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Vector2Array">
- </argument>
- <description>
- </description>
- </method>
- <method name="room_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="room_get_bounds" qualifiers="const">
- <return type="Dictionary">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="room_set_bounds">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Dictionary">
- </argument>
- <description>
- </description>
- </method>
- <method name="scenario_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="scenario_set_debug">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_default_clear_color">
- <argument index="0" name="arg0" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="shader_create">
- <return type="RID">
- </return>
- <argument index="0" name="mode" type="int" default="0">
- </argument>
- <description>
- </description>
- </method>
- <method name="shader_set_mode">
- <argument index="0" name="shader" type="RID">
- </argument>
- <argument index="1" name="mode" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="skeleton_bone_get_transform">
- <return type="Transform">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="skeleton_bone_set_transform">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <argument index="2" name="arg2" type="Transform">
- </argument>
- <description>
- </description>
- </method>
- <method name="skeleton_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="skeleton_get_bone_count" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="skeleton_resize">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="sync">
- <description>
- </description>
- </method>
<method name="texture_create">
<return type="RID">
</return>
@@ -49795,7 +53675,7 @@ do_property].
<method name="texture_create_from_image">
<return type="RID">
</return>
- <argument index="0" name="arg0" type="Image">
+ <argument index="0" name="arg0" type="Object">
</argument>
<argument index="1" name="arg1" type="int" default="7">
</argument>
@@ -49840,312 +53720,8 @@ do_property].
<description>
</description>
</method>
- <method name="viewport_attach_camera">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="RID" default="RID()">
- </argument>
- <description>
- </description>
- </method>
- <method name="viewport_attach_canvas">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="viewport_create">
- <return type="RID">
- </return>
- <description>
- </description>
- </method>
- <method name="viewport_get_attached_camera" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="viewport_get_rect" qualifiers="const">
- <return type="Rect2">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="viewport_get_scenario" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="viewport_remove_canvas">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <description>
- </description>
- </method>
- <method name="viewport_set_canvas_transform">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="RID">
- </argument>
- <argument index="2" name="arg2" type="Matrix32">
- </argument>
- <description>
- </description>
- </method>
- <method name="viewport_set_global_canvas_transform">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Matrix32">
- </argument>
- <description>
- </description>
- </method>
- <method name="viewport_set_rect">
- <argument index="0" name="arg0" type="RID">
- </argument>
- <argument index="1" name="arg1" type="Rect2">
- </argument>
- <description>
- </description>
- </method>
</methods>
<constants>
- <constant name="NO_INDEX_ARRAY" value="-1">
- </constant>
- <constant name="CUSTOM_ARRAY_SIZE" value="8">
- </constant>
- <constant name="ARRAY_WEIGHTS_SIZE" value="4">
- </constant>
- <constant name="MAX_PARTICLE_COLOR_PHASES" value="4">
- </constant>
- <constant name="MAX_PARTICLE_ATTRACTORS" value="4">
- </constant>
- <constant name="MAX_CURSORS" value="8">
- </constant>
- <constant name="TEXTURE_FLAG_MIPMAPS" value="1">
- </constant>
- <constant name="TEXTURE_FLAG_REPEAT" value="2">
- </constant>
- <constant name="TEXTURE_FLAG_FILTER" value="4">
- </constant>
- <constant name="TEXTURE_FLAG_CUBEMAP" value="2048">
- </constant>
- <constant name="TEXTURE_FLAGS_DEFAULT" value="7">
- </constant>
- <constant name="CUBEMAP_LEFT" value="0">
- </constant>
- <constant name="CUBEMAP_RIGHT" value="1">
- </constant>
- <constant name="CUBEMAP_BOTTOM" value="2">
- </constant>
- <constant name="CUBEMAP_TOP" value="3">
- </constant>
- <constant name="CUBEMAP_FRONT" value="4">
- </constant>
- <constant name="CUBEMAP_BACK" value="5">
- </constant>
- <constant name="SHADER_MATERIAL" value="0">
- </constant>
- <constant name="SHADER_POST_PROCESS" value="2">
- </constant>
- <constant name="MATERIAL_FLAG_VISIBLE" value="0">
- </constant>
- <constant name="MATERIAL_FLAG_DOUBLE_SIDED" value="1">
- </constant>
- <constant name="MATERIAL_FLAG_INVERT_FACES" value="2">
- </constant>
- <constant name="MATERIAL_FLAG_UNSHADED" value="3">
- </constant>
- <constant name="MATERIAL_FLAG_ONTOP" value="4">
- </constant>
- <constant name="MATERIAL_FLAG_MAX" value="7">
- </constant>
- <constant name="MATERIAL_BLEND_MODE_MIX" value="0">
- </constant>
- <constant name="MATERIAL_BLEND_MODE_ADD" value="1">
- </constant>
- <constant name="MATERIAL_BLEND_MODE_SUB" value="2">
- </constant>
- <constant name="MATERIAL_BLEND_MODE_MUL" value="3">
- </constant>
- <constant name="FIXED_MATERIAL_PARAM_DIFFUSE" value="0">
- </constant>
- <constant name="FIXED_MATERIAL_PARAM_DETAIL" value="1">
- </constant>
- <constant name="FIXED_MATERIAL_PARAM_SPECULAR" value="2">
- </constant>
- <constant name="FIXED_MATERIAL_PARAM_EMISSION" value="3">
- </constant>
- <constant name="FIXED_MATERIAL_PARAM_SPECULAR_EXP" value="4">
- </constant>
- <constant name="FIXED_MATERIAL_PARAM_GLOW" value="5">
- </constant>
- <constant name="FIXED_MATERIAL_PARAM_NORMAL" value="6">
- </constant>
- <constant name="FIXED_MATERIAL_PARAM_SHADE_PARAM" value="7">
- </constant>
- <constant name="FIXED_MATERIAL_PARAM_MAX" value="8">
- </constant>
- <constant name="FIXED_MATERIAL_TEXCOORD_SPHERE" value="3">
- </constant>
- <constant name="FIXED_MATERIAL_TEXCOORD_UV" value="0">
- </constant>
- <constant name="FIXED_MATERIAL_TEXCOORD_UV_TRANSFORM" value="1">
- </constant>
- <constant name="FIXED_MATERIAL_TEXCOORD_UV2" value="2">
- </constant>
- <constant name="ARRAY_VERTEX" value="0">
- </constant>
- <constant name="ARRAY_NORMAL" value="1">
- </constant>
- <constant name="ARRAY_TANGENT" value="2">
- </constant>
- <constant name="ARRAY_COLOR" value="3">
- </constant>
- <constant name="ARRAY_TEX_UV" value="4">
- </constant>
- <constant name="ARRAY_BONES" value="6">
- </constant>
- <constant name="ARRAY_WEIGHTS" value="7">
- </constant>
- <constant name="ARRAY_INDEX" value="8">
- </constant>
- <constant name="ARRAY_MAX" value="9">
- </constant>
- <constant name="ARRAY_FORMAT_VERTEX" value="1">
- </constant>
- <constant name="ARRAY_FORMAT_NORMAL" value="2">
- </constant>
- <constant name="ARRAY_FORMAT_TANGENT" value="4">
- </constant>
- <constant name="ARRAY_FORMAT_COLOR" value="8">
- </constant>
- <constant name="ARRAY_FORMAT_TEX_UV" value="16">
- </constant>
- <constant name="ARRAY_FORMAT_BONES" value="64">
- </constant>
- <constant name="ARRAY_FORMAT_WEIGHTS" value="128">
- </constant>
- <constant name="ARRAY_FORMAT_INDEX" value="256">
- </constant>
- <constant name="PRIMITIVE_POINTS" value="0">
- </constant>
- <constant name="PRIMITIVE_LINES" value="1">
- </constant>
- <constant name="PRIMITIVE_LINE_STRIP" value="2">
- </constant>
- <constant name="PRIMITIVE_LINE_LOOP" value="3">
- </constant>
- <constant name="PRIMITIVE_TRIANGLES" value="4">
- </constant>
- <constant name="PRIMITIVE_TRIANGLE_STRIP" value="5">
- </constant>
- <constant name="PRIMITIVE_TRIANGLE_FAN" value="6">
- </constant>
- <constant name="PRIMITIVE_MAX" value="7">
- </constant>
- <constant name="PARTICLE_LIFETIME" value="0">
- </constant>
- <constant name="PARTICLE_SPREAD" value="1">
- </constant>
- <constant name="PARTICLE_GRAVITY" value="2">
- </constant>
- <constant name="PARTICLE_LINEAR_VELOCITY" value="3">
- </constant>
- <constant name="PARTICLE_ANGULAR_VELOCITY" value="4">
- </constant>
- <constant name="PARTICLE_LINEAR_ACCELERATION" value="5">
- </constant>
- <constant name="PARTICLE_RADIAL_ACCELERATION" value="6">
- </constant>
- <constant name="PARTICLE_TANGENTIAL_ACCELERATION" value="7">
- </constant>
- <constant name="PARTICLE_INITIAL_SIZE" value="9">
- </constant>
- <constant name="PARTICLE_FINAL_SIZE" value="10">
- </constant>
- <constant name="PARTICLE_INITIAL_ANGLE" value="11">
- </constant>
- <constant name="PARTICLE_HEIGHT" value="12">
- </constant>
- <constant name="PARTICLE_HEIGHT_SPEED_SCALE" value="13">
- </constant>
- <constant name="PARTICLE_VAR_MAX" value="14">
- </constant>
- <constant name="LIGHT_DIRECTIONAL" value="0">
- </constant>
- <constant name="LIGHT_OMNI" value="1">
- </constant>
- <constant name="LIGHT_SPOT" value="2">
- </constant>
- <constant name="LIGHT_COLOR_DIFFUSE" value="0">
- </constant>
- <constant name="LIGHT_COLOR_SPECULAR" value="1">
- </constant>
- <constant name="LIGHT_PARAM_SPOT_ATTENUATION" value="0">
- </constant>
- <constant name="LIGHT_PARAM_SPOT_ANGLE" value="1">
- </constant>
- <constant name="LIGHT_PARAM_RADIUS" value="2">
- </constant>
- <constant name="LIGHT_PARAM_ENERGY" value="3">
- </constant>
- <constant name="LIGHT_PARAM_ATTENUATION" value="4">
- </constant>
- <constant name="LIGHT_PARAM_MAX" value="10">
- </constant>
- <constant name="SCENARIO_DEBUG_DISABLED" value="0">
- </constant>
- <constant name="SCENARIO_DEBUG_WIREFRAME" value="1">
- </constant>
- <constant name="SCENARIO_DEBUG_OVERDRAW" value="2">
- </constant>
- <constant name="INSTANCE_MESH" value="1">
- </constant>
- <constant name="INSTANCE_MULTIMESH" value="2">
- </constant>
- <constant name="INSTANCE_PARTICLES" value="4">
- </constant>
- <constant name="INSTANCE_LIGHT" value="5">
- </constant>
- <constant name="INSTANCE_ROOM" value="6">
- </constant>
- <constant name="INSTANCE_PORTAL" value="7">
- </constant>
- <constant name="INSTANCE_GEOMETRY_MASK" value="30">
- </constant>
- <constant name="INFO_OBJECTS_IN_FRAME" value="0">
- </constant>
- <constant name="INFO_VERTICES_IN_FRAME" value="1">
- </constant>
- <constant name="INFO_MATERIAL_CHANGES_IN_FRAME" value="2">
- </constant>
- <constant name="INFO_SHADER_CHANGES_IN_FRAME" value="3">
- </constant>
- <constant name="INFO_SURFACE_CHANGES_IN_FRAME" value="4">
- </constant>
- <constant name="INFO_DRAW_CALLS_IN_FRAME" value="5">
- </constant>
- <constant name="INFO_USAGE_VIDEO_MEM_TOTAL" value="6">
- </constant>
- <constant name="INFO_VIDEO_MEM_USED" value="7">
- </constant>
- <constant name="INFO_TEXTURE_MEM_USED" value="8">
- </constant>
- <constant name="INFO_VERTEX_MEM_USED" value="9">
- </constant>
</constants>
</class>
<class name="WeakRef" inherits="Reference" category="Core">
@@ -50182,6 +53758,12 @@ do_property].
Return the close [TextureButton].
</description>
</method>
+ <method name="get_resizable" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_title" qualifiers="const">
<return type="String">
</return>
@@ -50189,6 +53771,12 @@ do_property].
Return the title of the window.
</description>
</method>
+ <method name="set_resizable">
+ <argument index="0" name="resizable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_title">
<argument index="0" name="title" type="String">
</argument>
@@ -50197,6 +53785,12 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="resizable" type="bool" setter="set_resizable" getter="get_resizable" brief="">
+ </member>
+ <member name="window_title" type="String" setter="set_title" getter="get_title" brief="">
+ </member>
+ </members>
<constants>
</constants>
<theme_items>
@@ -50204,20 +53798,20 @@ do_property].
</theme_item>
<theme_item name="close_h_ofs" type="int">
</theme_item>
- <theme_item name="close_hilite" type="Texture">
+ <theme_item name="close_highlight" type="Texture">
</theme_item>
<theme_item name="close_v_ofs" type="int">
</theme_item>
<theme_item name="panel" type="StyleBox">
</theme_item>
+ <theme_item name="scaleborder_size" type="int">
+ </theme_item>
<theme_item name="title_color" type="Color">
</theme_item>
<theme_item name="title_font" type="Font">
</theme_item>
<theme_item name="title_height" type="int">
</theme_item>
- <theme_item name="titlebar_height" type="int">
- </theme_item>
</theme_items>
</class>
<class name="World" inherits="Resource" category="Core">
@@ -50240,13 +53834,13 @@ do_property].
<description>
</description>
</method>
- <method name="get_scenario" qualifiers="const">
- <return type="RID">
+ <method name="get_fallback_environment" qualifiers="const">
+ <return type="Environment">
</return>
<description>
</description>
</method>
- <method name="get_sound_space" qualifiers="const">
+ <method name="get_scenario" qualifiers="const">
<return type="RID">
</return>
<description>
@@ -50264,7 +53858,19 @@ do_property].
<description>
</description>
</method>
+ <method name="set_fallback_environment">
+ <argument index="0" name="env" type="Environment">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="environment" type="Environment" setter="set_environment" getter="get_environment" brief="">
+ </member>
+ <member name="fallback_environment" type="Environment" setter="set_fallback_environment" getter="get_fallback_environment" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -50290,13 +53896,6 @@ do_property].
Retrieve the state of this world's physics space. This allows arbitrary querying for collision.
</description>
</method>
- <method name="get_sound_space">
- <return type="RID">
- </return>
- <description>
- Retrieve the [RID] of this world's sound space resource. Used by the [SpatialSound2DServer] for 2D spatial audio.
- </description>
- </method>
<method name="get_space">
<return type="RID">
</return>
@@ -50308,25 +53907,33 @@ do_property].
<constants>
</constants>
</class>
-<class name="WorldEnvironment" inherits="Spatial" category="Core">
+<class name="WorldEnvironment" inherits="Node" category="Core">
<brief_description>
+ Sets environment properties for the entire scene
</brief_description>
<description>
+ The [WorldEnvironment] node can be added to a scene in order to set default [Environment] variables for the scene. The [WorldEnvironment] can be overridden by an [Environment] node set on the current [Camera]. Additionally, only one [WorldEnvironment] may be instanced in a given scene at a time. The [WorldEnvironment] allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox).
</description>
<methods>
<method name="get_environment" qualifiers="const">
<return type="Environment">
</return>
<description>
+ Return the [Environment] currently bound.
</description>
</method>
<method name="set_environment">
<argument index="0" name="env" type="Environment">
</argument>
<description>
+ Set the currently bound [Environment] to the one specified.
</description>
</method>
</methods>
+ <members>
+ <member name="environment" type="Environment" setter="set_environment" getter="get_environment" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
@@ -50444,7 +54051,7 @@ do_property].
<method name="open_buffer">
<return type="int">
</return>
- <argument index="0" name="buffer" type="RawArray">
+ <argument index="0" name="buffer" type="PoolByteArray">
</argument>
<description>
Open a XML raw buffer for parsing. This returns an error code.
@@ -50519,6 +54126,10 @@ do_property].
</description>
</method>
</methods>
+ <members>
+ <member name="sort_enabled" type="bool" setter="set_sort_enabled" getter="is_sort_enabled" brief="">
+ </member>
+ </members>
<constants>
</constants>
</class>
diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.py
index e05bcd63e7..1386e91ce1 100755..100644
--- a/doc/tools/doc_status.py
+++ b/doc/tools/doc_status.py
@@ -20,6 +20,7 @@ flags = {
'p': False,
'o': True,
'i': False,
+ 'a': True,
}
flag_descriptions = {
'c': 'Toggle colors when outputting.',
@@ -31,6 +32,7 @@ flag_descriptions = {
'p': 'Toggle showing percentage as well as counts.',
'o': 'Toggle overall column.',
'i': 'Toggle collapse of class items columns.',
+ 'a': 'Toggle showing all items.',
}
long_flags = {
'colors': 'c',
@@ -58,6 +60,8 @@ long_flags = {
'items': 'i',
'collapse': 'i',
+
+ 'all': 'a',
}
table_columns = ['name', 'brief_description', 'description', 'methods', 'constants', 'members', 'signals']
table_column_names = ['Name', 'Brief Desc.', 'Desc.', 'Methods', 'Constants', 'Members', 'Signals']
@@ -202,7 +206,7 @@ class ClassStatus:
output['overall'] = (description_progress + items_progress).to_colored_string('{percent}%', '{pad_percent}{s}')
if self.name.startswith('Total'):
- output['url'] = color('url', 'http://docs.godotengine.org/en/latest/classes/_classes.html')
+ output['url'] = color('url', 'http://docs.godotengine.org/en/latest/classes/')
if flags['s']:
output['comment'] = color('part_good', 'ALL OK')
else:
@@ -354,12 +358,11 @@ for cn in input_class_list:
validate_tag(c, 'class')
status = ClassStatus.generate_for_class(c)
- if flags['b'] and status.is_ok():
- continue
- if flags['g'] and not status.is_ok():
+ total_status = total_status + status
+
+ if (flags['b'] and status.is_ok()) or (flags['g'] and not status.is_ok()) or (not flags['a']):
continue
- total_status = total_status + status
out = status.make_output()
row = []
for column in table_columns:
@@ -378,11 +381,11 @@ for cn in input_class_list:
# Print output table #
################################################################################
-if len(table) == 1:
+if len(table) == 1 and flags['a']:
print(color('part_big_problem', 'No classes suitable for printing!'))
sys.exit(0)
-if len(table) > 2:
+if len(table) > 2 or not flags['a']:
total_status.name = 'Total = {0}'.format(len(table) - 1)
out = total_status.make_output()
row = []
diff --git a/doc/tools/locales/es/LC_MESSAGES/makedocs.mo b/doc/tools/locales/es/LC_MESSAGES/makedocs.mo
deleted file mode 100644
index 8d7ea2689e..0000000000
--- a/doc/tools/locales/es/LC_MESSAGES/makedocs.mo
+++ /dev/null
Binary files differ
diff --git a/doc/tools/locales/es/LC_MESSAGES/makedocs.po b/doc/tools/locales/es/LC_MESSAGES/makedocs.po
deleted file mode 100644
index 82115dd897..0000000000
--- a/doc/tools/locales/es/LC_MESSAGES/makedocs.po
+++ /dev/null
@@ -1,142 +0,0 @@
-# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
-# This file is distributed under the same license as the PROJECT project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: makedocs\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-10-07 11:47-0600\n"
-"PO-Revision-Date: 2015-10-07 13:10-0600\n"
-"Last-Translator: Jorge Araya Navarro <elcorreo@deshackra.com>\n"
-"Language-Team: \n"
-"Language: es\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 2.0\n"
-"X-Generator: Poedit 1.8.4\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#: makedocs.py:74
-msgid ""
-"\"<code>{gclass}</code>(Go to page of class {gclass})\":/class_{lkclass}"
-msgstr ""
-"\"<code>{gclass}</code>(Ir a la pagina de la clase {gclass})\":/"
-"class_{lkclass}"
-
-#: makedocs.py:76
-msgid ""
-"\"<code>{gclass}.{method}</code>(Go to page {gclass}, section {method})\":/"
-"class_{lkclass}#{lkmethod}"
-msgstr ""
-"\"<code>{gclass}.{method}</code>(Ir a la pagina {gclass}, sección "
-"{method})\":/class_{lkclass}#{lkmethod}"
-
-#: makedocs.py:79
-msgid "\"<code>{method}</code>(Jump to method {method})\":#{lkmethod}"
-msgstr "\"<code>{method}</code>(Saltar al método {method})\":#{lkmethod}"
-
-#: makedocs.py:81
-msgid " \"{rtype}(Go to page of class {rtype})\":/class_{link} "
-msgstr " \"{rtype}(Ir a la pagina de la clase {rtype})\":/class_{link} "
-
-#: makedocs.py:82
-msgid ""
-"\"*{funcname}*(Jump to description for node {funcname})\":#{link} <b>(</b> "
-msgstr ""
-"\"*{funcname}*(Saltar a la descripción para el nodo {funcname})\":#{link} "
-"<b>(</b> "
-
-#: makedocs.py:87
-msgid "h4. Inherits: "
-msgstr "h4. Hereda de: "
-
-#: makedocs.py:232
-msgid "<doc>'s version attribute missing"
-msgstr "El atributo version de <doc> no existe"
-
-#: makedocs.py:246
-msgid "|_. Index symbol |_. Class name |_. Index symbol |_. Class name |\n"
-msgstr ""
-"|_. Ãndice de símbolo |_. Nombre de la clase |_. Ãndice de símbolo |_. "
-"Nombre de la clase |\n"
-
-#: makedocs.py:305
-msgid ""
-"h4. Category: {}\n"
-"\n"
-msgstr ""
-"h4. Categoría: {}\n"
-"\n"
-
-#: makedocs.py:310
-msgid ""
-"h2. Brief Description\n"
-"\n"
-msgstr ""
-"h2. Descripción breve\n"
-"\n"
-
-#: makedocs.py:312
-msgid ""
-"\"read more\":#more\n"
-"\n"
-msgstr ""
-"\"Leer más\":#more\n"
-"\n"
-
-#: makedocs.py:317
-msgid ""
-"\n"
-"h3. Member Functions\n"
-"\n"
-msgstr ""
-"\n"
-"h3. Funciones miembro\n"
-"\n"
-
-#: makedocs.py:323
-msgid ""
-"\n"
-"h3. Signals\n"
-"\n"
-msgstr ""
-"\n"
-"h3. Señales\n"
-"\n"
-
-#: makedocs.py:331
-msgid ""
-"\n"
-"h3. Numeric Constants\n"
-"\n"
-msgstr ""
-"\n"
-"h3. Constantes numéricas\n"
-"\n"
-
-#: makedocs.py:347
-msgid ""
-"\n"
-"h3(#more). Description\n"
-"\n"
-msgstr ""
-"\n"
-"h3(#more). Descripción\n"
-"\n"
-
-#: makedocs.py:351
-msgid "_Nothing here, yet..._\n"
-msgstr "_Aún nada por aquí..._\n"
-
-#: makedocs.py:355
-msgid ""
-"\n"
-"h3. Member Function Description\n"
-"\n"
-msgstr ""
-"\n"
-"h3. Descripción de las funciones miembro\n"
-"\n"
diff --git a/doc/tools/main.css b/doc/tools/main.css
deleted file mode 100644
index 5eb3df2159..0000000000
--- a/doc/tools/main.css
+++ /dev/null
@@ -1,146 +0,0 @@
-BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV, SPAN {
- font-family: Arial, Geneva, Helvetica, sans-serif;
-}
-
-a {
-
- text-decoration: none;
-
-}
-
-a:hover {
-
- text-decoration: underline;
-}
-
-td.top_table {
-
- padding: 5px;
-}
-
-div.method_doc {
-
- padding-bottom: 30px;
-}
-
-div.method_description {
- margin-left: 30px;
-}
-
-list.inh_class_list {
- margin-left: 30px;
-
-}
-
-div.inh_class_list {
- margin-left: 30px;
-
-}
-
-div.method_doc div.method {
-
- font-size: 12pt;
- font-weight: bold;
-}
-
-span.funcdecl {
-
- color: #202060;
-}
-
-span.funcdef {
-
- color: #202060;
-}
-
-
-span.qualifier {
-
- font-weight: bold;
-}
-
-
-span.symbol {
-
- /*font-weight: bold;*/
- color: #471870;
-}
-
-
-span.datatype {
-
- color: #6a1533;
-}
-
-tr.category_title {
-
- background-color: #333333;
-}
-a.category_title {
- font-weight: bold;
- color: #FFFFFF;
-}
-
-div.method_list {
-
- margin-left: 30px;
-}
-
-div.constant_list {
-
- margin-left: 30px;
-}
-
-div.member_list {
-
- margin-left: 30px;
-}
-
-div.description {
-
- margin-left: 30px;
-}
-
-div.class_description {
-
- margin-left: 30px;
-}
-
-div.method_list li div {
-
- display: inline;
-}
-
-div.member_list li div.member {
-
- display: inline;
-}
-
-div.constant_list li div.constant {
-
- display: inline;
-}
-
-span.member_description {
-
- font-style: italic;
- color: grey;
-}
-
-span.constant_description {
-
- font-style: italic;
- color: grey;
-}
-
-span.identifier {
-
- font-weight: bold;
-}
-
-
-table.class_table td {
-
- vertical-align: top;
-}
-
diff --git a/doc/tools/makedocs.pot b/doc/tools/makedocs.pot
deleted file mode 100644
index be3220f686..0000000000
--- a/doc/tools/makedocs.pot
+++ /dev/null
@@ -1,108 +0,0 @@
-# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
-# This file is distributed under the same license as the PROJECT project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: makedocs 0.1\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-10-07 11:47-0600\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 2.0\n"
-"X-Generator: Poedit 1.8.4\n"
-
-#: makedocs.py:74
-msgid "\"<code>{gclass}</code>(Go to page of class {gclass})\":/class_{lkclass}"
-msgstr ""
-
-#: makedocs.py:76
-msgid "\"<code>{gclass}.{method}</code>(Go to page {gclass}, section {method})\":/class_{lkclass}#{lkmethod}"
-msgstr ""
-
-#: makedocs.py:79
-msgid "\"<code>{method}</code>(Jump to method {method})\":#{lkmethod}"
-msgstr ""
-
-#: makedocs.py:81
-msgid " \"{rtype}(Go to page of class {rtype})\":/class_{link} "
-msgstr ""
-
-#: makedocs.py:82
-msgid "\"*{funcname}*(Jump to description for node {funcname})\":#{link} <b>(</b> "
-msgstr ""
-
-#: makedocs.py:87
-msgid "h4. Inherits: "
-msgstr ""
-
-#: makedocs.py:232
-msgid "<doc>'s version attribute missing"
-msgstr ""
-
-#: makedocs.py:246
-msgid "|_. Index symbol |_. Class name |_. Index symbol |_. Class name |\n"
-msgstr ""
-
-#: makedocs.py:305
-msgid ""
-"h4. Category: {}\n"
-"\n"
-msgstr ""
-
-#: makedocs.py:310
-msgid ""
-"h2. Brief Description\n"
-"\n"
-msgstr ""
-
-#: makedocs.py:312
-msgid ""
-"\"read more\":#more\n"
-"\n"
-msgstr ""
-
-#: makedocs.py:317
-msgid ""
-"\n"
-"h3. Member Functions\n"
-"\n"
-msgstr ""
-
-#: makedocs.py:323
-msgid ""
-"\n"
-"h3. Signals\n"
-"\n"
-msgstr ""
-
-#: makedocs.py:331
-msgid ""
-"\n"
-"h3. Numeric Constants\n"
-"\n"
-msgstr ""
-
-#: makedocs.py:347
-msgid ""
-"\n"
-"h3(#more). Description\n"
-"\n"
-msgstr ""
-
-#: makedocs.py:351
-msgid "_Nothing here, yet..._\n"
-msgstr ""
-
-#: makedocs.py:355
-msgid ""
-"\n"
-"h3. Member Function Description\n"
-"\n"
-msgstr ""
diff --git a/doc/tools/makedocs.py b/doc/tools/makedocs.py
deleted file mode 100644
index 4c4b5d6fb9..0000000000
--- a/doc/tools/makedocs.py
+++ /dev/null
@@ -1,382 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-#
-# makedocs.py: Generate documentation for Open Project Wiki
-# Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur.
-# Contributor: Jorge Araya Navarro <elcorreo@deshackra.com>
-#
-
-# IMPORTANT NOTICE:
-# If you are going to modify anything from this file, please be sure to follow
-# the Style Guide for Python Code or often called "PEP8". To do this
-# automagically just install autopep8:
-#
-# $ sudo pip3 install autopep8
-#
-# and run:
-#
-# $ autopep8 makedocs.py
-#
-# Before committing your changes. Also be sure to delete any trailing
-# whitespace you may left.
-#
-# TODO:
-# * Refactor code.
-# * Adapt this script for generating content in other markup formats like
-# reStructuredText, Markdown, DokuWiki, etc.
-#
-# Also check other TODO entries in this script for more information on what is
-# left to do.
-import argparse
-import gettext
-import logging
-import re
-from itertools import zip_longest
-from os import path, listdir
-from xml.etree import ElementTree
-
-
-# add an option to change the verbosity
-logging.basicConfig(level=logging.INFO)
-
-
-def getxmlfloc():
- """ Returns the supposed location of the XML file
- """
- filepath = path.dirname(path.abspath(__file__))
- return path.join(filepath, "class_list.xml")
-
-
-def langavailable():
- """ Return a list of languages available for translation
- """
- filepath = path.join(
- path.dirname(path.abspath(__file__)), "locales")
- files = listdir(filepath)
- choices = [x for x in files]
- choices.insert(0, "none")
- return choices
-
-
-desc = "Generates documentation from a XML file to different markup languages"
-
-parser = argparse.ArgumentParser(description=desc)
-parser.add_argument("--input", dest="xmlfp", default=getxmlfloc(),
- help="Input XML file, default: {}".format(getxmlfloc()))
-parser.add_argument("--output-dir", dest="outputdir", required=True,
- help="Output directory for generated files")
-parser.add_argument("--language", choices=langavailable(), default="none",
- help=("Choose the language of translation"
- " for the output files. Default is English (none). "
- "Note: This is NOT for the documentation itself!"))
-# TODO: add an option for outputting different markup formats
-
-args = parser.parse_args()
-# Let's check if the file and output directory exists
-if not path.isfile(args.xmlfp):
- logging.critical("File not found: {}".format(args.xmlfp))
- exit(1)
-elif not path.isdir(args.outputdir):
- logging.critical("Path does not exist: {}".format(args.outputdir))
- exit(1)
-
-_ = gettext.gettext
-if args.language != "none":
- lang = gettext.translation(domain="makedocs",
- localedir="locales",
- languages=[args.language])
- lang.install()
-
- _ = lang.gettext
-
-# Strings
-C_LINK = _("\"<code>{gclass}</code>(Go to page of class"
- " {gclass})\":/class_{lkclass}")
-MC_LINK = _("\"<code>{gclass}.{method}</code>(Go "
- "to page {gclass}, section {method})\""
- ":/class_{lkclass}#{lkmethod}")
-TM_JUMP = _("\"<code>{method}</code>(Jump to method"
- " {method})\":#{lkmethod}")
-GTC_LINK = _(" \"{rtype}(Go to page of class {rtype})\":/class_{link} ")
-DFN_JUMP = _("\"*{funcname}*(Jump to description for"
- " node {funcname})\":#{link} <b>(</b> ")
-M_ARG_DEFAULT = C_LINK + " {name}={default}"
-M_ARG = C_LINK + " {name}"
-
-OPENPROJ_INH = _("h4. Inherits: ") + C_LINK + "\n\n"
-
-
-def tb(string):
- """ Return a byte representation of a string
- """
- return bytes(string, "UTF-8")
-
-
-def sortkey(c):
- """ Symbols are first, letters second
- """
- if "_" == c.attrib["name"][0]:
- return "A"
- else:
- return c.attrib["name"]
-
-
-def toOP(text):
- """ Convert commands in text to Open Project commands
- """
- # TODO: Make this capture content between [command] ... [/command]
- groups = re.finditer((r'\[html (?P<command>/?\w+/?)(\]| |=)?(\]| |=)?(?P<a'
- 'rg>\w+)?(\]| |=)?(?P<value>"[^"]+")?/?\]'), text)
- alignstr = ""
- for group in groups:
- gd = group.groupdict()
- if gd["command"] == "br/":
- text = text.replace(group.group(0), "\n\n", 1)
- elif gd["command"] == "div":
- if gd["value"] == '"center"':
- alignstr = ("{display:block; margin-left:auto;"
- " margin-right:auto;}")
- elif gd["value"] == '"left"':
- alignstr = "<"
- elif gd["value"] == '"right"':
- alignstr = ">"
- text = text.replace(group.group(0), "\n\n", 1)
- elif gd["command"] == "/div":
- alignstr = ""
- text = text.replace(group.group(0), "\n\n", 1)
- elif gd["command"] == "img":
- text = text.replace(group.group(0), "!{align}{src}!".format(
- align=alignstr, src=gd["value"].strip('"')), 1)
- elif gd["command"] == "b" or gd["command"] == "/b":
- text = text.replace(group.group(0), "*", 1)
- elif gd["command"] == "i" or gd["command"] == "/i":
- text = text.replace(group.group(0), "_", 1)
- elif gd["command"] == "u" or gd["command"] == "/u":
- text = text.replace(group.group(0), "+", 1)
- # Process other non-html commands
- groups = re.finditer((r'\[method ((?P<class>[aA0-zZ9_]+)(?:\.))'
- r'?(?P<method>[aA0-zZ9_]+)\]'), text)
- for group in groups:
- gd = group.groupdict()
- if gd["class"]:
- replacewith = (MC_LINK.format(gclass=gd["class"],
- method=gd["method"],
- lkclass=gd["class"].lower(),
- lkmethod=gd["method"].lower()))
- else:
- # The method is located in the same wiki page
- replacewith = (TM_JUMP.format(method=gd["method"],
- lkmethod=gd["method"].lower()))
-
- text = text.replace(group.group(0), replacewith, 1)
- # Finally, [Classes] are around brackets, make them direct links
- groups = re.finditer(r'\[(?P<class>[az0-AZ0_]+)\]', text)
- for group in groups:
- gd = group.groupdict()
- replacewith = (C_LINK.
- format(gclass=gd["class"],
- lkclass=gd["class"].lower()))
- text = text.replace(group.group(0), replacewith, 1)
-
- return text + "\n\n"
-
-
-def mkfn(node, is_signal=False):
- """ Return a string containing a unsorted item for a function
- """
- finalstr = ""
- name = node.attrib["name"]
- rtype = node.find("return")
- if rtype:
- rtype = rtype.attrib["type"]
- else:
- rtype = "void"
- # write the return type and the function name first
- finalstr += "* "
- # return type
- if not is_signal:
- if rtype != "void":
- finalstr += GTC_LINK.format(
- rtype=rtype,
- link=rtype.lower())
- else:
- finalstr += " void "
-
- # function name
- if not is_signal:
- finalstr += DFN_JUMP.format(
- funcname=name,
- link=name.lower())
- else:
- # Signals have no description
- finalstr += "*{funcname}* <b>(</b>".format(funcname=name)
- # loop for the arguments of the function, if any
- args = []
- for arg in sorted(
- node.iter(tag="argument"),
- key=lambda a: int(a.attrib["index"])):
-
- ntype = arg.attrib["type"]
- nname = arg.attrib["name"]
-
- if "default" in arg.attrib:
- args.insert(-1, M_ARG_DEFAULT.format(
- gclass=ntype,
- lkclass=ntype.lower(),
- name=nname,
- default=arg.attrib["default"]))
- else:
- # No default value present
- args.insert(-1, M_ARG.format(gclass=ntype,
- lkclass=ntype.lower(), name=nname))
- # join the arguments together
- finalstr += ", ".join(args)
- # and, close the function with a )
- finalstr += " <b>)</b>"
- # write the qualifier, if any
- if "qualifiers" in node.attrib:
- qualifier = node.attrib["qualifiers"]
- finalstr += " " + qualifier
-
- finalstr += "\n"
-
- return finalstr
-
-# Let's begin
-tree = ElementTree.parse(args.xmlfp)
-root = tree.getroot()
-
-# Check version attribute exists in <doc>
-if "version" not in root.attrib:
- logging.critical(_("<doc>'s version attribute missing"))
- exit(1)
-
-version = root.attrib["version"]
-classes = sorted(root, key=sortkey)
-# first column is always longer, second column of classes should be shorter
-zclasses = zip_longest(classes[:int(len(classes) / 2 + 1)],
- classes[int(len(classes) / 2 + 1):],
- fillvalue="")
-
-# We write the class_list file and also each class file at once
-with open(path.join(args.outputdir, "class_list.txt"), "wb") as fcl:
- # Write header of table
- fcl.write(tb("|^.\n"))
- fcl.write(tb(_("|_. Index symbol |_. Class name "
- "|_. Index symbol |_. Class name |\n")))
- fcl.write(tb("|-.\n"))
-
- indexletterl = ""
- indexletterr = ""
- for gdclassl, gdclassr in zclasses:
- # write a row #
- # write the index symbol column, left
- if indexletterl != gdclassl.attrib["name"][0]:
- indexletterl = gdclassl.attrib["name"][0]
- fcl.write(tb("| *{}* |".format(indexletterl.upper())))
- else:
- # empty cell
- fcl.write(tb("| |"))
- # write the class name column, left
- fcl.write(tb(C_LINK.format(
- gclass=gdclassl.attrib["name"],
- lkclass=gdclassl.attrib["name"].lower())))
-
- # write the index symbol column, right
- if isinstance(gdclassr, ElementTree.Element):
- if indexletterr != gdclassr.attrib["name"][0]:
- indexletterr = gdclassr.attrib["name"][0]
- fcl.write(tb("| *{}* |".format(indexletterr.upper())))
- else:
- # empty cell
- fcl.write(tb("| |"))
- # We are dealing with an empty string
- else:
- # two empty cell
- fcl.write(tb("| | |\n"))
- # We won't get the name of the class since there is no ElementTree
- # object for the right side of the tuple, so we iterate the next
- # tuple instead
- continue
-
- # write the class name column (if any), right
- fcl.write(tb(C_LINK.format(
- gclass=gdclassl.attrib["name"],
- lkclass=gdclassl.attrib["name"].lower()) + "|\n"))
-
- # row written #
- # now, let's write each class page for each class
- for gdclass in [gdclassl, gdclassr]:
- if not isinstance(gdclass, ElementTree.Element):
- continue
-
- classname = gdclass.attrib["name"]
- with open(path.join(args.outputdir, "{}.txt".format(
- classname.lower())), "wb") as clsf:
- # First level header with the name of the class
- clsf.write(tb("h1. {}\n\n".format(classname)))
- # lay the attributes
- if "inherits" in gdclass.attrib:
- inh = gdclass.attrib["inherits"].strip()
- clsf.write(tb(OPENPROJ_INH.format(gclass=inh,
- lkclass=inh.lower())))
- if "category" in gdclass.attrib:
- clsf.write(tb(_("h4. Category: {}\n\n").
- format(gdclass.attrib["category"].strip())))
- # lay child nodes
- briefd = gdclass.find("brief_description")
- if briefd.text.strip():
- clsf.write(tb(_("h2. Brief Description\n\n")))
- clsf.write(tb(toOP(briefd.text.strip()) +
- _("\"read more\":#more\n\n")))
-
- # Write the list of member functions of this class
- methods = gdclass.find("methods")
- if methods and len(methods) > 0:
- clsf.write(tb(_("\nh3. Member Functions\n\n")))
- for method in methods.iter(tag='method'):
- clsf.write(tb(mkfn(method)))
-
- signals = gdclass.find("signals")
- if signals and len(signals) > 0:
- clsf.write(tb(_("\nh3. Signals\n\n")))
- for signal in signals.iter(tag='signal'):
- clsf.write(tb(mkfn(signal, True)))
- # TODO: <members> tag is necessary to process? it does not
- # exists in class_list.xml file.
-
- consts = gdclass.find("constants")
- if consts and len(consts) > 0:
- clsf.write(tb(_("\nh3. Numeric Constants\n\n")))
- for const in sorted(consts, key=lambda k:
- k.attrib["name"]):
- if const.text.strip():
- clsf.write(tb("* *{name}* = *{value}* - {desc}\n".
- format(
- name=const.attrib["name"],
- value=const.attrib["value"],
- desc=const.text.strip())))
- else:
- # Constant have no description
- clsf.write(tb("* *{name}* = *{value}*\n".
- format(
- name=const.attrib["name"],
- value=const.attrib["value"])))
- descrip = gdclass.find("description")
- clsf.write(tb(_("\nh3(#more). Description\n\n")))
- if descrip.text:
- clsf.write(tb(descrip.text.strip() + "\n"))
- else:
- clsf.write(tb(_("_Nothing here, yet..._\n")))
-
- # and finally, the description for each method
- if methods and len(methods) > 0:
- clsf.write(tb(_("\nh3. Member Function Description\n\n")))
- for method in methods.iter(tag='method'):
- clsf.write(tb("h4(#{n}). {name}\n\n".format(
- n=method.attrib["name"].lower(),
- name=method.attrib["name"])))
- clsf.write(tb(mkfn(method) + "\n"))
- clsf.write(tb(toOP(method.find(
- "description").text.strip())))
diff --git a/doc/tools/makedoku.py b/doc/tools/makedoku.py
deleted file mode 100644
index ad3bfd791d..0000000000
--- a/doc/tools/makedoku.py
+++ /dev/null
@@ -1,499 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import sys
-import xml.etree.ElementTree as ET
-
-input_list = []
-
-
-for arg in sys.argv[1:]:
- input_list.append(arg)
-
-if len(input_list) < 1:
- print("usage: makedoku.py <classes.xml>")
- sys.exit(0)
-
-
-def validate_tag(elem, tag):
- if (elem.tag != tag):
- print("Tag mismatch, expected '" + tag + "', got " + elem.tag)
- sys.exit(255)
-
-
-class_names = []
-classes = {}
-
-
-def make_class_list(class_list, columns):
-
- f = open("class_list.txt", "wb")
- prev = 0
- col_max = len(class_list) / columns + 1
- print("col max is ", col_max)
- col_count = 0
- row_count = 0
- last_initial = ""
- fit_columns = []
-
- for n in range(0, columns):
- fit_columns += [[]]
-
- indexers = []
- last_initial = ""
-
- idx = 0
- for n in class_list:
- col = idx / col_max
- if (col >= columns):
- col = columns - 1
- fit_columns[col] += [n]
- idx += 1
- if (n[:1] != last_initial):
- indexers += [n]
- last_initial = n[:1]
-
- row_max = 0
-
- for n in range(0, columns):
- if (len(fit_columns[n]) > row_max):
- row_max = len(fit_columns[n])
-
- for r in range(0, row_max):
- s = "|"
- for c in range(0, columns):
- if (r >= len(fit_columns[c])):
- continue
-
- classname = fit_columns[c][r]
- initial = classname[0]
- if (classname in indexers):
- s += "**" + initial + "**|"
- else:
- s += " |"
-
- s += "[[" + classname.lower() + "|" + classname + "]]|"
-
- s += "\n"
- f.write(s)
-
-
-def dokuize_text(txt):
-
- return txt
-
-
-def dokuize_text(text):
- pos = 0
- while(True):
- pos = text.find("[", pos)
- if (pos == -1):
- break
-
- endq_pos = text.find("]", pos + 1)
- if (endq_pos == -1):
- break
-
- pre_text = text[:pos]
- post_text = text[endq_pos + 1:]
- tag_text = text[pos + 1:endq_pos]
-
- if (tag_text in class_names):
- tag_text = "[[" + tag_text.lower() + "|" + tag_text + "]]"
- else: # command
- cmd = tag_text
- space_pos = tag_text.find(" ")
- if (cmd.find("html") == 0):
- cmd = tag_text[:space_pos]
- param = tag_text[space_pos + 1:]
- tag_text = "<" + param + ">"
- elif(cmd.find("method") == 0):
- cmd = tag_text[:space_pos]
- param = tag_text[space_pos + 1:]
-
- if (param.find(".") != -1):
- class_param, method_param = param.split(".")
- tag_text = "[[" + class_param.lower() + "#" + method_param + "|" + class_param + '.' + method_param + "]]"
- else:
- tag_text = "[[#" + param + "|" + param + "]]"
- elif (cmd.find("image=") == 0):
- tag_text = "{{" + cmd[6:] + "}}"
- elif (cmd.find("url=") == 0):
- tag_text = "[[" + cmd[4:] + "|"
- elif (cmd == "/url"):
- tag_text = "]]>"
- elif (cmd == "center"):
- tag_text = ""
- elif (cmd == "/center"):
- tag_text = ""
- elif (cmd == "br"):
- tag_text = "\\\\\n"
- elif (cmd == "i" or cmd == "/i"):
- tag_text = "//"
- elif (cmd == "b" or cmd == "/b"):
- tag_text = "**"
- elif (cmd == "u" or cmd == "/u"):
- tag_text = "__"
- else:
- tag_text = "[" + tag_text + "]"
-
- text = pre_text + tag_text + post_text
- pos = len(pre_text) + len(tag_text)
-
- #tnode = ET.SubElement(parent,"div")
- # tnode.text=text
- return text
-
-
-def make_type(t):
- global class_names
- if (t in class_names):
- return "[[" + t.lower() + "|" + t + "]]"
- return t
-
-
-def make_method(f, name, m, declare, event=False):
-
- s = " * "
- ret_type = "void"
- args = list(m)
- mdata = {}
- mdata["argidx"] = []
- for a in args:
- if (a.tag == "return"):
- idx = -1
- elif (a.tag == "argument"):
- idx = int(a.attrib["index"])
- else:
- continue
-
- mdata["argidx"].append(idx)
- mdata[idx] = a
-
- if (not event):
- if (-1 in mdata["argidx"]):
- s += make_type(mdata[-1].attrib["type"])
- else:
- s += "void"
- s += " "
-
- if (declare):
-
- # span.attrib["class"]="funcdecl"
- # a=ET.SubElement(span,"a")
- # a.attrib["name"]=name+"_"+m.attrib["name"]
- # a.text=name+"::"+m.attrib["name"]
- s += "**" + m.attrib["name"] + "**"
- else:
- s += "[[#" + m.attrib["name"] + "|" + m.attrib["name"] + "]]"
-
- s += "**(**"
- argfound = False
- for a in mdata["argidx"]:
- arg = mdata[a]
- if (a < 0):
- continue
- if (a > 0):
- s += ", "
- else:
- s += " "
-
- s += make_type(arg.attrib["type"])
- if ("name" in arg.attrib):
- s += " " + arg.attrib["name"]
- else:
- s += " arg" + str(a)
-
- if ("default" in arg.attrib):
- s += "=" + arg.attrib["default"]
-
- argfound = True
-
- if (argfound):
- s += " "
- s += "**)**"
-
- if ("qualifiers" in m.attrib):
- s += " " + m.attrib["qualifiers"]
-
- f.write(s + "\n")
-
-
-def make_doku_class(node):
-
- name = node.attrib["name"]
-
- f = open(name.lower() + ".txt", "wb")
-
- f.write("====== " + name + " ======\n")
-
- if ("inherits" in node.attrib):
- inh = node.attrib["inherits"].strip()
- f.write("**Inherits:** [[" + inh.lower() + "|" + inh + "]]\\\\\n")
- if ("category" in node.attrib):
- f.write("**Category:** " + node.attrib["category"].strip() + "\\\\\n")
-
- briefd = node.find("brief_description")
- if (briefd != None):
- f.write("===== Brief Description ======\n")
- f.write(dokuize_text(briefd.text.strip()) + "\n")
-
- methods = node.find("methods")
-
- if(methods != None and len(list(methods)) > 0):
- f.write("===== Member Functions ======\n")
- for m in list(methods):
- make_method(f, node.attrib["name"], m, False)
-
- events = node.find("signals")
- if(events != None and len(list(events)) > 0):
- f.write("===== Signals ======\n")
- for m in list(events):
- make_method(f, node.attrib["name"], m, True, True)
-
- members = node.find("members")
-
- if(members != None and len(list(members)) > 0):
- f.write("===== Member Variables ======\n")
-
- for c in list(members):
- s = " * "
- s += make_type(c.attrib["type"]) + " "
- s += "**" + c.attrib["name"] + "**"
- if (c.text.strip() != ""):
- s += " - " + c.text.strip()
- f.write(s + "\n")
-
- constants = node.find("constants")
- if(constants != None and len(list(constants)) > 0):
- f.write("===== Numeric Constants ======\n")
- for c in list(constants):
- s = " * "
- s += "**" + c.attrib["name"] + "**"
- if ("value" in c.attrib):
- s += " = **" + c.attrib["value"] + "**"
- if (c.text.strip() != ""):
- s += " - " + c.text.strip()
- f.write(s + "\n")
-
- descr = node.find("description")
- if (descr != None and descr.text.strip() != ""):
- f.write("===== Description ======\n")
- f.write(dokuize_text(descr.text.strip()) + "\n")
-
- methods = node.find("methods")
-
- if(methods != None and len(list(methods)) > 0):
- f.write("===== Member Function Description ======\n")
- for m in list(methods):
-
- d = m.find("description")
- if (d == None or d.text.strip() == ""):
- continue
- f.write("== " + m.attrib["name"] + " ==\n")
- make_method(f, node.attrib["name"], m, False)
- f.write("\\\\\n")
- f.write(dokuize_text(d.text.strip()))
- f.write("\n")
-
- """
- div=ET.Element("div")
- div.attrib["class"]="class";
-
- a=ET.SubElement(div,"a")
- a.attrib["name"]=node.attrib["name"]
-
- h3=ET.SubElement(a,"h3")
- h3.attrib["class"]="title class_title"
- h3.text=node.attrib["name"]
-
- briefd = node.find("brief_description")
- if (briefd!=None):
- div2=ET.SubElement(div,"div")
- div2.attrib["class"]="description class_description"
- div2.text=briefd.text
-
- if ("inherits" in node.attrib):
- ET.SubElement(div,"br")
-
- div2=ET.SubElement(div,"div")
- div2.attrib["class"]="inheritance";
-
- span=ET.SubElement(div2,"span")
- span.text="Inherits: "
-
- make_type(node.attrib["inherits"],div2)
-
- if ("category" in node.attrib):
- ET.SubElement(div,"br")
-
- div3=ET.SubElement(div,"div")
- div3.attrib["class"]="category";
-
- span=ET.SubElement(div3,"span")
- span.attrib["class"]="category"
- span.text="Category: "
-
- a = ET.SubElement(div3,"a")
- a.attrib["class"]="category_ref"
- a.text=node.attrib["category"]
- catname=a.text
- if (catname.rfind("/")!=-1):
- catname=catname[catname.rfind("/"):]
- catname="CATEGORY_"+catname
-
- if (single_page):
- a.attrib["href"]="#"+catname
- else:
- a.attrib["href"]="category.html#"+catname
-
-
- methods = node.find("methods")
-
- if(methods!=None and len(list(methods))>0):
-
- h4=ET.SubElement(div,"h4")
- h4.text="Public Methods:"
-
- method_table=ET.SubElement(div,"table")
- method_table.attrib["class"]="method_list";
-
- for m in list(methods):
-# li = ET.SubElement(div2, "li")
- method_table.append( make_method_def(node.attrib["name"],m,False) )
-
- events = node.find("signals")
-
- if(events!=None and len(list(events))>0):
- h4=ET.SubElement(div,"h4")
- h4.text="Events:"
-
- event_table=ET.SubElement(div,"table")
- event_table.attrib["class"]="method_list";
-
- for m in list(events):
-# li = ET.SubElement(div2, "li")
- event_table.append( make_method_def(node.attrib["name"],m,False,True) )
-
-
- members = node.find("members")
- if(members!=None and len(list(members))>0):
-
- h4=ET.SubElement(div,"h4")
- h4.text="Public Variables:"
- div2=ET.SubElement(div,"div")
- div2.attrib["class"]="member_list";
-
- for c in list(members):
-
- li = ET.SubElement(div2, "li")
- div3=ET.SubElement(li,"div")
- div3.attrib["class"]="member";
- make_type(c.attrib["type"],div3)
- span=ET.SubElement(div3,"span")
- span.attrib["class"]="identifier member_name"
- span.text=" "+c.attrib["name"]+" "
- span=ET.SubElement(div3,"span")
- span.attrib["class"]="member_description"
- span.text=c.text
-
-
- constants = node.find("constants")
- if(constants!=None and len(list(constants))>0):
-
- h4=ET.SubElement(div,"h4")
- h4.text="Constants:"
- div2=ET.SubElement(div,"div")
- div2.attrib["class"]="constant_list";
-
- for c in list(constants):
- li = ET.SubElement(div2, "li")
- div3=ET.SubElement(li,"div")
- div3.attrib["class"]="constant";
-
- span=ET.SubElement(div3,"span")
- span.attrib["class"]="identifier constant_name"
- span.text=c.attrib["name"]+" "
- if ("value" in c.attrib):
- span=ET.SubElement(div3,"span")
- span.attrib["class"]="symbol"
- span.text="= "
- span=ET.SubElement(div3,"span")
- span.attrib["class"]="constant_value"
- span.text=c.attrib["value"]+" "
- span=ET.SubElement(div3,"span")
- span.attrib["class"]="constant_description"
- span.text=c.text
-
-# ET.SubElement(div,"br")
-
-
- descr=node.find("description")
- if (descr!=None and descr.text.strip()!=""):
-
- h4=ET.SubElement(div,"h4")
- h4.text="Description:"
-
- make_text_def(node.attrib["name"],div,descr.text)
-# div2=ET.SubElement(div,"div")
-# div2.attrib["class"]="description";
-# div2.text=descr.text
-
-
-
- if(methods!=None or events!=None):
-
- h4=ET.SubElement(div,"h4")
- h4.text="Method Documentation:"
- iter_list = []
- if (methods!=None):
- iter_list+=list(methods)
- if (events!=None):
- iter_list+=list(events)
-
- for m in iter_list:
-
- descr=m.find("description")
-
- if (descr==None or descr.text.strip()==""):
- continue;
-
- div2=ET.SubElement(div,"div")
- div2.attrib["class"]="method_doc";
-
-
- div2.append( make_method_def(node.attrib["name"],m,True) )
- #anchor = ET.SubElement(div2, "a")
- #anchor.attrib["name"] =
- make_text_def(node.attrib["name"],div2,descr.text)
- #div3=ET.SubElement(div2,"div")
- #div3.attrib["class"]="description";
- #div3.text=descr.text
-
-
- return div
-"""
-for file in input_list:
- tree = ET.parse(file)
- doc = tree.getroot()
-
- if ("version" not in doc.attrib):
- print("Version missing from 'doc'")
- sys.exit(255)
-
- version = doc.attrib["version"]
-
- for c in list(doc):
- if (c.attrib["name"] in class_names):
- continue
- class_names.append(c.attrib["name"])
- classes[c.attrib["name"]] = c
-
-
-class_names.sort()
-
-make_class_list(class_names, 4)
-
-for cn in class_names:
- c = classes[cn]
- make_doku_class(c)
diff --git a/doc/tools/makehtml.py b/doc/tools/makehtml.py
deleted file mode 100644
index 3ecb8220cb..0000000000
--- a/doc/tools/makehtml.py
+++ /dev/null
@@ -1,689 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import sys
-import xml.etree.ElementTree as ET
-from xml.sax.saxutils import escape, unescape
-
-html_escape_table = {
- '"': "&quot;",
- "'": "&apos;"
-}
-
-html_unescape_table = {v: k for k, v in html_escape_table.items()}
-
-
-def html_escape(text):
- return escape(text, html_escape_table)
-
-
-def html_unescape(text):
- return unescape(text, html_unescape_table)
-
-input_list = []
-
-single_page = True
-
-for arg in sys.argv[1:]:
- if arg[:1] == "-":
- if arg[1:] == "multipage":
- single_page = False
- if arg[1:] == "singlepage":
- single_page = True
- else:
- input_list.append(arg)
-
-if len(input_list) < 1:
- print("usage: makehtml.py <classes.xml>")
- sys.exit(0)
-
-
-def validate_tag(elem, tag):
- if (elem.tag != tag):
- print("Tag mismatch, expected '" + tag + "', got " + elem.tag)
- sys.exit(255)
-
-
-def make_html_bottom(body):
- # make_html_top(body,True)
- ET.SubElement(body, "hr")
- copyright = ET.SubElement(body, "span")
- copyright.text = "Copyright 2008-2010 Codenix SRL"
-
-
-def make_html_top(body, bottom=False):
-
- if (bottom):
- ET.SubElement(body, "hr")
-
- table = ET.SubElement(body, "table")
- table.attrib["class"] = "top_table"
- tr = ET.SubElement(table, "tr")
- td = ET.SubElement(tr, "td")
- td.attrib["class"] = "top_table"
-
- img = ET.SubElement(td, "image")
- img.attrib["src"] = "images/logo.png"
- td = ET.SubElement(tr, "td")
- td.attrib["class"] = "top_table"
- a = ET.SubElement(td, "a")
- a.attrib["href"] = "index.html"
- a.text = "Index"
- td = ET.SubElement(tr, "td")
- td.attrib["class"] = "top_table"
- a = ET.SubElement(td, "a")
- a.attrib["href"] = "alphabetical.html"
- a.text = "Classes"
- td = ET.SubElement(tr, "td")
- td.attrib["class"] = "top_table"
- a = ET.SubElement(td, "a")
- a.attrib["href"] = "category.html"
- a.text = "Categories"
- td = ET.SubElement(tr, "td")
- a = ET.SubElement(td, "a")
- a.attrib["href"] = "inheritance.html"
- a.text = "Inheritance"
- if (not bottom):
- ET.SubElement(body, "hr")
-
-
-def make_html_class_list(class_list, columns):
-
- div = ET.Element("div")
- div.attrib["class"] = "ClassList"
-
- h1 = ET.SubElement(div, "h2")
- h1.text = "Alphabetical Class List"
-
- table = ET.SubElement(div, "table")
- table.attrib["class"] = "class_table"
- table.attrib["width"] = "100%"
- prev = 0
-
- col_max = len(class_list) / columns + 1
- print("col max is ", col_max)
- col_count = 0
- row_count = 0
- last_initial = ""
- fit_columns = []
-
- for n in range(0, columns):
- fit_columns += [[]]
-
- indexers = []
- last_initial = ""
-
- idx = 0
- for n in class_list:
- col = int(idx / col_max)
- if (col >= columns):
- col = columns - 1
- fit_columns[col] += [n]
- idx += 1
- if (n[:1] != last_initial):
- indexers += [n]
- last_initial = n[:1]
-
- row_max = 0
-
- for n in range(0, columns):
- if (len(fit_columns[n]) > row_max):
- row_max = len(fit_columns[n])
-
- for r in range(0, row_max):
- tr = ET.SubElement(table, "tr")
- for c in range(0, columns):
- tdi = ET.SubElement(tr, "td")
- tdi.attrib["align"] = "right"
- td = ET.SubElement(tr, "td")
- if (r >= len(fit_columns[c])):
- continue
-
- classname = fit_columns[c][r]
- print(classname)
- if (classname in indexers):
-
- span = ET.SubElement(tdi, "span")
- span.attrib["class"] = "class_index_letter"
- span.text = classname[:1].upper()
-
- if (single_page):
- link = "#" + classname
- else:
- link = classname + ".html"
-
- a = ET.SubElement(td, "a")
- a.attrib["href"] = link
- a.text = classname
-
- if (not single_page):
- cat_class_list = ET.Element("html")
- csscc = ET.SubElement(cat_class_list, "link")
- csscc.attrib["href"] = "main.css"
- csscc.attrib["rel"] = "stylesheet"
- csscc.attrib["type"] = "text/css"
- bodycc = ET.SubElement(cat_class_list, "body")
- make_html_top(bodycc)
-
- cat_class_parent = bodycc
- else:
- cat_class_parent = div
-
- h1 = ET.SubElement(cat_class_parent, "h2")
- h1.text = "Class List By Category"
-
- class_cat_table = {}
- class_cat_list = []
-
- for c in class_list:
- clss = classes[c]
- if ("category" in clss.attrib):
- class_cat = clss.attrib["category"]
- else:
- class_cat = "Core"
- if (class_cat.find("/") != -1):
- class_cat = class_cat[class_cat.rfind("/") + 1:]
- if (not class_cat in class_cat_list):
- class_cat_list.append(class_cat)
- class_cat_table[class_cat] = []
- class_cat_table[class_cat].append(c)
-
- class_cat_list.sort()
-
- ct = ET.SubElement(cat_class_parent, "table")
- for cl in class_cat_list:
- l = class_cat_table[cl]
- l.sort()
- tr = ET.SubElement(ct, "tr")
- tr.attrib["class"] = "category_title"
- td = ET.SubElement(ct, "td")
- td.attrib["class"] = "category_title"
-
- a = ET.SubElement(td, "a")
- a.attrib["class"] = "category_title"
- a.text = cl
- a.attrib["name"] = "CATEGORY_" + cl
-
- td = ET.SubElement(ct, "td")
- td.attrib["class"] = "category_title"
-
- for clt in l:
- tr = ET.SubElement(ct, "tr")
- td = ET.SubElement(ct, "td")
- make_type(clt, td)
- clss = classes[clt]
- bd = clss.find("brief_description")
- bdtext = ""
- if (bd != None):
- bdtext = bd.text
- td = ET.SubElement(ct, "td")
- td.text = bdtext
-
- if (not single_page):
- make_html_bottom(bodycc)
- catet_out = ET.ElementTree(cat_class_list)
- catet_out.write("category.html")
-
- if (not single_page):
- inh_class_list = ET.Element("html")
- cssic = ET.SubElement(inh_class_list, "link")
- cssic.attrib["href"] = "main.css"
- cssic.attrib["rel"] = "stylesheet"
- cssic.attrib["type"] = "text/css"
- bodyic = ET.SubElement(inh_class_list, "body")
- make_html_top(bodyic)
- inh_class_parent = bodyic
- else:
- inh_class_parent = div
-
- h1 = ET.SubElement(inh_class_parent, "h2")
- h1.text = "Class List By Inheritance"
-
- itemlist = ET.SubElement(inh_class_parent, "list")
-
- class_inh_table = {}
-
- def add_class(clss):
- if (clss.attrib["name"] in class_inh_table):
- return # already added
- parent_list = None
-
- if ("inherits" in clss.attrib):
- inhc = clss.attrib["inherits"]
- if (not (inhc in class_inh_table)):
- add_class(classes[inhc])
-
- parent_list = class_inh_table[inhc].find("div")
- if (parent_list == None):
- parent_div = ET.SubElement(class_inh_table[inhc], "div")
- parent_list = ET.SubElement(parent_div, "list")
- parent_div.attrib["class"] = "inh_class_list"
- else:
- parent_list = parent_list.find("list")
-
- else:
- parent_list = itemlist
-
- item = ET.SubElement(parent_list, "li")
-# item.attrib["class"]="inh_class_list"
- class_inh_table[clss.attrib["name"]] = item
- make_type(clss.attrib["name"], item)
-
- for c in class_list:
- add_class(classes[c])
-
- if (not single_page):
- make_html_bottom(bodyic)
- catet_out = ET.ElementTree(inh_class_list)
- catet_out.write("inheritance.html")
-
- # h1=ET.SubElement(div,"h2")
- #h1.text="Class List By Inheritance"
-
- return div
-
-
-def make_type(p_type, p_parent):
- if (p_type == "RefPtr"):
- p_type = "Resource"
-
- if (p_type in class_names):
- a = ET.SubElement(p_parent, "a")
- a.attrib["class"] = "datatype_existing"
- a.text = p_type + " "
- if (single_page):
- a.attrib["href"] = "#" + p_type
- else:
- a.attrib["href"] = p_type + ".html"
- else:
- span = ET.SubElement(p_parent, "span")
- span.attrib["class"] = "datatype"
- span.text = p_type + " "
-
-
-def make_text_def(class_name, parent, text):
- text = html_escape(text)
- pos = 0
- while(True):
- pos = text.find("[", pos)
- if (pos == -1):
- break
-
- endq_pos = text.find("]", pos + 1)
- if (endq_pos == -1):
- break
-
- pre_text = text[:pos]
- post_text = text[endq_pos + 1:]
- tag_text = text[pos + 1:endq_pos]
-
- if (tag_text in class_names):
- if (single_page):
- tag_text = '<a href="#' + tag_text + '">' + tag_text + '</a>'
- else:
- tag_text = '<a href="' + tag_text + '.html">' + tag_text + '</a>'
- else: # command
- cmd = tag_text
- space_pos = tag_text.find(" ")
- if (cmd.find("html") == 0):
- cmd = tag_text[:space_pos]
- param = tag_text[space_pos + 1:]
- tag_text = "<" + param + ">"
- elif(cmd.find("method") == 0):
- cmd = tag_text[:space_pos]
- param = tag_text[space_pos + 1:]
-
- if (not single_page and param.find(".") != -1):
- class_param, method_param = param.split(".")
- tag_text = tag_text = '<a href="' + class_param + '.html#' + class_param + "_" + method_param + '">' + class_param + '.' + method_param + '()</a>'
- else:
- tag_text = tag_text = '<a href="#' + class_name + "_" + param + '">' + class_name + '.' + param + '()</a>'
- elif (cmd.find("image=") == 0):
- print("found image: " + cmd)
- tag_text = "<img src=" + cmd[6:] + "/>"
- elif (cmd.find("url=") == 0):
- tag_text = "<a href=" + cmd[4:] + ">"
- elif (cmd == "/url"):
- tag_text = "</a>"
- elif (cmd == "center"):
- tag_text = "<div align=\"center\">"
- elif (cmd == "/center"):
- tag_text = "</div>"
- elif (cmd == "br"):
- tag_text = "<br/>"
- elif (cmd == "i" or cmd == "/i" or cmd == "b" or cmd == "/b" or cmd == "u" or cmd == "/u"):
- tag_text = "<" + tag_text + ">" # html direct mapping
- else:
- tag_text = "[" + tag_text + "]"
-
- text = pre_text + tag_text + post_text
- pos = len(pre_text) + len(tag_text)
-
- #tnode = ET.SubElement(parent,"div")
- # tnode.text=text
- text = "<div class=\"description\">" + text + "</div>"
- try:
- tnode = ET.XML(text)
- parent.append(tnode)
- except:
- print("Error parsing description text: '" + text + "'")
- sys.exit(255)
-
- return tnode
-
-
-def make_method_def(name, m, declare, event=False):
-
- mdata = {}
-
- if (not declare):
- div = ET.Element("tr")
- div.attrib["class"] = "method"
- ret_parent = ET.SubElement(div, "td")
- ret_parent.attrib["align"] = "right"
- func_parent = ET.SubElement(div, "td")
- else:
- div = ET.Element("div")
- div.attrib["class"] = "method"
- ret_parent = div
- func_parent = div
-
- mdata["argidx"] = []
- mdata["name"] = m.attrib["name"]
- qualifiers = ""
- if ("qualifiers" in m.attrib):
- qualifiers = m.attrib["qualifiers"]
-
- args = list(m)
- for a in args:
- if (a.tag == "return"):
- idx = -1
- elif (a.tag == "argument"):
- idx = int(a.attrib["index"])
- else:
- continue
-
- mdata["argidx"].append(idx)
- mdata[idx] = a
-
- if (not event):
- if (-1 in mdata["argidx"]):
- make_type(mdata[-1].attrib["type"], ret_parent)
- mdata["argidx"].remove(-1)
- else:
- make_type("void", ret_parent)
-
- span = ET.SubElement(func_parent, "span")
- if (declare):
- span.attrib["class"] = "funcdecl"
- a = ET.SubElement(span, "a")
- a.attrib["name"] = name + "_" + m.attrib["name"]
- a.text = name + "::" + m.attrib["name"]
- else:
- span.attrib["class"] = "identifier funcdef"
- a = ET.SubElement(span, "a")
- a.attrib["href"] = "#" + name + "_" + m.attrib["name"]
- a.text = m.attrib["name"]
-
- span = ET.SubElement(func_parent, "span")
- span.attrib["class"] = "symbol"
- span.text = " ("
-
- for a in mdata["argidx"]:
- arg = mdata[a]
- if (a > 0):
- span = ET.SubElement(func_parent, "span")
- span.text = ", "
- else:
- span = ET.SubElement(func_parent, "span")
- span.text = " "
-
- make_type(arg.attrib["type"], func_parent)
-
- span = ET.SubElement(func_parent, "span")
- span.text = arg.attrib["name"]
- if ("default" in arg.attrib):
- span.text = span.text + "=" + arg.attrib["default"]
-
- span = ET.SubElement(func_parent, "span")
- span.attrib["class"] = "symbol"
- if (len(mdata["argidx"])):
- span.text = " )"
- else:
- span.text = ")"
-
- if (qualifiers):
- span = ET.SubElement(func_parent, "span")
- span.attrib["class"] = "qualifier"
- span.text = " " + qualifiers
-
- return div
-
-
-def make_html_class(node):
-
- div = ET.Element("div")
- div.attrib["class"] = "class"
-
- a = ET.SubElement(div, "a")
- a.attrib["name"] = node.attrib["name"]
-
- h3 = ET.SubElement(a, "h3")
- h3.attrib["class"] = "title class_title"
- h3.text = node.attrib["name"]
-
- briefd = node.find("brief_description")
- if (briefd != None):
- div2 = ET.SubElement(div, "div")
- div2.attrib["class"] = "description class_description"
- div2.text = briefd.text
-
- if ("inherits" in node.attrib):
- ET.SubElement(div, "br")
-
- div2 = ET.SubElement(div, "div")
- div2.attrib["class"] = "inheritance"
-
- span = ET.SubElement(div2, "span")
- span.text = "Inherits: "
-
- make_type(node.attrib["inherits"], div2)
-
- if ("category" in node.attrib):
- ET.SubElement(div, "br")
-
- div3 = ET.SubElement(div, "div")
- div3.attrib["class"] = "category"
-
- span = ET.SubElement(div3, "span")
- span.attrib["class"] = "category"
- span.text = "Category: "
-
- a = ET.SubElement(div3, "a")
- a.attrib["class"] = "category_ref"
- a.text = node.attrib["category"]
- catname = a.text
- if (catname.rfind("/") != -1):
- catname = catname[catname.rfind("/"):]
- catname = "CATEGORY_" + catname
-
- if (single_page):
- a.attrib["href"] = "#" + catname
- else:
- a.attrib["href"] = "category.html#" + catname
-
- methods = node.find("methods")
-
- if(methods != None and len(list(methods)) > 0):
-
- h4 = ET.SubElement(div, "h4")
- h4.text = "Public Methods:"
-
- method_table = ET.SubElement(div, "table")
- method_table.attrib["class"] = "method_list"
-
- for m in list(methods):
- #li = ET.SubElement(div2, "li")
- method_table.append(make_method_def(node.attrib["name"], m, False))
-
- events = node.find("signals")
-
- if(events != None and len(list(events)) > 0):
- h4 = ET.SubElement(div, "h4")
- h4.text = "Events:"
-
- event_table = ET.SubElement(div, "table")
- event_table.attrib["class"] = "method_list"
-
- for m in list(events):
- #li = ET.SubElement(div2, "li")
- event_table.append(make_method_def(node.attrib["name"], m, False, True))
-
- members = node.find("members")
- if(members != None and len(list(members)) > 0):
-
- h4 = ET.SubElement(div, "h4")
- h4.text = "Public Variables:"
- div2 = ET.SubElement(div, "div")
- div2.attrib["class"] = "member_list"
-
- for c in list(members):
-
- li = ET.SubElement(div2, "li")
- div3 = ET.SubElement(li, "div")
- div3.attrib["class"] = "member"
- make_type(c.attrib["type"], div3)
- span = ET.SubElement(div3, "span")
- span.attrib["class"] = "identifier member_name"
- span.text = " " + c.attrib["name"] + " "
- span = ET.SubElement(div3, "span")
- span.attrib["class"] = "member_description"
- span.text = c.text
-
- constants = node.find("constants")
- if(constants != None and len(list(constants)) > 0):
-
- h4 = ET.SubElement(div, "h4")
- h4.text = "Constants:"
- div2 = ET.SubElement(div, "div")
- div2.attrib["class"] = "constant_list"
-
- for c in list(constants):
- li = ET.SubElement(div2, "li")
- div3 = ET.SubElement(li, "div")
- div3.attrib["class"] = "constant"
-
- span = ET.SubElement(div3, "span")
- span.attrib["class"] = "identifier constant_name"
- span.text = c.attrib["name"] + " "
- if ("value" in c.attrib):
- span = ET.SubElement(div3, "span")
- span.attrib["class"] = "symbol"
- span.text = "= "
- span = ET.SubElement(div3, "span")
- span.attrib["class"] = "constant_value"
- span.text = c.attrib["value"] + " "
- span = ET.SubElement(div3, "span")
- span.attrib["class"] = "constant_description"
- span.text = c.text
-
-# ET.SubElement(div,"br")
-
- descr = node.find("description")
- if (descr != None and descr.text.strip() != ""):
- h4 = ET.SubElement(div, "h4")
- h4.text = "Description:"
-
- make_text_def(node.attrib["name"], div, descr.text)
-# div2=ET.SubElement(div,"div")
-# div2.attrib["class"]="description";
-# div2.text=descr.text
-
- if(methods != None or events != None):
-
- h4 = ET.SubElement(div, "h4")
- h4.text = "Method Documentation:"
- iter_list = []
- if (methods != None):
- iter_list += list(methods)
- if (events != None):
- iter_list += list(events)
-
- for m in iter_list:
-
- descr = m.find("description")
-
- if (descr == None or descr.text.strip() == ""):
- continue
-
- div2 = ET.SubElement(div, "div")
- div2.attrib["class"] = "method_doc"
-
- div2.append(make_method_def(node.attrib["name"], m, True))
- #anchor = ET.SubElement(div2, "a")
- # anchor.attrib["name"] =
- make_text_def(node.attrib["name"], div2, descr.text)
- # div3=ET.SubElement(div2,"div")
- # div3.attrib["class"]="description";
- # div3.text=descr.text
-
- return div
-
-class_names = []
-classes = {}
-
-for file in input_list:
- tree = ET.parse(file)
- doc = tree.getroot()
-
- if ("version" not in doc.attrib):
- print("Version missing from 'doc'")
- sys.exit(255)
-
- version = doc.attrib["version"]
-
- for c in list(doc):
- if (c.attrib["name"] in class_names):
- continue
- class_names.append(c.attrib["name"])
- classes[c.attrib["name"]] = c
-
-html = ET.Element("html")
-css = ET.SubElement(html, "link")
-css.attrib["href"] = "main.css"
-css.attrib["rel"] = "stylesheet"
-css.attrib["type"] = "text/css"
-
-body = ET.SubElement(html, "body")
-if (not single_page):
- make_html_top(body)
-
-
-class_names.sort()
-
-body.append(make_html_class_list(class_names, 5))
-
-for cn in class_names:
- c = classes[cn]
- if (single_page):
- body.append(make_html_class(c))
- else:
- html2 = ET.Element("html")
- css = ET.SubElement(html2, "link")
- css.attrib["href"] = "main.css"
- css.attrib["rel"] = "stylesheet"
- css.attrib["type"] = "text/css"
- body2 = ET.SubElement(html2, "body")
- make_html_top(body2)
- body2.append(make_html_class(c))
- make_html_bottom(body2)
- et_out = ET.ElementTree(html2)
- et_out.write(c.attrib["name"] + ".html")
-
-
-et_out = ET.ElementTree(html)
-if (single_page):
- et_out.write("singlepage.html")
-else:
- make_html_bottom(body)
- et_out.write("alphabetical.html")
diff --git a/doc/tools/makemd.py b/doc/tools/makemd.py
index bd0d4c6819..b2444eb47b 100644
--- a/doc/tools/makemd.py
+++ b/doc/tools/makemd.py
@@ -273,6 +273,12 @@ def make_doku_class(node):
f.write('\n### Signals \n')
for m in list(events):
make_method(f, node.attrib['name'], m, True, True)
+ d = m.find('description')
+ if d == None or d.text.strip() == '':
+ continue
+ f.write('\n')
+ f.write(dokuize_text(d.text.strip()))
+ f.write('\n')
members = node.find('members')
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py
index 6b6780ce1e..696e3c9c78 100644
--- a/doc/tools/makerst.py
+++ b/doc/tools/makerst.py
@@ -172,6 +172,7 @@ def rstize_text(text, cclass):
pos += 1
# Handle [tags]
+ inside_code = False
pos = 0
while True:
pos = text.find('[', pos)
@@ -191,7 +192,18 @@ def rstize_text(text, cclass):
else: # command
cmd = tag_text
space_pos = tag_text.find(' ')
- if cmd.find('html') == 0:
+ if cmd == '/codeblock':
+ tag_text = ''
+ inside_code = False
+ # Strip newline if the tag was alone on one
+ if pre_text[-1] == '\n':
+ pre_text = pre_text[:-1]
+ elif cmd == '/code':
+ tag_text = '``'
+ inside_code = False
+ elif inside_code:
+ tag_text = '[' + tag_text + ']'
+ elif cmd.find('html') == 0:
cmd = tag_text[:space_pos]
param = tag_text[space_pos + 1:]
tag_text = param
@@ -216,11 +228,7 @@ def rstize_text(text, cclass):
tag_text = ''
elif cmd == 'codeblock':
tag_text = '\n::\n'
- elif cmd == '/codeblock':
- tag_text = ''
- # Strip newline if the tag was alone on one
- if pre_text[-1] == '\n':
- pre_text = pre_text[:-1]
+ inside_code = True
elif cmd == 'br':
# Make a new paragraph instead of a linebreak, rst is not so linebreak friendly
tag_text = '\n\n'
@@ -233,10 +241,11 @@ def rstize_text(text, cclass):
tag_text = '**'
elif cmd == 'u' or cmd == '/u':
tag_text = ''
- elif cmd == 'code' or cmd == '/code':
+ elif cmd == 'code':
tag_text = '``'
+ inside_code = True
else:
- tag_text = ':ref:`' + tag_text + '<class_' + tag_text.lower() + '>`'
+ tag_text = make_type(tag_text)
text = pre_text + tag_text + post_text
pos = len(pre_text) + len(tag_text)
@@ -441,6 +450,12 @@ def make_rst_class(node):
f.write(make_heading('Signals', '-'))
for m in list(events):
make_method(f, node.attrib['name'], m, True, name, True)
+ d = m.find('description')
+ if d == None or d.text.strip() == '':
+ continue
+ f.write(rstize_text(d.text.strip(), name))
+ f.write("\n\n")
+
f.write('\n')
members = node.find('members')
diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp
index 7e445c7c10..4e6739e8c0 100644
--- a/drivers/alsa/audio_driver_alsa.cpp
+++ b/drivers/alsa/audio_driver_alsa.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,7 +31,7 @@
#ifdef ALSA_ENABLED
-#include "global_config.h"
+#include "project_settings.h"
#include <errno.h>
diff --git a/drivers/alsa/audio_driver_alsa.h b/drivers/alsa/audio_driver_alsa.h
index e545b7a511..9e9413f3d9 100644
--- a/drivers/alsa/audio_driver_alsa.h
+++ b/drivers/alsa/audio_driver_alsa.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/convex_decomp/SCsub b/drivers/convex_decomp/SCsub
index ee39fd2631..f017e55120 100644
--- a/drivers/convex_decomp/SCsub
+++ b/drivers/convex_decomp/SCsub
@@ -4,4 +4,13 @@ Import('env')
env.add_source_files(env.drivers_sources, "*.cpp")
+# Thirdparty dependencies
+thirdparty_dir = "#thirdparty/b2d_convexdecomp/"
+thirdparty_sources = [
+ "b2Polygon.cpp",
+ "b2Triangle.cpp",
+]
+thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+env.add_source_files(env.drivers_sources, thirdparty_sources)
+
Export('env')
diff --git a/drivers/convex_decomp/b2d_decompose.cpp b/drivers/convex_decomp/b2d_decompose.cpp
index afafda1527..d9011b8eab 100644
--- a/drivers/convex_decomp/b2d_decompose.cpp
+++ b/drivers/convex_decomp/b2d_decompose.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "b2d_decompose.h"
-#include "b2Polygon.h"
+
+#include "thirdparty/b2d_convexdecomp/b2Polygon.h"
namespace b2ConvexDecomp {
diff --git a/drivers/convex_decomp/b2d_decompose.h b/drivers/convex_decomp/b2d_decompose.h
index c3765275ef..3a064e08d3 100644
--- a/drivers/convex_decomp/b2d_decompose.h
+++ b/drivers/convex_decomp/b2d_decompose.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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/gl_context/context_gl.cpp b/drivers/gl_context/context_gl.cpp
index 9fe7fbf2b8..935391d58e 100644
--- a/drivers/gl_context/context_gl.cpp
+++ b/drivers/gl_context/context_gl.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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/gl_context/context_gl.h b/drivers/gl_context/context_gl.h
index 280da1aea6..c8eb0f93b4 100644
--- a/drivers/gl_context/context_gl.h
+++ b/drivers/gl_context/context_gl.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index 3f54f887da..7ad08ed7d5 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,8 +31,8 @@
#include "rasterizer_gles2.h"
#include "gl_context/context_gl.h"
-#include "global_config.h"
#include "os/os.h"
+#include "project_settings.h"
#include "servers/visual/particle_system_sw.h"
#include "servers/visual/shader_language.h"
#include <stdio.h>
@@ -341,12 +342,12 @@ void RasterizerGLES2::_draw_primitive(int p_points, const Vector3 *p_vertices, c
/* TEXTURE API */
-Image RasterizerGLES2::_get_gl_image_and_format(const Image &p_image, Image::Format p_format, uint32_t p_flags, GLenum &r_gl_format, GLenum &r_gl_internal_format, int &r_gl_components, bool &r_has_alpha_cache, bool &r_compressed) {
+Ref<Image> RasterizerGLES2::_get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, GLenum &r_gl_format, GLenum &r_gl_internal_format, int &r_gl_components, bool &r_has_alpha_cache, bool &r_compressed) {
r_has_alpha_cache = false;
r_compressed = false;
r_gl_format = 0;
- Image image = p_image;
+ Ref<Image> image = p_image;
switch (p_format) {
@@ -1599,9 +1600,9 @@ RID RasterizerGLES2::material_create() {
return material;
}
-void RasterizerGLES2::material_set_shader(RID p_material, RID p_shader) {
+void RasterizerGLES2::material_set_shader(RID p_shader_material, RID p_shader) {
- Material *material = material_owner.get(p_material);
+ Material *material = material_owner.get(p_shader_material);
ERR_FAIL_COND(!material);
if (material->shader == p_shader)
return;
@@ -1609,9 +1610,9 @@ void RasterizerGLES2::material_set_shader(RID p_material, RID p_shader) {
material->shader_version = 0;
}
-RID RasterizerGLES2::material_get_shader(RID p_material) const {
+RID RasterizerGLES2::material_get_shader(RID p_shader_material) const {
- Material *material = material_owner.get(p_material);
+ Material *material = material_owner.get(p_shader_material);
ERR_FAIL_COND_V(!material, RID());
return material->shader;
}
@@ -3940,8 +3941,8 @@ void RasterizerGLES2::begin_frame() {
//fragment_lighting=Globals::get_singleton()->get("rasterizer/use_fragment_lighting");
#ifdef TOOLS_ENABLED
- canvas_shader.set_conditional(CanvasShaderGLES2::USE_PIXEL_SNAP, GLOBAL_DEF("display/use_2d_pixel_snap", false));
- shadow_filter = ShadowFilterTechnique(int(GlobalConfig::get_singleton()->get("rasterizer/shadow_filter")));
+ canvas_shader.set_conditional(CanvasShaderGLES2::USE_PIXEL_SNAP, GLOBAL_DEF("rendering/use_2d_pixel_snap", false));
+ shadow_filter = ShadowFilterTechnique(int(ProjectSettings::get_singleton()->get("rasterizer/shadow_filter")));
#endif
canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_PCF5, shadow_filter == SHADOW_FILTER_PCF5);
@@ -4198,7 +4199,7 @@ void RasterizerGLES2::set_camera(const Transform &p_world, const CameraMatrix &p
void RasterizerGLES2::add_light(RID p_light_instance) {
-#define LIGHT_FADE_TRESHOLD 0.05
+#define LIGHT_FADE_THRESHOLD 0.05
ERR_FAIL_COND(light_instance_count >= MAX_SCENE_LIGHTS);
@@ -6480,7 +6481,7 @@ void RasterizerGLES2::_process_glow_bloom() {
copy_shader.bind();
copy_shader.set_uniform(CopyShaderGLES2::BLOOM, float(current_env->fx_param[VS::ENV_FX_PARAM_GLOW_BLOOM]));
- copy_shader.set_uniform(CopyShaderGLES2::BLOOM_TRESHOLD, float(current_env->fx_param[VS::ENV_FX_PARAM_GLOW_BLOOM_TRESHOLD]));
+ copy_shader.set_uniform(CopyShaderGLES2::BLOOM_THRESHOLD, float(current_env->fx_param[VS::ENV_FX_PARAM_GLOW_BLOOM_THRESHOLD]));
glUniform1i(copy_shader.get_uniform_location(CopyShaderGLES2::SOURCE), 0);
if (current_vd && current_env->fx_enabled[VS::ENV_FX_HDR]) {
@@ -6490,7 +6491,7 @@ void RasterizerGLES2::_process_glow_bloom() {
copy_shader.set_uniform(CopyShaderGLES2::TONEMAP_EXPOSURE, float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_EXPOSURE]));
copy_shader.set_uniform(CopyShaderGLES2::TONEMAP_WHITE, float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_WHITE]));
//copy_shader.set_uniform(CopyShaderGLES2::TONEMAP_WHITE,1.0);
- copy_shader.set_uniform(CopyShaderGLES2::HDR_GLOW_TRESHOLD, float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_GLOW_TRESHOLD]));
+ copy_shader.set_uniform(CopyShaderGLES2::HDR_GLOW_THRESHOLD, float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_GLOW_THRESHOLD]));
copy_shader.set_uniform(CopyShaderGLES2::HDR_GLOW_SCALE, float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_GLOW_SCALE]));
glActiveTexture(GL_TEXTURE0);
@@ -6818,7 +6819,7 @@ void RasterizerGLES2::end_scene() {
if (current_env->bg_mode == VS::ENV_BG_COLOR)
bgcolor = current_env->bg_param[VS::ENV_BG_PARAM_COLOR];
else
- bgcolor = GlobalConfig::get_singleton()->get("render/default_clear_color");
+ bgcolor = ProjectSettings::get_singleton()->get("render/default_clear_color");
bgcolor = _convert_color(bgcolor);
float a = use_fb ? float(current_env->bg_param[VS::ENV_BG_PARAM_GLOW]) : 1.0;
glClearColor(bgcolor.r, bgcolor.g, bgcolor.b, a);
@@ -7890,7 +7891,7 @@ void RasterizerGLES2::canvas_draw_rect(const Rect2 &p_rect, int p_flags, const R
_rinfo.ci_draw_commands++;
}
-void RasterizerGLES2::canvas_draw_style_box(const Rect2 &p_rect, const Rect2 &p_src_region, RID p_texture, const float *p_margin, bool p_draw_center, const Color &p_modulate) {
+void RasterizerGLES2::canvas_draw_style_box(const Rect2 &p_rect, const Rect2 &p_src_region, RID p_texture, const float *p_margins, bool p_draw_center, const Color &p_modulate) {
Color m = p_modulate;
m.a *= canvas_opacity;
@@ -7906,47 +7907,47 @@ void RasterizerGLES2::canvas_draw_style_box(const Rect2 &p_rect, const Rect2 &p_
region.size.height = texture->height;
/* CORNERS */
_draw_textured_quad( // top left
- Rect2(p_rect.pos, Size2(p_margin[MARGIN_LEFT], p_margin[MARGIN_TOP])),
- Rect2(region.pos, Size2(p_margin[MARGIN_LEFT], p_margin[MARGIN_TOP])),
+ Rect2(p_rect.pos, Size2(p_margins[MARGIN_LEFT], p_margins[MARGIN_TOP])),
+ Rect2(region.pos, Size2(p_margins[MARGIN_LEFT], p_margins[MARGIN_TOP])),
Size2(texture->width, texture->height));
_draw_textured_quad( // top right
- Rect2(Point2(p_rect.pos.x + p_rect.size.width - p_margin[MARGIN_RIGHT], p_rect.pos.y), Size2(p_margin[MARGIN_RIGHT], p_margin[MARGIN_TOP])),
- Rect2(Point2(region.pos.x + region.size.width - p_margin[MARGIN_RIGHT], region.pos.y), Size2(p_margin[MARGIN_RIGHT], p_margin[MARGIN_TOP])),
+ Rect2(Point2(p_rect.pos.x + p_rect.size.width - p_margins[MARGIN_RIGHT], p_rect.pos.y), Size2(p_margins[MARGIN_RIGHT], p_margins[MARGIN_TOP])),
+ Rect2(Point2(region.pos.x + region.size.width - p_margins[MARGIN_RIGHT], region.pos.y), Size2(p_margins[MARGIN_RIGHT], p_margins[MARGIN_TOP])),
Size2(texture->width, texture->height));
_draw_textured_quad( // bottom left
- Rect2(Point2(p_rect.pos.x, p_rect.pos.y + p_rect.size.height - p_margin[MARGIN_BOTTOM]), Size2(p_margin[MARGIN_LEFT], p_margin[MARGIN_BOTTOM])),
- Rect2(Point2(region.pos.x, region.pos.y + region.size.height - p_margin[MARGIN_BOTTOM]), Size2(p_margin[MARGIN_LEFT], p_margin[MARGIN_BOTTOM])),
+ Rect2(Point2(p_rect.pos.x, p_rect.pos.y + p_rect.size.height - p_margins[MARGIN_BOTTOM]), Size2(p_margins[MARGIN_LEFT], p_margins[MARGIN_BOTTOM])),
+ Rect2(Point2(region.pos.x, region.pos.y + region.size.height - p_margins[MARGIN_BOTTOM]), Size2(p_margins[MARGIN_LEFT], p_margins[MARGIN_BOTTOM])),
Size2(texture->width, texture->height));
_draw_textured_quad( // bottom right
- Rect2(Point2(p_rect.pos.x + p_rect.size.width - p_margin[MARGIN_RIGHT], p_rect.pos.y + p_rect.size.height - p_margin[MARGIN_BOTTOM]), Size2(p_margin[MARGIN_RIGHT], p_margin[MARGIN_BOTTOM])),
- Rect2(Point2(region.pos.x + region.size.width - p_margin[MARGIN_RIGHT], region.pos.y + region.size.height - p_margin[MARGIN_BOTTOM]), Size2(p_margin[MARGIN_RIGHT], p_margin[MARGIN_BOTTOM])),
+ Rect2(Point2(p_rect.pos.x + p_rect.size.width - p_margins[MARGIN_RIGHT], p_rect.pos.y + p_rect.size.height - p_margins[MARGIN_BOTTOM]), Size2(p_margins[MARGIN_RIGHT], p_margins[MARGIN_BOTTOM])),
+ Rect2(Point2(region.pos.x + region.size.width - p_margins[MARGIN_RIGHT], region.pos.y + region.size.height - p_margins[MARGIN_BOTTOM]), Size2(p_margins[MARGIN_RIGHT], p_margins[MARGIN_BOTTOM])),
Size2(texture->width, texture->height));
- Rect2 rect_center(p_rect.pos + Point2(p_margin[MARGIN_LEFT], p_margin[MARGIN_TOP]), Size2(p_rect.size.width - p_margin[MARGIN_LEFT] - p_margin[MARGIN_RIGHT], p_rect.size.height - p_margin[MARGIN_TOP] - p_margin[MARGIN_BOTTOM]));
+ Rect2 rect_center(p_rect.pos + Point2(p_margins[MARGIN_LEFT], p_margins[MARGIN_TOP]), Size2(p_rect.size.width - p_margins[MARGIN_LEFT] - p_margins[MARGIN_RIGHT], p_rect.size.height - p_margins[MARGIN_TOP] - p_margins[MARGIN_BOTTOM]));
- Rect2 src_center(Point2(region.pos.x + p_margin[MARGIN_LEFT], region.pos.y + p_margin[MARGIN_TOP]), Size2(region.size.width - p_margin[MARGIN_LEFT] - p_margin[MARGIN_RIGHT], region.size.height - p_margin[MARGIN_TOP] - p_margin[MARGIN_BOTTOM]));
+ Rect2 src_center(Point2(region.pos.x + p_margins[MARGIN_LEFT], region.pos.y + p_margins[MARGIN_TOP]), Size2(region.size.width - p_margins[MARGIN_LEFT] - p_margins[MARGIN_RIGHT], region.size.height - p_margins[MARGIN_TOP] - p_margins[MARGIN_BOTTOM]));
_draw_textured_quad( // top
- Rect2(Point2(rect_center.pos.x, p_rect.pos.y), Size2(rect_center.size.width, p_margin[MARGIN_TOP])),
- Rect2(Point2(src_center.pos.x, region.pos.y), Size2(src_center.size.width, p_margin[MARGIN_TOP])),
+ Rect2(Point2(rect_center.pos.x, p_rect.pos.y), Size2(rect_center.size.width, p_margins[MARGIN_TOP])),
+ Rect2(Point2(src_center.pos.x, region.pos.y), Size2(src_center.size.width, p_margins[MARGIN_TOP])),
Size2(texture->width, texture->height));
_draw_textured_quad( // bottom
- Rect2(Point2(rect_center.pos.x, rect_center.pos.y + rect_center.size.height), Size2(rect_center.size.width, p_margin[MARGIN_BOTTOM])),
- Rect2(Point2(src_center.pos.x, src_center.pos.y + src_center.size.height), Size2(src_center.size.width, p_margin[MARGIN_BOTTOM])),
+ Rect2(Point2(rect_center.pos.x, rect_center.pos.y + rect_center.size.height), Size2(rect_center.size.width, p_margins[MARGIN_BOTTOM])),
+ Rect2(Point2(src_center.pos.x, src_center.pos.y + src_center.size.height), Size2(src_center.size.width, p_margins[MARGIN_BOTTOM])),
Size2(texture->width, texture->height));
_draw_textured_quad( // left
- Rect2(Point2(p_rect.pos.x, rect_center.pos.y), Size2(p_margin[MARGIN_LEFT], rect_center.size.height)),
- Rect2(Point2(region.pos.x, region.pos.y + p_margin[MARGIN_TOP]), Size2(p_margin[MARGIN_LEFT], src_center.size.height)),
+ Rect2(Point2(p_rect.pos.x, rect_center.pos.y), Size2(p_margins[MARGIN_LEFT], rect_center.size.height)),
+ Rect2(Point2(region.pos.x, region.pos.y + p_margins[MARGIN_TOP]), Size2(p_margins[MARGIN_LEFT], src_center.size.height)),
Size2(texture->width, texture->height));
_draw_textured_quad( // right
- Rect2(Point2(rect_center.pos.x + rect_center.size.width, rect_center.pos.y), Size2(p_margin[MARGIN_RIGHT], rect_center.size.height)),
- Rect2(Point2(src_center.pos.x + src_center.size.width, region.pos.y + p_margin[MARGIN_TOP]), Size2(p_margin[MARGIN_RIGHT], src_center.size.height)),
+ Rect2(Point2(rect_center.pos.x + rect_center.size.width, rect_center.pos.y), Size2(p_margins[MARGIN_RIGHT], rect_center.size.height)),
+ Rect2(Point2(src_center.pos.x + src_center.size.width, region.pos.y + p_margins[MARGIN_TOP]), Size2(p_margins[MARGIN_RIGHT], src_center.size.height)),
Size2(texture->width, texture->height));
if (p_draw_center) {
@@ -8699,17 +8700,17 @@ void RasterizerGLES2::_canvas_item_render_commands(CanvasItem *p_item, CanvasIte
}
}
-void RasterizerGLES2::_canvas_item_setup_shader_params(CanvasItemMaterial *material, Shader *shader) {
+void RasterizerGLES2::_canvas_item_setup_shader_params(ShaderMaterial *material, Shader *p_shader) {
if (canvas_shader.bind())
rebind_texpixel_size = true;
- if (material->shader_version != shader->version) {
+ if (material->shader_version != p_shader->version) {
//todo optimize uniforms
- material->shader_version = shader->version;
+ material->shader_version = p_shader->version;
}
- if (shader->has_texscreen && framebuffer.active) {
+ if (p_shader->has_texscreen && framebuffer.active) {
int x = viewport.x;
int y = window_size.height - (viewport.height + viewport.y);
@@ -8741,19 +8742,19 @@ void RasterizerGLES2::_canvas_item_setup_shader_params(CanvasItemMaterial *mater
glActiveTexture(GL_TEXTURE0);
}
- if (shader->has_screen_uv) {
+ if (p_shader->has_screen_uv) {
canvas_shader.set_uniform(CanvasShaderGLES2::SCREEN_UV_MULT, Vector2(1.0 / viewport.width, 1.0 / viewport.height));
}
- uses_texpixel_size = shader->uses_texpixel_size;
+ uses_texpixel_size = p_shader->uses_texpixel_size;
}
-void RasterizerGLES2::_canvas_item_setup_shader_uniforms(CanvasItemMaterial *material, Shader *shader) {
+void RasterizerGLES2::_canvas_item_setup_shader_uniforms(ShaderMaterial *material, Shader *p_shader) {
//this can be optimized..
int tex_id = 1;
int idx = 0;
- for (Map<StringName, ShaderLanguage::Uniform>::Element *E = shader->uniforms.front(); E; E = E->next()) {
+ for (Map<StringName, ShaderLanguage::Uniform>::Element *E = p_shader->uniforms.front(); E; E = E->next()) {
Map<StringName, Variant>::Element *F = material->shader_param.find(E->key());
@@ -8766,7 +8767,7 @@ void RasterizerGLES2::_canvas_item_setup_shader_uniforms(CanvasItemMaterial *mat
if (!rid.is_valid()) {
- Map<StringName, RID>::Element *DT = shader->default_textures.find(E->key());
+ Map<StringName, RID>::Element *DT = p_shader->default_textures.find(E->key());
if (DT) {
rid = DT->get();
}
@@ -8798,7 +8799,7 @@ void RasterizerGLES2::_canvas_item_setup_shader_uniforms(CanvasItemMaterial *mat
glActiveTexture(GL_TEXTURE0);
}
- if (shader->uses_time) {
+ if (p_shader->uses_time) {
canvas_shader.set_uniform(CanvasShaderGLES2::TIME, Math::fmod(last_time, shader_time_rollback));
draw_next_frame = true;
}
@@ -8925,7 +8926,7 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list, int p_z, cons
//begin rect
CanvasItem *material_owner = ci->material_owner ? ci->material_owner : ci;
- CanvasItemMaterial *material = material_owner->material;
+ ShaderMaterial *material = material_owner->material;
if (material != canvas_last_material || rebind_shader) {
@@ -10385,7 +10386,7 @@ void RasterizerGLES2::init() {
copy_shader.set_conditional(CopyShaderGLES2::USE_8BIT_HDR, !use_fp16_fb);
canvas_shader.set_conditional(CanvasShaderGLES2::USE_DEPTH_SHADOWS, read_depth_supported);
- canvas_shader.set_conditional(CanvasShaderGLES2::USE_PIXEL_SNAP, GLOBAL_DEF("display/use_2d_pixel_snap", false));
+ canvas_shader.set_conditional(CanvasShaderGLES2::USE_PIXEL_SNAP, GLOBAL_DEF("rendering/use_2d_pixel_snap", false));
npo2_textures_available = true;
//fragment_lighting=false;
@@ -10717,7 +10718,7 @@ RasterizerGLES2::RasterizerGLES2(bool p_compress_arrays, bool p_keep_ram_copy, b
fragment_lighting = GLOBAL_DEF("rasterizer/use_fragment_lighting", true);
read_depth_supported = true; //todo check for extension
shadow_filter = ShadowFilterTechnique((int)(GLOBAL_DEF("rasterizer/shadow_filter", SHADOW_FILTER_PCF5)));
- GlobalConfig::get_singleton()->set_custom_property_info("rasterizer/shadow_filter", PropertyInfo(Variant::INT, "rasterizer/shadow_filter", PROPERTY_HINT_ENUM, "None,PCF5,PCF13,ESM"));
+ ProjectSettings::get_singleton()->set_custom_property_info("rasterizer/shadow_filter", PropertyInfo(Variant::INT, "rasterizer/shadow_filter", PROPERTY_HINT_ENUM, "None,PCF5,PCF13,ESM"));
use_fp16_fb = bool(GLOBAL_DEF("rasterizer/fp16_framebuffer", true));
use_shadow_mapping = true;
use_fast_texture_filter = !bool(GLOBAL_DEF("rasterizer/trilinear_mipmap_filter", true));
diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h
index 9aeb3af61a..ca6a0fce26 100644
--- a/drivers/gles2/rasterizer_gles2.h
+++ b/drivers/gles2/rasterizer_gles2.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -688,14 +689,14 @@ class RasterizerGLES2 : public Rasterizer {
fx_param[VS::ENV_FX_PARAM_GLOW_BLUR_STRENGTH] = 1.0;
fx_param[VS::ENV_FX_PARAM_GLOW_BLUR_BLEND_MODE] = 0;
fx_param[VS::ENV_FX_PARAM_GLOW_BLOOM] = 0.0;
- fx_param[VS::ENV_FX_PARAM_GLOW_BLOOM_TRESHOLD] = 0.5;
+ fx_param[VS::ENV_FX_PARAM_GLOW_BLOOM_THRESHOLD] = 0.5;
fx_param[VS::ENV_FX_PARAM_DOF_BLUR_PASSES] = 1;
fx_param[VS::ENV_FX_PARAM_DOF_BLUR_BEGIN] = 100.0;
fx_param[VS::ENV_FX_PARAM_DOF_BLUR_RANGE] = 10.0;
fx_param[VS::ENV_FX_PARAM_HDR_TONEMAPPER] = VS::ENV_FX_HDR_TONE_MAPPER_LINEAR;
fx_param[VS::ENV_FX_PARAM_HDR_EXPOSURE] = 0.4;
fx_param[VS::ENV_FX_PARAM_HDR_WHITE] = 1.0;
- fx_param[VS::ENV_FX_PARAM_HDR_GLOW_TRESHOLD] = 0.95;
+ fx_param[VS::ENV_FX_PARAM_HDR_GLOW_THRESHOLD] = 0.95;
fx_param[VS::ENV_FX_PARAM_HDR_GLOW_SCALE] = 0.2;
fx_param[VS::ENV_FX_PARAM_HDR_MIN_LUMINANCE] = 0.4;
fx_param[VS::ENV_FX_PARAM_HDR_MAX_LUMINANCE] = 8.0;
@@ -1224,7 +1225,7 @@ class RasterizerGLES2 : public Rasterizer {
bool uses_texpixel_size;
bool rebind_texpixel_size;
Transform canvas_transform;
- CanvasItemMaterial *canvas_last_material;
+ ShaderMaterial *canvas_last_material;
bool canvas_texscreen_used;
Vector2 normal_flip;
_FORCE_INLINE_ void _canvas_normal_set_flip(const Vector2 &p_flip);
@@ -1288,8 +1289,8 @@ class RasterizerGLES2 : public Rasterizer {
template <bool use_normalmap>
_FORCE_INLINE_ void _canvas_item_render_commands(CanvasItem *p_item, CanvasItem *current_clip, bool &reclip);
- _FORCE_INLINE_ void _canvas_item_setup_shader_params(CanvasItemMaterial *material, Shader *p_shader);
- _FORCE_INLINE_ void _canvas_item_setup_shader_uniforms(CanvasItemMaterial *material, Shader *p_shader);
+ _FORCE_INLINE_ void _canvas_item_setup_shader_params(ShaderMaterial *material, Shader *p_shader);
+ _FORCE_INLINE_ void _canvas_item_setup_shader_uniforms(ShaderMaterial *material, Shader *p_shader);
public:
/* TEXTURE API */
@@ -1523,7 +1524,7 @@ public:
virtual void light_directional_set_shadow_param(RID p_light, VS::LightDirectionalShadowParam p_param, float p_value);
virtual float light_directional_get_shadow_param(RID p_light, VS::LightDirectionalShadowParam p_param) const;
- virtual AABB light_get_aabb(RID p_poly) const;
+ virtual AABB light_get_aabb(RID p_light) const;
virtual RID light_instance_create(RID p_light);
virtual void light_instance_set_transform(RID p_light_instance, const Transform &p_transform);
diff --git a/drivers/gles2/rasterizer_instance_gles2.cpp b/drivers/gles2/rasterizer_instance_gles2.cpp
index 47bf6d11ff..8aedd4def0 100644
--- a/drivers/gles2/rasterizer_instance_gles2.cpp
+++ b/drivers/gles2/rasterizer_instance_gles2.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/gles2/rasterizer_instance_gles2.h b/drivers/gles2/rasterizer_instance_gles2.h
index 329e4e2739..09e9716b50 100644
--- a/drivers/gles2/rasterizer_instance_gles2.h
+++ b/drivers/gles2/rasterizer_instance_gles2.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp
index 25decb37a2..778d28fb99 100644
--- a/drivers/gles2/shader_compiler_gles2.cpp
+++ b/drivers/gles2/shader_compiler_gles2.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/gles2/shader_compiler_gles2.h b/drivers/gles2/shader_compiler_gles2.h
index 2565adcd5d..02f9e58978 100644
--- a/drivers/gles2/shader_compiler_gles2.h
+++ b/drivers/gles2/shader_compiler_gles2.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/gles2/shader_gles2.cpp b/drivers/gles2/shader_gles2.cpp
index 08b9c21d5b..8764ae3895 100644
--- a/drivers/gles2/shader_gles2.cpp
+++ b/drivers/gles2/shader_gles2.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -102,11 +103,11 @@ void ShaderGLES2::bind_uniforms() {
uniforms_dirty = false;
};
-GLint ShaderGLES2::get_uniform_location(int p_idx) const {
+GLint ShaderGLES2::get_uniform_location(int p_index) const {
ERR_FAIL_COND_V(!version, -1);
- return version->uniform_location[p_idx];
+ return version->uniform_location[p_index];
};
bool ShaderGLES2::bind() {
diff --git a/drivers/gles2/shader_gles2.h b/drivers/gles2/shader_gles2.h
index a292fda7fe..32b979807d 100644
--- a/drivers/gles2/shader_gles2.h
+++ b/drivers/gles2/shader_gles2.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -280,7 +281,7 @@ public:
};
GLint get_uniform_location(const String &p_name) const;
- GLint get_uniform_location(int p_uniform) const;
+ GLint get_uniform_location(int p_index) const;
static _FORCE_INLINE_ ShaderGLES2 *get_active() { return active; };
bool bind();
@@ -292,9 +293,9 @@ public:
void clear_caches();
uint32_t create_custom_shader();
- void set_custom_shader_code(uint32_t p_id, const String &p_vertex, const String &p_vertex_globals, const String &p_fragment, const String &p_p_light, const String &p_fragment_globals, const Vector<StringName> &p_uniforms, const Vector<const char *> &p_custom_defines);
- void set_custom_shader(uint32_t p_id);
- void free_custom_shader(uint32_t p_id);
+ void set_custom_shader_code(uint32_t p_code_id, const String &p_vertex, const String &p_vertex_globals, const String &p_fragment, const String &p_light, const String &p_fragment_globals, const Vector<StringName> &p_uniforms, const Vector<const char *> &p_custom_defines);
+ void set_custom_shader(uint32_t p_code_id);
+ void free_custom_shader(uint32_t p_code_id);
void set_uniform_default(int p_idx, const Variant &p_value) {
diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl
index 4bcebbd69d..4b8c553b60 100644
--- a/drivers/gles2/shaders/canvas.glsl
+++ b/drivers/gles2/shaders/canvas.glsl
@@ -30,10 +30,8 @@ uniform highp mat4 light_local_matrix;
uniform vec2 light_pos;
varying vec4 light_uv_interp;
-#if defined(NORMAL_USED)
varying vec4 local_rot;
uniform vec2 normal_flip;
-#endif
#ifdef USE_SHADOWS
varying highp vec2 pos;
@@ -86,10 +84,8 @@ VERTEX_SHADER_CODE
pos=outvec.xy;
#endif
-#if defined(NORMAL_USED)
local_rot.xy=normalize( (modelview_matrix * ( extra_matrix * vec4(1.0,0.0,0.0,0.0) )).xy )*normal_flip.x;
local_rot.zw=normalize( (modelview_matrix * ( extra_matrix * vec4(0.0,1.0,0.0,0.0) )).xy )*normal_flip.y;
-#endif
#endif
@@ -107,6 +103,7 @@ precision mediump int;
uniform sampler2D texture; // texunit:0
+uniform sampler2D normal_texture; // texunit:0
varying vec2 uv_interp;
varying vec4 color_interp;
@@ -157,9 +154,7 @@ uniform float light_height;
varying vec4 light_uv_interp;
uniform float light_outside_alpha;
-#if defined(NORMAL_USED)
varying vec4 local_rot;
-#endif
#ifdef USE_SHADOWS
@@ -189,19 +184,19 @@ FRAGMENT_SHADER_GLOBALS
void main() {
vec4 color = color_interp;
-#if defined(NORMAL_USED)
- vec3 normal = vec3(0.0,0.0,1.0);
-#endif
#ifdef USE_DISTANCE_FIELD
const float smoothing = 1.0/32.0;
- float distance = texture2D(texture, uv_interp).a;
+ float distance = textureLod(texture, uv_interp,0.0).a;
color.a = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance) * color.a;
#else
color *= texture2D( texture, uv_interp );
#endif
+ vec3 normal;
+ normal.xy = textureLod( normal_texture, uv_interp, 0.0 ).xy * 2.0 - 1.0;
+ normal.z = sqrt(1.0-dot(normal.xy,normal.xy));
#if defined(ENABLE_SCREEN_UV)
vec2 screen_uv = gl_FragCoord.xy*screen_uv_mult;
@@ -236,9 +231,7 @@ FRAGMENT_SHADER_CODE
vec2 light_vec = light_uv_interp.zw;; //for shadow and normal mapping
-#if defined(NORMAL_USED)
normal.xy = mat2(local_rot.xy,local_rot.zw) * normal.xy;
-#endif
float att=1.0;
@@ -263,10 +256,8 @@ LIGHT_SHADER_CODE
#else
-#if defined(NORMAL_USED)
vec3 light_normal = normalize(vec3(light_vec,-light_height));
light*=max(dot(-light_normal,normal),0.0);
-#endif
color*=light;
/*
diff --git a/drivers/gles2/shaders/copy.glsl b/drivers/gles2/shaders/copy.glsl
index cb42970921..23680ffe91 100644
--- a/drivers/gles2/shaders/copy.glsl
+++ b/drivers/gles2/shaders/copy.glsl
@@ -16,6 +16,7 @@ attribute vec2 uv_in; // attrib:4
#endif
attribute vec2 uv2_in; // attrib:5
+
#ifdef USE_CUBEMAP
varying vec3 cube_interp;
#else
@@ -58,7 +59,9 @@ float sRGB_gamma_correct(float c){
#define LUM_RANGE 4.0
-#ifdef USE_CUBEMAP
+#ifdef USE_ARRAY
+uniform sampler2DArray source;
+#elif defined(USE_CUBEMAP)
varying vec3 cube_interp;
uniform samplerCube source_cube;
#else
@@ -84,7 +87,7 @@ uniform sampler2D glow_source;
#if defined(USE_HDR) && defined(USE_GLOW_COPY)
-uniform highp float hdr_glow_treshold;
+uniform highp float hdr_glow_threshold;
uniform highp float hdr_glow_scale;
#endif
@@ -104,7 +107,7 @@ uniform vec3 bcs;
#ifdef USE_GLOW_COPY
uniform float bloom;
-uniform float bloom_treshold;
+uniform float bloom_threshold;
#endif
@@ -145,23 +148,17 @@ uniform float custom_alpha;
void main() {
//vec4 color = color_interp;
-#ifdef USE_HIGHP_SOURCE
-#ifdef USE_CUBEMAP
+
+#ifdef USE_ARRAY
+ highp vec4 color = textureLod( source, vec3(uv_interp,0.0),0.0 );
+#elif defined(USE_CUBEMAP)
highp vec4 color = textureCube( source_cube, normalize(cube_interp) );
#else
highp vec4 color = texture2D( source, uv_interp );
#endif
-#else
-
-#ifdef USE_CUBEMAP
- vec4 color = textureCube( source_cube, normalize(cube_interp) );
-
-#else
- vec4 color = texture2D( source, uv_interp );
-#endif
#endif
@@ -377,11 +374,11 @@ void main() {
#ifdef USE_GLOW_COPY
- highp vec3 glowcol = color.rgb*color.a+step(bloom_treshold,dot(vec3(0.3333,0.3333,0.3333),color.rgb))*bloom*color.rgb;
+ highp vec3 glowcol = color.rgb*color.a+step(bloom_threshold,dot(vec3(0.3333,0.3333,0.3333),color.rgb))*bloom*color.rgb;
#ifdef USE_HDR
highp float collum = max(color.r,max(color.g,color.b));
- glowcol+=color.rgb*max(collum-hdr_glow_treshold,0.0)*hdr_glow_scale;
+ glowcol+=color.rgb*max(collum-hdr_glow_threshold,0.0)*hdr_glow_scale;
#endif
color.rgb=glowcol;
color.a=0.0;
@@ -503,7 +500,7 @@ void main() {
//lum_accum=exp(lum_accum);
-#ifdef USE_8BIT_HDR
+#ifdef USE_8BIT_HDR
highp float vd_lum = dot(texture2D( source_vd_lum, vec2(0.0) ), _multcv );
lum_accum = clamp( vd_lum + (lum_accum-vd_lum)*hdr_time_delta*hdr_exp_adj_speed,min_luminance*(1.0/LUM_RANGE),max_luminance*(1.0/LUM_RANGE));
@@ -558,4 +555,3 @@ void main() {
#endif
}
-
diff --git a/drivers/gles3/SCsub b/drivers/gles3/SCsub
index a17335b41b..2471dd3739 100644
--- a/drivers/gles3/SCsub
+++ b/drivers/gles3/SCsub
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
Import('env')
env.add_source_files(env.drivers_sources,"*.cpp")
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index 26d13bad89..e6ffa39197 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,9 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "rasterizer_canvas_gles3.h"
-
#include "os/os.h"
-
+#include "project_settings.h"
+#include "rasterizer_scene_gles3.h"
+#include "servers/visual/visual_server_raster.h"
#ifndef GLES_OVER_GL
#define glClearDepth glClearDepthf
#endif
@@ -112,7 +114,7 @@ void RasterizerCanvasGLES3::light_internal_update(RID p_rid, Light *p_light) {
li->ubo_data.light_pos[0] = p_light->light_shader_pos.x;
li->ubo_data.light_pos[1] = p_light->light_shader_pos.y;
- li->ubo_data.shadowpixel_size = 1.0 / p_light->shadow_buffer_size;
+ li->ubo_data.shadowpixel_size = (1.0 / p_light->shadow_buffer_size) * (1.0 + p_light->shadow_smooth);
li->ubo_data.light_outside_alpha = p_light->mode == VS::CANVAS_LIGHT_MODE_MASK ? 1.0 : 0.0;
li->ubo_data.light_height = p_light->height;
if (p_light->radius_cache == 0)
@@ -163,12 +165,18 @@ void RasterizerCanvasGLES3::canvas_begin() {
state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF5, false);
state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF13, false);
state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_DISTANCE_FIELD, false);
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_NINEPATCH, false);
state.canvas_shader.set_custom_shader(0);
state.canvas_shader.bind();
state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE, Color(1, 1, 1, 1));
state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX, Transform2D());
state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX, Transform2D());
+ if (storage->frame.current_rt) {
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SCREEN_PIXEL_SIZE, Vector2(1.0 / storage->frame.current_rt->width, 1.0 / storage->frame.current_rt->height));
+ } else {
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SCREEN_PIXEL_SIZE, Vector2(1.0, 1.0));
+ }
//state.canvas_shader.set_uniform(CanvasShaderGLES3::PROJECTION_MATRIX,state.vp);
//state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX,Transform());
@@ -177,6 +185,7 @@ void RasterizerCanvasGLES3::canvas_begin() {
glBindBufferBase(GL_UNIFORM_BUFFER, 0, state.canvas_item_ubo);
glBindVertexArray(data.canvas_quad_array);
state.using_texture_rect = true;
+ state.using_ninepatch = false;
}
void RasterizerCanvasGLES3::canvas_end() {
@@ -185,47 +194,82 @@ void RasterizerCanvasGLES3::canvas_end() {
glBindBufferBase(GL_UNIFORM_BUFFER, 0, 0);
state.using_texture_rect = false;
+ state.using_ninepatch = false;
}
-RasterizerStorageGLES3::Texture *RasterizerCanvasGLES3::_bind_canvas_texture(const RID &p_texture) {
+RasterizerStorageGLES3::Texture *RasterizerCanvasGLES3::_bind_canvas_texture(const RID &p_texture, const RID &p_normal_map) {
- if (p_texture == state.current_tex) {
- return state.current_tex_ptr;
- }
+ RasterizerStorageGLES3::Texture *tex_return = NULL;
- if (p_texture.is_valid()) {
+ if (p_texture == state.current_tex) {
+ tex_return = state.current_tex_ptr;
+ } else if (p_texture.is_valid()) {
RasterizerStorageGLES3::Texture *texture = storage->texture_owner.getornull(p_texture);
if (!texture) {
state.current_tex = RID();
state.current_tex_ptr = NULL;
+ glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, storage->resources.white_tex);
- return NULL;
- }
- if (texture->render_target)
- texture->render_target->used_in_frame = true;
+ } else {
- glBindTexture(GL_TEXTURE_2D, texture->tex_id);
- state.current_tex = p_texture;
- state.current_tex_ptr = texture;
+ if (texture->render_target)
+ texture->render_target->used_in_frame = true;
- return texture;
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, texture->tex_id);
+ state.current_tex = p_texture;
+ state.current_tex_ptr = texture;
+
+ tex_return = texture;
+ }
} else {
+ glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, storage->resources.white_tex);
state.current_tex = RID();
state.current_tex_ptr = NULL;
}
- return NULL;
+ if (p_normal_map == state.current_normal) {
+ //do none
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::USE_DEFAULT_NORMAL, state.current_normal.is_valid());
+
+ } else if (p_normal_map.is_valid()) {
+
+ RasterizerStorageGLES3::Texture *normal_map = storage->texture_owner.getornull(p_normal_map);
+
+ if (!normal_map) {
+ state.current_normal = RID();
+ glActiveTexture(GL_TEXTURE1);
+ glBindTexture(GL_TEXTURE_2D, storage->resources.normal_tex);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::USE_DEFAULT_NORMAL, false);
+
+ } else {
+
+ glActiveTexture(GL_TEXTURE1);
+ glBindTexture(GL_TEXTURE_2D, normal_map->tex_id);
+ state.current_normal = p_normal_map;
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::USE_DEFAULT_NORMAL, true);
+ }
+
+ } else {
+
+ state.current_normal = RID();
+ glActiveTexture(GL_TEXTURE1);
+ glBindTexture(GL_TEXTURE_2D, storage->resources.normal_tex);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::USE_DEFAULT_NORMAL, false);
+ }
+
+ return tex_return;
}
-void RasterizerCanvasGLES3::_set_texture_rect_mode(bool p_enable) {
+void RasterizerCanvasGLES3::_set_texture_rect_mode(bool p_enable, bool p_ninepatch) {
- if (state.using_texture_rect == p_enable)
+ if (state.using_texture_rect == p_enable && state.using_ninepatch == p_ninepatch)
return;
if (p_enable) {
@@ -237,122 +281,118 @@ void RasterizerCanvasGLES3::_set_texture_rect_mode(bool p_enable) {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_NINEPATCH, p_ninepatch && p_enable);
state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_TEXTURE_RECT, p_enable);
state.canvas_shader.bind();
state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE, state.canvas_item_modulate);
state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX, state.final_transform);
state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX, state.extra_matrix);
-
+ if (storage->frame.current_rt) {
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SCREEN_PIXEL_SIZE, Vector2(1.0 / storage->frame.current_rt->width, 1.0 / storage->frame.current_rt->height));
+ } else {
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SCREEN_PIXEL_SIZE, Vector2(1.0, 1.0));
+ }
state.using_texture_rect = p_enable;
+ state.using_ninepatch = p_ninepatch;
}
-void RasterizerCanvasGLES3::_draw_polygon(int p_vertex_count, const int *p_indices, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, const RID &p_texture, bool p_singlecolor) {
+void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_count, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor) {
+
+ glBindVertexArray(data.polygon_buffer_pointer_array);
+ glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
+
+ uint32_t buffer_ofs = 0;
+
+ //vertex
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_vertices);
+ glEnableVertexAttribArray(VS::ARRAY_VERTEX);
+ glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, false, sizeof(Vector2), ((uint8_t *)0) + buffer_ofs);
+ buffer_ofs += sizeof(Vector2) * p_vertex_count;
+ //color
- bool do_colors = false;
- Color m;
if (p_singlecolor) {
- m = *p_colors;
+ glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ Color m = *p_colors;
glVertexAttrib4f(VS::ARRAY_COLOR, m.r, m.g, m.b, m.a);
} else if (!p_colors) {
-
+ glDisableVertexAttribArray(VS::ARRAY_COLOR);
glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
- } else
- do_colors = true;
-
- RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(p_texture);
-
-#ifndef GLES_NO_CLIENT_ARRAYS
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, false, sizeof(Vector2), p_vertices);
- if (do_colors) {
+ } else {
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Color) * p_vertex_count, p_colors);
glEnableVertexAttribArray(VS::ARRAY_COLOR);
- glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, false, sizeof(Color), p_colors);
- } else {
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, false, sizeof(Color), ((uint8_t *)0) + buffer_ofs);
+ buffer_ofs += sizeof(Color) * p_vertex_count;
}
- if (texture && p_uvs) {
+ if (p_uvs) {
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_uvs);
glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
- glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, false, sizeof(Vector2), p_uvs);
+ glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, false, sizeof(Vector2), ((uint8_t *)0) + buffer_ofs);
+ buffer_ofs += sizeof(Vector2) * p_vertex_count;
+
} else {
glDisableVertexAttribArray(VS::ARRAY_TEX_UV);
}
- if (p_indices) {
- glDrawElements(GL_TRIANGLES, p_vertex_count, GL_UNSIGNED_INT, p_indices);
- } else {
- glDrawArrays(GL_TRIANGLES, 0, p_vertex_count);
- }
+ //bind the indices buffer.
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
+ glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(int) * p_index_count, p_indices);
-#else //WebGL specific impl.
- glBindBuffer(GL_ARRAY_BUFFER, gui_quad_buffer);
- float *b = GlobalVertexBuffer;
- int ofs = 0;
- if (p_vertex_count > MAX_POLYGON_VERTICES) {
- print_line("Too many vertices to render");
- return;
- }
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, false, sizeof(float) * 2, ((float *)0) + ofs);
- for (int i = 0; i < p_vertex_count; i++) {
- b[ofs++] = p_vertices[i].x;
- b[ofs++] = p_vertices[i].y;
- }
+ //draw the triangles.
+ glDrawElements(GL_TRIANGLES, p_index_count, GL_UNSIGNED_INT, 0);
- if (p_colors && do_colors) {
+ storage->frame.canvas_draw_commands++;
- glEnableVertexAttribArray(VS::ARRAY_COLOR);
- glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, false, sizeof(float) * 4, ((float *)0) + ofs);
- for (int i = 0; i < p_vertex_count; i++) {
- b[ofs++] = p_colors[i].r;
- b[ofs++] = p_colors[i].g;
- b[ofs++] = p_colors[i].b;
- b[ofs++] = p_colors[i].a;
- }
+ glBindVertexArray(0);
+}
- } else {
+void RasterizerCanvasGLES3::_draw_generic(GLuint p_primitive, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor) {
+
+ glBindVertexArray(data.polygon_buffer_pointer_array);
+ glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
+
+ uint32_t buffer_ofs = 0;
+
+ //vertex
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_vertices);
+ glEnableVertexAttribArray(VS::ARRAY_VERTEX);
+ glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, false, sizeof(Vector2), ((uint8_t *)0) + buffer_ofs);
+ buffer_ofs += sizeof(Vector2) * p_vertex_count;
+ //color
+
+ if (p_singlecolor) {
glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ Color m = *p_colors;
+ glVertexAttrib4f(VS::ARRAY_COLOR, m.r, m.g, m.b, m.a);
+ } else if (!p_colors) {
+ glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ } else {
+
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Color) * p_vertex_count, p_colors);
+ glEnableVertexAttribArray(VS::ARRAY_COLOR);
+ glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, false, sizeof(Color), ((uint8_t *)0) + buffer_ofs);
+ buffer_ofs += sizeof(Color) * p_vertex_count;
}
if (p_uvs) {
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_uvs);
glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
- glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, false, sizeof(float) * 2, ((float *)0) + ofs);
- for (int i = 0; i < p_vertex_count; i++) {
- b[ofs++] = p_uvs[i].x;
- b[ofs++] = p_uvs[i].y;
- }
+ glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, false, sizeof(Vector2), ((uint8_t *)0) + buffer_ofs);
+ buffer_ofs += sizeof(Vector2) * p_vertex_count;
} else {
glDisableVertexAttribArray(VS::ARRAY_TEX_UV);
}
- glBufferSubData(GL_ARRAY_BUFFER, 0, ofs * 4, &b[0]);
-
- //bind the indices buffer.
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indices_buffer);
-
- static const int _max_draw_poly_indices = 16 * 1024; // change this size if needed!!!
- ERR_FAIL_COND(p_vertex_count > _max_draw_poly_indices);
- static uint16_t _draw_poly_indices[_max_draw_poly_indices];
- for (int i = 0; i < p_vertex_count; i++) {
- _draw_poly_indices[i] = p_indices[i];
- //OS::get_singleton()->print("ind: %d ", p_indices[i]);
- };
-
- //copy the data to GPU.
- glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, p_vertex_count * sizeof(uint16_t), &_draw_poly_indices[0]);
-
- //draw the triangles.
- glDrawElements(GL_TRIANGLES, p_vertex_count, GL_UNSIGNED_SHORT, 0);
-
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
-#endif
+ glDrawArrays(p_primitive, 0, p_vertex_count);
storage->frame.canvas_draw_commands++;
+
+ glBindVertexArray(0);
}
void RasterizerCanvasGLES3::_draw_gui_primitive(int p_points, const Vector2 *p_vertices, const Color *p_colors, const Vector2 *p_uvs) {
@@ -403,9 +443,9 @@ void RasterizerCanvasGLES3::_draw_gui_primitive(int p_points, const Vector2 *p_v
}
}
- glBindBuffer(GL_ARRAY_BUFFER, data.primitive_quad_buffer);
+ glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
glBufferSubData(GL_ARRAY_BUFFER, 0, p_points * stride * 4, &b[0]);
- glBindVertexArray(data.primitive_quad_buffer_arrays[version]);
+ glBindVertexArray(data.polygon_buffer_quad_arrays[version]);
glDrawArrays(prim[p_points], 0, p_points);
glBindVertexArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
@@ -428,26 +468,87 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
Item::CommandLine *line = static_cast<Item::CommandLine *>(c);
_set_texture_rect_mode(false);
- _bind_canvas_texture(RID());
+ _bind_canvas_texture(RID(), RID());
glVertexAttrib4f(VS::ARRAY_COLOR, line->color.r, line->color.g, line->color.b, line->color.a);
- Vector2 verts[2] = {
- Vector2(line->from.x, line->from.y),
- Vector2(line->to.x, line->to.y)
- };
+ if (line->width <= 1) {
+ Vector2 verts[2] = {
+ Vector2(line->from.x, line->from.y),
+ Vector2(line->to.x, line->to.y)
+ };
#ifdef GLES_OVER_GL
- if (line->antialiased)
- glEnable(GL_LINE_SMOOTH);
+ if (line->antialiased)
+ glEnable(GL_LINE_SMOOTH);
+#endif
+ //glLineWidth(line->width);
+ _draw_gui_primitive(2, verts, NULL, NULL);
+
+#ifdef GLES_OVER_GL
+ if (line->antialiased)
+ glDisable(GL_LINE_SMOOTH);
+#endif
+ } else {
+ //thicker line
+
+ Vector2 t = (line->from - line->to).normalized().tangent() * line->width * 0.5;
+
+ Vector2 verts[4] = {
+ line->from - t,
+ line->from + t,
+ line->to + t,
+ line->to - t,
+ };
+
+ //glLineWidth(line->width);
+ _draw_gui_primitive(4, verts, NULL, NULL);
+#ifdef GLES_OVER_GL
+ if (line->antialiased) {
+ glEnable(GL_LINE_SMOOTH);
+ for (int i = 0; i < 4; i++) {
+ Vector2 vertsl[2] = {
+ verts[i],
+ verts[(i + 1) % 4],
+ };
+ _draw_gui_primitive(2, vertsl, NULL, NULL);
+ }
+ glDisable(GL_LINE_SMOOTH);
+ }
#endif
- //glLineWidth(line->width);
- _draw_gui_primitive(2, verts, NULL, NULL);
+ }
+
+ } break;
+ case Item::Command::TYPE_POLYLINE: {
+ Item::CommandPolyLine *pline = static_cast<Item::CommandPolyLine *>(c);
+ _set_texture_rect_mode(false);
+
+ _bind_canvas_texture(RID(), RID());
+
+ if (pline->triangles.size()) {
+
+ _draw_generic(GL_TRIANGLE_STRIP, pline->triangles.size(), pline->triangles.ptr(), NULL, pline->triangle_colors.ptr(), pline->triangle_colors.size() == 1);
#ifdef GLES_OVER_GL
- if (line->antialiased)
+ glEnable(GL_LINE_SMOOTH);
+ if (pline->lines.size()) {
+ _draw_generic(GL_LINE_LOOP, pline->lines.size(), pline->lines.ptr(), NULL, pline->line_colors.ptr(), pline->line_colors.size() == 1);
+ }
glDisable(GL_LINE_SMOOTH);
#endif
+ } else {
+
+#ifdef GLES_OVER_GL
+ if (pline->antialiased)
+ glEnable(GL_LINE_SMOOTH);
+#endif
+ _draw_generic(GL_LINE_STRIP, pline->lines.size(), pline->lines.ptr(), NULL, pline->line_colors.ptr(), pline->line_colors.size() == 1);
+
+#ifdef GLES_OVER_GL
+ if (pline->antialiased)
+ glDisable(GL_LINE_SMOOTH);
+#endif
+ }
} break;
case Item::Command::TYPE_RECT: {
@@ -459,7 +560,7 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
//set color
glVertexAttrib4f(VS::ARRAY_COLOR, rect->modulate.r, rect->modulate.g, rect->modulate.b, rect->modulate.a);
- RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(rect->texture);
+ RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(rect->texture, rect->normal_map);
if (texture) {
@@ -472,7 +573,7 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
}
Size2 texpixel_size(1.0 / texture->width, 1.0 / texture->height);
- Rect2 src_rect = (rect->flags & CANVAS_RECT_REGION) ? Rect2(rect->source.pos * texpixel_size, rect->source.size * texpixel_size) : Rect2(0, 0, 1, 1);
+ Rect2 src_rect = (rect->flags & CANVAS_RECT_REGION) ? Rect2(rect->source.position * texpixel_size, rect->source.size * texpixel_size) : Rect2(0, 0, 1, 1);
if (rect->flags & CANVAS_RECT_FLIP_H) {
src_rect.size.x *= -1;
@@ -488,8 +589,10 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE, texpixel_size);
- glVertexAttrib4f(1, rect->rect.pos.x, rect->rect.pos.y, rect->rect.size.x, rect->rect.size.y);
- glVertexAttrib4f(2, src_rect.pos.x, src_rect.pos.y, src_rect.size.x, src_rect.size.y);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::DST_RECT, Color(rect->rect.position.x, rect->rect.position.y, rect->rect.size.x, rect->rect.size.y));
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SRC_RECT, Color(src_rect.position.x, src_rect.position.y, src_rect.size.x, src_rect.size.y));
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::CLIP_RECT_UV, (rect->flags & CANVAS_RECT_CLIP_UV) ? true : false);
+
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
if (untile) {
@@ -499,8 +602,9 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
} else {
- glVertexAttrib4f(1, rect->rect.pos.x, rect->rect.pos.y, rect->rect.size.x, rect->rect.size.y);
- glVertexAttrib4f(2, 0, 0, 1, 1);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::DST_RECT, Color(rect->rect.position.x, rect->rect.position.y, rect->rect.size.x, rect->rect.size.y));
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SRC_RECT, Color(0, 0, 1, 1));
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::CLIP_RECT_UV, false);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
@@ -512,78 +616,41 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
Item::CommandNinePatch *np = static_cast<Item::CommandNinePatch *>(c);
- _set_texture_rect_mode(true);
+ _set_texture_rect_mode(true, true);
glVertexAttrib4f(VS::ARRAY_COLOR, np->color.r, np->color.g, np->color.b, np->color.a);
- RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(np->texture);
-
- if (!texture) {
-
- glVertexAttrib4f(1, np->rect.pos.x, np->rect.pos.y, np->rect.size.x, np->rect.size.y);
- glVertexAttrib4f(2, 0, 0, 1, 1);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- continue;
- }
+ RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(np->texture, np->normal_map);
- Size2 texpixel_size(1.0 / texture->width, 1.0 / texture->height);
-
- state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE, texpixel_size);
+ Size2 texpixel_size;
-#define DSTRECT(m_x, m_y, m_w, m_h) glVertexAttrib4f(1, m_x, m_y, m_w, m_h)
-#define SRCRECT(m_x, m_y, m_w, m_h) glVertexAttrib4f(2, (m_x)*texpixel_size.x, (m_y)*texpixel_size.y, (m_w)*texpixel_size.x, (m_h)*texpixel_size.y)
-
- //top left
- DSTRECT(np->rect.pos.x, np->rect.pos.y, np->margin[MARGIN_LEFT], np->margin[MARGIN_TOP]);
- SRCRECT(0, 0, np->margin[MARGIN_LEFT], np->margin[MARGIN_TOP]);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-
- //top right
- DSTRECT(np->rect.pos.x + np->rect.size.x - np->margin[MARGIN_RIGHT], np->rect.pos.y, np->margin[MARGIN_RIGHT], np->margin[MARGIN_TOP]);
- SRCRECT(texture->width - np->margin[MARGIN_RIGHT], 0, np->margin[MARGIN_RIGHT], np->margin[MARGIN_TOP]);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ if (!texture) {
- //bottom right
- DSTRECT(np->rect.pos.x + np->rect.size.x - np->margin[MARGIN_RIGHT], np->rect.pos.y + np->rect.size.y - np->margin[MARGIN_BOTTOM], np->margin[MARGIN_RIGHT], np->margin[MARGIN_BOTTOM]);
- SRCRECT(texture->width - np->margin[MARGIN_RIGHT], texture->height - np->margin[MARGIN_BOTTOM], np->margin[MARGIN_RIGHT], np->margin[MARGIN_BOTTOM]);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ texpixel_size = Size2(1, 1);
- //bottom left
- DSTRECT(np->rect.pos.x, np->rect.pos.y + np->rect.size.y - np->margin[MARGIN_BOTTOM], np->margin[MARGIN_LEFT], np->margin[MARGIN_BOTTOM]);
- SRCRECT(0, texture->height - np->margin[MARGIN_BOTTOM], np->margin[MARGIN_LEFT], np->margin[MARGIN_BOTTOM]);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SRC_RECT, Color(0, 0, 1, 1));
- //top
- DSTRECT(np->rect.pos.x + np->margin[MARGIN_LEFT], np->rect.pos.y, np->rect.size.width - np->margin[MARGIN_LEFT] - np->margin[MARGIN_RIGHT], np->margin[MARGIN_TOP]);
- SRCRECT(np->margin[MARGIN_LEFT], 0, texture->width - np->margin[MARGIN_LEFT] - np->margin[MARGIN_RIGHT], np->margin[MARGIN_TOP]);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ } else {
- //bottom
- DSTRECT(np->rect.pos.x + np->margin[MARGIN_LEFT], np->rect.pos.y + np->rect.size.y - np->margin[MARGIN_BOTTOM], np->rect.size.width - np->margin[MARGIN_LEFT] - np->margin[MARGIN_RIGHT], np->margin[MARGIN_TOP]);
- SRCRECT(np->margin[MARGIN_LEFT], texture->height - np->margin[MARGIN_BOTTOM], texture->width - np->margin[MARGIN_LEFT] - np->margin[MARGIN_LEFT], np->margin[MARGIN_TOP]);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ if (np->source != Rect2()) {
+ texpixel_size = Size2(1.0 / np->source.size.width, 1.0 / np->source.size.height);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SRC_RECT, Color(np->source.position.x / texture->width, np->source.position.y / texture->height, np->source.size.x / texture->width, np->source.size.y / texture->height));
+ } else {
+ texpixel_size = Size2(1.0 / texture->width, 1.0 / texture->height);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SRC_RECT, Color(0, 0, 1, 1));
+ }
+ }
- //left
- DSTRECT(np->rect.pos.x, np->rect.pos.y + np->margin[MARGIN_TOP], np->margin[MARGIN_LEFT], np->rect.size.height - np->margin[MARGIN_TOP] - np->margin[MARGIN_BOTTOM]);
- SRCRECT(0, np->margin[MARGIN_TOP], np->margin[MARGIN_LEFT], texture->height - np->margin[MARGIN_TOP] - np->margin[MARGIN_BOTTOM]);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE, texpixel_size);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::CLIP_RECT_UV, false);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::NP_REPEAT_H, int(np->axis_x));
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::NP_REPEAT_V, int(np->axis_y));
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::NP_DRAW_CENTER, np->draw_center);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::NP_MARGINS, Color(np->margin[MARGIN_LEFT], np->margin[MARGIN_TOP], np->margin[MARGIN_RIGHT], np->margin[MARGIN_BOTTOM]));
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::DST_RECT, Color(np->rect.position.x, np->rect.position.y, np->rect.size.x, np->rect.size.y));
- //right
- DSTRECT(np->rect.pos.x + np->rect.size.width - np->margin[MARGIN_RIGHT], np->rect.pos.y + np->margin[MARGIN_TOP], np->margin[MARGIN_RIGHT], np->rect.size.height - np->margin[MARGIN_TOP] - np->margin[MARGIN_BOTTOM]);
- SRCRECT(texture->width - np->margin[MARGIN_RIGHT], np->margin[MARGIN_TOP], np->margin[MARGIN_RIGHT], texture->height - np->margin[MARGIN_TOP] - np->margin[MARGIN_BOTTOM]);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- if (np->draw_center) {
-
- //center
- DSTRECT(np->rect.pos.x + np->margin[MARGIN_LEFT], np->rect.pos.y + np->margin[MARGIN_TOP], np->rect.size.x - np->margin[MARGIN_LEFT] - np->margin[MARGIN_RIGHT], np->rect.size.height - np->margin[MARGIN_TOP] - np->margin[MARGIN_BOTTOM]);
- SRCRECT(np->margin[MARGIN_LEFT], np->margin[MARGIN_TOP], texture->width - np->margin[MARGIN_LEFT] - np->margin[MARGIN_RIGHT], texture->height - np->margin[MARGIN_TOP] - np->margin[MARGIN_BOTTOM]);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- }
-
-#undef SRCRECT
-#undef DSTRECT
-
storage->frame.canvas_draw_commands++;
} break;
@@ -594,7 +661,7 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
ERR_CONTINUE(primitive->points.size() < 1);
- RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(primitive->texture);
+ RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(primitive->texture, primitive->normal_map);
if (texture) {
Size2 texpixel_size(1.0 / texture->width, 1.0 / texture->height);
@@ -617,13 +684,140 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
Item::CommandPolygon *polygon = static_cast<Item::CommandPolygon *>(c);
_set_texture_rect_mode(false);
- RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(polygon->texture);
+ RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(polygon->texture, polygon->normal_map);
if (texture) {
Size2 texpixel_size(1.0 / texture->width, 1.0 / texture->height);
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->indices.ptr(), polygon->count, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
+
+ } break;
+ case Item::Command::TYPE_PARTICLES: {
+
+ Item::CommandParticles *particles_cmd = static_cast<Item::CommandParticles *>(c);
+
+ RasterizerStorageGLES3::Particles *particles = storage->particles_owner.getornull(particles_cmd->particles);
+ if (!particles)
+ break;
+
+ glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1); //not used, so keep white
+
+ VisualServerRaster::redraw_request();
+
+ storage->particles_request_process(particles_cmd->particles);
+ //enable instancing
+
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_INSTANCE_CUSTOM, true);
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_PARTICLES, true);
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_INSTANCING, true);
+ //reset shader and force rebind
+ state.using_texture_rect = true;
+ _set_texture_rect_mode(false);
+
+ RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(particles_cmd->texture, particles_cmd->normal_map);
+
+ if (texture) {
+ Size2 texpixel_size(1.0 / (texture->width / particles_cmd->h_frames), 1.0 / (texture->height / particles_cmd->v_frames));
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE, texpixel_size);
+ } else {
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE, Vector2(1.0, 1.0));
+ }
+
+ if (!particles->use_local_coords) {
+
+ Transform2D inv_xf;
+ inv_xf.set_axis(0, Vector2(particles->emission_transform.basis.get_axis(0).x, particles->emission_transform.basis.get_axis(0).y));
+ inv_xf.set_axis(1, Vector2(particles->emission_transform.basis.get_axis(1).x, particles->emission_transform.basis.get_axis(1).y));
+ inv_xf.set_origin(Vector2(particles->emission_transform.get_origin().x, particles->emission_transform.get_origin().y));
+ inv_xf.affine_invert();
+
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX, state.final_transform * inv_xf);
+ }
+
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::H_FRAMES, particles_cmd->h_frames);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::V_FRAMES, particles_cmd->v_frames);
+
+ glBindVertexArray(data.particle_quad_array); //use particle quad array
+ glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffers[0]); //bind particle buffer
+
+ int stride = sizeof(float) * 4 * 6;
+
+ int amount = particles->amount;
+
+ if (particles->draw_order != VS::PARTICLES_DRAW_ORDER_LIFETIME) {
+
+ glEnableVertexAttribArray(8); //xform x
+ glVertexAttribPointer(8, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 3);
+ glVertexAttribDivisor(8, 1);
+ glEnableVertexAttribArray(9); //xform y
+ glVertexAttribPointer(9, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 4);
+ glVertexAttribDivisor(9, 1);
+ glEnableVertexAttribArray(10); //xform z
+ glVertexAttribPointer(10, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 5);
+ glVertexAttribDivisor(10, 1);
+ glEnableVertexAttribArray(11); //color
+ glVertexAttribPointer(11, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + 0);
+ glVertexAttribDivisor(11, 1);
+ glEnableVertexAttribArray(12); //custom
+ glVertexAttribPointer(12, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 2);
+ glVertexAttribDivisor(12, 1);
+
+ glDrawArraysInstanced(GL_TRIANGLE_FAN, 0, 4, amount);
+ } else {
+ //split
+
+ int stride = sizeof(float) * 4 * 6;
+ int split = int(Math::ceil(particles->phase * particles->amount));
+
+ if (amount - split > 0) {
+ glEnableVertexAttribArray(8); //xform x
+ glVertexAttribPointer(8, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + stride * split + sizeof(float) * 4 * 3);
+ glVertexAttribDivisor(8, 1);
+ glEnableVertexAttribArray(9); //xform y
+ glVertexAttribPointer(9, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + stride * split + sizeof(float) * 4 * 4);
+ glVertexAttribDivisor(9, 1);
+ glEnableVertexAttribArray(10); //xform z
+ glVertexAttribPointer(10, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + stride * split + sizeof(float) * 4 * 5);
+ glVertexAttribDivisor(10, 1);
+ glEnableVertexAttribArray(11); //color
+ glVertexAttribPointer(11, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + stride * split + 0);
+ glVertexAttribDivisor(11, 1);
+ glEnableVertexAttribArray(12); //custom
+ glVertexAttribPointer(12, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + stride * split + sizeof(float) * 4 * 2);
+ glVertexAttribDivisor(12, 1);
+
+ glDrawArraysInstanced(GL_TRIANGLE_FAN, 0, 4, amount - split);
+ }
+
+ if (split > 0) {
+ glEnableVertexAttribArray(8); //xform x
+ glVertexAttribPointer(8, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 3);
+ glVertexAttribDivisor(8, 1);
+ glEnableVertexAttribArray(9); //xform y
+ glVertexAttribPointer(9, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 4);
+ glVertexAttribDivisor(9, 1);
+ glEnableVertexAttribArray(10); //xform z
+ glVertexAttribPointer(10, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 5);
+ glVertexAttribDivisor(10, 1);
+ glEnableVertexAttribArray(11); //color
+ glVertexAttribPointer(11, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + 0);
+ glVertexAttribDivisor(11, 1);
+ glEnableVertexAttribArray(12); //custom
+ glVertexAttribPointer(12, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 2);
+ glVertexAttribDivisor(12, 1);
+
+ glDrawArraysInstanced(GL_TRIANGLE_FAN, 0, 4, split);
+ }
+ }
+
+ glBindVertexArray(0);
+
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_INSTANCE_CUSTOM, false);
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_INSTANCING, false);
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_PARTICLES, false);
+ state.using_texture_rect = true;
+ _set_texture_rect_mode(false);
} break;
case Item::Command::TYPE_CIRCLE: {
@@ -643,6 +837,10 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
indices[i * 3 + 1] = (i + 1) % numpoints;
indices[i * 3 + 2] = numpoints;
}
+
+ _bind_canvas_texture(RID(), RID());
+ _draw_polygon(indices, numpoints * 3, numpoints + 1, points, NULL, &circle->color, 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;
@@ -669,8 +867,8 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
//glScissor(viewport.x+current_clip->final_clip_rect.pos.x,viewport.y+ (viewport.height-(current_clip->final_clip_rect.pos.y+current_clip->final_clip_rect.size.height)),
//current_clip->final_clip_rect.size.width,current_clip->final_clip_rect.size.height);
- int x = current_clip->final_clip_rect.pos.x;
- int y = storage->frame.current_rt->height - (current_clip->final_clip_rect.pos.y + current_clip->final_clip_rect.size.y);
+ int x = current_clip->final_clip_rect.position.x;
+ int y = storage->frame.current_rt->height - (current_clip->final_clip_rect.position.y + current_clip->final_clip_rect.size.y);
int w = current_clip->final_clip_rect.size.x;
int h = current_clip->final_clip_rect.size.y;
@@ -687,7 +885,7 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
}
#if 0
-void RasterizerGLES2::_canvas_item_setup_shader_params(CanvasItemMaterial *material,Shader* shader) {
+void RasterizerGLES2::_canvas_item_setup_shader_params(ShaderMaterial *material,Shader* shader) {
if (canvas_shader.bind())
rebind_texpixel_size=true;
@@ -741,6 +939,84 @@ void RasterizerGLES2::_canvas_item_setup_shader_params(CanvasItemMaterial *mater
#endif
+void RasterizerCanvasGLES3::_copy_texscreen(const Rect2 &p_rect) {
+
+ glDisable(GL_BLEND);
+
+ state.canvas_texscreen_used = true;
+ //blur diffuse into effect mipmaps using separatable convolution
+ //storage->shaders.copy.set_conditional(CopyShaderGLES3::GAUSSIAN_HORIZONTAL,true);
+
+ Vector2 wh(storage->frame.current_rt->width, storage->frame.current_rt->height);
+
+ Color blur_section(p_rect.position.x / wh.x, p_rect.position.y / wh.y, p_rect.size.x / wh.x, p_rect.size.y / wh.y);
+
+ if (p_rect != Rect2()) {
+
+ scene_render->state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::USE_BLUR_SECTION, true);
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::USE_COPY_SECTION, true);
+ }
+
+ glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo);
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->color);
+
+ storage->shaders.copy.bind();
+ storage->shaders.copy.set_uniform(CopyShaderGLES3::COPY_SECTION, blur_section);
+
+ scene_render->_copy_screen();
+
+ for (int i = 0; i < storage->frame.current_rt->effects.mip_maps[1].sizes.size(); i++) {
+
+ int vp_w = storage->frame.current_rt->effects.mip_maps[1].sizes[i].width;
+ int vp_h = storage->frame.current_rt->effects.mip_maps[1].sizes[i].height;
+ glViewport(0, 0, vp_w, vp_h);
+ //horizontal pass
+ scene_render->state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_HORIZONTAL, true);
+ scene_render->state.effect_blur_shader.bind();
+ scene_render->state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE, Vector2(1.0 / vp_w, 1.0 / vp_h));
+ scene_render->state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD, float(i));
+ scene_render->state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::BLUR_SECTION, blur_section);
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color); //previous level, since mipmaps[0] starts one level bigger
+ glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[1].sizes[i].fbo);
+
+ scene_render->_copy_screen();
+
+ scene_render->state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_HORIZONTAL, false);
+
+ //vertical pass
+ scene_render->state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_VERTICAL, true);
+ scene_render->state.effect_blur_shader.bind();
+ scene_render->state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE, Vector2(1.0 / vp_w, 1.0 / vp_h));
+ scene_render->state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD, float(i));
+ scene_render->state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::BLUR_SECTION, blur_section);
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[1].color);
+ glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[i + 1].fbo); //next level, since mipmaps[0] starts one level bigger
+
+ scene_render->_copy_screen();
+
+ scene_render->state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_VERTICAL, false);
+ }
+
+ scene_render->state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::USE_BLUR_SECTION, false);
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::USE_COPY_SECTION, false);
+
+ glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->fbo); //back to front
+ glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height);
+
+ state.canvas_shader.bind(); //back to canvas
+ _bind_canvas_texture(state.current_tex, state.current_normal);
+
+ if (state.using_texture_rect) {
+ state.using_texture_rect = false;
+ _set_texture_rect_mode(state.using_texture_rect, state.using_ninepatch);
+ }
+
+ glEnable(GL_BLEND);
+}
+
void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, const Color &p_modulate, Light *p_light) {
Item *current_clip = NULL;
@@ -758,6 +1034,7 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
state.current_tex = RID();
state.current_tex_ptr = NULL;
+ state.current_normal = RID();
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, storage->resources.white_tex);
@@ -786,51 +1063,24 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
if (current_clip) {
glEnable(GL_SCISSOR_TEST);
- glScissor(current_clip->final_clip_rect.pos.x, (rt_size.height - (current_clip->final_clip_rect.pos.y + current_clip->final_clip_rect.size.height)), current_clip->final_clip_rect.size.width, current_clip->final_clip_rect.size.height);
+ glScissor(current_clip->final_clip_rect.position.x, (rt_size.height - (current_clip->final_clip_rect.position.y + current_clip->final_clip_rect.size.height)), current_clip->final_clip_rect.size.width, current_clip->final_clip_rect.size.height);
} else {
glDisable(GL_SCISSOR_TEST);
}
}
-#if 0
- if (ci->copy_back_buffer && framebuffer.active && framebuffer.scale==1) {
- Rect2 rect;
- int x,y;
+ if (ci->copy_back_buffer) {
if (ci->copy_back_buffer->full) {
- x = viewport.x;
- y = window_size.height-(viewport.height+viewport.y);
- } else {
- x = viewport.x+ci->copy_back_buffer->screen_rect.pos.x;
- y = window_size.height-(viewport.y+ci->copy_back_buffer->screen_rect.pos.y+ci->copy_back_buffer->screen_rect.size.y);
- }
- glActiveTexture(GL_TEXTURE0+max_texture_units-1);
- glBindTexture(GL_TEXTURE_2D,framebuffer.sample_color);
-
-#ifdef GLEW_ENABLED
- if (current_rt) {
- glReadBuffer(GL_COLOR_ATTACHMENT0);
+ _copy_texscreen(Rect2());
} else {
- glReadBuffer(GL_BACK);
+ _copy_texscreen(ci->copy_back_buffer->rect);
}
-#endif
- if (current_rt) {
- glCopyTexSubImage2D(GL_TEXTURE_2D,0,viewport.x,viewport.y,viewport.x,viewport.y,viewport.width,viewport.height);
- //window_size.height-(viewport.height+viewport.y)
- } else {
- glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height);
- }
-
- canvas_texscreen_used=true;
- glActiveTexture(GL_TEXTURE0);
-
}
-#endif
-
//begin rect
Item *material_owner = ci->material_owner ? ci->material_owner : ci;
@@ -852,6 +1102,11 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
if (shader_ptr && shader_ptr != shader_cache) {
+ if (shader_ptr->canvas_item.uses_screen_texture && !state.canvas_texscreen_used) {
+ //copy if not copied before
+ _copy_texscreen(Rect2());
+ }
+
state.canvas_shader.set_custom_shader(shader_ptr->custom_code_id);
state.canvas_shader.bind();
@@ -865,7 +1120,7 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
for (int i = 0; i < tc; i++) {
- glActiveTexture(GL_TEXTURE1 + i);
+ glActiveTexture(GL_TEXTURE2 + i);
RasterizerStorageGLES3::Texture *t = storage->texture_owner.getornull(textures[i]);
if (!t) {
@@ -964,7 +1219,11 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE, state.canvas_item_modulate);
state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX, state.final_transform);
state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX, state.extra_matrix);
-
+ if (storage->frame.current_rt) {
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SCREEN_PIXEL_SIZE, Vector2(1.0 / storage->frame.current_rt->width, 1.0 / storage->frame.current_rt->height));
+ } else {
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SCREEN_PIXEL_SIZE, Vector2(1.0, 1.0));
+ }
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);
@@ -1107,7 +1366,7 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
if (reclip) {
glEnable(GL_SCISSOR_TEST);
- glScissor(current_clip->final_clip_rect.pos.x, (rt_size.height - (current_clip->final_clip_rect.pos.y + current_clip->final_clip_rect.size.height)), current_clip->final_clip_rect.size.width, current_clip->final_clip_rect.size.height);
+ glScissor(current_clip->final_clip_rect.position.x, (rt_size.height - (current_clip->final_clip_rect.position.y + current_clip->final_clip_rect.size.height)), current_clip->final_clip_rect.size.width, current_clip->final_clip_rect.size.height);
}
p_item_list = p_item_list->next;
@@ -1164,7 +1423,6 @@ void RasterizerCanvasGLES3::canvas_light_shadow_buffer_update(RID p_buffer, cons
glBindFramebuffer(GL_FRAMEBUFFER, cls->fbo);
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
state.canvas_shadow_shader.bind();
glViewport(0, 0, cls->size, cls->height);
@@ -1263,18 +1521,14 @@ void RasterizerCanvasGLES3::canvas_light_shadow_buffer_update(RID p_buffer, cons
}
}
*/
- glBindBuffer(GL_ARRAY_BUFFER, cc->vertex_id);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cc->index_id);
- glVertexAttribPointer(VS::ARRAY_VERTEX, 3, GL_FLOAT, false, 0, 0);
+ glBindVertexArray(cc->array_id);
glDrawElements(GL_TRIANGLES, cc->len * 3, GL_UNSIGNED_SHORT, 0);
instance = instance->next;
}
}
- glDisableVertexAttribArray(VS::ARRAY_VERTEX);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+ glBindVertexArray(0);
}
void RasterizerCanvasGLES3::reset_canvas() {
@@ -1298,8 +1552,11 @@ void RasterizerCanvasGLES3::reset_canvas() {
//glLineWidth(1.0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
- glDisableVertexAttribArray(i);
+
+ //use for reading from screen
+ if (storage->frame.current_rt) {
+ glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 3);
+ glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color);
}
glActiveTexture(GL_TEXTURE0);
@@ -1326,9 +1583,7 @@ void RasterizerCanvasGLES3::reset_canvas() {
state.vp = canvas_transform;
store_transform(canvas_transform, state.canvas_item_ubo_data.projection_matrix);
- for (int i = 0; i < 4; i++) {
- state.canvas_item_ubo_data.time[i] = storage->frame.time[i];
- }
+ state.canvas_item_ubo_data.time = storage->frame.time[0];
glBindBuffer(GL_UNIFORM_BUFFER, state.canvas_item_ubo);
glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(CanvasItemUBO), &state.canvas_item_ubo_data);
@@ -1339,11 +1594,74 @@ void RasterizerCanvasGLES3::reset_canvas() {
void RasterizerCanvasGLES3::draw_generic_textured_rect(const Rect2 &p_rect, const Rect2 &p_src) {
- glVertexAttrib4f(1, p_rect.pos.x, p_rect.pos.y, p_rect.size.x, p_rect.size.y);
- glVertexAttrib4f(2, p_src.pos.x, p_src.pos.y, p_src.size.x, p_src.size.y);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::DST_RECT, Color(p_rect.position.x, p_rect.position.y, p_rect.size.x, p_rect.size.y));
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SRC_RECT, Color(p_src.position.x, p_src.position.y, p_src.size.x, p_src.size.y));
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::CLIP_RECT_UV, false);
+
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
+void RasterizerCanvasGLES3::draw_window_margins(int *black_margin, RID *black_image) {
+
+ Vector2 window_size = OS::get_singleton()->get_window_size();
+ int window_h = window_size.height;
+ int window_w = window_size.width;
+
+ glBindFramebuffer(GL_FRAMEBUFFER, storage->system_fbo);
+ glViewport(0, 0, window_size.width, window_size.height);
+ canvas_begin();
+
+ if (black_image[MARGIN_LEFT].is_valid()) {
+ _bind_canvas_texture(black_image[MARGIN_LEFT], RID());
+ Size2 sz(storage->texture_get_width(black_image[MARGIN_LEFT]), storage->texture_get_height(black_image[MARGIN_LEFT]));
+ draw_generic_textured_rect(Rect2(0, 0, black_margin[MARGIN_LEFT], window_h), Rect2(0, 0, sz.x, sz.y));
+ } else if (black_margin[MARGIN_LEFT]) {
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, storage->resources.black_tex);
+
+ draw_generic_textured_rect(Rect2(0, 0, black_margin[MARGIN_LEFT], window_h), Rect2(0, 0, 1, 1));
+ }
+
+ if (black_image[MARGIN_RIGHT].is_valid()) {
+ _bind_canvas_texture(black_image[MARGIN_RIGHT], RID());
+ Size2 sz(storage->texture_get_width(black_image[MARGIN_RIGHT]), storage->texture_get_height(black_image[MARGIN_RIGHT]));
+ draw_generic_textured_rect(Rect2(window_w - black_margin[MARGIN_RIGHT], 0, black_margin[MARGIN_RIGHT], window_h), Rect2(0, 0, sz.x, sz.y));
+ } else if (black_margin[MARGIN_RIGHT]) {
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, storage->resources.black_tex);
+
+ draw_generic_textured_rect(Rect2(window_w - black_margin[MARGIN_RIGHT], 0, black_margin[MARGIN_RIGHT], window_h), Rect2(0, 0, 1, 1));
+ }
+
+ if (black_image[MARGIN_TOP].is_valid()) {
+ _bind_canvas_texture(black_image[MARGIN_TOP], RID());
+
+ Size2 sz(storage->texture_get_width(black_image[MARGIN_TOP]), storage->texture_get_height(black_image[MARGIN_TOP]));
+ draw_generic_textured_rect(Rect2(0, 0, window_w, black_margin[MARGIN_TOP]), Rect2(0, 0, sz.x, sz.y));
+
+ } else if (black_margin[MARGIN_TOP]) {
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, storage->resources.black_tex);
+
+ draw_generic_textured_rect(Rect2(0, 0, window_w, black_margin[MARGIN_TOP]), Rect2(0, 0, 1, 1));
+ }
+
+ if (black_image[MARGIN_BOTTOM].is_valid()) {
+
+ _bind_canvas_texture(black_image[MARGIN_BOTTOM], RID());
+
+ Size2 sz(storage->texture_get_width(black_image[MARGIN_BOTTOM]), storage->texture_get_height(black_image[MARGIN_BOTTOM]));
+ draw_generic_textured_rect(Rect2(0, window_h - black_margin[MARGIN_BOTTOM], window_w, black_margin[MARGIN_BOTTOM]), Rect2(0, 0, sz.x, sz.y));
+
+ } else if (black_margin[MARGIN_BOTTOM]) {
+
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, storage->resources.black_tex);
+
+ draw_generic_textured_rect(Rect2(0, window_h - black_margin[MARGIN_BOTTOM], window_w, black_margin[MARGIN_BOTTOM]), Rect2(0, 0, 1, 1));
+ }
+}
+
void RasterizerCanvasGLES3::initialize() {
{
@@ -1372,18 +1690,54 @@ void RasterizerCanvasGLES3::initialize() {
glBindVertexArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind
}
+ {
+ //particle quad buffers
+ glGenBuffers(1, &data.particle_quad_vertices);
+ glBindBuffer(GL_ARRAY_BUFFER, data.particle_quad_vertices);
+ {
+ //quad of size 1, with pivot on the center for particles, then regular UVS. Color is general plus fetched from particle
+ const float qv[16] = {
+ -0.5, -0.5,
+ 0.0, 0.0,
+ -0.5, 0.5,
+ 0.0, 1.0,
+ 0.5, 0.5,
+ 1.0, 1.0,
+ 0.5, -0.5,
+ 1.0, 0.0
+ };
+
+ glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 16, qv, GL_STATIC_DRAW);
+ }
+
+ glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind
+
+ glGenVertexArrays(1, &data.particle_quad_array);
+ glBindVertexArray(data.particle_quad_array);
+ glBindBuffer(GL_ARRAY_BUFFER, data.particle_quad_vertices);
+ glEnableVertexAttribArray(VS::ARRAY_VERTEX);
+ glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, 0);
+ glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, (float *)0 + 2);
+ glBindVertexArray(0);
+ glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind
+ }
{
- glGenBuffers(1, &data.primitive_quad_buffer);
- glBindBuffer(GL_ARRAY_BUFFER, data.primitive_quad_buffer);
- glBufferData(GL_ARRAY_BUFFER, (2 + 2 + 4) * 4 * sizeof(float), NULL, GL_DYNAMIC_DRAW); //allocate max size
+ uint32_t poly_size = GLOBAL_DEF("rendering/limits/buffers/canvas_polygon_buffer_size_kb", 128);
+ poly_size *= 1024; //kb
+ poly_size = MAX(poly_size, (2 + 2 + 4) * 4 * sizeof(float));
+ glGenBuffers(1, &data.polygon_buffer);
+ glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
+ glBufferData(GL_ARRAY_BUFFER, poly_size, NULL, GL_DYNAMIC_DRAW); //allocate max size
glBindBuffer(GL_ARRAY_BUFFER, 0);
+ //quad arrays
for (int i = 0; i < 4; i++) {
- glGenVertexArrays(1, &data.primitive_quad_buffer_arrays[i]);
- glBindVertexArray(data.primitive_quad_buffer_arrays[i]);
- glBindBuffer(GL_ARRAY_BUFFER, data.primitive_quad_buffer);
+ glGenVertexArrays(1, &data.polygon_buffer_quad_arrays[i]);
+ glBindVertexArray(data.polygon_buffer_quad_arrays[i]);
+ glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
int uv_ofs = 0;
int color_ofs = 0;
@@ -1414,6 +1768,15 @@ void RasterizerCanvasGLES3::initialize() {
glBindVertexArray(0);
}
+
+ glGenVertexArrays(1, &data.polygon_buffer_pointer_array);
+
+ uint32_t index_size = GLOBAL_DEF("rendering/limits/buffers/canvas_polygon_index_buffer_size_kb", 128);
+ index_size *= 1024; //kb
+ glGenBuffers(1, &data.polygon_index_buffer);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, index_size, NULL, GL_DYNAMIC_DRAW); //allocate max size
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
store_transform(Transform(), state.canvas_item_ubo_data.projection_matrix);
@@ -1424,7 +1787,7 @@ void RasterizerCanvasGLES3::initialize() {
glBindBuffer(GL_UNIFORM_BUFFER, 0);
state.canvas_shader.init();
- state.canvas_shader.set_base_material_tex_index(1);
+ state.canvas_shader.set_base_material_tex_index(2);
state.canvas_shadow_shader.init();
state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_RGBA_SHADOWS, storage->config.use_rgba_2d_shadows);
@@ -1435,6 +1798,11 @@ void RasterizerCanvasGLES3::finalize() {
glDeleteBuffers(1, &data.canvas_quad_vertices);
glDeleteVertexArrays(1, &data.canvas_quad_array);
+
+ glDeleteBuffers(1, &data.canvas_quad_vertices);
+ glDeleteVertexArrays(1, &data.canvas_quad_array);
+
+ glDeleteVertexArrays(1, &data.polygon_buffer_pointer_array);
}
RasterizerCanvasGLES3::RasterizerCanvasGLES3() {
diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h
index c90dcc7d65..29f889cc88 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.h
+++ b/drivers/gles3/rasterizer_canvas_gles3.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,23 +32,35 @@
#include "rasterizer_storage_gles3.h"
#include "servers/visual/rasterizer.h"
-#include "shaders/canvas_shadow.glsl.h"
+#include "shaders/canvas_shadow.glsl.gen.h"
+
+class RasterizerSceneGLES3;
class RasterizerCanvasGLES3 : public RasterizerCanvas {
public:
struct CanvasItemUBO {
float projection_matrix[16];
- float time[4];
+ float time;
+ uint8_t padding[12];
};
+ RasterizerSceneGLES3 *scene_render;
+
struct Data {
GLuint canvas_quad_vertices;
GLuint canvas_quad_array;
- GLuint primitive_quad_buffer;
- GLuint primitive_quad_buffer_arrays[4];
+ GLuint polygon_buffer;
+ GLuint polygon_buffer_quad_arrays[4];
+ GLuint polygon_buffer_pointer_array;
+ GLuint polygon_index_buffer;
+
+ GLuint particle_quad_vertices;
+ GLuint particle_quad_array;
+
+ uint32_t polygon_buffer_size;
} data;
@@ -59,8 +72,10 @@ public:
CanvasShadowShaderGLES3 canvas_shadow_shader;
bool using_texture_rect;
+ bool using_ninepatch;
RID current_tex;
+ RID current_normal;
RasterizerStorageGLES3::Texture *current_tex_ptr;
Transform vp;
@@ -88,6 +103,7 @@ public:
float light_height;
float light_outside_alpha;
float shadow_distance_mult;
+ uint8_t padding[4];
} ubo_data;
GLuint ubo;
@@ -102,12 +118,15 @@ public:
virtual void canvas_begin();
virtual void canvas_end();
- _FORCE_INLINE_ void _set_texture_rect_mode(bool p_enable);
- _FORCE_INLINE_ RasterizerStorageGLES3::Texture *_bind_canvas_texture(const RID &p_texture);
+ _FORCE_INLINE_ void _set_texture_rect_mode(bool p_enable, bool p_ninepatch = false);
+ _FORCE_INLINE_ RasterizerStorageGLES3::Texture *_bind_canvas_texture(const RID &p_texture, const RID &p_normal_map);
_FORCE_INLINE_ void _draw_gui_primitive(int p_points, const Vector2 *p_vertices, const Color *p_colors, const Vector2 *p_uvs);
- _FORCE_INLINE_ void _draw_polygon(int p_vertex_count, const int *p_indices, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, const RID &p_texture, bool p_singlecolor);
+ _FORCE_INLINE_ void _draw_polygon(const int *p_indices, int p_index_count, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor);
+ _FORCE_INLINE_ void _draw_generic(GLuint p_primitive, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor);
+
_FORCE_INLINE_ void _canvas_item_render_commands(Item *p_item, Item *current_clip, bool &reclip);
+ _FORCE_INLINE_ void _copy_texscreen(const Rect2 &p_rect);
virtual void canvas_render_items(Item *p_item_list, int p_z, const Color &p_modulate, Light *p_light);
virtual void canvas_debug_viewport_shadows(Light *p_lights_with_shadow);
@@ -121,6 +140,8 @@ public:
void initialize();
void finalize();
+ virtual void draw_window_margins(int *black_margin, RID *black_image);
+
RasterizerCanvasGLES3();
};
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index b6cb57d68a..e025992c0b 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,8 +30,8 @@
#include "rasterizer_gles3.h"
#include "gl_context/context_gl.h"
-#include "global_config.h"
#include "os/os.h"
+#include "project_settings.h"
#include <string.h>
RasterizerStorage *RasterizerGLES3::get_storage() {
@@ -71,7 +72,7 @@ RasterizerScene *RasterizerGLES3::get_scene() {
#define _EXT_DEBUG_SEVERITY_LOW_ARB 0x9148
#define _EXT_DEBUG_OUTPUT 0x92E0
-#ifdef WINDOWS_ENABLED
+#if (defined WINDOWS_ENABLED) && !(defined UWP_ENABLED)
#define GLAPIENTRY APIENTRY
#else
#define GLAPIENTRY
@@ -82,7 +83,6 @@ static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GL
if (type == _EXT_DEBUG_TYPE_OTHER_ARB)
return;
- print_line("mesege");
char debSource[256], debType[256], debSev[256];
if (source == _EXT_DEBUG_SOURCE_API_ARB)
strcpy(debSource, "OpenGL");
@@ -185,6 +185,9 @@ void RasterizerGLES3::initialize() {
GL_DEBUG_SEVERITY_HIGH_ARB,5, "hello");
*/
+
+ const GLubyte *renderer = glGetString(GL_RENDERER);
+ print_line("OpenGL ES 3.0 Renderer: " + String((const char *)renderer));
storage->initialize();
canvas->initialize();
scene->initialize();
@@ -194,28 +197,35 @@ void RasterizerGLES3::begin_frame() {
uint64_t tick = OS::get_singleton()->get_ticks_usec();
- double time_total = double(tick) / 1000000.0;
+ double delta = double(tick - prev_ticks) / 1000000.0;
+ delta *= Engine::get_singleton()->get_time_scale();
+
+ time_total += delta;
+
+ if (delta == 0) {
+ //to avoid hiccups
+ delta = 0.001;
+ }
+
+ prev_ticks = tick;
+
+ double time_roll_over = GLOBAL_GET("rendering/limits/time/time_rollover_secs");
+ if (time_total > time_roll_over)
+ time_total = 0; //roll over every day (should be customz
storage->frame.time[0] = time_total;
storage->frame.time[1] = Math::fmod(time_total, 3600);
storage->frame.time[2] = Math::fmod(time_total, 900);
storage->frame.time[3] = Math::fmod(time_total, 60);
storage->frame.count++;
- storage->frame.delta = double(tick - storage->frame.prev_tick) / 1000000.0;
- if (storage->frame.prev_tick == 0) {
- //to avoid hiccups
- storage->frame.delta = 0.001;
- }
+ storage->frame.delta = delta;
storage->frame.prev_tick = tick;
storage->update_dirty_resources();
- storage->info.render_object_count = 0;
- storage->info.render_material_switch_count = 0;
- storage->info.render_surface_switch_count = 0;
- storage->info.render_shader_rebind_count = 0;
- storage->info.render_vertices_count = 0;
+ storage->info.render_final = storage->info.render;
+ storage->info.render.reset();
scene->iteration();
}
@@ -270,6 +280,62 @@ void RasterizerGLES3::clear_render_target(const Color &p_color) {
storage->frame.clear_request_color = p_color;
}
+void RasterizerGLES3::set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale) {
+
+ if (p_image.is_null() || p_image->empty())
+ return;
+
+ begin_frame();
+
+ int window_w = OS::get_singleton()->get_video_mode(0).width;
+ int window_h = OS::get_singleton()->get_video_mode(0).height;
+
+ glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
+ glViewport(0, 0, window_w, window_h);
+ glDisable(GL_BLEND);
+ glDepthMask(GL_FALSE);
+ glClearColor(p_color.r, p_color.g, p_color.b, 1.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ canvas->canvas_begin();
+
+ RID texture = storage->texture_create();
+ storage->texture_allocate(texture, p_image->get_width(), p_image->get_height(), p_image->get_format(), VS::TEXTURE_FLAG_FILTER);
+ storage->texture_set_data(texture, p_image);
+
+ Rect2 imgrect(0, 0, p_image->get_width(), p_image->get_height());
+ Rect2 screenrect;
+ if (p_scale) {
+
+ if (window_w > window_h) {
+ //scale horizontally
+ screenrect.size.y = window_h;
+ screenrect.size.x = imgrect.size.x * window_h / imgrect.size.y;
+ screenrect.position.x = (window_w - screenrect.size.x) / 2;
+
+ } else {
+ //scale vertically
+ screenrect.size.x = window_w;
+ screenrect.size.y = imgrect.size.y * window_w / imgrect.size.x;
+ screenrect.position.y = (window_h - screenrect.size.y) / 2;
+ }
+ } else {
+
+ screenrect = imgrect;
+ screenrect.position += ((Size2(window_w, window_h) - screenrect.size) / 2.0).floor();
+ }
+
+ RasterizerStorageGLES3::Texture *t = storage->texture_owner.get(texture);
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, t->tex_id);
+ canvas->draw_generic_textured_rect(screenrect, Rect2(0, 0, 1, 1));
+ glBindTexture(GL_TEXTURE_2D, 0);
+ canvas->canvas_end();
+
+ storage->free(texture); // free since it's only one frame that stays there
+
+ OS::get_singleton()->swap_buffers();
+}
+
void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target, const Rect2 &p_screen_rect, int p_screen) {
ERR_FAIL_COND(storage->frame.current_rt);
@@ -282,6 +348,10 @@ void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target, const Re
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, rt->color);
+ //glBindTexture(GL_TEXTURE_2D, rt->effects.mip_maps[0].color);
+ glActiveTexture(GL_TEXTURE1);
+ glBindTexture(GL_TEXTURE_2D, storage->resources.normal_tex);
+
canvas->draw_generic_textured_rect(p_screen_rect, Rect2(0, 0, 1, -1));
glBindTexture(GL_TEXTURE_2D, 0);
canvas->canvas_end();
@@ -346,10 +416,9 @@ void RasterizerGLES3::make_current() {
void RasterizerGLES3::register_config() {
- GLOBAL_DEF("rendering/gles3/render_architecture", 0);
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/gles3/render_architecture", PropertyInfo(Variant::INT, "", PROPERTY_HINT_ENUM, "Desktop,Mobile"));
- GLOBAL_DEF("rendering/quality/use_nearest_mipmap_filter", false);
- GLOBAL_DEF("rendering/quality/anisotropic_filter_level", 4.0);
+ GLOBAL_DEF("rendering/quality/filters/use_nearest_mipmap_filter", false);
+ GLOBAL_DEF("rendering/quality/filters/anisotropic_filter_level", 4.0);
+ GLOBAL_DEF("rendering/limits/time/time_rollover_secs", 3600);
}
RasterizerGLES3::RasterizerGLES3() {
@@ -358,9 +427,13 @@ RasterizerGLES3::RasterizerGLES3() {
canvas = memnew(RasterizerCanvasGLES3);
scene = memnew(RasterizerSceneGLES3);
canvas->storage = storage;
+ canvas->scene_render = scene;
storage->canvas = canvas;
scene->storage = storage;
storage->scene = scene;
+
+ prev_ticks = 0;
+ time_total = 0;
}
RasterizerGLES3::~RasterizerGLES3() {
diff --git a/drivers/gles3/rasterizer_gles3.h b/drivers/gles3/rasterizer_gles3.h
index 823f39ae8f..4bc267ec7e 100644
--- a/drivers/gles3/rasterizer_gles3.h
+++ b/drivers/gles3/rasterizer_gles3.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -42,11 +43,16 @@ class RasterizerGLES3 : public Rasterizer {
RasterizerCanvasGLES3 *canvas;
RasterizerSceneGLES3 *scene;
+ uint64_t prev_ticks;
+ double time_total;
+
public:
virtual RasterizerStorage *get_storage();
virtual RasterizerCanvas *get_canvas();
virtual RasterizerScene *get_scene();
+ virtual void set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale);
+
virtual void initialize();
virtual void begin_frame();
virtual void set_current_render_target(RID p_render_target);
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index d3936801dd..30c0d65ff3 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "rasterizer_scene_gles3.h"
-#include "global_config.h"
#include "os/os.h"
+#include "project_settings.h"
#include "rasterizer_canvas_gles3.h"
#ifndef GLES_OVER_GL
@@ -124,14 +125,13 @@ void RasterizerSceneGLES3::shadow_atlas_set_size(RID p_atlas, int p_size) {
if (p_size == shadow_atlas->size)
return;
+ // erasing atlas
if (shadow_atlas->fbo) {
glDeleteTextures(1, &shadow_atlas->depth);
glDeleteFramebuffers(1, &shadow_atlas->fbo);
shadow_atlas->depth = 0;
shadow_atlas->fbo = 0;
-
- print_line("erasing atlas");
}
for (int i = 0; i < 4; i++) {
//clear subdivisions
@@ -521,13 +521,7 @@ void RasterizerSceneGLES3::reflection_atlas_set_size(RID p_ref_atlas, int p_size
glBindTexture(GL_TEXTURE_2D, reflection_atlas->color);
int mmsize = reflection_atlas->size;
-
- for (int i = 0; i < 6; i++) {
- glTexImage2D(GL_TEXTURE_2D, i, internal_format, mmsize, mmsize, 0,
- format, type, NULL);
-
- mmsize >>= 1;
- }
+ glTexStorage2DCustom(GL_TEXTURE_2D, 6, internal_format, mmsize, mmsize, format, type);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -537,8 +531,6 @@ void RasterizerSceneGLES3::reflection_atlas_set_size(RID p_ref_atlas, int p_size
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5);
- mmsize = reflection_atlas->size;
-
for (int i = 0; i < 6; i++) {
glGenFramebuffers(1, &reflection_atlas->fbo[i]);
glBindFramebuffer(GL_FRAMEBUFFER, reflection_atlas->fbo[i]);
@@ -761,7 +753,7 @@ bool RasterizerSceneGLES3::reflection_probe_instance_postprocess_step(RID p_inst
storage->shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::LOW_QUALITY, rpi->probe_ptr->update_mode == VS::REFLECTION_PROBE_UPDATE_ALWAYS);
for (int i = 0; i < 2; i++) {
- storage->shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::Z_FLIP, i > 0);
+ storage->shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::Z_FLIP, i == 0);
storage->shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::ROUGHNESS, rpi->render_step / 5.0);
uint32_t local_width = width, local_height = height;
@@ -798,20 +790,20 @@ void RasterizerSceneGLES3::environment_set_background(RID p_env, VS::Environment
env->bg_mode = p_bg;
}
-void RasterizerSceneGLES3::environment_set_skybox(RID p_env, RID p_skybox) {
+void RasterizerSceneGLES3::environment_set_sky(RID p_env, RID p_sky) {
Environment *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
- env->skybox = p_skybox;
+ env->sky = p_sky;
}
-void RasterizerSceneGLES3::environment_set_skybox_scale(RID p_env, float p_scale) {
+void RasterizerSceneGLES3::environment_set_sky_scale(RID p_env, float p_scale) {
Environment *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
- env->skybox_scale = p_scale;
+ env->sky_scale = p_scale;
}
void RasterizerSceneGLES3::environment_set_bg_color(RID p_env, const Color &p_color) {
@@ -836,14 +828,14 @@ void RasterizerSceneGLES3::environment_set_canvas_max_layer(RID p_env, int p_max
env->canvas_max_layer = p_max_layer;
}
-void RasterizerSceneGLES3::environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy, float p_skybox_contribution) {
+void RasterizerSceneGLES3::environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy, float p_sky_contribution) {
Environment *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->ambient_color = p_color;
env->ambient_energy = p_energy;
- env->ambient_skybox_contribution = p_skybox_contribution;
+ env->ambient_sky_contribution = p_sky_contribution;
}
void RasterizerSceneGLES3::environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, VS::EnvironmentDOFBlurQuality p_quality) {
@@ -869,7 +861,7 @@ void RasterizerSceneGLES3::environment_set_dof_blur_near(RID p_env, bool p_enabl
env->dof_blur_near_amount = p_amount;
env->dof_blur_near_quality = p_quality;
}
-void RasterizerSceneGLES3::environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_treshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_treshold, float p_hdr_bleed_scale, bool p_bicubic_upscale) {
+void RasterizerSceneGLES3::environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, bool p_bicubic_upscale) {
Environment *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
@@ -878,26 +870,25 @@ void RasterizerSceneGLES3::environment_set_glow(RID p_env, bool p_enable, int p_
env->glow_levels = p_level_flags;
env->glow_intensity = p_intensity;
env->glow_strength = p_strength;
- env->glow_bloom = p_bloom_treshold;
+ env->glow_bloom = p_bloom_threshold;
env->glow_blend_mode = p_blend_mode;
- env->glow_hdr_bleed_treshold = p_hdr_bleed_treshold;
+ env->glow_hdr_bleed_threshold = p_hdr_bleed_threshold;
env->glow_hdr_bleed_scale = p_hdr_bleed_scale;
env->glow_bicubic_upscale = p_bicubic_upscale;
}
void RasterizerSceneGLES3::environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture) {
}
-void RasterizerSceneGLES3::environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_accel, float p_fade, float p_depth_tolerance, bool p_smooth, bool p_roughness) {
+void RasterizerSceneGLES3::environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_in, float p_fade_out, float p_depth_tolerance, bool p_roughness) {
Environment *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->ssr_enabled = p_enable;
env->ssr_max_steps = p_max_steps;
- env->ssr_accel = p_accel;
- env->ssr_fade = p_fade;
+ env->ssr_fade_in = p_fade_in;
+ env->ssr_fade_out = p_fade_out;
env->ssr_depth_tolerance = p_depth_tolerance;
- env->ssr_smooth = p_smooth;
env->ssr_roughness = p_roughness;
}
@@ -933,6 +924,70 @@ void RasterizerSceneGLES3::environment_set_tonemap(RID p_env, VS::EnvironmentTon
}
void RasterizerSceneGLES3::environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp) {
+
+ Environment *env = environment_owner.getornull(p_env);
+ ERR_FAIL_COND(!env);
+
+ env->adjustments_enabled = p_enable;
+ env->adjustments_brightness = p_brightness;
+ env->adjustments_contrast = p_contrast;
+ env->adjustments_saturation = p_saturation;
+ env->color_correction = p_ramp;
+}
+
+void RasterizerSceneGLES3::environment_set_fog(RID p_env, bool p_enable, const Color &p_color, const Color &p_sun_color, float p_sun_amount) {
+
+ Environment *env = environment_owner.getornull(p_env);
+ ERR_FAIL_COND(!env);
+
+ env->fog_enabled = p_enable;
+ env->fog_color = p_color;
+ env->fog_sun_color = p_sun_color;
+ env->fog_sun_amount = p_sun_amount;
+}
+
+void RasterizerSceneGLES3::environment_set_fog_depth(RID p_env, bool p_enable, float p_depth_begin, float p_depth_curve, bool p_transmit, float p_transmit_curve) {
+
+ Environment *env = environment_owner.getornull(p_env);
+ ERR_FAIL_COND(!env);
+
+ env->fog_depth_enabled = p_enable;
+ env->fog_depth_begin = p_depth_begin;
+ env->fog_depth_curve = p_depth_curve;
+ env->fog_transmit_enabled = p_transmit;
+ env->fog_transmit_curve = p_transmit_curve;
+}
+
+void RasterizerSceneGLES3::environment_set_fog_height(RID p_env, bool p_enable, float p_min_height, float p_max_height, float p_height_curve) {
+
+ Environment *env = environment_owner.getornull(p_env);
+ ERR_FAIL_COND(!env);
+
+ env->fog_height_enabled = p_enable;
+ env->fog_height_min = p_min_height;
+ env->fog_height_max = p_max_height;
+ env->fog_height_curve = p_height_curve;
+}
+
+bool RasterizerSceneGLES3::is_environment(RID p_env) {
+
+ return environment_owner.owns(p_env);
+}
+
+VS::EnvironmentBG RasterizerSceneGLES3::environment_get_background(RID p_env) {
+
+ const Environment *env = environment_owner.getornull(p_env);
+ ERR_FAIL_COND_V(!env, VS::ENV_BG_MAX);
+
+ return env->bg_mode;
+}
+
+int RasterizerSceneGLES3::environment_get_canvas_max_layer(RID p_env) {
+
+ const Environment *env = environment_owner.getornull(p_env);
+ ERR_FAIL_COND_V(!env, -1);
+
+ return env->canvas_max_layer;
}
RID RasterizerSceneGLES3::light_instance_create(RID p_light) {
@@ -961,7 +1016,7 @@ void RasterizerSceneGLES3::light_instance_set_transform(RID p_light_instance, co
light_instance->transform = p_transform;
}
-void RasterizerSceneGLES3::light_instance_set_shadow_transform(RID p_light_instance, const CameraMatrix &p_projection, const Transform &p_transform, float p_far, float p_split, int p_pass) {
+void RasterizerSceneGLES3::light_instance_set_shadow_transform(RID p_light_instance, const CameraMatrix &p_projection, const Transform &p_transform, float p_far, float p_split, int p_pass, float p_bias_scale) {
LightInstance *light_instance = light_instance_owner.getornull(p_light_instance);
ERR_FAIL_COND(!light_instance);
@@ -976,6 +1031,7 @@ void RasterizerSceneGLES3::light_instance_set_shadow_transform(RID p_light_insta
light_instance->shadow_transform[p_pass].transform = p_transform;
light_instance->shadow_transform[p_pass].farplane = p_far;
light_instance->shadow_transform[p_pass].split = p_split;
+ light_instance->shadow_transform[p_pass].bias_scale = p_bias_scale;
}
void RasterizerSceneGLES3::light_instance_mark_visible(RID p_light_instance) {
@@ -1164,6 +1220,7 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
} break;
case ShaderLanguage::ShaderNode::Uniform::HINT_NORMAL: {
tex = storage->resources.normal_tex;
+
} break;
default: {
tex = storage->resources.white_tex;
@@ -1177,29 +1234,14 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
t->detect_3d(t->detect_3d_ud);
}
#endif
- if (storage->config.srgb_decode_supported) {
- //if SRGB decode extension is present, simply switch the texture to whathever is needed
- bool must_srgb = false;
-
- if (t->srgb && (texture_hints[i] == ShaderLanguage::ShaderNode::Uniform::HINT_ALBEDO || texture_hints[i] == ShaderLanguage::ShaderNode::Uniform::HINT_BLACK_ALBEDO)) {
- must_srgb = true;
- }
- if (t->using_srgb != must_srgb) {
- if (must_srgb) {
- glTexParameteri(t->target, _TEXTURE_SRGB_DECODE_EXT, _DECODE_EXT);
#ifdef TOOLS_ENABLED
- if (t->detect_srgb) {
- t->detect_srgb(t->detect_srgb_ud);
- }
-#endif
-
- } else {
- glTexParameteri(t->target, _TEXTURE_SRGB_DECODE_EXT, _SKIP_DECODE_EXT);
- }
- t->using_srgb = must_srgb;
- }
+ if (t->detect_normal && texture_hints[i] == ShaderLanguage::ShaderNode::Uniform::HINT_NORMAL) {
+ t->detect_normal(t->detect_normal_ud);
}
+#endif
+ if (t->render_target)
+ t->render_target->used_in_frame = true;
target = t->target;
tex = t->tex_id;
@@ -1207,6 +1249,30 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
glBindTexture(target, tex);
+ if (t && storage->config.srgb_decode_supported) {
+ //if SRGB decode extension is present, simply switch the texture to whathever is needed
+ bool must_srgb = false;
+
+ if (t->srgb && (texture_hints[i] == ShaderLanguage::ShaderNode::Uniform::HINT_ALBEDO || texture_hints[i] == ShaderLanguage::ShaderNode::Uniform::HINT_BLACK_ALBEDO)) {
+ must_srgb = true;
+ }
+
+ if (t->using_srgb != must_srgb) {
+ if (must_srgb) {
+ glTexParameteri(t->target, _TEXTURE_SRGB_DECODE_EXT, _DECODE_EXT);
+#ifdef TOOLS_ENABLED
+ if (t->detect_srgb) {
+ t->detect_srgb(t->detect_srgb_ud);
+ }
+#endif
+
+ } else {
+ glTexParameteri(t->target, _TEXTURE_SRGB_DECODE_EXT, _SKIP_DECODE_EXT);
+ }
+ t->using_srgb = must_srgb;
+ }
+ }
+
if (i == 0) {
state.current_main_tex = tex;
}
@@ -1215,7 +1281,26 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
return rebind;
}
-void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e) {
+struct RasterizerGLES3Particle {
+
+ float color[4];
+ float velocity_active[4];
+ float custom[4];
+ float xform_1[4];
+ float xform_2[4];
+ float xform_3[4];
+};
+
+struct RasterizerGLES3ParticleSort {
+
+ Vector3 z_dir;
+ bool operator()(const RasterizerGLES3Particle &p_a, const RasterizerGLES3Particle &p_b) const {
+
+ return z_dir.dot(Vector3(p_a.xform_1[3], p_a.xform_2[3], p_a.xform_3[3])) < z_dir.dot(Vector3(p_b.xform_1[3], p_b.xform_2[3], p_b.xform_3[3]));
+ }
+};
+
+void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e, const Transform &p_view_transform) {
switch (e->instance->base_type) {
@@ -1228,8 +1313,11 @@ void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e) {
storage->mesh_render_blend_shapes(s, e->instance->blend_values.ptr());
//rebind shader
state.scene_shader.bind();
+#ifdef DEBUG_ENABLED
+ } else if (state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_WIREFRAME && s->array_wireframe_id) {
+ glBindVertexArray(s->array_wireframe_id); // everything is so easy nowadays
+#endif
} else {
-
glBindVertexArray(s->array_id); // everything is so easy nowadays
}
@@ -1239,7 +1327,16 @@ void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e) {
RasterizerStorageGLES3::MultiMesh *multi_mesh = static_cast<RasterizerStorageGLES3::MultiMesh *>(e->owner);
RasterizerStorageGLES3::Surface *s = static_cast<RasterizerStorageGLES3::Surface *>(e->geometry);
- glBindVertexArray(s->instancing_array_id); // use the instancing array ID
+#ifdef DEBUG_ENABLED
+ if (state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_WIREFRAME && s->instancing_array_wireframe_id) {
+
+ glBindVertexArray(s->instancing_array_wireframe_id); // use the instancing array ID
+ } else
+#endif
+ {
+ glBindVertexArray(s->instancing_array_id); // use the instancing array ID
+ }
+
glBindBuffer(GL_ARRAY_BUFFER, multi_mesh->buffer); //modify the buffer
int stride = (multi_mesh->xform_floats + multi_mesh->color_floats) * 4;
@@ -1283,6 +1380,74 @@ void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e) {
}
} break;
+ case VS::INSTANCE_PARTICLES: {
+
+ RasterizerStorageGLES3::Particles *particles = static_cast<RasterizerStorageGLES3::Particles *>(e->owner);
+ RasterizerStorageGLES3::Surface *s = static_cast<RasterizerStorageGLES3::Surface *>(e->geometry);
+
+ if (particles->draw_order == VS::PARTICLES_DRAW_ORDER_VIEW_DEPTH && particles->particle_valid_histories[1]) {
+
+ glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffer_histories[1]); //modify the buffer, this was used 2 frames ago so it should be good enough for flushing
+ RasterizerGLES3Particle *particle_array = (RasterizerGLES3Particle *)glMapBufferRange(GL_ARRAY_BUFFER, 0, particles->amount * 24 * sizeof(float), GL_MAP_READ_BIT | GL_MAP_WRITE_BIT);
+
+ SortArray<RasterizerGLES3Particle, RasterizerGLES3ParticleSort> sorter;
+
+ if (particles->use_local_coords) {
+ sorter.compare.z_dir = e->instance->transform.affine_inverse().xform(p_view_transform.basis.get_axis(2)).normalized();
+ } else {
+ sorter.compare.z_dir = p_view_transform.basis.get_axis(2).normalized();
+ }
+
+ sorter.sort(particle_array, particles->amount);
+
+ glUnmapBuffer(GL_ARRAY_BUFFER);
+#ifdef DEBUG_ENABLED
+ if (state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_WIREFRAME && s->instancing_array_wireframe_id) {
+ glBindVertexArray(s->instancing_array_wireframe_id); // use the wireframe instancing array ID
+ } else
+#endif
+ {
+
+ glBindVertexArray(s->instancing_array_id); // use the instancing array ID
+ }
+ glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffer_histories[1]); //modify the buffer
+
+ } else {
+#ifdef DEBUG_ENABLED
+ if (state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_WIREFRAME && s->instancing_array_wireframe_id) {
+ glBindVertexArray(s->instancing_array_wireframe_id); // use the wireframe instancing array ID
+ } else
+#endif
+ {
+ glBindVertexArray(s->instancing_array_id); // use the instancing array ID
+ }
+ glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffers[0]); //modify the buffer
+ }
+
+ int stride = sizeof(float) * 4 * 6;
+
+ //transform
+
+ if (particles->draw_order != VS::PARTICLES_DRAW_ORDER_LIFETIME) {
+
+ glEnableVertexAttribArray(8); //xform x
+ glVertexAttribPointer(8, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 3);
+ glVertexAttribDivisor(8, 1);
+ glEnableVertexAttribArray(9); //xform y
+ glVertexAttribPointer(9, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 4);
+ glVertexAttribDivisor(9, 1);
+ glEnableVertexAttribArray(10); //xform z
+ glVertexAttribPointer(10, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 5);
+ glVertexAttribDivisor(10, 1);
+ glEnableVertexAttribArray(11); //color
+ glVertexAttribPointer(11, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + 0);
+ glVertexAttribDivisor(11, 1);
+ glEnableVertexAttribArray(12); //custom
+ glVertexAttribPointer(12, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 2);
+ glVertexAttribDivisor(12, 1);
+ }
+
+ } break;
}
}
@@ -1304,17 +1469,25 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
RasterizerStorageGLES3::Surface *s = static_cast<RasterizerStorageGLES3::Surface *>(e->geometry);
- if (s->index_array_len > 0) {
+#ifdef DEBUG_ENABLED
+
+ if (state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_WIREFRAME && s->array_wireframe_id) {
+
+ glDrawElements(GL_LINES, s->index_wireframe_len, GL_UNSIGNED_INT, 0);
+ storage->info.render.vertices_count += s->index_array_len;
+ } else
+#endif
+ if (s->index_array_len > 0) {
glDrawElements(gl_primitive[s->primitive], s->index_array_len, (s->array_len >= (1 << 16)) ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT, 0);
- storage->info.render_vertices_count += s->index_array_len;
+ storage->info.render.vertices_count += s->index_array_len;
} else {
glDrawArrays(gl_primitive[s->primitive], 0, s->array_len);
- storage->info.render_vertices_count += s->array_len;
+ storage->info.render.vertices_count += s->array_len;
}
} break;
@@ -1325,17 +1498,25 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
int amount = MAX(multi_mesh->size, multi_mesh->visible_instances);
- if (s->index_array_len > 0) {
+#ifdef DEBUG_ENABLED
+
+ if (state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_WIREFRAME && s->array_wireframe_id) {
+
+ glDrawElementsInstanced(GL_LINES, s->index_wireframe_len, GL_UNSIGNED_INT, 0, amount);
+ storage->info.render.vertices_count += s->index_array_len * amount;
+ } else
+#endif
+ 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);
- storage->info.render_vertices_count += s->index_array_len * amount;
+ storage->info.render.vertices_count += s->index_array_len * amount;
} else {
glDrawArraysInstanced(gl_primitive[s->primitive], 0, s->array_len, amount);
- storage->info.render_vertices_count += s->array_len * amount;
+ storage->info.render.vertices_count += s->array_len * amount;
}
} break;
@@ -1361,7 +1542,7 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
int vertices = c.vertices.size();
uint32_t buf_ofs = 0;
- storage->info.render_vertices_count += vertices;
+ storage->info.render.vertices_count += vertices;
if (c.texture.is_valid() && storage->texture_owner.owns(c.texture)) {
@@ -1380,7 +1561,7 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
if (!c.normals.empty()) {
glEnableVertexAttribArray(VS::ARRAY_NORMAL);
- glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Vector3) * vertices, c.normals.ptr());
+ glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Vector3) * vertices, c.normals.ptr());
glVertexAttribPointer(VS::ARRAY_NORMAL, 3, GL_FLOAT, false, sizeof(Vector3) * vertices, ((uint8_t *)NULL) + buf_ofs);
buf_ofs += sizeof(Vector3) * vertices;
@@ -1392,7 +1573,7 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
if (!c.tangents.empty()) {
glEnableVertexAttribArray(VS::ARRAY_TANGENT);
- glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Plane) * vertices, c.tangents.ptr());
+ glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Plane) * vertices, c.tangents.ptr());
glVertexAttribPointer(VS::ARRAY_TANGENT, 4, GL_FLOAT, false, sizeof(Plane) * vertices, ((uint8_t *)NULL) + buf_ofs);
buf_ofs += sizeof(Plane) * vertices;
@@ -1404,7 +1585,7 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
if (!c.colors.empty()) {
glEnableVertexAttribArray(VS::ARRAY_COLOR);
- glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Color) * vertices, c.colors.ptr());
+ glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Color) * vertices, c.colors.ptr());
glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, false, sizeof(Color), ((uint8_t *)NULL) + buf_ofs);
buf_ofs += sizeof(Color) * vertices;
@@ -1417,7 +1598,7 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
if (!c.uvs.empty()) {
glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
- glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Vector2) * vertices, c.uvs.ptr());
+ glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Vector2) * vertices, c.uvs.ptr());
glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, false, sizeof(Vector2), ((uint8_t *)NULL) + buf_ofs);
buf_ofs += sizeof(Vector2) * vertices;
@@ -1429,7 +1610,7 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
if (!c.uvs2.empty()) {
glEnableVertexAttribArray(VS::ARRAY_TEX_UV2);
- glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Vector2) * vertices, c.uvs2.ptr());
+ glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Vector2) * vertices, c.uvs2.ptr());
glVertexAttribPointer(VS::ARRAY_TEX_UV2, 2, GL_FLOAT, false, sizeof(Vector2), ((uint8_t *)NULL) + buf_ofs);
buf_ofs += sizeof(Vector2) * vertices;
@@ -1439,7 +1620,7 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
}
glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Vector3) * vertices, c.vertices.ptr());
+ glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Vector3) * vertices, c.vertices.ptr());
glVertexAttribPointer(VS::ARRAY_VERTEX, 3, GL_FLOAT, false, sizeof(Vector3), ((uint8_t *)NULL) + buf_ofs);
glDrawArrays(gl_primitive[c.primitive], 0, c.vertices.size());
}
@@ -1451,6 +1632,123 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
restore_tex = false;
}
} break;
+ case VS::INSTANCE_PARTICLES: {
+
+ RasterizerStorageGLES3::Particles *particles = static_cast<RasterizerStorageGLES3::Particles *>(e->owner);
+ RasterizerStorageGLES3::Surface *s = static_cast<RasterizerStorageGLES3::Surface *>(e->geometry);
+
+ if (!particles->use_local_coords) //not using local coordinates? then clear transform..
+ state.scene_shader.set_uniform(SceneShaderGLES3::WORLD_TRANSFORM, Transform());
+
+ int amount = particles->amount;
+
+ if (particles->draw_order == VS::PARTICLES_DRAW_ORDER_LIFETIME) {
+ //split
+
+ int stride = sizeof(float) * 4 * 6;
+ int split = int(Math::ceil(particles->phase * particles->amount));
+
+ if (amount - split > 0) {
+ glEnableVertexAttribArray(8); //xform x
+ glVertexAttribPointer(8, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + stride * split + sizeof(float) * 4 * 3);
+ glVertexAttribDivisor(8, 1);
+ glEnableVertexAttribArray(9); //xform y
+ glVertexAttribPointer(9, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + stride * split + sizeof(float) * 4 * 4);
+ glVertexAttribDivisor(9, 1);
+ glEnableVertexAttribArray(10); //xform z
+ glVertexAttribPointer(10, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + stride * split + sizeof(float) * 4 * 5);
+ glVertexAttribDivisor(10, 1);
+ glEnableVertexAttribArray(11); //color
+ glVertexAttribPointer(11, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + stride * split + 0);
+ glVertexAttribDivisor(11, 1);
+ glEnableVertexAttribArray(12); //custom
+ glVertexAttribPointer(12, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + stride * split + sizeof(float) * 4 * 2);
+ glVertexAttribDivisor(12, 1);
+#ifdef DEBUG_ENABLED
+
+ if (state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_WIREFRAME && s->array_wireframe_id) {
+
+ glDrawElementsInstanced(GL_LINES, s->index_wireframe_len, GL_UNSIGNED_INT, 0, amount - split);
+ storage->info.render.vertices_count += s->index_array_len * (amount - split);
+ } else
+#endif
+ 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 - split);
+
+ storage->info.render.vertices_count += s->index_array_len * (amount - split);
+
+ } else {
+
+ glDrawArraysInstanced(gl_primitive[s->primitive], 0, s->array_len, amount - split);
+
+ storage->info.render.vertices_count += s->array_len * (amount - split);
+ }
+ }
+
+ if (split > 0) {
+ glEnableVertexAttribArray(8); //xform x
+ glVertexAttribPointer(8, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 3);
+ glVertexAttribDivisor(8, 1);
+ glEnableVertexAttribArray(9); //xform y
+ glVertexAttribPointer(9, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 4);
+ glVertexAttribDivisor(9, 1);
+ glEnableVertexAttribArray(10); //xform z
+ glVertexAttribPointer(10, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 5);
+ glVertexAttribDivisor(10, 1);
+ glEnableVertexAttribArray(11); //color
+ glVertexAttribPointer(11, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + 0);
+ glVertexAttribDivisor(11, 1);
+ glEnableVertexAttribArray(12); //custom
+ glVertexAttribPointer(12, 4, GL_FLOAT, GL_FALSE, stride, ((uint8_t *)NULL) + sizeof(float) * 4 * 2);
+ glVertexAttribDivisor(12, 1);
+#ifdef DEBUG_ENABLED
+
+ if (state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_WIREFRAME && s->array_wireframe_id) {
+
+ glDrawElementsInstanced(GL_LINES, s->index_wireframe_len, GL_UNSIGNED_INT, 0, split);
+ storage->info.render.vertices_count += s->index_array_len * split;
+ } else
+#endif
+ 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, split);
+
+ storage->info.render.vertices_count += s->index_array_len * split;
+
+ } else {
+
+ glDrawArraysInstanced(gl_primitive[s->primitive], 0, s->array_len, split);
+
+ storage->info.render.vertices_count += s->array_len * split;
+ }
+ }
+
+ } else {
+
+#ifdef DEBUG_ENABLED
+
+ if (state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_WIREFRAME && s->array_wireframe_id) {
+
+ glDrawElementsInstanced(GL_LINES, s->index_wireframe_len, GL_UNSIGNED_INT, 0, amount);
+ storage->info.render.vertices_count += s->index_array_len * amount;
+ } else
+#endif
+ 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);
+
+ storage->info.render.vertices_count += s->index_array_len * amount;
+
+ } else {
+
+ glDrawArraysInstanced(gl_primitive[s->primitive], 0, s->array_len, amount);
+
+ storage->info.render.vertices_count += s->array_len * amount;
+ }
+ }
+
+ } break;
}
}
@@ -1528,25 +1826,28 @@ void RasterizerSceneGLES3::_setup_light(RenderList::Element *e, const Transform
GIProbeInstance *gipi = gi_probe_instance_owner.getptr(ridp[0]);
- glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 10);
+ float bias_scale = e->instance->baked_light ? 1 : 0;
+ glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 9);
glBindTexture(GL_TEXTURE_3D, gipi->tex_cache);
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_BIAS1, gipi->probe ? gipi->probe->bias * bias_scale : 0.0);
+ state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_NORMAL_BIAS1, gipi->probe ? gipi->probe->normal_bias * bias_scale : 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) {
GIProbeInstance *gipi2 = gi_probe_instance_owner.getptr(ridp[1]);
- glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 11);
+ glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 10);
glBindTexture(GL_TEXTURE_3D, gipi2->tex_cache);
state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_XFORM2, gipi2->transform_to_data * p_view_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_BIAS2, gipi2->probe ? gipi2->probe->bias * bias_scale : 0.0);
+ state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_NORMAL_BIAS2, gipi2->probe ? gipi2->probe->normal_bias * bias_scale : 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 {
@@ -1556,61 +1857,6 @@ void RasterizerSceneGLES3::_setup_light(RenderList::Element *e, const Transform
}
}
-void RasterizerSceneGLES3::_setup_transform(InstanceBase *p_instance, const Transform &p_view_transform, const CameraMatrix &p_projection) {
-
- if (p_instance->billboard || p_instance->billboard_y || p_instance->depth_scale) {
-
- Transform xf = p_instance->transform;
- if (p_instance->depth_scale) {
-
- if (p_projection.matrix[3][3]) {
- //orthogonal matrix, try to do about the same
- //with viewport size
- //real_t w = Math::abs( 1.0/(2.0*(p_projection.matrix[0][0])) );
- real_t h = Math::abs(1.0 / (2.0 * p_projection.matrix[1][1]));
- float sc = (h * 2.0); //consistent with Y-fov
- xf.basis.scale(Vector3(sc, sc, sc));
- } else {
- //just scale by depth
- real_t sc = Plane(p_view_transform.origin, -p_view_transform.get_basis().get_axis(2)).distance_to(xf.origin);
- xf.basis.scale(Vector3(sc, sc, sc));
- }
- }
-
- if (p_instance->billboard && storage->frame.current_rt) {
-
- Vector3 scale = xf.basis.get_scale();
-
- if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP]) {
- xf.set_look_at(xf.origin, xf.origin + p_view_transform.get_basis().get_axis(2), -p_view_transform.get_basis().get_axis(1));
- } else {
- xf.set_look_at(xf.origin, xf.origin + p_view_transform.get_basis().get_axis(2), p_view_transform.get_basis().get_axis(1));
- }
-
- xf.basis.scale(scale);
- }
-
- if (p_instance->billboard_y && storage->frame.current_rt) {
-
- Vector3 scale = xf.basis.get_scale();
- Vector3 look_at = p_view_transform.get_origin();
- look_at.y = 0.0;
- Vector3 look_at_norm = look_at.normalized();
-
- if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP]) {
- xf.set_look_at(xf.origin, xf.origin + look_at_norm, Vector3(0.0, -1.0, 0.0));
- } else {
- xf.set_look_at(xf.origin, xf.origin + look_at_norm, Vector3(0.0, 1.0, 0.0));
- }
- xf.basis.scale(scale);
- }
- state.scene_shader.set_uniform(SceneShaderGLES3::WORLD_TRANSFORM, xf);
-
- } else {
- state.scene_shader.set_uniform(SceneShaderGLES3::WORLD_TRANSFORM, p_instance->transform);
- }
-}
-
void RasterizerSceneGLES3::_set_cull(bool p_front, bool p_reverse_cull) {
bool front = p_front;
@@ -1626,30 +1872,31 @@ void RasterizerSceneGLES3::_set_cull(bool p_front, bool p_reverse_cull) {
void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_element_count, const Transform &p_view_transform, const CameraMatrix &p_projection, GLuint p_base_env, bool p_reverse_cull, bool p_alpha_pass, bool p_shadow, bool p_directional_add, bool p_directional_shadows) {
- if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP]) {
- //p_reverse_cull=!p_reverse_cull;
- glFrontFace(GL_CCW);
- } else {
- glFrontFace(GL_CW);
- }
-
glBindBufferBase(GL_UNIFORM_BUFFER, 0, state.scene_ubo); //bind globals ubo
+ bool use_radiance_map = false;
if (!p_shadow && !p_directional_add) {
glBindBufferBase(GL_UNIFORM_BUFFER, 2, state.env_radiance_ubo); //bind environment radiance info
- glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 1);
- glBindTexture(GL_TEXTURE_2D, state.brdf_texture);
if (p_base_env) {
glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 2);
- glBindTexture(GL_TEXTURE_2D, p_base_env);
+ if (storage->config.use_texture_array_environment) {
+ glBindTexture(GL_TEXTURE_2D_ARRAY, p_base_env);
+ } else {
+ glBindTexture(GL_TEXTURE_2D, p_base_env);
+ }
+
state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP, true);
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP_ARRAY, storage->config.use_texture_array_environment);
+ use_radiance_map = true;
} else {
state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP, false);
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP_ARRAY, false);
}
} else {
state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP, false);
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP_ARRAY, false);
}
state.cull_front = false;
@@ -1677,8 +1924,9 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS, true); //by default unshaded (easier to set)
bool first = true;
+ bool prev_use_instancing = false;
- storage->info.render_object_count += p_element_count;
+ storage->info.render.draw_call_count += p_element_count;
for (int i = 0; i < p_element_count; i++) {
@@ -1693,7 +1941,7 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
if (!p_shadow) {
if (p_directional_add) {
- if (e->sort_key & RenderList::SORT_KEY_UNSHADED_FLAG || !(e->instance->layer_mask & directional_light->light_ptr->cull_mask)) {
+ if (e->sort_key & SORT_KEY_UNSHADED_FLAG || !(e->instance->layer_mask & directional_light->light_ptr->cull_mask)) {
continue;
}
@@ -1702,10 +1950,11 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
if (shading != prev_shading) {
- if (e->sort_key & RenderList::SORT_KEY_UNSHADED_FLAG) {
+ if (e->sort_key & SORT_KEY_UNSHADED_FLAG) {
state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS, true);
state.scene_shader.set_conditional(SceneShaderGLES3::USE_FORWARD_LIGHTING, false);
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_VERTEX_LIGHTING, false);
state.scene_shader.set_conditional(SceneShaderGLES3::USE_LIGHT_DIRECTIONAL, false);
state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_DIRECTIONAL_SHADOW, false);
state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM4, false);
@@ -1715,6 +1964,8 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_5, false);
state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_13, false);
state.scene_shader.set_conditional(SceneShaderGLES3::USE_GI_PROBES, false);
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP, false);
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_CONTACT_SHADOWS, false);
//state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS,true);
} else {
@@ -1722,7 +1973,10 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
state.scene_shader.set_conditional(SceneShaderGLES3::USE_GI_PROBES, e->instance->gi_probe_instances.size() > 0);
state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS, false);
+
state.scene_shader.set_conditional(SceneShaderGLES3::USE_FORWARD_LIGHTING, !p_directional_add);
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_VERTEX_LIGHTING, (e->sort_key & SORT_KEY_VERTEX_LIT_FLAG));
+
state.scene_shader.set_conditional(SceneShaderGLES3::USE_LIGHT_DIRECTIONAL, false);
state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_DIRECTIONAL_SHADOW, false);
state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM4, false);
@@ -1730,8 +1984,10 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM_BLEND, false);
state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_5, shadow_filter_mode == SHADOW_FILTER_PCF5);
state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_13, shadow_filter_mode == SHADOW_FILTER_PCF13);
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP, use_radiance_map);
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_CONTACT_SHADOWS, state.used_contact_shadows);
- if (p_directional_add || (directional_light && (e->sort_key & RenderList::SORT_KEY_NO_DIRECTIONAL_FLAG) == 0)) {
+ if (p_directional_add || (directional_light && (e->sort_key & SORT_KEY_NO_DIRECTIONAL_FLAG) == 0)) {
state.scene_shader.set_conditional(SceneShaderGLES3::USE_LIGHT_DIRECTIONAL, true);
if (p_directional_shadows && directional_light->light_ptr->shadow) {
@@ -1804,10 +2060,10 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
}
}
+ bool use_instancing = e->instance->base_type == VS::INSTANCE_MULTIMESH || e->instance->base_type == VS::INSTANCE_PARTICLES;
-
- if ((prev_base_type == VS::INSTANCE_MULTIMESH) != (e->instance->base_type == VS::INSTANCE_MULTIMESH)) {
- state.scene_shader.set_conditional(SceneShaderGLES3::USE_INSTANCING, e->instance->base_type == VS::INSTANCE_MULTIMESH);
+ if (use_instancing != prev_use_instancing) {
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_INSTANCING, use_instancing);
rebind = true;
}
@@ -1819,39 +2075,36 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
if (skeleton.is_valid()) {
RasterizerStorageGLES3::Skeleton *sk = storage->skeleton_owner.getornull(skeleton);
- glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 6);
- glBindTexture(GL_TEXTURE_2D,sk->texture);
+ glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 1);
+ glBindTexture(GL_TEXTURE_2D, sk->texture);
}
}
if (material != prev_material || rebind) {
- storage->info.render_material_switch_count++;
+ storage->info.render.material_switch_count++;
rebind = _setup_material(material, p_alpha_pass);
if (rebind) {
- storage->info.render_shader_rebind_count++;
+ storage->info.render.shader_rebind_count++;
}
}
-
-
- if (!(e->sort_key & RenderList::SORT_KEY_UNSHADED_FLAG) && !p_directional_add && !p_shadow) {
+ if (!(e->sort_key & SORT_KEY_UNSHADED_FLAG) && !p_directional_add && !p_shadow) {
_setup_light(e, p_view_transform);
}
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++;
+ _setup_geometry(e, p_view_transform);
+ storage->info.render.surface_switch_count++;
}
_set_cull(e->sort_key & RenderList::SORT_KEY_MIRROR_FLAG, p_reverse_cull);
state.scene_shader.set_uniform(SceneShaderGLES3::NORMAL_MULT, e->instance->mirror ? -1.0 : 1.0);
-
- _setup_transform(e->instance, p_view_transform, p_projection);
+ state.scene_shader.set_uniform(SceneShaderGLES3::WORLD_TRANSFORM, e->instance->transform);
_render_geometry(e);
@@ -1861,6 +2114,7 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
prev_owner = e->owner;
prev_shading = shading;
prev_skeleton = skeleton;
+ prev_use_instancing = use_instancing;
first = false;
}
@@ -1880,6 +2134,8 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_5, false);
state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_13, false);
state.scene_shader.set_conditional(SceneShaderGLES3::USE_GI_PROBES, false);
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_CONTACT_SHADOWS, false);
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_VERTEX_LIGHTING, false);
}
void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, int p_material, bool p_shadow) {
@@ -1887,6 +2143,10 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
RasterizerStorageGLES3::Material *m = NULL;
RID m_src = p_instance->material_override.is_valid() ? p_instance->material_override : (p_material >= 0 ? p_instance->materials[p_material] : p_geometry->material);
+ if (state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_OVERDRAW) {
+ m_src = default_overdraw_material;
+ }
+
/*
#ifdef DEBUG_ENABLED
if (current_debug==VS::SCENARIO_DEBUG_OVERDRAW) {
@@ -1899,7 +2159,7 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
if (m_src.is_valid()) {
m = storage->material_owner.getornull(m_src);
- if (!m->shader) {
+ if (!m->shader || !m->shader->valid) {
m = NULL;
}
}
@@ -1910,32 +2170,48 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
ERR_FAIL_COND(!m);
- bool has_base_alpha = (m->shader->spatial.uses_alpha);
- bool has_blend_alpha = m->shader->spatial.blend_mode != RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MIX || m->shader->spatial.ontop;
+ _add_geometry_with_material(p_geometry, p_instance, p_owner, m, p_shadow);
+
+ while (m->next_pass.is_valid()) {
+ m = storage->material_owner.getornull(m->next_pass);
+ if (!m)
+ break;
+ _add_geometry_with_material(p_geometry, p_instance, p_owner, m, p_shadow);
+ }
+}
+
+void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, RasterizerStorageGLES3::Material *p_material, bool p_shadow) {
+
+ bool has_base_alpha = (p_material->shader->spatial.uses_alpha && !p_material->shader->spatial.uses_alpha_scissor) || p_material->shader->spatial.uses_screen_texture || p_material->shader->spatial.unshaded;
+ bool has_blend_alpha = p_material->shader->spatial.blend_mode != RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MIX || p_material->shader->spatial.ontop;
bool has_alpha = has_base_alpha || has_blend_alpha;
bool shadow = false;
bool mirror = p_instance->mirror;
- if (m->shader->spatial.cull_mode == RasterizerStorageGLES3::Shader::Spatial::CULL_MODE_FRONT) {
+ if (p_material->shader->spatial.cull_mode == RasterizerStorageGLES3::Shader::Spatial::CULL_MODE_FRONT) {
mirror = !mirror;
}
- if (m->shader->spatial.uses_sss) {
+ if (p_material->shader->spatial.uses_sss) {
state.used_sss = true;
}
+ if (p_material->shader->spatial.uses_screen_texture) {
+ state.used_screen_texture = true;
+ }
+
if (p_shadow) {
- if (has_blend_alpha || (has_base_alpha && m->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS))
+ if (has_blend_alpha || (has_base_alpha && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS))
return; //bye
- if (!m->shader->spatial.uses_vertex && !m->shader->spatial.uses_discard && m->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) {
+ if (!p_material->shader->spatial.uses_alpha_scissor && !p_material->shader->spatial.writes_modelview_or_projection && !p_material->shader->spatial.uses_vertex && !p_material->shader->spatial.uses_discard && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) {
//shader does not use discard and does not write a vertex position, use generic material
if (p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_DOUBLE_SIDED)
- m = storage->material_owner.getptr(default_material_twosided);
+ p_material = storage->material_owner.getptr(default_material_twosided);
else
- m = storage->material_owner.getptr(default_material);
+ p_material = storage->material_owner.getptr(default_material);
}
has_alpha = false;
@@ -1947,7 +2223,7 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
return;
e->geometry = p_geometry;
- e->material = m;
+ e->material = p_material;
e->instance = p_instance;
e->owner = p_owner;
e->sort_key = 0;
@@ -1958,7 +2234,7 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
}
if (!p_shadow && directional_light && (directional_light->light_ptr->cull_mask & e->instance->layer_mask) == 0) {
- e->sort_key |= RenderList::SORT_KEY_NO_DIRECTIONAL_FLAG;
+ e->sort_key |= SORT_KEY_NO_DIRECTIONAL_FLAG;
}
e->sort_key |= uint64_t(e->geometry->index) << RenderList::SORT_KEY_GEOMETRY_INDEX_SHIFT;
@@ -1974,7 +2250,7 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
e->sort_key |= uint64_t(e->material->index) << RenderList::SORT_KEY_MATERIAL_INDEX_SHIFT;
e->sort_key |= uint64_t(e->instance->depth_layer) << RenderList::SORT_KEY_DEPTH_LAYER_SHIFT;
- if (!has_blend_alpha && has_alpha && m->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) {
+ if (!has_blend_alpha && has_alpha && p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) {
//if nothing exists, add this element as opaque too
RenderList::Element *oe = render_list.add_element();
@@ -1986,7 +2262,7 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
}
if (e->instance->gi_probe_instances.size()) {
- e->sort_key |= RenderList::SORT_KEY_GI_PROBES_FLAG;
+ e->sort_key |= SORT_KEY_GI_PROBES_FLAG;
}
}
@@ -2001,18 +2277,23 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
//e->light_type=0xFF; // no lights!
- if (shadow || m->shader->spatial.unshaded /*|| current_debug==VS::SCENARIO_DEBUG_SHADELESS*/) {
+ if (shadow || p_material->shader->spatial.unshaded || state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_UNSHADED) {
+
+ e->sort_key |= SORT_KEY_UNSHADED_FLAG;
+ }
+
+ if (!shadow && (p_material->shader->spatial.uses_vertex_lighting || storage->config.force_vertex_shading)) {
- e->sort_key |= RenderList::SORT_KEY_UNSHADED_FLAG;
+ e->sort_key |= SORT_KEY_VERTEX_LIT_FLAG;
}
}
-void RasterizerSceneGLES3::_draw_skybox(RasterizerStorageGLES3::SkyBox *p_skybox, const CameraMatrix &p_projection, const Transform &p_transform, bool p_vflip, float p_scale) {
+void RasterizerSceneGLES3::_draw_sky(RasterizerStorageGLES3::Sky *p_sky, const CameraMatrix &p_projection, const Transform &p_transform, bool p_vflip, float p_scale, float p_energy) {
- if (!p_skybox)
+ if (!p_sky)
return;
- RasterizerStorageGLES3::Texture *tex = storage->texture_owner.getornull(p_skybox->cubemap);
+ RasterizerStorageGLES3::Texture *tex = storage->texture_owner.getornull(p_sky->panorama);
ERR_FAIL_COND(!tex);
glActiveTexture(GL_TEXTURE0);
@@ -2051,7 +2332,7 @@ void RasterizerSceneGLES3::_draw_skybox(RasterizerStorageGLES3::SkyBox *p_skybox
};
- //skybox uv vectors
+ //sky uv vectors
float vw, vh, zn;
p_projection.get_viewport_size(vw, vh);
zn = p_projection.get_z_near();
@@ -2068,21 +2349,24 @@ void RasterizerSceneGLES3::_draw_skybox(RasterizerStorageGLES3::SkyBox *p_skybox
vertices[i * 2 + 1].z = -vertices[i * 2 + 1].z;
}
- glBindBuffer(GL_ARRAY_BUFFER, state.skybox_verts);
+ glBindBuffer(GL_ARRAY_BUFFER, state.sky_verts);
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Vector3) * 8, vertices);
glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind
- glBindVertexArray(state.skybox_array);
+ glBindVertexArray(state.sky_array);
- storage->shaders.copy.set_conditional(CopyShaderGLES3::USE_CUBEMAP, true);
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::USE_PANORAMA, true);
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::USE_MULTIPLIER, true);
storage->shaders.copy.bind();
+ storage->shaders.copy.set_uniform(CopyShaderGLES3::MULTIPLIER, p_energy);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glBindVertexArray(0);
glColorMask(1, 1, 1, 1);
- storage->shaders.copy.set_conditional(CopyShaderGLES3::USE_CUBEMAP, false);
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::USE_MULTIPLIER, false);
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::USE_PANORAMA, false);
}
void RasterizerSceneGLES3::_setup_environment(Environment *env, const CameraMatrix &p_cam_projection, const Transform &p_cam_transform) {
@@ -2093,10 +2377,9 @@ void RasterizerSceneGLES3::_setup_environment(Environment *env, const CameraMatr
store_transform(p_cam_transform.affine_inverse(), state.ubo_data.camera_inverse_matrix);
//time global variables
- for (int i = 0; i < 4; i++) {
- state.ubo_data.time[i] = storage->frame.time[i];
- }
+ state.ubo_data.time = storage->frame.time[0];
+ state.ubo_data.z_far = p_cam_projection.get_z_far();
//bg and ambient
if (env) {
state.ubo_data.bg_energy = env->bg_energy;
@@ -2126,8 +2409,32 @@ void RasterizerSceneGLES3::_setup_environment(Environment *env, const CameraMatr
state.ubo_data.bg_color[2] = bg_color.b;
state.ubo_data.bg_color[3] = bg_color.a;
- state.env_radiance_data.ambient_contribution = env->ambient_skybox_contribution;
+ state.env_radiance_data.ambient_contribution = env->ambient_sky_contribution;
state.ubo_data.ambient_occlusion_affect_light = env->ssao_light_affect;
+
+ //fog
+
+ Color linear_fog = env->fog_color.to_linear();
+ state.ubo_data.fog_color_enabled[0] = linear_fog.r;
+ state.ubo_data.fog_color_enabled[1] = linear_fog.g;
+ state.ubo_data.fog_color_enabled[2] = linear_fog.b;
+ state.ubo_data.fog_color_enabled[3] = env->fog_enabled ? 1.0 : 0.0;
+
+ Color linear_sun = env->fog_sun_color.to_linear();
+ state.ubo_data.fog_sun_color_amount[0] = linear_sun.r;
+ state.ubo_data.fog_sun_color_amount[1] = linear_sun.g;
+ state.ubo_data.fog_sun_color_amount[2] = linear_sun.b;
+ state.ubo_data.fog_sun_color_amount[3] = env->fog_sun_amount;
+ state.ubo_data.fog_depth_enabled = env->fog_depth_enabled;
+ state.ubo_data.fog_depth_begin = env->fog_depth_begin;
+ state.ubo_data.fog_depth_curve = env->fog_depth_curve;
+ state.ubo_data.fog_transmit_enabled = env->fog_transmit_enabled;
+ state.ubo_data.fog_transmit_curve = env->fog_transmit_curve;
+ state.ubo_data.fog_height_enabled = env->fog_height_enabled;
+ state.ubo_data.fog_height_min = env->fog_height_min;
+ state.ubo_data.fog_height_max = env->fog_height_max;
+ state.ubo_data.fog_height_curve = env->fog_height_curve;
+
} else {
state.ubo_data.bg_energy = 1.0;
state.ubo_data.ambient_energy = 1.0;
@@ -2145,6 +2452,8 @@ void RasterizerSceneGLES3::_setup_environment(Environment *env, const CameraMatr
state.env_radiance_data.ambient_contribution = 0;
state.ubo_data.ambient_occlusion_affect_light = 0;
+
+ state.ubo_data.fog_color_enabled[3] = 0.0;
}
{
@@ -2227,8 +2536,8 @@ void RasterizerSceneGLES3::_setup_directional_light(int p_index, const Transform
for (int j = 0; j < shadow_count; j++) {
- uint32_t x = li->directional_rect.pos.x;
- uint32_t y = li->directional_rect.pos.y;
+ uint32_t x = li->directional_rect.position.x;
+ uint32_t y = li->directional_rect.position.y;
uint32_t width = li->directional_rect.size.x;
uint32_t height = li->directional_rect.size.y;
@@ -2273,8 +2582,8 @@ void RasterizerSceneGLES3::_setup_directional_light(int p_index, const Transform
store_camera(shadow_mtx, &ubo_data.shadow_matrix1[16 * j]);
- ubo_data.light_clamp[0] = atlas_rect.pos.x;
- ubo_data.light_clamp[1] = atlas_rect.pos.y;
+ ubo_data.light_clamp[0] = atlas_rect.position.x;
+ ubo_data.light_clamp[1] = atlas_rect.position.y;
ubo_data.light_clamp[2] = atlas_rect.size.x;
ubo_data.light_clamp[3] = atlas_rect.size.y;
}
@@ -2463,8 +2772,8 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result, int p_light_c
Rect2 rect(float(x) / atlas_size, float(y) / atlas_size, float(width) / atlas_size, float(height) / atlas_size);
ubo_data.light_params[3] = 1.0; //means it has shadow
- ubo_data.light_clamp[0] = rect.pos.x;
- ubo_data.light_clamp[1] = rect.pos.y;
+ ubo_data.light_clamp[0] = rect.position.x;
+ ubo_data.light_clamp[1] = rect.position.y;
ubo_data.light_clamp[2] = rect.size.x;
ubo_data.light_clamp[3] = rect.size.y;
@@ -2570,7 +2879,7 @@ void RasterizerSceneGLES3::_setup_reflections(RID *p_reflection_probe_cull_resul
ambient_linear.r *= p_env->ambient_energy;
ambient_linear.g *= p_env->ambient_energy;
ambient_linear.b *= p_env->ambient_energy;
- contrib = p_env->ambient_skybox_contribution;
+ contrib = p_env->ambient_sky_contribution;
}
reflection_ubo.ambient[0] = ambient_linear.r;
@@ -2588,7 +2897,7 @@ void RasterizerSceneGLES3::_setup_reflections(RID *p_reflection_probe_cull_resul
reflection_ubo.atlas_clamp[0] = float(x) / reflection_atlas->size;
reflection_ubo.atlas_clamp[1] = float(y) / reflection_atlas->size;
reflection_ubo.atlas_clamp[2] = float(width) / reflection_atlas->size;
- reflection_ubo.atlas_clamp[3] = float(height / 2) / reflection_atlas->size;
+ reflection_ubo.atlas_clamp[3] = float(height) / reflection_atlas->size;
Transform proj = (p_camera_inverse_transform * rpi->transform).inverse();
store_transform(proj, reflection_ubo.local_matrix);
@@ -2608,7 +2917,19 @@ void RasterizerSceneGLES3::_setup_reflections(RID *p_reflection_probe_cull_resul
glBindBufferBase(GL_UNIFORM_BUFFER, 6, state.reflection_array_ubo);
}
-void RasterizerSceneGLES3::_copy_screen() {
+void RasterizerSceneGLES3::_copy_screen(bool p_invalidate_color, bool p_invalidate_depth) {
+
+#ifndef GLES_OVER_GL
+ if (p_invalidate_color) {
+
+ GLenum attachments[2] = {
+ GL_COLOR_ATTACHMENT0,
+ GL_DEPTH_STENCIL_ATTACHMENT
+ };
+
+ glInvalidateFramebuffer(GL_FRAMEBUFFER, p_invalidate_depth ? 2 : 1, attachments);
+ }
+#endif
glBindVertexArray(storage->resources.quadie_array);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
@@ -2681,6 +3002,7 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p
current_geometry_index = 0;
current_material_index = 0;
state.used_sss = false;
+ state.used_screen_texture = false;
//fill list
@@ -2729,11 +3051,73 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p
} break;
case VS::INSTANCE_IMMEDIATE: {
+ RasterizerStorageGLES3::Immediate *immediate = storage->immediate_owner.getptr(inst->base);
+ ERR_CONTINUE(!immediate);
+
+ _add_geometry(immediate, inst, NULL, -1, p_shadow);
+
+ } break;
+ case VS::INSTANCE_PARTICLES: {
+
+ RasterizerStorageGLES3::Particles *particles = storage->particles_owner.getptr(inst->base);
+ ERR_CONTINUE(!particles);
+
+ for (int i = 0; i < particles->draw_passes.size(); i++) {
+
+ RID pmesh = particles->draw_passes[i];
+ if (!pmesh.is_valid())
+ continue;
+ RasterizerStorageGLES3::Mesh *mesh = storage->mesh_owner.get(pmesh);
+ if (!mesh)
+ continue; //mesh not assigned
+
+ int ssize = mesh->surfaces.size();
+
+ for (int j = 0; j < ssize; j++) {
+
+ RasterizerStorageGLES3::Surface *s = mesh->surfaces[j];
+ _add_geometry(s, inst, particles, -1, p_shadow);
+ }
+ }
+
} break;
}
}
}
+void RasterizerSceneGLES3::_blur_effect_buffer() {
+
+ //blur diffuse into effect mipmaps using separatable convolution
+ //storage->shaders.copy.set_conditional(CopyShaderGLES3::GAUSSIAN_HORIZONTAL,true);
+ for (int i = 0; i < storage->frame.current_rt->effects.mip_maps[1].sizes.size(); i++) {
+
+ int vp_w = storage->frame.current_rt->effects.mip_maps[1].sizes[i].width;
+ int vp_h = storage->frame.current_rt->effects.mip_maps[1].sizes[i].height;
+ glViewport(0, 0, vp_w, vp_h);
+ //horizontal pass
+ state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_HORIZONTAL, true);
+ state.effect_blur_shader.bind();
+ state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE, Vector2(1.0 / vp_w, 1.0 / vp_h));
+ state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD, float(i));
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color); //previous level, since mipmaps[0] starts one level bigger
+ glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[1].sizes[i].fbo);
+ _copy_screen(true);
+ state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_HORIZONTAL, false);
+
+ //vertical pass
+ state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_VERTICAL, true);
+ state.effect_blur_shader.bind();
+ state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE, Vector2(1.0 / vp_w, 1.0 / vp_h));
+ state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD, float(i));
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[1].color);
+ glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[i + 1].fbo); //next level, since mipmaps[0] starts one level bigger
+ _copy_screen(true);
+ state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_VERTICAL, false);
+ }
+}
+
void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_cam_projection) {
glDepthMask(GL_FALSE);
@@ -2777,7 +3161,7 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.ssao.depth_mipmap_fbos[i]); //copy to front first
glViewport(0, 0, ss[0], ss[1]);
- _copy_screen();
+ _copy_screen(true);
}
ss[0] = storage->frame.current_rt->width;
ss[1] = storage->frame.current_rt->height;
@@ -2829,7 +3213,7 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
Color white(1, 1, 1, 1);
glClearBufferfv(GL_COLOR, 0, white.components); // specular
- _copy_screen();
+ _copy_screen(true);
//do the batm, i mean blur
@@ -2850,7 +3234,7 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
if (i == 0) {
glClearBufferfv(GL_COLOR, 0, white.components); // specular
}
- _copy_screen();
+ _copy_screen(true);
}
}
@@ -2867,7 +3251,7 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.ssao.blur_red[0]); //previous level, since mipmaps[0] starts one level bigger
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); // copy to base level
- _copy_screen();
+ _copy_screen(true);
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::SSAO_MERGE, false);
} else {
@@ -2888,8 +3272,8 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
//copy normal and roughness to effect buffer
glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo);
glReadBuffer(GL_COLOR_ATTACHMENT3);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->buffers.effect_fbo);
- glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.ssao.blur_fbo[0]);
+ glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
state.sss_shader.set_conditional(SubsurfScatteringShaderGLES3::USE_11_SAMPLES, subsurface_scatter_quality == SSS_QUALITY_LOW);
state.sss_shader.set_conditional(SubsurfScatteringShaderGLES3::USE_17_SAMPLES, subsurface_scatter_quality == SSS_QUALITY_MEDIUM);
@@ -2905,21 +3289,29 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); //disable filter (fixes bugs on AMD)
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+
glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->buffers.effect);
+ glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.ssao.blur_red[0]);
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->depth);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE);
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->fbo); //copy to front first
- _copy_screen();
+ _copy_screen(true);
glActiveTexture(GL_TEXTURE0);
+
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->color);
state.sss_shader.set_uniform(SubsurfScatteringShaderGLES3::DIR, Vector2(0, 1));
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); // copy to base level
- _copy_screen();
+ _copy_screen(true);
+
+ glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color); //restore filter
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
}
if (env->ssr_enabled) {
@@ -2932,38 +3324,11 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
//blur diffuse into effect mipmaps using separatable convolution
//storage->shaders.copy.set_conditional(CopyShaderGLES3::GAUSSIAN_HORIZONTAL,true);
- for (int i = 0; i < storage->frame.current_rt->effects.mip_maps[1].sizes.size(); i++) {
-
- int vp_w = storage->frame.current_rt->effects.mip_maps[1].sizes[i].width;
- int vp_h = storage->frame.current_rt->effects.mip_maps[1].sizes[i].height;
- glViewport(0, 0, vp_w, vp_h);
- //horizontal pass
- state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_HORIZONTAL, true);
- state.effect_blur_shader.bind();
- state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE, Vector2(1.0 / vp_w, 1.0 / vp_h));
- state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD, float(i));
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color); //previous level, since mipmaps[0] starts one level bigger
- glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[1].sizes[i].fbo);
- _copy_screen();
- state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_HORIZONTAL, false);
-
- //vertical pass
- state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_VERTICAL, true);
- state.effect_blur_shader.bind();
- state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE, Vector2(1.0 / vp_w, 1.0 / vp_h));
- state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD, float(i));
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[1].color);
- glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[i + 1].fbo); //next level, since mipmaps[0] starts one level bigger
- _copy_screen();
- state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_VERTICAL, false);
- }
+ _blur_effect_buffer();
//perform SSR
- state.ssr_shader.set_conditional(ScreenSpaceReflectionShaderGLES3::SMOOTH_ACCEL, env->ssr_accel > 0 && env->ssr_smooth);
- state.ssr_shader.set_conditional(ScreenSpaceReflectionShaderGLES3::REFLECT_ROUGHNESS, env->ssr_accel > 0 && env->ssr_roughness);
+ state.ssr_shader.set_conditional(ScreenSpaceReflectionShaderGLES3::REFLECT_ROUGHNESS, env->ssr_roughness);
state.ssr_shader.bind();
@@ -2979,9 +3344,9 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
//state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::FRAME_INDEX,int(render_pass));
state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::FILTER_MIPMAP_LEVELS, float(storage->frame.current_rt->effects.mip_maps[0].sizes.size()));
state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::NUM_STEPS, env->ssr_max_steps);
- state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::ACCELERATION, env->ssr_accel);
state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::DEPTH_TOLERANCE, env->ssr_depth_tolerance);
- state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::DISTANCE_FADE, env->ssr_fade);
+ state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::DISTANCE_FADE, env->ssr_fade_out);
+ state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::CURVE_FADE_IN, env->ssr_fade_in);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color);
@@ -2994,7 +3359,7 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[1].sizes[0].fbo);
glViewport(0, 0, ssr_w, ssr_h);
- _copy_screen();
+ _copy_screen(true);
glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height);
}
@@ -3011,6 +3376,8 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
//copy reflection over diffuse, resolving SSR if needed
state.resolve_shader.set_conditional(ResolveShaderGLES3::USE_SSR, env->ssr_enabled);
state.resolve_shader.bind();
+ state.resolve_shader.set_uniform(ResolveShaderGLES3::PIXEL_SIZE, Vector2(1.0 / storage->frame.current_rt->width, 1.0 / storage->frame.current_rt->height));
+
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->color);
if (env->ssr_enabled) {
@@ -3023,10 +3390,17 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
glBlendEquation(GL_FUNC_ADD);
glBlendFunc(GL_ONE, GL_ONE); //use additive to accumulate one over the other
- _copy_screen();
+ _copy_screen(true);
glDisable(GL_BLEND); //end additive
+ if (state.used_screen_texture) {
+ _blur_effect_buffer();
+ //restored framebuffer
+ glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo);
+ glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height);
+ }
+
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::SIMPLE_COPY, true);
state.effect_blur_shader.bind();
state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD, float(0));
@@ -3040,7 +3414,7 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color);
- _copy_screen();
+ _copy_screen(true);
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::SIMPLE_COPY, false);
}
@@ -3061,27 +3435,32 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
//copy specular to front buffer
//copy diffuse to effect buffer
- glReadBuffer(GL_COLOR_ATTACHMENT0);
- glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo);
- glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
+ if (storage->frame.current_rt->buffers.active) {
+ //transfer to effect buffer if using buffers, also resolve MSAA
+ glReadBuffer(GL_COLOR_ATTACHMENT0);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo);
+ glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
- glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ }
- if (!env) {
- //no environment, simply return and convert to SRGB
+ if (!env || storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) {
+ //no environment or transparent render, simply return and convert to SRGB
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->fbo);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color);
storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB, true);
- storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA, true);
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::V_FLIP, storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP]);
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA, !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]);
storage->shaders.copy.bind();
- _copy_screen();
+ _copy_screen(true);
storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB, false);
storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA, false); //compute luminance
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::V_FLIP, false);
return;
}
@@ -3133,7 +3512,7 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->fbo); //copy to front first
- _copy_screen();
+ _copy_screen(true);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->color);
@@ -3142,7 +3521,6 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
_copy_screen();
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_FAR_BLUR, false);
- state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_FAR_BLUR, false);
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_LOW, false);
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_MEDIUM, false);
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_HIGH, false);
@@ -3220,7 +3598,7 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->buffers.diffuse);
}
- _copy_screen();
+ _copy_screen(true);
if (composite_from != storage->frame.current_rt->buffers.diffuse) {
@@ -3237,6 +3615,16 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
composite_from = storage->frame.current_rt->effects.mip_maps[0].color;
}
+ if (env->dof_blur_near_enabled || env->dof_blur_far_enabled) {
+ //these needed to disable filtering, reenamble
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ }
+
if (env->auto_exposure) {
//compute auto exposure
@@ -3255,12 +3643,12 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
glUniform2iv(state.exposure_shader.get_uniform(ExposureShaderGLES3::SOURCE_RENDER_SIZE), 1, ss);
glUniform2iv(state.exposure_shader.get_uniform(ExposureShaderGLES3::TARGET_SIZE), 1, ds);
glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->buffers.diffuse);
+ glBindTexture(GL_TEXTURE_2D, composite_from);
glBindFramebuffer(GL_FRAMEBUFFER, exposure_shrink[0].fbo);
glViewport(0, 0, exposure_shrink_size, exposure_shrink_size);
- _copy_screen();
+ _copy_screen(true);
//second step, shrink to 2x2 pixels
state.exposure_shader.set_conditional(ExposureShaderGLES3::EXPOSURE_BEGIN, false);
@@ -3304,7 +3692,7 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
state.exposure_shader.set_uniform(ExposureShaderGLES3::MAX_LUMINANCE, env->auto_exposure_max);
state.exposure_shader.set_uniform(ExposureShaderGLES3::MIN_LUMINANCE, env->auto_exposure_min);
- _copy_screen();
+ _copy_screen(true);
state.exposure_shader.set_conditional(ExposureShaderGLES3::EXPOSURE_FORCE_SET, false);
state.exposure_shader.set_conditional(ExposureShaderGLES3::EXPOSURE_END, false);
@@ -3368,14 +3756,14 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->exposure.color);
state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::GLOW_BLOOM, env->glow_bloom);
- state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::GLOW_HDR_TRESHOLD, env->glow_hdr_bleed_treshold);
+ state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::GLOW_HDR_THRESHOLD, env->glow_hdr_bleed_threshold);
state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::GLOW_HDR_SCALE, env->glow_hdr_bleed_scale);
} else {
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color); //previous level, since mipmaps[0] starts one level bigger
}
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[1].sizes[i].fbo);
- _copy_screen();
+ _copy_screen(true);
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GLOW_GAUSSIAN_HORIZONTAL, false);
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GLOW_FIRST_PASS, false);
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GLOW_USE_AUTO_EXPOSURE, false);
@@ -3444,6 +3832,18 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color);
}
+ if (env->adjustments_enabled) {
+
+ state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_BCS, true);
+ RasterizerStorageGLES3::Texture *tex = storage->texture_owner.getornull(env->color_correction);
+ if (tex) {
+ state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_COLOR_CORRECTION, true);
+ glActiveTexture(GL_TEXTURE3);
+ glBindTexture(tex->target, tex->tex_id);
+ }
+ }
+
+ state.tonemap_shader.set_conditional(TonemapShaderGLES3::V_FLIP, storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP]);
state.tonemap_shader.bind();
state.tonemap_shader.set_uniform(TonemapShaderGLES3::EXPOSURE, env->tone_mapper_exposure);
@@ -3466,7 +3866,12 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
state.tonemap_shader.set_uniform(TonemapShaderGLES3::AUTO_EXPOSURE_GREY, env->auto_exposure_grey);
}
- _copy_screen();
+ if (env->adjustments_enabled) {
+
+ state.tonemap_shader.set_uniform(TonemapShaderGLES3::BCS, Vector3(env->adjustments_brightness, env->adjustments_contrast, env->adjustments_saturation));
+ }
+
+ _copy_screen(true, true);
//turn off everything used
state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_AUTO_EXPOSURE, false);
@@ -3484,6 +3889,9 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_SCREEN, false);
state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_SOFTLIGHT, false);
state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_FILTER_BICUBIC, false);
+ state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_BCS, false);
+ state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_COLOR_CORRECTION, false);
+ state.tonemap_shader.set_conditional(TonemapShaderGLES3::V_FLIP, false);
}
void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_ortogonal, InstanceBase **p_cull_result, int p_cull_count, RID *p_light_cull_result, int p_light_cull_count, RID *p_reflection_probe_cull_result, int p_reflection_probe_cull_count, RID p_environment, RID p_shadow_atlas, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass) {
@@ -3493,12 +3901,14 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
//fill up ubo
+ storage->info.render.object_count += p_cull_count;
+
Environment *env = environment_owner.getornull(p_environment);
ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_shadow_atlas);
ReflectionAtlas *reflection_atlas = reflection_atlas_owner.getornull(p_reflection_atlas);
if (shadow_atlas && shadow_atlas->size) {
- glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 3);
+ glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 5);
glBindTexture(GL_TEXTURE_2D, shadow_atlas->depth);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LESS);
@@ -3507,7 +3917,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
}
if (reflection_atlas && reflection_atlas->size) {
- glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 5);
+ glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 3);
glBindTexture(GL_TEXTURE_2D, reflection_atlas->color);
}
@@ -3519,8 +3929,8 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
state.ubo_data.subsurface_scatter_width = subsurface_scatter_size;
- state.ubo_data.shadow_z_offset = 0;
- state.ubo_data.shadow_slope_scale = 0;
+ state.ubo_data.z_offset = 0;
+ state.ubo_data.z_slope_scale = 0;
state.ubo_data.shadow_dual_paraboloid_render_side = 0;
state.ubo_data.shadow_dual_paraboloid_render_zfar = 0;
@@ -3537,7 +3947,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
state.used_contact_shadows = true;
- if (storage->frame.current_rt && true) { //detect with state.used_contact_shadows too
+ if (!storage->config.no_depth_prepass && storage->frame.current_rt && state.debug_draw != VS::VIEWPORT_DEBUG_DRAW_OVERDRAW) { //detect with state.used_contact_shadows too
//pre z pass
glDisable(GL_BLEND);
@@ -3551,7 +3961,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
glColorMask(0, 0, 0, 0);
glClearDepth(1.0f);
- glClear(GL_DEPTH_BUFFER_BIT);
+ glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
render_list.clear();
_fill_render_list(p_cull_result, p_cull_count, true);
@@ -3571,12 +3981,15 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
//bind depth for read
- glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 9);
+ glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 8);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->depth);
}
fb_cleared = true;
render_pass++;
+ state.using_contact_shadows = true;
+ } else {
+ state.using_contact_shadows = false;
}
_setup_lights(p_light_cull_result, p_light_cull_count, p_cam_transform.affine_inverse(), p_cam_projection, p_shadow_atlas);
@@ -3624,7 +4037,12 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
} else {
- use_mrt = state.used_sss || (env && (env->ssao_enabled || env->ssr_enabled)); //only enable MRT rendering if any of these is enabled
+ use_mrt = env && (state.used_sss || env->ssao_enabled || env->ssr_enabled); //only enable MRT rendering if any of these is enabled
+ //effects disabled and transparency also prevent using MRTs
+ use_mrt = use_mrt && !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT];
+ use_mrt = use_mrt && !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_NO_3D_EFFECTS];
+ use_mrt = use_mrt && state.debug_draw != VS::VIEWPORT_DEBUG_DRAW_OVERDRAW;
+ use_mrt = use_mrt && env && (env->bg_mode != VS::ENV_BG_KEEP && env->bg_mode != VS::ENV_BG_CANVAS);
glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height);
@@ -3653,8 +4071,13 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
} else {
- current_fbo = storage->frame.current_rt->buffers.fbo;
- glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo);
+ if (storage->frame.current_rt->buffers.active) {
+ current_fbo = storage->frame.current_rt->buffers.fbo;
+ } else {
+ current_fbo = storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo;
+ }
+
+ glBindFramebuffer(GL_FRAMEBUFFER, current_fbo);
state.scene_shader.set_conditional(SceneShaderGLES3::USE_MULTIPLE_RENDER_TARGETS, false);
Vector<GLenum> draw_buffers;
@@ -3664,16 +4087,22 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
}
if (!fb_cleared) {
- glClearDepth(1.0f);
- glClear(GL_DEPTH_BUFFER_BIT);
+ glClearBufferfi(GL_DEPTH_STENCIL, 0, 1.0, 0);
}
Color clear_color(0, 0, 0, 0);
- RasterizerStorageGLES3::SkyBox *skybox = NULL;
+ RasterizerStorageGLES3::Sky *sky = NULL;
GLuint env_radiance_tex = 0;
- if (!env || env->bg_mode == VS::ENV_BG_CLEAR_COLOR) {
+ if (state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_OVERDRAW) {
+ clear_color = Color(0, 0, 0, 0);
+ storage->frame.clear_request = false;
+ } else if (!probe && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) {
+ clear_color = Color(0, 0, 0, 0);
+ storage->frame.clear_request = false;
+
+ } else if (!env || env->bg_mode == VS::ENV_BG_CLEAR_COLOR) {
if (storage->frame.clear_request) {
@@ -3681,16 +4110,20 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
storage->frame.clear_request = false;
}
+ } else if (env->bg_mode == VS::ENV_BG_CANVAS) {
+
+ clear_color = env->bg_color.to_linear();
+ storage->frame.clear_request = false;
} else if (env->bg_mode == VS::ENV_BG_COLOR) {
clear_color = env->bg_color.to_linear();
storage->frame.clear_request = false;
- } else if (env->bg_mode == VS::ENV_BG_SKYBOX) {
+ } else if (env->bg_mode == VS::ENV_BG_SKY) {
- skybox = storage->skybox_owner.getornull(env->skybox);
+ sky = storage->sky_owner.getornull(env->sky);
- if (skybox) {
- env_radiance_tex = skybox->radiance;
+ if (sky) {
+ env_radiance_tex = sky->radiance;
}
storage->frame.clear_request = false;
@@ -3698,28 +4131,54 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
storage->frame.clear_request = false;
}
- glClearBufferfv(GL_COLOR, 0, clear_color.components); // specular
+ if (!env || env->bg_mode != VS::ENV_BG_KEEP) {
+ glClearBufferfv(GL_COLOR, 0, clear_color.components); // specular
+ }
- state.texscreen_copied = false;
+ if (env && env->bg_mode == VS::ENV_BG_CANVAS) {
+ //copy canvas to 3d buffer and convert it to linear
- glBlendEquation(GL_FUNC_ADD);
+ glDisable(GL_BLEND);
+ glDepthMask(GL_FALSE);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_CULL_FACE);
- if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) {
- glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- } else {
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->color);
+
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA, true);
+
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::SRGB_TO_LINEAR, true);
+
+ storage->shaders.copy.bind();
+
+ _copy_screen(true, true);
+
+ //turn off everything used
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::SRGB_TO_LINEAR, false);
+ storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA, false);
+
+ //restore
+ glEnable(GL_BLEND);
+ glDepthMask(GL_TRUE);
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_CULL_FACE);
}
- glDisable(GL_BLEND);
+ state.texscreen_copied = false;
- render_list.sort_by_key(false);
+ glBlendEquation(GL_FUNC_ADD);
if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) {
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
} else {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glDisable(GL_BLEND);
}
+ render_list.sort_by_key(false);
+
if (state.directional_light_count == 0) {
directional_light = NULL;
_render_list(render_list.elements, render_list.element_count, p_cam_transform, p_cam_projection, env_radiance_tex, false, false, false, false, shadow_atlas != NULL);
@@ -3741,14 +4200,14 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
glDrawBuffers(1, &gldb);
}
- if (env && env->bg_mode == VS::ENV_BG_SKYBOX) {
+ if (env && env->bg_mode == VS::ENV_BG_SKY && (!storage->frame.current_rt || (!storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT] && state.debug_draw != VS::VIEWPORT_DEBUG_DRAW_OVERDRAW))) {
/*
if (use_mrt) {
- glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->buffers.fbo); //switch to alpha fbo for skybox, only diffuse/ambient matters
+ glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->buffers.fbo); //switch to alpha fbo for sky, only diffuse/ambient matters
*/
- _draw_skybox(skybox, p_cam_projection, p_cam_transform, storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP], env->skybox_scale);
+ _draw_sky(sky, p_cam_projection, p_cam_transform, false, env->sky_scale, env->bg_energy);
}
//_render_list_forward(&alpha_render_list,camera_transform,camera_transform_inverse,camera_projection,false,fragment_lighting,true);
@@ -3758,6 +4217,25 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
if (use_mrt) {
_render_mrts(env, p_cam_projection);
+ } else {
+ //FIXME: check that this is possible to use
+ if (storage->frame.current_rt && storage->frame.current_rt->buffers.active && state.used_screen_texture) {
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo);
+ glReadBuffer(GL_COLOR_ATTACHMENT0);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo);
+ glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ _blur_effect_buffer();
+ //restored framebuffer
+ glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo);
+ glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height);
+ }
+ }
+
+ if (storage->frame.current_rt && state.used_screen_texture && storage->frame.current_rt->buffers.active) {
+ glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 7);
+ glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color);
}
glEnable(GL_BLEND);
@@ -3765,7 +4243,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
glEnable(GL_DEPTH_TEST);
glDisable(GL_SCISSOR_TEST);
- render_list.sort_by_depth(true);
+ render_list.sort_by_reverse_depth(true);
if (state.directional_light_count == 0) {
directional_light = NULL;
@@ -3830,153 +4308,14 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
storage->canvas->canvas_begin();
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, env_radiance_tex);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
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));
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
}
-#if 0
- if (use_fb) {
-
-
-
- for(int i=0;i<VS::ARRAY_MAX;i++) {
- glDisableVertexAttribArray(i);
- }
- glBindBuffer(GL_ARRAY_BUFFER,0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0);
- glDisable(GL_BLEND);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_CULL_FACE);
- glDisable(GL_SCISSOR_TEST);
- glDepthMask(false);
-
- if (current_env && current_env->fx_enabled[VS::ENV_FX_HDR]) {
-
- int hdr_tm = current_env->fx_param[VS::ENV_FX_PARAM_HDR_TONEMAPPER];
- switch(hdr_tm) {
- case VS::ENV_FX_HDR_TONE_MAPPER_LINEAR: {
-
-
- } break;
- case VS::ENV_FX_HDR_TONE_MAPPER_LOG: {
- copy_shader.set_conditional(CopyShaderGLES2::USE_LOG_TONEMAPPER,true);
-
- } break;
- case VS::ENV_FX_HDR_TONE_MAPPER_REINHARDT: {
- copy_shader.set_conditional(CopyShaderGLES2::USE_REINHARDT_TONEMAPPER,true);
- } break;
- case VS::ENV_FX_HDR_TONE_MAPPER_REINHARDT_AUTOWHITE: {
-
- copy_shader.set_conditional(CopyShaderGLES2::USE_REINHARDT_TONEMAPPER,true);
- copy_shader.set_conditional(CopyShaderGLES2::USE_AUTOWHITE,true);
- } break;
- }
-
-
- _process_hdr();
- }
- if (current_env && current_env->fx_enabled[VS::ENV_FX_GLOW]) {
- _process_glow_bloom();
- int glow_transfer_mode=current_env->fx_param[VS::ENV_FX_PARAM_GLOW_BLUR_BLEND_MODE];
- if (glow_transfer_mode==1)
- copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW_SCREEN,true);
- if (glow_transfer_mode==2)
- copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW_SOFTLIGHT,true);
- }
-
- glBindFramebuffer(GL_FRAMEBUFFER, current_rt?current_rt->fbo:base_framebuffer);
-
- Size2 size;
- if (current_rt) {
- glBindFramebuffer(GL_FRAMEBUFFER, current_rt->fbo);
- glViewport( 0,0,viewport.width,viewport.height);
- size=Size2(viewport.width,viewport.height);
- } else {
- glBindFramebuffer(GL_FRAMEBUFFER, base_framebuffer);
- glViewport( viewport.x, window_size.height-(viewport.height+viewport.y), viewport.width,viewport.height );
- size=Size2(viewport.width,viewport.height);
- }
-
- //time to copy!!!
- copy_shader.set_conditional(CopyShaderGLES2::USE_BCS,current_env && current_env->fx_enabled[VS::ENV_FX_BCS]);
- copy_shader.set_conditional(CopyShaderGLES2::USE_SRGB,current_env && current_env->fx_enabled[VS::ENV_FX_SRGB]);
- copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW,current_env && current_env->fx_enabled[VS::ENV_FX_GLOW]);
- copy_shader.set_conditional(CopyShaderGLES2::USE_HDR,current_env && current_env->fx_enabled[VS::ENV_FX_HDR]);
- copy_shader.set_conditional(CopyShaderGLES2::USE_NO_ALPHA,true);
- copy_shader.set_conditional(CopyShaderGLES2::USE_FXAA,current_env && current_env->fx_enabled[VS::ENV_FX_FXAA]);
-
- copy_shader.bind();
- //copy_shader.set_uniform(CopyShaderGLES2::SOURCE,0);
-
- if (current_env && current_env->fx_enabled[VS::ENV_FX_GLOW]) {
-
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, framebuffer.blur[0].color );
- glUniform1i(copy_shader.get_uniform_location(CopyShaderGLES2::GLOW_SOURCE),1);
-
- }
-
- if (current_env && current_env->fx_enabled[VS::ENV_FX_HDR]) {
-
- glActiveTexture(GL_TEXTURE2);
- glBindTexture(GL_TEXTURE_2D, current_vd->lum_color );
- glUniform1i(copy_shader.get_uniform_location(CopyShaderGLES2::HDR_SOURCE),2);
- copy_shader.set_uniform(CopyShaderGLES2::TONEMAP_EXPOSURE,float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_EXPOSURE]));
- copy_shader.set_uniform(CopyShaderGLES2::TONEMAP_WHITE,float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_WHITE]));
-
- }
-
- if (current_env && current_env->fx_enabled[VS::ENV_FX_FXAA])
- copy_shader.set_uniform(CopyShaderGLES2::PIXEL_SIZE,Size2(1.0/size.x,1.0/size.y));
-
-
- if (current_env && current_env->fx_enabled[VS::ENV_FX_BCS]) {
-
- Vector3 bcs;
- bcs.x=current_env->fx_param[VS::ENV_FX_PARAM_BCS_BRIGHTNESS];
- bcs.y=current_env->fx_param[VS::ENV_FX_PARAM_BCS_CONTRAST];
- bcs.z=current_env->fx_param[VS::ENV_FX_PARAM_BCS_SATURATION];
- copy_shader.set_uniform(CopyShaderGLES2::BCS,bcs);
- }
-
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, framebuffer.color );
- glUniform1i(copy_shader.get_uniform_location(CopyShaderGLES2::SOURCE),0);
-
- _copy_screen_quad();
-
- copy_shader.set_conditional(CopyShaderGLES2::USE_BCS,false);
- copy_shader.set_conditional(CopyShaderGLES2::USE_SRGB,false);
- copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW,false);
- copy_shader.set_conditional(CopyShaderGLES2::USE_HDR,false);
- copy_shader.set_conditional(CopyShaderGLES2::USE_NO_ALPHA,false);
- copy_shader.set_conditional(CopyShaderGLES2::USE_FXAA,false);
- copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW_SCREEN,false);
- copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW_SOFTLIGHT,false);
- copy_shader.set_conditional(CopyShaderGLES2::USE_REINHARDT_TONEMAPPER,false);
- copy_shader.set_conditional(CopyShaderGLES2::USE_AUTOWHITE,false);
- copy_shader.set_conditional(CopyShaderGLES2::USE_LOG_TONEMAPPER,false);
-
- state.scene_shader.set_conditional(SceneShaderGLES3::USE_8BIT_HDR,false);
-
-
- if (current_env && current_env->fx_enabled[VS::ENV_FX_HDR] && GLOBAL_DEF("rasterizer/debug_hdr",false)) {
- _debug_luminances();
- }
- }
-
- current_env=NULL;
- current_debug=VS::SCENARIO_DEBUG_DISABLED;
- if (GLOBAL_DEF("rasterizer/debug_shadow_maps",false)) {
- _debug_shadows();
- }
- //_debug_luminances();
- //_debug_samplers();
-
- if (using_canvas_bg) {
- using_canvas_bg=false;
- glColorMask(1,1,1,1); //don't touch alpha
- }
-#endif
+ //disable all stuff
}
void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_pass, InstanceBase **p_cull_result, int p_cull_count) {
@@ -4001,6 +4340,8 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
float bias = 0;
float normal_bias = 0;
+ state.using_contact_shadows = false;
+
CameraMatrix light_projection;
Transform light_transform;
@@ -4017,15 +4358,15 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
} else if (directional_shadow.light_count == 2) {
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size, directional_shadow.size / 2);
if (light_instance->light_directional_index == 1) {
- light_instance->directional_rect.pos.x += light_instance->directional_rect.size.x;
+ light_instance->directional_rect.position.x += light_instance->directional_rect.size.x;
}
} else { //3 and 4
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size / 2, directional_shadow.size / 2);
if (light_instance->light_directional_index & 1) {
- light_instance->directional_rect.pos.x += light_instance->directional_rect.size.x;
+ light_instance->directional_rect.position.x += light_instance->directional_rect.size.x;
}
if (light_instance->light_directional_index / 2) {
- light_instance->directional_rect.pos.y += light_instance->directional_rect.size.y;
+ light_instance->directional_rect.position.y += light_instance->directional_rect.size.y;
}
}
}
@@ -4033,8 +4374,8 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
light_projection = light_instance->shadow_transform[p_pass].camera;
light_transform = light_instance->shadow_transform[p_pass].transform;
- x = light_instance->directional_rect.pos.x;
- y = light_instance->directional_rect.pos.y;
+ x = light_instance->directional_rect.position.x;
+ y = light_instance->directional_rect.position.y;
width = light_instance->directional_rect.size.x;
height = light_instance->directional_rect.size.y;
@@ -4066,8 +4407,8 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
}
zfar = light->param[VS::LIGHT_PARAM_RANGE];
- bias = light->param[VS::LIGHT_PARAM_SHADOW_BIAS];
- normal_bias = light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS];
+ bias = light->param[VS::LIGHT_PARAM_SHADOW_BIAS] * light_instance->shadow_transform[p_pass].bias_scale;
+ normal_bias = light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] * light_instance->shadow_transform[p_pass].bias_scale;
fbo = directional_shadow.fbo;
vp_height = directional_shadow.size;
@@ -4185,8 +4526,8 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
glClear(GL_DEPTH_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
- state.ubo_data.shadow_z_offset = bias;
- state.ubo_data.shadow_slope_scale = normal_bias;
+ state.ubo_data.z_offset = bias;
+ state.ubo_data.z_slope_scale = normal_bias;
state.ubo_data.shadow_dual_paraboloid_render_side = dp_direction;
state.ubo_data.shadow_dual_paraboloid_render_zfar = zfar;
@@ -4298,135 +4639,39 @@ bool RasterizerSceneGLES3::free(RID p_rid) {
return true;
}
-// http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html
-static _FORCE_INLINE_ float radicalInverse_VdC(uint32_t bits) {
- bits = (bits << 16u) | (bits >> 16u);
- bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
- bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
- bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
- bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
- return float(bits) * 2.3283064365386963e-10f; // / 0x100000000
-}
+void RasterizerSceneGLES3::set_debug_draw_mode(VS::ViewportDebugDraw p_debug_draw) {
-static _FORCE_INLINE_ Vector2 Hammersley(uint32_t i, uint32_t N) {
- return Vector2(float(i) / float(N), radicalInverse_VdC(i));
+ state.debug_draw = p_debug_draw;
}
-static _FORCE_INLINE_ Vector3 ImportanceSampleGGX(Vector2 Xi, float Roughness, Vector3 N) {
- float a = Roughness * Roughness; // DISNEY'S ROUGHNESS [see Burley'12 siggraph]
-
- // Compute distribution direction
- float Phi = 2.0f * Math_PI * Xi.x;
- float CosTheta = Math::sqrt((float)(1.0f - Xi.y) / (1.0f + (a * a - 1.0f) * Xi.y));
- float SinTheta = Math::sqrt((float)Math::abs(1.0f - CosTheta * CosTheta));
-
- // Convert to spherical direction
- Vector3 H;
- H.x = SinTheta * Math::cos(Phi);
- H.y = SinTheta * Math::sin(Phi);
- H.z = CosTheta;
-
- Vector3 UpVector = Math::abs(N.z) < 0.999 ? Vector3(0.0, 0.0, 1.0) : Vector3(1.0, 0.0, 0.0);
- Vector3 TangentX = UpVector.cross(N);
- TangentX.normalize();
- Vector3 TangentY = N.cross(TangentX);
-
- // Tangent to world space
- return TangentX * H.x + TangentY * H.y + N * H.z;
-}
-
-static _FORCE_INLINE_ float GGX(float NdotV, float a) {
- float k = a / 2.0;
- return NdotV / (NdotV * (1.0 - k) + k);
-}
-
-// http://graphicrants.blogspot.com.au/2013/08/specular-brdf-reference.html
-float _FORCE_INLINE_ G_Smith(float a, float nDotV, float nDotL) {
- return GGX(nDotL, a * a) * GGX(nDotV, a * a);
-}
-
-void RasterizerSceneGLES3::_generate_brdf() {
-
- int brdf_size = GLOBAL_DEF("rendering/gles3/brdf_texture_size", 64);
-
- PoolVector<uint8_t> brdf;
- brdf.resize(brdf_size * brdf_size * 2);
-
- PoolVector<uint8_t>::Write w = brdf.write();
-
- for (int i = 0; i < brdf_size; i++) {
- for (int j = 0; j < brdf_size; j++) {
-
- float Roughness = float(j) / (brdf_size - 1);
- float NoV = float(i + 1) / (brdf_size); //avoid storing nov0
-
- Vector3 V;
- V.x = Math::sqrt(1.0f - NoV * NoV);
- V.y = 0.0;
- V.z = NoV;
-
- Vector3 N = Vector3(0.0, 0.0, 1.0);
-
- float A = 0;
- float B = 0;
-
- for (int s = 0; s < 512; s++) {
-
- Vector2 xi = Hammersley(s, 512);
- Vector3 H = ImportanceSampleGGX(xi, Roughness, N);
- Vector3 L = 2.0 * V.dot(H) * H - V;
+void RasterizerSceneGLES3::initialize() {
- float NoL = CLAMP(L.z, 0.0, 1.0);
- float NoH = CLAMP(H.z, 0.0, 1.0);
- float VoH = CLAMP(V.dot(H), 0.0, 1.0);
+ render_pass = 0;
- if (NoL > 0.0) {
- float G = G_Smith(Roughness, NoV, NoL);
- float G_Vis = G * VoH / (NoH * NoV);
- float Fc = pow(1.0 - VoH, 5.0);
+ state.scene_shader.init();
- A += (1.0 - Fc) * G_Vis;
- B += Fc * G_Vis;
- }
- }
+ {
+ //default material and shader
- A /= 512.0;
- B /= 512.0;
+ default_shader = storage->shader_create();
+ storage->shader_set_code(default_shader, "shader_type spatial;\n");
+ default_material = storage->material_create();
+ storage->material_set_shader(default_material, default_shader);
- int tofs = ((brdf_size - j - 1) * brdf_size + i) * 2;
- w[tofs + 0] = CLAMP(A * 255, 0, 255);
- w[tofs + 1] = CLAMP(B * 255, 0, 255);
- }
+ default_shader_twosided = storage->shader_create();
+ default_material_twosided = storage->material_create();
+ storage->shader_set_code(default_shader_twosided, "shader_type spatial; render_mode cull_disabled;\n");
+ storage->material_set_shader(default_material_twosided, default_shader_twosided);
}
- //set up brdf texture
-
- glGenTextures(1, &state.brdf_texture);
-
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, state.brdf_texture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RG8, brdf_size, brdf_size, 0, GL_RG, GL_UNSIGNED_BYTE, w.ptr());
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glBindTexture(GL_TEXTURE_2D, 0);
-}
-
-void RasterizerSceneGLES3::initialize() {
-
- render_pass = 0;
-
- state.scene_shader.init();
-
- default_shader = storage->shader_create(VS::SHADER_SPATIAL);
- default_material = storage->material_create();
- storage->material_set_shader(default_material, default_shader);
+ {
+ //default material and shader
- default_shader_twosided = storage->shader_create(VS::SHADER_SPATIAL);
- default_material_twosided = storage->material_create();
- storage->shader_set_code(default_shader_twosided, "render_mode cull_disabled;\n");
- storage->material_set_shader(default_material_twosided, default_shader_twosided);
+ default_overdraw_shader = storage->shader_create();
+ storage->shader_set_code(default_overdraw_shader, "shader_type spatial;\nrender_mode blend_add,unshaded;\n void fragment() { ALBEDO=vec3(0.4,0.8,0.8); ALPHA=0.2; }");
+ default_overdraw_material = storage->material_create();
+ storage->material_set_shader(default_overdraw_material, default_overdraw_shader);
+ }
glGenBuffers(1, &state.scene_ubo);
glBindBuffer(GL_UNIFORM_BUFFER, state.scene_ubo);
@@ -4438,7 +4683,7 @@ void RasterizerSceneGLES3::initialize() {
glBufferData(GL_UNIFORM_BUFFER, sizeof(State::EnvironmentRadianceUBO), &state.env_radiance_ubo, GL_DYNAMIC_DRAW);
glBindBuffer(GL_UNIFORM_BUFFER, 0);
- render_list.max_elements = GLOBAL_DEF("rendering/gles3/max_renderable_elements", (int)RenderList::DEFAULT_MAX_ELEMENTS);
+ render_list.max_elements = GLOBAL_DEF("rendering/limits/rendering/max_renderable_elements", (int)RenderList::DEFAULT_MAX_ELEMENTS);
if (render_list.max_elements > 1000000)
render_list.max_elements = 1000000;
if (render_list.max_elements < 1024)
@@ -4447,14 +4692,14 @@ void RasterizerSceneGLES3::initialize() {
{
//quad buffers
- glGenBuffers(1, &state.skybox_verts);
- glBindBuffer(GL_ARRAY_BUFFER, state.skybox_verts);
+ glGenBuffers(1, &state.sky_verts);
+ glBindBuffer(GL_ARRAY_BUFFER, state.sky_verts);
glBufferData(GL_ARRAY_BUFFER, sizeof(Vector3) * 8, NULL, GL_DYNAMIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind
- glGenVertexArrays(1, &state.skybox_array);
- glBindVertexArray(state.skybox_array);
- glBindBuffer(GL_ARRAY_BUFFER, state.skybox_verts);
+ glGenVertexArrays(1, &state.sky_array);
+ glBindVertexArray(state.sky_array);
+ glBindBuffer(GL_ARRAY_BUFFER, state.sky_verts);
glVertexAttribPointer(VS::ARRAY_VERTEX, 3, GL_FLOAT, GL_FALSE, sizeof(Vector3) * 2, 0);
glEnableVertexAttribArray(VS::ARRAY_VERTEX);
glVertexAttribPointer(VS::ARRAY_TEX_UV, 3, GL_FLOAT, GL_FALSE, sizeof(Vector3) * 2, ((uint8_t *)NULL) + sizeof(Vector3));
@@ -4464,7 +4709,6 @@ void RasterizerSceneGLES3::initialize() {
}
render_list.init();
state.cube_to_dp_shader.init();
- _generate_brdf();
shadow_atlas_realloc_tolerance_msec = 500;
@@ -4513,7 +4757,7 @@ void RasterizerSceneGLES3::initialize() {
{
//directional light shadow
directional_shadow.light_count = 0;
- directional_shadow.size = nearest_power_of_2(GLOBAL_DEF("rendering/shadows/directional_shadow_size", 2048));
+ directional_shadow.size = nearest_power_of_2(GLOBAL_GET("rendering/quality/directional_shadow/size"));
glGenFramebuffers(1, &directional_shadow.fbo);
glBindFramebuffer(GL_FRAMEBUFFER, directional_shadow.fbo);
glGenTextures(1, &directional_shadow.depth);
@@ -4539,7 +4783,7 @@ void RasterizerSceneGLES3::initialize() {
const int ubo_light_size = 160;
state.ubo_light_size = ubo_light_size;
state.max_ubo_lights = MIN(RenderList::MAX_LIGHTS, max_ubo_size / ubo_light_size);
- print_line("max ubo light: " + itos(state.max_ubo_lights));
+ print_line("GLES3: max ubo light: " + itos(state.max_ubo_lights));
state.spot_array_tmp = (uint8_t *)memalloc(ubo_light_size * state.max_ubo_lights);
state.omni_array_tmp = (uint8_t *)memalloc(ubo_light_size * state.max_ubo_lights);
@@ -4565,7 +4809,7 @@ void RasterizerSceneGLES3::initialize() {
state.scene_shader.add_custom_define("#define MAX_FORWARD_LIGHTS " + itos(state.max_forward_lights_per_object) + "\n");
state.max_ubo_reflections = MIN(RenderList::MAX_REFLECTIONS, max_ubo_size / sizeof(ReflectionProbeDataUBO));
- print_line("max ubo reflections: " + itos(state.max_ubo_reflections) + " ubo size: " + itos(sizeof(ReflectionProbeDataUBO)));
+ print_line("GLES3: max ubo reflections: " + itos(state.max_ubo_reflections) + ", ubo size: " + itos(sizeof(ReflectionProbeDataUBO)));
state.reflection_array_tmp = (uint8_t *)memalloc(sizeof(ReflectionProbeDataUBO) * state.max_ubo_reflections);
@@ -4580,8 +4824,6 @@ void RasterizerSceneGLES3::initialize() {
state.scene_shader.add_custom_define("#define MAX_SKELETON_BONES " + itos(state.max_skeleton_bones) + "\n");
}
- GLOBAL_DEF("rendering/gles3/shadow_filter_mode", 1);
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/gles3/shadow_filter_mode", PropertyInfo(Variant::INT, "rendering/gles3/shadow_filter_mode", PROPERTY_HINT_ENUM, "Disabled,PCF5,PCF13"));
shadow_filter_mode = SHADOW_FILTER_NEAREST;
{ //reflection cubemaps
@@ -4645,7 +4887,7 @@ void RasterizerSceneGLES3::initialize() {
{
- uint32_t immediate_buffer_size = GLOBAL_DEF("rendering/buffers/immediate_buffer_size_kb", 2048);
+ uint32_t immediate_buffer_size = GLOBAL_DEF("rendering/limits/buffers/immediate_buffer_size_kb", 2048);
glGenBuffers(1, &state.immediate_buffer);
glBindBuffer(GL_ARRAY_BUFFER, state.immediate_buffer);
@@ -4672,13 +4914,13 @@ void RasterizerSceneGLES3::initialize() {
state.tonemap_shader.init();
{
- GLOBAL_DEF("rendering/ssurf_scattering/quality", 1);
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/ssurf_scattering/quality", PropertyInfo(Variant::INT, "rendering/ssurf_scattering/quality", PROPERTY_HINT_ENUM, "Low,Medium,High"));
- GLOBAL_DEF("rendering/ssurf_scattering/max_size", 1.0);
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/ssurf_scattering/max_size", PropertyInfo(Variant::INT, "rendering/ssurf_scattering/max_size", PROPERTY_HINT_RANGE, "0.01,8,0.01"));
- GLOBAL_DEF("rendering/ssurf_scattering/follow_surface", false);
+ GLOBAL_DEF("rendering/quality/subsurface_scattering/quality", 1);
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/subsurface_scattering/quality", PropertyInfo(Variant::INT, "rendering/quality/subsurface_scattering/quality", PROPERTY_HINT_ENUM, "Low,Medium,High"));
+ GLOBAL_DEF("rendering/quality/subsurface_scattering/scale", 1.0);
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/subsurface_scattering/scale", PropertyInfo(Variant::INT, "rendering/quality/subsurface_scattering/scale", PROPERTY_HINT_RANGE, "0.01,8,0.01"));
+ GLOBAL_DEF("rendering/quality/subsurface_scattering/follow_surface", false);
- GLOBAL_DEF("rendering/reflections/high_quality_vct_gi", true);
+ GLOBAL_DEF("rendering/quality/voxel_cone_tracing/high_quality", true);
}
exposure_shrink_size = 243;
@@ -4693,7 +4935,12 @@ void RasterizerSceneGLES3::initialize() {
glGenTextures(1, &e.color);
glBindTexture(GL_TEXTURE_2D, e.color);
+#ifdef IPHONE_ENABLED
+ ///@TODO ugly hack to get around iOS not supporting 32bit single channel floating point textures...
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_R16F, max_exposure_shrink_size, max_exposure_shrink_size, 0, GL_RED, GL_FLOAT, NULL);
+#else
glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, max_exposure_shrink_size, max_exposure_shrink_size, 0, GL_RED, GL_FLOAT, NULL);
+#endif
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, e.color, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -4706,16 +4953,18 @@ void RasterizerSceneGLES3::initialize() {
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
ERR_CONTINUE(status != GL_FRAMEBUFFER_COMPLETE);
}
+
+ state.debug_draw = VS::VIEWPORT_DEBUG_DRAW_DISABLED;
}
void RasterizerSceneGLES3::iteration() {
- shadow_filter_mode = ShadowFilterMode(int(GlobalConfig::get_singleton()->get("rendering/gles3/shadow_filter_mode")));
- subsurface_scatter_follow_surface = GlobalConfig::get_singleton()->get("rendering/ssurf_scattering/follow_surface");
- subsurface_scatter_quality = SubSurfaceScatterQuality(int(GlobalConfig::get_singleton()->get("rendering/ssurf_scattering/quality")));
- subsurface_scatter_size = GlobalConfig::get_singleton()->get("rendering/ssurf_scattering/max_size");
+ shadow_filter_mode = ShadowFilterMode(int(ProjectSettings::get_singleton()->get("rendering/quality/shadows/filter_mode")));
+ subsurface_scatter_follow_surface = ProjectSettings::get_singleton()->get("rendering/quality/subsurface_scattering/follow_surface");
+ subsurface_scatter_quality = SubSurfaceScatterQuality(int(ProjectSettings::get_singleton()->get("rendering/quality/subsurface_scattering/quality")));
+ subsurface_scatter_size = ProjectSettings::get_singleton()->get("rendering/quality/subsurface_scattering/scale");
- state.scene_shader.set_conditional(SceneShaderGLES3::VCT_QUALITY_HIGH, GlobalConfig::get_singleton()->get("rendering/reflections/high_quality_vct_gi"));
+ state.scene_shader.set_conditional(SceneShaderGLES3::VCT_QUALITY_HIGH, ProjectSettings::get_singleton()->get("rendering/quality/voxel_cone_tracing/high_quality"));
}
void RasterizerSceneGLES3::finalize() {
diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h
index b27bce726f..e1d96f23dd 100644
--- a/drivers/gles3/rasterizer_scene_gles3.h
+++ b/drivers/gles3/rasterizer_scene_gles3.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,17 +33,17 @@
/* Must come before shaders or the Windows build fails... */
#include "rasterizer_storage_gles3.h"
-#include "drivers/gles3/shaders/cube_to_dp.glsl.h"
-#include "drivers/gles3/shaders/effect_blur.glsl.h"
-#include "drivers/gles3/shaders/exposure.glsl.h"
-#include "drivers/gles3/shaders/resolve.glsl.h"
-#include "drivers/gles3/shaders/scene.glsl.h"
-#include "drivers/gles3/shaders/screen_space_reflection.glsl.h"
-#include "drivers/gles3/shaders/ssao.glsl.h"
-#include "drivers/gles3/shaders/ssao_blur.glsl.h"
-#include "drivers/gles3/shaders/ssao_minify.glsl.h"
-#include "drivers/gles3/shaders/subsurf_scattering.glsl.h"
-#include "drivers/gles3/shaders/tonemap.glsl.h"
+#include "drivers/gles3/shaders/cube_to_dp.glsl.gen.h"
+#include "drivers/gles3/shaders/effect_blur.glsl.gen.h"
+#include "drivers/gles3/shaders/exposure.glsl.gen.h"
+#include "drivers/gles3/shaders/resolve.glsl.gen.h"
+#include "drivers/gles3/shaders/scene.glsl.gen.h"
+#include "drivers/gles3/shaders/screen_space_reflection.glsl.gen.h"
+#include "drivers/gles3/shaders/ssao.glsl.gen.h"
+#include "drivers/gles3/shaders/ssao_blur.glsl.gen.h"
+#include "drivers/gles3/shaders/ssao_minify.glsl.gen.h"
+#include "drivers/gles3/shaders/subsurf_scattering.glsl.gen.h"
+#include "drivers/gles3/shaders/tonemap.glsl.gen.h"
class RasterizerSceneGLES3 : public RasterizerScene {
public:
@@ -76,6 +77,9 @@ public:
RID default_shader;
RID default_shader_twosided;
+ RID default_overdraw_material;
+ RID default_overdraw_shader;
+
RasterizerStorageGLES3 *storage;
Vector<RasterizerStorageGLES3::RenderTarget::Exposure> exposure_shrink;
@@ -107,22 +111,38 @@ public:
float projection_matrix[16];
float camera_inverse_matrix[16];
float camera_matrix[16];
- float time[4];
float ambient_light_color[4];
float bg_color[4];
+ float fog_color_enabled[4];
+ float fog_sun_color_amount[4];
+
float ambient_energy;
float bg_energy;
- float shadow_z_offset;
- float shadow_slope_scale;
+ float z_offset;
+ float z_slope_scale;
float shadow_dual_paraboloid_render_zfar;
float shadow_dual_paraboloid_render_side;
float screen_pixel_size[2];
float shadow_atlas_pixel_size[2];
float shadow_directional_pixel_size[2];
+
+ float time;
+ float z_far;
float reflection_multiplier;
float subsurface_scatter_width;
float ambient_occlusion_affect_light;
+ bool fog_depth_enabled;
+ float fog_depth_begin;
+ float fog_depth_curve;
+ bool fog_transmit_enabled;
+ float fog_transmit_curve;
+ bool fog_height_enabled;
+ float fog_height_min;
+ float fog_height_max;
+ float fog_height_curve;
+ uint8_t padding[8];
+
} ubo_data;
GLuint scene_ubo;
@@ -130,18 +150,15 @@ public:
struct EnvironmentRadianceUBO {
float transform[16];
- float box_min[4]; //unused for now
- float box_max[4];
float ambient_contribution;
+ uint8_t padding[12];
} env_radiance_data;
GLuint env_radiance_ubo;
- GLuint brdf_texture;
-
- GLuint skybox_verts;
- GLuint skybox_array;
+ GLuint sky_verts;
+ GLuint sky_array;
GLuint directional_ubo;
@@ -171,7 +188,10 @@ public:
bool cull_front;
bool used_sss;
+ bool used_screen_texture;
+ bool using_contact_shadows;
+ VS::ViewportDebugDraw debug_draw;
} state;
/* SHADOW ATLAS API */
@@ -328,25 +348,24 @@ public:
VS::EnvironmentBG bg_mode;
- RID skybox;
- float skybox_scale;
+ RID sky;
+ float sky_scale;
Color bg_color;
float bg_energy;
- float skybox_ambient;
+ float sky_ambient;
Color ambient_color;
float ambient_energy;
- float ambient_skybox_contribution;
+ float ambient_sky_contribution;
int canvas_max_layer;
bool ssr_enabled;
int ssr_max_steps;
- float ssr_accel;
- float ssr_fade;
+ float ssr_fade_in;
+ float ssr_fade_out;
float ssr_depth_tolerance;
- bool ssr_smooth;
bool ssr_roughness;
bool ssao_enabled;
@@ -365,7 +384,7 @@ public:
float glow_strength;
float glow_bloom;
VS::EnvironmentGlowBlendMode glow_blend_mode;
- float glow_hdr_bleed_treshold;
+ float glow_hdr_bleed_threshold;
float glow_hdr_bleed_scale;
bool glow_bicubic_upscale;
@@ -390,21 +409,41 @@ public:
float dof_blur_near_amount;
VS::EnvironmentDOFBlurQuality dof_blur_near_quality;
+ bool adjustments_enabled;
+ float adjustments_brightness;
+ float adjustments_contrast;
+ float adjustments_saturation;
+ RID color_correction;
+
+ bool fog_enabled;
+ Color fog_color;
+ Color fog_sun_color;
+ float fog_sun_amount;
+
+ bool fog_depth_enabled;
+ float fog_depth_begin;
+ float fog_depth_curve;
+ bool fog_transmit_enabled;
+ float fog_transmit_curve;
+ bool fog_height_enabled;
+ float fog_height_min;
+ float fog_height_max;
+ float fog_height_curve;
+
Environment() {
bg_mode = VS::ENV_BG_CLEAR_COLOR;
- skybox_scale = 1.0;
+ sky_scale = 1.0;
bg_energy = 1.0;
- skybox_ambient = 0;
+ sky_ambient = 0;
ambient_energy = 1.0;
- ambient_skybox_contribution = 0.0;
+ ambient_sky_contribution = 0.0;
canvas_max_layer = 0;
ssr_enabled = false;
ssr_max_steps = 64;
- ssr_accel = 0.04;
- ssr_fade = 2.0;
+ ssr_fade_in = 0.15;
+ ssr_fade_out = 2.0;
ssr_depth_tolerance = 0.2;
- ssr_smooth = true;
ssr_roughness = true;
ssao_enabled = false;
@@ -431,7 +470,7 @@ public:
glow_strength = 1.0;
glow_bloom = 0.0;
glow_blend_mode = VS::GLOW_BLEND_MODE_SOFTLIGHT;
- glow_hdr_bleed_treshold = 1.0;
+ glow_hdr_bleed_threshold = 1.0;
glow_hdr_bleed_scale = 2.0;
glow_bicubic_upscale = false;
@@ -446,6 +485,29 @@ public:
dof_blur_near_transition = 1;
dof_blur_near_amount = 0.1;
dof_blur_near_quality = VS::ENV_DOF_BLUR_QUALITY_MEDIUM;
+
+ adjustments_enabled = false;
+ adjustments_brightness = 1.0;
+ adjustments_contrast = 1.0;
+ adjustments_saturation = 1.0;
+
+ fog_enabled = false;
+ fog_color = Color(0.5, 0.5, 0.5);
+ fog_sun_color = Color(0.8, 0.8, 0.0);
+ fog_sun_amount = 0;
+
+ fog_depth_enabled = true;
+
+ fog_depth_begin = 10;
+ fog_depth_curve = 1;
+
+ fog_transmit_enabled = true;
+ fog_transmit_curve = 1;
+
+ fog_height_enabled = false;
+ fog_height_min = 0;
+ fog_height_max = 100;
+ fog_height_curve = 1;
}
};
@@ -454,25 +516,34 @@ public:
virtual RID environment_create();
virtual void environment_set_background(RID p_env, VS::EnvironmentBG p_bg);
- virtual void environment_set_skybox(RID p_env, RID p_skybox);
- virtual void environment_set_skybox_scale(RID p_env, float p_scale);
+ virtual void environment_set_sky(RID p_env, RID p_sky);
+ virtual void environment_set_sky_scale(RID p_env, float p_scale);
virtual void environment_set_bg_color(RID p_env, const Color &p_color);
virtual void environment_set_bg_energy(RID p_env, float p_energy);
virtual void environment_set_canvas_max_layer(RID p_env, int p_max_layer);
- virtual void environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy = 1.0, float p_skybox_contribution = 0.0);
+ virtual void environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy = 1.0, float p_sky_contribution = 0.0);
- virtual void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, VS::EnvironmentDOFBlurQuality p_quality);
- virtual void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, VS::EnvironmentDOFBlurQuality p_quality);
- virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_treshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_treshold, float p_hdr_bleed_scale, bool p_bicubic_upscale);
+ virtual void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, VS::EnvironmentDOFBlurQuality p_quality);
+ virtual void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, VS::EnvironmentDOFBlurQuality p_quality);
+ virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, bool p_bicubic_upscale);
virtual void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture);
- virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_accel, float p_fade, float p_depth_tolerance, bool p_smooth, bool p_roughness);
+ virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_in, float p_fade_out, float p_depth_tolerance, bool p_roughness);
virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_radius2, float p_intensity2, float p_intensity, float p_bias, float p_light_affect, const Color &p_color, bool p_blur);
virtual void environment_set_tonemap(RID p_env, VS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale);
virtual void environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp);
+ virtual void environment_set_fog(RID p_env, bool p_enable, const Color &p_color, const Color &p_sun_color, float p_sun_amount);
+ virtual void environment_set_fog_depth(RID p_env, bool p_enable, float p_depth_begin, float p_depth_curve, bool p_transmit, float p_transmit_curve);
+ virtual void environment_set_fog_height(RID p_env, bool p_enable, float p_min_height, float p_max_height, float p_height_curve);
+
+ virtual bool is_environment(RID p_env);
+
+ virtual VS::EnvironmentBG environment_get_background(RID p_env);
+ virtual int environment_get_canvas_max_layer(RID p_env);
+
/* LIGHT INSTANCE */
struct LightDataUBO {
@@ -498,6 +569,7 @@ public:
Transform transform;
float farplane;
float split;
+ float bias_scale;
};
ShadowTransform shadow_transform[4];
@@ -533,7 +605,7 @@ public:
virtual RID light_instance_create(RID p_light);
virtual void light_instance_set_transform(RID p_light_instance, const Transform &p_transform);
- virtual void light_instance_set_shadow_transform(RID p_light_instance, const CameraMatrix &p_projection, const Transform &p_transform, float p_far, float p_split, int p_pass);
+ virtual void light_instance_set_shadow_transform(RID p_light_instance, const CameraMatrix &p_projection, const Transform &p_transform, float p_far, float p_split, int p_pass, float p_bias_scale = 1.0);
virtual void light_instance_mark_visible(RID p_light_instance);
/* REFLECTION INSTANCE */
@@ -572,11 +644,13 @@ public:
MAX_REFLECTIONS = 1024,
SORT_KEY_DEPTH_LAYER_SHIFT = 60,
- SORT_KEY_UNSHADED_FLAG = uint64_t(1) << 59,
- SORT_KEY_NO_DIRECTIONAL_FLAG = uint64_t(1) << 58,
- SORT_KEY_GI_PROBES_FLAG = uint64_t(1) << 57,
- SORT_KEY_SHADING_SHIFT = 57,
- SORT_KEY_SHADING_MASK = 7,
+//64 bits unsupported in MSVC
+#define SORT_KEY_UNSHADED_FLAG (uint64_t(1) << 59)
+#define SORT_KEY_NO_DIRECTIONAL_FLAG (uint64_t(1) << 58)
+#define SORT_KEY_GI_PROBES_FLAG (uint64_t(1) << 57)
+#define SORT_KEY_VERTEX_LIT_FLAG (uint64_t(1) << 56)
+ SORT_KEY_SHADING_SHIFT = 56,
+ SORT_KEY_SHADING_MASK = 15,
SORT_KEY_MATERIAL_INDEX_SHIFT = 40,
SORT_KEY_GEOMETRY_INDEX_SHIFT = 20,
SORT_KEY_GEOMETRY_TYPE_SHIFT = 15,
@@ -596,7 +670,7 @@ public:
uint64_t sort_key;
};
- Element *_elements;
+ Element *base_elements;
Element **elements;
int element_count;
@@ -630,11 +704,11 @@ public:
struct SortByDepth {
_FORCE_INLINE_ bool operator()(const Element *A, const Element *B) const {
- return A->instance->depth > B->instance->depth;
+ return A->instance->depth < B->instance->depth;
}
};
- void sort_by_depth(bool p_alpha) {
+ void sort_by_depth(bool p_alpha) { //used for shadows
SortArray<Element *, SortByDepth> sorter;
if (p_alpha) {
@@ -644,11 +718,28 @@ public:
}
}
+ struct SortByReverseDepth {
+
+ _FORCE_INLINE_ bool operator()(const Element *A, const Element *B) const {
+ return A->instance->depth > B->instance->depth;
+ }
+ };
+
+ void sort_by_reverse_depth(bool p_alpha) { //used for alpha
+
+ SortArray<Element *, SortByReverseDepth> sorter;
+ if (p_alpha) {
+ sorter.sort(&elements[max_elements - alpha_element_count], alpha_element_count);
+ } else {
+ sorter.sort(elements, element_count);
+ }
+ }
+
_FORCE_INLINE_ Element *add_element() {
if (element_count + alpha_element_count >= max_elements)
return NULL;
- elements[element_count] = &_elements[element_count];
+ elements[element_count] = &base_elements[element_count];
return elements[element_count++];
}
@@ -657,7 +748,7 @@ public:
if (element_count + alpha_element_count >= max_elements)
return NULL;
int idx = max_elements - alpha_element_count - 1;
- elements[idx] = &_elements[idx];
+ elements[idx] = &base_elements[idx];
alpha_element_count++;
return elements[idx];
}
@@ -667,9 +758,9 @@ public:
element_count = 0;
alpha_element_count = 0;
elements = memnew_arr(Element *, max_elements);
- _elements = memnew_arr(Element, max_elements);
+ base_elements = memnew_arr(Element, max_elements);
for (int i = 0; i < max_elements; i++)
- elements[i] = &_elements[i]; // assign elements
+ elements[i] = &base_elements[i]; // assign elements
}
RenderList() {
@@ -679,7 +770,7 @@ public:
~RenderList() {
memdelete_arr(elements);
- memdelete_arr(_elements);
+ memdelete_arr(base_elements);
}
};
@@ -691,8 +782,7 @@ public:
_FORCE_INLINE_ void _set_cull(bool p_front, bool p_reverse_cull);
_FORCE_INLINE_ bool _setup_material(RasterizerStorageGLES3::Material *p_material, bool p_alpha_pass);
- _FORCE_INLINE_ void _setup_transform(InstanceBase *p_instance, const Transform &p_view_transform, const CameraMatrix &p_projection);
- _FORCE_INLINE_ void _setup_geometry(RenderList::Element *e);
+ _FORCE_INLINE_ void _setup_geometry(RenderList::Element *e, const Transform &p_view_transform);
_FORCE_INLINE_ void _render_geometry(RenderList::Element *e);
_FORCE_INLINE_ void _setup_light(RenderList::Element *e, const Transform &p_view_transform);
@@ -700,19 +790,22 @@ public:
_FORCE_INLINE_ void _add_geometry(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, int p_material, bool p_shadow);
- void _draw_skybox(RasterizerStorageGLES3::SkyBox *p_skybox, const CameraMatrix &p_projection, const Transform &p_transform, bool p_vflip, float p_scale);
+ _FORCE_INLINE_ void _add_geometry_with_material(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, RasterizerStorageGLES3::Material *p_material, bool p_shadow);
+
+ void _draw_sky(RasterizerStorageGLES3::Sky *p_sky, const CameraMatrix &p_projection, const Transform &p_transform, bool p_vflip, float p_scale, float p_energy);
void _setup_environment(Environment *env, const CameraMatrix &p_cam_projection, const Transform &p_cam_transform);
- void _setup_directional_light(int p_index, const Transform &p_camera_inverse_transformm, bool p_use_shadows);
+ void _setup_directional_light(int p_index, const Transform &p_camera_inverse_transform, bool p_use_shadows);
void _setup_lights(RID *p_light_cull_result, int p_light_cull_count, const Transform &p_camera_inverse_transform, const CameraMatrix &p_camera_projection, RID p_shadow_atlas);
void _setup_reflections(RID *p_reflection_probe_cull_result, int p_reflection_probe_cull_count, const Transform &p_camera_inverse_transform, const CameraMatrix &p_camera_projection, RID p_reflection_atlas, Environment *p_env);
- void _copy_screen();
+ void _copy_screen(bool p_invalidate_color = false, bool p_invalidate_depth = false);
void _copy_to_front_buffer(Environment *env);
void _copy_texture_to_front_buffer(GLuint p_texture); //used for debug
void _fill_render_list(InstanceBase **p_cull_result, int p_cull_count, bool p_shadow);
+ void _blur_effect_buffer();
void _render_mrts(Environment *env, const CameraMatrix &p_cam_projection);
void _post_process(Environment *env, const CameraMatrix &p_cam_projection);
@@ -720,9 +813,8 @@ public:
virtual void render_shadow(RID p_light, RID p_shadow_atlas, int p_pass, InstanceBase **p_cull_result, int p_cull_count);
virtual bool free(RID p_rid);
- void _generate_brdf();
-
virtual void set_scene_pass(uint64_t p_pass);
+ virtual void set_debug_draw_mode(VS::ViewportDebugDraw p_debug_draw);
void iteration();
void initialize();
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 4fcd09ed58..24fa117051 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "rasterizer_storage_gles3.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "rasterizer_canvas_gles3.h"
#include "rasterizer_scene_gles3.h"
@@ -98,13 +99,28 @@
#define _EXT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E
#define _EXT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F
+void glTexStorage2DCustom(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type) {
+
+#ifdef GLES_OVER_GL
+
+ for (int i = 0; i < levels; i++) {
+ glTexImage2D(target, i, internalformat, width, height, 0, format, type, NULL);
+ width = MAX(1, (width / 2));
+ height = MAX(1, (height / 2));
+ }
+
+#else
+ glTexStorage2D(target, levels, internalformat, width, height);
+#endif
+}
+
GLuint RasterizerStorageGLES3::system_fbo = 0;
-Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image &p_image, Image::Format p_format, uint32_t p_flags, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool &srgb) {
+Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool &srgb) {
r_compressed = false;
r_gl_format = 0;
- Image image = p_image;
+ Ref<Image> image = p_image;
srgb = false;
bool need_decompress = false;
@@ -163,18 +179,6 @@ Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image &p_image, Ima
srgb = true;
} break;
- case Image::FORMAT_RGB565: {
-#ifndef GLES_OVER_GL
- r_gl_internal_format = GL_RGB565;
-#else
- //#warning TODO: Convert tod 555 if 565 is not supported (GLES3.3-)
- r_gl_internal_format = GL_RGB5;
-#endif
- //r_gl_internal_format=GL_RGB565;
- r_gl_format = GL_RGB;
- r_gl_type = GL_UNSIGNED_SHORT_5_6_5;
-
- } break;
case Image::FORMAT_RGBA4444: {
r_gl_internal_format = GL_RGBA4;
@@ -240,11 +244,17 @@ Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image &p_image, Ima
r_gl_type = GL_HALF_FLOAT;
} break;
+ case Image::FORMAT_RGBE9995: {
+ r_gl_internal_format = GL_RGB9_E5;
+ r_gl_format = GL_RGB;
+ r_gl_type = GL_UNSIGNED_INT_5_9_9_9_REV;
+
+ } break;
case Image::FORMAT_DXT1: {
if (config.s3tc_supported) {
- r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB_S3TC_DXT1_NV : _EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV : _EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT;
r_gl_format = GL_RGBA;
r_gl_type = GL_UNSIGNED_BYTE;
r_compressed = true;
@@ -288,15 +298,14 @@ Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image &p_image, Ima
}
} break;
- case Image::FORMAT_ATI1: {
+ case Image::FORMAT_RGTC_R: {
- if (config.latc_supported) {
+ if (config.rgtc_supported) {
- r_gl_internal_format = _EXT_COMPRESSED_LUMINANCE_LATC1_EXT;
+ r_gl_internal_format = _EXT_COMPRESSED_RED_RGTC1_EXT;
r_gl_format = GL_RGBA;
r_gl_type = GL_UNSIGNED_BYTE;
r_compressed = true;
- srgb = true;
} else {
@@ -304,11 +313,11 @@ Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image &p_image, Ima
}
} break;
- case Image::FORMAT_ATI2: {
+ case Image::FORMAT_RGTC_RG: {
- if (config.latc_supported) {
+ if (config.rgtc_supported) {
- r_gl_internal_format = _EXT_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT;
+ r_gl_internal_format = _EXT_COMPRESSED_RED_GREEN_RGTC2_EXT;
r_gl_format = GL_RGBA;
r_gl_type = GL_UNSIGNED_BYTE;
r_compressed = true;
@@ -537,16 +546,17 @@ Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image &p_image, Ima
} break;
default: {
- ERR_FAIL_V(Image());
+ ERR_FAIL_V(Ref<Image>());
}
}
if (need_decompress) {
- if (!image.empty()) {
- image.decompress();
- ERR_FAIL_COND_V(image.is_compressed(), image);
- image.convert(Image::FORMAT_RGBA8);
+ if (!image.is_null()) {
+ image = image->duplicate();
+ image->decompress();
+ ERR_FAIL_COND_V(image->is_compressed(), image);
+ image->convert(Image::FORMAT_RGBA8);
}
r_gl_format = GL_RGBA;
@@ -606,7 +616,7 @@ void RasterizerStorageGLES3::texture_allocate(RID p_texture, int p_width, int p_
texture->stored_cube_sides = 0;
texture->target = (p_flags & VS::TEXTURE_FLAG_CUBEMAP) ? GL_TEXTURE_CUBE_MAP : GL_TEXTURE_2D;
- _get_gl_image_and_format(Image(), texture->format, texture->flags, format, internal_format, type, compressed, srgb);
+ _get_gl_image_and_format(Ref<Image>(), texture->format, texture->flags, format, internal_format, type, compressed, srgb);
texture->alloc_width = texture->width;
texture->alloc_height = texture->height;
@@ -630,15 +640,15 @@ void RasterizerStorageGLES3::texture_allocate(RID p_texture, int p_width, int p_
texture->active = true;
}
-void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Image &p_image, VS::CubeMapSide p_cube_side) {
+void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p_image, VS::CubeMapSide p_cube_side) {
Texture *texture = texture_owner.get(p_texture);
ERR_FAIL_COND(!texture);
ERR_FAIL_COND(!texture->active);
ERR_FAIL_COND(texture->render_target);
- ERR_FAIL_COND(texture->format != p_image.get_format());
- ERR_FAIL_COND(p_image.empty());
+ ERR_FAIL_COND(texture->format != p_image->get_format());
+ ERR_FAIL_COND(p_image.is_null());
GLenum type;
GLenum format;
@@ -650,31 +660,31 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Image &p_imag
texture->images[p_cube_side] = p_image;
}
- Image img = _get_gl_image_and_format(p_image, p_image.get_format(), texture->flags, format, internal_format, type, compressed, srgb);
+ Ref<Image> img = _get_gl_image_and_format(p_image, p_image->get_format(), texture->flags, format, internal_format, type, compressed, srgb);
- if (config.shrink_textures_x2 && (p_image.has_mipmaps() || !p_image.is_compressed()) && !(texture->flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING)) {
+ if (config.shrink_textures_x2 && (p_image->has_mipmaps() || !p_image->is_compressed()) && !(texture->flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING)) {
texture->alloc_height = MAX(1, texture->alloc_height / 2);
texture->alloc_width = MAX(1, texture->alloc_width / 2);
- if (texture->alloc_width == img.get_width() / 2 && texture->alloc_height == img.get_height() / 2) {
+ if (texture->alloc_width == img->get_width() / 2 && texture->alloc_height == img->get_height() / 2) {
- img.shrink_x2();
- } else if (img.get_format() <= Image::FORMAT_RGB565) {
+ img->shrink_x2();
+ } else if (img->get_format() <= Image::FORMAT_RGBA8) {
- img.resize(texture->alloc_width, texture->alloc_height, Image::INTERPOLATE_BILINEAR);
+ img->resize(texture->alloc_width, texture->alloc_height, Image::INTERPOLATE_BILINEAR);
}
};
GLenum blit_target = (texture->target == GL_TEXTURE_CUBE_MAP) ? _cube_side_enum[p_cube_side] : GL_TEXTURE_2D;
- texture->data_size = img.get_data().size();
- PoolVector<uint8_t>::Read read = img.get_data().read();
+ texture->data_size = img->get_data().size();
+ PoolVector<uint8_t>::Read read = img->get_data().read();
glActiveTexture(GL_TEXTURE0);
glBindTexture(texture->target, texture->tex_id);
- texture->ignore_mipmaps = compressed && !img.has_mipmaps();
+ texture->ignore_mipmaps = compressed && !img->has_mipmaps();
if (texture->flags & VS::TEXTURE_FLAG_MIPMAPS && !texture->ignore_mipmaps)
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, config.use_fast_texture_filter ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR_MIPMAP_LINEAR);
@@ -760,22 +770,33 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Image &p_imag
}
}
- int mipmaps = (texture->flags & VS::TEXTURE_FLAG_MIPMAPS && img.has_mipmaps()) ? img.get_mipmap_count() + 1 : 1;
+ int mipmaps = (texture->flags & VS::TEXTURE_FLAG_MIPMAPS && img->has_mipmaps()) ? img->get_mipmap_count() + 1 : 1;
- int w = img.get_width();
- int h = img.get_height();
+ int w = img->get_width();
+ int h = img->get_height();
int tsize = 0;
+
+ int block = Image::get_format_block_size(img->get_format());
+
for (int i = 0; i < mipmaps; i++) {
int size, ofs;
- img.get_mipmap_offset_and_size(i, ofs, size);
+ img->get_mipmap_offset_and_size(i, ofs, size);
//print_line("mipmap: "+itos(i)+" size: "+itos(size)+" w: "+itos(mm_w)+", h: "+itos(mm_h));
if (texture->compressed) {
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
- glCompressedTexImage2D(blit_target, i, internal_format, w, h, 0, size, &read[ofs]);
+
+ //this is not needed, as compressed takes the regular size, even if blocks extend it
+ //int bw = (w % block != 0) ? w + (block - w % block) : w;
+ //int bh = (h % block != 0) ? h + (block - h % block) : h;
+
+ int bw = w;
+ int bh = h;
+
+ glCompressedTexImage2D(blit_target, i, internal_format, bw, bh, 0, size, &read[ofs]);
} else {
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
@@ -812,19 +833,17 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Image &p_imag
//texture_set_flags(p_texture,texture->flags);
}
-Image RasterizerStorageGLES3::texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side) const {
+Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side) const {
Texture *texture = texture_owner.get(p_texture);
- ERR_FAIL_COND_V(!texture, Image());
- ERR_FAIL_COND_V(!texture->active, Image());
- ERR_FAIL_COND_V(texture->data_size == 0, Image());
- ERR_FAIL_COND_V(texture->render_target, Image());
+ ERR_FAIL_COND_V(!texture, Ref<Image>());
+ ERR_FAIL_COND_V(!texture->active, Ref<Image>());
+ ERR_FAIL_COND_V(texture->data_size == 0 && !texture->render_target, Ref<Image>());
- if (!texture->images[p_cube_side].empty()) {
+ if (!texture->images[p_cube_side].is_null()) {
return texture->images[p_cube_side];
}
- print_line("GETTING FROM GL ");
#ifdef GLES_OVER_GL
@@ -841,7 +860,7 @@ Image RasterizerStorageGLES3::texture_get_data(RID p_texture, VS::CubeMapSide p_
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
- print_line("GET FORMAT: " + Image::get_format_name(texture->format) + " mipmaps: " + itos(texture->mipmaps));
+ //print_line("GET FORMAT: " + Image::get_format_name(texture->format) + " mipmaps: " + itos(texture->mipmaps));
for (int i = 0; i < texture->mipmaps; i++) {
@@ -867,13 +886,13 @@ Image RasterizerStorageGLES3::texture_get_data(RID p_texture, VS::CubeMapSide p_
data.resize(data_size);
- Image img(texture->alloc_width, texture->alloc_height, texture->mipmaps > 1 ? true : false, texture->format, data);
+ Image *img = memnew(Image(texture->alloc_width, texture->alloc_height, texture->mipmaps > 1 ? true : false, texture->format, data));
- return img;
+ return Ref<Image>(img);
#else
ERR_EXPLAIN("Sorry, It's not posible to obtain images back in OpenGL ES");
- return Image();
+ return Ref<Image>();
#endif
}
@@ -969,6 +988,14 @@ Image::Format RasterizerStorageGLES3::texture_get_format(RID p_texture) const {
return texture->format;
}
+uint32_t RasterizerStorageGLES3::texture_get_texid(RID p_texture) const {
+
+ Texture *texture = texture_owner.get(p_texture);
+
+ ERR_FAIL_COND_V(!texture, 0);
+
+ return texture->tex_id;
+}
uint32_t RasterizerStorageGLES3::texture_get_width(RID p_texture) const {
Texture *texture = texture_owner.get(p_texture);
@@ -1060,6 +1087,14 @@ void RasterizerStorageGLES3::texture_set_detect_srgb_callback(RID p_texture, Vis
texture->detect_srgb_ud = p_userdata;
}
+void RasterizerStorageGLES3::texture_set_detect_normal_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata) {
+ Texture *texture = texture_owner.get(p_texture);
+ ERR_FAIL_COND(!texture);
+
+ texture->detect_normal = p_callback;
+ texture->detect_normal_ud = p_userdata;
+}
+
RID RasterizerStorageGLES3::texture_create_radiance_cubemap(RID p_source, int p_resolution) const {
Texture *texture = texture_owner.get(p_source);
@@ -1204,32 +1239,32 @@ RID RasterizerStorageGLES3::texture_create_radiance_cubemap(RID p_source, int p_
return texture_owner.make_rid(ctex);
}
-RID RasterizerStorageGLES3::skybox_create() {
+RID RasterizerStorageGLES3::sky_create() {
- SkyBox *skybox = memnew(SkyBox);
- skybox->radiance = 0;
- return skybox_owner.make_rid(skybox);
+ Sky *sky = memnew(Sky);
+ sky->radiance = 0;
+ return sky_owner.make_rid(sky);
}
-void RasterizerStorageGLES3::skybox_set_texture(RID p_skybox, RID p_cube_map, int p_radiance_size) {
+void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_radiance_size) {
- SkyBox *skybox = skybox_owner.getornull(p_skybox);
- ERR_FAIL_COND(!skybox);
+ Sky *sky = sky_owner.getornull(p_sky);
+ ERR_FAIL_COND(!sky);
- if (skybox->cubemap.is_valid()) {
- skybox->cubemap = RID();
- glDeleteTextures(1, &skybox->radiance);
- skybox->radiance = 0;
+ if (sky->panorama.is_valid()) {
+ sky->panorama = RID();
+ glDeleteTextures(1, &sky->radiance);
+ sky->radiance = 0;
}
- skybox->cubemap = p_cube_map;
- if (!skybox->cubemap.is_valid())
+ sky->panorama = p_panorama;
+ if (!sky->panorama.is_valid())
return; //cleared
- Texture *texture = texture_owner.getornull(skybox->cubemap);
- if (!texture || !(texture->flags & VS::TEXTURE_FLAG_CUBEMAP)) {
- skybox->cubemap = RID();
- ERR_FAIL_COND(!texture || !(texture->flags & VS::TEXTURE_FLAG_CUBEMAP));
+ Texture *texture = texture_owner.getornull(sky->panorama);
+ if (!texture) {
+ sky->panorama = RID();
+ ERR_FAIL_COND(!texture);
}
glBindVertexArray(0);
@@ -1240,6 +1275,10 @@ void RasterizerStorageGLES3::skybox_set_texture(RID p_skybox, RID p_cube_map, in
glActiveTexture(GL_TEXTURE0);
glBindTexture(texture->target, texture->tex_id);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); //need this for proper sampling
if (config.srgb_decode_supported && texture->srgb && !texture->using_srgb) {
@@ -1254,96 +1293,203 @@ void RasterizerStorageGLES3::skybox_set_texture(RID p_skybox, RID p_cube_map, in
}
glActiveTexture(GL_TEXTURE1);
- glGenTextures(1, &skybox->radiance);
- glBindTexture(GL_TEXTURE_2D, skybox->radiance);
+ glGenTextures(1, &sky->radiance);
- GLuint tmp_fb;
+ if (config.use_texture_array_environment) {
- glGenFramebuffers(1, &tmp_fb);
- glBindFramebuffer(GL_FRAMEBUFFER, tmp_fb);
+ //texture3D
+ glBindTexture(GL_TEXTURE_2D_ARRAY, sky->radiance);
- int size = p_radiance_size;
+ GLuint tmp_fb;
- int lod = 0;
+ glGenFramebuffers(1, &tmp_fb);
+ glBindFramebuffer(GL_FRAMEBUFFER, tmp_fb);
- int mipmaps = 6;
+ int size = p_radiance_size;
- int mm_level = mipmaps;
+ int array_level = 6;
- bool use_float = config.hdr_supported;
+ bool use_float = config.hdr_supported;
- GLenum internal_format = use_float ? GL_RGBA16F : GL_RGB10_A2;
- GLenum format = GL_RGBA;
- GLenum type = use_float ? GL_HALF_FLOAT : GL_UNSIGNED_INT_2_10_10_10_REV;
+ GLenum internal_format = use_float ? GL_RGBA16F : GL_RGB10_A2;
+ GLenum format = GL_RGBA;
+ GLenum type = use_float ? GL_HALF_FLOAT : GL_UNSIGNED_INT_2_10_10_10_REV;
- while (mm_level) {
+ glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, internal_format, size, size * 2, array_level, 0, format, type, NULL);
- glTexImage2D(GL_TEXTURE_2D, lod, internal_format, size, size * 2, 0, format, type, NULL);
- lod++;
- mm_level--;
+ glTexParameterf(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- if (size > 1)
- size >>= 1;
- }
+ GLuint tmp_fb2;
+ GLuint tmp_tex;
+ {
+ //generate another one for rendering, as can't read and write from a single texarray it seems
+ glGenFramebuffers(1, &tmp_fb2);
+ glBindFramebuffer(GL_FRAMEBUFFER, tmp_fb2);
+ glGenTextures(1, &tmp_tex);
+ glBindTexture(GL_TEXTURE_2D, tmp_tex);
+ glTexImage2D(GL_TEXTURE_2D, 0, internal_format, size, size * 2, 0, format, type, NULL);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tmp_tex, 0);
+ glTexParameterf(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+#ifdef DEBUG_ENABLED
+ GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
+#endif
+ }
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, lod - 1);
+ for (int j = 0; j < array_level; j++) {
- lod = 0;
- mm_level = mipmaps;
+ glBindFramebuffer(GL_FRAMEBUFFER, tmp_fb2);
- size = p_radiance_size;
+ if (j == 0) {
- shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID, true);
- shaders.cubemap_filter.bind();
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID, true);
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_SOURCE_PANORAMA, true);
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DIRECT_WRITE, true);
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_SOURCE_DUAL_PARABOLOID_ARRAY, false);
+ shaders.cubemap_filter.bind();
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(texture->target, texture->tex_id);
+ } else {
- while (mm_level) {
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID, true);
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_SOURCE_PANORAMA, false);
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_SOURCE_DUAL_PARABOLOID_ARRAY, true);
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DIRECT_WRITE, false);
+ shaders.cubemap_filter.bind();
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D_ARRAY, sky->radiance);
+ shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::SOURCE_ARRAY_INDEX, j - 1); //read from previous to ensure better blur
+ }
+
+ for (int i = 0; i < 2; i++) {
+ glViewport(0, i * size, size, size);
+ glBindVertexArray(resources.quadie_array);
+
+ shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::Z_FLIP, i > 0);
+ shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::ROUGHNESS, j / float(array_level - 1));
+
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ glBindVertexArray(0);
+ }
+
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, tmp_fb);
+ glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, sky->radiance, 0, j);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, tmp_fb2);
+ glReadBuffer(GL_COLOR_ATTACHMENT0);
+ glBlitFramebuffer(0, 0, size, size * 2, 0, 0, size, size * 2, GL_COLOR_BUFFER_BIT, GL_NEAREST);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ }
+
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_SOURCE_PANORAMA, false);
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID, false);
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_SOURCE_DUAL_PARABOLOID_ARRAY, false);
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DIRECT_WRITE, false);
+
+ //restore ranges
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D_ARRAY, sky->radiance);
+
+ glGenerateMipmap(GL_TEXTURE_2D_ARRAY);
+
+ glTexParameterf(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, skybox->radiance, lod);
+ glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
+ glDeleteFramebuffers(1, &tmp_fb);
+ glDeleteFramebuffers(1, &tmp_fb2);
+ glDeleteTextures(1, &tmp_tex);
+
+ } else {
+ //regular single texture with mipmaps
+ glBindTexture(GL_TEXTURE_2D, sky->radiance);
+
+ GLuint tmp_fb;
+
+ glGenFramebuffers(1, &tmp_fb);
+ glBindFramebuffer(GL_FRAMEBUFFER, tmp_fb);
+
+ int size = p_radiance_size;
+
+ int lod = 0;
+
+ int mipmaps = 6;
+
+ int mm_level = mipmaps;
+
+ bool use_float = config.hdr_supported;
+
+ GLenum internal_format = use_float ? GL_RGBA16F : GL_RGB10_A2;
+ GLenum format = GL_RGBA;
+ GLenum type = use_float ? GL_HALF_FLOAT : GL_UNSIGNED_INT_2_10_10_10_REV;
+
+ glTexStorage2DCustom(GL_TEXTURE_2D, mipmaps, internal_format, size, size * 2.0, format, type);
+
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, mipmaps - 1);
+
+ lod = 0;
+ mm_level = mipmaps;
+
+ size = p_radiance_size;
+
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID, true);
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_SOURCE_PANORAMA, true);
+ shaders.cubemap_filter.bind();
+
+ while (mm_level) {
+
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, sky->radiance, lod);
#ifdef DEBUG_ENABLED
- GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
- ERR_CONTINUE(status != GL_FRAMEBUFFER_COMPLETE);
+ GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ ERR_CONTINUE(status != GL_FRAMEBUFFER_COMPLETE);
#endif
- for (int i = 0; i < 2; i++) {
- glViewport(0, i * size, size, size);
- glBindVertexArray(resources.quadie_array);
+ for (int i = 0; i < 2; i++) {
+ glViewport(0, i * size, size, size);
+ glBindVertexArray(resources.quadie_array);
- shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::Z_FLIP, i > 0);
- shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::ROUGHNESS, lod / float(mipmaps - 1));
+ shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::Z_FLIP, i > 0);
+ shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::ROUGHNESS, lod / float(mipmaps - 1));
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- glBindVertexArray(0);
- }
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ glBindVertexArray(0);
+ }
- if (size > 1)
- size >>= 1;
- lod++;
- mm_level--;
- }
- shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID, false);
+ if (size > 1)
+ size >>= 1;
+ lod++;
+ mm_level--;
+ }
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID, false);
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_SOURCE_PANORAMA, false);
- //restore ranges
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, lod - 1);
+ //restore ranges
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, lod - 1);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
- glDeleteFramebuffers(1, &tmp_fb);
+ glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
+ glDeleteFramebuffers(1, &tmp_fb);
+ }
}
/* SHADER API */
-RID RasterizerStorageGLES3::shader_create(VS::ShaderMode p_mode) {
+RID RasterizerStorageGLES3::shader_create() {
Shader *shader = memnew(Shader);
- shader->mode = p_mode;
+ shader->mode = VS::SHADER_SPATIAL;
+ shader->shader = &scene->state.scene_shader;
RID rid = shader_owner.make_rid(shader);
- shader_set_mode(rid, p_mode);
_shader_make_dirty(shader);
shader->self = rid;
@@ -1358,22 +1504,30 @@ void RasterizerStorageGLES3::_shader_make_dirty(Shader *p_shader) {
_shader_dirty_list.add(&p_shader->dirty_list);
}
-void RasterizerStorageGLES3::shader_set_mode(RID p_shader, VS::ShaderMode p_mode) {
+void RasterizerStorageGLES3::shader_set_code(RID p_shader, const String &p_code) {
- ERR_FAIL_INDEX(p_mode, VS::SHADER_MAX);
Shader *shader = shader_owner.get(p_shader);
ERR_FAIL_COND(!shader);
- if (shader->custom_code_id && p_mode == shader->mode)
- return;
+ shader->code = p_code;
+
+ String mode_string = ShaderLanguage::get_shader_type(p_code);
+ VS::ShaderMode mode;
+
+ if (mode_string == "canvas_item")
+ mode = VS::SHADER_CANVAS_ITEM;
+ else if (mode_string == "particles")
+ mode = VS::SHADER_PARTICLES;
+ else
+ mode = VS::SHADER_SPATIAL;
- if (shader->custom_code_id) {
+ if (shader->custom_code_id && mode != shader->mode) {
shader->shader->free_custom_shader(shader->custom_code_id);
shader->custom_code_id = 0;
}
- shader->mode = p_mode;
+ shader->mode = mode;
ShaderGLES3 *shaders[VS::SHADER_MAX] = {
&scene->state.scene_shader,
@@ -1382,25 +1536,12 @@ void RasterizerStorageGLES3::shader_set_mode(RID p_shader, VS::ShaderMode p_mode
};
- shader->shader = shaders[p_mode];
-
- shader->custom_code_id = shader->shader->create_custom_shader();
-
- _shader_make_dirty(shader);
-}
-VS::ShaderMode RasterizerStorageGLES3::shader_get_mode(RID p_shader) const {
+ shader->shader = shaders[mode];
- const Shader *shader = shader_owner.get(p_shader);
- ERR_FAIL_COND_V(!shader, VS::SHADER_MAX);
-
- return shader->mode;
-}
-void RasterizerStorageGLES3::shader_set_code(RID p_shader, const String &p_code) {
-
- Shader *shader = shader_owner.get(p_shader);
- ERR_FAIL_COND(!shader);
+ if (shader->custom_code_id == 0) {
+ shader->custom_code_id = shader->shader->create_custom_shader();
+ }
- shader->code = p_code;
_shader_make_dirty(shader);
}
String RasterizerStorageGLES3::shader_get_code(RID p_shader) const {
@@ -1416,6 +1557,7 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
_shader_dirty_list.remove(&p_shader->dirty_list);
p_shader->valid = false;
+ p_shader->ubo_size = 0;
p_shader->uniforms.clear();
@@ -1427,6 +1569,8 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
p_shader->canvas_item.light_mode = Shader::CanvasItem::LIGHT_MODE_NORMAL;
p_shader->canvas_item.blend_mode = Shader::CanvasItem::BLEND_MODE_MIX;
+ p_shader->canvas_item.uses_screen_texture = false;
+ p_shader->canvas_item.uses_screen_uv = false;
shaders.actions_canvas.render_mode_values["blend_add"] = Pair<int *, int>(&p_shader->canvas_item.blend_mode, Shader::CanvasItem::BLEND_MODE_ADD);
shaders.actions_canvas.render_mode_values["blend_mix"] = Pair<int *, int>(&p_shader->canvas_item.blend_mode, Shader::CanvasItem::BLEND_MODE_MIX);
@@ -1437,6 +1581,10 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
shaders.actions_canvas.render_mode_values["unshaded"] = Pair<int *, int>(&p_shader->canvas_item.light_mode, Shader::CanvasItem::LIGHT_MODE_UNSHADED);
shaders.actions_canvas.render_mode_values["light_only"] = Pair<int *, int>(&p_shader->canvas_item.light_mode, Shader::CanvasItem::LIGHT_MODE_LIGHT_ONLY);
+ shaders.actions_canvas.usage_flag_pointers["SCREEN_UV"] = &p_shader->canvas_item.uses_screen_uv;
+ shaders.actions_canvas.usage_flag_pointers["SCREEN_PIXEL_SIZE"] = &p_shader->canvas_item.uses_screen_uv;
+ shaders.actions_canvas.usage_flag_pointers["SCREEN_TEXTURE"] = &p_shader->canvas_item.uses_screen_texture;
+
actions = &shaders.actions_canvas;
actions->uniforms = &p_shader->uniforms;
@@ -1448,11 +1596,15 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
p_shader->spatial.depth_draw_mode = Shader::Spatial::DEPTH_DRAW_OPAQUE;
p_shader->spatial.cull_mode = Shader::Spatial::CULL_MODE_BACK;
p_shader->spatial.uses_alpha = false;
+ p_shader->spatial.uses_alpha_scissor = false;
p_shader->spatial.uses_discard = false;
p_shader->spatial.unshaded = false;
p_shader->spatial.ontop = false;
p_shader->spatial.uses_sss = false;
+ p_shader->spatial.uses_vertex_lighting = false;
+ p_shader->spatial.uses_screen_texture = false;
p_shader->spatial.uses_vertex = false;
+ p_shader->spatial.writes_modelview_or_projection = false;
shaders.actions_scene.render_mode_values["blend_add"] = Pair<int *, int>(&p_shader->spatial.blend_mode, Shader::Spatial::BLEND_MODE_ADD);
shaders.actions_scene.render_mode_values["blend_mix"] = Pair<int *, int>(&p_shader->spatial.blend_mode, Shader::Spatial::BLEND_MODE_MIX);
@@ -1471,11 +1623,18 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
shaders.actions_scene.render_mode_flags["unshaded"] = &p_shader->spatial.unshaded;
shaders.actions_scene.render_mode_flags["ontop"] = &p_shader->spatial.ontop;
+ shaders.actions_scene.render_mode_flags["vertex_lighting"] = &p_shader->spatial.uses_vertex_lighting;
+
shaders.actions_scene.usage_flag_pointers["ALPHA"] = &p_shader->spatial.uses_alpha;
+ shaders.actions_scene.usage_flag_pointers["ALPHA_SCISSOR"] = &p_shader->spatial.uses_alpha_scissor;
shaders.actions_scene.usage_flag_pointers["VERTEX"] = &p_shader->spatial.uses_vertex;
shaders.actions_scene.usage_flag_pointers["SSS_STRENGTH"] = &p_shader->spatial.uses_sss;
shaders.actions_scene.usage_flag_pointers["DISCARD"] = &p_shader->spatial.uses_discard;
+ shaders.actions_scene.usage_flag_pointers["SCREEN_TEXTURE"] = &p_shader->spatial.uses_screen_texture;
+
+ shaders.actions_scene.write_flag_pointers["MODELVIEW_MATRIX"] = &p_shader->spatial.writes_modelview_or_projection;
+ shaders.actions_scene.write_flag_pointers["PROJECTION_MATRIX"] = &p_shader->spatial.writes_modelview_or_projection;
actions = &shaders.actions_scene;
actions->uniforms = &p_shader->uniforms;
@@ -1532,7 +1691,11 @@ void RasterizerStorageGLES3::shader_get_param_list(RID p_shader, List<PropertyIn
for (Map<StringName, ShaderLanguage::ShaderNode::Uniform>::Element *E = shader->uniforms.front(); E; E = E->next()) {
- order[E->get().order] = E->key();
+ if (E->get().texture_order >= 0) {
+ order[E->get().texture_order + 100000] = E->key();
+ } else {
+ order[E->get().order] = E->key();
+ }
}
for (Map<int, StringName>::Element *E = order.front(); E; E = E->next()) {
@@ -1719,6 +1882,14 @@ void RasterizerStorageGLES3::material_set_line_width(RID p_material, float p_wid
material->line_width = p_width;
}
+void RasterizerStorageGLES3::material_set_next_pass(RID p_material, RID p_next_material) {
+
+ Material *material = material_owner.get(p_material);
+ ERR_FAIL_COND(!material);
+
+ material->next_pass = p_next_material;
+}
+
bool RasterizerStorageGLES3::material_is_animated(RID p_material) {
Material *material = material_owner.get(p_material);
@@ -1727,7 +1898,11 @@ bool RasterizerStorageGLES3::material_is_animated(RID p_material) {
_update_material(material);
}
- return material->is_animated_cache;
+ bool animated = material->is_animated_cache;
+ if (!animated && material->next_pass.is_valid()) {
+ animated = material_is_animated(material->next_pass);
+ }
+ return animated;
}
bool RasterizerStorageGLES3::material_casts_shadows(RID p_material) {
@@ -1737,7 +1912,13 @@ bool RasterizerStorageGLES3::material_casts_shadows(RID p_material) {
_update_material(material);
}
- return material->can_cast_shadow_cache;
+ bool casts_shadows = material->can_cast_shadow_cache;
+
+ if (!casts_shadows && material->next_pass.is_valid()) {
+ casts_shadows = material_casts_shadows(material->next_pass);
+ }
+
+ return casts_shadows;
}
void RasterizerStorageGLES3::material_add_instance_owner(RID p_material, RasterizerScene::InstanceBase *p_instance) {
@@ -1946,8 +2127,8 @@ _FORCE_INLINE_ static void _fill_std140_variant_ubo_value(ShaderLanguage::DataTy
} else if (value.get_type() == Variant::RECT2) {
Rect2 v = value;
- gui[0] = v.pos.x;
- gui[1] = v.pos.y;
+ gui[0] = v.position.x;
+ gui[1] = v.position.y;
gui[2] = v.size.x;
gui[3] = v.size.y;
} else if (value.get_type() == Variant::QUAT) {
@@ -2229,6 +2410,10 @@ void RasterizerStorageGLES3::_update_material(Material *material) {
if (material->shader && material->shader->dirty_list.in_list()) {
_update_shader(material->shader);
}
+
+ if (material->shader && !material->shader->valid)
+ return;
+
//update caches
{
@@ -2294,6 +2479,9 @@ void RasterizerStorageGLES3::_update_material(Material *material) {
if (E->get().order < 0)
continue; // texture, does not go here
+ //if (material->shader->mode == VS::SHADER_PARTICLES) {
+ // print_line("uniform " + String(E->key()) + " order " + itos(E->get().order) + " offset " + itos(material->shader->ubo_offsets[E->get().order]));
+ //}
//regular uniform
uint8_t *data = &local_ubo[material->shader->ubo_offsets[E->get().order]];
@@ -2643,6 +2831,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
surface->skeleton_bone_used.resize(surface->skeleton_bone_aabb.size());
surface->aabb = p_aabb;
surface->max_bone = p_bone_aabbs.size();
+ surface->total_data_size += surface->array_byte_size + surface->index_array_byte_size;
for (int i = 0; i < surface->skeleton_bone_used.size(); i++) {
if (surface->skeleton_bone_aabb[i].size.x < 0 || surface->skeleton_bone_aabb[i].size.y < 0 || surface->skeleton_bone_aabb[i].size.z < 0) {
@@ -2712,6 +2901,112 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
+
+#ifdef DEBUG_ENABLED
+
+ if (config.generate_wireframes && p_primitive == VS::PRIMITIVE_TRIANGLES) {
+ //generate wireframes, this is used mostly by editor
+ PoolVector<uint32_t> wf_indices;
+ int index_count;
+
+ if (p_format & VS::ARRAY_FORMAT_INDEX) {
+
+ index_count = p_index_count * 2;
+ wf_indices.resize(index_count);
+
+ PoolVector<uint8_t>::Read ir = p_index_array.read();
+ PoolVector<uint32_t>::Write wr = wf_indices.write();
+
+ if (p_vertex_count < (1 << 16)) {
+ //read 16 bit indices
+ const uint16_t *src_idx = (const uint16_t *)ir.ptr();
+ for (int i = 0; i < index_count; i += 6) {
+
+ wr[i + 0] = src_idx[i / 2];
+ wr[i + 1] = src_idx[i / 2 + 1];
+ wr[i + 2] = src_idx[i / 2 + 1];
+ wr[i + 3] = src_idx[i / 2 + 2];
+ wr[i + 4] = src_idx[i / 2 + 2];
+ wr[i + 5] = src_idx[i / 2];
+ }
+
+ } else {
+
+ //read 16 bit indices
+ const uint32_t *src_idx = (const uint32_t *)ir.ptr();
+ for (int i = 0; i < index_count; i += 6) {
+
+ wr[i + 0] = src_idx[i / 2];
+ wr[i + 1] = src_idx[i / 2 + 1];
+ wr[i + 2] = src_idx[i / 2 + 1];
+ wr[i + 3] = src_idx[i / 2 + 2];
+ wr[i + 4] = src_idx[i / 2 + 2];
+ wr[i + 5] = src_idx[i / 2];
+ }
+ }
+
+ } else {
+
+ index_count = p_vertex_count * 2;
+ wf_indices.resize(index_count);
+ PoolVector<uint32_t>::Write wr = wf_indices.write();
+ for (int i = 0; i < index_count; i += 6) {
+
+ wr[i + 0] = i / 2;
+ wr[i + 1] = i / 2 + 1;
+ wr[i + 2] = i / 2 + 1;
+ wr[i + 3] = i / 2 + 2;
+ wr[i + 4] = i / 2 + 2;
+ wr[i + 5] = i / 2;
+ }
+ }
+ {
+ PoolVector<uint32_t>::Read ir = wf_indices.read();
+
+ glGenBuffers(1, &surface->index_wireframe_id);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, surface->index_wireframe_id);
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, index_count * sizeof(uint32_t), ir.ptr(), GL_STATIC_DRAW);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); //unbind
+
+ surface->index_wireframe_len = index_count;
+ }
+
+ for (int ai = 0; ai < 2; ai++) {
+
+ if (ai == 0) {
+ //for normal draw
+ glGenVertexArrays(1, &surface->array_wireframe_id);
+ glBindVertexArray(surface->array_wireframe_id);
+ glBindBuffer(GL_ARRAY_BUFFER, surface->vertex_id);
+ } else if (ai == 1) {
+ //for instancing draw (can be changed and no one cares)
+ glGenVertexArrays(1, &surface->instancing_array_wireframe_id);
+ glBindVertexArray(surface->instancing_array_wireframe_id);
+ glBindBuffer(GL_ARRAY_BUFFER, surface->vertex_id);
+ }
+
+ for (int i = 0; i < VS::ARRAY_MAX - 1; i++) {
+
+ if (!attribs[i].enabled)
+ continue;
+
+ if (attribs[i].integer) {
+ glVertexAttribIPointer(attribs[i].index, attribs[i].size, attribs[i].type, attribs[i].stride, ((uint8_t *)0) + attribs[i].offset);
+ } else {
+ glVertexAttribPointer(attribs[i].index, attribs[i].size, attribs[i].type, attribs[i].normalized, attribs[i].stride, ((uint8_t *)0) + attribs[i].offset);
+ }
+ glEnableVertexAttribArray(attribs[i].index);
+ }
+
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, surface->index_wireframe_id);
+
+ glBindVertexArray(0);
+ glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+ }
+ }
+
+#endif
}
{
@@ -2724,6 +3019,8 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
PoolVector<uint8_t>::Read vr = p_blend_shapes[i].read();
+ surface->total_data_size += array_size;
+
glGenBuffers(1, &mt.vertex_id);
glBindBuffer(GL_ARRAY_BUFFER, mt.vertex_id);
glBufferData(GL_ARRAY_BUFFER, array_size, vr.ptr(), GL_STATIC_DRAW);
@@ -2755,6 +3052,8 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
mesh->surfaces.push_back(surface);
mesh->instance_change_notify();
+
+ info.vertex_mem += surface->total_data_size;
}
void RasterizerStorageGLES3::mesh_set_blend_shape_count(RID p_mesh, int p_amount) {
@@ -2976,6 +3275,7 @@ void RasterizerStorageGLES3::mesh_remove_surface(RID p_mesh, int p_surface) {
}
glDeleteVertexArrays(1, &surface->array_id);
+ glDeleteVertexArrays(1, &surface->instancing_array_id);
for (int i = 0; i < surface->blend_shapes.size(); i++) {
@@ -2983,6 +3283,14 @@ void RasterizerStorageGLES3::mesh_remove_surface(RID p_mesh, int p_surface) {
glDeleteVertexArrays(1, &surface->blend_shapes[i].array_id);
}
+ if (surface->index_wireframe_id) {
+ glDeleteBuffers(1, &surface->index_wireframe_id);
+ glDeleteVertexArrays(1, &surface->array_wireframe_id);
+ glDeleteVertexArrays(1, &surface->instancing_array_wireframe_id);
+ }
+
+ info.vertex_mem -= surface->total_data_size;
+
mesh->instance_material_change_notify();
memdelete(surface);
@@ -3005,6 +3313,7 @@ void RasterizerStorageGLES3::mesh_set_custom_aabb(RID p_mesh, const Rect3 &p_aab
mesh->custom_aabb = p_aabb;
}
+
Rect3 RasterizerStorageGLES3::mesh_get_custom_aabb(RID p_mesh) const {
const Mesh *mesh = mesh_owner.getornull(p_mesh);
@@ -3814,7 +4123,7 @@ void RasterizerStorageGLES3::immediate_vertex(RID p_immediate, const Vector3 &p_
if (c->vertices.empty() && im->chunks.size() == 1) {
- im->aabb.pos = p_vertex;
+ im->aabb.position = p_vertex;
im->aabb.size = Vector3();
} else {
im->aabb.expand_to(p_vertex);
@@ -4133,7 +4442,6 @@ RID RasterizerStorageGLES3::light_create(VS::LightType p_type) {
light->param[VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET] = 0.3;
light->param[VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET] = 0.6;
light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] = 0.1;
- light->param[VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE] = 0.1;
light->color = Color(1, 1, 1, 1);
light->shadow = false;
@@ -4170,8 +4478,7 @@ void RasterizerStorageGLES3::light_set_param(RID p_light, VS::LightParam p_param
case VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET:
case VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET:
case VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS:
- case VS::LIGHT_PARAM_SHADOW_BIAS:
- case VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE: {
+ case VS::LIGHT_PARAM_SHADOW_BIAS: {
light->version++;
light->instance_change_notify();
@@ -4481,7 +4788,7 @@ Rect3 RasterizerStorageGLES3::reflection_probe_get_aabb(RID p_probe) const {
ERR_FAIL_COND_V(!reflection_probe, Rect3());
Rect3 aabb;
- aabb.pos = -reflection_probe->extents;
+ aabb.position = -reflection_probe->extents;
aabb.size = reflection_probe->extents * 2.0;
return aabb;
@@ -4571,6 +4878,7 @@ RID RasterizerStorageGLES3::gi_probe_create() {
gip->energy = 1.0;
gip->propagation = 1.0;
gip->bias = 0.4;
+ gip->normal_bias = 0.4;
gip->interior = false;
gip->compress = false;
gip->version = 1;
@@ -4677,6 +4985,14 @@ void RasterizerStorageGLES3::gi_probe_set_bias(RID p_probe, float p_range) {
gip->bias = p_range;
}
+void RasterizerStorageGLES3::gi_probe_set_normal_bias(RID p_probe, float p_range) {
+
+ GIProbe *gip = gi_probe_owner.getornull(p_probe);
+ ERR_FAIL_COND(!gip);
+
+ gip->normal_bias = p_range;
+}
+
void RasterizerStorageGLES3::gi_probe_set_propagation(RID p_probe, float p_range) {
GIProbe *gip = gi_probe_owner.getornull(p_probe);
@@ -4732,6 +5048,14 @@ float RasterizerStorageGLES3::gi_probe_get_bias(RID p_probe) const {
return gip->bias;
}
+float RasterizerStorageGLES3::gi_probe_get_normal_bias(RID p_probe) const {
+
+ const GIProbe *gip = gi_probe_owner.getornull(p_probe);
+ ERR_FAIL_COND_V(!gip, 0);
+
+ return gip->normal_bias;
+}
+
float RasterizerStorageGLES3::gi_probe_get_propagation(RID p_probe) const {
const GIProbe *gip = gi_probe_owner.getornull(p_probe);
@@ -4776,7 +5100,6 @@ RID RasterizerStorageGLES3::gi_probe_dynamic_data_create(int p_width, int p_heig
min_size = 4;
}
- print_line("dyndata create");
while (true) {
if (gipd->compression == GI_PROBE_S3TC) {
@@ -4854,6 +5177,10 @@ void RasterizerStorageGLES3::particles_set_emitting(RID p_particles, bool p_emit
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
+ if (p_emitting != particles->emitting) {
+ // Restart is overriden by set_emitting
+ particles->restart_request = false;
+ }
particles->emitting = p_emitting;
}
void RasterizerStorageGLES3::particles_set_amount(RID p_particles, int p_amount) {
@@ -4861,6 +5188,8 @@ void RasterizerStorageGLES3::particles_set_amount(RID p_particles, int p_amount)
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
+ particles->amount = p_amount;
+
int floats = p_amount * 24;
float *data = memnew_arr(float, floats);
@@ -4868,17 +5197,41 @@ void RasterizerStorageGLES3::particles_set_amount(RID p_particles, int p_amount)
data[i] = 0;
}
- glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffers[0]);
- glBufferData(GL_ARRAY_BUFFER, floats * sizeof(float), data, GL_DYNAMIC_DRAW);
+ for (int i = 0; i < 2; i++) {
- glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffers[1]);
- glBufferData(GL_ARRAY_BUFFER, floats * sizeof(float), data, GL_DYNAMIC_DRAW);
+ glBindVertexArray(particles->particle_vaos[i]);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
+ glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffers[i]);
+ glBufferData(GL_ARRAY_BUFFER, floats * sizeof(float), data, GL_DYNAMIC_DRAW);
+
+ for (int i = 0; i < 6; i++) {
+ glEnableVertexAttribArray(i);
+ glVertexAttribPointer(i, 4, GL_FLOAT, GL_FALSE, sizeof(float) * 4 * 6, ((uint8_t *)0) + (i * 16));
+ }
+ }
+
+ if (particles->histories_enabled) {
+
+ for (int i = 0; i < 2; i++) {
+ glBindVertexArray(particles->particle_vao_histories[i]);
+
+ glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffer_histories[i]);
+ glBufferData(GL_ARRAY_BUFFER, floats * sizeof(float), data, GL_DYNAMIC_COPY);
+
+ for (int j = 0; j < 6; j++) {
+ glEnableVertexAttribArray(j);
+ glVertexAttribPointer(j, 4, GL_FLOAT, GL_FALSE, sizeof(float) * 4 * 6, ((uint8_t *)0) + (j * 16));
+ }
+ particles->particle_valid_histories[i] = false;
+ }
+ }
+
+ glBindVertexArray(0);
particles->prev_ticks = 0;
particles->phase = 0;
particles->prev_phase = 0;
+ particles->clear = true;
memdelete_arr(data);
}
@@ -4889,6 +5242,14 @@ void RasterizerStorageGLES3::particles_set_lifetime(RID p_particles, float p_lif
ERR_FAIL_COND(!particles);
particles->lifetime = p_lifetime;
}
+
+void RasterizerStorageGLES3::particles_set_one_shot(RID p_particles, bool p_one_shot) {
+
+ Particles *particles = particles_owner.getornull(p_particles);
+ ERR_FAIL_COND(!particles);
+ particles->one_shot = p_one_shot;
+}
+
void RasterizerStorageGLES3::particles_set_pre_process_time(RID p_particles, float p_time) {
Particles *particles = particles_owner.getornull(p_particles);
@@ -4907,18 +5268,61 @@ void RasterizerStorageGLES3::particles_set_randomness_ratio(RID p_particles, flo
ERR_FAIL_COND(!particles);
particles->randomness = p_ratio;
}
+
+void RasterizerStorageGLES3::_particles_update_histories(Particles *particles) {
+
+ bool needs_histories = particles->draw_order == VS::PARTICLES_DRAW_ORDER_VIEW_DEPTH;
+
+ if (needs_histories == particles->histories_enabled)
+ return;
+
+ particles->histories_enabled = needs_histories;
+
+ int floats = particles->amount * 24;
+
+ if (!needs_histories) {
+
+ glDeleteBuffers(2, particles->particle_buffer_histories);
+ glDeleteVertexArrays(2, particles->particle_vao_histories);
+
+ } else {
+
+ glGenBuffers(2, particles->particle_buffer_histories);
+ glGenVertexArrays(2, particles->particle_vao_histories);
+
+ for (int i = 0; i < 2; i++) {
+ glBindVertexArray(particles->particle_vao_histories[i]);
+
+ glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffer_histories[i]);
+ glBufferData(GL_ARRAY_BUFFER, floats * sizeof(float), NULL, GL_DYNAMIC_COPY);
+
+ for (int j = 0; j < 6; j++) {
+ glEnableVertexAttribArray(j);
+ glVertexAttribPointer(j, 4, GL_FLOAT, GL_FALSE, sizeof(float) * 4 * 6, ((uint8_t *)0) + (j * 16));
+ }
+
+ particles->particle_valid_histories[i] = false;
+ }
+ }
+
+ particles->clear = true;
+}
+
void RasterizerStorageGLES3::particles_set_custom_aabb(RID p_particles, const Rect3 &p_aabb) {
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
particles->custom_aabb = p_aabb;
+ _particles_update_histories(particles);
+ particles->instance_change_notify();
}
-void RasterizerStorageGLES3::particles_set_gravity(RID p_particles, const Vector3 &p_gravity) {
+
+void RasterizerStorageGLES3::particles_set_speed_scale(RID p_particles, float p_scale) {
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
- particles->gravity = p_gravity;
+ particles->speed_scale = p_scale;
}
void RasterizerStorageGLES3::particles_set_use_local_coordinates(RID p_particles, bool p_enable) {
@@ -4927,85 +5331,218 @@ void RasterizerStorageGLES3::particles_set_use_local_coordinates(RID p_particles
particles->use_local_coords = p_enable;
}
-void RasterizerStorageGLES3::particles_set_process_material(RID p_particles, RID p_material) {
+
+void RasterizerStorageGLES3::particles_set_fixed_fps(RID p_particles, int p_fps) {
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
- particles->process_material = p_material;
+ particles->fixed_fps = p_fps;
}
-void RasterizerStorageGLES3::particles_set_emission_shape(RID p_particles, VS::ParticlesEmissionShape p_shape) {
+void RasterizerStorageGLES3::particles_set_fractional_delta(RID p_particles, bool p_enable) {
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
- particles->emission_shape = p_shape;
+ particles->fractional_delta = p_enable;
}
-void RasterizerStorageGLES3::particles_set_emission_sphere_radius(RID p_particles, float p_radius) {
+
+void RasterizerStorageGLES3::particles_set_process_material(RID p_particles, RID p_material) {
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
- particles->emission_sphere_radius = p_radius;
+ particles->process_material = p_material;
}
-void RasterizerStorageGLES3::particles_set_emission_box_extents(RID p_particles, const Vector3 &p_extents) {
+
+void RasterizerStorageGLES3::particles_set_draw_order(RID p_particles, VS::ParticlesDrawOrder p_order) {
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
- particles->emission_box_extents = p_extents;
+ particles->draw_order = p_order;
+ _particles_update_histories(particles);
}
-void RasterizerStorageGLES3::particles_set_emission_points(RID p_particles, const PoolVector<Vector3> &p_points) {
+
+void RasterizerStorageGLES3::particles_set_draw_passes(RID p_particles, int p_passes) {
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
- particles->emission_points = p_points;
+ particles->draw_passes.resize(p_passes);
}
-void RasterizerStorageGLES3::particles_set_draw_order(RID p_particles, VS::ParticlesDrawOrder p_order) {
+void RasterizerStorageGLES3::particles_set_draw_pass_mesh(RID p_particles, int p_pass, RID p_mesh) {
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
-
- particles->draw_order = p_order;
+ ERR_FAIL_INDEX(p_pass, particles->draw_passes.size());
+ particles->draw_passes[p_pass] = p_mesh;
}
-void RasterizerStorageGLES3::particles_set_draw_passes(RID p_particles, int p_count) {
+void RasterizerStorageGLES3::particles_restart(RID p_particles) {
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
- particles->draw_passes.resize(p_count);
+ particles->restart_request = true;
}
-void RasterizerStorageGLES3::particles_set_draw_pass_material(RID p_particles, int p_pass, RID p_material) {
+
+void RasterizerStorageGLES3::particles_request_process(RID p_particles) {
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
- ERR_FAIL_INDEX(p_pass, particles->draw_passes.size());
- particles->draw_passes[p_pass].material = p_material;
+
+ if (!particles->particle_element.in_list()) {
+ particle_update_list.add(&particles->particle_element);
+ }
}
-void RasterizerStorageGLES3::particles_set_draw_pass_mesh(RID p_particles, int p_pass, RID p_mesh) {
+
+Rect3 RasterizerStorageGLES3::particles_get_current_aabb(RID p_particles) {
+
+ const Particles *particles = particles_owner.getornull(p_particles);
+ ERR_FAIL_COND_V(!particles, Rect3());
+
+ glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffers[0]);
+
+ float *data = (float *)glMapBufferRange(GL_ARRAY_BUFFER, 0, particles->amount * 16 * 6, GL_MAP_READ_BIT);
+ Rect3 aabb;
+
+ Transform inv = particles->emission_transform.affine_inverse();
+
+ for (int i = 0; i < particles->amount; i++) {
+ int ofs = i * 24;
+ Vector3 pos = Vector3(data[ofs + 15], data[ofs + 19], data[ofs + 23]);
+ if (!particles->use_local_coords) {
+ pos = inv.xform(pos);
+ }
+ if (i == 0)
+ aabb.position = pos;
+ else
+ aabb.expand_to(pos);
+ }
+
+ glUnmapBuffer(GL_ARRAY_BUFFER);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+
+ float longest_axis = 0;
+ for (int i = 0; i < particles->draw_passes.size(); i++) {
+ if (particles->draw_passes[i].is_valid()) {
+ Rect3 maabb = mesh_get_aabb(particles->draw_passes[i], RID());
+ longest_axis = MAX(maabb.get_longest_axis_size(), longest_axis);
+ }
+ }
+
+ aabb.grow_by(longest_axis);
+
+ return aabb;
+}
+
+Rect3 RasterizerStorageGLES3::particles_get_aabb(RID p_particles) const {
+
+ const Particles *particles = particles_owner.getornull(p_particles);
+ ERR_FAIL_COND_V(!particles, Rect3());
+
+ return particles->custom_aabb;
+}
+
+void RasterizerStorageGLES3::particles_set_emission_transform(RID p_particles, const Transform &p_transform) {
Particles *particles = particles_owner.getornull(p_particles);
ERR_FAIL_COND(!particles);
- ERR_FAIL_INDEX(p_pass, particles->draw_passes.size());
- particles->draw_passes[p_pass].mesh = p_mesh;
+
+ particles->emission_transform = p_transform;
}
-Rect3 RasterizerStorageGLES3::particles_get_current_aabb(RID p_particles) {
+int RasterizerStorageGLES3::particles_get_draw_passes(RID p_particles) const {
const Particles *particles = particles_owner.getornull(p_particles);
- ERR_FAIL_COND_V(!particles, Rect3());
+ ERR_FAIL_COND_V(!particles, 0);
+
+ return particles->draw_passes.size();
+}
+
+RID RasterizerStorageGLES3::particles_get_draw_pass_mesh(RID p_particles, int p_pass) const {
+
+ const Particles *particles = particles_owner.getornull(p_particles);
+ ERR_FAIL_COND_V(!particles, RID());
+ ERR_FAIL_INDEX_V(p_pass, particles->draw_passes.size(), RID());
+
+ return particles->draw_passes[p_pass];
+}
+
+void RasterizerStorageGLES3::_particles_process(Particles *p_particles, float p_delta) {
+
+ float new_phase = Math::fmod((float)p_particles->phase + (p_delta / p_particles->lifetime) * p_particles->speed_scale, (float)1.0);
+
+ if (p_particles->clear) {
+ p_particles->cycle_number = 0;
+ p_particles->random_seed = Math::rand();
+ } else if (new_phase < p_particles->phase) {
+ if (p_particles->one_shot) {
+ p_particles->emitting = false;
+ shaders.particles.set_uniform(ParticlesShaderGLES3::EMITTING, false);
+ }
+ p_particles->cycle_number++;
+ }
+
+ shaders.particles.set_uniform(ParticlesShaderGLES3::SYSTEM_PHASE, new_phase);
+ shaders.particles.set_uniform(ParticlesShaderGLES3::PREV_SYSTEM_PHASE, p_particles->phase);
+ p_particles->phase = new_phase;
+
+ shaders.particles.set_uniform(ParticlesShaderGLES3::DELTA, p_delta * p_particles->speed_scale);
+ shaders.particles.set_uniform(ParticlesShaderGLES3::CLEAR, p_particles->clear);
+ glUniform1ui(shaders.particles.get_uniform_location(ParticlesShaderGLES3::RANDOM_SEED), p_particles->random_seed);
+
+ if (p_particles->use_local_coords)
+ shaders.particles.set_uniform(ParticlesShaderGLES3::EMISSION_TRANSFORM, Transform());
+ else
+ shaders.particles.set_uniform(ParticlesShaderGLES3::EMISSION_TRANSFORM, p_particles->emission_transform);
+
+ glUniform1ui(shaders.particles.get_uniform(ParticlesShaderGLES3::CYCLE), p_particles->cycle_number);
+
+ p_particles->clear = false;
+
+ glBindVertexArray(p_particles->particle_vaos[0]);
+
+ glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, p_particles->particle_buffers[1]);
- return particles->computed_aabb;
+ // GLint size = 0;
+ // glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, &size);
+
+ glBeginTransformFeedback(GL_POINTS);
+ glDrawArrays(GL_POINTS, 0, p_particles->amount);
+ glEndTransformFeedback();
+
+ SWAP(p_particles->particle_buffers[0], p_particles->particle_buffers[1]);
+ SWAP(p_particles->particle_vaos[0], p_particles->particle_vaos[1]);
+
+ glBindVertexArray(0);
+ /* //debug particles :D
+ glBindBuffer(GL_ARRAY_BUFFER, p_particles->particle_buffers[0]);
+
+ float *data = (float *)glMapBufferRange(GL_ARRAY_BUFFER, 0, p_particles->amount * 16 * 6, GL_MAP_READ_BIT);
+ for (int i = 0; i < p_particles->amount; i++) {
+ int ofs = i * 24;
+ print_line(itos(i) + ":");
+ print_line("\tColor: " + Color(data[ofs + 0], data[ofs + 1], data[ofs + 2], data[ofs + 3]));
+ print_line("\tVelocity: " + Vector3(data[ofs + 4], data[ofs + 5], data[ofs + 6]));
+ print_line("\tActive: " + itos(data[ofs + 7]));
+ print_line("\tCustom: " + Color(data[ofs + 8], data[ofs + 9], data[ofs + 10], data[ofs + 11]));
+ print_line("\tXF X: " + Color(data[ofs + 12], data[ofs + 13], data[ofs + 14], data[ofs + 15]));
+ print_line("\tXF Y: " + Color(data[ofs + 16], data[ofs + 17], data[ofs + 18], data[ofs + 19]));
+ print_line("\tXF Z: " + Color(data[ofs + 20], data[ofs + 21], data[ofs + 22], data[ofs + 23]));
+ }
+
+ glUnmapBuffer(GL_ARRAY_BUFFER);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ //*/
}
void RasterizerStorageGLES3::update_particles() {
glEnable(GL_RASTERIZER_DISCARD);
- glBindVertexArray(0);
while (particle_update_list.first()) {
@@ -5013,6 +5550,44 @@ void RasterizerStorageGLES3::update_particles() {
Particles *particles = particle_update_list.first()->self();
+ if (particles->restart_request) {
+ particles->emitting = true; //restart from zero
+ particles->prev_ticks = 0;
+ particles->phase = 0;
+ particles->prev_phase = 0;
+ particles->clear = true;
+ particles->particle_valid_histories[0] = false;
+ particles->particle_valid_histories[1] = false;
+ particles->restart_request = false;
+ }
+
+ if (particles->inactive && !particles->emitting) {
+
+ particle_update_list.remove(particle_update_list.first());
+ continue;
+ }
+
+ if (particles->emitting) {
+ if (particles->inactive) {
+ //restart system from scratch
+ particles->prev_ticks = 0;
+ particles->phase = 0;
+ particles->prev_phase = 0;
+ particles->clear = true;
+ particles->particle_valid_histories[0] = false;
+ particles->particle_valid_histories[1] = false;
+ }
+ particles->inactive = false;
+ particles->inactive_time = 0;
+ } else {
+ particles->inactive_time += particles->speed_scale * frame.delta;
+ if (particles->inactive_time > particles->lifetime * 1.2) {
+ particles->inactive = true;
+ particle_update_list.remove(particle_update_list.first());
+ continue;
+ }
+ }
+
Material *material = material_owner.getornull(particles->process_material);
if (!material || !material->shader || material->shader->mode != VS::SHADER_PARTICLES) {
@@ -5068,45 +5643,79 @@ void RasterizerStorageGLES3::update_particles() {
}
}
- shaders.particles.bind();
-
- shaders.particles.set_uniform(ParticlesShaderGLES3::ORIGIN, particles->origin);
+ shaders.particles.set_conditional(ParticlesShaderGLES3::USE_FRACTIONAL_DELTA, particles->fractional_delta);
- float new_phase = Math::fmod((float)particles->phase + (frame.delta / particles->lifetime), (float)1.0);
-
- shaders.particles.set_uniform(ParticlesShaderGLES3::SYSTEM_PHASE, new_phase);
- shaders.particles.set_uniform(ParticlesShaderGLES3::PREV_SYSTEM_PHASE, particles->phase);
- particles->phase = new_phase;
+ shaders.particles.bind();
shaders.particles.set_uniform(ParticlesShaderGLES3::TOTAL_PARTICLES, particles->amount);
- shaders.particles.set_uniform(ParticlesShaderGLES3::TIME, 0.0);
+ shaders.particles.set_uniform(ParticlesShaderGLES3::TIME, frame.time[0]);
shaders.particles.set_uniform(ParticlesShaderGLES3::EXPLOSIVENESS, particles->explosiveness);
- shaders.particles.set_uniform(ParticlesShaderGLES3::DELTA, frame.delta);
- shaders.particles.set_uniform(ParticlesShaderGLES3::GRAVITY, particles->gravity);
+ shaders.particles.set_uniform(ParticlesShaderGLES3::LIFETIME, particles->lifetime);
shaders.particles.set_uniform(ParticlesShaderGLES3::ATTRACTOR_COUNT, 0);
+ shaders.particles.set_uniform(ParticlesShaderGLES3::EMITTING, particles->emitting);
+ shaders.particles.set_uniform(ParticlesShaderGLES3::RANDOMNESS, particles->randomness);
- glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffers[0]);
- glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, particles->particle_buffers[1]);
+ if (particles->clear && particles->pre_process_time > 0.0) {
- for (int i = 0; i < 6; i++) {
- glEnableVertexAttribArray(i);
- glVertexAttribPointer(i, 4, GL_FLOAT, GL_FALSE, sizeof(float) * 4 * 6, ((uint8_t *)0) + (i * 16));
+ float frame_time;
+ if (particles->fixed_fps > 0)
+ frame_time = 1.0 / particles->fixed_fps;
+ else
+ frame_time = 1.0 / 30.0;
+
+ float delta = particles->pre_process_time;
+ if (delta > 0.1) { //avoid recursive stalls if fps goes below 10
+ delta = 0.1;
+ }
+ float todo = delta;
+
+ while (todo >= frame_time) {
+ _particles_process(particles, frame_time);
+ todo -= frame_time;
+ }
}
- glBeginTransformFeedback(GL_POINTS);
- glDrawArrays(GL_POINTS, 0, particles->amount);
- glEndTransformFeedback();
+ if (particles->fixed_fps > 0) {
+ float frame_time = 1.0 / particles->fixed_fps;
+ float delta = frame.delta;
+ if (delta > 0.1) { //avoid recursive stalls if fps goes below 10
+ delta = 0.1;
+ } else if (delta <= 0.0) { //unlikely but..
+ delta = 0.001;
+ }
+ float todo = particles->frame_remainder + delta;
+
+ while (todo >= frame_time) {
+ _particles_process(particles, frame_time);
+ todo -= frame_time;
+ }
+
+ particles->frame_remainder = todo;
+
+ } else {
+ _particles_process(particles, frame.delta);
+ }
particle_update_list.remove(particle_update_list.first());
- SWAP(particles->particle_buffers[0], particles->particle_buffers[1]);
- }
+ if (particles->histories_enabled) {
- glDisable(GL_RASTERIZER_DISCARD);
+ SWAP(particles->particle_buffer_histories[0], particles->particle_buffer_histories[1]);
+ SWAP(particles->particle_vao_histories[0], particles->particle_vao_histories[1]);
+ SWAP(particles->particle_valid_histories[0], particles->particle_valid_histories[1]);
+
+ //copy
+ glBindBuffer(GL_COPY_READ_BUFFER, particles->particle_buffers[0]);
+ glBindBuffer(GL_COPY_WRITE_BUFFER, particles->particle_buffer_histories[0]);
+ glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, particles->amount * 24 * sizeof(float));
+
+ particles->particle_valid_histories[0] = true;
+ }
- for (int i = 0; i < 6; i++) {
- glDisableVertexAttribArray(i);
+ particles->instance_change_notify(); //make sure shadows are updated
}
+
+ glDisable(GL_RASTERIZER_DISCARD);
}
////////
@@ -5143,6 +5752,10 @@ void RasterizerStorageGLES3::instance_add_dependency(RID p_base, RasterizerScene
inst = immediate_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
+ case VS::INSTANCE_PARTICLES: {
+ inst = particles_owner.getornull(p_base);
+ ERR_FAIL_COND(!inst);
+ } break;
case VS::INSTANCE_REFLECTION_PROBE: {
inst = reflection_probe_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
@@ -5182,6 +5795,10 @@ void RasterizerStorageGLES3::instance_remove_dependency(RID p_base, RasterizerSc
inst = immediate_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
+ case VS::INSTANCE_PARTICLES: {
+ inst = particles_owner.getornull(p_base);
+ ERR_FAIL_COND(!inst);
+ } break;
case VS::INSTANCE_REFLECTION_PROBE: {
inst = reflection_probe_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
@@ -5217,17 +5834,20 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) {
rt->fbo = 0;
}
- if (rt->buffers.fbo) {
+ if (rt->buffers.active) {
glDeleteFramebuffers(1, &rt->buffers.fbo);
glDeleteRenderbuffers(1, &rt->buffers.depth);
glDeleteRenderbuffers(1, &rt->buffers.diffuse);
- glDeleteRenderbuffers(1, &rt->buffers.specular);
- glDeleteRenderbuffers(1, &rt->buffers.normal_rough);
- glDeleteRenderbuffers(1, &rt->buffers.motion_sss);
- glDeleteFramebuffers(1, &rt->buffers.effect_fbo);
- glDeleteTextures(1, &rt->buffers.effect);
+ if (rt->buffers.effects_active) {
+ glDeleteRenderbuffers(1, &rt->buffers.specular);
+ glDeleteRenderbuffers(1, &rt->buffers.normal_rough);
+ glDeleteRenderbuffers(1, &rt->buffers.sss);
+ glDeleteFramebuffers(1, &rt->buffers.effect_fbo);
+ glDeleteTextures(1, &rt->buffers.effect);
+ }
- rt->buffers.fbo = 0;
+ rt->buffers.effects_active = false;
+ rt->buffers.active = false;
}
if (rt->depth) {
@@ -5262,15 +5882,18 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) {
tex->alloc_width = 0;
tex->width = 0;
tex->height = 0;
+ tex->active = false;
for (int i = 0; i < 2; i++) {
- for (int j = 0; j < rt->effects.mip_maps[i].sizes.size(); j++) {
- glDeleteFramebuffers(1, &rt->effects.mip_maps[i].sizes[j].fbo);
- }
+ if (rt->effects.mip_maps[i].color) {
+ for (int j = 0; j < rt->effects.mip_maps[i].sizes.size(); j++) {
+ glDeleteFramebuffers(1, &rt->effects.mip_maps[i].sizes[j].fbo);
+ }
- glDeleteTextures(1, &rt->effects.mip_maps[i].color);
- rt->effects.mip_maps[i].sizes.clear();
- rt->effects.mip_maps[i].levels = 0;
+ glDeleteTextures(1, &rt->effects.mip_maps[i].color);
+ rt->effects.mip_maps[i].sizes.clear();
+ rt->effects.mip_maps[i].levels = 0;
+ }
}
/*
@@ -5293,14 +5916,24 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
Image::Format image_format;
bool hdr = rt->flags[RENDER_TARGET_HDR] && config.hdr_supported;
- hdr = false;
+ //hdr = false;
if (!hdr || rt->flags[RENDER_TARGET_NO_3D]) {
- color_internal_format = GL_RGBA8;
- color_format = GL_RGBA;
- color_type = GL_UNSIGNED_BYTE;
- image_format = Image::FORMAT_RGBA8;
+ if (rt->flags[RENDER_TARGET_NO_3D_EFFECTS] && !rt->flags[RENDER_TARGET_TRANSPARENT]) {
+ //if this is not used, linear colorspace looks pretty bad
+ //this is the default mode used for mobile
+ color_internal_format = GL_RGB10_A2;
+ color_format = GL_RGBA;
+ color_type = GL_UNSIGNED_INT_2_10_10_10_REV;
+ image_format = Image::FORMAT_RGBA8;
+ } else {
+
+ color_internal_format = GL_RGBA8;
+ color_format = GL_RGBA;
+ color_type = GL_UNSIGNED_BYTE;
+ image_format = Image::FORMAT_RGBA8;
+ }
} else {
color_internal_format = GL_RGBA16F;
color_format = GL_RGBA;
@@ -5318,8 +5951,8 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
glGenTextures(1, &rt->depth);
glBindTexture(GL_TEXTURE_2D, rt->depth);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, rt->width, rt->height, 0,
- GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, rt->width, rt->height, 0,
+ GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -5358,17 +5991,27 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
tex->alloc_width = rt->width;
tex->height = rt->height;
tex->alloc_height = rt->height;
+ tex->active = true;
texture_set_flags(rt->texture, tex->flags);
}
/* BACK FBO */
- if (config.render_arch == RENDER_ARCH_DESKTOP && !rt->flags[RENDER_TARGET_NO_3D]) {
+ if (!rt->flags[RENDER_TARGET_NO_3D] && (!rt->flags[RENDER_TARGET_NO_3D_EFFECTS] || rt->msaa != VS::VIEWPORT_MSAA_DISABLED)) {
+
+ rt->buffers.active = true;
static const int msaa_value[] = { 0, 2, 4, 8, 16 };
int msaa = msaa_value[rt->msaa];
+ int max_samples = 0;
+ glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
+ if (msaa > max_samples) {
+ WARN_PRINTS("MSAA must be <= GL_MAX_SAMPLES, falling-back to GL_MAX_SAMPLES = " + itos(max_samples));
+ msaa = max_samples;
+ }
+
//regular fbo
glGenFramebuffers(1, &rt->buffers.fbo);
glBindFramebuffer(GL_FRAMEBUFFER, rt->buffers.fbo);
@@ -5392,75 +6035,157 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rt->buffers.diffuse);
- glGenRenderbuffers(1, &rt->buffers.specular);
- glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.specular);
+ if (!rt->flags[RENDER_TARGET_NO_3D_EFFECTS]) {
- if (msaa == 0)
- glRenderbufferStorage(GL_RENDERBUFFER, color_internal_format, rt->width, rt->height);
- else
- glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa, color_internal_format, rt->width, rt->height);
+ rt->buffers.effects_active = true;
+ glGenRenderbuffers(1, &rt->buffers.specular);
+ glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.specular);
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_RENDERBUFFER, rt->buffers.specular);
+ if (msaa == 0)
+ glRenderbufferStorage(GL_RENDERBUFFER, color_internal_format, rt->width, rt->height);
+ else
+ glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa, color_internal_format, rt->width, rt->height);
- glGenRenderbuffers(1, &rt->buffers.normal_rough);
- glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.normal_rough);
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_RENDERBUFFER, rt->buffers.specular);
- if (msaa == 0)
- glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, rt->width, rt->height);
- else
- glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa, GL_RGBA8, rt->width, rt->height);
+ glGenRenderbuffers(1, &rt->buffers.normal_rough);
+ glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.normal_rough);
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, GL_RENDERBUFFER, rt->buffers.normal_rough);
+ if (msaa == 0)
+ glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, rt->width, rt->height);
+ else
+ glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa, GL_RGBA8, rt->width, rt->height);
- glGenRenderbuffers(1, &rt->buffers.motion_sss);
- glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.motion_sss);
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, GL_RENDERBUFFER, rt->buffers.normal_rough);
- if (msaa == 0)
- glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, rt->width, rt->height);
- else
- glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa, GL_RGBA8, rt->width, rt->height);
+ glGenRenderbuffers(1, &rt->buffers.sss);
+ glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.sss);
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, GL_RENDERBUFFER, rt->buffers.motion_sss);
+ if (msaa == 0)
+ glRenderbufferStorage(GL_RENDERBUFFER, GL_R8, rt->width, rt->height);
+ else
+ glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa, GL_R8, rt->width, rt->height);
- GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
- glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, GL_RENDERBUFFER, rt->buffers.sss);
- if (status != GL_FRAMEBUFFER_COMPLETE) {
- printf("err status: %x\n", status);
- _render_target_clear(rt);
- ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
- }
+ GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
- glBindRenderbuffer(GL_RENDERBUFFER, 0);
+ if (status != GL_FRAMEBUFFER_COMPLETE) {
+ printf("err status: %x\n", status);
+ _render_target_clear(rt);
+ ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
+ }
- // effect resolver
+ glBindRenderbuffer(GL_RENDERBUFFER, 0);
- glGenFramebuffers(1, &rt->buffers.effect_fbo);
- glBindFramebuffer(GL_FRAMEBUFFER, rt->buffers.effect_fbo);
+ // effect resolver
- glGenTextures(1, &rt->buffers.effect);
- glBindTexture(GL_TEXTURE_2D, rt->buffers.effect);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, rt->width, rt->height, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- GL_TEXTURE_2D, rt->buffers.effect, 0);
+ glGenFramebuffers(1, &rt->buffers.effect_fbo);
+ glBindFramebuffer(GL_FRAMEBUFFER, rt->buffers.effect_fbo);
- if (status != GL_FRAMEBUFFER_COMPLETE) {
- printf("err status: %x\n", status);
- _render_target_clear(rt);
- ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
- }
+ glGenTextures(1, &rt->buffers.effect);
+ glBindTexture(GL_TEXTURE_2D, rt->buffers.effect);
+ glTexImage2D(GL_TEXTURE_2D, 0, color_internal_format, rt->width, rt->height, 0,
+ color_format, color_type, NULL);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_TEXTURE_2D, rt->buffers.effect, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
+ status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
- if (status != GL_FRAMEBUFFER_COMPLETE) {
- _render_target_clear(rt);
- ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
+ if (status != GL_FRAMEBUFFER_COMPLETE) {
+ printf("err status: %x\n", status);
+ _render_target_clear(rt);
+ ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
+ }
+
+ ///////////////// ssao
+
+ //AO strength textures
+ for (int i = 0; i < 2; i++) {
+
+ glGenFramebuffers(1, &rt->effects.ssao.blur_fbo[i]);
+ glBindFramebuffer(GL_FRAMEBUFFER, rt->effects.ssao.blur_fbo[i]);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
+ GL_TEXTURE_2D, rt->depth, 0);
+
+ glGenTextures(1, &rt->effects.ssao.blur_red[i]);
+ glBindTexture(GL_TEXTURE_2D, rt->effects.ssao.blur_red[i]);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, rt->width, rt->height, 0, GL_RED, GL_UNSIGNED_BYTE, NULL);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->effects.ssao.blur_red[i], 0);
+
+ status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ if (status != GL_FRAMEBUFFER_COMPLETE) {
+ _render_target_clear(rt);
+ ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
+ }
+ }
+ //5 mip levels for depth texture, but base is read separately
+
+ glGenTextures(1, &rt->effects.ssao.linear_depth);
+ glBindTexture(GL_TEXTURE_2D, rt->effects.ssao.linear_depth);
+
+ int ssao_w = rt->width / 2;
+ int ssao_h = rt->height / 2;
+
+ for (int i = 0; i < 4; i++) { //5, but 4 mips, base is read directly to save bw
+
+ glTexImage2D(GL_TEXTURE_2D, i, GL_R16UI, ssao_w, ssao_h, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, NULL);
+ ssao_w >>= 1;
+ ssao_h >>= 1;
+ }
+
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 3);
+
+ for (int i = 0; i < 4; i++) { //5, but 4 mips, base is read directly to save bw
+
+ GLuint fbo;
+ glGenFramebuffers(1, &fbo);
+ glBindFramebuffer(GL_FRAMEBUFFER, fbo);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->effects.ssao.linear_depth, i);
+ rt->effects.ssao.depth_mipmap_fbos.push_back(fbo);
+ }
+
+ //////Exposure
+
+ glGenFramebuffers(1, &rt->exposure.fbo);
+ glBindFramebuffer(GL_FRAMEBUFFER, rt->exposure.fbo);
+
+ glGenTextures(1, &rt->exposure.color);
+ glBindTexture(GL_TEXTURE_2D, rt->exposure.color);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, 1, 1, 0, GL_RED, GL_FLOAT, NULL);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->exposure.color, 0);
+
+ status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ if (status != GL_FRAMEBUFFER_COMPLETE) {
+ _render_target_clear(rt);
+ ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
+ }
+ } else {
+ rt->buffers.effects_active = false;
}
+ } else {
+ rt->buffers.active = false;
+ rt->buffers.effects_active = true;
+ }
+
+ if (!rt->flags[RENDER_TARGET_NO_SAMPLING]) {
for (int i = 0; i < 2; i++) {
@@ -5477,12 +6202,12 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
glBindTexture(GL_TEXTURE_2D, rt->effects.mip_maps[i].color);
int level = 0;
+ int fb_w = w;
+ int fb_h = h;
while (true) {
RenderTarget::Effects::MipMaps::Size mm;
-
- glTexImage2D(GL_TEXTURE_2D, level, color_internal_format, w, h, 0, color_format, color_type, NULL);
mm.width = w;
mm.height = h;
rt->effects.mip_maps[i].sizes.push_back(mm);
@@ -5496,8 +6221,15 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
level++;
}
+ glTexStorage2DCustom(GL_TEXTURE_2D, level + 1, color_internal_format, fb_w, fb_h, color_format, color_type);
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, level);
+ glDisable(GL_SCISSOR_TEST);
+ glColorMask(1, 1, 1, 1);
+ if (rt->buffers.active == false) {
+ glDepthMask(GL_TRUE);
+ }
for (int j = 0; j < rt->effects.mip_maps[i].sizes.size(); j++) {
@@ -5506,15 +6238,24 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
glGenFramebuffers(1, &mm.fbo);
glBindFramebuffer(GL_FRAMEBUFFER, mm.fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->effects.mip_maps[i].color, j);
+ bool used_depth = false;
+ if (j == 0 && i == 0 && rt->buffers.active == false && !rt->flags[RENDER_TARGET_NO_3D]) { //will use this one for rendering 3D
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, rt->depth, 0);
+ used_depth = true;
+ }
- status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
_render_target_clear(rt);
ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
}
float zero[4] = { 1, 0, 1, 0 };
+ glViewport(0, 0, rt->effects.mip_maps[i].sizes[j].width, rt->effects.mip_maps[i].sizes[j].height);
glClearBufferfv(GL_COLOR, 0, zero);
+ if (used_depth) {
+ glClearBufferfi(GL_DEPTH_STENCIL, 0, 1.0, 0);
+ }
}
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
@@ -5527,79 +6268,6 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
- ///////////////// ssao
-
- //AO strength textures
- for (int i = 0; i < 2; i++) {
-
- glGenFramebuffers(1, &rt->effects.ssao.blur_fbo[i]);
- glBindFramebuffer(GL_FRAMEBUFFER, rt->effects.ssao.blur_fbo[i]);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
- GL_TEXTURE_2D, rt->depth, 0);
-
- glGenTextures(1, &rt->effects.ssao.blur_red[i]);
- glBindTexture(GL_TEXTURE_2D, rt->effects.ssao.blur_red[i]);
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, rt->width, rt->height, 0, GL_RED, GL_UNSIGNED_BYTE, NULL);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->effects.ssao.blur_red[i], 0);
-
- status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
- if (status != GL_FRAMEBUFFER_COMPLETE) {
- _render_target_clear(rt);
- ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
- }
- }
- //5 mip levels for depth texture, but base is read separately
-
- glGenTextures(1, &rt->effects.ssao.linear_depth);
- glBindTexture(GL_TEXTURE_2D, rt->effects.ssao.linear_depth);
-
- int ssao_w = rt->width / 2;
- int ssao_h = rt->height / 2;
-
- for (int i = 0; i < 4; i++) { //5, but 4 mips, base is read directly to save bw
-
- glTexImage2D(GL_TEXTURE_2D, i, GL_R16UI, ssao_w, ssao_h, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, NULL);
- ssao_w >>= 1;
- ssao_h >>= 1;
- }
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 3);
-
- for (int i = 0; i < 4; i++) { //5, but 4 mips, base is read directly to save bw
-
- GLuint fbo;
- glGenFramebuffers(1, &fbo);
- glBindFramebuffer(GL_FRAMEBUFFER, fbo);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->effects.ssao.linear_depth, i);
- rt->effects.ssao.depth_mipmap_fbos.push_back(fbo);
- }
-
- //////Exposure
-
- glGenFramebuffers(1, &rt->exposure.fbo);
- glBindFramebuffer(GL_FRAMEBUFFER, rt->exposure.fbo);
-
- glGenTextures(1, &rt->exposure.color);
- glBindTexture(GL_TEXTURE_2D, rt->exposure.color);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, 1, 1, 0, GL_RED, GL_FLOAT, NULL);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->exposure.color, 0);
-
- status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
- if (status != GL_FRAMEBUFFER_COMPLETE) {
- _render_target_clear(rt);
- ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
- }
}
}
@@ -5624,9 +6292,10 @@ RID RasterizerStorageGLES3::render_target_create() {
t->srgb = false;
t->total_data_size = 0;
t->ignore_mipmaps = false;
- t->mipmaps = 0;
+ t->mipmaps = 1;
t->active = true;
t->tex_id = 0;
+ t->render_target = rt;
rt->texture = texture_owner.make_rid(t);
@@ -5663,8 +6332,10 @@ void RasterizerStorageGLES3::render_target_set_flag(RID p_render_target, RenderT
rt->flags[p_flag] = p_value;
switch (p_flag) {
+ case RENDER_TARGET_HDR:
case RENDER_TARGET_NO_3D:
- case RENDER_TARGET_TRANSPARENT: {
+ case RENDER_TARGET_NO_SAMPLING:
+ case RENDER_TARGET_NO_3D_EFFECTS: {
//must reset for these formats
_render_target_clear(rt);
_render_target_allocate(rt);
@@ -5673,10 +6344,20 @@ void RasterizerStorageGLES3::render_target_set_flag(RID p_render_target, RenderT
default: {}
}
}
+bool RasterizerStorageGLES3::render_target_was_used(RID p_render_target) {
-bool RasterizerStorageGLES3::render_target_renedered_in_frame(RID p_render_target) {
+ RenderTarget *rt = render_target_owner.getornull(p_render_target);
+ ERR_FAIL_COND_V(!rt, false);
- return false;
+ return rt->used_in_frame;
+}
+
+void RasterizerStorageGLES3::render_target_clear_used(RID p_render_target) {
+
+ RenderTarget *rt = render_target_owner.getornull(p_render_target);
+ ERR_FAIL_COND(!rt);
+
+ rt->used_in_frame = false;
}
void RasterizerStorageGLES3::render_target_set_msaa(RID p_render_target, VS::ViewportMSAA p_msaa) {
@@ -5745,6 +6426,7 @@ RID RasterizerStorageGLES3::canvas_light_occluder_create() {
co->index_id = 0;
co->vertex_id = 0;
co->len = 0;
+ glGenVertexArrays(1, &co->array_id);
return canvas_occluder_owner.make_rid(co);
}
@@ -5816,7 +6498,7 @@ void RasterizerStorageGLES3::canvas_light_occluder_set_polylines(RID p_occluder,
if (!co->vertex_id) {
glGenBuffers(1, &co->vertex_id);
glBindBuffer(GL_ARRAY_BUFFER, co->vertex_id);
- glBufferData(GL_ARRAY_BUFFER, lc * 6 * sizeof(real_t), vw.ptr(), GL_STATIC_DRAW);
+ glBufferData(GL_ARRAY_BUFFER, lc * 6 * sizeof(real_t), vw.ptr(), GL_DYNAMIC_DRAW);
} else {
glBindBuffer(GL_ARRAY_BUFFER, co->vertex_id);
@@ -5829,7 +6511,7 @@ void RasterizerStorageGLES3::canvas_light_occluder_set_polylines(RID p_occluder,
glGenBuffers(1, &co->index_id);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, co->index_id);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, lc * 3 * sizeof(uint16_t), iw.ptr(), GL_STATIC_DRAW);
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, lc * 3 * sizeof(uint16_t), iw.ptr(), GL_DYNAMIC_DRAW);
} else {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, co->index_id);
@@ -5839,6 +6521,12 @@ void RasterizerStorageGLES3::canvas_light_occluder_set_polylines(RID p_occluder,
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); //unbind
co->len = lc;
+ glBindVertexArray(co->array_id);
+ glBindBuffer(GL_ARRAY_BUFFER, co->vertex_id);
+ glEnableVertexAttribArray(VS::ARRAY_VERTEX);
+ glVertexAttribPointer(VS::ARRAY_VERTEX, 3, GL_FLOAT, false, 0, 0);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, co->index_id);
+ glBindVertexArray(0);
}
}
@@ -5856,6 +6544,10 @@ VS::InstanceType RasterizerStorageGLES3::get_base_type(RID p_rid) const {
return VS::INSTANCE_IMMEDIATE;
}
+ if (particles_owner.owns(p_rid)) {
+ return VS::INSTANCE_PARTICLES;
+ }
+
if (light_owner.owns(p_rid)) {
return VS::INSTANCE_LIGHT;
}
@@ -5890,12 +6582,12 @@ bool RasterizerStorageGLES3::free(RID p_rid) {
info.texture_mem -= texture->total_data_size;
texture_owner.free(p_rid);
memdelete(texture);
- } else if (skybox_owner.owns(p_rid)) {
- // delete the skybox
- SkyBox *skybox = skybox_owner.get(p_rid);
- skybox_set_texture(p_rid, RID(), 256);
- skybox_owner.free(p_rid);
- memdelete(skybox);
+ } else if (sky_owner.owns(p_rid)) {
+ // delete the sky
+ Sky *sky = sky_owner.get(p_rid);
+ sky_set_texture(p_rid, RID(), 256);
+ sky_owner.free(p_rid);
+ memdelete(sky);
} else if (shader_owner.owns(p_rid)) {
@@ -6051,7 +6743,6 @@ bool RasterizerStorageGLES3::free(RID p_rid) {
// delete the texture
GIProbeData *gi_probe_data = gi_probe_data_owner.get(p_rid);
- print_line("dyndata delete");
glDeleteTextures(1, &gi_probe_data->tex_id);
gi_probe_owner.free(p_rid);
memdelete(gi_probe_data);
@@ -6064,6 +6755,8 @@ bool RasterizerStorageGLES3::free(RID p_rid) {
if (co->vertex_id)
glDeleteBuffers(1, &co->vertex_id);
+ glDeleteVertexArrays(1, &co->array_id);
+
canvas_occluder_owner.free(p_rid);
memdelete(co);
@@ -6101,10 +6794,98 @@ bool RasterizerStorageGLES3::has_os_feature(const String &p_feature) const {
////////////////////////////////////////////
-void RasterizerStorageGLES3::initialize() {
+void RasterizerStorageGLES3::set_debug_generate_wireframes(bool p_generate) {
- config.render_arch = RENDER_ARCH_DESKTOP;
- //config.fbo_deferred=int(Globals::get_singleton()->get("rendering/gles3/lighting_technique"));
+ config.generate_wireframes = p_generate;
+}
+
+void RasterizerStorageGLES3::render_info_begin_capture() {
+
+ info.snap = info.render;
+}
+
+void RasterizerStorageGLES3::render_info_end_capture() {
+
+ info.snap.object_count = info.render.object_count - info.snap.object_count;
+ info.snap.draw_call_count = info.render.draw_call_count - info.snap.draw_call_count;
+ info.snap.material_switch_count = info.render.material_switch_count - info.snap.material_switch_count;
+ info.snap.surface_switch_count = info.render.surface_switch_count - info.snap.surface_switch_count;
+ info.snap.shader_rebind_count = info.render.shader_rebind_count - info.snap.shader_rebind_count;
+ info.snap.vertices_count = info.render.vertices_count - info.snap.vertices_count;
+}
+
+int RasterizerStorageGLES3::get_captured_render_info(VS::RenderInfo p_info) {
+
+ switch (p_info) {
+ case VS::INFO_OBJECTS_IN_FRAME: {
+
+ return info.snap.object_count;
+ } break;
+ case VS::INFO_VERTICES_IN_FRAME: {
+
+ return info.snap.vertices_count;
+ } break;
+ case VS::INFO_MATERIAL_CHANGES_IN_FRAME: {
+ return info.snap.material_switch_count;
+ } break;
+ case VS::INFO_SHADER_CHANGES_IN_FRAME: {
+ return info.snap.shader_rebind_count;
+ } break;
+ case VS::INFO_SURFACE_CHANGES_IN_FRAME: {
+ return info.snap.surface_switch_count;
+ } break;
+ case VS::INFO_DRAW_CALLS_IN_FRAME: {
+ return info.snap.draw_call_count;
+ } break;
+ default: {
+ return get_render_info(p_info);
+ }
+ }
+}
+
+int RasterizerStorageGLES3::get_render_info(VS::RenderInfo p_info) {
+
+ switch (p_info) {
+ case VS::INFO_OBJECTS_IN_FRAME: {
+
+ return info.render_final.object_count;
+ } break;
+ case VS::INFO_VERTICES_IN_FRAME: {
+
+ return info.render_final.vertices_count;
+ } break;
+ case VS::INFO_MATERIAL_CHANGES_IN_FRAME: {
+ return info.render_final.material_switch_count;
+ } break;
+ case VS::INFO_SHADER_CHANGES_IN_FRAME: {
+ return info.render_final.shader_rebind_count;
+ } break;
+ case VS::INFO_SURFACE_CHANGES_IN_FRAME: {
+ return info.render_final.surface_switch_count;
+ } break;
+ case VS::INFO_DRAW_CALLS_IN_FRAME: {
+ return info.render_final.draw_call_count;
+ } break;
+ case VS::INFO_USAGE_VIDEO_MEM_TOTAL: {
+
+ return 0; //no idea
+ } break;
+ case VS::INFO_VIDEO_MEM_USED: {
+
+ return info.vertex_mem + info.texture_mem;
+ } break;
+ case VS::INFO_TEXTURE_MEM_USED: {
+
+ return info.texture_mem;
+ } break;
+ case VS::INFO_VERTEX_MEM_USED: {
+
+ return info.vertex_mem;
+ } break;
+ }
+}
+
+void RasterizerStorageGLES3::initialize() {
RasterizerStorageGLES3::system_fbo = 0;
@@ -6114,9 +6895,7 @@ void RasterizerStorageGLES3::initialize() {
{
int max_extensions = 0;
- print_line("getting extensions");
glGetIntegerv(GL_NUM_EXTENSIONS, &max_extensions);
- print_line("total " + itos(max_extensions));
for (int i = 0; i < max_extensions; i++) {
const GLubyte *s = glGetStringi(GL_EXTENSIONS, i);
if (!s)
@@ -6126,20 +6905,24 @@ void RasterizerStorageGLES3::initialize() {
}
config.shrink_textures_x2 = false;
- config.use_fast_texture_filter = int(GlobalConfig::get_singleton()->get("rendering/quality/use_nearest_mipmap_filter"));
- config.use_anisotropic_filter = config.extensions.has("GL_EXT_texture_filter_anisotropic");
+ config.use_fast_texture_filter = int(ProjectSettings::get_singleton()->get("rendering/quality/filters/use_nearest_mipmap_filter"));
+ config.use_anisotropic_filter = config.extensions.has("rendering/quality/filters/anisotropic_filter_level");
- config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_dxt1") || config.extensions.has("GL_EXT_texture_compression_s3tc") || config.extensions.has("WEBGL_compressed_texture_s3tc");
config.etc_supported = config.extensions.has("GL_OES_compressed_ETC1_RGB8_texture");
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;
+ config.s3tc_supported = true;
+ config.rgtc_supported = true; //RGTC - core since OpenGL version 3.0
#else
config.etc2_supported = true;
config.hdr_supported = false;
+ config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_dxt1") || config.extensions.has("GL_EXT_texture_compression_s3tc") || config.extensions.has("WEBGL_compressed_texture_s3tc");
+ config.rgtc_supported = config.extensions.has("GL_EXT_texture_compression_rgtc") || config.extensions.has("GL_ARB_texture_compression_rgtc");
#endif
+
config.pvrtc_supported = config.extensions.has("GL_IMG_texture_compression_pvrtc");
config.srgb_decode_supported = config.extensions.has("GL_EXT_texture_sRGB_decode");
@@ -6147,7 +6930,7 @@ void RasterizerStorageGLES3::initialize() {
config.use_anisotropic_filter = config.extensions.has("GL_EXT_texture_filter_anisotropic");
if (config.use_anisotropic_filter) {
glGetFloatv(_GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &config.anisotropic_level);
- config.anisotropic_level = MIN(int(GlobalConfig::get_singleton()->get("rendering/quality/anisotropic_filter_level")), config.anisotropic_level);
+ config.anisotropic_level = MIN(int(ProjectSettings::get_singleton()->get("rendering/quality/filters/anisotropic_filter_level")), config.anisotropic_level);
}
frame.clear_request = false;
@@ -6254,11 +7037,11 @@ void RasterizerStorageGLES3::initialize() {
glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind
}
- //generic quadie for copying without touching skybox
+ //generic quadie for copying without touching sky
{
//transform feedback buffers
- uint32_t xf_feedback_size = GLOBAL_DEF("rendering/buffers/blend_shape_max_buffer_size_kb", 4096);
+ uint32_t xf_feedback_size = GLOBAL_DEF("rendering/limits/buffers/blend_shape_max_buffer_size_kb", 4096);
for (int i = 0; i < 2; i++) {
glGenBuffers(1, &resources.transform_feedback_buffers[i]);
@@ -6272,6 +7055,8 @@ void RasterizerStorageGLES3::initialize() {
}
shaders.cubemap_filter.init();
+ bool ggx_hq = GLOBAL_GET("rendering/quality/reflections/high_quality_ggx.mobile");
+ shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::LOW_QUALITY, !ggx_hq);
shaders.particles.init();
#ifdef GLES_OVER_GL
@@ -6281,7 +7066,32 @@ void RasterizerStorageGLES3::initialize() {
frame.count = 0;
frame.prev_tick = 0;
frame.delta = 0;
+ frame.current_rt = NULL;
config.keep_original_textures = false;
+ config.generate_wireframes = false;
+ config.use_texture_array_environment = GLOBAL_GET("rendering/quality/reflections/texture_array_reflections");
+
+ config.force_vertex_shading = GLOBAL_GET("rendering/quality/shading/force_vertex_shading");
+
+ GLOBAL_DEF("rendering/quality/depth_prepass/disable", false);
+
+ String renderer = (const char *)glGetString(GL_RENDERER);
+
+ config.no_depth_prepass = !bool(GLOBAL_GET("rendering/quality/depth_prepass/enable"));
+ if (!config.no_depth_prepass) {
+
+ String vendors = GLOBAL_GET("rendering/quality/depth_prepass/disable_for_vendors");
+ Vector<String> vendor_match = vendors.split(",");
+ for (int i = 0; i < vendor_match.size(); i++) {
+ String v = vendor_match[i].strip_edges();
+ if (v == String())
+ continue;
+
+ if (renderer.findn(v) != -1) {
+ config.no_depth_prepass = true;
+ }
+ }
+ }
}
void RasterizerStorageGLES3::finalize() {
diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h
index 50617b8124..3c7ea000ba 100644
--- a/drivers/gles3/rasterizer_storage_gles3.h
+++ b/drivers/gles3/rasterizer_storage_gles3.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,11 +35,11 @@
#include "servers/visual/shader_language.h"
#include "shader_compiler_gles3.h"
#include "shader_gles3.h"
-#include "shaders/blend_shape.glsl.h"
-#include "shaders/canvas.glsl.h"
-#include "shaders/copy.glsl.h"
-#include "shaders/cubemap_filter.glsl.h"
-#include "shaders/particles.glsl.h"
+#include "shaders/blend_shape.glsl.gen.h"
+#include "shaders/canvas.glsl.gen.h"
+#include "shaders/copy.glsl.gen.h"
+#include "shaders/cubemap_filter.glsl.gen.h"
+#include "shaders/particles.glsl.gen.h"
class RasterizerCanvasGLES3;
class RasterizerSceneGLES3;
@@ -47,6 +48,8 @@ class RasterizerSceneGLES3;
#define _DECODE_EXT 0x8A49
#define _SKIP_DECODE_EXT 0x8A4A
+void glTexStorage2DCustom(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type);
+
class RasterizerStorageGLES3 : public RasterizerStorage {
public:
RasterizerCanvasGLES3 *canvas;
@@ -60,14 +63,13 @@ public:
struct Config {
- RenderArchitecture render_arch;
-
bool shrink_textures_x2;
bool use_fast_texture_filter;
bool use_anisotropic_filter;
bool s3tc_supported;
bool latc_supported;
+ bool rgtc_supported;
bool bptc_supported;
bool etc_supported;
bool etc2_supported;
@@ -84,9 +86,16 @@ public:
int max_texture_image_units;
int max_texture_size;
+ bool generate_wireframes;
+
+ bool use_texture_array_environment;
+
Set<String> extensions;
bool keep_original_textures;
+
+ bool no_depth_prepass;
+ bool force_vertex_shading;
} config;
mutable struct Shaders {
@@ -124,12 +133,33 @@ public:
struct Info {
uint64_t texture_mem;
+ uint64_t vertex_mem;
+
+ struct Render {
+ uint32_t object_count;
+ uint32_t draw_call_count;
+ uint32_t material_switch_count;
+ uint32_t surface_switch_count;
+ uint32_t shader_rebind_count;
+ uint32_t vertices_count;
+
+ void reset() {
+ object_count = 0;
+ draw_call_count = 0;
+ material_switch_count = 0;
+ surface_switch_count = 0;
+ shader_rebind_count = 0;
+ vertices_count = 0;
+ }
+ } render, render_final, snap;
- uint32_t render_object_count;
- uint32_t render_material_switch_count;
- uint32_t render_surface_switch_count;
- uint32_t render_shader_rebind_count;
- uint32_t render_vertices_count;
+ Info() {
+
+ texture_mem = 0;
+ vertex_mem = 0;
+ render.reset();
+ render_final.reset();
+ }
} info;
@@ -239,7 +269,7 @@ public:
RenderTarget *render_target;
- Image images[6];
+ Ref<Image> images[6];
VisualServer::TextureDetectCallback detect_3d;
void *detect_3d_ud;
@@ -247,6 +277,9 @@ public:
VisualServer::TextureDetectCallback detect_srgb;
void *detect_srgb_ud;
+ VisualServer::TextureDetectCallback detect_normal;
+ void *detect_normal_ud;
+
Texture() {
using_srgb = false;
@@ -266,6 +299,8 @@ public:
detect_3d_ud = NULL;
detect_srgb = NULL;
detect_srgb_ud = NULL;
+ detect_normal = NULL;
+ detect_normal_ud = NULL;
}
~Texture() {
@@ -279,15 +314,16 @@ public:
mutable RID_Owner<Texture> texture_owner;
- Image _get_gl_image_and_format(const Image &p_image, Image::Format p_format, uint32_t p_flags, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_type, bool &r_compressed, bool &srgb);
+ Ref<Image> _get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool &srgb);
virtual RID texture_create();
virtual void texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT);
- virtual void texture_set_data(RID p_texture, const Image &p_image, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT);
- virtual Image texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) const;
+ virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT);
+ virtual Ref<Image> texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) const;
virtual void texture_set_flags(RID p_texture, uint32_t p_flags);
virtual uint32_t texture_get_flags(RID p_texture) const;
virtual Image::Format texture_get_format(RID p_texture) const;
+ virtual uint32_t texture_get_texid(RID p_texture) const;
virtual uint32_t texture_get_width(RID p_texture) const;
virtual uint32_t texture_get_height(RID p_texture) const;
virtual void texture_set_size_override(RID p_texture, int p_width, int p_height);
@@ -305,20 +341,21 @@ public:
virtual void texture_set_detect_3d_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata);
virtual void texture_set_detect_srgb_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata);
+ virtual void texture_set_detect_normal_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata);
- /* SKYBOX API */
+ /* SKY API */
- struct SkyBox : public RID_Data {
+ struct Sky : public RID_Data {
- RID cubemap;
+ RID panorama;
GLuint radiance;
int radiance_size;
};
- mutable RID_Owner<SkyBox> skybox_owner;
+ mutable RID_Owner<Sky> sky_owner;
- virtual RID skybox_create();
- virtual void skybox_set_texture(RID p_skybox, RID p_cube_map, int p_radiance_size);
+ virtual RID sky_create();
+ virtual void sky_set_texture(RID p_sky, RID p_panorama, int p_radiance_size);
/* SHADER API */
@@ -371,6 +408,8 @@ public:
};
int light_mode;
+ bool uses_screen_texture;
+ bool uses_screen_uv;
} canvas_item;
@@ -403,11 +442,15 @@ public:
int cull_mode;
bool uses_alpha;
+ bool uses_alpha_scissor;
bool unshaded;
bool ontop;
bool uses_vertex;
bool uses_discard;
bool uses_sss;
+ bool uses_screen_texture;
+ bool writes_modelview_or_projection;
+ bool uses_vertex_lighting;
} spatial;
@@ -422,6 +465,7 @@ public:
: dirty_list(this) {
shader = NULL;
+ ubo_size = 0;
valid = false;
custom_code_id = 0;
version = 1;
@@ -433,10 +477,7 @@ public:
mutable RID_Owner<Shader> shader_owner;
- virtual RID shader_create(VS::ShaderMode p_mode = VS::SHADER_SPATIAL);
-
- virtual void shader_set_mode(RID p_shader, VS::ShaderMode p_mode);
- virtual VS::ShaderMode shader_get_mode(RID p_shader) const;
+ virtual RID shader_create();
virtual void shader_set_code(RID p_shader, const String &p_code);
virtual String shader_get_code(RID p_shader) const;
@@ -462,6 +503,8 @@ public:
Vector<RID> textures;
float line_width;
+ RID next_pass;
+
uint32_t index;
uint64_t last_pass;
@@ -485,8 +528,8 @@ public:
mutable SelfList<Material>::List _material_dirty_list;
void _material_make_dirty(Material *p_material) const;
- void _material_add_geometry(RID p_material, Geometry *p_instantiable);
- void _material_remove_geometry(RID p_material, Geometry *p_instantiable);
+ void _material_add_geometry(RID p_material, Geometry *p_geometry);
+ void _material_remove_geometry(RID p_material, Geometry *p_geometry);
mutable RID_Owner<Material> material_owner;
@@ -499,6 +542,7 @@ public:
virtual Variant material_get_param(RID p_material, const StringName &p_param) const;
virtual void material_set_line_width(RID p_material, float p_width);
+ virtual void material_set_next_pass(RID p_material, RID p_next_material);
virtual bool material_is_animated(RID p_material);
virtual bool material_casts_shadows(RID p_material);
@@ -537,6 +581,11 @@ public:
GLuint vertex_id;
GLuint index_id;
+ GLuint index_wireframe_id;
+ GLuint array_wireframe_id;
+ GLuint instancing_array_wireframe_id;
+ int index_wireframe_len;
+
Vector<Rect3> skeleton_bone_aabb;
Vector<bool> skeleton_bone_used;
@@ -567,6 +616,8 @@ public:
mesh->update_multimeshes();
}
+ int total_data_size;
+
Surface() {
array_byte_size = 0;
@@ -581,6 +632,13 @@ public:
primitive = VS::PRIMITIVE_POINTS;
index_array_len = 0;
active = false;
+
+ total_data_size = 0;
+
+ index_wireframe_id = 0;
+ array_wireframe_id = 0;
+ instancing_array_wireframe_id = 0;
+ index_wireframe_len = 0;
}
~Surface() {
@@ -778,7 +836,7 @@ public:
Skeleton()
: update_list(this) {
- size=0;
+ size = 0;
use_2d = false;
texture = 0;
@@ -921,6 +979,7 @@ public:
int dynamic_range;
float energy;
float bias;
+ float normal_bias;
float propagation;
bool interior;
bool compress;
@@ -955,6 +1014,9 @@ public:
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_normal_bias(RID p_probe, float p_range);
+ virtual float gi_probe_get_normal_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;
@@ -987,71 +1049,97 @@ public:
/* PARTICLES */
- struct Particles : public Instantiable {
+ struct Particles : public GeometryOwner {
+ bool inactive;
+ float inactive_time;
bool emitting;
+ bool one_shot;
int amount;
float lifetime;
float pre_process_time;
float explosiveness;
float randomness;
+ bool restart_request;
Rect3 custom_aabb;
- Vector3 gravity;
bool use_local_coords;
RID process_material;
- VS::ParticlesEmissionShape emission_shape;
- float emission_sphere_radius;
- Vector3 emission_box_extents;
- PoolVector<Vector3> emission_points;
- GLuint emission_point_texture;
-
VS::ParticlesDrawOrder draw_order;
- struct DrawPass {
- RID mesh;
- RID material;
- };
- Vector<DrawPass> draw_passes;
-
- Rect3 computed_aabb;
+ Vector<RID> draw_passes;
GLuint particle_buffers[2];
+ GLuint particle_vaos[2];
+
+ GLuint particle_buffer_histories[2];
+ GLuint particle_vao_histories[2];
+ bool particle_valid_histories[2];
+ bool histories_enabled;
SelfList<Particles> particle_element;
float phase;
float prev_phase;
uint64_t prev_ticks;
+ uint32_t random_seed;
+
+ uint32_t cycle_number;
+
+ float speed_scale;
+
+ int fixed_fps;
+ bool fractional_delta;
+ float frame_remainder;
+
+ bool clear;
- Transform origin;
+ Transform emission_transform;
Particles()
: particle_element(this) {
+ cycle_number = 0;
emitting = false;
+ one_shot = false;
amount = 0;
lifetime = 1.0;
pre_process_time = 0.0;
explosiveness = 0.0;
randomness = 0.0;
use_local_coords = true;
+ fixed_fps = 0;
+ fractional_delta = false;
+ frame_remainder = 0;
+ histories_enabled = false;
+ speed_scale = 1.0;
+ random_seed = 0;
+
+ restart_request = false;
+
+ custom_aabb = Rect3(Vector3(-4, -4, -4), Vector3(8, 8, 8));
draw_order = VS::PARTICLES_DRAW_ORDER_INDEX;
- emission_shape = VS::PARTICLES_EMSSION_POINT;
- emission_sphere_radius = 1.0;
- emission_box_extents = Vector3(1, 1, 1);
- emission_point_texture = 0;
particle_buffers[0] = 0;
particle_buffers[1] = 0;
prev_ticks = 0;
+ clear = true;
+ inactive = true;
+ inactive_time = false;
+
glGenBuffers(2, particle_buffers);
+ glGenVertexArrays(2, particle_vaos);
}
~Particles() {
glDeleteBuffers(2, particle_buffers);
+ glDeleteVertexArrays(2, particle_vaos);
+ if (histories_enabled) {
+ glDeleteBuffers(2, particle_buffer_histories);
+ glDeleteVertexArrays(2, particle_vao_histories);
+ }
}
};
@@ -1066,26 +1154,34 @@ public:
virtual void particles_set_emitting(RID p_particles, bool p_emitting);
virtual void particles_set_amount(RID p_particles, int p_amount);
virtual void particles_set_lifetime(RID p_particles, float p_lifetime);
+ virtual void particles_set_one_shot(RID p_particles, bool p_one_shot);
virtual void particles_set_pre_process_time(RID p_particles, float p_time);
virtual void particles_set_explosiveness_ratio(RID p_particles, float p_ratio);
virtual void particles_set_randomness_ratio(RID p_particles, float p_ratio);
virtual void particles_set_custom_aabb(RID p_particles, const Rect3 &p_aabb);
- virtual void particles_set_gravity(RID p_particles, const Vector3 &p_gravity);
+ virtual void particles_set_speed_scale(RID p_particles, float p_scale);
virtual void particles_set_use_local_coordinates(RID p_particles, bool p_enable);
virtual void particles_set_process_material(RID p_particles, RID p_material);
-
- virtual void particles_set_emission_shape(RID p_particles, VS::ParticlesEmissionShape p_shape);
- virtual void particles_set_emission_sphere_radius(RID p_particles, float p_radius);
- virtual void particles_set_emission_box_extents(RID p_particles, const Vector3 &p_extents);
- virtual void particles_set_emission_points(RID p_particles, const PoolVector<Vector3> &p_points);
+ virtual void particles_set_fixed_fps(RID p_particles, int p_fps);
+ virtual void particles_set_fractional_delta(RID p_particles, bool p_enable);
+ virtual void particles_restart(RID p_particles);
virtual void particles_set_draw_order(RID p_particles, VS::ParticlesDrawOrder p_order);
- virtual void particles_set_draw_passes(RID p_particles, int p_count);
- virtual void particles_set_draw_pass_material(RID p_particles, int p_pass, RID p_material);
+ virtual void particles_set_draw_passes(RID p_particles, int p_passes);
virtual void particles_set_draw_pass_mesh(RID p_particles, int p_pass, RID p_mesh);
+ virtual void particles_request_process(RID p_particles);
virtual Rect3 particles_get_current_aabb(RID p_particles);
+ virtual Rect3 particles_get_aabb(RID p_particles) const;
+
+ virtual void _particles_update_histories(Particles *particles);
+
+ virtual void particles_set_emission_transform(RID p_particles, const Transform &p_transform);
+ void _particles_process(Particles *p_particles, float p_delta);
+
+ virtual int particles_get_draw_passes(RID p_particles) const;
+ virtual RID particles_get_draw_pass_mesh(RID p_particles, int p_pass) const;
/* INSTANCE */
@@ -1104,12 +1200,15 @@ public:
GLuint depth;
struct Buffers {
+
+ bool active;
+ bool effects_active;
GLuint fbo;
GLuint depth;
GLuint specular;
GLuint diffuse;
GLuint normal_rough;
- GLuint motion_sss;
+ GLuint sss;
GLuint effect_fbo;
GLuint effect;
@@ -1187,11 +1286,13 @@ public:
buffers.fbo = 0;
used_in_frame = false;
- flags[RENDER_TARGET_VFLIP] = false;
- flags[RENDER_TARGET_TRANSPARENT] = false;
- flags[RENDER_TARGET_NO_3D] = false;
+ for (int i = 0; i < RENDER_TARGET_FLAG_MAX; i++) {
+ flags[i] = false;
+ }
flags[RENDER_TARGET_HDR] = true;
- flags[RENDER_TARGET_NO_SAMPLING] = false;
+
+ buffers.active = false;
+ buffers.effects_active = false;
last_exposure_tick = 0;
}
@@ -1207,7 +1308,8 @@ public:
virtual RID render_target_get_texture(RID p_render_target) const;
virtual void render_target_set_flag(RID p_render_target, RenderTargetFlags p_flag, bool p_value);
- virtual bool render_target_renedered_in_frame(RID p_render_target);
+ virtual bool render_target_was_used(RID p_render_target);
+ virtual void render_target_clear_used(RID p_render_target);
virtual void render_target_set_msaa(RID p_render_target, VS::ViewportMSAA p_msaa);
/* CANVAS SHADOW */
@@ -1229,6 +1331,7 @@ public:
struct CanvasOccluder : public RID_Data {
+ GLuint array_id; // 0 means, unconfigured
GLuint vertex_id; // 0 means, unconfigured
GLuint index_id; // 0 means, unconfigured
PoolVector<Vector2> lines;
@@ -1255,6 +1358,7 @@ public:
float delta;
uint64_t prev_tick;
uint64_t count;
+
} frame;
void initialize();
@@ -1264,6 +1368,14 @@ public:
virtual void update_dirty_resources();
+ virtual void set_debug_generate_wireframes(bool p_generate);
+
+ virtual void render_info_begin_capture();
+ virtual void render_info_end_capture();
+ virtual int get_captured_render_info(VS::RenderInfo p_info);
+
+ virtual int get_render_info(VS::RenderInfo p_info);
+
RasterizerStorageGLES3();
};
diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp
index 48ca86ebe2..c014caee8d 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -91,6 +92,16 @@ static String _prestr(SL::DataPrecision p_pres) {
return "";
}
+static String _qualstr(SL::ArgumentQualifier p_qual) {
+
+ switch (p_qual) {
+ case SL::ARGUMENT_QUALIFIER_IN: return "";
+ case SL::ARGUMENT_QUALIFIER_OUT: return "out ";
+ case SL::ARGUMENT_QUALIFIER_INOUT: return "inout ";
+ }
+ return "";
+}
+
static String _opstr(SL::Operator p_op) {
return SL::get_operator_text(p_op);
@@ -175,6 +186,21 @@ static String get_constant_text(SL::DataType p_type, const Vector<SL::ConstantNo
return text;
} break;
+ case SL::TYPE_MAT2:
+ case SL::TYPE_MAT3:
+ case SL::TYPE_MAT4: {
+
+ String text = "mat" + itos(p_type - SL::TYPE_MAT2 + 2) + "(";
+ for (int i = 0; i < p_values.size(); i++) {
+ if (i > 0)
+ text += ",";
+
+ text += f2sp0(p_values[i].real);
+ }
+ text += ")";
+ return text;
+
+ } break;
default: ERR_FAIL_V(String());
}
}
@@ -194,6 +220,7 @@ void ShaderCompilerGLES3::_dump_function_deps(SL::ShaderNode *p_node, const Stri
for (Set<StringName>::Element *E = p_node->functions[fidx].uses_function.front(); E; E = E->next()) {
+ print_line(String(p_node->functions[fidx].name) + " uses function: " + String(E->get()));
if (added.has(E->get())) {
continue; //was added already
}
@@ -219,7 +246,7 @@ void ShaderCompilerGLES3::_dump_function_deps(SL::ShaderNode *p_node, const Stri
if (i > 0)
header += ", ";
- header += _prestr(fnode->arguments[i].precision) + _typestr(fnode->arguments[i].type) + " " + _mkid(fnode->arguments[i].name);
+ header += _qualstr(fnode->arguments[i].qualifier) + _prestr(fnode->arguments[i].precision) + _typestr(fnode->arguments[i].type) + " " + _mkid(fnode->arguments[i].name);
}
header += ")\n";
@@ -277,6 +304,7 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
uniform_sizes.resize(max_uniforms);
uniform_alignments.resize(max_uniforms);
uniform_defines.resize(max_uniforms);
+ bool uses_uniforms = false;
for (Map<StringName, SL::ShaderNode::Uniform>::Element *E = pnode->uniforms.front(); E; E = E->next()) {
@@ -296,9 +324,10 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
r_gen_code.texture_uniforms[E->get().texture_order] = _mkid(E->key());
r_gen_code.texture_hints[E->get().texture_order] = E->get().hint;
} else {
- if (r_gen_code.uniforms.empty()) {
+ if (!uses_uniforms) {
r_gen_code.defines.push_back(String("#define USE_MATERIAL\n").ascii());
+ uses_uniforms = true;
}
uniform_defines[E->get().order] = ucode;
uniform_sizes[E->get().order] = _get_datatype_size(E->get().type);
@@ -356,7 +385,7 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
String vcode;
vcode += _prestr(E->get().precission);
vcode += _typestr(E->get().type);
- vcode += " " + String(E->key());
+ vcode += " " + _mkid(E->key());
vcode += ";\n";
r_gen_code.vertex_global += "out " + vcode;
r_gen_code.fragment_global += "in " + vcode;
@@ -482,6 +511,12 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
case SL::OP_ASSIGN_BIT_AND:
case SL::OP_ASSIGN_BIT_OR:
case SL::OP_ASSIGN_BIT_XOR:
+ if (onode->arguments[0]->type == SL::Node::TYPE_VARIABLE) {
+ SL::VariableNode *vnode = (SL::VariableNode *)onode->arguments[0];
+ if (p_actions.write_flag_pointers.has(vnode->name)) {
+ *p_actions.write_flag_pointers[vnode->name] = true;
+ }
+ }
code = _dump_node_code(onode->arguments[0], p_level, r_gen_code, p_actions, p_default_actions) + _opstr(onode->op) + _dump_node_code(onode->arguments[1], p_level, r_gen_code, p_actions, p_default_actions);
break;
case SL::OP_BIT_INVERT:
@@ -524,6 +559,24 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
}
code += ")";
} break;
+ case SL::OP_INDEX: {
+
+ code += _dump_node_code(onode->arguments[0], p_level, r_gen_code, p_actions, p_default_actions);
+ code += "[";
+ code += _dump_node_code(onode->arguments[1], p_level, r_gen_code, p_actions, p_default_actions);
+ code += "]";
+
+ } break;
+ case SL::OP_SELECT_IF: {
+
+ code += _dump_node_code(onode->arguments[0], p_level, r_gen_code, p_actions, p_default_actions);
+ code += "?";
+ code += _dump_node_code(onode->arguments[1], p_level, r_gen_code, p_actions, p_default_actions);
+ code += ":";
+ code += _dump_node_code(onode->arguments[2], p_level, r_gen_code, p_actions, p_default_actions);
+
+ } break;
+
default: {
code = "(" + _dump_node_code(onode->arguments[0], p_level, r_gen_code, p_actions, p_default_actions) + _opstr(onode->op) + _dump_node_code(onode->arguments[1], p_level, r_gen_code, p_actions, p_default_actions) + ")";
@@ -543,13 +596,17 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
code += _mktab(p_level) + "else\n";
code += _dump_node_code(cfnode->blocks[1], p_level + 1, r_gen_code, p_actions, p_default_actions);
}
+ } else if (cfnode->flow_op == SL::FLOW_OP_WHILE) {
+
+ code += _mktab(p_level) + "while (" + _dump_node_code(cfnode->expressions[0], p_level, r_gen_code, p_actions, p_default_actions) + ")\n";
+ code += _dump_node_code(cfnode->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions);
} else if (cfnode->flow_op == SL::FLOW_OP_RETURN) {
- if (cfnode->blocks.size()) {
- code = "return " + _dump_node_code(cfnode->blocks[0], p_level, r_gen_code, p_actions, p_default_actions);
+ if (cfnode->expressions.size()) {
+ code = "return " + _dump_node_code(cfnode->expressions[0], p_level, r_gen_code, p_actions, p_default_actions) + ";";
} else {
- code = "return";
+ code = "return;";
}
}
@@ -566,7 +623,7 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
Error ShaderCompilerGLES3::compile(VS::ShaderMode p_mode, const String &p_code, IdentifierActions *p_actions, const String &p_path, GeneratedCode &r_gen_code) {
- Error err = parser.compile(p_code, ShaderTypes::get_singleton()->get_functions(p_mode), ShaderTypes::get_singleton()->get_modes(p_mode));
+ Error err = parser.compile(p_code, ShaderTypes::get_singleton()->get_functions(p_mode), ShaderTypes::get_singleton()->get_modes(p_mode), ShaderTypes::get_singleton()->get_types());
if (err != OK) {
#if 1
@@ -596,6 +653,14 @@ Error ShaderCompilerGLES3::compile(VS::ShaderMode p_mode, const String &p_code,
_dump_node_code(parser.get_shader(), 1, r_gen_code, *p_actions, actions[p_mode]);
+ if (r_gen_code.uniform_total_size) { //uniforms used?
+ int md = sizeof(float) * 4;
+ if (r_gen_code.uniform_total_size % md) {
+ r_gen_code.uniform_total_size += md - (r_gen_code.uniform_total_size % md);
+ }
+ r_gen_code.uniform_total_size += md; //pad just in case
+ }
+
return OK;
}
@@ -613,6 +678,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_CANVAS_ITEM].renames["PROJECTION_MATRIX"] = "projection_matrix";
actions[VS::SHADER_CANVAS_ITEM].renames["EXTRA_MATRIX"] == "extra_matrix";
actions[VS::SHADER_CANVAS_ITEM].renames["TIME"] = "time";
+ actions[VS::SHADER_CANVAS_ITEM].renames["AT_LIGHT_PASS"] = "at_light_pass";
actions[VS::SHADER_CANVAS_ITEM].renames["COLOR"] = "color";
actions[VS::SHADER_CANVAS_ITEM].renames["NORMAL"] = "normal";
@@ -624,7 +690,8 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_CANVAS_ITEM].renames["TEXTURE_PIXEL_SIZE"] = "color_texpixel_size";
actions[VS::SHADER_CANVAS_ITEM].renames["SCREEN_UV"] = "screen_uv";
actions[VS::SHADER_CANVAS_ITEM].renames["SCREEN_TEXTURE"] = "screen_texture";
- actions[VS::SHADER_CANVAS_ITEM].renames["POSITION"] = "(gl_FragCoord.xy)";
+ actions[VS::SHADER_CANVAS_ITEM].renames["SCREEN_PIXEL_SIZE"] = "screen_pixel_size";
+ actions[VS::SHADER_CANVAS_ITEM].renames["FRAGCOORD"] = "gl_FragCoord";
actions[VS::SHADER_CANVAS_ITEM].renames["POINT_COORD"] = "gl_PointCoord";
actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT_VEC"] = "light_vec";
@@ -638,17 +705,20 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_CANVAS_ITEM].usage_defines["COLOR"] = "#define COLOR_USED\n";
actions[VS::SHADER_CANVAS_ITEM].usage_defines["SCREEN_TEXTURE"] = "#define SCREEN_TEXTURE_USED\n";
actions[VS::SHADER_CANVAS_ITEM].usage_defines["SCREEN_UV"] = "#define SCREEN_UV_USED\n";
+ actions[VS::SHADER_CANVAS_ITEM].usage_defines["SCREEN_PIXEL_SIZE"] = "@SCREEN_UV";
actions[VS::SHADER_CANVAS_ITEM].usage_defines["NORMAL"] = "#define NORMAL_USED\n";
actions[VS::SHADER_CANVAS_ITEM].usage_defines["NORMALMAP"] = "#define NORMALMAP_USED\n";
actions[VS::SHADER_CANVAS_ITEM].usage_defines["SHADOW_COLOR"] = "#define SHADOW_COLOR_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].render_mode_defines["skip_transform"] = "#define SKIP_TRANSFORM_USED\n";
+ actions[VS::SHADER_CANVAS_ITEM].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n";
/** SPATIAL SHADER **/
actions[VS::SHADER_SPATIAL].renames["WORLD_MATRIX"] = "world_transform";
actions[VS::SHADER_SPATIAL].renames["INV_CAMERA_MATRIX"] = "camera_inverse_matrix";
+ actions[VS::SHADER_SPATIAL].renames["CAMERA_MATRIX"] = "camera_matrix";
actions[VS::SHADER_SPATIAL].renames["PROJECTION_MATRIX"] = "projection_matrix";
+ actions[VS::SHADER_SPATIAL].renames["MODELVIEW_MATRIX"] = "modelview";
actions[VS::SHADER_SPATIAL].renames["VERTEX"] = "vertex.xyz";
actions[VS::SHADER_SPATIAL].renames["NORMAL"] = "normal";
@@ -671,6 +741,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_SPATIAL].renames["NORMALMAP_DEPTH"] = "normaldepth";
actions[VS::SHADER_SPATIAL].renames["ALBEDO"] = "albedo";
actions[VS::SHADER_SPATIAL].renames["ALPHA"] = "alpha";
+ actions[VS::SHADER_SPATIAL].renames["METALLIC"] = "metallic";
actions[VS::SHADER_SPATIAL].renames["SPECULAR"] = "specular";
actions[VS::SHADER_SPATIAL].renames["ROUGHNESS"] = "roughness";
actions[VS::SHADER_SPATIAL].renames["RIM"] = "rim";
@@ -686,6 +757,12 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_SPATIAL].renames["DISCARD"] = "_discard";
//actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"]=ShaderLanguage::TYPE_VEC2;
actions[VS::SHADER_SPATIAL].renames["POINT_COORD"] = "gl_PointCoord";
+ actions[VS::SHADER_SPATIAL].renames["INSTANCE_CUSTOM"] = "instance_custom";
+ actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"] = "screen_uv";
+ actions[VS::SHADER_SPATIAL].renames["SCREEN_TEXTURE"] = "screen_texture";
+ actions[VS::SHADER_SPATIAL].renames["DEPTH_TEXTURE"] = "depth_buffer";
+ actions[VS::SHADER_SPATIAL].renames["SIDE"] = "side";
+ actions[VS::SHADER_SPATIAL].renames["ALPHA_SCISSOR"] = "alpha_scissor";
actions[VS::SHADER_SPATIAL].usage_defines["TANGENT"] = "#define ENABLE_TANGENT_INTERP\n";
actions[VS::SHADER_SPATIAL].usage_defines["BINORMAL"] = "@TANGENT";
@@ -701,16 +778,31 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_SPATIAL].usage_defines["NORMALMAP"] = "#define ENABLE_NORMALMAP\n";
actions[VS::SHADER_SPATIAL].usage_defines["NORMALMAP_DEPTH"] = "@NORMALMAP";
actions[VS::SHADER_SPATIAL].usage_defines["COLOR"] = "#define ENABLE_COLOR_INTERP\n";
+ actions[VS::SHADER_SPATIAL].usage_defines["INSTANCE_CUSTOM"] = "#define ENABLE_INSTANCE_CUSTOM\n";
+ actions[VS::SHADER_SPATIAL].usage_defines["ALPHA_SCISSOR"] = "#define ALPHA_SCISSOR_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["SSS_STRENGTH"] = "#define ENABLE_SSS_MOTION\n";
+ actions[VS::SHADER_SPATIAL].usage_defines["SSS_STRENGTH"] = "#define ENABLE_SSS\n";
+ actions[VS::SHADER_SPATIAL].usage_defines["SCREEN_TEXTURE"] = "#define SCREEN_TEXTURE_USED\n";
+ actions[VS::SHADER_SPATIAL].usage_defines["SCREEN_UV"] = "#define SCREEN_UV_USED\n";
actions[VS::SHADER_SPATIAL].renames["SSS_STRENGTH"] = "sss_strength";
- actions[VS::SHADER_SPATIAL].render_mode_defines["skip_transform"] = "#define SKIP_TRANSFORM_USED\n";
+ actions[VS::SHADER_SPATIAL].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n";
+ actions[VS::SHADER_SPATIAL].render_mode_defines["world_vertex_coords"] = "#define VERTEX_WORLD_COORDS_USED\n";
+
+ actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_burley"] = "#define DIFFUSE_BURLEY\n";
+ actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_oren_nayar"] = "#define DIFFUSE_OREN_NAYAR\n";
+ actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_half_lambert"] = "#define DIFFUSE_HALF_LAMBERT\n";
+ actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n";
+
+ actions[VS::SHADER_SPATIAL].render_mode_defines["specular_blinn"] = "#define SPECULAR_BLINN\n";
+ actions[VS::SHADER_SPATIAL].render_mode_defines["specular_phong"] = "#define SPECULAR_PHONG\n";
+ actions[VS::SHADER_SPATIAL].render_mode_defines["specular_toon"] = "#define SPECULAR_TOON\n";
+ actions[VS::SHADER_SPATIAL].render_mode_defines["specular_disabled"] = "#define SPECULAR_DISABLED\n";
/* PARTICLES SHADER */
- actions[VS::SHADER_PARTICLES].renames["COLOR"] = "color";
+ actions[VS::SHADER_PARTICLES].renames["COLOR"] = "out_color";
actions[VS::SHADER_PARTICLES].renames["VELOCITY"] = "out_velocity_active.xyz";
actions[VS::SHADER_PARTICLES].renames["MASS"] = "mass";
actions[VS::SHADER_PARTICLES].renames["ACTIVE"] = "active";
@@ -719,13 +811,16 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_PARTICLES].renames["TRANSFORM"] = "xform";
actions[VS::SHADER_PARTICLES].renames["TIME"] = "time";
actions[VS::SHADER_PARTICLES].renames["LIFETIME"] = "lifetime";
- actions[VS::SHADER_PARTICLES].renames["DELTA"] = "delta";
- actions[VS::SHADER_PARTICLES].renames["SEED"] = "seed";
- actions[VS::SHADER_PARTICLES].renames["ORIGIN"] = "origin";
+ actions[VS::SHADER_PARTICLES].renames["DELTA"] = "local_delta";
+ actions[VS::SHADER_PARTICLES].renames["NUMBER"] = "particle_number";
actions[VS::SHADER_PARTICLES].renames["INDEX"] = "index";
+ actions[VS::SHADER_PARTICLES].renames["GRAVITY"] = "current_gravity";
+ actions[VS::SHADER_PARTICLES].renames["EMISSION_TRANSFORM"] = "emission_transform";
+ actions[VS::SHADER_PARTICLES].renames["RANDOM_SEED"] = "random_seed";
actions[VS::SHADER_SPATIAL].render_mode_defines["disable_force"] = "#define DISABLE_FORCE\n";
actions[VS::SHADER_SPATIAL].render_mode_defines["disable_velocity"] = "#define DISABLE_VELOCITY\n";
+ actions[VS::SHADER_SPATIAL].render_mode_defines["keep_data"] = "#define ENABLE_KEEP_DATA\n";
vertex_name = "vertex";
fragment_name = "fragment";
diff --git a/drivers/gles3/shader_compiler_gles3.h b/drivers/gles3/shader_compiler_gles3.h
index 44d6b3a349..e79fdb3ba3 100644
--- a/drivers/gles3/shader_compiler_gles3.h
+++ b/drivers/gles3/shader_compiler_gles3.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,6 +42,7 @@ public:
Map<StringName, Pair<int *, int> > render_mode_values;
Map<StringName, bool *> render_mode_flags;
Map<StringName, bool *> usage_flag_pointers;
+ Map<StringName, bool *> write_flag_pointers;
Map<StringName, ShaderLanguage::ShaderNode::Uniform> *uniforms;
};
diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp
index 3894f24295..20956ad644 100644
--- a/drivers/gles3/shader_gles3.cpp
+++ b/drivers/gles3/shader_gles3.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -99,14 +100,14 @@ void ShaderGLES3::bind_uniforms() {
};
uniforms_dirty = false;
-};
+}
-GLint ShaderGLES3::get_uniform_location(int p_idx) const {
+GLint ShaderGLES3::get_uniform_location(int p_index) const {
ERR_FAIL_COND_V(!version, -1);
- return version->uniform_location[p_idx];
-};
+ return version->uniform_location[p_index];
+}
bool ShaderGLES3::bind() {
@@ -207,6 +208,7 @@ ShaderGLES3::Version *ShaderGLES3::get_current_version() {
Vector<const char *> strings;
#ifdef GLES_OVER_GL
strings.push_back("#version 330\n");
+ strings.push_back("#define GLES_OVER_GL\n");
#else
strings.push_back("#version 300 es\n");
#endif
@@ -271,6 +273,11 @@ ShaderGLES3::Version *ShaderGLES3::get_current_version() {
//vertex precision is high
strings.push_back("precision highp float;\n");
strings.push_back("precision highp int;\n");
+#ifndef GLES_OVER_GL
+ strings.push_back("precision highp sampler2D;\n");
+ strings.push_back("precision highp samplerCube;\n");
+ strings.push_back("precision highp sampler2DArray;\n");
+#endif
#if 0
if (cc) {
@@ -288,16 +295,17 @@ ShaderGLES3::Version *ShaderGLES3::get_current_version() {
#endif
strings.push_back(vertex_code0.get_data());
+
if (cc) {
- code_globals = cc->vertex_globals.ascii();
- strings.push_back(code_globals.get_data());
+ material_string = cc->uniforms.ascii();
+ strings.push_back(material_string.get_data());
}
strings.push_back(vertex_code1.get_data());
if (cc) {
- material_string = cc->uniforms.ascii();
- strings.push_back(material_string.get_data());
+ code_globals = cc->vertex_globals.ascii();
+ strings.push_back(code_globals.get_data());
}
strings.push_back(vertex_code2.get_data());
@@ -360,12 +368,19 @@ ShaderGLES3::Version *ShaderGLES3::get_current_version() {
ERR_FAIL_V(NULL);
}
+ //_display_error_with_code("pepo", strings);
+
/* FRAGMENT SHADER */
strings.resize(strings_base_size);
//fragment precision is medium
strings.push_back("precision highp float;\n");
strings.push_back("precision highp int;\n");
+#ifndef GLES_OVER_GL
+ strings.push_back("precision highp sampler2D;\n");
+ strings.push_back("precision highp samplerCube;\n");
+ strings.push_back("precision highp sampler2DArray;\n");
+#endif
#if 0
if (cc) {
@@ -384,35 +399,36 @@ ShaderGLES3::Version *ShaderGLES3::get_current_version() {
strings.push_back(fragment_code0.get_data());
if (cc) {
- code_globals = cc->fragment_globals.ascii();
- strings.push_back(code_globals.get_data());
+ material_string = cc->uniforms.ascii();
+ strings.push_back(material_string.get_data());
}
strings.push_back(fragment_code1.get_data());
if (cc) {
- material_string = cc->uniforms.ascii();
- strings.push_back(material_string.get_data());
+ code_globals = cc->fragment_globals.ascii();
+ strings.push_back(code_globals.get_data());
}
strings.push_back(fragment_code2.get_data());
if (cc) {
- code_string = cc->fragment.ascii();
+ code_string = cc->light.ascii();
strings.push_back(code_string.get_data());
}
strings.push_back(fragment_code3.get_data());
if (cc) {
- code_string2 = cc->light.ascii();
+ code_string2 = cc->fragment.ascii();
strings.push_back(code_string2.get_data());
}
strings.push_back(fragment_code4.get_data());
#ifdef DEBUG_SHADER
- DEBUG_PRINT("\nFragment Code:\n\n" + String(code_string.get_data()));
+ DEBUG_PRINT("\nFragment Globals:\n\n" + String(code_globals.get_data()));
+ DEBUG_PRINT("\nFragment Code:\n\n" + String(code_string2.get_data()));
for (int i = 0; i < strings.size(); i++) {
//print_line("frag strings "+itos(i)+":"+String(strings[i]));
@@ -614,21 +630,21 @@ void ShaderGLES3::setup(const char **p_conditional_defines, int p_conditional_co
String material_tag = "\nMATERIAL_UNIFORMS";
String code_tag = "\nVERTEX_SHADER_CODE";
String code = vertex_code;
- int cpos = code.find(globals_tag);
+ int cpos = code.find(material_tag);
if (cpos == -1) {
vertex_code0 = code.ascii();
} else {
vertex_code0 = code.substr(0, cpos).ascii();
- code = code.substr(cpos + globals_tag.length(), code.length());
+ code = code.substr(cpos + material_tag.length(), code.length());
- cpos = code.find(material_tag);
+ cpos = code.find(globals_tag);
if (cpos == -1) {
vertex_code1 = code.ascii();
} else {
vertex_code1 = code.substr(0, cpos).ascii();
- String code2 = code.substr(cpos + material_tag.length(), code.length());
+ String code2 = code.substr(cpos + globals_tag.length(), code.length());
cpos = code2.find(code_tag);
if (cpos == -1) {
@@ -648,14 +664,14 @@ void ShaderGLES3::setup(const char **p_conditional_defines, int p_conditional_co
String code_tag = "\nFRAGMENT_SHADER_CODE";
String light_code_tag = "\nLIGHT_SHADER_CODE";
String code = fragment_code;
- int cpos = code.find(globals_tag);
+ int cpos = code.find(material_tag);
if (cpos == -1) {
fragment_code0 = code.ascii();
} else {
fragment_code0 = code.substr(0, cpos).ascii();
//print_line("CODE0:\n"+String(fragment_code0.get_data()));
- code = code.substr(cpos + globals_tag.length(), code.length());
- cpos = code.find(material_tag);
+ code = code.substr(cpos + material_tag.length(), code.length());
+ cpos = code.find(globals_tag);
if (cpos == -1) {
fragment_code1 = code.ascii();
@@ -664,8 +680,8 @@ void ShaderGLES3::setup(const char **p_conditional_defines, int p_conditional_co
fragment_code1 = code.substr(0, cpos).ascii();
//print_line("CODE1:\n"+String(fragment_code1.get_data()));
- String code2 = code.substr(cpos + material_tag.length(), code.length());
- cpos = code2.find(code_tag);
+ String code2 = code.substr(cpos + globals_tag.length(), code.length());
+ cpos = code2.find(light_code_tag);
if (cpos == -1) {
fragment_code2 = code2.ascii();
@@ -674,16 +690,16 @@ void ShaderGLES3::setup(const char **p_conditional_defines, int p_conditional_co
fragment_code2 = code2.substr(0, cpos).ascii();
//print_line("CODE2:\n"+String(fragment_code2.get_data()));
- String code3 = code2.substr(cpos + code_tag.length(), code2.length());
+ String code3 = code2.substr(cpos + light_code_tag.length(), code2.length());
- cpos = code3.find(light_code_tag);
+ cpos = code3.find(code_tag);
if (cpos == -1) {
fragment_code3 = code3.ascii();
} else {
fragment_code3 = code3.substr(0, cpos).ascii();
//print_line("CODE3:\n"+String(fragment_code3.get_data()));
- fragment_code4 = code3.substr(cpos + light_code_tag.length(), code3.length()).ascii();
+ fragment_code4 = code3.substr(cpos + code_tag.length(), code3.length()).ascii();
//print_line("CODE4:\n"+String(fragment_code4.get_data()));
}
}
diff --git a/drivers/gles3/shader_gles3.h b/drivers/gles3/shader_gles3.h
index 6f5ccc9126..6a399a74cc 100644
--- a/drivers/gles3/shader_gles3.h
+++ b/drivers/gles3/shader_gles3.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -305,7 +306,7 @@ public:
};
GLint get_uniform_location(const String &p_name) const;
- GLint get_uniform_location(int p_uniform) const;
+ GLint get_uniform_location(int p_index) const;
static _FORCE_INLINE_ ShaderGLES3 *get_active() { return active; };
bool bind();
@@ -317,9 +318,9 @@ public:
void clear_caches();
uint32_t create_custom_shader();
- void set_custom_shader_code(uint32_t p_id, const String &p_vertex, const String &p_vertex_globals, const String &p_fragment, const String &p_p_light, const String &p_fragment_globals, const String &p_uniforms, const Vector<StringName> &p_texture_uniforms, const Vector<CharString> &p_custom_defines);
- void set_custom_shader(uint32_t p_id);
- void free_custom_shader(uint32_t p_id);
+ void set_custom_shader_code(uint32_t p_code_id, const String &p_vertex, const String &p_vertex_globals, const String &p_fragment, const String &p_light, const String &p_fragment_globals, const String &p_uniforms, const Vector<StringName> &p_texture_uniforms, const Vector<CharString> &p_custom_defines);
+ void set_custom_shader(uint32_t p_code_id);
+ void free_custom_shader(uint32_t p_code_id);
void set_uniform_default(int p_idx, const Variant &p_value) {
diff --git a/drivers/gles3/shaders/SCsub b/drivers/gles3/shaders/SCsub
index f9baeae97d..0c69c8cf74 100644
--- a/drivers/gles3/shaders/SCsub
+++ b/drivers/gles3/shaders/SCsub
@@ -1,22 +1,22 @@
+#!/usr/bin/env python
+
Import('env')
if env['BUILDERS'].has_key('GLES3_GLSL'):
- env.GLES3_GLSL('copy.glsl');
- env.GLES3_GLSL('resolve.glsl');
- env.GLES3_GLSL('canvas.glsl');
- env.GLES3_GLSL('canvas_shadow.glsl');
- env.GLES3_GLSL('scene.glsl');
- env.GLES3_GLSL('cubemap_filter.glsl');
- env.GLES3_GLSL('cube_to_dp.glsl');
- env.GLES3_GLSL('blend_shape.glsl');
- env.GLES3_GLSL('screen_space_reflection.glsl');
- env.GLES3_GLSL('effect_blur.glsl');
- env.GLES3_GLSL('subsurf_scattering.glsl');
- env.GLES3_GLSL('ssao.glsl');
- env.GLES3_GLSL('ssao_minify.glsl');
- env.GLES3_GLSL('ssao_blur.glsl');
- env.GLES3_GLSL('exposure.glsl');
- env.GLES3_GLSL('tonemap.glsl');
- env.GLES3_GLSL('particles.glsl');
-
-
+ env.GLES3_GLSL('copy.glsl');
+ env.GLES3_GLSL('resolve.glsl');
+ env.GLES3_GLSL('canvas.glsl');
+ env.GLES3_GLSL('canvas_shadow.glsl');
+ env.GLES3_GLSL('scene.glsl');
+ env.GLES3_GLSL('cubemap_filter.glsl');
+ env.GLES3_GLSL('cube_to_dp.glsl');
+ env.GLES3_GLSL('blend_shape.glsl');
+ env.GLES3_GLSL('screen_space_reflection.glsl');
+ env.GLES3_GLSL('effect_blur.glsl');
+ env.GLES3_GLSL('subsurf_scattering.glsl');
+ env.GLES3_GLSL('ssao.glsl');
+ env.GLES3_GLSL('ssao_minify.glsl');
+ env.GLES3_GLSL('ssao_blur.glsl');
+ env.GLES3_GLSL('exposure.glsl');
+ env.GLES3_GLSL('tonemap.glsl');
+ env.GLES3_GLSL('particles.glsl');
diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl
index e6c72da8f1..f0dc14c35a 100644
--- a/drivers/gles3/shaders/canvas.glsl
+++ b/drivers/gles3/shaders/canvas.glsl
@@ -6,21 +6,36 @@ layout(location=3) in vec4 color_attrib;
#ifdef USE_TEXTURE_RECT
-layout(location=1) in highp vec4 dst_rect;
-layout(location=2) in highp vec4 src_rect;
+uniform vec4 dst_rect;
+uniform vec4 src_rect;
#else
+#ifdef USE_INSTANCING
+
+layout(location=8) in highp vec4 instance_xform0;
+layout(location=9) in highp vec4 instance_xform1;
+layout(location=10) in highp vec4 instance_xform2;
+layout(location=11) in lowp vec4 instance_color;
+
+#ifdef USE_INSTANCE_CUSTOM
+layout(location=12) in highp vec4 instance_custom_data;
+#endif
+
+#endif
+
layout(location=4) in highp vec2 uv_attrib;
//skeletn
#endif
+uniform highp vec2 color_texpixel_size;
+
layout(std140) uniform CanvasItemData { //ubo:0
highp mat4 projection_matrix;
- highp vec4 time;
+ highp float time;
};
uniform highp mat4 modelview_matrix;
@@ -30,6 +45,12 @@ uniform highp mat4 extra_matrix;
out mediump vec2 uv_interp;
out mediump vec4 color_interp;
+#ifdef USE_NINEPATCH
+
+out highp vec2 pixel_size_interp;
+#endif
+
+
#ifdef USE_LIGHTING
layout(std140) uniform LightData { //ubo:1
@@ -51,18 +72,24 @@ layout(std140) uniform LightData { //ubo:1
out vec4 light_uv_interp;
-#if defined(NORMAL_USED)
+
out vec4 local_rot;
-#endif
+
#ifdef USE_SHADOWS
out highp vec2 pos;
#endif
+const bool at_light_pass = true;
+#else
+const bool at_light_pass = false;
#endif
+#ifdef USE_PARTICLES
+uniform int h_frames;
+uniform int v_frames;
+#endif
-VERTEX_SHADER_GLOBALS
#if defined(USE_MATERIAL)
@@ -74,10 +101,18 @@ MATERIAL_UNIFORMS
#endif
+VERTEX_SHADER_GLOBALS
+
void main() {
vec4 vertex_color = color_attrib;
+#ifdef USE_INSTANCING
+ mat4 extra_matrix2 = extra_matrix * transpose(mat4(instance_xform0,instance_xform1,instance_xform2,vec4(0.0,0.0,0.0,1.0)));
+ vertex_color*=instance_color;
+#else
+ mat4 extra_matrix2 = extra_matrix;
+#endif
#ifdef USE_TEXTURE_RECT
@@ -91,6 +126,22 @@ void main() {
#endif
+#ifdef USE_PARTICLES
+ //scale by texture size
+ outvec.xy/=color_texpixel_size;
+
+ //compute h and v frames and adjust UV interp for animation
+ int total_frames = h_frames * v_frames;
+ int frame = min(int(float(total_frames) *instance_custom_data.z),total_frames-1);
+ float frame_w = 1.0/float(h_frames);
+ float frame_h = 1.0/float(v_frames);
+ uv_interp.x = uv_interp.x * frame_w + frame_w * float(frame % h_frames);
+ uv_interp.y = uv_interp.y * frame_h + frame_h * float(frame / v_frames);
+
+#endif
+
+#define extra_matrix extra_matrix2
+
{
vec2 src_vtx=outvec.xy;
@@ -98,11 +149,19 @@ VERTEX_SHADER_CODE
}
+
+#ifdef USE_NINEPATCH
+
+ pixel_size_interp=abs(dst_rect.zw) * vertex;
+#endif
+
#if !defined(SKIP_TRANSFORM_USED)
outvec = extra_matrix * outvec;
outvec = modelview_matrix * outvec;
#endif
+#undef extra_matrix
+
color_interp = vertex_color;
#ifdef USE_PIXEL_SNAP
@@ -121,7 +180,7 @@ VERTEX_SHADER_CODE
pos=outvec.xy;
#endif
-#if defined(NORMAL_USED)
+
local_rot.xy=normalize( (modelview_matrix * ( extra_matrix * vec4(1.0,0.0,0.0,0.0) )).xy );
local_rot.zw=normalize( (modelview_matrix * ( extra_matrix * vec4(0.0,1.0,0.0,0.0) )).xy );
#ifdef USE_TEXTURE_RECT
@@ -129,7 +188,7 @@ VERTEX_SHADER_CODE
local_rot.zw*=sign(src_rect.w);
#endif
-#endif
+
#endif
@@ -141,6 +200,7 @@ VERTEX_SHADER_CODE
uniform mediump sampler2D color_texture; // texunit:0
uniform highp vec2 color_texpixel_size;
+uniform mediump sampler2D normal_texture; // texunit:1
in mediump vec2 uv_interp;
in mediump vec4 color_interp;
@@ -152,10 +212,15 @@ uniform sampler2D screen_texture; // texunit:-3
#endif
+#if defined(SCREEN_UV_USED)
+
+uniform vec2 screen_pixel_size;
+#endif
+
layout(std140) uniform CanvasItemData {
highp mat4 projection_matrix;
- highp vec4 time;
+ highp float time;
};
@@ -180,9 +245,8 @@ uniform lowp sampler2D light_texture; // texunit:-1
in vec4 light_uv_interp;
-#if defined(NORMAL_USED)
in vec4 local_rot;
-#endif
+
#ifdef USE_SHADOWS
@@ -191,11 +255,14 @@ in highp vec2 pos;
#endif
+const bool at_light_pass = true;
+#else
+const bool at_light_pass = false;
#endif
uniform mediump vec4 final_modulate;
-FRAGMENT_SHADER_GLOBALS
+
layout(location=0) out mediump vec4 frag_color;
@@ -211,11 +278,108 @@ MATERIAL_UNIFORMS
#endif
+FRAGMENT_SHADER_GLOBALS
+
+void light_compute(inout vec3 light,vec3 light_vec,float light_height,vec4 light_color,vec2 light_uv,vec4 shadow,vec3 normal,vec2 uv,vec2 screen_uv,vec4 color) {
+
+#if defined(USE_LIGHT_SHADER_CODE)
+
+LIGHT_SHADER_CODE
+
+#endif
+
+}
+
+#ifdef USE_TEXTURE_RECT
+
+uniform vec4 dst_rect;
+uniform vec4 src_rect;
+uniform bool clip_rect_uv;
+
+#ifdef USE_NINEPATCH
+
+in highp vec2 pixel_size_interp;
+
+uniform int np_repeat_v;
+uniform int np_repeat_h;
+uniform bool np_draw_center;
+//left top right bottom in pixel coordinates
+uniform vec4 np_margins;
+
+
+
+float map_ninepatch_axis(float pixel, float draw_size,float tex_pixel_size,float margin_begin,float margin_end,int np_repeat,inout int draw_center) {
+
+
+ float tex_size = 1.0/tex_pixel_size;
+
+ if (pixel < margin_begin) {
+ return pixel * tex_pixel_size;
+ } else if (pixel >= draw_size-margin_end) {
+ return (tex_size-(draw_size-pixel)) * tex_pixel_size;
+ } else {
+ if (!np_draw_center){
+ draw_center--;
+ }
+
+ if (np_repeat==0) { //stretch
+ //convert to ratio
+ float ratio = (pixel - margin_begin) / (draw_size - margin_begin - margin_end);
+ //scale to source texture
+ return (margin_begin + ratio * (tex_size - margin_begin - margin_end)) * tex_pixel_size;
+ } else if (np_repeat==1) { //tile
+ //convert to ratio
+ float ofs = mod((pixel - margin_begin), tex_size - margin_begin - margin_end);
+ //scale to source texture
+ return (margin_begin + ofs) * tex_pixel_size;
+ } else if (np_repeat==2) { //tile fit
+ //convert to ratio
+ float src_area = draw_size - margin_begin - margin_end;
+ float dst_area = tex_size - margin_begin - margin_end;
+ float scale = max(1.0,floor(src_area / max(dst_area,0.0000001) + 0.5));
+
+ //convert to ratio
+ float ratio = (pixel - margin_begin) / src_area;
+ ratio = mod(ratio * scale,1.0);
+ return (margin_begin + ratio * dst_area) * tex_pixel_size;
+ }
+ }
+
+}
+
+#endif
+#endif
+
+uniform bool use_default_normal;
+
void main() {
vec4 color = color_interp;
-#if defined(NORMAL_USED)
- vec3 normal = vec3(0.0,0.0,1.0);
+ vec2 uv = uv_interp;
+
+#ifdef USE_TEXTURE_RECT
+
+#ifdef USE_NINEPATCH
+
+ int draw_center=2;
+ uv = vec2(
+ map_ninepatch_axis(pixel_size_interp.x,abs(dst_rect.z),color_texpixel_size.x,np_margins.x,np_margins.z,np_repeat_h,draw_center),
+ map_ninepatch_axis(pixel_size_interp.y,abs(dst_rect.w),color_texpixel_size.y,np_margins.y,np_margins.w,np_repeat_v,draw_center)
+ );
+
+ if (draw_center==0) {
+ color.a=0.0;
+ }
+
+ uv = uv*src_rect.zw+src_rect.xy; //apply region if needed
+#endif
+
+ if (clip_rect_uv) {
+
+ vec2 half_texpixel = color_texpixel_size * 0.5;
+ uv = clamp(uv,src_rect.xy+half_texpixel,src_rect.xy+abs(src_rect.zw)-color_texpixel_size);
+ }
+
#endif
#if !defined(COLOR_USED)
@@ -223,17 +387,38 @@ void main() {
#ifdef USE_DISTANCE_FIELD
const float smoothing = 1.0/32.0;
- float distance = texture(color_texture, uv_interp).a;
+ float distance = textureLod(color_texture, uv,0.0).a;
color.a = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance) * color.a;
#else
- color *= texture( color_texture, uv_interp );
+ color *= texture( color_texture, uv );
#endif
#endif
-#if defined(ENABLE_SCREEN_UV)
- vec2 screen_uv = gl_FragCoord.xy*screen_uv_mult;
+
+
+ vec3 normal;
+
+#if defined(NORMAL_USED)
+
+ bool normal_used = true;
+#else
+ bool normal_used = false;
+#endif
+
+ if (use_default_normal) {
+ normal.xy = textureLod(normal_texture, uv,0.0).xy * 2.0 - 1.0;
+ normal.z = sqrt(1.0-dot(normal.xy,normal.xy));
+ normal_used=true;
+ } else {
+ normal = vec3(0.0,0.0,1.0);
+ }
+
+
+
+#if defined(SCREEN_UV_USED)
+ vec2 screen_uv = gl_FragCoord.xy*screen_pixel_size;
#endif
@@ -266,9 +451,9 @@ FRAGMENT_SHADER_CODE
vec2 light_vec = light_uv_interp.zw;; //for shadow and normal mapping
-#if defined(NORMAL_USED)
- normal.xy = mat2(local_rot.xy,local_rot.zw) * normal.xy;
-#endif
+ if (normal_used) {
+ normal.xy = mat2(local_rot.xy,local_rot.zw) * normal.xy;
+ }
float att=1.0;
@@ -285,18 +470,15 @@ FRAGMENT_SHADER_CODE
#if defined(USE_LIGHT_SHADER_CODE)
//light is written by the light shader
- {
- vec4 light_out=light*color;
-LIGHT_SHADER_CODE
- color=light_out;
- }
+ light_compute(light,light_vec,light_height,light_color,light_uv,shadow,normal,uv,screen_uv,color);
#else
-#if defined(NORMAL_USED)
- vec3 light_normal = normalize(vec3(light_vec,-light_height));
- light*=max(dot(-light_normal,normal),0.0);
-#endif
+ if (normal_used) {
+
+ vec3 light_normal = normalize(vec3(light_vec,-light_height));
+ light*=max(dot(-light_normal,normal),0.0);
+ }
color*=light;
/*
@@ -350,11 +532,11 @@ LIGHT_SHADER_CODE
#ifdef USE_RGBA_SHADOWS
-#define SHADOW_DEPTH(m_tex,m_uv) dot(texture2D((m_tex),(m_uv)),vec4(1.0 / (256.0 * 256.0 * 256.0),1.0 / (256.0 * 256.0),1.0 / 256.0,1) )
+#define SHADOW_DEPTH(m_tex,m_uv) dot(texture((m_tex),(m_uv)),vec4(1.0 / (256.0 * 256.0 * 256.0),1.0 / (256.0 * 256.0),1.0 / 256.0,1) )
#else
-#define SHADOW_DEPTH(m_tex,m_uv) (texture2D((m_tex),(m_uv)).r)
+#define SHADOW_DEPTH(m_tex,m_uv) (texture((m_tex),(m_uv)).r)
#endif
@@ -373,7 +555,7 @@ LIGHT_SHADER_CODE
#ifdef SHADOW_FILTER_NEAREST
- SHADOW_TEST(su+shadowpixel_size);
+ SHADOW_TEST(su);
#endif
diff --git a/drivers/gles3/shaders/copy.glsl b/drivers/gles3/shaders/copy.glsl
index a87d62f2d7..d33193ee50 100644
--- a/drivers/gles3/shaders/copy.glsl
+++ b/drivers/gles3/shaders/copy.glsl
@@ -2,14 +2,14 @@
layout(location=0) in highp vec4 vertex_attrib;
-#ifdef USE_CUBEMAP
+#if defined(USE_CUBEMAP) || defined(USE_PANORAMA)
layout(location=4) in vec3 cube_in;
#else
layout(location=4) in vec2 uv_in;
#endif
layout(location=5) in vec2 uv2_in;
-#ifdef USE_CUBEMAP
+#if defined(USE_CUBEMAP) || defined(USE_PANORAMA)
out vec3 cube_interp;
#else
out vec2 uv_interp;
@@ -17,62 +17,131 @@ out vec2 uv_interp;
out vec2 uv2_interp;
+#ifdef USE_COPY_SECTION
+
+uniform vec4 copy_section;
+
+#endif
+
void main() {
-#ifdef USE_CUBEMAP
+#if defined(USE_CUBEMAP) || defined(USE_PANORAMA)
cube_interp = cube_in;
#else
uv_interp = uv_in;
+#ifdef V_FLIP
+ uv_interp.y = 1.0-uv_interp.y;
+#endif
+
#endif
uv2_interp = uv2_in;
gl_Position = vertex_attrib;
+
+#ifdef USE_COPY_SECTION
+
+ uv_interp = copy_section.xy + uv_interp * copy_section.zw;
+ gl_Position.xy = (copy_section.xy + (gl_Position.xy * 0.5 + 0.5) * copy_section.zw) * 2.0 - 1.0;
+#endif
+
}
[fragment]
+#define M_PI 3.14159265359
-#ifdef USE_CUBEMAP
+#if !defined(USE_GLES_OVER_GL)
+precision mediump float;
+#endif
+
+#if defined(USE_CUBEMAP) || defined(USE_PANORAMA)
in vec3 cube_interp;
-uniform samplerCube source_cube; //texunit:0
#else
in vec2 uv_interp;
+#endif
+
+#ifdef USE_CUBEMAP
+uniform samplerCube source_cube; //texunit:0
+#else
uniform sampler2D source; //texunit:0
#endif
-float sRGB_gamma_correct(float c){
- float a = 0.055;
- if(c < 0.0031308)
- return 12.92*c;
- else
- return (1.0+a)*pow(c, 1.0/2.4) - a;
+#ifdef USE_MULTIPLIER
+uniform float multiplier;
+#endif
+
+#ifdef USE_PANORAMA
+
+vec4 texturePanorama(vec3 normal,sampler2D pano ) {
+
+ vec2 st = vec2(
+ atan(normal.x, normal.z),
+ acos(normal.y)
+ );
+
+ if(st.x < 0.0)
+ st.x += M_PI*2.0;
+
+ st/=vec2(M_PI*2.0,M_PI);
+
+ return textureLod(pano,st,0.0);
+
}
+#endif
+
uniform float stuff;
uniform vec2 pixel_size;
in vec2 uv2_interp;
+
+#ifdef USE_BCS
+
+uniform vec3 bcs;
+
+#endif
+
+#ifdef USE_COLOR_CORRECTION
+
+uniform sampler2D color_correction; //texunit:1
+
+#endif
+
layout(location = 0) out vec4 frag_color;
+
+
+
void main() {
//vec4 color = color_interp;
-#ifdef USE_CUBEMAP
+#ifdef USE_PANORAMA
+
+ vec4 color = texturePanorama( normalize(cube_interp), source );
+
+#elif defined(USE_CUBEMAP)
vec4 color = texture( source_cube, normalize(cube_interp) );
#else
- vec4 color = texture( source, uv_interp );
+ vec4 color = textureLod( source, uv_interp,0.0 );
#endif
+
+
#ifdef LINEAR_TO_SRGB
//regular Linear -> SRGB conversion
vec3 a = vec3(0.055);
color.rgb = mix( (vec3(1.0)+a)*pow(color.rgb,vec3(1.0/2.4))-a , 12.92*color.rgb , lessThan(color.rgb,vec3(0.0031308)));
#endif
+#ifdef SRGB_TO_LINEAR
+
+ color.rgb = mix(pow((color.rgb + vec3(0.055)) * (1.0 / (1 + 0.055)),vec3(2.4)),color.rgb * (1.0 / 12.92),lessThan(color.rgb,vec3(0.04045)));
+#endif
+
#ifdef DEBUG_GRADIENT
color.rg=uv_interp;
color.b=0.0;
@@ -99,7 +168,24 @@ void main() {
color+=texture( source, uv_interp+vec2( 0.0,-2.0)*pixel_size )*0.06136;
#endif
+#ifdef USE_BCS
+ color.rgb = mix(vec3(0.0),color.rgb,bcs.x);
+ color.rgb = mix(vec3(0.5),color.rgb,bcs.y);
+ color.rgb = mix(vec3(dot(vec3(1.0),color.rgb)*0.33333),color.rgb,bcs.z);
+
+#endif
+
+#ifdef USE_COLOR_CORRECTION
+
+ color.r = texture(color_correction,vec2(color.r,0.0)).r;
+ color.g = texture(color_correction,vec2(color.g,0.0)).g;
+ color.b = texture(color_correction,vec2(color.b,0.0)).b;
+#endif
+
+#ifdef USE_MULTIPLIER
+ color.rgb*=multiplier;
+#endif
frag_color = color;
}
diff --git a/drivers/gles3/shaders/cubemap_filter.glsl b/drivers/gles3/shaders/cubemap_filter.glsl
index 768d20ad22..485fbb6ee0 100644
--- a/drivers/gles3/shaders/cubemap_filter.glsl
+++ b/drivers/gles3/shaders/cubemap_filter.glsl
@@ -19,8 +19,19 @@ void main() {
precision highp float;
precision highp int;
+#ifdef USE_SOURCE_PANORAMA
+uniform sampler2D source_panorama; //texunit:0
+#endif
+
+#ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
+uniform sampler2DArray source_dual_paraboloid_array; //texunit:0
+uniform int source_array_index;
+#endif
+#if !defined(USE_SOURCE_DUAL_PARABOLOID_ARRAY) && !defined(USE_SOURCE_PANORAMA)
uniform samplerCube source_cube; //texunit:0
+#endif
+
uniform int face_id;
uniform float roughness;
in highp vec2 uv_interp;
@@ -165,6 +176,43 @@ vec2 Hammersley(uint i, uint N) {
uniform bool z_flip;
+#ifdef USE_SOURCE_PANORAMA
+
+vec4 texturePanorama(vec3 normal,sampler2D pano ) {
+
+ vec2 st = vec2(
+ atan(normal.x, normal.z),
+ acos(normal.y)
+ );
+
+ if(st.x < 0.0)
+ st.x += M_PI*2.0;
+
+ st/=vec2(M_PI*2.0,M_PI);
+
+ return textureLod(pano,st,0.0);
+
+}
+
+#endif
+
+#ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
+
+
+vec4 textureDualParaboloidArray(vec3 normal) {
+
+ vec3 norm = normalize(normal);
+ norm.xy/=1.0+abs(norm.z);
+ norm.xy=norm.xy * vec2(0.5,0.25) + vec2(0.5,0.25);
+ if (norm.z<0.0) {
+ norm.y=0.5-norm.y+0.5;
+ }
+ return textureLod(source_dual_paraboloid_array, vec3(norm.xy, float(source_array_index) ), 0.0);
+
+}
+
+#endif
+
void main() {
#ifdef USE_DUAL_PARABOLOID
@@ -173,9 +221,8 @@ void main() {
N.z = 0.5 - 0.5*((N.x * N.x) + (N.y * N.y));
N = normalize(N);
- if (!z_flip) {
+ if (z_flip) {
N.y=-N.y; //y is flipped to improve blending between both sides
- } else {
N.z=-N.z;
}
@@ -188,7 +235,24 @@ void main() {
#ifdef USE_DIRECT_WRITE
+#ifdef USE_SOURCE_PANORAMA
+
+ frag_color=vec4(texturePanorama(N,source_panorama).rgb,1.0);
+#endif
+
+#ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
+
+ frag_color=vec4(textureDualParaboloidArray(N).rgb,1.0);
+#endif
+
+#if !defined(USE_SOURCE_DUAL_PARABOLOID_ARRAY) && !defined(USE_SOURCE_PANORAMA)
+
+ N.y=-N.y;
frag_color=vec4(texture(N,source_cube).rgb,1.0);
+#endif
+
+
+
#else
@@ -204,7 +268,19 @@ void main() {
float ndotl = clamp(dot(N, L),0.0,1.0);
if (ndotl>0.0) {
+#ifdef USE_SOURCE_PANORAMA
+ sum.rgb += texturePanorama(H,source_panorama).rgb *ndotl;
+#endif
+
+#ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
+
+ sum.rgb += textureDualParaboloidArray(H).rgb *ndotl;
+#endif
+
+#if !defined(USE_SOURCE_DUAL_PARABOLOID_ARRAY) && !defined(USE_SOURCE_PANORAMA)
+ H.y=-H.y;
sum.rgb += textureLod(source_cube, H, 0.0).rgb *ndotl;
+#endif
sum.a += ndotl;
}
}
diff --git a/drivers/gles3/shaders/effect_blur.glsl b/drivers/gles3/shaders/effect_blur.glsl
index 89afa12f60..09e522866c 100644
--- a/drivers/gles3/shaders/effect_blur.glsl
+++ b/drivers/gles3/shaders/effect_blur.glsl
@@ -6,15 +6,28 @@ layout(location=4) in vec2 uv_in;
out vec2 uv_interp;
+#ifdef USE_BLUR_SECTION
+
+uniform vec4 blur_section;
+
+#endif
void main() {
uv_interp = uv_in;
gl_Position = vertex_attrib;
+#ifdef USE_BLUR_SECTION
+
+ uv_interp = blur_section.xy + uv_interp * blur_section.zw;
+ gl_Position.xy = (blur_section.xy + (gl_Position.xy * 0.5 + 0.5) * blur_section.zw) * 2.0 - 1.0;
+#endif
}
[fragment]
+#if !defined(GLES_OVER_GL)
+precision mediump float;
+#endif
in vec2 uv_interp;
uniform sampler2D source_color; //texunit:0
@@ -89,7 +102,7 @@ uniform highp float auto_exposure_grey;
#endif
uniform float glow_bloom;
-uniform float glow_hdr_treshold;
+uniform float glow_hdr_threshold;
uniform float glow_hdr_scale;
#endif
@@ -252,7 +265,7 @@ void main() {
frag_color*=exposure;
float luminance = max(frag_color.r,max(frag_color.g,frag_color.b));
- float feedback = max( smoothstep(glow_hdr_treshold,glow_hdr_treshold+glow_hdr_scale,luminance), glow_bloom );
+ float feedback = max( smoothstep(glow_hdr_threshold,glow_hdr_threshold+glow_hdr_scale,luminance), glow_bloom );
frag_color *= feedback;
@@ -275,4 +288,3 @@ void main() {
}
-
diff --git a/drivers/gles3/shaders/particles.glsl b/drivers/gles3/shaders/particles.glsl
index e72f12cc5e..a62c124dfe 100644
--- a/drivers/gles3/shaders/particles.glsl
+++ b/drivers/gles3/shaders/particles.glsl
@@ -22,16 +22,22 @@ struct Attractor {
#define MAX_ATTRACTORS 64
-uniform mat4 origin;
+uniform bool emitting;
uniform float system_phase;
uniform float prev_system_phase;
-uniform float total_particles;
+uniform int total_particles;
uniform float explosiveness;
-uniform vec4 time;
+uniform float randomness;
+uniform float time;
uniform float delta;
-uniform vec3 gravity;
+
uniform int attractor_count;
uniform Attractor attractors[MAX_ATTRACTORS];
+uniform bool clear;
+uniform uint cycle;
+uniform float lifetime;
+uniform mat4 emission_transform;
+uniform uint random_seed;
out highp vec4 out_color; //tfb:
@@ -41,7 +47,6 @@ out highp vec4 out_xform_1; //tfb:
out highp vec4 out_xform_2; //tfb:
out highp vec4 out_xform_3; //tfb:
-VERTEX_SHADER_GLOBALS
#if defined(USE_MATERIAL)
@@ -53,56 +58,136 @@ MATERIAL_UNIFORMS
#endif
+
+VERTEX_SHADER_GLOBALS
+
+uint hash(uint x) {
+
+ x = ((x >> uint(16)) ^ x) * uint(0x45d9f3b);
+ x = ((x >> uint(16)) ^ x) * uint(0x45d9f3b);
+ x = (x >> uint(16)) ^ x;
+ return x;
+}
+
+
void main() {
+#ifdef PARTICLES_COPY
+
+ out_color=color;
+ out_velocity_active=velocity_active;
+ out_custom = custom;
+ out_xform_1 = xform_1;
+ out_xform_2 = xform_2;
+ out_xform_3 = xform_3;
+
+#else
+
bool apply_forces=true;
bool apply_velocity=true;
+ float local_delta=delta;
float mass = 1.0;
- float restart_phase = float(gl_InstanceID)/total_particles;
- restart_phase*= explosiveness;
+ float restart_phase = float(gl_VertexID)/float(total_particles);
+
+ if (randomness>0.0) {
+ uint seed = cycle;
+ if (restart_phase >= system_phase) {
+ seed-=uint(1);
+ }
+ seed*=uint(total_particles);
+ seed+=uint(gl_VertexID);
+ float random = float(hash(seed) % uint(65536)) / 65536.0;
+ restart_phase+=randomness * random * 1.0 / float(total_particles);
+ }
+
+ restart_phase*= (1.0-explosiveness);
bool restart=false;
- bool active = out_velocity_active.a > 0.5;
+ bool shader_active = velocity_active.a > 0.5;
if (system_phase > prev_system_phase) {
- restart = prev_system_phase < restart_phase && system_phase >= restart_phase;
+ // restart_phase >= prev_system_phase is used so particles emit in the first frame they are processed
+
+ if (restart_phase >= prev_system_phase && restart_phase < system_phase ) {
+ restart=true;
+#ifdef USE_FRACTIONAL_DELTA
+ local_delta = (system_phase - restart_phase) * lifetime;
+#endif
+ }
+
} else {
- restart = prev_system_phase < restart_phase || system_phase >= restart_phase;
+ if (restart_phase >= prev_system_phase) {
+ restart=true;
+#ifdef USE_FRACTIONAL_DELTA
+ local_delta = (1.0 - restart_phase + system_phase) * lifetime;
+#endif
+ } else if (restart_phase < system_phase ) {
+ restart=true;
+#ifdef USE_FRACTIONAL_DELTA
+ local_delta = (system_phase - restart_phase) * lifetime;
+#endif
+ }
}
- if (restart) {
- active=true;
+ uint current_cycle = cycle;
+
+ if (system_phase < restart_phase) {
+ current_cycle-=uint(1);
}
- out_color=color;
- out_velocity_active=velocity_active;
- out_custom=custom;
+ uint particle_number = current_cycle * uint(total_particles) + uint(gl_VertexID);
+ int index = int(gl_VertexID);
- mat4 xform = transpose(mat4(xform_1,xform_2,xform_3,vec4(vec3(0.0),1.0)));
+ if (restart) {
+ shader_active=emitting;
+ }
+ mat4 xform;
- out_rot_active=rot_active;
+#if defined(ENABLE_KEEP_DATA)
+ if (clear) {
+#else
+ if (clear || restart) {
+#endif
+ out_color=vec4(1.0);
+ out_velocity_active=vec4(0.0);
+ out_custom=vec4(0.0);
+ if (!restart)
+ shader_active=false;
+
+ xform = mat4(
+ vec4(1.0,0.0,0.0,0.0),
+ vec4(0.0,1.0,0.0,0.0),
+ vec4(0.0,0.0,1.0,0.0),
+ vec4(0.0,0.0,0.0,1.0)
+ );
+ } else {
+ out_color=color;
+ out_velocity_active=velocity_active;
+ out_custom=custom;
+ xform = transpose(mat4(xform_1,xform_2,xform_3,vec4(vec3(0.0),1.0)));
+ }
- if (active) {
+ if (shader_active) {
//execute shader
{
- VERTEX_SHADER_CODE
+VERTEX_SHADER_CODE
}
#if !defined(DISABLE_FORCE)
- {
+ if (false) {
- vec3 force = gravity;
+ vec3 force = vec3(0.0);
for(int i=0;i<attractor_count;i++) {
- vec3 rel_vec = out_pos_lifetime.xyz - attractors[i].pos;
- float dist = rel_vec.length();
+ vec3 rel_vec = xform[3].xyz - attractors[i].pos;
+ float dist = length(rel_vec);
if (attractors[i].radius < dist)
continue;
- if (attractors[i].eat_radius>0 && attractors[i].eat_radius > dist) {
+ if (attractors[i].eat_radius>0.0 && attractors[i].eat_radius > dist) {
out_velocity_active.a=0.0;
}
@@ -119,27 +204,30 @@ void main() {
}
}
- out_velocity_seed.xyz += force * delta;
+ out_velocity_active.xyz += force * local_delta;
}
#endif
#if !defined(DISABLE_VELOCITY)
- {
+ if (true) {
- out_pos_lifetime.xyz += out_velocity_seed.xyz * delta;
+ xform[3].xyz += out_velocity_active.xyz * local_delta;
}
#endif
+ } else {
+ xform=mat4(0.0);
}
xform = transpose(xform);
- out_velocity_active.a = mix(0.0,1.0,active);
+ out_velocity_active.a = mix(0.0,1.0,shader_active);
out_xform_1 = xform[0];
out_xform_2 = xform[1];
out_xform_3 = xform[2];
+#endif //PARTICLES_COPY
}
@@ -147,7 +235,6 @@ void main() {
//any code here is never executed, stuff is filled just so it works
-FRAGMENT_SHADER_GLOBALS
#if defined(USE_MATERIAL)
@@ -159,9 +246,15 @@ MATERIAL_UNIFORMS
#endif
+FRAGMENT_SHADER_GLOBALS
+
void main() {
{
- FRAGMENT_SHADER_CODE
+LIGHT_SHADER_CODE
+ }
+
+ {
+FRAGMENT_SHADER_CODE
}
}
diff --git a/drivers/gles3/shaders/resolve.glsl b/drivers/gles3/shaders/resolve.glsl
index 6acc712299..0b50a9c57b 100644
--- a/drivers/gles3/shaders/resolve.glsl
+++ b/drivers/gles3/shaders/resolve.glsl
@@ -15,12 +15,15 @@ void main() {
[fragment]
+#if !defined(GLES_OVER_GL)
+precision mediump float;
+#endif
in vec2 uv_interp;
uniform sampler2D source_specular; //texunit:0
uniform sampler2D source_ssr; //texunit:1
-uniform float stuff;
+uniform vec2 pixel_size;
in vec2 uv2_interp;
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index ffc41e611b..3f0498746b 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -52,6 +52,10 @@ layout(location=9) in highp vec4 instance_xform1;
layout(location=10) in highp vec4 instance_xform2;
layout(location=11) in lowp vec4 instance_color;
+#if defined(ENABLE_INSTANCE_CUSTOM)
+layout(location=12) in highp vec4 instance_custom_data;
+#endif
+
#endif
layout(std140) uniform SceneData { //ubo:0
@@ -59,30 +63,46 @@ layout(std140) uniform SceneData { //ubo:0
highp mat4 projection_matrix;
highp mat4 camera_inverse_matrix;
highp mat4 camera_matrix;
- highp vec4 time;
- highp vec4 ambient_light_color;
- highp vec4 bg_color;
- float ambient_energy;
- float bg_energy;
+ mediump vec4 ambient_light_color;
+ mediump vec4 bg_color;
- float shadow_z_offset;
- float shadow_z_slope_scale;
- float shadow_dual_paraboloid_render_zfar;
- float shadow_dual_paraboloid_render_side;
+ mediump vec4 fog_color_enabled;
+ mediump vec4 fog_sun_color_amount;
- highp vec2 screen_pixel_size;
- vec2 shadow_atlas_pixel_size;
- vec2 directional_shadow_pixel_size;
+ mediump float ambient_energy;
+ mediump float bg_energy;
- float reflection_multiplier;
- float subsurface_scatter_width;
- float ambient_occlusion_affect_light;
+ mediump float z_offset;
+ mediump float z_slope_scale;
+ highp float shadow_dual_paraboloid_render_zfar;
+ highp float shadow_dual_paraboloid_render_side;
+
+ highp vec2 screen_pixel_size;
+ highp vec2 shadow_atlas_pixel_size;
+ highp vec2 directional_shadow_pixel_size;
+
+ highp float time;
+ highp float z_far;
+ mediump float reflection_multiplier;
+ mediump float subsurface_scatter_width;
+ mediump float ambient_occlusion_affect_light;
+
+ bool fog_depth_enabled;
+ highp float fog_depth_begin;
+ highp float fog_depth_curve;
+ bool fog_transmit_enabled;
+ highp float fog_transmit_curve;
+ bool fog_height_enabled;
+ highp float fog_height_min;
+ highp float fog_height_max;
+ highp float fog_height_curve;
};
uniform highp mat4 world_transform;
+
#ifdef USE_LIGHT_DIRECTIONAL
layout(std140) uniform DirectionalLightData { //ubo:3
@@ -102,6 +122,90 @@ layout(std140) uniform DirectionalLightData { //ubo:3
#endif
+#ifdef USE_VERTEX_LIGHTING
+//omni and spot
+
+struct LightData {
+
+ highp vec4 light_pos_inv_radius;
+ mediump vec4 light_direction_attenuation;
+ mediump vec4 light_color_energy;
+ mediump vec4 light_params; //cone attenuation, angle, specular, shadow enabled,
+ mediump vec4 light_clamp;
+ mediump vec4 shadow_color_contact;
+ highp mat4 shadow_matrix;
+
+};
+
+
+layout(std140) uniform OmniLightData { //ubo:4
+
+ LightData omni_lights[MAX_LIGHT_DATA_STRUCTS];
+};
+
+layout(std140) uniform SpotLightData { //ubo:5
+
+ LightData spot_lights[MAX_LIGHT_DATA_STRUCTS];
+};
+
+#ifdef USE_FORWARD_LIGHTING
+
+
+uniform int omni_light_indices[MAX_FORWARD_LIGHTS];
+uniform int omni_light_count;
+
+uniform int spot_light_indices[MAX_FORWARD_LIGHTS];
+uniform int spot_light_count;
+
+#endif
+
+out vec4 diffuse_light_interp;
+out vec4 specular_light_interp;
+
+void light_compute(vec3 N, vec3 L,vec3 V, vec3 light_color,float roughness,inout vec3 diffuse, inout vec3 specular) {
+
+ float dotNL = max(dot(N,L), 0.0 );
+ diffuse += dotNL * light_color;
+
+ if (roughness > 0.0) {
+
+ vec3 H = normalize(V + L);
+ float dotNH = max(dot(N,H), 0.0 );
+ float intensity = pow( dotNH, (1.0-roughness) * 256.0);
+ specular += light_color * intensity;
+
+ }
+}
+
+void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal, float roughness,inout vec3 diffuse, inout vec3 specular) {
+
+ vec3 light_rel_vec = omni_lights[idx].light_pos_inv_radius.xyz-vertex;
+ float light_length = length( light_rel_vec );
+ float normalized_distance = light_length*omni_lights[idx].light_pos_inv_radius.w;
+ vec3 light_attenuation = vec3(pow( max(1.0 - normalized_distance, 0.0), omni_lights[idx].light_direction_attenuation.w ));
+
+ light_compute(normal,normalize(light_rel_vec),eye_vec,omni_lights[idx].light_color_energy.rgb * light_attenuation,roughness,diffuse,specular);
+
+}
+
+void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, float roughness, inout vec3 diffuse, inout vec3 specular) {
+
+ vec3 light_rel_vec = spot_lights[idx].light_pos_inv_radius.xyz-vertex;
+ float light_length = length( light_rel_vec );
+ float normalized_distance = light_length*spot_lights[idx].light_pos_inv_radius.w;
+ vec3 light_attenuation = vec3(pow( max(1.0 - normalized_distance, 0.001), spot_lights[idx].light_direction_attenuation.w ));
+ vec3 spot_dir = spot_lights[idx].light_direction_attenuation.xyz;
+ float spot_cutoff=spot_lights[idx].light_params.y;
+ float scos = max(dot(-normalize(light_rel_vec), spot_dir),spot_cutoff);
+ float spot_rim = (1.0 - scos) / (1.0 - spot_cutoff);
+ light_attenuation *= 1.0 - pow( max(spot_rim,0.001), spot_lights[idx].light_params.x);
+
+
+ light_compute(normal,normalize(light_rel_vec),eye_vec,spot_lights[idx].light_color_energy.rgb*light_attenuation,roughness,diffuse,specular);
+}
+
+
+#endif
/* Varyings */
@@ -127,7 +231,7 @@ out vec3 binormal_interp;
#endif
-VERTEX_SHADER_GLOBALS
+
#if defined(USE_MATERIAL)
@@ -140,6 +244,8 @@ MATERIAL_UNIFORMS
#endif
+VERTEX_SHADER_GLOBALS
+
#ifdef RENDER_DEPTH_DUAL_PARABOLOID
out highp float dp_clip;
@@ -149,7 +255,7 @@ out highp float dp_clip;
#define SKELETON_TEXTURE_WIDTH 256
#ifdef USE_SKELETON
-uniform highp sampler2D skeleton_texture; //texunit:-6
+uniform highp sampler2D skeleton_texture; //texunit:-1
#endif
out highp vec4 position_interp;
@@ -157,9 +263,21 @@ out highp vec4 position_interp;
void main() {
highp vec4 vertex = vertex_attrib; // vec4(vertex_attrib.xyz * data_attrib.x,1.0);
- highp mat4 modelview = camera_inverse_matrix * world_transform;
+
+ mat4 world_matrix = world_transform;
+
+
+#ifdef USE_INSTANCING
+
+ {
+ highp mat4 m=mat4(instance_xform0,instance_xform1,instance_xform2,vec4(0.0,0.0,0.0,1.0));
+ world_matrix = world_matrix * transpose(m);
+ }
+#endif
+
vec3 normal = normal_attrib * normal_mult;
+
#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
vec3 tangent = tangent_attrib.xyz;
tangent*=normal_mult;
@@ -168,6 +286,10 @@ void main() {
#if defined(ENABLE_COLOR_INTERP)
color_interp = color_attrib;
+#if defined(USE_INSTANCING)
+ color_interp *= instance_color;
+#endif
+
#endif
#ifdef USE_SKELETON
@@ -210,67 +332,96 @@ void main() {
normal = vec4(normal,0.0) * m;
#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
- tangent.xyz = vec4(tangent.xyz,0.0) * mn;
+ tangent.xyz = vec4(tangent.xyz,0.0) * m;
#endif
}
#endif
-#ifdef USE_INSTANCING
-
- {
- highp mat3x4 m=mat3x4(instance_xform0,instance_xform1,instance_xform2);
- vertex.xyz = vertex * m;
- normal = vec4(normal,0.0) * m;
#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
- tangent.xyz = vec4(tangent.xyz,0.0) * mn;
-#endif
-#if defined(ENABLE_COLOR_INTERP)
- color_interp*=instance_color;
+ vec3 binormal = normalize( cross(normal,tangent) * binormalf );
#endif
- }
-#endif //USE_INSTANCING
-#if !defined(SKIP_TRANSFORM_USED)
-
- vertex = modelview * vertex;
- normal = normalize((modelview * vec4(normal,0.0)).xyz);
+#if defined(ENABLE_UV_INTERP)
+ uv_interp = uv_attrib;
#endif
-#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
-# if !defined(SKIP_TRANSFORM_USED)
+#if defined(ENABLE_UV2_INTERP)
+ uv2_interp = uv2_attrib;
+#endif
- tangent=normalize((modelview * vec4(tangent,0.0)).xyz);
-# endif
- vec3 binormal = normalize( cross(normal,tangent) * binormalf );
+#if defined(USE_INSTANCING) && defined(ENABLE_INSTANCE_CUSTOM)
+ vec4 instance_custom = instance_custom_data;
+#else
+ vec4 instance_custom = vec4(0.0);
#endif
+ highp mat4 modelview = camera_inverse_matrix * world_matrix;
+ highp mat4 local_projection = projection_matrix;
+//using world coordinates
+#if !defined(SKIP_TRANSFORM_USED) && defined(VERTEX_WORLD_COORDS_USED)
+ vertex = world_matrix * vertex;
+ normal = normalize((world_matrix * vec4(normal,0.0)).xyz);
-#if defined(ENABLE_UV_INTERP)
- uv_interp = uv_attrib;
-#endif
+#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
-#if defined(ENABLE_UV2_INTERP)
- uv2_interp = uv2_attrib;
+ tangent = normalize((world_matrix * vec4(tangent,0.0)).xyz);
+ binormal = normalize((world_matrix * vec4(binormal,0.0)).xyz);
#endif
+#endif
+
+ float roughness=0.0;
+//defines that make writing custom shaders easier
+#define projection_matrix local_projection
+#define world_transform world_matrix
{
VERTEX_SHADER_CODE
}
+
+
+//using local coordinates (default)
+#if !defined(SKIP_TRANSFORM_USED) && !defined(VERTEX_WORLD_COORDS_USED)
+
+ vertex = modelview * vertex;
+ normal = normalize((modelview * vec4(normal,0.0)).xyz);
+
+#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
+
+ tangent = normalize((modelview * vec4(tangent,0.0)).xyz);
+ binormal = normalize((modelview * vec4(binormal,0.0)).xyz);
+#endif
+#endif
+
+//using world coordinates
+#if !defined(SKIP_TRANSFORM_USED) && defined(VERTEX_WORLD_COORDS_USED)
+
+ vertex = camera_inverse_matrix * vertex;
+ normal = normalize((camera_inverse_matrix * vec4(normal,0.0)).xyz);
+
+#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
+
+ tangent = normalize((camera_inverse_matrix * vec4(tangent,0.0)).xyz);
+ binormal = normalize((camera_inverse_matrix * vec4(binormal,0.0)).xyz);
+#endif
+#endif
+
vertex_interp = vertex.xyz;
normal_interp = normal;
+
#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
tangent_interp = tangent;
binormal_interp = binormal;
#endif
+
#ifdef RENDER_DEPTH
@@ -283,7 +434,7 @@ VERTEX_SHADER_CODE
//for dual paraboloid shadow mapping, this is the fastest but least correct way, as it curves straight edges
- highp vec3 vtx = vertex_interp+normalize(vertex_interp)*shadow_z_offset;
+ highp vec3 vtx = vertex_interp+normalize(vertex_interp)*z_offset;
highp float distance = length(vtx);
vtx = normalize(vtx);
vtx.xy/=1.0-vtx.z;
@@ -296,8 +447,8 @@ VERTEX_SHADER_CODE
#else
- float z_ofs = shadow_z_offset;
- z_ofs += (1.0-abs(normal_interp.z))*shadow_z_slope_scale;
+ float z_ofs = z_offset;
+ z_ofs += (1.0-abs(normal_interp.z))*z_slope_scale;
vertex_interp.z-=z_ofs;
#endif //RENDER_DEPTH_DUAL_PARABOLOID
@@ -312,12 +463,75 @@ VERTEX_SHADER_CODE
#endif
position_interp=gl_Position;
+
+#ifdef USE_VERTEX_LIGHTING
+
+ diffuse_light_interp=vec4(0.0);
+ specular_light_interp=vec4(0.0);
+
+#ifdef USE_FORWARD_LIGHTING
+
+ for(int i=0;i<omni_light_count;i++) {
+ light_process_omni(omni_light_indices[i],vertex_interp,-normalize( vertex_interp ),normal_interp,roughness,diffuse_light_interp.rgb,specular_light_interp.rgb);
+ }
+
+ for(int i=0;i<spot_light_count;i++) {
+ light_process_spot(spot_light_indices[i],vertex_interp,-normalize( vertex_interp ),normal_interp,roughness,diffuse_light_interp.rgb,specular_light_interp.rgb);
+ }
+#endif
+
+#ifdef USE_LIGHT_DIRECTIONAL
+
+ vec3 directional_diffuse = vec3(0.0);
+ vec3 directional_specular = vec3(0.0);
+ light_compute(normal_interp,-light_direction_attenuation.xyz,-normalize( vertex_interp ),normal_interp,roughness,directional_diffuse,directional_specular);
+
+ float diff_avg = dot(diffuse_light_interp.rgb,vec3(0.33333));
+ float diff_dir_avg = dot(directional_diffuse,vec3(0.33333));
+ if (diff_avg>0.0) {
+ diffuse_light_interp.a=diff_dir_avg/(diff_avg+diff_dir_avg);
+ } else {
+ diffuse_light_interp.a=1.0;
+ }
+
+ diffuse_light_interp.rgb+=directional_diffuse;
+
+ float spec_avg = dot(specular_light_interp.rgb,vec3(0.33333));
+ float spec_dir_avg = dot(directional_specular,vec3(0.33333));
+ if (spec_avg>0.0) {
+ specular_light_interp.a=spec_dir_avg/(spec_avg+spec_dir_avg);
+ } else {
+ specular_light_interp.a=1.0;
+ }
+
+ specular_light_interp.rgb+=directional_specular;
+
+#endif //USE_LIGHT_DIRECTIONAL
+
+
+#endif // USE_VERTEX_LIGHTING
+
}
[fragment]
+/* texture unit usage, N is max_texture_unity-N
+
+1-skeleton
+2-radiance
+3-reflection_atlas
+4-directional_shadow
+5-shadow_atlas
+6-decal_atlas
+7-screen
+8-depth
+9-probe1
+10-probe2
+*/
+
+uniform highp mat4 world_transform;
#define M_PI 3.14159265359
@@ -349,28 +563,69 @@ in vec3 normal_interp;
//used on forward mainly
uniform bool no_ambient_light;
-uniform sampler2D brdf_texture; //texunit:-1
#ifdef USE_RADIANCE_MAP
-uniform sampler2D radiance_map; //texunit:-2
layout(std140) uniform Radiance { //ubo:2
mat4 radiance_inverse_xform;
- vec3 radiance_box_min;
- vec3 radiance_box_max;
float radiance_ambient_contribution;
};
+#define RADIANCE_MAX_LOD 5.0
+
+#ifdef USE_RADIANCE_MAP_ARRAY
+
+uniform sampler2DArray radiance_map; //texunit:-2
+
+vec3 textureDualParaboloid(sampler2DArray p_tex, vec3 p_vec,float p_roughness) {
+
+ vec3 norm = normalize(p_vec);
+ norm.xy/=1.0+abs(norm.z);
+ norm.xy=norm.xy * vec2(0.5,0.25) + vec2(0.5,0.25);
+
+ // we need to lie the derivatives (normg) and assume that DP side is always the same
+ // to get proper texure filtering
+ vec2 normg=norm.xy;
+ if (norm.z>0.0) {
+ norm.y=0.5-norm.y+0.5;
+ }
+
+ // thanks to OpenGL spec using floor(layer + 0.5) for texture arrays,
+ // it's easy to have precision errors using fract() to interpolate layers
+ // as such, using fixed point to ensure it works.
+
+ float index = p_roughness * RADIANCE_MAX_LOD;
+ int indexi = int(index * 256.0);
+ vec3 base = textureGrad(p_tex, vec3(norm.xy, float(indexi/256)),dFdx(normg),dFdy(normg)).xyz;
+ vec3 next = textureGrad(p_tex, vec3(norm.xy, float(indexi/256+1)),dFdx(normg),dFdy(normg)).xyz;
+ return mix(base,next,float(indexi%256)/256.0);
+}
+
+#else
+
+uniform sampler2D radiance_map; //texunit:-2
+
+vec3 textureDualParaboloid(sampler2D p_tex, vec3 p_vec,float p_roughness) {
+
+ vec3 norm = normalize(p_vec);
+ norm.xy/=1.0+abs(norm.z);
+ norm.xy=norm.xy * vec2(0.5,0.25) + vec2(0.5,0.25);
+ if (norm.z>0.0) {
+ norm.y=0.5-norm.y+0.5;
+ }
+ return textureLod(p_tex, norm.xy, p_roughness * RADIANCE_MAX_LOD).xyz;
+}
+
#endif
-/* Material Uniforms */
+#endif
+/* Material Uniforms */
-FRAGMENT_SHADER_GLOBALS
#if defined(USE_MATERIAL)
@@ -383,34 +638,47 @@ MATERIAL_UNIFORMS
#endif
+FRAGMENT_SHADER_GLOBALS
layout(std140) uniform SceneData {
highp mat4 projection_matrix;
highp mat4 camera_inverse_matrix;
highp mat4 camera_matrix;
- highp vec4 time;
- highp vec4 ambient_light_color;
- highp vec4 bg_color;
+ mediump vec4 ambient_light_color;
+ mediump vec4 bg_color;
+ mediump vec4 fog_color_enabled;
+ mediump vec4 fog_sun_color_amount;
- float ambient_energy;
- float bg_energy;
+ mediump float ambient_energy;
+ mediump float bg_energy;
- float shadow_z_offset;
- float shadow_z_slope_scale;
- float shadow_dual_paraboloid_render_zfar;
- float shadow_dual_paraboloid_render_side;
+ mediump float z_offset;
+ mediump float z_slope_scale;
+ highp float shadow_dual_paraboloid_render_zfar;
+ highp float shadow_dual_paraboloid_render_side;
highp vec2 screen_pixel_size;
- vec2 shadow_atlas_pixel_size;
- vec2 directional_shadow_pixel_size;
-
- float reflection_multiplier;
- float subsurface_scatter_width;
- float ambient_occlusion_affect_light;
-
+ highp vec2 shadow_atlas_pixel_size;
+ highp vec2 directional_shadow_pixel_size;
+
+ highp float time;
+ highp float z_far;
+ mediump float reflection_multiplier;
+ mediump float subsurface_scatter_width;
+ mediump float ambient_occlusion_affect_light;
+
+ bool fog_depth_enabled;
+ highp float fog_depth_begin;
+ highp float fog_depth_curve;
+ bool fog_transmit_enabled;
+ highp float fog_transmit_curve;
+ bool fog_height_enabled;
+ highp float fog_height_min;
+ highp float fog_height_max;
+ highp float fog_height_curve;
};
//directional light data
@@ -437,6 +705,10 @@ uniform highp sampler2DShadow directional_shadow; //texunit:-4
#endif
+#ifdef USE_VERTEX_LIGHTING
+in vec4 diffuse_light_interp;
+in vec4 specular_light_interp;
+#endif
//omni and spot
struct LightData {
@@ -463,7 +735,7 @@ layout(std140) uniform SpotLightData { //ubo:5
};
-uniform highp sampler2DShadow shadow_atlas; //texunit:-3
+uniform highp sampler2DShadow shadow_atlas; //texunit:-5
struct ReflectionData {
@@ -481,7 +753,7 @@ layout(std140) uniform ReflectionProbeData { //ubo:6
ReflectionData reflections[MAX_REFLECTION_DATA_STRUCTS];
};
-uniform mediump sampler2D reflection_atlas; //texunit:-5
+uniform mediump sampler2D reflection_atlas; //texunit:-3
#ifdef USE_FORWARD_LIGHTING
@@ -498,14 +770,19 @@ uniform int reflection_count;
#endif
+#if defined(SCREEN_TEXTURE_USED)
+
+uniform highp sampler2D screen_texture; //texunit:-7
+
+#endif
#ifdef USE_MULTIPLE_RENDER_TARGETS
layout(location=0) out vec4 diffuse_buffer;
layout(location=1) out vec4 specular_buffer;
layout(location=2) out vec4 normal_mr_buffer;
-#if defined (ENABLE_SSS_MOTION)
-layout(location=3) out vec4 motion_ssr_buffer;
+#if defined(ENABLE_SSS)
+layout(location=3) out float sss_buffer;
#endif
#else
@@ -515,7 +792,9 @@ layout(location=0) out vec4 frag_color;
#endif
in highp vec4 position_interp;
-uniform highp sampler2D depth_buffer; //texunit:-9
+uniform highp sampler2D depth_buffer; //texunit:-8
+
+#ifdef USE_CONTACT_SHADOWS
float contact_shadow_compute(vec3 pos, vec3 dir, float max_distance) {
@@ -531,6 +810,9 @@ float contact_shadow_compute(vec3 pos, vec3 dir, float max_distance) {
vec2 screen_rel = to_screen - from_screen;
+ if (length(screen_rel)<0.00001)
+ return 1.0; //too small, don't do anything
+
/*float pixel_size; //approximate pixel size
if (screen_rel.x > screen_rel.y) {
@@ -546,15 +828,16 @@ float contact_shadow_compute(vec3 pos, vec3 dir, float max_distance) {
vec2 pixel_incr = normalize(screen_rel)*screen_pixel_size;
- float steps = length(screen_rel) / length(pixel_incr);
+ float steps = length(screen_rel) / length(pixel_incr);
+ steps = min(2000.0,steps); //put a limit to avoid freezing in some strange situation
//steps=10.0;
vec4 incr = (dest - source)/steps;
float ratio=0.0;
float ratio_incr = 1.0/steps;
- do {
+ while(steps>0.0) {
source += incr*2.0;
bias+=incr*2.0;
@@ -572,11 +855,12 @@ float contact_shadow_compute(vec3 pos, vec3 dir, float max_distance) {
ratio+=ratio_incr;
steps-=1.0;
- } while (steps>0.0);
+ }
return 1.0;
}
+#endif
// GGX Specular
// Source: http://www.filmicworlds.com/images/ggx-opt/optimized-ggx.hlsl
@@ -603,20 +887,106 @@ float GTR1(float NdotH, float a)
-void light_compute(vec3 N, vec3 L,vec3 V,vec3 B, vec3 T,vec3 light_color,vec3 diffuse_color, vec3 specular_color, float specular_blob_intensity, float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,inout vec3 diffuse, inout vec3 specular) {
+void light_compute(vec3 N, vec3 L,vec3 V,vec3 B, vec3 T,vec3 light_color,vec3 diffuse_color, float specular_blob_intensity, float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,inout vec3 diffuse, inout vec3 specular) {
+
+#if defined(USE_LIGHT_SHADER_CODE)
+//light is written by the light shader
+
+
+LIGHT_SHADER_CODE
+
+
+#else
float dotNL = max(dot(N,L), 0.0 );
- float dotNV = max(dot(N,V), 0.0 );
+#if defined(DIFFUSE_HALF_LAMBERT)
+
+ float hl = dot(N,L) * 0.5 + 0.5;
+ diffuse += hl * light_color * diffuse_color;
+
+#elif defined(DIFFUSE_OREN_NAYAR)
+
+ {
+ float LdotV = dot(L, V);
+ float NdotL = dot(L, N);
+ float NdotV = dot(N, V);
+
+ float s = LdotV - NdotL * NdotV;
+ float t = mix(1.0, max(NdotL, NdotV), step(0.0, s));
+
+ float sigma2 = roughness * roughness;
+ vec3 A = 1.0 + sigma2 * (diffuse_color / (sigma2 + 0.13) + 0.5 / (sigma2 + 0.33));
+ float B = 0.45 * sigma2 / (sigma2 + 0.09);
+
+ diffuse += diffuse_color * max(0.0, NdotL) * (A + vec3(B) * s / t) / M_PI;
+ }
+
+#elif defined(DIFFUSE_TOON)
+
+ diffuse += smoothstep(-roughness,max(roughness,0.01),dot(N,L)) * light_color * diffuse_color;
+
+#elif defined(DIFFUSE_BURLEY)
+
+ {
+ float NdotL = dot(L, N);
+ float NdotV = dot(N, V);
+ float VdotH = dot(N, normalize(L+V));
+ float energyBias = mix(roughness, 0.0, 0.5);
+ float energyFactor = mix(roughness, 1.0, 1.0 / 1.51);
+ float fd90 = energyBias + 2.0 * VdotH * VdotH * roughness;
+ float f0 = 1.0;
+ float lightScatter = f0 + (fd90 - f0) * pow(1.0 - NdotL, 5.0);
+ float viewScatter = f0 + (fd90 - f0) * pow(1.0 - NdotV, 5.0);
+
+ diffuse+= light_color * diffuse_color * lightScatter * viewScatter * energyFactor;
+ }
+#else
+ //lambert
+ diffuse += dotNL * light_color * diffuse_color;
+#endif
+
+
+ float dotNV = max(dot(N,V), 0.0 );
#if defined(LIGHT_USE_RIM)
float rim_light = pow(1.0-dotNV,(1.0-roughness)*16.0);
diffuse += rim_light * rim * mix(vec3(1.0),diffuse_color,rim_tint) * light_color;
#endif
- diffuse += dotNL * light_color * diffuse_color;
if (roughness > 0.0) {
+
+ // D
+
+#if defined(SPECULAR_BLINN)
+
+ vec3 H = normalize(V + L);
+ float dotNH = max(dot(N,H), 0.0 );
+ float intensity = pow( dotNH, (1.0-roughness) * 256.0);
+ specular += light_color * intensity * specular_blob_intensity;
+
+#elif defined(SPECULAR_PHONG)
+
+ vec3 R = normalize(-reflect(L,N));
+ float dotNV = max(0.0,dot(R,V));
+ float intensity = pow( dotNV, (1.0-roughness) * 256.0);
+ specular += light_color * intensity * specular_blob_intensity;
+
+#elif defined(SPECULAR_TOON)
+
+ vec3 R = normalize(-reflect(L,N));
+ float dotNV = dot(R,V);
+ float mid = 1.0-roughness;
+ mid*=mid;
+ float intensity = smoothstep(mid-roughness*0.5,mid+roughness*0.5,dotNV) * mid;
+ diffuse += light_color * intensity * specular_blob_intensity; //write to diffuse, as in toon shading you generally want no reflection
+
+#elif defined(SPECULAR_DISABLED)
+ //none..
+
+#else
+ // shlick+ggx as default
float alpha = roughness * roughness;
vec3 H = normalize(V + L);
@@ -624,7 +994,6 @@ void light_compute(vec3 N, vec3 L,vec3 V,vec3 B, vec3 T,vec3 light_color,vec3 di
float dotNH = max(dot(N,H), 0.0 );
float dotLH = max(dot(L,H), 0.0 );
- // D
#if defined(LIGHT_USE_ANISOTROPY)
float aspect = sqrt(1.0-anisotropy*0.9);
@@ -655,7 +1024,8 @@ void light_compute(vec3 N, vec3 L,vec3 V,vec3 B, vec3 T,vec3 light_color,vec3 di
float speci = dotNL * D * F * vis;
- specular += speci * light_color /* specular_color*/ * specular_blob_intensity;
+ specular += speci * light_color * specular_blob_intensity;
+#endif
#if defined(LIGHT_USE_CLEARCOAT)
float Dr = GTR1(dotNH, mix(.1,.001,clearcoat_gloss));
@@ -667,6 +1037,7 @@ void light_compute(vec3 N, vec3 L,vec3 V,vec3 B, vec3 T,vec3 light_color,vec3 di
}
+#endif //defined(USE_LIGHT_SHADER_CODE)
}
@@ -714,6 +1085,8 @@ in highp float dp_clip;
#endif
+
+
#if 0
//need to save texture depth for this
@@ -743,7 +1116,7 @@ vec3 light_transmittance(float translucency,vec3 light_vec, vec3 normal, vec3 po
}
#endif
-void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 binormal, vec3 tangent, vec3 albedo, vec3 specular, float roughness, float rim, float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,inout vec3 diffuse_light, inout vec3 specular_light) {
+void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 binormal, vec3 tangent, vec3 albedo, float roughness, float rim, float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,float p_blob_intensity,inout vec3 diffuse_light, inout vec3 specular_light) {
vec3 light_rel_vec = omni_lights[idx].light_pos_inv_radius.xyz-vertex;
float light_length = length( light_rel_vec );
@@ -784,31 +1157,34 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 bino
splane.xy = clamp_rect.xy+splane.xy*clamp_rect.zw;
float shadow = sample_shadow(shadow_atlas,shadow_atlas_pixel_size,splane.xy,splane.z,clamp_rect);
+
+#ifdef USE_CONTACT_SHADOWS
+
if (shadow>0.01 && omni_lights[idx].shadow_color_contact.a>0.0) {
float contact_shadow = contact_shadow_compute(vertex,normalize(light_rel_vec),min(light_length,omni_lights[idx].shadow_color_contact.a));
shadow=min(shadow,contact_shadow);
-
}
+#endif
light_attenuation*=mix(omni_lights[idx].shadow_color_contact.rgb,vec3(1.0),shadow);
}
- light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,omni_lights[idx].light_color_energy.rgb*light_attenuation,albedo,specular,omni_lights[idx].light_params.z,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light);
+ light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,omni_lights[idx].light_color_energy.rgb*light_attenuation,albedo,omni_lights[idx].light_params.z*p_blob_intensity,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light);
}
-void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 binormal, vec3 tangent,vec3 albedo, vec3 specular, float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy, inout vec3 diffuse_light, inout vec3 specular_light) {
+void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 binormal, vec3 tangent,vec3 albedo, float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,float p_blob_intensity, inout vec3 diffuse_light, inout vec3 specular_light) {
vec3 light_rel_vec = spot_lights[idx].light_pos_inv_radius.xyz-vertex;
float light_length = length( light_rel_vec );
float normalized_distance = light_length*spot_lights[idx].light_pos_inv_radius.w;
- vec3 light_attenuation = vec3(pow( max(1.0 - normalized_distance, 0.0), spot_lights[idx].light_direction_attenuation.w ));
+ vec3 light_attenuation = vec3(pow( max(1.0 - normalized_distance, 0.001), spot_lights[idx].light_direction_attenuation.w ));
vec3 spot_dir = spot_lights[idx].light_direction_attenuation.xyz;
float spot_cutoff=spot_lights[idx].light_params.y;
float scos = max(dot(-normalize(light_rel_vec), spot_dir),spot_cutoff);
float spot_rim = (1.0 - scos) / (1.0 - spot_cutoff);
- light_attenuation *= 1.0 - pow( spot_rim, spot_lights[idx].light_params.x);
+ light_attenuation *= 1.0 - pow( max(spot_rim,0.001), spot_lights[idx].light_params.x);
if (spot_lights[idx].light_params.w>0.5) {
//there is a shadowmap
@@ -817,21 +1193,22 @@ void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi
float shadow = sample_shadow(shadow_atlas,shadow_atlas_pixel_size,splane.xy,splane.z,spot_lights[idx].light_clamp);
+#ifdef USE_CONTACT_SHADOWS
if (shadow>0.01 && spot_lights[idx].shadow_color_contact.a>0.0) {
float contact_shadow = contact_shadow_compute(vertex,normalize(light_rel_vec),min(light_length,spot_lights[idx].shadow_color_contact.a));
shadow=min(shadow,contact_shadow);
}
-
+#endif
light_attenuation*=mix(spot_lights[idx].shadow_color_contact.rgb,vec3(1.0),shadow);
}
- light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,spot_lights[idx].light_color_energy.rgb*light_attenuation,albedo,specular,spot_lights[idx].light_params.z,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light);
+ light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,spot_lights[idx].light_color_energy.rgb*light_attenuation,albedo,spot_lights[idx].light_params.z*p_blob_intensity,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light);
}
-void reflection_process(int idx, vec3 vertex, vec3 normal,vec3 binormal, vec3 tangent,float roughness,float anisotropy,vec3 ambient,vec3 skybox,vec2 brdf, inout highp vec4 reflection_accum,inout highp vec4 ambient_accum) {
+void reflection_process(int idx, vec3 vertex, vec3 normal,vec3 binormal, vec3 tangent,float roughness,float anisotropy,vec3 ambient,vec3 skybox, inout highp vec4 reflection_accum,inout highp vec4 ambient_accum) {
vec3 ref_vec = normalize(reflect(vertex,normal));
vec3 local_pos = (reflections[idx].local_matrix * vec4(vertex,1.0)).xyz;
@@ -867,27 +1244,19 @@ void reflection_process(int idx, vec3 vertex, vec3 normal,vec3 binormal, vec3 ta
}
-
- vec3 splane=normalize(local_ref_vec);
vec4 clamp_rect=reflections[idx].atlas_clamp;
-
- splane.z*=-1.0;
- if (splane.z>=0.0) {
- splane.z+=1.0;
- clamp_rect.y+=clamp_rect.w;
- } else {
- splane.z=1.0 - splane.z;
- splane.y=-splane.y;
+ vec3 norm = normalize(local_ref_vec);
+ norm.xy/=1.0+abs(norm.z);
+ norm.xy=norm.xy * vec2(0.5,0.25) + vec2(0.5,0.25);
+ if (norm.z>0.0) {
+ norm.y=0.5-norm.y+0.5;
}
- splane.xy/=splane.z;
- splane.xy=splane.xy * 0.5 + 0.5;
-
- splane.xy = splane.xy * clamp_rect.zw + clamp_rect.xy;
- splane.xy = clamp(splane.xy,clamp_rect.xy,clamp_rect.xy+clamp_rect.zw);
+ vec2 atlas_uv = norm.xy * clamp_rect.zw + clamp_rect.xy;
+ atlas_uv = clamp(atlas_uv,clamp_rect.xy,clamp_rect.xy+clamp_rect.zw);
highp vec4 reflection;
- reflection.rgb = textureLod(reflection_atlas,splane.xy,roughness*5.0).rgb * brdf.x + brdf.y;
+ reflection.rgb = textureLod(reflection_atlas,atlas_uv,roughness*5.0).rgb;
if (reflections[idx].params.z < 0.5) {
reflection.rgb = mix(skybox,reflection.rgb,blend);
@@ -948,12 +1317,13 @@ void reflection_process(int idx, vec3 vertex, vec3 normal,vec3 binormal, vec3 ta
#ifdef USE_GI_PROBES
-uniform mediump sampler3D gi_probe1; //texunit:-11
+uniform mediump sampler3D gi_probe1; //texunit:-9
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 highp float gi_probe_normal_bias1;
uniform bool gi_probe_blend_ambient1;
uniform mediump sampler3D gi_probe2; //texunit:-10
@@ -962,12 +1332,12 @@ 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 highp float gi_probe_normal_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, float p_bias) {
-
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);
@@ -988,27 +1358,30 @@ vec3 voxel_cone_trace(sampler3D probe, vec3 cell_size, vec3 pos, vec3 ambient, b
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,float p_bias, 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,float p_normal_bias, inout vec4 out_spec, inout vec4 out_diff) {
vec3 probe_pos = (probe_xform * vec4(pos,1.0)).xyz;
vec3 ref_pos = (probe_xform * vec4(pos+ref_vec,1.0)).xyz;
-
ref_vec = normalize(ref_pos - probe_pos);
+ probe_pos+=(probe_xform * vec4(normal_mtx[2],0.0)).xyz*p_normal_bias;
+
/* out_diff.rgb = voxel_cone_trace(probe,cell_size,probe_pos,normalize((probe_xform * vec4(ref_vec,0.0)).xyz),0.0 ,100.0);
out_diff.a = 1.0;
return;*/
//out_diff = vec4(textureLod(probe,probe_pos*cell_size,3.0).rgb,1.0);
//return;
- if (any(bvec2(any(lessThan(probe_pos,vec3(0.0))),any(greaterThan(probe_pos,bounds)))))
+ //this causes corrupted pixels, i have no idea why..
+ if (any(bvec2(any(lessThan(probe_pos,vec3(0.0))),any(greaterThan(probe_pos,bounds))))) {
return;
+ }
- vec3 blendv = probe_pos/bounds * 2.0 - 1.0;
- float blend = 1.001-max(blendv.x,max(blendv.y,blendv.z));
- blend=1.0;
+ //vec3 blendv = probe_pos/bounds * 2.0 - 1.0;
+ //float blend = 1.001-max(blendv.x,max(blendv.y,blendv.z));
+ float blend=1.0;
float max_distance = length(bounds);
@@ -1055,7 +1428,7 @@ void gi_probe_compute(sampler3D probe, mat4 probe_xform, vec3 bounds,vec3 cell_s
light*=multiplier;
- out_diff = vec4(light*blend,blend);
+ out_diff += vec4(light*blend,blend);
//irradiance
@@ -1064,11 +1437,12 @@ void gi_probe_compute(sampler3D probe, mat4 probe_xform, vec3 bounds,vec3 cell_s
irr_light *= multiplier;
//irr_light=vec3(0.0);
- out_spec = vec4(irr_light*blend,blend);
+ out_spec += vec4(irr_light*blend,blend);
+
}
-void gi_probes_compute(vec3 pos, vec3 normal, float roughness, vec3 specular, inout vec3 out_specular, inout vec3 out_ambient) {
+void gi_probes_compute(vec3 pos, vec3 normal, float roughness, inout vec3 out_specular, inout vec3 out_ambient) {
roughness = roughness * roughness;
@@ -1090,11 +1464,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,gi_probe_bias1,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,gi_probe_normal_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,gi_probe_bias2,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,gi_probe_normal_bias2,spec_accum,diff_accum);
}
if (diff_accum.a>0.0) {
@@ -1113,6 +1487,7 @@ void gi_probes_compute(vec3 pos, vec3 normal, float roughness, vec3 specular, in
#endif
+
void main() {
#ifdef RENDER_DEPTH_DUAL_PARABOLOID
@@ -1124,7 +1499,8 @@ void main() {
//lay out everything, whathever is unused is optimized away anyway
highp vec3 vertex = vertex_interp;
vec3 albedo = vec3(0.8,0.8,0.8);
- vec3 specular = vec3(0.2,0.2,0.2);
+ float metallic = 0.0;
+ float specular = 0.5;
vec3 emission = vec3(0.0,0.0,0.0);
float roughness = 1.0;
float rim = 0.0;
@@ -1147,6 +1523,10 @@ void main() {
#endif
+#if defined(ALPHA_SCISSOR_USED)
+ float alpha_scissor = 0.5;
+#endif
+
#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
vec3 binormal = normalize(binormal_interp)*side;
vec3 tangent = normalize(tangent_interp)*side;
@@ -1175,13 +1555,15 @@ void main() {
float normaldepth=1.0;
-
+#if defined(SCREEN_UV_USED)
+ vec2 screen_uv = gl_FragCoord.xy*screen_pixel_size;
+#endif
#if defined(ENABLE_DISCARD)
bool discard_=false;
#endif
-#if defined (ENABLE_SSS_MOTION)
+#if defined (ENABLE_SSS)
float sss_strength=0.0;
#endif
@@ -1193,6 +1575,12 @@ FRAGMENT_SHADER_CODE
}
+#if defined(ALPHA_SCISSOR_USED)
+ if (alpha<alpha_scissor) {
+ discard;
+ }
+#endif
+
#if defined(ENABLE_NORMALMAP)
@@ -1233,17 +1621,23 @@ FRAGMENT_SHADER_CODE
//apply energy conservation
+#ifdef USE_VERTEX_LIGHTING
+
+ vec3 specular_light = specular_light_interp.rgb;
+ vec3 diffuse_light = diffuse_light_interp.rgb;
+#else
+
vec3 specular_light = vec3(0.0,0.0,0.0);
- vec3 ambient_light;
vec3 diffuse_light = vec3(0.0,0.0,0.0);
+#endif
+
+ vec3 ambient_light;
+ vec3 env_reflection_light = vec3(0.0,0.0,0.0);
+
vec3 eye_vec = -normalize( vertex_interp );
-#ifndef RENDER_DEPTH
- float ndotv = clamp(dot(normal,eye_vec),0.0,1.0);
- vec2 brdf = texture(brdf_texture, vec2(roughness, ndotv)).xy;
-#endif
#ifdef USE_RADIANCE_MAP
@@ -1252,29 +1646,12 @@ FRAGMENT_SHADER_CODE
} else {
{
-
-
- float lod = roughness * 5.0;
-
{ //read radiance from dual paraboloid
vec3 ref_vec = reflect(-eye_vec,normal); //2.0 * ndotv * normal - view; // reflect(v, n);
ref_vec=normalize((radiance_inverse_xform * vec4(ref_vec,0.0)).xyz);
-
- vec3 norm = normalize(ref_vec);
- float y_ofs=0.0;
- if (norm.z>=0.0) {
-
- norm.z+=1.0;
- y_ofs+=0.5;
- } else {
- norm.z=1.0 - norm.z;
- norm.y=-norm.y;
- }
-
- norm.xy/=norm.z;
- norm.xy=norm.xy * vec2(0.5,0.25) + vec2(0.5,0.25+y_ofs);
- specular_light = textureLod(radiance_map, norm.xy, lod).xyz * brdf.x + brdf.y;
+ vec3 radiance = textureDualParaboloid(radiance_map,ref_vec,roughness) * bg_energy;
+ env_reflection_light = radiance;
}
//no longer a cubemap
@@ -1284,11 +1661,11 @@ FRAGMENT_SHADER_CODE
{
- /*vec3 ambient_dir=normalize((radiance_inverse_xform * vec4(normal,0.0)).xyz);
- vec3 env_ambient=textureLod(radiance_cube, ambient_dir, 5.0).xyz;
+ vec3 ambient_dir=normalize((radiance_inverse_xform * vec4(normal,0.0)).xyz);
+ vec3 env_ambient=textureDualParaboloid(radiance_map,ambient_dir,1.0) * bg_energy;
- ambient_light=mix(ambient_light_color.rgb,env_ambient,radiance_ambient_contribution);*/
- ambient_light=vec3(0.0,0.0,0.0);
+ ambient_light=mix(ambient_light_color.rgb,env_ambient,radiance_ambient_contribution);
+ //ambient_light=vec3(0.0,0.0,0.0);
}
}
@@ -1301,8 +1678,14 @@ FRAGMENT_SHADER_CODE
}
#endif
+ ambient_light*=ambient_energy;
-#ifdef USE_LIGHT_DIRECTIONAL
+ float specular_blob_intensity=1.0;
+#if defined(SPECULAR_TOON)
+ specular_blob_intensity*=specular * 2.0;
+#endif
+
+#if defined(USE_LIGHT_DIRECTIONAL)
vec3 light_attenuation=vec3(1.0);
@@ -1423,17 +1806,18 @@ FRAGMENT_SHADER_CODE
#if defined(LIGHT_USE_PSSM_BLEND)
if (use_blend) {
- shadow=mix(shadow, sample_shadow(directional_shadow,directional_shadow_pixel_size,pssm_coord2.xy,pssm_coord2.z,light_clamp));
+ shadow=mix(shadow, sample_shadow(directional_shadow,directional_shadow_pixel_size,pssm_coord2.xy,pssm_coord2.z,light_clamp),pssm_blend);
}
#endif
+#ifdef USE_CONTACT_SHADOWS
if (shadow>0.01 && shadow_color_contact.a>0.0) {
float contact_shadow = contact_shadow_compute(vertex,-light_direction_attenuation.xyz,shadow_color_contact.a);
shadow=min(shadow,contact_shadow);
}
-
+#endif
light_attenuation=mix(shadow_color_contact.rgb,vec3(1.0),shadow);
@@ -1441,58 +1825,63 @@ FRAGMENT_SHADER_CODE
#endif //LIGHT_DIRECTIONAL_SHADOW
- light_compute(normal,-light_direction_attenuation.xyz,eye_vec,binormal,tangent,light_color_energy.rgb*light_attenuation,albedo,specular,light_params.z,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light);
+#ifdef USE_VERTEX_LIGHTING
+ diffuse_light*=mix(vec3(1.0),light_attenuation,diffuse_light_interp.a);
+ specular_light*=mix(vec3(1.0),light_attenuation,specular_light_interp.a);
+
+#else
+ light_compute(normal,-light_direction_attenuation.xyz,eye_vec,binormal,tangent,light_color_energy.rgb*light_attenuation,albedo,light_params.z*specular_blob_intensity,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light);
+#endif
#endif //#USE_LIGHT_DIRECTIONAL
#ifdef USE_GI_PROBES
- gi_probes_compute(vertex,normal,roughness,specular,specular_light,ambient_light);
-#endif
+ gi_probes_compute(vertex,normal,roughness,env_reflection_light,ambient_light);
+#endif
#ifdef USE_FORWARD_LIGHTING
+
highp vec4 reflection_accum = vec4(0.0,0.0,0.0,0.0);
highp vec4 ambient_accum = vec4(0.0,0.0,0.0,0.0);
-
-
-
for(int i=0;i<reflection_count;i++) {
- reflection_process(reflection_indices[i],vertex,normal,binormal,tangent,roughness,anisotropy,ambient_light,specular_light,brdf,reflection_accum,ambient_accum);
+ reflection_process(reflection_indices[i],vertex,normal,binormal,tangent,roughness,anisotropy,ambient_light,env_reflection_light,reflection_accum,ambient_accum);
}
if (reflection_accum.a>0.0) {
specular_light+=reflection_accum.rgb/reflection_accum.a;
+ } else {
+ specular_light+=env_reflection_light;
}
+
if (ambient_accum.a>0.0) {
ambient_light+=ambient_accum.rgb/ambient_accum.a;
}
+
+
+#ifdef USE_VERTEX_LIGHTING
+
+ diffuse_light*=albedo;
+#else
+
for(int i=0;i<omni_light_count;i++) {
- light_process_omni(omni_light_indices[i],vertex,eye_vec,normal,binormal,tangent,albedo,specular,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light);
+ light_process_omni(omni_light_indices[i],vertex,eye_vec,normal,binormal,tangent,albedo,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,specular_blob_intensity,diffuse_light,specular_light);
}
for(int i=0;i<spot_light_count;i++) {
- light_process_spot(spot_light_indices[i],vertex,eye_vec,normal,binormal,tangent,albedo,specular,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light);
+ light_process_spot(spot_light_indices[i],vertex,eye_vec,normal,binormal,tangent,albedo,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,specular_blob_intensity,diffuse_light,specular_light);
}
-
+#endif //USE_VERTEX_LIGHTING
#endif
-#if defined(USE_LIGHT_SHADER_CODE)
-//light is written by the light shader
-{
-
-LIGHT_SHADER_CODE
-
-}
-#endif
-
#ifdef RENDER_DEPTH
//nothing happens, so a tree-ssa optimizer will result in no fragment shader :)
#else
@@ -1504,10 +1893,76 @@ LIGHT_SHADER_CODE
ambient_light*=ao;
#endif
- //energy conservation
- diffuse_light=mix(diffuse_light,vec3(0.0),specular);
- ambient_light=mix(ambient_light,vec3(0.0),specular);
- specular_light *= max(vec3(0.04),specular);
+
+ //energu conservation
+ diffuse_light=mix(diffuse_light,vec3(0.0),metallic);
+ ambient_light=mix(ambient_light,vec3(0.0),metallic);
+
+
+ {
+
+#if defined(DIFFUSE_TOON)
+ //simplify for toon, as
+ specular_light *= specular * metallic * albedo * 2.0;
+#else
+ //brdf approximation (Lazarov 2013)
+ float ndotv = clamp(dot(normal,eye_vec),0.0,1.0);
+ vec3 dielectric = vec3(0.034) * specular * 2.0;
+ //energy conservation
+ vec3 f0 = mix(dielectric, albedo, metallic);
+ const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
+ const vec4 c1 = vec4( 1.0, 0.0425, 1.04, -0.04);
+ vec4 r = roughness * c0 + c1;
+ float a004 = min( r.x * r.x, exp2( -9.28 * ndotv ) ) * r.x + r.y;
+ vec2 brdf = vec2( -1.04, 1.04 ) * a004 + r.zw;
+
+ specular_light *= min(1.0,50.0 * f0.g) * brdf.y + brdf.x * f0;
+#endif
+
+ }
+
+ if (fog_color_enabled.a > 0.5) {
+
+ float fog_amount=0.0;
+
+
+
+#ifdef USE_LIGHT_DIRECTIONAL
+
+ vec3 fog_color = mix( fog_color_enabled.rgb, fog_sun_color_amount.rgb,fog_sun_color_amount.a * pow(max( dot(normalize(vertex),-light_direction_attenuation.xyz), 0.0),8.0) );
+#else
+
+ vec3 fog_color = fog_color_enabled.rgb;
+#endif
+
+ //apply fog
+
+ if (fog_depth_enabled) {
+
+ float fog_z = smoothstep(fog_depth_begin,z_far,length(vertex));
+
+ fog_amount = pow(fog_z,fog_depth_curve);
+ if (fog_transmit_enabled) {
+ vec3 total_light = emission + ambient_light + specular_light + diffuse_light;
+ float transmit = pow(fog_z,fog_transmit_curve);
+ fog_color = mix(max(total_light,fog_color),fog_color,transmit);
+ }
+ }
+
+ if (fog_height_enabled) {
+ float y = (camera_matrix * vec4(vertex,1.0)).y;
+ fog_amount = max(fog_amount,pow(1.0-smoothstep(fog_height_min,fog_height_max,y),fog_height_curve));
+ }
+
+ float rev_amount = 1.0 - fog_amount;
+
+
+ emission = emission * rev_amount + fog_color * fog_amount;
+ ambient_light*=rev_amount;
+ specular_light*rev_amount;
+ diffuse_light*=rev_amount;
+
+ }
#ifdef USE_MULTIPLE_RENDER_TARGETS
@@ -1524,16 +1979,16 @@ LIGHT_SHADER_CODE
#endif //ENABLE_AO
diffuse_buffer=vec4(emission+diffuse_light+ambient_light,ambient_scale);
- specular_buffer=vec4(specular_light,max(specular.r,max(specular.g,specular.b)));
+ specular_buffer=vec4(specular_light,metallic);
normal_mr_buffer=vec4(normalize(normal)*0.5+0.5,roughness);
-#if defined (ENABLE_SSS_MOTION)
- motion_ssr_buffer = vec4(vec3(0.0),sss_strength);
+#if defined (ENABLE_SSS)
+ sss_buffer = sss_strength;
#endif
-#else
+#else //USE_MULTIPLE_RENDER_TARGETS
#ifdef SHADELESS
diff --git a/drivers/gles3/shaders/screen_space_reflection.glsl b/drivers/gles3/shaders/screen_space_reflection.glsl
index e4ba712de6..cc41d36c37 100644
--- a/drivers/gles3/shaders/screen_space_reflection.glsl
+++ b/drivers/gles3/shaders/screen_space_reflection.glsl
@@ -38,7 +38,8 @@ uniform mat4 projection;
uniform int num_steps;
uniform float depth_tolerance;
uniform float distance_fade;
-uniform float acceleration;
+uniform float curve_fade_in;
+
layout(location = 0) out vec4 frag_color;
@@ -117,10 +118,10 @@ void main() {
// clip the line to the viewport edges
- float scale_max_x = min(1, 0.99 * (1.0 - vp_line_begin.x) / max(1e-5, vp_line_dir.x));
- float scale_max_y = min(1, 0.99 * (1.0 - vp_line_begin.y) / max(1e-5, vp_line_dir.y));
- float scale_min_x = min(1, 0.99 * vp_line_begin.x / max(1e-5, -vp_line_dir.x));
- float scale_min_y = min(1, 0.99 * vp_line_begin.y / max(1e-5, -vp_line_dir.y));
+ float scale_max_x = min(1.0, 0.99 * (1.0 - vp_line_begin.x) / max(1e-5, vp_line_dir.x));
+ float scale_max_y = min(1.0, 0.99 * (1.0 - vp_line_begin.y) / max(1e-5, vp_line_dir.y));
+ float scale_min_x = min(1.0, 0.99 * vp_line_begin.x / max(1e-5, -vp_line_dir.x));
+ float scale_min_y = min(1.0, 0.99 * vp_line_begin.y / max(1e-5, -vp_line_dir.y));
float line_clip = min(scale_max_x, scale_max_y) * min(scale_min_x, scale_min_y);
line_dir *= line_clip;
z_dir *= line_clip;
@@ -148,11 +149,9 @@ void main() {
bool found=false;
- //if acceleration > 0, distance between pixels gets larger each step. This allows covering a larger area
- float accel=1.0+acceleration;
- float steps_taken=0;
+ float steps_taken=0.0;
- for(float i=0;i<num_steps;i++) {
+ for(int i=0;i<num_steps;i++) {
pos+=line_advance;
z+=z_advance;
@@ -177,9 +176,6 @@ void main() {
steps_taken+=1.0;
prev_pos=pos;
- z_advance*=accel;
- w_advance*=accel;
- line_advance*=accel;
}
@@ -207,41 +203,14 @@ void main() {
vec2 final_pos;
float grad;
+ grad=steps_taken/float(num_steps);
+ float initial_fade = curve_fade_in==0.0 ? 1.0 : pow(clamp(grad,0.0,1.0),curve_fade_in);
+ float fade = pow(clamp(1.0-grad,0.0,1.0),distance_fade)*initial_fade;
+ final_pos=pos;
-#ifdef SMOOTH_ACCEL
- //if the distance between point and prev point is >1, then take some samples in the middle for smoothing out the image
- vec2 blend_dir = pos - prev_pos;
- float steps = min(8.0,length(blend_dir));
- if (steps>2.0) {
- vec2 blend_step = blend_dir/steps;
- float blend_z = (z_to-z_from)/steps;
- vec2 new_pos;
- float subgrad=0.0;
- for(float i=0.0;i<steps;i++) {
-
- new_pos = (prev_pos+blend_step*i);
- float z = z_from+blend_z*i;
-
- depth = texture(source_depth, new_pos*pixel_size).r * 2.0 - 1.0;
- depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - depth * (camera_z_far - camera_z_near));
- depth=-depth;
-
- subgrad=i/steps;
- if (depth>z)
- break;
- }
- final_pos = new_pos;
- grad=(steps_taken+subgrad)/num_steps;
- } else {
-#endif
- grad=steps_taken/num_steps;
- final_pos=pos;
-#ifdef SMOOTH_ACCEL
- }
-#endif
@@ -259,7 +228,7 @@ void main() {
vec2 cone_dir = final_pos - line_begin;
float cone_len = length(cone_dir);
cone_dir = normalize(cone_dir); //will be used normalized from now on
- float max_mipmap = filter_mipmap_levels -1;
+ float max_mipmap = filter_mipmap_levels - 1.0;
float gloss_mult=gloss;
float rem_alpha=1.0;
@@ -327,10 +296,10 @@ void main() {
final_color = textureLod(source_diffuse,final_pos*pixel_size,0.0);
}
- frag_color = vec4(final_color.rgb,pow(clamp(1.0-grad,0.0,1.0),distance_fade)*margin_blend);
+ frag_color = vec4(final_color.rgb,fade*margin_blend);
#else
- frag_color = vec4(textureLod(source_diffuse,final_pos*pixel_size,0.0).rgb,pow(clamp(1.0-grad,0.0,1.0),distance_fade)*margin_blend);
+ frag_color = vec4(textureLod(source_diffuse,final_pos*pixel_size,0.0).rgb,fade*margin_blend);
#endif
diff --git a/drivers/gles3/shaders/ssao.glsl b/drivers/gles3/shaders/ssao.glsl
index ba29ec52c7..d8302bd46e 100644
--- a/drivers/gles3/shaders/ssao.glsl
+++ b/drivers/gles3/shaders/ssao.glsl
@@ -12,7 +12,7 @@ void main() {
[fragment]
-#define NUM_SAMPLES (11)
+#define NUM_SAMPLES (15)
// If using depth mip levels, the log of the maximum pixel offset before we need to switch to a lower
// miplevel to maintain reasonable spatial locality in the cache
@@ -25,8 +25,20 @@ void main() {
// This is the number of turns around the circle that the spiral pattern makes. This should be prime to prevent
// taps from lining up. This particular choice was tuned for NUM_SAMPLES == 9
-#define NUM_SPIRAL_TURNS (7)
+const int ROTATIONS[] = int[]( 1, 1, 2, 3, 2, 5, 2, 3, 2,
+3, 3, 5, 5, 3, 4, 7, 5, 5, 7,
+9, 8, 5, 5, 7, 7, 7, 8, 5, 8,
+11, 12, 7, 10, 13, 8, 11, 8, 7, 14,
+11, 11, 13, 12, 13, 19, 17, 13, 11, 18,
+19, 11, 11, 14, 17, 21, 15, 16, 17, 18,
+13, 17, 11, 17, 19, 18, 25, 18, 19, 19,
+29, 21, 19, 27, 31, 29, 21, 18, 17, 29,
+31, 31, 23, 18, 25, 26, 25, 23, 19, 34,
+19, 27, 21, 25, 39, 29, 17, 21, 27 );
+
+//#define NUM_SPIRAL_TURNS (7)
+const int NUM_SPIRAL_TURNS = ROTATIONS[NUM_SAMPLES-1];
uniform sampler2D source_depth; //texunit:0
uniform highp usampler2D source_depth_mipmaps; //texunit:1
diff --git a/drivers/gles3/shaders/ssao_blur.glsl b/drivers/gles3/shaders/ssao_blur.glsl
index ff852487c0..ce4154f50c 100644
--- a/drivers/gles3/shaders/ssao_blur.glsl
+++ b/drivers/gles3/shaders/ssao_blur.glsl
@@ -24,7 +24,7 @@ layout(location = 0) out float visibility;
// Tunable Parameters:
/** Increase to make depth edges crisper. Decrease to reduce flicker. */
-#define EDGE_SHARPNESS (1.0)
+#define EDGE_SHARPNESS (4.0)
/** Step in 2-pixel intervals since we already blurred against neighbors in the
first AO pass. This constant can be increased while R decreases to improve
diff --git a/drivers/gles3/shaders/subsurf_scattering.glsl b/drivers/gles3/shaders/subsurf_scattering.glsl
index eb329dbaed..569be6c5fe 100644
--- a/drivers/gles3/shaders/subsurf_scattering.glsl
+++ b/drivers/gles3/shaders/subsurf_scattering.glsl
@@ -107,14 +107,14 @@ uniform vec2 dir;
in vec2 uv_interp;
uniform sampler2D source_diffuse; //texunit:0
-uniform sampler2D source_motion_ss; //texunit:1
+uniform sampler2D source_sss; //texunit:1
uniform sampler2D source_depth; //texunit:2
layout(location = 0) out vec4 frag_color;
void main() {
- float strength = texture(source_motion_ss,uv_interp).a;
+ float strength = texture(source_sss,uv_interp).r;
strength*=strength; //stored as sqrt
// Fetch color of current pixel:
diff --git a/drivers/gles3/shaders/tonemap.glsl b/drivers/gles3/shaders/tonemap.glsl
index 8f7e0c7be3..988e31d1ea 100644
--- a/drivers/gles3/shaders/tonemap.glsl
+++ b/drivers/gles3/shaders/tonemap.glsl
@@ -6,17 +6,22 @@ layout(location=4) in vec2 uv_in;
out vec2 uv_interp;
-
-
void main() {
gl_Position = vertex_attrib;
uv_interp = uv_in;
+#ifdef V_FLIP
+ uv_interp.y = 1.0-uv_interp.y;
+#endif
}
[fragment]
+#if !defined(GLES_OVER_GL)
+precision mediump float;
+#endif
+
in vec2 uv_interp;
@@ -39,6 +44,19 @@ uniform highp float glow_intensity;
#endif
+#ifdef USE_BCS
+
+uniform vec3 bcs;
+
+#endif
+
+#ifdef USE_COLOR_CORRECTION
+
+uniform sampler2D color_correction; //texunit:3
+
+#endif
+
+
layout(location = 0) out vec4 frag_color;
#ifdef USE_GLOW_FILTER_BICUBIC
@@ -126,6 +144,38 @@ vec4 texture2D_bicubic(sampler2D tex, vec2 uv,int p_lod)
#endif
+vec3 tonemap_filmic(vec3 color,float white) {
+
+ float A = 0.15;
+ float B = 0.50;
+ float C = 0.10;
+ float D = 0.20;
+ float E = 0.02;
+ float F = 0.30;
+ float W = 11.2;
+
+ vec3 coltn = ((color*(A*color+C*B)+D*E)/(color*(A*color+B)+D*F))-E/F;
+ float whitetn = ((white*(A*white+C*B)+D*E)/(white*(A*white+B)+D*F))-E/F;
+
+ return coltn/whitetn;
+
+}
+
+vec3 tonemap_aces(vec3 color) {
+ float a = 2.51f;
+ float b = 0.03f;
+ float c = 2.43f;
+ float d = 0.59f;
+ float e = 0.14f;
+ return color = clamp((color*(a*color+b))/(color*(c*color+d)+e),vec3(0.0),vec3(1.0));
+}
+
+vec3 tonemap_reindhart(vec3 color,vec3 white) {
+
+ return ( color * ( 1.0 + ( color / ( white) ) ) ) / ( 1.0 + color );
+}
+
+
void main() {
ivec2 coord = ivec2(gl_FragCoord.xy);
@@ -139,8 +189,11 @@ void main() {
color*=exposure;
-
#if defined(USE_GLOW_LEVEL1) || defined(USE_GLOW_LEVEL2) || defined(USE_GLOW_LEVEL3) || defined(USE_GLOW_LEVEL4) || defined(USE_GLOW_LEVEL5) || defined(USE_GLOW_LEVEL6) || defined(USE_GLOW_LEVEL7)
+#define USING_GLOW
+#endif
+
+#if defined(USING_GLOW)
vec3 glow = vec3(0.0);
#ifdef USE_GLOW_LEVEL1
@@ -175,86 +228,98 @@ void main() {
glow *= glow_intensity;
+#endif
+
+#ifdef USE_REINDHART_TONEMAPPER
-#ifdef USE_GLOW_REPLACE
+ color.rgb = tonemap_reindhart(color.rgb,white);
- color.rgb = glow;
+# if defined(USING_GLOW)
+ glow = tonemap_reindhart(glow,white);
+# endif
#endif
-#ifdef USE_GLOW_SCREEN
+#ifdef USE_FILMIC_TONEMAPPER
- color.rgb = clamp((color.rgb + glow) - (color.rgb * glow), 0.0, 1.0);
+ color.rgb = tonemap_filmic(color.rgb,white);
-#endif
+# if defined(USING_GLOW)
+ glow = tonemap_filmic(glow,white);
+# endif
-#ifdef USE_GLOW_SOFTLIGHT
+#endif
- {
+#ifdef USE_ACES_TONEMAPPER
- glow = (glow * 0.5) + 0.5;
- color.r = (glow.r <= 0.5) ? (color.r - (1.0 - 2.0 * glow.r) * color.r * (1.0 - color.r)) : (((glow.r > 0.5) && (color.r <= 0.25)) ? (color.r + (2.0 * glow.r - 1.0) * (4.0 * color.r * (4.0 * color.r + 1.0) * (color.r - 1.0) + 7.0 * color.r)) : (color.r + (2.0 * glow.r - 1.0) * (sqrt(color.r) - color.r)));
- color.g = (glow.g <= 0.5) ? (color.g - (1.0 - 2.0 * glow.g) * color.g * (1.0 - color.g)) : (((glow.g > 0.5) && (color.g <= 0.25)) ? (color.g + (2.0 * glow.g - 1.0) * (4.0 * color.g * (4.0 * color.g + 1.0) * (color.g - 1.0) + 7.0 * color.g)) : (color.g + (2.0 * glow.g - 1.0) * (sqrt(color.g) - color.g)));
- color.b = (glow.b <= 0.5) ? (color.b - (1.0 - 2.0 * glow.b) * color.b * (1.0 - color.b)) : (((glow.b > 0.5) && (color.b <= 0.25)) ? (color.b + (2.0 * glow.b - 1.0) * (4.0 * color.b * (4.0 * color.b + 1.0) * (color.b - 1.0) + 7.0 * color.b)) : (color.b + (2.0 * glow.b - 1.0) * (sqrt(color.b) - color.b)));
- }
+ color.rgb = tonemap_aces(color.rgb);
-#endif
+# if defined(USING_GLOW)
+ glow = tonemap_aces(glow);
+# endif
-#if !defined(USE_GLOW_SCREEN) && !defined(USE_GLOW_SOFTLIGHT) && !defined(USE_GLOW_REPLACE)
- color.rgb+=glow;
#endif
+ //regular Linear -> SRGB conversion
+ vec3 a = vec3(0.055);
+ color.rgb = mix( (vec3(1.0)+a)*pow(color.rgb,vec3(1.0/2.4))-a , 12.92*color.rgb , lessThan(color.rgb,vec3(0.0031308)));
+#if defined(USING_GLOW)
+ glow = mix( (vec3(1.0)+a)*pow(glow,vec3(1.0/2.4))-a , 12.92*glow , lessThan(glow,vec3(0.0031308)));
#endif
+//glow needs to be added in SRGB space (together with image space effects)
-#ifdef USE_REINDHART_TONEMAPPER
+ color.rgb = clamp(color.rgb,0.0,1.0);
- {
- color.rgb = ( color.rgb * ( 1.0 + ( color.rgb / ( white) ) ) ) / ( 1.0 + color.rgb );
-
- }
+#if defined(USING_GLOW)
+ glow = clamp(glow,0.0,1.0);
#endif
-#ifdef USE_FILMIC_TONEMAPPER
+#ifdef USE_GLOW_REPLACE
- {
+ color.rgb = glow;
- float A = 0.15;
- float B = 0.50;
- float C = 0.10;
- float D = 0.20;
- float E = 0.02;
- float F = 0.30;
- float W = 11.2;
+#endif
- vec3 coltn = ((color.rgb*(A*color.rgb+C*B)+D*E)/(color.rgb*(A*color.rgb+B)+D*F))-E/F;
- float whitetn = ((white*(A*white+C*B)+D*E)/(white*(A*white+B)+D*F))-E/F;
+#ifdef USE_GLOW_SCREEN
- color.rgb=coltn/whitetn;
+ color.rgb = max((color.rgb + glow) - (color.rgb * glow), vec3(0.0));
- }
#endif
-#ifdef USE_ACES_TONEMAPPER
+#ifdef USE_GLOW_SOFTLIGHT
{
- float a = 2.51f;
- float b = 0.03f;
- float c = 2.43f;
- float d = 0.59f;
- float e = 0.14f;
- color.rgb = clamp((color.rgb*(a*color.rgb+b))/(color.rgb*(c*color.rgb+d)+e),vec3(0.0),vec3(1.0));
+
+ glow = (glow * 0.5) + 0.5;
+ color.r = (glow.r <= 0.5) ? (color.r - (1.0 - 2.0 * glow.r) * color.r * (1.0 - color.r)) : (((glow.r > 0.5) && (color.r <= 0.25)) ? (color.r + (2.0 * glow.r - 1.0) * (4.0 * color.r * (4.0 * color.r + 1.0) * (color.r - 1.0) + 7.0 * color.r)) : (color.r + (2.0 * glow.r - 1.0) * (sqrt(color.r) - color.r)));
+ color.g = (glow.g <= 0.5) ? (color.g - (1.0 - 2.0 * glow.g) * color.g * (1.0 - color.g)) : (((glow.g > 0.5) && (color.g <= 0.25)) ? (color.g + (2.0 * glow.g - 1.0) * (4.0 * color.g * (4.0 * color.g + 1.0) * (color.g - 1.0) + 7.0 * color.g)) : (color.g + (2.0 * glow.g - 1.0) * (sqrt(color.g) - color.g)));
+ color.b = (glow.b <= 0.5) ? (color.b - (1.0 - 2.0 * glow.b) * color.b * (1.0 - color.b)) : (((glow.b > 0.5) && (color.b <= 0.25)) ? (color.b + (2.0 * glow.b - 1.0) * (4.0 * color.b * (4.0 * color.b + 1.0) * (color.b - 1.0) + 7.0 * color.b)) : (color.b + (2.0 * glow.b - 1.0) * (sqrt(color.b) - color.b)));
}
#endif
- //regular Linear -> SRGB conversion
- vec3 a = vec3(0.055);
- color.rgb = mix( (vec3(1.0)+a)*pow(color.rgb,vec3(1.0/2.4))-a , 12.92*color.rgb , lessThan(color.rgb,vec3(0.0031308)));
+#if defined(USING_GLOW) && !defined(USE_GLOW_SCREEN) && !defined(USE_GLOW_SOFTLIGHT) && !defined(USE_GLOW_REPLACE)
+ //additive
+ color.rgb+=glow;
+#endif
+
+#ifdef USE_BCS
+ color.rgb = mix(vec3(0.0),color.rgb,bcs.x);
+ color.rgb = mix(vec3(0.5),color.rgb,bcs.y);
+ color.rgb = mix(vec3(dot(vec3(1.0),color.rgb)*0.33333),color.rgb,bcs.z);
+#endif
+
+#ifdef USE_COLOR_CORRECTION
+
+ color.r = texture(color_correction,vec2(color.r,0.0)).r;
+ color.g = texture(color_correction,vec2(color.g,0.0)).g;
+ color.b = texture(color_correction,vec2(color.b,0.0)).b;
+#endif
frag_color=vec4(color.rgb,1.0);
diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp
index c524bee43c..33d271248c 100644
--- a/drivers/png/image_loader_png.cpp
+++ b/drivers/png/image_loader_png.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -67,7 +68,7 @@ static void _png_warn_function(png_structp, png_const_charp text) {
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp));
-Error ImageLoaderPNG::_load_image(void *rf_up, png_rw_ptr p_func, Image *p_image) {
+Error ImageLoaderPNG::_load_image(void *rf_up, png_rw_ptr p_func, Ref<Image> p_image) {
png_structp png;
png_infop info;
@@ -200,7 +201,7 @@ Error ImageLoaderPNG::_load_image(void *rf_up, png_rw_ptr p_func, Image *p_image
return OK;
}
-Error ImageLoaderPNG::load_image(Image *p_image, FileAccess *f) {
+Error ImageLoaderPNG::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear) {
Error err = _load_image(f, _read_png_data, p_image);
f->close();
@@ -237,25 +238,27 @@ static void user_read_data(png_structp png_ptr, png_bytep data, png_size_t p_len
}
}
-static Image _load_mem_png(const uint8_t *p_png, int p_size) {
+static Ref<Image> _load_mem_png(const uint8_t *p_png, int p_size) {
PNGReadStatus prs;
prs.image = p_png;
prs.offset = 0;
prs.size = p_size;
- Image img;
- Error err = ImageLoaderPNG::_load_image(&prs, user_read_data, &img);
- ERR_FAIL_COND_V(err, Image());
+ Ref<Image> img;
+ img.instance();
+ Error err = ImageLoaderPNG::_load_image(&prs, user_read_data, img);
+ ERR_FAIL_COND_V(err, Ref<Image>());
return img;
}
-static Image _lossless_unpack_png(const PoolVector<uint8_t> &p_data) {
+static Ref<Image> _lossless_unpack_png(const PoolVector<uint8_t> &p_data) {
int len = p_data.size();
+ ERR_FAIL_COND_V(len < 4, Ref<Image>());
PoolVector<uint8_t>::Read r = p_data.read();
- ERR_FAIL_COND_V(r[0] != 'P' || r[1] != 'N' || r[2] != 'G' || r[3] != ' ', Image());
+ ERR_FAIL_COND_V(r[0] != 'P' || r[1] != 'N' || r[2] != 'G' || r[3] != ' ', Ref<Image>());
return _load_mem_png(&r[4], len - 4);
}
@@ -270,13 +273,14 @@ static void _write_png_data(png_structp png_ptr, png_bytep data, png_size_t p_le
//print_line("png write: "+itos(p_length));
}
-static PoolVector<uint8_t> _lossless_pack_png(const Image &p_image) {
+static PoolVector<uint8_t> _lossless_pack_png(const Ref<Image> &p_image) {
- Image img = p_image;
- if (img.is_compressed())
- img.decompress();
+ Ref<Image> img = p_image->duplicate();
- ERR_FAIL_COND_V(img.is_compressed(), PoolVector<uint8_t>());
+ if (img->is_compressed())
+ img->decompress();
+
+ ERR_FAIL_COND_V(img->is_compressed(), PoolVector<uint8_t>());
png_structp png_ptr;
png_infop info_ptr;
@@ -310,7 +314,7 @@ static PoolVector<uint8_t> _lossless_pack_png(const Image &p_image) {
int pngf = 0;
int cs = 0;
- switch (img.get_format()) {
+ switch (img->get_format()) {
case Image::FORMAT_L8: {
@@ -334,22 +338,22 @@ static PoolVector<uint8_t> _lossless_pack_png(const Image &p_image) {
} break;
default: {
- if (img.detect_alpha()) {
+ if (img->detect_alpha()) {
- img.convert(Image::FORMAT_RGBA8);
+ img->convert(Image::FORMAT_RGBA8);
pngf = PNG_COLOR_TYPE_RGB_ALPHA;
cs = 4;
} else {
- img.convert(Image::FORMAT_RGB8);
+ img->convert(Image::FORMAT_RGB8);
pngf = PNG_COLOR_TYPE_RGB;
cs = 3;
}
}
}
- int w = img.get_width();
- int h = img.get_height();
+ int w = img->get_width();
+ int h = img->get_height();
png_set_IHDR(png_ptr, info_ptr, w, h,
8, pngf, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
@@ -361,7 +365,7 @@ static PoolVector<uint8_t> _lossless_pack_png(const Image &p_image) {
ERR_FAIL_V(PoolVector<uint8_t>());
}
- PoolVector<uint8_t>::Read r = img.get_data().read();
+ PoolVector<uint8_t>::Read r = img->get_data().read();
row_pointers = (png_bytep *)memalloc(sizeof(png_bytep) * h);
for (int i = 0; i < h; i++) {
diff --git a/drivers/png/image_loader_png.h b/drivers/png/image_loader_png.h
index 00a64c5537..f0a525a9eb 100644
--- a/drivers/png/image_loader_png.h
+++ b/drivers/png/image_loader_png.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,8 +42,8 @@ class ImageLoaderPNG : public ImageFormatLoader {
static void _read_png_data(png_structp png_ptr, png_bytep data, png_size_t p_length);
public:
- static Error _load_image(void *rf_up, png_rw_ptr p_func, Image *p_image);
- virtual Error load_image(Image *p_image, FileAccess *f);
+ static Error _load_image(void *rf_up, png_rw_ptr p_func, Ref<Image> p_image);
+ virtual Error load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear);
virtual void get_recognized_extensions(List<String> *p_extensions) const;
ImageLoaderPNG();
};
diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp
index ce1ffde1c8..4f1f318aee 100644
--- a/drivers/png/resource_saver_png.cpp
+++ b/drivers/png/resource_saver_png.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,8 +30,8 @@
#include "resource_saver_png.h"
#include "core/image.h"
-#include "global_config.h"
#include "os/file_access.h"
+#include "project_settings.h"
#include "scene/resources/texture.h"
#include <png.h>
@@ -49,57 +50,24 @@ Error ResourceSaverPNG::save(const String &p_path, const RES &p_resource, uint32
ERR_EXPLAIN("Can't save empty texture as PNG");
ERR_FAIL_COND_V(!texture->get_width() || !texture->get_height(), ERR_INVALID_PARAMETER);
- Image img = texture->get_data();
+ Ref<Image> img = texture->get_data();
Error err = save_image(p_path, img);
if (err == OK) {
-
- bool global_filter = GlobalConfig::get_singleton()->get("image_loader/filter");
- bool global_mipmaps = GlobalConfig::get_singleton()->get("image_loader/gen_mipmaps");
- bool global_repeat = GlobalConfig::get_singleton()->get("image_loader/repeat");
-
- String text;
-
- if (global_filter != bool(texture->get_flags() & Texture::FLAG_FILTER)) {
- text += bool(texture->get_flags() & Texture::FLAG_FILTER) ? "filter=true\n" : "filter=false\n";
- }
- if (global_mipmaps != bool(texture->get_flags() & Texture::FLAG_MIPMAPS)) {
- text += bool(texture->get_flags() & Texture::FLAG_MIPMAPS) ? "gen_mipmaps=true\n" : "gen_mipmaps=false\n";
- }
- if (global_repeat != bool(texture->get_flags() & Texture::FLAG_REPEAT)) {
- text += bool(texture->get_flags() & Texture::FLAG_REPEAT) ? "repeat=true\n" : "repeat=false\n";
- }
- if (bool(texture->get_flags() & Texture::FLAG_ANISOTROPIC_FILTER)) {
- text += "anisotropic=true\n";
- }
- if (bool(texture->get_flags() & Texture::FLAG_CONVERT_TO_LINEAR)) {
- text += "tolinear=true\n";
- }
- if (bool(texture->get_flags() & Texture::FLAG_MIRRORED_REPEAT)) {
- text += "mirroredrepeat=true\n";
- }
-
- if (text != "" || FileAccess::exists(p_path + ".flags")) {
-
- FileAccess *f = FileAccess::open(p_path + ".flags", FileAccess::WRITE);
- if (f) {
-
- f->store_string(text);
- memdelete(f);
- }
- }
}
return err;
};
-Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) {
+Error ResourceSaverPNG::save_image(const String &p_path, const Ref<Image> &p_img) {
+
+ Ref<Image> img = p_img->duplicate();
- if (p_img.is_compressed())
- p_img.decompress();
+ if (img->is_compressed())
+ img->decompress();
- ERR_FAIL_COND_V(p_img.is_compressed(), ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(img->is_compressed(), ERR_INVALID_PARAMETER);
png_structp png_ptr;
png_infop info_ptr;
@@ -134,7 +102,7 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) {
int pngf = 0;
int cs = 0;
- switch (p_img.get_format()) {
+ switch (img->get_format()) {
case Image::FORMAT_L8: {
@@ -158,22 +126,22 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) {
} break;
default: {
- if (p_img.detect_alpha()) {
+ if (img->detect_alpha()) {
- p_img.convert(Image::FORMAT_RGBA8);
+ img->convert(Image::FORMAT_RGBA8);
pngf = PNG_COLOR_TYPE_RGB_ALPHA;
cs = 4;
} else {
- p_img.convert(Image::FORMAT_RGB8);
+ img->convert(Image::FORMAT_RGB8);
pngf = PNG_COLOR_TYPE_RGB;
cs = 3;
}
}
}
- int w = p_img.get_width();
- int h = p_img.get_height();
+ int w = img->get_width();
+ int h = img->get_height();
png_set_IHDR(png_ptr, info_ptr, w, h,
8, pngf, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
@@ -186,7 +154,7 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) {
ERR_FAIL_V(ERR_CANT_OPEN);
}
- PoolVector<uint8_t>::Read r = p_img.get_data().read();
+ PoolVector<uint8_t>::Read r = img->get_data().read();
row_pointers = (png_bytep *)memalloc(sizeof(png_bytep) * h);
for (int i = 0; i < h; i++) {
diff --git a/drivers/png/resource_saver_png.h b/drivers/png/resource_saver_png.h
index ebc8d8e3ae..31ec35c192 100644
--- a/drivers/png/resource_saver_png.h
+++ b/drivers/png/resource_saver_png.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,11 +30,12 @@
#ifndef RESOURCE_SAVER_PNG_H
#define RESOURCE_SAVER_PNG_H
+#include "image.h"
#include "io/resource_saver.h"
class ResourceSaverPNG : public ResourceFormatSaver {
public:
- static Error save_image(const String &p_path, Image &p_img);
+ static Error save_image(const String &p_path, const Ref<Image> &p_img);
virtual Error save(const String &p_path, const RES &p_resource, uint32_t p_flags = 0);
virtual bool recognize(const RES &p_resource) const;
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
index d33ec3ce3a..fb04ef0088 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,7 +33,7 @@
#include <pulse/error.h>
-#include "global_config.h"
+#include "project_settings.h"
Error AudioDriverPulseAudio::init() {
@@ -101,7 +102,6 @@ float AudioDriverPulseAudio::get_latency() {
void AudioDriverPulseAudio::thread_func(void *p_udata) {
- print_line("thread");
AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)p_udata;
while (!ad->exit_thread) {
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.h b/drivers/pulseaudio/audio_driver_pulseaudio.h
index b6508434d4..3ce031e616 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.h
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp
index 9540a16089..ca2f03c75a 100644
--- a/drivers/register_driver_types.cpp
+++ b/drivers/register_driver_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/register_driver_types.h b/drivers/register_driver_types.h
index 9a79d79ab8..63c50f6720 100644
--- a/drivers/register_driver_types.h
+++ b/drivers/register_driver_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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/rtaudio/audio_driver_rtaudio.cpp b/drivers/rtaudio/audio_driver_rtaudio.cpp
index 5ecd4cbaec..3de25c32ad 100644
--- a/drivers/rtaudio/audio_driver_rtaudio.cpp
+++ b/drivers/rtaudio/audio_driver_rtaudio.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "audio_driver_rtaudio.h"
-#include "global_config.h"
#include "os/os.h"
+#include "project_settings.h"
#ifdef RTAUDIO_ENABLED
@@ -78,7 +79,7 @@ int AudioDriverRtAudio::callback(void *outputBuffer, void *inputBuffer, unsigned
Error AudioDriverRtAudio::init() {
active = false;
- mutex = NULL;
+ mutex = Mutex::create(true);
dac = memnew(RtAudio);
ERR_EXPLAIN("Cannot initialize RtAudio audio driver: No devices present.")
@@ -135,7 +136,6 @@ Error AudioDriverRtAudio::init() {
try {
dac->openStream(&parameters, NULL, RTAUDIO_SINT32, mix_rate, &buffer_size, &callback, this, &options);
- mutex = Mutex::create(true);
active = true;
break;
@@ -161,6 +161,7 @@ Error AudioDriverRtAudio::init() {
try {
dac->closeStream();
+ active = false;
} catch (RtAudioError &e) {
ERR_PRINT(e.what());
ERR_FAIL_V(ERR_UNAVAILABLE);
@@ -211,17 +212,27 @@ void AudioDriverRtAudio::unlock() {
void AudioDriverRtAudio::finish() {
- if (active && dac->isStreamOpen())
+ lock();
+ if (active && dac->isStreamOpen()) {
dac->closeStream();
- if (mutex)
+ active = false;
+ }
+ unlock();
+
+ if (mutex) {
memdelete(mutex);
- if (dac)
+ mutex = NULL;
+ }
+ if (dac) {
memdelete(dac);
+ dac = NULL;
+ }
}
AudioDriverRtAudio::AudioDriverRtAudio() {
mutex = NULL;
+ dac = NULL;
mix_rate = 44100;
speaker_mode = SPEAKER_MODE_STEREO;
}
diff --git a/drivers/rtaudio/audio_driver_rtaudio.h b/drivers/rtaudio/audio_driver_rtaudio.h
index e7b480b7b2..c2a18b2731 100644
--- a/drivers/rtaudio/audio_driver_rtaudio.h
+++ b/drivers/rtaudio/audio_driver_rtaudio.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/SCsub b/drivers/unix/SCsub
index 3766e782e4..96efc91b7a 100644
--- a/drivers/unix/SCsub
+++ b/drivers/unix/SCsub
@@ -8,7 +8,7 @@ g_set_p += 'String OS_Unix::get_global_settings_path() const {\n'
g_set_p += '\treturn "' + env["unix_global_settings_path"] + '";\n'
g_set_p += '}\n'
g_set_p += '#endif'
-f = open("os_unix_global_settings_path.cpp", "wb")
+f = open("os_unix_global_settings_path.gen.cpp", "wb")
f.write(g_set_p)
f.close()
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index dbd73b198b..a183a37446 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/dir_access_unix.h b/drivers/unix/dir_access_unix.h
index 0ec0e551d7..e4b294a802 100644
--- a/drivers/unix/dir_access_unix.h
+++ b/drivers/unix/dir_access_unix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -74,8 +75,8 @@ public:
virtual uint64_t get_modified_time(String p_file);
- virtual Error rename(String p_from, String p_to);
- virtual Error remove(String p_name);
+ virtual Error rename(String p_path, String p_new_path);
+ virtual Error remove(String p_path);
virtual size_t get_space_left();
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index 723bf3321a..e2f04aec63 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h
index 4b5897e9a5..3c4b9c0c25 100644
--- a/drivers/unix/file_access_unix.h
+++ b/drivers/unix/file_access_unix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp
index 0a26b5bbba..f55b75c1d9 100644
--- a/drivers/unix/ip_unix.cpp
+++ b/drivers/unix/ip_unix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -76,7 +77,7 @@ static IP_Address _sockaddr2ip(struct sockaddr *p_addr) {
if (p_addr->sa_family == AF_INET) {
struct sockaddr_in *addr = (struct sockaddr_in *)p_addr;
ip.set_ipv4((uint8_t *)&(addr->sin_addr));
- } else {
+ } else if (p_addr->sa_family == AF_INET6) {
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)p_addr;
ip.set_ipv6(addr6->sin6_addr.s6_addr);
};
@@ -99,6 +100,7 @@ IP_Address IP_Unix::_resolve_hostname(const String &p_hostname, Type p_type) {
hints.ai_family = AF_UNSPEC;
hints.ai_flags = AI_ADDRCONFIG;
};
+ hints.ai_flags &= !AI_NUMERICHOST;
int s = getaddrinfo(p_hostname.utf8().get_data(), NULL, &hints, &result);
if (s != 0) {
@@ -179,15 +181,16 @@ void IP_Unix::get_local_addresses(List<IP_Address> *r_addresses) const {
SOCKADDR_IN *ipv4 = reinterpret_cast<SOCKADDR_IN *>(address->Address.lpSockaddr);
ip.set_ipv4((uint8_t *)&(ipv4->sin_addr));
- } else { // ipv6
+ r_addresses->push_back(ip);
+
+ } else if (address->Address.lpSockaddr->sa_family == AF_INET6) { // ipv6
SOCKADDR_IN6 *ipv6 = reinterpret_cast<SOCKADDR_IN6 *>(address->Address.lpSockaddr);
ip.set_ipv6(ipv6->sin6_addr.s6_addr);
+ r_addresses->push_back(ip);
};
- r_addresses->push_back(ip);
-
address = address->Next;
};
adapter = adapter->Next;
@@ -204,6 +207,7 @@ void IP_Unix::get_local_addresses(List<IP_Address> *r_addresses) const {
struct ifaddrs *ifAddrStruct = NULL;
struct ifaddrs *ifa = NULL;
+ int family;
getifaddrs(&ifAddrStruct);
@@ -211,6 +215,11 @@ void IP_Unix::get_local_addresses(List<IP_Address> *r_addresses) const {
if (!ifa->ifa_addr)
continue;
+ family = ifa->ifa_addr->sa_family;
+
+ if (family != AF_INET && family != AF_INET6)
+ continue;
+
IP_Address ip = _sockaddr2ip(ifa->ifa_addr);
r_addresses->push_back(ip);
}
diff --git a/drivers/unix/ip_unix.h b/drivers/unix/ip_unix.h
index c22fedfe1c..952d3a8771 100644
--- a/drivers/unix/ip_unix.h
+++ b/drivers/unix/ip_unix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/mutex_posix.cpp b/drivers/unix/mutex_posix.cpp
index 9009da2065..94cfcf78e3 100644
--- a/drivers/unix/mutex_posix.cpp
+++ b/drivers/unix/mutex_posix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/mutex_posix.h b/drivers/unix/mutex_posix.h
index 84fb32b844..b3c0cbe051 100644
--- a/drivers/unix/mutex_posix.h
+++ b/drivers/unix/mutex_posix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index e2a544b676..0f4e8f757c 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -49,11 +50,12 @@
#include <mach-o/dyld.h>
#endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#endif
-#include "global_config.h"
+#include "project_settings.h"
#include <assert.h>
+#include <dlfcn.h>
#include <errno.h>
#include <poll.h>
#include <signal.h>
@@ -413,7 +415,7 @@ Error OS_Unix::kill(const ProcessID &p_pid) {
return ret ? ERR_INVALID_PARAMETER : OK;
}
-int OS_Unix::get_process_ID() const {
+int OS_Unix::get_process_id() const {
return getpid();
};
@@ -435,6 +437,40 @@ String OS_Unix::get_locale() const {
return locale;
}
+Error OS_Unix::open_dynamic_library(const String p_path, void *&p_library_handle) {
+ p_library_handle = dlopen(p_path.utf8().get_data(), RTLD_NOW);
+ if (!p_library_handle) {
+ ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + dlerror());
+ ERR_FAIL_V(ERR_CANT_OPEN);
+ }
+ return OK;
+}
+
+Error OS_Unix::close_dynamic_library(void *p_library_handle) {
+ if (dlclose(p_library_handle)) {
+ return FAILED;
+ }
+ return OK;
+}
+
+Error OS_Unix::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional) {
+ const char *error;
+ dlerror(); // Clear existing errors
+
+ p_symbol_handle = dlsym(p_library_handle, p_name.utf8().get_data());
+
+ error = dlerror();
+ if (error != NULL) {
+ if (!p_optional) {
+ ERR_EXPLAIN("Can't resolve symbol " + p_name + ". Error: " + error);
+ ERR_FAIL_V(ERR_CANT_RESOLVE);
+ } else {
+ return ERR_CANT_RESOLVE;
+ }
+ }
+ return OK;
+}
+
Error OS_Unix::set_cwd(const String &p_cwd) {
if (chdir(p_cwd.utf8().get_data()) != 0)
@@ -462,7 +498,7 @@ String OS_Unix::get_data_dir() const {
if (has_environment("HOME")) {
- bool use_godot = GlobalConfig::get_singleton()->get("application/use_shared_user_dir");
+ bool use_godot = ProjectSettings::get_singleton()->get("application/config/use_shared_user_dir");
if (use_godot)
return get_environment("HOME") + "/.godot/app_userdata/" + an;
else
@@ -470,12 +506,7 @@ String OS_Unix::get_data_dir() const {
}
}
- return GlobalConfig::get_singleton()->get_resource_path();
-}
-
-bool OS_Unix::check_feature_support(const String &p_feature) {
-
- return VisualServer::get_singleton()->has_os_feature(p_feature);
+ return ProjectSettings::get_singleton()->get_resource_path();
}
String OS_Unix::get_installed_templates_path() const {
@@ -500,7 +531,7 @@ String OS_Unix::get_executable_path() const {
return OS::get_executable_path();
}
return b;
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
char resolved_path[MAXPATHLEN];
realpath(OS::get_executable_path().utf8().get_data(), resolved_path);
diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h
index 3ac4f46109..115bdc2d65 100644
--- a/drivers/unix/os_unix.h
+++ b/drivers/unix/os_unix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -68,20 +69,24 @@ public:
virtual void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type = ERR_ERROR);
virtual void print(const char *p_format, ...);
- virtual void vprint(const char *p_format, va_list p_list, bool p_stderr = false);
+ virtual void vprint(const char *p_format, va_list p_list, bool p_stder = false);
virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
virtual String get_stdin_string(bool p_block);
//virtual void set_mouse_show(bool p_show);
//virtual void set_mouse_grab(bool p_grab);
//virtual bool is_mouse_grab_enabled() const = 0;
- //virtual void get_mouse_pos(int &x, int &y) const;
+ //virtual void get_mouse_position(int &x, int &y) const;
//virtual void set_window_title(const String& p_title);
//virtual void set_video_mode(const VideoMode& p_video_mode);
//virtual VideoMode get_video_mode() const;
//virtual void get_fullscreen_mode_list(List<VideoMode> *p_list) const;
+ virtual Error open_dynamic_library(const String p_path, void *&p_library_handle);
+ virtual Error close_dynamic_library(void *p_library_handle);
+ virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false);
+
virtual Error set_cwd(const String &p_cwd);
virtual String get_name();
@@ -98,7 +103,7 @@ public:
virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL);
virtual Error kill(const ProcessID &p_pid);
- virtual int get_process_ID() const;
+ virtual int get_process_id() const;
virtual bool has_environment(const String &p_var) const;
virtual String get_environment(const String &p_var) const;
@@ -112,8 +117,6 @@ public:
virtual String get_executable_path() const;
virtual String get_data_dir() const;
- virtual bool check_feature_support(const String &p_feature);
-
//virtual void run( MainLoop * p_main_loop );
};
diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp
index e70e4fc349..b21990a866 100644
--- a/drivers/unix/packet_peer_udp_posix.cpp
+++ b/drivers/unix/packet_peer_udp_posix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -126,7 +127,7 @@ int PacketPeerUDPPosix::get_max_packet_size() const {
return 512; // uhm maybe not
}
-Error PacketPeerUDPPosix::listen(int p_port, IP_Address p_bind_address, int p_recv_buffer_size) {
+Error PacketPeerUDPPosix::listen(int p_port, const 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);
@@ -171,13 +172,13 @@ Error PacketPeerUDPPosix::wait() {
return _poll(true);
}
-Error PacketPeerUDPPosix::_poll(bool p_wait) {
+Error PacketPeerUDPPosix::_poll(bool p_block) {
if (sockfd == -1) {
return FAILED;
}
- _set_sock_blocking(p_wait);
+ _set_sock_blocking(p_block);
struct sockaddr_storage from = { 0 };
socklen_t len = sizeof(struct sockaddr_storage);
@@ -215,6 +216,8 @@ Error PacketPeerUDPPosix::_poll(bool p_wait) {
len = sizeof(struct sockaddr_storage);
++queue_count;
+ if (p_block)
+ break;
};
// TODO: Should ECONNRESET be handled here?
diff --git a/drivers/unix/packet_peer_udp_posix.h b/drivers/unix/packet_peer_udp_posix.h
index 60d5bf6580..d8b08818b0 100644
--- a/drivers/unix/packet_peer_udp_posix.h
+++ b/drivers/unix/packet_peer_udp_posix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -66,7 +67,7 @@ public:
virtual int get_max_packet_size() const;
- virtual Error listen(int p_port, IP_Address p_bind_address = IP_Address("*"), int p_recv_buffer_size = 65536);
+ virtual Error listen(int p_port, const 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 9c9ad26165..25bc8f0bd3 100644
--- a/drivers/unix/rw_lock_posix.cpp
+++ b/drivers/unix/rw_lock_posix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/rw_lock_posix.h b/drivers/unix/rw_lock_posix.h
index 429b5c22d7..f8199aeb54 100644
--- a/drivers/unix/rw_lock_posix.h
+++ b/drivers/unix/rw_lock_posix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/semaphore_posix.cpp b/drivers/unix/semaphore_posix.cpp
index 69f499bb52..8b553194db 100644
--- a/drivers/unix/semaphore_posix.cpp
+++ b/drivers/unix/semaphore_posix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/semaphore_posix.h b/drivers/unix/semaphore_posix.h
index 66e10db3c3..c7a7f9bd87 100644
--- a/drivers/unix/semaphore_posix.h
+++ b/drivers/unix/semaphore_posix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/socket_helpers.h b/drivers/unix/socket_helpers.h
index d27328a01e..5fa727a9b9 100644
--- a/drivers/unix/socket_helpers.h
+++ b/drivers/unix/socket_helpers.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -99,13 +100,21 @@ static size_t _set_listen_sockaddr(struct sockaddr_storage *p_addr, int p_port,
};
};
-static int _socket_create(IP::Type p_type, int type, int protocol) {
+static int _socket_create(IP::Type &p_type, int type, int protocol) {
ERR_FAIL_COND_V(p_type > IP::TYPE_ANY || p_type < IP::TYPE_NONE, ERR_INVALID_PARAMETER);
int family = p_type == IP::TYPE_IPV4 ? AF_INET : AF_INET6;
int sockfd = socket(family, type, protocol);
+ if (sockfd == -1 && p_type == IP::TYPE_ANY) {
+ // Careful here, changing the referenced parameter so the caller knows that we are using an IPv4 socket
+ // in place of a dual stack one, and further calls to _set_sock_addr will work as expected.
+ p_type = IP::TYPE_IPV4;
+ family = AF_INET;
+ sockfd = socket(family, type, protocol);
+ }
+
ERR_FAIL_COND_V(sockfd == -1, -1);
if (family == AF_INET6) {
diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp
index fc4838f1e0..30843e4947 100644
--- a/drivers/unix/stream_peer_tcp_posix.cpp
+++ b/drivers/unix/stream_peer_tcp_posix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/stream_peer_tcp_posix.h b/drivers/unix/stream_peer_tcp_posix.h
index ef98f2ab83..3f28f82b50 100644
--- a/drivers/unix/stream_peer_tcp_posix.h
+++ b/drivers/unix/stream_peer_tcp_posix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/unix/tcp_server_posix.cpp b/drivers/unix/tcp_server_posix.cpp
index 9049faebb8..a8554d07a3 100644
--- a/drivers/unix/tcp_server_posix.cpp
+++ b/drivers/unix/tcp_server_posix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -68,7 +69,7 @@ void TCPServerPosix::make_default() {
TCP_Server::_create = TCPServerPosix::_create;
};
-Error TCPServerPosix::listen(uint16_t p_port, const IP_Address p_bind_address) {
+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);
diff --git a/drivers/unix/tcp_server_posix.h b/drivers/unix/tcp_server_posix.h
index 408179c197..947050ab8a 100644
--- a/drivers/unix/tcp_server_posix.h
+++ b/drivers/unix/tcp_server_posix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -40,7 +41,7 @@ class TCPServerPosix : public TCP_Server {
static TCP_Server *_create();
public:
- virtual Error listen(uint16_t p_port, IP_Address p_bind_address = IP_Address("*"));
+ 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/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp
index c33cc8cc5d..3b895ff9c1 100644
--- a/drivers/unix/thread_posix.cpp
+++ b/drivers/unix/thread_posix.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,7 +38,7 @@
#include "os/memory.h"
-Thread::ID ThreadPosix::get_ID() const {
+Thread::ID ThreadPosix::get_id() const {
return id;
}
@@ -74,7 +75,7 @@ Thread *ThreadPosix::create_func_posix(ThreadCreateCallback p_callback, void *p_
return tr;
}
-Thread::ID ThreadPosix::get_thread_ID_func_posix() {
+Thread::ID ThreadPosix::get_thread_id_func_posix() {
return (ID)pthread_self();
}
@@ -121,7 +122,7 @@ Error ThreadPosix::set_name_func_posix(const String &p_name) {
void ThreadPosix::make_default() {
create_func = create_func_posix;
- get_thread_ID_func = get_thread_ID_func_posix;
+ get_thread_id_func = get_thread_id_func_posix;
wait_to_finish_func = wait_to_finish_func_posix;
set_name_func = set_name_func_posix;
}
diff --git a/drivers/unix/thread_posix.h b/drivers/unix/thread_posix.h
index a756ed972c..21e1d290a9 100644
--- a/drivers/unix/thread_posix.h
+++ b/drivers/unix/thread_posix.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -52,7 +53,7 @@ class ThreadPosix : public Thread {
static void *thread_callback(void *userdata);
static Thread *create_func_posix(ThreadCreateCallback p_callback, void *, const Settings &);
- static ID get_thread_ID_func_posix();
+ static ID get_thread_id_func_posix();
static void wait_to_finish_func_posix(Thread *p_thread);
static Error set_name_func_posix(const String &p_name);
@@ -60,7 +61,7 @@ class ThreadPosix : public Thread {
ThreadPosix();
public:
- virtual ID get_ID() const;
+ virtual ID get_id() const;
static void make_default();
diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp
index b0710b2c36..76665f0203 100644
--- a/drivers/windows/dir_access_windows.cpp
+++ b/drivers/windows/dir_access_windows.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/windows/dir_access_windows.h b/drivers/windows/dir_access_windows.h
index e0815f2c09..a352415fd6 100644
--- a/drivers/windows/dir_access_windows.h
+++ b/drivers/windows/dir_access_windows.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -74,8 +75,8 @@ public:
virtual Error make_dir(String p_dir);
- virtual Error rename(String p_from, String p_to);
- virtual Error remove(String p_name);
+ virtual Error rename(String p_path, String p_new_path);
+ virtual Error remove(String p_path);
//virtual FileType get_file_type() const;
size_t get_space_left();
diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp
index 0bb6c1d196..bb133b9899 100644
--- a/drivers/windows/file_access_windows.cpp
+++ b/drivers/windows/file_access_windows.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -52,9 +53,9 @@ void FileAccessWindows::check_errors() const {
}
}
-Error FileAccessWindows::_open(const String &p_filename, int p_mode_flags) {
+Error FileAccessWindows::_open(const String &p_path, int p_mode_flags) {
- String filename = fix_path(p_filename);
+ String filename = fix_path(p_path);
if (f)
close();
diff --git a/drivers/windows/file_access_windows.h b/drivers/windows/file_access_windows.h
index d64a4b98fc..de5fc2bc09 100644
--- a/drivers/windows/file_access_windows.h
+++ b/drivers/windows/file_access_windows.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/windows/mutex_windows.cpp b/drivers/windows/mutex_windows.cpp
index bacf89efbb..7d9bc22e51 100644
--- a/drivers/windows/mutex_windows.cpp
+++ b/drivers/windows/mutex_windows.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/windows/mutex_windows.h b/drivers/windows/mutex_windows.h
index 0c6cbd472a..2e000a43f5 100644
--- a/drivers/windows/mutex_windows.h
+++ b/drivers/windows/mutex_windows.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/windows/rw_lock_windows.cpp b/drivers/windows/rw_lock_windows.cpp
index 615bcd22aa..e2213be9c1 100644
--- a/drivers/windows/rw_lock_windows.cpp
+++ b/drivers/windows/rw_lock_windows.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/windows/rw_lock_windows.h b/drivers/windows/rw_lock_windows.h
index e4b5367c2f..eb030d6029 100644
--- a/drivers/windows/rw_lock_windows.h
+++ b/drivers/windows/rw_lock_windows.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/windows/semaphore_windows.cpp b/drivers/windows/semaphore_windows.cpp
index b1c9ee0182..3a5c0b054c 100644
--- a/drivers/windows/semaphore_windows.cpp
+++ b/drivers/windows/semaphore_windows.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/windows/semaphore_windows.h b/drivers/windows/semaphore_windows.h
index 5594cb0c58..90aacc7e26 100644
--- a/drivers/windows/semaphore_windows.h
+++ b/drivers/windows/semaphore_windows.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/windows/shell_windows.cpp b/drivers/windows/shell_windows.cpp
index 715d886ed2..17ff9fe962 100644
--- a/drivers/windows/shell_windows.cpp
+++ b/drivers/windows/shell_windows.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/windows/shell_windows.h b/drivers/windows/shell_windows.h
index e0baf3e765..d94c5812d1 100644
--- a/drivers/windows/shell_windows.h
+++ b/drivers/windows/shell_windows.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/drivers/windows/thread_windows.cpp b/drivers/windows/thread_windows.cpp
index e6143b4af3..01ddf42649 100644
--- a/drivers/windows/thread_windows.cpp
+++ b/drivers/windows/thread_windows.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,7 +33,7 @@
#include "os/memory.h"
-Thread::ID ThreadWindows::get_ID() const {
+Thread::ID ThreadWindows::get_id() const {
return id;
}
@@ -71,7 +72,7 @@ Thread *ThreadWindows::create_func_windows(ThreadCreateCallback p_callback, void
return tr;
}
-Thread::ID ThreadWindows::get_thread_ID_func_windows() {
+Thread::ID ThreadWindows::get_thread_id_func_windows() {
return (ID)GetCurrentThreadId(); //must implement
}
@@ -87,7 +88,7 @@ void ThreadWindows::wait_to_finish_func_windows(Thread *p_thread) {
void ThreadWindows::make_default() {
create_func = create_func_windows;
- get_thread_ID_func = get_thread_ID_func_windows;
+ get_thread_id_func = get_thread_id_func_windows;
wait_to_finish_func = wait_to_finish_func_windows;
}
diff --git a/drivers/windows/thread_windows.h b/drivers/windows/thread_windows.h
index 5b2c076c7f..143825039c 100644
--- a/drivers/windows/thread_windows.h
+++ b/drivers/windows/thread_windows.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -51,13 +52,13 @@ class ThreadWindows : public Thread {
static DWORD WINAPI thread_callback(LPVOID userdata);
static Thread *create_func_windows(ThreadCreateCallback p_callback, void *, const Settings &);
- static ID get_thread_ID_func_windows();
+ static ID get_thread_id_func_windows();
static void wait_to_finish_func_windows(Thread *p_thread);
ThreadWindows();
public:
- virtual ID get_ID() const;
+ virtual ID get_id() const;
static void make_default();
diff --git a/drivers/xaudio2/audio_driver_xaudio2.cpp b/drivers/xaudio2/audio_driver_xaudio2.cpp
index 546bbff1ba..a1ca2c678e 100644
--- a/drivers/xaudio2/audio_driver_xaudio2.cpp
+++ b/drivers/xaudio2/audio_driver_xaudio2.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "audio_driver_xaudio2.h"
-#include "global_config.h"
#include "os/os.h"
+#include "project_settings.h"
const char *AudioDriverXAudio2::get_name() const {
return "XAudio2";
diff --git a/drivers/xaudio2/audio_driver_xaudio2.h b/drivers/xaudio2/audio_driver_xaudio2.h
index 9a37ba7a7b..7c1d31b57c 100644
--- a/drivers/xaudio2/audio_driver_xaudio2.h
+++ b/drivers/xaudio2/audio_driver_xaudio2.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,7 +34,6 @@
#include "core/os/thread.h"
#include "servers/audio_server.h"
-#include <mmreg.h>
#include <mmsystem.h>
#include <windows.h>
#include <wrl/client.h>
diff --git a/editor/SCsub b/editor/SCsub
index d7392f8249..fd56c9d772 100644
--- a/editor/SCsub
+++ b/editor/SCsub
@@ -141,6 +141,210 @@ def make_translations_header(target, source, env):
g.write("#endif")
+def make_authors_header(target, source, env):
+
+ sections = ["Project Founders", "Lead Developer", "Project Manager", "Developers"]
+ sections_id = ["dev_founders", "dev_lead", "dev_manager", "dev_names"]
+
+ src = source[0].srcnode().abspath
+ dst = target[0].srcnode().abspath
+ f = open(src, "rb")
+ g = open(dst, "wb")
+
+ g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
+ g.write("#ifndef _EDITOR_AUTHORS_H\n")
+ g.write("#define _EDITOR_AUTHORS_H\n")
+
+ current_section = ""
+ name_count = -1
+
+ def close_section():
+ g.write("\t0\n")
+ g.write("};\n")
+ g.write("#define " + current_section.upper() + "_COUNT " + str(name_count) + "\n")
+
+ for line in f:
+ if name_count >= 0:
+ if line.startswith(" "):
+ g.write("\t\"" + line.strip() + "\",\n")
+ name_count += 1
+ continue
+ if line.startswith("## "):
+ if name_count >= 0:
+ close_section()
+ name_count = -1
+ for i in range(len(sections)):
+ if line.strip().endswith(sections[i]):
+ current_section = sections_id[i]
+ name_count = 0
+ g.write("static const char *" + current_section + "[] = {\n")
+ break
+
+ if name_count >= 0:
+ close_section()
+
+ g.write("#endif\n")
+
+def make_license_header(target, source, env):
+
+ src_copyright = source[0].srcnode().abspath
+ src_license = source[1].srcnode().abspath
+ dst = target[0].srcnode().abspath
+ f = open(src_license, "rb")
+ fc = open(src_copyright, "rb")
+ g = open(dst, "wb")
+
+ g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
+ g.write("#ifndef _EDITOR_LICENSE_H\n")
+ g.write("#define _EDITOR_LICENSE_H\n")
+ g.write("static const char *about_license =")
+
+ for line in f:
+ g.write("\n\t\"" + line.strip().replace("\"", "\\\"") + "\\n\"")
+
+ g.write(";\n")
+
+ tp_current = 0
+ tp_file = ""
+ tp_comment = ""
+ tp_copyright = ""
+ tp_license = ""
+
+ tp_licensename = ""
+ tp_licensebody = ""
+
+ tp = []
+ tp_licensetext = []
+ for line in fc:
+ if line.startswith("#"):
+ continue
+
+ if line.startswith("Files:"):
+ tp_file = line[6:].strip()
+ tp_current = 1
+ elif line.startswith("Comment:"):
+ tp_comment = line[8:].strip()
+ tp_current = 2
+ elif line.startswith("Copyright:"):
+ tp_copyright = line[10:].strip()
+ tp_current = 3
+ elif line.startswith("License:"):
+ if tp_current != 0:
+ tp_license = line[8:].strip()
+ tp_current = 4
+ else:
+ tp_licensename = line[8:].strip()
+ tp_current = 5
+ elif line.startswith(" "):
+ if tp_current == 1:
+ tp_file += "\n" + line.strip()
+ elif tp_current == 3:
+ tp_copyright += "\n" + line.strip()
+ elif tp_current == 5:
+ if line.strip() == ".":
+ tp_licensebody += "\n"
+ else:
+ tp_licensebody += line[1:]
+ else:
+ if tp_current != 0:
+ if tp_current == 5:
+ tp_licensetext.append([tp_licensename, tp_licensebody])
+
+ tp_licensename = ""
+ tp_licensebody = ""
+ else:
+ added = False
+ for i in tp:
+ if i[0] == tp_comment:
+ i[1].append([tp_file, tp_copyright, tp_license])
+ added = True
+ break
+ if not added:
+ tp.append([tp_comment,[[tp_file, tp_copyright, tp_license]]])
+
+ tp_file = []
+ tp_comment = ""
+ tp_copyright = []
+ tp_license = ""
+ tp_current = 0
+
+ tp_licensetext.append([tp_licensename, tp_licensebody])
+
+ about_thirdparty = ""
+ about_tp_copyright_count = ""
+ about_tp_license = ""
+ about_tp_copyright = ""
+ about_tp_file = ""
+
+ for i in tp:
+ about_thirdparty += "\t\"" + i[0] + "\",\n"
+ about_tp_copyright_count += str(len(i[1])) + ", "
+ for j in i[1]:
+ file_body = ""
+ copyright_body = ""
+ for k in j[0].split("\n"):
+ if file_body != "":
+ file_body += "\\n\"\n"
+ file_body += "\t\"" + k.strip().replace("\"", "\\\"")
+ for k in j[1].split("\n"):
+ if copyright_body != "":
+ copyright_body += "\\n\"\n"
+ copyright_body += "\t\"" + k.strip().replace("\"", "\\\"")
+
+ about_tp_file += "\t" + file_body + "\",\n"
+ about_tp_copyright += "\t" + copyright_body + "\",\n"
+ about_tp_license += "\t\"" + j[2] + "\",\n"
+
+ about_license_name = ""
+ about_license_body = ""
+
+ for i in tp_licensetext:
+ body = ""
+ for j in i[1].split("\n"):
+ if body != "":
+ body += "\\n\"\n"
+ body += "\t\"" + j.strip().replace("\"", "\\\"")
+
+ about_license_name += "\t\"" + i[0] + "\",\n"
+ about_license_body += "\t" + body + "\",\n"
+
+ g.write("static const char *about_thirdparty[] = {\n")
+ g.write(about_thirdparty)
+ g.write("\t0\n")
+ g.write("};\n")
+ g.write("#define THIRDPARTY_COUNT " + str(len(tp)) + "\n")
+
+ g.write("static const int about_tp_copyright_count[] = {\n\t")
+ g.write(about_tp_copyright_count)
+ g.write("0\n};\n")
+
+ g.write("static const char *about_tp_file[] = {\n")
+ g.write(about_tp_file)
+ g.write("\t0\n")
+ g.write("};\n")
+
+ g.write("static const char *about_tp_copyright[] = {\n")
+ g.write(about_tp_copyright)
+ g.write("\t0\n")
+ g.write("};\n")
+
+ g.write("static const char *about_tp_license[] = {\n")
+ g.write(about_tp_license)
+ g.write("\t0\n")
+ g.write("};\n")
+
+ g.write("static const char *about_license_name[] = {\n")
+ g.write(about_license_name)
+ g.write("\t0\n")
+ g.write("};\n")
+ g.write("#define LICENSE_COUNT " + str(len(tp_licensetext)) + "\n")
+
+ g.write("static const char *about_license_body[] = {\n")
+ g.write(about_license_body)
+ g.write("\t0\n")
+ g.write("};\n")
+
+ g.write("#endif\n")
if (env["tools"] == "yes"):
@@ -152,7 +356,7 @@ if (env["tools"] == "yes"):
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")
+ f = open("register_exporters.gen.cpp", "wb")
f.write(reg_exporters_inc)
f.write(reg_exporters)
f.close()
@@ -165,12 +369,12 @@ if (env["tools"] == "yes"):
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)
+ env.Depends("#editor/doc_data_compressed.gen.h", docs)
+ env.Command("#editor/doc_data_compressed.gen.h", docs, make_doc_header)
# Certificates
- 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)
+ env.Depends("#editor/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt")
+ env.Command("#editor/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt", make_certs_header)
import glob
path = env.Dir('.').abspath
@@ -178,15 +382,23 @@ if (env["tools"] == "yes"):
# Translations
tlist = glob.glob(path + "/translations/*.po")
print("translations: ", tlist)
- env.Depends('#editor/translations.h', tlist)
- env.Command('#editor/translations.h', tlist, make_translations_header)
+ env.Depends('#editor/translations.gen.h', tlist)
+ env.Command('#editor/translations.gen.h', tlist, make_translations_header)
# Fonts
flist = glob.glob(path + "/../thirdparty/fonts/*.ttf")
flist.append(glob.glob(path + "/../thirdparty/fonts/*.otf"))
print("fonts: ", flist)
- env.Depends('#editor/builtin_fonts.h', flist)
- env.Command('#editor/builtin_fonts.h', flist, make_fonts_header)
+ env.Depends('#editor/builtin_fonts.gen.h', flist)
+ env.Command('#editor/builtin_fonts.gen.h', flist, make_fonts_header)
+
+ # Authors
+ env.Depends('#editor/authors.gen.h', "../AUTHORS.md")
+ env.Command('#editor/authors.gen.h', "../AUTHORS.md", make_authors_header)
+
+ # License
+ env.Depends('#editor/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"])
+ env.Command('#editor/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"], make_license_header)
env.add_source_files(env.editor_sources, "*.cpp")
diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp
index fe342b0ee8..1571131aee 100644
--- a/editor/animation_editor.cpp
+++ b/editor/animation_editor.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -75,7 +76,7 @@ private:
Ref<StyleBox> sb = get_stylebox("normal", "LineEdit");
sb->draw(ci, r);
r.size -= sb->get_minimum_size();
- r.pos += sb->get_offset();
+ r.position += sb->get_offset();
//VisualServer::get_singleton()->canvas_item_add
Ref<Font> f = get_font("font", "Label");
@@ -110,7 +111,7 @@ private:
iflp = 1.0 - iflp;
}
- VisualServer::get_singleton()->canvas_item_add_line(ci, r.pos + Point2(iflp * r.size.width, prev * r.size.height), r.pos + Point2(ifl * r.size.width, h * r.size.height), mcolor);
+ VisualServer::get_singleton()->canvas_item_add_line(ci, r.position + Point2(iflp * r.size.width, prev * r.size.height), r.position + Point2(ifl * r.size.width, h * r.size.height), mcolor);
prev = h;
}
@@ -137,7 +138,7 @@ private:
iflp = 1.0 - iflp;
}
- VisualServer::get_singleton()->canvas_item_add_line(ci, r.pos + Point2(iflp * r.size.width, prev * r.size.height), r.pos + Point2(ifl * r.size.width, h * r.size.height), color);
+ VisualServer::get_singleton()->canvas_item_add_line(ci, r.position + Point2(iflp * r.size.width, prev * r.size.height), r.position + Point2(ifl * r.size.width, h * r.size.height), color);
prev = h;
}
}
@@ -153,13 +154,15 @@ private:
}
}
- void _gui_input(const InputEvent &p_ev) {
- if (p_ev.type == InputEvent::MOUSE_MOTION && p_ev.mouse_motion.button_mask & BUTTON_MASK_LEFT) {
+ void _gui_input(const Ref<InputEvent> &p_ev) {
+
+ Ref<InputEventMouseMotion> mm = p_ev;
+ if (mm.is_valid() && mm->get_button_mask() & BUTTON_MASK_LEFT) {
if (mode == MODE_DISABLED)
return;
- float rel = p_ev.mouse_motion.relative_x;
+ float rel = mm->get_relative().x;
if (rel == 0)
return;
@@ -1034,7 +1037,7 @@ void AnimationKeyEditor::_track_pos_draw() {
//draw position
int pixel = (timeline_pos - h_scroll->get_value()) * zoom_scale;
pixel += name_limit;
- track_pos->draw_line(ofs + Point2(pixel, 0), ofs + Point2(pixel, size.height), Color(1, 0.3, 0.3, 0.8));
+ track_pos->draw_line(ofs + Point2(pixel, 0), ofs + Point2(pixel, size.height), get_color("highlight_color", "Editor"));
}
}
@@ -1088,13 +1091,12 @@ void AnimationKeyEditor::_track_editor_draw() {
int sep = get_constant("vseparation", "Tree");
int hsep = get_constant("hseparation", "Tree");
Color color = get_color("font_color", "Tree");
- Color sepcolor = get_color("guide_color", "Tree");
- Color timecolor = get_color("prop_subsection", "Editor");
- timecolor = Color::html("ff4a414f");
+ Color sepcolor = Color(1, 1, 1, 0.2);
+ Color timecolor = Color(1, 1, 1, 0.2);
Color hover_color = Color(1, 1, 1, 0.05);
Color select_color = Color(1, 1, 1, 0.1);
- Color invalid_path_color = Color(1, 0.6, 0.4, 0.5);
- Color track_select_color = Color::html("ffbd8e8e");
+ Color invalid_path_color = get_color("error_color", "Editor");
+ Color track_select_color = get_color("highlight_color", "Editor");
Ref<Texture> remove_icon = get_icon("Remove", "EditorIcons");
Ref<Texture> move_up_icon = get_icon("MoveUp", "EditorIcons");
@@ -1154,11 +1156,12 @@ void AnimationKeyEditor::_track_editor_draw() {
int settings_limit = size.width - right_separator_ofs;
int name_limit = settings_limit * name_column_ratio;
- te->draw_line(ofs + Point2(name_limit, 0), ofs + Point2(name_limit, size.height), color);
- te->draw_line(ofs + Point2(settings_limit, 0), ofs + Point2(settings_limit, size.height), color);
+ Color linecolor = Color(1, 1, 1, 0.2);
+ te->draw_line(ofs + Point2(name_limit, 0), ofs + Point2(name_limit, size.height), linecolor);
+ te->draw_line(ofs + Point2(settings_limit, 0), ofs + Point2(settings_limit, size.height), linecolor);
te->draw_texture(hsize_icon, ofs + Point2(name_limit - hsize_icon->get_width() - hsep, (h - hsize_icon->get_height()) / 2));
- te->draw_line(ofs + Point2(0, h), ofs + Point2(size.width, h), color);
+ te->draw_line(ofs + Point2(0, h), ofs + Point2(size.width, h), linecolor);
// draw time
float keys_from;
@@ -1178,11 +1181,7 @@ void AnimationKeyEditor::_track_editor_draw() {
int end_px = (l - h_scroll->get_value()) * scale;
int begin_px = -h_scroll->get_value() * scale;
- Color notimecol;
- notimecol.r = timecolor.gray();
- notimecol.g = notimecol.r;
- notimecol.b = notimecol.r;
- notimecol.a = timecolor.a;
+ Color notimecol = get_color("dark_color_2", "Editor");
{
@@ -1278,7 +1277,7 @@ void AnimationKeyEditor::_track_editor_draw() {
if ((sc / step) != (prev_sc / step) || (prev_sc < 0 && sc >= 0)) {
int scd = sc < 0 ? prev_sc : sc;
- te->draw_line(ofs + Point2(name_limit + i, 0), ofs + Point2(name_limit + i, h), color);
+ te->draw_line(ofs + Point2(name_limit + i, 0), ofs + Point2(name_limit + i, h), linecolor);
te->draw_string(font, ofs + Point2(name_limit + i + 3, (h - font->get_height()) / 2 + font->get_ascent()).floor(), String::num((scd - (scd % step)) / double(SC_ADJ), decimals), sub ? color_time_dec : color_time_sec, zoomw - i);
}
}
@@ -1300,7 +1299,7 @@ void AnimationKeyEditor::_track_editor_draw() {
Object *obj = NULL;
RES res;
- Node *node = root->get_node_and_resource(animation->track_get_path(idx), res);
+ Node *node = root ? root->get_node_and_resource(animation->track_get_path(idx), res) : (Node *)NULL;
if (res.is_valid()) {
obj = res.ptr();
@@ -1325,7 +1324,7 @@ void AnimationKeyEditor::_track_editor_draw() {
te->draw_texture(type_icon[animation->track_get_type(idx)], ofs + Point2(0, y + (h - type_icon[0]->get_height()) / 2).floor());
NodePath np = animation->track_get_path(idx);
- Node *n = root->get_node(np);
+ Node *n = root ? root->get_node(np) : (Node *)NULL;
Color ncol = color;
if (n && editor_selection->is_selected(n))
ncol = track_select_color;
@@ -1337,7 +1336,7 @@ void AnimationKeyEditor::_track_editor_draw() {
te->draw_line(ofs + Point2(0, y + h), ofs + Point2(size.width, y + h), sepcolor);
Point2 icon_ofs = ofs + Point2(size.width, y + (h - remove_icon->get_height()) / 2).floor();
- icon_ofs.y += 4;
+ icon_ofs.y += 4 * EDSCALE;
/* icon_ofs.x-=remove_icon->get_width();
@@ -1355,7 +1354,7 @@ void AnimationKeyEditor::_track_editor_draw() {
*/
track_ofs[0] = size.width - icon_ofs.x;
icon_ofs.x -= down_icon->get_width();
- te->draw_texture(down_icon, icon_ofs);
+ te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE));
int wrap_type = animation->track_get_interpolation_loop_wrap(idx) ? 1 : 0;
icon_ofs.x -= hsep;
@@ -1368,7 +1367,7 @@ void AnimationKeyEditor::_track_editor_draw() {
track_ofs[1] = size.width - icon_ofs.x;
icon_ofs.x -= down_icon->get_width();
- te->draw_texture(down_icon, icon_ofs);
+ te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE));
int interp_type = animation->track_get_interpolation_type(idx);
ERR_CONTINUE(interp_type < 0 || interp_type >= 3);
@@ -1387,7 +1386,7 @@ void AnimationKeyEditor::_track_editor_draw() {
icon_ofs.x -= hsep;
icon_ofs.x -= down_icon->get_width();
- te->draw_texture(down_icon, icon_ofs);
+ te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE));
icon_ofs.x -= hsep;
icon_ofs.x -= cont_icon[umode]->get_width();
@@ -1482,7 +1481,9 @@ void AnimationKeyEditor::_track_editor_draw() {
switch (click.click) {
case ClickOver::CLICK_SELECT_KEYS: {
- te->draw_rect(Rect2(click.at, click.to - click.at), Color(0.7, 0.7, 1.0, 0.5));
+ Color box_color = get_color("highlight_color", "Editor");
+ box_color.a = 0.35;
+ te->draw_rect(Rect2(click.at, click.to - click.at), box_color);
} break;
case ClickOver::CLICK_MOVE_KEYS: {
@@ -1723,7 +1724,7 @@ bool AnimationKeyEditor::_edit_if_single_selection() {
curve_edit->set_transition(animation->track_get_key_transition(idx, key));
/*key_edit_dialog->set_size( Size2( 200,200) );
- key_edit_dialog->set_pos( track_editor->get_global_pos() + ofs + mpos +Point2(-100,20));
+ key_edit_dialog->set_position( track_editor->get_global_position() + ofs + mpos +Point2(-100,20));
key_edit_dialog->popup();*/
}
@@ -1748,7 +1749,7 @@ void AnimationKeyEditor::_anim_delete_keys() {
}
}
-void AnimationKeyEditor::_track_editor_gui_input(const InputEvent &p_input) {
+void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input) {
Control *te = track_editor;
Ref<StyleBox> style = get_stylebox("normal", "TextEdit");
@@ -1806,1073 +1807,1083 @@ void AnimationKeyEditor::_track_editor_gui_input(const InputEvent &p_input) {
int settings_limit = size.width - right_separator_ofs;
int name_limit = settings_limit * name_column_ratio;
- switch (p_input.type) {
+ Ref<InputEventKey> key = p_input;
+ if (key.is_valid()) {
- case InputEvent::KEY: {
+ if (key->get_scancode() == KEY_D && key->is_pressed() && key->get_command()) {
- if (p_input.key.scancode == KEY_D && p_input.key.pressed && p_input.key.mod.command) {
+ if (key->get_shift())
+ _menu_track(TRACK_MENU_DUPLICATE_TRANSPOSE);
+ else
+ _menu_track(TRACK_MENU_DUPLICATE);
- if (p_input.key.mod.shift)
- _menu_track(TRACK_MENU_DUPLICATE_TRANSPOSE);
- else
- _menu_track(TRACK_MENU_DUPLICATE);
+ accept_event();
- accept_event();
+ } else if (key->get_scancode() == KEY_DELETE && key->is_pressed() && click.click == ClickOver::CLICK_NONE) {
- } else if (p_input.key.scancode == KEY_DELETE && p_input.key.pressed && click.click == ClickOver::CLICK_NONE) {
+ _anim_delete_keys();
+ } else if (animation.is_valid() && animation->get_track_count() > 0) {
- _anim_delete_keys();
- } else if (animation.is_valid() && animation->get_track_count() > 0) {
-
- if (p_input.is_pressed() && (p_input.is_action("ui_up") || p_input.is_action("ui_page_up"))) {
+ if (key->is_pressed() && (key->is_action("ui_up") || key->is_action("ui_page_up"))) {
- if (p_input.is_action("ui_up"))
- selected_track--;
- if (v_scroll->is_visible_in_tree() && p_input.is_action("ui_page_up"))
- selected_track--;
+ if (key->is_action("ui_up"))
+ selected_track--;
+ if (v_scroll->is_visible_in_tree() && key->is_action("ui_page_up"))
+ selected_track--;
- if (selected_track < 0)
- selected_track = 0;
+ if (selected_track < 0)
+ selected_track = 0;
- if (v_scroll->is_visible_in_tree()) {
- if (v_scroll->get_value() > selected_track)
- v_scroll->set_value(selected_track);
- }
-
- track_editor->update();
- accept_event();
+ if (v_scroll->is_visible_in_tree()) {
+ if (v_scroll->get_value() > selected_track)
+ v_scroll->set_value(selected_track);
}
- if (p_input.is_pressed() && (p_input.is_action("ui_down") || p_input.is_action("ui_page_down"))) {
+ track_editor->update();
+ accept_event();
+ }
- if (p_input.is_action("ui_down"))
- selected_track++;
- else if (v_scroll->is_visible_in_tree() && p_input.is_action("ui_page_down"))
- selected_track += v_scroll->get_page();
+ if (key->is_pressed() && (key->is_action("ui_down") || key->is_action("ui_page_down"))) {
- if (selected_track >= animation->get_track_count())
- selected_track = animation->get_track_count() - 1;
+ if (key->is_action("ui_down"))
+ selected_track++;
+ else if (v_scroll->is_visible_in_tree() && key->is_action("ui_page_down"))
+ selected_track += v_scroll->get_page();
- if (v_scroll->is_visible_in_tree() && v_scroll->get_page() + v_scroll->get_value() < selected_track + 1) {
- v_scroll->set_value(selected_track - v_scroll->get_page() + 1);
- }
+ if (selected_track >= animation->get_track_count())
+ selected_track = animation->get_track_count() - 1;
- track_editor->update();
- accept_event();
+ if (v_scroll->is_visible_in_tree() && v_scroll->get_page() + v_scroll->get_value() < selected_track + 1) {
+ v_scroll->set_value(selected_track - v_scroll->get_page() + 1);
}
+
+ track_editor->update();
+ accept_event();
}
+ }
+ }
- } break;
- case InputEvent::MOUSE_BUTTON: {
+ Ref<InputEventMouseButton> mb = p_input;
- const InputEventMouseButton &mb = p_input.mouse_button;
+ if (mb.is_valid()) {
- if (mb.button_index == BUTTON_WHEEL_UP && mb.pressed) {
+ if (mb->get_button_index() == BUTTON_WHEEL_UP && mb->is_pressed()) {
- if (mb.mod.command) {
- zoom->set_value(zoom->get_value() + zoom->get_step());
- } else {
- v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() / 8);
- }
- }
+ if (mb->get_command()) {
- if (mb.button_index == BUTTON_WHEEL_DOWN && mb.pressed) {
+ zoom->set_value(zoom->get_value() + zoom->get_step());
+ } else {
- if (mb.mod.command) {
- zoom->set_value(zoom->get_value() - zoom->get_step());
- } else {
- v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() / 8);
- }
+ v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() * mb->get_factor() / 8);
}
+ }
- if (mb.button_index == BUTTON_RIGHT && mb.pressed) {
+ if (mb->get_button_index() == BUTTON_WHEEL_DOWN && mb->is_pressed()) {
- Point2 mpos = Point2(mb.x, mb.y) - ofs;
+ if (mb->get_command()) {
- if (selection.size() == 0) {
- // Auto-select on right-click if nothing is selected
- // Note: This code is pretty much duplicated from the left click code,
- // both codes could be moved into a function to avoid the duplicated code.
- Point2 mpos = Point2(mb.x, mb.y) - ofs;
+ zoom->set_value(zoom->get_value() - zoom->get_step());
+ } else {
- if (mpos.y < h) {
- return;
- }
+ v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * mb->get_factor() / 8);
+ }
+ }
- mpos.y -= h;
+ if (mb->get_button_index() == BUTTON_WHEEL_RIGHT && mb->is_pressed()) {
- int idx = mpos.y / h;
- idx += v_scroll->get_value();
- if (idx < 0 || idx >= animation->get_track_count())
- break;
+ h_scroll->set_value(h_scroll->get_value() - h_scroll->get_page() * mb->get_factor() / 8);
+ }
- if (mpos.x < name_limit) {
- } else if (mpos.x < settings_limit) {
- float pos = mpos.x - name_limit;
- pos /= _get_zoom_scale();
- pos += h_scroll->get_value();
- float w_time = (type_icon[0]->get_width() / _get_zoom_scale()) / 2.0;
+ if (mb->get_button_index() == BUTTON_WHEEL_LEFT && mb->is_pressed()) {
- int kidx = animation->track_find_key(idx, pos);
- int kidx_n = kidx + 1;
- int key = -1;
+ v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * mb->get_factor() / 8);
+ }
- if (kidx >= 0 && kidx < animation->track_get_key_count(idx)) {
+ if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed()) {
- float kpos = animation->track_get_key_time(idx, kidx);
- if (ABS(pos - kpos) <= w_time) {
+ Point2 mpos = mb->get_position() - ofs;
- key = kidx;
- }
- }
+ if (selection.size() == 0) {
+ // Auto-select on right-click if nothing is selected
+ // Note: This code is pretty much duplicated from the left click code,
+ // both codes could be moved into a function to avoid the duplicated code.
+ Point2 mpos = mb->get_position() - ofs;
- if (key == -1 && kidx_n >= 0 && kidx_n < animation->track_get_key_count(idx)) {
+ if (mpos.y < h) {
+ return;
+ }
- float kpos = animation->track_get_key_time(idx, kidx_n);
- if (ABS(pos - kpos) <= w_time) {
+ mpos.y -= h;
- key = kidx_n;
- }
- }
+ int idx = mpos.y / h;
+ idx += v_scroll->get_value();
+ if (idx < 0 || idx >= animation->get_track_count())
+ return;
- if (key == -1) {
+ if (mpos.x < name_limit) {
+ } else if (mpos.x < settings_limit) {
+ float pos = mpos.x - name_limit;
+ pos /= _get_zoom_scale();
+ pos += h_scroll->get_value();
+ float w_time = (type_icon[0]->get_width() / _get_zoom_scale()) / 2.0;
- click.click = ClickOver::CLICK_SELECT_KEYS;
- click.at = Point2(mb.x, mb.y);
- click.to = click.at;
- click.shift = mb.mod.shift;
- selected_track = idx;
- track_editor->update();
- //drag select region
- return;
+ int kidx = animation->track_find_key(idx, pos);
+ int kidx_n = kidx + 1;
+ int key = -1;
+
+ if (kidx >= 0 && kidx < animation->track_get_key_count(idx)) {
+
+ float kpos = animation->track_get_key_time(idx, kidx);
+ if (ABS(pos - kpos) <= w_time) {
+
+ key = kidx;
}
+ }
- SelectedKey sk;
- sk.track = idx;
- sk.key = key;
- KeyInfo ki;
- ki.pos = animation->track_get_key_time(idx, key);
- click.shift = mb.mod.shift;
- click.selk = sk;
+ if (key == -1 && kidx_n >= 0 && kidx_n < animation->track_get_key_count(idx)) {
- if (!mb.mod.shift && !selection.has(sk))
- _clear_selection();
+ float kpos = animation->track_get_key_time(idx, kidx_n);
+ if (ABS(pos - kpos) <= w_time) {
+
+ key = kidx_n;
+ }
+ }
- selection.insert(sk, ki);
+ if (key == -1) {
- click.click = ClickOver::CLICK_MOVE_KEYS;
- click.at = Point2(mb.x, mb.y);
+ click.click = ClickOver::CLICK_SELECT_KEYS;
+ click.at = mb->get_position();
click.to = click.at;
- update();
+ click.shift = mb->get_shift();
selected_track = idx;
track_editor->update();
-
- if (_edit_if_single_selection() && mb.mod.command) {
- edit_button->set_pressed(true);
- key_editor_tab->show();
- }
+ //drag select region
+ return;
}
- }
- if (selection.size()) {
- // User has right clicked and we have a selection, show a popup menu with options
- track_menu->clear();
- track_menu->set_size(Point2(1, 1));
- track_menu->add_item(TTR("Duplicate Selection"), RIGHT_MENU_DUPLICATE);
- track_menu->add_item(TTR("Duplicate Transposed"), RIGHT_MENU_DUPLICATE_TRANSPOSE);
- track_menu->add_item(TTR("Remove Selection"), RIGHT_MENU_REMOVE);
+ SelectedKey sk;
+ sk.track = idx;
+ sk.key = key;
+ KeyInfo ki;
+ ki.pos = animation->track_get_key_time(idx, key);
+ click.shift = mb->get_shift();
+ click.selk = sk;
- track_menu->set_pos(te->get_global_pos() + mpos);
+ if (!mb->get_shift() && !selection.has(sk))
+ _clear_selection();
- interp_editing = -1;
- cont_editing = -1;
- wrap_editing = -1;
+ selection.insert(sk, ki);
- track_menu->popup();
+ click.click = ClickOver::CLICK_MOVE_KEYS;
+ click.at = mb->get_position();
+ click.to = click.at;
+ update();
+ selected_track = idx;
+ track_editor->update();
+
+ if (_edit_if_single_selection() && mb->get_command()) {
+ edit_button->set_pressed(true);
+ key_editor_tab->show();
+ }
}
}
- if (mb.button_index == BUTTON_LEFT && !(mb.button_mask & ~BUTTON_MASK_LEFT)) {
+ if (selection.size()) {
+ // User has right clicked and we have a selection, show a popup menu with options
+ track_menu->clear();
+ track_menu->set_size(Point2(1, 1));
+ track_menu->add_item(TTR("Duplicate Selection"), RIGHT_MENU_DUPLICATE);
+ track_menu->add_item(TTR("Duplicate Transposed"), RIGHT_MENU_DUPLICATE_TRANSPOSE);
+ track_menu->add_item(TTR("Remove Selection"), RIGHT_MENU_REMOVE);
- if (mb.pressed) {
+ track_menu->set_position(te->get_global_position() + mpos);
- Point2 mpos = Point2(mb.x, mb.y) - ofs;
+ interp_editing = -1;
+ cont_editing = -1;
+ wrap_editing = -1;
- if (mpos.y < h) {
+ track_menu->popup();
+ }
+ }
- if (mpos.x < name_limit && mpos.x > (name_limit - hsep - hsize_icon->get_width())) {
+ if (mb->get_button_index() == BUTTON_LEFT && !(mb->get_button_mask() & ~BUTTON_MASK_LEFT)) {
- click.click = ClickOver::CLICK_RESIZE_NAMES;
- click.at = Point2(mb.x, mb.y);
- click.to = click.at;
- click.at.y = name_limit;
- }
+ if (mb->is_pressed()) {
- if (mpos.x >= name_limit && mpos.x < settings_limit) {
- //seek
- //int zoomw = settings_limit-name_limit;
- float scale = _get_zoom_scale();
- float pos = h_scroll->get_value() + (mpos.x - name_limit) / scale;
- if (animation->get_step())
- pos = Math::stepify(pos, animation->get_step());
-
- if (pos < 0)
- pos = 0;
- if (pos >= animation->get_length())
- pos = animation->get_length();
- timeline_pos = pos;
- click.click = ClickOver::CLICK_DRAG_TIMELINE;
- click.at = Point2(mb.x, mb.y);
- click.to = click.at;
- emit_signal("timeline_changed", pos, false);
- }
+ Point2 mpos = mb->get_position() - ofs;
- return;
- }
+ if (mpos.y < h) {
- mpos.y -= h;
+ if (mpos.x < name_limit && mpos.x > (name_limit - hsep - hsize_icon->get_width())) {
- int idx = mpos.y / h;
- idx += v_scroll->get_value();
- if (idx < 0)
- break;
+ click.click = ClickOver::CLICK_RESIZE_NAMES;
+ click.at = mb->get_position();
+ click.to = click.at;
+ click.at.y = name_limit;
+ }
- if (idx >= animation->get_track_count()) {
+ if (mpos.x >= name_limit && mpos.x < settings_limit) {
+ //seek
+ //int zoomw = settings_limit-name_limit;
+ float scale = _get_zoom_scale();
+ float pos = h_scroll->get_value() + (mpos.x - name_limit) / scale;
+ if (animation->get_step())
+ pos = Math::stepify(pos, animation->get_step());
- if (mpos.x >= name_limit && mpos.x < settings_limit) {
+ if (pos < 0)
+ pos = 0;
+ if (pos >= animation->get_length())
+ pos = animation->get_length();
+ timeline_pos = pos;
+ click.click = ClickOver::CLICK_DRAG_TIMELINE;
+ click.at = mb->get_position();
+ click.to = click.at;
+ emit_signal("timeline_changed", pos, false);
+ }
- click.click = ClickOver::CLICK_SELECT_KEYS;
- click.at = Point2(mb.x, mb.y);
- click.to = click.at;
- //drag select region
- }
+ return;
+ }
- break;
- }
+ mpos.y -= h;
- if (mpos.x < name_limit) {
- //name column
+ int idx = mpos.y / h;
+ idx += v_scroll->get_value();
+ if (idx < 0)
+ return;
- // area
- if (idx != selected_track) {
+ if (idx >= animation->get_track_count()) {
- selected_track = idx;
- track_editor->update();
- break;
- }
+ if (mpos.x >= name_limit && mpos.x < settings_limit) {
- Rect2 area(ofs.x, ofs.y + ((int(mpos.y) / h) + 1) * h, name_limit, h);
- track_name->set_text(animation->track_get_path(idx));
- track_name->set_pos(te->get_global_pos() + area.pos);
- track_name->set_size(area.size);
- track_name->show_modal();
- track_name->grab_focus();
- track_name->select_all();
- track_name_editing = idx;
+ click.click = ClickOver::CLICK_SELECT_KEYS;
+ click.at = mb->get_position();
+ click.to = click.at;
+ //drag select region
+ }
- } else if (mpos.x < settings_limit) {
+ return;
+ }
- float pos = mpos.x - name_limit;
- pos /= _get_zoom_scale();
- pos += h_scroll->get_value();
- float w_time = (type_icon[0]->get_width() / _get_zoom_scale()) / 2.0;
+ if (mpos.x < name_limit) {
+ //name column
- int kidx = animation->track_find_key(idx, pos);
- int kidx_n = kidx + 1;
- int key = -1;
+ // area
+ if (idx != selected_track) {
- if (kidx >= 0 && kidx < animation->track_get_key_count(idx)) {
+ selected_track = idx;
+ track_editor->update();
+ return;
+ }
- float kpos = animation->track_get_key_time(idx, kidx);
- if (ABS(pos - kpos) <= w_time) {
+ Rect2 area(ofs.x, ofs.y + ((int(mpos.y) / h) + 1) * h, name_limit, h);
+ track_name->set_text(animation->track_get_path(idx));
+ track_name->set_position(te->get_global_position() + area.position);
+ track_name->set_size(area.size);
+ track_name->show_modal();
+ track_name->grab_focus();
+ track_name->select_all();
+ track_name_editing = idx;
- key = kidx;
- }
- }
+ } else if (mpos.x < settings_limit) {
- if (key == -1 && kidx_n >= 0 && kidx_n < animation->track_get_key_count(idx)) {
+ float pos = mpos.x - name_limit;
+ pos /= _get_zoom_scale();
+ pos += h_scroll->get_value();
+ float w_time = (type_icon[0]->get_width() / _get_zoom_scale()) / 2.0;
- float kpos = animation->track_get_key_time(idx, kidx_n);
- if (ABS(pos - kpos) <= w_time) {
+ int kidx = animation->track_find_key(idx, pos);
+ int kidx_n = kidx + 1;
+ int key = -1;
- key = kidx_n;
- }
- }
+ if (kidx >= 0 && kidx < animation->track_get_key_count(idx)) {
- if (key == -1) {
+ float kpos = animation->track_get_key_time(idx, kidx);
+ if (ABS(pos - kpos) <= w_time) {
- click.click = ClickOver::CLICK_SELECT_KEYS;
- click.at = Point2(mb.x, mb.y);
- click.to = click.at;
- click.shift = mb.mod.shift;
- selected_track = idx;
- track_editor->update();
- //drag select region
- return;
+ key = kidx;
}
+ }
- SelectedKey sk;
- sk.track = idx;
- sk.key = key;
- KeyInfo ki;
- ki.pos = animation->track_get_key_time(idx, key);
- click.shift = mb.mod.shift;
- click.selk = sk;
+ if (key == -1 && kidx_n >= 0 && kidx_n < animation->track_get_key_count(idx)) {
- if (!mb.mod.shift && !selection.has(sk))
- _clear_selection();
+ float kpos = animation->track_get_key_time(idx, kidx_n);
+ if (ABS(pos - kpos) <= w_time) {
- selection.insert(sk, ki);
+ key = kidx_n;
+ }
+ }
+
+ if (key == -1) {
- click.click = ClickOver::CLICK_MOVE_KEYS;
- click.at = Point2(mb.x, mb.y);
+ click.click = ClickOver::CLICK_SELECT_KEYS;
+ click.at = mb->get_position();
click.to = click.at;
- update();
+ click.shift = mb->get_shift();
selected_track = idx;
track_editor->update();
+ //drag select region
+ return;
+ }
- if (_edit_if_single_selection() && mb.mod.command) {
- edit_button->set_pressed(true);
- key_editor_tab->show();
- }
- } else {
- //button column
- int ofsx = size.width - mpos.x;
- if (ofsx < 0)
- break;
- /*
- if (ofsx < remove_icon->get_width()) {
+ SelectedKey sk;
+ sk.track = idx;
+ sk.key = key;
+ KeyInfo ki;
+ ki.pos = animation->track_get_key_time(idx, key);
+ click.shift = mb->get_shift();
+ click.selk = sk;
- undo_redo->create_action("Remove Anim Track");
- undo_redo->add_do_method(animation.ptr(),"remove_track",idx);
- undo_redo->add_undo_method(animation.ptr(),"add_track",animation->track_get_type(idx),idx);
- undo_redo->add_undo_method(animation.ptr(),"track_set_path",idx,animation->track_get_path(idx));
- //todo interpolation
- for(int i=0;i<animation->track_get_key_count(idx);i++) {
+ if (!mb->get_shift() && !selection.has(sk))
+ _clear_selection();
- Variant v = animation->track_get_key_value(idx,i);
- float time = animation->track_get_key_time(idx,i);
- float trans = animation->track_get_key_transition(idx,i);
+ selection.insert(sk, ki);
- undo_redo->add_undo_method(animation.ptr(),"track_insert_key",idx,time,v);
- undo_redo->add_undo_method(animation.ptr(),"track_set_key_transition",idx,i,trans);
+ click.click = ClickOver::CLICK_MOVE_KEYS;
+ click.at = mb->get_position();
+ click.to = click.at;
+ update();
+ selected_track = idx;
+ track_editor->update();
- }
+ if (_edit_if_single_selection() && mb->get_command()) {
+ edit_button->set_pressed(true);
+ key_editor_tab->show();
+ }
+ } else {
+ //button column
+ int ofsx = size.width - mpos.x;
+ if (ofsx < 0)
+ return;
+ /*
+ if (ofsx < remove_icon->get_width()) {
- undo_redo->add_undo_method(animation.ptr(),"track_set_interpolation_type",idx,animation->track_get_interpolation_type(idx));
- if (animation->track_get_type(idx)==Animation::TYPE_VALUE) {
- undo_redo->add_undo_method(animation.ptr(),"value_track_set_continuous",idx,animation->value_track_is_continuous(idx));
+ undo_redo->create_action("Remove Anim Track");
+ undo_redo->add_do_method(animation.ptr(),"remove_track",idx);
+ undo_redo->add_undo_method(animation.ptr(),"add_track",animation->track_get_type(idx),idx);
+ undo_redo->add_undo_method(animation.ptr(),"track_set_path",idx,animation->track_get_path(idx));
+ //todo interpolation
+ for(int i=0;i<animation->track_get_key_count(idx);i++) {
- }
+ Variant v = animation->track_get_key_value(idx,i);
+ float time = animation->track_get_key_time(idx,i);
+ float trans = animation->track_get_key_transition(idx,i);
- undo_redo->commit_action();
+ undo_redo->add_undo_method(animation.ptr(),"track_insert_key",idx,time,v);
+ undo_redo->add_undo_method(animation.ptr(),"track_set_key_transition",idx,i,trans);
-
- return;
}
- ofsx-=hsep+remove_icon->get_width();
-
- if (ofsx < move_down_icon->get_width()) {
+ undo_redo->add_undo_method(animation.ptr(),"track_set_interpolation_type",idx,animation->track_get_interpolation_type(idx));
+ if (animation->track_get_type(idx)==Animation::TYPE_VALUE) {
+ undo_redo->add_undo_method(animation.ptr(),"value_track_set_continuous",idx,animation->value_track_is_continuous(idx));
- if (idx < animation->get_track_count() -1) {
- undo_redo->create_action("Move Anim Track Down");
- undo_redo->add_do_method(animation.ptr(),"track_move_up",idx);
- undo_redo->add_undo_method(animation.ptr(),"track_move_down",idx+1);
- undo_redo->commit_action();
- }
- return;
}
- ofsx-=hsep+move_down_icon->get_width();
+ undo_redo->commit_action();
- if (ofsx < move_up_icon->get_width()) {
- if (idx >0) {
- undo_redo->create_action("Move Anim Track Up");
- undo_redo->add_do_method(animation.ptr(),"track_move_down",idx);
- undo_redo->add_undo_method(animation.ptr(),"track_move_up",idx-1);
- undo_redo->commit_action();
- }
- return;
- }
+ return;
+ }
+ ofsx-=hsep+remove_icon->get_width();
- ofsx-=hsep*3+move_up_icon->get_width();
- */
+ if (ofsx < move_down_icon->get_width()) {
+
+ if (idx < animation->get_track_count() -1) {
+ undo_redo->create_action("Move Anim Track Down");
+ undo_redo->add_do_method(animation.ptr(),"track_move_up",idx);
+ undo_redo->add_undo_method(animation.ptr(),"track_move_down",idx+1);
+ undo_redo->commit_action();
+ }
+ return;
+ }
- if (ofsx < track_ofs[1]) {
+ ofsx-=hsep+move_down_icon->get_width();
- track_menu->clear();
- track_menu->set_size(Point2(1, 1));
- static const char *interp_name[2] = { "Clamp Loop Interp", "Wrap Loop Interp" };
- for (int i = 0; i < 2; i++) {
- track_menu->add_icon_item(wrap_icon[i], interp_name[i]);
- }
+ if (ofsx < move_up_icon->get_width()) {
- int popup_y = ofs.y + ((int(mpos.y) / h) + 2) * h;
- int popup_x = size.width - track_ofs[1];
+ if (idx >0) {
+ undo_redo->create_action("Move Anim Track Up");
+ undo_redo->add_do_method(animation.ptr(),"track_move_down",idx);
+ undo_redo->add_undo_method(animation.ptr(),"track_move_up",idx-1);
+ undo_redo->commit_action();
+ }
+ return;
+ }
- track_menu->set_pos(te->get_global_pos() + Point2(popup_x, popup_y));
- wrap_editing = idx;
- interp_editing = -1;
- cont_editing = -1;
+ ofsx-=hsep*3+move_up_icon->get_width();
+ */
- track_menu->popup();
+ if (ofsx < track_ofs[1]) {
- return;
+ track_menu->clear();
+ track_menu->set_size(Point2(1, 1));
+ static const char *interp_name[2] = { "Clamp Loop Interp", "Wrap Loop Interp" };
+ for (int i = 0; i < 2; i++) {
+ track_menu->add_icon_item(wrap_icon[i], interp_name[i]);
}
- if (ofsx < track_ofs[2]) {
+ int popup_y = ofs.y + ((int(mpos.y) / h) + 2) * h;
+ int popup_x = size.width - track_ofs[1];
- track_menu->clear();
- track_menu->set_size(Point2(1, 1));
- static const char *interp_name[3] = { "Nearest", "Linear", "Cubic" };
- for (int i = 0; i < 3; i++) {
- track_menu->add_icon_item(interp_icon[i], interp_name[i]);
- }
+ track_menu->set_position(te->get_global_position() + Point2(popup_x, popup_y));
- int popup_y = ofs.y + ((int(mpos.y) / h) + 2) * h;
- int popup_x = size.width - track_ofs[2];
+ wrap_editing = idx;
+ interp_editing = -1;
+ cont_editing = -1;
- track_menu->set_pos(te->get_global_pos() + Point2(popup_x, popup_y));
+ track_menu->popup();
- interp_editing = idx;
- cont_editing = -1;
- wrap_editing = -1;
+ return;
+ }
- track_menu->popup();
+ if (ofsx < track_ofs[2]) {
- return;
+ track_menu->clear();
+ track_menu->set_size(Point2(1, 1));
+ static const char *interp_name[3] = { "Nearest", "Linear", "Cubic" };
+ for (int i = 0; i < 3; i++) {
+ track_menu->add_icon_item(interp_icon[i], interp_name[i]);
}
- if (ofsx < track_ofs[3]) {
+ int popup_y = ofs.y + ((int(mpos.y) / h) + 2) * h;
+ int popup_x = size.width - track_ofs[2];
- track_menu->clear();
- track_menu->set_size(Point2(1, 1));
- String cont_name[3] = { TTR("Continuous"), TTR("Discrete"), TTR("Trigger") };
- for (int i = 0; i < 3; i++) {
- track_menu->add_icon_item(cont_icon[i], cont_name[i]);
- }
+ track_menu->set_position(te->get_global_position() + Point2(popup_x, popup_y));
- int popup_y = ofs.y + ((int(mpos.y) / h) + 2) * h;
- int popup_x = size.width - track_ofs[3];
+ interp_editing = idx;
+ cont_editing = -1;
+ wrap_editing = -1;
- track_menu->set_pos(te->get_global_pos() + Point2(popup_x, popup_y));
+ track_menu->popup();
- interp_editing = -1;
- wrap_editing = -1;
- cont_editing = idx;
+ return;
+ }
- track_menu->popup();
+ if (ofsx < track_ofs[3]) {
- return;
+ track_menu->clear();
+ track_menu->set_size(Point2(1, 1));
+ String cont_name[3] = { TTR("Continuous"), TTR("Discrete"), TTR("Trigger") };
+ for (int i = 0; i < 3; i++) {
+ track_menu->add_icon_item(cont_icon[i], cont_name[i]);
}
- if (ofsx < track_ofs[4]) {
+ int popup_y = ofs.y + ((int(mpos.y) / h) + 2) * h;
+ int popup_x = size.width - track_ofs[3];
- Animation::TrackType tt = animation->track_get_type(idx);
+ track_menu->set_position(te->get_global_position() + Point2(popup_x, popup_y));
- float pos = timeline_pos;
- int existing = animation->track_find_key(idx, pos, true);
+ interp_editing = -1;
+ wrap_editing = -1;
+ cont_editing = idx;
- Variant newval;
+ track_menu->popup();
- if (tt == Animation::TYPE_TRANSFORM) {
- Dictionary d;
- d["loc"] = Vector3();
- d["rot"] = Quat();
- d["scale"] = Vector3();
- newval = d;
+ return;
+ }
- } else if (tt == Animation::TYPE_METHOD) {
+ if (ofsx < track_ofs[4]) {
- Dictionary d;
- d["method"] = "";
- d["args"] = Vector<Variant>();
+ Animation::TrackType tt = animation->track_get_type(idx);
- newval = d;
- } else if (tt == Animation::TYPE_VALUE) {
+ float pos = timeline_pos;
+ int existing = animation->track_find_key(idx, pos, true);
- NodePath np;
- PropertyInfo inf = _find_hint_for_track(idx, np);
- if (inf.type != Variant::NIL) {
+ Variant newval;
- Variant::CallError err;
- newval = Variant::construct(inf.type, NULL, 0, err);
- }
+ if (tt == Animation::TYPE_TRANSFORM) {
+ Dictionary d;
+ d["loc"] = Vector3();
+ d["rot"] = Quat();
+ d["scale"] = Vector3();
+ newval = d;
- if (newval.get_type() == Variant::NIL) {
- //popup a new type
- cvi_track = idx;
- cvi_pos = pos;
+ } else if (tt == Animation::TYPE_METHOD) {
- type_menu->set_pos(get_global_pos() + mpos + ofs);
- type_menu->popup();
- return;
- }
- }
+ Dictionary d;
+ d["method"] = "";
+ d["args"] = Vector<Variant>();
- undo_redo->create_action(TTR("Anim Add Key"));
+ newval = d;
+ } else if (tt == Animation::TYPE_VALUE) {
- undo_redo->add_do_method(animation.ptr(), "track_insert_key", idx, pos, newval, 1);
- undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_pos", idx, pos);
+ NodePath np;
+ PropertyInfo inf = _find_hint_for_track(idx, np);
+ if (inf.type != Variant::NIL) {
- if (existing != -1) {
- Variant v = animation->track_get_key_value(idx, existing);
- float trans = animation->track_get_key_transition(idx, existing);
- undo_redo->add_undo_method(animation.ptr(), "track_insert_key", idx, pos, v, trans);
+ Variant::CallError err;
+ newval = Variant::construct(inf.type, NULL, 0, err);
}
- undo_redo->commit_action();
+ if (newval.get_type() == Variant::NIL) {
+ //popup a new type
+ cvi_track = idx;
+ cvi_pos = pos;
- return;
+ type_menu->set_position(get_global_position() + mpos + ofs);
+ type_menu->popup();
+ return;
+ }
}
- }
- } else {
+ undo_redo->create_action(TTR("Anim Add Key"));
- switch (click.click) {
- case ClickOver::CLICK_SELECT_KEYS: {
+ undo_redo->add_do_method(animation.ptr(), "track_insert_key", idx, pos, newval, 1);
+ undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_pos", idx, pos);
- float zoom_scale = _get_zoom_scale();
- float keys_from = h_scroll->get_value();
- float keys_to = keys_from + (settings_limit - name_limit) / zoom_scale;
+ if (existing != -1) {
+ Variant v = animation->track_get_key_value(idx, existing);
+ float trans = animation->track_get_key_transition(idx, existing);
+ undo_redo->add_undo_method(animation.ptr(), "track_insert_key", idx, pos, v, trans);
+ }
- float from_time = keys_from + (click.at.x - (name_limit + ofs.x)) / zoom_scale;
- float to_time = keys_from + (click.to.x - (name_limit + ofs.x)) / zoom_scale;
+ undo_redo->commit_action();
- if (to_time < from_time)
- SWAP(from_time, to_time);
+ return;
+ }
+ }
- if (from_time > keys_to || to_time < keys_from)
- break;
+ } else {
- if (from_time < keys_from)
- from_time = keys_from;
+ switch (click.click) {
+ case ClickOver::CLICK_SELECT_KEYS: {
- if (to_time >= keys_to)
- to_time = keys_to;
+ float zoom_scale = _get_zoom_scale();
+ float keys_from = h_scroll->get_value();
+ float keys_to = keys_from + (settings_limit - name_limit) / zoom_scale;
- int from_track = int(click.at.y - ofs.y - h - sep) / h + v_scroll->get_value();
- int to_track = int(click.to.y - ofs.y - h - sep) / h + v_scroll->get_value();
- int from_mod = int(click.at.y - ofs.y - sep) % h;
- int to_mod = int(click.to.y - ofs.y - sep) % h;
+ float from_time = keys_from + (click.at.x - (name_limit + ofs.x)) / zoom_scale;
+ float to_time = keys_from + (click.to.x - (name_limit + ofs.x)) / zoom_scale;
- if (to_track < from_track) {
+ if (to_time < from_time)
+ SWAP(from_time, to_time);
- SWAP(from_track, to_track);
- SWAP(from_mod, to_mod);
- }
+ if (from_time > keys_to || to_time < keys_from)
+ break;
- if ((from_mod > (h / 2)) && ((click.at.y - ofs.y) >= (h + sep))) {
- from_track++;
- }
+ if (from_time < keys_from)
+ from_time = keys_from;
- if (to_mod < h / 2) {
- to_track--;
- }
+ if (to_time >= keys_to)
+ to_time = keys_to;
- if (from_track > to_track) {
- if (!click.shift)
- _clear_selection();
- _edit_if_single_selection();
- break;
- }
+ int from_track = int(click.at.y - ofs.y - h - sep) / h + v_scroll->get_value();
+ int to_track = int(click.to.y - ofs.y - h - sep) / h + v_scroll->get_value();
+ int from_mod = int(click.at.y - ofs.y - sep) % h;
+ int to_mod = int(click.to.y - ofs.y - sep) % h;
+
+ if (to_track < from_track) {
- int tracks_from = v_scroll->get_value();
- int tracks_to = v_scroll->get_value() + fit - 1;
- if (tracks_to >= animation->get_track_count())
- tracks_to = animation->get_track_count() - 1;
+ SWAP(from_track, to_track);
+ SWAP(from_mod, to_mod);
+ }
- tracks_from = 0;
+ if ((from_mod > (h / 2)) && ((click.at.y - ofs.y) >= (h + sep))) {
+ from_track++;
+ }
+
+ if (to_mod < h / 2) {
+ to_track--;
+ }
+
+ if (from_track > to_track) {
+ if (!click.shift)
+ _clear_selection();
+ _edit_if_single_selection();
+ break;
+ }
+
+ int tracks_from = v_scroll->get_value();
+ int tracks_to = v_scroll->get_value() + fit - 1;
+ if (tracks_to >= animation->get_track_count())
tracks_to = animation->get_track_count() - 1;
- if (to_track > tracks_to)
- to_track = tracks_to;
- if (from_track < tracks_from)
- from_track = tracks_from;
-
- if (from_track > tracks_to || to_track < tracks_from) {
- if (!click.shift)
- _clear_selection();
- _edit_if_single_selection();
- break;
- }
+ tracks_from = 0;
+ tracks_to = animation->get_track_count() - 1;
+ if (to_track > tracks_to)
+ to_track = tracks_to;
+ if (from_track < tracks_from)
+ from_track = tracks_from;
+
+ if (from_track > tracks_to || to_track < tracks_from) {
if (!click.shift)
_clear_selection();
+ _edit_if_single_selection();
+ break;
+ }
- int higher_track = 0x7FFFFFFF;
- for (int i = from_track; i <= to_track; i++) {
+ if (!click.shift)
+ _clear_selection();
- int kc = animation->track_get_key_count(i);
- for (int j = 0; j < kc; j++) {
+ int higher_track = 0x7FFFFFFF;
+ for (int i = from_track; i <= to_track; i++) {
- float t = animation->track_get_key_time(i, j);
- if (t < from_time)
- continue;
- if (t > to_time)
- break;
+ int kc = animation->track_get_key_count(i);
+ for (int j = 0; j < kc; j++) {
- if (i < higher_track)
- higher_track = i;
+ float t = animation->track_get_key_time(i, j);
+ if (t < from_time)
+ continue;
+ if (t > to_time)
+ break;
- SelectedKey sk;
- sk.track = i;
- sk.key = j;
- KeyInfo ki;
- ki.pos = t;
- selection[sk] = ki;
- }
- }
+ if (i < higher_track)
+ higher_track = i;
- if (higher_track != 0x7FFFFFFF) {
- selected_track = higher_track;
- track_editor->update();
+ SelectedKey sk;
+ sk.track = i;
+ sk.key = j;
+ KeyInfo ki;
+ ki.pos = t;
+ selection[sk] = ki;
}
+ }
- _edit_if_single_selection();
+ if (higher_track != 0x7FFFFFFF) {
+ selected_track = higher_track;
+ track_editor->update();
+ }
- } break;
- case ClickOver::CLICK_MOVE_KEYS: {
+ _edit_if_single_selection();
- if (selection.empty())
- break;
- if (click.at == click.to) {
+ } break;
+ case ClickOver::CLICK_MOVE_KEYS: {
- if (!click.shift) {
+ if (selection.empty())
+ break;
+ if (click.at == click.to) {
- KeyInfo ki = selection[click.selk];
- _clear_selection();
- selection[click.selk] = ki;
- _edit_if_single_selection();
- }
+ if (!click.shift) {
- break;
+ KeyInfo ki = selection[click.selk];
+ _clear_selection();
+ selection[click.selk] = ki;
+ _edit_if_single_selection();
}
- float from_t = 1e20;
+ break;
+ }
- for (Map<SelectedKey, KeyInfo>::Element *E = selection.front(); E; E = E->next()) {
- float t = animation->track_get_key_time(E->key().track, E->key().key);
- if (t < from_t)
- from_t = t;
- }
+ float from_t = 1e20;
- float motion = from_t + (click.to.x - click.at.x) / _get_zoom_scale();
- if (step->get_value())
- motion = Math::stepify(motion, step->get_value());
+ for (Map<SelectedKey, KeyInfo>::Element *E = selection.front(); E; E = E->next()) {
+ float t = animation->track_get_key_time(E->key().track, E->key().key);
+ if (t < from_t)
+ from_t = t;
+ }
- undo_redo->create_action(TTR("Anim Move Keys"));
+ float motion = from_t + (click.to.x - click.at.x) / _get_zoom_scale();
+ if (step->get_value())
+ motion = Math::stepify(motion, step->get_value());
- List<_AnimMoveRestore> to_restore;
+ undo_redo->create_action(TTR("Anim Move Keys"));
- // 1-remove the keys
- for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
+ List<_AnimMoveRestore> to_restore;
- undo_redo->add_do_method(animation.ptr(), "track_remove_key", E->key().track, E->key().key);
- }
- // 2- remove overlapped keys
- for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
+ // 1-remove the keys
+ for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
- float newtime = E->get().pos - from_t + motion;
- int idx = animation->track_find_key(E->key().track, newtime, true);
- if (idx == -1)
- continue;
- SelectedKey sk;
- sk.key = idx;
- sk.track = E->key().track;
- if (selection.has(sk))
- continue; //already in selection, don't save
+ undo_redo->add_do_method(animation.ptr(), "track_remove_key", E->key().track, E->key().key);
+ }
+ // 2- remove overlapped keys
+ for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
+
+ float newtime = E->get().pos - from_t + motion;
+ int idx = animation->track_find_key(E->key().track, newtime, true);
+ if (idx == -1)
+ continue;
+ SelectedKey sk;
+ sk.key = idx;
+ sk.track = E->key().track;
+ if (selection.has(sk))
+ continue; //already in selection, don't save
+
+ undo_redo->add_do_method(animation.ptr(), "track_remove_key_at_pos", E->key().track, newtime);
+ _AnimMoveRestore amr;
+
+ amr.key = animation->track_get_key_value(E->key().track, idx);
+ amr.track = E->key().track;
+ amr.time = newtime;
+ amr.transition = animation->track_get_key_transition(E->key().track, idx);
+
+ to_restore.push_back(amr);
+ }
- undo_redo->add_do_method(animation.ptr(), "track_remove_key_at_pos", E->key().track, newtime);
- _AnimMoveRestore amr;
+ // 3-move the keys (re insert them)
+ for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
- amr.key = animation->track_get_key_value(E->key().track, idx);
- amr.track = E->key().track;
- amr.time = newtime;
- amr.transition = animation->track_get_key_transition(E->key().track, idx);
+ float newpos = E->get().pos - from_t + motion;
+ /*
+ if (newpos<0)
+ continue; //no add at the beginning
+ */
+ undo_redo->add_do_method(animation.ptr(), "track_insert_key", E->key().track, newpos, animation->track_get_key_value(E->key().track, E->key().key), animation->track_get_key_transition(E->key().track, E->key().key));
+ }
- to_restore.push_back(amr);
- }
+ // 4-(undo) remove inserted keys
+ for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
- // 3-move the keys (re insert them)
- for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
+ float newpos = E->get().pos + -from_t + motion;
+ /*
+ if (newpos<0)
+ continue; //no remove what no inserted
+ */
+ undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_pos", E->key().track, newpos);
+ }
- float newpos = E->get().pos - from_t + motion;
- /*
- if (newpos<0)
- continue; //no add at the beginning
- */
- undo_redo->add_do_method(animation.ptr(), "track_insert_key", E->key().track, newpos, animation->track_get_key_value(E->key().track, E->key().key), animation->track_get_key_transition(E->key().track, E->key().key));
- }
+ // 5-(undo) reinsert keys
+ for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
- // 4-(undo) remove inserted keys
- for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
+ undo_redo->add_undo_method(animation.ptr(), "track_insert_key", E->key().track, E->get().pos, animation->track_get_key_value(E->key().track, E->key().key), animation->track_get_key_transition(E->key().track, E->key().key));
+ }
- float newpos = E->get().pos + -from_t + motion;
- /*
- if (newpos<0)
- continue; //no remove what no inserted
- */
- undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_pos", E->key().track, newpos);
- }
+ // 6-(undo) reinsert overlapped keys
+ for (List<_AnimMoveRestore>::Element *E = to_restore.front(); E; E = E->next()) {
- // 5-(undo) reinsert keys
- for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
+ _AnimMoveRestore &amr = E->get();
+ undo_redo->add_undo_method(animation.ptr(), "track_insert_key", amr.track, amr.time, amr.key, amr.transition);
+ }
- undo_redo->add_undo_method(animation.ptr(), "track_insert_key", E->key().track, E->get().pos, animation->track_get_key_value(E->key().track, E->key().key), animation->track_get_key_transition(E->key().track, E->key().key));
- }
+ // 6-(undo) reinsert overlapped keys
+ for (List<_AnimMoveRestore>::Element *E = to_restore.front(); E; E = E->next()) {
- // 6-(undo) reinsert overlapped keys
- for (List<_AnimMoveRestore>::Element *E = to_restore.front(); E; E = E->next()) {
+ _AnimMoveRestore &amr = E->get();
+ undo_redo->add_undo_method(animation.ptr(), "track_insert_key", amr.track, amr.time, amr.key, amr.transition);
+ }
- _AnimMoveRestore &amr = E->get();
- undo_redo->add_undo_method(animation.ptr(), "track_insert_key", amr.track, amr.time, amr.key, amr.transition);
- }
+ undo_redo->add_do_method(this, "_clear_selection_for_anim", animation);
+ undo_redo->add_undo_method(this, "_clear_selection_for_anim", animation);
- // 6-(undo) reinsert overlapped keys
- for (List<_AnimMoveRestore>::Element *E = to_restore.front(); E; E = E->next()) {
+ // 7-reselect
- _AnimMoveRestore &amr = E->get();
- undo_redo->add_undo_method(animation.ptr(), "track_insert_key", amr.track, amr.time, amr.key, amr.transition);
- }
+ for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
- undo_redo->add_do_method(this, "_clear_selection_for_anim", animation);
- undo_redo->add_undo_method(this, "_clear_selection_for_anim", animation);
+ float oldpos = E->get().pos;
+ float newpos = oldpos - from_t + motion;
+ //if (newpos>=0)
+ undo_redo->add_do_method(this, "_select_at_anim", animation, E->key().track, newpos);
+ undo_redo->add_undo_method(this, "_select_at_anim", animation, E->key().track, oldpos);
+ }
- // 7-reselect
+ undo_redo->commit_action();
+ _edit_if_single_selection();
- for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
+ } break;
+ default: {}
+ }
- float oldpos = E->get().pos;
- float newpos = oldpos - from_t + motion;
- //if (newpos>=0)
- undo_redo->add_do_method(this, "_select_at_anim", animation, E->key().track, newpos);
- undo_redo->add_undo_method(this, "_select_at_anim", animation, E->key().track, oldpos);
- }
+ //button released
+ click.click = ClickOver::CLICK_NONE;
+ track_editor->update();
+ }
+ }
+ }
- undo_redo->commit_action();
- _edit_if_single_selection();
+ Ref<InputEventMouseMotion> mm = p_input;
- } break;
- default: {}
- }
+ if (mm.is_valid()) {
- //button released
- click.click = ClickOver::CLICK_NONE;
- track_editor->update();
- }
- }
+ mouse_over.over = MouseOver::OVER_NONE;
+ mouse_over.track = -1;
+ te->update();
+ track_editor->set_tooltip("");
- } break;
+ if (!track_editor->has_focus() && (!get_focus_owner() || !get_focus_owner()->is_text_field()))
+ track_editor->call_deferred("grab_focus");
- case InputEvent::MOUSE_MOTION: {
+ if (click.click != ClickOver::CLICK_NONE) {
- const InputEventMouseMotion &mb = p_input.mouse_motion;
+ switch (click.click) {
+ case ClickOver::CLICK_RESIZE_NAMES: {
- mouse_over.over = MouseOver::OVER_NONE;
- mouse_over.track = -1;
- te->update();
- track_editor->set_tooltip("");
+ float base = click.at.y;
+ float clickp = click.at.x - ofs.x;
+ float dif = base - clickp;
- if (!track_editor->has_focus() && (!get_focus_owner() || !get_focus_owner()->is_text_field()))
- track_editor->call_deferred("grab_focus");
+ float target = mm->get_position().x + dif - ofs.x;
- if (click.click != ClickOver::CLICK_NONE) {
+ float ratio = target / settings_limit;
- switch (click.click) {
- case ClickOver::CLICK_RESIZE_NAMES: {
+ if (ratio > 0.9)
+ ratio = 0.9;
+ else if (ratio < 0.2)
+ ratio = 0.2;
- float base = click.at.y;
- float clickp = click.at.x - ofs.x;
- float dif = base - clickp;
+ name_column_ratio = ratio;
- float target = mb.x + dif - ofs.x;
+ } break;
+ case ClickOver::CLICK_DRAG_TIMELINE: {
- float ratio = target / settings_limit;
+ Point2 mpos = mm->get_position() - ofs;
+ /*
+ if (mpos.x<name_limit)
+ mpos.x=name_limit;
+ if (mpos.x>settings_limit)
+ mpos.x=settings_limit;
+ */
- if (ratio > 0.9)
- ratio = 0.9;
- else if (ratio < 0.2)
- ratio = 0.2;
+ //int zoomw = settings_limit-name_limit;
+ float scale = _get_zoom_scale();
+ float pos = h_scroll->get_value() + (mpos.x - name_limit) / scale;
+ if (animation->get_step()) {
+ pos = Math::stepify(pos, animation->get_step());
+ }
+ if (pos < 0)
+ pos = 0;
+ if (pos >= animation->get_length())
+ pos = animation->get_length();
+
+ if (pos < h_scroll->get_value()) {
+ h_scroll->set_value(pos);
+ } else if (pos > h_scroll->get_value() + (settings_limit - name_limit) / scale) {
+ h_scroll->set_value(pos - (settings_limit - name_limit) / scale);
+ }
- name_column_ratio = ratio;
+ timeline_pos = pos;
+ emit_signal("timeline_changed", pos, true);
- } break;
- case ClickOver::CLICK_DRAG_TIMELINE: {
-
- Point2 mpos = Point2(mb.x, mb.y) - ofs;
- /*
- if (mpos.x<name_limit)
- mpos.x=name_limit;
- if (mpos.x>settings_limit)
- mpos.x=settings_limit;
- */
+ } break;
+ case ClickOver::CLICK_SELECT_KEYS: {
- //int zoomw = settings_limit-name_limit;
- float scale = _get_zoom_scale();
- float pos = h_scroll->get_value() + (mpos.x - name_limit) / scale;
- if (animation->get_step()) {
- pos = Math::stepify(pos, animation->get_step());
- }
- if (pos < 0)
- pos = 0;
- if (pos >= animation->get_length())
- pos = animation->get_length();
+ click.to = mm->get_position();
+ if (click.to.y < h && click.at.y > h && mm->get_relative().y < 0) {
- if (pos < h_scroll->get_value()) {
- h_scroll->set_value(pos);
- } else if (pos > h_scroll->get_value() + (settings_limit - name_limit) / scale) {
- h_scroll->set_value(pos - (settings_limit - name_limit) / scale);
- }
+ float prev = v_scroll->get_value();
+ v_scroll->set_value(v_scroll->get_value() - 1);
+ if (prev != v_scroll->get_value())
+ click.at.y += h;
+ }
+ if (click.to.y > size.height && click.at.y < size.height && mm->get_relative().y > 0) {
- timeline_pos = pos;
- emit_signal("timeline_changed", pos, true);
+ float prev = v_scroll->get_value();
+ v_scroll->set_value(v_scroll->get_value() + 1);
+ if (prev != v_scroll->get_value())
+ click.at.y -= h;
+ }
- } break;
- case ClickOver::CLICK_SELECT_KEYS: {
+ } break;
+ case ClickOver::CLICK_MOVE_KEYS: {
- click.to = Point2(mb.x, mb.y);
- if (click.to.y < h && click.at.y > h && mb.relative_y < 0) {
+ click.to = mm->get_position();
+ } break;
+ default: {}
+ }
- float prev = v_scroll->get_value();
- v_scroll->set_value(v_scroll->get_value() - 1);
- if (prev != v_scroll->get_value())
- click.at.y += h;
- }
- if (click.to.y > size.height && click.at.y < size.height && mb.relative_y > 0) {
+ return;
+ } else if (mm->get_button_mask() & BUTTON_MASK_MIDDLE) {
- float prev = v_scroll->get_value();
- v_scroll->set_value(v_scroll->get_value() + 1);
- if (prev != v_scroll->get_value())
- click.at.y -= h;
- }
+ int rel = mm->get_relative().x;
+ float relf = rel / _get_zoom_scale();
+ h_scroll->set_value(h_scroll->get_value() - relf);
+ }
- } break;
- case ClickOver::CLICK_MOVE_KEYS: {
+ if (mm->get_button_mask() == 0) {
- click.to = Point2(mb.x, mb.y);
- } break;
- default: {}
- }
+ Point2 mpos = mm->get_position() - ofs;
+ if (mpos.y < h) {
+#if 0
+ //seek
+ //int zoomw = settings_limit-name_limit;
+ float scale = _get_zoom_scale();
+ float pos = h_scroll->get_val() + (mpos.y-name_limit) / scale;
+ if (pos<0 )
+ pos=0;
+ if (pos>=animation->get_length())
+ pos=animation->get_length();
+ timeline->set_val(pos);
+#endif
return;
- } else if (mb.button_mask & BUTTON_MASK_MIDDLE) {
-
- int rel = mb.relative_x;
- float relf = rel / _get_zoom_scale();
- h_scroll->set_value(h_scroll->get_value() - relf);
}
- if (mb.button_mask == 0) {
+ mpos.y -= h;
- Point2 mpos = Point2(mb.x, mb.y) - ofs;
+ int idx = mpos.y / h;
+ idx += v_scroll->get_value();
+ if (idx < 0 || idx >= animation->get_track_count())
+ return;
- if (mpos.y < h) {
-#if 0
- //seek
- //int zoomw = settings_limit-name_limit;
- float scale = _get_zoom_scale();
- float pos = h_scroll->get_val() + (mpos.y-name_limit) / scale;
- if (pos<0 )
- pos=0;
- if (pos>=animation->get_length())
- pos=animation->get_length();
- timeline->set_val(pos);
-#endif
- return;
- }
+ mouse_over.track = idx;
- mpos.y -= h;
+ if (mpos.x < name_limit) {
+ //name column
- int idx = mpos.y / h;
- idx += v_scroll->get_value();
- if (idx < 0 || idx >= animation->get_track_count())
- break;
+ mouse_over.over = MouseOver::OVER_NAME;
- mouse_over.track = idx;
+ } else if (mpos.x < settings_limit) {
- if (mpos.x < name_limit) {
- //name column
+ float pos = mpos.x - name_limit;
+ pos /= _get_zoom_scale();
+ pos += h_scroll->get_value();
+ float w_time = (type_icon[0]->get_width() / _get_zoom_scale()) / 2.0;
- mouse_over.over = MouseOver::OVER_NAME;
+ int kidx = animation->track_find_key(idx, pos);
+ int kidx_n = kidx + 1;
- } else if (mpos.x < settings_limit) {
+ bool found = false;
- float pos = mpos.x - name_limit;
- pos /= _get_zoom_scale();
- pos += h_scroll->get_value();
- float w_time = (type_icon[0]->get_width() / _get_zoom_scale()) / 2.0;
+ if (kidx >= 0 && kidx < animation->track_get_key_count(idx)) {
- int kidx = animation->track_find_key(idx, pos);
- int kidx_n = kidx + 1;
+ float kpos = animation->track_get_key_time(idx, kidx);
+ if (ABS(pos - kpos) <= w_time) {
- bool found = false;
+ mouse_over.over = MouseOver::OVER_KEY;
+ mouse_over.track = idx;
+ mouse_over.over_key = kidx;
+ found = true;
+ }
+ }
- if (kidx >= 0 && kidx < animation->track_get_key_count(idx)) {
+ if (!found && kidx_n >= 0 && kidx_n < animation->track_get_key_count(idx)) {
- float kpos = animation->track_get_key_time(idx, kidx);
- if (ABS(pos - kpos) <= w_time) {
+ float kpos = animation->track_get_key_time(idx, kidx_n);
+ if (ABS(pos - kpos) <= w_time) {
- mouse_over.over = MouseOver::OVER_KEY;
- mouse_over.track = idx;
- mouse_over.over_key = kidx;
- found = true;
- }
+ mouse_over.over = MouseOver::OVER_KEY;
+ mouse_over.track = idx;
+ mouse_over.over_key = kidx_n;
+ found = true;
}
+ }
- if (!found && kidx_n >= 0 && kidx_n < animation->track_get_key_count(idx)) {
+ if (found) {
- float kpos = animation->track_get_key_time(idx, kidx_n);
- if (ABS(pos - kpos) <= w_time) {
+ String text;
+ text = "time: " + rtos(animation->track_get_key_time(idx, mouse_over.over_key)) + "\n";
- mouse_over.over = MouseOver::OVER_KEY;
- mouse_over.track = idx;
- mouse_over.over_key = kidx_n;
- found = true;
- }
- }
+ switch (animation->track_get_type(idx)) {
- if (found) {
-
- String text;
- text = "time: " + rtos(animation->track_get_key_time(idx, mouse_over.over_key)) + "\n";
-
- switch (animation->track_get_type(idx)) {
-
- case Animation::TYPE_TRANSFORM: {
-
- Dictionary d = animation->track_get_key_value(idx, mouse_over.over_key);
- if (d.has("loc"))
- text += "loc: " + String(d["loc"]) + "\n";
- if (d.has("rot"))
- text += "rot: " + String(d["rot"]) + "\n";
- if (d.has("scale"))
- text += "scale: " + String(d["scale"]) + "\n";
- } break;
- case Animation::TYPE_VALUE: {
-
- Variant v = animation->track_get_key_value(idx, mouse_over.over_key);
- //text+="value: "+String(v)+"\n";
-
- bool prop_exists = false;
- Variant::Type valid_type = Variant::NIL;
- Object *obj = NULL;
-
- RES res;
- Node *node = root->get_node_and_resource(animation->track_get_path(idx), res);
-
- if (res.is_valid()) {
- obj = res.ptr();
- } else if (node) {
- obj = node;
- }
-
- if (obj) {
- valid_type = obj->get_static_property_type(animation->track_get_path(idx).get_property(), &prop_exists);
- }
-
- text += "type: " + Variant::get_type_name(v.get_type()) + "\n";
- if (prop_exists && !Variant::can_convert(v.get_type(), valid_type)) {
- text += "value: " + String(v) + " (Invalid, expected type: " + Variant::get_type_name(valid_type) + ")\n";
- } else {
- text += "value: " + String(v) + "\n";
- }
-
- } break;
- case Animation::TYPE_METHOD: {
-
- Dictionary d = animation->track_get_key_value(idx, mouse_over.over_key);
- if (d.has("method"))
- text += String(d["method"]);
- text += "(";
- Vector<Variant> args;
- if (d.has("args"))
- args = d["args"];
- for (int i = 0; i < args.size(); i++) {
-
- if (i > 0)
- text += ", ";
- text += String(args[i]);
- }
- text += ")\n";
-
- } break;
- }
- text += "easing: " + rtos(animation->track_get_key_transition(idx, mouse_over.over_key));
+ case Animation::TYPE_TRANSFORM: {
- track_editor->set_tooltip(text);
- return;
- }
+ Dictionary d = animation->track_get_key_value(idx, mouse_over.over_key);
+ if (d.has("loc"))
+ text += "loc: " + String(d["loc"]) + "\n";
+ if (d.has("rot"))
+ text += "rot: " + String(d["rot"]) + "\n";
+ if (d.has("scale"))
+ text += "scale: " + String(d["scale"]) + "\n";
+ } break;
+ case Animation::TYPE_VALUE: {
- } else {
- //button column
- int ofsx = size.width - mpos.x;
- if (ofsx < 0)
- break;
- /*
- if (ofsx < remove_icon->get_width()) {
+ Variant v = animation->track_get_key_value(idx, mouse_over.over_key);
+ //text+="value: "+String(v)+"\n";
- mouse_over.over=MouseOver::OVER_REMOVE;
+ bool prop_exists = false;
+ Variant::Type valid_type = Variant::NIL;
+ Object *obj = NULL;
- return;
- }
+ RES res;
+ Node *node = root->get_node_and_resource(animation->track_get_path(idx), res);
- ofsx-=hsep+remove_icon->get_width();
+ if (res.is_valid()) {
+ obj = res.ptr();
+ } else if (node) {
+ obj = node;
+ }
- if (ofsx < move_down_icon->get_width()) {
+ if (obj) {
+ valid_type = obj->get_static_property_type(animation->track_get_path(idx).get_property(), &prop_exists);
+ }
- mouse_over.over=MouseOver::OVER_DOWN;
- return;
+ text += "type: " + Variant::get_type_name(v.get_type()) + "\n";
+ if (prop_exists && !Variant::can_convert(v.get_type(), valid_type)) {
+ text += "value: " + String(v) + " (Invalid, expected type: " + Variant::get_type_name(valid_type) + ")\n";
+ } else {
+ text += "value: " + String(v) + "\n";
+ }
+
+ } break;
+ case Animation::TYPE_METHOD: {
+
+ Dictionary d = animation->track_get_key_value(idx, mouse_over.over_key);
+ if (d.has("method"))
+ text += String(d["method"]);
+ text += "(";
+ Vector<Variant> args;
+ if (d.has("args"))
+ args = d["args"];
+ for (int i = 0; i < args.size(); i++) {
+
+ if (i > 0)
+ text += ", ";
+ text += String(args[i]);
+ }
+ text += ")\n";
+
+ } break;
}
+ text += "easing: " + rtos(animation->track_get_key_transition(idx, mouse_over.over_key));
- ofsx-=hsep+move_down_icon->get_width();
+ track_editor->set_tooltip(text);
+ return;
+ }
- if (ofsx < move_up_icon->get_width()) {
+ } else {
+ //button column
+ int ofsx = size.width - mpos.x;
+ if (ofsx < 0)
+ return;
+ /*
+ if (ofsx < remove_icon->get_width()) {
- mouse_over.over=MouseOver::OVER_UP;
- return;
- }
+ mouse_over.over=MouseOver::OVER_REMOVE;
- ofsx-=hsep*3+move_up_icon->get_width();
+ return;
+ }
- */
+ ofsx-=hsep+remove_icon->get_width();
- if (ofsx < down_icon->get_width() + wrap_icon[0]->get_width() + hsep * 3) {
+ if (ofsx < move_down_icon->get_width()) {
- mouse_over.over = MouseOver::OVER_WRAP;
- return;
- }
+ mouse_over.over=MouseOver::OVER_DOWN;
+ return;
+ }
- ofsx -= hsep * 3 + wrap_icon[0]->get_width() + down_icon->get_width();
+ ofsx-=hsep+move_down_icon->get_width();
- if (ofsx < down_icon->get_width() + interp_icon[0]->get_width() + hsep * 3) {
+ if (ofsx < move_up_icon->get_width()) {
- mouse_over.over = MouseOver::OVER_INTERP;
- return;
- }
+ mouse_over.over=MouseOver::OVER_UP;
+ return;
+ }
- ofsx -= hsep * 2 + interp_icon[0]->get_width() + down_icon->get_width();
+ ofsx-=hsep*3+move_up_icon->get_width();
- if (ofsx < down_icon->get_width() + cont_icon[0]->get_width() + hsep * 3) {
+*/
- mouse_over.over = MouseOver::OVER_VALUE;
- return;
- }
+ if (ofsx < down_icon->get_width() + wrap_icon[0]->get_width() + hsep * 3) {
- ofsx -= hsep * 3 + cont_icon[0]->get_width() + down_icon->get_width();
+ mouse_over.over = MouseOver::OVER_WRAP;
+ return;
+ }
- if (ofsx < add_key_icon->get_width()) {
+ ofsx -= hsep * 3 + wrap_icon[0]->get_width() + down_icon->get_width();
- mouse_over.over = MouseOver::OVER_ADD_KEY;
- return;
- }
+ if (ofsx < down_icon->get_width() + interp_icon[0]->get_width() + hsep * 3) {
+
+ mouse_over.over = MouseOver::OVER_INTERP;
+ return;
}
- }
- } break;
+ ofsx -= hsep * 2 + interp_icon[0]->get_width() + down_icon->get_width();
+
+ if (ofsx < down_icon->get_width() + cont_icon[0]->get_width() + hsep * 3) {
+
+ mouse_over.over = MouseOver::OVER_VALUE;
+ return;
+ }
+
+ ofsx -= hsep * 3 + cont_icon[0]->get_width() + down_icon->get_width();
+
+ if (ofsx < add_key_icon->get_width()) {
+
+ mouse_over.over = MouseOver::OVER_ADD_KEY;
+ return;
+ }
+ }
+ }
}
}
@@ -2890,6 +2901,8 @@ void AnimationKeyEditor::_notification(int p_what) {
key_editor->edit(key_edit);
zoomicon->set_texture(get_icon("Zoom", "EditorIcons"));
+ zoomicon->set_custom_minimum_size(Size2(24 * EDSCALE, 0));
+ zoomicon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
menu_add_track->set_icon(get_icon("AddTrack", "EditorIcons"));
menu_add_track->get_popup()->add_icon_item(get_icon("KeyValue", "EditorIcons"), "Add Normal Track", ADD_TRACK_MENU_ADD_VALUE_TRACK);
@@ -3733,7 +3746,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
history = EditorNode::get_singleton()->get_editor_history();
ec = memnew(Control);
- ec->set_custom_minimum_size(Size2(0, 150));
+ ec->set_custom_minimum_size(Size2(0, 150) * EDSCALE);
add_child(ec);
ec->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -3748,7 +3761,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
root = NULL;
//menu = memnew( MenuButton );
//menu->set_flat(true);
- //menu->set_pos(Point2());
+ //menu->set_position(Point2());
//add_child(menu);
zoomicon = memnew(TextureRect);
@@ -3762,6 +3775,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
zoom->set_max(2.0);
zoom->set_value(1.0);
zoom->set_h_size_flags(SIZE_EXPAND_FILL);
+ zoom->set_v_size_flags(SIZE_EXPAND_FILL);
zoom->set_stretch_ratio(2);
hb->add_child(zoom);
zoom->connect("value_changed", this, "_scroll_changed");
@@ -3890,7 +3904,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
/* l = memnew( Label );
l->set_text("Base: ");
- l->set_pos(Point2(0,3));
+ l->set_position(Point2(0,3));
//dr_panel->add_child(l);*/
//menu->get_popup()->connect("id_pressed",this,"_menu_callback");
@@ -3927,6 +3941,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
v_scroll->set_value(0);
key_editor_tab = memnew(TabContainer);
+ key_editor_tab->set_tab_align(TabContainer::ALIGN_LEFT);
hb->add_child(key_editor_tab);
key_editor_tab->set_custom_minimum_size(Size2(200, 0));
diff --git a/editor/animation_editor.h b/editor/animation_editor.h
index a775ad160b..9eacafb021 100644
--- a/editor/animation_editor.h
+++ b/editor/animation_editor.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -44,7 +45,6 @@
#include "scene/animation/animation_cache.h"
#include "scene/resources/animation.h"
#include "scene_tree_editor.h"
-#include "scene_tree_editor.h"
class AnimationKeyEdit;
class AnimationCurveEdit;
@@ -272,13 +272,13 @@ class AnimationKeyEditor : public VBoxContainer {
float _get_zoom_scale() const;
void _track_editor_draw();
- void _track_editor_gui_input(const InputEvent &p_input);
+ void _track_editor_gui_input(const Ref<InputEvent> &p_input);
void _track_pos_draw();
void _track_name_changed(const String &p_name);
void _track_menu_selected(int p_idx);
void _confirm_insert_list();
- int _confirm_insert(InsertData p_id, int p_at_track = -1);
+ int _confirm_insert(InsertData p_id, int p_last_track = -1);
void _query_insert(const InsertData &p_id);
void _update_menu();
bool insert_queue;
diff --git a/editor/array_property_edit.cpp b/editor/array_property_edit.cpp
index 62415f4993..06d7d5fdc8 100644
--- a/editor/array_property_edit.cpp
+++ b/editor/array_property_edit.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -250,7 +251,7 @@ void ArrayPropertyEdit::edit(Object *p_obj, const StringName &p_prop, const Stri
page = 0;
property = p_prop;
- obj = p_obj->get_instance_ID();
+ obj = p_obj->get_instance_id();
default_type = p_deftype;
if (!p_hint_string.empty()) {
diff --git a/editor/array_property_edit.h b/editor/array_property_edit.h
index 1461aa52a3..1bc82e22a1 100644
--- a/editor/array_property_edit.h
+++ b/editor/array_property_edit.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/asset_library_editor_plugin.cpp b/editor/asset_library_editor_plugin.cpp
index 7bfe52d1b4..0a2799c51f 100644
--- a/editor/asset_library_editor_plugin.cpp
+++ b/editor/asset_library_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -97,10 +98,10 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() {
Ref<StyleBoxEmpty> border;
border.instance();
- /*border->set_default_margin(MARGIN_LEFT,5);
- border->set_default_margin(MARGIN_RIGHT,5);
- border->set_default_margin(MARGIN_BOTTOM,5);
- border->set_default_margin(MARGIN_TOP,5);*/
+ border->set_default_margin(MARGIN_LEFT, 5);
+ border->set_default_margin(MARGIN_RIGHT, 5);
+ border->set_default_margin(MARGIN_BOTTOM, 5);
+ border->set_default_margin(MARGIN_TOP, 5);
add_style_override("panel", border);
HBoxContainer *hb = memnew(HBoxContainer);
@@ -143,7 +144,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() {
rating_hb->add_child(stars[i]);
}
price = memnew(Label);
- price->set_text("Free");
+ price->set_text(TTR("Free"));
vb->add_child(price);
set_custom_minimum_size(Size2(250, 100));
@@ -188,7 +189,14 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const
} break;
}
}
-
+void EditorAssetLibraryItemDescription::_notification(int p_what) {
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE: {
+ previews_bg->add_style_override("panel", get_stylebox("normal", "TextEdit"));
+ desc_bg->add_style_override("panel", get_stylebox("normal", "TextEdit"));
+ } break;
+ }
+}
void EditorAssetLibraryItemDescription::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_image"), &EditorAssetLibraryItemDescription::set_image);
ClassDB::bind_method(D_METHOD("_link_click"), &EditorAssetLibraryItemDescription::_link_click);
@@ -225,12 +233,12 @@ void EditorAssetLibraryItemDescription::configure(const String &p_title, int p_a
sha256 = p_sha256_hash;
item->configure(p_title, p_asset_id, p_category, p_category_id, p_author, p_author_id, p_rating, p_cost);
description->clear();
- description->add_text("Version: " + p_version_string + "\n");
- description->add_text("Contents: ");
+ description->add_text(TTR("Version:") + " " + p_version_string + "\n");
+ description->add_text(TTR("Contents:") + " ");
description->push_meta(p_browse_url);
- description->add_text("View Files");
+ description->add_text(TTR("View Files"));
description->pop();
- description->add_text("\nDescription:\n\n");
+ description->add_text("\n" + TTR("Description:") + "\n\n");
description->append_bbcode(p_description);
set_title(p_title);
}
@@ -273,24 +281,21 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() {
desc_vbox->add_child(item);
desc_vbox->set_custom_minimum_size(Size2(300, 0));
- PanelContainer *desc_bg = memnew(PanelContainer);
+ desc_bg = memnew(PanelContainer);
desc_vbox->add_child(desc_bg);
desc_bg->set_v_size_flags(SIZE_EXPAND_FILL);
description = memnew(RichTextLabel);
description->connect("meta_clicked", this, "_link_click");
- //desc_vbox->add_child(description);
desc_bg->add_child(description);
- desc_bg->add_style_override("panel", get_stylebox("normal", "TextEdit"));
preview = memnew(TextureRect);
preview->set_custom_minimum_size(Size2(640, 345));
hbox->add_child(preview);
- PanelContainer *previews_bg = memnew(PanelContainer);
+ previews_bg = memnew(PanelContainer);
vbox->add_child(previews_bg);
previews_bg->set_custom_minimum_size(Size2(0, 85));
- previews_bg->add_style_override("panel", get_stylebox("normal", "TextEdit"));
previews = memnew(ScrollContainer);
previews_bg->add_child(previews);
@@ -300,8 +305,8 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() {
preview_hb->set_v_size_flags(SIZE_EXPAND_FILL);
previews->add_child(preview_hb);
- get_ok()->set_text("Install");
- get_cancel()->set_text("Close");
+ get_ok()->set_text(TTR("Install"));
+ get_cancel()->set_text(TTR("Close"));
}
///////////////////////////////////////////////////////////////////////////////////
@@ -313,48 +318,49 @@ void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int
switch (p_status) {
case HTTPRequest::RESULT_CANT_RESOLVE: {
- error_text = ("Can't resolve hostname: " + host);
- status->set_text("Can't resolve.");
+ error_text = TTR("Can't resolve hostname:") + " " + host;
+ status->set_text(TTR("Can't resolve."));
} break;
case HTTPRequest::RESULT_BODY_SIZE_LIMIT_EXCEEDED:
case HTTPRequest::RESULT_CONNECTION_ERROR:
case HTTPRequest::RESULT_CHUNKED_BODY_SIZE_MISMATCH: {
- error_text = ("Connection error, please try again.");
- status->set_text("Can't connect.");
+ error_text = TTR("Connection error, please try again.");
+ status->set_text(TTR("Can't connect."));
} break;
case HTTPRequest::RESULT_SSL_HANDSHAKE_ERROR:
case HTTPRequest::RESULT_CANT_CONNECT: {
- error_text = ("Can't connect to host: " + host);
- status->set_text("Can't connect.");
+ error_text = TTR("Can't connect to host:") + " " + host;
+ status->set_text(TTR("Can't connect."));
} break;
case HTTPRequest::RESULT_NO_RESPONSE: {
- error_text = ("No response from host: " + host);
- status->set_text("No response.");
+ error_text = TTR("No response from host:") + " " + host;
+ status->set_text(TTR("No response."));
} break;
case HTTPRequest::RESULT_REQUEST_FAILED: {
- error_text = ("Request failed, return code: " + itos(p_code));
- status->set_text("Req. Failed.");
+ error_text = TTR("Request failed, return code:") + " " + itos(p_code);
+ status->set_text(TTR("Req. Failed."));
} break;
case HTTPRequest::RESULT_REDIRECT_LIMIT_REACHED: {
- error_text = ("Request failed, too many redirects");
- status->set_text("Redirect Loop.");
+ error_text = TTR("Request failed, too many redirects");
+ status->set_text(TTR("Redirect Loop."));
} break;
default: {
if (p_code != 200) {
- error_text = ("Request failed, return code: " + itos(p_code));
- status->set_text("Failed: " + itos(p_code));
+ error_text = TTR("Request failed, return code:") + " " + itos(p_code);
+ status->set_text(TTR("Failed:") + " " + itos(p_code));
} else if (sha256 != "") {
String download_sha256 = FileAccess::get_sha256(download->get_download_file());
if (sha256 != download_sha256) {
- error_text = "Bad download hash, assuming file has been tampered with.\nExpected: " + sha256 + "\nGot: " + download_sha256;
- status->set_text("Failed sha256 hash check");
+ error_text = TTR("Bad download hash, assuming file has been tampered with.") + "\n";
+ error_text += TTR("Expected:") + " " + sha256 + "\n" + TTR("Got:") + " " + download_sha256;
+ status->set_text(TTR("Failed sha256 hash check"));
}
}
} break;
}
if (error_text != String()) {
- download_error->set_text("Asset Download Error:\n" + error_text);
+ download_error->set_text(TTR("Asset Download Error:") + "\n" + error_text);
download_error->popup_centered_minsize();
return;
}
@@ -367,7 +373,7 @@ void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int
progress->set_value(download->get_downloaded_bytes());
- status->set_text("Success! (" + String::humanize_size(download->get_downloaded_bytes()) + ")");
+ status->set_text(TTR("Success!") + " (" + String::humanize_size(download->get_downloaded_bytes()) + ")");
set_process(false);
}
@@ -395,19 +401,19 @@ void EditorAssetLibraryItemDownload::_notification(int p_what) {
int cstatus = download->get_http_client_status();
if (cstatus == HTTPClient::STATUS_BODY)
- status->set_text("Fetching: " + String::humanize_size(download->get_downloaded_bytes()));
+ status->set_text(TTR("Fetching:") + " " + String::humanize_size(download->get_downloaded_bytes()));
if (cstatus != prev_status) {
switch (cstatus) {
case HTTPClient::STATUS_RESOLVING: {
- status->set_text("Resolving..");
+ status->set_text(TTR("Resolving.."));
} break;
case HTTPClient::STATUS_CONNECTING: {
- status->set_text("Connecting..");
+ status->set_text(TTR("Connecting.."));
} break;
case HTTPClient::STATUS_REQUESTING: {
- status->set_text("Requesting..");
+ status->set_text(TTR("Requesting.."));
} break;
default: {}
}
@@ -441,7 +447,7 @@ void EditorAssetLibraryItemDownload::_make_request() {
Error err = download->request(host);
if (err != OK) {
- status->set_text("Error making request");
+ status->set_text(TTR("Error making request"));
} else {
set_process(true);
}
@@ -482,7 +488,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
vb->add_spacer();
- status = memnew(Label("Idle"));
+ status = memnew(Label(TTR("Idle")));
vb->add_child(status);
status->add_color_override("font_color", Color(0.5, 0.5, 0.5));
progress = memnew(ProgressBar);
@@ -493,12 +499,12 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
hb2->add_spacer();
install = memnew(Button);
- install->set_text("Install");
+ install->set_text(TTR("Install"));
install->set_disabled(true);
install->connect("pressed", this, "_install");
retry = memnew(Button);
- retry->set_text("Retry");
+ retry->set_text(TTR("Retry"));
retry->connect("pressed", this, "_make_request");
hb2->add_child(retry);
@@ -511,7 +517,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
download_error = memnew(AcceptDialog);
add_child(download_error);
- download_error->set_title("Download Error");
+ download_error->set_title(TTR("Download Error"));
asset_installer = memnew(EditorAssetInstaller);
add_child(asset_installer);
@@ -524,53 +530,62 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
////////////////////////////////////////////////////////////////////////////////
void EditorAssetLibrary::_notification(int p_what) {
- if (p_what == NOTIFICATION_READY) {
- TextureRect *tf = memnew(TextureRect);
- tf->set_texture(get_icon("Error", "EditorIcons"));
- reverse->set_icon(get_icon("Updown", "EditorIcons"));
+ switch (p_what) {
+ case NOTIFICATION_READY: {
- error_hb->add_child(tf);
- error_label->raise();
- }
+ TextureRect *tf = memnew(TextureRect);
+ tf->set_texture(get_icon("Error", "EditorIcons"));
+ reverse->set_icon(get_icon("Updown", "EditorIcons"));
- if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
- if (is_visible()) {
- _repository_changed(0); // Update when shown for the first time
- }
- }
+ error_hb->add_child(tf);
+ error_label->raise();
+ } break;
- if (p_what == NOTIFICATION_PROCESS) {
+ case NOTIFICATION_VISIBILITY_CHANGED: {
- HTTPClient::Status s = request->get_http_client_status();
- bool visible = s != HTTPClient::STATUS_DISCONNECTED;
+ if (is_visible()) {
+ _repository_changed(0); // Update when shown for the first time
+ }
+ } break;
- if (visible != load_status->is_visible()) {
- load_status->set_visible(visible);
- }
+ case NOTIFICATION_PROCESS: {
- if (visible) {
- switch (s) {
+ HTTPClient::Status s = request->get_http_client_status();
+ bool visible = s != HTTPClient::STATUS_DISCONNECTED;
- case HTTPClient::STATUS_RESOLVING: {
- load_status->set_value(0.1);
- } break;
- case HTTPClient::STATUS_CONNECTING: {
- load_status->set_value(0.2);
- } break;
- case HTTPClient::STATUS_REQUESTING: {
- load_status->set_value(0.3);
- } break;
- case HTTPClient::STATUS_BODY: {
- load_status->set_value(0.4);
- } break;
- default: {}
+ if (visible != load_status->is_visible()) {
+ load_status->set_visible(visible);
}
- }
- bool no_downloads = downloads_hb->get_child_count() == 0;
- if (no_downloads == downloads_scroll->is_visible()) {
- downloads_scroll->set_visible(!no_downloads);
- }
+ if (visible) {
+ switch (s) {
+
+ case HTTPClient::STATUS_RESOLVING: {
+ load_status->set_value(0.1);
+ } break;
+ case HTTPClient::STATUS_CONNECTING: {
+ load_status->set_value(0.2);
+ } break;
+ case HTTPClient::STATUS_REQUESTING: {
+ load_status->set_value(0.3);
+ } break;
+ case HTTPClient::STATUS_BODY: {
+ load_status->set_value(0.4);
+ } break;
+ default: {}
+ }
+ }
+
+ bool no_downloads = downloads_hb->get_child_count() == 0;
+ if (no_downloads == downloads_scroll->is_visible()) {
+ downloads_scroll->set_visible(!no_downloads);
+ }
+
+ } break;
+ case NOTIFICATION_THEME_CHANGED: {
+
+ library_scroll_bg->add_style_override("panel", get_stylebox("bg", "Tree"));
+ } break;
}
}
@@ -584,7 +599,7 @@ void EditorAssetLibrary::_install_asset() {
if (d && d->get_asset_id() == description->get_asset_id()) {
if (EditorNode::get_singleton() != NULL)
- EditorNode::get_singleton()->show_warning("Download for this asset is already in progress!");
+ EditorNode::get_singleton()->show_warning(TTR("Download for this asset is already in progress!"));
return;
}
}
@@ -682,17 +697,18 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt
int len = image_data.size();
PoolByteArray::Read r = image_data.read();
- Image image(r.ptr(), len);
- if (!image.empty()) {
+ Ref<Image> image = Ref<Image>(memnew(Image(r.ptr(), len)));
+
+ if (!image->empty()) {
float max_height = 10000;
switch (image_queue[p_queue_id].image_type) {
case IMAGE_QUEUE_ICON: max_height = 80; break;
case IMAGE_QUEUE_THUMBNAIL: max_height = 80; break;
case IMAGE_QUEUE_SCREENSHOT: max_height = 345; break;
}
- float scale_ratio = max_height / image.get_height();
+ float scale_ratio = max_height / image->get_height();
if (scale_ratio < 1) {
- image.resize(image.get_width() * scale_ratio, image.get_height() * scale_ratio, Image::INTERPOLATE_CUBIC);
+ image->resize(image->get_width() * scale_ratio, image->get_height() * scale_ratio, Image::INTERPOLATE_CUBIC);
}
Ref<ImageTexture> tex;
@@ -901,7 +917,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int
if (p_page != 0) {
LinkButton *first = memnew(LinkButton);
- first->set_text("first");
+ first->set_text(TTR("first"));
first->add_color_override("font_color", gray);
first->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER);
first->connect("pressed", this, "_search", varray(0));
@@ -910,7 +926,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int
if (p_page > 0) {
LinkButton *prev = memnew(LinkButton);
- prev->set_text("prev");
+ prev->set_text(TTR("prev"));
prev->add_color_override("font_color", gray);
prev->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER);
prev->connect("pressed", this, "_search", varray(p_page - 1));
@@ -938,7 +954,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int
if (p_page < p_page_count - 1) {
LinkButton *next = memnew(LinkButton);
- next->set_text("next");
+ next->set_text(TTR("next"));
next->add_color_override("font_color", gray);
next->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER);
next->connect("pressed", this, "_search", varray(p_page + 1));
@@ -948,7 +964,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int
if (p_page != p_page_count - 1) {
LinkButton *last = memnew(LinkButton);
- last->set_text("last");
+ last->set_text(TTR("last"));
last->add_color_override("font_color", gray);
last->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER);
hbc->add_child(last);
@@ -991,30 +1007,30 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const
switch (p_status) {
case HTTPRequest::RESULT_CANT_RESOLVE: {
- error_label->set_text("Can't resolve hostname: " + host);
+ error_label->set_text(TTR("Can't resolve hostname:") + " " + host);
} break;
case HTTPRequest::RESULT_BODY_SIZE_LIMIT_EXCEEDED:
case HTTPRequest::RESULT_CONNECTION_ERROR:
case HTTPRequest::RESULT_CHUNKED_BODY_SIZE_MISMATCH: {
- error_label->set_text("Connection error, please try again.");
+ error_label->set_text(TTR("Connection error, please try again."));
} break;
case HTTPRequest::RESULT_SSL_HANDSHAKE_ERROR:
case HTTPRequest::RESULT_CANT_CONNECT: {
- error_label->set_text("Can't connect to host: " + host);
+ error_label->set_text(TTR("Can't connect to host:") + " " + host);
} break;
case HTTPRequest::RESULT_NO_RESPONSE: {
- error_label->set_text("No response from host: " + host);
+ error_label->set_text(TTR("No response from host:") + " " + host);
} break;
case HTTPRequest::RESULT_REQUEST_FAILED: {
- error_label->set_text("Request failed, return code: " + itos(p_code));
+ error_label->set_text(TTR("Request failed, return code:") + " " + itos(p_code));
} break;
case HTTPRequest::RESULT_REDIRECT_LIMIT_REACHED: {
- error_label->set_text("Request failed, too many redirects");
+ error_label->set_text(TTR("Request failed, too many redirects"));
} break;
default: {
if (p_code != 200) {
- error_label->set_text("Request failed, return code: " + itos(p_code));
+ error_label->set_text(TTR("Request failed, return code:") + " " + itos(p_code));
} else {
error_abort = false;
@@ -1047,7 +1063,7 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const
case REQUESTING_CONFIG: {
categories->clear();
- categories->add_item("All");
+ categories->add_item(TTR("All"));
categories->set_item_metadata(0, 0);
if (d.has("categories")) {
Array clist = d["categories"];
@@ -1134,7 +1150,7 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const
item->connect("category_selected", this, "_select_category");
if (r.has("icon_url") && r["icon_url"] != "") {
- _request_image(item->get_instance_ID(), r["icon_url"], IMAGE_QUEUE_ICON, 0);
+ _request_image(item->get_instance_id(), r["icon_url"], IMAGE_QUEUE_ICON, 0);
}
}
} break;
@@ -1171,7 +1187,7 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const
item->connect("category_selected",this,"_category_selected");*/
if (r.has("icon_url") && r["icon_url"] != "") {
- _request_image(description->get_instance_ID(), r["icon_url"], IMAGE_QUEUE_ICON, 0);
+ _request_image(description->get_instance_id(), r["icon_url"], IMAGE_QUEUE_ICON, 0);
}
if (d.has("previews")) {
@@ -1193,12 +1209,12 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const
description->add_preview(i, is_video, video_url);
if (p.has("thumbnail")) {
- _request_image(description->get_instance_ID(), p["thumbnail"], IMAGE_QUEUE_THUMBNAIL, i);
+ _request_image(description->get_instance_id(), p["thumbnail"], IMAGE_QUEUE_THUMBNAIL, i);
}
if (is_video) {
- //_request_image(description->get_instance_ID(),p["link"],IMAGE_QUEUE_SCREENSHOT,i);
+ //_request_image(description->get_instance_id(),p["link"],IMAGE_QUEUE_SCREENSHOT,i);
} else {
- _request_image(description->get_instance_ID(), p["link"], IMAGE_QUEUE_SCREENSHOT, i);
+ _request_image(description->get_instance_id(), p["link"], IMAGE_QUEUE_SCREENSHOT, i);
}
}
}
@@ -1226,8 +1242,8 @@ void EditorAssetLibrary::_asset_open() {
void EditorAssetLibrary::_manage_plugins() {
- ProjectSettings::get_singleton()->popup_project_settings();
- ProjectSettings::get_singleton()->set_plugins_page();
+ ProjectSettingsEditor::get_singleton()->popup_project_settings();
+ ProjectSettingsEditor::get_singleton()->set_plugins_page();
}
void EditorAssetLibrary::_install_external_asset(String p_zip_path, String p_title) {
@@ -1259,15 +1275,6 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
templates_only = p_templates_only;
- Ref<StyleBoxEmpty> border;
- border.instance();
- border->set_default_margin(MARGIN_LEFT, 15);
- border->set_default_margin(MARGIN_RIGHT, 15);
- border->set_default_margin(MARGIN_BOTTOM, 5);
- border->set_default_margin(MARGIN_TOP, 5);
-
- add_style_override("panel", border);
-
VBoxContainer *library_main = memnew(VBoxContainer);
add_child(library_main);
@@ -1282,7 +1289,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
search_hb->add_child(filter);
filter->set_h_size_flags(SIZE_EXPAND_FILL);
filter->connect("text_entered", this, "_search");
- search = memnew(Button("Search"));
+ search = memnew(Button(TTR("Search")));
search->connect("pressed", this, "_search");
search_hb->add_child(search);
@@ -1290,12 +1297,12 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
search_hb->add_child(memnew(VSeparator));
Button *open_asset = memnew(Button);
- open_asset->set_text("Import");
+ open_asset->set_text(TTR("Import"));
search_hb->add_child(open_asset);
open_asset->connect("pressed", this, "_asset_open");
Button *plugins = memnew(Button);
- plugins->set_text("Plugins");
+ plugins->set_text(TTR("Plugins"));
search_hb->add_child(plugins);
plugins->connect("pressed", this, "_manage_plugins");
@@ -1341,10 +1348,13 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
search_hb2->add_child(memnew(Label(TTR("Site:") + " ")));
repository = memnew(OptionButton);
- repository->add_item("Godot");
+ // FIXME: Reenable me once GH-7147 is fixed.
+ /*
+ repository->add_item("godotengine.org");
repository->set_item_metadata(0, "https://godotengine.org/asset-library/api");
- repository->add_item("Localhost"); // TODO: Maybe remove?
- repository->set_item_metadata(1, "http://127.0.0.1/asset-library/api");
+ */
+ repository->add_item("localhost");
+ repository->set_item_metadata(/*1*/ 0, "http://127.0.0.1/asset-library/api");
repository->connect("item_selected", this, "_repository_changed");
search_hb2->add_child(repository);
@@ -1364,9 +1374,8 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
/////////
- PanelContainer *library_scroll_bg = memnew(PanelContainer);
+ library_scroll_bg = memnew(PanelContainer);
library_main->add_child(library_scroll_bg);
- library_scroll_bg->add_style_override("panel", get_stylebox("normal", "TextEdit"));
library_scroll_bg->set_v_size_flags(SIZE_EXPAND_FILL);
library_scroll = memnew(ScrollContainer);
diff --git a/editor/asset_library_editor_plugin.h b/editor/asset_library_editor_plugin.h
index bdfd52cf4f..fa768ec96a 100644
--- a/editor/asset_library_editor_plugin.h
+++ b/editor/asset_library_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -88,6 +89,8 @@ class EditorAssetLibraryItemDescription : public ConfirmationDialog {
RichTextLabel *description;
ScrollContainer *previews;
HBoxContainer *preview_hb;
+ PanelContainer *previews_bg;
+ PanelContainer *desc_bg;
struct Preview {
int id;
@@ -109,9 +112,10 @@ class EditorAssetLibraryItemDescription : public ConfirmationDialog {
Ref<Texture> icon;
void _link_click(const String &p_url);
- void _preview_click(int p_index);
+ void _preview_click(int p_id);
protected:
+ void _notification(int p_what);
static void _bind_methods();
public:
@@ -178,6 +182,7 @@ class EditorAssetLibrary : public PanelContainer {
void _asset_open();
void _asset_file_selected(const String &p_file);
+ PanelContainer *library_scroll_bg;
ScrollContainer *library_scroll;
VBoxContainer *library_vb;
LineEdit *filter;
diff --git a/editor/call_dialog.cpp b/editor/call_dialog.cpp
index 7a8290c58d..32b9fc1254 100644
--- a/editor/call_dialog.cpp
+++ b/editor/call_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -252,8 +253,8 @@ CallDialog::CallDialog() {
call->set_anchor( MARGIN_TOP, ANCHOR_END );
call->set_anchor( MARGIN_RIGHT, ANCHOR_END );
call->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
- call->set_begin( Point2( 70, 29 ) );
- call->set_end( Point2( 15, 15 ) );
+ call->set_begin( Point2( -70, -29 ) );
+ call->set_end( Point2( -15, -15 ) );
call->set_text(TTR("Call"));
add_child(call);
@@ -261,8 +262,8 @@ CallDialog::CallDialog() {
cancel = memnew( Button );
cancel->set_anchor( MARGIN_TOP, ANCHOR_END );
cancel->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
- cancel->set_begin( Point2( 15, 29 ) );
- cancel->set_end( Point2( 70, 15 ) );
+ cancel->set_begin( Point2( -15, 29 ) );
+ cancel->set_end( Point2( 70, -15 ) );
cancel->set_text(TTR("Close"));
add_child(cancel);
@@ -271,7 +272,7 @@ CallDialog::CallDialog() {
tree->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
tree->set_begin( Point2( 20,50 ) );
- tree->set_margin(MARGIN_BOTTOM, 44 );
+ tree->set_margin(MARGIN_BOTTOM, -44 );
tree->set_margin(MARGIN_RIGHT, 0.5 );
tree->set_select_mode( Tree::SELECT_ROW );
add_child(tree);
@@ -281,16 +282,16 @@ CallDialog::CallDialog() {
property_editor = memnew( PropertyEditor );
- property_editor->set_anchor_and_margin( MARGIN_RIGHT, ANCHOR_END, 15 );
+ property_editor->set_anchor_and_margin( MARGIN_RIGHT, ANCHOR_END, -15 );
property_editor->set_anchor_and_margin( MARGIN_TOP, ANCHOR_BEGIN, 50 );
//property_editor->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 );
- property_editor->set_anchor_and_margin( MARGIN_BOTTOM, ANCHOR_END, 90 );
+ property_editor->set_anchor_and_margin( MARGIN_BOTTOM, ANCHOR_END, -90 );
property_editor->get_scene_tree()->set_hide_root( true );
property_editor->hide_top_label();
add_child(property_editor);
- method_label = memnew( Label );
- method_label->set_pos( Point2( 15,25) );
+ method_label = memnew(Label);
+ method_label->set_position(Point2( 15,25));
method_label->set_text(TTR("Method List:"));
add_child(method_label);
@@ -304,15 +305,15 @@ CallDialog::CallDialog() {
return_label = memnew( Label );
//return_label->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.53 );
- return_label->set_anchor_and_margin( MARGIN_TOP, ANCHOR_END, 85 );
+ return_label->set_anchor_and_margin( MARGIN_TOP, ANCHOR_END, -85 );
return_label->set_text(TTR("Return:"));
add_child(return_label);
return_value = memnew( LineEdit );
//return_value->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 );
- return_value->set_anchor_and_margin( MARGIN_RIGHT, ANCHOR_END, 15 );
- return_value->set_anchor_and_margin( MARGIN_TOP, ANCHOR_END, 65 );
+ return_value->set_anchor_and_margin( MARGIN_RIGHT, ANCHOR_END, -15 );
+ return_value->set_anchor_and_margin( MARGIN_TOP, ANCHOR_END, -65 );
add_child(return_value);
diff --git a/editor/call_dialog.h b/editor/call_dialog.h
index f3dbe6458b..ab833c8dd3 100644
--- a/editor/call_dialog.h
+++ b/editor/call_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index c4f836f3e4..07c0945114 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -63,13 +64,13 @@ GotoLineDialog::GotoLineDialog() {
set_title(TTR("Go to Line"));
Label *l = memnew(Label);
l->set_text(TTR("Line Number:"));
- l->set_pos(Point2(5, 5));
+ l->set_position(Point2(5, 5));
add_child(l);
line = memnew(LineEdit);
line->set_anchor(MARGIN_RIGHT, ANCHOR_END);
line->set_begin(Point2(15, 22));
- line->set_end(Point2(15, 35));
+ line->set_end(Point2(-15, 35));
add_child(line);
register_text_enter(line);
text_editor = NULL;
@@ -93,17 +94,16 @@ void FindReplaceBar::_notification(int p_what) {
}
}
-void FindReplaceBar::_unhandled_input(const InputEvent &p_event) {
+void FindReplaceBar::_unhandled_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::KEY) {
+ Ref<InputEventKey> k = p_event;
+ if (k.is_valid()) {
- const InputEventKey &k = p_event.key;
-
- if (k.pressed && (text_edit->has_focus() || text_vbc->is_a_parent_of(get_focus_owner()))) {
+ if (k->is_pressed() && (text_edit->has_focus() || text_vbc->is_a_parent_of(get_focus_owner()))) {
bool accepted = true;
- switch (k.scancode) {
+ switch (k->get_scancode()) {
case KEY_ESCAPE: {
@@ -887,7 +887,7 @@ FindReplaceDialog::FindReplaceDialog() {
replace_text = memnew(LineEdit);
replace_text->set_anchor(MARGIN_RIGHT, ANCHOR_END);
replace_text->set_begin(Point2(15, 132));
- replace_text->set_end(Point2(15, 135));
+ replace_text->set_end(Point2(-15, 135));
//replace_text->set_self_opacity(0.7);
replace_mc->add_child(replace_text);
@@ -937,8 +937,8 @@ FindReplaceDialog::FindReplaceDialog() {
skip->set_anchor(MARGIN_TOP, ANCHOR_END);
skip->set_anchor(MARGIN_RIGHT, ANCHOR_END);
skip->set_anchor(MARGIN_BOTTOM, ANCHOR_END);
- skip->set_begin(Point2(70, button_margin));
- skip->set_end(Point2(10, margin));
+ skip->set_begin(Point2(-70, -button_margin));
+ skip->set_end(Point2(-10, -margin));
skip->set_text(TTR("Skip"));
add_child(skip);
skip->connect("pressed", this, "_skip_pressed");
@@ -956,23 +956,27 @@ FindReplaceDialog::FindReplaceDialog() {
/*** CODE EDITOR ****/
-void CodeTextEditor::_text_editor_gui_input(const InputEvent &p_event) {
+void CodeTextEditor::_text_editor_gui_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::MOUSE_BUTTON) {
+ Ref<InputEventMouseButton> mb = p_event;
- const InputEventMouseButton &mb = p_event.mouse_button;
+ if (mb.is_valid()) {
- if (mb.pressed && mb.mod.command) {
+ if (mb->is_pressed() && mb->get_command()) {
- if (mb.button_index == BUTTON_WHEEL_UP) {
+ if (mb->get_button_index() == BUTTON_WHEEL_UP) {
_zoom_in();
- } else if (mb.button_index == BUTTON_WHEEL_DOWN) {
+ } else if (mb->get_button_index() == BUTTON_WHEEL_DOWN) {
_zoom_out();
}
}
- } else if (p_event.type == InputEvent::KEY) {
+ }
+
+ Ref<InputEventKey> k = p_event;
+
+ if (k.is_valid()) {
- if (p_event.key.pressed) {
+ if (k->is_pressed()) {
if (ED_IS_SHORTCUT("script_editor/zoom_in", p_event)) {
_zoom_in();
}
@@ -1070,7 +1074,8 @@ void CodeTextEditor::update_editor_settings() {
text_editor->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/completion/auto_brace_complete"));
text_editor->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/cursor/scroll_past_end_of_file"));
- text_editor->set_tab_size(EditorSettings::get_singleton()->get("text_editor/indent/tab_size"));
+ text_editor->set_indent_using_spaces(EditorSettings::get_singleton()->get("text_editor/indent/type"));
+ text_editor->set_indent_size(EditorSettings::get_singleton()->get("text_editor/indent/size"));
text_editor->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/indent/draw_tabs"));
text_editor->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_line_numbers"));
text_editor->set_line_numbers_zero_padded(EditorSettings::get_singleton()->get("text_editor/line_numbers/line_numbers_zero_padded"));
diff --git a/editor/code_editor.h b/editor/code_editor.h
index 8fa52b03f7..8d48c56503 100644
--- a/editor/code_editor.h
+++ b/editor/code_editor.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -99,7 +100,7 @@ class FindReplaceBar : public HBoxContainer {
protected:
void _notification(int p_what);
- void _unhandled_input(const InputEvent &p_event);
+ void _unhandled_input(const Ref<InputEvent> &p_event);
bool _search(uint32_t p_flags, int p_from_line, int p_from_col);
@@ -212,7 +213,7 @@ class CodeTextEditor : public VBoxContainer {
void _complete_request();
void _font_resize_timeout();
- void _text_editor_gui_input(const InputEvent &p_event);
+ void _text_editor_gui_input(const Ref<InputEvent> &p_event);
void _zoom_in();
void _zoom_out();
void _reset_zoom();
diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp
index 4705810eca..169c34782d 100644
--- a/editor/collada/collada.cpp
+++ b/editor/collada/collada.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -305,7 +306,7 @@ void Collada::_parse_image(XMLParser &parser) {
String path = parser.get_attribute_value("source").strip_edges();
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
- image.path = GlobalConfig::get_singleton()->localize_path(state.local_path.get_base_dir() + "/" + path.percent_decode());
+ image.path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir() + "/" + path.percent_decode());
}
} else {
@@ -322,11 +323,11 @@ void Collada::_parse_image(XMLParser &parser) {
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
- path = GlobalConfig::get_singleton()->localize_path(state.local_path.get_base_dir() + "/" + path);
+ path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir() + "/" + path);
} else if (path.find("file:///") == 0) {
path = path.replace_first("file:///", "");
- path = GlobalConfig::get_singleton()->localize_path(path);
+ path = ProjectSettings::get_singleton()->localize_path(path);
}
image.path = path;
@@ -2219,6 +2220,7 @@ void Collada::_merge_skeletons(VisualScene *p_vscene, Node *p_node) {
ERR_CONTINUE(!state.scene_map.has(nodeid)); //weird, it should have it...
NodeJoint *nj = SAFE_CAST<NodeJoint *>(state.scene_map[nodeid]);
+ ERR_CONTINUE(!nj); //broken collada
if (!nj->owner) {
print_line("no owner for: " + String(nodeid));
}
@@ -2555,7 +2557,7 @@ Error Collada::load(const String &p_path, int p_flags) {
Error err = parser.open(p_path);
ERR_FAIL_COND_V(err, err);
- state.local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ state.local_path = ProjectSettings::get_singleton()->localize_path(p_path);
state.import_flags = p_flags;
/* Skip headers */
err = OK;
diff --git a/editor/collada/collada.h b/editor/collada/collada.h
index 23b3aef670..f94f9ed197 100644
--- a/editor/collada/collada.h
+++ b/editor/collada/collada.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,9 +32,9 @@
#ifndef COLLADA_H
#define COLLADA_H
-#include "global_config.h"
#include "io/xml_parser.h"
#include "map.h"
+#include "project_settings.h"
#include "scene/resources/material.h"
class Collada {
@@ -612,7 +613,7 @@ private: // private stuff
void _parse_curve_geometry(XMLParser &parser, String p_id, String p_name);
void _parse_skin_controller(XMLParser &parser, String p_id);
- void _parse_morph_controller(XMLParser &parser, String id);
+ void _parse_morph_controller(XMLParser &parser, String p_id);
void _parse_controller(XMLParser &parser);
Node *_parse_visual_instance_geometry(XMLParser &parser);
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index 49990c4340..47c2cb5536 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -219,7 +220,7 @@ void ConnectDialog::_add_bind() {
if (cdbinds->params.size() >= VARIANT_ARG_MAX)
return;
- Variant::Type vt = (Variant::Type)type_list->get_item_ID(type_list->get_selected());
+ Variant::Type vt = (Variant::Type)type_list->get_item_id(type_list->get_selected());
Variant value;
@@ -238,7 +239,6 @@ void ConnectDialog::_add_bind() {
case Variant::BASIS: value = Basis(); break;
case Variant::TRANSFORM: value = Transform(); break;
case Variant::COLOR: value = Color(); break;
- case Variant::IMAGE: value = Image(); break;
default: { ERR_FAIL(); } break;
}
@@ -326,7 +326,6 @@ ConnectDialog::ConnectDialog() {
type_list->add_item("Transform", Variant::TRANSFORM);
//type_list->add_separator();
type_list->add_item("Color", Variant::COLOR);
- type_list->add_item("Image", Variant::IMAGE);
type_list->select(0);
Button *add_bind = memnew(Button);
@@ -418,6 +417,10 @@ void ConnectionsDock::_notification(int p_what) {
//RID ci = get_canvas_item();
//get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
}
+
+ if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+ update_tree();
+ }
}
void ConnectionsDock::_close() {
@@ -766,7 +769,7 @@ void ConnectionsDock::_something_activated() {
Ref<Script> script = c.target->get_script();
- if (script.is_valid() && ScriptEditor::get_singleton()->script_go_to_method(script, c.method)) {
+ if (script.is_valid() && ScriptEditor::get_singleton()->script_goto_method(script, c.method)) {
editor->call("_editor_select", EditorNode::EDITOR_SCRIPT);
}
}
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h
index 240e3655ed..bff85941cb 100644
--- a/editor/connections_dialog.h
+++ b/editor/connections_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 0e2ec92fde..1089068344 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -108,14 +109,15 @@ void CreateDialog::_text_changed(const String &p_newtext) {
_update_search();
}
-void CreateDialog::_sbox_input(const InputEvent &p_ie) {
+void CreateDialog::_sbox_input(const Ref<InputEvent> &p_ie) {
- if (p_ie.type == InputEvent::KEY && (p_ie.key.scancode == KEY_UP ||
- p_ie.key.scancode == KEY_DOWN ||
- p_ie.key.scancode == KEY_PAGEUP ||
- p_ie.key.scancode == KEY_PAGEDOWN)) {
+ Ref<InputEventKey> k = p_ie;
+ if (k.is_valid() && (k->get_scancode() == KEY_UP ||
+ k->get_scancode() == KEY_DOWN ||
+ k->get_scancode() == KEY_PAGEUP ||
+ k->get_scancode() == KEY_PAGEDOWN)) {
- search_options->call("_gui_input", p_ie);
+ search_options->call("_gui_input", k);
search_box->accept_event();
}
}
@@ -201,7 +203,7 @@ void CreateDialog::_update_search() {
}
List<StringName>::Element *I = type_list.front();
- TreeItem *to_select = NULL;
+ TreeItem *to_select = search_box->get_text() == base_type ? root : NULL;
for (; I; I = I->next()) {
@@ -487,11 +489,13 @@ void CreateDialog::_favorite_selected() {
void CreateDialog::_history_activated() {
+ _history_selected();
_confirmed();
}
void CreateDialog::_favorite_activated() {
+ _favorite_selected();
_confirmed();
}
diff --git a/editor/create_dialog.h b/editor/create_dialog.h
index 5f0b16bc34..02ce762726 100644
--- a/editor/create_dialog.h
+++ b/editor/create_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -68,7 +69,7 @@ class CreateDialog : public ConfirmationDialog {
void _history_activated();
void _favorite_activated();
- void _sbox_input(const InputEvent &p_ie);
+ void _sbox_input(const Ref<InputEvent> &p_ie);
void _confirmed();
void _text_changed(const String &p_newtext);
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 64c3cc1c00..3533c0993f 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/dependency_editor.h b/editor/dependency_editor.h
index bd0e1f8b07..5fdd2b72a8 100644
--- a/editor/dependency_editor.h
+++ b/editor/dependency_editor.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -105,7 +106,7 @@ class DependencyErrorDialog : public ConfirmationDialog {
void custom_action(const String &);
public:
- void show(const String &p_for, const Vector<String> &report);
+ void show(const String &p_for_file, const Vector<String> &report);
DependencyErrorDialog();
};
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp
index c6a51cce3d..69d7475f4c 100644
--- a/editor/doc/doc_data.cpp
+++ b/editor/doc/doc_data.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,10 +29,10 @@
/*************************************************************************/
#include "doc_data.h"
-#include "global_config.h"
#include "global_constants.h"
#include "io/compression.h"
#include "io/marshalls.h"
+#include "project_settings.h"
#include "scene/resources/theme.h"
#include "script_language.h"
#include "version.h"
@@ -294,8 +295,8 @@ void DocData::generate(bool p_basic_types) {
case Variant::REAL:
//keep it
break;
- case Variant::STRING: // 15
- case Variant::NODE_PATH: // 15
+ case Variant::STRING:
+ case Variant::NODE_PATH:
default_arg_text = "\"" + default_arg_text + "\"";
break;
case Variant::TRANSFORM:
@@ -306,19 +307,19 @@ void DocData::generate(bool p_basic_types) {
default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")";
break;
- case Variant::RECT3: //sorry naming convention fail :( not like it's used often // 10
+ case Variant::RECT3:
case Variant::COLOR:
case Variant::PLANE:
case Variant::POOL_BYTE_ARRAY:
case Variant::POOL_INT_ARRAY:
case Variant::POOL_REAL_ARRAY:
- case Variant::POOL_STRING_ARRAY: //25
+ case Variant::POOL_STRING_ARRAY:
case Variant::POOL_VECTOR2_ARRAY:
case Variant::POOL_VECTOR3_ARRAY:
case Variant::POOL_COLOR_ARRAY:
default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")";
break;
- case Variant::VECTOR2: // 5
+ case Variant::VECTOR2:
case Variant::RECT2:
case Variant::VECTOR3:
case Variant::QUAT:
@@ -330,15 +331,10 @@ void DocData::generate(bool p_basic_types) {
default_arg_text = "NULL";
break;
}
- case Variant::INPUT_EVENT:
case Variant::DICTIONARY: // 20
case Variant::ARRAY:
case Variant::_RID:
- case Variant::IMAGE:
- //case Variant::RESOURCE:
- default_arg_text = Variant::get_type_name(default_arg.get_type()) + "()";
- break;
default: {}
}
@@ -480,97 +476,78 @@ void DocData::generate(bool p_basic_types) {
if (i == Variant::OBJECT)
continue; //use the core type instead
- int loops = 1;
-
- if (i == Variant::INPUT_EVENT)
- loops = InputEvent::TYPE_MAX;
-
- for (int j = 0; j < loops; j++) {
-
- String cname = Variant::get_type_name(Variant::Type(i));
-
- if (i == Variant::INPUT_EVENT) {
- static const char *ie_type[InputEvent::TYPE_MAX] = {
- "", "Key", "MouseMotion", "MouseButton", "JoypadMotion", "JoypadButton", "ScreenTouch", "ScreenDrag", "Action"
- };
- cname += ie_type[j];
- }
-
- class_list[cname] = ClassDoc();
- ClassDoc &c = class_list[cname];
- c.name = cname;
- c.category = "Built-In Types";
+ String cname = Variant::get_type_name(Variant::Type(i));
- Variant::CallError cerror;
- Variant v = Variant::construct(Variant::Type(i), NULL, 0, cerror);
-
- if (i == Variant::INPUT_EVENT) {
- v.set("type", j);
- }
+ class_list[cname] = ClassDoc();
+ ClassDoc &c = class_list[cname];
+ c.name = cname;
+ c.category = "Built-In Types";
- List<MethodInfo> method_list;
- v.get_method_list(&method_list);
- method_list.sort();
- Variant::get_constructor_list(Variant::Type(i), &method_list);
+ Variant::CallError cerror;
+ Variant v = Variant::construct(Variant::Type(i), NULL, 0, cerror);
- for (List<MethodInfo>::Element *E = method_list.front(); E; E = E->next()) {
+ List<MethodInfo> method_list;
+ v.get_method_list(&method_list);
+ method_list.sort();
+ Variant::get_constructor_list(Variant::Type(i), &method_list);
- MethodInfo &mi = E->get();
- MethodDoc method;
+ for (List<MethodInfo>::Element *E = method_list.front(); E; E = E->next()) {
- method.name = mi.name;
+ MethodInfo &mi = E->get();
+ MethodDoc method;
- for (int i = 0; i < mi.arguments.size(); i++) {
+ method.name = mi.name;
- ArgumentDoc arg;
- PropertyInfo pi = mi.arguments[i];
+ for (int i = 0; i < mi.arguments.size(); i++) {
- arg.name = pi.name;
- //print_line("arg name: "+arg.name);
- if (pi.type == Variant::NIL)
- arg.type = "var";
- else
- arg.type = Variant::get_type_name(pi.type);
- int defarg = mi.default_arguments.size() - mi.arguments.size() + i;
- if (defarg >= 0)
- arg.default_value = mi.default_arguments[defarg];
+ ArgumentDoc arg;
+ PropertyInfo pi = mi.arguments[i];
- method.arguments.push_back(arg);
- }
+ arg.name = pi.name;
+ //print_line("arg name: "+arg.name);
+ if (pi.type == Variant::NIL)
+ arg.type = "var";
+ else
+ arg.type = Variant::get_type_name(pi.type);
+ int defarg = mi.default_arguments.size() - mi.arguments.size() + i;
+ if (defarg >= 0)
+ arg.default_value = mi.default_arguments[defarg];
- if (mi.return_val.type == Variant::NIL) {
- if (mi.return_val.name != "")
- method.return_type = "var";
+ method.arguments.push_back(arg);
+ }
- } else {
- method.return_type = Variant::get_type_name(mi.return_val.type);
- }
+ if (mi.return_val.type == Variant::NIL) {
+ if (mi.return_val.name != "")
+ method.return_type = "var";
- c.methods.push_back(method);
+ } else {
+ method.return_type = Variant::get_type_name(mi.return_val.type);
}
- List<PropertyInfo> properties;
- v.get_property_list(&properties);
- for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
+ c.methods.push_back(method);
+ }
- PropertyInfo pi = E->get();
- PropertyDoc property;
- property.name = pi.name;
- property.type = Variant::get_type_name(pi.type);
+ List<PropertyInfo> properties;
+ v.get_property_list(&properties);
+ for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
- c.properties.push_back(property);
- }
+ PropertyInfo pi = E->get();
+ PropertyDoc property;
+ property.name = pi.name;
+ property.type = Variant::get_type_name(pi.type);
+
+ c.properties.push_back(property);
+ }
- List<StringName> constants;
- Variant::get_numeric_constants_for_type(Variant::Type(i), &constants);
+ List<StringName> constants;
+ Variant::get_numeric_constants_for_type(Variant::Type(i), &constants);
- for (List<StringName>::Element *E = constants.front(); E; E = E->next()) {
+ for (List<StringName>::Element *E = constants.front(); E; E = E->next()) {
- ConstantDoc constant;
- constant.name = E->get();
- constant.value = itos(Variant::get_numeric_constant_value(Variant::Type(i), E->get()));
- c.constants.push_back(constant);
- }
+ ConstantDoc constant;
+ constant.name = E->get();
+ constant.value = itos(Variant::get_numeric_constant_value(Variant::Type(i), E->get()));
+ c.constants.push_back(constant);
}
}
@@ -591,14 +568,14 @@ void DocData::generate(bool p_basic_types) {
c.constants.push_back(cd);
}
- List<GlobalConfig::Singleton> singletons;
- GlobalConfig::get_singleton()->get_singletons(&singletons);
+ List<ProjectSettings::Singleton> singletons;
+ ProjectSettings::get_singleton()->get_singletons(&singletons);
//servers (this is kind of hackish)
- for (List<GlobalConfig::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
+ for (List<ProjectSettings::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
PropertyDoc pd;
- GlobalConfig::Singleton &s = E->get();
+ ProjectSettings::Singleton &s = E->get();
pd.name = s.name;
pd.type = s.ptr->get_class();
while (String(ClassDB::get_parent_class(pd.type)) != "Object")
diff --git a/editor/doc/doc_data.h b/editor/doc/doc_data.h
index b4bd63e6ee..41dfae428a 100644
--- a/editor/doc/doc_data.h
+++ b/editor/doc/doc_data.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/doc/doc_dump.cpp b/editor/doc/doc_dump.cpp
index 38b61d706d..79a8f79a7c 100644
--- a/editor/doc/doc_dump.cpp
+++ b/editor/doc/doc_dump.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -164,8 +165,8 @@ void DocDump::dump(const String &p_file) {
case Variant::REAL:
//keep it
break;
- case Variant::STRING: // 15
- case Variant::NODE_PATH: // 15
+ case Variant::STRING:
+ case Variant::NODE_PATH:
default_arg_text = "\"" + default_arg_text + "\"";
break;
case Variant::TRANSFORM:
@@ -176,32 +177,27 @@ void DocDump::dump(const String &p_file) {
default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")";
break;
- case Variant::VECTOR2: // 5
+ case Variant::VECTOR2:
case Variant::RECT2:
case Variant::VECTOR3:
case Variant::PLANE:
case Variant::QUAT:
- case Variant::RECT3: //sorry naming convention fail :( not like it's used often // 10
+ case Variant::RECT3:
case Variant::BASIS:
case Variant::COLOR:
case Variant::POOL_BYTE_ARRAY:
case Variant::POOL_INT_ARRAY:
case Variant::POOL_REAL_ARRAY:
- case Variant::POOL_STRING_ARRAY: //25
+ case Variant::POOL_STRING_ARRAY:
case Variant::POOL_VECTOR3_ARRAY:
case Variant::POOL_COLOR_ARRAY:
default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")";
break;
case Variant::OBJECT:
- case Variant::INPUT_EVENT:
case Variant::DICTIONARY: // 20
case Variant::ARRAY:
case Variant::_RID:
- case Variant::IMAGE:
- //case Variant::RESOURCE:
- default_arg_text = Variant::get_type_name(default_arg.get_type()) + "()";
- break;
default: {}
}
diff --git a/editor/doc/doc_dump.h b/editor/doc/doc_dump.h
index 6d6782788f..300ce916ee 100644
--- a/editor/doc/doc_dump.h
+++ b/editor/doc/doc_dump.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/doc_code_font.h b/editor/doc_code_font.h
index e3874214f5..8fbfa7b1d6 100644
--- a/editor/doc_code_font.h
+++ b/editor/doc_code_font.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/doc_font.h b/editor/doc_font.h
index c146f04cd8..a3d41bb8ef 100644
--- a/editor/doc_font.h
+++ b/editor/doc_font.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/doc_title_font.h b/editor/doc_title_font.h
index bb8a394807..14da323aa7 100644
--- a/editor/doc_title_font.h
+++ b/editor/doc_title_font.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp
new file mode 100644
index 0000000000..fd90c766fd
--- /dev/null
+++ b/editor/editor_about.cpp
@@ -0,0 +1,209 @@
+/*************************************************************************/
+/* editor_about.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_about.h"
+
+#include "authors.gen.h"
+#include "license.gen.h"
+#include "version.h"
+#include "version_hash.gen.h"
+
+void EditorAbout::_license_tree_selected() {
+
+ TreeItem *selected = _tpl_tree->get_selected();
+ _tpl_text->select(0, 0, 0, 0);
+ _tpl_text->set_text(selected->get_metadata(0));
+}
+
+void EditorAbout::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("_license_tree_selected"), &EditorAbout::_license_tree_selected);
+}
+
+TextureRect *EditorAbout::get_logo() const {
+
+ return _logo;
+}
+
+EditorAbout::EditorAbout() {
+
+ set_title(TTR("Thanks from the Godot community!"));
+ get_ok()->set_text(TTR("Thanks!"));
+ set_hide_on_ok(true);
+ set_resizable(true);
+
+ VBoxContainer *vbc = memnew(VBoxContainer);
+ HBoxContainer *hbc = memnew(HBoxContainer);
+ hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ hbc->set_alignment(BoxContainer::ALIGN_CENTER);
+ hbc->add_constant_override("separation", 30 * EDSCALE);
+ add_child(vbc);
+ vbc->add_child(hbc);
+
+ _logo = memnew(TextureRect);
+ hbc->add_child(_logo);
+
+ String hash = String(VERSION_HASH);
+ if (hash.length() != 0)
+ hash = "." + hash.left(7);
+
+ Label *about_text = memnew(Label);
+ about_text->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
+ about_text->set_text(VERSION_FULL_NAME + hash + String::utf8("\n\u00A9 2007-2017 Juan Linietsky, Ariel Manzur.\n\u00A9 2014-2017 ") +
+ TTR("Godot Engine contributors") + "\n");
+ hbc->add_child(about_text);
+
+ TabContainer *tc = memnew(TabContainer);
+ tc->set_custom_minimum_size(Size2(630, 240) * EDSCALE);
+ tc->set_v_size_flags(Control::SIZE_EXPAND_FILL);
+ vbc->add_child(tc);
+
+ ScrollContainer *dev_base = memnew(ScrollContainer);
+ dev_base->set_name(TTR("Authors"));
+ dev_base->set_v_size_flags(Control::SIZE_EXPAND);
+ tc->add_child(dev_base);
+
+ VBoxContainer *dev_vbc = memnew(VBoxContainer);
+ dev_vbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ dev_base->add_child(dev_vbc);
+
+ List<String> dev_sections;
+ dev_sections.push_back(TTR("Project Founders"));
+ dev_sections.push_back(TTR("Lead Developer"));
+ dev_sections.push_back(TTR("Project Manager"));
+ dev_sections.push_back(TTR("Developers"));
+
+ const char **dev_src[] = { dev_founders, dev_lead, dev_manager, dev_names };
+
+ for (int i = 0; i < dev_sections.size(); i++) {
+
+ Label *lbl = memnew(Label);
+ lbl->set_text(dev_sections[i]);
+ dev_vbc->add_child(lbl);
+
+ ItemList *il = memnew(ItemList);
+ il->set_max_columns(16);
+ il->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ il->set_fixed_column_width(230 * EDSCALE);
+ il->set_auto_height(true);
+ const char **dev_names_ptr = dev_src[i];
+ while (*dev_names_ptr)
+ il->add_item(String::utf8(*dev_names_ptr++), NULL, false);
+ dev_vbc->add_child(il);
+
+ HSeparator *hs = memnew(HSeparator);
+ hs->set_modulate(Color(0, 0, 0, 0));
+ dev_vbc->add_child(hs);
+ }
+
+ TextEdit *license = memnew(TextEdit);
+ license->set_name(TTR("License"));
+ license->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ license->set_v_size_flags(Control::SIZE_EXPAND_FILL);
+ license->set_wrap(true);
+ license->set_readonly(true);
+ license->set_text(String::utf8(about_license));
+ tc->add_child(license);
+
+ VBoxContainer *license_thirdparty = memnew(VBoxContainer);
+ license_thirdparty->set_name(TTR("Thirdparty License"));
+ license_thirdparty->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ tc->add_child(license_thirdparty);
+
+ Label *tpl_label = memnew(Label);
+ tpl_label->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ tpl_label->set_autowrap(true);
+ tpl_label->set_text(TTR("Godot Engine relies on a number of thirdparty free and open source libraries, all compatible with the terms of its MIT license. The following is an exhaustive list of all such thirdparty components with their respective copyright statements and license terms."));
+ license_thirdparty->add_child(tpl_label);
+
+ HSplitContainer *tpl_hbc = memnew(HSplitContainer);
+ tpl_hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ tpl_hbc->set_v_size_flags(Control::SIZE_EXPAND_FILL);
+ tpl_hbc->set_split_offset(240 * EDSCALE);
+ license_thirdparty->add_child(tpl_hbc);
+
+ _tpl_tree = memnew(Tree);
+ _tpl_tree->set_hide_root(true);
+ TreeItem *root = _tpl_tree->create_item();
+ TreeItem *tpl_ti_all = _tpl_tree->create_item(root);
+ tpl_ti_all->set_text(0, TTR("All Components"));
+ TreeItem *tpl_ti_tp = _tpl_tree->create_item(root);
+ tpl_ti_tp->set_text(0, TTR("Components"));
+ tpl_ti_tp->set_selectable(0, false);
+ TreeItem *tpl_ti_lc = _tpl_tree->create_item(root);
+ tpl_ti_lc->set_text(0, TTR("Licenses"));
+ tpl_ti_lc->set_selectable(0, false);
+ int read_idx = 0;
+ String long_text = "";
+ for (int i = 0; i < THIRDPARTY_COUNT; i++) {
+
+ TreeItem *ti = _tpl_tree->create_item(tpl_ti_tp);
+ String thirdparty = String(about_thirdparty[i]);
+ ti->set_text(0, thirdparty);
+ String text = thirdparty + "\n";
+ long_text += "- " + thirdparty + "\n\n";
+ for (int j = 0; j < about_tp_copyright_count[i]; j++) {
+
+ text += "\n Files:\n " + String(about_tp_file[read_idx]).replace("\n", "\n ") + "\n";
+ String copyright = String::utf8(" \u00A9 ") + String::utf8(about_tp_copyright[read_idx]).replace("\n", String::utf8("\n \u00A9 "));
+ text += copyright;
+ long_text += copyright;
+ String license = "\n License: " + String(about_tp_license[read_idx]) + "\n";
+ text += license;
+ long_text += license + "\n";
+ read_idx++;
+ }
+ ti->set_metadata(0, text);
+ }
+ for (int i = 0; i < LICENSE_COUNT; i++) {
+
+ TreeItem *ti = _tpl_tree->create_item(tpl_ti_lc);
+ String licensename = String(about_license_name[i]);
+ ti->set_text(0, licensename);
+ long_text += "- " + licensename + "\n\n";
+ String licensebody = String(about_license_body[i]);
+ ti->set_metadata(0, licensebody);
+ long_text += " " + licensebody.replace("\n", "\n ") + "\n\n";
+ }
+ tpl_ti_all->set_metadata(0, long_text);
+ tpl_hbc->add_child(_tpl_tree);
+
+ _tpl_text = memnew(TextEdit);
+ _tpl_text->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ _tpl_text->set_v_size_flags(Control::SIZE_EXPAND_FILL);
+ _tpl_text->set_wrap(true);
+ _tpl_text->set_readonly(true);
+ tpl_hbc->add_child(_tpl_text);
+
+ _tpl_tree->connect("item_selected", this, "_license_tree_selected");
+ tpl_ti_all->select(0);
+ _tpl_text->set_text(tpl_ti_all->get_metadata(0));
+}
+
+EditorAbout::~EditorAbout() {}
diff --git a/platform/osx/context_gl_osx.h b/editor/editor_about.h
index 66da8b1ecf..0bde94531a 100644
--- a/platform/osx/context_gl_osx.h
+++ b/editor/editor_about.h
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* context_gl_osx.h */
+/* editor_about.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,38 +27,44 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef CONTEXT_GL_OSX_H
-#define CONTEXT_GL_OSX_H
+#ifndef EDITOR_ABOUT_H
+#define EDITOR_ABOUT_H
+#include "scene/gui/control.h"
+#include "scene/gui/dialogs.h"
+#include "scene/gui/item_list.h"
+#include "scene/gui/scroll_container.h"
+#include "scene/gui/separator.h"
+#include "scene/gui/split_container.h"
+#include "scene/gui/tab_container.h"
+#include "scene/gui/text_edit.h"
+#include "scene/gui/texture_rect.h"
+#include "scene/gui/tree.h"
+
+#include "editor_scale.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
-#ifdef OSX_ENABLED
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
+class EditorAbout : public AcceptDialog {
-#include "drivers/gl_context/context_gl.h"
-#include "os/os.h"
-#include <AGL/agl.h>
-#include <Carbon/Carbon.h>
+ GDCLASS(EditorAbout, AcceptDialog);
-class ContextGL_OSX : public ContextGL {
+private:
+ void _license_tree_selected();
- AGLContext context;
- WindowRef window;
+ Tree *_tpl_tree;
+ TextEdit *_tpl_text;
+ TextureRect *_logo;
-public:
- virtual void release_current();
- virtual void make_current();
- virtual void swap_buffers();
+protected:
+ static void _bind_methods();
- virtual Error initialize();
+public:
+ TextureRect *get_logo() const;
- ContextGL_OSX(WindowRef window);
- ~ContextGL_OSX();
+ EditorAbout();
+ ~EditorAbout();
};
#endif
-
-#endif
-#endif
diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp
index dfe63aacc2..96bfb295ea 100644
--- a/editor/editor_asset_installer.cpp
+++ b/editor/editor_asset_installer.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -112,13 +113,13 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
extension_guess["png"] = get_icon("Texture", "EditorIcons");
extension_guess["jpg"] = get_icon("Texture", "EditorIcons");
extension_guess["tex"] = get_icon("Texture", "EditorIcons");
- extension_guess["atex"] = get_icon("Texture", "EditorIcons");
+ extension_guess["atlastex"] = get_icon("Texture", "EditorIcons");
extension_guess["dds"] = get_icon("Texture", "EditorIcons");
extension_guess["scn"] = get_icon("PackedScene", "EditorIcons");
extension_guess["tscn"] = get_icon("PackedScene", "EditorIcons");
extension_guess["xml"] = get_icon("PackedScene", "EditorIcons");
extension_guess["xscn"] = get_icon("PackedScene", "EditorIcons");
- extension_guess["mtl"] = get_icon("Material", "EditorIcons");
+ extension_guess["material"] = get_icon("Material", "EditorIcons");
extension_guess["shd"] = get_icon("Shader", "EditorIcons");
extension_guess["gd"] = get_icon("GDScript", "EditorIcons");
}
@@ -183,6 +184,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
dir_map[path] = ti;
ti->set_text(0, path.get_file() + "/");
ti->set_icon(0, get_icon("folder", "FileDialog"));
+ ti->set_metadata(0, String());
} else {
String file = path.get_file();
String extension = file.get_extension().to_lower();
@@ -304,6 +306,7 @@ void EditorAssetInstaller::ok_pressed() {
if (EditorNode::get_singleton() != NULL)
EditorNode::get_singleton()->show_warning("Package Installed Successfully!", "Success!");
}
+ EditorFileSystem::get_singleton()->scan_changes();
}
void EditorAssetInstaller::_bind_methods() {
diff --git a/editor/editor_asset_installer.h b/editor/editor_asset_installer.h
index 046387520e..e74bd6925b 100644
--- a/editor/editor_asset_installer.h
+++ b/editor/editor_asset_installer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index 36cb95a373..993429a5a4 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -46,6 +47,12 @@ void EditorAudioBus::_notification(int p_what) {
disabled_vu = get_icon("BusVuFrozen", "EditorIcons");
+ solo->set_icon(get_icon("AudioBusSolo", "EditorIcons"));
+ mute->set_icon(get_icon("AudioBusMute", "EditorIcons"));
+ bypass->set_icon(get_icon("AudioBusBypass", "EditorIcons"));
+
+ bus_options->set_icon(get_icon("GuiMiniTabMenu", "EditorIcons"));
+
prev_active = true;
update_bus();
set_process(true);
@@ -341,7 +348,7 @@ void EditorAudioBus::_effect_edited() {
if (effect->get_metadata(0) == Variant()) {
Rect2 area = effects->get_item_rect(effect);
- effect_options->set_pos(effects->get_global_pos() + area.pos + Vector2(0, area.size.y));
+ effect_options->set_position(effects->get_global_position() + area.position + Vector2(0, area.size.y));
effect_options->popup();
//add effect
} else {
@@ -384,16 +391,19 @@ void EditorAudioBus::_effect_add(int p_which) {
ur->commit_action();
}
-void EditorAudioBus::_gui_input(const InputEvent &p_event) {
+void EditorAudioBus::_gui_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::KEY && p_event.key.pressed && p_event.key.scancode == KEY_DELETE && !p_event.key.echo) {
+ Ref<InputEventKey> k = p_event;
+ if (k.is_valid() && k->is_pressed() && k->get_scancode() == KEY_DELETE && !k->is_echo()) {
accept_event();
emit_signal("delete_request");
}
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == 2 && p_event.mouse_button.pressed) {
- Vector2 pos = Vector2(p_event.mouse_button.x, p_event.mouse_button.y);
- delete_popup->set_pos(get_global_pos() + pos);
+ Ref<InputEventMouseButton> mb = p_event;
+ if (mb.is_valid() && mb->get_button_index() == 2 && mb->is_pressed()) {
+
+ Vector2 pos = Vector2(mb->get_position().x, mb->get_position().y);
+ delete_popup->set_position(get_global_position() + pos);
delete_popup->popup();
}
}
@@ -419,7 +429,7 @@ Variant EditorAudioBus::get_drag_data(const Point2 &p_point) {
c->add_child(p);
p->add_style_override("panel", get_stylebox("focus", "Button"));
p->set_size(get_size());
- p->set_pos(-p_point);
+ p->set_position(-p_point);
set_drag_preview(c);
Dictionary d;
d["type"] = "move_audio_bus";
@@ -575,7 +585,7 @@ void EditorAudioBus::_effect_rmb(const Vector2 &p_pos) {
if (item->get_metadata(0).get_type() != Variant::INT)
return;
- delete_effect_popup->set_pos(get_global_mouse_pos());
+ delete_effect_popup->set_position(get_global_mouse_position());
delete_effect_popup->popup();
}
@@ -612,37 +622,45 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) {
buses = p_buses;
updating_bus = false;
+ set_tooltip(TTR("Audio Bus, Drag and Drop to rearrange."));
+
VBoxContainer *vb = memnew(VBoxContainer);
add_child(vb);
set_v_size_flags(SIZE_EXPAND_FILL);
+ HBoxContainer *head = memnew(HBoxContainer);
track_name = memnew(LineEdit);
- vb->add_child(track_name);
+ head->add_child(track_name);
track_name->connect("text_entered", this, "_name_changed");
track_name->connect("focus_exited", this, "_name_focus_exit");
+ track_name->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ bus_options = memnew(MenuButton);
+ bus_options->set_h_size_flags(SIZE_SHRINK_END);
+ bus_options->set_tooltip(TTR("Bus options"));
+ head->add_child(bus_options);
+
+ vb->add_child(head);
HBoxContainer *hbc = memnew(HBoxContainer);
vb->add_child(hbc);
hbc->add_spacer();
solo = memnew(ToolButton);
- solo->set_text("S");
solo->set_toggle_mode(true);
- solo->set_modulate(Color(0.8, 1.2, 0.8));
+ solo->set_tooltip(TTR("Solo"));
solo->set_focus_mode(FOCUS_NONE);
solo->connect("pressed", this, "_solo_toggled");
hbc->add_child(solo);
mute = memnew(ToolButton);
- mute->set_text("M");
mute->set_toggle_mode(true);
- mute->set_modulate(Color(1.2, 0.8, 0.8));
+ mute->set_tooltip(TTR("Mute"));
mute->set_focus_mode(FOCUS_NONE);
mute->connect("pressed", this, "_mute_toggled");
hbc->add_child(mute);
bypass = memnew(ToolButton);
- bypass->set_text("B");
bypass->set_toggle_mode(true);
- bypass->set_modulate(Color(1.1, 1.1, 0.8));
+ bypass->set_tooltip(TTR("Bypass"));
bypass->set_focus_mode(FOCUS_NONE);
bypass->connect("pressed", this, "_bypass_toggled");
hbc->add_child(bypass);
@@ -678,7 +696,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) {
effects = memnew(Tree);
effects->set_hide_root(true);
- effects->set_custom_minimum_size(Size2(0, 90) * EDSCALE);
+ effects->set_custom_minimum_size(Size2(0, 100) * EDSCALE);
effects->set_hide_folding(true);
vb->add_child(effects);
effects->connect("item_edited", this, "_effect_edited");
@@ -687,6 +705,8 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) {
effects->set_drag_forwarding(this);
effects->connect("item_rmb_selected", this, "_effect_rmb");
effects->set_allow_rmb_select(true);
+ effects->set_single_select_cell_editing_only_when_already_selected(true);
+ effects->set_focus_mode(FOCUS_CLICK);
send = memnew(OptionButton);
send->set_clip_text(true);
@@ -715,7 +735,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) {
effect_options->set_item_icon(effect_options->get_item_count() - 1, icon);
}
- delete_popup = memnew(PopupMenu);
+ delete_popup = bus_options->get_popup();
delete_popup->add_item("Duplicate");
delete_popup->add_item("Delete");
add_child(delete_popup);
@@ -1050,41 +1070,46 @@ EditorAudioBuses::EditorAudioBuses() {
top_hb = memnew(HBoxContainer);
add_child(top_hb);
+ file = memnew(ToolButton);
+ file->set_text("default_bus_layout.tres");
+ top_hb->add_child(file);
+ file->connect("pressed", this, "_select_layout");
+
add = memnew(Button);
top_hb->add_child(add);
- ;
add->set_text(TTR("Add Bus"));
+ add->set_tooltip(TTR("Create a new Bus Layout."));
add->connect("pressed", this, "_add_bus");
top_hb->add_spacer();
- file = memnew(ToolButton);
- file->set_text("default_bus_layout.tres");
- top_hb->add_child(file);
- file->connect("pressed", this, "_select_layout");
-
load = memnew(Button);
load->set_text(TTR("Load"));
+ load->set_tooltip(TTR("Load an existing Bus Layout."));
top_hb->add_child(load);
load->connect("pressed", this, "_load_layout");
save_as = memnew(Button);
save_as->set_text(TTR("Save As"));
+ save_as->set_tooltip(TTR("Save this Bus Layout to a file."));
top_hb->add_child(save_as);
save_as->connect("pressed", this, "_save_as_layout");
_default = memnew(Button);
- _default->set_text(TTR("Default"));
+ _default->set_text(TTR("Load Default"));
+ _default->set_tooltip(TTR("Load the default Bus Layout."));
top_hb->add_child(_default);
_default->connect("pressed", this, "_load_default_layout");
_new = memnew(Button);
_new->set_text(TTR("Create"));
+ _new->set_tooltip(TTR("Create a new Bus Layout."));
top_hb->add_child(_new);
_new->connect("pressed", this, "_new_layout");
bus_scroll = memnew(ScrollContainer);
+ bus_scroll->add_style_override("panel", memnew(StyleBoxEmpty));
bus_scroll->set_v_size_flags(SIZE_EXPAND_FILL);
bus_scroll->set_enable_h_scroll(true);
bus_scroll->set_enable_v_scroll(false);
@@ -1104,9 +1129,9 @@ EditorAudioBuses::EditorAudioBuses() {
file_dialog = memnew(EditorFileDialog);
List<String> ext;
- ResourceLoader::get_recognized_extensions_for_type("AudioServerState", &ext);
+ ResourceLoader::get_recognized_extensions_for_type("AudioBusLayout", &ext);
for (List<String>::Element *E = ext.front(); E; E = E->next()) {
- file_dialog->add_filter("*." + E->get() + "; Audio Bus State");
+ file_dialog->add_filter("*." + E->get() + "; Audio Bus Layout");
}
add_child(file_dialog);
file_dialog->connect("file_selected", this, "_file_dialog_callback");
diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h
index 06a9c01bf0..ef7f5e0adf 100644
--- a/editor/editor_audio_buses.h
+++ b/editor/editor_audio_buses.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,6 +35,7 @@
#include "scene/gui/box_container.h"
#include "scene/gui/button.h"
#include "scene/gui/line_edit.h"
+#include "scene/gui/menu_button.h"
#include "scene/gui/option_button.h"
#include "scene/gui/panel.h"
#include "scene/gui/panel_container.h"
@@ -56,6 +58,7 @@ class EditorAudioBus : public PanelContainer {
Ref<Texture> disabled_vu;
LineEdit *track_name;
+ MenuButton *bus_options;
VSlider *slider;
TextureProgress *vu_l;
TextureProgress *vu_r;
@@ -74,7 +77,7 @@ class EditorAudioBus : public PanelContainer {
bool updating_bus;
- void _gui_input(const InputEvent &p_event);
+ void _gui_input(const Ref<InputEvent> &p_event);
void _delete_pressed(int p_option);
void _name_changed(const String &p_new_name);
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index 67e8c63e51..dde94cb334 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,8 +30,8 @@
#include "editor_autoload_settings.h"
#include "editor_node.h"
-#include "global_config.h"
#include "global_constants.h"
+#include "project_settings.h"
#define PREVIEW_LIST_MAX_SIZE 10
@@ -114,12 +115,12 @@ void EditorAutoloadSettings::_autoload_add() {
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
undo_redo->create_action(TTR("Add AutoLoad"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), name, "*" + path);
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), name, "*" + path);
- if (GlobalConfig::get_singleton()->has(name)) {
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name));
+ if (ProjectSettings::get_singleton()->has(name)) {
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, ProjectSettings::get_singleton()->get(name));
} else {
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, Variant());
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, Variant());
}
undo_redo->add_do_method(this, "update_autoload");
@@ -168,7 +169,7 @@ void EditorAutoloadSettings::_autoload_edited() {
return;
}
- if (GlobalConfig::get_singleton()->has("autoload/" + name)) {
+ if (ProjectSettings::get_singleton()->has("autoload/" + name)) {
ti->set_text(0, old_name);
EditorNode::get_singleton()->show_warning(vformat(TTR("Autoload '%s' already exists!"), name));
return;
@@ -178,18 +179,18 @@ void EditorAutoloadSettings::_autoload_edited() {
name = "autoload/" + name;
- int order = GlobalConfig::get_singleton()->get_order(selected_autoload);
- String path = GlobalConfig::get_singleton()->get(selected_autoload);
+ int order = ProjectSettings::get_singleton()->get_order(selected_autoload);
+ String path = ProjectSettings::get_singleton()->get(selected_autoload);
undo_redo->create_action(TTR("Rename Autoload"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), name, path);
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", name, order);
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "clear", selected_autoload);
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), name, path);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", name, order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", selected_autoload);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), selected_autoload, path);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", selected_autoload, order);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "clear", name);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), selected_autoload, path);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", selected_autoload, order);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", name);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -206,8 +207,8 @@ void EditorAutoloadSettings::_autoload_edited() {
bool checked = ti->is_checked(2);
String base = "autoload/" + ti->get_text(0);
- int order = GlobalConfig::get_singleton()->get_order(base);
- String path = GlobalConfig::get_singleton()->get(base);
+ int order = ProjectSettings::get_singleton()->get_order(base);
+ String path = ProjectSettings::get_singleton()->get(base);
if (path.begins_with("*"))
path = path.substr(1, path.length());
@@ -217,11 +218,11 @@ void EditorAutoloadSettings::_autoload_edited() {
undo_redo->create_action(TTR("Toggle AutoLoad Globals"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), base, path);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), base, GlobalConfig::get_singleton()->get(base));
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), base, path);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), base, ProjectSettings::get_singleton()->get(base));
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", base, order);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", base, order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", base, order);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", base, order);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -261,16 +262,16 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu
String swap_name = "autoload/" + swap->get_text(0);
- int order = GlobalConfig::get_singleton()->get_order(name);
- int swap_order = GlobalConfig::get_singleton()->get_order(swap_name);
+ int order = ProjectSettings::get_singleton()->get_order(name);
+ int swap_order = ProjectSettings::get_singleton()->get_order(swap_name);
undo_redo->create_action(TTR("Move Autoload"));
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", name, swap_order);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", name, order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", name, swap_order);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", name, order);
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", swap_name, order);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", swap_name, swap_order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", swap_name, order);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", swap_name, swap_order);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -282,15 +283,15 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu
} break;
case BUTTON_DELETE: {
- int order = GlobalConfig::get_singleton()->get_order(name);
+ int order = ProjectSettings::get_singleton()->get_order(name);
undo_redo->create_action(TTR("Remove Autoload"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), name, Variant());
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), name, Variant());
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name));
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_persisting", name, true);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", order);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, ProjectSettings::get_singleton()->get(name));
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_persisting", name, true);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", order);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -321,7 +322,7 @@ void EditorAutoloadSettings::update_autoload() {
TreeItem *root = tree->create_item();
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -331,14 +332,14 @@ void EditorAutoloadSettings::update_autoload() {
continue;
String name = pi.name.get_slice("/", 1);
- String path = GlobalConfig::get_singleton()->get(pi.name);
+ String path = ProjectSettings::get_singleton()->get(pi.name);
if (name.empty())
continue;
AutoLoadInfo info;
info.name = pi.name;
- info.order = GlobalConfig::get_singleton()->get_order(pi.name);
+ info.order = ProjectSettings::get_singleton()->get_order(pi.name);
autoload_cache.push_back(info);
@@ -458,7 +459,7 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant &
move_to_back = true;
}
- int order = GlobalConfig::get_singleton()->get_order("autoload/" + name);
+ int order = ProjectSettings::get_singleton()->get_order("autoload/" + name);
AutoLoadInfo aux;
List<AutoLoadInfo>::Element *E = NULL;
@@ -475,7 +476,7 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant &
orders.resize(autoload_cache.size());
for (int i = 0; i < autoloads.size(); i++) {
- aux.order = GlobalConfig::get_singleton()->get_order("autoload/" + autoloads[i]);
+ aux.order = ProjectSettings::get_singleton()->get_order("autoload/" + autoloads[i]);
List<AutoLoadInfo>::Element *I = autoload_cache.find(aux);
@@ -505,8 +506,8 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant &
i = 0;
for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) {
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", E->get().name, orders[i++]);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", E->get().name, E->get().order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", E->get().name, orders[i++]);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", E->get().name, E->get().order);
}
orders.clear();
diff --git a/editor/editor_autoload_settings.h b/editor/editor_autoload_settings.h
index 8eb6140180..9f8e3526b4 100644
--- a/editor/editor_autoload_settings.h
+++ b/editor/editor_autoload_settings.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -65,7 +66,7 @@ class EditorAutoloadSettings : public VBoxContainer {
EditorLineEditFileChooser *autoload_add_path;
LineEdit *autoload_add_name;
- bool _autoload_name_is_valid(const String &p_string, String *r_error = NULL);
+ bool _autoload_name_is_valid(const String &p_name, String *r_error = NULL);
void _autoload_add();
void _autoload_selected();
@@ -73,9 +74,9 @@ class EditorAutoloadSettings : public VBoxContainer {
void _autoload_button_pressed(Object *p_item, int p_column, int p_button);
void _autoload_file_callback(const String &p_path);
- 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);
+ Variant get_drag_data_fw(const Point2 &p_point, Control *p_control);
+ bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_control) const;
+ void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_control);
protected:
void _notification(int p_what);
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index d92a348df9..51fb1554c1 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,10 +31,10 @@
#include "editor_node.h"
#include "editor_settings.h"
-#include "global_config.h"
#include "io/resource_loader.h"
#include "os/dir_access.h"
#include "os/file_access.h"
+#include "project_settings.h"
#include "scene/resources/packed_scene.h"
void EditorHistory::_cleanup_history() {
@@ -182,7 +183,7 @@ ObjectID EditorHistory::get_current() {
if (!obj)
return 0;
- return obj->get_instance_ID();
+ return obj->get_instance_id();
}
int EditorHistory::get_path_size() const {
@@ -207,7 +208,7 @@ ObjectID EditorHistory::get_path_object(int p_index) const {
if (!obj)
return 0;
- return obj->get_instance_ID();
+ return obj->get_instance_id();
}
String EditorHistory::get_path_property(int p_index) const {
@@ -352,6 +353,7 @@ void EditorData::notify_edited_scene_changed() {
for (int i = 0; i < editor_plugins.size(); i++) {
editor_plugins[i]->edited_scene_changed();
+ editor_plugins[i]->notify_scene_changed(get_edited_scene_root());
}
}
@@ -487,8 +489,14 @@ void EditorData::move_edited_scene_index(int p_idx, int p_to_idx) {
}
void EditorData::remove_scene(int p_idx) {
ERR_FAIL_INDEX(p_idx, edited_scene.size());
- if (edited_scene[p_idx].root)
+ if (edited_scene[p_idx].root) {
+
+ for (int i = 0; i < editor_plugins.size(); i++) {
+ editor_plugins[i]->notify_scene_closed(edited_scene[p_idx].root->get_filename());
+ }
+
memdelete(edited_scene[p_idx].root);
+ }
if (current_edited_scene > p_idx)
current_edited_scene--;
@@ -614,13 +622,24 @@ int EditorData::get_edited_scene_count() const {
return edited_scene.size();
}
-void EditorData::set_edited_scene_version(uint64_t version, int scene_idx) {
+Vector<EditorData::EditedScene> EditorData::get_edited_scenes() const {
+
+ Vector<EditedScene> out_edited_scenes_list = Vector<EditedScene>();
+
+ for (int i = 0; i < edited_scene.size(); i++) {
+ out_edited_scenes_list.push_back(edited_scene[i]);
+ }
+
+ return out_edited_scenes_list;
+}
+
+void EditorData::set_edited_scene_version(uint64_t version, int p_scene_idx) {
ERR_FAIL_INDEX(current_edited_scene, edited_scene.size());
- if (scene_idx < 0) {
+ if (p_scene_idx < 0) {
edited_scene[current_edited_scene].version = version;
} else {
- ERR_FAIL_INDEX(scene_idx, edited_scene.size());
- edited_scene[scene_idx].version = version;
+ ERR_FAIL_INDEX(p_scene_idx, edited_scene.size());
+ edited_scene[p_scene_idx].version = version;
}
}
@@ -674,7 +693,12 @@ String EditorData::get_scene_title(int p_idx) const {
return "[empty]";
if (edited_scene[p_idx].root->get_filename() == "")
return "[unsaved]";
- return edited_scene[p_idx].root->get_filename().get_file();
+ bool show_ext = EDITOR_DEF("interface/scene_tabs/show_extension", false);
+ String name = edited_scene[p_idx].root->get_filename().get_file();
+ if (!show_ext) {
+ name = name.get_basename();
+ }
+ return name;
}
String EditorData::get_scene_path(int p_idx) const {
@@ -843,8 +867,8 @@ void EditorSelection::_bind_methods() {
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("add_node", "node"), &EditorSelection::add_node);
+ ClassDB::bind_method(D_METHOD("remove_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/editor/editor_data.h b/editor/editor_data.h
index 598cde2318..a601b5019d 100644
--- a/editor/editor_data.h
+++ b/editor/editor_data.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,6 +31,7 @@
#define EDITOR_DATA_H
#include "editor/editor_plugin.h"
+#include "editor/plugins/script_editor_plugin.h"
#include "list.h"
#include "pair.h"
#include "scene/resources/texture.h"
@@ -108,6 +110,17 @@ public:
Ref<Texture> icon;
};
+ struct EditedScene {
+ Node *root;
+ Dictionary editor_states;
+ List<Node *> selection;
+ Vector<EditorHistory::History> history_stored;
+ int history_current;
+ Dictionary custom_state;
+ uint64_t version;
+ NodePath live_edit_root;
+ };
+
private:
Vector<EditorPlugin *> editor_plugins;
@@ -123,17 +136,6 @@ private:
void _cleanup_history();
- struct EditedScene {
- Node *root;
- Dictionary editor_states;
- List<Node *> selection;
- Vector<EditorHistory::History> history_stored;
- int history_current;
- Dictionary custom_state;
- uint64_t version;
- NodePath live_edit_root;
- };
-
Vector<EditedScene> edited_scene;
int current_edited_scene;
@@ -179,6 +181,7 @@ public:
int get_edited_scene() const;
Node *get_edited_scene_root(int p_idx = -1);
int get_edited_scene_count() const;
+ Vector<EditedScene> get_edited_scenes() const;
String get_scene_title(int p_idx) const;
String get_scene_path(int p_idx) const;
String get_scene_type(int p_idx) const;
diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp
index 5cd277e218..b64f5f1c69 100644
--- a/editor/editor_dir_dialog.cpp
+++ b/editor/editor_dir_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -111,19 +112,19 @@ void EditorDirDialog::_notification(int p_what) {
}
}
-void EditorDirDialog::_item_collapsed(Object *_p_item) {
+void EditorDirDialog::_item_collapsed(Object *p_item) {
- TreeItem *p_item = _p_item->cast_to<TreeItem>();
+ TreeItem *item = p_item->cast_to<TreeItem>();
- if (updating || p_item->is_collapsed())
+ if (updating || item->is_collapsed())
return;
- TreeItem *ci = p_item->get_children();
+ TreeItem *ci = item->get_children();
while (ci) {
String p = ci->get_metadata(0);
if (p == "") {
- String pp = p_item->get_metadata(0);
+ String pp = item->get_metadata(0);
ci->set_metadata(0, pp.plus_file(ci->get_text(0)));
_update_dir(ci);
}
diff --git a/editor/editor_dir_dialog.h b/editor/editor_dir_dialog.h
index 2f2385e971..0fdb71b0a1 100644
--- a/editor/editor_dir_dialog.h
+++ b/editor/editor_dir_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 6497b99610..fe1dfa281c 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,21 +28,22 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "editor_export.h"
+
#include "editor/editor_file_system.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor_node.h"
#include "editor_settings.h"
-#include "global_config.h"
#include "io/config_file.h"
-#include "io/md5.h"
#include "io/resource_loader.h"
#include "io/resource_saver.h"
#include "io/zip_io.h"
-#include "os/dir_access.h"
#include "os/file_access.h"
+#include "project_settings.h"
#include "script_language.h"
#include "version.h"
+#include "thirdparty/misc/md5.h"
+
static int _get_pad(int p_alignment, int p_n) {
int rest = p_n % p_alignment;
@@ -75,11 +77,14 @@ bool EditorExportPreset::_get(const StringName &p_name, Variant &r_ret) const {
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());
+ if (platform->get_option_visibility(E->get().name, values)) {
+ p_list->push_back(E->get());
+ }
}
}
@@ -194,6 +199,17 @@ Vector<String> EditorExportPreset::get_patches() const {
return patches;
}
+void EditorExportPreset::set_custom_features(const String &p_custom_features) {
+
+ custom_features = p_custom_features;
+ EditorExport::singleton->save_presets();
+}
+
+String EditorExportPreset::get_custom_features() const {
+
+ return custom_features;
+}
+
EditorExportPreset::EditorExportPreset() {
export_filter = EXPORT_ALL_RESOURCES;
@@ -204,7 +220,8 @@ EditorExportPreset::EditorExportPreset() {
void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags) {
- String host = EditorSettings::get_singleton()->get("network/debug_host");
+ String host = EditorSettings::get_singleton()->get("network/debug/remote_host");
+ int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
if (p_flags & DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST)
host = "localhost";
@@ -224,7 +241,7 @@ void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags)
r_flags.push_back("-rdebug");
- r_flags.push_back(host + ":" + String::num(GLOBAL_DEF("network/debug/remote_port", 6007)));
+ r_flags.push_back(host + ":" + String::num(remote_port));
List<String> breakpoints;
ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
@@ -315,7 +332,7 @@ Error EditorExportPlatform::_save_zip_file(void *p_userdata, const String &p_pat
return OK;
}
-String EditorExportPlatform::find_export_template(String template_file_name) const {
+String EditorExportPlatform::find_export_template(String template_file_name, String *err) const {
String base_name = itos(VERSION_MAJOR) + "." + itos(VERSION_MINOR) + "-" + _MKSTR(VERSION_STATUS) + "/" + template_file_name;
String user_file = EditorSettings::get_singleton()->get_settings_path() + "/templates/" + base_name;
@@ -336,9 +353,20 @@ String EditorExportPlatform::find_export_template(String template_file_name) con
return system_file;
}
}
- print_line("none,sorry");
- return String(); //not found
+ // Not found
+ if (err) {
+ *err += "No export template found at \"" + user_file + "\"";
+ if (has_system_path)
+ *err += "\n or \"" + system_file + "\".";
+ else
+ *err += ".";
+ }
+ return String(); // not found
+}
+
+bool EditorExportPlatform::exists_export_template(String template_file_name, String *err) const {
+ return find_export_template(template_file_name, err) != "";
}
Ref<EditorExportPreset> EditorExportPlatform::create_preset() {
@@ -391,6 +419,63 @@ void EditorExportPlatform::_export_find_dependencies(const String &p_path, Set<S
}
}
+void EditorExportPlatform::_edit_files_with_filter(DirAccess *da, const Vector<String> &p_filters, Set<String> &r_list, bool exclude) {
+
+ da->list_dir_begin();
+ String cur_dir = da->get_current_dir().replace("\\", "/");
+ if (!cur_dir.ends_with("/"))
+ cur_dir += "/";
+
+ Vector<String> dirs;
+ String f;
+ while ((f = da->get_next()) != "") {
+ if (da->current_is_dir())
+ dirs.push_back(f);
+ else {
+ String fullpath = cur_dir + f;
+ for (int i = 0; i < p_filters.size(); ++i) {
+ if (fullpath.matchn(p_filters[i])) {
+ if (!exclude) {
+ r_list.insert(fullpath);
+ } else {
+ r_list.erase(fullpath);
+ }
+ }
+ }
+ }
+ }
+
+ da->list_dir_end();
+
+ for (int i = 0; i < dirs.size(); ++i) {
+ String dir = dirs[i];
+ if (dir.begins_with("."))
+ continue;
+ da->change_dir(dir);
+ _edit_files_with_filter(da, p_filters, r_list, exclude);
+ da->change_dir("..");
+ }
+}
+
+void EditorExportPlatform::_edit_filter_list(Set<String> &r_list, const String &p_filter, bool exclude) {
+
+ if (p_filter == "")
+ return;
+ Vector<String> split = p_filter.split(",");
+ Vector<String> filters;
+ for (int i = 0; i < split.size(); i++) {
+ String f = split[i].strip_edges();
+ if (f.empty())
+ continue;
+ filters.push_back(f);
+ }
+
+ DirAccess *da = DirAccess::open("res://");
+ ERR_FAIL_NULL(da);
+ _edit_files_with_filter(da, filters, r_list, exclude);
+ memdelete(da);
+}
+
Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata) {
Ref<EditorExportPlatform> platform = p_preset->get_platform();
@@ -420,6 +505,9 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
}
}
+ _edit_filter_list(paths, p_preset->get_include_filter(), false);
+ _edit_filter_list(paths, p_preset->get_exclude_filter(), true);
+
//store everything in the export medium
int idx = 0;
int total = paths.size();
@@ -473,9 +561,23 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
//save config!
- String config_file = "godot.cfb";
+ Vector<String> custom_list;
+
+ if (p_preset->get_custom_features() != String()) {
+
+ Vector<String> tmp_custom_list = p_preset->get_custom_features().split(",");
+
+ for (int i = 0; i < tmp_custom_list.size(); i++) {
+ String f = tmp_custom_list[i].strip_edges();
+ if (f != String()) {
+ custom_list.push_back(f);
+ }
+ }
+ }
+
+ String config_file = "project.binary";
String engine_cfb = EditorSettings::get_singleton()->get_settings_path() + "/tmp/tmp" + config_file;
- GlobalConfig::get_singleton()->save_custom(engine_cfb);
+ ProjectSettings::get_singleton()->save_custom(engine_cfb, ProjectSettings::CustomMap(), custom_list);
Vector<uint8_t> data = FileAccess::get_file_as_array(engine_cfb);
p_func(p_udata, "res://" + config_file, data, idx, total);
@@ -603,7 +705,8 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, co
void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags) {
- String host = EditorSettings::get_singleton()->get("network/debug_host");
+ String host = EditorSettings::get_singleton()->get("network/debug/remote_host");
+ int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
if (p_flags & DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST)
host = "localhost";
@@ -623,7 +726,7 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
r_flags.push_back("-rdebug");
- r_flags.push_back(host + ":" + String::num(GLOBAL_DEF("network/debug/remote_port", 6007)));
+ r_flags.push_back(host + ":" + String::num(remote_port));
List<String> breakpoints;
ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
@@ -672,6 +775,7 @@ void EditorExport::_save() {
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());
+ config->set_value(section, "custom_features", preset->get_custom_features());
bool save_files = false;
switch (preset->get_export_filter()) {
case EditorExportPreset::EXPORT_ALL_RESOURCES: {
@@ -804,6 +908,10 @@ void EditorExport::load_config() {
preset->set_name(config->get_value(section, "name"));
preset->set_runnable(config->get_value(section, "runnable"));
+ if (config->has_section_key(section, "custom_features")) {
+ preset->set_custom_features(config->get_value(section, "custom_features"));
+ }
+
String export_filter = config->get_value(section, "export_filter");
bool get_files = false;
@@ -912,6 +1020,11 @@ String EditorExportPlatformPC::get_name() const {
return name;
}
+
+String EditorExportPlatformPC::get_os_name() const {
+
+ return os_name;
+}
Ref<Texture> EditorExportPlatformPC::get_logo() const {
return logo;
@@ -919,19 +1032,47 @@ Ref<Texture> EditorExportPlatformPC::get_logo() const {
bool EditorExportPlatformPC::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
- r_missing_templates = false;
+ String err;
+ bool valid = true;
+
+ if (use64 && (!exists_export_template(debug_file_64, &err) || !exists_export_template(release_file_64, &err))) {
+ valid = false;
+ }
+
+ if (!use64 && (!exists_export_template(debug_file_32, &err) || !exists_export_template(release_file_32, &err))) {
+ valid = false;
+ }
+
+ String custom_debug_binary = p_preset->get("custom_template/debug");
+ String custom_release_binary = p_preset->get("custom_template/release");
+
+ if (custom_debug_binary == "" && custom_release_binary == "") {
+ if (!err.empty())
+ r_error = err;
+ return valid;
+ }
+
+ bool dvalid = true;
+ bool rvalid = true;
- 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;
+ if (!FileAccess::exists(custom_debug_binary)) {
+ dvalid = false;
+ err = "Custom debug binary not found.\n";
+ }
+
+ if (!FileAccess::exists(custom_release_binary)) {
+ rvalid = false;
+ err += "Custom release binary not found.\n";
}
- return !r_missing_templates;
+ if (dvalid || rvalid)
+ valid = true;
+ else
+ valid = false;
+
+ if (!err.empty())
+ r_error = err;
+ return valid;
}
String EditorExportPlatformPC::get_binary_extension() const {
@@ -986,6 +1127,10 @@ void EditorExportPlatformPC::set_name(const String &p_name) {
name = p_name;
}
+void EditorExportPlatformPC::set_os_name(const String &p_name) {
+ os_name = p_name;
+}
+
void EditorExportPlatformPC::set_logo(const Ref<Texture> &p_logo) {
logo = p_logo;
}
@@ -1008,6 +1153,20 @@ void EditorExportPlatformPC::set_debug_32(const String &p_file) {
debug_file_32 = p_file;
}
+void EditorExportPlatformPC::add_platform_feature(const String &p_feature) {
+
+ extra_features.insert(p_feature);
+}
+
+void EditorExportPlatformPC::get_platform_features(List<String> *r_features) {
+ r_features->push_back("pc"); //all pcs support "pc"
+ r_features->push_back("s3tc"); //all pcs support "s3tc" compression
+ r_features->push_back(get_os_name()); //OS name is a feature
+ for (Set<String>::Element *E = extra_features.front(); E; E = E->next()) {
+ r_features->push_back(E->get());
+ }
+}
+
EditorExportPlatformPC::EditorExportPlatformPC() {
}
@@ -1018,7 +1177,6 @@ EditorExportPlatformPC::EditorExportPlatformPC() {
#include "editor/plugins/script_editor_plugin.h"
#include "editor_node.h"
#include "editor_settings.h"
-#include "global_config.h"
#include "io/config_file.h"
#include "io/md5.h"
#include "io/resource_loader.h"
@@ -1027,14 +1185,15 @@ EditorExportPlatformPC::EditorExportPlatformPC() {
#include "io_plugins/editor_texture_import_plugin.h"
#include "os/dir_access.h"
#include "os/file_access.h"
+#include "project_settings.h"
#include "script_language.h"
#include "version.h"
String EditorImportPlugin::validate_source_path(const String& p_path) {
- String gp = GlobalConfig::get_singleton()->globalize_path(p_path);
- String rp = GlobalConfig::get_singleton()->get_resource_path();
+ String gp = ProjectSettings::get_singleton()->globalize_path(p_path);
+ String rp = ProjectSettings::get_singleton()->get_resource_path();
if (!rp.ends_with("/"))
rp+="/";
@@ -1044,7 +1203,7 @@ String EditorImportPlugin::validate_source_path(const String& p_path) {
String EditorImportPlugin::expand_source_path(const String& p_path) {
if (p_path.is_rel_path()) {
- return GlobalConfig::get_singleton()->get_resource_path().plus_file(p_path).simplify_path();
+ return ProjectSettings::get_singleton()->get_resource_path().plus_file(p_path).simplify_path();
} else {
return p_path;
}
@@ -1375,8 +1534,8 @@ Vector<StringName> EditorExportPlatform::get_dependencies(bool p_bundles) const
Set<StringName> exported;
- if (FileAccess::exists("res://godot.cfg"))
- exported.insert("res://godot.cfg");
+ if (FileAccess::exists("res://project.godot"))
+ exported.insert("res://project.godot");
if (EditorImportExport::get_singleton()->get_export_filter()!=EditorImportExport::EXPORT_SELECTED) {
@@ -1491,40 +1650,6 @@ Vector<StringName> EditorExportPlatform::get_dependencies(bool p_bundles) const
}
-String EditorExportPlatform::find_export_template(String template_file_name, String *err) const {
- String user_file = EditorSettings::get_singleton()->get_settings_path()
- +"/templates/"+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 "";
-}
-
-bool EditorExportPlatform::exists_export_template(String template_file_name, String *err) const {
- return find_export_template(template_file_name,err)!="";
-}
-
///////////////////////////////////////
@@ -1753,7 +1878,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
{
MD5_CTX ctx;
MD5Init(&ctx);
- String path = GlobalConfig::get_singleton()->get_resource_path()+"::"+String(E->get())+"::"+get_name();
+ String path = ProjectSettings::get_singleton()->get_resource_path()+"::"+String(E->get())+"::"+get_name();
MD5Update(&ctx,(unsigned char*)path.utf8().get_data(),path.utf8().length());
MD5Final(&ctx);
md5 = String::md5(ctx.digest);
@@ -1862,11 +1987,11 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
int flags=0;
- if (GlobalConfig::get_singleton()->get("image_loader/filter"))
+ if (ProjectSettings::get_singleton()->get("image_loader/filter"))
flags|=EditorTextureImportPlugin::IMAGE_FLAG_FILTER;
- if (!GlobalConfig::get_singleton()->get("image_loader/gen_mipmaps"))
+ if (!ProjectSettings::get_singleton()->get("image_loader/gen_mipmaps"))
flags|=EditorTextureImportPlugin::IMAGE_FLAG_NO_MIPMAPS;
- if (!GlobalConfig::get_singleton()->get("image_loader/repeat"))
+ if (!ProjectSettings::get_singleton()->get("image_loader/repeat"))
flags|=EditorTextureImportPlugin::IMAGE_FLAG_REPEAT;
flags|=EditorTextureImportPlugin::IMAGE_FLAG_FIX_BORDER_ALPHA;
@@ -1930,14 +2055,14 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
atex->set_region(region);
atex->set_margin(margin);
- String path = EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmpatlas.atex";
+ String path = EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmpatlas.atlastex";
Error err = ResourceSaver::save(path,atex);
if (err!=OK) {
EditorNode::add_io_error(TTR("Could not save atlas subtexture:")+" "+path);
return ERR_CANT_CREATE;
}
Vector<uint8_t> data = FileAccess::get_file_as_array(path);
- String dst_path = F->get().operator String().get_basename()+".atex";
+ String dst_path = F->get().operator String().get_basename()+".atlastex";
err = p_func(p_udata,dst_path,data,counter++,files.size());
saved.insert(dst_path);
if (err)
@@ -1972,10 +2097,10 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
}
- StringName engine_cfg="res://godot.cfg";
+ StringName engine_cfg="res://project.godot";
StringName boot_splash;
{
- String splash=GlobalConfig::get_singleton()->get("application/boot_splash"); //avoid splash from being converted
+ String splash=ProjectSettings::get_singleton()->get("application/boot_splash"); //avoid splash from being converted
splash=splash.strip_edges();
if (splash!=String()) {
if (!splash.begins_with("res://"))
@@ -1986,7 +2111,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
}
StringName custom_cursor;
{
- String splash=GlobalConfig::get_singleton()->get("display/custom_mouse_cursor"); //avoid splash from being converted
+ String splash=ProjectSettings::get_singleton()->get("display/custom_mouse_cursor"); //avoid splash from being converted
splash=splash.strip_edges();
if (splash!=String()) {
if (!splash.begins_with("res://"))
@@ -2026,7 +2151,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
{
- //make binary godot.cfg config
+ //make binary project.godot config
Map<String,Variant> custom;
@@ -2070,9 +2195,9 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
}
- String remap_file="godot.cfb";
+ String remap_file="project.binary";
String engine_cfb =EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmp"+remap_file;
- GlobalConfig::get_singleton()->save_custom(engine_cfb,custom);
+ ProjectSettings::get_singleton()->save_custom(engine_cfb,custom);
Vector<uint8_t> data = FileAccess::get_file_as_array(engine_cfb);
Error err = p_func(p_udata,"res://"+remap_file,data,counter,files.size());
@@ -2097,7 +2222,8 @@ static int _get_pad(int p_alignment, int p_n) {
void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags) {
- String host = EditorSettings::get_singleton()->get("network/debug_host");
+ String host = EditorSettings::get_singleton()->get("network/debug/remote_host");
+ int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
if (p_flags&EXPORT_REMOTE_DEBUG_LOCALHOST)
host="localhost";
@@ -2117,7 +2243,7 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
r_flags.push_back("-rdebug");
- r_flags.push_back(host+":"+String::num(GLOBAL_DEF("network/debug/remote_port", 6007)));
+ r_flags.push_back(host+":"+String::num(remote_port));
List<String> breakpoints;
ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
@@ -2424,50 +2550,6 @@ void EditorExportPlatformPC::set_binary_extension(const String& p_extension) {
binary_extension=p_extension;
}
-bool EditorExportPlatformPC::can_export(String *r_error) const {
-
- String err;
- bool valid=true;
-
- if (use64 && (!exists_export_template(debug_binary64) || !exists_export_template(release_binary64))) {
- valid=false;
- err="No 64 bits export templates found.\nDownload and install export templates.\n";
- }
-
- if (!use64 && (!exists_export_template(debug_binary32) || !exists_export_template(release_binary32))) {
- valid=false;
- err="No 32 bits export templates found.\nDownload and install export templates.\n";
- }
-
- if(custom_debug_binary=="" && custom_release_binary=="") {
- if (r_error) *r_error=err;
- return valid;
- }
-
- bool dvalid = true;
- bool rvalid = true;
-
- if(!FileAccess::exists(custom_debug_binary)) {
- dvalid = false;
- err = "Custom debug binary not found.\n";
- }
-
- if(!FileAccess::exists(custom_release_binary)) {
- rvalid = false;
- err = "Custom release binary not found.\n";
- }
-
- if (dvalid || rvalid)
- valid = true;
- else
- valid = false;
-
- if (r_error)
- *r_error=err;
- return valid;
-}
-
-
EditorExportPlatformPC::EditorExportPlatformPC() {
export_mode=EXPORT_PACK;
@@ -3195,24 +3277,24 @@ PoolVector<String> EditorImportExport::_get_export_platforms() {
void EditorImportExport::_bind_methods() {
- 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("add_import_plugin","plugin"),&EditorImportExport::add_import_plugin);
+ ClassDB::bind_method(D_METHOD("remove_import_plugin","plugin"),&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("get_import_plugin","idx"),&EditorImportExport::get_import_plugin);
+ ClassDB::bind_method(D_METHOD("get_import_plugin_by_name","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("add_export_plugin","plugin"),&EditorImportExport::add_export_plugin);
+ ClassDB::bind_method(D_METHOD("remove_export_plugin","plugin"),&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("get_export_plugin","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("add_export_platform","platform"),&EditorImportExport::add_export_platform);
+ //ClassDB::bind_method(D_METHOD("remove_export_platform","platform"),&EditorImportExport::add_export_platform);
+ ClassDB::bind_method(D_METHOD("get_export_platform","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);
diff --git a/editor/editor_export.h b/editor/editor_export.h
index 1c9f5b3354..df42b0d95d 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,7 @@
#ifndef EDITOR_EXPORT_H
#define EDITOR_EXPORT_H
+#include "os/dir_access.h"
#include "resource.h"
#include "scene/main/node.h"
#include "scene/main/timer.h"
@@ -69,6 +71,8 @@ private:
String name;
+ String custom_features;
+
protected:
bool _set(const StringName &p_name, const Variant &p_value);
bool _get(const StringName &p_name, Variant &r_ret) const;
@@ -76,6 +80,7 @@ protected:
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;
@@ -105,6 +110,9 @@ public:
void remove_patch(int p_idx);
Vector<String> get_patches() const;
+ void set_custom_features(const String &p_custom_features);
+ String get_custom_features() const;
+
const List<PropertyInfo> &get_properties() const { return properties; }
EditorExportPreset();
@@ -150,12 +158,17 @@ private:
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);
+ void _edit_files_with_filter(DirAccess *da, const Vector<String> &p_filters, Set<String> &r_list, bool exclude);
+ void _edit_filter_list(Set<String> &r_list, const String &p_filter, bool exclude);
+
protected:
- virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) = 0;
- String find_export_template(String template_file_name) const;
+ bool exists_export_template(String template_file_name, String *err) const;
+ String find_export_template(String template_file_name, String *err = NULL) const;
void gen_export_flags(Vector<String> &r_flags, int p_flags);
public:
+ virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) = 0;
+
struct ExportOption {
PropertyInfo option;
Variant default_value;
@@ -170,6 +183,9 @@ public:
virtual Ref<EditorExportPreset> create_preset();
virtual void get_export_options(List<ExportOption> *r_options) = 0;
+ virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const { return true; }
+
+ virtual String get_os_name() const = 0;
virtual String get_name() const = 0;
virtual Ref<Texture> get_logo() const = 0;
@@ -192,11 +208,13 @@ public:
};
virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) { return OK; }
+ virtual Ref<Texture> get_run_icon() const { return get_logo(); }
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;
+ virtual void get_platform_features(List<String> *r_features) = 0;
EditorExportPlatform();
};
@@ -247,6 +265,7 @@ class EditorExportPlatformPC : public EditorExportPlatform {
Ref<ImageTexture> logo;
String name;
+ String os_name;
String extension;
String release_file_32;
@@ -254,12 +273,17 @@ class EditorExportPlatformPC : public EditorExportPlatform {
String debug_file_32;
String debug_file_64;
+ Set<String> extra_features;
+
+ bool use64;
+
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 String get_os_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;
@@ -268,14 +292,18 @@ public:
void set_extension(const String &p_extension);
void set_name(const String &p_name);
+ void set_os_name(const String &p_name);
- void set_logo(const Ref<Texture> &p_loco);
+ void set_logo(const Ref<Texture> &p_logo);
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);
+ void add_platform_feature(const String &p_feature);
+ virtual void get_platform_features(List<String> *r_features);
+
EditorExportPlatformPC();
};
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index bde0fd90cf..d572ee8724 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -94,11 +95,13 @@ void EditorFileDialog::_notification(int p_what) {
}
}
-void EditorFileDialog::_unhandled_input(const InputEvent &p_event) {
+void EditorFileDialog::_unhandled_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::KEY && is_window_modal_on_top()) {
+ Ref<InputEventKey> k = p_event;
- if (p_event.key.pressed) {
+ if (k.is_valid() && is_window_modal_on_top()) {
+
+ if (k->is_pressed()) {
bool handled = false;
@@ -487,8 +490,9 @@ void EditorFileDialog::update_file_list() {
if (!has_icon("ResizedFolder", "EditorIcons")) {
Ref<ImageTexture> folder = get_icon("FolderBig", "EditorIcons");
- Image img = folder->get_data();
- img.resize(thumbnail_size, thumbnail_size);
+ Ref<Image> img = folder->get_data();
+ img = img->duplicate();
+ img->resize(thumbnail_size, thumbnail_size);
Ref<ImageTexture> resized_folder = Ref<ImageTexture>(memnew(ImageTexture));
resized_folder->create_from_image(img, 0);
Theme::get_default()->set_icon("ResizedFolder", "EditorIcons", resized_folder);
@@ -498,8 +502,9 @@ void EditorFileDialog::update_file_list() {
if (!has_icon("ResizedFile", "EditorIcons")) {
Ref<ImageTexture> file = get_icon("FileBig", "EditorIcons");
- Image img = file->get_data();
- img.resize(thumbnail_size, thumbnail_size);
+ Ref<Image> img = file->get_data();
+ img = img->duplicate();
+ img->resize(thumbnail_size, thumbnail_size);
Ref<ImageTexture> resized_file = Ref<ImageTexture>(memnew(ImageTexture));
resized_file->create_from_image(img, 0);
Theme::get_default()->set_icon("ResizedFile", "EditorIcons", resized_file);
@@ -551,8 +556,8 @@ void EditorFileDialog::update_file_list() {
dirs.push_back("..");
}
- dirs.sort_custom<NoCaseComparator>();
- files.sort_custom<NoCaseComparator>();
+ dirs.sort_custom<NaturalNoCaseComparator>();
+ files.sort_custom<NaturalNoCaseComparator>();
while (!dirs.empty()) {
const String &dir_name = dirs.front()->get();
@@ -1149,7 +1154,7 @@ void EditorFileDialog::_bind_methods() {
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("get_vbox"), &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);
@@ -1295,16 +1300,21 @@ EditorFileDialog::EditorFileDialog() {
favorite->connect("toggled", this, "_favorite_toggled");
pathhb->add_child(favorite);
+ Ref<ButtonGroup> view_mode_group;
+ view_mode_group.instance();
+
mode_thumbnails = memnew(ToolButton);
mode_thumbnails->connect("pressed", this, "set_display_mode", varray(DISPLAY_THUMBNAILS));
mode_thumbnails->set_toggle_mode(true);
mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS);
+ mode_thumbnails->set_button_group(view_mode_group);
pathhb->add_child(mode_thumbnails);
mode_list = memnew(ToolButton);
mode_list->connect("pressed", this, "set_display_mode", varray(DISPLAY_LIST));
mode_list->set_toggle_mode(true);
mode_list->set_pressed(display_mode == DISPLAY_LIST);
+ mode_list->set_button_group(view_mode_group);
pathhb->add_child(mode_list);
drives = memnew(OptionButton);
@@ -1444,9 +1454,9 @@ void EditorLineEditFileChooser::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("get_button"), &EditorLineEditFileChooser::get_button);
+ ClassDB::bind_method(D_METHOD("get_line_edit"), &EditorLineEditFileChooser::get_line_edit);
+ ClassDB::bind_method(D_METHOD("get_file_dialog"), &EditorLineEditFileChooser::get_file_dialog);
}
void EditorLineEditFileChooser::_chosen(const String &p_text) {
diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h
index 21b764e85b..f44193c70b 100644
--- a/editor/editor_file_dialog.h
+++ b/editor/editor_file_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -168,7 +169,7 @@ private:
void _thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata);
void _request_single_thumbnail(const String &p_path);
- void _unhandled_input(const InputEvent &p_event);
+ void _unhandled_input(const Ref<InputEvent> &p_event);
protected:
void _notification(int p_what);
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index b188a5760b..2f4ac02703 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,12 +32,12 @@
#include "editor_node.h"
#include "editor_resource_preview.h"
#include "editor_settings.h"
-#include "global_config.h"
#include "io/resource_import.h"
#include "io/resource_loader.h"
#include "io/resource_saver.h"
#include "os/file_access.h"
#include "os/os.h"
+#include "project_settings.h"
#include "variant_parser.h"
EditorFileSystem *EditorFileSystem::singleton = NULL;
@@ -143,7 +144,7 @@ void EditorFileSystemDirectory::_bind_methods() {
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("get_parent"), &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);
}
@@ -152,6 +153,7 @@ EditorFileSystemDirectory::EditorFileSystemDirectory() {
modified_time = 0;
parent = NULL;
+ verified = false;
}
EditorFileSystemDirectory::~EditorFileSystemDirectory() {
@@ -177,7 +179,7 @@ void EditorFileSystem::_scan_filesystem() {
sources_changed.clear();
file_cache.clear();
- String project = GlobalConfig::get_singleton()->get_resource_path();
+ String project = ProjectSettings::get_singleton()->get_resource_path();
String fscache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("filesystem_cache2");
FileAccess *f = FileAccess::open(fscache, FileAccess::READ);
@@ -337,6 +339,7 @@ bool EditorFileSystem::_update_scan_actions() {
int idx = ia.dir->find_file_index(ia.file);
ERR_CONTINUE(idx == -1);
+ _delete_internal_files(ia.dir->files[idx]->file);
memdelete(ia.dir->files[idx]);
ia.dir->files.remove(idx);
@@ -508,7 +511,9 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess
if (f.begins_with(".")) //ignore hidden and . / ..
continue;
- if (FileAccess::exists(cd.plus_file(f).plus_file("godot.cfg"))) // skip if another project inside this
+ if (FileAccess::exists(cd.plus_file(f).plus_file("project.godot"))) // skip if another project inside this
+ continue;
+ if (FileAccess::exists(cd.plus_file(f).plus_file(".gdignore"))) // skip if another project inside this
continue;
dirs.push_back(f);
@@ -521,8 +526,8 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess
da->list_dir_end();
- dirs.sort();
- files.sort();
+ dirs.sort_custom<NaturalNoCaseComparator>();
+ files.sort_custom<NaturalNoCaseComparator>();
int total = dirs.size() + files.size();
int idx = 0;
@@ -594,6 +599,10 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess
fi->type = fc->type;
fi->modified_time = fc->modification_time;
fi->import_modified_time = fc->import_modification_time;
+ if (fc->type == String()) {
+ fi->type = ResourceLoader::get_resource_type(path);
+ //there is also the chance that file type changed due to reimport, must probably check this somehow here (or kind of note it for next time in another file?)
+ }
} else {
@@ -611,6 +620,7 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess
}
fi->type = ResourceFormatImporter::get_singleton()->get_resource_type(path);
+ print_line("import extension tried resource type for " + path + " and its " + fi->type);
fi->modified_time = 0;
fi->import_modified_time = 0;
@@ -629,6 +639,7 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess
fi->import_modified_time = 0;
} else {
fi->type = ResourceLoader::get_resource_type(path);
+ print_line("regular import tried resource type for " + path + " and its " + fi->type);
fi->modified_time = mt;
fi->import_modified_time = 0;
}
@@ -687,7 +698,9 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const
int idx = p_dir->find_dir_index(f);
if (idx == -1) {
- if (FileAccess::exists(cd.plus_file(f).plus_file("godot.cfg"))) // skip if another project inside this
+ if (FileAccess::exists(cd.plus_file(f).plus_file("project.godot"))) // skip if another project inside this
+ continue;
+ if (FileAccess::exists(cd.plus_file(f).plus_file(".gdignore"))) // skip if another project inside this
continue;
EditorFileSystemDirectory *efd = memnew(EditorFileSystemDirectory);
@@ -789,7 +802,7 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const
} else {
uint64_t import_mt = FileAccess::get_modified_time(path + ".import");
- print_line(itos(import_mt) + " vs " + itos(p_dir->files[i]->import_modified_time));
+ //print_line(itos(import_mt) + " vs " + itos(p_dir->files[i]->import_modified_time));
if (import_mt != p_dir->files[i]->import_modified_time) {
print_line("REIMPORT: import modified changed, reimport");
reimport = true;
@@ -826,6 +839,19 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const
}
}
+void EditorFileSystem::_delete_internal_files(String p_file) {
+ if (FileAccess::exists(p_file + ".import")) {
+ List<String> paths;
+ ResourceFormatImporter::get_singleton()->get_internal_resource_path_list(p_file, &paths);
+ DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ for (List<String>::Element *E = paths.front(); E; E = E->next()) {
+ da->remove(E->get());
+ }
+ da->remove(p_file + ".import");
+ memdelete(da);
+ }
+}
+
void EditorFileSystem::_thread_func_sources(void *_userdata) {
EditorFileSystem *efs = (EditorFileSystem *)_userdata;
@@ -1006,7 +1032,7 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector
if (!filesystem || scanning)
return false;
- String f = GlobalConfig::get_singleton()->localize_path(p_file);
+ String f = ProjectSettings::get_singleton()->localize_path(p_file);
if (!f.begins_with("res://"))
return false;
@@ -1039,7 +1065,10 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector
if (idx == -1) {
//does not exist, create i guess?
EditorFileSystemDirectory *efsd = memnew(EditorFileSystemDirectory);
+
efsd->name = path[i];
+ efsd->parent = fs;
+
int idx2 = 0;
for (int j = 0; j < fs->get_subdir_count(); j++) {
@@ -1116,7 +1145,7 @@ EditorFileSystemDirectory *EditorFileSystem::get_filesystem_path(const String &p
if (!filesystem || scanning)
return NULL;
- String f = GlobalConfig::get_singleton()->localize_path(p_path);
+ String f = ProjectSettings::get_singleton()->localize_path(p_path);
if (!f.begins_with("res://"))
return NULL;
@@ -1177,6 +1206,7 @@ void EditorFileSystem::update_file(const String &p_file) {
if (!FileAccess::exists(p_file)) {
//was removed
+ _delete_internal_files(p_file);
memdelete(fs->files[cpos]);
fs->files.remove(cpos);
call_deferred("emit_signal", "filesystem_changed"); //update later
@@ -1234,7 +1264,7 @@ void EditorFileSystem::_reimport_file(const String &p_file) {
String importer_name;
if (FileAccess::exists(p_file + ".import")) {
-
+ //use existing
Ref<ConfigFile> cf;
cf.instance();
Error err = cf->load(p_file + ".import");
@@ -1249,6 +1279,7 @@ void EditorFileSystem::_reimport_file(const String &p_file) {
}
Ref<ResourceImporter> importer;
+ bool load_default = false;
//find the importer
if (importer_name != "") {
importer = ResourceFormatImporter::get_singleton()->get_importer_by_name(importer_name);
@@ -1257,6 +1288,7 @@ void EditorFileSystem::_reimport_file(const String &p_file) {
if (importer.is_null()) {
//not found by name, find by extension
importer = ResourceFormatImporter::get_singleton()->get_importer_by_extension(p_file.get_extension());
+ load_default = true;
if (importer.is_null()) {
ERR_PRINT("BUG: File queued for import, but can't be imported!");
ERR_FAIL();
@@ -1273,6 +1305,17 @@ void EditorFileSystem::_reimport_file(const String &p_file) {
}
}
+ if (load_default && ProjectSettings::get_singleton()->get("importer_defaults/" + importer->get_importer_name())) {
+ //use defaults if exist
+ Dictionary d = ProjectSettings::get_singleton()->get("importer_defaults/" + importer->get_importer_name());
+ List<Variant> v;
+ d.get_key_list(&v);
+
+ for (List<Variant>::Element *E = v.front(); E; E = E->next()) {
+ params[E->get()] = d[E->get()];
+ }
+ }
+
//finally, perform import!!
String base_path = ResourceFormatImporter::get_singleton()->get_import_base_path(p_file);
@@ -1330,7 +1373,7 @@ void EditorFileSystem::_reimport_file(const String &p_file) {
f->store_line("[params]");
f->store_line("");
- //store options in provided order, to avoid file changing
+ //store options in provided order, to avoid file changing. Order is also important because first match is accepted first.
for (List<ResourceImporter::ImportOption>::Element *E = opts.front(); E; E = E->next()) {
@@ -1381,13 +1424,13 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
void EditorFileSystem::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_filesystem:EditorFileSystemDirectory"), &EditorFileSystem::get_filesystem);
+ ClassDB::bind_method(D_METHOD("get_filesystem"), &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_filesystem_path", "path"), &EditorFileSystem::get_filesystem_path);
ClassDB::bind_method(D_METHOD("get_file_type", "path"), &EditorFileSystem::get_file_type);
ADD_SIGNAL(MethodInfo("filesystem_changed"));
@@ -1420,6 +1463,7 @@ EditorFileSystem::EditorFileSystem() {
singleton = this;
filesystem = memnew(EditorFileSystemDirectory); //like, empty
+ filesystem->parent = NULL;
thread = NULL;
scanning = false;
@@ -1428,7 +1472,9 @@ EditorFileSystem::EditorFileSystem() {
thread_sources = NULL;
new_filesystem = NULL;
+ abort_scan = false;
scanning_changes = false;
+ scanning_changes_done = false;
ResourceSaver::set_save_callback(_resource_saved);
DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h
index da78ba9cfb..f98758fd03 100644
--- a/editor/editor_file_system.h
+++ b/editor/editor_file_system.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -167,7 +168,7 @@ class EditorFileSystem : public Node {
void _scan_fs_changes(EditorFileSystemDirectory *p_dir, const ScanProgress &p_progress);
- int md_count;
+ void _delete_internal_files(String p_file);
Set<String> valid_extensions;
Set<String> import_extensions;
diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp
index 8bfacb4a26..4a85b4e2ef 100644
--- a/editor/editor_fonts.cpp
+++ b/editor/editor_fonts.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,7 +29,7 @@
/*************************************************************************/
#include "editor_fonts.h"
-#include "builtin_fonts.h"
+#include "builtin_fonts.gen.h"
#include "doc_code_font.h"
#include "doc_font.h"
#include "doc_title_font.h"
@@ -48,8 +49,8 @@ static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_valign, int p
int chr = c[0];
Rect2 frect;
- frect.pos.x = c[1];
- frect.pos.y = c[2];
+ frect.position.x = c[1];
+ frect.position.y = c[2];
frect.size.x = c[3];
frect.size.y = c[4];
Point2 align(c[5], c[6] + p_valign);
diff --git a/editor/editor_fonts.h b/editor/editor_fonts.h
index 0e8ce20609..1698093cca 100644
--- a/editor/editor_fonts.h
+++ b/editor/editor_fonts.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 3b2f187af5..8b1f558c0a 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,14 +29,15 @@
/*************************************************************************/
#include "editor_help.h"
-#include "doc_data_compressed.h"
+#include "doc_data_compressed.gen.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor_node.h"
#include "editor_settings.h"
#include "os/keyboard.h"
void EditorHelpSearch::popup() {
- popup_centered_ratio(0.6);
+
+ popup_centered(Size2(700, 600) * EDSCALE);
if (search_box->get_text() != "") {
search_box->select_all();
_update_search();
@@ -45,7 +47,7 @@ void EditorHelpSearch::popup() {
void EditorHelpSearch::popup(const String &p_term) {
- popup_centered_ratio(0.6);
+ popup_centered(Size2(700, 600) * EDSCALE);
if (p_term != "") {
search_box->set_text(p_term);
search_box->select_all();
@@ -60,14 +62,16 @@ void EditorHelpSearch::_text_changed(const String &p_newtext) {
_update_search();
}
-void EditorHelpSearch::_sbox_input(const InputEvent &p_ie) {
+void EditorHelpSearch::_sbox_input(const Ref<InputEvent> &p_ie) {
+
+ Ref<InputEventKey> k = p_ie;
- if (p_ie.type == InputEvent::KEY && (p_ie.key.scancode == KEY_UP ||
- p_ie.key.scancode == KEY_DOWN ||
- p_ie.key.scancode == KEY_PAGEUP ||
- p_ie.key.scancode == KEY_PAGEDOWN)) {
+ if (k.is_valid() && (k->get_scancode() == KEY_UP ||
+ k->get_scancode() == KEY_DOWN ||
+ k->get_scancode() == KEY_PAGEUP ||
+ k->get_scancode() == KEY_PAGEDOWN)) {
- search_options->call("_gui_input", p_ie);
+ search_options->call("_gui_input", k);
search_box->accept_event();
}
}
@@ -249,8 +253,8 @@ void EditorHelpSearch::_confirmed() {
return;
String mdata = ti->get_metadata(0);
+ EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);
emit_signal("go_to_help", mdata);
- editor->call("_editor_select", EditorNode::EDITOR_SCRIPT); // in case EditorHelpSearch beeen invoked on top of other editor window
// go to that
hide();
}
@@ -259,6 +263,8 @@ void EditorHelpSearch::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
+ search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
+
connect("confirmed", this, "_confirmed");
_update_search();
}
@@ -285,18 +291,12 @@ void EditorHelpSearch::_bind_methods() {
EditorHelpSearch::EditorHelpSearch() {
- editor = EditorNode::get_singleton();
VBoxContainer *vbc = memnew(VBoxContainer);
add_child(vbc);
HBoxContainer *sb_hb = memnew(HBoxContainer);
search_box = memnew(LineEdit);
- sb_hb->add_child(search_box);
- search_box->set_h_size_flags(SIZE_EXPAND_FILL);
- Button *sb = memnew(Button(TTR("Search")));
- sb->connect("pressed", this, "_update_search");
- sb_hb->add_child(sb);
- vbc->add_margin_child(TTR("Search:"), sb_hb);
+ vbc->add_child(search_box);
search_box->connect("text_changed", this, "_text_changed");
search_box->connect("gui_input", this, "_sbox_input");
search_options = memnew(Tree);
@@ -359,8 +359,8 @@ void EditorHelpIndex::_tree_item_selected() {
if (!s)
return;
+ EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);
emit_signal("open_class", s->get_text(0));
-
hide();
//_goto_desc(s->get_text(0));
@@ -376,7 +376,7 @@ void EditorHelpIndex::select_class(const String &p_class) {
void EditorHelpIndex::popup() {
- popup_centered_ratio(0.6);
+ popup_centered(Size2(500, 600) * EDSCALE);
search_box->set_text("");
_update_class_list();
@@ -386,6 +386,7 @@ void EditorHelpIndex::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
+ search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
_update_class_list();
connect("confirmed", this, "_tree_item_selected");
@@ -447,14 +448,16 @@ void EditorHelpIndex::_update_class_list() {
}
}
-void EditorHelpIndex::_sbox_input(const InputEvent &p_ie) {
+void EditorHelpIndex::_sbox_input(const Ref<InputEvent> &p_ie) {
- if (p_ie.type == InputEvent::KEY && (p_ie.key.scancode == KEY_UP ||
- p_ie.key.scancode == KEY_DOWN ||
- p_ie.key.scancode == KEY_PAGEUP ||
- p_ie.key.scancode == KEY_PAGEDOWN)) {
+ Ref<InputEventKey> k = p_ie;
- class_list->call("_gui_input", p_ie);
+ if (k.is_valid() && (k->get_scancode() == KEY_UP ||
+ k->get_scancode() == KEY_DOWN ||
+ k->get_scancode() == KEY_PAGEUP ||
+ k->get_scancode() == KEY_PAGEDOWN)) {
+
+ class_list->call("_gui_input", k);
search_box->accept_event();
}
}
@@ -474,7 +477,7 @@ EditorHelpIndex::EditorHelpIndex() {
add_child(vbc);
search_box = memnew(LineEdit);
- vbc->add_margin_child(TTR("Search:"), search_box);
+ vbc->add_child(search_box);
search_box->set_h_size_flags(SIZE_EXPAND_FILL);
register_text_enter(search_box);
@@ -498,11 +501,14 @@ EditorHelpIndex::EditorHelpIndex() {
/// /////////////////////////////////
DocData *EditorHelp::doc = NULL;
-void EditorHelp::_unhandled_key_input(const InputEvent &p_ev) {
+void EditorHelp::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
if (!is_visible_in_tree())
return;
- if (p_ev.key.mod.control && p_ev.key.scancode == KEY_F) {
+
+ Ref<InputEventKey> k = p_ev;
+
+ if (k.is_valid() && k->get_control() && k->get_scancode() == KEY_F) {
search->grab_focus();
search->select_all();
@@ -597,8 +603,11 @@ void EditorHelp::_class_desc_select(const String &p_select) {
}
}
-void EditorHelp::_class_desc_input(const InputEvent &p_input) {
- if (p_input.type == InputEvent::MOUSE_BUTTON && p_input.mouse_button.pressed && p_input.mouse_button.button_index == 1) {
+void EditorHelp::_class_desc_input(const Ref<InputEvent> &p_input) {
+
+ Ref<InputEventMouseButton> mb = p_input;
+
+ if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == 1) {
class_desc->set_selection_enabled(false);
class_desc->set_selection_enabled(true);
}
@@ -1268,7 +1277,7 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
void EditorHelp::_request_help(const String &p_string) {
Error err = _goto_desc(p_string);
if (err == OK) {
- editor->call("_editor_select", EditorNode::EDITOR_SCRIPT);
+ EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);
}
//100 palabras
}
@@ -1612,12 +1621,18 @@ void EditorHelp::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
-
//forward->set_icon(get_icon("Forward","EditorIcons"));
//back->set_icon(get_icon("Back","EditorIcons"));
_update_doc();
+ } break;
+ case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+ Ref<StyleBoxFlat> style(memnew(StyleBoxFlat));
+ style->set_bg_color(EditorSettings::get_singleton()->get("text_editor/highlighting/background_color"));
+ background_panel->add_style_override("panel", style);
} break;
+
+ default: break;
}
}
@@ -1678,8 +1693,6 @@ void EditorHelp::_bind_methods() {
EditorHelp::EditorHelp() {
- editor = EditorNode::get_singleton();
-
VBoxContainer *vbc = this;
EDITOR_DEF("text_editor/help/sort_functions_alphabetically", true);
@@ -1688,14 +1701,14 @@ EditorHelp::EditorHelp() {
//class_list->set_selection_enabled(true);
{
- Panel *pc = memnew(Panel);
+ background_panel = memnew(Panel);
Ref<StyleBoxFlat> style(memnew(StyleBoxFlat));
style->set_bg_color(EditorSettings::get_singleton()->get("text_editor/highlighting/background_color"));
- pc->set_v_size_flags(SIZE_EXPAND_FILL);
- pc->add_style_override("panel", style); //get_stylebox("normal","TextEdit"));
- vbc->add_child(pc);
+ background_panel->set_v_size_flags(SIZE_EXPAND_FILL);
+ background_panel->add_style_override("panel", style); //get_stylebox("normal","TextEdit"));
+ vbc->add_child(background_panel);
class_desc = memnew(RichTextLabel);
- pc->add_child(class_desc);
+ background_panel->add_child(class_desc);
class_desc->set_area_as_parent_rect(8);
class_desc->connect("meta_clicked", this, "_class_desc_select");
class_desc->connect("gui_input", this, "_class_desc_input");
@@ -1774,8 +1787,8 @@ void EditorHelpBit::_bind_methods() {
void EditorHelpBit::_notification(int p_what) {
- if (p_what == NOTIFICATION_ENTER_TREE) {
- add_style_override("panel", get_stylebox("normal", "TextEdit"));
+ if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+ add_style_override("panel", get_stylebox("ScriptPanel", "EditorStyles"));
}
}
@@ -1792,4 +1805,5 @@ EditorHelpBit::EditorHelpBit() {
rich_text->set_area_as_parent_rect(8 * EDSCALE);
rich_text->connect("meta_clicked", this, "_meta_clicked");
set_custom_minimum_size(Size2(0, 70 * EDSCALE));
+ add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles"));
}
diff --git a/editor/editor_help.h b/editor/editor_help.h
index 06b64edf78..e0d68605ab 100644
--- a/editor/editor_help.h
+++ b/editor/editor_help.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -48,14 +49,13 @@ class EditorHelpSearch : public ConfirmationDialog {
GDCLASS(EditorHelpSearch, ConfirmationDialog)
- EditorNode *editor;
LineEdit *search_box;
Tree *search_options;
String base_type;
void _update_search();
- void _sbox_input(const InputEvent &p_ie);
+ void _sbox_input(const Ref<InputEvent> &p_ie);
void _confirmed();
void _text_changed(const String &p_newtext);
@@ -80,7 +80,7 @@ class EditorHelpIndex : public ConfirmationDialog {
void _tree_item_selected();
void _text_changed(const String &p_text);
- void _sbox_input(const InputEvent &p_ie);
+ void _sbox_input(const Ref<InputEvent> &p_ie);
void _update_class_list();
@@ -118,7 +118,6 @@ class EditorHelp : public VBoxContainer {
String edited_class;
- EditorNode *editor;
Map<String, int> method_line;
Map<String, int> signal_line;
Map<String, int> property_line;
@@ -130,6 +129,7 @@ class EditorHelp : public VBoxContainer {
HSplitContainer *h_split;
static DocData *doc;
+ Panel *background_panel;
ConfirmationDialog *search_dialog;
LineEdit *search;
@@ -137,7 +137,7 @@ class EditorHelp : public VBoxContainer {
void _help_callback(const String &p_topic);
- void _add_text(const String &p_text);
+ void _add_text(const String &p_bbcode);
bool scroll_locked;
//void _button_pressed(int p_idx);
@@ -146,7 +146,7 @@ class EditorHelp : public VBoxContainer {
void _scroll_changed(double p_scroll);
void _class_list_select(const String &p_select);
void _class_desc_select(const String &p_select);
- void _class_desc_input(const InputEvent &p_input);
+ void _class_desc_input(const Ref<InputEvent> &p_input);
Error _goto_desc(const String &p_class, int p_vscr = -1);
//void _update_history_buttons();
@@ -156,7 +156,7 @@ class EditorHelp : public VBoxContainer {
void _search(const String &p_str);
void _search_cbk();
- void _unhandled_key_input(const InputEvent &p_ev);
+ void _unhandled_key_input(const Ref<InputEvent> &p_ev);
protected:
void _notification(int p_what);
@@ -189,7 +189,7 @@ class EditorHelpBit : public Panel {
RichTextLabel *rich_text;
void _go_to_help(String p_what);
- void _meta_clicked(String p_what);
+ void _meta_clicked(String p_select);
protected:
static void _bind_methods();
diff --git a/editor/editor_icons.h b/editor/editor_icons.h
index 7e8d8c0828..760bb4421c 100644
--- a/editor/editor_icons.h
+++ b/editor/editor_icons.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_initialize_ssl.cpp b/editor/editor_initialize_ssl.cpp
index 7801b312b3..290ade277e 100644
--- a/editor/editor_initialize_ssl.cpp
+++ b/editor/editor_initialize_ssl.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,7 +29,7 @@
/*************************************************************************/
#include "editor_initialize_ssl.h"
-#include "certs_compressed.h"
+#include "certs_compressed.gen.h"
#include "io/compression.h"
#include "io/stream_peer_ssl.h"
diff --git a/editor/editor_initialize_ssl.h b/editor/editor_initialize_ssl.h
index 0b34ac1d7e..fb289f5dfd 100644
--- a/editor/editor_initialize_ssl.h
+++ b/editor/editor_initialize_ssl.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp
index 60837d900e..c5e15b97b0 100644
--- a/editor/editor_log.cpp
+++ b/editor/editor_log.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,7 +36,7 @@
void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type) {
EditorLog *self = (EditorLog *)p_self;
- if (self->current != Thread::get_caller_ID())
+ if (self->current != Thread::get_caller_id())
return;
String err_str;
@@ -51,31 +52,6 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f
*/
err_str = " " + err_str;
- self->log->add_newline();
-
- Ref<Texture> icon;
-
- switch (p_type) {
- case ERR_HANDLER_ERROR: {
-
- icon = self->get_icon("Error", "EditorIcons");
- return; // these are confusing
- } break;
- case ERR_HANDLER_WARNING: {
-
- icon = self->get_icon("Error", "EditorIcons");
-
- } break;
- case ERR_HANDLER_SCRIPT: {
-
- icon = self->get_icon("ScriptError", "EditorIcons");
- } break;
- case ERR_HANDLER_SHADER: {
-
- icon = self->get_icon("Shader", "EditorIcons");
- } break;
- }
-
self->add_message(err_str, true);
}
@@ -86,6 +62,9 @@ void EditorLog::_notification(int p_what) {
log->add_color_override("default_color", get_color("font_color", "Tree"));
//button->set_icon(get_icon("Console","EditorIcons"));
}
+ if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+ _override_logger_styles();
+ }
/*if (p_what==NOTIFICATION_DRAW) {
@@ -110,16 +89,16 @@ void EditorLog::clear() {
void EditorLog::add_message(const String &p_msg, bool p_error) {
+ log->add_newline();
if (p_error) {
+ log->push_color(get_color("fg_error", "Editor"));
Ref<Texture> icon = get_icon("Error", "EditorIcons");
log->add_image(icon);
//button->set_icon(icon);
- log->push_color(get_color("fg_error", "Editor"));
} else {
//button->set_icon(Ref<Texture>());
}
- log->add_newline();
log->add_text(p_msg);
//button->set_text(p_msg);
@@ -164,15 +143,10 @@ EditorLog::EditorLog() {
HBoxContainer *hb = memnew(HBoxContainer);
vb->add_child(hb);
title = memnew(Label);
- title->set_text(TTR(" Output:"));
+ title->set_text(TTR("Output:"));
title->set_h_size_flags(SIZE_EXPAND_FILL);
hb->add_child(title);
- //pd = memnew( PaneDrag );
- //hb->add_child(pd);
- //pd->connect("dragged",this,"_dragged");
- //pd->set_default_cursor_shape(Control::CURSOR_MOVE);
-
clearbutton = memnew(Button);
hb->add_child(clearbutton);
clearbutton->set_text(TTR("Clear"));
@@ -180,7 +154,7 @@ EditorLog::EditorLog() {
ec = memnew(Control);
vb->add_child(ec);
- ec->set_custom_minimum_size(Size2(0, 180));
+ ec->set_custom_minimum_size(Size2(0, 180) * EDSCALE);
ec->set_v_size_flags(SIZE_EXPAND_FILL);
pc = memnew(PanelContainer);
@@ -200,7 +174,7 @@ EditorLog::EditorLog() {
eh.userdata = this;
add_error_handler(&eh);
- current = Thread::get_caller_ID();
+ current = Thread::get_caller_id();
EditorNode::get_undo_redo()->set_commit_notify_callback(_undo_redo_cbk, this);
}
diff --git a/editor/editor_log.h b/editor/editor_log.h
index 3debbfecd4..1c180df5f7 100644
--- a/editor/editor_log.h
+++ b/editor/editor_log.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_name_dialog.cpp b/editor/editor_name_dialog.cpp
index b8fa534ddb..74bb526ccc 100644
--- a/editor/editor_name_dialog.cpp
+++ b/editor/editor_name_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,16 +32,18 @@
#include "class_db.h"
#include "os/keyboard.h"
-void EditorNameDialog::_line_gui_input(const InputEvent &p_event) {
+void EditorNameDialog::_line_gui_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::KEY) {
+ Ref<InputEventKey> k = p_event;
- if (!p_event.key.pressed)
+ if (k.is_valid()) {
+
+ if (!k->is_pressed())
return;
- switch (p_event.key.scancode) {
- case KEY_ENTER:
- case KEY_RETURN: {
+ switch (k->get_scancode()) {
+ case KEY_KP_ENTER:
+ case KEY_ENTER: {
if (get_hide_on_ok())
hide();
@@ -78,11 +81,12 @@ void EditorNameDialog::_bind_methods() {
}
EditorNameDialog::EditorNameDialog() {
+ makevb = memnew(VBoxContainer);
+ add_child(makevb);
name = memnew(LineEdit);
- add_child(name);
- move_child(name, get_label()->get_index() + 1);
+ makevb->add_child(name);
name->set_margin(MARGIN_TOP, 5);
name->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5);
- name->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 5);
+ name->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -5);
name->connect("gui_input", this, "_line_gui_input");
}
diff --git a/editor/editor_name_dialog.h b/editor/editor_name_dialog.h
index 5b65abef84..57586951d1 100644
--- a/editor/editor_name_dialog.h
+++ b/editor/editor_name_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,9 +38,10 @@ class EditorNameDialog : public ConfirmationDialog {
GDCLASS(EditorNameDialog, ConfirmationDialog);
+ VBoxContainer *makevb;
LineEdit *name;
- void _line_gui_input(const InputEvent &p_event);
+ void _line_gui_input(const Ref<InputEvent> &p_event);
protected:
static void _bind_methods();
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 18c16af5af..242648d4a9 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,7 +38,6 @@
#include "editor_help.h"
#include "editor_settings.h"
#include "editor_themes.h"
-#include "global_config.h"
#include "io/config_file.h"
#include "io/stream_peer_ssl.h"
#include "io/zip_io.h"
@@ -49,6 +49,7 @@
#include "os/os.h"
#include "path_remap.h"
#include "print_string.h"
+#include "project_settings.h"
#include "pvrtc_compress.h"
#include "register_exporters.h"
#include "scene/resources/packed_scene.h"
@@ -71,9 +72,10 @@
#include "plugins/collision_polygon_2d_editor_plugin.h"
#include "plugins/collision_polygon_editor_plugin.h"
#include "plugins/collision_shape_2d_editor_plugin.h"
-#include "plugins/color_ramp_editor_plugin.h"
#include "plugins/cube_grid_theme_editor_plugin.h"
+#include "plugins/curve_editor_plugin.h"
#include "plugins/gi_probe_editor_plugin.h"
+#include "plugins/gradient_editor_plugin.h"
#include "plugins/item_list_editor_plugin.h"
#include "plugins/light_occluder_2d_editor_plugin.h"
#include "plugins/line_2d_editor_plugin.h"
@@ -108,6 +110,7 @@
// end
#include "editor_settings.h"
#include "import/editor_import_collada.h"
+#include "import/editor_scene_importer_gltf.h"
#include "io_plugins/editor_bitmask_import_plugin.h"
#include "io_plugins/editor_export_scene.h"
#include "io_plugins/editor_font_import_plugin.h"
@@ -159,7 +162,7 @@ void EditorNode::_update_scene_tabs() {
void EditorNode::_update_title() {
- String appname = GlobalConfig::get_singleton()->get("application/name");
+ String appname = ProjectSettings::get_singleton()->get("application/config/name");
String title = appname.empty() ? String(VERSION_FULL_NAME) : String(_MKSTR(VERSION_NAME) + String(" - ") + appname);
String edited = editor_data.get_edited_scene_root() ? editor_data.get_edited_scene_root()->get_filename() : String();
if (!edited.empty())
@@ -170,12 +173,13 @@ void EditorNode::_update_title() {
OS::get_singleton()->set_window_title(title);
}
-void EditorNode::_unhandled_input(const InputEvent &p_event) {
+void EditorNode::_unhandled_input(const Ref<InputEvent> &p_event) {
if (Node::get_viewport()->get_modal_stack_top())
return; //ignore because of modal window
- if (p_event.type == InputEvent::KEY && p_event.key.pressed && !p_event.key.echo && !gui_base->get_viewport()->gui_has_modal_stack()) {
+ Ref<InputEventKey> k = p_event;
+ if (k.is_valid() && k->is_pressed() && !k->is_echo() && !gui_base->get_viewport()->gui_has_modal_stack()) {
if (ED_IS_SHORTCUT("editor/next_tab", p_event)) {
int next_tab = editor_data.get_edited_scene() + 1;
@@ -191,28 +195,20 @@ void EditorNode::_unhandled_input(const InputEvent &p_event) {
filesystem_dock->focus_on_filter();
}
- switch (p_event.key.scancode) {
-
- /*case KEY_F1:
- if (!p_event.key.mod.shift && !p_event.key.mod.command)
- _editor_select(EDITOR_SCRIPT);
- break;*/
- case KEY_F1:
- if (!p_event.key.mod.shift && !p_event.key.mod.command)
- _editor_select(EDITOR_2D);
- break;
- case KEY_F2:
- if (!p_event.key.mod.shift && !p_event.key.mod.command)
- _editor_select(EDITOR_3D);
- break;
- case KEY_F3:
- if (!p_event.key.mod.shift && !p_event.key.mod.command)
- _editor_select(EDITOR_SCRIPT);
- break;
- /* case KEY_F5: _menu_option_confirm((p_event.key.mod.control&&p_event.key.mod.shift)?RUN_PLAY_CUSTOM_SCENE:RUN_PLAY,true); break;
- case KEY_F6: _menu_option_confirm(RUN_PLAY_SCENE,true); break;
- //case KEY_F7: _menu_option_confirm(RUN_PAUSE,true); break;
- case KEY_F8: _menu_option_confirm(RUN_STOP,true); break;*/
+ if (ED_IS_SHORTCUT("editor/editor_2d", p_event)) {
+ _editor_select(EDITOR_2D);
+ } else if (ED_IS_SHORTCUT("editor/editor_3d", p_event)) {
+ _editor_select(EDITOR_3D);
+ } else if (ED_IS_SHORTCUT("editor/editor_script", p_event)) {
+ _editor_select(EDITOR_SCRIPT);
+ } else if (ED_IS_SHORTCUT("editor/editor_help", p_event)) {
+ emit_signal("request_help_search", "");
+ } else if (ED_IS_SHORTCUT("editor/editor_assetlib", p_event)) {
+ _editor_select(EDITOR_ASSETLIB);
+ } else if (ED_IS_SHORTCUT("editor/editor_next", p_event)) {
+ _editor_select_next();
+ } else if (ED_IS_SHORTCUT("editor/editor_prev", p_event)) {
+ _editor_select_prev();
}
}
}
@@ -233,7 +229,7 @@ void EditorNode::_notification(int p_what) {
Rect2 grect = scene_root_base->get_global_rect();
Rect2 grectsrp = scene_root_parent->get_global_rect();
if (grect!=grectsrp) {
- scene_root_parent->set_pos(grect.pos);
+ scene_root_parent->set_position(grect.pos);
scene_root_parent->set_size(grect.size);
}
}
@@ -273,28 +269,9 @@ void EditorNode::_notification(int p_what) {
update_menu->set_icon(gui_base->get_icon("Progress" + itos(circle_step + 1), "EditorIcons"));
}
}
-
editor_selection->update();
- {
- uint32_t p32 = 0; //AudioServer::get_singleton()->read_output_peak()>>8;
-
- float peak = p32 == 0 ? -80 : Math::linear2db(p32 / 65535.0);
-
- if (peak < -80)
- peak = -80;
- float vu = audio_vu->get_value();
-
- if (peak > vu) {
- audio_vu->set_value(peak);
- } else {
- float new_vu = vu - get_process_delta_time() * 70.0;
- if (new_vu < -80)
- new_vu = -80;
- if (new_vu != -80 && vu != -80)
- audio_vu->set_value(new_vu);
- }
- }
+ scene_root->set_size_override(true, Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height")));
ResourceImporterTexture::get_singleton()->update_imports();
}
@@ -353,10 +330,25 @@ void EditorNode::_notification(int p_what) {
if (p_what == MainLoop::NOTIFICATION_WM_QUIT_REQUEST) {
_menu_option_confirm(FILE_QUIT, false);
- };
+ }
if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
scene_tabs->set_tab_close_display_policy((bool(EDITOR_DEF("interface/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY));
+ property_editor->set_enable_capitalize_paths(bool(EDITOR_DEF("interface/capitalize_properties", true)));
+ Ref<Theme> theme = create_editor_theme();
+ theme_base->set_theme(theme);
+ gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles"));
+ play_button_panel->add_style_override("panel", gui_base->get_stylebox("PlayButtonPanel", "EditorStyles"));
+ scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles"));
+ bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer"));
+ scene_tabs->add_style_override("tab_fg", gui_base->get_stylebox("SceneTabFG", "EditorStyles"));
+ scene_tabs->add_style_override("tab_bg", gui_base->get_stylebox("SceneTabBG", "EditorStyles"));
+ if (bool(EDITOR_DEF("interface/scene_tabs/resize_if_many_tabs", true))) {
+ scene_tabs->set_min_width(int(EDITOR_DEF("interface/scene_tabs/minimum_width", 50)) * EDSCALE);
+ } else {
+ scene_tabs->set_min_width(0);
+ }
+ _update_scene_tabs();
}
}
@@ -372,10 +364,28 @@ void EditorNode::_fs_changed() {
E->get()->invalidate();
}
- if (export_defer.platform != "") {
+ if (export_defer.preset != "") {
+ Ref<EditorExportPreset> preset;
+ for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); ++i) {
+ preset = EditorExport::get_singleton()->get_export_preset(i);
+ if (preset->get_name() == export_defer.preset) {
+ break;
+ }
+ }
+ if (preset.is_null()) {
+ String err = "Unknown export preset: " + export_defer.preset;
+ ERR_PRINT(err.utf8().get_data());
+ } else {
+ Ref<EditorExportPlatform> platform = preset->get_platform();
+ if (platform.is_null()) {
+ String err = "Preset \"" + export_defer.preset + "\" doesn't have a platform.";
+ ERR_PRINT(err.utf8().get_data());
+ } else {
+ platform->export_project(preset, export_defer.debug, export_defer.path, /*p_flags*/ 0);
+ }
+ }
- //project_export_settings->export_platform(export_defer.platform,export_defer.path,export_defer.debug,export_defer.password,true);
- export_defer.platform = "";
+ export_defer.preset = "";
}
{
@@ -424,6 +434,8 @@ void EditorNode::_fs_changed() {
}
}
}
+
+ _mark_unsaved_scenes();
}
void EditorNode::_sources_changed(bool p_exist) {
@@ -432,7 +444,7 @@ void EditorNode::_sources_changed(bool p_exist) {
if (defer_load_scene != "") {
- print_line("loading scene DEFERED");
+ print_line("loading scene DEFERRED");
load_scene(defer_load_scene);
defer_load_scene = "";
}
@@ -444,24 +456,36 @@ void EditorNode::_sources_changed(bool p_exist) {
void EditorNode::_vp_resized() {
}
-void EditorNode::_rebuild_import_menu() {
- PopupMenu *p = import_menu->get_popup();
- p->clear();
-//p->add_item(TTR("Node From Scene"), FILE_IMPORT_SUBSCENE);
-//p->add_separator();
-#if 0
- for (int i = 0; i < editor_import_export->get_import_plugin_count(); i++) {
- p->add_item(editor_import_export->get_import_plugin(i)->get_visible_name(), IMPORT_PLUGIN_BASE + i);
- }
-#endif
-}
-
void EditorNode::_node_renamed() {
if (property_editor)
property_editor->update_tree();
}
+void EditorNode::_editor_select_next() {
+
+ int editor = _get_current_main_editor();
+
+ if (editor == editor_table.size() - 1) {
+ editor = 0;
+ } else {
+ editor++;
+ }
+ _editor_select(editor);
+}
+
+void EditorNode::_editor_select_prev() {
+
+ int editor = _get_current_main_editor();
+
+ if (editor == 0) {
+ editor = editor_table.size() - 1;
+ } else {
+ editor--;
+ }
+ _editor_select(editor);
+}
+
Error EditorNode::load_resource(const String &p_scene) {
RES res = ResourceLoader::load(p_scene);
@@ -512,7 +536,7 @@ void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const St
flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
*/
- String path = GlobalConfig::get_singleton()->localize_path(p_path);
+ String path = ProjectSettings::get_singleton()->localize_path(p_path);
Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS);
if (err != OK) {
@@ -695,34 +719,34 @@ void EditorNode::_set_scene_metadata(const String &p_file, int p_idx) {
ERR_FAIL_COND(err != OK);
}
-bool EditorNode::_find_and_save_resource(RES res, Map<RES, bool> &processed, int32_t flags) {
+bool EditorNode::_find_and_save_resource(RES p_res, Map<RES, bool> &processed, int32_t flags) {
- if (res.is_null())
+ if (p_res.is_null())
return false;
- if (processed.has(res)) {
+ if (processed.has(p_res)) {
- return processed[res];
+ return processed[p_res];
}
- bool changed = res->is_edited();
- res->set_edited(false);
+ bool changed = p_res->is_edited();
+ p_res->set_edited(false);
- bool subchanged = _find_and_save_edited_subresources(res.ptr(), processed, flags);
+ bool subchanged = _find_and_save_edited_subresources(p_res.ptr(), processed, flags);
- //print_line("checking if edited: "+res->get_type()+" :: "+res->get_name()+" :: "+res->get_path()+" :: "+itos(changed)+" :: SR "+itos(subchanged));
+ //print_line("checking if edited: "+p_res->get_type()+" :: "+p_res->get_name()+" :: "+p_res->get_path()+" :: "+itos(changed)+" :: SR "+itos(subchanged));
- if (res->get_path().is_resource_file()) {
+ if (p_res->get_path().is_resource_file()) {
if (changed || subchanged) {
//save
- print_line("Also saving modified external resource: " + res->get_path());
- ResourceSaver::save(res->get_path(), res, flags);
+ print_line("Also saving modified external resource: " + p_res->get_path());
+ ResourceSaver::save(p_res->get_path(), p_res, flags);
}
- processed[res] = false; //because it's a file
+ processed[p_res] = false; //because it's a file
return false;
} else {
- processed[res] = changed;
+ processed[p_res] = changed;
return changed;
}
}
@@ -828,56 +852,54 @@ void EditorNode::_save_scene_with_preview(String p_file) {
}
save.step(TTR("Creating Thumbnail"), 1);
//current view?
- int screen = -1;
- for (int i = 0; i < editor_table.size(); i++) {
- if (editor_plugin_screen == editor_table[i]) {
- screen = i;
- break;
- }
+
+ Ref<Image> img;
+ if (is2d) {
+ img = scene_root->get_texture()->get_data();
+ } else {
+ img = SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data();
}
- _editor_select(is2d ? EDITOR_2D : EDITOR_3D);
+ if (img.is_valid()) {
+ save.step(TTR("Creating Thumbnail"), 2);
+ save.step(TTR("Creating Thumbnail"), 3);
- save.step(TTR("Creating Thumbnail"), 2);
- save.step(TTR("Creating Thumbnail"), 3);
-#if 0
- Image img = VS::get_singleton()->viewport_texture(scree_capture(viewport);
- int preview_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
- preview_size*=EDSCALE;
- int width,height;
- if (img.get_width() > preview_size && img.get_width() >= img.get_height()) {
+ int preview_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
+ preview_size *= EDSCALE;
+ int width, height;
+ if (img->get_width() > preview_size && img->get_width() >= img->get_height()) {
- width=preview_size;
- height = img.get_height() * preview_size / img.get_width();
- } else if (img.get_height() > preview_size && img.get_height() >= img.get_width()) {
+ width = preview_size;
+ height = img->get_height() * preview_size / img->get_width();
+ } else if (img->get_height() > preview_size && img->get_height() >= img->get_width()) {
- height=preview_size;
- width = img.get_width() * preview_size / img.get_height();
- } else {
+ height = preview_size;
+ width = img->get_width() * preview_size / img->get_height();
+ } else {
- width=img.get_width();
- height=img.get_height();
- }
+ width = img->get_width();
+ height = img->get_height();
+ }
- img.convert(Image::FORMAT_RGB8);
- img.resize(width,height);
+ img->convert(Image::FORMAT_RGB8);
+ img->resize(width, height);
+ img->flip_y();
- String pfile = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/last_scene_preview.png");
- img.save_png(pfile);
- Vector<uint8_t> imgdata = FileAccess::get_file_as_array(pfile);
+ //save thumbnail directly, as thumbnailer may not update due to actual scene not changing md5
+ String temp_path = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp");
+ String cache_base = ProjectSettings::get_singleton()->globalize_path(p_file).md5_text();
+ cache_base = temp_path.plus_file("resthumb-" + cache_base);
- //print_line("img data is "+itos(imgdata.size()));
+ //does not have it, try to load a cached thumbnail
- if (editor_data.get_edited_scene_import_metadata().is_null())
- editor_data.set_edited_scene_import_metadata(Ref<ResourceImportMetadata>( memnew( ResourceImportMetadata ) ) );
- editor_data.get_edited_scene_import_metadata()->set_option("thumbnail",imgdata);
-#endif
- //tamanio tel thumbnail
- if (screen != -1) {
- _editor_select(screen);
+ String file = cache_base + ".png";
+
+ img->save_png(file);
}
+
save.step(TTR("Saving Scene"), 4);
_save_scene(p_file);
+ EditorResourcePreview::get_singleton()->check_for_invalidation(p_file);
}
void EditorNode::_save_scene(String p_file, int idx) {
@@ -895,6 +917,7 @@ void EditorNode::_save_scene(String p_file, int idx) {
}
editor_data.apply_changes_in_editors();
+ _save_default_environment();
_set_scene_metadata(p_file, idx);
@@ -944,7 +967,7 @@ void EditorNode::_save_scene(String p_file, int idx) {
_save_edited_subresources(scene, processed, flg);
editor_data.save_editor_external_data();
if (err == OK) {
- scene->set_filename(GlobalConfig::get_singleton()->localize_path(p_file));
+ scene->set_filename(ProjectSettings::get_singleton()->localize_path(p_file));
//EditorFileSystem::get_singleton()->update_file(p_file,sdata->get_type());
if (idx < 0 || idx == editor_data.get_edited_scene())
set_current_version(editor_data.get_undo_redo().get_version());
@@ -956,7 +979,47 @@ void EditorNode::_save_scene(String p_file, int idx) {
_dialog_display_file_error(p_file, err);
}
-};
+}
+
+void EditorNode::_save_all_scenes() {
+
+ for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
+ Node *scene = editor_data.get_edited_scene_root(i);
+ if (scene && scene->get_filename() != "") {
+ // save in background if in the script editor
+ if (i != editor_data.get_edited_scene() || _get_current_main_editor() == EDITOR_SCRIPT) {
+ _save_scene(scene->get_filename(), i);
+ } else {
+ _save_scene_with_preview(scene->get_filename());
+ }
+ } // else: ignore new scenes
+ }
+
+ _save_default_environment();
+}
+
+void EditorNode::_mark_unsaved_scenes() {
+
+ for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
+
+ Node *node = editor_data.get_edited_scene_root(i);
+ if (!node)
+ continue;
+
+ String path = node->get_filename();
+ if (!(path == String() || FileAccess::exists(path))) {
+
+ node->set_filename("");
+ if (i == editor_data.get_edited_scene())
+ set_current_version(-1);
+ else
+ editor_data.set_edited_scene_version(-1, i);
+ }
+ }
+
+ _update_title();
+ _update_scene_tabs();
+}
void EditorNode::_import_action(const String &p_action) {
#if 0
@@ -983,7 +1046,7 @@ void EditorNode::_import_action(const String &p_action) {
EditorImport::generate_version_hashes(src);
- Node *dst = SceneLoader::load(editor_data.get_imported_scene(GlobalConfig::get_singleton()->localize_path(_tmp_import_path)));
+ Node *dst = SceneLoader::load(editor_data.get_imported_scene(ProjectSettings::get_singleton()->localize_path(_tmp_import_path)));
if (!dst) {
@@ -1086,9 +1149,10 @@ void EditorNode::_dialog_action(String p_file) {
} break;
case SETTINGS_PICK_MAIN_SCENE: {
- GlobalConfig::get_singleton()->set("application/main_scene", p_file);
- GlobalConfig::get_singleton()->save();
- //would be nice to show the project manager opened with the hilighted field..
+ ProjectSettings::get_singleton()->set("application/run/main_scene", p_file);
+ ProjectSettings::get_singleton()->save();
+ //would be nice to show the project manager opened with the highlighted field..
+ _run(false, ""); // automatically run the project
} break;
case FILE_SAVE_OPTIMIZED: {
@@ -1113,13 +1177,26 @@ void EditorNode::_dialog_action(String p_file) {
get_undo_redo()->clear_history();
} break;
+ case FILE_CLOSE:
+ case FILE_CLOSE_ALL_AND_QUIT:
+ case FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER:
+ case SCENE_TAB_CLOSE:
case FILE_SAVE_SCENE:
case FILE_SAVE_AS_SCENE: {
+ int scene_idx = (current_option == FILE_SAVE_SCENE || current_option == FILE_SAVE_AS_SCENE) ? -1 : tab_closing;
+
if (file->get_mode() == EditorFileDialog::MODE_SAVE_FILE) {
//_save_scene(p_file);
- _save_scene_with_preview(p_file);
+ _save_default_environment();
+ if (scene_idx != editor_data.get_edited_scene() || _get_current_main_editor() == EDITOR_SCRIPT)
+ _save_scene(p_file, scene_idx);
+ else
+ _save_scene_with_preview(p_file);
+
+ if (scene_idx != -1)
+ _discard_changes();
}
} break;
@@ -1128,6 +1205,7 @@ void EditorNode::_dialog_action(String p_file) {
if (file->get_mode() == EditorFileDialog::MODE_SAVE_FILE) {
//_save_scene(p_file);
+ _save_default_environment();
_save_scene_with_preview(p_file);
_call_build();
_run(true);
@@ -1154,7 +1232,7 @@ void EditorNode::_dialog_action(String p_file) {
ml = Ref<MeshLibrary>(memnew(MeshLibrary));
}
- //MeshLibraryEditor::update_library_file(editor_data.get_edited_scene_root(),ml,true);
+ MeshLibraryEditor::update_library_file(editor_data.get_edited_scene_root(), ml, true);
Error err = ResourceSaver::save(p_file, ml);
if (err) {
@@ -1225,7 +1303,7 @@ void EditorNode::_dialog_action(String p_file) {
Ref<ConfigFile> config;
config.instance();
- Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
+ Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts-3.cfg"));
if (err == ERR_CANT_OPEN) {
config.instance(); // new config
@@ -1236,7 +1314,7 @@ void EditorNode::_dialog_action(String p_file) {
_save_docks_to_config(config, p_file);
- config->save(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
+ config->save(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts-3.cfg"));
layout_dialog->hide();
_update_layouts_menu();
@@ -1253,7 +1331,7 @@ void EditorNode::_dialog_action(String p_file) {
Ref<ConfigFile> config;
config.instance();
- Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
+ Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts-3.cfg"));
if (err != OK || !config->has_section(p_file)) {
show_warning(TTR("Layout name not found!"));
@@ -1267,7 +1345,7 @@ void EditorNode::_dialog_action(String p_file) {
config->set_value(p_file, E->get(), Variant());
}
- config->save(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
+ config->save(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts-3.cfg"));
layout_dialog->hide();
_update_layouts_menu();
@@ -1298,7 +1376,7 @@ void EditorNode::push_item(Object *p_object, const String &p_property) {
return;
}
- uint32_t id = p_object->get_instance_ID();
+ uint32_t id = p_object->get_instance_id();
if (id != editor_history.get_current()) {
if (p_property == "")
@@ -1381,6 +1459,17 @@ void EditorNode::_property_editor_back() {
_edit_current();
}
+void EditorNode::_save_default_environment() {
+
+ Ref<Environment> fallback = get_tree()->get_root()->get_world()->get_fallback_environment();
+
+ if (fallback.is_valid() && fallback->get_path().is_resource_file()) {
+ Map<RES, bool> processed;
+ _find_and_save_edited_subresources(fallback.ptr(), processed, 0);
+ save_resource_in_path(fallback, fallback->get_path());
+ }
+}
+
void EditorNode::_imported(Node *p_node) {
/*
@@ -1451,7 +1540,7 @@ void EditorNode::_edit_current() {
property_editor->edit(current_res);
node_dock->set_node(NULL);
object_menu->set_disabled(false);
-
+ EditorNode::get_singleton()->get_import_dock()->set_edit_path(current_res->get_path());
//resources_dock->add_resource(Ref<Resource>(current_res));
//top_pallete->set_current_tab(1);
@@ -1459,11 +1548,16 @@ void EditorNode::_edit_current() {
Node *current_node = current_obj->cast_to<Node>();
ERR_FAIL_COND(!current_node);
- ERR_FAIL_COND(!current_node->is_inside_tree());
+ // ERR_FAIL_COND(!current_node->is_inside_tree());
property_editor->edit(current_node);
- node_dock->set_node(current_node);
- scene_tree_dock->set_selected(current_node);
+ if (current_node->is_inside_tree()) {
+ node_dock->set_node(current_node);
+ scene_tree_dock->set_selected(current_node);
+ } else {
+ node_dock->set_node(NULL);
+ scene_tree_dock->set_selected(NULL);
+ }
object_menu->get_popup()->clear();
//top_pallete->set_current_tab(0);
@@ -1498,6 +1592,11 @@ void EditorNode::_edit_current() {
editor_plugin_screen->make_visible(true);
+ int plugin_count = editor_data.get_editor_plugin_count();
+ for (int i = 0; i < plugin_count; i++) {
+ editor_data.get_editor_plugin(i)->notify_main_screen_changed(editor_plugin_screen->get_name());
+ }
+
for (int i = 0; i < editor_table.size(); i++) {
main_editor_buttons[i]->set_pressed(editor_table[i] == main_plugin);
@@ -1551,7 +1650,7 @@ void EditorNode::_edit_current() {
p->add_separator();
p->add_shortcut(ED_SHORTCUT("property_editor/make_subresources_unique", TTR("Make Sub-Resources Unique")), OBJECT_UNIQUE_RESOURCES);
p->add_separator();
- p->add_icon_shortcut(gui_base->get_icon("Help", "EditorIcons"), ED_SHORTCUT("property_editor/open_help", TTR("Open in Help")), OBJECT_REQUEST_HELP);
+ p->add_icon_shortcut(gui_base->get_icon("HelpSearch", "EditorIcons"), ED_SHORTCUT("property_editor/open_help", TTR("Open in Help")), OBJECT_REQUEST_HELP);
}
List<MethodInfo> methods;
@@ -1654,12 +1753,12 @@ void EditorNode::_run(bool p_current, const String &p_custom) {
if (run_filename == "") {
//evidently, run the scene
- main_scene = GLOBAL_DEF("application/main_scene", "");
+ main_scene = GLOBAL_DEF("application/run/main_scene", "");
if (main_scene == "") {
current_option = -1;
//accept->get_cancel()->hide();
- pick_main_scene->set_text(TTR("No main scene has ever been defined, select one?\nYou can change it later in later in \"Project Settings\" under the 'application' category."));
+ pick_main_scene->set_text(TTR("No main scene has ever been defined, select one?\nYou can change it later in \"Project Settings\" under the 'application' category."));
pick_main_scene->popup_centered_minsize();
return;
}
@@ -1720,7 +1819,7 @@ void EditorNode::_run(bool p_current, const String &p_custom) {
List<String> breakpoints;
editor_data.get_editor_breakpoints(&breakpoints);
- args = GlobalConfig::get_singleton()->get("editor/main_run_args");
+ args = ProjectSettings::get_singleton()->get("editor/main_run_args");
Error error = editor_run.run(run_filename, args, breakpoints);
@@ -1864,42 +1963,45 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
open_request(previous_scenes.back()->get());
} break;
+ case FILE_CLOSE_ALL_AND_QUIT:
+ case FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER:
case FILE_CLOSE: {
- if (!p_confirmed && unsaved_cache) {
- confirmation->get_ok()->set_text(TTR("Yes"));
- //confirmation->get_cancel()->show();
- confirmation->set_text(TTR("Close scene? (Unsaved changes will be lost)"));
- confirmation->popup_centered_minsize();
+ if (!p_confirmed && (unsaved_cache || p_option == FILE_CLOSE_ALL_AND_QUIT || p_option == FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER)) {
+ tab_closing = p_option == FILE_CLOSE ? editor_data.get_edited_scene() : _next_unsaved_scene(false);
+ String scene_filename = editor_data.get_edited_scene_root(tab_closing)->get_filename();
+ save_confirmation->get_ok()->set_text(TTR("Save & Close"));
+ save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene_filename != "" ? scene_filename : "unsaved scene"));
+ save_confirmation->popup_centered_minsize();
break;
}
-
- _remove_edited_scene();
-
- } break;
- case SCENE_TAB_CLOSE: {
- _remove_scene(tab_closing);
- _update_scene_tabs();
- current_option = -1;
- } break;
+ } // fallthrough
+ case SCENE_TAB_CLOSE:
case FILE_SAVE_SCENE: {
- Node *scene = editor_data.get_edited_scene_root();
+ int scene_idx = (p_option == FILE_SAVE_SCENE) ? -1 : tab_closing;
+
+ Node *scene = editor_data.get_edited_scene_root(scene_idx);
if (scene && scene->get_filename() != "") {
// save in background if in the script editor
- if (_get_current_main_editor() == EDITOR_SCRIPT) {
- _save_scene(scene->get_filename());
+ if (scene_idx != editor_data.get_edited_scene() || _get_current_main_editor() == EDITOR_SCRIPT) {
+ _save_scene(scene->get_filename(), scene_idx);
} else {
_save_scene_with_preview(scene->get_filename());
}
- return;
- };
+
+ if (scene_idx != -1)
+ _discard_changes();
+
+ break;
+ }
// fallthrough to save_as
};
case FILE_SAVE_AS_SCENE: {
+ int scene_idx = (p_option == FILE_SAVE_SCENE || p_option == FILE_SAVE_AS_SCENE) ? -1 : tab_closing;
- Node *scene = editor_data.get_edited_scene_root();
+ Node *scene = editor_data.get_edited_scene_root(scene_idx);
if (!scene) {
@@ -1935,7 +2037,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
String existing;
if (extensions.size()) {
- String root_name(get_edited_scene()->get_name());
+ String root_name(scene->get_name());
existing = root_name + "." + extensions.front()->get().to_lower();
}
file->set_current_path(existing);
@@ -1946,28 +2048,20 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
} break;
case FILE_SAVE_ALL_SCENES: {
- for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
- Node *scene = editor_data.get_edited_scene_root(i);
- if (scene && scene->get_filename() != "") {
- // save in background if in the script editor
- if (i != editor_data.get_edited_scene() || _get_current_main_editor() == EDITOR_SCRIPT) {
- _save_scene(scene->get_filename(), i);
- } else {
- _save_scene_with_preview(scene->get_filename());
- }
- } // else: ignore new scenes
- }
+
+ _save_all_scenes();
} break;
case FILE_SAVE_BEFORE_RUN: {
if (!p_confirmed) {
- accept->get_ok()->set_text(TTR("Yes"));
- accept->set_text(TTR("This scene has never been saved. Save before running?"));
- accept->popup_centered_minsize();
+ confirmation->get_cancel()->set_text(TTR("No"));
+ confirmation->get_ok()->set_text(TTR("Yes"));
+ confirmation->set_text(TTR("This scene has never been saved. Save before running?"));
+ confirmation->popup_centered_minsize();
break;
}
_menu_option(FILE_SAVE_AS_SCENE);
- _menu_option_confirm(FILE_SAVE_AND_RUN, true);
+ _menu_option_confirm(FILE_SAVE_AND_RUN, false);
} break;
case FILE_SAVE_OPTIMIZED: {
@@ -2074,22 +2168,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
} break;
- case FILE_QUIT: {
-
- if (!p_confirmed) {
-
- confirmation->get_ok()->set_text(TTR("Quit"));
- //confirmation->get_cancel()->show();
- confirmation->set_text(TTR("Exit the editor?"));
- confirmation->popup_centered(Size2(180, 70) * EDSCALE);
- break;
- }
-
- _menu_option_confirm(RUN_STOP, true);
- exiting = true;
- get_tree()->quit();
-
- } break;
case FILE_EXTERNAL_OPEN_SCENE: {
if (unsaved_cache && !p_confirmed) {
@@ -2208,7 +2286,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
}
instanced_scene->generate_instance_state();
- instanced_scene->set_filename( GlobalConfig::get_singleton()->localize_path(external_file) );
+ instanced_scene->set_filename( ProjectSettings::get_singleton()->localize_path(external_file) );
editor_data.get_undo_redo().create_action("Instance Scene");
editor_data.get_undo_redo().add_do_method(parent,"add_child",instanced_scene);
@@ -2390,6 +2468,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
} break;
case RUN_PLAY_SCENE: {
+
+ _save_default_environment();
_menu_option_confirm(RUN_STOP, true);
_call_build();
_run(true);
@@ -2416,54 +2496,77 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
project_settings->popup_project_settings();
} break;
+ case FILE_QUIT:
case RUN_PROJECT_MANAGER: {
if (!p_confirmed) {
- confirmation->get_ok()->set_text(TTR("Yes"));
- confirmation->set_text(TTR("Open Project Manager? \n(Unsaved changes will be lost)"));
- confirmation->popup_centered_minsize();
- break;
- }
+ bool save_each = EDITOR_DEF("interface/save_each_scene_on_quit", true);
+ if (_next_unsaved_scene(!save_each) == -1) {
- _menu_option_confirm(RUN_STOP, true);
- exiting = true;
- get_tree()->quit();
- String exec = OS::get_singleton()->get_executable_path();
+ bool confirm = EDITOR_DEF("interface/quit_confirmation", true);
+ if (confirm) {
- List<String> args;
- args.push_back("-path");
- args.push_back(exec.get_base_dir());
- args.push_back("-pm");
+ confirmation->get_ok()->set_text(p_option == FILE_QUIT ? TTR("Quit") : TTR("Yes"));
+ confirmation->set_text(p_option == FILE_QUIT ? TTR("Exit the editor?") : TTR("Open Project Manager?"));
+ confirmation->popup_centered_minsize();
+ } else {
+ _discard_changes();
+ break;
+ }
+ } else {
- OS::ProcessID pid = 0;
- Error err = OS::get_singleton()->execute(exec, args, false, &pid);
- ERR_FAIL_COND(err);
+ if (save_each) {
+
+ _menu_option_confirm(p_option == FILE_QUIT ? FILE_CLOSE_ALL_AND_QUIT : FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER, false);
+ } else {
+
+ String unsaved_scenes;
+ int i = _next_unsaved_scene(true, 0);
+ while (i != -1) {
+ unsaved_scenes += "\n " + editor_data.get_edited_scene_root(i)->get_filename();
+ i = _next_unsaved_scene(true, ++i);
+ }
+
+ save_confirmation->get_ok()->set_text(TTR("Save & Quit"));
+ save_confirmation->set_text((p_option == FILE_QUIT ? TTR("Save changes to the following scene(s) before quitting?") : TTR("Save changes the following scene(s) before opening Project Manager?")) + unsaved_scenes);
+ save_confirmation->popup_centered_minsize();
+ }
+ }
+
+ OS::get_singleton()->request_attention();
+ break;
+ }
+
+ if (_next_unsaved_scene(true) != -1) {
+ _save_all_scenes();
+ }
+ _discard_changes();
} break;
case RUN_FILE_SERVER: {
//file_server
- bool ischecked = debug_button->get_popup()->is_item_checked(debug_button->get_popup()->get_item_index(RUN_FILE_SERVER));
+ bool ischecked = debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(RUN_FILE_SERVER));
if (ischecked) {
file_server->stop();
run_native->set_deploy_dumb(false);
- //debug_button->set_icon(gui_base->get_icon("FileServer","EditorIcons"));
- //debug_button->get_popup()->set_item_text( debug_button->get_popup()->get_item_index(RUN_FILE_SERVER),"Enable File Server");
+ //debug_menu->set_icon(gui_base->get_icon("FileServer","EditorIcons"));
+ //debug_menu->get_popup()->set_item_text( debug_menu->get_popup()->get_item_index(RUN_FILE_SERVER),"Enable File Server");
} else {
file_server->start();
run_native->set_deploy_dumb(true);
- //debug_button->set_icon(gui_base->get_icon("FileServerActive","EditorIcons"));
- //debug_button->get_popup()->set_item_text( debug_button->get_popup()->get_item_index(RUN_FILE_SERVER),"Disable File Server");
+ //debug_menu->set_icon(gui_base->get_icon("FileServerActive","EditorIcons"));
+ //debug_menu->get_popup()->set_item_text( debug_menu->get_popup()->get_item_index(RUN_FILE_SERVER),"Disable File Server");
}
- debug_button->get_popup()->set_item_checked(debug_button->get_popup()->get_item_index(RUN_FILE_SERVER), !ischecked);
+ debug_menu->get_popup()->set_item_checked(debug_menu->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: {
- bool ischecked = debug_button->get_popup()->is_item_checked(debug_button->get_popup()->get_item_index(RUN_LIVE_DEBUG));
+ bool ischecked = debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(RUN_LIVE_DEBUG));
- debug_button->get_popup()->set_item_checked(debug_button->get_popup()->get_item_index(RUN_LIVE_DEBUG), !ischecked);
+ debug_menu->get_popup()->set_item_checked(debug_menu->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);
@@ -2471,23 +2574,23 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
/*case RUN_DEPLOY_DUMB_CLIENTS: {
- bool ischecked = debug_button->get_popup()->is_item_checked( debug_button->get_popup()->get_item_index(RUN_DEPLOY_DUMB_CLIENTS));
- debug_button->get_popup()->set_item_checked( debug_button->get_popup()->get_item_index(RUN_DEPLOY_DUMB_CLIENTS),!ischecked);
+ bool ischecked = debug_menu->get_popup()->is_item_checked( debug_menu->get_popup()->get_item_index(RUN_DEPLOY_DUMB_CLIENTS));
+ debug_menu->get_popup()->set_item_checked( debug_menu->get_popup()->get_item_index(RUN_DEPLOY_DUMB_CLIENTS),!ischecked);
run_native->set_deploy_dumb(!ischecked);
} break;*/
case RUN_DEPLOY_REMOTE_DEBUG: {
- 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);
+ bool ischecked = debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(RUN_DEPLOY_REMOTE_DEBUG));
+ debug_menu->get_popup()->set_item_checked(debug_menu->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: {
- bool ischecked = debug_button->get_popup()->is_item_checked(debug_button->get_popup()->get_item_index(RUN_DEBUG_COLLISONS));
- debug_button->get_popup()->set_item_checked(debug_button->get_popup()->get_item_index(RUN_DEBUG_COLLISONS), !ischecked);
+ bool ischecked = debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(RUN_DEBUG_COLLISONS));
+ debug_menu->get_popup()->set_item_checked(debug_menu->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);
@@ -2495,8 +2598,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
} break;
case RUN_DEBUG_NAVIGATION: {
- bool ischecked = debug_button->get_popup()->is_item_checked(debug_button->get_popup()->get_item_index(RUN_DEBUG_NAVIGATION));
- debug_button->get_popup()->set_item_checked(debug_button->get_popup()->get_item_index(RUN_DEBUG_NAVIGATION), !ischecked);
+ bool ischecked = debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(RUN_DEBUG_NAVIGATION));
+ debug_menu->get_popup()->set_item_checked(debug_menu->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);
@@ -2504,8 +2607,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
} break;
case RUN_RELOAD_SCRIPTS: {
- bool ischecked = debug_button->get_popup()->is_item_checked(debug_button->get_popup()->get_item_index(RUN_RELOAD_SCRIPTS));
- debug_button->get_popup()->set_item_checked(debug_button->get_popup()->get_item_index(RUN_RELOAD_SCRIPTS), !ischecked);
+ bool ischecked = debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(RUN_RELOAD_SCRIPTS));
+ debug_menu->get_popup()->set_item_checked(debug_menu->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);
@@ -2567,9 +2670,26 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
file->popup_centered_ratio();
} break;
- case SETTINGS_ABOUT: {
-
- about->popup_centered_minsize(Size2(500, 130) * EDSCALE);
+ case HELP_CLASSES: {
+ emit_signal("request_help_index", "");
+ } break;
+ case HELP_SEARCH: {
+ emit_signal("request_help_search", "");
+ } break;
+ case HELP_DOCS: {
+ OS::get_singleton()->shell_open("http://docs.godotengine.org/");
+ } break;
+ case HELP_QA: {
+ OS::get_singleton()->shell_open("https://godotengine.org/qa/");
+ } break;
+ case HELP_ISSUES: {
+ OS::get_singleton()->shell_open("https://github.com/godotengine/godot/issues");
+ } break;
+ case HELP_COMMUNITY: {
+ OS::get_singleton()->shell_open("https://godotengine.org/community");
+ } break;
+ case HELP_ABOUT: {
+ about->popup_centered_minsize(Size2(780, 500) * EDSCALE);
} break;
case SOURCES_REIMPORT: {
@@ -2646,6 +2766,73 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
}
}
+int EditorNode::_next_unsaved_scene(bool p_valid_filename, int p_start) {
+
+ for (int i = p_start; i < editor_data.get_edited_scene_count(); i++) {
+
+ if (!editor_data.get_edited_scene_root(i))
+ continue;
+ int current = editor_data.get_edited_scene();
+ bool unsaved = (i == current) ? saved_version != editor_data.get_undo_redo().get_version() : editor_data.get_scene_version(i) != 0;
+ if (unsaved) {
+ String scene_filename = editor_data.get_edited_scene_root(i)->get_filename();
+ if (p_valid_filename && scene_filename.length() == 0)
+ continue;
+ return i;
+ }
+ }
+ return -1;
+}
+
+void EditorNode::_discard_changes(const String &p_str) {
+
+ switch (current_option) {
+
+ case FILE_CLOSE_ALL_AND_QUIT:
+ case FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER:
+ case FILE_CLOSE:
+ case SCENE_TAB_CLOSE: {
+
+ _remove_scene(tab_closing);
+ _update_scene_tabs();
+
+ if (current_option == FILE_CLOSE_ALL_AND_QUIT || current_option == FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER) {
+ if (_next_unsaved_scene(false) == -1) {
+ current_option = current_option == FILE_CLOSE_ALL_AND_QUIT ? FILE_QUIT : RUN_PROJECT_MANAGER;
+ _discard_changes();
+ } else {
+ _menu_option_confirm(current_option, false);
+ }
+ } else {
+ current_option = -1;
+ save_confirmation->hide();
+ }
+ } break;
+ case FILE_QUIT: {
+
+ _menu_option_confirm(RUN_STOP, true);
+ exiting = true;
+ get_tree()->quit();
+ } break;
+ case RUN_PROJECT_MANAGER: {
+
+ _menu_option_confirm(RUN_STOP, true);
+ exiting = true;
+ get_tree()->quit();
+ String exec = OS::get_singleton()->get_executable_path();
+
+ List<String> args;
+ args.push_back("-path");
+ args.push_back(exec.get_base_dir());
+ args.push_back("-pm");
+
+ OS::ProcessID pid = 0;
+ Error err = OS::get_singleton()->execute(exec, args, false, &pid);
+ ERR_FAIL_COND(err);
+ } break;
+ }
+}
+
void EditorNode::_update_debug_options() {
bool check_deploy_remote = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_deploy_remote_debug", false);
@@ -2697,6 +2884,19 @@ void EditorNode::_editor_select(int p_which) {
editor_plugin_screen = new_editor;
editor_plugin_screen->make_visible(true);
editor_plugin_screen->selected_notify();
+
+ int plugin_count = editor_data.get_editor_plugin_count();
+ for (int i = 0; i < plugin_count; i++) {
+ editor_data.get_editor_plugin(i)->notify_main_screen_changed(editor_plugin_screen->get_name());
+ }
+
+ if (EditorSettings::get_singleton()->get("interface/separate_distraction_mode")) {
+ if (p_which == EDITOR_SCRIPT) {
+ set_distraction_free_mode(script_distraction);
+ } else {
+ set_distraction_free_mode(scene_distraction);
+ }
+ }
}
void EditorNode::add_editor_plugin(EditorPlugin *p_editor) {
@@ -2707,6 +2907,8 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor) {
tb->set_toggle_mode(true);
tb->connect("pressed", singleton, "_editor_select", varray(singleton->main_editor_buttons.size()));
tb->set_text(p_editor->get_name());
+ tb->set_icon(p_editor->get_base_control()->get_icon(p_editor->get_name(), "EditorIcons"));
+ tb->set_name(p_editor->get_name());
singleton->main_editor_buttons.push_back(tb);
singleton->main_editor_button_vb->add_child(tb);
singleton->editor_table.push_back(p_editor);
@@ -2736,7 +2938,6 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor) {
}
}
- //singleton->main_editor_tabs->add_tab(p_editor->get_name());
singleton->editor_table.erase(p_editor);
}
p_editor->make_visible(false);
@@ -2758,9 +2959,9 @@ void EditorNode::_update_addon_config() {
}
if (enabled_addons.size() == 0) {
- GlobalConfig::get_singleton()->set("editor_plugins/enabled", Variant());
+ ProjectSettings::get_singleton()->set("editor_plugins/enabled", Variant());
} else {
- GlobalConfig::get_singleton()->set("editor_plugins/enabled", enabled_addons);
+ ProjectSettings::get_singleton()->set("editor_plugins/enabled", enabled_addons);
}
project_settings->queue_save();
@@ -2812,7 +3013,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled)
}
if (!script->is_tool()) {
- show_warning("Unable to load addon script from path: '" + path + "' Script is does not support tool mode.");
+ show_warning("Unable to load addon script from path: '" + path + "' Script is not in tool mode.");
return;
}
@@ -3101,7 +3302,7 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
if (p_clear_errors)
load_errors->clear();
- String lpath = GlobalConfig::get_singleton()->localize_path(p_scene);
+ String lpath = ProjectSettings::get_singleton()->localize_path(p_scene);
if (!lpath.begins_with("res://")) {
@@ -3389,7 +3590,7 @@ void EditorNode::animation_editor_make_visible(bool p_visible) {
#endif
void EditorNode::_add_to_recent_scenes(const String &p_scene) {
- String base = "_" + GlobalConfig::get_singleton()->get_resource_path().replace("\\", "::").replace("/", "::");
+ String base = "_" + ProjectSettings::get_singleton()->get_resource_path().replace("\\", "::").replace("/", "::");
Vector<String> rc = EDITOR_DEF(base + "/_recent_scenes", Array());
String name = p_scene;
name = name.replace("res://", "");
@@ -3406,21 +3607,12 @@ void EditorNode::_add_to_recent_scenes(const String &p_scene) {
void EditorNode::_open_recent_scene(int p_idx) {
- String base = "_" + GlobalConfig::get_singleton()->get_resource_path().replace("\\", "::").replace("/", "::");
+ String base = "_" + ProjectSettings::get_singleton()->get_resource_path().replace("\\", "::").replace("/", "::");
Vector<String> rc = EDITOR_DEF(base + "/_recent_scenes", Array());
ERR_FAIL_INDEX(p_idx, rc.size());
String path = "res://" + rc[p_idx];
-
- /*if (unsaved_cache) {
- _recent_scene=rc[p_idx];
- open_recent_confirmation->set_text("Discard current scene and open:\n'"+rc[p_idx]+"'");
- open_recent_confirmation->get_label()->set_align(Label::ALIGN_CENTER);
- open_recent_confirmation->popup_centered(Size2(400,100));
- return;
- }*/
-
load_scene(path);
}
@@ -3458,13 +3650,13 @@ void EditorNode::_save_optimized() {
}
- project_settings->add_remapped_path(GlobalConfig::get_singleton()->localize_path(get_edited_scene()->get_filename()),GlobalConfig::get_singleton()->localize_path(path),platform);
+ project_settings->add_remapped_path(ProjectSettings::get_singleton()->localize_path(get_edited_scene()->get_filename()),ProjectSettings::get_singleton()->localize_path(path),platform);
#endif
}
void EditorNode::_update_recent_scenes() {
- String base = "_" + GlobalConfig::get_singleton()->get_resource_path().replace("\\", "::").replace("/", "::");
+ String base = "_" + ProjectSettings::get_singleton()->get_resource_path().replace("\\", "::").replace("/", "::");
Vector<String> rc = EDITOR_DEF(base + "/_recent_scenes", Array());
recent_scenes->clear();
for (int i = 0; i < rc.size(); i++) {
@@ -3566,7 +3758,7 @@ bool EditorNode::is_scene_in_use(const String &p_path) {
void EditorNode::register_editor_types() {
ClassDB::register_class<EditorPlugin>();
- // ClassDB::register_class<EditorImportPlugin>();
+ ClassDB::register_class<EditorImportPlugin>();
// ClassDB::register_class<EditorExportPlugin>();
// ClassDB::register_class<EditorScenePostImport>();
ClassDB::register_class<EditorScript>();
@@ -3579,6 +3771,7 @@ void EditorNode::register_editor_types() {
ClassDB::register_class<EditorResourcePreviewGenerator>();
ClassDB::register_class<EditorFileSystem>();
ClassDB::register_class<EditorFileSystemDirectory>();
+ ClassDB::register_virtual_class<ScriptEditor>();
//ClassDB::register_type<EditorImporter>();
//ClassDB::register_type<EditorPostImport>();
@@ -3599,9 +3792,9 @@ void EditorNode::progress_add_task(const String &p_task, const String &p_label,
singleton->progress_dialog->add_task(p_task, p_label, p_steps);
}
-void EditorNode::progress_task_step(const String &p_task, const String &p_state, int p_step, bool p_force_redraw) {
+void EditorNode::progress_task_step(const String &p_task, const String &p_state, int p_step, bool p_force_refresh) {
- singleton->progress_dialog->task_step(p_task, p_state, p_step, p_force_redraw);
+ singleton->progress_dialog->task_step(p_task, p_state, p_step, p_force_refresh);
}
void EditorNode::progress_end_task(const String &p_task) {
@@ -3669,9 +3862,9 @@ void EditorNode::_editor_file_dialog_unregister(EditorFileDialog *p_dialog) {
Vector<EditorNodeInitCallback> EditorNode::_init_callbacks;
-Error EditorNode::export_platform(const String &p_platform, const String &p_path, bool p_debug, const String &p_password, bool p_quit_after) {
+Error EditorNode::export_preset(const String &preset, const String &p_path, bool p_debug, const String &p_password, bool p_quit_after) {
- export_defer.platform = p_platform;
+ export_defer.preset = preset;
export_defer.path = p_path;
export_defer.debug = p_debug;
export_defer.password = p_password;
@@ -3686,11 +3879,13 @@ void EditorNode::show_warning(const String &p_text, const String &p_title) {
warning->popup_centered_minsize();
}
-void EditorNode::_dock_select_input(const InputEvent &p_input) {
+void EditorNode::_dock_select_input(const Ref<InputEvent> &p_input) {
+
+ Ref<InputEventMouse> me = p_input;
- if (p_input.type == InputEvent::MOUSE_BUTTON || p_input.type == InputEvent::MOUSE_MOTION) {
+ if (me.is_valid()) {
- Vector2 point(p_input.mouse_motion.x, p_input.mouse_motion.y);
+ Vector2 point = me->get_position();
int nrect = -1;
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
@@ -3708,7 +3903,9 @@ void EditorNode::_dock_select_input(const InputEvent &p_input) {
if (nrect == -1)
return;
- if (p_input.type == InputEvent::MOUSE_BUTTON && p_input.mouse_button.button_index == 1 && p_input.mouse_button.pressed && dock_popup_selected != nrect) {
+ Ref<InputEventMouseButton> mb = me;
+
+ if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed() && dock_popup_selected != nrect) {
Control *dock = dock_slot[dock_popup_selected]->get_current_tab_control();
if (dock) {
dock_slot[dock_popup_selected]->remove_child(dock);
@@ -3798,7 +3995,7 @@ void EditorNode::_dock_select_draw() {
unusable.a = 0.1;
Rect2 unr(s.x * 2, 0, s.x * 2, s.y * 2);
- unr.pos += Vector2(2, 5);
+ unr.position += Vector2(2, 5);
unr.size -= Vector2(4, 7);
dock_select->draw_rect(unr, unusable);
@@ -3851,7 +4048,7 @@ void EditorNode::_dock_select_draw() {
Rect2 r(ofs, s);
dock_select_rect[i] = r;
- r.pos += Vector2(2, 5);
+ r.position += Vector2(2, 5);
r.size -= Vector2(4, 7);
if (i == dock_select_rect_over) {
@@ -4134,7 +4331,7 @@ void EditorNode::_update_layouts_menu() {
Ref<ConfigFile> config;
config.instance();
- Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
+ Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts-3.cfg"));
if (err != OK) {
return; //no config
}
@@ -4182,7 +4379,7 @@ void EditorNode::_layout_menu_option(int p_id) {
Ref<ConfigFile> config;
config.instance();
- Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
+ Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts-3.cfg"));
if (err != OK) {
return; //no config
}
@@ -4203,23 +4400,76 @@ void EditorNode::_scene_tab_script_edited(int p_tab) {
void EditorNode::_scene_tab_closed(int p_tab) {
current_option = SCENE_TAB_CLOSE;
tab_closing = p_tab;
+ Node *scene = editor_data.get_edited_scene_root(p_tab);
+ if (!scene) {
+ _discard_changes();
+ return;
+ }
bool unsaved = (p_tab == editor_data.get_edited_scene()) ?
saved_version != editor_data.get_undo_redo().get_version() :
editor_data.get_scene_version(p_tab) != 0;
if (unsaved) {
- confirmation->get_ok()->set_text(TTR("Yes"));
+ save_confirmation->get_ok()->set_text(TTR("Save & Close"));
+ save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene->get_filename() != "" ? scene->get_filename() : "unsaved scene"));
+ save_confirmation->popup_centered_minsize();
+ } else {
+ _discard_changes();
+ }
+}
- //confirmation->get_cancel()->show();
- confirmation->set_text(TTR("Close scene? (Unsaved changes will be lost)"));
- confirmation->popup_centered_minsize();
+void EditorNode::_scene_tab_hover(int p_tab) {
+ if (bool(EDITOR_DEF("interface/scene_tabs/show_thumbnail_on_hover", true)) == false) {
+ return;
+ }
+ int current_tab = scene_tabs->get_current_tab();
+
+ if (p_tab == current_tab || p_tab < 0) {
+ tab_preview_panel->hide();
} else {
- _remove_scene(p_tab);
- _update_scene_tabs();
+ String path = editor_data.get_scene_path(p_tab);
+ EditorResourcePreview::get_singleton()->queue_resource_preview(path, this, "_thumbnail_done", p_tab);
+ }
+}
+
+void EditorNode::_scene_tab_exit() {
+ tab_preview_panel->hide();
+}
+
+void EditorNode::_scene_tab_input(const Ref<InputEvent> &p_input) {
+ Ref<InputEventMouseButton> mb = p_input;
+
+ if (mb.is_valid()) {
+ if (scene_tabs->get_hovered_tab() >= 0) {
+ if (mb->get_button_index() == BUTTON_MIDDLE && mb->is_pressed()) {
+ _scene_tab_closed(scene_tabs->get_hovered_tab());
+ }
+ } else {
+ if ((mb->get_button_index() == BUTTON_LEFT && mb->is_doubleclick()) || (mb->get_button_index() == BUTTON_MIDDLE && mb->is_pressed())) {
+ _menu_option_confirm(FILE_NEW_SCENE, true);
+ }
+ }
+ }
+}
+
+void EditorNode::_reposition_active_tab(int idx_to) {
+ editor_data.move_edited_scene_to_index(idx_to);
+ _update_scene_tabs();
+}
+
+void EditorNode::_thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata) {
+ int p_tab = p_udata.operator signed int();
+ if (p_preview.is_valid()) {
+ Rect2 rect = scene_tabs->get_tab_rect(p_tab);
+ rect.position += scene_tabs->get_global_position();
+ tab_preview->set_texture(p_preview);
+ tab_preview_panel->set_position(rect.position + Vector2(0, rect.size.height));
+ tab_preview_panel->show();
}
}
void EditorNode::_scene_tab_changed(int p_tab) {
+ tab_preview_panel->hide();
//print_line("set current 1 ");
bool unsaved = (saved_version != editor_data.get_undo_redo().get_version());
@@ -4390,7 +4640,25 @@ bool EditorNode::get_docks_visible() const {
void EditorNode::_toggle_distraction_free_mode() {
- set_distraction_free_mode(distraction_free->is_pressed());
+ if (EditorSettings::get_singleton()->get("interface/separate_distraction_mode")) {
+ int screen = -1;
+ for (int i = 0; i < editor_table.size(); i++) {
+ if (editor_plugin_screen == editor_table[i]) {
+ screen = i;
+ break;
+ }
+ }
+
+ if (screen == EDITOR_SCRIPT) {
+ script_distraction = !script_distraction;
+ set_distraction_free_mode(script_distraction);
+ } else {
+ scene_distraction = !scene_distraction;
+ set_distraction_free_mode(scene_distraction);
+ }
+ } else {
+ set_distraction_free_mode(distraction_free->is_pressed());
+ }
}
void EditorNode::set_distraction_free_mode(bool p_enter) {
@@ -4445,8 +4713,9 @@ Variant EditorNode::drag_resource(const Ref<Resource> &p_res, Control *p_from) {
{
//todo make proper previews
Ref<ImageTexture> pic = gui_base->get_icon("FileBig", "EditorIcons");
- Image img = pic->get_data();
- img.resize(48, 48); //meh
+ Ref<Image> img = pic->get_data();
+ img = img->duplicate();
+ img->resize(48, 48); //meh
Ref<ImageTexture> resized_pic = Ref<ImageTexture>(memnew(ImageTexture));
resized_pic->create_from_image(img);
preview = resized_pic;
@@ -4466,7 +4735,7 @@ Variant EditorNode::drag_resource(const Ref<Resource> &p_res, Control *p_from) {
p_from->set_drag_preview(drag_control); //wait until it enters scene
- label->set_pos(Point2((preview->get_width() - label->get_minimum_size().width) / 2, preview->get_height()));
+ label->set_position(Point2((preview->get_width() - label->get_minimum_size().width) / 2, preview->get_height()));
Dictionary drag_data;
drag_data["type"] = "resource";
@@ -4656,13 +4925,19 @@ void EditorNode::dim_editor(bool p_dimming) {
static int dim_count = 0;
bool dim_ui = EditorSettings::get_singleton()->get("interface/dim_editor_on_dialog_popup");
if (p_dimming) {
- if (dim_ui && dim_count == 0)
- _start_dimming(true);
- dim_count++;
+ if (dim_ui) {
+ if (dim_count == 0) {
+ _start_dimming(true);
+ }
+ dim_count++;
+ }
} else {
- dim_count--;
- if (dim_count < 1)
+ if (dim_count == 1) {
_start_dimming(false);
+ dim_count = 0;
+ } else if (dim_ui && dim_count > 0) {
+ dim_count--;
+ }
}
}
@@ -4690,6 +4965,22 @@ void EditorNode::_dim_timeout() {
}
}
+void EditorNode::_check_gui_base_size() {
+ if (gui_base->get_size().width > 1200 * EDSCALE) {
+ for (int i = 0; i < singleton->main_editor_button_vb->get_child_count(); i++) {
+ ToolButton *btn = singleton->main_editor_button_vb->get_child(i)->cast_to<ToolButton>();
+ if (btn == singleton->distraction_free) continue;
+ btn->set_text(btn->get_name());
+ }
+ } else {
+ for (int i = 0; i < singleton->main_editor_button_vb->get_child_count(); i++) {
+ ToolButton *btn = singleton->main_editor_button_vb->get_child(i)->cast_to<ToolButton>();
+ if (btn == singleton->distraction_free) continue;
+ btn->set_text("");
+ }
+ }
+}
+
void EditorNode::open_export_template_manager() {
export_template_manager->popup_manager();
@@ -4751,9 +5042,15 @@ void EditorNode::_bind_methods() {
ClassDB::bind_method("set_current_version", &EditorNode::set_current_version);
ClassDB::bind_method("_scene_tab_changed", &EditorNode::_scene_tab_changed);
ClassDB::bind_method("_scene_tab_closed", &EditorNode::_scene_tab_closed);
+ ClassDB::bind_method("_scene_tab_hover", &EditorNode::_scene_tab_hover);
+ ClassDB::bind_method("_scene_tab_exit", &EditorNode::_scene_tab_exit);
+ ClassDB::bind_method("_scene_tab_input", &EditorNode::_scene_tab_input);
+ ClassDB::bind_method("_reposition_active_tab", &EditorNode::_reposition_active_tab);
+ ClassDB::bind_method("_thumbnail_done", &EditorNode::_thumbnail_done);
ClassDB::bind_method("_scene_tab_script_edited", &EditorNode::_scene_tab_script_edited);
ClassDB::bind_method("_set_main_scene_state", &EditorNode::_set_main_scene_state);
ClassDB::bind_method("_update_scene_tabs", &EditorNode::_update_scene_tabs);
+ ClassDB::bind_method("_discard_changes", &EditorNode::_discard_changes);
ClassDB::bind_method("_prepare_history", &EditorNode::_prepare_history);
ClassDB::bind_method("_select_history", &EditorNode::_select_history);
@@ -4772,11 +5069,14 @@ void EditorNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("_open_imported"), &EditorNode::_open_imported);
ClassDB::bind_method(D_METHOD("_inherit_imported"), &EditorNode::_inherit_imported);
ClassDB::bind_method(D_METHOD("_dim_timeout"), &EditorNode::_dim_timeout);
+ ClassDB::bind_method(D_METHOD("_check_gui_base_size"), &EditorNode::_check_gui_base_size);
ADD_SIGNAL(MethodInfo("play_pressed"));
ADD_SIGNAL(MethodInfo("pause_pressed"));
ADD_SIGNAL(MethodInfo("stop_pressed"));
ADD_SIGNAL(MethodInfo("request_help"));
+ ADD_SIGNAL(MethodInfo("request_help_search"));
+ ADD_SIGNAL(MethodInfo("request_help_index"));
ADD_SIGNAL(MethodInfo("script_add_function_request", PropertyInfo(Variant::OBJECT, "obj"), PropertyInfo(Variant::STRING, "function"), PropertyInfo(Variant::POOL_STRING_ARRAY, "args")));
ADD_SIGNAL(MethodInfo("resource_saved", PropertyInfo(Variant::OBJECT, "obj")));
}
@@ -4791,9 +5091,11 @@ EditorNode::EditorNode() {
Resource::_get_local_scene_func = _resource_get_edited_scene;
VisualServer::get_singleton()->textures_keep_original(true);
+ VisualServer::get_singleton()->set_debug_generate_wireframes(true);
EditorHelp::generate_doc(); //before any editor classes are crated
SceneState::set_disable_placeholders(true);
+ ResourceLoader::clear_translation_remaps(); //no remaps using during editor
editor_initialize_certificates(); //for asset sharing
InputDefault *id = Input::get_singleton()->cast_to<InputDefault>();
@@ -4814,6 +5116,9 @@ EditorNode::EditorNode() {
_initializing_addons = false;
docks_visible = true;
+ scene_distraction = false;
+ script_distraction = false;
+
FileAccess::set_backup_save(true);
TranslationServer::get_singleton()->set_enabled(false);
@@ -4859,10 +5164,6 @@ EditorNode::EditorNode() {
import_wav.instance();
ResourceFormatImporter::get_singleton()->add_importer(import_wav);
- Ref<ResourceImporterOBJ> import_obj;
- import_obj.instance();
- ResourceFormatImporter::get_singleton()->add_importer(import_obj);
-
Ref<ResourceImporterScene> import_scene;
import_scene.instance();
ResourceFormatImporter::get_singleton()->add_importer(import_scene);
@@ -4871,6 +5172,14 @@ EditorNode::EditorNode() {
Ref<EditorSceneImporterCollada> import_collada;
import_collada.instance();
import_scene->add_importer(import_collada);
+
+ Ref<EditorOBJImporter> import_obj;
+ import_obj.instance();
+ import_scene->add_importer(import_obj);
+
+ Ref<EditorSceneImporterGLTF> import_gltf;
+ import_gltf.instance();
+ import_scene->add_importer(import_gltf);
}
}
@@ -4901,17 +5210,19 @@ EditorNode::EditorNode() {
ClassDB::set_class_enabled("CollisionShape2D", true);
ClassDB::set_class_enabled("CollisionPolygon2D", true);
- Control *theme_base = memnew(Control);
+ theme_base = memnew(Control);
add_child(theme_base);
theme_base->set_area_as_parent_rect();
gui_base = memnew(Panel);
theme_base->add_child(gui_base);
gui_base->set_area_as_parent_rect();
+ gui_base->connect("item_rect_changed", this, "_check_gui_base_size");
Ref<Theme> theme = create_editor_theme();
theme_base->set_theme(theme);
gui_base->set_theme(create_custom_theme());
+ gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles"));
resource_preview = memnew(EditorResourcePreview);
add_child(resource_preview);
@@ -4926,29 +5237,11 @@ EditorNode::EditorNode() {
main_vbox = memnew(VBoxContainer);
gui_base->add_child(main_vbox);
main_vbox->set_area_as_parent_rect(8);
-
-#if 0
- PanelContainer *top_dark_panel = memnew( PanelContainer );
- Ref<StyleBoxTexture> top_dark_sb;
- top_dark_sb.instance();
- top_dark_sb->set_texture(theme->get_icon("PanelTop","EditorIcons"));
- for(int i=0;i<4;i++) {
- top_dark_sb->set_margin_size(Margin(i),3);
- top_dark_sb->set_default_margin(Margin(i),0);
- }
- top_dark_sb->set_expand_margin_size(MARGIN_LEFT,20);
- top_dark_sb->set_expand_margin_size(MARGIN_RIGHT,20);
-
- top_dark_panel->add_style_override("panel",top_dark_sb);
- VBoxContainer *top_dark_vb = memnew( VBoxContainer );
- main_vbox->add_child(top_dark_panel);
- top_dark_panel->add_child(top_dark_vb);
-#endif
+ main_vbox->set_margin(MARGIN_TOP, 5);
menu_hb = memnew(HBoxContainer);
main_vbox->add_child(menu_hb);
- //top_dark_vb->add_child(scene_tabs);
//left
left_l_hsplit = memnew(HSplitContainer);
main_vbox->add_child(left_l_hsplit);
@@ -5023,10 +5316,10 @@ EditorNode::EditorNode() {
main_hsplit->connect("dragged", this, "_dock_split_dragged");
right_hsplit->connect("dragged", this, "_dock_split_dragged");
- dock_select_popoup = memnew(PopupPanel);
- gui_base->add_child(dock_select_popoup);
+ dock_select_popup = memnew(PopupPanel);
+ gui_base->add_child(dock_select_popup);
VBoxContainer *dock_vb = memnew(VBoxContainer);
- dock_select_popoup->add_child(dock_vb);
+ dock_select_popup->add_child(dock_vb);
HBoxContainer *dock_hb = memnew(HBoxContainer);
dock_tab_move_left = memnew(ToolButton);
@@ -5053,18 +5346,15 @@ EditorNode::EditorNode() {
dock_select->set_v_size_flags(Control::SIZE_EXPAND_FILL);
dock_vb->add_child(dock_select);
- dock_select_popoup->set_as_minsize();
+ dock_select_popup->set_as_minsize();
dock_select_rect_over = -1;
dock_popup_selected = -1;
- //dock_select_popoup->set_(Size2(20,20));
-
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
dock_slot[i]->set_custom_minimum_size(Size2(230, 220) * EDSCALE);
dock_slot[i]->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- dock_slot[i]->set_popup(dock_select_popoup);
+ dock_slot[i]->set_popup(dock_select_popup);
dock_slot[i]->connect("pre_popup_pressed", this, "_dock_pre_popup", varray(i));
-
- //dock_slot[i]->set_tab_align(TabContainer::ALIGN_LEFT);
+ dock_slot[i]->set_tab_align(TabContainer::ALIGN_LEFT);
}
dock_drag_timer = memnew(Timer);
@@ -5083,22 +5373,50 @@ EditorNode::EditorNode() {
top_split->add_child(srt);
srt->add_constant_override("separation", 0);
- /* main_editor_tabs = memnew( Tabs );
- main_editor_tabs->connect("tab_changed",this,"_editor_select");
- main_editor_tabs->set_tab_close_display_policy(Tabs::SHOW_NEVER);
-*/
+ tab_preview_panel = memnew(Panel);
+ tab_preview_panel->set_size(Size2(100, 100) * EDSCALE);
+ tab_preview_panel->hide();
+ tab_preview_panel->set_self_modulate(Color(1, 1, 1, 0.7));
+ gui_base->add_child(tab_preview_panel);
+
+ tab_preview = memnew(TextureRect);
+ tab_preview->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED);
+ tab_preview->set_size(Size2(96, 96) * EDSCALE);
+ tab_preview->set_position(Point2(2, 2) * EDSCALE);
+ tab_preview_panel->add_child(tab_preview);
+
scene_tabs = memnew(Tabs);
+ scene_tabs->add_style_override("tab_fg", gui_base->get_stylebox("SceneTabFG", "EditorStyles"));
+ scene_tabs->add_style_override("tab_bg", gui_base->get_stylebox("SceneTabBG", "EditorStyles"));
scene_tabs->add_tab("unsaved");
- scene_tabs->set_tab_align(Tabs::ALIGN_CENTER);
+ scene_tabs->set_tab_align(Tabs::ALIGN_LEFT);
scene_tabs->set_tab_close_display_policy((bool(EDITOR_DEF("interface/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY));
+ scene_tabs->set_min_width(int(EDITOR_DEF("interface/scene_tabs/minimum_width", 50)) * EDSCALE);
scene_tabs->connect("tab_changed", this, "_scene_tab_changed");
scene_tabs->connect("right_button_pressed", this, "_scene_tab_script_edited");
scene_tabs->connect("tab_close", this, "_scene_tab_closed");
+ scene_tabs->connect("tab_hover", this, "_scene_tab_hover");
+ scene_tabs->connect("mouse_exited", this, "_scene_tab_exit");
+ scene_tabs->connect("gui_input", this, "_scene_tab_input");
+ scene_tabs->connect("reposition_active_tab_request", this, "_reposition_active_tab");
- srt->add_child(scene_tabs);
+ HBoxContainer *tabbar_container = memnew(HBoxContainer);
+ scene_tabs->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+
+ srt->add_child(tabbar_container);
+ tabbar_container->add_child(scene_tabs);
+ distraction_free = memnew(ToolButton);
+ tabbar_container->add_child(distraction_free);
+ distraction_free->set_shortcut(ED_SHORTCUT("editor/distraction_free_mode", TTR("Distraction Free Mode"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F11));
+ distraction_free->set_tooltip(TTR("Toggle distraction-free mode."));
+ distraction_free->connect("pressed", this, "_toggle_distraction_free_mode");
+ distraction_free->set_icon(gui_base->get_icon("DistractionFree", "EditorIcons"));
+ distraction_free->set_toggle_mode(true);
scene_root_parent = memnew(PanelContainer);
scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE);
+ scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles"));
+ // sc->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles"));
//Ref<StyleBox> sp = scene_root_parent->get_stylebox("panel","TabContainer");
//scene_root_parent->add_style_override("panel",sp);
@@ -5118,29 +5436,29 @@ EditorNode::EditorNode() {
VisualServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport_rid(), true);
scene_root->set_disable_input(true);
scene_root->set_as_audio_listener_2d(true);
- //scene_root->set_size_override(true,Size2(GlobalConfig::get_singleton()->get("display/width"),GlobalConfig::get_singleton()->get("display/height")));
+ //scene_root->set_size_override(true,Size2(ProjectSettings::get_singleton()->get("display/width"),ProjectSettings::get_singleton()->get("display/height")));
//scene_root->set_world_2d( Ref<World2D>( memnew( World2D )) );
viewport = memnew(VBoxContainer);
viewport->set_v_size_flags(Control::SIZE_EXPAND_FILL);
+ viewport->add_constant_override("separation", 0);
/*for(int i=0;i<4;i++) {
viewport->set_margin(Margin(i),sp->get_margin(Margin(i)));
}*/
scene_root_parent->add_child(viewport);
PanelContainer *top_region = memnew(PanelContainer);
- top_region->add_style_override("panel", gui_base->get_stylebox("hover", "Button"));
+ top_region->add_style_override("panel", gui_base->get_stylebox("MenuPanel", "EditorStyles"));
HBoxContainer *left_menu_hb = memnew(HBoxContainer);
top_region->add_child(left_menu_hb);
menu_hb->add_child(top_region);
- PopupMenu *p;
-
file_menu = memnew(MenuButton);
file_menu->set_text(TTR("Scene"));
//file_menu->set_icon(gui_base->get_icon("Save","EditorIcons"));
left_menu_hb->add_child(file_menu);
+ file_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles"));
prev_scene = memnew(ToolButton);
prev_scene->set_icon(gui_base->get_icon("PrevScene", "EditorIcons"));
@@ -5149,12 +5467,13 @@ EditorNode::EditorNode() {
//left_menu_hb->add_child( prev_scene );
prev_scene->connect("pressed", this, "_menu_option", make_binds(FILE_OPEN_PREV));
gui_base->add_child(prev_scene);
- prev_scene->set_pos(Point2(3, 24));
+ prev_scene->set_position(Point2(3, 24));
prev_scene->hide();
ED_SHORTCUT("editor/next_tab", TTR("Next tab"), KEY_MASK_CMD + KEY_TAB);
ED_SHORTCUT("editor/prev_tab", TTR("Previous tab"), KEY_MASK_CMD + KEY_MASK_SHIFT + KEY_TAB);
ED_SHORTCUT("editor/filter_files", TTR("Filter Files.."), KEY_MASK_ALT + KEY_MASK_CMD + KEY_P);
+ PopupMenu *p;
file_menu->set_tooltip(TTR("Operations with scene files."));
p = file_menu->get_popup();
@@ -5168,13 +5487,11 @@ EditorNode::EditorNode() {
p->add_separator();
p->add_shortcut(ED_SHORTCUT("editor/close_scene", TTR("Close Scene"), KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_W), FILE_CLOSE);
p->add_separator();
- //p->add_shortcut(ED_SHORTCUT("editor/save_scene",TTR("Close Goto Prev. Scene")),FILE_OPEN_PREV,KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_P);
p->add_submenu_item(TTR("Open Recent"), "RecentScenes", FILE_OPEN_RECENT);
p->add_separator();
p->add_shortcut(ED_SHORTCUT("editor/quick_open_scene", TTR("Quick Open Scene.."), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_O), FILE_QUICK_OPEN_SCENE);
p->add_shortcut(ED_SHORTCUT("editor/quick_open_script", TTR("Quick Open Script.."), KEY_MASK_ALT + KEY_MASK_CMD + KEY_O), FILE_QUICK_OPEN_SCRIPT);
p->add_separator();
-
PopupMenu *pm_export = memnew(PopupMenu);
pm_export->set_name("Export");
p->add_child(pm_export);
@@ -5188,18 +5505,7 @@ EditorNode::EditorNode() {
p->add_shortcut(ED_SHORTCUT("editor/undo", TTR("Undo"), KEY_MASK_CMD + KEY_Z), EDIT_UNDO, true);
p->add_shortcut(ED_SHORTCUT("editor/redo", TTR("Redo"), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_Z), EDIT_REDO, true);
p->add_separator();
- p->add_item(TTR("Run Script"), FILE_RUN_SCRIPT, KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_R);
- p->add_separator();
- p->add_item(TTR("Project Settings"), RUN_SETTINGS);
- p->add_separator();
p->add_item(TTR("Revert Scene"), EDIT_REVERT);
- p->add_separator();
-#ifdef OSX_ENABLED
- p->add_item(TTR("Quit to Project List"), RUN_PROJECT_MANAGER, KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_Q);
-#else
- p->add_item(TTR("Quit to Project List"), RUN_PROJECT_MANAGER, KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_Q);
-#endif
- p->add_item(TTR("Quit"), FILE_QUIT, KEY_MASK_CMD + KEY_Q);
recent_scenes = memnew(PopupMenu);
recent_scenes->set_name("RecentScenes");
@@ -5211,96 +5517,117 @@ EditorNode::EditorNode() {
sp->set_custom_minimum_size(Size2(30, 0) * EDSCALE);
menu_hb->add_child(sp);
}
+ p->add_separator();
+ p->add_item(TTR("Quit"), FILE_QUIT, KEY_MASK_CMD + KEY_Q);
- PanelContainer *editor_region = memnew(PanelContainer);
- editor_region->add_style_override("panel", gui_base->get_stylebox("hover", "Button"));
- main_editor_button_vb = memnew(HBoxContainer);
- editor_region->add_child(main_editor_button_vb);
- menu_hb->add_child(editor_region);
-
- distraction_free = memnew(ToolButton);
- main_editor_button_vb->add_child(distraction_free);
- distraction_free->set_shortcut(ED_SHORTCUT("editor/distraction_free_mode", TTR("Distraction Free Mode"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F11));
- distraction_free->connect("pressed", this, "_toggle_distraction_free_mode");
- distraction_free->set_icon(gui_base->get_icon("DistractionFree", "EditorIcons"));
- distraction_free->set_toggle_mode(true);
+ project_menu = memnew(MenuButton);
+ project_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools."));
+ project_menu->set_text(TTR("Project"));
+ project_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles"));
+ left_menu_hb->add_child(project_menu);
-//menu_hb->add_spacer();
-#if 0
- node_menu = memnew( MenuButton );
- node_menu->set_text("Node");
- node_menu->set_pos( Point2( 50,0) );
- menu_panel->add_child( node_menu );
-
- p=node_menu->get_popup();
- p->add_item("Create",NODE_CREATE);
- p->add_item("Instance",NODE_INSTANCE);
- p->add_separator();
- p->add_item("Reparent",NODE_REPARENT);
- p->add_item("Move Up",NODE_MOVE_UP);
- p->add_item("Move Down",NODE_MOVE_DOWN);
- p->add_separator();
- p->add_item("Duplicate",NODE_DUPLICATE);
+ p = project_menu->get_popup();
+ p->add_item(TTR("Project Settings"), RUN_SETTINGS);
p->add_separator();
- p->add_item("Remove (Branch)",NODE_REMOVE_BRANCH);
- p->add_item("Remove (Element)",NODE_REMOVE_ELEMENT);
+ p->connect("id_pressed", this, "_menu_option");
+ p->add_item(TTR("Run Script"), FILE_RUN_SCRIPT, KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_R);
+ p->add_item(TTR("Export"), FILE_EXPORT_PROJECT);
+
+ PopupMenu *tool_menu = memnew(PopupMenu);
+ tool_menu->set_name("Tools");
+ tool_menu->connect("id_pressed", this, "_menu_option");
+ p->add_child(tool_menu);
+ p->add_submenu_item(TTR("Tools"), "Tools");
+ tool_menu->add_item(TTR("Orphan Resource Explorer"), TOOLS_ORPHAN_RESOURCES);
p->add_separator();
- p->add_item("Edit Subscriptions..",NODE_CONNECTIONS);
- p->add_item("Edit Groups..",NODE_GROUPS);
- resource_menu = memnew( MenuButton );
- resource_menu->set_text("Resource");
- resource_menu->set_pos( Point2( 90,0) );
- menu_panel->add_child( resource_menu );
+#ifdef OSX_ENABLED
+ p->add_item(TTR("Quit to Project List"), RUN_PROJECT_MANAGER, KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_Q);
+#else
+ p->add_item(TTR("Quit to Project List"), RUN_PROJECT_MANAGER, KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_Q);
#endif
- import_menu = memnew(MenuButton);
- import_menu->set_tooltip(TTR("Import assets to the project."));
- import_menu->set_text(TTR("Import"));
- //import_menu->set_icon(gui_base->get_icon("Save","EditorIcons"));
- left_menu_hb->add_child(import_menu);
-
- p = import_menu->get_popup();
- p->connect("id_pressed", this, "_menu_option");
-
- tool_menu = memnew(MenuButton);
- tool_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools."));
- tool_menu->set_text(TTR("Tools"));
+ PanelContainer *editor_region = memnew(PanelContainer);
+ main_editor_button_vb = memnew(HBoxContainer);
+ editor_region->add_child(main_editor_button_vb);
- //tool_menu->set_icon(gui_base->get_icon("Save","EditorIcons"));
- left_menu_hb->add_child(tool_menu);
+ menu_hb->add_spacer();
+ menu_hb->add_child(editor_region);
- p = tool_menu->get_popup();
+ debug_menu = memnew(MenuButton);
+ debug_menu->set_text(TTR("Debug"));
+ debug_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles"));
+ left_menu_hb->add_child(debug_menu);
+ p = debug_menu->get_popup();
+ p->set_hide_on_item_selection(false);
+ p->add_check_item(TTR("Deploy with Remote Debug"), RUN_DEPLOY_REMOTE_DEBUG);
+ p->set_item_tooltip(p->get_item_count() - 1, TTR("When exporting or deploying, the resulting executable will attempt to connect to the IP of this computer in order to be debugged."));
+ p->add_check_item(TTR("Small Deploy with Network FS"), RUN_FILE_SERVER);
+ p->set_item_tooltip(p->get_item_count() - 1, TTR("When this option is enabled, export or deploy will produce a minimal executable.\nThe filesystem will be provided from the project by the editor over the network.\nOn Android, deploy will use the USB cable for faster performance. This option speeds up testing for games with a large footprint."));
+ p->add_separator();
+ p->add_check_item(TTR("Visible Collision Shapes"), RUN_DEBUG_COLLISONS);
+ p->set_item_tooltip(p->get_item_count() - 1, TTR("Collision shapes and raycast nodes (for 2D and 3D) will be visible on the running game if this option is turned on."));
+ p->add_check_item(TTR("Visible Navigation"), RUN_DEBUG_NAVIGATION);
+ p->set_item_tooltip(p->get_item_count() - 1, TTR("Navigation meshes and polygons will be visible on the running game if this option is turned on."));
+ p->add_separator();
+ p->add_check_item(TTR("Sync Scene Changes"), RUN_LIVE_DEBUG);
+ p->set_item_tooltip(p->get_item_count() - 1, TTR("When this option is turned on, any changes made to the scene in the editor will be replicated in the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
+ p->add_check_item(TTR("Sync Script Changes"), RUN_RELOAD_SCRIPTS);
+ p->set_item_tooltip(p->get_item_count() - 1, TTR("When this option is turned on, any script that is saved will be reloaded on the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
p->connect("id_pressed", this, "_menu_option");
- p->add_item(TTR("Orphan Resource Explorer"), TOOLS_ORPHAN_RESOURCES);
-
- export_button = memnew(ToolButton);
- export_button->set_tooltip(TTR("Export the project to many platforms."));
- export_button->set_text(TTR("Export"));
- export_button->connect("pressed", this, "_menu_option", varray(FILE_EXPORT_PROJECT));
- export_button->set_focus_mode(Control::FOCUS_NONE);
- left_menu_hb->add_child(export_button);
menu_hb->add_spacer();
- //Separator *s1 = memnew( VSeparator );
- //menu_panel->add_child(s1);
- //s1->set_pos(Point2(210,4));
- //s1->set_size(Point2(10,15));
+ settings_menu = memnew(MenuButton);
+ left_menu_hb->add_child(settings_menu);
+ settings_menu->set_text(TTR("Editor"));
+ settings_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles"));
+ //settings_menu->set_anchor(MARGIN_RIGHT,ANCHOR_END);
+ p = settings_menu->get_popup();
+
+ //p->add_item("Export Settings",SETTINGS_EXPORT_PREFERENCES);
+ p->add_item(TTR("Editor Settings"), SETTINGS_PREFERENCES);
+ //p->add_item("Optimization Presets",SETTINGS_OPTIMIZED_PRESETS);
+ p->add_separator();
+ editor_layouts = memnew(PopupMenu);
+ editor_layouts->set_name("Layouts");
+ p->add_child(editor_layouts);
+ editor_layouts->connect("id_pressed", this, "_layout_menu_option");
+ p->add_submenu_item(TTR("Editor Layout"), "Layouts");
+ p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KEY_MASK_SHIFT | KEY_F11), SETTINGS_TOGGLE_FULLSCREN);
+ p->add_separator();
+ p->add_item(TTR("Manage Export Templates"), SETTINGS_MANAGE_EXPORT_TEMPLATES);
+
+ // Help Menu
+ MenuButton *help_menu = memnew(MenuButton);
+ left_menu_hb->add_child(help_menu);
+ help_menu->set_text(TTR("Help"));
+ help_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles"));
+ p = help_menu->get_popup();
+ p->connect("id_pressed", this, "_menu_option");
+ p->add_icon_item(gui_base->get_icon("ClassList", "EditorIcons"), TTR("Classes"), HELP_CLASSES);
+ p->add_icon_item(gui_base->get_icon("HelpSearch", "EditorIcons"), TTR("Search"), HELP_SEARCH);
+ p->add_separator();
+ p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Online Docs"), HELP_DOCS);
+ p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Q&A"), HELP_QA);
+ p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Issue Tracker"), HELP_ISSUES);
+ p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Community"), HELP_COMMUNITY);
+ p->add_separator();
+ p->add_icon_item(gui_base->get_icon("GodotDocs", "EditorIcons"), TTR("About"), HELP_ABOUT);
play_cc = memnew(CenterContainer);
play_cc->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
- gui_base->add_child(play_cc);
+ menu_hb->add_child(play_cc);
play_cc->set_area_as_parent_rect();
play_cc->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_BEGIN, 10);
play_cc->set_margin(MARGIN_TOP, 5);
- top_region = memnew(PanelContainer);
- top_region->add_style_override("panel", gui_base->get_stylebox("hover", "Button"));
- play_cc->add_child(top_region);
+ play_button_panel = memnew(PanelContainer);
+ play_button_panel->add_style_override("panel", gui_base->get_stylebox("PlayButtonPanel", "EditorStyles"));
+ play_cc->add_child(play_button_panel);
HBoxContainer *play_hb = memnew(HBoxContainer);
- top_region->add_child(play_hb);
+ play_button_panel->add_child(play_hb);
play_button = memnew(ToolButton);
play_hb->add_child(play_button);
@@ -5312,7 +5639,6 @@ EditorNode::EditorNode() {
play_button->set_shortcut(ED_SHORTCUT("editor/play", TTR("Play"), KEY_F5));
pause_button = memnew(ToolButton);
- //menu_panel->add_child(pause_button); - not needed for now?
pause_button->set_toggle_mode(true);
pause_button->set_icon(gui_base->get_icon("Pause", "EditorIcons"));
pause_button->set_focus_mode(Control::FOCUS_NONE);
@@ -5340,9 +5666,6 @@ EditorNode::EditorNode() {
native_play_button->get_popup()->connect("id_pressed", this, "_run_in_device");
run_native->connect("native_run", this, "_menu_option", varray(RUN_PLAY_NATIVE));
- //VSeparator *s1 = memnew( VSeparator );
- //play_hb->add_child(s1);
-
play_scene_button = memnew(ToolButton);
play_hb->add_child(play_scene_button);
play_scene_button->set_toggle_mode(true);
@@ -5361,109 +5684,25 @@ EditorNode::EditorNode() {
play_custom_scene_button->set_tooltip(TTR("Play custom scene"));
play_custom_scene_button->set_shortcut(ED_SHORTCUT("editor/play_custom_scene", TTR("Play Custom Scene"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F5));
- debug_button = memnew(MenuButton);
- debug_button->set_flat(true);
- play_hb->add_child(debug_button);
- //debug_button->set_toggle_mode(true);
- debug_button->set_focus_mode(Control::FOCUS_NONE);
- debug_button->set_icon(gui_base->get_icon("Remote", "EditorIcons"));
- //debug_button->connect("pressed", this,"_menu_option",make_binds(RUN_LIVE_DEBUG));
- debug_button->set_tooltip(TTR("Debug options"));
-
- p = debug_button->get_popup();
- p->set_hide_on_item_selection(false);
- p->add_check_item(TTR("Deploy with Remote Debug"), RUN_DEPLOY_REMOTE_DEBUG);
- p->set_item_tooltip(p->get_item_count() - 1, TTR("When exporting or deploying, the resulting executable will attempt to connect to the IP of this computer in order to be debugged."));
- p->add_check_item(TTR("Small Deploy with Network FS"), RUN_FILE_SERVER);
- p->set_item_tooltip(p->get_item_count() - 1, TTR("When this option is enabled, export or deploy will produce a minimal executable.\nThe filesystem will be provided from the project by the editor over the network.\nOn Android, deploy will use the USB cable for faster performance. This option speeds up testing for games with a large footprint."));
- p->add_separator();
- p->add_check_item(TTR("Visible Collision Shapes"), RUN_DEBUG_COLLISONS);
- p->set_item_tooltip(p->get_item_count() - 1, TTR("Collision shapes and raycast nodes (for 2D and 3D) will be visible on the running game if this option is turned on."));
- p->add_check_item(TTR("Visible Navigation"), RUN_DEBUG_NAVIGATION);
- p->set_item_tooltip(p->get_item_count() - 1, TTR("Navigation meshes and polygons will be visible on the running game if this option is turned on."));
- p->add_separator();
- p->add_check_item(TTR("Sync Scene Changes"), RUN_LIVE_DEBUG);
- p->set_item_tooltip(p->get_item_count() - 1, TTR("When this option is turned on, any changes made to the scene in the editor will be replicated in the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
- p->add_check_item(TTR("Sync Script Changes"), RUN_RELOAD_SCRIPTS);
- p->set_item_tooltip(p->get_item_count() - 1, TTR("When this option is turned on, any script that is saved will be reloaded on the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
- p->connect("id_pressed", this, "_menu_option");
-
- /*
- run_settings_button = memnew( ToolButton );
- //menu_hb->add_child(run_settings_button);
- //run_settings_button->set_toggle_mode(true);
- run_settings_button->set_focus_mode(Control::FOCUS_NONE);
- run_settings_button->set_icon(gui_base->get_icon("Run","EditorIcons"));
- run_settings_button->connect("pressed", this,"_menu_option",make_binds(RUN_SCENE_SETTINGS));
-*/
-
- /*
- run_settings_button = memnew( ToolButton );
- menu_panel->add_child(run_settings_button);
- run_settings_button->set_pos(Point2(305,0));
- run_settings_button->set_focus_mode(Control::FOCUS_NONE);
- run_settings_button->set_icon(gui_base->get_icon("Run","EditorIcons"));
- run_settings_button->connect("pressed", this,"_menu_option",make_binds(RUN_SETTINGS));
-*/
-
progress_hb = memnew(BackgroundProgress);
- menu_hb->add_child(progress_hb);
+ //menu_hb->add_child(progress_hb);
{
Control *sp = memnew(Control);
sp->set_custom_minimum_size(Size2(30, 0) * EDSCALE);
- menu_hb->add_child(sp);
+ //menu_hb->add_child(sp);
}
- PanelContainer *vu_cont = memnew(PanelContainer);
- vu_cont->add_style_override("panel", gui_base->get_stylebox("hover", "Button"));
- menu_hb->add_child(vu_cont);
-
- audio_vu = memnew(TextureProgress);
- CenterContainer *vu_cc = memnew(CenterContainer);
- vu_cc->add_child(audio_vu);
- vu_cont->add_child(vu_cc);
- audio_vu->set_under_texture(gui_base->get_icon("VuEmpty", "EditorIcons"));
- audio_vu->set_progress_texture(gui_base->get_icon("VuFull", "EditorIcons"));
- audio_vu->set_max(24);
- audio_vu->set_min(-80);
- audio_vu->set_step(0.01);
- audio_vu->set_value(0);
-
{
Control *sp = memnew(Control);
sp->set_custom_minimum_size(Size2(30, 0) * EDSCALE);
- menu_hb->add_child(sp);
+ //menu_hb->add_child(sp);
}
top_region = memnew(PanelContainer);
- top_region->add_style_override("panel", gui_base->get_stylebox("hover", "Button"));
HBoxContainer *right_menu_hb = memnew(HBoxContainer);
- top_region->add_child(right_menu_hb);
- menu_hb->add_child(top_region);
-
- settings_menu = memnew(MenuButton);
- settings_menu->set_text(TTR("Settings"));
- //settings_menu->set_anchor(MARGIN_RIGHT,ANCHOR_END);
- right_menu_hb->add_child(settings_menu);
- p = settings_menu->get_popup();
-
- //p->add_item("Export Settings",SETTINGS_EXPORT_PREFERENCES);
- p->add_item(TTR("Editor Settings"), SETTINGS_PREFERENCES);
- //p->add_item("Optimization Presets",SETTINGS_OPTIMIZED_PRESETS);
- p->add_separator();
- editor_layouts = memnew(PopupMenu);
- editor_layouts->set_name("Layouts");
- p->add_child(editor_layouts);
- editor_layouts->connect("id_pressed", this, "_layout_menu_option");
- p->add_submenu_item(TTR("Editor Layout"), "Layouts");
-
- p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KEY_MASK_SHIFT | KEY_F11), SETTINGS_TOGGLE_FULLSCREN);
-
- p->add_separator();
- p->add_item(TTR("Manage Export Templates"), SETTINGS_MANAGE_EXPORT_TEMPLATES);
- p->add_separator();
- p->add_item(TTR("About"), SETTINGS_ABOUT);
+ //top_region->add_child(right_menu_hb);
+ menu_hb->add_child(right_menu_hb);
layout_dialog = memnew(EditorNameDialog);
gui_base->add_child(layout_dialog);
@@ -5471,16 +5710,11 @@ EditorNode::EditorNode() {
layout_dialog->set_size(Size2(175, 70) * EDSCALE);
layout_dialog->connect("name_confirmed", this, "_dialog_action");
- sources_button = memnew(ToolButton);
- right_menu_hb->add_child(sources_button);
- sources_button->set_icon(gui_base->get_icon("DependencyOk", "EditorIcons"));
- sources_button->connect("pressed", this, "_menu_option", varray(SOURCES_REIMPORT));
- sources_button->set_tooltip(TTR("Alerts when an external resource has changed."));
-
update_menu = memnew(MenuButton);
update_menu->set_tooltip(TTR("Spins when the editor window repaints!"));
right_menu_hb->add_child(update_menu);
update_menu->set_icon(gui_base->get_icon("Progress1", "EditorIcons"));
+ update_menu->get_popup()->connect("id_pressed", this, "_menu_option");
p = update_menu->get_popup();
p->add_check_item(TTR("Update Always"), SETTINGS_UPDATE_ALWAYS);
p->add_check_item(TTR("Update Changes"), SETTINGS_UPDATE_CHANGES);
@@ -5488,52 +5722,15 @@ EditorNode::EditorNode() {
p->add_check_item(TTR("Disable Update Spinner"), SETTINGS_UPDATE_SPINNER_HIDE);
p->set_item_checked(1, true);
- //sources_button->connect();
-
- /*
- Separator *s2 = memnew( VSeparator );
- menu_panel->add_child(s2);
- s2->set_pos(Point2(338,4));
- s2->set_size(Point2(10,15));
-*/
-
- //editor_hsplit = memnew( HSplitContainer );
- //main_split->add_child(editor_hsplit);
- //editor_hsplit->set_v_size_flags(Control::SIZE_EXPAND_FILL);
-
- //editor_vsplit = memnew( VSplitContainer );
- //editor_hsplit->add_child(editor_vsplit);
-
- //top_pallete = memnew( TabContainer );
scene_tree_dock = memnew(SceneTreeDock(this, scene_root, editor_selection, editor_data));
scene_tree_dock->set_name(TTR("Scene"));
- //top_pallete->add_child(scene_tree_dock);
dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(scene_tree_dock);
#if 0
resources_dock = memnew( ResourcesDock(this) );
resources_dock->set_name("Resources");
- //top_pallete->add_child(resources_dock);
dock_slot[DOCK_SLOT_RIGHT_BL]->add_child(resources_dock);
- //top_pallete->set_v_size_flags(Control::SIZE_EXPAND_FILL);
#endif
dock_slot[DOCK_SLOT_LEFT_BR]->hide();
- /*Control *editor_spacer = memnew( Control );
- editor_spacer->set_custom_minimum_size(Size2(260,200));
- editor_spacer->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- editor_vsplit->add_child( editor_spacer );
- editor_spacer->add_child( top_pallete );
- top_pallete->set_area_as_parent_rect();*/
-
- //prop_pallete = memnew( TabContainer );
-
- //prop_pallete->set_v_size_flags(Control::SIZE_EXPAND_FILL);
-
- /*editor_spacer = memnew( Control );
- editor_spacer->set_custom_minimum_size(Size2(260,200));
- editor_spacer->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- editor_vsplit->add_child( editor_spacer );
- editor_spacer->add_child( prop_pallete );
- prop_pallete->set_area_as_parent_rect();*/
VBoxContainer *prop_editor_base = memnew(VBoxContainer);
prop_editor_base->set_name(TTR("Inspector")); // Properties?
@@ -5603,7 +5800,7 @@ EditorNode::EditorNode() {
search_button = memnew(ToolButton);
search_button->set_toggle_mode(true);
search_button->set_pressed(false);
- search_button->set_icon(gui_base->get_icon("Zoom", "EditorIcons"));
+ search_button->set_icon(gui_base->get_icon("Search", "EditorIcons"));
prop_editor_hb->add_child(search_button);
search_button->connect("toggled", this, "_toggle_search_bar");
@@ -5637,8 +5834,11 @@ EditorNode::EditorNode() {
property_editor = memnew(PropertyEditor);
property_editor->set_autoclear(true);
property_editor->set_show_categories(true);
+ property_editor->set_use_folding(true);
property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
property_editor->set_use_doc_hints(true);
+ property_editor->set_hide_script(false);
+ property_editor->set_enable_capitalize_paths(bool(EDITOR_DEF("interface/capitalize_properties", true)));
property_editor->hide_top_label();
property_editor->register_text_enter(search_box);
@@ -5672,7 +5872,6 @@ EditorNode::EditorNode() {
} else {
dock_slot[DOCK_SLOT_LEFT_UR]->add_child(filesystem_dock);
}
- //prop_pallete->add_child(filesystem_dock);
filesystem_dock->connect("open", this, "open_request");
filesystem_dock->connect("instance", this, "_instance_request");
@@ -5681,7 +5880,7 @@ EditorNode::EditorNode() {
overridden_default_layout = -1;
default_layout.instance();
default_layout->set_value(docks_section, "dock_3", TTR("FileSystem"));
- default_layout->set_value(docks_section, "dock_5", TTR("Scene"));
+ default_layout->set_value(docks_section, "dock_5", TTR("Scene") + "," + TTR("Import"));
default_layout->set_value(docks_section, "dock_6", TTR("Inspector") + "," + TTR("Node"));
for (int i = 0; i < DOCK_SLOT_MAX / 2; i++)
@@ -5692,7 +5891,7 @@ EditorNode::EditorNode() {
_update_layouts_menu();
bottom_panel = memnew(PanelContainer);
- bottom_panel->add_style_override("panel", gui_base->get_stylebox("panelf", "Panel"));
+ bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer"));
center_split->add_child(bottom_panel);
center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN);
@@ -5723,17 +5922,6 @@ EditorNode::EditorNode() {
//progress_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- /*
- animation_menu = memnew( ToolButton );
- animation_menu->set_pos(Point2(500,0));
- animation_menu->set_size(Size2(20,20));
- animation_menu->set_toggle_mode(true);
- animation_menu->set_focus_mode(Control::FOCUS_NONE);
- menu_panel->add_child(animation_menu);
- animation_menu->set_icon(gui_base->get_icon("Animation","EditorIcons"));
- animation_menu->connect("pressed",this,"_animation_visibility_toggle");
-*/
-
orphan_resources = memnew(OrphanResourcesDialog);
gui_base->add_child(orphan_resources);
@@ -5741,6 +5929,12 @@ EditorNode::EditorNode() {
gui_base->add_child(confirmation);
confirmation->connect("confirmed", this, "_menu_confirm_current");
+ save_confirmation = memnew(ConfirmationDialog);
+ save_confirmation->add_button(TTR("Don't Save"), OS::get_singleton()->get_swap_ok_cancel(), "discard");
+ gui_base->add_child(save_confirmation);
+ save_confirmation->connect("confirmed", this, "_menu_confirm_current");
+ save_confirmation->connect("custom_action", this, "_discard_changes");
+
accept = memnew(AcceptDialog);
gui_base->add_child(accept);
accept->connect("confirmed", this, "_menu_confirm_current");
@@ -5771,7 +5965,7 @@ EditorNode::EditorNode() {
settings_config_dialog = memnew(EditorSettingsDialog);
gui_base->add_child(settings_config_dialog);
- project_settings = memnew(ProjectSettings(&editor_data));
+ project_settings = memnew(ProjectSettingsEditor(&editor_data));
gui_base->add_child(project_settings);
import_confirmation = memnew(ConfirmationDialog);
@@ -5782,29 +5976,15 @@ EditorNode::EditorNode() {
import_confirmation->connect("custom_action", this, "_import_action");
gui_base->add_child(import_confirmation);
- open_recent_confirmation = memnew(ConfirmationDialog);
- add_child(open_recent_confirmation);
- open_recent_confirmation->connect("confirmed", this, "_open_recent_scene_confirm");
-
run_settings_dialog = memnew(RunSettingsDialog);
gui_base->add_child(run_settings_dialog);
export_template_manager = memnew(ExportTemplateManager);
gui_base->add_child(export_template_manager);
- about = memnew(AcceptDialog);
- about->set_title(TTR("Thanks from the Godot community!"));
- about->get_ok()->set_text(TTR("Thanks!"));
- about->set_hide_on_ok(true);
+ about = memnew(EditorAbout);
+ about->get_logo()->set_texture(gui_base->get_icon("Logo", "EditorIcons"));
gui_base->add_child(about);
- HBoxContainer *hbc = memnew(HBoxContainer);
- about->add_child(hbc);
- Label *about_text = memnew(Label);
- about_text->set_text(VERSION_FULL_NAME "\n(c) 2008-2017 Juan Linietsky, Ariel Manzur.\n");
- TextureRect *logo = memnew(TextureRect);
- logo->set_texture(gui_base->get_icon("Logo", "EditorIcons"));
- hbc->add_child(logo);
- hbc->add_child(about_text);
warning = memnew(AcceptDialog);
gui_base->add_child(warning);
@@ -5864,7 +6044,6 @@ EditorNode::EditorNode() {
file_menu->get_popup()->connect("id_pressed", this, "_menu_option");
object_menu->get_popup()->connect("id_pressed", this, "_menu_option");
- update_menu->get_popup()->connect("id_pressed", this, "_menu_option");
settings_menu->get_popup()->connect("id_pressed", this, "_menu_option");
file->connect("file_selected", this, "_dialog_action");
@@ -5899,21 +6078,17 @@ EditorNode::EditorNode() {
add_editor_plugin( memnew( ShaderEditorPlugin(this,false) ) );*/
add_editor_plugin(memnew(CameraEditorPlugin(this)));
- // add_editor_plugin( memnew( SampleEditorPlugin(this) ) );
- // add_editor_plugin( memnew( SampleLibraryEditorPlugin(this) ) );
add_editor_plugin(memnew(ThemeEditorPlugin(this)));
add_editor_plugin(memnew(MultiMeshEditorPlugin(this)));
add_editor_plugin(memnew(MeshInstanceEditorPlugin(this)));
add_editor_plugin(memnew(AnimationTreeEditorPlugin(this)));
- //add_editor_plugin( memnew( SamplePlayerEditorPlugin(this) ) ); - this is kind of useless at this point
- //add_editor_plugin( memnew( MeshLibraryEditorPlugin(this) ) );
- //add_editor_plugin( memnew( StreamEditorPlugin(this) ) );
+ add_editor_plugin(memnew(MeshLibraryEditorPlugin(this)));
add_editor_plugin(memnew(StyleBoxEditorPlugin(this)));
- //add_editor_plugin( memnew( ParticlesEditorPlugin(this) ) );
+ add_editor_plugin(memnew(ParticlesEditorPlugin(this)));
add_editor_plugin(memnew(ResourcePreloaderEditorPlugin(this)));
add_editor_plugin(memnew(ItemListEditorPlugin(this)));
//add_editor_plugin( memnew( RichTextEditorPlugin(this) ) );
- //add_editor_plugin( memnew( CollisionPolygonEditorPlugin(this) ) );
+ add_editor_plugin(memnew(CollisionPolygonEditorPlugin(this)));
add_editor_plugin(memnew(CollisionPolygon2DEditorPlugin(this)));
add_editor_plugin(memnew(TileSetEditorPlugin(this)));
add_editor_plugin(memnew(TileMapEditorPlugin(this)));
@@ -5922,18 +6097,18 @@ EditorNode::EditorNode() {
add_editor_plugin(memnew(Particles2DEditorPlugin(this)));
add_editor_plugin(memnew(GIProbeEditorPlugin(this)));
add_editor_plugin(memnew(Path2DEditorPlugin(this)));
- //add_editor_plugin( memnew( PathEditorPlugin(this) ) );
- //add_editor_plugin( memnew( BakedLightEditorPlugin(this) ) );
+ add_editor_plugin(memnew(PathEditorPlugin(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)));
- add_editor_plugin(memnew(ColorRampEditorPlugin(this)));
+ add_editor_plugin(memnew(GradientEditorPlugin(this)));
add_editor_plugin(memnew(CollisionShape2DEditorPlugin(this)));
+ add_editor_plugin(memnew(CurveEditorPlugin(this)));
add_editor_plugin(memnew(TextureEditorPlugin(this)));
add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor)));
//add_editor_plugin( memnew( MaterialEditorPlugin(this) ) );
- //add_editor_plugin( memnew( MeshEditorPlugin(this) ) );
+ add_editor_plugin(memnew(MeshEditorPlugin(this)));
for (int i = 0; i < EditorPlugins::get_plugin_count(); i++)
add_editor_plugin(EditorPlugins::create(i, this));
@@ -5942,23 +6117,21 @@ EditorNode::EditorNode() {
plugin_init_callbacks[i]();
}
- /*resource_preview->add_preview_generator( Ref<EditorTexturePreviewPlugin>( memnew(EditorTexturePreviewPlugin )));
- resource_preview->add_preview_generator( Ref<EditorPackedScenePreviewPlugin>( memnew(EditorPackedScenePreviewPlugin )));
- resource_preview->add_preview_generator( Ref<EditorMaterialPreviewPlugin>( memnew(EditorMaterialPreviewPlugin )));
- resource_preview->add_preview_generator( Ref<EditorScriptPreviewPlugin>( memnew(EditorScriptPreviewPlugin )));
- resource_preview->add_preview_generator( Ref<EditorSamplePreviewPlugin>( memnew(EditorSamplePreviewPlugin )));
- resource_preview->add_preview_generator( Ref<EditorMeshPreviewPlugin>( memnew(EditorMeshPreviewPlugin )));
- resource_preview->add_preview_generator( Ref<EditorBitmapPreviewPlugin>( memnew(EditorBitmapPreviewPlugin )));
-*/
+ resource_preview->add_preview_generator(Ref<EditorTexturePreviewPlugin>(memnew(EditorTexturePreviewPlugin)));
+ resource_preview->add_preview_generator(Ref<EditorPackedScenePreviewPlugin>(memnew(EditorPackedScenePreviewPlugin)));
+ resource_preview->add_preview_generator(Ref<EditorMaterialPreviewPlugin>(memnew(EditorMaterialPreviewPlugin)));
+ resource_preview->add_preview_generator(Ref<EditorScriptPreviewPlugin>(memnew(EditorScriptPreviewPlugin)));
+ //resource_preview->add_preview_generator( Ref<EditorSamplePreviewPlugin>( memnew(EditorSamplePreviewPlugin )));
+ resource_preview->add_preview_generator(Ref<EditorMeshPreviewPlugin>(memnew(EditorMeshPreviewPlugin)));
+ resource_preview->add_preview_generator(Ref<EditorBitmapPreviewPlugin>(memnew(EditorBitmapPreviewPlugin)));
circle_step_msec = OS::get_singleton()->get_ticks_msec();
circle_step_frame = Engine::get_singleton()->get_frames_drawn();
circle_step = 0;
- _rebuild_import_menu();
-
editor_plugin_screen = NULL;
editor_plugins_over = memnew(EditorPluginList);
+ editor_plugins_force_input_forwarding = memnew(EditorPluginList);
//force_top_viewport(true);
_edit_current();
@@ -5968,7 +6141,7 @@ EditorNode::EditorNode() {
Physics2DServer::get_singleton()->set_active(false); // no physics by default if editor
ScriptServer::set_scripting_enabled(false); // no scripting by default if editor
- //GlobalConfig::get_singleton()->set("render/room_cull_enabled",false);
+ //ProjectSettings::get_singleton()->set("render/room_cull_enabled",false);
reference_resource_mem = true;
save_external_resources_mem = true;
@@ -5981,7 +6154,7 @@ EditorNode::EditorNode() {
//store project name in ssettings
String project_name;
//figure it out from path
- project_name = GlobalConfig::get_singleton()->get_resource_path().replace("\\", "/");
+ project_name = ProjectSettings::get_singleton()->get_resource_path().replace("\\", "/");
print_line("path: " + project_name);
if (project_name.length() && project_name[project_name.length() - 1] == '/')
project_name = project_name.substr(0, project_name.length() - 1);
@@ -5989,7 +6162,7 @@ EditorNode::EditorNode() {
project_name = project_name.replace("/", "::");
if (project_name != "") {
- EditorSettings::get_singleton()->set("projects/" + project_name, GlobalConfig::get_singleton()->get_resource_path());
+ EditorSettings::get_singleton()->set("projects/" + project_name, ProjectSettings::get_singleton()->get_resource_path());
EditorSettings::get_singleton()->raise_order("projects/" + project_name);
EditorSettings::get_singleton()->save();
}
@@ -6066,10 +6239,15 @@ EditorNode::EditorNode() {
editor_data.set_edited_scene(0);
_update_scene_tabs();
+ import_dock->initialize_import_options();
+
{
_initializing_addons = true;
- Vector<String> addons = GlobalConfig::get_singleton()->get("editor_plugins/enabled");
+ Vector<String> addons;
+ if (ProjectSettings::get_singleton()->has("editor_plugins/enabled")) {
+ addons = ProjectSettings::get_singleton()->get("editor_plugins/enabled");
+ }
for (int i = 0; i < addons.size(); i++) {
set_addon_plugin_enabled(addons[i], true);
@@ -6089,6 +6267,14 @@ EditorNode::EditorNode() {
_dim_timer->set_wait_time(0.01666f);
_dim_timer->connect("timeout", this, "_dim_timeout");
add_child(_dim_timer);
+
+ ED_SHORTCUT("editor/editor_2d", TTR("Open 2D Editor"), KEY_F1);
+ ED_SHORTCUT("editor/editor_3d", TTR("Open 3D Editor"), KEY_F2);
+ ED_SHORTCUT("editor/editor_script", TTR("Open Script Editor"), KEY_F3); //hack neded for script editor F3 search to work :) Assign like this or don't use F3
+ ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_F4);
+ ED_SHORTCUT("editor/editor_assetlib", TTR("Open Asset Library"));
+ ED_SHORTCUT("editor/editor_next", TTR("Open the next Editor"));
+ ED_SHORTCUT("editor/editor_prev", TTR("Open the previous Editor"));
}
EditorNode::~EditorNode() {
@@ -6096,6 +6282,7 @@ EditorNode::~EditorNode() {
memdelete(EditorHelp::get_doc_data());
memdelete(editor_selection);
memdelete(editor_plugins_over);
+ memdelete(editor_plugins_force_input_forwarding);
memdelete(file_server);
EditorSettings::destroy();
}
@@ -6118,7 +6305,7 @@ void EditorPluginList::edit(Object *p_object) {
}
}
-bool EditorPluginList::forward_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event) {
+bool EditorPluginList::forward_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event) {
bool discard = false;
@@ -6131,10 +6318,14 @@ bool EditorPluginList::forward_gui_input(const Transform2D &p_canvas_xform, cons
return discard;
}
-bool EditorPluginList::forward_spatial_gui_input(Camera *p_camera, const InputEvent &p_event) {
+bool EditorPluginList::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled) {
bool discard = false;
for (int i = 0; i < plugins_list.size(); i++) {
+ if ((!serve_when_force_input_enabled) && plugins_list[i]->is_input_event_forwarding_always_enabled()) {
+ continue;
+ }
+
if (plugins_list[i]->forward_spatial_gui_input(p_camera, p_event)) {
discard = true;
}
@@ -6150,6 +6341,10 @@ void EditorPluginList::forward_draw_over_canvas(const Transform2D &p_canvas_xfor
}
}
+void EditorPluginList::add_plugin(EditorPlugin *p_plugin) {
+ plugins_list.push_back(p_plugin);
+}
+
bool EditorPluginList::empty() {
return plugins_list.empty();
}
diff --git a/editor/editor_node.h b/editor/editor_node.h
index 5182650abc..cf6ef33325 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,6 +33,7 @@
#include "editor/call_dialog.h"
#include "editor/connections_dialog.h"
#include "editor/create_dialog.h"
+#include "editor/editor_about.h"
#include "editor/editor_data.h"
#include "editor/editor_path.h"
#include "editor/editor_run.h"
@@ -63,7 +65,7 @@
#include "editor/editor_log.h"
#include "editor/editor_run_script.h"
#include "editor/project_export.h"
-#include "editor/project_settings.h"
+#include "editor/project_settings_editor.h"
#include "editor/resources_dock.h"
#include "editor/run_settings_dialog.h"
#include "editor/scene_tree_dock.h"
@@ -139,6 +141,8 @@ private:
FILE_RUN_SCRIPT,
FILE_OPEN_PREV,
FILE_CLOSE,
+ FILE_CLOSE_ALL_AND_QUIT,
+ FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER,
FILE_QUIT,
FILE_EXTERNAL_OPEN_SCENE,
EDIT_UNDO,
@@ -185,12 +189,19 @@ private:
SETTINGS_PICK_MAIN_SCENE,
SETTINGS_TOGGLE_FULLSCREN,
SETTINGS_HELP,
- SETTINGS_ABOUT,
SOURCES_REIMPORT,
DEPENDENCY_LOAD_CHANGED_IMAGES,
DEPENDENCY_UPDATE_IMPORTED,
SCENE_TAB_CLOSE,
+ HELP_CLASSES,
+ HELP_SEARCH,
+ HELP_DOCS,
+ HELP_QA,
+ HELP_ISSUES,
+ HELP_COMMUNITY,
+ HELP_ABOUT,
+
IMPORT_PLUGIN_BASE = 100,
OBJECT_METHOD_BASE = 500,
@@ -204,8 +215,10 @@ private:
//Ref<ResourceImportMetadata> scene_import_metadata;
PanelContainer *scene_root_parent;
+ Control *theme_base;
Control *gui_base;
VBoxContainer *main_vbox;
+ PanelContainer *play_button_panel;
//split
@@ -223,6 +236,8 @@ private:
//main tabs
Tabs *scene_tabs;
+ Panel *tab_preview_panel;
+ TextureRect *tab_preview;
int tab_closing;
bool exiting;
@@ -233,16 +248,14 @@ private:
Control *vp_base;
PaneDrag *pd;
//PaneDrag *pd_anim;
- Panel *menu_panel;
- //HSplitContainer *editor_hsplit;
- //VSplitContainer *editor_vsplit;
CenterContainer *play_cc;
HBoxContainer *menu_hb;
Control *viewport;
MenuButton *file_menu;
- MenuButton *import_menu;
- MenuButton *tool_menu;
+ MenuButton *project_menu;
+ MenuButton *debug_menu;
+ PopupMenu *tool_menu;
ToolButton *export_button;
ToolButton *prev_scene;
MenuButton *object_menu;
@@ -254,7 +267,6 @@ private:
ToolButton *run_settings_button;
ToolButton *play_scene_button;
ToolButton *play_custom_scene_button;
- MenuButton *debug_button;
ToolButton *search_button;
TextureProgress *audio_vu;
//MenuButton *fileserver_menu;
@@ -284,11 +296,11 @@ private:
//CallDialog *call_dialog;
ConfirmationDialog *confirmation;
+ ConfirmationDialog *save_confirmation;
ConfirmationDialog *import_confirmation;
- ConfirmationDialog *open_recent_confirmation;
ConfirmationDialog *pick_main_scene;
AcceptDialog *accept;
- AcceptDialog *about;
+ EditorAbout *about;
AcceptDialog *warning;
int overridden_default_layout;
@@ -299,7 +311,7 @@ private:
//OptimizedPresetsDialog *optimized_presets;
EditorSettingsDialog *settings_config_dialog;
RunSettingsDialog *run_settings_dialog;
- ProjectSettings *project_settings;
+ ProjectSettingsEditor *project_settings;
EditorFileDialog *file;
ExportTemplateManager *export_template_manager;
FileDialog *file_templates;
@@ -310,9 +322,7 @@ private:
LineEdit *file_export_password;
String current_path;
MenuButton *update_menu;
- ToolButton *sources_button;
- //TabContainer *prop_pallete;
- //TabContainer *top_pallete;
+
String defer_load_scene;
String defer_export;
String defer_export_platform;
@@ -348,7 +358,7 @@ private:
TabContainer *dock_slot[DOCK_SLOT_MAX];
Rect2 dock_select_rect[DOCK_SLOT_MAX];
int dock_select_rect_over;
- PopupPanel *dock_select_popoup;
+ PopupPanel *dock_select_popup;
Control *dock_select;
ToolButton *dock_tab_move_left;
ToolButton *dock_tab_move_right;
@@ -357,6 +367,9 @@ private:
bool docks_visible;
ToolButton *distraction_free;
+ bool scene_distraction;
+ bool script_distraction;
+
String _tmp_import_path;
EditorExport *editor_export;
@@ -383,6 +396,7 @@ private:
Vector<EditorPlugin *> editor_plugins;
EditorPlugin *editor_plugin_screen;
EditorPluginList *editor_plugins_over;
+ EditorPluginList *editor_plugins_force_input_forwarding;
EditorHistory editor_history;
EditorData editor_data;
@@ -437,6 +451,8 @@ private:
void _imported(Node *p_node);
void _node_renamed();
+ void _editor_select_next();
+ void _editor_select_prev();
void _editor_select(int p_which);
void _set_scene_metadata(const String &p_file, int p_idx = -1);
void _get_scene_metadata(const String &p_file);
@@ -446,9 +462,10 @@ private:
void _show_messages();
void _vp_resized();
- void _rebuild_import_menu();
-
void _save_scene(String p_file, int idx = -1);
+ void _save_all_scenes();
+ int _next_unsaved_scene(bool p_valid_filename, int p_start = 0);
+ void _discard_changes(const String &p_str = String());
void _instance_request(const Vector<String> &p_files);
@@ -477,7 +494,7 @@ private:
bool convert_old;
- void _unhandled_input(const InputEvent &p_event);
+ void _unhandled_input(const Ref<InputEvent> &p_event);
static void _load_error_notify(void *p_ud, const String &p_text);
@@ -507,6 +524,7 @@ private:
bool _find_and_save_resource(RES p_res, Map<RES, bool> &processed, int32_t flags);
bool _find_and_save_edited_subresources(Object *obj, Map<RES, bool> &processed, int32_t flags);
void _save_edited_subresources(Node *scene, Map<RES, bool> &processed, int32_t flags);
+ void _mark_unsaved_scenes();
void _find_node_types(Node *p_node, int &count_2d, int &count_3d);
void _save_scene_with_preview(String p_file);
@@ -521,7 +539,7 @@ private:
}
struct ExportDefer {
- String platform;
+ String preset;
String path;
bool debug;
String password;
@@ -534,7 +552,7 @@ private:
bool _find_scene_in_use(Node *p_node, const String &p_path) const;
- void _dock_select_input(const InputEvent &p_input);
+ void _dock_select_input(const Ref<InputEvent> &p_input);
void _dock_move_left();
void _dock_move_right();
void _dock_select_draw();
@@ -543,6 +561,11 @@ private:
void _dock_popup_exit();
void _scene_tab_changed(int p_tab);
void _scene_tab_closed(int p_tab);
+ void _scene_tab_hover(int p_tab);
+ void _scene_tab_exit();
+ void _scene_tab_input(const Ref<InputEvent> &p_input);
+ void _reposition_active_tab(int idx_to);
+ void _thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata);
void _scene_tab_script_edited(int p_tab);
Dictionary _get_main_scene_state();
@@ -558,7 +581,7 @@ private:
void _update_top_menu_visibility();
void _update_layouts_menu();
- void _layout_menu_option(int p_idx);
+ void _layout_menu_option(int p_id);
void _toggle_search_bar(bool p_pressed);
void _clear_search_box();
@@ -580,6 +603,7 @@ private:
static int plugin_init_callback_count;
static EditorPluginInitializeCallback plugin_init_callbacks[MAX_INIT_CALLBACKS];
+ void _save_default_environment();
void _call_build();
static int build_callback_count;
@@ -606,6 +630,9 @@ private:
void _start_dimming(bool p_dimming);
void _dim_timeout();
+ void _check_gui_base_size();
+
+ void _license_tree_selected();
protected:
void _notification(int p_what);
@@ -617,7 +644,8 @@ public:
enum EditorTable {
EDITOR_2D = 0,
EDITOR_3D,
- EDITOR_SCRIPT
+ EDITOR_SCRIPT,
+ EDITOR_ASSETLIB
};
void set_visible_editor(EditorTable p_table) { _editor_select(p_table); }
@@ -625,6 +653,7 @@ public:
EditorPlugin *get_editor_plugin_screen() { return editor_plugin_screen; }
EditorPluginList *get_editor_plugins_over() { return editor_plugins_over; }
+ EditorPluginList *get_editor_plugins_force_input_forwarding() { return editor_plugins_force_input_forwarding; }
PropertyEditor *get_property_editor() { return property_editor; }
VBoxContainer *get_property_editor_vb() { return prop_editor_vb; }
@@ -713,7 +742,7 @@ public:
void show_warning(const String &p_text, const String &p_title = "Warning!");
- Error export_platform(const String &p_platform, const String &p_path, bool p_debug, const String &p_password, bool p_quit_after = false);
+ Error export_preset(const String &p_platform, const String &p_path, bool p_debug, const String &p_password, bool p_quit_after = false);
static void register_editor_types();
static void unregister_editor_types();
@@ -800,9 +829,10 @@ public:
void make_visible(bool p_visible);
void edit(Object *p_object);
- bool forward_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event);
- bool forward_spatial_gui_input(Camera *p_camera, const InputEvent &p_event);
+ bool forward_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event);
+ bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled);
void forward_draw_over_canvas(const Transform2D &p_canvas_xform, Control *p_canvas);
+ void add_plugin(EditorPlugin *p_plugin);
void clear();
bool empty();
diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp
index 0200278dc0..fdac68ea1f 100644
--- a/editor/editor_path.cpp
+++ b/editor/editor_path.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -62,15 +63,16 @@ void EditorPath::_add_children_to_popup(Object *p_obj, int p_depth) {
int index = popup->get_item_count();
popup->add_icon_item(icon, E->get().name.capitalize(), objects.size());
popup->set_item_h_offset(index, p_depth * 10 * EDSCALE);
- objects.push_back(obj->get_instance_ID());
+ objects.push_back(obj->get_instance_id());
_add_children_to_popup(obj, p_depth + 1);
}
}
-void EditorPath::_gui_input(const InputEvent &p_event) {
+void EditorPath::_gui_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == BUTTON_LEFT && p_event.mouse_button.pressed) {
+ Ref<InputEventMouseButton> mb = p_event;
+ if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
Object *obj = ObjectDB::get_instance(history->get_path_object(history->get_path_size() - 1));
if (!obj)
@@ -79,7 +81,7 @@ void EditorPath::_gui_input(const InputEvent &p_event) {
objects.clear();
popup->clear();
_add_children_to_popup(obj);
- popup->set_pos(get_global_pos() + Vector2(0, get_size().height));
+ popup->set_position(get_global_position() + Vector2(0, get_size().height));
popup->set_size(Size2(get_size().width, 1));
popup->popup();
}
diff --git a/editor/editor_path.h b/editor/editor_path.h
index d781f6609a..7b73e7ebb6 100644
--- a/editor/editor_path.h
+++ b/editor/editor_path.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -45,7 +46,7 @@ class EditorPath : public Control {
EditorPath();
void _popup_select(int p_idx);
- void _gui_input(const InputEvent &p_event);
+ void _gui_input(const Ref<InputEvent> &p_event);
void _add_children_to_popup(Object *p_obj, int p_depth = 0);
protected:
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 2579871d78..d8c8d419b9 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -79,6 +80,24 @@ void EditorPlugin::edit_resource(const Ref<Resource> &p_resource) {
EditorNode::get_singleton()->edit_resource(p_resource);
}
+void EditorPlugin::open_scene_from_path(const String &scene_path) {
+
+ if (EditorNode::get_singleton()->is_changing_scene()) {
+ return;
+ }
+
+ EditorNode::get_singleton()->open_request(scene_path);
+}
+
+void EditorPlugin::reload_scene_from_path(const String &scene_path) {
+
+ if (EditorNode::get_singleton()->is_changing_scene()) {
+ return;
+ }
+
+ EditorNode::get_singleton()->reload_scene(scene_path);
+}
+
void EditorPlugin::add_control_to_container(CustomControlContainer p_location, Control *p_control) {
switch (p_location) {
@@ -146,6 +165,52 @@ void EditorPlugin::remove_tool_menu_item(const String &p_name) {
//EditorNode::get_singleton()->remove_tool_menu_item(p_name);
}
+void EditorPlugin::set_input_event_forwarding_always_enabled() {
+ input_event_forwarding_always_enabled = true;
+ EditorPluginList *always_input_forwarding_list = EditorNode::get_singleton()->get_editor_plugins_force_input_forwarding();
+ always_input_forwarding_list->add_plugin(this);
+}
+
+Node *EditorPlugin::get_edited_scene_root() {
+ return EditorNode::get_singleton()->get_edited_scene();
+}
+
+Array EditorPlugin::get_open_scenes() const {
+
+ Array ret;
+ Vector<EditorData::EditedScene> scenes = EditorNode::get_singleton()->get_editor_data().get_edited_scenes();
+
+ int scns_amount = scenes.size();
+ for (int idx_scn = 0; idx_scn < scns_amount; idx_scn++) {
+ if (scenes[idx_scn].root == NULL)
+ continue;
+ ret.push_back(scenes[idx_scn].root->get_filename());
+ }
+ return ret;
+}
+
+ScriptEditor *EditorPlugin::get_script_editor() {
+ return ScriptEditor::get_singleton();
+}
+
+void EditorPlugin::notify_scene_changed(const Node *scn_root) {
+ if (scn_root == NULL) return;
+ emit_signal("scene_changed", scn_root);
+}
+
+void EditorPlugin::notify_main_screen_changed(const String &screen_name) {
+
+ if (screen_name == last_main_screen_name)
+ return;
+
+ emit_signal("main_screen_changed", screen_name);
+ last_main_screen_name = screen_name;
+}
+
+void EditorPlugin::notify_scene_closed(const String &scene_filepath) {
+ emit_signal("scene_closed", scene_filepath);
+}
+
Ref<SpatialEditorGizmo> EditorPlugin::create_spatial_gizmo(Spatial *p_spatial) {
//??
if (get_script_instance() && get_script_instance()->has_method("create_spatial_gizmo")) {
@@ -155,7 +220,7 @@ Ref<SpatialEditorGizmo> EditorPlugin::create_spatial_gizmo(Spatial *p_spatial) {
return Ref<SpatialEditorGizmo>();
}
-bool EditorPlugin::forward_canvas_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event) {
+bool EditorPlugin::forward_canvas_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event) {
if (get_script_instance() && get_script_instance()->has_method("forward_canvas_gui_input")) {
return get_script_instance()->call("forward_canvas_gui_input", p_canvas_xform, p_event);
@@ -174,7 +239,7 @@ void EditorPlugin::update_canvas() {
CanvasItemEditor::get_singleton()->get_viewport_control()->update();
}
-bool EditorPlugin::forward_spatial_gui_input(Camera *p_camera, const InputEvent &p_event) {
+bool EditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) {
if (get_script_instance() && get_script_instance()->has_method("forward_spatial_gui_input")) {
return get_script_instance()->call("forward_spatial_gui_input", p_camera, p_event);
@@ -184,8 +249,8 @@ bool EditorPlugin::forward_spatial_gui_input(Camera *p_camera, const InputEvent
}
String EditorPlugin::get_name() const {
- if (get_script_instance() && get_script_instance()->has_method("get_name")) {
- return get_script_instance()->call("get_name");
+ if (get_script_instance() && get_script_instance()->has_method("get_plugin_name")) {
+ return get_script_instance()->call("get_plugin_name");
}
return String();
@@ -275,6 +340,16 @@ bool EditorPlugin::get_remove_list(List<Node *> *p_list) {
void EditorPlugin::restore_global_state() {}
void EditorPlugin::save_global_state() {}
+void EditorPlugin::add_import_plugin(const Ref<EditorImportPlugin> &p_importer) {
+ ResourceFormatImporter::get_singleton()->add_importer(p_importer);
+ EditorFileSystem::get_singleton()->scan();
+}
+
+void EditorPlugin::remove_import_plugin(const Ref<EditorImportPlugin> &p_importer) {
+ ResourceFormatImporter::get_singleton()->remove_importer(p_importer);
+ EditorFileSystem::get_singleton()->scan();
+}
+
void EditorPlugin::set_window_layout(Ref<ConfigFile> p_layout) {
if (get_script_instance() && get_script_instance()->has_method("set_window_layout")) {
@@ -332,42 +407,50 @@ EditorFileSystem *EditorPlugin::get_resource_file_system() {
void EditorPlugin::_bind_methods() {
- 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_control_to_container", "container", "control"), &EditorPlugin::add_control_to_container);
+ ClassDB::bind_method(D_METHOD("add_control_to_bottom_panel", "control", "title"), &EditorPlugin::add_control_to_bottom_panel);
+ ClassDB::bind_method(D_METHOD("add_control_to_dock", "slot", "control"), &EditorPlugin::add_control_to_dock);
+ ClassDB::bind_method(D_METHOD("remove_control_from_docks", "control"), &EditorPlugin::remove_control_from_docks);
+ ClassDB::bind_method(D_METHOD("remove_control_from_bottom_panel", "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("add_tool_submenu_item", "name", "submenu"), &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("add_custom_type", "type", "base", "script", "icon"), &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_editor_viewport"), &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("get_resource_previewer"), &EditorPlugin::get_resource_previewer);
+ ClassDB::bind_method(D_METHOD("get_resource_filesystem"), &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("make_bottom_panel_item_visible", "item"), &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("get_base_control"), &EditorPlugin::get_base_control);
+ ClassDB::bind_method(D_METHOD("get_undo_redo"), &EditorPlugin::_get_undo_redo);
+ ClassDB::bind_method(D_METHOD("get_selection"), &EditorPlugin::get_selection);
+ ClassDB::bind_method(D_METHOD("get_editor_settings"), &EditorPlugin::get_editor_settings);
+ ClassDB::bind_method(D_METHOD("get_script_editor"), &EditorPlugin::get_script_editor);
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::bind_method(D_METHOD("edit_resource", "resource"), &EditorPlugin::edit_resource);
+ ClassDB::bind_method(D_METHOD("open_scene_from_path", "scene_filepath"), &EditorPlugin::open_scene_from_path);
+ ClassDB::bind_method(D_METHOD("reload_scene_from_path", "scene_filepath"), &EditorPlugin::reload_scene_from_path);
+ ClassDB::bind_method(D_METHOD("add_import_plugin", "importer"), &EditorPlugin::add_import_plugin);
+ ClassDB::bind_method(D_METHOD("remove_import_plugin", "importer"), &EditorPlugin::remove_import_plugin);
+ ClassDB::bind_method(D_METHOD("set_input_event_forwarding_always_enabled"), &EditorPlugin::set_input_event_forwarding_always_enabled);
+ ClassDB::bind_method(D_METHOD("get_open_scenes"), &EditorPlugin::get_open_scenes);
+ ClassDB::bind_method(D_METHOD("get_edited_scene_root"), &EditorPlugin::get_edited_scene_root);
+
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_canvas_gui_input", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_draw_over_canvas", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::OBJECT, "canvas:Control")));
- ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::INPUT_EVENT, "event")));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
MethodInfo gizmo = MethodInfo(Variant::OBJECT, "create_spatial_gizmo", PropertyInfo(Variant::OBJECT, "for_spatial:Spatial"));
gizmo.return_val.hint = PROPERTY_HINT_RESOURCE_TYPE;
gizmo.return_val.hint_string = "EditorSpatialGizmo";
ClassDB::add_virtual_method(get_class_static(), gizmo);
- ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_name"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_plugin_name"));
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "has_main_screen"));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("make_visible", PropertyInfo(Variant::BOOL, "visible")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("edit", PropertyInfo(Variant::OBJECT, "object")));
@@ -381,6 +464,10 @@ void EditorPlugin::_bind_methods() {
ClassDB::add_virtual_method(get_class_static(), MethodInfo("set_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("get_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile")));
+ ADD_SIGNAL(MethodInfo("scene_changed", PropertyInfo(Variant::OBJECT, "scene_root:Node")));
+ ADD_SIGNAL(MethodInfo("scene_closed", PropertyInfo(Variant::STRING, "filepath:String")));
+ ADD_SIGNAL(MethodInfo("main_screen_changed", PropertyInfo(Variant::STRING, "screen_name:String")));
+
BIND_CONSTANT(CONTAINER_TOOLBAR);
BIND_CONSTANT(CONTAINER_SPATIAL_EDITOR_MENU);
BIND_CONSTANT(CONTAINER_SPATIAL_EDITOR_SIDE);
@@ -402,6 +489,8 @@ void EditorPlugin::_bind_methods() {
EditorPlugin::EditorPlugin() {
undo_redo = NULL;
+ input_event_forwarding_always_enabled = false;
+ last_main_screen_name = "";
}
EditorPlugin::~EditorPlugin() {
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index 611ef72945..77c5501b25 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,7 @@
#ifndef EDITOR_PLUGIN_H
#define EDITOR_PLUGIN_H
+#include "editor/import/editor_import_plugin.h"
#include "io/config_file.h"
#include "scene/gui/tool_button.h"
#include "scene/main/node.h"
@@ -50,6 +52,8 @@ class EditorImportPlugin;
class EditorExportPlugin;
class EditorResourcePreview;
class EditorFileSystem;
+class EditorToolAddons;
+class ScriptEditor;
class EditorPlugin : public Node {
@@ -59,6 +63,10 @@ class EditorPlugin : public Node {
UndoRedo *_get_undo_redo() { return undo_redo; }
+ bool input_event_forwarding_always_enabled;
+
+ String last_main_screen_name;
+
protected:
static void _bind_methods();
UndoRedo &get_undo_redo() { return *undo_redo; }
@@ -90,7 +98,7 @@ public:
DOCK_SLOT_MAX
};
- //TODO: send a resoucre for editing to the editor node?
+ //TODO: send a resource for editing to the editor node?
void add_control_to_container(CustomControlContainer p_location, Control *p_control);
ToolButton *add_control_to_bottom_panel(Control *p_control, const String &p_title);
@@ -99,21 +107,34 @@ public:
void remove_control_from_bottom_panel(Control *p_control);
Control *get_editor_viewport();
void edit_resource(const Ref<Resource> &p_resource);
+ void open_scene_from_path(const String &scene_path);
+ void reload_scene_from_path(const String &scene_path);
void add_tool_menu_item(const String &p_name, Object *p_handler, const String &p_callback, const Variant &p_ud = Variant());
void add_tool_submenu_item(const String &p_name, Object *p_submenu);
void remove_tool_menu_item(const String &p_name);
+ void set_input_event_forwarding_always_enabled();
+ bool is_input_event_forwarding_always_enabled() { return input_event_forwarding_always_enabled; }
+
+ Node *get_edited_scene_root();
+ Array get_open_scenes() const;
+ ScriptEditor *get_script_editor();
+
+ void notify_main_screen_changed(const String &screen_name);
+ void notify_scene_changed(const Node *scn_root);
+ void notify_scene_closed(const String &scene_filepath);
+
virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial *p_spatial);
- virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event);
+ virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event);
virtual void forward_draw_over_canvas(const Transform2D &p_canvas_xform, Control *p_canvas);
- virtual bool forward_spatial_gui_input(Camera *p_camera, const InputEvent &p_event);
+ virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event);
virtual String get_name() const;
virtual bool has_main_screen() const;
virtual void make_visible(bool p_visible);
virtual void selected_notify() {} //notify that it was raised by the user, not the editor
virtual void edit(Object *p_object);
- virtual bool handles(Object *p_node) const;
+ virtual bool handles(Object *p_object) const;
virtual Dictionary get_state() const; //save editor state so it can't be reloaded when reloading scene
virtual void set_state(const Dictionary &p_state); //restore editor state (likely was saved with the scene)
virtual void clear(); // clear any temporary data in te editor, reset it (likely new scene or load another scene)
@@ -145,6 +166,9 @@ public:
virtual void restore_global_state();
virtual void save_global_state();
+ void add_import_plugin(const Ref<EditorImportPlugin> &p_importer);
+ void remove_import_plugin(const Ref<EditorImportPlugin> &p_importer);
+
EditorPlugin();
virtual ~EditorPlugin();
};
diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp
index 3e7b225a8d..712a3ac001 100644
--- a/editor/editor_plugin_settings.cpp
+++ b/editor/editor_plugin_settings.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,10 +30,10 @@
#include "editor_plugin_settings.h"
#include "editor_node.h"
-#include "global_config.h"
#include "io/config_file.h"
#include "os/file_access.h"
#include "os/main_loop.h"
+#include "project_settings.h"
#include "scene/gui/margin_container.h"
void EditorPluginSettings::_notification(int p_what) {
@@ -81,7 +82,7 @@ void EditorPluginSettings::update_plugins() {
plugins.sort();
- Vector<String> active_plugins = GlobalConfig::get_singleton()->get("plugins/active");
+ Vector<String> active_plugins = ProjectSettings::get_singleton()->get("editor_plugins/enabled");
for (int i = 0; i < plugins.size(); i++) {
@@ -192,15 +193,16 @@ EditorPluginSettings::EditorPluginSettings() {
plugin_list->set_column_expand(1, false);
plugin_list->set_column_expand(2, false);
plugin_list->set_column_expand(3, false);
- plugin_list->set_column_min_width(1, 100);
- plugin_list->set_column_min_width(2, 250);
- plugin_list->set_column_min_width(3, 80);
+ plugin_list->set_column_min_width(1, 100 * EDSCALE);
+ plugin_list->set_column_min_width(2, 250 * EDSCALE);
+ plugin_list->set_column_min_width(3, 80 * EDSCALE);
plugin_list->set_hide_root(true);
plugin_list->connect("item_edited", this, "_plugin_activity_changed");
- MarginContainer *mc = memnew(MarginContainer);
+ VBoxContainer *mc = memnew(VBoxContainer);
mc->add_child(plugin_list);
mc->set_v_size_flags(SIZE_EXPAND_FILL);
+ mc->set_h_size_flags(SIZE_EXPAND_FILL);
add_child(mc);
diff --git a/editor/editor_plugin_settings.h b/editor/editor_plugin_settings.h
index faad933130..472be4c007 100644
--- a/editor/editor_plugin_settings.h
+++ b/editor/editor_plugin_settings.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp
index 1199779cb8..78bc99caae 100644
--- a/editor/editor_profiler.cpp
+++ b/editor/editor_profiler.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -128,10 +129,11 @@ String EditorProfiler::_get_time_as_text(Metric &m, float p_time, int p_calls) {
Color EditorProfiler::_get_color_from_signature(const StringName &p_signature) const {
+ Color bc = get_color("error_color", "Editor");
double rot = ABS(double(p_signature.hash()) / double(0x7FFFFFFF));
Color c;
- c.set_hsv(rot, 1, 1);
- return c;
+ c.set_hsv(rot, bc.get_s(), bc.get_v());
+ return c.linear_interpolate(get_color("base_color", "Editor"), 0.07);
}
void EditorProfiler::_item_edited() {
@@ -343,14 +345,16 @@ void EditorProfiler::_update_plot() {
wr = PoolVector<uint8_t>::Write();
- Image img(w, h, 0, Image::FORMAT_RGBA8, graph_image);
+ Ref<Image> img;
+ img.instance();
+ img->create(w, h, 0, Image::FORMAT_RGBA8, graph_image);
if (reset_texture) {
if (graph_texture.is_null()) {
graph_texture.instance();
}
- graph_texture->create(img.get_width(), img.get_height(), img.get_format(), Texture::FLAG_VIDEO_SURFACE);
+ graph_texture->create(img->get_width(), img->get_height(), img->get_format(), Texture::FLAG_VIDEO_SURFACE);
}
graph_texture->set_data(img);
@@ -384,7 +388,6 @@ void EditorProfiler::_update_frame() {
if (plot_sigs.has(m.categories[i].signature)) {
category->set_checked(0, true);
- category->set_custom_bg_color(0, Color(0, 0, 0));
category->set_custom_color(0, _get_color_from_signature(m.categories[i].signature));
}
@@ -408,7 +411,6 @@ void EditorProfiler::_update_frame() {
if (plot_sigs.has(it.signature)) {
item->set_checked(0, true);
- item->set_custom_bg_color(0, Color(0, 0, 0));
item->set_custom_color(0, _get_color_from_signature(it.signature));
}
}
@@ -480,16 +482,20 @@ void EditorProfiler::_cursor_metric_changed(double) {
_update_frame();
}
-void EditorProfiler::_graph_tex_input(const InputEvent &p_ev) {
+void EditorProfiler::_graph_tex_input(const Ref<InputEvent> &p_ev) {
if (last_metric < 0)
return;
+ Ref<InputEventMouse> me = p_ev;
+ Ref<InputEventMouseButton> mb = p_ev;
+ Ref<InputEventMouseMotion> mm = p_ev;
+
if (
- (p_ev.type == InputEvent::MOUSE_BUTTON && p_ev.mouse_button.button_index == BUTTON_LEFT && p_ev.mouse_button.pressed) ||
- (p_ev.type == InputEvent::MOUSE_MOTION)) {
+ (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) ||
+ (mm.is_valid())) {
- int x = p_ev.mouse_button.x;
+ int x = me->get_position().x;
x = x * frame_metrics.size() / graph->get_size().width;
bool show_hover = x >= 0 && x < frame_metrics.size();
@@ -516,7 +522,7 @@ void EditorProfiler::_graph_tex_input(const InputEvent &p_ev) {
hover_metric = -1;
}
- if (p_ev.type == InputEvent::MOUSE_BUTTON || p_ev.mouse_motion.button_mask & BUTTON_MASK_LEFT) {
+ if (mb.is_valid() || mm->get_button_mask() & BUTTON_MASK_LEFT) {
//cursor_metric=x;
updating_frame = true;
diff --git a/editor/editor_profiler.h b/editor/editor_profiler.h
index c084859942..4998d45a89 100644
--- a/editor/editor_profiler.h
+++ b/editor/editor_profiler.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -142,7 +143,7 @@ private:
void _graph_tex_mouse_exit();
void _graph_tex_draw();
- void _graph_tex_input(const InputEvent &p_ev);
+ void _graph_tex_input(const Ref<InputEvent> &p_ev);
int _get_cursor_index() const;
diff --git a/editor/editor_reimport_dialog.cpp b/editor/editor_reimport_dialog.cpp
index 5904070230..4b71f7046f 100644
--- a/editor/editor_reimport_dialog.cpp
+++ b/editor/editor_reimport_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_reimport_dialog.h b/editor/editor_reimport_dialog.h
index 7379c70c5e..b067630ded 100644
--- a/editor/editor_reimport_dialog.h
+++ b/editor/editor_reimport_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index 281602021f..dcfe68b286 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,11 +31,11 @@
#include "editor_scale.h"
#include "editor_settings.h"
-#include "global_config.h"
#include "io/resource_loader.h"
#include "io/resource_saver.h"
#include "message_queue.h"
#include "os/file_access.h"
+#include "project_settings.h"
bool EditorResourcePreviewGenerator::handles(const String &p_type) const {
@@ -189,7 +190,7 @@ void EditorResourcePreview::_thread() {
} else {
preview_mutex->unlock();
- Ref<Texture> texture;
+ Ref<ImageTexture> texture;
//print_line("pop from queue "+item.path);
@@ -205,7 +206,7 @@ void EditorResourcePreview::_thread() {
} else {
String temp_path = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp");
- String cache_base = GlobalConfig::get_singleton()->globalize_path(item.path).md5_text();
+ String cache_base = ProjectSettings::get_singleton()->globalize_path(item.path).md5_text();
cache_base = temp_path.plus_file("resthumb-" + cache_base);
//does not have it, try to load a cached thumbnail
@@ -228,6 +229,7 @@ void EditorResourcePreview::_thread() {
bool cache_valid = true;
if (tsize != thumbnail_size) {
+
cache_valid = false;
memdelete(f);
} else if (last_modtime != modtime) {
@@ -239,6 +241,7 @@ void EditorResourcePreview::_thread() {
if (last_md5 != md5) {
cache_valid = false;
+
} else {
//update modified time
@@ -251,14 +254,20 @@ void EditorResourcePreview::_thread() {
memdelete(f);
}
- cache_valid = false;
+ //cache_valid = false;
if (cache_valid) {
- texture = ResourceLoader::load(cache_base + ".png", "ImageTexture", true);
- if (!texture.is_valid()) {
+ Ref<Image> img;
+ img.instance();
+
+ if (img->load(cache_base + ".png") != OK) {
//well fuck
cache_valid = false;
+ } else {
+
+ texture.instance();
+ texture->create_from_image(img, Texture::FLAG_FILTER);
}
}
@@ -286,7 +295,7 @@ void EditorResourcePreview::queue_edited_resource_preview(const Ref<Resource> &p
preview_mutex->lock();
- String path_id = "ID:" + itos(p_res->get_instance_ID());
+ String path_id = "ID:" + itos(p_res->get_instance_id());
if (cache.has(path_id) && cache[path_id].last_hash == p_res->hash_edited_version()) {
@@ -301,7 +310,7 @@ void EditorResourcePreview::queue_edited_resource_preview(const Ref<Resource> &p
//print_line("send to thread "+p_path);
QueueItem item;
item.function = p_receiver_func;
- item.id = p_receiver->get_instance_ID();
+ item.id = p_receiver->get_instance_id();
item.resource = p_res;
item.path = path_id;
item.userdata = p_userdata;
@@ -325,7 +334,7 @@ void EditorResourcePreview::queue_resource_preview(const String &p_path, Object
//print_line("send to thread "+p_path);
QueueItem item;
item.function = p_receiver_func;
- item.id = p_receiver->get_instance_ID();
+ item.id = p_receiver->get_instance_id();
item.path = p_path;
item.userdata = p_userdata;
@@ -353,10 +362,10 @@ void EditorResourcePreview::_bind_methods() {
ClassDB::bind_method("_preview_ready", &EditorResourcePreview::_preview_ready);
- 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("queue_resource_preview", "path", "receiver", "receiver_func", "userdata"), &EditorResourcePreview::queue_resource_preview);
+ ClassDB::bind_method(D_METHOD("queue_edited_resource_preview", "resource", "receiver", "receiver_func", "userdata"), &EditorResourcePreview::queue_edited_resource_preview);
+ ClassDB::bind_method(D_METHOD("add_preview_generator", "generator"), &EditorResourcePreview::add_preview_generator);
+ ClassDB::bind_method(D_METHOD("remove_preview_generator", "generator"), &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/editor/editor_resource_preview.h b/editor/editor_resource_preview.h
index ebb280a8cf..cedd571194 100644
--- a/editor/editor_resource_preview.h
+++ b/editor/editor_resource_preview.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -114,8 +115,8 @@ public:
static EditorResourcePreview *get_singleton();
//callback function is callback(String p_path,Ref<Texture> preview,Variant udata) preview null if could not load
- void queue_resource_preview(const String &p_res, Object *p_receiver, const StringName &p_receiver_func, const Variant &p_userdata);
- void queue_edited_resource_preview(const Ref<Resource> &p_path, Object *p_receiver, const StringName &p_receiver_func, const Variant &p_userdata);
+ void queue_resource_preview(const String &p_path, Object *p_receiver, const StringName &p_receiver_func, const Variant &p_userdata);
+ void queue_edited_resource_preview(const Ref<Resource> &p_res, Object *p_receiver, const StringName &p_receiver_func, const Variant &p_userdata);
void add_preview_generator(const Ref<EditorResourcePreviewGenerator> &p_generator);
void remove_preview_generator(const Ref<EditorResourcePreviewGenerator> &p_generator);
diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp
index 99d32ea958..4954b1f741 100644
--- a/editor/editor_run.cpp
+++ b/editor/editor_run.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,7 @@
#include "editor_run.h"
#include "editor_settings.h"
-#include "global_config.h"
+#include "project_settings.h"
EditorRun::Status EditorRun::get_status() const {
@@ -39,7 +40,9 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
List<String> args;
- String resource_path = GlobalConfig::get_singleton()->get_resource_path();
+ String resource_path = ProjectSettings::get_singleton()->get_resource_path();
+ String remote_host = EditorSettings::get_singleton()->get("network/debug/remote_host");
+ int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
if (resource_path != "") {
args.push_back("-path");
@@ -48,11 +51,11 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
if (true) {
args.push_back("-rdebug");
- args.push_back("localhost:" + String::num(GLOBAL_GET("network/debug/remote_port")));
+ args.push_back(remote_host + ":" + String::num(remote_port));
}
args.push_back("-epid");
- args.push_back(String::num(OS::get_singleton()->get_process_ID()));
+ args.push_back(String::num(OS::get_singleton()->get_process_id()));
if (debug_collisions) {
args.push_back("-debugcol");
@@ -71,17 +74,17 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
}
Rect2 screen_rect;
- screen_rect.pos = OS::get_singleton()->get_screen_position(screen);
+ screen_rect.position = OS::get_singleton()->get_screen_position(screen);
screen_rect.size = OS::get_singleton()->get_screen_size(screen);
Size2 desired_size;
- desired_size.x = GlobalConfig::get_singleton()->get("display/width");
- desired_size.y = GlobalConfig::get_singleton()->get("display/height");
+ desired_size.x = ProjectSettings::get_singleton()->get("display/window/size/width");
+ desired_size.y = ProjectSettings::get_singleton()->get("display/window/size/height");
Size2 test_size;
- test_size.x = GlobalConfig::get_singleton()->get("display/test_width");
- test_size.y = GlobalConfig::get_singleton()->get("display/test_height");
+ test_size.x = ProjectSettings::get_singleton()->get("display/window/size/test_width");
+ test_size.y = ProjectSettings::get_singleton()->get("display/window/size/test_height");
if (test_size.x > 0 && test_size.y > 0) {
desired_size = test_size;
@@ -93,21 +96,21 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
case 0: { // default
args.push_back("-p");
- args.push_back(itos(screen_rect.pos.x) + "x" + itos(screen_rect.pos.y));
+ args.push_back(itos(screen_rect.position.x) + "x" + itos(screen_rect.position.y));
} break;
case 1: { // centered
- Vector2 pos = screen_rect.pos + ((screen_rect.size - desired_size) / 2).floor();
+ Vector2 pos = screen_rect.position + ((screen_rect.size - desired_size) / 2).floor();
args.push_back("-p");
args.push_back(itos(pos.x) + "x" + itos(pos.y));
} break;
case 2: { // custom pos
Vector2 pos = EditorSettings::get_singleton()->get("run/window_placement/rect_custom_position");
- pos += screen_rect.pos;
+ pos += screen_rect.position;
args.push_back("-p");
args.push_back(itos(pos.x) + "x" + itos(pos.y));
} break;
case 3: { // force maximized
- Vector2 pos = screen_rect.pos;
+ Vector2 pos = screen_rect.position;
args.push_back("-p");
args.push_back(itos(pos.x) + "x" + itos(pos.y));
args.push_back("-mx");
@@ -115,7 +118,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
} break;
case 4: { // force fullscreen
- Vector2 pos = screen_rect.pos;
+ Vector2 pos = screen_rect.position;
args.push_back("-p");
args.push_back(itos(pos.x) + "x" + itos(pos.y));
args.push_back("-f");
diff --git a/editor/editor_run.h b/editor/editor_run.h
index 796ff8fa3e..aa698ffad1 100644
--- a/editor/editor_run.h
+++ b/editor/editor_run.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp
index fa835ef76a..52b7e6992d 100644
--- a/editor/editor_run_native.cpp
+++ b/editor/editor_run_native.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -40,13 +41,14 @@ void EditorRunNative::_notification(int p_what) {
Ref<EditorExportPlatform> eep = EditorExport::get_singleton()->get_export_platform(i);
if (eep.is_null())
continue;
- Ref<ImageTexture> icon = eep->get_logo();
+ Ref<ImageTexture> icon = eep->get_run_icon();
if (!icon.is_null()) {
- Image im = icon->get_data();
- im.clear_mipmaps();
- if (!im.empty()) {
+ Ref<Image> im = icon->get_data();
+ im = im->duplicate();
+ im->clear_mipmaps();
+ if (!im->empty()) {
- im.resize(16, 16);
+ im->resize(16, 16);
Ref<ImageTexture> small_icon;
small_icon.instance();
small_icon->create_from_image(im, 0);
diff --git a/editor/editor_run_native.h b/editor/editor_run_native.h
index 63c3f02717..9dcfd88eb8 100644
--- a/editor/editor_run_native.h
+++ b/editor/editor_run_native.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_run_script.cpp b/editor/editor_run_script.cpp
index 21c97b4587..8bd1b8f4fd 100644
--- a/editor/editor_run_script.cpp
+++ b/editor/editor_run_script.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_run_script.h b/editor/editor_run_script.h
index 270600db69..2c3b4b85ce 100644
--- a/editor/editor_run_script.h
+++ b/editor/editor_run_script.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_scale.cpp b/editor/editor_scale.cpp
index 027f1edc28..1238cbb405 100644
--- a/editor/editor_scale.cpp
+++ b/editor/editor_scale.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_scale.h b/editor/editor_scale.h
index 035a5056c1..953be2ef81 100644
--- a/editor/editor_scale.h
+++ b/editor/editor_scale.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 2cdf076440..70367f1e07 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -6,6 +6,7 @@
/* http:/www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,6 @@
#include "editor_settings.h"
#include "editor_node.h"
-#include "global_config.h"
#include "io/compression.h"
#include "io/config_file.h"
#include "io/file_access_memory.h"
@@ -40,10 +40,11 @@
#include "os/file_access.h"
#include "os/keyboard.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/main/node.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
#include "scene/main/viewport.h"
-#include "translations.h"
+#include "translations.gen.h"
#include "version.h"
Ref<EditorSettings> EditorSettings::singleton = NULL;
@@ -64,7 +65,7 @@ bool EditorSettings::_set(const StringName &p_name, const Variant &p_value) {
for (int i = 0; i < arr.size(); i += 2) {
String name = arr[i];
- InputEvent shortcut = arr[i + 1];
+ Ref<InputEvent> shortcut = arr[i + 1];
Ref<ShortCut> sc;
sc.instance();
@@ -108,8 +109,8 @@ bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const {
continue; //this came from settings but is not any longer used
}
- InputEvent original = sc->get_meta("original");
- if (sc->is_shortcut(original) || (original.type == InputEvent::NONE && sc->get_shortcut().type == InputEvent::NONE))
+ Ref<InputEvent> original = sc->get_meta("original");
+ if (sc->is_shortcut(original) || (original.is_null() && sc->get_shortcut().is_null()))
continue; //not changed from default, don't save
}
@@ -215,6 +216,46 @@ Variant _EDITOR_DEF(const String &p_var, const Variant &p_default) {
return p_default;
}
+static Dictionary _get_builtin_script_templates() {
+ Dictionary templates;
+
+ //No Comments
+ templates["no_comments.gd"] =
+ "extends %BASE%\n"
+ "\n"
+ "func _ready():\n"
+ "%TS%pass\n";
+
+ //Empty
+ templates["empty.gd"] =
+ "extends %BASE%"
+ "\n"
+ "\n";
+
+ return templates;
+}
+
+static void _create_script_templates(const String &p_path) {
+
+ Dictionary templates = _get_builtin_script_templates();
+ List<Variant> keys;
+ templates.get_key_list(&keys);
+ FileAccess *file = FileAccess::create(FileAccess::ACCESS_FILESYSTEM);
+
+ DirAccess *dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ dir->change_dir(p_path);
+ for (int i = 0; i < keys.size(); i++) {
+ if (!dir->file_exists(keys[i])) {
+ file->reopen(p_path.plus_file((String)keys[i]), FileAccess::WRITE);
+ ERR_FAIL_COND(!file);
+ file->store_string(templates[keys[i]]);
+ file->close();
+ }
+ }
+
+ memdelete(file);
+}
+
void EditorSettings::create() {
if (singleton.ptr())
@@ -291,6 +332,13 @@ void EditorSettings::create() {
dir->change_dir("..");
}
+ if (dir->change_dir("script_templates") != OK) {
+ dir->make_dir("script_templates");
+ } else {
+ dir->change_dir("..");
+ }
+ _create_script_templates(dir->get_current_dir() + "/script_templates");
+
if (dir->change_dir("tmp") != OK) {
dir->make_dir("tmp");
} else {
@@ -307,7 +355,7 @@ void EditorSettings::create() {
dir->change_dir("config");
- String pcp = GlobalConfig::get_singleton()->get_resource_path();
+ String pcp = ProjectSettings::get_singleton()->get_resource_path();
if (pcp.ends_with("/"))
pcp = config_path.substr(0, pcp.size() - 1);
pcp = pcp.get_file() + "-" + pcp.md5_text();
@@ -406,13 +454,12 @@ void EditorSettings::setup_network() {
IP::get_singleton()->get_local_addresses(&local_ip);
String lip;
String hint;
- String current = get("network/debug_host");
+ String current = has("network/debug/remote_host") ? get("network/debug/remote_host") : "";
+ int port = has("network/debug/remote_port") ? (int)get("network/debug/remote_port") : 6007;
for (List<IP_Address>::Element *E = local_ip.front(); E; E = E->next()) {
String ip = E->get();
- if (ip == "127.0.0.1")
- continue;
if (lip == "")
lip = ip;
@@ -423,8 +470,11 @@ void EditorSettings::setup_network() {
hint += ip;
}
- set("network/debug_host", lip);
- add_property_hint(PropertyInfo(Variant::STRING, "network/debug_host", PROPERTY_HINT_ENUM, hint));
+ set("network/debug/remote_host", lip);
+ add_property_hint(PropertyInfo(Variant::STRING, "network/debug/remote_host", PROPERTY_HINT_ENUM, hint));
+
+ set("network/debug/remote_port", port);
+ add_property_hint(PropertyInfo(Variant::INT, "network/debug/remote_port", PROPERTY_HINT_RANGE, "1,65535,1"));
}
void EditorSettings::save() {
@@ -499,15 +549,38 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("interface/source_font_size", 14);
hints["interface/source_font_size"] = PropertyInfo(Variant::INT, "interface/source_font_size", PROPERTY_HINT_RANGE, "8,96,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("interface/custom_font", "");
- hints["interface/custom_font"] = PropertyInfo(Variant::STRING, "interface/custom_font", PROPERTY_HINT_GLOBAL_FILE, "*.fnt", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
- set("interface/custom_theme", "");
- hints["interface/custom_theme"] = PropertyInfo(Variant::STRING, "interface/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+ hints["interface/custom_font"] = PropertyInfo(Variant::STRING, "interface/custom_font", PROPERTY_HINT_GLOBAL_FILE, "*.font", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("interface/dim_editor_on_dialog_popup", true);
set("interface/dim_amount", 0.6f);
hints["interface/dim_amount"] = PropertyInfo(Variant::REAL, "interface/dim_amount", PROPERTY_HINT_RANGE, "0,1,0.01", PROPERTY_USAGE_DEFAULT);
- set("interface/dim_transition_time", 0.11f);
+ set("interface/dim_transition_time", 0.08f);
hints["interface/dim_transition_time"] = PropertyInfo(Variant::REAL, "interface/dim_transition_time", PROPERTY_HINT_RANGE, "0,1,0.001", PROPERTY_USAGE_DEFAULT);
+ set("interface/separate_distraction_mode", false);
+
+ set("interface/save_each_scene_on_quit", true); // Regression
+ set("interface/quit_confirmation", true);
+
+ set("interface/theme/preset", 0);
+ hints["interface/theme/preset"] = PropertyInfo(Variant::INT, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Grey,Godot 2,Arc,Custom", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+ set("interface/theme/base_color", Color::html("#323b4f"));
+ hints["interface/theme/highlight_color"] = PropertyInfo(Variant::COLOR, "interface/theme/highlight_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+ set("interface/theme/highlight_color", Color::html("#699ce8"));
+ hints["interface/theme/base_color"] = PropertyInfo(Variant::COLOR, "interface/theme/base_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+ set("interface/theme/contrast", 0.2);
+ hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01");
+ set("interface/theme/highlight_tabs", false);
+ set("interface/theme/border_size", 1);
+ hints["interface/theme/border_size"] = PropertyInfo(Variant::INT, "interface/theme/border_size", PROPERTY_HINT_RANGE, "0,2,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+ set("interface/theme/custom_theme", "");
+ hints["interface/theme/custom_theme"] = PropertyInfo(Variant::STRING, "interface/theme/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+
+ set("interface/scene_tabs/show_extension", false);
+ set("interface/scene_tabs/show_thumbnail_on_hover", true);
+ set("interface/scene_tabs/resize_if_many_tabs", true);
+ set("interface/scene_tabs/minimum_width", 50);
+ hints["interface/scene_tabs/minimum_width"] = PropertyInfo(Variant::INT, "interface/scene_tabs/minimum_width", PROPERTY_HINT_RANGE, "50,500,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+
set("filesystem/directories/autoscan_project_path", "");
hints["filesystem/directories/autoscan_project_path"] = PropertyInfo(Variant::STRING, "filesystem/directories/autoscan_project_path", PROPERTY_HINT_GLOBAL_DIR);
set("filesystem/directories/default_project_path", "");
@@ -528,8 +601,11 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("text_editor/highlighting/highlight_all_occurrences", true);
set("text_editor/cursor/scroll_past_end_of_file", false);
- set("text_editor/indent/tab_size", 4);
- hints["text_editor/indent/tab_size"] = PropertyInfo(Variant::INT, "text_editor/indent/tab_size", PROPERTY_HINT_RANGE, "1, 64, 1"); // size of 0 crashes.
+ set("text_editor/indent/type", 0);
+ hints["text_editor/indent/type"] = PropertyInfo(Variant::INT, "text_editor/indent/type", PROPERTY_HINT_ENUM, "Tabs,Spaces");
+ set("text_editor/indent/size", 4);
+ hints["text_editor/indent/size"] = PropertyInfo(Variant::INT, "text_editor/indent/size", PROPERTY_HINT_RANGE, "1, 64, 1"); // size of 0 crashes.
+ set("text_editor/indent/convert_indent_on_save", false);
set("text_editor/indent/draw_tabs", true);
set("text_editor/line_numbers/show_line_numbers", true);
@@ -539,6 +615,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("text_editor/line_numbers/line_length_guideline_column", 80);
hints["text_editor/line_numbers/line_length_guideline_column"] = PropertyInfo(Variant::INT, "text_editor/line_numbers/line_length_guideline_column", PROPERTY_HINT_RANGE, "20, 160, 10");
+ set("text_editor/open_scripts/show_members_overview", true);
+
set("text_editor/files/trim_trailing_whitespace_on_save", false);
set("text_editor/completion/idle_parse_delay", 2);
set("text_editor/tools/create_signal_callbacks", true);
@@ -550,9 +628,12 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
hints["text_editor/cursor/caret_blink_speed"] = PropertyInfo(Variant::REAL, "text_editor/cursor/caret_blink_speed", PROPERTY_HINT_RANGE, "0.1, 10, 0.1");
set("text_editor/theme/font", "");
- hints["text_editor/theme/font"] = PropertyInfo(Variant::STRING, "text_editor/theme/font", PROPERTY_HINT_GLOBAL_FILE, "*.fnt");
+ hints["text_editor/theme/font"] = PropertyInfo(Variant::STRING, "text_editor/theme/font", PROPERTY_HINT_GLOBAL_FILE, "*.font");
set("text_editor/completion/auto_brace_complete", false);
set("text_editor/files/restore_scripts_on_load", true);
+ set("text_editor/completion/complete_file_paths", true);
+ set("text_editor/files/maximum_recent_files", 20);
+ hints["text_editor/files/maximum_recent_files"] = PropertyInfo(Variant::INT, "text_editor/files/maximum_recent_files", PROPERTY_HINT_RANGE, "1, 200, 0");
//set("docks/scene_tree/display_old_action_buttons",false);
set("docks/scene_tree/start_create_dialog_fully_expanded", false);
@@ -561,10 +642,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("editors/grid_map/pick_distance", 5000.0);
- set("editors/3d/grid_color", Color(0, 1, 0, 0.2));
+ set("editors/3d/grid_color", Color(1, 1, 1, 0.2));
hints["editors/3d/grid_color"] = PropertyInfo(Variant::COLOR, "editors/3d/grid_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
- set("editors/3d/default_fov", 45.0);
+ set("editors/3d/default_fov", 55.0);
set("editors/3d/default_z_near", 0.1);
set("editors/3d/default_z_far", 500.0);
@@ -582,17 +663,26 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("editors/3d/emulate_3_button_mouse", false);
set("editors/3d/warped_mouse_panning", true);
+ set("editors/3d/freelook_base_speed", 1);
+
+ set("editors/3d/freelook_activation_modifier", 0);
+ hints["editors/3d/freelook_activation_modifier"] = PropertyInfo(Variant::INT, "editors/3d/freelook_activation_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl");
+
+ set("editors/3d/freelook_modifier_speed_factor", 5.0);
+
set("editors/2d/bone_width", 5);
set("editors/2d/bone_color1", Color(1.0, 1.0, 1.0, 0.9));
set("editors/2d/bone_color2", Color(0.75, 0.75, 0.75, 0.9));
set("editors/2d/bone_selected_color", Color(0.9, 0.45, 0.45, 0.9));
set("editors/2d/bone_ik_color", Color(0.9, 0.9, 0.45, 0.9));
-
set("editors/2d/keep_margins_when_changing_anchors", false);
-
set("editors/2d/warped_mouse_panning", true);
+ set("editors/2d/scroll_to_pan", false);
+ set("editors/2d/pan_speed", 20);
+
+ set("editors/poly_editor/point_grab_radius", 8);
- set("run/window_placement/rect", 0);
+ set("run/window_placement/rect", 1);
hints["run/window_placement/rect"] = PropertyInfo(Variant::INT, "run/window_placement/rect", PROPERTY_HINT_ENUM, "Default,Centered,Custom Position,Force Maximized,Force Full Screen");
String screen_hints = TTR("Default (Same as Editor)");
for (int i = 0; i < OS::get_singleton()->get_screen_count(); i++) {
@@ -695,7 +785,7 @@ void EditorSettings::_load_default_text_editor_theme() {
set("text_editor/highlighting/string_color", Color::html("ef6ebe"));
set("text_editor/highlighting/number_color", Color::html("EB9532"));
set("text_editor/highlighting/symbol_color", Color::html("badfff"));
- set("text_editor/highlighting/selection_color", Color::html("7b5dbe"));
+ set("text_editor/highlighting/selection_color", Color::html("6ca9c2"));
set("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2));
set("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15));
set("text_editor/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1));
@@ -753,9 +843,9 @@ void EditorSettings::add_property_hint(const PropertyInfo &p_hint) {
hints[p_hint.name] = p_hint;
}
-void EditorSettings::set_favorite_dirs(const Vector<String> &p_favorites) {
+void EditorSettings::set_favorite_dirs(const Vector<String> &p_favorites_dirs) {
- favorite_dirs = p_favorites;
+ favorite_dirs = p_favorites_dirs;
FileAccess *f = FileAccess::open(get_project_settings_path().plus_file("favorite_dirs"), FileAccess::WRITE);
if (f) {
for (int i = 0; i < favorite_dirs.size(); i++)
@@ -769,9 +859,9 @@ Vector<String> EditorSettings::get_favorite_dirs() const {
return favorite_dirs;
}
-void EditorSettings::set_recent_dirs(const Vector<String> &p_recent) {
+void EditorSettings::set_recent_dirs(const Vector<String> &p_recent_dirs) {
- recent_dirs = p_recent;
+ recent_dirs = p_recent_dirs;
FileAccess *f = FileAccess::open(get_project_settings_path().plus_file("recent_dirs"), FileAccess::WRITE);
if (f) {
for (int i = 0; i < recent_dirs.size(); i++)
@@ -919,6 +1009,25 @@ bool EditorSettings::save_text_editor_theme_as(String p_file) {
return false;
}
+Vector<String> EditorSettings::get_script_templates(const String &p_extension) {
+
+ Vector<String> templates;
+ DirAccess *d = DirAccess::open(settings_path + "/script_templates");
+ if (d) {
+ d->list_dir_begin();
+ String file = d->get_next();
+ while (file != String()) {
+ if (file.get_extension() == p_extension) {
+ templates.push_back(file.get_basename());
+ }
+ file = d->get_next();
+ }
+ d->list_dir_end();
+ memdelete(d);
+ }
+ return templates;
+}
+
bool EditorSettings::_save_text_editor_theme(String p_file) {
String theme_section = "color_theme";
Ref<ConfigFile> cf = memnew(ConfigFile); // hex is better?
@@ -965,7 +1074,7 @@ void EditorSettings::add_shortcut(const String &p_name, Ref<ShortCut> &p_shortcu
shortcuts[p_name] = p_shortcut;
}
-bool EditorSettings::is_shortcut(const String &p_name, const InputEvent &p_event) const {
+bool EditorSettings::is_shortcut(const String &p_name, const Ref<InputEvent> &p_event) const {
const Map<String, Ref<ShortCut> >::Element *E = shortcuts.find(p_name);
if (!E) {
@@ -1082,15 +1191,16 @@ Ref<ShortCut> ED_GET_SHORTCUT(const String &p_path) {
Ref<ShortCut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p_keycode) {
- InputEvent ie;
+ Ref<InputEventKey> ie;
if (p_keycode) {
- ie.type = InputEvent::KEY;
- ie.key.unicode = p_keycode & KEY_CODE_MASK;
- ie.key.scancode = p_keycode & KEY_CODE_MASK;
- ie.key.mod.shift = bool(p_keycode & KEY_MASK_SHIFT);
- ie.key.mod.alt = bool(p_keycode & KEY_MASK_ALT);
- ie.key.mod.control = bool(p_keycode & KEY_MASK_CTRL);
- ie.key.mod.meta = bool(p_keycode & KEY_MASK_META);
+ ie.instance();
+
+ ie->set_unicode(p_keycode & KEY_CODE_MASK);
+ ie->set_scancode(p_keycode & KEY_CODE_MASK);
+ ie->set_shift(bool(p_keycode & KEY_MASK_SHIFT));
+ ie->set_alt(bool(p_keycode & KEY_MASK_ALT));
+ ie->set_control(bool(p_keycode & KEY_MASK_CTRL));
+ ie->set_metakey(bool(p_keycode & KEY_MASK_META));
}
Ref<ShortCut> sc = EditorSettings::get_singleton()->get_shortcut(p_path);
diff --git a/editor/editor_settings.h b/editor/editor_settings.h
index 4e084e5291..a99d7e0ad5 100644
--- a/editor/editor_settings.h
+++ b/editor/editor_settings.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -144,7 +145,7 @@ public:
void add_property_hint(const PropertyInfo &p_hint);
- void set_favorite_dirs(const Vector<String> &p_favorite_dirs);
+ void set_favorite_dirs(const Vector<String> &p_favorites_dirs);
Vector<String> get_favorite_dirs() const;
void set_recent_dirs(const Vector<String> &p_recent_dirs);
@@ -158,8 +159,10 @@ public:
bool save_text_editor_theme();
bool save_text_editor_theme_as(String p_file);
+ Vector<String> get_script_templates(const String &p_extension);
+
void add_shortcut(const String &p_name, Ref<ShortCut> &p_shortcut);
- bool is_shortcut(const String &p_name, const InputEvent &p_event) const;
+ bool is_shortcut(const String &p_name, const Ref<InputEvent> &p_event) const;
Ref<ShortCut> get_shortcut(const String &p_name) const;
void get_shortcut_list(List<String> *r_shortcuts);
diff --git a/editor/editor_sub_scene.cpp b/editor/editor_sub_scene.cpp
index 01c08bb231..c107d3687e 100644
--- a/editor/editor_sub_scene.cpp
+++ b/editor/editor_sub_scene.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_sub_scene.h b/editor/editor_sub_scene.h
index 9739f49a45..3a11a13b53 100644
--- a/editor/editor_sub_scene.h
+++ b/editor/editor_sub_scene.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index adb4c8162e..11150371d2 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,25 +35,506 @@
#include "editor_scale.h"
#include "editor_settings.h"
+static Ref<StyleBoxTexture> make_stylebox(Ref<Texture> texture, float p_left, float p_top, float p_right, float p_botton, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_botton = -1, bool p_draw_center = true) {
+ Ref<StyleBoxTexture> style(memnew(StyleBoxTexture));
+ style->set_texture(texture);
+ style->set_margin_size(MARGIN_LEFT, p_left * EDSCALE);
+ style->set_margin_size(MARGIN_RIGHT, p_right * EDSCALE);
+ style->set_margin_size(MARGIN_BOTTOM, p_botton * EDSCALE);
+ style->set_margin_size(MARGIN_TOP, p_top * EDSCALE);
+ style->set_default_margin(MARGIN_LEFT, p_margin_left * EDSCALE);
+ style->set_default_margin(MARGIN_RIGHT, p_margin_right * EDSCALE);
+ style->set_default_margin(MARGIN_BOTTOM, p_margin_botton * EDSCALE);
+ style->set_default_margin(MARGIN_TOP, p_margin_top * EDSCALE);
+ style->set_draw_center(p_draw_center);
+ return style;
+}
+
+static Ref<StyleBoxEmpty> make_empty_stylebox(float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_bottom = -1) {
+ Ref<StyleBoxEmpty> style(memnew(StyleBoxEmpty));
+ style->set_default_margin(MARGIN_LEFT, p_margin_left * EDSCALE);
+ style->set_default_margin(MARGIN_RIGHT, p_margin_right * EDSCALE);
+ style->set_default_margin(MARGIN_BOTTOM, p_margin_bottom * EDSCALE);
+ style->set_default_margin(MARGIN_TOP, p_margin_top * EDSCALE);
+ return style;
+}
+
+static Ref<StyleBoxFlat> make_flat_stylebox(Color color, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_bottom = -1) {
+ Ref<StyleBoxFlat> style(memnew(StyleBoxFlat));
+ style->set_bg_color(color);
+ style->set_default_margin(MARGIN_LEFT, p_margin_left * EDSCALE);
+ style->set_default_margin(MARGIN_RIGHT, p_margin_right * EDSCALE);
+ style->set_default_margin(MARGIN_BOTTOM, p_margin_bottom * EDSCALE);
+ style->set_default_margin(MARGIN_TOP, p_margin_top * EDSCALE);
+ return style;
+}
+
+static Ref<StyleBoxLine> make_line_stylebox(Color color, int thickness = 1, float grow = 1, bool vertical = false) {
+ Ref<StyleBoxLine> style(memnew(StyleBoxLine));
+ style->set_color(color);
+ style->set_grow(grow);
+ style->set_thickness(thickness);
+ style->set_vertical(vertical);
+ return style;
+}
+
+static Ref<StyleBoxFlat> change_border_color(Ref<StyleBoxFlat> p_style, Color p_color) {
+ Ref<StyleBoxFlat> style = p_style->duplicate();
+ style->set_border_color_all(p_color);
+ return style;
+}
+
+static Ref<StyleBoxFlat> add_additional_border(Ref<StyleBoxFlat> p_style, int p_left, int p_top, int p_right, int p_bottom) {
+ Ref<StyleBoxFlat> style = p_style->duplicate();
+ style->set_border_width(MARGIN_LEFT, p_left * EDSCALE + style->get_border_width(MARGIN_LEFT));
+ style->set_border_width(MARGIN_RIGHT, p_right * EDSCALE + style->get_border_width(MARGIN_RIGHT));
+ style->set_border_width(MARGIN_TOP, p_top * EDSCALE + style->get_border_width(MARGIN_TOP));
+ style->set_border_width(MARGIN_BOTTOM, p_bottom * EDSCALE + style->get_border_width(MARGIN_BOTTOM));
+ style->set_expand_margin_size(MARGIN_LEFT, p_left * EDSCALE);
+ style->set_expand_margin_size(MARGIN_RIGHT, p_right * EDSCALE);
+ style->set_expand_margin_size(MARGIN_TOP, p_top * EDSCALE);
+ style->set_expand_margin_size(MARGIN_BOTTOM, p_bottom * EDSCALE);
+ return style;
+}
+
+#define HIGHLIGHT_COLOR_LIGHT highlight_color.linear_interpolate(Color(1, 1, 1, 1), 0.3)
+#define HIGHLIGHT_COLOR_DARK highlight_color.linear_interpolate(Color(0, 0, 0, 1), 0.5)
+
Ref<Theme> create_editor_theme() {
Ref<Theme> theme = Ref<Theme>(memnew(Theme));
editor_register_fonts(theme);
editor_register_icons(theme);
- Ref<StyleBoxTexture> focus_sbt = memnew(StyleBoxTexture);
- focus_sbt->set_texture(theme->get_icon("EditorFocus", "EditorIcons"));
- for (int i = 0; i < 4; i++) {
- focus_sbt->set_margin_size(Margin(i), 16 * EDSCALE);
- focus_sbt->set_default_margin(Margin(i), 16 * EDSCALE);
+ const float default_contrast = 0.25;
+
+ // Define colors
+ Color highlight_color = EDITOR_DEF("interface/theme/highlight_color", Color::html("#000000"));
+ Color base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#000000"));
+ float contrast = EDITOR_DEF("interface/theme/contrast", default_contrast);
+ int preset = EDITOR_DEF("interface/theme/preset", 0);
+ bool highlight_tabs = EDITOR_DEF("interface/theme/highlight_tabs", false);
+ int border_size = EDITOR_DEF("interface/theme/border_size", 1);
+
+ switch (preset) {
+ case 0: { // Default
+ highlight_color = Color::html("#699ce8");
+ base_color = Color::html("#323b4f");
+ contrast = default_contrast;
+ } break;
+ case 1: { // Grey
+ highlight_color = Color::html("#3e3e3e");
+ base_color = Color::html("#3d3d3d");
+ contrast = 0.2;
+ } break;
+ case 2: { // Godot 2
+ highlight_color = Color::html("#86ace2");
+ base_color = Color::html("#3C3A44");
+ contrast = 0.25;
+ } break;
+ case 3: { // Arc
+ highlight_color = Color::html("#5294e2");
+ base_color = Color::html("#383c4a");
+ contrast = 0.25;
+ } break;
}
- focus_sbt->set_draw_center(false);
- theme->set_stylebox("EditorFocus", "EditorStyles", focus_sbt);
- theme->set_color("prop_category", "Editor", Color::hex(0x3f3a44ff));
- theme->set_color("prop_section", "Editor", Color::hex(0x35313aff));
- theme->set_color("prop_subsection", "Editor", Color::hex(0x312e37ff));
- theme->set_color("fg_selected", "Editor", Color::html("ffbd8e8e"));
+
+ Color dark_color_1 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast);
+ Color dark_color_2 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 1.5);
+ Color dark_color_3 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 2);
+
+ Color light_color_1 = base_color.linear_interpolate(Color(1, 1, 1, 1), contrast);
+ Color light_color_2 = base_color.linear_interpolate(Color(1, 1, 1, 1), contrast * 1.5);
+
+ const int border_width = CLAMP(border_size, 0, 3) * EDSCALE;
+
+ Color title_color_hl = base_color;
+ if (highlight_tabs)
+ title_color_hl = base_color.linear_interpolate(Color(1, 1, 1, 1), contrast / default_contrast / 10);
+ bool dark_bg = ((title_color_hl.r + title_color_hl.g + title_color_hl.b) / 3.0) < 0.5;
+ Color title_color_hl_text_color = dark_bg ? Color(1, 1, 1, 0.9) : Color(0, 0, 0, 0.9);
+ Ref<Texture> title_hl_close_icon = theme->get_icon((dark_bg ? "GuiCloseLight" : "GuiCloseDark"), "EditorIcons");
+
+ bool dark_base = ((base_color.r + base_color.g + base_color.b) / 3.0) < 0.5;
+ Color separator_color = dark_base ? Color(1, 1, 1, 0.1) : Color(0, 0, 0, 0.1);
+
+ theme->set_color("highlight_color", "Editor", highlight_color);
+ theme->set_color("base_color", "Editor", base_color);
+ theme->set_color("dark_color_1", "Editor", dark_color_1);
+ theme->set_color("dark_color_2", "Editor", dark_color_2);
+ theme->set_color("dark_color_3", "Editor", dark_color_3);
+ theme->set_color("light_color_1", "Editor", light_color_1);
+ theme->set_color("light_color_2", "Editor", light_color_2);
+
+ Color success_color = highlight_color.linear_interpolate(Color(.6, 1, .6), 0.8);
+ Color warning_color = highlight_color.linear_interpolate(Color(1, 1, .2), 0.8);
+ Color error_color = highlight_color.linear_interpolate(Color(1, .2, .2), 0.8);
+ theme->set_color("success_color", "Editor", success_color);
+ theme->set_color("warning_color", "Editor", warning_color);
+ theme->set_color("error_color", "Editor", error_color);
+
+ // Checkbox icon
+ theme->set_icon("checked", "CheckBox", theme->get_icon("GuiChecked", "EditorIcons"));
+ theme->set_icon("unchecked", "CheckBox", theme->get_icon("GuiUnchecked", "EditorIcons"));
+ theme->set_icon("checked", "PopupMenu", theme->get_icon("GuiChecked", "EditorIcons"));
+ theme->set_icon("unchecked", "PopupMenu", theme->get_icon("GuiUnchecked", "EditorIcons"));
+ theme->set_icon("radio_checked", "CheckBox", theme->get_icon("GuiRadioChecked", "EditorIcons"));
+ theme->set_icon("radio_unchecked", "CheckBox", theme->get_icon("GuiRadioUnchecked", "EditorIcons"));
+ theme->set_icon("radio_checked", "PopupMenu", theme->get_icon("GuiChecked", "EditorIcons"));
+ theme->set_icon("radio_unchecked", "PopupMenu", theme->get_icon("GuiUnchecked", "EditorIcons"));
+
+ // Editor background
+ Ref<StyleBoxFlat> style_panel = make_flat_stylebox(dark_color_2, 4, 4, 4, 4);
+ theme->set_stylebox("Background", "EditorStyles", style_panel);
+
+ // Focus
+ Ref<StyleBoxFlat> focus_sbt = make_flat_stylebox(light_color_1, 4, 4, 4, 4);
+ focus_sbt->set_filled(false);
+ focus_sbt->set_border_width_all(1 * EDSCALE);
+ focus_sbt = change_border_color(focus_sbt, light_color_2);
+ theme->set_stylebox("Focus", "EditorStyles", focus_sbt);
+
+ // Menu
+ Ref<StyleBoxEmpty> style_menu = make_empty_stylebox(4, 4, 4, 4);
+ theme->set_stylebox("panel", "PanelContainer", style_menu);
+ theme->set_stylebox("MenuPanel", "EditorStyles", style_menu);
+
+ // Play button group
+ theme->set_stylebox("PlayButtonPanel", "EditorStyles", make_stylebox(theme->get_icon("GuiPlayButtonGroup", "EditorIcons"), 16, 16, 16, 16, 8, 4, 8, 4));
+
+ Ref<StyleBoxFlat> style_menu_hover_border = make_flat_stylebox(highlight_color, 4, 4, 4, 4);
+ Ref<StyleBoxFlat> style_menu_hover_bg = make_flat_stylebox(dark_color_2, 4, 4, 4, 4);
+
+ style_menu_hover_border->set_filled(false);
+ style_menu_hover_border->set_border_width(MARGIN_BOTTOM, border_width);
+ style_menu_hover_border->set_expand_margin_size(MARGIN_BOTTOM, border_width);
+
+ theme->set_stylebox("normal", "MenuButton", style_menu);
+ theme->set_stylebox("hover", "MenuButton", style_menu);
+ theme->set_stylebox("pressed", "MenuButton", style_menu);
+ theme->set_stylebox("focus", "MenuButton", style_menu);
+ theme->set_stylebox("disabled", "MenuButton", style_menu);
+
+ theme->set_stylebox("normal", "PopupMenu", style_menu);
+ theme->set_stylebox("hover", "PopupMenu", style_menu_hover_bg);
+ theme->set_stylebox("pressed", "PopupMenu", style_menu);
+ theme->set_stylebox("focus", "PopupMenu", style_menu);
+ theme->set_stylebox("disabled", "PopupMenu", style_menu);
+
+ theme->set_stylebox("normal", "ToolButton", style_menu);
+ theme->set_stylebox("hover", "ToolButton", style_menu);
+ theme->set_stylebox("pressed", "ToolButton", style_menu);
+ theme->set_stylebox("focus", "ToolButton", style_menu);
+ theme->set_stylebox("disabled", "ToolButton", style_menu);
+
+ theme->set_color("font_color_hover", "MenuButton", HIGHLIGHT_COLOR_LIGHT);
+ theme->set_color("font_color_hover", "ToolButton", HIGHLIGHT_COLOR_LIGHT);
+ theme->set_color("font_color_pressed", "ToolButton", highlight_color);
+
+ theme->set_stylebox("MenuHover", "EditorStyles", style_menu_hover_border);
+
+ // Content of each tab
+ Ref<StyleBoxFlat> style_content_panel = make_flat_stylebox(base_color, 4, 5, 4, 4);
+ style_content_panel->set_border_color_all(title_color_hl);
+ style_content_panel->set_border_width_all(border_width);
+ Ref<StyleBoxFlat> style_content_panel_vp = make_flat_stylebox(base_color, border_width, 5, border_width, border_width);
+ style_content_panel_vp->set_border_color_all(title_color_hl);
+ style_content_panel_vp->set_border_width_all(border_width);
+ theme->set_stylebox("panel", "TabContainer", style_content_panel);
+ theme->set_stylebox("Content", "EditorStyles", style_content_panel_vp);
+
+ Ref<StyleBoxFlat> style_button_type = make_flat_stylebox(dark_color_1, 6, 4, 6, 4);
+ style_button_type->set_filled(true);
+ style_button_type->set_border_width_all(border_width);
+ style_button_type->set_border_color_all(light_color_1);
+
+ Ref<StyleBoxFlat> style_button_type_disabled = change_border_color(style_button_type, dark_color_2);
+
+ Color button_font_color = light_color_1.linear_interpolate(Color(1, 1, 1, 1), .6);
+
+ // Button
+ theme->set_stylebox("normal", "Button", style_button_type);
+ theme->set_stylebox("hover", "Button", change_border_color(style_button_type, HIGHLIGHT_COLOR_LIGHT));
+ theme->set_stylebox("pressed", "Button", change_border_color(style_button_type, highlight_color));
+ theme->set_stylebox("focus", "Button", change_border_color(style_button_type, highlight_color));
+ theme->set_stylebox("disabled", "Button", style_button_type_disabled);
+ theme->set_color("font_color", "Button", button_font_color);
+
+ theme->set_color("font_color_hover", "Button", HIGHLIGHT_COLOR_LIGHT);
+ theme->set_color("font_color_pressed", "Button", highlight_color);
+ theme->set_color("icon_color_hover", "Button", HIGHLIGHT_COLOR_LIGHT);
+ // make icon color value bigger because icon image is not complete white
+ theme->set_color("icon_color_pressed", "Button", Color(highlight_color.r * 1.15, highlight_color.g * 1.15, highlight_color.b * 1.15, highlight_color.a));
+
+ // OptionButton
+ Ref<StyleBoxFlat> style_option_button = make_flat_stylebox(dark_color_1, 4, 4, 4, 4);
+ style_option_button->set_border_width_all(border_width);
+ style_option_button->set_border_color_all(light_color_1);
+ theme->set_stylebox("hover", "OptionButton", change_border_color(style_button_type, HIGHLIGHT_COLOR_LIGHT));
+ theme->set_stylebox("pressed", "OptionButton", change_border_color(style_button_type, highlight_color));
+ theme->set_stylebox("focus", "OptionButton", change_border_color(style_button_type, highlight_color));
+ theme->set_stylebox("disabled", "OptionButton", style_button_type_disabled);
+ theme->set_stylebox("normal", "OptionButton", style_button_type);
+ theme->set_color("font_color", "OptionButton", button_font_color);
+ theme->set_color("font_color_hover", "OptionButton", HIGHLIGHT_COLOR_LIGHT);
+ theme->set_color("font_color_pressed", "OptionButton", highlight_color);
+ theme->set_color("icon_color_hover", "OptionButton", HIGHLIGHT_COLOR_LIGHT);
+ theme->set_icon("arrow", "OptionButton", theme->get_icon("GuiOptionArrow", "EditorIcons"));
+ theme->set_constant("arrow_margin", "OptionButton", 4);
+ theme->set_constant("modulate_arrow", "OptionButton", true);
+
+ // CheckButton
+ theme->set_icon("on", "CheckButton", theme->get_icon("GuiToggleOn", "EditorIcons"));
+ theme->set_icon("off", "CheckButton", theme->get_icon("GuiToggleOff", "EditorIcons"));
+
+ // PopupMenu
+ Ref<StyleBoxFlat> style_popup_menu = make_flat_stylebox(dark_color_1, 8, 8, 8, 8);
+ style_popup_menu->set_border_width_all(MAX(EDSCALE, border_width));
+ style_popup_menu->set_border_color_all(light_color_1);
+ theme->set_stylebox("panel", "PopupMenu", style_popup_menu);
+ theme->set_stylebox("separator", "PopupMenu", make_line_stylebox(separator_color, MAX(EDSCALE, border_width), 8 - MAX(EDSCALE, border_width)));
+
+ // Tree & ItemList background
+ Ref<StyleBoxFlat> style_tree_bg = make_flat_stylebox(dark_color_1, 2, 4, 2, 4);
+ style_tree_bg->set_border_width_all(border_width);
+ style_tree_bg->set_border_color_all(dark_color_3);
+ theme->set_stylebox("bg", "Tree", style_tree_bg);
+ // Script background
+ Ref<StyleBoxFlat> style_script_bg = make_flat_stylebox(dark_color_1, 0, 0, 0, 0);
+ style_script_bg->set_border_width_all(border_width);
+ style_script_bg->set_border_color_all(dark_color_3);
+ theme->set_stylebox("ScriptPanel", "EditorStyles", style_script_bg);
+
+ // Tree
+ theme->set_icon("checked", "Tree", theme->get_icon("GuiChecked", "EditorIcons"));
+ theme->set_icon("unchecked", "Tree", theme->get_icon("GuiUnchecked", "EditorIcons"));
+ theme->set_icon("arrow", "Tree", theme->get_icon("GuiTreeArrowDown", "EditorIcons"));
+ theme->set_icon("arrow_collapsed", "Tree", theme->get_icon("GuiTreeArrowRight", "EditorIcons"));
+ theme->set_icon("select_arrow", "Tree", theme->get_icon("GuiDropdown", "EditorIcons"));
+ theme->set_stylebox("bg_focus", "Tree", focus_sbt);
+ theme->set_stylebox("custom_button", "Tree", make_empty_stylebox());
+ theme->set_stylebox("custom_button_pressed", "Tree", make_empty_stylebox());
+ theme->set_stylebox("custom_button_hover", "Tree", style_button_type);
+ theme->set_color("custom_button_font_highlight", "Tree", HIGHLIGHT_COLOR_LIGHT);
+
+ Ref<StyleBox> style_tree_btn = make_flat_stylebox(light_color_1, 2, 4, 2, 4);
+ theme->set_stylebox("button_pressed", "Tree", style_tree_btn);
+
+ Ref<StyleBoxFlat> style_tree_focus = make_flat_stylebox(HIGHLIGHT_COLOR_DARK, 2, 2, 2, 2);
+ theme->set_stylebox("selected_focus", "Tree", style_tree_focus);
+
+ Ref<StyleBoxFlat> style_tree_selected = make_flat_stylebox(HIGHLIGHT_COLOR_DARK, 2, 2, 2, 2);
+ theme->set_stylebox("selected", "Tree", style_tree_selected);
+
+ Ref<StyleBoxFlat> style_tree_cursor = make_flat_stylebox(HIGHLIGHT_COLOR_DARK, 4, 4, 4, 4);
+ style_tree_cursor->set_filled(false);
+ style_tree_cursor->set_border_width_all(border_width);
+ style_tree_cursor->set_border_color_all(light_color_1);
+
+ Ref<StyleBoxFlat> style_tree_title = make_flat_stylebox(dark_color_3, 4, 4, 4, 4);
+ theme->set_stylebox("cursor", "Tree", style_tree_cursor);
+ theme->set_stylebox("cursor_unfocused", "Tree", style_tree_cursor);
+ theme->set_stylebox("title_button_normal", "Tree", style_tree_title);
+ theme->set_stylebox("title_button_hover", "Tree", style_tree_title);
+ theme->set_stylebox("title_button_pressed", "Tree", style_tree_title);
+
+ theme->set_color("prop_category", "Editor", dark_color_1.linear_interpolate(Color(1, 1, 1, 1), 0.12));
+ theme->set_color("prop_section", "Editor", dark_color_1.linear_interpolate(Color(1, 1, 1, 1), 0.09));
+ theme->set_color("prop_subsection", "Editor", dark_color_1.linear_interpolate(Color(1, 1, 1, 1), 0.06));
+ theme->set_color("fg_selected", "Editor", HIGHLIGHT_COLOR_DARK);
theme->set_color("fg_error", "Editor", Color::html("ffbd8e8e"));
+ theme->set_color("drop_position_color", "Tree", highlight_color);
+
+ // ItemList
+ Ref<StyleBoxFlat> style_itemlist_bg = make_flat_stylebox(dark_color_1, 4, 4, 4, 4);
+ style_itemlist_bg->set_border_width_all(border_width);
+ style_itemlist_bg->set_border_color_all(dark_color_3);
+
+ Ref<StyleBoxFlat> style_itemlist_cursor = make_flat_stylebox(highlight_color, 0, 0, 0, 0);
+ style_itemlist_cursor->set_filled(false);
+ style_itemlist_cursor->set_border_width_all(border_width);
+ style_itemlist_cursor->set_border_color_all(HIGHLIGHT_COLOR_DARK);
+ theme->set_stylebox("cursor", "ItemList", style_itemlist_cursor);
+ theme->set_stylebox("cursor_unfocused", "ItemList", style_itemlist_cursor);
+ theme->set_stylebox("selected_focus", "ItemList", style_tree_focus);
+ theme->set_stylebox("selected", "ItemList", style_tree_selected);
+ theme->set_stylebox("bg_focus", "ItemList", focus_sbt);
+ theme->set_stylebox("bg", "ItemList", style_itemlist_bg);
+ theme->set_constant("vseparation", "ItemList", 5 * EDSCALE);
+
+ Ref<StyleBoxFlat> style_tab_fg = make_flat_stylebox(title_color_hl, 15, 5, 15, 5);
+ Ref<StyleBoxFlat> style_tab_bg = make_flat_stylebox(base_color, 15, 5, 15, 5);
+ style_tab_bg->set_filled(false);
+
+ // Tabs & TabContainer
+ theme->set_stylebox("tab_fg", "TabContainer", style_tab_fg);
+ theme->set_stylebox("tab_bg", "TabContainer", style_tab_bg);
+ theme->set_stylebox("tab_fg", "Tabs", style_tab_fg);
+ theme->set_stylebox("tab_bg", "Tabs", style_tab_bg);
+ theme->set_color("font_color_fg", "TabContainer", title_color_hl_text_color);
+ theme->set_color("font_color_bg", "TabContainer", light_color_2);
+ theme->set_icon("menu", "TabContainer", theme->get_icon("GuiTabMenu", "EditorIcons"));
+ theme->set_icon("menu_hl", "TabContainer", theme->get_icon("GuiTabMenu", "EditorIcons"));
+ theme->set_stylebox("SceneTabFG", "EditorStyles", make_flat_stylebox(title_color_hl, 10, 5, 10, 5));
+ theme->set_stylebox("SceneTabBG", "EditorStyles", make_empty_stylebox(6, 5, 6, 5));
+ theme->set_icon("close", "Tabs", title_hl_close_icon);
+
+ // Separators (no separators)
+ theme->set_stylebox("separator", "HSeparator", make_line_stylebox(separator_color, border_width));
+ theme->set_stylebox("separator", "VSeparator", make_line_stylebox(separator_color, border_width, 0, true));
+
+ // Debugger
+ Ref<StyleBoxFlat> style_panel_debugger = make_flat_stylebox(dark_color_2, 4, 4, 4, 4);
+ theme->set_stylebox("DebuggerPanel", "EditorStyles", style_panel_debugger);
+
+ Ref<StyleBoxFlat> style_tab_fg_debugger = make_flat_stylebox(dark_color_2, 10, 5, 10, 5);
+ Ref<StyleBoxFlat> style_tab_bg_debugger = make_flat_stylebox(dark_color_2, 10, 5, 10, 5);
+ style_tab_bg_debugger->set_filled(false);
+
+ theme->set_stylebox("DebuggerTabFG", "EditorStyles", style_tab_fg_debugger);
+ theme->set_stylebox("DebuggerTabBG", "EditorStyles", style_tab_bg_debugger);
+
+ // LineEdit
+ Ref<StyleBoxFlat> style_lineedit = style_button_type;
+ style_lineedit = change_border_color(style_lineedit, light_color_1);
+ Ref<StyleBoxFlat> style_lineedit_disabled = change_border_color(style_lineedit, dark_color_1);
+ style_lineedit_disabled->set_bg_color(Color(0, 0, 0, .1));
+ Ref<StyleBoxFlat> style_lineedit_focus = change_border_color(style_lineedit, highlight_color);
+ theme->set_stylebox("normal", "LineEdit", style_lineedit);
+ theme->set_stylebox("focus", "LineEdit", style_lineedit_focus);
+ theme->set_stylebox("read_only", "LineEdit", style_lineedit_disabled);
+ theme->set_color("read_only", "LineEdit", dark_color_1);
+
+ // TextEdit
+ Ref<StyleBoxFlat> style_textedit_normal(memnew(StyleBoxFlat));
+ style_textedit_normal->set_bg_color(dark_color_2);
+ style_textedit_normal->set_default_margin(MARGIN_LEFT, 0);
+ style_textedit_normal->set_default_margin(MARGIN_RIGHT, 0);
+ style_textedit_normal->set_default_margin(MARGIN_BOTTOM, 0);
+ style_textedit_normal->set_default_margin(MARGIN_TOP, 0);
+ theme->set_stylebox("normal", "TextEdit", style_textedit_normal);
+ theme->set_stylebox("focus", "TextEdit", focus_sbt);
+ theme->set_constant("side_margin", "TabContainer", 0);
+
+ // H/VSplitContainer
+ theme->set_stylebox("bg", "VSplitContainer", make_stylebox(theme->get_icon("GuiVsplitBg", "EditorIcons"), 1, 1, 1, 1));
+ theme->set_stylebox("bg", "HSplitContainer", make_stylebox(theme->get_icon("GuiHsplitBg", "EditorIcons"), 1, 1, 1, 1));
+
+ theme->set_icon("grabber", "VSplitContainer", theme->get_icon("GuiVsplitter", "EditorIcons"));
+ theme->set_icon("grabber", "HSplitContainer", theme->get_icon("GuiHsplitter", "EditorIcons"));
+
+ theme->set_constant("separation", "HSplitContainer", 8 * EDSCALE);
+ theme->set_constant("separation", "VSplitContainer", 8 * EDSCALE);
+
+ // WindowDialog
+ Ref<StyleBoxFlat> style_window = make_flat_stylebox(dark_color_2, 4, 4, 4, 4);
+ style_window->set_border_width_all(MAX(EDSCALE, border_width));
+ style_window->set_border_color_all(title_color_hl);
+ style_window->set_border_width(MARGIN_TOP, 24 * EDSCALE);
+ style_window->set_expand_margin_size(MARGIN_TOP, 24 * EDSCALE);
+ theme->set_stylebox("panel", "WindowDialog", style_window);
+ theme->set_color("title_color", "WindowDialog", title_color_hl_text_color);
+ theme->set_icon("close", "WindowDialog", title_hl_close_icon);
+ theme->set_icon("close_highlight", "WindowDialog", title_hl_close_icon);
+ theme->set_constant("close_h_ofs", "WindowDialog", 22 * EDSCALE);
+ theme->set_constant("close_v_ofs", "WindowDialog", 20 * EDSCALE);
+ theme->set_constant("title_height", "WindowDialog", 24 * EDSCALE);
+
+ // HScrollBar
+ Ref<Texture> empty_icon = memnew(ImageTexture);
+
+ theme->set_stylebox("scroll", "HScrollBar", make_stylebox(theme->get_icon("GuiScrollBg", "EditorIcons"), 5, 5, 5, 5, 0, 0, 0, 0));
+ theme->set_stylebox("scroll_focus", "HScrollBar", make_stylebox(theme->get_icon("GuiScrollBg", "EditorIcons"), 5, 5, 5, 5, 0, 0, 0, 0));
+ theme->set_stylebox("grabber", "HScrollBar", make_stylebox(theme->get_icon("GuiScrollGrabber", "EditorIcons"), 6, 6, 6, 6, 2, 2, 2, 2));
+ theme->set_stylebox("grabber_highlight", "HScrollBar", make_stylebox(theme->get_icon("GuiScrollGrabberHl", "EditorIcons"), 5, 5, 5, 5, 2, 2, 2, 2));
+ theme->set_stylebox("grabber_pressed", "HScrollBar", make_stylebox(theme->get_icon("GuiScrollGrabberPressed", "EditorIcons"), 6, 6, 6, 6, 2, 2, 2, 2));
+
+ theme->set_icon("increment", "HScrollBar", empty_icon);
+ theme->set_icon("increment_highlight", "HScrollBar", empty_icon);
+ theme->set_icon("decrement", "HScrollBar", empty_icon);
+ theme->set_icon("decrement_highlight", "HScrollBar", empty_icon);
+
+ // VScrollBar
+ theme->set_stylebox("scroll", "VScrollBar", make_stylebox(theme->get_icon("GuiScrollBg", "EditorIcons"), 5, 5, 5, 5, 0, 0, 0, 0));
+ theme->set_stylebox("scroll_focus", "VScrollBar", make_stylebox(theme->get_icon("GuiScrollBg", "EditorIcons"), 5, 5, 5, 5, 0, 0, 0, 0));
+ theme->set_stylebox("grabber", "VScrollBar", make_stylebox(theme->get_icon("GuiScrollGrabber", "EditorIcons"), 6, 6, 6, 6, 2, 2, 2, 2));
+ theme->set_stylebox("grabber_highlight", "VScrollBar", make_stylebox(theme->get_icon("GuiScrollGrabberHl", "EditorIcons"), 5, 5, 5, 5, 2, 2, 2, 2));
+ theme->set_stylebox("grabber_pressed", "VScrollBar", make_stylebox(theme->get_icon("GuiScrollGrabberPressed", "EditorIcons"), 6, 6, 6, 6, 2, 2, 2, 2));
+
+ theme->set_icon("increment", "VScrollBar", empty_icon);
+ theme->set_icon("increment_highlight", "VScrollBar", empty_icon);
+ theme->set_icon("decrement", "VScrollBar", empty_icon);
+ theme->set_icon("decrement_highlight", "VScrollBar", empty_icon);
+
+ // HSlider
+ theme->set_stylebox("slider", "HSlider", make_stylebox(theme->get_icon("GuiHsliderBg", "EditorIcons"), 4, 4, 4, 4));
+ theme->set_icon("grabber", "HSlider", theme->get_icon("GuiSliderGrabber", "EditorIcons"));
+ theme->set_icon("grabber_highlight", "HSlider", theme->get_icon("GuiSliderGrabberHl", "EditorIcons"));
+
+ // VSlider
+ theme->set_stylebox("slider", "VSlider", make_stylebox(theme->get_icon("GuiVsliderBg", "EditorIcons"), 4, 4, 4, 4));
+ theme->set_icon("grabber", "VSlider", theme->get_icon("GuiSliderGrabber", "EditorIcons"));
+ theme->set_icon("grabber_highlight", "VSlider", theme->get_icon("GuiSliderGrabberHl", "EditorIcons"));
+
+ //RichTextLabel
+ theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox());
+
+ // Panel
+ theme->set_stylebox("panel", "Panel", style_panel);
+
+ // TooltipPanel
+ Ref<StyleBoxFlat> style_tooltip = make_flat_stylebox(Color(1, 1, 1, 0.8), 8, 8, 8, 8);
+ style_tooltip->set_border_width_all(border_width);
+ style_tooltip->set_border_color_all(Color(1, 1, 1, 0.9));
+ theme->set_stylebox("panel", "TooltipPanel", style_tooltip);
+
+ // PopupPanel
+ Ref<StyleBoxFlat> style_dock_select = make_flat_stylebox(base_color);
+ style_dock_select->set_border_color_all(light_color_1);
+ style_dock_select = add_additional_border(style_dock_select, 2, 2, 2, 2);
+ theme->set_stylebox("panel", "PopupPanel", style_dock_select);
+
+ // SpinBox
+ theme->set_icon("updown", "SpinBox", theme->get_icon("GuiSpinboxUpdown", "EditorIcons"));
+
+ // ProgressBar
+ theme->set_stylebox("bg", "ProgressBar", make_stylebox(theme->get_icon("GuiProgressBar", "EditorIcons"), 4, 4, 4, 4, 0, 0, 0, 0));
+ theme->set_stylebox("fg", "ProgressBar", make_stylebox(theme->get_icon("GuiProgressFill", "EditorIcons"), 6, 6, 6, 6, 2, 1, 2, 1));
+
+ // theme->set_font("font", "ProgressBar", default_font);
+
+ // theme->set_color("font_color", "ProgressBar", control_font_color_hover);
+ theme->set_color("font_color_shadow", "ProgressBar", Color(0, 0, 0));
+
+ // GraphEdit
+ theme->set_stylebox("bg", "GraphEdit", make_flat_stylebox(dark_color_2, 4, 4, 4, 4));
+
+ // GraphNode
+ Ref<StyleBoxFlat> graphsb = make_flat_stylebox(Color(0, 0, 0, 0.3), 16, 24, 16, 5);
+ graphsb->set_border_width_all(border_width);
+ graphsb->set_border_color_all(Color(1, 1, 1, 0.6));
+ graphsb = add_additional_border(graphsb, 0, -22, 0, 0);
+ Ref<StyleBoxFlat> graphsbselected = make_flat_stylebox(Color(0, 0, 0, 0.4), 16, 24, 16, 5);
+ graphsbselected->set_border_width_all(border_width);
+ graphsbselected->set_border_color_all(Color(1, 1, 1, 0.9));
+ graphsbselected = add_additional_border(graphsbselected, 0, -22, 0, 0);
+ Ref<StyleBoxFlat> graphsbcomment = make_flat_stylebox(Color(0, 0, 0, 0.3), 16, 24, 16, 5);
+ graphsbcomment->set_border_width_all(border_width);
+ graphsbcomment->set_border_color_all(Color(1, 1, 1, 0.6));
+ graphsbcomment = add_additional_border(graphsbcomment, 0, -22, 0, 0);
+ Ref<StyleBoxFlat> graphsbcommentselected = make_flat_stylebox(Color(0, 0, 0, 0.4), 16, 24, 16, 5);
+ graphsbcommentselected->set_border_width_all(border_width);
+ graphsbcommentselected->set_border_color_all(Color(1, 1, 1, 0.9));
+ graphsbcommentselected = add_additional_border(graphsbcommentselected, 0, -22, 0, 0);
+ theme->set_stylebox("frame", "GraphNode", graphsb);
+ theme->set_stylebox("selectedframe", "GraphNode", graphsbselected);
+ theme->set_stylebox("comment", "GraphNode", graphsbcomment);
+ theme->set_stylebox("commentfocus", "GraphNode", graphsbcommentselected);
+
+ // FileDialog
+ Color disable_color = light_color_2;
+ disable_color.a = 0.7;
+ theme->set_color("files_disabled", "FileDialog", disable_color);
return theme;
}
@@ -60,7 +542,7 @@ Ref<Theme> create_editor_theme() {
Ref<Theme> create_custom_theme() {
Ref<Theme> theme;
- String custom_theme = EditorSettings::get_singleton()->get("interface/custom_theme");
+ String custom_theme = EditorSettings::get_singleton()->get("interface/theme/custom_theme");
if (custom_theme != "") {
theme = ResourceLoader::load(custom_theme);
}
diff --git a/editor/editor_themes.h b/editor/editor_themes.h
index bf15420917..2ebefee6f3 100644
--- a/editor/editor_themes.h
+++ b/editor/editor_themes.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp
index 83ada90144..e6f15d1712 100644
--- a/editor/export_template_manager.cpp
+++ b/editor/export_template_manager.cpp
@@ -1,11 +1,40 @@
+/*************************************************************************/
+/* export_template_manager.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "export_template_manager.h"
+
#include "editor_node.h"
#include "editor_scale.h"
+#include "io/zip_io.h"
#include "os/dir_access.h"
#include "version.h"
-#include "io/zip_io.h"
-
void ExportTemplateManager::_update_template_list() {
while (current_hb->get_child_count()) {
diff --git a/editor/export_template_manager.h b/editor/export_template_manager.h
index c3834ec643..480c73e123 100644
--- a/editor/export_template_manager.h
+++ b/editor/export_template_manager.h
@@ -1,3 +1,32 @@
+/*************************************************************************/
+/* export_template_manager.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 EXPORT_TEMPLATE_MANAGER_H
#define EXPORT_TEMPLATE_MANAGER_H
diff --git a/editor/file_type_cache.cpp b/editor/file_type_cache.cpp
index 7db0182a37..728e80bba7 100644
--- a/editor/file_type_cache.cpp
+++ b/editor/file_type_cache.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "file_type_cache.h"
-#include "global_config.h"
#include "os/file_access.h"
+#include "project_settings.h"
FileTypeCache *FileTypeCache::singleton = NULL;
@@ -54,7 +55,7 @@ void FileTypeCache::set_file_type(const String &p_path, const String &p_type) {
void FileTypeCache::load() {
GLOBAL_LOCK_FUNCTION
- String project = GlobalConfig::get_singleton()->get_resource_path();
+ String project = ProjectSettings::get_singleton()->get_resource_path();
FileAccess *f = FileAccess::open(project + "/file_type_cache.cch", FileAccess::READ);
if (!f) {
@@ -79,7 +80,7 @@ void FileTypeCache::load() {
void FileTypeCache::save() {
GLOBAL_LOCK_FUNCTION
- String project = GlobalConfig::get_singleton()->get_resource_path();
+ String project = ProjectSettings::get_singleton()->get_resource_path();
FileAccess *f = FileAccess::open(project + "/file_type_cache.cch", FileAccess::WRITE);
if (!f) {
diff --git a/editor/file_type_cache.h b/editor/file_type_cache.h
index fa2c7b46af..a434384eb4 100644
--- a/editor/file_type_cache.h
+++ b/editor/file_type_cache.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp
index 20a4809e36..7e168c54be 100644
--- a/editor/fileserver/editor_file_server.cpp
+++ b/editor/fileserver/editor_file_server.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/fileserver/editor_file_server.h b/editor/fileserver/editor_file_server.h
index cf97f685f7..01b84627b7 100644
--- a/editor/fileserver/editor_file_server.h
+++ b/editor/fileserver/editor_file_server.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index fe1f984f39..8e40850a0c 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,11 +31,11 @@
#include "editor_node.h"
#include "editor_settings.h"
-#include "global_config.h"
#include "io/resource_loader.h"
#include "os/dir_access.h"
#include "os/file_access.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/main/viewport.h"
bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir) {
@@ -101,7 +102,7 @@ void FileSystemDock::_notification(int p_what) {
case NOTIFICATION_RESIZED: {
- bool new_mode = get_size().height < get_viewport_rect().size.height * 3 / 4;
+ bool new_mode = get_size().height < get_viewport_rect().size.height / 2;
if (new_mode != split_mode) {
@@ -152,7 +153,7 @@ void FileSystemDock::_notification(int p_what) {
files->connect("item_activated", this, "_select_file");
button_hist_next->connect("pressed", this, "_fw_history");
button_hist_prev->connect("pressed", this, "_bw_history");
- search_icon->set_texture(get_icon("Zoom", "EditorIcons"));
+ search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
button_hist_next->set_icon(get_icon("Forward", "EditorIcons"));
button_hist_prev->set_icon(get_icon("Back", "EditorIcons"));
@@ -414,8 +415,9 @@ void FileSystemDock::_update_files(bool p_keep_selection) {
if (!has_icon("ResizedFolder", "EditorIcons")) {
Ref<ImageTexture> folder = get_icon("FolderBig", "EditorIcons");
- Image img = folder->get_data();
- img.resize(thumbnail_size, thumbnail_size);
+ Ref<Image> img = folder->get_data();
+ img = img->duplicate();
+ img->resize(thumbnail_size, thumbnail_size);
Ref<ImageTexture> resized_folder = Ref<ImageTexture>(memnew(ImageTexture));
resized_folder->create_from_image(img, 0);
Theme::get_default()->set_icon("ResizedFolder", "EditorIcons", resized_folder);
@@ -425,8 +427,8 @@ void FileSystemDock::_update_files(bool p_keep_selection) {
if (!has_icon("ResizedFile", "EditorIcons")) {
Ref<ImageTexture> file = get_icon("FileBig", "EditorIcons");
- Image img = file->get_data();
- img.resize(thumbnail_size, thumbnail_size);
+ Ref<Image> img = file->get_data();
+ img->resize(thumbnail_size, thumbnail_size);
Ref<ImageTexture> resized_file = Ref<ImageTexture>(memnew(ImageTexture));
resized_file->create_from_image(img, 0);
Theme::get_default()->set_icon("ResizedFile", "EditorIcons", resized_file);
@@ -587,7 +589,7 @@ void FileSystemDock::_go_to_dir(const String &p_dir) {
void FileSystemDock::_preview_invalidated(const String &p_path) {
- if (p_path.get_base_dir() == path && search_box->get_text() == String() && file_list_vb->is_visible_in_tree()) {
+ if (display_mode == DISPLAY_THUMBNAILS && p_path.get_base_dir() == path && search_box->get_text() == String() && file_list_vb->is_visible_in_tree()) {
for (int i = 0; i < files->get_item_count(); i++) {
@@ -877,7 +879,7 @@ void FileSystemDock::_file_option(int p_option) {
String path = files->get_item_metadata(idx);
if (p_option == FILE_SHOW_IN_EXPLORER) {
- String dir = GlobalConfig::get_singleton()->globalize_path(path);
+ String dir = ProjectSettings::get_singleton()->globalize_path(path);
dir = dir.substr(0, dir.find_last("/"));
OS::get_singleton()->shell_open(String("file://") + dir);
return;
@@ -1063,6 +1065,11 @@ void FileSystemDock::_folder_option(int p_option) {
child = child->get_next();
}
break;
+ case FOLDER_SHOW_IN_EXPLORER:
+ String path = item->get_metadata(tree->get_selected_column());
+ String dir = ProjectSettings::get_singleton()->globalize_path(path);
+ OS::get_singleton()->shell_open(String("file://") + dir);
+ return;
}
}
@@ -1101,7 +1108,10 @@ void FileSystemDock::_dir_rmb_pressed(const Vector2 &p_pos) {
folder_options->add_item(TTR("Expand all"), FOLDER_EXPAND_ALL);
folder_options->add_item(TTR("Collapse all"), FOLDER_COLLAPSE_ALL);
- folder_options->set_pos(files->get_global_pos() + p_pos);
+ folder_options->add_separator();
+ folder_options->add_item(TTR("Show In File Manager"), FOLDER_SHOW_IN_EXPLORER);
+
+ folder_options->set_position(tree->get_global_position() + p_pos);
folder_options->popup();
}
@@ -1525,7 +1535,7 @@ void FileSystemDock::_files_list_rmb_select(int p_item, const Vector2 &p_pos) {
*/
}
- file_options->set_pos(files->get_global_pos() + p_pos);
+ file_options->set_position(files->get_global_position() + p_pos);
file_options->popup();
}
@@ -1738,10 +1748,6 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
path_hb->add_child(search_box);
search_box->connect("text_changed", this, "_search_changed");
- search_icon = memnew(TextureRect);
- search_icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
- path_hb->add_child(search_icon);
-
button_display_mode = memnew(ToolButton);
path_hb->add_child(button_display_mode);
button_display_mode->set_toggle_mode(true);
diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h
index 1a4b5ae977..2ec0c38815 100644
--- a/editor/filesystem_dock.h
+++ b/editor/filesystem_dock.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -75,7 +76,8 @@ private:
enum FolderMenu {
FOLDER_EXPAND_ALL,
- FOLDER_COLLAPSE_ALL
+ FOLDER_COLLAPSE_ALL,
+ FOLDER_SHOW_IN_EXPLORER
};
VBoxContainer *scanning_vb;
@@ -156,7 +158,7 @@ private:
void _favorites_pressed();
void _open_pressed();
- void _dir_rmb_pressed(const Vector2 &local_mouse_pos);
+ void _dir_rmb_pressed(const Vector2 &p_pos);
void _search_changed(const String &p_text);
void _files_list_rmb_select(int p_item, const Vector2 &p_pos);
diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp
index c9e9acd7f2..ea1827f16f 100644
--- a/editor/groups_editor.cpp
+++ b/editor/groups_editor.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/groups_editor.h b/editor/groups_editor.h
index 2b27a3a70c..acbe60c21f 100644
--- a/editor/groups_editor.h
+++ b/editor/groups_editor.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/icons/2x/icon_2_d.png b/editor/icons/2x/icon_2_d.png
new file mode 100644
index 0000000000..9b2ed64665
--- /dev/null
+++ b/editor/icons/2x/icon_2_d.png
Binary files differ
diff --git a/editor/icons/2x/icon_3_d.png b/editor/icons/2x/icon_3_d.png
new file mode 100644
index 0000000000..218c246870
--- /dev/null
+++ b/editor/icons/2x/icon_3_d.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_checked.png b/editor/icons/2x/icon_GUI_checked.png
new file mode 100644
index 0000000000..d51f20b867
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_checked.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_dropdown.png b/editor/icons/2x/icon_GUI_dropdown.png
new file mode 100644
index 0000000000..78d3352e4e
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_dropdown.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_hslider_bg.png b/editor/icons/2x/icon_GUI_hslider_bg.png
new file mode 100644
index 0000000000..38af962095
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_hslider_bg.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_hsplitter.png b/editor/icons/2x/icon_GUI_hsplitter.png
new file mode 100644
index 0000000000..063f0c90fc
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_hsplitter.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_mini_tab_menu.png b/editor/icons/2x/icon_GUI_mini_tab_menu.png
new file mode 100644
index 0000000000..8c3aa73aaf
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_mini_tab_menu.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_option_arrow.png b/editor/icons/2x/icon_GUI_option_arrow.png
new file mode 100644
index 0000000000..87fdc8aa51
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_option_arrow.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_play_button_group.png b/editor/icons/2x/icon_GUI_play_button_group.png
new file mode 100644
index 0000000000..6a569d5e80
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_play_button_group.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_progress_bar.png b/editor/icons/2x/icon_GUI_progress_bar.png
new file mode 100644
index 0000000000..ca53eba8d0
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_progress_bar.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_progress_fill.png b/editor/icons/2x/icon_GUI_progress_fill.png
new file mode 100644
index 0000000000..ac6c562650
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_progress_fill.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_radio_checked.png b/editor/icons/2x/icon_GUI_radio_checked.png
new file mode 100644
index 0000000000..1b38071c00
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_radio_checked.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_radio_unchecked.png b/editor/icons/2x/icon_GUI_radio_unchecked.png
new file mode 100644
index 0000000000..b76bf63f2d
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_radio_unchecked.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_scroll_bg.png b/editor/icons/2x/icon_GUI_scroll_bg.png
new file mode 100644
index 0000000000..58369d6f96
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_scroll_bg.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_scroll_grabber.png b/editor/icons/2x/icon_GUI_scroll_grabber.png
new file mode 100644
index 0000000000..6f74a9365f
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_scroll_grabber.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_scroll_grabber_hl.png b/editor/icons/2x/icon_GUI_scroll_grabber_hl.png
new file mode 100644
index 0000000000..c03ca1adf9
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_scroll_grabber_hl.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_slider_grabber.png b/editor/icons/2x/icon_GUI_slider_grabber.png
new file mode 100644
index 0000000000..97e97cb536
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_slider_grabber.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_slider_grabber_hl.png b/editor/icons/2x/icon_GUI_slider_grabber_hl.png
new file mode 100644
index 0000000000..2229e25a60
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_slider_grabber_hl.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_spinbox_updown.png b/editor/icons/2x/icon_GUI_spinbox_updown.png
new file mode 100644
index 0000000000..a20b43f9c3
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_spinbox_updown.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_tab_menu.png b/editor/icons/2x/icon_GUI_tab_menu.png
new file mode 100644
index 0000000000..3887615fee
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_tab_menu.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_toggle_off.png b/editor/icons/2x/icon_GUI_toggle_off.png
new file mode 100644
index 0000000000..9da02707d1
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_toggle_off.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_toggle_on.png b/editor/icons/2x/icon_GUI_toggle_on.png
new file mode 100644
index 0000000000..41a25e9345
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_toggle_on.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_tree_arrow_down.png b/editor/icons/2x/icon_GUI_tree_arrow_down.png
new file mode 100644
index 0000000000..c71c6f4159
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_tree_arrow_down.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_tree_arrow_right.png b/editor/icons/2x/icon_GUI_tree_arrow_right.png
new file mode 100644
index 0000000000..66331c730a
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_tree_arrow_right.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_unchecked.png b/editor/icons/2x/icon_GUI_unchecked.png
new file mode 100644
index 0000000000..f76b6351d8
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_unchecked.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_vslider_bg.png b/editor/icons/2x/icon_GUI_vslider_bg.png
new file mode 100644
index 0000000000..eeb68e2d7a
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_vslider_bg.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_vsplit_bg.png b/editor/icons/2x/icon_GUI_vsplit_bg.png
new file mode 100644
index 0000000000..09524bd25a
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_vsplit_bg.png
Binary files differ
diff --git a/editor/icons/2x/icon_GUI_vsplitter.png b/editor/icons/2x/icon_GUI_vsplitter.png
new file mode 100644
index 0000000000..84920525b7
--- /dev/null
+++ b/editor/icons/2x/icon_GUI_vsplitter.png
Binary files differ
diff --git a/editor/icons/2x/icon_animation_player.png b/editor/icons/2x/icon_animation_player.png
index 4a3209ab70..1a9373938b 100644
--- a/editor/icons/2x/icon_animation_player.png
+++ b/editor/icons/2x/icon_animation_player.png
Binary files differ
diff --git a/editor/icons/2x/icon_animation_tree.png b/editor/icons/2x/icon_animation_tree.png
index a213ab6e5e..ba7930b88f 100644
--- a/editor/icons/2x/icon_animation_tree.png
+++ b/editor/icons/2x/icon_animation_tree.png
Binary files differ
diff --git a/editor/icons/2x/icon_animation_tree_player.png b/editor/icons/2x/icon_animation_tree_player.png
index a213ab6e5e..ba7930b88f 100644
--- a/editor/icons/2x/icon_animation_tree_player.png
+++ b/editor/icons/2x/icon_animation_tree_player.png
Binary files differ
diff --git a/editor/icons/2x/icon_arrow_left.png b/editor/icons/2x/icon_arrow_left.png
index bc3995f70b..64bb9c81c0 100644
--- a/editor/icons/2x/icon_arrow_left.png
+++ b/editor/icons/2x/icon_arrow_left.png
Binary files differ
diff --git a/editor/icons/2x/icon_arrow_right.png b/editor/icons/2x/icon_arrow_right.png
index 045b390e0d..c3d6e66482 100644
--- a/editor/icons/2x/icon_arrow_right.png
+++ b/editor/icons/2x/icon_arrow_right.png
Binary files differ
diff --git a/editor/icons/2x/icon_arrow_up.png b/editor/icons/2x/icon_arrow_up.png
index 524ab934e2..008ef633ba 100644
--- a/editor/icons/2x/icon_arrow_up.png
+++ b/editor/icons/2x/icon_arrow_up.png
Binary files differ
diff --git a/editor/icons/2x/icon_asset_lib.png b/editor/icons/2x/icon_asset_lib.png
new file mode 100644
index 0000000000..22c31fb2d5
--- /dev/null
+++ b/editor/icons/2x/icon_asset_lib.png
Binary files differ
diff --git a/editor/icons/2x/icon_audio_bus_bypass.png b/editor/icons/2x/icon_audio_bus_bypass.png
new file mode 100644
index 0000000000..b44c40fb35
--- /dev/null
+++ b/editor/icons/2x/icon_audio_bus_bypass.png
Binary files differ
diff --git a/editor/icons/2x/icon_audio_bus_layout.png b/editor/icons/2x/icon_audio_bus_layout.png
new file mode 100644
index 0000000000..d6a5cba5c1
--- /dev/null
+++ b/editor/icons/2x/icon_audio_bus_layout.png
Binary files differ
diff --git a/editor/icons/2x/icon_audio_bus_mute.png b/editor/icons/2x/icon_audio_bus_mute.png
new file mode 100644
index 0000000000..4b334682f0
--- /dev/null
+++ b/editor/icons/2x/icon_audio_bus_mute.png
Binary files differ
diff --git a/editor/icons/2x/icon_audio_bus_solo.png b/editor/icons/2x/icon_audio_bus_solo.png
new file mode 100644
index 0000000000..b09a15351a
--- /dev/null
+++ b/editor/icons/2x/icon_audio_bus_solo.png
Binary files differ
diff --git a/editor/icons/2x/icon_audio_effect_amplify.png b/editor/icons/2x/icon_audio_effect_amplify.png
new file mode 100644
index 0000000000..868bc6ddde
--- /dev/null
+++ b/editor/icons/2x/icon_audio_effect_amplify.png
Binary files differ
diff --git a/editor/icons/2x/icon_audio_stream_player.png b/editor/icons/2x/icon_audio_stream_player.png
new file mode 100644
index 0000000000..799b93cc5d
--- /dev/null
+++ b/editor/icons/2x/icon_audio_stream_player.png
Binary files differ
diff --git a/editor/icons/2x/icon_audio_stream_player_2_d.png b/editor/icons/2x/icon_audio_stream_player_2_d.png
new file mode 100644
index 0000000000..f2eaa41769
--- /dev/null
+++ b/editor/icons/2x/icon_audio_stream_player_2_d.png
Binary files differ
diff --git a/editor/icons/2x/icon_audio_stream_player_3_d.png b/editor/icons/2x/icon_audio_stream_player_3_d.png
new file mode 100644
index 0000000000..917719f54b
--- /dev/null
+++ b/editor/icons/2x/icon_audio_stream_player_3_d.png
Binary files differ
diff --git a/editor/icons/2x/icon_audio_stream_sample.png b/editor/icons/2x/icon_audio_stream_sample.png
new file mode 100644
index 0000000000..baaa7bf86f
--- /dev/null
+++ b/editor/icons/2x/icon_audio_stream_sample.png
Binary files differ
diff --git a/editor/icons/2x/icon_back.png b/editor/icons/2x/icon_back.png
index 648c440928..b3c9b302b4 100644
--- a/editor/icons/2x/icon_back.png
+++ b/editor/icons/2x/icon_back.png
Binary files differ
diff --git a/editor/icons/2x/icon_baked_light.png b/editor/icons/2x/icon_baked_light.png
index 3c1cba5586..9b13ed8ff1 100644
--- a/editor/icons/2x/icon_baked_light.png
+++ b/editor/icons/2x/icon_baked_light.png
Binary files differ
diff --git a/editor/icons/2x/icon_bit_map.png b/editor/icons/2x/icon_bit_map.png
index 7372b85944..864d09991e 100644
--- a/editor/icons/2x/icon_bit_map.png
+++ b/editor/icons/2x/icon_bit_map.png
Binary files differ
diff --git a/editor/icons/2x/icon_bool.png b/editor/icons/2x/icon_bool.png
index 47103538bd..e2383809d8 100644
--- a/editor/icons/2x/icon_bool.png
+++ b/editor/icons/2x/icon_bool.png
Binary files differ
diff --git a/editor/icons/2x/icon_bus_vu_db.png b/editor/icons/2x/icon_bus_vu_db.png
new file mode 100644
index 0000000000..8856b026f0
--- /dev/null
+++ b/editor/icons/2x/icon_bus_vu_db.png
Binary files differ
diff --git a/editor/icons/2x/icon_bus_vu_empty.png b/editor/icons/2x/icon_bus_vu_empty.png
new file mode 100644
index 0000000000..dfa1536fb4
--- /dev/null
+++ b/editor/icons/2x/icon_bus_vu_empty.png
Binary files differ
diff --git a/editor/icons/2x/icon_bus_vu_frozen.png b/editor/icons/2x/icon_bus_vu_frozen.png
new file mode 100644
index 0000000000..94d5d335d6
--- /dev/null
+++ b/editor/icons/2x/icon_bus_vu_frozen.png
Binary files differ
diff --git a/editor/icons/2x/icon_bus_vu_full.png b/editor/icons/2x/icon_bus_vu_full.png
new file mode 100644
index 0000000000..2c2f0bca06
--- /dev/null
+++ b/editor/icons/2x/icon_bus_vu_full.png
Binary files differ
diff --git a/editor/icons/2x/icon_button.png b/editor/icons/2x/icon_button.png
index 210b0da486..dc07e92b73 100644
--- a/editor/icons/2x/icon_button.png
+++ b/editor/icons/2x/icon_button.png
Binary files differ
diff --git a/editor/icons/2x/icon_button_group.png b/editor/icons/2x/icon_button_group.png
index 47f62005b9..15bcae7690 100644
--- a/editor/icons/2x/icon_button_group.png
+++ b/editor/icons/2x/icon_button_group.png
Binary files differ
diff --git a/editor/icons/2x/icon_capsule_mesh.png b/editor/icons/2x/icon_capsule_mesh.png
new file mode 100644
index 0000000000..ebc48ee736
--- /dev/null
+++ b/editor/icons/2x/icon_capsule_mesh.png
Binary files differ
diff --git a/editor/icons/2x/icon_checked.png b/editor/icons/2x/icon_checked.png
new file mode 100644
index 0000000000..6083540ffe
--- /dev/null
+++ b/editor/icons/2x/icon_checked.png
Binary files differ
diff --git a/editor/icons/2x/icon_color_rect.png b/editor/icons/2x/icon_color_rect.png
index 153029ac20..7f258d5d92 100644
--- a/editor/icons/2x/icon_color_rect.png
+++ b/editor/icons/2x/icon_color_rect.png
Binary files differ
diff --git a/editor/icons/2x/icon_confirmation_dialog.png b/editor/icons/2x/icon_confirmation_dialog.png
index a0df7fcd1e..ebf5886445 100644
--- a/editor/icons/2x/icon_confirmation_dialog.png
+++ b/editor/icons/2x/icon_confirmation_dialog.png
Binary files differ
diff --git a/editor/icons/2x/icon_connect.png b/editor/icons/2x/icon_connect.png
index e3f4b8fd12..2a36b1716a 100644
--- a/editor/icons/2x/icon_connect.png
+++ b/editor/icons/2x/icon_connect.png
Binary files differ
diff --git a/editor/icons/2x/icon_copy_node_path.png b/editor/icons/2x/icon_copy_node_path.png
index 056748d20b..29180d017c 100644
--- a/editor/icons/2x/icon_copy_node_path.png
+++ b/editor/icons/2x/icon_copy_node_path.png
Binary files differ
diff --git a/editor/icons/2x/icon_cube_mesh.png b/editor/icons/2x/icon_cube_mesh.png
new file mode 100644
index 0000000000..b2acdd156d
--- /dev/null
+++ b/editor/icons/2x/icon_cube_mesh.png
Binary files differ
diff --git a/editor/icons/2x/icon_curve.png b/editor/icons/2x/icon_curve.png
new file mode 100644
index 0000000000..fb8c209d1e
--- /dev/null
+++ b/editor/icons/2x/icon_curve.png
Binary files differ
diff --git a/editor/icons/2x/icon_curve_texture.png b/editor/icons/2x/icon_curve_texture.png
new file mode 100644
index 0000000000..ccdebe89f5
--- /dev/null
+++ b/editor/icons/2x/icon_curve_texture.png
Binary files differ
diff --git a/editor/icons/2x/icon_cylinder_mesh.png b/editor/icons/2x/icon_cylinder_mesh.png
new file mode 100644
index 0000000000..b36f599522
--- /dev/null
+++ b/editor/icons/2x/icon_cylinder_mesh.png
Binary files differ
diff --git a/editor/icons/2x/icon_debug.png b/editor/icons/2x/icon_debug.png
new file mode 100644
index 0000000000..c007d54b6e
--- /dev/null
+++ b/editor/icons/2x/icon_debug.png
Binary files differ
diff --git a/editor/icons/2x/icon_dropdown.png b/editor/icons/2x/icon_dropdown.png
new file mode 100644
index 0000000000..626dba79ec
--- /dev/null
+++ b/editor/icons/2x/icon_dropdown.png
Binary files differ
diff --git a/editor/icons/2x/icon_edit_resource.png b/editor/icons/2x/icon_edit_resource.png
index 5ba9b36b0a..f0c7570160 100644
--- a/editor/icons/2x/icon_edit_resource.png
+++ b/editor/icons/2x/icon_edit_resource.png
Binary files differ
diff --git a/editor/icons/2x/icon_editor_control_anchor.png b/editor/icons/2x/icon_editor_control_anchor.png
new file mode 100644
index 0000000000..838f85b763
--- /dev/null
+++ b/editor/icons/2x/icon_editor_control_anchor.png
Binary files differ
diff --git a/editor/icons/2x/icon_environment.png b/editor/icons/2x/icon_environment.png
index 4c4c30b0e5..b8438202c1 100644
--- a/editor/icons/2x/icon_environment.png
+++ b/editor/icons/2x/icon_environment.png
Binary files differ
diff --git a/editor/icons/2x/icon_error.png b/editor/icons/2x/icon_error.png
index a6d79ab41b..c915da1d27 100644
--- a/editor/icons/2x/icon_error.png
+++ b/editor/icons/2x/icon_error.png
Binary files differ
diff --git a/editor/icons/2x/icon_file.png b/editor/icons/2x/icon_file.png
index 683f1141fd..a10fe2cc60 100644
--- a/editor/icons/2x/icon_file.png
+++ b/editor/icons/2x/icon_file.png
Binary files differ
diff --git a/editor/icons/2x/icon_file_big.png b/editor/icons/2x/icon_file_big.png
index 8c86c6b958..092132ff36 100644
--- a/editor/icons/2x/icon_file_big.png
+++ b/editor/icons/2x/icon_file_big.png
Binary files differ
diff --git a/editor/icons/2x/icon_file_dialog.png b/editor/icons/2x/icon_file_dialog.png
index f19b4d7507..ca34090296 100644
--- a/editor/icons/2x/icon_file_dialog.png
+++ b/editor/icons/2x/icon_file_dialog.png
Binary files differ
diff --git a/editor/icons/2x/icon_forward.png b/editor/icons/2x/icon_forward.png
index 11fd444a04..6029449354 100644
--- a/editor/icons/2x/icon_forward.png
+++ b/editor/icons/2x/icon_forward.png
Binary files differ
diff --git a/editor/icons/2x/icon_g_d_native_library.png b/editor/icons/2x/icon_g_d_native_library.png
new file mode 100644
index 0000000000..1deb0664ed
--- /dev/null
+++ b/editor/icons/2x/icon_g_d_native_library.png
Binary files differ
diff --git a/editor/icons/2x/icon_g_d_native_script.png b/editor/icons/2x/icon_g_d_native_script.png
new file mode 100644
index 0000000000..31cc130867
--- /dev/null
+++ b/editor/icons/2x/icon_g_d_native_script.png
Binary files differ
diff --git a/editor/icons/2x/icon_godot.png b/editor/icons/2x/icon_godot.png
index 94d87e23cc..d40c25cae7 100644
--- a/editor/icons/2x/icon_godot.png
+++ b/editor/icons/2x/icon_godot.png
Binary files differ
diff --git a/editor/icons/2x/icon_godot_docs.png b/editor/icons/2x/icon_godot_docs.png
new file mode 100644
index 0000000000..be30f092ef
--- /dev/null
+++ b/editor/icons/2x/icon_godot_docs.png
Binary files differ
diff --git a/editor/icons/2x/icon_gradient.png b/editor/icons/2x/icon_gradient.png
new file mode 100644
index 0000000000..caf6da5836
--- /dev/null
+++ b/editor/icons/2x/icon_gradient.png
Binary files differ
diff --git a/editor/icons/2x/icon_gradient_texture.png b/editor/icons/2x/icon_gradient_texture.png
new file mode 100644
index 0000000000..d002c8534c
--- /dev/null
+++ b/editor/icons/2x/icon_gradient_texture.png
Binary files differ
diff --git a/editor/icons/2x/icon_graph_scalars_to_vec.png b/editor/icons/2x/icon_graph_scalars_to_vec.png
index 266c84e5ae..7363a47db3 100644
--- a/editor/icons/2x/icon_graph_scalars_to_vec.png
+++ b/editor/icons/2x/icon_graph_scalars_to_vec.png
Binary files differ
diff --git a/editor/icons/2x/icon_graph_vec_to_scalars.png b/editor/icons/2x/icon_graph_vec_to_scalars.png
index 1b8254b3c6..6d16ea72fe 100644
--- a/editor/icons/2x/icon_graph_vec_to_scalars.png
+++ b/editor/icons/2x/icon_graph_vec_to_scalars.png
Binary files differ
diff --git a/editor/icons/2x/icon_graph_vecs_to_xform.png b/editor/icons/2x/icon_graph_vecs_to_xform.png
index a9ed5052be..0f2ad7a83a 100644
--- a/editor/icons/2x/icon_graph_vecs_to_xform.png
+++ b/editor/icons/2x/icon_graph_vecs_to_xform.png
Binary files differ
diff --git a/editor/icons/2x/icon_graph_xform_to_vecs.png b/editor/icons/2x/icon_graph_xform_to_vecs.png
index 22125df573..d274ad99a6 100644
--- a/editor/icons/2x/icon_graph_xform_to_vecs.png
+++ b/editor/icons/2x/icon_graph_xform_to_vecs.png
Binary files differ
diff --git a/editor/icons/2x/icon_grid_map.png b/editor/icons/2x/icon_grid_map.png
index 5bbd16d3df..83baf36c1b 100644
--- a/editor/icons/2x/icon_grid_map.png
+++ b/editor/icons/2x/icon_grid_map.png
Binary files differ
diff --git a/editor/icons/2x/icon_gui_close_dark.png b/editor/icons/2x/icon_gui_close_dark.png
new file mode 100644
index 0000000000..fe47e003f9
--- /dev/null
+++ b/editor/icons/2x/icon_gui_close_dark.png
Binary files differ
diff --git a/editor/icons/2x/icon_gui_close_light.png b/editor/icons/2x/icon_gui_close_light.png
new file mode 100644
index 0000000000..2d93123f20
--- /dev/null
+++ b/editor/icons/2x/icon_gui_close_light.png
Binary files differ
diff --git a/editor/icons/2x/icon_h_button_array.png b/editor/icons/2x/icon_h_button_array.png
index 750eef8267..3e4464f33e 100644
--- a/editor/icons/2x/icon_h_button_array.png
+++ b/editor/icons/2x/icon_h_button_array.png
Binary files differ
diff --git a/editor/icons/2x/icon_h_scroll_bar.png b/editor/icons/2x/icon_h_scroll_bar.png
index d15a36bb16..6186d23742 100644
--- a/editor/icons/2x/icon_h_scroll_bar.png
+++ b/editor/icons/2x/icon_h_scroll_bar.png
Binary files differ
diff --git a/editor/icons/2x/icon_h_slider.png b/editor/icons/2x/icon_h_slider.png
index 50bad1cc18..dee580d909 100644
--- a/editor/icons/2x/icon_h_slider.png
+++ b/editor/icons/2x/icon_h_slider.png
Binary files differ
diff --git a/editor/icons/2x/icon_help.png b/editor/icons/2x/icon_help.png
index f16a34c918..771b815020 100644
--- a/editor/icons/2x/icon_help.png
+++ b/editor/icons/2x/icon_help.png
Binary files differ
diff --git a/editor/icons/2x/icon_help_search.png b/editor/icons/2x/icon_help_search.png
new file mode 100644
index 0000000000..a35c4b6070
--- /dev/null
+++ b/editor/icons/2x/icon_help_search.png
Binary files differ
diff --git a/editor/icons/2x/icon_hslider_bg.png b/editor/icons/2x/icon_hslider_bg.png
new file mode 100644
index 0000000000..e3c61f25e0
--- /dev/null
+++ b/editor/icons/2x/icon_hslider_bg.png
Binary files differ
diff --git a/editor/icons/2x/icon_key_hover.png b/editor/icons/2x/icon_key_hover.png
index c9894ad8bf..5dd96e8dca 100644
--- a/editor/icons/2x/icon_key_hover.png
+++ b/editor/icons/2x/icon_key_hover.png
Binary files differ
diff --git a/editor/icons/2x/icon_key_selected.png b/editor/icons/2x/icon_key_selected.png
index 243dacb604..7fc9ffdeb4 100644
--- a/editor/icons/2x/icon_key_selected.png
+++ b/editor/icons/2x/icon_key_selected.png
Binary files differ
diff --git a/editor/icons/2x/icon_key_value.png b/editor/icons/2x/icon_key_value.png
index 3863403706..94921e2446 100644
--- a/editor/icons/2x/icon_key_value.png
+++ b/editor/icons/2x/icon_key_value.png
Binary files differ
diff --git a/editor/icons/2x/icon_key_xform.png b/editor/icons/2x/icon_key_xform.png
index 70c49b5b5f..5749aac8f4 100644
--- a/editor/icons/2x/icon_key_xform.png
+++ b/editor/icons/2x/icon_key_xform.png
Binary files differ
diff --git a/editor/icons/2x/icon_line_2d.png b/editor/icons/2x/icon_line_2d.png
index 27299a2b69..66e5bbc5ba 100644
--- a/editor/icons/2x/icon_line_2d.png
+++ b/editor/icons/2x/icon_line_2d.png
Binary files differ
diff --git a/editor/icons/2x/icon_line_edit.png b/editor/icons/2x/icon_line_edit.png
index d0c987388f..e6a0bc4777 100644
--- a/editor/icons/2x/icon_line_edit.png
+++ b/editor/icons/2x/icon_line_edit.png
Binary files differ
diff --git a/editor/icons/2x/icon_mini_basis.png b/editor/icons/2x/icon_mini_basis.png
new file mode 100644
index 0000000000..276b48d722
--- /dev/null
+++ b/editor/icons/2x/icon_mini_basis.png
Binary files differ
diff --git a/editor/icons/2x/icon_mini_matrix3.png b/editor/icons/2x/icon_mini_matrix3.png
index 93783177e1..276b48d722 100644
--- a/editor/icons/2x/icon_mini_matrix3.png
+++ b/editor/icons/2x/icon_mini_matrix3.png
Binary files differ
diff --git a/editor/icons/2x/icon_mini_transform2D.png b/editor/icons/2x/icon_mini_transform2D.png
new file mode 100644
index 0000000000..4237eced18
--- /dev/null
+++ b/editor/icons/2x/icon_mini_transform2D.png
Binary files differ
diff --git a/editor/icons/2x/icon_mirror_x.png b/editor/icons/2x/icon_mirror_x.png
index 3b096dce88..b5a8867a16 100644
--- a/editor/icons/2x/icon_mirror_x.png
+++ b/editor/icons/2x/icon_mirror_x.png
Binary files differ
diff --git a/editor/icons/2x/icon_mirror_y.png b/editor/icons/2x/icon_mirror_y.png
index 4c89b167b5..4a0483eb70 100644
--- a/editor/icons/2x/icon_mirror_y.png
+++ b/editor/icons/2x/icon_mirror_y.png
Binary files differ
diff --git a/editor/icons/2x/icon_move_down.png b/editor/icons/2x/icon_move_down.png
index 97bbeea631..2a17aab204 100644
--- a/editor/icons/2x/icon_move_down.png
+++ b/editor/icons/2x/icon_move_down.png
Binary files differ
diff --git a/editor/icons/2x/icon_move_up.png b/editor/icons/2x/icon_move_up.png
index f8f31baeb1..d8d7f5a207 100644
--- a/editor/icons/2x/icon_move_up.png
+++ b/editor/icons/2x/icon_move_up.png
Binary files differ
diff --git a/editor/icons/2x/icon_multi_script.png b/editor/icons/2x/icon_multi_script.png
new file mode 100644
index 0000000000..8a7dd4ee11
--- /dev/null
+++ b/editor/icons/2x/icon_multi_script.png
Binary files differ
diff --git a/editor/icons/2x/icon_native_script.png b/editor/icons/2x/icon_native_script.png
new file mode 100644
index 0000000000..31cc130867
--- /dev/null
+++ b/editor/icons/2x/icon_native_script.png
Binary files differ
diff --git a/editor/icons/2x/icon_new.png b/editor/icons/2x/icon_new.png
index 683f1141fd..a10fe2cc60 100644
--- a/editor/icons/2x/icon_new.png
+++ b/editor/icons/2x/icon_new.png
Binary files differ
diff --git a/editor/icons/2x/icon_nine_patch_rect.png b/editor/icons/2x/icon_nine_patch_rect.png
index 5762a0392e..95edb79936 100644
--- a/editor/icons/2x/icon_nine_patch_rect.png
+++ b/editor/icons/2x/icon_nine_patch_rect.png
Binary files differ
diff --git a/editor/icons/2x/icon_open.png b/editor/icons/2x/icon_open.png
index 2e797c448b..759381d636 100644
--- a/editor/icons/2x/icon_open.png
+++ b/editor/icons/2x/icon_open.png
Binary files differ
diff --git a/editor/icons/2x/icon_option_arrow.png b/editor/icons/2x/icon_option_arrow.png
new file mode 100644
index 0000000000..ed177a4451
--- /dev/null
+++ b/editor/icons/2x/icon_option_arrow.png
Binary files differ
diff --git a/editor/icons/2x/icon_option_button.png b/editor/icons/2x/icon_option_button.png
index f4438f9efd..0e9998f856 100644
--- a/editor/icons/2x/icon_option_button.png
+++ b/editor/icons/2x/icon_option_button.png
Binary files differ
diff --git a/editor/icons/2x/icon_panorama_sky.png b/editor/icons/2x/icon_panorama_sky.png
new file mode 100644
index 0000000000..984b92c682
--- /dev/null
+++ b/editor/icons/2x/icon_panorama_sky.png
Binary files differ
diff --git a/editor/icons/2x/icon_particles_material.png b/editor/icons/2x/icon_particles_material.png
new file mode 100644
index 0000000000..26ce8f6809
--- /dev/null
+++ b/editor/icons/2x/icon_particles_material.png
Binary files differ
diff --git a/editor/icons/2x/icon_plane_mesh.png b/editor/icons/2x/icon_plane_mesh.png
new file mode 100644
index 0000000000..d7692eae72
--- /dev/null
+++ b/editor/icons/2x/icon_plane_mesh.png
Binary files differ
diff --git a/editor/icons/2x/icon_play_button_group.png b/editor/icons/2x/icon_play_button_group.png
new file mode 100644
index 0000000000..e28cb52e64
--- /dev/null
+++ b/editor/icons/2x/icon_play_button_group.png
Binary files differ
diff --git a/editor/icons/2x/icon_prism_mesh.png b/editor/icons/2x/icon_prism_mesh.png
new file mode 100644
index 0000000000..fcf34ba7a6
--- /dev/null
+++ b/editor/icons/2x/icon_prism_mesh.png
Binary files differ
diff --git a/editor/icons/2x/icon_procedural_sky.png b/editor/icons/2x/icon_procedural_sky.png
new file mode 100644
index 0000000000..b615c16ecb
--- /dev/null
+++ b/editor/icons/2x/icon_procedural_sky.png
Binary files differ
diff --git a/editor/icons/2x/icon_quad_mesh.png b/editor/icons/2x/icon_quad_mesh.png
new file mode 100644
index 0000000000..a8a3513b6d
--- /dev/null
+++ b/editor/icons/2x/icon_quad_mesh.png
Binary files differ
diff --git a/editor/icons/2x/icon_reference_rect.png b/editor/icons/2x/icon_reference_rect.png
index 63fe559fa7..41130f7fdd 100644
--- a/editor/icons/2x/icon_reference_rect.png
+++ b/editor/icons/2x/icon_reference_rect.png
Binary files differ
diff --git a/editor/icons/2x/icon_remote_transform.png b/editor/icons/2x/icon_remote_transform.png
index dad528615a..38bfaad644 100644
--- a/editor/icons/2x/icon_remote_transform.png
+++ b/editor/icons/2x/icon_remote_transform.png
Binary files differ
diff --git a/editor/icons/2x/icon_remote_transform_2d.png b/editor/icons/2x/icon_remote_transform_2d.png
index 7ef3e06f81..022da8a9ef 100644
--- a/editor/icons/2x/icon_remote_transform_2d.png
+++ b/editor/icons/2x/icon_remote_transform_2d.png
Binary files differ
diff --git a/editor/icons/2x/icon_search.png b/editor/icons/2x/icon_search.png
new file mode 100644
index 0000000000..0c4a6a8c84
--- /dev/null
+++ b/editor/icons/2x/icon_search.png
Binary files differ
diff --git a/editor/icons/2x/icon_slider_grabber.png b/editor/icons/2x/icon_slider_grabber.png
new file mode 100644
index 0000000000..64cf83270a
--- /dev/null
+++ b/editor/icons/2x/icon_slider_grabber.png
Binary files differ
diff --git a/editor/icons/2x/icon_slider_grabber_hl.png b/editor/icons/2x/icon_slider_grabber_hl.png
new file mode 100644
index 0000000000..d68da0d12a
--- /dev/null
+++ b/editor/icons/2x/icon_slider_grabber_hl.png
Binary files differ
diff --git a/editor/icons/2x/icon_slider_joint.png b/editor/icons/2x/icon_slider_joint.png
index 626479152f..d3bb501bac 100644
--- a/editor/icons/2x/icon_slider_joint.png
+++ b/editor/icons/2x/icon_slider_joint.png
Binary files differ
diff --git a/editor/icons/2x/icon_spatial_material.png b/editor/icons/2x/icon_spatial_material.png
new file mode 100644
index 0000000000..68f6cf8dac
--- /dev/null
+++ b/editor/icons/2x/icon_spatial_material.png
Binary files differ
diff --git a/editor/icons/2x/icon_sphere_mesh.png b/editor/icons/2x/icon_sphere_mesh.png
new file mode 100644
index 0000000000..29b01ebd1b
--- /dev/null
+++ b/editor/icons/2x/icon_sphere_mesh.png
Binary files differ
diff --git a/editor/icons/2x/icon_spinbox_updown.png b/editor/icons/2x/icon_spinbox_updown.png
new file mode 100644
index 0000000000..e711fbf08b
--- /dev/null
+++ b/editor/icons/2x/icon_spinbox_updown.png
Binary files differ
diff --git a/editor/icons/2x/icon_stream_texture.png b/editor/icons/2x/icon_stream_texture.png
new file mode 100644
index 0000000000..85cc3e7206
--- /dev/null
+++ b/editor/icons/2x/icon_stream_texture.png
Binary files differ
diff --git a/editor/icons/2x/icon_tab_menu.png b/editor/icons/2x/icon_tab_menu.png
new file mode 100644
index 0000000000..becad9db76
--- /dev/null
+++ b/editor/icons/2x/icon_tab_menu.png
Binary files differ
diff --git a/editor/icons/2x/icon_tabs.png b/editor/icons/2x/icon_tabs.png
index 6c317010c8..af61bc5ab1 100644
--- a/editor/icons/2x/icon_tabs.png
+++ b/editor/icons/2x/icon_tabs.png
Binary files differ
diff --git a/editor/icons/2x/icon_texture_rect.png b/editor/icons/2x/icon_texture_rect.png
index 50d715dd09..4eba75c4e7 100644
--- a/editor/icons/2x/icon_texture_rect.png
+++ b/editor/icons/2x/icon_texture_rect.png
Binary files differ
diff --git a/editor/icons/2x/icon_timer.png b/editor/icons/2x/icon_timer.png
index b0df31d803..bc07f41828 100644
--- a/editor/icons/2x/icon_timer.png
+++ b/editor/icons/2x/icon_timer.png
Binary files differ
diff --git a/editor/icons/2x/icon_tool_button.png b/editor/icons/2x/icon_tool_button.png
index 091fa8334f..b9dd65518f 100644
--- a/editor/icons/2x/icon_tool_button.png
+++ b/editor/icons/2x/icon_tool_button.png
Binary files differ
diff --git a/editor/icons/2x/icon_tools.png b/editor/icons/2x/icon_tools.png
index 6143191fc7..be76e8fc3a 100644
--- a/editor/icons/2x/icon_tools.png
+++ b/editor/icons/2x/icon_tools.png
Binary files differ
diff --git a/editor/icons/2x/icon_tree.png b/editor/icons/2x/icon_tree.png
index 3f470cc0f3..7fb4f97f83 100644
--- a/editor/icons/2x/icon_tree.png
+++ b/editor/icons/2x/icon_tree.png
Binary files differ
diff --git a/editor/icons/2x/icon_tree_arrow_down.png b/editor/icons/2x/icon_tree_arrow_down.png
new file mode 100644
index 0000000000..00012dea39
--- /dev/null
+++ b/editor/icons/2x/icon_tree_arrow_down.png
Binary files differ
diff --git a/editor/icons/2x/icon_tree_arrow_right.png b/editor/icons/2x/icon_tree_arrow_right.png
new file mode 100644
index 0000000000..baaf016784
--- /dev/null
+++ b/editor/icons/2x/icon_tree_arrow_right.png
Binary files differ
diff --git a/editor/icons/2x/icon_tween.png b/editor/icons/2x/icon_tween.png
index a13d955eb0..1f020a0e79 100644
--- a/editor/icons/2x/icon_tween.png
+++ b/editor/icons/2x/icon_tween.png
Binary files differ
diff --git a/editor/icons/2x/icon_unchecked.png b/editor/icons/2x/icon_unchecked.png
new file mode 100644
index 0000000000..cd8b781000
--- /dev/null
+++ b/editor/icons/2x/icon_unchecked.png
Binary files differ
diff --git a/editor/icons/2x/icon_v_button_array.png b/editor/icons/2x/icon_v_button_array.png
index 93fd1fed04..c91d7ec1cb 100644
--- a/editor/icons/2x/icon_v_button_array.png
+++ b/editor/icons/2x/icon_v_button_array.png
Binary files differ
diff --git a/editor/icons/2x/icon_v_scroll_bar.png b/editor/icons/2x/icon_v_scroll_bar.png
index 5e4f83197f..2601f681b7 100644
--- a/editor/icons/2x/icon_v_scroll_bar.png
+++ b/editor/icons/2x/icon_v_scroll_bar.png
Binary files differ
diff --git a/editor/icons/2x/icon_v_slider.png b/editor/icons/2x/icon_v_slider.png
index afc88cf510..fb7d8c2e56 100644
--- a/editor/icons/2x/icon_v_slider.png
+++ b/editor/icons/2x/icon_v_slider.png
Binary files differ
diff --git a/editor/icons/2x/icon_variant.png b/editor/icons/2x/icon_variant.png
new file mode 100644
index 0000000000..bb8075a069
--- /dev/null
+++ b/editor/icons/2x/icon_variant.png
Binary files differ
diff --git a/editor/icons/2x/icon_video_player.png b/editor/icons/2x/icon_video_player.png
index 588e17aa4e..4c1961f2ae 100644
--- a/editor/icons/2x/icon_video_player.png
+++ b/editor/icons/2x/icon_video_player.png
Binary files differ
diff --git a/editor/icons/2x/icon_visual_script.png b/editor/icons/2x/icon_visual_script.png
index 78a3a0c318..eefd214811 100644
--- a/editor/icons/2x/icon_visual_script.png
+++ b/editor/icons/2x/icon_visual_script.png
Binary files differ
diff --git a/editor/icons/2x/icon_vslider_bg.png b/editor/icons/2x/icon_vslider_bg.png
new file mode 100644
index 0000000000..a7e0e78564
--- /dev/null
+++ b/editor/icons/2x/icon_vslider_bg.png
Binary files differ
diff --git a/editor/icons/2x/icon_warning.png b/editor/icons/2x/icon_warning.png
index 5d807065e7..e953c02ce3 100644
--- a/editor/icons/2x/icon_warning.png
+++ b/editor/icons/2x/icon_warning.png
Binary files differ
diff --git a/editor/icons/2x/icon_world_environment.png b/editor/icons/2x/icon_world_environment.png
index 9ca558fcba..c680dd99bd 100644
--- a/editor/icons/2x/icon_world_environment.png
+++ b/editor/icons/2x/icon_world_environment.png
Binary files differ
diff --git a/editor/icons/2x/icon_zoom.png b/editor/icons/2x/icon_zoom.png
index 0c4a6a8c84..0de25b4db7 100644
--- a/editor/icons/2x/icon_zoom.png
+++ b/editor/icons/2x/icon_zoom.png
Binary files differ
diff --git a/editor/icons/SCsub b/editor/icons/SCsub
index 3fc8e5461f..182624a80d 100644
--- a/editor/icons/SCsub
+++ b/editor/icons/SCsub
@@ -62,9 +62,9 @@ def make_editor_icons_action(target, source, env):
s.write("static Ref<ImageTexture> make_icon(const uint8_t* p_png,const uint8_t* p_hidpi_png) {\n")
s.write("\tRef<ImageTexture> texture( memnew( ImageTexture ) );\n")
s.write("\tbool use_hidpi_image=(editor_get_scale()>1.0&&p_hidpi_png);\n")
- s.write("\tImage img(use_hidpi_image?p_hidpi_png:p_png);\n")
- s.write("\tif (editor_get_scale()>1.0 && !p_hidpi_png) { img.convert(Image::FORMAT_RGBA8); img.expand_x2_hq2x(); use_hidpi_image=true;}\n")
- s.write("\timg.resize(img.get_width()*EDSCALE/(use_hidpi_image?2:1),img.get_height()*EDSCALE/(use_hidpi_image?2:1));\n")
+ s.write("\tRef<Image> img = memnew(Image(use_hidpi_image?p_hidpi_png:p_png));\n")
+ s.write("\tif (editor_get_scale()>1.0 && !p_hidpi_png) { img->convert(Image::FORMAT_RGBA8); img->expand_x2_hq2x(); use_hidpi_image=true;}\n")
+ s.write("\timg->resize(img->get_width()*EDSCALE/(use_hidpi_image?2:1),img->get_height()*EDSCALE/(use_hidpi_image?2:1));\n")
s.write("\ttexture->create_from_image( img,ImageTexture::FLAG_FILTER );\n")
s.write("\treturn texture;\n")
s.write("}\n\n")
@@ -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('#editor/editor_icons.cpp', Glob("*.png"))])
+env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.gen.cpp', Glob("*.png"))])
-env.editor_sources.append("#editor/editor_icons.cpp")
+env.editor_sources.append("#editor/editor_icons.gen.cpp")
Export('env')
diff --git a/editor/icons/icon_2_d.png b/editor/icons/icon_2_d.png
new file mode 100644
index 0000000000..d8a77ee1c2
--- /dev/null
+++ b/editor/icons/icon_2_d.png
Binary files differ
diff --git a/editor/icons/icon_3_d.png b/editor/icons/icon_3_d.png
new file mode 100644
index 0000000000..e1daf1077b
--- /dev/null
+++ b/editor/icons/icon_3_d.png
Binary files differ
diff --git a/editor/icons/icon_GUI_checked.png b/editor/icons/icon_GUI_checked.png
new file mode 100644
index 0000000000..aa5e7f6bdb
--- /dev/null
+++ b/editor/icons/icon_GUI_checked.png
Binary files differ
diff --git a/editor/icons/icon_GUI_dropdown.png b/editor/icons/icon_GUI_dropdown.png
new file mode 100644
index 0000000000..d21cdb634e
--- /dev/null
+++ b/editor/icons/icon_GUI_dropdown.png
Binary files differ
diff --git a/editor/icons/icon_GUI_hslider_bg.png b/editor/icons/icon_GUI_hslider_bg.png
new file mode 100644
index 0000000000..1286b887f6
--- /dev/null
+++ b/editor/icons/icon_GUI_hslider_bg.png
Binary files differ
diff --git a/editor/icons/icon_GUI_hsplitter.png b/editor/icons/icon_GUI_hsplitter.png
new file mode 100644
index 0000000000..3ac1dddf90
--- /dev/null
+++ b/editor/icons/icon_GUI_hsplitter.png
Binary files differ
diff --git a/editor/icons/icon_GUI_mini_tab_menu.png b/editor/icons/icon_GUI_mini_tab_menu.png
new file mode 100644
index 0000000000..1dc793de1a
--- /dev/null
+++ b/editor/icons/icon_GUI_mini_tab_menu.png
Binary files differ
diff --git a/editor/icons/icon_GUI_option_arrow.png b/editor/icons/icon_GUI_option_arrow.png
new file mode 100644
index 0000000000..b7bc38e03f
--- /dev/null
+++ b/editor/icons/icon_GUI_option_arrow.png
Binary files differ
diff --git a/editor/icons/icon_GUI_play_button_group.png b/editor/icons/icon_GUI_play_button_group.png
new file mode 100644
index 0000000000..83820c8e0c
--- /dev/null
+++ b/editor/icons/icon_GUI_play_button_group.png
Binary files differ
diff --git a/editor/icons/icon_GUI_progress_bar.png b/editor/icons/icon_GUI_progress_bar.png
new file mode 100644
index 0000000000..7d70e6beb5
--- /dev/null
+++ b/editor/icons/icon_GUI_progress_bar.png
Binary files differ
diff --git a/editor/icons/icon_GUI_progress_fill.png b/editor/icons/icon_GUI_progress_fill.png
new file mode 100644
index 0000000000..4b7b4c554c
--- /dev/null
+++ b/editor/icons/icon_GUI_progress_fill.png
Binary files differ
diff --git a/editor/icons/icon_GUI_radio_checked.png b/editor/icons/icon_GUI_radio_checked.png
new file mode 100644
index 0000000000..699d0966a9
--- /dev/null
+++ b/editor/icons/icon_GUI_radio_checked.png
Binary files differ
diff --git a/editor/icons/icon_GUI_radio_unchecked.png b/editor/icons/icon_GUI_radio_unchecked.png
new file mode 100644
index 0000000000..e8ce1f8e6d
--- /dev/null
+++ b/editor/icons/icon_GUI_radio_unchecked.png
Binary files differ
diff --git a/editor/icons/icon_GUI_scroll_bg.png b/editor/icons/icon_GUI_scroll_bg.png
new file mode 100644
index 0000000000..1908fd8aee
--- /dev/null
+++ b/editor/icons/icon_GUI_scroll_bg.png
Binary files differ
diff --git a/editor/icons/icon_GUI_scroll_grabber.png b/editor/icons/icon_GUI_scroll_grabber.png
new file mode 100644
index 0000000000..4be7f4e6cc
--- /dev/null
+++ b/editor/icons/icon_GUI_scroll_grabber.png
Binary files differ
diff --git a/editor/icons/icon_GUI_scroll_grabber_hl.png b/editor/icons/icon_GUI_scroll_grabber_hl.png
new file mode 100644
index 0000000000..98e357f82a
--- /dev/null
+++ b/editor/icons/icon_GUI_scroll_grabber_hl.png
Binary files differ
diff --git a/editor/icons/icon_GUI_scroll_grabber_pressed.png b/editor/icons/icon_GUI_scroll_grabber_pressed.png
new file mode 100644
index 0000000000..a46d242ddd
--- /dev/null
+++ b/editor/icons/icon_GUI_scroll_grabber_pressed.png
Binary files differ
diff --git a/editor/icons/icon_GUI_slider_grabber.png b/editor/icons/icon_GUI_slider_grabber.png
new file mode 100644
index 0000000000..76edc3b81f
--- /dev/null
+++ b/editor/icons/icon_GUI_slider_grabber.png
Binary files differ
diff --git a/editor/icons/icon_GUI_slider_grabber_hl.png b/editor/icons/icon_GUI_slider_grabber_hl.png
new file mode 100644
index 0000000000..97a2f4b67a
--- /dev/null
+++ b/editor/icons/icon_GUI_slider_grabber_hl.png
Binary files differ
diff --git a/editor/icons/icon_GUI_spinbox_updown.png b/editor/icons/icon_GUI_spinbox_updown.png
new file mode 100644
index 0000000000..ff65df801b
--- /dev/null
+++ b/editor/icons/icon_GUI_spinbox_updown.png
Binary files differ
diff --git a/editor/icons/icon_GUI_tab_menu.png b/editor/icons/icon_GUI_tab_menu.png
new file mode 100644
index 0000000000..ffc63f2d41
--- /dev/null
+++ b/editor/icons/icon_GUI_tab_menu.png
Binary files differ
diff --git a/editor/icons/icon_GUI_toggle_off.png b/editor/icons/icon_GUI_toggle_off.png
new file mode 100644
index 0000000000..c4c599172d
--- /dev/null
+++ b/editor/icons/icon_GUI_toggle_off.png
Binary files differ
diff --git a/editor/icons/icon_GUI_toggle_on.png b/editor/icons/icon_GUI_toggle_on.png
new file mode 100644
index 0000000000..9dd6ce7bee
--- /dev/null
+++ b/editor/icons/icon_GUI_toggle_on.png
Binary files differ
diff --git a/editor/icons/icon_GUI_tree_arrow_down.png b/editor/icons/icon_GUI_tree_arrow_down.png
new file mode 100644
index 0000000000..4ef7b41de6
--- /dev/null
+++ b/editor/icons/icon_GUI_tree_arrow_down.png
Binary files differ
diff --git a/editor/icons/icon_GUI_tree_arrow_right.png b/editor/icons/icon_GUI_tree_arrow_right.png
new file mode 100644
index 0000000000..13a42f730d
--- /dev/null
+++ b/editor/icons/icon_GUI_tree_arrow_right.png
Binary files differ
diff --git a/editor/icons/icon_GUI_unchecked.png b/editor/icons/icon_GUI_unchecked.png
new file mode 100644
index 0000000000..8341cdc643
--- /dev/null
+++ b/editor/icons/icon_GUI_unchecked.png
Binary files differ
diff --git a/editor/icons/icon_GUI_vslider_bg.png b/editor/icons/icon_GUI_vslider_bg.png
new file mode 100644
index 0000000000..fa8c6cac1f
--- /dev/null
+++ b/editor/icons/icon_GUI_vslider_bg.png
Binary files differ
diff --git a/editor/icons/icon_GUI_vsplit_bg.png b/editor/icons/icon_GUI_vsplit_bg.png
new file mode 100644
index 0000000000..0c29b1e35c
--- /dev/null
+++ b/editor/icons/icon_GUI_vsplit_bg.png
Binary files differ
diff --git a/editor/icons/icon_GUI_vsplitter.png b/editor/icons/icon_GUI_vsplitter.png
new file mode 100644
index 0000000000..56fb20bc3f
--- /dev/null
+++ b/editor/icons/icon_GUI_vsplitter.png
Binary files differ
diff --git a/editor/icons/icon_animation_player.png b/editor/icons/icon_animation_player.png
index 8a6f446e4e..474ec2e647 100644
--- a/editor/icons/icon_animation_player.png
+++ b/editor/icons/icon_animation_player.png
Binary files differ
diff --git a/editor/icons/icon_animation_tree.png b/editor/icons/icon_animation_tree.png
index 684edb876b..0bc8e7245a 100644
--- a/editor/icons/icon_animation_tree.png
+++ b/editor/icons/icon_animation_tree.png
Binary files differ
diff --git a/editor/icons/icon_animation_tree_player.png b/editor/icons/icon_animation_tree_player.png
index 684edb876b..0bc8e7245a 100644
--- a/editor/icons/icon_animation_tree_player.png
+++ b/editor/icons/icon_animation_tree_player.png
Binary files differ
diff --git a/editor/icons/icon_arrow_left.png b/editor/icons/icon_arrow_left.png
index 1e0d38b4b6..ad382516c2 100644
--- a/editor/icons/icon_arrow_left.png
+++ b/editor/icons/icon_arrow_left.png
Binary files differ
diff --git a/editor/icons/icon_arrow_right.png b/editor/icons/icon_arrow_right.png
index 09907755e1..6260d44fac 100644
--- a/editor/icons/icon_arrow_right.png
+++ b/editor/icons/icon_arrow_right.png
Binary files differ
diff --git a/editor/icons/icon_arrow_up.png b/editor/icons/icon_arrow_up.png
index f7ec666f69..2f02f48e18 100644
--- a/editor/icons/icon_arrow_up.png
+++ b/editor/icons/icon_arrow_up.png
Binary files differ
diff --git a/editor/icons/icon_asset_lib.png b/editor/icons/icon_asset_lib.png
new file mode 100644
index 0000000000..70d708a58c
--- /dev/null
+++ b/editor/icons/icon_asset_lib.png
Binary files differ
diff --git a/editor/icons/icon_audio_bus_bypass.png b/editor/icons/icon_audio_bus_bypass.png
new file mode 100644
index 0000000000..95a3a0177a
--- /dev/null
+++ b/editor/icons/icon_audio_bus_bypass.png
Binary files differ
diff --git a/editor/icons/icon_audio_bus_layout.png b/editor/icons/icon_audio_bus_layout.png
new file mode 100644
index 0000000000..bfa5e2c933
--- /dev/null
+++ b/editor/icons/icon_audio_bus_layout.png
Binary files differ
diff --git a/editor/icons/icon_audio_bus_mute.png b/editor/icons/icon_audio_bus_mute.png
new file mode 100644
index 0000000000..b074d848e0
--- /dev/null
+++ b/editor/icons/icon_audio_bus_mute.png
Binary files differ
diff --git a/editor/icons/icon_audio_bus_solo.png b/editor/icons/icon_audio_bus_solo.png
new file mode 100644
index 0000000000..085269f231
--- /dev/null
+++ b/editor/icons/icon_audio_bus_solo.png
Binary files differ
diff --git a/editor/icons/icon_audio_effect_amplify.png b/editor/icons/icon_audio_effect_amplify.png
index 9af3227d40..6588b90372 100644
--- a/editor/icons/icon_audio_effect_amplify.png
+++ b/editor/icons/icon_audio_effect_amplify.png
Binary files differ
diff --git a/editor/icons/icon_audio_stream_player.png b/editor/icons/icon_audio_stream_player.png
new file mode 100644
index 0000000000..c3e6d6cafa
--- /dev/null
+++ b/editor/icons/icon_audio_stream_player.png
Binary files differ
diff --git a/editor/icons/icon_audio_stream_player_2_d.png b/editor/icons/icon_audio_stream_player_2_d.png
new file mode 100644
index 0000000000..a332b876ea
--- /dev/null
+++ b/editor/icons/icon_audio_stream_player_2_d.png
Binary files differ
diff --git a/editor/icons/icon_audio_stream_player_3_d.png b/editor/icons/icon_audio_stream_player_3_d.png
new file mode 100644
index 0000000000..60e3528ffd
--- /dev/null
+++ b/editor/icons/icon_audio_stream_player_3_d.png
Binary files differ
diff --git a/editor/icons/icon_audio_stream_sample.png b/editor/icons/icon_audio_stream_sample.png
new file mode 100644
index 0000000000..2b97f6198b
--- /dev/null
+++ b/editor/icons/icon_audio_stream_sample.png
Binary files differ
diff --git a/editor/icons/icon_back.png b/editor/icons/icon_back.png
index 52fbc8117a..8497d2cf4b 100644
--- a/editor/icons/icon_back.png
+++ b/editor/icons/icon_back.png
Binary files differ
diff --git a/editor/icons/icon_baked_light.png b/editor/icons/icon_baked_light.png
index 3b7fce5c9f..c667b542c1 100644
--- a/editor/icons/icon_baked_light.png
+++ b/editor/icons/icon_baked_light.png
Binary files differ
diff --git a/editor/icons/icon_bit_map.png b/editor/icons/icon_bit_map.png
index 50dd8157d1..58468c98bd 100644
--- a/editor/icons/icon_bit_map.png
+++ b/editor/icons/icon_bit_map.png
Binary files differ
diff --git a/editor/icons/icon_bool.png b/editor/icons/icon_bool.png
index 822b5dd688..c680bc195a 100644
--- a/editor/icons/icon_bool.png
+++ b/editor/icons/icon_bool.png
Binary files differ
diff --git a/editor/icons/icon_bus_vu_db.png b/editor/icons/icon_bus_vu_db.png
index 52507cae52..2c51a2e559 100644
--- a/editor/icons/icon_bus_vu_db.png
+++ b/editor/icons/icon_bus_vu_db.png
Binary files differ
diff --git a/editor/icons/icon_bus_vu_empty.png b/editor/icons/icon_bus_vu_empty.png
index 6fc3143a55..32d886b1a2 100644
--- a/editor/icons/icon_bus_vu_empty.png
+++ b/editor/icons/icon_bus_vu_empty.png
Binary files differ
diff --git a/editor/icons/icon_bus_vu_frozen.png b/editor/icons/icon_bus_vu_frozen.png
index cf128afa91..4e9b8f4b4b 100644
--- a/editor/icons/icon_bus_vu_frozen.png
+++ b/editor/icons/icon_bus_vu_frozen.png
Binary files differ
diff --git a/editor/icons/icon_bus_vu_full.png b/editor/icons/icon_bus_vu_full.png
index 9e3d7a93e3..b47deea254 100644
--- a/editor/icons/icon_bus_vu_full.png
+++ b/editor/icons/icon_bus_vu_full.png
Binary files differ
diff --git a/editor/icons/icon_button.png b/editor/icons/icon_button.png
index da02831da2..0c39e003e4 100644
--- a/editor/icons/icon_button.png
+++ b/editor/icons/icon_button.png
Binary files differ
diff --git a/editor/icons/icon_button_group.png b/editor/icons/icon_button_group.png
index c105234598..ac2e484abc 100644
--- a/editor/icons/icon_button_group.png
+++ b/editor/icons/icon_button_group.png
Binary files differ
diff --git a/editor/icons/icon_capsule_mesh.png b/editor/icons/icon_capsule_mesh.png
new file mode 100644
index 0000000000..e656b4b047
--- /dev/null
+++ b/editor/icons/icon_capsule_mesh.png
Binary files differ
diff --git a/editor/icons/icon_checked.png b/editor/icons/icon_checked.png
new file mode 100644
index 0000000000..d3442930bb
--- /dev/null
+++ b/editor/icons/icon_checked.png
Binary files differ
diff --git a/editor/icons/icon_color_rect.png b/editor/icons/icon_color_rect.png
index 40b9dab605..4199a89049 100644
--- a/editor/icons/icon_color_rect.png
+++ b/editor/icons/icon_color_rect.png
Binary files differ
diff --git a/editor/icons/icon_confirmation_dialog.png b/editor/icons/icon_confirmation_dialog.png
index 2dd4cd00fb..ffadb9d907 100644
--- a/editor/icons/icon_confirmation_dialog.png
+++ b/editor/icons/icon_confirmation_dialog.png
Binary files differ
diff --git a/editor/icons/icon_connect.png b/editor/icons/icon_connect.png
index 51615838a9..0963063bed 100644
--- a/editor/icons/icon_connect.png
+++ b/editor/icons/icon_connect.png
Binary files differ
diff --git a/editor/icons/icon_copy_node_path.png b/editor/icons/icon_copy_node_path.png
index d777f132d8..877bb81d81 100644
--- a/editor/icons/icon_copy_node_path.png
+++ b/editor/icons/icon_copy_node_path.png
Binary files differ
diff --git a/editor/icons/icon_cube_mesh.png b/editor/icons/icon_cube_mesh.png
new file mode 100644
index 0000000000..a52d7a1823
--- /dev/null
+++ b/editor/icons/icon_cube_mesh.png
Binary files differ
diff --git a/editor/icons/icon_curve.png b/editor/icons/icon_curve.png
index 27d423edcd..a261e00f66 100644
--- a/editor/icons/icon_curve.png
+++ b/editor/icons/icon_curve.png
Binary files differ
diff --git a/editor/icons/icon_curve_texture.png b/editor/icons/icon_curve_texture.png
new file mode 100644
index 0000000000..bc5c7f6bf1
--- /dev/null
+++ b/editor/icons/icon_curve_texture.png
Binary files differ
diff --git a/editor/icons/icon_cylinder_mesh.png b/editor/icons/icon_cylinder_mesh.png
new file mode 100644
index 0000000000..da147ce7b4
--- /dev/null
+++ b/editor/icons/icon_cylinder_mesh.png
Binary files differ
diff --git a/editor/icons/icon_debug.png b/editor/icons/icon_debug.png
index 03b98aa9e4..b67e306697 100644
--- a/editor/icons/icon_debug.png
+++ b/editor/icons/icon_debug.png
Binary files differ
diff --git a/editor/icons/icon_default_project_icon.png b/editor/icons/icon_default_project_icon.png
index e87a49bd28..4c31fe5cb2 100644
--- a/editor/icons/icon_default_project_icon.png
+++ b/editor/icons/icon_default_project_icon.png
Binary files differ
diff --git a/editor/icons/icon_dropdown.png b/editor/icons/icon_dropdown.png
new file mode 100644
index 0000000000..b9a324be7c
--- /dev/null
+++ b/editor/icons/icon_dropdown.png
Binary files differ
diff --git a/editor/icons/icon_edit_resource.png b/editor/icons/icon_edit_resource.png
index 9f064fea3f..fca57f3e7e 100644
--- a/editor/icons/icon_edit_resource.png
+++ b/editor/icons/icon_edit_resource.png
Binary files differ
diff --git a/editor/icons/icon_editor_control_anchor.png b/editor/icons/icon_editor_control_anchor.png
new file mode 100644
index 0000000000..158dd62a7b
--- /dev/null
+++ b/editor/icons/icon_editor_control_anchor.png
Binary files differ
diff --git a/editor/icons/icon_environment.png b/editor/icons/icon_environment.png
index c8c4da3e8f..265af5e4ad 100644
--- a/editor/icons/icon_environment.png
+++ b/editor/icons/icon_environment.png
Binary files differ
diff --git a/editor/icons/icon_error.png b/editor/icons/icon_error.png
index 7a9bed43aa..8a9130f70b 100644
--- a/editor/icons/icon_error.png
+++ b/editor/icons/icon_error.png
Binary files differ
diff --git a/editor/icons/icon_file.png b/editor/icons/icon_file.png
index 69c6c90dc7..b012e1f214 100644
--- a/editor/icons/icon_file.png
+++ b/editor/icons/icon_file.png
Binary files differ
diff --git a/editor/icons/icon_file_big.png b/editor/icons/icon_file_big.png
index d429736b57..e0aff764f1 100644
--- a/editor/icons/icon_file_big.png
+++ b/editor/icons/icon_file_big.png
Binary files differ
diff --git a/editor/icons/icon_file_dialog.png b/editor/icons/icon_file_dialog.png
index 162827b2b0..c918e2b3b2 100644
--- a/editor/icons/icon_file_dialog.png
+++ b/editor/icons/icon_file_dialog.png
Binary files differ
diff --git a/editor/icons/icon_forward.png b/editor/icons/icon_forward.png
index 412ffa89d3..529964f49d 100644
--- a/editor/icons/icon_forward.png
+++ b/editor/icons/icon_forward.png
Binary files differ
diff --git a/editor/icons/icon_g_d_native_library.png b/editor/icons/icon_g_d_native_library.png
new file mode 100644
index 0000000000..530e06a982
--- /dev/null
+++ b/editor/icons/icon_g_d_native_library.png
Binary files differ
diff --git a/editor/icons/icon_g_d_native_script.png b/editor/icons/icon_g_d_native_script.png
new file mode 100644
index 0000000000..ea4fe06704
--- /dev/null
+++ b/editor/icons/icon_g_d_native_script.png
Binary files differ
diff --git a/editor/icons/icon_godot.png b/editor/icons/icon_godot.png
index 0b72e6ecc7..a5e371865c 100644
--- a/editor/icons/icon_godot.png
+++ b/editor/icons/icon_godot.png
Binary files differ
diff --git a/editor/icons/icon_godot_docs.png b/editor/icons/icon_godot_docs.png
new file mode 100644
index 0000000000..554280c5b4
--- /dev/null
+++ b/editor/icons/icon_godot_docs.png
Binary files differ
diff --git a/editor/icons/icon_gradient.png b/editor/icons/icon_gradient.png
new file mode 100644
index 0000000000..c5e89c3908
--- /dev/null
+++ b/editor/icons/icon_gradient.png
Binary files differ
diff --git a/editor/icons/icon_gradient_texture.png b/editor/icons/icon_gradient_texture.png
new file mode 100644
index 0000000000..fedbf038a3
--- /dev/null
+++ b/editor/icons/icon_gradient_texture.png
Binary files differ
diff --git a/editor/icons/icon_graph_scalars_to_vec.png b/editor/icons/icon_graph_scalars_to_vec.png
index 231a25a02a..b8893e78ca 100644
--- a/editor/icons/icon_graph_scalars_to_vec.png
+++ b/editor/icons/icon_graph_scalars_to_vec.png
Binary files differ
diff --git a/editor/icons/icon_graph_vec_to_scalars.png b/editor/icons/icon_graph_vec_to_scalars.png
index 33f9fdf9bd..b0f2a9c4ae 100644
--- a/editor/icons/icon_graph_vec_to_scalars.png
+++ b/editor/icons/icon_graph_vec_to_scalars.png
Binary files differ
diff --git a/editor/icons/icon_graph_vecs_to_xform.png b/editor/icons/icon_graph_vecs_to_xform.png
index 82c32525dc..b5217badcf 100644
--- a/editor/icons/icon_graph_vecs_to_xform.png
+++ b/editor/icons/icon_graph_vecs_to_xform.png
Binary files differ
diff --git a/editor/icons/icon_graph_xform_to_vecs.png b/editor/icons/icon_graph_xform_to_vecs.png
index 3d59c7957d..9e2909969f 100644
--- a/editor/icons/icon_graph_xform_to_vecs.png
+++ b/editor/icons/icon_graph_xform_to_vecs.png
Binary files differ
diff --git a/editor/icons/icon_grid_map.png b/editor/icons/icon_grid_map.png
index 570b11d085..69a431ccba 100644
--- a/editor/icons/icon_grid_map.png
+++ b/editor/icons/icon_grid_map.png
Binary files differ
diff --git a/editor/icons/icon_gui_close_dark.png b/editor/icons/icon_gui_close_dark.png
new file mode 100644
index 0000000000..8f1d7d8b2c
--- /dev/null
+++ b/editor/icons/icon_gui_close_dark.png
Binary files differ
diff --git a/editor/icons/icon_gui_close_light.png b/editor/icons/icon_gui_close_light.png
new file mode 100644
index 0000000000..b8e3a80e3b
--- /dev/null
+++ b/editor/icons/icon_gui_close_light.png
Binary files differ
diff --git a/editor/icons/icon_h_button_array.png b/editor/icons/icon_h_button_array.png
index baf3386801..81b2bf79e3 100644
--- a/editor/icons/icon_h_button_array.png
+++ b/editor/icons/icon_h_button_array.png
Binary files differ
diff --git a/editor/icons/icon_h_scroll_bar.png b/editor/icons/icon_h_scroll_bar.png
index e4576c4ae3..c6c6daf7a4 100644
--- a/editor/icons/icon_h_scroll_bar.png
+++ b/editor/icons/icon_h_scroll_bar.png
Binary files differ
diff --git a/editor/icons/icon_h_slider.png b/editor/icons/icon_h_slider.png
index 87cf585e14..156364e920 100644
--- a/editor/icons/icon_h_slider.png
+++ b/editor/icons/icon_h_slider.png
Binary files differ
diff --git a/editor/icons/icon_help.png b/editor/icons/icon_help.png
index f05b512f4c..d70807000e 100644
--- a/editor/icons/icon_help.png
+++ b/editor/icons/icon_help.png
Binary files differ
diff --git a/editor/icons/icon_help_search.png b/editor/icons/icon_help_search.png
new file mode 100644
index 0000000000..7a1506853e
--- /dev/null
+++ b/editor/icons/icon_help_search.png
Binary files differ
diff --git a/editor/icons/icon_hslider_bg.png b/editor/icons/icon_hslider_bg.png
new file mode 100644
index 0000000000..e3c61f25e0
--- /dev/null
+++ b/editor/icons/icon_hslider_bg.png
Binary files differ
diff --git a/editor/icons/icon_hsplit_bg.png b/editor/icons/icon_hsplit_bg.png
new file mode 100644
index 0000000000..cfb76f7dc7
--- /dev/null
+++ b/editor/icons/icon_hsplit_bg.png
Binary files differ
diff --git a/editor/icons/icon_hsplitter.png b/editor/icons/icon_hsplitter.png
new file mode 100644
index 0000000000..3ac1dddf90
--- /dev/null
+++ b/editor/icons/icon_hsplitter.png
Binary files differ
diff --git a/editor/icons/icon_key_hover.png b/editor/icons/icon_key_hover.png
index 7ab405bb07..c8e59f0e87 100644
--- a/editor/icons/icon_key_hover.png
+++ b/editor/icons/icon_key_hover.png
Binary files differ
diff --git a/editor/icons/icon_key_selected.png b/editor/icons/icon_key_selected.png
index 1838dc95aa..e5f802db1c 100644
--- a/editor/icons/icon_key_selected.png
+++ b/editor/icons/icon_key_selected.png
Binary files differ
diff --git a/editor/icons/icon_key_value.png b/editor/icons/icon_key_value.png
index 5c0b25a264..1fa007f9e2 100644
--- a/editor/icons/icon_key_value.png
+++ b/editor/icons/icon_key_value.png
Binary files differ
diff --git a/editor/icons/icon_key_xform.png b/editor/icons/icon_key_xform.png
index 1171bd80db..bd87611d7a 100644
--- a/editor/icons/icon_key_xform.png
+++ b/editor/icons/icon_key_xform.png
Binary files differ
diff --git a/editor/icons/icon_line_2d.png b/editor/icons/icon_line_2d.png
index 4ebf46af04..8d2b176335 100644
--- a/editor/icons/icon_line_2d.png
+++ b/editor/icons/icon_line_2d.png
Binary files differ
diff --git a/editor/icons/icon_line_edit.png b/editor/icons/icon_line_edit.png
index 81b5efcf6c..813642f25e 100644
--- a/editor/icons/icon_line_edit.png
+++ b/editor/icons/icon_line_edit.png
Binary files differ
diff --git a/editor/icons/icon_logo.png b/editor/icons/icon_logo.png
index 9bbd7dc619..aed94cb87a 100644
--- a/editor/icons/icon_logo.png
+++ b/editor/icons/icon_logo.png
Binary files differ
diff --git a/editor/icons/icon_logo_small.png b/editor/icons/icon_logo_small.png
index 9c7c7fe365..809cf18541 100644
--- a/editor/icons/icon_logo_small.png
+++ b/editor/icons/icon_logo_small.png
Binary files differ
diff --git a/editor/icons/icon_mini_basis.png b/editor/icons/icon_mini_basis.png
new file mode 100644
index 0000000000..7a4ac9b137
--- /dev/null
+++ b/editor/icons/icon_mini_basis.png
Binary files differ
diff --git a/editor/icons/icon_mini_matrix3.png b/editor/icons/icon_mini_matrix3.png
index dd59d093cc..7a4ac9b137 100644
--- a/editor/icons/icon_mini_matrix3.png
+++ b/editor/icons/icon_mini_matrix3.png
Binary files differ
diff --git a/editor/icons/icon_mini_transform2D.png b/editor/icons/icon_mini_transform2D.png
new file mode 100644
index 0000000000..f4e1211bd7
--- /dev/null
+++ b/editor/icons/icon_mini_transform2D.png
Binary files differ
diff --git a/editor/icons/icon_mirror_x.png b/editor/icons/icon_mirror_x.png
index 7be48946b4..f2c9074b89 100644
--- a/editor/icons/icon_mirror_x.png
+++ b/editor/icons/icon_mirror_x.png
Binary files differ
diff --git a/editor/icons/icon_mirror_y.png b/editor/icons/icon_mirror_y.png
index ba924f7ae7..655f52d481 100644
--- a/editor/icons/icon_mirror_y.png
+++ b/editor/icons/icon_mirror_y.png
Binary files differ
diff --git a/editor/icons/icon_move_down.png b/editor/icons/icon_move_down.png
index 3934310964..7bb964675d 100644
--- a/editor/icons/icon_move_down.png
+++ b/editor/icons/icon_move_down.png
Binary files differ
diff --git a/editor/icons/icon_move_up.png b/editor/icons/icon_move_up.png
index 684013dc40..92614b8799 100644
--- a/editor/icons/icon_move_up.png
+++ b/editor/icons/icon_move_up.png
Binary files differ
diff --git a/editor/icons/icon_multi_script.png b/editor/icons/icon_multi_script.png
new file mode 100644
index 0000000000..7626937296
--- /dev/null
+++ b/editor/icons/icon_multi_script.png
Binary files differ
diff --git a/editor/icons/icon_native_script.png b/editor/icons/icon_native_script.png
new file mode 100644
index 0000000000..ea4fe06704
--- /dev/null
+++ b/editor/icons/icon_native_script.png
Binary files differ
diff --git a/editor/icons/icon_new.png b/editor/icons/icon_new.png
index 69c6c90dc7..b012e1f214 100644
--- a/editor/icons/icon_new.png
+++ b/editor/icons/icon_new.png
Binary files differ
diff --git a/editor/icons/icon_nine_patch_rect.png b/editor/icons/icon_nine_patch_rect.png
index bdd1467144..721bd36d08 100644
--- a/editor/icons/icon_nine_patch_rect.png
+++ b/editor/icons/icon_nine_patch_rect.png
Binary files differ
diff --git a/editor/icons/icon_open.png b/editor/icons/icon_open.png
index cc05e98ebb..81835efa25 100644
--- a/editor/icons/icon_open.png
+++ b/editor/icons/icon_open.png
Binary files differ
diff --git a/editor/icons/icon_option_arrow.png b/editor/icons/icon_option_arrow.png
new file mode 100644
index 0000000000..b7bc38e03f
--- /dev/null
+++ b/editor/icons/icon_option_arrow.png
Binary files differ
diff --git a/editor/icons/icon_option_button.png b/editor/icons/icon_option_button.png
index c1155309aa..b67e951fef 100644
--- a/editor/icons/icon_option_button.png
+++ b/editor/icons/icon_option_button.png
Binary files differ
diff --git a/editor/icons/icon_panorama_sky.png b/editor/icons/icon_panorama_sky.png
new file mode 100644
index 0000000000..38a53afe52
--- /dev/null
+++ b/editor/icons/icon_panorama_sky.png
Binary files differ
diff --git a/editor/icons/icon_particles_material.png b/editor/icons/icon_particles_material.png
new file mode 100644
index 0000000000..3b5c5644b2
--- /dev/null
+++ b/editor/icons/icon_particles_material.png
Binary files differ
diff --git a/editor/icons/icon_plane_mesh.png b/editor/icons/icon_plane_mesh.png
new file mode 100644
index 0000000000..8b86099d67
--- /dev/null
+++ b/editor/icons/icon_plane_mesh.png
Binary files differ
diff --git a/editor/icons/icon_play_button_group.png b/editor/icons/icon_play_button_group.png
new file mode 100644
index 0000000000..83820c8e0c
--- /dev/null
+++ b/editor/icons/icon_play_button_group.png
Binary files differ
diff --git a/editor/icons/icon_prism_mesh.png b/editor/icons/icon_prism_mesh.png
new file mode 100644
index 0000000000..49f773765f
--- /dev/null
+++ b/editor/icons/icon_prism_mesh.png
Binary files differ
diff --git a/editor/icons/icon_procedural_sky.png b/editor/icons/icon_procedural_sky.png
new file mode 100644
index 0000000000..484bcde038
--- /dev/null
+++ b/editor/icons/icon_procedural_sky.png
Binary files differ
diff --git a/editor/icons/icon_quad_mesh.png b/editor/icons/icon_quad_mesh.png
new file mode 100644
index 0000000000..52f19899a3
--- /dev/null
+++ b/editor/icons/icon_quad_mesh.png
Binary files differ
diff --git a/editor/icons/icon_reference_rect.png b/editor/icons/icon_reference_rect.png
index b253af477f..3d08ee4f76 100644
--- a/editor/icons/icon_reference_rect.png
+++ b/editor/icons/icon_reference_rect.png
Binary files differ
diff --git a/editor/icons/icon_remote_transform.png b/editor/icons/icon_remote_transform.png
index 2a8b5f4d0e..9a6c30bcc8 100644
--- a/editor/icons/icon_remote_transform.png
+++ b/editor/icons/icon_remote_transform.png
Binary files differ
diff --git a/editor/icons/icon_remote_transform_2d.png b/editor/icons/icon_remote_transform_2d.png
index 16d2691832..7266f2a71d 100644
--- a/editor/icons/icon_remote_transform_2d.png
+++ b/editor/icons/icon_remote_transform_2d.png
Binary files differ
diff --git a/editor/icons/icon_scroll_bg.png b/editor/icons/icon_scroll_bg.png
new file mode 100644
index 0000000000..1908fd8aee
--- /dev/null
+++ b/editor/icons/icon_scroll_bg.png
Binary files differ
diff --git a/editor/icons/icon_scroll_grabber.png b/editor/icons/icon_scroll_grabber.png
new file mode 100644
index 0000000000..4be7f4e6cc
--- /dev/null
+++ b/editor/icons/icon_scroll_grabber.png
Binary files differ
diff --git a/editor/icons/icon_scroll_grabber_hl.png b/editor/icons/icon_scroll_grabber_hl.png
new file mode 100644
index 0000000000..a81239b84b
--- /dev/null
+++ b/editor/icons/icon_scroll_grabber_hl.png
Binary files differ
diff --git a/editor/icons/icon_search.png b/editor/icons/icon_search.png
new file mode 100644
index 0000000000..f3748803cf
--- /dev/null
+++ b/editor/icons/icon_search.png
Binary files differ
diff --git a/editor/icons/icon_slider_grabber.png b/editor/icons/icon_slider_grabber.png
new file mode 100644
index 0000000000..6b6982e26c
--- /dev/null
+++ b/editor/icons/icon_slider_grabber.png
Binary files differ
diff --git a/editor/icons/icon_slider_grabber_hl.png b/editor/icons/icon_slider_grabber_hl.png
new file mode 100644
index 0000000000..03d4b2bb99
--- /dev/null
+++ b/editor/icons/icon_slider_grabber_hl.png
Binary files differ
diff --git a/editor/icons/icon_slider_joint.png b/editor/icons/icon_slider_joint.png
index d65fb3650d..5b8c2df6ff 100644
--- a/editor/icons/icon_slider_joint.png
+++ b/editor/icons/icon_slider_joint.png
Binary files differ
diff --git a/editor/icons/icon_spatial_material.png b/editor/icons/icon_spatial_material.png
new file mode 100644
index 0000000000..7608fc9036
--- /dev/null
+++ b/editor/icons/icon_spatial_material.png
Binary files differ
diff --git a/editor/icons/icon_sphere_mesh.png b/editor/icons/icon_sphere_mesh.png
new file mode 100644
index 0000000000..19ed49c3cd
--- /dev/null
+++ b/editor/icons/icon_sphere_mesh.png
Binary files differ
diff --git a/editor/icons/icon_spinbox_updown.png b/editor/icons/icon_spinbox_updown.png
new file mode 100644
index 0000000000..ff65df801b
--- /dev/null
+++ b/editor/icons/icon_spinbox_updown.png
Binary files differ
diff --git a/editor/icons/icon_stream_texture.png b/editor/icons/icon_stream_texture.png
new file mode 100644
index 0000000000..1858a299d7
--- /dev/null
+++ b/editor/icons/icon_stream_texture.png
Binary files differ
diff --git a/editor/icons/icon_tab_menu.png b/editor/icons/icon_tab_menu.png
index 29edd02f01..ffc63f2d41 100644
--- a/editor/icons/icon_tab_menu.png
+++ b/editor/icons/icon_tab_menu.png
Binary files differ
diff --git a/editor/icons/icon_tabs.png b/editor/icons/icon_tabs.png
index bef0f60660..c17ab6fa1b 100644
--- a/editor/icons/icon_tabs.png
+++ b/editor/icons/icon_tabs.png
Binary files differ
diff --git a/editor/icons/icon_texture_rect.png b/editor/icons/icon_texture_rect.png
index 84e4a90bfb..20adc22715 100644
--- a/editor/icons/icon_texture_rect.png
+++ b/editor/icons/icon_texture_rect.png
Binary files differ
diff --git a/editor/icons/icon_timer.png b/editor/icons/icon_timer.png
index d3eb6a4b49..81e619cdaa 100644
--- a/editor/icons/icon_timer.png
+++ b/editor/icons/icon_timer.png
Binary files differ
diff --git a/editor/icons/icon_tool_button.png b/editor/icons/icon_tool_button.png
index b2f3f6103f..43c08592c6 100644
--- a/editor/icons/icon_tool_button.png
+++ b/editor/icons/icon_tool_button.png
Binary files differ
diff --git a/editor/icons/icon_tools.png b/editor/icons/icon_tools.png
index 4db4c53796..d81c93f212 100644
--- a/editor/icons/icon_tools.png
+++ b/editor/icons/icon_tools.png
Binary files differ
diff --git a/editor/icons/icon_tree.png b/editor/icons/icon_tree.png
index 50ec1df98b..de856a79fb 100644
--- a/editor/icons/icon_tree.png
+++ b/editor/icons/icon_tree.png
Binary files differ
diff --git a/editor/icons/icon_tree_arrow_down.png b/editor/icons/icon_tree_arrow_down.png
new file mode 100644
index 0000000000..4ef7b41de6
--- /dev/null
+++ b/editor/icons/icon_tree_arrow_down.png
Binary files differ
diff --git a/editor/icons/icon_tree_arrow_right.png b/editor/icons/icon_tree_arrow_right.png
new file mode 100644
index 0000000000..13a42f730d
--- /dev/null
+++ b/editor/icons/icon_tree_arrow_right.png
Binary files differ
diff --git a/editor/icons/icon_tween.png b/editor/icons/icon_tween.png
index 36717c0922..3181e2cf63 100644
--- a/editor/icons/icon_tween.png
+++ b/editor/icons/icon_tween.png
Binary files differ
diff --git a/editor/icons/icon_unchecked.png b/editor/icons/icon_unchecked.png
new file mode 100644
index 0000000000..9d7d55aa46
--- /dev/null
+++ b/editor/icons/icon_unchecked.png
Binary files differ
diff --git a/editor/icons/icon_v_button_array.png b/editor/icons/icon_v_button_array.png
index d7ea9cc375..996475ffa4 100644
--- a/editor/icons/icon_v_button_array.png
+++ b/editor/icons/icon_v_button_array.png
Binary files differ
diff --git a/editor/icons/icon_v_scroll_bar.png b/editor/icons/icon_v_scroll_bar.png
index 91e00f4619..edd6d4cd67 100644
--- a/editor/icons/icon_v_scroll_bar.png
+++ b/editor/icons/icon_v_scroll_bar.png
Binary files differ
diff --git a/editor/icons/icon_v_slider.png b/editor/icons/icon_v_slider.png
index 545c126d23..d9c0bb00d9 100644
--- a/editor/icons/icon_v_slider.png
+++ b/editor/icons/icon_v_slider.png
Binary files differ
diff --git a/editor/icons/icon_variant.png b/editor/icons/icon_variant.png
index 1ae2812ff7..af7590345e 100644
--- a/editor/icons/icon_variant.png
+++ b/editor/icons/icon_variant.png
Binary files differ
diff --git a/editor/icons/icon_video_player.png b/editor/icons/icon_video_player.png
index 5fd3723b22..0d5dc0ed73 100644
--- a/editor/icons/icon_video_player.png
+++ b/editor/icons/icon_video_player.png
Binary files differ
diff --git a/editor/icons/icon_visual_script.png b/editor/icons/icon_visual_script.png
index 1678998d17..355d3c03c3 100644
--- a/editor/icons/icon_visual_script.png
+++ b/editor/icons/icon_visual_script.png
Binary files differ
diff --git a/editor/icons/icon_vslider_bg.png b/editor/icons/icon_vslider_bg.png
new file mode 100644
index 0000000000..a7e0e78564
--- /dev/null
+++ b/editor/icons/icon_vslider_bg.png
Binary files differ
diff --git a/editor/icons/icon_vsplit_bg.png b/editor/icons/icon_vsplit_bg.png
new file mode 100644
index 0000000000..0c29b1e35c
--- /dev/null
+++ b/editor/icons/icon_vsplit_bg.png
Binary files differ
diff --git a/editor/icons/icon_vsplitter.png b/editor/icons/icon_vsplitter.png
new file mode 100644
index 0000000000..56fb20bc3f
--- /dev/null
+++ b/editor/icons/icon_vsplitter.png
Binary files differ
diff --git a/editor/icons/icon_warning.png b/editor/icons/icon_warning.png
index 451beba820..45b52542da 100644
--- a/editor/icons/icon_warning.png
+++ b/editor/icons/icon_warning.png
Binary files differ
diff --git a/editor/icons/icon_world_environment.png b/editor/icons/icon_world_environment.png
index d9f1323386..230d660107 100644
--- a/editor/icons/icon_world_environment.png
+++ b/editor/icons/icon_world_environment.png
Binary files differ
diff --git a/editor/icons/icon_zoom.png b/editor/icons/icon_zoom.png
index f3748803cf..e95cf2bd78 100644
--- a/editor/icons/icon_zoom.png
+++ b/editor/icons/icon_zoom.png
Binary files differ
diff --git a/editor/icons/source/icon_2_d.svg b/editor/icons/source/icon_2_d.svg
new file mode 100644
index 0000000000..54c93a45aa
--- /dev/null
+++ b/editor/icons/source/icon_2_d.svg
@@ -0,0 +1,93 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_2_d.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627418"
+ inkscape:cx="1.7654173"
+ inkscape:cy="7.2653991"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 2,1040.3622 2,-2 2,2"
+ id="path4485"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccc" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 4,1039.3622 v 9 h 9"
+ id="path4487"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccc" />
+ <path
+ sodipodi:nodetypes="ccc"
+ inkscape:connector-curvature="0"
+ id="path4489"
+ d="m 12,1046.3622 2,2 -2,2"
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_3_d.svg b/editor/icons/source/icon_3_d.svg
new file mode 100644
index 0000000000..3147d14dc1
--- /dev/null
+++ b/editor/icons/source/icon_3_d.svg
@@ -0,0 +1,105 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_3_d.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32.000001"
+ inkscape:cx="7.1007207"
+ inkscape:cy="6.155123"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 2.0050708,1040.3622 2,-2 2,2"
+ id="path4485"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccc" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 4.0050708,1039.3622 v 9 h 9.0000002"
+ id="path4487"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccc" />
+ <path
+ sodipodi:nodetypes="ccc"
+ inkscape:connector-curvature="0"
+ id="path4489"
+ d="m 12.005071,1046.3622 2,2 -2,2"
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 4.0050708,1048.3622 8.0000002,-8"
+ id="path4496"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ sodipodi:nodetypes="ccc"
+ inkscape:connector-curvature="0"
+ id="path4498"
+ d="m 10.176644,1039.3622 h 2.828427 v 2.8284"
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_checked.svg b/editor/icons/source/icon_GUI_checked.svg
new file mode 100644
index 0000000000..6d2c03f4c5
--- /dev/null
+++ b/editor/icons/source/icon_GUI_checked.svg
@@ -0,0 +1,79 @@
+<?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 15.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ sodipodi:docname="checked.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/checked.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="8.555527"
+ inkscape:cy="7.1886752"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3623)">
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:0.78431374;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 4 2 C 2.8954305 2 2 2.8954305 2 4 L 2 12 C 2 13.104569 2.8954305 14 4 14 L 12 14 C 13.104569 14 14 13.104569 14 12 L 14 4 C 14 2.8954305 13.104569 2 12 2 L 4 2 z M 11.292969 4.2929688 L 12.707031 5.7070312 L 6 12.414062 L 3.2929688 9.7070312 L 4.7070312 8.2929688 L 6 9.5859375 L 11.292969 4.2929688 z "
+ transform="translate(0,1036.3623)"
+ id="circle4178" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_dropdown.svg b/editor/icons/source/icon_GUI_dropdown.svg
new file mode 100644
index 0000000000..897f63c268
--- /dev/null
+++ b/editor/icons/source/icon_GUI_dropdown.svg
@@ -0,0 +1,93 @@
+<?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="14"
+ height="14"
+ viewBox="0 0 14 14"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_GUI_dropdown.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="6.5843041"
+ inkscape:cy="6.8000184"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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,-1038.3622)">
+ <circle
+ style="fill:#ffffff;fill-opacity:0.58823529;stroke-width:2;stroke-linejoin:round;stroke-opacity:0.39215686"
+ id="path4268"
+ cx="7.5"
+ cy="1040.8622"
+ r="1.5" />
+ <circle
+ r="1.5"
+ cy="1045.8622"
+ cx="7.5"
+ id="circle4271"
+ style="fill:#ffffff;fill-opacity:0.58823529;stroke-width:2;stroke-linejoin:round;stroke-opacity:0.39215686" />
+ <circle
+ style="fill:#ffffff;fill-opacity:0.58823529;stroke-width:2;stroke-linejoin:round;stroke-opacity:0.39215686"
+ id="circle4273"
+ cx="7.5"
+ cy="1050.8622"
+ r="1.5" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_hslider_bg.svg b/editor/icons/source/icon_GUI_hslider_bg.svg
new file mode 100644
index 0000000000..a920bf34ab
--- /dev/null
+++ b/editor/icons/source/icon_GUI_hslider_bg.svg
@@ -0,0 +1,83 @@
+<?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 15.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ sodipodi:docname="icon_GUI_hslider_bg.svg"
+ inkscape:export-filename="/mnt/2TB/Development/godot_dev/editor/icons/2x/icon_hslider_bg.png"
+ inkscape:export-xdpi="96"
+ inkscape:export-ydpi="96">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="5.4823689"
+ inkscape:cy="7.6591052"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3623)">
+ <rect
+ style="fill:#000000;fill-opacity:0.39215687;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.3254902"
+ id="rect4266"
+ width="14"
+ height="6"
+ x="1"
+ y="1041.3623"
+ ry="0" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_hsplitter.svg b/editor/icons/source/icon_GUI_hsplitter.svg
new file mode 100644
index 0000000000..01c893fc56
--- /dev/null
+++ b/editor/icons/source/icon_GUI_hsplitter.svg
@@ -0,0 +1,79 @@
+<?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="8"
+ height="64"
+ viewBox="0 0 8 64"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="hsplitter.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="11.313709"
+ inkscape:cx="-2.0338296"
+ inkscape:cy="39.22669"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-988.3622)">
+ <path
+ style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:0.39215687;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 4,990.3622 v 60"
+ id="path814"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_mini_tab_menu.svg b/editor/icons/source/icon_GUI_mini_tab_menu.svg
new file mode 100644
index 0000000000..65d71e86a0
--- /dev/null
+++ b/editor/icons/source/icon_GUI_mini_tab_menu.svg
@@ -0,0 +1,93 @@
+<?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="6"
+ height="16"
+ viewBox="0 0 6 16"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_GUI_mini_tab_menu.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32.000001"
+ inkscape:cx="5.71687"
+ inkscape:cy="8.5207578"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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)">
+ <circle
+ style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118"
+ id="path819"
+ cx="3"
+ cy="1038.3622"
+ r="2" />
+ <circle
+ r="2"
+ cy="1044.3622"
+ cx="3"
+ id="circle821"
+ style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118" />
+ <circle
+ style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118"
+ id="circle823"
+ cx="3"
+ cy="1050.3622"
+ r="2" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_option_arrow.svg b/editor/icons/source/icon_GUI_option_arrow.svg
new file mode 100644
index 0000000000..5cd943e9e3
--- /dev/null
+++ b/editor/icons/source/icon_GUI_option_arrow.svg
@@ -0,0 +1,80 @@
+<?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="12"
+ height="12"
+ viewBox="0 0 12 12"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="option_arrow.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254834"
+ inkscape:cx="3.1667338"
+ inkscape:cy="5.9875884"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1040.3622)">
+ <path
+ inkscape:connector-curvature="0"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.78431374;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 9.9999996,1043.3583 c -0.2637796,0.01 -0.5144012,0.1165 -0.697265,0.3067 l -3.292969,3.2929 -3.2929688,-3.2929 C 2.5285367,1043.4714 2.2700113,1043.3622 2,1043.3622 c -0.8974208,2e-4 -1.34038281,1.0909 -0.6972656,1.7168 l 4,4 c 0.3905299,0.3904 1.0235325,0.3904 1.4140624,0 l 4.0000002,-4 c 0.657344,-0.6321 0.194906,-1.7422 -0.7167974,-1.7207 z"
+ id="path4484"
+ sodipodi:nodetypes="cccccccccc" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_play_button_group.svg b/editor/icons/source/icon_GUI_play_button_group.svg
new file mode 100644
index 0000000000..84bdb00505
--- /dev/null
+++ b/editor/icons/source/icon_GUI_play_button_group.svg
@@ -0,0 +1,78 @@
+<?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="32"
+ height="32"
+ viewBox="0 0 32 31.999998"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ sodipodi:docname="button_group.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/button_disabled.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16"
+ inkscape:cx="15.144473"
+ inkscape:cy="14.499068"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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,-1020.3623)">
+ <circle
+ style="fill:#000000;fill-opacity:0.19607843;stroke:none;stroke-width:2.54545379;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4503"
+ cx="16"
+ cy="1036.3623"
+ r="13.999995" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_progress_bar.svg b/editor/icons/source/icon_GUI_progress_bar.svg
new file mode 100644
index 0000000000..1edd33dd85
--- /dev/null
+++ b/editor/icons/source/icon_GUI_progress_bar.svg
@@ -0,0 +1,81 @@
+<?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 15.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ sodipodi:docname="icon_GUI_progress_bar.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/checked.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="11.875071"
+ inkscape:cy="9.2973804"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3623)">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:0.39215687;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 2,1036.3623 c -1.09070018,-2e-4 -2,0.9073 -2,1.998 v 12.002 c 0,1.0907 0.9092998,2 2,2 h 12 c 1.0907,0 2,-0.9093 2,-2 v -12 c 0,-1.0907 -0.9093,-1.9978 -2,-1.998 z m 0,2 12,0 v 11.998 H 2 Z"
+ id="path4310"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="sssssssssccccc" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_progress_fill.svg b/editor/icons/source/icon_GUI_progress_fill.svg
new file mode 100644
index 0000000000..cf55c55ab1
--- /dev/null
+++ b/editor/icons/source/icon_GUI_progress_fill.svg
@@ -0,0 +1,83 @@
+<?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 15.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ sodipodi:docname="icon_GUI_progress_fill.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/checked.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254834"
+ inkscape:cx="10.136535"
+ inkscape:cy="8.7983986"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3623)">
+ <rect
+ style="fill:#e0e0e0;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
+ id="rect4338"
+ width="8"
+ height="7.9999952"
+ x="4"
+ y="1040.3623"
+ ry="0.99999499" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_radio_checked.svg b/editor/icons/source/icon_GUI_radio_checked.svg
new file mode 100644
index 0000000000..c0dc46448b
--- /dev/null
+++ b/editor/icons/source/icon_GUI_radio_checked.svg
@@ -0,0 +1,87 @@
+<?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 15.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ sodipodi:docname="icon_GUI_radio_checked.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/checked.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627417"
+ inkscape:cx="10.337496"
+ inkscape:cy="8.5995258"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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.3623)">
+ <circle
+ style="opacity:1;fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.78431374"
+ id="path4285"
+ cx="8"
+ cy="1044.3623"
+ r="5" />
+ <circle
+ style="opacity:1;fill:#e0e0e0;fill-opacity:0.78431373;stroke:none;stroke-width:2.99999523;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.78431373"
+ id="path4287"
+ cx="8"
+ cy="1044.3623"
+ r="2.9999952" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_radio_unchecked.svg b/editor/icons/source/icon_GUI_radio_unchecked.svg
new file mode 100644
index 0000000000..d21ba299b6
--- /dev/null
+++ b/editor/icons/source/icon_GUI_radio_unchecked.svg
@@ -0,0 +1,81 @@
+<?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 15.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ sodipodi:docname="icon_GUI_radio_unchecked.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/checked.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627417"
+ inkscape:cx="10.337496"
+ inkscape:cy="8.5995258"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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.3623)">
+ <circle
+ style="opacity:1;fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.78431374"
+ id="path4285"
+ cx="8"
+ cy="1044.3623"
+ r="5" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_scroll_bg.svg b/editor/icons/source/icon_GUI_scroll_bg.svg
new file mode 100644
index 0000000000..29604b9e14
--- /dev/null
+++ b/editor/icons/source/icon_GUI_scroll_bg.svg
@@ -0,0 +1,71 @@
+<?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="12"
+ height="12"
+ viewBox="0 0 12 11.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ sodipodi:docname="scroll_bg.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/panel_bg.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254836"
+ inkscape:cx="4.4464273"
+ inkscape:cy="6.9717582"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1040.3623)" />
+</svg>
diff --git a/editor/icons/source/icon_GUI_scroll_grabber.svg b/editor/icons/source/icon_GUI_scroll_grabber.svg
new file mode 100644
index 0000000000..b9d2bbbec0
--- /dev/null
+++ b/editor/icons/source/icon_GUI_scroll_grabber.svg
@@ -0,0 +1,78 @@
+<?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="12"
+ height="12"
+ viewBox="0 0 12 11.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ sodipodi:docname="scroll_grabber.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/panel_bg.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254836"
+ inkscape:cx="1.3086411"
+ inkscape:cy="6.9275641"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1040.3623)">
+ <circle
+ style="opacity:1;fill:#ffffff;fill-opacity:0.27450982;stroke:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4239"
+ cx="6"
+ cy="1046.3623"
+ r="2" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_scroll_grabber_hl.svg b/editor/icons/source/icon_GUI_scroll_grabber_hl.svg
new file mode 100644
index 0000000000..ce9a66c5bc
--- /dev/null
+++ b/editor/icons/source/icon_GUI_scroll_grabber_hl.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="12"
+ height="12"
+ viewBox="0 0 12 11.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 unknown"
+ sodipodi:docname="icon_scroll_grabber_hl.svg"
+ inkscape:export-filename="/mnt/2TB/Development/godot_dev/editor/icons/icon_scroll_grabber_hl.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254836"
+ inkscape:cx="3.0874565"
+ inkscape:cy="5.7564185"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1097"
+ inkscape:window-height="1076"
+ inkscape:window-x="161"
+ inkscape:window-y="200"
+ inkscape:window-maximized="0"
+ inkscape:snap-nodes="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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,-1040.3623)">
+ <circle
+ style="opacity:1;fill:#f9f9f9;fill-opacity:0.73000002;stroke:none;stroke-width:2.24999642;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4239"
+ cx="6"
+ cy="1046.3623"
+ r="2.9999952"
+ inkscape:export-filename="/mnt/2TB/Development/godot_dev/editor/icons/icon_scroll_grabber_hl.png"
+ inkscape:export-xdpi="96"
+ inkscape:export-ydpi="96" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_scroll_grabber_pressed.svg b/editor/icons/source/icon_GUI_scroll_grabber_pressed.svg
new file mode 100644
index 0000000000..852e985c4c
--- /dev/null
+++ b/editor/icons/source/icon_GUI_scroll_grabber_pressed.svg
@@ -0,0 +1,83 @@
+<?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="12"
+ height="12"
+ viewBox="0 0 12 11.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="icon_GUI_scroll_grabber_pressed.svg"
+ inkscape:export-filename="D:\HDD Documents\Other Projects\godot\editor\icons\icon_GUI_scroll_grabber_pressed.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="69.166667"
+ inkscape:cx="3.7445783"
+ inkscape:cy="6"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1017"
+ inkscape:window-x="-8"
+ inkscape:window-y="-8"
+ inkscape:window-maximized="1"
+ inkscape:snap-nodes="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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,-1040.3623)">
+ <circle
+ style="opacity:1;fill:#afafaf;fill-opacity:0.72941178;stroke:none;stroke-width:2.24999642000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4239"
+ cx="6"
+ cy="1046.3623"
+ r="2.9999952"
+ inkscape:export-filename="/mnt/2TB/Development/godot_dev/editor/icons/icon_scroll_grabber_hl.png"
+ inkscape:export-xdpi="96"
+ inkscape:export-ydpi="96"
+ d="m 8.9999952,1046.3623 c 0,1.6569 -1.3431436,3 -2.9999952,3 -1.6568516,0 -2.9999952,-1.3431 -2.9999952,-3 0,-1.6568 1.3431436,-3 2.9999952,-3 1.6568516,0 2.9999952,1.3432 2.9999952,3 z" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_slider_grabber.svg b/editor/icons/source/icon_GUI_slider_grabber.svg
new file mode 100644
index 0000000000..fb6c9d1c5c
--- /dev/null
+++ b/editor/icons/source/icon_GUI_slider_grabber.svg
@@ -0,0 +1,81 @@
+<?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 15.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ sodipodi:docname="icon_GUI_slider_grabber.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/checked.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="4.462853"
+ inkscape:cy="8.2694974"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3623)">
+ <circle
+ style="fill:#ffffff;fill-opacity:0.78431374;stroke-width:2.99999523;stroke-linejoin:round;stroke-opacity:0.39215686"
+ id="path4266"
+ cx="8"
+ cy="1044.3623"
+ r="2.9999952" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_slider_grabber_hl.svg b/editor/icons/source/icon_GUI_slider_grabber_hl.svg
new file mode 100644
index 0000000000..c7e9018ac3
--- /dev/null
+++ b/editor/icons/source/icon_GUI_slider_grabber_hl.svg
@@ -0,0 +1,86 @@
+<?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 15.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ sodipodi:docname="icon_GUI_slider_grabber_hl.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/checked.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="9.784247"
+ inkscape:cy="7.9005685"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3623)">
+ <path
+ style="fill:#d3d3d3;fill-opacity:1;stroke:none;stroke-width:20;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 8 1 A 6.9999943 6.9999943 0 0 0 1 8 A 6.9999943 6.9999943 0 0 0 8 15 A 6.9999943 6.9999943 0 0 0 15 8 A 6.9999943 6.9999943 0 0 0 8 1 z M 8 3 A 4.9999943 4.9999943 0 0 1 8.5 3.0253906 A 4.9999943 4.9999943 0 0 1 8.9941406 3.0996094 A 4.9999943 4.9999943 0 0 1 9.4785156 3.2226562 A 4.9999943 4.9999943 0 0 1 9.9472656 3.3945312 A 4.9999943 4.9999943 0 0 1 10.396484 3.6113281 A 4.9999943 4.9999943 0 0 1 10.822266 3.8730469 A 4.9999943 4.9999943 0 0 1 11.220703 4.1757812 A 4.9999943 4.9999943 0 0 1 11.585938 4.515625 A 4.9999943 4.9999943 0 0 1 11.916016 4.8925781 A 4.9999943 4.9999943 0 0 1 12.207031 5.2988281 A 4.9999943 4.9999943 0 0 1 12.455078 5.7324219 A 4.9999943 4.9999943 0 0 1 12.660156 6.1875 A 4.9999943 4.9999943 0 0 1 12.818359 6.6621094 A 4.9999943 4.9999943 0 0 1 12.927734 7.1503906 A 4.9999943 4.9999943 0 0 1 12.988281 7.6464844 A 4.9999943 4.9999943 0 0 1 13 8 A 4.9999943 4.9999943 0 0 1 12.974609 8.5 A 4.9999943 4.9999943 0 0 1 12.900391 8.9941406 A 4.9999943 4.9999943 0 0 1 12.777344 9.4785156 A 4.9999943 4.9999943 0 0 1 12.605469 9.9472656 A 4.9999943 4.9999943 0 0 1 12.388672 10.396484 A 4.9999943 4.9999943 0 0 1 12.126953 10.822266 A 4.9999943 4.9999943 0 0 1 11.824219 11.220703 A 4.9999943 4.9999943 0 0 1 11.484375 11.585938 A 4.9999943 4.9999943 0 0 1 11.107422 11.916016 A 4.9999943 4.9999943 0 0 1 10.701172 12.207031 A 4.9999943 4.9999943 0 0 1 10.267578 12.455078 A 4.9999943 4.9999943 0 0 1 9.8125 12.660156 A 4.9999943 4.9999943 0 0 1 9.3378906 12.818359 A 4.9999943 4.9999943 0 0 1 8.8496094 12.927734 A 4.9999943 4.9999943 0 0 1 8.3535156 12.988281 A 4.9999943 4.9999943 0 0 1 8 13 A 4.9999943 4.9999943 0 0 1 7.5 12.974609 A 4.9999943 4.9999943 0 0 1 7.0058594 12.900391 A 4.9999943 4.9999943 0 0 1 6.5214844 12.777344 A 4.9999943 4.9999943 0 0 1 6.0527344 12.605469 A 4.9999943 4.9999943 0 0 1 5.6035156 12.388672 A 4.9999943 4.9999943 0 0 1 5.1777344 12.126953 A 4.9999943 4.9999943 0 0 1 4.7792969 11.824219 A 4.9999943 4.9999943 0 0 1 4.4140625 11.484375 A 4.9999943 4.9999943 0 0 1 4.0839844 11.107422 A 4.9999943 4.9999943 0 0 1 3.7929688 10.701172 A 4.9999943 4.9999943 0 0 1 3.5449219 10.267578 A 4.9999943 4.9999943 0 0 1 3.3398438 9.8125 A 4.9999943 4.9999943 0 0 1 3.1816406 9.3378906 A 4.9999943 4.9999943 0 0 1 3.0722656 8.8496094 A 4.9999943 4.9999943 0 0 1 3.0117188 8.3535156 A 4.9999943 4.9999943 0 0 1 3 8 A 4.9999943 4.9999943 0 0 1 3.0253906 7.5 A 4.9999943 4.9999943 0 0 1 3.0996094 7.0058594 A 4.9999943 4.9999943 0 0 1 3.2226562 6.5214844 A 4.9999943 4.9999943 0 0 1 3.3945312 6.0527344 A 4.9999943 4.9999943 0 0 1 3.6113281 5.6035156 A 4.9999943 4.9999943 0 0 1 3.8730469 5.1777344 A 4.9999943 4.9999943 0 0 1 4.1757812 4.7792969 A 4.9999943 4.9999943 0 0 1 4.515625 4.4140625 A 4.9999943 4.9999943 0 0 1 4.8925781 4.0839844 A 4.9999943 4.9999943 0 0 1 5.2988281 3.7929688 A 4.9999943 4.9999943 0 0 1 5.7324219 3.5449219 A 4.9999943 4.9999943 0 0 1 6.1875 3.3398438 A 4.9999943 4.9999943 0 0 1 6.6621094 3.1816406 A 4.9999943 4.9999943 0 0 1 7.1503906 3.0722656 A 4.9999943 4.9999943 0 0 1 7.6464844 3.0117188 A 4.9999943 4.9999943 0 0 1 8 3 z "
+ id="circle4262"
+ transform="translate(0,1036.3623)" />
+ <circle
+ style="fill:#ffffff;fill-opacity:0.58823529;stroke-width:2.99999523;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.3254902"
+ id="path4271"
+ cx="8"
+ cy="1044.3623"
+ r="2.9999952" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_spinbox_updown.svg b/editor/icons/source/icon_GUI_spinbox_updown.svg
new file mode 100644
index 0000000000..e29d7fe0d2
--- /dev/null
+++ b/editor/icons/source/icon_GUI_spinbox_updown.svg
@@ -0,0 +1,83 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="spinbox_updown.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16"
+ inkscape:cx="-1.901723"
+ inkscape:cy="9.1326297"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1-5"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:0.78431374;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 7.984375 1.0019531 A 1.0001 1.0001 0 0 0 7.2929688 1.2929688 L 3.2929688 5.2929688 A 1.0001 1.0001 0 1 0 4.7070312 6.7070312 L 8 3.4140625 L 11.292969 6.7070312 A 1.0001 1.0001 0 1 0 12.707031 5.2929688 L 8.7070312 1.2929688 A 1.0001 1.0001 0 0 0 7.984375 1.0019531 z M 11.990234 8.9863281 A 1.0001 1.0001 0 0 0 11.292969 9.2929688 L 8 12.585938 L 4.7070312 9.2929688 A 1.0001 1.0001 0 0 0 3.9902344 8.9902344 A 1.0001 1.0001 0 0 0 3.2929688 10.707031 L 7.2929688 14.707031 A 1.0001 1.0001 0 0 0 8.7070312 14.707031 L 12.707031 10.707031 A 1.0001 1.0001 0 0 0 11.990234 8.9863281 z "
+ transform="translate(0,1036.3622)"
+ id="path4484" />
+ <g
+ id="layer1-5"
+ inkscape:label="Layer 1"
+ transform="translate(14.210182,-5.3664)" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_tab_menu.svg b/editor/icons/source/icon_GUI_tab_menu.svg
new file mode 100644
index 0000000000..39e0d1f261
--- /dev/null
+++ b/editor/icons/source/icon_GUI_tab_menu.svg
@@ -0,0 +1,92 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="tab_menu.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32.000001"
+ inkscape:cx="4.0814179"
+ inkscape:cy="8.4695645"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <circle
+ style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118"
+ id="path819"
+ cx="8"
+ cy="1038.3622"
+ r="2" />
+ <circle
+ r="2"
+ cy="1044.3622"
+ cx="8"
+ id="circle821"
+ style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118" />
+ <circle
+ style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118"
+ id="circle823"
+ cx="8"
+ cy="1050.3622"
+ r="2" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_toggle_off.svg b/editor/icons/source/icon_GUI_toggle_off.svg
new file mode 100644
index 0000000000..f0cf10a653
--- /dev/null
+++ b/editor/icons/source/icon_GUI_toggle_off.svg
@@ -0,0 +1,80 @@
+<?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="64"
+ height="32"
+ viewBox="0 0 64 31.999998"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ sodipodi:docname="icon_GUI_toggle_off.svg"
+ inkscape:export-filename="/mnt/2TB/Development/godot_dev/editor/icons/2x/icon_hslider_bg.png"
+ inkscape:export-xdpi="96"
+ inkscape:export-ydpi="96">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16"
+ inkscape:cx="35.349571"
+ inkscape:cy="18.723365"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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,-1020.3623)">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:0.78431374;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter-blend-mode:normal;filter-gaussianBlur-deviation:0;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;opacity:1"
+ d="M 24 4.0019531 C 17.3693 4.0019531 12 9.3673469 12 15.998047 L 12 16.001953 C 12 22.632653 17.3693 28.001953 24 28.001953 L 40 28.001953 C 46.6307 28.001953 52 22.632653 52 16.001953 L 52 15.998047 C 52 9.3673469 46.6307 4.0019531 40 4.0019531 L 24 4.0019531 z M 24 6.0019531 L 40 6.0019531 C 45.557295 6.0019531 50 10.440747 50 15.998047 L 50 16.001953 C 50 21.559253 45.557295 26.001953 40 26.001953 L 24 26.001953 C 18.442705 26.001953 14 21.559253 14 16.001953 L 14 15.998047 C 14 10.440747 18.442705 6.0019531 24 6.0019531 z M 31 10.998047 A 1.0001 1.0001 0 0 0 30 11.998047 L 30 19.998047 A 1 1 0 0 0 31 20.998047 A 1 1 0 0 0 32 19.998047 L 32 16.998047 L 34 16.998047 A 1 1 0 0 0 35 15.998047 A 1 1 0 0 0 34 14.998047 L 32 14.998047 L 32 12.998047 L 36 12.998047 A 1 1 0 0 0 37 11.998047 A 1 1 0 0 0 36 10.998047 L 31 10.998047 z M 40 10.998047 A 1.0001 1.0001 0 0 0 39 11.998047 L 39 15.998047 L 39 19.998047 A 1 1 0 0 0 40 20.998047 A 1 1 0 0 0 41 19.998047 L 41 16.998047 L 43 16.998047 A 1 1 0 0 0 44 15.998047 A 1 1 0 0 0 43 14.998047 L 41 14.998047 L 41 12.998047 L 45 12.998047 A 1 1 0 0 0 46 11.998047 A 1 1 0 0 0 45 10.998047 L 40 10.998047 z M 23 11.001953 C 20.250421 11.001953 18 13.252353 18 16.001953 C 18 18.751553 20.250421 21.001953 23 21.001953 C 25.749579 21.001953 28 18.751553 28 16.001953 C 28 13.252353 25.749579 11.001953 23 11.001953 z M 23 13.001953 C 24.668699 13.001953 26 14.333253 26 16.001953 C 26 17.670653 24.668699 19.001953 23 19.001953 C 21.331301 19.001953 20 17.670653 20 16.001953 C 20 14.333253 21.331301 13.001953 23 13.001953 z "
+ transform="translate(0,1020.3623)"
+ id="path4442" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_toggle_on.svg b/editor/icons/source/icon_GUI_toggle_on.svg
new file mode 100644
index 0000000000..79715dd767
--- /dev/null
+++ b/editor/icons/source/icon_GUI_toggle_on.svg
@@ -0,0 +1,80 @@
+<?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="64"
+ height="32"
+ viewBox="0 0 64 31.999998"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ sodipodi:docname="icon_GUI_toggle_on.svg"
+ inkscape:export-filename="/mnt/2TB/Development/godot_dev/editor/icons/2x/icon_hslider_bg.png"
+ inkscape:export-xdpi="96"
+ inkscape:export-ydpi="96">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="8"
+ inkscape:cx="32.275235"
+ inkscape:cy="18.558884"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1020.3623)">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:0.78431374;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 24 4.0019531 C 17.3693 4.0019531 12 9.3673469 12 15.998047 C 12 22.628747 17.3693 27.998047 24 27.998047 L 40 27.998047 C 46.6307 27.998047 52 22.628747 52 15.998047 C 52 9.3673469 46.6307 4.0019531 40 4.0019531 L 24 4.0019531 z M 41 10.998047 A 1 1 0 0 1 42 11.998047 L 42 19.998047 A 1.0001 1.0001 0 0 1 40.248047 20.660156 L 35 14.660156 L 35 19.998047 A 1 1 0 0 1 34 20.998047 A 1 1 0 0 1 33 19.998047 L 33 11.998047 A 1.0001 1.0001 0 0 1 34.751953 11.339844 L 40 17.339844 L 40 11.998047 A 1 1 0 0 1 41 10.998047 z M 26 11.001953 C 28.749579 11.001953 31 13.252353 31 16.001953 C 31 18.751553 28.749579 21.001953 26 21.001953 C 23.250421 21.001953 21 18.751553 21 16.001953 C 21 13.252353 23.250421 11.001953 26 11.001953 z M 26 13.001953 C 24.331301 13.001953 23 14.333253 23 16.001953 C 23 17.670653 24.331301 19.001953 26 19.001953 C 27.668699 19.001953 29 17.670653 29 16.001953 C 29 14.333253 27.668699 13.001953 26 13.001953 z "
+ transform="translate(0,1020.3623)"
+ id="path4272" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_tree_arrow_down.svg b/editor/icons/source/icon_GUI_tree_arrow_down.svg
new file mode 100644
index 0000000000..1dd209720f
--- /dev/null
+++ b/editor/icons/source/icon_GUI_tree_arrow_down.svg
@@ -0,0 +1,80 @@
+<?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="12"
+ height="12"
+ viewBox="0 0 12 12"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="arrow_down.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627417"
+ inkscape:cx="1.7981958"
+ inkscape:cy="7.5815407"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1040.3622)">
+ <path
+ style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.39215687"
+ d="m 3,1045.3622 3,3 3,-3"
+ id="path814"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccc" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_tree_arrow_right.svg b/editor/icons/source/icon_GUI_tree_arrow_right.svg
new file mode 100644
index 0000000000..43134ba1b1
--- /dev/null
+++ b/editor/icons/source/icon_GUI_tree_arrow_right.svg
@@ -0,0 +1,80 @@
+<?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="12"
+ height="12"
+ viewBox="0 0 12 12"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="arrow_right.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254836"
+ inkscape:cx="4.0845752"
+ inkscape:cy="5.8802612"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1040.3622)">
+ <path
+ style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.39215687"
+ d="m 4,1049.3622 3.0000202,-3 -3.0000202,-3"
+ id="path814"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccc" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_unchecked.svg b/editor/icons/source/icon_GUI_unchecked.svg
new file mode 100644
index 0000000000..053cbe6de5
--- /dev/null
+++ b/editor/icons/source/icon_GUI_unchecked.svg
@@ -0,0 +1,77 @@
+<?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 15.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ sodipodi:docname="unchecked.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/unchecked.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="4.8224661"
+ inkscape:cy="8.2065809"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3623)">
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:0.78431374;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 4 2 A 2 2 0 0 0 2 4 L 2 12 A 2 2 0 0 0 4 14 L 12 14 A 2 2 0 0 0 14 12 L 14 4 A 2 2 0 0 0 12 2 L 4 2 z M 4.8007812 4 L 11.199219 4 A 0.8000012 0.8000012 0 0 1 12 4.8007812 L 12 11.199219 A 0.8000012 0.8000012 0 0 1 11.199219 12 L 4.8007812 12 A 0.8000012 0.8000012 0 0 1 4 11.199219 L 4 4.8007812 A 0.8000012 0.8000012 0 0 1 4.8007812 4 z "
+ transform="translate(0,1036.3623)"
+ id="circle4178" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_vslider_bg.svg b/editor/icons/source/icon_GUI_vslider_bg.svg
new file mode 100644
index 0000000000..cfa4feeca6
--- /dev/null
+++ b/editor/icons/source/icon_GUI_vslider_bg.svg
@@ -0,0 +1,83 @@
+<?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 15.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ sodipodi:docname="icon_GUI_vslider_bg.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/checked.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="8.3954629"
+ inkscape:cy="7.6047847"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3623)">
+ <rect
+ style="fill:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.3254902;fill-opacity:0.39215687"
+ id="rect4267"
+ width="4"
+ height="14"
+ x="6"
+ y="1037.3623"
+ ry="0" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_vsplit_bg.svg b/editor/icons/source/icon_GUI_vsplit_bg.svg
new file mode 100644
index 0000000000..e11940cf53
--- /dev/null
+++ b/editor/icons/source/icon_GUI_vsplit_bg.svg
@@ -0,0 +1,79 @@
+<?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="8"
+ height="8"
+ viewBox="0 0 8 7.9999995"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="vsplit_bg.svg"
+ inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/panel_bg.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="64.000003"
+ inkscape:cx="-1.1524794"
+ inkscape:cy="3.8847002"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1044.3623)">
+ <rect
+ style="opacity:1;fill:#000000;fill-opacity:0.09803922;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect4213"
+ width="8"
+ height="7.999999"
+ x="0"
+ y="1044.3623" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_GUI_vsplitter.svg b/editor/icons/source/icon_GUI_vsplitter.svg
new file mode 100644
index 0000000000..80f7c2ce12
--- /dev/null
+++ b/editor/icons/source/icon_GUI_vsplitter.svg
@@ -0,0 +1,79 @@
+<?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="64"
+ height="8"
+ viewBox="0 0 64 8"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="vsplitter.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32.000001"
+ inkscape:cx="59.744611"
+ inkscape:cy="0.46378871"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1044.3622)">
+ <path
+ style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:0.39215687;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 2,1048.3622 H 62"
+ id="path814"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_animation_player.svg b/editor/icons/source/icon_animation_player.svg
index add4d5ac42..e6500ea249 100644
--- a/editor/icons/source/icon_animation_player.svg
+++ b/editor/icons/source/icon_animation_player.svg
@@ -14,11 +14,11 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_animation_player.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_animation_player (copy).svg">
+ sodipodi:docname="icon_animation_player.svg">
<defs
id="defs4" />
<sodipodi:namedview
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="31.999998"
- inkscape:cx="8.7610995"
- inkscape:cy="9.3751685"
+ inkscape:cx="3.1985991"
+ inkscape:cy="7.9689184"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,7 +69,7 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#e1cb50;fill-opacity:0.98431373;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ style="opacity:1;fill:#fbe87a;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 1,1037.3622 0,14 1.1666666,0 0,-2 1.8333334,0 0,2 8,0 0,-2 2,0 0,2 1,0 0,-14 -1,0 0,2 -2,0 0,-2 -8,0 0,2 -1.8333334,0 0,-2 z m 1.1666666,4 1.8333334,0 0,2 -1.8333334,0 z m 9.8333334,0 2,0 0,2 -2,0 z m -9.8333334,4 1.8333334,0 0,2 -1.8333334,0 z m 9.8333334,0 2,0 0,2 -2,0 z"
id="rect4136"
inkscape:connector-curvature="0"
diff --git a/editor/icons/source/icon_animation_tree_player.svg b/editor/icons/source/icon_animation_tree_player.svg
index ab81cb226a..fa5803489e 100644
--- a/editor/icons/source/icon_animation_tree_player.svg
+++ b/editor/icons/source/icon_animation_tree_player.svg
@@ -14,11 +14,11 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_animation_tree_player.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_animation_tree_player (copy).svg">
+ sodipodi:docname="icon_animation_tree_player.svg">
<defs
id="defs4" />
<sodipodi:namedview
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="45.254831"
- inkscape:cx="9.7184474"
- inkscape:cy="8.2407739"
+ inkscape:zoom="31.999999"
+ inkscape:cx="5.6353556"
+ inkscape:cy="8.4280346"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,8 +69,8 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#e1cb50;fill-opacity:0.98431373;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 1 1 L 1 15 L 2.1660156 15 L 2.1660156 13 L 4 13 L 4 15 L 12 15 L 12 13 L 14 13 L 14 15 L 15 15 L 15 1 L 14 1 L 14 3 L 12 3 L 12 1 L 4 1 L 4 3 L 2.1660156 3 L 2.1660156 1 L 1 1 z M 2.1660156 5 L 4 5 L 4 7 L 2.1660156 7 L 2.1660156 5 z M 8 5 A 1 1 0 0 1 9 6 A 1 1 0 0 1 8.8339844 6.5507812 L 10.060547 9.0039062 A 1 1 0 0 1 11 10 A 1 1 0 0 1 10 11 A 1 1 0 0 1 9 10 A 1 1 0 0 1 9.1660156 9.4492188 L 8 7.1171875 L 6.8339844 9.4492188 A 1 1 0 0 1 7 10 A 1 1 0 0 1 6 11 A 1 1 0 0 1 5 10 A 1 1 0 0 1 5.9414062 9.0019531 L 7.1660156 6.5507812 A 1 1 0 0 1 7 6 A 1 1 0 0 1 8 5 z M 12 5 L 14 5 L 14 7 L 12 7 L 12 5 z M 2.1660156 9 L 4 9 L 4 11 L 2.1660156 11 L 2.1660156 9 z M 12 9 L 14 9 L 14 11 L 12 11 L 12 9 z "
+ style="opacity:1;fill:#fbe87a;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 1 1 L 1 15 L 2.1660156 15 L 2.1660156 13 L 4 13 L 4 15 L 12 15 L 12 13 L 14 13 L 14 15 L 15 15 L 15 1 L 14 1 L 14 3 L 12 3 L 12 1 L 4 1 L 4 3 L 2.1660156 3 L 2.1660156 1 L 1 1 z M 5 4 L 7 4 L 7 5 L 7 6 L 8 6 L 11 6 L 11 8 L 9 8 L 9 9 L 9 10 L 10 10 L 11 10 L 11 12 L 10 12 L 8 12 A 1.0001 1.0001 0 0 1 7 11 L 7 10 L 7 8 L 6 8 A 1.0001 1.0001 0 0 1 5 7 L 5 6 L 5 5 L 5 4 z M 2.1660156 5 L 4 5 L 4 7 L 2.1660156 7 L 2.1660156 5 z M 12 5 L 14 5 L 14 7 L 12 7 L 12 5 z M 2.1660156 9 L 4 9 L 4 11 L 2.1660156 11 L 2.1660156 9 z M 12 9 L 14 9 L 14 11 L 12 11 L 12 9 z "
transform="translate(0,1036.3622)"
id="rect4136" />
</g>
diff --git a/editor/icons/source/icon_arrow_left.svg b/editor/icons/source/icon_arrow_left.svg
index 75a9ef0d68..a9be19b6d4 100644
--- a/editor/icons/source/icon_arrow_left.svg
+++ b/editor/icons/source/icon_arrow_left.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_arrow_left.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="-0.2534386"
- inkscape:cy="9.1352698"
+ inkscape:cx="7.4636822"
+ inkscape:cy="9.1396144"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -69,9 +69,16 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 6 4 L 3.5 6 L 1 8 L 3.5 10 L 6 12 L 6 9 L 15 9 L 15 7 L 6 7 L 6 4 z "
- transform="translate(0,1036.3622)"
- id="rect4352" />
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="m 8,1048.3622 -4,-4 4,-4"
+ id="path814"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccc" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="m 4,1044.3622 h 7"
+ id="path816"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
</g>
</svg>
diff --git a/editor/icons/source/icon_arrow_right.svg b/editor/icons/source/icon_arrow_right.svg
index a7600699f7..f6cbe3bc19 100644
--- a/editor/icons/source/icon_arrow_right.svg
+++ b/editor/icons/source/icon_arrow_right.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_arrow_left.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="0.9028114"
- inkscape:cy="9.2602698"
+ inkscape:cx="7.0981428"
+ inkscape:cy="9.8315212"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
+ <dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,10 +69,16 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 10,1048.3622 5,-4 -5,-4 0,3 -9,0 0,2 9,0 z"
- id="rect4352"
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="m 8.0142425,1048.3622 3.9999995,-4 -3.9999995,-4"
+ id="path814"
inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccccccc" />
+ sodipodi:nodetypes="ccc" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="M 12.014242,1044.3622 H 5.0142425"
+ id="path816"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
</g>
</svg>
diff --git a/editor/icons/source/icon_arrow_up.svg b/editor/icons/source/icon_arrow_up.svg
index c1839cd69e..b24a167b8e 100644
--- a/editor/icons/source/icon_arrow_up.svg
+++ b/editor/icons/source/icon_arrow_up.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_arrow_left.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="6.7465614"
- inkscape:cy="9.3227698"
+ inkscape:cx="7.0981428"
+ inkscape:cy="9.8315212"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -69,9 +69,9 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 12,1042.3622 -2,-2.5 -2,-2.5 -2,2.5 -2,2.5 3,0 0,9 2,0 0,-9 3,0 z"
- id="rect4352"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:0.99607843;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 2.9875012,1044.3838 a 1.0001,1.0001 0 0 0 1.7167968,0.6972 l 2.2929688,-2.2929 v 4.5859 a 1.0001,1.0001 0 1 0 2,0 v -4.5859 l 2.2929692,2.2929 a 1.0001,1.0001 0 1 0 1.414062,-1.414 l -3.9140624,-3.9141 a 1.0001,1.0001 0 0 0 -1.5859376,0 1.0001,1.0001 0 0 0 -0.00391,0.01 l -3.9101562,3.9102 a 1.0001,1.0001 0 0 0 -0.3027344,0.7168 z"
+ id="path814"
inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_asset_lib.svg b/editor/icons/source/icon_asset_lib.svg
new file mode 100644
index 0000000000..db9fcda6d4
--- /dev/null
+++ b/editor/icons/source/icon_asset_lib.svg
@@ -0,0 +1,80 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_asset_lib.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254835"
+ inkscape:cx="8.3739682"
+ inkscape:cy="8.9121875"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:1.87082875;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 8 1 A 3 3 0 0 0 5 4 L 5 6 L 1 6 L 1 10 L 1 13 C 1 14.10801 1.8919904 15 3 15 L 13 15 C 14.10801 15 15 14.10801 15 13 L 15 10 L 15 6 L 11 6 L 11 4 A 3 3 0 0 0 8 1 z M 8 2 A 2 2 0 0 0 7.84375 2.0078125 A 2.0000174 2.0000174 0 0 1 8 2 z M 8.15625 2.0078125 A 2.0000174 2.0000174 0 0 1 8.296875 2.0234375 A 2 2 0 0 0 8.15625 2.0078125 z M 7.703125 2.0234375 A 2 2 0 0 0 7.640625 2.0332031 A 2.0000174 2.0000174 0 0 1 7.703125 2.0234375 z M 8.359375 2.0332031 A 2.0000174 2.0000174 0 0 1 8.4648438 2.0566406 A 2 2 0 0 0 8.359375 2.0332031 z M 7.5351562 2.0566406 A 2 2 0 0 0 7.4296875 2.0839844 A 2.0000174 2.0000174 0 0 1 7.5351562 2.0566406 z M 8.5703125 2.0839844 A 2.0000174 2.0000174 0 0 1 8.6621094 2.1152344 A 2 2 0 0 0 8.5703125 2.0839844 z M 7.3378906 2.1152344 A 2 2 0 0 0 7.2558594 2.1464844 A 2.0000174 2.0000174 0 0 1 7.3378906 2.1152344 z M 8.7441406 2.1464844 A 2.0000174 2.0000174 0 0 1 8.8496094 2.1914062 A 2 2 0 0 0 8.7441406 2.1464844 z M 7.1503906 2.1914062 A 2 2 0 0 0 7.0722656 2.2304688 A 2.0000174 2.0000174 0 0 1 7.1503906 2.1914062 z M 8.9277344 2.2304688 A 2.0000174 2.0000174 0 0 1 9.0195312 2.28125 A 2 2 0 0 0 8.9277344 2.2304688 z M 6.9804688 2.28125 A 2 2 0 0 0 6.8886719 2.3378906 A 2.0000174 2.0000174 0 0 1 6.9804688 2.28125 z M 6.8320312 2.3789062 A 2 2 0 0 0 6.7304688 2.4550781 A 2.0000174 2.0000174 0 0 1 6.8320312 2.3789062 z M 9.2695312 2.4550781 A 2.0000174 2.0000174 0 0 1 9.3378906 2.515625 A 2 2 0 0 0 9.2695312 2.4550781 z M 6.6621094 2.515625 A 2 2 0 0 0 6.5859375 2.5859375 A 2.0000174 2.0000174 0 0 1 6.6621094 2.515625 z M 9.4140625 2.5859375 A 2.0000174 2.0000174 0 0 1 9.484375 2.6621094 A 2 2 0 0 0 9.4140625 2.5859375 z M 6.515625 2.6621094 A 2 2 0 0 0 6.4550781 2.7304688 A 2.0000174 2.0000174 0 0 1 6.515625 2.6621094 z M 9.5449219 2.7304688 A 2.0000174 2.0000174 0 0 1 9.6210938 2.8320312 A 2 2 0 0 0 9.5449219 2.7304688 z M 9.6621094 2.8886719 A 2.0000174 2.0000174 0 0 1 9.71875 2.9804688 A 2 2 0 0 0 9.6621094 2.8886719 z M 6.28125 2.9804688 A 2 2 0 0 0 6.2304688 3.0722656 A 2.0000174 2.0000174 0 0 1 6.28125 2.9804688 z M 8 3 A 1 1 0 0 1 9 4 L 9 6 L 7 6 L 7 4 A 1 1 0 0 1 8 3 z M 9.7695312 3.0722656 A 2.0000174 2.0000174 0 0 1 9.8085938 3.1503906 A 2 2 0 0 0 9.7695312 3.0722656 z M 6.1914062 3.1503906 A 2 2 0 0 0 6.1464844 3.2558594 A 2.0000174 2.0000174 0 0 1 6.1914062 3.1503906 z M 9.8535156 3.2558594 A 2.0000174 2.0000174 0 0 1 9.8847656 3.3378906 A 2 2 0 0 0 9.8535156 3.2558594 z M 6.1152344 3.3378906 A 2 2 0 0 0 6.0839844 3.4296875 A 2.0000174 2.0000174 0 0 1 6.1152344 3.3378906 z M 9.9160156 3.4296875 A 2.0000174 2.0000174 0 0 1 9.9433594 3.5351562 A 2 2 0 0 0 9.9160156 3.4296875 z M 6.0566406 3.5351562 A 2 2 0 0 0 6.0332031 3.640625 A 2.0000174 2.0000174 0 0 1 6.0566406 3.5351562 z M 9.9667969 3.640625 A 2.0000174 2.0000174 0 0 1 9.9765625 3.703125 A 2 2 0 0 0 9.9667969 3.640625 z M 6.0234375 3.703125 A 2 2 0 0 0 6.0078125 3.84375 A 2.0000174 2.0000174 0 0 1 6.0234375 3.703125 z M 9.9921875 3.84375 A 2.0000174 2.0000174 0 0 1 10 4 A 2 2 0 0 0 9.9921875 3.84375 z "
+ transform="translate(0,1036.3622)"
+ id="rect4503" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_audio_bus_bypass.svg b/editor/icons/source/icon_audio_bus_bypass.svg
new file mode 100644
index 0000000000..fe517d9ff7
--- /dev/null
+++ b/editor/icons/source/icon_audio_bus_bypass.svg
@@ -0,0 +1,295 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_audio_bus_bypass.svg">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-75">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-3"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-5">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-6"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-2"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-9"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-1">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-2"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-7">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-5"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-3">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-5"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-6"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-2"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-9">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-1"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-3">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-6"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-0">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-62"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-61"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-8"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-7">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-9"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-75-2">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-3-0"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-5-2">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-6-3"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-2-7"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-9-5"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-1-9">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-2-2"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-7-2">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-5-8"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-3-9">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-5-7"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-6-3"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-2-6"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-9-1">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-1-2"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="31.999999"
+ inkscape:cx="13.750219"
+ inkscape:cy="8.7492163"
+ 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="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <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="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 6.9707031 2 C 6.7159676 2.01 6.4735547 2.1112156 6.2929688 2.2910156 L 3.5859375 4.9980469 L 2 4.9980469 C 1.4477381 4.9981469 1.0000552 5.4457469 1 5.9980469 L 1 9.9980469 C 1.0000552 10.550347 1.4477381 10.997947 2 10.998047 L 3.5859375 10.998047 L 6.2929688 13.705078 C 6.9229867 14.334678 7.9997118 13.888747 8 12.998047 L 8 2.9980469 C 7.9990576 2.4349469 7.5335846 1.9836 6.9707031 2 z M 10.984375 4.9863281 A 1.0001 1.0001 0 0 0 10 6 L 10 10 A 1.0001 1.0001 0 1 0 12 10 L 12 6 A 1.0001 1.0001 0 0 0 10.984375 4.9863281 z M 13.984375 4.9863281 A 1.0001 1.0001 0 0 0 13 6 L 13 10 A 1.0001 1.0001 0 1 0 15 10 L 15 6 A 1.0001 1.0001 0 0 0 13.984375 4.9863281 z "
+ transform="translate(0,1036.3622)"
+ id="path4158" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_audio_bus_layout.svg b/editor/icons/source/icon_audio_bus_layout.svg
new file mode 100644
index 0000000000..66dc37ecfc
--- /dev/null
+++ b/editor/icons/source/icon_audio_bus_layout.svg
@@ -0,0 +1,107 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ 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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_audio_bus_layout.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient959-5">
+ <stop
+ id="stop957-3"
+ offset="0"
+ style="stop-color:#ff8484;stop-opacity:1" />
+ <stop
+ style="stop-color:#e1dc7a;stop-opacity:1"
+ offset="0.5"
+ id="stop955-5" />
+ <stop
+ id="stop953-6"
+ offset="1"
+ style="stop-color:#84ffb1;stop-opacity:1" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient959-5"
+ id="linearGradient4542"
+ gradientUnits="userSpaceOnUse"
+ x1="8"
+ y1="1"
+ x2="8"
+ y2="15" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32.000001"
+ inkscape:cx="4.4869184"
+ inkscape:cy="8.3575292"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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:url(#linearGradient4542);fill-opacity:1.0;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="M 3 1 C 1.8919904 1 1 1.8919904 1 3 L 1 13 C 1 14.10801 1.8919904 15 3 15 L 5 15 C 6.1080096 15 7 14.10801 7 13 L 7 3 C 7 1.8919904 6.1080096 1 5 1 L 3 1 z M 11 1 C 9.8919889 1 9 1.8919889 9 3 L 9 13 C 9 14.108011 9.8919889 15 11 15 L 13 15 C 14.108011 15 15 14.108011 15 13 L 15 3 C 15 1.8919889 14.108011 1 13 1 L 11 1 z M 3 2 L 5 2 C 5.5540096 2 6 2.4459904 6 3 L 6 13 C 6 13.55401 5.5540096 14 5 14 L 3 14 C 2.4459904 14 2 13.55401 2 13 L 2 3 C 2 2.4459904 2.4459904 2 3 2 z "
+ transform="translate(0,1036.3622)"
+ id="rect4505" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_audio_bus_mute.svg b/editor/icons/source/icon_audio_bus_mute.svg
new file mode 100644
index 0000000000..55a776dd97
--- /dev/null
+++ b/editor/icons/source/icon_audio_bus_mute.svg
@@ -0,0 +1,301 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_audio_bus_mute.svg">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-75">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-3"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-5">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-6"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-2"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-9"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-1">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-2"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-7">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-5"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-3">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-5"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-6"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-2"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-9">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-1"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-3">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-6"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-0">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-62"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-61"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-8"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-7">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-9"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-75-2">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-3-0"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-5-2">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-6-3"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-2-7"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-9-5"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-1-9">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-2-2"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-7-2">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-5-8"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-3-9">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-5-7"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-6-3"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-2-6"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-9-1">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-1-2"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="31.999999"
+ inkscape:cx="11.636432"
+ inkscape:cy="7.916113"
+ 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="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <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="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 6.9707031,1038.3625 c -0.2547355,0.01 -0.4971483,0.1112 -0.6777343,0.291 l -2.7070313,2.707 H 2 c -0.5522619,10e-5 -0.9999448,0.4477 -1,1 v 4 c 5.52e-5,0.5523 0.4477381,0.9999 1,1 h 1.5859375 l 2.7070313,2.7071 c 0.630018,0.6296 1.706743,0.1836 1.7070312,-0.7071 v -10 c -9.424e-4,-0.5631 -0.4664154,-1.0144 -1.0292969,-0.998 z"
+ id="path4158"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccccccccc" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 10.990234 4.9902344 A 1.0001 1.0001 0 0 0 10.292969 6.7070312 L 11.585938 8 L 10.292969 9.2929688 A 1.0001 1.0001 0 1 0 11.707031 10.707031 L 13 9.4140625 L 14.292969 10.707031 A 1.0001 1.0001 0 1 0 15.707031 9.2929688 L 14.414062 8 L 15.707031 6.7070312 A 1.0001 1.0001 0 0 0 14.980469 4.9921875 A 1.0001 1.0001 0 0 0 14.292969 5.2929688 L 13 6.5859375 L 11.707031 5.2929688 A 1.0001 1.0001 0 0 0 10.990234 4.9902344 z "
+ transform="translate(0,1036.3622)"
+ id="path1075" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_audio_bus_solo.svg b/editor/icons/source/icon_audio_bus_solo.svg
new file mode 100644
index 0000000000..fd06442da1
--- /dev/null
+++ b/editor/icons/source/icon_audio_bus_solo.svg
@@ -0,0 +1,315 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_audio_bus_solo.svg">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-75">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-3"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-5">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-6"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-2"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-9"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-1">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-2"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-7">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-5"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-3">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-5"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-6"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-2"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-9">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-1"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-3">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-6"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-0">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-62"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-61"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-8"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-7">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-9"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-75-2">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-3-0"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-5-2">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-6-3"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-2-7"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-9-5"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-1-9">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-2-2"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253-7-2">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255-5-8"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199-3-9">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201-5-7"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4392-6-3"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4394-2-6"
+ d="m 8.072266,1041.3622 a 5,5 0 0 0 -3.607422,1.4648 5,5 0 0 0 0,7.0704 5,5 0 0 0 7.070312,0 l -1.416015,-1.4161 A 3,3 0 0 1 8,1049.3622 a 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 2.119141,0.8809 l 1.416015,-1.4161 a 5,5 0 0 0 -3.46289,-1.4648 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4196-9-1">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8.0624999,1025.8622 a 3.375,2.9999997 0 0 0 -3.375,3 3.375,2.9999997 0 0 0 1.6875,2.5957 l 0,9.8115 a 3.375,2.9999997 0 0 0 -1.6875,2.5928 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.3750001,-3 3.375,2.9999997 0 0 0 -1.6875001,-2.5957 l 0,-8.7832 11.9311511,10.6054 a 3.375,2.9999997 0 0 0 -0.118651,0.7735 3.375,2.9999997 0 0 0 3.375,3 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -0.873413,0.1025 l -11.927857,-10.6025 9.884399,0 a 3.375,2.9999997 0 0 0 2.916871,1.5 3.375,2.9999997 0 0 0 3.375,-3 3.375,2.9999997 0 0 0 -3.375,-3 3.375,2.9999997 0 0 0 -2.920166,1.5 l -11.037964,0 a 3.375,2.9999997 0 0 0 -2.9168701,-1.5 z"
+ id="path4198-1-2"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627416"
+ inkscape:cx="9.3895072"
+ inkscape:cy="10.039347"
+ 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="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <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="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 6.9707031,1038.3625 c -0.2547355,0.01 -0.4971483,0.1112 -0.6777343,0.291 l -2.7070313,2.707 H 2 c -0.5522619,10e-5 -0.9999448,0.4477 -1,1 v 4 c 5.52e-5,0.5523 0.4477381,0.9999 1,1 h 1.5859375 l 2.7070313,2.7071 c 0.630018,0.6296 1.706743,0.1836 1.7070312,-0.7071 v -10 c -9.424e-4,-0.5631 -0.4664154,-1.0144 -1.0292969,-0.998 z"
+ id="path4158"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccccccccc" />
+ <path
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 15,1040.3622 a 3,3 0 0 0 -3,3 v 2 a 1.0000174,1.0000174 0 0 1 -1,1 v 2 a 3,3 0 0 0 3,-3 v -2 a 1.0000174,1.0000174 0 0 1 1,-1 z"
+ id="path4534"
+ inkscape:connector-curvature="0" />
+ <rect
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4208"
+ width="1"
+ height="2"
+ x="10"
+ y="1046.3622" />
+ <rect
+ y="1040.3622"
+ x="15"
+ height="2"
+ width="1"
+ id="rect4210"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_audio_effect_amplify.svg b/editor/icons/source/icon_audio_effect_amplify.svg
new file mode 100644
index 0000000000..3c75d71791
--- /dev/null
+++ b/editor/icons/source/icon_audio_effect_amplify.svg
@@ -0,0 +1,110 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ 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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_audio_effect_amplify.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient959-5"
+ inkscape:collect="always">
+ <stop
+ style="stop-color:#ff8484;stop-opacity:1"
+ offset="0"
+ id="stop957-3" />
+ <stop
+ id="stop955-5"
+ offset="0.5"
+ style="stop-color:#e1dc7a;stop-opacity:1" />
+ <stop
+ style="stop-color:#84ffb1;stop-opacity:1"
+ offset="1"
+ id="stop953-6" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient959-5"
+ id="linearGradient4521"
+ x1="9"
+ y1="1037.3622"
+ x2="9"
+ y2="1051.3622"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(0,-1036.3622)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627418"
+ inkscape:cx="11.634663"
+ inkscape:cy="5.7749201"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="fill:url(#linearGradient4521);fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 15,1 1,8 H 15 Z M 2,10 v 1 h 2 v -1 z m 2,1 v 1 H 2 V 11 H 1 v 4 h 1 v -2 h 2 v 2 h 1 v -4 z m 2,-1 v 1 4 h 1 v -4 h 1 v 4 h 1 v -4 h 1 v -1 z m 4,1 v 4 h 1 v -4 z m 2,-1 v 5 h 1 v -2 h 2 v -3 z m 1,1 h 1 v 1 h -1 z"
+ transform="translate(0,1036.3622)"
+ id="path4513"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccc" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_audio_stream_player.svg b/editor/icons/source/icon_audio_stream_player.svg
new file mode 100644
index 0000000000..2d9c5f4e6c
--- /dev/null
+++ b/editor/icons/source/icon_audio_stream_player.svg
@@ -0,0 +1,113 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ 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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_audio_player.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient959-5"
+ inkscape:collect="always">
+ <stop
+ style="stop-color:#ff8484;stop-opacity:1"
+ offset="0"
+ id="stop957-3" />
+ <stop
+ id="stop955-5"
+ offset="0.5"
+ style="stop-color:#e1dc7a;stop-opacity:1" />
+ <stop
+ style="stop-color:#84ffb1;stop-opacity:1"
+ offset="1"
+ id="stop953-6" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient959-5"
+ id="linearGradient4552"
+ x1="8"
+ y1="1"
+ x2="8"
+ y2="15"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="11.313709"
+ inkscape:cx="14.998333"
+ inkscape:cy="3.5679216"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.97227669;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 10.023235,1044.3625 c -0.5613918,-0.013 -1.0235345,0.4264 -1.0234377,0.9724 v 5.0542 c 6.911e-4,0.7482 0.8336124,1.2154 1.4999997,0.8414 l 4,-2.5262 c 0.666937,-0.3743 0.666937,-1.3104 0,-1.6847 l -4,-2.5261 c -0.145049,-0.082 -0.308928,-0.1269 -0.476562,-0.131 z"
+ id="path4507"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:url(#linearGradient4552);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 11.970703 1.0019531 A 1.0001 1.0001 0 0 0 11.724609 1.0390625 L 4.7246094 3.0390625 A 1.0001 1.0001 0 0 0 4 4 L 4 9.5507812 A 2.5 2.4999914 0 0 0 3.5 9.5 A 2.5 2.4999914 0 0 0 1 12 A 2.5 2.4999914 0 0 0 3.5 14.5 A 2.5 2.4999914 0 0 0 5.9960938 12.087891 A 1.0001 1.0001 0 0 0 6 12 L 6 4.7558594 L 11 3.328125 L 11 6.5 L 13 5.5 L 13 2 A 1.0001 1.0001 0 0 0 11.970703 1.0019531 z "
+ transform="translate(0,1036.3622)"
+ id="path4514" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_audio_stream_player_2_d.svg b/editor/icons/source/icon_audio_stream_player_2_d.svg
new file mode 100644
index 0000000000..39149786c4
--- /dev/null
+++ b/editor/icons/source/icon_audio_stream_player_2_d.svg
@@ -0,0 +1,114 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ 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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_audio_player_2d.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient959-5"
+ inkscape:collect="always">
+ <stop
+ style="stop-color:#ff8484;stop-opacity:1"
+ offset="0"
+ id="stop957-3" />
+ <stop
+ id="stop955-5"
+ offset="0.5"
+ style="stop-color:#e1dc7a;stop-opacity:1" />
+ <stop
+ style="stop-color:#84ffb1;stop-opacity:1"
+ offset="1"
+ id="stop953-6" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient959-5"
+ id="linearGradient4552"
+ x1="8"
+ y1="1"
+ x2="8"
+ y2="15"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="11.313709"
+ inkscape:cx="12.877013"
+ inkscape:cy="3.5679216"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#a5b7f1;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.97227669;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 10.023235,1044.3625 c -0.5613918,-0.013 -1.0235345,0.4264 -1.0234377,0.9724 v 5.0542 c 6.911e-4,0.7482 0.8336124,1.2154 1.4999997,0.8414 l 4,-2.5262 c 0.666937,-0.3743 0.666937,-1.3104 0,-1.6847 l -4,-2.5261 c -0.145049,-0.082 -0.308928,-0.1269 -0.476562,-0.131 z"
+ id="path4507"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:url(#linearGradient4552);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 11.970703 1.0019531 A 1.0001 1.0001 0 0 0 11.724609 1.0390625 L 4.7246094 3.0390625 A 1.0001 1.0001 0 0 0 4 4 L 4 9.5507812 A 2.5 2.4999914 0 0 0 3.5 9.5 A 2.5 2.4999914 0 0 0 1 12 A 2.5 2.4999914 0 0 0 3.5 14.5 A 2.5 2.4999914 0 0 0 5.9960938 12.087891 A 1.0001 1.0001 0 0 0 6 12 L 6 4.7558594 L 11 3.328125 L 11 6.5 L 13 5.5 L 13 2 A 1.0001 1.0001 0 0 0 11.970703 1.0019531 z "
+ transform="translate(0,1036.3622)"
+ id="path4514" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_audio_stream_player_3_d.svg b/editor/icons/source/icon_audio_stream_player_3_d.svg
new file mode 100644
index 0000000000..1858f8fe33
--- /dev/null
+++ b/editor/icons/source/icon_audio_stream_player_3_d.svg
@@ -0,0 +1,114 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ 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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_audio_stream_player_3_d.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient959-5"
+ inkscape:collect="always">
+ <stop
+ style="stop-color:#ff8484;stop-opacity:1"
+ offset="0"
+ id="stop957-3" />
+ <stop
+ id="stop955-5"
+ offset="0.5"
+ style="stop-color:#e1dc7a;stop-opacity:1" />
+ <stop
+ style="stop-color:#84ffb1;stop-opacity:1"
+ offset="1"
+ id="stop953-6" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient959-5"
+ id="linearGradient4552"
+ x1="8"
+ y1="1"
+ x2="8"
+ y2="15"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="11.313709"
+ inkscape:cx="-0.23400447"
+ inkscape:cy="10.117538"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#fc9c9c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.97227669;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 10.023235,1044.3625 c -0.5613918,-0.013 -1.0235345,0.4264 -1.0234377,0.9724 v 5.0542 c 6.911e-4,0.7482 0.8336124,1.2154 1.4999997,0.8414 l 4,-2.5262 c 0.666937,-0.3743 0.666937,-1.3104 0,-1.6847 l -4,-2.5261 c -0.145049,-0.082 -0.308928,-0.1269 -0.476562,-0.131 z"
+ id="path4507"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:url(#linearGradient4552);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 11.970703 1.0019531 A 1.0001 1.0001 0 0 0 11.724609 1.0390625 L 4.7246094 3.0390625 A 1.0001 1.0001 0 0 0 4 4 L 4 9.5507812 A 2.5 2.4999914 0 0 0 3.5 9.5 A 2.5 2.4999914 0 0 0 1 12 A 2.5 2.4999914 0 0 0 3.5 14.5 A 2.5 2.4999914 0 0 0 5.9960938 12.087891 A 1.0001 1.0001 0 0 0 6 12 L 6 4.7558594 L 11 3.328125 L 11 6.5 L 13 5.5 L 13 2 A 1.0001 1.0001 0 0 0 11.970703 1.0019531 z "
+ transform="translate(0,1036.3622)"
+ id="path4514" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_audio_stream_sample.svg b/editor/icons/source/icon_audio_stream_sample.svg
new file mode 100644
index 0000000000..0724daa333
--- /dev/null
+++ b/editor/icons/source/icon_audio_stream_sample.svg
@@ -0,0 +1,108 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ 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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_audio_stream_sample.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient959-5"
+ inkscape:collect="always">
+ <stop
+ style="stop-color:#ff8484;stop-opacity:1"
+ offset="0"
+ id="stop957-3" />
+ <stop
+ id="stop955-5"
+ offset="0.5"
+ style="stop-color:#e1dc7a;stop-opacity:1" />
+ <stop
+ style="stop-color:#84ffb1;stop-opacity:1"
+ offset="1"
+ id="stop953-6" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient959-5"
+ id="linearGradient4552"
+ x1="8"
+ y1="1"
+ x2="8"
+ y2="15"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="11.313708"
+ inkscape:cx="0.86295209"
+ inkscape:cy="-2.4874516"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:url(#linearGradient4552);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 11.970703 1.0019531 C 11.887443 1.0040231 11.804775 1.0164945 11.724609 1.0390625 L 4.7246094 3.0390625 C 4.2958022 3.1619372 4.0002098 3.5539354 4 4 L 4 9.5507812 C 3.8354622 9.5171023 3.6679493 9.5000892 3.5 9.5 C 2.1192848 9.5 0.99999525 10.61929 1 12 C 0.99999525 13.38071 2.1192848 14.5 3.5 14.5 C 4.8455926 14.4987 5.9487926 13.432648 5.9960938 12.087891 C 5.9986844 12.058665 5.9999878 12.02934 6 12 L 6 4.7558594 L 11 3.328125 L 11 6.5 L 13 5.5 L 13 2 C 12.999084 1.4368608 12.533603 0.98551202 11.970703 1.0019531 z M 10.5 8 C 10.223 8 10 8.223 10 8.5 L 10 13.5 C 10 13.777 10.223 14 10.5 14 C 10.777 14 11 13.777 11 13.5 L 11 8.5 C 11 8.223 10.777 8 10.5 8 z M 12.5 9 C 12.223 9 12 9.223 12 9.5 L 12 12.5 C 12 12.777 12.223 13 12.5 13 C 12.777 13 13 12.777 13 12.5 L 13 9.5 C 13 9.223 12.777 9 12.5 9 z M 8.5 10 C 8.223 10 8 10.223 8 10.5 L 8 11.5 C 8 11.777 8.223 12 8.5 12 C 8.777 12 9 11.777 9 11.5 L 9 10.5 C 9 10.223 8.777 10 8.5 10 z M 14.5 10 C 14.223 10 14 10.223 14 10.5 L 14 11.5 C 14 11.777 14.223 12 14.5 12 C 14.777 12 15 11.777 15 11.5 L 15 10.5 C 15 10.223 14.777 10 14.5 10 z "
+ transform="translate(0,1036.3622)"
+ id="path4514" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_back.svg b/editor/icons/source/icon_back.svg
index 597a1c3068..dfaf25de01 100644
--- a/editor/icons/source/icon_back.svg
+++ b/editor/icons/source/icon_back.svg
@@ -14,7 +14,7 @@
viewBox="0 0 8 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_bone.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="4.4850647"
- inkscape:cy="8.9717887"
+ inkscape:cx="8.1867174"
+ inkscape:cy="8.4650528"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -60,7 +60,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -70,10 +70,9 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
- d="m 5.9707031,1037.3633 c -0.3235485,0.01 -0.622658,0.1743 -0.8027343,0.4433 l -4,6 c -0.22390586,0.3359 -0.22390586,0.7735 0,1.1094 l 4,6 C 5.716941,1051.7388 6.999645,1051.3504 7,1050.3613 l 0,-12 c -9.424e-4,-0.5631 -0.4664154,-1.0144 -1.0292969,-0.998 z"
- id="path4159"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccccccc" />
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 6,1038.3622 -4,6 4,6"
+ id="path814"
+ inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_baked_light.svg b/editor/icons/source/icon_baked_light.svg
index 98dc3135f6..e4d435254d 100644
--- a/editor/icons/source/icon_baked_light.svg
+++ b/editor/icons/source/icon_baked_light.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_bone.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,7 +29,7 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="22.627417"
- inkscape:cx="6.1801151"
+ inkscape:cx="-2.7913022"
inkscape:cy="10.551189"
inkscape:document-units="px"
inkscape:current-layer="layer1"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -70,7 +70,7 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ style="opacity:1;fill:#fc9c9c;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 2 1 L 2 3 L 14 3 L 14 1 L 2 1 z M 1 4 L 1 13 A 2 2.0000174 0 0 0 3 15 L 13 15 A 2 2.0000174 0 0 0 15 13 L 15 4 L 1 4 z M 3 5 L 4 5 L 4 6 L 3 6 L 3 5 z M 6 5 L 7 5 L 7 6 L 6 6 L 6 5 z M 9 5 L 10 5 L 10 6 L 9 6 L 9 5 z M 12 5 L 13 5 L 13 6 L 12 6 L 12 5 z M 3 7 L 13 7 L 13 13 L 3 13 L 3 7 z M 6 8 L 6 9 L 10 9 L 10 8 L 6 8 z "
transform="translate(0,1036.3622)"
id="rect4155" />
diff --git a/editor/icons/source/icon_bit_map.svg b/editor/icons/source/icon_bit_map.svg
index fbaf573af6..5c1ad9139a 100644
--- a/editor/icons/source/icon_bit_map.svg
+++ b/editor/icons/source/icon_bit_map.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="-0.178935"
- inkscape:cy="8.367044"
+ inkscape:cx="3.664815"
+ inkscape:cy="7.867044"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -74,7 +74,7 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 1 1 L 1 3 L 3 3 L 3 1 L 1 1 z M 3 3 L 3 5 L 5 5 L 5 3 L 3 3 z M 5 3 L 7 3 L 7 1 L 5 1 L 5 3 z M 7 3 L 7 5 L 9 5 L 9 3 L 7 3 z M 9 3 L 11 3 L 11 1 L 9 1 L 9 3 z M 11 3 L 11 5 L 13 5 L 13 3 L 11 3 z M 13 3 L 15 3 L 15 1 L 13 1 L 13 3 z M 13 5 L 13 7 L 15 7 L 15 5 L 13 5 z M 13 7 L 11 7 L 11 9 L 13 9 L 13 7 z M 13 9 L 13 11 L 15 11 L 15 9 L 13 9 z M 13 11 L 11 11 L 11 13 L 13 13 L 13 11 z M 13 13 L 13 15 L 15 15 L 15 13 L 13 13 z M 11 13 L 9 13 L 9 15 L 11 15 L 11 13 z M 9 13 L 9 11 L 7 11 L 7 13 L 9 13 z M 7 13 L 5 13 L 5 15 L 7 15 L 7 13 z M 5 13 L 5 11 L 3 11 L 3 13 L 5 13 z M 3 13 L 1 13 L 1 15 L 3 15 L 3 13 z M 3 11 L 3 9 L 1 9 L 1 11 L 3 11 z M 3 9 L 5 9 L 5 7 L 3 7 L 3 9 z M 3 7 L 3 5 L 1 5 L 1 7 L 3 7 z M 5 7 L 7 7 L 7 5 L 5 5 L 5 7 z M 7 7 L 7 9 L 9 9 L 9 7 L 7 7 z M 9 7 L 11 7 L 11 5 L 9 5 L 9 7 z M 9 9 L 9 11 L 11 11 L 11 9 L 9 9 z M 7 9 L 5 9 L 5 11 L 7 11 L 7 9 z "
id="rect4170"
transform="translate(0,1036.3622)" />
diff --git a/editor/icons/source/icon_bool.svg b/editor/icons/source/icon_bool.svg
index e471871adf..9f429376fd 100644
--- a/editor/icons/source/icon_bool.svg
+++ b/editor/icons/source/icon_bool.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_bool.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="16"
- inkscape:cx="-0.0405559"
- inkscape:cy="11.453214"
+ inkscape:zoom="32"
+ inkscape:cx="3.5294581"
+ inkscape:cy="7.990409"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -68,10 +68,68 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
- <path
- style="opacity:1;fill:#cf68ea;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 3 1 L 3 3 L 4 3 L 4 13 L 3 13 L 3 15 L 11 15 L 11 13 L 6 13 L 6 3 L 9 3 L 9 1 L 3 1 z M 9 3 L 9 8 L 11 8 L 11 3 L 9 3 z M 11 8 L 11 13 L 13 13 L 13 8 L 11 8 z "
- transform="translate(0,1036.3622)"
- id="rect4140" />
+ <g
+ transform="translate(0,-2.0001)"
+ id="layer1-5"
+ inkscape:label="Layer 1"
+ style="fill:#cf68ea;fill-opacity:1">
+ <rect
+ transform="scale(-1,1)"
+ y="1044.3622"
+ x="-2"
+ height="5.9999666"
+ width="2"
+ id="rect4364"
+ style="fill:#cf68ea;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ transform="scale(-1,1)"
+ style="fill:#cf68ea;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4368"
+ width="1"
+ height="2.0000174"
+ x="-2"
+ y="1044.3622" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4370"
+ d="m 2,1044.3623 a 3,3 0 0 1 3,3 H 3 a 1.0000174,1.0000174 0 0 0 -1,-1 z"
+ style="fill:#cf68ea;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#cf68ea;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4374"
+ width="2"
+ height="5"
+ x="13"
+ y="-1047.3622"
+ transform="scale(1,-1)" />
+ <path
+ style="fill:#cf68ea;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 2,1050.3623 a 3,3 0 0 0 3,-3 H 3 a 1.0000174,1.0000174 0 0 1 -1,1 z"
+ id="path4378"
+ inkscape:connector-curvature="0" />
+ <rect
+ style="fill:#cf68ea;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4384"
+ width="2"
+ height="3.9999492"
+ x="-2"
+ y="1042.3622"
+ transform="scale(-1,1)" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4392"
+ d="m 16,1050.3623 a 3,3 0 0 1 -3,-3 h 2 a 1.0000174,1.0000174 0 0 0 1,1 z"
+ style="fill:#cf68ea;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4148"
+ d="m 7,1044.3622 a 3,3 0 0 0 -3,3 3,3 0 0 0 3,3 3,3 0 0 0 3,-3 3,3 0 0 0 -3,-3 z m 0,2 a 1.0000174,1.0000174 0 0 1 1,1 1.0000174,1.0000174 0 0 1 -1,1 1.0000174,1.0000174 0 0 1 -1,-1 1.0000174,1.0000174 0 0 1 1,-1 z"
+ style="fill:#cf68ea;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4174"
+ d="m 11,1044.3622 a 3,3 0 0 0 -3,3 3,3 0 0 0 3,3 3,3 0 0 0 3,-3 3,3 0 0 0 -3,-3 z m 0,2 a 1.0000174,1.0000174 0 0 1 1,1 1.0000174,1.0000174 0 0 1 -1,1 1.0000174,1.0000174 0 0 1 -1,-1 1.0000174,1.0000174 0 0 1 1,-1 z"
+ style="fill:#cf68ea;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
</g>
</svg>
diff --git a/editor/icons/source/icon_bus_vu_db.svg b/editor/icons/source/icon_bus_vu_db.svg
new file mode 100644
index 0000000000..813990bb42
--- /dev/null
+++ b/editor/icons/source/icon_bus_vu_db.svg
@@ -0,0 +1,111 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="32"
+ height="128"
+ viewBox="0 0 32 128"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_vu_empty.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_bus_vu_db.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient959-5"
+ id="linearGradient4736"
+ x1="16"
+ y1="0"
+ x2="16"
+ y2="128"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient959-5">
+ <stop
+ id="stop957-3"
+ offset="0"
+ style="stop-color:#ff8484;stop-opacity:1" />
+ <stop
+ style="stop-color:#e1dc7a;stop-opacity:1"
+ offset="0.5"
+ id="stop955-5" />
+ <stop
+ id="stop953-6"
+ offset="1"
+ style="stop-color:#84ffb1;stop-opacity:1" />
+ </linearGradient>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="4"
+ inkscape:cx="21.367149"
+ inkscape:cy="54.069367"
+ 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="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:snap-midpoints="false"
+ 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,-924.3622)">
+ <path
+ style="fill:url(#linearGradient4736);fill-opacity:1;stroke:none;stroke-width:2.68328929;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.49019608"
+ d="M 1.5 0 C 0.66899518 0 0 0.66899518 0 1.5 C 0 2.3310048 0.66899518 3 1.5 3 L 3.5 3 C 4.3310048 3 5 2.3310048 5 1.5 C 5 0.66899518 4.3310048 0 3.5 0 L 1.5 0 z M 1.5 7 C 0.669 7 0 7.669 0 8.5 C 0 9.331 0.669 10 1.5 10 C 2.331 10 3 9.331 3 8.5 C 3 7.669 2.331 7 1.5 7 z M 24 10.75 C 22.5 10.75 21 12.05555 21 14 A 1.0001 1.0001 0 1 0 23 14 C 23 12.94444 23.5 12.75 24 12.75 C 24.5 12.75 25 12.94444 25 14 C 25 14.59157 24.641069 15.156041 23.808594 15.863281 C 22.976118 16.570521 21.747003 17.315092 20.451172 18.164062 A 1.0001 1.0001 0 0 0 21 20 L 26 20 A 1.0001 1.0001 0 1 0 26 18 L 24.214844 18 C 24.498598 17.79333 24.845909 17.605569 25.103516 17.386719 C 26.133676 16.511529 27 15.40842 27 14 C 27 12.05555 25.5 10.75 24 10.75 z M 16.970703 11.001953 A 1.0001 1.0001 0 0 0 16.552734 11.105469 L 14.552734 12.105469 A 1.0001163 1.0001163 0 0 0 15.447266 13.894531 L 16 13.619141 L 16 19 A 1.0001 1.0001 0 1 0 18 19 L 18 12 A 1.0001 1.0001 0 0 0 16.970703 11.001953 z M 1.5 14 C 0.66899518 14 0 14.668995 0 15.5 C 0 16.331005 0.66899518 17 1.5 17 L 3.5 17 C 4.3310048 17 5 16.331005 5 15.5 C 5 14.668995 4.3310048 14 3.5 14 L 1.5 14 z M 1.5 21 C 0.669 21 0 21.669 0 22.5 C 0 23.331 0.669 24 1.5 24 C 2.331 24 3 23.331 3 22.5 C 3 21.669 2.331 21 1.5 21 z M 23 24 C 22.446 24 22 24.446 22 25 L 22 26 L 22 28 L 21.070312 28 A 1.0001 1.0001 0 0 0 21 28 C 19.929806 28 18.937441 28.57318 18.402344 29.5 C 17.867247 30.42681 17.867247 31.57318 18.402344 32.5 C 18.937441 33.42681 19.929806 34 21 34 L 23 34 C 23.554 34 24 33.554 24 33 L 24 25 C 24 24.446 23.554 24 23 24 z M 27 24 C 26.446 24 26 24.446 26 25 L 26 33 C 26 33.554 26.446 34 27 34 L 29 34 C 30.070194 34 31.062559 33.42681 31.597656 32.5 C 32.132753 31.57318 32.132753 30.42681 31.597656 29.5 C 31.492619 29.31807 31.365922 29.153017 31.228516 29 C 31.366318 28.846693 31.49237 28.682361 31.597656 28.5 C 32.132753 27.57318 32.132753 26.42681 31.597656 25.5 C 31.062559 24.57318 30.070194 24 29 24 L 27 24 z M 13 25 C 11.355297 25 10 26.3553 10 28 L 10 31 C 10 32.6447 11.355297 34 13 34 C 14.644703 34 16 32.6447 16 31 L 16 28 C 16 26.3553 14.644703 25 13 25 z M 28 26 L 29 26 C 29.358869 26 29.6858 26.18921 29.865234 26.5 C 30.044669 26.81079 30.044669 27.18921 29.865234 27.5 C 29.6858 27.81079 29.358869 28 29 28 L 28.929688 28 L 28 28 L 28 26 z M 13 27 C 13.571297 27 14 27.4287 14 28 L 14 31 C 14 31.5713 13.571297 32 13 32 C 12.428703 32 12 31.5713 12 31 L 12 28 C 12 27.4287 12.428703 27 13 27 z M 1.5 28 C 0.66899518 28 0 28.668995 0 29.5 C 0 30.331005 0.66899518 31 1.5 31 L 3.5 31 C 4.3310048 31 5 30.331005 5 29.5 C 5 28.668995 4.3310048 28 3.5 28 L 1.5 28 z M 21 30 L 22 30 L 22 32 L 21.070312 32 A 1.0001 1.0001 0 0 0 21 32 C 20.641131 32 20.3142 31.81079 20.134766 31.5 C 19.955331 31.18921 19.955331 30.81079 20.134766 30.5 C 20.3142 30.18921 20.641131 30 21 30 z M 28 30 L 29 30 C 29.358869 30 29.6858 30.18921 29.865234 30.5 C 30.044669 30.81079 30.044669 31.18921 29.865234 31.5 C 29.6858 31.81079 29.358869 32 29 32 L 28 32 L 28 30 z M 1.5 35 C 0.669 35 0 35.669 0 36.5 C 0 37.331 0.669 38 1.5 38 C 2.331 38 3 37.331 3 36.5 C 3 35.669 2.331 35 1.5 35 z M 24 37.75 C 22.5 37.75 21 39.05555 21 41 A 1.0001 1.0001 0 1 0 23 41 C 23 39.94444 23.5 39.75 24 39.75 C 24.5 39.75 25 39.94444 25 41 C 25 41.59157 24.641069 42.156041 23.808594 42.863281 C 22.976118 43.570521 21.747003 44.315092 20.451172 45.164062 A 1.0001 1.0001 0 0 0 21 47 L 26 47 A 1.0001 1.0001 0 1 0 26 45 L 24.214844 45 C 24.498598 44.79333 24.845909 44.605569 25.103516 44.386719 C 26.133676 43.511529 27 42.40842 27 41 C 27 39.05555 25.5 37.75 24 37.75 z M 16.970703 38.001953 A 1.0001 1.0001 0 0 0 16.552734 38.105469 L 14.552734 39.105469 A 1.0001163 1.0001163 0 0 0 15.447266 40.894531 L 16 40.619141 L 16 46 A 1.0001 1.0001 0 1 0 18 46 L 18 39 A 1.0001 1.0001 0 0 0 16.970703 38.001953 z M 1.5 42 C 0.66899518 42 0 42.668995 0 43.5 C 0 44.331005 0.66899518 45 1.5 45 L 3.5 45 C 4.3310048 45 5 44.331005 5 43.5 C 5 42.668995 4.3310048 42 3.5 42 L 1.5 42 z M 9 43 L 9 45 L 12 45 L 12 43 L 9 43 z M 2 49 C 1.169 49 0.5 49.669 0.5 50.5 C 0.5 51.331 1.169 52 2 52 C 2.831 52 3.5 51.331 3.5 50.5 C 3.5 49.669 2.831 49 2 49 z M 17.986328 52.75 C 16.486328 52.75 14.986328 54.05555 14.986328 56 A 1.0001 1.0001 0 1 0 16.986328 56 C 16.986328 54.94444 17.486328 54.75 17.986328 54.75 C 18.486328 54.75 18.986328 54.94444 18.986328 56 C 18.986328 56.59157 18.627397 57.156041 17.794922 57.863281 C 16.962447 58.570521 15.733331 59.315092 14.4375 60.164062 A 1.0001 1.0001 0 0 0 14.986328 62 L 19.986328 62 A 1.0001 1.0001 0 1 0 19.986328 60 L 18.199219 60 C 18.483315 59.79311 18.83195 59.605809 19.089844 59.386719 C 20.120004 58.511529 20.986328 57.40842 20.986328 56 C 20.986328 54.05555 19.486328 52.75 17.986328 52.75 z M 25.033203 52.988281 A 1.0001 1.0001 0 0 0 24.142578 53.486328 L 21.142578 58.486328 A 1.0001 1.0001 0 0 0 22 60 L 25 60 L 25 61 A 1.0001 1.0001 0 1 0 27 61 L 27 59 A 1.0001 1.0001 0 0 0 26 58 L 23.767578 58 L 25.857422 54.515625 A 1.0001 1.0001 0 0 0 25.033203 52.988281 z M 1.5 56 C 0.66899518 56 0 56.668995 0 57.5 C 0 58.331005 0.66899518 59 1.5 59 L 3.5 59 C 4.3310048 59 5 58.331005 5 57.5 C 5 56.668995 4.3310048 56 3.5 56 L 1.5 56 z M 9 58 L 9 60 L 12 60 L 12 58 L 9 58 z M 1.5 63 C 0.669 63 0 63.669 0 64.5 C 0 65.331 0.669 66 1.5 66 C 2.331 66 3 65.331 3 64.5 C 3 63.669 2.331 63 1.5 63 z M 26.046875 67.996094 A 1.0001 1.0001 0 0 0 25.683594 68.052734 C 25.683594 68.052734 24.700104 68.385829 23.792969 69.292969 C 22.885834 70.200139 22 71.75 22 74 A 1.0001 1.0001 0 0 0 22.021484 74.214844 C 22.135372 75.759296 23.42866 77 25 77 C 26.64501 77 28 75.64497 28 74 C 28 72.35499 26.64501 71 25 71 C 24.984666 71 24.970361 71.003672 24.955078 71.003906 C 25.03908 70.902917 25.122032 70.79203 25.207031 70.707031 C 25.799896 70.114161 26.316406 69.949219 26.316406 69.949219 A 1.0001 1.0001 0 0 0 26.046875 67.996094 z M 16.986328 68.001953 C 15.94567 68.009427 14.945809 68.560643 14.402344 69.501953 A 1.0001607 1.0001607 0 0 0 16.134766 70.501953 C 16.380733 70.075953 16.87953 69.892287 17.341797 70.060547 C 17.804064 70.228797 18.069795 70.689368 17.984375 71.173828 C 17.898952 71.658288 17.491934 72.001953 17 72.001953 A 1.0001 1.0001 0 0 0 16.916016 72.003906 A 1.0001 1.0001 0 0 0 16.751953 72.029297 A 1.0001 1.0001 0 0 0 16.722656 72.037109 A 1.0001 1.0001 0 0 0 16.634766 72.064453 A 1.0001 1.0001 0 0 0 16.574219 72.091797 A 1.0001 1.0001 0 0 0 16.527344 72.113281 A 1.0001 1.0001 0 0 0 16.486328 72.136719 A 1.0001 1.0001 0 0 0 16.453125 72.15625 A 1.0001 1.0001 0 0 0 16.3125 72.263672 A 1.0001 1.0001 0 0 0 16.287109 72.287109 A 1.0001 1.0001 0 0 0 16.269531 72.306641 A 1.0001 1.0001 0 0 0 16.21875 72.359375 A 1.0001 1.0001 0 0 0 16.1875 72.400391 A 1.0001 1.0001 0 0 0 16.162109 72.435547 A 1.0001 1.0001 0 0 0 16.142578 72.466797 A 1.0001 1.0001 0 0 0 16.064453 72.611328 A 1.0001 1.0001 0 0 0 16.041016 72.677734 A 1.0001 1.0001 0 0 0 16.033203 72.695312 A 1.0001 1.0001 0 0 0 15.996094 72.861328 A 1.0001 1.0001 0 0 0 15.990234 72.912109 A 1.0001 1.0001 0 0 0 15.990234 72.927734 A 1.0001 1.0001 0 0 0 15.986328 73 A 1.0001 1.0001 0 0 0 15.990234 73.074219 A 1.0001 1.0001 0 0 0 15.990234 73.089844 A 1.0001 1.0001 0 0 0 15.996094 73.140625 A 1.0001 1.0001 0 0 0 16.033203 73.304688 A 1.0001 1.0001 0 0 0 16.041016 73.324219 A 1.0001 1.0001 0 0 0 16.064453 73.390625 A 1.0001 1.0001 0 0 0 16.070312 73.404297 A 1.0001 1.0001 0 0 0 16.101562 73.466797 A 1.0001 1.0001 0 0 0 16.142578 73.535156 A 1.0001 1.0001 0 0 0 16.162109 73.566406 A 1.0001 1.0001 0 0 0 16.1875 73.601562 A 1.0001 1.0001 0 0 0 16.21875 73.642578 A 1.0001 1.0001 0 0 0 16.269531 73.695312 A 1.0001 1.0001 0 0 0 16.287109 73.714844 A 1.0001 1.0001 0 0 0 16.3125 73.738281 A 1.0001 1.0001 0 0 0 16.4375 73.835938 A 1.0001 1.0001 0 0 0 16.515625 73.882812 A 1.0001 1.0001 0 0 0 16.521484 73.886719 A 1.0001 1.0001 0 0 0 16.59375 73.919922 A 1.0001 1.0001 0 0 0 16.615234 73.929688 A 1.0001 1.0001 0 0 0 16.679688 73.953125 A 1.0001 1.0001 0 0 0 16.720703 73.964844 A 1.0001 1.0001 0 0 0 16.751953 73.972656 A 1.0001 1.0001 0 0 0 16.919922 73.998047 A 1.0001 1.0001 0 0 0 17 74.001953 C 17.491934 74.001953 17.898952 74.343665 17.984375 74.828125 C 18.069795 75.312585 17.804064 75.773206 17.341797 75.941406 C 16.87953 76.109706 16.380733 75.92637 16.134766 75.5 A 1.0001607 1.0001607 0 0 0 14.402344 76.5 C 15.126964 77.7551 16.66355 78.316013 18.025391 77.820312 C 19.387231 77.324714 20.206736 75.907669 19.955078 74.480469 C 19.854803 73.911777 19.590188 73.406592 19.222656 73 C 19.589698 72.593206 19.854887 72.089699 19.955078 71.521484 C 20.206736 70.094264 19.387231 68.677311 18.025391 68.181641 C 17.68493 68.057723 17.333214 67.999462 16.986328 68.001953 z M 1.5 70 C 0.66899518 70 0 70.668995 0 71.5 C 0 72.331005 0.66899518 73 1.5 73 L 3.5 73 C 4.3310048 73 5 72.331005 5 71.5 C 5 70.668995 4.3310048 70 3.5 70 L 1.5 70 z M 9 72 L 9 74 L 12 74 L 12 72 L 9 72 z M 25 73 C 25.564129 73 26 73.43587 26 74 C 26 74.56413 25.564129 75 25 75 C 24.435871 75 24 74.56413 24 74 C 24 73.43587 24.435871 73 25 73 z M 1.5 77 C 0.669 77 0 77.669 0 78.5 C 0 79.331 0.669 80 1.5 80 C 2.331 80 3 79.331 3 78.5 C 3 77.669 2.331 77 1.5 77 z M 18.033203 80.988281 A 1.0001 1.0001 0 0 0 17.142578 81.486328 L 14.142578 86.486328 A 1.0001 1.0001 0 0 0 15 88 L 18 88 L 18 89 A 1.0001 1.0001 0 1 0 20 89 L 20 87 A 1.0001 1.0001 0 0 0 19 86 L 16.767578 86 L 18.857422 82.515625 A 1.0001 1.0001 0 0 0 18.033203 80.988281 z M 25 81 C 23.35499 81 22 82.355 22 84 C 22 84.768995 22.303687 85.466552 22.787109 86 C 22.304287 86.533316 22 87.231542 22 88 C 22 89.645 23.35499 91 25 91 C 26.64501 91 28 89.645 28 88 C 28 87.231542 27.695713 86.533316 27.212891 86 C 27.696313 85.466552 28 84.768995 28 84 C 28 82.355 26.64501 81 25 81 z M 25 83 C 25.564129 83 26 83.4359 26 84 C 26 84.5642 25.564129 85 25 85 C 24.435871 85 24 84.5642 24 84 C 24 83.4359 24.435871 83 25 83 z M 1.5 84 C 0.66899518 84 0 84.668995 0 85.5 C 0 86.331005 0.66899518 87 1.5 87 L 3.5 87 C 4.3310048 87 5 86.331005 5 85.5 C 5 84.668995 4.3310048 84 3.5 84 L 1.5 84 z M 9 86 L 9 88 L 12 88 L 12 86 L 9 86 z M 25 87 C 25.564129 87 26 87.4359 26 88 C 26 88.5642 25.564129 89 25 89 C 24.435871 89 24 88.5642 24 88 C 24 87.4359 24.435871 87 25 87 z M 1.5 91 C 0.669 91 0 91.669 0 92.5 C 0 93.331 0.669 94 1.5 94 C 2.331 94 3 93.331 3 92.5 C 3 91.669 2.331 91 1.5 91 z M 17.947266 94.982422 A 1.0001 1.0001 0 0 0 17.683594 95.037109 C 17.683594 95.037109 16.700104 95.372197 15.792969 96.279297 C 14.885834 97.186097 14 98.736326 14 100.98633 A 1.0001 1.0001 0 0 0 14.021484 101.20117 C 14.135372 102.74565 15.42866 103.98633 17 103.98633 C 18.64501 103.98633 20 102.63133 20 100.98633 C 20 99.341226 18.64501 97.986328 17 97.986328 C 16.984666 97.986328 16.970361 97.99 16.955078 97.990234 C 17.03908 97.889241 17.122032 97.778363 17.207031 97.693359 C 17.799896 97.100459 18.316406 96.935547 18.316406 96.935547 A 1.0001 1.0001 0 0 0 18.046875 94.982422 A 1.0001 1.0001 0 0 0 17.947266 94.982422 z M 25 95 C 23.355297 95 22 96.3553 22 98 L 22 101 C 22 102.6447 23.355297 104 25 104 C 26.644703 104 28 102.6447 28 101 L 28 98 C 28 96.3553 26.644703 95 25 95 z M 25 97 C 25.571297 97 26 97.4287 26 98 L 26 101 C 26 101.5713 25.571297 102 25 102 C 24.428703 102 24 101.5713 24 101 L 24 98 C 24 97.4287 24.428703 97 25 97 z M 1.5 98 C 0.66899518 98 0 98.668995 0 99.5 C 0 100.331 0.66899518 101 1.5 101 L 3.5 101 C 4.3310048 101 5 100.331 5 99.5 C 5 98.668995 4.3310048 98 3.5 98 L 1.5 98 z M 17 99.986328 C 17.564129 99.986328 18 100.42213 18 100.98633 C 18 101.55043 17.564129 101.98633 17 101.98633 C 16.435871 101.98633 16 101.55043 16 100.98633 C 16 100.42213 16.435871 99.986328 17 99.986328 z M 9 100 L 9 102 L 12 102 L 12 100 L 9 100 z M 1.5 105 C 0.669 105 0 105.669 0 106.5 C 0 107.331 0.669 108 1.5 108 C 2.331 108 3 107.331 3 106.5 C 3 105.669 2.331 105 1.5 105 z M 24 108.75 C 22.5 108.75 21 110.0556 21 112 A 1.0001 1.0001 0 1 0 23 112 C 23 110.9445 23.5 110.75 24 110.75 C 24.5 110.75 25 110.9445 25 112 C 25 112.5916 24.641069 113.15608 23.808594 113.86328 C 22.976118 114.57048 21.747004 115.31506 20.451172 116.16406 A 1.0001 1.0001 0 0 0 21 118 L 26 118 A 1.0001 1.0001 0 1 0 26 116 L 24.214844 116 C 24.498598 115.7934 24.845909 115.60562 25.103516 115.38672 C 26.133676 114.51162 27 113.4085 27 112 C 27 110.0556 25.5 108.75 24 108.75 z M 14 109 A 1.0001 1.0001 0 1 0 14 111 L 17.382812 111 L 14.105469 117.55273 A 1.0001181 1.0001181 0 0 0 15.894531 118.44727 L 19.894531 110.44727 A 1.0001 1.0001 0 0 0 19 109 L 14 109 z M 1.5 112 C 0.66899518 112 0 112.669 0 113.5 C 0 114.331 0.66899518 115 1.5 115 L 3.5 115 C 4.3310048 115 5 114.331 5 113.5 C 5 112.669 4.3310048 112 3.5 112 L 1.5 112 z M 9 114 L 9 116 L 12 116 L 12 114 L 9 114 z M 1.5 119 C 0.669 119 0 119.669 0 120.5 C 0 121.331 0.669 122 1.5 122 C 2.331 122 3 121.331 3 120.5 C 3 119.669 2.331 119 1.5 119 z "
+ transform="translate(0,924.3622)"
+ id="rect4527" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_bus_vu_empty.svg b/editor/icons/source/icon_bus_vu_empty.svg
new file mode 100644
index 0000000000..0755a2695b
--- /dev/null
+++ b/editor/icons/source/icon_bus_vu_empty.svg
@@ -0,0 +1,115 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="128"
+ viewBox="0 0 16 128"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_vu_empty.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_bus_vu_empty.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient959"
+ inkscape:collect="always">
+ <stop
+ style="stop-color:#ff8484;stop-opacity:1"
+ offset="0"
+ id="stop957" />
+ <stop
+ id="stop955"
+ offset="0.5"
+ style="stop-color:#e1dc7a;stop-opacity:1" />
+ <stop
+ style="stop-color:#84ffb1;stop-opacity:1"
+ offset="1"
+ id="stop953" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient959"
+ id="linearGradient951"
+ x1="8"
+ y1="2"
+ x2="8"
+ y2="126"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="5.6568543"
+ inkscape:cx="37.883117"
+ inkscape:cy="58.698878"
+ 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="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:object-nodes="false"
+ inkscape:snap-smooth-nodes="false"
+ inkscape:snap-midpoints="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,-924.3622)">
+ <path
+ style="fill:url(#linearGradient951);fill-opacity:1;stroke:none;stroke-width:1.28571427;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 3 2 C 2.4459952 2 2 2.4459952 2 3 C 2 3.5540048 2.4459952 4 3 4 L 13 4 C 13.554005 4 14 3.5540048 14 3 C 14 2.4459952 13.554005 2 13 2 L 3 2 z M 3 5 C 2.4459952 5 2 5.4459952 2 6 C 2 6.5540048 2.4459952 7 3 7 L 13 7 C 13.554005 7 14 6.5540048 14 6 C 14 5.4459952 13.554005 5 13 5 L 3 5 z M 3 8 C 2.4459952 8 2 8.4459952 2 9 C 2 9.5540048 2.4459952 10 3 10 L 13 10 C 13.554005 10 14 9.5540048 14 9 C 14 8.4459952 13.554005 8 13 8 L 3 8 z M 3 11 C 2.4459952 11 2 11.445995 2 12 C 2 12.554005 2.4459952 13 3 13 L 13 13 C 13.554005 13 14 12.554005 14 12 C 14 11.445995 13.554005 11 13 11 L 3 11 z M 3 14 C 2.4459952 14 2 14.445995 2 15 C 2 15.554005 2.4459952 16 3 16 L 13 16 C 13.554005 16 14 15.554005 14 15 C 14 14.445995 13.554005 14 13 14 L 3 14 z M 3 17 C 2.4459952 17 2 17.445995 2 18 C 2 18.554005 2.4459952 19 3 19 L 13 19 C 13.554005 19 14 18.554005 14 18 C 14 17.445995 13.554005 17 13 17 L 3 17 z M 3 20 C 2.4459952 20 2 20.445995 2 21 C 2 21.554005 2.4459952 22 3 22 L 13 22 C 13.554005 22 14 21.554005 14 21 C 14 20.445995 13.554005 20 13 20 L 3 20 z M 3 23 C 2.4459952 23 2 23.445995 2 24 C 2 24.554005 2.4459952 25 3 25 L 13 25 C 13.554005 25 14 24.554005 14 24 C 14 23.445995 13.554005 23 13 23 L 3 23 z M 3 26 C 2.4459952 26 2 26.445995 2 27 C 2 27.554005 2.4459952 28 3 28 L 13 28 C 13.554005 28 14 27.554005 14 27 C 14 26.445995 13.554005 26 13 26 L 3 26 z M 3 31 C 2.4459952 31 2 31.445995 2 32 C 2 32.554005 2.4459952 33 3 33 L 13 33 C 13.554005 33 14 32.554005 14 32 C 14 31.445995 13.554005 31 13 31 L 3 31 z M 3 34 C 2.4459952 34 2 34.445995 2 35 C 2 35.554005 2.4459952 36 3 36 L 13 36 C 13.554005 36 14 35.554005 14 35 C 14 34.445995 13.554005 34 13 34 L 3 34 z M 3 37 C 2.4459952 37 2 37.445995 2 38 C 2 38.554005 2.4459952 39 3 39 L 13 39 C 13.554005 39 14 38.554005 14 38 C 14 37.445995 13.554005 37 13 37 L 3 37 z M 3 40 C 2.4459952 40 2 40.445995 2 41 C 2 41.554005 2.4459952 42 3 42 L 13 42 C 13.554005 42 14 41.554005 14 41 C 14 40.445995 13.554005 40 13 40 L 3 40 z M 3 43 C 2.4459952 43 2 43.445995 2 44 C 2 44.554005 2.4459952 45 3 45 L 13 45 C 13.554005 45 14 44.554005 14 44 C 14 43.445995 13.554005 43 13 43 L 3 43 z M 3 46 C 2.4459952 46 2 46.445995 2 47 C 2 47.554005 2.4459952 48 3 48 L 13 48 C 13.554005 48 14 47.554005 14 47 C 14 46.445995 13.554005 46 13 46 L 3 46 z M 3 49 C 2.4459952 49 2 49.445995 2 50 C 2 50.554005 2.4459952 51 3 51 L 13 51 C 13.554005 51 14 50.554005 14 50 C 14 49.445995 13.554005 49 13 49 L 3 49 z M 3 52 C 2.4459952 52 2 52.445995 2 53 C 2 53.554005 2.4459952 54 3 54 L 13 54 C 13.554005 54 14 53.554005 14 53 C 14 52.445995 13.554005 52 13 52 L 3 52 z M 3 55 C 2.4459952 55 2 55.445995 2 56 C 2 56.554005 2.4459952 57 3 57 L 13 57 C 13.554005 57 14 56.554005 14 56 C 14 55.445995 13.554005 55 13 55 L 3 55 z M 3 58 C 2.4459952 58 2 58.445995 2 59 C 2 59.554005 2.4459952 60 3 60 L 13 60 C 13.554005 60 14 59.554005 14 59 C 14 58.445995 13.554005 58 13 58 L 3 58 z M 3 61 C 2.4459952 61 2 61.445995 2 62 C 2 62.554005 2.4459952 63 3 63 L 13 63 C 13.554005 63 14 62.554005 14 62 C 14 61.445995 13.554005 61 13 61 L 3 61 z M 3 64 C 2.4459952 64 2 64.445995 2 65 C 2 65.554005 2.4459952 66 3 66 L 13 66 C 13.554005 66 14 65.554005 14 65 C 14 64.445995 13.554005 64 13 64 L 3 64 z M 3 67 C 2.4459952 67 2 67.445995 2 68 C 2 68.554005 2.4459952 69 3 69 L 13 69 C 13.554005 69 14 68.554005 14 68 C 14 67.445995 13.554005 67 13 67 L 3 67 z M 3 70 C 2.4459952 70 2 70.445995 2 71 C 2 71.554005 2.4459952 72 3 72 L 13 72 C 13.554005 72 14 71.554005 14 71 C 14 70.445995 13.554005 70 13 70 L 3 70 z M 3 73 C 2.4459952 73 2 73.445995 2 74 C 2 74.554005 2.4459952 75 3 75 L 13 75 C 13.554005 75 14 74.554005 14 74 C 14 73.445995 13.554005 73 13 73 L 3 73 z M 3 76 C 2.4459952 76 2 76.445995 2 77 C 2 77.554005 2.4459952 78 3 78 L 13 78 C 13.554005 78 14 77.554005 14 77 C 14 76.445995 13.554005 76 13 76 L 3 76 z M 3 79 C 2.4459952 79 2 79.445995 2 80 C 2 80.554005 2.4459952 81 3 81 L 13 81 C 13.554005 81 14 80.554005 14 80 C 14 79.445995 13.554005 79 13 79 L 3 79 z M 3 82 C 2.4459952 82 2 82.445995 2 83 C 2 83.554005 2.4459952 84 3 84 L 13 84 C 13.554005 84 14 83.554005 14 83 C 14 82.445995 13.554005 82 13 82 L 3 82 z M 3 85 C 2.4459952 85 2 85.445995 2 86 C 2 86.554005 2.4459952 87 3 87 L 13 87 C 13.554005 87 14 86.554005 14 86 C 14 85.445995 13.554005 85 13 85 L 3 85 z M 3 88 C 2.4459952 88 2 88.445995 2 89 C 2 89.554005 2.4459952 90 3 90 L 13 90 C 13.554005 90 14 89.554005 14 89 C 14 88.445995 13.554005 88 13 88 L 3 88 z M 3 91 C 2.4459952 91 2 91.445995 2 92 C 2 92.554005 2.4459952 93 3 93 L 13 93 C 13.554005 93 14 92.554005 14 92 C 14 91.445995 13.554005 91 13 91 L 3 91 z M 3 94 C 2.4459952 94 2 94.445995 2 95 C 2 95.554005 2.4459952 96 3 96 L 13 96 C 13.554005 96 14 95.554005 14 95 C 14 94.445995 13.554005 94 13 94 L 3 94 z M 3 97 C 2.4459952 97 2 97.445995 2 98 C 2 98.554005 2.4459952 99 3 99 L 13 99 C 13.554005 99 14 98.554005 14 98 C 14 97.445995 13.554005 97 13 97 L 3 97 z M 3 100 C 2.4459952 100 2 100.446 2 101 C 2 101.554 2.4459952 102 3 102 L 13 102 C 13.554005 102 14 101.554 14 101 C 14 100.446 13.554005 100 13 100 L 3 100 z M 3 103 C 2.4459952 103 2 103.446 2 104 C 2 104.554 2.4459952 105 3 105 L 13 105 C 13.554005 105 14 104.554 14 104 C 14 103.446 13.554005 103 13 103 L 3 103 z M 3 106 C 2.4459952 106 2 106.446 2 107 C 2 107.554 2.4459952 108 3 108 L 13 108 C 13.554005 108 14 107.554 14 107 C 14 106.446 13.554005 106 13 106 L 3 106 z M 3 109 C 2.4459952 109 2 109.446 2 110 C 2 110.554 2.4459952 111 3 111 L 13 111 C 13.554005 111 14 110.554 14 110 C 14 109.446 13.554005 109 13 109 L 3 109 z M 3 112 C 2.4459952 112 2 112.446 2 113 C 2 113.554 2.4459952 114 3 114 L 13 114 C 13.554005 114 14 113.554 14 113 C 14 112.446 13.554005 112 13 112 L 3 112 z M 3 115 C 2.4459952 115 2 115.446 2 116 C 2 116.554 2.4459952 117 3 117 L 13 117 C 13.554005 117 14 116.554 14 116 C 14 115.446 13.554005 115 13 115 L 3 115 z M 3 118 C 2.4459952 118 2 118.446 2 119 C 2 119.554 2.4459952 120 3 120 L 13 120 C 13.554005 120 14 119.554 14 119 C 14 118.446 13.554005 118 13 118 L 3 118 z M 3 121 C 2.4459952 121 2 121.446 2 122 C 2 122.554 2.4459952 123 3 123 L 13 123 C 13.554005 123 14 122.554 14 122 C 14 121.446 13.554005 121 13 121 L 3 121 z M 3 124 C 2.4459952 124 2 124.446 2 125 C 2 125.554 2.4459952 126 3 126 L 13 126 C 13.554005 126 14 125.554 14 125 C 14 124.446 13.554005 124 13 124 L 3 124 z "
+ transform="translate(0,924.3622)"
+ id="rect852" />
+ <path
+ id="path1006"
+ transform="translate(0,924.3622)"
+ d="M 3 2 C 2.4459952 2 2 2.4459952 2 3 C 2 3.5540048 2.4459952 4 3 4 L 13 4 C 13.554005 4 14 3.5540048 14 3 C 14 2.4459952 13.554005 2 13 2 L 3 2 z M 3 5 C 2.4459952 5 2 5.4459952 2 6 C 2 6.5540048 2.4459952 7 3 7 L 13 7 C 13.554005 7 14 6.5540048 14 6 C 14 5.4459952 13.554005 5 13 5 L 3 5 z M 3 8 C 2.4459952 8 2 8.4459952 2 9 C 2 9.5540048 2.4459952 10 3 10 L 13 10 C 13.554005 10 14 9.5540048 14 9 C 14 8.4459952 13.554005 8 13 8 L 3 8 z M 3 11 C 2.4459952 11 2 11.445995 2 12 C 2 12.554005 2.4459952 13 3 13 L 13 13 C 13.554005 13 14 12.554005 14 12 C 14 11.445995 13.554005 11 13 11 L 3 11 z M 3 14 C 2.4459952 14 2 14.445995 2 15 C 2 15.554005 2.4459952 16 3 16 L 13 16 C 13.554005 16 14 15.554005 14 15 C 14 14.445995 13.554005 14 13 14 L 3 14 z M 3 17 C 2.4459952 17 2 17.445995 2 18 C 2 18.554005 2.4459952 19 3 19 L 13 19 C 13.554005 19 14 18.554005 14 18 C 14 17.445995 13.554005 17 13 17 L 3 17 z M 3 20 C 2.4459952 20 2 20.445995 2 21 C 2 21.554005 2.4459952 22 3 22 L 13 22 C 13.554005 22 14 21.554005 14 21 C 14 20.445995 13.554005 20 13 20 L 3 20 z M 3 23 C 2.4459952 23 2 23.445995 2 24 C 2 24.554005 2.4459952 25 3 25 L 13 25 C 13.554005 25 14 24.554005 14 24 C 14 23.445995 13.554005 23 13 23 L 3 23 z M 3 26 C 2.4459952 26 2 26.445995 2 27 C 2 27.554005 2.4459952 28 3 28 L 13 28 C 13.554005 28 14 27.554005 14 27 C 14 26.445995 13.554005 26 13 26 L 3 26 z M 3 31 C 2.4459952 31 2 31.445995 2 32 C 2 32.554005 2.4459952 33 3 33 L 13 33 C 13.554005 33 14 32.554005 14 32 C 14 31.445995 13.554005 31 13 31 L 3 31 z M 3 34 C 2.4459952 34 2 34.445995 2 35 C 2 35.554005 2.4459952 36 3 36 L 13 36 C 13.554005 36 14 35.554005 14 35 C 14 34.445995 13.554005 34 13 34 L 3 34 z M 3 37 C 2.4459952 37 2 37.445995 2 38 C 2 38.554005 2.4459952 39 3 39 L 13 39 C 13.554005 39 14 38.554005 14 38 C 14 37.445995 13.554005 37 13 37 L 3 37 z M 3 40 C 2.4459952 40 2 40.445995 2 41 C 2 41.554005 2.4459952 42 3 42 L 13 42 C 13.554005 42 14 41.554005 14 41 C 14 40.445995 13.554005 40 13 40 L 3 40 z M 3 43 C 2.4459952 43 2 43.445995 2 44 C 2 44.554005 2.4459952 45 3 45 L 13 45 C 13.554005 45 14 44.554005 14 44 C 14 43.445995 13.554005 43 13 43 L 3 43 z M 3 46 C 2.4459952 46 2 46.445995 2 47 C 2 47.554005 2.4459952 48 3 48 L 13 48 C 13.554005 48 14 47.554005 14 47 C 14 46.445995 13.554005 46 13 46 L 3 46 z M 3 49 C 2.4459952 49 2 49.445995 2 50 C 2 50.554005 2.4459952 51 3 51 L 13 51 C 13.554005 51 14 50.554005 14 50 C 14 49.445995 13.554005 49 13 49 L 3 49 z M 3 52 C 2.4459952 52 2 52.445995 2 53 C 2 53.554005 2.4459952 54 3 54 L 13 54 C 13.554005 54 14 53.554005 14 53 C 14 52.445995 13.554005 52 13 52 L 3 52 z M 3 55 C 2.4459952 55 2 55.445995 2 56 C 2 56.554005 2.4459952 57 3 57 L 13 57 C 13.554005 57 14 56.554005 14 56 C 14 55.445995 13.554005 55 13 55 L 3 55 z M 3 58 C 2.4459952 58 2 58.445995 2 59 C 2 59.554005 2.4459952 60 3 60 L 13 60 C 13.554005 60 14 59.554005 14 59 C 14 58.445995 13.554005 58 13 58 L 3 58 z M 3 61 C 2.4459952 61 2 61.445995 2 62 C 2 62.554005 2.4459952 63 3 63 L 13 63 C 13.554005 63 14 62.554005 14 62 C 14 61.445995 13.554005 61 13 61 L 3 61 z M 3 64 C 2.4459952 64 2 64.445995 2 65 C 2 65.554005 2.4459952 66 3 66 L 13 66 C 13.554005 66 14 65.554005 14 65 C 14 64.445995 13.554005 64 13 64 L 3 64 z M 3 67 C 2.4459952 67 2 67.445995 2 68 C 2 68.554005 2.4459952 69 3 69 L 13 69 C 13.554005 69 14 68.554005 14 68 C 14 67.445995 13.554005 67 13 67 L 3 67 z M 3 70 C 2.4459952 70 2 70.445995 2 71 C 2 71.554005 2.4459952 72 3 72 L 13 72 C 13.554005 72 14 71.554005 14 71 C 14 70.445995 13.554005 70 13 70 L 3 70 z M 3 73 C 2.4459952 73 2 73.445995 2 74 C 2 74.554005 2.4459952 75 3 75 L 13 75 C 13.554005 75 14 74.554005 14 74 C 14 73.445995 13.554005 73 13 73 L 3 73 z M 3 76 C 2.4459952 76 2 76.445995 2 77 C 2 77.554005 2.4459952 78 3 78 L 13 78 C 13.554005 78 14 77.554005 14 77 C 14 76.445995 13.554005 76 13 76 L 3 76 z M 3 79 C 2.4459952 79 2 79.445995 2 80 C 2 80.554005 2.4459952 81 3 81 L 13 81 C 13.554005 81 14 80.554005 14 80 C 14 79.445995 13.554005 79 13 79 L 3 79 z M 3 82 C 2.4459952 82 2 82.445995 2 83 C 2 83.554005 2.4459952 84 3 84 L 13 84 C 13.554005 84 14 83.554005 14 83 C 14 82.445995 13.554005 82 13 82 L 3 82 z M 3 85 C 2.4459952 85 2 85.445995 2 86 C 2 86.554005 2.4459952 87 3 87 L 13 87 C 13.554005 87 14 86.554005 14 86 C 14 85.445995 13.554005 85 13 85 L 3 85 z M 3 88 C 2.4459952 88 2 88.445995 2 89 C 2 89.554005 2.4459952 90 3 90 L 13 90 C 13.554005 90 14 89.554005 14 89 C 14 88.445995 13.554005 88 13 88 L 3 88 z M 3 91 C 2.4459952 91 2 91.445995 2 92 C 2 92.554005 2.4459952 93 3 93 L 13 93 C 13.554005 93 14 92.554005 14 92 C 14 91.445995 13.554005 91 13 91 L 3 91 z M 3 94 C 2.4459952 94 2 94.445995 2 95 C 2 95.554005 2.4459952 96 3 96 L 13 96 C 13.554005 96 14 95.554005 14 95 C 14 94.445995 13.554005 94 13 94 L 3 94 z M 3 97 C 2.4459952 97 2 97.445995 2 98 C 2 98.554005 2.4459952 99 3 99 L 13 99 C 13.554005 99 14 98.554005 14 98 C 14 97.445995 13.554005 97 13 97 L 3 97 z M 3 100 C 2.4459952 100 2 100.446 2 101 C 2 101.554 2.4459952 102 3 102 L 13 102 C 13.554005 102 14 101.554 14 101 C 14 100.446 13.554005 100 13 100 L 3 100 z M 3 103 C 2.4459952 103 2 103.446 2 104 C 2 104.554 2.4459952 105 3 105 L 13 105 C 13.554005 105 14 104.554 14 104 C 14 103.446 13.554005 103 13 103 L 3 103 z M 3 106 C 2.4459952 106 2 106.446 2 107 C 2 107.554 2.4459952 108 3 108 L 13 108 C 13.554005 108 14 107.554 14 107 C 14 106.446 13.554005 106 13 106 L 3 106 z M 3 109 C 2.4459952 109 2 109.446 2 110 C 2 110.554 2.4459952 111 3 111 L 13 111 C 13.554005 111 14 110.554 14 110 C 14 109.446 13.554005 109 13 109 L 3 109 z M 3 112 C 2.4459952 112 2 112.446 2 113 C 2 113.554 2.4459952 114 3 114 L 13 114 C 13.554005 114 14 113.554 14 113 C 14 112.446 13.554005 112 13 112 L 3 112 z M 3 115 C 2.4459952 115 2 115.446 2 116 C 2 116.554 2.4459952 117 3 117 L 13 117 C 13.554005 117 14 116.554 14 116 C 14 115.446 13.554005 115 13 115 L 3 115 z M 3 118 C 2.4459952 118 2 118.446 2 119 C 2 119.554 2.4459952 120 3 120 L 13 120 C 13.554005 120 14 119.554 14 119 C 14 118.446 13.554005 118 13 118 L 3 118 z M 3 121 C 2.4459952 121 2 121.446 2 122 C 2 122.554 2.4459952 123 3 123 L 13 123 C 13.554005 123 14 122.554 14 122 C 14 121.446 13.554005 121 13 121 L 3 121 z M 3 124 C 2.4459952 124 2 124.446 2 125 C 2 125.554 2.4459952 126 3 126 L 13 126 C 13.554005 126 14 125.554 14 125 C 14 124.446 13.554005 124 13 124 L 3 124 z "
+ style="fill:#000000;fill-opacity:0.23529412;stroke:none;stroke-width:1.28571427;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_bus_vu_frozen.svg b/editor/icons/source/icon_bus_vu_frozen.svg
new file mode 100644
index 0000000000..40577a1a77
--- /dev/null
+++ b/editor/icons/source/icon_bus_vu_frozen.svg
@@ -0,0 +1,111 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="128"
+ viewBox="0 0 16 128"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_vu_empty.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_bus_vu_frozen.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient959"
+ inkscape:collect="always">
+ <stop
+ style="stop-color:#62aeff;stop-opacity:1"
+ offset="0"
+ id="stop957" />
+ <stop
+ id="stop955"
+ offset="0.5"
+ style="stop-color:#75d1e6;stop-opacity:1" />
+ <stop
+ style="stop-color:#84ffee;stop-opacity:1"
+ offset="1"
+ id="stop953" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient959"
+ id="linearGradient951"
+ x1="8"
+ y1="2"
+ x2="8"
+ y2="126"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="5.6568543"
+ inkscape:cx="14.809902"
+ inkscape:cy="65.349668"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:object-nodes="false"
+ inkscape:snap-smooth-nodes="false"
+ inkscape:snap-midpoints="false"
+ inkscape:document-rotation="0">
+ <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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-924.3622)">
+ <path
+ style="fill:url(#linearGradient951);fill-opacity:1;stroke:none;stroke-width:1.28571427;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;opacity:0.7"
+ d="M 3 2 C 2.4459952 2 2 2.4459952 2 3 C 2 3.5540048 2.4459952 4 3 4 L 13 4 C 13.554005 4 14 3.5540048 14 3 C 14 2.4459952 13.554005 2 13 2 L 3 2 z M 3 5 C 2.4459952 5 2 5.4459952 2 6 C 2 6.5540048 2.4459952 7 3 7 L 13 7 C 13.554005 7 14 6.5540048 14 6 C 14 5.4459952 13.554005 5 13 5 L 3 5 z M 3 8 C 2.4459952 8 2 8.4459952 2 9 C 2 9.5540048 2.4459952 10 3 10 L 13 10 C 13.554005 10 14 9.5540048 14 9 C 14 8.4459952 13.554005 8 13 8 L 3 8 z M 3 11 C 2.4459952 11 2 11.445995 2 12 C 2 12.554005 2.4459952 13 3 13 L 13 13 C 13.554005 13 14 12.554005 14 12 C 14 11.445995 13.554005 11 13 11 L 3 11 z M 3 14 C 2.4459952 14 2 14.445995 2 15 C 2 15.554005 2.4459952 16 3 16 L 13 16 C 13.554005 16 14 15.554005 14 15 C 14 14.445995 13.554005 14 13 14 L 3 14 z M 3 17 C 2.4459952 17 2 17.445995 2 18 C 2 18.554005 2.4459952 19 3 19 L 13 19 C 13.554005 19 14 18.554005 14 18 C 14 17.445995 13.554005 17 13 17 L 3 17 z M 3 20 C 2.4459952 20 2 20.445995 2 21 C 2 21.554005 2.4459952 22 3 22 L 13 22 C 13.554005 22 14 21.554005 14 21 C 14 20.445995 13.554005 20 13 20 L 3 20 z M 3 23 C 2.4459952 23 2 23.445995 2 24 C 2 24.554005 2.4459952 25 3 25 L 13 25 C 13.554005 25 14 24.554005 14 24 C 14 23.445995 13.554005 23 13 23 L 3 23 z M 3 26 C 2.4459952 26 2 26.445995 2 27 C 2 27.554005 2.4459952 28 3 28 L 13 28 C 13.554005 28 14 27.554005 14 27 C 14 26.445995 13.554005 26 13 26 L 3 26 z M 3 31 C 2.4459952 31 2 31.445995 2 32 C 2 32.554005 2.4459952 33 3 33 L 13 33 C 13.554005 33 14 32.554005 14 32 C 14 31.445995 13.554005 31 13 31 L 3 31 z M 3 34 C 2.4459952 34 2 34.445995 2 35 C 2 35.554005 2.4459952 36 3 36 L 13 36 C 13.554005 36 14 35.554005 14 35 C 14 34.445995 13.554005 34 13 34 L 3 34 z M 3 37 C 2.4459952 37 2 37.445995 2 38 C 2 38.554005 2.4459952 39 3 39 L 13 39 C 13.554005 39 14 38.554005 14 38 C 14 37.445995 13.554005 37 13 37 L 3 37 z M 3 40 C 2.4459952 40 2 40.445995 2 41 C 2 41.554005 2.4459952 42 3 42 L 13 42 C 13.554005 42 14 41.554005 14 41 C 14 40.445995 13.554005 40 13 40 L 3 40 z M 3 43 C 2.4459952 43 2 43.445995 2 44 C 2 44.554005 2.4459952 45 3 45 L 13 45 C 13.554005 45 14 44.554005 14 44 C 14 43.445995 13.554005 43 13 43 L 3 43 z M 3 46 C 2.4459952 46 2 46.445995 2 47 C 2 47.554005 2.4459952 48 3 48 L 13 48 C 13.554005 48 14 47.554005 14 47 C 14 46.445995 13.554005 46 13 46 L 3 46 z M 3 49 C 2.4459952 49 2 49.445995 2 50 C 2 50.554005 2.4459952 51 3 51 L 13 51 C 13.554005 51 14 50.554005 14 50 C 14 49.445995 13.554005 49 13 49 L 3 49 z M 3 52 C 2.4459952 52 2 52.445995 2 53 C 2 53.554005 2.4459952 54 3 54 L 13 54 C 13.554005 54 14 53.554005 14 53 C 14 52.445995 13.554005 52 13 52 L 3 52 z M 3 55 C 2.4459952 55 2 55.445995 2 56 C 2 56.554005 2.4459952 57 3 57 L 13 57 C 13.554005 57 14 56.554005 14 56 C 14 55.445995 13.554005 55 13 55 L 3 55 z M 3 58 C 2.4459952 58 2 58.445995 2 59 C 2 59.554005 2.4459952 60 3 60 L 13 60 C 13.554005 60 14 59.554005 14 59 C 14 58.445995 13.554005 58 13 58 L 3 58 z M 3 61 C 2.4459952 61 2 61.445995 2 62 C 2 62.554005 2.4459952 63 3 63 L 13 63 C 13.554005 63 14 62.554005 14 62 C 14 61.445995 13.554005 61 13 61 L 3 61 z M 3 64 C 2.4459952 64 2 64.445995 2 65 C 2 65.554005 2.4459952 66 3 66 L 13 66 C 13.554005 66 14 65.554005 14 65 C 14 64.445995 13.554005 64 13 64 L 3 64 z M 3 67 C 2.4459952 67 2 67.445995 2 68 C 2 68.554005 2.4459952 69 3 69 L 13 69 C 13.554005 69 14 68.554005 14 68 C 14 67.445995 13.554005 67 13 67 L 3 67 z M 3 70 C 2.4459952 70 2 70.445995 2 71 C 2 71.554005 2.4459952 72 3 72 L 13 72 C 13.554005 72 14 71.554005 14 71 C 14 70.445995 13.554005 70 13 70 L 3 70 z M 3 73 C 2.4459952 73 2 73.445995 2 74 C 2 74.554005 2.4459952 75 3 75 L 13 75 C 13.554005 75 14 74.554005 14 74 C 14 73.445995 13.554005 73 13 73 L 3 73 z M 3 76 C 2.4459952 76 2 76.445995 2 77 C 2 77.554005 2.4459952 78 3 78 L 13 78 C 13.554005 78 14 77.554005 14 77 C 14 76.445995 13.554005 76 13 76 L 3 76 z M 3 79 C 2.4459952 79 2 79.445995 2 80 C 2 80.554005 2.4459952 81 3 81 L 13 81 C 13.554005 81 14 80.554005 14 80 C 14 79.445995 13.554005 79 13 79 L 3 79 z M 3 82 C 2.4459952 82 2 82.445995 2 83 C 2 83.554005 2.4459952 84 3 84 L 13 84 C 13.554005 84 14 83.554005 14 83 C 14 82.445995 13.554005 82 13 82 L 3 82 z M 3 85 C 2.4459952 85 2 85.445995 2 86 C 2 86.554005 2.4459952 87 3 87 L 13 87 C 13.554005 87 14 86.554005 14 86 C 14 85.445995 13.554005 85 13 85 L 3 85 z M 3 88 C 2.4459952 88 2 88.445995 2 89 C 2 89.554005 2.4459952 90 3 90 L 13 90 C 13.554005 90 14 89.554005 14 89 C 14 88.445995 13.554005 88 13 88 L 3 88 z M 3 91 C 2.4459952 91 2 91.445995 2 92 C 2 92.554005 2.4459952 93 3 93 L 13 93 C 13.554005 93 14 92.554005 14 92 C 14 91.445995 13.554005 91 13 91 L 3 91 z M 3 94 C 2.4459952 94 2 94.445995 2 95 C 2 95.554005 2.4459952 96 3 96 L 13 96 C 13.554005 96 14 95.554005 14 95 C 14 94.445995 13.554005 94 13 94 L 3 94 z M 3 97 C 2.4459952 97 2 97.445995 2 98 C 2 98.554005 2.4459952 99 3 99 L 13 99 C 13.554005 99 14 98.554005 14 98 C 14 97.445995 13.554005 97 13 97 L 3 97 z M 3 100 C 2.4459952 100 2 100.446 2 101 C 2 101.554 2.4459952 102 3 102 L 13 102 C 13.554005 102 14 101.554 14 101 C 14 100.446 13.554005 100 13 100 L 3 100 z M 3 103 C 2.4459952 103 2 103.446 2 104 C 2 104.554 2.4459952 105 3 105 L 13 105 C 13.554005 105 14 104.554 14 104 C 14 103.446 13.554005 103 13 103 L 3 103 z M 3 106 C 2.4459952 106 2 106.446 2 107 C 2 107.554 2.4459952 108 3 108 L 13 108 C 13.554005 108 14 107.554 14 107 C 14 106.446 13.554005 106 13 106 L 3 106 z M 3 109 C 2.4459952 109 2 109.446 2 110 C 2 110.554 2.4459952 111 3 111 L 13 111 C 13.554005 111 14 110.554 14 110 C 14 109.446 13.554005 109 13 109 L 3 109 z M 3 112 C 2.4459952 112 2 112.446 2 113 C 2 113.554 2.4459952 114 3 114 L 13 114 C 13.554005 114 14 113.554 14 113 C 14 112.446 13.554005 112 13 112 L 3 112 z M 3 115 C 2.4459952 115 2 115.446 2 116 C 2 116.554 2.4459952 117 3 117 L 13 117 C 13.554005 117 14 116.554 14 116 C 14 115.446 13.554005 115 13 115 L 3 115 z M 3 118 C 2.4459952 118 2 118.446 2 119 C 2 119.554 2.4459952 120 3 120 L 13 120 C 13.554005 120 14 119.554 14 119 C 14 118.446 13.554005 118 13 118 L 3 118 z M 3 121 C 2.4459952 121 2 121.446 2 122 C 2 122.554 2.4459952 123 3 123 L 13 123 C 13.554005 123 14 122.554 14 122 C 14 121.446 13.554005 121 13 121 L 3 121 z M 3 124 C 2.4459952 124 2 124.446 2 125 C 2 125.554 2.4459952 126 3 126 L 13 126 C 13.554005 126 14 125.554 14 125 C 14 124.446 13.554005 124 13 124 L 3 124 z "
+ id="rect852"
+ transform="translate(0,924.3622)" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_bus_vu_full.svg b/editor/icons/source/icon_bus_vu_full.svg
new file mode 100644
index 0000000000..7f2fd22560
--- /dev/null
+++ b/editor/icons/source/icon_bus_vu_full.svg
@@ -0,0 +1,110 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="128"
+ viewBox="0 0 16 128"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_vu_empty.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_bus_vu_full.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient959"
+ inkscape:collect="always">
+ <stop
+ style="stop-color:#ff8484;stop-opacity:1"
+ offset="0"
+ id="stop957" />
+ <stop
+ id="stop955"
+ offset="0.5"
+ style="stop-color:#e1dc7a;stop-opacity:1" />
+ <stop
+ style="stop-color:#84ffb1;stop-opacity:1"
+ offset="1"
+ id="stop953" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient959"
+ id="linearGradient951"
+ x1="8"
+ y1="2"
+ x2="8"
+ y2="126"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="5.6568543"
+ inkscape:cx="1.8206711"
+ inkscape:cy="73.901674"
+ 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="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:object-nodes="false"
+ inkscape:snap-smooth-nodes="false"
+ inkscape:snap-midpoints="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,-924.3622)">
+ <path
+ style="fill:url(#linearGradient951);fill-opacity:1;stroke:none;stroke-width:1.28571427;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 3 2 C 2.4459952 2 2 2.4459952 2 3 C 2 3.5540048 2.4459952 4 3 4 L 13 4 C 13.554005 4 14 3.5540048 14 3 C 14 2.4459952 13.554005 2 13 2 L 3 2 z M 3 5 C 2.4459952 5 2 5.4459952 2 6 C 2 6.5540048 2.4459952 7 3 7 L 13 7 C 13.554005 7 14 6.5540048 14 6 C 14 5.4459952 13.554005 5 13 5 L 3 5 z M 3 8 C 2.4459952 8 2 8.4459952 2 9 C 2 9.5540048 2.4459952 10 3 10 L 13 10 C 13.554005 10 14 9.5540048 14 9 C 14 8.4459952 13.554005 8 13 8 L 3 8 z M 3 11 C 2.4459952 11 2 11.445995 2 12 C 2 12.554005 2.4459952 13 3 13 L 13 13 C 13.554005 13 14 12.554005 14 12 C 14 11.445995 13.554005 11 13 11 L 3 11 z M 3 14 C 2.4459952 14 2 14.445995 2 15 C 2 15.554005 2.4459952 16 3 16 L 13 16 C 13.554005 16 14 15.554005 14 15 C 14 14.445995 13.554005 14 13 14 L 3 14 z M 3 17 C 2.4459952 17 2 17.445995 2 18 C 2 18.554005 2.4459952 19 3 19 L 13 19 C 13.554005 19 14 18.554005 14 18 C 14 17.445995 13.554005 17 13 17 L 3 17 z M 3 20 C 2.4459952 20 2 20.445995 2 21 C 2 21.554005 2.4459952 22 3 22 L 13 22 C 13.554005 22 14 21.554005 14 21 C 14 20.445995 13.554005 20 13 20 L 3 20 z M 3 23 C 2.4459952 23 2 23.445995 2 24 C 2 24.554005 2.4459952 25 3 25 L 13 25 C 13.554005 25 14 24.554005 14 24 C 14 23.445995 13.554005 23 13 23 L 3 23 z M 3 26 C 2.4459952 26 2 26.445995 2 27 C 2 27.554005 2.4459952 28 3 28 L 13 28 C 13.554005 28 14 27.554005 14 27 C 14 26.445995 13.554005 26 13 26 L 3 26 z M 3 31 C 2.4459952 31 2 31.445995 2 32 C 2 32.554005 2.4459952 33 3 33 L 13 33 C 13.554005 33 14 32.554005 14 32 C 14 31.445995 13.554005 31 13 31 L 3 31 z M 3 34 C 2.4459952 34 2 34.445995 2 35 C 2 35.554005 2.4459952 36 3 36 L 13 36 C 13.554005 36 14 35.554005 14 35 C 14 34.445995 13.554005 34 13 34 L 3 34 z M 3 37 C 2.4459952 37 2 37.445995 2 38 C 2 38.554005 2.4459952 39 3 39 L 13 39 C 13.554005 39 14 38.554005 14 38 C 14 37.445995 13.554005 37 13 37 L 3 37 z M 3 40 C 2.4459952 40 2 40.445995 2 41 C 2 41.554005 2.4459952 42 3 42 L 13 42 C 13.554005 42 14 41.554005 14 41 C 14 40.445995 13.554005 40 13 40 L 3 40 z M 3 43 C 2.4459952 43 2 43.445995 2 44 C 2 44.554005 2.4459952 45 3 45 L 13 45 C 13.554005 45 14 44.554005 14 44 C 14 43.445995 13.554005 43 13 43 L 3 43 z M 3 46 C 2.4459952 46 2 46.445995 2 47 C 2 47.554005 2.4459952 48 3 48 L 13 48 C 13.554005 48 14 47.554005 14 47 C 14 46.445995 13.554005 46 13 46 L 3 46 z M 3 49 C 2.4459952 49 2 49.445995 2 50 C 2 50.554005 2.4459952 51 3 51 L 13 51 C 13.554005 51 14 50.554005 14 50 C 14 49.445995 13.554005 49 13 49 L 3 49 z M 3 52 C 2.4459952 52 2 52.445995 2 53 C 2 53.554005 2.4459952 54 3 54 L 13 54 C 13.554005 54 14 53.554005 14 53 C 14 52.445995 13.554005 52 13 52 L 3 52 z M 3 55 C 2.4459952 55 2 55.445995 2 56 C 2 56.554005 2.4459952 57 3 57 L 13 57 C 13.554005 57 14 56.554005 14 56 C 14 55.445995 13.554005 55 13 55 L 3 55 z M 3 58 C 2.4459952 58 2 58.445995 2 59 C 2 59.554005 2.4459952 60 3 60 L 13 60 C 13.554005 60 14 59.554005 14 59 C 14 58.445995 13.554005 58 13 58 L 3 58 z M 3 61 C 2.4459952 61 2 61.445995 2 62 C 2 62.554005 2.4459952 63 3 63 L 13 63 C 13.554005 63 14 62.554005 14 62 C 14 61.445995 13.554005 61 13 61 L 3 61 z M 3 64 C 2.4459952 64 2 64.445995 2 65 C 2 65.554005 2.4459952 66 3 66 L 13 66 C 13.554005 66 14 65.554005 14 65 C 14 64.445995 13.554005 64 13 64 L 3 64 z M 3 67 C 2.4459952 67 2 67.445995 2 68 C 2 68.554005 2.4459952 69 3 69 L 13 69 C 13.554005 69 14 68.554005 14 68 C 14 67.445995 13.554005 67 13 67 L 3 67 z M 3 70 C 2.4459952 70 2 70.445995 2 71 C 2 71.554005 2.4459952 72 3 72 L 13 72 C 13.554005 72 14 71.554005 14 71 C 14 70.445995 13.554005 70 13 70 L 3 70 z M 3 73 C 2.4459952 73 2 73.445995 2 74 C 2 74.554005 2.4459952 75 3 75 L 13 75 C 13.554005 75 14 74.554005 14 74 C 14 73.445995 13.554005 73 13 73 L 3 73 z M 3 76 C 2.4459952 76 2 76.445995 2 77 C 2 77.554005 2.4459952 78 3 78 L 13 78 C 13.554005 78 14 77.554005 14 77 C 14 76.445995 13.554005 76 13 76 L 3 76 z M 3 79 C 2.4459952 79 2 79.445995 2 80 C 2 80.554005 2.4459952 81 3 81 L 13 81 C 13.554005 81 14 80.554005 14 80 C 14 79.445995 13.554005 79 13 79 L 3 79 z M 3 82 C 2.4459952 82 2 82.445995 2 83 C 2 83.554005 2.4459952 84 3 84 L 13 84 C 13.554005 84 14 83.554005 14 83 C 14 82.445995 13.554005 82 13 82 L 3 82 z M 3 85 C 2.4459952 85 2 85.445995 2 86 C 2 86.554005 2.4459952 87 3 87 L 13 87 C 13.554005 87 14 86.554005 14 86 C 14 85.445995 13.554005 85 13 85 L 3 85 z M 3 88 C 2.4459952 88 2 88.445995 2 89 C 2 89.554005 2.4459952 90 3 90 L 13 90 C 13.554005 90 14 89.554005 14 89 C 14 88.445995 13.554005 88 13 88 L 3 88 z M 3 91 C 2.4459952 91 2 91.445995 2 92 C 2 92.554005 2.4459952 93 3 93 L 13 93 C 13.554005 93 14 92.554005 14 92 C 14 91.445995 13.554005 91 13 91 L 3 91 z M 3 94 C 2.4459952 94 2 94.445995 2 95 C 2 95.554005 2.4459952 96 3 96 L 13 96 C 13.554005 96 14 95.554005 14 95 C 14 94.445995 13.554005 94 13 94 L 3 94 z M 3 97 C 2.4459952 97 2 97.445995 2 98 C 2 98.554005 2.4459952 99 3 99 L 13 99 C 13.554005 99 14 98.554005 14 98 C 14 97.445995 13.554005 97 13 97 L 3 97 z M 3 100 C 2.4459952 100 2 100.446 2 101 C 2 101.554 2.4459952 102 3 102 L 13 102 C 13.554005 102 14 101.554 14 101 C 14 100.446 13.554005 100 13 100 L 3 100 z M 3 103 C 2.4459952 103 2 103.446 2 104 C 2 104.554 2.4459952 105 3 105 L 13 105 C 13.554005 105 14 104.554 14 104 C 14 103.446 13.554005 103 13 103 L 3 103 z M 3 106 C 2.4459952 106 2 106.446 2 107 C 2 107.554 2.4459952 108 3 108 L 13 108 C 13.554005 108 14 107.554 14 107 C 14 106.446 13.554005 106 13 106 L 3 106 z M 3 109 C 2.4459952 109 2 109.446 2 110 C 2 110.554 2.4459952 111 3 111 L 13 111 C 13.554005 111 14 110.554 14 110 C 14 109.446 13.554005 109 13 109 L 3 109 z M 3 112 C 2.4459952 112 2 112.446 2 113 C 2 113.554 2.4459952 114 3 114 L 13 114 C 13.554005 114 14 113.554 14 113 C 14 112.446 13.554005 112 13 112 L 3 112 z M 3 115 C 2.4459952 115 2 115.446 2 116 C 2 116.554 2.4459952 117 3 117 L 13 117 C 13.554005 117 14 116.554 14 116 C 14 115.446 13.554005 115 13 115 L 3 115 z M 3 118 C 2.4459952 118 2 118.446 2 119 C 2 119.554 2.4459952 120 3 120 L 13 120 C 13.554005 120 14 119.554 14 119 C 14 118.446 13.554005 118 13 118 L 3 118 z M 3 121 C 2.4459952 121 2 121.446 2 122 C 2 122.554 2.4459952 123 3 123 L 13 123 C 13.554005 123 14 122.554 14 122 C 14 121.446 13.554005 121 13 121 L 3 121 z M 3 124 C 2.4459952 124 2 124.446 2 125 C 2 125.554 2.4459952 126 3 126 L 13 126 C 13.554005 126 14 125.554 14 125 C 14 124.446 13.554005 124 13 124 L 3 124 z "
+ transform="translate(0,924.3622)"
+ id="rect852" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_button.svg b/editor/icons/source/icon_button.svg
index 54644ecb9b..f095b169ca 100644
--- a/editor/icons/source/icon_button.svg
+++ b/editor/icons/source/icon_button.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_button.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="45.254834"
- inkscape:cx="6.249456"
- inkscape:cy="9.3054468"
+ inkscape:zoom="32"
+ inkscape:cx="9.0492367"
+ inkscape:cy="8.5595615"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -60,7 +60,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,26 +69,40 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
- <path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 1 3 L 1 11 L 15 11 L 15 3 L 1 3 z M 4 5 L 7 5 L 7 9 L 4 9 L 4 5 z M 9 5 L 10 5 L 10 6 L 11 6 L 11 5 L 12 5 L 12 6 L 11 6 L 11 7 L 12 7 L 12 9 L 11 9 L 11 7 L 10 7 L 10 9 L 9 9 L 9 5 z M 5 6 L 5 8 L 6 8 L 6 6 L 5 6 z "
- transform="translate(0,1036.3622)"
- id="rect4139" />
<rect
- transform="scale(1,-1)"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4160"
- width="14"
- height="2.0000522"
- x="1"
- y="-1049.3622" />
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect829"
+ width="8"
+ height="4.0000172"
+ x="4"
+ y="1045.3622"
+ ry="1.5" />
+ <rect
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:1.92153788;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect825"
+ width="12"
+ height="2"
+ x="2"
+ y="1048.3622"
+ ry="0" />
<rect
- y="-1049.3622"
- x="1"
- height="2.0000522"
- width="14"
- id="rect4142"
- style="opacity:1;fill:#000000;fill-opacity:0.07843138;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- transform="scale(1,-1)" />
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect827"
+ width="8"
+ height="2"
+ x="4"
+ y="1047.3622"
+ ry="0" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 5,1040.3622 3,2 3,-2"
+ id="path831"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 8,1037.3622 v 5"
+ id="path833"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
</g>
</svg>
diff --git a/editor/icons/source/icon_button_group.svg b/editor/icons/source/icon_button_group.svg
index 9d5df99deb..d1433634df 100644
--- a/editor/icons/source/icon_button_group.svg
+++ b/editor/icons/source/icon_button_group.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_button_group.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="3.5392558"
- inkscape:cy="8.9453899"
+ inkscape:cx="10.59901"
+ inkscape:cy="8.8192036"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -69,110 +69,10 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4172"
- width="1"
- height="10"
- x="0"
- y="1039.3622" />
- <rect
- y="1039.3622"
- x="15"
- height="10"
- width="1"
- id="rect4174"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="path4176"
- sodipodi:type="arc"
- sodipodi:cx="1"
- sodipodi:cy="1049.3622"
- sodipodi:rx="1"
- sodipodi:ry="1"
- sodipodi:start="0"
- sodipodi:end="4.712389"
- d="m 2,1049.3622 a 1,1 0 0 1 -0.6173166,0.9239 1,1 0 0 1 -1.08979019,-0.2168 1,1 0 0 1 -0.21677274,-1.0898 A 1,1 0 0 1 1,1048.3622 l 0,1 z" />
- <rect
- y="-15"
- x="1049.3622"
- height="14"
- width="1"
- id="rect4178"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- transform="matrix(0,1,-1,0,0,0)" />
- <path
- d="m -14,1049.3622 a 1,1 0 0 1 -0.617317,0.9239 1,1 0 0 1 -1.08979,-0.2168 1,1 0 0 1 -0.216773,-1.0898 1,1 0 0 1 0.92388,-0.6173 l 0,1 z"
- sodipodi:end="4.712389"
- sodipodi:start="0"
- sodipodi:ry="1"
- sodipodi:rx="1"
- sodipodi:cy="1049.3622"
- sodipodi:cx="-15"
- sodipodi:type="arc"
- id="path4180"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- transform="scale(-1,1)" />
- <path
- d="m 2,-1039.3622 a 1,1 0 0 1 -0.6173166,0.9239 1,1 0 0 1 -1.08979019,-0.2168 1,1 0 0 1 -0.21677274,-1.0898 A 1,1 0 0 1 1,-1040.3622 l 0,1 z"
- sodipodi:end="4.712389"
- sodipodi:start="0"
- sodipodi:ry="1"
- sodipodi:rx="1"
- sodipodi:cy="-1039.3622"
- sodipodi:cx="1"
- sodipodi:type="arc"
- id="path4182"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- transform="scale(1,-1)" />
- <path
- transform="scale(-1,-1)"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="path4184"
- sodipodi:type="arc"
- sodipodi:cx="-15"
- sodipodi:cy="-1039.3622"
- sodipodi:rx="1"
- sodipodi:ry="1"
- sodipodi:start="0"
- sodipodi:end="4.712389"
- d="m -14,-1039.3622 a 1,1 0 0 1 -0.617317,0.9239 1,1 0 0 1 -1.08979,-0.2168 1,1 0 0 1 -0.216773,-1.0898 1,1 0 0 1 0.92388,-0.6173 l 0,1 z" />
- <rect
- transform="matrix(0,1,-1,0,0,0)"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4186"
- width="1"
- height="14"
- x="1038.3622"
- y="-15" />
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4188"
- width="4"
- height="6.0000172"
- x="3"
- y="1041.3622" />
- <rect
- y="1041.3622"
- x="9"
- height="6.0000172"
- width="4"
- id="rect4190"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <rect
- y="1045.3622"
- x="3"
- height="1.9999998"
- width="4"
- id="rect4192"
- style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <rect
- style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4194"
- width="4"
- height="1.9999998"
- x="9"
- y="1045.3622" />
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 4 1 C 3.446 1 3 1.446 3 2 L 3 14 C 3 14.554 3.446 15 4 15 L 12 15 C 12.554 15 13 14.554 13 14 L 13 2 C 13 1.446 12.554 1 12 1 L 4 1 z M 5 2 L 7 2 C 7.554 2 8 2.446 8 3 C 8 3.554 7.554 4 7 4 L 5 4 C 4.446 4 4 3.554 4 3 C 4 2.446 4.446 2 5 2 z M 11 2 C 11.552285 2 12 2.4477153 12 3 C 12 3.5522847 11.552285 4 11 4 C 10.447715 4 10 3.5522847 10 3 C 10 2.4477153 10.447715 2 11 2 z M 6 6 A 2 2 0 0 1 8 8 A 2 2 0 0 1 6 10 A 2 2 0 0 1 4 8 A 2 2 0 0 1 6 6 z M 11 6 C 11.552285 6 12 6.4477153 12 7 C 12 7.5522847 11.552285 8 11 8 C 10.447715 8 10 7.5522847 10 7 C 10 6.4477153 10.447715 6 11 6 z M 11 10 C 11.552285 10 12 10.447715 12 11 C 12 11.552285 11.552285 12 11 12 C 10.447715 12 10 11.552285 10 11 C 10 10.447715 10.447715 10 11 10 z M 4 12 L 5 12 L 5 14 L 4 14 L 4 12 z M 6 12 L 7 12 L 7 14 L 6 14 L 6 12 z M 8 12 L 9 12 L 9 14 L 8 14 L 8 12 z "
+ transform="translate(0,1036.3622)"
+ id="rect4500" />
</g>
</svg>
diff --git a/editor/icons/source/icon_capsule_mesh.svg b/editor/icons/source/icon_capsule_mesh.svg
new file mode 100644
index 0000000000..38975b3d25
--- /dev/null
+++ b/editor/icons/source/icon_capsule_mesh.svg
@@ -0,0 +1,93 @@
+<?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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_capsule_mesh.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="10.821682"
+ inkscape:cy="9.8571693"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
+ <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)">
+ <rect
+ style="fill:none;stroke:#ffd684;stroke-width:1.93995905;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4266"
+ width="8"
+ height="11.999983"
+ x="4"
+ y="1038.3622"
+ ry="4" />
+ <path
+ style="fill:none;stroke:#ffd684;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 4,1044.3622 c 2.7376816,1.306 5.3946358,1.3618 8,0"
+ id="path4268"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#ffd684;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 8,1038.3622 v 12"
+ id="path4270"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_color_rect.svg b/editor/icons/source/icon_color_rect.svg
index 76bf6596a9..f352c5552a 100644
--- a/editor/icons/source/icon_color_rect.svg
+++ b/editor/icons/source/icon_color_rect.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -66,8 +66,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="9.9050022"
- inkscape:cy="11.383887"
+ inkscape:cx="9.1237522"
+ inkscape:cy="7.790137"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -79,8 +79,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -99,7 +99,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -109,46 +109,46 @@
id="layer1"
transform="translate(0,-1036.3622)">
<rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4154"
- width="1"
+ width="2"
height="14"
x="1"
y="1037.3622" />
<rect
- y="1050.3622"
+ y="1049.3622"
x="1"
- height="0.9999826"
+ height="1.9999652"
width="14"
id="rect4156"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82846403;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4158"
width="14"
- height="0.9999826"
+ height="2.0000174"
x="1"
y="1037.3622" />
<rect
y="1037.3622"
- x="14"
+ x="13"
height="14"
- width="1"
+ width="2"
id="rect4160"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
- style="fill:#70bfff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
- d="m 13,1049.3622 -6,0 6,-6 z"
+ style="fill:#70bfff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 12,1048.3622 H 7.2 l 4.8,-4.8 z"
id="path4168"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path4170"
- d="m 3,1039.3622 6,0 -6,6 z"
- style="fill:#ff7070;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ d="m 4,1040.3622 h 4.8 l -4.8,4.8 z"
+ style="fill:#ff7070;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
- style="fill:#7aff70;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="m 3,1049.3622 0,-4 6,-6 4,0 0,4 -6,6 z"
+ style="fill:#7aff70;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 4,1048.3622 v -3.2 l 4.8,-4.8 H 12 v 3.2 l -4.8,4.8 z"
id="path4172"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
diff --git a/editor/icons/source/icon_confirmation_dialog.svg b/editor/icons/source/icon_confirmation_dialog.svg
index 49dbc21e92..52cdf7618e 100644
--- a/editor/icons/source/icon_confirmation_dialog.svg
+++ b/editor/icons/source/icon_confirmation_dialog.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_confirmation_dialog.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="16"
- inkscape:cx="7.6980886"
- inkscape:cy="13.203824"
+ inkscape:zoom="32"
+ inkscape:cx="8.6970479"
+ inkscape:cy="7.4854117"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -70,7 +70,7 @@
transform="translate(0,-1036.3622)">
<path
style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 3 1 C 1.89543 1 1 1.8954 1 3 L 1 4 L 15 4 L 15 3 C 15 1.8954 14.104569 1 13 1 L 3 1 z M 12 2 L 13 2 L 13 3 L 12 3 L 12 2 z M 1 5 L 1 13 C 1 14.1046 1.89543 15 3 15 L 13 15 C 14.104569 15 15 14.1046 15 13 L 15 5 L 1 5 z M 2.5859375 8.8789062 L 4 10.292969 L 5.4140625 8.8789062 L 6.1210938 9.5859375 L 4.7070312 11 L 6.1210938 12.414062 L 5.4140625 13.121094 L 4 11.707031 L 2.5859375 13.121094 L 1.8789062 12.414062 L 3.2929688 11 L 1.8789062 9.5859375 L 2.5859375 8.8789062 z M 12.949219 8.8789062 L 13.65625 9.5859375 L 10.828125 12.414062 L 10.121094 13.121094 L 9.4140625 12.414062 L 8 11 L 8.7070312 10.292969 L 10.121094 11.707031 L 12.949219 8.8789062 z "
+ d="M 3 1 C 1.89543 1 1 1.8954 1 3 L 1 4 L 15 4 L 15 3 C 15 1.8954 14.104569 1 13 1 L 3 1 z M 12 2 L 13 2 L 13 3 L 12 3 L 12 2 z M 1 5 L 1 13 C 1 14.1046 1.89543 15 3 15 L 13 15 C 14.104569 15 15 14.1046 15 13 L 15 5 L 1 5 z M 7.9863281 6.0019531 C 8.3332141 5.9996687 8.6849305 6.0577156 9.0253906 6.1816406 C 10.387231 6.6772406 11.206736 8.0942844 10.955078 9.5214844 C 10.764025 10.604982 9.9933535 11.46759 9 11.822266 L 9 12 L 8 12 L 7 12 L 7 11.158203 A 1.0001 1.0001 0 0 1 8 10 C 8.4919343 10 8.898952 9.6582281 8.984375 9.1738281 C 9.0697985 8.6893281 8.8040639 8.2287469 8.3417969 8.0605469 C 7.8795298 7.8922469 7.3807328 8.074 7.1347656 8.5 A 1.0001606 1.0001606 0 0 1 5.4023438 7.5 C 5.9458088 6.558525 6.9456702 6.0088063 7.9863281 6.0019531 z M 7 13 L 9 13 L 9 14 L 7 14 L 7 13 z "
transform="translate(0,1036.3622)"
id="rect4140" />
</g>
diff --git a/editor/icons/source/icon_connect.svg b/editor/icons/source/icon_connect.svg
index 745d3cc436..15c8b481a1 100644
--- a/editor/icons/source/icon_connect.svg
+++ b/editor/icons/source/icon_connect.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92+devel unknown"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="22.627418"
- inkscape:cx="0.78663326"
- inkscape:cy="12.940707"
+ inkscape:zoom="32.000001"
+ inkscape:cx="13.864856"
+ inkscape:cy="7.2235346"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -46,7 +46,8 @@
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
- inkscape:window-maximized="1">
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
<inkscape:grid
type="xygrid"
id="grid3336" />
@@ -68,10 +69,37 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
+ <circle
+ style="fill:#e0e0e0;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
+ id="path4266"
+ cx="4"
+ cy="1048.3622"
+ r="2" />
<path
- style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 7 2 A 2 2 0 0 0 5 4 L 5 7 L 1 7 L 1 9 L 5 9 L 5 12 A 2 2 0 0 0 7 14 L 11 14 L 11 12 L 14 12 L 14 10 L 11 10 L 11 6 L 14 6 L 14 4 L 11 4 L 11 2 L 7 2 z "
- transform="translate(0,1036.3622)"
- id="rect4155" />
+ id="circle4268"
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc"
+ sodipodi:cx="4"
+ sodipodi:cy="1048.3622"
+ sodipodi:rx="5"
+ sodipodi:ry="5"
+ sodipodi:start="4.712389"
+ sodipodi:end="0"
+ sodipodi:arc-type="arc"
+ d="M 4.0000001,1043.3622 A 5,5 0 0 1 9,1048.3622"
+ sodipodi:open="true" />
+ <path
+ id="circle4270"
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc"
+ sodipodi:cx="4"
+ sodipodi:cy="1048.3622"
+ sodipodi:rx="9"
+ sodipodi:ry="9"
+ sodipodi:start="4.712389"
+ sodipodi:end="0"
+ sodipodi:open="true"
+ sodipodi:arc-type="arc"
+ d="m 4.0000002,1039.3622 a 9,9 0 0 1 8.9999998,9" />
</g>
</svg>
diff --git a/editor/icons/source/icon_copy_node_path.svg b/editor/icons/source/icon_copy_node_path.svg
index 9f33c5e54d..abc93eb003 100644
--- a/editor/icons/source/icon_copy_node_path.svg
+++ b/editor/icons/source/icon_copy_node_path.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/godotengine/godot/tools/editor/icons/con_script_create.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -39,8 +39,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="21.189633"
- inkscape:cx="12.640765"
- inkscape:cy="9.6848443"
+ inkscape:cx="-1.3283302"
+ inkscape:cy="8.1746718"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -52,8 +52,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -73,7 +73,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -90,7 +90,7 @@
ry="1.0000174"
rx="1" />
<path
- style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:0.78431374;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 2 1 C 1.4477381 1.0001 1.0000552 1.4477 1 2 L 1 14 C 1.0000552 14.5523 1.4477381 14.9999 2 15 L 14 15 C 14.552262 14.9999 14.999945 14.5523 15 14 L 15 6 L 10 1 L 2 1 z M 3 3 L 9 3 L 9 6 C 9 6.554 9.4459905 7 10 7 L 13 7 L 13 13 L 3 13 L 3 3 z M 6 8 L 4 12 L 6 12 L 8 8 L 6 8 z M 10 8 L 8 12 L 10 12 L 12 8 L 10 8 z "
transform="translate(0,1036.3622)"
id="rect4178" />
diff --git a/editor/icons/source/icon_cube_mesh.svg b/editor/icons/source/icon_cube_mesh.svg
new file mode 100644
index 0000000000..1506b3e434
--- /dev/null
+++ b/editor/icons/source/icon_cube_mesh.svg
@@ -0,0 +1,87 @@
+<?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 14.999999 14.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_cube_mesh.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254834"
+ inkscape:cx="10.638124"
+ inkscape:cy="7.9587327"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:object-nodes="false"
+ inkscape:snap-smooth-nodes="false"
+ inkscape:snap-midpoints="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ originx="0"
+ originy="0"
+ spacingx="0.93749994"
+ spacingy="0.93749994" />
+ </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,-1037.3622)">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffd684;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.7735548;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 7.4999994,1038.1958 -6.56249953,3.2804 v 6.772 l 0.49015243,0.246 6.0723471,3.0344 6.5624996,-3.2804 v -6.772 z m 0,1.9831 3.6925976,1.8463 -3.6925977,1.8463 -3.6925967,-1.8463 z m -4.7889446,3.2804 3.9021671,1.9502 v 3.6944 l -3.9021671,-1.952 z m 9.5778892,0 v 3.6926 l -3.9021673,1.952 v -3.6944 z"
+ id="path4298"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_sample_player_2d.svg b/editor/icons/source/icon_curve.svg
index 33a7eba019..a58e08d950 100644
--- a/editor/icons/source/icon_sample_player_2d.svg
+++ b/editor/icons/source/icon_curve.svg
@@ -14,11 +14,11 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92+devel unknown"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_sample_player_2d.svg">
+ sodipodi:docname="icon_curve.svg">
<defs
id="defs4" />
<sodipodi:namedview
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="31.999999"
- inkscape:cx="8.6950163"
- inkscape:cy="7.1009775"
+ inkscape:zoom="32"
+ inkscape:cx="7.6124179"
+ inkscape:cy="9.8854217"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -46,7 +46,8 @@
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
- inkscape:window-maximized="1">
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
<inkscape:grid
type="xygrid"
id="grid3336"
@@ -70,9 +71,15 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#a5b7f7;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- d="M 8 1 L 4 6 L 1 6 L 1 10 L 4 10 L 8 15 L 8 1 z M 13 3 L 13 13 L 14 13 L 14 3 L 13 3 z M 10 6 L 10 11 L 11 11 L 11 6 L 10 6 z "
- transform="translate(0,1036.3622)"
- id="rect4154" />
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:0.32549021;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 2,1038.3622 v 12 h 12"
+ id="path4289"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 2,1050.3622 c 8,0 12,-4 12,-12"
+ id="path4285"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
</g>
</svg>
diff --git a/editor/icons/source/icon_curve_texture.svg b/editor/icons/source/icon_curve_texture.svg
new file mode 100644
index 0000000000..b1cb456608
--- /dev/null
+++ b/editor/icons/source/icon_curve_texture.svg
@@ -0,0 +1,81 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_key.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_curve_texture.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="5.2803314"
+ inkscape:cy="6.7903753"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-smooth-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
+ d="M 2 1 C 1.4477153 1 1 1.4477153 1 2 L 1 11.160156 C 1.3218501 11.050492 1.6599997 10.996335 2 11 C 2.3311746 11 2.665754 10.992098 3 10.986328 L 3 3 L 13 3 L 13 4.1347656 C 13.290071 4.0308316 13.594421 3.9722014 13.902344 3.9609375 C 14.275493 3.9481411 14.647753 4.0051061 15 4.1289062 L 15 2 C 15 1.4477153 14.552285 1 14 1 L 2 1 z M 9 5 L 9 6 L 8 6 L 8 7 L 6 7 L 6 8 L 5 8 L 5 9 L 4 9 L 4 10 L 6 10 L 8 10 L 8.390625 10 C 9.5025431 9.4332285 10.358388 8.54624 11 6.5273438 L 11 6 L 10 6 L 10 5 L 9 5 z M 13.966797 5.9882812 A 1.0001 1.0001 0 0 0 13.039062 6.7265625 C 12.111631 9.9725625 10.403509 11.409059 8.3867188 12.193359 C 6.369928 12.977659 4 13 2 13 A 1.0001 1.0001 0 1 0 2 15 C 4 15 6.6300719 15.023994 9.1132812 14.058594 C 11.596491 13.092894 13.888369 11.029391 14.960938 7.2753906 A 1.0001 1.0001 0 0 0 13.966797 5.9882812 z "
+ transform="translate(0,1036.3622)"
+ id="rect4156" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_cylinder_mesh.svg b/editor/icons/source/icon_cylinder_mesh.svg
new file mode 100644
index 0000000000..26003365bc
--- /dev/null
+++ b/editor/icons/source/icon_cylinder_mesh.svg
@@ -0,0 +1,89 @@
+<?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 14.999999 14.999999"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_cylinder_mesh.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="8.8446434"
+ inkscape:cy="10.246909"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:snap-midpoints="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ originx="0"
+ originy="0"
+ spacingx="0.93749994"
+ spacingy="0.93749994" />
+ </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,-1037.3622)">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffd684;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 8,1 C 6.2530724,1 4.6719569,1.2264786 3.4414062,1.6367188 2.8261309,1.8418388 2.2942826,2.0885933 1.8515625,2.4375 1.4088424,2.7864067 1,3.3185066 1,4 v 8 c 0,0.681493 0.4088424,1.215546 0.8515625,1.564453 0.4427201,0.348907 0.9745684,0.595768 1.5898437,0.800781 C 4.6719569,14.775474 6.2530724,15 8,15 c 1.7469276,0 3.328042,-0.224526 4.558594,-0.634766 0.615274,-0.205013 1.147122,-0.451874 1.589844,-0.800781 C 14.591158,13.215546 15,12.681493 15,12 V 4 C 15,3.3185066 14.591158,2.7864067 14.148438,2.4375 13.705716,2.0885933 13.173868,1.8418388 12.558594,1.6367188 11.328042,1.2264786 9.7469276,1 8,1 Z m 0,2 c 1.5667809,0 2.986711,0.2214496 3.927734,0.5351562 0.463676,0.1545602 0.801384,0.3374102 0.96875,0.4667969 -0.167523,0.12928 -0.505463,0.3104971 -0.96875,0.4648438 C 10.986711,4.7805036 9.5667809,5 8,5 6.4332191,5 5.0132879,4.7805036 4.0722656,4.4667969 3.6089791,4.3124502 3.271039,4.1312331 3.1035156,4.0019531 3.2708819,3.8725664 3.6085896,3.6897164 4.0722656,3.5351562 5.0132879,3.2214496 6.4332191,3 8,3 Z M 3,6.1875 C 3.1467977,6.2465706 3.2834962,6.3126178 3.4414062,6.3652344 4.6719569,6.7754744 6.2530724,7 8,7 9.7469276,7 11.328042,6.7754744 12.558594,6.3652344 12.716504,6.3126178 12.853202,6.2465706 13,6.1875 V 12 c -0.167523,0.12928 -0.608979,0.31245 -1.072266,0.466797 C 10.986711,12.780504 9.5667809,13 8,13 6.4332191,13 5.0132879,12.780504 4.0722656,12.466797 3.6089791,12.31245 3.1675234,12.12928 3,12 Z"
+ transform="matrix(0.93749994,0,0,0.93749994,0,1037.3622)"
+ id="path4385"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="sssssscsccsscssscccscccsccsccccsccc" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_debug.svg b/editor/icons/source/icon_debug.svg
new file mode 100644
index 0000000000..25ca0d6a11
--- /dev/null
+++ b/editor/icons/source/icon_debug.svg
@@ -0,0 +1,143 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_debug.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="6.6351189"
+ inkscape:cy="7.5931892"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </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;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4548"
+ sodipodi:type="arc"
+ sodipodi:cx="8"
+ sodipodi:cy="-1042.3622"
+ sodipodi:rx="4"
+ sodipodi:ry="4"
+ sodipodi:start="0.78539816"
+ sodipodi:end="2.3561945"
+ d="M 10.828427,-1039.5338 A 4,4 0 0 1 8,-1038.3622 a 4,4 0 0 1 -2.8284272,-1.1716"
+ transform="scale(1,-1)"
+ sodipodi:open="true" />
+ <ellipse
+ style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.97303921"
+ id="path4491"
+ cx="8"
+ cy="1047.3572"
+ rx="3.644531"
+ ry="1.6348" />
+ <circle
+ style="fill:#f0f0f0;fill-opacity:1;stroke:#4c4c4c;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.78431373"
+ id="path4493"
+ cx="8"
+ cy="1047.3622"
+ r="3.9999993" />
+ <path
+ style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 5,1047.3622 H 2"
+ id="path4495"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 10,1047.3622 h 4"
+ id="path4497"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 6,1045.3572 c -2,0 -3,-2 -3,-3"
+ id="path4499"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 10,1045.3572 c 2,0 3,-2 3,-3"
+ id="path4501"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 6,1049.3572 c -1,0 -2,1 -3,2"
+ id="path4503"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 10,1049.3572 c 1,0 2,1 3,2"
+ id="path4505"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <circle
+ style="fill:#f0f0f0;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.78431373"
+ id="path4508"
+ cx="8"
+ cy="1043.3622"
+ r="2" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_edit_resource.svg b/editor/icons/source/icon_edit_resource.svg
index 1950988ca2..7f6516eb58 100644
--- a/editor/icons/source/icon_edit_resource.svg
+++ b/editor/icons/source/icon_edit_resource.svg
@@ -14,7 +14,7 @@
viewBox="0 0 8 8"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="63.999997"
- inkscape:cx="1.8775976"
- inkscape:cy="5.2018914"
+ inkscape:cx="2.7141614"
+ inkscape:cy="4.341677"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -73,9 +73,9 @@
id="layer1"
transform="translate(0,-1044.3622)">
<path
- style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
- d="m 1.9472656,1044.3555 a 1.0001,1.0001 0 0 0 -0.546875,1.8066 l 2.9335938,2.2012 -2.9335938,2.1992 a 1.0001,1.0001 0 1 0 1.1992188,1.5996 l 4,-3 a 1.0001,1.0001 0 0 0 0,-1.5996 l -4,-3 a 1.0001,1.0001 0 0 0 -0.6523438,-0.207 z"
- id="path4137"
- inkscape:connector-curvature="0" />
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:0.78431373;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 3.9902344 -0.009765625 A 1.0001 1.0001 0 0 0 3.2929688 1.7070312 L 4.5859375 3 L 1 3 L 1 5 L 4.5859375 5 L 3.2929688 6.2929688 A 1.0001 1.0001 0 1 0 4.7070312 7.7070312 L 7.7070312 4.7070312 A 1.0001 1.0001 0 0 0 7.7070312 3.2929688 L 4.7070312 0.29296875 A 1.0001 1.0001 0 0 0 3.9902344 -0.009765625 z "
+ transform="translate(0,1044.3622)"
+ id="path814" />
</g>
</svg>
diff --git a/editor/icons/source/icon_editor_control_anchor.svg b/editor/icons/source/icon_editor_control_anchor.svg
new file mode 100644
index 0000000000..473b69d060
--- /dev/null
+++ b/editor/icons/source/icon_editor_control_anchor.svg
@@ -0,0 +1,98 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/gilles/godot/editor/icons/icon_editor_control_anchor.png"
+ inkscape:export-xdpi="96"
+ inkscape:export-ydpi="96"
+ sodipodi:docname="icon_editor_control_anchor.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627416"
+ inkscape:cx="0.71312079"
+ inkscape:cy="11.175116"
+ 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="1356"
+ inkscape:window-height="742"
+ inkscape:window-x="4"
+ inkscape:window-y="20"
+ inkscape:window-maximized="0"
+ inkscape:pagecheckerboard="true"
+ showguides="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="fill:#a5efac;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+ d="M 8.8320312 6.1445312 A 4 4.0000234 0 0 1 6.140625 8.8300781 L 16 16 L 8.8320312 6.1445312 z "
+ transform="translate(0,1036.3622)"
+ id="path7188" />
+ <ellipse
+ r="2"
+ style="opacity:1;fill:#6e6e6e;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="ellipse4152"
+ cx="3"
+ cy="1039.3622" />
+ <ellipse
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0.53333384;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke"
+ id="path31"
+ cx="4"
+ cy="1040.3622"
+ rx="4"
+ ry="4.0000091" />
+ <circle
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0.5333333;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke"
+ id="path31-3"
+ cx="5"
+ cy="1041.3622"
+ r="0" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_environment.svg b/editor/icons/source/icon_environment.svg
index 45add2c7f7..96d0f7e29c 100644
--- a/editor/icons/source/icon_environment.svg
+++ b/editor/icons/source/icon_environment.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/icon_node_2d.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="16"
- inkscape:cx="10.741006"
- inkscape:cy="10.690232"
+ inkscape:zoom="22.627417"
+ inkscape:cx="4.0727417"
+ inkscape:cy="8.9873869"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -64,7 +64,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -73,10 +73,29 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
+ <circle
+ style="fill:none;fill-opacity:1;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path814"
+ cx="8"
+ cy="1044.3622"
+ r="6" />
<path
- style="opacity:1;fill:#e1e1e1;fill-opacity:0.99215686;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- d="M 8 1 A 7 7 0 0 0 1 8 A 7 7 0 0 0 8 15 A 7 7 0 0 0 15 8 A 7 7 0 0 0 8 1 z M 7.0273438 2.0820312 C 6.3462908 2.6213949 5.3431503 3.5860946 4.6757812 5 L 2.8105469 5 A 6 6 0 0 1 7.0273438 2.0820312 z M 8.9785156 2.0859375 A 6 6 0 0 1 13.1875 5 L 11.324219 5 C 10.658501 3.5895934 9.6595492 2.6261235 8.9785156 2.0859375 z M 8 2.6054688 C 8.3858776 2.856627 9.3974911 3.6104334 10.185547 5 L 5.8144531 5 C 6.6025089 3.6104334 7.6141224 2.856627 8 2.6054688 z M 2.3515625 6 L 4.2949219 6 C 4.1145279 6.6059544 4 7.2695302 4 8 C 4 8.7306855 4.1144398 9.3938115 4.2949219 10 L 2.3496094 10 A 6 6 0 0 1 2 8 A 6 6 0 0 1 2.3515625 6 z M 5.3398438 6 L 10.660156 6 C 10.868048 6.5934731 11 7.2583063 11 8 C 11 8.7421382 10.866303 9.4061377 10.658203 10 L 5.3417969 10 C 5.1336971 9.4061377 5 8.7421382 5 8 C 5 7.2583063 5.1319522 6.5934731 5.3398438 6 z M 11.705078 6 L 13.650391 6 A 6 6 0 0 1 14 8 A 6 6 0 0 1 13.648438 10 L 11.705078 10 C 11.88556 9.3938115 12 8.7306855 12 8 C 12 7.2695302 11.885472 6.6059544 11.705078 6 z M 2.8125 11 L 4.6777344 11 C 5.343895 12.410381 6.3427806 13.374042 7.0234375 13.914062 A 6 6 0 0 1 2.8125 11 z M 5.8144531 11 L 10.185547 11 C 9.3971916 12.390235 8.3853773 13.145488 8 13.396484 C 7.6146227 13.145488 6.6028084 12.390235 5.8144531 11 z M 11.322266 11 L 13.189453 11 A 6 6 0 0 1 8.9707031 13.917969 C 9.651376 13.378771 10.654456 12.413873 11.322266 11 z "
- transform="translate(0,1036.3622)"
- id="path4158" />
+ style="fill:none;stroke:#e0e0e0;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 2,1044.3622 c 4.5932382,1.582 8.398513,1.0627 12,0"
+ id="path816"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ sodipodi:nodetypes="cc"
+ inkscape:connector-curvature="0"
+ id="path820"
+ d="m 8,1038.3622 c -3,4 -3,8 0,12"
+ style="fill:none;stroke:#e0e0e0;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 8,1038.3622 c 3,4 3,8 0,12"
+ id="path822"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
</g>
</svg>
diff --git a/editor/icons/source/icon_error.svg b/editor/icons/source/icon_error.svg
index a0b04a98cb..013f1c7ba9 100644
--- a/editor/icons/source/icon_error.svg
+++ b/editor/icons/source/icon_error.svg
@@ -14,7 +14,7 @@
viewBox="0 0 8 8"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="22.627416"
- inkscape:cx="5.542036"
- inkscape:cy="14.568715"
+ inkscape:zoom="45.254832"
+ inkscape:cx="0.9455546"
+ inkscape:cy="4.9546755"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -76,6 +76,6 @@
height="8"
x="2.220446e-16"
y="1044.3622"
- ry="1.0000174" />
+ ry="4" />
</g>
</svg>
diff --git a/editor/icons/source/icon_file_big.svg b/editor/icons/source/icon_file_big.svg
index 38ad9b707a..084247937b 100644
--- a/editor/icons/source/icon_file_big.svg
+++ b/editor/icons/source/icon_file_big.svg
@@ -14,7 +14,7 @@
viewBox="0 0 64 64"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_new.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="11.313708"
- inkscape:cx="32.899003"
- inkscape:cy="32.88081"
+ inkscape:zoom="8"
+ inkscape:cx="29.157928"
+ inkscape:cy="37.490712"
inkscape:document-units="px"
inkscape:current-layer="layer1-8"
showgrid="true"
@@ -42,14 +42,16 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
- inkscape:object-paths="false"
- inkscape:snap-intersection-paths="false"
- inkscape:object-nodes="false">
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true">
<inkscape:grid
type="xygrid"
id="grid3336" />
@@ -76,12 +78,10 @@
inkscape:label="Layer 1"
transform="translate(0,-1.6949463e-5)">
<path
- style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 10,5 0,54 44,0 0,-36 -18,0 0,-18 z m 31,0 0,13 13,0 z"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.58823532;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 14 5 C 11.801312 5 10 6.80131 10 9 L 10 55 C 10 57.1987 11.801312 59 14 59 L 50 59 C 52.198688 59 54 57.1987 54 55 L 54 22 L 53.992188 22 C 53.994308 21.751685 53.912915 21.499015 53.707031 21.292969 L 37.707031 5.2929688 C 37.519176 5.1060418 37.264574 5.003582 37 5.0039062 L 37 5 L 14 5 z M 14 7 L 36 7 L 36 9 L 36 19 C 36 21.1987 37.801349 23 40 23 L 50 23 L 52 23 L 52 55 C 52 56.1253 51.125282 57 50 57 L 14 57 C 12.874718 57 12 56.1253 12 55 L 12 9 C 12 7.87472 12.874718 7 14 7 z "
transform="translate(0,988.36222)"
- id="rect4158"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccccccccccc" />
+ id="rect815" />
</g>
</g>
</svg>
diff --git a/editor/icons/source/icon_file_dialog.svg b/editor/icons/source/icon_file_dialog.svg
index 9dee04c220..a3af269bee 100644
--- a/editor/icons/source/icon_file_dialog.svg
+++ b/editor/icons/source/icon_file_dialog.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_confirmation_dialog.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="16"
- inkscape:cx="2.7469423"
- inkscape:cy="8.766806"
+ inkscape:zoom="22.627417"
+ inkscape:cx="6.7929949"
+ inkscape:cy="8.3839819"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -70,8 +70,10 @@
transform="translate(0,-1036.3622)">
<path
style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 3 1 C 1.89543 1 1 1.8954 1 3 L 1 4 L 15 4 L 15 3 C 15 1.8954 14.104569 1 13 1 L 3 1 z M 12 2 L 13 2 L 13 3 L 12 3 L 12 2 z M 1 5 L 1 13 C 1 14.1046 1.89543 15 3 15 L 13 15 C 14.104569 15 15 14.1046 15 13 L 15 5 L 1 5 z M 5 7 L 8 7 L 8 8 L 11 8 L 11 13 L 5 13 L 5 7 z "
+ d="M 3,1 C 1.89543,1 1,1.8954 1,3 V 4 H 15 V 3 C 15,1.8954 14.104569,1 13,1 Z m 9,1 h 1 V 3 H 12 Z M 1,5 v 8 c 0,1.1046 0.89543,2 2,2 h 10 c 1.104569,0 2,-0.8954 2,-2 V 5 Z m 3,2 h 3 c 1,0 1,2 2,2 h 3 v 4 H 4 Z"
transform="translate(0,1036.3622)"
- id="rect4140" />
+ id="rect4140"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ssccsssccccccssssccccccccc" />
</g>
</svg>
diff --git a/editor/icons/source/icon_forward.svg b/editor/icons/source/icon_forward.svg
index f6cb351cc1..392e2bda8e 100644
--- a/editor/icons/source/icon_forward.svg
+++ b/editor/icons/source/icon_forward.svg
@@ -14,7 +14,7 @@
viewBox="0 0 8 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_bone.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,7 +29,7 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="4.4850647"
+ inkscape:cx="-1.8586853"
inkscape:cy="8.9717887"
inkscape:document-units="px"
inkscape:current-layer="layer1"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -60,7 +60,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -70,10 +70,9 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
- d="m 2.0293363,1037.3633 c 0.3235485,0.01 0.622658,0.1743 0.8027343,0.4433 l 4,6 c 0.2239059,0.3359 0.2239059,0.7735 0,1.1094 l -4,6 c -0.5489722,0.8228 -1.8316762,0.4344 -1.8320312,-0.5547 l 0,-12 c 9.424e-4,-0.5631 0.4664154,-1.0144 1.0292969,-0.998 z"
- id="path4159"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccccccc" />
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 2,1038.3622 4,6 -4,6"
+ id="path814"
+ inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_g_d_native_library.svg b/editor/icons/source/icon_g_d_native_library.svg
new file mode 100644
index 0000000000..9eae07c69b
--- /dev/null
+++ b/editor/icons/source/icon_g_d_native_library.svg
@@ -0,0 +1,83 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_g_d_script.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_g_d_native_library.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="9.2871559"
+ inkscape:cy="8.7634992"
+ 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="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 7 1 L 6.4355469 3.2578125 A 5.0000172 5.0000172 0 0 0 5.7460938 3.5371094 L 3.7578125 2.34375 L 2.34375 3.7578125 L 3.5390625 5.7519531 A 5.0000172 5.0000172 0 0 0 3.2539062 6.4375 L 1 7 L 1 9 L 3.2578125 9.5644531 A 5.0000172 5.0000172 0 0 0 3.5371094 10.251953 L 2.34375 12.242188 L 3.7578125 13.65625 L 5.7519531 12.460938 A 5.0000172 5.0000172 0 0 0 6.4375 12.746094 L 7 15 L 7 9.7304688 A 2.0000174 2.0000174 0 0 1 6 8 A 2.0000174 2.0000174 0 0 1 7 6.2714844 L 7 6 L 8 6 L 12.576172 6 A 5.0000172 5.0000172 0 0 0 12.462891 5.7480469 L 13.65625 3.7578125 L 12.242188 2.34375 L 10.248047 3.5390625 A 5.0000172 5.0000172 0 0 0 9.5625 3.2539062 L 9 1 L 7 1 z "
+ transform="translate(0,1036.3622)"
+ id="path4176" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 9,1044.3622 v 1 5 1 h 5 c 0.552285,0 1,-0.4477 1,-1 v -5 c 0,-0.5523 -0.447715,-1 -1,-1 v 4 l -1,-1 -1,1 v -4 z"
+ id="path4162"
+ sodipodi:nodetypes="ccccssscccccc" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_godot.svg b/editor/icons/source/icon_godot.svg
index 419f23125b..8f90c4c91a 100644
--- a/editor/icons/source/icon_godot.svg
+++ b/editor/icons/source/icon_godot.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92+devel unknown"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,12 +28,12 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="32"
- inkscape:cx="9.8470361"
- inkscape:cy="9.8599985"
+ inkscape:zoom="22.627417"
+ inkscape:cx="18.673414"
+ inkscape:cy="10.896798"
inkscape:document-units="px"
inkscape:current-layer="layer1"
- showgrid="false"
+ showgrid="true"
units="px"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
@@ -46,7 +46,8 @@
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
- inkscape:window-maximized="1">
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
<inkscape:grid
type="xygrid"
id="grid3336" />
@@ -59,7 +60,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
+ <dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,81 +70,88 @@
id="layer1"
transform="translate(0,-1036.3622)">
<g
- transform="matrix(0.01724138,0,0,0.01724138,-0.82758647,1035.0456)"
- id="layer1-5"
+ transform="matrix(0.01724138,0,0,0.01724138,-0.82758616,1033.7378)"
+ id="layer1-6"
inkscape:label="Layer 1">
<g
- transform="matrix(1.0688992,0,0,1.1334985,-45.061194,-81.689066)"
- id="g4149">
+ style="stroke-width:0.32031175"
+ transform="matrix(4.162611,0,0,-4.162611,919.24059,771.67186)"
+ id="g78">
<path
- style="fill:#ffffff;fill-opacity:1;stroke:none"
- d="m 116.99388,715.36604 43.13957,-74.51381 75.99672,-171.42666 271.088,-13.63746 282.06373,14.1696 138.45065,255.56931 -25.0756,66.96734 -376.12685,53.39482 -367.70391,-40.32222 z"
- id="path3239"
inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccccccccc" />
- <g
- id="g3412"
- transform="matrix(12.995388,0,0,-12.995388,898.37246,704.73082)">
- <path
- inkscape:connector-curvature="0"
- d="m 0,0 0,-3.942 c 0,-0.39 -0.25,-0.734 -0.621,-0.852 L -6.835,-6.8 c -0.273,-0.091 -0.57,-0.042 -0.8,0.128 -0.232,0.168 -0.37,0.437 -0.37,0.721 l 0,4.305 -5.818,-1.108 0,-4.381 c 0,-0.447 -0.332,-0.824 -0.775,-0.885 l -8.41,-1.152 c -0.039,-0.003 -0.081,-0.008 -0.121,-0.008 -0.214,0 -0.424,0.078 -0.588,0.22 -0.195,0.172 -0.306,0.416 -0.306,0.676 l 0,4.638 -4.341,-0.018 0,-10e-4 -0.318,10e-4 -0.319,-10e-4 0,10e-4 -4.34,0.018 0,-4.638 c 0,-0.26 -0.112,-0.504 -0.307,-0.676 -0.164,-0.142 -0.374,-0.22 -0.587,-0.22 -0.041,0 -0.082,0.005 -0.123,0.008 l -8.41,1.152 c -0.442,0.061 -0.774,0.438 -0.774,0.885 l 0,4.381 -5.819,1.108 0,-4.305 c 0,-0.284 -0.137,-0.553 -0.368,-0.721 -0.232,-0.17 -0.529,-0.219 -0.802,-0.128 l -6.215,2.006 c -0.369,0.118 -0.619,0.462 -0.619,0.852 l 0,3.942 -3.837,1.29 c -0.19,-0.811 -0.295,-1.642 -0.295,-2.481 0,-10.301 14.512,-18.252 32.448,-18.309 l 0.022,0 0.023,0 c 17.936,0.057 32.448,8.008 32.448,18.309 0,0.766 -0.088,1.521 -0.247,2.266 L 0,0 Z"
- style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none"
- id="path3414" />
- </g>
- <g
- id="g3416"
- transform="matrix(12.995388,0,0,-12.995388,140.10982,467.34929)">
- <path
- inkscape:connector-curvature="0"
- d="m 0,0 0,-16.047 2.163,-0.729 c 0.364,-0.122 0.61,-0.462 0.61,-0.847 l 0,-3.936 4.426,-1.428 0,4.154 c 0,0.27 0.118,0.52 0.323,0.689 0.206,0.172 0.474,0.241 0.739,0.192 l 7.608,-1.452 c 0.422,-0.079 0.728,-0.448 0.728,-0.877 l 0,-4.338 6.62,-0.904 0,4.509 c 0,0.241 0.096,0.467 0.264,0.635 0.167,0.166 0.394,0.259 0.633,0.259 l 0.002,0 5.551,-0.022 5.549,0.022 c 0.245,-10e-4 0.468,-0.093 0.635,-0.259 0.169,-0.168 0.264,-0.394 0.264,-0.635 l 0,-4.509 6.621,0.904 0,4.338 c 0,0.429 0.304,0.798 0.726,0.877 l 7.609,1.452 c 0.262,0.049 0.533,-0.02 0.738,-0.192 0.205,-0.169 0.325,-0.419 0.325,-0.689 l 0,-4.154 4.425,1.428 0,3.936 c 0,0.385 0.245,0.725 0.609,0.847 l 1.475,0.497 0,16.279 0.04,0 c 1.437,1.834 2.767,3.767 4.042,5.828 -1.694,2.883 -3.768,5.459 -5.986,7.846 -2.057,-1.035 -4.055,-2.208 -5.942,-3.456 -0.944,0.938 -2.008,1.706 -3.052,2.509 -1.027,0.824 -2.183,1.428 -3.281,2.132 0.327,2.433 0.489,4.828 0.554,7.327 -2.831,1.424 -5.85,2.369 -8.903,3.047 -1.219,-2.048 -2.334,-4.267 -3.304,-6.436 -1.152,0.192 -2.309,0.264 -3.467,0.277 l 0,0.002 c -0.008,0 -0.015,-0.002 -0.022,-0.002 -0.008,0 -0.015,0.002 -0.022,0.002 l 0,-0.002 c -1.16,-0.013 -2.316,-0.085 -3.468,-0.277 -0.97,2.169 -2.084,4.388 -3.305,6.436 C 19.475,24.555 16.456,23.61 13.626,22.186 13.69,19.687 13.852,17.292 14.18,14.859 13.081,14.155 11.925,13.551 10.898,12.727 9.855,11.924 8.79,11.156 7.846,10.218 5.958,11.466 3.961,12.639 1.904,13.674 -0.314,11.287 -2.388,8.711 -4.082,5.828 -2.807,3.767 -1.477,1.834 -0.04,0 L 0,0 Z"
- style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none"
- id="path3418" />
- </g>
- <g
- id="g3420"
- transform="matrix(12.995388,0,0,-12.995388,411.4457,567.42812)">
- <path
- inkscape:connector-curvature="0"
- d="m 0,0 c 0,-3.611 -2.926,-6.537 -6.537,-6.537 -3.608,0 -6.535,2.926 -6.535,6.537 0,3.609 2.927,6.533 6.535,6.533 C -2.926,6.533 0,3.609 0,0"
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
- id="path3422" />
- </g>
- <g
- id="g3424"
- transform="matrix(12.995388,0,0,-12.995388,391.00655,572.46636)">
- <path
- inkscape:connector-curvature="0"
- d="m 0,0 c 0,-2.396 -1.941,-4.337 -4.339,-4.337 -2.396,0 -4.339,1.941 -4.339,4.337 0,2.396 1.943,4.339 4.339,4.339 C -1.941,4.339 0,2.396 0,0"
- style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
- id="path3426" />
- </g>
- <g
- id="g3428"
- transform="matrix(12.995388,0,0,-12.995388,526.30933,660.10985)">
- <path
- inkscape:connector-curvature="0"
- d="m 0,0 c -1.162,0 -2.104,0.856 -2.104,1.912 l 0,6.018 c 0,1.054 0.942,1.912 2.104,1.912 1.162,0 2.106,-0.858 2.106,-1.912 l 0,-6.018 C 2.106,0.856 1.162,0 0,0"
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
- id="path3430" />
- </g>
- <g
- id="g3432"
- transform="matrix(12.995388,0,0,-12.995388,641.18731,567.42812)">
- <path
- inkscape:connector-curvature="0"
- d="m 0,0 c 0,-3.611 2.926,-6.537 6.537,-6.537 3.609,0 6.535,2.926 6.535,6.537 0,3.609 -2.926,6.533 -6.535,6.533 C 2.926,6.533 0,3.609 0,0"
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
- id="path3434" />
- </g>
- <g
- id="g3436"
- transform="matrix(12.995388,0,0,-12.995388,661.63165,572.46636)">
- <path
- inkscape:connector-curvature="0"
- d="m 0,0 c 0,-2.396 1.941,-4.337 4.336,-4.337 2.398,0 4.339,1.941 4.339,4.337 0,2.396 -1.941,4.339 -4.339,4.339 C 1.941,4.339 0,2.396 0,0"
- style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
- id="path3438" />
- </g>
+ id="path80"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ d="m 0,0 c 0,0 -0.325,1.994 -0.515,1.976 l -36.182,-3.491 c -2.879,-0.278 -5.115,-2.574 -5.317,-5.459 l -0.994,-14.247 -27.992,-1.997 -1.904,12.912 c -0.424,2.872 -2.932,5.037 -5.835,5.037 h -38.188 c -2.902,0 -5.41,-2.165 -5.834,-5.037 l -1.905,-12.912 -27.992,1.997 -0.994,14.247 c -0.202,2.886 -2.438,5.182 -5.317,5.46 l -36.2,3.49 c -0.187,0.018 -0.324,-1.978 -0.511,-1.978 l -0.049,-7.83 30.658,-4.944 1.004,-14.374 c 0.203,-2.91 2.551,-5.263 5.463,-5.472 l 38.551,-2.75 c 0.146,-0.01 0.29,-0.016 0.434,-0.016 2.897,0 5.401,2.166 5.825,5.038 l 1.959,13.286 h 28.005 l 1.959,-13.286 c 0.423,-2.871 2.93,-5.037 5.831,-5.037 0.142,0 0.284,0.005 0.423,0.015 l 38.556,2.75 c 2.911,0.209 5.26,2.562 5.463,5.472 l 1.003,14.374 30.645,4.966 z" />
+ </g>
+ <g
+ style="stroke-width:0.32031175"
+ transform="matrix(4.162611,0,0,-4.162611,104.69892,525.90697)"
+ id="g82-3">
+ <path
+ inkscape:connector-curvature="0"
+ id="path84-6"
+ style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ d="m 0,0 v -47.514 -6.035 -5.492 c 0.108,-0.001 0.216,-0.005 0.323,-0.015 l 36.196,-3.49 c 1.896,-0.183 3.382,-1.709 3.514,-3.609 l 1.116,-15.978 31.574,-2.253 2.175,14.747 c 0.282,1.912 1.922,3.329 3.856,3.329 h 38.188 c 1.933,0 3.573,-1.417 3.855,-3.329 l 2.175,-14.747 31.575,2.253 1.115,15.978 c 0.133,1.9 1.618,3.425 3.514,3.609 l 36.182,3.49 c 0.107,0.01 0.214,0.014 0.322,0.015 v 4.711 l 0.015,0.005 V 0 h 0.134 c 4.795,6.12 9.232,12.569 13.487,19.449 -5.651,9.62 -12.575,18.217 -19.976,26.182 -6.864,-3.455 -13.531,-7.369 -19.828,-11.534 -3.151,3.132 -6.7,5.694 -10.186,8.372 -3.425,2.751 -7.285,4.768 -10.946,7.118 1.09,8.117 1.629,16.108 1.846,24.448 -9.446,4.754 -19.519,7.906 -29.708,10.17 -4.068,-6.837 -7.788,-14.241 -11.028,-21.479 -3.842,0.642 -7.702,0.88 -11.567,0.926 v 0.006 c -0.027,0 -0.052,-0.006 -0.075,-0.006 -0.024,0 -0.049,0.006 -0.073,0.006 V 63.652 C 93.903,63.606 90.046,63.368 86.203,62.726 82.965,69.964 79.247,77.368 75.173,84.205 64.989,81.941 54.915,78.789 45.47,74.035 45.686,65.695 46.225,57.704 47.318,49.587 43.65,47.237 39.795,45.22 36.369,42.469 32.888,39.791 29.333,37.229 26.181,34.097 19.884,38.262 13.219,42.176 6.353,45.631 -1.048,37.666 -7.968,29.069 -13.621,19.449 -9.368,12.569 -4.928,6.12 -0.134,0 Z" />
+ </g>
+ <g
+ style="stroke-width:0.32031175"
+ transform="matrix(4.162611,0,0,-4.162611,784.07144,817.24284)"
+ id="g86-7">
+ <path
+ inkscape:connector-curvature="0"
+ id="path88-5"
+ style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ d="m 0,0 -1.121,-16.063 c -0.135,-1.936 -1.675,-3.477 -3.611,-3.616 l -38.555,-2.751 c -0.094,-0.007 -0.188,-0.01 -0.281,-0.01 -1.916,0 -3.569,1.406 -3.852,3.33 l -2.211,14.994 H -81.09 l -2.211,-14.994 c -0.297,-2.018 -2.101,-3.469 -4.133,-3.32 l -38.555,2.751 c -1.936,0.139 -3.476,1.68 -3.611,3.616 L -130.721,0 -163.268,3.138 c 0.015,-3.498 0.06,-7.33 0.06,-8.093 0,-34.374 43.605,-50.896 97.781,-51.086 h 0.066 0.067 c 54.176,0.19 97.766,16.712 97.766,51.086 0,0.777 0.047,4.593 0.063,8.093 z" />
+ </g>
+ <g
+ style="stroke-width:0.32031175"
+ transform="matrix(4.162611,0,0,-4.162611,389.21484,625.67104)"
+ id="g90-3">
+ <path
+ inkscape:connector-curvature="0"
+ id="path92-5"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ d="m 0,0 c 0,-12.052 -9.765,-21.815 -21.813,-21.815 -12.042,0 -21.81,9.763 -21.81,21.815 0,12.044 9.768,21.802 21.81,21.802 C -9.765,21.802 0,12.044 0,0" />
+ </g>
+ <g
+ style="stroke-width:0.32031175"
+ transform="matrix(4.162611,0,0,-4.162611,367.36686,631.05679)"
+ id="g94-6">
+ <path
+ inkscape:connector-curvature="0"
+ id="path96-2"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ d="m 0,0 c 0,-7.994 -6.479,-14.473 -14.479,-14.473 -7.996,0 -14.479,6.479 -14.479,14.473 0,7.994 6.483,14.479 14.479,14.479 C -6.479,14.479 0,7.994 0,0" />
+ </g>
+ <g
+ style="stroke-width:0.32031175"
+ transform="matrix(4.162611,0,0,-4.162611,511.99336,724.73954)"
+ id="g98-9">
+ <path
+ inkscape:connector-curvature="0"
+ id="path100-1"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ d="m 0,0 c -3.878,0 -7.021,2.858 -7.021,6.381 v 20.081 c 0,3.52 3.143,6.381 7.021,6.381 3.878,0 7.028,-2.861 7.028,-6.381 V 6.381 C 7.028,2.858 3.878,0 0,0" />
+ </g>
+ <g
+ style="stroke-width:0.32031175"
+ transform="matrix(4.162611,0,0,-4.162611,634.78706,625.67104)"
+ id="g102-2">
+ <path
+ inkscape:connector-curvature="0"
+ id="path104-7"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ d="m 0,0 c 0,-12.052 9.765,-21.815 21.815,-21.815 12.041,0 21.808,9.763 21.808,21.815 0,12.044 -9.767,21.802 -21.808,21.802 C 9.765,21.802 0,12.044 0,0" />
+ </g>
+ <g
+ style="stroke-width:0.32031175"
+ transform="matrix(4.162611,0,0,-4.162611,656.64056,631.05679)"
+ id="g106-0">
+ <path
+ inkscape:connector-curvature="0"
+ id="path108-9"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ d="m 0,0 c 0,-7.994 6.477,-14.473 14.471,-14.473 8.002,0 14.479,6.479 14.479,14.473 0,7.994 -6.477,14.479 -14.479,14.479 C 6.477,14.479 0,7.994 0,0" />
</g>
</g>
<path
diff --git a/editor/icons/source/icon_image_sky_box.svg b/editor/icons/source/icon_gradient.svg
index 9a89c04e58..4ce1b3232f 100644
--- a/editor/icons/source/icon_image_sky_box.svg
+++ b/editor/icons/source/icon_gradient.svg
@@ -10,78 +10,75 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- sodipodi:docname="icon_image_sky_box.svg"
- inkscape:export-ydpi="90"
- inkscape:export-xdpi="90"
- inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_box_shape.png"
- inkscape:version="0.91 r13725"
- version="1.1"
- id="svg2"
- viewBox="0 0 16 16"
+ width="16"
height="16"
- width="16">
- <sodipodi:namedview
- inkscape:snap-smooth-nodes="true"
- inkscape:object-nodes="true"
- inkscape:snap-intersection-paths="false"
- inkscape:object-paths="false"
- inkscape:window-maximized="1"
- inkscape:window-y="27"
- inkscape:window-x="0"
- inkscape:window-height="1016"
- inkscape:window-width="1920"
- inkscape:snap-center="true"
- inkscape:snap-object-midpoints="true"
- inkscape:snap-bbox-midpoints="true"
- inkscape:snap-bbox-edge-midpoints="true"
- inkscape:bbox-nodes="true"
- inkscape:bbox-paths="true"
- inkscape:snap-bbox="true"
- units="px"
- showgrid="true"
- inkscape:current-layer="layer1"
- inkscape:document-units="px"
- inkscape:cy="9.413879"
- inkscape:cx="10.701686"
- inkscape:zoom="32"
- inkscape:pageshadow="2"
- inkscape:pageopacity="0.0"
- borderopacity="1.0"
- bordercolor="#666666"
- pagecolor="#ffffff"
- id="base"
- inkscape:snap-midpoints="true">
- <inkscape:grid
- id="grid3336"
- type="xygrid"
- empspacing="4" />
- </sodipodi:namedview>
+ viewBox="0 0 16 16"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_key.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_gradient.svg">
<defs
id="defs4">
<linearGradient
inkscape:collect="always"
- id="linearGradient4142">
+ id="linearGradient848">
<stop
- style="stop-color:#84c2ff;stop-opacity:1"
+ style="stop-color:#e0e0e0;stop-opacity:1;"
offset="0"
- id="stop4144" />
+ id="stop844" />
<stop
- style="stop-color:#46a3ff;stop-opacity:1"
+ style="stop-color:#e0e0e0;stop-opacity:0;"
offset="1"
- id="stop4146" />
+ id="stop846" />
</linearGradient>
- <radialGradient
+ <linearGradient
inkscape:collect="always"
- xlink:href="#linearGradient4142"
- id="radialGradient4148"
- cx="9.9399967"
- cy="1051.0801"
- fx="9.9399967"
- fy="1051.0801"
- r="7"
- gradientTransform="matrix(1.3337828e-5,-1.9999995,1.5714282,2.7945105e-6,-1643.697,1071.2392)"
+ xlink:href="#linearGradient848"
+ id="linearGradient850"
+ x1="10"
+ y1="1"
+ x2="10"
+ y2="15"
gradientUnits="userSpaceOnUse" />
</defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="9.5330742"
+ inkscape:cy="10.782845"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:object-nodes="false"
+ inkscape:snap-smooth-nodes="false"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
@@ -90,27 +87,21 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
+ <dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
- transform="translate(0,-1036.3622)"
- id="layer1"
+ inkscape:label="Layer 1"
inkscape:groupmode="layer"
- inkscape:label="Layer 1">
- <rect
- style="opacity:1;fill:url(#radialGradient4148);fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect4140"
- width="14"
- height="13.999983"
- x="1"
- y="1037.3622"
- ry="2.0000174" />
+ id="layer1"
+ transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 6 4 A 1 1 0 0 0 5 5 A 1 1 0 0 0 6 6 A 1 1 0 0 0 7 5 A 1 1 0 0 0 6 4 z M 11 5 A 2 2 0 0 0 9 7 A 1 1 0 0 0 8 8 A 1 1 0 0 0 9 9 L 13 9 A 1 1 0 0 0 14 8 A 1 1 0 0 0 13 7 A 2 2 0 0 0 11 5 z M 3 9 A 1 1 0 0 0 2 10 A 1 1 0 0 0 3 11 L 5 11 A 1 1 0 0 0 4 12 A 1 1 0 0 0 5 13 L 8 13 A 1 1 0 0 0 9 12 A 1 1 0 0 0 8 11 L 6 11 A 1 1 0 0 0 7 10 A 1 1 0 0 0 6 9 L 3 9 z "
+ style="opacity:1;fill:url(#linearGradient850);fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
+ d="M 2,1 C 1.4477153,1 1,1.4477153 1,2 v 12 c 0,0.552285 0.4477153,1 1,1 h 12 c 0.552285,0 1,-0.447715 1,-1 V 2 C 15,1.4477153 14.552285,1 14,1 Z"
transform="translate(0,1036.3622)"
- id="path4150" />
+ id="rect4156"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="sssssssss" />
</g>
</svg>
diff --git a/editor/icons/source/icon_texture.svg b/editor/icons/source/icon_gradient_texture.svg
index 39e88e592b..efc48bb778 100644
--- a/editor/icons/source/icon_texture.svg
+++ b/editor/icons/source/icon_gradient_texture.svg
@@ -7,6 +7,7 @@
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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16"
@@ -14,13 +15,35 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_key.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_image_texture.svg">
+ sodipodi:docname="icon_gradient_texture.svg">
<defs
- id="defs4" />
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient848">
+ <stop
+ style="stop-color:#e0e0e0;stop-opacity:1;"
+ offset="0"
+ id="stop844" />
+ <stop
+ style="stop-color:#e0e0e0;stop-opacity:0;"
+ offset="1"
+ id="stop846" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient848"
+ id="linearGradient850"
+ x1="10"
+ y1="1"
+ x2="10"
+ y2="15"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
@@ -29,7 +52,7 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="9.9365814"
+ inkscape:cx="3.5928314"
inkscape:cy="6.4466253"
inkscape:document-units="px"
inkscape:current-layer="layer1"
@@ -42,8 +65,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -73,7 +96,7 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
+ style="opacity:1;fill:url(#linearGradient850);fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
d="M 2 1 A 1 1 0 0 0 1 2 L 1 14 A 1 1 0 0 0 2 15 L 14 15 A 1 1 0 0 0 15 14 L 15 2 A 1 1 0 0 0 14 1 L 2 1 z M 3 3 L 13 3 L 13 11 L 3 11 L 3 3 z "
transform="translate(0,1036.3622)"
id="rect4156" />
diff --git a/editor/icons/source/icon_graph_scalars_to_vec.svg b/editor/icons/source/icon_graph_scalars_to_vec.svg
index 0f2994a606..d951a41832 100644
--- a/editor/icons/source/icon_graph_scalars_to_vec.svg
+++ b/editor/icons/source/icon_graph_scalars_to_vec.svg
@@ -7,6 +7,7 @@
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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="14"
@@ -14,13 +15,35 @@
viewBox="0 0 14 14"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot-design/assets/icons/svg/icon_graph_scalar_uniform.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
sodipodi:docname="icon_graph_scalars_to_vec.svg">
<defs
- id="defs4" />
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient834">
+ <stop
+ id="stop832"
+ offset="0"
+ style="stop-color:#cf68ea;stop-opacity:1" />
+ <stop
+ id="stop830"
+ offset="1"
+ style="stop-color:#b8ea68;stop-opacity:1;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient834"
+ id="linearGradient836"
+ x1="1"
+ y1="7"
+ x2="13.014242"
+ y2="7"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
@@ -29,8 +52,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="4.4222736"
- inkscape:cy="8.4198974"
+ inkscape:cx="6.5785236"
+ inkscape:cy="9.2011474"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +65,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -63,7 +86,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -73,22 +96,9 @@
id="layer1"
transform="translate(0,-1038.3622)">
<path
- style="fill:none;fill-rule:evenodd;stroke:#b8ea68;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 7,1045.3622 5,0"
- id="path4154"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cc" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:#cf68ea;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 2,1040.3622 5,0 0,10 -5,0"
- id="path4155"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccc" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:#cf68ea;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 7,1045.3622 -5,0"
- id="path4157"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cc" />
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:url(#linearGradient836);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 1.9902344 0.99023438 A 1.0001 1.0001 0 0 0 1.2929688 2.7070312 L 4.5859375 6 L 2 6 A 1.0001 1.0001 0 1 0 2 8 L 4.5859375 8 L 1.2929688 11.292969 A 1.0001 1.0001 0 1 0 2.7070312 12.707031 L 7.4140625 8 L 12 8 A 1.0001 1.0001 0 1 0 12 6 L 7.4140625 6 L 2.7070312 1.2929688 A 1.0001 1.0001 0 0 0 1.9902344 0.99023438 z "
+ transform="translate(0,1038.3622)"
+ id="path4154" />
</g>
</svg>
diff --git a/editor/icons/source/icon_graph_vec_to_scalars.svg b/editor/icons/source/icon_graph_vec_to_scalars.svg
index fb58db9d78..8bddf89b2d 100644
--- a/editor/icons/source/icon_graph_vec_to_scalars.svg
+++ b/editor/icons/source/icon_graph_vec_to_scalars.svg
@@ -7,6 +7,7 @@
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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="14"
@@ -14,13 +15,36 @@
viewBox="0 0 14 14"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot-design/assets/icons/svg/icon_graph_scalar_uniform.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
sodipodi:docname="icon_graph_vec_to_scalars.svg">
<defs
- id="defs4" />
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient834">
+ <stop
+ id="stop832"
+ offset="0"
+ style="stop-color:#cf68ea;stop-opacity:1" />
+ <stop
+ id="stop830"
+ offset="1"
+ style="stop-color:#b8ea68;stop-opacity:1;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient834"
+ id="linearGradient836"
+ x1="1"
+ y1="7"
+ x2="13.014242"
+ y2="7"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,13.999754,1038.3622)" />
+ </defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
@@ -29,8 +53,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="4.4222736"
- inkscape:cy="8.4198974"
+ inkscape:cx="6.5785236"
+ inkscape:cy="9.2011474"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +66,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -73,22 +97,9 @@
id="layer1"
transform="translate(0,-1038.3622)">
<path
- style="fill:none;fill-rule:evenodd;stroke:#b8ea68;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 7,1045.3622 -5,0"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:url(#linearGradient836);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 12.00952,1039.3524 a 1.0001,1.0001 0 0 1 0.697265,1.7168 l -3.2929685,3.293 h 2.5859375 a 1.0001,1.0001 0 1 1 0,2 H 9.4138165 l 3.2929685,3.293 a 1.0001,1.0001 0 1 1 -1.414062,1.414 l -4.7070315,-4.707 H 1.999754 a 1.0001,1.0001 0 1 1 0,-2 h 4.5859375 l 4.7070315,-4.707 a 1.0001,1.0001 0 0 1 0.716797,-0.3028 z"
id="path4154"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cc" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:#cf68ea;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 12,1040.3622 -5,0 0,10 5,0"
- id="path4155"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccc" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:#cf68ea;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 7,1045.3622 5,0"
- id="path4157"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cc" />
+ inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_graph_vecs_to_xform.svg b/editor/icons/source/icon_graph_vecs_to_xform.svg
index f8ba3eb4b8..1321766117 100644
--- a/editor/icons/source/icon_graph_vecs_to_xform.svg
+++ b/editor/icons/source/icon_graph_vecs_to_xform.svg
@@ -7,6 +7,7 @@
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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="14"
@@ -14,13 +15,36 @@
viewBox="0 0 14 14"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot-design/assets/icons/svg/icon_graph_scalar_uniform.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
sodipodi:docname="icon_graph_vecs_to_xform.svg">
<defs
- id="defs4" />
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient834">
+ <stop
+ style="stop-color:#b8ea68;stop-opacity:1;"
+ offset="0"
+ id="stop830" />
+ <stop
+ style="stop-color:#ea686c;stop-opacity:1"
+ offset="1"
+ id="stop832" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient834"
+ id="linearGradient836"
+ x1="1"
+ y1="7"
+ x2="13.014242"
+ y2="7"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(7.4681641e-4,1038.3622)" />
+ </defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
@@ -29,8 +53,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="2.8910236"
- inkscape:cy="10.294897"
+ inkscape:cx="3.3597736"
+ inkscape:cy="10.326147"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +66,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -73,14 +97,9 @@
id="layer1"
transform="translate(0,-1038.3622)">
<path
- style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ea686c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
- d="m 7,1044.3613 a 1.0001,1.0001 0 1 0 0,2 l 5,0 a 1.0001,1.0001 0 1 0 0,-2 l -5,0 z"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:url(#linearGradient836);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 1.9909808,1039.3524 a 1.0001,1.0001 0 0 0 -0.697265,1.7168 l 3.2929683,3.293 H 2.0007468 a 1.0001,1.0001 0 1 0 0,2 h 2.5859373 l -3.2929683,3.293 a 1.0001,1.0001 0 1 0 1.414062,1.414 l 4.7070313,-4.707 h 4.5859379 a 1.0001,1.0001 0 1 0 0,-2 H 7.4148091 l -4.7070313,-4.707 a 1.0001,1.0001 0 0 0 -0.716797,-0.3028 z"
id="path4154"
inkscape:connector-curvature="0" />
- <path
- style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#b8ea68;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
- d="M 2 1 A 1.0001 1.0001 0 1 0 2 3 L 6 3 L 6 6 L 2 6 A 1.0001 1.0001 0 1 0 2 8 L 6 8 L 6 11 L 2 11 A 1.0001 1.0001 0 1 0 2 13 L 7 13 A 1.0001 1.0001 0 0 0 8 12 L 8 7.1679688 A 1.0001 1.0001 0 0 0 8 6.8398438 L 8 2 A 1.0001 1.0001 0 0 0 7 1 L 2 1 z "
- transform="translate(0,1038.3622)"
- id="path4155" />
</g>
</svg>
diff --git a/editor/icons/source/icon_graph_xform_to_vecs.svg b/editor/icons/source/icon_graph_xform_to_vecs.svg
index cc113e72fd..45754c8a44 100644
--- a/editor/icons/source/icon_graph_xform_to_vecs.svg
+++ b/editor/icons/source/icon_graph_xform_to_vecs.svg
@@ -7,6 +7,7 @@
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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="14"
@@ -14,13 +15,36 @@
viewBox="0 0 14 14"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot-design/assets/icons/svg/icon_graph_scalar_uniform.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
sodipodi:docname="icon_graph_xform_to_vecs.svg">
<defs
- id="defs4" />
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient834">
+ <stop
+ style="stop-color:#b8ea68;stop-opacity:1;"
+ offset="0"
+ id="stop830" />
+ <stop
+ style="stop-color:#ea686c;stop-opacity:1"
+ offset="1"
+ id="stop832" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient834"
+ id="linearGradient836"
+ x1="1"
+ y1="7"
+ x2="13.014242"
+ y2="7"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,13.999754,1038.3622)" />
+ </defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
@@ -29,8 +53,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="-2.5152264"
- inkscape:cy="10.232397"
+ inkscape:cx="3.3597736"
+ inkscape:cy="10.326147"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +66,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -73,14 +97,9 @@
id="layer1"
transform="translate(0,-1038.3622)">
<path
- style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ea686c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
- d="m 7,1044.3613 a 1.0001,1.0001 0 1 1 0,2 l -5,0 a 1.0001,1.0001 0 1 1 0,-2 l 5,0 z"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:url(#linearGradient836);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 12.00952,1039.3524 a 1.0001,1.0001 0 0 1 0.697265,1.7168 l -3.2929683,3.293 h 2.5859373 a 1.0001,1.0001 0 1 1 0,2 H 9.4138167 l 3.2929683,3.293 a 1.0001,1.0001 0 1 1 -1.414062,1.414 l -4.7070313,-4.707 H 1.999754 a 1.0001,1.0001 0 1 1 0,-2 h 4.5859377 l 4.7070313,-4.707 a 1.0001,1.0001 0 0 1 0.716797,-0.3028 z"
id="path4154"
inkscape:connector-curvature="0" />
- <path
- style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#b8ea68;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
- d="m 12,1039.3622 a 1.0001,1.0001 0 1 1 0,2 l -4,0 0,3 4,0 a 1.0001,1.0001 0 1 1 0,2 l -4,0 0,3 4,0 a 1.0001,1.0001 0 1 1 0,2 l -5,0 a 1.0001,1.0001 0 0 1 -1,-1 l 0,-4.832 a 1.0001,1.0001 0 0 1 0,-0.3282 l 0,-4.8398 a 1.0001,1.0001 0 0 1 1,-1 l 5,0 z"
- id="path4155"
- inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_grid_map.svg b/editor/icons/source/icon_grid_map.svg
index 5bbea0ff2c..83b831abd4 100644
--- a/editor/icons/source/icon_grid_map.svg
+++ b/editor/icons/source/icon_grid_map.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="32"
- inkscape:cx="9.49128"
- inkscape:cy="9.6074202"
+ inkscape:zoom="16"
+ inkscape:cx="10.766846"
+ inkscape:cy="6.0751122"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -68,68 +68,10 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
- <rect
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4170"
- width="4"
- height="4.0000172"
- x="1"
- y="1037.3622" />
- <rect
- y="1037.3622"
- x="11"
- height="4.0000172"
- width="4"
- id="rect4172"
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <rect
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4174"
- width="4"
- height="4.0000172"
- x="6"
- y="1037.3622" />
- <rect
- y="1042.3622"
- x="1"
- height="4.0000172"
- width="4"
- id="rect4176"
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <rect
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4178"
- width="4"
- height="4.0000172"
- x="11"
- y="1042.3622" />
- <rect
- y="1042.3622"
- x="6"
- height="4.0000172"
- width="4"
- id="rect4180"
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <rect
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4182"
- width="4"
- height="4.0000172"
- x="1"
- y="1047.3622" />
- <rect
- y="1047.3622"
- x="11"
- height="4.0000172"
- width="4"
- id="rect4184"
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <rect
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4186"
- width="4"
- height="4.0000172"
- x="6"
- y="1047.3622" />
+ <path
+ style="fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 8 1 L 6 2 L 4 3 L 2 4 L 2 6 L 2 8 L 2 10 L 2 12 L 4 13 L 6 14 L 8 15 L 10 14 L 12 13 L 14 12 L 14 10 L 12 9 L 10 10 L 8 11 L 6 10 L 6 8 L 6 6 L 8 5 L 8 3 L 10 2 L 8 1 z M 12 3 L 10 4 L 10 6 L 12 7 L 14 6 L 14 4 L 12 3 z "
+ transform="translate(0,1036.3622)"
+ id="path1047" />
</g>
</svg>
diff --git a/editor/icons/source/icon_gui_close_dark.svg b/editor/icons/source/icon_gui_close_dark.svg
new file mode 100644
index 0000000000..ccb4239784
--- /dev/null
+++ b/editor/icons/source/icon_gui_close_dark.svg
@@ -0,0 +1,79 @@
+<?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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_gui_close_dark.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32.000001"
+ inkscape:cx="5.2641929"
+ inkscape:cy="7.5472551"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
+ <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:#000000;fill-opacity:0.89803922;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 3.7578125 2.34375 L 2.34375 3.7578125 L 6.5859375 8 L 2.34375 12.242188 L 3.7578125 13.65625 L 8 9.4140625 L 12.242188 13.65625 L 13.65625 12.242188 L 9.4140625 8 L 13.65625 3.7578125 L 12.242188 2.34375 L 8 6.5859375 L 3.7578125 2.34375 z "
+ transform="translate(0,1036.3622)"
+ id="rect4137" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_gui_close_light.svg b/editor/icons/source/icon_gui_close_light.svg
new file mode 100644
index 0000000000..90d811965b
--- /dev/null
+++ b/editor/icons/source/icon_gui_close_light.svg
@@ -0,0 +1,79 @@
+<?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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_gui_close_light.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32.000001"
+ inkscape:cx="5.2641929"
+ inkscape:cy="7.5472551"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
+ <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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="fill:#ffffff;fill-opacity:0.89803922;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 3.7578125 2.34375 L 2.34375 3.7578125 L 6.5859375 8 L 2.34375 12.242188 L 3.7578125 13.65625 L 8 9.4140625 L 12.242188 13.65625 L 13.65625 12.242188 L 9.4140625 8 L 13.65625 3.7578125 L 12.242188 2.34375 L 8 6.5859375 L 3.7578125 2.34375 z "
+ transform="translate(0,1036.3622)"
+ id="rect4137" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_h_button_array.svg b/editor/icons/source/icon_h_button_array.svg
index 9470aeb370..0dad9ee8b8 100644
--- a/editor/icons/source/icon_h_button_array.svg
+++ b/editor/icons/source/icon_h_button_array.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_button.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="32"
- inkscape:cx="12.020131"
- inkscape:cy="9.3264403"
+ inkscape:zoom="16"
+ inkscape:cx="13.231578"
+ inkscape:cy="12.996902"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,11 +42,15 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
- inkscape:window-maximized="1">
+ inkscape:window-maximized="1"
+ inkscape:snap-intersection-paths="true"
+ inkscape:object-paths="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:snap-midpoints="true">
<inkscape:grid
type="xygrid"
id="grid3336"
@@ -60,7 +64,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,29 +73,21 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4156"
- width="6"
- height="5.9999828"
- x="2"
- y="1041.3622" />
+ <g
+ id="layer1-7"
+ inkscape:label="Layer 1"
+ transform="translate(9,-1.9999826)"
+ style="fill:#a5efac;fill-opacity:1" />
<path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 10,1041.3622 0,6 4,0 -1,-2 1,-2 -1,-2 -3,0 z"
- id="rect4158"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 12,1041.3622 v 2 h -2 v 2 h 2 v 2 h 2 v -2 h 2 v -2 h -2 v -2 z"
+ id="rect836"
inkscape:connector-curvature="0" />
- <rect
- y="1046.3622"
- x="2"
- height="0.99996543"
- width="6"
- id="rect4161"
- style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
- style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 10,1046.3622 0,1 4,0 -0.5,-1 -3.5,0 z"
- id="rect4163"
- inkscape:connector-curvature="0" />
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 4,1037.3622 v 3.1328 l -1.445312,-0.9648 -1.109376,1.664 3,2 c 0.335902,0.2239 0.773474,0.2239 1.109376,0 l 3,-2 -1.109376,-1.664 L 6,1040.495 v -3.1328 z m -0.5,8 c -0.831,0 -1.5,0.669 -1.5,1.5 v 0.5 1 H 1 v 2 h 8 v -2 H 8 v -1 -0.5 c 0,-0.831 -0.669,-1.5 -1.5,-1.5 z"
+ id="rect829-9"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccccccccssccccccccsss" />
</g>
</svg>
diff --git a/editor/icons/source/icon_h_scroll_bar.svg b/editor/icons/source/icon_h_scroll_bar.svg
index 2f007c7c94..fbcee056b3 100644
--- a/editor/icons/source/icon_h_scroll_bar.svg
+++ b/editor/icons/source/icon_h_scroll_bar.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,7 +29,7 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="9.1371771"
+ inkscape:cx="2.7934271"
inkscape:cy="7.8450604"
inkscape:document-units="px"
inkscape:current-layer="layer1"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -63,7 +63,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -73,25 +73,9 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 3,3 C 1.8954305,3 1,3.8954305 1,5 l 0,6 c 0,1.104569 0.8954305,2 2,2 l 10,0 c 1.104569,0 2,-0.895431 2,-2 L 15,5 C 15,3.8954305 14.104569,3 13,3 Z m 0,2 10,0 0,6 -10,0 z"
- transform="translate(0,1036.3622)"
- id="rect4140"
inkscape:connector-curvature="0"
- sodipodi:nodetypes="sssssssssccccc" />
- <rect
- style="opacity:1;fill:none;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4181"
- width="4"
- height="4"
- x="4"
- y="1042.3622" />
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4187"
- width="4"
- height="4"
- x="4"
- y="1042.3622" />
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 15,1041.3622 c 0,-1.108 -0.892,-2 -2,-2 H 3 c -1.108,0 -2,0.892 -2,2 v 6 c 0,1.108 0.892,2 2,2 h 10 c 1.108,0 2,-0.892 2,-2 z m -1,2.9883 a 1.0001,1.0001 0 0 1 -0.168,0.5664 l -2,3 a 1.0001,1.0001 0 1 1 -1.664,-1.1094 l 1.6289,-2.4453 -1.6289,-2.4453 a 1.0001,1.0001 0 1 1 1.664,-1.1094 l 2,3 a 1.0001,1.0001 0 0 1 0.168,0.543 z m -7.9922,-2.9981 a 1.0001,1.0001 0 0 1 -0.1758,0.5645 l -1.6308,2.4453 1.6308,2.4453 a 1.0001,1.0001 0 1 1 -1.664,1.1094 l -2,-3 a 1.0001,1.0001 0 0 1 0,-1.1094 l 2,-3 a 1.0001,1.0001 0 0 1 1.8398,0.5449 z"
+ id="rect825" />
</g>
</svg>
diff --git a/editor/icons/source/icon_h_slider.svg b/editor/icons/source/icon_h_slider.svg
index beee5f8b6a..b3e8a956da 100644
--- a/editor/icons/source/icon_h_slider.svg
+++ b/editor/icons/source/icon_h_slider.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="32"
- inkscape:cx="9.3533577"
- inkscape:cy="8.3875011"
+ inkscape:zoom="22.627417"
+ inkscape:cx="7.7094459"
+ inkscape:cy="9.5190595"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -63,7 +63,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -73,27 +73,38 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 2 7 L 2 9 L 5.1738281 9 A 3 3 0 0 1 5 8 A 3 3 0 0 1 5.1757812 7 L 2 7 z M 10.826172 7 A 3 3 0 0 1 11 8 A 3 3 0 0 1 10.824219 9 L 14 9 L 14 7 L 10.826172 7 z "
- transform="translate(0,1036.3622)"
- id="rect4157" />
- <circle
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="path4159"
- cx="2"
- cy="1044.3622"
- r="1" />
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#a5efac;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 2,1046.3622 a 1.0001,1.0001 0 1 0 0,2 h 2.1308594 a 4,4 0 0 1 -0.1308594,-1 4,4 0 0 1 0.1328125,-1 z m 9.869141,0 a 4,4 0 0 1 0.130859,1 4,4 0 0 1 -0.132812,1 H 14 a 1.0001,1.0001 0 1 0 0,-2 z"
+ id="path817"
+ inkscape:connector-curvature="0" />
<circle
- r="1"
- cy="1044.3622"
- cx="14"
- id="circle4161"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" />
- <circle
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="path4167"
- cx="8"
- cy="1044.3622"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path824"
+ cx="13"
+ cy="1047.3622"
r="2" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 2,1040.3622 v 2"
+ id="path835"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 8,1041.3622 v 0"
+ id="path837"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 14,1040.3622 v 2"
+ id="path839"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 3 10 L 3 12 L 9.1308594 12 A 4 4 0 0 1 9 11 A 4 4 0 0 1 9.1328125 10 L 3 10 z "
+ transform="translate(0,1036.3622)"
+ id="rect841" />
</g>
</svg>
diff --git a/editor/icons/source/icon_help.svg b/editor/icons/source/icon_help.svg
index 01e85e0f55..cc8517d2d1 100644
--- a/editor/icons/source/icon_help.svg
+++ b/editor/icons/source/icon_help.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92+devel unknown"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_help.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="31.999999"
- inkscape:cx="5.4018713"
- inkscape:cy="8.2308388"
+ inkscape:cx="9.7940153"
+ inkscape:cy="7.5068869"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -46,7 +46,8 @@
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
- inkscape:window-maximized="1">
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
<inkscape:grid
type="xygrid"
id="grid3336" />
@@ -59,7 +60,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,42 +70,9 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#f1f1f1;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 8 1 A 7 7 0 0 0 1 8 A 7 7 0 0 0 8 15 A 7 7 0 0 0 15 8 A 7 7 0 0 0 8 1 z M 8 4 A 4.0000172 4.0000172 0 0 1 12 8 A 4.0000172 4.0000172 0 0 1 8 12 A 4.0000172 4.0000172 0 0 1 4 8 A 4.0000172 4.0000172 0 0 1 8 4 z "
+ style="fill:#e0e0e0;fill-opacity:0.58823532;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.3254902"
+ d="M 5.0292969 1 C 4.0296094 0.989075 3.0196929 1.31165 2 2 L 2 9 C 4.0172141 7.6471 6.0167145 7.6864 8 9 C 9.9832855 7.6864 11.982786 7.6471 14 9 L 14 2 C 12.980307 1.31165 11.970391 0.989075 10.970703 1 C 10.309402 1.007227 9.6532285 1.1734956 9 1.4628906 L 9 6 L 8 6 L 8 2 C 7.0184429 1.35535 6.0289844 1.010925 5.0292969 1 z M 0 10 L 0 16 L 2 16 A 3 3 0 0 0 5 13 A 3 3 0 0 0 2 10 L 0 10 z M 5 13 A 3 3 0 0 0 8 16 A 3 3 0 0 0 11 13 A 3 3 0 0 0 8 10 A 3 3 0 0 0 5 13 z M 11 13 A 3 3 0 0 0 14 16 L 15 16 L 15 14 L 14 14 A 1.0000174 1.0000174 0 0 1 13 13 A 1.0000174 1.0000174 0 0 1 14 12 L 15 12 L 15 10 L 14 10 A 3 3 0 0 0 11 13 z M 2 12 A 1 1 0 0 1 3 13 A 1 1 0 0 1 2 14 L 2 12 z M 8 12 A 1.0000174 1.0000174 0 0 1 9 13 A 1.0000174 1.0000174 0 0 1 8 14 A 1.0000174 1.0000174 0 0 1 7 13 A 1.0000174 1.0000174 0 0 1 8 12 z "
transform="translate(0,1036.3622)"
- id="circle4160" />
- <path
- style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 8,1 0,3 c 1.1045715,-4.8e-6 2.104267,0.4480167 2.828125,1.171875 L 12.949219,3.0507812 C 11.68247,1.7840321 9.9329986,1.0000047 8,1 Z"
- transform="translate(0,1036.3622)"
- id="circle4154"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccccc"
- inkscape:transform-center-x="-2.4746095"
- inkscape:transform-center-y="-4.9140625" />
- <path
- inkscape:transform-center-y="2.4746"
- inkscape:transform-center-x="-4.9140625"
- sodipodi:nodetypes="ccccc"
- inkscape:connector-curvature="0"
- id="path4163"
- d="m 15,1044.3622 -3,0 c 5e-6,1.1046 -0.448017,2.1043 -1.171875,2.8281 l 2.121094,2.1211 c 1.266749,-1.2667 2.050776,-3.0162 2.050781,-4.9492 z"
- style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <path
- style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 8,1051.3622 0,-3 c -1.1046,0 -2.1043,-0.448 -2.8281,-1.1719 l -2.1211,2.1211 c 1.2667,1.2668 3.0162,2.0508 4.9492,2.0508 z"
- id="path4165"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccccc"
- inkscape:transform-center-x="2.4746"
- inkscape:transform-center-y="4.91405" />
- <path
- inkscape:transform-center-y="-2.4746"
- inkscape:transform-center-x="4.91405"
- sodipodi:nodetypes="ccccc"
- inkscape:connector-curvature="0"
- id="path4167"
- d="m 1,1044.3622 3,0 c 0,-1.1046 0.448,-2.1043 1.1719,-2.8281 L 3.0508,1039.413 C 1.784,1040.6797 1,1042.4292 1,1044.3622 Z"
- style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ id="path4270" />
</g>
</svg>
diff --git a/editor/icons/source/icon_help_search.svg b/editor/icons/source/icon_help_search.svg
new file mode 100644
index 0000000000..ab914c0c64
--- /dev/null
+++ b/editor/icons/source/icon_help_search.svg
@@ -0,0 +1,91 @@
+<?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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_help.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_help_search.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627417"
+ inkscape:cx="10.167683"
+ inkscape:cy="7.1383117"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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:#e0e0e0;fill-opacity:1;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.3254902"
+ d="m 0,10 v 6 H 2 C 3.6568542,16 5,14.656854 5,13 5,11.343146 3.6568542,10 2,10 Z m 5,3 c 0,1.656854 1.3431458,3 3,3 1.6568542,0 3,-1.343146 3,-3 0,-1.656854 -1.3431458,-3 -3,-3 -1.6568542,0 -3,1.343146 -3,3 z m 6,0 c 0,1.656854 1.343146,3 3,3 h 1 v -2 h -1 c -0.552281,-10e-6 -0.99999,-0.447719 -1,-1 10e-6,-0.552281 0.447719,-0.99999 1,-1 h 1 v -2 h -1 c -1.656854,0 -3,1.343146 -3,3 z M 2,12 c 0.5522847,0 1,0.447715 1,1 0,0.552285 -0.4477153,1 -1,1 z m 6,0 c 0.5522808,10e-6 0.9999904,0.447719 1,1 -9.6e-6,0.552281 -0.4477192,0.99999 -1,1 -0.5522808,-10e-6 -0.9999904,-0.447719 -1,-1 9.6e-6,-0.552281 0.4477192,-0.99999 1,-1 z"
+ transform="translate(0,1036.3622)"
+ id="path4270"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccssscssssssscccccccsscsccccccc" />
+ <path
+ style="fill:#e0e0e0;fill-opacity:1;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.3254902"
+ d="m 9,1036.3622 a 4,4 0 0 0 -4,4 4,4 0 0 0 4,4 4,4 0 0 0 4,-4 4,4 0 0 0 -4,-4 z m 0,2 a 2.0000174,2.0000174 0 0 1 2,2 2.0000174,2.0000174 0 0 1 -2,2 2.0000174,2.0000174 0 0 1 -2,-2 2.0000174,2.0000174 0 0 1 2,-2 z"
+ id="path4285"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 7,1042.3622 -3,3"
+ id="path4290"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_key_hover.svg b/editor/icons/source/icon_key_hover.svg
index c3f34a781b..10caa81968 100644
--- a/editor/icons/source/icon_key_hover.svg
+++ b/editor/icons/source/icon_key_hover.svg
@@ -14,7 +14,7 @@
viewBox="0 0 8 8"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_dependency_changed_hl.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="43.417341"
- inkscape:cx="0.40602789"
- inkscape:cy="4.9542089"
+ inkscape:zoom="61.401392"
+ inkscape:cx="1.5457638"
+ inkscape:cy="2.7778126"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -68,10 +68,14 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1044.3622)">
- <path
- style="opacity:1;fill:#8fdeef;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 4 0 A 4 3.9999914 0 0 0 0 4 A 4 3.9999914 0 0 0 4 8 A 4 3.9999914 0 0 0 8 4 A 4 3.9999914 0 0 0 4 0 z "
- transform="translate(0,1044.3622)"
- id="path4137" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.76284212;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect814"
+ width="6.1027369"
+ height="6.1027369"
+ x="-741.52698"
+ y="741.08105"
+ ry="0.76285541"
+ transform="rotate(-45)" />
</g>
</svg>
diff --git a/editor/icons/source/icon_key_selected.svg b/editor/icons/source/icon_key_selected.svg
index c3f01dbec8..62180cca5b 100644
--- a/editor/icons/source/icon_key_selected.svg
+++ b/editor/icons/source/icon_key_selected.svg
@@ -14,7 +14,7 @@
viewBox="0 0 8 8"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_dependency_changed_hl.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="43.417341"
- inkscape:cx="3.4232555"
- inkscape:cy="4.5626603"
+ inkscape:cx="-0.88377936"
+ inkscape:cy="3.8025953"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -68,10 +68,14 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1044.3622)">
- <path
- style="opacity:1;fill:#e7e7e7;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 4 0 A 4 3.9999914 0 0 0 0 4 A 4 3.9999914 0 0 0 4 8 A 4 3.9999914 0 0 0 8 4 A 4 3.9999914 0 0 0 4 0 z "
- transform="translate(0,1044.3622)"
- id="path4137" />
+ <rect
+ style="fill:#84c2ff;fill-opacity:1;stroke:none;stroke-width:0.76284212;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect814"
+ width="6.1027369"
+ height="6.1027369"
+ x="-741.52698"
+ y="741.08112"
+ ry="0.76285541"
+ transform="rotate(-45)" />
</g>
</svg>
diff --git a/editor/icons/source/icon_key_value.svg b/editor/icons/source/icon_key_value.svg
index 5e6333e54b..21780cc695 100644
--- a/editor/icons/source/icon_key_value.svg
+++ b/editor/icons/source/icon_key_value.svg
@@ -14,7 +14,7 @@
viewBox="0 0 8 8"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_dependency_changed_hl.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="43.417341"
- inkscape:cx="3.2850619"
- inkscape:cy="5.046338"
+ inkscape:cx="3.6075137"
+ inkscape:cy="3.8486599"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -68,10 +68,14 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1044.3622)">
- <path
- style="opacity:1;fill:#3da9bf;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 4 0 A 4 3.9999914 0 0 0 0 4 A 4 3.9999914 0 0 0 4 8 A 4 3.9999914 0 0 0 8 4 A 4 3.9999914 0 0 0 4 0 z "
- transform="translate(0,1044.3622)"
- id="path4137" />
+ <rect
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:0.76284212;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect814"
+ width="6.1027369"
+ height="6.1027369"
+ x="-741.52698"
+ y="741.08105"
+ ry="0.76285541"
+ transform="rotate(-45)" />
</g>
</svg>
diff --git a/editor/icons/source/icon_key_xform.svg b/editor/icons/source/icon_key_xform.svg
index 06a282f705..37de107284 100644
--- a/editor/icons/source/icon_key_xform.svg
+++ b/editor/icons/source/icon_key_xform.svg
@@ -14,7 +14,7 @@
viewBox="0 0 8 8"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_dependency_changed_hl.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="43.417341"
- inkscape:cx="3.2850619"
- inkscape:cy="5.046338"
+ inkscape:cx="4.6209337"
+ inkscape:cy="3.8256276"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -68,10 +68,14 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1044.3622)">
- <path
- style="opacity:1;fill:#bf523c;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 4 0 A 4 3.9999914 0 0 0 0 4 A 4 3.9999914 0 0 0 4 8 A 4 3.9999914 0 0 0 8 4 A 4 3.9999914 0 0 0 4 0 z "
- transform="translate(0,1044.3622)"
- id="path4137" />
+ <rect
+ style="fill:#ea686c;fill-opacity:1;stroke:none;stroke-width:0.76284212;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect814"
+ width="6.1027369"
+ height="6.1027369"
+ x="-741.52698"
+ y="741.08112"
+ ry="0.76285541"
+ transform="rotate(-45)" />
</g>
</svg>
diff --git a/editor/icons/source/icon_line_edit.svg b/editor/icons/source/icon_line_edit.svg
index 61ba1ebe7e..ccd94b92ed 100644
--- a/editor/icons/source/icon_line_edit.svg
+++ b/editor/icons/source/icon_line_edit.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="45.254834"
- inkscape:cx="4.4635244"
- inkscape:cy="8.6660933"
+ inkscape:zoom="32"
+ inkscape:cx="10.632447"
+ inkscape:cy="9.3208726"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -63,7 +63,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -74,17 +74,15 @@
transform="translate(0,-1036.3622)">
<path
style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 3,3 C 1.8954305,3 1,3.8954305 1,5 l 0,6 c 0,1.104569 0.8954305,2 2,2 l 10,0 c 1.104569,0 2,-0.895431 2,-2 L 15,5 C 15,3.8954305 14.104569,3 13,3 Z m 0,2 10,0 0,6 -10,0 z"
+ d="M 1 11 C 1 12.104569 1.8954305 13 3 13 L 13 13 C 14.104569 13 15 12.104569 15 11 L 13 11 L 3 11 L 1 11 z "
transform="translate(0,1036.3622)"
- id="rect4140"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="sssssssssccccc" />
+ id="rect4140" />
<rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:3.16227078;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4167"
- width="1"
- height="4.0000172"
- x="4"
- y="1042.3622" />
+ width="2"
+ height="5"
+ x="2"
+ y="1040.3622" />
</g>
</svg>
diff --git a/editor/icons/source/icon_mini_basis.svg b/editor/icons/source/icon_mini_basis.svg
new file mode 100644
index 0000000000..a9d3be82ea
--- /dev/null
+++ b/editor/icons/source/icon_mini_basis.svg
@@ -0,0 +1,204 @@
+<?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="12"
+ viewBox="0 0 16 12"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_mini_basis.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627418"
+ inkscape:cx="13.930099"
+ inkscape:cy="4.8789967"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-nodes="true"
+ inkscape:snap-smooth-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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,-1040.3622)">
+ <rect
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4364"
+ width="2"
+ height="5.9999666"
+ x="-2"
+ y="1044.3621"
+ transform="scale(-1,1)" />
+ <rect
+ y="1044.3621"
+ x="-2"
+ height="2.0000174"
+ width="1"
+ id="rect4368"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ transform="scale(-1,1)" />
+ <path
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 2,1044.3622 a 3,3 0 0 1 3,3 H 3 a 1.0000174,1.0000174 0 0 0 -1,-1 z"
+ id="path4370"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4378"
+ d="m 2,1050.3622 a 3,3 0 0 0 3,-3 H 3 a 1.0000174,1.0000174 0 0 1 -1,1 z"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ transform="scale(-1,1)"
+ y="1042.3621"
+ x="-2"
+ height="3.9999492"
+ width="2"
+ id="rect4384"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:1.41422868;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect857"
+ width="2"
+ height="2.0000174"
+ x="-9"
+ y="1044.3622"
+ transform="scale(-1,1)" />
+ <path
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path859"
+ sodipodi:type="arc"
+ sodipodi:cx="7"
+ sodipodi:cy="1046.3622"
+ sodipodi:rx="2"
+ sodipodi:ry="2"
+ sodipodi:start="1.5707963"
+ sodipodi:end="4.712389"
+ sodipodi:open="true"
+ d="m 7.0000001,1048.3622 a 2,2 0 0 1 -1.7320509,-1 2,2 0 0 1 0,-2 2,2 0 0 1 1.7320508,-1" />
+ <path
+ d="m -6.9999999,1050.3622 a 2,2 0 0 1 -1.7320509,-1 2,2 0 0 1 0,-2 2,2 0 0 1 1.7320508,-1"
+ sodipodi:open="true"
+ sodipodi:end="4.712389"
+ sodipodi:start="1.5707963"
+ sodipodi:ry="2"
+ sodipodi:rx="2"
+ sodipodi:cy="1048.3622"
+ sodipodi:cx="-7"
+ sodipodi:type="arc"
+ id="path861"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ transform="scale(-1,1)" />
+ <rect
+ transform="scale(-1,1)"
+ y="1048.3622"
+ x="-7"
+ height="2.0000174"
+ width="2"
+ id="rect863"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:1.41422868;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#eef39f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4412"
+ width="2"
+ height="3.9999492"
+ x="10"
+ y="1046.3622" />
+ <rect
+ y="1042.3622"
+ x="10"
+ height="1.9999928"
+ width="2"
+ id="rect4432"
+ style="fill:#eef39f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ transform="scale(-1,1)"
+ y="1044.3622"
+ x="-16"
+ height="2.0000174"
+ width="2"
+ id="rect902"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:1.41422868;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ d="m 14,1048.3622 a 2,2 0 0 1 -1.732051,-1 2,2 0 0 1 0,-2 2,2 0 0 1 1.732051,-1"
+ sodipodi:open="true"
+ sodipodi:end="4.712389"
+ sodipodi:start="1.5707963"
+ sodipodi:ry="2"
+ sodipodi:rx="2"
+ sodipodi:cy="1046.3622"
+ sodipodi:cx="14"
+ sodipodi:type="arc"
+ id="path904"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ transform="scale(-1,1)"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path906"
+ sodipodi:type="arc"
+ sodipodi:cx="-14"
+ sodipodi:cy="1048.3622"
+ sodipodi:rx="2"
+ sodipodi:ry="2"
+ sodipodi:start="1.5707963"
+ sodipodi:end="4.712389"
+ sodipodi:open="true"
+ d="m -14,1050.3622 a 2,2 0 0 1 -1.732051,-1 2,2 0 0 1 0,-2 2,2 0 0 1 1.732051,-1" />
+ <rect
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:1.41422868;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect908"
+ width="2"
+ height="2.0000174"
+ x="-14"
+ y="1048.3622"
+ transform="scale(-1,1)" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_mini_matrix3.svg b/editor/icons/source/icon_mini_matrix3.svg
index 592230d13c..27adb40b17 100644
--- a/editor/icons/source/icon_mini_matrix3.svg
+++ b/editor/icons/source/icon_mini_matrix3.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 12"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="32.000001"
- inkscape:cx="4.071303"
- inkscape:cy="4.582959"
+ inkscape:zoom="22.627418"
+ inkscape:cx="13.930099"
+ inkscape:cy="4.8789967"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -70,71 +70,135 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1040.3622)">
+ <rect
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4364"
+ width="2"
+ height="5.9999666"
+ x="-2"
+ y="1044.3621"
+ transform="scale(-1,1)" />
+ <rect
+ y="1044.3621"
+ x="-2"
+ height="2.0000174"
+ width="1"
+ id="rect4368"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ transform="scale(-1,1)" />
<path
style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 12.00042,1044.3622 a 1,1 0 0 1 1,1 1,1 0 0 1 -1,1 l 0,2 a 3,3 0 0 0 2.597656,-1.5 3,3 0 0 0 0.226563,-2.5 l -2.824219,0 z"
- id="path4753"
+ d="m 2,1044.3622 a 3,3 0 0 1 3,3 H 3 a 1.0000174,1.0000174 0 0 0 -1,-1 z"
+ id="path4370"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
- id="path4757"
- d="m 12.00042,1046.3622 0,2 a 1,1 0 0 1 1,1 1,1 0 0 1 -1,1 l 0,2 a 3,3 0 0 0 2.597656,-1.5 3,3 0 0 0 0,-3 3,3 0 0 0 -2.597656,-1.5 z"
+ id="path4378"
+ d="m 2,1050.3622 a 3,3 0 0 0 3,-3 H 3 a 1.0000174,1.0000174 0 0 1 -1,1 z"
style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <path
- style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 3,1044.3622 a 3,3 0 0 1 3,3 l -2,0 a 1.0000174,1.0000174 0 0 0 -1,-1 l 0,-2 z"
- id="path4771"
- inkscape:connector-curvature="0" />
<rect
- y="-1050.3622"
- x="4"
- height="3"
+ transform="scale(-1,1)"
+ y="1042.3621"
+ x="-2"
+ height="3.9999492"
width="2"
- id="rect4773"
- style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- transform="scale(1,-1)" />
+ id="rect4384"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
- style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect4775"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:1.41422868;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect857"
+ width="2"
+ height="2.0000174"
+ x="-9"
+ y="1044.3622"
+ transform="scale(-1,1)" />
+ <path
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path859"
+ sodipodi:type="arc"
+ sodipodi:cx="7"
+ sodipodi:cy="1046.3622"
+ sodipodi:rx="2"
+ sodipodi:ry="2"
+ sodipodi:start="1.5707963"
+ sodipodi:end="4.712389"
+ sodipodi:open="true"
+ d="m 7.0000001,1048.3622 a 2,2 0 0 1 -1.7320509,-1 2,2 0 0 1 0,-2 2,2 0 0 1 1.7320508,-1" />
+ <path
+ d="m -6.9999999,1050.3622 a 2,2 0 0 1 -1.7320509,-1 2,2 0 0 1 0,-2 2,2 0 0 1 1.7320508,-1"
+ sodipodi:open="true"
+ sodipodi:end="4.712389"
+ sodipodi:start="1.5707963"
+ sodipodi:ry="2"
+ sodipodi:rx="2"
+ sodipodi:cy="1048.3622"
+ sodipodi:cx="-7"
+ sodipodi:type="arc"
+ id="path861"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ transform="scale(-1,1)" />
+ <rect
+ transform="scale(-1,1)"
+ y="1048.3622"
+ x="-7"
+ height="2.0000174"
width="2"
- height="5.9999828"
- x="1"
- y="-1050.3622"
- transform="scale(1,-1)" />
+ id="rect863"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:1.41422868;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
- transform="scale(1,-1)"
- y="-1050.3622"
- x="4"
- height="5.9999828"
+ style="fill:#eef39f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4412"
width="2"
- id="rect4777"
- style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <path
- inkscape:connector-curvature="0"
- id="path4779"
- d="m 6,1044.3622 a 3,3 0 0 1 3,3 l -2,0 a 1.0000174,1.0000174 0 0 0 -1,-1 l 0,-2 z"
- style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ height="3.9999492"
+ x="10"
+ y="1046.3622" />
<rect
- style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect4781"
+ y="1042.3622"
+ x="10"
+ height="1.9999928"
width="2"
- height="3.0000002"
- x="7"
- y="-1050.3622"
- transform="scale(1,-1)" />
+ id="rect4432"
+ style="fill:#eef39f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
- style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect4783"
- width="4.0004196"
- height="2"
- x="11"
- y="1043.3622" />
+ transform="scale(-1,1)"
+ y="1044.3622"
+ x="-16"
+ height="2.0000174"
+ width="2"
+ id="rect902"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:1.41422868;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ d="m 14,1048.3622 a 2,2 0 0 1 -1.732051,-1 2,2 0 0 1 0,-2 2,2 0 0 1 1.732051,-1"
+ sodipodi:open="true"
+ sodipodi:end="4.712389"
+ sodipodi:start="1.5707963"
+ sodipodi:ry="2"
+ sodipodi:rx="2"
+ sodipodi:cy="1046.3622"
+ sodipodi:cx="14"
+ sodipodi:type="arc"
+ id="path904"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ transform="scale(-1,1)"
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path906"
+ sodipodi:type="arc"
+ sodipodi:cx="-14"
+ sodipodi:cy="1048.3622"
+ sodipodi:rx="2"
+ sodipodi:ry="2"
+ sodipodi:start="1.5707963"
+ sodipodi:end="4.712389"
+ sodipodi:open="true"
+ d="m -14,1050.3622 a 2,2 0 0 1 -1.732051,-1 2,2 0 0 1 0,-2 2,2 0 0 1 1.732051,-1" />
<rect
- y="1050.3622"
- x="11"
- height="2"
- width="1"
- id="rect4173"
- style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#e3ec69;fill-opacity:1;stroke:none;stroke-width:1.41422868;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect908"
+ width="2"
+ height="2.0000174"
+ x="-14"
+ y="1048.3622"
+ transform="scale(-1,1)" />
</g>
</svg>
diff --git a/editor/icons/source/icon_mini_matrix32.svg b/editor/icons/source/icon_mini_transform2D.svg
index 5159ea0b87..e8e38f1256 100644
--- a/editor/icons/source/icon_mini_matrix32.svg
+++ b/editor/icons/source/icon_mini_transform2D.svg
@@ -14,11 +14,11 @@
viewBox="0 0 16 12"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45"
- sodipodi:docname="icon_mini_matrix32.svg">
+ sodipodi:docname="icon_mini_transform2D.svg">
<defs
id="defs4" />
<sodipodi:namedview
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="32.000001"
- inkscape:cx="1.5471383"
- inkscape:cy="5.978497"
+ inkscape:zoom="22.627418"
+ inkscape:cx="6.4108823"
+ inkscape:cy="5.363647"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -61,7 +61,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
+ <dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@@ -70,76 +70,48 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1040.3622)">
- <path
- style="fill:#ddf4aa;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 8 2 L 8 4 L 9 4 L 10 4 A 1 1 0 0 1 9 5 L 9 7 A 1 1 0 0 1 10 8 A 1 1 0 0 1 9 9 L 8 9 L 8 11 L 9 11 A 3 3 0 0 0 11.597656 9.5 A 3 3 0 0 0 11.597656 6.5 A 3 3 0 0 0 11.232422 5.9980469 A 3 3 0 0 0 11.597656 5.5 A 3 3 0 0 0 11.994141 4 L 12 4 L 12 2 L 9 2 L 8 2 z "
- transform="translate(0,1040.3622)"
- id="path4753" />
<rect
y="1048.3622"
- x="11"
+ x="5"
height="2"
width="5"
id="rect4763"
- style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ddf4aa;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:open="true"
- d="m 13,1050.3622 a 2,2 0 0 1 -1.732051,-1 2,2 0 0 1 0,-2 2,2 0 0 1 1.732051,-1"
+ d="m 7.0000001,1050.3622 a 2,2 0 0 1 -1.7320509,-1 2,2 0 0 1 0,-2 2,2 0 0 1 1.7320508,-1"
sodipodi:end="4.712389"
sodipodi:start="1.5707963"
sodipodi:ry="2"
sodipodi:rx="2"
sodipodi:cy="1048.3622"
- sodipodi:cx="13"
+ sodipodi:cx="7"
sodipodi:type="arc"
id="path4765"
- style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ddf4aa;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path4767"
- d="m 13,1042.3622 0,2 a 1,1 0 0 1 1,1 1,1 0 0 1 -1,1 l 0,2 a 3,3 0 0 0 2.597656,-1.5 3,3 0 0 0 0,-3 3,3 0 0 0 -2.597656,-1.5 z"
- style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <path
- style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 2,1044.3622 a 3,3 0 0 1 3,3 l -2,0 a 1.0000174,1.0000174 0 0 0 -1,-1 l 0,-2 z"
- id="path4771"
- inkscape:connector-curvature="0" />
+ d="m 7,1042.3622 v 2 a 1,1 0 0 1 1,1 1,1 0 0 1 -1,1 v 2 a 3,3 0 0 0 2.597656,-1.5 3,3 0 0 0 0,-3 A 3,3 0 0 0 7,1042.3622 Z"
+ style="fill:#ddf4aa;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
- y="-1050.3622"
- x="3"
- height="3"
- width="2"
- id="rect4773"
- style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- transform="scale(1,-1)" />
- <rect
- style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect4775"
- width="2"
- height="5.9999828"
+ style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:1.85164022;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect823"
+ width="6"
+ height="2"
x="0"
- y="-1050.3622"
- transform="scale(1,-1)" />
+ y="1042.3622" />
<rect
- transform="scale(1,-1)"
- y="-1050.3622"
- x="3"
- height="5.9999828"
+ y="1043.3622"
+ x="2"
+ height="7.0000172"
width="2"
- id="rect4777"
- style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ id="rect825"
+ style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2.00000238;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
- inkscape:connector-curvature="0"
- id="path4779"
- d="m 5,1044.3622 a 3,3 0 0 1 3,3 l -2,0 a 1.0000174,1.0000174 0 0 0 -1,-1 l 0,-2 z"
- style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <rect
- style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect4781"
- width="2"
- height="3.0000002"
- x="6"
- y="-1050.3622"
- transform="scale(1,-1)" />
+ style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2.1380899;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 10 2 L 10 10 L 12 10 A 4 4 0 0 0 15.464844 8 A 4 4 0 0 0 15.464844 4 A 4 4 0 0 0 12 2 L 10 2 z M 12 4 A 2.0000174 2.0000174 0 0 1 13.732422 5 A 2.0000174 2.0000174 0 0 1 13.732422 7 A 2.0000174 2.0000174 0 0 1 12 8 L 12 4 z "
+ transform="translate(0,1040.3622)"
+ id="rect827" />
</g>
</svg>
diff --git a/editor/icons/source/icon_mirror_x.svg b/editor/icons/source/icon_mirror_x.svg
index f24a630770..ca28fec4f8 100644
--- a/editor/icons/source/icon_mirror_x.svg
+++ b/editor/icons/source/icon_mirror_x.svg
@@ -14,11 +14,11 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_tool_move.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_h_size.svg">
+ sodipodi:docname="icon_mirror_x.svg">
<defs
id="defs4" />
<sodipodi:namedview
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="7.1680801"
- inkscape:cy="7.9718121"
+ inkscape:cx="2.7305801"
+ inkscape:cy="8.1905621"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,11 +69,21 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 4,7 0,-2 -3,3 3,3 0,-2 8,0 0,2 3,-3 -3,-3 0,2 z"
- transform="translate(0,1036.3622)"
- id="rect4140"
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="m 4,1042.3622 -2,2 2,2"
+ id="path816"
inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccccccccccc" />
+ sodipodi:nodetypes="ccc" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 2,1044.3622 H 13"
+ id="path818"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path820"
+ d="m 12,1042.3622 2,2 -2,2"
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ sodipodi:nodetypes="ccc" />
</g>
</svg>
diff --git a/editor/icons/source/icon_mirror_y.svg b/editor/icons/source/icon_mirror_y.svg
index bb913b84af..922caf6efc 100644
--- a/editor/icons/source/icon_mirror_y.svg
+++ b/editor/icons/source/icon_mirror_y.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_tool_move.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="1.7618301"
- inkscape:cy="7.9093121"
+ inkscape:cx="2.7305801"
+ inkscape:cy="8.1905621"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
+ <dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,10 +69,9 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 7,1048.3622 -2,0 3,3 3,-3 -2,0 0,-8 2,0 -3,-3 -3,3 2,0 z"
- id="rect4140"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccccccccccc" />
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:0.99607843;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 11.012128,1048.3548 a 1.0001,1.0001 0 0 0 -1.7167967,-0.6973 l -0.2929688,0.293 v -7.1719 l 0.2929688,0.293 a 1.0001,1.0001 0 0 0 1.7148437,-0.7266 1.0001,1.0001 0 0 0 -0.300781,-0.6875 l -2.0000003,-2 a 1.0001,1.0001 0 0 0 -1.4140624,0 l -1.9999998,2 a 1.0001,1.0001 0 1 0 1.4140622,1.4141 l 0.2929688,-0.293 v 7.1719 l -0.2929688,-0.293 a 1.0001,1.0001 0 1 0 -1.4140622,1.4141 l 1.9999998,2 a 1.0001,1.0001 0 0 0 1.4140624,0 l 2.0000003,-2 a 1.0001,1.0001 0 0 0 0.302734,-0.7168 z"
+ id="path816"
+ inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_move_down.svg b/editor/icons/source/icon_move_down.svg
index e83a69ad50..911def98b8 100644
--- a/editor/icons/source/icon_move_down.svg
+++ b/editor/icons/source/icon_move_down.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_arrow_left.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="22.627417"
- inkscape:cx="4.2997855"
- inkscape:cy="8.3620593"
+ inkscape:zoom="32"
+ inkscape:cx="-0.21847599"
+ inkscape:cy="8.1503711"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -62,7 +62,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -72,9 +72,14 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="fill:#e0e0e0;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
- d="m 8,1051.3622 -6,-7 4,0 0,-7 4,0 0,7 4,0 -6,7 z"
- id="path4135"
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="m 4,1045.348 4,5 4,-5"
+ id="path814"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="m 8,1038.348 v 11"
+ id="path816"
inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_move_up.svg b/editor/icons/source/icon_move_up.svg
index 8f671a0d72..4e24791efb 100644
--- a/editor/icons/source/icon_move_up.svg
+++ b/editor/icons/source/icon_move_up.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_arrow_left.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="22.627417"
- inkscape:cx="4.2997855"
- inkscape:cy="8.3620593"
+ inkscape:zoom="32"
+ inkscape:cx="5.8620142"
+ inkscape:cy="9.0057643"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -62,7 +62,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -72,9 +72,14 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="fill:#e0e0e0;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
- d="M 8 1 L 2 8 L 6 8 L 6 15 L 10 15 L 10 8 L 14 8 L 8 1 z "
- transform="translate(0,1036.3622)"
- id="path4135" />
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.99607843;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 4,1043.3622 4,-5 4,5"
+ id="path814"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:0.99607843;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 8,1050.3622 v -11"
+ id="path816"
+ inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_multi_script.svg b/editor/icons/source/icon_multi_script.svg
new file mode 100644
index 0000000000..07c49383a9
--- /dev/null
+++ b/editor/icons/source/icon_multi_script.svg
@@ -0,0 +1,83 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_g_d_script.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_multi_script.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="8.3086348"
+ inkscape:cy="8.7213858"
+ 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="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 7 1 L 6.4355469 3.2578125 A 5.0000172 5.0000172 0 0 0 5.7460938 3.5371094 L 3.7578125 2.34375 L 2.34375 3.7578125 L 3.5390625 5.7519531 A 5.0000172 5.0000172 0 0 0 3.2539062 6.4375 L 1 7 L 1 9 L 3.2578125 9.5644531 A 5.0000172 5.0000172 0 0 0 3.5371094 10.251953 L 2.34375 12.242188 L 3.7578125 13.65625 L 5 12.912109 L 5 8 L 6 8 A 2.0000174 2.0000174 0 0 1 8 6 L 8 5 L 12.912109 5 L 13.65625 3.7578125 L 12.242188 2.34375 L 10.248047 3.5390625 A 5.0000172 5.0000172 0 0 0 9.5625 3.2539062 L 9 1 L 7 1 z "
+ transform="translate(0,1036.3622)"
+ id="path4176" />
+ <path
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:0.99999714;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 10,1043.3622 v 3 H 7 v 2 h 3 v 3 h 2 v -3 h 3 v -2 h -3 v -3 z"
+ id="rect817"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccc" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_native_script.svg b/editor/icons/source/icon_native_script.svg
new file mode 100644
index 0000000000..33a8e52a5d
--- /dev/null
+++ b/editor/icons/source/icon_native_script.svg
@@ -0,0 +1,77 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_g_d_script.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_g_d_native.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627417"
+ inkscape:cx="6.4177687"
+ inkscape:cy="8.8552476"
+ 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="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 7 1 L 6.4355469 3.2578125 A 5.0000172 5.0000172 0 0 0 5.7460938 3.5371094 L 3.7578125 2.34375 L 2.34375 3.7578125 L 3.5390625 5.7519531 A 5.0000172 5.0000172 0 0 0 3.2539062 6.4375 L 1 7 L 4 7 L 4 8 L 4 9 L 6 9 L 6 8.0488281 A 2.0000174 2.0000174 0 0 1 6 8 A 2.0000174 2.0000174 0 0 1 8 6 A 2.0000174 2.0000174 0 0 1 10 8 L 10 9 L 15 9 L 15 7 L 12.742188 6.4355469 A 5.0000172 5.0000172 0 0 0 12.462891 5.7480469 L 13.65625 3.7578125 L 12.242188 2.34375 L 10.248047 3.5390625 A 5.0000172 5.0000172 0 0 0 9.5625 3.2539062 L 9 1 L 7 1 z M 1 8 L 1 12 L 1 16 L 3 16 A 3 3 0 0 0 6 13 A 3 3 0 0 0 3 10 L 3 8 L 1 8 z M 7 8 L 7 10 L 9 10 L 9 8 L 7 8 z M 10 10 L 10 16 L 12 16 L 12 12 A 1.0000174 1.0000174 0 0 1 13 13 L 13 16 L 15 16 L 15 13 A 3 3 0 0 0 12 10 L 10 10 z M 3 12 A 1.0000174 1.0000174 0 0 1 4 13 A 1.0000174 1.0000174 0 0 1 3 14 L 3 12 z M 7 12 L 7 16 L 9 16 L 9 12 L 7 12 z "
+ transform="translate(0,1036.3622)"
+ id="path4176" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_new.svg b/editor/icons/source/icon_new.svg
index a37ba1be3f..d59dd3513a 100644
--- a/editor/icons/source/icon_new.svg
+++ b/editor/icons/source/icon_new.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_new.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="16"
- inkscape:cx="0.22745062"
- inkscape:cy="11.330333"
+ inkscape:zoom="22.627417"
+ inkscape:cx="20.922744"
+ inkscape:cy="2.4022924"
inkscape:document-units="px"
inkscape:current-layer="layer1-8"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -76,11 +76,17 @@
inkscape:label="Layer 1"
transform="translate(0,-1.6949463e-5)">
<path
- sodipodi:nodetypes="ccccccccccc"
- inkscape:connector-curvature="0"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 2,1 v 14 h 8 V 14 H 8 v -4 h 2 V 8 h 4 V 6 H 9 V 1 Z m 8,0 v 4 h 4 z"
+ transform="translate(0,1036.3622)"
id="rect4158"
- d="m 2,1037.3622 0,14 12,0 0,-9 -5,0 0,-5 z m 8,0 0,4 4,0 z"
- style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccccccc" />
+ <path
+ style="fill:#84ffb1;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 11,1045.3622 v 2 H 9 v 2 h 2 v 2 h 2 v -2 h 2 v -2 h -2 v -2 z"
+ id="rect4485"
+ inkscape:connector-curvature="0" />
</g>
</g>
</svg>
diff --git a/editor/icons/source/icon_nine_patch_rect.svg b/editor/icons/source/icon_nine_patch_rect.svg
index f12789c19e..0a6b94094a 100644
--- a/editor/icons/source/icon_nine_patch_rect.svg
+++ b/editor/icons/source/icon_nine_patch_rect.svg
@@ -14,11 +14,11 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_patch_9_frame.svg">
+ sodipodi:docname="icon_nine_patch_rect.svg">
<defs
id="defs4" />
<sodipodi:namedview
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="10.35114"
- inkscape:cy="9.1140348"
+ inkscape:cx="8.03864"
+ inkscape:cy="8.0827848"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -69,35 +69,35 @@
id="layer1"
transform="translate(0,-1036.3622)">
<rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4154"
- width="1"
+ width="2"
height="14"
x="1"
y="1037.3622" />
<rect
- y="1050.3622"
+ y="1049.3622"
x="1"
- height="0.9999826"
+ height="1.9999652"
width="14"
id="rect4156"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82846403;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4158"
width="14"
- height="0.9999826"
+ height="2.0000174"
x="1"
y="1037.3622" />
<rect
y="1037.3622"
- x="14"
+ x="13"
height="14"
- width="1"
+ width="2"
id="rect4160"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
- y="1040.3622"
+ y="1041.3622"
x="1"
height="0.9999826"
width="14"
@@ -109,18 +109,18 @@
width="14"
height="0.9999826"
x="1"
- y="1047.3622" />
+ y="1046.3622" />
<rect
style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4166"
width="14"
height="0.9999826"
x="1037.3622"
- y="-5"
- transform="matrix(0,1,-1,0,0,0)" />
+ y="-6"
+ transform="rotate(90)" />
<rect
- transform="matrix(0,1,-1,0,0,0)"
- y="-12"
+ transform="rotate(90)"
+ y="-10.999983"
x="1037.3622"
height="0.9999826"
width="14"
diff --git a/editor/icons/source/icon_option_button.svg b/editor/icons/source/icon_option_button.svg
index 4537b14616..a58d3d9c06 100644
--- a/editor/icons/source/icon_option_button.svg
+++ b/editor/icons/source/icon_option_button.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="3.751238"
- inkscape:cy="7.999659"
+ inkscape:cx="10.188738"
+ inkscape:cy="6.593409"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -63,7 +63,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -74,11 +74,9 @@
transform="translate(0,-1036.3622)">
<path
style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 3,3 C 1.8954305,3 1,3.8954305 1,5 l 0,6 c 0,1.104569 0.8954305,2 2,2 L 9,13 9,3 Z m 7,0 0,10 3,0 c 1.104569,0 2,-0.895431 2,-2 L 15,5 C 15,3.8954305 14.104569,3 13,3 Z m 1,4 3,0 -1.5,2 z"
- id="rect4140"
+ d="M 3 3 C 1.8954305 3 1 3.8954305 1 5 L 1 11 C 1 12.104569 1.8954305 13 3 13 L 8 13 L 9 13 L 10 13 L 12 13 L 13 13 C 14.104569 13 15 12.104569 15 11 L 15 5 C 15 3.8954305 14.104569 3 13 3 L 12 3 L 10 3 L 9 3 L 8 3 L 3 3 z M 11 5.9863281 A 1.0001 1.0001 0 0 1 11.716797 7.7070312 L 8.7167969 10.707031 A 1.0001 1.0001 0 0 1 7.3027344 10.707031 L 4.3027344 7.7070312 A 1.0001 1.0001 0 0 1 5 5.9902344 A 1.0001 1.0001 0 0 1 5.7167969 6.2929688 L 8.0097656 8.5859375 L 10.302734 6.2929688 A 1.0001 1.0001 0 0 1 11 5.9863281 z "
transform="translate(0,1036.3622)"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="ssssccsccssssccccc" />
+ id="rect4140" />
<rect
style="opacity:1;fill:none;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
id="rect4181"
diff --git a/editor/icons/source/icon_panorama_sky.svg b/editor/icons/source/icon_panorama_sky.svg
new file mode 100644
index 0000000000..32a5253fe3
--- /dev/null
+++ b/editor/icons/source/icon_panorama_sky.svg
@@ -0,0 +1,131 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ 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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_confirmation_dialog.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_panorama_sky.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4291">
+ <stop
+ style="stop-color:#1ec3ff;stop-opacity:1"
+ offset="0"
+ id="stop4287" />
+ <stop
+ style="stop-color:#b2e1ff;stop-opacity:1"
+ offset="1"
+ id="stop4289" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4291"
+ id="linearGradient4293"
+ x1="8"
+ y1="1038.3622"
+ x2="8"
+ y2="1050.3622"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.0096153,0,0,1.0227214,-0.00961532,-22.593074)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254834"
+ inkscape:cx="8.0139922"
+ inkscape:cy="7.7749171"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ originx="0"
+ originy="0"
+ spacingx="1"
+ spacingy="1" />
+ </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,-1037.3622)">
+ <path
+ style="fill:url(#linearGradient4293);fill-opacity:1;stroke-width:15.24220753"
+ d="m 1,1039.3622 c 4.2748686,2.6091 10.764971,2.7449 14,0 v 12 c -3.58489,-2.6849 -9.7929096,-2.6544 -14,0 z"
+ id="rect4285"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902"
+ id="rect4273"
+ width="3"
+ height="2"
+ x="2"
+ y="1046.3622"
+ ry="1" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902"
+ id="rect4275"
+ width="4"
+ height="2"
+ x="8"
+ y="1044.3622"
+ ry="1" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902"
+ id="rect4277"
+ width="4"
+ height="2"
+ x="10"
+ y="1043.3622"
+ ry="1" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_particles_shader.svg b/editor/icons/source/icon_particles_material.svg
index b4c2ef7ccd..b4c2ef7ccd 100644
--- a/editor/icons/source/icon_particles_shader.svg
+++ b/editor/icons/source/icon_particles_material.svg
diff --git a/editor/icons/source/icon_patch_9_rect.svg b/editor/icons/source/icon_patch_9_rect.svg
deleted file mode 100644
index c5a09603a6..0000000000
--- a/editor/icons/source/icon_patch_9_rect.svg
+++ /dev/null
@@ -1,130 +0,0 @@
-<?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="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90"
- sodipodi:docname="icon_patch_9_rect.svg">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="32"
- inkscape:cx="10.35114"
- inkscape:cy="9.1140348"
- 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="1016"
- inkscape:window-x="0"
- inkscape:window-y="27"
- inkscape:window-maximized="1">
- <inkscape:grid
- type="xygrid"
- id="grid3336" />
- </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 />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0,-1036.3622)">
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4154"
- width="1"
- height="14"
- x="1"
- y="1037.3622" />
- <rect
- y="1050.3622"
- x="1"
- height="0.9999826"
- width="14"
- id="rect4156"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4158"
- width="14"
- height="0.9999826"
- x="1"
- y="1037.3622" />
- <rect
- y="1037.3622"
- x="14"
- height="14"
- width="1"
- id="rect4160"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <rect
- y="1040.3622"
- x="1"
- height="0.9999826"
- width="14"
- id="rect4162"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4164"
- width="14"
- height="0.9999826"
- x="1"
- y="1047.3622" />
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4166"
- width="14"
- height="0.9999826"
- x="1037.3622"
- y="-5"
- transform="matrix(0,1,-1,0,0,0)" />
- <rect
- transform="matrix(0,1,-1,0,0,0)"
- y="-12"
- x="1037.3622"
- height="0.9999826"
- width="14"
- id="rect4168"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- </g>
-</svg>
diff --git a/editor/icons/source/icon_sample_player.svg b/editor/icons/source/icon_plane_mesh.svg
index 2254718a9b..5273900606 100644
--- a/editor/icons/source/icon_sample_player.svg
+++ b/editor/icons/source/icon_plane_mesh.svg
@@ -14,11 +14,11 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92+devel unknown"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_sample_player.svg">
+ sodipodi:docname="icon_quad_mesh.svg">
<defs
id="defs4" />
<sodipodi:namedview
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="31.999999"
- inkscape:cx="10.445016"
- inkscape:cy="6.2884774"
+ inkscape:cx="13.201653"
+ inkscape:cy="9.702363"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -46,7 +46,8 @@
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
- inkscape:window-maximized="1">
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
<inkscape:grid
type="xygrid"
id="grid3336"
@@ -60,7 +61,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -70,9 +71,9 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- d="M 8 1 L 4 6 L 1 6 L 1 10 L 4 10 L 8 15 L 8 1 z M 13 3 L 13 13 L 14 13 L 14 3 L 13 3 z M 10 6 L 10 11 L 11 11 L 11 6 L 10 6 z "
- transform="translate(0,1036.3622)"
- id="rect4154" />
+ style="fill:none;stroke:#ffd684;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 2,1048.3622 h 12 l -3,-8 H 5 Z"
+ id="path4266"
+ inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_prism_mesh.svg b/editor/icons/source/icon_prism_mesh.svg
new file mode 100644
index 0000000000..310d8f1a28
--- /dev/null
+++ b/editor/icons/source/icon_prism_mesh.svg
@@ -0,0 +1,79 @@
+<?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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_prism_mesh.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="9.3129802"
+ inkscape:cy="9.9193702"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
+ <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="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffd684;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter-blend-mode:normal;filter-gaussianBlur-deviation:0;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;opacity:1"
+ d="M 7.9824219 1.0019531 A 1.0001 1.0001 0 0 0 7.1679688 1.4453125 L 1.1953125 10.40625 L 1.1679688 10.445312 A 1 1 0 0 0 1.1054688 10.552734 A 1 1 0 0 0 1.5527344 11.894531 L 7.5527344 14.894531 A 1.0001 1.0001 0 0 0 8.4472656 14.894531 L 14.447266 11.894531 A 1 1 0 0 0 14.894531 10.552734 A 1 1 0 0 0 14.832031 10.445312 L 8.8320312 1.4453125 A 1.0001 1.0001 0 0 0 7.9824219 1.0019531 z M 7 5.3027344 L 7 12.382812 L 3.4609375 10.611328 L 7 5.3027344 z M 9 5.3027344 L 12.539062 10.611328 L 9 12.382812 L 9 5.3027344 z "
+ transform="translate(0,1036.3622)"
+ id="path4309" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_procedural_sky.svg b/editor/icons/source/icon_procedural_sky.svg
new file mode 100644
index 0000000000..97162f3efa
--- /dev/null
+++ b/editor/icons/source/icon_procedural_sky.svg
@@ -0,0 +1,129 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ 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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_confirmation_dialog.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_procedural_sky.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4291">
+ <stop
+ style="stop-color:#1ec3ff;stop-opacity:1"
+ offset="0"
+ id="stop4287" />
+ <stop
+ style="stop-color:#b2e1ff;stop-opacity:1"
+ offset="1"
+ id="stop4289" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4291"
+ id="linearGradient4303"
+ x1="8"
+ y1="1040.3622"
+ x2="8"
+ y2="1050.3622"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254834"
+ inkscape:cx="12.704839"
+ inkscape:cy="7.3549048"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ originx="0"
+ originy="0"
+ spacingx="1"
+ spacingy="1" />
+ </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,-1037.3622)">
+ <path
+ style="fill:url(#linearGradient4303);fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902"
+ d="m 8,1040.3622 a 7,7 0 0 0 -7,7 7,7 0 0 0 0.6855469,3 H 14.316406 a 7,7 0 0 0 0.683594,-3 7,7 0 0 0 -7,-7 z"
+ id="path4292"
+ inkscape:connector-curvature="0" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902"
+ id="rect4305"
+ width="3"
+ height="2"
+ x="2"
+ y="1047.3622"
+ ry="1" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902"
+ id="rect4307"
+ width="4"
+ height="2"
+ x="7"
+ y="1045.3622"
+ ry="1" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902"
+ id="rect4309"
+ width="4"
+ height="2"
+ x="9"
+ y="1044.3622"
+ ry="1" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_quad_mesh.svg b/editor/icons/source/icon_quad_mesh.svg
new file mode 100644
index 0000000000..f511dd8a12
--- /dev/null
+++ b/editor/icons/source/icon_quad_mesh.svg
@@ -0,0 +1,79 @@
+<?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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_quad_mesh.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="11.701653"
+ inkscape:cy="9.702363"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
+ <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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffd684;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 15,1037.3622 v 1 13 H 1 v -14 z m -2,2 H 4.414062 L 13,1047.9481 Z m -10,1.4141 v 8.5859 h 8.585938 z"
+ id="path4276"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_reference_rect.svg b/editor/icons/source/icon_reference_rect.svg
index cee814360d..ace9a48a23 100644
--- a/editor/icons/source/icon_reference_rect.svg
+++ b/editor/icons/source/icon_reference_rect.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="4.94489"
- inkscape:cy="9.0515348"
+ inkscape:cx="8.97614"
+ inkscape:cy="8.6140348"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,32 +69,62 @@
id="layer1"
transform="translate(0,-1036.3622)">
<rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4154"
- width="1"
- height="14"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ id="rect817"
+ width="2"
+ height="2"
x="1"
y="1037.3622" />
<rect
- y="1050.3622"
- x="1"
- height="0.9999826"
- width="14"
- id="rect4156"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ y="1037.3622"
+ x="13"
+ height="2"
+ width="2"
+ id="rect819"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
<rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4158"
- width="14"
- height="0.9999826"
- x="1"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ id="rect821"
+ width="8"
+ height="2"
+ x="4"
y="1037.3622" />
<rect
- y="1037.3622"
- x="14"
- height="14"
- width="1"
- id="rect4160"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ y="1049.3622"
+ x="4"
+ height="2"
+ width="8"
+ id="rect823"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
+ <rect
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ id="rect825"
+ width="2"
+ height="2"
+ x="13"
+ y="1049.3622" />
+ <rect
+ y="1049.3622"
+ x="1"
+ height="2"
+ width="2"
+ id="rect827"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
+ <rect
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ id="rect829"
+ width="8"
+ height="2"
+ x="1040.3622"
+ y="-3"
+ transform="rotate(90)" />
+ <rect
+ transform="rotate(90)"
+ y="-15"
+ x="1040.3622"
+ height="2"
+ width="8"
+ id="rect831"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
</g>
</svg>
diff --git a/editor/icons/source/icon_remote_transform.svg b/editor/icons/source/icon_remote_transform.svg
index fbbfacf629..814384297e 100644
--- a/editor/icons/source/icon_remote_transform.svg
+++ b/editor/icons/source/icon_remote_transform.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="16"
- inkscape:cx="7.0691739"
- inkscape:cy="9.3738931"
+ inkscape:cx="10.542126"
+ inkscape:cy="9.6951879"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,10 +42,10 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1680"
- inkscape:window-height="1050"
- inkscape:window-x="1366"
- inkscape:window-y="0"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="true"
@@ -64,7 +64,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -74,51 +74,53 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="path4155"
+ style="fill:#fc9c9c;fill-opacity:1;stroke:none;stroke-width:2.66666675;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path834"
sodipodi:type="arc"
- sodipodi:cx="744.13245"
- sodipodi:cy="734.23291"
+ sodipodi:cx="8"
+ sodipodi:cy="1047.3622"
sodipodi:rx="4"
sodipodi:ry="4"
sodipodi:start="0"
sodipodi:end="3.1415927"
- d="m 748.13245,734.23291 a 4,4 0 0 1 -2,3.4641 4,4 0 0 1 -4,0 4,4 0 0 1 -2,-3.4641 l 4,0 z"
- inkscape:transform-center-y="0.58575321"
- transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)"
- inkscape:transform-center-x="0.58575732" />
- <circle
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="path4159"
- cx="7"
- cy="1045.3622"
- r="1" />
- <path
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 13.242641,1039.1196 a 6.0000172,6.0000172 0 0 0 -8.4852817,0 l 0.7071068,0.7071 a 5.0000172,5.0000172 0 0 1 7.0710679,0 5.0000172,5.0000172 0 0 1 0,7.071 l 0.707107,0.7071 a 6.0000172,6.0000172 0 0 0 0,-8.4852 z"
- id="circle4163"
- inkscape:connector-curvature="0"
- inkscape:transform-center-y="-0.87867618"
- inkscape:transform-center-x="-0.8786559" />
+ d="m 12,1047.3622 a 4,4 0 0 1 -2.0000001,3.4641 4,4 0 0 1 -4,0 A 4,4 0 0 1 4,1047.3622 l 4,0 z" />
+ <rect
+ style="fill:#fc9c9c;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect836"
+ width="2"
+ height="4"
+ x="7"
+ y="1045.3622"
+ ry="1" />
<path
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 11.828427,1040.5338 a 4.0000172,4.0000172 0 0 0 -5.6568541,0 l 0.7071068,0.7071 a 3.0000174,3.0000174 0 0 1 4.2426403,0 3.0000174,3.0000174 0 0 1 0,4.2426 l 0.707107,0.7071 a 4.0000172,4.0000172 0 0 0 0,-5.6568 z"
- id="circle4168"
- inkscape:connector-curvature="0"
- inkscape:transform-center-y="-0.58578284"
- inkscape:transform-center-x="-0.58576926" />
+ style="fill:none;fill-opacity:1;stroke:#fc9c9c;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path838"
+ sodipodi:type="arc"
+ sodipodi:cx="8"
+ sodipodi:cy="1045.3622"
+ sodipodi:rx="7.0000172"
+ sodipodi:ry="7.0000172"
+ sodipodi:start="3.6651914"
+ sodipodi:end="5.7595865"
+ d="m 1.9378072,1041.8622 a 7.0000172,7.0000172 0 0 1 6.0621926,-3.5 7.0000172,7.0000172 0 0 1 6.0621932,3.5"
+ sodipodi:open="true" />
<path
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 10.414214,1041.948 a 2,2 0 0 0 -2.8284276,0 l 0.7071068,0.7071 a 1.0000174,1.0000174 0 0 1 1.4142136,0 1.0000174,1.0000174 0 0 1 0,1.4142 l 0.7071072,0.7071 a 2,2 0 0 0 0,-2.8284 z"
- id="circle4172"
- inkscape:connector-curvature="0"
- inkscape:transform-center-y="-0.29289334"
- inkscape:transform-center-x="-0.29288664" />
+ r="3.645746"
+ cy="1045.3622"
+ cx="8"
+ id="path846"
+ style="fill:#fc9c9c;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
- style="fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="m 1,1051.3622 4,-5 1,0 0,5 z"
- id="path4181"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccccc" />
+ id="circle848"
+ style="fill:none;fill-opacity:1;stroke:#fc9c9c;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc"
+ sodipodi:cx="8"
+ sodipodi:cy="1045.3622"
+ sodipodi:rx="2.9999826"
+ sodipodi:ry="2.9999826"
+ sodipodi:start="3.403392"
+ sodipodi:end="6.0213859"
+ d="m 5.1022393,1044.5857 a 2.9999826,2.9999826 0 0 1 2.8977606,-2.2235 2.9999826,2.9999826 0 0 1 2.8977611,2.2235"
+ sodipodi:open="true" />
</g>
</svg>
diff --git a/editor/icons/source/icon_remote_transform_2d.svg b/editor/icons/source/icon_remote_transform_2d.svg
index 479cc0eb25..7976937a17 100644
--- a/editor/icons/source/icon_remote_transform_2d.svg
+++ b/editor/icons/source/icon_remote_transform_2d.svg
@@ -14,11 +14,11 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_remote_transform.svg">
+ sodipodi:docname="icon_remote_transform_2d.svg">
<defs
id="defs4" />
<sodipodi:namedview
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="16"
- inkscape:cx="6.9441739"
- inkscape:cy="9.4988931"
+ inkscape:cx="-4.711526"
+ inkscape:cy="5.1371642"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -64,7 +64,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -74,51 +74,47 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#a5b7f6;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="path4155"
+ style="fill:#a5b7f7;fill-opacity:0.98823529;stroke:none;stroke-width:2.66666675;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path834"
sodipodi:type="arc"
- sodipodi:cx="744.13245"
- sodipodi:cy="734.23291"
+ sodipodi:cx="8"
+ sodipodi:cy="1047.3622"
sodipodi:rx="4"
sodipodi:ry="4"
sodipodi:start="0"
sodipodi:end="3.1415927"
- d="m 748.13245,734.23291 a 4,4 0 0 1 -2,3.4641 4,4 0 0 1 -4,0 4,4 0 0 1 -2,-3.4641 l 4,0 z"
- inkscape:transform-center-y="0.58575321"
- transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)"
- inkscape:transform-center-x="0.58575732" />
- <circle
- style="opacity:1;fill:#a5b7f6;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="path4159"
- cx="7"
- cy="1045.3622"
- r="1" />
+ d="m 12,1047.3622 a 4,4 0 0 1 -2.0000001,3.4641 4,4 0 0 1 -4,0 A 4,4 0 0 1 4,1047.3622 l 4,0 z" />
+ <rect
+ style="fill:#a5b7f7;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect836"
+ width="2"
+ height="4"
+ x="7"
+ y="1045.3622"
+ ry="1" />
<path
- style="opacity:1;fill:#a5b7f6;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 13.242641,1039.1196 a 6.0000172,6.0000172 0 0 0 -8.4852817,0 l 0.7071068,0.7071 a 5.0000172,5.0000172 0 0 1 7.0710679,0 5.0000172,5.0000172 0 0 1 0,7.071 l 0.707107,0.7071 a 6.0000172,6.0000172 0 0 0 0,-8.4852 z"
- id="circle4163"
- inkscape:connector-curvature="0"
- inkscape:transform-center-y="-0.87867618"
- inkscape:transform-center-x="-0.8786559" />
- <path
- style="opacity:1;fill:#a5b7f6;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 11.828427,1040.5338 a 4.0000172,4.0000172 0 0 0 -5.6568541,0 l 0.7071068,0.7071 a 3.0000174,3.0000174 0 0 1 4.2426403,0 3.0000174,3.0000174 0 0 1 0,4.2426 l 0.707107,0.7071 a 4.0000172,4.0000172 0 0 0 0,-5.6568 z"
- id="circle4168"
- inkscape:connector-curvature="0"
- inkscape:transform-center-y="-0.58578284"
- inkscape:transform-center-x="-0.58576926" />
- <path
- style="opacity:1;fill:#a5b7f6;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 10.414214,1041.948 a 2,2 0 0 0 -2.8284276,0 l 0.7071068,0.7071 a 1.0000174,1.0000174 0 0 1 1.4142136,0 1.0000174,1.0000174 0 0 1 0,1.4142 l 0.7071072,0.7071 a 2,2 0 0 0 0,-2.8284 z"
- id="circle4172"
- inkscape:connector-curvature="0"
- inkscape:transform-center-y="-0.29289334"
- inkscape:transform-center-x="-0.29288664" />
+ style="fill:none;fill-opacity:1;stroke:#a5b7f7;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path838"
+ sodipodi:type="arc"
+ sodipodi:cx="8"
+ sodipodi:cy="1045.3622"
+ sodipodi:rx="7.0000172"
+ sodipodi:ry="7.0000172"
+ sodipodi:start="3.6651914"
+ sodipodi:end="5.7595865"
+ d="m 1.9378072,1041.8622 a 7.0000172,7.0000172 0 0 1 6.0621926,-3.5 7.0000172,7.0000172 0 0 1 6.0621932,3.5"
+ sodipodi:open="true" />
<path
- style="fill:#a5b7f6;fill-opacity:0.98823529;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="m 1,1051.3622 4,-5 1,0 0,5 z"
- id="path4181"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccccc" />
+ id="circle848"
+ style="fill:none;fill-opacity:1;stroke:#a5b7f7;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc"
+ sodipodi:cx="8"
+ sodipodi:cy="1045.3622"
+ sodipodi:rx="2.9999826"
+ sodipodi:ry="2.9999826"
+ sodipodi:start="3.403392"
+ sodipodi:end="6.0213859"
+ d="m 5.1022393,1044.5857 a 2.9999826,2.9999826 0 0 1 2.8977606,-2.2235 2.9999826,2.9999826 0 0 1 2.8977611,2.2235"
+ sodipodi:open="true" />
</g>
</svg>
diff --git a/editor/icons/source/icon_sample.svg b/editor/icons/source/icon_sample.svg
deleted file mode 100644
index 782e07a012..0000000000
--- a/editor/icons/source/icon_sample.svg
+++ /dev/null
@@ -1,128 +0,0 @@
-<?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="/home/djrm/Projects/godot/tools/editor/icons/icon_dependency_changed_hl.png"
- inkscape:export-xdpi="45"
- inkscape:export-ydpi="45"
- sodipodi:docname="icon_sample.svg">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="30.700696"
- inkscape:cx="10.421269"
- inkscape:cy="6.7982798"
- 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="false"
- inkscape:snap-object-midpoints="true"
- inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
- inkscape:window-x="0"
- inkscape:window-y="27"
- inkscape:window-maximized="1">
- <inkscape:grid
- type="xygrid"
- id="grid3336" />
- </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)">
- <rect
- style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4156"
- width="1"
- height="1.999948"
- x="-14"
- y="1043.3622"
- transform="scale(-1,1)" />
- <rect
- y="1039.3622"
- x="-12"
- height="10.000017"
- width="1"
- id="rect4158"
- style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- transform="scale(-1,1)" />
- <rect
- style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4160"
- width="1"
- height="7.9999475"
- x="-10"
- y="1040.3622"
- transform="scale(-1,1)" />
- <rect
- y="1037.3622"
- x="-8"
- height="13.999949"
- width="1"
- id="rect4162"
- style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- transform="scale(-1,1)" />
- <rect
- style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4164"
- width="1"
- height="12.000017"
- x="-6"
- y="1038.3622"
- transform="scale(-1,1)" />
- <rect
- y="1041.3622"
- x="-4"
- height="6.0000172"
- width="1"
- id="rect4166"
- style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- transform="scale(-1,1)" />
- <rect
- style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4168"
- width="1"
- height="1.9999824"
- x="-2"
- y="1043.3622"
- transform="scale(-1,1)" />
- </g>
-</svg>
diff --git a/editor/icons/source/icon_search.svg b/editor/icons/source/icon_search.svg
new file mode 100644
index 0000000000..bcd2ecca46
--- /dev/null
+++ b/editor/icons/source/icon_search.svg
@@ -0,0 +1,87 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_zoom.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_search.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="5.8093316"
+ inkscape:cy="11.467722"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 6,1037.3622 a 5,5 0 0 0 -5,5 5,5 0 0 0 5,5 5,5 0 0 0 5,-5 5,5 0 0 0 -5,-5 z m 0,2 a 3,3 0 0 1 3,3 3,3 0 0 1 -3,3 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 z"
+ id="path4135"
+ inkscape:connector-curvature="0" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect4140"
+ width="2"
+ height="7.0000172"
+ x="-733.81873"
+ y="745.30402"
+ inkscape:transform-center-y="5.3032921"
+ transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,0)"
+ inkscape:transform-center-x="-5.3033134" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_slider_joint.svg b/editor/icons/source/icon_slider_joint.svg
index 021a295186..25bccca831 100644
--- a/editor/icons/source/icon_slider_joint.svg
+++ b/editor/icons/source/icon_slider_joint.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="22.627417"
- inkscape:cx="3.8333359"
- inkscape:cy="8.8668138"
+ inkscape:cx="8.5719521"
+ inkscape:cy="9.4331459"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,9 +69,36 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 15,1037.3622 -5,0 0,6 -5,0 0,2 5,0 0,6 5,0 0,-14 z m -7,0 -5,0 -2,0 0,4 0,10 2,0 5,0 0,-4 -5,0 0,-6 5,0 0,-4 z"
- id="rect4161"
+ inkscape:connector-curvature="0"
+ id="path840"
+ d="m 3,1051.3622 h 5 l -1,-4 z"
+ style="fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ sodipodi:nodetypes="cccc" />
+ <path
+ style="fill:#fb9b9b;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+ d="m 6,1048.3622 9,-9 v 3 l -8,8 z"
+ id="path842"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path844"
+ d="m 10,1040.3622 -9,9 v -3 l 8,-8 z"
+ style="fill:#fb9b9b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccc"
+ style="fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 13,1037.3622 H 8 l 1,4 z"
+ id="path846"
inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#fb9b9b;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 10,1038.3622 H 5"
+ id="path850"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path852"
+ d="M 11,1050.3622 H 6"
+ style="fill:none;stroke:#fb9b9b;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</svg>
diff --git a/editor/icons/source/icon_spatial_shader.svg b/editor/icons/source/icon_spatial_material.svg
index 329354b716..329354b716 100644
--- a/editor/icons/source/icon_spatial_shader.svg
+++ b/editor/icons/source/icon_spatial_material.svg
diff --git a/editor/icons/source/icon_sphere_mesh.svg b/editor/icons/source/icon_sphere_mesh.svg
new file mode 100644
index 0000000000..1264ca3984
--- /dev/null
+++ b/editor/icons/source/icon_sphere_mesh.svg
@@ -0,0 +1,79 @@
+<?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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_sphere_mesh.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627416"
+ inkscape:cx="10.188774"
+ inkscape:cy="7.9201751"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:document-rotation="0">
+ <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="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffd684;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter-blend-mode:normal;filter-gaussianBlur-deviation:0;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;opacity:1"
+ d="M 8 1 C 4.1458514 1 1 4.1459 1 8 C 1 11.8542 4.1458514 15 8 15 C 11.854149 15 15 11.8542 15 8 C 15 4.1459 11.854149 1 8 1 z M 7 3.0976562 L 7 7.96875 C 5.7068959 7.8974081 4.3938983 7.6705607 3.0566406 7.2773438 C 3.3574503 5.1795086 4.9418857 3.5108322 7 3.0976562 z M 9 3.0976562 C 11.05489 3.5101849 12.637036 5.1743816 12.941406 7.2675781 C 11.636828 7.6343492 10.325593 7.8701693 9 7.9550781 L 9 3.0976562 z M 12.785156 9.3789062 C 12.276517 11.157679 10.835259 12.531968 9 12.900391 L 9 9.9492188 C 10.27916 9.876918 11.541917 9.6821761 12.785156 9.3789062 z M 3.2207031 9.3964844 C 4.4939533 9.7154019 5.7543858 9.8986297 7 9.9589844 L 7 12.900391 C 5.170884 12.533201 3.7340013 11.166534 3.2207031 9.3964844 z "
+ transform="translate(0,1036.3622)"
+ id="path4309" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_stream_texture.svg b/editor/icons/source/icon_stream_texture.svg
new file mode 100644
index 0000000000..6ec701adff
--- /dev/null
+++ b/editor/icons/source/icon_stream_texture.svg
@@ -0,0 +1,81 @@
+<?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.92.1 r"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_key.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_stream_texture.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="11.200084"
+ inkscape:cy="6.7708068"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:object-nodes="false"
+ inkscape:snap-smooth-nodes="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
+ d="M 2 1 A 1 1 0 0 0 1 2 L 1 14 A 1 1 0 0 0 2 15 L 8 15 L 8 13 L 10 13 L 10 11 L 8 11 L 3 11 L 3 3 L 8 3 L 8 1 L 2 1 z M 8 3 L 8 5 L 10 5 L 10 3 L 8 3 z M 10 3 L 12 3 L 12 1 L 10 1 L 10 3 z M 12 3 L 12 5 L 14 5 L 14 3 L 12 3 z M 12 5 L 10 5 L 10 7 L 12 7 L 12 5 z M 12 7 L 12 9 L 14 9 L 14 7 L 12 7 z M 12 9 L 10 9 L 10 11 L 12 11 L 12 9 z M 12 11 L 12 13 L 14 13 L 14 11 L 12 11 z M 12 13 L 10 13 L 10 15 L 12 15 L 12 13 z M 10 9 L 10 7 L 8 7 L 8 6 L 7 6 L 7 7 L 6 7 L 6 8 L 5 8 L 5 9 L 4 9 L 4 10 L 6 10 L 8 10 L 8 9 L 10 9 z "
+ transform="translate(0,1036.3622)"
+ id="rect4156" />
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_tabs.svg b/editor/icons/source/icon_tabs.svg
index 79ed1e5910..c09a042033 100644
--- a/editor/icons/source/icon_tabs.svg
+++ b/editor/icons/source/icon_tabs.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="22.627417"
- inkscape:cx="11.687421"
- inkscape:cy="9.3335226"
+ inkscape:zoom="32"
+ inkscape:cx="6.9623805"
+ inkscape:cy="8.3399158"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -71,73 +71,10 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4156"
- width="1"
- height="9.0000172"
- x="1"
- y="1040.3622" />
- <rect
- y="-8"
- x="1039.3622"
- height="6"
- width="1"
- id="rect4159"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- transform="matrix(0,1,-1,0,0,0)" />
- <rect
- y="1040.3622"
- x="7"
- height="3.0000174"
- width="1"
- id="rect4161"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="path4163"
- sodipodi:type="arc"
- sodipodi:cx="2"
- sodipodi:cy="1040.3622"
- sodipodi:rx="1"
- sodipodi:ry="1"
- sodipodi:start="1.5707963"
- sodipodi:end="0"
- d="m 2,1041.3622 a 1,1 0 0 1 -0.9238795,-0.6173 1,1 0 0 1 0.2167727,-1.0898 1,1 0 0 1 1.0897902,-0.2168 A 1,1 0 0 1 3,1040.3622 l -1,0 z" />
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4167"
- width="1"
- height="9.0000172"
- x="14"
- y="1040.3622" />
- <rect
- transform="matrix(0,1,-1,0,0,0)"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4169"
- width="1"
- height="6"
- x="1039.3622"
- y="-14" />
- <path
- transform="scale(-1,1)"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="path4171"
- sodipodi:type="arc"
- sodipodi:cx="-14"
- sodipodi:cy="1040.3622"
- sodipodi:rx="1"
- sodipodi:ry="1"
- sodipodi:start="1.5707963"
- sodipodi:end="0"
- d="m -14,1041.3622 a 1,1 0 0 1 -0.92388,-0.6173 1,1 0 0 1 0.216773,-1.0898 1,1 0 0 1 1.08979,-0.2168 1,1 0 0 1 0.617317,0.9239 l -1,0 z" />
- <rect
- transform="matrix(0,1,-1,0,0,0)"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4173"
- width="1"
- height="13"
- x="1042.3622"
- y="-15" />
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 5 4 C 3.8919904 4 3.1821539 4.9071 3 6 L 2 12 L 1 12 L 1 14 L 5 14 L 11 14 L 15 14 L 15 12 L 13 12 L 12 6 C 11.817843 4.9071 11.108009 4 10 4 L 5 4 z "
+ transform="translate(0,1036.3622)"
+ id="rect821" />
</g>
</svg>
diff --git a/editor/icons/source/icon_texture_rect.svg b/editor/icons/source/icon_texture_rect.svg
index 88d9b4081f..e02882812c 100644
--- a/editor/icons/source/icon_texture_rect.svg
+++ b/editor/icons/source/icon_texture_rect.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,7 +29,7 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="14.395168"
+ inkscape:cx="8.051418"
inkscape:cy="9.9171316"
inkscape:document-units="px"
inkscape:current-layer="layer1"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,33 +69,12 @@
id="layer1"
transform="translate(0,-1036.3622)">
<rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4154"
- width="1"
- height="14"
- x="1"
- y="1037.3622" />
- <rect
- y="1050.3622"
- x="1"
- height="0.9999826"
- width="14"
- id="rect4156"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4158"
- width="14"
- height="0.9999826"
- x="1"
- y="1037.3622" />
- <rect
- y="1037.3622"
- x="14"
- height="14"
- width="1"
- id="rect4160"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect818"
+ width="12"
+ height="12"
+ x="2"
+ y="1038.3622" />
<path
inkscape:connector-curvature="0"
id="rect4197"
diff --git a/editor/icons/source/icon_timer.svg b/editor/icons/source/icon_timer.svg
index 0615ab865a..f156414686 100644
--- a/editor/icons/source/icon_timer.svg
+++ b/editor/icons/source/icon_timer.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_sprite.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="32"
- inkscape:cx="4.6045193"
- inkscape:cy="8.1915618"
+ inkscape:zoom="16"
+ inkscape:cx="4.3214346"
+ inkscape:cy="13.122944"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -62,7 +62,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -72,37 +72,32 @@
id="layer1"
transform="translate(0,-1036.3622)">
<rect
- style="opacity:1;fill:#fefeff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4175"
- width="1"
- height="1"
- x="20"
- y="1042.3622" />
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:1.85164022;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect818"
+ width="12"
+ height="2"
+ x="2"
+ y="1037.3622"
+ ry="1" />
<rect
- y="1042.3622"
- x="29"
- height="1"
- width="1"
- id="rect4177"
- style="opacity:1;fill:#fefeff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" />
+ ry="1"
+ y="1049.3622"
+ x="2"
+ height="2"
+ width="12"
+ id="rect820"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:1.85164022;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
- style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- d="M 8 1 A 7.0000172 7.0000172 0 0 0 1 8 A 7.0000172 7.0000172 0 0 0 8 15 A 7.0000172 7.0000172 0 0 0 15 8 A 7.0000172 7.0000172 0 0 0 8 1 z M 8 3 A 5.0000172 5.0000172 0 0 1 13 8 A 5.0000172 5.0000172 0 0 1 8 13 A 5.0000172 5.0000172 0 0 1 3 8 A 5.0000172 5.0000172 0 0 1 8 3 z "
- transform="translate(0,1036.3622)"
- id="path4156" />
- <rect
- style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4161"
- width="2"
- height="3.9999826"
- x="7"
- y="1041.3622" />
- <rect
- y="1043.3622"
- x="7"
- height="1.9999826"
- width="4"
- id="rect4163"
- style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" />
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 3,1050.3622 h 10 l -3,-6 H 6 Z"
+ id="path838"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 3,1038.3622 h 10 c 0,2 -3,4 -4,6 1,2 4,4 4,6 H 3 c 0,-2 3,-4 4,-6 -1,-2 -4,-4 -4,-6 z"
+ id="path840"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccc" />
</g>
</svg>
diff --git a/editor/icons/source/icon_tool_button.svg b/editor/icons/source/icon_tool_button.svg
index 1c5176c8c9..6fb580bc7f 100644
--- a/editor/icons/source/icon_tool_button.svg
+++ b/editor/icons/source/icon_tool_button.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_button.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="8.173168"
- inkscape:cy="9.7479984"
+ inkscape:cx="7.704418"
+ inkscape:cy="7.4979984"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -60,7 +60,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,26 +69,44 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
- <path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 1 3 L 1 11 L 15 11 L 15 3 L 1 3 z M 11 4 A 3 3 0 0 1 13.826172 6 L 11 6 A 1 1 0 0 0 10 7 A 1 1 0 0 0 11 8 L 13.824219 8 A 3 3 0 0 1 11 10 A 3 3 0 0 1 8.1757812 8 L 3 8 A 1 1 0 0 1 2 7 A 1 1 0 0 1 3 6 L 8.1738281 6 A 3 3 0 0 1 11 4 z "
- transform="translate(0,1036.3622)"
- id="rect4139" />
<rect
- transform="scale(1,-1)"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4160"
- width="14"
- height="2.0000522"
- x="1"
- y="-1049.3622" />
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect829"
+ width="6"
+ height="4"
+ x="2"
+ y="1047.3622"
+ ry="1.5" />
<rect
- y="-1049.3622"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:1.71867573;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect825"
+ width="8"
+ height="2.0000174"
x="1"
- height="2.0000522"
- width="14"
- id="rect4142"
- style="opacity:1;fill:#000000;fill-opacity:0.07843138;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- transform="scale(1,-1)" />
+ y="1049.3622"
+ ry="0" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 2,1042.3622 3,2 3,-2"
+ id="path831"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 5,1039.3622 v 5"
+ id="path833"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <g
+ id="layer1-7"
+ inkscape:label="Layer 1"
+ transform="translate(9,-1)"
+ style="fill:#a5efac;fill-opacity:1">
+ <path
+ id="path828"
+ d="m 2,1038.536 c -1.1978593,0.4235 -1.9990448,1.5557 -2,2.8262 9.552e-4,1.2705 0.8021407,2.4027 2,2.8262 v 6.1738 1 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -4 -3.1758 c 1.197184,-0.4232 1.998218,-1.5544 2,-2.8242 -0.00178,-1.2698 -0.802816,-2.401 -2,-2.8242 v 2.8242 c 0,0.5523 -0.447715,1 -1,1 -0.552285,0 -1,-0.4477 -1,-1 z"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccsssccccsssc" />
+ </g>
</g>
</svg>
diff --git a/editor/icons/source/icon_tools.svg b/editor/icons/source/icon_tools.svg
index f2b8cd9343..030d38f6cf 100644
--- a/editor/icons/source/icon_tools.svg
+++ b/editor/icons/source/icon_tools.svg
@@ -14,11 +14,11 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_g_d_script.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_g_d_script.svg">
+ sodipodi:docname="icon_tools.svg">
<defs
id="defs4" />
<sodipodi:namedview
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="32"
- inkscape:cx="6.7306265"
- inkscape:cy="9.0071681"
+ inkscape:zoom="22.627417"
+ inkscape:cx="17.67723"
+ inkscape:cy="10.600994"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,9 +69,9 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 7 1 L 6.4355469 3.2578125 A 5.0000172 5.0000172 0 0 0 5.7460938 3.5371094 L 3.7578125 2.34375 L 2.34375 3.7578125 L 3.5390625 5.7519531 A 5.0000172 5.0000172 0 0 0 3.2539062 6.4375 L 1 7 L 1 9 L 3.2578125 9.5644531 A 5.0000172 5.0000172 0 0 0 3.5371094 10.251953 L 2.34375 12.242188 L 3.7578125 13.65625 L 5.7519531 12.460938 A 5.0000172 5.0000172 0 0 0 6.4375 12.746094 L 7 15 L 9 15 L 9.5644531 12.742188 A 5.0000172 5.0000172 0 0 0 10.251953 12.462891 L 12.242188 13.65625 L 13.65625 12.242188 L 12.460938 10.248047 A 5.0000172 5.0000172 0 0 0 12.746094 9.5625 L 15 9 L 15 7 L 12.742188 6.4355469 A 5.0000172 5.0000172 0 0 0 12.462891 5.7480469 L 13.65625 3.7578125 L 12.242188 2.34375 L 10.248047 3.5390625 A 5.0000172 5.0000172 0 0 0 9.5625 3.2539062 L 9 1 L 7 1 z M 8 6 A 2.0000174 2.0000174 0 0 1 10 8 A 2.0000174 2.0000174 0 0 1 8 10 A 2.0000174 2.0000174 0 0 1 6 8 A 2.0000174 2.0000174 0 0 1 8 6 z "
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 4 1 L 3 3 L 4 5 L 4 9 L 2 9 L 2 12 L 2 12.5 C 2 13.885 3.115 15 4.5 15 C 5.885 15 7 13.885 7 12.5 L 7 11.5 L 7 9 L 5 9 L 5 5 L 6 3 L 5 1 L 4 1 z M 10 1.1738281 A 3 3 0 0 0 8 4 A 3 3 0 0 0 10 6.8261719 L 10 13 L 10 14 C 10 14.554 10.446 15 11 15 C 11.554 15 12 14.554 12 14 L 12 10 L 12 6.8242188 A 3 3 0 0 0 14 4 A 3 3 0 0 0 12 1.1757812 L 12 4 A 1 1 0 0 1 11 5 A 1 1 0 0 1 10 4 L 10 1.1738281 z "
transform="translate(0,1036.3622)"
- id="path4176" />
+ id="path828" />
</g>
</svg>
diff --git a/editor/icons/source/icon_tree.svg b/editor/icons/source/icon_tree.svg
index b31fd38097..0c2b20f458 100644
--- a/editor/icons/source/icon_tree.svg
+++ b/editor/icons/source/icon_tree.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_sprite.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="45.254834"
- inkscape:cx="10.885344"
- inkscape:cy="6.8775392"
+ inkscape:zoom="22.627417"
+ inkscape:cx="7.8708755"
+ inkscape:cy="9.6521385"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -62,7 +62,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -85,45 +85,48 @@
width="1"
id="rect4177"
style="opacity:1;fill:#fefeff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" />
- <path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- d="M 3 1 A 2 2 0 0 0 1.5859375 1.5859375 A 2 2 0 0 0 1 3 L 1 13 A 2 2 0 0 0 1.5859375 14.414062 A 2 2 0 0 0 3 15 L 13 15 A 2 2 0 0 0 15 13 L 15 3 A 2 2 0 0 0 13 1 L 3 1 z M 3 2 L 13 2 A 1.0000174 1.0000174 0 0 1 14 3 L 14 13 A 1.0000174 1.0000174 0 0 1 13 14 L 3 14 A 1.0000174 1.0000174 0 0 1 2 13 L 2 3 A 1.0000174 1.0000174 0 0 1 3 2 z "
- transform="translate(0,1036.3622)"
- id="rect4179" />
<rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4173"
- width="1"
- height="5.0000172"
- x="4"
- y="1040.3622" />
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect821"
+ width="14"
+ height="2"
+ x="1"
+ y="1037.3622" />
<rect
y="1041.3622"
- x="4"
- height="1.0000174"
- width="8"
- id="rect4176"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" />
+ x="6"
+ height="2"
+ width="9"
+ id="rect823"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:1.60356748;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4178"
- width="7"
- height="1.0000174"
- x="5"
- y="1044.3622" />
- <rect
- y="1045.3622"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:1.51185787;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect825"
+ width="8"
+ height="2"
x="7"
- height="3.0000174"
- width="1"
- id="rect4180"
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" />
+ y="1045.3622" />
<rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4191"
- width="5"
- height="1"
+ y="1049.3622"
x="7"
- y="1047.3622" />
+ height="2"
+ width="8"
+ id="rect827"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:1.51185787;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 2,1038.3622 v 4 h 4"
+ id="path829"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 6,1042.3622 v 4 h 3"
+ id="path831"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 2,1040.3622 v 10 h 7"
+ id="path833"
+ inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_tween.svg b/editor/icons/source/icon_tween.svg
index 5cb5cad227..7857c5f187 100644
--- a/editor/icons/source/icon_tween.svg
+++ b/editor/icons/source/icon_tween.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_tween.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="6.0670176"
- inkscape:cy="10.041334"
+ inkscape:cx="4.9605895"
+ inkscape:cy="8.5201258"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -71,28 +71,25 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 9,1050.3622 -7,0 0,-7"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#fbe87a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 1,1043.3613 v 8 h 8 v -2 H 3 v -6 z"
id="path4138"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccc" />
+ inkscape:connector-curvature="0" />
<path
- sodipodi:nodetypes="ccc"
- inkscape:connector-curvature="0"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#fbe87a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 7,1037.3613 v 2 h 6 v 6 h 2 v -8 z"
id="path4140"
- d="m 7,1038.3622 7,0 0,7"
- style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="cccc"
inkscape:connector-curvature="0"
id="path4142"
d="m 6.0000002,1041.3622 4.9999998,0 0,5 z"
- style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ style="opacity:1;fill:#fbe87a;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
- inkscape:connector-curvature="0"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#fbe87a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 8.2929688,1042.6543 -7,7 1.4140624,1.4141 7,-7 z"
id="path4144"
- d="m 2,1050.3622 7,-7"
- style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- sodipodi:nodetypes="cc" />
+ inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_v_button_array.svg b/editor/icons/source/icon_v_button_array.svg
index aded4b401b..08fc7d7614 100644
--- a/editor/icons/source/icon_v_button_array.svg
+++ b/editor/icons/source/icon_v_button_array.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_button.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="32"
- inkscape:cx="5.9547041"
- inkscape:cy="8.9802416"
+ inkscape:zoom="22.627417"
+ inkscape:cx="8.7528394"
+ inkscape:cy="11.065221"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -63,7 +63,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -72,29 +72,20 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4156"
- width="14"
- height="6.0000172"
- x="1"
- y="1037.3622" />
- <rect
- y="1042.3622"
- x="1"
- height="0.99996543"
- width="14"
- id="rect4161"
- style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <g
+ id="layer1-7"
+ inkscape:label="Layer 1"
+ transform="translate(11.5,-2.9999826)"
+ style="fill:#a5efac;fill-opacity:1" />
<path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 1 9 L 1 15 L 3 13 L 5 15 L 7 13 L 9 15 L 11 13 L 13 15 L 15 13 L 15 9 L 1 9 z "
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 7 1 L 7 3.1328125 L 5.5546875 2.1679688 L 4.4453125 3.8320312 L 7.4453125 5.8320312 C 7.7812145 6.0559312 8.2187855 6.0559313 8.5546875 5.8320312 L 11.554688 3.8320312 L 10.445312 2.1679688 L 9 3.1328125 L 9 1 L 7 1 z M 6.5 7 C 5.669 7 5 7.669 5 8.5 L 5 9 L 4 9 L 4 11 L 6 11 L 6 9 L 10 9 L 10 11 L 12 11 L 12 9 L 11 9 L 11 8.5 C 11 7.669 10.331 7 9.5 7 L 6.5 7 z "
transform="translate(0,1036.3622)"
- id="rect4157" />
+ id="rect829-9" />
<path
- style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 1 14 L 1 15 L 2 14 L 1 14 z M 4 14 L 5 15 L 6 14 L 4 14 z M 8 14 L 9 15 L 10 14 L 8 14 z M 12 14 L 13 15 L 14 14 L 12 14 z "
- transform="translate(0,1036.3622)"
- id="rect4159" />
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 7,1046.3622 v 2 H 5 v 2 h 2 v 2 h 2 v -2 h 2 v -2 H 9 v -2 z"
+ id="rect836"
+ inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_v_scroll_bar.svg b/editor/icons/source/icon_v_scroll_bar.svg
index 659dc39b0b..8ad6baa5b3 100644
--- a/editor/icons/source/icon_v_scroll_bar.svg
+++ b/editor/icons/source/icon_v_scroll_bar.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,7 +29,7 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="10.543346"
+ inkscape:cx="4.199596"
inkscape:cy="9.3134214"
inkscape:document-units="px"
inkscape:current-layer="layer1"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -63,7 +63,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -73,26 +73,9 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 13,1039.3622 c 0,-1.1046 -0.89543,-2 -2,-2 l -6,0 c -1.104569,0 -2,0.8954 -2,2 l 0,10 c 0,1.1046 0.895431,2 2,2 l 6,0 c 1.10457,0 2,-0.8954 2,-2 z m -2,0 0,10 -6,0 0,-10 z"
- id="rect4140"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="sssssssssccccc" />
- <rect
- style="opacity:1;fill:none;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4181"
- width="4"
- height="4"
- x="1042.3622"
- y="-8"
- transform="matrix(0,1,-1,0,0,0)" />
- <rect
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4187"
- width="4"
- height="4"
- x="1040.3622"
- y="-10"
- transform="matrix(0,1,-1,0,0,0)" />
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 5 1 C 3.8919904 1 3 1.8919904 3 3 L 3 13 C 3 14.10801 3.8919904 15 5 15 L 11 15 C 12.10801 15 13 14.10801 13 13 L 13 3 C 13 1.8919904 12.10801 1 11 1 L 5 1 z M 7.9882812 2 A 1.0001 1.0001 0 0 1 8.5546875 2.1679688 L 11.554688 4.1679688 A 1.0001 1.0001 0 1 1 10.445312 5.8320312 L 8 4.203125 L 5.5546875 5.8320312 A 1.0001 1.0001 0 1 1 4.4453125 4.1679688 L 7.4453125 2.1679688 A 1.0001 1.0001 0 0 1 7.9882812 2 z M 4.9902344 9.9921875 A 1.0001 1.0001 0 0 1 5.5546875 10.167969 L 8 11.798828 L 10.445312 10.167969 A 1.0001 1.0001 0 1 1 11.554688 11.832031 L 8.5546875 13.832031 A 1.0001 1.0001 0 0 1 7.4453125 13.832031 L 4.4453125 11.832031 A 1.0001 1.0001 0 0 1 4.9902344 9.9921875 z "
+ transform="translate(0,1036.3622)"
+ id="rect825" />
</g>
</svg>
diff --git a/editor/icons/source/icon_v_slider.svg b/editor/icons/source/icon_v_slider.svg
index 74b59cfce5..e13c008d3a 100644
--- a/editor/icons/source/icon_v_slider.svg
+++ b/editor/icons/source/icon_v_slider.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
- inkscape:cx="9.3533577"
- inkscape:cy="8.3875011"
+ inkscape:cx="2.2553429"
+ inkscape:cy="8.5533887"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -63,7 +63,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -73,15 +73,39 @@
id="layer1"
transform="translate(0,-1036.3622)">
<path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 9,1038.3622 a 1,1 0 0 0 -1,-1 1,1 0 0 0 -1,1 l 0,3.1738 a 3,3 0 0 1 1,-0.1738 3,3 0 0 1 1,0.1758 l 0,-3.1758 z m 0,8.8262 a 3,3 0 0 1 -1,0.1738 3,3 0 0 1 -1,-0.1758 l 0,3.1758 a 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 l 0,-3.1738 z"
- id="rect4157"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#a5efac;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 5.99995,1050.3623 a 1.0001,1.0001 0 1 1 -2,0 v -2.1308 a 4,4 0 0 0 1,0.1308 4,4 0 0 0 1,-0.1328 z m 0,-9.8691 a 4,4 0 0 0 -1,-0.1309 4,4 0 0 0 -1,0.1329 v -2.1329 a 1.0001,1.0001 0 1 1 2,0 z"
+ id="path817"
inkscape:connector-curvature="0" />
<circle
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="path4167"
- cx="8"
- cy="1044.3622"
- r="2" />
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path824"
+ cx="-1039.3623"
+ cy="-4.9999676"
+ r="2"
+ transform="matrix(0,-1,-1,0,0,0)" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 11.99995,1038.3623 h -2"
+ id="path835"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 10.99995,1044.3623 v 0"
+ id="path837"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 11.99995,1050.3623 h -2"
+ id="path839"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 5.99995,1049.3623 h -2 v -6.1308 a 4,4 0 0 0 1,0.1308 4,4 0 0 0 1,-0.1328 z"
+ id="rect841" />
</g>
</svg>
diff --git a/editor/icons/source/icon_variant.svg b/editor/icons/source/icon_variant.svg
new file mode 100644
index 0000000000..d966190ab0
--- /dev/null
+++ b/editor/icons/source/icon_variant.svg
@@ -0,0 +1,146 @@
+<?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.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_variant.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627418"
+ inkscape:cx="12.635414"
+ inkscape:cy="11.860443"
+ 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="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </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)">
+ <g
+ transform="translate(0,-3)"
+ id="layer1-5"
+ inkscape:label="Layer 1"
+ style="fill:#e0e0e0;fill-opacity:1">
+ <rect
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4320"
+ width="2"
+ height="5.9999666"
+ x="3"
+ y="1044.3622" />
+ <rect
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4324"
+ width="2"
+ height="5.9999843"
+ x="6"
+ y="1044.3622" />
+ <rect
+ y="1044.3622"
+ x="3"
+ height="2.0000174"
+ width="1"
+ id="rect4326"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 3,1044.3622 a 3,3 0 0 0 -3,3 h 2 a 1.0000174,1.0000174 0 0 1 1,-1 z"
+ id="path4328"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path4330"
+ d="m 14,1050.3622 a 3,3 0 0 1 -3,-3 h 2 a 1.0000174,1.0000174 0 0 0 1,1 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ inkscape:connector-curvature="0" />
+ <rect
+ transform="scale(1,-1)"
+ y="-1052.3622"
+ x="14"
+ height="7.9999843"
+ width="2"
+ id="rect4334"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ transform="scale(1,-1)"
+ y="-1047.3622"
+ x="11"
+ height="2.9999826"
+ width="2"
+ id="rect4338"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4340"
+ d="m 3,1050.3622 a 3,3 0 0 1 -3,-3 h 2 a 1.0000174,1.0000174 0 0 0 1,1 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4342"
+ d="m 8,1044.3622 a 3,3 0 0 1 3,3 H 9 a 1.0000174,1.0000174 0 0 0 -1,-1 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ y="1047.3622"
+ x="9"
+ height="3.0000174"
+ width="2"
+ id="rect4344"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ </g>
+</svg>
diff --git a/editor/icons/source/icon_video_player.svg b/editor/icons/source/icon_video_player.svg
index bfb499518b..a049791930 100644
--- a/editor/icons/source/icon_video_player.svg
+++ b/editor/icons/source/icon_video_player.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_sprite.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="16"
- inkscape:cx="4.9323208"
- inkscape:cy="11.020342"
+ inkscape:zoom="22.627417"
+ inkscape:cx="6.7289895"
+ inkscape:cy="10.226546"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -62,7 +62,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -72,29 +72,26 @@
id="layer1"
transform="translate(0,-1036.3622)">
<rect
- style="opacity:1;fill:#fefeff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4175"
- width="1"
- height="1"
- x="20"
- y="1042.3622" />
- <rect
- y="1042.3622"
- x="29"
- height="1"
- width="1"
- id="rect4177"
- style="opacity:1;fill:#fefeff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" />
- <path
- style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- d="M 3 1 A 2 2 0 0 0 1.5859375 1.5859375 A 2 2 0 0 0 1 3 L 1 13 A 2 2 0 0 0 1.5859375 14.414062 A 2 2 0 0 0 3 15 L 13 15 A 2 2 0 0 0 15 13 L 15 3 A 2 2 0 0 0 13 1 L 3 1 z M 3 2 L 13 2 A 1.0000174 1.0000174 0 0 1 14 3 L 14 13 A 1.0000174 1.0000174 0 0 1 13 14 L 3 14 A 1.0000174 1.0000174 0 0 1 2 13 L 2 3 A 1.0000174 1.0000174 0 0 1 3 2 z "
- transform="translate(0,1036.3622)"
- id="rect4179" />
+ style="fill:none;fill-opacity:1;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect819"
+ width="12"
+ height="12"
+ x="2"
+ y="1038.3622"
+ ry="1.0000174" />
<path
style="fill:#a5efac;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="m 6,1047.3622 0,-6 5,3 z"
+ d="m 6,1045.3622 v -4 l 4,2 z"
id="path4180"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
+ <rect
+ style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect821"
+ width="10"
+ height="2"
+ x="3"
+ y="1047.3622"
+ ry="0" />
</g>
</svg>
diff --git a/editor/icons/source/icon_visual_script.svg b/editor/icons/source/icon_visual_script.svg
index be4b47ca54..d82cb36cb5 100644
--- a/editor/icons/source/icon_visual_script.svg
+++ b/editor/icons/source/icon_visual_script.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_canvas_item_shader_graph.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="15.999999"
- inkscape:cx="2.7930637"
- inkscape:cy="10.792256"
+ inkscape:zoom="22.627416"
+ inkscape:cx="9.8155367"
+ inkscape:cy="10.356948"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -61,7 +61,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -70,11 +70,6 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
- <path
- style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="M 3 1 A 2 2 0 0 0 1 3 A 2 2 0 0 0 2 4.7304688 L 2 11.271484 A 2 2 0 0 0 1 13 A 2 2 0 0 0 3 15 A 2 2 0 0 0 5 13 A 2 2 0 0 0 4 11.269531 L 4 5.4140625 L 6.2929688 7.7070312 L 7.7070312 6.2929688 L 5.4140625 4 L 11.271484 4 A 2 2 0 0 0 13 5 A 2 2 0 0 0 15 3 A 2 2 0 0 0 13 1 A 2 2 0 0 0 11.269531 2 L 4.7285156 2 A 2 2 0 0 0 3 1 z "
- transform="translate(0,1036.3622)"
- id="path4198" />
<ellipse
r="2"
style="opacity:1;fill:#6e6e6e;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
@@ -82,10 +77,9 @@
cx="3"
cy="1039.3622" />
<path
- style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
- d="m 11,1050.3622 3,-3 -3,-3"
- id="path3378"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccc" />
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 7 1 L 6.4355469 3.2578125 A 5.0000172 5.0000172 0 0 0 5.7460938 3.5371094 L 3.7578125 2.34375 L 2.34375 3.7578125 L 3.5390625 5.7519531 A 5.0000172 5.0000172 0 0 0 3.2539062 6.4375 L 1 7 L 1 9 L 6.2714844 9 A 2.0000174 2.0000174 0 0 1 6 8 A 2.0000174 2.0000174 0 0 1 8 6 A 2.0000174 2.0000174 0 0 1 10 8 A 2.0000174 2.0000174 0 0 1 9.7304688 9 L 15 9 L 15 7 L 12.742188 6.4355469 A 5.0000172 5.0000172 0 0 0 12.462891 5.7480469 L 13.65625 3.7578125 L 12.242188 2.34375 L 10.248047 3.5390625 A 5.0000172 5.0000172 0 0 0 9.5625 3.2539062 L 9 1 L 7 1 z M 3 10 L 3 16 L 5 16 A 3 3 0 0 0 8 13 L 8 10 L 6 10 L 6 13 A 1.0000174 1.0000174 0 0 1 5 14 L 5 10 L 3 10 z M 11 10 A 2 2 0 0 0 9.2675781 11 A 2 2 0 0 0 9.2675781 13 A 2 2 0 0 0 11 14 L 9 14 L 9 16 L 11 16 A 2 2 0 0 0 12.732422 15 A 2 2 0 0 0 12.732422 13 A 2 2 0 0 0 11 12 L 13 12 L 13 10 L 11 10 z "
+ transform="translate(0,1036.3622)"
+ id="path4176" />
</g>
</svg>
diff --git a/editor/icons/source/icon_warning.svg b/editor/icons/source/icon_warning.svg
index 4d39141a58..d886fbdaed 100644
--- a/editor/icons/source/icon_warning.svg
+++ b/editor/icons/source/icon_warning.svg
@@ -14,7 +14,7 @@
viewBox="0 0 8 8"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -29,7 +29,7 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="45.254832"
- inkscape:cx="2.2320862"
+ inkscape:cx="-2.2536226"
inkscape:cy="6.41947"
inkscape:document-units="px"
inkscape:current-layer="layer1"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -76,6 +76,6 @@
height="8"
x="0"
y="1044.3622"
- ry="1" />
+ ry="4" />
</g>
</svg>
diff --git a/editor/icons/source/icon_world_environment.svg b/editor/icons/source/icon_world_environment.svg
index 912e348c81..33e7f86137 100644
--- a/editor/icons/source/icon_world_environment.svg
+++ b/editor/icons/source/icon_world_environment.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/icon_node_2d.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="31.999999"
- inkscape:cx="2.4346197"
- inkscape:cy="8.8876091"
+ inkscape:zoom="22.627416"
+ inkscape:cx="13.590088"
+ inkscape:cy="8.7617352"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -64,7 +64,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -73,36 +73,29 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
+ <circle
+ style="fill:none;fill-opacity:1;stroke:#fc9c9c;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ id="path814"
+ cx="8"
+ cy="1044.3622"
+ r="6" />
<path
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- d="M 8 1 A 7 7 0 0 0 1 8 A 7 7 0 0 0 8 15 A 7 7 0 0 0 15 8 A 7 7 0 0 0 8 1 z M 8 2 A 6 6 0 0 1 14 8 A 6 6 0 0 1 8 14 A 6 6 0 0 1 2 8 A 6 6 0 0 1 8 2 z "
- transform="translate(0,1036.3622)"
- id="path4158" />
- <rect
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
- id="rect4163"
- width="12"
- height="1"
- x="2"
- y="1041.3622" />
- <rect
- y="1046.3622"
- x="2"
- height="1"
- width="12"
- id="rect4165"
- style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" />
+ style="fill:none;stroke:#fc9c9c;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="m 2,1044.3622 c 4.5932382,1.582 8.398513,1.0627 12,0"
+ id="path816"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
<path
- style="fill:none;fill-rule:evenodd;stroke:#fc9c9c;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843"
- d="m 8,1038.3622 c 0,0 -3.5,2 -3.5,6 0,4 3.5,6 3.5,6"
- id="path4167"
+ sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
- sodipodi:nodetypes="czc" />
+ id="path820"
+ d="m 8,1038.3622 c -3,4 -3,8 0,12"
+ style="fill:none;stroke:#fc9c9c;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
<path
- sodipodi:nodetypes="czc"
+ style="fill:none;stroke:#fc9c9c;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="m 8,1038.3622 c 3,4 3,8 0,12"
+ id="path822"
inkscape:connector-curvature="0"
- id="path4169"
- d="m 8,1038.3622 c 0,0 3.5,2 3.5,6 0,4 -3.5,6 -3.5,6"
- style="fill:none;fill-rule:evenodd;stroke:#fc9c9c;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843" />
+ sodipodi:nodetypes="cc" />
</g>
</svg>
diff --git a/editor/icons/source/icon_zoom.svg b/editor/icons/source/icon_zoom.svg
index 811036b370..de94ed9614 100644
--- a/editor/icons/source/icon_zoom.svg
+++ b/editor/icons/source/icon_zoom.svg
@@ -14,7 +14,7 @@
viewBox="0 0 16 16"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_zoom.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -28,9 +28,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="22.627417"
- inkscape:cx="3.7772222"
- inkscape:cy="11.922647"
+ inkscape:zoom="32"
+ inkscape:cx="9.872627"
+ inkscape:cy="8.8162049"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -42,8 +42,8 @@
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
- inkscape:window-width="1920"
- inkscape:window-height="1016"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
@@ -59,7 +59,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -70,18 +70,8 @@
transform="translate(0,-1036.3622)">
<path
style="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 6,1037.3622 a 5,5 0 0 0 -5,5 5,5 0 0 0 5,5 5,5 0 0 0 5,-5 5,5 0 0 0 -5,-5 z m 0,2 a 3,3 0 0 1 3,3 3,3 0 0 1 -3,3 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 z"
- id="path4135"
- inkscape:connector-curvature="0" />
- <rect
- style="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect4140"
- width="2"
- height="7.0000172"
- x="-733.81873"
- y="745.30402"
- inkscape:transform-center-y="5.3032921"
- transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,0)"
- inkscape:transform-center-x="-5.3033134" />
+ d="M 6 1 A 5 5 0 0 0 1 6 A 5 5 0 0 0 6 11 A 5 5 0 0 0 8.7519531 10.166016 L 13.070312 14.484375 L 14.484375 13.070312 L 10.166016 8.7519531 A 5 5 0 0 0 10.576172 8 L 10 8 L 10 6 L 9 6 A 3 3 0 0 1 6 9 A 3 3 0 0 1 3 6 A 3 3 0 0 1 6 3 A 3 3 0 0 1 8 3.7675781 L 8 2 L 8.9902344 2 A 5 5 0 0 0 6 1 z M 11 1 L 11 3 L 9 3 L 9 5 L 11 5 L 11 7 L 13 7 L 13 5 L 15 5 L 15 3 L 13 3 L 13 1 L 11 1 z "
+ transform="translate(0,1036.3622)"
+ id="path4135" />
</g>
</svg>
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index 93614fb511..a75147a3a9 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -71,7 +72,7 @@ struct ColladaImport {
Map<String, NodeMap> node_map; //map from collada node to engine node
Map<String, String> node_name_map; //map from collada node to engine node
- Map<String, Ref<Mesh> > mesh_cache;
+ Map<String, Ref<ArrayMesh> > mesh_cache;
Map<String, Ref<Curve3D> > curve_cache;
Map<String, Ref<Material> > material_cache;
Map<Collada::Node *, Skeleton *> skeleton_map;
@@ -86,8 +87,8 @@ struct ColladaImport {
Error _create_scene_skeletons(Collada::Node *p_node);
Error _create_scene(Collada::Node *p_node, Spatial *p_parent);
Error _create_resources(Collada::Node *p_node);
- Error _create_material(const String &p_material);
- Error _create_mesh_surfaces(bool p_optimize, Ref<Mesh> &p_mesh, const Map<String, Collada::NodeGeometry::Material> &p_material_map, const Collada::MeshData &meshdata, const Transform &p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_data, const Collada::MorphControllerData *p_morph_data, Vector<Ref<Mesh> > p_morph_meshes = Vector<Ref<Mesh> >(), bool p_for_morph = false, bool p_use_mesh_material = false);
+ Error _create_material(const String &p_target);
+ Error _create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_mesh, const Map<String, Collada::NodeGeometry::Material> &p_material_map, const Collada::MeshData &meshdata, const Transform &p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, Vector<Ref<ArrayMesh> > p_morph_meshes = Vector<Ref<ArrayMesh> >(), bool p_for_morph = false, bool p_use_mesh_material = false);
Error load(const String &p_path, int p_flags, bool p_force_make_tangents = false);
void _fix_param_animation_tracks();
void create_animation(int p_clip, bool p_make_tracks_in_all_bones, bool p_import_value_tracks);
@@ -364,7 +365,7 @@ Error ColladaImport::_create_material(const String &p_target) {
ERR_FAIL_COND_V(!collada.state.effect_map.has(src_mat.instance_effect), ERR_INVALID_PARAMETER);
Collada::Effect &effect = collada.state.effect_map[src_mat.instance_effect];
- Ref<FixedSpatialMaterial> material = memnew(FixedSpatialMaterial);
+ Ref<SpatialMaterial> material = memnew(SpatialMaterial);
if (src_mat.name != "")
material->set_name(src_mat.name);
@@ -381,15 +382,15 @@ Error ColladaImport::_create_material(const String &p_target) {
Ref<Texture> texture = ResourceLoader::load(texfile, "Texture");
if (texture.is_valid()) {
- material->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO, texture);
+ material->set_texture(SpatialMaterial::TEXTURE_ALBEDO, texture);
material->set_albedo(Color(1, 1, 1, 1));
- //material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1,1));
+ //material->set_parameter(SpatialMaterial::PARAM_DIFFUSE,Color(1,1,1,1));
} else {
missing_textures.push_back(texfile.get_file());
}
}
} else {
- //material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,effect.diffuse.color);
+ material->set_albedo(effect.diffuse.color);
}
// SPECULAR
@@ -401,17 +402,18 @@ Error ColladaImport::_create_material(const String &p_target) {
Ref<Texture> texture = ResourceLoader::load(texfile, "Texture");
if (texture.is_valid()) {
- material->set_texture(FixedSpatialMaterial::TEXTURE_SPECULAR, texture);
- material->set_specular(Color(1, 1, 1, 1));
+ material->set_texture(SpatialMaterial::TEXTURE_METALLIC, texture);
+ material->set_specular(1.0);
- //material->set_texture(FixedSpatialMaterial::PARAM_SPECULAR,texture);
- //material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,Color(1,1,1,1));
+ //material->set_texture(SpatialMaterial::PARAM_SPECULAR,texture);
+ //material->set_parameter(SpatialMaterial::PARAM_SPECULAR,Color(1,1,1,1));
} else {
missing_textures.push_back(texfile.get_file());
}
}
+
} else {
- material->set_metalness(effect.specular.color.get_v());
+ material->set_metallic(effect.specular.color.get_v());
}
// EMISSION
@@ -424,18 +426,18 @@ Error ColladaImport::_create_material(const String &p_target) {
Ref<Texture> texture = ResourceLoader::load(texfile, "Texture");
if (texture.is_valid()) {
- material->set_feature(FixedSpatialMaterial::FEATURE_EMISSION, true);
- material->set_texture(FixedSpatialMaterial::TEXTURE_EMISSION, texture);
+ material->set_feature(SpatialMaterial::FEATURE_EMISSION, true);
+ material->set_texture(SpatialMaterial::TEXTURE_EMISSION, texture);
material->set_emission(Color(1, 1, 1, 1));
- //material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,Color(1,1,1,1));
+ //material->set_parameter(SpatialMaterial::PARAM_EMISSION,Color(1,1,1,1));
} else {
missing_textures.push_back(texfile.get_file());
}
}
} else {
if (effect.emission.color != Color()) {
- material->set_feature(FixedSpatialMaterial::FEATURE_EMISSION, true);
+ material->set_feature(SpatialMaterial::FEATURE_EMISSION, true);
material->set_emission(effect.emission.color);
}
}
@@ -449,11 +451,11 @@ Error ColladaImport::_create_material(const String &p_target) {
Ref<Texture> texture = ResourceLoader::load(texfile, "Texture");
if (texture.is_valid()) {
- material->set_feature(FixedSpatialMaterial::FEATURE_NORMAL_MAPPING, true);
- material->set_texture(FixedSpatialMaterial::TEXTURE_NORMAL, texture);
+ material->set_feature(SpatialMaterial::FEATURE_NORMAL_MAPPING, true);
+ material->set_texture(SpatialMaterial::TEXTURE_NORMAL, texture);
//material->set_emission(Color(1,1,1,1));
- //material->set_texture(FixedSpatialMaterial::PARAM_NORMAL,texture);
+ //material->set_texture(SpatialMaterial::PARAM_NORMAL,texture);
} else {
//missing_textures.push_back(texfile.get_file());
}
@@ -464,9 +466,9 @@ Error ColladaImport::_create_material(const String &p_target) {
material->set_roughness(roughness);
if (effect.double_sided) {
- material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
+ material->set_cull_mode(SpatialMaterial::CULL_DISABLED);
}
- material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, effect.unshaded);
+ material->set_flag(SpatialMaterial::FLAG_UNSHADED, effect.unshaded);
material_cache[p_target] = material;
return OK;
@@ -589,7 +591,7 @@ static void _generate_tangents_and_binormals(const PoolVector<int> &p_indices, c
}
}
-Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<Mesh> &p_mesh, const Map<String, Collada::NodeGeometry::Material> &p_material_map, const Collada::MeshData &meshdata, const Transform &p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *skin_controller, const Collada::MorphControllerData *p_morph_data, Vector<Ref<Mesh> > p_morph_meshes, bool p_for_morph, bool p_use_mesh_material) {
+Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_mesh, const Map<String, Collada::NodeGeometry::Material> &p_material_map, const Collada::MeshData &meshdata, const Transform &p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, Vector<Ref<ArrayMesh> > p_morph_meshes, bool p_for_morph, bool p_use_mesh_material) {
bool local_xform_mirror = p_local_xform.basis.determinant() < 0;
@@ -712,35 +714,35 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<Mesh> &p_mesh, c
bool has_weights = false;
- if (skin_controller) {
+ if (p_skin_controller) {
const Collada::SkinControllerData::Source *weight_src = NULL;
int weight_ofs = 0;
- if (skin_controller->weights.sources.has("WEIGHT")) {
+ if (p_skin_controller->weights.sources.has("WEIGHT")) {
- String weight_id = skin_controller->weights.sources["WEIGHT"].source;
- weight_ofs = skin_controller->weights.sources["WEIGHT"].offset;
- if (skin_controller->sources.has(weight_id)) {
+ String weight_id = p_skin_controller->weights.sources["WEIGHT"].source;
+ weight_ofs = p_skin_controller->weights.sources["WEIGHT"].offset;
+ if (p_skin_controller->sources.has(weight_id)) {
- weight_src = &skin_controller->sources[weight_id];
+ weight_src = &p_skin_controller->sources[weight_id];
}
}
int joint_ofs = 0;
- if (skin_controller->weights.sources.has("JOINT")) {
+ if (p_skin_controller->weights.sources.has("JOINT")) {
- joint_ofs = skin_controller->weights.sources["JOINT"].offset;
+ joint_ofs = p_skin_controller->weights.sources["JOINT"].offset;
}
//should be OK, given this was pre-checked.
int index_ofs = 0;
- int wstride = skin_controller->weights.sources.size();
- for (int w_i = 0; w_i < skin_controller->weights.sets.size(); w_i++) {
+ int wstride = p_skin_controller->weights.sources.size();
+ for (int w_i = 0; w_i < p_skin_controller->weights.sets.size(); w_i++) {
- int amount = skin_controller->weights.sets[w_i];
+ int amount = p_skin_controller->weights.sets[w_i];
Vector<Collada::Vertex::Weight> weights;
@@ -749,13 +751,13 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<Mesh> &p_mesh, c
Collada::Vertex::Weight w;
int read_from = index_ofs + a_i * wstride;
- ERR_FAIL_INDEX_V(read_from + wstride - 1, skin_controller->weights.indices.size(), ERR_INVALID_DATA);
- int weight_index = skin_controller->weights.indices[read_from + weight_ofs];
+ ERR_FAIL_INDEX_V(read_from + wstride - 1, p_skin_controller->weights.indices.size(), ERR_INVALID_DATA);
+ int weight_index = p_skin_controller->weights.indices[read_from + weight_ofs];
ERR_FAIL_INDEX_V(weight_index, weight_src->array.size(), ERR_INVALID_DATA);
w.weight = weight_src->array[weight_index];
- int bone_index = skin_controller->weights.indices[read_from + joint_ofs];
+ int bone_index = p_skin_controller->weights.indices[read_from + joint_ofs];
if (bone_index == -1)
continue; //ignore this weight (refers to bind shape)
ERR_FAIL_INDEX_V(bone_index, bone_remap.size(), ERR_INVALID_DATA);
@@ -865,7 +867,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<Mesh> &p_mesh, c
int normal_pos = (normal_src->stride ? normal_src->stride : 3) * p.indices[src + normal_ofs];
ERR_FAIL_INDEX_V(normal_pos, normal_src->array.size(), ERR_INVALID_DATA);
vertex.normal = Vector3(normal_src->array[normal_pos + 0], normal_src->array[normal_pos + 1], normal_src->array[normal_pos + 2]);
- vertex.normal = vertex.normal.snapped(0.001);
+ vertex.normal.snap(Vector3(0.001, 0.001, 0.001));
if (tangent_src && binormal_src) {
@@ -906,12 +908,18 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<Mesh> &p_mesh, c
#ifndef NO_UP_AXIS_SWAP
if (collada.state.up_axis == Vector3::AXIS_Z) {
+ Vector3 bn = vertex.normal.cross(vertex.tangent.normal) * vertex.tangent.d;
+
SWAP(vertex.vertex.z, vertex.vertex.y);
vertex.vertex.z = -vertex.vertex.z;
SWAP(vertex.normal.z, vertex.normal.y);
vertex.normal.z = -vertex.normal.z;
SWAP(vertex.tangent.normal.z, vertex.tangent.normal.y);
vertex.tangent.normal.z = -vertex.tangent.normal.z;
+ SWAP(bn.z, bn.y);
+ bn.z = -bn.z;
+
+ vertex.tangent.d = vertex.normal.cross(vertex.tangent.normal).dot(bn) > 0 ? 1 : -1;
}
#endif
@@ -1000,7 +1008,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<Mesh> &p_mesh, c
{
- Ref<FixedSpatialMaterial> material;
+ Ref<SpatialMaterial> material;
//find material
Mesh::PrimitiveType primitive = Mesh::PRIMITIVE_TRIANGLES;
@@ -1528,7 +1536,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) {
String meshid;
Transform apply_xform;
Vector<int> bone_remap;
- Vector<Ref<Mesh> > morphs;
+ Vector<Ref<ArrayMesh> > morphs;
print_line("mesh: " + String(mi->get_name()));
@@ -1619,9 +1627,9 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) {
String meshid = names[i];
if (collada.state.mesh_data_map.has(meshid)) {
- Ref<Mesh> mesh = Ref<Mesh>(memnew(Mesh));
+ Ref<ArrayMesh> mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid];
- Error err = _create_mesh_surfaces(false, mesh, ng->material_map, meshdata, apply_xform, bone_remap, skin, NULL, Vector<Ref<Mesh> >(), true);
+ Error err = _create_mesh_surfaces(false, mesh, ng->material_map, meshdata, apply_xform, bone_remap, skin, NULL, Vector<Ref<ArrayMesh> >(), true);
ERR_FAIL_COND_V(err, err);
morphs.push_back(mesh);
@@ -1646,7 +1654,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) {
meshid = ng->source;
}
- Ref<Mesh> mesh;
+ Ref<ArrayMesh> mesh;
if (mesh_cache.has(meshid)) {
mesh = mesh_cache[meshid];
} else {
@@ -1654,7 +1662,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) {
//bleh, must ignore invalid
ERR_FAIL_COND_V(!collada.state.mesh_data_map.has(meshid), ERR_INVALID_DATA);
- mesh = Ref<Mesh>(memnew(Mesh));
+ mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid];
mesh->set_name(meshdata.name);
Error err = _create_mesh_surfaces(morphs.size() == 0, mesh, ng->material_map, meshdata, apply_xform, bone_remap, skin, morph, morphs, false, use_mesh_builtin_materials);
@@ -1862,7 +1870,7 @@ void ColladaImport::create_animations(bool p_make_tracks_in_all_bones, bool p_im
node = node_name_map[at.target];
} else {
- print_line("Coudlnt find node: " + at.target);
+ print_line("Couldnt find node: " + at.target);
continue;
}
} else {
diff --git a/editor/import/editor_import_collada.h b/editor/import/editor_import_collada.h
index f9e9c10980..2c60916d52 100644
--- a/editor/import/editor_import_collada.h
+++ b/editor/import/editor_import_collada.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/import/editor_import_plugin.cpp b/editor/import/editor_import_plugin.cpp
new file mode 100644
index 0000000000..4ebbcb1610
--- /dev/null
+++ b/editor/import/editor_import_plugin.cpp
@@ -0,0 +1,152 @@
+/*************************************************************************/
+/* editor_import_plugin.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_import_plugin.h"
+#include "core/script_language.h"
+
+EditorImportPlugin::EditorImportPlugin() {
+}
+
+String EditorImportPlugin::get_importer_name() const {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_importer_name")), "");
+ return get_script_instance()->call("get_importer_name");
+}
+
+String EditorImportPlugin::get_visible_name() const {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_visible_name")), "");
+ return get_script_instance()->call("get_visible_name");
+}
+
+void EditorImportPlugin::get_recognized_extensions(List<String> *p_extensions) const {
+ ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("get_recognized_extensions")));
+ Array extensions = get_script_instance()->call("get_recognized_extensions");
+ for (int i = 0; i < extensions.size(); i++) {
+ p_extensions->push_back(extensions[i]);
+ }
+}
+
+String EditorImportPlugin::get_preset_name(int p_idx) const {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_preset_name")), "");
+ return get_script_instance()->call("get_preset_name", p_idx);
+}
+
+int EditorImportPlugin::get_preset_count() const {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_preset_count")), 0);
+ return get_script_instance()->call("get_preset_count");
+}
+
+String EditorImportPlugin::get_save_extension() const {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_save_extension")), "");
+ return get_script_instance()->call("get_save_extension");
+}
+
+String EditorImportPlugin::get_resource_type() const {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_resource_type")), "");
+ return get_script_instance()->call("get_resource_type");
+}
+
+void EditorImportPlugin::get_import_options(List<ResourceImporter::ImportOption> *r_options, int p_preset) const {
+
+ ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("get_import_options")));
+ Array needed;
+ needed.push_back("name");
+ needed.push_back("default_value");
+ Array options = get_script_instance()->call("get_import_options", p_preset);
+ for (int i = 0; i < options.size(); i++) {
+ Dictionary d = options[i];
+ ERR_FAIL_COND(!d.has_all(needed));
+ String name = d["name"];
+ Variant default_value = d["default_value"];
+
+ PropertyHint hint = PROPERTY_HINT_NONE;
+ if (d.has("property_hint")) {
+ hint = (PropertyHint)d["property_hint"].operator int64_t();
+ }
+
+ String hint_string;
+ if (d.has("hint_string")) {
+ hint_string = d["hint_string"];
+ }
+
+ uint32_t usage = PROPERTY_USAGE_DEFAULT;
+ if (d.has("usage")) {
+ usage = d["usage"];
+ }
+
+ ImportOption option(PropertyInfo(default_value.get_type(), name, hint, hint_string, usage), default_value);
+ r_options->push_back(option);
+ }
+}
+
+bool EditorImportPlugin::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_option_visibility")), true);
+ Dictionary d;
+ Map<StringName, Variant>::Element *E = p_options.front();
+ while (E) {
+ d[E->key()] = E->get();
+ E = E->next();
+ }
+ return get_script_instance()->call("get_option_visibility", p_option, d);
+}
+
+Error EditorImportPlugin::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) {
+
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("import")), ERR_UNAVAILABLE);
+ Dictionary options;
+ Array platform_variants, gen_files;
+
+ Map<StringName, Variant>::Element *E = p_options.front();
+ while (E) {
+ options[E->key()] = E->get();
+ E = E->next();
+ }
+ Error err = (Error)get_script_instance()->call("import", p_source_file, p_save_path, options, platform_variants, gen_files).operator int64_t();
+
+ for (int i = 0; i < platform_variants.size(); i++) {
+ r_platform_variants->push_back(platform_variants[i]);
+ }
+ for (int i = 0; i < gen_files.size(); i++) {
+ r_gen_files->push_back(gen_files[i]);
+ }
+ return err;
+}
+
+void EditorImportPlugin::_bind_methods() {
+
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_importer_name"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_visible_name"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::INT, "get_preset_count"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_preset_name", PropertyInfo(Variant::INT, "preset")));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::ARRAY, "get_recognized_extensions"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::ARRAY, "get_import_options", PropertyInfo(Variant::INT, "preset")));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_save_extension"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_resource_type"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "get_option_visibility", PropertyInfo(Variant::STRING, "option"), PropertyInfo(Variant::DICTIONARY, "options")));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::INT, "import", PropertyInfo(Variant::STRING, "source_file"), PropertyInfo(Variant::STRING, "save_path"), PropertyInfo(Variant::DICTIONARY, "options"), PropertyInfo(Variant::ARRAY, "r_platform_variants"), PropertyInfo(Variant::ARRAY, "r_gen_files")));
+}
diff --git a/scene/3d/quad.h b/editor/import/editor_import_plugin.h
index 607d7238ed..b60813db61 100644
--- a/scene/3d/quad.h
+++ b/editor/import/editor_import_plugin.h
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* quad.h */
+/* editor_import_plugin.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,50 +27,28 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef QUAD_H
-#define QUAD_H
+#ifndef EDITOR_IMPORT_PLUGIN_H
+#define EDITOR_IMPORT_PLUGIN_H
-#include "rid.h"
-#include "scene/3d/visual_instance.h"
-
-class Quad : public GeometryInstance {
-
- GDCLASS(Quad, GeometryInstance);
-
- Vector3::Axis axis;
- bool centered;
- Vector2 offset;
- Vector2 size;
-
- Rect3 aabb;
- bool configured;
- bool pending_update;
- RID mesh;
-
- void _update();
+#include "io/resource_import.h"
+class EditorImportPlugin : public ResourceImporter {
+ GDCLASS(EditorImportPlugin, Reference)
protected:
- void _notification(int p_what);
static void _bind_methods();
public:
- void set_axis(Vector3::Axis p_axis);
- Vector3::Axis get_axis() const;
-
- void set_size(const Vector2 &p_sizze);
- Vector2 get_size() const;
-
- void set_offset(const Vector2 &p_offset);
- Vector2 get_offset() const;
-
- void set_centered(bool p_enabled);
- bool is_centered() const;
-
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
- virtual Rect3 get_aabb() const;
-
- Quad();
- ~Quad();
+ EditorImportPlugin();
+ 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_preset_name(int p_idx) const;
+ virtual int get_preset_count() const;
+ virtual String get_save_extension() const;
+ virtual String get_resource_type() const;
+ virtual void get_import_options(List<ImportOption> *r_options, int p_preset) 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);
};
-#endif // QUAD_H
+#endif //EDITOR_IMPORT_PLUGIN_H
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
new file mode 100644
index 0000000000..1c42bcef8a
--- /dev/null
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -0,0 +1,2108 @@
+#include "editor_scene_importer_gltf.h"
+#include "io/json.h"
+#include "os/file_access.h"
+#include "os/os.h"
+#include "scene/3d/camera.h"
+#include "scene/3d/mesh_instance.h"
+#include "scene/animation/animation_player.h"
+#include "scene/resources/surface_tool.h"
+#include "thirdparty/misc/base64.h"
+
+uint32_t EditorSceneImporterGLTF::get_import_flags() const {
+
+ return IMPORT_SCENE | IMPORT_ANIMATION;
+}
+void EditorSceneImporterGLTF::get_extensions(List<String> *r_extensions) const {
+
+ r_extensions->push_back("gltf");
+ r_extensions->push_back("glb");
+}
+
+Error EditorSceneImporterGLTF::_parse_json(const String &p_path, GLTFState &state) {
+
+ Error err;
+ FileAccessRef f = FileAccess::open(p_path, FileAccess::READ, &err);
+ if (!f) {
+ return err;
+ }
+
+ Vector<uint8_t> array;
+ array.resize(f->get_len());
+ f->get_buffer(array.ptr(), array.size());
+ String text;
+ text.parse_utf8((const char *)array.ptr(), array.size());
+
+ String err_txt;
+ int err_line;
+ Variant v;
+ err = JSON::parse(text, v, err_txt, err_line);
+ if (err != OK) {
+ _err_print_error("", p_path.utf8().get_data(), err_line, err_txt.utf8().get_data(), ERR_HANDLER_SCRIPT);
+ return err;
+ }
+ state.json = v;
+
+ return OK;
+}
+
+Error EditorSceneImporterGLTF::_parse_glb(const String &p_path, GLTFState &state) {
+
+ Error err;
+ FileAccessRef f = FileAccess::open(p_path, FileAccess::READ, &err);
+ if (!f) {
+ return err;
+ }
+
+ uint32_t magic = f->get_32();
+ ERR_FAIL_COND_V(magic != 0x46546C67, ERR_FILE_UNRECOGNIZED); //glTF
+ uint32_t version = f->get_32();
+ uint32_t length = f->get_32();
+
+ uint32_t chunk_length = f->get_32();
+ uint32_t chunk_type = f->get_32();
+
+ ERR_FAIL_COND_V(chunk_type != 0x4E4F534A, ERR_PARSE_ERROR); //JSON
+ Vector<uint8_t> json_data;
+ json_data.resize(chunk_length);
+ uint32_t len = f->get_buffer(json_data.ptr(), chunk_length);
+ ERR_FAIL_COND_V(len != chunk_length, ERR_FILE_CORRUPT);
+
+ String text;
+ text.parse_utf8((const char *)json_data.ptr(), json_data.size());
+
+ String err_txt;
+ int err_line;
+ Variant v;
+ err = JSON::parse(text, v, err_txt, err_line);
+ if (err != OK) {
+ _err_print_error("", p_path.utf8().get_data(), err_line, err_txt.utf8().get_data(), ERR_HANDLER_SCRIPT);
+ return err;
+ }
+
+ state.json = v;
+
+ //data?
+
+ chunk_length = f->get_32();
+ chunk_type = f->get_32();
+
+ if (f->eof_reached()) {
+ return OK; //all good
+ }
+
+ ERR_FAIL_COND_V(chunk_type != 0x004E4942, ERR_PARSE_ERROR); //BIN
+
+ state.glb_data.resize(chunk_length);
+ len = f->get_buffer(state.glb_data.ptr(), chunk_length);
+ ERR_FAIL_COND_V(len != chunk_length, ERR_FILE_CORRUPT);
+
+ return OK;
+}
+
+static Vector3 _arr_to_vec3(const Array &p_array) {
+ ERR_FAIL_COND_V(p_array.size() != 3, Vector3());
+ return Vector3(p_array[0], p_array[1], p_array[2]);
+}
+
+static Quat _arr_to_quat(const Array &p_array) {
+ ERR_FAIL_COND_V(p_array.size() != 4, Quat());
+ return Quat(p_array[0], p_array[1], p_array[2], p_array[3]);
+}
+
+static Transform _arr_to_xform(const Array &p_array) {
+ ERR_FAIL_COND_V(p_array.size() != 16, Transform());
+
+ Transform xform;
+ xform.basis.set_axis(Vector3::AXIS_X, Vector3(p_array[0], p_array[1], p_array[2]));
+ xform.basis.set_axis(Vector3::AXIS_Y, Vector3(p_array[4], p_array[5], p_array[6]));
+ xform.basis.set_axis(Vector3::AXIS_Z, Vector3(p_array[8], p_array[9], p_array[10]));
+ xform.set_origin(Vector3(p_array[12], p_array[13], p_array[14]));
+
+ return xform;
+}
+
+String EditorSceneImporterGLTF::_gen_unique_name(GLTFState &state, const String &p_name) {
+
+ int index = 1;
+
+ String name;
+ while (true) {
+
+ name = p_name;
+ if (index > 1) {
+ name += " " + itos(index);
+ }
+ if (!state.unique_names.has(name)) {
+ break;
+ }
+ index++;
+ }
+
+ state.unique_names.insert(name);
+
+ return name;
+}
+
+Error EditorSceneImporterGLTF::_parse_scenes(GLTFState &state) {
+
+ ERR_FAIL_COND_V(!state.json.has("scenes"), ERR_FILE_CORRUPT);
+ Array scenes = state.json["scenes"];
+ for (int i = 0; i < 1; i++) { //only first scene is imported
+ Dictionary s = scenes[i];
+ ERR_FAIL_COND_V(!s.has("nodes"), ERR_UNAVAILABLE);
+ Array nodes = s["nodes"];
+ for (int j = 0; j < nodes.size(); j++) {
+ state.root_nodes.push_back(nodes[j]);
+ }
+
+ if (s.has("name")) {
+ state.scene_name = s["name"];
+ }
+ }
+
+ return OK;
+}
+
+Error EditorSceneImporterGLTF::_parse_nodes(GLTFState &state) {
+
+ ERR_FAIL_COND_V(!state.json.has("nodes"), ERR_FILE_CORRUPT);
+ Array nodes = state.json["nodes"];
+ for (int i = 0; i < nodes.size(); i++) {
+
+ GLTFNode *node = memnew(GLTFNode);
+ Dictionary n = nodes[i];
+
+ print_line("node " + itos(i) + ": " + String(Variant(n)));
+ if (n.has("name")) {
+ node->name = n["name"];
+ }
+ if (n.has("camera")) {
+ node->camera = n["camera"];
+ }
+ if (n.has("mesh")) {
+ node->mesh = n["mesh"];
+ }
+ if (n.has("skin")) {
+ node->skin = n["skin"];
+ if (!state.skin_users.has(node->skin)) {
+ state.skin_users[node->skin] = Vector<int>();
+ }
+
+ state.skin_users[node->skin].push_back(i);
+ }
+ if (n.has("matrix")) {
+ node->xform = _arr_to_xform(n["matrix"]);
+
+ } else {
+
+ if (n.has("translation")) {
+ node->translation = _arr_to_vec3(n["translation"]);
+ }
+ if (n.has("rotation")) {
+ node->rotation = _arr_to_quat(n["rotation"]);
+ }
+ if (n.has("scale")) {
+ node->scale = _arr_to_vec3(n["scale"]);
+ }
+
+ node->xform.basis = Basis(node->rotation);
+ node->xform.basis.scale(node->scale);
+ node->xform.origin = node->translation;
+ }
+
+ if (n.has("children")) {
+ Array children = n["children"];
+ for (int i = 0; i < children.size(); i++) {
+ node->children.push_back(children[i]);
+ }
+ }
+
+ state.nodes.push_back(node);
+ }
+
+ //build the hierarchy
+
+ for (int i = 0; i < state.nodes.size(); i++) {
+
+ for (int j = 0; j < state.nodes[i]->children.size(); j++) {
+ int child = state.nodes[i]->children[j];
+ ERR_FAIL_INDEX_V(child, state.nodes.size(), ERR_FILE_CORRUPT);
+ ERR_CONTINUE(state.nodes[child]->parent != -1); //node already has a parent, wtf.
+
+ state.nodes[child]->parent = i;
+ }
+ }
+
+ return OK;
+}
+
+static Vector<uint8_t> _parse_base64_uri(const String &uri) {
+
+ int start = uri.find(",");
+ ERR_FAIL_COND_V(start == -1, Vector<uint8_t>());
+
+ CharString substr = uri.right(start + 1).ascii();
+
+ int strlen = substr.length();
+
+ Vector<uint8_t> buf;
+ buf.resize(strlen / 4 * 3 + 1 + 1);
+
+ int len = base64_decode((char *)buf.ptr(), (char *)substr.get_data(), strlen);
+
+ buf.resize(len);
+
+ return buf;
+}
+
+Error EditorSceneImporterGLTF::_parse_buffers(GLTFState &state, const String &p_base_path) {
+
+ if (!state.json.has("buffers"))
+ return OK;
+
+ Array buffers = state.json["buffers"];
+ for (int i = 0; i < buffers.size(); i++) {
+
+ if (i == 0 && state.glb_data.size()) {
+ state.buffers.push_back(state.glb_data);
+
+ } else {
+ Dictionary buffer = buffers[i];
+ if (buffer.has("uri")) {
+
+ Vector<uint8_t> buffer_data;
+ String uri = buffer["uri"];
+
+ if (uri.findn("data:application/octet-stream;base64") == 0) {
+ //embedded data
+ buffer_data = _parse_base64_uri(uri);
+ } else {
+
+ uri = p_base_path.plus_file(uri).replace("\\", "/"); //fix for windows
+ buffer_data = FileAccess::get_file_as_array(uri);
+ ERR_FAIL_COND_V(buffer.size() == 0, ERR_PARSE_ERROR);
+ }
+
+ ERR_FAIL_COND_V(!buffer.has("byteLength"), ERR_PARSE_ERROR);
+ int byteLength = buffer["byteLength"];
+ ERR_FAIL_COND_V(byteLength < buffer_data.size(), ERR_PARSE_ERROR);
+ state.buffers.push_back(buffer_data);
+ }
+ }
+ }
+
+ print_line("total buffers: " + itos(state.buffers.size()));
+
+ return OK;
+}
+
+Error EditorSceneImporterGLTF::_parse_buffer_views(GLTFState &state) {
+
+ ERR_FAIL_COND_V(!state.json.has("bufferViews"), ERR_FILE_CORRUPT);
+ Array buffers = state.json["bufferViews"];
+ for (int i = 0; i < buffers.size(); i++) {
+
+ Dictionary d = buffers[i];
+
+ GLTFBufferView buffer_view;
+
+ ERR_FAIL_COND_V(!d.has("buffer"), ERR_PARSE_ERROR);
+ buffer_view.buffer = d["buffer"];
+ ERR_FAIL_COND_V(!d.has("byteLength"), ERR_PARSE_ERROR);
+ buffer_view.byte_length = d["byteLength"];
+
+ if (d.has("byteOffset")) {
+ buffer_view.byte_offset = d["byteOffset"];
+ }
+
+ if (d.has("byteStride")) {
+ buffer_view.byte_stride = d["byteStride"];
+ }
+
+ if (d.has("target")) {
+ int target = d["target"];
+ buffer_view.indices = target == ELEMENT_ARRAY_BUFFER;
+ }
+
+ state.buffer_views.push_back(buffer_view);
+ }
+
+ print_line("total buffer views: " + itos(state.buffer_views.size()));
+
+ return OK;
+}
+
+EditorSceneImporterGLTF::GLTFType EditorSceneImporterGLTF::_get_type_from_str(const String &p_string) {
+
+ if (p_string == "SCALAR")
+ return TYPE_SCALAR;
+
+ if (p_string == "VEC2")
+ return TYPE_VEC2;
+ if (p_string == "VEC3")
+ return TYPE_VEC3;
+ if (p_string == "VEC4")
+ return TYPE_VEC4;
+
+ if (p_string == "MAT2")
+ return TYPE_MAT2;
+ if (p_string == "MAT3")
+ return TYPE_MAT3;
+ if (p_string == "MAT4")
+ return TYPE_MAT4;
+
+ ERR_FAIL_V(TYPE_SCALAR);
+}
+
+Error EditorSceneImporterGLTF::_parse_accessors(GLTFState &state) {
+
+ ERR_FAIL_COND_V(!state.json.has("accessors"), ERR_FILE_CORRUPT);
+ Array accessors = state.json["accessors"];
+ for (int i = 0; i < accessors.size(); i++) {
+
+ Dictionary d = accessors[i];
+
+ GLTFAccessor accessor;
+
+ ERR_FAIL_COND_V(!d.has("componentType"), ERR_PARSE_ERROR);
+ accessor.component_type = d["componentType"];
+ ERR_FAIL_COND_V(!d.has("count"), ERR_PARSE_ERROR);
+ accessor.count = d["count"];
+ ERR_FAIL_COND_V(!d.has("type"), ERR_PARSE_ERROR);
+ accessor.type = _get_type_from_str(d["type"]);
+
+ if (d.has("bufferView")) {
+ accessor.buffer_view = d["bufferView"]; //optional because it may be sparse...
+ }
+
+ if (d.has("byteOffset")) {
+ accessor.byte_offset = d["byteOffset"];
+ }
+
+ if (d.has("max")) {
+ accessor.max = d["max"];
+ }
+
+ if (d.has("min")) {
+ accessor.min = d["min"];
+ }
+
+ if (d.has("sparse")) {
+ //eeh..
+
+ Dictionary s = d["sparse"];
+
+ ERR_FAIL_COND_V(!d.has("count"), ERR_PARSE_ERROR);
+ accessor.sparse_count = d["count"];
+ ERR_FAIL_COND_V(!d.has("indices"), ERR_PARSE_ERROR);
+ Dictionary si = d["indices"];
+
+ ERR_FAIL_COND_V(!si.has("bufferView"), ERR_PARSE_ERROR);
+ accessor.sparse_indices_buffer_view = si["bufferView"];
+ ERR_FAIL_COND_V(!si.has("componentType"), ERR_PARSE_ERROR);
+ accessor.sparse_indices_component_type = si["componentType"];
+
+ if (si.has("byteOffset")) {
+ accessor.sparse_indices_byte_offset = si["byteOffset"];
+ }
+
+ ERR_FAIL_COND_V(!d.has("values"), ERR_PARSE_ERROR);
+ Dictionary sv = d["values"];
+
+ ERR_FAIL_COND_V(!sv.has("bufferView"), ERR_PARSE_ERROR);
+ accessor.sparse_values_buffer_view = sv["bufferView"];
+ if (sv.has("byteOffset")) {
+ accessor.sparse_values_byte_offset = sv["byteOffset"];
+ }
+ }
+
+ state.accessors.push_back(accessor);
+ }
+
+ print_line("total accessors: " + itos(state.accessors.size()));
+
+ return OK;
+}
+
+String EditorSceneImporterGLTF::_get_component_type_name(uint32_t p_component) {
+
+ switch (p_component) {
+ case COMPONENT_TYPE_BYTE: return "Byte";
+ case COMPONENT_TYPE_UNSIGNED_BYTE: return "UByte";
+ case COMPONENT_TYPE_SHORT: return "Short";
+ case COMPONENT_TYPE_UNSIGNED_SHORT: return "UShort";
+ case COMPONENT_TYPE_INT: return "Int";
+ case COMPONENT_TYPE_FLOAT: return "Float";
+ }
+
+ return "<Error>";
+}
+
+String EditorSceneImporterGLTF::_get_type_name(GLTFType p_component) {
+
+ static const char *names[] = {
+ "float",
+ "vec2",
+ "vec3",
+ "vec4",
+ "mat2",
+ "mat3",
+ "mat4"
+ };
+
+ return names[p_component];
+}
+
+Error EditorSceneImporterGLTF::_decode_buffer_view(GLTFState &state, int p_buffer_view, double *dst, int skip_every, int skip_bytes, int element_size, int count, GLTFType type, int component_count, int component_type, int component_size, bool normalized, int byte_offset, bool for_vertex) {
+
+ const GLTFBufferView &bv = state.buffer_views[p_buffer_view];
+
+ int stride = bv.byte_stride ? bv.byte_stride : element_size;
+ if (for_vertex && stride % 4) {
+ stride += 4 - (stride % 4); //according to spec must be multiple of 4
+ }
+
+ ERR_FAIL_INDEX_V(bv.buffer, state.buffers.size(), ERR_PARSE_ERROR);
+
+ uint32_t offset = bv.byte_offset + byte_offset;
+ Vector<uint8_t> buffer = state.buffers[bv.buffer]; //copy on write, so no performance hit
+
+ //use to debug
+ print_line("type " + _get_type_name(type) + " component type: " + _get_component_type_name(component_type) + " stride: " + itos(stride) + " amount " + itos(count));
+ print_line("accessor offset" + itos(byte_offset) + " view offset: " + itos(bv.byte_offset) + " total buffer len: " + itos(buffer.size()) + " view len " + itos(bv.byte_length));
+
+ int buffer_end = (stride * (count - 1)) + element_size;
+ ERR_FAIL_COND_V(buffer_end > bv.byte_length, ERR_PARSE_ERROR);
+
+ ERR_FAIL_COND_V((offset + buffer_end) > buffer.size(), ERR_PARSE_ERROR);
+
+ //fill everything as doubles
+
+ for (int i = 0; i < count; i++) {
+
+ const uint8_t *src = &buffer[offset + i * stride];
+
+ for (int j = 0; j < component_count; j++) {
+
+ if (skip_every && j > 0 && (j % skip_every) == 0) {
+ src += skip_bytes;
+ }
+
+ double d = 0;
+
+ switch (component_type) {
+ case COMPONENT_TYPE_BYTE: {
+ int8_t b = int8_t(*src);
+ if (normalized) {
+ d = (double(b) / 128.0);
+ } else {
+ d = double(b);
+ }
+ } break;
+ case COMPONENT_TYPE_UNSIGNED_BYTE: {
+ uint8_t b = *src;
+ if (normalized) {
+ d = (double(b) / 255.0);
+ } else {
+ d = double(b);
+ }
+ } break;
+ case COMPONENT_TYPE_SHORT: {
+ int16_t s = *(int16_t *)src;
+ if (normalized) {
+ d = (double(s) / 32768.0);
+ } else {
+ d = double(s);
+ }
+ } break;
+ case COMPONENT_TYPE_UNSIGNED_SHORT: {
+ uint16_t s = *(uint16_t *)src;
+ if (normalized) {
+ d = (double(s) / 65535.0);
+ } else {
+ d = double(s);
+ }
+
+ } break;
+ case COMPONENT_TYPE_INT: {
+ d = *(int *)src;
+ } break;
+ case COMPONENT_TYPE_FLOAT: {
+ d = *(float *)src;
+ } break;
+ }
+
+ *dst++ = d;
+ src += component_size;
+ }
+ }
+
+ return OK;
+}
+
+int EditorSceneImporterGLTF::_get_component_type_size(int component_type) {
+
+ switch (component_type) {
+ case COMPONENT_TYPE_BYTE: return 1; break;
+ case COMPONENT_TYPE_UNSIGNED_BYTE: return 1; break;
+ case COMPONENT_TYPE_SHORT: return 2; break;
+ case COMPONENT_TYPE_UNSIGNED_SHORT: return 2; break;
+ case COMPONENT_TYPE_INT: return 4; break;
+ case COMPONENT_TYPE_FLOAT: return 4; break;
+ default: { ERR_FAIL_V(0); }
+ }
+ return 0;
+}
+
+Vector<double> EditorSceneImporterGLTF::_decode_accessor(GLTFState &state, int p_accessor, bool p_for_vertex) {
+
+ //spec, for reference:
+ //https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#data-alignment
+
+ ERR_FAIL_INDEX_V(p_accessor, state.accessors.size(), Vector<double>());
+
+ const GLTFAccessor &a = state.accessors[p_accessor];
+
+ int component_count_for_type[7] = {
+ 1, 2, 3, 4, 4, 9, 16
+ };
+
+ int component_count = component_count_for_type[a.type];
+ int component_size = _get_component_type_size(a.component_type);
+ ERR_FAIL_COND_V(component_size == 0, Vector<double>());
+ int element_size = component_count * component_size;
+
+ int skip_every = 0;
+ int skip_bytes = 0;
+ //special case of alignments, as described in spec
+ switch (a.component_type) {
+ case COMPONENT_TYPE_BYTE:
+ case COMPONENT_TYPE_UNSIGNED_BYTE: {
+
+ if (a.type == TYPE_MAT2) {
+ skip_every = 2;
+ skip_bytes = 2;
+ element_size = 8; //override for this case
+ }
+ if (a.type == TYPE_MAT3) {
+ skip_every = 3;
+ skip_bytes = 1;
+ element_size = 12; //override for this case
+ }
+
+ } break;
+ case COMPONENT_TYPE_SHORT:
+ case COMPONENT_TYPE_UNSIGNED_SHORT: {
+ if (a.type == TYPE_MAT3) {
+ skip_every = 6;
+ skip_bytes = 4;
+ element_size = 16; //override for this case
+ }
+ } break;
+ default: {}
+ }
+
+ Vector<double> dst_buffer;
+ dst_buffer.resize(component_count * a.count);
+ double *dst = dst_buffer.ptr();
+
+ if (a.buffer_view >= 0) {
+
+ ERR_FAIL_INDEX_V(a.buffer_view, state.buffer_views.size(), Vector<double>());
+
+ Error err = _decode_buffer_view(state, a.buffer_view, dst, skip_every, skip_bytes, element_size, a.count, a.type, component_count, a.component_type, component_size, a.normalized, a.byte_offset, p_for_vertex);
+ if (err != OK)
+ return Vector<double>();
+
+ } else {
+ //fill with zeros, as bufferview is not defined.
+ for (int i = 0; i < (a.count * component_count); i++) {
+ dst_buffer[i] = 0;
+ }
+ }
+
+ if (a.sparse_count > 0) {
+ // I could not find any file using this, so this code is so far untested
+ Vector<double> indices;
+ indices.resize(a.sparse_count);
+ int indices_component_size = _get_component_type_size(a.sparse_indices_component_type);
+
+ Error err = _decode_buffer_view(state, a.sparse_indices_buffer_view, indices.ptr(), 0, 0, indices_component_size, a.sparse_count, TYPE_SCALAR, 1, a.sparse_indices_component_type, indices_component_size, false, a.sparse_indices_byte_offset, false);
+ if (err != OK)
+ return Vector<double>();
+
+ Vector<double> data;
+ data.resize(component_count * a.sparse_count);
+ err = _decode_buffer_view(state, a.sparse_values_buffer_view, data.ptr(), skip_every, skip_bytes, element_size, a.sparse_count, a.type, component_count, a.component_type, component_size, a.normalized, a.sparse_values_byte_offset, p_for_vertex);
+ if (err != OK)
+ return Vector<double>();
+
+ for (int i = 0; i < indices.size(); i++) {
+ int write_offset = int(indices[i]) * component_count;
+
+ for (int j = 0; j < component_count; j++) {
+ dst[write_offset + j] = data[i * component_count + j];
+ }
+ }
+ }
+
+ return dst_buffer;
+}
+
+PoolVector<int> EditorSceneImporterGLTF::_decode_accessor_as_ints(GLTFState &state, int p_accessor, bool p_for_vertex) {
+
+ Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
+ PoolVector<int> ret;
+ if (attribs.size() == 0)
+ return ret;
+ const double *attribs_ptr = attribs.ptr();
+ int ret_size = attribs.size();
+ ret.resize(ret_size);
+ {
+ PoolVector<int>::Write w = ret.write();
+ for (int i = 0; i < ret_size; i++) {
+ w[i] = int(attribs_ptr[i]);
+ }
+ }
+ return ret;
+}
+
+PoolVector<float> EditorSceneImporterGLTF::_decode_accessor_as_floats(GLTFState &state, int p_accessor, bool p_for_vertex) {
+
+ Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
+ PoolVector<float> ret;
+ if (attribs.size() == 0)
+ return ret;
+ const double *attribs_ptr = attribs.ptr();
+ int ret_size = attribs.size();
+ ret.resize(ret_size);
+ {
+ PoolVector<float>::Write w = ret.write();
+ for (int i = 0; i < ret_size; i++) {
+ w[i] = float(attribs_ptr[i]);
+ }
+ }
+ return ret;
+}
+
+PoolVector<Vector2> EditorSceneImporterGLTF::_decode_accessor_as_vec2(GLTFState &state, int p_accessor, bool p_for_vertex) {
+
+ Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
+ PoolVector<Vector2> ret;
+ if (attribs.size() == 0)
+ return ret;
+ ERR_FAIL_COND_V(attribs.size() % 2 != 0, ret);
+ const double *attribs_ptr = attribs.ptr();
+ int ret_size = attribs.size() / 2;
+ ret.resize(ret_size);
+ {
+ PoolVector<Vector2>::Write w = ret.write();
+ for (int i = 0; i < ret_size; i++) {
+ w[i] = Vector2(attribs_ptr[i * 2 + 0], attribs_ptr[i * 2 + 1]);
+ }
+ }
+ return ret;
+}
+
+PoolVector<Vector3> EditorSceneImporterGLTF::_decode_accessor_as_vec3(GLTFState &state, int p_accessor, bool p_for_vertex) {
+
+ Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
+ PoolVector<Vector3> ret;
+ if (attribs.size() == 0)
+ return ret;
+ ERR_FAIL_COND_V(attribs.size() % 3 != 0, ret);
+ const double *attribs_ptr = attribs.ptr();
+ int ret_size = attribs.size() / 3;
+ ret.resize(ret_size);
+ {
+ PoolVector<Vector3>::Write w = ret.write();
+ for (int i = 0; i < ret_size; i++) {
+ w[i] = Vector3(attribs_ptr[i * 3 + 0], attribs_ptr[i * 3 + 1], attribs_ptr[i * 3 + 2]);
+ }
+ }
+ return ret;
+}
+PoolVector<Color> EditorSceneImporterGLTF::_decode_accessor_as_color(GLTFState &state, int p_accessor, bool p_for_vertex) {
+
+ Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
+ PoolVector<Color> ret;
+ if (attribs.size() == 0)
+ return ret;
+ ERR_FAIL_COND_V(attribs.size() % 4 != 0, ret);
+ const double *attribs_ptr = attribs.ptr();
+ int ret_size = attribs.size() / 4;
+ ret.resize(ret_size);
+ {
+ PoolVector<Color>::Write w = ret.write();
+ for (int i = 0; i < ret_size; i++) {
+ w[i] = Color(attribs_ptr[i * 4 + 0], attribs_ptr[i * 4 + 1], attribs_ptr[i * 4 + 2], attribs_ptr[i * 4 + 3]);
+ }
+ }
+ return ret;
+}
+Vector<Quat> EditorSceneImporterGLTF::_decode_accessor_as_quat(GLTFState &state, int p_accessor, bool p_for_vertex) {
+
+ Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
+ Vector<Quat> ret;
+ if (attribs.size() == 0)
+ return ret;
+ ERR_FAIL_COND_V(attribs.size() % 4 != 0, ret);
+ const double *attribs_ptr = attribs.ptr();
+ int ret_size = attribs.size() / 4;
+ ret.resize(ret_size);
+ {
+ for (int i = 0; i < ret_size; i++) {
+ ret[i] = Quat(attribs_ptr[i * 4 + 0], attribs_ptr[i * 4 + 1], attribs_ptr[i * 4 + 2], attribs_ptr[i * 4 + 3]);
+ }
+ }
+ return ret;
+}
+Vector<Transform2D> EditorSceneImporterGLTF::_decode_accessor_as_xform2d(GLTFState &state, int p_accessor, bool p_for_vertex) {
+
+ Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
+ Vector<Transform2D> ret;
+ if (attribs.size() == 0)
+ return ret;
+ ERR_FAIL_COND_V(attribs.size() % 4 != 0, ret);
+ ret.resize(attribs.size() / 4);
+ for (int i = 0; i < ret.size(); i++) {
+ ret[i][0] = Vector2(attribs[i * 4 + 0], attribs[i * 4 + 1]);
+ ret[i][1] = Vector2(attribs[i * 4 + 2], attribs[i * 4 + 3]);
+ }
+ return ret;
+}
+
+Vector<Basis> EditorSceneImporterGLTF::_decode_accessor_as_basis(GLTFState &state, int p_accessor, bool p_for_vertex) {
+
+ Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
+ Vector<Basis> ret;
+ if (attribs.size() == 0)
+ return ret;
+ ERR_FAIL_COND_V(attribs.size() % 9 != 0, ret);
+ ret.resize(attribs.size() / 9);
+ for (int i = 0; i < ret.size(); i++) {
+ ret[i].set_axis(0, Vector3(attribs[i * 9 + 0], attribs[i * 9 + 1], attribs[i * 9 + 2]));
+ ret[i].set_axis(1, Vector3(attribs[i * 9 + 3], attribs[i * 9 + 4], attribs[i * 9 + 5]));
+ ret[i].set_axis(2, Vector3(attribs[i * 9 + 6], attribs[i * 9 + 7], attribs[i * 9 + 8]));
+ }
+ return ret;
+}
+Vector<Transform> EditorSceneImporterGLTF::_decode_accessor_as_xform(GLTFState &state, int p_accessor, bool p_for_vertex) {
+
+ Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
+ Vector<Transform> ret;
+ if (attribs.size() == 0)
+ return ret;
+ ERR_FAIL_COND_V(attribs.size() % 16 != 0, ret);
+ ret.resize(attribs.size() / 16);
+ for (int i = 0; i < ret.size(); i++) {
+ ret[i].basis.set_axis(0, Vector3(attribs[i * 16 + 0], attribs[i * 16 + 1], attribs[i * 16 + 2]));
+ ret[i].basis.set_axis(1, Vector3(attribs[i * 16 + 4], attribs[i * 16 + 5], attribs[i * 16 + 6]));
+ ret[i].basis.set_axis(2, Vector3(attribs[i * 16 + 8], attribs[i * 16 + 9], attribs[i * 16 + 10]));
+ ret[i].set_origin(Vector3(attribs[i * 16 + 12], attribs[i * 16 + 13], attribs[i * 16 + 14]));
+ }
+ return ret;
+}
+
+Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
+
+ if (!state.json.has("meshes"))
+ return OK;
+
+ Array meshes = state.json["meshes"];
+ for (int i = 0; i < meshes.size(); i++) {
+
+ Dictionary d = meshes[i];
+
+ GLTFMesh mesh;
+ mesh.mesh.instance();
+
+ ERR_FAIL_COND_V(!d.has("primitives"), ERR_PARSE_ERROR);
+
+ Array primitives = d["primitives"];
+
+ for (int j = 0; j < primitives.size(); j++) {
+
+ Dictionary p = primitives[j];
+
+ Array array;
+ array.resize(Mesh::ARRAY_MAX);
+
+ ERR_FAIL_COND_V(!p.has("attributes"), ERR_PARSE_ERROR);
+
+ Dictionary a = p["attributes"];
+
+ Mesh::PrimitiveType primitive = Mesh::PRIMITIVE_TRIANGLES;
+ if (p.has("mode")) {
+ int mode = p["mode"];
+ ERR_FAIL_INDEX_V(mode, 7, ERR_FILE_CORRUPT);
+ static const Mesh::PrimitiveType primitives[7] = {
+ Mesh::PRIMITIVE_POINTS,
+ Mesh::PRIMITIVE_LINES,
+ Mesh::PRIMITIVE_LINE_LOOP,
+ Mesh::PRIMITIVE_LINE_STRIP,
+ Mesh::PRIMITIVE_TRIANGLES,
+ Mesh::PRIMITIVE_TRIANGLE_STRIP,
+ Mesh::PRIMITIVE_TRIANGLE_FAN,
+ };
+
+ primitive = primitives[mode];
+ }
+
+ if (a.has("POSITION")) {
+ array[Mesh::ARRAY_VERTEX] = _decode_accessor_as_vec3(state, a["POSITION"], true);
+ }
+ if (a.has("NORMAL")) {
+ array[Mesh::ARRAY_NORMAL] = _decode_accessor_as_vec3(state, a["NORMAL"], true);
+ }
+ if (a.has("TANGENT")) {
+ array[Mesh::ARRAY_TANGENT] = _decode_accessor_as_floats(state, a["TANGENT"], true);
+ }
+ if (a.has("TEXCOORD_0")) {
+ array[Mesh::ARRAY_TEX_UV] = _decode_accessor_as_vec2(state, a["TEXCOORD_0"], true);
+ }
+ if (a.has("TEXCOORD_1")) {
+ array[Mesh::ARRAY_TEX_UV2] = _decode_accessor_as_vec2(state, a["TEXCOORD_1"], true);
+ }
+ if (a.has("COLOR_0")) {
+ array[Mesh::ARRAY_COLOR] = _decode_accessor_as_color(state, a["COLOR_0"], true);
+ }
+ if (a.has("JOINTS_0")) {
+ array[Mesh::ARRAY_BONES] = _decode_accessor_as_ints(state, a["JOINTS_0"], true);
+ }
+ if (a.has("WEIGHTS_0")) {
+ PoolVector<float> weights = _decode_accessor_as_floats(state, a["WEIGHTS_0"], true);
+ { //gltf does not seem to normalize the weights for some reason..
+ int wc = weights.size();
+ PoolVector<float>::Write w = weights.write();
+ for (int i = 0; i < wc; i += 4) {
+ float total = 0.0;
+ total += w[i + 0];
+ total += w[i + 1];
+ total += w[i + 2];
+ total += w[i + 3];
+ if (total > 0.0) {
+ w[i + 0] /= total;
+ w[i + 1] /= total;
+ w[i + 2] /= total;
+ w[i + 3] /= total;
+ }
+ }
+ }
+ array[Mesh::ARRAY_WEIGHTS] = weights;
+ }
+
+ if (p.has("indices")) {
+
+ PoolVector<int> indices = _decode_accessor_as_ints(state, p["indices"], false);
+
+ if (primitive == Mesh::PRIMITIVE_TRIANGLES) {
+ //swap around indices, convert ccw to cw for front face
+
+ int is = indices.size();
+ PoolVector<int>::Write w = indices.write();
+ for (int i = 0; i < is; i += 3) {
+ SWAP(w[i + 1], w[i + 2]);
+ }
+ }
+ array[Mesh::ARRAY_INDEX] = indices;
+ } else if (primitive == Mesh::PRIMITIVE_TRIANGLES) {
+ //generate indices because they need to be swapped for CW/CCW
+ PoolVector<Vector3> vertices = array[Mesh::ARRAY_VERTEX];
+ ERR_FAIL_COND_V(vertices.size() == 0, ERR_PARSE_ERROR);
+ PoolVector<int> indices;
+ int vs = vertices.size();
+ indices.resize(vs);
+ {
+ PoolVector<int>::Write w = indices.write();
+ for (int i = 0; i < vs; i += 3) {
+ w[i] = i;
+ w[i + 1] = i + 2;
+ w[i + 2] = i + 1;
+ }
+ }
+ array[Mesh::ARRAY_INDEX] = indices;
+ }
+
+ bool generated_tangents = false;
+ Variant erased_indices;
+
+ if (primitive == Mesh::PRIMITIVE_TRIANGLES && !a.has("TANGENT") && a.has("TEXCOORD_0") && a.has("NORMAL")) {
+ //must generate mikktspace tangents.. ergh..
+ Ref<SurfaceTool> st;
+ st.instance();
+ st->create_from_triangle_arrays(array);
+ if (p.has("targets")) {
+ //morph targets should not be reindexed, as array size might differ
+ //removing indices is the best bet here
+ st->deindex();
+ erased_indices = a[Mesh::ARRAY_INDEX];
+ a[Mesh::ARRAY_INDEX] = Variant();
+ }
+ st->generate_tangents();
+ array = st->commit_to_arrays();
+ generated_tangents = true;
+ }
+
+ Array morphs;
+ //blend shapes
+ if (p.has("targets")) {
+ print_line("has targets!");
+ Array targets = p["targets"];
+
+ if (j == 0) {
+ for (int k = 0; k < targets.size(); k++) {
+ mesh.mesh->add_blend_shape(String("morph_") + itos(k));
+ }
+ }
+
+ for (int k = 0; k < targets.size(); k++) {
+
+ Dictionary t = targets[k];
+
+ Array array_copy;
+ array_copy.resize(Mesh::ARRAY_MAX);
+
+ for (int l = 0; l < Mesh::ARRAY_MAX; l++) {
+ array_copy[l] = array[l];
+ }
+
+ array_copy[Mesh::ARRAY_INDEX] = Variant();
+
+ if (t.has("POSITION")) {
+ array_copy[Mesh::ARRAY_VERTEX] = _decode_accessor_as_vec3(state, t["POSITION"], true);
+ }
+ if (t.has("NORMAL")) {
+ array_copy[Mesh::ARRAY_NORMAL] = _decode_accessor_as_vec3(state, t["NORMAL"], true);
+ }
+ if (t.has("TANGENT")) {
+ PoolVector<Vector3> tangents_v3 = _decode_accessor_as_vec3(state, t["TANGENT"], true);
+ PoolVector<float> tangents_v4;
+ PoolVector<float> src_tangents = array[Mesh::ARRAY_TANGENT];
+ ERR_FAIL_COND_V(src_tangents.size() == 0, ERR_PARSE_ERROR);
+
+ {
+
+ int size4 = src_tangents.size();
+ tangents_v4.resize(size4);
+ PoolVector<float>::Write w4 = tangents_v4.write();
+
+ PoolVector<Vector3>::Read r3 = tangents_v3.read();
+ PoolVector<float>::Read r4 = src_tangents.read();
+
+ for (int l = 0; l < size4 / 4; l++) {
+
+ w4[l * 4 + 0] = r3[l].x;
+ w4[l * 4 + 1] = r3[l].y;
+ w4[l * 4 + 2] = r3[l].z;
+ w4[l * 4 + 3] = r4[l * 4 + 3]; //copy flip value
+ }
+ }
+
+ array_copy[Mesh::ARRAY_TANGENT] = tangents_v4;
+ }
+
+ if (generated_tangents) {
+ Ref<SurfaceTool> st;
+ st.instance();
+ array_copy[Mesh::ARRAY_INDEX] = erased_indices; //needed for tangent generation, erased by deindex
+ st->create_from_triangle_arrays(array_copy);
+ st->deindex();
+ st->generate_tangents();
+ array_copy = st->commit_to_arrays();
+ }
+
+ morphs.push_back(array_copy);
+ }
+ }
+
+ //just add it
+ mesh.mesh->add_surface_from_arrays(primitive, array, morphs);
+
+ if (p.has("material")) {
+ int material = p["material"];
+ ERR_FAIL_INDEX_V(material, state.materials.size(), ERR_FILE_CORRUPT);
+ Ref<Material> mat = state.materials[material];
+
+ mesh.mesh->surface_set_material(mesh.mesh->get_surface_count() - 1, mat);
+ }
+ }
+
+ if (d.has("weights")) {
+ Array weights = d["weights"];
+ ERR_FAIL_COND_V(mesh.mesh->get_blend_shape_count() != weights.size(), ERR_PARSE_ERROR);
+ mesh.blend_weights.resize(weights.size());
+ for (int j = 0; j < weights.size(); j++) {
+ mesh.blend_weights[j] = weights[j];
+ }
+ }
+
+ state.meshes.push_back(mesh);
+ }
+
+ print_line("total meshes: " + itos(state.meshes.size()));
+
+ return OK;
+}
+
+Error EditorSceneImporterGLTF::_parse_images(GLTFState &state, const String &p_base_path) {
+
+ if (!state.json.has("images"))
+ return OK;
+
+ Array images = state.json["images"];
+ for (int i = 0; i < images.size(); i++) {
+
+ Dictionary d = images[i];
+
+ String mimetype;
+ if (d.has("mimeType")) {
+ mimetype = d["mimeType"];
+ }
+
+ Vector<uint8_t> data;
+ const uint8_t *data_ptr = NULL;
+ int data_size = 0;
+
+ if (d.has("uri")) {
+ String uri = d["uri"];
+
+ if (uri.findn("data:application/octet-stream;base64") == 0) {
+ //embedded data
+ data = _parse_base64_uri(uri);
+ data_ptr = data.ptr();
+ data_size = data.size();
+ } else {
+
+ uri = p_base_path.plus_file(uri).replace("\\", "/"); //fix for windows
+ Ref<Texture> texture = ResourceLoader::load(uri);
+ state.images.push_back(texture);
+ continue;
+ }
+ }
+
+ if (d.has("bufferView")) {
+ int bvi = d["bufferView"];
+
+ ERR_FAIL_INDEX_V(bvi, state.buffer_views.size(), ERR_PARAMETER_RANGE_ERROR);
+
+ GLTFBufferView &bv = state.buffer_views[bvi];
+
+ int bi = bv.buffer;
+ ERR_FAIL_INDEX_V(bi, state.buffers.size(), ERR_PARAMETER_RANGE_ERROR);
+
+ ERR_FAIL_COND_V(bv.byte_offset + bv.byte_length > state.buffers[bi].size(), ERR_FILE_CORRUPT);
+
+ data_ptr = &state.buffers[bi][bv.byte_offset];
+ data_size = bv.byte_length;
+ }
+
+ ERR_FAIL_COND_V(mimetype == "", ERR_FILE_CORRUPT);
+
+ if (mimetype.findn("png") != -1) {
+ //is a png
+ Ref<Image> img = Image::_png_mem_loader_func(data_ptr, data_size);
+
+ ERR_FAIL_COND_V(img.is_null(), ERR_FILE_CORRUPT);
+
+ Ref<ImageTexture> t;
+ t.instance();
+ t->create_from_image(img);
+
+ state.images.push_back(t);
+ continue;
+ }
+
+ if (mimetype.findn("jpg") != -1) {
+ //is a jpg
+ Ref<Image> img = Image::_jpg_mem_loader_func(data_ptr, data_size);
+
+ ERR_FAIL_COND_V(img.is_null(), ERR_FILE_CORRUPT);
+
+ Ref<ImageTexture> t;
+ t.instance();
+ t->create_from_image(img);
+
+ state.images.push_back(t);
+
+ continue;
+ }
+
+ ERR_FAIL_V(ERR_FILE_CORRUPT);
+ }
+
+ print_line("total images: " + itos(state.images.size()));
+
+ return OK;
+}
+
+Error EditorSceneImporterGLTF::_parse_textures(GLTFState &state) {
+
+ if (!state.json.has("textures"))
+ return OK;
+
+ Array textures = state.json["textures"];
+ for (int i = 0; i < textures.size(); i++) {
+
+ Dictionary d = textures[i];
+
+ ERR_FAIL_COND_V(!d.has("source"), ERR_PARSE_ERROR);
+
+ GLTFTexture t;
+ t.src_image = d["source"];
+ state.textures.push_back(t);
+ }
+
+ return OK;
+}
+
+Ref<Texture> EditorSceneImporterGLTF::_get_texture(GLTFState &state, int p_texture) {
+ ERR_FAIL_INDEX_V(p_texture, state.textures.size(), Ref<Texture>());
+ int image = state.textures[p_texture].src_image;
+
+ ERR_FAIL_INDEX_V(image, state.images.size(), Ref<Texture>());
+
+ return state.images[image];
+}
+
+Error EditorSceneImporterGLTF::_parse_materials(GLTFState &state) {
+
+ if (!state.json.has("materials"))
+ return OK;
+
+ Array materials = state.json["materials"];
+ for (int i = 0; i < materials.size(); i++) {
+
+ Dictionary d = materials[i];
+
+ Ref<SpatialMaterial> material;
+ material.instance();
+ if (d.has("name")) {
+ material->set_name(d["name"]);
+ }
+
+ if (d.has("pbrMetallicRoughness")) {
+
+ Dictionary mr = d["pbrMetallicRoughness"];
+ if (mr.has("baseColorFactor")) {
+ Array arr = mr["baseColorFactor"];
+ ERR_FAIL_COND_V(arr.size() != 4, ERR_PARSE_ERROR);
+ Color c = Color(arr[0], arr[1], arr[2], arr[3]).to_srgb();
+
+ material->set_albedo(c);
+ }
+
+ if (mr.has("baseColorTexture")) {
+ Dictionary bct = mr["baseColorTexture"];
+ if (bct.has("index")) {
+ material->set_texture(SpatialMaterial::TEXTURE_ALBEDO, _get_texture(state, bct["index"]));
+ }
+ if (!mr.has("baseColorFactor")) {
+ material->set_albedo(Color(1, 1, 1));
+ }
+ }
+
+ if (mr.has("metallicFactor")) {
+
+ material->set_metallic(mr["metallicFactor"]);
+ }
+ if (mr.has("roughnessFactor")) {
+
+ material->set_roughness(mr["roughnessFactor"]);
+ }
+
+ if (mr.has("metallicRoughnessTexture")) {
+ Dictionary bct = mr["metallicRoughnessTexture"];
+ if (bct.has("index")) {
+ Ref<Texture> t = _get_texture(state, bct["index"]);
+ material->set_texture(SpatialMaterial::TEXTURE_METALLIC, t);
+ material->set_metallic_texture_channel(SpatialMaterial::TEXTURE_CHANNEL_RED);
+ material->set_texture(SpatialMaterial::TEXTURE_ROUGHNESS, t);
+ material->set_roughness_texture_channel(SpatialMaterial::TEXTURE_CHANNEL_GREEN);
+ if (!mr.has("metallicFactor")) {
+ material->set_metallic(1);
+ }
+ if (!mr.has("roughnessFactor")) {
+ material->set_roughness(1);
+ }
+ }
+ }
+ }
+
+ if (d.has("normalTexture")) {
+ Dictionary bct = d["normalTexture"];
+ if (bct.has("index")) {
+ material->set_texture(SpatialMaterial::TEXTURE_NORMAL, _get_texture(state, bct["index"]));
+ material->set_feature(SpatialMaterial::FEATURE_NORMAL_MAPPING, true);
+ }
+ if (bct.has("scale")) {
+ material->set_normal_scale(bct["scale"]);
+ }
+ }
+ if (d.has("occlusionTexture")) {
+ Dictionary bct = d["occlusionTexture"];
+ if (bct.has("index")) {
+ material->set_texture(SpatialMaterial::TEXTURE_AMBIENT_OCCLUSION, _get_texture(state, bct["index"]));
+ material->set_feature(SpatialMaterial::FEATURE_AMBIENT_OCCLUSION, true);
+ }
+ }
+
+ if (d.has("emissiveFactor")) {
+ Array arr = d["emissiveFactor"];
+ ERR_FAIL_COND_V(arr.size() != 3, ERR_PARSE_ERROR);
+ Color c = Color(arr[0], arr[1], arr[2]).to_srgb();
+ material->set_feature(SpatialMaterial::FEATURE_EMISSION, true);
+
+ material->set_emission(c);
+ }
+
+ if (d.has("emissiveTexture")) {
+ Dictionary bct = d["emissiveTexture"];
+ if (bct.has("index")) {
+ material->set_texture(SpatialMaterial::TEXTURE_EMISSION, _get_texture(state, bct["index"]));
+ material->set_feature(SpatialMaterial::FEATURE_EMISSION, true);
+ material->set_emission(Color(0, 0, 0));
+ }
+ }
+
+ if (d.has("doubleSided")) {
+ bool ds = d["doubleSided"];
+ if (ds) {
+ material->set_cull_mode(SpatialMaterial::CULL_DISABLED);
+ }
+ }
+
+ if (d.has("alphaMode")) {
+ String am = d["alphaMode"];
+ if (am != "OPAQUE") {
+ material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ }
+ }
+
+ state.materials.push_back(material);
+ }
+
+ print_line("total materials: " + itos(state.materials.size()));
+
+ return OK;
+}
+
+Error EditorSceneImporterGLTF::_parse_skins(GLTFState &state) {
+
+ if (!state.json.has("skins"))
+ return OK;
+
+ Array skins = state.json["skins"];
+ for (int i = 0; i < skins.size(); i++) {
+
+ Dictionary d = skins[i];
+
+ GLTFSkin skin;
+
+ ERR_FAIL_COND_V(!d.has("joints"), ERR_PARSE_ERROR);
+
+ Array joints = d["joints"];
+ Vector<Transform> bind_matrices;
+
+ if (d.has("inverseBindMatrices")) {
+ bind_matrices = _decode_accessor_as_xform(state, d["inverseBindMatrices"], false);
+ ERR_FAIL_COND_V(bind_matrices.size() != joints.size(), ERR_PARSE_ERROR);
+ }
+
+ for (int j = 0; j < joints.size(); j++) {
+ int index = joints[j];
+ ERR_FAIL_INDEX_V(index, state.nodes.size(), ERR_PARSE_ERROR);
+ state.nodes[index]->joint_skin = state.skins.size();
+ state.nodes[index]->joint_bone = j;
+ GLTFSkin::Bone bone;
+ bone.node = index;
+ if (bind_matrices.size()) {
+ bone.inverse_bind = bind_matrices[j];
+ }
+
+ skin.bones.push_back(bone);
+ }
+
+ print_line("skin has skeleton? " + itos(d.has("skeleton")));
+ if (d.has("skeleton")) {
+ int skeleton = d["skeleton"];
+ ERR_FAIL_INDEX_V(skeleton, state.nodes.size(), ERR_PARSE_ERROR);
+ state.nodes[skeleton]->skeleton_skin = state.skins.size();
+ print_line("setting skeleton skin to" + itos(skeleton));
+ skin.skeleton = skeleton;
+ }
+
+ if (d.has("name")) {
+ skin.name = d["name"];
+ }
+
+ //locate the right place to put a Skeleton node
+
+ if (state.skin_users.has(i)) {
+ Vector<int> users = state.skin_users[i];
+ int skin_node = -1;
+ for (int j = 0; j < users.size(); j++) {
+ int user = state.nodes[users[j]]->parent; //always go from parent
+ if (j == 0) {
+ skin_node = user;
+ } else if (skin_node != -1) {
+ bool found = false;
+ while (skin_node >= 0) {
+
+ int cuser = user;
+ while (cuser != -1) {
+ if (cuser == skin_node) {
+ found = true;
+ break;
+ }
+ cuser = state.nodes[skin_node]->parent;
+ }
+ if (found)
+ break;
+ skin_node = state.nodes[skin_node]->parent;
+ }
+
+ if (!found) {
+ skin_node = -1; //just leave where it is
+ }
+
+ //find a common parent
+ }
+ }
+
+ if (skin_node != -1) {
+ for (int j = 0; j < users.size(); j++) {
+ state.nodes[users[j]]->child_of_skeleton = i;
+ }
+
+ state.nodes[skin_node]->skeleton_children.push_back(i);
+ }
+ state.skins.push_back(skin);
+ }
+ }
+ print_line("total skins: " + itos(state.skins.size()));
+
+ //now
+
+ return OK;
+}
+
+Error EditorSceneImporterGLTF::_parse_cameras(GLTFState &state) {
+
+ if (!state.json.has("cameras"))
+ return OK;
+
+ Array cameras = state.json["cameras"];
+
+ for (int i = 0; i < cameras.size(); i++) {
+
+ Dictionary d = cameras[i];
+
+ GLTFCamera camera;
+ ERR_FAIL_COND_V(!d.has("type"), ERR_PARSE_ERROR);
+ String type = d["type"];
+ if (type == "orthographic") {
+
+ camera.perspective = false;
+ if (d.has("orthographic")) {
+ Dictionary og = d["orthographic"];
+ camera.fov_size = og["ymag"];
+ camera.zfar = og["zfar"];
+ camera.znear = og["znear"];
+ } else {
+ camera.fov_size = 10;
+ }
+
+ } else if (type == "perspective") {
+
+ camera.perspective = true;
+ if (d.has("perspective")) {
+ Dictionary ppt = d["perspective"];
+ camera.fov_size = ppt["yfov"];
+ camera.zfar = ppt["zfar"];
+ camera.znear = ppt["znear"];
+ } else {
+ camera.fov_size = 10;
+ }
+ } else {
+ ERR_EXPLAIN("Camera should be in 'orthographic' or 'perspective'");
+ ERR_FAIL_V(ERR_PARSE_ERROR);
+ }
+
+ state.cameras.push_back(camera);
+ }
+
+ print_line("total cameras: " + itos(state.cameras.size()));
+}
+
+Error EditorSceneImporterGLTF::_parse_animations(GLTFState &state) {
+
+ if (!state.json.has("animations"))
+ return OK;
+
+ Array animations = state.json["animations"];
+
+ for (int i = 0; i < animations.size(); i++) {
+
+ Dictionary d = animations[i];
+
+ GLTFAnimation animation;
+
+ if (!d.has("channels") || !d.has("samplers"))
+ continue;
+
+ Array channels = d["channels"];
+ Array samplers = d["samplers"];
+
+ if (d.has("name")) {
+ animation.name = d["name"];
+ }
+
+ for (int j = 0; j < channels.size(); j++) {
+
+ Dictionary c = channels[j];
+ if (!c.has("target"))
+ continue;
+
+ Dictionary t = c["target"];
+ if (!t.has("node") || !t.has("path")) {
+ continue;
+ }
+
+ ERR_FAIL_COND_V(!c.has("sampler"), ERR_PARSE_ERROR);
+ int sampler = c["sampler"];
+ ERR_FAIL_INDEX_V(sampler, samplers.size(), ERR_PARSE_ERROR);
+
+ int node = t["node"];
+ String path = t["path"];
+
+ ERR_FAIL_INDEX_V(node, state.nodes.size(), ERR_PARSE_ERROR);
+
+ GLTFAnimation::Track *track = NULL;
+
+ if (!animation.tracks.has(node)) {
+ animation.tracks[node] = GLTFAnimation::Track();
+ }
+
+ track = &animation.tracks[node];
+
+ Dictionary s = samplers[sampler];
+
+ ERR_FAIL_COND_V(!s.has("input"), ERR_PARSE_ERROR);
+ ERR_FAIL_COND_V(!s.has("output"), ERR_PARSE_ERROR);
+
+ int input = s["input"];
+ int output = s["output"];
+
+ GLTFAnimation::Interpolation interp = GLTFAnimation::INTERP_LINEAR;
+ if (s.has("interpolation")) {
+ String in = s["interpolation"];
+ if (in == "STEP") {
+ interp = GLTFAnimation::INTERP_STEP;
+ } else if (in == "LINEAR") {
+ interp = GLTFAnimation::INTERP_LINEAR;
+ } else if (in == "CATMULLROMSPLINE") {
+ interp = GLTFAnimation::INTERP_CATMULLROMSPLINE;
+ } else if (in == "CUBICSPLINE") {
+ interp = GLTFAnimation::INTERP_CUBIC_SPLINE;
+ }
+ }
+
+ print_line("path: " + path);
+ PoolVector<float> times = _decode_accessor_as_floats(state, input, false);
+ if (path == "translation") {
+ PoolVector<Vector3> translations = _decode_accessor_as_vec3(state, output, false);
+ track->translation_track.interpolation = interp;
+ track->translation_track.times = Variant(times); //convert via variant
+ track->translation_track.values = Variant(translations); //convert via variant
+ } else if (path == "rotation") {
+ Vector<Quat> rotations = _decode_accessor_as_quat(state, output, false);
+ track->rotation_track.interpolation = interp;
+ track->rotation_track.times = Variant(times); //convert via variant
+ track->rotation_track.values = rotations; //convert via variant
+ } else if (path == "scale") {
+ PoolVector<Vector3> scales = _decode_accessor_as_vec3(state, output, false);
+ track->scale_track.interpolation = interp;
+ track->scale_track.times = Variant(times); //convert via variant
+ track->scale_track.values = Variant(scales); //convert via variant
+ } else if (path == "weights") {
+ PoolVector<float> weights = _decode_accessor_as_floats(state, output, false);
+
+ ERR_FAIL_INDEX_V(state.nodes[node]->mesh, state.meshes.size(), ERR_PARSE_ERROR);
+ GLTFMesh *mesh = &state.meshes[state.nodes[node]->mesh];
+ ERR_FAIL_COND_V(mesh->blend_weights.size() == 0, ERR_PARSE_ERROR);
+ int wc = mesh->blend_weights.size();
+
+ track->weight_tracks.resize(wc);
+
+ int wlen = weights.size() / wc;
+ PoolVector<float>::Read r = weights.read();
+ for (int k = 0; k < wc; k++) { //separate tracks, having them together is not such a good idea
+ GLTFAnimation::Channel<float> cf;
+ cf.interpolation = interp;
+ cf.times = Variant(times);
+ Vector<float> wdata;
+ wdata.resize(wlen);
+ for (int l = 0; l < wlen; l++) {
+ wdata[l] = r[l * wc + k];
+ }
+
+ cf.values = wdata;
+ track->weight_tracks[k] = cf;
+ }
+ } else {
+ WARN_PRINTS("Invalid path: " + path);
+ }
+ }
+
+ state.animations.push_back(animation);
+ }
+
+ print_line("total animations: " + itos(state.animations.size()));
+
+ return OK;
+}
+
+void EditorSceneImporterGLTF::_assign_scene_names(GLTFState &state) {
+
+ for (int i = 0; i < state.nodes.size(); i++) {
+ GLTFNode *n = state.nodes[i];
+ if (n->name == "") {
+ if (n->mesh >= 0) {
+ n->name = "Mesh";
+ } else if (n->joint_skin >= 0) {
+ n->name = "Bone";
+ } else {
+ n->name = "Node";
+ }
+ }
+
+ n->name = _gen_unique_name(state, n->name);
+ }
+}
+
+void EditorSceneImporterGLTF::_generate_node(GLTFState &state, int p_node, Node *p_parent, Node *p_owner, Vector<Skeleton *> &skeletons) {
+ ERR_FAIL_INDEX(p_node, state.nodes.size());
+
+ GLTFNode *n = state.nodes[p_node];
+ Spatial *node;
+
+ if (n->mesh >= 0) {
+ ERR_FAIL_INDEX(n->mesh, state.meshes.size());
+ MeshInstance *mi = memnew(MeshInstance);
+ const GLTFMesh &mesh = state.meshes[n->mesh];
+ mi->set_mesh(mesh.mesh);
+ for (int i = 0; i < mesh.blend_weights.size(); i++) {
+ mi->set("blend_shapes/" + mesh.mesh->get_blend_shape_name(i), mesh.blend_weights[i]);
+ }
+
+ node = mi;
+ } else if (n->camera >= 0) {
+ ERR_FAIL_INDEX(n->camera, state.cameras.size());
+ Camera *camera = memnew(Camera);
+
+ const GLTFCamera &c = state.cameras[n->camera];
+ if (c.perspective) {
+ camera->set_perspective(c.fov_size, c.znear, c.znear);
+ } else {
+ camera->set_orthogonal(c.fov_size, c.znear, c.znear);
+ }
+
+ node = camera;
+ } else {
+ node = memnew(Spatial);
+ }
+
+ node->set_name(n->name);
+
+ if (n->child_of_skeleton >= 0) {
+ //move skeleton around and place it on node, as the node _is_ a skeleton.
+ Skeleton *s = skeletons[n->child_of_skeleton];
+ p_parent = s;
+ }
+
+ p_parent->add_child(node);
+ node->set_owner(p_owner);
+ node->set_transform(n->xform);
+
+ n->godot_node = node;
+
+ for (int i = 0; i < n->skeleton_children.size(); i++) {
+
+ Skeleton *s = skeletons[n->skeleton_children[i]];
+ s->get_parent()->remove_child(s);
+ node->add_child(s);
+ s->set_owner(p_owner);
+ }
+
+ for (int i = 0; i < n->children.size(); i++) {
+ if (state.nodes[n->children[i]]->joint_skin >= 0) {
+ _generate_bone(state, n->children[i], skeletons, -1);
+ } else {
+ _generate_node(state, n->children[i], node, p_owner, skeletons);
+ }
+ }
+}
+
+void EditorSceneImporterGLTF::_generate_bone(GLTFState &state, int p_node, Vector<Skeleton *> &skeletons, int p_parent_bone) {
+ ERR_FAIL_INDEX(p_node, state.nodes.size());
+
+ GLTFNode *n = state.nodes[p_node];
+
+ ERR_FAIL_COND(n->joint_skin < 0);
+
+ int bone_index = skeletons[n->joint_skin]->get_bone_count();
+ skeletons[n->joint_skin]->add_bone(n->name);
+ if (p_parent_bone >= 0) {
+ skeletons[n->joint_skin]->set_bone_parent(bone_index, p_parent_bone);
+ }
+ skeletons[n->joint_skin]->set_bone_rest(bone_index, state.skins[n->joint_skin].bones[n->joint_bone].inverse_bind.affine_inverse());
+
+ n->godot_node = skeletons[n->joint_skin];
+ n->godot_bone_index = bone_index;
+
+ for (int i = 0; i < n->children.size(); i++) {
+ ERR_CONTINUE(state.nodes[n->children[i]]->joint_skin < 0);
+ _generate_bone(state, n->children[i], skeletons, bone_index);
+ }
+}
+
+template <class T>
+struct EditorSceneImporterGLTFInterpolate {
+
+ T lerp(const T &a, const T &b, float c) const {
+
+ return a + (b - a) * c;
+ }
+
+ T catmull_rom(const T &p0, const T &p1, const T &p2, const T &p3, float t) {
+
+ float t2 = t * t;
+ float t3 = t2 * t;
+
+ return 0.5f * ((2.0f * p1) + (-p0 + p2) * t + (2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 + (-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3);
+ }
+
+ T bezier(T start, T control_1, T control_2, T end, float t) {
+ /* Formula from Wikipedia article on Bezier curves. */
+ real_t omt = (1.0 - t);
+ real_t omt2 = omt * omt;
+ real_t omt3 = omt2 * omt;
+ real_t t2 = t * t;
+ real_t t3 = t2 * t;
+
+ return start * omt3 + control_1 * omt2 * t * 3.0 + control_2 * omt * t2 * 3.0 + end * t3;
+ }
+};
+
+//thank you for existing, partial specialization
+template <>
+struct EditorSceneImporterGLTFInterpolate<Quat> {
+
+ Quat lerp(const Quat &a, const Quat &b, float c) const {
+
+ return a.slerp(b, c);
+ }
+
+ Quat catmull_rom(const Quat &p0, const Quat &p1, const Quat &p2, const Quat &p3, float c) {
+
+ return p1.slerp(p2, c);
+ }
+
+ Quat bezier(Quat start, Quat control_1, Quat control_2, Quat end, float t) {
+ return start.slerp(end, t);
+ }
+};
+
+template <class T>
+T EditorSceneImporterGLTF::_interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values, float p_time, GLTFAnimation::Interpolation p_interp) {
+
+ //could use binary search, worth it?
+ int idx = -1;
+ for (int i = 0; i < p_times.size(); i++) {
+ if (p_times[i] > p_time)
+ break;
+ idx++;
+ }
+
+ EditorSceneImporterGLTFInterpolate<T> interp;
+
+ switch (p_interp) {
+ case GLTFAnimation::INTERP_LINEAR: {
+
+ if (idx == -1) {
+ return p_values[0];
+ } else if (idx >= p_times.size() - 1) {
+ return p_values[p_times.size() - 1];
+ }
+
+ float c = (p_time - p_times[idx]) / (p_times[idx + 1] - p_times[idx]);
+
+ return interp.lerp(p_values[idx], p_values[idx + 1], c);
+
+ } break;
+ case GLTFAnimation::INTERP_STEP: {
+
+ if (idx == -1) {
+ return p_values[0];
+ } else if (idx >= p_times.size() - 1) {
+ return p_values[p_times.size() - 1];
+ }
+
+ return p_values[idx];
+
+ } break;
+ case GLTFAnimation::INTERP_CATMULLROMSPLINE: {
+
+ if (idx == -1) {
+ return p_values[1];
+ } else if (idx >= p_times.size() - 1) {
+ return p_values[1 + p_times.size() - 1];
+ }
+
+ float c = (p_time - p_times[idx]) / (p_times[idx + 1] - p_times[idx]);
+
+ return interp.catmull_rom(p_values[idx - 1], p_values[idx], p_values[idx + 1], p_values[idx + 3], c);
+
+ } break;
+ case GLTFAnimation::INTERP_CUBIC_SPLINE: {
+
+ if (idx == -1) {
+ return p_values[1];
+ } else if (idx >= p_times.size() - 1) {
+ return p_values[(p_times.size() - 1) * 3 + 1];
+ }
+
+ float c = (p_time - p_times[idx]) / (p_times[idx + 1] - p_times[idx]);
+
+ T from = p_values[idx * 3 + 1];
+ T c1 = from + p_values[idx * 3 + 0];
+ T to = p_values[idx * 3 + 3];
+ T c2 = to + p_values[idx * 3 + 2];
+
+ return interp.bezier(from, c1, c2, to, c);
+
+ } break;
+ }
+
+ ERR_FAIL_V(p_values[0]);
+}
+
+void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlayer *ap, int index, int bake_fps, Vector<Skeleton *> skeletons) {
+
+ const GLTFAnimation &anim = state.animations[index];
+
+ String name = anim.name;
+ if (name == "") {
+ name = _gen_unique_name(state, "Animation");
+ }
+
+ Ref<Animation> animation;
+ animation.instance();
+ animation->set_name(name);
+
+ for (Map<int, GLTFAnimation::Track>::Element *E = anim.tracks.front(); E; E = E->next()) {
+
+ const GLTFAnimation::Track &track = E->get();
+ //need to find the path
+ NodePath node_path;
+
+ GLTFNode *node = state.nodes[E->key()];
+ ERR_CONTINUE(!node->godot_node);
+
+ if (node->godot_bone_index >= 0) {
+ Skeleton *sk = (Skeleton *)node->godot_node;
+ String path = ap->get_parent()->get_path_to(sk);
+ String bone = sk->get_bone_name(node->godot_bone_index);
+ node_path = path + ":" + bone;
+ } else {
+ node_path = ap->get_parent()->get_path_to(node->godot_node);
+ }
+
+ float length = 0;
+
+ for (int i = 0; i < track.rotation_track.times.size(); i++) {
+ length = MAX(length, track.rotation_track.times[i]);
+ }
+ for (int i = 0; i < track.translation_track.times.size(); i++) {
+ length = MAX(length, track.translation_track.times[i]);
+ }
+ for (int i = 0; i < track.scale_track.times.size(); i++) {
+ length = MAX(length, track.scale_track.times[i]);
+ }
+
+ for (int i = 0; i < track.weight_tracks.size(); i++) {
+ for (int j = 0; j < track.weight_tracks[i].times.size(); j++) {
+ length = MAX(length, track.weight_tracks[i].times[j]);
+ }
+ }
+
+ animation->set_length(length);
+
+ if (track.rotation_track.values.size() || track.translation_track.values.size() || track.scale_track.values.size()) {
+ //make transform track
+ int track_idx = animation->get_track_count();
+ animation->add_track(Animation::TYPE_TRANSFORM);
+ animation->track_set_path(track_idx, node_path);
+ //first determine animation length
+
+ float increment = 1.0 / float(bake_fps);
+ float time = 0.0;
+
+ Vector3 base_pos;
+ Quat base_rot;
+ Vector3 base_scale = Vector3(1, 1, 1);
+
+ if (!track.rotation_track.values.size()) {
+ base_rot = state.nodes[E->key()]->rotation;
+ }
+
+ if (!track.translation_track.values.size()) {
+ base_pos = state.nodes[E->key()]->translation;
+ }
+
+ if (!track.scale_track.values.size()) {
+ base_scale = state.nodes[E->key()]->scale;
+ }
+
+ bool last = false;
+ while (true) {
+
+ Vector3 pos = base_pos;
+ Quat rot = base_rot;
+ Vector3 scale = base_scale;
+
+ if (track.translation_track.times.size()) {
+
+ pos = _interpolate_track<Vector3>(track.translation_track.times, track.translation_track.values, time, track.translation_track.interpolation);
+ }
+
+ if (track.rotation_track.times.size()) {
+
+ rot = _interpolate_track<Quat>(track.rotation_track.times, track.rotation_track.values, time, track.rotation_track.interpolation);
+ }
+
+ if (track.scale_track.times.size()) {
+
+ scale = _interpolate_track<Vector3>(track.scale_track.times, track.scale_track.values, time, track.scale_track.interpolation);
+ }
+
+ if (node->godot_bone_index >= 0) {
+
+ Transform xform;
+ xform.basis = Basis(rot);
+ xform.basis.scale(scale);
+ xform.origin = pos;
+
+ Skeleton *skeleton = skeletons[node->joint_skin];
+ int bone = node->godot_bone_index;
+ xform = skeleton->get_bone_rest(bone).affine_inverse() * xform;
+
+ rot = xform.basis;
+ rot.normalize();
+ scale = xform.basis.get_scale();
+ pos = xform.origin;
+ }
+
+ animation->transform_track_insert_key(track_idx, time, pos, rot, scale);
+
+ if (last) {
+ break;
+ }
+ time += increment;
+ if (time >= length) {
+ last = true;
+ time = length;
+ }
+ }
+ }
+
+ for (int i = 0; i < track.weight_tracks.size(); i++) {
+ ERR_CONTINUE(node->mesh < 0 || node->mesh >= state.meshes.size());
+ const GLTFMesh &mesh = state.meshes[node->mesh];
+ String prop = "blend_shapes/" + mesh.mesh->get_blend_shape_name(i);
+ node_path = String(node_path) + ":" + prop;
+
+ int track_idx = animation->get_track_count();
+ animation->add_track(Animation::TYPE_VALUE);
+ animation->track_set_path(track_idx, node_path);
+
+ if (track.weight_tracks[i].interpolation <= GLTFAnimation::INTERP_STEP) {
+ animation->track_set_interpolation_type(track_idx, track.weight_tracks[i].interpolation == GLTFAnimation::INTERP_STEP ? Animation::INTERPOLATION_NEAREST : Animation::INTERPOLATION_NEAREST);
+ for (int j = 0; j < track.weight_tracks[i].times.size(); j++) {
+ float t = track.weight_tracks[i].times[j];
+ float w = track.weight_tracks[i].values[j];
+ animation->track_insert_key(track_idx, t, w);
+ }
+ } else {
+ //must bake, apologies.
+ float increment = 1.0 / float(bake_fps);
+ float time = 0.0;
+
+ bool last = false;
+ while (true) {
+
+ float value = _interpolate_track<float>(track.weight_tracks[i].times, track.weight_tracks[i].values, time, track.weight_tracks[i].interpolation);
+ if (last) {
+ break;
+ }
+ time += increment;
+ if (time >= length) {
+ last = true;
+ time = length;
+ }
+ }
+ }
+ }
+ }
+
+ ap->add_animation(name, animation);
+}
+
+Spatial *EditorSceneImporterGLTF::_generate_scene(GLTFState &state, int p_bake_fps) {
+
+ Spatial *root = memnew(Spatial);
+ root->set_name(state.scene_name);
+ //generate skeletons
+ Vector<Skeleton *> skeletons;
+ for (int i = 0; i < state.skins.size(); i++) {
+ Skeleton *s = memnew(Skeleton);
+ String name = state.skins[i].name;
+ if (name == "") {
+ name = _gen_unique_name(state, "Skeleton");
+ }
+ s->set_name(name);
+ root->add_child(s);
+ s->set_owner(root);
+ skeletons.push_back(s);
+ }
+ for (int i = 0; i < state.root_nodes.size(); i++) {
+ if (state.nodes[state.root_nodes[i]]->joint_skin >= 0) {
+ _generate_bone(state, state.root_nodes[i], skeletons, -1);
+ } else {
+ _generate_node(state, state.root_nodes[i], root, root, skeletons);
+ }
+ }
+
+ for (int i = 0; i < skeletons.size(); i++) {
+ skeletons[i]->localize_rests();
+ }
+
+ if (state.animations.size()) {
+ AnimationPlayer *ap = memnew(AnimationPlayer);
+ ap->set_name("AnimationPlayer");
+ root->add_child(ap);
+ ap->set_owner(root);
+
+ for (int i = 0; i < state.animations.size(); i++) {
+ _import_animation(state, ap, i, p_bake_fps, skeletons);
+ }
+ }
+
+ return root;
+}
+
+Node *EditorSceneImporterGLTF::import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err) {
+
+ GLTFState state;
+
+ if (p_path.to_lower().ends_with("glb")) {
+ //binary file
+ //text file
+ Error err = _parse_glb(p_path, state);
+ if (err)
+ return NULL;
+ } else {
+ //text file
+ Error err = _parse_json(p_path, state);
+ if (err)
+ return NULL;
+ }
+
+ ERR_FAIL_COND_V(!state.json.has("asset"), NULL);
+
+ Dictionary asset = state.json["asset"];
+
+ ERR_FAIL_COND_V(!asset.has("version"), NULL);
+
+ String version = asset["version"];
+
+ state.major_version = version.get_slice(".", 0).to_int();
+ state.minor_version = version.get_slice(".", 1).to_int();
+
+ /* STEP 0 PARSE SCENE */
+ Error err = _parse_scenes(state);
+ if (err != OK)
+ return NULL;
+
+ /* STEP 1 PARSE NODES */
+ err = _parse_nodes(state);
+ if (err != OK)
+ return NULL;
+
+ /* STEP 2 PARSE BUFFERS */
+ err = _parse_buffers(state, p_path.get_base_dir());
+ if (err != OK)
+ return NULL;
+
+ /* STEP 3 PARSE BUFFER VIEWS */
+ err = _parse_buffer_views(state);
+ if (err != OK)
+ return NULL;
+
+ /* STEP 4 PARSE ACCESSORS */
+ err = _parse_accessors(state);
+ if (err != OK)
+ return NULL;
+
+ /* STEP 5 PARSE IMAGES */
+ err = _parse_images(state, p_path.get_base_dir());
+ if (err != OK)
+ return NULL;
+
+ /* STEP 6 PARSE TEXTURES */
+ err = _parse_textures(state);
+ if (err != OK)
+ return NULL;
+
+ /* STEP 7 PARSE TEXTURES */
+ err = _parse_materials(state);
+ if (err != OK)
+ return NULL;
+
+ /* STEP 8 PARSE MESHES (we have enough info now) */
+ err = _parse_meshes(state);
+ if (err != OK)
+ return NULL;
+
+ /* STEP 9 PARSE SKINS */
+ err = _parse_skins(state);
+ if (err != OK)
+ return NULL;
+
+ /* STEP 10 PARSE CAMERAS */
+ err = _parse_cameras(state);
+ if (err != OK)
+ return NULL;
+
+ /* STEP 11 PARSE ANIMATIONS */
+ err = _parse_animations(state);
+ if (err != OK)
+ return NULL;
+
+ /* STEP 12 ASSIGN SCENE NAMES */
+ _assign_scene_names(state);
+
+ /* STEP 13 MAKE SCENE! */
+ Spatial *scene = _generate_scene(state, p_bake_fps);
+
+ return scene;
+}
+
+Ref<Animation> EditorSceneImporterGLTF::import_animation(const String &p_path, uint32_t p_flags) {
+
+ return Ref<Animation>();
+}
+
+EditorSceneImporterGLTF::EditorSceneImporterGLTF() {
+}
diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h
new file mode 100644
index 0000000000..d9479fae6f
--- /dev/null
+++ b/editor/import/editor_scene_importer_gltf.h
@@ -0,0 +1,304 @@
+#ifndef EDITOR_SCENE_IMPORTER_GLTF_H
+#define EDITOR_SCENE_IMPORTER_GLTF_H
+
+#include "editor/import/resource_importer_scene.h"
+#include "scene/3d/skeleton.h"
+#include "scene/3d/spatial.h"
+
+class AnimationPlayer;
+
+class EditorSceneImporterGLTF : public EditorSceneImporter {
+
+ GDCLASS(EditorSceneImporterGLTF, EditorSceneImporter);
+
+ enum {
+ ARRAY_BUFFER = 34962,
+ ELEMENT_ARRAY_BUFFER = 34963,
+
+ TYPE_BYTE = 5120,
+ TYPE_UNSIGNED_BYTE = 5121,
+ TYPE_SHORT = 5122,
+ TYPE_UNSIGNED_SHORT = 5123,
+ TYPE_UNSIGNED_INT = 5125,
+ TYPE_FLOAT = 5126,
+
+ COMPONENT_TYPE_BYTE = 5120,
+ COMPONENT_TYPE_UNSIGNED_BYTE = 5121,
+ COMPONENT_TYPE_SHORT = 5122,
+ COMPONENT_TYPE_UNSIGNED_SHORT = 5123,
+ COMPONENT_TYPE_INT = 5125,
+ COMPONENT_TYPE_FLOAT = 5126,
+
+ };
+
+ String _get_component_type_name(uint32_t p_component);
+ int _get_component_type_size(int component_type);
+
+ enum GLTFType {
+ TYPE_SCALAR,
+ TYPE_VEC2,
+ TYPE_VEC3,
+ TYPE_VEC4,
+ TYPE_MAT2,
+ TYPE_MAT3,
+ TYPE_MAT4,
+ };
+
+ String _get_type_name(GLTFType p_component);
+
+ struct GLTFNode {
+ //matrices need to be transformed to this
+ int parent;
+
+ Transform xform;
+ String name;
+ Node *godot_node;
+ int godot_bone_index;
+
+ int mesh;
+ int camera;
+ int skin;
+ int skeleton_skin;
+ int child_of_skeleton; // put as children of skeleton
+ Vector<int> skeleton_children; //skeleton put as children of this
+
+ int joint_skin;
+ int joint_bone;
+
+ //keep them for animation
+ Vector3 translation;
+ Quat rotation;
+ Vector3 scale;
+
+ Vector<int> children;
+
+ GLTFNode() {
+ godot_node = NULL;
+ godot_bone_index = -1;
+ joint_skin = -1;
+ joint_bone = -1;
+ child_of_skeleton = -1;
+ skeleton_skin = -1;
+ mesh = -1;
+ camera = -1;
+ parent = -1;
+ scale = Vector3(1, 1, 1);
+ }
+ };
+
+ struct GLTFBufferView {
+
+ int buffer;
+ int byte_offset;
+ int byte_length;
+ int byte_stride;
+ bool indices;
+ //matrices need to be transformed to this
+
+ GLTFBufferView() {
+ buffer = 0;
+ byte_offset = 0;
+ byte_length = 0;
+ byte_stride = 0;
+ indices = false;
+ }
+ };
+
+ struct GLTFAccessor {
+
+ int buffer_view;
+ int byte_offset;
+ int component_type;
+ bool normalized;
+ int count;
+ GLTFType type;
+ float min;
+ float max;
+ int sparse_count;
+ int sparse_indices_buffer_view;
+ int sparse_indices_byte_offset;
+ int sparse_indices_component_type;
+ int sparse_values_buffer_view;
+ int sparse_values_byte_offset;
+
+ //matrices need to be transformed to this
+
+ GLTFAccessor() {
+ buffer_view = 0;
+ byte_offset = 0;
+ component_type = 0;
+ normalized = false;
+ count = 0;
+ min = 0;
+ max = 0;
+ sparse_count = 0;
+ sparse_indices_byte_offset = 0;
+ sparse_values_byte_offset = 0;
+ }
+ };
+ struct GLTFTexture {
+ int src_image;
+ };
+
+ struct GLTFSkin {
+
+ String name;
+ struct Bone {
+ Transform inverse_bind;
+ int node;
+ };
+
+ int skeleton;
+ Vector<Bone> bones;
+
+ //matrices need to be transformed to this
+
+ GLTFSkin() {
+ skeleton = -1;
+ }
+ };
+
+ struct GLTFMesh {
+ Ref<ArrayMesh> mesh;
+ Vector<float> blend_weights;
+ };
+
+ struct GLTFCamera {
+
+ bool perspective;
+ float fov_size;
+ float zfar;
+ float znear;
+
+ GLTFCamera() {
+ perspective = true;
+ fov_size = 65;
+ zfar = 500;
+ znear = 0.1;
+ }
+ };
+
+ struct GLTFAnimation {
+
+ enum Interpolation {
+ INTERP_LINEAR,
+ INTERP_STEP,
+ INTERP_CATMULLROMSPLINE,
+ INTERP_CUBIC_SPLINE
+ };
+
+ template <class T>
+ struct Channel {
+ Interpolation interpolation;
+ Vector<float> times;
+ Vector<T> values;
+ };
+
+ struct Track {
+
+ Channel<Vector3> translation_track;
+ Channel<Quat> rotation_track;
+ Channel<Vector3> scale_track;
+ Vector<Channel<float> > weight_tracks;
+ };
+
+ String name;
+
+ Map<int, Track> tracks;
+ };
+
+ struct GLTFState {
+
+ Dictionary json;
+ int major_version;
+ int minor_version;
+ Vector<uint8_t> glb_data;
+
+ Vector<GLTFNode *> nodes;
+ Vector<Vector<uint8_t> > buffers;
+ Vector<GLTFBufferView> buffer_views;
+ Vector<GLTFAccessor> accessors;
+
+ Vector<GLTFMesh> meshes; //meshes are loaded directly, no reason not to.
+ Vector<Ref<Material> > materials;
+
+ String scene_name;
+ Vector<int> root_nodes;
+
+ Vector<GLTFTexture> textures;
+ Vector<Ref<Texture> > images;
+
+ Vector<GLTFSkin> skins;
+ Vector<GLTFCamera> cameras;
+
+ Set<String> unique_names;
+
+ Vector<GLTFAnimation> animations;
+
+ Map<int, Vector<int> > skin_users; //cache skin users
+
+ ~GLTFState() {
+ for (int i = 0; i < nodes.size(); i++) {
+ memdelete(nodes[i]);
+ }
+ }
+ };
+
+ String _gen_unique_name(GLTFState &state, const String &p_name);
+
+ Ref<Texture> _get_texture(GLTFState &state, int p_texture);
+
+ Error _parse_json(const String &p_path, GLTFState &state);
+ Error _parse_glb(const String &p_path, GLTFState &state);
+
+ Error _parse_scenes(GLTFState &state);
+ Error _parse_nodes(GLTFState &state);
+ Error _parse_buffers(GLTFState &state, const String &p_base_path);
+ Error _parse_buffer_views(GLTFState &state);
+ GLTFType _get_type_from_str(const String &p_string);
+ Error _parse_accessors(GLTFState &state);
+ Error _decode_buffer_view(GLTFState &state, int p_buffer_view, double *dst, int skip_every, int skip_bytes, int element_size, int count, GLTFType type, int component_count, int component_type, int component_size, bool normalized, int byte_offset, bool for_vertex);
+ Vector<double> _decode_accessor(GLTFState &state, int p_accessor, bool p_for_vertex);
+ PoolVector<float> _decode_accessor_as_floats(GLTFState &state, int p_accessor, bool p_for_vertex);
+ PoolVector<int> _decode_accessor_as_ints(GLTFState &state, int p_accessor, bool p_for_vertex);
+ PoolVector<Vector2> _decode_accessor_as_vec2(GLTFState &state, int p_accessor, bool p_for_vertex);
+ PoolVector<Vector3> _decode_accessor_as_vec3(GLTFState &state, int p_accessor, bool p_for_vertex);
+ PoolVector<Color> _decode_accessor_as_color(GLTFState &state, int p_accessor, bool p_for_vertex);
+ Vector<Quat> _decode_accessor_as_quat(GLTFState &state, int p_accessor, bool p_for_vertex);
+ Vector<Transform2D> _decode_accessor_as_xform2d(GLTFState &state, int p_accessor, bool p_for_vertex);
+ Vector<Basis> _decode_accessor_as_basis(GLTFState &state, int p_accessor, bool p_for_vertex);
+ Vector<Transform> _decode_accessor_as_xform(GLTFState &state, int p_accessor, bool p_for_vertex);
+
+ void _generate_bone(GLTFState &state, int p_node, Vector<Skeleton *> &skeletons, int p_parent_bone);
+ void _generate_node(GLTFState &state, int p_node, Node *p_parent, Node *p_owner, Vector<Skeleton *> &skeletons);
+ void _import_animation(GLTFState &state, AnimationPlayer *ap, int index, int bake_fps, Vector<Skeleton *> skeletons);
+
+ Spatial *_generate_scene(GLTFState &state, int p_bake_fps);
+
+ Error _parse_meshes(GLTFState &state);
+ Error _parse_images(GLTFState &state, const String &p_base_path);
+ Error _parse_textures(GLTFState &state);
+
+ Error _parse_materials(GLTFState &state);
+
+ Error _parse_skins(GLTFState &state);
+
+ Error _parse_cameras(GLTFState &state);
+
+ Error _parse_animations(GLTFState &state);
+
+ void _assign_scene_names(GLTFState &state);
+
+ template <class T>
+ T _interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values, float p_time, GLTFAnimation::Interpolation p_interp);
+
+public:
+ virtual uint32_t get_import_flags() const;
+ virtual void get_extensions(List<String> *r_extensions) const;
+ virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps = NULL, Error *r_err = NULL);
+ virtual Ref<Animation> import_animation(const String &p_path, uint32_t p_flags);
+
+ EditorSceneImporterGLTF();
+};
+
+#endif // EDITOR_SCENE_IMPORTER_GLTF_H
diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp
index 3be89920fb..9214b8f45e 100644
--- a/editor/import/resource_importer_csv_translation.cpp
+++ b/editor/import/resource_importer_csv_translation.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -53,7 +54,7 @@ String ResourceImporterCSVTranslation::get_save_extension() const {
String ResourceImporterCSVTranslation::get_resource_type() const {
- return "StreamCSVTranslation";
+ return "Translation";
}
bool ResourceImporterCSVTranslation::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const {
@@ -127,7 +128,7 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const
xlt = cxl;
}
- String save_path = p_source_file.get_basename() + "." + translations[i]->get_locale() + ".xl";
+ String save_path = p_source_file.get_basename() + "." + translations[i]->get_locale() + ".translation";
ResourceSaver::save(save_path, xlt);
if (r_gen_files) {
diff --git a/editor/import/resource_importer_csv_translation.h b/editor/import/resource_importer_csv_translation.h
index 8b1e1b5827..748c6264df 100644
--- a/editor/import/resource_importer_csv_translation.h
+++ b/editor/import/resource_importer_csv_translation.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp
index 145071d4cb..8f86e64cf2 100644
--- a/editor/import/resource_importer_obj.cpp
+++ b/editor/import/resource_importer_obj.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,83 +31,206 @@
#include "io/resource_saver.h"
#include "os/file_access.h"
+#include "scene/3d/mesh_instance.h"
+#include "scene/3d/spatial.h"
#include "scene/resources/mesh.h"
#include "scene/resources/surface_tool.h"
-#include "scene/resources/surface_tool.h"
-String ResourceImporterOBJ::get_importer_name() const {
+uint32_t EditorOBJImporter::get_import_flags() const {
- return "obj_mesh";
+ return IMPORT_SCENE;
}
+void EditorOBJImporter::get_extensions(List<String> *r_extensions) const {
-String ResourceImporterOBJ::get_visible_name() const {
-
- return "OBJ As Mesh";
+ r_extensions->push_back("obj");
}
-void ResourceImporterOBJ::get_recognized_extensions(List<String> *p_extensions) const {
- p_extensions->push_back("obj");
-}
-String ResourceImporterOBJ::get_save_extension() const {
- return "msh";
-}
+Error EditorOBJImporter::_parse_material_library(const String &p_path, Map<String, Ref<SpatialMaterial> > &material_map, List<String> *r_missing_deps) {
-String ResourceImporterOBJ::get_resource_type() const {
+ FileAccessRef f = FileAccess::open(p_path, FileAccess::READ);
+ ERR_FAIL_COND_V(!f, ERR_CANT_OPEN);
- return "Mesh";
-}
+ Ref<SpatialMaterial> current;
+ String current_name;
+ String base_path = p_path.get_base_dir();
+ while (true) {
-bool ResourceImporterOBJ::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const {
+ String l = f->get_line().strip_edges();
- return true;
-}
+ if (l.begins_with("newmtl ")) {
+ //vertex
-int ResourceImporterOBJ::get_preset_count() const {
- return 0;
-}
-String ResourceImporterOBJ::get_preset_name(int p_idx) const {
+ current_name = l.replace("newmtl", "").strip_edges();
+ current.instance();
+ material_map[current_name] = current;
+ } else if (l.begins_with("Ka ")) {
+ //uv
+ print_line("Warning: Ambient light for material '" + current_name + "' is ignored in PBR");
- return String();
-}
+ } else if (l.begins_with("Kd ")) {
+ //normal
+ ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
+ Vector<String> v = l.split(" ", false);
+ ERR_FAIL_COND_V(v.size() < 4, ERR_INVALID_DATA);
+ Color c = current->get_albedo();
+ c.r = v[1].to_float();
+ c.g = v[2].to_float();
+ c.b = v[3].to_float();
+ current->set_albedo(c);
+ } else if (l.begins_with("Ks ")) {
+ //normal
+ ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
+ Vector<String> v = l.split(" ", false);
+ ERR_FAIL_COND_V(v.size() < 4, ERR_INVALID_DATA);
+ float r = v[1].to_float();
+ float g = v[2].to_float();
+ float b = v[3].to_float();
+ float metalness = MAX(r, MAX(g, b));
+ current->set_metallic(metalness);
+ } else if (l.begins_with("Ns ")) {
+ //normal
+ ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
+ Vector<String> v = l.split(" ", false);
+ ERR_FAIL_COND_V(v.size() != 2, ERR_INVALID_DATA);
+ float s = v[1].to_float();
+ current->set_metallic((1000.0 - s) / 1000.0);
+ } else if (l.begins_with("d ")) {
+ //normal
+ ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
+ Vector<String> v = l.split(" ", false);
+ ERR_FAIL_COND_V(v.size() != 2, ERR_INVALID_DATA);
+ float d = v[1].to_float();
+ Color c = current->get_albedo();
+ c.a = d;
+ current->set_albedo(c);
+ if (c.a < 0.99) {
+ current->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ }
+ } else if (l.begins_with("Tr ")) {
+ //normal
+ ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
+ Vector<String> v = l.split(" ", false);
+ ERR_FAIL_COND_V(v.size() != 2, ERR_INVALID_DATA);
+ float d = v[1].to_float();
+ Color c = current->get_albedo();
+ c.a = 1.0 - d;
+ current->set_albedo(c);
+ if (c.a < 0.99) {
+ current->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ }
+
+ } else if (l.begins_with("map_Ka ")) {
+ //uv
+ print_line("Warning: Ambient light texture for material '" + current_name + "' is ignored in PBR");
+
+ } else if (l.begins_with("map_Kd ")) {
+ //normal
+ ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
+
+ String p = l.replace("map_Kd", "").replace("\\", "/").strip_edges();
+ String path = base_path.plus_file(p);
+
+ Ref<Texture> texture = ResourceLoader::load(path);
+
+ if (texture.is_valid()) {
+ current->set_texture(SpatialMaterial::TEXTURE_ALBEDO, texture);
+ } else {
+ r_missing_deps->push_back(path);
+ }
+
+ } else if (l.begins_with("map_Ks ")) {
+ //normal
+ ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
+
+ String p = l.replace("map_Ks", "").replace("\\", "/").strip_edges();
+ String path = base_path.plus_file(p);
+
+ Ref<Texture> texture = ResourceLoader::load(path);
+
+ if (texture.is_valid()) {
+ current->set_texture(SpatialMaterial::TEXTURE_METALLIC, texture);
+ } else {
+ r_missing_deps->push_back(path);
+ }
+
+ } else if (l.begins_with("map_Ns ")) {
+ //normal
+ ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
+
+ String p = l.replace("map_Ns", "").replace("\\", "/").strip_edges();
+ String path = base_path.plus_file(p);
+
+ Ref<Texture> texture = ResourceLoader::load(path);
+
+ if (texture.is_valid()) {
+ current->set_texture(SpatialMaterial::TEXTURE_ROUGHNESS, texture);
+ } else {
+ r_missing_deps->push_back(path);
+ }
+ } else if (l.begins_with("map_bump ")) {
+ //normal
+ ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
+
+ String p = l.replace("map_bump", "").replace("\\", "/").strip_edges();
+ String path = base_path.plus_file(p);
+
+ Ref<Texture> texture = ResourceLoader::load(path);
-void ResourceImporterOBJ::get_import_options(List<ImportOption> *r_options, int p_preset) const {
-
- r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "generate/tangents"), true));
- r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "generate/normals"), true));
- //not for nowp
- //r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"import/materials")));
- //r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"import/textures")));
- r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/flip_faces"), false));
- r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/smooth_shading"), true));
- r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/weld_vertices"), true));
- r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "force/weld_tolerance", PROPERTY_HINT_RANGE, "0.00001,16,0.00001"), 0.0001));
- //r_options->push_back(PropertyInfo(Variant::INT,"compress/bitrate",PROPERTY_HINT_ENUM,"64,96,128,192"));
+ if (texture.is_valid()) {
+ current->set_feature(SpatialMaterial::FEATURE_NORMAL_MAPPING, true);
+ current->set_texture(SpatialMaterial::TEXTURE_NORMAL, texture);
+ } else {
+ r_missing_deps->push_back(path);
+ }
+ } else if (f->eof_reached()) {
+ break;
+ }
+ }
+
+ return OK;
}
-Error ResourceImporterOBJ::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) {
+Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err) {
- FileAccessRef f = FileAccess::open(p_source_file, FileAccess::READ);
- ERR_FAIL_COND_V(!f, ERR_CANT_OPEN);
+ FileAccessRef f = FileAccess::open(p_path, FileAccess::READ);
+
+ if (r_err) {
+ *r_err = ERR_CANT_OPEN;
+ }
+
+ ERR_FAIL_COND_V(!f, NULL);
+
+ if (r_err) {
+ *r_err = OK;
+ }
+
+ Spatial *scene = memnew(Spatial);
+
+ Ref<ArrayMesh> mesh;
+ mesh.instance();
- Ref<Mesh> mesh = Ref<Mesh>(memnew(Mesh));
Map<String, Ref<Material> > name_map;
- bool generate_normals = p_options["generate/normals"];
- bool generate_tangents = p_options["generate/tangents"];
- bool flip_faces = p_options["force/flip_faces"];
- bool force_smooth = p_options["force/smooth_shading"];
- bool weld_vertices = p_options["force/weld_vertices"];
- float weld_tolerance = p_options["force/weld_tolerance"];
+ bool generate_tangents = p_flags & IMPORT_GENERATE_TANGENT_ARRAYS;
+ bool flip_faces = false;
+ //bool flip_faces = p_options["force/flip_faces"];
+ //bool force_smooth = p_options["force/smooth_shading"];
+ //bool weld_vertices = p_options["force/weld_vertices"];
+ //float weld_tolerance = p_options["force/weld_tolerance"];
+
Vector<Vector3> vertices;
Vector<Vector3> normals;
Vector<Vector2> uvs;
String name;
+ Map<String, Map<String, Ref<SpatialMaterial> > > material_map;
+
Ref<SurfaceTool> surf_tool = memnew(SurfaceTool);
surf_tool->begin(Mesh::PRIMITIVE_TRIANGLES);
- if (force_smooth)
- surf_tool->add_smooth_group(true);
- int has_index_data = false;
+
+ String current_material_library;
+ String current_material;
+ String current_group;
while (true) {
@@ -115,7 +239,7 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s
if (l.begins_with("v ")) {
//vertex
Vector<String> v = l.split(" ", false);
- ERR_FAIL_COND_V(v.size() < 4, ERR_INVALID_DATA);
+ ERR_FAIL_COND_V(v.size() < 4, NULL);
Vector3 vtx;
vtx.x = v[1].to_float();
vtx.y = v[2].to_float();
@@ -124,7 +248,7 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s
} else if (l.begins_with("vt ")) {
//uv
Vector<String> v = l.split(" ", false);
- ERR_FAIL_COND_V(v.size() < 3, ERR_INVALID_DATA);
+ ERR_FAIL_COND_V(v.size() < 3, NULL);
Vector2 uv;
uv.x = v[1].to_float();
uv.y = 1.0 - v[2].to_float();
@@ -133,7 +257,7 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s
} else if (l.begins_with("vn ")) {
//normal
Vector<String> v = l.split(" ", false);
- ERR_FAIL_COND_V(v.size() < 4, ERR_INVALID_DATA);
+ ERR_FAIL_COND_V(v.size() < 4, NULL);
Vector3 nrm;
nrm.x = v[1].to_float();
nrm.y = v[2].to_float();
@@ -142,21 +266,20 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s
} else if (l.begins_with("f ")) {
//vertex
- has_index_data = true;
Vector<String> v = l.split(" ", false);
- ERR_FAIL_COND_V(v.size() < 4, ERR_INVALID_DATA);
+ ERR_FAIL_COND_V(v.size() < 4, NULL);
//not very fast, could be sped up
Vector<String> face[3];
face[0] = v[1].split("/");
face[1] = v[2].split("/");
- ERR_FAIL_COND_V(face[0].size() == 0, ERR_PARSE_ERROR);
- ERR_FAIL_COND_V(face[0].size() != face[1].size(), ERR_PARSE_ERROR);
+ ERR_FAIL_COND_V(face[0].size() == 0, NULL);
+ ERR_FAIL_COND_V(face[0].size() != face[1].size(), NULL);
for (int i = 2; i < v.size() - 1; i++) {
face[2] = v[i + 1].split("/");
- ERR_FAIL_COND_V(face[0].size() != face[2].size(), ERR_PARSE_ERROR);
+ ERR_FAIL_COND_V(face[0].size() != face[2].size(), NULL);
for (int j = 0; j < 3; j++) {
int idx = j;
@@ -167,63 +290,119 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s
if (face[idx].size() == 3) {
int norm = face[idx][2].to_int() - 1;
- ERR_FAIL_INDEX_V(norm, normals.size(), ERR_PARSE_ERROR);
+ if (norm < 0)
+ norm += normals.size() + 1;
+ ERR_FAIL_INDEX_V(norm, normals.size(), NULL);
surf_tool->add_normal(normals[norm]);
}
if (face[idx].size() >= 2 && face[idx][1] != String()) {
-
int uv = face[idx][1].to_int() - 1;
- ERR_FAIL_INDEX_V(uv, uvs.size(), ERR_PARSE_ERROR);
+ if (uv < 0)
+ uv += uvs.size() + 1;
+ ERR_FAIL_INDEX_V(uv, uvs.size(), NULL);
surf_tool->add_uv(uvs[uv]);
}
int vtx = face[idx][0].to_int() - 1;
- ERR_FAIL_INDEX_V(vtx, vertices.size(), ERR_PARSE_ERROR);
+ if (vtx < 0)
+ vtx += vertices.size() + 1;
+ ERR_FAIL_INDEX_V(vtx, vertices.size(), NULL);
Vector3 vertex = vertices[vtx];
- if (weld_vertices)
- vertex = vertex.snapped(weld_tolerance);
+ //if (weld_vertices)
+ // vertex.snap(Vector3(weld_tolerance, weld_tolerance, weld_tolerance));
surf_tool->add_vertex(vertex);
}
face[1] = face[2];
}
- } else if (l.begins_with("s ") && !force_smooth) { //smoothing
+ } else if (l.begins_with("s ")) { //smoothing
String what = l.substr(2, l.length()).strip_edges();
if (what == "off")
surf_tool->add_smooth_group(false);
else
surf_tool->add_smooth_group(true);
-
- } else if (l.begins_with("o ") || f->eof_reached()) { //new surface or done
-
- if (has_index_data) {
- //new object/surface
- if (generate_normals || force_smooth)
+ } else if (/*l.begins_with("g ") ||*/ l.begins_with("usemtl ") || (l.begins_with("o ") || f->eof_reached())) { //commit group to mesh
+ //groups are too annoying
+ if (surf_tool->get_vertex_array().size()) {
+ //another group going on, commit it
+ if (normals.size() == 0) {
surf_tool->generate_normals();
- if (uvs.size() && (normals.size() || generate_normals) && generate_tangents)
+ }
+
+ if (generate_tangents && uvs.size()) {
surf_tool->generate_tangents();
+ }
surf_tool->index();
+
+ print_line("current material library " + current_material_library + " has " + itos(material_map.has(current_material_library)));
+ print_line("current material " + current_material + " has " + itos(material_map.has(current_material_library) && material_map[current_material_library].has(current_material)));
+
+ if (material_map.has(current_material_library) && material_map[current_material_library].has(current_material)) {
+ surf_tool->set_material(material_map[current_material_library][current_material]);
+ }
+
mesh = surf_tool->commit(mesh);
- if (name == "")
- name = vformat(TTR("Surface %d"), mesh->get_surface_count() - 1);
- mesh->surface_set_name(mesh->get_surface_count() - 1, name);
- name = "";
+
+ if (current_material != String()) {
+ mesh->surface_set_name(mesh->get_surface_count() - 1, current_material.get_basename());
+ } else if (current_group != String()) {
+ mesh->surface_set_name(mesh->get_surface_count() - 1, current_group);
+ }
+
+ print_line("Added surface :" + mesh->surface_get_name(mesh->get_surface_count() - 1));
surf_tool->clear();
surf_tool->begin(Mesh::PRIMITIVE_TRIANGLES);
- if (force_smooth)
- surf_tool->add_smooth_group(true);
+ }
- has_index_data = false;
+ if (l.begins_with("o ") || f->eof_reached()) {
- if (f->eof_reached())
- break;
+ MeshInstance *mi = memnew(MeshInstance);
+ mi->set_name(name);
+ mi->set_mesh(mesh);
+
+ scene->add_child(mi);
+ mi->set_owner(scene);
+
+ mesh.instance();
+ current_group = "";
+ current_material = "";
+ }
+
+ if (f->eof_reached()) {
+ break;
}
- if (l.begins_with("o ")) //name
+ if (l.begins_with("o ")) {
name = l.substr(2, l.length()).strip_edges();
+ }
+
+ if (l.begins_with("usemtl ")) {
+
+ current_material = l.replace("usemtl", "").strip_edges();
+ }
+
+ if (l.begins_with("g ")) {
+
+ current_group = l.substr(2, l.length()).strip_edges();
+ }
+
+ } else if (l.begins_with("mtllib ")) { //parse material
+
+ current_material_library = l.replace("mtllib", "").strip_edges();
+ if (!material_map.has(current_material_library)) {
+ Map<String, Ref<SpatialMaterial> > lib;
+ Error err = _parse_material_library(current_material_library, lib, r_missing_deps);
+ if (err == ERR_CANT_OPEN) {
+ String dir = p_path.get_base_dir();
+ err = _parse_material_library(dir.plus_file(current_material_library), lib, r_missing_deps);
+ }
+ if (err == OK) {
+ material_map[current_material_library] = lib;
+ }
+ }
}
}
@@ -238,10 +417,11 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s
}
*/
- Error err = ResourceSaver::save(p_save_path + ".msh", mesh);
-
- return err;
+ return scene;
}
+Ref<Animation> EditorOBJImporter::import_animation(const String &p_path, uint32_t p_flags) {
-ResourceImporterOBJ::ResourceImporterOBJ() {
+ return Ref<Animation>();
+}
+EditorOBJImporter::EditorOBJImporter() {
}
diff --git a/editor/import/resource_importer_obj.h b/editor/import/resource_importer_obj.h
index de2f2eceda..c8285ce6c9 100644
--- a/editor/import/resource_importer_obj.h
+++ b/editor/import/resource_importer_obj.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,26 +30,21 @@
#ifndef RESOURCEIMPORTEROBJ_H
#define RESOURCEIMPORTEROBJ_H
-#include "io/resource_import.h"
+#include "import/resource_importer_scene.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;
+class EditorOBJImporter : public EditorSceneImporter {
- virtual int get_preset_count() const;
- virtual String get_preset_name(int p_idx) const;
+ GDCLASS(EditorOBJImporter, EditorSceneImporter);
- 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;
+ Error _parse_material_library(const String &p_path, Map<String, Ref<SpatialMaterial> > &material_map, List<String> *r_missing_deps);
- 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);
+public:
+ virtual uint32_t get_import_flags() const;
+ virtual void get_extensions(List<String> *r_extensions) const;
+ virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err = NULL);
+ virtual Ref<Animation> import_animation(const String &p_path, uint32_t p_flags);
- ResourceImporterOBJ();
+ EditorOBJImporter();
};
#endif // RESOURCEIMPORTEROBJ_H
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index 8a78376f13..ae89dfd77f 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,7 +33,7 @@
#include "io/resource_saver.h"
#include "scene/resources/packed_scene.h"
-#include "scene/3d/body_shape.h"
+#include "scene/3d/collision_shape.h"
#include "scene/3d/mesh_instance.h"
#include "scene/3d/navigation.h"
#include "scene/3d/physics_body.h"
@@ -103,14 +104,27 @@ bool ResourceImporterScene::get_option_visibility(const String &p_option, const
}
}
+ if (p_option == "materials/keep_files" && int(p_options["materials/storage"]) == 0) {
+ return false;
+ }
+
return true;
}
int ResourceImporterScene::get_preset_count() const {
- return 0;
+ return 6;
}
String ResourceImporterScene::get_preset_name(int p_idx) const {
+ switch (p_idx) {
+ case PRESET_SINGLE_SCENE: return TTR("Import as Single Scene");
+ case PRESET_SEPARATE_MATERIALS: return TTR("Import with Separate Materials");
+ case PRESET_SEPARATE_MESHES: return TTR("Import with Separate Objects");
+ case PRESET_SEPARATE_MESHES_AND_MATERIALS: return TTR("Import with Separate Objects+Materials");
+ case PRESET_MULTIPLE_SCENES: return TTR("Import as Multiple Scenes");
+ case PRESET_MULTIPLE_SCENES_AND_MATERIALS: return TTR("Import as Multiple Scenes+Materials");
+ }
+
return "";
}
@@ -136,7 +150,7 @@ static String _fixstr(const String &p_what, const String &p_str) {
return p_what;
}
-Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>, Ref<Shape> > &collision_map) {
+Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<ArrayMesh>, Ref<Shape> > &collision_map) {
// children first..
for (int i = 0; i < p_node->get_child_count(); i++) {
@@ -157,7 +171,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
memdelete(p_node);
return NULL;
}
-
+#if 0
if (p_node->cast_to<MeshInstance>()) {
MeshInstance *mi = p_node->cast_to<MeshInstance>();
@@ -174,44 +188,44 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
mi->set_flag(GeometryInstance::FLAG_BILLBOARD, true);
if (mi->get_mesh().is_valid()) {
- Ref<Mesh> m = mi->get_mesh();
+ Ref<ArrayMesh> m = mi->get_mesh();
for (int i = 0; i < m->get_surface_count(); i++) {
- Ref<FixedSpatialMaterial> fm = m->surface_get_material(i);
+ Ref<SpatialMaterial> fm = m->surface_get_material(i);
if (fm.is_valid()) {
//fm->set_flag(Material::FLAG_UNSHADED,true);
//fm->set_flag(Material::FLAG_DOUBLE_SIDED,true);
//fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
+ //fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true);
}
}
}
}
}
-
+#endif
if (p_node->cast_to<MeshInstance>()) {
MeshInstance *mi = p_node->cast_to<MeshInstance>();
- Ref<Mesh> m = mi->get_mesh();
+ Ref<ArrayMesh> m = mi->get_mesh();
if (m.is_valid()) {
for (int i = 0; i < m->get_surface_count(); i++) {
- Ref<FixedSpatialMaterial> mat = m->surface_get_material(i);
+ Ref<SpatialMaterial> mat = m->surface_get_material(i);
if (!mat.is_valid())
continue;
if (_teststr(mat->get_name(), "alpha")) {
- mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
mat->set_name(_fixstr(mat->get_name(), "alpha"));
}
if (_teststr(mat->get_name(), "vcol")) {
- mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
mat->set_name(_fixstr(mat->get_name(), "vcol"));
}
}
@@ -242,7 +256,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
}
}
}
-
+#if 0
if (p_node->cast_to<MeshInstance>()) {
MeshInstance *mi = p_node->cast_to<MeshInstance>();
@@ -274,15 +288,15 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
if (mi->get_mesh().is_valid()) {
- Ref<Mesh> m = mi->get_mesh();
+ Ref<ArrayMesh> m = mi->get_mesh();
for (int i = 0; i < m->get_surface_count(); i++) {
- Ref<FixedSpatialMaterial> fm = m->surface_get_material(i);
+ Ref<SpatialMaterial> fm = m->surface_get_material(i);
if (fm.is_valid()) {
//fm->set_flag(Material::FLAG_UNSHADED,true);
//fm->set_flag(Material::FLAG_DOUBLE_SIDED,true);
//fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
+ //fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true);
}
}
}
@@ -290,6 +304,8 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
}
}
}
+
+#endif
#if 0
if (p_flags&SCENE_FLAG_CREATE_LODS && p_node->cast_to<MeshInstance>()) {
@@ -322,15 +338,15 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
/*if (mi->get_mesh().is_valid()) {
- Ref<Mesh> m = mi->get_mesh();
+ Ref<ArrayMesh> m = mi->get_mesh();
for(int i=0;i<m->get_surface_count();i++) {
- Ref<FixedSpatialMaterial> fm = m->surface_get_material(i);
+ Ref<SpatialMaterial> fm = m->surface_get_material(i);
if (fm.is_valid()) {
fm->set_flag(Material::FLAG_UNSHADED,true);
fm->set_flag(Material::FLAG_DOUBLE_SIDED,true);
fm->set_hint(Material::HINT_NO_DEPTH_DRAW,true);
- fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
+ fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true);
}
}
}*/
@@ -366,10 +382,8 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
p_node = col;
StaticBody *sb = col->cast_to<StaticBody>();
- CollisionShape *colshape = memnew(CollisionShape);
- colshape->set_shape(sb->get_shape(0));
+ CollisionShape *colshape = sb->get_child(0)->cast_to<CollisionShape>();
colshape->set_name("shape");
- sb->add_child(colshape);
colshape->set_owner(p_node->get_owner());
} else if (p_node->has_meta("empty_draw_type")) {
String empty_draw_type = String(p_node->get_meta("empty_draw_type"));
@@ -460,8 +474,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
p_node->add_child(col);
StaticBody *sb = col->cast_to<StaticBody>();
- CollisionShape *colshape = memnew(CollisionShape);
- colshape->set_shape(sb->get_shape(0));
+ CollisionShape *colshape = sb->get_child(0)->cast_to<CollisionShape>();
colshape->set_name("shape");
col->add_child(colshape);
colshape->set_owner(p_node->get_owner());
@@ -474,7 +487,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
MeshInstance *mi = p_node->cast_to<MeshInstance>();
- Ref<Mesh> mesh = mi->get_mesh();
+ Ref<ArrayMesh> mesh = mi->get_mesh();
ERR_FAIL_COND_V(mesh.is_null(), NULL);
NavigationMeshInstance *nmi = memnew(NavigationMeshInstance);
@@ -591,7 +604,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
for (int i = 0; i < 3; i++) {
- Vector3 v = f.vertex[i].snapped(0.01);
+ Vector3 v = f.vertex[i].snapped(Vector3(0.01, 0.01, 0.01));
if (!points.has(v)) {
points.insert(v);
center += v;
@@ -652,7 +665,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
MeshInstance *mi = p_node->cast_to<MeshInstance>();
- Ref<Mesh> mesh = mi->get_mesh();
+ Ref<ArrayMesh> mesh = mi->get_mesh();
if (!mesh.is_null()) {
if (_teststr(mesh->get_name(), "col")) {
@@ -687,16 +700,16 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
for (int i = 0; i < mesh->get_surface_count(); i++) {
- Ref<FixedSpatialMaterial> fm = mesh->surface_get_material(i);
+ Ref<SpatialMaterial> fm = mesh->surface_get_material(i);
if (fm.is_valid()) {
String name = fm->get_name();
/* if (_teststr(name,"alpha")) {
- fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
+ fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true);
name=_fixstr(name,"alpha");
}
if (_teststr(name,"vcol")) {
- fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true);
+ fm->set_fixed_flag(SpatialMaterial::FLAG_USE_COLOR_ARRAY,true);
name=_fixstr(name,"vcol");
}*/
fm->set_name(name);
@@ -969,7 +982,7 @@ static String _make_extname(const String &p_str) {
return ext_name;
}
-void ResourceImporterScene::_make_external_resources(Node *p_node, const String &p_base_path, bool p_make_materials, bool p_make_meshes, Map<Ref<Material>, Ref<Material> > &p_materials, Map<Ref<Mesh>, Ref<Mesh> > &p_meshes) {
+void ResourceImporterScene::_make_external_resources(Node *p_node, const String &p_base_path, bool p_make_materials, bool p_keep_materials, bool p_make_meshes, Map<Ref<Material>, Ref<Material> > &p_materials, Map<Ref<ArrayMesh>, Ref<ArrayMesh> > &p_meshes) {
List<PropertyInfo> pi;
@@ -984,8 +997,8 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String
if (!p_materials.has(mat)) {
- String ext_name = p_base_path + "." + _make_extname(mat->get_name()) + ".mtl";
- if (FileAccess::exists(ext_name)) {
+ String ext_name = p_base_path.plus_file(_make_extname(mat->get_name()) + ".material");
+ if (p_keep_materials && FileAccess::exists(ext_name)) {
//if exists, use it
Ref<Material> existing = ResourceLoader::load(ext_name);
p_materials[mat] = existing;
@@ -1002,7 +1015,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String
}
} else {
- Ref<Mesh> mesh = p_node->get(E->get().name);
+ Ref<ArrayMesh> mesh = p_node->get(E->get().name);
if (mesh.is_valid()) {
@@ -1012,17 +1025,12 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String
if (!p_meshes.has(mesh)) {
- String ext_name = p_base_path + "." + _make_extname(mesh->get_name()) + ".msh";
- if (FileAccess::exists(ext_name)) {
- //if exists, use it
- Ref<Mesh> existing = ResourceLoader::load(ext_name);
- p_meshes[mesh] = existing;
- } else {
+ //meshes are always overwritten, keeping them is not practical
+ String ext_name = p_base_path.plus_file(_make_extname(mesh->get_name()) + ".mesh");
- ResourceSaver::save(ext_name, mesh, ResourceSaver::FLAG_CHANGE_PATH);
- p_meshes[mesh] = mesh;
- mesh_just_added = true;
- }
+ ResourceSaver::save(ext_name, mesh, ResourceSaver::FLAG_CHANGE_PATH);
+ p_meshes[mesh] = mesh;
+ mesh_just_added = true;
}
}
@@ -1037,7 +1045,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String
if (!p_materials.has(mat)) {
- String ext_name = p_base_path + "." + _make_extname(mat->get_name()) + ".mtl";
+ String ext_name = p_base_path + "." + _make_extname(mat->get_name()) + ".material";
if (FileAccess::exists(ext_name)) {
//if exists, use it
Ref<Material> existing = ResourceLoader::load(ext_name);
@@ -1056,7 +1064,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String
}
if (!p_make_meshes) {
- p_meshes[mesh] = Ref<Mesh>(); //save it anyway, so it won't be checked again
+ p_meshes[mesh] = Ref<ArrayMesh>(); //save it anyway, so it won't be checked again
}
}
}
@@ -1067,7 +1075,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String
for (int i = 0; i < p_node->get_child_count(); i++) {
- _make_external_resources(p_node->get_child(i), p_base_path, p_make_materials, p_make_meshes, p_materials, p_meshes);
+ _make_external_resources(p_node->get_child(i), p_base_path, p_make_materials, p_keep_materials, p_make_meshes, p_materials, p_meshes);
}
}
@@ -1087,12 +1095,19 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in
script_ext_hint += "*." + E->get();
}
+ bool materials_out = p_preset == PRESET_SEPARATE_MATERIALS || p_preset == PRESET_SEPARATE_MESHES_AND_MATERIALS || p_preset == PRESET_MULTIPLE_SCENES_AND_MATERIALS;
+ bool meshes_out = p_preset == PRESET_SEPARATE_MESHES || p_preset == PRESET_SEPARATE_MESHES_AND_MATERIALS;
+ bool scenes_out = p_preset == PRESET_MULTIPLE_SCENES || p_preset == PRESET_MULTIPLE_SCENES_AND_MATERIALS;
+
r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "nodes/custom_script", PROPERTY_HINT_FILE, script_ext_hint), ""));
- r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "materials/location", PROPERTY_HINT_ENUM, "Node,Mesh"), 0));
- r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "materials/storage", PROPERTY_HINT_ENUM, "Bult-In,Files"), 0));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "nodes/storage", PROPERTY_HINT_ENUM, "Single Scene,Instanced Sub-Scenes"), scenes_out ? 1 : 0));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "materials/location", PROPERTY_HINT_ENUM, "Node,Mesh"), meshes_out ? 1 : 0));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "materials/storage", PROPERTY_HINT_ENUM, "Built-In,Files", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), materials_out ? 1 : 0));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "materials/keep_files"), materials_out ? true : false));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "geometry/compress"), true));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "geometry/ensure_tangents"), true));
- r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "geometry/storage", PROPERTY_HINT_ENUM, "Built-In,Files"), 0));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "geometry/storage", PROPERTY_HINT_ENUM, "Built-In,Files"), meshes_out ? true : false));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "external_files/store_in_subdir"), true));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/import", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true));
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/fps", PROPERTY_HINT_RANGE, "1,120,1"), 15));
r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "animation/filter_script", PROPERTY_HINT_MULTILINE_TEXT), ""));
@@ -1110,6 +1125,18 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in
}
}
+void ResourceImporterScene::_replace_owner(Node *p_node, Node *p_scene, Node *p_new_owner) {
+
+ if (p_node != p_new_owner && p_node->get_owner() == p_scene) {
+ p_node->set_owner(p_new_owner);
+ }
+
+ for (int i = 0; i < p_node->get_child_count(); i++) {
+ Node *n = p_node->get_child(i);
+ _replace_owner(n, p_scene, p_new_owner);
+ }
+}
+
Error ResourceImporterScene::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) {
String src_path = p_source_file;
@@ -1189,7 +1216,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
float anim_optimizer_angerr = p_options["animation/optimizer/max_angular_error"];
float anim_optimizer_maxang = p_options["animation/optimizer/max_angle"];
- Map<Ref<Mesh>, Ref<Shape> > collision_map;
+ Map<Ref<ArrayMesh>, Ref<Shape> > collision_map;
scene = _fix_node(scene, scene, collision_map);
@@ -1224,11 +1251,30 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
bool external_materials = p_options["materials/storage"];
bool external_meshes = p_options["geometry/storage"];
+ bool external_scenes = int(p_options["nodes/storage"]) == 1;
+
+ String base_path = p_source_file.get_base_dir();
+
+ if (external_materials || external_meshes || external_scenes) {
+
+ if (bool(p_options["external_files/store_in_subdir"])) {
+ String subdir_name = p_source_file.get_file().get_basename();
+ DirAccess *da = DirAccess::open(base_path);
+ print_line("at path " + da->get_current_dir() + " making " + subdir_name);
+ Error err = da->make_dir(subdir_name);
+ memdelete(da);
+ ERR_FAIL_COND_V(err != OK && err != ERR_ALREADY_EXISTS, err);
+ base_path = base_path.plus_file(subdir_name);
+ }
+ }
if (external_materials || external_meshes) {
Map<Ref<Material>, Ref<Material> > mat_map;
- Map<Ref<Mesh>, Ref<Mesh> > mesh_map;
- _make_external_resources(scene, p_source_file.get_basename(), external_materials, external_meshes, mat_map, mesh_map);
+ Map<Ref<ArrayMesh>, Ref<ArrayMesh> > mesh_map;
+
+ bool keep_materials = bool(p_options["materials/keep_files"]);
+
+ _make_external_resources(scene, base_path, external_materials, keep_materials, external_meshes, mat_map, mesh_map);
}
progress.step(TTR("Running Custom Script.."), 2);
@@ -1263,10 +1309,33 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
progress.step(TTR("Saving.."), 104);
+ if (external_scenes) {
+ //save sub-scenes as instances!
+ for (int i = 0; i < scene->get_child_count(); i++) {
+ Node *child = scene->get_child(i);
+ if (child->get_owner() != scene)
+ continue; //not a real child probably created by scene type (ig, a scrollbar)
+ _replace_owner(child, scene, child);
+
+ String cn = String(child->get_name()).strip_edges().replace(".", "_").replace(":", "_");
+ if (cn == String()) {
+ cn = "ChildNode" + itos(i);
+ }
+ String path = base_path.plus_file(cn + ".scn");
+ child->set_filename(path);
+
+ Ref<PackedScene> packer = memnew(PackedScene);
+ packer->pack(child);
+ err = ResourceSaver::save(path, packer); //do not take over, let the changed files reload themselves
+ ERR_FAIL_COND_V(err != OK, err);
+ }
+ }
+
Ref<PackedScene> packer = memnew(PackedScene);
packer->pack(scene);
print_line("SAVING TO: " + p_save_path + ".scn");
err = ResourceSaver::save(p_save_path + ".scn", packer); //do not take over, let the changed files reload themselves
+ ERR_FAIL_COND_V(err != OK, err);
memdelete(scene);
diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h
index 799d458837..f404582d7e 100644
--- a/editor/import/resource_importer_scene.h
+++ b/editor/import/resource_importer_scene.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,6 +32,7 @@
#include "io/resource_import.h"
#include "scene/resources/animation.h"
+#include "scene/resources/mesh.h"
#include "scene/resources/shape.h"
class Material;
@@ -80,6 +82,17 @@ class ResourceImporterScene : public ResourceImporter {
static ResourceImporterScene *singleton;
+ enum Presets {
+ PRESET_SINGLE_SCENE,
+ PRESET_SEPARATE_MATERIALS,
+ PRESET_SEPARATE_MESHES,
+ PRESET_SEPARATE_MESHES_AND_MATERIALS,
+ PRESET_MULTIPLE_SCENES,
+ PRESET_MULTIPLE_SCENES_AND_MATERIALS,
+ };
+
+ void _replace_owner(Node *p_node, Node *p_scene, Node *p_new_owner);
+
public:
static ResourceImporterScene *get_singleton() { return singleton; }
@@ -99,9 +112,9 @@ public:
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 _make_external_resources(Node *p_node, const String &p_base_path, bool p_make_materials, bool p_make_meshes, Map<Ref<Material>, Ref<Material> > &p_materials, Map<Ref<Mesh>, Ref<Mesh> > &p_meshes);
+ void _make_external_resources(Node *p_node, const String &p_base_path, bool p_make_materials, bool p_keep_materials, bool p_make_meshes, Map<Ref<Material>, Ref<Material> > &p_materials, Map<Ref<ArrayMesh>, Ref<ArrayMesh> > &p_meshes);
- Node *_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>, Ref<Shape> > &collision_map);
+ Node *_fix_node(Node *p_node, Node *p_root, Map<Ref<ArrayMesh>, Ref<Shape> > &collision_map);
void _create_clips(Node *scene, const Array &p_clips, bool p_bake_all);
void _filter_anim_tracks(Ref<Animation> anim, Set<String> &keep);
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp
index cb419e0f4a..c0c507c2d6 100644
--- a/editor/import/resource_importer_texture.cpp
+++ b/editor/import/resource_importer_texture.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -65,6 +66,22 @@ void ResourceImporterTexture::_texture_reimport_3d(const Ref<StreamTexture> &p_t
singleton->mutex->unlock();
}
+void ResourceImporterTexture::_texture_reimport_normal(const Ref<StreamTexture> &p_tex) {
+
+ singleton->mutex->lock();
+ StringName path = p_tex->get_path();
+
+ if (!singleton->make_flags.has(path)) {
+ singleton->make_flags[path] = 0;
+ }
+
+ singleton->make_flags[path] |= MAKE_NORMAL_FLAG;
+
+ print_line("requesting normalfor " + String(path));
+
+ singleton->mutex->unlock();
+}
+
void ResourceImporterTexture::update_imports() {
if (EditorFileSystem::get_singleton()->is_scanning() || EditorFileSystem::get_singleton()->is_importing()) {
@@ -95,6 +112,11 @@ void ResourceImporterTexture::update_imports() {
changed = true;
}
+ if (E->get() & MAKE_NORMAL_FLAG && int(cf->get_value("params", "compress/normal_map")) == 0) {
+ cf->set_value("params", "compress/normal_map", 1);
+ changed = true;
+ }
+
if (E->get() & MAKE_3D_FLAG && bool(cf->get_value("params", "detect_3d"))) {
cf->set_value("params", "detect_3d", false);
cf->set_value("params", "compress/mode", 2);
@@ -143,8 +165,12 @@ String ResourceImporterTexture::get_resource_type() const {
bool ResourceImporterTexture::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const {
- if (p_option == "compress/lossy_quality" && int(p_options["compress/mode"]) != COMPRESS_LOSSY)
- return false;
+ if (p_option == "compress/lossy_quality") {
+ int compress_mode = int(p_options["compress/mode"]);
+ if (compress_mode != COMPRESS_LOSSY && compress_mode != COMPRESS_VIDEO_RAM) {
+ return false;
+ }
+ }
return true;
}
@@ -168,28 +194,32 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options,
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/mode", PROPERTY_HINT_ENUM, "Lossless,Lossy,Video RAM,Uncompressed", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), p_preset == PRESET_3D ? 2 : 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "compress/lossy_quality", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.7));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/hdr_mode", PROPERTY_HINT_ENUM, "Compress,Force RGBE"), 0));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/normal_map", PROPERTY_HINT_ENUM, "Detect,Enable,Disabled"), 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "flags/repeat", PROPERTY_HINT_ENUM, "Disabled,Enabled,Mirrored"), p_preset == PRESET_3D ? 1 : 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "flags/filter"), p_preset == PRESET_2D_PIXEL ? false : true));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "flags/mipmaps"), p_preset == PRESET_3D ? true : false));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "flags/anisotropic"), false));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "flags/srgb", PROPERTY_HINT_ENUM, "Disable,Enable,Detect"), 2));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/fix_alpha_border"), p_preset != PRESET_3D ? true : false));
- r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/premult_alpha"), true));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/premult_alpha"), false));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/HDR_as_SRGB"), false));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "stream"), false));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "size_limit", PROPERTY_HINT_RANGE, "0,4096,1"), 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "detect_3d"), p_preset == PRESET_DETECT));
}
-void ResourceImporterTexture::_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) {
+void ResourceImporterTexture::_save_stex(const Ref<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, bool p_force_rgbe, bool p_detect_normal, bool p_force_normal) {
+ print_line("saving: " + p_to_path);
FileAccess *f = FileAccess::open(p_to_path, FileAccess::WRITE);
f->store_8('G');
f->store_8('D');
f->store_8('S');
f->store_8('T'); //godot streamable texture
- f->store_32(p_image.get_width());
- f->store_32(p_image.get_height());
+ f->store_32(p_image->get_width());
+ f->store_32(p_image->get_height());
f->store_32(p_texture_flags);
uint32_t format = 0;
@@ -202,18 +232,24 @@ void ResourceImporterTexture::_save_stex(const Image &p_image, const String &p_t
format |= StreamTexture::FORMAT_BIT_DETECT_3D;
if (p_detect_srgb)
format |= StreamTexture::FORMAT_BIT_DETECT_SRGB;
+ if (p_detect_normal)
+ format |= StreamTexture::FORMAT_BIT_DETECT_NORMAL;
+
+ if ((p_compress_mode == COMPRESS_LOSSLESS || p_compress_mode == COMPRESS_LOSSY) && p_image->get_format() > Image::FORMAT_RGBA8) {
+ p_compress_mode = COMPRESS_UNCOMPRESSED; //these can't go as lossy
+ }
switch (p_compress_mode) {
case COMPRESS_LOSSLESS: {
- Image image = p_image;
+ Ref<Image> image = p_image->duplicate();
if (p_mipmaps) {
- image.generate_mipmaps();
+ image->generate_mipmaps();
} else {
- image.clear_mipmaps();
+ image->clear_mipmaps();
}
- int mmc = image.get_mipmap_count() + 1;
+ int mmc = image->get_mipmap_count() + 1;
format |= StreamTexture::FORMAT_BIT_LOSSLESS;
f->store_32(format);
@@ -222,7 +258,7 @@ void ResourceImporterTexture::_save_stex(const Image &p_image, const String &p_t
for (int i = 0; i < mmc; i++) {
if (i > 0) {
- image.shrink_x2();
+ image->shrink_x2();
}
PoolVector<uint8_t> data = Image::lossless_packer(image);
@@ -235,14 +271,14 @@ void ResourceImporterTexture::_save_stex(const Image &p_image, const String &p_t
} break;
case COMPRESS_LOSSY: {
- Image image = p_image;
+ Ref<Image> image = p_image->duplicate();
if (p_mipmaps) {
- image.generate_mipmaps();
+ image->generate_mipmaps();
} else {
- image.clear_mipmaps();
+ image->clear_mipmaps();
}
- int mmc = image.get_mipmap_count() + 1;
+ int mmc = image->get_mipmap_count() + 1;
format |= StreamTexture::FORMAT_BIT_LOSSY;
f->store_32(format);
@@ -251,7 +287,7 @@ void ResourceImporterTexture::_save_stex(const Image &p_image, const String &p_t
for (int i = 0; i < mmc; i++) {
if (i > 0) {
- image.shrink_x2();
+ image->shrink_x2();
}
PoolVector<uint8_t> data = Image::lossy_packer(image, p_lossy_quality);
@@ -264,33 +300,44 @@ void ResourceImporterTexture::_save_stex(const Image &p_image, const String &p_t
} break;
case COMPRESS_VIDEO_RAM: {
- Image image = p_image;
- image.generate_mipmaps();
- image.compress(p_vram_compression);
+ Ref<Image> image = p_image->duplicate();
+ image->generate_mipmaps();
- format |= image.get_format();
+ if (p_force_rgbe && image->get_format() >= Image::FORMAT_R8 && image->get_format() <= Image::FORMAT_RGBE9995) {
+ image->convert(Image::FORMAT_RGBE9995);
+ } else {
+ Image::CompressSource csource = Image::COMPRESS_SOURCE_GENERIC;
+ if (p_force_normal) {
+ csource = Image::COMPRESS_SOURCE_NORMAL;
+ } else if (p_texture_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) {
+ csource = Image::COMPRESS_SOURCE_SRGB;
+ }
+
+ image->compress(p_vram_compression, csource, p_lossy_quality);
+ }
+
+ format |= image->get_format();
f->store_32(format);
- PoolVector<uint8_t> data = image.get_data();
+ PoolVector<uint8_t> data = image->get_data();
int dl = data.size();
PoolVector<uint8_t>::Read r = data.read();
f->store_buffer(r.ptr(), dl);
-
} break;
case COMPRESS_UNCOMPRESSED: {
- Image image = p_image;
+ Ref<Image> image = p_image->duplicate();
if (p_mipmaps) {
- image.generate_mipmaps();
+ image->generate_mipmaps();
} else {
- image.clear_mipmaps();
+ image->clear_mipmaps();
}
- format |= image.get_format();
+ format |= image->get_format();
f->store_32(format);
- PoolVector<uint8_t> data = image.get_data();
+ PoolVector<uint8_t> data = image->get_data();
int dl = data.size();
PoolVector<uint8_t>::Read r = data.read();
@@ -315,9 +362,13 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
bool premult_alpha = p_options["process/premult_alpha"];
bool stream = p_options["stream"];
int size_limit = p_options["size_limit"];
+ bool force_rgbe = int(p_options["compress/hdr_mode"]) == 1;
+ bool hdr_as_srgb = p_options["process/HDR_as_SRGB"];
+ int normal = p_options["compress/normal_map"];
- Image image;
- Error err = ImageLoader::load_image(p_source_file, &image);
+ Ref<Image> image;
+ image.instance();
+ Error err = ImageLoader::load_image(p_source_file, image, NULL, hdr_as_srgb);
if (err != OK)
return err;
@@ -335,46 +386,64 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
if (srgb == 1)
tex_flags |= Texture::FLAG_CONVERT_TO_LINEAR;
- if (size_limit > 0 && (image.get_width() > size_limit || image.get_height() > size_limit)) {
+ if (size_limit > 0 && (image->get_width() > size_limit || image->get_height() > size_limit)) {
//limit size
- if (image.get_width() >= image.get_height()) {
+ if (image->get_width() >= image->get_height()) {
int new_width = size_limit;
- int new_height = image.get_height() * new_width / image.get_width();
+ int new_height = image->get_height() * new_width / image->get_width();
- image.resize(new_width, new_height, Image::INTERPOLATE_CUBIC);
+ image->resize(new_width, new_height, Image::INTERPOLATE_CUBIC);
} else {
int new_height = size_limit;
- int new_width = image.get_width() * new_height / image.get_height();
+ int new_width = image->get_width() * new_height / image->get_height();
- image.resize(new_width, new_height, Image::INTERPOLATE_CUBIC);
+ image->resize(new_width, new_height, Image::INTERPOLATE_CUBIC);
}
}
if (fix_alpha_border) {
- image.fix_alpha_edges();
+ image->fix_alpha_edges();
}
if (premult_alpha) {
- image.premultiply_alpha();
+ image->premultiply_alpha();
}
bool detect_3d = p_options["detect_3d"];
bool detect_srgb = srgb == 2;
+ bool detect_normal = normal == 0;
+ bool force_normal = normal == 1;
if (compress_mode == COMPRESS_VIDEO_RAM) {
- //must import in all formats
+ //must import in all formats, in order of priority (so platform choses the best supported one. IE, etc2 over etc).
//Android, GLES 2.x
- _save_stex(image, p_save_path + ".etc.stex", compress_mode, lossy, Image::COMPRESS_ETC, mipmaps, tex_flags, stream, detect_3d, detect_srgb);
- r_platform_variants->push_back("etc");
- //_save_stex(image,p_save_path+".etc2.stex",compress_mode,lossy,Image::COMPRESS_ETC2,mipmaps,tex_flags,stream);
- //r_platform_variants->push_back("etc2");
- _save_stex(image, p_save_path + ".s3tc.stex", compress_mode, lossy, Image::COMPRESS_S3TC, mipmaps, tex_flags, stream, detect_3d, detect_srgb);
- r_platform_variants->push_back("s3tc");
+ if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_s3tc")) {
+
+ _save_stex(image, p_save_path + ".s3tc.stex", compress_mode, lossy, Image::COMPRESS_S3TC, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal);
+ r_platform_variants->push_back("s3tc");
+ }
+
+ if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc2")) {
+
+ _save_stex(image, p_save_path + ".etc2.stex", compress_mode, lossy, Image::COMPRESS_ETC2, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal);
+ r_platform_variants->push_back("etc2");
+ }
+
+ if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc")) {
+ _save_stex(image, p_save_path + ".etc.stex", compress_mode, lossy, Image::COMPRESS_ETC, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal);
+ r_platform_variants->push_back("etc");
+ }
+
+ if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_pvrtc")) {
+
+ _save_stex(image, p_save_path + ".pvrtc.stex", compress_mode, lossy, Image::COMPRESS_PVRTC4, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal);
+ r_platform_variants->push_back("pvrtc");
+ }
} else {
//import normally
- _save_stex(image, p_save_path + ".stex", compress_mode, lossy, Image::COMPRESS_16BIT /*this is ignored */, mipmaps, tex_flags, stream, detect_3d, detect_srgb);
+ _save_stex(image, p_save_path + ".stex", compress_mode, lossy, Image::COMPRESS_S3TC /*this is ignored */, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal);
}
return OK;
@@ -387,6 +456,7 @@ ResourceImporterTexture::ResourceImporterTexture() {
singleton = this;
StreamTexture::request_3d_callback = _texture_reimport_3d;
StreamTexture::request_srgb_callback = _texture_reimport_srgb;
+ StreamTexture::request_normal_callback = _texture_reimport_normal;
mutex = Mutex::create();
}
diff --git a/editor/import/resource_importer_texture.h b/editor/import/resource_importer_texture.h
index 9be016884d..31bd0f29b0 100644
--- a/editor/import/resource_importer_texture.h
+++ b/editor/import/resource_importer_texture.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,9 @@
#ifndef RESOURCEIMPORTTEXTURE_H
#define RESOURCEIMPORTTEXTURE_H
+#include "image.h"
#include "io/resource_import.h"
+
class StreamTexture;
class ResourceImporterTexture : public ResourceImporter {
@@ -38,7 +41,8 @@ class ResourceImporterTexture : public ResourceImporter {
protected:
enum {
MAKE_3D_FLAG = 1,
- MAKE_SRGB_FLAG = 2
+ MAKE_SRGB_FLAG = 2,
+ MAKE_NORMAL_FLAG = 4
};
Mutex *mutex;
@@ -46,6 +50,7 @@ protected:
static void _texture_reimport_srgb(const Ref<StreamTexture> &p_tex);
static void _texture_reimport_3d(const Ref<StreamTexture> &p_tex);
+ static void _texture_reimport_normal(const Ref<StreamTexture> &p_tex);
static ResourceImporterTexture *singleton;
@@ -77,7 +82,7 @@ public:
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);
+ void _save_stex(const Ref<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, bool p_force_rgbe, bool p_detect_normal, bool p_force_normal);
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);
diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp
index 751fd36414..07f1f4dd9f 100644
--- a/editor/import/resource_importer_wav.cpp
+++ b/editor/import/resource_importer_wav.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -47,7 +48,7 @@ void ResourceImporterWAV::get_recognized_extensions(List<String> *p_extensions)
p_extensions->push_back("wav");
}
String ResourceImporterWAV::get_save_extension() const {
- return "smp";
+ return "sample";
}
String ResourceImporterWAV::get_resource_type() const {
@@ -122,6 +123,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
int format_channels = 0;
AudioStreamSample::LoopMode loop = AudioStreamSample::LOOP_DISABLED;
+ uint16_t compression_code = 1;
bool format_found = false;
bool data_found = false;
int format_freq = 0;
@@ -150,9 +152,10 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
if (chunkID[0] == 'f' && chunkID[1] == 'm' && chunkID[2] == 't' && chunkID[3] == ' ' && !format_found) {
/* IS FORMAT CHUNK */
- uint16_t compression_code = file->get_16();
-
- if (compression_code != 1) {
+ //Issue: #7755 : Not a bug - usage of other formats (format codes) are unsupported in current importer version.
+ //Consider revision for engine version 3.0
+ compression_code = file->get_16();
+ if (compression_code != 1 && compression_code != 3) {
ERR_PRINT("Format not supported for WAVE file (not PCM). Save WAVE files as uncompressed PCM instead.");
break;
}
@@ -207,33 +210,37 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
data.resize(frames * format_channels);
- for (int i = 0; i < frames; i++) {
-
- for (int c = 0; c < format_channels; c++) {
-
- if (format_bits == 8) {
- // 8 bit samples are UNSIGNED
+ if (format_bits == 8) {
+ for (int i = 0; i < frames * format_channels; i++) {
+ // 8 bit samples are UNSIGNED
- uint8_t s = file->get_8();
- s -= 128;
- int8_t *sp = (int8_t *)&s;
-
- data[i * format_channels + c] = float(*sp) / 128.0;
+ data[i] = int8_t(file->get_8() - 128) / 128.f;
+ }
+ } else if (format_bits == 32 && compression_code == 3) {
+ for (int i = 0; i < frames * format_channels; i++) {
+ //32 bit IEEE Float
- } else {
- //16+ bits samples are SIGNED
- // if sample is > 16 bits, just read extra bytes
+ data[i] = file->get_float();
+ }
+ } else if (format_bits == 16) {
+ for (int i = 0; i < frames * format_channels; i++) {
+ //16 bit SIGNED
- uint32_t s = 0;
- for (int b = 0; b < (format_bits >> 3); b++) {
+ data[i] = int16_t(file->get_16()) / 32768.f;
+ }
+ } else {
+ for (int i = 0; i < frames * format_channels; i++) {
+ //16+ bits samples are SIGNED
+ // if sample is > 16 bits, just read extra bytes
- s |= ((uint32_t)file->get_8()) << (b * 8);
- }
- s <<= (32 - format_bits);
- int32_t ss = s;
+ uint32_t s = 0;
+ for (int b = 0; b < (format_bits >> 3); b++) {
- data[i * format_channels + c] = (ss >> 16) / 32768.0;
+ s |= ((uint32_t)file->get_8()) << (b * 8);
}
+ s <<= (32 - format_bits);
+
+ data[i] = (int32_t(s) >> 16) / 32768.f;
}
}
@@ -248,6 +255,15 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
if (chunkID[0] == 's' && chunkID[1] == 'm' && chunkID[2] == 'p' && chunkID[3] == 'l') {
//loop point info!
+ /**
+ * Consider exploring next document:
+ * http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/RIFFNEW.pdf
+ * Especially on page:
+ * 16 - 17
+ * Timestamp:
+ * 22:38 06.07.2017 GMT
+ **/
+
for (int i = 0; i < 10; i++)
file->get_32(); // i wish to know why should i do this... no doc!
@@ -279,7 +295,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
bool limit_rate = p_options["force/max_rate"];
int limit_rate_hz = p_options["force/max_rate_hz"];
- if (limit_rate && rate > limit_rate_hz) {
+ if (limit_rate && rate > limit_rate_hz && rate > 0 && frames > 0) {
//resampleeee!!!
int new_data_frames = frames * limit_rate_hz / rate;
Vector<float> new_data;
@@ -344,7 +360,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
bool trim = p_options["edit/trim"];
- if (trim && !loop) {
+ if (trim && !loop && format_channels > 0) {
int first = 0;
int last = (frames * format_channels) - 1;
@@ -484,7 +500,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
sample->set_loop_end(loop_end);
sample->set_stereo(format_channels == 2);
- ResourceSaver::save(p_save_path + ".smp", sample);
+ ResourceSaver::save(p_save_path + ".sample", sample);
return OK;
}
diff --git a/editor/import/resource_importer_wav.h b/editor/import/resource_importer_wav.h
index b78ab1e7bf..6b4f86e641 100644
--- a/editor/import/resource_importer_wav.h
+++ b/editor/import/resource_importer_wav.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp
index d245450114..a4f744aa84 100644
--- a/editor/import_dock.cpp
+++ b/editor/import_dock.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -133,6 +134,14 @@ void ImportDock::set_edit_path(const String &p_path) {
}
}
+ preset->get_popup()->add_separator();
+ preset->get_popup()->add_item(vformat(TTR("Set as Default for '%s'"), params->importer->get_visible_name()), ITEM_SET_AS_DEFAULT);
+ if (ProjectSettings::get_singleton()->has("importer_defaults/" + params->importer->get_importer_name())) {
+ preset->get_popup()->add_item(TTR("Load Default"), ITEM_LOAD_DEFAULT);
+ preset->get_popup()->add_separator();
+ preset->get_popup()->add_item(vformat(TTR("Clear Default for '%s'"), params->importer->get_visible_name()), ITEM_CLEAR_DEFAULT);
+ }
+
params->paths.clear();
params->paths.push_back(p_path);
import->set_disabled(false);
@@ -255,17 +264,56 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) {
void ImportDock::_preset_selected(int p_idx) {
- print_line("preset selected? " + p_idx);
- List<ResourceImporter::ImportOption> options;
+ switch (p_idx) {
+ case ITEM_SET_AS_DEFAULT: {
+ List<ResourceImporter::ImportOption> options;
- params->importer->get_import_options(&options, p_idx);
+ params->importer->get_import_options(&options, p_idx);
- for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
+ Dictionary d;
+ for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
- params->values[E->get().option.name] = E->get().default_value;
- }
+ d[E->get().option.name] = E->get().default_value;
+ }
- params->update();
+ ProjectSettings::get_singleton()->set("importer_defaults/" + params->importer->get_importer_name(), d);
+ ProjectSettings::get_singleton()->save();
+
+ } break;
+ case ITEM_LOAD_DEFAULT: {
+
+ ERR_FAIL_COND(!ProjectSettings::get_singleton()->has("importer_defaults/" + params->importer->get_importer_name()));
+
+ Dictionary d = ProjectSettings::get_singleton()->get("importer_defaults/" + params->importer->get_importer_name());
+ List<Variant> v;
+ d.get_key_list(&v);
+
+ for (List<Variant>::Element *E = v.front(); E; E = E->next()) {
+ params->values[E->get()] = d[E->get()];
+ }
+ params->update();
+
+ } break;
+ case ITEM_CLEAR_DEFAULT: {
+
+ ProjectSettings::get_singleton()->set("importer_defaults/" + params->importer->get_importer_name(), Variant());
+ ProjectSettings::get_singleton()->save();
+
+ } break;
+ default: {
+
+ List<ResourceImporter::ImportOption> options;
+
+ params->importer->get_import_options(&options, p_idx);
+
+ for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
+
+ params->values[E->get().option.name] = E->get().default_value;
+ }
+
+ params->update();
+ } break;
+ }
}
void ImportDock::clear() {
@@ -308,6 +356,13 @@ void ImportDock::_bind_methods() {
ClassDB::bind_method(D_METHOD("_preset_selected"), &ImportDock::_preset_selected);
}
+void ImportDock::initialize_import_options() const {
+
+ ERR_FAIL_COND(!import_opts || !params);
+
+ import_opts->edit(params);
+}
+
ImportDock::ImportDock() {
imported = memnew(LineEdit);
@@ -327,7 +382,6 @@ ImportDock::ImportDock() {
add_child(import_opts);
import_opts->set_v_size_flags(SIZE_EXPAND_FILL);
import_opts->hide_top_label();
- import_opts->set_hide_script(true);
hb = memnew(HBoxContainer);
add_child(hb);
@@ -339,7 +393,6 @@ ImportDock::ImportDock() {
hb->add_spacer();
params = memnew(ImportDockParameters);
- import_opts->edit(params);
}
ImportDock::~ImportDock() {
diff --git a/editor/import_dock.h b/editor/import_dock.h
index 2c78b922eb..4844fc07ea 100644
--- a/editor/import_dock.h
+++ b/editor/import_dock.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -56,12 +57,19 @@ class ImportDock : public VBoxContainer {
void _reimport();
+ enum {
+ ITEM_SET_AS_DEFAULT = 100,
+ ITEM_LOAD_DEFAULT,
+ ITEM_CLEAR_DEFAULT,
+ };
+
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 initialize_import_options() const;
void clear();
ImportDock();
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index 253f9bcc01..a644558521 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/inspector_dock.h b/editor/inspector_dock.h
index 83a7e5f54b..cee18f2d49 100644
--- a/editor/inspector_dock.h
+++ b/editor/inspector_dock.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_atlas.cpp b/editor/io_plugins/editor_atlas.cpp
index 4be22c34c7..42800ee80d 100644
--- a/editor/io_plugins/editor_atlas.cpp
+++ b/editor/io_plugins/editor_atlas.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_atlas.h b/editor/io_plugins/editor_atlas.h
index 1fb8a8ed4e..206897c8e5 100644
--- a/editor/io_plugins/editor_atlas.h
+++ b/editor/io_plugins/editor_atlas.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_bitmask_import_plugin.cpp b/editor/io_plugins/editor_bitmask_import_plugin.cpp
index bccf6c262f..e508dc0a9d 100644
--- a/editor/io_plugins/editor_bitmask_import_plugin.cpp
+++ b/editor/io_plugins/editor_bitmask_import_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_bitmask_import_plugin.h b/editor/io_plugins/editor_bitmask_import_plugin.h
index d1618d7843..b31ee9c86a 100644
--- a/editor/io_plugins/editor_bitmask_import_plugin.h
+++ b/editor/io_plugins/editor_bitmask_import_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_export_scene.cpp b/editor/io_plugins/editor_export_scene.cpp
index e6066b9075..6392b4a715 100644
--- a/editor/io_plugins/editor_export_scene.cpp
+++ b/editor/io_plugins/editor_export_scene.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,11 +30,11 @@
#include "editor_export_scene.h"
#if 0
#include "editor/editor_settings.h"
-#include "global_config.h"
#include "io/resource_loader.h"
#include "io/resource_saver.h"
#include "os/dir_access.h"
#include "os/file_access.h"
+#include "project_settings.h"
#include "scene/resources/packed_scene.h"
Vector<uint8_t> EditorSceneExportPlugin::custom_export(String& p_path,const Ref<EditorExportPlatform> &p_platform) {
@@ -62,7 +63,7 @@ Vector<uint8_t> EditorSceneExportPlugin::custom_export(String& p_path,const Ref<
uint64_t sd=0;
String smd5;
- String gp = GlobalConfig::get_singleton()->globalize_path(p_path);
+ String gp = ProjectSettings::get_singleton()->globalize_path(p_path);
String md5=gp.md5_text();
String tmp_path = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/");
diff --git a/editor/io_plugins/editor_export_scene.h b/editor/io_plugins/editor_export_scene.h
index ac425fbedd..d8fe21adfc 100644
--- a/editor/io_plugins/editor_export_scene.h
+++ b/editor/io_plugins/editor_export_scene.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_font_import_plugin.cpp b/editor/io_plugins/editor_font_import_plugin.cpp
index 2898d85de9..9831e08cf1 100644
--- a/editor/io_plugins/editor_font_import_plugin.cpp
+++ b/editor/io_plugins/editor_font_import_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -532,16 +533,16 @@ class EditorFontImportDialog : public ConfirmationDialog {
return;
}
- if (dest->get_line_edit()->get_text().get_file()==".fnt") {
- dest->get_line_edit()->set_text(dest->get_line_edit()->get_text().get_base_dir() + "/" + source->get_line_edit()->get_text().get_file().get_basename() + ".fnt" );
+ if (dest->get_line_edit()->get_text().get_file()==".font") {
+ dest->get_line_edit()->set_text(dest->get_line_edit()->get_text().get_base_dir() + "/" + source->get_line_edit()->get_text().get_file().get_basename() + ".font" );
}
if (dest->get_line_edit()->get_text().get_extension() == dest->get_line_edit()->get_text()) {
- dest->get_line_edit()->set_text(dest->get_line_edit()->get_text() + ".fnt");
+ dest->get_line_edit()->set_text(dest->get_line_edit()->get_text() + ".font");
}
- if (dest->get_line_edit()->get_text().get_extension().to_lower() != "fnt") {
- error_dialog->set_text(TTR("Invalid file extension.\nPlease use .fnt."));
+ if (dest->get_line_edit()->get_text().get_extension().to_lower() != "font") {
+ error_dialog->set_text(TTR("Invalid file extension.\nPlease use .font."));
error_dialog->popup_centered(Size2(200,100));
return;
}
@@ -664,7 +665,7 @@ public:
//
List<String> fl;
Ref<BitmapFont> font= memnew(BitmapFont);
- dest->get_file_dialog()->add_filter("*.fnt ; Font" );
+ dest->get_file_dialog()->add_filter("*.font ; Font" );
/*
ResourceSaver::get_recognized_extensions(font,&fl);
for(List<String>::Element *E=fl.front();E;E=E->next()) {
@@ -1689,7 +1690,7 @@ void EditorFontImportPlugin::import_from_drop(const Vector<String>& p_drop, cons
if (ext=="ttf" || ext=="otf" || ext=="fnt") {
import_dialog();
- dialog->set_source_and_dest(p_drop[i],p_dest_path.plus_file(file.get_basename()+".fnt"));
+ dialog->set_source_and_dest(p_drop[i],p_dest_path.plus_file(file.get_basename()+".font"));
break;
}
}
diff --git a/editor/io_plugins/editor_font_import_plugin.h b/editor/io_plugins/editor_font_import_plugin.h
index 315a80e8cd..d204b8ea97 100644
--- a/editor/io_plugins/editor_font_import_plugin.h
+++ b/editor/io_plugins/editor_font_import_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_mesh_import_plugin.cpp b/editor/io_plugins/editor_mesh_import_plugin.cpp
index f4d0868d16..0c9f3a3f37 100644
--- a/editor/io_plugins/editor_mesh_import_plugin.cpp
+++ b/editor/io_plugins/editor_mesh_import_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -261,7 +262,7 @@ public:
imd->add_source(EditorImportPlugin::validate_source_path(meshes[i]));
- String file_path = dst.plus_file(meshes[i].get_file().get_basename()+".msh");
+ String file_path = dst.plus_file(meshes[i].get_file().get_basename()+".mesh");
plugin->import(file_path,imd);
}
diff --git a/editor/io_plugins/editor_mesh_import_plugin.h b/editor/io_plugins/editor_mesh_import_plugin.h
index df374549d4..06fdc4195e 100644
--- a/editor/io_plugins/editor_mesh_import_plugin.h
+++ b/editor/io_plugins/editor_mesh_import_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_sample_import_plugin.cpp b/editor/io_plugins/editor_sample_import_plugin.cpp
index a21d41d8c8..0909b96cdc 100644
--- a/editor/io_plugins/editor_sample_import_plugin.cpp
+++ b/editor/io_plugins/editor_sample_import_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -298,7 +299,7 @@ public:
error_dialog->popup_centered(Size2(200,100)*EDSCALE);
}
- dst = dst.plus_file(samples[i].get_file().get_basename()+".smp");
+ dst = dst.plus_file(samples[i].get_file().get_basename()+".sample");
plugin->import(dst,imd);
}
@@ -909,13 +910,13 @@ Vector<uint8_t> EditorSampleExportPlugin::custom_export(String& p_path,const Ref
imd->set_option("edit/loop",false);
imd->set_option("compress/mode",1);
- String savepath = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/smpconv.smp");
+ String savepath = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/smpconv.sample");
Error err = EditorSampleImportPlugin::singleton->import(savepath,imd);
ERR_FAIL_COND_V(err!=OK,Vector<uint8_t>());
- p_path=p_path.get_basename()+".converted.smp";
+ p_path=p_path.get_basename()+".converted.sample";
return FileAccess::get_file_as_array(savepath);
}
diff --git a/editor/io_plugins/editor_sample_import_plugin.h b/editor/io_plugins/editor_sample_import_plugin.h
index 6085043a83..134868f8c2 100644
--- a/editor/io_plugins/editor_sample_import_plugin.h
+++ b/editor/io_plugins/editor_sample_import_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_scene_import_plugin.cpp b/editor/io_plugins/editor_scene_import_plugin.cpp
index 52a554f6d1..1890ca906a 100644
--- a/editor/io_plugins/editor_scene_import_plugin.cpp
+++ b/editor/io_plugins/editor_scene_import_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,10 +31,10 @@
#if 0
#include "editor/create_dialog.h"
#include "editor/editor_node.h"
-#include "global_config.h"
#include "io/resource_saver.h"
#include "os/file_access.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/3d/body_shape.h"
#include "scene/3d/mesh_instance.h"
#include "scene/3d/navigation.h"
@@ -671,9 +672,9 @@ void EditorSceneImportDialog::_choose_save_file(const String& p_path) {
void EditorSceneImportDialog::_choose_script(const String& p_path) {
- String p = GlobalConfig::get_singleton()->localize_path(p_path);
+ String p = ProjectSettings::get_singleton()->localize_path(p_path);
if (!p.is_resource_file())
- p=GlobalConfig::get_singleton()->get_resource_path().path_to(p_path.get_base_dir())+p_path.get_file();
+ p=ProjectSettings::get_singleton()->get_resource_path().path_to(p_path.get_base_dir())+p_path.get_file();
script_path->set_text(p);
}
@@ -726,7 +727,7 @@ void EditorSceneImportDialog::_import(bool p_and_open) {
if (texture_action->get_selected()==0)
dst_path=save_path->get_text();//.get_base_dir();
else
- dst_path=GlobalConfig::get_singleton()->get("import/shared_textures");
+ dst_path=ProjectSettings::get_singleton()->get("import/shared_textures");
uint32_t flags=0;
@@ -1092,7 +1093,7 @@ const EditorSceneImportDialog::FlagInfo EditorSceneImportDialog::scene_flag_name
{EditorSceneImportPlugin::SCENE_FLAG_MERGE_KEEP_EXTRA_ANIM_TRACKS,("Merge"),"Keep user-added Animation tracks.",true},
{EditorSceneImportPlugin::SCENE_FLAG_DETECT_ALPHA,("Materials"),"Set Alpha in Materials (-alpha)",true},
{EditorSceneImportPlugin::SCENE_FLAG_DETECT_VCOLOR,("Materials"),"Set Vert. Color in Materials (-vcol)",true},
- {EditorSceneImportPlugin::SCENE_FLAG_CREATE_COLLISIONS,("Create"),"Create Collisions and/or Rigid Bodies (-col,-colonly,-rigid)",true},
+ {EditorSceneImportPlugin::SCENE_FLAG_CREATE_COLLISIONS,("Create"),"Create Collisions and/or Rigid Bodies (-col,-colonly,-rigid,-rigidonly)",true},
{EditorSceneImportPlugin::SCENE_FLAG_CREATE_PORTALS,("Create"),"Create Portals (-portal)",true},
{EditorSceneImportPlugin::SCENE_FLAG_CREATE_ROOMS,("Create"),"Create Rooms (-room)",true},
{EditorSceneImportPlugin::SCENE_FLAG_SIMPLIFY_ROOMS,("Create"),"Simplify Rooms",false},
@@ -1276,7 +1277,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce
set_hide_on_ok(false);
GLOBAL_DEF("import/shared_textures","res://");
- GlobalConfig::get_singleton()->set_custom_property_info("import/shared_textures",PropertyInfo(Variant::STRING,"import/shared_textures",PROPERTY_HINT_DIR));
+ ProjectSettings::get_singleton()->set_custom_property_info("import/shared_textures",PropertyInfo(Variant::STRING,"import/shared_textures",PROPERTY_HINT_DIR));
import_hb->add_constant_override("separation",30);
@@ -1306,7 +1307,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce
//confirm_import->set_child_rect(cvb);
PanelContainer *pc = memnew( PanelContainer );
- pc->add_style_override("panel",get_stylebox("normal","TextEdit"));
+ pc->add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("normal","TextEdit"));
//ec->add_child(pc);
missing_files = memnew( RichTextLabel );
cvb->add_margin_child(TTR("The Following Files are Missing:"),pc,true);
@@ -1408,7 +1409,7 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag
for(List<PropertyInfo>::Element *E=pl.front();E;E=E->next()) {
if (E->get().type==Variant::OBJECT || E->get().type==Variant::ARRAY || E->get().type==Variant::DICTIONARY) {
- if (E->get().type==Variant::OBJECT && res->cast_to<FixedSpatialMaterial>() && (E->get().name=="textures/diffuse" || E->get().name=="textures/detail" || E->get().name=="textures/emission")) {
+ if (E->get().type==Variant::OBJECT && res->cast_to<SpatialMaterial>() && (E->get().name=="textures/diffuse" || E->get().name=="textures/detail" || E->get().name=="textures/emission")) {
Ref<ImageTexture> tex =res->get(E->get().name);
if (tex.is_valid()) {
@@ -1416,7 +1417,7 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag
image_map.insert(tex,TEXTURE_ROLE_DIFFUSE);
}
- } else if (E->get().type==Variant::OBJECT && res->cast_to<FixedSpatialMaterial>() && (E->get().name=="textures/normal")) {
+ } else if (E->get().type==Variant::OBJECT && res->cast_to<SpatialMaterial>() && (E->get().name=="textures/normal")) {
Ref<ImageTexture> tex =res->get(E->get().name);
if (tex.is_valid()) {
@@ -1424,7 +1425,7 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag
image_map.insert(tex,TEXTURE_ROLE_NORMALMAP);
/*
if (p_flags&SCENE_FLAG_CONVERT_NORMALMAPS_TO_XY)
- res->cast_to<FixedSpatialMaterial>()->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_XY_NORMALMAP,true);
+ res->cast_to<SpatialMaterial>()->set_fixed_flag(SpatialMaterial::FLAG_USE_XY_NORMALMAP,true);
*/
}
@@ -1532,12 +1533,12 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
Ref<Mesh> m = mi->get_mesh();
for(int i=0;i<m->get_surface_count();i++) {
- Ref<FixedSpatialMaterial> fm = m->surface_get_material(i);
+ Ref<SpatialMaterial> fm = m->surface_get_material(i);
if (fm.is_valid()) {
//fm->set_flag(Material::FLAG_UNSHADED,true);
//fm->set_flag(Material::FLAG_DOUBLE_SIDED,true);
//fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
+ //fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true);
}
}
}
@@ -1555,18 +1556,18 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
for(int i=0;i<m->get_surface_count();i++) {
- Ref<FixedSpatialMaterial> mat = m->surface_get_material(i);
+ Ref<SpatialMaterial> mat = m->surface_get_material(i);
if (!mat.is_valid())
continue;
if (p_flags&SCENE_FLAG_DETECT_ALPHA && _teststr(mat->get_name(),"alpha")) {
- //mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
+ //mat->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true);
//mat->set_name(_fixstr(mat->get_name(),"alpha"));
}
if (p_flags&SCENE_FLAG_DETECT_VCOLOR && _teststr(mat->get_name(),"vcol")) {
- //mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true);
+ //mat->set_fixed_flag(SpatialMaterial::FLAG_USE_COLOR_ARRAY,true);
//mat->set_name(_fixstr(mat->get_name(),"vcol"));
}
@@ -1641,12 +1642,12 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
Ref<Mesh> m = mi->get_mesh();
for(int i=0;i<m->get_surface_count();i++) {
- Ref<FixedSpatialMaterial> fm = m->surface_get_material(i);
+ Ref<SpatialMaterial> fm = m->surface_get_material(i);
if (fm.is_valid()) {
//fm->set_flag(Material::FLAG_UNSHADED,true);
//fm->set_flag(Material::FLAG_DOUBLE_SIDED,true);
//fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
+ //fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true);
}
}
}
@@ -1689,12 +1690,12 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
Ref<Mesh> m = mi->get_mesh();
for(int i=0;i<m->get_surface_count();i++) {
- Ref<FixedSpatialMaterial> fm = m->surface_get_material(i);
+ Ref<SpatialMaterial> fm = m->surface_get_material(i);
if (fm.is_valid()) {
fm->set_flag(Material::FLAG_UNSHADED,true);
fm->set_flag(Material::FLAG_DOUBLE_SIDED,true);
fm->set_hint(Material::HINT_NO_DEPTH_DRAW,true);
- fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
+ fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true);
}
}
}*/
@@ -1713,12 +1714,14 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
//mi->set_baked_light_texture_id(layer);
}
- if (p_flags&SCENE_FLAG_CREATE_COLLISIONS && _teststr(name,"colonly")) {
+ bool is_rigid = _teststr(name, "rigidonly");
+
+ if (p_flags & SCENE_FLAG_CREATE_COLLISIONS && (_teststr(name, "colonly") || is_rigid)) {
if (isroot)
return p_node;
-
- if (p_node->cast_to<MeshInstance>()) {
+
+ if (p_node->cast_to<MeshInstance>() && !is_rigid) {
MeshInstance *mi = p_node->cast_to<MeshInstance>();
Node * col = mi->create_trimesh_collision_node();
ERR_FAIL_COND_V(!col,NULL);
@@ -1738,10 +1741,16 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
} else if (p_node->has_meta("empty_draw_type")) {
String empty_draw_type = String(p_node->get_meta("empty_draw_type"));
print_line(empty_draw_type);
- StaticBody *sb = memnew( StaticBody);
- sb->set_name(_fixstr(name,"colonly"));
- sb->cast_to<Spatial>()->set_transform(p_node->cast_to<Spatial>()->get_transform());
- p_node->replace_by(sb);
+ PhysicsBody *pb;
+ if (is_rigid) {
+ pb = memnew(RigidBody);
+ pb->set_name(_fixstr(name, "rigidonly"));
+ } else {
+ pb = memnew(StaticBody);
+ pb->set_name(_fixstr(name, "colonly"));
+ }
+ pb->cast_to<Spatial>()->set_transform(p_node->cast_to<Spatial>()->get_transform());
+ p_node->replace_by(pb);
memdelete(p_node);
CollisionShape *colshape = memnew( CollisionShape);
if (empty_draw_type == "CUBE") {
@@ -1754,7 +1763,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
rayShape->set_length(1);
colshape->set_shape(rayShape);
colshape->set_name("RayShape");
- sb->cast_to<Spatial>()->rotate_x(Math_PI / 2);
+ pb->cast_to<Spatial>()->rotate_x(Math_PI / 2);
} else if (empty_draw_type == "IMAGE") {
PlaneShape *planeShape = memnew( PlaneShape);
colshape->set_shape(planeShape);
@@ -1765,8 +1774,8 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
colshape->set_shape(sphereShape);
colshape->set_name("SphereShape");
}
- sb->add_child(colshape);
- colshape->set_owner(sb->get_owner());
+ pb->add_child(colshape);
+ colshape->set_owner(pb->get_owner());
}
} else if (p_flags&SCENE_FLAG_CREATE_COLLISIONS && _teststr(name,"rigid") && p_node->cast_to<MeshInstance>()) {
@@ -2062,16 +2071,16 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
for(int i=0;i<mesh->get_surface_count();i++) {
- Ref<FixedSpatialMaterial> fm = mesh->surface_get_material(i);
+ Ref<SpatialMaterial> fm = mesh->surface_get_material(i);
if (fm.is_valid()) {
String name = fm->get_name();
/* if (_teststr(name,"alpha")) {
- fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
+ fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true);
name=_fixstr(name,"alpha");
}
if (_teststr(name,"vcol")) {
- fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true);
+ fm->set_fixed_flag(SpatialMaterial::FLAG_USE_COLOR_ARRAY,true);
name=_fixstr(name,"vcol");
}*/
fm->set_name(name);
@@ -2803,7 +2812,7 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
String path = texture->get_path();
String fname= path.get_file();
- String target_path = GlobalConfig::get_singleton()->localize_path(target_res_path.plus_file(fname));
+ String target_path = ProjectSettings::get_singleton()->localize_path(target_res_path.plus_file(fname));
progress.step(TTR("Import Image:")+" "+fname,3+(idx)*100/imagemap.size());
idx++;
diff --git a/editor/io_plugins/editor_scene_import_plugin.h b/editor/io_plugins/editor_scene_import_plugin.h
index e365a003a3..44526deb8b 100644
--- a/editor/io_plugins/editor_scene_import_plugin.h
+++ b/editor/io_plugins/editor_scene_import_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_scene_importer_fbxconv.cpp b/editor/io_plugins/editor_scene_importer_fbxconv.cpp
index a2fe4a649b..784ad8536e 100644
--- a/editor/io_plugins/editor_scene_importer_fbxconv.cpp
+++ b/editor/io_plugins/editor_scene_importer_fbxconv.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -483,29 +484,29 @@ void EditorSceneImporterFBXConv::_parse_materials(State& state) {
ERR_CONTINUE(!material.has("id"));
String id = _id(material["id"]);
- Ref<FixedSpatialMaterial> mat = memnew( FixedSpatialMaterial );
+ Ref<SpatialMaterial> mat = memnew( SpatialMaterial );
if (material.has("diffuse")) {
- mat->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,_get_color(material["diffuse"]));
+ mat->set_parameter(SpatialMaterial::PARAM_DIFFUSE,_get_color(material["diffuse"]));
}
if (material.has("specular")) {
- mat->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,_get_color(material["specular"]));
+ mat->set_parameter(SpatialMaterial::PARAM_SPECULAR,_get_color(material["specular"]));
}
if (material.has("emissive")) {
- mat->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,_get_color(material["emissive"]));
+ mat->set_parameter(SpatialMaterial::PARAM_EMISSION,_get_color(material["emissive"]));
}
if (material.has("shininess")) {
float exp = material["shininess"];
- mat->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR_EXP,exp);
+ mat->set_parameter(SpatialMaterial::PARAM_SPECULAR_EXP,exp);
}
if (material.has("opacity")) {
- Color c = mat->get_parameter(FixedSpatialMaterial::PARAM_DIFFUSE);
+ Color c = mat->get_parameter(SpatialMaterial::PARAM_DIFFUSE);
c.a=material["opacity"];
- mat->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,c);
+ mat->set_parameter(SpatialMaterial::PARAM_DIFFUSE,c);
}
@@ -537,15 +538,15 @@ void EditorSceneImporterFBXConv::_parse_materials(State& state) {
String type=texture["type"];
if (type=="DIFFUSE")
- mat->set_texture(FixedSpatialMaterial::PARAM_DIFFUSE,tex);
+ mat->set_texture(SpatialMaterial::PARAM_DIFFUSE,tex);
else if (type=="SPECULAR")
- mat->set_texture(FixedSpatialMaterial::PARAM_SPECULAR,tex);
+ mat->set_texture(SpatialMaterial::PARAM_SPECULAR,tex);
else if (type=="SHININESS")
- mat->set_texture(FixedSpatialMaterial::PARAM_SPECULAR_EXP,tex);
+ mat->set_texture(SpatialMaterial::PARAM_SPECULAR_EXP,tex);
else if (type=="NORMAL")
- mat->set_texture(FixedSpatialMaterial::PARAM_NORMAL,tex);
+ mat->set_texture(SpatialMaterial::PARAM_NORMAL,tex);
else if (type=="EMISSIVE")
- mat->set_texture(FixedSpatialMaterial::PARAM_EMISSION,tex);
+ mat->set_texture(SpatialMaterial::PARAM_EMISSION,tex);
}
}
diff --git a/editor/io_plugins/editor_scene_importer_fbxconv.h b/editor/io_plugins/editor_scene_importer_fbxconv.h
index da7058ad88..d191a17489 100644
--- a/editor/io_plugins/editor_scene_importer_fbxconv.h
+++ b/editor/io_plugins/editor_scene_importer_fbxconv.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_texture_import_plugin.cpp b/editor/io_plugins/editor_texture_import_plugin.cpp
index 32742483bc..095bc02fa0 100644
--- a/editor/io_plugins/editor_texture_import_plugin.cpp
+++ b/editor/io_plugins/editor_texture_import_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,20 +28,22 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "editor_texture_import_plugin.h"
+
#if 0
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor_atlas.h"
-#include "global_config.h"
#include "io/image_loader.h"
#include "io/marshalls.h"
-#include "io/md5.h"
#include "io/resource_saver.h"
+#include "project_settings.h"
#include "scene/gui/button_group.h"
#include "scene/gui/check_button.h"
#include "scene/gui/margin_container.h"
#include "scene/io/resource_format_image.h"
+#include "thirdparty/misc/md5.h"
+
static const char *flag_names[]={
("Streaming Format"),
("Fix Border Alpha"),
@@ -593,7 +596,7 @@ void EditorTextureImportDialog::_mode_changed(int p_mode) {
size->show();
file_select->set_mode(EditorFileDialog::MODE_OPEN_FILE);
- save_file_select->add_filter("*.ltex;"+TTR("Large Texture"));
+ save_file_select->add_filter("*.largetex;"+TTR("Large Texture"));
texture_options->set_flags(EditorTextureImportPlugin::IMAGE_FLAG_FIX_BORDER_ALPHA|EditorTextureImportPlugin::IMAGE_FLAG_NO_MIPMAPS|EditorTextureImportPlugin::IMAGE_FLAG_FILTER);
texture_options->set_quality(0.7);
@@ -1094,7 +1097,7 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
int cell_size=from->get_option("large_cell_size");
ERR_FAIL_COND_V(cell_size<128 || cell_size>16384,ERR_CANT_OPEN);
- EditorProgress pg("ltex",TTR("Import Large Texture"),3);
+ EditorProgress pg("largetex",TTR("Import Large Texture"),3);
pg.step(TTR("Load Source Image"),0);
Image img;
@@ -1314,9 +1317,9 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
String spath = from->get_source_path(E->get()).get_file();
if (p_external) {
- apath = p_path.get_base_dir().plus_file(spath.get_basename()+"."+from->get_source_path(E->get()).md5_text()+".atex");
+ apath = p_path.get_base_dir().plus_file(spath.get_basename()+"."+from->get_source_path(E->get()).md5_text()+".atlastex");
} else {
- apath = p_path.get_base_dir().plus_file(spath.get_basename()+".atex");
+ apath = p_path.get_base_dir().plus_file(spath.get_basename()+".atlastex");
}
Ref<AtlasTexture> at;
@@ -1650,7 +1653,7 @@ Vector<uint8_t> EditorTextureImportPlugin::custom_export(const String& p_path, c
uint8_t f4[4];
encode_uint32(flags,&f4[0]);
MD5Init(&ctx);
- String gp = GlobalConfig::get_singleton()->globalize_path(p_path);
+ String gp = ProjectSettings::get_singleton()->globalize_path(p_path);
CharString cs = gp.utf8();
MD5Update(&ctx,(unsigned char*)cs.get_data(),cs.length());
MD5Update(&ctx,f4,4);
diff --git a/editor/io_plugins/editor_texture_import_plugin.h b/editor/io_plugins/editor_texture_import_plugin.h
index 5d0d21f116..ea09227713 100644
--- a/editor/io_plugins/editor_texture_import_plugin.h
+++ b/editor/io_plugins/editor_texture_import_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/io_plugins/editor_translation_import_plugin.cpp b/editor/io_plugins/editor_translation_import_plugin.cpp
index 9aa9f043b3..5b15b94006 100644
--- a/editor/io_plugins/editor_translation_import_plugin.cpp
+++ b/editor/io_plugins/editor_translation_import_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -257,7 +258,7 @@ public:
imd->set_option("skip_first",ignore_first->is_pressed());
imd->set_option("compress",compress->is_pressed());
- String savefile = save_path->get_text().plus_file(import_path->get_text().get_file().get_basename()+"."+locale+".xl");
+ String savefile = save_path->get_text().plus_file(import_path->get_text().get_file().get_basename()+"."+locale+".translation");
Error err = plugin->import(savefile,imd);
if (err!=OK) {
error_dialog->set_text(TTR("Couldn't import!"));
@@ -346,7 +347,7 @@ public:
add_to_project = memnew( CheckButton);
add_to_project->set_pressed(true);
- add_to_project->set_text(TTR("Add to Project (godot.cfg)"));
+ add_to_project->set_text(TTR("Add to Project (project.godot)"));
tcomp->add_child(add_to_project);
file_select = memnew(EditorFileDialog);
diff --git a/editor/io_plugins/editor_translation_import_plugin.h b/editor/io_plugins/editor_translation_import_plugin.h
index 030c5bbf6f..78335b531d 100644
--- a/editor/io_plugins/editor_translation_import_plugin.h
+++ b/editor/io_plugins/editor_translation_import_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/multi_node_edit.cpp b/editor/multi_node_edit.cpp
index e0e6838402..a0f7b1e9dd 100644
--- a/editor/multi_node_edit.cpp
+++ b/editor/multi_node_edit.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/multi_node_edit.h b/editor/multi_node_edit.h
index 2307968794..3ffb0e205e 100644
--- a/editor/multi_node_edit.h
+++ b/editor/multi_node_edit.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp
index d76a427e1f..0f3f4b96f5 100644
--- a/editor/node_dock.cpp
+++ b/editor/node_dock.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/node_dock.h b/editor/node_dock.h
index b7d91899d8..0af65719c9 100644
--- a/editor/node_dock.h
+++ b/editor/node_dock.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/output_strings.cpp b/editor/output_strings.cpp
index 0894a92731..8c9f8386ef 100644
--- a/editor/output_strings.cpp
+++ b/editor/output_strings.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,15 +38,15 @@ void OutputStrings::update_scrollbars() {
v_scroll->set_anchor(MARGIN_RIGHT, ANCHOR_END);
v_scroll->set_anchor(MARGIN_BOTTOM, ANCHOR_END);
- v_scroll->set_begin(Point2(vmin.width, 0));
+ v_scroll->set_begin(Point2(-vmin.width, 0));
v_scroll->set_end(Point2(0, 0));
h_scroll->set_anchor(MARGIN_RIGHT, ANCHOR_END);
h_scroll->set_anchor(MARGIN_TOP, ANCHOR_END);
h_scroll->set_anchor(MARGIN_BOTTOM, ANCHOR_END);
- h_scroll->set_begin(Point2(0, hmin.y));
- h_scroll->set_end(Point2(vmin.x, 0));
+ h_scroll->set_begin(Point2(0, -hmin.y));
+ h_scroll->set_end(Point2(-vmin.x, 0));
margin.y = hmin.y;
margin.x = vmin.x;
diff --git a/editor/output_strings.h b/editor/output_strings.h
index 392b1d4dc8..aeaad35c0c 100644
--- a/editor/output_strings.h
+++ b/editor/output_strings.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/pane_drag.cpp b/editor/pane_drag.cpp
index 253b217049..22b306f941 100644
--- a/editor/pane_drag.cpp
+++ b/editor/pane_drag.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,11 +29,12 @@
/*************************************************************************/
#include "pane_drag.h"
-void PaneDrag::_gui_input(const InputEvent &p_input) {
+void PaneDrag::_gui_input(const Ref<InputEvent> &p_input) {
- if (p_input.type == InputEvent::MOUSE_MOTION && p_input.mouse_motion.button_mask & BUTTON_MASK_LEFT) {
+ Ref<InputEventMouseMotion> mm = p_input;
+ if (mm.is_valid() && mm->get_button_mask() & BUTTON_MASK_LEFT) {
- emit_signal("dragged", Point2(p_input.mouse_motion.relative_x, p_input.mouse_motion.relative_y));
+ emit_signal("dragged", Point2(mm->get_relative().x, mm->get_relative().y));
}
}
diff --git a/editor/pane_drag.h b/editor/pane_drag.h
index 30ca6c20a2..0be017b8f7 100644
--- a/editor/pane_drag.h
+++ b/editor/pane_drag.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,12 +34,12 @@
class PaneDrag : public Control {
- GDCLASS(PaneDrag, Control);
+ GDCLASS(PaneDrag, Control)
bool mouse_over;
protected:
- void _gui_input(const InputEvent &p_input);
+ void _gui_input(const Ref<InputEvent> &p_input);
void _notification(int p_what);
virtual Size2 get_minimum_size() const;
static void _bind_methods();
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 90d2847103..ecae272b6d 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,10 +31,10 @@
#include "editor/animation_editor.h"
#include "editor/editor_settings.h"
-#include "global_config.h"
#include "io/resource_loader.h"
#include "io/resource_saver.h"
#include "os/keyboard.h"
+#include "project_settings.h"
void AnimationPlayerEditor::_node_removed(Node *p_node) {
@@ -50,7 +51,7 @@ void AnimationPlayerEditor::_node_removed(Node *p_node) {
}
}
-void AnimationPlayerEditor::_gui_input(InputEvent p_event) {
+void AnimationPlayerEditor::_gui_input(Ref<InputEvent> p_event) {
}
void AnimationPlayerEditor::_notification(int p_what) {
@@ -86,7 +87,7 @@ void AnimationPlayerEditor::_notification(int p_what) {
}
last_active = player->is_playing();
- //seek->set_val(player->get_pos());
+ //seek->set_val(player->get_position());
updating = false;
}
@@ -117,8 +118,6 @@ void AnimationPlayerEditor::_notification(int p_what) {
blend_editor.next->connect("item_selected", this, "_blend_editor_next_changed");
- nodename->set_icon(get_icon("AnimationPlayer", "EditorIcons"));
-
/*
anim_editor_load->set_normal_texture( get_icon("AnimGet","EditorIcons"));
anim_editor_store->set_normal_texture( get_icon("AnimSet","EditorIcons"));
@@ -255,6 +254,10 @@ void AnimationPlayerEditor::_play_bw_from_pressed() {
}
void AnimationPlayerEditor::_stop_pressed() {
+ if (!player) {
+ return;
+ }
+
player->stop(false);
play->set_pressed(false);
stop->set_pressed(true);
@@ -369,7 +372,7 @@ void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource> &p_resou
flg |= ResourceSaver::FLAG_RELATIVE_PATHS;
*/
- String path = GlobalConfig::get_singleton()->localize_path(p_path);
+ String path = ProjectSettings::get_singleton()->localize_path(p_path);
Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS);
if (err != OK) {
@@ -789,10 +792,6 @@ void AnimationPlayerEditor::_update_player() {
player->get_animation_list(&animlist);
animation->clear();
- if (player)
- nodename->set_text(player->get_name());
- else
- nodename->set_text("<empty>");
add_anim->set_disabled(player == NULL);
load_anim->set_disabled(player == NULL);
@@ -1165,14 +1164,15 @@ void AnimationPlayerEditor::_animation_save_menu(int p_option) {
}
}
-void AnimationPlayerEditor::_unhandled_key_input(const InputEvent &p_ev) {
+void AnimationPlayerEditor::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
- if (is_visible_in_tree() && p_ev.type == InputEvent::KEY && p_ev.key.pressed && !p_ev.key.echo && !p_ev.key.mod.alt && !p_ev.key.mod.control && !p_ev.key.mod.meta) {
+ Ref<InputEventKey> k = p_ev;
+ if (is_visible_in_tree() && k.is_valid() && k->is_pressed() && !k->is_echo() && !k->get_alt() && !k->get_control() && !k->get_metakey()) {
- switch (p_ev.key.scancode) {
+ switch (k->get_scancode()) {
case KEY_A: {
- if (!p_ev.key.mod.shift)
+ if (!k->get_shift())
_play_bw_from_pressed();
else
_play_bw_pressed();
@@ -1181,7 +1181,7 @@ void AnimationPlayerEditor::_unhandled_key_input(const InputEvent &p_ev) {
_stop_pressed();
} break;
case KEY_D: {
- if (!p_ev.key.mod.shift)
+ if (!k->get_shift())
_play_from_pressed();
else
_play_pressed();
@@ -1246,7 +1246,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) {
set_focus_mode(FOCUS_ALL);
player = NULL;
- add_style_override("panel", get_stylebox("panel", "Panel"));
+ add_style_override("panel", editor->get_gui_base()->get_stylebox("panel", "Panel"));
Label *l;
@@ -1366,8 +1366,6 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) {
//tool_anim->get_popup()->add_item("Edit Anim Resource",TOOL_PASTE_ANIM);
hb->add_child(tool_anim);
- nodename = memnew(Button);
- hb->add_child(nodename);
pin = memnew(ToolButton);
pin->set_toggle_mode(true);
hb->add_child(pin);
@@ -1383,19 +1381,18 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) {
name_dialog->set_title(TTR("Create New Animation"));
name_dialog->set_hide_on_ok(false);
add_child(name_dialog);
- name = memnew(LineEdit);
- name_dialog->add_child(name);
- name->set_pos(Point2(18, 30));
- name->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 10);
- name_dialog->register_text_enter(name);
+ VBoxContainer *vb = memnew(VBoxContainer);
+ name_dialog->add_child(vb);
l = memnew(Label);
l->set_text(TTR("Animation Name:"));
- l->set_pos(Point2(10, 10));
-
- name_dialog->add_child(l);
+ vb->add_child(l);
name_title = l;
+ name = memnew(LineEdit);
+ vb->add_child(name);
+ name_dialog->register_text_enter(name);
+
error_dialog = memnew(ConfirmationDialog);
error_dialog->get_ok()->set_text(TTR("Close"));
//error_dialog->get_cancel()->set_text("Close");
diff --git a/editor/plugins/animation_player_editor_plugin.h b/editor/plugins/animation_player_editor_plugin.h
index 0eee4afcd4..bcf40f52d3 100644
--- a/editor/plugins/animation_player_editor_plugin.h
+++ b/editor/plugins/animation_player_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -84,7 +85,6 @@ class AnimationPlayerEditor : public VBoxContainer {
Button *remove_anim;
MenuButton *tool_anim;
ToolButton *pin;
- Button *nodename;
SpinBox *frame;
LineEdit *scale;
LineEdit *name;
@@ -155,10 +155,10 @@ class AnimationPlayerEditor : public VBoxContainer {
void _animation_player_changed(Object *p_pl);
void _animation_key_editor_seek(float p_pos, bool p_drag);
- void _animation_key_editor_anim_len_changed(float p_new);
+ void _animation_key_editor_anim_len_changed(float p_len);
void _animation_key_editor_anim_step_changed(float p_len);
- void _unhandled_key_input(const InputEvent &p_ev);
+ void _unhandled_key_input(const Ref<InputEvent> &p_ev);
void _animation_tool_menu(int p_option);
void _animation_save_menu(int p_option);
@@ -166,7 +166,7 @@ class AnimationPlayerEditor : public VBoxContainer {
protected:
void _notification(int p_what);
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
void _node_removed(Node *p_node);
static void _bind_methods();
@@ -198,8 +198,8 @@ public:
virtual String get_name() const { return "Anim"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
AnimationPlayerEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp
index 7800fde7a8..6e24d4d2cb 100644
--- a/editor/plugins/animation_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_tree_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "animation_tree_editor_plugin.h"
-#include "core/global_config.h"
#include "core/io/resource_loader.h"
+#include "core/project_settings.h"
#include "os/input.h"
#include "os/keyboard.h"
#include "scene/gui/menu_button.h"
@@ -260,12 +261,12 @@ void AnimationTreeEditor::_popup_edit_dialog() {
Ref<StyleBox> style = get_stylebox("panel", "PopupMenu");
Size2 size = get_node_size(edited_node);
Point2 popup_pos(pos.x + style->get_margin(MARGIN_LEFT), pos.y + size.y - style->get_margin(MARGIN_BOTTOM));
- popup_pos += get_global_pos();
+ popup_pos += get_global_position();
if (renaming_edit) {
edit_label[0]->set_text(TTR("New name:"));
- edit_label[0]->set_pos(Point2(5, 5));
+ edit_label[0]->set_position(Point2(5, 5));
edit_label[0]->show();
edit_line[0]->set_begin(Point2(15, 25));
edit_line[0]->set_text(edited_node);
@@ -293,18 +294,18 @@ void AnimationTreeEditor::_popup_edit_dialog() {
master_anim_popup->add_item(E->get());
}
- master_anim_popup->set_pos(popup_pos);
+ master_anim_popup->set_position(popup_pos);
master_anim_popup->popup();
} else {
property_editor->edit(this, "", Variant::OBJECT, anim_tree->animation_node_get_animation(edited_node), PROPERTY_HINT_RESOURCE_TYPE, "Animation");
- property_editor->set_pos(popup_pos);
+ property_editor->set_position(popup_pos);
property_editor->popup();
updating_edit = false;
}
return;
case AnimationTreePlayer::NODE_TIMESCALE:
edit_label[0]->set_text(TTR("Scale:"));
- edit_label[0]->set_pos(Point2(5, 5));
+ edit_label[0]->set_position(Point2(5, 5));
edit_label[0]->show();
edit_line[0]->set_begin(Point2(15, 25));
edit_line[0]->set_text(rtos(anim_tree->timescale_node_get_scale(edited_node)));
@@ -313,13 +314,13 @@ void AnimationTreeEditor::_popup_edit_dialog() {
break;
case AnimationTreePlayer::NODE_ONESHOT:
edit_label[0]->set_text(TTR("Fade In (s):"));
- edit_label[0]->set_pos(Point2(5, 5));
+ edit_label[0]->set_position(Point2(5, 5));
edit_label[0]->show();
edit_line[0]->set_begin(Point2(15, 25));
edit_line[0]->set_text(rtos(anim_tree->oneshot_node_get_fadein_time(edited_node)));
edit_line[0]->show();
edit_label[1]->set_text(TTR("Fade Out (s):"));
- edit_label[1]->set_pos(Point2(5, 55));
+ edit_label[1]->set_position(Point2(5, 55));
edit_label[1]->show();
edit_line[1]->set_begin(Point2(15, 75));
edit_line[1]->set_text(rtos(anim_tree->oneshot_node_get_fadeout_time(edited_node)));
@@ -339,13 +340,13 @@ void AnimationTreeEditor::_popup_edit_dialog() {
edit_check->show();
edit_label[2]->set_text(TTR("Restart (s):"));
- edit_label[2]->set_pos(Point2(5, 145));
+ edit_label[2]->set_position(Point2(5, 145));
edit_label[2]->show();
edit_line[2]->set_begin(Point2(15, 165));
edit_line[2]->set_text(rtos(anim_tree->oneshot_node_get_autorestart_delay(edited_node)));
edit_line[2]->show();
edit_label[3]->set_text(TTR("Random Restart (s):"));
- edit_label[3]->set_pos(Point2(5, 195));
+ edit_label[3]->set_position(Point2(5, 195));
edit_label[3]->show();
edit_line[3]->set_begin(Point2(15, 215));
edit_line[3]->set_text(rtos(anim_tree->oneshot_node_get_autorestart_random_delay(edited_node)));
@@ -366,10 +367,11 @@ void AnimationTreeEditor::_popup_edit_dialog() {
case AnimationTreePlayer::NODE_MIX:
edit_label[0]->set_text(TTR("Amount:"));
- edit_label[0]->set_pos(Point2(5, 5));
+ edit_label[0]->set_position(Point2(5, 5));
edit_label[0]->show();
edit_scroll[0]->set_min(0);
edit_scroll[0]->set_max(1);
+ edit_scroll[0]->set_step(0.01);
edit_scroll[0]->set_value(anim_tree->mix_node_get_amount(edited_node));
edit_scroll[0]->set_begin(Point2(15, 25));
edit_scroll[0]->show();
@@ -378,10 +380,11 @@ void AnimationTreeEditor::_popup_edit_dialog() {
break;
case AnimationTreePlayer::NODE_BLEND2:
edit_label[0]->set_text(TTR("Blend:"));
- edit_label[0]->set_pos(Point2(5, 5));
+ edit_label[0]->set_position(Point2(5, 5));
edit_label[0]->show();
edit_scroll[0]->set_min(0);
edit_scroll[0]->set_max(1);
+ edit_scroll[0]->set_step(0.01);
edit_scroll[0]->set_value(anim_tree->blend2_node_get_amount(edited_node));
edit_scroll[0]->set_begin(Point2(15, 25));
edit_scroll[0]->show();
@@ -393,10 +396,11 @@ void AnimationTreeEditor::_popup_edit_dialog() {
case AnimationTreePlayer::NODE_BLEND3:
edit_label[0]->set_text(TTR("Blend:"));
- edit_label[0]->set_pos(Point2(5, 5));
+ edit_label[0]->set_position(Point2(5, 5));
edit_label[0]->show();
edit_scroll[0]->set_min(-1);
edit_scroll[0]->set_max(1);
+ edit_scroll[0]->set_step(0.01);
edit_scroll[0]->set_value(anim_tree->blend3_node_get_amount(edited_node));
edit_scroll[0]->set_begin(Point2(15, 25));
edit_scroll[0]->show();
@@ -406,18 +410,20 @@ void AnimationTreeEditor::_popup_edit_dialog() {
case AnimationTreePlayer::NODE_BLEND4:
edit_label[0]->set_text(TTR("Blend 0:"));
- edit_label[0]->set_pos(Point2(5, 5));
+ edit_label[0]->set_position(Point2(5, 5));
edit_label[0]->show();
edit_scroll[0]->set_min(0);
edit_scroll[0]->set_max(1);
+ edit_scroll[0]->set_step(0.01);
edit_scroll[0]->set_value(anim_tree->blend4_node_get_amount(edited_node).x);
edit_scroll[0]->set_begin(Point2(15, 25));
edit_scroll[0]->show();
edit_label[1]->set_text(TTR("Blend 1:"));
- edit_label[1]->set_pos(Point2(5, 55));
+ edit_label[1]->set_position(Point2(5, 55));
edit_label[1]->show();
edit_scroll[1]->set_min(0);
edit_scroll[1]->set_max(1);
+ edit_scroll[1]->set_step(0.01);
edit_scroll[1]->set_value(anim_tree->blend4_node_get_amount(edited_node).y);
edit_scroll[1]->set_begin(Point2(15, 75));
edit_scroll[1]->show();
@@ -428,14 +434,14 @@ void AnimationTreeEditor::_popup_edit_dialog() {
case AnimationTreePlayer::NODE_TRANSITION: {
edit_label[0]->set_text(TTR("X-Fade Time (s):"));
- edit_label[0]->set_pos(Point2(5, 5));
+ edit_label[0]->set_position(Point2(5, 5));
edit_label[0]->show();
edit_line[0]->set_begin(Point2(15, 25));
edit_line[0]->set_text(rtos(anim_tree->transition_node_get_xfade_time(edited_node)));
edit_line[0]->show();
edit_label[1]->set_text(TTR("Current:"));
- edit_label[1]->set_pos(Point2(5, 55));
+ edit_label[1]->set_position(Point2(5, 55));
edit_label[1]->show();
edit_option->set_begin(Point2(15, 75));
@@ -454,7 +460,7 @@ void AnimationTreeEditor::_popup_edit_dialog() {
}
}
- edit_dialog->set_pos(popup_pos);
+ edit_dialog->set_position(popup_pos);
edit_dialog->popup();
updating_edit = false;
@@ -670,16 +676,16 @@ AnimationTreeEditor::ClickType AnimationTreeEditor::_locate_click(const Point2 &
return CLICK_NONE;
}
-Point2 AnimationTreeEditor::_get_slot_pos(const StringName &p_node, bool p_input, int p_slot) {
+Point2 AnimationTreeEditor::_get_slot_pos(const StringName &p_node_id, bool p_input, int p_slot) {
Ref<StyleBox> style = get_stylebox("panel", "PopupMenu");
Ref<Font> font = get_font("font", "PopupMenu");
Ref<Texture> slot_icon = get_icon("NodeRealSlot", "EditorIcons");
- Size2 size = get_node_size(p_node);
- Point2 pos = anim_tree->node_get_pos(p_node);
+ Size2 size = get_node_size(p_node_id);
+ Point2 pos = anim_tree->node_get_pos(p_node_id);
- if (click_type == CLICK_NODE && click_node == p_node) {
+ if (click_type == CLICK_NODE && click_node == p_node_id) {
pos += click_motion - click_pos;
if (pos.x < 5)
@@ -726,147 +732,147 @@ void AnimationTreeEditor::_node_edit_property(const StringName& p_node) {
property_editor->edit(NULL,ph.name,ph.type,anim_tree->node_get_param(p_node),ph.hint,ph.hint_string);
Point2 popup_pos=Point2( pos.x+(size.width-property_editor->get_size().width)/2.0,pos.y+(size.y-style->get_margin(MARGIN_BOTTOM))).floor();
- popup_pos+=get_global_pos();
- property_editor->set_pos(popup_pos);
+ popup_pos+=get_global_position();
+ property_editor->set_position(popup_pos);
property_editor->popup();
}
#endif
-void AnimationTreeEditor::_gui_input(InputEvent p_event) {
+void AnimationTreeEditor::_gui_input(Ref<InputEvent> p_event) {
- switch (p_event.type) {
+ Ref<InputEventMouseButton> mb = p_event;
- case InputEvent::MOUSE_BUTTON: {
+ if (mb.is_valid()) {
- if (p_event.mouse_button.pressed) {
+ if (mb->is_pressed()) {
- if (p_event.mouse_button.button_index == 1) {
- click_pos = Point2(p_event.mouse_button.x, p_event.mouse_button.y);
- click_motion = click_pos;
- click_type = _locate_click(click_pos, &click_node, &click_slot);
- if (click_type != CLICK_NONE) {
+ if (mb->get_button_index() == 1) {
+ click_pos = Point2(mb->get_position().x, mb->get_position().y);
+ click_motion = click_pos;
+ click_type = _locate_click(click_pos, &click_node, &click_slot);
+ if (click_type != CLICK_NONE) {
- order.erase(click_node);
- order.push_back(click_node);
- update();
- }
+ order.erase(click_node);
+ order.push_back(click_node);
+ update();
+ }
- switch (click_type) {
- case CLICK_INPUT_SLOT: {
- click_pos = _get_slot_pos(click_node, true, click_slot);
- } break;
- case CLICK_OUTPUT_SLOT: {
- click_pos = _get_slot_pos(click_node, false, click_slot);
- } break;
- case CLICK_PARAMETER: {
-
- edited_node = click_node;
- renaming_edit = false;
- _popup_edit_dialog();
- //open editor
- //_node_edit_property(click_node);
- } break;
- default: {}
- }
+ switch (click_type) {
+ case CLICK_INPUT_SLOT: {
+ click_pos = _get_slot_pos(click_node, true, click_slot);
+ } break;
+ case CLICK_OUTPUT_SLOT: {
+ click_pos = _get_slot_pos(click_node, false, click_slot);
+ } break;
+ case CLICK_PARAMETER: {
+
+ edited_node = click_node;
+ renaming_edit = false;
+ _popup_edit_dialog();
+ //open editor
+ //_node_edit_property(click_node);
+ } break;
+ default: {}
}
- if (p_event.mouse_button.button_index == 2) {
-
- if (click_type != CLICK_NONE) {
- click_type = CLICK_NONE;
- update();
- } else {
- // try to disconnect/remove
-
- Point2 rclick_pos = Point2(p_event.mouse_button.x, p_event.mouse_button.y);
- rclick_type = _locate_click(rclick_pos, &rclick_node, &rclick_slot);
- if (rclick_type == CLICK_INPUT_SLOT || rclick_type == CLICK_OUTPUT_SLOT) {
-
- node_popup->clear();
- node_popup->add_item(TTR("Disconnect"), NODE_DISCONNECT);
- if (anim_tree->node_get_type(rclick_node) == AnimationTreePlayer::NODE_TRANSITION) {
- node_popup->add_item(TTR("Add Input"), NODE_ADD_INPUT);
- if (rclick_type == CLICK_INPUT_SLOT) {
- if (anim_tree->transition_node_has_input_auto_advance(rclick_node, rclick_slot))
- node_popup->add_item(TTR("Clear Auto-Advance"), NODE_CLEAR_AUTOADVANCE);
- else
- node_popup->add_item(TTR("Set Auto-Advance"), NODE_SET_AUTOADVANCE);
- node_popup->add_item(TTR("Delete Input"), NODE_DELETE_INPUT);
- }
- }
+ }
+ if (mb->get_button_index() == 2) {
- node_popup->set_pos(rclick_pos + get_global_pos());
- node_popup->popup();
+ if (click_type != CLICK_NONE) {
+ click_type = CLICK_NONE;
+ update();
+ } else {
+ // try to disconnect/remove
+
+ Point2 rclick_pos = Point2(mb->get_position().x, mb->get_position().y);
+ rclick_type = _locate_click(rclick_pos, &rclick_node, &rclick_slot);
+ if (rclick_type == CLICK_INPUT_SLOT || rclick_type == CLICK_OUTPUT_SLOT) {
+
+ node_popup->clear();
+ node_popup->add_item(TTR("Disconnect"), NODE_DISCONNECT);
+ if (anim_tree->node_get_type(rclick_node) == AnimationTreePlayer::NODE_TRANSITION) {
+ node_popup->add_item(TTR("Add Input"), NODE_ADD_INPUT);
+ if (rclick_type == CLICK_INPUT_SLOT) {
+ if (anim_tree->transition_node_has_input_auto_advance(rclick_node, rclick_slot))
+ node_popup->add_item(TTR("Clear Auto-Advance"), NODE_CLEAR_AUTOADVANCE);
+ else
+ node_popup->add_item(TTR("Set Auto-Advance"), NODE_SET_AUTOADVANCE);
+ node_popup->add_item(TTR("Delete Input"), NODE_DELETE_INPUT);
+ }
}
- if (rclick_type == CLICK_NODE) {
- node_popup->clear();
- node_popup->add_item(TTR("Rename"), NODE_RENAME);
- node_popup->add_item(TTR("Remove"), NODE_ERASE);
- if (anim_tree->node_get_type(rclick_node) == AnimationTreePlayer::NODE_TRANSITION)
- node_popup->add_item(TTR("Add Input"), NODE_ADD_INPUT);
- node_popup->set_pos(rclick_pos + get_global_pos());
- node_popup->popup();
- }
+ node_popup->set_position(rclick_pos + get_global_position());
+ node_popup->popup();
}
- }
- } else {
- if (p_event.mouse_button.button_index == 1 && click_type != CLICK_NONE) {
+ if (rclick_type == CLICK_NODE) {
+ node_popup->clear();
+ node_popup->add_item(TTR("Rename"), NODE_RENAME);
+ node_popup->add_item(TTR("Remove"), NODE_ERASE);
+ if (anim_tree->node_get_type(rclick_node) == AnimationTreePlayer::NODE_TRANSITION)
+ node_popup->add_item(TTR("Add Input"), NODE_ADD_INPUT);
+ node_popup->set_position(rclick_pos + get_global_position());
+ node_popup->popup();
+ }
+ }
+ }
+ } else {
- switch (click_type) {
- case CLICK_INPUT_SLOT:
- case CLICK_OUTPUT_SLOT: {
+ if (mb->get_button_index() == 1 && click_type != CLICK_NONE) {
- Point2 dst_click_pos = Point2(p_event.mouse_button.x, p_event.mouse_button.y);
- StringName id;
- int slot;
- ClickType dst_click_type = _locate_click(dst_click_pos, &id, &slot);
+ switch (click_type) {
+ case CLICK_INPUT_SLOT:
+ case CLICK_OUTPUT_SLOT: {
- if (dst_click_type == CLICK_INPUT_SLOT && click_type == CLICK_OUTPUT_SLOT) {
+ Point2 dst_click_pos = Point2(mb->get_position().x, mb->get_position().y);
+ StringName id;
+ int slot;
+ ClickType dst_click_type = _locate_click(dst_click_pos, &id, &slot);
- anim_tree->connect_nodes(click_node, id, slot);
- }
- if (click_type == CLICK_INPUT_SLOT && dst_click_type == CLICK_OUTPUT_SLOT) {
+ if (dst_click_type == CLICK_INPUT_SLOT && click_type == CLICK_OUTPUT_SLOT) {
- anim_tree->connect_nodes(id, click_node, click_slot);
- }
+ anim_tree->connect_nodes(click_node, id, slot);
+ }
+ if (click_type == CLICK_INPUT_SLOT && dst_click_type == CLICK_OUTPUT_SLOT) {
- } break;
- case CLICK_NODE: {
- Point2 new_pos = anim_tree->node_get_pos(click_node) + (click_motion - click_pos);
- if (new_pos.x < 5)
- new_pos.x = 5;
- if (new_pos.y < 5)
- new_pos.y = 5;
- anim_tree->node_set_pos(click_node, new_pos);
-
- } break;
- default: {}
- }
+ anim_tree->connect_nodes(id, click_node, click_slot);
+ }
- click_type = CLICK_NONE;
- update();
+ } break;
+ case CLICK_NODE: {
+ Point2 new_pos = anim_tree->node_get_pos(click_node) + (click_motion - click_pos);
+ if (new_pos.x < 5)
+ new_pos.x = 5;
+ if (new_pos.y < 5)
+ new_pos.y = 5;
+ anim_tree->node_set_pos(click_node, new_pos);
+
+ } break;
+ default: {}
}
+
+ click_type = CLICK_NONE;
+ update();
}
}
+ }
- case InputEvent::MOUSE_MOTION: {
+ Ref<InputEventMouseMotion> mm = p_event;
- if (p_event.mouse_motion.button_mask & 1 && click_type != CLICK_NONE) {
+ if (mm.is_valid()) {
- click_motion = Point2(p_event.mouse_button.x, p_event.mouse_button.y);
- update();
- }
- if ((p_event.mouse_motion.button_mask & 4 || Input::get_singleton()->is_key_pressed(KEY_SPACE))) {
+ if (mm->get_button_mask() & 1 && click_type != CLICK_NONE) {
- h_scroll->set_value(h_scroll->get_value() - p_event.mouse_motion.relative_x);
- v_scroll->set_value(v_scroll->get_value() - p_event.mouse_motion.relative_y);
- update();
- }
+ click_motion = Point2(mm->get_position().x, mm->get_position().y);
+ update();
+ }
+ if ((mm->get_button_mask() & 4 || Input::get_singleton()->is_key_pressed(KEY_SPACE))) {
- } break;
+ h_scroll->set_value(h_scroll->get_value() - mm->get_relative().x);
+ v_scroll->set_value(v_scroll->get_value() - mm->get_relative().y);
+ update();
+ }
}
}
@@ -875,7 +881,7 @@ void AnimationTreeEditor::_draw_cos_line(const Vector2 &p_from, const Vector2 &p
static const int steps = 20;
Rect2 r;
- r.pos = p_from;
+ r.position = p_from;
r.expand_to(p_to);
Vector2 sign = Vector2((p_from.x < p_to.x) ? 1 : -1, (p_from.y < p_to.y) ? 1 : -1);
bool flip = sign.x * sign.y < 0;
@@ -887,7 +893,7 @@ void AnimationTreeEditor::_draw_cos_line(const Vector2 &p_from, const Vector2 &p
float c = -Math::cos(d * Math_PI) * 0.5 + 0.5;
if (flip)
c = 1.0 - c;
- Vector2 p = r.pos + Vector2(d * r.size.width, c * r.size.height);
+ Vector2 p = r.position + Vector2(d * r.size.width, c * r.size.height);
if (i > 0) {
@@ -1301,7 +1307,7 @@ AnimationTreeEditor::AnimationTreeEditor() {
add_menu = memnew(MenuButton);
//add_menu->set_
- add_menu->set_pos(Point2(0, 0));
+ add_menu->set_position(Point2(0, 0));
add_menu->set_size(Point2(25, 15));
add_child(add_menu);
@@ -1323,7 +1329,7 @@ AnimationTreeEditor::AnimationTreeEditor() {
p->connect("id_pressed", this, "_add_menu_item");
play_button = memnew(Button);
- play_button->set_pos(Point2(25, 0));
+ play_button->set_position(Point2(25, 0));
play_button->set_size(Point2(25, 15));
add_child(play_button);
play_button->set_toggle_mode(true);
@@ -1365,7 +1371,7 @@ AnimationTreeEditor::AnimationTreeEditor() {
edit_option = memnew(OptionButton);
edit_option->set_anchor(MARGIN_RIGHT, ANCHOR_END);
- edit_option->set_margin(MARGIN_RIGHT, 10);
+ edit_option->set_margin(MARGIN_RIGHT, -10);
edit_dialog->add_child(edit_option);
edit_option->connect("item_selected", this, "_edit_dialog_changedf");
edit_option->hide();
@@ -1373,7 +1379,7 @@ AnimationTreeEditor::AnimationTreeEditor() {
for (int i = 0; i < 2; i++) {
edit_scroll[i] = memnew(HSlider);
edit_scroll[i]->set_anchor(MARGIN_RIGHT, ANCHOR_END);
- edit_scroll[i]->set_margin(MARGIN_RIGHT, 10);
+ edit_scroll[i]->set_margin(MARGIN_RIGHT, -10);
edit_dialog->add_child(edit_scroll[i]);
edit_scroll[i]->hide();
edit_scroll[i]->connect("value_changed", this, "_edit_dialog_changedf");
@@ -1381,7 +1387,7 @@ AnimationTreeEditor::AnimationTreeEditor() {
for (int i = 0; i < 4; i++) {
edit_line[i] = memnew(LineEdit);
edit_line[i]->set_anchor(MARGIN_RIGHT, ANCHOR_END);
- edit_line[i]->set_margin(MARGIN_RIGHT, 10);
+ edit_line[i]->set_margin(MARGIN_RIGHT, -10);
edit_dialog->add_child(edit_line[i]);
edit_line[i]->hide();
edit_line[i]->connect("text_changed", this, "_edit_dialog_changeds");
@@ -1393,21 +1399,21 @@ AnimationTreeEditor::AnimationTreeEditor() {
edit_button = memnew(Button);
edit_button->set_anchor(MARGIN_RIGHT, ANCHOR_END);
- edit_button->set_margin(MARGIN_RIGHT, 10);
+ edit_button->set_margin(MARGIN_RIGHT, -10);
edit_dialog->add_child(edit_button);
edit_button->hide();
edit_button->connect("pressed", this, "_edit_oneshot_start");
edit_check = memnew(CheckButton);
edit_check->set_anchor(MARGIN_RIGHT, ANCHOR_END);
- edit_check->set_margin(MARGIN_RIGHT, 10);
+ edit_check->set_margin(MARGIN_RIGHT, -10);
edit_dialog->add_child(edit_check);
edit_check->hide();
edit_check->connect("pressed", this, "_edit_dialog_changed");
file_dialog = memnew(EditorFileDialog);
file_dialog->set_enable_multiple_selection(true);
- file_dialog->set_current_dir(GlobalConfig::get_singleton()->get_resource_path());
+ file_dialog->set_current_dir(ProjectSettings::get_singleton()->get_resource_path());
add_child(file_dialog);
file_dialog->connect("file_selected", this, "_file_dialog_selected");
@@ -1422,7 +1428,7 @@ AnimationTreeEditor::AnimationTreeEditor() {
filter_button = memnew(Button);
filter_button->set_anchor(MARGIN_RIGHT, ANCHOR_END);
- filter_button->set_margin(MARGIN_RIGHT, 10);
+ filter_button->set_margin(MARGIN_RIGHT, -10);
edit_dialog->add_child(filter_button);
filter_button->hide();
filter_button->set_text(TTR("Filters.."));
diff --git a/editor/plugins/animation_tree_editor_plugin.h b/editor/plugins/animation_tree_editor_plugin.h
index d998cb99ae..972c6c9b47 100644
--- a/editor/plugins/animation_tree_editor_plugin.h
+++ b/editor/plugins/animation_tree_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -154,12 +155,12 @@ class AnimationTreeEditor : public Control {
protected:
void _notification(int p_what);
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
static void _bind_methods();
public:
virtual Size2 get_minimum_size() const;
- void edit(AnimationTreePlayer *p_player);
+ void edit(AnimationTreePlayer *p_anim_tree);
AnimationTreeEditor();
};
@@ -174,8 +175,8 @@ class AnimationTreeEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "AnimTree"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
AnimationTreeEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/baked_light_baker.cpp b/editor/plugins/baked_light_baker.cpp
index de2b78b8dd..036229a7af 100644
--- a/editor/plugins/baked_light_baker.cpp
+++ b/editor/plugins/baked_light_baker.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -144,18 +145,18 @@ void BakedLightBaker::_add_mesh(const Ref<Mesh>& p_mesh,const Ref<Material>& p_m
MeshMaterial mm;
- Ref<FixedSpatialMaterial> fm = mat;
+ Ref<SpatialMaterial> fm = mat;
if (fm.is_valid()) {
//fixed route
- mm.diffuse.color=fm->get_parameter(FixedSpatialMaterial::PARAM_DIFFUSE);
+ mm.diffuse.color=fm->get_parameter(SpatialMaterial::PARAM_DIFFUSE);
if (linear_color)
mm.diffuse.color=mm.diffuse.color.to_linear();
- mm.diffuse.tex=_get_mat_tex(fm->get_texture(FixedSpatialMaterial::PARAM_DIFFUSE));
- mm.specular.color=fm->get_parameter(FixedSpatialMaterial::PARAM_SPECULAR);
+ mm.diffuse.tex=_get_mat_tex(fm->get_texture(SpatialMaterial::PARAM_DIFFUSE));
+ mm.specular.color=fm->get_parameter(SpatialMaterial::PARAM_SPECULAR);
if (linear_color)
mm.specular.color=mm.specular.color.to_linear();
- mm.specular.tex=_get_mat_tex(fm->get_texture(FixedSpatialMaterial::PARAM_SPECULAR));
+ mm.specular.tex=_get_mat_tex(fm->get_texture(SpatialMaterial::PARAM_SPECULAR));
} else {
mm.diffuse.color=Color(1,1,1,1);
diff --git a/editor/plugins/baked_light_baker.h b/editor/plugins/baked_light_baker.h
index f328062b1e..123812fc07 100644
--- a/editor/plugins/baked_light_baker.h
+++ b/editor/plugins/baked_light_baker.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,7 +31,7 @@
#define BAKED_LIGHT_BAKER_H
#include "os/thread.h"
-#include "scene/3d/baked_light_instance.h"
+
#include "scene/3d/light.h"
#include "scene/3d/mesh_instance.h"
diff --git a/editor/plugins/baked_light_baker_cmpxchg.cpp b/editor/plugins/baked_light_baker_cmpxchg.cpp
index f84c001f78..f0a1aea416 100644
--- a/editor/plugins/baked_light_baker_cmpxchg.cpp
+++ b/editor/plugins/baked_light_baker_cmpxchg.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/baked_light_editor_plugin.cpp b/editor/plugins/baked_light_editor_plugin.cpp
index 5ac4b54600..f973639a67 100644
--- a/editor/plugins/baked_light_editor_plugin.cpp
+++ b/editor/plugins/baked_light_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/baked_light_editor_plugin.h b/editor/plugins/baked_light_editor_plugin.h
index 036407a574..c4a7cd51cf 100644
--- a/editor/plugins/baked_light_editor_plugin.h
+++ b/editor/plugins/baked_light_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/camera_editor_plugin.cpp b/editor/plugins/camera_editor_plugin.cpp
index 96b6da51fd..8e625c4a73 100644
--- a/editor/plugins/camera_editor_plugin.cpp
+++ b/editor/plugins/camera_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -87,7 +88,7 @@ CameraEditor::CameraEditor() {
preview->set_toggle_mode(true);
preview->set_anchor(MARGIN_LEFT, Control::ANCHOR_END);
preview->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END);
- preview->set_margin(MARGIN_LEFT, 60);
+ preview->set_margin(MARGIN_LEFT, -60);
preview->set_margin(MARGIN_RIGHT, 0);
preview->set_margin(MARGIN_TOP, 0);
preview->set_margin(MARGIN_BOTTOM, 10);
diff --git a/editor/plugins/camera_editor_plugin.h b/editor/plugins/camera_editor_plugin.h
index f23b0d5cc8..a0f98687cb 100644
--- a/editor/plugins/camera_editor_plugin.h
+++ b/editor/plugins/camera_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -67,8 +68,8 @@ class CameraEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "Camera"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
CameraEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 3221208019..9e57e53a24 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,10 +35,10 @@
#include "editor/plugins/animation_player_editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor/script_editor_debugger.h"
-#include "global_config.h"
#include "os/input.h"
#include "os/keyboard.h"
#include "print_string.h"
+#include "project_settings.h"
#include "scene/2d/light_2d.h"
#include "scene/2d/particles_2d.h"
#include "scene/2d/polygon_2d.h"
@@ -175,7 +176,6 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2 &mouse_pos) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node2D *n2d = E->get()->cast_to<Node2D>();
-
if (n2d && n2d->edit_has_pivot()) {
Vector2 offset = n2d->edit_get_pivot();
@@ -185,41 +185,61 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2 &mouse_pos) {
Vector2 motion_ofs = gpos - local_mouse_pos;
- undo_redo->add_do_method(n2d, "set_global_pos", local_mouse_pos);
+ undo_redo->add_do_method(n2d, "set_global_position", local_mouse_pos);
undo_redo->add_do_method(n2d, "edit_set_pivot", offset + n2d->get_global_transform().affine_inverse().basis_xform(motion_ofs));
- undo_redo->add_undo_method(n2d, "set_global_pos", gpos);
+ undo_redo->add_undo_method(n2d, "set_global_position", gpos);
undo_redo->add_undo_method(n2d, "edit_set_pivot", offset);
for (int i = 0; i < n2d->get_child_count(); i++) {
Node2D *n2dc = n2d->get_child(i)->cast_to<Node2D>();
if (!n2dc)
continue;
- undo_redo->add_do_method(n2dc, "set_global_pos", n2dc->get_global_position());
- undo_redo->add_undo_method(n2dc, "set_global_pos", n2dc->get_global_position());
+ undo_redo->add_do_method(n2dc, "set_global_position", n2dc->get_global_position());
+ undo_redo->add_undo_method(n2dc, "set_global_position", n2dc->get_global_position());
}
}
+
+ Control *cnt = E->get()->cast_to<Control>();
+ if (cnt) {
+
+ Vector2 old_pivot = cnt->get_pivot_offset();
+ Vector2 new_pivot = cnt->get_global_transform_with_canvas().affine_inverse().xform(mouse_pos);
+ Vector2 old_pos = cnt->get_position();
+
+ Vector2 top_pos = cnt->get_transform().get_origin(); //remember where top pos was
+ cnt->set_pivot_offset(new_pivot);
+ Vector2 new_top_pos = cnt->get_transform().get_origin(); //check where it is now
+
+ Vector2 new_pos = old_pos - (new_top_pos - top_pos); //offset it back
+
+ undo_redo->add_do_method(cnt, "set_pivot_offset", new_pivot);
+ undo_redo->add_do_method(cnt, "set_position", new_pos);
+ undo_redo->add_undo_method(cnt, "set_pivot_offset", old_pivot);
+ undo_redo->add_undo_method(cnt, "set_position", old_pos);
+ }
}
undo_redo->commit_action();
}
-void CanvasItemEditor::_unhandled_key_input(const InputEvent &p_ev) {
+void CanvasItemEditor::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
+
+ Ref<InputEventKey> k = p_ev;
if (!is_visible_in_tree() || get_viewport()->gui_has_modal_stack())
return;
- if (p_ev.key.mod.control)
+ if (k->get_control())
return;
- if (p_ev.key.pressed && !p_ev.key.echo && p_ev.key.scancode == KEY_V && drag == DRAG_NONE && can_move_pivot) {
+ if (k->is_pressed() && !k->is_echo() && k->get_scancode() == KEY_V && drag == DRAG_NONE && can_move_pivot) {
- if (p_ev.key.mod.shift) {
+ if (k->get_shift()) {
//move drag pivot
drag = DRAG_PIVOT;
} else if (!Input::get_singleton()->is_mouse_button_pressed(0)) {
List<Node *> &selection = editor_selection->get_selected_node_list();
-
Vector2 mouse_pos = viewport->get_local_mouse_pos();
if (selection.size() && viewport->get_rect().has_point(mouse_pos)) {
//just in case, make it work if over viewport
@@ -236,7 +256,6 @@ void CanvasItemEditor::_tool_select(int p_index) {
ToolButton *tb[TOOL_MAX] = { select_button, list_select_button, move_button, rotate_button, pivot_button, pan_button };
for (int i = 0; i < TOOL_MAX; i++) {
-
tb[i]->set_pressed(i == p_index);
}
@@ -356,6 +375,8 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) {
int idx = skeleton_menu->get_item_index(SKELETON_SHOW_BONES);
skeleton_menu->set_item_checked(idx, skeleton_show_bones);
}
+
+ viewport->update();
}
void CanvasItemEditor::_add_canvas_item(CanvasItem *p_canvas_item) {
@@ -366,7 +387,7 @@ void CanvasItemEditor::_add_canvas_item(CanvasItem *p_canvas_item) {
return;
canvas_items.insert(p_canvas_item,p_info);
- p_canvas_item->connect("hide",this,"_visibility_changed",varray(p_canvas_item->get_instance_ID()),CONNECT_ONESHOT);
+ p_canvas_item->connect("hide",this,"_visibility_changed",varray(p_canvas_item->get_instance_id()),CONNECT_ONESHOT);
#endif
}
@@ -427,44 +448,7 @@ bool CanvasItemEditor::_is_part_of_subscene(CanvasItem *p_item) {
return item_owner && item_owner != scene_node && p_item != scene_node && item_owner->get_filename() != "";
}
-// slow but modern computers should have no problem
-CanvasItem *CanvasItemEditor::_select_canvas_item_at_pos(const Point2 &p_pos, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform) {
-
- if (!p_node)
- return NULL;
- if (p_node->cast_to<Viewport>())
- return NULL;
-
- CanvasItem *c = p_node->cast_to<CanvasItem>();
-
- for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
-
- CanvasItem *r = NULL;
-
- if (c && !c->is_set_as_toplevel())
- r = _select_canvas_item_at_pos(p_pos, p_node->get_child(i), p_parent_xform * c->get_transform(), p_canvas_xform);
- else {
- CanvasLayer *cl = p_node->cast_to<CanvasLayer>();
- r = _select_canvas_item_at_pos(p_pos, p_node->get_child(i), transform, cl ? cl->get_transform() : p_canvas_xform); //use base transform
- }
-
- if (r)
- return r;
- }
-
- if (c && c->is_visible_in_tree() && !c->has_meta("_edit_lock_") && !_is_part_of_subscene(c) && !c->cast_to<CanvasLayer>()) {
-
- Rect2 rect = c->get_item_rect();
- Point2 local_pos = (p_parent_xform * p_canvas_xform * c->get_transform()).affine_inverse().xform(p_pos);
-
- if (rect.has_point(local_pos))
- return c;
- }
-
- return NULL;
-}
-
-void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform, Vector<_SelectResult> &r_items) {
+void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform, Vector<_SelectResult> &r_items, unsigned int limit) {
if (!p_node)
return;
if (p_node->cast_to<Viewport>())
@@ -480,6 +464,9 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_no
CanvasLayer *cl = p_node->cast_to<CanvasLayer>();
_find_canvas_items_at_pos(p_pos, p_node->get_child(i), transform, cl ? cl->get_transform() : p_canvas_xform, r_items); //use base transform
}
+
+ if (limit != 0 && r_items.size() >= limit)
+ return;
}
if (c && c->is_visible_in_tree() && !c->has_meta("_edit_lock_") && !c->cast_to<CanvasLayer>()) {
@@ -533,82 +520,60 @@ void CanvasItemEditor::_find_canvas_items_at_rect(const Rect2 &p_rect, Node *p_n
Rect2 rect = c->get_item_rect();
Transform2D xform = p_parent_xform * p_canvas_xform * c->get_transform();
- if (p_rect.has_point(xform.xform(rect.pos)) &&
- p_rect.has_point(xform.xform(rect.pos + Vector2(rect.size.x, 0))) &&
- p_rect.has_point(xform.xform(rect.pos + Vector2(rect.size.x, rect.size.y))) &&
- p_rect.has_point(xform.xform(rect.pos + Vector2(0, rect.size.y)))) {
+ if (p_rect.has_point(xform.xform(rect.position)) &&
+ p_rect.has_point(xform.xform(rect.position + Vector2(rect.size.x, 0))) &&
+ p_rect.has_point(xform.xform(rect.position + Vector2(rect.size.x, rect.size.y))) &&
+ p_rect.has_point(xform.xform(rect.position + Vector2(0, rect.size.y)))) {
r_items->push_back(c);
}
}
}
-bool CanvasItemEditor::_select(CanvasItem *item, Point2 p_click_pos, bool p_append, bool p_drag) {
-
- if (p_append) {
- //additive selection
-
- if (!item) {
-
- if (p_drag) {
- drag_from = transform.affine_inverse().xform(p_click_pos);
-
- box_selecting = true;
- box_selecting_to = drag_from;
- }
+void CanvasItemEditor::_select_click_on_empty_area(Point2 p_click_pos, bool p_append, bool p_box_selection) {
+ if (!p_append) {
+ editor_selection->clear();
+ viewport->update();
+ };
- return false; //nothing to add
- }
+ if (p_box_selection) {
+ // Start a box selection
+ drag_from = transform.affine_inverse().xform(p_click_pos);
+ box_selecting = true;
+ box_selecting_to = drag_from;
+ }
+}
+bool CanvasItemEditor::_select_click_on_item(CanvasItem *item, Point2 p_click_pos, bool p_append, bool p_drag) {
+ bool still_selected = true;
+ if (p_append) {
if (editor_selection->is_selected(item)) {
- //already in here, erase it
+ // Already in the selection, remove it from the selected nodes
editor_selection->remove_node(item);
- //_remove_canvas_item(c);
-
- viewport->update();
- return false;
+ still_selected = false;
+ } else {
+ // Add the item to the selection
+ _append_canvas_item(item);
}
- _append_canvas_item(item);
- viewport->update();
-
- return true;
-
} else {
- //regular selection
-
- if (!item) {
- //clear because nothing clicked
- editor_selection->clear();
-
- if (p_drag) {
- drag_from = transform.affine_inverse().xform(p_click_pos);
-
- box_selecting = true;
- box_selecting_to = drag_from;
- }
-
- viewport->update();
- return false;
- }
-
if (!editor_selection->is_selected(item)) {
- //select a new one and clear previous selection
+ // Select a new one and clear previous selection
editor_selection->clear();
editor_selection->add_node(item);
- //reselect
+ // Reselect
if (get_tree()->is_editor_hint()) {
editor->call("edit_node", item);
}
}
+ }
- if (p_drag) {
- _prepare_drag(p_click_pos);
- }
-
- viewport->update();
-
- return true;
+ if (still_selected && p_drag) {
+ // Drag the node(s) if requested
+ _prepare_drag(p_click_pos);
}
+
+ viewport->update();
+ return still_selected;
}
void CanvasItemEditor::_key_move(const Vector2 &p_dir, bool p_snap, KeyMoveMODE p_move_mode) {
@@ -649,7 +614,7 @@ void CanvasItemEditor::_key_move(const Vector2 &p_dir, bool p_snap, KeyMoveMODE
// drag = transform.affine_inverse().basis_xform(p_dir); // zoom sensitive
drag = canvas_item->get_global_transform_with_canvas().affine_inverse().basis_xform(drag);
Rect2 local_rect = canvas_item->get_item_rect();
- local_rect.pos += drag;
+ local_rect.position += drag;
undo_redo->add_do_method(canvas_item, "edit_set_rect", local_rect);
} else { // p_move_mode==MOVE_LOCAL_BASE || p_move_mode==MOVE_LOCAL_WITH_ROT
@@ -665,7 +630,7 @@ void CanvasItemEditor::_key_move(const Vector2 &p_dir, bool p_snap, KeyMoveMODE
} else if (Control *control = canvas_item->cast_to<Control>()) {
- control->set_pos(control->get_pos() + drag);
+ control->set_position(control->get_position() + drag);
}
}
}
@@ -677,7 +642,7 @@ Point2 CanvasItemEditor::_find_topleftmost_point() {
Vector2 tl = Point2(1e10, 1e10);
Rect2 r2;
- r2.pos = tl;
+ r2.position = tl;
List<Node *> &selection = editor_selection->get_selected_node_list();
@@ -692,13 +657,13 @@ Point2 CanvasItemEditor::_find_topleftmost_point() {
Rect2 rect = canvas_item->get_item_rect();
Transform2D xform = canvas_item->get_global_transform_with_canvas();
- r2.expand_to(xform.xform(rect.pos));
- r2.expand_to(xform.xform(rect.pos + Vector2(rect.size.x, 0)));
- r2.expand_to(xform.xform(rect.pos + rect.size));
- r2.expand_to(xform.xform(rect.pos + Vector2(0, rect.size.y)));
+ r2.expand_to(xform.xform(rect.position));
+ r2.expand_to(xform.xform(rect.position + Vector2(rect.size.x, 0)));
+ r2.expand_to(xform.xform(rect.position + rect.size));
+ r2.expand_to(xform.xform(rect.position + Vector2(0, rect.size.y)));
}
- return r2.pos;
+ return r2.position;
}
int CanvasItemEditor::get_item_count() {
@@ -744,8 +709,8 @@ CanvasItem *CanvasItemEditor::get_single_item() {
return single_item;
}
-CanvasItemEditor::DragType CanvasItemEditor::_find_drag_type(const Transform2D &p_xform, const Rect2 &p_local_rect, const Point2 &p_click, Vector2 &r_point) {
-
+CanvasItemEditor::DragType CanvasItemEditor::_get_resize_handle_drag_type(const Point2 &p_click, Vector2 &r_point) {
+ // Returns a drag type if a resize handle is clicked
CanvasItem *canvas_item = get_single_item();
ERR_FAIL_COND_V(!canvas_item, DRAG_NONE);
@@ -756,18 +721,18 @@ CanvasItemEditor::DragType CanvasItemEditor::_find_drag_type(const Transform2D &
Vector2 endpoints[4] = {
- xform.xform(rect.pos),
- xform.xform(rect.pos + Vector2(rect.size.x, 0)),
- xform.xform(rect.pos + rect.size),
- xform.xform(rect.pos + Vector2(0, rect.size.y))
+ xform.xform(rect.position),
+ xform.xform(rect.position + Vector2(rect.size.x, 0)),
+ xform.xform(rect.position + rect.size),
+ xform.xform(rect.position + Vector2(0, rect.size.y))
};
Vector2 endpointsl[4] = {
- xforml.xform(rect.pos),
- xforml.xform(rect.pos + Vector2(rect.size.x, 0)),
- xforml.xform(rect.pos + rect.size),
- xforml.xform(rect.pos + Vector2(0, rect.size.y))
+ xforml.xform(rect.position),
+ xforml.xform(rect.position + Vector2(rect.size.x, 0)),
+ xforml.xform(rect.position + rect.size),
+ xforml.xform(rect.position + Vector2(0, rect.size.y))
};
DragType dragger[] = {
@@ -783,8 +748,6 @@ CanvasItemEditor::DragType CanvasItemEditor::_find_drag_type(const Transform2D &
float radius = (select_handle->get_size().width / 2) * 1.5;
- //try draggers
-
for (int i = 0; i < 4; i++) {
int prev = (i + 3) % 4;
@@ -809,13 +772,89 @@ CanvasItemEditor::DragType CanvasItemEditor::_find_drag_type(const Transform2D &
return dragger[i * 2 + 1];
}
- /*
- if (rect.has_point(xform.affine_inverse().xform(p_click))) {
- r_point=_find_topleftmost_point();
- return DRAG_ALL;
- }*/
+ return DRAG_NONE;
+}
- //try draggers
+float CanvasItemEditor::_anchor_snap(float p_anchor, bool *p_snapped, float p_opposite_anchor) {
+ bool snapped = false;
+ float dist, dist_min = 0.0;
+ float radius = 0.05 / zoom;
+ float basic_anchors[3] = { 0.0, 0.5, 1.0 };
+ for (int i = 0; i < 3; i++) {
+ if ((dist = fabs(p_anchor - basic_anchors[i])) < radius) {
+ if (!snapped || dist <= dist_min) {
+ p_anchor = basic_anchors[i];
+ dist_min = dist;
+ snapped = true;
+ }
+ }
+ }
+ if (p_opposite_anchor >= 0 && (dist = fabs(p_anchor - p_opposite_anchor)) < radius) {
+ if (!snapped || dist <= dist_min) {
+ p_anchor = p_opposite_anchor;
+ dist_min = dist;
+ snapped = true;
+ }
+ }
+ if (p_snapped)
+ *p_snapped = snapped;
+ return p_anchor;
+}
+
+Vector2 CanvasItemEditor::_anchor_to_position(Control *p_control, Vector2 anchor) {
+ ERR_FAIL_COND_V(!p_control, Vector2());
+
+ Transform2D parent_transform = p_control->get_transform().affine_inverse();
+ Size2 parent_size = p_control->get_parent_area_size();
+
+ return parent_transform.xform(Vector2(parent_size.x * anchor.x, parent_size.y * anchor.y));
+}
+
+Vector2 CanvasItemEditor::_position_to_anchor(Control *p_control, Vector2 position) {
+ ERR_FAIL_COND_V(!p_control, Vector2());
+ Size2 parent_size = p_control->get_parent_area_size();
+
+ return p_control->get_transform().xform(position) / parent_size;
+}
+
+CanvasItemEditor::DragType CanvasItemEditor::_get_anchor_handle_drag_type(const Point2 &p_click, Vector2 &r_point) {
+ // Returns a drag type if an anchor handle is clicked
+ CanvasItem *canvas_item = get_single_item();
+ ERR_FAIL_COND_V(!canvas_item, DRAG_NONE);
+
+ Control *control = canvas_item->cast_to<Control>();
+ ERR_FAIL_COND_V(!control, DRAG_NONE);
+
+ Vector2 anchor_pos[4];
+ anchor_pos[0] = Vector2(control->get_anchor(MARGIN_LEFT), control->get_anchor(MARGIN_TOP));
+ anchor_pos[1] = Vector2(control->get_anchor(MARGIN_RIGHT), control->get_anchor(MARGIN_TOP));
+ anchor_pos[2] = Vector2(control->get_anchor(MARGIN_RIGHT), control->get_anchor(MARGIN_BOTTOM));
+ anchor_pos[3] = Vector2(control->get_anchor(MARGIN_LEFT), control->get_anchor(MARGIN_BOTTOM));
+
+ Rect2 anchor_rects[4];
+ for (int i = 0; i < 4; i++) {
+ anchor_pos[i] = (transform * control->get_global_transform_with_canvas()).xform(_anchor_to_position(control, anchor_pos[i]));
+ anchor_rects[i] = Rect2(anchor_pos[i], anchor_handle->get_size());
+ anchor_rects[i].position -= anchor_handle->get_size() * Vector2(i == 0 || i == 3, i <= 1);
+ }
+
+ DragType dragger[] = {
+ DRAG_ANCHOR_TOP_LEFT,
+ DRAG_ANCHOR_TOP_RIGHT,
+ DRAG_ANCHOR_BOTTOM_RIGHT,
+ DRAG_ANCHOR_BOTTOM_LEFT,
+ };
+
+ for (int i = 0; i < 4; i++) {
+ if (anchor_rects[i].has_point(p_click)) {
+ r_point = transform.affine_inverse().xform(anchor_pos[i]);
+ if ((anchor_pos[0] == anchor_pos[2]) && (anchor_pos[0].distance_to(p_click) < anchor_handle->get_size().length() / 3.0)) {
+ return DRAG_ANCHOR_ALL;
+ } else {
+ return dragger[i];
+ }
+ }
+ }
return DRAG_NONE;
}
@@ -839,6 +878,8 @@ void CanvasItemEditor::_prepare_drag(const Point2 &p_click_pos) {
se->undo_state = canvas_item->edit_get_state();
if (canvas_item->cast_to<Node2D>())
se->undo_pivot = canvas_item->cast_to<Node2D>()->edit_get_pivot();
+ if (canvas_item->cast_to<Control>())
+ se->undo_pivot = canvas_item->cast_to<Control>()->get_pivot_offset();
}
if (selection.size() == 1 && selection[0]->cast_to<Node2D>()) {
@@ -906,9 +947,9 @@ void CanvasItemEditor::incend(float &beg, float &end, float inc, float minsize,
}
}
-void CanvasItemEditor::_append_canvas_item(CanvasItem *c) {
+void CanvasItemEditor::_append_canvas_item(CanvasItem *p_item) {
- editor_selection->add_node(c);
+ editor_selection->add_node(p_item);
}
void CanvasItemEditor::_snap_changed() {
@@ -942,7 +983,7 @@ void CanvasItemEditor::_selection_result_pressed(int p_result) {
CanvasItem *item = selection_results[p_result].item;
if (item)
- _select(item, Point2(), additive_selection, false);
+ _select_click_on_item(item, Point2(), additive_selection, false);
}
void CanvasItemEditor::_selection_menu_hide() {
@@ -957,9 +998,9 @@ bool CanvasItemEditor::get_remove_list(List<Node *> *p_list) {
return false; //!p_list->empty();
}
-void CanvasItemEditor::_list_select(const InputEventMouseButton &b) {
+void CanvasItemEditor::_list_select(const Ref<InputEventMouseButton> &b) {
- Point2 click = Point2(b.x, b.y);
+ Point2 click = b->get_position();
Node *scene = editor->get_edited_scene();
if (!scene)
@@ -981,8 +1022,9 @@ void CanvasItemEditor::_list_select(const InputEventMouseButton &b) {
CanvasItem *item = selection_results[0].item;
selection_results.clear();
- additive_selection = b.mod.shift;
- if (!_select(item, click, additive_selection, false))
+ additive_selection = b->get_shift();
+
+ if (!_select_click_on_item(item, click, additive_selection, false))
return;
} else if (!selection_results.empty()) {
@@ -1007,13 +1049,12 @@ void CanvasItemEditor::_list_select(const InputEventMouseButton &b) {
selection_menu->add_item(item->get_name());
selection_menu->set_item_icon(i, icon);
selection_menu->set_item_metadata(i, node_path);
- selection_menu->set_item_tooltip(i, String(item->get_name()) +
- "\nType: " + item->get_class() + "\nPath: " + node_path);
+ selection_menu->set_item_tooltip(i, String(item->get_name()) + "\nType: " + item->get_class() + "\nPath: " + node_path);
}
- additive_selection = b.mod.shift;
+ additive_selection = b->get_shift();
- selection_menu->set_global_pos(Vector2(b.global_x, b.global_y));
+ selection_menu->set_global_position(b->get_global_position());
selection_menu->popup();
selection_menu->call_deferred("grab_click_focus");
selection_menu->set_invalidate_click_until_motion();
@@ -1022,10 +1063,9 @@ void CanvasItemEditor::_list_select(const InputEventMouseButton &b) {
}
}
-void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
+void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
{
-
EditorNode *en = editor;
EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
@@ -1038,40 +1078,53 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
}
}
- if (p_event.type == InputEvent::MOUSE_BUTTON) {
+ Ref<InputEventMouseButton> b = p_event;
+ if (b.is_valid()) {
+ // Button event
- const InputEventMouseButton &b = p_event.mouse_button;
+ if (b->get_button_index() == BUTTON_WHEEL_DOWN) {
+ // Scroll or pan down
+ if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) {
- if (b.button_index == BUTTON_WHEEL_DOWN) {
+ v_scroll->set_value(v_scroll->get_value() + int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor());
- if (zoom < MIN_ZOOM)
- return;
+ } else {
- float prev_zoom = zoom;
- zoom = zoom * 0.95;
- {
- Point2 ofs(b.x, b.y);
- ofs = ofs / prev_zoom - ofs / zoom;
- h_scroll->set_value(h_scroll->get_value() + ofs.x);
- v_scroll->set_value(v_scroll->get_value() + ofs.y);
+ if (zoom < MIN_ZOOM)
+ return;
+
+ float prev_zoom = zoom;
+ zoom = zoom * (1 - (0.05 * b->get_factor()));
+ {
+ Point2 ofs = b->get_position();
+ ofs = ofs / prev_zoom - ofs / zoom;
+ h_scroll->set_value(h_scroll->get_value() + ofs.x);
+ v_scroll->set_value(v_scroll->get_value() + ofs.y);
+ }
}
+
_update_scroll(0);
viewport->update();
return;
}
- if (b.button_index == BUTTON_WHEEL_UP) {
+ if (b->get_button_index() == BUTTON_WHEEL_UP) {
+ // Scroll or pan up
+ if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) {
- if (zoom > MAX_ZOOM)
- return;
+ v_scroll->set_value(v_scroll->get_value() - int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor());
- float prev_zoom = zoom;
- zoom = zoom * (1.0 / 0.95);
- {
- Point2 ofs(b.x, b.y);
- ofs = ofs / prev_zoom - ofs / zoom;
- h_scroll->set_value(h_scroll->get_value() + ofs.x);
- v_scroll->set_value(v_scroll->get_value() + ofs.y);
+ } else {
+ if (zoom > MAX_ZOOM) return;
+
+ float prev_zoom = zoom;
+ zoom = zoom * ((0.95 + (0.05 * b->get_factor())) / 0.95);
+ {
+ Point2 ofs = b->get_position();
+ ofs = ofs / prev_zoom - ofs / zoom;
+ h_scroll->set_value(h_scroll->get_value() + ofs.x);
+ v_scroll->set_value(v_scroll->get_value() + ofs.y);
+ }
}
_update_scroll(0);
@@ -1079,32 +1132,43 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
return;
}
- if (b.button_index == BUTTON_RIGHT) {
+ if (b->get_button_index() == BUTTON_WHEEL_LEFT) {
+ // Pan left
+ if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) {
+
+ h_scroll->set_value(h_scroll->get_value() - int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor());
+ }
+ }
- if (b.pressed && (tool == TOOL_SELECT && b.mod.alt)) {
+ if (b->get_button_index() == BUTTON_WHEEL_RIGHT) {
+ // Pan right
+ if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) {
+ h_scroll->set_value(h_scroll->get_value() + int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor());
+ }
+ }
+
+ if (b->get_button_index() == BUTTON_RIGHT) {
+
+ if (b->is_pressed() && (tool == TOOL_SELECT && b->get_alt())) {
+ // Open the selection list
_list_select(b);
return;
}
if (get_item_count() > 0 && drag != DRAG_NONE) {
- //cancel drag
-
+ // Cancel a drag
if (bone_ik_list.size()) {
-
for (List<BoneIK>::Element *E = bone_ik_list.back(); E; E = E->prev()) {
-
E->get().node->edit_set_state(E->get().orig_state);
}
bone_ik_list.clear();
} else {
-
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
-
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
@@ -1118,6 +1182,8 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
canvas_item->edit_set_state(se->undo_state);
if (canvas_item->cast_to<Node2D>())
canvas_item->cast_to<Node2D>()->edit_set_pivot(se->undo_pivot);
+ if (canvas_item->cast_to<Control>())
+ canvas_item->cast_to<Control>()->set_pivot_offset(se->undo_pivot);
}
}
@@ -1126,34 +1192,24 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
can_move_pivot = false;
} else if (box_selecting) {
+ // Cancel box selection
box_selecting = false;
viewport->update();
- } else if (b.pressed) {
-#if 0
- ref_item = NULL;
- Node* scene = get_scene()->get_root_node()->cast_to<EditorNode>()->get_edited_scene();
- if ( scene ) ref_item =_select_canvas_item_at_pos( Point2( b.x, b.y ), scene, transform );
-#endif
- //popup->set_pos(Point2(b.x,b.y));
- //popup->popup();
}
return;
}
- /*
- if (!canvas_items.size())
- return;
- */
- if (b.button_index == BUTTON_LEFT && tool == TOOL_LIST_SELECT) {
- if (b.pressed)
+ if (b->get_button_index() == BUTTON_LEFT && tool == TOOL_LIST_SELECT) {
+ if (b->is_pressed())
+ // Open the selection list
_list_select(b);
return;
}
- if (b.button_index == BUTTON_LEFT && tool == TOOL_EDIT_PIVOT) {
- if (b.pressed) {
-
- Point2 mouse_pos(b.x, b.y);
+ if (b->get_button_index() == BUTTON_LEFT && tool == TOOL_EDIT_PIVOT) {
+ if (b->is_pressed()) {
+ // Set the pivot point
+ Point2 mouse_pos = b->get_position();
mouse_pos = transform.affine_inverse().xform(mouse_pos);
mouse_pos = snap_point(mouse_pos);
_edit_set_pivot(mouse_pos);
@@ -1161,17 +1217,19 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
return;
}
- if (tool == TOOL_PAN || b.button_index != BUTTON_LEFT || Input::get_singleton()->is_key_pressed(KEY_SPACE))
+ if (tool == TOOL_PAN || b->get_button_index() != BUTTON_LEFT || Input::get_singleton()->is_key_pressed(KEY_SPACE))
+ // Pan the view
return;
- if (!b.pressed) {
+ // -- From now we consider that the button is BUTTON_LEFT --
- if (drag != DRAG_NONE) {
+ if (!b->is_pressed()) {
+ if (drag != DRAG_NONE) {
+ // Stop dragging
if (undo_redo) {
if (bone_ik_list.size()) {
-
undo_redo->create_action(TTR("Edit IK Chain"));
for (List<BoneIK>::Element *E = bone_ik_list.back(); E; E = E->prev()) {
@@ -1187,7 +1245,6 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
undo_redo->commit_action();
} else {
-
undo_redo->create_action(TTR("Edit CanvasItem"));
List<Node *> &selection = editor_selection->get_selected_node_list();
@@ -1207,12 +1264,18 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
Variant state = canvas_item->edit_get_state();
undo_redo->add_do_method(canvas_item, "edit_set_state", state);
undo_redo->add_undo_method(canvas_item, "edit_set_state", se->undo_state);
- if (canvas_item->cast_to<Node2D>()) {
+ {
Node2D *pvt = canvas_item->cast_to<Node2D>();
- if (pvt->edit_has_pivot()) {
+ if (pvt && pvt->edit_has_pivot()) {
undo_redo->add_do_method(canvas_item, "edit_set_pivot", pvt->edit_get_pivot());
undo_redo->add_undo_method(canvas_item, "edit_set_pivot", se->undo_pivot);
}
+
+ Control *cnt = canvas_item->cast_to<Control>();
+ if (cnt) {
+ undo_redo->add_do_method(canvas_item, "set_pivot_offset", cnt->get_pivot_offset());
+ undo_redo->add_undo_method(canvas_item, "set_pivot_offset", se->undo_pivot);
+ }
}
}
undo_redo->commit_action();
@@ -1225,11 +1288,7 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
}
if (box_selecting) {
-#if 0
- if ( ! b.mod.shift ) _clear_canvas_items();
- if ( box_selection_end() ) return;
-#endif
-
+ // Stop box selection
Node *scene = editor->get_edited_scene();
if (scene) {
@@ -1256,6 +1315,8 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
return;
}
+ // -- From now we consider that the button is BUTTON_LEFT and that it is pressed --
+
Map<ObjectID, BoneList>::Element *Cbone = NULL; //closest
{
@@ -1271,8 +1332,8 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
E->get().to
};
- Vector2 p = Geometry::get_closest_point_to_segment_2d(Vector2(b.x, b.y), s);
- float d = p.distance_to(Vector2(b.x, b.y));
+ Vector2 p = Geometry::get_closest_point_to_segment_2d(b->get_position(), s);
+ float d = p.distance_to(b->get_position());
if (d < bone_width && d < closest_dist) {
Cbone = E;
closest_dist = d;
@@ -1288,6 +1349,7 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
if (b) {
bool ik_found = false;
+
bool first = true;
while (b) {
@@ -1330,93 +1392,89 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
}
}
- CanvasItem *single_item = get_single_item();
-
- if (single_item) {
- //try single canvas_item edit
-
- CanvasItem *canvas_item = single_item;
+ // Single selected item
+ CanvasItem *canvas_item = get_single_item();
+ if (canvas_item) {
CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
ERR_FAIL_COND(!se);
- Point2 click(b.x, b.y);
-
- if ((b.mod.control && tool == TOOL_SELECT) || tool == TOOL_ROTATE) {
+ Point2 click = b->get_position();
+ // Rotation
+ if ((b->get_control() && tool == TOOL_SELECT) || tool == TOOL_ROTATE) {
drag = DRAG_ROTATE;
drag_from = transform.affine_inverse().xform(click);
se->undo_state = canvas_item->edit_get_state();
if (canvas_item->cast_to<Node2D>())
se->undo_pivot = canvas_item->cast_to<Node2D>()->edit_get_pivot();
if (canvas_item->cast_to<Control>())
- se->undo_pivot = Vector2();
+ se->undo_pivot = canvas_item->cast_to<Control>()->get_pivot_offset();
return;
}
- Transform2D xform = transform * canvas_item->get_global_transform_with_canvas();
- Rect2 rect = canvas_item->get_item_rect();
- //float handle_radius = handle_len * 1.4144; //magic number, guess what it means!
-
if (tool == TOOL_SELECT) {
- drag = _find_drag_type(xform, rect, click, drag_point_from);
-
- if (b.doubleclick) {
-
+ // Open a sub-scene on double-click
+ if (b->is_doubleclick()) {
if (canvas_item->get_filename() != "" && canvas_item != editor->get_edited_scene()) {
-
editor->open_request(canvas_item->get_filename());
return;
}
}
- if (drag != DRAG_NONE && (!Cbone || drag != DRAG_ALL)) {
+ // Drag resize handles
+ drag = _get_resize_handle_drag_type(click, drag_point_from);
+ if (drag != DRAG_NONE) {
drag_from = transform.affine_inverse().xform(click);
se->undo_state = canvas_item->edit_get_state();
if (canvas_item->cast_to<Node2D>())
se->undo_pivot = canvas_item->cast_to<Node2D>()->edit_get_pivot();
-
+ if (canvas_item->cast_to<Control>())
+ se->undo_pivot = canvas_item->cast_to<Control>()->get_pivot_offset();
return;
}
- } else {
- drag = DRAG_NONE;
+ // Drag anchor handles
+ if (canvas_item->cast_to<Control>()) {
+ drag = _get_anchor_handle_drag_type(click, drag_point_from);
+ if (drag != DRAG_NONE) {
+ drag_from = transform.affine_inverse().xform(click);
+ se->undo_state = canvas_item->edit_get_state();
+ return;
+ }
+ }
}
}
- //multi canvas_item edit
+ // Multiple selected items
+ Point2 click = b->get_position();
- Point2 click = Point2(b.x, b.y);
-
- if ((b.mod.alt || tool == TOOL_MOVE) && get_item_count()) {
+ if ((b->get_alt() || tool == TOOL_MOVE) && get_item_count()) {
+ // Drag the nodes
_prepare_drag(click);
viewport->update();
return;
}
- Node *scene = editor->get_edited_scene();
- if (!scene)
- return;
-
- /*
- if (current_window) {
- //no window.... ?
- click-=current_window->get_scroll();
- }*/
CanvasItem *c = NULL;
-
if (Cbone) {
-
Object *obj = ObjectDB::get_instance(Cbone->get().bone);
if (obj)
c = obj->cast_to<CanvasItem>();
if (c)
c = c->get_parent_item();
}
+
+ Node *scene = editor->get_edited_scene();
+ if (!scene)
+ return;
+ // Find the item to select
if (!c) {
- c = _select_canvas_item_at_pos(click, scene, transform, Transform2D());
+ Vector<_SelectResult> selection;
+ _find_canvas_items_at_pos(click, scene, transform, Transform2D(), selection, 1);
+ if (!selection.empty())
+ c = selection[0].item;
CanvasItem *cn = c;
-
while (cn) {
if (cn->has_meta("_edit_group_")) {
c = cn;
@@ -1426,43 +1484,47 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
}
Node *n = c;
-
while ((n && n != scene && n->get_owner() != scene) || (n && !n->is_class("CanvasItem"))) {
n = n->get_parent();
};
- c = n->cast_to<CanvasItem>();
-#if 0
- if ( b.pressed ) box_selection_start( click );
-#endif
- additive_selection = b.mod.shift;
- if (!_select(c, click, additive_selection))
+ if (n) {
+ c = n->cast_to<CanvasItem>();
+ } else {
+ c = NULL;
+ }
+
+ // Select the item
+ additive_selection = b->get_shift();
+ if (!c) {
+ _select_click_on_empty_area(click, additive_selection, true);
+ } else if (!_select_click_on_item(c, click, additive_selection, true)) {
return;
+ }
}
- if (p_event.type == InputEvent::MOUSE_MOTION) {
+ Ref<InputEventMouseMotion> m = p_event;
+ if (m.is_valid()) {
+ // Mouse motion event
if (!viewport->has_focus() && (!get_focus_owner() || !get_focus_owner()->is_text_field()))
viewport->call_deferred("grab_focus");
- const InputEventMouseMotion &m = p_event.mouse_motion;
-
if (box_selecting) {
-
- box_selecting_to = transform.affine_inverse().xform(Point2(m.x, m.y));
+ // Update box selection
+ box_selecting_to = transform.affine_inverse().xform(m->get_position());
viewport->update();
return;
}
if (drag == DRAG_NONE) {
-
- if ((m.button_mask & BUTTON_MASK_LEFT && tool == TOOL_PAN) || m.button_mask & BUTTON_MASK_MIDDLE || (m.button_mask & BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE))) {
-
+ if ((m->get_button_mask() & BUTTON_MASK_LEFT && tool == TOOL_PAN) || m->get_button_mask() & BUTTON_MASK_MIDDLE || (m->get_button_mask() & BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE))) {
+ // Pan the viewport
Point2i relative;
if (bool(EditorSettings::get_singleton()->get("editors/2d/warped_mouse_panning"))) {
relative = Input::get_singleton()->warp_mouse_motion(m, viewport->get_global_rect());
} else {
- relative = Point2i(m.relative_x, m.relative_y);
+ relative = m->get_relative();
}
h_scroll->set_value(h_scroll->get_value() - relative.x / zoom);
@@ -1473,7 +1535,6 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
}
List<Node *> &selection = editor_selection->get_selected_node_list();
-
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
@@ -1492,15 +1553,17 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
canvas_item->edit_set_state(se->undo_state); //reset state and reapply
if (canvas_item->cast_to<Node2D>())
canvas_item->cast_to<Node2D>()->edit_set_pivot(se->undo_pivot);
+ if (canvas_item->cast_to<Control>())
+ canvas_item->cast_to<Control>()->set_pivot_offset(se->undo_pivot);
}
Vector2 dfrom = drag_from;
- Vector2 dto = transform.affine_inverse().xform(Point2(m.x, m.y));
+ Vector2 dto = transform.affine_inverse().xform(m->get_position());
if (canvas_item->has_meta("_edit_lock_"))
continue;
if (drag == DRAG_ROTATE) {
-
+ // Rotate the node
Vector2 center = canvas_item->get_global_transform_with_canvas().get_origin();
{
Node2D *node = canvas_item->cast_to<Node2D>();
@@ -1529,12 +1592,49 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
continue;
}
- bool uniform = m.mod.shift;
- bool symmetric = m.mod.alt;
+ Control *control = canvas_item->cast_to<Control>();
+ if (control) {
+ // Drag and snap the anchor
+ Vector2 anchor = _position_to_anchor(control, canvas_item->get_global_transform_with_canvas().affine_inverse().xform(dto - drag_from + drag_point_from));
+
+ switch (drag) {
+ case DRAG_ANCHOR_TOP_LEFT:
+ control->set_anchor(MARGIN_LEFT, _anchor_snap(anchor.x, NULL, control->get_anchor(MARGIN_RIGHT)), false, false);
+ control->set_anchor(MARGIN_TOP, _anchor_snap(anchor.y, NULL, control->get_anchor(MARGIN_BOTTOM)), false, false);
+ continue;
+ break;
+ case DRAG_ANCHOR_TOP_RIGHT:
+ control->set_anchor(MARGIN_RIGHT, _anchor_snap(anchor.x, NULL, control->get_anchor(MARGIN_LEFT)), false, false);
+ control->set_anchor(MARGIN_TOP, _anchor_snap(anchor.y, NULL, control->get_anchor(MARGIN_BOTTOM)), false, false);
+ continue;
+ break;
+ case DRAG_ANCHOR_BOTTOM_RIGHT:
+ control->set_anchor(MARGIN_RIGHT, _anchor_snap(anchor.x, NULL, control->get_anchor(MARGIN_LEFT)), false, false);
+ control->set_anchor(MARGIN_BOTTOM, _anchor_snap(anchor.y, NULL, control->get_anchor(MARGIN_TOP)), false, false);
+ continue;
+ break;
+ case DRAG_ANCHOR_BOTTOM_LEFT:
+ control->set_anchor(MARGIN_LEFT, _anchor_snap(anchor.x, NULL, control->get_anchor(MARGIN_RIGHT)), false, false);
+ control->set_anchor(MARGIN_BOTTOM, _anchor_snap(anchor.y, NULL, control->get_anchor(MARGIN_TOP)), false, false);
+ continue;
+ break;
+ case DRAG_ANCHOR_ALL:
+ control->set_anchor(MARGIN_LEFT, _anchor_snap(anchor.x));
+ control->set_anchor(MARGIN_RIGHT, _anchor_snap(anchor.x));
+ control->set_anchor(MARGIN_TOP, _anchor_snap(anchor.y));
+ control->set_anchor(MARGIN_BOTTOM, _anchor_snap(anchor.y));
+ continue;
+ break;
+ }
+ }
+
+ bool uniform = m->get_shift();
+ bool symmetric = m->get_alt();
- dto = dto - (drag == DRAG_ALL || drag == DRAG_NODE_2D ? drag_from - drag_point_from : Vector2(0, 0));
+ if (drag == DRAG_ALL || drag == DRAG_NODE_2D)
+ dto -= drag_from - drag_point_from;
- if (uniform && drag == DRAG_ALL) {
+ if (uniform && (drag == DRAG_ALL || drag == DRAG_NODE_2D)) {
if (ABS(dto.x - drag_point_from.x) > ABS(dto.y - drag_point_from.y)) {
dto.y = drag_point_from.y;
} else {
@@ -1550,100 +1650,104 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
canvas_item->get_global_transform_with_canvas().affine_inverse().xform(dfrom);
Rect2 local_rect = canvas_item->get_item_rect();
- Vector2 begin = local_rect.pos;
- Vector2 end = local_rect.pos + local_rect.size;
+ Vector2 begin = local_rect.position;
+ Vector2 end = local_rect.position + local_rect.size;
Vector2 minsize = canvas_item->edit_get_minimum_size();
if (uniform) {
+ // Keep the height/width ratio of the item
float aspect = local_rect.size.aspect();
switch (drag) {
+ case DRAG_LEFT:
+ drag_vector.y = -drag_vector.x / aspect;
+ break;
+ case DRAG_RIGHT:
+ drag_vector.y = drag_vector.x / aspect;
+ break;
+ case DRAG_TOP:
+ drag_vector.x = -drag_vector.y * aspect;
+ break;
+ case DRAG_BOTTOM:
+ drag_vector.x = drag_vector.y * aspect;
+ break;
case DRAG_BOTTOM_LEFT:
- case DRAG_TOP_RIGHT: {
+ case DRAG_TOP_RIGHT:
if (aspect > 1.0) { // width > height, take x as reference
drag_vector.y = -drag_vector.x / aspect;
} else { // height > width, take y as reference
drag_vector.x = -drag_vector.y * aspect;
}
- } break;
+ break;
case DRAG_BOTTOM_RIGHT:
- case DRAG_TOP_LEFT: {
+ case DRAG_TOP_LEFT:
if (aspect > 1.0) { // width > height, take x as reference
drag_vector.y = drag_vector.x / aspect;
} else { // height > width, take y as reference
drag_vector.x = drag_vector.y * aspect;
}
- } break;
- default: {}
+ break;
+ }
+ } else {
+ switch (drag) {
+ case DRAG_RIGHT:
+ case DRAG_LEFT:
+ drag_vector.y = 0;
+ break;
+ case DRAG_TOP:
+ case DRAG_BOTTOM:
+ drag_vector.x = 0;
+ break;
}
}
switch (drag) {
- case DRAG_ALL: {
+ case DRAG_ALL:
begin += drag_vector;
end += drag_vector;
- } break;
- case DRAG_RIGHT: {
-
- incend(begin.x, end.x, drag_vector.x, minsize.x, symmetric);
-
- } break;
- case DRAG_BOTTOM: {
-
- incend(begin.y, end.y, drag_vector.y, minsize.y, symmetric);
-
- } break;
- case DRAG_BOTTOM_RIGHT: {
-
+ break;
+ case DRAG_RIGHT:
+ case DRAG_BOTTOM:
+ case DRAG_BOTTOM_RIGHT:
incend(begin.x, end.x, drag_vector.x, minsize.x, symmetric);
incend(begin.y, end.y, drag_vector.y, minsize.y, symmetric);
- } break;
- case DRAG_TOP_LEFT: {
-
+ break;
+ case DRAG_TOP_LEFT:
incbeg(begin.x, end.x, drag_vector.x, minsize.x, symmetric);
incbeg(begin.y, end.y, drag_vector.y, minsize.y, symmetric);
- } break;
- case DRAG_TOP: {
-
- incbeg(begin.y, end.y, drag_vector.y, minsize.y, symmetric);
-
- } break;
- case DRAG_LEFT: {
-
- incbeg(begin.x, end.x, drag_vector.x, minsize.x, symmetric);
-
- } break;
- case DRAG_TOP_RIGHT: {
-
+ break;
+ case DRAG_TOP:
+ case DRAG_TOP_RIGHT:
incbeg(begin.y, end.y, drag_vector.y, minsize.y, symmetric);
incend(begin.x, end.x, drag_vector.x, minsize.x, symmetric);
-
- } break;
- case DRAG_BOTTOM_LEFT: {
-
+ break;
+ case DRAG_LEFT:
+ case DRAG_BOTTOM_LEFT:
incbeg(begin.x, end.x, drag_vector.x, minsize.x, symmetric);
incend(begin.y, end.y, drag_vector.y, minsize.y, symmetric);
- } break;
- case DRAG_PIVOT: {
+ break;
+
+ case DRAG_PIVOT:
if (canvas_item->cast_to<Node2D>()) {
Node2D *n2d = canvas_item->cast_to<Node2D>();
n2d->edit_set_pivot(se->undo_pivot + drag_vector);
}
+ if (canvas_item->cast_to<Control>()) {
+ canvas_item->cast_to<Control>()->set_pivot_offset(se->undo_pivot + drag_vector);
+ }
continue;
- } break;
- case DRAG_NODE_2D: {
+ break;
+ case DRAG_NODE_2D:
ERR_FAIL_COND(!canvas_item->cast_to<Node2D>());
canvas_item->cast_to<Node2D>()->set_global_position(dto);
continue;
- } break;
-
- default: {}
+ break;
}
if (!dragging_bone) {
- local_rect.pos = begin;
+ local_rect.position = begin;
local_rect.size = end - begin;
canvas_item->edit_set_rect(local_rect);
@@ -1764,25 +1868,23 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
}
}
- if (p_event.type == InputEvent::KEY) {
-
- const InputEventKey &k = p_event.key;
-
- if (k.pressed && drag == DRAG_NONE) {
-
+ Ref<InputEventKey> k = p_event;
+ if (k.is_valid()) {
+ if (k->is_pressed() && drag == DRAG_NONE) {
+ // Move the object with the arrow keys
KeyMoveMODE move_mode = MOVE_VIEW_BASE;
- if (k.mod.alt) move_mode = MOVE_LOCAL_BASE;
- if (k.mod.control || k.mod.meta) move_mode = MOVE_LOCAL_WITH_ROT;
-
- if (k.scancode == KEY_UP)
- _key_move(Vector2(0, -1), k.mod.shift, move_mode);
- else if (k.scancode == KEY_DOWN)
- _key_move(Vector2(0, 1), k.mod.shift, move_mode);
- else if (k.scancode == KEY_LEFT)
- _key_move(Vector2(-1, 0), k.mod.shift, move_mode);
- else if (k.scancode == KEY_RIGHT)
- _key_move(Vector2(1, 0), k.mod.shift, move_mode);
- else if (k.scancode == KEY_ESCAPE) {
+ if (k->get_alt()) move_mode = MOVE_LOCAL_BASE;
+ if (k->get_control() || k->get_metakey()) move_mode = MOVE_LOCAL_WITH_ROT;
+
+ if (k->get_scancode() == KEY_UP)
+ _key_move(Vector2(0, -1), k->get_shift(), move_mode);
+ else if (k->get_scancode() == KEY_DOWN)
+ _key_move(Vector2(0, 1), k->get_shift(), move_mode);
+ else if (k->get_scancode() == KEY_LEFT)
+ _key_move(Vector2(-1, 0), k->get_shift(), move_mode);
+ else if (k->get_scancode() == KEY_RIGHT)
+ _key_move(Vector2(1, 0), k->get_shift(), move_mode);
+ else if (k->get_scancode() == KEY_ESCAPE) {
editor_selection->clear();
viewport->update();
} else
@@ -1793,6 +1895,30 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent &p_event) {
}
}
+void CanvasItemEditor::_draw_percentage_at_position(float p_value, Point2 p_position, Margin p_side) {
+ if (p_value != 0) {
+ Color color = Color(0.8, 0.8, 0.8, 0.5);
+ Ref<Font> font = get_font("font", "Label");
+ String str = vformat("%.1f %%", p_value * 100.0);
+ Size2 text_size = font->get_string_size(str);
+ switch (p_side) {
+ case MARGIN_LEFT:
+ p_position += Vector2(-text_size.x - 5, text_size.y / 2);
+ break;
+ case MARGIN_TOP:
+ p_position += Vector2(-text_size.x / 2, -5);
+ break;
+ case MARGIN_RIGHT:
+ p_position += Vector2(5, text_size.y / 2);
+ break;
+ case MARGIN_BOTTOM:
+ p_position += Vector2(-text_size.x / 2, text_size.y + 5);
+ break;
+ }
+ viewport->draw_string(font, p_position, str, color);
+ }
+}
+
void CanvasItemEditor::_viewport_draw() {
// TODO fetch the viewport?
@@ -1802,13 +1928,23 @@ void CanvasItemEditor::_viewport_draw() {
RID ci = viewport->get_canvas_item();
if (snap_show_grid) {
+ //Draw the grid
Size2 s = viewport->get_size();
int last_cell;
Transform2D xform = transform.affine_inverse();
+ Vector2 grid_offset;
+ if (snap_relative && snap_grid && get_item_count() > 0) {
+ Vector2 topleft = _find_topleftmost_point();
+ grid_offset.x = fmod(topleft.x, snap_step.x);
+ grid_offset.y = fmod(topleft.y, snap_step.y);
+ } else {
+ grid_offset = snap_offset;
+ }
+
if (snap_step.x != 0) {
for (int i = 0; i < s.width; i++) {
- int cell = Math::fast_ftoi(Math::floor((xform.xform(Vector2(i, 0)).x - snap_offset.x) / snap_step.x));
+ int cell = Math::fast_ftoi(Math::floor((xform.xform(Vector2(i, 0)).x - grid_offset.x) / snap_step.x));
if (i == 0)
last_cell = cell;
if (last_cell != cell)
@@ -1819,7 +1955,7 @@ void CanvasItemEditor::_viewport_draw() {
if (snap_step.y != 0) {
for (int i = 0; i < s.height; i++) {
- int cell = Math::fast_ftoi(Math::floor((xform.xform(Vector2(0, i)).y - snap_offset.y) / snap_step.y));
+ int cell = Math::fast_ftoi(Math::floor((xform.xform(Vector2(0, i)).y - grid_offset.y) / snap_step.y));
if (i == 0)
last_cell = cell;
if (last_cell != cell)
@@ -1831,12 +1967,7 @@ void CanvasItemEditor::_viewport_draw() {
if (viewport->has_focus()) {
Size2 size = viewport->get_size();
- if (v_scroll->is_visible_in_tree())
- size.width -= v_scroll->get_size().width;
- if (h_scroll->is_visible_in_tree())
- size.height -= h_scroll->get_size().height;
-
- get_stylebox("EditorFocus", "EditorStyles")->draw(ci, Rect2(Point2(), size));
+ get_stylebox("Focus", "EditorStyles")->draw(ci, Rect2(Point2(), size));
}
Ref<Texture> lock = get_icon("Lock", "EditorIcons");
@@ -1866,10 +1997,10 @@ void CanvasItemEditor::_viewport_draw() {
Vector2 endpoints[4] = {
- xform.xform(rect.pos),
- xform.xform(rect.pos + Vector2(rect.size.x, 0)),
- xform.xform(rect.pos + rect.size),
- xform.xform(rect.pos + Vector2(0, rect.size.y))
+ xform.xform(rect.position),
+ xform.xform(rect.position + Vector2(rect.size.x, 0)),
+ xform.xform(rect.position + rect.size),
+ xform.xform(rect.position + Vector2(0, rect.size.y))
};
Color c = Color(1, 0.6, 0.4, 0.7);
@@ -1891,6 +2022,100 @@ void CanvasItemEditor::_viewport_draw() {
}
}
+ Control *control = canvas_item->cast_to<Control>();
+ if (control) {
+ Vector2 pivot_ofs = control->get_pivot_offset();
+ if (pivot_ofs != Vector2()) {
+ viewport->draw_texture(pivot, xform.xform(pivot_ofs) + (-pivot->get_size() / 2).floor());
+ }
+ can_move_pivot = true;
+ pivot_found = true;
+
+ if (tool == TOOL_SELECT) {
+ float anchors_values[4];
+ anchors_values[0] = control->get_anchor(MARGIN_LEFT);
+ anchors_values[1] = control->get_anchor(MARGIN_TOP);
+ anchors_values[2] = control->get_anchor(MARGIN_RIGHT);
+ anchors_values[3] = control->get_anchor(MARGIN_BOTTOM);
+
+ // Draw the anchors
+ Vector2 anchors[4];
+ Vector2 anchors_pos[4];
+ for (int i = 0; i < 4; i++) {
+ anchors[i] = Vector2((i % 2 == 0) ? anchors_values[i] : anchors_values[(i + 1) % 4], (i % 2 == 1) ? anchors_values[i] : anchors_values[(i + 1) % 4]);
+ anchors_pos[i] = xform.xform(_anchor_to_position(control, anchors[i]));
+ }
+
+ // Get which anchor is dragged
+ int dragged_anchor = -1;
+ switch (drag) {
+ case DRAG_ANCHOR_ALL:
+ case DRAG_ANCHOR_TOP_LEFT:
+ dragged_anchor = 0;
+ break;
+ case DRAG_ANCHOR_TOP_RIGHT:
+ dragged_anchor = 1;
+ break;
+ case DRAG_ANCHOR_BOTTOM_RIGHT:
+ dragged_anchor = 2;
+ break;
+ case DRAG_ANCHOR_BOTTOM_LEFT:
+ dragged_anchor = 3;
+ break;
+ }
+
+ if (dragged_anchor >= 0) {
+ // Draw the 4 lines when dragged
+ bool snapped;
+ Color color_snapped = Color(0.64, 0.93, 0.67, 0.5);
+ Color color_base = Color(0.8, 0.8, 0.8, 0.5);
+
+ Vector2 corners_pos[4];
+ for (int i = 0; i < 4; i++) {
+ corners_pos[i] = xform.xform(_anchor_to_position(control, Vector2((i == 0 || i == 3) ? ANCHOR_BEGIN : ANCHOR_END, (i <= 1) ? ANCHOR_BEGIN : ANCHOR_END)));
+ }
+
+ Vector2 line_starts[4];
+ Vector2 line_ends[4];
+ for (int i = 0; i < 4; i++) {
+ float anchor_val = (i >= 2) ? ANCHOR_END - anchors_values[i] : anchors_values[i];
+ line_starts[i] = Vector2::linear_interpolate(corners_pos[i], corners_pos[(i + 1) % 4], anchor_val);
+ line_ends[i] = Vector2::linear_interpolate(corners_pos[(i + 3) % 4], corners_pos[(i + 2) % 4], anchor_val);
+ _anchor_snap(anchors_values[i], &snapped);
+ viewport->draw_line(line_starts[i], line_ends[i], snapped ? color_snapped : color_base, (i == dragged_anchor || (i + 3) % 4 == dragged_anchor) ? 2 : 1);
+ }
+
+ // Display the percentages next to the lines
+ float percent_val;
+ percent_val = anchors_values[(dragged_anchor + 2) % 4] - anchors_values[dragged_anchor];
+ percent_val = (dragged_anchor >= 2) ? -percent_val : percent_val;
+ _draw_percentage_at_position(percent_val, (anchors_pos[dragged_anchor] + anchors_pos[(dragged_anchor + 1) % 4]) / 2, (Margin)((dragged_anchor + 1) % 4));
+
+ percent_val = anchors_values[(dragged_anchor + 3) % 4] - anchors_values[(dragged_anchor + 1) % 4];
+ percent_val = ((dragged_anchor + 1) % 4 >= 2) ? -percent_val : percent_val;
+ _draw_percentage_at_position(percent_val, (anchors_pos[dragged_anchor] + anchors_pos[(dragged_anchor + 3) % 4]) / 2, (Margin)(dragged_anchor));
+
+ percent_val = anchors_values[(dragged_anchor + 1) % 4];
+ percent_val = ((dragged_anchor + 1) % 4 >= 2) ? ANCHOR_END - percent_val : percent_val;
+ _draw_percentage_at_position(percent_val, (line_starts[dragged_anchor] + anchors_pos[dragged_anchor]) / 2, (Margin)(dragged_anchor));
+
+ percent_val = anchors_values[dragged_anchor];
+ percent_val = (dragged_anchor >= 2) ? ANCHOR_END - percent_val : percent_val;
+ _draw_percentage_at_position(percent_val, (line_ends[(dragged_anchor + 1) % 4] + anchors_pos[dragged_anchor]) / 2, (Margin)((dragged_anchor + 1) % 4));
+ }
+
+ Rect2 anchor_rects[4];
+ anchor_rects[0] = Rect2(anchors_pos[0] - anchor_handle->get_size(), anchor_handle->get_size());
+ anchor_rects[1] = Rect2(anchors_pos[1] - Vector2(0.0, anchor_handle->get_size().y), Point2(-anchor_handle->get_size().x, anchor_handle->get_size().y));
+ anchor_rects[2] = Rect2(anchors_pos[2], -anchor_handle->get_size());
+ anchor_rects[3] = Rect2(anchors_pos[3] - Vector2(anchor_handle->get_size().x, 0.0), Point2(anchor_handle->get_size().x, -anchor_handle->get_size().y));
+
+ for (int i = 0; i < 4; i++) {
+ anchor_handle->draw_rect(ci, anchor_rects[i]);
+ }
+ }
+ }
+
if (tool == TOOL_SELECT) {
for (int i = 0; i < 4; i++) {
@@ -1938,7 +2163,7 @@ void CanvasItemEditor::_viewport_draw() {
VisualServer::get_singleton()->canvas_item_add_line(ci, transform.xform(display_rotate_from), transform.xform(display_rotate_to), rotate_color);
}
- Size2 screen_size = Size2(GlobalConfig::get_singleton()->get("display/window/width"), GlobalConfig::get_singleton()->get("display/window/height"));
+ Size2 screen_size = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"));
Vector2 screen_endpoints[4] = {
transform.xform(Vector2(0, 0)),
@@ -2075,23 +2300,34 @@ void CanvasItemEditor::_notification(int p_what) {
continue;
Rect2 r = canvas_item->get_item_rect();
-
Transform2D xform = canvas_item->get_transform();
- if (r != se->prev_rect || xform != se->prev_xform) {
+ float anchors[4];
+ Vector2 pivot;
+ if (canvas_item->cast_to<Control>()) {
+ pivot = canvas_item->cast_to<Control>()->get_pivot_offset();
+ anchors[MARGIN_LEFT] = canvas_item->cast_to<Control>()->get_anchor(MARGIN_LEFT);
+ anchors[MARGIN_RIGHT] = canvas_item->cast_to<Control>()->get_anchor(MARGIN_RIGHT);
+ anchors[MARGIN_TOP] = canvas_item->cast_to<Control>()->get_anchor(MARGIN_TOP);
+ anchors[MARGIN_BOTTOM] = canvas_item->cast_to<Control>()->get_anchor(MARGIN_BOTTOM);
+ }
+
+ if (r != se->prev_rect || xform != se->prev_xform || pivot != se->prev_pivot || anchors[MARGIN_LEFT] != se->prev_anchors[MARGIN_LEFT] || anchors[MARGIN_RIGHT] != se->prev_anchors[MARGIN_RIGHT] || anchors[MARGIN_TOP] != se->prev_anchors[MARGIN_TOP] || anchors[MARGIN_BOTTOM] != se->prev_anchors[MARGIN_BOTTOM]) {
viewport->update();
se->prev_rect = r;
se->prev_xform = xform;
+ se->prev_pivot = pivot;
+ se->prev_anchors[MARGIN_LEFT] = anchors[MARGIN_LEFT];
+ se->prev_anchors[MARGIN_RIGHT] = anchors[MARGIN_RIGHT];
+ se->prev_anchors[MARGIN_TOP] = anchors[MARGIN_TOP];
+ se->prev_anchors[MARGIN_BOTTOM] = anchors[MARGIN_BOTTOM];
}
}
- bool show_anchor = all_control && has_control;
- if (show_anchor != anchor_menu->is_visible()) {
- if (show_anchor)
- anchor_menu->show();
- else
- anchor_menu->hide();
- }
+ if (all_control && has_control)
+ anchor_menu->show();
+ else
+ anchor_menu->hide();
for (Map<ObjectID, BoneList>::Element *E = bone_list.front(); E; E = E->next()) {
@@ -2130,6 +2366,7 @@ void CanvasItemEditor::_notification(int p_what) {
pan_button->set_icon(get_icon("ToolPan", "EditorIcons"));
pivot_button->set_icon(get_icon("EditPivot", "EditorIcons"));
select_handle = get_icon("EditorHandle", "EditorIcons");
+ anchor_handle = get_icon("EditorControlAnchor", "EditorIcons");
lock_button->set_icon(get_icon("Lock", "EditorIcons"));
unlock_button->set_icon(get_icon("Unlock", "EditorIcons"));
group_button->set_icon(get_icon("Group", "EditorIcons"));
@@ -2159,6 +2396,7 @@ void CanvasItemEditor::_notification(int p_what) {
p->add_icon_item(get_icon("ControlHcenterWide", "EditorIcons"), "HCenter Wide ", ANCHOR_ALIGN_HCENTER_WIDE);
p->add_separator();
p->add_icon_item(get_icon("ControlAlignWide", "EditorIcons"), "Full Rect", ANCHOR_ALIGN_WIDE);
+ p->add_icon_item(get_icon("ControlAlignWide", "EditorIcons"), "Full Rect and Fit Parent", ANCHOR_ALIGN_WIDE_FIT);
AnimationPlayerEditor::singleton->get_key_editor()->connect("visibility_changed", this, "_keying_changed");
_keying_changed();
@@ -2210,13 +2448,13 @@ void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2 &r_rect, cons
lock.group = c->has_meta("_edit_group_");
if (lock.group || lock.lock) {
- lock.pos = xform.xform(rect.pos);
+ lock.pos = xform.xform(rect.position);
lock_list.push_back(lock);
}
if (c->has_meta("_edit_bone_")) {
- ObjectID id = c->get_instance_ID();
+ ObjectID id = c->get_instance_id();
if (!bone_list.has(id)) {
BoneList bone;
bone.bone = id;
@@ -2226,10 +2464,10 @@ void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2 &r_rect, cons
bone_list[id].last_pass = bone_last_frame;
}
- r_rect.expand_to(xform.xform(rect.pos));
- r_rect.expand_to(xform.xform(rect.pos + Point2(rect.size.x, 0)));
- r_rect.expand_to(xform.xform(rect.pos + Point2(0, rect.size.y)));
- r_rect.expand_to(xform.xform(rect.pos + rect.size));
+ r_rect.expand_to(xform.xform(rect.position));
+ r_rect.expand_to(xform.xform(rect.position + Point2(rect.size.x, 0)));
+ r_rect.expand_to(xform.xform(rect.position + Point2(0, rect.size.y)));
+ r_rect.expand_to(xform.xform(rect.position + rect.size));
}
}
@@ -2247,7 +2485,7 @@ void CanvasItemEditor::_update_scrollbars() {
h_scroll->set_begin(Point2(0, size.height - hmin.height));
h_scroll->set_end(Point2(size.width - vmin.width, size.height));
- Size2 screen_rect = Size2(GlobalConfig::get_singleton()->get("display/window/width"), GlobalConfig::get_singleton()->get("display/window/height"));
+ Size2 screen_rect = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"));
Rect2 local_rect = Rect2(Point2(), viewport->get_size() - Size2(vmin.width, hmin.height));
@@ -2275,19 +2513,19 @@ void CanvasItemEditor::_update_scrollbars() {
//expand area so it's easier to do animations and stuff at 0,0
canvas_item_rect.size += screen_rect * 2;
- canvas_item_rect.pos -= screen_rect;
+ canvas_item_rect.position -= screen_rect;
Point2 ofs;
if (canvas_item_rect.size.height <= (local_rect.size.y / zoom)) {
v_scroll->hide();
- ofs.y = canvas_item_rect.pos.y;
+ ofs.y = canvas_item_rect.position.y;
} else {
v_scroll->show();
- v_scroll->set_min(canvas_item_rect.pos.y);
- v_scroll->set_max(canvas_item_rect.pos.y + canvas_item_rect.size.y);
+ v_scroll->set_min(canvas_item_rect.position.y);
+ v_scroll->set_max(canvas_item_rect.position.y + canvas_item_rect.size.y);
v_scroll->set_page(local_rect.size.y / zoom);
if (first_update) {
//so 0,0 is visible
@@ -2302,12 +2540,12 @@ void CanvasItemEditor::_update_scrollbars() {
if (canvas_item_rect.size.width <= (local_rect.size.x / zoom)) {
h_scroll->hide();
- ofs.x = canvas_item_rect.pos.x;
+ ofs.x = canvas_item_rect.position.x;
} else {
h_scroll->show();
- h_scroll->set_min(canvas_item_rect.pos.x);
- h_scroll->set_max(canvas_item_rect.pos.x + canvas_item_rect.size.x);
+ h_scroll->set_min(canvas_item_rect.position.x);
+ h_scroll->set_max(canvas_item_rect.position.x + canvas_item_rect.size.x);
h_scroll->set_page(local_rect.size.x / zoom);
ofs.x = h_scroll->get_value();
}
@@ -2343,7 +2581,7 @@ void CanvasItemEditor::_update_scroll(float) {
viewport->update();
}
-void CanvasItemEditor::_set_anchor(Control::AnchorType p_left, Control::AnchorType p_top, Control::AnchorType p_right, Control::AnchorType p_bottom) {
+void CanvasItemEditor::_set_anchors_preset(Control::LayoutPreset p_preset) {
List<Node *> &selection = editor_selection->get_selected_node_list();
undo_redo->create_action(TTR("Change Anchors"));
@@ -2351,10 +2589,7 @@ void CanvasItemEditor::_set_anchor(Control::AnchorType p_left, Control::AnchorTy
Control *c = E->get()->cast_to<Control>();
- undo_redo->add_do_method(c, "set_anchor", MARGIN_LEFT, p_left);
- undo_redo->add_do_method(c, "set_anchor", MARGIN_TOP, p_top);
- undo_redo->add_do_method(c, "set_anchor", MARGIN_RIGHT, p_right);
- undo_redo->add_do_method(c, "set_anchor", MARGIN_BOTTOM, p_bottom);
+ undo_redo->add_do_method(c, "set_anchors_preset", p_preset);
undo_redo->add_undo_method(c, "set_anchor", MARGIN_LEFT, c->get_anchor(MARGIN_LEFT));
undo_redo->add_undo_method(c, "set_anchor", MARGIN_TOP, c->get_anchor(MARGIN_TOP));
undo_redo->add_undo_method(c, "set_anchor", MARGIN_RIGHT, c->get_anchor(MARGIN_RIGHT));
@@ -2364,6 +2599,32 @@ void CanvasItemEditor::_set_anchor(Control::AnchorType p_left, Control::AnchorTy
undo_redo->commit_action();
}
+void CanvasItemEditor::_set_full_rect() {
+ List<Node *> &selection = editor_selection->get_selected_node_list();
+
+ undo_redo->create_action(TTR("Change Anchors"));
+ for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
+
+ Control *c = E->get()->cast_to<Control>();
+
+ undo_redo->add_do_method(c, "set_anchors_preset", PRESET_WIDE);
+ undo_redo->add_do_method(c, "set_margin", MARGIN_LEFT, 0);
+ undo_redo->add_do_method(c, "set_margin", MARGIN_TOP, 0);
+ undo_redo->add_do_method(c, "set_margin", MARGIN_RIGHT, 0);
+ undo_redo->add_do_method(c, "set_margin", MARGIN_BOTTOM, 0);
+ undo_redo->add_undo_method(c, "set_anchor", MARGIN_LEFT, c->get_anchor(MARGIN_LEFT));
+ undo_redo->add_undo_method(c, "set_anchor", MARGIN_TOP, c->get_anchor(MARGIN_TOP));
+ undo_redo->add_undo_method(c, "set_anchor", MARGIN_RIGHT, c->get_anchor(MARGIN_RIGHT));
+ undo_redo->add_undo_method(c, "set_anchor", MARGIN_BOTTOM, c->get_anchor(MARGIN_BOTTOM));
+ undo_redo->add_undo_method(c, "set_margin", MARGIN_LEFT, c->get_margin(MARGIN_LEFT));
+ undo_redo->add_undo_method(c, "set_margin", MARGIN_TOP, c->get_margin(MARGIN_TOP));
+ undo_redo->add_undo_method(c, "set_margin", MARGIN_RIGHT, c->get_margin(MARGIN_RIGHT));
+ undo_redo->add_undo_method(c, "set_margin", MARGIN_BOTTOM, c->get_margin(MARGIN_BOTTOM));
+ }
+
+ undo_redo->commit_action();
+}
+
void CanvasItemEditor::_popup_callback(int p_op) {
last_option = MenuOption(p_op);
@@ -2373,6 +2634,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
snap_grid = !snap_grid;
int idx = edit_menu->get_popup()->get_item_index(SNAP_USE);
edit_menu->get_popup()->set_item_checked(idx, snap_grid);
+ viewport->update();
} break;
case SNAP_SHOW_GRID: {
snap_show_grid = !snap_show_grid;
@@ -2389,6 +2651,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
snap_relative = !snap_relative;
int idx = edit_menu->get_popup()->get_item_index(SNAP_RELATIVE);
edit_menu->get_popup()->set_item_checked(idx, snap_relative);
+ viewport->update();
} break;
case SNAP_USE_PIXEL: {
snap_pixel = !snap_pixel;
@@ -2521,29 +2784,6 @@ void CanvasItemEditor::_popup_callback(int p_op) {
} break;
- case EXPAND_TO_PARENT: {
-
- List<Node *> &selection = editor_selection->get_selected_node_list();
-
- for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
-
- CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible_in_tree())
- continue;
-
- if (canvas_item->get_viewport() != EditorNode::get_singleton()->get_scene_root())
- continue;
-
- Control *c = canvas_item->cast_to<Control>();
- if (!c)
- continue;
- c->set_area_as_parent_rect();
- }
-
- viewport->update();
-
- } break;
-
case ALIGN_VERTICAL: {
#if 0
if ( ref_item && canvas_items.size() > 1 ) {
@@ -2588,53 +2828,55 @@ void CanvasItemEditor::_popup_callback(int p_op) {
//space_selected_items< proj_vector2_y, compare_items_y >();
} break;
case ANCHOR_ALIGN_TOP_LEFT: {
- _set_anchor(ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_BEGIN);
+ _set_anchors_preset(PRESET_TOP_LEFT);
} break;
case ANCHOR_ALIGN_TOP_RIGHT: {
- _set_anchor(ANCHOR_END, ANCHOR_BEGIN, ANCHOR_END, ANCHOR_BEGIN);
+ _set_anchors_preset(PRESET_TOP_RIGHT);
} break;
case ANCHOR_ALIGN_BOTTOM_LEFT: {
- _set_anchor(ANCHOR_BEGIN, ANCHOR_END, ANCHOR_BEGIN, ANCHOR_END);
+ _set_anchors_preset(PRESET_BOTTOM_LEFT);
} break;
case ANCHOR_ALIGN_BOTTOM_RIGHT: {
- _set_anchor(ANCHOR_END, ANCHOR_END, ANCHOR_END, ANCHOR_END);
+ _set_anchors_preset(PRESET_BOTTOM_RIGHT);
} break;
case ANCHOR_ALIGN_CENTER_LEFT: {
- _set_anchor(ANCHOR_BEGIN, ANCHOR_CENTER, ANCHOR_BEGIN, ANCHOR_CENTER);
+ _set_anchors_preset(PRESET_CENTER_LEFT);
} break;
case ANCHOR_ALIGN_CENTER_RIGHT: {
-
- _set_anchor(ANCHOR_END, ANCHOR_CENTER, ANCHOR_END, ANCHOR_CENTER);
+ _set_anchors_preset(PRESET_CENTER_RIGHT);
} break;
case ANCHOR_ALIGN_CENTER_TOP: {
- _set_anchor(ANCHOR_CENTER, ANCHOR_BEGIN, ANCHOR_CENTER, ANCHOR_BEGIN);
+ _set_anchors_preset(PRESET_CENTER_TOP);
} break;
case ANCHOR_ALIGN_CENTER_BOTTOM: {
- _set_anchor(ANCHOR_CENTER, ANCHOR_END, ANCHOR_CENTER, ANCHOR_END);
+ _set_anchors_preset(PRESET_CENTER_BOTTOM);
} break;
case ANCHOR_ALIGN_CENTER: {
- _set_anchor(ANCHOR_CENTER, ANCHOR_CENTER, ANCHOR_CENTER, ANCHOR_CENTER);
+ _set_anchors_preset(PRESET_CENTER);
} break;
case ANCHOR_ALIGN_TOP_WIDE: {
- _set_anchor(ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_END, ANCHOR_BEGIN);
+ _set_anchors_preset(PRESET_TOP_WIDE);
} break;
case ANCHOR_ALIGN_LEFT_WIDE: {
- _set_anchor(ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_END);
+ _set_anchors_preset(PRESET_LEFT_WIDE);
} break;
case ANCHOR_ALIGN_RIGHT_WIDE: {
- _set_anchor(ANCHOR_END, ANCHOR_BEGIN, ANCHOR_END, ANCHOR_END);
+ _set_anchors_preset(PRESET_RIGHT_WIDE);
} break;
case ANCHOR_ALIGN_BOTTOM_WIDE: {
- _set_anchor(ANCHOR_BEGIN, ANCHOR_END, ANCHOR_END, ANCHOR_END);
+ _set_anchors_preset(PRESET_BOTTOM_WIDE);
} break;
case ANCHOR_ALIGN_VCENTER_WIDE: {
- _set_anchor(ANCHOR_CENTER, ANCHOR_BEGIN, ANCHOR_CENTER, ANCHOR_END);
+ _set_anchors_preset(PRESET_VCENTER_WIDE);
} break;
case ANCHOR_ALIGN_HCENTER_WIDE: {
- _set_anchor(ANCHOR_BEGIN, ANCHOR_CENTER, ANCHOR_END, ANCHOR_CENTER);
+ _set_anchors_preset(PRESET_HCENTER_WIDE);
} break;
case ANCHOR_ALIGN_WIDE: {
- _set_anchor(ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_END, ANCHOR_END);
+ _set_anchors_preset(PRESET_WIDE);
+ } break;
+ case ANCHOR_ALIGN_WIDE_FIT: {
+ _set_full_rect();
} break;
case ANIM_INSERT_KEY:
@@ -2657,11 +2899,11 @@ void CanvasItemEditor::_popup_callback(int p_op) {
Node2D *n2d = canvas_item->cast_to<Node2D>();
if (key_pos)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d, "transform/pos", n2d->get_position(), existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d, "position", n2d->get_position(), existing);
if (key_rot)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d, "transform/rot", Math::rad2deg(n2d->get_rotation()), existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d, "rotation_deg", Math::rad2deg(n2d->get_rotation()), existing);
if (key_scale)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d, "transform/scale", n2d->get_scale(), existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d, "scale", n2d->get_scale(), existing);
if (n2d->has_meta("_edit_bone_") && n2d->get_parent_item()) {
//look for an IK chain
@@ -2688,11 +2930,11 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for (List<Node2D *>::Element *F = ik_chain.front(); F; F = F->next()) {
if (key_pos)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(), "transform/pos", F->get()->get_position(), existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(), "position", F->get()->get_position(), existing);
if (key_rot)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(), "transform/rot", Math::rad2deg(F->get()->get_rotation()), existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(), "rotation_deg", Math::rad2deg(F->get()->get_rotation()), existing);
if (key_scale)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(), "transform/scale", F->get()->get_scale(), existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(), "scale", F->get()->get_scale(), existing);
}
}
}
@@ -2702,9 +2944,11 @@ void CanvasItemEditor::_popup_callback(int p_op) {
Control *ctrl = canvas_item->cast_to<Control>();
if (key_pos)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl, "rect/pos", ctrl->get_pos(), existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl, "rect_position", ctrl->get_position(), existing);
+ if (key_rot)
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl, "rect_rotation", ctrl->get_rotation_deg(), existing);
if (key_scale)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl, "rect/size", ctrl->get_size(), existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl, "rect_size", ctrl->get_size(), existing);
}
}
@@ -2768,7 +3012,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
pc.pos = n2d->get_position();
pc.rot = n2d->get_rotation();
pc.scale = n2d->get_scale();
- pc.id = n2d->get_instance_ID();
+ pc.id = n2d->get_instance_id();
pose_clipboard.push_back(pc);
}
}
@@ -2788,11 +3032,11 @@ void CanvasItemEditor::_popup_callback(int p_op) {
Node2D *n2d = o->cast_to<Node2D>();
if (!n2d)
continue;
- undo_redo->add_do_method(n2d, "set_pos", E->get().pos);
- undo_redo->add_do_method(n2d, "set_rot", E->get().rot);
+ undo_redo->add_do_method(n2d, "set_position", E->get().pos);
+ undo_redo->add_do_method(n2d, "set_rotation", E->get().rot);
undo_redo->add_do_method(n2d, "set_scale", E->get().scale);
- undo_redo->add_undo_method(n2d, "set_pos", n2d->get_position());
- undo_redo->add_undo_method(n2d, "set_rot", n2d->get_rotation());
+ undo_redo->add_undo_method(n2d, "set_position", n2d->get_position());
+ undo_redo->add_undo_method(n2d, "set_rotation", n2d->get_rotation());
undo_redo->add_undo_method(n2d, "set_scale", n2d->get_scale());
}
undo_redo->commit_action();
@@ -2825,7 +3069,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
Control *ctrl = canvas_item->cast_to<Control>();
if (key_pos)
- ctrl->set_pos(Point2());
+ ctrl->set_position(Point2());
/*
if (key_scale)
AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size());
@@ -2975,7 +3219,7 @@ void CanvasItemEditor::_focus_selection(int p_op) {
Transform2D t(angle, Vector2(0.f, 0.f));
item_rect = t.xform(item_rect);
- Rect2 canvas_item_rect(pos + scale * item_rect.pos, scale * item_rect.size);
+ Rect2 canvas_item_rect(pos + scale * item_rect.position, scale * item_rect.size);
if (count == 1) {
rect = canvas_item_rect;
} else {
@@ -2986,7 +3230,7 @@ void CanvasItemEditor::_focus_selection(int p_op) {
if (p_op == VIEW_CENTER_TO_SELECTION) {
- center = rect.pos + rect.size / 2;
+ center = rect.position + rect.size / 2;
Vector2 offset = viewport->get_size() / 2 - editor->get_scene_root()->get_global_canvas_transform().xform(center);
h_scroll->set_value(h_scroll->get_value() - offset.x / zoom);
v_scroll->set_value(v_scroll->get_value() - offset.y / zoom);
@@ -3240,6 +3484,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
PopupMenu *p;
p = edit_menu->get_popup();
+ p->set_hide_on_checkable_item_selection(false);
p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/use_snap", TTR("Use Snap")), SNAP_USE);
p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_grid", TTR("Show Grid")), SNAP_SHOW_GRID);
p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/use_rotation_snap", TTR("Use Rotation Snap")), SNAP_USE_ROTATION);
@@ -3248,8 +3493,6 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
p->add_separator();
p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/use_pixel_snap", TTR("Use Pixel Snap")), SNAP_USE_PIXEL);
p->add_separator();
- p->add_shortcut(ED_SHORTCUT("canvas_item_editor/expand_to_parent", TTR("Expand to Parent"), KEY_MASK_CMD | KEY_P), EXPAND_TO_PARENT);
- p->add_separator();
p->add_submenu_item(TTR("Skeleton.."), "skeleton");
skeleton_menu = memnew(PopupMenu);
p->add_child(skeleton_menu);
@@ -3261,6 +3504,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
skeleton_menu->add_separator();
skeleton_menu->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_set_ik_chain", TTR("Make IK Chain")), SKELETON_SET_IK_CHAIN);
skeleton_menu->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_ik_chain", TTR("Clear IK Chain")), SKELETON_CLEAR_IK_CHAIN);
+ skeleton_menu->set_hide_on_checkable_item_selection(false);
skeleton_menu->connect("id_pressed", this, "_popup_callback");
/*
@@ -3299,6 +3543,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
key_loc_button = memnew(Button("loc"));
key_loc_button->set_toggle_mode(true);
+ key_loc_button->set_flat(true);
key_loc_button->set_pressed(true);
key_loc_button->set_focus_mode(FOCUS_NONE);
key_loc_button->add_color_override("font_color", Color(1, 0.6, 0.6));
@@ -3307,6 +3552,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
animation_hb->add_child(key_loc_button);
key_rot_button = memnew(Button("rot"));
key_rot_button->set_toggle_mode(true);
+ key_rot_button->set_flat(true);
key_rot_button->set_pressed(true);
key_rot_button->set_focus_mode(FOCUS_NONE);
key_rot_button->add_color_override("font_color", Color(1, 0.6, 0.6));
@@ -3315,12 +3561,14 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
animation_hb->add_child(key_rot_button);
key_scale_button = memnew(Button("scl"));
key_scale_button->set_toggle_mode(true);
+ key_scale_button->set_flat(true);
key_scale_button->set_focus_mode(FOCUS_NONE);
key_scale_button->add_color_override("font_color", Color(1, 0.6, 0.6));
key_scale_button->add_color_override("font_color_pressed", Color(0.6, 1, 0.6));
key_scale_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_SCALE));
animation_hb->add_child(key_scale_button);
key_insert_button = memnew(Button);
+ key_insert_button->set_flat(true);
key_insert_button->set_focus_mode(FOCUS_NONE);
key_insert_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_KEY));
key_insert_button->set_tooltip(TTR("Insert Keys"));
@@ -3353,14 +3601,14 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
Label *l = memnew(Label);
l->set_text(TTR("Snap (Pixels):"));
- l->set_pos(Point2(5, 5));
+ l->set_position(Point2(5, 5));
value_dialog->add_child(l);
dialog_label = l;
dialog_val = memnew(SpinBox);
dialog_val->set_anchor(MARGIN_RIGHT, ANCHOR_END);
dialog_val->set_begin(Point2(15, 25));
- dialog_val->set_end(Point2(10, 25));
+ dialog_val->set_end(Point2(-10, 25));
value_dialog->add_child(dialog_val);
dialog_val->connect("value_changed", this, "_dialog_value_changed");
select_sb = Ref<StyleBoxTexture>(memnew(StyleBoxTexture));
@@ -3473,8 +3721,8 @@ void CanvasItemEditorViewport::_on_change_type() {
}
void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) const {
- label->set_pos(get_global_pos() + Point2(14, 14));
- label_desc->set_pos(label->get_pos() + Point2(0, label->get_size().height));
+ label->set_position(get_global_position() + Point2(14, 14) * EDSCALE);
+ label_desc->set_position(label->get_position() + Point2(0, label->get_size().height));
for (int i = 0; i < files.size(); i++) {
String path = files[i];
RES res = ResourceLoader::load(path);
@@ -3575,8 +3823,8 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String &
// locate at preview position
Point2 pos;
- if (parent->has_method("get_global_pos")) {
- pos = parent->call("get_global_pos");
+ if (parent->has_method("get_global_position")) {
+ pos = parent->call("get_global_position");
}
Transform2D trans = canvas->get_canvas_transform();
Point2 target_pos = (p_point - trans.get_origin()) / trans.get_scale().x - pos;
@@ -3606,7 +3854,7 @@ bool CanvasItemEditorViewport::_create_instance(Node *parent, String &path, cons
}
}
- instanced_scene->set_filename(GlobalConfig::get_singleton()->localize_path(path));
+ instanced_scene->set_filename(ProjectSettings::get_singleton()->localize_path(path));
editor_data->get_undo_redo().add_do_method(parent, "add_child", instanced_scene);
editor_data->get_undo_redo().add_do_method(instanced_scene, "set_owner", editor->get_edited_scene());
@@ -3625,7 +3873,7 @@ bool CanvasItemEditorViewport::_create_instance(Node *parent, String &path, cons
} else {
Control *parent_control = parent->cast_to<Control>();
if (parent_control) {
- pos = parent_control->get_global_pos();
+ pos = parent_control->get_global_position();
}
}
Transform2D trans = canvas->get_canvas_transform();
@@ -3779,10 +4027,16 @@ void CanvasItemEditorViewport::drop_data(const Point2 &p_point, const Variant &p
}
void CanvasItemEditorViewport::_notification(int p_what) {
- if (p_what == NOTIFICATION_ENTER_TREE) {
- connect("mouse_exited", this, "_on_mouse_exit");
- } else if (p_what == NOTIFICATION_EXIT_TREE) {
- disconnect("mouse_exited", this, "_on_mouse_exit");
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE: {
+ connect("mouse_exited", this, "_on_mouse_exit");
+ label->add_color_override("font_color", get_color("warning_color", "Editor"));
+ } break;
+ case NOTIFICATION_EXIT_TREE: {
+ disconnect("mouse_exited", this, "_on_mouse_exit");
+ } break;
+
+ default: break;
}
}
@@ -3812,11 +4066,12 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte
accept = memnew(AcceptDialog);
editor->get_gui_base()->add_child(accept);
- selector = memnew(WindowDialog);
+ selector = memnew(AcceptDialog);
selector->set_title(TTR("Change default type"));
VBoxContainer *vbc = memnew(VBoxContainer);
- vbc->add_constant_override("separation", 10 * EDSCALE);
+ vbc->set_h_size_flags(SIZE_EXPAND_FILL);
+ vbc->set_v_size_flags(SIZE_EXPAND_FILL);
vbc->set_custom_minimum_size(Size2(200, 260) * EDSCALE);
selector_label = memnew(Label);
@@ -3833,23 +4088,18 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte
for (int i = 0; i < types.size(); i++) {
CheckBox *check = memnew(CheckBox);
check->set_text(types[i]);
- check->connect("button_selected", this, "_on_select_type", varray(check));
+ check->connect("button_down", this, "_on_select_type", varray(check));
btn_group->add_child(check);
check->set_button_group(button_group);
}
vbc->add_child(btn_group);
- Button *ok = memnew(Button);
- ok->set_text(TTR("OK"));
- ok->set_h_size_flags(0);
- vbc->add_child(ok);
- ok->connect("pressed", this, "_on_change_type");
+ selector->connect("confirmed", this, "_on_change_type");
selector->add_child(vbc);
editor->get_gui_base()->add_child(selector);
label = memnew(Label);
- label->add_color_override("font_color", Color(1, 1, 0, 1));
label->add_color_override("font_color_shadow", Color(0, 0, 0, 1));
label->add_constant_override("shadow_as_outline", 1 * EDSCALE);
label->hide();
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index ba3f240a49..9b027fda60 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -55,6 +56,8 @@ public:
Transform2D prev_xform;
float prev_rot;
Rect2 prev_rect;
+ Vector2 prev_pivot;
+ float prev_anchors[4];
CanvasItemEditorSelectedItem() { prev_rot = 0; }
};
@@ -109,10 +112,10 @@ class CanvasItemEditor : public VBoxContainer {
ANCHOR_ALIGN_VCENTER_WIDE,
ANCHOR_ALIGN_HCENTER_WIDE,
ANCHOR_ALIGN_WIDE,
+ ANCHOR_ALIGN_WIDE_FIT,
SPACE_HORIZONTAL,
SPACE_VERTICAL,
- EXPAND_TO_PARENT,
ANIM_INSERT_KEY,
ANIM_INSERT_KEY_EXISTING,
ANIM_INSERT_POS,
@@ -141,11 +144,15 @@ class CanvasItemEditor : public VBoxContainer {
DRAG_BOTTOM_RIGHT,
DRAG_BOTTOM,
DRAG_BOTTOM_LEFT,
+ DRAG_ANCHOR_TOP_LEFT,
+ DRAG_ANCHOR_TOP_RIGHT,
+ DRAG_ANCHOR_BOTTOM_RIGHT,
+ DRAG_ANCHOR_BOTTOM_LEFT,
+ DRAG_ANCHOR_ALL,
DRAG_ALL,
DRAG_ROTATE,
DRAG_PIVOT,
DRAG_NODE_2D,
-
};
enum KeyMoveMODE {
@@ -298,14 +305,15 @@ class CanvasItemEditor : public VBoxContainer {
#endif
Ref<StyleBoxTexture> select_sb;
Ref<Texture> select_handle;
+ Ref<Texture> anchor_handle;
int handle_len;
bool _is_part_of_subscene(CanvasItem *p_item);
- CanvasItem *_select_canvas_item_at_pos(const Point2 &p_pos, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform);
- void _find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform, Vector<_SelectResult> &r_items);
+ void _find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform, Vector<_SelectResult> &r_items, unsigned int limit = 0);
void _find_canvas_items_at_rect(const Rect2 &p_rect, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform, List<CanvasItem *> *r_items);
- bool _select(CanvasItem *item, Point2 p_click_pos, bool p_append, bool p_drag = true);
+ void _select_click_on_empty_area(Point2 p_click_pos, bool p_append, bool p_box_selection);
+ bool _select_click_on_item(CanvasItem *item, Point2 p_click_pos, bool p_append, bool p_drag);
ConfirmationDialog *snap_dialog;
@@ -321,10 +329,15 @@ class CanvasItemEditor : public VBoxContainer {
void _clear_canvas_items();
void _visibility_changed(ObjectID p_canvas_item);
void _key_move(const Vector2 &p_dir, bool p_snap, KeyMoveMODE p_move_mode);
- void _list_select(const InputEventMouseButton &b);
+ void _list_select(const Ref<InputEventMouseButton> &b);
- DragType _find_drag_type(const Transform2D &p_xform, const Rect2 &p_local_rect, const Point2 &p_click, Vector2 &r_point);
+ DragType _get_resize_handle_drag_type(const Point2 &p_click, Vector2 &r_point);
void _prepare_drag(const Point2 &p_click_pos);
+ DragType _get_anchor_handle_drag_type(const Point2 &p_click, Vector2 &r_point);
+
+ float _anchor_snap(float anchor, bool *snapped = NULL, float p_opposite_anchor = -1);
+ Vector2 _anchor_to_position(Control *p_control, Vector2 anchor);
+ Vector2 _position_to_anchor(Control *p_control, Vector2 position);
void _popup_callback(int p_op);
bool updating_scroll;
@@ -351,14 +364,17 @@ class CanvasItemEditor : public VBoxContainer {
int get_item_count();
void _keying_changed();
- void _unhandled_key_input(const InputEvent &p_ev);
+ void _unhandled_key_input(const Ref<InputEvent> &p_ev);
+
+ void _draw_percentage_at_position(float p_value, Point2 p_position, Margin p_side);
- void _viewport_gui_input(const InputEvent &p_event);
+ void _viewport_gui_input(const Ref<InputEvent> &p_event);
void _viewport_draw();
void _focus_selection(int p_op);
- void _set_anchor(Control::AnchorType p_left, Control::AnchorType p_top, Control::AnchorType p_right, Control::AnchorType p_bottom);
+ void _set_anchors_preset(Control::LayoutPreset p_preset);
+ void _set_full_rect();
HSplitContainer *palette_split;
VSplitContainer *bottom_split;
diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/editor/plugins/collision_polygon_2d_editor_plugin.cpp
index 0f7e3a3990..346c00df64 100644
--- a/editor/plugins/collision_polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/collision_polygon_2d_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -93,213 +94,208 @@ void CollisionPolygon2DEditor::_wip_close() {
edited_point = -1;
}
-bool CollisionPolygon2DEditor::forward_gui_input(const InputEvent &p_event) {
+bool CollisionPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (!node)
return false;
- switch (p_event.type) {
+ Ref<InputEventMouseButton> mb = p_event;
- case InputEvent::MOUSE_BUTTON: {
+ if (mb.is_valid()) {
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- const InputEventMouseButton &mb = p_event.mouse_button;
+ Vector2 gpoint = mb->get_position();
+ Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
+ cpoint = canvas_item_editor->snap_point(cpoint);
+ cpoint = node->get_global_transform().affine_inverse().xform(cpoint);
- Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Vector<Vector2> poly = node->get_polygon();
- Vector2 gpoint = Point2(mb.x, mb.y);
- Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
- cpoint = canvas_item_editor->snap_point(cpoint);
- cpoint = node->get_global_transform().affine_inverse().xform(cpoint);
+ //first check if a point is to be added (segment split)
+ real_t grab_threshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
- Vector<Vector2> poly = node->get_polygon();
+ switch (mode) {
- //first check if a point is to be added (segment split)
- real_t grab_treshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
+ case MODE_CREATE: {
- switch (mode) {
+ if (mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
- case MODE_CREATE: {
+ if (!wip_active) {
- if (mb.button_index == BUTTON_LEFT && mb.pressed) {
+ wip.clear();
+ wip.push_back(cpoint);
+ wip_active = true;
+ edited_point_pos = cpoint;
+ canvas_item_editor->get_viewport_control()->update();
+ edited_point = 1;
+ return true;
+ } else {
- if (!wip_active) {
+ if (wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_threshold) {
+ //wip closed
+ _wip_close();
- wip.clear();
- wip.push_back(cpoint);
- wip_active = true;
- edited_point_pos = cpoint;
- canvas_item_editor->get_viewport_control()->update();
- edited_point = 1;
return true;
} else {
- if (wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_treshold) {
- //wip closed
- _wip_close();
-
- return true;
- } else {
-
- wip.push_back(cpoint);
- edited_point = wip.size();
- canvas_item_editor->get_viewport_control()->update();
- return true;
+ wip.push_back(cpoint);
+ edited_point = wip.size();
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
- //add wip point
- }
+ //add wip point
}
- } else if (mb.button_index == BUTTON_RIGHT && mb.pressed && wip_active) {
- _wip_close();
}
+ } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && wip_active) {
+ _wip_close();
+ }
- } break;
-
- case MODE_EDIT: {
+ } break;
- if (mb.button_index == BUTTON_LEFT) {
- if (mb.pressed) {
+ case MODE_EDIT: {
- if (mb.mod.control) {
+ if (mb->get_button_index() == BUTTON_LEFT) {
+ if (mb->is_pressed()) {
- if (poly.size() < 3) {
+ if (mb->get_control()) {
- undo_redo->create_action(TTR("Edit Poly"));
- undo_redo->add_undo_method(node, "set_polygon", poly);
- poly.push_back(cpoint);
- undo_redo->add_do_method(node, "set_polygon", poly);
- 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;
- }
-
- //search edges
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
- for (int i = 0; i < poly.size(); i++) {
-
- Vector2 points[2] = { xform.xform(poly[i]),
- xform.xform(poly[(i + 1) % poly.size()]) };
-
- Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint, points);
- if (cp.distance_squared_to(points[0]) < CMP_EPSILON2 || cp.distance_squared_to(points[1]) < CMP_EPSILON2)
- continue; //not valid to reuse point
-
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_pos = cp;
- closest_idx = i;
- }
- }
-
- if (closest_idx >= 0) {
+ if (poly.size() < 3) {
- pre_move_edit = poly;
- poly.insert(closest_idx + 1, xform.affine_inverse().xform(closest_pos));
- edited_point = closest_idx + 1;
- edited_point_pos = xform.affine_inverse().xform(closest_pos);
- node->set_polygon(poly);
- canvas_item_editor->get_viewport_control()->update();
- return true;
- }
- } else {
+ undo_redo->create_action(TTR("Edit Poly"));
+ undo_redo->add_undo_method(node, "set_polygon", poly);
+ poly.push_back(cpoint);
+ undo_redo->add_do_method(node, "set_polygon", poly);
+ 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;
+ }
- //look for points to move
+ //search edges
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
- for (int i = 0; i < poly.size(); i++) {
+ Vector2 points[2] = { xform.xform(poly[i]),
+ xform.xform(poly[(i + 1) % poly.size()]) };
- Vector2 cp = xform.xform(poly[i]);
+ Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint, points);
+ if (cp.distance_squared_to(points[0]) < CMP_EPSILON2 || cp.distance_squared_to(points[1]) < CMP_EPSILON2)
+ continue; //not valid to reuse point
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_pos = cp;
- closest_idx = i;
- }
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
}
+ }
- if (closest_idx >= 0) {
+ if (closest_idx >= 0) {
- pre_move_edit = poly;
- edited_point = closest_idx;
- edited_point_pos = xform.affine_inverse().xform(closest_pos);
- canvas_item_editor->get_viewport_control()->update();
- return true;
- }
+ pre_move_edit = poly;
+ poly.insert(closest_idx + 1, xform.affine_inverse().xform(closest_pos));
+ edited_point = closest_idx + 1;
+ edited_point_pos = xform.affine_inverse().xform(closest_pos);
+ node->set_polygon(poly);
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
}
} else {
- if (edited_point != -1) {
+ //look for points to move
- //apply
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
- ERR_FAIL_INDEX_V(edited_point, poly.size(), false);
- poly[edited_point] = edited_point_pos;
- undo_redo->create_action(TTR("Edit Poly"));
- undo_redo->add_do_method(node, "set_polygon", poly);
- undo_redo->add_undo_method(node, "set_polygon", pre_move_edit);
- 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();
+ Vector2 cp = xform.xform(poly[i]);
- edited_point = -1;
- return true;
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
+ }
}
- }
- } else if (mb.button_index == BUTTON_RIGHT && mb.pressed && edited_point == -1) {
-
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
- for (int i = 0; i < poly.size(); i++) {
- Vector2 cp = xform.xform(poly[i]);
+ if (closest_idx >= 0) {
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_pos = cp;
- closest_idx = i;
+ pre_move_edit = poly;
+ edited_point = closest_idx;
+ edited_point_pos = xform.affine_inverse().xform(closest_pos);
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
}
}
+ } else {
+
+ if (edited_point != -1) {
- if (closest_idx >= 0) {
+ //apply
- undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
- undo_redo->add_undo_method(node, "set_polygon", poly);
- poly.remove(closest_idx);
+ ERR_FAIL_INDEX_V(edited_point, poly.size(), false);
+ poly[edited_point] = edited_point_pos;
+ undo_redo->create_action(TTR("Edit Poly"));
undo_redo->add_do_method(node, "set_polygon", poly);
+ undo_redo->add_undo_method(node, "set_polygon", pre_move_edit);
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();
+
+ edited_point = -1;
return true;
}
}
+ } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && edited_point == -1) {
- } break;
- }
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
- } break;
- case InputEvent::MOUSE_MOTION: {
+ Vector2 cp = xform.xform(poly[i]);
- const InputEventMouseMotion &mm = p_event.mouse_motion;
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
+ }
+ }
- if (edited_point != -1 && (wip_active || mm.button_mask & BUTTON_MASK_LEFT)) {
+ if (closest_idx >= 0) {
- Vector2 gpoint = Point2(mm.x, mm.y);
- Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
- cpoint = canvas_item_editor->snap_point(cpoint);
- edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint);
+ undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
+ undo_redo->add_undo_method(node, "set_polygon", poly);
+ poly.remove(closest_idx);
+ undo_redo->add_do_method(node, "set_polygon", poly);
+ 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;
+ }
+ }
- canvas_item_editor->get_viewport_control()->update();
- }
+ } break;
+ }
+ }
- } break;
+ Ref<InputEventMouseMotion> mm = p_event;
+
+ if (mm.is_valid()) {
+
+ if (edited_point != -1 && (wip_active || mm->get_button_mask() & BUTTON_MASK_LEFT)) {
+
+ Vector2 gpoint = mm->get_position();
+ Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
+ cpoint = canvas_item_editor->snap_point(cpoint);
+ edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint);
+
+ canvas_item_editor->get_viewport_control()->update();
+ }
}
return false;
diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.h b/editor/plugins/collision_polygon_2d_editor_plugin.h
index abd723cce9..b2f32d8491 100644
--- a/editor/plugins/collision_polygon_2d_editor_plugin.h
+++ b/editor/plugins/collision_polygon_2d_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -79,7 +80,7 @@ protected:
static void _bind_methods();
public:
- bool forward_gui_input(const InputEvent &p_event);
+ bool forward_gui_input(const Ref<InputEvent> &p_event);
void edit(Node *p_collision_polygon);
CollisionPolygon2DEditor(EditorNode *p_editor);
};
@@ -92,12 +93,12 @@ class CollisionPolygon2DEditorPlugin : public EditorPlugin {
EditorNode *editor;
public:
- virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "CollisionPolygon2D"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
CollisionPolygon2DEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_editor_plugin.cpp
index 62426a7699..5b364ed2c1 100644
--- a/editor/plugins/collision_polygon_editor_plugin.cpp
+++ b/editor/plugins/collision_polygon_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,339 +35,304 @@
#include "scene/3d/camera.h"
#include "spatial_editor_plugin.h"
-#if 0
-
void CollisionPolygonEditor::_notification(int p_what) {
- switch(p_what) {
+ switch (p_what) {
case NOTIFICATION_READY: {
- button_create->set_icon( get_icon("Edit","EditorIcons"));
- button_edit->set_icon( get_icon("MovePoint","EditorIcons"));
+ button_create->set_icon(get_icon("Edit", "EditorIcons"));
+ button_edit->set_icon(get_icon("MovePoint", "EditorIcons"));
button_edit->set_pressed(true);
- get_tree()->connect("node_removed",this,"_node_removed");
-
+ get_tree()->connect("node_removed", this, "_node_removed");
} break;
case NOTIFICATION_PROCESS: {
if (node->get_depth() != prev_depth) {
_polygon_draw();
- prev_depth=node->get_depth();
+ prev_depth = node->get_depth();
}
} break;
}
-
}
void CollisionPolygonEditor::_node_removed(Node *p_node) {
- if(p_node==node) {
- node=NULL;
- if (imgeom->get_parent()==p_node)
+ if (p_node == node) {
+ node = NULL;
+ if (imgeom->get_parent() == p_node)
p_node->remove_child(imgeom);
hide();
set_process(false);
}
-
}
-
void CollisionPolygonEditor::_menu_option(int p_option) {
- switch(p_option) {
+ switch (p_option) {
case MODE_CREATE: {
- mode=MODE_CREATE;
+ mode = MODE_CREATE;
button_create->set_pressed(true);
button_edit->set_pressed(false);
} break;
case MODE_EDIT: {
- mode=MODE_EDIT;
+ mode = MODE_EDIT;
button_create->set_pressed(false);
button_edit->set_pressed(true);
} break;
-
}
}
void CollisionPolygonEditor::_wip_close() {
undo_redo->create_action(TTR("Create Poly3D"));
- undo_redo->add_undo_method(node,"set_polygon",node->get_polygon());
- undo_redo->add_do_method(node,"set_polygon",wip);
- undo_redo->add_do_method(this,"_polygon_draw");
- undo_redo->add_undo_method(this,"_polygon_draw");
+ undo_redo->add_undo_method(node, "set_polygon", node->get_polygon());
+ undo_redo->add_do_method(node, "set_polygon", wip);
+ undo_redo->add_do_method(this, "_polygon_draw");
+ undo_redo->add_undo_method(this, "_polygon_draw");
wip.clear();
- wip_active=false;
- mode=MODE_EDIT;
+ wip_active = false;
+ mode = MODE_EDIT;
button_edit->set_pressed(true);
button_create->set_pressed(false);
- edited_point=-1;
+ edited_point = -1;
undo_redo->commit_action();
-
}
-bool CollisionPolygonEditor::forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) {
+bool CollisionPolygonEditor::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) {
if (!node)
return false;
Transform gt = node->get_global_transform();
Transform gi = gt.affine_inverse();
- float depth = node->get_depth()*0.5;
+ float depth = node->get_depth() * 0.5;
Vector3 n = gt.basis.get_axis(2).normalized();
- Plane p(gt.origin+n*depth,n);
-
-
- switch(p_event.type) {
+ Plane p(gt.origin + n * depth, n);
- case InputEvent::MOUSE_BUTTON: {
+ Ref<InputEventMouseButton> mb = p_event;
- const InputEventMouseButton &mb=p_event.mouse_button;
+ if (mb.is_valid()) {
+ Vector2 gpoint = mb->get_position();
+ Vector3 ray_from = p_camera->project_ray_origin(gpoint);
+ Vector3 ray_dir = p_camera->project_ray_normal(gpoint);
+ Vector3 spoint;
- Vector2 gpoint=Point2(mb.x,mb.y);
- Vector3 ray_from = p_camera->project_ray_origin(gpoint);
- Vector3 ray_dir = p_camera->project_ray_normal(gpoint);
-
- Vector3 spoint;
-
- if (!p.intersects_ray(ray_from,ray_dir,&spoint))
- break;
+ if (!p.intersects_ray(ray_from, ray_dir, &spoint))
+ return false;
- spoint = gi.xform(spoint);
+ spoint = gi.xform(spoint);
- Vector2 cpoint(spoint.x,spoint.y);
+ Vector2 cpoint(spoint.x, spoint.y);
- cpoint=CanvasItemEditor::get_singleton()->snap_point(cpoint);
+ cpoint = CanvasItemEditor::get_singleton()->snap_point(cpoint);
- Vector<Vector2> poly = node->get_polygon();
+ Vector<Vector2> poly = node->get_polygon();
- //first check if a point is to be added (segment split)
- real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8);
+ //first check if a point is to be added (segment split)
+ real_t grab_treshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
- switch(mode) {
+ switch (mode) {
+ case MODE_CREATE: {
- case MODE_CREATE: {
+ if (mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
- if (mb.button_index==BUTTON_LEFT && mb.pressed) {
+ if (!wip_active) {
+ wip.clear();
+ wip.push_back(cpoint);
+ wip_active = true;
+ edited_point_pos = cpoint;
+ _polygon_draw();
+ edited_point = 1;
+ return true;
+ } else {
- if (!wip_active) {
+ if (wip.size() > 1 && p_camera->unproject_position(gt.xform(Vector3(wip[0].x, wip[0].y, depth))).distance_to(gpoint) < grab_treshold) {
+ //wip closed
+ _wip_close();
- wip.clear();
- wip.push_back( cpoint );
- wip_active=true;
- edited_point_pos=cpoint;
- _polygon_draw();
- edited_point=1;
return true;
} else {
-
- if (wip.size()>1 && p_camera->unproject_position(gt.xform(Vector3(wip[0].x,wip[0].y,depth))).distance_to(gpoint)<grab_treshold) {
- //wip closed
- _wip_close();
-
- return true;
- } else {
-
- wip.push_back( cpoint );
- edited_point=wip.size();
- _polygon_draw();
- return true;
-
- //add wip point
- }
+ wip.push_back(cpoint);
+ edited_point = wip.size();
+ _polygon_draw();
+ return true;
}
- } else if (mb.button_index==BUTTON_RIGHT && mb.pressed && wip_active) {
- _wip_close();
}
+ } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && wip_active) {
+ _wip_close();
+ }
+ } break;
+ case MODE_EDIT: {
- } break;
+ if (mb->get_button_index() == BUTTON_LEFT) {
+ if (mb->is_pressed()) {
- case MODE_EDIT: {
+ if (mb->get_control()) {
- if (mb.button_index==BUTTON_LEFT) {
- if (mb.pressed) {
+ if (poly.size() < 3) {
- if (mb.mod.control) {
-
-
- if (poly.size() < 3) {
-
- undo_redo->create_action(TTR("Edit Poly"));
- undo_redo->add_undo_method(node,"set_polygon",poly);
- poly.push_back(cpoint);
- undo_redo->add_do_method(node,"set_polygon",poly);
- undo_redo->add_do_method(this,"_polygon_draw");
- undo_redo->add_undo_method(this,"_polygon_draw");
- undo_redo->commit_action();
- return true;
- }
-
- //search edges
- int closest_idx=-1;
- Vector2 closest_pos;
- real_t closest_dist=1e10;
- for(int i=0;i<poly.size();i++) {
-
- Vector2 points[2] ={
- p_camera->unproject_position(gt.xform(Vector3(poly[i].x,poly[i].y,depth))),
- p_camera->unproject_position(gt.xform(Vector3(poly[(i+1)%poly.size()].x,poly[(i+1)%poly.size()].y,depth)))
- };
-
- Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint,points);
- if (cp.distance_squared_to(points[0])<CMP_EPSILON2 || cp.distance_squared_to(points[1])<CMP_EPSILON2)
- continue; //not valid to reuse point
-
- real_t d = cp.distance_to(gpoint);
- if (d<closest_dist && d<grab_treshold) {
- closest_dist=d;
- closest_pos=cp;
- closest_idx=i;
- }
-
-
- }
-
- if (closest_idx>=0) {
-
- pre_move_edit=poly;
- poly.insert(closest_idx+1,cpoint);
- edited_point=closest_idx+1;
- edited_point_pos=cpoint;
- node->set_polygon(poly);
- _polygon_draw();
- return true;
- }
- } else {
-
- //look for points to move
-
- int closest_idx=-1;
- Vector2 closest_pos;
- real_t closest_dist=1e10;
- for(int i=0;i<poly.size();i++) {
-
- Vector2 cp = p_camera->unproject_position(gt.xform(Vector3(poly[i].x,poly[i].y,depth)));
-
- real_t d = cp.distance_to(gpoint);
- if (d<closest_dist && d<grab_treshold) {
- closest_dist=d;
- closest_pos=cp;
- closest_idx=i;
- }
+ undo_redo->create_action(TTR("Edit Poly"));
+ undo_redo->add_undo_method(node, "set_polygon", poly);
+ poly.push_back(cpoint);
+ undo_redo->add_do_method(node, "set_polygon", poly);
+ undo_redo->add_do_method(this, "_polygon_draw");
+ undo_redo->add_undo_method(this, "_polygon_draw");
+ undo_redo->commit_action();
+ return true;
+ }
+ //search edges
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
+
+ Vector2 points[2] = {
+ p_camera->unproject_position(gt.xform(Vector3(poly[i].x, poly[i].y, depth))),
+ p_camera->unproject_position(gt.xform(Vector3(poly[(i + 1) % poly.size()].x, poly[(i + 1) % poly.size()].y, depth)))
+ };
+
+ Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint, points);
+ if (cp.distance_squared_to(points[0]) < CMP_EPSILON2 || cp.distance_squared_to(points[1]) < CMP_EPSILON2)
+ continue; //not valid to reuse point
+
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_treshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
}
+ }
- if (closest_idx>=0) {
+ if (closest_idx >= 0) {
- pre_move_edit=poly;
- edited_point=closest_idx;
- edited_point_pos=poly[closest_idx];
- _polygon_draw();
- return true;
- }
+ pre_move_edit = poly;
+ poly.insert(closest_idx + 1, cpoint);
+ edited_point = closest_idx + 1;
+ edited_point_pos = cpoint;
+ node->set_polygon(poly);
+ _polygon_draw();
+ return true;
}
} else {
- if (edited_point!=-1) {
+ //look for points to move
- //apply
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
- ERR_FAIL_INDEX_V(edited_point,poly.size(),false);
- poly[edited_point]=edited_point_pos;
- undo_redo->create_action(TTR("Edit Poly"));
- undo_redo->add_do_method(node,"set_polygon",poly);
- undo_redo->add_undo_method(node,"set_polygon",pre_move_edit);
- undo_redo->add_do_method(this,"_polygon_draw");
- undo_redo->add_undo_method(this,"_polygon_draw");
- undo_redo->commit_action();
+ Vector2 cp = p_camera->unproject_position(gt.xform(Vector3(poly[i].x, poly[i].y, depth)));
- edited_point=-1;
- return true;
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_treshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
+ }
}
- }
- } if (mb.button_index==BUTTON_RIGHT && mb.pressed && edited_point==-1) {
-
+ if (closest_idx >= 0) {
- int closest_idx=-1;
- Vector2 closest_pos;
- real_t closest_dist=1e10;
- for(int i=0;i<poly.size();i++) {
-
- Vector2 cp = p_camera->unproject_position(gt.xform(Vector3(poly[i].x,poly[i].y,depth)));
-
- real_t d = cp.distance_to(gpoint);
- if (d<closest_dist && d<grab_treshold) {
- closest_dist=d;
- closest_pos=cp;
- closest_idx=i;
+ pre_move_edit = poly;
+ edited_point = closest_idx;
+ edited_point_pos = poly[closest_idx];
+ _polygon_draw();
+ return true;
}
-
}
+ } else {
- if (closest_idx>=0) {
+ if (edited_point != -1) {
+ //apply
- undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
- undo_redo->add_undo_method(node,"set_polygon",poly);
- poly.remove(closest_idx);
- undo_redo->add_do_method(node,"set_polygon",poly);
- undo_redo->add_do_method(this,"_polygon_draw");
- undo_redo->add_undo_method(this,"_polygon_draw");
+ ERR_FAIL_INDEX_V(edited_point, poly.size(), false);
+ poly[edited_point] = edited_point_pos;
+ undo_redo->create_action(TTR("Edit Poly"));
+ undo_redo->add_do_method(node, "set_polygon", poly);
+ undo_redo->add_undo_method(node, "set_polygon", pre_move_edit);
+ undo_redo->add_do_method(this, "_polygon_draw");
+ undo_redo->add_undo_method(this, "_polygon_draw");
undo_redo->commit_action();
+
+ edited_point = -1;
return true;
}
-
}
+ }
+ if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && edited_point == -1) {
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
+ Vector2 cp = p_camera->unproject_position(gt.xform(Vector3(poly[i].x, poly[i].y, depth)));
- } break;
- }
-
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_treshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
+ }
+ }
+ if (closest_idx >= 0) {
- } break;
- case InputEvent::MOUSE_MOTION: {
+ undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
+ undo_redo->add_undo_method(node, "set_polygon", poly);
+ poly.remove(closest_idx);
+ undo_redo->add_do_method(node, "set_polygon", poly);
+ undo_redo->add_do_method(this, "_polygon_draw");
+ undo_redo->add_undo_method(this, "_polygon_draw");
+ undo_redo->commit_action();
+ return true;
+ }
+ }
- const InputEventMouseMotion &mm=p_event.mouse_motion;
+ } break;
+ }
+ }
- if (edited_point!=-1 && (wip_active || mm.button_mask&BUTTON_MASK_LEFT)) {
+ Ref<InputEventMouseMotion> mm = p_event;
- Vector2 gpoint = Point2(mm.x,mm.y);
+ if (mm.is_valid()) {
- Vector3 ray_from = p_camera->project_ray_origin(gpoint);
- Vector3 ray_dir = p_camera->project_ray_normal(gpoint);
+ if (edited_point != -1 && (wip_active || mm->get_button_mask() & BUTTON_MASK_LEFT)) {
- Vector3 spoint;
+ Vector2 gpoint = mm->get_position();
- if (!p.intersects_ray(ray_from,ray_dir,&spoint))
- break;
+ Vector3 ray_from = p_camera->project_ray_origin(gpoint);
+ Vector3 ray_dir = p_camera->project_ray_normal(gpoint);
- spoint = gi.xform(spoint);
+ Vector3 spoint;
- Vector2 cpoint(spoint.x,spoint.y);
+ if (!p.intersects_ray(ray_from, ray_dir, &spoint))
+ return false;
- cpoint=CanvasItemEditor::get_singleton()->snap_point(cpoint);
- edited_point_pos = cpoint;
+ spoint = gi.xform(spoint);
- _polygon_draw();
+ Vector2 cpoint(spoint.x, spoint.y);
- }
+ cpoint = CanvasItemEditor::get_singleton()->snap_point(cpoint);
+ edited_point_pos = cpoint;
- } break;
+ _polygon_draw();
+ }
}
return false;
@@ -379,41 +345,38 @@ void CollisionPolygonEditor::_polygon_draw() {
Vector<Vector2> poly;
if (wip_active)
- poly=wip;
+ poly = wip;
else
- poly=node->get_polygon();
-
+ poly = node->get_polygon();
- float depth = node->get_depth()*0.5;
+ float depth = node->get_depth() * 0.5;
imgeom->clear();
imgeom->set_material_override(line_material);
- imgeom->begin(Mesh::PRIMITIVE_LINES,Ref<Texture>());
-
+ imgeom->begin(Mesh::PRIMITIVE_LINES, Ref<Texture>());
Rect2 rect;
- for(int i=0;i<poly.size();i++) {
-
+ for (int i = 0; i < poly.size(); i++) {
- Vector2 p,p2;
- p = i==edited_point ? edited_point_pos : poly[i];
- if ((wip_active && i==poly.size()-1) || (((i+1)%poly.size())==edited_point))
- p2=edited_point_pos;
+ Vector2 p, p2;
+ p = i == edited_point ? edited_point_pos : poly[i];
+ if ((wip_active && i == poly.size() - 1) || (((i + 1) % poly.size()) == edited_point))
+ p2 = edited_point_pos;
else
- p2 = poly[(i+1)%poly.size()];
+ p2 = poly[(i + 1) % poly.size()];
- if (i==0)
- rect.pos=p;
+ if (i == 0)
+ rect.position = p;
else
rect.expand_to(p);
- Vector3 point = Vector3(p.x,p.y,depth);
- Vector3 next_point = Vector3(p2.x,p2.y,depth);
+ Vector3 point = Vector3(p.x, p.y, depth);
+ Vector3 next_point = Vector3(p2.x, p2.y, depth);
- imgeom->set_color(Color(1,0.3,0.1,0.8));
+ imgeom->set_color(Color(1, 0.3, 0.1, 0.8));
imgeom->add_vertex(point);
- imgeom->set_color(Color(1,0.3,0.1,0.8));
+ imgeom->set_color(Color(1, 0.3, 0.1, 0.8));
imgeom->add_vertex(next_point);
//Color col=Color(1,0.3,0.1,0.8);
@@ -421,60 +384,59 @@ void CollisionPolygonEditor::_polygon_draw() {
//vpc->draw_texture(handle,point-handle->get_size()*0.5);
}
- rect=rect.grow(1);
-
- AABB r;
- r.pos.x=rect.pos.x;
- r.pos.y=rect.pos.y;
- r.pos.z=depth;
- r.size.x=rect.size.x;
- r.size.y=rect.size.y;
- r.size.z=0;
-
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos);
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+Vector3(0.3,0,0));
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos);
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+Vector3(0.0,0.3,0));
-
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+Vector3(r.size.x,0,0));
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+Vector3(r.size.x,0,0)-Vector3(0.3,0,0));
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+Vector3(r.size.x,0,0));
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+Vector3(r.size.x,0,0)+Vector3(0,0.3,0));
-
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+Vector3(0,r.size.y,0));
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+Vector3(0,r.size.y,0)-Vector3(0,0.3,0));
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+Vector3(0,r.size.y,0));
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+Vector3(0,r.size.y,0)+Vector3(0.3,0,0));
-
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+r.size);
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+r.size-Vector3(0.3,0,0));
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+r.size);
- imgeom->set_color(Color(0.8,0.8,0.8,0.2));
- imgeom->add_vertex(r.pos+r.size-Vector3(0.0,0.3,0));
+ rect = rect.grow(1);
+
+ Rect3 r;
+ r.position.x = rect.position.x;
+ r.position.y = rect.position.y;
+ r.position.z = depth;
+ r.size.x = rect.size.x;
+ r.size.y = rect.size.y;
+ r.size.z = 0;
+
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position);
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + Vector3(0.3, 0, 0));
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position);
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + Vector3(0.0, 0.3, 0));
+
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + Vector3(r.size.x, 0, 0));
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + Vector3(r.size.x, 0, 0) - Vector3(0.3, 0, 0));
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + Vector3(r.size.x, 0, 0));
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + Vector3(r.size.x, 0, 0) + Vector3(0, 0.3, 0));
+
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + Vector3(0, r.size.y, 0));
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + Vector3(0, r.size.y, 0) - Vector3(0, 0.3, 0));
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + Vector3(0, r.size.y, 0));
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + Vector3(0, r.size.y, 0) + Vector3(0.3, 0, 0));
+
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + r.size);
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + r.size - Vector3(0.3, 0, 0));
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + r.size);
+ imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2));
+ imgeom->add_vertex(r.position + r.size - Vector3(0.0, 0.3, 0));
imgeom->end();
-
- while(m->get_surface_count()) {
+ while (m->get_surface_count()) {
m->surface_remove(0);
}
- if (poly.size()==0)
+ if (poly.size() == 0)
return;
Array a;
@@ -483,78 +445,69 @@ void CollisionPolygonEditor::_polygon_draw() {
{
va.resize(poly.size());
- PoolVector<Vector3>::Write w=va.write();
- for(int i=0;i<poly.size();i++) {
-
+ PoolVector<Vector3>::Write w = va.write();
+ for (int i = 0; i < poly.size(); i++) {
- Vector2 p,p2;
- p = i==edited_point ? edited_point_pos : poly[i];
+ Vector2 p, p2;
+ p = i == edited_point ? edited_point_pos : poly[i];
- Vector3 point = Vector3(p.x,p.y,depth);
- w[i]=point;
+ Vector3 point = Vector3(p.x, p.y, depth);
+ w[i] = point;
}
}
- a[Mesh::ARRAY_VERTEX]=va;
- m->add_surface(Mesh::PRIMITIVE_POINTS,a);
- m->surface_set_material(0,handle_material);
-
+ a[Mesh::ARRAY_VERTEX] = va;
+ m->add_surface_from_arrays(Mesh::PRIMITIVE_POINTS, a);
+ m->surface_set_material(0, handle_material);
}
-
-
void CollisionPolygonEditor::edit(Node *p_collision_polygon) {
-
-
if (p_collision_polygon) {
- node=p_collision_polygon->cast_to<CollisionPolygon>();
+ node = p_collision_polygon->cast_to<CollisionPolygon>();
wip.clear();
- wip_active=false;
- edited_point=-1;
+ wip_active = false;
+ edited_point = -1;
p_collision_polygon->add_child(imgeom);
_polygon_draw();
set_process(true);
- prev_depth=-1;
+ prev_depth = -1;
} else {
- node=NULL;
+ node = NULL;
if (imgeom->get_parent())
imgeom->get_parent()->remove_child(imgeom);
set_process(false);
}
-
}
void CollisionPolygonEditor::_bind_methods() {
- 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);
-
+ 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);
}
CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) {
-
- node=NULL;
- editor=p_editor;
+ node = NULL;
+ editor = p_editor;
undo_redo = editor->get_undo_redo();
- add_child( memnew( VSeparator ));
- button_create = memnew( ToolButton );
+ add_child(memnew(VSeparator));
+ button_create = memnew(ToolButton);
add_child(button_create);
- button_create->connect("pressed",this,"_menu_option",varray(MODE_CREATE));
+ button_create->connect("pressed", this, "_menu_option", varray(MODE_CREATE));
button_create->set_toggle_mode(true);
- button_edit = memnew( ToolButton );
+ button_edit = memnew(ToolButton);
add_child(button_edit);
- button_edit->connect("pressed",this,"_menu_option",varray(MODE_EDIT));
+ button_edit->connect("pressed", this, "_menu_option", varray(MODE_EDIT));
button_edit->set_toggle_mode(true);
- //add_constant_override("separation",0);
+//add_constant_override("separation",0);
#if 0
options = memnew( MenuButton );
@@ -566,46 +519,40 @@ CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) {
#endif
mode = MODE_EDIT;
- wip_active=false;
- imgeom = memnew( ImmediateGeometry );
- imgeom->set_transform(Transform(Matrix3(),Vector3(0,0,0.00001)));
-
+ wip_active = false;
+ imgeom = memnew(ImmediateGeometry);
+ imgeom->set_transform(Transform(Basis(), Vector3(0, 0, 0.00001)));
- line_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
- line_material->set_flag(Material::FLAG_UNSHADED, true);
+ line_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
line_material->set_line_width(3.0);
- line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true);
- line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, true);
- line_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1));
-
-
-
-
- handle_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
- handle_material->set_flag(Material::FLAG_UNSHADED, true);
- handle_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_POINT_SIZE, true);
- handle_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1));
- handle_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true);
- handle_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, false);
- Ref<Texture> handle=editor->get_gui_base()->get_icon("Editor3DHandle","EditorIcons");
+ line_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ line_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ line_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ line_material->set_albedo(Color(1, 1, 1));
+
+ handle_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ handle_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ handle_material->set_flag(SpatialMaterial::FLAG_USE_POINT_SIZE, true);
+ handle_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ handle_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ handle_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ Ref<Texture> handle = editor->get_gui_base()->get_icon("Editor3DHandle", "EditorIcons");
handle_material->set_point_size(handle->get_width());
- handle_material->set_texture(FixedSpatialMaterial::PARAM_DIFFUSE,handle);
+ handle_material->set_texture(SpatialMaterial::TEXTURE_ALBEDO, handle);
- pointsm = memnew( MeshInstance );
+ pointsm = memnew(MeshInstance);
imgeom->add_child(pointsm);
- m = Ref<Mesh>( memnew( Mesh ) );
+ m.instance();
pointsm->set_mesh(m);
- pointsm->set_transform(Transform(Matrix3(),Vector3(0,0,0.00001)));
-
-
+ pointsm->set_transform(Transform(Basis(), Vector3(0, 0, 0.00001)));
}
CollisionPolygonEditor::~CollisionPolygonEditor() {
- memdelete( imgeom );
+ memdelete(imgeom);
}
-
void CollisionPolygonEditorPlugin::edit(Object *p_object) {
collision_polygon_editor->edit(p_object->cast_to<Node>());
@@ -613,7 +560,7 @@ void CollisionPolygonEditorPlugin::edit(Object *p_object) {
bool CollisionPolygonEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("CollisionPolygon");
+ return p_object->is_class("CollisionPolygon");
}
void CollisionPolygonEditorPlugin::make_visible(bool p_visible) {
@@ -625,24 +572,16 @@ void CollisionPolygonEditorPlugin::make_visible(bool p_visible) {
collision_polygon_editor->hide();
collision_polygon_editor->edit(NULL);
}
-
}
CollisionPolygonEditorPlugin::CollisionPolygonEditorPlugin(EditorNode *p_node) {
- editor=p_node;
- collision_polygon_editor = memnew( CollisionPolygonEditor(p_node) );
+ editor = p_node;
+ collision_polygon_editor = memnew(CollisionPolygonEditor(p_node));
SpatialEditor::get_singleton()->add_control_to_menu_panel(collision_polygon_editor);
collision_polygon_editor->hide();
-
-
-
}
-
-CollisionPolygonEditorPlugin::~CollisionPolygonEditorPlugin()
-{
+CollisionPolygonEditorPlugin::~CollisionPolygonEditorPlugin() {
}
-
-#endif
diff --git a/editor/plugins/collision_polygon_editor_plugin.h b/editor/plugins/collision_polygon_editor_plugin.h
index ace8c3429f..9f8b52d7f2 100644
--- a/editor/plugins/collision_polygon_editor_plugin.h
+++ b/editor/plugins/collision_polygon_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,12 +42,11 @@
@author Juan Linietsky <reduzio@gmail.com>
*/
-#if 0
class CanvasItemEditor;
class CollisionPolygonEditor : public HBoxContainer {
- GDCLASS(CollisionPolygonEditor, HBoxContainer );
+ GDCLASS(CollisionPolygonEditor, HBoxContainer);
UndoRedo *undo_redo;
enum Mode {
@@ -61,16 +61,15 @@ class CollisionPolygonEditor : public HBoxContainer {
ToolButton *button_create;
ToolButton *button_edit;
-
- Ref<FixedSpatialMaterial> line_material;
- Ref<FixedSpatialMaterial> handle_material;
+ Ref<SpatialMaterial> line_material;
+ Ref<SpatialMaterial> handle_material;
EditorNode *editor;
Panel *panel;
CollisionPolygon *node;
ImmediateGeometry *imgeom;
MeshInstance *pointsm;
- Ref<Mesh> m;
+ Ref<ArrayMesh> m;
MenuButton *options;
@@ -90,9 +89,9 @@ protected:
void _notification(int p_what);
void _node_removed(Node *p_node);
static void _bind_methods();
-public:
- virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event);
+public:
+ virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event);
void edit(Node *p_collision_polygon);
CollisionPolygonEditor(EditorNode *p_editor);
~CollisionPolygonEditor();
@@ -100,24 +99,22 @@ public:
class CollisionPolygonEditorPlugin : public EditorPlugin {
- GDCLASS( CollisionPolygonEditorPlugin, EditorPlugin );
+ GDCLASS(CollisionPolygonEditorPlugin, EditorPlugin);
CollisionPolygonEditor *collision_polygon_editor;
EditorNode *editor;
public:
-
- virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) { return collision_polygon_editor->forward_spatial_gui_input(p_camera,p_event); }
+ virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) { return collision_polygon_editor->forward_spatial_gui_input(p_camera, p_event); }
virtual String get_name() const { return "CollisionPolygon"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
CollisionPolygonEditorPlugin(EditorNode *p_node);
~CollisionPolygonEditorPlugin();
-
};
-#endif
+
#endif // COLLISION_POLYGON_EDITOR_PLUGIN_H
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp
index 3538878877..fb2aa16383 100644
--- a/editor/plugins/collision_shape_2d_editor_plugin.cpp
+++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -301,7 +302,7 @@ void CollisionShape2DEditor::commit_handle(int idx, Variant &p_org) {
undo_redo->commit_action();
}
-bool CollisionShape2DEditor::forward_gui_input(const InputEvent &p_event) {
+bool CollisionShape2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (!node) {
return false;
@@ -315,68 +316,66 @@ bool CollisionShape2DEditor::forward_gui_input(const InputEvent &p_event) {
return false;
}
- switch (p_event.type) {
- case InputEvent::MOUSE_BUTTON: {
- const InputEventMouseButton &mb = p_event.mouse_button;
+ Ref<InputEventMouseButton> mb = p_event;
- Transform2D gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ if (mb.is_valid()) {
- Point2 gpoint(mb.x, mb.y);
+ Transform2D gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- if (mb.button_index == BUTTON_LEFT) {
- if (mb.pressed) {
- for (int i = 0; i < handles.size(); i++) {
- if (gt.xform(handles[i]).distance_to(gpoint) < 8) {
- edit_handle = i;
+ Point2 gpoint(mb->get_position().x, mb->get_position().y);
- break;
- }
+ if (mb->get_button_index() == BUTTON_LEFT) {
+ if (mb->is_pressed()) {
+ for (int i = 0; i < handles.size(); i++) {
+ if (gt.xform(handles[i]).distance_to(gpoint) < 8) {
+ edit_handle = i;
+
+ break;
}
+ }
- if (edit_handle == -1) {
- pressed = false;
+ if (edit_handle == -1) {
+ pressed = false;
- return false;
- }
+ return false;
+ }
- original = get_handle_value(edit_handle);
- pressed = true;
+ original = get_handle_value(edit_handle);
+ pressed = true;
- return true;
+ return true;
- } else {
- if (pressed) {
- commit_handle(edit_handle, original);
+ } else {
+ if (pressed) {
+ commit_handle(edit_handle, original);
- edit_handle = -1;
- pressed = false;
+ edit_handle = -1;
+ pressed = false;
- return true;
- }
+ return true;
}
}
+ }
- return false;
+ return false;
+ }
- } break;
+ Ref<InputEventMouseMotion> mm = p_event;
- case InputEvent::MOUSE_MOTION: {
- const InputEventMouseMotion &mm = p_event.mouse_motion;
+ if (mm.is_valid()) {
- if (edit_handle == -1 || !pressed) {
- return false;
- }
-
- Point2 gpoint = Point2(mm.x, mm.y);
- Point2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
- cpoint = canvas_item_editor->snap_point(cpoint);
- cpoint = node->get_global_transform().affine_inverse().xform(cpoint);
+ if (edit_handle == -1 || !pressed) {
+ return false;
+ }
- set_handle(edit_handle, cpoint);
+ Point2 gpoint = mm->get_position();
+ Point2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
+ cpoint = canvas_item_editor->snap_point(cpoint);
+ cpoint = node->get_global_transform().affine_inverse().xform(cpoint);
- return true;
+ set_handle(edit_handle, cpoint);
- } break;
+ return true;
}
return false;
@@ -586,12 +585,12 @@ void CollisionShape2DEditorPlugin::make_visible(bool visible) {
}
}
-CollisionShape2DEditorPlugin::CollisionShape2DEditorPlugin(EditorNode *p_node) {
+CollisionShape2DEditorPlugin::CollisionShape2DEditorPlugin(EditorNode *p_editor) {
- editor = p_node;
+ editor = p_editor;
- collision_shape_2d_editor = memnew(CollisionShape2DEditor(p_node));
- p_node->get_gui_base()->add_child(collision_shape_2d_editor);
+ collision_shape_2d_editor = memnew(CollisionShape2DEditor(p_editor));
+ p_editor->get_gui_base()->add_child(collision_shape_2d_editor);
}
CollisionShape2DEditorPlugin::~CollisionShape2DEditorPlugin() {
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.h b/editor/plugins/collision_shape_2d_editor_plugin.h
index 75331a1d61..09aefc65c0 100644
--- a/editor/plugins/collision_shape_2d_editor_plugin.h
+++ b/editor/plugins/collision_shape_2d_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -73,7 +74,7 @@ protected:
static void _bind_methods();
public:
- bool forward_gui_input(const InputEvent &p_event);
+ bool forward_gui_input(const Ref<InputEvent> &p_event);
void edit(Node *p_node);
CollisionShape2DEditor(EditorNode *p_editor);
@@ -86,7 +87,7 @@ class CollisionShape2DEditorPlugin : public EditorPlugin {
EditorNode *editor;
public:
- virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event) { return collision_shape_2d_editor->forward_gui_input(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event) { return collision_shape_2d_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "CollisionShape2D"; }
bool has_main_screen() const { return false; }
diff --git a/editor/plugins/cube_grid_theme_editor_plugin.cpp b/editor/plugins/cube_grid_theme_editor_plugin.cpp
index e73a9b31af..b26b2aec4f 100644
--- a/editor/plugins/cube_grid_theme_editor_plugin.cpp
+++ b/editor/plugins/cube_grid_theme_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,7 +29,6 @@
/*************************************************************************/
#include "cube_grid_theme_editor_plugin.h"
-#if 0
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "main/main.h"
@@ -38,214 +38,236 @@
#include "scene/main/viewport.h"
#include "scene/resources/packed_scene.h"
-void MeshLibraryEditor::edit(const Ref<MeshLibrary>& p_theme) {
+void MeshLibraryEditor::edit(const Ref<MeshLibrary> &p_theme) {
- theme=p_theme;
+ theme = p_theme;
if (theme.is_valid())
- menu->get_popup()->set_item_disabled(menu->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE),!theme->has_meta("_editor_source_scene"));
-
+ menu->get_popup()->set_item_disabled(menu->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE), !theme->has_meta("_editor_source_scene"));
}
void MeshLibraryEditor::_menu_confirm() {
+ switch (option) {
- switch(option) {
-
- case MENU_OPTION_REMOVE_ITEM: {
+ case MENU_OPTION_REMOVE_ITEM: {
- theme->remove_item(to_erase);
- } break;
- case MENU_OPTION_UPDATE_FROM_SCENE: {
+ theme->remove_item(to_erase);
+ } break;
+ case MENU_OPTION_UPDATE_FROM_SCENE: {
String existing = theme->get_meta("_editor_source_scene");
- ERR_FAIL_COND(existing=="");
+ ERR_FAIL_COND(existing == "");
_import_scene_cbk(existing);
- } break;
- default: {};
+ } break;
+ default: {};
}
-
}
-
void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, bool p_merge) {
if (!p_merge)
p_library->clear();
-
- for(int i=0;i<p_scene->get_child_count();i++) {
-
+ for (int i = 0; i < p_scene->get_child_count(); i++) {
Node *child = p_scene->get_child(i);
if (!child->cast_to<MeshInstance>()) {
- if (child->get_child_count()>0) {
- child=child->get_child(0);
+ if (child->get_child_count() > 0) {
+ child = child->get_child(0);
if (!child->cast_to<MeshInstance>()) {
continue;
}
} else
continue;
-
-
}
MeshInstance *mi = child->cast_to<MeshInstance>();
- Ref<Mesh> mesh=mi->get_mesh();
+ Ref<Mesh> mesh = mi->get_mesh();
if (mesh.is_null())
- continue;
+ continue;
int id = p_library->find_item_name(mi->get_name());
- if (id<0) {
+ if (id < 0) {
- id=p_library->get_last_unused_item_id();
+ id = p_library->get_last_unused_item_id();
p_library->create_item(id);
- p_library->set_item_name(id,mi->get_name());
+ p_library->set_item_name(id, mi->get_name());
}
-
- p_library->set_item_mesh(id,mesh);
+ p_library->set_item_mesh(id, mesh);
Ref<Shape> collision;
+ for (int j = 0; j < mi->get_child_count(); j++) {
- for(int j=0;j<mi->get_child_count();j++) {
-#if 1
Node *child2 = mi->get_child(j);
if (!child2->cast_to<StaticBody>())
continue;
+
StaticBody *sb = child2->cast_to<StaticBody>();
- if (sb->get_shape_count()==0)
- continue;
- collision=sb->get_shape(0);
- if (!collision.is_null())
- break;
-#endif
+ List<uint32_t> shapes;
+ sb->get_shape_owners(&shapes);
+
+ for (List<uint32_t>::Element *E = shapes.front(); E; E = E->next()) {
+ if (sb->is_shape_owner_disabled(E->get())) continue;
+
+ //Transform shape_transform = sb->shape_owner_get_transform(E->get());
+
+ //shape_transform.set_origin(shape_transform.get_origin() - phys_offset);
+
+ for (int k = 0; k < sb->shape_owner_get_shape_count(E->get()); k++) {
+
+ collision = sb->shape_owner_get_shape(E->get(), k);
+ if (collision.is_valid())
+ break;
+ /* TileSet::ShapeData shape_data;
+ shape_data.shape = shape;
+ shape_data.shape_transform = shape_transform;
+ shape_data.one_way_collision = one_way;
+ collisions.push_back(shape_data);*/
+ }
+ if (collision.is_valid())
+ break;
+ }
}
if (!collision.is_null()) {
- p_library->set_item_shape(id,collision);
+ p_library->set_item_shape(id, collision);
}
Ref<NavigationMesh> navmesh;
- for(int j=0;j<mi->get_child_count();j++) {
- Node *child2 = mi->get_child(j);
- if (!child2->cast_to<NavigationMeshInstance>())
- continue;
- NavigationMeshInstance *sb = child2->cast_to<NavigationMeshInstance>();
- navmesh=sb->get_navigation_mesh();
- if (!navmesh.is_null())
- break;
+ for (int j = 0; j < mi->get_child_count(); j++) {
+ Node *child2 = mi->get_child(j);
+ if (!child2->cast_to<NavigationMeshInstance>())
+ continue;
+ NavigationMeshInstance *sb = child2->cast_to<NavigationMeshInstance>();
+ navmesh = sb->get_navigation_mesh();
+ if (!navmesh.is_null())
+ break;
}
- if(!navmesh.is_null()){
+ if (!navmesh.is_null()) {
p_library->set_item_navmesh(id, navmesh);
}
- }
-
- //generate previews!
-
- if (1) {
- Vector<int> ids = p_library->get_item_list();
- RID vp = VS::get_singleton()->viewport_create();
- VS::ViewportRect vr;
- vr.x=0;
- vr.y=0;
- vr.width=EditorSettings::get_singleton()->get("editors/grid_map/preview_size");
- vr.height=EditorSettings::get_singleton()->get("editors/grid_map/preview_size");
- VS::get_singleton()->viewport_set_rect(vp,vr);
- VS::get_singleton()->viewport_set_as_render_target(vp,true);
- VS::get_singleton()->viewport_set_render_target_update_mode(vp,VS::RENDER_TARGET_UPDATE_ALWAYS);
- RID scen = VS::get_singleton()->scenario_create();
- VS::get_singleton()->viewport_set_scenario(vp,scen);
- RID cam = VS::get_singleton()->camera_create();
- VS::get_singleton()->camera_set_transform(cam, Transform() );
- VS::get_singleton()->viewport_attach_camera(vp,cam);
- RID light = VS::get_singleton()->light_create(VS::LIGHT_DIRECTIONAL);
- RID lightinst = VS::get_singleton()->instance_create2(light,scen);
- VS::get_singleton()->camera_set_orthogonal(cam,1.0,0.01,1000.0);
-
-
- EditorProgress ep("mlib",TTR("Creating Mesh Library"),ids.size());
-
- for(int i=0;i<ids.size();i++) {
-
- int id=ids[i];
+ }
+
+ //generate previews!
+
+ if (1) {
+ Vector<int> ids = p_library->get_item_list();
+ RID vp = VS::get_singleton()->viewport_create();
+ int size = EditorSettings::get_singleton()->get("editors/grid_map/preview_size");
+
+ RID scenario = VS::get_singleton()->scenario_create();
+
+ RID viewport = VS::get_singleton()->viewport_create();
+ VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ALWAYS);
+ VS::get_singleton()->viewport_set_vflip(viewport, true);
+ VS::get_singleton()->viewport_set_scenario(viewport, scenario);
+ VS::get_singleton()->viewport_set_size(viewport, size, size);
+ VS::get_singleton()->viewport_set_transparent_background(viewport, true);
+ VS::get_singleton()->viewport_set_active(viewport, true);
+ RID viewport_texture = VS::get_singleton()->viewport_get_texture(viewport);
+
+ RID camera = VS::get_singleton()->camera_create();
+ VS::get_singleton()->viewport_attach_camera(viewport, camera);
+ VS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3)));
+ //VS::get_singleton()->camera_set_perspective(camera,45,0.1,10);
+ VS::get_singleton()->camera_set_orthogonal(camera, 1.0, 0.01, 1000.0);
+
+ RID light = VS::get_singleton()->light_create(VS::LIGHT_DIRECTIONAL);
+ RID light_instance = VS::get_singleton()->instance_create2(light, scenario);
+ VS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
+
+ RID light2 = VS::get_singleton()->light_create(VS::LIGHT_DIRECTIONAL);
+ VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+ //VS::get_singleton()->light_set_color(light2, VS::LIGHT_COLOR_SPECULAR, Color(0.0, 0.0, 0.0));
+ RID light_instance2 = VS::get_singleton()->instance_create2(light2, scenario);
+
+ VS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
+
+ //sphere = VS::get_singleton()->mesh_create();
+ RID mesh_instance = VS::get_singleton()->instance_create();
+ VS::get_singleton()->instance_set_scenario(mesh_instance, scenario);
+
+ EditorProgress ep("mlib", TTR("Creating Mesh Library"), ids.size());
+
+ for (int i = 0; i < ids.size(); i++) {
+
+ int id = ids[i];
Ref<Mesh> mesh = p_library->get_item_mesh(id);
if (!mesh.is_valid())
continue;
- AABB aabb= mesh->get_aabb();
- print_line("aabb: "+aabb);
- Vector3 ofs = aabb.pos + aabb.size*0.5;
- aabb.pos-=ofs;
+ Rect3 aabb = mesh->get_aabb();
+ print_line("aabb: " + aabb);
+ Vector3 ofs = aabb.position + aabb.size * 0.5;
+ aabb.position -= ofs;
Transform xform;
- xform.basis=Matrix3().rotated(Vector3(0,1,0),-Math_PI*0.25);
- xform.basis = Matrix3().rotated(Vector3(1,0,0),Math_PI*0.25)*xform.basis;
- AABB rot_aabb = xform.xform(aabb);
- print_line("rot_aabb: "+rot_aabb);
- float m = MAX(rot_aabb.size.x,rot_aabb.size.y)*0.5;
- if (m==0)
+ xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math_PI * 0.25);
+ xform.basis = Basis().rotated(Vector3(1, 0, 0), Math_PI * 0.25) * xform.basis;
+ Rect3 rot_aabb = xform.xform(aabb);
+ print_line("rot_aabb: " + rot_aabb);
+ float m = MAX(rot_aabb.size.x, rot_aabb.size.y) * 0.5;
+ if (m == 0)
continue;
- m=1.0/m;
- m*=0.5;
- print_line("scale: "+rtos(m));
- xform.basis.scale(Vector3(m,m,m));
- xform.origin=-xform.basis.xform(ofs); //-ofs*m;
- xform.origin.z-=rot_aabb.size.z*2;
- RID inst = VS::get_singleton()->instance_create2(mesh->get_rid(),scen);
- VS::get_singleton()->instance_set_transform(inst,xform);
- ep.step(TTR("Thumbnail.."),i);
- VS::get_singleton()->viewport_queue_screen_capture(vp);
+ m = 1.0 / m;
+ m *= 0.5;
+ print_line("scale: " + rtos(m));
+ xform.basis.scale(Vector3(m, m, m));
+ xform.origin = -xform.basis.xform(ofs); //-ofs*m;
+ xform.origin.z -= rot_aabb.size.z * 2;
+ RID inst = VS::get_singleton()->instance_create2(mesh->get_rid(), scenario);
+ VS::get_singleton()->instance_set_transform(inst, xform);
+ ep.step(TTR("Thumbnail.."), i);
+ Main::iteration();
Main::iteration();
- Image img = VS::get_singleton()->viewport_get_screen_capture(vp);
- ERR_CONTINUE(img.empty());
- Ref<ImageTexture> it( memnew( ImageTexture ));
+ Ref<Image> img = VS::get_singleton()->texture_get_data(viewport_texture);
+ ERR_CONTINUE(!img.is_valid() || img->empty());
+ Ref<ImageTexture> it(memnew(ImageTexture));
it->create_from_image(img);
- p_library->set_item_preview(id,it);
+ p_library->set_item_preview(id, it);
//print_line("loaded image, size: "+rtos(m)+" dist: "+rtos(dist)+" empty?"+itos(img.empty())+" w: "+itos(it->get_width())+" h: "+itos(it->get_height()));
VS::get_singleton()->free(inst);
- }
+ }
- VS::get_singleton()->free(lightinst);
- VS::get_singleton()->free(light);
- VS::get_singleton()->free(vp);
- VS::get_singleton()->free(cam);
- VS::get_singleton()->free(scen);
+ VS::get_singleton()->free(mesh_instance);
+ VS::get_singleton()->free(viewport);
+ VS::get_singleton()->free(light);
+ VS::get_singleton()->free(light_instance);
+ VS::get_singleton()->free(light2);
+ VS::get_singleton()->free(light_instance2);
+ VS::get_singleton()->free(camera);
+ VS::get_singleton()->free(scenario);
}
-
-
}
-
-void MeshLibraryEditor::_import_scene_cbk(const String& p_str) {
-
+void MeshLibraryEditor::_import_scene_cbk(const String &p_str) {
print_line("Impot Callback!");
- Ref<PackedScene> ps = ResourceLoader::load(p_str,"PackedScene");
+ Ref<PackedScene> ps = ResourceLoader::load(p_str, "PackedScene");
ERR_FAIL_COND(ps.is_null());
Node *scene = ps->instance();
- _import_scene(scene,theme,option==MENU_OPTION_UPDATE_FROM_SCENE);
+ _import_scene(scene, theme, option == MENU_OPTION_UPDATE_FROM_SCENE);
memdelete(scene);
- theme->set_meta("_editor_source_scene",p_str);
- menu->get_popup()->set_item_disabled(menu->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE),false);
-
+ theme->set_meta("_editor_source_scene", p_str);
+ menu->get_popup()->set_item_disabled(menu->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE), false);
}
-Error MeshLibraryEditor::update_library_file(Node *p_base_scene, Ref<MeshLibrary> ml,bool p_merge) {
+Error MeshLibraryEditor::update_library_file(Node *p_base_scene, Ref<MeshLibrary> ml, bool p_merge) {
- _import_scene(p_base_scene,ml,p_merge);
+ _import_scene(p_base_scene, ml, p_merge);
return OK;
}
-
void MeshLibraryEditor::_menu_cbk(int p_option) {
- option=p_option;
- switch(p_option) {
+ option = p_option;
+ switch (p_option) {
case MENU_OPTION_ADD_ITEM: {
@@ -254,86 +276,84 @@ void MeshLibraryEditor::_menu_cbk(int p_option) {
case MENU_OPTION_REMOVE_ITEM: {
String p = editor->get_property_editor()->get_selected_path();
- if (p.begins_with("/MeshLibrary/item") && p.get_slice_count("/")>=3) {
+ if (p.begins_with("/MeshLibrary/item") && p.get_slice_count("/") >= 3) {
- to_erase = p.get_slice("/",3).to_int();
- cd->set_text(vformat(TTR("Remove item %d?"),to_erase));
- cd->popup_centered(Size2(300,60));
+ to_erase = p.get_slice("/", 3).to_int();
+ cd->set_text(vformat(TTR("Remove item %d?"), to_erase));
+ cd->popup_centered(Size2(300, 60));
}
} break;
case MENU_OPTION_IMPORT_FROM_SCENE: {
file->popup_centered_ratio();
} break;
- case MENU_OPTION_UPDATE_FROM_SCENE: {
+ case MENU_OPTION_UPDATE_FROM_SCENE: {
- cd->set_text("Update from existing scene?:\n"+String(theme->get_meta("_editor_source_scene")));
- cd->popup_centered(Size2(500,60));
- } break;
+ cd->set_text("Update from existing scene?:\n" + String(theme->get_meta("_editor_source_scene")));
+ cd->popup_centered(Size2(500, 60));
+ } break;
}
}
-
void MeshLibraryEditor::_bind_methods() {
- ClassDB::bind_method("_menu_cbk",&MeshLibraryEditor::_menu_cbk);
- ClassDB::bind_method("_menu_confirm",&MeshLibraryEditor::_menu_confirm);
- ClassDB::bind_method("_import_scene_cbk",&MeshLibraryEditor::_import_scene_cbk);
+ ClassDB::bind_method("_menu_cbk", &MeshLibraryEditor::_menu_cbk);
+ ClassDB::bind_method("_menu_confirm", &MeshLibraryEditor::_menu_confirm);
+ ClassDB::bind_method("_import_scene_cbk", &MeshLibraryEditor::_import_scene_cbk);
}
MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) {
- file = memnew( EditorFileDialog );
+ file = memnew(EditorFileDialog);
file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
//not for now?
List<String> extensions;
- ResourceLoader::get_recognized_extensions_for_type("PackedScene",&extensions);
+ ResourceLoader::get_recognized_extensions_for_type("PackedScene", &extensions);
file->clear_filters();
file->set_title(TTR("Import Scene"));
- for(int i=0;i<extensions.size();i++) {
+ for (int i = 0; i < extensions.size(); i++) {
- file->add_filter("*."+extensions[i]+" ; "+extensions[i].to_upper());
+ file->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper());
}
add_child(file);
- file->connect("file_selected",this,"_import_scene_cbk");
+ file->connect("file_selected", this, "_import_scene_cbk");
- Panel *panel = memnew( Panel );
+ Panel *panel = memnew(Panel);
panel->set_area_as_parent_rect();
add_child(panel);
- MenuButton * options = memnew( MenuButton );
+ MenuButton *options = memnew(MenuButton);
panel->add_child(options);
- options->set_pos(Point2(1,1));
+ options->set_position(Point2(1, 1));
options->set_text("Theme");
- options->get_popup()->add_item(TTR("Add Item"),MENU_OPTION_ADD_ITEM);
- options->get_popup()->add_item(TTR("Remove Selected Item"),MENU_OPTION_REMOVE_ITEM);
+ options->get_popup()->add_item(TTR("Add Item"), MENU_OPTION_ADD_ITEM);
+ options->get_popup()->add_item(TTR("Remove Selected Item"), MENU_OPTION_REMOVE_ITEM);
options->get_popup()->add_separator();
- options->get_popup()->add_item(TTR("Import from Scene"),MENU_OPTION_IMPORT_FROM_SCENE);
- options->get_popup()->add_item(TTR("Update from Scene"),MENU_OPTION_UPDATE_FROM_SCENE);
- options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE),true);
- options->get_popup()->connect("id_pressed", this,"_menu_cbk");
- menu=options;
- editor=p_editor;
+ options->get_popup()->add_item(TTR("Import from Scene"), MENU_OPTION_IMPORT_FROM_SCENE);
+ options->get_popup()->add_item(TTR("Update from Scene"), MENU_OPTION_UPDATE_FROM_SCENE);
+ options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE), true);
+ options->get_popup()->connect("id_pressed", this, "_menu_cbk");
+ menu = options;
+ editor = p_editor;
cd = memnew(ConfirmationDialog);
add_child(cd);
- cd->get_ok()->connect("pressed", this,"_menu_confirm");
-
+ cd->get_ok()->connect("pressed", this, "_menu_confirm");
}
void MeshLibraryEditorPlugin::edit(Object *p_node) {
if (p_node && p_node->cast_to<MeshLibrary>()) {
- theme_editor->edit( p_node->cast_to<MeshLibrary>() );
+ theme_editor->edit(p_node->cast_to<MeshLibrary>());
theme_editor->show();
} else
theme_editor->hide();
}
-bool MeshLibraryEditorPlugin::handles(Object *p_node) const{
+bool MeshLibraryEditorPlugin::handles(Object *p_node) const {
- return p_node->is_type("MeshLibrary");
+ return p_node->is_class("MeshLibrary");
}
-void MeshLibraryEditorPlugin::make_visible(bool p_visible){
+void MeshLibraryEditorPlugin::make_visible(bool p_visible) {
if (p_visible)
theme_editor->show();
@@ -343,15 +363,13 @@ void MeshLibraryEditorPlugin::make_visible(bool p_visible){
MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) {
- EDITOR_DEF("editors/grid_map/preview_size",64);
- theme_editor = memnew( MeshLibraryEditor(p_node) );
+ EDITOR_DEF("editors/grid_map/preview_size", 64);
+ theme_editor = memnew(MeshLibraryEditor(p_node));
p_node->get_viewport()->add_child(theme_editor);
theme_editor->set_area_as_parent_rect();
- theme_editor->set_anchor( MARGIN_RIGHT, Control::ANCHOR_END );
- theme_editor->set_anchor( MARGIN_BOTTOM, Control::ANCHOR_BEGIN );
- theme_editor->set_end( Point2(0,22) );
+ theme_editor->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END);
+ theme_editor->set_anchor(MARGIN_BOTTOM, Control::ANCHOR_BEGIN);
+ theme_editor->set_end(Point2(0, 22));
theme_editor->hide();
-
}
-#endif
diff --git a/editor/plugins/cube_grid_theme_editor_plugin.h b/editor/plugins/cube_grid_theme_editor_plugin.h
index af3929e616..6fe5fc4235 100644
--- a/editor/plugins/cube_grid_theme_editor_plugin.h
+++ b/editor/plugins/cube_grid_theme_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,10 +33,9 @@
#include "editor/editor_node.h"
#include "scene/resources/mesh_library.h"
-#if 0
class MeshLibraryEditor : public Control {
- GDCLASS( MeshLibraryEditor, Control );
+ GDCLASS(MeshLibraryEditor, Control);
Ref<MeshLibrary> theme;
@@ -54,7 +54,7 @@ class MeshLibraryEditor : public Control {
};
int option;
- void _import_scene_cbk(const String& p_str);
+ void _import_scene_cbk(const String &p_str);
void _menu_cbk(int p_option);
void _menu_confirm();
@@ -62,25 +62,22 @@ class MeshLibraryEditor : public Control {
protected:
static void _bind_methods();
-public:
- void edit(const Ref<MeshLibrary>& p_theme);
- static Error update_library_file(Node *p_base_scene, Ref<MeshLibrary> ml,bool p_merge=true);
+public:
+ void edit(const Ref<MeshLibrary> &p_theme);
+ static Error update_library_file(Node *p_base_scene, Ref<MeshLibrary> ml, bool p_merge = true);
MeshLibraryEditor(EditorNode *p_editor);
};
-
-
class MeshLibraryEditorPlugin : public EditorPlugin {
- GDCLASS( MeshLibraryEditorPlugin, EditorPlugin );
+ GDCLASS(MeshLibraryEditorPlugin, EditorPlugin);
MeshLibraryEditor *theme_editor;
EditorNode *editor;
public:
-
virtual String get_name() const { return "MeshLibrary"; }
bool has_main_screen() const { return false; }
virtual void edit(Object *p_node);
@@ -88,8 +85,6 @@ public:
virtual void make_visible(bool p_visible);
MeshLibraryEditorPlugin(EditorNode *p_node);
-
};
#endif // CUBE_GRID_THEME_EDITOR_PLUGIN_H
-#endif
diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp
new file mode 100644
index 0000000000..2d05c8eba1
--- /dev/null
+++ b/editor/plugins/curve_editor_plugin.cpp
@@ -0,0 +1,920 @@
+/*************************************************************************/
+/* curve_editor_plugin.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "curve_editor_plugin.h"
+
+#include "canvas_item_editor_plugin.h"
+#include "core_string_names.h"
+#include "os/input.h"
+#include "os/keyboard.h"
+
+CurveEditor::CurveEditor() {
+ _selected_point = -1;
+ _hover_point = -1;
+ _selected_tangent = TANGENT_NONE;
+ _hover_radius = 6;
+ _tangents_length = 40;
+ _dragging = false;
+ _has_undo_data = false;
+
+ set_focus_mode(FOCUS_ALL);
+ set_clip_contents(true);
+
+ _context_menu = memnew(PopupMenu);
+ _context_menu->connect("id_pressed", this, "_on_context_menu_item_selected");
+ add_child(_context_menu);
+
+ _presets_menu = memnew(PopupMenu);
+ _presets_menu->set_name("_presets_menu");
+ _presets_menu->add_item("Flat0", PRESET_FLAT0);
+ _presets_menu->add_item("Flat1", PRESET_FLAT1);
+ _presets_menu->add_item("Linear", PRESET_LINEAR);
+ _presets_menu->add_item("Ease in", PRESET_EASE_IN);
+ _presets_menu->add_item("Ease out", PRESET_EASE_OUT);
+ _presets_menu->add_item("Smoothstep", PRESET_SMOOTHSTEP);
+ _presets_menu->connect("id_pressed", this, "_on_preset_item_selected");
+ _context_menu->add_child(_presets_menu);
+}
+
+void CurveEditor::set_curve(Ref<Curve> curve) {
+
+ if (curve == _curve_ref)
+ return;
+
+ if (_curve_ref.is_valid()) {
+ _curve_ref->disconnect(CoreStringNames::get_singleton()->changed, this, "_curve_changed");
+ _curve_ref->disconnect(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed");
+ }
+
+ _curve_ref = curve;
+
+ if (_curve_ref.is_valid()) {
+ _curve_ref->connect(CoreStringNames::get_singleton()->changed, this, "_curve_changed");
+ _curve_ref->connect(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed");
+ }
+
+ _selected_point = -1;
+ _hover_point = -1;
+ _selected_tangent = TANGENT_NONE;
+
+ update();
+
+ // Note: if you edit a curve, then set another, and try to undo,
+ // it will normally apply on the previous curve, but you won't see it
+}
+
+Size2 CurveEditor::get_minimum_size() const {
+ return Vector2(64, 64);
+}
+
+void CurveEditor::_notification(int p_what) {
+ if (p_what == NOTIFICATION_DRAW)
+ _draw();
+}
+
+void CurveEditor::on_gui_input(const Ref<InputEvent> &p_event) {
+
+ Ref<InputEventMouseButton> mb_ref = p_event;
+ if (mb_ref.is_valid()) {
+
+ const InputEventMouseButton &mb = **mb_ref;
+
+ if (mb.is_pressed() && !_dragging) {
+
+ Vector2 mpos = mb.get_position();
+
+ _selected_tangent = get_tangent_at(mpos);
+ if (_selected_tangent == TANGENT_NONE)
+ set_selected_point(get_point_at(mpos));
+
+ switch (mb.get_button_index()) {
+ case BUTTON_RIGHT:
+ _context_click_pos = mpos;
+ open_context_menu(get_global_transform().xform(mpos));
+ break;
+
+ case BUTTON_MIDDLE:
+ remove_point(_hover_point);
+ break;
+
+ case BUTTON_LEFT:
+ _dragging = true;
+ break;
+ }
+ }
+
+ if (!mb.is_pressed() && _dragging && mb.get_button_index() == BUTTON_LEFT) {
+ _dragging = false;
+ if (_has_undo_data) {
+
+ UndoRedo &ur = *EditorNode::get_singleton()->get_undo_redo();
+
+ ur.create_action(_selected_tangent == TANGENT_NONE ? TTR("Modify Curve Point") : TTR("Modify Curve Tangent"));
+ ur.add_do_method(*_curve_ref, "_set_data", _curve_ref->get_data());
+ ur.add_undo_method(*_curve_ref, "_set_data", _undo_data);
+ // Note: this will trigger one more "changed" signal even if nothing changes,
+ // but it's ok since it would have fired every frame during the drag anyways
+ ur.commit_action();
+
+ _has_undo_data = false;
+ }
+ }
+ }
+
+ Ref<InputEventMouseMotion> mm_ref = p_event;
+ if (mm_ref.is_valid()) {
+
+ const InputEventMouseMotion &mm = **mm_ref;
+
+ Vector2 mpos = mm.get_position();
+
+ if (_dragging && _curve_ref.is_valid()) {
+ Curve &curve = **_curve_ref;
+
+ if (_selected_point != -1) {
+
+ if (!_has_undo_data) {
+ // Save full curve state before dragging points,
+ // because this operation can modify their order
+ _undo_data = curve.get_data();
+ _has_undo_data = true;
+ }
+
+ if (_selected_tangent == TANGENT_NONE) {
+ // Drag point
+
+ Vector2 point_pos = get_world_pos(mpos);
+
+ int i = curve.set_point_offset(_selected_point, point_pos.x);
+ // The index may change if the point is dragged across another one
+ set_hover_point_index(i);
+ set_selected_point(i);
+
+ // This is to prevent the user from loosing a point out of view.
+ if (point_pos.y < curve.get_min_value())
+ point_pos.y = curve.get_min_value();
+ else if (point_pos.y > curve.get_max_value())
+ point_pos.y = curve.get_max_value();
+
+ curve.set_point_value(_selected_point, point_pos.y);
+
+ } else {
+ // Drag tangent
+
+ Vector2 point_pos = curve.get_point_pos(_selected_point);
+ Vector2 control_pos = get_world_pos(mpos);
+
+ Vector2 dir = (control_pos - point_pos).normalized();
+
+ real_t tangent;
+ if (Math::abs(dir.x) > CMP_EPSILON)
+ tangent = dir.y / dir.x;
+ else
+ tangent = 9999 * (dir.y >= 0 ? 1 : -1);
+
+ bool link = !Input::get_singleton()->is_key_pressed(KEY_SHIFT);
+
+ if (_selected_tangent == TANGENT_LEFT) {
+ curve.set_point_left_tangent(_selected_point, tangent);
+
+ // Note: if a tangent is set to linear, it shouldn't be linked to the other
+ if (link && _selected_point != curve.get_point_count() - 1 && !curve.get_point_right_mode(_selected_point) != Curve::TANGENT_FREE)
+ curve.set_point_right_tangent(_selected_point, tangent);
+
+ } else {
+ curve.set_point_right_tangent(_selected_point, tangent);
+
+ if (link && _selected_point != 0 && !curve.get_point_left_mode(_selected_point) != Curve::TANGENT_FREE)
+ curve.set_point_left_tangent(_selected_point, tangent);
+ }
+ }
+ }
+
+ } else {
+ set_hover_point_index(get_point_at(mpos));
+ }
+ }
+
+ Ref<InputEventKey> key_ref = p_event;
+ if (key_ref.is_valid()) {
+ const InputEventKey &key = **key_ref;
+
+ if (key.is_pressed() && _selected_point != -1) {
+ if (key.get_scancode() == KEY_DELETE)
+ remove_point(_selected_point);
+ }
+ }
+}
+
+void CurveEditor::on_preset_item_selected(int preset_id) {
+ ERR_FAIL_COND(preset_id < 0 || preset_id >= PRESET_COUNT);
+ ERR_FAIL_COND(_curve_ref.is_null());
+
+ Curve &curve = **_curve_ref;
+ Array previous_data = curve.get_data();
+
+ curve.clear_points();
+
+ switch (preset_id) {
+ case PRESET_FLAT0:
+ curve.add_point(Vector2(0, 0));
+ curve.add_point(Vector2(1, 0));
+ curve.set_point_right_mode(0, Curve::TANGENT_LINEAR);
+ curve.set_point_left_mode(1, Curve::TANGENT_LINEAR);
+ break;
+
+ case PRESET_FLAT1:
+ curve.add_point(Vector2(0, 1));
+ curve.add_point(Vector2(1, 1));
+ curve.set_point_right_mode(0, Curve::TANGENT_LINEAR);
+ curve.set_point_left_mode(1, Curve::TANGENT_LINEAR);
+ break;
+
+ case PRESET_LINEAR:
+ curve.add_point(Vector2(0, 0));
+ curve.add_point(Vector2(1, 1));
+ curve.set_point_right_mode(0, Curve::TANGENT_LINEAR);
+ curve.set_point_left_mode(1, Curve::TANGENT_LINEAR);
+ break;
+
+ case PRESET_EASE_IN:
+ curve.add_point(Vector2(0, 0));
+ curve.add_point(Vector2(1, 1), (curve.get_max_value() - curve.get_min_value()) * 1.4, 0);
+ break;
+
+ case PRESET_EASE_OUT:
+ curve.add_point(Vector2(0, 0), 0, (curve.get_max_value() - curve.get_min_value()) * 1.4);
+ curve.add_point(Vector2(1, 1));
+ break;
+
+ case PRESET_SMOOTHSTEP:
+ curve.add_point(Vector2(0, 0));
+ curve.add_point(Vector2(1, 1));
+ break;
+
+ default:
+ break;
+ }
+
+ UndoRedo &ur = *EditorNode::get_singleton()->get_undo_redo();
+ ur.create_action(TTR("Load Curve Preset"));
+
+ ur.add_do_method(&curve, "_set_data", curve.get_data());
+ ur.add_undo_method(&curve, "_set_data", previous_data);
+
+ ur.commit_action();
+}
+
+void CurveEditor::_curve_changed() {
+ update();
+ // Point count can change in case of undo
+ if (_selected_point >= _curve_ref->get_point_count()) {
+ set_selected_point(-1);
+ }
+}
+
+void CurveEditor::on_context_menu_item_selected(int action_id) {
+ switch (action_id) {
+ case CONTEXT_ADD_POINT:
+ add_point(_context_click_pos);
+ break;
+
+ case CONTEXT_REMOVE_POINT:
+ remove_point(_selected_point);
+ break;
+
+ case CONTEXT_LINEAR:
+ toggle_linear();
+ break;
+
+ case CONTEXT_LEFT_LINEAR:
+ toggle_linear(TANGENT_LEFT);
+ break;
+
+ case CONTEXT_RIGHT_LINEAR:
+ toggle_linear(TANGENT_RIGHT);
+ break;
+ }
+}
+
+void CurveEditor::open_context_menu(Vector2 pos) {
+ _context_menu->set_position(pos);
+
+ _context_menu->clear();
+
+ if (_curve_ref.is_valid()) {
+ _context_menu->add_item(TTR("Add point"), CONTEXT_ADD_POINT);
+
+ if (_selected_point >= 0) {
+ _context_menu->add_item(TTR("Remove point"), CONTEXT_REMOVE_POINT);
+
+ if (_selected_tangent != TANGENT_NONE) {
+ _context_menu->add_separator();
+
+ _context_menu->add_check_item(TTR("Linear"), CONTEXT_LINEAR);
+
+ bool is_linear = _selected_tangent == TANGENT_LEFT ?
+ _curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR :
+ _curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR;
+
+ _context_menu->set_item_checked(CONTEXT_LINEAR, is_linear);
+
+ } else {
+ _context_menu->add_separator();
+
+ if (_selected_point > 0) {
+ _context_menu->add_check_item(TTR("Left linear"), CONTEXT_LEFT_LINEAR);
+ _context_menu->set_item_checked(CONTEXT_LEFT_LINEAR,
+ _curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR);
+ }
+ if (_selected_point + 1 < _curve_ref->get_point_count()) {
+ _context_menu->add_check_item(TTR("Right linear"), CONTEXT_RIGHT_LINEAR);
+ _context_menu->set_item_checked(CONTEXT_RIGHT_LINEAR,
+ _curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR);
+ }
+ }
+ }
+
+ _context_menu->add_separator();
+ }
+
+ _context_menu->add_submenu_item(TTR("Load preset"), _presets_menu->get_name());
+
+ _context_menu->popup();
+}
+
+int CurveEditor::get_point_at(Vector2 pos) const {
+ if (_curve_ref.is_null())
+ return -1;
+ const Curve &curve = **_curve_ref;
+
+ const float r = _hover_radius * _hover_radius;
+
+ for (int i = 0; i < curve.get_point_count(); ++i) {
+ Vector2 p = get_view_pos(curve.get_point_pos(i));
+ if (p.distance_squared_to(pos) <= r) {
+ return i;
+ }
+ }
+
+ return -1;
+}
+
+CurveEditor::TangentIndex CurveEditor::get_tangent_at(Vector2 pos) const {
+ if (_curve_ref.is_null() || _selected_point < 0)
+ return TANGENT_NONE;
+
+ if (_selected_point != 0) {
+ Vector2 control_pos = get_tangent_view_pos(_selected_point, TANGENT_LEFT);
+ if (control_pos.distance_to(pos) < _hover_radius) {
+ return TANGENT_LEFT;
+ }
+ }
+
+ if (_selected_point != _curve_ref->get_point_count() - 1) {
+ Vector2 control_pos = get_tangent_view_pos(_selected_point, TANGENT_RIGHT);
+ if (control_pos.distance_to(pos) < _hover_radius) {
+ return TANGENT_RIGHT;
+ }
+ }
+
+ return TANGENT_NONE;
+}
+
+void CurveEditor::add_point(Vector2 pos) {
+ ERR_FAIL_COND(_curve_ref.is_null());
+
+ UndoRedo &ur = *EditorNode::get_singleton()->get_undo_redo();
+ ur.create_action(TTR("Remove Curve Point"));
+
+ Vector2 point_pos = get_world_pos(pos);
+ if (point_pos.y < 0.0)
+ point_pos.y = 0.0;
+ else if (point_pos.y > 1.0)
+ point_pos.y = 1.0;
+
+ // Small trick to get the point index to feed the undo method
+ int i = _curve_ref->add_point(point_pos);
+ _curve_ref->remove_point(i);
+
+ ur.add_do_method(*_curve_ref, "add_point", point_pos);
+ ur.add_undo_method(*_curve_ref, "remove_point", i);
+
+ ur.commit_action();
+}
+
+void CurveEditor::remove_point(int index) {
+ ERR_FAIL_COND(_curve_ref.is_null());
+
+ UndoRedo &ur = *EditorNode::get_singleton()->get_undo_redo();
+ ur.create_action(TTR("Remove Curve Point"));
+
+ Curve::Point p = _curve_ref->get_point(index);
+
+ ur.add_do_method(*_curve_ref, "remove_point", index);
+ ur.add_undo_method(*_curve_ref, "add_point", p.pos, p.left_tangent, p.right_tangent, p.left_mode, p.right_mode);
+
+ if (index == _selected_point)
+ set_selected_point(-1);
+
+ ur.commit_action();
+}
+
+void CurveEditor::toggle_linear(TangentIndex tangent) {
+ ERR_FAIL_COND(_curve_ref.is_null());
+
+ UndoRedo &ur = *EditorNode::get_singleton()->get_undo_redo();
+ ur.create_action(TTR("Toggle Curve Linear Tangent"));
+
+ if (tangent == TANGENT_NONE)
+ tangent = _selected_tangent;
+
+ if (tangent == TANGENT_LEFT) {
+
+ bool is_linear = _curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR;
+
+ Curve::TangentMode prev_mode = _curve_ref->get_point_left_mode(_selected_point);
+ Curve::TangentMode mode = is_linear ? Curve::TANGENT_FREE : Curve::TANGENT_LINEAR;
+
+ ur.add_do_method(*_curve_ref, "set_point_left_mode", _selected_point, mode);
+ ur.add_undo_method(*_curve_ref, "set_point_left_mode", _selected_point, prev_mode);
+
+ } else {
+
+ bool is_linear = _curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR;
+
+ Curve::TangentMode prev_mode = _curve_ref->get_point_right_mode(_selected_point);
+ Curve::TangentMode mode = is_linear ? Curve::TANGENT_FREE : Curve::TANGENT_LINEAR;
+
+ ur.add_do_method(*_curve_ref, "set_point_right_mode", _selected_point, mode);
+ ur.add_undo_method(*_curve_ref, "set_point_right_mode", _selected_point, prev_mode);
+ }
+
+ ur.commit_action();
+}
+
+void CurveEditor::set_selected_point(int index) {
+ if (index != _selected_point) {
+ _selected_point = index;
+ update();
+ }
+}
+
+void CurveEditor::set_hover_point_index(int index) {
+ if (index != _hover_point) {
+ _hover_point = index;
+ update();
+ }
+}
+
+void CurveEditor::update_view_transform() {
+ Vector2 control_size = get_size();
+ const real_t margin = 24;
+
+ float min_y = 0;
+ float max_y = 1;
+
+ if (_curve_ref.is_valid()) {
+ min_y = _curve_ref->get_min_value();
+ max_y = _curve_ref->get_max_value();
+ }
+
+ Rect2 world_rect = Rect2(Curve::MIN_X, min_y, Curve::MAX_X, max_y - min_y);
+ Vector2 wm = Vector2(margin, margin) / control_size;
+ wm.y *= (max_y - min_y);
+ world_rect.position -= wm;
+ world_rect.size += 2.0 * wm;
+
+ _world_to_view = Transform2D();
+ _world_to_view.translate(-world_rect.position - Vector2(0, world_rect.size.y));
+ _world_to_view.scale(Vector2(control_size.x, -control_size.y) / world_rect.size);
+}
+
+Vector2 CurveEditor::get_tangent_view_pos(int i, TangentIndex tangent) const {
+
+ Vector2 dir;
+ if (tangent == TANGENT_LEFT)
+ dir = -Vector2(1, _curve_ref->get_point_left_tangent(i));
+ else
+ dir = Vector2(1, _curve_ref->get_point_right_tangent(i));
+
+ Vector2 point_pos = get_view_pos(_curve_ref->get_point_pos(i));
+ Vector2 control_pos = get_view_pos(_curve_ref->get_point_pos(i) + dir);
+
+ return point_pos + _tangents_length * (control_pos - point_pos).normalized();
+}
+
+Vector2 CurveEditor::get_view_pos(Vector2 world_pos) const {
+ return _world_to_view.xform(world_pos);
+}
+
+Vector2 CurveEditor::get_world_pos(Vector2 view_pos) const {
+ return _world_to_view.affine_inverse().xform(view_pos);
+}
+
+// Uses non-baked points, but takes advantage of ordered iteration to be faster
+template <typename T>
+static void plot_curve_accurate(const Curve &curve, float step, T plot_func) {
+
+ if (curve.get_point_count() <= 1) {
+ // Not enough points to make a curve, so it's just a straight line
+ float y = curve.interpolate(0);
+ plot_func(Vector2(0, y), Vector2(1.f, y), true);
+
+ } else {
+ Vector2 first_point = curve.get_point_pos(0);
+ Vector2 last_point = curve.get_point_pos(curve.get_point_count() - 1);
+
+ // Edge lines
+ plot_func(Vector2(0, first_point.y), first_point, false);
+ plot_func(Vector2(Curve::MAX_X, last_point.y), last_point, false);
+
+ // Draw section by section, so that we get maximum precision near points.
+ // It's an accurate representation, but slower than using the baked one.
+ for (int i = 1; i < curve.get_point_count(); ++i) {
+ Vector2 a = curve.get_point_pos(i - 1);
+ Vector2 b = curve.get_point_pos(i);
+
+ Vector2 pos = a;
+ Vector2 prev_pos = a;
+
+ float len = b.x - a.x;
+ //float step = 4.f / view_size.x;
+
+ for (float x = step; x < len; x += step) {
+ pos.x = a.x + x;
+ pos.y = curve.interpolate_local_nocheck(i - 1, x);
+ plot_func(prev_pos, pos, true);
+ prev_pos = pos;
+ }
+
+ plot_func(prev_pos, b, true);
+ }
+ }
+}
+
+struct CanvasItemPlotCurve {
+
+ CanvasItem &ci;
+ Color color1;
+ Color color2;
+
+ CanvasItemPlotCurve(CanvasItem &p_ci, Color p_color1, Color p_color2)
+ : ci(p_ci), color1(p_color1), color2(p_color2) {}
+
+ void operator()(Vector2 pos0, Vector2 pos1, bool in_definition) {
+ ci.draw_line(pos0, pos1, in_definition ? color1 : color2);
+ }
+};
+
+void CurveEditor::_draw() {
+ if (_curve_ref.is_null())
+ return;
+ Curve &curve = **_curve_ref;
+
+ update_view_transform();
+
+ // Background
+
+ Vector2 view_size = get_rect().size;
+ draw_style_box(get_stylebox("bg", "Tree"), Rect2(Point2(), view_size));
+
+ // Grid
+
+ draw_set_transform_matrix(_world_to_view);
+
+ Vector2 min_edge = get_world_pos(Vector2(0, view_size.y));
+ Vector2 max_edge = get_world_pos(Vector2(view_size.x, 0));
+
+ const Color grid_color0(0, 0, 0, 0.5);
+ const Color grid_color1(0, 0, 0, 0.15);
+ draw_line(Vector2(min_edge.x, curve.get_min_value()), Vector2(max_edge.x, curve.get_min_value()), grid_color0);
+ draw_line(Vector2(max_edge.x, curve.get_max_value()), Vector2(min_edge.x, curve.get_max_value()), grid_color0);
+ draw_line(Vector2(0, min_edge.y), Vector2(0, max_edge.y), grid_color0);
+ draw_line(Vector2(1, max_edge.y), Vector2(1, min_edge.y), grid_color0);
+
+ float curve_height = (curve.get_max_value() - curve.get_min_value());
+ const Vector2 grid_step(0.25, 0.5 * curve_height);
+
+ for (real_t x = 0; x < 1.0; x += grid_step.x) {
+ draw_line(Vector2(x, min_edge.y), Vector2(x, max_edge.y), grid_color1);
+ }
+ for (real_t y = curve.get_min_value(); y < curve.get_max_value(); y += grid_step.y) {
+ draw_line(Vector2(min_edge.x, y), Vector2(max_edge.x, y), grid_color1);
+ }
+
+ // Markings
+
+ draw_set_transform_matrix(Transform2D());
+
+ Ref<Font> font = get_font("font", "Label");
+ float font_height = font->get_height();
+ const Color text_color(1, 1, 1, 0.3);
+
+ {
+ // X axis
+ float y = curve.get_min_value();
+ Vector2 off(0, font_height - 1);
+ draw_string(font, get_view_pos(Vector2(0, y)) + off, "0.0", text_color);
+ draw_string(font, get_view_pos(Vector2(0.25, y)) + off, "0.25", text_color);
+ draw_string(font, get_view_pos(Vector2(0.5, y)) + off, "0.5", text_color);
+ draw_string(font, get_view_pos(Vector2(0.75, y)) + off, "0.75", text_color);
+ draw_string(font, get_view_pos(Vector2(1, y)) + off, "1.0", text_color);
+ }
+
+ {
+ // Y axis
+ float m0 = curve.get_min_value();
+ float m1 = 0.5 * (curve.get_min_value() + curve.get_max_value());
+ float m2 = curve.get_max_value();
+ Vector2 off(1, -1);
+ draw_string(font, get_view_pos(Vector2(0, m0)) + off, String::num(m0, 2), text_color);
+ draw_string(font, get_view_pos(Vector2(0, m1)) + off, String::num(m1, 2), text_color);
+ draw_string(font, get_view_pos(Vector2(0, m2)) + off, String::num(m2, 3), text_color);
+ }
+
+ // Draw tangents for current point
+
+ if (_selected_point >= 0) {
+
+ const Color tangent_color(0.5, 0.5, 1, 1);
+
+ int i = _selected_point;
+ Vector2 pos = curve.get_point_pos(i);
+
+ if (i != 0) {
+ Vector2 control_pos = get_tangent_view_pos(i, TANGENT_LEFT);
+ draw_line(get_view_pos(pos), control_pos, tangent_color);
+ draw_rect(Rect2(control_pos, Vector2(1, 1)).grow(2), tangent_color);
+ }
+
+ if (i != curve.get_point_count() - 1) {
+ Vector2 control_pos = get_tangent_view_pos(i, TANGENT_RIGHT);
+ draw_line(get_view_pos(pos), control_pos, tangent_color);
+ draw_rect(Rect2(control_pos, Vector2(1, 1)).grow(2), tangent_color);
+ }
+ }
+
+ // Draw lines
+
+ draw_set_transform_matrix(_world_to_view);
+
+ const Color line_color(1, 1, 1, 0.85);
+ const Color edge_line_color(1, 1, 1, 0.4);
+
+ CanvasItemPlotCurve plot_func(*this, line_color, edge_line_color);
+ plot_curve_accurate(curve, 4.f / view_size.x, plot_func);
+
+ /*// TEST draw baked curve
+ {
+ Vector2 pos = Vector2(0, curve.interpolate_baked(0));
+ Vector2 prev_pos = pos;
+
+ float len = 1.0;
+ float step = 4.f / view_size.x;
+
+ for(float x = step; x < len; x += step) {
+ pos.x = x;
+ pos.y = curve.interpolate_baked(x);
+ draw_line(get_point_view_pos(prev_pos), get_point_view_pos(pos), Color(0,1,0));
+ prev_pos = pos;
+ }
+
+ draw_line(get_point_view_pos(prev_pos), get_point_view_pos(Vector2(1, curve.interpolate_baked(1))), Color(0,1,0));
+ }//*/
+
+ // Draw points
+
+ draw_set_transform_matrix(Transform2D());
+
+ const Color point_color(1, 1, 1);
+ const Color selected_point_color(1, 0.5, 0.5);
+
+ for (int i = 0; i < curve.get_point_count(); ++i) {
+ Vector2 pos = curve.get_point_pos(i);
+ draw_rect(Rect2(get_view_pos(pos), Vector2(1, 1)).grow(3), i == _selected_point ? selected_point_color : point_color);
+ // TODO Circles are prettier. Needs a fix! Or a texture
+ //draw_circle(pos, 2, point_color);
+ }
+
+ // Hover
+
+ if (_hover_point != -1) {
+ const Color hover_color = line_color;
+ Vector2 pos = curve.get_point_pos(_hover_point);
+ stroke_rect(Rect2(get_view_pos(pos), Vector2(1, 1)).grow(_hover_radius), hover_color);
+ }
+
+ // Help text
+
+ if (_selected_point > 0 && _selected_point + 1 < curve.get_point_count()) {
+ draw_string(font, Vector2(50, font_height), TTR("Hold Shift to edit tangents individually"), text_color);
+ }
+}
+
+// TODO That should be part of the drawing API...
+void CurveEditor::stroke_rect(Rect2 rect, Color color) {
+
+ // a---b
+ // | |
+ // c---d
+ Vector2 a(rect.position);
+ Vector2 b(rect.position.x + rect.size.x, rect.position.y);
+ Vector2 c(rect.position.x, rect.position.y + rect.size.y);
+ Vector2 d(rect.position + rect.size);
+
+ draw_line(a, b, color);
+ draw_line(b, d, color);
+ draw_line(d, c, color);
+ draw_line(c, a, color);
+}
+
+void CurveEditor::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("_gui_input"), &CurveEditor::on_gui_input);
+ ClassDB::bind_method(D_METHOD("_on_preset_item_selected"), &CurveEditor::on_preset_item_selected);
+ ClassDB::bind_method(D_METHOD("_curve_changed"), &CurveEditor::_curve_changed);
+ ClassDB::bind_method(D_METHOD("_on_context_menu_item_selected"), &CurveEditor::on_context_menu_item_selected);
+}
+
+//---------------
+
+CurveEditorPlugin::CurveEditorPlugin(EditorNode *p_node) {
+ _editor_node = p_node;
+
+ _view = memnew(CurveEditor);
+ _view->set_custom_minimum_size(Size2(100, 128 * EDSCALE));
+ _view->hide();
+
+ _toggle_button = _editor_node->add_bottom_panel_item(get_name(), _view);
+ _toggle_button->hide();
+
+ get_resource_previewer()->add_preview_generator(memnew(CurvePreviewGenerator));
+}
+
+CurveEditorPlugin::~CurveEditorPlugin() {
+}
+
+void CurveEditorPlugin::edit(Object *p_object) {
+
+ Ref<Curve> curve_ref;
+
+ if (_current_ref.is_valid()) {
+ CurveTexture *ct = _current_ref->cast_to<CurveTexture>();
+ if (ct)
+ ct->disconnect(CoreStringNames::get_singleton()->changed, this, "_curve_texture_changed");
+ }
+
+ if (p_object) {
+ Resource *res = p_object->cast_to<Resource>();
+ ERR_FAIL_COND(res == NULL);
+ ERR_FAIL_COND(!handles(p_object));
+
+ _current_ref = Ref<Resource>(p_object->cast_to<Resource>());
+
+ if (_current_ref.is_valid()) {
+ Curve *curve = _current_ref->cast_to<Curve>();
+ if (curve)
+ curve_ref = Ref<Curve>(curve);
+ else {
+ CurveTexture *ct = _current_ref->cast_to<CurveTexture>();
+ if (ct) {
+ ct->connect(CoreStringNames::get_singleton()->changed, this, "_curve_texture_changed");
+ curve_ref = ct->get_curve();
+ }
+ }
+ }
+
+ } else {
+ _current_ref = Ref<Resource>();
+ }
+
+ _view->set_curve(curve_ref);
+}
+
+bool CurveEditorPlugin::handles(Object *p_object) const {
+ // Both handled so that we can keep the curve editor open
+ return p_object->cast_to<Curve>() || p_object->cast_to<CurveTexture>();
+}
+
+void CurveEditorPlugin::make_visible(bool p_visible) {
+ if (p_visible) {
+ _toggle_button->show();
+ _editor_node->make_bottom_panel_item_visible(_view);
+ } else {
+ _toggle_button->hide();
+ if (_view->is_visible_in_tree())
+ _editor_node->hide_bottom_panel();
+ }
+}
+
+void CurveEditorPlugin::_curve_texture_changed() {
+ // If the curve is shown indirectly as a CurveTexture is edited,
+ // we need to monitor when the curve property gets assigned
+ CurveTexture *ct = _current_ref->cast_to<CurveTexture>();
+ if (ct) {
+ _view->set_curve(ct->get_curve());
+ }
+}
+
+void CurveEditorPlugin::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("_curve_texture_changed"), &CurveEditorPlugin::_curve_texture_changed);
+}
+
+//-----------------------------------
+// Preview generator
+
+bool CurvePreviewGenerator::handles(const String &p_type) const {
+ return p_type == "Curve";
+}
+
+Ref<Texture> CurvePreviewGenerator::generate(const Ref<Resource> &p_from) {
+
+ Ref<Curve> curve_ref = p_from;
+ ERR_FAIL_COND_V(curve_ref.is_null(), Ref<Texture>());
+ Curve &curve = **curve_ref;
+
+ int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
+ thumbnail_size *= EDSCALE;
+ Ref<Image> img_ref;
+ img_ref.instance();
+ Image &im = **img_ref;
+
+ im.create(thumbnail_size, thumbnail_size, 0, Image::FORMAT_RGBA8);
+
+ im.lock();
+
+ Color bg_color(0.1, 0.1, 0.1, 1.0);
+ for (int i = 0; i < thumbnail_size; i++) {
+ for (int j = 0; j < thumbnail_size; j++) {
+ im.set_pixel(i, j, bg_color);
+ }
+ }
+
+ Color line_color(0.8, 0.8, 0.8, 1.0);
+ float range_y = curve.get_max_value() - curve.get_min_value();
+
+ int prev_y = 0;
+ for (int x = 0; x < im.get_width(); ++x) {
+
+ float t = static_cast<float>(x) / im.get_width();
+ float v = (curve.interpolate_baked(t) - curve.get_min_value()) / range_y;
+ int y = CLAMP(im.get_height() - v * im.get_height(), 0, im.get_height());
+
+ // Plot point
+ if (y >= 0 && y < im.get_height()) {
+ im.set_pixel(x, y, line_color);
+ }
+
+ // Plot vertical line to fix discontinuity (not 100% correct but enough for a preview)
+ if (x != 0 && Math::abs(y - prev_y) > 1) {
+ int y0, y1;
+ if (y < prev_y) {
+ y0 = y;
+ y1 = prev_y;
+ } else {
+ y0 = prev_y;
+ y1 = y;
+ }
+ for (int ly = y0; ly < y1; ++ly) {
+ im.set_pixel(x, ly, line_color);
+ }
+ }
+
+ prev_y = y;
+ }
+
+ im.unlock();
+
+ Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture));
+
+ ptex->create_from_image(img_ref, 0);
+ return ptex;
+}
diff --git a/editor/plugins/curve_editor_plugin.h b/editor/plugins/curve_editor_plugin.h
new file mode 100644
index 0000000000..040c298a92
--- /dev/null
+++ b/editor/plugins/curve_editor_plugin.h
@@ -0,0 +1,153 @@
+/*************************************************************************/
+/* curve_editor_plugin.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 CURVE_EDITOR_PLUGIN_H
+#define CURVE_EDITOR_PLUGIN_H
+
+#include "editor/editor_node.h"
+#include "editor/editor_plugin.h"
+#include "scene/resources/curve.h"
+
+// Edits a y(x) curve
+class CurveEditor : public Control {
+ GDCLASS(CurveEditor, Control)
+public:
+ CurveEditor();
+
+ Size2 get_minimum_size() const;
+
+ void set_curve(Ref<Curve> curve);
+
+ enum PresetID {
+ PRESET_FLAT0 = 0,
+ PRESET_FLAT1,
+ PRESET_LINEAR,
+ PRESET_EASE_IN,
+ PRESET_EASE_OUT,
+ PRESET_SMOOTHSTEP,
+ PRESET_COUNT
+ };
+
+ enum ContextAction {
+ CONTEXT_ADD_POINT = 0,
+ CONTEXT_REMOVE_POINT,
+ CONTEXT_LINEAR,
+ CONTEXT_LEFT_LINEAR,
+ CONTEXT_RIGHT_LINEAR
+ };
+
+ enum TangentIndex {
+ TANGENT_NONE = -1,
+ TANGENT_LEFT = 0,
+ TANGENT_RIGHT = 1
+ };
+
+protected:
+ void _notification(int p_what);
+
+ static void _bind_methods();
+
+private:
+ void on_gui_input(const Ref<InputEvent> &p_event);
+ void on_preset_item_selected(int preset_id);
+ void _curve_changed();
+ void on_context_menu_item_selected(int action_id);
+
+ void open_context_menu(Vector2 pos);
+ int get_point_at(Vector2 pos) const;
+ TangentIndex get_tangent_at(Vector2 pos) const;
+ void add_point(Vector2 pos);
+ void remove_point(int index);
+ void toggle_linear(TangentIndex tangent = TANGENT_NONE);
+ void set_selected_point(int index);
+ void set_hover_point_index(int index);
+ void update_view_transform();
+
+ Vector2 get_tangent_view_pos(int i, TangentIndex tangent) const;
+ Vector2 get_view_pos(Vector2 world_pos) const;
+ Vector2 get_world_pos(Vector2 view_pos) const;
+
+ void _draw();
+
+ void stroke_rect(Rect2 rect, Color color);
+
+private:
+ Transform2D _world_to_view;
+
+ Ref<Curve> _curve_ref;
+ PopupMenu *_context_menu;
+ PopupMenu *_presets_menu;
+
+ Array _undo_data;
+ bool _has_undo_data;
+
+ Vector2 _context_click_pos;
+ int _selected_point;
+ int _hover_point;
+ TangentIndex _selected_tangent;
+ bool _dragging;
+
+ // Constant
+ float _hover_radius;
+ float _tangents_length;
+};
+
+class CurveEditorPlugin : public EditorPlugin {
+ GDCLASS(CurveEditorPlugin, EditorPlugin)
+public:
+ CurveEditorPlugin(EditorNode *p_node);
+ ~CurveEditorPlugin();
+
+ String get_name() const { return "Curve"; }
+ bool has_main_screen() const { return false; }
+ void edit(Object *p_object);
+ bool handles(Object *p_object) const;
+ void make_visible(bool p_visible);
+
+private:
+ static void _bind_methods();
+
+ void _curve_texture_changed();
+
+private:
+ CurveEditor *_view;
+ Ref<Resource> _current_ref;
+ EditorNode *_editor_node;
+ ToolButton *_toggle_button;
+};
+
+class CurvePreviewGenerator : public EditorResourcePreviewGenerator {
+ GDCLASS(CurvePreviewGenerator, EditorResourcePreviewGenerator)
+public:
+ bool handles(const String &p_type) const;
+ Ref<Texture> generate(const Ref<Resource> &p_from);
+};
+
+#endif // CURVE_EDITOR_PLUGIN_H
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp
index eaadf3976b..ce6eefd694 100644
--- a/editor/plugins/editor_preview_plugins.cpp
+++ b/editor/plugins/editor_preview_plugins.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,239 +39,226 @@
#include "scene/resources/bit_mask.h"
#include "scene/resources/mesh.h"
-#if 0
-bool EditorTexturePreviewPlugin::handles(const String& p_type) const {
+bool EditorTexturePreviewPlugin::handles(const String &p_type) const {
- return (ClassDB::is_type(p_type,"ImageTexture") || ClassDB::is_type(p_type, "AtlasTexture"));
+ return ClassDB::is_parent_class(p_type, "Texture");
}
-Ref<Texture> EditorTexturePreviewPlugin::generate(const RES& p_from) {
+Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from) {
- Image img;
+ Ref<Image> img;
Ref<AtlasTexture> atex = p_from;
if (atex.is_valid()) {
- Ref<ImageTexture> tex = atex->get_atlas();
+ Ref<Texture> tex = atex->get_atlas();
if (!tex.is_valid()) {
return Ref<Texture>();
}
- Image atlas = tex->get_data();
- img = atlas.get_rect(atex->get_region());
- }
- else {
- Ref<ImageTexture> tex = p_from;
+ Ref<Image> atlas = tex->get_data();
+ img = atlas->get_rect(atex->get_region());
+ } else {
+ Ref<Texture> tex = p_from;
img = tex->get_data();
}
- if (img.empty())
+ if (img.is_null() || img->empty())
return Ref<Texture>();
- img.clear_mipmaps();
+ img->clear_mipmaps();
int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
- thumbnail_size*=EDSCALE;
- if (img.is_compressed()) {
- if (img.decompress()!=OK)
+ thumbnail_size *= EDSCALE;
+ if (img->is_compressed()) {
+ if (img->decompress() != OK)
return Ref<Texture>();
- } else if (img.get_format()!=Image::FORMAT_RGB8 && img.get_format()!=Image::FORMAT_RGBA8) {
- img.convert(Image::FORMAT_RGBA8);
+ } else if (img->get_format() != Image::FORMAT_RGB8 && img->get_format() != Image::FORMAT_RGBA8) {
+ img->convert(Image::FORMAT_RGBA8);
}
- int width,height;
- if (img.get_width() > thumbnail_size && img.get_width() >= img.get_height()) {
+ int width, height;
+ if (img->get_width() > thumbnail_size && img->get_width() >= img->get_height()) {
- width=thumbnail_size;
- height = img.get_height() * thumbnail_size / img.get_width();
- } else if (img.get_height() > thumbnail_size && img.get_height() >= img.get_width()) {
+ width = thumbnail_size;
+ height = img->get_height() * thumbnail_size / img->get_width();
+ } else if (img->get_height() > thumbnail_size && img->get_height() >= img->get_width()) {
- height=thumbnail_size;
- width = img.get_width() * thumbnail_size / img.get_height();
- } else {
+ height = thumbnail_size;
+ width = img->get_width() * thumbnail_size / img->get_height();
+ } else {
- width=img.get_width();
- height=img.get_height();
+ width = img->get_width();
+ height = img->get_height();
}
- img.resize(width,height);
+ img->resize(width, height);
- Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture ));
+ Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture));
- ptex->create_from_image(img,0);
+ ptex->create_from_image(img, 0);
return ptex;
-
}
EditorTexturePreviewPlugin::EditorTexturePreviewPlugin() {
-
-
}
////////////////////////////////////////////////////////////////////////////
-bool EditorBitmapPreviewPlugin::handles(const String& p_type) const {
+bool EditorBitmapPreviewPlugin::handles(const String &p_type) const {
- return ClassDB::is_type(p_type,"BitMap");
+ return ClassDB::is_parent_class(p_type, "BitMap");
}
-Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES& p_from) {
+Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES &p_from) {
- Ref<BitMap> bm =p_from;
+ Ref<BitMap> bm = p_from;
- if (bm->get_size()==Size2()) {
+ if (bm->get_size() == Size2()) {
return Ref<Texture>();
}
PoolVector<uint8_t> data;
- data.resize(bm->get_size().width*bm->get_size().height);
+ data.resize(bm->get_size().width * bm->get_size().height);
{
- PoolVector<uint8_t>::Write w=data.write();
+ PoolVector<uint8_t>::Write w = data.write();
- for(int i=0;i<bm->get_size().width;i++) {
- for(int j=0;j<bm->get_size().height;j++) {
- if (bm->get_bit(Point2i(i,j))) {
- w[j*bm->get_size().width+i]=255;
+ for (int i = 0; i < bm->get_size().width; i++) {
+ for (int j = 0; j < bm->get_size().height; j++) {
+ if (bm->get_bit(Point2i(i, j))) {
+ w[j * bm->get_size().width + i] = 255;
} else {
- w[j*bm->get_size().width+i]=0;
-
+ w[j * bm->get_size().width + i] = 0;
}
}
-
}
}
-
- Image img(bm->get_size().width,bm->get_size().height,0,Image::FORMAT_L8,data);
+ Ref<Image> img;
+ img.instance();
+ img->create(bm->get_size().width, bm->get_size().height, 0, Image::FORMAT_L8, data);
int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
- thumbnail_size*=EDSCALE;
- if (img.is_compressed()) {
- if (img.decompress()!=OK)
+ thumbnail_size *= EDSCALE;
+ if (img->is_compressed()) {
+ if (img->decompress() != OK)
return Ref<Texture>();
- } else if (img.get_format()!=Image::FORMAT_RGB8 && img.get_format()!=Image::FORMAT_RGBA8) {
- img.convert(Image::FORMAT_RGBA8);
+ } else if (img->get_format() != Image::FORMAT_RGB8 && img->get_format() != Image::FORMAT_RGBA8) {
+ img->convert(Image::FORMAT_RGBA8);
}
- int width,height;
- if (img.get_width() > thumbnail_size && img.get_width() >= img.get_height()) {
+ int width, height;
+ if (img->get_width() > thumbnail_size && img->get_width() >= img->get_height()) {
- width=thumbnail_size;
- height = img.get_height() * thumbnail_size / img.get_width();
- } else if (img.get_height() > thumbnail_size && img.get_height() >= img.get_width()) {
+ width = thumbnail_size;
+ height = img->get_height() * thumbnail_size / img->get_width();
+ } else if (img->get_height() > thumbnail_size && img->get_height() >= img->get_width()) {
- height=thumbnail_size;
- width = img.get_width() * thumbnail_size / img.get_height();
- } else {
+ height = thumbnail_size;
+ width = img->get_width() * thumbnail_size / img->get_height();
+ } else {
- width=img.get_width();
- height=img.get_height();
+ width = img->get_width();
+ height = img->get_height();
}
- img.resize(width,height);
+ img->resize(width, height);
- Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture ));
+ Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture));
- ptex->create_from_image(img,0);
+ ptex->create_from_image(img, 0);
return ptex;
-
}
EditorBitmapPreviewPlugin::EditorBitmapPreviewPlugin() {
-
-
}
///////////////////////////////////////////////////////////////////////////
+bool EditorPackedScenePreviewPlugin::handles(const String &p_type) const {
-Ref<Texture> EditorPackedScenePreviewPlugin::_gen_from_imd(Ref<ResourceImportMetadata> p_imd) {
-
- if (p_imd.is_null()) {
- return Ref<Texture>();
- }
+ return ClassDB::is_parent_class(p_type, "PackedScene");
+}
+Ref<Texture> EditorPackedScenePreviewPlugin::generate(const RES &p_from) {
- if (!p_imd->has_option("thumbnail"))
- return Ref<Texture>();
+ return generate_from_path(p_from->get_path());
+}
- Variant tn = p_imd->get_option("thumbnail");
- //print_line(Variant::get_type_name(tn.get_type()));
- PoolVector<uint8_t> thumbnail = tn;
+Ref<Texture> EditorPackedScenePreviewPlugin::generate_from_path(const String &p_path) {
- int len = thumbnail.size();
- if (len==0)
- return Ref<Texture>();
+ String temp_path = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp");
+ String cache_base = ProjectSettings::get_singleton()->globalize_path(p_path).md5_text();
+ cache_base = temp_path.plus_file("resthumb-" + cache_base);
+ //does not have it, try to load a cached thumbnail
- PoolVector<uint8_t>::Read r = thumbnail.read();
+ String path = cache_base + ".png";
- Image img(r.ptr(),len);
- if (img.empty())
+ if (!FileAccess::exists(path))
return Ref<Texture>();
- Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture ));
- ptex->create_from_image(img,0);
- return ptex;
+ Ref<Image> img;
+ img.instance();
+ Error err = img->load(path);
+ if (err == OK) {
-}
+ Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture));
-bool EditorPackedScenePreviewPlugin::handles(const String& p_type) const {
+ ptex->create_from_image(img, 0);
+ return ptex;
- return ClassDB::is_type(p_type,"PackedScene");
+ } else {
+ return Ref<Texture>();
+ }
}
-Ref<Texture> EditorPackedScenePreviewPlugin::generate(const RES& p_from) {
- Ref<ResourceImportMetadata> imd = p_from->get_import_metadata();
- return _gen_from_imd(imd);
+EditorPackedScenePreviewPlugin::EditorPackedScenePreviewPlugin() {
}
-Ref<Texture> EditorPackedScenePreviewPlugin::generate_from_path(const String& p_path) {
+//////////////////////////////////////////////////////////////////
+
+void EditorMaterialPreviewPlugin::_preview_done(const Variant &p_udata) {
- Ref<ResourceImportMetadata> imd = ResourceLoader::load_import_metadata(p_path);
- return _gen_from_imd(imd);
+ preview_done = true;
}
-EditorPackedScenePreviewPlugin::EditorPackedScenePreviewPlugin() {
+void EditorMaterialPreviewPlugin::_bind_methods() {
+ ClassDB::bind_method("_preview_done", &EditorMaterialPreviewPlugin::_preview_done);
}
-//////////////////////////////////////////////////////////////////
+bool EditorMaterialPreviewPlugin::handles(const String &p_type) const {
-bool EditorMaterialPreviewPlugin::handles(const String& p_type) const {
-
- return ClassDB::is_type(p_type,"Material"); //any material
+ return ClassDB::is_parent_class(p_type, "Material"); //any material
}
-Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES& p_from) {
+Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES &p_from) {
Ref<Material> material = p_from;
- ERR_FAIL_COND_V(material.is_null(),Ref<Texture>());
+ ERR_FAIL_COND_V(material.is_null(), Ref<Texture>());
- VS::get_singleton()->mesh_surface_set_material(sphere,0,material->get_rid());
+ VS::get_singleton()->mesh_surface_set_material(sphere, 0, material->get_rid());
- VS::get_singleton()->viewport_queue_screen_capture(viewport);
- VS::get_singleton()->viewport_set_render_target_update_mode(viewport,VS::RENDER_TARGET_UPDATE_ONCE); //once used for capture
+ VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ONCE); //once used for capture
//print_line("queue capture!");
- Image img;
- int timeout=1000;
- while(timeout) {
- //print_line("try capture?");
+ preview_done = false;
+ VS::get_singleton()->request_frame_drawn_callback(this, "_preview_done", Variant());
+
+ while (!preview_done) {
OS::get_singleton()->delay_usec(10);
- img = VS::get_singleton()->viewport_get_screen_capture(viewport);
- if (!img.empty())
- break;
- timeout--;
}
- //print_line("captured!");
- VS::get_singleton()->mesh_surface_set_material(sphere,0,RID());
+ Ref<Image> img = VS::get_singleton()->VS::get_singleton()->texture_get_data(viewport_texture);
+ VS::get_singleton()->mesh_surface_set_material(sphere, 0, RID());
- int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
- thumbnail_size*=EDSCALE;
- img.resize(thumbnail_size,thumbnail_size);
+ ERR_FAIL_COND_V(!img.is_valid(), Ref<ImageTexture>());
- Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture ));
- ptex->create_from_image(img,0);
+ int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
+ thumbnail_size *= EDSCALE;
+ img->convert(Image::FORMAT_RGBA8);
+ img->resize(thumbnail_size, thumbnail_size);
+ Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture));
+ ptex->create_from_image(img, 0);
return ptex;
}
@@ -279,70 +267,68 @@ EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() {
scenario = VS::get_singleton()->scenario_create();
viewport = VS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_as_render_target(viewport,true);
- VS::get_singleton()->viewport_set_render_target_update_mode(viewport,VS::RENDER_TARGET_UPDATE_DISABLED);
- VS::get_singleton()->viewport_set_scenario(viewport,scenario);
- VS::ViewportRect vr;
- vr.x=0;
- vr.y=0;
- vr.width=128;
- vr.height=128;
- VS::get_singleton()->viewport_set_rect(viewport,vr);
+ VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_DISABLED);
+ VS::get_singleton()->viewport_set_scenario(viewport, scenario);
+ VS::get_singleton()->viewport_set_size(viewport, 128, 128);
+ VS::get_singleton()->viewport_set_transparent_background(viewport, true);
+ VS::get_singleton()->viewport_set_active(viewport, true);
+ VS::get_singleton()->viewport_set_vflip(viewport, true);
+ viewport_texture = VS::get_singleton()->viewport_get_texture(viewport);
camera = VS::get_singleton()->camera_create();
- VS::get_singleton()->viewport_attach_camera(viewport,camera);
- VS::get_singleton()->camera_set_transform(camera,Transform(Matrix3(),Vector3(0,0,3)));
- VS::get_singleton()->camera_set_perspective(camera,45,0.1,10);
+ VS::get_singleton()->viewport_attach_camera(viewport, camera);
+ VS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3)));
+ VS::get_singleton()->camera_set_perspective(camera, 45, 0.1, 10);
light = VS::get_singleton()->light_create(VS::LIGHT_DIRECTIONAL);
- light_instance = VS::get_singleton()->instance_create2(light,scenario);
- VS::get_singleton()->instance_set_transform(light_instance,Transform().looking_at(Vector3(-1,-1,-1),Vector3(0,1,0)));
+ light_instance = VS::get_singleton()->instance_create2(light, scenario);
+ VS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
light2 = VS::get_singleton()->light_create(VS::LIGHT_DIRECTIONAL);
- VS::get_singleton()->light_set_color(light2,VS::LIGHT_COLOR_DIFFUSE,Color(0.7,0.7,0.7));
- VS::get_singleton()->light_set_color(light2,VS::LIGHT_COLOR_SPECULAR,Color(0.0,0.0,0.0));
- light_instance2 = VS::get_singleton()->instance_create2(light2,scenario);
+ VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+ //VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+
+ light_instance2 = VS::get_singleton()->instance_create2(light2, scenario);
- VS::get_singleton()->instance_set_transform(light_instance2,Transform().looking_at(Vector3(0,1,0),Vector3(0,0,1)));
+ VS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
sphere = VS::get_singleton()->mesh_create();
- sphere_instance = VS::get_singleton()->instance_create2(sphere,scenario);
+ sphere_instance = VS::get_singleton()->instance_create2(sphere, scenario);
- int lats=32;
- int lons=32;
- float radius=1.0;
+ int lats = 32;
+ int lons = 32;
+ float radius = 1.0;
PoolVector<Vector3> vertices;
PoolVector<Vector3> normals;
PoolVector<Vector2> uvs;
PoolVector<float> tangents;
- Matrix3 tt = Matrix3(Vector3(0,1,0),Math_PI*0.5);
+ Basis tt = Basis(Vector3(0, 1, 0), Math_PI * 0.5);
- for(int i = 1; i <= lats; i++) {
- double lat0 = Math_PI * (-0.5 + (double) (i - 1) / lats);
- double z0 = Math::sin(lat0);
- double zr0 = Math::cos(lat0);
+ for (int i = 1; i <= lats; i++) {
+ double lat0 = Math_PI * (-0.5 + (double)(i - 1) / lats);
+ double z0 = Math::sin(lat0);
+ double zr0 = Math::cos(lat0);
- double lat1 = Math_PI * (-0.5 + (double) i / lats);
+ double lat1 = Math_PI * (-0.5 + (double)i / lats);
double z1 = Math::sin(lat1);
double zr1 = Math::cos(lat1);
- for(int j = lons; j >= 1; j--) {
+ for (int j = lons; j >= 1; j--) {
- double lng0 = 2 * Math_PI * (double) (j - 1) / lons;
+ double lng0 = 2 * Math_PI * (double)(j - 1) / lons;
double x0 = Math::cos(lng0);
double y0 = Math::sin(lng0);
- double lng1 = 2 * Math_PI * (double) (j) / lons;
+ double lng1 = 2 * Math_PI * (double)(j) / lons;
double x1 = Math::cos(lng1);
double y1 = Math::sin(lng1);
-
- Vector3 v[4]={
- Vector3(x1 * zr0, z0, y1 *zr0),
- Vector3(x1 * zr1, z1, y1 *zr1),
- Vector3(x0 * zr1, z1, y0 *zr1),
- Vector3(x0 * zr0, z0, y0 *zr0)
+ Vector3 v[4] = {
+ Vector3(x1 * zr0, z0, y1 * zr0),
+ Vector3(x1 * zr1, z1, y1 * zr1),
+ Vector3(x0 * zr1, z1, y0 * zr1),
+ Vector3(x0 * zr0, z0, y0 * zr0)
};
#define ADD_POINT(m_idx) \
@@ -363,8 +349,6 @@ EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() {
tangents.push_back(1.0); \
}
-
-
ADD_POINT(0);
ADD_POINT(1);
ADD_POINT(2);
@@ -377,12 +361,11 @@ EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() {
Array arr;
arr.resize(VS::ARRAY_MAX);
- arr[VS::ARRAY_VERTEX]=vertices;
- arr[VS::ARRAY_NORMAL]=normals;
- arr[VS::ARRAY_TANGENT]=tangents;
- arr[VS::ARRAY_TEX_UV]=uvs;
- VS::get_singleton()->mesh_add_surface(sphere,VS::PRIMITIVE_TRIANGLES,arr);
-
+ arr[VS::ARRAY_VERTEX] = vertices;
+ arr[VS::ARRAY_NORMAL] = normals;
+ arr[VS::ARRAY_TANGENT] = tangents;
+ arr[VS::ARRAY_TEX_UV] = uvs;
+ VS::get_singleton()->mesh_add_surface_from_arrays(sphere, VS::PRIMITIVE_TRIANGLES, arr);
}
EditorMaterialPreviewPlugin::~EditorMaterialPreviewPlugin() {
@@ -396,30 +379,28 @@ EditorMaterialPreviewPlugin::~EditorMaterialPreviewPlugin() {
VS::get_singleton()->free(light_instance2);
VS::get_singleton()->free(camera);
VS::get_singleton()->free(scenario);
-
}
///////////////////////////////////////////////////////////////////////////
static bool _is_text_char(CharType c) {
- return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='_';
+ return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_';
}
-bool EditorScriptPreviewPlugin::handles(const String& p_type) const {
+bool EditorScriptPreviewPlugin::handles(const String &p_type) const {
- return ClassDB::is_type(p_type,"Script");
+ return ClassDB::is_parent_class(p_type, "Script");
}
-Ref<Texture> EditorScriptPreviewPlugin::generate(const RES& p_from) {
-
+Ref<Texture> EditorScriptPreviewPlugin::generate(const RES &p_from) {
Ref<Script> scr = p_from;
if (scr.is_null())
return Ref<Texture>();
String code = scr->get_source_code().strip_edges();
- if (code=="")
+ if (code == "")
return Ref<Texture>();
List<String> kwors;
@@ -427,107 +408,104 @@ Ref<Texture> EditorScriptPreviewPlugin::generate(const RES& p_from) {
Set<String> keywords;
- for(List<String>::Element *E=kwors.front();E;E=E->next()) {
+ for (List<String>::Element *E = kwors.front(); E; E = E->next()) {
keywords.insert(E->get());
-
}
-
int line = 0;
- int col=0;
+ int col = 0;
int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
- thumbnail_size*=EDSCALE;
- Image img(thumbnail_size,thumbnail_size,0,Image::FORMAT_RGBA8);
-
-
+ thumbnail_size *= EDSCALE;
+ Ref<Image> img;
+ img.instance();
+ img->create(thumbnail_size, thumbnail_size, 0, Image::FORMAT_RGBA8);
Color bg_color = EditorSettings::get_singleton()->get("text_editor/highlighting/background_color");
- bg_color.a=1.0;
+ bg_color.a = 1.0;
Color keyword_color = EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color");
Color text_color = EditorSettings::get_singleton()->get("text_editor/highlighting/text_color");
Color symbol_color = EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color");
+ img->lock();
- for(int i=0;i<thumbnail_size;i++) {
- for(int j=0;j<thumbnail_size;j++) {
- img.put_pixel(i,j,bg_color);
+ for (int i = 0; i < thumbnail_size; i++) {
+ for (int j = 0; j < thumbnail_size; j++) {
+ img->set_pixel(i, j, bg_color);
}
-
}
- bool prev_is_text=false;
- bool in_keyword=false;
- for(int i=0;i<code.length();i++) {
+ bool prev_is_text = false;
+ bool in_keyword = false;
+ for (int i = 0; i < code.length(); i++) {
CharType c = code[i];
- if (c>32) {
- if (col<thumbnail_size) {
+ if (c > 32) {
+ if (col < thumbnail_size) {
Color color = text_color;
- if (c!='_' && ((c>='!' && c<='/') || (c>=':' && c<='@') || (c>='[' && c<='`') || (c>='{' && c<='~') || c=='\t')) {
+ if (c != '_' && ((c >= '!' && c <= '/') || (c >= ':' && c <= '@') || (c >= '[' && c <= '`') || (c >= '{' && c <= '~') || c == '\t')) {
//make symbol a little visible
- color=symbol_color;
- in_keyword=false;
+ color = symbol_color;
+ in_keyword = false;
} else if (!prev_is_text && _is_text_char(c)) {
int pos = i;
- while(_is_text_char(code[pos])) {
+ while (_is_text_char(code[pos])) {
pos++;
}
///print_line("from "+itos(i)+" to "+itos(pos));
- String word = code.substr(i,pos-i);
+ String word = code.substr(i, pos - i);
//print_line("found word: "+word);
if (keywords.has(word))
- in_keyword=true;
+ in_keyword = true;
} else if (!_is_text_char(c)) {
- in_keyword=false;
+ in_keyword = false;
}
if (in_keyword)
- color=keyword_color;
+ color = keyword_color;
- Color ul=color;
- ul.a*=0.5;
- img.put_pixel(col,line*2,bg_color.blend(ul));
- img.put_pixel(col,line*2+1,color);
+ Color ul = color;
+ ul.a *= 0.5;
+ img->set_pixel(col, line * 2, bg_color.blend(ul));
+ img->set_pixel(col, line * 2 + 1, color);
- prev_is_text=_is_text_char(c);
+ prev_is_text = _is_text_char(c);
}
} else {
- prev_is_text=false;
- in_keyword=false;
+ prev_is_text = false;
+ in_keyword = false;
- if (c=='\n') {
- col=0;
+ if (c == '\n') {
+ col = 0;
line++;
- if (line>=thumbnail_size/2)
+ if (line >= thumbnail_size / 2)
break;
- } else if (c=='\t') {
- col+=3;
+ } else if (c == '\t') {
+ col += 3;
}
}
col++;
}
- Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture));
+ img->unlock();
- ptex->create_from_image(img,0);
- return ptex;
+ Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture));
+ ptex->create_from_image(img, 0);
+ return ptex;
}
EditorScriptPreviewPlugin::EditorScriptPreviewPlugin() {
-
-
}
///////////////////////////////////////////////////////////////////
#if 0
bool EditorSamplePreviewPlugin::handles(const String& p_type) const {
- return ClassDB::is_type(p_type,"Sample");
+ return ClassDB::is_parent_class(p_type,"Sample");
}
Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) {
@@ -794,105 +772,108 @@ EditorSamplePreviewPlugin::EditorSamplePreviewPlugin() {
#endif
///////////////////////////////////////////////////////////////////////////
-bool EditorMeshPreviewPlugin::handles(const String& p_type) const {
+void EditorMeshPreviewPlugin::_preview_done(const Variant &p_udata) {
- return ClassDB::is_type(p_type,"Mesh"); //any Mesh
+ preview_done = true;
}
-Ref<Texture> EditorMeshPreviewPlugin::generate(const RES& p_from) {
+void EditorMeshPreviewPlugin::_bind_methods() {
+
+ ClassDB::bind_method("_preview_done", &EditorMeshPreviewPlugin::_preview_done);
+}
+bool EditorMeshPreviewPlugin::handles(const String &p_type) const {
+
+ return ClassDB::is_parent_class(p_type, "Mesh"); //any Mesh
+}
+Ref<Texture> EditorMeshPreviewPlugin::generate(const RES &p_from) {
+
+ print_line("**Generating for mesh finally??");
Ref<Mesh> mesh = p_from;
- ERR_FAIL_COND_V(mesh.is_null(),Ref<Texture>());
+ ERR_FAIL_COND_V(mesh.is_null(), Ref<Texture>());
- VS::get_singleton()->instance_set_base(mesh_instance,mesh->get_rid());
+ VS::get_singleton()->instance_set_base(mesh_instance, mesh->get_rid());
- AABB aabb= mesh->get_aabb();
- Vector3 ofs = aabb.pos + aabb.size*0.5;
- aabb.pos-=ofs;
+ Rect3 aabb = mesh->get_aabb();
+ print_line("mesh aabb: " + aabb);
+ Vector3 ofs = aabb.position + aabb.size * 0.5;
+ aabb.position -= ofs;
Transform xform;
- xform.basis=Matrix3().rotated(Vector3(0,1,0),-Math_PI*0.125);
- xform.basis = Matrix3().rotated(Vector3(1,0,0),Math_PI*0.125)*xform.basis;
- AABB rot_aabb = xform.xform(aabb);
- float m = MAX(rot_aabb.size.x,rot_aabb.size.y)*0.5;
- if (m==0)
+ xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math_PI * 0.125);
+ xform.basis = Basis().rotated(Vector3(1, 0, 0), Math_PI * 0.125) * xform.basis;
+ Rect3 rot_aabb = xform.xform(aabb);
+ float m = MAX(rot_aabb.size.x, rot_aabb.size.y) * 0.5;
+ if (m == 0)
return Ref<Texture>();
- m=1.0/m;
- m*=0.5;
+ m = 1.0 / m;
+ m *= 0.5;
//print_line("scale: "+rtos(m));
- xform.basis.scale(Vector3(m,m,m));
- xform.origin=-xform.basis.xform(ofs); //-ofs*m;
- xform.origin.z-=rot_aabb.size.z*2;
- VS::get_singleton()->instance_set_transform(mesh_instance,xform);
-
+ xform.basis.scale(Vector3(m, m, m));
+ xform.origin = -xform.basis.xform(ofs); //-ofs*m;
+ xform.origin.z -= rot_aabb.size.z * 2;
+ VS::get_singleton()->instance_set_transform(mesh_instance, xform);
-
- VS::get_singleton()->viewport_queue_screen_capture(viewport);
- VS::get_singleton()->viewport_set_render_target_update_mode(viewport,VS::RENDER_TARGET_UPDATE_ONCE); //once used for capture
+ VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ONCE); //once used for capture
//print_line("queue capture!");
- Image img;
- int timeout=1000;
- while(timeout) {
- //print_line("try capture?");
+ preview_done = false;
+ VS::get_singleton()->request_frame_drawn_callback(this, "_preview_done", Variant());
+
+ while (!preview_done) {
OS::get_singleton()->delay_usec(10);
- img = VS::get_singleton()->viewport_get_screen_capture(viewport);
- if (!img.empty())
- break;
- timeout--;
}
- //print_line("captured!");
- VS::get_singleton()->instance_set_base(mesh_instance,RID());
+ Ref<Image> img = VS::get_singleton()->VS::get_singleton()->texture_get_data(viewport_texture);
+ ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
+
+ print_line("captured! " + itos(img->get_width()) + "x" + itos(img->get_height()));
+ VS::get_singleton()->instance_set_base(mesh_instance, RID());
int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
- thumbnail_size*=EDSCALE;
- img.resize(thumbnail_size,thumbnail_size);
+ thumbnail_size *= EDSCALE;
+ img->convert(Image::FORMAT_RGBA8);
+ img->resize(thumbnail_size, thumbnail_size);
- Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture ));
- ptex->create_from_image(img,0);
+ Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture));
+ ptex->create_from_image(img, 0);
return ptex;
}
EditorMeshPreviewPlugin::EditorMeshPreviewPlugin() {
scenario = VS::get_singleton()->scenario_create();
+
viewport = VS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_as_render_target(viewport,true);
- VS::get_singleton()->viewport_set_render_target_update_mode(viewport,VS::RENDER_TARGET_UPDATE_DISABLED);
- VS::get_singleton()->viewport_set_scenario(viewport,scenario);
- VS::ViewportRect vr;
- vr.x=0;
- vr.y=0;
- vr.width=128;
- vr.height=128;
- VS::get_singleton()->viewport_set_rect(viewport,vr);
+ VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_DISABLED);
+ VS::get_singleton()->viewport_set_vflip(viewport, true);
+ VS::get_singleton()->viewport_set_scenario(viewport, scenario);
+ VS::get_singleton()->viewport_set_size(viewport, 128, 128);
+ VS::get_singleton()->viewport_set_transparent_background(viewport, true);
+ VS::get_singleton()->viewport_set_active(viewport, true);
+ viewport_texture = VS::get_singleton()->viewport_get_texture(viewport);
camera = VS::get_singleton()->camera_create();
- VS::get_singleton()->viewport_attach_camera(viewport,camera);
- VS::get_singleton()->camera_set_transform(camera,Transform(Matrix3(),Vector3(0,0,3)));
+ VS::get_singleton()->viewport_attach_camera(viewport, camera);
+ VS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3)));
//VS::get_singleton()->camera_set_perspective(camera,45,0.1,10);
- VS::get_singleton()->camera_set_orthogonal(camera,1.0,0.01,1000.0);
+ VS::get_singleton()->camera_set_orthogonal(camera, 1.0, 0.01, 1000.0);
light = VS::get_singleton()->light_create(VS::LIGHT_DIRECTIONAL);
- light_instance = VS::get_singleton()->instance_create2(light,scenario);
- VS::get_singleton()->instance_set_transform(light_instance,Transform().looking_at(Vector3(-1,-1,-1),Vector3(0,1,0)));
+ light_instance = VS::get_singleton()->instance_create2(light, scenario);
+ VS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
light2 = VS::get_singleton()->light_create(VS::LIGHT_DIRECTIONAL);
- VS::get_singleton()->light_set_color(light2,VS::LIGHT_COLOR_DIFFUSE,Color(0.7,0.7,0.7));
- VS::get_singleton()->light_set_color(light2,VS::LIGHT_COLOR_SPECULAR,Color(0.0,0.0,0.0));
- light_instance2 = VS::get_singleton()->instance_create2(light2,scenario);
+ VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+ //VS::get_singleton()->light_set_color(light2, VS::LIGHT_COLOR_SPECULAR, Color(0.0, 0.0, 0.0));
+ light_instance2 = VS::get_singleton()->instance_create2(light2, scenario);
- VS::get_singleton()->instance_set_transform(light_instance2,Transform().looking_at(Vector3(0,1,0),Vector3(0,0,1)));
+ VS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
//sphere = VS::get_singleton()->mesh_create();
mesh_instance = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_scenario(mesh_instance,scenario);
-
-
-
+ VS::get_singleton()->instance_set_scenario(mesh_instance, scenario);
}
-
EditorMeshPreviewPlugin::~EditorMeshPreviewPlugin() {
//VS::get_singleton()->free(sphere);
@@ -904,6 +885,4 @@ EditorMeshPreviewPlugin::~EditorMeshPreviewPlugin() {
VS::get_singleton()->free(light_instance2);
VS::get_singleton()->free(camera);
VS::get_singleton()->free(scenario);
-
}
-#endif
diff --git a/editor/plugins/editor_preview_plugins.h b/editor/plugins/editor_preview_plugins.h
index b1d4fa0b38..7e7d36eb1e 100644
--- a/editor/plugins/editor_preview_plugins.h
+++ b/editor/plugins/editor_preview_plugins.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,55 +32,58 @@
#include "editor/editor_resource_preview.h"
-#if 0
class EditorTexturePreviewPlugin : public EditorResourcePreviewGenerator {
+ GDCLASS(EditorTexturePreviewPlugin, EditorResourcePreviewGenerator)
public:
-
- virtual bool handles(const String& p_type) const;
- virtual Ref<Texture> generate(const RES& p_from);
+ virtual bool handles(const String &p_type) const;
+ virtual Ref<Texture> generate(const RES &p_from);
EditorTexturePreviewPlugin();
};
-
class EditorBitmapPreviewPlugin : public EditorResourcePreviewGenerator {
+ GDCLASS(EditorBitmapPreviewPlugin, EditorResourcePreviewGenerator)
public:
-
- virtual bool handles(const String& p_type) const;
- virtual Ref<Texture> generate(const RES& p_from);
+ virtual bool handles(const String &p_type) const;
+ virtual Ref<Texture> generate(const RES &p_from);
EditorBitmapPreviewPlugin();
};
-
-
class EditorPackedScenePreviewPlugin : public EditorResourcePreviewGenerator {
- Ref<Texture> _gen_from_imd(Ref<ResourceImportMetadata> p_imd);
public:
-
- virtual bool handles(const String& p_type) const;
- virtual Ref<Texture> generate(const RES& p_from);
- virtual Ref<Texture> generate_from_path(const String& p_path);
+ virtual bool handles(const String &p_type) const;
+ virtual Ref<Texture> generate(const RES &p_from);
+ virtual Ref<Texture> generate_from_path(const String &p_path);
EditorPackedScenePreviewPlugin();
};
class EditorMaterialPreviewPlugin : public EditorResourcePreviewGenerator {
+ GDCLASS(EditorMaterialPreviewPlugin, EditorResourcePreviewGenerator)
+
RID scenario;
RID sphere;
RID sphere_instance;
RID viewport;
+ RID viewport_texture;
RID light;
RID light_instance;
RID light2;
RID light_instance2;
RID camera;
-public:
+ volatile bool preview_done;
- virtual bool handles(const String& p_type) const;
- virtual Ref<Texture> generate(const RES& p_from);
+ void _preview_done(const Variant &p_udata);
+
+protected:
+ static void _bind_methods();
+
+public:
+ virtual bool handles(const String &p_type) const;
+ virtual Ref<Texture> generate(const RES &p_from);
EditorMaterialPreviewPlugin();
~EditorMaterialPreviewPlugin();
@@ -87,9 +91,8 @@ public:
class EditorScriptPreviewPlugin : public EditorResourcePreviewGenerator {
public:
-
- virtual bool handles(const String& p_type) const;
- virtual Ref<Texture> generate(const RES& p_from);
+ virtual bool handles(const String &p_type) const;
+ virtual Ref<Texture> generate(const RES &p_from);
EditorScriptPreviewPlugin();
};
@@ -107,22 +110,30 @@ public:
#endif
class EditorMeshPreviewPlugin : public EditorResourcePreviewGenerator {
+ GDCLASS(EditorMeshPreviewPlugin, EditorResourcePreviewGenerator)
+
RID scenario;
RID mesh_instance;
RID viewport;
+ RID viewport_texture;
RID light;
RID light_instance;
RID light2;
RID light_instance2;
RID camera;
-public:
+ volatile bool preview_done;
- virtual bool handles(const String& p_type) const;
- virtual Ref<Texture> generate(const RES& p_from);
+ void _preview_done(const Variant &p_udata);
+
+protected:
+ static void _bind_methods();
+
+public:
+ virtual bool handles(const String &p_type) const;
+ virtual Ref<Texture> generate(const RES &p_from);
EditorMeshPreviewPlugin();
~EditorMeshPreviewPlugin();
};
-#endif
#endif // EDITORPREVIEWPLUGINS_H
diff --git a/editor/plugins/gi_probe_editor_plugin.cpp b/editor/plugins/gi_probe_editor_plugin.cpp
index 0930c91e94..a8f840a8b1 100644
--- a/editor/plugins/gi_probe_editor_plugin.cpp
+++ b/editor/plugins/gi_probe_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/gi_probe_editor_plugin.h b/editor/plugins/gi_probe_editor_plugin.h
index 14d831a01a..e4151d4b8c 100644
--- a/editor/plugins/gi_probe_editor_plugin.h
+++ b/editor/plugins/gi_probe_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -51,8 +52,8 @@ protected:
public:
virtual String get_name() const { return "GIProbe"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
GIProbeEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/color_ramp_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp
index 1d1d654bd5..4aaa155cfd 100644
--- a/editor/plugins/color_ramp_editor_plugin.cpp
+++ b/editor/plugins/gradient_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,15 +27,15 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "color_ramp_editor_plugin.h"
+#include "gradient_editor_plugin.h"
#include "canvas_item_editor_plugin.h"
#include "spatial_editor_plugin.h"
-ColorRampEditorPlugin::ColorRampEditorPlugin(EditorNode *p_node) {
+GradientEditorPlugin::GradientEditorPlugin(EditorNode *p_node) {
editor = p_node;
- ramp_editor = memnew(ColorRampEdit);
+ ramp_editor = memnew(GradientEdit);
add_control_to_container(CONTAINER_PROPERTY_EDITOR_BOTTOM, ramp_editor);
@@ -43,21 +44,21 @@ ColorRampEditorPlugin::ColorRampEditorPlugin(EditorNode *p_node) {
ramp_editor->connect("ramp_changed", this, "ramp_changed");
}
-void ColorRampEditorPlugin::edit(Object *p_object) {
+void GradientEditorPlugin::edit(Object *p_object) {
- ColorRamp *color_ramp = p_object->cast_to<ColorRamp>();
- if (!color_ramp)
+ Gradient *gradient = p_object->cast_to<Gradient>();
+ if (!gradient)
return;
- color_ramp_ref = Ref<ColorRamp>(color_ramp);
- ramp_editor->set_points(color_ramp_ref->get_points());
+ gradient_ref = Ref<Gradient>(gradient);
+ ramp_editor->set_points(gradient_ref->get_points());
}
-bool ColorRampEditorPlugin::handles(Object *p_object) const {
+bool GradientEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("ColorRamp");
+ return p_object->is_class("Gradient");
}
-void ColorRampEditorPlugin::make_visible(bool p_visible) {
+void GradientEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
ramp_editor->show();
@@ -66,43 +67,42 @@ void ColorRampEditorPlugin::make_visible(bool p_visible) {
}
}
-void ColorRampEditorPlugin::_ramp_changed() {
+void GradientEditorPlugin::_ramp_changed() {
- if (color_ramp_ref.is_valid()) {
+ if (gradient_ref.is_valid()) {
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
//Not sure if I should convert this data to PoolVector
Vector<float> new_offsets = ramp_editor->get_offsets();
Vector<Color> new_colors = ramp_editor->get_colors();
- Vector<float> old_offsets = color_ramp_ref->get_offsets();
- Vector<Color> old_colors = color_ramp_ref->get_colors();
+ Vector<float> old_offsets = gradient_ref->get_offsets();
+ Vector<Color> old_colors = gradient_ref->get_colors();
if (old_offsets.size() != new_offsets.size())
ur->create_action(TTR("Add/Remove Color Ramp Point"));
else
ur->create_action(TTR("Modify Color Ramp"), UndoRedo::MERGE_ENDS);
- ur->add_do_method(this, "undo_redo_color_ramp", new_offsets, new_colors);
- ur->add_undo_method(this, "undo_redo_color_ramp", old_offsets, old_colors);
+ ur->add_do_method(this, "undo_redo_gradient", new_offsets, new_colors);
+ ur->add_undo_method(this, "undo_redo_gradient", old_offsets, old_colors);
ur->commit_action();
//color_ramp_ref->set_points(ramp_editor->get_points());
}
}
-void ColorRampEditorPlugin::_undo_redo_color_ramp(const Vector<float> &offsets,
- const Vector<Color> &colors) {
+void GradientEditorPlugin::_undo_redo_gradient(const Vector<float> &offsets, const Vector<Color> &colors) {
- color_ramp_ref->set_offsets(offsets);
- color_ramp_ref->set_colors(colors);
- ramp_editor->set_points(color_ramp_ref->get_points());
+ gradient_ref->set_offsets(offsets);
+ gradient_ref->set_colors(colors);
+ ramp_editor->set_points(gradient_ref->get_points());
ramp_editor->update();
}
-ColorRampEditorPlugin::~ColorRampEditorPlugin() {
+GradientEditorPlugin::~GradientEditorPlugin() {
}
-void ColorRampEditorPlugin::_bind_methods() {
- 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);
+void GradientEditorPlugin::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("ramp_changed"), &GradientEditorPlugin::_ramp_changed);
+ ClassDB::bind_method(D_METHOD("undo_redo_gradient", "offsets", "colors"), &GradientEditorPlugin::_undo_redo_gradient);
}
diff --git a/editor/plugins/color_ramp_editor_plugin.h b/editor/plugins/gradient_editor_plugin.h
index 45ac53c669..1acf5f7e57 100644
--- a/editor/plugins/color_ramp_editor_plugin.h
+++ b/editor/plugins/gradient_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,31 +32,30 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/gui/color_ramp_edit.h"
+#include "scene/gui/gradient_edit.h"
-class ColorRampEditorPlugin : public EditorPlugin {
+class GradientEditorPlugin : public EditorPlugin {
- GDCLASS(ColorRampEditorPlugin, EditorPlugin);
+ GDCLASS(GradientEditorPlugin, EditorPlugin);
- bool _2d;
- Ref<ColorRamp> color_ramp_ref;
- ColorRampEdit *ramp_editor;
+ Ref<Gradient> gradient_ref;
+ GradientEdit *ramp_editor;
EditorNode *editor;
protected:
static void _bind_methods();
void _ramp_changed();
- void _undo_redo_color_ramp(const Vector<float> &offsets, const Vector<Color> &colors);
+ void _undo_redo_gradient(const Vector<float> &offsets, const Vector<Color> &colors);
public:
virtual String get_name() const { return "ColorRamp"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
- ColorRampEditorPlugin(EditorNode *p_node);
- ~ColorRampEditorPlugin();
+ GradientEditorPlugin(EditorNode *p_node);
+ ~GradientEditorPlugin();
};
#endif /* TOOLS_EDITOR_PLUGINS_COLOR_RAMP_EDITOR_PLUGIN_H_ */
diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp
index fabbf07a15..f567abc5b1 100644
--- a/editor/plugins/item_list_editor_plugin.cpp
+++ b/editor/plugins/item_list_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -192,6 +193,45 @@ ItemListPopupMenuPlugin::ItemListPopupMenuPlugin() {
}
///////////////////////////////////////////////////////////////
+
+void ItemListItemListPlugin::set_object(Object *p_object) {
+
+ pp = p_object->cast_to<ItemList>();
+}
+
+bool ItemListItemListPlugin::handles(Object *p_object) const {
+
+ return p_object->is_class("ItemList");
+}
+
+int ItemListItemListPlugin::get_flags() const {
+
+ return FLAG_ICON | FLAG_ENABLE;
+}
+
+void ItemListItemListPlugin::add_item() {
+
+ pp->add_item(vformat(TTR("Item %d"), pp->get_item_count()));
+ _change_notify();
+}
+
+int ItemListItemListPlugin::get_item_count() const {
+
+ return pp->get_item_count();
+}
+
+void ItemListItemListPlugin::erase(int p_idx) {
+
+ pp->remove_item(p_idx);
+ _change_notify();
+}
+
+ItemListItemListPlugin::ItemListItemListPlugin() {
+
+ pp = NULL;
+}
+
+///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
@@ -372,6 +412,7 @@ ItemListEditorPlugin::ItemListEditorPlugin(EditorNode *p_node) {
item_list_editor->hide();
item_list_editor->add_plugin(memnew(ItemListOptionButtonPlugin));
item_list_editor->add_plugin(memnew(ItemListPopupMenuPlugin));
+ item_list_editor->add_plugin(memnew(ItemListItemListPlugin));
}
ItemListEditorPlugin::~ItemListEditorPlugin() {
diff --git a/editor/plugins/item_list_editor_plugin.h b/editor/plugins/item_list_editor_plugin.h
index 064c43bda5..3bfe2c88e0 100644
--- a/editor/plugins/item_list_editor_plugin.h
+++ b/editor/plugins/item_list_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -115,8 +116,8 @@ public:
virtual void set_item_enabled(int p_idx, int p_enabled) { ob->set_item_disabled(p_idx, !p_enabled); }
virtual bool is_item_enabled(int p_idx) const { return !ob->is_item_disabled(p_idx); }
- virtual void set_item_id(int p_idx, int p_id) { ob->set_item_ID(p_idx, p_id); }
- virtual int get_item_id(int p_idx) const { return ob->get_item_ID(p_idx); }
+ virtual void set_item_id(int p_idx, int p_id) { ob->set_item_id(p_idx, p_id); }
+ virtual int get_item_id(int p_idx) const { return ob->get_item_id(p_idx); }
virtual void add_item();
virtual int get_item_count() const;
@@ -151,8 +152,8 @@ public:
virtual void set_item_enabled(int p_idx, int p_enabled) { pp->set_item_disabled(p_idx, !p_enabled); }
virtual bool is_item_enabled(int p_idx) const { return !pp->is_item_disabled(p_idx); }
- virtual void set_item_id(int p_idx, int p_id) { pp->set_item_ID(p_idx, p_idx); }
- virtual int get_item_id(int p_idx) const { return pp->get_item_ID(p_idx); }
+ virtual void set_item_id(int p_idx, int p_id) { pp->set_item_id(p_idx, p_idx); }
+ virtual int get_item_id(int p_idx) const { return pp->get_item_id(p_idx); }
virtual void set_item_separator(int p_idx, bool p_separator) { pp->set_item_as_separator(p_idx, p_separator); }
virtual bool is_item_separator(int p_idx) const { return pp->is_item_separator(p_idx); }
@@ -166,6 +167,35 @@ public:
///////////////////////////////////////////////////////////////
+class ItemListItemListPlugin : public ItemListPlugin {
+
+ GDCLASS(ItemListItemListPlugin, ItemListPlugin);
+
+ ItemList *pp;
+
+public:
+ virtual void set_object(Object *p_object);
+ virtual bool handles(Object *p_object) const;
+ virtual int get_flags() const;
+
+ virtual void set_item_text(int p_idx, const String &p_text) { pp->set_item_text(p_idx, p_text); }
+ virtual String get_item_text(int p_idx) const { return pp->get_item_text(p_idx); }
+
+ virtual void set_item_icon(int p_idx, const Ref<Texture> &p_tex) { pp->set_item_icon(p_idx, p_tex); }
+ virtual Ref<Texture> get_item_icon(int p_idx) const { return pp->get_item_icon(p_idx); }
+
+ virtual void set_item_enabled(int p_idx, int p_enabled) { pp->set_item_disabled(p_idx, !p_enabled); }
+ virtual bool is_item_enabled(int p_idx) const { return !pp->is_item_disabled(p_idx); }
+
+ virtual void add_item();
+ virtual int get_item_count() const;
+ virtual void erase(int p_idx);
+
+ ItemListItemListPlugin();
+};
+
+///////////////////////////////////////////////////////////////
+
class ItemListEditor : public HBoxContainer {
GDCLASS(ItemListEditor, HBoxContainer);
@@ -213,8 +243,8 @@ class ItemListEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "ItemList"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
ItemListEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/light_occluder_2d_editor_plugin.cpp b/editor/plugins/light_occluder_2d_editor_plugin.cpp
index 6db25e8455..a7a20e71fe 100644
--- a/editor/plugins/light_occluder_2d_editor_plugin.cpp
+++ b/editor/plugins/light_occluder_2d_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -97,225 +98,223 @@ void LightOccluder2DEditor::_wip_close(bool p_closed) {
edited_point = -1;
}
-bool LightOccluder2DEditor::forward_gui_input(const InputEvent &p_event) {
+bool LightOccluder2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (!node)
return false;
if (node->get_occluder_polygon().is_null()) {
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == 1 && p_event.mouse_button.pressed) {
+ Ref<InputEventMouseButton> mb = p_event;
+ if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) {
create_poly->set_text("No OccluderPolygon2D resource on this node.\nCreate and assign one?");
create_poly->popup_centered_minsize();
}
- return (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == 1);
+ return (mb.is_valid() && mb->get_button_index() == 1);
}
- switch (p_event.type) {
- case InputEvent::MOUSE_BUTTON: {
+ Ref<InputEventMouseButton> mb = p_event;
- const InputEventMouseButton &mb = p_event.mouse_button;
+ if (mb.is_valid()) {
- Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Vector2 gpoint = Point2(mb.x, mb.y);
- Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
- cpoint = canvas_item_editor->snap_point(cpoint);
- cpoint = node->get_global_transform().affine_inverse().xform(cpoint);
+ Vector2 gpoint = mb->get_position();
+ Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
+ cpoint = canvas_item_editor->snap_point(cpoint);
+ cpoint = node->get_global_transform().affine_inverse().xform(cpoint);
- Vector<Vector2> poly = Variant(node->get_occluder_polygon()->get_polygon());
+ Vector<Vector2> poly = Variant(node->get_occluder_polygon()->get_polygon());
- //first check if a point is to be added (segment split)
- real_t grab_treshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
+ //first check if a point is to be added (segment split)
+ real_t grab_threshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
- switch (mode) {
+ switch (mode) {
- case MODE_CREATE: {
+ case MODE_CREATE: {
- if (mb.button_index == BUTTON_LEFT && mb.pressed) {
+ if (mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
- if (!wip_active) {
+ if (!wip_active) {
- wip.clear();
- wip.push_back(cpoint);
- wip_active = true;
- edited_point_pos = cpoint;
- canvas_item_editor->get_viewport_control()->update();
- edited_point = 1;
- return true;
- } else {
+ wip.clear();
+ wip.push_back(cpoint);
+ wip_active = true;
+ edited_point_pos = cpoint;
+ canvas_item_editor->get_viewport_control()->update();
+ edited_point = 1;
+ return true;
+ } else {
- if (wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_treshold) {
- //wip closed
- _wip_close(true);
+ if (wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_threshold) {
+ //wip closed
+ _wip_close(true);
- return true;
- } else if (wip.size() > 1 && xform.xform(wip[wip.size() - 1]).distance_to(gpoint) < grab_treshold) {
- //wip closed
- _wip_close(false);
- return true;
+ return true;
+ } else if (wip.size() > 1 && xform.xform(wip[wip.size() - 1]).distance_to(gpoint) < grab_threshold) {
+ //wip closed
+ _wip_close(false);
+ return true;
- } else {
+ } else {
- wip.push_back(cpoint);
- edited_point = wip.size();
- canvas_item_editor->get_viewport_control()->update();
- return true;
+ wip.push_back(cpoint);
+ edited_point = wip.size();
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
- //add wip point
- }
+ //add wip point
}
- } else if (mb.button_index == BUTTON_RIGHT && mb.pressed && wip_active) {
- _wip_close(true);
}
+ } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && wip_active) {
+ _wip_close(true);
+ }
- } break;
-
- case MODE_EDIT: {
-
- if (mb.button_index == BUTTON_LEFT) {
- if (mb.pressed) {
-
- if (mb.mod.control) {
+ } break;
- if (poly.size() < 3) {
+ case MODE_EDIT: {
- undo_redo->create_action(TTR("Edit Poly"));
- undo_redo->add_undo_method(node->get_occluder_polygon().ptr(), "set_polygon", poly);
- poly.push_back(cpoint);
- undo_redo->add_do_method(node->get_occluder_polygon().ptr(), "set_polygon", poly);
- 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->get_button_index() == BUTTON_LEFT) {
+ if (mb->is_pressed()) {
- //search edges
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
- for (int i = 0; i < poly.size(); i++) {
-
- Vector2 points[2] = { xform.xform(poly[i]),
- xform.xform(poly[(i + 1) % poly.size()]) };
-
- Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint, points);
- if (cp.distance_squared_to(points[0]) < CMP_EPSILON2 || cp.distance_squared_to(points[1]) < CMP_EPSILON2)
- continue; //not valid to reuse point
-
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_pos = cp;
- closest_idx = i;
- }
- }
+ if (mb->get_control()) {
- if (closest_idx >= 0) {
+ if (poly.size() < 3) {
- pre_move_edit = poly;
- poly.insert(closest_idx + 1, xform.affine_inverse().xform(closest_pos));
- edited_point = closest_idx + 1;
- edited_point_pos = xform.affine_inverse().xform(closest_pos);
- node->get_occluder_polygon()->set_polygon(Variant(poly));
- canvas_item_editor->get_viewport_control()->update();
- return true;
- }
- } else {
+ undo_redo->create_action(TTR("Edit Poly"));
+ undo_redo->add_undo_method(node->get_occluder_polygon().ptr(), "set_polygon", poly);
+ poly.push_back(cpoint);
+ undo_redo->add_do_method(node->get_occluder_polygon().ptr(), "set_polygon", poly);
+ 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;
+ }
- //look for points to move
+ //search edges
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
- for (int i = 0; i < poly.size(); i++) {
+ Vector2 points[2] = { xform.xform(poly[i]),
+ xform.xform(poly[(i + 1) % poly.size()]) };
- Vector2 cp = xform.xform(poly[i]);
+ Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint, points);
+ if (cp.distance_squared_to(points[0]) < CMP_EPSILON2 || cp.distance_squared_to(points[1]) < CMP_EPSILON2)
+ continue; //not valid to reuse point
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_pos = cp;
- closest_idx = i;
- }
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
}
+ }
- if (closest_idx >= 0) {
+ if (closest_idx >= 0) {
- pre_move_edit = poly;
- edited_point = closest_idx;
- edited_point_pos = xform.affine_inverse().xform(closest_pos);
- canvas_item_editor->get_viewport_control()->update();
- return true;
- }
+ pre_move_edit = poly;
+ poly.insert(closest_idx + 1, xform.affine_inverse().xform(closest_pos));
+ edited_point = closest_idx + 1;
+ edited_point_pos = xform.affine_inverse().xform(closest_pos);
+ node->get_occluder_polygon()->set_polygon(Variant(poly));
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
}
} else {
- if (edited_point != -1) {
+ //look for points to move
- //apply
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
- ERR_FAIL_INDEX_V(edited_point, poly.size(), false);
- poly[edited_point] = edited_point_pos;
- undo_redo->create_action(TTR("Edit Poly"));
- undo_redo->add_do_method(node->get_occluder_polygon().ptr(), "set_polygon", poly);
- undo_redo->add_undo_method(node->get_occluder_polygon().ptr(), "set_polygon", pre_move_edit);
- 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();
+ Vector2 cp = xform.xform(poly[i]);
- edited_point = -1;
- return true;
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
+ }
}
- }
- } else if (mb.button_index == BUTTON_RIGHT && mb.pressed && edited_point == -1) {
-
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
- for (int i = 0; i < poly.size(); i++) {
- Vector2 cp = xform.xform(poly[i]);
+ if (closest_idx >= 0) {
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_pos = cp;
- closest_idx = i;
+ pre_move_edit = poly;
+ edited_point = closest_idx;
+ edited_point_pos = xform.affine_inverse().xform(closest_pos);
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
}
}
+ } else {
+
+ if (edited_point != -1) {
- if (closest_idx >= 0) {
+ //apply
- undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
- undo_redo->add_undo_method(node->get_occluder_polygon().ptr(), "set_polygon", poly);
- poly.remove(closest_idx);
+ ERR_FAIL_INDEX_V(edited_point, poly.size(), false);
+ poly[edited_point] = edited_point_pos;
+ undo_redo->create_action(TTR("Edit Poly"));
undo_redo->add_do_method(node->get_occluder_polygon().ptr(), "set_polygon", poly);
+ undo_redo->add_undo_method(node->get_occluder_polygon().ptr(), "set_polygon", pre_move_edit);
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();
+
+ edited_point = -1;
return true;
}
}
+ } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && edited_point == -1) {
- } break;
- }
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
- } break;
- case InputEvent::MOUSE_MOTION: {
+ Vector2 cp = xform.xform(poly[i]);
- const InputEventMouseMotion &mm = p_event.mouse_motion;
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
+ }
+ }
- if (edited_point != -1 && (wip_active || mm.button_mask & BUTTON_MASK_LEFT)) {
+ if (closest_idx >= 0) {
- Vector2 gpoint = Point2(mm.x, mm.y);
- Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
- cpoint = canvas_item_editor->snap_point(cpoint);
- edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint);
+ undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
+ undo_redo->add_undo_method(node->get_occluder_polygon().ptr(), "set_polygon", poly);
+ poly.remove(closest_idx);
+ undo_redo->add_do_method(node->get_occluder_polygon().ptr(), "set_polygon", poly);
+ 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;
+ }
+ }
- canvas_item_editor->get_viewport_control()->update();
- }
+ } break;
+ }
+ }
- } break;
+ Ref<InputEventMouseMotion> mm = p_event;
+
+ if (mm.is_valid()) {
+
+ if (edited_point != -1 && (wip_active || mm->get_button_mask() & BUTTON_MASK_LEFT)) {
+
+ Vector2 gpoint = mm->get_position();
+ Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
+ cpoint = canvas_item_editor->snap_point(cpoint);
+ edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint);
+
+ canvas_item_editor->get_viewport_control()->update();
+ }
}
return false;
diff --git a/editor/plugins/light_occluder_2d_editor_plugin.h b/editor/plugins/light_occluder_2d_editor_plugin.h
index 68e5e3f729..435d650a69 100644
--- a/editor/plugins/light_occluder_2d_editor_plugin.h
+++ b/editor/plugins/light_occluder_2d_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -83,7 +84,7 @@ protected:
public:
Vector2 snap_point(const Vector2 &p_point) const;
- bool forward_gui_input(const InputEvent &p_event);
+ bool forward_gui_input(const Ref<InputEvent> &p_event);
void edit(Node *p_collision_polygon);
LightOccluder2DEditor(EditorNode *p_editor);
};
@@ -96,12 +97,12 @@ class LightOccluder2DEditorPlugin : public EditorPlugin {
EditorNode *editor;
public:
- virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "LightOccluder2D"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
LightOccluder2DEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/line_2d_editor_plugin.cpp b/editor/plugins/line_2d_editor_plugin.cpp
index b3afe0bb93..41327fb07e 100644
--- a/editor/plugins/line_2d_editor_plugin.cpp
+++ b/editor/plugins/line_2d_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -53,20 +54,20 @@ void Line2DEditor::_notification(int p_what) {
}
}
-Vector2 Line2DEditor::mouse_to_local_pos(Vector2 gpoint, bool alt) {
+Vector2 Line2DEditor::mouse_to_local_pos(Vector2 gpos, 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)));
+ return !alt ? canvas_item_editor->snap_point(xform.affine_inverse().xform(gpos)) : node->get_global_transform().affine_inverse().xform(canvas_item_editor->snap_point(canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpos)));
}
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);
+ real_t grab_threshold = EDITOR_DEF("editors/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) {
+ if (gpos.distance_to(p) < grab_threshold) {
return i;
}
}
@@ -74,7 +75,7 @@ int Line2DEditor::get_point_index_at(Vector2 gpos) {
return -1;
}
-bool Line2DEditor::forward_gui_input(const InputEvent &p_event) {
+bool Line2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (!node)
return false;
@@ -82,75 +83,74 @@ bool Line2DEditor::forward_gui_input(const InputEvent &p_event) {
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;
+ Ref<InputEventMouseButton> mb = p_event;
+
+ if (mb.is_valid()) {
+
+ Vector2 gpoint = mb->get_position();
+ Vector2 cpoint = mouse_to_local_pos(gpoint, mb->get_alt());
+
+ if (mb->is_pressed() && _dragging == false) {
+ int i = get_point_index_at(gpoint);
+ if (i != -1) {
+ if (mb->get_button_index() == BUTTON_LEFT && !mb->get_shift() && mode == MODE_EDIT) {
+ _dragging = true;
+ action_point = i;
+ moving_from = node->get_point_pos(i);
+ moving_screen_from = gpoint;
+ } else if ((mb->get_button_index() == BUTTON_RIGHT && mode == MODE_EDIT) || (mb->get_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)) {
+ if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && ((mb->get_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();
+ 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;
+ _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();
+ canvas_item_editor->get_viewport_control()->update();
- return true;
- }
+ 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;
+ if (!mb->is_pressed() && mb->get_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;
+ }
+ }
+
+ Ref<InputEventMouseMotion> mm = p_event;
+
+ if (mm.is_valid()) {
+
+ if (_dragging) {
+ Vector2 cpoint = mouse_to_local_pos(mm->get_position(), mm->get_alt());
+ node->set_point_pos(action_point, cpoint);
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
+ }
}
return false;
diff --git a/editor/plugins/line_2d_editor_plugin.h b/editor/plugins/line_2d_editor_plugin.h
index 6bade92da4..f2979e4330 100644
--- a/editor/plugins/line_2d_editor_plugin.h
+++ b/editor/plugins/line_2d_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -42,7 +43,7 @@ class Line2DEditor : public HBoxContainer {
GDCLASS(Line2DEditor, HBoxContainer)
public:
- bool forward_gui_input(const InputEvent &p_event);
+ bool forward_gui_input(const Ref<InputEvent> &p_event);
void edit(Node *p_line2d);
Line2DEditor(EditorNode *p_editor);
@@ -94,14 +95,14 @@ class Line2DEditorPlugin : public EditorPlugin {
public:
virtual bool forward_canvas_gui_input(
const Transform2D &p_canvas_xform,
- const InputEvent &p_event) {
+ const Ref<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 edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
Line2DEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp
index 8716349cb4..179ef27eda 100644
--- a/editor/plugins/material_editor_plugin.cpp
+++ b/editor/plugins/material_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/material_editor_plugin.h b/editor/plugins/material_editor_plugin.h
index 30bed67a5e..a0a91f53a6 100644
--- a/editor/plugins/material_editor_plugin.h
+++ b/editor/plugins/material_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp
index 93f417247e..23b19e61b9 100644
--- a/editor/plugins/mesh_editor_plugin.cpp
+++ b/editor/plugins/mesh_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,18 +29,17 @@
/*************************************************************************/
#include "mesh_editor_plugin.h"
-#if 0
-void MeshEditor::_gui_input(InputEvent p_event) {
+void MeshEditor::_gui_input(Ref<InputEvent> p_event) {
+ Ref<InputEventMouseMotion> mm = p_event;
+ if (mm.is_valid() && mm->get_button_mask() & BUTTON_MASK_LEFT) {
- if (p_event.type==InputEvent::MOUSE_MOTION && p_event.mouse_motion.button_mask&BUTTON_MASK_LEFT) {
-
- rot_x-=p_event.mouse_motion.relative_y*0.01;
- rot_y-=p_event.mouse_motion.relative_x*0.01;
- if (rot_x<-Math_PI/2)
- rot_x=-Math_PI/2;
- else if (rot_x>Math_PI/2) {
- rot_x=Math_PI/2;
+ rot_x -= mm->get_relative().y * 0.01;
+ rot_y -= mm->get_relative().x * 0.01;
+ if (rot_x < -Math_PI / 2)
+ rot_x = -Math_PI / 2;
+ else if (rot_x > Math_PI / 2) {
+ rot_x = Math_PI / 2;
}
_update_rotation();
}
@@ -47,35 +47,30 @@ void MeshEditor::_gui_input(InputEvent p_event) {
void MeshEditor::_notification(int p_what) {
- if (p_what==NOTIFICATION_FIXED_PROCESS) {
-
+ if (p_what == NOTIFICATION_FIXED_PROCESS) {
}
-
- if (p_what==NOTIFICATION_READY) {
+ if (p_what == NOTIFICATION_READY) {
//get_scene()->connect("node_removed",this,"_node_removed");
if (first_enter) {
- //it's in propertyeditor so.. could be moved around
+ //it's in propertyeditor so. could be moved around
- light_1_switch->set_normal_texture(get_icon("MaterialPreviewLight1","EditorIcons"));
- light_1_switch->set_pressed_texture(get_icon("MaterialPreviewLight1Off","EditorIcons"));
- light_2_switch->set_normal_texture(get_icon("MaterialPreviewLight2","EditorIcons"));
- light_2_switch->set_pressed_texture(get_icon("MaterialPreviewLight2Off","EditorIcons"));
- first_enter=false;
+ light_1_switch->set_normal_texture(get_icon("MaterialPreviewLight1", "EditorIcons"));
+ light_1_switch->set_pressed_texture(get_icon("MaterialPreviewLight1Off", "EditorIcons"));
+ light_2_switch->set_normal_texture(get_icon("MaterialPreviewLight2", "EditorIcons"));
+ light_2_switch->set_pressed_texture(get_icon("MaterialPreviewLight2Off", "EditorIcons"));
+ first_enter = false;
}
-
}
- if (p_what==NOTIFICATION_DRAW) {
-
+ if (p_what == NOTIFICATION_DRAW) {
- Ref<Texture> checkerboard = get_icon("Checkerboard","EditorIcons");
+ Ref<Texture> checkerboard = get_icon("Checkerboard", "EditorIcons");
Size2 size = get_size();
- draw_texture_rect(checkerboard,Rect2(Point2(),size),true);
-
+ //draw_texture_rect(checkerboard, Rect2(Point2(), size), true);
}
}
@@ -84,125 +79,115 @@ void MeshEditor::_update_rotation() {
Transform t;
t.basis.rotate(Vector3(0, 1, 0), -rot_y);
t.basis.rotate(Vector3(1, 0, 0), -rot_x);
- mesh_instance->set_transform(t);
-
+ rotation->set_transform(t);
}
void MeshEditor::edit(Ref<Mesh> p_mesh) {
- mesh=p_mesh;
+ mesh = p_mesh;
mesh_instance->set_mesh(mesh);
if (mesh.is_null()) {
hide();
} else {
- rot_x=0;
- rot_y=0;
+ rot_x = 0;
+ rot_y = 0;
_update_rotation();
- AABB aabb= mesh->get_aabb();
- Vector3 ofs = aabb.pos + aabb.size*0.5;
- aabb.pos-=ofs;
- float m = MAX(aabb.size.x,aabb.size.y)*0.5;
- if (m!=0) {
- m=1.0/m;
- m*=0.5;
+ Rect3 aabb = mesh->get_aabb();
+ print_line("aabb: " + aabb);
+ Vector3 ofs = aabb.position + aabb.size * 0.5;
+ float m = aabb.get_longest_axis_size();
+ if (m != 0) {
+ m = 1.0 / m;
+ m *= 0.5;
//print_line("scale: "+rtos(m));
Transform xform;
- xform.basis.scale(Vector3(m,m,m));
- xform.origin=-xform.basis.xform(ofs); //-ofs*m;
- xform.origin.z-=aabb.size.z*2;
+ xform.basis.scale(Vector3(m, m, m));
+ xform.origin = -xform.basis.xform(ofs); //-ofs*m;
+ //xform.origin.z -= aabb.get_longest_axis_size() * 2;
mesh_instance->set_transform(xform);
}
-
}
-
}
+void MeshEditor::_button_pressed(Node *p_button) {
-void MeshEditor::_button_pressed(Node* p_button) {
-
- if (p_button==light_1_switch) {
- light1->set_enabled(!light_1_switch->is_pressed());
+ if (p_button == light_1_switch) {
+ light1->set_visible(!light_1_switch->is_pressed());
}
- if (p_button==light_2_switch) {
- light2->set_enabled(!light_2_switch->is_pressed());
+ if (p_button == light_2_switch) {
+ light2->set_visible(!light_2_switch->is_pressed());
}
-
-
}
void MeshEditor::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_gui_input"),&MeshEditor::_gui_input);
- ClassDB::bind_method(D_METHOD("_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);
}
MeshEditor::MeshEditor() {
- viewport = memnew( Viewport );
+ viewport = memnew(Viewport);
Ref<World> world;
world.instance();
viewport->set_world(world); //use own world
add_child(viewport);
viewport->set_disable_input(true);
+ set_stretch(true);
- camera = memnew( Camera );
- camera->set_transform(Transform(Matrix3(),Vector3(0,0,3)));
- camera->set_perspective(45,0.1,10);
+ camera = memnew(Camera);
+ camera->set_transform(Transform(Basis(), Vector3(0, 0, 1.1)));
+ camera->set_perspective(45, 0.1, 10);
viewport->add_child(camera);
- light1 = memnew( DirectionalLight );
- light1->set_transform(Transform().looking_at(Vector3(-1,-1,-1),Vector3(0,1,0)));
+ light1 = memnew(DirectionalLight);
+ light1->set_transform(Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
viewport->add_child(light1);
- light2 = memnew( DirectionalLight );
- light2->set_transform(Transform().looking_at(Vector3(0,1,0),Vector3(0,0,1)));
- light2->set_color(Light::COLOR_DIFFUSE,Color(0.7,0.7,0.7));
- light2->set_color(Light::COLOR_SPECULAR,Color(0.7,0.7,0.7));
+ light2 = memnew(DirectionalLight);
+ light2->set_transform(Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
+ light2->set_color(Color(0.7, 0.7, 0.7));
viewport->add_child(light2);
- mesh_instance = memnew( MeshInstance );
- viewport->add_child(mesh_instance);
-
-
+ rotation = memnew(Spatial);
+ viewport->add_child(rotation);
+ mesh_instance = memnew(MeshInstance);
+ rotation->add_child(mesh_instance);
- set_custom_minimum_size(Size2(1,150)*EDSCALE);
+ set_custom_minimum_size(Size2(1, 150) * EDSCALE);
- HBoxContainer *hb = memnew( HBoxContainer );
+ HBoxContainer *hb = memnew(HBoxContainer);
add_child(hb);
hb->set_area_as_parent_rect(2);
hb->add_spacer();
- VBoxContainer *vb_light = memnew( VBoxContainer );
+ VBoxContainer *vb_light = memnew(VBoxContainer);
hb->add_child(vb_light);
- light_1_switch = memnew( TextureButton );
+ light_1_switch = memnew(TextureButton);
light_1_switch->set_toggle_mode(true);
vb_light->add_child(light_1_switch);
- light_1_switch->connect("pressed",this,"_button_pressed",varray(light_1_switch));
+ light_1_switch->connect("pressed", this, "_button_pressed", varray(light_1_switch));
- light_2_switch = memnew( TextureButton );
+ light_2_switch = memnew(TextureButton);
light_2_switch->set_toggle_mode(true);
vb_light->add_child(light_2_switch);
- light_2_switch->connect("pressed",this,"_button_pressed",varray(light_2_switch));
-
- first_enter=true;
-
- rot_x=0;
- rot_y=0;
+ light_2_switch->connect("pressed", this, "_button_pressed", varray(light_2_switch));
+ first_enter = true;
+ rot_x = 0;
+ rot_y = 0;
}
-
void MeshEditorPlugin::edit(Object *p_object) {
- Mesh * s = p_object->cast_to<Mesh>();
+ Mesh *s = p_object->cast_to<Mesh>();
if (!s)
return;
@@ -211,7 +196,7 @@ void MeshEditorPlugin::edit(Object *p_object) {
bool MeshEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("Mesh");
+ return p_object->is_class("Mesh");
}
void MeshEditorPlugin::make_visible(bool p_visible) {
@@ -224,22 +209,15 @@ void MeshEditorPlugin::make_visible(bool p_visible) {
mesh_editor->hide();
//mesh_editor->set_process(false);
}
-
}
MeshEditorPlugin::MeshEditorPlugin(EditorNode *p_node) {
- editor=p_node;
- mesh_editor = memnew( MeshEditor );
- add_control_to_container(CONTAINER_PROPERTY_EDITOR_BOTTOM,mesh_editor);
+ editor = p_node;
+ mesh_editor = memnew(MeshEditor);
+ add_control_to_container(CONTAINER_PROPERTY_EDITOR_BOTTOM, mesh_editor);
mesh_editor->hide();
-
-
-
}
-
-MeshEditorPlugin::~MeshEditorPlugin()
-{
+MeshEditorPlugin::~MeshEditorPlugin() {
}
-#endif
diff --git a/editor/plugins/mesh_editor_plugin.h b/editor/plugins/mesh_editor_plugin.h
index ec6d67e2f7..305d24ba07 100644
--- a/editor/plugins/mesh_editor_plugin.h
+++ b/editor/plugins/mesh_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,8 +30,6 @@
#ifndef MESH_EDITOR_PLUGIN_H
#define MESH_EDITOR_PLUGIN_H
-#if 0
-
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
#include "scene/3d/camera.h"
@@ -38,61 +37,56 @@
#include "scene/3d/mesh_instance.h"
#include "scene/resources/material.h"
-class MeshEditor : public Control {
-
- GDCLASS(MeshEditor, Control);
-
+class MeshEditor : public ViewportContainer {
+ GDCLASS(MeshEditor, ViewportContainer);
float rot_x;
float rot_y;
Viewport *viewport;
MeshInstance *mesh_instance;
+ Spatial *rotation;
DirectionalLight *light1;
DirectionalLight *light2;
Camera *camera;
Ref<Mesh> mesh;
-
TextureButton *light_1_switch;
TextureButton *light_2_switch;
- void _button_pressed(Node* p_button);
+ void _button_pressed(Node *p_button);
bool first_enter;
void _update_rotation();
+
protected:
void _notification(int p_what);
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
static void _bind_methods();
-public:
+public:
void edit(Ref<Mesh> p_mesh);
MeshEditor();
};
-
class MeshEditorPlugin : public EditorPlugin {
- GDCLASS( MeshEditorPlugin, EditorPlugin );
+ GDCLASS(MeshEditorPlugin, EditorPlugin);
MeshEditor *mesh_editor;
EditorNode *editor;
public:
-
virtual String get_name() const { return "Mesh"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
MeshEditorPlugin(EditorNode *p_node);
~MeshEditorPlugin();
-
};
-#endif // MESH_EDITOR_PLUGIN_H
#endif
diff --git a/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_editor_plugin.cpp
index 972e92e51e..49498d0fa0 100644
--- a/editor/plugins/mesh_instance_editor_plugin.cpp
+++ b/editor/plugins/mesh_instance_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,7 +29,7 @@
/*************************************************************************/
#include "mesh_instance_editor_plugin.h"
-#include "scene/3d/body_shape.h"
+#include "scene/3d/collision_shape.h"
#include "scene/3d/navigation_mesh.h"
#include "scene/3d/physics_body.h"
#include "scene/gui/box_container.h"
diff --git a/editor/plugins/mesh_instance_editor_plugin.h b/editor/plugins/mesh_instance_editor_plugin.h
index 54d42d1a01..614dcac0b9 100644
--- a/editor/plugins/mesh_instance_editor_plugin.h
+++ b/editor/plugins/mesh_instance_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -81,8 +82,8 @@ class MeshInstanceEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "MeshInstance"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
MeshInstanceEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp
index 126927480a..a9689cce56 100644
--- a/editor/plugins/multimesh_editor_plugin.cpp
+++ b/editor/plugins/multimesh_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -380,7 +381,7 @@ MultiMeshEditor::MultiMeshEditor() {
populate_amount = memnew(SpinBox);
populate_amount->set_anchor(MARGIN_RIGHT, ANCHOR_END);
populate_amount->set_begin(Point2(20, 232));
- populate_amount->set_end(Point2(5, 237));
+ populate_amount->set_end(Point2(-5, 237));
populate_amount->set_min(1);
populate_amount->set_max(65536);
populate_amount->set_value(128);
diff --git a/editor/plugins/multimesh_editor_plugin.h b/editor/plugins/multimesh_editor_plugin.h
index eb46733082..a93fa73a2e 100644
--- a/editor/plugins/multimesh_editor_plugin.h
+++ b/editor/plugins/multimesh_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -94,8 +95,8 @@ class MultiMeshEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "MultiMesh"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
MultiMeshEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/navigation_polygon_editor_plugin.cpp b/editor/plugins/navigation_polygon_editor_plugin.cpp
index e5b2594872..725e57fe0b 100644
--- a/editor/plugins/navigation_polygon_editor_plugin.cpp
+++ b/editor/plugins/navigation_polygon_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -111,263 +112,262 @@ void NavigationPolygonEditor::_wip_close() {
edited_point = -1;
}
-bool NavigationPolygonEditor::forward_gui_input(const InputEvent &p_event) {
+bool NavigationPolygonEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (!node)
return false;
if (node->get_navigation_polygon().is_null()) {
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == 1 && p_event.mouse_button.pressed) {
+
+ Ref<InputEventMouseButton> mb = p_event;
+
+ if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) {
create_nav->set_text("No NavigationPolygon resource on this node.\nCreate and assign one?");
create_nav->popup_centered_minsize();
}
- return (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == 1);
+ return (mb.is_valid() && mb->get_button_index() == 1);
}
- switch (p_event.type) {
+ Ref<InputEventMouseButton> mb = p_event;
- case InputEvent::MOUSE_BUTTON: {
+ if (mb.is_valid()) {
- const InputEventMouseButton &mb = p_event.mouse_button;
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Vector2 gpoint = mb->get_position();
+ Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
+ cpoint = canvas_item_editor->snap_point(cpoint);
+ cpoint = node->get_global_transform().affine_inverse().xform(cpoint);
- Vector2 gpoint = Point2(mb.x, mb.y);
- Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
- cpoint = canvas_item_editor->snap_point(cpoint);
- cpoint = node->get_global_transform().affine_inverse().xform(cpoint);
+ //first check if a point is to be added (segment split)
+ real_t grab_threshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
- //first check if a point is to be added (segment split)
- real_t grab_treshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
+ switch (mode) {
- switch (mode) {
+ case MODE_CREATE: {
- case MODE_CREATE: {
+ if (mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
- if (mb.button_index == BUTTON_LEFT && mb.pressed) {
+ if (!wip_active) {
- if (!wip_active) {
+ wip.clear();
+ wip.push_back(cpoint);
+ wip_active = true;
+ edited_point_pos = cpoint;
+ edited_outline = -1;
+ canvas_item_editor->get_viewport_control()->update();
+ edited_point = 1;
+ return true;
+ } else {
+
+ if (wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_threshold) {
+ //wip closed
+ _wip_close();
- wip.clear();
- wip.push_back(cpoint);
- wip_active = true;
- edited_point_pos = cpoint;
- edited_outline = -1;
- canvas_item_editor->get_viewport_control()->update();
- edited_point = 1;
return true;
} else {
- if (wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_treshold) {
- //wip closed
- _wip_close();
-
- return true;
- } else {
-
- wip.push_back(cpoint);
- edited_point = wip.size();
- canvas_item_editor->get_viewport_control()->update();
- return true;
+ wip.push_back(cpoint);
+ edited_point = wip.size();
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
- //add wip point
- }
+ //add wip point
}
- } else if (mb.button_index == BUTTON_RIGHT && mb.pressed && wip_active) {
- _wip_close();
}
+ } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && wip_active) {
+ _wip_close();
+ }
- } break;
+ } break;
- case MODE_EDIT: {
+ case MODE_EDIT: {
- if (mb.button_index == BUTTON_LEFT) {
- if (mb.pressed) {
+ if (mb->get_button_index() == BUTTON_LEFT) {
+ if (mb->is_pressed()) {
- if (mb.mod.control) {
+ if (mb->get_control()) {
- //search edges
- int closest_outline = -1;
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
+ //search edges
+ int closest_outline = -1;
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
- for (int j = 0; j < node->get_navigation_polygon()->get_outline_count(); j++) {
+ for (int j = 0; j < node->get_navigation_polygon()->get_outline_count(); j++) {
- PoolVector<Vector2> points = node->get_navigation_polygon()->get_outline(j);
+ PoolVector<Vector2> points = node->get_navigation_polygon()->get_outline(j);
- int pc = points.size();
- PoolVector<Vector2>::Read poly = points.read();
+ int pc = points.size();
+ PoolVector<Vector2>::Read poly = points.read();
- for (int i = 0; i < pc; i++) {
+ for (int i = 0; i < pc; i++) {
- Vector2 points[2] = { xform.xform(poly[i]),
- xform.xform(poly[(i + 1) % pc]) };
+ Vector2 points[2] = { xform.xform(poly[i]),
+ xform.xform(poly[(i + 1) % pc]) };
- Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint, points);
- if (cp.distance_squared_to(points[0]) < CMP_EPSILON2 || cp.distance_squared_to(points[1]) < CMP_EPSILON2)
- continue; //not valid to reuse point
+ Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint, points);
+ if (cp.distance_squared_to(points[0]) < CMP_EPSILON2 || cp.distance_squared_to(points[1]) < CMP_EPSILON2)
+ continue; //not valid to reuse point
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_outline = j;
- closest_pos = cp;
- closest_idx = i;
- }
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_outline = j;
+ closest_pos = cp;
+ closest_idx = i;
}
}
+ }
- if (closest_idx >= 0) {
-
- pre_move_edit = node->get_navigation_polygon()->get_outline(closest_outline);
- PoolVector<Point2> poly = pre_move_edit;
- poly.insert(closest_idx + 1, xform.affine_inverse().xform(closest_pos));
- edited_point = closest_idx + 1;
- edited_outline = closest_outline;
- edited_point_pos = xform.affine_inverse().xform(closest_pos);
- node->get_navigation_polygon()->set_outline(closest_outline, poly);
- canvas_item_editor->get_viewport_control()->update();
- return true;
- }
- } else {
+ if (closest_idx >= 0) {
+
+ pre_move_edit = node->get_navigation_polygon()->get_outline(closest_outline);
+ PoolVector<Point2> poly = pre_move_edit;
+ poly.insert(closest_idx + 1, xform.affine_inverse().xform(closest_pos));
+ edited_point = closest_idx + 1;
+ edited_outline = closest_outline;
+ edited_point_pos = xform.affine_inverse().xform(closest_pos);
+ node->get_navigation_polygon()->set_outline(closest_outline, poly);
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
+ }
+ } else {
- //look for points to move
- int closest_outline = -1;
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
+ //look for points to move
+ int closest_outline = -1;
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
- for (int j = 0; j < node->get_navigation_polygon()->get_outline_count(); j++) {
+ for (int j = 0; j < node->get_navigation_polygon()->get_outline_count(); j++) {
- PoolVector<Vector2> points = node->get_navigation_polygon()->get_outline(j);
+ PoolVector<Vector2> points = node->get_navigation_polygon()->get_outline(j);
- int pc = points.size();
- PoolVector<Vector2>::Read poly = points.read();
+ int pc = points.size();
+ PoolVector<Vector2>::Read poly = points.read();
- for (int i = 0; i < pc; i++) {
+ for (int i = 0; i < pc; i++) {
- Vector2 cp = xform.xform(poly[i]);
+ Vector2 cp = xform.xform(poly[i]);
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_pos = cp;
- closest_outline = j;
- closest_idx = i;
- }
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_outline = j;
+ closest_idx = i;
}
}
+ }
- if (closest_idx >= 0) {
+ if (closest_idx >= 0) {
- pre_move_edit = node->get_navigation_polygon()->get_outline(closest_outline);
- edited_point = closest_idx;
- edited_outline = closest_outline;
- edited_point_pos = xform.affine_inverse().xform(closest_pos);
- canvas_item_editor->get_viewport_control()->update();
- return true;
- }
+ pre_move_edit = node->get_navigation_polygon()->get_outline(closest_outline);
+ edited_point = closest_idx;
+ edited_outline = closest_outline;
+ edited_point_pos = xform.affine_inverse().xform(closest_pos);
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
}
- } else {
+ }
+ } else {
- if (edited_point != -1) {
+ if (edited_point != -1) {
- //apply
+ //apply
- PoolVector<Vector2> poly = node->get_navigation_polygon()->get_outline(edited_outline);
- ERR_FAIL_INDEX_V(edited_point, poly.size(), false);
- poly.set(edited_point, edited_point_pos);
- undo_redo->create_action(TTR("Edit Poly"));
- undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "set_outline", edited_outline, poly);
- undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "set_outline", edited_outline, pre_move_edit);
- undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
- undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
- 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();
+ PoolVector<Vector2> poly = node->get_navigation_polygon()->get_outline(edited_outline);
+ ERR_FAIL_INDEX_V(edited_point, poly.size(), false);
+ poly.set(edited_point, edited_point_pos);
+ undo_redo->create_action(TTR("Edit Poly"));
+ undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "set_outline", edited_outline, poly);
+ undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "set_outline", edited_outline, pre_move_edit);
+ undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
+ undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
+ 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();
- edited_point = -1;
- return true;
- }
+ edited_point = -1;
+ return true;
}
- } else if (mb.button_index == BUTTON_RIGHT && mb.pressed && edited_point == -1) {
+ }
+ } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && edited_point == -1) {
- int closest_outline = -1;
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
+ int closest_outline = -1;
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
- for (int j = 0; j < node->get_navigation_polygon()->get_outline_count(); j++) {
+ for (int j = 0; j < node->get_navigation_polygon()->get_outline_count(); j++) {
- PoolVector<Vector2> points = node->get_navigation_polygon()->get_outline(j);
+ PoolVector<Vector2> points = node->get_navigation_polygon()->get_outline(j);
- int pc = points.size();
- PoolVector<Vector2>::Read poly = points.read();
+ int pc = points.size();
+ PoolVector<Vector2>::Read poly = points.read();
- for (int i = 0; i < pc; i++) {
+ for (int i = 0; i < pc; i++) {
- Vector2 cp = xform.xform(poly[i]);
+ Vector2 cp = xform.xform(poly[i]);
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_pos = cp;
- closest_outline = j;
- closest_idx = i;
- }
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_outline = j;
+ closest_idx = i;
}
}
+ }
- if (closest_idx >= 0) {
-
- PoolVector<Vector2> poly = node->get_navigation_polygon()->get_outline(closest_outline);
-
- if (poly.size() > 3) {
- undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
- undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "set_outline", closest_outline, poly);
- poly.remove(closest_idx);
- undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "set_outline", closest_outline, poly);
- undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
- undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
- 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();
- } else {
-
- undo_redo->create_action(TTR("Remove Poly And Point"));
- undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "add_outline_at_index", poly, closest_outline);
- poly.remove(closest_idx);
- undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "remove_outline", closest_outline);
- undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
- undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
- 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 (closest_idx >= 0) {
+
+ PoolVector<Vector2> poly = node->get_navigation_polygon()->get_outline(closest_outline);
+
+ if (poly.size() > 3) {
+ undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
+ undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "set_outline", closest_outline, poly);
+ poly.remove(closest_idx);
+ undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "set_outline", closest_outline, poly);
+ undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
+ undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
+ 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();
+ } else {
+
+ undo_redo->create_action(TTR("Remove Poly And Point"));
+ undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "add_outline_at_index", poly, closest_outline);
+ poly.remove(closest_idx);
+ undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "remove_outline", closest_outline);
+ undo_redo->add_do_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
+ undo_redo->add_undo_method(node->get_navigation_polygon().ptr(), "make_polygons_from_outlines");
+ 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;
}
+ }
- } break;
- }
-
- } break;
- case InputEvent::MOUSE_MOTION: {
+ } break;
+ }
+ }
- const InputEventMouseMotion &mm = p_event.mouse_motion;
+ Ref<InputEventMouseMotion> mm = p_event;
- if (edited_point != -1 && (wip_active || mm.button_mask & BUTTON_MASK_LEFT)) {
+ if (mm.is_valid()) {
- Vector2 gpoint = Point2(mm.x, mm.y);
- Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
- cpoint = canvas_item_editor->snap_point(cpoint);
- edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint);
+ if (edited_point != -1 && (wip_active || mm->get_button_mask() & BUTTON_MASK_LEFT)) {
- canvas_item_editor->get_viewport_control()->update();
- }
+ Vector2 gpoint = mm->get_position();
+ Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
+ cpoint = canvas_item_editor->snap_point(cpoint);
+ edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint);
- } break;
+ canvas_item_editor->get_viewport_control()->update();
+ }
}
return false;
diff --git a/editor/plugins/navigation_polygon_editor_plugin.h b/editor/plugins/navigation_polygon_editor_plugin.h
index ba18756869..6ec9b14cc1 100644
--- a/editor/plugins/navigation_polygon_editor_plugin.h
+++ b/editor/plugins/navigation_polygon_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -84,7 +85,7 @@ protected:
static void _bind_methods();
public:
- bool forward_gui_input(const InputEvent &p_event);
+ bool forward_gui_input(const Ref<InputEvent> &p_event);
void edit(Node *p_collision_polygon);
NavigationPolygonEditor(EditorNode *p_editor);
};
@@ -97,12 +98,12 @@ class NavigationPolygonEditorPlugin : public EditorPlugin {
EditorNode *editor;
public:
- virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "NavigationPolygonInstance"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
NavigationPolygonEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp
index 94644cd410..a759e5892f 100644
--- a/editor/plugins/particles_2d_editor_plugin.cpp
+++ b/editor/plugins/particles_2d_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,8 +31,8 @@
#include "canvas_item_editor_plugin.h"
#include "io/image_loader.h"
+#include "scene/3d/particles.h"
#include "scene/gui/separator.h"
-
void Particles2DEditorPlugin::edit(Object *p_object) {
if (p_object) {
@@ -61,77 +62,264 @@ void Particles2DEditorPlugin::_file_selected(const String &p_file) {
print_line("file: " + p_file);
- int epc = epoints->get_value();
+ source_emission_file = p_file;
+ emission_mask->popup_centered_minsize();
+}
+
+void Particles2DEditorPlugin::_menu_callback(int p_idx) {
+
+ switch (p_idx) {
+ case MENU_GENERATE_VISIBILITY_RECT: {
+ generate_aabb->popup_centered_minsize();
+ } break;
+ case MENU_LOAD_EMISSION_MASK: {
+
+ file->popup_centered_ratio();
+
+ } break;
+ case MENU_CLEAR_EMISSION_MASK: {
+
+ emission_mask->popup_centered_minsize();
+
+ /*undo_redo->create_action(TTR("Clear Emission Mask"));
+ undo_redo->add_do_method(particles, "set_emission_points", PoolVector<Vector2>());
+ undo_redo->add_undo_method(particles, "set_emission_points", particles->get_emission_points());
+ undo_redo->commit_action();*/
+ } break;
+ }
+}
+
+void Particles2DEditorPlugin::_generate_visibility_rect() {
+
+ float time = generate_seconds->get_value();
+
+ float running = 0.0;
+
+ EditorProgress ep("gen_aabb", TTR("Generating AABB"), int(time));
- Image img;
- Error err = ImageLoader::load_image(p_file, &img);
- ERR_EXPLAIN(TTR("Error loading image:") + " " + p_file);
+ Rect2 rect;
+ while (running < time) {
+
+ uint64_t ticks = OS::get_singleton()->get_ticks_usec();
+ ep.step("Generating..", int(running), true);
+ OS::get_singleton()->delay_usec(1000);
+
+ Rect2 capture = particles->capture_rect();
+ if (rect == Rect2())
+ rect = capture;
+ else
+ rect = rect.merge(capture);
+
+ running += (OS::get_singleton()->get_ticks_usec() - ticks) / 1000000.0;
+ }
+
+ particles->set_visibility_rect(rect);
+}
+
+void Particles2DEditorPlugin::_generate_emission_mask() {
+
+ Ref<ParticlesMaterial> pm = particles->get_process_material();
+ if (!pm.is_valid()) {
+ EditorNode::get_singleton()->show_warning(TTR("Can only set point into a ParticlesMaterial process material"));
+ return;
+ }
+
+ Ref<Image> img;
+ img.instance();
+ Error err = ImageLoader::load_image(source_emission_file, img);
+ ERR_EXPLAIN(TTR("Error loading image:") + " " + source_emission_file);
ERR_FAIL_COND(err != OK);
- img.convert(Image::FORMAT_LA8);
- ERR_FAIL_COND(img.get_format() != Image::FORMAT_LA8);
- Size2i s = Size2(img.get_width(), img.get_height());
+ if (img->is_compressed()) {
+ img->decompress();
+ }
+ img->convert(Image::FORMAT_RGBA8);
+ ERR_FAIL_COND(img->get_format() != Image::FORMAT_RGBA8);
+ Size2i s = Size2(img->get_width(), img->get_height());
ERR_FAIL_COND(s.width == 0 || s.height == 0);
- PoolVector<uint8_t> data = img.get_data();
- PoolVector<uint8_t>::Read r = data.read();
+ Vector<Point2> valid_positions;
+ Vector<Point2> valid_normals;
+ Vector<uint8_t> valid_colors;
- Vector<Point2i> valid_positions;
valid_positions.resize(s.width * s.height);
+
+ EmissionMode emode = (EmissionMode)emission_mask_mode->get_selected();
+
+ if (emode == EMISSION_MODE_BORDER_DIRECTED) {
+ valid_normals.resize(s.width * s.height);
+ }
+
+ bool capture_colors = emission_colors->is_pressed();
+
+ if (capture_colors) {
+ valid_colors.resize(s.width * s.height * 4);
+ }
+
int vpc = 0;
- for (int i = 0; i < s.width * s.height; i++) {
+ {
+ PoolVector<uint8_t> data = img->get_data();
+ PoolVector<uint8_t>::Read r = data.read();
+
+ for (int i = 0; i < s.width; i++) {
+ for (int j = 0; j < s.height; j++) {
+
+ uint8_t a = r[(j * s.width + i) * 4 + 3];
+
+ if (a > 128) {
+
+ if (emode == EMISSION_MODE_SOLID) {
+
+ if (capture_colors) {
+ valid_colors[vpc * 4 + 0] = r[(j * s.width + i) * 4 + 0];
+ valid_colors[vpc * 4 + 1] = r[(j * s.width + i) * 4 + 1];
+ valid_colors[vpc * 4 + 2] = r[(j * s.width + i) * 4 + 2];
+ valid_colors[vpc * 4 + 3] = r[(j * s.width + i) * 4 + 3];
+ }
+ valid_positions[vpc++] = Point2(i, j);
- uint8_t a = r[i * 2 + 1];
- if (a > 128) {
- valid_positions[vpc++] = Point2i(i % s.width, i / s.width);
+ } else {
+
+ bool on_border = false;
+ for (int x = i - 1; x <= i + 1; x++) {
+ for (int y = j - 1; y <= j + 1; y++) {
+
+ if (x < 0 || y < 0 || x >= s.width || y >= s.height || r[(y * s.width + x) * 4 + 3] <= 128) {
+ on_border = true;
+ break;
+ }
+ }
+
+ if (on_border)
+ break;
+ }
+
+ if (on_border) {
+ valid_positions[vpc] = Point2(i, j);
+
+ if (emode == EMISSION_MODE_BORDER_DIRECTED) {
+ Vector2 normal;
+ for (int x = i - 2; x <= i + 2; x++) {
+ for (int y = j - 2; y <= j + 2; y++) {
+
+ if (x == i && y == j)
+ continue;
+
+ if (x < 0 || y < 0 || x >= s.width || y >= s.height || r[(y * s.width + x) * 4 + 3] <= 128) {
+ normal += Vector2(x - i, y - j).normalized();
+ }
+ }
+ }
+
+ normal.normalize();
+ valid_normals[vpc] = normal;
+ }
+
+ if (capture_colors) {
+ valid_colors[vpc * 4 + 0] = r[(j * s.width + i) * 4 + 0];
+ valid_colors[vpc * 4 + 1] = r[(j * s.width + i) * 4 + 1];
+ valid_colors[vpc * 4 + 2] = r[(j * s.width + i) * 4 + 2];
+ valid_colors[vpc * 4 + 3] = r[(j * s.width + i) * 4 + 3];
+ }
+
+ vpc++;
+ }
+ }
+ }
+ }
}
}
valid_positions.resize(vpc);
+ if (valid_normals.size()) {
+ valid_normals.resize(vpc);
+ }
ERR_EXPLAIN(TTR("No pixels with transparency > 128 in image.."));
ERR_FAIL_COND(valid_positions.size() == 0);
- PoolVector<Point2> epoints;
- epoints.resize(epc);
- PoolVector<Point2>::Write w = epoints.write();
+ PoolVector<uint8_t> texdata;
+
+ int w = 2048;
+ int h = (vpc / 2048) + 1;
- Size2 extents = Size2(img.get_width() * 0.5, img.get_height() * 0.5);
+ texdata.resize(w * h * 2 * sizeof(float));
- for (int i = 0; i < epc; i++) {
+ {
+ PoolVector<uint8_t>::Write tw = texdata.write();
+ float *twf = (float *)tw.ptr();
+ for (int i = 0; i < vpc; i++) {
- Point2 p = valid_positions[Math::rand() % vpc];
- p -= s / 2;
- w[i] = p / extents;
+ twf[i * 2 + 0] = valid_positions[i].x;
+ twf[i * 2 + 1] = valid_positions[i].y;
+ }
}
- w = PoolVector<Point2>::Write();
+ img.instance();
+ img->create(w, h, false, Image::FORMAT_RGF, texdata);
- undo_redo->create_action(TTR("Set Emission Mask"));
- undo_redo->add_do_method(particles, "set_emission_points", epoints);
- undo_redo->add_do_method(particles, "set_emission_half_extents", extents);
- undo_redo->add_undo_method(particles, "set_emission_points", particles->get_emission_points());
- undo_redo->add_undo_method(particles, "set_emission_half_extents", particles->get_emission_half_extents());
- undo_redo->commit_action();
-}
+ Ref<ImageTexture> imgt;
+ imgt.instance();
+ imgt->create_from_image(img, 0);
-void Particles2DEditorPlugin::_menu_callback(int p_idx) {
+ pm->set_emission_point_texture(imgt);
+ pm->set_emission_point_count(vpc);
- switch (p_idx) {
- case MENU_LOAD_EMISSION_MASK: {
+ if (capture_colors) {
- file->popup_centered_ratio();
+ PoolVector<uint8_t> colordata;
+ colordata.resize(w * h * 4); //use RG texture
- } break;
- case MENU_CLEAR_EMISSION_MASK: {
+ {
+ PoolVector<uint8_t>::Write tw = colordata.write();
+ for (int i = 0; i < vpc * 4; i++) {
- undo_redo->create_action(TTR("Clear Emission Mask"));
- undo_redo->add_do_method(particles, "set_emission_points", PoolVector<Vector2>());
- undo_redo->add_undo_method(particles, "set_emission_points", particles->get_emission_points());
- undo_redo->commit_action();
- } break;
+ tw[i] = valid_colors[i];
+ }
+ }
+
+ img.instance();
+ img->create(w, h, false, Image::FORMAT_RGBA8, colordata);
+
+ imgt.instance();
+ imgt->create_from_image(img, 0);
+ pm->set_emission_color_texture(imgt);
}
+
+ if (valid_normals.size()) {
+ pm->set_emission_shape(ParticlesMaterial::EMISSION_SHAPE_DIRECTED_POINTS);
+
+ PoolVector<uint8_t> normdata;
+ normdata.resize(w * h * 2 * sizeof(float)); //use RG texture
+
+ {
+ PoolVector<uint8_t>::Write tw = normdata.write();
+ float *twf = (float *)tw.ptr();
+ for (int i = 0; i < vpc; i++) {
+ twf[i * 2 + 0] = valid_normals[i].x;
+ twf[i * 2 + 1] = valid_normals[i].y;
+ }
+ }
+
+ img.instance();
+ img->create(w, h, false, Image::FORMAT_RGF, normdata);
+
+ imgt.instance();
+ imgt->create_from_image(img, 0);
+ pm->set_emission_normal_texture(imgt);
+
+ } else {
+ pm->set_emission_shape(ParticlesMaterial::EMISSION_SHAPE_POINTS);
+ }
+
+ /*undo_redo->create_action(TTR("Set Emission Mask"));
+ undo_redo->add_do_method(particles, "set_emission_points", epoints);
+ undo_redo->add_do_method(particles, "set_emission_half_extents", extents);
+ undo_redo->add_undo_method(particles, "set_emission_points", particles->get_emission_points());
+ undo_redo->add_undo_method(particles, "set_emission_half_extents", particles->get_emission_half_extents());
+ undo_redo->commit_action();
+ */
}
void Particles2DEditorPlugin::_notification(int p_what) {
@@ -148,6 +336,8 @@ void Particles2DEditorPlugin::_bind_methods() {
ClassDB::bind_method(D_METHOD("_menu_callback"), &Particles2DEditorPlugin::_menu_callback);
ClassDB::bind_method(D_METHOD("_file_selected"), &Particles2DEditorPlugin::_file_selected);
+ ClassDB::bind_method(D_METHOD("_generate_visibility_rect"), &Particles2DEditorPlugin::_generate_visibility_rect);
+ ClassDB::bind_method(D_METHOD("_generate_emission_mask"), &Particles2DEditorPlugin::_generate_emission_mask);
}
Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) {
@@ -163,8 +353,10 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) {
toolbar->add_child(memnew(VSeparator));
menu = memnew(MenuButton);
+ menu->get_popup()->add_item(TTR("Generate Visibility Rect"), MENU_GENERATE_VISIBILITY_RECT);
+ menu->get_popup()->add_separator();
menu->get_popup()->add_item(TTR("Load Emission Mask"), MENU_LOAD_EMISSION_MASK);
- menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK);
+ // menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK);
menu->set_text("Particles");
toolbar->add_child(menu);
@@ -183,6 +375,37 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) {
epoints->set_step(1);
epoints->set_value(512);
file->get_vbox()->add_margin_child(TTR("Generated Point Count:"), epoints);
+
+ generate_aabb = memnew(ConfirmationDialog);
+ generate_aabb->set_title(TTR("Generate Visibility Rect"));
+ VBoxContainer *genvb = memnew(VBoxContainer);
+ generate_aabb->add_child(genvb);
+ generate_seconds = memnew(SpinBox);
+ genvb->add_margin_child(TTR("Generation Time (sec):"), generate_seconds);
+ generate_seconds->set_min(0.1);
+ generate_seconds->set_max(25);
+ generate_seconds->set_value(2);
+
+ toolbar->add_child(generate_aabb);
+
+ generate_aabb->connect("confirmed", this, "_generate_visibility_rect");
+
+ emission_mask = memnew(ConfirmationDialog);
+ emission_mask->set_title(TTR("Generate Visibility Rect"));
+ VBoxContainer *emvb = memnew(VBoxContainer);
+ emission_mask->add_child(emvb);
+ emission_mask_mode = memnew(OptionButton);
+ emvb->add_margin_child(TTR("Emission Mask"), emission_mask_mode);
+ emission_mask_mode->add_item("Solid Pixels", EMISSION_MODE_SOLID);
+ emission_mask_mode->add_item("Border Pixels", EMISSION_MODE_BORDER);
+ emission_mask_mode->add_item("Directed Border Pixels", EMISSION_MODE_BORDER_DIRECTED);
+ emission_colors = memnew(CheckBox);
+ emission_colors->set_text(TTR("Capture from Pixel"));
+ emvb->add_margin_child(TTR("Emission Colors"), emission_colors);
+
+ toolbar->add_child(emission_mask);
+
+ emission_mask->connect("confirmed", this, "_generate_emission_mask");
}
Particles2DEditorPlugin::~Particles2DEditorPlugin() {
diff --git a/editor/plugins/particles_2d_editor_plugin.h b/editor/plugins/particles_2d_editor_plugin.h
index 56122c4354..ccfec1a25f 100644
--- a/editor/plugins/particles_2d_editor_plugin.h
+++ b/editor/plugins/particles_2d_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,10 +44,17 @@ class Particles2DEditorPlugin : public EditorPlugin {
enum {
+ MENU_GENERATE_VISIBILITY_RECT,
MENU_LOAD_EMISSION_MASK,
MENU_CLEAR_EMISSION_MASK
};
+ enum EmissionMode {
+ EMISSION_MODE_SOLID,
+ EMISSION_MODE_BORDER,
+ EMISSION_MODE_BORDER_DIRECTED
+ };
+
Particles2D *particles;
EditorFileDialog *file;
@@ -57,9 +65,20 @@ class Particles2DEditorPlugin : public EditorPlugin {
SpinBox *epoints;
+ ConfirmationDialog *generate_aabb;
+ SpinBox *generate_seconds;
+
+ ConfirmationDialog *emission_mask;
+ OptionButton *emission_mask_mode;
+ CheckBox *emission_colors;
+
+ String source_emission_file;
+
UndoRedo *undo_redo;
void _file_selected(const String &p_file);
void _menu_callback(int p_idx);
+ void _generate_visibility_rect();
+ void _generate_emission_mask();
protected:
void _notification(int p_what);
@@ -68,8 +87,8 @@ protected:
public:
virtual String get_name() const { return "Particles2D"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
Particles2DEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp
index fd26674a0e..d918a3e24e 100644
--- a/editor/plugins/particles_editor_plugin.cpp
+++ b/editor/plugins/particles_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,30 +28,24 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#if 0
#include "particles_editor_plugin.h"
#include "editor/plugins/spatial_editor_plugin.h"
#include "io/resource_loader.h"
-#include "servers/visual/particle_system_sw.h"
-
void ParticlesEditor::_node_removed(Node *p_node) {
- if(p_node==node) {
- node=NULL;
+ if (p_node == node) {
+ node = NULL;
hide();
}
-
}
-
-void ParticlesEditor::_resource_seleted(const String& p_res) {
+void ParticlesEditor::_resource_seleted(const String &p_res) {
//print_line("selected resource path: "+p_res);
}
-void ParticlesEditor::_node_selected(const NodePath& p_path){
-
+void ParticlesEditor::_node_selected(const NodePath &p_path) {
Node *sel = get_node(p_path);
if (!sel)
@@ -66,12 +61,11 @@ void ParticlesEditor::_node_selected(const NodePath& p_path){
geometry = vi->get_faces(VisualInstance::FACES_SOLID);
- if (geometry.size()==0) {
+ if (geometry.size() == 0) {
err_dialog->set_text(TTR("Node does not contain geometry (faces)."));
err_dialog->popup_centered_minsize();
return;
-
}
Transform geom_xform = node->get_global_transform().affine_inverse() * vi->get_global_transform();
@@ -79,20 +73,17 @@ void ParticlesEditor::_node_selected(const NodePath& p_path){
int gc = geometry.size();
PoolVector<Face3>::Write w = geometry.write();
-
- for(int i=0;i<gc;i++) {
- for(int j=0;j<3;j++) {
- w[i].vertex[j] = geom_xform.xform( w[i].vertex[j] );
+ for (int i = 0; i < gc; i++) {
+ for (int j = 0; j < 3; j++) {
+ w[i].vertex[j] = geom_xform.xform(w[i].vertex[j]);
}
}
-
w = PoolVector<Face3>::Write();
- emission_dialog->popup_centered(Size2(300,130));
+ emission_dialog->popup_centered(Size2(300, 130));
}
-
/*
void ParticlesEditor::_populate() {
@@ -112,74 +103,36 @@ void ParticlesEditor::_populate() {
void ParticlesEditor::_notification(int p_notification) {
- if (p_notification==NOTIFICATION_ENTER_TREE) {
- options->set_icon(options->get_popup()->get_icon("Particles","EditorIcons"));
-
+ if (p_notification == NOTIFICATION_ENTER_TREE) {
+ options->set_icon(options->get_popup()->get_icon("Particles", "EditorIcons"));
}
}
-
void ParticlesEditor::_menu_option(int p_option) {
-
- switch(p_option) {
+ switch (p_option) {
case MENU_OPTION_GENERATE_AABB: {
-
- Transform globalizer = node->get_global_transform();
- ParticleSystemSW pssw;
- for(int i=0;i<VS::PARTICLE_VAR_MAX;i++) {
-
- pssw.particle_vars[i]=node->get_variable((Particles::Variable)i);
- pssw.particle_randomness[i]=node->get_randomness((Particles::Variable)i);
- }
-
- pssw.emission_half_extents=node->get_emission_half_extents();
- pssw.emission_points=node->get_emission_points();
- pssw.emission_base_velocity=node->get_emission_base_velocity();
- pssw.amount=node->get_amount();
- pssw.gravity_normal=node->get_gravity_normal();
- pssw.emitting=true;
- pssw.height_from_velocity=node->has_height_from_velocity();
- pssw.color_phase_count=1;
-
-
- ParticleSystemProcessSW pp;
- float delta=0.01;
- float lifetime=pssw.particle_vars[VS::PARTICLE_LIFETIME];
-
-
- Transform localizer = globalizer.affine_inverse();
- AABB aabb;
- for(float t=0;t<lifetime;t+=delta) {
-
- pp.process(&pssw,globalizer,delta);
- for(int i=0;i<pp.particle_data.size();i++) {
-
- Vector3 p = localizer.xform(pp.particle_data[i].pos);
-
- if (t==0 && i==0)
- aabb.pos=p;
- else
- aabb.expand_to(p);
- }
- }
-
- aabb.grow_by( aabb.get_longest_axis_size()*0.2);
-
- node->set_visibility_aabb(aabb);
-
-
+ generate_aabb->popup_centered_minsize();
} break;
case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH: {
-
+ Ref<ParticlesMaterial> material = node->get_process_material();
+ if (material.is_null()) {
+ EditorNode::get_singleton()->show_warning(TTR("A processor material of type 'ParticlesMaterial' is required."));
+ return;
+ }
emission_file_dialog->popup_centered_ratio();
} break;
case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE: {
-/*
+ Ref<ParticlesMaterial> material = node->get_process_material();
+ if (material.is_null()) {
+ EditorNode::get_singleton()->show_warning(TTR("A processor material of type 'ParticlesMaterial' is required."));
+ return;
+ }
+ /*
Node *root = get_scene()->get_root_node();
ERR_FAIL_COND(!root);
EditorNode *en = root->cast_to<EditorNode>();
@@ -192,50 +145,77 @@ void ParticlesEditor::_menu_option(int p_option) {
}
}
+void ParticlesEditor::_generate_aabb() {
-void ParticlesEditor::edit(Particles *p_particles) {
+ float time = generate_seconds->get_value();
+
+ float running = 0.0;
+
+ EditorProgress ep("gen_aabb", TTR("Generating AABB"), int(time));
+
+ Rect3 rect;
+ while (running < time) {
+
+ uint64_t ticks = OS::get_singleton()->get_ticks_usec();
+ ep.step("Generating..", int(running), true);
+ OS::get_singleton()->delay_usec(1000);
+
+ Rect3 capture = node->capture_aabb();
+ if (rect == Rect3())
+ rect = capture;
+ else
+ rect.merge_with(capture);
+
+ running += (OS::get_singleton()->get_ticks_usec() - ticks) / 1000000.0;
+ }
+
+ node->set_visibility_aabb(rect);
+}
- node=p_particles;
+void ParticlesEditor::edit(Particles *p_particles) {
+ node = p_particles;
}
void ParticlesEditor::_generate_emission_points() {
/// hacer codigo aca
- PoolVector<Vector3> points;
+ PoolVector<float> points;
+ bool use_normals = emission_fill->get_selected() == 1;
+ PoolVector<float> normals;
- if (emission_fill->get_selected()==0) {
+ if (emission_fill->get_selected() < 2) {
- float area_accum=0;
- Map<float,int> triangle_area_map;
- print_line("geometry size: "+itos(geometry.size()));
+ float area_accum = 0;
+ Map<float, int> triangle_area_map;
+ print_line("geometry size: " + itos(geometry.size()));
- for(int i=0;i<geometry.size();i++) {
+ for (int i = 0; i < geometry.size(); i++) {
float area = geometry[i].get_area();
- if (area<CMP_EPSILON)
+ if (area < CMP_EPSILON)
continue;
- triangle_area_map[area_accum]=i;
- area_accum+=area;
+ triangle_area_map[area_accum] = i;
+ area_accum += area;
}
- if (!triangle_area_map.size() || area_accum==0) {
+ if (!triangle_area_map.size() || area_accum == 0) {
err_dialog->set_text(TTR("Faces contain no area!"));
err_dialog->popup_centered_minsize();
return;
}
- int emissor_count=emission_amount->get_val();
+ int emissor_count = emission_amount->get_value();
- for(int i=0;i<emissor_count;i++) {
+ for (int i = 0; i < emissor_count; i++) {
- float areapos = Math::random(0,area_accum);
+ float areapos = Math::random(0.0f, area_accum);
- Map<float,int>::Element *E = triangle_area_map.find_closest(areapos);
+ Map<float, int>::Element *E = triangle_area_map.find_closest(areapos);
ERR_FAIL_COND(!E)
int index = E->get();
- ERR_FAIL_INDEX(index,geometry.size());
+ ERR_FAIL_INDEX(index, geometry.size());
// ok FINALLY get face
Face3 face = geometry[index];
@@ -243,13 +223,22 @@ void ParticlesEditor::_generate_emission_points() {
Vector3 pos = face.get_random_point_inside();
- points.push_back(pos);
+ points.push_back(pos.x);
+ points.push_back(pos.y);
+ points.push_back(pos.z);
+
+ if (use_normals) {
+ Vector3 normal = face.get_plane().normal;
+ normals.push_back(normal.x);
+ normals.push_back(normal.y);
+ normals.push_back(normal.z);
+ }
}
} else {
int gcount = geometry.size();
- if (gcount==0) {
+ if (gcount == 0) {
err_dialog->set_text(TTR("No faces!"));
err_dialog->popup_centered_minsize();
@@ -258,32 +247,32 @@ void ParticlesEditor::_generate_emission_points() {
PoolVector<Face3>::Read r = geometry.read();
- AABB aabb;
+ Rect3 aabb;
- for(int i=0;i<gcount;i++) {
+ for (int i = 0; i < gcount; i++) {
- for(int j=0;j<3;j++) {
+ for (int j = 0; j < 3; j++) {
- if (i==0 && j==0)
- aabb.pos=r[i].vertex[j];
+ if (i == 0 && j == 0)
+ aabb.position = r[i].vertex[j];
else
aabb.expand_to(r[i].vertex[j]);
}
}
- int emissor_count=emission_amount->get_val();
+ int emissor_count = emission_amount->get_value();
- for(int i=0;i<emissor_count;i++) {
+ for (int i = 0; i < emissor_count; i++) {
- int attempts=5;
+ int attempts = 5;
- for(int j=0;j<attempts;j++) {
+ for (int j = 0; j < attempts; j++) {
Vector3 dir;
- dir[Math::rand()%3]=1.0;
- Vector3 ofs = Vector3(1,1,1)-dir;
- ofs=(Vector3(1,1,1)-dir)*Vector3(Math::randf(),Math::randf(),Math::randf())*aabb.size;
- ofs+=aabb.pos;
+ dir[Math::rand() % 3] = 1.0;
+ Vector3 ofs = Vector3(1, 1, 1) - dir;
+ ofs = (Vector3(1, 1, 1) - dir) * Vector3(Math::randf(), Math::randf(), Math::randf()) * aabb.size;
+ ofs += aabb.position;
Vector3 ofsv = ofs + aabb.size * dir;
@@ -291,135 +280,187 @@ void ParticlesEditor::_generate_emission_points() {
ofs -= dir;
ofsv += dir;
- float max=-1e7,min=1e7;
+ float max = -1e7, min = 1e7;
- for(int k=0;k<gcount;k++) {
+ for (int k = 0; k < gcount; k++) {
- const Face3& f3 = r[k];
+ const Face3 &f3 = r[k];
Vector3 res;
- if (f3.intersects_segment(ofs,ofsv,&res)) {
+ if (f3.intersects_segment(ofs, ofsv, &res)) {
- res-=ofs;
+ res -= ofs;
float d = dir.dot(res);
- if (d<min)
- min=d;
- if (d>max)
- max=d;
-
+ if (d < min)
+ min = d;
+ if (d > max)
+ max = d;
}
}
-
- if (max<min)
+ if (max < min)
continue; //lost attempt
- float val = min + (max-min)*Math::randf();
+ float val = min + (max - min) * Math::randf();
Vector3 point = ofs + dir * val;
- points.push_back(point);
+ points.push_back(point.x);
+ points.push_back(point.y);
+ points.push_back(point.z);
break;
}
}
}
- //print_line("point count: "+itos(points.size()));
- node->set_emission_points(points);
+ int point_count = points.size() / 3;
+
+ int w = 2048;
+ int h = (point_count / 2048) + 1;
+
+ PoolVector<uint8_t> point_img;
+ point_img.resize(w * h * 3 * sizeof(float));
+
+ {
+ PoolVector<uint8_t>::Write iw = point_img.write();
+ zeromem(iw.ptr(), w * h * 3 * sizeof(float));
+ PoolVector<float>::Read r = points.read();
+ copymem(iw.ptr(), r.ptr(), point_count * sizeof(float) * 3);
+ }
+
+ Ref<Image> image = memnew(Image(w, h, false, Image::FORMAT_RGBF, point_img));
+
+ Ref<ImageTexture> tex;
+ tex.instance();
+ tex->create_from_image(image, Texture::FLAG_FILTER);
+
+ Ref<ParticlesMaterial> material = node->get_process_material();
+ ERR_FAIL_COND(material.is_null());
+
+ if (use_normals) {
+
+ material->set_emission_shape(ParticlesMaterial::EMISSION_SHAPE_DIRECTED_POINTS);
+ material->set_emission_point_count(point_count);
+ material->set_emission_point_texture(tex);
+
+ PoolVector<uint8_t> point_img2;
+ point_img2.resize(w * h * 3 * sizeof(float));
+
+ {
+ PoolVector<uint8_t>::Write iw = point_img2.write();
+ zeromem(iw.ptr(), w * h * 3 * sizeof(float));
+ PoolVector<float>::Read r = normals.read();
+ copymem(iw.ptr(), r.ptr(), point_count * sizeof(float) * 3);
+ }
+
+ Ref<Image> image2 = memnew(Image(w, h, false, Image::FORMAT_RGBF, point_img2));
+
+ Ref<ImageTexture> tex2;
+ tex2.instance();
+ tex2->create_from_image(image2, Texture::FLAG_FILTER);
+ material->set_emission_normal_texture(tex2);
+ } else {
+
+ material->set_emission_shape(ParticlesMaterial::EMISSION_SHAPE_POINTS);
+ material->set_emission_point_count(point_count);
+ material->set_emission_point_texture(tex);
+ }
+
+ //print_line("point count: "+itos(points.size()));
+ //node->set_emission_points(points);
}
void ParticlesEditor::_bind_methods() {
- ClassDB::bind_method("_menu_option",&ParticlesEditor::_menu_option);
- ClassDB::bind_method("_resource_seleted",&ParticlesEditor::_resource_seleted);
- ClassDB::bind_method("_node_selected",&ParticlesEditor::_node_selected);
- ClassDB::bind_method("_generate_emission_points",&ParticlesEditor::_generate_emission_points);
+ ClassDB::bind_method("_menu_option", &ParticlesEditor::_menu_option);
+ ClassDB::bind_method("_resource_seleted", &ParticlesEditor::_resource_seleted);
+ ClassDB::bind_method("_node_selected", &ParticlesEditor::_node_selected);
+ ClassDB::bind_method("_generate_emission_points", &ParticlesEditor::_generate_emission_points);
+ ClassDB::bind_method("_generate_aabb", &ParticlesEditor::_generate_aabb);
//ClassDB::bind_method("_populate",&ParticlesEditor::_populate);
-
}
ParticlesEditor::ParticlesEditor() {
- particles_editor_hb = memnew ( HBoxContainer );
+ particles_editor_hb = memnew(HBoxContainer);
SpatialEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb);
- options = memnew( MenuButton );
+ options = memnew(MenuButton);
particles_editor_hb->add_child(options);
particles_editor_hb->hide();
options->set_text("Particles");
- options->get_popup()->add_item(TTR("Generate AABB"),MENU_OPTION_GENERATE_AABB);
+ options->get_popup()->add_item(TTR("Generate AABB"), MENU_OPTION_GENERATE_AABB);
options->get_popup()->add_separator();
- options->get_popup()->add_item(TTR("Create Emitter From Mesh"),MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH);
- options->get_popup()->add_item(TTR("Create Emitter From Node"),MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE);
- options->get_popup()->add_item(TTR("Clear Emitter"),MENU_OPTION_CLEAR_EMISSION_VOLUME);
+ options->get_popup()->add_item(TTR("Create Emission Points From Mesh"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH);
+ options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE);
+ // options->get_popup()->add_item(TTR("Clear Emitter"), MENU_OPTION_CLEAR_EMISSION_VOLUME);
- options->get_popup()->connect("id_pressed", this,"_menu_option");
+ options->get_popup()->connect("id_pressed", this, "_menu_option");
- emission_dialog = memnew( ConfirmationDialog );
+ emission_dialog = memnew(ConfirmationDialog);
emission_dialog->set_title(TTR("Create Emitter"));
add_child(emission_dialog);
- Label *l = memnew(Label);
- l->set_pos(Point2(5,5));
- l->set_text(TTR("Emission Positions:"));
- emission_dialog->add_child(l);
-
+ VBoxContainer *emd_vb = memnew(VBoxContainer);
+ emission_dialog->add_child(emd_vb);
- emission_amount = memnew( SpinBox );
- emission_amount->set_anchor(MARGIN_RIGHT,ANCHOR_END);
- emission_amount->set_begin( Point2(20,23));
- emission_amount->set_end( Point2(5,25));
+ emission_amount = memnew(SpinBox);
emission_amount->set_min(1);
- emission_amount->set_max(65536);
- emission_amount->set_val(512);
- emission_dialog->add_child(emission_amount);
- emission_dialog->get_ok()->set_text(TTR("Create"));
- emission_dialog->connect("confirmed",this,"_generate_emission_points");
-
- l = memnew(Label);
- l->set_pos(Point2(5,50));
- l->set_text(TTR("Emission Fill:"));
- emission_dialog->add_child(l);
-
- emission_fill = memnew( OptionButton );
- emission_fill->set_anchor(MARGIN_RIGHT,ANCHOR_END);
- emission_fill->set_begin( Point2(20,70));
- emission_fill->set_end( Point2(5,75));
- emission_fill->add_item(TTR("Surface"));
+ emission_amount->set_max(100000);
+ emission_amount->set_value(512);
+ emd_vb->add_margin_child(TTR("Emission Points:"), emission_amount);
+
+ emission_fill = memnew(OptionButton);
+ emission_fill->add_item(TTR("Surface Points"));
+ emission_fill->add_item(TTR("Surface Points+Normal (Directed)"));
emission_fill->add_item(TTR("Volume"));
- emission_dialog->add_child(emission_fill);
+ emd_vb->add_margin_child(TTR("Emission Source: "), emission_fill);
+
+ emission_dialog->get_ok()->set_text(TTR("Create"));
+ emission_dialog->connect("confirmed", this, "_generate_emission_points");
- err_dialog = memnew( ConfirmationDialog );
+ err_dialog = memnew(ConfirmationDialog);
//err_dialog->get_cancel()->hide();
add_child(err_dialog);
-
- emission_file_dialog = memnew( EditorFileDialog );
+ emission_file_dialog = memnew(EditorFileDialog);
add_child(emission_file_dialog);
- emission_file_dialog->connect("file_selected",this,"_resource_seleted");
- emission_tree_dialog = memnew( SceneTreeDialog );
+ emission_file_dialog->connect("file_selected", this, "_resource_seleted");
+ emission_tree_dialog = memnew(SceneTreeDialog);
add_child(emission_tree_dialog);
- emission_tree_dialog->connect("selected",this,"_node_selected");
+ emission_tree_dialog->connect("selected", this, "_node_selected");
List<String> extensions;
- ResourceLoader::get_recognized_extensions_for_type("Mesh",&extensions);
+ ResourceLoader::get_recognized_extensions_for_type("Mesh", &extensions);
emission_file_dialog->clear_filters();
- for(int i=0;i<extensions.size();i++) {
+ for (int i = 0; i < extensions.size(); i++) {
- emission_file_dialog->add_filter("*."+extensions[i]+" ; "+extensions[i].to_upper());
+ emission_file_dialog->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper());
}
emission_file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE);
+ generate_aabb = memnew(ConfirmationDialog);
+ generate_aabb->set_title(TTR("Generate Visibility AABB"));
+ VBoxContainer *genvb = memnew(VBoxContainer);
+ generate_aabb->add_child(genvb);
+ generate_seconds = memnew(SpinBox);
+ genvb->add_margin_child(TTR("Generation Time (sec):"), generate_seconds);
+ generate_seconds->set_min(0.1);
+ generate_seconds->set_max(25);
+ generate_seconds->set_value(2);
+
+ add_child(generate_aabb);
+
+ generate_aabb->connect("confirmed", this, "_generate_aabb");
+
//options->set_anchor(MARGIN_LEFT,Control::ANCHOR_END);
//options->set_anchor(MARGIN_RIGHT,Control::ANCHOR_END);
-
}
-
void ParticlesEditorPlugin::edit(Object *p_object) {
particles_editor->edit(p_object->cast_to<Particles>());
@@ -427,7 +468,7 @@ void ParticlesEditorPlugin::edit(Object *p_object) {
bool ParticlesEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("Particles");
+ return p_object->is_class("Particles");
}
void ParticlesEditorPlugin::make_visible(bool p_visible) {
@@ -440,21 +481,16 @@ void ParticlesEditorPlugin::make_visible(bool p_visible) {
particles_editor->hide();
particles_editor->edit(NULL);
}
-
}
ParticlesEditorPlugin::ParticlesEditorPlugin(EditorNode *p_node) {
- editor=p_node;
- particles_editor = memnew( ParticlesEditor );
+ editor = p_node;
+ particles_editor = memnew(ParticlesEditor);
editor->get_viewport()->add_child(particles_editor);
particles_editor->hide();
}
-
-ParticlesEditorPlugin::~ParticlesEditorPlugin()
-{
+ParticlesEditorPlugin::~ParticlesEditorPlugin() {
}
-
-#endif
diff --git a/editor/plugins/particles_editor_plugin.h b/editor/plugins/particles_editor_plugin.h
index 420e20d641..a6e14266c7 100644
--- a/editor/plugins/particles_editor_plugin.h
+++ b/editor/plugins/particles_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,17 +38,16 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
-#if 0
+
class ParticlesEditor : public Control {
- GDCLASS(ParticlesEditor, Control );
+ GDCLASS(ParticlesEditor, Control);
Panel *panel;
MenuButton *options;
HBoxContainer *particles_editor_hb;
Particles *node;
-
EditorFileDialog *emission_file_dialog;
SceneTreeDialog *emission_tree_dialog;
@@ -57,8 +57,8 @@ class ParticlesEditor : public Control {
SpinBox *emission_amount;
OptionButton *emission_fill;
-
-
+ ConfirmationDialog *generate_aabb;
+ SpinBox *generate_seconds;
enum Menu {
@@ -71,46 +71,43 @@ class ParticlesEditor : public Control {
PoolVector<Face3> geometry;
+ void _generate_aabb();
void _generate_emission_points();
- void _resource_seleted(const String& p_res);
- void _node_selected(const NodePath& p_path);
+ void _resource_seleted(const String &p_res);
+ void _node_selected(const NodePath &p_path);
void _menu_option(int);
void _populate();
-friend class ParticlesEditorPlugin;
+ friend class ParticlesEditorPlugin;
protected:
-
void _notification(int p_notification);
void _node_removed(Node *p_node);
static void _bind_methods();
-public:
+public:
void edit(Particles *p_particles);
ParticlesEditor();
};
class ParticlesEditorPlugin : public EditorPlugin {
- GDCLASS( ParticlesEditorPlugin, EditorPlugin );
+ GDCLASS(ParticlesEditorPlugin, EditorPlugin);
ParticlesEditor *particles_editor;
EditorNode *editor;
public:
-
virtual String get_name() const { return "Particles"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
ParticlesEditorPlugin(EditorNode *p_node);
~ParticlesEditorPlugin();
-
};
#endif // PARTICLES_EDITOR_PLUGIN_H
-#endif
diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp
index 36605c118f..3a210f3fe0 100644
--- a/editor/plugins/path_2d_editor_plugin.cpp
+++ b/editor/plugins/path_2d_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -57,8 +58,7 @@ void Path2DEditor::_node_removed(Node *p_node) {
}
}
-bool Path2DEditor::forward_gui_input(const InputEvent &p_event) {
-
+bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (!node)
return false;
@@ -68,70 +68,50 @@ bool Path2DEditor::forward_gui_input(const InputEvent &p_event) {
if (!node->get_curve().is_valid())
return false;
- switch (p_event.type) {
-
- case InputEvent::MOUSE_BUTTON: {
-
- const InputEventMouseButton &mb = p_event.mouse_button;
-
- Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Ref<InputEventMouseButton> mb = p_event;
- Vector2 gpoint = Point2(mb.x, mb.y);
- Vector2 cpoint = !mb.mod.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)));
+ if (mb.is_valid()) {
- //first check if a point is to be added (segment split)
- real_t grab_treshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- // Test move point!!
+ Vector2 gpoint = mb->get_position();
+ Vector2 cpoint =
+ !mb->get_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)));
- if (mb.pressed && action == ACTION_NONE) {
+ real_t grab_threshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
- Ref<Curve2D> curve = node->get_curve();
+ if (mb->is_pressed() && action == ACTION_NONE) {
- for (int i = 0; i < curve->get_point_count(); i++) {
+ Ref<Curve2D> curve = node->get_curve();
- bool pointunder = false;
+ for (int i = 0; i < curve->get_point_count(); i++) {
- {
- Point2 p = xform.xform(curve->get_point_pos(i));
- if (gpoint.distance_to(p) < grab_treshold) {
+ real_t dist_to_p = gpoint.distance_to(xform.xform(curve->get_point_pos(i)));
+ real_t dist_to_p_out = gpoint.distance_to(xform.xform(curve->get_point_pos(i) + curve->get_point_out(i)));
+ real_t dist_to_p_in = gpoint.distance_to(xform.xform(curve->get_point_pos(i) + curve->get_point_in(i)));
- if (mb.button_index == BUTTON_LEFT && !mb.mod.shift && mode == MODE_EDIT) {
+ // Check for point movement start (for point + in/out controls).
+ if (mb->get_button_index() == BUTTON_LEFT) {
+ if (mode == MODE_EDIT && !mb->get_shift() && dist_to_p < grab_threshold) {
+ // Points can only be moved in edit mode.
- action = ACTION_MOVING_POINT;
- action_point = i;
- moving_from = curve->get_point_pos(i);
- moving_screen_from = gpoint;
- return true;
- } 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 Curve"));
- undo_redo->add_do_method(curve.ptr(), "remove_point", i);
- undo_redo->add_undo_method(curve.ptr(), "add_point", curve->get_point_pos(i), curve->get_point_in(i), curve->get_point_out(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;
- } else
- pointunder = true;
- }
- }
-
- if (mb.button_index == BUTTON_LEFT && i < (curve->get_point_count() - 1)) {
- Point2 p = xform.xform(curve->get_point_pos(i) + curve->get_point_out(i));
- if (gpoint.distance_to(p) < grab_treshold && (mode == MODE_EDIT || mode == MODE_EDIT_CURVE)) {
+ action = ACTION_MOVING_POINT;
+ action_point = i;
+ moving_from = curve->get_point_pos(i);
+ moving_screen_from = gpoint;
+ return true;
+ } else if (mode == MODE_EDIT || mode == MODE_EDIT_CURVE) {
+ // In/out controls can be moved in multiple modes.
+ if (dist_to_p_out < grab_threshold && i < (curve->get_point_count() - 1)) {
action = ACTION_MOVING_OUT;
action_point = i;
moving_from = curve->get_point_out(i);
moving_screen_from = gpoint;
return true;
- }
- }
-
- if (mb.button_index == BUTTON_LEFT && i > 0) {
- Point2 p = xform.xform(curve->get_point_pos(i) + curve->get_point_in(i));
- if (gpoint.distance_to(p) < grab_treshold && (mode == MODE_EDIT || mode == MODE_EDIT_CURVE)) {
+ } else if (dist_to_p_in < grab_threshold && i > 0) {
action = ACTION_MOVING_IN;
action_point = i;
@@ -140,314 +120,362 @@ bool Path2DEditor::forward_gui_input(const InputEvent &p_event) {
return true;
}
}
+ }
- if (pointunder)
+ // Check for point deletion.
+ if ((mb->get_button_index() == BUTTON_RIGHT && mode == MODE_EDIT) || (mb->get_button_index() == BUTTON_LEFT && mode == MODE_DELETE)) {
+ if (dist_to_p < grab_threshold) {
+
+ undo_redo->create_action(TTR("Remove Point from Curve"));
+ undo_redo->add_do_method(curve.ptr(), "remove_point", i);
+ undo_redo->add_undo_method(curve.ptr(), "add_point", curve->get_point_pos(i), curve->get_point_in(i), curve->get_point_out(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;
+ } else if (dist_to_p_out < grab_threshold) {
+
+ undo_redo->create_action(TTR("Remove Out-Control from Curve"));
+ undo_redo->add_do_method(curve.ptr(), "set_point_out", i, Vector2());
+ undo_redo->add_undo_method(curve.ptr(), "set_point_out", i, curve->get_point_out(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;
+ } else if (dist_to_p_in < grab_threshold) {
+
+ undo_redo->create_action(TTR("Remove In-Control from Curve"));
+ undo_redo->add_do_method(curve.ptr(), "set_point_in", i, Vector2());
+ undo_redo->add_undo_method(curve.ptr(), "set_point_in", i, curve->get_point_in(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;
+ }
}
}
+ }
- // Test add point in empty space!
+ // Check for point creation.
+ if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && ((mb->get_command() && mode == MODE_EDIT) || mode == MODE_CREATE)) {
- if (mb.pressed && mb.button_index == BUTTON_LEFT && ((mb.mod.command && mode == MODE_EDIT) || mode == MODE_CREATE)) {
+ Ref<Curve2D> curve = node->get_curve();
- Ref<Curve2D> curve = node->get_curve();
+ undo_redo->create_action(TTR("Add Point to Curve"));
+ undo_redo->add_do_method(curve.ptr(), "add_point", cpoint);
+ undo_redo->add_undo_method(curve.ptr(), "remove_point", curve->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();
- undo_redo->create_action(TTR("Add Point to Curve"));
- undo_redo->add_do_method(curve.ptr(), "add_point", cpoint);
- undo_redo->add_undo_method(curve.ptr(), "remove_point", curve->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();
+ action = ACTION_MOVING_POINT;
+ action_point = curve->get_point_count() - 1;
+ moving_from = curve->get_point_pos(action_point);
+ moving_screen_from = gpoint;
- action = ACTION_MOVING_POINT;
- action_point = curve->get_point_count() - 1;
- moving_from = curve->get_point_pos(action_point);
- moving_screen_from = gpoint;
+ canvas_item_editor->get_viewport_control()->update();
- canvas_item_editor->get_viewport_control()->update();
+ return true;
+ }
- return true;
- }
+ // Check for point movement completion.
+ if (!mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && action != ACTION_NONE) {
- if (!mb.pressed && mb.button_index == BUTTON_LEFT && action != ACTION_NONE) {
+ Ref<Curve2D> curve = node->get_curve();
- Ref<Curve2D> curve = node->get_curve();
+ Vector2 new_pos = moving_from + xform.affine_inverse().basis_xform(gpoint - moving_screen_from);
+ switch (action) {
- Vector2 new_pos = moving_from + xform.affine_inverse().basis_xform(gpoint - moving_screen_from);
- switch (action) {
+ case ACTION_NONE:
+ // N/A, handled in above condition.
+ break;
- case ACTION_MOVING_POINT: {
+ case ACTION_MOVING_POINT: {
- undo_redo->create_action(TTR("Move Point in Curve"));
- undo_redo->add_do_method(curve.ptr(), "set_point_pos", action_point, cpoint);
- undo_redo->add_undo_method(curve.ptr(), "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();
+ undo_redo->create_action(TTR("Move Point in Curve"));
+ undo_redo->add_do_method(curve.ptr(), "set_point_pos", action_point, cpoint);
+ undo_redo->add_undo_method(curve.ptr(), "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();
- } break;
- case ACTION_MOVING_IN: {
+ } break;
- undo_redo->create_action(TTR("Move In-Control in Curve"));
- undo_redo->add_do_method(curve.ptr(), "set_point_in", action_point, new_pos);
- undo_redo->add_undo_method(curve.ptr(), "set_point_in", 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();
+ case ACTION_MOVING_IN: {
- } break;
- case ACTION_MOVING_OUT: {
+ undo_redo->create_action(TTR("Move In-Control in Curve"));
+ undo_redo->add_do_method(curve.ptr(), "set_point_in", action_point, new_pos);
+ undo_redo->add_undo_method(curve.ptr(), "set_point_in", 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();
- undo_redo->create_action(TTR("Move Out-Control in Curve"));
- undo_redo->add_do_method(curve.ptr(), "set_point_out", action_point, new_pos);
- undo_redo->add_undo_method(curve.ptr(), "set_point_out", 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();
+ } break;
- } break;
- }
+ case ACTION_MOVING_OUT: {
- action = ACTION_NONE;
+ undo_redo->create_action(TTR("Move Out-Control in Curve"));
+ undo_redo->add_do_method(curve.ptr(), "set_point_out", action_point, new_pos);
+ undo_redo->add_undo_method(curve.ptr(), "set_point_out", 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();
- return true;
+ } break;
}
+ action = ACTION_NONE;
+
+ return true;
+ }
+
#if 0
- switch(mode) {
+ switch(mode) {
- case MODE_CREATE: {
+ case MODE_CREATE: {
- if (mb.button_index==BUTTON_LEFT && mb.pressed) {
+ if (mb->get_button_index()==BUTTON_LEFT && mb->is_pressed()) {
- if (!wip_active) {
+ if (!wip_active) {
- wip.clear();
- wip.push_back( canvas_item_editor->snap_point(cpoint) );
- wip_active=true;
- edited_point_pos=canvas_item_editor->snap_point(cpoint);
- canvas_item_editor->update();
- edited_point=1;
- return true;
- } else {
+ wip.clear();
+ wip.push_back( canvas_item_editor->snap_point(cpoint) );
+ wip_active=true;
+ edited_point_pos=canvas_item_editor->snap_point(cpoint);
+ canvas_item_editor->update();
+ edited_point=1;
+ return true;
+ } else {
+ if (wip.size()>1 && xform.xform(wip[0]).distance_to(gpoint)<grab_threshold) {
+ //wip closed
+ _wip_close();
- if (wip.size()>1 && xform.xform(wip[0]).distance_to(gpoint)<grab_treshold) {
- //wip closed
- _wip_close();
- return true;
- } else {
+ return true;
+ } else {
- wip.push_back( canvas_item_editor->snap_point(cpoint) );
- edited_point=wip.size();
- canvas_item_editor->update();
- return true;
+ wip.push_back( canvas_item_editor->snap_point(cpoint) );
+ edited_point=wip.size();
+ canvas_item_editor->update();
+ return true;
- //add wip point
- }
+ //add wip point
}
- } else if (mb.button_index==BUTTON_RIGHT && mb.pressed && wip_active) {
- _wip_close();
}
+ } else if (mb->get_button_index()==BUTTON_RIGHT && mb->is_pressed() && wip_active) {
+ _wip_close();
+ }
+ } break;
+ case MODE_EDIT: {
- } break;
-
- case MODE_EDIT: {
-
- if (mb.button_index==BUTTON_LEFT) {
- if (mb.pressed) {
-
- if (mb.mod.control) {
+ if (mb->get_button_index()==BUTTON_LEFT) {
+ if (mb->is_pressed()) {
+ if (mb->get_control()) {
- if (poly.size() < 3) {
- undo_redo->create_action(TTR("Edit Poly"));
- undo_redo->add_undo_method(node,"set_polygon",poly);
- poly.push_back(cpoint);
- undo_redo->add_do_method(node,"set_polygon",poly);
- 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 (poly.size() < 3) {
- //search edges
- int closest_idx=-1;
- Vector2 closest_pos;
- real_t closest_dist=1e10;
- for(int i=0;i<poly.size();i++) {
-
- Vector2 points[2] ={ xform.xform(poly[i]),
- xform.xform(poly[(i+1)%poly.size()]) };
+ undo_redo->create_action(TTR("Edit Poly"));
+ undo_redo->add_undo_method(node,"set_polygon",poly);
+ poly.push_back(cpoint);
+ undo_redo->add_do_method(node,"set_polygon",poly);
+ 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;
+ }
- Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint,points);
- if (cp.distance_squared_to(points[0])<CMP_EPSILON2 || cp.distance_squared_to(points[1])<CMP_EPSILON2)
- continue; //not valid to reuse point
+ //search edges
+ int closest_idx=-1;
+ Vector2 closest_pos;
+ real_t closest_dist=1e10;
+ for(int i=0;i<poly.size();i++) {
- real_t d = cp.distance_to(gpoint);
- if (d<closest_dist && d<grab_treshold) {
+ if (d<closest_dist && d<grab_threshold) {
closest_dist=d;
closest_pos=cp;
closest_idx=i;
}
+ Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint,points);
+ if (cp.distance_squared_to(points[0])<CMP_EPSILON2 || cp.distance_squared_to(points[1])<CMP_EPSILON2)
+ continue; //not valid to reuse point
+ real_t d = cp.distance_to(gpoint);
+ if (d<closest_dist && d<grab_threshold) {
+ closest_dist=d;
+ closest_pos=cp;
+ closest_idx=i;
}
- if (closest_idx>=0) {
-
- pre_move_edit=poly;
- poly.insert(closest_idx+1,canvas_item_editor->snap_point(xform.affine_inverse().xform(closest_pos)));
- edited_point=closest_idx+1;
- edited_point_pos=canvas_item_editor->snap_point(xform.affine_inverse().xform(closest_pos));
- node->set_polygon(poly);
- canvas_item_editor->update();
- return true;
- }
- } else {
- //look for points to move
+ }
- int closest_idx=-1;
- Vector2 closest_pos;
- real_t closest_dist=1e10;
- for(int i=0;i<poly.size();i++) {
+ if (closest_idx>=0) {
- Vector2 cp =xform.xform(poly[i]);
+ pre_move_edit=poly;
+ poly.insert(closest_idx+1,canvas_item_editor->snap_point(xform.affine_inverse().xform(closest_pos)));
+ edited_point=closest_idx+1;
+ edited_point_pos=canvas_item_editor->snap_point(xform.affine_inverse().xform(closest_pos));
+ node->set_polygon(poly);
+ canvas_item_editor->update();
+ return true;
+ }
+ } else {
real_t d = cp.distance_to(gpoint);
- if (d<closest_dist && d<grab_treshold) {
+ if (d<closest_dist && d<grab_threshold) {
closest_dist=d;
closest_pos=cp;
closest_idx=i;
}
- }
+ int closest_idx=-1;
+ Vector2 closest_pos;
+ real_t closest_dist=1e10;
+ for(int i=0;i<poly.size();i++) {
- if (closest_idx>=0) {
+ Vector2 cp =xform.xform(poly[i]);
- pre_move_edit=poly;
- edited_point=closest_idx;
- edited_point_pos=xform.affine_inverse().xform(closest_pos);
- canvas_item_editor->update();
- return true;
+ real_t d = cp.distance_to(gpoint);
+ if (d<closest_dist && d<grab_threshold) {
+ closest_dist=d;
+ closest_pos=cp;
+ closest_idx=i;
}
- }
- } else {
- if (edited_point!=-1) {
+ }
- //apply
+ if (closest_idx>=0) {
- ERR_FAIL_INDEX_V(edited_point,poly.size(),false);
- poly[edited_point]=edited_point_pos;
- undo_redo->create_action(TTR("Edit Poly"));
- undo_redo->add_do_method(node,"set_polygon",poly);
- undo_redo->add_undo_method(node,"set_polygon",pre_move_edit);
- 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();
-
- edited_point=-1;
+ pre_move_edit=poly;
+ edited_point=closest_idx;
+ edited_point_pos=xform.affine_inverse().xform(closest_pos);
+ canvas_item_editor->update();
return true;
}
}
- } if (mb.button_index==BUTTON_RIGHT && mb.pressed && edited_point==-1) {
+ } else {
+ if (edited_point!=-1) {
+ //apply
- int closest_idx=-1;
- Vector2 closest_pos;
- real_t closest_dist=1e10;
- for(int i=0;i<poly.size();i++) {
+ ERR_FAIL_INDEX_V(edited_point,poly.size(),false);
+ poly[edited_point]=edited_point_pos;
+ undo_redo->create_action(TTR("Edit Poly"));
+ undo_redo->add_do_method(node,"set_polygon",poly);
+ undo_redo->add_undo_method(node,"set_polygon",pre_move_edit);
+ 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();
- Vector2 cp =xform.xform(poly[i]);
+ edited_point=-1;
+ return true;
+ }
+ }
+ } if (mb->get_button_index()==BUTTON_RIGHT && mb->is_pressed() && edited_point==-1) {
real_t d = cp.distance_to(gpoint);
- if (d<closest_dist && d<grab_treshold) {
+ if (d<closest_dist && d<grab_threshold) {
closest_dist=d;
closest_pos=cp;
closest_idx=i;
}
- }
-
- if (closest_idx>=0) {
+ int closest_idx=-1;
+ Vector2 closest_pos;
+ real_t closest_dist=1e10;
+ for(int i=0;i<poly.size();i++) {
+ Vector2 cp =xform.xform(poly[i]);
- undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
- undo_redo->add_undo_method(node,"set_polygon",poly);
- poly.remove(closest_idx);
- undo_redo->add_do_method(node,"set_polygon",poly);
- 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;
+ real_t d = cp.distance_to(gpoint);
+ if (d<closest_dist && d<grab_threshold) {
+ closest_dist=d;
+ closest_pos=cp;
+ closest_idx=i;
}
}
+ if (closest_idx>=0) {
- } break;
- }
-
-#endif
- } break;
- case InputEvent::MOUSE_MOTION: {
-
- const InputEventMouseMotion &mm = p_event.mouse_motion;
+ undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
+ undo_redo->add_undo_method(node,"set_polygon",poly);
+ poly.remove(closest_idx);
+ undo_redo->add_do_method(node,"set_polygon",poly);
+ 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 (action != ACTION_NONE) {
+ }
- Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Vector2 gpoint = Point2(mm.x, mm.y);
- Vector2 cpoint = !mm.mod.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)));
+ } break;
+ }
+#endif
+ }
- Ref<Curve2D> curve = node->get_curve();
+ Ref<InputEventMouseMotion> mm = p_event;
- Vector2 new_pos = moving_from + xform.affine_inverse().basis_xform(gpoint - moving_screen_from);
+ if (mm.is_valid()) {
- switch (action) {
+ if (action != ACTION_NONE) {
+ // Handle point/control movement.
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Vector2 gpoint = mm->get_position();
+ Vector2 cpoint =
+ !mm->get_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)));
- case ACTION_MOVING_POINT: {
+ Ref<Curve2D> curve = node->get_curve();
- curve->set_point_pos(action_point, cpoint);
- } break;
- case ACTION_MOVING_IN: {
+ Vector2 new_pos = moving_from + xform.affine_inverse().basis_xform(gpoint - moving_screen_from);
- curve->set_point_in(action_point, new_pos);
+ switch (action) {
- } break;
- case ACTION_MOVING_OUT: {
+ case ACTION_NONE:
+ // N/A, handled in above condition.
+ break;
- curve->set_point_out(action_point, new_pos);
+ case ACTION_MOVING_POINT: {
+ curve->set_point_pos(action_point, cpoint);
+ } break;
- } break;
- }
+ case ACTION_MOVING_IN: {
+ curve->set_point_in(action_point, new_pos);
+ } break;
- canvas_item_editor->get_viewport_control()->update();
- return true;
+ case ACTION_MOVING_OUT: {
+ curve->set_point_out(action_point, new_pos);
+ } break;
}
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
+ }
+
#if 0
- if (edited_point!=-1 && (wip_active || mm.button_mask&BUTTON_MASK_LEFT)) {
+ if (edited_point!=-1 && (wip_active || mm->get_button_mask()&BUTTON_MASK_LEFT)) {
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Vector2 gpoint = Point2(mm.x,mm.y);
- edited_point_pos = canvas_item_editor->snap_point(xform.affine_inverse().xform(gpoint));
- canvas_item_editor->update();
+ Vector2 gpoint = Point2(mm.x,mm.y);
+ edited_point_pos = canvas_item_editor->snap_point(xform.affine_inverse().xform(gpoint));
+ canvas_item_editor->update();
- }
+ }
#endif
- } break;
}
return false;
diff --git a/editor/plugins/path_2d_editor_plugin.h b/editor/plugins/path_2d_editor_plugin.h
index 32dd6868bb..61ff700118 100644
--- a/editor/plugins/path_2d_editor_plugin.h
+++ b/editor/plugins/path_2d_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -94,7 +95,7 @@ protected:
static void _bind_methods();
public:
- bool forward_gui_input(const InputEvent &p_event);
+ bool forward_gui_input(const Ref<InputEvent> &p_event);
void edit(Node *p_path2d);
Path2DEditor(EditorNode *p_editor);
};
@@ -107,12 +108,12 @@ class Path2DEditorPlugin : public EditorPlugin {
EditorNode *editor;
public:
- virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event) { return path2d_editor->forward_gui_input(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event) { return path2d_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "Path2D"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
Path2DEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp
index 0b3587bc5e..c32ed1064f 100644
--- a/editor/plugins/path_editor_plugin.cpp
+++ b/editor/plugins/path_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,61 +33,57 @@
#include "scene/resources/curve.h"
#include "spatial_editor_plugin.h"
-#if 0
String PathSpatialGizmo::get_handle_name(int p_idx) const {
Ref<Curve3D> c = path->get_curve();
if (c.is_null())
return "";
- if (p_idx<c->get_point_count()) {
+ if (p_idx < c->get_point_count()) {
- return TTR("Curve Point #")+itos(p_idx);
+ return TTR("Curve Point #") + itos(p_idx);
}
- p_idx=p_idx-c->get_point_count()+1;
+ p_idx = p_idx - c->get_point_count() + 1;
- int idx=p_idx/2;
- int t=p_idx%2;
- String n = TTR("Curve Point #")+itos(idx);
- if (t==0)
- n+=" In";
+ int idx = p_idx / 2;
+ int t = p_idx % 2;
+ String n = TTR("Curve Point #") + itos(idx);
+ if (t == 0)
+ n += " In";
else
- n+=" Out";
+ n += " Out";
return n;
-
-
}
-Variant PathSpatialGizmo::get_handle_value(int p_idx) const{
+Variant PathSpatialGizmo::get_handle_value(int p_idx) const {
Ref<Curve3D> c = path->get_curve();
if (c.is_null())
return Variant();
- if (p_idx<c->get_point_count()) {
+ if (p_idx < c->get_point_count()) {
- original=c->get_point_pos(p_idx);
+ original = c->get_point_pos(p_idx);
return original;
}
- p_idx=p_idx-c->get_point_count()+1;
+ p_idx = p_idx - c->get_point_count() + 1;
- int idx=p_idx/2;
- int t=p_idx%2;
+ int idx = p_idx / 2;
+ int t = p_idx % 2;
Vector3 ofs;
- if (t==0)
- ofs=c->get_point_in(idx);
+ if (t == 0)
+ ofs = c->get_point_in(idx);
else
- ofs= c->get_point_out(idx);
+ ofs = c->get_point_out(idx);
- original=ofs+c->get_point_pos(idx);
+ original = ofs + c->get_point_pos(idx);
return ofs;
-
}
-void PathSpatialGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_point){
+void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_point) {
Ref<Curve3D> c = path->get_curve();
if (c.is_null())
@@ -97,51 +94,49 @@ void PathSpatialGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_po
Vector3 ray_from = p_camera->project_ray_origin(p_point);
Vector3 ray_dir = p_camera->project_ray_normal(p_point);
- if (p_idx<c->get_point_count()) {
+ if (p_idx < c->get_point_count()) {
- Plane p(gt.xform(original),p_camera->get_transform().basis.get_axis(2));
+ Plane p(gt.xform(original), p_camera->get_transform().basis.get_axis(2));
Vector3 inters;
- if (p.intersects_ray(ray_from,ray_dir,&inters)) {
+ if (p.intersects_ray(ray_from, ray_dir, &inters)) {
- if(SpatialEditor::get_singleton()->is_snap_enabled())
- {
+ if (SpatialEditor::get_singleton()->is_snap_enabled()) {
float snap = SpatialEditor::get_singleton()->get_translate_snap();
- inters.snap(snap);
+ inters.snap(Vector3(snap, snap, snap));
}
-
+
Vector3 local = gi.xform(inters);
- c->set_point_pos(p_idx,local);
+ c->set_point_pos(p_idx, local);
}
return;
}
- p_idx=p_idx-c->get_point_count()+1;
+ p_idx = p_idx - c->get_point_count() + 1;
- int idx=p_idx/2;
- int t=p_idx%2;
+ int idx = p_idx / 2;
+ int t = p_idx % 2;
Vector3 base = c->get_point_pos(idx);
- Plane p(gt.xform(original),p_camera->get_transform().basis.get_axis(2));
+ Plane p(gt.xform(original), p_camera->get_transform().basis.get_axis(2));
Vector3 inters;
- if (p.intersects_ray(ray_from,ray_dir,&inters)) {
+ if (p.intersects_ray(ray_from, ray_dir, &inters)) {
- Vector3 local = gi.xform(inters)-base;
- if (t==0) {
- c->set_point_in(idx,local);
+ Vector3 local = gi.xform(inters) - base;
+ if (t == 0) {
+ c->set_point_in(idx, local);
} else {
- c->set_point_out(idx,local);
+ c->set_point_out(idx, local);
}
}
-
}
-void PathSpatialGizmo::commit_handle(int p_idx,const Variant& p_restore,bool p_cancel){
+void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) {
Ref<Curve3D> c = path->get_curve();
if (c.is_null())
@@ -149,67 +144,59 @@ void PathSpatialGizmo::commit_handle(int p_idx,const Variant& p_restore,bool p_c
UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
- if (p_idx<c->get_point_count()) {
+ if (p_idx < c->get_point_count()) {
if (p_cancel) {
- c->set_point_pos(p_idx,p_restore);
+ c->set_point_pos(p_idx, p_restore);
return;
}
ur->create_action(TTR("Set Curve Point Pos"));
- ur->add_do_method(c.ptr(),"set_point_pos",p_idx,c->get_point_pos(p_idx));
- ur->add_undo_method(c.ptr(),"set_point_pos",p_idx,p_restore);
+ ur->add_do_method(c.ptr(), "set_point_pos", p_idx, c->get_point_pos(p_idx));
+ ur->add_undo_method(c.ptr(), "set_point_pos", p_idx, p_restore);
ur->commit_action();
return;
}
- p_idx=p_idx-c->get_point_count()+1;
+ p_idx = p_idx - c->get_point_count() + 1;
- int idx=p_idx/2;
- int t=p_idx%2;
+ int idx = p_idx / 2;
+ int t = p_idx % 2;
Vector3 ofs;
if (p_cancel) {
-
-
return;
}
-
-
- if (t==0) {
+ if (t == 0) {
if (p_cancel) {
- c->set_point_in(p_idx,p_restore);
+ c->set_point_in(p_idx, p_restore);
return;
}
ur->create_action(TTR("Set Curve In Pos"));
- ur->add_do_method(c.ptr(),"set_point_in",idx,c->get_point_in(idx));
- ur->add_undo_method(c.ptr(),"set_point_in",idx,p_restore);
+ ur->add_do_method(c.ptr(), "set_point_in", idx, c->get_point_in(idx));
+ ur->add_undo_method(c.ptr(), "set_point_in", idx, p_restore);
ur->commit_action();
-
} else {
if (p_cancel) {
- c->set_point_out(idx,p_restore);
+ c->set_point_out(idx, p_restore);
return;
}
ur->create_action(TTR("Set Curve Out Pos"));
- ur->add_do_method(c.ptr(),"set_point_out",idx,c->get_point_out(idx));
- ur->add_undo_method(c.ptr(),"set_point_out",idx,p_restore);
+ ur->add_do_method(c.ptr(), "set_point_out", idx, c->get_point_out(idx));
+ ur->add_undo_method(c.ptr(), "set_point_out", idx, p_restore);
ur->commit_action();
-
}
-
}
-
-void PathSpatialGizmo::redraw(){
+void PathSpatialGizmo::redraw() {
clear();
@@ -217,80 +204,76 @@ void PathSpatialGizmo::redraw(){
if (c.is_null())
return;
- Vector3Array v3a=c->tesselate();
- //Vector3Array v3a=c->get_baked_points();
+ PoolVector<Vector3> v3a = c->tessellate();
+ //PoolVector<Vector3> v3a=c->get_baked_points();
int v3s = v3a.size();
- if (v3s==0)
+ if (v3s == 0)
return;
Vector<Vector3> v3p;
- Vector3Array::Read r = v3a.read();
+ PoolVector<Vector3>::Read r = v3a.read();
- for(int i=0;i<v3s-1;i++) {
+ // BUG: the following won't work when v3s, avoid drawing as a temporary workaround.
+ for (int i = 0; i < v3s - 1; i++) {
v3p.push_back(r[i]);
- v3p.push_back(r[i+1]);
+ v3p.push_back(r[i + 1]);
//v3p.push_back(r[i]);
//v3p.push_back(r[i]+Vector3(0,0.2,0));
}
- add_lines(v3p,PathEditorPlugin::singleton->path_material);
+ add_lines(v3p, PathEditorPlugin::singleton->path_material);
add_collision_segments(v3p);
- if (PathEditorPlugin::singleton->get_edited_path()==path) {
+ if (PathEditorPlugin::singleton->get_edited_path() == path) {
v3p.clear();
Vector<Vector3> handles;
Vector<Vector3> sec_handles;
- for(int i=0;i<c->get_point_count();i++) {
+ for (int i = 0; i < c->get_point_count(); i++) {
Vector3 p = c->get_point_pos(i);
handles.push_back(p);
- if (i>0) {
+ if (i > 0) {
v3p.push_back(p);
- v3p.push_back(p+c->get_point_in(i));
- sec_handles.push_back(p+c->get_point_in(i));
+ v3p.push_back(p + c->get_point_in(i));
+ sec_handles.push_back(p + c->get_point_in(i));
}
- if (i<c->get_point_count()-1) {
+ if (i < c->get_point_count() - 1) {
v3p.push_back(p);
- v3p.push_back(p+c->get_point_out(i));
- sec_handles.push_back(p+c->get_point_out(i));
+ v3p.push_back(p + c->get_point_out(i));
+ sec_handles.push_back(p + c->get_point_out(i));
}
}
- add_lines(v3p,PathEditorPlugin::singleton->path_thin_material);
+ add_lines(v3p, PathEditorPlugin::singleton->path_thin_material);
add_handles(handles);
- add_handles(sec_handles,false,true);
+ add_handles(sec_handles, false, true);
}
-
}
-PathSpatialGizmo::PathSpatialGizmo(Path* p_path){
+PathSpatialGizmo::PathSpatialGizmo(Path *p_path) {
- path=p_path;
+ path = p_path;
set_spatial_node(p_path);
-
-
-
}
-Ref<SpatialEditorGizmo> PathEditorPlugin::create_spatial_gizmo(Spatial* p_spatial) {
-
+Ref<SpatialEditorGizmo> PathEditorPlugin::create_spatial_gizmo(Spatial *p_spatial) {
if (p_spatial->cast_to<Path>()) {
- return memnew( PathSpatialGizmo(p_spatial->cast_to<Path>()));
+ return memnew(PathSpatialGizmo(p_spatial->cast_to<Path>()));
}
return Ref<SpatialEditorGizmo>();
}
-bool PathEditorPlugin::forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) {
+bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) {
if (!path)
return false;
- Ref<Curve3D> c=path->get_curve();
+ Ref<Curve3D> c = path->get_curve();
if (c.is_null())
return false;
Transform gt = path->get_global_transform();
@@ -298,105 +281,99 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera* p_camera,const InputEve
static const int click_dist = 10; //should make global
+ Ref<InputEventMouseButton> mb = p_event;
- if (p_event.type==InputEvent::MOUSE_BUTTON) {
+ if (mb.is_valid()) {
- const InputEventMouseButton &mb=p_event.mouse_button;
- Point2 mbpos(mb.x,mb.y);
+ Point2 mbpos(mb->get_position().x, mb->get_position().y);
- if (mb.pressed && mb.button_index==BUTTON_LEFT && (curve_create->is_pressed() || (curve_edit->is_pressed() && mb.mod.control))) {
+ if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && (curve_create->is_pressed() || (curve_edit->is_pressed() && mb->get_control()))) {
//click into curve, break it down
- Vector3Array v3a = c->tesselate();
- int idx=0;
- int rc=v3a.size();
- int closest_seg=-1;
+ PoolVector<Vector3> v3a = c->tessellate();
+ int idx = 0;
+ int rc = v3a.size();
+ int closest_seg = -1;
Vector3 closest_seg_point;
- float closest_d=1e20;
+ float closest_d = 1e20;
- if (rc>=2) {
- Vector3Array::Read r = v3a.read();
+ if (rc >= 2) {
+ PoolVector<Vector3>::Read r = v3a.read();
- if (p_camera->unproject_position(gt.xform(c->get_point_pos(0))).distance_to(mbpos)<click_dist)
+ if (p_camera->unproject_position(gt.xform(c->get_point_pos(0))).distance_to(mbpos) < click_dist)
return false; //nope, existing
-
- for(int i=0;i<c->get_point_count()-1;i++) {
+ for (int i = 0; i < c->get_point_count() - 1; i++) {
//find the offset and point index of the place to break up
- int j=idx;
- if (p_camera->unproject_position(gt.xform(c->get_point_pos(i+1))).distance_to(mbpos)<click_dist)
+ int j = idx;
+ if (p_camera->unproject_position(gt.xform(c->get_point_pos(i + 1))).distance_to(mbpos) < click_dist)
return false; //nope, existing
+ while (j < rc && c->get_point_pos(i + 1) != r[j]) {
- while(j<rc && c->get_point_pos(i+1)!=r[j]) {
-
- Vector3 from =r[j];
- Vector3 to =r[j+1];
+ Vector3 from = r[j];
+ Vector3 to = r[j + 1];
real_t cdist = from.distance_to(to);
- from=gt.xform(from);
- to=gt.xform(to);
- if (cdist>0) {
+ from = gt.xform(from);
+ to = gt.xform(to);
+ if (cdist > 0) {
Vector2 s[2];
s[0] = p_camera->unproject_position(from);
s[1] = p_camera->unproject_position(to);
- Vector2 inters = Geometry::get_closest_point_to_segment_2d(mbpos,s);
+ Vector2 inters = Geometry::get_closest_point_to_segment_2d(mbpos, s);
float d = inters.distance_to(mbpos);
- if (d<10 && d<closest_d) {
+ if (d < 10 && d < closest_d) {
+ closest_d = d;
+ closest_seg = i;
+ Vector3 ray_from = p_camera->project_ray_origin(mbpos);
+ Vector3 ray_dir = p_camera->project_ray_normal(mbpos);
- closest_d=d;
- closest_seg=i;
- Vector3 ray_from=p_camera->project_ray_origin(mbpos);
- Vector3 ray_dir=p_camera->project_ray_normal(mbpos);
+ Vector3 ra, rb;
+ Geometry::get_closest_points_between_segments(ray_from, ray_from + ray_dir * 4096, from, to, ra, rb);
- Vector3 ra,rb;
- Geometry::get_closest_points_between_segments(ray_from,ray_from+ray_dir*4096,from,to,ra,rb);
-
- closest_seg_point=it.xform(rb);
+ closest_seg_point = it.xform(rb);
}
-
}
j++;
-
}
- if (idx==j)
+ if (idx == j)
idx++; //force next
else
- idx=j; //swap
+ idx = j; //swap
-
- if (j==rc)
+ if (j == rc)
break;
}
}
UndoRedo *ur = editor->get_undo_redo();
- if (closest_seg!=-1) {
+ if (closest_seg != -1) {
//subdivide
ur->create_action(TTR("Split Path"));
- ur->add_do_method(c.ptr(),"add_point",closest_seg_point,Vector3(),Vector3(),closest_seg+1);
- ur->add_undo_method(c.ptr(),"remove_point",closest_seg+1);
+ ur->add_do_method(c.ptr(), "add_point", closest_seg_point, Vector3(), Vector3(), closest_seg + 1);
+ ur->add_undo_method(c.ptr(), "remove_point", closest_seg + 1);
ur->commit_action();
return true;
} else {
Vector3 org;
- if (c->get_point_count()==0)
- org=path->get_transform().get_origin();
+ if (c->get_point_count() == 0)
+ org = path->get_transform().get_origin();
else
- org=gt.xform(c->get_point_pos(c->get_point_count()));
- Plane p(org,p_camera->get_transform().basis.get_axis(2));
- Vector3 ray_from=p_camera->project_ray_origin(mbpos);
- Vector3 ray_dir=p_camera->project_ray_normal(mbpos);
+ org = gt.xform(c->get_point_pos(c->get_point_count() - 1));
+ Plane p(org, p_camera->get_transform().basis.get_axis(2));
+ Vector3 ray_from = p_camera->project_ray_origin(mbpos);
+ Vector3 ray_dir = p_camera->project_ray_normal(mbpos);
Vector3 inters;
- if (p.intersects_ray(ray_from,ray_dir,&inters)) {
+ if (p.intersects_ray(ray_from, ray_dir, &inters)) {
ur->create_action(TTR("Add Point to Curve"));
- ur->add_do_method(c.ptr(),"add_point",it.xform(inters),Vector3(),Vector3(),-1);
- ur->add_undo_method(c.ptr(),"remove_point",c->get_point_count());
+ ur->add_do_method(c.ptr(), "add_point", it.xform(inters), Vector3(), Vector3(), -1);
+ ur->add_undo_method(c.ptr(), "remove_point", c->get_point_count());
ur->commit_action();
return true;
}
@@ -404,39 +381,51 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera* p_camera,const InputEve
//add new at pos
}
- } else if (mb.pressed && ((mb.button_index==BUTTON_LEFT && curve_del->is_pressed()) || (mb.button_index==BUTTON_RIGHT && curve_edit->is_pressed()))) {
+ } else if (mb->is_pressed() && ((mb->get_button_index() == BUTTON_LEFT && curve_del->is_pressed()) || (mb->get_button_index() == BUTTON_RIGHT && curve_edit->is_pressed()))) {
- int erase_idx=-1;
- for(int i=0;i<c->get_point_count();i++) {
- //find the offset and point index of the place to break up
- if (p_camera->unproject_position(gt.xform(c->get_point_pos(i))).distance_to(mbpos)<click_dist) {
+ for (int i = 0; i < c->get_point_count(); i++) {
+ real_t dist_to_p = p_camera->unproject_position(gt.xform(c->get_point_pos(i))).distance_to(mbpos);
+ real_t dist_to_p_out = p_camera->unproject_position(gt.xform(c->get_point_pos(i) + c->get_point_out(i))).distance_to(mbpos);
+ real_t dist_to_p_in = p_camera->unproject_position(gt.xform(c->get_point_pos(i) + c->get_point_in(i))).distance_to(mbpos);
- erase_idx=i;
- break;
- }
- }
+ // Find the offset and point index of the place to break up.
+ // Also check for the control points.
+ if (dist_to_p < click_dist) {
- if (erase_idx!=-1) {
+ UndoRedo *ur = editor->get_undo_redo();
+ ur->create_action(TTR("Remove Path Point"));
+ ur->add_do_method(c.ptr(), "remove_point", i);
+ ur->add_undo_method(c.ptr(), "add_point", c->get_point_pos(i), c->get_point_in(i), c->get_point_out(i), i);
+ ur->commit_action();
+ return true;
+ } else if (dist_to_p_out < click_dist) {
- UndoRedo *ur = editor->get_undo_redo();
- ur->create_action(TTR("Remove Path Point"));
- ur->add_do_method(c.ptr(),"remove_point",erase_idx);
- ur->add_undo_method(c.ptr(),"add_point",c->get_point_pos(erase_idx),c->get_point_in(erase_idx),c->get_point_out(erase_idx),erase_idx);
- ur->commit_action();
- return true;
+ UndoRedo *ur = editor->get_undo_redo();
+ ur->create_action(TTR("Remove Out-Control Point"));
+ ur->add_do_method(c.ptr(), "set_point_out", i, Vector3());
+ ur->add_undo_method(c.ptr(), "set_point_out", i, c->get_point_out(i));
+ ur->commit_action();
+ return true;
+ } else if (dist_to_p_in < click_dist) {
+
+ UndoRedo *ur = editor->get_undo_redo();
+ ur->create_action(TTR("Remove In-Control Point"));
+ ur->add_do_method(c.ptr(), "set_point_in", i, Vector3());
+ ur->add_undo_method(c.ptr(), "set_point_in", i, c->get_point_in(i));
+ ur->commit_action();
+ return true;
+ }
}
}
-
}
return false;
}
-
void PathEditorPlugin::edit(Object *p_object) {
if (p_object) {
- path=p_object->cast_to<Path>();
+ path = p_object->cast_to<Path>();
if (path) {
if (path->get_curve().is_valid()) {
@@ -444,8 +433,8 @@ void PathEditorPlugin::edit(Object *p_object) {
}
}
} else {
- Path *pre=path;
- path=NULL;
+ Path *pre = path;
+ path = NULL;
if (pre) {
pre->get_curve()->emit_signal("changed");
}
@@ -455,7 +444,7 @@ void PathEditorPlugin::edit(Object *p_object) {
bool PathEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("Path");
+ return p_object->is_class("Path");
}
void PathEditorPlugin::make_visible(bool p_visible) {
@@ -465,120 +454,115 @@ void PathEditorPlugin::make_visible(bool p_visible) {
curve_create->show();
curve_edit->show();
curve_del->show();
- curve_close->show();
- sep->show();
+ curve_close->show();
+ sep->show();
} else {
curve_create->hide();
curve_edit->hide();
curve_del->hide();
- curve_close->hide();
- sep->hide();
+ curve_close->hide();
+ sep->hide();
{
- Path *pre=path;
- path=NULL;
+ Path *pre = path;
+ path = NULL;
if (pre && pre->get_curve().is_valid()) {
pre->get_curve()->emit_signal("changed");
}
}
}
-
}
void PathEditorPlugin::_mode_changed(int p_idx) {
- curve_create->set_pressed(p_idx==0);
- curve_edit->set_pressed(p_idx==1);
- curve_del->set_pressed(p_idx==2);
+ curve_create->set_pressed(p_idx == 0);
+ curve_edit->set_pressed(p_idx == 1);
+ curve_del->set_pressed(p_idx == 2);
}
void PathEditorPlugin::_close_curve() {
- Ref<Curve3D> c = path->get_curve();
- if (c.is_null())
- return ;
- if (c->get_point_count()<2)
- return;
- c->add_point(c->get_point_pos(0),c->get_point_in(0),c->get_point_out(0));
-
+ Ref<Curve3D> c = path->get_curve();
+ if (c.is_null())
+ return;
+ if (c->get_point_count() < 2)
+ return;
+ c->add_point(c->get_point_pos(0), c->get_point_in(0), c->get_point_out(0));
}
void PathEditorPlugin::_notification(int p_what) {
- if (p_what==NOTIFICATION_ENTER_TREE) {
+ if (p_what == NOTIFICATION_ENTER_TREE) {
- curve_create->connect("pressed",this,"_mode_changed",make_binds(0));
- curve_edit->connect("pressed",this,"_mode_changed",make_binds(1));
- curve_del->connect("pressed",this,"_mode_changed",make_binds(2));
- curve_close->connect("pressed",this,"_close_curve");
- }
+ curve_create->connect("pressed", this, "_mode_changed", make_binds(0));
+ curve_edit->connect("pressed", this, "_mode_changed", make_binds(1));
+ curve_del->connect("pressed", this, "_mode_changed", make_binds(2));
+ curve_close->connect("pressed", this, "_close_curve");
+ }
}
void PathEditorPlugin::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_mode_changed"),&PathEditorPlugin::_mode_changed);
- ClassDB::bind_method(D_METHOD("_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;
-
+PathEditorPlugin *PathEditorPlugin::singleton = NULL;
PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) {
- path=NULL;
- editor=p_node;
- singleton=this;
+ path = NULL;
+ editor = p_node;
+ singleton = this;
- path_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
- path_material->set_parameter( FixedSpatialMaterial::PARAM_DIFFUSE,Color(0.5,0.5,1.0,0.8) );
- path_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true);
+ path_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ path_material->set_albedo(Color(0.5, 0.5, 1.0, 0.8));
+ path_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
path_material->set_line_width(3);
- path_material->set_flag(Material::FLAG_DOUBLE_SIDED,true);
- path_material->set_flag(Material::FLAG_UNSHADED,true);
+ path_material->set_cull_mode(SpatialMaterial::CULL_DISABLED);
+ path_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
- path_thin_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
- path_thin_material->set_parameter( FixedSpatialMaterial::PARAM_DIFFUSE,Color(0.5,0.5,1.0,0.4) );
- path_thin_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true);
+ path_thin_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ path_thin_material->set_albedo(Color(0.5, 0.5, 1.0, 0.4));
+ path_thin_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
path_thin_material->set_line_width(1);
- path_thin_material->set_flag(Material::FLAG_DOUBLE_SIDED,true);
- path_thin_material->set_flag(Material::FLAG_UNSHADED,true);
+ path_thin_material->set_cull_mode(SpatialMaterial::CULL_DISABLED);
+ path_thin_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
//SpatialEditor::get_singleton()->add_gizmo_plugin(this);
- sep = memnew( VSeparator);
+ sep = memnew(VSeparator);
sep->hide();
SpatialEditor::get_singleton()->add_control_to_menu_panel(sep);
- curve_edit = memnew( ToolButton );
- curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveEdit","EditorIcons"));
+ curve_edit = memnew(ToolButton);
+ curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveEdit", "EditorIcons"));
curve_edit->set_toggle_mode(true);
curve_edit->hide();
curve_edit->set_focus_mode(Control::FOCUS_NONE);
- curve_edit->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"));
+ curve_edit->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"));
SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_edit);
- curve_create = memnew( ToolButton );
- curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCreate","EditorIcons"));
+ curve_create = memnew(ToolButton);
+ curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCreate", "EditorIcons"));
curve_create->set_toggle_mode(true);
curve_create->hide();
curve_create->set_focus_mode(Control::FOCUS_NONE);
- curve_create->set_tooltip(TTR("Add Point (in empty space)")+"\n"+TTR("Split Segment (in curve)"));
+ curve_create->set_tooltip(TTR("Add Point (in empty space)") + "\n" + TTR("Split Segment (in curve)"));
SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_create);
- curve_del = memnew( ToolButton );
- curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete","EditorIcons"));
+ curve_del = memnew(ToolButton);
+ curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete", "EditorIcons"));
curve_del->set_toggle_mode(true);
curve_del->hide();
curve_del->set_focus_mode(Control::FOCUS_NONE);
curve_del->set_tooltip(TTR("Delete Point"));
SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_del);
- curve_close = memnew( ToolButton );
- curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveClose","EditorIcons"));
+ curve_close = memnew(ToolButton);
+ curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveClose", "EditorIcons"));
curve_close->hide();
curve_close->set_focus_mode(Control::FOCUS_NONE);
curve_close->set_tooltip(TTR("Close Curve"));
SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_close);
-
-
curve_edit->set_pressed(true);
/*
collision_polygon_editor = memnew( PathEditor(p_node) );
@@ -592,13 +576,7 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) {
collision_polygon_editor->hide();
*/
-
-
}
-
-PathEditorPlugin::~PathEditorPlugin()
-{
+PathEditorPlugin::~PathEditorPlugin() {
}
-
-#endif
diff --git a/editor/plugins/path_editor_plugin.h b/editor/plugins/path_editor_plugin.h
index 9d0f6eb9f2..43df9d460f 100644
--- a/editor/plugins/path_editor_plugin.h
+++ b/editor/plugins/path_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,30 +32,27 @@
#include "editor/spatial_editor_gizmos.h"
#include "scene/3d/path.h"
-#if 0
-class PathSpatialGizmo : public EditorSpatialGizmo {
- GDCLASS(PathSpatialGizmo,EditorSpatialGizmo);
+class PathSpatialGizmo : public EditorSpatialGizmo {
- Path* path;
+ GDCLASS(PathSpatialGizmo, EditorSpatialGizmo);
+
+ Path *path;
mutable Vector3 original;
public:
-
virtual String get_handle_name(int p_idx) const;
virtual Variant get_handle_value(int p_idx) const;
- virtual void set_handle(int p_idx,Camera *p_camera, const Point2& p_point);
- virtual void commit_handle(int p_idx,const Variant& p_restore,bool p_cancel=false);
+ virtual void set_handle(int p_idx, Camera *p_camera, const Point2 &p_point);
+ virtual void commit_handle(int p_idx, const Variant &p_restore, bool p_cancel = false);
void redraw();
- PathSpatialGizmo(Path* p_path=NULL);
-
+ PathSpatialGizmo(Path *p_path = NULL);
};
class PathEditorPlugin : public EditorPlugin {
- GDCLASS( PathEditorPlugin, EditorPlugin );
-
+ GDCLASS(PathEditorPlugin, EditorPlugin);
Separator *sep;
ToolButton *curve_create;
@@ -64,36 +62,33 @@ class PathEditorPlugin : public EditorPlugin {
EditorNode *editor;
-
Path *path;
void _mode_changed(int p_idx);
- void _close_curve();
+ void _close_curve();
+
protected:
void _notification(int p_what);
static void _bind_methods();
public:
-
Path *get_edited_path() { return path; }
- static PathEditorPlugin* singleton;
- Ref<FixedSpatialMaterial> path_material;
- Ref<FixedSpatialMaterial> path_thin_material;
- virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event);
+ static PathEditorPlugin *singleton;
+ Ref<SpatialMaterial> path_material;
+ Ref<SpatialMaterial> path_thin_material;
+ virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event);
//virtual bool forward_gui_input(const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
- virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial* p_spatial);
+ virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial *p_spatial);
virtual String get_name() const { return "Path"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
PathEditorPlugin(EditorNode *p_node);
~PathEditorPlugin();
-
};
-#endif
#endif // PATH_EDITOR_PLUGIN_H
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index 8d208f9cee..24ccdcd445 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -200,213 +201,209 @@ void Polygon2DEditor::_wip_close() {
edited_point = -1;
}
-bool Polygon2DEditor::forward_gui_input(const InputEvent &p_event) {
+bool Polygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (node == NULL)
return false;
- switch (p_event.type) {
+ Ref<InputEventMouseButton> mb = p_event;
- case InputEvent::MOUSE_BUTTON: {
+ if (mb.is_valid()) {
- const InputEventMouseButton &mb = p_event.mouse_button;
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Vector2 gpoint = mb->get_position();
+ Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
+ cpoint = canvas_item_editor->snap_point(cpoint);
+ cpoint = node->get_global_transform().affine_inverse().xform(cpoint);
- Vector2 gpoint = Point2(mb.x, mb.y);
- Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
- cpoint = canvas_item_editor->snap_point(cpoint);
- cpoint = node->get_global_transform().affine_inverse().xform(cpoint);
+ Vector<Vector2> poly = Variant(node->get_polygon());
- Vector<Vector2> poly = Variant(node->get_polygon());
+ //first check if a point is to be added (segment split)
+ real_t grab_threshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
- //first check if a point is to be added (segment split)
- real_t grab_treshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
+ switch (mode) {
- switch (mode) {
+ case MODE_CREATE: {
- case MODE_CREATE: {
+ if (mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
- if (mb.button_index == BUTTON_LEFT && mb.pressed) {
+ if (!wip_active) {
- if (!wip_active) {
+ wip.clear();
+ wip.push_back(cpoint - node->get_offset());
+ wip_active = true;
+ edited_point_pos = cpoint;
+ canvas_item_editor->get_viewport_control()->update();
+ edited_point = 1;
+ return true;
+ } else {
+
+ if (wip.size() > 1 && xform.xform(wip[0] + node->get_offset()).distance_to(gpoint) < grab_threshold) {
+ //wip closed
+ _wip_close();
- wip.clear();
- wip.push_back(cpoint - node->get_offset());
- wip_active = true;
- edited_point_pos = cpoint;
- canvas_item_editor->get_viewport_control()->update();
- edited_point = 1;
return true;
} else {
- if (wip.size() > 1 && xform.xform(wip[0] + node->get_offset()).distance_to(gpoint) < grab_treshold) {
- //wip closed
- _wip_close();
-
- return true;
- } else {
-
- wip.push_back(cpoint - node->get_offset());
- edited_point = wip.size();
- canvas_item_editor->get_viewport_control()->update();
- return true;
+ wip.push_back(cpoint - node->get_offset());
+ edited_point = wip.size();
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
- //add wip point
- }
+ //add wip point
}
- } else if (mb.button_index == BUTTON_RIGHT && mb.pressed && wip_active) {
- _wip_close();
}
+ } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && wip_active) {
+ _wip_close();
+ }
- } break;
-
- case MODE_EDIT: {
-
- if (mb.button_index == BUTTON_LEFT) {
- if (mb.pressed) {
-
- if (mb.mod.control) {
+ } break;
- if (poly.size() < 3) {
+ case MODE_EDIT: {
- undo_redo->create_action(TTR("Edit Poly"));
- undo_redo->add_undo_method(node, "set_polygon", poly);
- poly.push_back(cpoint);
- undo_redo->add_do_method(node, "set_polygon", poly);
- 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->get_button_index() == BUTTON_LEFT) {
+ if (mb->is_pressed()) {
- //search edges
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
- for (int i = 0; i < poly.size(); i++) {
-
- Vector2 points[2] = { xform.xform(poly[i] + node->get_offset()),
- xform.xform(poly[(i + 1) % poly.size()] + node->get_offset()) };
-
- Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint, points);
- if (cp.distance_squared_to(points[0]) < CMP_EPSILON2 || cp.distance_squared_to(points[1]) < CMP_EPSILON2)
- continue; //not valid to reuse point
-
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_pos = cp;
- closest_idx = i;
- }
- }
+ if (mb->get_control()) {
- if (closest_idx >= 0) {
+ if (poly.size() < 3) {
- pre_move_edit = poly;
- poly.insert(closest_idx + 1, xform.affine_inverse().xform(closest_pos) - node->get_offset());
- edited_point = closest_idx + 1;
- edited_point_pos = xform.affine_inverse().xform(closest_pos);
- node->set_polygon(Variant(poly));
- canvas_item_editor->get_viewport_control()->update();
- return true;
- }
- } else {
+ undo_redo->create_action(TTR("Edit Poly"));
+ undo_redo->add_undo_method(node, "set_polygon", poly);
+ poly.push_back(cpoint);
+ undo_redo->add_do_method(node, "set_polygon", poly);
+ 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;
+ }
- //look for points to move
+ //search edges
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
- for (int i = 0; i < poly.size(); i++) {
+ Vector2 points[2] = { xform.xform(poly[i] + node->get_offset()),
+ xform.xform(poly[(i + 1) % poly.size()] + node->get_offset()) };
- Vector2 cp = xform.xform(poly[i] + node->get_offset());
+ Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint, points);
+ if (cp.distance_squared_to(points[0]) < CMP_EPSILON2 || cp.distance_squared_to(points[1]) < CMP_EPSILON2)
+ continue; //not valid to reuse point
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_pos = cp;
- closest_idx = i;
- }
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
}
+ }
- if (closest_idx >= 0) {
+ if (closest_idx >= 0) {
- pre_move_edit = poly;
- edited_point = closest_idx;
- edited_point_pos = xform.affine_inverse().xform(closest_pos);
- canvas_item_editor->get_viewport_control()->update();
- return true;
- }
+ pre_move_edit = poly;
+ poly.insert(closest_idx + 1, xform.affine_inverse().xform(closest_pos) - node->get_offset());
+ edited_point = closest_idx + 1;
+ edited_point_pos = xform.affine_inverse().xform(closest_pos);
+ node->set_polygon(Variant(poly));
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
}
} else {
- if (edited_point != -1) {
+ //look for points to move
- //apply
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
- ERR_FAIL_INDEX_V(edited_point, poly.size(), false);
- poly[edited_point] = edited_point_pos - node->get_offset();
- undo_redo->create_action(TTR("Edit Poly"));
- undo_redo->add_do_method(node, "set_polygon", poly);
- undo_redo->add_undo_method(node, "set_polygon", pre_move_edit);
- 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();
+ Vector2 cp = xform.xform(poly[i] + node->get_offset());
- edited_point = -1;
- return true;
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
+ }
}
- }
- } else if (mb.button_index == BUTTON_RIGHT && mb.pressed && edited_point == -1) {
- int closest_idx = -1;
- Vector2 closest_pos;
- real_t closest_dist = 1e10;
- for (int i = 0; i < poly.size(); i++) {
+ if (closest_idx >= 0) {
- Vector2 cp = xform.xform(poly[i] + node->get_offset());
-
- real_t d = cp.distance_to(gpoint);
- if (d < closest_dist && d < grab_treshold) {
- closest_dist = d;
- closest_pos = cp;
- closest_idx = i;
+ pre_move_edit = poly;
+ edited_point = closest_idx;
+ edited_point_pos = xform.affine_inverse().xform(closest_pos);
+ canvas_item_editor->get_viewport_control()->update();
+ return true;
}
}
+ } else {
+
+ if (edited_point != -1) {
- if (closest_idx >= 0) {
+ //apply
- undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
- undo_redo->add_undo_method(node, "set_polygon", poly);
- poly.remove(closest_idx);
+ ERR_FAIL_INDEX_V(edited_point, poly.size(), false);
+ poly[edited_point] = edited_point_pos - node->get_offset();
+ undo_redo->create_action(TTR("Edit Poly"));
undo_redo->add_do_method(node, "set_polygon", poly);
+ undo_redo->add_undo_method(node, "set_polygon", pre_move_edit);
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();
+
+ edited_point = -1;
return true;
}
}
+ } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && edited_point == -1) {
- } break;
- }
+ int closest_idx = -1;
+ Vector2 closest_pos;
+ real_t closest_dist = 1e10;
+ for (int i = 0; i < poly.size(); i++) {
- } break;
- case InputEvent::MOUSE_MOTION: {
+ Vector2 cp = xform.xform(poly[i] + node->get_offset());
- const InputEventMouseMotion &mm = p_event.mouse_motion;
+ real_t d = cp.distance_to(gpoint);
+ if (d < closest_dist && d < grab_threshold) {
+ closest_dist = d;
+ closest_pos = cp;
+ closest_idx = i;
+ }
+ }
- if (edited_point != -1 && (wip_active || mm.button_mask & BUTTON_MASK_LEFT)) {
+ if (closest_idx >= 0) {
- Vector2 gpoint = Point2(mm.x, mm.y);
- Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
- cpoint = canvas_item_editor->snap_point(cpoint);
- edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint);
+ undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
+ undo_redo->add_undo_method(node, "set_polygon", poly);
+ poly.remove(closest_idx);
+ undo_redo->add_do_method(node, "set_polygon", poly);
+ 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;
+ }
+ }
- canvas_item_editor->get_viewport_control()->update();
- }
+ } break;
+ }
+ }
- } break;
+ Ref<InputEventMouseMotion> mm = p_event;
+
+ if (mm.is_valid()) {
+
+ if (edited_point != -1 && (wip_active || mm->get_button_mask() & BUTTON_MASK_LEFT)) {
+
+ Vector2 gpoint = mm->get_position();
+ Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
+ cpoint = canvas_item_editor->snap_point(cpoint);
+ edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint);
+
+ canvas_item_editor->get_viewport_control()->update();
+ }
}
return false;
@@ -454,31 +451,31 @@ void Polygon2DEditor::_uv_mode(int p_mode) {
}
}
-void Polygon2DEditor::_uv_input(const InputEvent &p_input) {
+void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
Transform2D mtx;
mtx.elements[2] = -uv_draw_ofs;
mtx.scale_basis(Vector2(uv_draw_zoom, uv_draw_zoom));
- if (p_input.type == InputEvent::MOUSE_BUTTON) {
+ Ref<InputEventMouseButton> mb = p_input;
- const InputEventMouseButton &mb = p_input.mouse_button;
+ if (mb.is_valid()) {
- if (mb.button_index == BUTTON_LEFT) {
+ if (mb->get_button_index() == BUTTON_LEFT) {
- if (mb.pressed) {
+ if (mb->is_pressed()) {
- uv_drag_from = Vector2(mb.x, mb.y);
+ uv_drag_from = Vector2(mb->get_position().x, mb->get_position().y);
uv_drag = true;
uv_prev = node->get_uv();
uv_move_current = uv_mode;
if (uv_move_current == UV_MODE_EDIT_POINT) {
- if (mb.mod.shift && mb.mod.command)
+ if (mb->get_shift() && mb->get_command())
uv_move_current = UV_MODE_SCALE;
- else if (mb.mod.shift)
+ else if (mb->get_shift())
uv_move_current = UV_MODE_MOVE;
- else if (mb.mod.command)
+ else if (mb->get_command())
uv_move_current = UV_MODE_ROTATE;
}
@@ -488,7 +485,7 @@ void Polygon2DEditor::_uv_input(const InputEvent &p_input) {
for (int i = 0; i < uv_prev.size(); i++) {
Vector2 tuv = mtx.xform(uv_prev[i]);
- if (tuv.distance_to(Vector2(mb.x, mb.y)) < 8) {
+ if (tuv.distance_to(Vector2(mb->get_position().x, mb->get_position().y)) < 8) {
uv_drag_from = tuv;
uv_drag_index = i;
}
@@ -510,7 +507,7 @@ void Polygon2DEditor::_uv_input(const InputEvent &p_input) {
uv_drag = false;
}
- } else if (mb.button_index == BUTTON_RIGHT && mb.pressed) {
+ } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed()) {
if (uv_drag) {
@@ -519,27 +516,28 @@ void Polygon2DEditor::_uv_input(const InputEvent &p_input) {
uv_edit_draw->update();
}
- } else if (mb.button_index == BUTTON_WHEEL_UP && mb.pressed) {
+ } else if (mb->get_button_index() == BUTTON_WHEEL_UP && mb->is_pressed()) {
- uv_zoom->set_value(uv_zoom->get_value() / 0.9);
- } else if (mb.button_index == BUTTON_WHEEL_DOWN && mb.pressed) {
+ uv_zoom->set_value(uv_zoom->get_value() / (1 - (0.1 * mb->get_factor())));
+ } else if (mb->get_button_index() == BUTTON_WHEEL_DOWN && mb->is_pressed()) {
- uv_zoom->set_value(uv_zoom->get_value() * 0.9);
+ uv_zoom->set_value(uv_zoom->get_value() * (1 - (0.1 * mb->get_factor())));
}
+ }
- } else if (p_input.type == InputEvent::MOUSE_MOTION) {
+ Ref<InputEventMouseMotion> mm = p_input;
- const InputEventMouseMotion &mm = p_input.mouse_motion;
+ if (mm.is_valid()) {
- if (mm.button_mask & BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) {
+ if (mm->get_button_mask() & BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) {
- Vector2 drag(mm.relative_x, mm.relative_y);
+ Vector2 drag(mm->get_relative().x, mm->get_relative().y);
uv_hscroll->set_value(uv_hscroll->get_value() - drag.x);
uv_vscroll->set_value(uv_vscroll->get_value() - drag.y);
} else if (uv_drag) {
- Vector2 uv_drag_to = snap_point(Vector2(mm.x, mm.y));
+ Vector2 uv_drag_to = mm->get_position();
Vector2 drag = mtx.affine_inverse().xform(uv_drag_to) - mtx.affine_inverse().xform(uv_drag_from);
switch (uv_move_current) {
@@ -677,14 +675,14 @@ void Polygon2DEditor::_uv_draw() {
rect = rect.grow(200);
updating_uv_scroll = true;
- uv_hscroll->set_min(rect.pos.x);
- uv_hscroll->set_max(rect.pos.x + rect.size.x);
+ uv_hscroll->set_min(rect.position.x);
+ uv_hscroll->set_max(rect.position.x + rect.size.x);
uv_hscroll->set_page(uv_edit_draw->get_size().x);
uv_hscroll->set_value(uv_draw_ofs.x);
uv_hscroll->set_step(0.001);
- uv_vscroll->set_min(rect.pos.y);
- uv_vscroll->set_max(rect.pos.y + rect.size.y);
+ uv_vscroll->set_min(rect.position.y);
+ uv_vscroll->set_max(rect.position.y + rect.size.y);
uv_vscroll->set_page(uv_edit_draw->get_size().y);
uv_vscroll->set_value(uv_draw_ofs.y);
uv_vscroll->set_step(0.001);
diff --git a/editor/plugins/polygon_2d_editor_plugin.h b/editor/plugins/polygon_2d_editor_plugin.h
index 94eb3f49e8..4fcb1d81c2 100644
--- a/editor/plugins/polygon_2d_editor_plugin.h
+++ b/editor/plugins/polygon_2d_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -112,7 +113,7 @@ class Polygon2DEditor : public HBoxContainer {
Vector2 snap_step;
void _uv_scroll_changed(float);
- void _uv_input(const InputEvent &p_input);
+ void _uv_input(const Ref<InputEvent> &p_input);
void _uv_draw();
void _uv_mode(int p_mode);
void _wip_close();
@@ -134,7 +135,7 @@ protected:
Vector2 snap_point(Vector2 p_target) const;
public:
- bool forward_gui_input(const InputEvent &p_event);
+ bool forward_gui_input(const Ref<InputEvent> &p_event);
void edit(Node *p_collision_polygon);
Polygon2DEditor(EditorNode *p_editor);
};
@@ -147,12 +148,12 @@ class Polygon2DEditorPlugin : public EditorPlugin {
EditorNode *editor;
public:
- virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "Polygon2D"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
Polygon2DEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp
index 2cdbff8d97..ccefbc1843 100644
--- a/editor/plugins/resource_preloader_editor_plugin.cpp
+++ b/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,10 +30,10 @@
#include "resource_preloader_editor_plugin.h"
#include "editor/editor_settings.h"
-#include "global_config.h"
#include "io/resource_loader.h"
+#include "project_settings.h"
-void ResourcePreloaderEditor::_gui_input(InputEvent p_event) {
+void ResourcePreloaderEditor::_gui_input(Ref<InputEvent> p_event) {
}
void ResourcePreloaderEditor::_notification(int p_what) {
@@ -361,7 +362,7 @@ void ResourcePreloaderEditor::_bind_methods() {
ResourcePreloaderEditor::ResourcePreloaderEditor() {
- //add_style_override("panel", get_stylebox("panel","Panel"));
+ //add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("panel","Panel"));
VBoxContainer *vbc = memnew(VBoxContainer);
add_child(vbc);
diff --git a/editor/plugins/resource_preloader_editor_plugin.h b/editor/plugins/resource_preloader_editor_plugin.h
index 946a3887ef..6e4726748d 100644
--- a/editor/plugins/resource_preloader_editor_plugin.h
+++ b/editor/plugins/resource_preloader_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -69,7 +70,7 @@ class ResourcePreloaderEditor : public PanelContainer {
protected:
void _notification(int p_what);
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
static void _bind_methods();
public:
@@ -90,8 +91,8 @@ class ResourcePreloaderEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "ResourcePreloader"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
ResourcePreloaderEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/rich_text_editor_plugin.cpp b/editor/plugins/rich_text_editor_plugin.cpp
index 72a9278e62..07c0cced49 100644
--- a/editor/plugins/rich_text_editor_plugin.cpp
+++ b/editor/plugins/rich_text_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/rich_text_editor_plugin.h b/editor/plugins/rich_text_editor_plugin.h
index ab3c252fcf..2665db2993 100644
--- a/editor/plugins/rich_text_editor_plugin.h
+++ b/editor/plugins/rich_text_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -78,8 +79,8 @@ class RichTextEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "RichText"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
RichTextEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/sample_editor_plugin.cpp b/editor/plugins/sample_editor_plugin.cpp
index 4d685f4289..1d6417e2d5 100644
--- a/editor/plugins/sample_editor_plugin.cpp
+++ b/editor/plugins/sample_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,8 +31,8 @@
#if 0
#include "editor/editor_settings.h"
-#include "global_config.h"
#include "io/resource_loader.h"
+#include "project_settings.h"
@@ -359,20 +360,20 @@ SampleEditor::SampleEditor() {
player = memnew(SamplePlayer);
add_child(player);
- add_style_override("panel", get_stylebox("panel","Panel"));
+ add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("panel","Panel"));
library = Ref<SampleLibrary>(memnew(SampleLibrary));
player->set_sample_library(library);
sample_texframe = memnew( TextureRect );
add_child(sample_texframe);
sample_texframe->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_BEGIN,5);
- sample_texframe->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,5);
+ sample_texframe->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,-5);
sample_texframe->set_anchor_and_margin(MARGIN_TOP,ANCHOR_BEGIN,30);
- sample_texframe->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_END,5);
+ sample_texframe->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_END,-5);
info_label = memnew( Label );
sample_texframe->add_child(info_label);
info_label->set_area_as_parent_rect();
- info_label->set_anchor_and_margin(MARGIN_TOP,ANCHOR_END,15);
+ info_label->set_anchor_and_margin(MARGIN_TOP,ANCHOR_END,-15);
info_label->set_margin(MARGIN_BOTTOM,4);
info_label->set_margin(MARGIN_RIGHT,4);
info_label->set_align(Label::ALIGN_RIGHT);
@@ -380,14 +381,14 @@ SampleEditor::SampleEditor() {
play = memnew( Button );
- play->set_pos(Point2( 5, 5 ));
+ play->set_position(Point2( 5, 5 ));
play->set_size( Size2(1,1 ) );
play->set_toggle_mode(true);
add_child(play);
stop = memnew( Button );
- stop->set_pos(Point2( 35, 5 ));
+ stop->set_position(Point2( 35, 5 ));
stop->set_size( Size2(1,1 ) );
stop->set_toggle_mode(true);
add_child(stop);
diff --git a/editor/plugins/sample_editor_plugin.h b/editor/plugins/sample_editor_plugin.h
index 0e7bccffa7..8f93026c92 100644
--- a/editor/plugins/sample_editor_plugin.h
+++ b/editor/plugins/sample_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/sample_library_editor_plugin.cpp b/editor/plugins/sample_library_editor_plugin.cpp
index c164428553..3deb634491 100644
--- a/editor/plugins/sample_library_editor_plugin.cpp
+++ b/editor/plugins/sample_library_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,8 +32,8 @@
#include "sample_library_editor_plugin.h"
#include "editor/editor_settings.h"
-#include "global_config.h"
#include "io/resource_loader.h"
+#include "project_settings.h"
#include "sample_editor_plugin.h"
#include "scene/main/viewport.h"
@@ -431,11 +432,11 @@ SampleLibraryEditor::SampleLibraryEditor() {
player = memnew(SamplePlayer);
add_child(player);
- add_style_override("panel", get_stylebox("panel","Panel"));
+ add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("panel","Panel"));
load = memnew( Button );
- load->set_pos(Point2( 5, 5 ));
+ load->set_position(Point2( 5, 5 ));
load->set_size( Size2(1,1 ) );
add_child(load);
@@ -451,9 +452,9 @@ SampleLibraryEditor::SampleLibraryEditor() {
tree->set_columns(6);
add_child(tree);
tree->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_BEGIN,5);
- tree->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,5);
+ tree->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,-5);
tree->set_anchor_and_margin(MARGIN_TOP,ANCHOR_BEGIN,30);
- tree->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_END,5);
+ tree->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_END,-5);
tree->set_column_titles_visible(true);
tree->set_column_title(0,TTR("Name"));
tree->set_column_title(1,TTR("Preview"));
diff --git a/editor/plugins/sample_library_editor_plugin.h b/editor/plugins/sample_library_editor_plugin.h
index a41e1538b4..0244fa66ed 100644
--- a/editor/plugins/sample_library_editor_plugin.h
+++ b/editor/plugins/sample_library_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/sample_player_editor_plugin.cpp b/editor/plugins/sample_player_editor_plugin.cpp
index a550d96d5c..ea9b646a9b 100644
--- a/editor/plugins/sample_player_editor_plugin.cpp
+++ b/editor/plugins/sample_player_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -117,10 +118,10 @@ SamplePlayerEditor::SamplePlayerEditor() {
play = memnew( Button );
- play->set_pos(Point2( 5, 5 ));
+ play->set_position(Point2( 5, 5 ));
play->set_toggle_mode(true);
- play->set_anchor_and_margin(MARGIN_LEFT,Control::ANCHOR_END,250);
- play->set_anchor_and_margin(MARGIN_RIGHT,Control::ANCHOR_END,230);
+ play->set_anchor_and_margin(MARGIN_LEFT,Control::ANCHOR_END,-250);
+ play->set_anchor_and_margin(MARGIN_RIGHT,Control::ANCHOR_END,-230);
play->set_anchor_and_margin(MARGIN_TOP,Control::ANCHOR_BEGIN,0);
play->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_BEGIN,0);
@@ -128,17 +129,17 @@ SamplePlayerEditor::SamplePlayerEditor() {
stop = memnew( Button );
- stop->set_pos(Point2( 35, 5 ));
+ stop->set_position(Point2( 35, 5 ));
stop->set_toggle_mode(true);
- stop->set_anchor_and_margin(MARGIN_LEFT,Control::ANCHOR_END,220);
- stop->set_anchor_and_margin(MARGIN_RIGHT,Control::ANCHOR_END,200);
+ stop->set_anchor_and_margin(MARGIN_LEFT,Control::ANCHOR_END,-220);
+ stop->set_anchor_and_margin(MARGIN_RIGHT,Control::ANCHOR_END,-200);
stop->set_anchor_and_margin(MARGIN_TOP,Control::ANCHOR_BEGIN,0);
stop->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_BEGIN,0);
add_child(stop);
samples = memnew( OptionButton );
- samples->set_anchor_and_margin(MARGIN_LEFT,Control::ANCHOR_END,190);
- samples->set_anchor_and_margin(MARGIN_RIGHT,Control::ANCHOR_END,5);
+ samples->set_anchor_and_margin(MARGIN_LEFT,Control::ANCHOR_END,-190);
+ samples->set_anchor_and_margin(MARGIN_RIGHT,Control::ANCHOR_END,-5);
samples->set_anchor_and_margin(MARGIN_TOP,Control::ANCHOR_BEGIN,0);
samples->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_BEGIN,0);
add_child(samples);
@@ -181,7 +182,7 @@ SamplePlayerEditorPlugin::SamplePlayerEditorPlugin(EditorNode *p_node) {
sample_player_editor->set_anchor(MARGIN_LEFT,Control::ANCHOR_END);
sample_player_editor->set_anchor(MARGIN_RIGHT,Control::ANCHOR_END);
- sample_player_editor->set_margin(MARGIN_LEFT,250);
+ sample_player_editor->set_margin(MARGIN_LEFT,-250);
sample_player_editor->set_margin(MARGIN_RIGHT,0);
sample_player_editor->set_margin(MARGIN_TOP,0);
sample_player_editor->set_margin(MARGIN_BOTTOM,10);
diff --git a/editor/plugins/sample_player_editor_plugin.h b/editor/plugins/sample_player_editor_plugin.h
index 10a08b8a17..5c1b25aaa2 100644
--- a/editor/plugins/sample_player_editor_plugin.h
+++ b/editor/plugins/sample_player_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 4e7a0709fa..1873a3f58b 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,14 +32,13 @@
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/script_editor_debugger.h"
-#include "global_config.h"
#include "io/resource_loader.h"
#include "io/resource_saver.h"
#include "os/file_access.h"
#include "os/input.h"
#include "os/keyboard.h"
-#include "os/keyboard.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/main/viewport.h"
/*** SCRIPT EDITOR ****/
@@ -47,6 +47,7 @@ void ScriptEditorBase::_bind_methods() {
ADD_SIGNAL(MethodInfo("name_changed"));
ADD_SIGNAL(MethodInfo("request_help_search", PropertyInfo(Variant::STRING, "topic")));
+ ADD_SIGNAL(MethodInfo("request_help_index"));
ADD_SIGNAL(MethodInfo("request_open_script_at_line", PropertyInfo(Variant::OBJECT, "script"), PropertyInfo(Variant::INT, "line")));
ADD_SIGNAL(MethodInfo("request_save_history"));
ADD_SIGNAL(MethodInfo("go_to_help", PropertyInfo(Variant::STRING, "what")));
@@ -163,14 +164,16 @@ void ScriptEditorQuickOpen::_text_changed(const String &p_newtext) {
_update_search();
}
-void ScriptEditorQuickOpen::_sbox_input(const InputEvent &p_ie) {
+void ScriptEditorQuickOpen::_sbox_input(const Ref<InputEvent> &p_ie) {
+
+ Ref<InputEventKey> k = p_ie;
- if (p_ie.type == InputEvent::KEY && (p_ie.key.scancode == KEY_UP ||
- p_ie.key.scancode == KEY_DOWN ||
- p_ie.key.scancode == KEY_PAGEUP ||
- p_ie.key.scancode == KEY_PAGEDOWN)) {
+ if (k.is_valid() && (k->get_scancode() == KEY_UP ||
+ k->get_scancode() == KEY_DOWN ||
+ k->get_scancode() == KEY_PAGEUP ||
+ k->get_scancode() == KEY_PAGEDOWN)) {
- search_options->call("_gui_input", p_ie);
+ search_options->call("_gui_input", k);
search_box->accept_event();
}
}
@@ -208,9 +211,11 @@ void ScriptEditorQuickOpen::_confirmed() {
void ScriptEditorQuickOpen::_notification(int p_what) {
- if (p_what == NOTIFICATION_ENTER_TREE) {
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE: {
- connect("confirmed", this, "_confirmed");
+ connect("confirmed", this, "_confirmed");
+ } break;
}
}
@@ -310,6 +315,13 @@ void ScriptEditor::_goto_script_line(REF p_script, int p_line) {
editor->push_item(p_script.ptr());
+ if (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) {
+
+ Ref<Script> script = p_script->cast_to<Script>();
+ if (!script.is_null() && script->get_path().is_resource_file())
+ edit(p_script, p_line, 0);
+ }
+
int selected = tab_container->get_current_tab();
if (selected < 0 || selected >= tab_container->get_child_count())
return;
@@ -395,6 +407,8 @@ void ScriptEditor::_go_to_tab(int p_idx) {
script_icon->set_texture(c->cast_to<ScriptEditorBase>()->get_icon());
if (is_visible_in_tree())
c->cast_to<ScriptEditorBase>()->ensure_focus();
+
+ notify_script_changed(c->cast_to<ScriptEditorBase>()->get_edited_script());
}
if (c->cast_to<EditorHelp>()) {
@@ -407,7 +421,83 @@ void ScriptEditor::_go_to_tab(int p_idx) {
c->set_meta("__editor_pass", ++edit_pass);
_update_history_arrows();
_update_script_colors();
+ _update_members_overview();
_update_selected_editor_menu();
+ _update_members_overview_visibility();
+}
+
+void ScriptEditor::_add_recent_script(String p_path) {
+
+ if (p_path.empty()) {
+ return;
+ }
+
+ // remove if already stored
+ int already_recent = previous_scripts.find(p_path);
+ if (already_recent >= 0) {
+ previous_scripts.remove(already_recent);
+ }
+
+ // add to list
+ previous_scripts.insert(0, p_path);
+
+ _update_recent_scripts();
+}
+
+void ScriptEditor::_update_recent_scripts() {
+
+ // make sure we don't exceed max size
+ const int max_history = EDITOR_DEF("text_editor/files/maximum_recent_files", 20);
+ if (previous_scripts.size() > max_history) {
+ previous_scripts.resize(max_history);
+ }
+
+ recent_scripts->clear();
+
+ recent_scripts->add_shortcut(ED_SHORTCUT("script_editor/open_recent", TTR("Open Recent"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_T));
+ recent_scripts->add_separator();
+
+ const int max_shown = 8;
+ for (int i = 0; i < previous_scripts.size() && i <= max_shown; i++) {
+ String path = previous_scripts.get(i);
+ // just show script name and last dir
+ recent_scripts->add_item(path.get_slice("/", path.get_slice_count("/") - 2) + "/" + path.get_file());
+ }
+
+ recent_scripts->add_separator();
+ recent_scripts->add_shortcut(ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Files")));
+}
+
+void ScriptEditor::_open_recent_script(int p_idx) {
+
+ // clear button
+ if (p_idx == recent_scripts->get_item_count() - 1) {
+ previous_scripts.clear();
+ _update_recent_scripts();
+ return;
+ }
+
+ // take two for the open recent button
+ if (p_idx > 0) {
+ p_idx -= 2;
+ }
+
+ if (p_idx < previous_scripts.size() && p_idx >= 0) {
+
+ String path = previous_scripts.get(p_idx);
+ // if its not on disk its a help file or deleted
+ if (FileAccess::exists(path)) {
+ Ref<Script> script = ResourceLoader::load(path);
+ if (script.is_valid()) {
+ edit(script, true);
+ }
+ // if it's a path then its most likely a delted file not help
+ } else if (!path.is_resource_file()) {
+ _help_class_open(path);
+ }
+ previous_scripts.remove(p_idx);
+ _update_recent_scripts();
+ }
}
void ScriptEditor::_close_tab(int p_idx, bool p_save) {
@@ -419,14 +509,20 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) {
Node *tselected = tab_container->get_child(selected);
ScriptEditorBase *current = tab_container->get_child(selected)->cast_to<ScriptEditorBase>();
if (current) {
+ _add_recent_script(current->get_edited_script()->get_path());
if (p_save) {
apply_scripts();
}
- if (current->get_edit_menu()) {
- memdelete(current->get_edit_menu());
- }
+ current->clear_edit_menu();
+ notify_script_close(current->get_edited_script());
+ } else {
+ EditorHelp *help = tab_container->get_child(selected)->cast_to<EditorHelp>();
+ _add_recent_script(help->get_class());
}
+ // roll back to previous tab
+ _history_back();
+
//remove from history
history.resize(history_pos + 1);
@@ -459,6 +555,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) {
_update_history_arrows();
_update_script_names();
+ _update_members_overview_visibility();
_save_layout();
}
@@ -529,6 +626,15 @@ void ScriptEditor::_resave_scripts(const String &p_str) {
if (trim_trailing_whitespace_on_save) {
se->trim_trailing_whitespace();
}
+
+ if (convert_indent_on_save) {
+ if (use_space_indentation) {
+ se->convert_indent_to_spaces();
+ } else {
+ se->convert_indent_to_tabs();
+ }
+ }
+
editor->save_resource(script);
se->tag_saved_version();
}
@@ -678,6 +784,31 @@ void ScriptEditor::_file_dialog_action(String p_file) {
file_dialog_option = -1;
}
+Ref<Script> ScriptEditor::_get_current_script() {
+
+ int selected = tab_container->get_current_tab();
+ if (selected < 0 || selected >= tab_container->get_child_count())
+ return NULL;
+
+ ScriptEditorBase *current = tab_container->get_child(selected)->cast_to<ScriptEditorBase>();
+ if (current) {
+ return current->get_edited_script();
+ } else {
+ return NULL;
+ }
+}
+
+Array ScriptEditor::_get_open_scripts() const {
+
+ Array ret;
+ Vector<Ref<Script> > scripts = get_open_scripts();
+ int scrits_amount = scripts.size();
+ for (int idx_script = 0; idx_script < scrits_amount; idx_script++) {
+ ret.push_back(scripts[idx_script]);
+ }
+ return ret;
+}
+
void ScriptEditor::_menu_option(int p_option) {
switch (p_option) {
@@ -773,6 +904,14 @@ void ScriptEditor::_menu_option(int p_option) {
debugger->set_hide_on_stop(visible);
debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_SHOW_KEEP_OPEN), !visible);
} break;
+ case DEBUG_WITH_EXTERNAL_EDITOR: {
+ bool debug_with_external_editor = !debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR));
+ debugger->set_debug_with_external_editor(debug_with_external_editor);
+ debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR), debug_with_external_editor);
+ } break;
+ case TOGGLE_SCRIPTS_PANEL: {
+ list_split->set_visible(!list_split->is_visible());
+ }
}
int selected = tab_container->get_current_tab();
@@ -794,12 +933,28 @@ void ScriptEditor::_menu_option(int p_option) {
if (trim_trailing_whitespace_on_save)
current->trim_trailing_whitespace();
+
+ if (convert_indent_on_save) {
+ if (use_space_indentation) {
+ current->convert_indent_to_spaces();
+ } else {
+ current->convert_indent_to_tabs();
+ }
+ }
editor->save_resource(current->get_edited_script());
} break;
case FILE_SAVE_AS: {
current->trim_trailing_whitespace();
+
+ if (convert_indent_on_save) {
+ if (use_space_indentation) {
+ current->convert_indent_to_spaces();
+ } else {
+ current->convert_indent_to_tabs();
+ }
+ }
editor->push_item(current->get_edited_script()->cast_to<Object>());
editor->save_resource_as(current->get_edited_script());
@@ -877,28 +1032,29 @@ void ScriptEditor::_menu_option(int p_option) {
}
}
}
- }
+ } else {
- EditorHelp *help = tab_container->get_current_tab_control()->cast_to<EditorHelp>();
- if (help) {
+ EditorHelp *help = tab_container->get_current_tab_control()->cast_to<EditorHelp>();
+ if (help) {
- switch (p_option) {
+ switch (p_option) {
- case HELP_SEARCH_FIND: {
- help->popup_search();
- } break;
- case HELP_SEARCH_FIND_NEXT: {
- help->search_again();
- } break;
- case FILE_CLOSE: {
- _close_current_tab();
- } break;
- case CLOSE_DOCS: {
- _close_docs_tab();
- } break;
- case CLOSE_ALL: {
- _close_all_tabs();
- } break;
+ case HELP_SEARCH_FIND: {
+ help->popup_search();
+ } break;
+ case HELP_SEARCH_FIND_NEXT: {
+ help->search_again();
+ } break;
+ case FILE_CLOSE: {
+ _close_current_tab();
+ } break;
+ case CLOSE_DOCS: {
+ _close_docs_tab();
+ } break;
+ case CLOSE_ALL: {
+ _close_all_tabs();
+ } break;
+ }
}
}
}
@@ -910,55 +1066,73 @@ void ScriptEditor::_tab_changed(int p_which) {
void ScriptEditor::_notification(int p_what) {
- if (p_what == NOTIFICATION_ENTER_TREE) {
-
- editor->connect("play_pressed", this, "_editor_play");
- editor->connect("pause_pressed", this, "_editor_pause");
- editor->connect("stop_pressed", this, "_editor_stop");
- editor->connect("script_add_function_request", this, "_add_callback");
- editor->connect("resource_saved", this, "_res_saved_callback");
- script_list->connect("item_selected", this, "_script_selected");
- script_split->connect("dragged", this, "_script_split_dragged");
- autosave_timer->connect("timeout", this, "_autosave_scripts");
- {
- float autosave_time = EditorSettings::get_singleton()->get("text_editor/files/autosave_interval_secs");
- if (autosave_time > 0) {
- autosave_timer->set_wait_time(autosave_time);
- autosave_timer->start();
- } else {
- autosave_timer->stop();
+ switch (p_what) {
+
+ case NOTIFICATION_ENTER_TREE: {
+
+ editor->connect("play_pressed", this, "_editor_play");
+ editor->connect("pause_pressed", this, "_editor_pause");
+ editor->connect("stop_pressed", this, "_editor_stop");
+ editor->connect("script_add_function_request", this, "_add_callback");
+ editor->connect("resource_saved", this, "_res_saved_callback");
+ script_list->connect("item_selected", this, "_script_selected");
+ members_overview->connect("item_selected", this, "_members_overview_selected");
+ script_split->connect("dragged", this, "_script_split_dragged");
+ autosave_timer->connect("timeout", this, "_autosave_scripts");
+ {
+ float autosave_time = EditorSettings::get_singleton()->get("text_editor/files/autosave_interval_secs");
+ if (autosave_time > 0) {
+ autosave_timer->set_wait_time(autosave_time);
+ autosave_timer->start();
+ } else {
+ autosave_timer->stop();
+ }
}
- }
- EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed");
- help_search->set_icon(get_icon("Help", "EditorIcons"));
- site_search->set_icon(get_icon("Godot", "EditorIcons"));
- class_search->set_icon(get_icon("ClassList", "EditorIcons"));
+ EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed");
+ help_search->set_icon(get_icon("HelpSearch", "EditorIcons"));
+ site_search->set_icon(get_icon("Instance", "EditorIcons"));
+ class_search->set_icon(get_icon("ClassList", "EditorIcons"));
- script_forward->set_icon(get_icon("Forward", "EditorIcons"));
- script_back->set_icon(get_icon("Back", "EditorIcons"));
- }
+ script_forward->set_icon(get_icon("Forward", "EditorIcons"));
+ script_back->set_icon(get_icon("Back", "EditorIcons"));
+ } break;
- if (p_what == NOTIFICATION_READY) {
+ case NOTIFICATION_READY: {
- get_tree()->connect("tree_changed", this, "_tree_changed");
- editor->connect("request_help", this, "_request_help");
- }
+ get_tree()->connect("tree_changed", this, "_tree_changed");
+ editor->connect("request_help", this, "_request_help");
+ editor->connect("request_help_search", this, "_help_search");
+ editor->connect("request_help_index", this, "_help_index");
+ } break;
- if (p_what == NOTIFICATION_EXIT_TREE) {
+ case NOTIFICATION_EXIT_TREE: {
- editor->disconnect("play_pressed", this, "_editor_play");
- editor->disconnect("pause_pressed", this, "_editor_pause");
- editor->disconnect("stop_pressed", this, "_editor_stop");
- }
+ editor->disconnect("play_pressed", this, "_editor_play");
+ editor->disconnect("pause_pressed", this, "_editor_pause");
+ editor->disconnect("stop_pressed", this, "_editor_stop");
+ } break;
- if (p_what == MainLoop::NOTIFICATION_WM_FOCUS_IN) {
+ case MainLoop::NOTIFICATION_WM_FOCUS_IN: {
- _test_script_times_on_disk();
- _update_modified_scripts_for_external_editor();
- }
+ _test_script_times_on_disk();
+ _update_modified_scripts_for_external_editor();
+ } break;
+
+ case NOTIFICATION_PROCESS: {
+ } break;
- if (p_what == NOTIFICATION_PROCESS) {
+ case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+
+ tab_container->add_style_override("panel", editor->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles"));
+
+ Ref<StyleBox> sb = editor->get_gui_base()->get_stylebox("panel", "TabContainer")->duplicate();
+ sb->set_default_margin(MARGIN_TOP, 0);
+ add_style_override("panel", sb);
+ } break;
+
+ default:
+ break;
}
}
@@ -1000,6 +1174,14 @@ void ScriptEditor::edited_scene_changed() {
_update_modified_scripts_for_external_editor();
}
+void ScriptEditor::notify_script_close(const Ref<Script> &p_script) {
+ emit_signal("script_close", p_script);
+}
+
+void ScriptEditor::notify_script_changed(const Ref<Script> &p_script) {
+ emit_signal("editor_script_changed", p_script);
+}
+
static const Node *_find_node_with_script(const Node *p_node, const RefPtr &p_script) {
if (p_node->get_script() == p_script)
@@ -1154,7 +1336,8 @@ void ScriptEditor::ensure_focus_current() {
int cidx = tab_container->get_current_tab();
if (cidx < 0 || cidx >= tab_container->get_tab_count())
- ;
+ return;
+
Control *c = tab_container->get_child(cidx)->cast_to<Control>();
if (!c)
return;
@@ -1164,6 +1347,16 @@ void ScriptEditor::ensure_focus_current() {
se->ensure_focus();
}
+void ScriptEditor::_members_overview_selected(int p_idx) {
+ Node *current = tab_container->get_child(tab_container->get_current_tab());
+ ScriptEditorBase *se = current->cast_to<ScriptEditorBase>();
+ if (!se) {
+ return;
+ }
+ se->goto_line(members_overview->get_item_metadata(p_idx));
+ se->ensure_focus();
+}
+
void ScriptEditor::_script_selected(int p_idx) {
grab_focus_block = !Input::get_singleton()->is_mouse_button_pressed(1); //amazing hack, simply amazing
@@ -1233,6 +1426,46 @@ struct _ScriptEditorItemData {
}
};
+void ScriptEditor::_update_members_overview_visibility() {
+
+ int selected = tab_container->get_current_tab();
+ if (selected < 0 || selected >= tab_container->get_child_count())
+ return;
+
+ Node *current = tab_container->get_child(tab_container->get_current_tab());
+ ScriptEditorBase *se = current->cast_to<ScriptEditorBase>();
+ if (!se) {
+ members_overview->set_visible(false);
+ return;
+ }
+
+ if (members_overview_enabled && se->show_members_overview()) {
+ members_overview->set_visible(true);
+ } else {
+ members_overview->set_visible(false);
+ }
+}
+
+void ScriptEditor::_update_members_overview() {
+ members_overview->clear();
+
+ int selected = tab_container->get_current_tab();
+ if (selected < 0 || selected >= tab_container->get_child_count())
+ return;
+
+ Node *current = tab_container->get_child(tab_container->get_current_tab());
+ ScriptEditorBase *se = current->cast_to<ScriptEditorBase>();
+ if (!se) {
+ return;
+ }
+
+ Vector<String> functions = se->get_functions();
+ for (int i = 0; i < functions.size(); i++) {
+ members_overview->add_item(functions[i].get_slice(":", 0));
+ members_overview->set_item_metadata(i, functions[i].get_slice(":", 1).to_int() - 1);
+ }
+}
+
void ScriptEditor::_update_script_colors() {
bool script_temperature_enabled = EditorSettings::get_singleton()->get("text_editor/open_scripts/script_temperature_enabled");
@@ -1376,13 +1609,14 @@ void ScriptEditor::_update_script_names() {
}
}
+ _update_members_overview();
_update_script_colors();
}
-void ScriptEditor::edit(const Ref<Script> &p_script, bool p_grab_focus) {
+bool ScriptEditor::edit(const Ref<Script> &p_script, int p_line, int p_col, bool p_grab_focus) {
if (p_script.is_null())
- return;
+ return false;
// refuse to open built-in if scene is not loaded
@@ -1390,22 +1624,43 @@ void ScriptEditor::edit(const Ref<Script> &p_script, bool p_grab_focus) {
bool open_dominant = EditorSettings::get_singleton()->get("text_editor/files/open_dominant_script_on_scene_change");
- if (p_script->get_path().is_resource_file() && bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) {
+ if ((debugger->get_dump_stack_script() != p_script || debugger->get_debug_with_external_editor()) &&
+ p_script->get_language()->open_in_external_editor(p_script, p_line >= 0 ? p_line : 0, p_col) == OK &&
+ p_script->get_path().is_resource_file() &&
+ bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) {
String path = EditorSettings::get_singleton()->get("text_editor/external/exec_path");
String flags = EditorSettings::get_singleton()->get("text_editor/external/exec_flags");
+
+ Dictionary keys;
+ keys["project"] = ProjectSettings::get_singleton()->get_resource_path();
+ keys["file"] = ProjectSettings::get_singleton()->globalize_path(p_script->get_path());
+ keys["line"] = p_line >= 0 ? p_line : 0;
+ keys["col"] = p_col;
+
+ flags = flags.format(keys).strip_edges().replace("\\\\", "\\");
+
List<String> args;
- flags = flags.strip_edges();
- if (flags != String()) {
- Vector<String> flagss = flags.split(" ", false);
- for (int i = 0; i < flagss.size(); i++)
- args.push_back(flagss[i]);
+
+ if (flags.size()) {
+ int from = 0, to = 0;
+ bool inside_quotes = false;
+ for (int i = 0; i < flags.size(); i++) {
+ if (flags[i] == '"' && (!i || flags[i - 1] != '\\')) {
+ inside_quotes = !inside_quotes;
+ } else if (flags[i] == '\0' || (!inside_quotes && flags[i] == ' ')) {
+ args.push_back(flags.substr(from, to));
+ from = i + 1;
+ to = 0;
+ } else {
+ to++;
+ }
+ }
}
- args.push_back(GlobalConfig::get_singleton()->globalize_path(p_script->get_path()));
Error err = OS::get_singleton()->execute(path, args, false);
if (err == OK)
- return;
+ return false;
WARN_PRINT("Couldn't open external text editor, using internal");
}
@@ -1424,8 +1679,11 @@ void ScriptEditor::edit(const Ref<Script> &p_script, bool p_grab_focus) {
}
if (is_visible_in_tree())
se->ensure_focus();
+
+ if (p_line >= 0)
+ se->goto_line(p_line - 1);
}
- return;
+ return true;
}
}
@@ -1438,7 +1696,7 @@ void ScriptEditor::edit(const Ref<Script> &p_script, bool p_grab_focus) {
if (se)
break;
}
- ERR_FAIL_COND(!se);
+ ERR_FAIL_COND_V(!se, false);
tab_container->add_child(se);
se->set_edited_script(p_script);
@@ -1465,6 +1723,12 @@ void ScriptEditor::edit(const Ref<Script> &p_script, bool p_grab_focus) {
_test_script_times_on_disk(p_script);
_update_modified_scripts_for_external_editor(p_script);
+
+ if (p_line >= 0)
+ se->goto_line(p_line - 1);
+
+ notify_script_changed(p_script);
+ return true;
}
void ScriptEditor::save_all_scripts() {
@@ -1475,13 +1739,21 @@ void ScriptEditor::save_all_scripts() {
if (!se)
continue;
- if (!se->is_unsaved())
- continue;
+ if (convert_indent_on_save) {
+ if (use_space_indentation) {
+ se->convert_indent_to_spaces();
+ } else {
+ se->convert_indent_to_tabs();
+ }
+ }
if (trim_trailing_whitespace_on_save) {
se->trim_trailing_whitespace();
}
+ if (!se->is_unsaved())
+ continue;
+
Ref<Script> script = se->get_edited_script();
if (script.is_valid())
se->apply_code();
@@ -1581,6 +1853,12 @@ void ScriptEditor::_save_layout() {
void ScriptEditor::_editor_settings_changed() {
trim_trailing_whitespace_on_save = EditorSettings::get_singleton()->get("text_editor/files/trim_trailing_whitespace_on_save");
+ convert_indent_on_save = EditorSettings::get_singleton()->get("text_editor/indent/convert_indent_on_save");
+ use_space_indentation = EditorSettings::get_singleton()->get("text_editor/indent/type");
+
+ members_overview_enabled = EditorSettings::get_singleton()->get("text_editor/open_scripts/show_members_overview");
+ _update_members_overview_visibility();
+
float autosave_time = EditorSettings::get_singleton()->get("text_editor/files/autosave_interval_secs");
if (autosave_time > 0) {
autosave_timer->set_wait_time(autosave_time);
@@ -1629,8 +1907,8 @@ void ScriptEditor::_script_split_dragged(float) {
_save_layout();
}
-void ScriptEditor::_unhandled_input(const InputEvent &p_event) {
- if (p_event.key.pressed || !is_visible_in_tree()) return;
+void ScriptEditor::_unhandled_input(const Ref<InputEvent> &p_event) {
+ if (p_event->is_pressed() || !is_visible_in_tree()) return;
if (ED_IS_SHORTCUT("script_editor/next_script", p_event)) {
int next_tab = script_list->get_current() + 1;
next_tab %= script_list->get_item_count();
@@ -1675,6 +1953,9 @@ void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) {
for (int i = 0; i < helps.size(); i++) {
String path = helps[i];
+ if (path == "") { // invalid, skip
+ continue;
+ }
_help_class_open(path);
}
@@ -1823,6 +2104,8 @@ void ScriptEditor::_update_history_pos(int p_new_pos) {
n->cast_to<ScriptEditorBase>()->set_edit_state(history[history_pos].state);
n->cast_to<ScriptEditorBase>()->ensure_focus();
+
+ notify_script_changed(n->cast_to<ScriptEditorBase>()->get_edited_script());
}
if (n->cast_to<EditorHelp>()) {
@@ -1850,6 +2133,21 @@ void ScriptEditor::_history_back() {
_update_history_pos(history_pos - 1);
}
}
+
+Vector<Ref<Script> > ScriptEditor::get_open_scripts() const {
+
+ Vector<Ref<Script> > out_scripts = Vector<Ref<Script> >();
+
+ for (int i = 0; i < tab_container->get_child_count(); i++) {
+ ScriptEditorBase *se = tab_container->get_child(i)->cast_to<ScriptEditorBase>();
+ if (!se)
+ continue;
+ out_scripts.push_back(se->get_edited_script());
+ }
+
+ return out_scripts;
+}
+
void ScriptEditor::set_scene_root_script(Ref<Script> p_script) {
bool open_dominant = EditorSettings::get_singleton()->get("text_editor/files/open_dominant_script_on_scene_change");
@@ -1862,20 +2160,14 @@ void ScriptEditor::set_scene_root_script(Ref<Script> p_script) {
}
}
-bool ScriptEditor::script_go_to_method(Ref<Script> p_script, const String &p_method) {
+bool ScriptEditor::script_goto_method(Ref<Script> p_script, const String &p_method) {
- for (int i = 0; i < tab_container->get_child_count(); i++) {
- ScriptEditorBase *current = tab_container->get_child(i)->cast_to<ScriptEditorBase>();
+ int line = p_script->get_member_line(p_method);
- if (current && current->get_edited_script() == p_script) {
- if (current->goto_method(p_method)) {
- edit(p_script);
- return true;
- }
- break;
- }
- }
- return false;
+ if (line == -1)
+ return false;
+
+ return edit(p_script, line, 0);
}
void ScriptEditor::set_live_auto_reload_running_scripts(bool p_enabled) {
@@ -1883,6 +2175,10 @@ void ScriptEditor::set_live_auto_reload_running_scripts(bool p_enabled) {
auto_reload_running_scripts = p_enabled;
}
+void ScriptEditor::_help_index(String p_text) {
+ help_index->popup();
+}
+
void ScriptEditor::_help_search(String p_text) {
help_search_dialog->popup(p_text);
}
@@ -1913,6 +2209,7 @@ void ScriptEditor::_bind_methods() {
ClassDB::bind_method("_close_discard_current_tab", &ScriptEditor::_close_discard_current_tab);
ClassDB::bind_method("_close_docs_tab", &ScriptEditor::_close_docs_tab);
ClassDB::bind_method("_close_all_tabs", &ScriptEditor::_close_all_tabs);
+ ClassDB::bind_method("_open_recent_script", &ScriptEditor::_open_recent_script);
ClassDB::bind_method("_editor_play", &ScriptEditor::_editor_play);
ClassDB::bind_method("_editor_pause", &ScriptEditor::_editor_pause);
ClassDB::bind_method("_editor_stop", &ScriptEditor::_editor_stop);
@@ -1923,6 +2220,7 @@ void ScriptEditor::_bind_methods() {
ClassDB::bind_method("_goto_script_line", &ScriptEditor::_goto_script_line);
ClassDB::bind_method("_goto_script_line2", &ScriptEditor::_goto_script_line2);
ClassDB::bind_method("_help_search", &ScriptEditor::_help_search);
+ ClassDB::bind_method("_help_index", &ScriptEditor::_help_index);
ClassDB::bind_method("_save_history", &ScriptEditor::_save_history);
ClassDB::bind_method("_breaked", &ScriptEditor::_breaked);
@@ -1932,6 +2230,7 @@ void ScriptEditor::_bind_methods() {
ClassDB::bind_method("_editor_settings_changed", &ScriptEditor::_editor_settings_changed);
ClassDB::bind_method("_update_script_names", &ScriptEditor::_update_script_names);
ClassDB::bind_method("_tree_changed", &ScriptEditor::_tree_changed);
+ ClassDB::bind_method("_members_overview_selected", &ScriptEditor::_members_overview_selected);
ClassDB::bind_method("_script_selected", &ScriptEditor::_script_selected);
ClassDB::bind_method("_script_created", &ScriptEditor::_script_created);
ClassDB::bind_method("_script_split_dragged", &ScriptEditor::_script_split_dragged);
@@ -1942,6 +2241,12 @@ void ScriptEditor::_bind_methods() {
ClassDB::bind_method("_history_back", &ScriptEditor::_history_back);
ClassDB::bind_method("_live_auto_reload_running_scripts", &ScriptEditor::_live_auto_reload_running_scripts);
ClassDB::bind_method("_unhandled_input", &ScriptEditor::_unhandled_input);
+
+ ClassDB::bind_method(D_METHOD("get_current_script"), &ScriptEditor::_get_current_script);
+ ClassDB::bind_method(D_METHOD("get_open_scripts"), &ScriptEditor::_get_open_scripts);
+
+ ADD_SIGNAL(MethodInfo("editor_script_changed", PropertyInfo(Variant::OBJECT, "script:Script")));
+ ADD_SIGNAL(MethodInfo("script_close", PropertyInfo(Variant::OBJECT, "script:Script")));
}
ScriptEditor::ScriptEditor(EditorNode *p_editor) {
@@ -1953,21 +2258,40 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
waiting_update_names = false;
pending_auto_reload = false;
auto_reload_running_scripts = false;
+ members_overview_enabled = true;
editor = p_editor;
+ Ref<StyleBox> sb = p_editor->get_gui_base()->get_stylebox("panel", "TabContainer")->duplicate();
+ sb->set_default_margin(MARGIN_TOP, 0);
+ add_style_override("panel", sb);
+ VBoxContainer *main_container = memnew(VBoxContainer);
+ add_child(main_container);
+
menu_hb = memnew(HBoxContainer);
- add_child(menu_hb);
+ main_container->add_child(menu_hb);
script_split = memnew(HSplitContainer);
- add_child(script_split);
+ main_container->add_child(script_split);
script_split->set_v_size_flags(SIZE_EXPAND_FILL);
+ list_split = memnew(VSplitContainer);
+ script_split->add_child(list_split);
+ list_split->set_v_size_flags(SIZE_EXPAND_FILL);
+
script_list = memnew(ItemList);
- script_split->add_child(script_list);
- script_list->set_custom_minimum_size(Size2(0, 0));
+ list_split->add_child(script_list);
+ script_list->set_custom_minimum_size(Size2(150 * EDSCALE, 100)); //need to give a bit of limit to avoid it from disappearing
+ script_list->set_v_size_flags(SIZE_EXPAND_FILL);
script_split->set_split_offset(140);
+ //list_split->set_split_offset(500);
+
+ members_overview = memnew(ItemList);
+ list_split->add_child(members_overview);
+ members_overview->set_custom_minimum_size(Size2(0, 100)); //need to give a bit of limit to avoid it from disappearing
+ members_overview->set_v_size_flags(SIZE_EXPAND_FILL);
tab_container = memnew(TabContainer);
+ tab_container->add_style_override("panel", p_editor->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles"));
tab_container->set_tabs_visible(false);
script_split->add_child(tab_container);
@@ -1982,6 +2306,14 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
file_menu->set_text(TTR("File"));
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new", TTR("New")), FILE_NEW);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/open", TTR("Open")), FILE_OPEN);
+ file_menu->get_popup()->add_submenu_item(TTR("Open Recent"), "RecentScripts", FILE_OPEN_RECENT);
+
+ recent_scripts = memnew(PopupMenu);
+ recent_scripts->set_name("RecentScripts");
+ file_menu->get_popup()->add_child(recent_scripts);
+ recent_scripts->connect("id_pressed", this, "_open_recent_script");
+ _update_recent_scripts();
+
file_menu->get_popup()->add_separator();
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save", TTR("Save"), KEY_MASK_ALT | KEY_MASK_CMD | KEY_S), FILE_SAVE);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_as", TTR("Save As..")), FILE_SAVE_AS);
@@ -2001,6 +2333,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD | KEY_W), FILE_CLOSE);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_all", TTR("Close All")), CLOSE_ALL);
+ file_menu->get_popup()->add_separator();
+ file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_scripts_panel", TTR("Toggle Scripts Panel"), KEY_MASK_CMD | KEY_BACKSLASH), TOGGLE_SCRIPTS_PANEL);
file_menu->get_popup()->connect("id_pressed", this, "_menu_option");
script_search_menu = memnew(MenuButton);
@@ -2023,6 +2357,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
debug_menu->get_popup()->add_separator();
//debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW);
debug_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("debugger/keep_debugger_open", TTR("Keep Debugger Open")), DEBUG_SHOW_KEEP_OPEN);
+ debug_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("debugger/debug_with_exteral_editor", TTR("Debug with external editor")), DEBUG_WITH_EXTERNAL_EDITOR);
debug_menu->get_popup()->connect("id_pressed", this, "_menu_option");
debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true);
@@ -2056,10 +2391,10 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
menu_hb->add_spacer();
site_search = memnew(ToolButton);
- site_search->set_text(TTR("Tutorials"));
+ site_search->set_text(TTR("Online Docs"));
site_search->connect("pressed", this, "_menu_option", varray(SEARCH_WEBSITE));
menu_hb->add_child(site_search);
- site_search->set_tooltip(TTR("Open https://godotengine.org at tutorials section."));
+ site_search->set_tooltip(TTR("Open Godot online documentation"));
class_search = memnew(ToolButton);
class_search->set_text(TTR("Classes"));
@@ -2159,6 +2494,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
edit_pass = 0;
trim_trailing_whitespace_on_save = false;
+ convert_indent_on_save = false;
+ use_space_indentation = false;
ScriptServer::edit_request_func = _open_script_request;
}
@@ -2286,6 +2623,9 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) {
EDITOR_DEF("text_editor/open_scripts/list_script_names_as", 0);
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "text_editor/external/exec_path", PROPERTY_HINT_GLOBAL_FILE));
EDITOR_DEF("text_editor/external/exec_flags", "");
+
+ ED_SHORTCUT("script_editor/open_recent", TTR("Open Recent"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_T);
+ ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Files"));
}
ScriptEditorPlugin::~ScriptEditorPlugin() {
diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h
index a73e14423d..4614a41605 100644
--- a/editor/plugins/script_editor_plugin.h
+++ b/editor/plugins/script_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -53,7 +54,7 @@ class ScriptEditorQuickOpen : public ConfirmationDialog {
void _update_search();
- void _sbox_input(const InputEvent &p_ie);
+ void _sbox_input(const Ref<InputEvent> &p_ie);
Vector<String> functions;
void _confirmed();
@@ -64,7 +65,7 @@ protected:
static void _bind_methods();
public:
- void popup(const Vector<String> &p_base, bool p_dontclear = false);
+ void popup(const Vector<String> &p_functions, bool p_dontclear = false);
ScriptEditorQuickOpen();
};
@@ -90,18 +91,22 @@ public:
virtual void set_edit_state(const Variant &p_state) = 0;
virtual void goto_line(int p_line, bool p_with_error = false) = 0;
virtual void trim_trailing_whitespace() = 0;
+ virtual void convert_indent_to_spaces() = 0;
+ virtual void convert_indent_to_tabs() = 0;
virtual void ensure_focus() = 0;
virtual void tag_saved_version() = 0;
virtual void reload(bool p_soft) = 0;
virtual void get_breakpoints(List<int> *p_breakpoints) = 0;
- virtual bool goto_method(const String &p_method) = 0;
virtual void add_callback(const String &p_function, PoolStringArray p_args) = 0;
virtual void update_settings() = 0;
virtual void set_debugger_active(bool p_active) = 0;
virtual bool can_lose_focus_on_node_selection() { return true; }
+ virtual bool show_members_overview() = 0;
+
virtual void set_tooltip_request_func(String p_method, Object *p_obj) = 0;
virtual Control *get_edit_menu() = 0;
+ virtual void clear_edit_menu() = 0;
ScriptEditorBase() {}
};
@@ -110,14 +115,15 @@ typedef ScriptEditorBase *(*CreateScriptEditorFunc)(const Ref<Script> &p_script)
class EditorScriptCodeCompletionCache;
-class ScriptEditor : public VBoxContainer {
+class ScriptEditor : public PanelContainer {
- GDCLASS(ScriptEditor, VBoxContainer);
+ GDCLASS(ScriptEditor, PanelContainer);
EditorNode *editor;
enum {
FILE_NEW,
FILE_OPEN,
+ FILE_OPEN_RECENT,
FILE_SAVE,
FILE_SAVE_AS,
FILE_SAVE_ALL,
@@ -128,6 +134,7 @@ class ScriptEditor : public VBoxContainer {
FILE_CLOSE,
CLOSE_DOCS,
CLOSE_ALL,
+ TOGGLE_SCRIPTS_PANEL,
FILE_TOOL_RELOAD,
FILE_TOOL_RELOAD_SOFT,
DEBUG_NEXT,
@@ -136,6 +143,7 @@ class ScriptEditor : public VBoxContainer {
DEBUG_CONTINUE,
DEBUG_SHOW,
DEBUG_SHOW_KEEP_OPEN,
+ DEBUG_WITH_EXTERNAL_EDITOR,
SEARCH_HELP,
SEARCH_CLASSES,
SEARCH_WEBSITE,
@@ -167,6 +175,8 @@ class ScriptEditor : public VBoxContainer {
Timer *autosave_timer;
uint64_t idle;
+ PopupMenu *recent_scripts;
+
Button *help_search;
Button *site_search;
Button *class_search;
@@ -174,6 +184,9 @@ class ScriptEditor : public VBoxContainer {
ItemList *script_list;
HSplitContainer *script_split;
+ ItemList *members_overview;
+ bool members_overview_enabled;
+ VSplitContainer *list_split;
TabContainer *tab_container;
EditorFileDialog *file_dialog;
ConfirmationDialog *erase_tab_confirm;
@@ -205,23 +218,29 @@ class ScriptEditor : public VBoxContainer {
Vector<ScriptHistory> history;
int history_pos;
+ Vector<String> previous_scripts;
+
EditorHelpIndex *help_index;
void _tab_changed(int p_which);
- void _menu_option(int p_optin);
+ void _menu_option(int p_option);
Tree *disk_changed_list;
ConfirmationDialog *disk_changed;
bool restoring_layout;
- String _get_debug_tooltip(const String &p_text, Node *_ste);
+ String _get_debug_tooltip(const String &p_text, Node *_se);
void _resave_scripts(const String &p_str);
void _reload_scripts();
bool _test_script_times_on_disk(Ref<Script> p_for_script = Ref<Script>());
+ void _add_recent_script(String p_path);
+ void _update_recent_scripts();
+ void _open_recent_script(int p_idx);
+
void _close_tab(int p_idx, bool p_save = true);
void _close_current_tab();
@@ -251,6 +270,8 @@ class ScriptEditor : public VBoxContainer {
void _res_saved_callback(const Ref<Resource> &p_res);
bool trim_trailing_whitespace_on_save;
+ bool use_space_indentation;
+ bool convert_indent_on_save;
void _trim_trailing_whitespace(TextEdit *tx);
@@ -265,8 +286,11 @@ class ScriptEditor : public VBoxContainer {
void _editor_settings_changed();
void _autosave_scripts();
+ void _update_members_overview_visibility();
+ void _update_members_overview();
void _update_script_names();
+ void _members_overview_selected(int p_idx);
void _script_selected(int p_idx);
void _find_scripts(Node *p_base, Node *p_current, Set<Ref<Script> > &used);
@@ -275,9 +299,10 @@ class ScriptEditor : public VBoxContainer {
void _script_split_dragged(float);
- void _unhandled_input(const InputEvent &p_event);
+ void _unhandled_input(const Ref<InputEvent> &p_event);
void _help_search(String p_text);
+ void _help_index(String p_text);
void _history_forward();
void _history_back();
@@ -296,6 +321,9 @@ class ScriptEditor : public VBoxContainer {
int file_dialog_option;
void _file_dialog_action(String p_file);
+ Ref<Script> _get_current_script();
+ Array _get_open_scripts() const;
+
static void _open_script_request(const String &p_path);
static ScriptEditor *script_editor;
@@ -311,7 +339,9 @@ public:
void apply_scripts() const;
void ensure_select_current();
- void edit(const Ref<Script> &p_script, bool p_grab_focus = true);
+
+ _FORCE_INLINE_ bool edit(const Ref<Script> &p_script, bool p_grab_focus = true) { return edit(p_script, -1, 0, p_grab_focus); }
+ bool edit(const Ref<Script> &p_script, int p_line, int p_col, bool p_grab_focus = true);
Dictionary get_state() const;
void set_state(const Dictionary &p_state);
@@ -327,17 +357,23 @@ public:
void get_window_layout(Ref<ConfigFile> p_layout);
void set_scene_root_script(Ref<Script> p_script);
+ Vector<Ref<Script> > get_open_scripts() const;
- bool script_go_to_method(Ref<Script> p_script, const String &p_method);
+ bool script_goto_method(Ref<Script> p_script, const String &p_method);
virtual void edited_scene_changed();
+ void notify_script_close(const Ref<Script> &p_script);
+ void notify_script_changed(const Ref<Script> &p_script);
+
void close_builtin_scripts_from_scene(const String &p_scene);
void goto_help(const String &p_desc) { _help_class_goto(p_desc); }
bool can_take_away_focus() const;
+ VSplitContainer *get_left_list_split() { return list_split; }
+
ScriptEditorDebugger *get_debugger() { return debugger; }
void set_live_auto_reload_running_scripts(bool p_enabled);
@@ -356,8 +392,8 @@ class ScriptEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "Script"; }
bool has_main_screen() const { return true; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
virtual void selected_notify();
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 7496ad8cca..422c656351 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -68,26 +69,6 @@ Ref<Script> ScriptTextEditor::get_edited_script() const {
return script;
}
-bool ScriptTextEditor::goto_method(const String &p_method) {
-
- Vector<String> functions = get_functions();
-
- String method_search = p_method + ":";
-
- for (int i = 0; i < functions.size(); i++) {
- String function = functions[i];
-
- if (function.begins_with(method_search)) {
-
- int line = function.get_slice(":", 1).to_int();
- goto_line(line - 1);
- return true;
- }
- }
-
- return false;
-}
-
void ScriptTextEditor::_load_theme_settings() {
TextEdit *text_edit = code_editor->get_text_edit();
@@ -143,7 +124,6 @@ void ScriptTextEditor::_load_theme_settings() {
text_edit->add_keyword_color("Transform", basetype_color);
text_edit->add_keyword_color("Color", basetype_color);
text_edit->add_keyword_color("Image", basetype_color);
- text_edit->add_keyword_color("InputEvent", basetype_color);
text_edit->add_keyword_color("Rect2", basetype_color);
text_edit->add_keyword_color("NodePath", basetype_color);
@@ -238,6 +218,10 @@ void ScriptTextEditor::add_callback(const String &p_function, PoolStringArray p_
code_editor->get_text_edit()->cursor_set_column(1);
}
+bool ScriptTextEditor::show_members_overview() {
+ return true;
+}
+
void ScriptTextEditor::update_settings() {
code_editor->update_editor_settings();
@@ -259,6 +243,48 @@ Variant ScriptTextEditor::get_edit_state() {
return state;
}
+void ScriptTextEditor::_convert_case(CaseStyle p_case) {
+ TextEdit *te = code_editor->get_text_edit();
+ Ref<Script> scr = get_edited_script();
+ if (scr.is_null()) {
+ return;
+ }
+
+ if (te->is_selection_active()) {
+ te->begin_complex_operation();
+
+ int begin = te->get_selection_from_line();
+ int end = te->get_selection_to_line();
+ int begin_col = te->get_selection_from_column();
+ int end_col = te->get_selection_to_column();
+
+ for (int i = begin; i <= end; i++) {
+ String new_line = te->get_line(i);
+
+ switch (p_case) {
+ case UPPER: {
+ new_line = new_line.to_upper();
+ } break;
+ case LOWER: {
+ new_line = new_line.to_lower();
+ } break;
+ case CAPITALIZE: {
+ new_line = new_line.capitalize();
+ } break;
+ }
+
+ if (i == begin) {
+ new_line = te->get_line(i).left(begin_col) + new_line.right(begin_col);
+ }
+ if (i == end) {
+ new_line = new_line.left(end_col) + te->get_line(i).right(end_col);
+ }
+ te->set_line(i, new_line);
+ }
+ te->end_complex_operation();
+ }
+}
+
void ScriptTextEditor::trim_trailing_whitespace() {
TextEdit *tx = code_editor->get_text_edit();
@@ -289,13 +315,120 @@ void ScriptTextEditor::trim_trailing_whitespace() {
}
}
+void ScriptTextEditor::convert_indent_to_spaces() {
+ TextEdit *tx = code_editor->get_text_edit();
+ Ref<Script> scr = get_edited_script();
+
+ if (scr.is_null()) {
+ return;
+ }
+
+ int indent_size = EditorSettings::get_singleton()->get("text_editor/indent/size");
+ String indent = "";
+
+ for (int i = 0; i < indent_size; i++) {
+ indent += " ";
+ }
+
+ int cursor_line = tx->cursor_get_line();
+ int cursor_column = tx->cursor_get_column();
+
+ bool changed_indentation = false;
+ for (int i = 0; i < tx->get_line_count(); i++) {
+ String line = tx->get_line(i);
+
+ if (line.length() <= 0) {
+ continue;
+ }
+
+ int j = 0;
+ while (j < line.length() && (line[j] == ' ' || line[j] == '\t')) {
+ if (line[j] == '\t') {
+ if (!changed_indentation) {
+ tx->begin_complex_operation();
+ changed_indentation = true;
+ }
+ if (cursor_line == i && cursor_column > j) {
+ cursor_column += indent_size - 1;
+ }
+ line = line.left(j) + indent + line.right(j + 1);
+ }
+ j++;
+ }
+ if (changed_indentation) {
+ tx->set_line(i, line);
+ }
+ }
+ if (changed_indentation) {
+ tx->cursor_set_column(cursor_column);
+ tx->end_complex_operation();
+ tx->update();
+ }
+}
+
+void ScriptTextEditor::convert_indent_to_tabs() {
+ TextEdit *tx = code_editor->get_text_edit();
+ Ref<Script> scr = get_edited_script();
+
+ if (scr.is_null()) {
+ return;
+ }
+
+ int indent_size = EditorSettings::get_singleton()->get("text_editor/indent/size");
+ indent_size -= 1;
+
+ int cursor_line = tx->cursor_get_line();
+ int cursor_column = tx->cursor_get_column();
+
+ bool changed_indentation = false;
+ for (int i = 0; i < tx->get_line_count(); i++) {
+ String line = tx->get_line(i);
+
+ if (line.length() <= 0) {
+ continue;
+ }
+
+ int j = 0;
+ int space_count = -1;
+ while (j < line.length() && (line[j] == ' ' || line[j] == '\t')) {
+ if (line[j] != '\t') {
+ space_count++;
+
+ if (space_count == indent_size) {
+ if (!changed_indentation) {
+ tx->begin_complex_operation();
+ changed_indentation = true;
+ }
+ if (cursor_line == i && cursor_column > j) {
+ cursor_column -= indent_size;
+ }
+ line = line.left(j - indent_size) + "\t" + line.right(j + 1);
+ j = 0;
+ space_count = -1;
+ }
+ } else {
+ space_count = -1;
+ }
+ j++;
+ }
+ if (changed_indentation) {
+ tx->set_line(i, line);
+ }
+ }
+ if (changed_indentation) {
+ tx->cursor_set_column(cursor_column);
+ tx->end_complex_operation();
+ tx->update();
+ }
+}
+
void ScriptTextEditor::tag_saved_version() {
code_editor->get_text_edit()->tag_saved_version();
}
void ScriptTextEditor::goto_line(int p_line, bool p_with_error) {
- code_editor->get_text_edit()->cursor_set_line(p_line);
+ code_editor->get_text_edit()->call_deferred("cursor_set_line", p_line);
}
void ScriptTextEditor::ensure_focus() {
@@ -327,7 +460,7 @@ String ScriptTextEditor::get_name() {
} else if (script->get_name() != "")
name = script->get_name();
else
- name = script->get_class() + "(" + itos(script->get_instance_ID()) + ")";
+ name = script->get_class() + "(" + itos(script->get_instance_id()) + ")";
return name;
}
@@ -428,6 +561,8 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo
if (!bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor")))
return;
+ ERR_FAIL_COND(!get_tree());
+
Set<Ref<Script> > scripts;
Node *base = get_tree()->get_edited_scene_root();
@@ -503,7 +638,17 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c
}
ScriptLanguage::LookupResult result;
- if (script->get_language()->lookup_code(code_editor->get_text_edit()->get_text_for_lookup_completion(), p_symbol, script->get_path().get_base_dir(), base, result) == OK) {
+ if (p_symbol.is_resource_file()) {
+ List<String> scene_extensions;
+ ResourceLoader::get_recognized_extensions_for_type("PackedScene", &scene_extensions);
+
+ if (scene_extensions.find(p_symbol.get_extension())) {
+ EditorNode::get_singleton()->load_scene(p_symbol);
+ } else {
+ EditorNode::get_singleton()->load_resource(p_symbol);
+ }
+
+ } else if (script->get_language()->lookup_code(code_editor->get_text_edit()->get_text_for_lookup_completion(), p_symbol, script->get_path().get_base_dir(), base, result) == OK) {
_goto_line(p_row);
@@ -826,10 +971,24 @@ void ScriptTextEditor::_edit_option(int p_op) {
case EDIT_TRIM_TRAILING_WHITESAPCE: {
trim_trailing_whitespace();
} break;
+ case EDIT_CONVERT_INDENT_TO_SPACES: {
+ convert_indent_to_spaces();
+ } break;
+ case EDIT_CONVERT_INDENT_TO_TABS: {
+ convert_indent_to_tabs();
+ } break;
case EDIT_PICK_COLOR: {
color_panel->popup();
} break;
-
+ case EDIT_TO_UPPERCASE: {
+ _convert_case(UPPER);
+ } break;
+ case EDIT_TO_LOWERCASE: {
+ _convert_case(LOWER);
+ } break;
+ case EDIT_CAPITALIZE: {
+ _convert_case(CAPITALIZE);
+ } break;
case SEARCH_FIND: {
code_editor->get_find_replace_bar()->popup_search();
@@ -948,6 +1107,10 @@ Control *ScriptTextEditor::get_edit_menu() {
return edit_hb;
}
+void ScriptTextEditor::clear_edit_menu() {
+ memdelete(edit_hb);
+}
+
void ScriptTextEditor::reload(bool p_soft) {
TextEdit *te = code_editor->get_text_edit();
@@ -1087,15 +1250,18 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
}
}
-void ScriptTextEditor::_text_edit_gui_input(const InputEvent &ev) {
- if (ev.type == InputEvent::MOUSE_BUTTON) {
- InputEventMouseButton mb = ev.mouse_button;
- if (mb.button_index == BUTTON_RIGHT && !mb.pressed) {
+void ScriptTextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) {
+
+ Ref<InputEventMouseButton> mb = ev;
+
+ if (mb.is_valid()) {
+
+ if (mb->get_button_index() == BUTTON_RIGHT && !mb->is_pressed()) {
int col, row;
TextEdit *tx = code_editor->get_text_edit();
- tx->_get_mouse_pos(Point2i(mb.global_x, mb.global_y) - tx->get_global_pos(), row, col);
- Vector2 mpos = Vector2(mb.global_x, mb.global_y) - tx->get_global_pos();
+ tx->_get_mouse_pos(mb->get_global_position() - tx->get_global_position(), row, col);
+ Vector2 mpos = mb->get_global_position() - tx->get_global_position();
bool have_selection = (tx->get_selection_text().length() > 0);
bool have_color = (tx->get_word_at_pos(mpos) == "Color");
if (have_color) {
@@ -1123,9 +1289,7 @@ void ScriptTextEditor::_text_edit_gui_input(const InputEvent &ev) {
float alpha = color.size() > 3 ? color[3] : 1.0f;
color_picker->set_pick_color(Color(color[0], color[1], color[2], alpha));
}
- color_panel->set_pos(get_global_transform().xform(get_local_mouse_pos()));
- Size2 ms = Size2(300, color_picker->get_combined_minimum_size().height + 10);
- color_panel->set_size(ms);
+ color_panel->set_position(get_global_transform().xform(get_local_mouse_pos()));
} else {
have_color = false;
}
@@ -1173,7 +1337,7 @@ void ScriptTextEditor::_make_context_menu(bool p_selection, bool p_color) {
context_menu->add_separator();
context_menu->add_item(TTR("Pick Color"), EDIT_PICK_COLOR);
}
- context_menu->set_pos(get_global_transform().xform(get_local_mouse_pos()));
+ context_menu->set_position(get_global_transform().xform(get_local_mouse_pos()));
context_menu->set_size(Vector2(1, 1));
context_menu->popup();
}
@@ -1182,6 +1346,7 @@ ScriptTextEditor::ScriptTextEditor() {
code_editor = memnew(CodeTextEditor);
add_child(code_editor);
+ code_editor->add_constant_override("separation", 0);
code_editor->set_area_as_parent_rect();
code_editor->connect("validate_script", this, "_validate_script");
code_editor->connect("load_theme_settings", this, "_load_theme_settings");
@@ -1207,7 +1372,6 @@ ScriptTextEditor::ScriptTextEditor() {
add_child(color_panel);
color_picker = memnew(ColorPicker);
color_panel->add_child(color_picker);
- color_panel->set_child_rect(color_picker); //NOT
color_picker->connect("color_changed", this, "_color_changed");
edit_hb = memnew(HBoxContainer);
@@ -1236,6 +1400,8 @@ ScriptTextEditor::ScriptTextEditor() {
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/complete_symbol"), EDIT_COMPLETE);
#endif
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/trim_trailing_whitespace"), EDIT_TRIM_TRAILING_WHITESAPCE);
+ edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_indent_to_spaces"), EDIT_CONVERT_INDENT_TO_SPACES);
+ edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_indent_to_tabs"), EDIT_CONVERT_INDENT_TO_TABS);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/auto_indent"), EDIT_AUTO_INDENT);
edit_menu->get_popup()->connect("id_pressed", this, "_edit_option");
edit_menu->get_popup()->add_separator();
@@ -1243,6 +1409,15 @@ ScriptTextEditor::ScriptTextEditor() {
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_breakpoints"), DEBUG_REMOVE_ALL_BREAKPOINTS);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_breakpoint"), DEBUG_GOTO_NEXT_BREAKPOINT);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_breakpoint"), DEBUG_GOTO_PREV_BREAKPOINT);
+ edit_menu->get_popup()->add_separator();
+ PopupMenu *convert_case = memnew(PopupMenu);
+ convert_case->set_name("convert_case");
+ edit_menu->get_popup()->add_child(convert_case);
+ edit_menu->get_popup()->add_submenu_item(TTR("Convert Case"), "convert_case");
+ convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/convert_to_uppercase", TTR("Uppercase")), EDIT_TO_UPPERCASE);
+ convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/convert_to_lowercase", TTR("Lowercase")), EDIT_TO_LOWERCASE);
+ convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize")), EDIT_CAPITALIZE);
+ convert_case->connect("id_pressed", this, "_edit_option");
search_menu = memnew(MenuButton);
edit_hb->add_child(search_menu);
@@ -1304,6 +1479,8 @@ void ScriptTextEditor::register_editor() {
ED_SHORTCUT("script_text_editor/complete_symbol", TTR("Complete Symbol"), KEY_MASK_CMD | KEY_SPACE);
#endif
ED_SHORTCUT("script_text_editor/trim_trailing_whitespace", TTR("Trim Trailing Whitespace"), KEY_MASK_CTRL | KEY_MASK_ALT | KEY_T);
+ ED_SHORTCUT("script_text_editor/convert_indent_to_spaces", TTR("Convert Indent To Spaces"), KEY_MASK_CTRL | KEY_MASK_SHIFT | KEY_Y);
+ ED_SHORTCUT("script_text_editor/convert_indent_to_tabs", TTR("Convert Indent To Tabs"), KEY_MASK_CTRL | KEY_MASK_SHIFT | KEY_X);
ED_SHORTCUT("script_text_editor/auto_indent", TTR("Auto Indent"), KEY_MASK_CMD | KEY_I);
ED_SHORTCUT("script_text_editor/toggle_breakpoint", TTR("Toggle Breakpoint"), KEY_F9);
@@ -1311,6 +1488,10 @@ void ScriptTextEditor::register_editor() {
ED_SHORTCUT("script_text_editor/goto_next_breakpoint", TTR("Goto Next Breakpoint"), KEY_MASK_CTRL | KEY_PERIOD);
ED_SHORTCUT("script_text_editor/goto_previous_breakpoint", TTR("Goto Previous Breakpoint"), KEY_MASK_CTRL | KEY_COMMA);
+ ED_SHORTCUT("script_text_editor/convert_to_uppercase", TTR("Convert To Uppercase"), KEY_MASK_SHIFT | KEY_F4);
+ ED_SHORTCUT("script_text_editor/convert_to_lowercase", TTR("Convert To Lowercase"), KEY_MASK_SHIFT | KEY_F3);
+ ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize"), KEY_MASK_SHIFT | KEY_F2);
+
ED_SHORTCUT("script_text_editor/find", TTR("Find.."), KEY_MASK_CMD | KEY_F);
ED_SHORTCUT("script_text_editor/find_next", TTR("Find Next"), KEY_F3);
ED_SHORTCUT("script_text_editor/find_previous", TTR("Find Previous"), KEY_MASK_SHIFT | KEY_F3);
diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h
index c5f65fb1db..e55847832f 100644
--- a/editor/plugins/script_text_editor.h
+++ b/editor/plugins/script_text_editor.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -66,6 +67,8 @@ class ScriptTextEditor : public ScriptEditorBase {
EDIT_COMPLETE,
EDIT_AUTO_INDENT,
EDIT_TRIM_TRAILING_WHITESAPCE,
+ EDIT_CONVERT_INDENT_TO_SPACES,
+ EDIT_CONVERT_INDENT_TO_TABS,
EDIT_TOGGLE_COMMENT,
EDIT_MOVE_LINE_UP,
EDIT_MOVE_LINE_DOWN,
@@ -73,6 +76,9 @@ class ScriptTextEditor : public ScriptEditorBase {
EDIT_INDENT_LEFT,
EDIT_CLONE_DOWN,
EDIT_PICK_COLOR,
+ EDIT_TO_UPPERCASE,
+ EDIT_TO_LOWERCASE,
+ EDIT_CAPITALIZE,
SEARCH_FIND,
SEARCH_FIND_NEXT,
SEARCH_FIND_PREV,
@@ -100,12 +106,19 @@ protected:
void _edit_option(int p_op);
void _make_context_menu(bool p_selection, bool p_color);
- void _text_edit_gui_input(const InputEvent &ev);
+ void _text_edit_gui_input(const Ref<InputEvent> &ev);
void _color_changed(const Color &p_color);
void _goto_line(int p_line) { goto_line(p_line); }
void _lookup_symbol(const String &p_symbol, int p_row, int p_column);
+ enum CaseStyle {
+ UPPER,
+ LOWER,
+ CAPITALIZE,
+ };
+ void _convert_case(CaseStyle p_case);
+
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);
@@ -124,6 +137,8 @@ public:
virtual void set_edit_state(const Variant &p_state);
virtual void ensure_focus();
virtual void trim_trailing_whitespace();
+ virtual void convert_indent_to_spaces();
+ virtual void convert_indent_to_tabs();
virtual void tag_saved_version();
virtual void goto_line(int p_line, bool p_with_error = false);
@@ -133,14 +148,15 @@ public:
virtual void add_callback(const String &p_function, PoolStringArray p_args);
virtual void update_settings();
- virtual bool goto_method(const String &p_method);
+
+ virtual bool show_members_overview();
virtual void set_tooltip_request_func(String p_method, Object *p_obj);
virtual void set_debugger_active(bool p_active);
Control *get_edit_menu();
-
+ virtual void clear_edit_menu();
static void register_editor();
ScriptTextEditor();
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index 11dfb7b910..bad88979ac 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -137,14 +138,35 @@ void ShaderTextEditor::_load_theme_settings() {
}*/
}
+void ShaderTextEditor::_check_shader_mode() {
+
+ String type = ShaderLanguage::get_shader_type(get_text_edit()->get_text());
+
+ print_line("type is: " + type);
+ Shader::Mode mode;
+
+ if (type == "canvas_item") {
+ mode = Shader::MODE_CANVAS_ITEM;
+ } else if (type == "particles") {
+ mode = Shader::MODE_PARTICLES;
+ } else {
+ mode = Shader::MODE_SPATIAL;
+ }
+
+ if (shader->get_mode() != mode) {
+ shader->set_code(get_text_edit()->get_text());
+ _load_theme_settings();
+ }
+}
+
void ShaderTextEditor::_code_complete_script(const String &p_code, List<String> *r_options) {
- print_line("code complete");
+ _check_shader_mode();
ShaderLanguage sl;
String calltip;
- Error err = sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), r_options, calltip);
+ Error err = sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip);
if (calltip != "") {
get_text_edit()->set_code_hint(calltip);
@@ -153,18 +175,20 @@ void ShaderTextEditor::_code_complete_script(const String &p_code, List<String>
void ShaderTextEditor::_validate_script() {
+ _check_shader_mode();
+
String code = get_text_edit()->get_text();
//List<StringName> params;
//shader->get_param_list(&params);
ShaderLanguage sl;
- Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())));
+ Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types());
if (err != OK) {
String error_text = "error(" + itos(sl.get_error_line()) + "): " + sl.get_error_text();
set_error(error_text);
- get_text_edit()->set_line_as_marked(sl.get_error_line(), true);
+ get_text_edit()->set_line_as_marked(sl.get_error_line() - 1, true);
} else {
for (int i = 0; i < get_text_edit()->get_line_count(); i++)
@@ -346,7 +370,8 @@ void ShaderEditor::_editor_settings_changed() {
shader_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/completion/auto_brace_complete"));
shader_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/cursor/scroll_past_end_of_file"));
- shader_editor->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/indent/tab_size"));
+ shader_editor->get_text_edit()->set_indent_size(EditorSettings::get_singleton()->get("text_editor/indent/size"));
+ shader_editor->get_text_edit()->set_indent_using_spaces(EditorSettings::get_singleton()->get("text_editor/indent/type"));
shader_editor->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/indent/draw_tabs"));
shader_editor->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_line_numbers"));
shader_editor->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/highlighting/syntax_highlighting"));
@@ -421,7 +446,7 @@ ShaderEditor::ShaderEditor() {
edit_menu = memnew(MenuButton);
hbc->add_child(edit_menu);
- edit_menu->set_pos(Point2(5, -1));
+ edit_menu->set_position(Point2(5, -1));
edit_menu->set_text(TTR("Edit"));
edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/undo", TTR("Undo"), KEY_MASK_CMD | KEY_Z), EDIT_UNDO);
edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/redo", TTR("Redo"), KEY_MASK_CMD | KEY_Y), EDIT_REDO);
@@ -435,7 +460,7 @@ ShaderEditor::ShaderEditor() {
search_menu = memnew(MenuButton);
hbc->add_child(search_menu);
- search_menu->set_pos(Point2(38, -1));
+ search_menu->set_position(Point2(38, -1));
search_menu->set_text(TTR("Search"));
search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find.."), KEY_MASK_CMD | KEY_F), SEARCH_FIND);
search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_next", TTR("Find Next"), KEY_F3), SEARCH_FIND_NEXT);
@@ -527,7 +552,8 @@ ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node) {
shader_editor = memnew(ShaderEditor);
shader_editor->set_custom_minimum_size(Size2(0, 300));
- button = editor->add_bottom_panel_item("Shader", shader_editor);
+ button = editor->add_bottom_panel_item(TTR("Shader"), shader_editor);
+ button->hide();
}
ShaderEditorPlugin::~ShaderEditorPlugin() {
diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h
index 4a56c14ecb..8625267a63 100644
--- a/editor/plugins/shader_editor_plugin.h
+++ b/editor/plugins/shader_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -44,6 +45,8 @@ class ShaderTextEditor : public CodeTextEditor {
Ref<Shader> shader;
+ void _check_shader_mode();
+
protected:
static void _bind_methods();
virtual void _load_theme_settings();
@@ -89,7 +92,7 @@ class ShaderEditor : public VBoxContainer {
ShaderTextEditor *shader_editor;
- void _menu_option(int p_optin);
+ void _menu_option(int p_option);
void _params_changed();
mutable Ref<Shader> shader;
@@ -127,8 +130,8 @@ class ShaderEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "Shader"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
virtual void selected_notify();
diff --git a/editor/plugins/shader_graph_editor_plugin.cpp b/editor/plugins/shader_graph_editor_plugin.cpp
index bff7dece20..5506c035ec 100644
--- a/editor/plugins/shader_graph_editor_plugin.cpp
+++ b/editor/plugins/shader_graph_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -39,7 +40,7 @@
void GraphColorRampEdit::_gui_input(const InputEvent& p_event) {
- if (p_event.type==InputEvent::KEY && p_event.key.pressed && p_event.key.scancode==KEY_DELETE && grabbed!=-1) {
+ if (p_event.type==InputEvent::KEY && p_event->is_pressed() && p_event->get_scancode()==KEY_DELETE && grabbed!=-1) {
points.remove(grabbed);
grabbed=-1;
@@ -48,10 +49,10 @@ void GraphColorRampEdit::_gui_input(const InputEvent& p_event) {
accept_event();
}
- if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==1 && p_event.mouse_button.pressed) {
+ if (p_event.type==InputEvent::MOUSE_BUTTON && p_event->get_button_index()==1 && p_event->is_pressed()) {
update();
- int x = p_event.mouse_button.x;
+ int x = p_event->get_pos().x;
int total_w = get_size().width-get_size().height-3;
if (x>total_w+3) {
@@ -59,7 +60,7 @@ void GraphColorRampEdit::_gui_input(const InputEvent& p_event) {
return;
Size2 ms = Size2(350, picker->get_combined_minimum_size().height+10);
picker->set_color(points[grabbed].color);
- popup->set_pos(get_global_pos()-Size2(0,ms.height));
+ popup->set_position(get_global_position()-Size2(0,ms.height));
popup->set_size(ms);
popup->popup();
return;
@@ -131,7 +132,7 @@ void GraphColorRampEdit::_gui_input(const InputEvent& p_event) {
}
- if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==1 && !p_event.mouse_button.pressed) {
+ if (p_event.type==InputEvent::MOUSE_BUTTON && p_event->get_button_index()==1 && !p_event->is_pressed()) {
if (grabbing) {
grabbing=false;
@@ -318,7 +319,7 @@ GraphColorRampEdit::GraphColorRampEdit(){
void GraphCurveMapEdit::_gui_input(const InputEvent& p_event) {
- if (p_event.type==InputEvent::KEY && p_event.key.pressed && p_event.key.scancode==KEY_DELETE && grabbed!=-1) {
+ if (p_event.type==InputEvent::KEY && p_event->is_pressed() && p_event->get_scancode()==KEY_DELETE && grabbed!=-1) {
points.remove(grabbed);
grabbed=-1;
@@ -327,10 +328,10 @@ void GraphCurveMapEdit::_gui_input(const InputEvent& p_event) {
accept_event();
}
- if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==1 && p_event.mouse_button.pressed) {
+ if (p_event.type==InputEvent::MOUSE_BUTTON && p_event->get_button_index()==1 && p_event->is_pressed()) {
update();
- Point2 p = Vector2(p_event.mouse_button.x,p_event.mouse_button.y)/get_size();
+ Point2 p = Vector2(p_event->get_pos().x,p_event->get_pos().y)/get_size();
p.y=1.0-p.y;
grabbed=-1;
grabbing=true;
@@ -370,7 +371,7 @@ void GraphCurveMapEdit::_gui_input(const InputEvent& p_event) {
}
- if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==1 && !p_event.mouse_button.pressed) {
+ if (p_event.type==InputEvent::MOUSE_BUTTON && p_event->get_button_index()==1 && !p_event->is_pressed()) {
if (grabbing) {
grabbing=false;
@@ -381,7 +382,7 @@ void GraphCurveMapEdit::_gui_input(const InputEvent& p_event) {
if (p_event.type==InputEvent::MOUSE_MOTION && grabbing && grabbed != -1) {
- Point2 p = Vector2(p_event.mouse_button.x,p_event.mouse_button.y)/get_size();
+ Point2 p = Vector2(p_event->get_pos().x,p_event->get_pos().y)/get_size();
p.y=1.0-p.y;
p.x = CLAMP(p.x,0.0,1.0);
@@ -839,7 +840,7 @@ void ShaderGraphView::_xform_input_changed(int p_id, Node *p_button){
ToolButton *tb = p_button->cast_to<ToolButton>();
- ped_popup->set_pos(tb->get_global_pos()+Vector2(0,tb->get_size().height));
+ ped_popup->set_position(tb->get_global_position()+Vector2(0,tb->get_size().height));
ped_popup->set_size(tb->get_size());
edited_id=p_id;
edited_def=-1;
@@ -850,7 +851,7 @@ void ShaderGraphView::_xform_input_changed(int p_id, Node *p_button){
void ShaderGraphView::_xform_const_changed(int p_id, Node *p_button){
ToolButton *tb = p_button->cast_to<ToolButton>();
- ped_popup->set_pos(tb->get_global_pos()+Vector2(0,tb->get_size().height));
+ ped_popup->set_position(tb->get_global_position()+Vector2(0,tb->get_size().height));
ped_popup->set_size(tb->get_size());
edited_id=p_id;
edited_def=-1;
@@ -1074,7 +1075,7 @@ void ShaderGraphView::_input_name_changed(const String& p_name, int p_id, Node *
void ShaderGraphView::_tex_edited(int p_id,Node* p_button) {
ToolButton *tb = p_button->cast_to<ToolButton>();
- ped_popup->set_pos(tb->get_global_pos()+Vector2(0,tb->get_size().height));
+ ped_popup->set_position(tb->get_global_position()+Vector2(0,tb->get_size().height));
ped_popup->set_size(tb->get_size());
edited_id=p_id;
edited_def=-1;
@@ -1084,7 +1085,7 @@ void ShaderGraphView::_tex_edited(int p_id,Node* p_button) {
void ShaderGraphView::_cube_edited(int p_id,Node* p_button) {
ToolButton *tb = p_button->cast_to<ToolButton>();
- ped_popup->set_pos(tb->get_global_pos()+Vector2(0,tb->get_size().height));
+ ped_popup->set_position(tb->get_global_position()+Vector2(0,tb->get_size().height));
ped_popup->set_size(tb->get_size());
edited_id=p_id;
edited_def=-1;
@@ -1299,7 +1300,7 @@ void ShaderGraphView::_delete_nodes_request()
void ShaderGraphView::_default_changed(int p_id, Node *p_button, int p_param, int v_type, String p_hint)
{
ToolButton *tb = p_button->cast_to<ToolButton>();
- ped_popup->set_pos(tb->get_global_pos()+Vector2(0,tb->get_size().height));
+ ped_popup->set_position(tb->get_global_position()+Vector2(0,tb->get_size().height));
ped_popup->set_size(tb->get_size());
edited_id=p_id;
edited_def=p_param;
@@ -1381,7 +1382,7 @@ ToolButton *ShaderGraphView::make_editor(String text,GraphNode* gn,int p_id,int
Color c = graph->default_get_value(type,p_id,param);
for (int x=1;x<14;x++)
for (int y=1;y<14;y++)
- icon_color.put_pixel(x,y,c);
+ icon_color.set_pixel(x,y,c);
Ref<ImageTexture> t;
t.instance();
t->create_from_image(icon_color);
@@ -2750,7 +2751,7 @@ ShaderGraphView::ShaderGraphView(ShaderGraph::ShaderType p_type) {
graph_edit->get_top_layer()->add_child(status);
graph_edit->connect("_begin_node_move", this, "_begin_node_move");
graph_edit->connect("_end_node_move", this, "_end_node_move");
- status->set_pos(Vector2(5,5));
+ status->set_position(Vector2(5,5));
status->add_color_override("font_color_shadow",Color(0,0,0));
status->add_color_override("font_color",Color(1,0.4,0.3));
status->add_constant_override("shadow_as_outline",1);
@@ -2778,7 +2779,7 @@ void ShaderGraphEditor::_popup_requested(const Vector2 &p_position)
{
Vector2 scroll_ofs=graph_edits[tabs->get_current_tab()]->get_graph_edit()->get_scroll_ofs();
next_location = get_local_mouse_pos() + scroll_ofs;
- popup->set_global_pos(p_position);
+ popup->set_global_position(p_position);
popup->set_size( Size2( 200, 0) );
popup->popup();
popup->call_deferred("grab_click_focus");
diff --git a/editor/plugins/shader_graph_editor_plugin.h b/editor/plugins/shader_graph_editor_plugin.h
index e5c59f82f4..e7cab50d8d 100644
--- a/editor/plugins/shader_graph_editor_plugin.h
+++ b/editor/plugins/shader_graph_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index c00652bc35..5faacf7a67 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,9 +36,9 @@
#include "editor/editor_settings.h"
#include "editor/plugins/animation_player_editor_plugin.h"
#include "editor/spatial_editor_gizmos.h"
-#include "global_config.h"
#include "os/keyboard.h"
#include "print_string.h"
+#include "project_settings.h"
#include "scene/3d/camera.h"
#include "scene/3d/visual_instance.h"
#include "scene/resources/surface_tool.h"
@@ -50,6 +51,18 @@
//#define GIZMO_SCALE_DEFAULT 0.28
#define GIZMO_SCALE_DEFAULT 0.15
+#define ZOOM_MIN_DISTANCE 0.001
+#define ZOOM_MULTIPLIER 1.08
+#define ZOOM_INDICATOR_DELAY_S 1.5
+
+#define FREELOOK_MIN_SPEED 0.1
+
+#define MIN_Z 0.01
+#define MAX_Z 10000
+
+#define MIN_FOV 0.01
+#define MAX_FOV 179
+
void SpatialEditorViewport::_update_camera() {
if (orthogonal) {
//camera->set_orthogonal(size.width*cursor.distance,get_znear(),get_zfar());
@@ -57,20 +70,26 @@ void SpatialEditorViewport::_update_camera() {
} else
camera->set_perspective(get_fov(), get_znear(), get_zfar());
+ Transform camera_transform = to_camera_transform(cursor);
+
+ if (camera->get_global_transform() != camera_transform) {
+ camera->set_global_transform(camera_transform);
+ update_transform_gizmo_view();
+ }
+}
+
+Transform SpatialEditorViewport::to_camera_transform(const Cursor &p_cursor) const {
Transform camera_transform;
- camera_transform.translate(cursor.pos);
- camera_transform.basis.rotate(Vector3(1, 0, 0), -cursor.x_rot);
- camera_transform.basis.rotate(Vector3(0, 1, 0), -cursor.y_rot);
+ camera_transform.translate(p_cursor.pos);
+ camera_transform.basis.rotate(Vector3(1, 0, 0), -p_cursor.x_rot);
+ camera_transform.basis.rotate(Vector3(0, 1, 0), -p_cursor.y_rot);
if (orthogonal)
camera_transform.translate(0, 0, 4096);
else
- camera_transform.translate(0, 0, cursor.distance);
+ camera_transform.translate(0, 0, p_cursor.distance);
- if (camera->get_global_transform() != camera_transform) {
- camera->set_global_transform(camera_transform);
- update_transform_gizmo_view();
- }
+ return camera_transform;
}
String SpatialEditorGizmo::get_handle_name(int p_idx) const {
@@ -140,26 +159,15 @@ int SpatialEditorViewport::get_selected_count() const {
float SpatialEditorViewport::get_znear() const {
- float val = spatial_editor->get_znear();
- if (val < 0.001)
- val = 0.001;
- return val;
+ return CLAMP(spatial_editor->get_znear(), MIN_Z, MAX_Z);
}
float SpatialEditorViewport::get_zfar() const {
- float val = spatial_editor->get_zfar();
- if (val < 0.001)
- val = 0.001;
- return val;
+ return CLAMP(spatial_editor->get_zfar(), MIN_Z, MAX_Z);
}
float SpatialEditorViewport::get_fov() const {
- float val = spatial_editor->get_fov();
- if (val < 0.001)
- val = 0.001;
- if (val > 89)
- val = 89;
- return val;
+ return CLAMP(spatial_editor->get_fov(), MIN_FOV, MAX_FOV);
}
Transform SpatialEditorViewport::_get_camera_transform() const {
@@ -258,6 +266,9 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append,
float closest_dist = 1e20;
int selected_handle = -1;
+ Vector<Spatial *> subscenes = Vector<Spatial *>();
+ Vector<Vector3> subscenes_positions = Vector<Vector3>();
+
for (int i = 0; i < instances.size(); i++) {
Object *obj = ObjectDB::get_instance(instances[i]);
@@ -271,11 +282,22 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append,
Ref<SpatialEditorGizmo> seg = spat->get_gizmo();
- if (!seg.is_valid())
- continue;
+ if ((!seg.is_valid()) || found_gizmos.has(seg)) {
+
+ Node *subscene_candidate = spat;
+ Vector3 source_click_spatial_pos = spat->get_global_transform().origin;
+
+ while ((subscene_candidate->get_owner() != NULL) && (subscene_candidate->get_owner() != editor->get_edited_scene()))
+ subscene_candidate = subscene_candidate->get_owner();
+
+ spat = subscene_candidate->cast_to<Spatial>();
+ if (spat && (spat->get_filename() != "") && (subscene_candidate->get_owner() != NULL)) {
+ subscenes.push_back(spat);
+ subscenes_positions.push_back(source_click_spatial_pos);
+ }
- if (found_gizmos.has(seg))
continue;
+ }
found_gizmos.insert(seg);
Vector3 point;
@@ -303,6 +325,22 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append,
// r_includes_current=true;
}
+ for (int idx_subscene = 0; idx_subscene < subscenes.size(); idx_subscene++) {
+
+ Spatial *subscene = subscenes.get(idx_subscene);
+ float dist = ray.cross(subscenes_positions.get(idx_subscene) - pos).length();
+
+ if ((dist < 0) || (dist > 1.2))
+ continue;
+
+ if (dist < closest_dist) {
+ closest = subscene->get_instance_id();
+ closest_dist = dist;
+ item = subscene;
+ selected_handle = -1;
+ }
+ }
+
if (!item)
return 0;
@@ -376,7 +414,7 @@ void SpatialEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_incl
results.sort();
}
-Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3 &p_pos) {
+Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3 &p_vector3) {
CameraMatrix cm;
cm.set_perspective(get_fov(), get_size().aspect(), get_znear(), get_zfar());
@@ -389,7 +427,7 @@ Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3 &p_pos) {
camera_transform.basis.rotate(Vector3(0, 1, 0), -cursor.y_rot);
camera_transform.translate(0, 0, cursor.distance);
- return camera_transform.xform(Vector3(((p_pos.x / get_size().width) * 2.0 - 1.0) * screen_w, ((1.0 - (p_pos.y / get_size().height)) * 2.0 - 1.0) * screen_h, -get_znear()));
+ return camera_transform.xform(Vector3(((p_vector3.x / get_size().width) * 2.0 - 1.0) * screen_w, ((1.0 - (p_vector3.y / get_size().height)) * 2.0 - 1.0) * screen_h, -get_znear()));
}
void SpatialEditorViewport::_select_region() {
@@ -505,7 +543,7 @@ void SpatialEditorViewport::_compute_edit(const Point2 &p_point) {
*/
}
-static int _get_key_modifier(const String &p_property) {
+static int _get_key_modifier_setting(const String &p_property) {
switch (EditorSettings::get_singleton()->get(p_property).operator int()) {
@@ -518,13 +556,25 @@ static int _get_key_modifier(const String &p_property) {
return 0;
}
-bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hilite_only) {
+static int _get_key_modifier(Ref<InputEventWithModifiers> e) {
+ if (e->get_shift())
+ return KEY_SHIFT;
+ if (e->get_alt())
+ return KEY_ALT;
+ if (e->get_control())
+ return KEY_CONTROL;
+ if (e->get_metakey())
+ return KEY_META;
+ return 0;
+}
+
+bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_highlight_only) {
if (!spatial_editor->is_gizmo_visible())
return false;
if (get_selected_count() == 0) {
- if (p_hilite_only)
- spatial_editor->select_gizmo_hilight_axis(-1);
+ if (p_highlight_only)
+ spatial_editor->select_gizmo_highlight_axis(-1);
return false;
}
@@ -556,9 +606,9 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hil
if (col_axis != -1) {
- if (p_hilite_only) {
+ if (p_highlight_only) {
- spatial_editor->select_gizmo_hilight_axis(col_axis);
+ spatial_editor->select_gizmo_highlight_axis(col_axis);
} else {
//handle rotate
@@ -596,9 +646,9 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hil
if (col_axis != -1) {
- if (p_hilite_only) {
+ if (p_highlight_only) {
- spatial_editor->select_gizmo_hilight_axis(col_axis + 3);
+ spatial_editor->select_gizmo_highlight_axis(col_axis + 3);
} else {
//handle rotate
_edit.mode = TRANSFORM_ROTATE;
@@ -609,8 +659,8 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hil
}
}
- if (p_hilite_only)
- spatial_editor->select_gizmo_hilight_axis(-1);
+ if (p_highlight_only)
+ spatial_editor->select_gizmo_highlight_axis(-1);
return false;
}
@@ -621,9 +671,9 @@ void SpatialEditorViewport::_smouseenter() {
surface->grab_focus();
}
-void SpatialEditorViewport::_list_select(InputEventMouseButton b) {
+void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
- _find_items_at_pos(Vector2(b.x, b.y), clicked_includes_current, selection_results, b.mod.shift);
+ _find_items_at_pos(b->get_position(), clicked_includes_current, selection_results, b->get_shift());
Node *scene = editor->get_edited_scene();
@@ -636,11 +686,11 @@ void SpatialEditorViewport::_list_select(InputEventMouseButton b) {
}
}
- clicked_wants_append = b.mod.shift;
+ clicked_wants_append = b->get_shift();
if (selection_results.size() == 1) {
- clicked = selection_results[0].item->get_instance_ID();
+ clicked = selection_results[0].item->get_instance_id();
selection_results.clear();
if (clicked) {
@@ -668,877 +718,960 @@ void SpatialEditorViewport::_list_select(InputEventMouseButton b) {
selection_menu->add_item(spat->get_name());
selection_menu->set_item_icon(i, icon);
selection_menu->set_item_metadata(i, node_path);
- selection_menu->set_item_tooltip(i, String(spat->get_name()) +
- "\nType: " + spat->get_class() + "\nPath: " + node_path);
+ selection_menu->set_item_tooltip(i, String(spat->get_name()) + "\nType: " + spat->get_class() + "\nPath: " + node_path);
}
- selection_menu->set_global_pos(Vector2(b.global_x, b.global_y));
+ selection_menu->set_global_position(b->get_global_position());
selection_menu->popup();
selection_menu->call_deferred("grab_click_focus");
selection_menu->set_invalidate_click_until_motion();
}
}
-void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
+void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (previewing)
return; //do NONE
{
-
+ EditorNode *en = editor;
+ EditorPluginList *force_input_forwarding_list = en->get_editor_plugins_force_input_forwarding();
+ if (!force_input_forwarding_list->empty()) {
+ bool discard = force_input_forwarding_list->forward_spatial_gui_input(camera, p_event, true);
+ if (discard)
+ return;
+ }
+ }
+ {
EditorNode *en = editor;
EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
-
if (!over_plugin_list->empty()) {
- bool discard = over_plugin_list->forward_spatial_gui_input(camera, p_event);
+ bool discard = over_plugin_list->forward_spatial_gui_input(camera, p_event, false);
if (discard)
return;
}
}
- switch (p_event.type) {
- case InputEvent::MOUSE_BUTTON: {
-
- const InputEventMouseButton &b = p_event.mouse_button;
+ Ref<InputEventMouseButton> b = p_event;
- switch (b.button_index) {
+ if (b.is_valid()) {
- case BUTTON_WHEEL_UP: {
+ switch (b->get_button_index()) {
- cursor.distance /= 1.08;
- if (cursor.distance < 0.001)
- cursor.distance = 0.001;
+ case BUTTON_WHEEL_UP: {
+ scale_cursor_distance(is_freelook_active() ? ZOOM_MULTIPLIER : 1.0 / ZOOM_MULTIPLIER);
+ } break;
- } break;
- case BUTTON_WHEEL_DOWN: {
+ case BUTTON_WHEEL_DOWN: {
+ scale_cursor_distance(is_freelook_active() ? 1.0 / ZOOM_MULTIPLIER : ZOOM_MULTIPLIER);
+ } break;
- if (cursor.distance < 0.001)
- cursor.distance = 0.001;
- cursor.distance *= 1.08;
+ case BUTTON_RIGHT: {
- } break;
- case BUTTON_RIGHT: {
+ NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int();
- NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int();
+ if (b->is_pressed() && _edit.gizmo.is_valid()) {
+ //restore
+ _edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_initial_value, true);
+ _edit.gizmo = Ref<SpatialEditorGizmo>();
+ }
- if (b.pressed && _edit.gizmo.is_valid()) {
- //restore
- _edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_initial_value, true);
- _edit.gizmo = Ref<SpatialEditorGizmo>();
- }
+ if (_edit.mode == TRANSFORM_NONE && b->is_pressed()) {
- if (_edit.mode == TRANSFORM_NONE && b.pressed) {
+ if (b->get_alt()) {
- Plane cursor_plane(cursor.cursor_pos, _get_camera_normal());
+ if (nav_scheme == NAVIGATION_MAYA)
+ break;
- Vector3 ray_origin = _get_ray_pos(Vector2(b.x, b.y));
- Vector3 ray_dir = _get_ray(Vector2(b.x, b.y));
+ _list_select(b);
+ return;
+ }
+ }
- //gizmo modify
+ if (_edit.mode != TRANSFORM_NONE && b->is_pressed()) {
+ //cancel motion
+ _edit.mode = TRANSFORM_NONE;
+ //_validate_selection();
- if (b.mod.control) {
+ List<Node *> &selection = editor_selection->get_selected_node_list();
- Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(ray_origin, ray_dir, get_tree()->get_root()->get_world()->get_scenario());
+ for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Plane p(ray_origin, _get_camera_normal());
+ Spatial *sp = E->get()->cast_to<Spatial>();
+ if (!sp)
+ continue;
- float min_d = 1e10;
- bool found = false;
+ SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ if (!se)
+ continue;
- for (int i = 0; i < instances.size(); i++) {
+ sp->set_global_transform(se->original);
+ }
+ surface->update();
+ //VisualServer::get_singleton()->poly_clear(indicators);
+ set_message(TTR("Transform Aborted."), 3);
+ }
- Object *obj = ObjectDB::get_instance(instances[i]);
+ if (b->is_pressed()) {
+ int mod = _get_key_modifier(b);
+ if (mod == _get_key_modifier_setting("editors/3d/freelook_activation_modifier")) {
+ freelook_active = true;
+ }
+ } else {
+ freelook_active = false;
+ }
- if (!obj)
- continue;
+ if (freelook_active && !surface->has_focus()) {
+ // Focus usually doesn't trigger on right-click, but in case of freelook it should,
+ // otherwise using keyboard navigation would misbehave
+ surface->grab_focus();
+ }
- VisualInstance *vi = obj->cast_to<VisualInstance>();
- if (!vi)
- continue;
+ } break;
+ case BUTTON_MIDDLE: {
- //optimize by checking AABB (although should pre sort by distance)
- Rect3 aabb = vi->get_global_transform().xform(vi->get_aabb());
- if (p.distance_to(aabb.get_support(-ray_dir)) > min_d)
- continue;
+ if (b->is_pressed() && _edit.mode != TRANSFORM_NONE) {
- PoolVector<Face3> faces = vi->get_faces(VisualInstance::FACES_SOLID);
- int c = faces.size();
- if (c > 0) {
- PoolVector<Face3>::Read r = faces.read();
+ switch (_edit.plane) {
- for (int j = 0; j < c; j++) {
+ case TRANSFORM_VIEW: {
- Vector3 inters;
- if (r[j].intersects_ray(ray_origin, ray_dir, &inters)) {
+ _edit.plane = TRANSFORM_X_AXIS;
+ set_message(TTR("X-Axis Transform."), 2);
+ name = "";
+ _update_name();
+ } break;
+ case TRANSFORM_X_AXIS: {
- float d = p.distance_to(inters);
- if (d < 0)
- continue;
+ _edit.plane = TRANSFORM_Y_AXIS;
+ set_message(TTR("Y-Axis Transform."), 2);
- if (d < min_d) {
- min_d = d;
- found = true;
- }
- }
- }
- }
- }
+ } break;
+ case TRANSFORM_Y_AXIS: {
- if (found) {
+ _edit.plane = TRANSFORM_Z_AXIS;
+ set_message(TTR("Z-Axis Transform."), 2);
- //cursor.cursor_pos=ray_origin+ray_dir*min_d;
- //VisualServer::get_singleton()->instance_set_transform(cursor_instance,Transform(Matrix3(),cursor.cursor_pos));
- }
+ } break;
+ case TRANSFORM_Z_AXIS: {
- } else {
- Vector3 new_pos;
- if (cursor_plane.intersects_ray(ray_origin, ray_dir, &new_pos)) {
+ _edit.plane = TRANSFORM_VIEW;
+ set_message(TTR("View Plane Transform."), 2);
- //cursor.cursor_pos=new_pos;
- //VisualServer::get_singleton()->instance_set_transform(cursor_instance,Transform(Matrix3(),cursor.cursor_pos));
- }
- }
+ } break;
+ }
+ }
+ } break;
+ case BUTTON_LEFT: {
- if (b.mod.alt) {
+ if (b->is_pressed()) {
- if (nav_scheme == NAVIGATION_MAYA)
- break;
+ NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int();
+ if ((nav_scheme == NAVIGATION_MAYA || nav_scheme == NAVIGATION_MODO) && b->get_alt()) {
+ break;
+ }
- _list_select(b);
- return;
- }
+ if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_LIST_SELECT) {
+ _list_select(b);
+ break;
}
- if (_edit.mode != TRANSFORM_NONE && b.pressed) {
- //cancel motion
- _edit.mode = TRANSFORM_NONE;
- //_validate_selection();
+ _edit.mouse_pos = b->get_position();
+ _edit.snap = false;
+ _edit.mode = TRANSFORM_NONE;
- List<Node *> &selection = editor_selection->get_selected_node_list();
+ //gizmo has priority over everything
- for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
+ bool can_select_gizmos = true;
- Spatial *sp = E->get()->cast_to<Spatial>();
- if (!sp)
- continue;
+ {
+ int idx = view_menu->get_popup()->get_item_index(VIEW_GIZMOS);
+ can_select_gizmos = view_menu->get_popup()->is_item_checked(idx);
+ }
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
- if (!se)
- continue;
+ if (can_select_gizmos && spatial_editor->get_selected()) {
+
+ Ref<SpatialEditorGizmo> seg = spatial_editor->get_selected()->get_gizmo();
+ if (seg.is_valid()) {
+ int handle = -1;
+ Vector3 point;
+ Vector3 normal;
+ bool inters = seg->intersect_ray(camera, _edit.mouse_pos, point, normal, &handle, b->get_shift());
+ if (inters && handle != -1) {
- sp->set_global_transform(se->original);
+ _edit.gizmo = seg;
+ _edit.gizmo_handle = handle;
+ //_edit.gizmo_initial_pos=seg->get_handle_pos(gizmo_handle);
+ _edit.gizmo_initial_value = seg->get_handle_value(handle);
+ break;
+ }
}
- surface->update();
- //VisualServer::get_singleton()->poly_clear(indicators);
- set_message(TTR("Transform Aborted."), 3);
}
- } break;
- case BUTTON_MIDDLE: {
- if (b.pressed && _edit.mode != TRANSFORM_NONE) {
+ if (_gizmo_select(_edit.mouse_pos))
+ break;
- switch (_edit.plane) {
+ clicked = 0;
+ clicked_includes_current = false;
- case TRANSFORM_VIEW: {
+ if ((spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT && b->get_control()) || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_ROTATE) {
- _edit.plane = TRANSFORM_X_AXIS;
- set_message(TTR("X-Axis Transform."), 2);
- name = "";
- _update_name();
- } break;
- case TRANSFORM_X_AXIS: {
+ /* HANDLE ROTATION */
+ if (get_selected_count() == 0)
+ break; //bye
+ //handle rotate
+ _edit.mode = TRANSFORM_ROTATE;
+ _compute_edit(b->get_position());
+ break;
+ }
- _edit.plane = TRANSFORM_Y_AXIS;
- set_message(TTR("Y-Axis Transform."), 2);
+ if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_MOVE) {
- } break;
- case TRANSFORM_Y_AXIS: {
+ if (get_selected_count() == 0)
+ break; //bye
+ //handle rotate
+ _edit.mode = TRANSFORM_TRANSLATE;
+ _compute_edit(b->get_position());
+ break;
+ }
- _edit.plane = TRANSFORM_Z_AXIS;
- set_message(TTR("Z-Axis Transform."), 2);
+ if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SCALE) {
- } break;
- case TRANSFORM_Z_AXIS: {
+ if (get_selected_count() == 0)
+ break; //bye
+ //handle rotate
+ _edit.mode = TRANSFORM_SCALE;
+ _compute_edit(b->get_position());
+ break;
+ }
- _edit.plane = TRANSFORM_VIEW;
- set_message(TTR("View Plane Transform."), 2);
+ // todo scale
- } break;
- }
- }
- } break;
- case BUTTON_LEFT: {
+ int gizmo_handle = -1;
- if (b.pressed) {
+ clicked = _select_ray(b->get_position(), b->get_shift(), clicked_includes_current, &gizmo_handle, b->get_shift());
- NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int();
- if ((nav_scheme == NAVIGATION_MAYA || nav_scheme == NAVIGATION_MODO) && b.mod.alt) {
- break;
- }
+ //clicking is always deferred to either move or release
- if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_LIST_SELECT) {
- _list_select(b);
- break;
- }
+ clicked_wants_append = b->get_shift();
- _edit.mouse_pos = Point2(b.x, b.y);
- _edit.snap = false;
- _edit.mode = TRANSFORM_NONE;
+ if (!clicked) {
- //gizmo has priority over everything
+ if (!clicked_wants_append)
+ _clear_selected();
- bool can_select_gizmos = true;
+ //default to regionselect
+ cursor.region_select = true;
+ cursor.region_begin = b->get_position();
+ cursor.region_end = b->get_position();
+ }
- {
- int idx = view_menu->get_popup()->get_item_index(VIEW_GIZMOS);
- can_select_gizmos = view_menu->get_popup()->is_item_checked(idx);
- }
+ if (clicked && gizmo_handle >= 0) {
- if (can_select_gizmos && spatial_editor->get_selected()) {
+ Object *obj = ObjectDB::get_instance(clicked);
+ if (obj) {
- Ref<SpatialEditorGizmo> seg = spatial_editor->get_selected()->get_gizmo();
- if (seg.is_valid()) {
- int handle = -1;
- Vector3 point;
- Vector3 normal;
- bool inters = seg->intersect_ray(camera, _edit.mouse_pos, point, normal, &handle, b.mod.shift);
- if (inters && handle != -1) {
+ Spatial *spa = obj->cast_to<Spatial>();
+ if (spa) {
+
+ Ref<SpatialEditorGizmo> seg = spa->get_gizmo();
+ if (seg.is_valid()) {
_edit.gizmo = seg;
- _edit.gizmo_handle = handle;
+ _edit.gizmo_handle = gizmo_handle;
//_edit.gizmo_initial_pos=seg->get_handle_pos(gizmo_handle);
- _edit.gizmo_initial_value = seg->get_handle_value(handle);
+ _edit.gizmo_initial_value = seg->get_handle_value(gizmo_handle);
+ //print_line("GIZMO: "+itos(gizmo_handle)+" FROMPOS: "+_edit.orig_gizmo_pos);
break;
}
}
}
+ //_compute_edit(Point2(b.x,b.y)); //in case a motion happens..
+ }
- if (_gizmo_select(_edit.mouse_pos))
- break;
+ surface->update();
+ } else {
+
+ if (_edit.gizmo.is_valid()) {
+ _edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_initial_value, false);
+ _edit.gizmo = Ref<SpatialEditorGizmo>();
+ break;
+ }
+ if (clicked) {
+ _select_clicked(clicked_wants_append, true);
+ //clickd processing was deferred
clicked = 0;
- clicked_includes_current = false;
+ }
- if ((spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT && b.mod.control) || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_ROTATE) {
+ if (cursor.region_select) {
+ _select_region();
+ cursor.region_select = false;
+ surface->update();
+ }
- /* HANDLE ROTATION */
- if (get_selected_count() == 0)
- break; //bye
- //handle rotate
- _edit.mode = TRANSFORM_ROTATE;
- _compute_edit(Point2(b.x, b.y));
- break;
- }
+ if (_edit.mode != TRANSFORM_NONE) {
- if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_MOVE) {
+ static const char *_transform_name[4] = { "None", "Rotate", "Translate", "Scale" };
+ undo_redo->create_action(_transform_name[_edit.mode]);
- if (get_selected_count() == 0)
- break; //bye
- //handle rotate
- _edit.mode = TRANSFORM_TRANSLATE;
- _compute_edit(Point2(b.x, b.y));
- break;
- }
+ List<Node *> &selection = editor_selection->get_selected_node_list();
- if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SCALE) {
+ for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- if (get_selected_count() == 0)
- break; //bye
- //handle rotate
- _edit.mode = TRANSFORM_SCALE;
- _compute_edit(Point2(b.x, b.y));
- break;
- }
+ Spatial *sp = E->get()->cast_to<Spatial>();
+ if (!sp)
+ continue;
- // todo scale
+ SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ if (!se)
+ continue;
- int gizmo_handle = -1;
+ undo_redo->add_do_method(sp, "set_global_transform", sp->get_global_transform());
+ undo_redo->add_undo_method(sp, "set_global_transform", se->original);
+ }
+ undo_redo->commit_action();
+ _edit.mode = TRANSFORM_NONE;
+ //VisualServer::get_singleton()->poly_clear(indicators);
+ set_message("");
+ }
- clicked = _select_ray(Vector2(b.x, b.y), b.mod.shift, clicked_includes_current, &gizmo_handle, b.mod.shift);
+ surface->update();
+ }
- //clicking is always deferred to either move or release
+ } break;
+ }
+ }
- clicked_wants_append = b.mod.shift;
+ Ref<InputEventMouseMotion> m = p_event;
- if (!clicked) {
+ if (m.is_valid()) {
- if (!clicked_wants_append)
- _clear_selected();
+ _edit.mouse_pos = m->get_position();
- //default to regionselect
- cursor.region_select = true;
- cursor.region_begin = Point2(b.x, b.y);
- cursor.region_end = Point2(b.x, b.y);
- }
+ if (spatial_editor->get_selected()) {
- if (clicked && gizmo_handle >= 0) {
+ Ref<SpatialEditorGizmo> seg = spatial_editor->get_selected()->get_gizmo();
+ if (seg.is_valid()) {
- Object *obj = ObjectDB::get_instance(clicked);
- if (obj) {
+ int selected_handle = -1;
- Spatial *spa = obj->cast_to<Spatial>();
- if (spa) {
+ int handle = -1;
+ Vector3 point;
+ Vector3 normal;
+ bool inters = seg->intersect_ray(camera, _edit.mouse_pos, point, normal, &handle, false);
+ if (inters && handle != -1) {
- Ref<SpatialEditorGizmo> seg = spa->get_gizmo();
- if (seg.is_valid()) {
+ selected_handle = handle;
+ }
- _edit.gizmo = seg;
- _edit.gizmo_handle = gizmo_handle;
- //_edit.gizmo_initial_pos=seg->get_handle_pos(gizmo_handle);
- _edit.gizmo_initial_value = seg->get_handle_value(gizmo_handle);
- //print_line("GIZMO: "+itos(gizmo_handle)+" FROMPOS: "+_edit.orig_gizmo_pos);
- break;
- }
- }
- }
- //_compute_edit(Point2(b.x,b.y)); //in case a motion happens..
- }
+ if (selected_handle != spatial_editor->get_over_gizmo_handle()) {
+ spatial_editor->set_over_gizmo_handle(selected_handle);
+ spatial_editor->get_selected()->update_gizmo();
+ if (selected_handle != -1)
+ spatial_editor->select_gizmo_highlight_axis(-1);
+ }
+ }
+ }
- surface->update();
- } else {
+ if (spatial_editor->get_over_gizmo_handle() == -1 && !(m->get_button_mask() & 1) && !_edit.gizmo.is_valid()) {
- if (_edit.gizmo.is_valid()) {
+ _gizmo_select(_edit.mouse_pos, true);
+ }
- _edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_initial_value, false);
- _edit.gizmo = Ref<SpatialEditorGizmo>();
- break;
- }
- if (clicked) {
- _select_clicked(clicked_wants_append, true);
- //clickd processing was deferred
- clicked = 0;
- }
+ NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int();
+ NavigationMode nav_mode = NAVIGATION_NONE;
- if (cursor.region_select) {
- _select_region();
- cursor.region_select = false;
- surface->update();
- }
+ if (_edit.gizmo.is_valid()) {
- if (_edit.mode != TRANSFORM_NONE) {
+ _edit.gizmo->set_handle(_edit.gizmo_handle, camera, m->get_position());
+ Variant v = _edit.gizmo->get_handle_value(_edit.gizmo_handle);
+ String n = _edit.gizmo->get_handle_name(_edit.gizmo_handle);
+ set_message(n + ": " + String(v));
- static const char *_transform_name[4] = { "None", "Rotate", "Translate", "Scale" };
- undo_redo->create_action(_transform_name[_edit.mode]);
+ } else if (m->get_button_mask() & BUTTON_MASK_LEFT) {
- List<Node *> &selection = editor_selection->get_selected_node_list();
+ if (nav_scheme == NAVIGATION_MAYA && m->get_alt()) {
+ nav_mode = NAVIGATION_ORBIT;
+ } else if (nav_scheme == NAVIGATION_MODO && m->get_alt() && m->get_shift()) {
+ nav_mode = NAVIGATION_PAN;
+ } else if (nav_scheme == NAVIGATION_MODO && m->get_alt() && m->get_control()) {
+ nav_mode = NAVIGATION_ZOOM;
+ } else if (nav_scheme == NAVIGATION_MODO && m->get_alt()) {
+ nav_mode = NAVIGATION_ORBIT;
+ } else {
+ if (clicked) {
- for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
+ if (!clicked_includes_current) {
- Spatial *sp = E->get()->cast_to<Spatial>();
- if (!sp)
- continue;
+ _select_clicked(clicked_wants_append, true);
+ //clickd processing was deferred
+ }
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
- if (!se)
- continue;
+ _compute_edit(_edit.mouse_pos);
+ clicked = 0;
- undo_redo->add_do_method(sp, "set_global_transform", sp->get_global_transform());
- undo_redo->add_undo_method(sp, "set_global_transform", se->original);
- }
- undo_redo->commit_action();
- _edit.mode = TRANSFORM_NONE;
- //VisualServer::get_singleton()->poly_clear(indicators);
- set_message("");
- }
+ _edit.mode = TRANSFORM_TRANSLATE;
+ }
- surface->update();
- }
- } break;
- }
- } break;
- case InputEvent::MOUSE_MOTION: {
- const InputEventMouseMotion &m = p_event.mouse_motion;
- _edit.mouse_pos = Point2(p_event.mouse_motion.x, p_event.mouse_motion.y);
+ if (cursor.region_select && nav_mode == NAVIGATION_NONE) {
- if (spatial_editor->get_selected()) {
+ cursor.region_end = m->get_position();
+ surface->update();
+ return;
+ }
- Ref<SpatialEditorGizmo> seg = spatial_editor->get_selected()->get_gizmo();
- if (seg.is_valid()) {
+ if (_edit.mode == TRANSFORM_NONE && nav_mode == NAVIGATION_NONE)
+ return;
- int selected_handle = -1;
+ Vector3 ray_pos = _get_ray_pos(m->get_position());
+ Vector3 ray = _get_ray(m->get_position());
- int handle = -1;
- Vector3 point;
- Vector3 normal;
- bool inters = seg->intersect_ray(camera, _edit.mouse_pos, point, normal, &handle, false);
- if (inters && handle != -1) {
+ switch (_edit.mode) {
- selected_handle = handle;
- }
+ case TRANSFORM_SCALE: {
- if (selected_handle != spatial_editor->get_over_gizmo_handle()) {
- spatial_editor->set_over_gizmo_handle(selected_handle);
- spatial_editor->get_selected()->update_gizmo();
- if (selected_handle != -1)
- spatial_editor->select_gizmo_hilight_axis(-1);
- }
- }
- }
+ Plane plane = Plane(_edit.center, _get_camera_normal());
- if (spatial_editor->get_over_gizmo_handle() == -1 && !(m.button_mask & 1) && !_edit.gizmo.is_valid()) {
+ Vector3 intersection;
+ if (!plane.intersects_ray(ray_pos, ray, &intersection))
+ break;
- _gizmo_select(_edit.mouse_pos, true);
- }
+ Vector3 click;
+ if (!plane.intersects_ray(_edit.click_ray_pos, _edit.click_ray, &click))
+ break;
+
+ float center_click_dist = click.distance_to(_edit.center);
+ float center_inters_dist = intersection.distance_to(_edit.center);
+ if (center_click_dist == 0)
+ break;
- NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int();
- NavigationMode nav_mode = NAVIGATION_NONE;
+ float scale = (center_inters_dist / center_click_dist) * 100.0;
- if (_edit.gizmo.is_valid()) {
+ if (_edit.snap || spatial_editor->is_snap_enabled()) {
- _edit.gizmo->set_handle(_edit.gizmo_handle, camera, Vector2(m.x, m.y));
- Variant v = _edit.gizmo->get_handle_value(_edit.gizmo_handle);
- String n = _edit.gizmo->get_handle_name(_edit.gizmo_handle);
- set_message(n + ": " + String(v));
+ scale = Math::stepify(scale, spatial_editor->get_scale_snap());
+ }
- } else if (m.button_mask & 1) {
+ set_message(vformat(TTR("Scaling to %s%%."), String::num(scale, 1)));
+ scale /= 100.0;
- if (nav_scheme == NAVIGATION_MAYA && m.mod.alt) {
- nav_mode = NAVIGATION_ORBIT;
- } else if (nav_scheme == NAVIGATION_MODO && m.mod.alt && m.mod.shift) {
- nav_mode = NAVIGATION_PAN;
- } else if (nav_scheme == NAVIGATION_MODO && m.mod.alt && m.mod.control) {
- nav_mode = NAVIGATION_ZOOM;
- } else if (nav_scheme == NAVIGATION_MODO && m.mod.alt) {
- nav_mode = NAVIGATION_ORBIT;
- } else {
- if (clicked) {
+ Transform r;
+ r.basis.scale(Vector3(scale, scale, scale));
- if (!clicked_includes_current) {
+ List<Node *> &selection = editor_selection->get_selected_node_list();
- _select_clicked(clicked_wants_append, true);
- //clickd processing was deferred
- }
+ for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- _compute_edit(_edit.mouse_pos);
- clicked = 0;
+ Spatial *sp = E->get()->cast_to<Spatial>();
+ if (!sp)
+ continue;
- _edit.mode = TRANSFORM_TRANSLATE;
- }
+ SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ if (!se)
+ continue;
- if (cursor.region_select && nav_mode == NAVIGATION_NONE) {
+ Transform original = se->original;
- cursor.region_end = Point2(m.x, m.y);
- surface->update();
- return;
- }
+ Transform base = Transform(Basis(), _edit.center);
+ Transform t = base * (r * (base.inverse() * original));
- if (_edit.mode == TRANSFORM_NONE && nav_mode == NAVIGATION_NONE)
- break;
+ sp->set_global_transform(t);
+ }
- Vector3 ray_pos = _get_ray_pos(Vector2(m.x, m.y));
- Vector3 ray = _get_ray(Vector2(m.x, m.y));
+ surface->update();
- switch (_edit.mode) {
+ } break;
- case TRANSFORM_SCALE: {
+ case TRANSFORM_TRANSLATE: {
- Plane plane = Plane(_edit.center, _get_camera_normal());
+ Vector3 motion_mask;
+ Plane plane;
- Vector3 intersection;
- if (!plane.intersects_ray(ray_pos, ray, &intersection))
+ switch (_edit.plane) {
+ case TRANSFORM_VIEW:
+ motion_mask = Vector3(0, 0, 0);
+ plane = Plane(_edit.center, _get_camera_normal());
break;
-
- Vector3 click;
- if (!plane.intersects_ray(_edit.click_ray_pos, _edit.click_ray, &click))
+ case TRANSFORM_X_AXIS:
+ motion_mask = spatial_editor->get_gizmo_transform().basis.get_axis(0);
+ plane = Plane(_edit.center, motion_mask.cross(motion_mask.cross(_get_camera_normal())).normalized());
break;
-
- float center_click_dist = click.distance_to(_edit.center);
- float center_inters_dist = intersection.distance_to(_edit.center);
- if (center_click_dist == 0)
+ case TRANSFORM_Y_AXIS:
+ motion_mask = spatial_editor->get_gizmo_transform().basis.get_axis(1);
+ plane = Plane(_edit.center, motion_mask.cross(motion_mask.cross(_get_camera_normal())).normalized());
+ break;
+ case TRANSFORM_Z_AXIS:
+ motion_mask = spatial_editor->get_gizmo_transform().basis.get_axis(2);
+ plane = Plane(_edit.center, motion_mask.cross(motion_mask.cross(_get_camera_normal())).normalized());
break;
+ }
- float scale = (center_inters_dist / center_click_dist) * 100.0;
+ Vector3 intersection;
+ if (!plane.intersects_ray(ray_pos, ray, &intersection))
+ break;
- if (_edit.snap || spatial_editor->is_snap_enabled()) {
+ Vector3 click;
+ if (!plane.intersects_ray(_edit.click_ray_pos, _edit.click_ray, &click))
+ break;
- scale = Math::stepify(scale, spatial_editor->get_scale_snap());
- }
+ //_validate_selection();
+ Vector3 motion = intersection - click;
+ if (motion_mask != Vector3()) {
+ motion = motion_mask.dot(motion) * motion_mask;
+ }
- set_message(vformat(TTR("Scaling to %s%%."), String::num(scale, 1)));
- scale /= 100.0;
+ //set_message("Translating: "+motion);
- Transform r;
- r.basis.scale(Vector3(scale, scale, scale));
+ List<Node *> &selection = editor_selection->get_selected_node_list();
- List<Node *> &selection = editor_selection->get_selected_node_list();
+ float snap = 0;
- for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
+ if (_edit.snap || spatial_editor->is_snap_enabled()) {
- Spatial *sp = E->get()->cast_to<Spatial>();
- if (!sp)
- continue;
+ snap = spatial_editor->get_translate_snap();
+ bool local_coords = spatial_editor->are_local_coords_enabled();
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
- if (!se)
- continue;
+ if (local_coords) {
+ bool multiple = false;
+ Spatial *node = NULL;
+ for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Transform original = se->original;
+ Spatial *sp = E->get()->cast_to<Spatial>();
+ if (!sp) {
+ continue;
+ }
+ if (node) {
+ multiple = true;
+ break;
+ } else {
+ node = sp;
+ }
+ }
- Transform base = Transform(Basis(), _edit.center);
- Transform t = base * (r * (base.inverse() * original));
+ if (multiple) {
+ motion.snap(Vector3(snap, snap, snap));
+ } else {
+ Basis b = node->get_global_transform().basis.orthonormalized();
+ Vector3 local_motion = b.inverse().xform(motion);
+ local_motion.snap(Vector3(snap, snap, snap));
+ motion = b.xform(local_motion);
+ }
- sp->set_global_transform(t);
+ } else {
+ motion.snap(Vector3(snap, snap, snap));
}
+ }
- surface->update();
+ for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- } break;
+ Spatial *sp = E->get()->cast_to<Spatial>();
+ if (!sp) {
+ continue;
+ }
- case TRANSFORM_TRANSLATE: {
+ SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ if (!se) {
+ continue;
+ }
- Vector3 motion_mask;
- Plane plane;
+ Transform t = se->original;
+ t.origin += motion;
+ sp->set_global_transform(t);
+ }
+ } break;
- switch (_edit.plane) {
- case TRANSFORM_VIEW:
- motion_mask = Vector3(0, 0, 0);
- plane = Plane(_edit.center, _get_camera_normal());
- break;
- case TRANSFORM_X_AXIS:
- motion_mask = spatial_editor->get_gizmo_transform().basis.get_axis(0);
- plane = Plane(_edit.center, motion_mask.cross(motion_mask.cross(_get_camera_normal())).normalized());
- break;
- case TRANSFORM_Y_AXIS:
- motion_mask = spatial_editor->get_gizmo_transform().basis.get_axis(1);
- plane = Plane(_edit.center, motion_mask.cross(motion_mask.cross(_get_camera_normal())).normalized());
- break;
- case TRANSFORM_Z_AXIS:
- motion_mask = spatial_editor->get_gizmo_transform().basis.get_axis(2);
- plane = Plane(_edit.center, motion_mask.cross(motion_mask.cross(_get_camera_normal())).normalized());
- break;
- }
+ case TRANSFORM_ROTATE: {
- Vector3 intersection;
- if (!plane.intersects_ray(ray_pos, ray, &intersection))
- break;
+ Plane plane;
- Vector3 click;
- if (!plane.intersects_ray(_edit.click_ray_pos, _edit.click_ray, &click))
+ switch (_edit.plane) {
+ case TRANSFORM_VIEW:
+ plane = Plane(_edit.center, _get_camera_normal());
+ break;
+ case TRANSFORM_X_AXIS:
+ plane = Plane(_edit.center, spatial_editor->get_gizmo_transform().basis.get_axis(0));
break;
+ case TRANSFORM_Y_AXIS:
+ plane = Plane(_edit.center, spatial_editor->get_gizmo_transform().basis.get_axis(1));
+ break;
+ case TRANSFORM_Z_AXIS:
+ plane = Plane(_edit.center, spatial_editor->get_gizmo_transform().basis.get_axis(2));
+ break;
+ }
- //_validate_selection();
- Vector3 motion = intersection - click;
- if (motion_mask != Vector3()) {
- motion = motion_mask.dot(motion) * motion_mask;
- }
+ Vector3 intersection;
+ if (!plane.intersects_ray(ray_pos, ray, &intersection))
+ break;
- float snap = 0;
+ Vector3 click;
+ if (!plane.intersects_ray(_edit.click_ray_pos, _edit.click_ray, &click))
+ break;
- if (_edit.snap || spatial_editor->is_snap_enabled()) {
+ Vector3 y_axis = (click - _edit.center).normalized();
+ Vector3 x_axis = plane.normal.cross(y_axis).normalized();
- snap = spatial_editor->get_translate_snap();
- motion.snap(snap);
- }
+ float angle = Math::atan2(x_axis.dot(intersection - _edit.center), y_axis.dot(intersection - _edit.center));
+ if (_edit.snap || spatial_editor->is_snap_enabled()) {
- //set_message("Translating: "+motion);
+ float snap = spatial_editor->get_rotate_snap();
- List<Node *> &selection = editor_selection->get_selected_node_list();
+ if (snap) {
+ angle = Math::rad2deg(angle) + snap * 0.5; //else it wont reach +180
+ angle -= Math::fmod(angle, snap);
+ set_message(vformat(TTR("Rotating %s degrees."), rtos(angle)));
+ angle = Math::deg2rad(angle);
+ } else
+ set_message(vformat(TTR("Rotating %s degrees."), rtos(Math::rad2deg(angle))));
- for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
+ } else {
+ set_message(vformat(TTR("Rotating %s degrees."), rtos(Math::rad2deg(angle))));
+ }
- Spatial *sp = E->get()->cast_to<Spatial>();
- if (!sp) {
- continue;
- }
+ Transform r;
+ r.basis.rotate(plane.normal, angle);
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
- if (!se) {
- continue;
- }
+ List<Node *> &selection = editor_selection->get_selected_node_list();
- Transform t = se->original;
- t.origin += motion;
- sp->set_global_transform(t);
- }
- } break;
+ for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- case TRANSFORM_ROTATE: {
+ Spatial *sp = E->get()->cast_to<Spatial>();
+ if (!sp)
+ continue;
- Plane plane;
+ SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ if (!se)
+ continue;
- switch (_edit.plane) {
- case TRANSFORM_VIEW:
- plane = Plane(_edit.center, _get_camera_normal());
- break;
- case TRANSFORM_X_AXIS:
- plane = Plane(_edit.center, spatial_editor->get_gizmo_transform().basis.get_axis(0));
- break;
- case TRANSFORM_Y_AXIS:
- plane = Plane(_edit.center, spatial_editor->get_gizmo_transform().basis.get_axis(1));
- break;
- case TRANSFORM_Z_AXIS:
- plane = Plane(_edit.center, spatial_editor->get_gizmo_transform().basis.get_axis(2));
- break;
- }
+ Transform original = se->original;
- Vector3 intersection;
- if (!plane.intersects_ray(ray_pos, ray, &intersection))
- break;
+ Transform base = Transform(Basis(), _edit.center);
+ Transform t = base * r * base.inverse() * original;
- Vector3 click;
- if (!plane.intersects_ray(_edit.click_ray_pos, _edit.click_ray, &click))
- break;
+ sp->set_global_transform(t);
+ }
- Vector3 y_axis = (click - _edit.center).normalized();
- Vector3 x_axis = plane.normal.cross(y_axis).normalized();
+ surface->update();
+ /*
+ VisualServer::get_singleton()->poly_clear(indicators);
+
+ Vector<Vector3> points;
+ Vector<Vector3> empty;
+ Vector<Color> colors;
+ points.push_back(intersection);
+ points.push_back(_edit.original.origin);
+ colors.push_back( Color(255,155,100) );
+ colors.push_back( Color(255,155,100) );
+ VisualServer::get_singleton()->poly_add_primitive(indicators,points,empty,colors,empty);
+ */
+ } break;
+ default: {}
+ }
+ }
- float angle = Math::atan2(x_axis.dot(intersection - _edit.center), y_axis.dot(intersection - _edit.center));
- if (_edit.snap || spatial_editor->is_snap_enabled()) {
+ } else if (m->get_button_mask() & BUTTON_MASK_RIGHT) {
- float snap = spatial_editor->get_rotate_snap();
+ if (nav_scheme == NAVIGATION_MAYA && m->get_alt()) {
+ nav_mode = NAVIGATION_ZOOM;
+ } else if (freelook_active) {
+ nav_mode = NAVIGATION_LOOK;
+ }
- if (snap) {
- angle = Math::rad2deg(angle) + snap * 0.5; //else it wont reach +180
- angle -= Math::fmod(angle, snap);
- set_message(vformat(TTR("Rotating %s degrees."), rtos(angle)));
- angle = Math::deg2rad(angle);
- } else
- set_message(vformat(TTR("Rotating %s degrees."), rtos(Math::rad2deg(angle))));
+ } else if (m->get_button_mask() & BUTTON_MASK_MIDDLE) {
- } else {
- set_message(vformat(TTR("Rotating %s degrees."), rtos(Math::rad2deg(angle))));
- }
-
- Transform r;
- r.basis.rotate(plane.normal, angle);
+ if (nav_scheme == NAVIGATION_GODOT) {
- List<Node *> &selection = editor_selection->get_selected_node_list();
+ int mod = _get_key_modifier(m);
- for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
+ if (mod == _get_key_modifier_setting("editors/3d/pan_modifier"))
+ nav_mode = NAVIGATION_PAN;
+ else if (mod == _get_key_modifier_setting("editors/3d/zoom_modifier"))
+ nav_mode = NAVIGATION_ZOOM;
+ else if (mod == _get_key_modifier_setting("editors/3d/orbit_modifier"))
+ nav_mode = NAVIGATION_ORBIT;
- Spatial *sp = E->get()->cast_to<Spatial>();
- if (!sp)
- continue;
+ } else if (nav_scheme == NAVIGATION_MAYA) {
+ if (m->get_alt())
+ nav_mode = NAVIGATION_PAN;
+ }
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
- if (!se)
- continue;
+ } else if (EditorSettings::get_singleton()->get("editors/3d/emulate_3_button_mouse")) {
+ // Handle trackpad (no external mouse) use case
+ int mod = _get_key_modifier(m);
- Transform original = se->original;
+ if (mod) {
+ if (mod == _get_key_modifier_setting("editors/3d/pan_modifier"))
+ nav_mode = NAVIGATION_PAN;
+ else if (mod == _get_key_modifier_setting("editors/3d/zoom_modifier"))
+ nav_mode = NAVIGATION_ZOOM;
+ else if (mod == _get_key_modifier_setting("editors/3d/orbit_modifier"))
+ nav_mode = NAVIGATION_ORBIT;
+ }
+ }
- Transform base = Transform(Basis(), _edit.center);
- Transform t = base * r * base.inverse() * original;
+ switch (nav_mode) {
+ case NAVIGATION_PAN: {
- sp->set_global_transform(t);
- }
+ real_t pan_speed = 1 / 150.0;
+ int pan_speed_modifier = 10;
+ if (nav_scheme == NAVIGATION_MAYA && m->get_shift())
+ pan_speed *= pan_speed_modifier;
- surface->update();
- /*
- VisualServer::get_singleton()->poly_clear(indicators);
-
- Vector<Vector3> points;
- Vector<Vector3> empty;
- Vector<Color> colors;
- points.push_back(intersection);
- points.push_back(_edit.original.origin);
- colors.push_back( Color(255,155,100) );
- colors.push_back( Color(255,155,100) );
- VisualServer::get_singleton()->poly_add_primitive(indicators,points,empty,colors,empty);
- */
- } break;
- default: {}
- }
- }
+ Point2i relative = _get_warped_mouse_motion(m);
- } else if (m.button_mask & 2) {
+ Transform camera_transform;
- if (nav_scheme == NAVIGATION_MAYA && m.mod.alt) {
- nav_mode = NAVIGATION_ZOOM;
- }
+ camera_transform.translate(cursor.pos);
+ camera_transform.basis.rotate(Vector3(1, 0, 0), -cursor.x_rot);
+ camera_transform.basis.rotate(Vector3(0, 1, 0), -cursor.y_rot);
+ Vector3 translation(-relative.x * pan_speed, relative.y * pan_speed, 0);
+ translation *= cursor.distance / DISTANCE_DEFAULT;
+ camera_transform.translate(translation);
+ cursor.pos = camera_transform.origin;
- } else if (m.button_mask & 4) {
-
- if (nav_scheme == NAVIGATION_GODOT) {
-
- int mod = 0;
- if (m.mod.shift)
- mod = KEY_SHIFT;
- if (m.mod.alt)
- mod = KEY_ALT;
- if (m.mod.control)
- mod = KEY_CONTROL;
- if (m.mod.meta)
- mod = KEY_META;
-
- if (mod == _get_key_modifier("editors/3d/pan_modifier"))
- nav_mode = NAVIGATION_PAN;
- else if (mod == _get_key_modifier("editors/3d/zoom_modifier"))
- nav_mode = NAVIGATION_ZOOM;
- else if (mod == _get_key_modifier("editors/3d/orbit_modifier"))
- nav_mode = NAVIGATION_ORBIT;
-
- } else if (nav_scheme == NAVIGATION_MAYA) {
- if (m.mod.alt)
- nav_mode = NAVIGATION_PAN;
- }
+ } break;
- } else if (EditorSettings::get_singleton()->get("editors/3d/emulate_3_button_mouse")) {
- // Handle trackpad (no external mouse) use case
- int mod = 0;
- if (m.mod.shift)
- mod = KEY_SHIFT;
- if (m.mod.alt)
- mod = KEY_ALT;
- if (m.mod.control)
- mod = KEY_CONTROL;
- if (m.mod.meta)
- mod = KEY_META;
-
- if (mod) {
- if (mod == _get_key_modifier("editors/3d/pan_modifier"))
- nav_mode = NAVIGATION_PAN;
- else if (mod == _get_key_modifier("editors/3d/zoom_modifier"))
- nav_mode = NAVIGATION_ZOOM;
- else if (mod == _get_key_modifier("editors/3d/orbit_modifier"))
- nav_mode = NAVIGATION_ORBIT;
+ case NAVIGATION_ZOOM: {
+ real_t zoom_speed = 1 / 80.0;
+ int zoom_speed_modifier = 10;
+ if (nav_scheme == NAVIGATION_MAYA && m->get_shift())
+ zoom_speed *= zoom_speed_modifier;
+
+ NavigationZoomStyle zoom_style = (NavigationZoomStyle)EditorSettings::get_singleton()->get("editors/3d/zoom_style").operator int();
+ if (zoom_style == NAVIGATION_ZOOM_HORIZONTAL) {
+ if (m->get_relative().x > 0)
+ scale_cursor_distance(1 - m->get_relative().x * zoom_speed);
+ else if (m->get_relative().x < 0)
+ scale_cursor_distance(1.0 / (1 + m->get_relative().x * zoom_speed));
+ } else {
+ if (m->get_relative().y > 0)
+ scale_cursor_distance(1 + m->get_relative().y * zoom_speed);
+ else if (m->get_relative().y < 0)
+ scale_cursor_distance(1.0 / (1 - m->get_relative().y * zoom_speed));
}
- }
-
- switch (nav_mode) {
- case NAVIGATION_PAN: {
- real_t pan_speed = 1 / 150.0;
- int pan_speed_modifier = 10;
- if (nav_scheme == NAVIGATION_MAYA && m.mod.shift)
- pan_speed *= pan_speed_modifier;
-
- Point2i relative;
- if (bool(EditorSettings::get_singleton()->get("editors/3d/warped_mouse_panning"))) {
- relative = Input::get_singleton()->warp_mouse_motion(m, surface->get_global_rect());
- } else {
- relative = Point2i(m.relative_x, m.relative_y);
- }
-
- Transform camera_transform;
-
- camera_transform.translate(cursor.pos);
- camera_transform.basis.rotate(Vector3(1, 0, 0), -cursor.x_rot);
- camera_transform.basis.rotate(Vector3(0, 1, 0), -cursor.y_rot);
- Vector3 translation(-relative.x * pan_speed, relative.y * pan_speed, 0);
- translation *= cursor.distance / DISTANCE_DEFAULT;
- camera_transform.translate(translation);
- cursor.pos = camera_transform.origin;
-
- } break;
-
- case NAVIGATION_ZOOM: {
- real_t zoom_speed = 1 / 80.0;
- int zoom_speed_modifier = 10;
- if (nav_scheme == NAVIGATION_MAYA && m.mod.shift)
- zoom_speed *= zoom_speed_modifier;
-
- NavigationZoomStyle zoom_style = (NavigationZoomStyle)EditorSettings::get_singleton()->get("editors/3d/zoom_style").operator int();
- if (zoom_style == NAVIGATION_ZOOM_HORIZONTAL) {
- if (m.relative_x > 0)
- cursor.distance *= 1 - m.relative_x * zoom_speed;
- else if (m.relative_x < 0)
- cursor.distance /= 1 + m.relative_x * zoom_speed;
- } else {
- if (m.relative_y > 0)
- cursor.distance *= 1 + m.relative_y * zoom_speed;
- else if (m.relative_y < 0)
- cursor.distance /= 1 - m.relative_y * zoom_speed;
- }
+ } break;
- } break;
+ case NAVIGATION_ORBIT: {
+ Point2i relative = _get_warped_mouse_motion(m);
+ cursor.x_rot += relative.y / 80.0;
+ cursor.y_rot += relative.x / 80.0;
+ if (cursor.x_rot > Math_PI / 2.0)
+ cursor.x_rot = Math_PI / 2.0;
+ if (cursor.x_rot < -Math_PI / 2.0)
+ cursor.x_rot = -Math_PI / 2.0;
+ name = "";
+ _update_name();
+ } break;
- case NAVIGATION_ORBIT: {
- cursor.x_rot += m.relative_y / 80.0;
- cursor.y_rot += m.relative_x / 80.0;
+ case NAVIGATION_LOOK: {
+ // Freelook only works properly in perspective.
+ // It technically works too in ortho, but it's awful for a user due to fov being near zero
+ if (!orthogonal) {
+ Point2i relative = _get_warped_mouse_motion(m);
+ cursor.x_rot += relative.y / 120.0;
+ cursor.y_rot += relative.x / 120.0;
if (cursor.x_rot > Math_PI / 2.0)
cursor.x_rot = Math_PI / 2.0;
if (cursor.x_rot < -Math_PI / 2.0)
cursor.x_rot = -Math_PI / 2.0;
+
+ // Look is like Orbit, except the cursor translates, not the camera
+ Transform camera_transform = to_camera_transform(cursor);
+ Vector3 pos = camera_transform.xform(Vector3(0, 0, 0));
+ Vector3 diff = camera->get_translation() - pos;
+ cursor.pos += diff;
+
name = "";
_update_name();
- } break;
+ }
- default: {}
- }
- } break;
- case InputEvent::KEY: {
- const InputEventKey &k = p_event.key;
- if (!k.pressed)
- break;
+ } break;
- if (ED_IS_SHORTCUT("spatial_editor/snap", p_event)) {
- if (_edit.mode != TRANSFORM_NONE) {
- _edit.snap = true;
- }
- }
- if (ED_IS_SHORTCUT("spatial_editor/bottom_view", p_event)) {
- cursor.y_rot = 0;
- cursor.x_rot = -Math_PI / 2.0;
- set_message(TTR("Bottom View."), 2);
- name = TTR("Bottom");
- _update_name();
- }
- if (ED_IS_SHORTCUT("spatial_editor/top_view", p_event)) {
- cursor.y_rot = 0;
- cursor.x_rot = Math_PI / 2.0;
- set_message(TTR("Top View."), 2);
- name = TTR("Top");
- _update_name();
- }
- if (ED_IS_SHORTCUT("spatial_editor/rear_view", p_event)) {
- cursor.x_rot = 0;
- cursor.y_rot = Math_PI;
- set_message(TTR("Rear View."), 2);
- name = TTR("Rear");
- _update_name();
- }
- if (ED_IS_SHORTCUT("spatial_editor/front_view", p_event)) {
- cursor.x_rot = 0;
- cursor.y_rot = 0;
- set_message(TTR("Front View."), 2);
- name = TTR("Front");
- _update_name();
- }
- if (ED_IS_SHORTCUT("spatial_editor/left_view", p_event)) {
- cursor.x_rot = 0;
- cursor.y_rot = Math_PI / 2.0;
- set_message(TTR("Left View."), 2);
- name = TTR("Left");
- _update_name();
+ default: {}
+ }
+ }
+
+ Ref<InputEventKey> k = p_event;
+
+ if (k.is_valid()) {
+ if (!k->is_pressed())
+ return;
+
+ if (ED_IS_SHORTCUT("spatial_editor/snap", p_event)) {
+ if (_edit.mode != TRANSFORM_NONE) {
+ _edit.snap = true;
}
- if (ED_IS_SHORTCUT("spatial_editor/right_view", p_event)) {
- cursor.x_rot = 0;
- cursor.y_rot = -Math_PI / 2.0;
- set_message(TTR("Right View."), 2);
- name = TTR("Right");
- _update_name();
+ }
+ if (ED_IS_SHORTCUT("spatial_editor/bottom_view", p_event)) {
+ cursor.y_rot = 0;
+ cursor.x_rot = -Math_PI / 2.0;
+ set_message(TTR("Bottom View."), 2);
+ name = TTR("Bottom");
+ _update_name();
+ }
+ if (ED_IS_SHORTCUT("spatial_editor/top_view", p_event)) {
+ cursor.y_rot = 0;
+ cursor.x_rot = Math_PI / 2.0;
+ set_message(TTR("Top View."), 2);
+ name = TTR("Top");
+ _update_name();
+ }
+ if (ED_IS_SHORTCUT("spatial_editor/rear_view", p_event)) {
+ cursor.x_rot = 0;
+ cursor.y_rot = Math_PI;
+ set_message(TTR("Rear View."), 2);
+ name = TTR("Rear");
+ _update_name();
+ }
+ if (ED_IS_SHORTCUT("spatial_editor/front_view", p_event)) {
+ cursor.x_rot = 0;
+ cursor.y_rot = 0;
+ set_message(TTR("Front View."), 2);
+ name = TTR("Front");
+ _update_name();
+ }
+ if (ED_IS_SHORTCUT("spatial_editor/left_view", p_event)) {
+ cursor.x_rot = 0;
+ cursor.y_rot = Math_PI / 2.0;
+ set_message(TTR("Left View."), 2);
+ name = TTR("Left");
+ _update_name();
+ }
+ if (ED_IS_SHORTCUT("spatial_editor/right_view", p_event)) {
+ cursor.x_rot = 0;
+ cursor.y_rot = -Math_PI / 2.0;
+ set_message(TTR("Right View."), 2);
+ name = TTR("Right");
+ _update_name();
+ }
+ if (ED_IS_SHORTCUT("spatial_editor/switch_perspective_orthogonal", p_event)) {
+ _menu_option(orthogonal ? VIEW_PERSPECTIVE : VIEW_ORTHOGONAL);
+ _update_name();
+ }
+ if (ED_IS_SHORTCUT("spatial_editor/insert_anim_key", p_event)) {
+ if (!get_selected_count() || _edit.mode != TRANSFORM_NONE)
+ return;
+
+ if (!AnimationPlayerEditor::singleton->get_key_editor()->has_keying()) {
+ set_message(TTR("Keying is disabled (no key inserted)."));
+ return;
}
- if (ED_IS_SHORTCUT("spatial_editor/switch_perspective_orthogonal", p_event)) {
- _menu_option(orthogonal ? VIEW_PERSPECTIVE : VIEW_ORTHOGONAL);
- _update_name();
+
+ List<Node *> &selection = editor_selection->get_selected_node_list();
+
+ for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
+
+ Spatial *sp = E->get()->cast_to<Spatial>();
+ if (!sp)
+ continue;
+
+ emit_signal("transform_key_request", sp, "", sp->get_transform());
}
- if (ED_IS_SHORTCUT("spatial_editor/insert_anim_key", p_event)) {
- if (!get_selected_count() || _edit.mode != TRANSFORM_NONE)
- break;
- if (!AnimationPlayerEditor::singleton->get_key_editor()->has_keying()) {
- set_message(TTR("Keying is disabled (no key inserted)."));
- break;
- }
+ set_message(TTR("Animation Key Inserted."));
+ }
+
+ if (k->get_scancode() == KEY_SPACE) {
+ if (!k->is_pressed()) emit_signal("toggle_maximize_view", this);
+ }
+ }
+}
- List<Node *> &selection = editor_selection->get_selected_node_list();
+void SpatialEditorViewport::scale_cursor_distance(real_t scale) {
- for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
+ // Prevents zero distance which would short-circuit any scaling
+ if (cursor.distance < ZOOM_MIN_DISTANCE)
+ cursor.distance = ZOOM_MIN_DISTANCE;
- Spatial *sp = E->get()->cast_to<Spatial>();
- if (!sp)
- continue;
+ real_t prev_distance = cursor.distance;
+ cursor.distance *= scale;
- emit_signal("transform_key_request", sp, "", sp->get_transform());
- }
+ if (cursor.distance < ZOOM_MIN_DISTANCE)
+ cursor.distance = ZOOM_MIN_DISTANCE;
- set_message(TTR("Animation Key Inserted."));
- }
+ if (is_freelook_active()) {
+ // In freelook mode, cursor reference is reversed so it needs to be adjusted
+ Vector3 forward = camera->get_transform().basis.xform(Vector3(0, 0, -1));
+ cursor.pos += (cursor.distance - prev_distance) * forward;
+ }
- if (k.scancode == KEY_SPACE) {
- if (!k.pressed) emit_signal("toggle_maximize_view", this);
- }
+ zoom_indicator_delay = ZOOM_INDICATOR_DELAY_S;
+ surface->update();
+}
- } break;
+Point2i SpatialEditorViewport::_get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const {
+ Point2i relative;
+ if (bool(EditorSettings::get_singleton()->get("editors/3d/warped_mouse_panning"))) {
+ relative = Input::get_singleton()->warp_mouse_motion(p_ev_mouse_motion, surface->get_global_rect());
+ } else {
+ relative = p_ev_mouse_motion->get_relative();
+ }
+ return relative;
+}
+
+void SpatialEditorViewport::_update_freelook(real_t delta) {
+
+ if (!is_freelook_active())
+ return;
+
+ Vector3 forward = camera->get_transform().basis.xform(Vector3(0, 0, -1));
+ Vector3 right = camera->get_transform().basis.xform(Vector3(1, 0, 0));
+ Vector3 up = camera->get_transform().basis.xform(Vector3(0, 1, 0));
+
+ int key_left = ED_GET_SHORTCUT("spatial_editor/freelook_left")->get_shortcut()->cast_to<InputEventKey>()->get_scancode();
+ int key_right = ED_GET_SHORTCUT("spatial_editor/freelook_right")->get_shortcut()->cast_to<InputEventKey>()->get_scancode();
+ int key_forward = ED_GET_SHORTCUT("spatial_editor/freelook_forward")->get_shortcut()->cast_to<InputEventKey>()->get_scancode();
+ int key_backwards = ED_GET_SHORTCUT("spatial_editor/freelook_backwards")->get_shortcut()->cast_to<InputEventKey>()->get_scancode();
+ int key_up = ED_GET_SHORTCUT("spatial_editor/freelook_up")->get_shortcut()->cast_to<InputEventKey>()->get_scancode();
+ int key_down = ED_GET_SHORTCUT("spatial_editor/freelook_down")->get_shortcut()->cast_to<InputEventKey>()->get_scancode();
+ int key_speed_modifier = ED_GET_SHORTCUT("spatial_editor/freelook_speed_modifier")->get_shortcut()->cast_to<InputEventKey>()->get_scancode();
+
+ Vector3 velocity;
+ bool pressed = false;
+ bool speed_modifier = false;
+
+ const Input &input = *Input::get_singleton();
+
+ if (input.is_key_pressed(key_left)) {
+ velocity -= right;
+ pressed = true;
+ }
+ if (input.is_key_pressed(key_right)) {
+ velocity += right;
+ pressed = true;
+ }
+ if (input.is_key_pressed(key_forward)) {
+ velocity += forward;
+ pressed = true;
+ }
+ if (input.is_key_pressed(key_backwards)) {
+ velocity -= forward;
+ pressed = true;
+ }
+ if (input.is_key_pressed(key_up)) {
+ velocity += up;
+ pressed = true;
+ }
+ if (input.is_key_pressed(key_down)) {
+ velocity -= up;
+ pressed = true;
+ }
+ if (input.is_key_pressed(key_speed_modifier)) {
+ speed_modifier = true;
+ }
+
+ if (pressed) {
+ const EditorSettings &s = *EditorSettings::get_singleton();
+ const real_t base_speed = s.get("editors/3d/freelook_base_speed");
+ const real_t modifier_speed_factor = s.get("editors/3d/freelook_modifier_speed_factor");
+
+ real_t speed = base_speed * cursor.distance;
+ if (speed_modifier)
+ speed *= modifier_speed_factor;
+
+ velocity.normalize();
+
+ cursor.pos += velocity * (speed * delta);
}
}
@@ -1578,6 +1711,17 @@ void SpatialEditorViewport::_notification(int p_what) {
}
*/
+ real_t delta = get_tree()->get_idle_process_time();
+
+ if (zoom_indicator_delay > 0) {
+ zoom_indicator_delay -= delta;
+ if (zoom_indicator_delay <= 0) {
+ surface->update();
+ }
+ }
+
+ _update_freelook(delta);
+
_update_camera();
Map<Node *, Object *> &selection = editor_selection->get_selection();
@@ -1603,7 +1747,7 @@ void SpatialEditorViewport::_notification(int p_what) {
}
Transform t = sp->get_global_transform();
- t.translate(se->aabb.pos);
+ t.translate(se->aabb.position);
t.basis.scale(se->aabb.size);
exist = true;
@@ -1632,11 +1776,11 @@ void SpatialEditorViewport::_notification(int p_what) {
//update shadow atlas if changed
- int shadowmap_size = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/size");
- int atlas_q0 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_0_subdiv");
- int atlas_q1 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_1_subdiv");
- int atlas_q2 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_2_subdiv");
- int atlas_q3 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_3_subdiv");
+ int shadowmap_size = ProjectSettings::get_singleton()->get("rendering/quality/shadow_atlas/size");
+ int atlas_q0 = ProjectSettings::get_singleton()->get("rendering/quality/shadow_atlas/quadrant_0_subdiv");
+ int atlas_q1 = ProjectSettings::get_singleton()->get("rendering/quality/shadow_atlas/quadrant_1_subdiv");
+ int atlas_q2 = ProjectSettings::get_singleton()->get("rendering/quality/shadow_atlas/quadrant_2_subdiv");
+ int atlas_q3 = ProjectSettings::get_singleton()->get("rendering/quality/shadow_atlas/quadrant_3_subdiv");
viewport->set_shadow_atlas_size(shadowmap_size);
viewport->set_shadow_atlas_quadrant_subdiv(0, Viewport::ShadowAtlasQuadrantSubdiv(atlas_q0));
@@ -1646,11 +1790,38 @@ void SpatialEditorViewport::_notification(int p_what) {
//update msaa if changed
- int msaa_mode = GlobalConfig::get_singleton()->get("rendering/quality/msaa");
+ int msaa_mode = ProjectSettings::get_singleton()->get("rendering/quality/filters/msaa");
viewport->set_msaa(Viewport::MSAA(msaa_mode));
- bool hdr = GlobalConfig::get_singleton()->get("rendering/quality/hdr");
+ bool hdr = ProjectSettings::get_singleton()->get("rendering/quality/depth/hdr");
viewport->set_hdr(hdr);
+
+ bool show_info = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_INFORMATION));
+ if (show_info != info->is_visible()) {
+ if (show_info)
+ info->show();
+ else
+ info->hide();
+ }
+
+ if (show_info) {
+
+ String text;
+ text += TTR("Objects Drawn") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_OBJECTS_IN_FRAME)) + "\n";
+ text += TTR("Material Changes") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_MATERIAL_CHANGES_IN_FRAME)) + "\n";
+ text += TTR("Shader Changes") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_SHADER_CHANGES_IN_FRAME)) + "\n";
+ text += TTR("Surface Changes") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_SURFACE_CHANGES_IN_FRAME)) + "\n";
+ text += TTR("Draw Calls") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_DRAW_CALLS_IN_FRAME)) + "\n";
+ text += TTR("Vertices") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_VERTICES_IN_FRAME));
+
+ if (info_label->get_text() != text || surface->get_size() != prev_size) {
+ info_label->set_text(text);
+ Size2 ms = info->get_minimum_size();
+ info->set_position(surface->get_size() - ms - Vector2(20, 20) * EDSCALE);
+ }
+ }
+
+ prev_size = surface->get_size();
}
if (p_what == NOTIFICATION_ENTER_TREE) {
@@ -1658,6 +1829,7 @@ void SpatialEditorViewport::_notification(int p_what) {
surface->connect("draw", this, "_draw");
surface->connect("gui_input", this, "_sinput");
surface->connect("mouse_entered", this, "_smouseenter");
+ info->add_style_override("panel", get_stylebox("panel", "Panel"));
preview_camera->set_icon(get_icon("Camera", "EditorIcons"));
_init_gizmo_instance(index);
}
@@ -1673,12 +1845,29 @@ void SpatialEditorViewport::_notification(int p_what) {
}
}
+// TODO That should be part of the drawing API...
+static void stroke_rect(CanvasItem *ci, Rect2 rect, Color color, real_t width = 1.0) {
+
+ // a---b
+ // | |
+ // c---d
+ Vector2 a(rect.position);
+ Vector2 b(rect.position.x + rect.size.x, rect.position.y);
+ Vector2 c(rect.position.x, rect.position.y + rect.size.y);
+ Vector2 d(rect.position + rect.size);
+
+ ci->draw_line(a, b, color, width);
+ ci->draw_line(b, d, color, width);
+ ci->draw_line(d, c, color, width);
+ ci->draw_line(c, a, color, width);
+}
+
void SpatialEditorViewport::_draw() {
if (surface->has_focus()) {
Size2 size = surface->get_size();
Rect2 r = Rect2(Point2(), size);
- get_stylebox("EditorFocus", "EditorStyles")->draw(surface->get_canvas_item(), r);
+ get_stylebox("Focus", "EditorStyles")->draw(surface->get_canvas_item(), r);
}
RID ci = surface->get_canvas_item();
@@ -1704,7 +1893,7 @@ void SpatialEditorViewport::_draw() {
if (previewing) {
- Size2 ss = Size2(GlobalConfig::get_singleton()->get("display/width"), GlobalConfig::get_singleton()->get("display/height"));
+ Size2 ss = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"));
float aspect = ss.aspect();
Size2 s = get_size();
@@ -1714,25 +1903,52 @@ void SpatialEditorViewport::_draw() {
case Camera::KEEP_WIDTH: {
draw_rect.size = Size2(s.width, s.width / aspect);
- draw_rect.pos.x = 0;
- draw_rect.pos.y = (s.height - draw_rect.size.y) * 0.5;
+ draw_rect.position.x = 0;
+ draw_rect.position.y = (s.height - draw_rect.size.y) * 0.5;
} break;
case Camera::KEEP_HEIGHT: {
draw_rect.size = Size2(s.height * aspect, s.height);
- draw_rect.pos.y = 0;
- draw_rect.pos.x = (s.width - draw_rect.size.x) * 0.5;
+ draw_rect.position.y = 0;
+ draw_rect.position.x = (s.width - draw_rect.size.x) * 0.5;
} break;
}
draw_rect = Rect2(Vector2(), s).clip(draw_rect);
- surface->draw_line(draw_rect.pos, draw_rect.pos + Vector2(draw_rect.size.x, 0), Color(0.6, 0.6, 0.1, 0.5), 2.0);
- surface->draw_line(draw_rect.pos + Vector2(draw_rect.size.x, 0), draw_rect.pos + draw_rect.size, Color(0.6, 0.6, 0.1, 0.5), 2.0);
- surface->draw_line(draw_rect.pos + draw_rect.size, draw_rect.pos + Vector2(0, draw_rect.size.y), Color(0.6, 0.6, 0.1, 0.5), 2.0);
- surface->draw_line(draw_rect.pos, draw_rect.pos + Vector2(0, draw_rect.size.y), Color(0.6, 0.6, 0.1, 0.5), 2.0);
+ stroke_rect(surface, draw_rect, Color(0.6, 0.6, 0.1, 0.5), 2.0);
+
+ } else {
+
+ if (zoom_indicator_delay > 0.0) {
+ // Show indicative zoom factor
+
+ real_t min_distance = ZOOM_MIN_DISTANCE; // TODO Why not pick znear to limit zoom?
+ real_t max_distance = camera->get_zfar();
+ real_t scale_length = (max_distance - min_distance);
+
+ if (Math::abs(scale_length) > CMP_EPSILON) {
+ real_t logscale_t = 1.0 - Math::log(1 + cursor.distance - min_distance) / Math::log(1 + scale_length);
+
+ // There is no real maximum distance so that factor can become negative,
+ // Let's make it look asymptotic instead (will decrease slower and slower).
+ if (logscale_t < 0.25)
+ logscale_t = 0.25 * Math::exp(4.0 * logscale_t - 1.0);
+
+ Vector2 surface_size = surface->get_size();
+ real_t h = surface_size.y / 2.0;
+ real_t y = (surface_size.y - h) / 2.0;
+
+ Rect2 r(10, y, 6, h);
+ real_t sy = r.size.y * logscale_t;
+
+ surface->draw_rect(r, Color(1, 1, 1, 0.2));
+ surface->draw_rect(Rect2(r.position.x, r.position.y + r.size.y - sy, r.size.x, sy), Color(1, 1, 1, 0.6));
+ stroke_rect(surface, r.grow(1), Color(0, 0, 0, 0.7));
+ }
+ }
}
}
@@ -1868,6 +2084,15 @@ void SpatialEditorViewport::_menu_option(int p_option) {
view_menu->get_popup()->set_item_checked(idx, current);
} break;
+ case VIEW_AUDIO_DOPPLER: {
+
+ int idx = view_menu->get_popup()->get_item_index(VIEW_AUDIO_DOPPLER);
+ bool current = view_menu->get_popup()->is_item_checked(idx);
+ current = !current;
+ camera->set_doppler_tracking(current ? Camera::DOPPLER_TRACKING_IDLE_STEP : Camera::DOPPLER_TRACKING_DISABLED);
+ view_menu->get_popup()->set_item_checked(idx, current);
+
+ } break;
case VIEW_GIZMOS: {
int idx = view_menu->get_popup()->get_item_index(VIEW_GIZMOS);
@@ -1880,6 +2105,52 @@ void SpatialEditorViewport::_menu_option(int p_option) {
view_menu->get_popup()->set_item_checked(idx, current);
} break;
+ case VIEW_INFORMATION: {
+
+ int idx = view_menu->get_popup()->get_item_index(VIEW_INFORMATION);
+ bool current = view_menu->get_popup()->is_item_checked(idx);
+ view_menu->get_popup()->set_item_checked(idx, !current);
+
+ } break;
+ case VIEW_DISPLAY_NORMAL: {
+
+ viewport->set_debug_draw(Viewport::DEBUG_DRAW_DISABLED);
+
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL), true);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_WIREFRAME), false);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_OVERDRAW), false);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_SHADELESS), false);
+
+ } break;
+ case VIEW_DISPLAY_WIREFRAME: {
+
+ viewport->set_debug_draw(Viewport::DEBUG_DRAW_WIREFRAME);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL), false);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_WIREFRAME), true);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_OVERDRAW), false);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_SHADELESS), false);
+
+ } break;
+ case VIEW_DISPLAY_OVERDRAW: {
+
+ viewport->set_debug_draw(Viewport::DEBUG_DRAW_OVERDRAW);
+ VisualServer::get_singleton()->scenario_set_debug(get_tree()->get_root()->get_world()->get_scenario(), VisualServer::SCENARIO_DEBUG_OVERDRAW);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL), false);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_WIREFRAME), false);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_OVERDRAW), true);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_SHADELESS), false);
+
+ } break;
+ case VIEW_DISPLAY_SHADELESS: {
+
+ viewport->set_debug_draw(Viewport::DEBUG_DRAW_UNSHADED);
+ VisualServer::get_singleton()->scenario_set_debug(get_tree()->get_root()->get_world()->get_scenario(), VisualServer::SCENARIO_DEBUG_SHADELESS);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL), false);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_WIREFRAME), false);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_OVERDRAW), false);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_SHADELESS), true);
+
+ } break;
}
}
@@ -1950,7 +2221,7 @@ void SpatialEditorViewport::_selection_result_pressed(int p_result) {
if (selection_results.size() <= p_result)
return;
- clicked = selection_results[p_result].item->get_instance_ID();
+ clicked = selection_results[p_result].item->get_instance_id();
if (clicked) {
_select_clicked(clicked_wants_append, true);
@@ -2034,6 +2305,13 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) {
viewport->set_as_audio_listener(listener);
view_menu->get_popup()->set_item_checked(idx, listener);
}
+ if (p_state.has("doppler")) {
+ bool doppler = p_state["doppler"];
+
+ int idx = view_menu->get_popup()->get_item_index(VIEW_AUDIO_DOPPLER);
+ camera->set_doppler_tracking(doppler ? Camera::DOPPLER_TRACKING_IDLE_STEP : Camera::DOPPLER_TRACKING_DISABLED);
+ view_menu->get_popup()->set_item_checked(idx, doppler);
+ }
if (p_state.has("previewing")) {
Node *pv = EditorNode::get_singleton()->get_edited_scene()->get_node(p_state["previewing"]);
@@ -2142,6 +2420,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
clicked_includes_current = false;
orthogonal = false;
message_time = 0;
+ zoom_indicator_delay = 0.0;
spatial_editor = p_spatial_editor;
ViewportContainer *c = memnew(ViewportContainer);
@@ -2155,6 +2434,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
surface = memnew(Control);
add_child(surface);
surface->set_area_as_parent_rect();
+ surface->set_clip_contents(true);
camera = memnew(Camera);
camera->set_disable_gizmo(true);
camera->set_cull_mask(((1 << 20) - 1) | (1 << (GIZMO_BASE_LAYER + p_index)) | (1 << GIZMO_EDIT_LAYER) | (1 << GIZMO_GRID_LAYER));
@@ -2165,7 +2445,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
view_menu = memnew(MenuButton);
surface->add_child(view_menu);
- view_menu->set_pos(Point2(4, 4));
+ view_menu->set_position(Point2(4, 4) * EDSCALE);
view_menu->set_self_modulate(Color(1, 1, 1, 0.5));
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/top_view"), VIEW_TOP);
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/bottom_view"), VIEW_BOTTOM);
@@ -2178,12 +2458,19 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
view_menu->get_popup()->add_check_item(TTR("Orthogonal") + " (" + ED_GET_SHORTCUT("spatial_editor/switch_perspective_orthogonal")->get_as_text() + ")", VIEW_ORTHOGONAL);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_PERSPECTIVE), true);
view_menu->get_popup()->add_separator();
- view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_environment", TTR("Environment")), VIEW_ENVIRONMENT);
+ view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_normal", TTR("Display Normal")), VIEW_DISPLAY_NORMAL);
+ view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_wireframe", TTR("Display Wireframe")), VIEW_DISPLAY_WIREFRAME);
+ view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_overdraw", TTR("Display Overdraw")), VIEW_DISPLAY_OVERDRAW);
+ view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_unshaded", TTR("Display Unshaded")), VIEW_DISPLAY_SHADELESS);
+ view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL), true);
+ view_menu->get_popup()->add_separator();
+ view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_environment", TTR("View Environment")), VIEW_ENVIRONMENT);
+ view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_gizmos", TTR("View Gizmos")), VIEW_GIZMOS);
+ view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_information", TTR("View Information")), VIEW_INFORMATION);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_ENVIRONMENT), true);
view_menu->get_popup()->add_separator();
view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_audio_listener", TTR("Audio Listener")), VIEW_AUDIO_LISTENER);
- view_menu->get_popup()->add_separator();
- view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_gizmos", TTR("Gizmos")), VIEW_GIZMOS);
+ view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_audio_doppler", TTR("Doppler Enable")), VIEW_AUDIO_DOPPLER);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_GIZMOS), true);
view_menu->get_popup()->add_separator();
@@ -2192,10 +2479,18 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_selection_with_view"), VIEW_ALIGN_SELECTION_WITH_VIEW);
view_menu->get_popup()->connect("id_pressed", this, "_menu_option");
+ ED_SHORTCUT("spatial_editor/freelook_left", TTR("Freelook Left"), KEY_A);
+ ED_SHORTCUT("spatial_editor/freelook_right", TTR("Freelook Right"), KEY_D);
+ ED_SHORTCUT("spatial_editor/freelook_forward", TTR("Freelook Forward"), KEY_W);
+ ED_SHORTCUT("spatial_editor/freelook_backwards", TTR("Freelook Backwards"), KEY_S);
+ ED_SHORTCUT("spatial_editor/freelook_up", TTR("Freelook Up"), KEY_Q);
+ ED_SHORTCUT("spatial_editor/freelook_down", TTR("Freelook Down"), KEY_E);
+ ED_SHORTCUT("spatial_editor/freelook_speed_modifier", TTR("Freelook Speed Modifier"), KEY_SHIFT);
+
preview_camera = memnew(Button);
preview_camera->set_toggle_mode(true);
- preview_camera->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, 90);
- preview_camera->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 10);
+ preview_camera->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -90 * EDSCALE);
+ preview_camera->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 10 * EDSCALE);
preview_camera->set_text("preview");
surface->add_child(preview_camera);
preview_camera->hide();
@@ -2204,9 +2499,18 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
preview = NULL;
gizmo_scale = 1.0;
+ info = memnew(PanelContainer);
+ info->set_self_modulate(Color(1, 1, 1, 0.4));
+ surface->add_child(info);
+ info_label = memnew(Label);
+ info->add_child(info_label);
+ info->hide();
+
+ freelook_active = false;
+
selection_menu = memnew(PopupMenu);
add_child(selection_menu);
- selection_menu->set_custom_minimum_size(Vector2(100, 0));
+ selection_menu->set_custom_minimum_size(Size2(100, 0) * EDSCALE);
selection_menu->connect("id_pressed", this, "_selection_result_pressed");
selection_menu->connect("popup_hide", this, "_selection_menu_hide");
@@ -2215,12 +2519,311 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
viewport->set_as_audio_listener(true);
}
- name = TTR("Top");
+ name = "";
_update_name();
EditorSettings::get_singleton()->connect("settings_changed", this, "update_transform_gizmo_view");
}
+//////////////////////////////////////////////////////////////
+
+void SpatialEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event) {
+
+ Ref<InputEventMouseButton> mb = p_event;
+
+ if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
+
+ Vector2 size = get_size();
+
+ int h_sep = get_constant("separation", "HSplitContainer");
+ int v_sep = get_constant("separation", "VSplitContainer");
+
+ int mid_w = size.width * ratio_h;
+ int mid_h = size.height * ratio_v;
+
+ dragging_h = mb->get_position().x > (mid_w - h_sep / 2) && mb->get_position().x < (mid_w + h_sep / 2);
+ dragging_v = mb->get_position().y > (mid_h - v_sep / 2) && mb->get_position().y < (mid_h + v_sep / 2);
+
+ drag_begin_pos = mb->get_position();
+ drag_begin_ratio.x = ratio_h;
+ drag_begin_ratio.y = ratio_v;
+
+ switch (view) {
+ case VIEW_USE_1_VIEWPORT: {
+
+ dragging_h = false;
+ dragging_v = false;
+
+ } break;
+ case VIEW_USE_2_VIEWPORTS: {
+
+ dragging_h = false;
+
+ } break;
+ case VIEW_USE_2_VIEWPORTS_ALT: {
+
+ dragging_v = false;
+
+ } break;
+ case VIEW_USE_3_VIEWPORTS: {
+
+ if (dragging_v)
+ dragging_h = false;
+ else
+ dragging_v = false;
+
+ } break;
+ case VIEW_USE_3_VIEWPORTS_ALT: {
+
+ if (dragging_h)
+ dragging_v = false;
+ else
+ dragging_h = false;
+ } break;
+ case VIEW_USE_4_VIEWPORTS: {
+
+ } break;
+ }
+ }
+
+ if (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
+ dragging_h = false;
+ dragging_v = false;
+ }
+
+ Ref<InputEventMouseMotion> mm = p_event;
+
+ if (mm.is_valid() && (dragging_h || dragging_v)) {
+
+ if (dragging_h) {
+ float new_ratio = drag_begin_ratio.x + (mm->get_position().x - drag_begin_pos.x) / get_size().width;
+ new_ratio = CLAMP(new_ratio, 40 / get_size().width, (get_size().width - 40) / get_size().width);
+ ratio_h = new_ratio;
+ queue_sort();
+ update();
+ }
+ if (dragging_v) {
+ float new_ratio = drag_begin_ratio.y + (mm->get_position().y - drag_begin_pos.y) / get_size().height;
+ new_ratio = CLAMP(new_ratio, 40 / get_size().height, (get_size().height - 40) / get_size().height);
+ ratio_v = new_ratio;
+ queue_sort();
+ update();
+ }
+ }
+}
+
+void SpatialEditorViewportContainer::_notification(int p_what) {
+
+ if (p_what == NOTIFICATION_MOUSE_ENTER || p_what == NOTIFICATION_MOUSE_EXIT) {
+
+ mouseover = (p_what == NOTIFICATION_MOUSE_ENTER);
+ update();
+ }
+
+ if (p_what == NOTIFICATION_DRAW && mouseover) {
+
+ Ref<Texture> h_grabber = get_icon("grabber", "HSplitContainer");
+
+ Ref<Texture> v_grabber = get_icon("grabber", "VSplitContainer");
+
+ Vector2 size = get_size();
+
+ int h_sep = get_constant("separation", "HSplitContainer");
+
+ int v_sep = get_constant("separation", "VSplitContainer");
+
+ int mid_w = size.width * ratio_h;
+ int mid_h = size.height * ratio_v;
+
+ int size_left = mid_w - h_sep / 2;
+ int size_bottom = size.height - mid_h - v_sep / 2;
+
+ switch (view) {
+
+ case VIEW_USE_1_VIEWPORT: {
+
+ //nothing to show
+
+ } break;
+ case VIEW_USE_2_VIEWPORTS: {
+
+ draw_texture(v_grabber, Vector2((size.width - v_grabber->get_width()) / 2, mid_h - v_grabber->get_height() / 2));
+
+ } break;
+ case VIEW_USE_2_VIEWPORTS_ALT: {
+
+ draw_texture(h_grabber, Vector2(mid_w - h_grabber->get_width() / 2, (size.height - h_grabber->get_height()) / 2));
+
+ } break;
+ case VIEW_USE_3_VIEWPORTS: {
+
+ draw_texture(v_grabber, Vector2((size.width - v_grabber->get_width()) / 2, mid_h - v_grabber->get_height() / 2));
+ draw_texture(h_grabber, Vector2(mid_w - h_grabber->get_width() / 2, mid_h + v_grabber->get_height() / 2 + (size_bottom - h_grabber->get_height()) / 2));
+
+ } break;
+ case VIEW_USE_3_VIEWPORTS_ALT: {
+
+ draw_texture(v_grabber, Vector2((size_left - v_grabber->get_width()) / 2, mid_h - v_grabber->get_height() / 2));
+ draw_texture(h_grabber, Vector2(mid_w - h_grabber->get_width() / 2, (size.height - h_grabber->get_height()) / 2));
+ } break;
+ case VIEW_USE_4_VIEWPORTS: {
+
+ Vector2 half(mid_w, mid_h);
+ draw_texture(v_grabber, half - v_grabber->get_size() / 2.0);
+ draw_texture(h_grabber, half - h_grabber->get_size() / 2.0);
+
+ } break;
+ }
+ }
+
+ if (p_what == NOTIFICATION_SORT_CHILDREN) {
+
+ SpatialEditorViewport *viewports[4];
+ int vc = 0;
+ for (int i = 0; i < get_child_count(); i++) {
+ viewports[vc] = get_child(i)->cast_to<SpatialEditorViewport>();
+ if (viewports[vc]) {
+ vc++;
+ }
+ }
+
+ ERR_FAIL_COND(vc != 4);
+
+ Size2 size = get_size();
+
+ if (size.x < 10 || size.y < 10) {
+ for (int i = 0; i < 4; i++) {
+ viewports[i]->hide();
+ }
+ return;
+ }
+ int h_sep = get_constant("separation", "HSplitContainer");
+
+ int v_sep = get_constant("separation", "VSplitContainer");
+
+ int mid_w = size.width * ratio_h;
+ int mid_h = size.height * ratio_v;
+
+ int size_left = mid_w - h_sep / 2;
+ int size_right = size.width - mid_w - h_sep / 2;
+
+ int size_top = mid_h - v_sep / 2;
+ int size_bottom = size.height - mid_h - v_sep / 2;
+
+ switch (view) {
+
+ case VIEW_USE_1_VIEWPORT: {
+
+ for (int i = 1; i < 4; i++) {
+
+ viewports[i]->hide();
+ }
+
+ fit_child_in_rect(viewports[0], Rect2(Vector2(), size));
+
+ } break;
+ case VIEW_USE_2_VIEWPORTS: {
+
+ for (int i = 1; i < 4; i++) {
+
+ if (i == 1 || i == 3)
+ viewports[i]->hide();
+ else
+ viewports[i]->show();
+ }
+
+ fit_child_in_rect(viewports[0], Rect2(Vector2(), Vector2(size.width, size_top)));
+ fit_child_in_rect(viewports[2], Rect2(Vector2(0, mid_h + v_sep / 2), Vector2(size.width, size_bottom)));
+
+ } break;
+ case VIEW_USE_2_VIEWPORTS_ALT: {
+
+ for (int i = 1; i < 4; i++) {
+
+ if (i == 1 || i == 3)
+ viewports[i]->hide();
+ else
+ viewports[i]->show();
+ }
+ fit_child_in_rect(viewports[0], Rect2(Vector2(), Vector2(size_left, size.height)));
+ fit_child_in_rect(viewports[2], Rect2(Vector2(mid_w + h_sep / 2, 0), Vector2(size_right, size.height)));
+
+ } break;
+ case VIEW_USE_3_VIEWPORTS: {
+
+ for (int i = 1; i < 4; i++) {
+
+ if (i == 1)
+ viewports[i]->hide();
+ else
+ viewports[i]->show();
+ }
+
+ fit_child_in_rect(viewports[0], Rect2(Vector2(), Vector2(size.width, size_top)));
+ fit_child_in_rect(viewports[2], Rect2(Vector2(0, mid_h + v_sep / 2), Vector2(size_left, size_bottom)));
+ fit_child_in_rect(viewports[3], Rect2(Vector2(mid_w + h_sep / 2, mid_h + v_sep / 2), Vector2(size_right, size_bottom)));
+
+ } break;
+ case VIEW_USE_3_VIEWPORTS_ALT: {
+
+ for (int i = 1; i < 4; i++) {
+
+ if (i == 1)
+ viewports[i]->hide();
+ else
+ viewports[i]->show();
+ }
+
+ fit_child_in_rect(viewports[0], Rect2(Vector2(), Vector2(size_left, size_top)));
+ fit_child_in_rect(viewports[2], Rect2(Vector2(0, mid_h + v_sep / 2), Vector2(size_left, size_bottom)));
+ fit_child_in_rect(viewports[3], Rect2(Vector2(mid_w + h_sep / 2, 0), Vector2(size_right, size.height)));
+
+ } break;
+ case VIEW_USE_4_VIEWPORTS: {
+
+ for (int i = 1; i < 4; i++) {
+
+ viewports[i]->show();
+ }
+
+ fit_child_in_rect(viewports[0], Rect2(Vector2(), Vector2(size_left, size_top)));
+ fit_child_in_rect(viewports[1], Rect2(Vector2(mid_w + h_sep / 2, 0), Vector2(size_right, size_top)));
+ fit_child_in_rect(viewports[2], Rect2(Vector2(0, mid_h + v_sep / 2), Vector2(size_left, size_bottom)));
+ fit_child_in_rect(viewports[3], Rect2(Vector2(mid_w + h_sep / 2, mid_h + v_sep / 2), Vector2(size_right, size_bottom)));
+
+ } break;
+ }
+ }
+}
+
+void SpatialEditorViewportContainer::set_view(View p_view) {
+
+ view = p_view;
+ queue_sort();
+}
+
+SpatialEditorViewportContainer::View SpatialEditorViewportContainer::get_view() {
+
+ return view;
+}
+
+void SpatialEditorViewportContainer::_bind_methods() {
+
+ ClassDB::bind_method("_gui_input", &SpatialEditorViewportContainer::_gui_input);
+}
+
+SpatialEditorViewportContainer::SpatialEditorViewportContainer() {
+
+ view = VIEW_USE_1_VIEWPORT;
+ mouseover = false;
+ ratio_h = 0.5;
+ ratio_v = 0.5;
+ dragging_v = false;
+ dragging_h = false;
+}
+
+///////////////////////////////////////////////////////////////////
+
SpatialEditor *SpatialEditor::singleton = NULL;
SpatialEditorSelectedItem::~SpatialEditorSelectedItem() {
@@ -2229,7 +2832,7 @@ SpatialEditorSelectedItem::~SpatialEditorSelectedItem() {
VisualServer::get_singleton()->free(sbox_instance);
}
-void SpatialEditor::select_gizmo_hilight_axis(int p_axis) {
+void SpatialEditor::select_gizmo_highlight_axis(int p_axis) {
for (int i = 0; i < 3; i++) {
@@ -2259,7 +2862,7 @@ void SpatialEditor::update_transform_gizmo() {
Transform xf = se->sp->get_global_transform();
if (first) {
- center.pos = xf.origin;
+ center.position = xf.origin;
first = false;
if (local_gizmo_coords) {
gizmo_basis = xf.basis;
@@ -2272,12 +2875,12 @@ void SpatialEditor::update_transform_gizmo() {
//count++;
}
- Vector3 pcenter = center.pos + center.size * 0.5;
+ Vector3 pcenter = center.position + center.size * 0.5;
gizmo.visible = !first;
gizmo.transform.origin = pcenter;
gizmo.transform.basis = gizmo_basis;
- for (int i = 0; i < 4; i++) {
+ for (int i = 0; i < VIEWPORTS_COUNT; i++) {
viewports[i]->update_transform_gizmo_view();
}
}
@@ -2329,12 +2932,12 @@ void SpatialEditor::_generate_selection_box() {
st->add_vertex(b);
}
- Ref<FixedSpatialMaterial> mat = memnew(FixedSpatialMaterial);
- mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ Ref<SpatialMaterial> mat = memnew(SpatialMaterial);
+ mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
mat->set_albedo(Color(1, 1, 1));
- mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
- mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
st->set_material(mat);
selection_box = st->commit();
}
@@ -2373,17 +2976,11 @@ Dictionary SpatialEditor::get_state() const {
d["viewports"] = vpdata;
- d["default_light"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_LIGHT));
- d["ambient_light_color"] = settings_ambient_color->get_pick_color();
-
- d["default_srgb"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_SRGB));
d["show_grid"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_GRID));
d["show_origin"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN));
d["fov"] = get_fov();
d["znear"] = get_znear();
d["zfar"] = get_zfar();
- d["deflight_rot_x"] = settings_default_light_rot_x;
- d["deflight_rot_y"] = settings_default_light_rot_y;
return d;
}
@@ -2433,7 +3030,7 @@ void SpatialEditor::set_state(const Dictionary &p_state) {
Array vp = d["viewports"];
ERR_FAIL_COND(vp.size() > 4);
- for (int i = 0; i < 4; i++) {
+ for (int i = 0; i < VIEWPORTS_COUNT; i++) {
viewports[i]->set_state(vp[i]);
}
}
@@ -2445,26 +3042,6 @@ void SpatialEditor::set_state(const Dictionary &p_state) {
if (d.has("fov"))
settings_fov->set_value(float(d["fov"]));
- if (d.has("default_light")) {
- bool use = d["default_light"];
-
- bool existing = light_instance.is_valid();
- if (use != existing) {
- if (existing) {
- VisualServer::get_singleton()->free(light_instance);
- light_instance = RID();
- } else {
- light_instance = VisualServer::get_singleton()->instance_create2(light, get_tree()->get_root()->get_world()->get_scenario());
- VisualServer::get_singleton()->instance_set_transform(light_instance, light_transform);
- }
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_LIGHT), light_instance.is_valid());
- }
- }
- if (d.has("ambient_light_color")) {
- settings_ambient_color->set_pick_color(d["ambient_light_color"]);
- //viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,d["ambient_light_color"]);
- }
-
if (d.has("default_srgb")) {
bool use = d["default_srgb"];
@@ -2487,13 +3064,6 @@ void SpatialEditor::set_state(const Dictionary &p_state) {
VisualServer::get_singleton()->instance_set_visible(origin_instance, use);
}
}
-
- if (d.has("deflight_rot_x"))
- settings_default_light_rot_x = d["deflight_rot_x"];
- if (d.has("deflight_rot_y"))
- settings_default_light_rot_y = d["deflight_rot_y"];
-
- _update_default_light_angle();
}
void SpatialEditor::edit(Spatial *p_spatial) {
@@ -2524,9 +3094,9 @@ void SpatialEditor::edit(Spatial *p_spatial) {
/*
if (p_spatial) {
_validate_selection();
- if (selected.has(p_spatial->get_instance_ID()) && selected.size()==1)
+ if (selected.has(p_spatial->get_instance_id()) && selected.size()==1)
return;
- _select(p_spatial->get_instance_ID(),false,true);
+ _select(p_spatial->get_instance_id(),false,true);
// should become the selection
}
@@ -2627,49 +3197,12 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
xform_scale[i]->set_text("1");
}
- xform_dialog->popup_centered(Size2(200, 200));
-
- } break;
- case MENU_VIEW_USE_DEFAULT_LIGHT: {
-
- bool is_checked = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(p_option));
-
- if (is_checked) {
- VisualServer::get_singleton()->free(light_instance);
- light_instance = RID();
- } else {
- light_instance = VisualServer::get_singleton()->instance_create2(light, get_tree()->get_root()->get_world()->get_scenario());
- VisualServer::get_singleton()->instance_set_transform(light_instance, light_transform);
-
- _update_default_light_angle();
- }
-
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(p_option), light_instance.is_valid());
-
- } break;
- case MENU_VIEW_USE_DEFAULT_SRGB: {
-
- bool is_checked = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(p_option));
-
- if (is_checked) {
- //viewport_environment->set_enable_fx(Environment::FX_SRGB,false);
- } else {
- //viewport_environment->set_enable_fx(Environment::FX_SRGB,true);
- }
-
- is_checked = !is_checked;
-
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(p_option), is_checked);
+ xform_dialog->popup_centered(Size2(320, 240) * EDSCALE);
} break;
case MENU_VIEW_USE_1_VIEWPORT: {
- for (int i = 1; i < 4; i++) {
-
- viewports[i]->hide();
- }
-
- viewports[0]->set_area_as_parent_rect();
+ viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_1_VIEWPORT);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), true);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false);
@@ -2681,17 +3214,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_2_VIEWPORTS: {
- for (int i = 1; i < 4; i++) {
-
- if (i == 1 || i == 3)
- viewports[i]->hide();
- else
- viewports[i]->show();
- }
- viewports[0]->set_area_as_parent_rect();
- //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
- viewports[2]->set_area_as_parent_rect();
- //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
+ viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_2_VIEWPORTS);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), true);
@@ -2703,17 +3226,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_2_VIEWPORTS_ALT: {
- for (int i = 1; i < 4; i++) {
-
- if (i == 1 || i == 3)
- viewports[i]->hide();
- else
- viewports[i]->show();
- }
- viewports[0]->set_area_as_parent_rect();
- //viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
- viewports[2]->set_area_as_parent_rect();
- //viewports[2]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
+ viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_2_VIEWPORTS_ALT);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false);
@@ -2725,21 +3238,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_3_VIEWPORTS: {
- for (int i = 1; i < 4; i++) {
-
- if (i == 1)
- viewports[i]->hide();
- else
- viewports[i]->show();
- }
- viewports[0]->set_area_as_parent_rect();
- //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
- viewports[2]->set_area_as_parent_rect();
- //viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
- //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
- viewports[3]->set_area_as_parent_rect();
- //viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
- //viewports[3]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
+ viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_3_VIEWPORTS);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false);
@@ -2751,21 +3250,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_3_VIEWPORTS_ALT: {
- for (int i = 1; i < 4; i++) {
-
- if (i == 1)
- viewports[i]->hide();
- else
- viewports[i]->show();
- }
- viewports[0]->set_area_as_parent_rect();
- //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
- //viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
- viewports[2]->set_area_as_parent_rect();
- //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
- //viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
- viewports[3]->set_area_as_parent_rect();
- //viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
+ viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_3_VIEWPORTS_ALT);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false);
@@ -2777,22 +3262,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_4_VIEWPORTS: {
- for (int i = 1; i < 4; i++) {
-
- viewports[i]->show();
- }
- viewports[0]->set_area_as_parent_rect();
- //viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
- //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
- viewports[1]->set_area_as_parent_rect();
- //viewports[1]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
- //viewports[1]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
- viewports[2]->set_area_as_parent_rect();
- //viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
- //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
- viewports[3]->set_area_as_parent_rect();
- //viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
- //viewports[3]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
+ viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_4_VIEWPORTS);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false);
@@ -2802,43 +3272,6 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), false);
} break;
- case MENU_VIEW_DISPLAY_NORMAL: {
-
- VisualServer::get_singleton()->scenario_set_debug(get_tree()->get_root()->get_world()->get_scenario(), VisualServer::SCENARIO_DEBUG_DISABLED);
-
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_NORMAL), true);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_WIREFRAME), false);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_OVERDRAW), false);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_SHADELESS), false);
-
- } break;
- case MENU_VIEW_DISPLAY_WIREFRAME: {
-
- VisualServer::get_singleton()->scenario_set_debug(get_tree()->get_root()->get_world()->get_scenario(), VisualServer::SCENARIO_DEBUG_WIREFRAME);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_NORMAL), false);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_WIREFRAME), true);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_OVERDRAW), false);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_SHADELESS), false);
-
- } break;
- case MENU_VIEW_DISPLAY_OVERDRAW: {
-
- VisualServer::get_singleton()->scenario_set_debug(get_tree()->get_root()->get_world()->get_scenario(), VisualServer::SCENARIO_DEBUG_OVERDRAW);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_NORMAL), false);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_WIREFRAME), false);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_OVERDRAW), true);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_SHADELESS), false);
-
- } break;
- case MENU_VIEW_DISPLAY_SHADELESS: {
-
- VisualServer::get_singleton()->scenario_set_debug(get_tree()->get_root()->get_world()->get_scenario(), VisualServer::SCENARIO_DEBUG_SHADELESS);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_NORMAL), false);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_WIREFRAME), false);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_OVERDRAW), false);
- view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_SHADELESS), true);
-
- } break;
case MENU_VIEW_ORIGIN: {
bool is_checked = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(p_option));
@@ -2873,14 +3306,6 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
void SpatialEditor::_init_indicators() {
- //make sure that the camera indicator is not selectable
- light = VisualServer::get_singleton()->light_create(VisualServer::LIGHT_DIRECTIONAL);
- //VisualServer::get_singleton()->light_set_shadow( light, true );
- light_instance = VisualServer::get_singleton()->instance_create2(light, get_tree()->get_root()->get_world()->get_scenario());
-
- light_transform.rotate(Vector3(1, 0, 0), -Math_PI / 5.0);
- VisualServer::get_singleton()->instance_set_transform(light_instance, light_transform);
-
//RID mat = VisualServer::get_singleton()->fixed_material_create();
///VisualServer::get_singleton()->fixed_material_set_flag(mat, VisualServer::FIXED_MATERIAL_FLAG_USE_ALPHA,true);
//VisualServer::get_singleton()->fixed_material_set_flag(mat, VisualServer::FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY,true);
@@ -2888,12 +3313,12 @@ void SpatialEditor::_init_indicators() {
{
indicator_mat.instance();
- indicator_mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- //indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP,true);
- indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- indicator_mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ indicator_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ //indicator_mat->set_flag(SpatialMaterial::FLAG_ONTOP,true);
+ indicator_mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ indicator_mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
- indicator_mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ indicator_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
PoolVector<Color> grid_colors[3];
PoolVector<Vector3> grid_points[3];
@@ -2980,7 +3405,7 @@ void SpatialEditor::_init_indicators() {
cursor_points.push_back(Vector3(0, 0, -cs));
cursor_material.instance();
cursor_material->set_albedo(Color(0, 1, 1));
- cursor_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ cursor_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
Array d;
d.resize(VS::ARRAY_MAX);
@@ -3000,21 +3425,21 @@ void SpatialEditor::_init_indicators() {
float gizmo_alph = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_opacity");
- gizmo_hl = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- gizmo_hl->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- gizmo_hl->set_flag(FixedSpatialMaterial::FLAG_ONTOP, true);
- gizmo_hl->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ gizmo_hl = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ gizmo_hl->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ gizmo_hl->set_flag(SpatialMaterial::FLAG_ONTOP, true);
+ gizmo_hl->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
gizmo_hl->set_albedo(Color(1, 1, 1, gizmo_alph + 0.2f));
for (int i = 0; i < 3; i++) {
- move_gizmo[i] = Ref<Mesh>(memnew(Mesh));
- rotate_gizmo[i] = Ref<Mesh>(memnew(Mesh));
+ move_gizmo[i] = Ref<ArrayMesh>(memnew(ArrayMesh));
+ rotate_gizmo[i] = Ref<ArrayMesh>(memnew(ArrayMesh));
- Ref<FixedSpatialMaterial> mat = memnew(FixedSpatialMaterial);
- mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP, true);
- mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ Ref<SpatialMaterial> mat = memnew(SpatialMaterial);
+ mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ mat->set_flag(SpatialMaterial::FLAG_ONTOP, true);
+ mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
Color col;
col[i] = 1.0;
col.a = gizmo_alph;
@@ -3138,8 +3563,6 @@ void SpatialEditor::_finish_indicators() {
VisualServer::get_singleton()->free(grid_instance[i]);
VisualServer::get_singleton()->free(grid[i]);
}
- VisualServer::get_singleton()->free(light_instance);
- VisualServer::get_singleton()->free(light);
//VisualServer::get_singleton()->free(poly);
//VisualServer::get_singleton()->free(indicators_instance);
//VisualServer::get_singleton()->free(indicators);
@@ -3148,37 +3571,15 @@ void SpatialEditor::_finish_indicators() {
VisualServer::get_singleton()->free(cursor_mesh);
}
-void SpatialEditor::_instance_scene() {
-#if 0
- EditorNode *en = get_scene()->get_root_node()->cast_to<EditorNode>();
- ERR_FAIL_COND(!en);
- String path = en->get_filesystem_dock()->get_selected_path();
- if (path=="") {
- set_message(TTR("No scene selected to instance!"));
- return;
- }
-
- undo_redo->create_action(TTR("Instance at Cursor"));
-
- Node* scene = en->request_instance_scene(path);
-
- if (!scene) {
- set_message(TTR("Could not instance scene!"));
- undo_redo->commit_action(); //bleh
- return;
- }
-
- Spatial *s = scene->cast_to<Spatial>();
- if (s) {
-
- undo_redo->add_do_method(s,"set_global_transform",Transform(Matrix3(),cursor.cursor_pos));
+bool SpatialEditor::is_any_freelook_active() const {
+ for (unsigned int i = 0; i < VIEWPORTS_COUNT; ++i) {
+ if (viewports[i]->is_freelook_active())
+ return true;
}
-
- undo_redo->commit_action();
-#endif
+ return false;
}
-void SpatialEditor::_unhandled_key_input(InputEvent p_event) {
+void SpatialEditor::_unhandled_key_input(Ref<InputEvent> p_event) {
if (!is_visible_in_tree() || get_viewport()->gui_has_modal_stack())
return;
@@ -3198,38 +3599,28 @@ void SpatialEditor::_unhandled_key_input(InputEvent p_event) {
}
#endif
- switch (p_event.type) {
-
- case InputEvent::KEY: {
-
- const InputEventKey &k = p_event.key;
+ Ref<InputEventKey> k = p_event;
- if (!k.pressed)
- break;
+ if (k.is_valid()) {
- switch (k.scancode) {
+ // Note: need to check is_echo because first person movement keys might still be held
+ if (!is_any_freelook_active() && !p_event->is_echo()) {
- case KEY_Q: _menu_item_pressed(MENU_TOOL_SELECT); break;
- case KEY_W: _menu_item_pressed(MENU_TOOL_MOVE); break;
- case KEY_E: _menu_item_pressed(MENU_TOOL_ROTATE); break;
- case KEY_R: _menu_item_pressed(MENU_TOOL_SCALE); break;
+ if (!k->is_pressed())
+ return;
- case KEY_Z: {
- if (k.mod.shift || k.mod.control || k.mod.command)
- break;
+ if (ED_IS_SHORTCUT("spatial_editor/tool_select", p_event))
+ _menu_item_pressed(MENU_TOOL_SELECT);
- if (view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_WIREFRAME))) {
- _menu_item_pressed(MENU_VIEW_DISPLAY_NORMAL);
- } else {
- _menu_item_pressed(MENU_VIEW_DISPLAY_WIREFRAME);
- }
- } break;
+ else if (ED_IS_SHORTCUT("spatial_editor/tool_move", p_event))
+ _menu_item_pressed(MENU_TOOL_MOVE);
-#if 0
-#endif
- }
+ else if (ED_IS_SHORTCUT("spatial_editor/tool_rotate", p_event))
+ _menu_item_pressed(MENU_TOOL_ROTATE);
- } break;
+ else if (ED_IS_SHORTCUT("spatial_editor/tool_scale", p_event))
+ _menu_item_pressed(MENU_TOOL_SCALE);
+ }
}
}
void SpatialEditor::_notification(int p_what) {
@@ -3241,8 +3632,6 @@ void SpatialEditor::_notification(int p_what) {
tool_button[SpatialEditor::TOOL_MODE_ROTATE]->set_icon(get_icon("ToolRotate", "EditorIcons"));
tool_button[SpatialEditor::TOOL_MODE_SCALE]->set_icon(get_icon("ToolScale", "EditorIcons"));
tool_button[SpatialEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_icon("ListSelect", "EditorIcons"));
- instance_button->set_icon(get_icon("SpatialAdd", "EditorIcons"));
- instance_button->hide();
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_icon("Panels1", "EditorIcons"));
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_icon("Panels2", "EditorIcons"));
@@ -3254,14 +3643,12 @@ void SpatialEditor::_notification(int p_what) {
_menu_item_pressed(MENU_VIEW_USE_1_VIEWPORT);
get_tree()->connect("node_removed", this, "_node_removed");
- VS::get_singleton()->scenario_set_fallback_environment(get_viewport()->find_world()->get_scenario(), viewport_environment->get_rid());
}
if (p_what == NOTIFICATION_ENTER_TREE) {
gizmos = memnew(SpatialEditorGizmos);
_init_indicators();
- _update_default_light_angle();
}
if (p_what == NOTIFICATION_EXIT_TREE) {
@@ -3343,7 +3730,7 @@ void SpatialEditor::_toggle_maximize_view(Object *p_viewport) {
if (!maximized) {
- for (int i = 0; i < 4; i++) {
+ for (int i = 0; i < VIEWPORTS_COUNT; i++) {
if (i == index)
viewports[i]->set_area_as_parent_rect();
else
@@ -3351,7 +3738,7 @@ void SpatialEditor::_toggle_maximize_view(Object *p_viewport) {
}
} else {
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < VIEWPORTS_COUNT; i++)
viewports[i]->show();
if (view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT)))
@@ -3382,11 +3769,8 @@ void SpatialEditor::_bind_methods() {
ClassDB::bind_method("_node_removed", &SpatialEditor::_node_removed);
ClassDB::bind_method("_menu_item_pressed", &SpatialEditor::_menu_item_pressed);
ClassDB::bind_method("_xform_dialog_action", &SpatialEditor::_xform_dialog_action);
- ClassDB::bind_method("_instance_scene", &SpatialEditor::_instance_scene);
ClassDB::bind_method("_get_editor_data", &SpatialEditor::_get_editor_data);
ClassDB::bind_method("_request_gizmo", &SpatialEditor::_request_gizmo);
- ClassDB::bind_method("_default_light_angle_input", &SpatialEditor::_default_light_angle_input);
- ClassDB::bind_method("_update_ambient_light_color", &SpatialEditor::_update_ambient_light_color);
ClassDB::bind_method("_toggle_maximize_view", &SpatialEditor::_toggle_maximize_view);
ADD_SIGNAL(MethodInfo("transform_key_request"));
@@ -3394,17 +3778,14 @@ void SpatialEditor::_bind_methods() {
void SpatialEditor::clear() {
- settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 60.0));
+ settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 55.0));
settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.1));
settings_zfar->set_value(EDITOR_DEF("editors/3d/default_z_far", 1500.0));
- for (int i = 0; i < 4; i++) {
+ for (int i = 0; i < VIEWPORTS_COUNT; i++) {
viewports[i]->reset();
}
- _menu_item_pressed(MENU_VIEW_USE_1_VIEWPORT);
- _menu_item_pressed(MENU_VIEW_DISPLAY_NORMAL);
-
VisualServer::get_singleton()->instance_set_visible(origin_instance, true);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), true);
for (int i = 0; i < 3; ++i) {
@@ -3414,49 +3795,13 @@ void SpatialEditor::clear() {
}
}
- for (int i = 0; i < 4; i++) {
+ for (int i = 0; i < VIEWPORTS_COUNT; i++) {
viewports[i]->view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(SpatialEditorViewport::VIEW_AUDIO_LISTENER), i == 0);
viewports[i]->viewport->set_as_audio_listener(i == 0);
}
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_GRID), true);
-
- settings_default_light_rot_x = Math_PI * 0.3;
- settings_default_light_rot_y = Math_PI * 0.2;
-
- //viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0.15,0.15,0.15));
- settings_ambient_color->set_pick_color(Color(0.15, 0.15, 0.15));
- if (!light_instance.is_valid())
- _menu_item_pressed(MENU_VIEW_USE_DEFAULT_LIGHT);
-
- _update_default_light_angle();
-}
-
-void SpatialEditor::_update_ambient_light_color(const Color &p_color) {
-
- //viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,settings_ambient_color->get_color());
-}
-
-void SpatialEditor::_update_default_light_angle() {
-
- Transform t;
- t.basis.rotate(Vector3(1, 0, 0), -settings_default_light_rot_x);
- t.basis.rotate(Vector3(0, 1, 0), -settings_default_light_rot_y);
- settings_dlight->set_transform(t);
- if (light_instance.is_valid()) {
- VS::get_singleton()->instance_set_transform(light_instance, t);
- }
-}
-
-void SpatialEditor::_default_light_angle_input(const InputEvent &p_event) {
-
- if (p_event.type == InputEvent::MOUSE_MOTION && p_event.mouse_motion.button_mask & (0x1 | 0x2 | 0x4)) {
-
- settings_default_light_rot_y = Math::fposmod(settings_default_light_rot_y - p_event.mouse_motion.relative_x * 0.01, Math_PI * 2.0);
- settings_default_light_rot_x = Math::fposmod(settings_default_light_rot_x - p_event.mouse_motion.relative_y * 0.01, Math_PI * 2.0);
- _update_default_light_angle();
- }
}
SpatialEditor::SpatialEditor(EditorNode *p_editor) {
@@ -3519,12 +3864,6 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_button[TOOL_MODE_SCALE]->connect("pressed", this, "_menu_item_pressed", button_binds);
tool_button[TOOL_MODE_SCALE]->set_tooltip(TTR("Scale Mode (R)"));
- instance_button = memnew(Button);
- hbc_menu->add_child(instance_button);
- instance_button->set_flat(true);
- instance_button->connect("pressed", this, "_instance_scene");
- instance_button->hide();
-
VSeparator *vs = memnew(VSeparator);
hbc_menu->add_child(vs);
@@ -3552,6 +3891,13 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
ED_SHORTCUT("spatial_editor/focus_selection", TTR("Focus Selection"), KEY_F);
ED_SHORTCUT("spatial_editor/align_selection_with_view", TTR("Align Selection With View"), KEY_MASK_ALT + KEY_MASK_CMD + KEY_F);
+ ED_SHORTCUT("spatial_editor/tool_select", TTR("Tool Select"), KEY_Q);
+ ED_SHORTCUT("spatial_editor/tool_move", TTR("Tool Move"), KEY_W);
+ ED_SHORTCUT("spatial_editor/tool_rotate", TTR("Tool Rotate"), KEY_E);
+ ED_SHORTCUT("spatial_editor/tool_scale", TTR("Tool Scale"), KEY_R);
+
+ ED_SHORTCUT("spatial_editor/display_wireframe", TTR("Display Wireframe"), KEY_Z);
+
PopupMenu *p;
transform_menu = memnew(MenuButton);
@@ -3571,15 +3917,11 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
view_menu = memnew(MenuButton);
view_menu->set_text(TTR("View"));
- view_menu->set_pos(Point2(212, 0));
+ view_menu->set_position(Point2(212, 0));
hbc_menu->add_child(view_menu);
p = view_menu->get_popup();
- p->add_check_shortcut(ED_SHORTCUT("spatial_editor/use_default_light", TTR("Use Default Light")), MENU_VIEW_USE_DEFAULT_LIGHT);
- p->add_check_shortcut(ED_SHORTCUT("spatial_editor/use_default_srgb", TTR("Use Default sRGB")), MENU_VIEW_USE_DEFAULT_SRGB);
- p->add_separator();
-
p->add_check_shortcut(ED_SHORTCUT("spatial_editor/1_viewport", TTR("1 Viewport"), KEY_MASK_CMD + KEY_1), MENU_VIEW_USE_1_VIEWPORT);
p->add_check_shortcut(ED_SHORTCUT("spatial_editor/2_viewports", TTR("2 Viewports"), KEY_MASK_CMD + KEY_2), MENU_VIEW_USE_2_VIEWPORTS);
p->add_check_shortcut(ED_SHORTCUT("spatial_editor/2_viewports_alt", TTR("2 Viewports (Alt)"), KEY_MASK_ALT + KEY_MASK_CMD + KEY_2), MENU_VIEW_USE_2_VIEWPORTS_ALT);
@@ -3588,18 +3930,11 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
p->add_check_shortcut(ED_SHORTCUT("spatial_editor/4_viewports", TTR("4 Viewports"), KEY_MASK_CMD + KEY_4), MENU_VIEW_USE_4_VIEWPORTS);
p->add_separator();
- p->add_check_shortcut(ED_SHORTCUT("spatial_editor/display_normal", TTR("Display Normal")), MENU_VIEW_DISPLAY_NORMAL);
- p->add_check_shortcut(ED_SHORTCUT("spatial_editor/display_wireframe", TTR("Display Wireframe")), MENU_VIEW_DISPLAY_WIREFRAME);
- p->add_check_shortcut(ED_SHORTCUT("spatial_editor/display_overdraw", TTR("Display Overdraw")), MENU_VIEW_DISPLAY_OVERDRAW);
- p->add_check_shortcut(ED_SHORTCUT("spatial_editor/display_shadeless", TTR("Display Shadeless")), MENU_VIEW_DISPLAY_SHADELESS);
- p->add_separator();
p->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_origin", TTR("View Origin")), MENU_VIEW_ORIGIN);
p->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_grid", TTR("View Grid")), MENU_VIEW_GRID);
p->add_separator();
p->add_shortcut(ED_SHORTCUT("spatial_editor/settings", TTR("Settings")), MENU_VIEW_CAMERA_SETTINGS);
- p->set_item_checked(p->get_item_index(MENU_VIEW_USE_DEFAULT_LIGHT), true);
- p->set_item_checked(p->get_item_index(MENU_VIEW_DISPLAY_NORMAL), true);
p->set_item_checked(p->get_item_index(MENU_VIEW_ORIGIN), true);
p->set_item_checked(p->get_item_index(MENU_VIEW_GRID), true);
@@ -3614,10 +3949,10 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
shader_split = memnew(VSplitContainer);
shader_split->set_h_size_flags(SIZE_EXPAND_FILL);
palette_split->add_child(shader_split);
- viewport_base = memnew(Control);
+ viewport_base = memnew(SpatialEditorViewportContainer);
shader_split->add_child(viewport_base);
viewport_base->set_v_size_flags(SIZE_EXPAND_FILL);
- for (int i = 0; i < 4; i++) {
+ for (int i = 0; i < VIEWPORTS_COUNT; i++) {
viewports[i] = memnew(SpatialEditorViewport(this, editor, i));
viewports[i]->connect("toggle_maximize_view", this, "_toggle_maximize_view");
@@ -3653,57 +3988,27 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
settings_dialog->set_title(TTR("Viewport Settings"));
add_child(settings_dialog);
settings_vbc = memnew(VBoxContainer);
- settings_vbc->set_custom_minimum_size(Size2(200, 0));
+ settings_vbc->set_custom_minimum_size(Size2(200, 0) * EDSCALE);
settings_dialog->add_child(settings_vbc);
//settings_dialog->set_child_rect(settings_vbc);
- settings_light_base = memnew(ViewportContainer);
- settings_light_base->set_custom_minimum_size(Size2(128, 128));
- settings_light_base->connect("gui_input", this, "_default_light_angle_input");
- settings_vbc->add_margin_child(TTR("Default Light Normal:"), settings_light_base);
- settings_light_vp = memnew(Viewport);
- settings_light_vp->set_disable_input(true);
- settings_light_vp->set_use_own_world(true);
- settings_light_base->add_child(settings_light_vp);
-
- settings_dlight = memnew(DirectionalLight);
- settings_light_vp->add_child(settings_dlight);
- settings_sphere = memnew(ImmediateGeometry);
- settings_sphere->begin(Mesh::PRIMITIVE_TRIANGLES, Ref<Texture>());
- settings_sphere->set_color(Color(1, 1, 1));
- settings_sphere->add_sphere(32, 16, 1);
- settings_sphere->end();
- settings_light_vp->add_child(settings_sphere);
- settings_camera = memnew(Camera);
- settings_light_vp->add_child(settings_camera);
- settings_camera->set_translation(Vector3(0, 0, 2));
- settings_camera->set_orthogonal(2.1, 0.1, 5);
-
- settings_default_light_rot_x = Math_PI * 0.3;
- settings_default_light_rot_y = Math_PI * 0.2;
-
- settings_ambient_color = memnew(ColorPickerButton);
- settings_vbc->add_margin_child(TTR("Ambient Light Color:"), settings_ambient_color);
- settings_ambient_color->connect("color_changed", this, "_update_ambient_light_color");
- settings_ambient_color->set_pick_color(Color(0.15, 0.15, 0.15));
-
settings_fov = memnew(SpinBox);
- settings_fov->set_max(179);
- settings_fov->set_min(1);
+ settings_fov->set_max(MAX_FOV);
+ settings_fov->set_min(MIN_FOV);
settings_fov->set_step(0.01);
- settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 60.0));
+ settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 55.0));
settings_vbc->add_margin_child(TTR("Perspective FOV (deg.):"), settings_fov);
settings_znear = memnew(SpinBox);
- settings_znear->set_max(10000);
- settings_znear->set_min(0.1);
+ settings_znear->set_max(MAX_Z);
+ settings_znear->set_min(MIN_Z);
settings_znear->set_step(0.01);
settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.1));
settings_vbc->add_margin_child(TTR("View Z-Near:"), settings_znear);
settings_zfar = memnew(SpinBox);
- settings_zfar->set_max(10000);
- settings_zfar->set_min(0.1);
+ settings_zfar->set_max(MAX_Z);
+ settings_zfar->set_min(MIN_Z);
settings_zfar->set_step(0.01);
settings_zfar->set_value(EDITOR_DEF("editors/3d/default_z_far", 1500));
settings_vbc->add_margin_child(TTR("View Z-Far:"), settings_zfar);
@@ -3714,55 +4019,59 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
xform_dialog = memnew(ConfirmationDialog);
xform_dialog->set_title(TTR("Transform Change"));
add_child(xform_dialog);
+
+ VBoxContainer *xform_vbc = memnew(VBoxContainer);
+ xform_dialog->add_child(xform_vbc);
+
Label *l = memnew(Label);
l->set_text(TTR("Translate:"));
- l->set_pos(Point2(5, 5));
- xform_dialog->add_child(l);
+ xform_vbc->add_child(l);
+
+ HBoxContainer *xform_hbc = memnew(HBoxContainer);
+ xform_vbc->add_child(xform_hbc);
for (int i = 0; i < 3; i++) {
xform_translate[i] = memnew(LineEdit);
- xform_translate[i]->set_pos(Point2(15 + i * 60, 22));
- xform_translate[i]->set_size(Size2(50, 12));
- xform_dialog->add_child(xform_translate[i]);
+ xform_translate[i]->set_h_size_flags(SIZE_EXPAND_FILL);
+ xform_hbc->add_child(xform_translate[i]);
}
l = memnew(Label);
l->set_text(TTR("Rotate (deg.):"));
- l->set_pos(Point2(5, 45));
- xform_dialog->add_child(l);
+ xform_vbc->add_child(l);
+
+ xform_hbc = memnew(HBoxContainer);
+ xform_vbc->add_child(xform_hbc);
for (int i = 0; i < 3; i++) {
xform_rotate[i] = memnew(LineEdit);
- xform_rotate[i]->set_pos(Point2(15 + i * 60, 62));
- xform_rotate[i]->set_size(Size2(50, 22));
- xform_dialog->add_child(xform_rotate[i]);
+ xform_rotate[i]->set_h_size_flags(SIZE_EXPAND_FILL);
+ xform_hbc->add_child(xform_rotate[i]);
}
l = memnew(Label);
l->set_text(TTR("Scale (ratio):"));
- l->set_pos(Point2(5, 85));
- xform_dialog->add_child(l);
+ xform_vbc->add_child(l);
+
+ xform_hbc = memnew(HBoxContainer);
+ xform_vbc->add_child(xform_hbc);
for (int i = 0; i < 3; i++) {
xform_scale[i] = memnew(LineEdit);
- xform_scale[i]->set_pos(Point2(15 + i * 60, 102));
- xform_scale[i]->set_size(Size2(50, 22));
- xform_dialog->add_child(xform_scale[i]);
+ xform_scale[i]->set_h_size_flags(SIZE_EXPAND_FILL);
+ xform_hbc->add_child(xform_scale[i]);
}
l = memnew(Label);
l->set_text(TTR("Transform Type"));
- l->set_pos(Point2(5, 125));
- xform_dialog->add_child(l);
+ xform_vbc->add_child(l);
xform_type = memnew(OptionButton);
- xform_type->set_anchor(MARGIN_RIGHT, ANCHOR_END);
- xform_type->set_begin(Point2(15, 142));
- xform_type->set_end(Point2(15, 75));
+ xform_type->set_h_size_flags(SIZE_EXPAND_FILL);
xform_type->add_item(TTR("Pre"));
xform_type->add_item(TTR("Post"));
- xform_dialog->add_child(xform_type);
+ xform_vbc->add_child(xform_type);
xform_dialog->connect("confirmed", this, "_xform_dialog_action");
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h
index e0d2a38956..2fd72739df 100644
--- a/editor/plugins/spatial_editor_plugin.h
+++ b/editor/plugins/spatial_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -82,7 +83,13 @@ class SpatialEditorViewport : public Control {
VIEW_ENVIRONMENT,
VIEW_ORTHOGONAL,
VIEW_AUDIO_LISTENER,
+ VIEW_AUDIO_DOPPLER,
VIEW_GIZMOS,
+ VIEW_INFORMATION,
+ VIEW_DISPLAY_NORMAL,
+ VIEW_DISPLAY_WIREFRAME,
+ VIEW_DISPLAY_OVERDRAW,
+ VIEW_DISPLAY_SHADELESS,
};
public:
@@ -113,6 +120,11 @@ private:
bool orthogonal;
float gizmo_scale;
+ bool freelook_active;
+
+ PanelContainer *info;
+ Label *info_label;
+
struct _RayResult {
Spatial *item;
@@ -139,7 +151,7 @@ private:
Vector3 _get_screen_to_space(const Vector3 &p_vector3);
void _select_region();
- bool _gizmo_select(const Vector2 &p_screenpos, bool p_hilite_only = false);
+ bool _gizmo_select(const Vector2 &p_screenpos, bool p_highlight_only = false);
float get_znear() const;
float get_zfar() const;
@@ -167,7 +179,8 @@ private:
NAVIGATION_NONE,
NAVIGATION_PAN,
NAVIGATION_ZOOM,
- NAVIGATION_ORBIT
+ NAVIGATION_ORBIT,
+ NAVIGATION_LOOK
};
enum TransformMode {
TRANSFORM_NONE,
@@ -202,8 +215,6 @@ private:
struct Cursor {
- Vector3 cursor_pos;
-
Vector3 pos;
float x_rot, y_rot, distance;
bool region_select;
@@ -216,6 +227,10 @@ private:
}
} cursor;
+ void scale_cursor_distance(real_t scale);
+
+ real_t zoom_indicator_delay;
+
RID move_gizmo_instance[3], rotate_gizmo_instance[3];
String last_message;
@@ -226,10 +241,12 @@ private:
//
void _update_camera();
+ Transform to_camera_transform(const Cursor &p_cursor) const;
void _draw();
void _smouseenter();
- void _sinput(const InputEvent &p_ie);
+ void _sinput(const Ref<InputEvent> &p_event);
+ void _update_freelook(real_t delta);
SpatialEditor *spatial_editor;
Camera *previewing;
@@ -241,7 +258,8 @@ private:
void _finish_gizmo_instances();
void _selection_result_pressed(int);
void _selection_menu_hide();
- void _list_select(InputEventMouseButton b);
+ void _list_select(Ref<InputEventMouseButton> b);
+ Point2i _get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const;
protected:
void _notification(int p_what);
@@ -254,6 +272,7 @@ public:
void set_state(const Dictionary &p_state);
Dictionary get_state() const;
void reset();
+ bool is_freelook_active() const { return freelook_active; }
void focus_selection();
@@ -277,6 +296,43 @@ public:
~SpatialEditorSelectedItem();
};
+class SpatialEditorViewportContainer : public Container {
+
+ GDCLASS(SpatialEditorViewportContainer, Container)
+public:
+ enum View {
+ VIEW_USE_1_VIEWPORT,
+ VIEW_USE_2_VIEWPORTS,
+ VIEW_USE_2_VIEWPORTS_ALT,
+ VIEW_USE_3_VIEWPORTS,
+ VIEW_USE_3_VIEWPORTS_ALT,
+ VIEW_USE_4_VIEWPORTS,
+ };
+
+private:
+ View view;
+ bool mouseover;
+ float ratio_h;
+ float ratio_v;
+
+ bool dragging_v;
+ bool dragging_h;
+ Vector2 drag_begin_pos;
+ Vector2 drag_begin_ratio;
+
+ void _gui_input(const Ref<InputEvent> &p_event);
+
+protected:
+ void _notification(int p_what);
+ static void _bind_methods();
+
+public:
+ void set_view(View p_view);
+ View get_view();
+
+ SpatialEditorViewportContainer();
+};
+
class SpatialEditor : public VBoxContainer {
GDCLASS(SpatialEditor, VBoxContainer);
@@ -294,11 +350,13 @@ public:
};
private:
+ static const unsigned int VIEWPORTS_COUNT = 4;
+
EditorNode *editor;
EditorSelection *editor_selection;
- Control *viewport_base;
- SpatialEditorViewport *viewports[4];
+ SpatialEditorViewportContainer *viewport_base;
+ SpatialEditorViewport *viewports[VIEWPORTS_COUNT];
VSplitContainer *shader_split;
HSplitContainer *palette_split;
@@ -309,10 +367,6 @@ private:
VisualServer::ScenarioDebugMode scenario_debug;
- RID light;
- RID light_instance;
- Transform light_transform;
-
RID origin;
RID origin_instance;
RID grid[3];
@@ -322,19 +376,19 @@ private:
bool grid_enable[3]; //should be always visible if true
bool grid_enabled;
- Ref<Mesh> move_gizmo[3], rotate_gizmo[3];
- Ref<FixedSpatialMaterial> gizmo_color[3];
- Ref<FixedSpatialMaterial> gizmo_hl;
+ Ref<ArrayMesh> move_gizmo[3], rotate_gizmo[3];
+ Ref<SpatialMaterial> gizmo_color[3];
+ Ref<SpatialMaterial> gizmo_hl;
int over_gizmo_handle;
- Ref<Mesh> selection_box;
+ Ref<ArrayMesh> selection_box;
RID indicators;
RID indicators_instance;
RID cursor_mesh;
RID cursor_instance;
- Ref<FixedSpatialMaterial> indicator_mat;
- Ref<FixedSpatialMaterial> cursor_material;
+ Ref<SpatialMaterial> indicator_mat;
+ Ref<SpatialMaterial> cursor_material;
/*
struct Selected {
@@ -371,12 +425,6 @@ private:
MENU_VIEW_USE_3_VIEWPORTS,
MENU_VIEW_USE_3_VIEWPORTS_ALT,
MENU_VIEW_USE_4_VIEWPORTS,
- MENU_VIEW_USE_DEFAULT_LIGHT,
- MENU_VIEW_USE_DEFAULT_SRGB,
- MENU_VIEW_DISPLAY_NORMAL,
- MENU_VIEW_DISPLAY_WIREFRAME,
- MENU_VIEW_DISPLAY_OVERDRAW,
- MENU_VIEW_DISPLAY_SHADELESS,
MENU_VIEW_ORIGIN,
MENU_VIEW_GRID,
MENU_VIEW_CAMERA_SETTINGS,
@@ -384,7 +432,6 @@ private:
};
Button *tool_button[TOOL_MAX];
- Button *instance_button;
MenuButton *transform_menu;
MenuButton *view_menu;
@@ -408,16 +455,6 @@ private:
SpinBox *settings_fov;
SpinBox *settings_znear;
SpinBox *settings_zfar;
- DirectionalLight *settings_dlight;
- ImmediateGeometry *settings_sphere;
- Camera *settings_camera;
- float settings_default_light_rot_x;
- float settings_default_light_rot_y;
-
- ViewportContainer *settings_light_base;
- Viewport *settings_light_vp;
- ColorPickerButton *settings_ambient_color;
- Image settings_light_dir_image;
void _xform_dialog_action();
void _menu_item_pressed(int p_option);
@@ -451,14 +488,12 @@ private:
SpatialEditorGizmos *gizmos;
SpatialEditor();
- void _update_ambient_light_color(const Color &p_color);
- void _update_default_light_angle();
- void _default_light_angle_input(const InputEvent &p_event);
+ bool is_any_freelook_active() const;
protected:
void _notification(int p_what);
//void _gui_input(InputEvent p_event);
- void _unhandled_key_input(InputEvent p_event);
+ void _unhandled_key_input(Ref<InputEvent> p_event);
static void _bind_methods();
@@ -479,12 +514,14 @@ public:
float get_rotate_snap() const { return snap_rotate->get_text().to_double(); }
float get_scale_snap() const { return snap_scale->get_text().to_double(); }
- Ref<Mesh> get_move_gizmo(int idx) const { return move_gizmo[idx]; }
- Ref<Mesh> get_rotate_gizmo(int idx) const { return rotate_gizmo[idx]; }
+ bool are_local_coords_enabled() const { return transform_menu->get_popup()->is_item_checked(transform_menu->get_popup()->get_item_index(SpatialEditor::MENU_TRANSFORM_LOCAL_COORDS)); }
+
+ Ref<ArrayMesh> get_move_gizmo(int idx) const { return move_gizmo[idx]; }
+ Ref<ArrayMesh> get_rotate_gizmo(int idx) const { return rotate_gizmo[idx]; }
void update_transform_gizmo();
- void select_gizmo_hilight_axis(int p_axis);
+ void select_gizmo_highlight_axis(int p_axis);
void set_custom_camera(Node *p_camera) { custom_camera = p_camera; }
void set_undo_redo(UndoRedo *p_undo_redo) { undo_redo = p_undo_redo; }
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 7adfb90e6f..0f008552d0 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,11 +30,11 @@
#include "sprite_frames_editor_plugin.h"
#include "editor/editor_settings.h"
-#include "global_config.h"
#include "io/resource_loader.h"
+#include "project_settings.h"
#include "scene/3d/sprite_3d.h"
-void SpriteFramesEditor::_gui_input(InputEvent p_event) {
+void SpriteFramesEditor::_gui_input(Ref<InputEvent> p_event) {
}
void SpriteFramesEditor::_notification(int p_what) {
@@ -713,7 +714,7 @@ void SpriteFramesEditor::_bind_methods() {
SpriteFramesEditor::SpriteFramesEditor() {
- //add_style_override("panel", get_stylebox("panel","Panel"));
+ //add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("panel","Panel"));
split = memnew(HSplitContainer);
add_child(split);
diff --git a/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h
index 3e9ba710f3..c0eb1ec3d0 100644
--- a/editor/plugins/sprite_frames_editor_plugin.h
+++ b/editor/plugins/sprite_frames_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -99,7 +100,7 @@ class SpriteFramesEditor : public PanelContainer {
protected:
void _notification(int p_what);
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
static void _bind_methods();
public:
@@ -120,8 +121,8 @@ class SpriteFramesEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "SpriteFrames"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
SpriteFramesEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/stream_editor_plugin.cpp b/editor/plugins/stream_editor_plugin.cpp
index 449f6f610e..dd97ce936d 100644
--- a/editor/plugins/stream_editor_plugin.cpp
+++ b/editor/plugins/stream_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -83,7 +84,7 @@ StreamEditor::StreamEditor() {
stop = memnew( Button );
- stop->set_pos(Point2( 35, 5 ));
+ stop->set_position(Point2( 35, 5 ));
stop->set_anchor_and_margin(MARGIN_LEFT,Control::ANCHOR_END,30);
stop->set_anchor_and_margin(MARGIN_RIGHT,Control::ANCHOR_END,10);
stop->set_anchor_and_margin(MARGIN_TOP,Control::ANCHOR_BEGIN,0);
diff --git a/editor/plugins/stream_editor_plugin.h b/editor/plugins/stream_editor_plugin.h
index 6b68ba02f9..cdd1c126ad 100644
--- a/editor/plugins/stream_editor_plugin.h
+++ b/editor/plugins/stream_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/style_box_editor_plugin.cpp b/editor/plugins/style_box_editor_plugin.cpp
index 093f25e2b0..d421b203e9 100644
--- a/editor/plugins/style_box_editor_plugin.cpp
+++ b/editor/plugins/style_box_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -60,12 +61,12 @@ StyleBoxEditor::StyleBoxEditor() {
Label *l = memnew(Label);
l->set_text(TTR("StyleBox Preview:"));
- l->set_pos(Point2(5, 5));
+ l->set_position(Point2(5, 5));
panel->add_child(l);
preview = memnew(Panel);
panel->add_child(preview);
- preview->set_pos(Point2(50, 50));
+ preview->set_position(Point2(50, 50));
preview->set_size(Size2(200, 100));
}
diff --git a/editor/plugins/style_box_editor_plugin.h b/editor/plugins/style_box_editor_plugin.h
index 1dfe48d97f..effcdb7e5a 100644
--- a/editor/plugins/style_box_editor_plugin.h
+++ b/editor/plugins/style_box_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp
index 3d05e68cac..57c27a8a7e 100644
--- a/editor/plugins/texture_editor_plugin.cpp
+++ b/editor/plugins/texture_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,10 +30,10 @@
#include "texture_editor_plugin.h"
#include "editor/editor_settings.h"
-#include "global_config.h"
#include "io/resource_loader.h"
+#include "project_settings.h"
-void TextureEditor::_gui_input(InputEvent p_event) {
+void TextureEditor::_gui_input(Ref<InputEvent> p_event) {
}
void TextureEditor::_notification(int p_what) {
@@ -60,9 +61,21 @@ void TextureEditor::_notification(int p_what) {
tex_height = texture->get_height() * tex_width / texture->get_width();
}
+ // Prevent the texture from being unpreviewable after the rescale, so that we can still see something
+ if (tex_height <= 0)
+ tex_height = 1;
+ if (tex_width <= 0)
+ tex_width = 1;
+
int ofs_x = (size.width - tex_width) / 2;
int ofs_y = (size.height - tex_height) / 2;
+ if (texture->cast_to<CurveTexture>()) {
+ // In the case of CurveTextures we know they are 1 in height, so fill the preview to see the gradient
+ ofs_y = 0;
+ tex_height = size.height;
+ }
+
draw_texture_rect(texture, Rect2(ofs_x, ofs_y, tex_width, tex_height));
Ref<Font> font = get_font("font", "Label");
@@ -70,6 +83,8 @@ void TextureEditor::_notification(int p_what) {
String format;
if (texture->cast_to<ImageTexture>()) {
format = Image::get_format_name(texture->cast_to<ImageTexture>()->get_format());
+ } else if (texture->cast_to<StreamTexture>()) {
+ format = Image::get_format_name(texture->cast_to<StreamTexture>()->get_format());
} else {
format = texture->get_class();
}
@@ -87,14 +102,24 @@ void TextureEditor::_notification(int p_what) {
}
}
+void TextureEditor::_changed_callback(Object *p_changed, const char *p_prop) {
+
+ if (!is_visible())
+ return;
+ update();
+}
+
void TextureEditor::edit(Ref<Texture> p_texture) {
+ if (!texture.is_null())
+ texture->remove_change_receptor(this);
+
texture = p_texture;
- if (!texture.is_null())
+ if (!texture.is_null()) {
+ texture->add_change_receptor(this);
update();
- else {
-
+ } else {
hide();
}
}
diff --git a/editor/plugins/texture_editor_plugin.h b/editor/plugins/texture_editor_plugin.h
index 083fbada8b..2b5e7ed629 100644
--- a/editor/plugins/texture_editor_plugin.h
+++ b/editor/plugins/texture_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,7 +42,8 @@ class TextureEditor : public Control {
protected:
void _notification(int p_what);
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
+ void _changed_callback(Object *p_changed, const char *p_prop);
static void _bind_methods();
public:
@@ -59,8 +61,8 @@ class TextureEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "Texture"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
TextureEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index c0b410ba99..d878bba427 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Author: Mariano Suligoy */
/* */
@@ -113,10 +114,10 @@ void TextureRegionEditor::_region_draw() {
for (List<Rect2>::Element *E = autoslice_cache.front(); E; E = E->next()) {
Rect2 r = E->get();
Vector2 endpoints[4] = {
- mtx.basis_xform(r.pos),
- mtx.basis_xform(r.pos + Vector2(r.size.x, 0)),
- mtx.basis_xform(r.pos + r.size),
- mtx.basis_xform(r.pos + Vector2(0, r.size.y))
+ mtx.basis_xform(r.position),
+ mtx.basis_xform(r.position + Vector2(r.size.x, 0)),
+ mtx.basis_xform(r.position + r.size),
+ mtx.basis_xform(r.position + Vector2(0, r.size.y))
};
for (int i = 0; i < 4; i++) {
int next = (i + 1) % 4;
@@ -131,10 +132,10 @@ void TextureRegionEditor::_region_draw() {
scroll_rect.expand_to(mtx.basis_xform(edit_draw->get_size()));
Vector2 endpoints[4] = {
- mtx.basis_xform(rect.pos),
- mtx.basis_xform(rect.pos + Vector2(rect.size.x, 0)),
- mtx.basis_xform(rect.pos + rect.size),
- mtx.basis_xform(rect.pos + Vector2(0, rect.size.y))
+ mtx.basis_xform(rect.position),
+ mtx.basis_xform(rect.position + Vector2(rect.size.x, 0)),
+ mtx.basis_xform(rect.position + rect.size),
+ mtx.basis_xform(rect.position + Vector2(0, rect.size.y))
};
Color color(0.9, 0.5, 0.5);
for (int i = 0; i < 4; i++) {
@@ -161,14 +162,14 @@ void TextureRegionEditor::_region_draw() {
scroll_rect = scroll_rect.grow(200);
updating_scroll = true;
- hscroll->set_min(scroll_rect.pos.x);
- hscroll->set_max(scroll_rect.pos.x + scroll_rect.size.x);
+ hscroll->set_min(scroll_rect.position.x);
+ hscroll->set_max(scroll_rect.position.x + scroll_rect.size.x);
hscroll->set_page(edit_draw->get_size().x);
hscroll->set_value(draw_ofs.x);
hscroll->set_step(0.001);
- vscroll->set_min(scroll_rect.pos.y);
- vscroll->set_max(scroll_rect.pos.y + scroll_rect.size.y);
+ vscroll->set_min(scroll_rect.position.y);
+ vscroll->set_max(scroll_rect.position.y + scroll_rect.size.y);
vscroll->set_page(edit_draw->get_size().y);
vscroll->set_value(draw_ofs.y);
vscroll->set_step(0.001);
@@ -201,29 +202,28 @@ void TextureRegionEditor::_region_draw() {
}
}
-void TextureRegionEditor::_region_input(const InputEvent &p_input) {
+void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
Transform2D mtx;
mtx.elements[2] = -draw_ofs;
mtx.scale_basis(Vector2(draw_zoom, draw_zoom));
Vector2 endpoints[8] = {
- mtx.xform(rect.pos) + Vector2(-4, -4),
- mtx.xform(rect.pos + Vector2(rect.size.x / 2, 0)) + Vector2(0, -4),
- mtx.xform(rect.pos + Vector2(rect.size.x, 0)) + Vector2(4, -4),
- mtx.xform(rect.pos + Vector2(rect.size.x, rect.size.y / 2)) + Vector2(4, 0),
- mtx.xform(rect.pos + rect.size) + Vector2(4, 4),
- mtx.xform(rect.pos + Vector2(rect.size.x / 2, rect.size.y)) + Vector2(0, 4),
- mtx.xform(rect.pos + Vector2(0, rect.size.y)) + Vector2(-4, 4),
- mtx.xform(rect.pos + Vector2(0, rect.size.y / 2)) + Vector2(-4, 0)
+ mtx.xform(rect.position) + Vector2(-4, -4),
+ mtx.xform(rect.position + Vector2(rect.size.x / 2, 0)) + Vector2(0, -4),
+ mtx.xform(rect.position + Vector2(rect.size.x, 0)) + Vector2(4, -4),
+ mtx.xform(rect.position + Vector2(rect.size.x, rect.size.y / 2)) + Vector2(4, 0),
+ mtx.xform(rect.position + rect.size) + Vector2(4, 4),
+ mtx.xform(rect.position + Vector2(rect.size.x / 2, rect.size.y)) + Vector2(0, 4),
+ mtx.xform(rect.position + Vector2(0, rect.size.y)) + Vector2(-4, 4),
+ mtx.xform(rect.position + Vector2(0, rect.size.y / 2)) + Vector2(-4, 0)
};
- if (p_input.type == InputEvent::MOUSE_BUTTON) {
+ Ref<InputEventMouseButton> mb = p_input;
+ if (mb.is_valid()) {
- const InputEventMouseButton &mb = p_input.mouse_button;
+ if (mb->get_button_index() == BUTTON_LEFT) {
- if (mb.button_index == BUTTON_LEFT) {
-
- if (mb.pressed) {
+ if (mb->is_pressed()) {
if (node_patch9 || obj_styleBox.is_valid()) {
edited_margin = -1;
float margins[4];
@@ -239,31 +239,31 @@ void TextureRegionEditor::_region_input(const InputEvent &p_input) {
margins[3] = obj_styleBox->get_margin_size(MARGIN_RIGHT);
}
Vector2 pos[4] = {
- mtx.basis_xform(rect.pos + Vector2(0, margins[0])) - draw_ofs,
- mtx.basis_xform(rect.pos + rect.size - Vector2(0, margins[1])) - draw_ofs,
- mtx.basis_xform(rect.pos + Vector2(margins[2], 0)) - draw_ofs,
- mtx.basis_xform(rect.pos + rect.size - Vector2(margins[3], 0)) - draw_ofs
+ mtx.basis_xform(rect.position + Vector2(0, margins[0])) - draw_ofs,
+ mtx.basis_xform(rect.position + rect.size - Vector2(0, margins[1])) - draw_ofs,
+ mtx.basis_xform(rect.position + Vector2(margins[2], 0)) - draw_ofs,
+ mtx.basis_xform(rect.position + rect.size - Vector2(margins[3], 0)) - draw_ofs
};
- if (Math::abs(mb.y - pos[0].y) < 8) {
+ if (Math::abs(mb->get_position().y - pos[0].y) < 8) {
edited_margin = 0;
prev_margin = margins[0];
- } else if (Math::abs(mb.y - pos[1].y) < 8) {
+ } else if (Math::abs(mb->get_position().y - pos[1].y) < 8) {
edited_margin = 1;
prev_margin = margins[1];
- } else if (Math::abs(mb.x - pos[2].x) < 8) {
+ } else if (Math::abs(mb->get_position().x - pos[2].x) < 8) {
edited_margin = 2;
prev_margin = margins[2];
- } else if (Math::abs(mb.x - pos[3].x) < 8) {
+ } else if (Math::abs(mb->get_position().x - pos[3].x) < 8) {
edited_margin = 3;
prev_margin = margins[3];
}
if (edited_margin >= 0) {
- drag_from = Vector2(mb.x, mb.y);
+ drag_from = Vector2(mb->get_position().x, mb->get_position().y);
drag = true;
}
}
if (edited_margin < 0 && snap_mode == SNAP_AUTOSLICE) {
- Vector2 point = mtx.affine_inverse().xform(Vector2(mb.x, mb.y));
+ Vector2 point = mtx.affine_inverse().xform(Vector2(mb->get_position().x, mb->get_position().y));
for (List<Rect2>::Element *E = autoslice_cache.front(); E; E = E->next()) {
if (E->get().has_point(point)) {
rect = E->get();
@@ -277,8 +277,8 @@ void TextureRegionEditor::_region_input(const InputEvent &p_input) {
r = obj_styleBox->get_region_rect();
else if (atlas_tex.is_valid())
r = atlas_tex->get_region();
- rect.expand_to(r.pos);
- rect.expand_to(r.pos + r.size);
+ rect.expand_to(r.position);
+ rect.expand_to(r.position + r.size);
}
undo_redo->create_action("Set Region Rect");
if (node_sprite) {
@@ -301,7 +301,7 @@ void TextureRegionEditor::_region_input(const InputEvent &p_input) {
}
}
} else if (edited_margin < 0) {
- drag_from = mtx.affine_inverse().xform(Vector2(mb.x, mb.y));
+ drag_from = mtx.affine_inverse().xform(Vector2(mb->get_position().x, mb->get_position().y));
if (snap_mode == SNAP_PIXEL)
drag_from = drag_from.snapped(Vector2(1, 1));
else if (snap_mode == SNAP_GRID)
@@ -318,7 +318,7 @@ void TextureRegionEditor::_region_input(const InputEvent &p_input) {
for (int i = 0; i < 8; i++) {
Vector2 tuv = endpoints[i];
- if (tuv.distance_to(Vector2(mb.x, mb.y)) < 8) {
+ if (tuv.distance_to(Vector2(mb->get_position().x, mb->get_position().y)) < 8) {
drag_index = i;
}
}
@@ -368,7 +368,7 @@ void TextureRegionEditor::_region_input(const InputEvent &p_input) {
creating = false;
}
- } else if (mb.button_index == BUTTON_RIGHT && mb.pressed) {
+ } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed()) {
if (drag) {
drag = false;
@@ -386,18 +386,20 @@ void TextureRegionEditor::_region_input(const InputEvent &p_input) {
drag_index = -1;
}
}
- } else if (mb.button_index == BUTTON_WHEEL_UP && mb.pressed) {
+ } else if (mb->get_button_index() == BUTTON_WHEEL_UP && mb->is_pressed()) {
_zoom_in();
- } else if (mb.button_index == BUTTON_WHEEL_DOWN && mb.pressed) {
+ } else if (mb->get_button_index() == BUTTON_WHEEL_DOWN && mb->is_pressed()) {
_zoom_out();
}
- } else if (p_input.type == InputEvent::MOUSE_MOTION) {
+ }
+
+ Ref<InputEventMouseMotion> mm = p_input;
- const InputEventMouseMotion &mm = p_input.mouse_motion;
+ if (mm.is_valid()) {
- if (mm.button_mask & BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) {
+ if (mm->get_button_mask() & BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) {
- Vector2 draged(mm.relative_x, mm.relative_y);
+ Vector2 draged(mm->get_relative().x, mm->get_relative().y);
hscroll->set_value(hscroll->get_value() - draged.x);
vscroll->set_value(vscroll->get_value() - draged.y);
@@ -406,13 +408,13 @@ void TextureRegionEditor::_region_input(const InputEvent &p_input) {
if (edited_margin >= 0) {
float new_margin;
if (edited_margin == 0)
- new_margin = prev_margin + (mm.y - drag_from.y) / draw_zoom;
+ new_margin = prev_margin + (mm->get_position().y - drag_from.y) / draw_zoom;
else if (edited_margin == 1)
- new_margin = prev_margin - (mm.y - drag_from.y) / draw_zoom;
+ new_margin = prev_margin - (mm->get_position().y - drag_from.y) / draw_zoom;
else if (edited_margin == 2)
- new_margin = prev_margin + (mm.x - drag_from.x) / draw_zoom;
+ new_margin = prev_margin + (mm->get_position().x - drag_from.x) / draw_zoom;
else if (edited_margin == 3)
- new_margin = prev_margin - (mm.x - drag_from.x) / draw_zoom;
+ new_margin = prev_margin - (mm->get_position().x - drag_from.x) / draw_zoom;
if (new_margin < 0)
new_margin = 0;
static Margin m[4] = { MARGIN_TOP, MARGIN_BOTTOM, MARGIN_LEFT, MARGIN_RIGHT };
@@ -421,7 +423,7 @@ void TextureRegionEditor::_region_input(const InputEvent &p_input) {
if (obj_styleBox.is_valid())
obj_styleBox->set_margin_size(m[edited_margin], new_margin);
} else {
- Vector2 new_pos = mtx.affine_inverse().xform(Vector2(mm.x, mm.y));
+ Vector2 new_pos = mtx.affine_inverse().xform(mm->get_position());
if (snap_mode == SNAP_PIXEL)
new_pos = new_pos.snapped(Vector2(1, 1));
else if (snap_mode == SNAP_GRID)
@@ -437,49 +439,49 @@ void TextureRegionEditor::_region_input(const InputEvent &p_input) {
switch (drag_index) {
case 0: {
- Vector2 p = rect_prev.pos + rect_prev.size;
+ Vector2 p = rect_prev.position + rect_prev.size;
rect = Rect2(p, Size2());
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 1: {
- Vector2 p = rect_prev.pos + Vector2(0, rect_prev.size.y);
+ Vector2 p = rect_prev.position + Vector2(0, rect_prev.size.y);
rect = Rect2(p, Size2(rect_prev.size.x, 0));
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 2: {
- Vector2 p = rect_prev.pos + Vector2(0, rect_prev.size.y);
+ Vector2 p = rect_prev.position + Vector2(0, rect_prev.size.y);
rect = Rect2(p, Size2());
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 3: {
- Vector2 p = rect_prev.pos;
+ Vector2 p = rect_prev.position;
rect = Rect2(p, Size2(0, rect_prev.size.y));
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 4: {
- Vector2 p = rect_prev.pos;
+ Vector2 p = rect_prev.position;
rect = Rect2(p, Size2());
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 5: {
- Vector2 p = rect_prev.pos;
+ Vector2 p = rect_prev.position;
rect = Rect2(p, Size2(rect_prev.size.x, 0));
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 6: {
- Vector2 p = rect_prev.pos + Vector2(rect_prev.size.x, 0);
+ Vector2 p = rect_prev.position + Vector2(rect_prev.size.x, 0);
rect = Rect2(p, Size2());
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 7: {
- Vector2 p = rect_prev.pos + Vector2(rect_prev.size.x, 0);
+ Vector2 p = rect_prev.position + Vector2(rect_prev.size.x, 0);
rect = Rect2(p, Size2(0, rect_prev.size.y));
rect.expand_to(new_pos);
apply_rect(rect);
@@ -615,38 +617,24 @@ void TextureRegionEditor::_bind_methods() {
}
void TextureRegionEditor::edit(Object *p_obj) {
- if (node_sprite && node_sprite->is_connected("texture_changed", this, "_edit_region"))
- node_sprite->disconnect("texture_changed", this, "_edit_region");
- if (node_patch9 && node_patch9->is_connected("texture_changed", this, "_edit_region"))
- node_patch9->disconnect("texture_changed", this, "_edit_region");
- if (obj_styleBox.is_valid() && obj_styleBox->is_connected("texture_changed", this, "_edit_region"))
- obj_styleBox->disconnect("texture_changed", this, "_edit_region");
- if (atlas_tex.is_valid() && atlas_tex->is_connected("atlas_changed", this, "_edit_region"))
- atlas_tex->disconnect("atlas_changed", this, "_edit_region");
+ if (node_sprite)
+ node_sprite->remove_change_receptor(this);
+ if (node_patch9)
+ node_patch9->remove_change_receptor(this);
+ if (obj_styleBox.is_valid())
+ obj_styleBox->remove_change_receptor(this);
+ if (atlas_tex.is_valid())
+ atlas_tex->remove_change_receptor(this);
if (p_obj) {
node_sprite = p_obj->cast_to<Sprite>();
node_patch9 = p_obj->cast_to<NinePatchRect>();
if (p_obj->cast_to<StyleBoxTexture>())
obj_styleBox = Ref<StyleBoxTexture>(p_obj->cast_to<StyleBoxTexture>());
- if (p_obj->cast_to<AtlasTexture>()) {
+ if (p_obj->cast_to<AtlasTexture>())
atlas_tex = Ref<AtlasTexture>(p_obj->cast_to<AtlasTexture>());
- atlas_tex->connect("atlas_changed", this, "_edit_region");
- } else {
- p_obj->connect("texture_changed", this, "_edit_region");
- }
p_obj->add_change_receptor(this);
- p_obj->connect("tree_exited", this, "_node_removed", varray(p_obj), CONNECT_ONESHOT);
_edit_region();
} else {
- if (node_sprite)
- node_sprite->disconnect("tree_exited", this, "_node_removed");
- else if (node_patch9)
- node_patch9->disconnect("tree_exited", this, "_node_removed");
- else if (obj_styleBox.is_valid())
- obj_styleBox->disconnect("tree_exited", this, "_node_removed");
- else if (atlas_tex.is_valid())
- atlas_tex->disconnect("tree_exited", this, "_node_removed");
-
node_sprite = NULL;
node_patch9 = NULL;
obj_styleBox = Ref<StyleBoxTexture>(NULL);
@@ -656,9 +644,11 @@ void TextureRegionEditor::edit(Object *p_obj) {
}
void TextureRegionEditor::_changed_callback(Object *p_changed, const char *p_prop) {
- if ((String)p_prop == "region_rect") {
+
+ if (!is_visible())
+ return;
+ if (p_prop == StringName("atlas") || p_prop == StringName("texture"))
_edit_region();
- }
}
void TextureRegionEditor::_edit_region() {
@@ -677,12 +667,13 @@ void TextureRegionEditor::_edit_region() {
}
autoslice_cache.clear();
- Image i;
- if (i.load(texture->get_path()) == OK) {
+ Ref<Image> i;
+ i.instance();
+ if (i->load(texture->get_path()) == OK) {
BitMap bm;
bm.create_from_image_alpha(i);
- for (int y = 0; y < i.get_height(); y++) {
- for (int x = 0; x < i.get_width(); x++) {
+ for (int y = 0; y < i->get_height(); y++) {
+ for (int x = 0; x < i->get_width(); x++) {
if (bm.get_bit(Point2(x, y))) {
bool found = false;
for (List<Rect2>::Element *E = autoslice_cache.front(); E; E = E->next()) {
@@ -690,7 +681,7 @@ void TextureRegionEditor::_edit_region() {
if (grown.has_point(Point2(x, y))) {
E->get().expand_to(Point2(x, y));
E->get().expand_to(Point2(x + 1, y + 1));
- x = E->get().pos.x + E->get().size.x - 1;
+ x = E->get().position.x + E->get().size.x - 1;
bool merged = true;
while (merged) {
merged = false;
@@ -703,8 +694,8 @@ void TextureRegionEditor::_edit_region() {
if (F == E)
continue;
if (E->get().grow(1).intersects(F->get())) {
- E->get().expand_to(F->get().pos);
- E->get().expand_to(F->get().pos + F->get().size);
+ E->get().expand_to(F->get().position);
+ E->get().expand_to(F->get().position + F->get().size);
if (F->prev()) {
F = F->prev();
autoslice_cache.erase(F->next());
@@ -789,6 +780,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) {
hb_tools->add_child(snap_mode_button);
snap_mode_button->set_text(TTR("<None>"));
PopupMenu *p = snap_mode_button->get_popup();
+ p->set_hide_on_checkable_item_selection(false);
p->add_item(TTR("<None>"), 0);
p->add_item(TTR("Pixel Snap"), 1);
p->add_item(TTR("Grid Snap"), 2);
@@ -906,12 +898,12 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) {
edit_draw->set_clip_contents(true);
}
-void TextureRegionEditorPlugin::edit(Object *p_node) {
- region_editor->edit(p_node);
+void TextureRegionEditorPlugin::edit(Object *p_object) {
+ region_editor->edit(p_object);
}
-bool TextureRegionEditorPlugin::handles(Object *p_obj) const {
- return p_obj->is_class("Sprite") || p_obj->is_class("Patch9Rect") || p_obj->is_class("StyleBoxTexture") || p_obj->is_class("AtlasTexture");
+bool TextureRegionEditorPlugin::handles(Object *p_object) const {
+ return p_object->is_class("Sprite") || p_object->is_class("Patch9Rect") || p_object->is_class("StyleBoxTexture") || p_object->is_class("AtlasTexture");
}
void TextureRegionEditorPlugin::make_visible(bool p_visible) {
diff --git a/editor/plugins/texture_region_editor_plugin.h b/editor/plugins/texture_region_editor_plugin.h
index b3763acc22..265d46cb08 100644
--- a/editor/plugins/texture_region_editor_plugin.h
+++ b/editor/plugins/texture_region_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Author: Mariano Suligoy */
/* */
@@ -121,7 +122,7 @@ protected:
public:
void _edit_region();
void _region_draw();
- void _region_input(const InputEvent &p_input);
+ void _region_input(const Ref<InputEvent> &p_input);
void _scroll_changed(float);
void edit(Object *p_obj);
@@ -138,8 +139,8 @@ class TextureRegionEditorPlugin : public EditorPlugin {
public:
virtual String get_name() const { return "TextureRegion"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
void set_state(const Dictionary &p_state);
Dictionary get_state() const;
diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp
index 03316cc7d9..d45a3b1312 100644
--- a/editor/plugins/theme_editor_plugin.cpp
+++ b/editor/plugins/theme_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -103,7 +104,7 @@ struct _TECategory {
Ref<T> item;
StringName name;
- bool operator<(const RefItem<T> &p) const { return item->get_instance_ID() < p.item->get_instance_ID(); }
+ bool operator<(const RefItem<T> &p) const { return item->get_instance_id() < p.item->get_instance_id(); }
};
template <class T>
@@ -492,11 +493,10 @@ void ThemeEditor::_theme_menu_cbk(int p_option) {
Ref<Theme> base_theme;
- type_select->show();
- type_select_label->show();
name_select_label->show();
- name_edit->show();
- name_menu->show();
+ name_hbc->show();
+ type_select_label->show();
+ type_select->show();
if (p_option == POPUP_ADD) { //add
@@ -514,11 +514,10 @@ void ThemeEditor::_theme_menu_cbk(int p_option) {
base_theme = Theme::get_default();
- type_select->hide();
name_select_label->hide();
+ name_hbc->hide();
type_select_label->hide();
- name_edit->hide();
- name_menu->hide();
+ type_select->hide();
} else if (p_option == POPUP_REMOVE) {
@@ -536,11 +535,10 @@ void ThemeEditor::_theme_menu_cbk(int p_option) {
base_theme = Theme::get_default();
- type_select->hide();
name_select_label->hide();
+ name_hbc->hide();
type_select_label->hide();
- name_edit->hide();
- name_menu->hide();
+ type_select->hide();
}
popup_mode = p_option;
@@ -639,7 +637,7 @@ ThemeEditor::ThemeEditor() {
theme_menu->get_popup()->add_item(TTR("Create Empty Editor Template"), POPUP_CREATE_EDITOR_EMPTY);
add_child(theme_menu);
- theme_menu->set_pos(Vector2(3, 3) * EDSCALE);
+ theme_menu->set_position(Vector2(3, 3) * EDSCALE);
theme_menu->get_popup()->connect("id_pressed", this, "_theme_menu_cbk");
HBoxContainer *main_hb = memnew(HBoxContainer);
@@ -777,23 +775,23 @@ ThemeEditor::ThemeEditor() {
/*
test_h_scroll = memnew( HScrollBar );
- test_h_scroll->set_pos( Point2( 25, 225 ) );
+ test_h_scroll->set_position( Point2( 25, 225 ) );
test_h_scroll->set_size( Point2( 150, 5 ) );
panel->add_child(test_h_scroll);
line_edit = memnew( LineEdit );
- line_edit->set_pos( Point2( 25, 275 ) );
+ line_edit->set_position( Point2( 25, 275 ) );
line_edit->set_size( Point2( 150, 5 ) );
line_edit->set_text("Line Edit");
panel->add_child(line_edit);
test_v_scroll = memnew( VScrollBar );
- test_v_scroll->set_pos( Point2( 200, 25 ) );
+ test_v_scroll->set_position( Point2( 200, 25 ) );
test_v_scroll->set_size( Point2( 5, 150 ) );
panel->add_child(test_v_scroll);
test_tree = memnew(Tree);
- test_tree->set_pos( Point2( 300, 25 ) );
+ test_tree->set_position( Point2( 300, 25 ) );
test_tree->set_size( Point2( 200, 200 ) );
panel->add_child(test_tree);
@@ -817,7 +815,7 @@ ThemeEditor::ThemeEditor() {
item->set_range(0,2);
Button *fd_button= memnew( Button );
- fd_button->set_pos(Point2(300,275));
+ fd_button->set_position(Point2(300,275));
fd_button->set_text("Open File Dialog");
panel->add_child(fd_button);
@@ -831,48 +829,46 @@ ThemeEditor::ThemeEditor() {
add_del_dialog->hide();
add_child(add_del_dialog);
+ VBoxContainer *dialog_vbc = memnew(VBoxContainer);
+ add_del_dialog->add_child(dialog_vbc);
+
Label *l = memnew(Label);
- l->set_pos(Point2(5, 5) * EDSCALE);
l->set_text(TTR("Type:"));
- add_del_dialog->add_child(l);
- dtype_select_label = l;
+ dialog_vbc->add_child(l);
+
+ type_hbc = memnew(HBoxContainer);
+ dialog_vbc->add_child(type_hbc);
type_edit = memnew(LineEdit);
- type_edit->set_pos(Point2(5, 25) * EDSCALE);
- type_edit->set_size(Point2(150, 5) * EDSCALE);
- add_del_dialog->add_child(type_edit);
+ type_edit->set_h_size_flags(SIZE_EXPAND_FILL);
+ type_hbc->add_child(type_edit);
type_menu = memnew(MenuButton);
- type_menu->set_pos(Point2(160, 25) * EDSCALE);
- type_menu->set_size(Point2(30, 5) * EDSCALE);
type_menu->set_text("..");
- add_del_dialog->add_child(type_menu);
+ type_hbc->add_child(type_menu);
type_menu->get_popup()->connect("id_pressed", this, "_type_menu_cbk");
l = memnew(Label);
- l->set_pos(Point2(200, 5) * EDSCALE);
l->set_text(TTR("Name:"));
- add_del_dialog->add_child(l);
+ dialog_vbc->add_child(l);
name_select_label = l;
+ name_hbc = memnew(HBoxContainer);
+ dialog_vbc->add_child(name_hbc);
+
name_edit = memnew(LineEdit);
- name_edit->set_pos(Point2(200, 25) * EDSCALE);
- name_edit->set_size(Point2(150, 5) * EDSCALE);
- add_del_dialog->add_child(name_edit);
+ name_edit->set_h_size_flags(SIZE_EXPAND_FILL);
+ name_hbc->add_child(name_edit);
name_menu = memnew(MenuButton);
- name_menu->set_pos(Point2(360, 25) * EDSCALE);
- name_menu->set_size(Point2(30, 5) * EDSCALE);
name_menu->set_text("..");
-
- add_del_dialog->add_child(name_menu);
+ name_hbc->add_child(name_menu);
name_menu->get_popup()->connect("about_to_show", this, "_name_menu_about_to_show");
name_menu->get_popup()->connect("id_pressed", this, "_name_menu_cbk");
type_select_label = memnew(Label);
- type_select_label->set_pos(Point2(400, 5) * EDSCALE);
type_select_label->set_text(TTR("Data Type:"));
- add_del_dialog->add_child(type_select_label);
+ dialog_vbc->add_child(type_select_label);
type_select = memnew(OptionButton);
type_select->add_item(TTR("Icon"));
@@ -880,10 +876,8 @@ ThemeEditor::ThemeEditor() {
type_select->add_item(TTR("Font"));
type_select->add_item(TTR("Color"));
type_select->add_item(TTR("Constant"));
- type_select->set_pos(Point2(400, 25) * EDSCALE);
- type_select->set_size(Point2(80, 5) * EDSCALE);
- add_del_dialog->add_child(type_select);
+ dialog_vbc->add_child(type_select);
add_del_dialog->get_ok()->connect("pressed", this, "_dialog_cbk");
diff --git a/editor/plugins/theme_editor_plugin.h b/editor/plugins/theme_editor_plugin.h
index 3881cf1a41..a75b83e76a 100644
--- a/editor/plugins/theme_editor_plugin.h
+++ b/editor/plugins/theme_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -53,14 +54,15 @@ class ThemeEditor : public Control {
MenuButton *theme_menu;
ConfirmationDialog *add_del_dialog;
+ HBoxContainer *type_hbc;
MenuButton *type_menu;
LineEdit *type_edit;
+ HBoxContainer *name_hbc;
MenuButton *name_menu;
LineEdit *name_edit;
OptionButton *type_select;
Label *type_select_label;
Label *name_select_label;
- Label *dtype_select_label;
enum PopupMode {
POPUP_ADD,
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 8cda9848bd..80ff6627b2 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -48,9 +49,18 @@ void TileMapEditor::_notification(int p_what) {
rotate_180->set_icon(get_icon("Rotate180", "EditorIcons"));
rotate_270->set_icon(get_icon("Rotate270", "EditorIcons"));
+ search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
+
} break;
+
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+ bool new_show_tile_info = EditorSettings::get_singleton()->get("editors/tile_map/show_tile_info_on_hover");
+ if (new_show_tile_info != show_tile_info) {
+ show_tile_info = new_show_tile_info;
+ tile_info->set_visible(show_tile_info);
+ }
+
if (is_visible_in_tree()) {
_update_palette();
}
@@ -97,8 +107,8 @@ void TileMapEditor::_menu_option(int p_option) {
return;
undo_redo->create_action("Erase Selection");
- for (int i = rectangle.pos.y; i <= rectangle.pos.y + rectangle.size.y; i++) {
- for (int j = rectangle.pos.x; j <= rectangle.pos.x + rectangle.size.x; j++) {
+ for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) {
+ for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) {
_set_cell(Point2i(j, i), TileMap::INVALID_CELL, false, false, false, true);
}
@@ -178,18 +188,33 @@ void TileMapEditor::_text_changed(const String &p_text) {
_update_palette();
}
-void TileMapEditor::_sbox_input(const InputEvent &p_ie) {
+void TileMapEditor::_sbox_input(const Ref<InputEvent> &p_ie) {
+
+ Ref<InputEventKey> k = p_ie;
- if (p_ie.type == InputEvent::KEY && (p_ie.key.scancode == KEY_UP ||
- p_ie.key.scancode == KEY_DOWN ||
- p_ie.key.scancode == KEY_PAGEUP ||
- p_ie.key.scancode == KEY_PAGEDOWN)) {
+ if (k.is_valid() && (k->get_scancode() == KEY_UP ||
+ k->get_scancode() == KEY_DOWN ||
+ k->get_scancode() == KEY_PAGEUP ||
+ k->get_scancode() == KEY_PAGEDOWN)) {
- palette->call("_gui_input", p_ie);
+ palette->call("_gui_input", k);
search_box->accept_event();
}
}
+// Implementation detail of TileMapEditor::_update_palette();
+// in modern C++ this could have been inside its body
+namespace {
+struct _PaletteEntry {
+ int id;
+ String name;
+
+ bool operator<(const _PaletteEntry &p_rhs) const {
+ return name < p_rhs.name;
+ }
+};
+}
+
void TileMapEditor::_update_palette() {
if (!node)
@@ -212,6 +237,8 @@ void TileMapEditor::_update_palette() {
min_size *= EDSCALE;
int hseparation = EDITOR_DEF("editors/tile_map/palette_item_hseparation", 8);
bool show_tile_names = bool(EDITOR_DEF("editors/tile_map/show_tile_names", true));
+ bool show_tile_ids = bool(EDITOR_DEF("editors/tile_map/show_tile_ids", false));
+ bool sort_by_name = bool(EDITOR_DEF("editors/tile_map/sort_tiles_by_name", true));
palette->add_constant_override("hseparation", hseparation * EDSCALE);
palette->add_constant_override("vseparation", 8 * EDSCALE);
@@ -221,12 +248,20 @@ void TileMapEditor::_update_palette() {
String filter = search_box->get_text().strip_edges();
+ Vector<_PaletteEntry> entries;
+
for (List<int>::Element *E = tiles.front(); E; E = E->next()) {
- String name;
+ String name = tileset->tile_get_name(E->get());
- if (tileset->tile_get_name(E->get()) != "") {
- name = itos(E->get()) + " - " + tileset->tile_get_name(E->get());
+ if (name != "") {
+ if (show_tile_ids) {
+ if (sort_by_name) {
+ name = name + " - " + itos(E->get());
+ } else {
+ name = itos(E->get()) + " - " + name;
+ }
+ }
} else {
name = "#" + itos(E->get());
}
@@ -234,16 +269,26 @@ void TileMapEditor::_update_palette() {
if (filter != "" && !filter.is_subsequence_ofi(name))
continue;
+ const _PaletteEntry entry = { E->get(), name };
+ entries.push_back(entry);
+ }
+
+ if (sort_by_name) {
+ entries.sort();
+ }
+
+ for (int i = 0; i < entries.size(); i++) {
+
if (show_tile_names) {
- palette->add_item(name);
+ palette->add_item(entries[i].name);
} else {
palette->add_item(String());
}
- Ref<Texture> tex = tileset->tile_get_texture(E->get());
+ Ref<Texture> tex = tileset->tile_get_texture(entries[i].id);
if (tex.is_valid()) {
- Rect2 region = tileset->tile_get_region(E->get());
+ Rect2 region = tileset->tile_get_region(entries[i].id);
if (!region.has_no_area())
palette->set_item_icon_region(palette->get_item_count() - 1, region);
@@ -251,7 +296,7 @@ void TileMapEditor::_update_palette() {
palette->set_item_icon(palette->get_item_count() - 1, tex);
}
- palette->set_item_metadata(palette->get_item_count() - 1, E->get());
+ palette->set_item_metadata(palette->get_item_count() - 1, entries[i].id);
}
palette->set_same_column_width(true);
@@ -294,10 +339,12 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
if (id == TileMap::INVALID_CELL)
return PoolVector<Vector2>();
+ } else if (prev_id == TileMap::INVALID_CELL) {
+ return PoolVector<Vector2>();
}
Rect2i r = node->get_item_rect();
- r.pos = r.pos / node->get_cell_size();
+ r.position = r.position / node->get_cell_size();
r.size = r.size / node->get_cell_size();
int area = r.get_area();
@@ -313,7 +360,7 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
invalidate_cache = true;
}
// Tile ID changed or position wasn't visited by the previous fill
- int loc = (p_start.x - r.get_pos().x) + (p_start.y - r.get_pos().y) * r.get_size().x;
+ int loc = (p_start.x - r.position.x) + (p_start.y - r.position.y) * r.get_size().x;
if (prev_id != bucket_cache_tile || !bucket_cache_visited[loc]) {
invalidate_cache = true;
}
@@ -344,7 +391,7 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
if (node->get_cell(n.x, n.y) == prev_id) {
if (preview) {
- int loc = (n.x - r.get_pos().x) + (n.y - r.get_pos().y) * r.get_size().x;
+ int loc = (n.x - r.position.x) + (n.y - r.position.y) * r.get_size().x;
if (bucket_cache_visited[loc])
continue;
bucket_cache_visited[loc] = true;
@@ -405,7 +452,7 @@ void TileMapEditor::_select(const Point2i &p_from, const Point2i &p_to) {
SWAP(begin.y, end.y);
}
- rectangle.pos = begin;
+ rectangle.position = begin;
rectangle.size = end - begin;
canvas_item_editor->update();
@@ -424,7 +471,7 @@ void TileMapEditor::_draw_cell(int p_cell, const Point2i &p_point, bool p_flip_h
Size2 sc = p_xform.get_scale();
Rect2 rect = Rect2();
- rect.pos = node->map_to_world(p_point) + node->get_cell_draw_offset();
+ rect.position = node->map_to_world(p_point) + node->get_cell_draw_offset();
if (r.has_no_area()) {
rect.size = t->get_size();
@@ -454,42 +501,42 @@ void TileMapEditor::_draw_cell(int p_cell, const Point2i &p_point, bool p_flip_h
if (node->get_tile_origin() == TileMap::TILE_ORIGIN_TOP_LEFT) {
- rect.pos += tile_ofs;
+ rect.position += tile_ofs;
} else if (node->get_tile_origin() == TileMap::TILE_ORIGIN_BOTTOM_LEFT) {
Size2 cell_size = node->get_cell_size();
- rect.pos += tile_ofs;
+ rect.position += tile_ofs;
if (p_transpose) {
if (p_flip_h)
- rect.pos.x -= cell_size.x;
+ rect.position.x -= cell_size.x;
else
- rect.pos.x += cell_size.x;
+ rect.position.x += cell_size.x;
} else {
if (p_flip_v)
- rect.pos.y -= cell_size.y;
+ rect.position.y -= cell_size.y;
else
- rect.pos.y += cell_size.y;
+ rect.position.y += cell_size.y;
}
} else if (node->get_tile_origin() == TileMap::TILE_ORIGIN_CENTER) {
- rect.pos += node->get_cell_size() / 2;
+ rect.position += node->get_cell_size() / 2;
Vector2 s = r.size;
Vector2 center = (s / 2) - tile_ofs;
if (p_flip_h)
- rect.pos.x -= s.x - center.x;
+ rect.position.x -= s.x - center.x;
else
- rect.pos.x -= center.x;
+ rect.position.x -= center.x;
if (p_flip_v)
- rect.pos.y -= s.y - center.y;
+ rect.position.y -= s.y - center.y;
else
- rect.pos.y -= center.y;
+ rect.position.y -= center.y;
}
- rect.pos = p_xform.xform(rect.pos);
+ rect.position = p_xform.xform(rect.position);
rect.size *= sc;
if (r.has_no_area())
@@ -524,9 +571,9 @@ void TileMapEditor::_update_copydata() {
if (!selection_active)
return;
- for (int i = rectangle.pos.y; i <= rectangle.pos.y + rectangle.size.y; i++) {
+ for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) {
- for (int j = rectangle.pos.x; j <= rectangle.pos.x + rectangle.size.x; j++) {
+ for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) {
TileData tcd;
@@ -588,7 +635,7 @@ static inline Vector<Point2i> line(int x0, int x1, int y0, int y1) {
return points;
}
-bool TileMapEditor::forward_gui_input(const InputEvent &p_event) {
+bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (!node || !node->get_tileset().is_valid() || !node->is_visible_in_tree())
return false;
@@ -596,464 +643,461 @@ bool TileMapEditor::forward_gui_input(const InputEvent &p_event) {
Transform2D xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform();
Transform2D xform_inv = xform.affine_inverse();
- switch (p_event.type) {
-
- case InputEvent::MOUSE_BUTTON: {
-
- const InputEventMouseButton &mb = p_event.mouse_button;
+ Ref<InputEventMouseButton> mb = p_event;
- if (mb.button_index == BUTTON_LEFT) {
+ if (mb.is_valid()) {
+ if (mb->get_button_index() == BUTTON_LEFT) {
- if (mb.pressed) {
+ if (mb->is_pressed()) {
- if (Input::get_singleton()->is_key_pressed(KEY_SPACE))
- return false; //drag
+ if (Input::get_singleton()->is_key_pressed(KEY_SPACE))
+ return false; //drag
- if (tool == TOOL_NONE) {
+ if (tool == TOOL_NONE) {
- if (mb.mod.shift) {
+ if (mb->get_shift()) {
- if (mb.mod.control)
- tool = TOOL_RECTANGLE_PAINT;
- else
- tool = TOOL_LINE_PAINT;
+ if (mb->get_control())
+ tool = TOOL_RECTANGLE_PAINT;
+ else
+ tool = TOOL_LINE_PAINT;
- selection_active = false;
- rectangle_begin = over_tile;
-
- return true;
- }
+ selection_active = false;
+ rectangle_begin = over_tile;
- if (mb.mod.control) {
+ return true;
+ }
- tool = TOOL_PICKING;
- _pick_tile(over_tile);
+ if (mb->get_control()) {
- return true;
- }
+ tool = TOOL_PICKING;
+ _pick_tile(over_tile);
- tool = TOOL_PAINTING;
+ return true;
}
- if (tool == TOOL_PAINTING) {
+ tool = TOOL_PAINTING;
+ }
- int id = get_selected_tile();
+ if (tool == TOOL_PAINTING) {
- if (id != TileMap::INVALID_CELL) {
+ int id = get_selected_tile();
- tool = TOOL_PAINTING;
+ if (id != TileMap::INVALID_CELL) {
- paint_undo.clear();
- paint_undo[over_tile] = _get_op_from_cell(over_tile);
-
- _set_cell(over_tile, id, flip_h, flip_v, transpose);
- }
- } else if (tool == TOOL_PICKING) {
+ tool = TOOL_PAINTING;
- _pick_tile(over_tile);
- } else if (tool == TOOL_SELECTING) {
+ paint_undo.clear();
+ paint_undo[over_tile] = _get_op_from_cell(over_tile);
- selection_active = true;
- rectangle_begin = over_tile;
+ _set_cell(over_tile, id, flip_h, flip_v, transpose);
}
+ } else if (tool == TOOL_PICKING) {
- return true;
+ _pick_tile(over_tile);
+ } else if (tool == TOOL_SELECTING) {
- } else {
+ selection_active = true;
+ rectangle_begin = over_tile;
+ }
- if (tool != TOOL_NONE) {
+ return true;
- if (tool == TOOL_PAINTING) {
+ } else {
- int id = get_selected_tile();
+ if (tool != TOOL_NONE) {
- if (id != TileMap::INVALID_CELL && paint_undo.size()) {
+ if (tool == TOOL_PAINTING) {
- undo_redo->create_action(TTR("Paint TileMap"));
- for (Map<Point2i, CellOp>::Element *E = paint_undo.front(); E; E = E->next()) {
+ int id = get_selected_tile();
- Point2 p = E->key();
- undo_redo->add_do_method(node, "set_cellv", p, id, flip_h, flip_v, transpose);
- undo_redo->add_undo_method(node, "set_cellv", p, E->get().idx, E->get().xf, E->get().yf, E->get().tr);
- }
- undo_redo->commit_action();
+ if (id != TileMap::INVALID_CELL && paint_undo.size()) {
- paint_undo.clear();
- }
- } else if (tool == TOOL_LINE_PAINT) {
+ undo_redo->create_action(TTR("Paint TileMap"));
+ for (Map<Point2i, CellOp>::Element *E = paint_undo.front(); E; E = E->next()) {
- int id = get_selected_tile();
+ Point2 p = E->key();
+ undo_redo->add_do_method(node, "set_cellv", p, id, flip_h, flip_v, transpose);
+ undo_redo->add_undo_method(node, "set_cellv", p, E->get().idx, E->get().xf, E->get().yf, E->get().tr);
+ }
+ undo_redo->commit_action();
- if (id != TileMap::INVALID_CELL) {
+ paint_undo.clear();
+ }
+ } else if (tool == TOOL_LINE_PAINT) {
- undo_redo->create_action("Line Draw");
- for (Map<Point2i, CellOp>::Element *E = paint_undo.front(); E; E = E->next()) {
+ int id = get_selected_tile();
- _set_cell(E->key(), id, flip_h, flip_v, transpose, true);
- }
- undo_redo->commit_action();
+ if (id != TileMap::INVALID_CELL) {
- paint_undo.clear();
+ undo_redo->create_action("Line Draw");
+ for (Map<Point2i, CellOp>::Element *E = paint_undo.front(); E; E = E->next()) {
- canvas_item_editor->update();
+ _set_cell(E->key(), id, flip_h, flip_v, transpose, true);
}
- } else if (tool == TOOL_RECTANGLE_PAINT) {
-
- int id = get_selected_tile();
-
- if (id != TileMap::INVALID_CELL) {
+ undo_redo->commit_action();
- undo_redo->create_action("Rectangle Paint");
- for (int i = rectangle.pos.y; i <= rectangle.pos.y + rectangle.size.y; i++) {
- for (int j = rectangle.pos.x; j <= rectangle.pos.x + rectangle.size.x; j++) {
+ paint_undo.clear();
- _set_cell(Point2i(j, i), id, flip_h, flip_v, transpose, true);
- }
- }
- undo_redo->commit_action();
+ canvas_item_editor->update();
+ }
+ } else if (tool == TOOL_RECTANGLE_PAINT) {
- canvas_item_editor->update();
- }
- } else if (tool == TOOL_DUPLICATING) {
+ int id = get_selected_tile();
- Point2 ofs = over_tile - rectangle.pos;
+ if (id != TileMap::INVALID_CELL) {
- undo_redo->create_action(TTR("Duplicate"));
- for (List<TileData>::Element *E = copydata.front(); E; E = E->next()) {
+ undo_redo->create_action("Rectangle Paint");
+ for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) {
+ for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) {
- _set_cell(E->get().pos + ofs, E->get().cell, E->get().flip_h, E->get().flip_v, E->get().transpose, true);
+ _set_cell(Point2i(j, i), id, flip_h, flip_v, transpose, true);
+ }
}
undo_redo->commit_action();
- copydata.clear();
-
canvas_item_editor->update();
+ }
+ } else if (tool == TOOL_DUPLICATING) {
- } else if (tool == TOOL_SELECTING) {
+ Point2 ofs = over_tile - rectangle.position;
- canvas_item_editor->update();
+ undo_redo->create_action(TTR("Duplicate"));
+ for (List<TileData>::Element *E = copydata.front(); E; E = E->next()) {
+
+ _set_cell(E->get().pos + ofs, E->get().cell, E->get().flip_h, E->get().flip_v, E->get().transpose, true);
+ }
+ undo_redo->commit_action();
+
+ copydata.clear();
+
+ canvas_item_editor->update();
- } else if (tool == TOOL_BUCKET) {
+ } else if (tool == TOOL_SELECTING) {
- Dictionary pop;
- pop["id"] = node->get_cell(over_tile.x, over_tile.y);
- pop["flip_h"] = node->is_cell_x_flipped(over_tile.x, over_tile.y);
- pop["flip_v"] = node->is_cell_y_flipped(over_tile.x, over_tile.y);
- pop["transpose"] = node->is_cell_transposed(over_tile.x, over_tile.y);
+ canvas_item_editor->update();
- PoolVector<Vector2> points = _bucket_fill(over_tile);
+ } else if (tool == TOOL_BUCKET) {
- if (points.size() == 0)
- return false;
+ Dictionary pop;
+ pop["id"] = node->get_cell(over_tile.x, over_tile.y);
+ pop["flip_h"] = node->is_cell_x_flipped(over_tile.x, over_tile.y);
+ pop["flip_v"] = node->is_cell_y_flipped(over_tile.x, over_tile.y);
+ pop["transpose"] = node->is_cell_transposed(over_tile.x, over_tile.y);
- Dictionary op;
- op["id"] = get_selected_tile();
- op["flip_h"] = flip_h;
- op["flip_v"] = flip_v;
- op["transpose"] = transpose;
+ PoolVector<Vector2> points = _bucket_fill(over_tile);
- undo_redo->create_action("Bucket Fill");
+ if (points.size() == 0)
+ return false;
- undo_redo->add_do_method(this, "_fill_points", points, op);
- undo_redo->add_undo_method(this, "_fill_points", points, pop);
+ Dictionary op;
+ op["id"] = get_selected_tile();
+ op["flip_h"] = flip_h;
+ op["flip_v"] = flip_v;
+ op["transpose"] = transpose;
- undo_redo->commit_action();
- }
+ undo_redo->create_action("Bucket Fill");
- tool = TOOL_NONE;
+ undo_redo->add_do_method(this, "_fill_points", points, op);
+ undo_redo->add_undo_method(this, "_fill_points", points, pop);
- return true;
+ undo_redo->commit_action();
}
- }
- } else if (mb.button_index == BUTTON_RIGHT) {
- if (mb.pressed) {
+ tool = TOOL_NONE;
- if (tool == TOOL_SELECTING || selection_active) {
+ return true;
+ }
+ }
+ } else if (mb->get_button_index() == BUTTON_RIGHT) {
- tool = TOOL_NONE;
- selection_active = false;
+ if (mb->is_pressed()) {
- canvas_item_editor->update();
+ if (tool == TOOL_SELECTING || selection_active) {
- return true;
- }
+ tool = TOOL_NONE;
+ selection_active = false;
- if (tool == TOOL_DUPLICATING) {
+ canvas_item_editor->update();
- tool = TOOL_NONE;
- copydata.clear();
+ return true;
+ }
- canvas_item_editor->update();
+ if (tool == TOOL_DUPLICATING) {
- return true;
- }
+ tool = TOOL_NONE;
+ copydata.clear();
- if (tool == TOOL_NONE) {
+ canvas_item_editor->update();
- paint_undo.clear();
+ return true;
+ }
+
+ if (tool == TOOL_NONE) {
- Point2 local = node->world_to_map(xform_inv.xform(Point2(mb.x, mb.y)));
+ paint_undo.clear();
- if (mb.mod.shift) {
+ Point2 local = node->world_to_map(xform_inv.xform(mb->get_position()));
- if (mb.mod.control)
- tool = TOOL_RECTANGLE_ERASE;
- else
- tool = TOOL_LINE_ERASE;
+ if (mb->get_shift()) {
- selection_active = false;
- rectangle_begin = local;
- } else {
+ if (mb->get_control())
+ tool = TOOL_RECTANGLE_ERASE;
+ else
+ tool = TOOL_LINE_ERASE;
- tool = TOOL_ERASING;
+ selection_active = false;
+ rectangle_begin = local;
+ } else {
- paint_undo[local] = _get_op_from_cell(local);
- _set_cell(local, TileMap::INVALID_CELL);
- }
+ tool = TOOL_ERASING;
- return true;
+ paint_undo[local] = _get_op_from_cell(local);
+ _set_cell(local, TileMap::INVALID_CELL);
}
- } else {
- if (tool == TOOL_ERASING || tool == TOOL_RECTANGLE_ERASE || tool == TOOL_LINE_ERASE) {
+ return true;
+ }
- if (paint_undo.size()) {
- undo_redo->create_action(TTR("Erase TileMap"));
- for (Map<Point2i, CellOp>::Element *E = paint_undo.front(); E; E = E->next()) {
+ } else {
+ if (tool == TOOL_ERASING || tool == TOOL_RECTANGLE_ERASE || tool == TOOL_LINE_ERASE) {
- Point2 p = E->key();
- undo_redo->add_do_method(node, "set_cellv", p, TileMap::INVALID_CELL, false, false, false);
- undo_redo->add_undo_method(node, "set_cellv", p, E->get().idx, E->get().xf, E->get().yf, E->get().tr);
- }
+ if (paint_undo.size()) {
+ undo_redo->create_action(TTR("Erase TileMap"));
+ for (Map<Point2i, CellOp>::Element *E = paint_undo.front(); E; E = E->next()) {
- undo_redo->commit_action();
- paint_undo.clear();
+ Point2 p = E->key();
+ undo_redo->add_do_method(node, "set_cellv", p, TileMap::INVALID_CELL, false, false, false);
+ undo_redo->add_undo_method(node, "set_cellv", p, E->get().idx, E->get().xf, E->get().yf, E->get().tr);
}
- if (tool == TOOL_RECTANGLE_ERASE || tool == TOOL_LINE_ERASE) {
- canvas_item_editor->update();
- }
+ undo_redo->commit_action();
+ paint_undo.clear();
+ }
- tool = TOOL_NONE;
+ if (tool == TOOL_RECTANGLE_ERASE || tool == TOOL_LINE_ERASE) {
+ canvas_item_editor->update();
+ }
- return true;
+ tool = TOOL_NONE;
- } else if (tool == TOOL_BUCKET) {
+ return true;
- Dictionary pop;
- pop["id"] = node->get_cell(over_tile.x, over_tile.y);
- pop["flip_h"] = node->is_cell_x_flipped(over_tile.x, over_tile.y);
- pop["flip_v"] = node->is_cell_y_flipped(over_tile.x, over_tile.y);
- pop["transpose"] = node->is_cell_transposed(over_tile.x, over_tile.y);
+ } else if (tool == TOOL_BUCKET) {
- PoolVector<Vector2> points = _bucket_fill(over_tile, true);
+ Dictionary pop;
+ pop["id"] = node->get_cell(over_tile.x, over_tile.y);
+ pop["flip_h"] = node->is_cell_x_flipped(over_tile.x, over_tile.y);
+ pop["flip_v"] = node->is_cell_y_flipped(over_tile.x, over_tile.y);
+ pop["transpose"] = node->is_cell_transposed(over_tile.x, over_tile.y);
- if (points.size() == 0)
- return false;
+ PoolVector<Vector2> points = _bucket_fill(over_tile, true);
- undo_redo->create_action("Bucket Fill");
+ if (points.size() == 0)
+ return false;
- undo_redo->add_do_method(this, "_erase_points", points);
- undo_redo->add_undo_method(this, "_fill_points", points, pop);
+ undo_redo->create_action("Bucket Fill");
- undo_redo->commit_action();
- }
+ undo_redo->add_do_method(this, "_erase_points", points);
+ undo_redo->add_undo_method(this, "_fill_points", points, pop);
+
+ undo_redo->commit_action();
}
}
- } break;
- case InputEvent::MOUSE_MOTION: {
+ }
+ }
- const InputEventMouseMotion &mm = p_event.mouse_motion;
+ Ref<InputEventMouseMotion> mm = p_event;
- Point2i new_over_tile = node->world_to_map(xform_inv.xform(Point2(mm.x, mm.y)));
+ if (mm.is_valid()) {
- if (new_over_tile != over_tile) {
+ Point2i new_over_tile = node->world_to_map(xform_inv.xform(mm->get_position()));
- over_tile = new_over_tile;
- canvas_item_editor->update();
- }
+ if (new_over_tile != over_tile) {
+
+ over_tile = new_over_tile;
+ canvas_item_editor->update();
+ }
+ if (show_tile_info) {
int tile_under = node->get_cell(over_tile.x, over_tile.y);
String tile_name = "none";
if (node->get_tileset()->has_tile(tile_under))
tile_name = node->get_tileset()->tile_get_name(tile_under);
tile_info->set_text(String::num(over_tile.x) + ", " + String::num(over_tile.y) + " [" + tile_name + "]");
+ }
- if (tool == TOOL_PAINTING) {
+ if (tool == TOOL_PAINTING) {
- int id = get_selected_tile();
- if (id != TileMap::INVALID_CELL) {
+ int id = get_selected_tile();
+ if (id != TileMap::INVALID_CELL) {
- if (!paint_undo.has(over_tile)) {
- paint_undo[over_tile] = _get_op_from_cell(over_tile);
- }
+ if (!paint_undo.has(over_tile)) {
+ paint_undo[over_tile] = _get_op_from_cell(over_tile);
+ }
- _set_cell(over_tile, id, flip_h, flip_v, transpose);
+ _set_cell(over_tile, id, flip_h, flip_v, transpose);
- return true;
- }
+ return true;
}
+ }
- if (tool == TOOL_SELECTING) {
+ if (tool == TOOL_SELECTING) {
- _select(rectangle_begin, over_tile);
+ _select(rectangle_begin, over_tile);
- return true;
- }
+ return true;
+ }
- if (tool == TOOL_LINE_PAINT || tool == TOOL_LINE_ERASE) {
+ if (tool == TOOL_LINE_PAINT || tool == TOOL_LINE_ERASE) {
- int id = get_selected_tile();
- bool erasing = (tool == TOOL_LINE_ERASE);
+ int id = get_selected_tile();
+ bool erasing = (tool == TOOL_LINE_ERASE);
- if (erasing && paint_undo.size()) {
+ if (erasing && paint_undo.size()) {
- for (Map<Point2i, CellOp>::Element *E = paint_undo.front(); E; E = E->next()) {
+ for (Map<Point2i, CellOp>::Element *E = paint_undo.front(); E; E = E->next()) {
- _set_cell(E->key(), E->get().idx, E->get().xf, E->get().yf, E->get().tr);
- }
+ _set_cell(E->key(), E->get().idx, E->get().xf, E->get().yf, E->get().tr);
}
+ }
- paint_undo.clear();
-
- if (id != TileMap::INVALID_CELL) {
+ paint_undo.clear();
- Vector<Point2i> points = line(rectangle_begin.x, over_tile.x, rectangle_begin.y, over_tile.y);
+ if (id != TileMap::INVALID_CELL) {
- for (int i = 0; i < points.size(); i++) {
+ Vector<Point2i> points = line(rectangle_begin.x, over_tile.x, rectangle_begin.y, over_tile.y);
- paint_undo[points[i]] = _get_op_from_cell(points[i]);
+ for (int i = 0; i < points.size(); i++) {
- if (erasing)
- _set_cell(points[i], TileMap::INVALID_CELL);
- }
+ paint_undo[points[i]] = _get_op_from_cell(points[i]);
- canvas_item_editor->update();
+ if (erasing)
+ _set_cell(points[i], TileMap::INVALID_CELL);
}
- return true;
+ canvas_item_editor->update();
}
- if (tool == TOOL_RECTANGLE_PAINT || tool == TOOL_RECTANGLE_ERASE) {
- _select(rectangle_begin, over_tile);
+ return true;
+ }
+ if (tool == TOOL_RECTANGLE_PAINT || tool == TOOL_RECTANGLE_ERASE) {
- if (tool == TOOL_RECTANGLE_ERASE) {
+ _select(rectangle_begin, over_tile);
- if (paint_undo.size()) {
+ if (tool == TOOL_RECTANGLE_ERASE) {
- for (Map<Point2i, CellOp>::Element *E = paint_undo.front(); E; E = E->next()) {
+ if (paint_undo.size()) {
- _set_cell(E->key(), E->get().idx, E->get().xf, E->get().yf, E->get().tr);
- }
+ for (Map<Point2i, CellOp>::Element *E = paint_undo.front(); E; E = E->next()) {
+
+ _set_cell(E->key(), E->get().idx, E->get().xf, E->get().yf, E->get().tr);
}
+ }
- paint_undo.clear();
+ paint_undo.clear();
- for (int i = rectangle.pos.y; i <= rectangle.pos.y + rectangle.size.y; i++) {
- for (int j = rectangle.pos.x; j <= rectangle.pos.x + rectangle.size.x; j++) {
+ for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) {
+ for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) {
- Point2i tile = Point2i(j, i);
- paint_undo[tile] = _get_op_from_cell(tile);
+ Point2i tile = Point2i(j, i);
+ paint_undo[tile] = _get_op_from_cell(tile);
- _set_cell(tile, TileMap::INVALID_CELL);
- }
+ _set_cell(tile, TileMap::INVALID_CELL);
}
}
-
- return true;
}
- if (tool == TOOL_ERASING) {
-
- if (!paint_undo.has(over_tile)) {
- paint_undo[over_tile] = _get_op_from_cell(over_tile);
- }
- _set_cell(over_tile, TileMap::INVALID_CELL);
+ return true;
+ }
+ if (tool == TOOL_ERASING) {
- return true;
+ if (!paint_undo.has(over_tile)) {
+ paint_undo[over_tile] = _get_op_from_cell(over_tile);
}
- if (tool == TOOL_PICKING && Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT)) {
- _pick_tile(over_tile);
+ _set_cell(over_tile, TileMap::INVALID_CELL);
- return true;
- }
- } break;
- case InputEvent::KEY: {
+ return true;
+ }
+ if (tool == TOOL_PICKING && Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT)) {
- const InputEventKey &k = p_event.key;
+ _pick_tile(over_tile);
- if (!k.pressed)
- break;
+ return true;
+ }
+ }
- if (k.scancode == KEY_ESCAPE) {
+ Ref<InputEventKey> k = p_event;
- if (tool == TOOL_DUPLICATING)
- copydata.clear();
- else if (tool == TOOL_SELECTING || selection_active)
- selection_active = false;
+ if (k.is_valid() && k->is_pressed()) {
- tool = TOOL_NONE;
+ if (k->get_scancode() == KEY_ESCAPE) {
- canvas_item_editor->update();
+ if (tool == TOOL_DUPLICATING)
+ copydata.clear();
+ else if (tool == TOOL_SELECTING || selection_active)
+ selection_active = false;
- return true;
- }
+ tool = TOOL_NONE;
- if (tool != TOOL_NONE || !mouse_over)
- return false;
+ canvas_item_editor->update();
- if (ED_IS_SHORTCUT("tile_map_editor/erase_selection", p_event)) {
- _menu_option(OPTION_ERASE_SELECTION);
+ return true;
+ }
- return true;
- }
- if (ED_IS_SHORTCUT("tile_map_editor/select", p_event)) {
- tool = TOOL_SELECTING;
- selection_active = false;
+ if (tool != TOOL_NONE || !mouse_over)
+ return false;
- canvas_item_editor->update();
+ if (ED_IS_SHORTCUT("tile_map_editor/erase_selection", p_event)) {
+ _menu_option(OPTION_ERASE_SELECTION);
- return true;
- }
- if (ED_IS_SHORTCUT("tile_map_editor/duplicate_selection", p_event)) {
- _update_copydata();
+ return true;
+ }
+ if (ED_IS_SHORTCUT("tile_map_editor/select", p_event)) {
+ tool = TOOL_SELECTING;
+ selection_active = false;
- if (selection_active) {
- tool = TOOL_DUPLICATING;
+ canvas_item_editor->update();
- canvas_item_editor->update();
+ return true;
+ }
+ if (ED_IS_SHORTCUT("tile_map_editor/duplicate_selection", p_event)) {
+ _update_copydata();
- return true;
- }
- }
- if (ED_IS_SHORTCUT("tile_map_editor/find_tile", p_event)) {
- search_box->select_all();
- search_box->grab_focus();
+ if (selection_active) {
+ tool = TOOL_DUPLICATING;
- return true;
- }
- if (ED_IS_SHORTCUT("tile_map_editor/mirror_x", p_event)) {
- flip_h = !flip_h;
- mirror_x->set_pressed(flip_h);
- canvas_item_editor->update();
- return true;
- }
- if (ED_IS_SHORTCUT("tile_map_editor/mirror_y", p_event)) {
- flip_v = !flip_v;
- mirror_y->set_pressed(flip_v);
- canvas_item_editor->update();
- return true;
- }
- if (ED_IS_SHORTCUT("tile_map_editor/transpose", p_event)) {
- transpose = !transpose;
- transp->set_pressed(transpose);
canvas_item_editor->update();
+
return true;
}
- } break;
+ }
+ if (ED_IS_SHORTCUT("tile_map_editor/find_tile", p_event)) {
+ search_box->select_all();
+ search_box->grab_focus();
+
+ return true;
+ }
+ if (ED_IS_SHORTCUT("tile_map_editor/mirror_x", p_event)) {
+ flip_h = !flip_h;
+ mirror_x->set_pressed(flip_h);
+ canvas_item_editor->update();
+ return true;
+ }
+ if (ED_IS_SHORTCUT("tile_map_editor/mirror_y", p_event)) {
+ flip_v = !flip_v;
+ mirror_y->set_pressed(flip_v);
+ canvas_item_editor->update();
+ return true;
+ }
+ if (ED_IS_SHORTCUT("tile_map_editor/transpose", p_event)) {
+ transpose = !transpose;
+ transp->set_pressed(transpose);
+ canvas_item_editor->update();
+ return true;
+ }
}
return false;
@@ -1072,7 +1116,7 @@ void TileMapEditor::_canvas_draw() {
Size2 screen_size = canvas_item_editor->get_size();
{
Rect2 aabb;
- aabb.pos = node->world_to_map(xform_inv.xform(Vector2()));
+ aabb.position = node->world_to_map(xform_inv.xform(Vector2()));
aabb.expand_to(node->world_to_map(xform_inv.xform(Vector2(0, screen_size.height))));
aabb.expand_to(node->world_to_map(xform_inv.xform(Vector2(screen_size.width, 0))));
aabb.expand_to(node->world_to_map(xform_inv.xform(screen_size)));
@@ -1082,10 +1126,10 @@ void TileMapEditor::_canvas_draw() {
int max_lines = 2000; //avoid crash if size too smal
- for (int i = (si.pos.x) - 1; i <= (si.pos.x + si.size.x); i++) {
+ for (int i = (si.position.x) - 1; i <= (si.position.x + si.size.x); i++) {
- Vector2 from = xform.xform(node->map_to_world(Vector2(i, si.pos.y)));
- Vector2 to = xform.xform(node->map_to_world(Vector2(i, si.pos.y + si.size.y + 1)));
+ Vector2 from = xform.xform(node->map_to_world(Vector2(i, si.position.y)));
+ Vector2 to = xform.xform(node->map_to_world(Vector2(i, si.position.y + si.size.y + 1)));
Color col = i == 0 ? Color(1, 0.8, 0.2, 0.5) : Color(1, 0.3, 0.1, 0.2);
canvas_item_editor->draw_line(from, to, col, 1);
@@ -1096,9 +1140,9 @@ void TileMapEditor::_canvas_draw() {
int max_lines = 10000; //avoid crash if size too smal
- for (int i = (si.pos.x) - 1; i <= (si.pos.x + si.size.x); i++) {
+ for (int i = (si.position.x) - 1; i <= (si.position.x + si.size.x); i++) {
- for (int j = (si.pos.y) - 1; j <= (si.pos.y + si.size.y); j++) {
+ for (int j = (si.position.y) - 1; j <= (si.position.y + si.size.y); j++) {
Vector2 ofs;
if (ABS(j) & 1) {
@@ -1120,10 +1164,10 @@ void TileMapEditor::_canvas_draw() {
if (node->get_half_offset() != TileMap::HALF_OFFSET_Y) {
- for (int i = (si.pos.y) - 1; i <= (si.pos.y + si.size.y); i++) {
+ for (int i = (si.position.y) - 1; i <= (si.position.y + si.size.y); i++) {
- Vector2 from = xform.xform(node->map_to_world(Vector2(si.pos.x, i)));
- Vector2 to = xform.xform(node->map_to_world(Vector2(si.pos.x + si.size.x + 1, i)));
+ Vector2 from = xform.xform(node->map_to_world(Vector2(si.position.x, i)));
+ Vector2 to = xform.xform(node->map_to_world(Vector2(si.position.x + si.size.x + 1, i)));
Color col = i == 0 ? Color(1, 0.8, 0.2, 0.5) : Color(1, 0.3, 0.1, 0.2);
canvas_item_editor->draw_line(from, to, col, 1);
@@ -1133,9 +1177,9 @@ void TileMapEditor::_canvas_draw() {
}
} else {
- for (int i = (si.pos.y) - 1; i <= (si.pos.y + si.size.y); i++) {
+ for (int i = (si.position.y) - 1; i <= (si.position.y + si.size.y); i++) {
- for (int j = (si.pos.x) - 1; j <= (si.pos.x + si.size.x); j++) {
+ for (int j = (si.position.x) - 1; j <= (si.position.x + si.size.x); j++) {
Vector2 ofs;
if (ABS(j) & 1) {
@@ -1157,10 +1201,10 @@ void TileMapEditor::_canvas_draw() {
if (selection_active) {
Vector<Vector2> points;
- points.push_back(xform.xform(node->map_to_world((rectangle.pos))));
- points.push_back(xform.xform(node->map_to_world((rectangle.pos + Point2(rectangle.size.x + 1, 0)))));
- points.push_back(xform.xform(node->map_to_world((rectangle.pos + Point2(rectangle.size.x + 1, rectangle.size.y + 1)))));
- points.push_back(xform.xform(node->map_to_world((rectangle.pos + Point2(0, rectangle.size.y + 1)))));
+ points.push_back(xform.xform(node->map_to_world((rectangle.position))));
+ points.push_back(xform.xform(node->map_to_world((rectangle.position + Point2(rectangle.size.x + 1, 0)))));
+ points.push_back(xform.xform(node->map_to_world((rectangle.position + Point2(rectangle.size.x + 1, rectangle.size.y + 1)))));
+ points.push_back(xform.xform(node->map_to_world((rectangle.position + Point2(0, rectangle.size.y + 1)))));
canvas_item_editor->draw_colored_polygon(points, Color(0.2, 0.8, 1, 0.4));
}
@@ -1217,8 +1261,8 @@ void TileMapEditor::_canvas_draw() {
if (id == TileMap::INVALID_CELL)
return;
- for (int i = rectangle.pos.y; i <= rectangle.pos.y + rectangle.size.y; i++) {
- for (int j = rectangle.pos.x; j <= rectangle.pos.x + rectangle.size.x; j++) {
+ for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) {
+ for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) {
_draw_cell(id, Point2i(j, i), flip_h, flip_v, transpose, xform);
}
@@ -1233,7 +1277,7 @@ void TileMapEditor::_canvas_draw() {
if (ts.is_null())
return;
- Point2 ofs = over_tile - rectangle.pos;
+ Point2 ofs = over_tile - rectangle.position;
for (List<TileData>::Element *E = copydata.front(); E; E = E->next()) {
@@ -1246,13 +1290,13 @@ void TileMapEditor::_canvas_draw() {
}
Rect2i duplicate = rectangle;
- duplicate.pos = over_tile;
+ duplicate.position = over_tile;
Vector<Vector2> points;
- points.push_back(xform.xform(node->map_to_world(duplicate.pos)));
- points.push_back(xform.xform(node->map_to_world((duplicate.pos + Point2(duplicate.size.x + 1, 0)))));
- points.push_back(xform.xform(node->map_to_world((duplicate.pos + Point2(duplicate.size.x + 1, duplicate.size.y + 1)))));
- points.push_back(xform.xform(node->map_to_world((duplicate.pos + Point2(0, duplicate.size.y + 1)))));
+ points.push_back(xform.xform(node->map_to_world(duplicate.position)));
+ points.push_back(xform.xform(node->map_to_world((duplicate.position + Point2(duplicate.size.x + 1, 0)))));
+ points.push_back(xform.xform(node->map_to_world((duplicate.position + Point2(duplicate.size.x + 1, duplicate.size.y + 1)))));
+ points.push_back(xform.xform(node->map_to_world((duplicate.position + Point2(0, duplicate.size.y + 1)))));
canvas_item_editor->draw_colored_polygon(points, Color(0.2, 1.0, 0.8, 0.2));
@@ -1404,6 +1448,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
tool = TOOL_NONE;
selection_active = false;
mouse_over = false;
+ show_tile_info = true;
flip_h = false;
flip_v = false;
@@ -1418,6 +1463,11 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
ED_SHORTCUT("tile_map_editor/mirror_x", TTR("Mirror X"), KEY_A);
ED_SHORTCUT("tile_map_editor/mirror_y", TTR("Mirror Y"), KEY_S);
+ HBoxContainer *tool_hb1 = memnew(HBoxContainer);
+ add_child(tool_hb1);
+ HBoxContainer *tool_hb2 = memnew(HBoxContainer);
+ add_child(tool_hb2);
+
search_box = memnew(LineEdit);
search_box->set_h_size_flags(SIZE_EXPAND_FILL);
search_box->connect("text_entered", this, "_text_entered");
@@ -1449,6 +1499,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
toolbar = memnew(HBoxContainer);
toolbar->set_h_size_flags(SIZE_EXPAND_FILL);
toolbar->set_alignment(BoxContainer::ALIGN_END);
+ toolbar->hide();
CanvasItemEditor::get_singleton()->add_control_to_menu_panel(toolbar);
// Tile position
@@ -1474,54 +1525,49 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
toolbar->add_child(options);
- toolbar->add_child(memnew(VSeparator));
-
transp = memnew(ToolButton);
transp->set_toggle_mode(true);
transp->set_tooltip(TTR("Transpose") + " (" + ED_GET_SHORTCUT("tile_map_editor/transpose")->get_as_text() + ")");
transp->set_focus_mode(FOCUS_NONE);
transp->connect("pressed", this, "_update_transform_buttons", make_binds(transp));
- toolbar->add_child(transp);
+ tool_hb1->add_child(transp);
mirror_x = memnew(ToolButton);
mirror_x->set_toggle_mode(true);
mirror_x->set_tooltip(TTR("Mirror X") + " (" + ED_GET_SHORTCUT("tile_map_editor/mirror_x")->get_as_text() + ")");
mirror_x->set_focus_mode(FOCUS_NONE);
mirror_x->connect("pressed", this, "_update_transform_buttons", make_binds(mirror_x));
- toolbar->add_child(mirror_x);
+ tool_hb1->add_child(mirror_x);
mirror_y = memnew(ToolButton);
mirror_y->set_toggle_mode(true);
mirror_y->set_tooltip(TTR("Mirror Y") + " (" + ED_GET_SHORTCUT("tile_map_editor/mirror_y")->get_as_text() + ")");
mirror_y->set_focus_mode(FOCUS_NONE);
mirror_y->connect("pressed", this, "_update_transform_buttons", make_binds(mirror_y));
- toolbar->add_child(mirror_y);
-
- toolbar->add_child(memnew(VSeparator));
+ tool_hb1->add_child(mirror_y);
rotate_0 = memnew(ToolButton);
rotate_0->set_toggle_mode(true);
rotate_0->set_tooltip(TTR("Rotate 0 degrees"));
rotate_0->set_focus_mode(FOCUS_NONE);
rotate_0->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_0));
- toolbar->add_child(rotate_0);
+ tool_hb2->add_child(rotate_0);
rotate_90 = memnew(ToolButton);
rotate_90->set_toggle_mode(true);
rotate_90->set_tooltip(TTR("Rotate 90 degrees"));
rotate_90->set_focus_mode(FOCUS_NONE);
rotate_90->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_90));
- toolbar->add_child(rotate_90);
+ tool_hb2->add_child(rotate_90);
rotate_180 = memnew(ToolButton);
rotate_180->set_toggle_mode(true);
rotate_180->set_tooltip(TTR("Rotate 180 degrees"));
rotate_180->set_focus_mode(FOCUS_NONE);
rotate_180->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_180));
- toolbar->add_child(rotate_180);
+ tool_hb2->add_child(rotate_180);
rotate_270 = memnew(ToolButton);
rotate_270->set_toggle_mode(true);
rotate_270->set_tooltip(TTR("Rotate 270 degrees"));
rotate_270->set_focus_mode(FOCUS_NONE);
rotate_270->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_270));
- toolbar->add_child(rotate_270);
- toolbar->hide();
+ tool_hb2->add_child(rotate_270);
rotate_0->set_pressed(true);
}
@@ -1563,7 +1609,10 @@ TileMapEditorPlugin::TileMapEditorPlugin(EditorNode *p_node) {
EDITOR_DEF("editors/tile_map/preview_size", 64);
EDITOR_DEF("editors/tile_map/palette_item_hseparation", 8);
EDITOR_DEF("editors/tile_map/show_tile_names", true);
+ EDITOR_DEF("editors/tile_map/show_tile_ids", false);
+ EDITOR_DEF("editors/tile_map/sort_tiles_by_name", true);
EDITOR_DEF("editors/tile_map/bucket_fill_preview", true);
+ EDITOR_DEF("editors/tile_map/show_tile_info_on_hover", true);
tile_map_editor = memnew(TileMapEditor(p_node));
add_control_to_container(CONTAINER_CANVAS_EDITOR_SIDE, tile_map_editor);
diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h
index a4774a23b9..d76884e663 100644
--- a/editor/plugins/tile_map_editor_plugin.h
+++ b/editor/plugins/tile_map_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -96,6 +97,7 @@ class TileMapEditor : public VBoxContainer {
bool selection_active;
bool mouse_over;
+ bool show_tile_info;
bool flip_h;
bool flip_v;
@@ -157,7 +159,7 @@ class TileMapEditor : public VBoxContainer {
void _text_entered(const String &p_text);
void _text_changed(const String &p_text);
- void _sbox_input(const InputEvent &p_ie);
+ void _sbox_input(const Ref<InputEvent> &p_ie);
void _update_palette();
void _canvas_draw();
void _menu_option(int p_option);
@@ -178,7 +180,7 @@ protected:
public:
HBoxContainer *get_toolbar() const { return toolbar; }
- bool forward_gui_input(const InputEvent &p_event);
+ bool forward_gui_input(const Ref<InputEvent> &p_event);
void edit(Node *p_tile_map);
TileMapEditor(EditorNode *p_editor);
@@ -192,12 +194,12 @@ class TileMapEditorPlugin : public EditorPlugin {
TileMapEditor *tile_map_editor;
public:
- virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event) { return tile_map_editor->forward_gui_input(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event) { return tile_map_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "TileMap"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
TileMapEditorPlugin(EditorNode *p_node);
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index 6dee151d99..bed4727bb9 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,29 +37,24 @@ void TileSetEditor::edit(const Ref<TileSet> &p_tileset) {
tileset = p_tileset;
}
-void TileSetEditor::_import_scene(Node *scene, Ref<TileSet> p_library, bool p_merge) {
+void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) {
- if (!p_merge)
- p_library->clear();
-
- for (int i = 0; i < scene->get_child_count(); i++) {
+ for (int i = 0; i < p_node->get_child_count(); i++) {
- Node *child = scene->get_child(i);
+ Node *child = p_node->get_child(i);
if (!child->cast_to<Sprite>()) {
if (child->get_child_count() > 0) {
- child = child->get_child(0);
- if (!child->cast_to<Sprite>()) {
- continue;
- }
+ _import_node(child, p_library);
+ }
- } else
- continue;
+ continue;
}
Sprite *mi = child->cast_to<Sprite>();
Ref<Texture> texture = mi->get_texture();
- Ref<CanvasItemMaterial> material = mi->get_material();
+ Ref<Texture> normal_map = mi->get_normal_map();
+ Ref<ShaderMaterial> material = mi->get_material();
if (texture.is_null())
continue;
@@ -72,6 +68,7 @@ void TileSetEditor::_import_scene(Node *scene, Ref<TileSet> p_library, bool p_me
}
p_library->tile_set_texture(id, texture);
+ p_library->tile_set_normal_map(id, normal_map);
p_library->tile_set_material(id, material);
p_library->tile_set_modulate(id, mi->get_modulate());
@@ -93,9 +90,10 @@ void TileSetEditor::_import_scene(Node *scene, Ref<TileSet> p_library, bool p_me
phys_offset += -s / 2;
}
- Vector<Ref<Shape2D> > collisions;
+ Vector<TileSet::ShapeData> collisions;
Ref<NavigationPolygon> nav_poly;
Ref<OccluderPolygon2D> occluder;
+ bool found_collisions = false;
for (int j = 0; j < mi->get_child_count(); j++) {
@@ -109,24 +107,36 @@ void TileSetEditor::_import_scene(Node *scene, Ref<TileSet> p_library, bool p_me
if (!child2->cast_to<StaticBody2D>())
continue;
+
+ found_collisions = true;
+
StaticBody2D *sb = child2->cast_to<StaticBody2D>();
- int shape_count = sb->get_shape_count();
- if (shape_count == 0)
- continue;
- for (int shape_index = 0; shape_index < shape_count; ++shape_index) {
- Ref<Shape2D> collision = sb->get_shape(shape_index);
- if (collision.is_valid()) {
- collisions.push_back(collision);
+
+ List<uint32_t> shapes;
+ sb->get_shape_owners(&shapes);
+
+ for (List<uint32_t>::Element *E = shapes.front(); E; E = E->next()) {
+ if (sb->is_shape_owner_disabled(E->get())) continue;
+
+ Transform2D shape_transform = sb->shape_owner_get_transform(E->get());
+ bool one_way = sb->is_shape_owner_one_way_collision_enabled(E->get());
+
+ shape_transform.set_origin(shape_transform.get_origin() - phys_offset);
+
+ for (int k = 0; k < sb->shape_owner_get_shape_count(E->get()); k++) {
+
+ Ref<Shape2D> shape = sb->shape_owner_get_shape(E->get(), k);
+ TileSet::ShapeData shape_data;
+ shape_data.shape = shape;
+ shape_data.shape_transform = shape_transform;
+ shape_data.one_way_collision = one_way;
+ collisions.push_back(shape_data);
}
}
}
- if (collisions.size()) {
-
+ if (found_collisions) {
p_library->tile_set_shapes(id, collisions);
- p_library->tile_set_shape_offset(id, -phys_offset);
- } else {
- p_library->tile_set_shape_offset(id, Vector2());
}
p_library->tile_set_texture_offset(id, mi->get_offset());
@@ -137,6 +147,14 @@ void TileSetEditor::_import_scene(Node *scene, Ref<TileSet> p_library, bool p_me
}
}
+void TileSetEditor::_import_scene(Node *p_scene, Ref<TileSet> p_library, bool p_merge) {
+
+ if (!p_merge)
+ p_library->clear();
+
+ _import_node(p_scene, p_library);
+}
+
void TileSetEditor::_menu_confirm() {
switch (option) {
@@ -224,7 +242,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
add_child(panel);
MenuButton *options = memnew(MenuButton);
panel->add_child(options);
- options->set_pos(Point2(1, 1));
+ options->set_position(Point2(1, 1));
options->set_text("Theme");
options->get_popup()->add_item(TTR("Add Item"), MENU_OPTION_ADD_ITEM);
options->get_popup()->add_item(TTR("Remove Item"), MENU_OPTION_REMOVE_ITEM);
diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h
index 0dabf58f7c..d04ebc7197 100644
--- a/editor/plugins/tile_set_editor_plugin.h
+++ b/editor/plugins/tile_set_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -58,6 +59,7 @@ class TileSetEditor : public Control {
void _menu_confirm();
void _name_dialog_confirm(const String &name);
+ static void _import_node(Node *p_node, Ref<TileSet> p_library);
static void _import_scene(Node *p_scene, Ref<TileSet> p_library, bool p_merge);
protected:
diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp
index 55f220ba9a..51a40faf37 100644
--- a/editor/progress_dialog.cpp
+++ b/editor/progress_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/progress_dialog.h b/editor/progress_dialog.h
index 346d6a58b3..75ad0f26dd 100644
--- a/editor/progress_dialog.h
+++ b/editor/progress_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index 015031a1ee..b9694dffcb 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,7 +32,6 @@
#include "editor_data.h"
#include "editor_node.h"
#include "editor_settings.h"
-#include "global_config.h"
#include "io/image_loader.h"
#include "io/resource_loader.h"
#include "io/resource_saver.h"
@@ -39,6 +39,7 @@
#include "os/dir_access.h"
#include "os/file_access.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/gui/box_container.h"
#include "scene/gui/margin_container.h"
#include "scene/gui/scroll_container.h"
@@ -50,6 +51,7 @@ void ProjectExportDialog::_notification(int p_what) {
case NOTIFICATION_READY: {
delete_preset->set_icon(get_icon("Del", "EditorIcons"));
connect("confirmed", this, "_export_pck_zip");
+ custom_feature_display->get_parent_control()->add_style_override("panel", get_stylebox("bg", "Tree"));
} break;
case NOTIFICATION_POPUP_HIDE: {
EditorSettings::get_singleton()->set("interface/dialogs/export_bounds", get_rect());
@@ -228,18 +230,73 @@ void ProjectExportDialog::_edit_preset(int p_index) {
}
if (needs_templates)
export_templates_error->show();
+ else
+ export_templates_error->hide();
- get_ok()->set_disabled(true);
+ export_button->set_disabled(true);
} else {
- export_error->show();
+ export_error->hide();
export_templates_error->hide();
- get_ok()->set_disabled(false);
+ export_button->set_disabled(false);
}
+ custom_features->set_text(current->get_custom_features());
+ _update_feature_list();
+
updating = false;
}
+void ProjectExportDialog::_update_feature_list() {
+
+ Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current());
+ ERR_FAIL_COND(current.is_null());
+
+ Set<String> fset;
+ List<String> features;
+
+ current->get_platform()->get_platform_features(&features);
+ current->get_platform()->get_preset_features(current, &features);
+
+ String custom = current->get_custom_features();
+ Vector<String> custom_list = custom.split(",");
+ for (int i = 0; i < custom_list.size(); i++) {
+ String f = custom_list[i].strip_edges();
+ if (f != String()) {
+ features.push_back(f);
+ }
+ }
+
+ for (List<String>::Element *E = features.front(); E; E = E->next()) {
+ fset.insert(E->get());
+ }
+
+ custom_feature_display->clear();
+ for (Set<String>::Element *E = fset.front(); E; E = E->next()) {
+ String f = E->get();
+ if (E->next()) {
+ f += ", ";
+ }
+ custom_feature_display->add_text(f);
+ }
+}
+
+void ProjectExportDialog::_custom_features_changed(const String &p_text) {
+
+ if (updating)
+ return;
+
+ Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current());
+ ERR_FAIL_COND(current.is_null());
+
+ current->set_custom_features(p_text);
+ _update_feature_list();
+}
+
+void ProjectExportDialog::_tab_changed(int) {
+ _update_feature_list();
+}
+
void ProjectExportDialog::_patch_button_pressed(Object *p_item, int p_column, int p_id) {
TreeItem *ti = (TreeItem *)p_item;
@@ -291,10 +348,10 @@ void ProjectExportDialog::_patch_selected(const String &p_path) {
if (patch_index >= patches.size()) {
- current->add_patch(GlobalConfig::get_singleton()->get_resource_path().path_to(p_path) + "*");
+ current->add_patch(ProjectSettings::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);
+ current->set_patch(patch_index, ProjectSettings::get_singleton()->get_resource_path().path_to(p_path) + enabled);
}
_edit_preset(presets->get_current());
@@ -313,6 +370,12 @@ void ProjectExportDialog::_patch_deleted() {
}
}
+void ProjectExportDialog::_update_parameters(const String &p_edited_property) {
+
+ _edit_preset(presets->get_current());
+ parameters->update_tree();
+}
+
void ProjectExportDialog::_runnable_pressed() {
if (updating)
@@ -676,6 +739,7 @@ void ProjectExportDialog::_bind_methods() {
ClassDB::bind_method("_add_preset", &ProjectExportDialog::_add_preset);
ClassDB::bind_method("_edit_preset", &ProjectExportDialog::_edit_preset);
+ ClassDB::bind_method("_update_parameters", &ProjectExportDialog::_update_parameters);
ClassDB::bind_method("_runnable_pressed", &ProjectExportDialog::_runnable_pressed);
ClassDB::bind_method("_name_changed", &ProjectExportDialog::_name_changed);
ClassDB::bind_method("_delete_preset", &ProjectExportDialog::_delete_preset);
@@ -695,6 +759,8 @@ void ProjectExportDialog::_bind_methods() {
ClassDB::bind_method("_open_export_template_manager", &ProjectExportDialog::_open_export_template_manager);
ClassDB::bind_method("_export_project", &ProjectExportDialog::_export_project);
ClassDB::bind_method("_export_project_to_path", &ProjectExportDialog::_export_project_to_path);
+ ClassDB::bind_method("_custom_features_changed", &ProjectExportDialog::_custom_features_changed);
+ ClassDB::bind_method("_tab_changed", &ProjectExportDialog::_tab_changed);
}
ProjectExportDialog::ProjectExportDialog() {
@@ -744,6 +810,7 @@ ProjectExportDialog::ProjectExportDialog() {
settings_vb->add_child(runnable);
sections = memnew(TabContainer);
+ sections->set_tab_align(TabContainer::ALIGN_LEFT);
settings_vb->add_child(sections);
sections->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -752,7 +819,8 @@ ProjectExportDialog::ProjectExportDialog() {
parameters->set_name(TTR("Options"));
parameters->hide_top_label();
parameters->set_v_size_flags(SIZE_EXPAND_FILL);
- parameters->set_hide_script(true);
+
+ parameters->connect("property_edited", this, "_update_parameters");
VBoxContainer *resources_vb = memnew(VBoxContainer);
sections->add_child(resources_vb);
@@ -816,6 +884,21 @@ ProjectExportDialog::ProjectExportDialog() {
patch_erase->connect("confirmed", this, "_patch_deleted");
add_child(patch_erase);
+ VBoxContainer *feature_vb = memnew(VBoxContainer);
+ feature_vb->set_name(TTR("Features"));
+ custom_features = memnew(LineEdit);
+ custom_features->connect("text_changed", this, "_custom_features_changed");
+ feature_vb->add_margin_child(TTR("Custom (comma-separated):"), custom_features);
+ Panel *features_panel = memnew(Panel);
+ custom_feature_display = memnew(RichTextLabel);
+ features_panel->add_child(custom_feature_display);
+ custom_feature_display->set_area_as_parent_rect(10 * EDSCALE);
+ custom_feature_display->set_v_size_flags(SIZE_EXPAND_FILL);
+ feature_vb->add_margin_child(TTR("Feature List:"), features_panel, true);
+ sections->add_child(feature_vb);
+
+ sections->connect("tab_changed", this, "_tab_changed");
+
//disable by default
name->set_editable(false);
runnable->set_disabled(true);
diff --git a/editor/project_export.h b/editor/project_export.h
index 0dc59a09e2..29c24005e0 100644
--- a/editor/project_export.h
+++ b/editor/project_export.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -39,6 +40,7 @@
#include "scene/gui/label.h"
#include "scene/gui/link_button.h"
#include "scene/gui/option_button.h"
+#include "scene/gui/rich_text_label.h"
#include "scene/gui/tab_container.h"
#include "scene/gui/tree.h"
#include "scene/main/timer.h"
@@ -90,6 +92,9 @@ private:
Button *export_button;
+ LineEdit *custom_features;
+ RichTextLabel *custom_feature_display;
+
Label *export_error;
HBoxContainer *export_templates_error;
@@ -97,6 +102,7 @@ private:
void _patch_deleted();
void _runnable_pressed();
+ void _update_parameters(const String &p_edited_property);
void _name_changed(const String &p_string);
void _add_preset(int p_platform);
void _edit_preset(int p_index);
@@ -130,6 +136,11 @@ private:
void _export_project();
void _export_project_to_path(const String &p_path);
+ void _update_feature_list();
+ void _custom_features_changed(const String &p_text);
+
+ void _tab_changed(int);
+
protected:
void _notification(int p_what);
static void _bind_methods();
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 5278efb3c6..dc0c888eea 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -48,6 +49,7 @@
#include "scene/gui/texture_rect.h"
#include "scene/gui/tool_button.h"
#include "version.h"
+#include "version_hash.gen.h"
class NewProjectDialog : public ConfirmationDialog {
@@ -91,18 +93,18 @@ private:
if (mode != MODE_IMPORT) {
- if (d->file_exists("godot.cfg")) {
+ if (d->file_exists("project.godot")) {
- error->set_text(TTR("Invalid project path, godot.cfg must not exist."));
+ error->set_text(TTR("Invalid project path, project.godot must not exist."));
memdelete(d);
return "";
}
} else {
- if (valid_path != "" && !d->file_exists("godot.cfg")) {
+ if (valid_path != "" && !d->file_exists("project.godot")) {
- error->set_text(TTR("Invalid project path, godot.cfg must exist."));
+ error->set_text(TTR("Invalid project path, project.godot must exist."));
memdelete(d);
return "";
}
@@ -135,7 +137,7 @@ private:
String p = p_path;
if (mode == MODE_IMPORT) {
- if (p.ends_with("godot.cfg")) {
+ if (p.ends_with("project.godot")) {
p = p.get_base_dir();
}
@@ -161,7 +163,7 @@ private:
fdialog->set_mode(FileDialog::MODE_OPEN_FILE);
fdialog->clear_filters();
- fdialog->add_filter("godot.cfg ; " _MKSTR(VERSION_NAME) " Project");
+ fdialog->add_filter("project.godot ; " _MKSTR(VERSION_NAME) " Project");
} else {
fdialog->set_mode(FileDialog::MODE_OPEN_DIR);
}
@@ -185,27 +187,27 @@ private:
} else {
if (mode == MODE_NEW) {
- FileAccess *f = FileAccess::open(dir.plus_file("/godot.cfg"), FileAccess::WRITE);
- if (!f) {
- error->set_text(TTR("Couldn't create godot.cfg in project path."));
- } else {
-
- f->store_line("; Engine configuration file.");
- f->store_line("; It's best edited using the editor UI and not directly,");
- f->store_line("; since the parameters that go here are not all obvious.");
- f->store_line("; ");
- f->store_line("; Format: ");
- f->store_line("; [section] ; section goes between []");
- f->store_line("; param=value ; assign values to parameters");
- f->store_line("\n");
- f->store_line("[application]");
- f->store_line("\n");
- f->store_line("name=\"" + project_name->get_text() + "\"");
- f->store_line("icon=\"res://icon.png\"");
-
- memdelete(f);
+ ProjectSettings::CustomMap initial_settings;
+ initial_settings["application/config/name"] = project_name->get_text();
+ initial_settings["application/config/icon"] = "res://icon.png";
+ initial_settings["rendering/environment/default_environment"] = "res://default_env.tres";
+ if (ProjectSettings::get_singleton()->save_custom(dir.plus_file("/project.godot"), initial_settings, Vector<String>(), false)) {
+ error->set_text(TTR("Couldn't create project.godot in project path."));
+ } else {
ResourceSaver::save(dir.plus_file("/icon.png"), get_icon("DefaultProjectIcon", "EditorIcons"));
+
+ FileAccess *f = FileAccess::open(dir.plus_file("/default_env.tres"), FileAccess::WRITE);
+ if (!f) {
+ error->set_text(TTR("Couldn't create project.godot in project path."));
+ } else {
+ f->store_line("[gd_resource type=\"Environment\" load_steps=2 format=2]");
+ f->store_line("[sub_resource type=\"ProceduralSky\" id=1]");
+ f->store_line("[resource]");
+ f->store_line("background_mode = 2");
+ f->store_line("background_sky = SubResource( 1 )");
+ memdelete(f);
+ }
}
} else if (mode == MODE_INSTALL) {
@@ -404,7 +406,7 @@ public:
l = memnew(Label);
l->set_text(TTR("Project Name:"));
- l->set_pos(Point2(5, 50));
+ l->set_position(Point2(5, 50));
vb->add_child(l);
pn = l;
@@ -489,27 +491,20 @@ void ProjectManager::_update_project_buttons() {
item->update();
}
- bool has_runnable_scene = false;
- for (Map<String, String>::Element *E = selected_list.front(); E; E = E->next()) {
- const String &selected_main = E->get();
- if (selected_main == "") continue;
- has_runnable_scene = true;
- break;
- }
-
erase_btn->set_disabled(selected_list.size() < 1);
open_btn->set_disabled(selected_list.size() < 1);
- run_btn->set_disabled(!has_runnable_scene);
}
-void ProjectManager::_panel_input(const InputEvent &p_ev, Node *p_hb) {
+void ProjectManager::_panel_input(const Ref<InputEvent> &p_ev, Node *p_hb) {
- if (p_ev.type == InputEvent::MOUSE_BUTTON && p_ev.mouse_button.pressed && p_ev.mouse_button.button_index == BUTTON_LEFT) {
+ Ref<InputEventMouseButton> mb = p_ev;
+
+ if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
String clicked = p_hb->get_meta("name");
String clicked_main_scene = p_hb->get_meta("main_scene");
- if (p_ev.key.mod.shift && selected_list.size() > 0 && last_clicked != "" && clicked != last_clicked) {
+ if (mb->get_shift() && selected_list.size() > 0 && last_clicked != "" && clicked != last_clicked) {
int clicked_id = -1;
int last_clicked_id = -1;
@@ -526,7 +521,7 @@ void ProjectManager::_panel_input(const InputEvent &p_ev, Node *p_hb) {
for (int i = 0; i < scroll_childs->get_child_count(); ++i) {
HBoxContainer *hb = scroll_childs->get_child(i)->cast_to<HBoxContainer>();
if (!hb) continue;
- if (i != clicked_id && (i < min || i > max) && !p_ev.key.mod.control) {
+ if (i != clicked_id && (i < min || i > max) && !mb->get_control()) {
selected_list.erase(hb->get_meta("name"));
} else if (i >= min && i <= max) {
selected_list.insert(hb->get_meta("name"), hb->get_meta("main_scene"));
@@ -534,14 +529,14 @@ void ProjectManager::_panel_input(const InputEvent &p_ev, Node *p_hb) {
}
}
- } else if (selected_list.has(clicked) && p_ev.key.mod.control) {
+ } else if (selected_list.has(clicked) && mb->get_control()) {
selected_list.erase(clicked);
} else {
last_clicked = clicked;
- if (p_ev.key.mod.control || selected_list.size() == 0) {
+ if (mb->get_control() || selected_list.size() == 0) {
selected_list.insert(clicked, clicked_main_scene);
} else {
selected_list.clear();
@@ -551,25 +546,25 @@ void ProjectManager::_panel_input(const InputEvent &p_ev, Node *p_hb) {
_update_project_buttons();
- if (p_ev.mouse_button.doubleclick)
+ if (mb->is_doubleclick())
_open_project(); //open if doubleclicked
}
}
-void ProjectManager::_unhandled_input(const InputEvent &p_ev) {
+void ProjectManager::_unhandled_input(const Ref<InputEvent> &p_ev) {
- if (p_ev.type == InputEvent::KEY) {
+ Ref<InputEventKey> k = p_ev;
- const InputEventKey &k = p_ev.key;
+ if (k.is_valid()) {
- if (!k.pressed)
+ if (!k->is_pressed())
return;
bool scancode_handled = true;
- switch (k.scancode) {
+ switch (k->get_scancode()) {
- case KEY_RETURN: {
+ case KEY_ENTER: {
_open_project();
} break;
@@ -605,7 +600,7 @@ void ProjectManager::_unhandled_input(const InputEvent &p_ev) {
} break;
case KEY_UP: {
- if (k.mod.shift)
+ if (k->get_shift())
break;
if (selected_list.size()) {
@@ -623,7 +618,7 @@ void ProjectManager::_unhandled_input(const InputEvent &p_ev) {
selected_list.clear();
selected_list.insert(current, hb->get_meta("main_scene"));
- int offset_diff = scroll->get_v_scroll() - hb->get_pos().y;
+ int offset_diff = scroll->get_v_scroll() - hb->get_position().y;
if (offset_diff > 0)
scroll->set_v_scroll(scroll->get_v_scroll() - offset_diff);
@@ -644,7 +639,7 @@ void ProjectManager::_unhandled_input(const InputEvent &p_ev) {
}
case KEY_DOWN: {
- if (k.mod.shift)
+ if (k->get_shift())
break;
bool found = selected_list.empty();
@@ -661,7 +656,7 @@ void ProjectManager::_unhandled_input(const InputEvent &p_ev) {
selected_list.insert(current, hb->get_meta("main_scene"));
int last_y_visible = scroll->get_v_scroll() + scroll->get_size().y;
- int offset_diff = (hb->get_pos().y + hb->get_size().y) - last_y_visible;
+ int offset_diff = (hb->get_position().y + hb->get_size().y) - last_y_visible;
if (offset_diff > 0)
scroll->set_v_scroll(scroll->get_v_scroll() + offset_diff);
@@ -678,7 +673,7 @@ void ProjectManager::_unhandled_input(const InputEvent &p_ev) {
} break;
case KEY_F: {
- if (k.mod.command)
+ if (k->get_command())
this->project_filter->search_box->grab_focus();
else
scancode_handled = false;
@@ -740,7 +735,7 @@ void ProjectManager::_load_recent_projects() {
continue;
String project = _name.get_slice("/", 1);
- String conf = path.plus_file("godot.cfg");
+ String conf = path.plus_file("project.godot");
bool favorite = (_name.begins_with("favorite_projects/")) ? true : false;
uint64_t last_modified = 0;
@@ -794,22 +789,23 @@ void ProjectManager::_load_recent_projects() {
String project_name = TTR("Unnamed Project");
- if (cf->has_section_key("application", "name")) {
- project_name = static_cast<String>(cf->get_value("application", "name")).xml_unescape();
+ if (cf->has_section_key("application", "config/name")) {
+ project_name = static_cast<String>(cf->get_value("application", "config/name")).xml_unescape();
}
if (filter_option == ProjectListFilter::FILTER_NAME && search_term != "" && project_name.findn(search_term) == -1)
continue;
Ref<Texture> icon;
- if (cf->has_section_key("application", "icon")) {
- String appicon = cf->get_value("application", "icon");
+ if (cf->has_section_key("application", "config/icon")) {
+ String appicon = cf->get_value("application", "config/icon");
if (appicon != "") {
- Image img;
- Error err = img.load(appicon.replace_first("res://", path + "/"));
+ Ref<Image> img;
+ img.instance();
+ Error err = img->load(appicon.replace_first("res://", path + "/"));
if (err == OK) {
- img.resize(64, 64);
+ img->resize(64, 64);
Ref<ImageTexture> it = memnew(ImageTexture);
it->create_from_image(img);
icon = it;
@@ -822,8 +818,8 @@ void ProjectManager::_load_recent_projects() {
}
String main_scene;
- if (cf->has_section_key("application", "main_scene")) {
- main_scene = cf->get_value("application", "main_scene");
+ if (cf->has_section_key("application", "run/main_scene")) {
+ main_scene = cf->get_value("application", "run/main_scene");
}
selected_list_copy.erase(project);
@@ -852,6 +848,7 @@ void ProjectManager::_load_recent_projects() {
VBoxContainer *vb = memnew(VBoxContainer);
vb->set_name("project");
+ vb->set_h_size_flags(SIZE_EXPAND_FILL);
hb->add_child(vb);
Control *ec = memnew(Control);
ec->set_custom_minimum_size(Size2(0, 1));
@@ -859,12 +856,14 @@ void ProjectManager::_load_recent_projects() {
Label *title = memnew(Label(project_name));
title->add_font_override("font", gui_base->get_font("large", "Fonts"));
title->add_color_override("font_color", font_color);
+ title->set_clip_text(true);
vb->add_child(title);
Label *fpath = memnew(Label(path));
fpath->set_name("path");
vb->add_child(fpath);
fpath->set_modulate(Color(1, 1, 1, 0.5));
fpath->add_color_override("font_color", font_color);
+ fpath->set_clip_text(true);
scroll_childs->add_child(hb);
}
@@ -897,8 +896,9 @@ void ProjectManager::_on_project_created(const String &dir) {
_update_scroll_pos(dir);
} else {
_load_recent_projects();
- scroll->connect("draw", this, "_update_scroll_pos", varray(dir), CONNECT_ONESHOT);
+ _update_scroll_pos(dir);
}
+ _open_project();
}
void ProjectManager::_update_scroll_pos(const String &dir) {
@@ -911,7 +911,7 @@ void ProjectManager::_update_scroll_pos(const String &dir) {
selected_list.insert(hb->get_meta("name"), hb->get_meta("main_scene"));
_update_project_buttons();
int last_y_visible = scroll->get_v_scroll() + scroll->get_size().y;
- int offset_diff = (hb->get_pos().y + hb->get_size().y) - last_y_visible;
+ int offset_diff = (hb->get_position().y + hb->get_size().y) - last_y_visible;
if (offset_diff > 0)
scroll->set_v_scroll(scroll->get_v_scroll() + offset_diff);
@@ -963,10 +963,22 @@ void ProjectManager::_run_project_confirm() {
for (Map<String, String>::Element *E = selected_list.front(); E; E = E->next()) {
const String &selected_main = E->get();
- if (selected_main == "") continue;
+ if (selected_main == "") {
+ run_error_diag->set_text(TTR("Can't run project: no main scene defined.\nPlease edit the project and set the main scene in \"Project Settings\" under the \"Application\" category."));
+ run_error_diag->popup_centered();
+ return;
+ }
+
const String &selected = E->key();
String path = EditorSettings::get_singleton()->get("projects/" + selected);
+
+ if (!DirAccess::exists(path + "/.import")) {
+ run_error_diag->set_text(TTR("Can't run project: Assets need to be imported.\nPlease edit the project to trigger the initial import."));
+ run_error_diag->popup_centered();
+ return;
+ }
+
print_line("OPENING: " + path + " (" + selected + ")");
List<String> args;
@@ -1005,7 +1017,7 @@ void ProjectManager::_scan_dir(DirAccess *da, float pos, float total, List<Strin
while (n != String()) {
if (da->current_is_dir() && !n.begins_with(".")) {
subdirs.push_front(n);
- } else if (n == "godot.cfg") {
+ } else if (n == "project.godot") {
r_projects->push_back(da->get_current_dir());
}
n = da->get_next();
@@ -1116,7 +1128,7 @@ void ProjectManager::_files_dropped(PoolStringArray p_files, int p_screen) {
dir->list_dir_begin();
String file = dir->get_next();
while (confirm && file != String()) {
- if (!dir->current_is_dir() && file.ends_with("godot.cfg")) {
+ if (!dir->current_is_dir() && file.ends_with("project.godot")) {
confirm = false;
}
file = dir->get_next();
@@ -1190,7 +1202,7 @@ ProjectManager::ProjectManager() {
}
}
- FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesytem/file_dialog/show_hidden_files"));
+ FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"));
set_area_as_parent_rect();
set_theme(create_editor_theme());
@@ -1226,7 +1238,10 @@ ProjectManager::ProjectManager() {
top_hb->add_child(ccl);
top_hb->add_spacer();
l = memnew(Label);
- l->set_text("v" VERSION_MKSTRING);
+ String hash = String(VERSION_HASH);
+ if (hash.length() != 0)
+ hash = "." + hash.left(7);
+ l->set_text("v" VERSION_MKSTRING "" + hash);
//l->add_font_override("font",get_font("bold","Fonts"));
l->set_align(Label::ALIGN_CENTER);
top_hb->add_child(l);
@@ -1323,7 +1338,7 @@ ProjectManager::ProjectManager() {
if (StreamPeerSSL::is_available()) {
asset_library = memnew(EditorAssetLibrary(true));
- asset_library->set_name("Templates");
+ asset_library->set_name(TTR("Templates"));
tabs->add_child(asset_library);
asset_library->connect("install_asset", this, "_install_project");
} else {
@@ -1381,6 +1396,10 @@ ProjectManager::ProjectManager() {
last_clicked = "";
SceneTree::get_singleton()->connect("files_dropped", this, "_files_dropped");
+
+ run_error_diag = memnew(AcceptDialog);
+ gui_base->add_child(run_error_diag);
+ run_error_diag->set_title(TTR("Can't run project"));
}
ProjectManager::~ProjectManager() {
@@ -1452,7 +1471,7 @@ ProjectListFilter::ProjectListFilter() {
_current_filter = FILTER_NAME;
filter_option = memnew(OptionButton);
- filter_option->set_custom_minimum_size(Size2(80, 10));
+ filter_option->set_custom_minimum_size(Size2(80 * EDSCALE, 10 * EDSCALE));
filter_option->set_clip_text(true);
filter_option->connect("item_selected", this, "_filter_option_selected");
add_child(filter_option);
diff --git a/editor/project_manager.h b/editor/project_manager.h
index 918b76cb01..181d3cc5d9 100644
--- a/editor/project_manager.h
+++ b/editor/project_manager.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -56,6 +57,7 @@ class ProjectManager : public Control {
ConfirmationDialog *multi_open_ask;
ConfirmationDialog *multi_run_ask;
ConfirmationDialog *multi_scan_ask;
+ AcceptDialog *run_error_diag;
NewProjectDialog *npdialog;
ScrollContainer *scroll;
VBoxContainer *scroll_childs;
@@ -90,8 +92,8 @@ class ProjectManager : public Control {
void _install_project(const String &p_zip_path, const String &p_title);
void _panel_draw(Node *p_hb);
- void _panel_input(const InputEvent &p_ev, Node *p_hb);
- void _unhandled_input(const InputEvent &p_ev);
+ void _panel_input(const Ref<InputEvent> &p_ev, Node *p_hb);
+ void _unhandled_input(const Ref<InputEvent> &p_ev);
void _favorite_pressed(Node *p_hb);
void _files_dropped(PoolStringArray p_files, int p_screen);
void _scan_multiple_folders(PoolStringArray p_files);
diff --git a/editor/project_settings.cpp b/editor/project_settings_editor.cpp
index b47f95010b..019ed47e81 100644
--- a/editor/project_settings.cpp
+++ b/editor/project_settings_editor.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,17 +27,17 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "project_settings.h"
+#include "project_settings_editor.h"
#include "editor_node.h"
-#include "global_config.h"
#include "global_constants.h"
#include "os/keyboard.h"
+#include "project_settings.h"
#include "scene/gui/margin_container.h"
#include "scene/gui/tab_container.h"
#include "translation.h"
-ProjectSettings *ProjectSettings::singleton = NULL;
+ProjectSettingsEditor *ProjectSettingsEditor::singleton = NULL;
static const char *_button_names[JOY_BUTTON_MAX] = {
"PS Cross, XBox A, Nintendo B",
@@ -71,21 +72,21 @@ static const char *_axis_names[JOY_AXIS_MAX * 2] = {
"", " (R2)"
};
-void ProjectSettings::_notification(int p_what) {
+void ProjectSettingsEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
- globals_editor->edit(GlobalConfig::get_singleton());
+ globals_editor->edit(ProjectSettings::get_singleton());
- search_button->set_icon(get_icon("Zoom", "EditorIcons"));
+ search_button->set_icon(get_icon("Search", "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);
+ popup_add->add_icon_item(get_icon("Keyboard", "EditorIcons"), TTR("Key "), INPUT_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"), INPUT_JOY_BUTTON);
+ popup_add->add_icon_item(get_icon("JoyAxis", "EditorIcons"), TTR("Joy Axis"), INPUT_JOY_MOTION);
+ popup_add->add_icon_item(get_icon("Mouse", "EditorIcons"), TTR("Mouse Button"), INPUT_MOUSE_BUTTON);
List<String> tfn;
ResourceLoader::get_recognized_extensions_for_type("Translation", &tfn);
@@ -105,19 +106,23 @@ void ProjectSettings::_notification(int p_what) {
case NOTIFICATION_POPUP_HIDE: {
EditorSettings::get_singleton()->set("interface/dialogs/project_settings_bounds", get_rect());
} break;
+ case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+ _update_actions();
+ } break;
}
}
-void ProjectSettings::_action_selected() {
+void ProjectSettingsEditor::_action_selected() {
TreeItem *ti = input_editor->get_selected();
if (!ti || !ti->is_editable(0))
return;
add_at = "input/" + ti->get_text(0);
+ edit_idx = -1;
}
-void ProjectSettings::_action_edited() {
+void ProjectSettingsEditor::_action_edited() {
TreeItem *ti = input_editor->get_selected();
if (!ti)
@@ -135,33 +140,33 @@ void ProjectSettings::_action_edited() {
add_at = "input/" + old_name;
message->set_text(TTR("Invalid action (anything goes but '/' or ':')."));
- message->popup_centered(Size2(300, 100));
+ message->popup_centered(Size2(300, 100) * EDSCALE);
return;
}
String action_prop = "input/" + new_name;
- if (GlobalConfig::get_singleton()->has(action_prop)) {
+ if (ProjectSettings::get_singleton()->has(action_prop)) {
ti->set_text(0, old_name);
add_at = "input/" + old_name;
message->set_text(vformat(TTR("Action '%s' already exists!"), new_name));
- message->popup_centered(Size2(300, 100));
+ message->popup_centered(Size2(300, 100) * EDSCALE);
return;
}
- int order = GlobalConfig::get_singleton()->get_order(add_at);
- Array va = GlobalConfig::get_singleton()->get(add_at);
+ int order = ProjectSettings::get_singleton()->get_order(add_at);
+ Array va = ProjectSettings::get_singleton()->get(add_at);
setting = true;
undo_redo->create_action(TTR("Rename Input Action Event"));
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "clear", add_at);
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set", action_prop, va);
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", action_prop, order);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "clear", action_prop);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set", add_at, va);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", add_at, order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", add_at);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", action_prop, va);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", action_prop, order);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", action_prop);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", add_at, va);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", add_at, order);
undo_redo->add_do_method(this, "_update_actions");
undo_redo->add_undo_method(this, "_update_actions");
undo_redo->add_do_method(this, "_settings_changed");
@@ -172,66 +177,91 @@ void ProjectSettings::_action_edited() {
add_at = action_prop;
}
-void ProjectSettings::_device_input_add() {
+void ProjectSettingsEditor::_device_input_add() {
- InputEvent ie;
+ Ref<InputEvent> ie;
String name = add_at;
- Variant old_val = GlobalConfig::get_singleton()->get(name);
+ int idx = edit_idx;
+ Variant old_val = ProjectSettings::get_singleton()->get(name);
Array arr = old_val;
- ie.device = device_id->get_value();
-
- ie.type = add_type;
+ // ie.device = device_id->get_value();
+ // ie.type = add_type;
switch (add_type) {
- case InputEvent::MOUSE_BUTTON: {
+ case INPUT_MOUSE_BUTTON: {
- ie.mouse_button.button_index = device_index->get_selected() + 1;
+ Ref<InputEventMouseButton> mb;
+ mb.instance();
+ mb->set_button_index(device_index->get_selected() + 1);
+ mb->set_device(device_id->get_value());
for (int i = 0; i < arr.size(); i++) {
- InputEvent aie = arr[i];
- if (aie.device == ie.device && aie.type == InputEvent::MOUSE_BUTTON && aie.mouse_button.button_index == ie.mouse_button.button_index) {
+ Ref<InputEventMouseButton> aie = arr[i];
+ if (aie.is_null())
+ continue;
+ if (aie->get_device() == mb->get_device() && aie->get_button_index() == mb->get_button_index()) {
return;
}
}
+ ie = mb;
+
} break;
- case InputEvent::JOYPAD_MOTION: {
+ case INPUT_JOY_MOTION: {
- ie.joy_motion.axis = device_index->get_selected() >> 1;
- ie.joy_motion.axis_value = device_index->get_selected() & 1 ? 1 : -1;
+ Ref<InputEventJoypadMotion> jm;
+ jm.instance();
+ jm->set_axis(device_index->get_selected() >> 1);
+ jm->set_axis_value(device_index->get_selected() & 1 ? 1 : -1);
+ jm->set_device(device_id->get_value());
for (int i = 0; i < arr.size(); i++) {
- InputEvent aie = arr[i];
- if (aie.device == ie.device && aie.type == InputEvent::JOYPAD_MOTION && aie.joy_motion.axis == ie.joy_motion.axis && aie.joy_motion.axis_value == ie.joy_motion.axis_value) {
+ Ref<InputEventJoypadMotion> aie = arr[i];
+ if (aie.is_null())
+ continue;
+ if (aie->get_device() == jm->get_device() && aie->get_axis() == jm->get_axis() && aie->get_axis_value() == jm->get_axis_value()) {
return;
}
}
+ ie = jm;
+
} break;
- case InputEvent::JOYPAD_BUTTON: {
+ case INPUT_JOY_BUTTON: {
+
+ Ref<InputEventJoypadButton> jb;
+ jb.instance();
- ie.joy_button.button_index = device_index->get_selected();
+ jb->set_button_index(device_index->get_selected());
+ jb->set_device(device_id->get_value());
for (int i = 0; i < arr.size(); i++) {
- InputEvent aie = arr[i];
- if (aie.device == ie.device && aie.type == InputEvent::JOYPAD_BUTTON && aie.joy_button.button_index == ie.joy_button.button_index) {
+ Ref<InputEventJoypadButton> aie = arr[i];
+ if (aie.is_null())
+ continue;
+ if (aie->get_device() == jb->get_device() && aie->get_button_index() == jb->get_button_index()) {
return;
}
}
+ ie = jb;
} break;
default: {}
}
- arr.push_back(ie);
+ if (idx < 0 || idx >= arr.size()) {
+ arr.push_back(ie);
+ } else {
+ arr[idx] = ie;
+ }
undo_redo->create_action(TTR("Add Input Action Event"));
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set", name, arr);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set", name, old_val);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, arr);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", name, old_val);
undo_redo->add_do_method(this, "_update_actions");
undo_redo->add_undo_method(this, "_update_actions");
undo_redo->add_do_method(this, "_settings_changed");
@@ -241,33 +271,44 @@ void ProjectSettings::_device_input_add() {
_show_last_added(ie, name);
}
-void ProjectSettings::_press_a_key_confirm() {
+void ProjectSettingsEditor::_press_a_key_confirm() {
- if (last_wait_for_key.type != InputEvent::KEY)
+ if (last_wait_for_key.is_null())
return;
- InputEvent ie;
- ie.type = InputEvent::KEY;
- ie.key.scancode = last_wait_for_key.key.scancode;
- ie.key.mod = last_wait_for_key.key.mod;
+ Ref<InputEventKey> ie;
+ ie.instance();
+ ie->set_scancode(last_wait_for_key->get_scancode());
+ ie->set_shift(last_wait_for_key->get_shift());
+ ie->set_alt(last_wait_for_key->get_alt());
+ ie->set_control(last_wait_for_key->get_control());
+ ie->set_metakey(last_wait_for_key->get_metakey());
+
String name = add_at;
+ int idx = edit_idx;
- Variant old_val = GlobalConfig::get_singleton()->get(name);
+ Variant old_val = ProjectSettings::get_singleton()->get(name);
Array arr = old_val;
for (int i = 0; i < arr.size(); i++) {
- InputEvent aie = arr[i];
- if (aie.type == InputEvent::KEY && aie.key.scancode == ie.key.scancode && aie.key.mod == ie.key.mod) {
+ Ref<InputEventKey> aie = arr[i];
+ if (aie.is_null())
+ continue;
+ if (aie->get_scancode_with_modifiers() == ie->get_scancode_with_modifiers()) {
return;
}
}
- arr.push_back(ie);
+ if (idx < 0 || idx >= arr.size()) {
+ arr.push_back(ie);
+ } else {
+ arr[idx] = ie;
+ }
undo_redo->create_action(TTR("Add Input Action Event"));
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set", name, arr);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set", name, old_val);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, arr);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", name, old_val);
undo_redo->add_do_method(this, "_update_actions");
undo_redo->add_undo_method(this, "_update_actions");
undo_redo->add_do_method(this, "_settings_changed");
@@ -277,7 +318,7 @@ void ProjectSettings::_press_a_key_confirm() {
_show_last_added(ie, name);
}
-void ProjectSettings::_show_last_added(const InputEvent &p_event, const String &p_name) {
+void ProjectSettingsEditor::_show_last_added(const Ref<InputEvent> &p_event, const String &p_name) {
TreeItem *r = input_editor->get_root();
String name = p_name;
@@ -310,19 +351,21 @@ void ProjectSettings::_show_last_added(const InputEvent &p_event, const String &
if (found) input_editor->ensure_cursor_is_visible();
}
-void ProjectSettings::_wait_for_key(const InputEvent &p_event) {
+void ProjectSettingsEditor::_wait_for_key(const Ref<InputEvent> &p_event) {
+
+ Ref<InputEventKey> k = p_event;
- if (p_event.type == InputEvent::KEY && p_event.key.pressed && p_event.key.scancode != 0) {
+ if (k.is_valid() && k->is_pressed() && k->get_scancode() != 0) {
last_wait_for_key = p_event;
- String str = keycode_get_string(p_event.key.scancode).capitalize();
- if (p_event.key.mod.meta)
+ String str = keycode_get_string(k->get_scancode()).capitalize();
+ if (k->get_metakey())
str = TTR("Meta+") + str;
- if (p_event.key.mod.shift)
+ if (k->get_shift())
str = TTR("Shift+") + str;
- if (p_event.key.mod.alt)
+ if (k->get_alt())
str = TTR("Alt+") + str;
- if (p_event.key.mod.control)
+ if (k->get_control())
str = TTR("Control+") + str;
press_a_key_label->set_text(str);
@@ -330,22 +373,21 @@ void ProjectSettings::_wait_for_key(const InputEvent &p_event) {
}
}
-void ProjectSettings::_add_item(int p_item) {
+void ProjectSettingsEditor::_add_item(int p_item, Ref<InputEvent> p_exiting_event) {
- add_type = InputEvent::Type(p_item);
+ add_type = InputType(p_item);
switch (add_type) {
- case InputEvent::KEY: {
+ case INPUT_KEY: {
press_a_key_label->set_text(TTR("Press a Key.."));
- last_wait_for_key = InputEvent();
+ last_wait_for_key = Ref<InputEvent>();
press_a_key->popup_centered(Size2(250, 80) * EDSCALE);
press_a_key->grab_focus();
} break;
- case InputEvent::MOUSE_BUTTON: {
+ case INPUT_MOUSE_BUTTON: {
- device_id->set_value(0);
device_index_label->set_text(TTR("Mouse Button Index:"));
device_index->clear();
device_index->add_item(TTR("Left Button"));
@@ -357,11 +399,20 @@ void ProjectSettings::_add_item(int p_item) {
device_index->add_item(TTR("Button 7"));
device_index->add_item(TTR("Button 8"));
device_index->add_item(TTR("Button 9"));
- device_input->popup_centered_minsize(Size2(350, 95));
+ device_input->popup_centered_minsize(Size2(350, 95) * EDSCALE);
+
+ Ref<InputEventMouseButton> mb = p_exiting_event;
+ if (mb.is_valid()) {
+ device_index->select(mb->get_button_index() - 1);
+ device_id->set_value(mb->get_device());
+ device_input->get_ok()->set_text(TTR("Change"));
+ } else {
+ device_id->set_value(0);
+ device_input->get_ok()->set_text(TTR("Add"));
+ }
} break;
- case InputEvent::JOYPAD_MOTION: {
+ case INPUT_JOY_MOTION: {
- device_id->set_value(0);
device_index_label->set_text(TTR("Joypad Axis Index:"));
device_index->clear();
for (int i = 0; i < JOY_AXIS_MAX * 2; i++) {
@@ -369,12 +420,20 @@ void ProjectSettings::_add_item(int p_item) {
String desc = _axis_names[i];
device_index->add_item(TTR("Axis") + " " + itos(i / 2) + " " + (i & 1 ? "+" : "-") + desc);
}
- device_input->popup_centered_minsize(Size2(350, 95));
-
+ device_input->popup_centered_minsize(Size2(350, 95) * EDSCALE);
+
+ Ref<InputEventJoypadMotion> jm = p_exiting_event;
+ if (jm.is_valid()) {
+ device_index->select(jm->get_axis() * 2 + (jm->get_axis_value() > 0 ? 1 : 0));
+ device_id->set_value(jm->get_device());
+ device_input->get_ok()->set_text(TTR("Change"));
+ } else {
+ device_id->set_value(0);
+ device_input->get_ok()->set_text(TTR("Add"));
+ }
} break;
- case InputEvent::JOYPAD_BUTTON: {
+ case INPUT_JOY_BUTTON: {
- device_id->set_value(0);
device_index_label->set_text(TTR("Joypad Button Index:"));
device_index->clear();
@@ -382,28 +441,84 @@ void ProjectSettings::_add_item(int p_item) {
device_index->add_item(itos(i) + ": " + String(_button_names[i]));
}
- device_input->popup_centered_minsize(Size2(350, 95));
+ device_input->popup_centered_minsize(Size2(350, 95) * EDSCALE);
+
+ Ref<InputEventJoypadButton> jb = p_exiting_event;
+ if (jb.is_valid()) {
+ device_index->select(jb->get_button_index());
+ device_id->set_value(jb->get_device());
+ device_input->get_ok()->set_text(TTR("Change"));
+ } else {
+ device_id->set_value(0);
+ device_input->get_ok()->set_text(TTR("Add"));
+ }
} break;
default: {}
}
}
-void ProjectSettings::_action_button_pressed(Object *p_obj, int p_column, int p_id) {
+void ProjectSettingsEditor::_edit_item(Ref<InputEvent> p_exiting_event) {
+
+ InputType ie_type;
+
+ if ((Ref<InputEventKey>(p_exiting_event)).is_valid()) {
+ ie_type = INPUT_KEY;
+
+ } else if ((Ref<InputEventJoypadButton>(p_exiting_event)).is_valid()) {
+ ie_type = INPUT_JOY_BUTTON;
+
+ } else if ((Ref<InputEventMouseButton>(p_exiting_event)).is_valid()) {
+ ie_type = INPUT_MOUSE_BUTTON;
+
+ } else if ((Ref<InputEventJoypadMotion>(p_exiting_event)).is_valid()) {
+ ie_type = INPUT_JOY_MOTION;
+
+ } else {
+ return;
+ }
+
+ _add_item(ie_type, p_exiting_event);
+}
+void ProjectSettingsEditor::_action_activated() {
+
+ TreeItem *ti = input_editor->get_selected();
+
+ if (!ti || ti->get_parent() == input_editor->get_root())
+ return;
+
+ String name = "input/" + ti->get_parent()->get_text(0);
+ int idx = ti->get_metadata(0);
+ Array va = ProjectSettings::get_singleton()->get(name);
+
+ ERR_FAIL_INDEX(idx, va.size());
+
+ Ref<InputEvent> ie = va[idx];
+
+ if (ie.is_null())
+ return;
+
+ add_at = name;
+ edit_idx = idx;
+ _edit_item(ie);
+}
+
+void ProjectSettingsEditor::_action_button_pressed(Object *p_obj, int p_column, int p_id) {
TreeItem *ti = p_obj->cast_to<TreeItem>();
ERR_FAIL_COND(!ti);
if (p_id == 1) {
- Point2 ofs = input_editor->get_global_pos();
+ Point2 ofs = input_editor->get_global_position();
Rect2 ir = input_editor->get_item_rect(ti);
- ir.pos.y -= input_editor->get_scroll().y;
- ofs += ir.pos + ir.size;
+ ir.position.y -= input_editor->get_scroll().y;
+ ofs += ir.position + ir.size;
ofs.x -= 100;
- popup_add->set_pos(ofs);
+ popup_add->set_position(ofs);
popup_add->popup();
add_at = "input/" + ti->get_text(0);
+ edit_idx = -1;
} else if (p_id == 2) {
//remove
@@ -413,13 +528,13 @@ void ProjectSettings::_action_button_pressed(Object *p_obj, int p_column, int p_
//remove main thing
String name = "input/" + ti->get_text(0);
- Variant old_val = GlobalConfig::get_singleton()->get(name);
- int order = GlobalConfig::get_singleton()->get_order(name);
+ Variant old_val = ProjectSettings::get_singleton()->get(name);
+ int order = ProjectSettings::get_singleton()->get_order(name);
undo_redo->create_action(TTR("Add Input Action"));
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "clear", name);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set", name, old_val);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", name, order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", name);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", name, old_val);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", name, order);
undo_redo->add_do_method(this, "_update_actions");
undo_redo->add_undo_method(this, "_update_actions");
undo_redo->add_do_method(this, "_settings_changed");
@@ -429,7 +544,7 @@ void ProjectSettings::_action_button_pressed(Object *p_obj, int p_column, int p_
} else {
//remove action
String name = "input/" + ti->get_parent()->get_text(0);
- Variant old_val = GlobalConfig::get_singleton()->get(name);
+ Variant old_val = ProjectSettings::get_singleton()->get(name);
int idx = ti->get_metadata(0);
Array va = old_val;
@@ -444,18 +559,44 @@ void ProjectSettings::_action_button_pressed(Object *p_obj, int p_column, int p_
va.resize(va.size() - 1);
undo_redo->create_action(TTR("Erase Input Action Event"));
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set", name, va);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set", name, old_val);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, va);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", name, old_val);
undo_redo->add_do_method(this, "_update_actions");
undo_redo->add_undo_method(this, "_update_actions");
undo_redo->add_do_method(this, "_settings_changed");
undo_redo->add_undo_method(this, "_settings_changed");
undo_redo->commit_action();
}
+ } else if (p_id == 3) {
+ //edit
+
+ if (ti->get_parent() == input_editor->get_root()) {
+
+ ti->set_as_cursor(0);
+ input_editor->edit_selected();
+
+ } else {
+ //edit action
+ String name = "input/" + ti->get_parent()->get_text(0);
+ int idx = ti->get_metadata(0);
+ Array va = ProjectSettings::get_singleton()->get(name);
+
+ ERR_FAIL_INDEX(idx, va.size());
+
+ Ref<InputEvent> ie = va[idx];
+
+ if (ie.is_null())
+ return;
+
+ ti->set_as_cursor(0);
+ add_at = name;
+ edit_idx = idx;
+ _edit_item(ie);
+ }
}
}
-void ProjectSettings::_update_actions() {
+void ProjectSettingsEditor::_update_actions() {
if (setting)
return;
@@ -465,7 +606,7 @@ void ProjectSettings::_update_actions() {
input_editor->set_hide_root(true);
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -480,86 +621,92 @@ void ProjectSettings::_update_actions() {
TreeItem *item = input_editor->create_item(root);
//item->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
item->set_text(0, name);
- item->add_button(0, get_icon("Add", "EditorIcons"), 1);
- if (!GlobalConfig::get_singleton()->get_input_presets().find(pi.name)) {
- item->add_button(0, get_icon("Remove", "EditorIcons"), 2);
+ item->add_button(0, get_icon("Add", "EditorIcons"), 1, false, TTR("Add Event"));
+ if (!ProjectSettings::get_singleton()->get_input_presets().find(pi.name)) {
+ item->add_button(0, get_icon("Remove", "EditorIcons"), 2, false, TTR("Remove"));
item->set_editable(0, true);
}
item->set_custom_bg_color(0, get_color("prop_subsection", "Editor"));
//item->set_checked(0,pi.usage&PROPERTY_USAGE_CHECKED);
- Array actions = GlobalConfig::get_singleton()->get(pi.name);
+ Array actions = ProjectSettings::get_singleton()->get(pi.name);
for (int i = 0; i < actions.size(); i++) {
- if (actions[i].get_type() != Variant::INPUT_EVENT)
+ Ref<InputEvent> ie = actions[i];
+ if (ie.is_null())
continue;
- InputEvent ie = actions[i];
TreeItem *action = input_editor->create_item(item);
- switch (ie.type) {
-
- case InputEvent::KEY: {
-
- String str = keycode_get_string(ie.key.scancode).capitalize();
- if (ie.key.mod.meta)
- str = TTR("Meta+") + str;
- if (ie.key.mod.shift)
- str = TTR("Shift+") + str;
- if (ie.key.mod.alt)
- str = TTR("Alt+") + str;
- if (ie.key.mod.control)
- str = TTR("Control+") + str;
-
- action->set_text(0, str);
- action->set_icon(0, get_icon("Keyboard", "EditorIcons"));
-
- } break;
- case InputEvent::JOYPAD_BUTTON: {
-
- String str = TTR("Device") + " " + itos(ie.device) + ", " + TTR("Button") + " " + itos(ie.joy_button.button_index);
- if (ie.joy_button.button_index >= 0 && ie.joy_button.button_index < JOY_BUTTON_MAX)
- str += String() + " (" + _button_names[ie.joy_button.button_index] + ").";
- else
- str += ".";
-
- action->set_text(0, str);
- action->set_icon(0, get_icon("JoyButton", "EditorIcons"));
- } break;
- case InputEvent::MOUSE_BUTTON: {
-
- String str = TTR("Device") + " " + itos(ie.device) + ", ";
- switch (ie.mouse_button.button_index) {
- case BUTTON_LEFT: str += TTR("Left Button."); break;
- case BUTTON_RIGHT: str += TTR("Right Button."); break;
- case BUTTON_MIDDLE: str += TTR("Middle Button."); break;
- case BUTTON_WHEEL_UP: str += TTR("Wheel Up."); break;
- case BUTTON_WHEEL_DOWN: str += TTR("Wheel Down."); break;
- default: str += TTR("Button") + " " + itos(ie.mouse_button.button_index) + ".";
- }
-
- action->set_text(0, str);
- action->set_icon(0, get_icon("Mouse", "EditorIcons"));
- } break;
- case InputEvent::JOYPAD_MOTION: {
-
- int ax = ie.joy_motion.axis;
- int n = 2 * ax + (ie.joy_motion.axis_value < 0 ? 0 : 1);
- String desc = _axis_names[n];
- String str = TTR("Device") + " " + itos(ie.device) + ", " + TTR("Axis") + " " + itos(ax) + " " + (ie.joy_motion.axis_value < 0 ? "-" : "+") + desc + ".";
- action->set_text(0, str);
- action->set_icon(0, get_icon("JoyAxis", "EditorIcons"));
- } break;
+ Ref<InputEventKey> k = ie;
+ if (k.is_valid()) {
+
+ String str = keycode_get_string(k->get_scancode()).capitalize();
+ if (k->get_metakey())
+ str = TTR("Meta+") + str;
+ if (k->get_shift())
+ str = TTR("Shift+") + str;
+ if (k->get_alt())
+ str = TTR("Alt+") + str;
+ if (k->get_control())
+ str = TTR("Control+") + str;
+
+ action->set_text(0, str);
+ action->set_icon(0, get_icon("Keyboard", "EditorIcons"));
+ }
+
+ Ref<InputEventJoypadButton> jb = ie;
+
+ if (jb.is_valid()) {
+
+ String str = TTR("Device") + " " + itos(jb->get_device()) + ", " + TTR("Button") + " " + itos(jb->get_button_index());
+ if (jb->get_button_index() >= 0 && jb->get_button_index() < JOY_BUTTON_MAX)
+ str += String() + " (" + _button_names[jb->get_button_index()] + ").";
+ else
+ str += ".";
+
+ action->set_text(0, str);
+ action->set_icon(0, get_icon("JoyButton", "EditorIcons"));
+ }
+
+ Ref<InputEventMouseButton> mb = ie;
+
+ if (mb.is_valid()) {
+ String str = TTR("Device") + " " + itos(mb->get_device()) + ", ";
+ switch (mb->get_button_index()) {
+ case BUTTON_LEFT: str += TTR("Left Button."); break;
+ case BUTTON_RIGHT: str += TTR("Right Button."); break;
+ case BUTTON_MIDDLE: str += TTR("Middle Button."); break;
+ case BUTTON_WHEEL_UP: str += TTR("Wheel Up."); break;
+ case BUTTON_WHEEL_DOWN: str += TTR("Wheel Down."); break;
+ default: str += TTR("Button") + " " + itos(mb->get_button_index()) + ".";
+ }
+
+ action->set_text(0, str);
+ action->set_icon(0, get_icon("Mouse", "EditorIcons"));
}
- action->add_button(0, get_icon("Remove", "EditorIcons"), 2);
+
+ Ref<InputEventJoypadMotion> jm = ie;
+
+ if (jm.is_valid()) {
+
+ int ax = jm->get_axis();
+ int n = 2 * ax + (jm->get_axis_value() < 0 ? 0 : 1);
+ String desc = _axis_names[n];
+ String str = TTR("Device") + " " + itos(jm->get_device()) + ", " + TTR("Axis") + " " + itos(ax) + " " + (jm->get_axis_value() < 0 ? "-" : "+") + desc + ".";
+ action->set_text(0, str);
+ action->set_icon(0, get_icon("JoyAxis", "EditorIcons"));
+ }
+ action->add_button(0, get_icon("Edit", "EditorIcons"), 3, false, TTR("Edit"));
+ action->add_button(0, get_icon("Remove", "EditorIcons"), 2, false, TTR("Remove"));
action->set_metadata(0, i);
action->set_meta("__input", ie);
}
}
}
-void ProjectSettings::popup_project_settings() {
+void ProjectSettingsEditor::popup_project_settings() {
// Restore valid window bounds or pop up at default size.
if (EditorSettings::get_singleton()->has("interface/dialogs/project_settings_bounds")) {
@@ -573,7 +720,7 @@ void ProjectSettings::popup_project_settings() {
plugin_settings->update_plugins();
}
-void ProjectSettings::_item_selected() {
+void ProjectSettingsEditor::_item_selected() {
TreeItem *ti = globals_editor->get_property_editor()->get_scene_tree()->get_selected();
if (!ti)
@@ -582,15 +729,15 @@ void ProjectSettings::_item_selected() {
return;
category->set_text(globals_editor->get_current_section());
property->set_text(ti->get_text(0));
- popup_platform->set_disabled(false);
+ popup_copy_to_feature->set_disabled(false);
}
-void ProjectSettings::_item_adds(String) {
+void ProjectSettingsEditor::_item_adds(String) {
_item_add();
}
-void ProjectSettings::_item_add() {
+void ProjectSettingsEditor::_item_add() {
Variant value;
switch (type->get_selected()) {
@@ -618,12 +765,12 @@ void ProjectSettings::_item_add() {
undo_redo->create_action("Add Global Property");
- undo_redo->add_do_property(GlobalConfig::get_singleton(), name, value);
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), name, value);
- if (GlobalConfig::get_singleton()->has(name)) {
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name));
+ if (ProjectSettings::get_singleton()->has(name)) {
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, ProjectSettings::get_singleton()->get(name));
} else {
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, Variant());
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, Variant());
}
undo_redo->add_do_method(globals_editor, "update_category_list");
@@ -639,20 +786,35 @@ void ProjectSettings::_item_add() {
_settings_changed();
}
-void ProjectSettings::_item_del() {
+void ProjectSettingsEditor::_item_del() {
- String catname = category->get_text().strip_edges();
- //ERR_FAIL_COND(!catname.is_valid_identifier());
- String propname = property->get_text().strip_edges();
- //ERR_FAIL_COND(!propname.is_valid_identifier());
+ String path = globals_editor->get_property_editor()->get_selected_path();
+ if (path == String()) {
+ EditorNode::get_singleton()->show_warning(TTR("Select an setting item first!"));
+ return;
+ }
- String name = catname != "" ? catname + "/" + propname : propname;
+ String property = globals_editor->get_current_section().plus_file(path);
+
+ if (!ProjectSettings::get_singleton()->has(property)) {
+ EditorNode::get_singleton()->show_warning(TTR("No property '" + property + "' exists."));
+ return;
+ }
+
+ if (ProjectSettings::get_singleton()->get_order(property) < ProjectSettings::NO_BUILTIN_ORDER_BASE) {
+ EditorNode::get_singleton()->show_warning(TTR("Setting '" + property + "' is internal, and it can't be deleted."));
+ return;
+ }
- undo_redo->create_action("Delete Global Property");
+ print_line("to delete.. " + property);
+ undo_redo->create_action(TTR("Delete Item"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), name, Variant());
+ Variant value = ProjectSettings::get_singleton()->get(property);
+ int order = ProjectSettings::get_singleton()->get_order(property);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name));
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", property);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", property, value);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", property, order);
undo_redo->add_do_method(globals_editor, "update_category_list");
undo_redo->add_undo_method(globals_editor, "update_category_list");
@@ -661,35 +823,33 @@ void ProjectSettings::_item_del() {
undo_redo->add_undo_method(this, "_settings_changed");
undo_redo->commit_action();
-
- _settings_changed();
}
-void ProjectSettings::_action_adds(String) {
+void ProjectSettingsEditor::_action_adds(String) {
_action_add();
}
-void ProjectSettings::_action_add() {
+void ProjectSettingsEditor::_action_add() {
String action = action_name->get_text();
if (action.find("/") != -1 || action.find(":") != -1 || action == "") {
message->set_text(TTR("Invalid action (anything goes but '/' or ':')."));
- message->popup_centered(Size2(300, 100));
+ message->popup_centered(Size2(300, 100) * EDSCALE);
return;
}
- if (GlobalConfig::get_singleton()->has("input/" + action)) {
+ if (ProjectSettings::get_singleton()->has("input/" + action)) {
message->set_text(vformat(TTR("Action '%s' already exists!"), action));
- message->popup_centered(Size2(300, 100));
+ message->popup_centered(Size2(300, 100) * EDSCALE);
return;
}
Array va;
String name = "input/" + action;
undo_redo->create_action(TTR("Add Input Action Event"));
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set", name, va);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "clear", name);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, va);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", name);
undo_redo->add_do_method(this, "_update_actions");
undo_redo->add_undo_method(this, "_update_actions");
undo_redo->add_do_method(this, "_settings_changed");
@@ -712,66 +872,119 @@ void ProjectSettings::_action_add() {
input_editor->ensure_cursor_is_visible();
}
-void ProjectSettings::_item_checked(const String &p_item, bool p_check) {
+void ProjectSettingsEditor::_item_checked(const String &p_item, bool p_check) {
}
-void ProjectSettings::_save() {
+void ProjectSettingsEditor::_save() {
- Error err = GlobalConfig::get_singleton()->save();
+ Error err = ProjectSettings::get_singleton()->save();
message->set_text(err != OK ? TTR("Error saving settings.") : TTR("Settings saved OK."));
- message->popup_centered(Size2(300, 100));
+ message->popup_centered(Size2(300, 100) * EDSCALE);
}
-void ProjectSettings::_settings_prop_edited(const String &p_name) {
+void ProjectSettingsEditor::_settings_prop_edited(const String &p_name) {
String full_item = globals_editor->get_full_item_path(p_name);
_settings_changed();
}
-void ProjectSettings::_settings_changed() {
+void ProjectSettingsEditor::_settings_changed() {
timer->start();
}
-void ProjectSettings::queue_save() {
+void ProjectSettingsEditor::queue_save() {
_settings_changed();
}
-void ProjectSettings::_copy_to_platform(int p_which) {
+void ProjectSettingsEditor::_copy_to_platform_about_to_show() {
- String catname = category->get_text();
- if (!catname.is_valid_identifier()) {
- message->set_text("Invalid Category.\nValid characters: a-z,A-Z,0-9 or _");
- message->popup_centered(Size2(300, 100));
- return;
+ Set<String> presets;
+
+ presets.insert("s3tc");
+ presets.insert("etc");
+ presets.insert("etc2");
+ presets.insert("pvrtc");
+ presets.insert("debug");
+ presets.insert("release");
+
+ for (int i = 0; i < EditorExport::get_singleton()->get_export_platform_count(); i++) {
+ List<String> p;
+ EditorExport::get_singleton()->get_export_platform(i)->get_platform_features(&p);
+ for (List<String>::Element *E = p.front(); E; E = E->next()) {
+ presets.insert(E->get());
+ }
}
- String propname = property->get_text();
- if (!propname.is_valid_identifier()) {
- message->set_text("Invalid Property.\nValid characters: a-z,A-Z,0-9 or _");
- message->popup_centered(Size2(300, 100));
+ for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); i++) {
+
+ List<String> p;
+ EditorExport::get_singleton()->get_export_preset(i)->get_platform()->get_preset_features(EditorExport::get_singleton()->get_export_preset(i), &p);
+ for (List<String>::Element *E = p.front(); E; E = E->next()) {
+ presets.insert(E->get());
+ }
+
+ String custom = EditorExport::get_singleton()->get_export_preset(i)->get_custom_features();
+ Vector<String> custom_list = custom.split(",");
+ for (int i = 0; i < custom_list.size(); i++) {
+ String f = custom_list[i].strip_edges();
+ if (f != String()) {
+ presets.insert(f);
+ }
+ }
+ }
+
+ popup_copy_to_feature->get_popup()->clear();
+ int id = 0;
+ for (Set<String>::Element *E = presets.front(); E; E = E->next()) {
+ popup_copy_to_feature->get_popup()->add_item(E->get(), id++);
+ }
+}
+
+void ProjectSettingsEditor::_copy_to_platform(int p_which) {
+
+ String path = globals_editor->get_property_editor()->get_selected_path();
+ if (path == String()) {
+ EditorNode::get_singleton()->show_warning(TTR("Select an setting item first!"));
return;
}
- String name = catname + "/" + propname;
- Variant value = GlobalConfig::get_singleton()->get(name);
+ String property = globals_editor->get_current_section().plus_file(path);
- catname += "." + popup_platform->get_popup()->get_item_text(p_which);
- name = catname + "/" + propname;
+ undo_redo->create_action(TTR("Override for Feature"));
- GlobalConfig::get_singleton()->set(name, value);
- globals_editor->get_property_editor()->update_tree();
+ Variant value = ProjectSettings::get_singleton()->get(property);
+ if (property.find(".") != -1) { //overwriting overwrite, keep overwrite
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", property);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", property, value);
+ }
+
+ String feature = popup_copy_to_feature->get_popup()->get_item_text(p_which);
+ String new_path = property + "." + feature;
+
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", new_path, value);
+ if (ProjectSettings::get_singleton()->has(new_path)) {
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", new_path, ProjectSettings::get_singleton()->get(new_path));
+ }
+
+ undo_redo->add_do_method(globals_editor, "update_category_list");
+ undo_redo->add_undo_method(globals_editor, "update_category_list");
+
+ undo_redo->add_do_method(this, "_settings_changed");
+ undo_redo->add_undo_method(this, "_settings_changed");
+
+ undo_redo->commit_action();
}
-void ProjectSettings::add_translation(const String &p_translation) {
+void ProjectSettingsEditor::add_translation(const String &p_translation) {
_translation_add(p_translation);
}
-void ProjectSettings::_translation_add(const String &p_path) {
+void ProjectSettingsEditor::_translation_add(const String &p_path) {
- PoolStringArray translations = GlobalConfig::get_singleton()->get("locale/translations");
+ PoolStringArray translations = ProjectSettings::get_singleton()->get("locale/translations");
for (int i = 0; i < translations.size(); i++) {
@@ -781,8 +994,8 @@ void ProjectSettings::_translation_add(const String &p_path) {
translations.push_back(p_path);
undo_redo->create_action(TTR("Add Translation"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), "locale/translations", translations);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), "locale/translations", GlobalConfig::get_singleton()->get("locale/translations"));
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), "locale/translations", translations);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), "locale/translations", ProjectSettings::get_singleton()->get("locale/translations"));
undo_redo->add_do_method(this, "_update_translations");
undo_redo->add_undo_method(this, "_update_translations");
undo_redo->add_do_method(this, "_settings_changed");
@@ -790,27 +1003,27 @@ void ProjectSettings::_translation_add(const String &p_path) {
undo_redo->commit_action();
}
-void ProjectSettings::_translation_file_open() {
+void ProjectSettingsEditor::_translation_file_open() {
translation_file_open->popup_centered_ratio();
}
-void ProjectSettings::_translation_delete(Object *p_item, int p_column, int p_button) {
+void ProjectSettingsEditor::_translation_delete(Object *p_item, int p_column, int p_button) {
TreeItem *ti = p_item->cast_to<TreeItem>();
ERR_FAIL_COND(!ti);
int idx = ti->get_metadata(0);
- PoolStringArray translations = GlobalConfig::get_singleton()->get("locale/translations");
+ PoolStringArray translations = ProjectSettings::get_singleton()->get("locale/translations");
ERR_FAIL_INDEX(idx, translations.size());
translations.remove(idx);
undo_redo->create_action(TTR("Remove Translation"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), "locale/translations", translations);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), "locale/translations", GlobalConfig::get_singleton()->get("locale/translations"));
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), "locale/translations", translations);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), "locale/translations", ProjectSettings::get_singleton()->get("locale/translations"));
undo_redo->add_do_method(this, "_update_translations");
undo_redo->add_undo_method(this, "_update_translations");
undo_redo->add_do_method(this, "_settings_changed");
@@ -818,18 +1031,18 @@ void ProjectSettings::_translation_delete(Object *p_item, int p_column, int p_bu
undo_redo->commit_action();
}
-void ProjectSettings::_translation_res_file_open() {
+void ProjectSettingsEditor::_translation_res_file_open() {
translation_res_file_open->popup_centered_ratio();
}
-void ProjectSettings::_translation_res_add(const String &p_path) {
+void ProjectSettingsEditor::_translation_res_add(const String &p_path) {
Variant prev;
Dictionary remaps;
- if (GlobalConfig::get_singleton()->has("locale/translation_remaps")) {
- remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
+ if (ProjectSettings::get_singleton()->has("locale/translation_remaps")) {
+ remaps = ProjectSettings::get_singleton()->get("locale/translation_remaps");
prev = remaps;
}
@@ -839,8 +1052,8 @@ void ProjectSettings::_translation_res_add(const String &p_path) {
remaps[p_path] = PoolStringArray();
undo_redo->create_action(TTR("Add Remapped Path"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), "locale/translation_remaps", remaps);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), "locale/translation_remaps", prev);
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), "locale/translation_remaps", remaps);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), "locale/translation_remaps", prev);
undo_redo->add_do_method(this, "_update_translations");
undo_redo->add_undo_method(this, "_update_translations");
undo_redo->add_do_method(this, "_settings_changed");
@@ -848,15 +1061,15 @@ void ProjectSettings::_translation_res_add(const String &p_path) {
undo_redo->commit_action();
}
-void ProjectSettings::_translation_res_option_file_open() {
+void ProjectSettingsEditor::_translation_res_option_file_open() {
translation_res_option_file_open->popup_centered_ratio();
}
-void ProjectSettings::_translation_res_option_add(const String &p_path) {
+void ProjectSettingsEditor::_translation_res_option_add(const String &p_path) {
- ERR_FAIL_COND(!GlobalConfig::get_singleton()->has("locale/translation_remaps"));
+ ERR_FAIL_COND(!ProjectSettings::get_singleton()->has("locale/translation_remaps"));
- Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
+ Dictionary remaps = ProjectSettings::get_singleton()->get("locale/translation_remaps");
TreeItem *k = translation_remap->get_selected();
ERR_FAIL_COND(!k);
@@ -869,8 +1082,8 @@ void ProjectSettings::_translation_res_option_add(const String &p_path) {
remaps[key] = r;
undo_redo->create_action(TTR("Resource Remap Add Remap"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), "locale/translation_remaps", remaps);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), "locale/translation_remaps", GlobalConfig::get_singleton()->get("locale/translation_remaps"));
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), "locale/translation_remaps", remaps);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), "locale/translation_remaps", ProjectSettings::get_singleton()->get("locale/translation_remaps"));
undo_redo->add_do_method(this, "_update_translations");
undo_redo->add_undo_method(this, "_update_translations");
undo_redo->add_do_method(this, "_settings_changed");
@@ -878,7 +1091,7 @@ void ProjectSettings::_translation_res_option_add(const String &p_path) {
undo_redo->commit_action();
}
-void ProjectSettings::_translation_res_select() {
+void ProjectSettingsEditor::_translation_res_select() {
if (updating_translations)
return;
@@ -886,15 +1099,15 @@ void ProjectSettings::_translation_res_select() {
call_deferred("_update_translations");
}
-void ProjectSettings::_translation_res_option_changed() {
+void ProjectSettingsEditor::_translation_res_option_changed() {
if (updating_translations)
return;
- if (!GlobalConfig::get_singleton()->has("locale/translation_remaps"))
+ if (!ProjectSettings::get_singleton()->has("locale/translation_remaps"))
return;
- Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
+ Dictionary remaps = ProjectSettings::get_singleton()->get("locale/translation_remaps");
TreeItem *k = translation_remap->get_selected();
ERR_FAIL_COND(!k);
@@ -918,8 +1131,8 @@ void ProjectSettings::_translation_res_option_changed() {
updating_translations = true;
undo_redo->create_action(TTR("Change Resource Remap Language"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), "locale/translation_remaps", remaps);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), "locale/translation_remaps", GlobalConfig::get_singleton()->get("locale/translation_remaps"));
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), "locale/translation_remaps", remaps);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), "locale/translation_remaps", ProjectSettings::get_singleton()->get("locale/translation_remaps"));
undo_redo->add_do_method(this, "_update_translations");
undo_redo->add_undo_method(this, "_update_translations");
undo_redo->add_do_method(this, "_settings_changed");
@@ -928,15 +1141,15 @@ void ProjectSettings::_translation_res_option_changed() {
updating_translations = false;
}
-void ProjectSettings::_translation_res_delete(Object *p_item, int p_column, int p_button) {
+void ProjectSettingsEditor::_translation_res_delete(Object *p_item, int p_column, int p_button) {
if (updating_translations)
return;
- if (!GlobalConfig::get_singleton()->has("locale/translation_remaps"))
+ if (!ProjectSettings::get_singleton()->has("locale/translation_remaps"))
return;
- Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
+ Dictionary remaps = ProjectSettings::get_singleton()->get("locale/translation_remaps");
TreeItem *k = p_item->cast_to<TreeItem>();
@@ -946,8 +1159,8 @@ void ProjectSettings::_translation_res_delete(Object *p_item, int p_column, int
remaps.erase(key);
undo_redo->create_action(TTR("Remove Resource Remap"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), "locale/translation_remaps", remaps);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), "locale/translation_remaps", GlobalConfig::get_singleton()->get("locale/translation_remaps"));
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), "locale/translation_remaps", remaps);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), "locale/translation_remaps", ProjectSettings::get_singleton()->get("locale/translation_remaps"));
undo_redo->add_do_method(this, "_update_translations");
undo_redo->add_undo_method(this, "_update_translations");
undo_redo->add_do_method(this, "_settings_changed");
@@ -955,15 +1168,15 @@ void ProjectSettings::_translation_res_delete(Object *p_item, int p_column, int
undo_redo->commit_action();
}
-void ProjectSettings::_translation_res_option_delete(Object *p_item, int p_column, int p_button) {
+void ProjectSettingsEditor::_translation_res_option_delete(Object *p_item, int p_column, int p_button) {
if (updating_translations)
return;
- if (!GlobalConfig::get_singleton()->has("locale/translation_remaps"))
+ if (!ProjectSettings::get_singleton()->has("locale/translation_remaps"))
return;
- Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
+ Dictionary remaps = ProjectSettings::get_singleton()->get("locale/translation_remaps");
TreeItem *k = translation_remap->get_selected();
ERR_FAIL_COND(!k);
@@ -980,8 +1193,8 @@ void ProjectSettings::_translation_res_option_delete(Object *p_item, int p_colum
remaps[key] = r;
undo_redo->create_action(TTR("Remove Resource Remap Option"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), "locale/translation_remaps", remaps);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), "locale/translation_remaps", GlobalConfig::get_singleton()->get("locale/translation_remaps"));
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), "locale/translation_remaps", remaps);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), "locale/translation_remaps", ProjectSettings::get_singleton()->get("locale/translation_remaps"));
undo_redo->add_do_method(this, "_update_translations");
undo_redo->add_undo_method(this, "_update_translations");
undo_redo->add_do_method(this, "_settings_changed");
@@ -989,7 +1202,7 @@ void ProjectSettings::_translation_res_option_delete(Object *p_item, int p_colum
undo_redo->commit_action();
}
-void ProjectSettings::_update_translations() {
+void ProjectSettingsEditor::_update_translations() {
//update translations
@@ -1001,9 +1214,9 @@ void ProjectSettings::_update_translations() {
translation_list->clear();
TreeItem *root = translation_list->create_item(NULL);
translation_list->set_hide_root(true);
- if (GlobalConfig::get_singleton()->has("locale/translations")) {
+ if (ProjectSettings::get_singleton()->has("locale/translations")) {
- PoolStringArray translations = GlobalConfig::get_singleton()->get("locale/translations");
+ PoolStringArray translations = ProjectSettings::get_singleton()->get("locale/translations");
for (int i = 0; i < translations.size(); i++) {
TreeItem *t = translation_list->create_item(root);
@@ -1011,7 +1224,7 @@ void ProjectSettings::_update_translations() {
t->set_text(0, translations[i].replace_first("res://", ""));
t->set_tooltip(0, translations[i]);
t->set_metadata(0, i);
- t->add_button(0, get_icon("Del", "EditorIcons"), 0);
+ t->add_button(0, get_icon("Del", "EditorIcons"), 0, false, TTR("Remove"));
}
}
@@ -1039,9 +1252,9 @@ void ProjectSettings::_update_translations() {
langnames += names[i];
}
- if (GlobalConfig::get_singleton()->has("locale/translation_remaps")) {
+ if (ProjectSettings::get_singleton()->has("locale/translation_remaps")) {
- Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
+ Dictionary remaps = ProjectSettings::get_singleton()->get("locale/translation_remaps");
List<Variant> rk;
remaps.get_key_list(&rk);
Vector<String> keys;
@@ -1057,7 +1270,7 @@ void ProjectSettings::_update_translations() {
t->set_text(0, keys[i].replace_first("res://", ""));
t->set_tooltip(0, keys[i]);
t->set_metadata(0, keys[i]);
- t->add_button(0, get_icon("Del", "EditorIcons"), 0);
+ t->add_button(0, get_icon("Del", "EditorIcons"), 0, false, TTR("Remove"));
if (keys[i] == remap_selected) {
t->select(0);
translation_res_option_add_button->set_disabled(false);
@@ -1075,7 +1288,7 @@ void ProjectSettings::_update_translations() {
t2->set_text(0, path.replace_first("res://", ""));
t2->set_tooltip(0, path);
t2->set_metadata(0, j);
- t2->add_button(0, get_icon("Del", "EditorIcons"), 0);
+ t2->add_button(0, get_icon("Del", "EditorIcons"), 0, false, TTR("Remove"));
t2->set_cell_mode(1, TreeItem::CELL_MODE_RANGE);
t2->set_text(1, langnames);
t2->set_editable(1, true);
@@ -1094,7 +1307,7 @@ void ProjectSettings::_update_translations() {
updating_translations = false;
}
-void ProjectSettings::_toggle_search_bar(bool p_pressed) {
+void ProjectSettingsEditor::_toggle_search_bar(bool p_pressed) {
globals_editor->get_property_editor()->set_use_filter(p_pressed);
@@ -1111,7 +1324,7 @@ void ProjectSettings::_toggle_search_bar(bool p_pressed) {
}
}
-void ProjectSettings::_clear_search_box() {
+void ProjectSettingsEditor::_clear_search_box() {
if (search_box->get_text() == "")
return;
@@ -1120,59 +1333,63 @@ void ProjectSettings::_clear_search_box() {
globals_editor->get_property_editor()->update_tree();
}
-void ProjectSettings::set_plugins_page() {
+void ProjectSettingsEditor::set_plugins_page() {
tab_container->set_current_tab(plugin_settings->get_index());
}
-void ProjectSettings::_bind_methods() {
-
- 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);
+void ProjectSettingsEditor::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("_item_selected"), &ProjectSettingsEditor::_item_selected);
+ ClassDB::bind_method(D_METHOD("_item_add"), &ProjectSettingsEditor::_item_add);
+ ClassDB::bind_method(D_METHOD("_item_adds"), &ProjectSettingsEditor::_item_adds);
+ ClassDB::bind_method(D_METHOD("_item_del"), &ProjectSettingsEditor::_item_del);
+ ClassDB::bind_method(D_METHOD("_item_checked"), &ProjectSettingsEditor::_item_checked);
+ ClassDB::bind_method(D_METHOD("_save"), &ProjectSettingsEditor::_save);
+ ClassDB::bind_method(D_METHOD("_action_add"), &ProjectSettingsEditor::_action_add);
+ ClassDB::bind_method(D_METHOD("_action_adds"), &ProjectSettingsEditor::_action_adds);
+ ClassDB::bind_method(D_METHOD("_action_selected"), &ProjectSettingsEditor::_action_selected);
+ ClassDB::bind_method(D_METHOD("_action_edited"), &ProjectSettingsEditor::_action_edited);
+ ClassDB::bind_method(D_METHOD("_action_activated"), &ProjectSettingsEditor::_action_activated);
+ ClassDB::bind_method(D_METHOD("_action_button_pressed"), &ProjectSettingsEditor::_action_button_pressed);
+ ClassDB::bind_method(D_METHOD("_update_actions"), &ProjectSettingsEditor::_update_actions);
+ ClassDB::bind_method(D_METHOD("_wait_for_key"), &ProjectSettingsEditor::_wait_for_key);
+ ClassDB::bind_method(D_METHOD("_add_item"), &ProjectSettingsEditor::_add_item, DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("_device_input_add"), &ProjectSettingsEditor::_device_input_add);
+ ClassDB::bind_method(D_METHOD("_press_a_key_confirm"), &ProjectSettingsEditor::_press_a_key_confirm);
+ ClassDB::bind_method(D_METHOD("_settings_prop_edited"), &ProjectSettingsEditor::_settings_prop_edited);
+ ClassDB::bind_method(D_METHOD("_copy_to_platform"), &ProjectSettingsEditor::_copy_to_platform);
+ ClassDB::bind_method(D_METHOD("_update_translations"), &ProjectSettingsEditor::_update_translations);
+ ClassDB::bind_method(D_METHOD("_translation_delete"), &ProjectSettingsEditor::_translation_delete);
+ ClassDB::bind_method(D_METHOD("_settings_changed"), &ProjectSettingsEditor::_settings_changed);
+ ClassDB::bind_method(D_METHOD("_translation_add"), &ProjectSettingsEditor::_translation_add);
+ ClassDB::bind_method(D_METHOD("_translation_file_open"), &ProjectSettingsEditor::_translation_file_open);
+
+ ClassDB::bind_method(D_METHOD("_translation_res_add"), &ProjectSettingsEditor::_translation_res_add);
+ ClassDB::bind_method(D_METHOD("_translation_res_file_open"), &ProjectSettingsEditor::_translation_res_file_open);
+ ClassDB::bind_method(D_METHOD("_translation_res_option_add"), &ProjectSettingsEditor::_translation_res_option_add);
+ ClassDB::bind_method(D_METHOD("_translation_res_option_file_open"), &ProjectSettingsEditor::_translation_res_option_file_open);
+ ClassDB::bind_method(D_METHOD("_translation_res_select"), &ProjectSettingsEditor::_translation_res_select);
+ ClassDB::bind_method(D_METHOD("_translation_res_option_changed"), &ProjectSettingsEditor::_translation_res_option_changed);
+ ClassDB::bind_method(D_METHOD("_translation_res_delete"), &ProjectSettingsEditor::_translation_res_delete);
+ ClassDB::bind_method(D_METHOD("_translation_res_option_delete"), &ProjectSettingsEditor::_translation_res_option_delete);
+
+ ClassDB::bind_method(D_METHOD("_clear_search_box"), &ProjectSettingsEditor::_clear_search_box);
+ ClassDB::bind_method(D_METHOD("_toggle_search_bar"), &ProjectSettingsEditor::_toggle_search_bar);
+
+ ClassDB::bind_method(D_METHOD("_copy_to_platform_about_to_show"), &ProjectSettingsEditor::_copy_to_platform_about_to_show);
}
-ProjectSettings::ProjectSettings(EditorData *p_data) {
+ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
singleton = this;
- set_title(TTR("Project Settings (godot.cfg)"));
+ set_title(TTR("Project Settings (project.godot)"));
set_resizable(true);
undo_redo = &p_data->get_undo_redo();
data = p_data;
tab_container = memnew(TabContainer);
+ tab_container->set_tab_align(TabContainer::ALIGN_LEFT);
add_child(tab_container);
//set_child_rect(tab_container);
@@ -1239,11 +1456,6 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
add->set_text(TTR("Add"));
add->connect("pressed", this, "_item_add");
- Button *del = memnew(Button);
- add_prop_bar->add_child(del);
- del->set_text(TTR("Del"));
- del->connect("pressed", this, "_item_del");
-
search_bar = memnew(HBoxContainer);
search_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->add_child(search_bar);
@@ -1260,10 +1472,10 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
globals_editor = memnew(SectionedPropertyEditor);
props_base->add_child(globals_editor);
globals_editor->get_property_editor()->set_undo_redo(EditorNode::get_singleton()->get_undo_redo());
+ globals_editor->get_property_editor()->set_property_selectable(true);
//globals_editor->hide_top_label();
globals_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- globals_editor->get_property_editor()->register_text_enter(search_box);
- globals_editor->get_property_editor()->set_capitalize_paths(false);
+ globals_editor->register_search_box(search_box);
globals_editor->get_property_editor()->get_scene_tree()->connect("cell_selected", this, "_item_selected");
globals_editor->get_property_editor()->connect("property_toggled", this, "_item_checked", varray(), CONNECT_DEFERRED);
globals_editor->get_property_editor()->connect("property_edited", this, "_settings_prop_edited");
@@ -1282,15 +1494,17 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
save->connect("pressed",this,"_save");
*/
- hbc = memnew(HBoxContainer);
- props_base->add_child(hbc);
+ Button *del = memnew(Button);
+ hbc->add_child(del);
+ del->set_text(TTR("Delete"));
+ del->connect("pressed", this, "_item_del");
- popup_platform = memnew(MenuButton);
- popup_platform->set_text(TTR("Copy To Platform.."));
- popup_platform->set_disabled(true);
- hbc->add_child(popup_platform);
+ add_prop_bar->add_child(memnew(VSeparator));
- hbc->add_spacer();
+ popup_copy_to_feature = memnew(MenuButton);
+ popup_copy_to_feature->set_text(TTR("Override For.."));
+ popup_copy_to_feature->set_disabled(true);
+ add_prop_bar->add_child(popup_copy_to_feature);
/*List<StringName> ep;
EditorImportExport::get_singleton()->get_export_platforms(&ep);
@@ -1298,11 +1512,13 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
for(List<StringName>::Element *E=ep.front();E;E=E->next()) {
- popup_platform->get_popup()->add_item( E->get() );
+ popup_copy_to_feature->get_popup()->add_item( E->get() );
}*/
- popup_platform->get_popup()->connect("id_pressed", this, "_copy_to_platform");
+ popup_copy_to_feature->get_popup()->connect("id_pressed", this, "_copy_to_platform");
+ popup_copy_to_feature->get_popup()->connect("about_to_show", this, "_copy_to_platform_about_to_show");
+
get_ok()->set_text(TTR("Close"));
set_hide_on_ok(true);
@@ -1318,14 +1534,14 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
VBoxContainer *vbc = memnew(VBoxContainer);
input_base->add_child(vbc);
- vbc->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 5);
- vbc->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 5);
- vbc->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5);
- vbc->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 5);
+ vbc->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 0);
+ vbc->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0);
+ vbc->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 0);
+ vbc->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0);
l = memnew(Label);
vbc->add_child(l);
- l->set_pos(Point2(6, 5));
+ l->set_position(Point2(6, 5) * EDSCALE);
l->set_text(TTR("Action:"));
hbc = memnew(HBoxContainer);
@@ -1338,7 +1554,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
add = memnew(Button);
hbc->add_child(add);
- add->set_custom_minimum_size(Size2(150, 0));
+ add->set_custom_minimum_size(Size2(150, 0) * EDSCALE);
add->set_text(TTR("Add"));
add->connect("pressed", this, "_action_add");
@@ -1346,6 +1562,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
vbc->add_child(input_editor);
input_editor->set_v_size_flags(SIZE_EXPAND_FILL);
input_editor->connect("item_edited", this, "_action_edited");
+ input_editor->connect("item_activated", this, "_action_activated");
input_editor->connect("cell_selected", this, "_action_selected");
input_editor->connect("button_pressed", this, "_action_button_pressed");
popup_add = memnew(PopupMenu);
@@ -1415,6 +1632,8 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
//translations
TabContainer *translations = memnew(TabContainer);
+ translations->add_style_override("panel", memnew(StyleBoxEmpty));
+ translations->set_tab_align(TabContainer::ALIGN_LEFT);
translations->set_name(TTR("Localization"));
tab_container->add_child(translations);
@@ -1430,7 +1649,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
Button *addtr = memnew(Button(TTR("Add..")));
addtr->connect("pressed", this, "_translation_file_open");
thb->add_child(addtr);
- MarginContainer *tmc = memnew(MarginContainer);
+ VBoxContainer *tmc = memnew(VBoxContainer);
tvb->add_child(tmc);
tmc->set_v_size_flags(SIZE_EXPAND_FILL);
translation_list = memnew(Tree);
@@ -1454,7 +1673,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
Button *addtr = memnew(Button(TTR("Add..")));
addtr->connect("pressed", this, "_translation_res_file_open");
thb->add_child(addtr);
- MarginContainer *tmc = memnew(MarginContainer);
+ VBoxContainer *tmc = memnew(VBoxContainer);
tvb->add_child(tmc);
tmc->set_v_size_flags(SIZE_EXPAND_FILL);
translation_remap = memnew(Tree);
@@ -1476,7 +1695,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
addtr->connect("pressed", this, "_translation_res_option_file_open");
translation_res_option_add_button = addtr;
thb->add_child(addtr);
- tmc = memnew(MarginContainer);
+ tmc = memnew(VBoxContainer);
tvb->add_child(tmc);
tmc->set_v_size_flags(SIZE_EXPAND_FILL);
translation_remap_options = memnew(Tree);
@@ -1515,7 +1734,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
timer = memnew(Timer);
timer->set_wait_time(1.5);
- timer->connect("timeout", GlobalConfig::get_singleton(), "save");
+ timer->connect("timeout", ProjectSettings::get_singleton(), "save");
timer->set_one_shot(true);
add_child(timer);
diff --git a/editor/project_settings.h b/editor/project_settings_editor.h
index 892198e00f..4390a23d60 100644
--- a/editor/project_settings.h
+++ b/editor/project_settings_editor.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -39,14 +40,22 @@
//#include "project_export_settings.h"
-class ProjectSettings : public AcceptDialog {
- GDCLASS(ProjectSettings, AcceptDialog);
+class ProjectSettingsEditor : public AcceptDialog {
+ GDCLASS(ProjectSettingsEditor, AcceptDialog);
+
+ enum InputType {
+ INPUT_KEY,
+ INPUT_JOY_BUTTON,
+ INPUT_JOY_MOTION,
+ INPUT_MOUSE_BUTTON
+ };
TabContainer *tab_container;
Timer *timer;
- InputEvent::Type add_type;
+ InputType add_type;
String add_at;
+ int edit_idx;
EditorData *data;
UndoRedo *undo_redo;
@@ -69,14 +78,14 @@ class ProjectSettings : public AcceptDialog {
SpinBox *device_id;
OptionButton *device_index;
Label *device_index_label;
- MenuButton *popup_platform;
+ MenuButton *popup_copy_to_feature;
LineEdit *action_name;
Tree *input_editor;
bool setting;
bool updating_translations;
- InputEvent last_wait_for_key;
+ Ref<InputEventKey> last_wait_for_key;
EditorFileDialog *translation_file_open;
Tree *translation_list;
@@ -97,7 +106,8 @@ class ProjectSettings : public AcceptDialog {
void _item_del();
void _update_actions();
void _save();
- void _add_item(int p_item);
+ void _add_item(int p_item, Ref<InputEvent> p_exiting_event = NULL);
+ void _edit_item(Ref<InputEvent> p_exiting_event);
void _action_adds(String);
void _action_add();
@@ -106,10 +116,11 @@ class ProjectSettings : public AcceptDialog {
void _item_checked(const String &p_item, bool p_check);
void _action_selected();
void _action_edited();
+ void _action_activated();
void _action_button_pressed(Object *p_obj, int p_column, int p_id);
- void _wait_for_key(const InputEvent &p_event);
+ void _wait_for_key(const Ref<InputEvent> &p_event);
void _press_a_key_confirm();
- void _show_last_added(const InputEvent &p_event, const String &p_name);
+ void _show_last_added(const Ref<InputEvent> &p_event, const String &p_name);
void _settings_prop_edited(const String &p_name);
void _settings_changed();
@@ -134,9 +145,11 @@ class ProjectSettings : public AcceptDialog {
void _toggle_search_bar(bool p_pressed);
void _clear_search_box();
- ProjectSettings();
+ void _copy_to_platform_about_to_show();
+
+ ProjectSettingsEditor();
- static ProjectSettings *singleton;
+ static ProjectSettingsEditor *singleton;
protected:
void _notification(int p_what);
@@ -144,13 +157,13 @@ protected:
public:
void add_translation(const String &p_translation);
- static ProjectSettings *get_singleton() { return singleton; }
+ static ProjectSettingsEditor *get_singleton() { return singleton; }
void popup_project_settings();
void set_plugins_page();
void queue_save();
- ProjectSettings(EditorData *p_data);
+ ProjectSettingsEditor(EditorData *p_data);
};
#endif // PROJECT_SETTINGS_H
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index cc26769939..2f47d3e130 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,8 +37,6 @@
#include "editor_help.h"
#include "editor_node.h"
#include "editor_settings.h"
-#include "global_config.h"
-#include "global_config.h"
#include "io/image_loader.h"
#include "io/resource_loader.h"
#include "multi_node_edit.h"
@@ -45,6 +44,7 @@
#include "os/keyboard.h"
#include "pair.h"
#include "print_string.h"
+#include "project_settings.h"
#include "property_selector.h"
#include "scene/gui/label.h"
#include "scene/main/viewport.h"
@@ -64,6 +64,9 @@ void CustomPropertyEditor::_notification(int p_what) {
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2( 10,10,60, get_size().height-20 ), v );
}*/
}
+ if (p_what == MainLoop::NOTIFICATION_WM_QUIT_REQUEST) {
+ hide();
+ }
}
void CustomPropertyEditor::_menu_option(int p_which) {
@@ -115,7 +118,6 @@ void CustomPropertyEditor::_menu_option(int p_which) {
Set<String> valid_extensions;
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
- print_line("found: " + E->get());
valid_extensions.insert(E->get());
}
@@ -318,12 +320,12 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
CheckBox *c = checks20[0];
c->set_text("True");
- checks20gc->set_pos(Vector2(4, 4));
+ checks20gc->set_position(Vector2(4, 4) * EDSCALE);
c->set_pressed(v);
c->show();
checks20gc->set_size(checks20gc->get_minimum_size());
- set_size(checks20gc->get_pos() + checks20gc->get_size() + Vector2(4, 4) * EDSCALE);
+ set_size(checks20gc->get_position() + checks20gc->get_size() + c->get_size() + Vector2(4, 4) * EDSCALE);
} break;
case Variant::INT:
@@ -373,7 +375,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
for (int i = 0; i < options.size(); i++) {
menu->add_item(options[i], i);
}
- menu->set_pos(get_pos());
+ menu->set_position(get_position());
menu->popup();
hide();
updating = false;
@@ -412,7 +414,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
int idx = i * 10 + j;
CheckBox *c = checks20[idx];
- c->set_text(GlobalConfig::get_singleton()->get(basename + "/layer_" + itos(idx + 1)));
+ c->set_text(ProjectSettings::get_singleton()->get(basename + "/layer_" + itos(idx + 1)));
c->set_pressed(flgs & (1 << (i * 10 + j)));
c->show();
}
@@ -422,23 +424,23 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
value_label[0]->set_text(title);
value_label[0]->show();
- value_label[0]->set_pos(Vector2(4, 4) * EDSCALE);
+ value_label[0]->set_position(Vector2(4, 4) * EDSCALE);
- checks20gc->set_pos(Vector2(4, 4) * EDSCALE + Vector2(0, value_label[0]->get_size().height + 4 * EDSCALE));
+ checks20gc->set_position(Vector2(4, 4) * EDSCALE + Vector2(0, value_label[0]->get_size().height + 4 * EDSCALE));
checks20gc->set_size(checks20gc->get_minimum_size());
- set_size(Vector2(4, 4) * EDSCALE + checks20gc->get_pos() + checks20gc->get_size());
+ set_size(Vector2(4, 4) * EDSCALE + checks20gc->get_position() + checks20gc->get_size());
} else if (hint == PROPERTY_HINT_EXP_EASING) {
- easing_draw->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5);
- easing_draw->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 5);
- easing_draw->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 5);
- easing_draw->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 30);
- type_button->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 3);
- type_button->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 3);
- type_button->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, 25);
- type_button->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 7);
+ easing_draw->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5 * EDSCALE);
+ easing_draw->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -5 * EDSCALE);
+ easing_draw->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 5 * EDSCALE);
+ easing_draw->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -30 * EDSCALE);
+ type_button->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 3 * EDSCALE);
+ type_button->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -3 * EDSCALE);
+ type_button->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, -25 * EDSCALE);
+ type_button->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -7 * EDSCALE);
type_button->set_text(TTR("Preset.."));
type_button->get_popup()->clear();
type_button->get_popup()->add_item(TTR("Linear"), EASING_LINEAR);
@@ -465,7 +467,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
if (f & (1 << i))
menu->set_item_checked(menu->get_item_index(i), true);
}
- menu->set_pos(get_pos());
+ menu->set_position(get_position());
menu->popup();
hide();
updating = false;
@@ -501,7 +503,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
for (int i = 0; i < options.size(); i++) {
menu->add_item(options[i], i);
}
- menu->set_pos(get_pos());
+ menu->set_position(get_position());
menu->popup();
hide();
updating = false;
@@ -521,8 +523,8 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
action_buttons[0]->set_anchor(MARGIN_TOP, ANCHOR_END);
action_buttons[0]->set_anchor(MARGIN_RIGHT, ANCHOR_END);
action_buttons[0]->set_anchor(MARGIN_BOTTOM, ANCHOR_END);
- action_buttons[0]->set_begin(Point2(70, button_margin - 5));
- action_buttons[0]->set_end(Point2(margin, margin));
+ action_buttons[0]->set_begin(Point2(-70 * EDSCALE, -button_margin + 5 * EDSCALE));
+ action_buttons[0]->set_end(Point2(-margin, -margin));
action_buttons[0]->set_text(TTR("Close"));
action_buttons[0]->show();
@@ -609,12 +611,9 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
type = Variant::Type(Variant::Type(i));
}
}
- InputEvent::Type iet = InputEvent::NONE;
- if (hint_text.find(".") != -1) {
- iet = InputEvent::Type(int(hint_text.get_slice(".", 1).to_int()));
- }
+
if (type)
- property_select->select_property_from_basic_type(type, iet, v);
+ property_select->select_property_from_basic_type(type, v);
updating = false;
return false;
@@ -681,8 +680,8 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
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));
+ value_editor[0]->set_text(String::num(r.position.x));
+ value_editor[1]->set_text(String::num(r.position.y));
value_editor[2]->set_text(String::num(r.size.x));
value_editor[3]->set_text(String::num(r.size.y));
} break;
@@ -736,9 +735,9 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
config_value_editors(6, 3, 16, field_names);
Rect3 aabb = v;
- value_editor[0]->set_text(String::num(aabb.pos.x));
- value_editor[1]->set_text(String::num(aabb.pos.y));
- value_editor[2]->set_text(String::num(aabb.pos.z));
+ value_editor[0]->set_text(String::num(aabb.position.x));
+ value_editor[1]->set_text(String::num(aabb.position.y));
+ value_editor[2]->set_text(String::num(aabb.position.z));
value_editor[3]->set_text(String::num(aabb.size.x));
value_editor[4]->set_text(String::num(aabb.size.y));
value_editor[5]->set_text(String::num(aabb.size.z));
@@ -815,16 +814,12 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
color_picker = memnew(ColorPicker);
add_child(color_picker);
color_picker->hide();
- color_picker->set_area_as_parent_rect();
- for (int i = 0; i < 4; i++)
- color_picker->set_margin((Margin)i, 5);
color_picker->connect("color_changed", this, "_color_changed");
}
color_picker->show();
color_picker->set_edit_alpha(hint != PROPERTY_HINT_COLOR_NO_ALPHA);
color_picker->set_pick_color(v);
- set_size(Size2(300 * EDSCALE, color_picker->get_combined_minimum_size().height + 10 * EDSCALE));
color_picker->set_focus_on_line_edit();
/*
int ofs=80;
@@ -837,15 +832,15 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
value_editor[i]->show();
value_label[i]->show();
- value_label[i]->set_pos(Point2(ofs,y));
+ value_label[i]->set_position(Point2(ofs,y));
scroll[i]->set_min(0);
scroll[i]->set_max(1.0);
scroll[i]->set_page(0);
- scroll[i]->set_pos(Point2(ofs+15,y+Math::floor((h-scroll[i]->get_minimum_size().height)/2.0)));
+ scroll[i]->set_position(Point2(ofs+15,y+Math::floor((h-scroll[i]->get_minimum_size().height)/2.0)));
scroll[i]->set_val(values[i]);
scroll[i]->set_size(Size2(120,1));
scroll[i]->show();
- value_editor[i]->set_pos(Point2(ofs+140,y));
+ value_editor[i]->set_position(Point2(ofs+140,y));
value_editor[i]->set_size(Size2(40,h));
value_editor[i]->set_text( String::num(values[i],2 ));
@@ -856,25 +851,21 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
value_label[2]->set_text("B");
value_label[3]->set_text("A");
- Size2 new_size = value_editor[3]->get_pos() + value_editor[3]->get_size() + Point2(10,10);
+ Size2 new_size = value_editor[3]->get_position() + value_editor[3]->get_size() + Point2(10,10);
set_size( new_size );
*/
} break;
- case Variant::IMAGE: {
-
- List<String> names;
- names.push_back(TTR("New"));
- names.push_back(TTR("Load"));
- names.push_back(TTR("Clear"));
- config_action_buttons(names);
- } break;
case Variant::NODE_PATH: {
List<String> names;
names.push_back(TTR("Assign"));
names.push_back(TTR("Clear"));
+
+ if (owner->is_class("Node") && (v.get_type() == Variant::NODE_PATH) && owner->cast_to<Node>()->has_node(v))
+ names.push_back(TTR("Select Node"));
+
config_action_buttons(names);
} break;
@@ -884,7 +875,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
break;
menu->clear();
- menu->set_size(Size2(1, 1));
+ menu->set_size(Size2(1, 1) * EDSCALE);
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);
@@ -933,7 +924,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
if (!RES(v).is_null()) {
- menu->add_icon_item(get_icon("EditResource", "EditorIcons"), "Edit", OBJ_MENU_EDIT);
+ menu->add_icon_item(get_icon("Edit", "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;
@@ -980,16 +971,13 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
}
}
- menu->set_pos(get_pos());
+ menu->set_position(get_position());
menu->popup();
hide();
updating = false;
return false;
} break;
- case Variant::INPUT_EVENT: {
-
- } break;
case Variant::DICTIONARY: {
} break;
@@ -1034,7 +1022,7 @@ void CustomPropertyEditor::_file_selected(String p_file) {
if (hint == PROPERTY_HINT_FILE || hint == PROPERTY_HINT_DIR) {
- v = GlobalConfig::get_singleton()->localize_path(p_file);
+ v = ProjectSettings::get_singleton()->localize_path(p_file);
emit_signal("variant_changed");
hide();
}
@@ -1061,16 +1049,6 @@ void CustomPropertyEditor::_file_selected(String p_file) {
emit_signal("variant_changed");
hide();
} break;
- case Variant::IMAGE: {
-
- Image image;
- Error err = ImageLoader::load_image(p_file, &image);
- ERR_EXPLAIN(TTR("Couldn't load image"));
- ERR_FAIL_COND(err);
- v = image;
- emit_signal("variant_changed");
- hide();
- } break;
default: {}
}
}
@@ -1295,7 +1273,18 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
v = NodePath();
emit_signal("variant_changed");
hide();
+ } else if (p_which == 2) {
+
+ if (owner->is_class("Node") && (v.get_type() == Variant::NODE_PATH) && owner->cast_to<Node>()->has_node(v)) {
+
+ Node *target_node = owner->cast_to<Node>()->get_node(v);
+ EditorNode::get_singleton()->get_editor_selection()->clear();
+ EditorNode::get_singleton()->get_scene_tree_dock()->set_selected(target_node);
+ }
+
+ hide();
}
+
} break;
case Variant::OBJECT: {
@@ -1387,36 +1376,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
}
} break;
- case Variant::IMAGE: {
-
- if (p_which == 0) {
- //new image too difficult
- ERR_PRINT("New Image Unimplemented");
-
- } else if (p_which == 1) {
- file->set_access(EditorFileDialog::ACCESS_RESOURCES);
- file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
- List<String> extensions;
- ImageLoader::get_recognized_extensions(&extensions);
-
- file->clear_filters();
-
- for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
-
- file->add_filter("*." + E->get() + " ; " + E->get().to_upper());
- }
-
- file->popup_centered_ratio();
-
- } else if (p_which == 2) {
-
- v = Image();
- emit_signal("variant_changed");
- hide();
- }
-
- } break;
default: {};
}
}
@@ -1448,11 +1408,13 @@ void CustomPropertyEditor::_scroll_modified(double p_value) {
*/
}
-void CustomPropertyEditor::_drag_easing(const InputEvent &p_ev) {
+void CustomPropertyEditor::_drag_easing(const Ref<InputEvent> &p_ev) {
+
+ Ref<InputEventMouseMotion> mm = p_ev;
- if (p_ev.type == InputEvent::MOUSE_MOTION && p_ev.mouse_motion.button_mask & BUTTON_MASK_LEFT) {
+ if (mm.is_valid() && mm->get_button_mask() & BUTTON_MASK_LEFT) {
- float rel = p_ev.mouse_motion.relative_x;
+ float rel = mm->get_relative().x;
if (rel == 0)
return;
@@ -1481,8 +1443,8 @@ void CustomPropertyEditor::_drag_easing(const InputEvent &p_ev) {
//emit_signal("variant_changed");
emit_signal("variant_changed");
}
- if (p_ev.type == InputEvent::MOUSE_BUTTON && p_ev.mouse_button.button_index == BUTTON_LEFT) {
- }
+ // if (p_ev.type == Ref<InputEvent>::MOUSE_BUTTON && p_ev->get_button_index() == BUTTON_LEFT) {
+ // }
}
void CustomPropertyEditor::_draw_easing() {
@@ -1590,13 +1552,13 @@ void CustomPropertyEditor::_modified(String p_string) {
Rect2 r2;
if (evaluator) {
- r2.pos.x = evaluator->eval(value_editor[0]->get_text());
- r2.pos.y = evaluator->eval(value_editor[1]->get_text());
+ r2.position.x = evaluator->eval(value_editor[0]->get_text());
+ r2.position.y = evaluator->eval(value_editor[1]->get_text());
r2.size.x = evaluator->eval(value_editor[2]->get_text());
r2.size.y = evaluator->eval(value_editor[3]->get_text());
} else {
- r2.pos.x = value_editor[0]->get_text().to_double();
- r2.pos.y = value_editor[1]->get_text().to_double();
+ r2.position.x = value_editor[0]->get_text().to_double();
+ r2.position.y = value_editor[1]->get_text().to_double();
r2.size.x = value_editor[2]->get_text().to_double();
r2.size.y = value_editor[3]->get_text().to_double();
}
@@ -1756,17 +1718,12 @@ void CustomPropertyEditor::_modified(String p_string) {
emit_signal("variant_changed");
*/
} break;
- case Variant::IMAGE: {
- } break;
case Variant::NODE_PATH: {
v = NodePath(value_editor[0]->get_text());
emit_signal("variant_changed");
} break;
- case Variant::INPUT_EVENT: {
-
- } break;
case Variant::DICTIONARY: {
} break;
@@ -1867,7 +1824,7 @@ void CustomPropertyEditor::config_action_buttons(const List<String> &p_strings)
if (i < p_strings.size()) {
action_buttons[i]->show();
action_buttons[i]->set_text(p_strings[i]);
- action_buttons[i]->set_pos(Point2(m, m + i * (h + m)));
+ action_buttons[i]->set_position(Point2(m, m + i * (h + m)));
action_buttons[i]->set_size(Size2(w - m * 2, h));
action_buttons[i]->set_flat(true);
} else {
@@ -1895,9 +1852,9 @@ void CustomPropertyEditor::config_value_editors(int p_amount, int p_columns, int
value_editor[i]->show();
value_label[i]->show();
value_label[i]->set_text(i < p_strings.size() ? p_strings[i] : String(""));
- value_editor[i]->set_pos(Point2(m + p_label_w + c * (w + m + p_label_w), m + r * (h + m)));
+ value_editor[i]->set_position(Point2(m + p_label_w + c * (w + m + p_label_w), m + r * (h + m)));
value_editor[i]->set_size(Size2(w, h));
- value_label[i]->set_pos(Point2(m + c * (w + m + p_label_w), m + r * (h + m)));
+ value_label[i]->set_position(Point2(m + c * (w + m + p_label_w), m + r * (h + m)));
value_editor[i]->set_editable(!read_only);
} else {
value_editor[i]->hide();
@@ -2014,11 +1971,6 @@ CustomPropertyEditor::CustomPropertyEditor() {
add_child(error);
//error->get_cancel()->hide();
- type_button = memnew(MenuButton);
- add_child(type_button);
- type_button->hide();
- type_button->get_popup()->connect("id_pressed", this, "_type_create_selected");
-
scene_tree = memnew(SceneTreeDialog);
add_child(scene_tree);
scene_tree->connect("selected", this, "_node_path_selected");
@@ -2036,6 +1988,11 @@ CustomPropertyEditor::CustomPropertyEditor() {
//easing_draw->emit_signal(SceneStringNames::get_singleton()->input_event,InputEvent());
easing_draw->set_default_cursor_shape(Control::CURSOR_MOVE);
+ type_button = memnew(MenuButton);
+ add_child(type_button);
+ type_button->hide();
+ type_button->get_popup()->connect("id_pressed", this, "_type_create_selected");
+
menu = memnew(PopupMenu);
add_child(menu);
menu->connect("id_pressed", this, "_menu_option");
@@ -2357,15 +2314,6 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String &p
//p_item->set_text(1,obj->get(p_name));
} break;
- case Variant::IMAGE: {
-
- Image img = obj->get(p_name);
- if (img.empty())
- p_item->set_text(1, "[Image (empty)]");
- else
- p_item->set_text(1, "[Image " + itos(img.get_width()) + "x" + itos(img.get_height()) + "-" + String(Image::get_format_name(img.get_format())) + "]");
-
- } break;
case Variant::NODE_PATH: {
p_item->set_text(1, obj->get(p_name));
@@ -2375,6 +2323,7 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String &p
if (obj->get(p_name).get_type() == Variant::NIL || obj->get(p_name).operator RefPtr().is_null()) {
p_item->set_text(1, "<null>");
p_item->set_icon(1, Ref<Texture>());
+ p_item->set_custom_as_button(1, false);
Dictionary d = p_item->get_metadata(0);
int hint = d.has("hint") ? d["hint"].operator int() : -1;
@@ -2384,9 +2333,14 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String &p
}
} else {
+ p_item->set_custom_as_button(1, true);
RES res = obj->get(p_name).operator RefPtr();
if (res->is_class("Texture")) {
int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width");
+ Vector2 size(res->call("get_width"), res->call("get_height"));
+ if (size.width < size.height) {
+ tw = MAX((size.width / size.height) * tw, 1);
+ }
p_item->set_icon_max_width(1, tw);
p_item->set_icon(1, res);
p_item->set_text(1, "");
@@ -2426,9 +2380,11 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String &p
}
}
- if (!res->is_class("Texture")) {
+ if (res->is_class("Script")) {
+ p_item->set_text(1, res->get_path().get_file());
+ } else if (!res->is_class("Texture")) {
//texture already previews via itself
- EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res, this, "_resource_preview_done", p_item->get_instance_ID());
+ EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res, this, "_resource_preview_done", p_item->get_instance_id());
}
}
@@ -2518,11 +2474,14 @@ bool PropertyEditor::_is_drop_valid(const Dictionary &p_drag_data, const Diction
String allowed_type = d["hint_text"];
+ print_line("allowed type " + allowed_type);
+
Dictionary drag_data = p_drag_data;
if (drag_data.has("type") && String(drag_data["type"]) == "resource") {
Ref<Resource> res = drag_data["resource"];
for (int i = 0; i < allowed_type.get_slice_count(","); i++) {
String at = allowed_type.get_slice(",", i).strip_edges();
+ print_line("RES vs " + at);
if (res.is_valid() && ClassDB::is_parent_class(res->get_class(), at)) {
return true;
}
@@ -2533,13 +2492,18 @@ bool PropertyEditor::_is_drop_valid(const Dictionary &p_drag_data, const Diction
Vector<String> files = drag_data["files"];
+ print_line("fileS: " + String(Variant(files)));
if (files.size() == 1) {
String file = files[0];
String ftype = EditorFileSystem::get_singleton()->get_file_type(file);
+
+ print_line("file: " + file);
+ print_line("type: " + ftype);
if (ftype != "") {
for (int i = 0; i < allowed_type.get_slice_count(","); i++) {
String at = allowed_type.get_slice(",", i).strip_edges();
+ print_line("FILE vs " + at);
if (ClassDB::is_parent_class(ftype, at)) {
return true;
}
@@ -2744,39 +2708,52 @@ void PropertyEditor::_notification(int p_what) {
changing = false;
}
+
+ if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+ update_tree();
+ }
}
-TreeItem *PropertyEditor::get_parent_node(String p_path, HashMap<String, TreeItem *> &item_paths, TreeItem *root) {
+TreeItem *PropertyEditor::get_parent_node(String p_path, HashMap<String, TreeItem *> &item_paths, TreeItem *root, TreeItem *category) {
TreeItem *item = NULL;
if (p_path == "") {
- item = root;
+ item = category ? category : root;
} else if (item_paths.has(p_path)) {
item = item_paths.get(p_path);
} else {
//printf("path %s parent path %s - item name %s\n",p_path.ascii().get_data(),p_path.left( p_path.find_last("/") ).ascii().get_data(),p_path.right( p_path.find_last("/") ).ascii().get_data() );
- TreeItem *parent = get_parent_node(p_path.left(p_path.find_last("/")), item_paths, root);
+ TreeItem *parent = get_parent_node(p_path.left(p_path.find_last("/")), item_paths, root, NULL);
item = tree->create_item(parent);
String name = (p_path.find("/") != -1) ? p_path.right(p_path.find_last("/") + 1) : p_path;
- if (capitalize_paths)
- item->set_text(0, name.capitalize());
- else
- item->set_text(0, name);
+ item->set_text(0, capitalize_paths ? name.capitalize() : name);
item->set_tooltip(0, p_path);
if (item->get_parent() != root) {
item->set_icon(0, get_icon("Folder", "EditorIcons"));
}
item->set_editable(0, false);
+ if (!subsection_selectable) {
+ item->set_expand_right(0, true);
+ }
item->set_selectable(0, subsection_selectable);
item->set_editable(1, false);
item->set_selectable(1, subsection_selectable);
+ if (use_folding) {
+ if (!obj->editor_is_section_unfolded(p_path)) {
+ updating_folding = true;
+ item->set_collapsed(true);
+ updating_folding = false;
+ }
+ item->set_metadata(0, p_path);
+ }
+
if (item->get_parent() == root) {
item->set_custom_bg_color(0, get_color("prop_subsection", "Editor"));
@@ -2988,17 +2965,21 @@ void PropertyEditor::update_tree() {
TreeItem *sep = tree->create_item(root);
current_category = sep;
String type = p.name;
- /*if (has_icon(type,"EditorIcons"))
- sep->set_icon(0,get_icon(type,"EditorIcons") );
+ //*
+ if (has_icon(type, "EditorIcons"))
+ sep->set_icon(0, get_icon(type, "EditorIcons"));
else
- sep->set_icon(0,get_icon("Object","EditorIcons") );
- print_line("CATEGORY: "+type);
- */
+ sep->set_icon(0, get_icon("Object", "EditorIcons"));
+
+ //*/
sep->set_text(0, type);
+ sep->set_expand_right(0, true);
sep->set_selectable(0, false);
sep->set_selectable(1, false);
sep->set_custom_bg_color(0, get_color("prop_category", "Editor"));
sep->set_custom_bg_color(1, get_color("prop_category", "Editor"));
+ sep->set_text_align(0, TreeItem::ALIGN_CENTER);
+ sep->set_disable_folding(true);
if (use_doc_hints) {
StringName type = p.name;
@@ -3029,6 +3010,8 @@ void PropertyEditor::update_tree() {
if (group_base != "") {
if (basename.begins_with(group_base)) {
basename = basename.replace_first(group_base, "");
+ } else if (group_base.begins_with(basename)) {
+ //keep it, this is used pretty often
} else {
group = ""; //no longer using group base, clear
}
@@ -3041,8 +3024,18 @@ void PropertyEditor::update_tree() {
String name = (basename.find("/") != -1) ? basename.right(basename.find_last("/") + 1) : basename;
- if (capitalize_paths)
- name = name.camelcase_to_underscore().capitalize();
+ if (capitalize_paths) {
+ int dot = name.find(".");
+ if (dot != -1) {
+ String ov = name.right(dot);
+ name = name.substr(0, dot);
+ name = name.camelcase_to_underscore().capitalize();
+ name += ov;
+
+ } else {
+ name = name.camelcase_to_underscore().capitalize();
+ }
+ }
String path = basename.left(basename.find_last("/"));
@@ -3058,7 +3051,7 @@ void PropertyEditor::update_tree() {
}
//printf("property %s\n",basename.ascii().get_data());
- TreeItem *parent = get_parent_node(path, item_path, current_category ? current_category : root);
+ TreeItem *parent = get_parent_node(path, item_path, root, current_category);
/*
if (parent->get_parent()==root)
parent=root;
@@ -3085,7 +3078,7 @@ void PropertyEditor::update_tree() {
//item->set_custom_bg_color(1,col);
}
item->set_editable(0, false);
- item->set_selectable(0, false);
+ item->set_selectable(0, property_selectable);
if (p.usage & PROPERTY_USAGE_CHECKABLE) {
@@ -3098,6 +3091,18 @@ void PropertyEditor::update_tree() {
item->set_text(0, name);
item->set_tooltip(0, p.name);
+ if (name.find(".") != -1) {
+ Color textcol = get_color("font_color", "Tree");
+ textcol.a *= 0.5;
+ //override :D
+ item->set_custom_color(0, textcol);
+ item->set_custom_color(1, textcol);
+
+ Color iconcol(1, 1, 1, 0.6);
+ item->set_icon_color(0, iconcol);
+ item->set_icon_color(1, iconcol);
+ }
+
if (use_doc_hints) {
StringName setter;
StringName type;
@@ -3399,6 +3404,13 @@ void PropertyEditor::update_tree() {
item->set_icon(0, get_icon("ArrayData", "EditorIcons"));
} break;
+ case Variant::DICTIONARY: {
+
+ item->set_cell_mode(1, TreeItem::CELL_MODE_STRING);
+ item->set_editable(1, false);
+ item->set_text(1, obj->get(p.name).operator String());
+
+ } break;
case Variant::POOL_INT_ARRAY: {
@@ -3578,19 +3590,7 @@ void PropertyEditor::update_tree() {
item->set_icon(0, get_icon("Color", "EditorIcons"));
} break;
- case Variant::IMAGE: {
- item->set_cell_mode(1, TreeItem::CELL_MODE_CUSTOM);
- item->set_editable(1, !read_only);
- Image img = obj->get(p.name);
- if (img.empty())
- item->set_text(1, "[Image (empty)]");
- else
- item->set_text(1, "[Image " + itos(img.get_width()) + "x" + itos(img.get_height()) + "-" + String(Image::get_format_name(img.get_format())) + "]");
- if (show_type_icons)
- item->set_icon(0, get_icon("Image", "EditorIcons"));
-
- } break;
case Variant::NODE_PATH: {
item->set_cell_mode(1, TreeItem::CELL_MODE_STRING);
@@ -3603,20 +3603,28 @@ void PropertyEditor::update_tree() {
item->set_cell_mode(1, TreeItem::CELL_MODE_CUSTOM);
item->set_editable(1, !read_only);
- item->add_button(1, get_icon("EditResource", "EditorIcons"));
+ //item->add_button(1, get_icon("EditResource", "EditorIcons"));
String type;
if (p.hint == PROPERTY_HINT_RESOURCE_TYPE)
type = p.hint_string;
- if (obj->get(p.name).get_type() == Variant::NIL || obj->get(p.name).operator RefPtr().is_null()) {
+ RES res = obj->get(p.name).operator RefPtr();
+
+ if (obj->get(p.name).get_type() == Variant::NIL || res.is_null()) {
item->set_text(1, "<null>");
item->set_icon(1, Ref<Texture>());
+ item->set_custom_as_button(1, false);
- } else {
- RES res = obj->get(p.name).operator RefPtr();
+ } else if (res.is_valid()) {
+
+ item->set_custom_as_button(1, true);
if (res->is_class("Texture")) {
int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width");
+ Vector2 size(res->call("get_width"), res->call("get_height"));
+ if (size.width < size.height) {
+ tw = MAX((size.width / size.height) * tw, 1);
+ }
item->set_icon_max_width(1, tw);
item->set_icon(1, res);
item->set_text(1, "");
@@ -3640,9 +3648,11 @@ void PropertyEditor::update_tree() {
} else if (res.is_valid()) {
item->set_tooltip(1, res->get_name() + " (" + res->get_class() + ")");
}
- if (!res->is_class("Texture")) {
+ if (res->is_class("Script")) {
+ item->set_text(1, res->get_path().get_file());
+ } else if (!res->is_class("Texture")) {
//texture already previews via itself
- EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res, this, "_resource_preview_done", item->get_instance_ID());
+ EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res, this, "_resource_preview_done", item->get_instance_id());
}
}
@@ -3725,13 +3735,23 @@ void PropertyEditor::_draw_transparency(Object *t, const Rect2 &p_rect) {
// make a little space between consecutive color fields
Rect2 area = p_rect;
- area.pos.y += 1;
+ area.position.y += 1;
area.size.height -= 2;
area.size.width -= arrow->get_size().width + 5;
tree->draw_texture_rect(get_icon("Transparent", "EditorIcons"), area, true);
tree->draw_rect(area, color);
}
+void PropertyEditor::_item_folded(Object *item_obj) {
+
+ if (updating_folding)
+ return;
+
+ TreeItem *item = item_obj->cast_to<TreeItem>();
+
+ obj->editor_set_section_unfold(item->get_metadata(0), !item->is_collapsed());
+}
+
void PropertyEditor::_item_selected() {
TreeItem *item = tree->get_selected();
@@ -3739,6 +3759,10 @@ void PropertyEditor::_item_selected() {
selected_property = item->get_metadata(1);
}
+void PropertyEditor::_item_rmb_edited() {
+ _custom_editor_request(true);
+}
+
void PropertyEditor::_edit_set(const String &p_name, const Variant &p_value, bool p_refresh_all, const String &p_changed_field) {
if (autoclear) {
@@ -3846,8 +3870,8 @@ void PropertyEditor::_item_edited() {
} break;
case Variant::BOOL: {
- _edit_set(name, item->is_checked(1), refresh_all);
item->set_tooltip(1, item->is_checked(1) ? "True" : "False");
+ _edit_set(name, item->is_checked(1), refresh_all);
} break;
case Variant::INT:
case Variant::REAL: {
@@ -3860,7 +3884,7 @@ void PropertyEditor::_item_edited() {
break;
if (type == Variant::INT)
- _edit_set(name, int(item->get_range(1)), refresh_all);
+ _edit_set(name, int64_t(round(item->get_range(1))), refresh_all);
else
_edit_set(name, item->get_range(1), refresh_all);
} break;
@@ -3906,17 +3930,22 @@ void PropertyEditor::_item_edited() {
case Variant::COLOR: {
//_edit_set(name,item->get_custom_bg_color(0));
} break;
- case Variant::IMAGE: {
- } break;
case Variant::NODE_PATH: {
_edit_set(name, NodePath(item->get_text(1)), refresh_all);
} break;
+ case Variant::OBJECT: {
+ if (!item->is_custom_set_as_button(1))
+ break;
- case Variant::INPUT_EVENT: {
+ RES res = obj->get(name);
+ if (res.is_valid()) {
+ emit_signal("resource_selected", res.get_ref_ptr(), name);
+ }
} break;
+
case Variant::DICTIONARY: {
} break;
@@ -3988,7 +4017,7 @@ void PropertyEditor::_custom_editor_request(bool p_arrow) {
int hint = d.has("hint") ? d["hint"].operator int() : -1;
String hint_text = d.has("hint_text") ? d["hint_text"] : "";
Rect2 where = tree->get_custom_popup_rect();
- custom_editor->set_pos(where.pos);
+ custom_editor->set_position(where.position);
if (custom_editor->edit(obj, name, type, v, hint, hint_text)) {
custom_editor->popup();
@@ -4095,9 +4124,9 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
Variant v = obj->get(n);
custom_editor->edit(obj, n, (Variant::Type)t, v, h, ht);
Rect2 where = tree->get_item_rect(ti, 1);
- where.pos -= tree->get_scroll();
- where.pos += tree->get_global_pos();
- custom_editor->set_pos(where.pos);
+ where.position -= tree->get_scroll();
+ where.position += tree->get_global_position();
+ custom_editor->set_position(where.position);
custom_editor->popup();
} else if (t == Variant::STRING) {
@@ -4108,9 +4137,9 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
if (h == PROPERTY_HINT_FILE || h == PROPERTY_HINT_DIR || h == PROPERTY_HINT_GLOBAL_DIR || h == PROPERTY_HINT_GLOBAL_FILE) {
Rect2 where = tree->get_item_rect(ti, 1);
- where.pos -= tree->get_scroll();
- where.pos += tree->get_global_pos();
- custom_editor->set_pos(where.pos);
+ where.position -= tree->get_scroll();
+ where.position += tree->get_global_position();
+ custom_editor->set_position(where.position);
custom_editor->popup();
} else {
custom_editor->popup_centered_ratio();
@@ -4162,9 +4191,9 @@ void PropertyEditor::set_keying(bool p_active) {
update_tree();
}
-void PropertyEditor::_draw_flags(Object *t, const Rect2 &p_rect) {
+void PropertyEditor::_draw_flags(Object *p_object, const Rect2 &p_rect) {
- TreeItem *ti = t->cast_to<TreeItem>();
+ TreeItem *ti = p_object->cast_to<TreeItem>();
if (!ti)
return;
@@ -4186,7 +4215,7 @@ void PropertyEditor::_draw_flags(Object *t, const Rect2 &p_rect) {
if (i == 1)
ofs.y += bsize + 1;
- ofs += p_rect.pos;
+ ofs += p_rect.position;
for (int j = 0; j < 10; j++) {
Point2 o = ofs + Point2(j * (bsize + 1), 0);
@@ -4230,6 +4259,8 @@ void PropertyEditor::_bind_methods() {
ClassDB::bind_method("_item_edited", &PropertyEditor::_item_edited);
ClassDB::bind_method("_item_selected", &PropertyEditor::_item_selected);
+ ClassDB::bind_method("_item_rmb_edited", &PropertyEditor::_item_rmb_edited);
+ ClassDB::bind_method("_item_folded", &PropertyEditor::_item_folded);
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(""));
@@ -4286,9 +4317,15 @@ String PropertyEditor::get_selected_path() const {
return "";
}
-void PropertyEditor::set_capitalize_paths(bool p_capitalize) {
+bool PropertyEditor::is_capitalize_paths_enabled() const {
+
+ return capitalize_paths;
+}
+
+void PropertyEditor::set_enable_capitalize_paths(bool p_capitalize) {
capitalize_paths = p_capitalize;
+ update_tree_pending = true;
}
void PropertyEditor::set_autoclear(bool p_enable) {
@@ -4320,6 +4357,11 @@ void PropertyEditor::register_text_enter(Node *p_line_edit) {
search_box->connect("text_changed", this, "_filter_changed");
}
+void PropertyEditor::set_property_selectable(bool p_selectable) {
+ property_selectable = p_selectable;
+ update_tree();
+}
+
void PropertyEditor::set_subsection_selectable(bool p_selectable) {
if (p_selectable == subsection_selectable)
@@ -4329,11 +4371,18 @@ void PropertyEditor::set_subsection_selectable(bool p_selectable) {
update_tree();
}
+void PropertyEditor::set_use_folding(bool p_enable) {
+
+ use_folding = p_enable;
+ tree->set_hide_folding(false);
+}
+
PropertyEditor::PropertyEditor() {
_prop_edited = "property_edited";
- hide_script = false;
+ hide_script = true;
+ use_folding = false;
undo_redo = NULL;
obj = NULL;
@@ -4365,7 +4414,9 @@ PropertyEditor::PropertyEditor() {
add_child(tree);
tree->connect("item_edited", this, "_item_edited", varray(), CONNECT_DEFERRED);
+ tree->connect("item_rmb_edited", this, "_item_rmb_edited");
tree->connect("cell_selected", this, "_item_selected");
+ tree->connect("item_collapsed", this, "_item_folded");
tree->set_drag_forwarding(this);
@@ -4388,14 +4439,17 @@ PropertyEditor::PropertyEditor() {
capitalize_paths = true;
autoclear = false;
tree->set_column_titles_visible(false);
+ tree->add_constant_override("button_margin", 0);
keying = false;
read_only = false;
show_categories = false;
refresh_countdown = 0;
use_doc_hints = false;
+ updating_folding = true;
use_filter = false;
subsection_selectable = false;
+ property_selectable = false;
show_type_icons = EDITOR_DEF("interface/show_type_icons", false);
}
@@ -4460,7 +4514,7 @@ class SectionedPropertyEditorFilter : public Object {
continue;
if (sp == -1) {
- pi.name = "Global/" + pi.name;
+ pi.name = "global/" + pi.name;
}
if (pi.name.begins_with(section + "/")) {
@@ -4510,6 +4564,7 @@ public:
void SectionedPropertyEditor::_bind_methods() {
ClassDB::bind_method("_section_selected", &SectionedPropertyEditor::_section_selected);
+ ClassDB::bind_method("_search_changed", &SectionedPropertyEditor::_search_changed);
ClassDB::bind_method("update_category_list", &SectionedPropertyEditor::update_category_list);
}
@@ -4559,7 +4614,7 @@ void SectionedPropertyEditor::edit(Object *p_object) {
return;
}
- ObjectID id = p_object->get_instance_ID();
+ ObjectID id = p_object->get_instance_id();
if (obj != id) {
@@ -4607,6 +4662,10 @@ void SectionedPropertyEditor::update_category_list() {
if (pi.name.find(":") != -1 || pi.name == "script" || pi.name == "resource_name" || pi.name == "resource_path")
continue;
+
+ if (search_box && search_box->get_text() != String() && pi.name.findn(search_box->get_text()) == -1)
+ continue;
+
int sp = pi.name.find("/");
if (sp == -1)
pi.name = "Global/" + pi.name;
@@ -4614,7 +4673,9 @@ void SectionedPropertyEditor::update_category_list() {
Vector<String> sectionarr = pi.name.split("/");
String metasection;
- for (int i = 0; i < MIN(2, sectionarr.size() - 1); i++) {
+ int sc = MIN(2, sectionarr.size() - 1);
+
+ for (int i = 0; i < sc; i++) {
TreeItem *parent = section_map[metasection];
@@ -4629,6 +4690,12 @@ void SectionedPropertyEditor::update_category_list() {
section_map[metasection] = ms;
ms->set_text(0, sectionarr[i].capitalize());
ms->set_metadata(0, metasection);
+ ms->set_selectable(0, false);
+ }
+
+ if (i == sc - 1) {
+ //if it has children, make selectable
+ section_map[metasection]->set_selectable(0, true);
}
}
}
@@ -4636,6 +4703,20 @@ void SectionedPropertyEditor::update_category_list() {
if (section_map.has(selected_category)) {
section_map[selected_category]->select(0);
}
+
+ editor->update_tree();
+}
+
+void SectionedPropertyEditor::register_search_box(LineEdit *p_box) {
+
+ search_box = p_box;
+ editor->register_text_enter(p_box);
+ search_box->connect("text_changed", this, "_search_changed");
+}
+
+void SectionedPropertyEditor::_search_changed(const String &p_what) {
+
+ update_category_list();
}
PropertyEditor *SectionedPropertyEditor::get_property_editor() {
@@ -4647,6 +4728,8 @@ SectionedPropertyEditor::SectionedPropertyEditor() {
obj = -1;
+ search_box = NULL;
+
VBoxContainer *left_vb = memnew(VBoxContainer);
left_vb->set_custom_minimum_size(Size2(160, 0) * EDSCALE);
add_child(left_vb);
@@ -4691,20 +4774,20 @@ double PropertyValueEvaluator::eval(const String &p_text) {
return _default_eval(p_text);
}
- ScriptInstance *script_instance = script->instance_create(this);
+ Object dummy;
+ ScriptInstance *script_instance = script->instance_create(&dummy);
if (!script_instance)
return _default_eval(p_text);
Variant::CallError call_err;
- script_instance->call("set_this", obj);
- double result = script_instance->call("e", NULL, 0, call_err);
+ Variant arg = obj;
+ const Variant *args[] = { &arg };
+ double result = script_instance->call("eval", args, 1, call_err);
if (call_err.error == Variant::CallError::CALL_OK) {
return result;
}
print_line("[PropertyValueEvaluator]: Error eval! Error code: " + itos(call_err.error));
- memdelete(script_instance);
-
return _default_eval(p_text);
}
@@ -4713,9 +4796,8 @@ void PropertyValueEvaluator::edit(Object *p_obj) {
}
String PropertyValueEvaluator::_build_script(const String &p_text) {
- String script_text = "tool\nvar this\nfunc set_this(p_this):\n\tthis=p_this\nfunc e():\n\treturn ";
- script_text += p_text.strip_edges();
- script_text += "\n";
+ String script_text =
+ "tool\nextends Object\nfunc eval(s):\n\tself = s\n\treturn " + p_text.strip_edges() + "\n";
return script_text;
}
diff --git a/editor/property_editor.h b/editor/property_editor.h
index f7f8d0e974..3dd09268ec 100644
--- a/editor/property_editor.h
+++ b/editor/property_editor.h
@@ -1,4 +1,4 @@
-/*************************************************************************/
+/*************************************************************************/
/* property_editor.h */
/*************************************************************************/
/* This file is part of: */
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -133,7 +134,7 @@ class CustomPropertyEditor : public Popup {
void _draw_easing();
void _menu_option(int p_which);
- void _drag_easing(const InputEvent &p_ev);
+ void _drag_easing(const Ref<InputEvent> &p_ev);
void _node_path_selected(NodePath p_path);
void show_value_editors(int p_amount);
@@ -189,6 +190,10 @@ class PropertyEditor : public Control {
bool use_filter;
bool subsection_selectable;
bool hide_script;
+ bool use_folding;
+ bool property_selectable;
+
+ bool updating_folding;
HashMap<String, String> pending;
String selected_property;
@@ -204,15 +209,16 @@ class PropertyEditor : public Control {
void _custom_editor_request(bool p_arrow);
void _item_selected();
+ void _item_rmb_edited();
void _item_edited();
- TreeItem *get_parent_node(String p_path, HashMap<String, TreeItem *> &item_paths, TreeItem *root);
+ TreeItem *get_parent_node(String p_path, HashMap<String, TreeItem *> &item_paths, TreeItem *root, TreeItem *category);
void set_item_text(TreeItem *p_item, int p_type, const String &p_name, int p_hint = PROPERTY_HINT_NONE, const String &p_hint_text = "");
TreeItem *find_item(TreeItem *p_item, const String &p_name);
- virtual void _changed_callback(Object *p_changed, const char *p_what);
- virtual void _changed_callbacks(Object *p_changed, const String &p_callback);
+ virtual void _changed_callback(Object *p_changed, const char *p_prop);
+ virtual void _changed_callbacks(Object *p_changed, const String &p_prop);
void _check_reload_status(const String &p_name, TreeItem *item);
@@ -222,7 +228,7 @@ class PropertyEditor : public Control {
friend class ProjectExportDialog;
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);
+ void _draw_flags(Object *p_object, const Rect2 &p_rect);
bool _might_be_in_instance();
bool _get_instanced_node_original_property(const StringName &p_prop, Variant &value);
@@ -243,6 +249,7 @@ class PropertyEditor : public Control {
void _resource_preview_done(const String &p_path, const Ref<Texture> &p_preview, Variant p_ud);
void _draw_transparency(Object *t, const Rect2 &p_rect);
+ void _item_folded(Object *item_obj);
UndoRedo *undo_redo;
@@ -271,7 +278,8 @@ public:
custom_editor->set_read_only(p_read_only);
}
- void set_capitalize_paths(bool p_capitalize);
+ bool is_capitalize_paths_enabled() const;
+ void set_enable_capitalize_paths(bool p_capitalize);
void set_autoclear(bool p_enable);
void set_show_categories(bool p_show);
@@ -282,7 +290,9 @@ public:
void register_text_enter(Node *p_line_edit);
void set_subsection_selectable(bool p_selectable);
+ void set_property_selectable(bool p_selectable);
+ void set_use_folding(bool p_enable);
PropertyEditor();
~PropertyEditor();
};
@@ -300,11 +310,15 @@ class SectionedPropertyEditor : public HBoxContainer {
Map<String, TreeItem *> section_map;
PropertyEditor *editor;
+ LineEdit *search_box;
static void _bind_methods();
void _section_selected();
+ void _search_changed(const String &p_what);
+
public:
+ void register_search_box(LineEdit *p_box);
PropertyEditor *get_property_editor();
void edit(Object *p_object);
String get_full_item_path(const String &p_item);
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index 34086ba905..bd68eac9f2 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,17 +37,19 @@ void PropertySelector::_text_changed(const String &p_newtext) {
_update_search();
}
-void PropertySelector::_sbox_input(const InputEvent &p_ie) {
+void PropertySelector::_sbox_input(const Ref<InputEvent> &p_ie) {
- if (p_ie.type == InputEvent::KEY) {
+ Ref<InputEventKey> k = p_ie;
- switch (p_ie.key.scancode) {
+ if (k.is_valid()) {
+
+ switch (k->get_scancode()) {
case KEY_UP:
case KEY_DOWN:
case KEY_PAGEUP:
case KEY_PAGEDOWN: {
- search_options->call("_gui_input", p_ie);
+ search_options->call("_gui_input", k);
search_box->accept_event();
TreeItem *root = search_options->get_root();
@@ -88,14 +91,8 @@ void PropertySelector::_update_search() {
instance->get_property_list(&props, true);
} else if (type != Variant::NIL) {
Variant v;
- if (type == Variant::INPUT_EVENT) {
- InputEvent ie;
- ie.type = event_type;
- v = ie;
- } else {
- Variant::CallError ce;
- v = Variant::construct(type, NULL, 0, ce);
- }
+ Variant::CallError ce;
+ v = Variant::construct(type, NULL, 0, ce);
v.get_property_list(&props);
} else {
@@ -135,11 +132,9 @@ void PropertySelector::_update_search() {
Control::get_icon("MiniMatrix3", "EditorIcons"),
Control::get_icon("MiniTransform", "EditorIcons"),
Control::get_icon("MiniColor", "EditorIcons"),
- Control::get_icon("MiniImage", "EditorIcons"),
Control::get_icon("MiniPath", "EditorIcons"),
Control::get_icon("MiniRid", "EditorIcons"),
Control::get_icon("MiniObject", "EditorIcons"),
- Control::get_icon("MiniInput", "EditorIcons"),
Control::get_icon("MiniDictionary", "EditorIcons"),
Control::get_icon("MiniArray", "EditorIcons"),
Control::get_icon("MiniRawArray", "EditorIcons"),
@@ -172,7 +167,7 @@ void PropertySelector::_update_search() {
continue;
}
- if (!(E->get().usage & PROPERTY_USAGE_EDITOR))
+ if (!(E->get().usage & PROPERTY_USAGE_EDITOR) && !(E->get().usage & PROPERTY_USAGE_SCRIPT_VARIABLE))
continue;
if (search_box->get_text() != String() && E->get().name.find(search_box->get_text()) == -1)
@@ -325,22 +320,7 @@ void PropertySelector::_item_selected() {
String name = item->get_metadata(0);
String class_type;
- if (properties && type == Variant::INPUT_EVENT) {
-
- switch (event_type) {
- case InputEvent::NONE: class_type = "InputEvent"; break;
- case InputEvent::KEY: class_type = "InputEventKey"; break;
- case InputEvent::MOUSE_MOTION: class_type = "InputEventMouseMotion"; break;
- case InputEvent::MOUSE_BUTTON: class_type = "InputEventMouseButton"; break;
- case InputEvent::JOYPAD_MOTION: class_type = "InputEventJoypadMotion"; break;
- case InputEvent::JOYPAD_BUTTON: class_type = "InputEventJoypadButton"; break;
- case InputEvent::SCREEN_TOUCH: class_type = "InputEventScreenTouch"; break;
- case InputEvent::SCREEN_DRAG: class_type = "InputEventScreenDrag"; break;
- case InputEvent::ACTION: class_type = "InputEventAction"; break;
- default: {}
- }
-
- } else if (type) {
+ if (type) {
class_type = Variant::get_type_name(type);
} else {
@@ -438,7 +418,7 @@ void PropertySelector::select_method_from_script(const Ref<Script> &p_script, co
base_type = p_script->get_instance_base_type();
selected = p_current;
type = Variant::NIL;
- script = p_script->get_instance_ID();
+ script = p_script->get_instance_id();
properties = false;
instance = NULL;
@@ -472,7 +452,7 @@ void PropertySelector::select_method_from_instance(Object *p_instance, const Str
{
Ref<Script> scr = p_instance->get_script();
if (scr.is_valid())
- script = scr->get_instance_ID();
+ script = scr->get_instance_id();
}
properties = false;
instance = NULL;
@@ -505,7 +485,7 @@ void PropertySelector::select_property_from_script(const Ref<Script> &p_script,
base_type = p_script->get_instance_base_type();
selected = p_current;
type = Variant::NIL;
- script = p_script->get_instance_ID();
+ script = p_script->get_instance_id();
properties = true;
instance = NULL;
@@ -514,13 +494,12 @@ void PropertySelector::select_property_from_script(const Ref<Script> &p_script,
search_box->grab_focus();
_update_search();
}
-void PropertySelector::select_property_from_basic_type(Variant::Type p_type, InputEvent::Type p_event_type, const String &p_current) {
+void PropertySelector::select_property_from_basic_type(Variant::Type p_type, const String &p_current) {
ERR_FAIL_COND(p_type == Variant::NIL);
base_type = "";
selected = p_current;
type = p_type;
- event_type = p_event_type;
script = 0;
properties = true;
instance = NULL;
diff --git a/editor/property_selector.h b/editor/property_selector.h
index c6903ee680..def791a3fd 100644
--- a/editor/property_selector.h
+++ b/editor/property_selector.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,7 +42,7 @@ class PropertySelector : public ConfirmationDialog {
void _update_search();
- void _sbox_input(const InputEvent &p_ie);
+ void _sbox_input(const Ref<InputEvent> &p_ie);
void _confirmed();
void _text_changed(const String &p_newtext);
@@ -51,7 +52,6 @@ class PropertySelector : public ConfirmationDialog {
bool properties;
String selected;
Variant::Type type;
- InputEvent::Type event_type;
String base_type;
ObjectID script;
Object *instance;
@@ -70,7 +70,7 @@ public:
void select_property_from_base_type(const String &p_base, const String &p_current = "");
void select_property_from_script(const Ref<Script> &p_script, const String &p_current = "");
- void select_property_from_basic_type(Variant::Type p_type, InputEvent::Type p_event_type, const String &p_current = "");
+ void select_property_from_basic_type(Variant::Type p_type, const String &p_current = "");
void select_property_from_instance(Object *p_instance, const String &p_current = "");
PropertySelector();
diff --git a/editor/pvrtc_compress.cpp b/editor/pvrtc_compress.cpp
index 4b4e74cd62..ef875bbead 100644
--- a/editor/pvrtc_compress.cpp
+++ b/editor/pvrtc_compress.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -88,7 +89,7 @@ static void _compress_image(Image::CompressMode p_mode, Image *p_image) {
args.push_back("-m");
Ref<ImageTexture> t = memnew(ImageTexture);
- t->create_from_image(*p_image, 0);
+ t->create_from_image(Ref<Image>(p_image), 0);
ResourceSaver::save(src_img, t);
Error err = OS::get_singleton()->execute(ttpath, args, true);
@@ -100,7 +101,7 @@ static void _compress_image(Image::CompressMode p_mode, Image *p_image) {
ERR_EXPLAIN(TTR("Can't load back converted image using PVRTC tool:") + " " + dst_img);
ERR_FAIL_COND(t.is_null());
- *p_image = t->get_data();
+ p_image->copy_internals_from(t->get_data());
}
static void _compress_pvrtc2(Image *p_image) {
diff --git a/editor/pvrtc_compress.h b/editor/pvrtc_compress.h
index 3699a731a0..2bb6d57050 100644
--- a/editor/pvrtc_compress.h
+++ b/editor/pvrtc_compress.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp
index bc6b0ad9f3..7fb9666afb 100644
--- a/editor/quick_open.cpp
+++ b/editor/quick_open.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -76,17 +77,18 @@ void EditorQuickOpen::_text_changed(const String &p_newtext) {
_update_search();
}
-void EditorQuickOpen::_sbox_input(const InputEvent &p_ie) {
+void EditorQuickOpen::_sbox_input(const Ref<InputEvent> &p_ie) {
- if (p_ie.type == InputEvent::KEY) {
+ Ref<InputEventKey> k = p_ie;
+ if (k.is_valid()) {
- switch (p_ie.key.scancode) {
+ switch (k->get_scancode()) {
case KEY_UP:
case KEY_DOWN:
case KEY_PAGEUP:
case KEY_PAGEDOWN: {
- search_options->call("_gui_input", p_ie);
+ search_options->call("_gui_input", k);
search_box->accept_event();
TreeItem *root = search_options->get_root();
diff --git a/editor/quick_open.h b/editor/quick_open.h
index bcb0842c49..44f8c025e6 100644
--- a/editor/quick_open.h
+++ b/editor/quick_open.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -46,7 +47,7 @@ class EditorQuickOpen : public ConfirmationDialog {
void _update_search();
- void _sbox_input(const InputEvent &p_ie);
+ void _sbox_input(const Ref<InputEvent> &p_ie);
void _parse_fs(EditorFileSystemDirectory *efsd, Vector<Pair<String, Ref<Texture> > > &list);
float _path_cmp(String search, String path) const;
diff --git a/editor/register_exporters.h b/editor/register_exporters.h
index d6afd1459a..72f8acb89c 100644
--- a/editor/register_exporters.h
+++ b/editor/register_exporters.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/reparent_dialog.cpp b/editor/reparent_dialog.cpp
index 3305c1642a..acc511e004 100644
--- a/editor/reparent_dialog.cpp
+++ b/editor/reparent_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -94,7 +95,7 @@ ReparentDialog::ReparentDialog() {
tree->get_scene_tree()->connect("item_activated", this, "_reparent");
//Label *label = memnew( Label );
- //label->set_pos( Point2( 15,8) );
+ //label->set_position( Point2( 15,8) );
//label->set_text("Reparent Location (Select new Parent):");
keep_transform = memnew(CheckBox);
diff --git a/editor/reparent_dialog.h b/editor/reparent_dialog.h
index c66963e298..b7a3164f4b 100644
--- a/editor/reparent_dialog.h
+++ b/editor/reparent_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/resources_dock.cpp b/editor/resources_dock.cpp
index c5f141562a..db3bf6a352 100644
--- a/editor/resources_dock.cpp
+++ b/editor/resources_dock.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,10 +32,10 @@
#include "editor_file_system.h"
#include "editor_node.h"
#include "editor_settings.h"
-#include "global_config.h"
#include "io/resource_loader.h"
#include "io/resource_saver.h"
#include "project_settings.h"
+#include "project_settings_editor.h"
void ResourcesDock::_tool_selected(int p_tool) {
@@ -123,7 +124,7 @@ void ResourcesDock::save_resource(const String &p_path, const Ref<Resource> &p_r
flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
*/
- String path = GlobalConfig::get_singleton()->localize_path(p_path);
+ String path = ProjectSettings::get_singleton()->localize_path(p_path);
Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS);
if (err != OK) {
@@ -203,7 +204,7 @@ void ResourcesDock::_update_name(TreeItem *item) {
else if (res->get_path() != "" && res->get_path().find("::") == -1)
item->set_text(0, res->get_path().get_file());
else
- item->set_text(0, res->get_class() + " (" + itos(res->get_instance_ID()) + ")");
+ item->set_text(0, res->get_class() + " (" + itos(res->get_instance_id()) + ")");
}
void ResourcesDock::remove_resource(const Ref<Resource> &p_resource) {
diff --git a/editor/resources_dock.h b/editor/resources_dock.h
index 15437f981f..e5470b1a3c 100644
--- a/editor/resources_dock.h
+++ b/editor/resources_dock.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -72,7 +73,7 @@ class ResourcesDock : public VBoxContainer {
bool block_add;
int current_action;
- void _file_action(const String &p_action);
+ void _file_action(const String &p_path);
void _delete(Object *p_item, int p_column, int p_id);
void _resource_selected();
diff --git a/editor/run_settings_dialog.cpp b/editor/run_settings_dialog.cpp
index 35cbb6c410..4548ae0939 100644
--- a/editor/run_settings_dialog.cpp
+++ b/editor/run_settings_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/run_settings_dialog.h b/editor/run_settings_dialog.h
index 98d0368344..b1b4240bf2 100644
--- a/editor/run_settings_dialog.h
+++ b/editor/run_settings_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 1c6c195719..ce3b85332f 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,9 +37,9 @@
#include "editor/plugins/spatial_editor_plugin.h"
#include "editor_node.h"
#include "editor_settings.h"
-#include "global_config.h"
#include "multi_node_edit.h"
#include "os/keyboard.h"
+#include "project_settings.h"
#include "scene/main/viewport.h"
#include "scene/resources/packed_scene.h"
#include "script_editor_debugger.h"
@@ -51,19 +52,21 @@ void SceneTreeDock::_nodes_drag_begin() {
}
}
-void SceneTreeDock::_input(InputEvent p_event) {
+void SceneTreeDock::_input(Ref<InputEvent> p_event) {
- if (p_event.type == InputEvent::MOUSE_BUTTON && !p_event.mouse_button.pressed && p_event.mouse_button.button_index == BUTTON_LEFT) {
+ Ref<InputEventMouseButton> mb = p_event;
+
+ if (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
restore_script_editor_on_drag = false; //lost chance
}
}
-void SceneTreeDock::_unhandled_key_input(InputEvent p_event) {
+void SceneTreeDock::_unhandled_key_input(Ref<InputEvent> p_event) {
if (get_viewport()->get_modal_stack_top())
return; //ignore because of modal window
- if (!p_event.key.pressed || p_event.key.echo)
+ if (!p_event->is_pressed() || p_event->is_echo())
return;
if (ED_IS_SHORTCUT("scene_tree/add_child_node", p_event)) {
@@ -180,7 +183,7 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node
}
}
- instanced_scene->set_filename(GlobalConfig::get_singleton()->localize_path(p_files[i]));
+ instanced_scene->set_filename(ProjectSettings::get_singleton()->localize_path(p_files[i]));
instances.push_back(instanced_scene);
}
@@ -361,8 +364,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
else {
String path = selected->get_filename();
script_create_dialog->config(selected->get_class(), path);
- script_create_dialog->popup_centered(Size2(300, 290));
- //script_create_dialog->popup_centered_minsize();
+ script_create_dialog->popup_centered();
}
} break;
@@ -656,6 +658,110 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
}
}
} break;
+ case TOOL_SCENE_EDITABLE_CHILDREN: {
+ List<Node *> selection = editor_selection->get_selected_node_list();
+ if (List<Node *>::Element *e = selection.front()) {
+ if (Node *node = e->get()) {
+ bool editable = EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(node);
+ int editable_item_idx = menu->get_item_idx_from_text(TTR("Editable Children"));
+ int placeholder_item_idx = menu->get_item_idx_from_text(TTR("Load As Placeholder"));
+ editable = !editable;
+
+ EditorNode::get_singleton()->get_edited_scene()->set_editable_instance(node, editable);
+
+ menu->set_item_checked(editable_item_idx, editable);
+ if (editable) {
+ node->set_scene_instance_load_placeholder(false);
+ menu->set_item_checked(placeholder_item_idx, false);
+ }
+ scene_tree->update_tree();
+ }
+ }
+ } break;
+ case TOOL_SCENE_USE_PLACEHOLDER: {
+ List<Node *> selection = editor_selection->get_selected_node_list();
+ if (List<Node *>::Element *e = selection.front()) {
+ if (Node *node = e->get()) {
+ bool placeholder = node->get_scene_instance_load_placeholder();
+ placeholder = !placeholder;
+ int editable_item_idx = menu->get_item_idx_from_text(TTR("Editable Children"));
+ int placeholder_item_idx = menu->get_item_idx_from_text(TTR("Load As Placeholder"));
+ if (placeholder)
+ EditorNode::get_singleton()->get_edited_scene()->set_editable_instance(node, false);
+
+ node->set_scene_instance_load_placeholder(placeholder);
+ menu->set_item_checked(editable_item_idx, false);
+ menu->set_item_checked(placeholder_item_idx, placeholder);
+ scene_tree->update_tree();
+ }
+ }
+ } break;
+ case TOOL_SCENE_CLEAR_INSTANCING: {
+ List<Node *> selection = editor_selection->get_selected_node_list();
+ if (List<Node *>::Element *e = selection.front()) {
+ if (Node *node = e->get()) {
+ Node *root = EditorNode::get_singleton()->get_edited_scene();
+ UndoRedo *undo_redo = &editor_data->get_undo_redo();
+ if (!root)
+ break;
+
+ ERR_FAIL_COND(node->get_filename() == String());
+
+ undo_redo->create_action("Discard Instancing");
+ undo_redo->add_do_method(node, "set_filename", "");
+ undo_redo->add_undo_method(node, "set_filename", node->get_filename());
+ _node_replace_owner(node, node, root);
+ undo_redo->add_do_method(scene_tree, "update_tree");
+ undo_redo->add_undo_method(scene_tree, "update_tree");
+ undo_redo->commit_action();
+ }
+ }
+ } break;
+ case TOOL_SCENE_OPEN: {
+ List<Node *> selection = editor_selection->get_selected_node_list();
+ if (List<Node *>::Element *e = selection.front()) {
+ if (Node *node = e->get()) {
+ scene_tree->emit_signal("open", node->get_filename());
+ }
+ }
+ } break;
+ case TOOL_SCENE_CLEAR_INHERITANCE: {
+ clear_inherit_confirm->popup_centered_minsize();
+ } break;
+ case TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM: {
+ List<Node *> selection = editor_selection->get_selected_node_list();
+ if (List<Node *>::Element *e = selection.front()) {
+ if (Node *node = e->get()) {
+ node->set_scene_inherited_state(Ref<SceneState>());
+ scene_tree->update_tree();
+ EditorNode::get_singleton()->get_property_editor()->update_tree();
+ }
+ }
+ } break;
+ case TOOL_SCENE_OPEN_INHERITED: {
+ List<Node *> selection = editor_selection->get_selected_node_list();
+ if (List<Node *>::Element *e = selection.front()) {
+ if (Node *node = e->get()) {
+ if (node && node->get_scene_inherited_state().is_valid()) {
+ scene_tree->emit_signal("open", node->get_scene_inherited_state()->get_path());
+ }
+ }
+ }
+ } break;
+ default: {
+
+ if (p_tool >= EDIT_SUBRESOURCE_BASE) {
+
+ int idx = p_tool - EDIT_SUBRESOURCE_BASE;
+
+ ERR_FAIL_INDEX(idx, subresources.size());
+
+ Object *obj = ObjectDB::get_instance(subresources[idx]);
+ ERR_FAIL_COND(!obj);
+
+ editor->push_item(obj);
+ }
+ }
}
}
@@ -680,11 +786,34 @@ void SceneTreeDock::_notification(int p_what) {
button_create_script->set_icon(get_icon("ScriptCreate", "EditorIcons"));
button_clear_script->set_icon(get_icon("ScriptRemove", "EditorIcons"));
- filter_icon->set_texture(get_icon("Zoom", "EditorIcons"));
+ filter->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
EditorNode::get_singleton()->get_editor_selection()->connect("selection_changed", this, "_selection_changed");
} break;
+
+ case NOTIFICATION_ENTER_TREE: {
+ clear_inherit_confirm->connect("confirmed", this, "_tool_selected", varray(TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM));
+ } break;
+
+ case NOTIFICATION_EXIT_TREE: {
+ clear_inherit_confirm->disconnect("confirmed", this, "_tool_selected");
+ } break;
+ }
+}
+
+void SceneTreeDock::_node_replace_owner(Node *p_base, Node *p_node, Node *p_root) {
+
+ if (p_base != p_node) {
+ if (p_node->get_owner() == p_base) {
+ UndoRedo *undo_redo = &editor_data->get_undo_redo();
+ undo_redo->add_do_method(p_node, "set_owner", p_root);
+ undo_redo->add_undo_method(p_node, "set_owner", p_base);
+ }
+ }
+
+ for (int i = 0; i < p_node->get_child_count(); i++) {
+ _node_replace_owner(p_base, p_node->get_child(i), p_root);
}
}
@@ -1111,7 +1240,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V
if (node->cast_to<Spatial>())
editor_data->get_undo_redo().add_do_method(node, "set_global_transform", node->cast_to<Spatial>()->get_global_transform());
if (node->cast_to<Control>())
- editor_data->get_undo_redo().add_do_method(node, "set_global_pos", node->cast_to<Control>()->get_global_pos());
+ editor_data->get_undo_redo().add_do_method(node, "set_global_position", node->cast_to<Control>()->get_global_position());
}
editor_data->get_undo_redo().add_do_method(this, "_set_owners", edited_scene, owners);
@@ -1153,7 +1282,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V
if (node->cast_to<Spatial>())
editor_data->get_undo_redo().add_undo_method(node, "set_transform", node->cast_to<Spatial>()->get_transform());
if (node->cast_to<Control>())
- editor_data->get_undo_redo().add_undo_method(node, "set_pos", node->cast_to<Control>()->get_pos());
+ editor_data->get_undo_redo().add_undo_method(node, "set_position", node->cast_to<Control>()->get_position());
}
}
@@ -1240,8 +1369,8 @@ void SceneTreeDock::_delete_confirm() {
editor_data->get_undo_redo().add_undo_reference(n);
ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger();
- editor_data->get_undo_redo().add_do_method(sed, "live_debug_remove_and_keep_node", edited_scene->get_path_to(n), n->get_instance_ID());
- editor_data->get_undo_redo().add_undo_method(sed, "live_debug_restore_node", n->get_instance_ID(), edited_scene->get_path_to(n->get_parent()), n->get_index());
+ editor_data->get_undo_redo().add_do_method(sed, "live_debug_remove_and_keep_node", edited_scene->get_path_to(n), n->get_instance_id());
+ editor_data->get_undo_redo().add_undo_method(sed, "live_debug_restore_node", n->get_instance_id(), edited_scene->get_path_to(n->get_parent()), n->get_index());
}
}
editor_data->get_undo_redo().commit_action();
@@ -1660,6 +1789,47 @@ void SceneTreeDock::_nodes_dragged(Array p_nodes, NodePath p_to, int p_type) {
_do_reparent(to_node, to_pos, nodes, true);
}
+void SceneTreeDock::_add_children_to_popup(Object *p_obj, int p_depth) {
+
+ if (p_depth > 8)
+ return;
+
+ List<PropertyInfo> pinfo;
+ p_obj->get_property_list(&pinfo);
+ for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
+
+ if (!(E->get().usage & PROPERTY_USAGE_EDITOR))
+ continue;
+ if (E->get().hint != PROPERTY_HINT_RESOURCE_TYPE)
+ continue;
+
+ Variant value = p_obj->get(E->get().name);
+ if (value.get_type() != Variant::OBJECT)
+ continue;
+ Object *obj = value;
+ if (!obj)
+ continue;
+
+ Ref<Texture> icon;
+
+ if (has_icon(obj->get_class(), "EditorIcons"))
+ icon = get_icon(obj->get_class(), "EditorIcons");
+ else
+ icon = get_icon("Object", "EditorIcons");
+
+ if (menu->get_item_count() == 0) {
+ menu->add_item(TTR("Sub-Resources:"));
+ menu->set_item_disabled(0, true);
+ }
+ int index = menu->get_item_count();
+ menu->add_icon_item(icon, E->get().name.capitalize(), EDIT_SUBRESOURCE_BASE + subresources.size());
+ menu->set_item_h_offset(index, p_depth * 10 * EDSCALE);
+ subresources.push_back(obj->get_instance_id());
+
+ _add_children_to_popup(obj, p_depth + 1);
+ }
+}
+
void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
if (!EditorNode::get_singleton()->get_edited_scene()) {
@@ -1668,7 +1838,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
menu->add_icon_shortcut(get_icon("Instance", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/instance_scene"), TOOL_INSTANCE);
menu->set_size(Size2(1, 1));
- menu->set_pos(p_menu_pos);
+ menu->set_position(p_menu_pos);
menu->popup();
return;
}
@@ -1681,6 +1851,12 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
menu->clear();
if (selection.size() == 1) {
+
+ subresources.clear();
+ _add_children_to_popup(selection.front()->get(), 0);
+ if (menu->get_item_count() > 0)
+ menu->add_separator();
+
menu->add_icon_shortcut(get_icon("Add", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/add_child_node"), TOOL_NEW);
menu->add_icon_shortcut(get_icon("Instance", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/instance_scene"), TOOL_INSTANCE);
menu->add_separator();
@@ -1705,11 +1881,31 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
menu->add_icon_shortcut(get_icon("CreateNewSceneFrom", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/save_branch_as_scene"), TOOL_NEW_SCENE_FROM);
menu->add_separator();
menu->add_icon_shortcut(get_icon("CopyNodePath", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/copy_node_path"), TOOL_COPY_NODE_PATH);
+ bool is_external = (selection[0]->get_filename() != "");
+ if (is_external) {
+ bool is_inherited = selection[0]->get_scene_inherited_state() != NULL;
+ bool is_top_level = selection[0]->get_owner() == NULL;
+ if (is_inherited && is_top_level) {
+ menu->add_separator();
+ menu->add_item(TTR("Clear Inheritance"), TOOL_SCENE_CLEAR_INHERITANCE);
+ menu->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open in Editor"), TOOL_SCENE_OPEN_INHERITED);
+ } else if (!is_top_level) {
+ menu->add_separator();
+ bool editable = EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(selection[0]);
+ bool placeholder = selection[0]->get_scene_instance_load_placeholder();
+ menu->add_check_item(TTR("Editable Children"), TOOL_SCENE_EDITABLE_CHILDREN);
+ menu->add_check_item(TTR("Load As Placeholder"), TOOL_SCENE_USE_PLACEHOLDER);
+ menu->add_item(TTR("Discard Instancing"), TOOL_SCENE_CLEAR_INSTANCING);
+ menu->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open in Editor"), TOOL_SCENE_OPEN);
+ menu->set_item_checked(menu->get_item_idx_from_text(TTR("Editable Children")), editable);
+ menu->set_item_checked(menu->get_item_idx_from_text(TTR("Load As Placeholder")), placeholder);
+ }
+ }
}
menu->add_separator();
menu->add_icon_shortcut(get_icon("Remove", "EditorIcons"), ED_SHORTCUT("scene_tree/delete", TTR("Delete Node(s)"), KEY_DELETE), TOOL_ERASE);
menu->set_size(Size2(1, 1));
- menu->set_pos(p_menu_pos);
+ menu->set_position(p_menu_pos);
menu->popup();
}
@@ -1790,6 +1986,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
VBoxContainer *vbc = this;
HBoxContainer *filter_hbc = memnew(HBoxContainer);
+ filter_hbc->add_constant_override("separate", 0);
ToolButton *tb;
ED_SHORTCUT("scene_tree/add_child_node", TTR("Add Child Node"), KEY_MASK_CMD | KEY_A);
@@ -1824,10 +2021,8 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
vbc->add_child(filter_hbc);
filter = memnew(LineEdit);
filter->set_h_size_flags(SIZE_EXPAND_FILL);
+ filter->set_placeholder(TTR("Filter nodes"));
filter_hbc->add_child(filter);
- filter_icon = memnew(TextureRect);
- filter_hbc->add_child(filter_icon);
- filter_icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
filter->connect("text_changed", this, "_filter_changed");
tb = memnew(ToolButton);
@@ -1912,6 +2107,11 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
first_enter = true;
restore_script_editor_on_drag = false;
+ clear_inherit_confirm = memnew(ConfirmationDialog);
+ clear_inherit_confirm->set_text(TTR("Clear Inheritance? (No Undo!)"));
+ clear_inherit_confirm->get_ok()->set_text(TTR("Clear!"));
+ add_child(clear_inherit_confirm);
+
vbc->add_constant_override("separation", 4);
set_process_input(true);
}
diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h
index b43a6ea9b1..5a6bc94125 100644
--- a/editor/scene_tree_dock.h
+++ b/editor/scene_tree_dock.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -69,9 +70,22 @@ class SceneTreeDock : public VBoxContainer {
TOOL_MULTI_EDIT,
TOOL_ERASE,
TOOL_COPY_NODE_PATH,
- TOOL_BUTTON_MAX
+ TOOL_BUTTON_MAX,
+ TOOL_SCENE_EDITABLE_CHILDREN,
+ TOOL_SCENE_USE_PLACEHOLDER,
+ TOOL_SCENE_CLEAR_INSTANCING,
+ TOOL_SCENE_OPEN,
+ TOOL_SCENE_CLEAR_INHERITANCE,
+ TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM,
+ TOOL_SCENE_OPEN_INHERITED
};
+ enum {
+ EDIT_SUBRESOURCE_BASE = 100
+ };
+
+ Vector<ObjectID> subresources;
+
bool restore_script_editor_on_drag;
int current_option;
@@ -105,6 +119,7 @@ class SceneTreeDock : public VBoxContainer {
TextureRect *filter_icon;
PopupMenu *menu;
+ ConfirmationDialog *clear_inherit_confirm;
bool first_enter;
@@ -113,11 +128,14 @@ class SceneTreeDock : public VBoxContainer {
Node *edited_scene;
EditorNode *editor;
+ void _add_children_to_popup(Object *p_obj, int p_depth);
+
Node *_duplicate(Node *p_node, Map<Node *, Node *> &duplimap);
void _node_reparent(NodePath p_path, bool p_keep_global_xform);
void _do_reparent(Node *p_new_parent, int p_position_in_parent, Vector<Node *> p_nodes, bool p_keep_global_xform);
void _set_owners(Node *p_owner, const Array &p_nodes);
+ void _node_replace_owner(Node *p_base, Node *p_node, Node *p_root);
void _load_request(const String &p_path);
void _script_open_request(const Ref<Script> &p_script);
@@ -132,8 +150,8 @@ class SceneTreeDock : public VBoxContainer {
void _node_prerenamed(Node *p_node, const String &p_new_name);
void _nodes_drag_begin();
- void _input(InputEvent p_event);
- void _unhandled_key_input(InputEvent p_event);
+ void _input(Ref<InputEvent> p_event);
+ void _unhandled_key_input(Ref<InputEvent> p_event);
void _import_subscene();
@@ -171,7 +189,7 @@ public:
void import_subscene();
void set_edited_scene(Node *p_scene);
- void instance(const String &p_path);
+ void instance(const String &p_file);
void instance_scenes(const Vector<String> &p_files, Node *p_parent = NULL);
void set_selected(Node *p_node, bool p_emit_selected = false);
void fill_path_renames(Node *p_node, Node *p_new_parent, List<Pair<NodePath, NodePath> > *p_renames);
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 3310405ae9..94ef712c25 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,110 +44,6 @@ Node *SceneTreeEditor::get_scene_node() {
return get_tree()->get_edited_scene_root();
}
-void SceneTreeEditor::_subscene_option(int p_idx) {
-
- Object *obj = ObjectDB::get_instance(instance_node);
- if (!obj)
- return;
- Node *node = obj->cast_to<Node>();
- if (!node)
- return;
-
- switch (p_idx) {
-
- case SCENE_MENU_EDITABLE_CHILDREN: {
-
- bool editable = EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(node);
- editable = !editable;
-
- //node->set_instance_children_editable(editable);
- EditorNode::get_singleton()->get_edited_scene()->set_editable_instance(node, editable);
- instance_menu->set_item_checked(0, editable);
- if (editable) {
- node->set_scene_instance_load_placeholder(false);
- instance_menu->set_item_checked(1, false);
- }
-
- _update_tree();
-
- } break;
- case SCENE_MENU_USE_PLACEHOLDER: {
-
- bool placeholder = node->get_scene_instance_load_placeholder();
- placeholder = !placeholder;
-
- //node->set_instance_children_editable(editable);
- if (placeholder) {
- EditorNode::get_singleton()->get_edited_scene()->set_editable_instance(node, false);
- }
- node->set_scene_instance_load_placeholder(placeholder);
- instance_menu->set_item_checked(0, false);
- instance_menu->set_item_checked(1, placeholder);
-
- _update_tree();
-
- } break;
- case SCENE_MENU_OPEN: {
-
- emit_signal("open", node->get_filename());
- } break;
- case SCENE_MENU_CLEAR_INHERITANCE: {
- clear_inherit_confirm->popup_centered_minsize();
- } break;
- case SCENE_MENU_CLEAR_INSTANCING: {
-
- Node *root = EditorNode::get_singleton()->get_edited_scene();
- if (!root)
- break;
-
- ERR_FAIL_COND(node->get_filename() == String());
-
- undo_redo->create_action("Discard Instancing");
-
- undo_redo->add_do_method(node, "set_filename", "");
- undo_redo->add_undo_method(node, "set_filename", node->get_filename());
-
- _node_replace_owner(node, node, root);
-
- undo_redo->add_do_method(this, "update_tree");
- undo_redo->add_undo_method(this, "update_tree");
-
- undo_redo->commit_action();
-
- } break;
- case SCENE_MENU_OPEN_INHERITED: {
- if (node && node->get_scene_inherited_state().is_valid()) {
- emit_signal("open", node->get_scene_inherited_state()->get_path());
- }
- } break;
- case SCENE_MENU_CLEAR_INHERITANCE_CONFIRM: {
- if (node && node->get_scene_inherited_state().is_valid()) {
- node->set_scene_inherited_state(Ref<SceneState>());
- update_tree();
- EditorNode::get_singleton()->get_property_editor()->update_tree();
- }
-
- } break;
- }
-}
-
-void SceneTreeEditor::_node_replace_owner(Node *p_base, Node *p_node, Node *p_root) {
-
- if (p_base != p_node) {
-
- if (p_node->get_owner() == p_base) {
-
- undo_redo->add_do_method(p_node, "set_owner", p_root);
- undo_redo->add_undo_method(p_node, "set_owner", p_base);
- }
- }
-
- for (int i = 0; i < p_node->get_child_count(); i++) {
-
- _node_replace_owner(p_base, p_node->get_child(i), p_root);
- }
-}
-
void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_id) {
TreeItem *item = p_item->cast_to<TreeItem>();
@@ -158,38 +55,13 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i
ERR_FAIL_COND(!n);
if (p_id == BUTTON_SUBSCENE) {
- //open scene request
- Rect2 item_rect = tree->get_item_rect(item, 0);
- item_rect.pos.y -= tree->get_scroll().y;
- item_rect.pos += tree->get_global_pos();
-
if (n == get_scene_node()) {
- inheritance_menu->set_pos(item_rect.pos + Vector2(0, item_rect.size.y));
- inheritance_menu->set_size(Vector2(item_rect.size.x, 0));
- inheritance_menu->popup();
- instance_node = n->get_instance_ID();
-
- } else {
- instance_menu->set_pos(item_rect.pos + Vector2(0, item_rect.size.y));
- instance_menu->set_size(Vector2(item_rect.size.x, 0));
- if (EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(n))
- instance_menu->set_item_checked(0, true);
- else
- instance_menu->set_item_checked(0, false);
-
- if (n->get_owner() == get_scene_node()) {
- instance_menu->set_item_checked(1, n->get_scene_instance_load_placeholder());
- instance_menu->set_item_disabled(1, false);
- } else {
-
- instance_menu->set_item_checked(1, false);
- instance_menu->set_item_disabled(1, true);
+ if (n && n->get_scene_inherited_state().is_valid()) {
+ emit_signal("open", n->get_scene_inherited_state()->get_path());
}
-
- instance_menu->popup();
- instance_node = n->get_instance_ID();
+ } else {
+ emit_signal("open", n->get_filename());
}
- //emit_signal("open",n->get_filename());
} else if (p_id == BUTTON_SCRIPT) {
RefPtr script = n->get_script();
if (!script.is_null())
@@ -289,7 +161,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
item->set_selectable(0, true);
if (can_rename) {
-#ifdef ENABLE_DEPRECATED
+#ifndef DISABLE_DEPRECATED
if (p_node->has_meta("_editor_collapsed")) {
//remove previous way of storing folding, which did not get along with scene inheritance and instancing
if ((bool)p_node->get_meta("_editor_collapsed"))
@@ -313,19 +185,19 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
if (part_of_subscene) {
//item->set_selectable(0,marked_selectable);
- item->set_custom_color(0, Color(0.8, 0.4, 0.20));
+ item->set_custom_color(0, get_color("error_color", "Editor").linear_interpolate(get_color("warning_color", "Editor"), 0.4));
} else if (marked.has(p_node)) {
item->set_selectable(0, marked_selectable);
- item->set_custom_color(0, Color(0.8, 0.1, 0.10));
+ item->set_custom_color(0, get_color("error_color", "Editor"));
} else if (!marked_selectable && !marked_children_selectable) {
Node *node = p_node;
while (node) {
if (marked.has(node)) {
item->set_selectable(0, false);
- item->set_custom_color(0, Color(0.8, 0.1, 0.10));
+ item->set_custom_color(0, get_color("error_color", "Editor"));
break;
}
node = node->get_parent();
@@ -336,27 +208,27 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
String warning = p_node->get_configuration_warning();
if (warning != String()) {
- item->add_button(0, get_icon("NodeWarning", "EditorIcons"), BUTTON_WARNING);
+ item->add_button(0, get_icon("NodeWarning", "EditorIcons"), BUTTON_WARNING, false, TTR("Node configuration warning:") + "\n" + p_node->get_configuration_warning());
}
bool has_connections = p_node->has_persistent_signal_connections();
bool has_groups = p_node->has_persistent_groups();
if (has_connections && has_groups) {
- item->add_button(0, get_icon("ConnectionAndGroups", "EditorIcons"), BUTTON_SIGNALS);
+ item->add_button(0, get_icon("ConnectionAndGroups", "EditorIcons"), BUTTON_SIGNALS, false, TTR("Node has connection(s) and group(s)\nClick to show signals dock."));
} else if (has_connections) {
- item->add_button(0, get_icon("Connect", "EditorIcons"), BUTTON_SIGNALS);
+ item->add_button(0, get_icon("Connect", "EditorIcons"), BUTTON_SIGNALS, false, TTR("Node has connections.\nClick to show signals dock."));
} else if (has_groups) {
- item->add_button(0, get_icon("Groups", "EditorIcons"), BUTTON_GROUPS);
+ item->add_button(0, get_icon("Groups", "EditorIcons"), BUTTON_GROUPS, false, TTR("Node is in group(s).\nClick to show groups dock."));
}
}
if (p_node == get_scene_node() && p_node->get_scene_inherited_state().is_valid()) {
- item->add_button(0, get_icon("InstanceOptions", "EditorIcons"), BUTTON_SUBSCENE);
+ item->add_button(0, get_icon("InstanceOptions", "EditorIcons"), BUTTON_SUBSCENE, false, TTR("Open in Editor"));
item->set_tooltip(0, TTR("Inherits:") + " " + p_node->get_scene_inherited_state()->get_path() + "\n" + TTR("Type:") + " " + p_node->get_class());
} else if (p_node != get_scene_node() && p_node->get_filename() != "" && can_open_instance) {
- item->add_button(0, get_icon("InstanceOptions", "EditorIcons"), BUTTON_SUBSCENE);
+ item->add_button(0, get_icon("InstanceOptions", "EditorIcons"), BUTTON_SUBSCENE, false, TTR("Open in Editor"));
item->set_tooltip(0, TTR("Instance:") + " " + p_node->get_filename() + "\n" + TTR("Type:") + " " + p_node->get_class());
} else {
item->set_tooltip(0, String(p_node->get_name()) + "\n" + TTR("Type:") + " " + p_node->get_class());
@@ -369,24 +241,24 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
if (!p_node->get_script().is_null()) {
- item->add_button(0, get_icon("Script", "EditorIcons"), BUTTON_SCRIPT);
+ item->add_button(0, get_icon("Script", "EditorIcons"), BUTTON_SCRIPT, false, TTR("Open script"));
}
if (p_node->is_class("CanvasItem")) {
bool is_locked = p_node->has_meta("_edit_lock_"); //_edit_group_
if (is_locked)
- item->add_button(0, get_icon("Lock", "EditorIcons"), BUTTON_LOCK);
+ item->add_button(0, get_icon("Lock", "EditorIcons"), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock"));
bool is_grouped = p_node->has_meta("_edit_group_");
if (is_grouped)
- item->add_button(0, get_icon("Group", "EditorIcons"), BUTTON_GROUP);
+ item->add_button(0, get_icon("Group", "EditorIcons"), BUTTON_GROUP, false, TTR("Children are not selectable.\nClick to make selectable"));
bool v = p_node->call("is_visible");
if (v)
- item->add_button(0, get_icon("Visible", "EditorIcons"), BUTTON_VISIBILITY);
+ item->add_button(0, get_icon("Visible", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
else
- item->add_button(0, get_icon("Hidden", "EditorIcons"), BUTTON_VISIBILITY);
+ item->add_button(0, get_icon("Hidden", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
if (!p_node->is_connected("visibility_changed", this, "_node_visibility_changed"))
p_node->connect("visibility_changed", this, "_node_visibility_changed", varray(p_node));
@@ -396,9 +268,9 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
bool v = p_node->call("is_visible");
if (v)
- item->add_button(0, get_icon("Visible", "EditorIcons"), BUTTON_VISIBILITY);
+ item->add_button(0, get_icon("Visible", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
else
- item->add_button(0, get_icon("Hidden", "EditorIcons"), BUTTON_VISIBILITY);
+ item->add_button(0, get_icon("Hidden", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
if (!p_node->is_connected("visibility_changed", this, "_node_visibility_changed"))
p_node->connect("visibility_changed", this, "_node_visibility_changed", varray(p_node));
@@ -471,7 +343,7 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) {
void SceneTreeEditor::_update_visibility_color(Node *p_node, TreeItem *p_item) {
if (p_node->is_class("CanvasItem") || p_node->is_class("Spatial")) {
Color color(1, 1, 1, 1);
- bool visible_on_screen = p_node->call("is_visible");
+ bool visible_on_screen = p_node->call("is_visible_in_tree");
if (!visible_on_screen) {
color = Color(0.6, 0.6, 0.6, 1);
}
@@ -539,9 +411,9 @@ void SceneTreeEditor::_update_tree() {
void SceneTreeEditor::_compute_hash(Node *p_node, uint64_t &hash) {
- hash = hash_djb2_one_64(p_node->get_instance_ID(), hash);
+ hash = hash_djb2_one_64(p_node->get_instance_id(), hash);
if (p_node->get_parent())
- hash = hash_djb2_one_64(p_node->get_parent()->get_instance_ID(), hash); //so a reparent still produces a different hash
+ hash = hash_djb2_one_64(p_node->get_parent()->get_instance_id(), hash); //so a reparent still produces a different hash
for (int i = 0; i < p_node->get_child_count(); i++) {
@@ -632,10 +504,7 @@ void SceneTreeEditor::_notification(int p_what) {
get_tree()->connect("node_removed", this, "_node_removed");
get_tree()->connect("node_configuration_warning_changed", this, "_warning_changed");
- instance_menu->set_item_icon(5, get_icon("Load", "EditorIcons"));
tree->connect("item_collapsed", this, "_cell_collapsed");
- inheritance_menu->set_item_icon(2, get_icon("Load", "EditorIcons"));
- clear_inherit_confirm->connect("confirmed", this, "_subscene_option", varray(SCENE_MENU_CLEAR_INHERITANCE_CONFIRM));
EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed");
@@ -648,7 +517,6 @@ void SceneTreeEditor::_notification(int p_what) {
get_tree()->disconnect("tree_changed", this, "_tree_changed");
get_tree()->disconnect("node_removed", this, "_node_removed");
tree->disconnect("item_collapsed", this, "_cell_collapsed");
- clear_inherit_confirm->disconnect("confirmed", this, "_subscene_option");
get_tree()->disconnect("node_configuration_warning_changed", this, "_warning_changed");
EditorSettings::get_singleton()->disconnect("settings_changed", this, "_editor_settings_changed");
}
@@ -757,8 +625,8 @@ void SceneTreeEditor::_renamed() {
} else {
undo_redo->create_action(TTR("Rename Node"));
emit_signal("node_prerename", n, new_name);
- undo_redo->add_do_method(this, "_rename_node", n->get_instance_ID(), new_name);
- undo_redo->add_undo_method(this, "_rename_node", n->get_instance_ID(), n->get_name());
+ undo_redo->add_do_method(this, "_rename_node", n->get_instance_id(), new_name);
+ undo_redo->add_undo_method(this, "_rename_node", n->get_instance_id(), n->get_name());
undo_redo->commit_action();
}
}
@@ -1058,7 +926,6 @@ void SceneTreeEditor::_bind_methods() {
ClassDB::bind_method("_selection_changed", &SceneTreeEditor::_selection_changed);
ClassDB::bind_method("_cell_button_pressed", &SceneTreeEditor::_cell_button_pressed);
ClassDB::bind_method("_cell_collapsed", &SceneTreeEditor::_cell_collapsed);
- ClassDB::bind_method("_subscene_option", &SceneTreeEditor::_subscene_option);
ClassDB::bind_method("_rmb_select", &SceneTreeEditor::_rmb_select);
ClassDB::bind_method("_warning_changed", &SceneTreeEditor::_warning_changed);
@@ -1102,7 +969,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope
if (p_label) {
Label *label = memnew(Label);
- label->set_pos(Point2(10, 0));
+ label->set_position(Point2(10, 0));
label->set_text(TTR("Scene Tree (Nodes):"));
add_child(label);
@@ -1113,6 +980,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope
tree->set_anchor(MARGIN_BOTTOM, ANCHOR_END);
tree->set_begin(Point2(0, p_label ? 18 : 0));
tree->set_end(Point2(0, 0));
+ tree->add_constant_override("button_margin", 0);
add_child(tree);
@@ -1143,29 +1011,6 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope
updating_tree = false;
blocked = 0;
- instance_menu = memnew(PopupMenu);
- instance_menu->add_check_item(TTR("Editable Children"), SCENE_MENU_EDITABLE_CHILDREN);
- instance_menu->add_check_item(TTR("Load As Placeholder"), SCENE_MENU_USE_PLACEHOLDER);
- instance_menu->add_separator();
- instance_menu->add_item(TTR("Discard Instancing"), SCENE_MENU_CLEAR_INSTANCING);
- instance_menu->add_separator();
- instance_menu->add_item(TTR("Open in Editor"), SCENE_MENU_OPEN);
- instance_menu->connect("id_pressed", this, "_subscene_option");
- add_child(instance_menu);
-
- inheritance_menu = memnew(PopupMenu);
- inheritance_menu->add_item(TTR("Clear Inheritance"), SCENE_MENU_CLEAR_INHERITANCE);
- inheritance_menu->add_separator();
- inheritance_menu->add_item(TTR("Open in Editor"), SCENE_MENU_OPEN_INHERITED);
- inheritance_menu->connect("id_pressed", this, "_subscene_option");
-
- add_child(inheritance_menu);
-
- clear_inherit_confirm = memnew(ConfirmationDialog);
- clear_inherit_confirm->set_text(TTR("Clear Inheritance? (No Undo!)"));
- clear_inherit_confirm->get_ok()->set_text(TTR("Clear!"));
- add_child(clear_inherit_confirm);
-
update_timer = memnew(Timer);
update_timer->connect("timeout", this, "_update_tree");
update_timer->set_one_shot(true);
diff --git a/editor/scene_tree_editor.h b/editor/scene_tree_editor.h
index 22ef492379..c666b6a8d5 100644
--- a/editor/scene_tree_editor.h
+++ b/editor/scene_tree_editor.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -55,27 +56,14 @@ class SceneTreeEditor : public Control {
BUTTON_GROUPS = 7,
};
- enum {
- SCENE_MENU_EDITABLE_CHILDREN,
- SCENE_MENU_USE_PLACEHOLDER,
- SCENE_MENU_OPEN,
- SCENE_MENU_CLEAR_INHERITANCE,
- SCENE_MENU_OPEN_INHERITED,
- SCENE_MENU_CLEAR_INHERITANCE_CONFIRM,
- SCENE_MENU_CLEAR_INSTANCING,
- };
-
Tree *tree;
Node *selected;
- PopupMenu *instance_menu;
- PopupMenu *inheritance_menu;
ObjectID instance_node;
String filter;
AcceptDialog *error;
AcceptDialog *warning;
- ConfirmationDialog *clear_inherit_confirm;
int blocked;
@@ -113,12 +101,11 @@ class SceneTreeEditor : public Control {
static void _bind_methods();
void _cell_button_pressed(Object *p_item, int p_column, int p_id);
- void _cell_multi_selected(Object *p_object, int p_cel, bool p_selected);
+ void _cell_multi_selected(Object *p_object, int p_cell, bool p_selected);
void _update_selection(TreeItem *item);
void _node_script_changed(Node *p_node);
void _node_visibility_changed(Node *p_node);
void _update_visibility_color(Node *p_node, TreeItem *p_item);
- void _subscene_option(int p_idx);
void _node_replace_owner(Node *p_base, Node *p_node, Node *p_root);
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index d1a8aa62e5..0748c43b5f 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,12 +29,24 @@
/*************************************************************************/
#include "script_create_dialog.h"
+#include "editor/editor_node.h"
+#include "editor/editor_scale.h"
#include "editor_file_system.h"
-#include "global_config.h"
#include "io/resource_saver.h"
#include "os/file_access.h"
+#include "project_settings.h"
#include "script_language.h"
+void ScriptCreateDialog::_notification(int p_what) {
+
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE: {
+ path_button->set_icon(get_icon("Folder", "EditorIcons"));
+ parent_browse_button->set_icon(get_icon("Folder", "EditorIcons"));
+ }
+ }
+}
+
void ScriptCreateDialog::config(const String &p_base_name, const String &p_base_path) {
class_name->set_text("");
@@ -45,6 +58,8 @@ void ScriptCreateDialog::config(const String &p_base_name, const String &p_base_
initial_bp = "";
file_path->set_text("");
}
+ _lang_changed(current_language);
+ _parent_name_changed(parent_name->get_text());
_class_name_changed("");
_path_changed(file_path->get_text());
}
@@ -54,6 +69,8 @@ bool ScriptCreateDialog::_validate(const String &p_string) {
if (p_string.length() == 0)
return false;
+ String path_chars = "\"res://";
+ bool is_val_path = ScriptServer::get_language(language_menu->get_selected())->can_inherit_from_file();
for (int i = 0; i < p_string.length(); i++) {
if (i == 0) {
@@ -61,7 +78,17 @@ bool ScriptCreateDialog::_validate(const String &p_string) {
return false; // no start with number plz
}
- bool valid_char = (p_string[i] >= '0' && p_string[i] <= '9') || (p_string[i] >= 'a' && p_string[i] <= 'z') || (p_string[i] >= 'A' && p_string[i] <= 'Z') || p_string[i] == '_';
+ if (i == p_string.length() - 1 && is_val_path)
+ return p_string[i] == '\"';
+
+ if (is_val_path && i < path_chars.length()) {
+ if (p_string[i] != path_chars[i])
+ is_val_path = false;
+ else
+ continue;
+ }
+
+ bool valid_char = (p_string[i] >= '0' && p_string[i] <= '9') || (p_string[i] >= 'a' && p_string[i] <= 'z') || (p_string[i] >= 'A' && p_string[i] <= 'Z') || p_string[i] == '_' || (is_val_path && (p_string[i] == '/' || p_string[i] == '.'));
if (!valid_char)
return false;
@@ -72,76 +99,81 @@ bool ScriptCreateDialog::_validate(const String &p_string) {
void ScriptCreateDialog::_class_name_changed(const String &p_name) {
- if (!_validate(parent_name->get_text())) {
- error_label->set_text(TTR("Invalid parent class name"));
- error_label->add_color_override("font_color", Color(1, 0.4, 0.0, 0.8));
- } else if (class_name->is_editable()) {
- if (class_name->get_text() == "") {
- error_label->set_text(TTR("Valid chars:") + " a-z A-Z 0-9 _");
- error_label->add_color_override("font_color", Color(1, 1, 1, 0.6));
- } else if (!_validate(class_name->get_text())) {
- error_label->set_text(TTR("Invalid class name"));
- error_label->add_color_override("font_color", Color(1, 0.2, 0.2, 0.8));
- } else {
- error_label->set_text(TTR("Valid name"));
- error_label->add_color_override("font_color", Color(0, 1.0, 0.8, 0.8));
- }
+ if (_validate(class_name->get_text())) {
+ is_class_name_valid = true;
} else {
+ is_class_name_valid = false;
+ }
+ _update_dialog();
+}
+
+void ScriptCreateDialog::_parent_name_changed(const String &p_parent) {
+
+ if (_validate(parent_name->get_text())) {
+ is_parent_name_valid = true;
+ } else {
+ is_parent_name_valid = false;
+ }
+ _update_dialog();
+}
+
+void ScriptCreateDialog::_template_changed(int p_template) {
- error_label->set_text(TTR("N/A"));
- error_label->add_color_override("font_color", Color(0, 1.0, 0.8, 0.8));
+ String selected_template = p_template == 0 ? "" : template_menu->get_item_text(template_menu->get_selected());
+ EditorSettings::get_singleton()->set_project_metadata("script_setup", "last_selected_template", selected_template);
+ if (p_template == 0) {
+ //default
+ script_template = "";
+ return;
}
+ String ext = ScriptServer::get_language(language_menu->get_selected())->get_extension();
+ String name = template_list[p_template - 1] + "." + ext;
+ script_template = EditorSettings::get_singleton()->get_settings_path() + "/script_templates/" + name;
}
void ScriptCreateDialog::ok_pressed() {
- if (create_new) {
+ if (is_new_script_created) {
_create_new();
} else {
_load_exist();
}
- create_new = true;
- _update_controls();
+ is_new_script_created = true;
+ _update_dialog();
}
void ScriptCreateDialog::_create_new() {
- if (class_name->is_editable() && !_validate(class_name->get_text())) {
- alert->set_text(TTR("Class name is invalid!"));
- alert->popup_centered_minsize();
- return;
- }
- if (!_validate(parent_name->get_text())) {
- alert->set_text(TTR("Parent class name is invalid!"));
- alert->popup_centered_minsize();
- return;
- }
-
String cname;
- if (class_name->is_editable())
+ if (has_named_classes)
cname = class_name->get_text();
- 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_project_metadata("script_setup", "last_selected_language", selected_language);
+ Ref<Script> scr;
+ if (script_template != "") {
+ scr = ResourceLoader::load(script_template);
+ if (scr.is_null()) {
+ alert->get_ok()->set_text(TTR("OK"));
+ alert->set_text(vformat(TTR("Error loading template '%s'"), script_template));
+ alert->popup_centered();
+ return;
+ }
+ scr = scr->duplicate();
+ ScriptServer::get_language(language_menu->get_selected())->make_template(cname, parent_name->get_text(), scr);
+ } else {
+ scr = ScriptServer::get_language(language_menu->get_selected())->get_template(cname, parent_name->get_text());
+ }
if (cname != "")
scr->set_name(cname);
- if (!internal->is_pressed()) {
- String lpath = GlobalConfig::get_singleton()->localize_path(file_path->get_text());
+ if (!is_built_in) {
+ String lpath = ProjectSettings::get_singleton()->localize_path(file_path->get_text());
scr->set_path(lpath);
- if (!path_valid) {
- alert->set_text(TTR("Invalid path!"));
- alert->popup_centered_minsize();
- return;
- }
Error err = ResourceSaver::save(lpath, scr, ResourceSaver::FLAG_CHANGE_PATH);
if (err != OK) {
- alert->set_text(TTR("Could not create script in filesystem."));
- alert->popup_centered_minsize();
+ alert->set_text(TTR("Error - Could not create script in filesystem."));
+ alert->popup_centered();
return;
}
}
@@ -155,9 +187,9 @@ void ScriptCreateDialog::_load_exist() {
String path = file_path->get_text();
RES p_script = ResourceLoader::load(path, "Script");
if (p_script.is_null()) {
- alert->get_ok()->set_text(TTR("Ugh"));
+ alert->get_ok()->set_text(TTR("OK"));
alert->set_text(vformat(TTR("Error loading script from %s"), path));
- alert->popup_centered_minsize();
+ alert->popup_centered();
return;
}
@@ -168,63 +200,104 @@ void ScriptCreateDialog::_load_exist() {
void ScriptCreateDialog::_lang_changed(int l) {
l = language_menu->get_selected();
- if (ScriptServer::get_language(l)->has_named_classes()) {
- class_name->set_editable(true);
+ ScriptLanguage *language = ScriptServer::get_language(l);
+ if (language->has_named_classes()) {
+ has_named_classes = true;
} else {
- class_name->set_editable(false);
+ has_named_classes = false;
}
- String selected_ext = "." + ScriptServer::get_language(l)->get_extension();
- String path = file_path->get_text();
- String extension = "";
- if (path.find(".") >= 0) {
- extension = path.get_extension();
+ if (ScriptServer::get_language(l)->can_inherit_from_file()) {
+ can_inherit_from_file = true;
+ } else {
+ can_inherit_from_file = false;
}
- if (extension.length() == 0) {
- // add extension if none
- path += selected_ext;
- _path_changed(path);
- } else {
- // change extension by selected language
- List<String> extensions;
- // get all possible extensions for script
- for (int l = 0; l < language_menu->get_item_count(); l++) {
- ScriptServer::get_language(l)->get_recognized_extensions(&extensions);
+ String selected_ext = "." + language->get_extension();
+ String path = file_path->get_text();
+ String extension = "";
+ if (path != "") {
+ if (path.find(".") >= 0) {
+ extension = path.get_extension();
}
- for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
- if (E->get().nocasecmp_to(extension) == 0) {
- path = path.get_basename() + selected_ext;
- _path_changed(path);
- break;
+ if (extension.length() == 0) {
+ // add extension if none
+ path += selected_ext;
+ _path_changed(path);
+ } else {
+ // change extension by selected language
+ List<String> extensions;
+ // get all possible extensions for script
+ for (int l = 0; l < language_menu->get_item_count(); l++) {
+ ScriptServer::get_language(l)->get_recognized_extensions(&extensions);
+ }
+
+ for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
+ if (E->get().nocasecmp_to(extension) == 0) {
+ path = path.get_basename() + selected_ext;
+ _path_changed(path);
+ break;
+ }
}
}
+ } else {
+ path = "class" + selected_ext;
+ _path_changed(path);
}
file_path->set_text(path);
- _class_name_changed(class_name->get_text());
+
+ bool use_templates = language->is_using_templates();
+ template_menu->set_disabled(!use_templates);
+ template_menu->clear();
+ if (use_templates) {
+
+ template_list = EditorSettings::get_singleton()->get_script_templates(language->get_extension());
+
+ String last_lang = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_language", "");
+ String last_template = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_template", "");
+
+ template_menu->add_item(TTR("Default"));
+ for (int i = 0; i < template_list.size(); i++) {
+ String s = template_list[i].capitalize();
+ template_menu->add_item(s);
+ if (language_menu->get_item_text(language_menu->get_selected()) == last_lang && last_template == s) {
+ template_menu->select(i + 1);
+ }
+ }
+ } else {
+
+ template_menu->add_item(TTR("N/A"));
+ script_template = "";
+ }
+
+ _template_changed(template_menu->get_selected());
+ EditorSettings::get_singleton()->set_project_metadata("script_setup", "last_selected_language", language_menu->get_item_text(language_menu->get_selected()));
+
+ _update_dialog();
}
void ScriptCreateDialog::_built_in_pressed() {
if (internal->is_pressed()) {
- path_vb->hide();
+ is_built_in = true;
} else {
- path_vb->show();
+ is_built_in = false;
}
+ _update_dialog();
}
-void ScriptCreateDialog::_browse_path() {
+void ScriptCreateDialog::_browse_path(bool browse_parent) {
+
+ is_browsing_parent = browse_parent;
file_browse->set_mode(EditorFileDialog::MODE_SAVE_FILE);
file_browse->set_disable_overwrite_warning(true);
file_browse->clear_filters();
List<String> extensions;
- // get all possible extensions for script
- for (int l = 0; l < language_menu->get_item_count(); l++) {
- ScriptServer::get_language(l)->get_recognized_extensions(&extensions);
- }
+ int lang = language_menu->get_selected();
+ ScriptServer::get_language(lang)->get_recognized_extensions(&extensions);
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
file_browse->add_filter("*." + E->get());
@@ -236,47 +309,57 @@ void ScriptCreateDialog::_browse_path() {
void ScriptCreateDialog::_file_selected(const String &p_file) {
- String p = GlobalConfig::get_singleton()->localize_path(p_file);
- file_path->set_text(p);
- _path_changed(p);
+ String p = ProjectSettings::get_singleton()->localize_path(p_file);
+ if (is_browsing_parent) {
+ parent_name->set_text("\"" + p + "\"");
+ _class_name_changed("\"" + p + "\"");
+ } else {
+ file_path->set_text(p);
+ _path_changed(p);
+ }
}
void ScriptCreateDialog::_path_changed(const String &p_path) {
- path_valid = false;
+ is_path_valid = false;
+ is_new_script_created = true;
String p = p_path;
if (p == "") {
-
- path_error_label->set_text(TTR("Path is empty"));
- path_error_label->add_color_override("font_color", Color(1, 0.4, 0.0, 0.8));
+ _msg_path_valid(false, TTR("Path is empty"));
+ _update_dialog();
return;
}
- p = GlobalConfig::get_singleton()->localize_path(p);
+ p = ProjectSettings::get_singleton()->localize_path(p);
if (!p.begins_with("res://")) {
-
- path_error_label->set_text(TTR("Path is not local"));
- path_error_label->add_color_override("font_color", Color(1, 0.4, 0.0, 0.8));
+ _msg_path_valid(false, TTR("Path is not local"));
+ _update_dialog();
return;
}
if (p.find("/") || p.find("\\")) {
DirAccess *d = DirAccess::create(DirAccess::ACCESS_RESOURCES);
-
if (d->change_dir(p.get_base_dir()) != OK) {
-
- path_error_label->set_text(TTR("Invalid base path"));
- path_error_label->add_color_override("font_color", Color(1, 0.4, 0.0, 0.8));
+ _msg_path_valid(false, TTR("Invalid base path"));
memdelete(d);
+ _update_dialog();
return;
}
memdelete(d);
}
- FileAccess *f = FileAccess::create(FileAccess::ACCESS_RESOURCES);
- create_new = !f->file_exists(p);
+ /* Does file already exist */
+
+ DirAccess *f = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ if (f->file_exists(p) && !(f->current_is_dir())) {
+ is_new_script_created = false;
+ is_path_valid = true;
+ }
memdelete(f);
+ _update_dialog();
+
+ /* Check file extension */
String extension = p.get_extension();
List<String> extensions;
@@ -287,134 +370,371 @@ void ScriptCreateDialog::_path_changed(const String &p_path) {
}
bool found = false;
+ bool match = false;
int index = 0;
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
if (E->get().nocasecmp_to(extension) == 0) {
- language_menu->select(index); // change Language option by extension
+ //FIXME (?) - changing language this way doesn't update controls, needs rework
+ //language_menu->select(index); // change Language option by extension
found = true;
+ if (E->get() == ScriptServer::get_language(language_menu->get_selected())->get_extension()) {
+ match = true;
+ }
break;
}
index++;
}
if (!found) {
- path_error_label->set_text(TTR("Invalid extension"));
- path_error_label->add_color_override("font_color", Color(1, 0.4, 0.0, 0.8));
+ _msg_path_valid(false, TTR("Invalid extension"));
+ _update_dialog();
return;
}
- _update_controls();
+ if (!match) {
+ _msg_path_valid(false, TTR("Wrong extension chosen"));
+ _update_dialog();
+ return;
+ }
- path_error_label->add_color_override("font_color", Color(0, 1.0, 0.8, 0.8));
+ /* All checks passed */
- path_valid = true;
+ is_path_valid = true;
+ _update_dialog();
}
-void ScriptCreateDialog::_update_controls() {
+void ScriptCreateDialog::_msg_script_valid(bool valid, const String &p_msg) {
+
+ error_label->set_text(TTR(p_msg));
+ if (valid) {
+ error_label->add_color_override("font_color", get_color("success_color", "Editor"));
+ } else {
+ error_label->add_color_override("font_color", get_color("error_color", "Editor"));
+ }
+}
- if (create_new) {
- path_error_label->set_text(TTR("Create new script"));
+void ScriptCreateDialog::_msg_path_valid(bool valid, const String &p_msg) {
+
+ path_error_label->set_text(TTR(p_msg));
+ if (valid) {
+ path_error_label->add_color_override("font_color", get_color("success_color", "Editor"));
+ } else {
+ path_error_label->add_color_override("font_color", get_color("error_color", "Editor"));
+ }
+}
+
+void ScriptCreateDialog::_update_dialog() {
+
+ bool script_ok = true;
+
+ /* "Add Script Dialog" gui logic and script checks */
+
+ // Is Script Valid (order from top to bottom)
+ get_ok()->set_disabled(true);
+ if (!is_built_in) {
+ if (!is_path_valid) {
+ _msg_script_valid(false, TTR("Invalid Path"));
+ script_ok = false;
+ }
+ }
+ if (has_named_classes && (!is_class_name_valid)) {
+ _msg_script_valid(false, TTR("Invalid class name"));
+ script_ok = false;
+ }
+ if (!is_parent_name_valid) {
+ _msg_script_valid(false, TTR("Invalid inherited parent name or path"));
+ script_ok = false;
+ }
+ if (script_ok) {
+ _msg_script_valid(true, TTR("Script valid"));
+ get_ok()->set_disabled(false);
+ }
+
+ /* Does script have named classes */
+
+ if (has_named_classes) {
+ if (is_new_script_created) {
+ class_name->set_editable(true);
+ class_name->set_placeholder(TTR("Allowed: a-z, A-Z, 0-9 and _"));
+ class_name->set_placeholder_alpha(0.3);
+ } else {
+ class_name->set_editable(false);
+ }
+ } else {
+ class_name->set_editable(false);
+ class_name->set_placeholder(TTR("N/A"));
+ class_name->set_placeholder_alpha(1);
+ }
+
+ /* Can script inherit from a file */
+
+ if (can_inherit_from_file) {
+ parent_browse_button->set_disabled(false);
+ } else {
+ parent_browse_button->set_disabled(true);
+ }
+
+ /* Is script Built-in */
+
+ if (is_built_in) {
+ file_path->set_editable(false);
+ path_button->set_disabled(true);
+ re_check_path = true;
+ } else {
+ file_path->set_editable(true);
+ path_button->set_disabled(false);
+ if (re_check_path) {
+ re_check_path = false;
+ _path_changed(file_path->get_text());
+ }
+ }
+
+ /* Is Script created or loaded from existing file */
+
+ if (is_new_script_created) {
+ // New Script Created
get_ok()->set_text(TTR("Create"));
+ parent_name->set_editable(true);
+ parent_browse_button->set_disabled(false);
+ internal->set_disabled(false);
+ if (is_built_in) {
+ _msg_path_valid(true, TTR("Built-in script (into scene file)"));
+ } else {
+ if (script_ok) {
+ _msg_path_valid(true, TTR("Create new script file"));
+ }
+ }
} else {
- path_error_label->set_text(TTR("Load existing script"));
+ // Script Loaded
get_ok()->set_text(TTR("Load"));
+ parent_name->set_editable(false);
+ parent_browse_button->set_disabled(true);
+ internal->set_disabled(true);
+ if (script_ok) {
+ _msg_path_valid(true, TTR("Load existing script file"));
+ }
}
- parent_name->set_editable(create_new);
- internal->set_disabled(!create_new);
}
void ScriptCreateDialog::_bind_methods() {
ClassDB::bind_method("_class_name_changed", &ScriptCreateDialog::_class_name_changed);
+ ClassDB::bind_method("_parent_name_changed", &ScriptCreateDialog::_parent_name_changed);
ClassDB::bind_method("_lang_changed", &ScriptCreateDialog::_lang_changed);
ClassDB::bind_method("_built_in_pressed", &ScriptCreateDialog::_built_in_pressed);
ClassDB::bind_method("_browse_path", &ScriptCreateDialog::_browse_path);
ClassDB::bind_method("_file_selected", &ScriptCreateDialog::_file_selected);
ClassDB::bind_method("_path_changed", &ScriptCreateDialog::_path_changed);
+ ClassDB::bind_method("_template_changed", &ScriptCreateDialog::_template_changed);
ADD_SIGNAL(MethodInfo("script_created", PropertyInfo(Variant::OBJECT, "script", PROPERTY_HINT_RESOURCE_TYPE, "Script")));
}
ScriptCreateDialog::ScriptCreateDialog() {
- /* SNAP DIALOG */
-
+ GridContainer *gc = memnew(GridContainer);
VBoxContainer *vb = memnew(VBoxContainer);
- add_child(vb);
- //set_child_rect(vb);
+ HBoxContainer *hb = memnew(HBoxContainer);
+ Label *l = memnew(Label);
+ Control *empty = memnew(Control);
+ Control *empty_h = memnew(Control);
+ Control *empty_v = memnew(Control);
+ PanelContainer *pc = memnew(PanelContainer);
- class_name = memnew(LineEdit);
- VBoxContainer *vb2 = memnew(VBoxContainer);
- vb2->add_child(class_name);
- class_name->connect("text_changed", this, "_class_name_changed");
- error_label = memnew(Label);
- error_label->set_text("valid chars: a-z A-Z 0-9 _");
- error_label->set_align(Label::ALIGN_CENTER);
- vb2->add_child(error_label);
- vb->add_margin_child(TTR("Class Name:"), vb2);
+ /* DIALOG */
- parent_name = memnew(LineEdit);
- vb->add_margin_child(TTR("Inherits:"), parent_name);
- parent_name->connect("text_changed", this, "_class_name_changed");
+ /* Main Controls */
- language_menu = memnew(OptionButton);
- vb->add_margin_child(TTR("Language"), language_menu);
+ gc = memnew(GridContainer);
+ gc->set_columns(2);
+
+ /* Error Messages Field */
+
+ vb = memnew(VBoxContainer);
+ hb = memnew(HBoxContainer);
+ l = memnew(Label);
+ l->set_text(" - ");
+ hb->add_child(l);
+ error_label = memnew(Label);
+ error_label->set_text(TTR("Error!"));
+ error_label->set_align(Label::ALIGN_LEFT);
+ hb->add_child(error_label);
+ vb->add_child(hb);
+
+ hb = memnew(HBoxContainer);
+ l = memnew(Label);
+ l->set_text(" - ");
+ hb->add_child(l);
+ path_error_label = memnew(Label);
+ path_error_label->set_text(TTR("Error!"));
+ path_error_label->set_align(Label::ALIGN_LEFT);
+ hb->add_child(path_error_label);
+ vb->add_child(hb);
+
+ pc = memnew(PanelContainer);
+ pc->set_h_size_flags(Control::SIZE_FILL);
+ pc->add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("bg", "Tree"));
+ pc->add_child(vb);
+
+ /* Margins */
+
+ empty_h = memnew(Control);
+ empty_h->set_name("empty_h"); //duplicate() doesn't like nodes without a name
+ empty_h->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ empty_h->set_v_size_flags(Control::SIZE_EXPAND_FILL);
+ empty_h->set_custom_minimum_size(Size2(0, 10 * EDSCALE));
+ empty_v = memnew(Control);
+ empty_v->set_name("empty_v");
+ empty_v->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ empty_v->set_v_size_flags(Control::SIZE_EXPAND_FILL);
+ empty_v->set_custom_minimum_size(Size2(10, 0 * EDSCALE));
+
+ vb = memnew(VBoxContainer);
+ vb->add_child(empty_h->duplicate());
+ vb->add_child(gc);
+ vb->add_child(empty_h->duplicate());
+ vb->add_child(pc);
+ vb->add_child(empty_h->duplicate());
+ hb = memnew(HBoxContainer);
+ hb->add_child(empty_v->duplicate());
+ hb->add_child(vb);
+ hb->add_child(empty_v->duplicate());
+
+ add_child(hb);
+
+ /* Language */
+
+ language_menu = memnew(OptionButton);
+ language_menu->set_custom_minimum_size(Size2(250, 0) * EDSCALE);
+ language_menu->set_h_size_flags(SIZE_EXPAND_FILL);
+ l = memnew(Label);
+ l->set_text(TTR("Language"));
+ l->set_align(Label::ALIGN_RIGHT);
+ gc->add_child(l);
+ gc->add_child(language_menu);
+
+ int default_lang = 0;
for (int i = 0; i < ScriptServer::get_language_count(); i++) {
- language_menu->add_item(ScriptServer::get_language(i)->get_name());
+ String lang = ScriptServer::get_language(i)->get_name();
+ language_menu->add_item(lang);
+ if (lang == "GDScript") {
+ default_lang = i;
+ }
}
- editor_settings = EditorSettings::get_singleton();
- 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++)
+ String last_selected_language = EditorSettings::get_singleton()->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) {
language_menu->select(i);
+ current_language = i;
break;
- } else
- language_menu->select(0);
+ }
+ }
+ } else {
+ language_menu->select(default_lang);
+ current_language = default_lang;
+ }
language_menu->connect("item_selected", this, "_lang_changed");
- //parent_name->set_text();
+ /* Inherits */
- vb2 = memnew(VBoxContainer);
- path_vb = memnew(VBoxContainer);
- vb2->add_child(path_vb);
+ hb = memnew(HBoxContainer);
+ hb->set_h_size_flags(SIZE_EXPAND_FILL);
+ parent_name = memnew(LineEdit);
+ parent_name->connect("text_changed", this, "_parent_name_changed");
+ parent_name->set_h_size_flags(SIZE_EXPAND_FILL);
+ hb->add_child(parent_name);
+ parent_browse_button = memnew(Button);
+ parent_browse_button->set_flat(true);
+ parent_browse_button->connect("pressed", this, "_browse_path", varray(true));
+ hb->add_child(parent_browse_button);
+ l = memnew(Label);
+ l->set_text(TTR("Inherits"));
+ l->set_align(Label::ALIGN_RIGHT);
+ gc->add_child(l);
+ gc->add_child(hb);
+ is_browsing_parent = false;
+
+ /* Class Name */
- HBoxContainer *hbc = memnew(HBoxContainer);
- file_path = memnew(LineEdit);
- file_path->connect("text_changed", this, "_path_changed");
- hbc->add_child(file_path);
- file_path->set_h_size_flags(SIZE_EXPAND_FILL);
- Button *b = memnew(Button);
- b->set_text(" .. ");
- b->connect("pressed", this, "_browse_path");
- hbc->add_child(b);
- path_vb->add_child(hbc);
- path_error_label = memnew(Label);
- path_vb->add_child(path_error_label);
- path_error_label->set_text(TTR("Error!"));
- path_error_label->set_align(Label::ALIGN_CENTER);
+ class_name = memnew(LineEdit);
+ class_name->connect("text_changed", this, "_class_name_changed");
+ class_name->set_h_size_flags(SIZE_EXPAND_FILL);
+ l = memnew(Label);
+ l->set_text(TTR("Class Name"));
+ l->set_align(Label::ALIGN_RIGHT);
+ gc->add_child(l);
+ gc->add_child(class_name);
- internal = memnew(CheckButton);
- internal->set_text(TTR("Built-In Script"));
- vb2->add_child(internal);
- internal->connect("pressed", this, "_built_in_pressed");
+ /* Templates */
- vb->add_margin_child(TTR("Path:"), vb2);
+ template_menu = memnew(OptionButton);
+ l = memnew(Label);
+ l->set_text(TTR("Template"));
+ l->set_align(Label::ALIGN_RIGHT);
+ gc->add_child(l);
+ gc->add_child(template_menu);
+ template_menu->connect("item_selected", this, "_template_changed");
- set_size(Size2(200, 150));
- set_hide_on_ok(false);
- set_title(TTR("Attach Node Script"));
+ /* Built-in Script */
+
+ internal = memnew(CheckButton);
+ internal->connect("pressed", this, "_built_in_pressed");
+ hb = memnew(HBoxContainer);
+ empty = memnew(Control);
+ hb->add_child(internal);
+ hb->add_child(empty);
+ l = memnew(Label);
+ l->set_text(TTR("Built-in Script"));
+ l->set_align(Label::ALIGN_RIGHT);
+ gc->add_child(l);
+ gc->add_child(hb);
+
+ /* Path */
+
+ hb = memnew(HBoxContainer);
+ file_path = memnew(LineEdit);
+ file_path->connect("text_changed", this, "_path_changed");
+ file_path->set_h_size_flags(SIZE_EXPAND_FILL);
+ hb->add_child(file_path);
+ path_button = memnew(Button);
+ path_button->set_flat(true);
+ path_button->connect("pressed", this, "_browse_path", varray(false));
+ hb->add_child(path_button);
+ l = memnew(Label);
+ l->set_text(TTR("Path"));
+ l->set_align(Label::ALIGN_RIGHT);
+ gc->add_child(l);
+ gc->add_child(hb);
+
+ /* Dialog Setup */
file_browse = memnew(EditorFileDialog);
file_browse->connect("file_selected", this, "_file_selected");
add_child(file_browse);
get_ok()->set_text(TTR("Create"));
alert = memnew(AcceptDialog);
+ alert->set_as_minsize();
+ alert->get_label()->set_autowrap(true);
+ alert->get_label()->set_align(Label::ALIGN_CENTER);
+ alert->get_label()->set_valign(Label::VALIGN_CENTER);
+ alert->get_label()->set_custom_minimum_size(Size2(325, 60) * EDSCALE);
add_child(alert);
- _lang_changed(0);
- create_new = true;
+ set_as_minsize();
+ set_hide_on_ok(false);
+ set_title(TTR("Attach Node Script"));
+
+ is_parent_name_valid = false;
+ is_class_name_valid = false;
+ is_path_valid = false;
+
+ has_named_classes = false;
+ can_inherit_from_file = false;
+ is_built_in = false;
+
+ is_new_script_created = true;
}
diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h
index a3ad06dbbf..c8f199b53a 100644
--- a/editor/script_create_dialog.h
+++ b/editor/script_create_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,8 +34,10 @@
#include "editor/editor_settings.h"
#include "scene/gui/check_button.h"
#include "scene/gui/dialogs.h"
+#include "scene/gui/grid_container.h"
#include "scene/gui/line_edit.h"
#include "scene/gui/option_button.h"
+#include "scene/gui/panel_container.h"
class ScriptCreateDialog : public ConfirmationDialog {
GDCLASS(ScriptCreateDialog, ConfirmationDialog);
@@ -43,30 +46,49 @@ class ScriptCreateDialog : public ConfirmationDialog {
Label *error_label;
Label *path_error_label;
LineEdit *parent_name;
+ Button *parent_browse_button;
OptionButton *language_menu;
+ OptionButton *template_menu;
LineEdit *file_path;
+ Button *path_button;
EditorFileDialog *file_browse;
CheckButton *internal;
VBoxContainer *path_vb;
AcceptDialog *alert;
bool path_valid;
bool create_new;
+ bool is_browsing_parent;
String initial_bp;
- EditorSettings *editor_settings;
+ bool is_new_script_created;
+ bool is_path_valid;
+ bool has_named_classes;
+ bool can_inherit_from_file;
+ bool is_parent_name_valid;
+ bool is_class_name_valid;
+ bool is_built_in;
+ int current_language;
+ bool re_check_path;
+ String script_template;
+ Vector<String> template_list;
void _path_changed(const String &p_path = String());
void _lang_changed(int l = 0);
void _built_in_pressed();
- bool _validate(const String &p_strin);
+ bool _validate(const String &p_string);
void _class_name_changed(const String &p_name);
- void _browse_path();
+ void _parent_name_changed(const String &p_parent);
+ void _template_changed(int p_template = 0);
+ void _browse_path(bool browse_parent);
void _file_selected(const String &p_file);
virtual void ok_pressed();
void _create_new();
void _load_exist();
- void _update_controls();
+ void _msg_script_valid(bool valid, const String &p_msg = String());
+ void _msg_path_valid(bool valid, const String &p_msg = String());
+ void _update_dialog();
protected:
+ void _notification(int p_what);
static void _bind_methods();
public:
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index b7a904c255..01cfdc1b57 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,8 +32,8 @@
#include "editor_node.h"
#include "editor_profiler.h"
#include "editor_settings.h"
-#include "global_config.h"
#include "main/performance.h"
+#include "project_settings.h"
#include "property_editor.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/label.h"
@@ -89,11 +90,13 @@ public:
return "";
}
- void add_property(const String &p_name, const Variant &p_value) {
+ void add_property(const String &p_name, const Variant &p_value, const PropertyHint &p_hint, const String p_hint_string) {
PropertyInfo pinfo;
pinfo.name = p_name;
pinfo.type = p_value.get_type();
+ pinfo.hint = p_hint;
+ pinfo.hint_string = p_hint_string;
props.push_back(pinfo);
values[p_name] = p_value;
}
@@ -436,7 +439,11 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
inspected_object->last_edited_id = id;
- inspect_properties->edit(inspected_object);
+ if (tabs->get_current_tab() == 2) {
+ inspect_properties->edit(inspected_object);
+ } else {
+ editor->push_item(inspected_object);
+ }
} else if (p_msg == "message:video_mem") {
@@ -498,13 +505,20 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
String n = p_data[ofs + i * 2 + 0];
Variant v = p_data[ofs + i * 2 + 1];
+ PropertyHint h = PROPERTY_HINT_NONE;
+ String hs = String();
if (n.begins_with("*")) {
n = n.substr(1, n.length());
+ h = PROPERTY_HINT_OBJECT_ID;
+ String s = v;
+ s = s.replace("[", "");
+ hs = s.get_slice(":", 0);
+ v = s.get_slice(":", 1).to_int();
}
- variables->add_property("members/" + n, v);
+ variables->add_property("members/" + n, v, h, hs);
}
ofs += mcount * 2;
@@ -515,13 +529,20 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
String n = p_data[ofs + i * 2 + 0];
Variant v = p_data[ofs + i * 2 + 1];
+ PropertyHint h = PROPERTY_HINT_NONE;
+ String hs = String();
if (n.begins_with("*")) {
n = n.substr(1, n.length());
+ h = PROPERTY_HINT_OBJECT_ID;
+ String s = v;
+ s = s.replace("[", "");
+ hs = s.get_slice(":", 0);
+ v = s.get_slice(":", 1).to_int();
}
- variables->add_property("locals/" + n, v);
+ variables->add_property("locals/" + n, v, h, hs);
}
variables->update();
@@ -616,7 +637,6 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
} else if (p_msg == "profile_sig") {
//cache a signature
- print_line("SIG: " + String(Variant(p_data)));
profiler_signature[p_data[1]] = p_data[0];
} else if (p_msg == "profile_frame" || p_msg == "profile_total") {
@@ -769,19 +789,20 @@ void ScriptEditorDebugger::_performance_draw() {
Point2i p(i % cols, i / cols);
Rect2i r(p * s, s);
- r.pos += Point2(margin, margin);
+ r.position += Point2(margin, margin);
r.size -= Point2(margin, margin) * 2.0;
perf_draw->draw_style_box(graph_sb, r);
- r.pos += graph_sb->get_offset();
+ r.position += graph_sb->get_offset();
r.size -= graph_sb->get_minimum_size();
int pi = which[i];
- Color c = Color(0.7, 0.9, 0.5);
+ Color c = get_color("success_color", "Editor");
c.set_hsv(Math::fmod(c.get_h() + pi * 0.7654, 1), c.get_s(), c.get_v());
+ //c = c.linear_interpolate(get_color("base_color", "Editor"), 0.9);
c.a = 0.8;
- perf_draw->draw_string(graph_font, r.pos + Point2(0, graph_font->get_ascent()), perf_items[pi]->get_text(0), c, r.size.x);
+ perf_draw->draw_string(graph_font, r.position + Point2(0, graph_font->get_ascent()), perf_items[pi]->get_text(0), c, r.size.x);
c.a = 0.6;
- perf_draw->draw_string(graph_font, r.pos + Point2(graph_font->get_char_size('X').width, graph_font->get_ascent() + graph_font->get_height()), perf_items[pi]->get_text(1), c, r.size.y);
+ perf_draw->draw_string(graph_font, r.position + Point2(graph_font->get_char_size('X').width, graph_font->get_ascent() + graph_font->get_height()), perf_items[pi]->get_text(1), c, r.size.y);
float spacing = point_sep / float(cols);
float from = r.size.width;
@@ -798,7 +819,7 @@ void ScriptEditorDebugger::_performance_draw() {
c.a = 0.7;
if (E != perf_history.front())
- perf_draw->draw_line(r.pos + Point2(from, h), r.pos + Point2(from + spacing, prev), c, 2.0);
+ perf_draw->draw_line(r.position + Point2(from, h), r.position + Point2(from + spacing, prev), c, 2.0);
prev = h;
E = E->next();
from -= spacing;
@@ -827,6 +848,8 @@ void ScriptEditorDebugger::_notification(int p_what) {
error_stack->connect("item_selected", this, "_error_stack_selected");
vmem_refresh->set_icon(get_icon("Reload", "EditorIcons"));
+ reason->add_color_override("font_color", get_color("error_color", "Editor"));
+
} break;
case NOTIFICATION_PROCESS: {
@@ -998,6 +1021,11 @@ void ScriptEditorDebugger::_notification(int p_what) {
}
} break;
+ case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+ tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles"));
+ tabs->add_style_override("tab_fg", editor->get_gui_base()->get_stylebox("DebuggerTabFG", "EditorStyles"));
+ tabs->add_style_override("tab_bg", editor->get_gui_base()->get_stylebox("DebuggerTabBG", "EditorStyles"));
+ } break;
}
}
@@ -1009,14 +1037,17 @@ void ScriptEditorDebugger::start() {
EditorNode::get_singleton()->make_bottom_panel_item_visible(this);
}
- uint16_t port = GLOBAL_GET("network/debug/remote_port");
perf_history.clear();
for (int i = 0; i < Performance::MONITOR_MAX; i++) {
perf_max[i] = 0;
}
- server->listen(port);
+ int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
+ if (server->listen(remote_port) != OK) {
+ EditorNode::get_log()->add_message(String("** Error listening on port ") + itos(remote_port) + String(" **"));
+ return;
+ }
set_process(true);
}
@@ -1055,6 +1086,9 @@ void ScriptEditorDebugger::stop() {
EditorNode::get_singleton()->get_pause_button()->set_pressed(false);
EditorNode::get_singleton()->get_pause_button()->set_disabled(true);
+ //avoid confusion when stopped debugging but an object is still edited
+ EditorNode::get_singleton()->push_item(NULL);
+
if (hide_on_stop) {
if (is_visible_in_tree())
EditorNode::get_singleton()->hide_bottom_panel();
@@ -1105,8 +1139,9 @@ void ScriptEditorDebugger::_stack_dump_frame_selected() {
Dictionary d = ti->get_metadata(0);
- Ref<Script> s = ResourceLoader::load(d["file"]);
- emit_signal("goto_script_line", s, int(d["line"]) - 1);
+ stack_script = ResourceLoader::load(d["file"]);
+ emit_signal("goto_script_line", stack_script, int(d["line"]) - 1);
+ stack_script.unref();
ERR_FAIL_COND(connection.is_null());
ERR_FAIL_COND(!connection->is_connected_to_host());
@@ -1490,6 +1525,21 @@ void ScriptEditorDebugger::set_hide_on_stop(bool p_hide) {
hide_on_stop = p_hide;
}
+bool ScriptEditorDebugger::get_debug_with_external_editor() const {
+
+ return enable_external_editor;
+}
+
+void ScriptEditorDebugger::set_debug_with_external_editor(bool p_enabled) {
+
+ enable_external_editor = p_enabled;
+}
+
+Ref<Script> ScriptEditorDebugger::get_dump_stack_script() const {
+
+ return stack_script;
+}
+
void ScriptEditorDebugger::_paused() {
ERR_FAIL_COND(connection.is_null());
@@ -1547,9 +1597,14 @@ void ScriptEditorDebugger::_bind_methods() {
ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
ppeer = Ref<PacketPeerStream>(memnew(PacketPeerStream));
+ ppeer->set_input_buffer_max_size(1024 * 1024 * 8); //8mb should be enough
editor = p_editor;
tabs = memnew(TabContainer);
+ tabs->set_tab_align(TabContainer::ALIGN_LEFT);
+ tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles"));
+ tabs->add_style_override("tab_fg", editor->get_gui_base()->get_stylebox("DebuggerTabFG", "EditorStyles"));
+ tabs->add_style_override("tab_bg", editor->get_gui_base()->get_stylebox("DebuggerTabBG", "EditorStyles"));
tabs->set_v_size_flags(SIZE_EXPAND_FILL);
tabs->set_area_as_parent_rect();
add_child(tabs);
@@ -1563,40 +1618,35 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
HBoxContainer *hbc = memnew(HBoxContainer);
vbc->add_child(hbc);
- reason = memnew(LineEdit);
+ reason = memnew(Label);
reason->set_text("");
- reason->set_editable(false);
hbc->add_child(reason);
- reason->add_color_override("font_color", Color(1, 0.4, 0.0, 0.8));
reason->set_h_size_flags(SIZE_EXPAND_FILL);
- //reason->set_clip_text(true);
hbc->add_child(memnew(VSeparator));
- step = memnew(Button);
+ step = memnew(ToolButton);
hbc->add_child(step);
step->set_tooltip(TTR("Step Into"));
step->connect("pressed", this, "debug_step");
- next = memnew(Button);
+ next = memnew(ToolButton);
hbc->add_child(next);
next->set_tooltip(TTR("Step Over"));
next->connect("pressed", this, "debug_next");
hbc->add_child(memnew(VSeparator));
- dobreak = memnew(Button);
+ dobreak = memnew(ToolButton);
hbc->add_child(dobreak);
dobreak->set_tooltip(TTR("Break"));
dobreak->connect("pressed", this, "debug_break");
- docontinue = memnew(Button);
+ docontinue = memnew(ToolButton);
hbc->add_child(docontinue);
docontinue->set_tooltip(TTR("Continue"));
docontinue->connect("pressed", this, "debug_continue");
- //hbc->add_child( memnew( VSeparator) );
-
back = memnew(Button);
hbc->add_child(back);
back->set_tooltip(TTR("Inspect Previous Instance"));
@@ -1624,8 +1674,9 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
inspector->set_h_size_flags(SIZE_EXPAND_FILL);
inspector->hide_top_label();
inspector->get_scene_tree()->set_column_title(0, TTR("Variable"));
- inspector->set_capitalize_paths(false);
+ inspector->set_enable_capitalize_paths(false);
inspector->set_read_only(true);
+ inspector->connect("object_id_selected", this, "_scene_tree_property_select_object");
sc->add_child(inspector);
server = TCP_Server::create_ref();
@@ -1637,10 +1688,6 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
breaked = false;
tabs->add_child(dbg);
- //tabs->move_child(vbc,0);
-
- hbc = memnew(HBoxContainer);
- vbc->add_child(hbc);
}
{ //errors
@@ -1763,12 +1810,12 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
vmem_total->set_editable(false);
vmem_total->set_custom_minimum_size(Size2(100, 1) * EDSCALE);
vmem_hb->add_child(vmem_total);
- vmem_refresh = memnew(Button);
+ vmem_refresh = memnew(ToolButton);
vmem_hb->add_child(vmem_refresh);
vmem_vb->add_child(vmem_hb);
vmem_refresh->connect("pressed", this, "_video_mem_request");
- MarginContainer *vmmc = memnew(MarginContainer);
+ VBoxContainer *vmmc = memnew(VBoxContainer);
vmem_tree = memnew(Tree);
vmem_tree->set_v_size_flags(SIZE_EXPAND_FILL);
vmem_tree->set_h_size_flags(SIZE_EXPAND_FILL);
@@ -1796,30 +1843,31 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
}
{ // misc
- VBoxContainer *info_left = memnew(VBoxContainer);
- info_left->set_h_size_flags(SIZE_EXPAND_FILL);
+ GridContainer *info_left = memnew(GridContainer);
+ info_left->set_columns(2);
info_left->set_name(TTR("Misc"));
tabs->add_child(info_left);
clicked_ctrl = memnew(LineEdit);
- info_left->add_margin_child(TTR("Clicked Control:"), clicked_ctrl);
+ clicked_ctrl->set_h_size_flags(SIZE_EXPAND_FILL);
+ info_left->add_child(memnew(Label(TTR("Clicked Control:"))));
+ info_left->add_child(clicked_ctrl);
clicked_ctrl_type = memnew(LineEdit);
- info_left->add_margin_child(TTR("Clicked Control Type:"), clicked_ctrl_type);
+ info_left->add_child(memnew(Label(TTR("Clicked Control Type:"))));
+ info_left->add_child(clicked_ctrl_type);
live_edit_root = memnew(LineEdit);
+ live_edit_root->set_h_size_flags(SIZE_EXPAND_FILL);
{
HBoxContainer *lehb = memnew(HBoxContainer);
Label *l = memnew(Label(TTR("Live Edit Root:")));
- lehb->add_child(l);
- l->set_h_size_flags(SIZE_EXPAND_FILL);
+ info_left->add_child(l);
+ lehb->add_child(live_edit_root);
le_set = memnew(Button(TTR("Set From Tree")));
lehb->add_child(le_set);
le_clear = memnew(Button(TTR("Clear")));
lehb->add_child(le_clear);
info_left->add_child(lehb);
- MarginContainer *mc = memnew(MarginContainer);
- mc->add_child(live_edit_root);
- info_left->add_child(mc);
le_set->set_disabled(true);
le_clear->set_disabled(true);
}
@@ -1834,6 +1882,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
last_path_id = false;
error_count = 0;
hide_on_stop = true;
+ enable_external_editor = false;
last_error_count = 0;
EditorNode::get_singleton()->get_pause_button()->connect("pressed", this, "_paused");
diff --git a/editor/script_editor_debugger.h b/editor/script_editor_debugger.h
index 74fbbf8f4b..d255d73167 100644
--- a/editor/script_editor_debugger.h
+++ b/editor/script_editor_debugger.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -83,10 +84,12 @@ class ScriptEditorDebugger : public Control {
int last_error_count;
bool hide_on_stop;
+ bool enable_external_editor;
+ Ref<Script> stack_script;
TabContainer *tabs;
- LineEdit *reason;
+ Label *reason;
ScriptEditorDebuggerVariables *variables;
Button *step;
@@ -200,6 +203,11 @@ public:
void set_hide_on_stop(bool p_hide);
+ bool get_debug_with_external_editor() const;
+ void set_debug_with_external_editor(bool p_enabled);
+
+ Ref<Script> get_dump_stack_script() const;
+
void set_tool_button(Button *p_tb) { debugger_button = p_tb; }
void reload_scripts();
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index 909ed99da6..d455e0cea9 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,8 +32,8 @@
#include "editor_file_system.h"
#include "editor_node.h"
#include "editor_settings.h"
-#include "global_config.h"
#include "os/keyboard.h"
+#include "project_settings.h"
#include "scene/gui/margin_container.h"
void EditorSettingsDialog::ok_pressed() {
@@ -147,7 +148,7 @@ void EditorSettingsDialog::_update_shortcuts() {
if (!sc->has_meta("original"))
continue;
- InputEvent original = sc->get_meta("original");
+ Ref<InputEvent> original = sc->get_meta("original");
String section_name = E->get().get_slice("/", 0);
@@ -169,7 +170,7 @@ void EditorSettingsDialog::_update_shortcuts() {
item->set_text(0, sc->get_name());
item->set_text(1, sc->get_as_text());
- if (!sc->is_shortcut(original) && !(sc->get_shortcut().type == InputEvent::NONE && original.type == InputEvent::NONE)) {
+ if (!sc->is_shortcut(original) && !(sc->get_shortcut().is_null() && original.is_null())) {
item->add_button(1, get_icon("Reload", "EditorIcons"), 2);
}
item->add_button(1, get_icon("Edit", "EditorIcons"), 0);
@@ -198,7 +199,7 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column
if (p_idx == 0) {
press_a_key_label->set_text(TTR("Press a Key.."));
- last_wait_for_key = InputEvent();
+ last_wait_for_key = Ref<InputEventKey>();
press_a_key->popup_centered(Size2(250, 80) * EDSCALE);
press_a_key->grab_focus();
press_a_key->get_ok()->set_focus_mode(FOCUS_NONE);
@@ -211,7 +212,7 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
ur->create_action("Erase Shortcut");
- ur->add_do_method(sc.ptr(), "set_shortcut", InputEvent());
+ ur->add_do_method(sc.ptr(), "set_shortcut", Ref<InputEvent>());
ur->add_undo_method(sc.ptr(), "set_shortcut", sc->get_shortcut());
ur->add_do_method(this, "_update_shortcuts");
ur->add_undo_method(this, "_update_shortcuts");
@@ -222,7 +223,7 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column
if (!sc.is_valid())
return; //pointless, there is nothing
- InputEvent original = sc->get_meta("original");
+ Ref<InputEvent> original = sc->get_meta("original");
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
ur->create_action("Restore Shortcut");
@@ -236,19 +237,21 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column
}
}
-void EditorSettingsDialog::_wait_for_key(const InputEvent &p_event) {
+void EditorSettingsDialog::_wait_for_key(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::KEY && p_event.key.pressed && p_event.key.scancode != 0) {
+ Ref<InputEventKey> k = p_event;
- last_wait_for_key = p_event;
- String str = keycode_get_string(p_event.key.scancode).capitalize();
- if (p_event.key.mod.meta)
+ if (k.is_valid() && k->is_pressed() && k->get_scancode() != 0) {
+
+ last_wait_for_key = k;
+ String str = keycode_get_string(k->get_scancode()).capitalize();
+ if (k->get_metakey())
str = TTR("Meta+") + str;
- if (p_event.key.mod.shift)
+ if (k->get_shift())
str = TTR("Shift+") + str;
- if (p_event.key.mod.alt)
+ if (k->get_alt())
str = TTR("Alt+") + str;
- if (p_event.key.mod.control)
+ if (k->get_control())
str = TTR("Control+") + str;
press_a_key_label->set_text(str);
@@ -258,13 +261,16 @@ void EditorSettingsDialog::_wait_for_key(const InputEvent &p_event) {
void EditorSettingsDialog::_press_a_key_confirm() {
- if (last_wait_for_key.type != InputEvent::KEY)
+ if (last_wait_for_key.is_null())
return;
- InputEvent ie;
- ie.type = InputEvent::KEY;
- ie.key.scancode = last_wait_for_key.key.scancode;
- ie.key.mod = last_wait_for_key.key.mod;
+ Ref<InputEventKey> ie;
+ ie.instance();
+ ie->set_scancode(last_wait_for_key->get_scancode());
+ ie->set_shift(last_wait_for_key->get_shift());
+ ie->set_control(last_wait_for_key->get_control());
+ ie->set_alt(last_wait_for_key->get_alt());
+ ie->set_metakey(last_wait_for_key->get_metakey());
Ref<ShortCut> sc = EditorSettings::get_singleton()->get_shortcut(shortcut_configured);
@@ -299,6 +305,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
set_resizable(true);
tabs = memnew(TabContainer);
+ tabs->set_tab_align(TabContainer::ALIGN_LEFT);
add_child(tabs);
//set_child_rect(tabs);
@@ -325,7 +332,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
property_editor = memnew(SectionedPropertyEditor);
//property_editor->hide_top_label();
property_editor->get_property_editor()->set_use_filter(true);
- property_editor->get_property_editor()->register_text_enter(search_box);
+ property_editor->register_search_box(search_box);
property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
vbc->add_child(property_editor);
property_editor->get_property_editor()->connect("property_edited", this, "_settings_property_edited");
@@ -375,10 +382,6 @@ EditorSettingsDialog::EditorSettingsDialog() {
press_a_key->add_child(l);
press_a_key->connect("gui_input", this, "_wait_for_key");
press_a_key->connect("confirmed", this, "_press_a_key_confirm");
- //Button *load = memnew( Button );
-
- //load->set_text("Load..");
- //hbc->add_child(load);
//get_ok()->set_text("Apply");
set_hide_on_ok(true);
diff --git a/editor/settings_config_dialog.h b/editor/settings_config_dialog.h
index ff6a831fe3..cda191ac36 100644
--- a/editor/settings_config_dialog.h
+++ b/editor/settings_config_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -53,7 +54,7 @@ class EditorSettingsDialog : public AcceptDialog {
ConfirmationDialog *press_a_key;
Label *press_a_key_label;
- InputEvent last_wait_for_key;
+ Ref<InputEventKey> last_wait_for_key;
String shortcut_configured;
String shortcut_filter;
@@ -67,7 +68,7 @@ class EditorSettingsDialog : public AcceptDialog {
void _notification(int p_what);
void _press_a_key_confirm();
- void _wait_for_key(const InputEvent &p_event);
+ void _wait_for_key(const Ref<InputEvent> &p_event);
void _clear_shortcut_search_box();
void _clear_search_box();
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index 8a24ed2b2f..24be2095ce 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -69,11 +70,7 @@ void EditorSpatialGizmo::redraw() {
void EditorSpatialGizmo::Instance::create_instance(Spatial *p_base) {
instance = VS::get_singleton()->instance_create2(mesh->get_rid(), p_base->get_world()->get_scenario());
- VS::get_singleton()->instance_attach_object_instance_ID(instance, p_base->get_instance_ID());
- if (billboard)
- VS::get_singleton()->instance_geometry_set_flag(instance, VS::INSTANCE_FLAG_BILLBOARD, true);
- if (unscaled)
- VS::get_singleton()->instance_geometry_set_flag(instance, VS::INSTANCE_FLAG_DEPH_SCALE, true);
+ VS::get_singleton()->instance_attach_object_instance_id(instance, p_base->get_instance_id());
if (skeleton.is_valid())
VS::get_singleton()->instance_attach_skeleton(instance, skeleton);
if (extra_margin)
@@ -82,7 +79,7 @@ void EditorSpatialGizmo::Instance::create_instance(Spatial *p_base) {
VS::get_singleton()->instance_set_layer_mask(instance, 1 << SpatialEditorViewport::GIZMO_EDIT_LAYER); //gizmos are 26
}
-void EditorSpatialGizmo::add_mesh(const Ref<Mesh> &p_mesh, bool p_billboard, const RID &p_skeleton) {
+void EditorSpatialGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard, const RID &p_skeleton) {
ERR_FAIL_COND(!spatial_node);
Instance ins;
@@ -103,7 +100,7 @@ void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mat
ERR_FAIL_COND(!spatial_node);
Instance ins;
- Ref<Mesh> mesh = memnew(Mesh);
+ Ref<ArrayMesh> mesh = memnew(ArrayMesh);
Array a;
a.resize(Mesh::ARRAY_MAX);
@@ -165,7 +162,7 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material> &p_material,
uv.push_back(Vector2(0, 1));
uv.push_back(Vector2(1, 1));
- Ref<Mesh> mesh = memnew(Mesh);
+ Ref<ArrayMesh> mesh = memnew(ArrayMesh);
Array a;
a.resize(Mesh::ARRAY_MAX);
a[Mesh::ARRAY_VERTEX] = vs;
@@ -222,13 +219,12 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, bool p_bi
ERR_FAIL_COND(!spatial_node);
Instance ins;
- Ref<Mesh> mesh = memnew(Mesh);
+ Ref<ArrayMesh> mesh = memnew(ArrayMesh);
#if 1
Array a;
a.resize(VS::ARRAY_MAX);
a[VS::ARRAY_VERTEX] = p_handles;
- print_line("handles?: " + itos(p_handles.size()));
PoolVector<Color> colors;
{
colors.resize(p_handles.size());
@@ -243,7 +239,10 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, bool p_bi
}
a[VS::ARRAY_COLOR] = colors;
mesh->add_surface_from_arrays(Mesh::PRIMITIVE_POINTS, a);
- mesh->surface_set_material(0, SpatialEditorGizmos::singleton->handle2_material);
+ if (p_billboard)
+ mesh->surface_set_material(0, SpatialEditorGizmos::singleton->handle2_material_billboard);
+ else
+ mesh->surface_set_material(0, SpatialEditorGizmos::singleton->handle2_material);
if (p_billboard) {
float md = 0;
@@ -390,7 +389,7 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera, const Point2 &p_p
Transform t = spatial_node->get_global_transform();
t.orthonormalize();
if (billboard_handle) {
- t.set_look_at(t.origin, t.origin + p_camera->get_transform().basis.get_axis(2), p_camera->get_transform().basis.get_axis(1));
+ t.set_look_at(t.origin, t.origin - p_camera->get_transform().basis.get_axis(2), p_camera->get_transform().basis.get_axis(1));
}
float min_d = 1e20;
@@ -452,7 +451,7 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera, const Point2 &p_p
const Vector3 *vptr = collision_segments.ptr();
Transform t = spatial_node->get_global_transform();
if (billboard_handle) {
- t.set_look_at(t.origin, t.origin + p_camera->get_transform().basis.get_axis(2), p_camera->get_transform().basis.get_axis(1));
+ t.set_look_at(t.origin, t.origin - p_camera->get_transform().basis.get_axis(2), p_camera->get_transform().basis.get_axis(1));
}
Vector3 cp;
@@ -504,7 +503,7 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera, const Point2 &p_p
Transform gt = spatial_node->get_global_transform();
if (billboard_handle) {
- gt.set_look_at(gt.origin, gt.origin + p_camera->get_transform().basis.get_axis(2), p_camera->get_transform().basis.get_axis(1));
+ gt.set_look_at(gt.origin, gt.origin - p_camera->get_transform().basis.get_axis(2), p_camera->get_transform().basis.get_axis(1));
}
Transform ai = gt.affine_inverse();
@@ -563,13 +562,13 @@ void EditorSpatialGizmo::free() {
void EditorSpatialGizmo::_bind_methods() {
- 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_lines", "lines", "material", "billboard"), &EditorSpatialGizmo::add_lines, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("add_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_collision_triangles", "triangles"), &EditorSpatialGizmo::add_collision_triangles);
+ ClassDB::bind_method(D_METHOD("add_unscaled_billboard", "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("set_spatial_node", "node"), &EditorSpatialGizmo::_set_spatial_node);
ClassDB::bind_method(D_METHOD("clear"), &EditorSpatialGizmo::clear);
BIND_VMETHOD(MethodInfo("redraw"));
@@ -777,7 +776,7 @@ void LightSpatialGizmo::redraw() {
points.push_back(Vector3(b.x, b.y, 0));
}
- add_lines(points, SpatialEditorGizmos::singleton->light_material, true);
+ add_lines(points, SpatialEditorGizmos::singleton->light_material_omni, true);
add_collision_segments(points);
add_unscaled_billboard(SpatialEditorGizmos::singleton->light_material_omni_icon, 0.05);
@@ -868,6 +867,127 @@ LightSpatialGizmo::LightSpatialGizmo(Light *p_light) {
//////
+//// player gizmo
+
+String AudioStreamPlayer3DSpatialGizmo::get_handle_name(int p_idx) const {
+
+ return "Emission Radius";
+}
+
+Variant AudioStreamPlayer3DSpatialGizmo::get_handle_value(int p_idx) const {
+
+ return player->get_emission_angle();
+}
+
+void AudioStreamPlayer3DSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_point) {
+
+ Transform gt = player->get_global_transform();
+ gt.orthonormalize();
+ Transform gi = gt.affine_inverse();
+
+ Vector3 ray_from = p_camera->project_ray_origin(p_point);
+ Vector3 ray_dir = p_camera->project_ray_normal(p_point);
+ Vector3 ray_to = ray_from + ray_dir * 4096;
+
+ ray_from = gi.xform(ray_from);
+ ray_to = gi.xform(ray_to);
+
+ float closest_dist = 1e20;
+ float closest_angle = 1e20;
+
+ for (int i = 0; i < 180; i++) {
+
+ float a = i * Math_PI / 180.0;
+ float an = (i + 1) * Math_PI / 180.0;
+
+ Vector3 from(Math::sin(a), 0, -Math::cos(a));
+ Vector3 to(Math::sin(an), 0, -Math::cos(an));
+
+ Vector3 r1, r2;
+ Geometry::get_closest_points_between_segments(from, to, ray_from, ray_to, r1, r2);
+ float d = r1.distance_to(r2);
+ if (d < closest_dist) {
+ closest_dist = d;
+ closest_angle = i;
+ }
+ }
+
+ if (closest_angle < 91) {
+ player->set_emission_angle(closest_angle);
+ }
+}
+
+void AudioStreamPlayer3DSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) {
+
+ if (p_cancel) {
+
+ player->set_emission_angle(p_restore);
+
+ } else {
+
+ UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ ur->create_action(TTR("Change AudioStreamPlayer3D Emission Angle"));
+ ur->add_do_method(player, "set_emission_angle", player->get_emission_angle());
+ ur->add_undo_method(player, "set_emission_angle", p_restore);
+ ur->commit_action();
+ }
+}
+
+void AudioStreamPlayer3DSpatialGizmo::redraw() {
+
+ clear();
+
+ if (player->is_emission_angle_enabled()) {
+ float pc = player->get_emission_angle();
+
+ Vector<Vector3> points;
+ points.resize(208);
+
+ float ofs = -Math::cos(Math::deg2rad(pc));
+ float radius = Math::sin(Math::deg2rad(pc));
+
+ for (int i = 0; i < 100; i++) {
+
+ float a = i * 2.0 * Math_PI / 100.0;
+ float an = (i + 1) * 2.0 * Math_PI / 100.0;
+
+ Vector3 from(Math::sin(a) * radius, Math::cos(a) * radius, ofs);
+ Vector3 to(Math::sin(an) * radius, Math::cos(an) * radius, ofs);
+
+ points[i * 2 + 0] = from;
+ points[i * 2 + 1] = to;
+ }
+
+ for (int i = 0; i < 4; i++) {
+
+ float a = i * 2.0 * Math_PI / 4.0;
+
+ Vector3 from(Math::sin(a) * radius, Math::cos(a) * radius, ofs);
+
+ points[200 + i * 2 + 0] = from;
+ points[200 + i * 2 + 1] = Vector3();
+ }
+
+ add_lines(points, SpatialEditorGizmos::singleton->car_wheel_material);
+ add_collision_segments(points);
+
+ Vector<Vector3> handles;
+ float ha = Math::deg2rad(player->get_emission_angle());
+ handles.push_back(Vector3(Math::sin(ha), 0, -Math::cos(ha)));
+ add_handles(handles);
+ }
+
+ add_unscaled_billboard(SpatialEditorGizmos::singleton->sample_player_icon, 0.05);
+}
+
+AudioStreamPlayer3DSpatialGizmo::AudioStreamPlayer3DSpatialGizmo(AudioStreamPlayer3D *p_player) {
+
+ player = p_player;
+ set_spatial_node(p_player);
+}
+
+//////
+
String CameraSpatialGizmo::get_handle_name(int p_idx) const {
if (camera->get_projection() == Camera::PROJECTION_PERSPECTIVE) {
@@ -1030,7 +1150,7 @@ CameraSpatialGizmo::CameraSpatialGizmo(Camera *p_camera) {
void MeshInstanceSpatialGizmo::redraw() {
- Ref<Mesh> m = mesh->get_mesh();
+ Ref<ArrayMesh> m = mesh->get_mesh();
if (!m.is_valid())
return; //none
@@ -1249,7 +1369,7 @@ void SkeletonSpatialGizmo::redraw() {
*/
}
- Ref<Mesh> m = surface_tool->commit();
+ Ref<ArrayMesh> m = surface_tool->commit();
add_mesh(m, false, skel->get_skeleton());
}
@@ -1280,8 +1400,8 @@ void RoomSpatialGizmo::redraw() {
for (int j = 0; j < 3; j++) {
_EdgeKey ek;
- ek.from = r[i].vertex[j].snapped(CMP_EPSILON);
- ek.to = r[i].vertex[(j + 1) % 3].snapped(CMP_EPSILON);
+ ek.from = r[i].vertex[j].snapped(Vector3(CMP_EPSILON, CMP_EPSILON, CMP_EPSILON));
+ ek.to = r[i].vertex[(j + 1) % 3].snapped(Vector3(CMP_EPSILON, CMP_EPSILON, CMP_EPSILON));
if (ek.from < ek.to)
SWAP(ek.from, ek.to);
@@ -1440,20 +1560,6 @@ VehicleWheelSpatialGizmo::VehicleWheelSpatialGizmo(VehicleWheel *p_car_wheel) {
car_wheel = p_car_wheel;
}
-///
-
-void TestCubeSpatialGizmo::redraw() {
-
- clear();
- add_collision_triangles(SpatialEditorGizmos::singleton->test_cube_tm);
-}
-
-TestCubeSpatialGizmo::TestCubeSpatialGizmo(TestCube *p_tc) {
-
- tc = p_tc;
- set_spatial_node(p_tc);
-}
-
///////////
String CollisionShapeSpatialGizmo::get_handle_name(int p_idx) const {
@@ -1723,8 +1829,8 @@ void CollisionShapeSpatialGizmo::redraw() {
Ref<BoxShape> bs = s;
Vector<Vector3> lines;
Rect3 aabb;
- aabb.pos = -bs->get_extents();
- aabb.size = aabb.pos * -2;
+ aabb.position = -bs->get_extents();
+ aabb.size = aabb.position * -2;
for (int i = 0; i < 12; i++) {
Vector3 a, b;
@@ -1954,7 +2060,7 @@ void VisibilityNotifierGizmo::set_handle(int p_idx, Camera *p_camera, const Poin
Vector3 ray_dir = p_camera->project_ray_normal(p_point);
Vector3 sg[2] = { gi.xform(ray_from), gi.xform(ray_from + ray_dir * 4096) };
- Vector3 ofs = aabb.pos + aabb.size * 0.5;
+ Vector3 ofs = aabb.position + aabb.size * 0.5;
Vector3 axis;
axis[p_idx] = 1.0;
@@ -1965,7 +2071,7 @@ void VisibilityNotifierGizmo::set_handle(int p_idx, Camera *p_camera, const Poin
if (d < 0.001)
d = 0.001;
- aabb.pos[p_idx] = (aabb.pos[p_idx] + aabb.size[p_idx] * 0.5) - d;
+ aabb.position[p_idx] = (aabb.position[p_idx] + aabb.size[p_idx] * 0.5) - d;
aabb.size[p_idx] = d * 2;
notifier->set_aabb(aabb);
}
@@ -2003,7 +2109,7 @@ void VisibilityNotifierGizmo::redraw() {
for (int i = 0; i < 3; i++) {
Vector3 ax;
- ax[i] = aabb.pos[i] + aabb.size[i];
+ ax[i] = aabb.position[i] + aabb.size[i];
handles.push_back(ax);
}
@@ -2022,6 +2128,131 @@ VisibilityNotifierGizmo::VisibilityNotifierGizmo(VisibilityNotifier *p_notifier)
///
+String ParticlesGizmo::get_handle_name(int p_idx) const {
+
+ switch (p_idx) {
+ case 0: return "Size X";
+ case 1: return "Size Y";
+ case 2: return "Size Z";
+ case 3: return "Pos X";
+ case 4: return "Pos Y";
+ case 5: return "Pos Z";
+ }
+
+ return "";
+}
+Variant ParticlesGizmo::get_handle_value(int p_idx) const {
+
+ return particles->get_visibility_aabb();
+}
+void ParticlesGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_point) {
+
+ Transform gt = particles->get_global_transform();
+ //gt.orthonormalize();
+ Transform gi = gt.affine_inverse();
+
+ bool move = p_idx >= 3;
+ p_idx = p_idx % 3;
+
+ Rect3 aabb = particles->get_visibility_aabb();
+ Vector3 ray_from = p_camera->project_ray_origin(p_point);
+ Vector3 ray_dir = p_camera->project_ray_normal(p_point);
+
+ Vector3 sg[2] = { gi.xform(ray_from), gi.xform(ray_from + ray_dir * 4096) };
+
+ Vector3 ofs = aabb.position + aabb.size * 0.5;
+
+ Vector3 axis;
+ axis[p_idx] = 1.0;
+
+ if (move) {
+
+ Vector3 ra, rb;
+ Geometry::get_closest_points_between_segments(ofs - axis * 4096, ofs + axis * 4096, sg[0], sg[1], ra, rb);
+
+ float d = ra[p_idx];
+
+ aabb.position[p_idx] = d - 1.0 - aabb.size[p_idx] * 0.5;
+ particles->set_visibility_aabb(aabb);
+
+ } else {
+ Vector3 ra, rb;
+ Geometry::get_closest_points_between_segments(ofs, ofs + axis * 4096, sg[0], sg[1], ra, rb);
+
+ float d = ra[p_idx] - ofs[p_idx];
+ if (d < 0.001)
+ d = 0.001;
+ //resize
+ aabb.position[p_idx] = (aabb.position[p_idx] + aabb.size[p_idx] * 0.5) - d;
+ aabb.size[p_idx] = d * 2;
+ particles->set_visibility_aabb(aabb);
+ }
+}
+
+void ParticlesGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) {
+
+ if (p_cancel) {
+ particles->set_visibility_aabb(p_restore);
+ return;
+ }
+
+ UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ ur->create_action(TTR("Change Particles AABB"));
+ ur->add_do_method(particles, "set_custom_aabb", particles->get_visibility_aabb());
+ ur->add_undo_method(particles, "set_custom_aabb", p_restore);
+ ur->commit_action();
+}
+
+void ParticlesGizmo::redraw() {
+
+ clear();
+
+ Vector<Vector3> lines;
+ Rect3 aabb = particles->get_visibility_aabb();
+
+ for (int i = 0; i < 12; i++) {
+ Vector3 a, b;
+ aabb.get_edge(i, a, b);
+ lines.push_back(a);
+ lines.push_back(b);
+ }
+
+ Vector<Vector3> handles;
+
+ for (int i = 0; i < 3; i++) {
+
+ Vector3 ax;
+ ax[i] = aabb.position[i] + aabb.size[i];
+ ax[(i + 1) % 3] = aabb.position[(i + 1) % 3] + aabb.size[(i + 1) % 3] * 0.5;
+ ax[(i + 2) % 3] = aabb.position[(i + 2) % 3] + aabb.size[(i + 2) % 3] * 0.5;
+ handles.push_back(ax);
+ }
+
+ Vector3 center = aabb.position + aabb.size * 0.5;
+ for (int i = 0; i < 3; i++) {
+
+ Vector3 ax;
+ ax[i] = 1.0;
+ handles.push_back(center + ax);
+ lines.push_back(center);
+ lines.push_back(center + ax);
+ }
+
+ add_lines(lines, SpatialEditorGizmos::singleton->particles_material);
+ add_collision_segments(lines);
+ //add_unscaled_billboard(SpatialEditorGizmos::singleton->visi,0.05);
+ add_handles(handles);
+}
+ParticlesGizmo::ParticlesGizmo(Particles *p_particles) {
+
+ particles = p_particles;
+ set_spatial_node(p_particles);
+}
+
+////////
+
+///
+
String ReflectionProbeGizmo::get_handle_name(int p_idx) const {
switch (p_idx) {
@@ -2094,7 +2325,7 @@ void ReflectionProbeGizmo::commit_handle(int p_idx, const Variant &p_restore, bo
Rect3 restore = p_restore;
if (p_cancel) {
- probe->set_extents(restore.pos);
+ probe->set_extents(restore.position);
probe->set_origin_offset(restore.size);
return;
}
@@ -2103,7 +2334,7 @@ void ReflectionProbeGizmo::commit_handle(int p_idx, const Variant &p_restore, bo
ur->create_action(TTR("Change Probe Extents"));
ur->add_do_method(probe, "set_extents", probe->get_extents());
ur->add_do_method(probe, "set_origin_offset", probe->get_origin_offset());
- ur->add_undo_method(probe, "set_extents", restore.pos);
+ ur->add_undo_method(probe, "set_extents", restore.position);
ur->add_undo_method(probe, "set_origin_offset", restore.size);
ur->commit_action();
}
@@ -2117,7 +2348,7 @@ void ReflectionProbeGizmo::redraw() {
Vector3 extents = probe->get_extents();
Rect3 aabb;
- aabb.pos = -extents;
+ aabb.position = -extents;
aabb.size = extents * 2;
for (int i = 0; i < 12; i++) {
@@ -2138,7 +2369,7 @@ void ReflectionProbeGizmo::redraw() {
for (int i = 0; i < 3; i++) {
Vector3 ax;
- ax[i] = aabb.pos[i] + aabb.size[i];
+ ax[i] = aabb.position[i] + aabb.size[i];
handles.push_back(ax);
}
@@ -2268,7 +2499,7 @@ void GIProbeGizmo::redraw() {
for (int k = 0; k < 4; k++) {
- Vector3 from = aabb.pos, to = aabb.pos;
+ Vector3 from = aabb.position, to = aabb.position;
from[j] += cell_size * i;
to[j] += cell_size * i;
@@ -2297,7 +2528,7 @@ void GIProbeGizmo::redraw() {
for (int i = 0; i < 3; i++) {
Vector3 ax;
- ax[i] = aabb.pos[i] + aabb.size[i];
+ ax[i] = aabb.position[i] + aabb.size[i];
handles.push_back(ax);
}
@@ -2353,8 +2584,8 @@ void NavigationMeshSpatialGizmo::redraw() {
tw[tidx++] = f.vertex[j];
_EdgeKey ek;
- ek.from = f.vertex[j].snapped(CMP_EPSILON);
- ek.to = f.vertex[(j + 1) % 3].snapped(CMP_EPSILON);
+ ek.from = f.vertex[j].snapped(Vector3(CMP_EPSILON, CMP_EPSILON, CMP_EPSILON));
+ ek.to = f.vertex[(j + 1) % 3].snapped(Vector3(CMP_EPSILON, CMP_EPSILON, CMP_EPSILON));
if (ek.from < ek.to)
SWAP(ek.from, ek.to);
@@ -2387,7 +2618,7 @@ void NavigationMeshSpatialGizmo::redraw() {
if (lines.size())
add_lines(lines, navmesh->is_enabled() ? SpatialEditorGizmos::singleton->navmesh_edge_material : SpatialEditorGizmos::singleton->navmesh_edge_material_disabled);
add_collision_triangles(tmesh);
- Ref<Mesh> m = memnew(Mesh);
+ Ref<ArrayMesh> m = memnew(ArrayMesh);
Array a;
a.resize(Mesh::ARRAY_MAX);
a[0] = tmeshfaces;
@@ -2921,12 +3152,6 @@ Ref<SpatialEditorGizmo> SpatialEditorGizmos::get_gizmo(Spatial *p_spatial) {
return misg;
}
- if (p_spatial->cast_to<TestCube>()) {
-
- Ref<TestCubeSpatialGizmo> misg = memnew(TestCubeSpatialGizmo(p_spatial->cast_to<TestCube>()));
- return misg;
- }
-
if (p_spatial->cast_to<CollisionShape>()) {
Ref<CollisionShapeSpatialGizmo> misg = memnew(CollisionShapeSpatialGizmo(p_spatial->cast_to<CollisionShape>()));
@@ -2939,6 +3164,12 @@ Ref<SpatialEditorGizmo> SpatialEditorGizmos::get_gizmo(Spatial *p_spatial) {
return misg;
}
+ if (p_spatial->cast_to<Particles>()) {
+
+ Ref<ParticlesGizmo> misg = memnew(ParticlesGizmo(p_spatial->cast_to<Particles>()));
+ return misg;
+ }
+
if (p_spatial->cast_to<ReflectionProbe>()) {
Ref<ReflectionProbeGizmo> misg = memnew(ReflectionProbeGizmo(p_spatial->cast_to<ReflectionProbe>()));
@@ -2991,27 +3222,33 @@ Ref<SpatialEditorGizmo> SpatialEditorGizmos::get_gizmo(Spatial *p_spatial) {
return misg;
}
+ if (p_spatial->cast_to<AudioStreamPlayer3D>()) {
+
+ Ref<AudioStreamPlayer3DSpatialGizmo> misg = memnew(AudioStreamPlayer3DSpatialGizmo(p_spatial->cast_to<AudioStreamPlayer3D>()));
+ return misg;
+ }
+
return Ref<SpatialEditorGizmo>();
}
-Ref<FixedSpatialMaterial> SpatialEditorGizmos::create_line_material(const Color &p_base_color) {
+Ref<SpatialMaterial> SpatialEditorGizmos::create_line_material(const Color &p_base_color) {
- Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- line_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ Ref<SpatialMaterial> line_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
line_material->set_line_width(3.0);
- line_material->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
- //line_material->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- //->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ line_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ //line_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ //->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
line_material->set_albedo(p_base_color);
return line_material;
}
-Ref<FixedSpatialMaterial> SpatialEditorGizmos::create_solid_material(const Color &p_base_color) {
+Ref<SpatialMaterial> SpatialEditorGizmos::create_solid_material(const Color &p_base_color) {
- Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- line_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- line_material->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ Ref<SpatialMaterial> line_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ line_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
line_material->set_albedo(p_base_color);
return line_material;
@@ -3021,62 +3258,69 @@ SpatialEditorGizmos::SpatialEditorGizmos() {
singleton = this;
- handle_material = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- handle_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ handle_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ handle_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
handle_material->set_albedo(Color(0.8, 0.8, 0.8));
+ handle_material_billboard = handle_material->duplicate();
+ handle_material_billboard->set_billboard_mode(SpatialMaterial::BILLBOARD_ENABLED);
- handle2_material = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- handle2_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- handle2_material->set_flag(FixedSpatialMaterial::FLAG_USE_POINT_SIZE, true);
+ handle2_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ handle2_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ handle2_material->set_flag(SpatialMaterial::FLAG_USE_POINT_SIZE, true);
handle_t = SpatialEditor::get_singleton()->get_icon("Editor3DHandle", "EditorIcons");
handle2_material->set_point_size(handle_t->get_width());
- handle2_material->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO, handle_t);
+ handle2_material->set_texture(SpatialMaterial::TEXTURE_ALBEDO, handle_t);
handle2_material->set_albedo(Color(1, 1, 1));
- handle2_material->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
- handle2_material->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- handle2_material->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ handle2_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ handle2_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ handle2_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ handle2_material_billboard = handle2_material->duplicate();
+ handle2_material_billboard->set_billboard_mode(SpatialMaterial::BILLBOARD_ENABLED);
light_material = create_line_material(Color(1, 1, 0.2));
-
- light_material_omni_icon = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- light_material_omni_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- light_material_omni_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
- light_material_omni_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
- light_material_omni_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ light_material_omni = create_line_material(Color(1, 1, 0.2));
+ light_material_omni->set_billboard_mode(SpatialMaterial::BILLBOARD_ENABLED);
+
+ light_material_omni_icon = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ light_material_omni_icon->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ light_material_omni_icon->set_cull_mode(SpatialMaterial::CULL_DISABLED);
+ light_material_omni_icon->set_depth_draw_mode(SpatialMaterial::DEPTH_DRAW_DISABLED);
+ light_material_omni_icon->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
light_material_omni_icon->set_albedo(Color(1, 1, 1, 0.9));
- light_material_omni_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoLight", "EditorIcons"));
-
- light_material_directional_icon = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- light_material_directional_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- light_material_directional_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
- light_material_directional_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
- light_material_directional_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ light_material_omni_icon->set_texture(SpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoLight", "EditorIcons"));
+ light_material_omni_icon->set_flag(SpatialMaterial::FLAG_FIXED_SIZE, true);
+
+ light_material_directional_icon = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ light_material_directional_icon->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ light_material_directional_icon->set_cull_mode(SpatialMaterial::CULL_DISABLED);
+ light_material_directional_icon->set_depth_draw_mode(SpatialMaterial::DEPTH_DRAW_DISABLED);
+ light_material_directional_icon->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
light_material_directional_icon->set_albedo(Color(1, 1, 1, 0.9));
- light_material_directional_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoDirectionalLight", "EditorIcons"));
+ light_material_directional_icon->set_texture(SpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoDirectionalLight", "EditorIcons"));
camera_material = create_line_material(Color(1.0, 0.5, 1.0));
navmesh_edge_material = create_line_material(Color(0.1, 0.8, 1.0));
navmesh_solid_material = create_solid_material(Color(0.1, 0.8, 1.0, 0.4));
- navmesh_edge_material->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, false);
- navmesh_edge_material->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, false);
- navmesh_solid_material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
+ navmesh_edge_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, false);
+ navmesh_edge_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, false);
+ navmesh_solid_material->set_cull_mode(SpatialMaterial::CULL_DISABLED);
navmesh_edge_material_disabled = create_line_material(Color(1.0, 0.8, 0.1));
navmesh_solid_material_disabled = create_solid_material(Color(1.0, 0.8, 0.1, 0.4));
- navmesh_edge_material_disabled->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, false);
- navmesh_edge_material_disabled->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, false);
- navmesh_solid_material_disabled->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
+ navmesh_edge_material_disabled->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, false);
+ navmesh_edge_material_disabled->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, false);
+ navmesh_solid_material_disabled->set_cull_mode(SpatialMaterial::CULL_DISABLED);
skeleton_material = create_line_material(Color(0.6, 1.0, 0.3));
- skeleton_material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
- skeleton_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- skeleton_material->set_flag(FixedSpatialMaterial::FLAG_ONTOP, true);
- skeleton_material->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
+ skeleton_material->set_cull_mode(SpatialMaterial::CULL_DISABLED);
+ skeleton_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ skeleton_material->set_flag(SpatialMaterial::FLAG_ONTOP, true);
+ skeleton_material->set_depth_draw_mode(SpatialMaterial::DEPTH_DRAW_DISABLED);
//position 3D Shared mesh
- pos3d_mesh = Ref<Mesh>(memnew(Mesh));
+ pos3d_mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
{
PoolVector<Vector3> cursor_points;
@@ -3095,11 +3339,11 @@ SpatialEditorGizmos::SpatialEditorGizmos() {
cursor_colors.push_back(Color(0.5, 0.5, 1, 0.7));
cursor_colors.push_back(Color(0.5, 0.5, 1, 0.7));
- Ref<FixedSpatialMaterial> mat = memnew(FixedSpatialMaterial);
- mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
- mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ Ref<SpatialMaterial> mat = memnew(SpatialMaterial);
+ mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
mat->set_line_width(3);
Array d;
d.resize(VS::ARRAY_MAX);
@@ -3109,7 +3353,7 @@ SpatialEditorGizmos::SpatialEditorGizmos() {
pos3d_mesh->surface_set_material(0, mat);
}
- listener_line_mesh = Ref<Mesh>(memnew(Mesh));
+ listener_line_mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
{
PoolVector<Vector3> cursor_points;
@@ -3119,11 +3363,11 @@ SpatialEditorGizmos::SpatialEditorGizmos() {
cursor_colors.push_back(Color(0.5, 0.5, 0.5, 0.7));
cursor_colors.push_back(Color(0.5, 0.5, 0.5, 0.7));
- Ref<FixedSpatialMaterial> mat = memnew(FixedSpatialMaterial);
- mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
- mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ Ref<SpatialMaterial> mat = memnew(SpatialMaterial);
+ mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
mat->set_line_width(3);
Array d;
d.resize(VS::ARRAY_MAX);
@@ -3133,48 +3377,49 @@ SpatialEditorGizmos::SpatialEditorGizmos() {
listener_line_mesh->surface_set_material(0, mat);
}
- sample_player_icon = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- sample_player_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- sample_player_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
- sample_player_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
- sample_player_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ sample_player_icon = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ sample_player_icon->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ sample_player_icon->set_cull_mode(SpatialMaterial::CULL_DISABLED);
+ sample_player_icon->set_depth_draw_mode(SpatialMaterial::DEPTH_DRAW_DISABLED);
+ sample_player_icon->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
sample_player_icon->set_albedo(Color(1, 1, 1, 0.9));
- sample_player_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoSpatialSamplePlayer", "EditorIcons"));
+ sample_player_icon->set_texture(SpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoSpatialSamplePlayer", "EditorIcons"));
room_material = create_line_material(Color(1.0, 0.6, 0.9));
portal_material = create_line_material(Color(1.0, 0.8, 0.6));
raycast_material = create_line_material(Color(1.0, 0.8, 0.6));
car_wheel_material = create_line_material(Color(0.6, 0.8, 1.0));
visibility_notifier_material = create_line_material(Color(1.0, 0.5, 1.0));
+ particles_material = create_line_material(Color(1.0, 1.0, 0.5));
reflection_probe_material = create_line_material(Color(0.5, 1.0, 0.7));
reflection_probe_material_internal = create_line_material(Color(0.3, 0.8, 0.5, 0.15));
gi_probe_material = create_line_material(Color(0.7, 1.0, 0.5));
gi_probe_material_internal = create_line_material(Color(0.5, 0.8, 0.3, 0.1));
joint_material = create_line_material(Color(0.6, 0.8, 1.0));
- stream_player_icon = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- stream_player_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- stream_player_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
- stream_player_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
- stream_player_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ stream_player_icon = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ stream_player_icon->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ stream_player_icon->set_cull_mode(SpatialMaterial::CULL_DISABLED);
+ stream_player_icon->set_depth_draw_mode(SpatialMaterial::DEPTH_DRAW_DISABLED);
+ stream_player_icon->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
stream_player_icon->set_albedo(Color(1, 1, 1, 0.9));
- stream_player_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoSpatialStreamPlayer", "EditorIcons"));
+ stream_player_icon->set_texture(SpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoSpatialStreamPlayer", "EditorIcons"));
- visibility_notifier_icon = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- visibility_notifier_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- visibility_notifier_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
- visibility_notifier_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
- visibility_notifier_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ visibility_notifier_icon = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ visibility_notifier_icon->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ visibility_notifier_icon->set_cull_mode(SpatialMaterial::CULL_DISABLED);
+ visibility_notifier_icon->set_depth_draw_mode(SpatialMaterial::DEPTH_DRAW_DISABLED);
+ visibility_notifier_icon->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
visibility_notifier_icon->set_albedo(Color(1, 1, 1, 0.9));
- visibility_notifier_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("Visible", "EditorIcons"));
+ visibility_notifier_icon->set_texture(SpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("Visible", "EditorIcons"));
- listener_icon = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- listener_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- listener_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
- listener_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
- listener_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ listener_icon = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ listener_icon->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ listener_icon->set_cull_mode(SpatialMaterial::CULL_DISABLED);
+ listener_icon->set_depth_draw_mode(SpatialMaterial::DEPTH_DRAW_DISABLED);
+ listener_icon->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
listener_icon->set_albedo(Color(1, 1, 1, 0.9));
- listener_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoListener", "EditorIcons"));
+ listener_icon->set_texture(SpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoListener", "EditorIcons"));
{
diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h
index 76564c5a99..28feee3fcc 100644
--- a/editor/spatial_editor_gizmos.h
+++ b/editor/spatial_editor_gizmos.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,24 +31,24 @@
#define SPATIAL_EDITOR_GIZMOS_H
#include "editor/plugins/spatial_editor_plugin.h"
-#include "scene/3d/body_shape.h"
+#include "scene/3d/audio_stream_player_3d.h"
#include "scene/3d/camera.h"
+#include "scene/3d/collision_polygon.h"
+#include "scene/3d/collision_shape.h"
#include "scene/3d/gi_probe.h"
#include "scene/3d/light.h"
#include "scene/3d/listener.h"
#include "scene/3d/mesh_instance.h"
#include "scene/3d/navigation_mesh.h"
+#include "scene/3d/particles.h"
+#include "scene/3d/physics_joint.h"
#include "scene/3d/portal.h"
#include "scene/3d/position_3d.h"
#include "scene/3d/ray_cast.h"
#include "scene/3d/reflection_probe.h"
#include "scene/3d/room_instance.h"
-#include "scene/3d/test_cube.h"
-#include "scene/3d/visibility_notifier.h"
-
-#include "scene/3d/collision_polygon.h"
-#include "scene/3d/physics_joint.h"
#include "scene/3d/vehicle_body.h"
+#include "scene/3d/visibility_notifier.h"
class Camera;
@@ -58,7 +59,7 @@ class EditorSpatialGizmo : public SpatialEditorGizmo {
struct Instance {
RID instance;
- Ref<Mesh> mesh;
+ Ref<ArrayMesh> mesh;
RID skeleton;
bool billboard;
bool unscaled;
@@ -96,7 +97,7 @@ class EditorSpatialGizmo : public SpatialEditorGizmo {
protected:
void add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard = false);
- void add_mesh(const Ref<Mesh> &p_mesh, bool p_billboard = false, const RID &p_skeleton = RID());
+ void add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard = false, const RID &p_skeleton = RID());
void add_collision_segments(const Vector<Vector3> &p_lines);
void add_collision_triangles(const Ref<TriangleMesh> &p_tmesh);
void add_unscaled_billboard(const Ref<Material> &p_material, float p_scale = 1);
@@ -137,6 +138,22 @@ public:
LightSpatialGizmo(Light *p_light = NULL);
};
+class AudioStreamPlayer3DSpatialGizmo : public EditorSpatialGizmo {
+
+ GDCLASS(AudioStreamPlayer3DSpatialGizmo, EditorSpatialGizmo);
+
+ AudioStreamPlayer3D *player;
+
+public:
+ virtual String get_handle_name(int p_idx) const;
+ virtual Variant get_handle_value(int p_idx) const;
+ virtual void set_handle(int p_idx, Camera *p_camera, const Point2 &p_point);
+ virtual void commit_handle(int p_idx, const Variant &p_restore, bool p_cancel = false);
+
+ void redraw();
+ AudioStreamPlayer3DSpatialGizmo(AudioStreamPlayer3D *p_player = NULL);
+};
+
class CameraSpatialGizmo : public EditorSpatialGizmo {
GDCLASS(CameraSpatialGizmo, EditorSpatialGizmo);
@@ -186,17 +203,6 @@ public:
SkeletonSpatialGizmo(Skeleton *p_skel = NULL);
};
-class TestCubeSpatialGizmo : public EditorSpatialGizmo {
-
- GDCLASS(TestCubeSpatialGizmo, EditorSpatialGizmo);
-
- TestCube *tc;
-
-public:
- void redraw();
- TestCubeSpatialGizmo(TestCube *p_tc = NULL);
-};
-
class RoomSpatialGizmo : public EditorSpatialGizmo {
GDCLASS(RoomSpatialGizmo, EditorSpatialGizmo);
@@ -243,6 +249,22 @@ public:
VisibilityNotifierGizmo(VisibilityNotifier *p_notifier = NULL);
};
+class ParticlesGizmo : public EditorSpatialGizmo {
+
+ GDCLASS(ParticlesGizmo, EditorSpatialGizmo);
+
+ Particles *particles;
+
+public:
+ virtual String get_handle_name(int p_idx) const;
+ virtual Variant get_handle_value(int p_idx) const;
+ virtual void set_handle(int p_idx, Camera *p_camera, const Point2 &p_point);
+ virtual void commit_handle(int p_idx, const Variant &p_restore, bool p_cancel = false);
+
+ void redraw();
+ ParticlesGizmo(Particles *p_particles = NULL);
+};
+
class ReflectionProbeGizmo : public EditorSpatialGizmo {
GDCLASS(ReflectionProbeGizmo, EditorSpatialGizmo);
@@ -256,7 +278,7 @@ public:
virtual void commit_handle(int p_idx, const Variant &p_restore, bool p_cancel = false);
void redraw();
- ReflectionProbeGizmo(ReflectionProbe *p_notifier = NULL);
+ ReflectionProbeGizmo(ReflectionProbe *p_probe = NULL);
};
class GIProbeGizmo : public EditorSpatialGizmo {
@@ -272,7 +294,7 @@ public:
virtual void commit_handle(int p_idx, const Variant &p_restore, bool p_cancel = false);
void redraw();
- GIProbeGizmo(GIProbe *p_notifier = NULL);
+ GIProbeGizmo(GIProbe *p_probe = NULL);
};
class CollisionShapeSpatialGizmo : public EditorSpatialGizmo {
@@ -399,42 +421,46 @@ public:
class SpatialEditorGizmos {
public:
- Ref<FixedSpatialMaterial> create_line_material(const Color &p_base_color);
- Ref<FixedSpatialMaterial> create_solid_material(const Color &p_base_color);
- Ref<FixedSpatialMaterial> handle2_material;
- Ref<FixedSpatialMaterial> handle_material;
- Ref<FixedSpatialMaterial> light_material;
- Ref<FixedSpatialMaterial> light_material_omni_icon;
- Ref<FixedSpatialMaterial> light_material_directional_icon;
- Ref<FixedSpatialMaterial> camera_material;
- Ref<FixedSpatialMaterial> skeleton_material;
- Ref<FixedSpatialMaterial> reflection_probe_material;
- Ref<FixedSpatialMaterial> reflection_probe_material_internal;
- Ref<FixedSpatialMaterial> gi_probe_material;
- Ref<FixedSpatialMaterial> gi_probe_material_internal;
- Ref<FixedSpatialMaterial> room_material;
- Ref<FixedSpatialMaterial> portal_material;
- Ref<FixedSpatialMaterial> raycast_material;
- Ref<FixedSpatialMaterial> visibility_notifier_material;
- Ref<FixedSpatialMaterial> car_wheel_material;
- Ref<FixedSpatialMaterial> joint_material;
-
- Ref<FixedSpatialMaterial> navmesh_edge_material;
- Ref<FixedSpatialMaterial> navmesh_solid_material;
- Ref<FixedSpatialMaterial> navmesh_edge_material_disabled;
- Ref<FixedSpatialMaterial> navmesh_solid_material_disabled;
-
- Ref<FixedSpatialMaterial> listener_icon;
-
- Ref<FixedSpatialMaterial> sample_player_icon;
- Ref<FixedSpatialMaterial> stream_player_icon;
- Ref<FixedSpatialMaterial> visibility_notifier_icon;
-
- Ref<FixedSpatialMaterial> shape_material;
+ Ref<SpatialMaterial> create_line_material(const Color &p_base_color);
+ Ref<SpatialMaterial> create_solid_material(const Color &p_base_color);
+ Ref<SpatialMaterial> handle2_material;
+ Ref<SpatialMaterial> handle2_material_billboard;
+ Ref<SpatialMaterial> handle_material;
+ Ref<SpatialMaterial> handle_material_billboard;
+ Ref<SpatialMaterial> light_material;
+ Ref<SpatialMaterial> light_material_omni;
+ Ref<SpatialMaterial> light_material_omni_icon;
+ Ref<SpatialMaterial> light_material_directional_icon;
+ Ref<SpatialMaterial> camera_material;
+ Ref<SpatialMaterial> skeleton_material;
+ Ref<SpatialMaterial> reflection_probe_material;
+ Ref<SpatialMaterial> reflection_probe_material_internal;
+ Ref<SpatialMaterial> gi_probe_material;
+ Ref<SpatialMaterial> gi_probe_material_internal;
+ Ref<SpatialMaterial> room_material;
+ Ref<SpatialMaterial> portal_material;
+ Ref<SpatialMaterial> raycast_material;
+ Ref<SpatialMaterial> visibility_notifier_material;
+ Ref<SpatialMaterial> particles_material;
+ Ref<SpatialMaterial> car_wheel_material;
+ Ref<SpatialMaterial> joint_material;
+
+ Ref<SpatialMaterial> navmesh_edge_material;
+ Ref<SpatialMaterial> navmesh_solid_material;
+ Ref<SpatialMaterial> navmesh_edge_material_disabled;
+ Ref<SpatialMaterial> navmesh_solid_material_disabled;
+
+ Ref<SpatialMaterial> listener_icon;
+
+ Ref<SpatialMaterial> sample_player_icon;
+ Ref<SpatialMaterial> stream_player_icon;
+ Ref<SpatialMaterial> visibility_notifier_icon;
+
+ Ref<SpatialMaterial> shape_material;
Ref<Texture> handle_t;
- Ref<Mesh> pos3d_mesh;
- Ref<Mesh> listener_line_mesh;
+ Ref<ArrayMesh> pos3d_mesh;
+ Ref<ArrayMesh> listener_line_mesh;
static SpatialEditorGizmos *singleton;
Ref<TriangleMesh> test_cube_tm;
diff --git a/editor/translations/ar.po b/editor/translations/ar.po
index 2e8e0ab725..d617f55dfd 100644
--- a/editor/translations/ar.po
+++ b/editor/translations/ar.po
@@ -2,13 +2,15 @@
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
+# athomield <athomield@hotmail.com>, 2017.
# Mohammmad Khashashneh <mohammad.rasmi@gmail.com>, 2016.
+# OWs Tetra <owstetra@gmail.com>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2016-08-08 10:20+0000\n"
-"Last-Translator: Mohammmad Khashashneh <mohammad.rasmi@gmail.com>\n"
+"PO-Revision-Date: 2017-03-29 16:30+0000\n"
+"Last-Translator: OWs Tetra <owstetra@gmail.com>\n"
"Language-Team: Arabic <https://hosted.weblate.org/projects/godot-engine/"
"godot/ar/>\n"
"Language: ar\n"
@@ -16,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
-"X-Generator: Weblate 2.8-dev\n"
+"X-Generator: Weblate 2.13-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -356,6 +358,174 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "View Files"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connecting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Error making request"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -363,6 +533,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -376,10 +570,6 @@ msgid "Category:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "الموقع:"
@@ -391,7 +581,7 @@ msgstr ""
msgid "Official"
msgstr ""
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "مجتمع"
@@ -411,20 +601,6 @@ msgstr ""
msgid "Call"
msgstr "نداء"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr ""
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr ""
@@ -474,13 +650,6 @@ msgid "Selection Only"
msgstr ""
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr ""
@@ -555,6 +724,7 @@ msgstr ""
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr ""
@@ -630,11 +800,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -665,6 +830,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -765,8 +931,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -776,6 +941,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -844,8 +1010,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr ""
@@ -911,7 +1076,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1036,7 +1201,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1053,7 +1219,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1109,10 +1274,6 @@ msgstr ""
msgid "Clear"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1228,8 +1389,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1283,6 +1444,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1339,7 +1504,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1377,6 +1542,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1429,7 +1598,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1457,50 +1626,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1508,47 +1650,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1619,8 +1729,8 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
+#: editor/editor_node.cpp
+msgid "Editor"
msgstr ""
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
@@ -1640,11 +1750,67 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1728,6 +1894,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1755,12 +1929,32 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+msgid "Open 2D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 3D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2002,6 +2196,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2030,10 +2228,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2199,7 +2393,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2674,7 +2868,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3335,7 +3529,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr ""
@@ -3384,15 +3578,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3423,6 +3608,32 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Add point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "عملية تحريك"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3692,6 +3903,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3704,7 +3928,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3715,6 +3939,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3724,6 +3965,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3736,11 +3981,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3752,26 +3997,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3826,6 +4087,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "عملية تحريك"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3979,6 +4249,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4066,10 +4340,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4103,15 +4373,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4166,6 +4428,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4216,6 +4494,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4237,6 +4523,14 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4259,6 +4553,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4476,35 +4774,95 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Shader Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4564,71 +4922,67 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+msgid "Tool Select"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "1 Viewport"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "2 Viewports"
+msgid "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "2 Viewports (Alt)"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "3 Viewports"
+msgid "1 Viewport"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "3 Viewports (Alt)"
+msgid "2 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "4 Viewports"
+msgid "2 Viewports (Alt)"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
+msgid "3 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
+msgid "3 Viewports (Alt)"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
+msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4652,14 +5006,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5072,11 +5418,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5088,7 +5434,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5124,10 +5470,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5186,6 +5528,10 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+msgid "Templates"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5304,6 +5650,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr ""
@@ -5369,7 +5719,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5436,10 +5786,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5489,10 +5835,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
msgid "Pick a Node"
msgstr ""
@@ -5677,6 +6019,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5752,10 +6098,57 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "عمل اشتراك"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5800,76 +6193,84 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
+msgid "Error - Could not create script in filesystem."
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
+msgid "Error loading script from %s"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
+msgid "Invalid Path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
+msgid "Invalid inherited parent name or path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "عمل اشتراك"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Load existing script file"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Inherits"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Class Name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Template"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6041,26 +6442,37 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
+#, fuzzy
msgid "Invalid type argument to convert(), use TYPE_* constants."
msgstr ""
+"صن٠إحدى المتغيرات المدخلة (arguments) غير صحيح ÙÙŠ ()convert . إستعمل ثابتة "
+"_*TYPE"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
+#, fuzzy
msgid "Not enough bytes for decoding bytes, or invalid format."
msgstr ""
+"لا يوجد ما يكÙÙŠ من البيتات (bytes) Ù„ÙÙƒ ØªØ´ÙŠÙØ±Ø© البيتات أو بنيتها (format) غير "
+"صحيحة."
#: modules/gdscript/gd_functions.cpp
msgid "step argument is zero!"
-msgstr ""
+msgstr "الخطوة (المتغيرة المدخلة/argument) تساوي ØµÙØ± !"
#: modules/gdscript/gd_functions.cpp
+#, fuzzy
msgid "Not a script with an instance"
-msgstr ""
+msgstr "Ø§Ù„Ø´ÙØ±Ø© (script) لا تملك نسخة."
#: modules/gdscript/gd_functions.cpp
msgid "Not based on a script"
@@ -6068,23 +6480,30 @@ msgstr "لا تستند الى Ø´ÙØ±Ø© مصدرية"
#: modules/gdscript/gd_functions.cpp
msgid "Not based on a resource file"
-msgstr ""
+msgstr "لا تستند على مل٠مورد"
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary format (missing @path)"
msgstr ""
+"instance dictionary format نموذج الشكل القاموسي غير صالح - المسار Ù…Ùقود"
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary format (can't load script at @path)"
msgstr ""
+"instance dictionary format نموذج الشكل القاموسي غير صالح - لا يمكن تحميل "
+"السكريبت من المسار"
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary format (invalid script at @path)"
msgstr ""
+"instance dictionary format نموذج الشكل القاموسي غير صالح - السكريبت ÙÙŠ "
+"المسار غير صالح"
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary (invalid subclasses)"
msgstr ""
+"instance dictionary نموذج القاموس غير صالح - subclasses Ø§Ù„ÙØ¦Ø© Ø§Ù„ÙØ±Ø¹ÙŠØ© غير "
+"صالحة"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -6359,6 +6778,26 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr ""
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6502,8 +6941,10 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
#: scene/2d/path_2d.cpp
@@ -6566,6 +7007,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6581,6 +7027,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr ""
@@ -6623,6 +7077,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
diff --git a/editor/translations/bg.po b/editor/translations/bg.po
index 590eb37b73..7ca3987827 100644
--- a/editor/translations/bg.po
+++ b/editor/translations/bg.po
@@ -356,6 +356,176 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Файл:"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connecting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Имаше грешка при зареждане на Ñцената."
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -363,6 +533,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "ВнаÑÑне"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "ПриÑтавки"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -376,10 +570,6 @@ msgid "Category:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr ""
@@ -391,7 +581,7 @@ msgstr ""
msgid "Official"
msgstr ""
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr ""
@@ -411,20 +601,6 @@ msgstr ""
msgid "Call"
msgstr ""
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr ""
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr ""
@@ -474,13 +650,6 @@ msgid "Selection Only"
msgstr ""
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr ""
@@ -555,6 +724,7 @@ msgstr ""
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr ""
@@ -630,11 +800,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -665,6 +830,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -765,8 +931,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -776,6 +941,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -845,8 +1011,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Път:"
@@ -912,7 +1077,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1038,7 +1203,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr "Извършва Ñе повторно внаÑÑне"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1055,7 +1221,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1110,10 +1275,6 @@ msgstr ""
msgid "Clear"
msgstr "ИзчиÑтване"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1229,8 +1390,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1284,6 +1445,11 @@ msgid "Save Scene As.."
msgstr "Запазване на Ñцената като.."
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Възел"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1340,7 +1506,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1378,6 +1544,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Сцена"
@@ -1430,7 +1600,7 @@ msgstr "ЗатварÑне на Ñцената"
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1458,99 +1628,41 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "ÐаÑтройки на проекта"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Изход до ÑпиÑъка Ñ Ð¿Ñ€Ð¾ÐµÐºÑ‚Ð¸"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "ВнаÑÑне на обекти в проекта."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "ВнаÑÑне"
+#, fuzzy
+msgid "Project"
+msgstr "ИзнаÑÑне на проекта"
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
-msgstr ""
+msgid "Project Settings"
+msgstr "ÐаÑтройки на проекта"
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Run Script"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "ИзнаÑÑне на проекта на много платформи."
-
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "ИзнаÑÑне"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "Възпроизвеждане на проекта."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "ПреуÑтановÑване на Ñцената"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "ПреуÑтановÑване на Ñцената"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "Спиране на Ñцената."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "Възпроизвеждане на редактирана Ñцена."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "Възпроизвеждане на Ñцената"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "Възпроизвеждане на Ñцена по избор"
-
-#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "Възпроизвеждане на Ñцена по избор"
+msgid "Quit to Project List"
+msgstr "Изход до ÑпиÑъка Ñ Ð¿Ñ€Ð¾ÐµÐºÑ‚Ð¸"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "ÐаÑтройки за отÑтранÑване на грешки"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "ОтÑтранÑване на грешки"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1620,9 +1732,9 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "ÐаÑтройки"
+#: editor/editor_node.cpp
+msgid "Editor"
+msgstr ""
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1641,14 +1753,70 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr "ОтноÑно"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr "Възпроизвеждане на проекта."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "ПреуÑтановÑване на Ñцената"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "ПреуÑтановÑване на Ñцената"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Спиране на Ñцената."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
msgstr ""
#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "Възпроизвеждане на редактирана Ñцена."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Възпроизвеждане на Ñцената"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Възпроизвеждане на Ñцена по избор"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "Възпроизвеждане на Ñцена по избор"
+
+#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
msgstr ""
@@ -1729,6 +1897,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "ВнаÑÑне на шаблони от архив във формат ZIP"
@@ -1756,15 +1932,36 @@ msgstr ""
msgid "Load Errors"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Open 2D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 3D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "ИзнаÑÑне на библиотеката"
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
+msgstr ""
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "ИнÑталирани приÑтавки:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr ""
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr ""
@@ -2008,6 +2205,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2036,10 +2237,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Повторно внаÑÑне.."
@@ -2208,7 +2405,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2683,7 +2880,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3345,7 +3542,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "Добре"
@@ -3394,15 +3591,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3433,6 +3621,31 @@ msgstr "ВнаÑÑне от Ñцена"
msgid "Update from Scene"
msgstr "ОбновÑване от Ñцена"
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Add point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Remove point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3702,6 +3915,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3714,7 +3940,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3725,6 +3951,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3734,6 +3977,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3746,11 +3993,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3762,26 +4009,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3836,6 +4099,14 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove Out-Control Point"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3989,6 +4260,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4077,10 +4352,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "ОтÑтранÑване на грешки"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4114,15 +4385,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4177,6 +4440,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4227,6 +4506,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4248,6 +4535,14 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4270,6 +4565,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4487,35 +4786,96 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Колелцето надолу."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Shader Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4575,63 +4935,55 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Select"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "1 Viewport"
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "2 Viewports"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "2 Viewports (Alt)"
+msgid "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "3 Viewports"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "3 Viewports (Alt)"
+msgid "1 Viewport"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "4 Viewports"
+msgid "2 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
+msgid "2 Viewports (Alt)"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
+msgid "3 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
+msgid "3 Viewports (Alt)"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4643,6 +4995,10 @@ msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "ÐаÑтройки"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr ""
@@ -4663,14 +5019,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5087,11 +5435,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5103,7 +5451,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5139,10 +5487,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5201,6 +5545,10 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+msgid "Templates"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5319,6 +5667,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "УÑтройÑтво"
@@ -5384,8 +5736,9 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr ""
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "ÐаÑтройки на проекта"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5451,10 +5804,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "ПриÑтавки"
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5505,10 +5854,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "ПоÑтавÑне"
@@ -5696,6 +6041,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5773,10 +6122,58 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "ÐаÑтройки за отÑтранÑване на грешки"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Ðова Ñцена"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5821,77 +6218,86 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr ""
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "ÐеуÑпешно Ñъздаване на папка."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr ""
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "Грешка при зареждането на шрифта."
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
+msgid "Invalid Path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-#, fuzzy
-msgid "Error loading script from %s"
-msgstr "Грешка при зареждането на шрифта."
+msgid "Invalid inherited parent name or path"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "Създаване на папка"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Class Name"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Template"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6064,6 +6470,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6394,6 +6804,29 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "ÐеуÑпешно Ñъздаване на папка."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "ÐеуÑпешно Ñъздаване на папка."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "ÐеуÑпешно Ñъздаване на папка."
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6556,11 +6989,11 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr "ParallaxLayer работи Ñамо когато е наÑледник на ParallaxBackground."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"Параметърът 'Path' трÑбва да Ñочи към дейÑтвителен възел Particles2D, за да "
-"работи."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6626,6 +7059,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6644,6 +7082,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Тревога!"
@@ -6686,6 +7132,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6694,6 +7146,17 @@ msgid ""
"texture to some node for display."
msgstr ""
+#~ msgid "Import assets to the project."
+#~ msgstr "ВнаÑÑне на обекти в проекта."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "ИзнаÑÑне на проекта на много платформи."
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Параметърът 'Path' трÑбва да Ñочи към дейÑтвителен възел Particles2D, за "
+#~ "да работи."
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
diff --git a/editor/translations/bn.po b/editor/translations/bn.po
index 4ff2f6c459..abf7b8c8b9 100644
--- a/editor/translations/bn.po
+++ b/editor/translations/bn.po
@@ -8,7 +8,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2017-01-07 04:19+0000\n"
+"PO-Revision-Date: 2017-01-08 13:05+0000\n"
"Last-Translator: ABU MD. MARUF SARKER <maruf.webdev@gmail.com>\n"
"Language-Team: Bengali <https://hosted.weblate.org/projects/godot-engine/"
"godot/bn/>\n"
@@ -358,6 +358,184 @@ msgstr "শà§à¦°à§‡à¦£à§€à¦¬à¦¿à¦¨à§à¦¯à¦¾à¦¸/সারির মানের
msgid "Change Array Value"
msgstr "শà§à¦°à§‡à¦£à§€à¦¬à¦¿à¦¨à§à¦¯à¦¾à¦¸/সারির মান পরিবরà§à¦¤à¦¨ করà§à¦¨"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "সংসà§à¦•রণ:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "ধà§à¦°à§à¦¬à¦•সমূহ:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "ফাইল"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "বরà§à¦£à¦¨à¦¾:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "ইনà§à¦¸à¦Ÿà¦²"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "বনà§à¦§ করà§à¦¨"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "সংযোগ.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "নোডের সাথে সংযà§à¦•à§à¦¤ করà§à¦¨:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "আবেদনকৃত ফাইল ফরমà§à¦¯à¦¾à¦Ÿ/ধরণ অজানা:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "সংরকà§à¦·à¦¿à¦¤ হচà§à¦›à§‡.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "সংযোগ.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "পরীকà§à¦·à¦¾à¦®à§‚লক উৎস"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "রিসোরà§à¦¸ সংরকà§à¦·à¦£à§‡ সমসà§à¦¯à¦¾ হয়েছে!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "নীচে"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "সকল"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -365,6 +543,30 @@ msgstr "শà§à¦°à§‡à¦£à§€à¦¬à¦¿à¦¨à§à¦¯à¦¾à¦¸/সারির মান পর
msgid "Search:"
msgstr "অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "ইমà§à¦ªà§‹à¦°à§à¦Ÿ"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "পà§à¦²à¦¾à¦—ইন-সমূহ"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "সাজান:"
@@ -378,10 +580,6 @@ msgid "Category:"
msgstr "বিভাগ:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "সকল"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "ওয়েবসাইট:"
@@ -393,7 +591,7 @@ msgstr "সমরà§à¦¥à¦¨.."
msgid "Official"
msgstr "অফিসিয়াল/পà§à¦°à¦¾à¦¥à¦®à¦¿à¦• উৎস"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "কমিউনিটি/যৌথ-সামাজিক উৎস"
@@ -413,20 +611,6 @@ msgstr "'%s' à¦à¦° জনà§à¦¯ মেথডের তালিকা:"
msgid "Call"
msgstr "ডাকà§à¦¨ (Call)"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "বনà§à¦§ করà§à¦¨"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "মেথডের তালিকা:"
@@ -477,13 +661,6 @@ msgid "Selection Only"
msgstr "শà§à¦§à§à¦®à¦¾à¦¤à§à¦° নিরà§à¦¬à¦¾à¦šà¦¿à¦¤à¦¸à¦®à§‚হ"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "সনà§à¦§à¦¾à¦¨ করà§à¦¨"
@@ -560,6 +737,7 @@ msgstr "সংযোজন করà§à¦¨"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "অপসারণ করà§à¦¨"
@@ -635,11 +813,6 @@ msgstr "সামà§à¦ªà§à¦°à¦¤à¦¿à¦•:"
msgid "Matches:"
msgstr "মিলসমূহ:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "বরà§à¦£à¦¨à¦¾:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "à¦à¦° জনà§à¦¯ পà§à¦°à¦¤à¦¿à¦¸à§à¦¥à¦¾à¦ªà¦•ের অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨:"
@@ -674,6 +847,7 @@ msgstr "রিসোরà§à¦¸"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "পথ"
@@ -778,8 +952,7 @@ msgstr ""
msgid "Add Bus"
msgstr "%s সংযà§à¦•à§à¦¤ করà§à¦¨"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "লোড"
@@ -789,6 +962,7 @@ msgid "Save As"
msgstr "à¦à¦‡à¦°à§‚পে সংরকà§à¦·à¦£ করà§à¦¨"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "সাধারণ/ডিফলà§à¦Ÿ"
@@ -863,8 +1037,7 @@ msgid "Rearrange Autoloads"
msgstr "Autoload সমূহ পà§à¦¨à¦°à§à¦¬à¦¿à¦¨à§à¦¯à¦¸à§à¦¤ করà§à¦¨"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "পথ:"
@@ -930,7 +1103,7 @@ msgstr "সংরকà§à¦·à¦¿à¦¤ ফাইল:"
msgid "Packing"
msgstr "পà§à¦¯à¦¾à¦•/গà§à¦šà§à¦›à¦¿à¦¤ করা"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1056,7 +1229,8 @@ msgstr "উৎসসমূহ সà§à¦•à§à¦¯à¦¾à¦¨ করà§à¦¨"
msgid "(Re)Importing Assets"
msgstr "পà§à¦¨à¦°à¦¾à§Ÿ ইমà§à¦ªà§‹à¦°à§à¦Ÿ হচà§à¦›à§‡"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "সাহাযà§à¦¯ অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨"
@@ -1073,7 +1247,6 @@ msgid "Class:"
msgstr "কà§à¦²à¦¾à¦¸:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "গà§à¦°à¦¹à¦£ করে:"
@@ -1106,9 +1279,8 @@ msgid "Constants:"
msgstr "ধà§à¦°à§à¦¬à¦•সমূহ:"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Property Description:"
-msgstr "সংকà§à¦·à¦¿à¦ªà§à¦¤ বরà§à¦£à¦¨à¦¾:"
+msgstr "মান/পà§à¦°à§‹à¦ªà¦¾à¦°à§à¦Ÿà¦¿à¦° বরà§à¦£à¦¨à¦¾:"
#: editor/editor_help.cpp
msgid "Method Description:"
@@ -1129,10 +1301,6 @@ msgstr " আউটপà§à¦Ÿ/ফলাফল:"
msgid "Clear"
msgstr "পরিসà§à¦•ার করà§à¦¨/কà§à¦²à§€à§Ÿà¦¾à¦°"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "দৃশà§à¦¯ হতে নোড"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1248,10 +1416,11 @@ msgid "There is no defined scene to run."
msgstr "চালানোর জনà§à¦¯ কোনো দৃশà§à¦¯ নিরà§à¦¦à¦¿à¦·à§à¦Ÿ করা নেই।"
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"কোনো মà§à¦–à§à¦¯ দৃশà§à¦¯ নিরà§à¦§à¦¾à¦°à¦£ করা হয়নি, নিরà§à¦§à¦¾à¦°à¦£ করবেন?\n"
"আপনি পরবরà§à¦¤à¦¿à¦¤à§‡ তা 'অà§à¦¯à¦¾à¦ªà§à¦²à¦¿à¦•েশন (application)' বিভাগের \\\"পà§à¦°à¦•লà§à¦ªà§‡à¦° সেটিংস "
@@ -1316,6 +1485,11 @@ msgid "Save Scene As.."
msgstr "দৃশà§à¦¯ à¦à¦‡à¦°à§‚পে সংরকà§à¦·à¦£ করà§à¦¨.."
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "নোড"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr "à¦à¦‡ দৃশà§à¦¯à¦Ÿà¦¿ কখনোই সংরকà§à¦·à¦£ করা হয় নি। চালানোর পূরà§à¦¬à§‡ সংরকà§à¦·à¦£ করবেন?"
@@ -1374,7 +1548,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "আহà§â€Œ"
@@ -1414,6 +1588,10 @@ msgstr "%d টি অধিক ফাইল(সমূহ)"
msgid "%d more file(s) or folder(s)"
msgstr "%d টি অধিক ফাইল(সমূহ) বা ফোলà§à¦¡à¦¾à¦°(সমূহ)"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "বিকà§à¦·à§‡à¦ª-হীন মোড"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "দৃশà§à¦¯"
@@ -1467,7 +1645,7 @@ msgstr "দৃশà§à¦¯ বনà§à¦§ করà§à¦¨"
msgid "Close Goto Prev. Scene"
msgstr "বনà§à¦§ করে পূরà§à¦¬à§‡à¦° দৃশà§à¦¯à§‡ যান"
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "সামà§à¦ªà§à¦°à¦¤à¦¿à¦•সমূহ খà§à¦²à§à¦¨"
@@ -1495,99 +1673,41 @@ msgid "Redo"
msgstr "পà§à¦¨à¦°à¦¾à¦¯à¦¼ করà§à¦¨"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ চালান"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° সেটিংস"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "দৃশà§à¦¯ পà§à¦°à¦¤à§à¦¯à¦¾à¦¬à§ƒà¦¤à§à¦¤ করà§à¦¨"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° তালিকায় পà§à¦°à¦¸à§à¦¥à¦¾à¦¨ করà§à¦¨"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "বিকà§à¦·à§‡à¦ª-হীন মোড"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "উপাদানসমূহ পà§à¦°à¦•লà§à¦ªà§‡ ইমà§à¦ªà§‹à¦°à§à¦Ÿ করà§à¦¨à¥¤"
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "ইমà§à¦ªà§‹à¦°à§à¦Ÿ"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "পà§à¦°à¦•লà§à¦ª অথবা দৃশà§à¦¯à§‡-বà§à¦¯à¦¾à¦ªà§€ বিবিধ সরঞà§à¦œà¦¾à¦®-সমূহ।"
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "সরঞà§à¦œà¦¾à¦®-সমূহ"
+#, fuzzy
+msgid "Project"
+msgstr "নতà§à¦¨ পà§à¦°à¦•লà§à¦ª"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° সেটিংস"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "পà§à¦°à¦•লà§à¦ªà¦Ÿà¦¿ à¦à¦•াধিক পà§à¦²à¦¾à¦Ÿà¦«à¦°à§à¦®à§‡ à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ করà§à¦¨à¥¤"
+msgid "Run Script"
+msgstr "সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ চালান"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "পà§à¦°à¦•লà§à¦ªà¦Ÿà¦¿ চালান।"
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "চালান"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "দৃশà§à¦¯à¦Ÿà¦¿à¦•ে বিরতি দিন"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "দৃশà§à¦¯à¦•ে বিরতি দিন"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "দৃশà§à¦¯à¦Ÿà¦¿à¦•ে থামান।"
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "থামান"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "সমà§à¦ªà¦¾à¦¦à¦¿à¦¤ দৃশà§à¦¯à¦Ÿà¦¿ চালান।"
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "দৃশà§à¦¯ চালান"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "সà§à¦¬à¦¨à¦¿à¦°à§à¦¬à¦¾à¦šà¦¿à¦¤ দৃশà§à¦¯ চালান"
+msgid "Tools"
+msgstr "সরঞà§à¦œà¦¾à¦®-সমূহ"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "সà§à¦¬à¦¨à¦¿à¦°à§à¦¬à¦¾à¦šà¦¿à¦¤ দৃশà§à¦¯ চালান"
+msgid "Quit to Project List"
+msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° তালিকায় পà§à¦°à¦¸à§à¦¥à¦¾à¦¨ করà§à¦¨"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "ডিবাগের সিদà§à¦§à¦¾à¦¨à§à¦¤à¦¸à¦®à§‚হ"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "ডিবাগ"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1677,9 +1797,10 @@ msgstr ""
"রিমোট ডিভাইসে বà§à¦¯à¦¬à¦¹à¦¾à¦°à§‡à¦° সময়, নেটওয়ারà§à¦• ফাইল-সিসà§à¦Ÿà§‡à¦® (filesystem) à¦à¦Ÿà¦¿à¦•ে আরো "
"কারà§à¦¯à¦•র করবে।"
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "সেটিংস"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "সমà§à¦ªà¦¾à¦¦à¦¨ করà§à¦¨ (Edit)"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1699,12 +1820,69 @@ msgid "Manage Export Templates"
msgstr "à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ টেমপà§à¦²à§‡à¦Ÿà¦¸à¦®à§‚হ লোড হচà§à¦›à§‡"
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "কà§à¦²à¦¾à¦¸à¦¸à¦®à§‚হ"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "ডকà§à¦®à§‡à¦¨à§à¦Ÿà¦¸à¦®à§‚হ বনà§à¦§ করà§à¦¨"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr "সমà§à¦¬à¦¨à§à¦§à§‡/সমà§à¦ªà¦°à§à¦•ে"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "বহি:সà§à¦¥ রিসোরà§à¦¸à§‡à¦° পরিবরà§à¦¤à¦¨à§‡ সতরà§à¦• করে।"
+msgid "Play the project."
+msgstr "পà§à¦°à¦•লà§à¦ªà¦Ÿà¦¿ চালান।"
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "চালান"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "দৃশà§à¦¯à¦Ÿà¦¿à¦•ে বিরতি দিন"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "দৃশà§à¦¯à¦•ে বিরতি দিন"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "দৃশà§à¦¯à¦Ÿà¦¿à¦•ে থামান।"
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "থামান"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "সমà§à¦ªà¦¾à¦¦à¦¿à¦¤ দৃশà§à¦¯à¦Ÿà¦¿ চালান।"
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "দৃশà§à¦¯ চালান"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "সà§à¦¬à¦¨à¦¿à¦°à§à¦¬à¦¾à¦šà¦¿à¦¤ দৃশà§à¦¯ চালান"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "সà§à¦¬à¦¨à¦¿à¦°à§à¦¬à¦¾à¦šà¦¿à¦¤ দৃশà§à¦¯ চালান"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1787,6 +1965,14 @@ msgid "Thanks!"
msgstr "ধনà§à¦¯à¦¬à¦¾à¦¦!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "ZIP ফাইল হতে টেমপà§à¦²à§‡à¦Ÿ-সমূহ ইমà§à¦ªà§‹à¦°à§à¦Ÿ করà§à¦¨"
@@ -1814,15 +2000,41 @@ msgstr "à¦à¦•টি সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ খà§à¦²à§à¦¨ à¦à¦¬à¦‚ চà¦
msgid "Load Errors"
msgstr "ভà§à¦²/সমসà§à¦¯à¦¾-সমূহ লোড করà§à¦¨"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "à¦à¦¡à¦¿à¦Ÿà¦°à§‡ খà§à¦²à§à¦¨"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "à¦à¦¡à¦¿à¦Ÿà¦°à§‡ খà§à¦²à§à¦¨"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "à¦à¦¡à¦¿à¦Ÿà¦°à§‡ খà§à¦²à§à¦¨"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "লাইবà§à¦°à§‡à¦°à¦¿ à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ করà§à¦¨"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "à¦à¦¡à¦¿à¦Ÿà¦°à§‡ খà§à¦²à§à¦¨"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "à¦à¦¡à¦¿à¦Ÿà¦°à§‡ খà§à¦²à§à¦¨"
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "ইনà§à¦¸à¦Ÿà¦²-কৃত পà§à¦²à¦¾à¦—ইন-সমূহ:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "সংসà§à¦•রণ:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "লেখক:"
@@ -2077,6 +2289,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "ফাইল-মà§à¦¯à¦¾à¦¨à§‡à¦œà¦¾à¦°à§‡ দেখà§à¦¨"
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr "ইনসà§à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸"
@@ -2105,10 +2321,6 @@ msgid "Info"
msgstr "তথà§à¦¯"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "ফাইল-মà§à¦¯à¦¾à¦¨à§‡à¦œà¦¾à¦°à§‡ দেখà§à¦¨"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "পà§à¦¨-ইমà§à¦ªà§‹à¦°à§à¦Ÿ.."
@@ -2275,9 +2487,10 @@ msgid "No target font resource!"
msgstr "ফনà§à¦Ÿà§‡à¦° কোনো উদà§à¦¦à§‡à¦¶à§à¦¯à¦¿à¦¤ রিসোরà§à¦¸ নেই!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"ফাইলের অগà§à¦°à¦¹à¦¨à¦¯à§‹à¦—à§à¦¯ à¦à¦•à§à¦¸à¦Ÿà§‡à¦¨à¦¶à¦¨à¥¤\n"
"অনà§à¦—à§à¦°à¦¹ করে .fnt বà§à¦¯à¦¬à¦¹à¦¾à¦° করà§à¦¨à¥¤"
@@ -2760,8 +2973,9 @@ msgid "Compress"
msgstr "সঙà§à¦•োচন করà§à¦¨"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr "পà§à¦°à¦•লà§à¦ªà§‡ সংযà§à¦•à§à¦¤ করà§à¦¨ (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "পà§à¦°à¦•লà§à¦ªà§‡ সংযà§à¦•à§à¦¤ করà§à¦¨ (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -3424,7 +3638,7 @@ msgid "Change default type"
msgstr "ডিফলà§à¦Ÿ ধরণ পরিবরà§à¦¤à¦¨ করà§à¦¨"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "সঠিক"
@@ -3475,15 +3689,6 @@ msgstr "Poly3D তৈরি করà§à¦¨"
msgid "Set Handle"
msgstr "হà§à¦¯à¦¾à¦¨à§à¦¡à§‡à¦² সà§à¦¥à¦¾à¦ªà¦¨ করà§à¦¨"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "রঙà§à¦—ের রâ€à§à¦¯à¦¾à¦®à§à¦ª বিনà§à¦¦à§ সংযোজন/বিয়োজন করà§à¦¨"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr "রঙà§à¦—ের রâ€à§à¦¯à¦¾à¦®à§à¦ª পরিবরà§à¦¤à¦¨ করà§à¦¨"
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr "মেস লাইবà§à¦°à§‡à¦°à¦¿ তৈরি হচà§à¦›à§‡"
@@ -3514,6 +3719,35 @@ msgstr "দৃশà§à¦¯ হতে ইমà§à¦ªà§‹à¦°à§à¦Ÿ করà§à¦¨"
msgid "Update from Scene"
msgstr "দৃশà§à¦¯ হতে হালনাগাদ করà§à¦¨"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "ইনপà§à¦Ÿ যোগ করà§à¦¨"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "পথের বিনà§à¦¦à§ অপসারণ করà§à¦¨"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "রিসোরà§à¦¸ লোড করà§à¦¨"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Modify Curve"
+msgstr "Curve Map পরিবরà§à¦¤à¦¨ করà§à¦¨"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "রঙà§à¦—ের রâ€à§à¦¯à¦¾à¦®à§à¦ª বিনà§à¦¦à§ সংযোজন/বিয়োজন করà§à¦¨"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "রঙà§à¦—ের রâ€à§à¦¯à¦¾à¦®à§à¦ª পরিবরà§à¦¤à¦¨ করà§à¦¨"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "বসà§à¦¤à§ %d"
@@ -3787,6 +4021,20 @@ msgid "Remove Poly And Point"
msgstr "পলি à¦à¦¬à¦‚ বিনà§à¦¦à§ অপসারণ করà§à¦¨"
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "Emission Mask পরিসà§à¦•ার করà§à¦¨"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "AABB উৎপনà§à¦¨ করà§à¦¨"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "ছবি লোডে সমসà§à¦¯à¦¾ হয়েছে:"
@@ -3799,8 +4047,8 @@ msgid "Set Emission Mask"
msgstr "Emission Mask সà§à¦¥à¦¾à¦ªà¦¨ করà§à¦¨"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
-msgstr "Emission Mask পরিসà§à¦•ার করà§à¦¨"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -3810,6 +4058,27 @@ msgstr "Emission Mask লোড করà§à¦¨"
msgid "Generated Point Count:"
msgstr "উৎপাদিত বিনà§à¦¦à§à¦° সংখà§à¦¯à¦¾:"
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "গড় সময় (সেঃ)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "Emission Mask সà§à¦¥à¦¾à¦ªà¦¨ করà§à¦¨"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "দৃশà§à¦¯ হতে তৈরি করবেন"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Emission-à¦à¦° সà§à¦¥à¦¾à¦¨à¦¸à¦®à§‚হ:"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr "নোডে কোনো জà§à¦¯à¦¾à¦®à¦¿à¦¤à¦¿à¦• আকার নেই।"
@@ -3819,6 +4088,10 @@ msgid "Node does not contain geometry (faces)."
msgstr "নোডে কোনো জà§à¦¯à¦¾à¦®à¦¿à¦¤à¦¿à¦• আকার নেই (পৃষà§à¦ )।"
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "পৃষà§à¦ à¦¸à¦®à§‚হ কোনো আকার নেই!"
@@ -3831,11 +4104,13 @@ msgid "Generate AABB"
msgstr "AABB উৎপনà§à¦¨ করà§à¦¨"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+#, fuzzy
+msgid "Create Emission Points From Mesh"
msgstr "Mesh হতে Emitter তৈরি করà§à¦¨"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+#, fuzzy
+msgid "Create Emission Points From Node"
msgstr "Node হতে Emitter তৈরি করà§à¦¨"
#: editor/plugins/particles_editor_plugin.cpp
@@ -3847,26 +4122,48 @@ msgid "Create Emitter"
msgstr "Emitter তৈরি করà§à¦¨"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+#, fuzzy
+msgid "Emission Points:"
msgstr "Emission-à¦à¦° সà§à¦¥à¦¾à¦¨à¦¸à¦®à§‚হ:"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr "Emission পূরণ:"
+#, fuzzy
+msgid "Surface Points"
+msgstr "পৃষà§à¦ à¦¤à¦² %d"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "পৃষà§à¦ à¦¤à¦²"
+msgid "Surface Points+Normal (Directed)"
+msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "আয়তন"
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Source: "
+msgstr "Emission পূরণ:"
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "AABB উৎপনà§à¦¨ করà§à¦¨"
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr "বকà§à¦°à¦°à§‡à¦–া হতে বিনà§à¦¦à§ অপসারণ করà§à¦¨"
#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "বকà§à¦°à¦°à§‡à¦–া বহিঃ-নিয়নà§à¦¤à§à¦°à¦£à§‡ সরান"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "বকà§à¦°à¦°à§‡à¦–া হতে বিনà§à¦¦à§ অপসারণ করà§à¦¨"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr "বকà§à¦°à¦°à§‡à¦–ায় বিনà§à¦¦à§ যোগ করà§à¦¨"
@@ -3921,6 +4218,16 @@ msgstr "পথ বিভকà§à¦¤ করà§à¦¨"
msgid "Remove Path Point"
msgstr "পথের বিনà§à¦¦à§ অপসারণ করà§à¦¨"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "বকà§à¦°à¦°à§‡à¦–া বহিঃ-নিয়নà§à¦¤à§à¦°à¦£à§‡ সরান"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "বকà§à¦°à¦°à§‡à¦–া আনà§à¦¤-নিয়নà§à¦¤à§à¦°à¦£à§‡ সরান"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "UV Map তৈরি করà§à¦¨"
@@ -4074,6 +4381,11 @@ msgid "Pitch"
msgstr "পিচà§â€Œ"
#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "বোনà§â€Œ/হাড় পরিষà§à¦•ার করà§à¦¨"
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr "থিম সংরকà§à¦·à¦£à§‡ সমসà§à¦¯à¦¾ হয়েছে"
@@ -4161,10 +4473,6 @@ msgstr "খà§à¦à¦œà§à¦¨.."
msgid "Find Next"
msgstr "পরবরà§à¦¤à§€ খà§à¦à¦œà§à¦¨"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "ডিবাগ"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr "ধাপ লাফিয়ে যান"
@@ -4198,16 +4506,9 @@ msgid "Move Right"
msgstr "ডানে সরান"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "টিউটোরিয়ালসমূহ"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "টিউটোরিয়ালের সà§à¦¥à¦¾à¦¨à§‡ https://godotengine.org খà§à¦²à§à¦¨à¥¤"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "কà§à¦²à¦¾à¦¸à¦¸à¦®à§‚হ"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "রেফারেনà§à¦¸à§‡à¦° ডকà§à¦®à§‡à¦¨à§à¦Ÿà§‡à¦¶à¦¨à§‡ খà§à¦à¦œà§à¦¨à¥¤"
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
@@ -4264,6 +4565,23 @@ msgid "Pick Color"
msgstr "রঙ পছনà§à¦¦ করà§à¦¨"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "ছবিসমূহ রূপানà§à¦¤à¦° করা হচà§à¦›à§‡"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4314,6 +4632,14 @@ msgid "Trim Trailing Whitespace"
msgstr "শেষের হোয়াইটসà§à¦ªà§‡à¦¸ ছেà¦à¦Ÿà§‡ ফেলà§à¦¨"
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr "সà§à¦¬à§Ÿà¦‚কà§à¦°à¦¿à§Ÿà¦­à¦¾à¦¬à§‡ মাতà§à¦°à¦¾ দিন"
@@ -4335,6 +4661,16 @@ msgid "Goto Previous Breakpoint"
msgstr "পূরà§à¦¬à§‡à¦° বিরতিবিনà§à¦¦à§à¦¤à§‡ যান"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "à¦à¦¤à§‡ রূপানà§à¦¤à¦° করà§à¦¨.."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "à¦à¦¤à§‡ রূপানà§à¦¤à¦° করà§à¦¨.."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "পূরà§à¦¬à§‡ খà§à¦à¦œà§à¦¨"
@@ -4357,6 +4693,10 @@ msgstr "লাইনে যান.."
msgid "Contextual Help"
msgstr "পà§à¦°à¦¾à¦¸à¦™à§à¦—িক সাহাযà§à¦¯"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr "সà§à¦•েলার ধà§à¦°à§à¦¬à¦• পরিবরà§à¦¤à¦¨ করà§à¦¨"
@@ -4574,36 +4914,106 @@ msgid "Animation Key Inserted."
msgstr "অà§à¦¯à¦¾à¦¨à¦¿à¦®à§‡à¦¶à¦¨à§‡à¦° চাবি সনà§à¦¨à¦¿à¦¬à§‡à¦¶à¦¿à¦¤ হয়েছে।"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "সামনের দিকে যান"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "পিছনের/অতীতের দিকে"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "মাউসের চাকা নিচের দিকে চকà§à¦•র।"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "পরিবরà§à¦¤à¦¨à¦¸à¦®à§‚হ হাল-নাগাদ করà§à¦¨"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "পরিবরà§à¦¤à¦¨à¦¸à¦®à§‚হ হাল-নাগাদ করà§à¦¨"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "পরিবরà§à¦¤à¦¨à¦¸à¦®à§‚হ হাল-নাগাদ করà§à¦¨"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "ভারটেকà§à¦¸"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr "দরà§à¦¶à¦¨à§‡à¦° সাথে সারিবদà§à¦§ করà§à¦¨"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
-msgstr "পরিবেশ (Environment)"
+msgid "Display Normal"
+msgstr "Normal পà§à¦°à¦¦à¦°à§à¦¶à¦¨"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
-msgstr "অডিও শà§à¦°à§‹à¦¤à¦¾"
+msgid "Display Wireframe"
+msgstr "Wireframe পà§à¦°à¦¦à¦°à§à¦¶à¦¨"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
-msgstr "গিজমোস"
+msgid "Display Overdraw"
+msgstr "Overdraw পà§à¦°à¦¦à¦°à§à¦¶à¦¨"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
-msgstr "XForm à¦à¦° সংলাপ"
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Shadeless পà§à¦°à¦¦à¦°à§à¦¶à¦¨"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করার জনà§à¦¯ কোনো দৃশà§à¦¯ নিরà§à¦¬à¦¾à¦šà¦¨ করা হয়নি!"
+#, fuzzy
+msgid "View Environment"
+msgstr "পরিবেশ (Environment)"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "কারà§à¦¸à¦°à§‡à¦° সà§à¦¥à¦¾à¦¨à§‡ ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করà§à¦¨"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "গিজমোস"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "দৃশà§à¦¯ ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করা সমà§à¦­à¦¬ হয়নি!"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr "অডিও শà§à¦°à§‹à¦¤à¦¾"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "XForm à¦à¦° সংলাপ"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4662,6 +5072,26 @@ msgid "Align Selection With View"
msgstr "নিরà§à¦¬à¦¾à¦šà¦¨à¦•ে দরà§à¦¶à¦¨à§‡à¦° সাথে সারিবদà§à¦§ করà§à¦¨"
#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "নিরà§à¦¬à¦¾à¦šà¦¨ করà§à¦¨"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "সরান"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "কনà§à¦Ÿà§à¦°à§‹à¦² বোতাম: ঘূরà§à¦£à¦¨"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "সà§à¦•েল/মাপ:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
msgstr "রà§à¦ªà¦¾à¦¨à§à¦¤à¦°"
@@ -4674,14 +5104,6 @@ msgid "Transform Dialog.."
msgstr "রà§à¦ªà¦¾à¦¨à§à¦¤à¦°à§‡à¦° à¦à¦° সংলাপ.."
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr "পà§à¦°à¦¾à¦¥à¦®à¦¿à¦• লাইট বà§à¦¯à¦¬à¦¹à¦¾à¦° করà§à¦¨"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "পà§à¦°à¦¾à¦¥à¦®à¦¿à¦• sRGB বà§à¦¯à¦¬à¦¹à¦¾à¦° করà§à¦¨"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
msgstr "১ টি Viewport"
@@ -4706,22 +5128,6 @@ msgid "4 Viewports"
msgstr "৪ টি Viewports"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr "Normal পà§à¦°à¦¦à¦°à§à¦¶à¦¨"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr "Wireframe পà§à¦°à¦¦à¦°à§à¦¶à¦¨"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr "Overdraw পà§à¦°à¦¦à¦°à§à¦¶à¦¨"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr "Shadeless পà§à¦°à¦¦à¦°à§à¦¶à¦¨"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr "অরিজিন দেখà§à¦¨"
@@ -4730,6 +5136,10 @@ msgid "View Grid"
msgstr "গà§à¦°à¦¿à¦¡ দেখà§à¦¨"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "সেটিংস"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "সà§à¦¨à§à¦¯à¦¾à¦ª সেটিংস"
@@ -4750,14 +5160,6 @@ msgid "Viewport Settings"
msgstr "Viewport সেটিংস"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr "লাইটের পà§à¦°à¦¾à¦¥à¦®à¦¿à¦• নরমাল:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr "অà§à¦¯à¦¾à¦®à§à¦¬à¦¿à§Ÿà§‡à¦¨à§à¦Ÿ লাইটের রঙ:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr "পরিপà§à¦°à§‡à¦•à§à¦·à¦¿à¦¤ (Perspective) FOV (ডিগà§à¦°à¦¿):"
@@ -5186,12 +5588,14 @@ msgid "Invalid project path, the path must exist!"
msgstr "অকারà§à¦¯à¦•র পà§à¦°à¦•লà§à¦ªà§‡à¦° পথ, পথটি অবশà§à¦¯à¦‡ বিদà§à¦¯à¦®à¦¾à¦¨ হতে হবে!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "অকারà§à¦¯à¦•র পà§à¦°à¦•লà§à¦ªà§‡à¦° পথ, godot.cfg অবশà§à¦¯à¦‡ অনà§à¦ªà¦¸à§à¦¥à¦¿à¦¤ হতে হবে।"
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "অকারà§à¦¯à¦•র পà§à¦°à¦•লà§à¦ªà§‡à¦° পথ, engine.cfg অবশà§à¦¯à¦‡ অনà§à¦ªà¦¸à§à¦¥à¦¿à¦¤ হতে হবে।"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr "অকারà§à¦¯à¦•র পà§à¦°à¦•লà§à¦ªà§‡à¦° পথ, godot.cfg অবশà§à¦¯à¦‡ উপসà§à¦¥à¦¿à¦¤ হতে হবে।"
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "অকারà§à¦¯à¦•র পà§à¦°à¦•লà§à¦ªà§‡à¦° পথ, engine.cfg অবশà§à¦¯à¦‡ উপসà§à¦¥à¦¿à¦¤ হতে হবে।"
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5202,8 +5606,9 @@ msgid "Invalid project path (changed anything?)."
msgstr "অকারà§à¦¯à¦•র পà§à¦°à¦•লà§à¦ªà§‡à¦° পথ (কোনোকিছৠপরিবরà§à¦¤à¦¨ করেছেন?)।"
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
-msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° পথে godot.cfg তৈরি করা সমà§à¦­à¦¬ হয়নি।"
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° পথে engine.cfg তৈরি করা সমà§à¦­à¦¬ হয়নি।"
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
@@ -5238,10 +5643,6 @@ msgid "Install Project:"
msgstr "পà§à¦°à¦•লà§à¦ª ইনà§à¦¸à¦Ÿà¦² করà§à¦¨:"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "ইনà§à¦¸à¦Ÿà¦²"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "বà§à¦°à¦¾à¦‰à¦¸"
@@ -5302,6 +5703,11 @@ msgid "New Project"
msgstr "নতà§à¦¨ পà§à¦°à¦•লà§à¦ª"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "বসà§à¦¤à§ অপসারণ করà§à¦¨"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "পà§à¦°à¦¸à§à¦¥à¦¾à¦¨ করà§à¦¨"
@@ -5422,6 +5828,11 @@ msgstr "ইনপà§à¦Ÿ অà§à¦¯à¦¾à¦•শন যোগ করà§à¦¨"
msgid "Erase Input Action Event"
msgstr "ইনপà§à¦Ÿ অà§à¦¯à¦¾à¦•শন ইভেনà§à¦Ÿ মà§à¦›à§‡ ফেলà§à¦¨"
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "খালি বসà§à¦¤à§ যোগ করà§à¦¨"
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "ডিভাইস/যনà§à¦¤à§à¦°"
@@ -5487,8 +5898,9 @@ msgid "Remove Resource Remap Option"
msgstr "রিসোরà§à¦¸à§‡à¦° পà§à¦¨à¦ƒ-নকশার সিদà§à¦§à¦¾à¦¨à§à¦¤ অপসারণ করà§à¦¨"
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° সেটিংস (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° সেটিংস (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5554,10 +5966,6 @@ msgstr "ঘটনাসà§à¦¥à¦²"
msgid "AutoLoad"
msgstr "সà§à¦¬à§Ÿà¦‚কà§à¦°à¦¿à§Ÿ-লোড"
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "পà§à¦²à¦¾à¦—ইন-সমূহ"
-
#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Viewport"
@@ -5609,10 +6017,6 @@ msgid "Error loading file: Not a resource!"
msgstr "ফাইল লোডে সমসà§à¦¯à¦¾: রিসোরà§à¦¸ নয়!"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "ছবি লোড অসমà§à¦­à¦¬ হয়েছে"
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "à¦à¦•টি নোড নিরà§à¦¬à¦¾à¦šà¦¨ করà§à¦¨"
@@ -5802,6 +6206,11 @@ msgid "Error duplicating scene to save it."
msgstr "দৃশà§à¦¯ পà§à¦°à¦¤à¦¿à¦²à¦¿à¦ªà¦¿ করে সংরকà§à¦·à¦£à§‡ সমসà§à¦¯à¦¾ হয়েছে।"
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "রিসোরà§à¦¸à¦¸à¦®à§‚হ:"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "গà§à¦°à§à¦ªà¦¸à¦®à§‚হ সমà§à¦ªà¦¾à¦¦à¦¨ করà§à¦¨"
@@ -5879,10 +6288,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "CanvasItem দৃশà§à¦¯à¦®à¦¾à¦¨à¦¤à¦¾ টগল করà§à¦¨"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "ডিবাগের সিদà§à¦§à¦¾à¦¨à§à¦¤à¦¸à¦®à§‚হ"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸:"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "পরবরà§à¦¤à§€ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Spatial দৃশà§à¦¯à¦®à¦¾à¦¨à¦¤à¦¾ টগল করà§à¦¨"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr "অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ নোডের নাম, নীমà§à¦¨à§‹à¦•à§à¦¤ অকà§à¦·à¦°à¦¸à¦®à§‚হ গà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ নয়:"
@@ -5927,75 +6385,93 @@ msgid "Select a Node"
msgstr "à¦à¦•টি নোড নিরà§à¦¬à¦¾à¦šà¦¨ করà§à¦¨"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "অভিভাবকের অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ কà§à¦²à¦¾à¦¸ নাম"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "ফাইলসিসà§à¦Ÿà§‡à¦®à§‡ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ তৈরি করা সমà§à¦­à¦¬ হয়নি।"
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "গà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ অকà§à¦·à¦°à¦¸à¦®à§‚হ:"
+msgid "Error loading script from %s"
+msgstr "%s হতে সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ তà§à¦²à¦¤à§‡/লোডে সমসà§à¦¯à¦¾ হয়েছে"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ কà§à¦²à¦¾à¦¸ নাম"
+msgid "Path is empty"
+msgstr "পথটি খালি"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "গà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ নাম"
+msgid "Path is not local"
+msgstr "পথটি সà§à¦¥à¦¾à¦¨à§€à§Ÿ নয়"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "না/আ"
+msgid "Invalid base path"
+msgstr "বেস পথ অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "কà§à¦²à¦¾à¦¸ নাম অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯!"
+msgid "Invalid extension"
+msgstr "অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ à¦à¦•à§à¦¸à¦Ÿà§‡à¦¨à¦¶à¦¨"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "অভিভাবকের কà§à¦²à¦¾à¦¸ নাম অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯!"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ পথ!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "অকারà§à¦¯à¦•র পথ।"
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "ফাইলসিসà§à¦Ÿà§‡à¦®à§‡ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ তৈরি করা সমà§à¦­à¦¬ হয়নি।"
+msgid "Invalid class name"
+msgstr "অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ কà§à¦²à¦¾à¦¸ নাম"
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
-msgstr "%s হতে সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ তà§à¦²à¦¤à§‡/লোডে সমসà§à¦¯à¦¾ হয়েছে"
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "সূচক/ইনডেকà§à¦¸ মানের অগà§à¦°à¦¹à¦¨à¦¯à§‹à¦—à§à¦¯ নাম।"
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "পথটি খালি"
+#, fuzzy
+msgid "Script valid"
+msgstr "সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "পথটি সà§à¦¥à¦¾à¦¨à§€à§Ÿ নয়"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "বেস পথ অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯"
+msgid "N/A"
+msgstr "না/আ"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ à¦à¦•à§à¦¸à¦Ÿà§‡à¦¨à¦¶à¦¨"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+#, fuzzy
+msgid "Create new script file"
msgstr "নতà§à¦¨ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ তৈরি করà§à¦¨"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+#, fuzzy
+msgid "Load existing script file"
msgstr "বিদà§à¦¯à¦®à¦¾à¦¨ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ লোড করà§à¦¨"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "গà§à¦°à¦¹à¦£ করে:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "কà§à¦²à¦¾à¦¸ নাম:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "বসà§à¦¤à§ অপসারণ করà§à¦¨"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "পূরà§à¦¬à¦¨à¦¿à¦°à§à¦®à¦¿à¦¤ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ"
#: editor/script_create_dialog.cpp
@@ -6167,9 +6643,12 @@ msgid "Change Notifier Extents"
msgstr "Notifier à¦à¦° সীমা পরিবরà§à¦¤à¦¨ করà§à¦¨"
#: editor/spatial_editor_gizmos.cpp
-#, fuzzy
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
-msgstr "Notifier à¦à¦° সীমা পরিবরà§à¦¤à¦¨ করà§à¦¨"
+msgstr "পà§à¦°à§‹à¦¬à§‡à¦° (Probe) পরিবà§à¦¯à¦¾à¦ªà§à¦¤à¦¿ পরিবরà§à¦¤à¦¨ করà§à¦¨"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6500,7 +6979,32 @@ msgstr "à¦à¦‡à¦®à¦¾à¦¤à§à¦° চাপিত"
msgid "just released"
msgstr "à¦à¦‡à¦®à¦¾à¦¤à§à¦° অবà§à¦¯à¦¾à¦¹à¦¿à¦¤/মà§à¦•à§à¦¤"
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Run in Browser"
+msgstr "বà§à¦°à¦¾à¦‰à¦¸"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "টাইলটি খà§à¦à¦œà§‡ পাওয়া যায়নি:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "টাইলটি খà§à¦à¦œà§‡ পাওয়া যায়নি:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "ফোলà§à¦¡à¦¾à¦° তৈরী করা সমà§à¦­à¦¬ হয়নি।"
+
#: platform/uwp/export/export.cpp
+#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr ""
@@ -6662,9 +7166,11 @@ msgid ""
msgstr ""
"ParallaxLayer à¦à¦•মাতà§à¦° ParallaxBackground à¦à¦° অংশ হিসেবে নিরà§à¦§à¦¾à¦°à¦¨ করলেই কাজ করে।"
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
-msgstr "Path à¦à¦° দিক অবশà§à¦¯à¦‡ à¦à¦•টি কারà§à¦¯à¦•র Particles2D à¦à¦° দিকে নিরà§à¦¦à§‡à¦¶ করাতে হবে।"
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6744,6 +7250,11 @@ msgstr ""
"NavigationMeshInstance-কে অবশà§à¦¯à¦‡ Navigation-à¦à¦° অংশ অথবা অংশের অংশ হতে হবে। "
"à¦à¦Ÿà¦¾ শà§à¦§à§à¦®à¦¾à¦¤à§à¦° নà§à¦¯à¦¾à¦­à¦¿à¦—েশনের তথà§à¦¯ পà§à¦°à¦¦à¦¾à¦¨ করে।"
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr "Path à¦à¦° দিক অবশà§à¦¯à¦‡ à¦à¦•টি কারà§à¦¯à¦•র Spatial নোডের à¦à¦° দিকে নিরà§à¦¦à§‡à¦¶ করাতে হবে।"
@@ -6763,6 +7274,15 @@ msgstr ""
"AnimatedSprite3D দà§à¦¬à¦¾à¦°à¦¾ ফà§à¦°à§‡à¦® দেখাতে SpriteFrames রিসোরà§à¦¸ অবশà§à¦¯à¦‡ তৈরি করতে হবে "
"অথবা 'Frames' à¦à¦° মান-ঠনিরà§à¦§à¦¾à¦°à¦¨ করে দিতে হবে।"
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "চালানোর মোড:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "সতরà§à¦•তা!"
@@ -6808,6 +7328,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6820,6 +7346,72 @@ msgstr ""
"আকার ধারণ করতে পারে। অনà§à¦¯à¦¥à¦¾à§Ÿ, à¦à¦Ÿà¦¿à¦•ে à¦à¦•টি RenderTarget করà§à¦¨ à¦à¦¬à¦‚ à¦à¦° অভà§à¦¯à¦¨à§à¦¤à¦°à§€à¦£ "
"দৃশà§à¦¯à¦¾à¦¬à¦²à¦¿à¦•ে (texture) দৃশà§à¦¯à¦®à¦¾à¦¨ করতে কোনো নোডে হসà§à¦¤à¦¾à¦¨à§à¦¤à¦° করà§à¦¨à¥¤"
+#~ msgid "Node From Scene"
+#~ msgstr "দৃশà§à¦¯ হতে নোড"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "উপাদানসমূহ পà§à¦°à¦•লà§à¦ªà§‡ ইমà§à¦ªà§‹à¦°à§à¦Ÿ করà§à¦¨à¥¤"
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "পà§à¦°à¦•লà§à¦ªà¦Ÿà¦¿ à¦à¦•াধিক পà§à¦²à¦¾à¦Ÿà¦«à¦°à§à¦®à§‡ à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ করà§à¦¨à¥¤"
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "বহি:সà§à¦¥ রিসোরà§à¦¸à§‡à¦° পরিবরà§à¦¤à¦¨à§‡ সতরà§à¦• করে।"
+
+#~ msgid "Tutorials"
+#~ msgstr "টিউটোরিয়ালসমূহ"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "টিউটোরিয়ালের সà§à¦¥à¦¾à¦¨à§‡ https://godotengine.org খà§à¦²à§à¦¨à¥¤"
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করার জনà§à¦¯ কোনো দৃশà§à¦¯ নিরà§à¦¬à¦¾à¦šà¦¨ করা হয়নি!"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "কারà§à¦¸à¦°à§‡à¦° সà§à¦¥à¦¾à¦¨à§‡ ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করà§à¦¨"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "দৃশà§à¦¯ ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করা সমà§à¦­à¦¬ হয়নি!"
+
+#~ msgid "Use Default Light"
+#~ msgstr "পà§à¦°à¦¾à¦¥à¦®à¦¿à¦• লাইট বà§à¦¯à¦¬à¦¹à¦¾à¦° করà§à¦¨"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "পà§à¦°à¦¾à¦¥à¦®à¦¿à¦• sRGB বà§à¦¯à¦¬à¦¹à¦¾à¦° করà§à¦¨"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "লাইটের পà§à¦°à¦¾à¦¥à¦®à¦¿à¦• নরমাল:"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "অà§à¦¯à¦¾à¦®à§à¦¬à¦¿à§Ÿà§‡à¦¨à§à¦Ÿ লাইটের রঙ:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "ছবি লোড অসমà§à¦­à¦¬ হয়েছে"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "অভিভাবকের অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ কà§à¦²à¦¾à¦¸ নাম"
+
+#~ msgid "Valid chars:"
+#~ msgstr "গà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ অকà§à¦·à¦°à¦¸à¦®à§‚হ:"
+
+#~ msgid "Valid name"
+#~ msgstr "গà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ নাম"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "কà§à¦²à¦¾à¦¸ নাম অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "অভিভাবকের কà§à¦²à¦¾à¦¸ নাম অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ পথ!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr "Path à¦à¦° দিক অবশà§à¦¯à¦‡ à¦à¦•টি কারà§à¦¯à¦•র Particles2D à¦à¦° দিকে নিরà§à¦¦à§‡à¦¶ করাতে হবে।"
+
+#~ msgid "Surface"
+#~ msgstr "পৃষà§à¦ à¦¤à¦²"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
@@ -6864,33 +7456,52 @@ msgstr ""
#~ msgid "No exporter for platform '%s' yet."
#~ msgstr "'%s' পà§à¦²à§à¦¯à¦¾à¦Ÿà¦«à¦°à§à¦®à§‡à¦° জনà§à¦¯ à¦à¦–নো কোনো à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿà¦¾à¦° নেই।"
-#, fuzzy
#~ msgid "Create Android keystore"
-#~ msgstr "নতà§à¦¨ রিসোরà§à¦¸ তৈরি করà§à¦¨"
+#~ msgstr "অà§à¦¯à¦¾à¦¨à§à¦¡à§à¦°à¦¯à¦¼à§‡à¦¡ কীসà§à¦Ÿà§‹à¦° (keystore) তৈরি করà§à¦¨"
-#, fuzzy
#~ msgid "Full name"
-#~ msgstr "গà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ নাম"
+#~ msgstr "পূরà§à¦£ নাম"
+
+#~ msgid "Organizational unit"
+#~ msgstr "সাংগঠনিক à¦à¦•ক (Organizational unit)"
-#, fuzzy
#~ msgid "Organization"
-#~ msgstr "টà§à¦°à§à¦¯à¦¾à¦¨à¦œà¦¿à¦¶à¦¨/সà§à¦¥à¦¾à¦¨à¦¾à¦¨à§à¦¤à¦°à¦£"
+#~ msgstr "সংগঠন"
+
+#~ msgid "City"
+#~ msgstr "শহর"
-#, fuzzy
#~ msgid "State"
-#~ msgstr "অবসà§à¦¥à¦¾:"
+#~ msgstr "পà§à¦°à¦¦à§‡à¦¶/রাজà§à¦¯"
+
+#~ msgid "2 letter country code"
+#~ msgstr "২ অকà§à¦·à¦°à§‡ দেশের কোড"
+
+#~ msgid "User alias"
+#~ msgstr "বà§à¦¯à¦¬à¦¹à¦¾à¦°à¦•ারীর উপনাম (User alias)"
-#, fuzzy
#~ msgid "Password"
-#~ msgstr "পাসওয়ারà§à¦¡:"
+#~ msgstr "পাসওয়ারà§à¦¡"
-#, fuzzy
#~ msgid "at least 6 characters"
-#~ msgstr "গà§à¦°à¦¹à¦¨à¦¯à§‹à¦—à§à¦¯ অকà§à¦·à¦°à¦¸à¦®à§‚হ:"
+#~ msgstr "কমপকà§à¦·à§‡ ৬ টি অকà§à¦·à¦°"
-#, fuzzy
#~ msgid "File name"
-#~ msgstr "নতà§à¦¨ নাম:"
+#~ msgstr "ফাইলের নাম"
+
+#~ msgid "Path : (better to save outside of project)"
+#~ msgstr "পথ : (পà§à¦°à¦•লà§à¦ªà§‡à¦° বাইরে সংরকà§à¦·à¦£ করা ভালো হবে)"
+
+#~ msgid ""
+#~ "Release keystore is not set.\n"
+#~ "Do you want to create one?"
+#~ msgstr ""
+#~ "রিলিসের কীসà§à¦Ÿà§‹à¦° (keystore) সà§à¦¥à¦¾à¦ªà¦¨ করা নেই।\n"
+#~ "আপনি কি à¦à¦•টি তৈরি করতে চান?"
+
+#~ msgid "Fill Keystore/Release User and Release Password"
+#~ msgstr ""
+#~ "কীসà§à¦Ÿà§‹à¦°(keystore)/রিলিসের বà§à¦¯à¦¬à¦¹à¦¾à¦°à¦•ারী (User) à¦à¦¬à¦‚ রিলিসের পাসওয়ারà§à¦¡ পূরণ করà§à¦¨"
#~ msgid "Include"
#~ msgstr "অনà§à¦¤à¦°à§à¦­à§à¦•à§à¦¤ করà§à¦¨"
@@ -7018,9 +7629,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "পরিশিষà§à¦Ÿ নীরবতা:"
-#~ msgid "Script"
-#~ msgstr "সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ"
-
#~ msgid "Script Export Mode:"
#~ msgstr "সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ মোড:"
@@ -7054,9 +7662,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance কোনো BakedLight রিসোরà§à¦¸ ধারণ করে না।"
-#~ msgid "Vertex"
-#~ msgstr "ভারটেকà§à¦¸"
-
#~ msgid "Fragment"
#~ msgstr "ফà§à¦°à¦¾à¦—মেনà§à¦Ÿ"
diff --git a/editor/translations/ca.po b/editor/translations/ca.po
index 2016fd9473..7273e877a9 100644
--- a/editor/translations/ca.po
+++ b/editor/translations/ca.po
@@ -358,6 +358,184 @@ msgstr "Canvia Tipus de la Matriu"
msgid "Change Array Value"
msgstr "Canvia Valor de la Matriu"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "Versió:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Constants:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Fitxer:"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Descripció:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Tanca"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Connecta.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Connecta al Node:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Format de fitxer desconegut:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Desant..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Connecta.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Provant"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Error en desar recurs!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Errors de Càrrega"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Tot"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -365,6 +543,30 @@ msgstr "Canvia Valor de la Matriu"
msgid "Search:"
msgstr "Cerca:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Cerca"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "Importa"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Ordena:"
@@ -378,10 +580,6 @@ msgid "Category:"
msgstr "Categoria:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Tot"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Lloc:"
@@ -393,7 +591,7 @@ msgstr "Suport..."
msgid "Official"
msgstr "Oficial"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Comunitat"
@@ -413,20 +611,6 @@ msgstr "Llista de mètodes de '%s':"
msgid "Call"
msgstr "Crida"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Tanca"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Llista de mètodes:"
@@ -477,13 +661,6 @@ msgid "Selection Only"
msgstr "Selecció Només"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Cerca"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Troba"
@@ -558,6 +735,7 @@ msgstr "Afegeix"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Treu"
@@ -634,11 +812,6 @@ msgstr "Recents:"
msgid "Matches:"
msgstr "Coincidències:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "Descripció:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Cerca Reemplaçant per a:"
@@ -673,6 +846,7 @@ msgstr "Recurs"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Camí"
@@ -775,8 +949,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -786,6 +959,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Predeterminat"
@@ -857,8 +1031,7 @@ msgid "Rearrange Autoloads"
msgstr "Reorganitza AutoCàrregues"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Camí:"
@@ -924,7 +1097,7 @@ msgstr "Emmagatzemant Fitxer:"
msgid "Packing"
msgstr "Compressió"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1050,7 +1223,8 @@ msgstr "Escaneja Fonts"
msgid "(Re)Importing Assets"
msgstr "Re-Importació"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "Cerca Ajuda"
@@ -1067,7 +1241,6 @@ msgid "Class:"
msgstr "Classe:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "Hereta:"
@@ -1123,10 +1296,6 @@ msgstr " Sortida:"
msgid "Clear"
msgstr "Neteja"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Node de l'Escena"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1242,10 +1411,11 @@ msgid "There is no defined scene to run."
msgstr "No s'ha definit cap escena per executar."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"No s'ha definit cap escena principal. Seleccioneu-ne una.\n"
"És possible triar-ne una altra més endavant a \"Configuració del Projecte\" "
@@ -1310,6 +1480,10 @@ msgid "Save Scene As.."
msgstr "Desa Escena com..."
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
"Aquesta Escena no s'ha desat mai encara. Voleu desar-la abans d'executar-la?"
@@ -1369,7 +1543,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "Uf..."
@@ -1409,6 +1583,10 @@ msgstr "%d fitxer(s) més"
msgid "%d more file(s) or folder(s)"
msgstr "%d fitxer(s) o directori(s) més"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "Mode Lliure de Distraccions"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Escena"
@@ -1462,7 +1640,7 @@ msgstr "Tanca l'Escena"
msgid "Close Goto Prev. Scene"
msgstr "Tanca i Vés a l'Escena anterior"
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "Obre Recent"
@@ -1490,99 +1668,41 @@ msgid "Redo"
msgstr "Refés"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "Executa Script"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Configuració del Projecte"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "Reverteix Escena"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Surt a la Llista de Projectes"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Mode Lliure de Distraccions"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "Importa actius al projecte."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "Importa"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "Eines vàries o d'escena."
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "Eines"
+#, fuzzy
+msgid "Project"
+msgstr "Exporta Projecte"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "Configuració del Projecte"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "Exporta el projecte a diverses plataformes."
+msgid "Run Script"
+msgstr "Executa Script"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "Exporta"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "Reprodueix el projecte."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "Reprodueix"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "Pausa l'escena"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "Pausa Escena"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "Atura l'escena."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "Atura"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "Reprodueix l'escena editada."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "Reprodueix Escena"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "Reprodueix escena personalitzada"
+msgid "Tools"
+msgstr "Eines"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "Reprodueix Escena Personalitzada"
+msgid "Quit to Project List"
+msgstr "Surt a la Llista de Projectes"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "Opcions de Depuració (Debug)"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr ""
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1672,9 +1792,10 @@ msgstr ""
"En usar-se remotament en un dispositiu, un sistema de fitxers en xarxa en "
"millora el rendiment."
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "Configuració"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Edita"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1695,12 +1816,68 @@ msgid "Manage Export Templates"
msgstr "Carregant Plantilles d'Exportació"
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr "Quant a"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "Alerta en canviar un recurs extern."
+msgid "Play the project."
+msgstr "Reprodueix el projecte."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "Reprodueix"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "Pausa l'escena"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "Pausa Escena"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Atura l'escena."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "Atura"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "Reprodueix l'escena editada."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Reprodueix Escena"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Reprodueix escena personalitzada"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "Reprodueix Escena Personalitzada"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1783,6 +1960,14 @@ msgid "Thanks!"
msgstr "Gràcies!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "Importa Plantilles des d'un Fitxer ZIP"
@@ -1810,15 +1995,40 @@ msgstr "Obre i Executa un Script"
msgid "Load Errors"
msgstr "Errors de Càrrega"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Obre un Directori"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Obre un Directori"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Editor de Dependències"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "Exporta Biblioteca"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Editor de Dependències"
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
+msgstr ""
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "Connectors Instal·lats:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "Versió:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "Autor:"
@@ -2069,6 +2279,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "Mostra en el Gestor de Fitxers"
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr "Instància"
@@ -2097,10 +2311,6 @@ msgid "Info"
msgstr "Informació"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "Mostra en el Gestor de Fitxers"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "ReImporta..."
@@ -2267,9 +2477,10 @@ msgid "No target font resource!"
msgstr "Cap recurs de Lletra!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"Extensió de fitxer no vàlida.\n"
"Utilitzeu .fnt."
@@ -2753,7 +2964,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3415,7 +3626,7 @@ msgid "Change default type"
msgstr "Canvia Tipus de la Matriu"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "D'acord"
@@ -3464,15 +3675,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3503,6 +3705,34 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Afegeix Senyal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Treu Senyal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "Errors de Càrrega"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3773,6 +4003,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3785,7 +4028,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3796,6 +4039,24 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Temps Mitjà (s)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3805,6 +4066,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3817,11 +4082,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3833,26 +4098,43 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr ""
+#, fuzzy
+msgid "Surface Points"
+msgstr "Superfície %d"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3907,6 +4189,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Treure Autocàrrega"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -4060,6 +4351,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4148,10 +4443,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4185,15 +4476,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4249,6 +4532,23 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "Converteix a..."
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4299,6 +4599,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4320,6 +4628,16 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "Converteix a..."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Converteix a..."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4342,6 +4660,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4559,35 +4881,101 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Endavant"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "Enrere"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Roda Avall."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Actualitza Canvis"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Actualitza Canvis"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "Actualitza Canvis"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "Audio Listener"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4647,23 +5035,33 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "Tota la Selecció"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "Mou"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4691,22 +5089,6 @@ msgid "4 Viewports"
msgstr "4 Vistes"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr ""
@@ -4715,6 +5097,10 @@ msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Configuració"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "Configuració de Desplaçament"
@@ -4735,14 +5121,6 @@ msgid "Viewport Settings"
msgstr "Configuració de la Vista"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5163,12 +5541,14 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr ""
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "El camí de Destinació ha d'existir."
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr ""
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "El camí de Destinació ha d'existir."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5179,7 +5559,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5215,10 +5595,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5277,6 +5653,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Treu la Selecció"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5395,6 +5776,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Dispositiu"
@@ -5460,8 +5845,9 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr "Configuració del Projecte (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Configuració del Projecte (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5527,10 +5913,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Viewport"
@@ -5583,10 +5965,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "Camí al Node:"
@@ -5774,6 +6152,11 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Recurs"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5851,10 +6234,58 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Opcions de Depuració (Debug)"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Obertura Ràpida d'Scripts..."
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5899,79 +6330,94 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr ""
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "No s'ha pogut crear la carpeta."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr ""
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "Error carregant lletra."
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr ""
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Camí no vàlid."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Error loading script from %s"
-msgstr "Error carregant lletra."
+msgid "Invalid inherited parent name or path"
+msgstr "El Nom de la propietat index és invàlid."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "Crea Subscripció"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr "No s'ha pogut instanciar l'script:"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
-msgstr ""
+#, fuzzy
+msgid "Inherits"
+msgstr "Hereta:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
-msgstr ""
+#, fuzzy
+msgid "Class Name"
+msgstr "Classe:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr "Treu la Selecció"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
+msgstr "Executa Script"
#: editor/script_create_dialog.cpp
#, fuzzy
@@ -6143,6 +6589,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6484,7 +6934,31 @@ msgstr "premut"
msgid "just released"
msgstr "alliberat"
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "No s'ha pogut crear la carpeta."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "No s'ha pogut crear la carpeta."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "No s'ha pogut crear la carpeta."
+
#: platform/uwp/export/export.cpp
+#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr ""
@@ -6656,10 +7130,11 @@ msgstr ""
"Un node ParallaxLayer només funciona quan s'estableix com a fill d'un node "
"ParallaxBackground."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"Cal que la propietat Camí (Path) assenyali cap a un node Particles2D vàlid."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6742,6 +7217,11 @@ msgstr ""
"NavigationMeshInstance ha de ser fill o nét d'un node Navigation. Només "
"proporciona dades de navegació."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6763,6 +7243,14 @@ msgstr ""
"Cal crear o establir un recurs SpriteFrames en la propietat 'Frames' perquè "
"AnimatedSprite3D dibuixi els quadres."
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Ep!"
@@ -6808,6 +7296,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6820,6 +7314,23 @@ msgstr ""
"forma per tal d'obtenir-ne la mida. Altrament, establiu-la com a Destinació "
"de Renderització i assigneu-ne la textura interna a algun node."
+#~ msgid "Node From Scene"
+#~ msgstr "Node de l'Escena"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Importa actius al projecte."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Exporta el projecte a diverses plataformes."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "Alerta en canviar un recurs extern."
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Cal que la propietat Camí (Path) assenyali cap a un node Particles2D "
+#~ "vàlid."
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
diff --git a/editor/translations/cs.po b/editor/translations/cs.po
index 72cee55e6b..d2420e32ed 100644
--- a/editor/translations/cs.po
+++ b/editor/translations/cs.po
@@ -4,19 +4,20 @@
#
# Jan 'spl!te' Kondelík <j.kondelik@centrum.cz>, 2016.
# Luděk Novotný <gladosicek@gmail.com>, 2016.
+# Martin Novák <maidx@seznam.cz>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2016-08-11 15:01+0000\n"
-"Last-Translator: Luděk Novotný <gladosicek@gmail.com>\n"
+"PO-Revision-Date: 2017-01-12 15:39+0000\n"
+"Last-Translator: Martin Novák <maidx@seznam.cz>\n"
"Language-Team: Czech <https://hosted.weblate.org/projects/godot-engine/godot/"
"cs/>\n"
"Language: cs\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
-"X-Generator: Weblate 2.8-dev\n"
+"X-Generator: Weblate 2.11-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -357,6 +358,181 @@ msgstr "Změnit typ hodnot pole"
msgid "Change Array Value"
msgstr "Změnit hodnotu pole"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Spojité"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Soubor:"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Zavřít"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Připojit.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Připojit k uzlu:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Připojit.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Testované"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Chyba nahrávání fontu."
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Všechny"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -364,6 +540,30 @@ msgstr "Změnit hodnotu pole"
msgid "Search:"
msgstr "Hledat:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Hledat"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Řadit:"
@@ -377,10 +577,6 @@ msgid "Category:"
msgstr "Kategorie:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Všechny"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Web:"
@@ -392,7 +588,7 @@ msgstr "Podpora.."
msgid "Official"
msgstr "Oficiální"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Z komunity"
@@ -410,21 +606,7 @@ msgstr "Seznam metod '%s':"
#: editor/call_dialog.cpp modules/visual_script/visual_script_editor.cpp
msgid "Call"
-msgstr "Volat"
-
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Zavřít"
+msgstr "Zavolat"
#: editor/call_dialog.cpp
msgid "Method List:"
@@ -476,13 +658,6 @@ msgid "Selection Only"
msgstr "Pouze výběr"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Hledat"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Najít"
@@ -557,6 +732,7 @@ msgstr "Přidat"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Odebrat"
@@ -632,11 +808,6 @@ msgstr ""
msgid "Matches:"
msgstr "Shody:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Hledat náhradu za:"
@@ -671,6 +842,7 @@ msgstr "Zdroj"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Cesta"
@@ -773,8 +945,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -784,6 +955,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -847,15 +1019,14 @@ msgstr ""
#: editor/editor_autoload_settings.cpp
msgid "Enable"
-msgstr ""
+msgstr "Povolit"
#: editor/editor_autoload_settings.cpp
msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Cesta:"
@@ -867,11 +1038,11 @@ msgstr ""
#: editor/io_plugins/editor_scene_import_plugin.cpp
#: editor/plugins/sample_library_editor_plugin.cpp editor/project_manager.cpp
msgid "Name"
-msgstr ""
+msgstr "Název"
#: editor/editor_autoload_settings.cpp
msgid "Singleton"
-msgstr ""
+msgstr "Singleton"
#: editor/editor_autoload_settings.cpp
msgid "List:"
@@ -921,7 +1092,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1046,7 +1217,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1063,7 +1235,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1119,10 +1290,6 @@ msgstr ""
msgid "Clear"
msgstr "VyÄistit"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1238,8 +1405,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1293,6 +1460,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1349,7 +1520,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1387,6 +1558,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1439,7 +1614,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1464,101 +1639,43 @@ msgstr "Zpět"
#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Redo"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
+msgstr "Znovu"
#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
-msgstr ""
+#, fuzzy
+msgid "Project"
+msgstr "Nastavení projektu"
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr ""
+msgid "Project Settings"
+msgstr "Nastavení projektu"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr ""
+msgid "Run Script"
+msgstr "Spustit skript"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1629,9 +1746,10 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr ""
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Upravit"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1650,14 +1768,71 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
msgstr ""
#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Přehrát vlastní scénu"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Play Custom Scene"
+msgstr "Přehrát vlastní scénu"
+
+#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
msgstr ""
@@ -1738,6 +1913,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1765,12 +1948,36 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Otevřít složku"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Otevřít složku"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Editor závislostí"
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Editor závislostí"
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -1932,8 +2139,9 @@ msgid "No version.txt found inside templates."
msgstr ""
#: editor/export_template_manager.cpp
+#, fuzzy
msgid "Error creating path for templates:\n"
-msgstr ""
+msgstr "Chyba při vytváření podpisového objektu."
#: editor/export_template_manager.cpp
msgid "Extracting Export Templates"
@@ -2014,6 +2222,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2042,10 +2254,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2212,7 +2420,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2286,7 +2494,7 @@ msgstr "Neplatná velikost fontu."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Invalid font custom source."
-msgstr ""
+msgstr "Nevalidní písmo z vlastního zdroje."
#: editor/io_plugins/editor_font_import_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp
@@ -2687,7 +2895,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3350,7 +3558,7 @@ msgid "Change default type"
msgstr "Změnit typ hodnot pole"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "OK"
@@ -3399,15 +3607,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3438,6 +3637,33 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Přidat signál"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Odstranit signál"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3708,6 +3934,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3720,7 +3959,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3731,6 +3970,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3740,6 +3996,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3752,11 +4012,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3768,26 +4028,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3842,6 +4118,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Odstranit funkci"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3995,6 +4280,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4083,10 +4372,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4120,15 +4405,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4184,6 +4461,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4234,6 +4527,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4255,6 +4556,15 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Připojit k uzlu:"
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4277,6 +4587,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4494,35 +4808,97 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "KoleÄko dolů."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Změnit"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "Audio Listener"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4582,23 +4958,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "Všechny vybrané"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Local Coords"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4626,27 +5011,15 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4670,14 +5043,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5016,8 +5381,9 @@ msgid "Error"
msgstr ""
#: editor/project_export.cpp
+#, fuzzy
msgid "Runnable"
-msgstr ""
+msgstr "Povolit"
#: editor/project_export.cpp
#, fuzzy
@@ -5093,11 +5459,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5109,7 +5475,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5145,10 +5511,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5207,6 +5569,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Odstranit výběr"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5325,6 +5692,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Zařízení"
@@ -5390,8 +5761,9 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr ""
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Nastavení projektu"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5457,10 +5829,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5510,13 +5878,9 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
-msgstr "Cesta k uzlu:"
+msgstr "Vložit uzly"
#: editor/property_editor.cpp
msgid "Bit %d, val %d."
@@ -5701,6 +6065,11 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Zdroj"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5742,8 +6111,9 @@ msgid "Save Branch as Scene"
msgstr ""
#: editor/scene_tree_dock.cpp
+#, fuzzy
msgid "Copy Node Path"
-msgstr ""
+msgstr "Zkopírovat uzly"
#: editor/scene_tree_dock.cpp
#, fuzzy
@@ -5777,10 +6147,57 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Spustit skript"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5825,80 +6242,93 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr ""
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Nelze vytvořit složku."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr ""
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "Chyba nahrávání fontu."
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr ""
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Neplatná cesta."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Error loading script from %s"
-msgstr "Chyba nahrávání fontu."
+msgid "Invalid inherited parent name or path"
+msgstr "Neplatné jméno vlastnosti."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "Vytvořit odběr"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Class Name"
msgstr ""
#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr "Odstranit výběr"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
+msgstr "Spustit skript"
+
+#: editor/script_create_dialog.cpp
msgid "Attach Node Script"
msgstr ""
@@ -6067,6 +6497,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6074,15 +6508,16 @@ msgstr ""
#: modules/visual_script/visual_script_builtin_funcs.cpp
msgid "Invalid type argument to convert(), use TYPE_* constants."
msgstr ""
+"Neplatný typ argumentu funkce convert(), použijte některou z konstant TYPE_*"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
msgid "Not enough bytes for decoding bytes, or invalid format."
-msgstr ""
+msgstr "Nedostatek bajtů pro dekódování bajtů, nebo špatný formát."
#: modules/gdscript/gd_functions.cpp
msgid "step argument is zero!"
-msgstr ""
+msgstr "Argument kroku je nula!"
#: modules/gdscript/gd_functions.cpp
msgid "Not a script with an instance"
@@ -6219,20 +6654,27 @@ msgid "Add Node"
msgstr "Přidat uzel"
#: modules/visual_script/visual_script_editor.cpp
+#, fuzzy
msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature."
msgstr ""
+"Podržte Meta k uvolnění getteru. Podržte Shift k uvolnění generického "
+"podpisu."
#: modules/visual_script/visual_script_editor.cpp
+#, fuzzy
msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature."
msgstr ""
+"Podržte Ctrl k uvolnění getteru. Podržte Shift k uvolnění generického "
+"podpisu."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a simple reference to the node."
-msgstr ""
+msgstr "Podržte Meta k uvolnění jednoduché reference na uzel."
#: modules/visual_script/visual_script_editor.cpp
+#, fuzzy
msgid "Hold Ctrl to drop a simple reference to the node."
-msgstr ""
+msgstr "Podržte Ctrl k uvolnění jednoduché reference na uzel."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a Variable Setter."
@@ -6243,13 +6685,12 @@ msgid "Hold Ctrl to drop a Variable Setter."
msgstr ""
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Add Preload Node"
-msgstr "Přidat uzel"
+msgstr "PÅ™idat pÅ™edem naÄtený uzel"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Node(s) From Tree"
-msgstr "Přidat uzel (uzly) ze stromu"
+msgstr "Přidat uzel(y) ze stromu"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Getter Property"
@@ -6266,7 +6707,7 @@ msgstr "Přechod"
#: modules/visual_script/visual_script_editor.cpp
msgid "Sequence"
-msgstr ""
+msgstr "Sekvence"
#: modules/visual_script/visual_script_editor.cpp
msgid "Switch"
@@ -6274,16 +6715,15 @@ msgstr ""
#: modules/visual_script/visual_script_editor.cpp
msgid "Iterator"
-msgstr ""
+msgstr "Iterátor"
#: modules/visual_script/visual_script_editor.cpp
msgid "While"
msgstr ""
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Return"
-msgstr "Vrátit:"
+msgstr "Vrátit"
#: modules/visual_script/visual_script_editor.cpp
msgid "Get"
@@ -6324,28 +6764,27 @@ msgstr "Vyhledat typ uzlu"
#: modules/visual_script/visual_script_editor.cpp
msgid "Copy Nodes"
-msgstr ""
+msgstr "Zkopírovat uzly"
#: modules/visual_script/visual_script_editor.cpp
msgid "Cut Nodes"
-msgstr ""
+msgstr "Vyjmout uzly"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Paste Nodes"
-msgstr "Cesta k uzlu:"
+msgstr "Vložit uzly"
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Input type not iterable: "
-msgstr ""
+msgstr "Vstupním typem nelze iterovat: "
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Iterator became invalid"
-msgstr ""
+msgstr "Iterátor se stal neplatným"
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Iterator became invalid: "
-msgstr ""
+msgstr "Iterátor se stal neplatným: "
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Invalid index property name."
@@ -6388,99 +6827,133 @@ msgid ""
"Invalid return value from _step(), must be integer (seq out), or string "
"(error)."
msgstr ""
+"Neplatná návratová hodnota z funkce _step(). Musí být celé Äíslo (výstupní "
+"posloupnost), nebo řetězec (chyba)."
#: modules/visual_script/visual_script_nodes.cpp
msgid "just pressed"
-msgstr ""
+msgstr "právě stisknuto"
#: modules/visual_script/visual_script_nodes.cpp
msgid "just released"
+msgstr "právě uvolněno"
+
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
msgstr ""
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "Nelze vytvořit složku."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "Nelze vytvořit složku."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "Nelze vytvořit složku."
+
#: platform/uwp/export/export.cpp
+#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr ""
+"NepodaÅ™ilo se pÅ™eÄíst soubor certifikátu. Jsou cesta a heslo obÄ› korektní?"
#: platform/uwp/export/export.cpp
msgid "Error creating the signature object."
-msgstr ""
+msgstr "Chyba při vytváření podpisového objektu."
#: platform/uwp/export/export.cpp
msgid "Error creating the package signature."
-msgstr ""
+msgstr "Chyba pÅ™i vytváření podpisu balíÄku."
#: platform/uwp/export/export.cpp
+#, fuzzy
msgid ""
"No export templates found.\n"
"Download and install export templates."
msgstr ""
+"Nebyly nalezeny žádné exportní šablony.\n"
+"Stáhněte a nainstalujte exportní šablony."
#: platform/uwp/export/export.cpp
msgid "Custom debug package not found."
-msgstr ""
+msgstr "Vlastní ladící balíÄek nebyl nalezen."
#: platform/uwp/export/export.cpp
+#, fuzzy
msgid "Custom release package not found."
-msgstr ""
+msgstr "Vlastní balíÄek k uveÅ™ejnÄ›ní nebyl nalezen."
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid "Invalid unique name."
-msgstr "Neplatný název."
+msgstr "Neplatný unikátní název."
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid "Invalid product GUID."
-msgstr "Neplatná velikost fontu."
+msgstr "Neplatné GUID produktu."
#: platform/uwp/export/export.cpp
msgid "Invalid publisher GUID."
-msgstr ""
+msgstr "Neplatné GUID vydavatele."
#: platform/uwp/export/export.cpp
msgid "Invalid background color."
-msgstr ""
+msgstr "Neplatná barva pozadí."
#: platform/uwp/export/export.cpp
msgid "Invalid Store Logo image dimensions (should be 50x50)."
-msgstr ""
+msgstr "Neplatné rozměry Store Logo obrázku (měly by být 50x50)."
#: platform/uwp/export/export.cpp
msgid "Invalid square 44x44 logo image dimensions (should be 44x44)."
-msgstr ""
+msgstr "Neplatné rozměry Square 44x44 Logo obrázku (měly by být 44x44)."
#: platform/uwp/export/export.cpp
msgid "Invalid square 71x71 logo image dimensions (should be 71x71)."
-msgstr ""
+msgstr "Neplatné rozměry Square 71x71 Logo obrázku (měly by být 71x71)."
#: platform/uwp/export/export.cpp
msgid "Invalid square 150x150 logo image dimensions (should be 150x150)."
-msgstr ""
+msgstr "Neplatné rozměry Square 150x150 Logo obrázku (měly by být 150x150)."
#: platform/uwp/export/export.cpp
msgid "Invalid square 310x310 logo image dimensions (should be 310x310)."
-msgstr ""
+msgstr "Neplatné rozměry Square 310x310 Logo obrázku (měly by být 310x310)."
#: platform/uwp/export/export.cpp
msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)."
-msgstr ""
+msgstr "Neplatné rozměry Square 310x150 Logo obrázku (měly by být 310x150)."
#: platform/uwp/export/export.cpp
msgid "Invalid splash screen image dimensions (should be 620x300)."
-msgstr ""
+msgstr "Neplatné rozměry obrázku uvítací obrazovky (měly by být 620x300)."
#: scene/2d/animated_sprite.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
"order for AnimatedSprite to display frames."
msgstr ""
+"Aby AnimatedSprite mohl zobrazovat snímky, zdroj SpriteFrames musí být "
+"vytvořen nebo nastaven v vlastnosti 'Frames'."
#: scene/2d/canvas_modulate.cpp
msgid ""
"Only one visible CanvasModulate is allowed per scene (or set of instanced "
"scenes). The first created one will work, while the rest will be ignored."
msgstr ""
+"Je povolená jen jedna viditelná CanvasModulate na scénu (nebo množinu "
+"instancovaných scén). První vytvořená bude fungovat, ostatní budou "
+"ignorovány."
#: scene/2d/collision_polygon_2d.cpp
msgid ""
@@ -6509,10 +6982,11 @@ msgstr ""
"jejich tvaru."
#: scene/2d/collision_shape_2d.cpp
+#, fuzzy
msgid ""
"A shape must be provided for CollisionShape2D to function. Please create a "
"shape resource for it!"
-msgstr ""
+msgstr "CollisionShape2D musí obsahovat tvar. Prosím vytvořte zdrojový tvar."
#: scene/2d/light_2d.cpp
msgid ""
@@ -6552,11 +7026,11 @@ msgid ""
msgstr ""
"Uzel ParallaxLayer funguje pouze když je dítětem uzlu ParallaxBackground."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"Aby ParticleAttractor2D fungoval, musí vlastnost path ukazovat na platný "
-"uzel Particles2D."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6635,6 +7109,11 @@ msgstr ""
"NavigationMeshInstance musí být dítÄ›tem nebo vnouÄetem uzlu Navigation. "
"Poskytuje pouze data pro navigaci."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6657,6 +7136,14 @@ msgstr ""
"Zdroj SpriteFrames musí být vytvořen nebo nastaven ve vlastnosti 'Frames', "
"aby mohl AnimatedSprite3D zobrazit rámeÄky."
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Pozor!"
@@ -6702,6 +7189,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6714,6 +7207,11 @@ msgstr ""
"mohl získat velikost. Jinak ho nastavte jako render target a pÅ™iÅ™aÄte jeho "
"vnitřní texturu nějakému uzlu k zobrazení."
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Aby ParticleAttractor2D fungoval, musí vlastnost path ukazovat na platný "
+#~ "uzel Particles2D."
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
diff --git a/editor/translations/da.po b/editor/translations/da.po
index 1cbf5ad454..51a0b05e3b 100644
--- a/editor/translations/da.po
+++ b/editor/translations/da.po
@@ -356,6 +356,181 @@ msgstr "Skift Array værditype"
msgid "Change Array Value"
msgstr "Ændre Array-værdi"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Kontinuerlig"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Fil:"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Luk"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Forbind..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Opret forbindelse til Node:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Forbind..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Tester"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Error loading skrifttype."
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Alle"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -363,6 +538,30 @@ msgstr "Ændre Array-værdi"
msgid "Search:"
msgstr "Søgning:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Søg"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Sorter:"
@@ -376,10 +575,6 @@ msgid "Category:"
msgstr "Kategori:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Alle"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Websted:"
@@ -391,7 +586,7 @@ msgstr "Støtte..."
msgid "Official"
msgstr "Officiel"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Fællesskabet"
@@ -411,20 +606,6 @@ msgstr "Metode liste For '%s':"
msgid "Call"
msgstr "Kald"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Luk"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Metode liste:"
@@ -475,13 +656,6 @@ msgid "Selection Only"
msgstr "Kun Valgte"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Søg"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Find"
@@ -556,6 +730,7 @@ msgstr "Tilføj"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Fjern"
@@ -631,11 +806,6 @@ msgstr ""
msgid "Matches:"
msgstr "Matches:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Søg erstatning For:"
@@ -670,6 +840,7 @@ msgstr "Ressource"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Sti"
@@ -770,8 +941,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -781,6 +951,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -849,8 +1020,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Sti:"
@@ -916,7 +1086,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1041,7 +1211,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1058,7 +1229,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1114,10 +1284,6 @@ msgstr ""
msgid "Clear"
msgstr "Clear"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1233,8 +1399,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1288,6 +1454,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1344,7 +1514,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1382,6 +1552,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1434,7 +1608,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1462,50 +1636,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1513,47 +1660,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1624,9 +1739,10 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr ""
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Rediger"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1645,11 +1761,67 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1733,6 +1905,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1760,12 +1940,36 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Ã…bn en mappe"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Ã…bn en mappe"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Afhængigheds Editor"
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Afhængigheds Editor"
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2009,6 +2213,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2037,10 +2245,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2207,7 +2411,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2682,7 +2886,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3344,7 +3548,7 @@ msgid "Change default type"
msgstr "Skift Array værditype"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "Ok"
@@ -3393,15 +3597,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3432,6 +3627,33 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Tilføj Signal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Fjern Signal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3702,6 +3924,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3714,7 +3949,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3725,6 +3960,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3734,6 +3986,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3746,11 +4002,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3762,26 +4018,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3836,6 +4108,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Fjern Funktion"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3989,6 +4270,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4077,10 +4362,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4114,15 +4395,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4178,6 +4451,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4228,6 +4517,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4249,6 +4546,15 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Opret forbindelse til Node:"
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4271,6 +4577,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4488,35 +4798,98 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "Baglæns"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Hjulet ned."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Skift"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4576,23 +4949,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "All selection"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Transform"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4620,27 +5002,15 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4664,14 +5034,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5085,11 +5447,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5101,7 +5463,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5137,10 +5499,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5199,6 +5557,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Fjern markering"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5317,6 +5680,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Enhed"
@@ -5382,7 +5749,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5449,10 +5816,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5502,10 +5865,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "Sti til Node:"
@@ -5693,6 +6052,11 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Ressource"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5768,10 +6132,57 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Opret abonnement"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5816,77 +6227,89 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr ""
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Kunne ikke oprette mappe."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr ""
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "Error loading skrifttype."
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr ""
+#, fuzzy
+msgid "Invalid Path"
+msgstr ": Ugyldige argumenter: "
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Error loading script from %s"
-msgstr "Error loading skrifttype."
+msgid "Invalid inherited parent name or path"
+msgstr "Ugyldigt index egenskabsnavn."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "Opret abonnement"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Class Name"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr "Fjern markering"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6058,6 +6481,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6390,6 +6817,29 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "Kunne ikke oprette mappe."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "Kunne ikke oprette mappe."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "Kunne ikke oprette mappe."
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6552,9 +7002,11 @@ msgstr ""
"ParallaxLayer node virker kun, når den angives som barn af en "
"ParallaxBackground node."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
-msgstr "Egenskaben Path skal pege på en gyldig Particles2D node for at virke."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6635,6 +7087,11 @@ msgstr ""
"NavigationMeshInstance skal være et barn eller barnebarn til en Navigation "
"node. Det giver kun navigationsdata."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6655,6 +7112,14 @@ msgstr ""
"En SpriteFrames ressource skal oprettes eller angivets i egenskaben 'Frames' "
"for at AnimatedSprite3D kan vise frames."
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Advarsel!"
@@ -6700,6 +7165,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6712,6 +7183,10 @@ msgstr ""
"den kan opnå en størrelse. Ellers gør den til en RenderTarget og tildel dens "
"indre textur til en node så den kan vises."
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Egenskaben Path skal pege på en gyldig Particles2D node for at virke."
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
diff --git a/editor/translations/de.po b/editor/translations/de.po
index 678cc1e347..894f7b6028 100644
--- a/editor/translations/de.po
+++ b/editor/translations/de.po
@@ -6,15 +6,17 @@
# Andreas Esau <andreasesau@gmail.com>, 2016.
# Andreas Haas <liu.gam3@gmail.com>, 2016.
# Andreas Hirschauer <andreas@hirschauer-it.de>, 2016.
-# Christian Fisch <christian.fiesel@gmail.com>, 2016.
+# Christian Fisch <christian.fiesel@gmail.com>, 2016-2017.
# danjo <atze@libra.uberspace.de>, 2016.
+# Eurocloud KnowHow <tobias.kloy@werde-volunteer.info>, 2017.
# hyperglow <greensoma@web.de>, 2016.
# Jan Groß <jan@grossit.de>, 2016.
-# Oliver Ruehl <oliver@ruehldesign.co>, 2016.
+# Kim <github@aggsol.de>, 2017.
+# Oliver Ruehl <oliver@ruehldesign.co>, 2016-2017.
# Paul-Vincent Roll <paviro@me.com>, 2016.
# Peter Friedland <peter_friedland@gmx.de>, 2016.
# No need for a name <endoplasmatik@gmx.net>, 2016.
-# So Wieso <sowieso@dukun.de>, 2016.
+# So Wieso <sowieso@dukun.de>, 2016-2017.
# Timo Schwarzer <account@timoschwarzer.com>, 2016.
# viernullvier <hannes.breul+github@gmail.com>, 2016.
#
@@ -22,7 +24,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2016-12-10 04:27+0000\n"
+"PO-Revision-Date: 2017-04-12 03:22+0000\n"
"Last-Translator: So Wieso <sowieso@dukun.de>\n"
"Language-Team: German <https://hosted.weblate.org/projects/godot-engine/"
"godot/de/>\n"
@@ -31,7 +33,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.10-dev\n"
+"X-Generator: Weblate 2.13-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -373,6 +375,184 @@ msgstr "Wertetyp des Arrays ändern"
msgid "Change Array Value"
msgstr "Array-Wert ändern"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "Version:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Konstanten:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Datei"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Beschreibung:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "Installieren"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Schließen"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Verbinde.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Verbinde mit Node:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Angefordertes Dateiformat unbekannt:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Speichere.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Verbinde.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Testphase"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Fehler beim speichern der Ressource!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Herunter"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Alle"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -380,6 +560,30 @@ msgstr "Array-Wert ändern"
msgid "Search:"
msgstr "Suche:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Suche"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "Import"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "Erweiterungen"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Sortiere:"
@@ -393,10 +597,6 @@ msgid "Category:"
msgstr "Kategorie:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Alle"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Seite:"
@@ -408,7 +608,7 @@ msgstr "Unterstützung.."
msgid "Official"
msgstr "Offiziell"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Gemeinschaft"
@@ -428,20 +628,6 @@ msgstr "Methodenliste für '%s':"
msgid "Call"
msgstr "Aufruf"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Schließen"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Methodenliste:"
@@ -492,13 +678,6 @@ msgid "Selection Only"
msgstr "Nur Auswahl"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Suche"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Finde"
@@ -575,6 +754,7 @@ msgstr "Hinzufügen"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Entfernen"
@@ -650,11 +830,6 @@ msgstr "Kürzlich:"
msgid "Matches:"
msgstr "Treffer:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "Beschreibung:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Suche Ersatz für:"
@@ -689,6 +864,7 @@ msgstr "Ressource"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Pfad"
@@ -778,23 +954,23 @@ msgstr "Löschen"
#: editor/editor_audio_buses.cpp
msgid "Save Audio Bus Layout As.."
-msgstr ""
+msgstr "Audiobus-Layout speichern als…"
#: editor/editor_audio_buses.cpp
+#, fuzzy
msgid "Location for New Layout.."
-msgstr ""
+msgstr "Ort für neues Layout…"
#: editor/editor_audio_buses.cpp
msgid "Open Audio Bus Layout"
-msgstr ""
+msgstr "Öffne Audiobus-Layout"
#: editor/editor_audio_buses.cpp
#, fuzzy
msgid "Add Bus"
msgstr "%s hinzufügen"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "Lade"
@@ -804,6 +980,7 @@ msgid "Save As"
msgstr "Speichern als"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Standard"
@@ -878,8 +1055,7 @@ msgid "Rearrange Autoloads"
msgstr "Autoloads neu anordnen"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Pfad:"
@@ -945,9 +1121,9 @@ msgstr "Speichere Datei:"
msgid "Packing"
msgstr "Packe"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "Template-Datei nicht gefunden:\n"
#: editor/editor_export.cpp
msgid "Added:"
@@ -1071,7 +1247,8 @@ msgstr "Lese Quellen"
msgid "(Re)Importing Assets"
msgstr "Importiere erneut"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "Hilfe durchsuchen"
@@ -1088,7 +1265,6 @@ msgid "Class:"
msgstr "Klasse:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "Erbt:"
@@ -1121,13 +1297,12 @@ msgid "Constants:"
msgstr "Konstanten:"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Property Description:"
-msgstr "Kurze Beschreibung:"
+msgstr "Eigenschaft-Beschreibung:"
#: editor/editor_help.cpp
msgid "Method Description:"
-msgstr "Methoden Beschreibung:"
+msgstr "Methoden-Beschreibung:"
#: editor/editor_help.cpp
msgid "Search Text"
@@ -1144,10 +1319,6 @@ msgstr " Ausgabe:"
msgid "Clear"
msgstr "Löschen"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Node aus Szene"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1263,10 +1434,11 @@ msgid "There is no defined scene to run."
msgstr "Es ist keine zu startende Szene definiert."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"Es ist keine Hauptszene definiert worden.\n"
"Wähle eine in den Projekteinstellungen unter der Kategorie „Anwendung“."
@@ -1330,6 +1502,11 @@ msgid "Save Scene As.."
msgstr "Szene speichern als.."
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Node"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr "Diese Szene wurde nie gespeichert. Speichern vorm Starten?"
@@ -1388,9 +1565,13 @@ msgid ""
"Scene '%s' was automatically imported, so it can't be modified.\n"
"To make changes to it, a new inherited scene can be created."
msgstr ""
+"Szene ‚%s‘ wurde automatisch importiert und kann daher nicht verändert "
+"werden.\n"
+"Um Änderungen an der Szene vorzunehmen kann eine abgeleitete Szene erstellt "
+"werden."
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "Ähm"
@@ -1431,6 +1612,10 @@ msgstr "%d weitere Datei(en)"
msgid "%d more file(s) or folder(s)"
msgstr "%d weitere Datei(en) oder Ordner"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "Ablenkungsfreier Modus"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Szene"
@@ -1484,7 +1669,7 @@ msgstr "Szene schließen"
msgid "Close Goto Prev. Scene"
msgstr "Schließen und zur letzten Szene wechseln"
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "Zuletzt benutzte Szenen"
@@ -1512,99 +1697,41 @@ msgid "Redo"
msgstr "Wiederherstellen"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "Skript ausführen"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Projekteinstellungen"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "Szene zurücksetzen"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Verlasse zur Projektverwaltung"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Ablenkungsfreier Modus"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "Importiere Medieninhalte ins Projekt."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "Import"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "Sonstiges Projekt oder szenenübergreifende Werkzeuge."
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "Werkzeuge"
+#, fuzzy
+msgid "Project"
+msgstr "Neues Projekt"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "Exportiere das Projekt für viele Plattformen."
+msgid "Project Settings"
+msgstr "Projekteinstellungen"
+
+#: editor/editor_node.cpp
+msgid "Run Script"
+msgstr "Skript ausführen"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "Exportieren"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "Projekt abspielen."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "Abspielen"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "Szene pausieren"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "Szene pausieren"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "Szene stoppen."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "Stop"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "Spiele die bearbeitete Szene."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "Szene starten"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "Spiele angepasste Szene"
+msgid "Tools"
+msgstr "Werkzeuge"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "Spiele angepasste Szene"
+msgid "Quit to Project List"
+msgstr "Verlasse zur Projektverwaltung"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "Fehlerbehebungsoptionen"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "Debuggen"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1694,9 +1821,10 @@ msgstr ""
"Sollte dies beim Abspielen auf externen Geräten genutzt werden, ist es am "
"effizientesten das Netzwerk-Dateisystem zu nutzen."
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "Einstellungen"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Bearbeiten"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1716,12 +1844,69 @@ msgid "Manage Export Templates"
msgstr "Lade Exportvorlagen"
#: editor/editor_node.cpp
+msgid "Help"
+msgstr "Hilfe"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "Klassen"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "Dokumentation schließen"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr "Über"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "Signalisiert, wenn sich eine externe Ressource verändert hat."
+msgid "Play the project."
+msgstr "Projekt abspielen."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "Starten"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "Szene pausieren"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "Szene pausieren"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Szene stoppen."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "Stop"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "Spiele die bearbeitete Szene."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Szene starten"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Spiele angepasste Szene"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "Spiele angepasste Szene"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1804,6 +1989,14 @@ msgid "Thanks!"
msgstr "Danke!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "Vorlagen aus ZIP-Datei importieren"
@@ -1831,15 +2024,41 @@ msgstr "Skript öffnen und ausführen"
msgid "Load Errors"
msgstr "Ladefehler"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Im Editor öffnen"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Im Editor öffnen"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Im Editor öffnen"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "Bibliothek exportieren"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Im Editor öffnen"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "Im Editor öffnen"
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "Installierte Erweiterungen:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "Version:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "Autor:"
@@ -1973,7 +2192,7 @@ msgstr "Herunter"
#: editor/export_template_manager.cpp
msgid "(Missing)"
-msgstr ""
+msgstr "(Fehlend)"
#: editor/export_template_manager.cpp
#, fuzzy
@@ -1982,7 +2201,7 @@ msgstr "Laufend:"
#: editor/export_template_manager.cpp
msgid "Remove template version '%s'?"
-msgstr ""
+msgstr "Template-Version ‚%s‘ entfernen?"
#: editor/export_template_manager.cpp
msgid "Can't open export templates zip."
@@ -1990,17 +2209,19 @@ msgstr "Exportvorlagen-ZIP-Datei konnte nicht geöffnet werden."
#: editor/export_template_manager.cpp
msgid "Invalid version.txt format inside templates."
-msgstr ""
+msgstr "Ungültiges version.txt-Format in Templates."
#: editor/export_template_manager.cpp
msgid ""
"Invalid version.txt format inside templates. Revision is not a valid "
"identifier."
msgstr ""
+"Ungültiges version.txt-Format in Templates. Revision ist kein gültiger "
+"Bezeichner."
#: editor/export_template_manager.cpp
msgid "No version.txt found inside templates."
-msgstr ""
+msgstr "Keine version.txt in Templates gefunden."
#: editor/export_template_manager.cpp
#, fuzzy
@@ -2058,7 +2279,7 @@ msgstr ""
#: editor/filesystem_dock.cpp
msgid "Cannot navigate to '"
-msgstr ""
+msgstr "Kann Ordner ‚"
#: editor/filesystem_dock.cpp
msgid "Same source and destination files, doing nothing."
@@ -2091,7 +2312,11 @@ msgstr "Auf übergeordnetes Node ausdehnen"
#: editor/filesystem_dock.cpp
msgid "Collapse all"
-msgstr ""
+msgstr "Alle einklappen"
+
+#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "Zeige im Dateimanager"
#: editor/filesystem_dock.cpp
msgid "Instance"
@@ -2122,10 +2347,6 @@ msgid "Info"
msgstr "Info"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "Zeige im Dateimanager"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Neuimport.."
@@ -2292,9 +2513,10 @@ msgid "No target font resource!"
msgstr "Keine Zielschriftart-Ressource!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"Ungültige Dateiendung.\n"
"Nutze .fnt als Dateiendung."
@@ -2507,7 +2729,7 @@ msgstr "Post-Process Skript:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Custom Root Node Type:"
-msgstr "Angepasster Stamm-Node Typ:"
+msgstr "Angepasster Root-Node-Typ:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Auto"
@@ -2776,8 +2998,9 @@ msgid "Compress"
msgstr "Komprimieren"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr "Zu Projekt hinzufügen (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "Zu Projekt hinzufügen (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -3443,17 +3666,16 @@ msgid "Change default type"
msgstr "Standardtyp ändern"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "OK"
#: editor/plugins/canvas_item_editor_plugin.cpp
-#, fuzzy
msgid ""
"Drag & drop + Shift : Add node as sibling\n"
"Drag & drop + Alt : Change node type"
msgstr ""
-"Ziehen + Umschalt: Node in gleicher Hierarchie einfügen\n"
+"Ziehen + Umschalt: Node auf gleicher Ebene einfügen\n"
"Ziehen + Alt: Nodetyp ändern"
#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
@@ -3495,15 +3717,6 @@ msgstr "Polygon3D erstellen"
msgid "Set Handle"
msgstr "Wähle Griff"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "Farbverlaufspunkt hinzufügen/entfernen"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr "Farbverlauf anpassen"
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr "Erzeuge MeshLibrary"
@@ -3534,6 +3747,35 @@ msgstr "Aus Szene importieren"
msgid "Update from Scene"
msgstr "Aus Szene aktualisieren"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Eingang hinzufügen"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Pfadpunkt entfernen"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "Ressource laden"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Modify Curve"
+msgstr "Verändere Curve-Map"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "Farbverlaufspunkt hinzufügen/entfernen"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "Farbverlauf anpassen"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "Element %d"
@@ -3808,6 +4050,20 @@ msgid "Remove Poly And Point"
msgstr "Polygon und Punkt entfernen"
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "Emissionsmaske leeren"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "Erzeuge AABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "Fehler beim Laden des Bilds:"
@@ -3820,8 +4076,8 @@ msgid "Set Emission Mask"
msgstr "Emissionsmaske setzen"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
-msgstr "Emissionsmaske leeren"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -3831,6 +4087,27 @@ msgstr "Emissionsmaske laden"
msgid "Generated Point Count:"
msgstr "Anzahl generierter Punkte:"
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Durchschnittszeit (Sek)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "Emissionsmaske setzen"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "Von Szene erstellen"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Emissionsorte:"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr "Knoten enthält keine Geometrie."
@@ -3840,6 +4117,10 @@ msgid "Node does not contain geometry (faces)."
msgstr "Knoten enthält keine Geometrie (Flächen)."
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr "Ein Verarbeitungsmaterial des Typs ‚ParticlesMaterial‘ wird benötigt."
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "Flächen enthalten keinen Bereich!"
@@ -3852,11 +4133,13 @@ msgid "Generate AABB"
msgstr "Erzeuge AABB"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+#, fuzzy
+msgid "Create Emission Points From Mesh"
msgstr "Erzeuge Emittent aus Mesh"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+#, fuzzy
+msgid "Create Emission Points From Node"
msgstr "Erzeuge Emittent aus Node"
#: editor/plugins/particles_editor_plugin.cpp
@@ -3868,26 +4151,48 @@ msgid "Create Emitter"
msgstr "Erzeuge Emittent"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+#, fuzzy
+msgid "Emission Points:"
msgstr "Emissionsorte:"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr "Emissionsfüllung:"
+#, fuzzy
+msgid "Surface Points"
+msgstr "Oberfläche %d"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "Oberfläche"
+msgid "Surface Points+Normal (Directed)"
+msgstr "Oberflächenpunkte + Normale (gerichtet)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "Volumen"
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Source: "
+msgstr "Emissionsfüllung:"
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "Erzeuge AABB"
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr "Punkt von Kurve entfernen"
#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "Ausgangsgriff auf Kurve verschieben"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "Punkt von Kurve entfernen"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr "Punkt zu Kurve hinzufügen"
@@ -3942,6 +4247,16 @@ msgstr "Pfad aufteilen"
msgid "Remove Path Point"
msgstr "Pfadpunkt entfernen"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Ausgangsgriff auf Kurve verschieben"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "Eingangsgriff auf Kurve verschieben"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "Erzeuge UV-Map"
@@ -4095,6 +4410,11 @@ msgid "Pitch"
msgstr "Tonhöhe"
#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "Knochen entfernen"
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr "Fehler beim Speichern des Motivs"
@@ -4182,10 +4502,6 @@ msgstr "Finde.."
msgid "Find Next"
msgstr "Finde Nächstes"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "Debuggen"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr "Überspringen"
@@ -4219,16 +4535,9 @@ msgid "Move Right"
msgstr "nach rechts"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "Anleitungen"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "Öffnet https://godotengine.org im Abschnitt ‚Tutorials‘."
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "Klassen"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "Durchsuche die Referenzdokumentation."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
@@ -4287,6 +4596,23 @@ msgid "Pick Color"
msgstr "Farbe auswählen"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "Bilder werden konvertiert"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4337,6 +4663,14 @@ msgid "Trim Trailing Whitespace"
msgstr "kürze Leerraum am Zeilenende"
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr "Automatische Einrückung"
@@ -4358,6 +4692,16 @@ msgid "Goto Previous Breakpoint"
msgstr "Springe zum vorigen Haltepunkt"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "Umwandeln zu.."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Umwandeln zu.."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "Finde Vorheriges"
@@ -4380,6 +4724,10 @@ msgstr "Springe zu Zeile.."
msgid "Contextual Help"
msgstr "Kontexthilfe"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr "Ändere skalare Konstante"
@@ -4597,36 +4945,106 @@ msgid "Animation Key Inserted."
msgstr "Animationsschlüsselbild eingefügt."
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Vor"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "Rückwärts"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Mausrad runter."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Änderungen aktualisieren"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Änderungen aktualisieren"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "Änderungen aktualisieren"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "Vertex"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr "Auf Sicht ausrichten"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
-msgstr "Umgebung"
+msgid "Display Normal"
+msgstr "Normale Ansicht"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
-msgstr "Audiosenke"
+msgid "Display Wireframe"
+msgstr "Wireframe-Ansicht"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
-msgstr "Gizmos"
+msgid "Display Overdraw"
+msgstr "Overdraw-Ansicht"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
-msgstr "Transformationsdialog"
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Shadeless-Ansicht"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "Keine Szene für Instanz ausgewählt!"
+#, fuzzy
+msgid "View Environment"
+msgstr "Umgebung"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Instanz am Mauszeiger"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Gizmos"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "Konnte Szene nicht instantiieren!"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr "Audiosenke"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "Transformationsdialog"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4685,6 +5103,26 @@ msgid "Align Selection With View"
msgstr "Auswahl auf Ansicht ausrichten"
#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "Auswählen"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "Verschieben"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Strg: Rotieren"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "Skalierung:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
msgstr "Transformation"
@@ -4697,14 +5135,6 @@ msgid "Transform Dialog.."
msgstr "Transformationsdialog.."
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr "Nutze Standardlicht"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "Nutze Standard-sRGB"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
msgstr "Eine Ansicht"
@@ -4729,22 +5159,6 @@ msgid "4 Viewports"
msgstr "Vier Ansichten"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr "Normale Ansicht"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr "Wireframe-Ansicht"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr "Overdraw-Ansicht"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr "Shadeless-Ansicht"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr "Zeige Ursprung"
@@ -4753,6 +5167,10 @@ msgid "View Grid"
msgstr "Zeige Gitter"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Einstellungen"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "Einrasteinstellungen"
@@ -4773,14 +5191,6 @@ msgid "Viewport Settings"
msgstr "Einstellungen für Ansichten"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr "Standardlichtnormale:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr "Umgebungslichtfarbe:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr "Perspektivisches FOV (Grad):"
@@ -5198,7 +5608,7 @@ msgstr "Zielpfad:"
#: editor/project_export.cpp
msgid "Export templates for this platform are missing:"
-msgstr ""
+msgstr "Export-Templates für diese Systeme fehlen:"
#: editor/project_export.cpp
#, fuzzy
@@ -5210,12 +5620,14 @@ msgid "Invalid project path, the path must exist!"
msgstr "Ungültiger Projektpfad, der Pfad muss existieren!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "Ungültiger Projektpfad, godot.cfg darf nicht existieren."
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Ungültiger Projektpfad, engine.cfg darf nicht existieren."
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr "Ungültiger Projektpfad, godot.cfg muss existieren."
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "Ungültiger Projektpfad, engine.cfg muss existieren."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5226,8 +5638,9 @@ msgid "Invalid project path (changed anything?)."
msgstr "Ungültiger Projektpfad (etwas geändert?)."
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
-msgstr "Konnte godot.cfg in Projektpfad nicht erzeugen."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "Konnte engine.cfg in Projektpfad nicht erzeugen."
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
@@ -5262,10 +5675,6 @@ msgid "Install Project:"
msgstr "Installiere Projekt:"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "Installieren"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "Durchstöbern"
@@ -5326,6 +5735,11 @@ msgid "New Project"
msgstr "Neues Projekt"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Entferne Element"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "Verlassen"
@@ -5446,6 +5860,11 @@ msgstr "Füge Eingabeaktion hinzu"
msgid "Erase Input Action Event"
msgstr "Lösche Eingabeaktionsereignis"
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "Empty einfügen"
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Gerät"
@@ -5511,8 +5930,9 @@ msgid "Remove Resource Remap Option"
msgstr "Ressourcen-Remap-Option entfernen"
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr "Projekteinstellungen (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Projekteinstellungen (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5578,10 +5998,6 @@ msgstr "Lokalisierung"
msgid "AutoLoad"
msgstr "Autoload"
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "Erweiterungen"
-
#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Viewport"
@@ -5633,10 +6049,6 @@ msgid "Error loading file: Not a resource!"
msgstr "Fehler beim Laden der Datei: Keine Ressource!"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "Konnte Bild nicht laden"
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "Wähle ein Node"
@@ -5786,7 +6198,7 @@ msgstr "Diese Aktion kann nicht ohne eine Szene ausgeführt werden."
#: editor/scene_tree_dock.cpp
msgid "Can not perform with the root node."
-msgstr ""
+msgstr "Lässt sich nicht an Root-Node ausführen."
#: editor/scene_tree_dock.cpp
msgid "This operation can't be done on instanced scenes."
@@ -5829,6 +6241,11 @@ msgid "Error duplicating scene to save it."
msgstr "Fehler beim Duplizieren der Szene zum Speichern."
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Ressourcen:"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "Gruppen bearbeiten"
@@ -5887,7 +6304,7 @@ msgid ""
"exists."
msgstr ""
"Instantiiere eine Szenendatei als Node. Erzeugt eine geerbte Szene falls "
-"keine Root-Node existiert."
+"kein Root-Node existiert."
#: editor/scene_tree_dock.cpp
msgid "Attach a new or existing script for the selected node."
@@ -5906,10 +6323,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "CanvasItem-Sichtbarkeit umschalten"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Fehlerbehebungsoptionen"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "Instanz:"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Nächstes Skript"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Spatial-Sichtbarkeit umschalten"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
"Ungültiger Name für ein Node, die folgenden Zeichen sind nicht gestattet:"
@@ -5955,75 +6421,93 @@ msgid "Select a Node"
msgstr "Wähle ein Node"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "Ungültiger Name für Elternklasse"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Skript konnte nicht im Dateisystem erstellt werden."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "Gültige Zeichen:"
+msgid "Error loading script from %s"
+msgstr "Fehler beim Laden des Skripts von %s"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "Ungültiger Klassenname"
+msgid "Path is empty"
+msgstr "Pfad ist leer"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "Gültiger Name"
+msgid "Path is not local"
+msgstr "Pfad ist nicht lokal"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "Nicht verfügbar"
+msgid "Invalid base path"
+msgstr "Ungültiger Pfad"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "Name der Klasse ist ungültig!"
+msgid "Invalid extension"
+msgstr "Ungültige Erweiterung"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "Name der Elternklasse ist ungültig!"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "Ungültiger Pfad!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Ungültiger Pfad."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "Skript konnte nicht im Dateisystem erstellt werden."
+msgid "Invalid class name"
+msgstr "Ungültiger Klassenname"
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
-msgstr "Fehler beim Laden des Skripts von %s"
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "Ungültiger Name der Index-Eigenschaft."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "Pfad ist leer"
+#, fuzzy
+msgid "Script valid"
+msgstr "Skript"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "Pfad ist nicht lokal"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "Ungültiger Pfad"
+msgid "N/A"
+msgstr "Nicht verfügbar"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "Ungültige Erweiterung"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+#, fuzzy
+msgid "Create new script file"
msgstr "Neues Skript erstellen"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+#, fuzzy
+msgid "Load existing script file"
msgstr "Lade bestehendes Skript"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "Erbt:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "Klassenname:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Entferne Element"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "Built-In-Skript"
#: editor/script_create_dialog.cpp
@@ -6195,6 +6679,10 @@ msgid "Change Notifier Extents"
msgstr "Ändere Ausmaße des Benachrichtigers"
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
#, fuzzy
msgid "Change Probe Extents"
msgstr "Ändere Ausmaße des Benachrichtigers"
@@ -6203,7 +6691,7 @@ msgstr "Ändere Ausmaße des Benachrichtigers"
#: modules/visual_script/visual_script_builtin_funcs.cpp
msgid "Invalid type argument to convert(), use TYPE_* constants."
msgstr ""
-"Ungültiger Parametertyp in convert()-Aufruf, TYPE_*-Konstanten benötigt."
+"Ungültiger Argument-Typ in convert()-Aufruf, TYPE_*-Konstanten benötigt."
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6534,7 +7022,32 @@ msgstr "gerade gedrückt"
msgid "just released"
msgstr "gerade losgelassen"
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Run in Browser"
+msgstr "Durchstöbern"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr "Führe exportiertes HTML im Standard-Browser des Betriebssystems aus."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "Konnte Kachel nicht finden:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "Konnte Kachel nicht finden:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "Ordner konnte nicht erstellt werden."
+
#: platform/uwp/export/export.cpp
+#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr ""
@@ -6706,9 +7219,11 @@ msgstr ""
"Das ParallaxLayer-Node lässt sich nur als Unterobjekt eines "
"ParallaxBackground-Node verwenden."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
-msgstr "Die Pfad-Eigenschaft muss auf ein gültiges Particles2D-Node verweisen."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6792,6 +7307,11 @@ msgstr ""
"Eine NavigationMesh-Instanz muss ein Unterobjekt erster oder höherer Ordnung "
"eines Navigation-Nodes sein. Es liefert nur Navigationsdaten."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr "Die Pfad-Eigenschaft muss auf ein gültiges Spatial-Node verweisen."
@@ -6811,6 +7331,15 @@ msgstr ""
"Eine SpriteFrames-Ressource muss in der ‚Frames‘-Eigenschaft erzeugt oder "
"definiert werden, damit AnimatedSprite3D Einzelbilder anzeigen kann."
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "Ausführungsmodus:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Warnung!"
@@ -6856,6 +7385,17 @@ msgid ""
"Use a container as child (VBox,HBox,etc), or a Control and set the custom "
"minimum size manually."
msgstr ""
+"ScrollContainer sollte mit einem einzigen Control-Unterobjekt verwendet "
+"werden.\n"
+"Um die Minimalgröße einzustellen sollte ein Behälter (VBox, HBox, …) oder "
+"ein Control als Unterobjekt verwendet und dessen Minimalgröße eingestellt "
+"werden."
+
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
#: scene/main/viewport.cpp
msgid ""
@@ -6870,6 +7410,73 @@ msgstr ""
"Eigenschaft ‚Render Target‘ des Viewports aktiviert und seine Textur "
"irgendeinem Node zum Anzeigen zugewiesen werden."
+#~ msgid "Node From Scene"
+#~ msgstr "Node aus Szene"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Importiere Medieninhalte ins Projekt."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Exportiere das Projekt für viele Plattformen."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "Signalisiert, wenn sich eine externe Ressource verändert hat."
+
+#~ msgid "Tutorials"
+#~ msgstr "Anleitungen"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "Öffnet https://godotengine.org im Abschnitt ‚Tutorials‘."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "Keine Szene für Instanz ausgewählt!"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "Instanz am Mauszeiger"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "Konnte Szene nicht instantiieren!"
+
+#~ msgid "Use Default Light"
+#~ msgstr "Nutze Standardlicht"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "Nutze Standard-sRGB"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "Standardlichtnormale:"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "Umgebungslichtfarbe:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "Konnte Bild nicht laden"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "Ungültiger Name für Elternklasse"
+
+#~ msgid "Valid chars:"
+#~ msgstr "Gültige Zeichen:"
+
+#~ msgid "Valid name"
+#~ msgstr "Gültiger Name"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "Name der Klasse ist ungültig!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "Name der Elternklasse ist ungültig!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "Ungültiger Pfad!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Die Pfad-Eigenschaft muss auf ein gültiges Particles2D-Node verweisen."
+
+#~ msgid "Surface"
+#~ msgstr "Oberfläche"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
@@ -6914,33 +7521,51 @@ msgstr ""
#~ msgid "No exporter for platform '%s' yet."
#~ msgstr "Kein Exporter für Plattform ‚%s‘ verfügbar."
-#, fuzzy
#~ msgid "Create Android keystore"
-#~ msgstr "Erstelle neue Ressource"
+#~ msgstr "Erzeuge Android-Schlüssel"
-#, fuzzy
#~ msgid "Full name"
-#~ msgstr "Gültiger Name"
+#~ msgstr "Vollständiger Name"
+
+#~ msgid "Organizational unit"
+#~ msgstr "Organisatorische Einheit"
-#, fuzzy
#~ msgid "Organization"
-#~ msgstr "Übergang"
+#~ msgstr "Organisation"
+
+#~ msgid "City"
+#~ msgstr "Stadt"
-#, fuzzy
#~ msgid "State"
-#~ msgstr "Status:"
+#~ msgstr "Status"
+
+#~ msgid "2 letter country code"
+#~ msgstr "2-Buchstaben-Ländercode"
+
+#~ msgid "User alias"
+#~ msgstr "Nutzer-Alias"
-#, fuzzy
#~ msgid "Password"
-#~ msgstr "Passwort:"
+#~ msgstr "Passwort"
-#, fuzzy
#~ msgid "at least 6 characters"
-#~ msgstr "Gültige Zeichen:"
+#~ msgstr "Mindestens 6 Zeichen"
-#, fuzzy
#~ msgid "File name"
-#~ msgstr "Neuer Name:"
+#~ msgstr "Dateiname"
+
+#~ msgid "Path : (better to save outside of project)"
+#~ msgstr "Pfad: (besser außerhalb des Projektordners speichern)"
+
+#~ msgid ""
+#~ "Release keystore is not set.\n"
+#~ "Do you want to create one?"
+#~ msgstr ""
+#~ "Release-Schlüsselspeicher wurde nicht gewählt.\n"
+#~ "Soll einer erstellt werden?"
+
+#~ msgid "Fill Keystore/Release User and Release Password"
+#~ msgstr "Schlüsselspeicher, Nutzer und Passwort für Release eingeben"
#~ msgid "Include"
#~ msgstr "Einbeziehen"
@@ -7069,9 +7694,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "Auslaufende Stille:"
-#~ msgid "Script"
-#~ msgstr "Skript"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Skript-Exportmodus:"
@@ -7105,9 +7727,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance enthält keine BakedLight-Ressource."
-#~ msgid "Vertex"
-#~ msgstr "Vertex"
-
#~ msgid "Fragment"
#~ msgstr "Fragment"
@@ -7143,9 +7762,6 @@ msgstr ""
#~ msgid "Cannot go into subdir:"
#~ msgstr "Unterordner kann nicht geöffnet werden:"
-#~ msgid "Help"
-#~ msgstr "Hilfe"
-
#~ msgid "Imported Resources"
#~ msgstr "Importierte Ressourcen"
diff --git a/editor/translations/de_CH.po b/editor/translations/de_CH.po
index a057f5fbe9..15b70b2172 100644
--- a/editor/translations/de_CH.po
+++ b/editor/translations/de_CH.po
@@ -355,6 +355,178 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Datei(en) öffnen"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Verbindung zu Node:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Connections editieren"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Szene kann nicht gespeichert werden."
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -362,6 +534,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -375,10 +571,6 @@ msgid "Category:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr ""
@@ -390,7 +582,7 @@ msgstr ""
msgid "Official"
msgstr ""
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr ""
@@ -410,20 +602,6 @@ msgstr ""
msgid "Call"
msgstr ""
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr ""
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr ""
@@ -473,13 +651,6 @@ msgid "Selection Only"
msgstr ""
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr ""
@@ -555,6 +726,7 @@ msgstr ""
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr ""
@@ -630,11 +802,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -665,6 +832,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -765,8 +933,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -776,6 +943,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -844,8 +1012,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr ""
@@ -911,7 +1078,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1036,7 +1203,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1053,7 +1221,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1108,10 +1275,6 @@ msgstr ""
msgid "Clear"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Node von Szene"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1227,8 +1390,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1282,6 +1445,11 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Node"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1338,7 +1506,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1376,6 +1544,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1429,7 +1601,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1457,99 +1629,40 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Projekteinstellungen"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Zurück zur Projektliste"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "Assets zum Projekt importieren."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "Verschiedene Projekte oder Szenenweite Werkzeuge."
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "Exportiere das Projekt für viele Plattformen."
-
-#: editor/editor_node.cpp editor/project_export.cpp
-msgid "Export"
-msgstr ""
+#, fuzzy
+msgid "Project"
+msgstr "Projektname:"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "Projekt starten."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "Abspielen"
+msgid "Project Settings"
+msgstr "Projekteinstellungen"
#: editor/editor_node.cpp
-msgid "Pause the scene"
+msgid "Run Script"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Pause Scene"
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "Spiele die editierte Szene."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "Szene starten"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "Spiele angepasste Szene"
-
-#: editor/editor_node.cpp
-#, fuzzy
-msgid "Play Custom Scene"
-msgstr "Spiele angepasste Szene"
+msgid "Quit to Project List"
+msgstr "Zurück zur Projektliste"
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1623,8 +1736,8 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
+#: editor/editor_node.cpp
+msgid "Editor"
msgstr ""
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
@@ -1644,14 +1757,71 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr "Projekt starten."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "Abspielen"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
msgstr ""
#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "Spiele die editierte Szene."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Szene starten"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Spiele angepasste Szene"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Play Custom Scene"
+msgstr "Spiele angepasste Szene"
+
+#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
msgstr ""
@@ -1732,6 +1902,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1759,12 +1937,34 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Verzeichnis öffnen"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Verzeichnis öffnen"
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2008,6 +2208,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2036,10 +2240,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2206,7 +2406,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2685,8 +2885,9 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr "Zum Projekt hinzufügen (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "Zum Projekt hinzufügen (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -3356,7 +3557,7 @@ msgid "Change default type"
msgstr "Typ ändern"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "Okay"
@@ -3405,15 +3606,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3444,6 +3636,33 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Script hinzufügen"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Ungültige Bilder löschen"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3714,6 +3933,20 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Emission Mask"
+msgstr "Inhalt der Emissions-Masken löschen"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3726,9 +3959,8 @@ msgid "Set Emission Mask"
msgstr "Emissions-Maske setzen"
#: editor/plugins/particles_2d_editor_plugin.cpp
-#, fuzzy
-msgid "Clear Emission Mask"
-msgstr "Inhalt der Emissions-Masken löschen"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -3738,6 +3970,25 @@ msgstr "Emissions-Maske laden"
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "Emissions-Maske setzen"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Emissions-Maske setzen"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3747,6 +3998,10 @@ msgid "Node does not contain geometry (faces)."
msgstr "Node enthält keine Geometrie (Flächen)."
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "Flächen enthalten keinen Bereich!"
@@ -3759,11 +4014,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3775,19 +4030,29 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+#, fuzzy
+msgid "Emission Points:"
+msgstr "Emissions-Maske setzen"
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Points"
+msgstr "Oberfläche %d"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Volume"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "Oberfläche"
+msgid "Emission Source: "
+msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Volume"
+msgid "Generate Visibility AABB"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -3795,6 +4060,14 @@ msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3849,6 +4122,14 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove Out-Control Point"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -4002,6 +4283,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4089,10 +4374,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4126,15 +4407,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4189,6 +4462,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4239,6 +4528,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4260,6 +4557,15 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Verbindung zu Node:"
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4282,6 +4588,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4499,35 +4809,97 @@ msgid "Animation Key Inserted."
msgstr "Animationsbild eingefügt."
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Typ ändern"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "Oberfläche %d"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4588,71 +4960,67 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Select"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "1 Viewport"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "2 Viewports"
+msgid "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "2 Viewports (Alt)"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "3 Viewports"
+msgid "1 Viewport"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "3 Viewports (Alt)"
+msgid "2 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "4 Viewports"
+msgid "2 Viewports (Alt)"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
+msgid "3 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
+msgid "3 Viewports (Alt)"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
+msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4676,14 +5044,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5098,12 +5458,14 @@ msgid "Invalid project path, the path must exist!"
msgstr "Ungültiger Projektpfad, Pfad existiert nicht!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "Ungültiger Projektpfad, godot.cfg vorhanden!"
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Ungültiger Projektpfad, engine.cfg vorhanden!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr "Ungültiger Projektpfad, godot.cfg nicht vorhanden!"
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "Ungültiger Projektpfad, engine.cfg nicht vorhanden!"
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5114,8 +5476,9 @@ msgid "Invalid project path (changed anything?)."
msgstr "Ungültiger Projektpfad, (wurde was geändert?)!"
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
-msgstr "Die godot.cfg kann im Projektverzeichnis nicht erstellt werden."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "Die engine.cfg kann im Projektverzeichnis nicht erstellt werden."
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
@@ -5150,10 +5513,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5212,6 +5571,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Ungültige Bilder löschen"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5330,6 +5694,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr ""
@@ -5395,8 +5763,9 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr ""
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Projekteinstellungen"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5462,10 +5831,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5516,10 +5881,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "TimeScale-Node"
@@ -5706,6 +6067,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5783,10 +6148,57 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Script hinzufügen"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5831,77 +6243,86 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
+msgid "Error - Could not create script in filesystem."
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr ""
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "Fehler beim Instanzieren der %s Szene"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
+msgid "Invalid Path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-#, fuzzy
-msgid "Error loading script from %s"
-msgstr "Fehler beim Instanzieren der %s Szene"
+msgid "Invalid inherited parent name or path"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "Neues Projekt erstellen"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Class Name"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr "Ungültige Bilder löschen"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6074,6 +6495,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6403,6 +6828,26 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr ""
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6557,9 +7002,11 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
-msgstr "Die Pfad-Variable muss auf einen gültigen Particles2D Node verweisen."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6628,6 +7075,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6644,6 +7096,15 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "Node erstellen"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Alert!"
@@ -6686,6 +7147,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6694,6 +7161,22 @@ msgid ""
"texture to some node for display."
msgstr ""
+#~ msgid "Node From Scene"
+#~ msgstr "Node von Szene"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Assets zum Projekt importieren."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Exportiere das Projekt für viele Plattformen."
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Die Pfad-Variable muss auf einen gültigen Particles2D Node verweisen."
+
+#~ msgid "Surface"
+#~ msgstr "Oberfläche"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
diff --git a/editor/translations/editor.pot b/editor/translations/editor.pot
index 985b48efc2..9821ef4e01 100644
--- a/editor/translations/editor.pot
+++ b/editor/translations/editor.pot
@@ -1,5 +1,6 @@
# LANGUAGE translation of the Godot Engine editor
-# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
+# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
+# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
# This file is distributed under the same license as the Godot source code.
#
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
@@ -349,6 +350,174 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "View Files"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connecting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Error making request"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -356,6 +525,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -369,10 +562,6 @@ msgid "Category:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr ""
@@ -384,7 +573,7 @@ msgstr ""
msgid "Official"
msgstr ""
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr ""
@@ -404,20 +593,6 @@ msgstr ""
msgid "Call"
msgstr ""
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr ""
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr ""
@@ -467,13 +642,6 @@ msgid "Selection Only"
msgstr ""
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr ""
@@ -548,6 +716,7 @@ msgstr ""
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr ""
@@ -623,11 +792,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -658,6 +822,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -758,8 +923,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -769,6 +933,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -837,8 +1002,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr ""
@@ -904,7 +1068,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1029,7 +1193,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1046,7 +1211,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1101,10 +1265,6 @@ msgstr ""
msgid "Clear"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1220,8 +1380,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1275,6 +1435,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1331,7 +1495,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1369,6 +1533,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1421,7 +1589,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1449,50 +1617,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1500,47 +1641,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1611,8 +1720,8 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
+#: editor/editor_node.cpp
+msgid "Editor"
msgstr ""
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
@@ -1632,11 +1741,67 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1720,6 +1885,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1747,12 +1920,32 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+msgid "Open 2D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 3D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -1994,6 +2187,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2022,10 +2219,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2191,7 +2384,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2666,7 +2859,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3326,7 +3519,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr ""
@@ -3375,15 +3568,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3414,6 +3598,31 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Add point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Remove point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3683,6 +3892,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3695,7 +3917,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3706,6 +3928,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3715,6 +3954,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3727,11 +3970,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3743,26 +3986,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3817,6 +4076,14 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove Out-Control Point"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3970,6 +4237,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4057,10 +4328,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4094,15 +4361,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4157,6 +4416,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4207,6 +4482,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4228,6 +4511,14 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4250,6 +4541,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4467,35 +4762,95 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Shader Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "Audio Listener"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4555,71 +4910,67 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Select"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "1 Viewport"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "2 Viewports"
+msgid "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "2 Viewports (Alt)"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "3 Viewports"
+msgid "1 Viewport"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "3 Viewports (Alt)"
+msgid "2 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "4 Viewports"
+msgid "2 Viewports (Alt)"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
+msgid "3 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
+msgid "3 Viewports (Alt)"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
+msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4643,14 +4994,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5063,11 +5406,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5079,7 +5422,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5115,10 +5458,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5177,6 +5516,10 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+msgid "Templates"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5295,6 +5638,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr ""
@@ -5360,7 +5707,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5427,10 +5774,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5480,10 +5823,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
msgid "Pick a Node"
msgstr ""
@@ -5668,6 +6007,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5742,10 +6085,56 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Open script"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5790,75 +6179,83 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
+msgid "Error - Could not create script in filesystem."
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
+msgid "Error loading script from %s"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
+msgid "Invalid Path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
+msgid "Invalid inherited parent name or path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+msgid "Create new script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Class Name"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Template"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6030,6 +6427,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6347,6 +6748,26 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr ""
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6486,8 +6907,10 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
#: scene/2d/path_2d.cpp
@@ -6550,6 +6973,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6565,6 +6993,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr ""
@@ -6607,6 +7043,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
diff --git a/editor/translations/el.po b/editor/translations/el.po
new file mode 100644
index 0000000000..bd95d6e6f6
--- /dev/null
+++ b/editor/translations/el.po
@@ -0,0 +1,7433 @@
+# Greek translation of the Godot Engine editor
+# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
+# This file is distributed under the same license as the Godot source code.
+#
+# gtsiam <gtsiam@windowslive.com>, 2017.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Godot Engine editor\n"
+"PO-Revision-Date: 2017-06-24 22:14+0000\n"
+"Last-Translator: gtsiam <gtsiam@windowslive.com>\n"
+"Language-Team: Greek <https://hosted.weblate.org/projects/godot-engine/godot/"
+"el/>\n"
+"Language: el\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 2.15-dev\n"
+
+#: editor/animation_editor.cpp
+msgid "Disabled"
+msgstr "ΑπενεÏγοποιημένο"
+
+#: editor/animation_editor.cpp
+msgid "All Selection"
+msgstr "Επιλογή όλων"
+
+#: editor/animation_editor.cpp
+msgid "Move Add Key"
+msgstr "Μετακίνηση ÎºÎ»ÎµÎ¹Î´Î¹Î¿Ï Ï€Ïοσθήκης"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Transition"
+msgstr "Anim Αλλαγή μετάβασης"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Transform"
+msgstr "Anim Αλλαγή Î¼ÎµÏ„Î±ÏƒÏ‡Î·Î¼Î±Ï„Î¹ÏƒÎ¼Î¿Ï (transform)"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Value"
+msgstr "Anim Αλλαγή τιμής"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Call"
+msgstr "Anim Αλλαγή κλήσης"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Track"
+msgstr "Anim ΠÏοσθήκη κομματιοÏ"
+
+#: editor/animation_editor.cpp
+msgid "Anim Duplicate Keys"
+msgstr "Anim Διπλασιασμός κλειδιών"
+
+#: editor/animation_editor.cpp
+msgid "Move Anim Track Up"
+msgstr "Μετακίνηση ÎºÎ¿Î¼Î¼Î±Ï„Î¹Î¿Ï animation πάνω"
+
+#: editor/animation_editor.cpp
+msgid "Move Anim Track Down"
+msgstr "Μετακίνηση ÎºÎ¿Î¼Î¼Î±Ï„Î¹Î¿Ï animation κάτω"
+
+#: editor/animation_editor.cpp
+msgid "Remove Anim Track"
+msgstr "Anim ΑφαίÏεση κομματιοÏ"
+
+#: editor/animation_editor.cpp
+msgid "Set Transitions to:"
+msgstr "ΟÏισμός μεταβάσεων σε:"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Rename"
+msgstr "Anim Μετονομασία κομματιοÏ"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Interpolation"
+msgstr "Anim Αλλαγή παÏεμβολής κομματιοÏ"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Value Mode"
+msgstr "Anim ΛειτουÏγία αλλαγής τιμής κομματιοÏ"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Wrap Mode"
+msgstr "Αλλαγή λειτουÏγίας αναδίπλωσης ÎºÎ¿Î¼Î¼Î±Ï„Î¹Î¿Ï ÎºÎ¯Î½Î·ÏƒÎ·Ï‚"
+
+#: editor/animation_editor.cpp
+msgid "Edit Node Curve"
+msgstr "ΕπεξεÏγασία ΚαμπÏλης κόμβου"
+
+#: editor/animation_editor.cpp
+msgid "Edit Selection Curve"
+msgstr "ΕπεξεÏγασία επιλεγμένης καμπÏλης"
+
+#: editor/animation_editor.cpp
+msgid "Anim Delete Keys"
+msgstr "Anim ΔιαγÏαφή κλειδιών"
+
+#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
+msgid "Duplicate Selection"
+msgstr "Διπλασιασμός επιλογής"
+
+#: editor/animation_editor.cpp
+msgid "Duplicate Transposed"
+msgstr "Διπλασιασμός ανεστÏαμένων"
+
+#: editor/animation_editor.cpp
+msgid "Remove Selection"
+msgstr "ΑφαίÏεση επιλογής"
+
+#: editor/animation_editor.cpp
+msgid "Continuous"
+msgstr "Συνεχόμενη"
+
+#: editor/animation_editor.cpp
+msgid "Discrete"
+msgstr "ΞεχωÏιστή"
+
+#: editor/animation_editor.cpp
+msgid "Trigger"
+msgstr "Άμεση"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Key"
+msgstr "Anim ΠÏοσθήκη κλειδιοÏ"
+
+#: editor/animation_editor.cpp
+msgid "Anim Move Keys"
+msgstr "Anim Μετακίνηση κελιδιών"
+
+#: editor/animation_editor.cpp
+msgid "Scale Selection"
+msgstr "Μεγέθυνση επιλογής"
+
+#: editor/animation_editor.cpp
+msgid "Scale From Cursor"
+msgstr "Μεγέθυνση από τον δείκτη"
+
+#: editor/animation_editor.cpp
+msgid "Goto Next Step"
+msgstr "Πήγαινε στο επόμενο βήμα"
+
+#: editor/animation_editor.cpp
+msgid "Goto Prev Step"
+msgstr "Πήγαινε στο Ï€ÏοηγοÏμενο βήμα"
+
+#: editor/animation_editor.cpp editor/property_editor.cpp
+msgid "Linear"
+msgstr "ΓÏαμμική"
+
+#: editor/animation_editor.cpp editor/plugins/theme_editor_plugin.cpp
+msgid "Constant"
+msgstr "ΣταθεÏή"
+
+#: editor/animation_editor.cpp
+msgid "In"
+msgstr "Είσοδος"
+
+#: editor/animation_editor.cpp
+msgid "Out"
+msgstr "Έξοδος"
+
+#: editor/animation_editor.cpp
+msgid "In-Out"
+msgstr "Είσοδος-Έξοδος"
+
+#: editor/animation_editor.cpp
+msgid "Out-In"
+msgstr "Έξοδος-Είσοδος"
+
+#: editor/animation_editor.cpp
+msgid "Transitions"
+msgstr "Μεταβάσεις"
+
+#: editor/animation_editor.cpp
+msgid "Optimize Animation"
+msgstr "Βελτιστοποίηση animation"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up Animation"
+msgstr "ΚαθαÏισμός animation"
+
+#: editor/animation_editor.cpp
+msgid "Create NEW track for %s and insert key?"
+msgstr "ΔημιουÏγία νέου ÎºÎ¿Î¼Î¼Î±Ï„Î¹Î¿Ï Î³Î¹Î± %s και εισαγωγή κλειδιοÏ;"
+
+#: editor/animation_editor.cpp
+msgid "Create %d NEW tracks and insert keys?"
+msgstr "ΔημιουÏγία %d νέων κομματιών και εισαγωγή κλειδιών;"
+
+#: editor/animation_editor.cpp editor/create_dialog.cpp
+#: editor/editor_audio_buses.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp editor/project_manager.cpp
+#: editor/script_create_dialog.cpp
+msgid "Create"
+msgstr "ΔημιουÏγία"
+
+#: editor/animation_editor.cpp
+msgid "Anim Create & Insert"
+msgstr "Anim ΔημιουÏγία & Εισαγωγή"
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert Track & Key"
+msgstr "Anim Εισαγωγή ÎºÎ¿Î¼Î¼Î±Ï„Î¹Î¿Ï & κλειδιοÏ"
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert Key"
+msgstr "Anim εισαγωγή κλειδιοÏ"
+
+#: editor/animation_editor.cpp
+msgid "Change Anim Len"
+msgstr "Αλλαγή μήκους animation"
+
+#: editor/animation_editor.cpp
+msgid "Change Anim Loop"
+msgstr "Αλλαγή επανάληψης animation"
+
+#: editor/animation_editor.cpp
+msgid "Anim Create Typed Value Key"
+msgstr "Anim ΔημιουÏγία ÎºÎ»ÎµÎ¹Î´Î¹Î¿Ï Ï„Î¹Î¼Î®Ï‚ οÏισμένου Ï„Ïπου"
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert"
+msgstr "Anim Εισαγωγή"
+
+#: editor/animation_editor.cpp
+msgid "Anim Scale Keys"
+msgstr "Anim Μεγέθυνση κλειδιών"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Call Track"
+msgstr "Anim ΠÏοσθήκη ÎºÎ¿Î¼Î¼Î±Ï„Î¹Î¿Ï ÎºÎ»Î®ÏƒÎ·Ï‚"
+
+#: editor/animation_editor.cpp
+msgid "Animation zoom."
+msgstr "Μεγέθυνση animation."
+
+#: editor/animation_editor.cpp
+msgid "Length (s):"
+msgstr "Μήκος (s):"
+
+#: editor/animation_editor.cpp
+msgid "Animation length (in seconds)."
+msgstr "Μήκος animation (σε δευτεÏόλεπτα)."
+
+#: editor/animation_editor.cpp
+msgid "Step (s):"
+msgstr "Βήμα (s):"
+
+#: editor/animation_editor.cpp
+msgid "Cursor step snap (in seconds)."
+msgstr "Βήμα κουμπώματος δÏομέα (σε δευτεÏόλεπτα)."
+
+#: editor/animation_editor.cpp
+msgid "Enable/Disable looping in animation."
+msgstr "ΕνεÏγοποίηση/ΑπενεÏγοποίηση επανάληψης στο animation."
+
+#: editor/animation_editor.cpp
+msgid "Add new tracks."
+msgstr "ΠÏοσθήκη νέων κομματιών."
+
+#: editor/animation_editor.cpp
+msgid "Move current track up."
+msgstr "Μετακίνηση Ï„Ïέχοντος ÎºÎ¿Î¼Î¼Î±Ï„Î¹Î¿Ï Ï€Î¬Î½Ï‰."
+
+#: editor/animation_editor.cpp
+msgid "Move current track down."
+msgstr "Μετακίνηση Ï„Ïέχοντος ÎºÎ¿Î¼Î¼Î±Ï„Î¹Î¿Ï ÎºÎ¬Ï„Ï‰."
+
+#: editor/animation_editor.cpp
+msgid "Remove selected track."
+msgstr "ΑφαίÏεση επιλεγμένου κομματιοÏ."
+
+#: editor/animation_editor.cpp
+msgid "Track tools"
+msgstr "ΕÏγαλεία κομματιοÏ"
+
+#: editor/animation_editor.cpp
+msgid "Enable editing of individual keys by clicking them."
+msgstr "ΕνεÏγοποίηση επεξεÏγασίας μεμονωμένων κλειδιών με το κλικ."
+
+#: editor/animation_editor.cpp
+msgid "Anim. Optimizer"
+msgstr "Anim. Μηχανή βελτιστοποίησης"
+
+#: editor/animation_editor.cpp
+msgid "Max. Linear Error:"
+msgstr "Μέγιστο γÏαμμικό σφάλμα:"
+
+#: editor/animation_editor.cpp
+msgid "Max. Angular Error:"
+msgstr "Μέγιστο γωνιώδες σφάλμα:"
+
+#: editor/animation_editor.cpp
+msgid "Max Optimizable Angle:"
+msgstr "Μέγιστη βελτιστοποίησιμη γωνία:"
+
+#: editor/animation_editor.cpp
+msgid "Optimize"
+msgstr "Βελτιστοποίησε"
+
+#: editor/animation_editor.cpp
+msgid "Select an AnimationPlayer from the Scene Tree to edit animations."
+msgstr ""
+"Επιλέξτε ένα AnimationPlayer από την ιεÏαÏχία της σκηνής για να "
+"επεξεÏγαστείτε animations."
+
+#: editor/animation_editor.cpp
+msgid "Key"
+msgstr "Κλειδί"
+
+#: editor/animation_editor.cpp
+msgid "Transition"
+msgstr "Μετάβαση"
+
+#: editor/animation_editor.cpp
+msgid "Scale Ratio:"
+msgstr "Λόγος μεγέθυνσης:"
+
+#: editor/animation_editor.cpp
+msgid "Call Functions in Which Node?"
+msgstr "Σε ποιο κόμβο να κληθοÏν οι συναÏτήσεις;"
+
+#: editor/animation_editor.cpp
+msgid "Remove invalid keys"
+msgstr "ΑφαίÏεση άκυÏων κλειδιών"
+
+#: editor/animation_editor.cpp
+msgid "Remove unresolved and empty tracks"
+msgstr "ΑφαίÏεση ανεπίλυτων και άδειων κομματιών"
+
+#: editor/animation_editor.cpp
+msgid "Clean-up all animations"
+msgstr "ΕκκαθάÏιση όλων των animation"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up Animation(s) (NO UNDO!)"
+msgstr "ΕκκαθάÏιση όλων των animation (ΧΩΡΙΣ ΑÎΑΙΡΕΣΗ!)"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up"
+msgstr "ΕκκαθάÏιση"
+
+#: editor/array_property_edit.cpp
+msgid "Resize Array"
+msgstr "Αλλαγή μεγέθους πίνακα"
+
+#: editor/array_property_edit.cpp
+msgid "Change Array Value Type"
+msgstr "Αλλαγή Ï„Ïπου τιμής πίνακα"
+
+#: editor/array_property_edit.cpp
+msgid "Change Array Value"
+msgstr "Αλλαγή τιμής πίνακα"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "Έκδοση:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "ΣταθεÏές:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr " ΑÏχεία"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "ΠεÏιγÏαφή:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "Εγκατάσταση"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Κλείσιμο"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "ΣÏνδεση.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "ΣÏνδεση στον κόμβο:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Ζητήθηκε άγνωστη μοÏφή αÏχείου:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Αποθήκευση..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "ΣÏνδεση.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Δοκιμιμαστικά"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Σφάλμα κατά την αποθήκευση πόÏου!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Λήψη"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Όλα"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
+#: editor/quick_open.cpp editor/settings_config_dialog.cpp
+msgid "Search:"
+msgstr "Αναζήτηση:"
+
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Αναζήτηση"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "Εισαγωγή"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "ΠÏόσθετα"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Sort:"
+msgstr "Ταξινόμηση:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Reverse"
+msgstr "ΑντιστÏοφή"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Category:"
+msgstr "ΚατηγοÏία:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Site:"
+msgstr "ΔιεÏθυνση:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Support.."
+msgstr "ΥποστήÏιξη.."
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Official"
+msgstr "Επίσημα"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+msgid "Community"
+msgstr "Κοινότητα"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Testing"
+msgstr "Δοκιμιμαστικά"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Assets ZIP File"
+msgstr "ΑÏχείο ZIP του Asset"
+
+#: editor/call_dialog.cpp
+msgid "Method List For '%s':"
+msgstr "Λίστα συναÏτήσεων για '%s':"
+
+#: editor/call_dialog.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Call"
+msgstr "Κλήση"
+
+#: editor/call_dialog.cpp
+msgid "Method List:"
+msgstr "Λίστα συναÏτήσεων:"
+
+#: editor/call_dialog.cpp
+msgid "Arguments:"
+msgstr "ΠαÏάμετÏοι:"
+
+#: editor/call_dialog.cpp
+msgid "Return:"
+msgstr "ΕπιστÏέφει:"
+
+#: editor/code_editor.cpp
+msgid "Go to Line"
+msgstr "Πήγαινε στη γÏαμμή"
+
+#: editor/code_editor.cpp
+msgid "Line Number:"
+msgstr "ΑÏ. γÏαμμής:"
+
+#: editor/code_editor.cpp
+msgid "No Matches"
+msgstr "Δεν υπάÏχουν αντιστοιχίες"
+
+#: editor/code_editor.cpp
+msgid "Replaced %d occurrence(s)."
+msgstr "Αντικαταστάθηκαν %d εμφανίσεις."
+
+#: editor/code_editor.cpp
+msgid "Replace"
+msgstr "Αντικατάσταση"
+
+#: editor/code_editor.cpp
+msgid "Replace All"
+msgstr "Αντικατάσταση όλων"
+
+#: editor/code_editor.cpp
+msgid "Match Case"
+msgstr "Αντιστοίχηση πεζών-κεφαλαίων"
+
+#: editor/code_editor.cpp
+msgid "Whole Words"
+msgstr "ΟλόκληÏες λέξεις"
+
+#: editor/code_editor.cpp
+msgid "Selection Only"
+msgstr "Μόνο στην επιλογή"
+
+#: editor/code_editor.cpp editor/editor_help.cpp
+msgid "Find"
+msgstr "ΕÏÏεση"
+
+#: editor/code_editor.cpp
+msgid "Next"
+msgstr "Επόμενο"
+
+#: editor/code_editor.cpp
+msgid "Not found!"
+msgstr "Δεν βÏέθηκε!"
+
+#: editor/code_editor.cpp
+msgid "Replace By"
+msgstr "Αντικατάσταση με"
+
+#: editor/code_editor.cpp
+msgid "Case Sensitive"
+msgstr "ΔιάκÏιση πεζών-κεφαλαίων"
+
+#: editor/code_editor.cpp
+msgid "Backwards"
+msgstr "ΑντίστÏοφα"
+
+#: editor/code_editor.cpp
+msgid "Prompt On Replace"
+msgstr "Ρώτησε στην αντικατάσταση"
+
+#: editor/code_editor.cpp
+msgid "Skip"
+msgstr "ΠαÏάλειψη"
+
+#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom In"
+msgstr "Μεγέθυνση"
+
+#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Out"
+msgstr "ΣμÏκÏινση"
+
+#: editor/code_editor.cpp
+msgid "Reset Zoom"
+msgstr "ΕπαναφοÏά μεγέθυνσης"
+
+#: editor/code_editor.cpp editor/script_editor_debugger.cpp
+msgid "Line:"
+msgstr "ΓÏαμμή:"
+
+#: editor/code_editor.cpp
+msgid "Col:"
+msgstr "Στήλη:"
+
+#: editor/connections_dialog.cpp
+msgid "Method in target Node must be specified!"
+msgstr "ΠÏέπει να οÏισθεί συνάÏτηση για τον στοχευμένο κόμβο!"
+
+#: editor/connections_dialog.cpp
+msgid ""
+"Target method not found! Specify a valid method or attach a script to target "
+"Node."
+msgstr ""
+"Η στοχευμένη συνάÏτηση δεν βÏέθηκε! ΟÏίστε μία έγκυÏη μέθοδο ή συνδέστε μία "
+"δεσμή ενεÏγειών στον στοχευμένο κόμβο."
+
+#: editor/connections_dialog.cpp
+msgid "Connect To Node:"
+msgstr "ΣÏνδεση στον κόμβο:"
+
+#: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp
+#: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_settings.cpp
+msgid "Add"
+msgstr "ΠÏοσθήκη"
+
+#: editor/connections_dialog.cpp editor/dependency_editor.cpp
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
+msgid "Remove"
+msgstr "ΑφαίÏεση"
+
+#: editor/connections_dialog.cpp
+msgid "Add Extra Call Argument:"
+msgstr "ΠÏοσθήκη επιπλέον παÏαμέτÏου κλήσης:"
+
+#: editor/connections_dialog.cpp
+msgid "Extra Call Arguments:"
+msgstr "Επιπλέον παÏάμετÏοι κλήσης:"
+
+#: editor/connections_dialog.cpp
+msgid "Path to Node:"
+msgstr "ΔιαδÏομή για τον κόμβο:"
+
+#: editor/connections_dialog.cpp
+msgid "Make Function"
+msgstr "ΔημιουÏγήστε μία συνάÏτηση"
+
+#: editor/connections_dialog.cpp
+msgid "Deferred"
+msgstr "Αναβλημένη"
+
+#: editor/connections_dialog.cpp
+msgid "Oneshot"
+msgstr "Μία κλήση"
+
+#: editor/connections_dialog.cpp
+msgid "Connect"
+msgstr "ΣÏνδεση"
+
+#: editor/connections_dialog.cpp
+msgid "Connect '%s' to '%s'"
+msgstr "ΣÏνδεση του '%s' στο '%s'"
+
+#: editor/connections_dialog.cpp
+msgid "Connecting Signal:"
+msgstr "ΣÏνδεση στο σήμα:"
+
+#: editor/connections_dialog.cpp
+msgid "Create Subscription"
+msgstr "ΔημιουÏγία εγγÏαφής"
+
+#: editor/connections_dialog.cpp
+msgid "Connect.."
+msgstr "ΣÏνδεση.."
+
+#: editor/connections_dialog.cpp
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Disconnect"
+msgstr "ΑποσÏνδεση"
+
+#: editor/connections_dialog.cpp editor/node_dock.cpp
+msgid "Signals"
+msgstr "Σήματα"
+
+#: editor/create_dialog.cpp
+msgid "Create New"
+msgstr "ΔημιουÏγία νέου"
+
+#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/filesystem_dock.cpp
+msgid "Favorites:"
+msgstr "Αγαπημένα:"
+
+#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
+msgid "Recent:"
+msgstr "ΠÏόσφατα:"
+
+#: editor/create_dialog.cpp editor/editor_help.cpp
+#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
+#: editor/quick_open.cpp
+msgid "Matches:"
+msgstr "Αντιστοιχίες:"
+
+#: editor/dependency_editor.cpp
+msgid "Search Replacement For:"
+msgstr "Αναζήτηση αντικατάστασης για:"
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies For:"
+msgstr "ΕξαÏτήσεις για:"
+
+#: editor/dependency_editor.cpp
+msgid ""
+"Scene '%s' is currently being edited.\n"
+"Changes will not take effect unless reloaded."
+msgstr ""
+"Γίνεται επεξεÏγασία στη σκηνή '%s'\n"
+"Οι αλλαγές δεν θα δÏάσουν, εκτός κι αν γίνει επαναφόÏτωση."
+
+#: editor/dependency_editor.cpp
+msgid ""
+"Resource '%s' is in use.\n"
+"Changes will take effect when reloaded."
+msgstr ""
+"Ο πόÏος '%s' χÏησιμοποιείται.\n"
+"Οι αλλαγές θα δÏάσουν όταν γίνει επαναφόÏτωση."
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies"
+msgstr "ΕξαÏτήσεις"
+
+#: editor/dependency_editor.cpp
+msgid "Resource"
+msgstr "ΠόÏος"
+
+#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
+#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
+msgid "Path"
+msgstr "ΔιαδÏομή"
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies:"
+msgstr "ΕξαÏτήσεις:"
+
+#: editor/dependency_editor.cpp
+msgid "Fix Broken"
+msgstr "ΔιόÏθωση χαλασμένων"
+
+#: editor/dependency_editor.cpp
+msgid "Dependency Editor"
+msgstr "ΕπεξεÏγαστής εξαÏτήσεων"
+
+#: editor/dependency_editor.cpp
+msgid "Search Replacement Resource:"
+msgstr "Αναζήτηση αντικαταστάτη πόÏου:"
+
+#: editor/dependency_editor.cpp
+msgid "Owners Of:"
+msgstr "Ιδιοκτήτες του:"
+
+#: editor/dependency_editor.cpp
+msgid ""
+"The files being removed are required by other resources in order for them to "
+"work.\n"
+"Remove them anyway? (no undo)"
+msgstr ""
+"Τα αÏχεία που αφαιÏοÏνται απαιτοÏνται από άλλους πόÏους για να δουλέψουν.\n"
+"Îα αφαιÏεθοÏν; (ΑδÏνατη η αναίÏεση)"
+
+#: editor/dependency_editor.cpp
+msgid "Remove selected files from the project? (no undo)"
+msgstr "Îα αφαιÏεθοÏν τα επιλεγμένα αÏχεία από το έÏγο; (ΑδÏνατη η αναίÏεση)"
+
+#: editor/dependency_editor.cpp
+msgid "Error loading:"
+msgstr "Σφάλμα κατά την φόÏτωση:"
+
+#: editor/dependency_editor.cpp
+msgid "Scene failed to load due to missing dependencies:"
+msgstr "Η φόÏτωση της σκηνής απέτυχε, λόγω απόντων εξαÏτήσεων:"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+msgid "Open Anyway"
+msgstr "Άνοιγμα πάÏαυτα"
+
+#: editor/dependency_editor.cpp
+msgid "Which action should be taken?"
+msgstr "Ποια Ï€Ïάξη να γίνει;"
+
+#: editor/dependency_editor.cpp
+msgid "Fix Dependencies"
+msgstr "ΔιόÏθωση εξαÏτήσεων"
+
+#: editor/dependency_editor.cpp
+msgid "Errors loading!"
+msgstr "Σφάλματα κατά την φόÏτωση!"
+
+#: editor/dependency_editor.cpp
+msgid "Permanently delete %d item(s)? (No undo!)"
+msgstr "Μόνιμη διαγÏαφή %d αντικειμένων; (ΑδÏνατη η αναίÏεση)"
+
+#: editor/dependency_editor.cpp
+msgid "Owns"
+msgstr "Κατέχει"
+
+#: editor/dependency_editor.cpp
+msgid "Resources Without Explicit Ownership:"
+msgstr "ΠόÏοι χωÏίς Ïητή ιδιοκτησία:"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+msgid "Orphan Resource Explorer"
+msgstr "ΕξεÏευνητής αχÏησιμοποίητων πόÏων"
+
+#: editor/dependency_editor.cpp
+msgid "Delete selected files?"
+msgstr "ΔιαγÏαφή επιλεγμένων αÏχείων;"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+#: editor/filesystem_dock.cpp editor/plugins/item_list_editor_plugin.cpp
+#: editor/project_export.cpp editor/scene_tree_dock.cpp
+msgid "Delete"
+msgstr "ΔιαγÏαφή"
+
+#: editor/editor_audio_buses.cpp
+msgid "Save Audio Bus Layout As.."
+msgstr "Αποθήκευση διάταξης διαÏλων ήχου ÏŽÏ‚.."
+
+#: editor/editor_audio_buses.cpp
+msgid "Location for New Layout.."
+msgstr "Τοποθεσία για νέα διάταξη.."
+
+#: editor/editor_audio_buses.cpp
+msgid "Open Audio Bus Layout"
+msgstr "Άνοιγμα διάταξης διαÏλων ήχου"
+
+#: editor/editor_audio_buses.cpp
+msgid "Add Bus"
+msgstr "ΠÏοσθήκη διαÏλου"
+
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
+msgid "Load"
+msgstr "ΦόÏτωσε"
+
+#: editor/editor_audio_buses.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Save As"
+msgstr "Αποθήκευση ώς"
+
+#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
+msgid "Default"
+msgstr "ΠÏοεπιλογή"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name."
+msgstr "Μη έγκυÏο όνομα."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Valid characters:"
+msgstr "ΈγκυÏοι χαÏακτήÏες:"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing engine class name."
+msgstr ""
+"ΆκυÏο όνομα. Δεν Ï€Ïέπει να συγχέεται με υπαÏκτό όνομα κλάσης της godot."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing buit-in type name."
+msgstr ""
+"ΆκυÏο όνομα. Δεν Ï€Ïέπει να συγχέεται με υπαÏκτό ενσωματωμένο όνομα Ï„Ïπου."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing global constant name."
+msgstr "ΆκυÏο όνομα. Δεν Ï€Ïέπει να συγχέεται με υπαÏκτό καθολικό όνομα."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid Path."
+msgstr "ΆκυÏη διαδÏομή."
+
+#: editor/editor_autoload_settings.cpp
+msgid "File does not exist."
+msgstr "Το αÏχείο δεν υπάÏχει."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Not in resource path."
+msgstr "Δεν υπάÏχει στην διαδÏομή πόÏων."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Add AutoLoad"
+msgstr "ΠÏοσθήκη AutoLoad"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Autoload '%s' already exists!"
+msgstr "AutoLoad '%s' υπάÏχει ήδη!"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Rename Autoload"
+msgstr "Μετονομασία AutoLoad"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Toggle AutoLoad Globals"
+msgstr "Εναλλαγή καθολικών υπογÏαφών AutoLoad"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Move Autoload"
+msgstr "Μετακίνηση AutoLoad"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Remove Autoload"
+msgstr "ΑφαίÏεση AutoLoad"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Enable"
+msgstr "ΕνεÏγοποίηση"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Rearrange Autoloads"
+msgstr "Αναδιάταξη των AutoLoad"
+
+#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
+msgid "Path:"
+msgstr "ΔιαδÏομή:"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Node Name:"
+msgstr "Όνομα κόμβου:"
+
+#: editor/editor_autoload_settings.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Name"
+msgstr "Όνομα"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Singleton"
+msgstr "ΜονοσÏνολο"
+
+#: editor/editor_autoload_settings.cpp
+msgid "List:"
+msgstr "Λίστα:"
+
+#: editor/editor_data.cpp
+msgid "Updating Scene"
+msgstr "ΕνημέÏωση σκηνής"
+
+#: editor/editor_data.cpp
+msgid "Storing local changes.."
+msgstr "Αποθήκευση τοπικών αλλαγών.."
+
+#: editor/editor_data.cpp
+msgid "Updating scene.."
+msgstr "ΕνημέÏωση σκηνής.."
+
+#: editor/editor_dir_dialog.cpp
+msgid "Choose a Directory"
+msgstr "Επιλέξτε ένα λεξικό"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: scene/gui/file_dialog.cpp
+msgid "Create Folder"
+msgstr "ΔημιουÏγία φακέλου"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/editor_plugin_settings.cpp editor/plugins/theme_editor_plugin.cpp
+#: editor/project_export.cpp scene/gui/file_dialog.cpp
+msgid "Name:"
+msgstr "Όνομα:"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: scene/gui/file_dialog.cpp
+msgid "Could not create folder."
+msgstr "ΑδÏνατη η δημιουÏγία φακέλου."
+
+#: editor/editor_dir_dialog.cpp
+msgid "Choose"
+msgstr "Επιλέξτε"
+
+#: editor/editor_export.cpp
+msgid "Storing File:"
+msgstr "ΑÏχείο αποθήκευσης:"
+
+#: editor/editor_export.cpp
+msgid "Packing"
+msgstr "ΠακετάÏισμα"
+
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
+msgid "Template file not found:\n"
+msgstr "Δεν βÏέθηκε το αÏχείο Ï€ÏοτÏπου:\n"
+
+#: editor/editor_export.cpp
+msgid "Added:"
+msgstr "ΠÏοστέθηκαν:"
+
+#: editor/editor_export.cpp
+msgid "Removed:"
+msgstr "ΑφαιÏέθηκαν:"
+
+#: editor/editor_export.cpp
+msgid "Error saving atlas:"
+msgstr "Σφάλμα κατά την αποθήκευση άτλαντα:"
+
+#: editor/editor_export.cpp
+msgid "Could not save atlas subtexture:"
+msgstr "ΑδÏνατη η αποθήκευση υπό-εικόνας άτλαντα:"
+
+#: editor/editor_export.cpp
+msgid "Exporting for %s"
+msgstr "Εξαγωγή για %s"
+
+#: editor/editor_export.cpp
+msgid "Setting Up.."
+msgstr "ΑÏχικοποίηση.."
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "File Exists, Overwrite?"
+msgstr "Το αÏχείο υπάÏχει. Θέλετε να το αντικαταστήσετε;"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "All Recognized"
+msgstr "Όλες αναγνωÏίστηκαν"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "All Files (*)"
+msgstr "Όλα τα αÏχεία (*)"
+
+#: editor/editor_file_dialog.cpp editor/editor_help.cpp editor/editor_node.cpp
+#: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/property_selector.cpp editor/quick_open.cpp scene/gui/file_dialog.cpp
+msgid "Open"
+msgstr "Άνοιγμα"
+
+#: editor/editor_file_dialog.cpp editor/editor_node.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp scene/gui/file_dialog.cpp
+msgid "Save"
+msgstr "Αποθήκευση"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Save a File"
+msgstr "Αποθήκευση αÏχείου"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Back"
+msgstr "Πήγαινε πίσω"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Forward"
+msgstr "Πήγαινε μπÏοστά"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Up"
+msgstr "Πήγαινε πάνω"
+
+#: editor/editor_file_dialog.cpp
+msgid "Refresh"
+msgstr "Αναναίωση"
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Hidden Files"
+msgstr "Εναλλαγή κÏυμμένων αÏχείων"
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Favorite"
+msgstr "Εναλλαγή αγαπημένου"
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Mode"
+msgstr "Εναλλαγή λειτουÏγίας"
+
+#: editor/editor_file_dialog.cpp
+msgid "Focus Path"
+msgstr "Εστίαση στη διαδÏομή"
+
+#: editor/editor_file_dialog.cpp
+msgid "Move Favorite Up"
+msgstr "Μετακίνηση αγαπημένου πάνω"
+
+#: editor/editor_file_dialog.cpp
+msgid "Move Favorite Down"
+msgstr "Μετακίνηση αγαπημένου κάτω"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Directories & Files:"
+msgstr "Φάκελοι & ΑÏχεία:"
+
+#: editor/editor_file_dialog.cpp
+msgid "Preview:"
+msgstr "ΠÏοεπισκόπηση:"
+
+#: editor/editor_file_dialog.cpp editor/script_editor_debugger.cpp
+#: scene/gui/file_dialog.cpp
+msgid "File:"
+msgstr "ΑÏχείο:"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Filter:"
+msgstr "ΦίλτÏο:"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Must use a valid extension."
+msgstr "Απαιτείται η χÏήση έγκυÏης επέκτασης."
+
+#: editor/editor_file_system.cpp
+msgid "ScanSources"
+msgstr "ΣάÏωση πηγών"
+
+#: editor/editor_file_system.cpp
+msgid "(Re)Importing Assets"
+msgstr "(Επαν)εισαγωγή πόÏων"
+
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search Help"
+msgstr "Αναζήτηση βοήθειας"
+
+#: editor/editor_help.cpp
+msgid "Class List:"
+msgstr "Λίστα κλάσεων:"
+
+#: editor/editor_help.cpp
+msgid "Search Classes"
+msgstr "Αναζήτηση κλάσεων"
+
+#: editor/editor_help.cpp editor/property_editor.cpp
+msgid "Class:"
+msgstr "Κλάση:"
+
+#: editor/editor_help.cpp editor/scene_tree_editor.cpp
+msgid "Inherits:"
+msgstr "ΚληÏονομεί:"
+
+#: editor/editor_help.cpp
+msgid "Inherited by:"
+msgstr "ΚληÏονομείται από:"
+
+#: editor/editor_help.cpp
+msgid "Brief Description:"
+msgstr "ΣÏντομη πεÏιγÏαφή:"
+
+#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Members:"
+msgstr "Μέλη:"
+
+#: editor/editor_help.cpp
+msgid "Public Methods:"
+msgstr "Δημόσιες συναÏτήσεις:"
+
+#: editor/editor_help.cpp
+msgid "GUI Theme Items:"
+msgstr "Στοιχεία του θέματος GUI:"
+
+#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Signals:"
+msgstr "Σήματα:"
+
+#: editor/editor_help.cpp
+msgid "Constants:"
+msgstr "ΣταθεÏές:"
+
+#: editor/editor_help.cpp
+msgid "Property Description:"
+msgstr "ΠεÏιγÏαφή ιδιότητας:"
+
+#: editor/editor_help.cpp
+msgid "Method Description:"
+msgstr "ΠεÏιγÏαφή μεθόδου:"
+
+#: editor/editor_help.cpp
+msgid "Search Text"
+msgstr "Αναζήτηση κειμένου"
+
+#: editor/editor_log.cpp
+msgid " Output:"
+msgstr " Έξοδος:"
+
+#: editor/editor_log.cpp editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/rich_text_editor_plugin.cpp editor/property_editor.cpp
+#: editor/script_editor_debugger.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Clear"
+msgstr "ΕκκαθάÏιση"
+
+#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
+#: editor/resources_dock.cpp
+msgid "Error saving resource!"
+msgstr "Σφάλμα κατά την αποθήκευση πόÏου!"
+
+#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
+#: editor/resources_dock.cpp
+msgid "Save Resource As.."
+msgstr "Αποθήκευση πόÏου ως.."
+
+#: editor/editor_node.cpp editor/export_template_manager.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "I see.."
+msgstr "Εντάξει.."
+
+#: editor/editor_node.cpp
+msgid "Can't open file for writing:"
+msgstr "ΑδÏνατο το άνοιγμα αÏχείου για εγγÏαφή:"
+
+#: editor/editor_node.cpp
+msgid "Requested file format unknown:"
+msgstr "Ζητήθηκε άγνωστη μοÏφή αÏχείου:"
+
+#: editor/editor_node.cpp
+msgid "Error while saving."
+msgstr "Σφάλμα κατά την αποθήκευση."
+
+#: editor/editor_node.cpp
+msgid "Saving Scene"
+msgstr "Αποθήκευση σκηνής"
+
+#: editor/editor_node.cpp
+msgid "Analyzing"
+msgstr "Ανάλυση"
+
+#: editor/editor_node.cpp
+msgid "Creating Thumbnail"
+msgstr "ΔημιουÏγία μικÏογÏαφίας"
+
+#: editor/editor_node.cpp
+msgid ""
+"Couldn't save scene. Likely dependencies (instances) couldn't be satisfied."
+msgstr ""
+"ΑδÏνατη η αποθήκευση σκηνής. Πιθανώς οι εξαÏτήσεις (στιγμιότυπα) να μην "
+"μποÏοÏσαν να ικανοποιηθοÏν."
+
+#: editor/editor_node.cpp
+msgid "Failed to load resource."
+msgstr "Απέτυχε η φόÏτωση πόÏου."
+
+#: editor/editor_node.cpp
+msgid "Can't load MeshLibrary for merging!"
+msgstr "ΑδÏνατο το φόÏτωμα της βιβλιοθήκης πλεγμάτων για συγχώνευση!"
+
+#: editor/editor_node.cpp
+msgid "Error saving MeshLibrary!"
+msgstr "Σφάλμα κατά την αποθήκευση της βιβλιοθήκης πλεγμάτων !"
+
+#: editor/editor_node.cpp
+msgid "Can't load TileSet for merging!"
+msgstr "ΑδÏνατο το φόÏτωμα του TileSet για συγχώνευση!"
+
+#: editor/editor_node.cpp
+msgid "Error saving TileSet!"
+msgstr "Σφάλμα κατά την αποθήκευση TileSet!"
+
+#: editor/editor_node.cpp
+msgid "Error trying to save layout!"
+msgstr "Σφάλμα κατά την αποθήκευση διάταξης!"
+
+#: editor/editor_node.cpp
+msgid "Default editor layout overridden."
+msgstr "Η Ï€Ïοεπιλεγμένη διάταξη του editor έχει παÏακαμφθεί."
+
+#: editor/editor_node.cpp
+msgid "Layout name not found!"
+msgstr "Το όνομα της διάταξης δεν βÏέθηκε!"
+
+#: editor/editor_node.cpp
+msgid "Restored default layout to base settings."
+msgstr "ΕπαναφοÏά της Ï€Ïοεπιλεγμένης διάταξης στις βασικές Ïυθμίσεις."
+
+#: editor/editor_node.cpp
+msgid "Copy Params"
+msgstr "ΑντιγÏαφή παÏαμέτÏων"
+
+#: editor/editor_node.cpp
+msgid "Paste Params"
+msgstr "Επικόλληση παÏαμέτÏων"
+
+#: editor/editor_node.cpp editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Paste Resource"
+msgstr "Επικόλληση πόÏου"
+
+#: editor/editor_node.cpp
+msgid "Copy Resource"
+msgstr "ΑντιγÏαφή πόÏου"
+
+#: editor/editor_node.cpp
+msgid "Make Built-In"
+msgstr "ΜετατÏοπή σε ενσωματωμένο"
+
+#: editor/editor_node.cpp
+msgid "Make Sub-Resources Unique"
+msgstr "Κάνε τους υπό-πόÏους μοναδικοÏÏ‚"
+
+#: editor/editor_node.cpp
+msgid "Open in Help"
+msgstr "Άνοιγμα στη βοήθεια"
+
+#: editor/editor_node.cpp
+msgid "There is no defined scene to run."
+msgstr "Δεν υπάÏχει καθοÏισμένη σκηνή για εκτελέση."
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid ""
+"No main scene has ever been defined, select one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+"Η κÏÏια σκηνή δεν έχει καθοÏιστεί, θέλετε να επιλέξετε μία;\n"
+"ΜποÏείτε να την αλλάξετε αÏγότεÏα στις «Ρυθμίσεις έÏγου» κάτω από την "
+"κατηγοÏία «εφαÏμογή»."
+
+#: editor/editor_node.cpp
+msgid ""
+"Selected scene '%s' does not exist, select a valid one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+"Η επιλεγμένη σκηνή '%s' δεν υπάÏχει, θέλετε να επιλέξετε μία έγκυÏη;\n"
+"ΜποÏείτε να την αλλάξετε αÏγότεÏα στις «Ρυθμίσεις έÏγου» κάτω από την "
+"κατηγοÏία «εφαÏμογή»."
+
+#: editor/editor_node.cpp
+msgid ""
+"Selected scene '%s' is not a scene file, select a valid one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+"Η επιλεγμένη σκηνή '%s' δεν είναι αÏχείο σκηνής, θέλετε να επιλέξετε μία "
+"έγκυÏη;\n"
+"ΜποÏείτε να την αλλάξετε αÏγότεÏα στις «Ρυθμίσεις έÏγου» κάτω από την "
+"κατηγοÏία «εφαÏμογή»."
+
+#: editor/editor_node.cpp
+msgid "Current scene was never saved, please save it prior to running."
+msgstr ""
+"Η Ï„Ïέχουσα σκηνή δεν έχει αποθηκευτεί, αποθηκεÏστε Ï€Ïιν να Ï„Ïέξετε το "
+"Ï€ÏόγÏαμμα."
+
+#: editor/editor_node.cpp
+msgid "Could not start subprocess!"
+msgstr "ΑδÏνατη η εκκίνηση της υπό-εÏγασίας!"
+
+#: editor/editor_node.cpp
+msgid "Open Scene"
+msgstr "Άνοιγμα σκηνής"
+
+#: editor/editor_node.cpp
+msgid "Open Base Scene"
+msgstr "Άνοιγμα σκηνής βάσης"
+
+#: editor/editor_node.cpp
+msgid "Quick Open Scene.."
+msgstr "ΓÏήγοÏο άνοιγμα σκηνής..."
+
+#: editor/editor_node.cpp
+msgid "Quick Open Script.."
+msgstr "ΓÏήγοÏη άνοιγμα δεσμής ενεÏγειών..."
+
+#: editor/editor_node.cpp
+msgid "Yes"
+msgstr "Îαι"
+
+#: editor/editor_node.cpp
+msgid "Close scene? (Unsaved changes will be lost)"
+msgstr "Κλείσιμο σκηνής; (Οι μη αποθηκευμένες αλλαγές θα χαθοÏν)"
+
+#: editor/editor_node.cpp
+msgid "Save Scene As.."
+msgstr "Αποθήκευση σκηνή ως..."
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Κόμβος"
+
+#: editor/editor_node.cpp
+msgid "This scene has never been saved. Save before running?"
+msgstr "Αυτή η σκηνή δεν έχει αποθηκευτεί. Αποθήκευση Ï€Ïιν από την εκτέλεση;"
+
+#: editor/editor_node.cpp
+msgid "Export Mesh Library"
+msgstr "Εξαγωγή βιβλιοθήκης πλεγμάτων"
+
+#: editor/editor_node.cpp
+msgid "Export Tile Set"
+msgstr "Εξαγωγή σετ πλακιδίων"
+
+#: editor/editor_node.cpp
+msgid "Quit"
+msgstr "Έξοδος"
+
+#: editor/editor_node.cpp
+msgid "Exit the editor?"
+msgstr "ΤεÏματισμός του Ï€ÏογÏάμματος επεξεÏγασίας;"
+
+#: editor/editor_node.cpp
+msgid "Current scene not saved. Open anyway?"
+msgstr "Η Ï„Ïέχουσα σκηνή δεν έχει αποθηκευτεί. Συνέχεια με το άνοιγμα;"
+
+#: editor/editor_node.cpp
+msgid "Can't reload a scene that was never saved."
+msgstr ""
+"Δεν είναι δυνατό να φοÏτώσετε εκ νέου μια σκηνή που δεν αποθηκεÏτηκε ποτέ."
+
+#: editor/editor_node.cpp
+msgid "Revert"
+msgstr "ΕπαναφοÏά"
+
+#: editor/editor_node.cpp
+msgid "This action cannot be undone. Revert anyway?"
+msgstr ""
+"Αυτή η ενέÏγεια δεν μποÏεί να αναιÏεθεί. Θέλετε να συνεχίσετε με την "
+"επαναφοÏά;"
+
+#: editor/editor_node.cpp
+msgid "Quick Run Scene.."
+msgstr "ΓÏήγοÏη εκτέλεση σκηνής..."
+
+#: editor/editor_node.cpp
+msgid ""
+"Open Project Manager? \n"
+"(Unsaved changes will be lost)"
+msgstr ""
+"Θέλετε να ανοίξετε τον διαχειÏιστή έÏγου; \n"
+"(Οι μη αποθηκευμένες αλλαγές θα χαθοÏν)"
+
+#: editor/editor_node.cpp
+msgid "Pick a Main Scene"
+msgstr "Επιλογή κÏÏιας σκηνής"
+
+#: editor/editor_node.cpp
+msgid ""
+"Scene '%s' was automatically imported, so it can't be modified.\n"
+"To make changes to it, a new inherited scene can be created."
+msgstr ""
+"Η σκηνή '%s' έχει εισαχθεί αυτόματα και δεν μποÏεί να Ï„Ïοποποιηθεί.\n"
+"Για να κάνετε αλλαγές σε αυτή, Ï€Ïέπει να δημιουÏγηθεί μία νέα κληÏονομημένη "
+"σκηνή."
+
+#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/scene_tree_dock.cpp
+msgid "Ugh"
+msgstr "α..."
+
+#: editor/editor_node.cpp
+msgid ""
+"Error loading scene, it must be inside the project path. Use 'Import' to "
+"open the scene, then save it inside the project path."
+msgstr ""
+"Σφάλμα κατά τη φόÏτωση της σκηνής, διότι δεν είναι μέσα στη διαδÏομή του "
+"έÏγου. ΧÏησιμοποιήστε την «Εισαγωγή» για να ανοίξετε τη σκηνή και, στη "
+"συνέχεια, αποθηκεÏστε τη μέσα στη διαδÏομή του έÏγου."
+
+#: editor/editor_node.cpp
+msgid "Error loading scene."
+msgstr "Σφάλμα κατά τη φόÏτωση σκηνής."
+
+#: editor/editor_node.cpp
+msgid "Scene '%s' has broken dependencies:"
+msgstr "Η σκηνή '%s' έχει σπασμένες εξαÏτήσεις:"
+
+#: editor/editor_node.cpp
+msgid "Save Layout"
+msgstr "Αποθήκευση διάταξης"
+
+#: editor/editor_node.cpp
+msgid "Delete Layout"
+msgstr "ΔιαγÏαφή διάταξης"
+
+#: editor/editor_node.cpp
+msgid "Switch Scene Tab"
+msgstr "Εναλλαγή καÏτέλας σκηνής"
+
+#: editor/editor_node.cpp
+msgid "%d more file(s)"
+msgstr "%d πεÏισσότεÏα αÏχεία"
+
+#: editor/editor_node.cpp
+msgid "%d more file(s) or folder(s)"
+msgstr "%d πεÏισσότεÏα αÏχεία ή φάκελοι"
+
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "ΛειτουÏγία χωÏίς διάσπαση Ï€Ïοσοχής"
+
+#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Scene"
+msgstr "Σκηνή"
+
+#: editor/editor_node.cpp
+msgid "Go to previously opened scene."
+msgstr "Πηγαίνετε στη σκηνή ανοίξατε Ï€Ïοηγουμένως."
+
+#: editor/editor_node.cpp
+msgid "Next tab"
+msgstr "Επόμενη καÏτέλα"
+
+#: editor/editor_node.cpp
+msgid "Previous tab"
+msgstr "ΠÏοηγοÏμενη καÏτέλα"
+
+#: editor/editor_node.cpp
+msgid "Filter Files.."
+msgstr "ΦιλτÏάÏισμα αÏχείων..."
+
+#: editor/editor_node.cpp
+msgid "Operations with scene files."
+msgstr "ΠÏάξεις με αÏχεία σκηνής."
+
+#: editor/editor_node.cpp
+msgid "New Scene"
+msgstr "Îέα σκηνή"
+
+#: editor/editor_node.cpp
+msgid "New Inherited Scene.."
+msgstr "Îέα κληÏονομημένη σκηνή.."
+
+#: editor/editor_node.cpp
+msgid "Open Scene.."
+msgstr "Άνοιγμα σκηνής.."
+
+#: editor/editor_node.cpp
+msgid "Save Scene"
+msgstr "ΑποθηκεÏσετε σκηνής"
+
+#: editor/editor_node.cpp
+msgid "Save all Scenes"
+msgstr "Αποθήκευση όλων των σκηνών"
+
+#: editor/editor_node.cpp
+msgid "Close Scene"
+msgstr "Κλείσιμο σκηνής"
+
+#: editor/editor_node.cpp
+msgid "Close Goto Prev. Scene"
+msgstr "Κλείσιμο και μετάβαση στην Ï€ÏοηγοÏμενη σκηνή"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Open Recent"
+msgstr "Άνοιγμα Ï€Ïόσφατων"
+
+#: editor/editor_node.cpp
+msgid "Convert To.."
+msgstr "ΜετατÏοπή σε..."
+
+#: editor/editor_node.cpp
+msgid "MeshLibrary.."
+msgstr "Βιβλιοθήκη πλεγμάτων..."
+
+#: editor/editor_node.cpp
+msgid "TileSet.."
+msgstr "TileSet..."
+
+#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Undo"
+msgstr "ΑναίÏεση"
+
+#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Redo"
+msgstr "ΑκÏÏωση αναίÏεσης"
+
+#: editor/editor_node.cpp
+msgid "Revert Scene"
+msgstr "ΕπαναφοÏά σκηνής"
+
+#: editor/editor_node.cpp
+msgid "Miscellaneous project or scene-wide tools."
+msgstr "Λοιπά έÏγα ή εÏγαλεία για όλη τη σκηνή."
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Project"
+msgstr "Îέο έÏγο"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "Ρυθμίσεις έÏγου"
+
+#: editor/editor_node.cpp
+msgid "Run Script"
+msgstr "Εκτέλεση δεσμής ενεÏγειών"
+
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Export"
+msgstr "Εξαγωγή"
+
+#: editor/editor_node.cpp
+msgid "Tools"
+msgstr "ΕÏγαλεία"
+
+#: editor/editor_node.cpp
+msgid "Quit to Project List"
+msgstr "Έξοδος στη λίστα έÏγων"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "Αποσφαλμάτωση"
+
+#: editor/editor_node.cpp
+msgid "Deploy with Remote Debug"
+msgstr "Ανέπτυξε με απομακÏυσμένο εντοπισμό σφαλμάτων"
+
+#: editor/editor_node.cpp
+msgid ""
+"When exporting or deploying, the resulting executable will attempt to "
+"connect to the IP of this computer in order to be debugged."
+msgstr ""
+"Όταν εξάγετε ή αναπτÏσσετε, το παÏαγόμενο εκτελέσιμο θα Ï€Ïοσπαθήσει να "
+"συνδεθεί στην IP Î±Ï…Ï„Î¿Ï Ï„Î¿Ï… υπολογιστή για να αποσφαλματωθεί."
+
+#: editor/editor_node.cpp
+msgid "Small Deploy with Network FS"
+msgstr "ΜικÏή ανάπτυξη με δικτυωμένο σÏστημα αÏχείων"
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is enabled, export or deploy will produce a minimal "
+"executable.\n"
+"The filesystem will be provided from the project by the editor over the "
+"network.\n"
+"On Android, deploy will use the USB cable for faster performance. This "
+"option speeds up testing for games with a large footprint."
+msgstr ""
+"Όταν ενεÏγοποιείται αυτή η επιλογή, η εξαγωγή ή η ανάπτυξη θα παÏάξουν ένα "
+"ελαχιστοποιημένο εκτελέσιμο.\n"
+"Το σÏστημα αÏχείων θα διατεθεί από τον επεξεÏγαστή μέσω του διαδικτÏου.\n"
+"Στο Android, η ανάπτυξη θα χÏησιμοποιήσει το καλώδιο USB για μεγαλÏτεÏη "
+"απόδοση. Αυτή η επιλογή επιταχÏνει τις δοκιμές για παιχνίδια με μεγάλο "
+"αποτÏπωμα."
+
+#: editor/editor_node.cpp
+msgid "Visible Collision Shapes"
+msgstr "ΟÏατά σχήματα σÏγκÏουσης"
+
+#: editor/editor_node.cpp
+msgid ""
+"Collision shapes and raycast nodes (for 2D and 3D) will be visible on the "
+"running game if this option is turned on."
+msgstr ""
+"Σχήματα σÏγκÏουσης και κόμβοι raycast (για 2D και 3D) θα είναι οÏατά στο "
+"παιχνίδι εάν αυτή η επιλογή είναι ενεÏγοποιημένη."
+
+#: editor/editor_node.cpp
+msgid "Visible Navigation"
+msgstr "ΟÏατή πλοήγηση"
+
+#: editor/editor_node.cpp
+msgid ""
+"Navigation meshes and polygons will be visible on the running game if this "
+"option is turned on."
+msgstr ""
+"Τα πλέγματα πλοήγησης και τα πολÏγονα θα είναι οÏατά στο παιχνίδι εάν αυτή η "
+"επιλογή είναι ενεÏγοποιημένη."
+
+#: editor/editor_node.cpp
+msgid "Sync Scene Changes"
+msgstr "ΣυγχÏονισμός αλλαγών στη σκηνή"
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is turned on, any changes made to the scene in the editor "
+"will be replicated in the running game.\n"
+"When used remotely on a device, this is more efficient with network "
+"filesystem."
+msgstr ""
+"Όταν αυτή η επιλογή είναι ενεÏγοποιημένη, ÏŒ,τι αλλαγές γίνουν στη σκηνή θα "
+"αναπαÏαχθοÏν και στο παιχνίδι.\n"
+"Όταν χÏησιμοποιηθεί απομακÏυσμένα σε μία συσκευή, αυτό είναι ποιο "
+"αποτελεσματικό με δικτυωμένο σÏστημα αÏχείων."
+
+#: editor/editor_node.cpp
+msgid "Sync Script Changes"
+msgstr "ΣυγχÏονισμός αλλαγών στις δεσμές ενεÏγειών"
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is turned on, any script that is saved will be reloaded on "
+"the running game.\n"
+"When used remotely on a device, this is more efficient with network "
+"filesystem."
+msgstr ""
+"Όταν αυτή η επιλογή είναι ενεÏγοποιημένη, όποια δεσμή ενεÏγειών αποθηκευτεί "
+"θα επαναφοÏτωθεί στο παιχνίδι.\n"
+"Όταν χÏησιμοποιηθεί απομακÏυσμένα σε μία συσκευή, αυτό είναι ποιο "
+"αποτελεσματικό με δικτυωμένο σÏστημα αÏχείων."
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "ΕπεξεÏγασία"
+
+#: editor/editor_node.cpp editor/settings_config_dialog.cpp
+msgid "Editor Settings"
+msgstr "Ρυθμίσεις επεξεÏγαστή"
+
+#: editor/editor_node.cpp
+msgid "Editor Layout"
+msgstr "Διάταξη επεξεÏγαστή"
+
+#: editor/editor_node.cpp
+msgid "Toggle Fullscreen"
+msgstr "Εναλλαγή πλήÏους οθόνης"
+
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Manage Export Templates"
+msgstr "ΔιαχείÏιση Ï€ÏοτÏπων εξαγωγής"
+
+#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "Κλάσεις"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "Κλείσιμο τεκμηÏίωσης"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "About"
+msgstr "Σχετικά"
+
+#: editor/editor_node.cpp
+msgid "Play the project."
+msgstr "ΑναπαÏαγωγή του έÏγου."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "ΑναπαÏαγωγή"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "ΠαÏση της σκηνής"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "ΠαÏση της σκηνής"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Διέκοψε τη σκηνή."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "Διακοπή"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "ΑναπαÏαγωγή επεξεÏγαζόμενης σκηνής."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "ΑναπαÏαγωγή σκηνής"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "ΑναπαÏαγωγή Ï€ÏοσαÏμοσμένης σκηνής"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "ΑναπαÏαγωγή Ï€ÏοσαÏμοσμένης σκηνής"
+
+#: editor/editor_node.cpp
+msgid "Spins when the editor window repaints!"
+msgstr "ΠεÏιστÏέφεται όταν το παÏάθυÏο του επεξεÏγαστή επαναχÏωματίζεται!"
+
+#: editor/editor_node.cpp
+msgid "Update Always"
+msgstr "ΕνημέÏωση πάντα"
+
+#: editor/editor_node.cpp
+msgid "Update Changes"
+msgstr "ΕνημέÏωση αλλαγών"
+
+#: editor/editor_node.cpp
+msgid "Disable Update Spinner"
+msgstr "ΑπενεÏγοποίηση δείκτη ενημέÏωσης"
+
+#: editor/editor_node.cpp
+msgid "Inspector"
+msgstr "ΕπιθεωÏητής"
+
+#: editor/editor_node.cpp
+msgid "Create a new resource in memory and edit it."
+msgstr "ΔημιοÏÏγησε έναν νέο πόÏο στη μνήμη και επεξεÏγάσου τον."
+
+#: editor/editor_node.cpp
+msgid "Load an existing resource from disk and edit it."
+msgstr "ΦόÏτωσε υπάÏχων πόÏο στη μνήμη και επεξεÏγάσου τον."
+
+#: editor/editor_node.cpp
+msgid "Save the currently edited resource."
+msgstr "Αποθήκευσε το Ï„Ïέχων επεξεÏγαζόμενο πόÏο."
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Save As.."
+msgstr "Αποθήκευση ως..."
+
+#: editor/editor_node.cpp
+msgid "Go to the previous edited object in history."
+msgstr "Πήγαινε στο Ï€Ïοηγουμένως επεξεÏγασμένο αντικείμενο στο ιστοÏικό."
+
+#: editor/editor_node.cpp
+msgid "Go to the next edited object in history."
+msgstr "Πήγαινε στο επόμενο επεξεÏγασμένο αντικείμενο στο ιστοÏικό."
+
+#: editor/editor_node.cpp
+msgid "History of recently edited objects."
+msgstr "ΙστοÏικό Ï€Ïοσφάτως επεξεÏγασμένων αντικειμένων."
+
+#: editor/editor_node.cpp
+msgid "Object properties."
+msgstr "Ιδιότητες αντικειμένου."
+
+#: editor/editor_node.cpp
+msgid "FileSystem"
+msgstr "ΣÏστημα αÏχείων"
+
+#: editor/editor_node.cpp editor/node_dock.cpp
+msgid "Node"
+msgstr "Κόμβος"
+
+#: editor/editor_node.cpp
+msgid "Output"
+msgstr "Έξοδος"
+
+#: editor/editor_node.cpp editor/editor_reimport_dialog.cpp
+msgid "Re-Import"
+msgstr "Επανεισαγωγή"
+
+#: editor/editor_node.cpp editor/editor_plugin_settings.cpp
+msgid "Update"
+msgstr "ΕνημέÏωση"
+
+#: editor/editor_node.cpp
+msgid "Thanks from the Godot community!"
+msgstr "ΕυχαÏιστίες από την κοινότητα της Godot!"
+
+#: editor/editor_node.cpp
+msgid "Thanks!"
+msgstr "ΕυχαÏιστώ!"
+
+#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Import Templates From ZIP File"
+msgstr "Εισαγωγή Ï€ÏοτÏπων από αÏχείο ZIP"
+
+#: editor/editor_node.cpp
+msgid "Export Project"
+msgstr "Εξαγωγή έÏγου"
+
+#: editor/editor_node.cpp
+msgid "Export Library"
+msgstr "Εξαγωγή βιβλιοθήκης"
+
+#: editor/editor_node.cpp
+msgid "Merge With Existing"
+msgstr "Συγχώνευση με υπάÏχων"
+
+#: editor/editor_node.cpp
+msgid "Password:"
+msgstr "Κωδικός:"
+
+#: editor/editor_node.cpp
+msgid "Open & Run a Script"
+msgstr "Άνοιξε & ΤÏέξε μία δεσμή ενεÏγειών"
+
+#: editor/editor_node.cpp
+msgid "Load Errors"
+msgstr "Σφάλματα φόÏτωσης"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Άνοιγμα στον επεξεÏγαστή"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Άνοιγμα στον επεξεÏγαστή"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Άνοιγμα στον επεξεÏγαστή"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "Εξαγωγή βιβλιοθήκης"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Άνοιγμα στον επεξεÏγαστή"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "Άνοιγμα στον επεξεÏγαστή"
+
+#: editor/editor_plugin_settings.cpp
+msgid "Installed Plugins:"
+msgstr "Εγκατεστημένα Ï€Ïόσθετα:"
+
+#: editor/editor_plugin_settings.cpp
+msgid "Author:"
+msgstr "ΣυγγÏαφέας:"
+
+#: editor/editor_plugin_settings.cpp
+msgid "Status:"
+msgstr "Κατάσταση:"
+
+#: editor/editor_profiler.cpp
+msgid "Stop Profiling"
+msgstr "Διακοπή Ï€Ïοφίλ"
+
+#: editor/editor_profiler.cpp
+msgid "Start Profiling"
+msgstr "ΈναÏξη Ï€Ïοφίλ"
+
+#: editor/editor_profiler.cpp
+msgid "Measure:"
+msgstr "ΜέτÏο:"
+
+#: editor/editor_profiler.cpp
+msgid "Frame Time (sec)"
+msgstr "ΧÏόνος καÏέ (sec)"
+
+#: editor/editor_profiler.cpp
+msgid "Average Time (sec)"
+msgstr "Μέσος ΧÏόνος (sec)"
+
+#: editor/editor_profiler.cpp
+msgid "Frame %"
+msgstr "ΚαÏέ %"
+
+#: editor/editor_profiler.cpp
+msgid "Fixed Frame %"
+msgstr "ΣταθεÏÏŒ καÏέ %"
+
+#: editor/editor_profiler.cpp editor/script_editor_debugger.cpp
+msgid "Time:"
+msgstr "ΧÏόνος:"
+
+#: editor/editor_profiler.cpp
+msgid "Inclusive"
+msgstr "ΠεÏιοκτικός"
+
+#: editor/editor_profiler.cpp
+msgid "Self"
+msgstr "Εαυτός"
+
+#: editor/editor_profiler.cpp
+msgid "Frame #:"
+msgstr "ΚαÏέ #:"
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Please wait for scan to complete."
+msgstr "ΠαÏακαλώ πεÏιμένετε να ολοκληÏωθεί η σάÏωση."
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Current scene must be saved to re-import."
+msgstr "Η Ï„Ïέχουσα σκηνή Ï€Ïέπει να αποθηκευτεί για να επαν-εισάγετε."
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Save & Re-Import"
+msgstr "Αποθήκευση & Επανεισαγωγή"
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Re-Importing"
+msgstr "Επανεισαγωγή"
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Re-Import Changed Resources"
+msgstr "Επανεισαγωγή Ï„Ïοποπιημένων πόÏων"
+
+#: editor/editor_run_script.cpp
+msgid "Write your logic in the _run() method."
+msgstr "ΓÏάψτε τη λογική σας στη μέθοδο _run()."
+
+#: editor/editor_run_script.cpp
+msgid "There is an edited scene already."
+msgstr "ΥπάÏχει ήδη μία σκηνή για επεξεÏγασία."
+
+#: editor/editor_run_script.cpp
+msgid "Couldn't instance script:"
+msgstr "ΑδÏνατη η δημιουÏγία στιγμιοτÏπου δεσμής ενεÏγειών:"
+
+#: editor/editor_run_script.cpp
+msgid "Did you forget the 'tool' keyword?"
+msgstr "Μήπως ξεχάσατε τη λέξη-κλειδί \"tool\"?"
+
+#: editor/editor_run_script.cpp
+msgid "Couldn't run script:"
+msgstr "ΑδÏνατη η εκτέλεση της δεσμής ενεÏγειών:"
+
+#: editor/editor_run_script.cpp
+msgid "Did you forget the '_run' method?"
+msgstr "Μήπως ξεχάσατε τη μέθοδο '_run';"
+
+#: editor/editor_settings.cpp
+msgid "Default (Same as Editor)"
+msgstr "ΠÏοεπιλογή (Το ίδιο με τον επεξεÏγαστή)"
+
+#: editor/editor_sub_scene.cpp
+msgid "Select Node(s) to Import"
+msgstr "Επιλέξτε κόμβους για εισαγωγή"
+
+#: editor/editor_sub_scene.cpp
+msgid "Scene Path:"
+msgstr "ΔιαδÏομή σκηνής:"
+
+#: editor/editor_sub_scene.cpp
+msgid "Import From Node:"
+msgstr "Εισαγωγή σκηνής από κόμβο:"
+
+#: editor/export_template_manager.cpp
+msgid "Re-Download"
+msgstr "Εκ νέου λήψη"
+
+#: editor/export_template_manager.cpp
+msgid "Uninstall"
+msgstr "Απεγκατάσταση"
+
+#: editor/export_template_manager.cpp
+msgid "(Installed)"
+msgstr "(Εγκατεστημένο)"
+
+#: editor/export_template_manager.cpp
+msgid "Download"
+msgstr "Λήψη"
+
+#: editor/export_template_manager.cpp
+msgid "(Missing)"
+msgstr "(Λείπει)"
+
+#: editor/export_template_manager.cpp
+msgid "(Current)"
+msgstr "(ΤÏέχων)"
+
+#: editor/export_template_manager.cpp
+msgid "Remove template version '%s'?"
+msgstr "ΑφαίÏεση Ï€Ïότυπης εκδοχής '%s';"
+
+#: editor/export_template_manager.cpp
+msgid "Can't open export templates zip."
+msgstr "ΑδÏνατο το άνοιγμα του zip των Ï€ÏοτÏπων εξαγωγής."
+
+#: editor/export_template_manager.cpp
+msgid "Invalid version.txt format inside templates."
+msgstr "ΆκυÏη μοÏφή version.txt μέσα στα Ï€Ïότυπα."
+
+#: editor/export_template_manager.cpp
+msgid ""
+"Invalid version.txt format inside templates. Revision is not a valid "
+"identifier."
+msgstr ""
+"ΆκυÏη μοÏφή version.txt μέσα στα Ï€Ïότυπα. Το Revision δεν είναι έγκυÏο "
+"αναγνωÏιστικό."
+
+#: editor/export_template_manager.cpp
+msgid "No version.txt found inside templates."
+msgstr "Δεν βÏέθηκε version.txt μέσα στα Ï€Ïότυπα."
+
+#: editor/export_template_manager.cpp
+msgid "Error creating path for templates:\n"
+msgstr "Σφάλμα κατά τη δημιουÏγία διαδÏομης για τα Ï€Ïότυπα:\n"
+
+#: editor/export_template_manager.cpp
+msgid "Extracting Export Templates"
+msgstr "Εξαγωγή Ï€ÏοτÏπων εξαγωγής"
+
+#: editor/export_template_manager.cpp
+msgid "Importing:"
+msgstr "Εισαγωγή:"
+
+#: editor/export_template_manager.cpp
+msgid "Loading Export Templates"
+msgstr "ΦόÏτωση Ï€ÏοτÏπων εξαγωγής"
+
+#: editor/export_template_manager.cpp
+msgid "Current Version:"
+msgstr "ΤÏέχουσα έκδοση:"
+
+#: editor/export_template_manager.cpp
+msgid "Installed Versions:"
+msgstr "Εγκατεστημένες εκδόσεις:"
+
+#: editor/export_template_manager.cpp
+msgid "Install From File"
+msgstr "Εγκατάσταση από αÏχείο"
+
+#: editor/export_template_manager.cpp
+msgid "Remove Template"
+msgstr "ΑφαίÏεση Ï€ÏοτÏπου"
+
+#: editor/export_template_manager.cpp
+msgid "Select template file"
+msgstr "Επιλέξτε ένα αÏχείο Ï€ÏοτÏπων"
+
+#: editor/export_template_manager.cpp
+msgid "Export Template Manager"
+msgstr "ΔιαχειÏιστής Ï€ÏοτÏπων εξαγωγής"
+
+#: editor/file_type_cache.cpp
+msgid "Can't open file_type_cache.cch for writing, not saving file type cache!"
+msgstr ""
+"ΑδÏνατο το άνοιγμα του αÏχείου file_type_cache.cch για εγγÏαφή, παÏάλειψη "
+"αποθήκευσης cache Ï„Ïπου αÏχείου!"
+
+#: editor/filesystem_dock.cpp
+msgid "Cannot navigate to '"
+msgstr "ΑδÏνατη η πλοήγηση στο '"
+
+#: editor/filesystem_dock.cpp
+msgid "Same source and destination files, doing nothing."
+msgstr "Ίδια αÏχεία πηγής και Ï€ÏοοÏισμοÏ, παÏάλειψη ενέÏγειας."
+
+#: editor/filesystem_dock.cpp
+msgid "Same source and destination paths, doing nothing."
+msgstr "Ίδιες διαδÏομές πηγής και Ï€ÏοοÏισμοÏ, παÏάλειψη ενέÏγειας."
+
+#: editor/filesystem_dock.cpp
+msgid "Can't move directories to within themselves."
+msgstr "ΑδÏνατη η μετακίνηση καταλόγων μέσα στους εαυτοÏÏ‚ τους."
+
+#: editor/filesystem_dock.cpp
+msgid "Can't operate on '..'"
+msgstr "ΑδÏνατη η λειτουÏγία στο '..'"
+
+#: editor/filesystem_dock.cpp
+msgid "Pick New Name and Location For:"
+msgstr "Επιλέξτε νέο όνομα και θέση για:"
+
+#: editor/filesystem_dock.cpp
+msgid "No files selected!"
+msgstr "Δεν επιλέχθηκαν αÏχεία!"
+
+#: editor/filesystem_dock.cpp
+msgid "Expand all"
+msgstr "Ανάπτυξη όλων"
+
+#: editor/filesystem_dock.cpp
+msgid "Collapse all"
+msgstr "ΣÏμπτηξη όλων"
+
+#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "Εμφάνιση στη διαχείÏιση αÏχείων"
+
+#: editor/filesystem_dock.cpp
+msgid "Instance"
+msgstr "Στιγμιότυπο"
+
+#: editor/filesystem_dock.cpp
+msgid "Edit Dependencies.."
+msgstr "ΕπεξεÏγασία εξαÏτήσεων .."
+
+#: editor/filesystem_dock.cpp
+msgid "View Owners.."
+msgstr "ΠÏοβολή Ιδιοκτητών .."
+
+#: editor/filesystem_dock.cpp
+msgid "Copy Path"
+msgstr "ΑντιγÏαφή διαδÏομής"
+
+#: editor/filesystem_dock.cpp
+msgid "Rename or Move.."
+msgstr "Μετονομασία ή μετακίνηση.."
+
+#: editor/filesystem_dock.cpp
+msgid "Move To.."
+msgstr "Μετακίνηση σε..."
+
+#: editor/filesystem_dock.cpp
+msgid "Info"
+msgstr "ΠληÏοφοÏίες"
+
+#: editor/filesystem_dock.cpp
+msgid "Re-Import.."
+msgstr "Εκ νέου εισαγωγή..."
+
+#: editor/filesystem_dock.cpp
+msgid "Previous Directory"
+msgstr "ΠÏοηγοÏμενος κατάλογος"
+
+#: editor/filesystem_dock.cpp
+msgid "Next Directory"
+msgstr "Επόμενος κατάλογος"
+
+#: editor/filesystem_dock.cpp
+msgid "Re-Scan Filesystem"
+msgstr "Εκ νέου σάÏωση το συστήματος αÏχείων"
+
+#: editor/filesystem_dock.cpp
+msgid "Toggle folder status as Favorite"
+msgstr "Εναλλαγή αγαπημένου"
+
+#: editor/filesystem_dock.cpp
+msgid "Instance the selected scene(s) as child of the selected node."
+msgstr ""
+"ΔημιουÏγία στιγμιοτÏπων των επιλεγμένων σκηνών ως παιδιά του επιλεγμένου "
+"κόμβου."
+
+#: editor/filesystem_dock.cpp
+msgid "Move"
+msgstr "Μετακίνηση"
+
+#: editor/groups_editor.cpp
+msgid "Add to Group"
+msgstr "ΠÏοσθήκη σε Ομάδα"
+
+#: editor/groups_editor.cpp
+msgid "Remove from Group"
+msgstr "ΚατάÏγηση από την ομάδα"
+
+#: editor/import/resource_importer_obj.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Surface %d"
+msgstr "Επιφάνεια %d"
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Import Scene"
+msgstr "Εισαγωγή σκηνής"
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Importing Scene.."
+msgstr "Εισαγωγή σκηνής..."
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Running Custom Script.."
+msgstr "Εκτέλεση Ï€ÏοσαÏμοσμένης δέσμης ενεÏγειών..."
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't load post-import script:"
+msgstr "Δεν ήταν δυνατή η φόÏτωση της δεσμής ενεÏγειών για μετά την εισαγωγή:"
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Invalid/broken script for post-import (check console):"
+msgstr ""
+"ΆκυÏη / χαλασμένη δεσμή ενεÏγειών για την διαδικασία της μετ-εισαγωγής "
+"(ελέγξτε την κονσόλα):"
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Error running post-import script:"
+msgstr "Σφάλμα κατά την εκτέλεση της δέσμης ενεÏγειών μετ-εισαγωγής:"
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Saving.."
+msgstr "Αποθήκευση..."
+
+#: editor/import_dock.cpp
+msgid " Files"
+msgstr " ΑÏχεία"
+
+#: editor/import_dock.cpp
+msgid "Import As:"
+msgstr "Εισαγωγή ώς:"
+
+#: editor/import_dock.cpp editor/property_editor.cpp
+msgid "Preset.."
+msgstr "ΠÏοκαθοÏισμένο..."
+
+#: editor/import_dock.cpp
+msgid "Reimport"
+msgstr "Επανεισαγωγή"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "No bit masks to import!"
+msgstr "Δεν υπάÏχουν μάσκες bit για εισαγωγή!"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path is empty."
+msgstr "Η διαδÏομή Ï€ÏοοÏÎ¹ÏƒÎ¼Î¿Ï ÎµÎ¯Î½Î±Î¹ άδεια."
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path must be a complete resource path."
+msgstr "Η διαδÏομή Ï€ÏοοÏÎ¹ÏƒÎ¼Î¿Ï Ï€Ïέπει να είναι μία πλήÏης διαδÏομή σε πόÏο."
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path must exist."
+msgstr "Η διαδÏομή Ï€ÏοοÏÎ¹ÏƒÎ¼Î¿Ï Ï€Ïέπει να υπάÏχει."
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Save path is empty!"
+msgstr "Η διαδÏομή αποθήκευσης είναι άδεια!"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "Import BitMasks"
+msgstr "Εισαγωγή μάσκας bit"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture(s):"
+msgstr "Πηγαίες υφές:"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Target Path:"
+msgstr "ΔιαδÏομή Ï€ÏοοÏισμοÏ:"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Accept"
+msgstr "Αποδοχή"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "Bit Mask"
+msgstr "Μάσκα bit"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "No source font file!"
+msgstr "Δεν δόθηκε πηγαίο αÏχείο γÏαμματοσειÏάς!"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "No target font resource!"
+msgstr "Δε δόθηκε πόÏος γÏαμματοσειÏάς Ï€ÏοοÏισμοÏ!"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
+msgid ""
+"Invalid file extension.\n"
+"Please use .font."
+msgstr ""
+"ΆκυÏη επέκταση αÏχείου.\n"
+"ΠαÏακαλώ χÏησιμοποιήστε .fnt."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Can't load/process source font."
+msgstr "Δεν ήταν δυνατή η φόÏτωση/επεξεÏγασία της πηγαίας γÏαμματοσειÏάς."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Couldn't save font."
+msgstr "Δεν ήταν δυνατή η αποθήκευση της γÏαμματοσειÏάς."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Source Font:"
+msgstr "Πηγαία γÏαμματοσειÏά:"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Source Font Size:"
+msgstr "Μέγεθος πηγαίας γÏαμματοσειÏάς:"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Dest Resource:"
+msgstr "ΠόÏος Ï€ÏοοÏισμοÏ:"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "The quick brown fox jumps over the lazy dog."
+msgstr "Γαζέες καὶ μυÏτιὲς δὲν θὰ βÏá¿¶ πιὰ στὸ χÏυσαφὶ ξέφωτο."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Test:"
+msgstr "Δοκιμή:"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Options:"
+msgstr "Επιλογές:"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Font Import"
+msgstr "Εισαγωγή γÏαμματοσειÏάς"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid ""
+"This file is already a Godot font file, please supply a BMFont type file "
+"instead."
+msgstr ""
+"Αυτό το αÏχείο είναι ήδη ένα αÏχείο γÏαμματοσειÏάς της Godot, παÏακαλώ "
+"υποβάλετε ένα αÏχείο Ï„Ïπου BMFont."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Failed opening as BMFont file."
+msgstr "Απέτυχε το άνοιγμα ως αÏχείο BMFont."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Error initializing FreeType."
+msgstr "Σφάλμα κατά την αÏχικοποίηση του FreeType."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Unknown font format."
+msgstr "Άγνωστη μοÏφή γÏαμματοσειÏάς."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Error loading font."
+msgstr "Σφάλμα κατά την φόÏτωση της γÏαμματοσειÏάς."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Invalid font size."
+msgstr "Μη έγκυÏο μέγεθος γÏαμματοσειÏάς."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Invalid font custom source."
+msgstr "ΆκυÏη Ï€ÏοσαÏμοσμένη πηγή γÏαμματοσειÏάς."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Font"
+msgstr "ΓÏαμματοσειÏά"
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "No meshes to import!"
+msgstr "Δεν υπάÏχουν πλέγματα για εισαγωγή!"
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Single Mesh Import"
+msgstr "Εισαγωγή ενός πλέγματος"
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Source Mesh(es):"
+msgstr "Πηγαία πλέγματα:"
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh"
+msgstr "Πλέγμα"
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "No samples to import!"
+msgstr "Δεν υπάÏχουν δείγματα για εισαγωγή!"
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Import Audio Samples"
+msgstr "Εισαγωγή δειγμάτων ήχου"
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Source Sample(s):"
+msgstr "Πηγαία δείγματα:"
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Audio Sample"
+msgstr "Δείγμα ήχου"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "New Clip"
+msgstr "Îέο απόσπασμα"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Animation Options"
+msgstr "Επιλογές κίνησης"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Flags"
+msgstr "Σημαίες"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Bake FPS:"
+msgstr "Ψήστε FPS:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Optimizer"
+msgstr "ΕÏγαλείο βελτιστοποίησης"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Linear Error"
+msgstr "Μέγιστο γÏαμμικό σφάλμα"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Angular Error"
+msgstr "Μέγιστο γωνιακό σφάλμα"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Angle"
+msgstr "Ανώτατη Γωνία"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Clips"
+msgstr "Αποσπάσματα"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Start(s)"
+msgstr "ΑÏχή"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "End(s)"
+msgstr "Τέλος"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Loop"
+msgstr "Επανάληψη"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Filters"
+msgstr "ΦίλτÏα"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Source path is empty."
+msgstr "Η διαδÏομή Ï€Ïοέλευσης είναι άδεια."
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't load post-import script."
+msgstr "Δεν ήταν δυνατή η φόÏτωση της δεσμής ενεÏγειών μετ-εισαγωγής."
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Invalid/broken script for post-import."
+msgstr ""
+"ΆκυÏη / χαλασμένη δεσμή ενεÏγειών για την διαδικασία της μετ-εισαγωγής."
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Error importing scene."
+msgstr "Σφάλμα κατά την εισαγωγή της σκηνής."
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import 3D Scene"
+msgstr "Εισαγωγή 3D σκηνής"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Source Scene:"
+msgstr "Σκηνή Ï€Ïοέλευσης:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Same as Target Scene"
+msgstr "Το ίδιο με την στοχευμένη σκηνή"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Shared"
+msgstr "ΚοινόχÏηστο"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Target Texture Folder:"
+msgstr "Επιλεγμένος φάκλος υφών:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Post-Process Script:"
+msgstr "Δεσμή ενεÏγειών μετ-επεξεÏγασίας:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Custom Root Node Type:"
+msgstr "ΠÏοσαÏμοσμένος Ï„Ïπος ÏÎ¹Î¶Î¹ÎºÎ¿Ï ÎºÏŒÎ¼Î²Î¿Ï…:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Auto"
+msgstr "Αυτόματο"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Root Node Name:"
+msgstr "Όνομα ÏÎ¹Î¶Î¹ÎºÎ¿Ï ÎºÏŒÎ¼Î²Î¿Ï…:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "The Following Files are Missing:"
+msgstr "Τα ακόλουθα αÏχεία λείπουν:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import Anyway"
+msgstr "Εισαγωγή οÏτως ή άλλως"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp scene/gui/dialogs.cpp
+msgid "Cancel"
+msgstr "ΑκÏÏωση"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import & Open"
+msgstr "Εισαγωγή & Άνοιγμα"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Edited scene has not been saved, open imported scene anyway?"
+msgstr ""
+"Η Ï„Ïέχουσα σκηνή δεν έχει αποθηκευτεί, άνοιγμα της εισαγμένης σκηνής οÏτως ή "
+"άλλως;"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import Image:"
+msgstr "Εισαγωγή εικόνας:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Can't import a file over itself:"
+msgstr "Δεν είναι δυνατή η εισαγωγή ενός αÏχείου πάνω στον εαυτό του:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't localize path: %s (already local)"
+msgstr ""
+"Δεν είναι δυνατή η μετατÏοπή της διαδÏομής σε τοπική: %s (είναι ήδη τοπικό)"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "3D Scene Animation"
+msgstr "Κίνηση Ï„Ïισδιάστατης σκηνής"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Uncompressed"
+msgstr "Ασυμπίεστο"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress Lossless (PNG)"
+msgstr "Συμπίεση χωÏίς απώλειες (PNG)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress Lossy (WebP)"
+msgstr "Συμπίεση με απώλειες (WebP)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress (VRAM)"
+msgstr "Συμπίεση (VRAM)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Format"
+msgstr "ΜοÏφή υφής"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Compression Quality (WebP):"
+msgstr "Ποιότητα συμπίεσης υφής (WebP):"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Options"
+msgstr "Επιλογές υφής"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Please specify some files!"
+msgstr "ΠαÏακαλώ καθοÏίστε κάποια αÏχεία!"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "At least one file needed for Atlas."
+msgstr "Τουλάχιστον ένα αÏχείο απαιτείται για τον άτλαντα."
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Error importing:"
+msgstr "Σφάλμα κατά την εισαγωγή:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Only one file is required for large texture."
+msgstr "Μόνο ένα αÏχείο είναι απαÏαίτητη για μεγάλη υφή."
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Max Texture Size:"
+msgstr "Μέγιστο μέγεθος υφής:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for Atlas (2D)"
+msgstr "Εισαγωγή υφών για τον άτλαντα (2D)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Cell Size:"
+msgstr "Μέγεθος κελιοÏ:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Large Texture"
+msgstr "Μεγάλη υφή"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Large Textures (2D)"
+msgstr "Εισαγωγής Μεγάλων Υφών (2D)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture"
+msgstr "Υφή Ï€Ïοέλευσης"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Base Atlas Texture"
+msgstr "Βασική υφή άτλαντα"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture(s)"
+msgstr "Υφές Ï€Ïοέλευσης"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for 2D"
+msgstr "Εισαγωγή υφών για 2 διαστάσεις"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for 3D"
+msgstr "Εισαγωγή υφών για 3 διαστάσεις"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures"
+msgstr "Εισαγωγή υφών"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "2D Texture"
+msgstr "Υφή 2 διαστάσεων"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "3D Texture"
+msgstr "Υφή 3 διαστάσεων"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Atlas Texture"
+msgstr "Υφή άτλαντα"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid ""
+"NOTICE: Importing 2D textures is not mandatory. Just copy png/jpg files to "
+"the project."
+msgstr ""
+"ΣΗΜΕΙΩΣΗ: Η εισαγωγή δισδιάστατων υφών δεν είναι υποχÏεωτική. Απλά "
+"αντιγÏάψτε τα αÏχεία png/jpg στο έÏγο."
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Crop empty space."
+msgstr "ΠεÏικοπή άδειου χώÏου."
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture"
+msgstr "Υφή"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Large Texture"
+msgstr "Εισαγωγή μεγάλης υφής"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Load Source Image"
+msgstr "ΦόÏτωση εικόνας Ï€Ïοέλευσης"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Slicing"
+msgstr "Κατάτμηση"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Inserting"
+msgstr "Εισαγωγή"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Saving"
+msgstr "Αποθήκευση"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save large texture:"
+msgstr "Δεν ήταν δυνατή η αποθήκευση μεγάλης υφής:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Build Atlas For:"
+msgstr "Κατασκευή άτλαντα για:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Loading Image:"
+msgstr "ΦόÏτωση εικόνας:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't load image:"
+msgstr "Δεν ήταν δυνατή η φόÏτωση της εικόνας:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Converting Images"
+msgstr "ΜετατÏοπή Εικόνων"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Cropping Images"
+msgstr "ΠεÏικοπή Εικόνων"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Blitting Images"
+msgstr "Συνδυασμός εικόνων"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save atlas image:"
+msgstr "Δεν ήταν δυνατή η αποθήκευση εικόνας άτλαντα:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save converted texture:"
+msgstr "Δεν ήταν δυνατή η αποθήκευση υφής που έχει μετατÏαπεί:"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Invalid source!"
+msgstr "Μη έγκυÏη πηγή!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Invalid translation source!"
+msgstr "Μη έγκυÏη πηγή μετάφÏασης!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Column"
+msgstr "Στήλη"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/script_create_dialog.cpp
+msgid "Language"
+msgstr "Γλώσσα"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "No items to import!"
+msgstr "Δεν υπάÏχουν στοιχεία για εισαγωγή!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "No target path!"
+msgstr "Καμία διαδÏομή Ï€ÏοοÏισμοÏ!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Translations"
+msgstr "Εισαγωγή μεταφÏάσεων"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Couldn't import!"
+msgstr "Δεν ήταν δυνατή η εισαγωγή!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Translation"
+msgstr "Εισαγωγή μετάφÏασης"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Source CSV:"
+msgstr "CSV Ï€Ïοέλευσης:"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Ignore First Row"
+msgstr "Αγνόησε την Ï€Ïώτη γÏαμμή"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Compress"
+msgstr "Συμπίεση"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "ΠÏόσθεσε στο έÏγο (godot.cfg)"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Languages:"
+msgstr "Εισαγωγή γλωσσών:"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Translation"
+msgstr "ΜετάφÏαση"
+
+#: editor/multi_node_edit.cpp
+msgid "MultiNode Set"
+msgstr "Σετ πολλαπλών κόμβων"
+
+#: editor/node_dock.cpp
+msgid "Groups"
+msgstr "Ομάδες"
+
+#: editor/node_dock.cpp
+msgid "Select a Node to edit Signals and Groups."
+msgstr "Επιλέξτε ένα κόμβο για να επεξεÏγαστείτε τα σήματα και τις ομάδες."
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Toggle Autoplay"
+msgstr "Εναλλαγή αυτόματης αναπαÏαγωγής"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "New Animation Name:"
+msgstr "Όνομα νέας κίνησης:"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "New Anim"
+msgstr "Îέα κίνηση"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Change Animation Name:"
+msgstr "Αλλαγή ονόματος κίνησης:"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Delete Animation?"
+msgstr "ΔιαγÏαφή κίνησης;"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Remove Animation"
+msgstr "ΚατάÏγηση κίνησης"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: Invalid animation name!"
+msgstr "ΣΦΑΛΜΑ: Μη έγκυÏο όνομα κίνησης!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: Animation name already exists!"
+msgstr "ΣΦΑΛΜΑ: Αυτό το όνομα κίνησης υπάÏχει ήδη!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Rename Animation"
+msgstr "Μετονομασία κίνησης"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Animation"
+msgstr "ΠÏοσθήκη κίνησης"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Blend Next Changed"
+msgstr "Το επόμενο στην μείξη κίνησης άλλαξε"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Change Blend Time"
+msgstr "Αλλαγή χÏόνου ανάμειξης"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load Animation"
+msgstr "ΦόÏτωση κίνησης"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Duplicate Animation"
+msgstr "ΑναπαÏαγωγή κίνησης"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation to copy!"
+msgstr "ΣΦΑΛΜΑ: Δεν υπάÏχει κίνηση για αντÏιγÏαφή!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation resource on clipboard!"
+msgstr "ΣΦΑΛΜΑ: Δεν υπάÏχει πόÏος κίνησης στο Ï€ÏόχειÏο!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Pasted Animation"
+msgstr "Επικολλημένη κίνηση"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Paste Animation"
+msgstr "Επικόλληση κίνησης"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation to edit!"
+msgstr "ΣΦΑΛΜΑ: Δεν υπάÏχει κίνηση για επεξεÏγασία!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation backwards from current pos. (A)"
+msgstr "ΑναπαÏαγωγή της επιλεγμένης κίνησης ανάποδα από την Ï„Ïέχουσα θέση. (A)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation backwards from end. (Shift+A)"
+msgstr "ΑναπαÏαγωγή της επιλεγμένης κίνησης ανάποδα από το τέλος. (Shift + A)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Stop animation playback. (S)"
+msgstr "Πάυση αναπαÏγωγής κίνησης. (S)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation from start. (Shift+D)"
+msgstr "ΑναπαÏαγωγή της επιλεγμένης κίνησης από την αÏχή. (Shift + D)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation from current pos. (D)"
+msgstr "ΑναπαÏαγωγή της επιλεγμένης κίνησης από την Ï„Ïέχουσα θέση. (D)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation position (in seconds)."
+msgstr "Θέση κίνησης (σε δευτεÏόλεπτα)."
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Scale animation playback globally for the node."
+msgstr "Κλιμάκωση αναπαÏαγωγής κίνησης παγκοσμίως για τον κόμβο."
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Create new animation in player."
+msgstr "ΔημιουÏγία νέας κίνησης στον αναπαÏαγωγέα."
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load animation from disk."
+msgstr "ΦόÏτωση κίνησης από τον δίσκο."
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load an animation from disk."
+msgstr "ΦόÏτωση μίας κίνησης από τον δίσκο."
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Save the current animation"
+msgstr "Αποθήκεση της Ï„Ïέχουσας κίνησης"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Display list of animations in player."
+msgstr "Εμφάνιση λίστας κινήσεων στον αναπαÏαγωγέα."
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Autoplay on Load"
+msgstr "Αυτόματη αναπαÏαγωγή"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Edit Target Blend Times"
+msgstr "ΕπεξεÏγασία χÏόνων ανάμειξης κινήσεων"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation Tools"
+msgstr "ΕÏγαλεία κινήσεων"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Copy Animation"
+msgstr "ΑνιγÏαφή κίνησης"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Create New Animation"
+msgstr "ΔημιουÏγία νέας κίνησης"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation Name:"
+msgstr "Όνομα κίνησης:"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
+#: editor/script_create_dialog.cpp
+msgid "Error!"
+msgstr "Σφάλμα!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Blend Times:"
+msgstr "ΧÏόνοι ανάμειξης:"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Next (Auto Queue):"
+msgstr "Επόμενο (Αυτόματη σειÏά):"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Cross-Animation Blend Times"
+msgstr "ΧÏόνοι ανάμειξης κινήσεων"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Animation"
+msgstr "Κίνηση"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "New name:"
+msgstr "Îέο όνομα:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Scale:"
+msgstr "Κλιμάκωση:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Fade In (s):"
+msgstr "Εμφάνιση σε (δευτεÏόλεπτα):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Fade Out (s):"
+msgstr "ΑπόκÏυψη σε (δευτεÏόλεπτα):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend"
+msgstr "Ανάμειξη"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Mix"
+msgstr "Μείξη"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Auto Restart:"
+msgstr "Αυτόματη επανεκκίνηση:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Restart (s):"
+msgstr "Επανεκκίνηση (δευτεÏόλεπτα):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Random Restart (s):"
+msgstr "Τυχαία επανεκκίνηση (δευτεÏόλεπτα):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Start!"
+msgstr "Εκκινιση!"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Amount:"
+msgstr "Ποσότητα:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend:"
+msgstr "Ανάμειξη:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend 0:"
+msgstr "Ανάμειξη 0:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend 1:"
+msgstr "Ανάμειξη 1:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "X-Fade Time (s):"
+msgstr "ΧÏόνος ÏƒÏ…Î½Î´Î¹Î±ÏƒÎ¼Î¿Ï (s):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Current:"
+msgstr "ΤÏέχων:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Add Input"
+msgstr "ΠÏοσθήκη εισόδου"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Clear Auto-Advance"
+msgstr "ΕκκαθάÏιση αυτόματης Ï€Ïοέλασης"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Set Auto-Advance"
+msgstr "ΟÏισμός αυτόματης Ï€Ïοέλασης"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Delete Input"
+msgstr "ΔιαγÏαφή εισόδου"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Rename"
+msgstr "Μετονομασία"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation tree is valid."
+msgstr "Το δέντÏο κίνησης είναι έγκυÏο."
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation tree is invalid."
+msgstr "Το δέντÏο κίνησης δεν είναι έγκυÏο."
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation Node"
+msgstr "Κόμβος κίνησης"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "OneShot Node"
+msgstr "Κόμβος OneShot"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Mix Node"
+msgstr "Κόμβος μείξης"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend2 Node"
+msgstr "Κόμβος Ανάμειξης 2"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend3 Node"
+msgstr "Κόμβος Ανάμειξης 3"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend4 Node"
+msgstr "Κόμβος Ανάμειξης 4"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "TimeScale Node"
+msgstr "Κόμβος κλιμάκωσης χÏόνου"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "TimeSeek Node"
+msgstr "Κόμβος εÏÏεσης χÏόνου"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Transition Node"
+msgstr "Κόμβος μετάβασης"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Import Animations.."
+msgstr "Εισαγωγή κινήσεων.."
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Edit Node Filters"
+msgstr "ΕπεξεÏγασία φίλτÏων κόμβων"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Filters.."
+msgstr "ΦίλτÏα.."
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Parsing %d Triangles:"
+msgstr "Ανάλυση %d ΤÏιγώνων:"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Triangle #"
+msgstr "ΤÏίγωνο #"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Light Baker Setup:"
+msgstr "ΡÏθμιση Ï€ÏοεπεγεÏγαστή φωτός:"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Parsing Geometry"
+msgstr "Ανάλυση γεωμετÏίας"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Fixing Lights"
+msgstr "ΔιόÏθωση φώτων"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Making BVH"
+msgstr "ΔημιουÏγία BVH"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Creating Light Octree"
+msgstr "ΔημιουÏγία Î¿ÎºÏ„Î±Î´Î¹ÎºÎ¿Ï Î´Î­Î½Ï„Ïου φωτός"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Creating Octree Texture"
+msgstr "ΔημιουÏγία υφής Î¿ÎºÏ„Î±Î´Î¹ÎºÎ¿Ï Î´Î­Î½Ï„Ïου"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Transfer to Lightmaps:"
+msgstr "ΜεταφοÏά στους χάÏτες φωτός:"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Allocating Texture #"
+msgstr "Δέσμευση υφής #"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Baking Triangle #"
+msgstr "ΠÏοεπεξεÏγασία Ï„Ïιγώνου #"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Post-Processing Texture #"
+msgstr "ΜετεπεξεÏγασία υφής #"
+
+#: editor/plugins/baked_light_editor_plugin.cpp
+msgid "Bake!"
+msgstr "ΠÏοεπεξεÏγάσου!"
+
+#: editor/plugins/baked_light_editor_plugin.cpp
+msgid "Reset the lightmap octree baking process (start over)."
+msgstr ""
+"ΕπαναφοÏά της Ï€ÏοεπεξεÏγασίας του Î¿ÎºÏ„Î±Î´Î¹ÎºÎ¿Ï Î´Î­Î½Ï„Ïου του χάÏτη φωτός "
+"(Εκκίνηση από την αÏχή)."
+
+#: editor/plugins/camera_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Preview"
+msgstr "ΠÏοεπισκόπηση"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Configure Snap"
+msgstr "ΠÏοσαÏμογή Ï€Ïοσκόλλησης"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid Offset:"
+msgstr "Μετατόπιση πλέγατος:"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid Step:"
+msgstr "Βήμα πλέγματος:"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotation Offset:"
+msgstr "Μετατόπιση πεÏιστÏοφής:"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotation Step:"
+msgstr "Βήμα πεÏιστÏοφής:"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Pivot"
+msgstr "Μετακίνηση πηγαίου σημείου"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Action"
+msgstr "ΕνέÏγεια μετακίνησης"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Edit IK Chain"
+msgstr "ΕπεξεÏγασία Αλυσίδας IK"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Edit CanvasItem"
+msgstr "ΕπεξεÏγασία στοιχείου κανβά"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Change Anchors"
+msgstr "Αλλαγή αγκυÏών"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom (%):"
+msgstr "Μεγέθυνση (%):"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Paste Pose"
+msgstr "Επικόληση στάσης"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Select Mode"
+msgstr "Επιλογή λειτουÏγίας"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Drag: Rotate"
+msgstr "ΣÏÏσιμο: ΠεÏιστÏοφή"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Alt+Drag: Move"
+msgstr "Alt + ΣÏÏσιμο: Μετακίνηση"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving)."
+msgstr ""
+"Πατήστε 'v' για να αλλάξετε το πηγαίο σημείο, ή 'Shift+v' για το να σÏÏετε."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Alt+RMB: Depth list selection"
+msgstr "Alt+Δεξί κλικ: Επιλογή λίστας βάθους"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Mode"
+msgstr "ΛειτουÏγία μετακίνησης"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotate Mode"
+msgstr "ΛειτουÏγία πεÏιστÏοφής"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid ""
+"Show a list of all objects at the position clicked\n"
+"(same as Alt+RMB in select mode)."
+msgstr ""
+"Εμφάνιση λίστας όλων των αντικειμένων στην θέση που κάνετε κλικ\n"
+"(Το ίδιο με Alt+Δεξί κλικ στην λειτουÏγία επιλογής)."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Click to change object's rotation pivot."
+msgstr ""
+"Κάντε κλικ για να αλλάξετε το πηγαίο σημείο πεÏιστÏοφής του αντικειμένου."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Pan Mode"
+msgstr "ΛειτουÏγία Μετακίνησης κάμεÏας"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Lock the selected object in place (can't be moved)."
+msgstr "Κλείδωμα του επιλεγμένου αντικείμένου (Δεν μποÏεί να μετακινηθεί)."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Unlock the selected object (can be moved)."
+msgstr "Ξεκλείδωμα του επιλεγμένου αντικείμένου (ΜποÏεί να μετακινηθεί)."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Makes sure the object's children are not selectable."
+msgstr "ΣιγουÏεÏεται ότι τα παιδιά του αντικειμένου δεν μποÏοÏν να επιλεχθοÏν."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Restores the object's children's ability to be selected."
+msgstr "ΕπαναφέÏει την δυνατότητα των παιδιών του αντικειμένου να επιλεγοÏν."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_manager.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit"
+msgstr "ΕπεξεÏγασία"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Use Snap"
+msgstr "ΧÏήση κουμπώματος"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Show Grid"
+msgstr "Εμφάνιση πλέγματος"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Use Rotation Snap"
+msgstr "ΧÏήση κουμπώματος πεÏιστÏοφής"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap Relative"
+msgstr "Σχετικό κοÏμπωμα"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Configure Snap.."
+msgstr "ΔιαμόÏφωση κουμπώματος.."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Use Pixel Snap"
+msgstr "ΧÏήση κουμπώματος εικονοστοιχείου"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Expand to Parent"
+msgstr "Επικάλυψη γονέα"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Skeleton.."
+msgstr "Σκελετός.."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Make Bones"
+msgstr "ΔημιουÏγία οστών"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear Bones"
+msgstr "ΕκκαθάÏιση οστών"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Bones"
+msgstr "Εμφάνιση οστών"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Make IK Chain"
+msgstr "ΔημιουÏγία αλυσίδας IK"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear IK Chain"
+msgstr "ΕκκαθάÏιση αλυσίδας IK"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View"
+msgstr "ΚάμεÏα"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Reset"
+msgstr "ΕπαναφοÏά μεγέθυνσης"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Set.."
+msgstr "ΟÏισμός μεγέθυνσης.."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Center Selection"
+msgstr "ΚεντÏάÏισμα επιλογής"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Frame Selection"
+msgstr "Πλαισίωμα επιλογής"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Anchor"
+msgstr "ΆγκυÏα"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Keys"
+msgstr "Εισαγωγή κλειδιών"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Key"
+msgstr "Εισαγωγή κλειδιοÏ"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Key (Existing Tracks)"
+msgstr "Εισαγωγή ÎºÎ»ÎµÎ¹Î´Î¹Î¿Ï (ΥπαÏκτά κομμάτια)"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Copy Pose"
+msgstr "ΑντιγÏαφή στάσης"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear Pose"
+msgstr "ΕκκαθάÏιση στάσης"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Set a Value"
+msgstr "ΟÏισμός τιμής"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap (Pixels):"
+msgstr "ΚοÏμπωμα (Εικονοστοιχεία):"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Add %s"
+msgstr "ΠÏόσθεσε %s"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Adding %s..."
+msgstr "ΠÏοσθήκη %s..."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Create Node"
+msgstr "ΔημιουÏγία κόμβου"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Error instancing scene from %s"
+msgstr "Σφάλμα κατά την αÏχικοποίηση σκηνής από %s"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "OK :("
+msgstr "Εντάξει :("
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "No parent to instance a child at."
+msgstr ""
+"Δεν υπάÏχει γονέας στον οποίο μποÏεί να γίνει αÏχικοποίηση του παιδιοÏ."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "This operation requires a single selected node."
+msgstr "Αυτή η λειτουÏγία απαιτεί έναν μόνο επιλεγμένο κόμβο."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Change default type"
+msgstr "Αλλαγή Ï€Ïοεπιλεγμένου Ï„Ïπου"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
+msgid "OK"
+msgstr "Εντάξει"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid ""
+"Drag & drop + Shift : Add node as sibling\n"
+"Drag & drop + Alt : Change node type"
+msgstr ""
+"ΣÏÏσιμο & απόθεση + Shift: ΠÏοσθήκη του κόμβου ως αδελφό\n"
+"ΣÏÏσιμο & απόθεση + Alt: Αλλαγή του Ï„Ïπου του κόμβου"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Create Poly"
+msgstr "Δημιουγία πολυγώνου"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Edit Poly"
+msgstr "ΕπεγεÏγασία πολυγώνου"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Edit Poly (Remove Point)"
+msgstr "ΕπεγεÏγασία πολυγώνου (ΑφαίÏεση σημείου)"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Create a new polygon from scratch."
+msgstr "ΔημιουÏγία νέου πολυγώνου από την αÏχή."
+
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+msgid "Create Poly3D"
+msgstr "ΔημιουÏγία πολυγώνου 3D"
+
+#: editor/plugins/collision_shape_2d_editor_plugin.cpp
+msgid "Set Handle"
+msgstr "ΟÏισμός λαβής"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Creating Mesh Library"
+msgstr "ΔημιουÏγία βιβλιοθήκης πλεγμάτων"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Thumbnail.."
+msgstr "ΜικÏογÏαφία.."
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Remove item %d?"
+msgstr "ΑφαίÏεση του στοιχείου %d?"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Add Item"
+msgstr "ΠÏοσθήκη στοιχείου"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Remove Selected Item"
+msgstr "ΑφαίÏεση του επιλεγμένου στοιοχείου"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Import from Scene"
+msgstr "Εισαγωγή από την σκηνή"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Update from Scene"
+msgstr "ΑναπÏοσαÏμογή από την σκηνή"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "ΠÏοσθήκη εισόδου"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "ΑφαίÏεση σημείου διαδÏομής"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "ΦόÏτωση πόÏου"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr "ΤÏοποπίηση καμπÏλης"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "ΠÏοσθήκη αφαίÏεση σημείου διαβάθμισης χÏωμάτων"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "ΕπεξεÏγασία διαβάθμισης χÏωμάτων"
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Item %d"
+msgstr "Στοιχείο %d"
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Items"
+msgstr "Στοιχεία"
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Item List Editor"
+msgstr "ΕπεξεÏγαστής λίστας στοιχείων"
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "Create Occluder Polygon"
+msgstr "ΔημιουÏγία πολυγώνου εμποδίου"
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Edit existing polygon:"
+msgstr "ΕπεξεÏγασία υπαÏÎºÏ„Î¿Ï Ï€Î¿Î»Ï…Î³ÏŽÎ½Î¿Ï…:"
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "LMB: Move Point."
+msgstr "ΑÏιστεÏÏŒ κλίκ: ΜΕτακίνηση σημείου."
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Ctrl+LMB: Split Segment."
+msgstr "Ctrl+ΑÏιστεÏÏŒ κλικ: ΔιαχωÏσμός τμήματος."
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "RMB: Erase Point."
+msgstr "Δεξί κλικ: ΔιαγÏαφή σημείου."
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Remove Point from Line2D"
+msgstr "ΔιαγÏαφή σημείου από την δισδιάστατη γÏαμμή"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Add Point to Line2D"
+msgstr "ΠÏόσθεσε σημείο στην δισδυάστατη γÏαμμή"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Move Point in Line2D"
+msgstr "Μετακίινηση σημείου στην δισδιάστατη γÏαμμή"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Select Points"
+msgstr "Επιλογή σημείων"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Shift+Drag: Select Control Points"
+msgstr "Shift + ΣÏÏσιμο: Επιλογή σημείψν ελέγχου"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Click: Add Point"
+msgstr "Κλικ: ΠÏοσθήκη σημείου"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Right Click: Delete Point"
+msgstr "Δεξί κλικ: ΔιαγÏαφή σημείου"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Add Point (in empty space)"
+msgstr "ΠÏοσθήκη σημείου (σε άδειο χώÏο)"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Split Segment (in line)"
+msgstr "ΔιαχωÏισμός τμήματος (στη γÏαμμή)"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Delete Point"
+msgstr "ΔιαγÏαφή σημείου"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh is empty!"
+msgstr "Το πλέγμα είναι άδειο!"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Static Trimesh Body"
+msgstr "ΔημιουÏγία ÏƒÏ„Î±Ï„Î¹ÎºÎ¿Ï ÏƒÏŽÎ¼Î±Ï„Î¿Ï‚ πλέγματος Ï„Ïιγώνων"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Static Convex Body"
+msgstr "ΔημιουÏγία ÏƒÏ„Î±Ï„Î¹ÎºÎ¿Ï ÎºÏ…ÏÏ„Î¿Ï ÏƒÏŽÎ¼Î±Ï„Î¿Ï‚"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "This doesn't work on scene root!"
+msgstr "Αυτό δεν δουλεÏει στη Ïίζα της σκηνής!"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Shape"
+msgstr "ΔημιουÏγία σχήματος πλέγματος Ï„Ïιγώνων"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Shape"
+msgstr "ΔημιουÏγία κυÏÏ„Î¿Ï ÏƒÏ‡Î®Î¼Î±Ï„Î¿Ï‚"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Navigation Mesh"
+msgstr "ΔημιουÏγία πλέγματος πλοήγησης"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "MeshInstance lacks a Mesh!"
+msgstr "Το στιγμιότυπο πλέγματος δεν έχει πλέγμα!"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh has not surface to create outlines from!"
+msgstr "Το πλέγμα δεν έχει επιφάνει από την οποία να δημιουÏγήσει πεÏιγÏάματα!"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Could not create outline!"
+msgstr "Δεν ήταν δυνατή η δημιουÏγία πεÏιγÏάμματος!"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline"
+msgstr "ΔημιουÏγία πεÏιγÏάμματος"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Static Body"
+msgstr "ΔημιουÏγία ÏƒÏ„Î±Ï„Î¹ÎºÎ¿Ï ÏƒÏŽÎ¼Î±Ï„Î¿Ï‚ πλέγματος Ï„Ïιγώνων"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Static Body"
+msgstr "ΔημιουÏγία ÏƒÏ„Î±Ï„Î¹ÎºÎ¿Ï ÎºÏ…ÏÏ„Î¿Ï ÏƒÏŽÎ¼Î±Ï„Î¿Ï‚"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Collision Sibling"
+msgstr "ΔημιουÏγία Î±Î´ÎµÎ»Ï†Î¿Ï ÏƒÏγκÏουσης πλέγατος Ï„Ïιγώνων"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Collision Sibling"
+msgstr "ΔημιουÏγία Î±Î´ÎµÎ»Ï†Î¿Ï ÏƒÏγκÏουσης κυÏÏ„Î¿Ï ÏƒÏŽÎ¼Î±Ï„Î¿Ï‚"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline Mesh.."
+msgstr "ΔημιουÏγία πλέγματος πεÏιγÏάμματος.."
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline Mesh"
+msgstr "ΔημιουÏγία πλέγματος πεÏιγÏάμματος"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Outline Size:"
+msgstr "Μέγεθος πεÏιγÏάμματος:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No mesh source specified (and no MultiMesh set in node)."
+msgstr "Δεν οÏίστικε πηγαίο πλέγμα (οÏτε πολλαπλό πλέγμα στον κόμβο)."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No mesh source specified (and MultiMesh contains no Mesh)."
+msgstr ""
+"Δεν οÏίστικε πηγαίο πλέγμα (και το πολλαπλό πλέγμα δεν πεÏιέχει κανένα "
+"πλέγμα)."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (invalid path)."
+msgstr "Το πηγαίο πλέγμα δεν είναι έγκυÏο (Μη έγκυÏη διαδÏομή)."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (not a MeshInstance)."
+msgstr "Το πηγαίο πλέγμα δεν είναι έγκυÏο (Δεν είναι στιγμιότυπο πλέγματος)."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (contains no Mesh resource)."
+msgstr "Το πηγαίο πλέγμα δεν είναι έγκυÏο (Δεν πεÏιέχει πόÏο πλέγματος)."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No surface source specified."
+msgstr "Δεν οÏίστηκε πηγαία επιφάνεια."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (invalid path)."
+msgstr "Η πηγαία επιφάνεια δεν είναι έγκυÏη (Μη έγκυÏη διαδÏομή)."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (no geometry)."
+msgstr "Η πηγαία επιφάνεια δεν είναι έγκυÏη (Δεν υπάÏχει γεωμετÏία)."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (no faces)."
+msgstr "Η πηγαία επιφάνεια δεν είναι έγκυÏη (Δεν υπάÏχουν επιφάνειες)."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Parent has no solid faces to populate."
+msgstr "Ο γονέας δεν έχει συμπαγείς επιφάνειες για να συμπληÏωθοÏν."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Couldn't map area."
+msgstr "Δεν ήταν δυνατή η χαÏτογÏάφηση της πεÏιοχής."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Select a Source Mesh:"
+msgstr "Έπιλέξτε ένα πηγαίο πλέγμα:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Select a Target Surface:"
+msgstr "Επιλέξτε την στοχευμένη επιφάνεια:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate Surface"
+msgstr "ΣυμπλήÏωση επιφάνειας"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate MultiMesh"
+msgstr "ΣυμπλήÏωση Ï€Î¿Î»Î»Î±Ï€Î»Î¿Ï Ï€Î»Î­Î³Î¼Î±Ï„Î¿Ï‚"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Target Surface:"
+msgstr "Στοχευμένη επιφάνεια:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Source Mesh:"
+msgstr "Πηγαίο πλέγμα:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "X-Axis"
+msgstr "Χ άξονας"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Y-Axis"
+msgstr "Υ άξονας"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Z-Axis"
+msgstr "Ζ άξονας"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh Up Axis:"
+msgstr "Πάνω άξονας πλέγματος:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Rotation:"
+msgstr "Τυχαία πεÏιστÏοφή:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Tilt:"
+msgstr "Τυχαία κλίση:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Scale:"
+msgstr "Τυχαία κλιμάκωση:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate"
+msgstr "ΣυμπλήÏωση"
+
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Create Navigation Polygon"
+msgstr "ΔημιουÏγία πολυγώνου πλοήγησης"
+
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Remove Poly And Point"
+msgstr "ΑφαίÏεση πολυγώνου και σημείου"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "ΕκκαθάÏιση μάσκας εκπομπής"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "ΔημιουÏία AABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Error loading image:"
+msgstr "Σφάλμα κατά την φόÏτωση εικόνας:"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "No pixels with transparency > 128 in image.."
+msgstr "Δεν υπάÏχουν εικονοστοιχεία με διαφάνεια >128 στην εικόνα.."
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Set Emission Mask"
+msgstr "ΟÏισμός μάσκας εκπομπής"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Generate Visibility Rect"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Load Emission Mask"
+msgstr "ΦόÏτωση μάσκας εκπομπής"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Generated Point Count:"
+msgstr "ΑÏιθμός δημιουÏγημένων σημείων:"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Μέσος ΧÏόνος (sec)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "ΟÏισμός μάσκας εκπομπής"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "ΔημιουÏγία από σκηνή"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Σημεία εκπομπής:"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Node does not contain geometry."
+msgstr "Ο κόμβος δεν πεÏιέχει γεωμετÏία."
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Node does not contain geometry (faces)."
+msgstr "Ο κόμβος δεν πεÏιέχει γεωμετÏία (Επιφάνειες)."
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr "Απαιτείται ένα υλικό επεξεÏγασίας Ï„Ïπου 'ParticlesMaterial'."
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Faces contain no area!"
+msgstr "Οι επιφάνειες έχουν μηδενικό εμβαδόν!"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "No faces!"
+msgstr "Δεν υπάÏχουν επιφάνειες!"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate AABB"
+msgstr "ΔημιουÏία AABB"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emission Points From Mesh"
+msgstr "ΔημιουÏγία σημείων εκπομπής από πλέγμα"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emission Points From Node"
+msgstr "ΔημιουÏγία σημείων εκπομπής από κόμβο"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Clear Emitter"
+msgstr "ΕκκαθάÏιση πομποÏ"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emitter"
+msgstr "ΔημιουÏγία πομποÏ"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Points:"
+msgstr "Σημεία εκπομπής:"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Surface Points"
+msgstr "Σημεία επιφάνειας"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Surface Points+Normal (Directed)"
+msgstr "Σημεία επιφάνειας + Κανονικό δίανυσμα (Κατευθηνόμενο)"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Volume"
+msgstr "Ένταση"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr "Πηγή εκπομπής: "
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "ΔημιουÏία AABB"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
+msgstr "ΑφαίÏεση σημείου από την καμπÏλη"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "Μετακίνηση ελεγκτή εξόδου στην καμπÏλη"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "ΑφαίÏεση σημείου από την καμπÏλη"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Add Point to Curve"
+msgstr "ΠÏοσθήκη σημείου στην καμπÏλη"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move Point in Curve"
+msgstr "Μετακίνηση σημείου στην καμπÏλη"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move In-Control in Curve"
+msgstr "Μετακίνηση ελεγκτή εισόδου στην καμπÏλη"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move Out-Control in Curve"
+msgstr "Μετακίνηση ελεγκτή εξόδου στην καμπÏλη"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Select Control Points (Shift+Drag)"
+msgstr "Επλογή σημείων ελέγχου (Shift + ΣÏÏσιμο)"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Split Segment (in curve)"
+msgstr "ΔιαχωÏισμός τμήματος (στην καμπÏλη)"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Close Curve"
+msgstr "κλείσιμο καμπÏλης"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Curve Point #"
+msgstr "Σημείο καμπÏλης #"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve Point Pos"
+msgstr "ΟÏισμός θέσης σημείου καμπÏλης"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve In Pos"
+msgstr "ΟÏισμός θέσης εισόδου καμπÏλης"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve Out Pos"
+msgstr "ΟÏισμός θέσης εξόδου καμπÏλης"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Split Path"
+msgstr "ΔιαχωÏισμός διαδÏομής"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove Path Point"
+msgstr "ΑφαίÏεση σημείου διαδÏομής"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Μετακίνηση ελεγκτή εξόδου στην καμπÏλη"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "Μετακίνηση ελεγκτή εισόδου στην καμπÏλη"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Create UV Map"
+msgstr "ΔημιουÏγία χάÏτη UV"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Transform UV Map"
+msgstr "Μετασχηματισμός χάÏτη UV"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Polygon 2D UV Editor"
+msgstr "ΕπεξεÏγαστής δισδιάστατου πολυγώνου"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Move Point"
+msgstr "Μετακίνηση σημείου"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Ctrl: Rotate"
+msgstr "Ctrl: ΠεÏιστÏοφή"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Shift: Move All"
+msgstr "Shift: Μετακίνηση όλων"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Shift+Ctrl: Scale"
+msgstr "Shift + Ctrl: Κλιμάκωση"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Move Polygon"
+msgstr "Μετακίνηση πολυγώνου"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Rotate Polygon"
+msgstr "ΠεÏιστÏοφή πολυγώνου"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Scale Polygon"
+msgstr "Κλιμάκωση πολυγώνου"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Polygon->UV"
+msgstr "ΠολÏγωνο -> UV"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "UV->Polygon"
+msgstr "UV -> ΠολÏγωνο"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Clear UV"
+msgstr "ΕκκαθάÏιση UV"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Snap"
+msgstr "ΚοÏμπωμα"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Enable Snap"
+msgstr "ΕνεÏγοποίηση κουμπώματος"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid"
+msgstr "Πλέγμα"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "ERROR: Couldn't load resource!"
+msgstr "Σφάλμα: Δεν ήταν δυνατή η φόÏτωση πόÏου!"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Add Resource"
+msgstr "ΠÏοσθήκη πόÏου"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Rename Resource"
+msgstr "Μετονομασία πόÏου"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Delete Resource"
+msgstr "ΔιαγÏαφή πόÏου"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Resource clipboard is empty!"
+msgstr "Το Ï€ÏόχειÏο πόÏων είναι άδειο!"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Load Resource"
+msgstr "ΦόÏτωση πόÏου"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
+#: editor/resources_dock.cpp scene/gui/line_edit.cpp scene/gui/text_edit.cpp
+msgid "Paste"
+msgstr "Επικόληση"
+
+#: editor/plugins/rich_text_editor_plugin.cpp
+msgid "Parse BBCode"
+msgstr "Ανάλυση BBCode"
+
+#: editor/plugins/sample_editor_plugin.cpp
+msgid "Length:"
+msgstr "Μήκος:"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Open Sample File(s)"
+msgstr "Άνοιγμα αÏχείων δειγμάτων"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "ERROR: Couldn't load sample!"
+msgstr "ΣΦΑΛΜΑ: Δεν ήταν δυνατή η φόÏτωση δείγματος!"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Add Sample"
+msgstr "ΠÏοσθήκη δείγματος"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Rename Sample"
+msgstr "Μετονομασία δείγματος"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Delete Sample"
+msgstr "ΔιαγÏαφή δείγματος"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "16 Bits"
+msgstr "16 Δυαδικά ψηφία"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "8 Bits"
+msgstr "8 Δυαδικά ψηφία"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stereo"
+msgstr "ΣτεÏεοφωνικό"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Mono"
+msgstr "Μονοφωνικό"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Format"
+msgstr "ΜοÏφή"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Pitch"
+msgstr "Τόνος"
+
+#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "ΕκκαθάÏιση οστών"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error while saving theme"
+msgstr "Σφάλμα κατά την αποθήκευση θέματος"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error saving"
+msgstr "Σφάλμα κατά την αποθήκευση"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error importing theme"
+msgstr "Σφάλμα κατά την εισαγωγή θέματος"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error importing"
+msgstr "Σφάλμα κατά την εισαγωγή"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Import Theme"
+msgstr "Εισαγωγή θέματος"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme As.."
+msgstr "Αποθήκευση θέματος ως.."
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Next script"
+msgstr "Επόμενη δεσμή ενεÏγειών"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Previous script"
+msgstr "ΠÏοηγοÏμενη δεσμή ενεÏγειών"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "File"
+msgstr "ΑÏχείο"
+
+#: editor/plugins/script_editor_plugin.cpp editor/property_editor.cpp
+msgid "New"
+msgstr "Îέο"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save All"
+msgstr "Αποθήκευση όλων"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Soft Reload Script"
+msgstr "Απλή επαναφόÏτωση δεσμής ενεÏγειών"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "History Prev"
+msgstr "ΙστοÏικά Ï€ÏοηγοÏμενο"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "History Next"
+msgstr "ΙστοÏικά επόμενο"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Reload Theme"
+msgstr "ΕπαναφόÏτωση θέματος"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme"
+msgstr "Αποθήκευση θέματος"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme As"
+msgstr "Αποθήκευση θέματος ως"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close Docs"
+msgstr "Κλείσιμο τεκμηÏίωσης"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close All"
+msgstr "Κλείσιμο όλων"
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find.."
+msgstr "ΕÏÏεση.."
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find Next"
+msgstr "ΕÏÏεση επόμενου"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Step Over"
+msgstr "Βήμα πάνω"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Step Into"
+msgstr "Βήμα μέσα"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Break"
+msgstr "Διακοπή"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Continue"
+msgstr "Συνέχιση"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Keep Debugger Open"
+msgstr "ΔιατήÏησε τον αποσφαλματωτή ανοιχτό"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Window"
+msgstr "ΠαÏάθυÏο"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Move Left"
+msgstr "Μετκίνιση αÏιστεÏά"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Move Right"
+msgstr "Μετακίνηση δεξιά"
+
+#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "Αναζήτηση στην τεκμηÏίωση αναφοÏάς."
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search the class hierarchy."
+msgstr "Αναζήτηση στην ιεÏαÏχεία κλάσεων."
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search the reference documentation."
+msgstr "Αναζήτηση στην τεκμηÏίωση αναφοÏάς."
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Go to previous edited document."
+msgstr "Πήγαινε στο Ï€ÏοηγοÏμενo έγγÏαφο."
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Go to next edited document."
+msgstr "Πήγαινε στο επόμενο έγγÏαφο."
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Discard"
+msgstr "ΑπόÏÏιψη"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Create Script"
+msgstr "ΔημιουÏγία δεσμής ενεÏγειών"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid ""
+"The following files are newer on disk.\n"
+"What action should be taken?:"
+msgstr ""
+"Τα ακόλουθα αÏχεία είναι νεότεÏα στον δίσκο.\n"
+"Τι δÏάση να ληφθεί;:"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Reload"
+msgstr "ΕπαναφόÏτωση"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Resave"
+msgstr "Επαναποθήκευση"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Debugger"
+msgstr "Αποσφαλματωτής"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid ""
+"Built-in scripts can only be edited when the scene they belong to is loaded"
+msgstr ""
+"Οι ενσωματομένες δεσμές ενεÏγειών μποÏοÏν να επεξεÏγαστοÏν μόνο όταν η σκηνή "
+"στην οποία ανοίκουν είναι φοÏτωμένη"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Pick Color"
+msgstr "Επιλογή χÏώματος"
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "ΜετατÏοπή Εικόνων"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Cut"
+msgstr "Αποκοπή"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/property_editor.cpp
+#: editor/resources_dock.cpp scene/gui/line_edit.cpp scene/gui/text_edit.cpp
+msgid "Copy"
+msgstr "ΑντιγÏαφή"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Select All"
+msgstr "Επιλογή όλων"
+
+#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
+msgid "Move Up"
+msgstr "Μετακίνηση πάνω"
+
+#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
+msgid "Move Down"
+msgstr "Μετακίνηση κάτω"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Indent Left"
+msgstr "στοιχειοθέτηση αÏιστεÏά"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Indent Right"
+msgstr "στοιχειοθέτηση δεξιά"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Toggle Comment"
+msgstr "Εναλλαγή σχολιασμοÏ"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Clone Down"
+msgstr "Κλωνοποίηση κάτω"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Complete Symbol"
+msgstr "ΣυμπλήÏωση συμβόλου"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Trim Trailing Whitespace"
+msgstr "ΠεÏικοπή ÎºÎ±Ï„Î±Î»Î·ÎºÏ„Î¹ÎºÎ¿Ï ÎºÎµÎ½Î¿Ï Î´Î¹Î±ÏƒÏ„Î®Î¼Î±Ï„Î¿Ï‚"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Auto Indent"
+msgstr "Αυτόματη στοιχειοθέτηση"
+
+#: editor/plugins/script_text_editor.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Toggle Breakpoint"
+msgstr "Εναλλαγή σημείου διακοπής"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Remove All Breakpoints"
+msgstr "ΑφαίÏεση όλων των σημείων διακοπής"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Next Breakpoint"
+msgstr "Πήγαινε στο επόμενο σημείο διακοπής"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Previous Breakpoint"
+msgstr "Πήγαινε στο Ï€ÏοηγοÏμενο σημείο διακοπής"
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "ΜετατÏοπή σε..."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "ΜετατÏοπή σε..."
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find Previous"
+msgstr "ΈυÏεση Ï€ÏοηγοÏμενου"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Replace.."
+msgstr "Αντικατάσταση.."
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Function.."
+msgstr "Πήγαινε σε συνάÏτηση.."
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Goto Line.."
+msgstr "Πήγαινε σε γÏαμμή.."
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Contextual Help"
+msgstr "Βοήθεια ανάλογα με τα συμφÏαζόμενα"
+
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Constant"
+msgstr "Αλλαγή μονόμετÏης σταθεÏάς"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Constant"
+msgstr "Αλλαγή διανυσματικής σταθεÏάς"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Constant"
+msgstr "Αλλαγή χÏωματικής σταθεÏάς"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Operator"
+msgstr "Αλλαγή μονόμετÏου τελεστή"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Operator"
+msgstr "Αλλαγή Î´Î¹Î±Î½Ï…ÏƒÎ¼Î±Ï„Î¹ÎºÎ¿Ï Ï„ÎµÎ»ÎµÏƒÏ„Î®"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Scalar Operator"
+msgstr "Αλλαγή Î´Î¹Î±Î½Ï…ÏƒÎ¼Î±Ï„Î¹ÎºÎ¿Ï - μονόμετÏου τελεστή"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Operator"
+msgstr "Αλλαγή χÏÏ‰Î¼Î±Ï„Î¹ÎºÎ¿Ï Ï„ÎµÎ»ÎµÏƒÏ„Î®"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Toggle Rot Only"
+msgstr "Εναλλαγή μόνο πεÏιστÏοφή"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Function"
+msgstr "Αλλαγή μονόμετÏης συνάÏτησης"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Function"
+msgstr "Αλλαγή διανυσματικής συνάÏτησης"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Uniform"
+msgstr "Αλλαγή μονόμετÏης ομοιόμοÏφης μεταβλητής"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Uniform"
+msgstr "Αλλαγή διανυσματικής ομοιόμοÏφης μεταβλητής"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Uniform"
+msgstr "Αλλαγή χÏωματικής ομοιόμοÏφης μεταβλητής"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Default Value"
+msgstr "Αλλαγή Ï€Ïοεπιλλεγμένης τιμής"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change XForm Uniform"
+msgstr "Αλλαγή ομοιόμοÏφης μεταβλητής XForm"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Texture Uniform"
+msgstr "Αλλαγή ομοιόμοÏφης μεταβλητής υφής"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Cubemap Uniform"
+msgstr "Αλλαγή ομοιόμοÏφης μεταβλητής χάÏτη κÏβου"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Comment"
+msgstr "Αλλαγή σχολίου"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add/Remove to Color Ramp"
+msgstr "ΠÏοσθήκη/ΑφαίÏεση σε διαβάθμηση χÏώματος"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add/Remove to Curve Map"
+msgstr "ΠÏοσθήκη/ΑφαίÏεση σε χάÏτη καμπÏλης"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Curve Map"
+msgstr "ΤÏοποποίηση χάÏτη καμπÏλης"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Input Name"
+msgstr "Αλλαγή ονόματος εισόδου"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Connect Graph Nodes"
+msgstr "ΣÏνδεση κόμβων γÏαφήματος"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Disconnect Graph Nodes"
+msgstr "ΑποσÏνδεση κόμβων γÏαφήματος"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Remove Shader Graph Node"
+msgstr "ΑφαίÏεση κόμβου γÏαφήματος"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Move Shader Graph Node"
+msgstr "Μετακίνηση κόμβου γÏαφήματος"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Duplicate Graph Node(s)"
+msgstr "Διπλασιασμός κόμβων γÏαφήματος"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Delete Shader Graph Node(s)"
+msgstr "ΔιαγÏαφή κόμβων γÏαφήματος"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Error: Cyclic Connection Link"
+msgstr "Σφάλμα: Κυκλικός σÏνδεσμος"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Error: Missing Input Connections"
+msgstr "Σφάλμα: Οι συνδέσεις εισόδου λείπουν"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add Shader Graph Node"
+msgstr "ΠÏοσθήκη κόμβου γÏαφήματος"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Orthogonal"
+msgstr "ΟÏθογώνια"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Perspective"
+msgstr "ΠÏοοπτική"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Aborted."
+msgstr "Ο μετασχηματισμός ματαιώθηκε."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "X-Axis Transform."
+msgstr "Μετασχηματισμός στον Χ άξονα."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Y-Axis Transform."
+msgstr "Μετασχηματισμός στον Υ άξονα."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Z-Axis Transform."
+msgstr "Μετασχηματισμός στον Ζ άξονα."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Plane Transform."
+msgstr "Μετασχηματισμός στο επίπεδο θέασης."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scaling to %s%%."
+msgstr "Κλιμάκωση to %s%%."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotating %s degrees."
+msgstr "ΠεÏιστÏοφή %s μοίÏες."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom View."
+msgstr "Κάτω όψη."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom"
+msgstr "Κάτω"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top View."
+msgstr "Πάνω όψη."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top"
+msgstr "Πάνω"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear View."
+msgstr "Πίσω όψη."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear"
+msgstr "Πίσω"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front View."
+msgstr "ΕμπÏόσθια όψη."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front"
+msgstr "ΜπÏοστά"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left View."
+msgstr "ΑÏιστεÏή όψη."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left"
+msgstr "ΑÏιστεÏά"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right View."
+msgstr "Δεξιά όψη."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right"
+msgstr "Δεξιά"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Keying is disabled (no key inserted)."
+msgstr ""
+"Η δημιουÏγία κλειδιών είναι απενεÏγοποιημένη (Δεν έχει εισαχθεί κλειδί)."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Animation Key Inserted."
+msgstr "Το κλειδί κίνησης έχει εισαχθεί."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Πήγαινε μπÏοστά"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "ΑντίστÏοφα"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Ροδέλα κάτω."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "ΕνημέÏωση αλλαγών"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "ΕνημέÏωση αλλαγών"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "ΕνημέÏωση αλλαγών"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "Ιδιότητες:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align with view"
+msgstr "Στοίχηση με την Ï€Ïοβολή"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Normal"
+msgstr "Κανονική εμφάνιση"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Wireframe"
+msgstr "Εμφάνιση πεÏιγÏάμματος επιφάνειας"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Overdraw"
+msgstr "Εμφάνιση Ï€ÏÎ¿ÏƒÎ¸ÎµÏ„Î¹ÎºÎ¿Ï ÏƒÏ‡ÎµÎ´Î¹Î±ÏƒÎ¼Î¿Ï"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Άσκια εμφάνιση"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Environment"
+msgstr "ΠεÏιβάλλον"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Gizmos"
+msgstr "ΜαÏαφέτια"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr "ΑκÏοατής ήχου"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "Διάλογος XForm"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Move Mode (W)"
+msgstr "ΛειτουÏγία μετακίνησης (W)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate Mode (E)"
+msgstr "ΛειτουÏγία πεÏιστÏοφής (E)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale Mode (R)"
+msgstr "ΛειτουÏγία κλιμάκωσης (R)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom View"
+msgstr "Κάτω όψη"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top View"
+msgstr "Πάνω όψη"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear View"
+msgstr "Πίσω όψη"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front View"
+msgstr "ΕμπÏόσθια όψη"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left View"
+msgstr "ΑÏιστεÏή όψη"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right View"
+msgstr "Δεξιά όψη"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Switch Perspective/Orthogonal view"
+msgstr "Εναλλαγή ΠÏοοπτικής / ΟÏθογώνιας Ï€Ïοβολής"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Insert Animation Key"
+msgstr "Εισαγωγή ÎºÎ»ÎµÎ¹Î´Î¹Î¿Ï ÎºÎ¯Î½Î·ÏƒÎ·Ï‚"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Focus Origin"
+msgstr "Εστίαση στην αÏχή"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Focus Selection"
+msgstr "Εστίαση στην επιλογή"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align Selection With View"
+msgstr "Στοίχηση επιλογής με την Ï€Ïοβολή"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "Επιλογή"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "Μετακίνηση"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: ΠεÏιστÏοφή"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "Κλιμάκωση:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform"
+msgstr "Μετασχηματισμός"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Local Coords"
+msgstr "Τοπικές συντεταγμένες"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
+msgstr "Διάλογος μετασχηματισμοÏ.."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "1 Viewport"
+msgstr "1 Οπτική γωνία"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "2 Viewports"
+msgstr "2 Οπτικές γωνίες"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "2 Viewports (Alt)"
+msgstr "2 Οπτικές γωνίες (Εναλλακτικό)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "3 Viewports"
+msgstr "3 Οπτικές γωνίες"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "3 Viewports (Alt)"
+msgstr "3 Οπτικές γωνίες (Εναλλακτικό)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "4 Viewports"
+msgstr "4 Οπτικές γωνίες"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Origin"
+msgstr "ΠÏοβολή ΑÏχής"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Grid"
+msgstr "ΠÏοβολή πλέγματος"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Ρυθμίσεις"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Snap Settings"
+msgstr "Ρυθμίσεις κουμπώματος"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Translate Snap:"
+msgstr "ΚοÏμπωμα μετατόπισης:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate Snap (deg.):"
+msgstr "ΚοÏμπωμα πεÏιστÏοφής (μοίÏες):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale Snap (%):"
+msgstr "ΚοÏμπωμα κλιμάκωσης (%):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Viewport Settings"
+msgstr "Ρυθμίσεις οπτικής γωνίας"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Perspective FOV (deg.):"
+msgstr "ΈυÏος Î¿Ï€Ï„Î¹ÎºÎ¿Ï Ï€ÎµÎ´Î¯Î¿Ï… Ï€Ïοοπτικής (μοίÏες):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Z-Near:"
+msgstr "Κοντινό απόσταση Ï€Ïοβολής:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Z-Far:"
+msgstr "ΜακÏινή απόσταση Ï€Ïοβολής:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Change"
+msgstr "Αλλαγή μετασχηματισμοÏ"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Translate:"
+msgstr "Μετατόπιση:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate (deg.):"
+msgstr "ΠεÏιστÏοφή (μοίÏες):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale (ratio):"
+msgstr "Κλιμάκωση (αναλογία):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Type"
+msgstr "Είδος μετασχηματισμοÏ"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Pre"
+msgstr "ΠÏιν"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Post"
+msgstr "Μετά"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "ERROR: Couldn't load frame resource!"
+msgstr "ΣΦΑΛΜΑ: Δεν ήταν δυνατή η φόÏτωση πόÏου Ï„Ïπου καÏέ!"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Frame"
+msgstr "ΠÏοσθήκη καÏέ"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Resource clipboard is empty or not a texture!"
+msgstr "Το Ï€ÏόχειÏο πόÏων είναι άδειο ή δεν είναι υφή!"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Paste Frame"
+msgstr "Επικόλληση καÏέ"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Empty"
+msgstr "ΠÏοσθήκη άδειου"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Change Animation Loop"
+msgstr "Αλλαγή βÏόχου κίνησης"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Change Animation FPS"
+msgstr "Αλλαγή FPS κίνησης"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "(empty)"
+msgstr "(άδειο)"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Animations"
+msgstr "Κινήσεις"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Speed (FPS):"
+msgstr "ΤαχÏτητα (FPS):"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Animation Frames"
+msgstr "ΚαÏέ κίνησης"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Insert Empty (Before)"
+msgstr "Εισαγωγή άδειου (ΠÏιν)"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Insert Empty (After)"
+msgstr "Εισαγωγή άδειου (Μετά)"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Up"
+msgstr "Πάνω"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Down"
+msgstr "Κάτω"
+
+#: editor/plugins/style_box_editor_plugin.cpp
+msgid "StyleBox Preview:"
+msgstr "ΠÏοεπισκόπηση StyleBox:"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Snap Mode:"
+msgstr "ΛειτουÏγία κουμπώματος:"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "<None>"
+msgstr "<Τίποτα>"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Pixel Snap"
+msgstr "ΚοÏμπωμα στα εικονοστοιχεία"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Grid Snap"
+msgstr "ΚοÏμπωμα στο πλέγμα"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Auto Slice"
+msgstr "Αυτόματο κόψιμο"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Offset:"
+msgstr "Μετατόπιση:"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Step:"
+msgstr "Βήμα:"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Separation:"
+msgstr "ΔιαχωÏισμός:"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Texture Region"
+msgstr "ΠεÏιοχή υφής"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Texture Region Editor"
+msgstr "ΕπεξεÏγαστής πεÏιοχής υφής"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Can't save theme to file:"
+msgstr "Δεν ήταν δυνατή η αποθήκευση θέματος σε αÏχείο:"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add All Items"
+msgstr "ΠÏοσθήκη όλων των στοιχείων"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add All"
+msgstr "ΠÏοσθήκη όλων"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Remove Item"
+msgstr "ΑφαίÏεση στοιχείου"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Theme"
+msgstr "Θέμα"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add Class Items"
+msgstr "ΠÏοσθήκη στοιχείων κλάσης"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Remove Class Items"
+msgstr "ΑφαίÏεση στοιχείων κλάσης"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Create Empty Template"
+msgstr "ΔημιουÏγία άδειου Ï€ÏοτÏπου"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Create Empty Editor Template"
+msgstr "ΔημιουÏγία άδειου Ï€ÏοτÏπου επεξεÏγαστή"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "CheckBox Radio1"
+msgstr "Κουμπί επιλογής1"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "CheckBox Radio2"
+msgstr "Κουμπί επιλογής 2"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Item"
+msgstr "Στοιχείο"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Check Item"
+msgstr "Επιλογή στοιχείου"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Item"
+msgstr "Επιλεγμένο στοιχείο"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Has"
+msgstr "Έχει"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Many"
+msgstr "Πολλές"
+
+#: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp
+msgid "Options"
+msgstr "Επιλογές"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Have,Many,Several,Options!"
+msgstr "Έχει,ΠάÏα,Πολλές,Επιλογές!"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 1"
+msgstr "ΚαÏτέλα 1"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 2"
+msgstr "ΚαÏτέλα 2"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 3"
+msgstr "ΚαÏτέλα 3"
+
+#: editor/plugins/theme_editor_plugin.cpp editor/project_settings.cpp
+#: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp
+msgid "Type:"
+msgstr "ΤÏπος:"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Data Type:"
+msgstr "ΤÏπος δεδομένων:"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Icon"
+msgstr "Εικονίδιο"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Style"
+msgstr "Στυλ"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Color"
+msgstr "ΧÏώμα"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Paint TileMap"
+msgstr "Βάψιμο TileMap"
+
+#: editor/plugins/tile_map_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Duplicate"
+msgstr "Διπλασιασμός"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Erase TileMap"
+msgstr "ΔιαγÏαφή TileMap"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Erase selection"
+msgstr "ΔιαγÏαφή επιλογής"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Find tile"
+msgstr "ΕÏÏεση πλακιδίου"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Transpose"
+msgstr "Μετατόπιση"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Mirror X"
+msgstr "ΣυμμετÏία στον άξονα Χ"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Mirror Y"
+msgstr "ΣυμμετÏία στον άξονα Î¥"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Bucket"
+msgstr "Κουβάς"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Pick Tile"
+msgstr "Επιλογή πλακιδίου"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Select"
+msgstr "Επιλογή"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 0 degrees"
+msgstr "ΠεÏιστÏοφή 0 μοίÏες"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 90 degrees"
+msgstr "ΠεÏιστÏοφή 90 μοίÏες"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 180 degrees"
+msgstr "ΠεÏιστÏοφή 180 μοίÏες"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 270 degrees"
+msgstr "ΠεÏιστÏοφή 270 μοίÏες"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Could not find tile:"
+msgstr "Δεν ήταν δυνατή η εÏÏεση πλακιδίου:"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Item name or ID:"
+msgstr "Όνομα στοιχείου ή αναγνωÏιστικοÏ:"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Create from scene?"
+msgstr "ΔημιουÏγία από σκηνή;"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Merge from scene?"
+msgstr "Συγχώνευση από σκηνή;"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Create from Scene"
+msgstr "ΔημιουÏγία από σκηνή"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Merge from Scene"
+msgstr "Συγχώνευση από σκηνή"
+
+#: editor/plugins/tile_set_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Error"
+msgstr "Σφάλμα"
+
+#: editor/project_export.cpp
+msgid "Runnable"
+msgstr "Εκτελέσιμο"
+
+#: editor/project_export.cpp
+msgid "Delete patch '"
+msgstr "ΔιαγÏαφή ενημέÏωσης '"
+
+#: editor/project_export.cpp
+msgid "Delete preset '%s'?"
+msgstr "ΔιαγÏαφή διαμόÏφωσης '%s';"
+
+#: editor/project_export.cpp
+msgid "Presets"
+msgstr "ΔιαμοÏφώσεις"
+
+#: editor/project_export.cpp editor/project_settings.cpp
+msgid "Add.."
+msgstr "ΠÏοσθήκη.."
+
+#: editor/project_export.cpp
+msgid "Resources"
+msgstr "ΠόÏοι"
+
+#: editor/project_export.cpp
+msgid "Export all resources in the project"
+msgstr "Εξαγωγή όλων των πόÏων στο έÏγο"
+
+#: editor/project_export.cpp
+msgid "Export selected scenes (and dependencies)"
+msgstr "Εξαγωγή επιλεγμένων σκηνών (και εξαÏτήσεων)"
+
+#: editor/project_export.cpp
+msgid "Export selected resources (and dependencies)"
+msgstr "Εξαγωγή επιλεγμένων πόÏων (και εξαÏτήσεων)"
+
+#: editor/project_export.cpp
+msgid "Export Mode:"
+msgstr "ΛειτουÏγία εξαγωγής:"
+
+#: editor/project_export.cpp
+msgid "Resources to export:"
+msgstr "ΠόÏοι για εξαγωγή:"
+
+#: editor/project_export.cpp
+msgid ""
+"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"
+msgstr ""
+"ΦίλτÏα για εξαγωγή για αÏχεία που δεν είναι πόÏοι (χωÏισμένα με κόμμα Ï€.χ. *."
+"json, *.txt)"
+
+#: editor/project_export.cpp
+msgid ""
+"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)"
+msgstr ""
+"ΦίλτÏα για την εξαίÏεση αÏχείων από το έÏγο (χωÏισμένα με κόμμα Ï€.χ. *.json, "
+"*.txt)"
+
+#: editor/project_export.cpp
+msgid "Patches"
+msgstr "ΕνημεÏώσεις"
+
+#: editor/project_export.cpp
+msgid "Make Patch"
+msgstr "ΔημιουÏγία ενημέÏωσης"
+
+#: editor/project_export.cpp
+msgid "Export templates for this platform are missing:"
+msgstr "Τα Ï€Ïότυπα εξαγωγής για αυτή την πλατφόÏτμα λείπουν:"
+
+#: editor/project_export.cpp
+msgid "Export With Debug"
+msgstr "Εξαγωγή με αποσφαλμάτωση"
+
+#: editor/project_manager.cpp
+msgid "Invalid project path, the path must exist!"
+msgstr "Μη έγκυÏη διαδÏομή έÏγου, η διαδÏομή Ï€Ïέπει να υπάÏχει!"
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Μη έγκυÏη διαδÏομή έÏγου, το godot.cfg δεν Ï€Ïέπει να υπάÏχει."
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "Μη έγκυÏη διαδÏομή έÏγου, το godot.cfg Ï€Ïέπει να υπάÏχει."
+
+#: editor/project_manager.cpp
+msgid "Imported Project"
+msgstr "Εισαγμένο έÏγο"
+
+#: editor/project_manager.cpp
+msgid "Invalid project path (changed anything?)."
+msgstr "Μη έγκυÏη διαδÏομή έÏγου (Αλλάξατε τίποτα;)."
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "Δεν ήταν δυνατή η δημιουÏγία του godot.cfg στη διαδÏομή έÏγου."
+
+#: editor/project_manager.cpp
+msgid "The following files failed extraction from package:"
+msgstr "Η εξαγωγή των ακόλουθων αÏχείων από το πακέτο απέτυχε:"
+
+#: editor/project_manager.cpp
+msgid "Package Installed Successfully!"
+msgstr "Το πακέτο εγκαταστάθηκε επιτυχώς!"
+
+#: editor/project_manager.cpp
+msgid "Import Existing Project"
+msgstr "Εισαγωγή υπαÏÎºÏ„Î¿Ï Î­Ïγου"
+
+#: editor/project_manager.cpp
+msgid "Project Path (Must Exist):"
+msgstr "ΔιαδÏομή έÏγου (ΠÏέπει να υπάÏχει):"
+
+#: editor/project_manager.cpp
+msgid "Project Name:"
+msgstr "Όνομα έÏγου:"
+
+#: editor/project_manager.cpp
+msgid "Create New Project"
+msgstr "ΔημιουÏγία νέου έÏγου"
+
+#: editor/project_manager.cpp
+msgid "Project Path:"
+msgstr "ΔιαδÏομή έÏγου:"
+
+#: editor/project_manager.cpp
+msgid "Install Project:"
+msgstr "Εγκατάσταση έÏγου:"
+
+#: editor/project_manager.cpp
+msgid "Browse"
+msgstr "ΠεÏιήγηση"
+
+#: editor/project_manager.cpp
+msgid "New Game Project"
+msgstr "Îέο έÏγο παιχνιδιοÏ"
+
+#: editor/project_manager.cpp
+msgid "That's a BINGO!"
+msgstr "Αυτό είναι ένα «ΕÏÏηκα»!"
+
+#: editor/project_manager.cpp
+msgid "Unnamed Project"
+msgstr "Ανώνυμο έÏγο"
+
+#: editor/project_manager.cpp
+msgid "Are you sure to open more than one project?"
+msgstr "Είστε σίγουÏοι πως θέλετε να ανοίξετε πεÏισσότεÏα από ένα έÏγα;"
+
+#: editor/project_manager.cpp
+msgid "Are you sure to run more than one project?"
+msgstr "Είστε σίγουÏοι πως θέλετε να Ï„Ïέξετε πεÏισσότεÏα από ένα έÏγα;"
+
+#: editor/project_manager.cpp
+msgid "Remove project from the list? (Folder contents will not be modified)"
+msgstr ""
+"ΑφαίÏεση έÏγου από την λίστα; (Τα πεÏιεχόμενα το φακέλου δεν θα "
+"Ï„ÏοποποιηθοÏν)"
+
+#: editor/project_manager.cpp
+msgid ""
+"You are about the scan %s folders for existing Godot projects. Do you "
+"confirm?"
+msgstr ""
+"Είστε έτοιμοι να σαÏώσετε %s φακέλους για υπαÏκτά έÏγα Godot. Είστε σίγουÏοι;"
+
+#: editor/project_manager.cpp
+msgid "Project Manager"
+msgstr "ΔιαχειÏιστής"
+
+#: editor/project_manager.cpp
+msgid "Project List"
+msgstr "Λίστα έÏγων"
+
+#: editor/project_manager.cpp
+msgid "Run"
+msgstr "Εκτέλεση"
+
+#: editor/project_manager.cpp
+msgid "Scan"
+msgstr "ΣάÏωση"
+
+#: editor/project_manager.cpp
+msgid "Select a Folder to Scan"
+msgstr "Επιλέξτε έναν φάκελο για σάÏωση"
+
+#: editor/project_manager.cpp
+msgid "New Project"
+msgstr "Îέο έÏγο"
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "ΑφαίÏεση Ï€ÏοτÏπου"
+
+#: editor/project_manager.cpp
+msgid "Exit"
+msgstr "Έξοδος"
+
+#: editor/project_settings.cpp
+msgid "Key "
+msgstr "Κλειδί "
+
+#: editor/project_settings.cpp
+msgid "Joy Button"
+msgstr "Κουμπί Joystick"
+
+#: editor/project_settings.cpp
+msgid "Joy Axis"
+msgstr "Άξονας Joystick"
+
+#: editor/project_settings.cpp
+msgid "Mouse Button"
+msgstr "Κουμπί ποντικιοÏ"
+
+#: editor/project_settings.cpp
+msgid "Invalid action (anything goes but '/' or ':')."
+msgstr "Μη έγκυÏη ενέÏγεια (Όλα επιτÏέποντα εκτός από το '/' και το ':')."
+
+#: editor/project_settings.cpp
+msgid "Action '%s' already exists!"
+msgstr "Η ενέÏγεια '%s' υπάÏχει ήδη!"
+
+#: editor/project_settings.cpp
+msgid "Rename Input Action Event"
+msgstr "Μετονομασία συμβάντος εισόδου"
+
+#: editor/project_settings.cpp
+msgid "Add Input Action Event"
+msgstr "ΠÏοσθήκη συμβάντος εισόδου"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Meta+"
+msgstr "Meta+"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Shift+"
+msgstr "Shift+"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Alt+"
+msgstr "Alt+"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "Control+"
+msgstr "Control+"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "Press a Key.."
+msgstr "Πατήστε ένα κουμπί.."
+
+#: editor/project_settings.cpp
+msgid "Mouse Button Index:"
+msgstr "Kουμπί ποντικιοÏ:"
+
+#: editor/project_settings.cpp
+msgid "Left Button"
+msgstr "ΑÏιστεÏÏŒ κουμπί"
+
+#: editor/project_settings.cpp
+msgid "Right Button"
+msgstr "Δεξί κουμπί"
+
+#: editor/project_settings.cpp
+msgid "Middle Button"
+msgstr "Μεσαίο κουμπί"
+
+#: editor/project_settings.cpp
+msgid "Wheel Up Button"
+msgstr "Ροδέλα πάνω"
+
+#: editor/project_settings.cpp
+msgid "Wheel Down Button"
+msgstr "Ροδέλα κάτω"
+
+#: editor/project_settings.cpp
+msgid "Button 6"
+msgstr "Κουμπί 6"
+
+#: editor/project_settings.cpp
+msgid "Button 7"
+msgstr "Κουμπί 7"
+
+#: editor/project_settings.cpp
+msgid "Button 8"
+msgstr "Κουμπί 8"
+
+#: editor/project_settings.cpp
+msgid "Button 9"
+msgstr "Κουμπί 9"
+
+#: editor/project_settings.cpp
+msgid "Joypad Axis Index:"
+msgstr "ΑÏιθμός άξονα Joypad:"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Axis"
+msgstr "Άξονας"
+
+#: editor/project_settings.cpp
+msgid "Joypad Button Index:"
+msgstr "ΑÏιθμός ÎºÎ¿Ï…Î¼Ï€Î¹Î¿Ï Joypad:"
+
+#: editor/project_settings.cpp
+msgid "Add Input Action"
+msgstr "ΠÏοσθήκη συμβάντος ενέÏγειας εισόδου"
+
+#: editor/project_settings.cpp
+msgid "Erase Input Action Event"
+msgstr "ΔιαγÏαφή συμβάντος ενέÏγειας εισόδου"
+
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "ΠÏοσθήκη άδειου"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Device"
+msgstr "Συσκευή"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Button"
+msgstr "Κουμπί"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Left Button."
+msgstr "ΑÏιστεÏÏŒ κουμπί."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Right Button."
+msgstr "Δεξί κουμπί."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Middle Button."
+msgstr "Μεσαίο κουμπί."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Wheel Up."
+msgstr "Ροδέλα πάνω."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Wheel Down."
+msgstr "Ροδέλα κάτω."
+
+#: editor/project_settings.cpp
+msgid "Error saving settings."
+msgstr "Σφάλμα κατά την αποθήκευση Ïυθμίσεων."
+
+#: editor/project_settings.cpp
+msgid "Settings saved OK."
+msgstr "Οι Ïυθμίσεις αποθηκεÏτικαν εντάξει."
+
+#: editor/project_settings.cpp
+msgid "Add Translation"
+msgstr "ΠÏοσθήκη μετάφÏασης"
+
+#: editor/project_settings.cpp
+msgid "Remove Translation"
+msgstr "ΑφαίÏεση μετάφÏασης"
+
+#: editor/project_settings.cpp
+msgid "Add Remapped Path"
+msgstr "ΠÏοσθήκη ανακατεÏθυνσης διαδÏομής"
+
+#: editor/project_settings.cpp
+msgid "Resource Remap Add Remap"
+msgstr "ΠÏοσθήκη ανακατεÏθυνσης διαδÏομής πόÏου"
+
+#: editor/project_settings.cpp
+msgid "Change Resource Remap Language"
+msgstr "Αλλαγή γλώσσας ανακατεÏθυνσης πόÏων"
+
+#: editor/project_settings.cpp
+msgid "Remove Resource Remap"
+msgstr "ΑφαίÏεση ανακατεÏθυνσης πόÏου"
+
+#: editor/project_settings.cpp
+msgid "Remove Resource Remap Option"
+msgstr "ΑφαίÏεση επιλογής ανακατεÏθυνσης πόÏου"
+
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Ρυθμίσεις έÏγου (godot.cfg)"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "General"
+msgstr "Γενικά"
+
+#: editor/project_settings.cpp editor/property_editor.cpp
+msgid "Property:"
+msgstr "Ιδιότητα:"
+
+#: editor/project_settings.cpp
+msgid "Del"
+msgstr "ΔιαγÏαφή"
+
+#: editor/project_settings.cpp
+msgid "Copy To Platform.."
+msgstr "ΑντιγÏαφή σε πλατφόÏμα.."
+
+#: editor/project_settings.cpp
+msgid "Input Map"
+msgstr "ΧάÏτης εισόδου"
+
+#: editor/project_settings.cpp
+msgid "Action:"
+msgstr "ΕνέÏγεια:"
+
+#: editor/project_settings.cpp
+msgid "Device:"
+msgstr "Συσκευή:"
+
+#: editor/project_settings.cpp
+msgid "Index:"
+msgstr "Δείκτης:"
+
+#: editor/project_settings.cpp
+msgid "Localization"
+msgstr "Τοπική Ï€ÏοσαÏμογή"
+
+#: editor/project_settings.cpp
+msgid "Translations"
+msgstr "ΜεταφÏάσεις"
+
+#: editor/project_settings.cpp
+msgid "Translations:"
+msgstr "ΜεταφÏάσεις:"
+
+#: editor/project_settings.cpp
+msgid "Remaps"
+msgstr "ΑνακατευθÏνσεις"
+
+#: editor/project_settings.cpp
+msgid "Resources:"
+msgstr "ΠόÏοι:"
+
+#: editor/project_settings.cpp
+msgid "Remaps by Locale:"
+msgstr "ΑνακατευθÏνσεις ανά πεÏιοχή:"
+
+#: editor/project_settings.cpp
+msgid "Locale"
+msgstr "ΠεÏιοχή"
+
+#: editor/project_settings.cpp
+msgid "AutoLoad"
+msgstr "Αυτόματη φόÏτωση"
+
+#: editor/property_editor.cpp
+msgid "Pick a Viewport"
+msgstr "Επιλέξτε μία οπτική γωνία"
+
+#: editor/property_editor.cpp
+msgid "Ease In"
+msgstr "Ομαλή κίνηση Ï€Ïος τα μέσα"
+
+#: editor/property_editor.cpp
+msgid "Ease Out"
+msgstr "Ομαλή κίνηση Ï€Ïος τα έξω"
+
+#: editor/property_editor.cpp
+msgid "Zero"
+msgstr "Μηδέν"
+
+#: editor/property_editor.cpp
+msgid "Easing In-Out"
+msgstr "Ομαλή κίνηση από μέσα Ï€Ïος τα έξω"
+
+#: editor/property_editor.cpp
+msgid "Easing Out-In"
+msgstr "Ομαλή κίνηση από έξω Ï€Ïος τα μέσα"
+
+#: editor/property_editor.cpp
+msgid "File.."
+msgstr "ΑÏχείο.."
+
+#: editor/property_editor.cpp
+msgid "Dir.."
+msgstr "Κατάλογος.."
+
+#: editor/property_editor.cpp
+msgid "Assign"
+msgstr "Ανάθεση"
+
+#: editor/property_editor.cpp
+msgid "New Script"
+msgstr "Îεα δεσμή ενεÏγειών"
+
+#: editor/property_editor.cpp
+msgid "Show in File System"
+msgstr "Εμφάνιση στο σÏστημα αÏχείων"
+
+#: editor/property_editor.cpp
+msgid "Error loading file: Not a resource!"
+msgstr "Σφάλμα κατά την φόÏτωση αÏχείου: Δεν είναι πόÏος!"
+
+#: editor/property_editor.cpp
+msgid "Pick a Node"
+msgstr "Επιλέξτε έναν κόμβο"
+
+#: editor/property_editor.cpp
+msgid "Bit %d, val %d."
+msgstr "Δυαδικό ψηφίο %d, τιμή %d."
+
+#: editor/property_editor.cpp
+msgid "On"
+msgstr "Îαι"
+
+#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Set"
+msgstr "ÎŒÏισε"
+
+#: editor/property_editor.cpp
+msgid "Properties:"
+msgstr "Ιδιότητες:"
+
+#: editor/property_editor.cpp
+msgid "Sections:"
+msgstr "Ενότητες:"
+
+#: editor/property_selector.cpp
+msgid "Select Property"
+msgstr "Επιλογή ιδιότητας"
+
+#: editor/property_selector.cpp
+msgid "Select Method"
+msgstr "Επιλογή μεθόδου"
+
+#: editor/pvrtc_compress.cpp
+msgid "Could not execute PVRTC tool:"
+msgstr "Δεν ήταν δυνατή η εκτέλεση του εÏγαλείου PVRTC:"
+
+#: editor/pvrtc_compress.cpp
+msgid "Can't load back converted image using PVRTC tool:"
+msgstr ""
+"Δεν ήταν δυνατή η επαναφόÏτωση της εικόνας που έχει μετατÏαπεί με το "
+"εÏγαλείο PVRTC:"
+
+#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
+msgid "Reparent Node"
+msgstr "ΕπαναπÏοσδιοÏισμός γονέα κόμβου"
+
+#: editor/reparent_dialog.cpp
+msgid "Reparent Location (Select new Parent):"
+msgstr "Θέση γονέα (Επιλέξτε νέο γονέα):"
+
+#: editor/reparent_dialog.cpp
+msgid "Keep Global Transform"
+msgstr "ΔιατήÏηση παγκόσμιου μετασχηματισμοÏ"
+
+#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
+msgid "Reparent"
+msgstr "ΕπαναπÏοσδιοÏισμός γονέα"
+
+#: editor/resources_dock.cpp
+msgid "Create New Resource"
+msgstr "ΔημιουÏγία νέου πόÏου"
+
+#: editor/resources_dock.cpp
+msgid "Open Resource"
+msgstr "Άνοιγμα πόÏου"
+
+#: editor/resources_dock.cpp
+msgid "Save Resource"
+msgstr "Αποθήκευση πόÏου"
+
+#: editor/resources_dock.cpp
+msgid "Resource Tools"
+msgstr "ΕÏγαλεία πόÏων"
+
+#: editor/resources_dock.cpp
+msgid "Make Local"
+msgstr "Κάνε τοπικό"
+
+#: editor/run_settings_dialog.cpp
+msgid "Run Mode:"
+msgstr "ΛειτουÏγία εκτέλεσης:"
+
+#: editor/run_settings_dialog.cpp
+msgid "Current Scene"
+msgstr "ΤÏέχουσα σκηνή"
+
+#: editor/run_settings_dialog.cpp
+msgid "Main Scene"
+msgstr "ΚÏÏια σκηνή"
+
+#: editor/run_settings_dialog.cpp
+msgid "Main Scene Arguments:"
+msgstr "ΟÏίσματα κÏÏιας σκηνής:"
+
+#: editor/run_settings_dialog.cpp
+msgid "Scene Run Settings"
+msgstr "Ρυθμίσης εκτέλεσης σκηνής"
+
+#: editor/scene_tree_dock.cpp
+msgid "No parent to instance the scenes at."
+msgstr "Δεν υπάÏχει γονέας για να δημιουÏγηθοÏν τα στιγμιότυπα των σκηνών."
+
+#: editor/scene_tree_dock.cpp
+msgid "Error loading scene from %s"
+msgstr "Σφάλμα κατά τη φόÏτωση σκηνής από %s"
+
+#: editor/scene_tree_dock.cpp
+msgid "Ok"
+msgstr "Εντάξει"
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Cannot instance the scene '%s' because the current scene exists within one "
+"of its nodes."
+msgstr ""
+"Δεν ήταν δυνατή η δημιουÏγία στιγμιοτÏπου της σκηνής '%s', επειδή η Ï„Ïέχουσα "
+"σκηνή υπάÏχει μέσα σε έναν από τους κόμβους της."
+
+#: editor/scene_tree_dock.cpp
+msgid "Instance Scene(s)"
+msgstr "ΔημιουÏγία στιγμιοτÏπυ σκηνών"
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done on the tree root."
+msgstr "Αυτή η λειτουÏγία δεν μποÏεί να γίνει στην Ïίζα το δέντÏου."
+
+#: editor/scene_tree_dock.cpp
+msgid "Move Node In Parent"
+msgstr "Μετακίνηση κόμβου στον γονέα"
+
+#: editor/scene_tree_dock.cpp
+msgid "Move Nodes In Parent"
+msgstr "Μετακίνηση κόμβων στον γονέα"
+
+#: editor/scene_tree_dock.cpp
+msgid "Duplicate Node(s)"
+msgstr "Διπλασιασμός κόμβων"
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete Node(s)?"
+msgstr "ΔιαγÏαφή κόμβων;"
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done without a scene."
+msgstr "Αυτή η λειτουÏγία δεν μποÏεί να γίνει χωÏίς σκηνή."
+
+#: editor/scene_tree_dock.cpp
+msgid "Can not perform with the root node."
+msgstr "Δεν είναι δυνατή η εκτέλεση με τον πηγαίο κόμβο."
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done on instanced scenes."
+msgstr ""
+"Αυτή η λειτουÏγία δεν μποÏεί να γίνει σε σκηνές από τις οποίες έχουν "
+"δημιουÏγηθεί στιγμιότυπα."
+
+#: editor/scene_tree_dock.cpp
+msgid "Save New Scene As.."
+msgstr "Αποθήκευση νέας σκηνής ως.."
+
+#: editor/scene_tree_dock.cpp
+msgid "Makes Sense!"
+msgstr "Βγάζει νόημα!"
+
+#: editor/scene_tree_dock.cpp
+msgid "Can't operate on nodes from a foreign scene!"
+msgstr "Δεν είναι δυνατή η λειτουÏγία σε κόμβους από ξένη σκηνή!"
+
+#: editor/scene_tree_dock.cpp
+msgid "Can't operate on nodes the current scene inherits from!"
+msgstr ""
+"Δεν είναι δυνατή η λειτουÏγία σε κόμβους από τους οποίους κληÏονομεί η "
+"Ï„Ïέχουσα σκηνή!"
+
+#: editor/scene_tree_dock.cpp
+msgid "Remove Node(s)"
+msgstr "ΑφαίÏεση κόμβων"
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Couldn't save new scene. Likely dependencies (instances) couldn't be "
+"satisfied."
+msgstr ""
+"Δεν ήταν δυνατή η αποθήκευση νέας σκηνής. Πιθανώς οι εξαÏτήσεις "
+"(στιγμιότυπα) δεν μποÏοÏσαν να ικανοποιηθοÏν."
+
+#: editor/scene_tree_dock.cpp
+msgid "Error saving scene."
+msgstr "Σφάλμα κατά την αποθήκευση σκηνής."
+
+#: editor/scene_tree_dock.cpp
+msgid "Error duplicating scene to save it."
+msgstr "Σφάλμα κατά τον διπλασιασμό σκηνής για αποθήκευση."
+
+#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "ΠόÏοι:"
+
+#: editor/scene_tree_dock.cpp
+msgid "Edit Groups"
+msgstr "ΕπεξεÏγασία Ομάδων"
+
+#: editor/scene_tree_dock.cpp
+msgid "Edit Connections"
+msgstr "ΕπεξεÏγασία συνδέσεων"
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete Node(s)"
+msgstr "ΔιαγÏαφή Κόμβων"
+
+#: editor/scene_tree_dock.cpp
+msgid "Add Child Node"
+msgstr "ΠÏοσθήκη κόμβου ως παιδί"
+
+#: editor/scene_tree_dock.cpp
+msgid "Instance Child Scene"
+msgstr "ΑÏχικοποίηση σκηνής ως παιδί"
+
+#: editor/scene_tree_dock.cpp
+msgid "Change Type"
+msgstr "Αλλαγή Ï„Ïπου"
+
+#: editor/scene_tree_dock.cpp
+msgid "Attach Script"
+msgstr "ΣÏνδεση δεσμής ενεÏγειών"
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear Script"
+msgstr "ΕκκαθάÏιση δεσμής ενεÏγειών"
+
+#: editor/scene_tree_dock.cpp
+msgid "Merge From Scene"
+msgstr "Συγχώνευση από σκηνή"
+
+#: editor/scene_tree_dock.cpp
+msgid "Save Branch as Scene"
+msgstr "Αποθήκευσι ÎºÎ»Î±Î´Î¹Î¿Ï Ï‰Ï‚ σκηνή"
+
+#: editor/scene_tree_dock.cpp
+msgid "Copy Node Path"
+msgstr "ΑντιγÏαφή διαδÏομής κόμβου"
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete (No Confirm)"
+msgstr "ΔιαγÏαφή (ΧωÏίς επιβεβαίωση)"
+
+#: editor/scene_tree_dock.cpp
+msgid "Add/Create a New Node"
+msgstr "ΠÏοσθήκη/ΔημιουÏγία κόμβου"
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Instance a scene file as a Node. Creates an inherited scene if no root node "
+"exists."
+msgstr ""
+"ΑÏχικοποίηση σκηνής ως κόμβο. ΔημιουÏγεί μία κληÏονομημένη σκηνή αν δεν "
+"υπάÏχει πηγαίος κόμβος."
+
+#: editor/scene_tree_dock.cpp
+msgid "Attach a new or existing script for the selected node."
+msgstr "ΣÏνδεση νέας ή υπαÏκτής δεσμής ενεÏγειών για τον επιλεγμένο κόμβο."
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear a script for the selected node."
+msgstr "ΕκκαθάÏιση δεσμής ενεÏγειών για τον επιλεγμένο κόμβο."
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Spatial Visible"
+msgstr "Εναλλαγή οÏατότητας Spatial"
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle CanvasItem Visible"
+msgstr "Εναλλαγή οÏατότητας CanvasItem"
+
+#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Επιλογές ÎµÎ½Ï„Î¿Ï€Î¹ÏƒÎ¼Î¿Ï ÏƒÏ†Î±Î»Î¼Î¬Ï„Ï‰Î½"
+
+#: editor/scene_tree_editor.cpp
+msgid "Instance:"
+msgstr "Στιγμιότυπο:"
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Επόμενη δεσμή ενεÏγειών"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Εναλλαγή οÏατότητας Spatial"
+
+#: editor/scene_tree_editor.cpp
+msgid "Invalid node name, the following characters are not allowed:"
+msgstr "ΆκυÏο όνομα κόμβου, οι ακόλουθοι χαÏακτήÏες δεν επιτÏέπονται:"
+
+#: editor/scene_tree_editor.cpp
+msgid "Rename Node"
+msgstr "Μετονομασία κόμβου"
+
+#: editor/scene_tree_editor.cpp
+msgid "Scene Tree (Nodes):"
+msgstr "ΔέντÏο σκηνής (Κόμβοι):"
+
+#: editor/scene_tree_editor.cpp
+msgid "Editable Children"
+msgstr "ΕπεξεÏγάσιμα παιδιά"
+
+#: editor/scene_tree_editor.cpp
+msgid "Load As Placeholder"
+msgstr "ΦόÏτωση ως μέσο κÏάτησης θέσης"
+
+#: editor/scene_tree_editor.cpp
+msgid "Discard Instancing"
+msgstr "ΑπόÏÏιψη στιγμιοτÏπισης"
+
+#: editor/scene_tree_editor.cpp
+msgid "Open in Editor"
+msgstr "Άνοιγμα στον επεξεÏγαστή"
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear Inheritance"
+msgstr "ΕκκαθάÏιση κληÏονομικότητας"
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear Inheritance? (No Undo!)"
+msgstr "ΕκκαθάÏιση κληÏονομικότητας; (Δεν γίνεται ανέÏαιση!)"
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear!"
+msgstr "ΕκκαθάÏιση!"
+
+#: editor/scene_tree_editor.cpp
+msgid "Select a Node"
+msgstr "Επιλέξτε έναν κόμβο"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Δεν ήταν δυνατή η δημιουÏγία δεσμής ενεÏγειών στο σÏστημα αÏχείων."
+
+#: editor/script_create_dialog.cpp
+msgid "Error loading script from %s"
+msgstr "Σφάλμα κατά την φόÏτωση δεσμής ενεÏγειών από %s"
+
+#: editor/script_create_dialog.cpp
+msgid "Path is empty"
+msgstr "Η διαδÏομή είναι άδεια"
+
+#: editor/script_create_dialog.cpp
+msgid "Path is not local"
+msgstr "Η διαδÏομή δεν είναι τοπική"
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid base path"
+msgstr "Μη έγκυÏη βασική διαδÏομή"
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid extension"
+msgstr "Μη έγκυÏη επέκταση"
+
+#: editor/script_create_dialog.cpp
+msgid "Wrong extension chosen"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Invalid Path"
+msgstr "ΆκυÏη διαδÏομή."
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid class name"
+msgstr "Μη έγκυÏο όνομα κλάσης"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "ΆκυÏο όνομα ιδιότητας δείκτη."
+
+#: editor/script_create_dialog.cpp
+msgid "Script valid"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "N/A"
+msgstr "Δ/Υ"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in script (into scene file)"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Create new script file"
+msgstr "ΔημιουÏγία νέας δεσμής ενεÏγειών"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Load existing script file"
+msgstr "ΦόÏτωση υπαÏκτής δεσμής ενεÏγειών"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Inherits"
+msgstr "ΚληÏονομεί:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
+msgstr "Όνομα κλάσης:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr "ΑφαίÏεση Ï€ÏοτÏπου"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
+msgstr "Ενσωματωμένη δεσμή ενεÏγειών"
+
+#: editor/script_create_dialog.cpp
+msgid "Attach Node Script"
+msgstr "ΣÏνδεση δεσμής ενεÏγειών κόμβου"
+
+#: editor/script_editor_debugger.cpp
+msgid "Bytes:"
+msgstr "Ψηφιολέξεις:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Warning"
+msgstr "ΠÏοειδοποίηση"
+
+#: editor/script_editor_debugger.cpp
+msgid "Error:"
+msgstr "Σφάλμα:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Source:"
+msgstr "Πηγή:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Function:"
+msgstr "ΣυνάÏτηση:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Errors"
+msgstr "Σφάλματα"
+
+#: editor/script_editor_debugger.cpp
+msgid "Child Process Connected"
+msgstr "Η παιδική διαδικασία συνδέθηκε"
+
+#: editor/script_editor_debugger.cpp
+msgid "Inspect Previous Instance"
+msgstr "ΕπιθεώÏηση του Ï€ÏοηγοÏμενου στιγμιοτÏπου"
+
+#: editor/script_editor_debugger.cpp
+msgid "Inspect Next Instance"
+msgstr "ΕπιθεώÏηση του επόμενου στιγμιοτÏπου"
+
+#: editor/script_editor_debugger.cpp
+msgid "Stack Frames"
+msgstr "Στοίβαξη καÏέ"
+
+#: editor/script_editor_debugger.cpp
+msgid "Variable"
+msgstr "Μεταβλητή"
+
+#: editor/script_editor_debugger.cpp
+msgid "Errors:"
+msgstr "Σφάλματα:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Stack Trace (if applicable):"
+msgstr "Ιχνηλάτηση στοίβας (Εάν υφίσταται):"
+
+#: editor/script_editor_debugger.cpp
+msgid "Remote Inspector"
+msgstr "ΑπομακÏυσμένος επιθεωÏητής"
+
+#: editor/script_editor_debugger.cpp
+msgid "Live Scene Tree:"
+msgstr "Ζωντανό δέντÏο σκηνής:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Remote Object Properties: "
+msgstr "ΑπομακÏυσμένες ιδιότητες αντικειμένου: "
+
+#: editor/script_editor_debugger.cpp
+msgid "Profiler"
+msgstr "ΠÏόγÏαμμα δημιουÏγίας Ï€Ïοφιλ"
+
+#: editor/script_editor_debugger.cpp
+msgid "Monitor"
+msgstr "Κλειδί"
+
+#: editor/script_editor_debugger.cpp
+msgid "Value"
+msgstr "Τιμή"
+
+#: editor/script_editor_debugger.cpp
+msgid "Monitors"
+msgstr "ΠαÏακολοÏθηση"
+
+#: editor/script_editor_debugger.cpp
+msgid "List of Video Memory Usage by Resource:"
+msgstr "Λίστα χÏήσης βιντεο-μνήμης ανά πόÏο:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Total:"
+msgstr "Συνολικά:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Video Mem"
+msgstr "βιντεο-μνήμη"
+
+#: editor/script_editor_debugger.cpp
+msgid "Resource Path"
+msgstr "ΔιαδÏομή πόÏου"
+
+#: editor/script_editor_debugger.cpp
+msgid "Type"
+msgstr "ΤÏπος"
+
+#: editor/script_editor_debugger.cpp
+msgid "Usage"
+msgstr "ΧÏήση"
+
+#: editor/script_editor_debugger.cpp
+msgid "Misc"
+msgstr "ΔιάφοÏα"
+
+#: editor/script_editor_debugger.cpp
+msgid "Clicked Control:"
+msgstr "Πατημένο στοιχείο ελέγχου:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Clicked Control Type:"
+msgstr "ΤÏπος πατημένου στοιχείου ελέγχου:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Live Edit Root:"
+msgstr "Ρίζα ζωντανής επεξεÏγασίας:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Set From Tree"
+msgstr "ΟÏισμός από το δέντÏο"
+
+#: editor/settings_config_dialog.cpp
+msgid "Shortcuts"
+msgstr "ΣυντομεÏσεις"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Light Radius"
+msgstr "Αλλαγή διαμέτÏου φωτός"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Camera FOV"
+msgstr "Αλλαγή εÏÏους πεδίου κάμεÏας"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Camera Size"
+msgstr "Αλλαγή μεγέθους κάμεÏας"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Sphere Shape Radius"
+msgstr "Αλλαγή ακτίνας σφαιÏÎ¹ÎºÎ¿Ï ÏƒÏ‡Î®Î¼Î±Ï„Î¿Ï‚"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Box Shape Extents"
+msgstr "Αλλαγή διαστάσεων ÎºÏ…Î²Î¹ÎºÎ¿Ï ÏƒÏ‡Î®Î¼Î±Ï„Î¿Ï‚"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Capsule Shape Radius"
+msgstr "Αλλαγή ακτίνας κάψουλας"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Capsule Shape Height"
+msgstr "Αλλαγή Ïψους κάψουλας"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Ray Shape Length"
+msgstr "Αλλαγή μήκους ακτίνας"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Notifier Extents"
+msgstr "Αλλαγή διαστάσεων ειδοποιητή"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Probe Extents"
+msgstr "Αλλαγή διαστάσεων αισθητήÏα"
+
+#: modules/gdscript/gd_functions.cpp
+#: modules/visual_script/visual_script_builtin_funcs.cpp
+msgid "Invalid type argument to convert(), use TYPE_* constants."
+msgstr ""
+"Μη έγκυÏη παÏάμετÏος στην convert(). ΧÏησιμοποιήστε τις σταθεÏές TYPE_*."
+
+#: modules/gdscript/gd_functions.cpp
+#: modules/visual_script/visual_script_builtin_funcs.cpp
+msgid "Not enough bytes for decoding bytes, or invalid format."
+msgstr "Δεν υπάÏχουν αÏκετά byte για την αποκωδικοποίηση, ή άκυÏη μοÏφή."
+
+#: modules/gdscript/gd_functions.cpp
+msgid "step argument is zero!"
+msgstr "Η παÏάμετÏος step είναι μηδέν!"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not a script with an instance"
+msgstr "Δεν είναι δεσμή ενεÏγειών με στιγμιότυπο"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not based on a script"
+msgstr "Δεν είναι βασισμένο σε δεσμή ενεÏγειών"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not based on a resource file"
+msgstr "Δεν βασίζεται σε αÏχείο πόÏων"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (missing @path)"
+msgstr "ΆκυÏη μοÏφή Î»ÎµÎ¾Î¹ÎºÎ¿Ï ÏƒÏ„Î¹Î³Î¼Î¹Î¿Ï„Ïπων (λείπει το @path)"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (can't load script at @path)"
+msgstr ""
+"ΆκυÏη μοÏφή Î»ÎµÎ¾Î¹ÎºÎ¿Ï ÏƒÏ„Î¹Î³Î¼Î¹Î¿Ï„Ïπων (αδÏνατη η φόÏτωση της δεσμής ενεÏγειών στο "
+"@path)"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (invalid script at @path)"
+msgstr "ΆκυÏη μοÏφή Î»ÎµÎ¾Î¹ÎºÎ¿Ï ÏƒÏ„Î¹Î³Î¼Î¹Î¿Ï„Ïπων (Μη έγκυÏη δεσμή ενεÏγειών στο @path)"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary (invalid subclasses)"
+msgstr "ΆκυÏη μοÏφή Î»ÎµÎ¾Î¹ÎºÎ¿Ï ÏƒÏ„Î¹Î³Î¼Î¹Î¿Ï„Ïπων (άκυÏες υπό-κλάσεις)"
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"A node yielded without working memory, please read the docs on how to yield "
+"properly!"
+msgstr ""
+"Ένας κόμβος παÏέδωσε χωÏίς μνήμη εÏγασίας. Διαβάστε τις οδηγίες για τη σωστή "
+"λειτουÏγία του yield!"
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"Node yielded, but did not return a function state in the first working "
+"memory."
+msgstr ""
+"Ένας κόμβος παÏέδωσε (έκανε yield), αλλά δεν επέστÏεψε μία κατάσταση "
+"συνάÏτηση στην Ï€Ïώτη μνήμη εÏγασίας."
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"Return value must be assigned to first element of node working memory! Fix "
+"your node please."
+msgstr ""
+"Η τιμή επιστÏοφής Ï€Ïέπει να έχει ανατεθεί στο Ï€Ïώτο στοιχείο της μνήμης "
+"εÏγασίας του κόμβου! ΠαÏακαλοÏμε διοÏθώστε τον κόμβο σας."
+
+#: modules/visual_script/visual_script.cpp
+msgid "Node returned an invalid sequence output: "
+msgstr "Ο κόμβος επέστÏεψε μία άκυÏη ακολουθία ως έξοδο: "
+
+#: modules/visual_script/visual_script.cpp
+msgid "Found sequence bit but not the node in the stack, report bug!"
+msgstr ""
+"Î’Ïέθηκε το bit της ακολουθίας, αλλά όχι ο κόμβος στη στοίβα. ΠαÏακαλοÏμε "
+"αναφέÏετε το bug!"
+
+#: modules/visual_script/visual_script.cpp
+msgid "Stack overflow with stack depth: "
+msgstr "ΥπεÏχείλιση στοίβας με βάθος στοίβας: "
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Functions:"
+msgstr "ΣυναÏτήσεις:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Variables:"
+msgstr "Μεταβλητές:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Name is not a valid identifier:"
+msgstr "Το όνομα δεν είναι έγκυÏο αναγνωÏιστικό:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Name already in use by another func/var/signal:"
+msgstr "Το όνομα χÏησιμοποιείται ήδη από μία άλλη συνάÏτηση/μεταβλητή/σήμα:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Function"
+msgstr "Μετονομασία συνάÏτησης"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Variable"
+msgstr "Μετονομασία μεταβλητής"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Signal"
+msgstr "Μετονομασία σήματος"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Function"
+msgstr "ΠÏοσθήκη συνάÏτησης"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Variable"
+msgstr "ΠÏοσθήκη μεταβλητής"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Signal"
+msgstr "ΠÏοσθήκη σήματος"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Function"
+msgstr "ΑφαίÏεση συνάÏτησης"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Variable"
+msgstr "ΑφαίÏεση μεταβλητής"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Editing Variable:"
+msgstr "ΕπεξεÏγασία μεταβλητής:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Signal"
+msgstr "ΑφαίÏεση σήματος"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Editing Signal:"
+msgstr "ΕπεξεÏγασία σήματος:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change Expression"
+msgstr "Αλλαγή έκφÏασης"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Node"
+msgstr "ΠÏοσθήκη κόμβου"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature."
+msgstr ""
+"Πατήστε παÏατεταμένα το κουμπί Meta για να Ï€Ïοσθέσετε έναν Getter. Πατήστε "
+"παÏατεταμένα το Shift για να Ï€Ïοσθέσετε μία γενική υπογÏαφή."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature."
+msgstr ""
+"Πατήστε παÏατεταμένα το Ctrl για να Ï€Ïοσθέσετε έναν Getter. Πατήστε "
+"παÏατεταμένα το Shift για να Ï€Ïοσθέσετε μία γενική υπογÏαφή."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a simple reference to the node."
+msgstr ""
+"Πατήστε παÏατεταμένα το κουμπί Meta για να Ï€Ïοσθέσετε μία απλή αναφοÏά στον "
+"κόμβο."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a simple reference to the node."
+msgstr ""
+"Πατήστε παÏατεταμένα το Ctrl για να Ï€Ïοσθέσετε μία απλή αναφοÏά στον κόμβο."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a Variable Setter."
+msgstr ""
+"Πατήστε παÏατεταμένα το κουμπί Meta για να Ï€Ïοσθέσετε έναν Setter μεταβλητής."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a Variable Setter."
+msgstr "Πατήστε παÏατεταμένα το Ctrl για να Ï€Ïοσθέσετε έναν Setter μεταβλητής."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Preload Node"
+msgstr "ΠÏοσθέστε έναν κόμβο preload"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Node(s) From Tree"
+msgstr "ΠÏοσθέστε κόμβο/-ους από δέντÏο"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Getter Property"
+msgstr "ΠÏοσθέστε ιδιότητα Getter"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Setter Property"
+msgstr "ΠÏοσθέστε ιδιότητα Setter"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Condition"
+msgstr "Συνθήκη"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Sequence"
+msgstr "Ακολουθία"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Switch"
+msgstr "Μεταγωγέας"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Iterator"
+msgstr "Επαναλήπτης"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "While"
+msgstr "Όσο"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Return"
+msgstr "ΕπιστÏοφή"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Get"
+msgstr "ΠάÏε"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Base Type:"
+msgstr "ΤÏπος βάσης:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Available Nodes:"
+msgstr "Διαθέσιμοι κόμβοι:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Select or create a function to edit graph"
+msgstr "Επιλέξτε ή δημιουÏγήστε μία συνάÏτηση για να επεξεÏγαστείτε το γÏάφημα"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Signal Arguments:"
+msgstr "ΕπεξεÏγασία παÏαμέτÏων σήματος:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Variable:"
+msgstr "ΕπεξεÏγασία μεταβλητής:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change"
+msgstr "Αλλαγή"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Delete Selected"
+msgstr "ΔιαγÏαφή επιλεγμένου"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Find Node Type"
+msgstr "ΕÏÏεση είδους κόμβου"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Copy Nodes"
+msgstr "ΑντιγÏαφή κόμβων"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Cut Nodes"
+msgstr "Αποκοπή κόμβων"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Paste Nodes"
+msgstr "Επικόλληση κόμβων"
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Input type not iterable: "
+msgstr "Δεν μποÏεί να γίνει επανάληψη στον εισηγμένο Ï„Ïπο: "
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Iterator became invalid"
+msgstr "Ο επαναλήπτης έγινε άκυÏος"
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Iterator became invalid: "
+msgstr "Ο επαναλήπτης έγινε άκυÏος: "
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Invalid index property name."
+msgstr "ΆκυÏο όνομα ιδιότητας δείκτη."
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Base object is not a Node!"
+msgstr "Το βασικό αντικείμενο δεν είναι κόμβος!"
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Path does not lead Node!"
+msgstr "Η διαδÏομή δεν οδηγεί σε κόμβο!"
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Invalid index property name '%s' in node %s."
+msgstr "ΆκυÏο όνομα ιδιότητας δείκτη '%s' στον κόμβο %s."
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ": Invalid argument of type: "
+msgstr ": ΆκυÏη παÏάμετÏος Ï„Ïπου: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ": Invalid arguments: "
+msgstr ": ΆκυÏοι παÏάμετÏοι: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "VariableGet not found in script: "
+msgstr "Το VariableGet δεν βÏέθηκε στη δεσμή ενεÏγειών: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "VariableSet not found in script: "
+msgstr "Το VariableSet δεν βÏέθηκε στη δεσμή ενεÏγειών: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "Custom node has no _step() method, can't process graph."
+msgstr ""
+"Ο κόμβος δεν έχει τη μέθοδο _step(), αδÏνατη η επεξεÏγασία του γÏαφήματος."
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ""
+"Invalid return value from _step(), must be integer (seq out), or string "
+"(error)."
+msgstr ""
+"ΆκυÏος Ï„Ïπος επιστÏοφής από την _step(), Ï€Ïέπει να είναι ακέÏαιος (seq out) "
+"ή ακολουθία χαÏακτήÏων (error)."
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "just pressed"
+msgstr "μόλις πατήθηκε"
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "just released"
+msgstr "μόλις απελευθεÏώθηκε"
+
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr "Εκτέλεση στον πεÏιηγητή"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr "Εκτέλεση εξαγόμενης HTMP στον Ï€Ïοεπιλεγμένο πεÏιηγητή του συστήματος."
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr "Δεν ήταν δυνατό το γÏάψιμο στο αÏχείο:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr "Δεν ήταν δυνατή η ανάγνωση του αÏχείου:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr "Δεν ήταν δυνατό το άνοιγμα Ï€ÏοτÏπου για εξαγωγή:\n"
+
+#: platform/uwp/export/export.cpp
+msgid ""
+"Couldn't read the certificate file. Are the path and password both correct?"
+msgstr ""
+"Δεν ήταν δυνατή η ανάγνωση του αÏχείου πιστοποιητικών. Είναι η διαδÏομή και "
+"ο κωδικός σωστοί;"
+
+#: platform/uwp/export/export.cpp
+msgid "Error creating the signature object."
+msgstr "Σφάλμα κατά τη δημιουÏγία της υπογÏαφής του αντικειμένου."
+
+#: platform/uwp/export/export.cpp
+msgid "Error creating the package signature."
+msgstr "Σφάλμα κατά τη δημιουÏγία της υπογÏαφής του πακέτου."
+
+#: platform/uwp/export/export.cpp
+msgid ""
+"No export templates found.\n"
+"Download and install export templates."
+msgstr ""
+"Δεν βÏέθηκαν Ï€Ïότυπα εξαγωγής.\n"
+"Κατεβάστε και εγκαταστήστε τα Ï€Ïότυπα εξαγωγής."
+
+#: platform/uwp/export/export.cpp
+msgid "Custom debug package not found."
+msgstr "Το Ï€ÏοσαÏμοσμένο πακέτο αποσφαλμάτωσης δεν βÏέθηκε."
+
+#: platform/uwp/export/export.cpp
+msgid "Custom release package not found."
+msgstr "Το Ï€ÏοσαÏμοσμένο πακέτο παÏαγωγής δεν βÏέθηκε."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid unique name."
+msgstr "ΆκυÏο μοναδικό όνομα."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid product GUID."
+msgstr "ΆκυÏο GUID Ï€Ïοϊόντος."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid publisher GUID."
+msgstr "ΆκυÏο GUID εκδότη."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid background color."
+msgstr "ΆκυÏο χÏώμα παÏασκηνίου."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid Store Logo image dimensions (should be 50x50)."
+msgstr "ΆκυÏη εικόνα λογότυπου καταστήματος (Ï€Ïέπει να είναι 50x50)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 44x44 logo image dimensions (should be 44x44)."
+msgstr "ΆκυÏη εικόνα τετÏάγωνου λογότυπου 44x44 (Ï€Ïέπει να είναι 44x44)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 71x71 logo image dimensions (should be 71x71)."
+msgstr "ΆκυÏη εικόνα τετÏάγωνου λογότυπου 71x71 (Ï€Ïέπει να είναι 71x71)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 150x150 logo image dimensions (should be 150x150)."
+msgstr "ΆκυÏη εικόνα τετÏάγωνου λογότυπου 150x150 (Ï€Ïέπει να είναι 150x150)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 310x310 logo image dimensions (should be 310x310)."
+msgstr "ΆκυÏη εικόνα τετÏάγωνου λογότυπου 310x310 (Ï€Ïέπει να είναι 310x310)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)."
+msgstr "ΆκυÏη εικόνα ευÏÏ Î»Î¿Î³ÏŒÏ„Ï…Ï€Î¿Ï… 310x150 (Ï€Ïέπει να είναι 310x150)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid splash screen image dimensions (should be 620x300)."
+msgstr "ΆκυÏες διαστάσεις εικόνας οθόνης εκκίνησης (Ï€Ïέπει να είναι 620x300)."
+
+#: scene/2d/animated_sprite.cpp
+msgid ""
+"A SpriteFrames resource must be created or set in the 'Frames' property in "
+"order for AnimatedSprite to display frames."
+msgstr ""
+"Ένας πόÏος SpriteFrames Ï€Ïέπει να έχει δημιουÏγηθεί ή οÏισθεί στην ιδιότητα "
+"'Frames' για να μποÏεί το AnimatedSprite να παÏουσιάσει frames."
+
+#: scene/2d/canvas_modulate.cpp
+msgid ""
+"Only one visible CanvasModulate is allowed per scene (or set of instanced "
+"scenes). The first created one will work, while the rest will be ignored."
+msgstr ""
+"Μόνο ένα οÏατό CanvasModulate επιτÏέπεται σε κάθε σκηνή (ή σÏνολο "
+"στιγμιότυπων σκηνών). Το Ï€Ïώτο που δημιουÏγήθηκε θα δουλέψει, ενώ τα άλλα θα "
+"αγνοηθοÏν."
+
+#: scene/2d/collision_polygon_2d.cpp
+msgid ""
+"CollisionPolygon2D only serves to provide a collision shape to a "
+"CollisionObject2D derived node. Please only use it as a child of Area2D, "
+"StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."
+msgstr ""
+"To CollisionPolygon2D υπάÏχει μόνο για να δώσει ένα σχήμα σÏγκÏουσης σε έναν "
+"κόμβο που Ï€ÏοέÏχεται από το CollisionObject2D. ΧÏησιμοποιήστε το μόνο εάν "
+"κληÏονομεί τα Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, κλπ, για "
+"να τους δώσετε ένα σχήμα."
+
+#: scene/2d/collision_polygon_2d.cpp
+msgid "An empty CollisionPolygon2D has no effect on collision."
+msgstr "Ένα άδειο ColisionPollygon2D δεν επηÏεάζει τη σÏγκÏουση."
+
+#: scene/2d/collision_shape_2d.cpp
+msgid ""
+"CollisionShape2D only serves to provide a collision shape to a "
+"CollisionObject2D derived node. Please only use it as a child of Area2D, "
+"StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."
+msgstr ""
+"To CollisionShape2D υπάÏχει μόνο για να δώσει ένα σχήμα σÏγκÏουσης σε έναν "
+"κόμβο που Ï€ÏοέÏχεται από το CollisionObject2D. ΧÏησιμοποιήστε το μόνο εάν "
+"κληÏονομεί τα Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, κλπ, για "
+"να τους δώσετε ένα σχήμα."
+
+#: scene/2d/collision_shape_2d.cpp
+msgid ""
+"A shape must be provided for CollisionShape2D to function. Please create a "
+"shape resource for it!"
+msgstr ""
+"Ένα σχήμα Ï€Ïέπει να δοθεί στο CollisionShape2D για να λειτουÏγήσει. "
+"ΔημιουÏγήστε ένα πόÏο σχήματος για αυτό!"
+
+#: scene/2d/light_2d.cpp
+msgid ""
+"A texture with the shape of the light must be supplied to the 'texture' "
+"property."
+msgstr "Μία υφή με το σχήμα του φωτός Ï€Ïέπει να δοθεί στην ιδιότητα 'texture'."
+
+#: scene/2d/light_occluder_2d.cpp
+msgid ""
+"An occluder polygon must be set (or drawn) for this occluder to take effect."
+msgstr ""
+"Ένα πολÏγωνο εμποδίου Ï€Ïέπει να οÏιστεί (ή ζωγÏαφιστεί) για να λειτουÏγήσει "
+"αυτό το εμπόδιο."
+
+#: scene/2d/light_occluder_2d.cpp
+msgid "The occluder polygon for this occluder is empty. Please draw a polygon!"
+msgstr ""
+"Το πολÏγωνο εμποδίου για αυτό το εμπόδιο είναι άδειο. ΖωγÏαφίστε ένα "
+"πολÏγονο!"
+
+#: scene/2d/navigation_polygon.cpp
+msgid ""
+"A NavigationPolygon resource must be set or created for this node to work. "
+"Please set a property or draw a polygon."
+msgstr ""
+"Ένας πόÏος NavigationPolygon Ï€Ïέπει να οÏισθεί ή δημιουÏγηθεί για να "
+"λειτουÏγήσει αυτός ο κόμβος. ΟÏίστε μία ιδιότητα ή ζωγÏαφίστε ένα πολÏγωνο."
+
+#: scene/2d/navigation_polygon.cpp
+msgid ""
+"NavigationPolygonInstance must be a child or grandchild to a Navigation2D "
+"node. It only provides navigation data."
+msgstr ""
+"Το NavigationPolygonInstance Ï€Ïέπει να κληÏονομεί έναν κόμβο Ï„Ïπου "
+"Navigation2D, διότι διαθέτει μόνο δεδομένα πλοήγησης."
+
+#: scene/2d/parallax_layer.cpp
+msgid ""
+"ParallaxLayer node only works when set as child of a ParallaxBackground node."
+msgstr ""
+"Ένας κόμβος ParallaxLayer δουλεÏει μόνο όταν κληÏονομεί έναν κόμβο Ï„Ïπου "
+"ParallaxBackground."
+
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
+
+#: scene/2d/path_2d.cpp
+msgid "PathFollow2D only works when set as a child of a Path2D node."
+msgstr "Το PathFollow2D δουλεÏει μόνο όταν κληÏονομεί έναν κόμβο Path2D."
+
+#: scene/2d/remote_transform_2d.cpp
+msgid "Path property must point to a valid Node2D node to work."
+msgstr ""
+"Η ιδιότητα Path Ï€Ïέπει να δείχνει σε έναν έγκυÏο κόμβο Node2D για να "
+"δουλέψει."
+
+#: scene/2d/sprite.cpp
+msgid ""
+"Path property must point to a valid Viewport node to work. Such Viewport "
+"must be set to 'render target' mode."
+msgstr ""
+"Η ιδιότητα Path Ï€Ïέπει να δείχνει σε έναν έγκυÏο κόμβο Ï„Ïπου Viewport σε "
+"λειτουÏγία 'render target' για να δουλέψει."
+
+#: scene/2d/sprite.cpp
+msgid ""
+"The Viewport set in the path property must be set as 'render target' in "
+"order for this sprite to work."
+msgstr ""
+"Το Viewport που οÏίστηκε στην ιδιότητα 'path' Ï€Ïέπει να είναι σε λειτουÏγία "
+"'render target' για να δουλέψει αυτό to sprite."
+
+#: scene/2d/visibility_notifier_2d.cpp
+msgid ""
+"VisibilityEnable2D works best when used with the edited scene root directly "
+"as parent."
+msgstr ""
+"Το VisibilityEnable2D δουλεÏει καλÏτεÏα όταν χÏησιμοποιείται μα την Ïίζα της "
+"επεξεÏγασμένης σκηνές κατευθείαν ως γονέας."
+
+#: scene/3d/body_shape.cpp
+msgid ""
+"CollisionShape only serves to provide a collision shape to a CollisionObject "
+"derived node. Please only use it as a child of Area, StaticBody, RigidBody, "
+"KinematicBody, etc. to give them a shape."
+msgstr ""
+"To CollisionShape υπάÏχει μόνο για να δώσει ένα σχήμα σÏγκÏουσης σε έναν "
+"κόμβο που Ï€ÏοέÏχεται από το CollisionObject. ΧÏησιμοποιήστε το μόνο εάν "
+"κληÏονομεί τα Area, StaticBody, RigidBody, KinematicBody, κλπ, για να τους "
+"δώσετε ένα σχήμα."
+
+#: scene/3d/body_shape.cpp
+msgid ""
+"A shape must be provided for CollisionShape to function. Please create a "
+"shape resource for it!"
+msgstr ""
+"Ένα σχήμα Ï€Ïέπει να δοθεί στο CollisionShape για να λειτουÏγήσει. "
+"ΔημιουÏγήστε ένα πόÏο σχήματος για αυτό!"
+
+#: scene/3d/collision_polygon.cpp
+msgid ""
+"CollisionPolygon only serves to provide a collision shape to a "
+"CollisionObject derived node. Please only use it as a child of Area, "
+"StaticBody, RigidBody, KinematicBody, etc. to give them a shape."
+msgstr ""
+"To CollisionPolygon υπάÏχει μόνο για να δώσει ένα σχήμα σÏγκÏουσης σε έναν "
+"κόμβο που Ï€ÏοέÏχεται από το CollisionObject. ΧÏησιμοποιήστε το μόνο εάν "
+"κληÏονομεί τα Area, StaticBody, RigidBody, KinematicBody, κλπ, για να τους "
+"δώσετε ένα σχήμα."
+
+#: scene/3d/collision_polygon.cpp
+msgid "An empty CollisionPolygon has no effect on collision."
+msgstr "Ένα άδειο CollisionPolygon δεν επηÏεάζει την σÏγκÏουση."
+
+#: scene/3d/navigation_mesh.cpp
+msgid "A NavigationMesh resource must be set or created for this node to work."
+msgstr ""
+"Ένας πόÏος πλέγματος πλοήγησης θα Ï€Ïέπει να έχει οÏισθεί ή δημιουÏγηθεί για "
+"να δουλέψει αυτός ο κόμβος."
+
+#: scene/3d/navigation_mesh.cpp
+msgid ""
+"NavigationMeshInstance must be a child or grandchild to a Navigation node. "
+"It only provides navigation data."
+msgstr ""
+"Ένας κόμβος Ï„Ïπου στιγμιοτÏπου πλέγματος πλοήγησης Ï€Ïέπει να κληÏονομεί έναν "
+"κόμβο Ï„Ïπου πλοήγηση, διότι διαθέτει μόνο δεδομένα πλοήγησης."
+
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
+#: scene/3d/remote_transform.cpp
+msgid "Path property must point to a valid Spatial node to work."
+msgstr ""
+"Η ιδιότητα Path Ï€Ïέπει να δείχνει σε έναν έγκυÏο κόμβο Spatial για να "
+"δουλέψει αυτός ο κόμβος."
+
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
+msgstr ""
+"Μόνο ένα WorldEnvironment επιτÏέπεται σε κάθε σκηνή (ή σÏνολο στιγμιοτÏπων "
+"σκηνών)."
+
+#: scene/3d/sprite_3d.cpp
+msgid ""
+"A SpriteFrames resource must be created or set in the 'Frames' property in "
+"order for AnimatedSprite3D to display frames."
+msgstr ""
+"Ένας πόÏος SpriteFrames Ï€Ïέπει να δημιουÏγηθεί ή οÏισθεί στην ιδιότητα "
+"'Frames' για να δείξει frames το AnimatedSprite3D."
+
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "ΛειτουÏγία εκτέλεσης:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
+#: scene/gui/dialogs.cpp
+msgid "Alert!"
+msgstr "Ειδοποίηση!"
+
+#: scene/gui/dialogs.cpp
+msgid "Please Confirm..."
+msgstr "ΠαÏακαλώ επιβεβαιώστε..."
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a File"
+msgstr "Άνοιγμα αÏχείου"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open File(s)"
+msgstr "Άνοιγμα αÏχείου/-ων"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a Directory"
+msgstr "Άνοιγμα λεξικοÏ"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a File or Directory"
+msgstr "Άνοιγμα αÏχείου ή λεξικοÏ"
+
+#: scene/gui/input_action.cpp
+msgid "Ctrl+"
+msgstr "Ctrl+"
+
+#: scene/gui/popup.cpp
+msgid ""
+"Popups will hide by default unless you call popup() or any of the popup*() "
+"functions. Making them visible for editing is fine though, but they will "
+"hide upon running."
+msgstr ""
+"Οι κόμβοι Ï„Ïπου Popup θα είναι κÏυμμένοι από Ï€Ïοεπιλογή, εκτός κι αν "
+"καλέσετε την popup() ή καμία από τις συναÏτήσεις popup*(). Το να τους κάνετε "
+"οÏατοÏÏ‚ κατά την επεξεÏγασία, όμως, δεν είναι Ï€Ïόβλημα."
+
+#: scene/gui/scroll_container.cpp
+msgid ""
+"ScrollContainer is intended to work with a single child control.\n"
+"Use a container as child (VBox,HBox,etc), or a Control and set the custom "
+"minimum size manually."
+msgstr ""
+"Το ScrollContainer είναι φτιαγμένο για να δουλεÏει με ένα μόνο υπο-στοιχείο "
+"control.\n"
+"ΧÏησιμοποιήστε ένα container ως παιδί (VBox, HBox, κτλ), ή ένα Control και "
+"οÏίστε το Ï€ÏοσαÏμοσμένο ελάχιστο μέγεθος χειÏοκίνητα."
+
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
+#: scene/main/viewport.cpp
+msgid ""
+"This viewport is not set as render target. If you intend for it to display "
+"its contents directly to the screen, make it a child of a Control so it can "
+"obtain a size. Otherwise, make it a RenderTarget and assign its internal "
+"texture to some node for display."
+msgstr ""
+"Το Viewport δεν έχει οÏισθεί ως \"render target'. Αν σκοπεÏετε να δείχνει τα "
+"πεÏιεχόμενα του, κάντε το να κληÏονομεί ένα Control, ώστε να αποκτήσει "
+"μέγεθος. Αλλιώς, κάντε το ένα RenderTarget και οÏίστε το internal texture σε "
+"έναν κόμβο για απεικόνιση."
+
+#~ msgid "Node From Scene"
+#~ msgstr "Κόμβος από σκηνή"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Εισαγωγή πόÏων στο έÏγο."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Εξαγωγή έÏγου σε πολλές πλατφόÏμες."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "Ειδοποίηση όταν ένας εξωτεÏικός πόÏος έχει αλλάξει."
+
+#~ msgid "Tutorials"
+#~ msgstr "Βοηθήματα"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr ""
+#~ "Άνοιγμα της ιστοσελίδας https://godotengine.org στην πεÏιοχή tutorials."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "Δεν έχει επιλεγεί σκηνή για τη δημιουÏγία στιγμιοτÏπου!"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "Στιγμιότυπο στον δÏομέα"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "Δεν ήταν δυνατή η δημιουÏγία στιγμιοτÏπου της σκηνής!"
+
+#~ msgid "Use Default Light"
+#~ msgstr "ΧÏήση Ï€Ïοεπιλεγμέου φωτός"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "ΧÏήση Ï€Ïοεπιλεγμένου sRGB"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "ΠÏοεπιλεγμένο διάνυσμα κανονικής ανάκλασης φωτός:"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "ΧÏώμα φωτός πεÏιβάλλοντος:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "Δεν ήταν δυνατή η φόÏτωση εικόνας"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "Μη έγκυÏο όνομα γονικής κλάσης"
+
+#~ msgid "Valid chars:"
+#~ msgstr "ΈγκυÏοι χαÏακτήÏες:"
+
+#~ msgid "Valid name"
+#~ msgstr "ΈγκυÏο όνομα"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "Το όνομα της κλάσης δεν είναι έγκυÏο!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "Το όνομα της γονικής κλάσης δεν είναι έγκυÏο!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "Μη έγκυÏη διαδÏομή!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Η ιδιότητα Path Ï€Ïέπει να δείχνει σε έναν έγκυÏο κόμβο Particles2D για να "
+#~ "δουλέψει."
+
+#~ msgid ""
+#~ "A SampleLibrary resource must be created or set in the 'samples' property "
+#~ "in order for SamplePlayer to play sound."
+#~ msgstr ""
+#~ "Ένας πόÏος SampleLibrary Ï€Ïέπει να έχει δημιουÏγηθεί ή οÏισθεί στην "
+#~ "ιδιότητα 'samples' για να παίξει ήχο το SamplePlayer."
+
+#~ msgid ""
+#~ "A SampleLibrary resource must be created or set in the 'samples' property "
+#~ "in order for SpatialSamplePlayer to play sound."
+#~ msgstr ""
+#~ "Ένας πόÏος SampleLibrary Ï€Ïέπει να δημιουÏγηθεί ή οÏισθεί στην ιδιότητα "
+#~ "'samples' για να παίξει ήχο το SpatialSamplePlayer."
+
+#~ msgid "Replaced %d Ocurrence(s)."
+#~ msgstr "Αντικαταστάθηκαν %d εμφανίσεις."
+
+#~ msgid "Please save the scene first."
+#~ msgstr "ΠαÏακαλοÏμε αποθηκεÏστε την σκηνή Ï€Ïώτα."
+
+#~ msgid "Save Translatable Strings"
+#~ msgstr "Αποθήκευση μεταφÏάσιμων συμβολοσειÏών"
+
+#~ msgid "Translatable Strings.."
+#~ msgstr "ΜεταφÏάσιμες συμβολοσειÏές..."
+
+#~ msgid "Install Export Templates"
+#~ msgstr "Εγκατάσταση Ï€ÏοτÏπων εξαγωγής"
diff --git a/editor/translations/es.po b/editor/translations/es.po
index ac7371e47c..053bbc1085 100644
--- a/editor/translations/es.po
+++ b/editor/translations/es.po
@@ -2,19 +2,19 @@
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
+# Alejandro Alvarez <eliluminado00@gmail.com>, 2017.
# Carlos López <genetita@gmail.com>, 2016.
-# Ismael Ferreras Morezuelas <swyterzone+mame@gmail.com>, 2016.
-# Lisandro Lorea <lisandrolorea@gmail.com>, 2016.
+# Lisandro Lorea <lisandrolorea@gmail.com>, 2016-2017.
# Roger BR <drai_kin@hotmail.com>, 2016.
# Sebastian Silva <sebastian@fuentelibre.org>, 2016.
-# Swyter <swyterzone@gmail.com>, 2016.
+# Swyter <swyterzone@gmail.com>, 2016-2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2016-11-22 16:41+0000\n"
-"Last-Translator: Swyter <swyterzone@gmail.com>\n"
+"PO-Revision-Date: 2017-01-16 16:20+0000\n"
+"Last-Translator: Lisandro Lorea <lisandrolorea@gmail.com>\n"
"Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/"
"godot/es/>\n"
"Language: es\n"
@@ -22,7 +22,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.10-dev\n"
+"X-Generator: Weblate 2.11-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -366,6 +366,184 @@ msgstr "Cambiar tipo de valor del «array»"
msgid "Change Array Value"
msgstr "Cambiar valor del «array»"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "Versión:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Constantes:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Archivo"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Descripción:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "Instalar"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Cerrar"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Conectar.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Conectar a nodo:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Formato de archivo desconocido:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Guardando…"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Conectar.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Prueba"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "¡Hubo un error al guardar el recurso!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Abajo"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Todos"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -373,6 +551,30 @@ msgstr "Cambiar valor del «array»"
msgid "Search:"
msgstr "Buscar:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Buscar"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "Importar"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "Plugins"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Ordenar:"
@@ -386,22 +588,18 @@ msgid "Category:"
msgstr "Categoría:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Todos"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Sitio:"
#: editor/asset_library_editor_plugin.cpp
msgid "Support.."
-msgstr "Ayuda…"
+msgstr "Soporte.."
#: editor/asset_library_editor_plugin.cpp
msgid "Official"
msgstr "Oficial"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Comunidad"
@@ -421,20 +619,6 @@ msgstr "Lista de métodos Para '%s':"
msgid "Call"
msgstr "Llamada"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Cerrar"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Lista de métodos:"
@@ -485,13 +669,6 @@ msgid "Selection Only"
msgstr "Sólo selección"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Buscar"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Búsqueda"
@@ -569,6 +746,7 @@ msgstr "Añadir"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Quitar"
@@ -615,7 +793,7 @@ msgstr "Crear suscripción"
#: editor/connections_dialog.cpp
msgid "Connect.."
-msgstr "Conectar…"
+msgstr "Conectar.."
#: editor/connections_dialog.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
@@ -645,11 +823,6 @@ msgstr "Recientes:"
msgid "Matches:"
msgstr "Coincidencias:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "Descripción:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Buscar reemplazo para:"
@@ -684,6 +857,7 @@ msgstr "Recursos"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Ruta"
@@ -790,8 +964,7 @@ msgstr ""
msgid "Add Bus"
msgstr "Añadir todos"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "Cargar"
@@ -801,6 +974,7 @@ msgid "Save As"
msgstr "Guardar como"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Predeterminado"
@@ -875,8 +1049,7 @@ msgid "Rearrange Autoloads"
msgstr "Reordenar «Autoloads»"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Ruta:"
@@ -904,11 +1077,11 @@ msgstr "Actualizando escena"
#: editor/editor_data.cpp
msgid "Storing local changes.."
-msgstr "Guardando cambios locales…"
+msgstr "Guardando cambios locales.."
#: editor/editor_data.cpp
msgid "Updating scene.."
-msgstr "Actualizando escena…"
+msgstr "Actualizando escena.."
#: editor/editor_dir_dialog.cpp
msgid "Choose a Directory"
@@ -942,7 +1115,7 @@ msgstr "Almacén de archivo:"
msgid "Packing"
msgstr "Empaquetando"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1068,7 +1241,8 @@ msgstr "AnalizandoFuentes"
msgid "(Re)Importing Assets"
msgstr "Reimportando"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "Ayuda de búsqueda"
@@ -1085,7 +1259,6 @@ msgid "Class:"
msgstr "Clase:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "Hereda:"
@@ -1141,10 +1314,6 @@ msgstr " Salida:"
msgid "Clear"
msgstr "Borrar todo"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Nodo desde escena"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1260,10 +1429,11 @@ msgid "There is no defined scene to run."
msgstr "No hay escena definida para ejecutar."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"No se ha definido ninguna escena principal, ¿quieres elegir alguna?\n"
"Es posible cambiarla más tarde en «Ajustes del proyecto» bajo la categoría "
@@ -1328,6 +1498,11 @@ msgid "Save Scene As.."
msgstr "Guardar escena como…"
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Nodo"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
"Esta escena nunca se ha guardado. ¿Quieres guardarla antes de ejecutarla?"
@@ -1387,7 +1562,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "Vaya"
@@ -1428,6 +1603,10 @@ msgstr "%d archivos más"
msgid "%d more file(s) or folder(s)"
msgstr "%d archivos o carpetas más"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "Modo sin distracciones"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Escena"
@@ -1481,7 +1660,7 @@ msgstr "Cerrar escena"
msgid "Close Goto Prev. Scene"
msgstr "Cerrar e ir a escena anterior"
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "Abrir reciente"
@@ -1509,99 +1688,41 @@ msgid "Redo"
msgstr "Rehacer"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "Ejecutar script"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Ajustes del proyecto"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "Revertir escena"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Salir al listado del proyecto"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Modo sin distracciones"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "Importar elementos al proyecto."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "Importar"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "Herramientas varias o de escenas."
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "Herramientas"
+#, fuzzy
+msgid "Project"
+msgstr "Proyecto nuevo"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "Ajustes del proyecto"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "Exportar el proyecto a varias plataformas."
+msgid "Run Script"
+msgstr "Ejecutar script"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "Exportar"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "Inicia el proyecto para poder jugarlo."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "Reproducir"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "Pausar la escena"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "Pausar la escena"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "Detener la escena."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "Detener"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "Reproducir la escena editada."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "Reproducir escena"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "Reproducir escena personalizada"
+msgid "Tools"
+msgstr "Herramientas"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "Reproducir escena personalizada"
+msgid "Quit to Project List"
+msgstr "Salir al listado del proyecto"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "Opciones de depuración"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "Depurar"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1690,9 +1811,10 @@ msgstr ""
"Cuando se use remotamente en un dispositivo, esto es mas eficiente con un "
"sistema de archivos de red."
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "Ajustes"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Editar"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1713,12 +1835,69 @@ msgid "Manage Export Templates"
msgstr "Cargando plantillas de exportación"
#: editor/editor_node.cpp
+msgid "Help"
+msgstr "Ayuda"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "Clases"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "Cerrar documentación"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr "Acerca de"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "Alerta cuando un recurso externo haya cambiado."
+msgid "Play the project."
+msgstr "Inicia el proyecto para poder jugarlo."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "Reproducir"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "Pausar la escena"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "Pausar la escena"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Detener la escena."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "Detener"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "Reproducir la escena editada."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Reproducir escena"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Reproducir escena personalizada"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "Reproducir escena personalizada"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1802,6 +1981,14 @@ msgid "Thanks!"
msgstr "¡Gracias!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "Importar plantillas desde un archivo ZIP"
@@ -1829,15 +2016,41 @@ msgstr "Abrir y ejecutar un script"
msgid "Load Errors"
msgstr "Errores de carga"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Abrir en el editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Abrir en el editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Abrir en el editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "Exportar biblioteca"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Abrir en el editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "Abrir en el editor"
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "Plugins instalados:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "Versión:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "Autor:"
@@ -2094,6 +2307,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "Mostrar en el navegador de archivos"
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr "Instanciar"
@@ -2122,10 +2339,6 @@ msgid "Info"
msgstr "Info"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "Mostrar en el navegador de archivos"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Reimportando…"
@@ -2294,9 +2507,10 @@ msgid "No target font resource!"
msgstr "¡No se ha elegido ningún recurso de tipografías!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"La extensión del archivo no es correcta.\n"
"Prueba con la extensión .fnt."
@@ -2780,8 +2994,9 @@ msgid "Compress"
msgstr "Comprimir"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr "Añadir al proyecto (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "Añadir al proyecto (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -3453,7 +3668,7 @@ msgid "Change default type"
msgstr "Cambiar Valor por Defecto"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "Aceptar"
@@ -3505,16 +3720,6 @@ msgstr "Crear Poly3D"
msgid "Set Handle"
msgstr "Establecer handle"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#, fuzzy
-msgid "Add/Remove Color Ramp Point"
-msgstr "Añadir/quitar punto de rampa de color"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr "Modificar rampa de color"
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr "Crear biblioteca de modelos 3D"
@@ -3545,6 +3750,36 @@ msgstr "Importar desde escena"
msgid "Update from Scene"
msgstr "Actualizar desde escena"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Añadir entrada"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Quitar Punto de ruta"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "Cargar recurso"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Modify Curve"
+msgstr "Modificar Mapa de Curvas"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#, fuzzy
+msgid "Add/Remove Color Ramp Point"
+msgstr "Añadir/quitar punto de rampa de color"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "Modificar rampa de color"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "Elemento %d"
@@ -3823,6 +4058,20 @@ msgid "Remove Poly And Point"
msgstr "Quitar polígono y punto"
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "Borrar máscara de emisión"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "Generar AABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "Error al cargar la imagen:"
@@ -3836,8 +4085,8 @@ msgid "Set Emission Mask"
msgstr "Establecer máscara de emisión"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
-msgstr "Borrar máscara de emisión"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -3847,6 +4096,27 @@ msgstr "Cargar máscara de emisión"
msgid "Generated Point Count:"
msgstr "Conteo de puntos generados:"
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Tiempo promedio (seg)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "Establecer máscara de emisión"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "Crear desde escena"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Posiciones de emisión:"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr "El nodo no contiene geometría."
@@ -3856,6 +4126,10 @@ msgid "Node does not contain geometry (faces)."
msgstr "El nodo no contiene geometría (caras)."
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "¡Las caras no contienen área!"
@@ -3868,11 +4142,13 @@ msgid "Generate AABB"
msgstr "Generar AABB"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+#, fuzzy
+msgid "Create Emission Points From Mesh"
msgstr "Crear emisor a partir de modelo"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+#, fuzzy
+msgid "Create Emission Points From Node"
msgstr "Crear emisor a partir de nodo"
#: editor/plugins/particles_editor_plugin.cpp
@@ -3884,26 +4160,48 @@ msgid "Create Emitter"
msgstr "Crear emisor"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+#, fuzzy
+msgid "Emission Points:"
msgstr "Posiciones de emisión:"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr "Relleno de emisión:"
+#, fuzzy
+msgid "Surface Points"
+msgstr "Superficie %d"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "Superficie"
+msgid "Surface Points+Normal (Directed)"
+msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "Volumen"
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Source: "
+msgstr "Relleno de emisión:"
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "Generar AABB"
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr "Borrar punto de curva"
#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "Mover Out-Control en Curva"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "Borrar punto de curva"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
#, fuzzy
msgid "Add Point to Curve"
@@ -3959,6 +4257,16 @@ msgstr "Dividir ruta"
msgid "Remove Path Point"
msgstr "Quitar Punto de ruta"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Mover Out-Control en Curva"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "Mover In-Control en Curva"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "Crear mapa UV"
@@ -4112,6 +4420,11 @@ msgid "Pitch"
msgstr "Altura"
#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "Reestablecer huesos"
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr "Error al guardar el tema"
@@ -4200,10 +4513,6 @@ msgstr "Buscar…"
msgid "Find Next"
msgstr "Buscar siguiente"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "Depurar"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr "Step Over"
@@ -4237,16 +4546,9 @@ msgid "Move Right"
msgstr "Mover a la derecha"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "Tutoriales"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "Abre https://godotengine.org en la sección de tutoriales."
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "Clases"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "Buscar en la documentación de referencia."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
@@ -4306,6 +4608,23 @@ msgid "Pick Color"
msgstr "Color"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "Convirtiendo imágenes"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4356,6 +4675,14 @@ msgid "Trim Trailing Whitespace"
msgstr "Borrar espacios sobrantes al final"
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr "Autoindentar"
@@ -4377,6 +4704,16 @@ msgid "Goto Previous Breakpoint"
msgstr "Ir al «breakpoint» anterior"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "Convertir a…"
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Convertir a…"
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "Buscar anterior"
@@ -4399,6 +4736,10 @@ msgstr "Ir a línea…"
msgid "Contextual Help"
msgstr "Ayuda contextual"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr "Cambiar Constante Escalar"
@@ -4618,36 +4959,106 @@ msgid "Animation Key Inserted."
msgstr "Clave de animación insertada."
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Avanzar"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "Hacia atrás"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Rueda hacia abajo."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Actualizar cambios"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Actualizar cambios"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "Actualizar cambios"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "Vértice"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr "Alinear con vista"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
-msgstr "Entorno"
+msgid "Display Normal"
+msgstr "Mostrar normales"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
-msgstr "Oyente de Audio"
+msgid "Display Wireframe"
+msgstr "Mostrar polígonos"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
-msgstr "Gizmos"
+msgid "Display Overdraw"
+msgstr "Mostrar superposiciones"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
-msgstr "Ventana de transformación"
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Mostrar sin sombras"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Environment"
+msgstr "Entorno"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "¡No se ha elegido ninguna escena a instanciar!"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Gizmos"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Instanciar en cursor"
+msgid "View Information"
+msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "¡No se pudo instanciar la escena!"
+msgid "Audio Listener"
+msgstr "Oyente de Audio"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "Ventana de transformación"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4707,6 +5118,26 @@ msgid "Align Selection With View"
msgstr "Alinear selección con visor"
#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "Seleccionar"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "Mover"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: Rotar"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "Escala:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
msgstr "Transformar"
@@ -4719,14 +5150,6 @@ msgid "Transform Dialog.."
msgstr "Ventana de transformación…"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr "Usar iluminación predeterminada"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "Usar sRGB predeterminado"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
msgstr "1 visor"
@@ -4751,22 +5174,6 @@ msgid "4 Viewports"
msgstr "4 visores"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr "Mostrar normales"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr "Mostrar polígonos"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr "Mostrar superposiciones"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr "Mostrar sin sombras"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr "Ver origen"
@@ -4775,6 +5182,10 @@ msgid "View Grid"
msgstr "Ver rejilla"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Ajustes"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "Ajustes de fijado"
@@ -4795,14 +5206,6 @@ msgid "Viewport Settings"
msgstr "Ajustes del visor"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr "Iluminación por normales predeterminada:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr "Color de iluminación ambiental:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr "Anchura de perspectiva (en grados):"
@@ -5233,12 +5636,14 @@ msgid "Invalid project path, the path must exist!"
msgstr "¡La ruta del proyecto no es correcta, tiene que existir!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "La ruta del proyecto no es correcta, godot.cfg no debe existir."
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "La ruta del proyecto no es correcta, engine.cfg no debe existir."
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr "¡La ruta del proyecto no es correcta, godot.cfg debe existir."
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "¡La ruta del proyecto no es correcta, engine.cfg debe existir."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5249,8 +5654,9 @@ msgid "Invalid project path (changed anything?)."
msgstr "La ruta del proyecto no es correcta (¿has cambiado algo?)."
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
-msgstr "No se pudo crear godot.cfg en la ruta de proyecto."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "No se pudo crear engine.cfg en la ruta de proyecto."
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
@@ -5285,10 +5691,6 @@ msgid "Install Project:"
msgstr "Instalar proyecto:"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "Instalar"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "Examinar"
@@ -5351,6 +5753,11 @@ msgid "New Project"
msgstr "Proyecto nuevo"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Remover Item"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "Salir"
@@ -5471,6 +5878,11 @@ msgstr "Añadir acción de entrada"
msgid "Erase Input Action Event"
msgstr "Borrar evento de acción de entrada"
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "Añadir elemento vacío"
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Dispositivo"
@@ -5536,8 +5948,9 @@ msgid "Remove Resource Remap Option"
msgstr "Quitar opción de remapeo de recursos"
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr "Ajustes de proyecto (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Ajustes de proyecto (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5603,10 +6016,6 @@ msgstr "Idioma"
msgid "AutoLoad"
msgstr "AutoLoad"
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "Plugins"
-
#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Viewport"
@@ -5659,10 +6068,6 @@ msgid "Error loading file: Not a resource!"
msgstr "Error al cargar el archivo: ¡No es un recurso!"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "No se pudo cargar la imagen"
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "Selecciona un nodo"
@@ -5855,6 +6260,11 @@ msgid "Error duplicating scene to save it."
msgstr "Error al duplicar escena para guardarla."
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Recursos:"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "Editar grupos"
@@ -5936,10 +6346,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "Act/Desact. CanvasItem Visible"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Opciones de depuración"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "Instancia:"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Script siguiente"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Act/Desact. Espacial Visible"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
"El nombre del nodo no es correcto, las siguientes letras no están permitidas:"
@@ -5985,78 +6444,94 @@ msgid "Select a Node"
msgstr "Selecciona un nodo"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "El nombre de clase padre no es correcto"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "No se puede crear el script en el sistema de archivos."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "Letras permitidas:"
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "Error al cargar escena desde %s"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "El nombre de clase no es correcto"
+msgid "Path is empty"
+msgstr "La ruta está vacia"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "Nombre válido"
+msgid "Path is not local"
+msgstr "La ruta no es local"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "N/D"
+msgid "Invalid base path"
+msgstr "Ruta base incorrecta"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "¡El nombre de clase no es correcto!"
+msgid "Invalid extension"
+msgstr "La extensión no es correcta"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "¡El nombre de clase padre no es correcto!"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "¡Ruta incorrecta!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Ruta incorrecta."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "No se puede crear el script en el sistema de archivos."
+msgid "Invalid class name"
+msgstr "El nombre de clase no es correcto"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Error loading script from %s"
-msgstr "Error al cargar escena desde %s"
+msgid "Invalid inherited parent name or path"
+msgstr "El nombre de la propiedad índice no es correcto."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "La ruta está vacia"
+#, fuzzy
+msgid "Script valid"
+msgstr "Script"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "La ruta no es local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "Ruta base incorrecta"
+msgid "N/A"
+msgstr "N/D"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "La extensión no es correcta"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "Crear script"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr "Script siguiente"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "Hereda:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "Nombre de clase:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Remover Item"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "Script integrado"
#: editor/script_create_dialog.cpp
@@ -6229,6 +6704,10 @@ msgid "Change Notifier Extents"
msgstr "Cambiar Alcances de Notificadores"
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
#, fuzzy
msgid "Change Probe Extents"
msgstr "Cambiar Alcances de Notificadores"
@@ -6458,14 +6937,12 @@ msgid "While"
msgstr "Mientras"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Return"
-msgstr "Devuelve:"
+msgstr "Devuelve"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Get"
-msgstr "Establecer"
+msgstr "Obtener"
#: modules/visual_script/visual_script_editor.cpp
msgid "Base Type:"
@@ -6581,6 +7058,30 @@ msgstr "se presione"
msgid "just released"
msgstr "se levante"
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Run in Browser"
+msgstr "Examinar"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "No se pudo cargar el tile:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "No se pudo cargar el tile:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "No se pudo crear la carpeta."
+
#: platform/uwp/export/export.cpp
#, fuzzy
msgid ""
@@ -6768,10 +7269,11 @@ msgstr ""
"ParallaxLayer node solo funciona cuando esta seteado como hijo de un nodo "
"ParallaxBackground."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"La propiedad Path debe apuntar a un nodo Particles2D valido para funcionar."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6852,6 +7354,11 @@ msgstr ""
"NavigationMeshInstance debe ser un hijo o nieto de un nodo Navigation. Ya "
"que sólo proporciona los datos de navegación."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6873,9 +7380,18 @@ msgstr ""
"Un recurso SpriteFrames debe ser creado o asignado en la propiedad 'Frames' "
"para que AnimatedSprite3D pueda mostrar frames."
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "Modo de ejecución:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
-msgstr "Notificación"
+msgstr "Alerta!"
#: scene/gui/dialogs.cpp
msgid "Please Confirm..."
@@ -6918,6 +7434,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6930,6 +7452,74 @@ msgstr ""
"que pueda obtener un tamaño. Alternativamente, hacelo un RenderTarget y "
"asigná su textura interna a algún otro nodo para mostrar."
+#~ msgid "Node From Scene"
+#~ msgstr "Nodo desde escena"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Importar elementos al proyecto."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Exportar el proyecto a varias plataformas."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "Alerta cuando un recurso externo haya cambiado."
+
+#~ msgid "Tutorials"
+#~ msgstr "Tutoriales"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "Abre https://godotengine.org en la sección de tutoriales."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "¡No se ha elegido ninguna escena a instanciar!"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "Instanciar en cursor"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "¡No se pudo instanciar la escena!"
+
+#~ msgid "Use Default Light"
+#~ msgstr "Usar iluminación predeterminada"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "Usar sRGB predeterminado"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "Iluminación por normales predeterminada:"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "Color de iluminación ambiental:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "No se pudo cargar la imagen"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "El nombre de clase padre no es correcto"
+
+#~ msgid "Valid chars:"
+#~ msgstr "Letras permitidas:"
+
+#~ msgid "Valid name"
+#~ msgstr "Nombre válido"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "¡El nombre de clase no es correcto!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "¡El nombre de clase padre no es correcto!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "¡Ruta incorrecta!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "La propiedad Path debe apuntar a un nodo Particles2D valido para "
+#~ "funcionar."
+
+#~ msgid "Surface"
+#~ msgstr "Superficie"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
@@ -6983,14 +7573,26 @@ msgstr ""
#~ msgid "Full name"
#~ msgstr "Nombre válido"
+#~ msgid "Organizational unit"
+#~ msgstr "Unidad organizativa"
+
#, fuzzy
#~ msgid "Organization"
#~ msgstr "Transición"
+#~ msgid "City"
+#~ msgstr "Ciudad"
+
#, fuzzy
#~ msgid "State"
#~ msgstr "Estado:"
+#~ msgid "2 letter country code"
+#~ msgstr "Código de país de dos letras"
+
+#~ msgid "User alias"
+#~ msgstr "Mote"
+
#, fuzzy
#~ msgid "Password"
#~ msgstr "Contraseña:"
@@ -7003,6 +7605,19 @@ msgstr ""
#~ msgid "File name"
#~ msgstr "Nuevo nombre:"
+#~ msgid "Path : (better to save outside of project)"
+#~ msgstr "Ruta (es mejor guardar fuera del proyecto)"
+
+#~ msgid ""
+#~ "Release keystore is not set.\n"
+#~ "Do you want to create one?"
+#~ msgstr ""
+#~ "No hay ningún almacén de claves con el que publicar.\n"
+#~ "¿Quieres crear uno?"
+
+#~ msgid "Fill Keystore/Release User and Release Password"
+#~ msgstr "Escribe la contraseña del usuario del almacén de claves"
+
#~ msgid "Include"
#~ msgstr "Incluir"
@@ -7129,9 +7744,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "Silencio sobrante al final:"
-#~ msgid "Script"
-#~ msgstr "Script"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Modo de exportación de scipts:"
@@ -7165,9 +7777,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance no contiene un recurso BakedLight."
-#~ msgid "Vertex"
-#~ msgstr "Vértice"
-
#~ msgid "Fragment"
#~ msgstr "Fragmento"
@@ -7203,9 +7812,6 @@ msgstr ""
#~ msgid "Cannot go into subdir:"
#~ msgstr "No se puede acceder al subdir:"
-#~ msgid "Help"
-#~ msgstr "Ayuda"
-
#~ msgid "Imported Resources"
#~ msgstr "Importar Recursos"
diff --git a/editor/translations/es_AR.po b/editor/translations/es_AR.po
index d813943460..3457d72d9a 100644
--- a/editor/translations/es_AR.po
+++ b/editor/translations/es_AR.po
@@ -2,7 +2,7 @@
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
-# Lisandro Lorea <lisandrolorea@gmail.com>, 2016.
+# Lisandro Lorea <lisandrolorea@gmail.com>, 2016-2017.
# Roger BR <drai_kin@hotmail.com>, 2016.
# Sebastian Silva <sebastian@sugarlabs.org>, 2016.
#
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2016-12-04 06:03+0000\n"
+"PO-Revision-Date: 2017-04-17 00:30+0000\n"
"Last-Translator: Lisandro Lorea <lisandrolorea@gmail.com>\n"
"Language-Team: Spanish (Argentina) <https://hosted.weblate.org/projects/"
"godot-engine/godot/es_AR/>\n"
@@ -19,7 +19,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.10-dev\n"
+"X-Generator: Weblate 2.14-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -86,9 +86,8 @@ msgid "Anim Track Change Value Mode"
msgstr "Cambiar Modo de Valor de Track de Anim"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Track Change Wrap Mode"
-msgstr "Cambiar Modo de Valor de Track de Anim"
+msgstr "Cambiar Modo de Envoltura de Track de Anim"
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
@@ -361,6 +360,184 @@ msgstr "Cambiar Tipo de Valor del Array"
msgid "Change Array Value"
msgstr "Cambiar Valor del Array"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "Version:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Constantes:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr " Archivos"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Descripción:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "Instalar"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Cerrar"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Conectar.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Conectar a Nodo:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Formato requerido de archivo desconocido:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Guardando.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Conectar.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Testeo"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Error al guardar el recurso!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Descargar"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Todos"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -368,6 +545,30 @@ msgstr "Cambiar Valor del Array"
msgid "Search:"
msgstr "Buscar:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Buscar"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "Importar"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "Plugins"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Ordenar:"
@@ -381,10 +582,6 @@ msgid "Category:"
msgstr "Categoría:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Todos"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Sitio:"
@@ -396,7 +593,7 @@ msgstr "Soporte.."
msgid "Official"
msgstr "Oficial"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Comunidad"
@@ -416,20 +613,6 @@ msgstr "Lista de Métodos Para '%s':"
msgid "Call"
msgstr "Llamar"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Cerrar"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Lista de Métodos:"
@@ -455,9 +638,8 @@ msgid "No Matches"
msgstr "Sin Coincidencias"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replaced %d occurrence(s)."
-msgstr "%d Ocurrencia(s) Reemplazadas."
+msgstr "%d ocurrencia(s) Reemplazadas."
#: editor/code_editor.cpp
msgid "Replace"
@@ -480,13 +662,6 @@ msgid "Selection Only"
msgstr "Solo Selección"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Buscar"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Encontrar"
@@ -563,6 +738,7 @@ msgstr "Agregar"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Quitar"
@@ -638,11 +814,6 @@ msgstr "Recientes:"
msgid "Matches:"
msgstr "Coincidencias:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "Descripción:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Buscar Reemplazo Para:"
@@ -675,6 +846,7 @@ msgstr "Recursos"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Ruta"
@@ -765,23 +937,21 @@ msgstr "Eliminar"
#: editor/editor_audio_buses.cpp
msgid "Save Audio Bus Layout As.."
-msgstr ""
+msgstr "Guardar Layout de Bus de Audio Como.."
#: editor/editor_audio_buses.cpp
msgid "Location for New Layout.."
-msgstr ""
+msgstr "Ubicación para el Nuevo Layout.."
#: editor/editor_audio_buses.cpp
msgid "Open Audio Bus Layout"
-msgstr ""
+msgstr "Abrir Layout de Bus de Audio"
#: editor/editor_audio_buses.cpp
-#, fuzzy
msgid "Add Bus"
-msgstr "Agregar %s"
+msgstr "Agregar Bus"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "Cargar"
@@ -791,6 +961,7 @@ msgid "Save As"
msgstr "Guardar Como"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Por Defecto"
@@ -865,8 +1036,7 @@ msgid "Rearrange Autoloads"
msgstr "Reordenar Autoloads"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Ruta:"
@@ -932,9 +1102,9 @@ msgstr "Almacenando Archivo:"
msgid "Packing"
msgstr "Empaquetando"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "Plantilla no encontrada:\n"
#: editor/editor_export.cpp
msgid "Added:"
@@ -1054,11 +1224,11 @@ msgid "ScanSources"
msgstr "EscanearFuentes"
#: editor/editor_file_system.cpp
-#, fuzzy
msgid "(Re)Importing Assets"
-msgstr "Reimportando"
+msgstr "(Re)Importando Assets"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "Buscar en la Ayuda"
@@ -1075,7 +1245,6 @@ msgid "Class:"
msgstr "Clase:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "Hereda:"
@@ -1108,9 +1277,8 @@ msgid "Constants:"
msgstr "Constantes:"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Property Description:"
-msgstr "Descripción Breve:"
+msgstr "Descripción de Propiedad:"
#: editor/editor_help.cpp
msgid "Method Description:"
@@ -1131,10 +1299,6 @@ msgstr " Salida:"
msgid "Clear"
msgstr "Limpiar"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Nodo desde Escena"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1250,10 +1414,11 @@ msgid "There is no defined scene to run."
msgstr "No hay escena definida para ejecutar."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"No se ha definido ninguna escena principal, ¿elegir una?\n"
"Es posible cambiarla más tarde en \"Ajustes del Proyecto\" bajo la categoria "
@@ -1318,6 +1483,11 @@ msgid "Save Scene As.."
msgstr "Guardar Escena Como.."
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Nodo"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr "Esta escena nunca ha sido guardada. Guardar antes de ejecutar?"
@@ -1372,9 +1542,12 @@ msgid ""
"Scene '%s' was automatically imported, so it can't be modified.\n"
"To make changes to it, a new inherited scene can be created."
msgstr ""
+"La escena '%s' fue importada automaticamente, por lo tanto no puede ser "
+"modificada.\n"
+"Para realizar cambios, se debe crear una nueva escena heredada."
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "Ugh"
@@ -1415,6 +1588,10 @@ msgstr "%d archivo(s) más"
msgid "%d more file(s) or folder(s)"
msgstr "%d archivo(s) o carpeta(s) más"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "Modo Sin Distracciones"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Escena"
@@ -1432,9 +1609,8 @@ msgid "Previous tab"
msgstr "Pestaña anterior"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Filter Files.."
-msgstr "Filtrado Rápido de Archivos.."
+msgstr "Filtrar Archivos.."
#: editor/editor_node.cpp
msgid "Operations with scene files."
@@ -1468,7 +1644,7 @@ msgstr "Cerrar Escena"
msgid "Close Goto Prev. Scene"
msgstr "Cerrar e Ir a Escena Prev."
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "Abrir Reciente"
@@ -1496,99 +1672,41 @@ msgid "Redo"
msgstr "Rehacer"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "Ejecutar Script"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Configuración de Proyecto"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "Revertir Escena"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Salir a Listado de Proyecto"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Modo Sin Distracciones"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "Importar assets al proyecto."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "Importar"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "Herramientas misceláneas a nivel proyecto o escena."
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "Herramientas"
+#, fuzzy
+msgid "Project"
+msgstr "Proyecto Nuevo"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "Exportar el proyecto a munchas plataformas."
+msgid "Project Settings"
+msgstr "Configuración de Proyecto"
+
+#: editor/editor_node.cpp
+msgid "Run Script"
+msgstr "Ejecutar Script"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "Exportar"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "Reproducir el proyecto."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "Reproducir"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "Pausar la escena"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "Pausar la Escena"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "Parar la escena."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "Detener"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "Reproducir la escena editada."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "Reproducir Escena"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "Reproducir escena personalizada"
+msgid "Tools"
+msgstr "Herramientas"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "Reproducir Escena Personalizada"
+msgid "Quit to Project List"
+msgstr "Salir a Listado de Proyecto"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "Opciones de debugueo"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "Debuguear"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1678,9 +1796,10 @@ msgstr ""
"Cuando se use remotamente en un dispositivo, esto es mas eficiente con un "
"sistema de archivos de red."
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "Configuración"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Editar"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1695,17 +1814,73 @@ msgid "Toggle Fullscreen"
msgstr "Act./Desact. Pantalla Completa"
#: editor/editor_node.cpp editor/project_export.cpp
-#, fuzzy
msgid "Manage Export Templates"
-msgstr "Cargando Templates de Exportación"
+msgstr "Gestionar Plantillas de Exportación"
+
+#: editor/editor_node.cpp
+msgid "Help"
+msgstr "Ayuda"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "Clases"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "Cerrar Docs"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
#: editor/editor_node.cpp
msgid "About"
msgstr "Acerca de"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "Alerta cuando un recurso externo haya cambiado."
+msgid "Play the project."
+msgstr "Reproducir el proyecto."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "Reproducir"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "Pausar la escena"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "Pausar la Escena"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Parar la escena."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "Detener"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "Reproducir la escena editada."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Reproducir Escena"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Reproducir escena personalizada"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "Reproducir Escena Personalizada"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1788,8 +1963,16 @@ msgid "Thanks!"
msgstr "Gracias!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
-msgstr "Importar Templates Desde Archivo ZIP"
+msgstr "Importar Plantillas Desde Archivo ZIP"
#: editor/editor_node.cpp
msgid "Export Project"
@@ -1815,15 +1998,41 @@ msgstr "Abrir y Correr un Script"
msgid "Load Errors"
msgstr "Erroes de carga"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Abrir en Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Abrir en Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Abrir en Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "Exportar Libreria"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Abrir en Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "Abrir en Editor"
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "Plugins Instalados:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "Version:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "Autor:"
@@ -1936,65 +2145,60 @@ msgid "Import From Node:"
msgstr "Importar Desde Nodo:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Re-Download"
-msgstr "Volver a Cargar"
+msgstr "Volver a Descargar"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Uninstall"
-msgstr "Instalar"
+msgstr "Desinstalar"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "(Installed)"
-msgstr "Instalar"
+msgstr "(Instalado)"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Download"
-msgstr "Abajo"
+msgstr "Descargar"
#: editor/export_template_manager.cpp
msgid "(Missing)"
-msgstr ""
+msgstr "(Faltante)"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "(Current)"
-msgstr "Actual:"
+msgstr "(Actual)"
#: editor/export_template_manager.cpp
msgid "Remove template version '%s'?"
-msgstr ""
+msgstr "Quitar plantilla version '%s'?"
#: editor/export_template_manager.cpp
msgid "Can't open export templates zip."
-msgstr "No se puede abir el zip de templates de exportación."
+msgstr "No se puede abir el zip de plantillas de exportación."
#: editor/export_template_manager.cpp
msgid "Invalid version.txt format inside templates."
-msgstr ""
+msgstr "Formato de version.txt invalido dentro de plantillas."
#: editor/export_template_manager.cpp
msgid ""
"Invalid version.txt format inside templates. Revision is not a valid "
"identifier."
msgstr ""
+"Formato de version.txt invalido dentro de plantillas. Revision no es un "
+"identificador valido."
#: editor/export_template_manager.cpp
msgid "No version.txt found inside templates."
-msgstr ""
+msgstr "No se encontro ningún version.txt dentro de las plantillas."
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Error creating path for templates:\n"
-msgstr "Error al guardar atlas:"
+msgstr "Error creando ruta para las plantillas:\n"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Extracting Export Templates"
-msgstr "Cargando Templates de Exportación"
+msgstr "Extrayendo Plantillas de Exportación"
#: editor/export_template_manager.cpp
msgid "Importing:"
@@ -2002,37 +2206,31 @@ msgstr "Importando:"
#: editor/export_template_manager.cpp
msgid "Loading Export Templates"
-msgstr "Cargando Templates de Exportación"
+msgstr "Cargando Plantillas de Exportación"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Current Version:"
-msgstr "Escena Actual"
+msgstr "Version Actual:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Installed Versions:"
-msgstr "Plugins Instalados:"
+msgstr "Versiones Instaladas:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Install From File"
-msgstr "Instalar Proyecto:"
+msgstr "Instalar Desde Archivo"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Remove Template"
-msgstr "Remover Item"
+msgstr "Remover Plantilla"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Select template file"
-msgstr "Eliminar archivos seleccionados?"
+msgstr "Elegir archivo de plantilla"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Export Template Manager"
-msgstr "Cargando Templates de Exportación"
+msgstr "Gestor de Plantillas de Exportación"
#: editor/file_type_cache.cpp
msgid "Can't open file_type_cache.cch for writing, not saving file type cache!"
@@ -2042,7 +2240,7 @@ msgstr ""
#: editor/filesystem_dock.cpp
msgid "Cannot navigate to '"
-msgstr ""
+msgstr "No se puede navegar a '"
#: editor/filesystem_dock.cpp
msgid "Same source and destination files, doing nothing."
@@ -2069,13 +2267,16 @@ msgid "No files selected!"
msgstr "Ningún Archivo seleccionado!"
#: editor/filesystem_dock.cpp
-#, fuzzy
msgid "Expand all"
-msgstr "Expandir al Padre"
+msgstr "Expandir todos"
#: editor/filesystem_dock.cpp
msgid "Collapse all"
-msgstr ""
+msgstr "Colapsar todos"
+
+#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "Mostrar en Gestor de Archivos"
#: editor/filesystem_dock.cpp
msgid "Instance"
@@ -2106,10 +2307,6 @@ msgid "Info"
msgstr "Info"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "Mostrar en Gestor de Archivos"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Reimportando.."
@@ -2188,21 +2385,18 @@ msgid "Saving.."
msgstr "Guardando.."
#: editor/import_dock.cpp
-#, fuzzy
msgid " Files"
-msgstr "Archivo"
+msgstr " Archivos"
#: editor/import_dock.cpp
-#, fuzzy
msgid "Import As:"
-msgstr "Importar"
+msgstr "Importar Como:"
#: editor/import_dock.cpp editor/property_editor.cpp
msgid "Preset.."
msgstr "Preseteo.."
#: editor/import_dock.cpp
-#, fuzzy
msgid "Reimport"
msgstr "Reimportar"
@@ -2277,9 +2471,10 @@ msgid "No target font resource!"
msgstr "Sin recurso de tipografías de destino!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"Extension de archivo inválida.\n"
"Usá .fnt, por favor."
@@ -2762,7 +2957,8 @@ msgid "Compress"
msgstr "Comprimir"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
msgstr "Agregar al Proyecto (godot.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -2802,9 +2998,8 @@ msgid "Change Animation Name:"
msgstr "Cambiar Nombre de Animación:"
#: editor/plugins/animation_player_editor_plugin.cpp
-#, fuzzy
msgid "Delete Animation?"
-msgstr "Duplicar Animación"
+msgstr "Eliminar Animación?"
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
@@ -3208,7 +3403,7 @@ msgstr "Editar CanvasItem"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Change Anchors"
-msgstr "Cambiar Anchors"
+msgstr "Cambiar Anclas"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Zoom (%):"
@@ -3430,7 +3625,7 @@ msgid "Change default type"
msgstr "Cambiar typo por defecto"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "OK"
@@ -3481,15 +3676,6 @@ msgstr "Crear Poly3D"
msgid "Set Handle"
msgstr "Setear Handle"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "Agregar/Quitar Punto de Rampa de Color"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr "Modificar Rampa de Color"
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr "Crear Librería de Meshes"
@@ -3520,6 +3706,34 @@ msgstr "Importar desde Escena"
msgid "Update from Scene"
msgstr "Acutalizar desde Escena"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Agregar Entrada"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Quitar Punto del Path"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "Cargar Recurso"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr "Modificar Curva"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "Agregar/Quitar Punto de Rampa de Color"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "Modificar Rampa de Color"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "Item %d"
@@ -3557,19 +3771,16 @@ msgid "RMB: Erase Point."
msgstr "Click Der.: Borrar Punto."
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Remove Point from Line2D"
-msgstr "Remover Punto de Curva"
+msgstr "Remover Punto de Line2D"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Add Point to Line2D"
-msgstr "Agregar Punto a Curva"
+msgstr "Agregar Punto a Line2D"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Move Point in Line2D"
-msgstr "Mover Punto en Curva"
+msgstr "Mover Punto en Line2D"
#: editor/plugins/line_2d_editor_plugin.cpp
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -3602,9 +3813,8 @@ msgid "Add Point (in empty space)"
msgstr "Agregar Punto (en espacio vacío)"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Split Segment (in line)"
-msgstr "Partir Segmento (en curva)"
+msgstr "Partir Segmento (en línea)"
#: editor/plugins/line_2d_editor_plugin.cpp
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -3794,6 +4004,20 @@ msgid "Remove Poly And Point"
msgstr "Remover Polígono y Punto"
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "Limpiar Máscara de Emisión"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "Generar AABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "Error al cargar la imagen:"
@@ -3806,8 +4030,8 @@ msgid "Set Emission Mask"
msgstr "Setear Máscara de Emisión"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
-msgstr "Limpiar Máscara de Emisión"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -3817,6 +4041,27 @@ msgstr "Cargar Máscara de Emisión"
msgid "Generated Point Count:"
msgstr "Conteo de Puntos Generados:"
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Tiempo Promedio (seg)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "Setear Máscara de Emisión"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "Crear desde Escena"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Puntos de Emisión:"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr "El nodo no contiene geometría."
@@ -3826,6 +4071,10 @@ msgid "Node does not contain geometry (faces)."
msgstr "El nodo no contiene geometría (caras)."
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr "Se requiere un material procesador de tipo 'ParticlesMaterial'."
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "Las caras no contienen area!"
@@ -3838,12 +4087,12 @@ msgid "Generate AABB"
msgstr "Generar AABB"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
-msgstr "Crear Emisor desde Mesh"
+msgid "Create Emission Points From Mesh"
+msgstr "Crear Puntos de Emisión desde Mesh"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
-msgstr "Crear Emisor desde Nodo"
+msgid "Create Emission Points From Node"
+msgstr "Crear Puntos de Emisión Desde Nodo"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Clear Emitter"
@@ -3854,26 +4103,45 @@ msgid "Create Emitter"
msgstr "Crear Emisor"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
-msgstr "Posiciones de Emisión:"
+msgid "Emission Points:"
+msgstr "Puntos de Emisión:"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr "Relleno de Emisión:"
+msgid "Surface Points"
+msgstr "Puntos de Superficie"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "Superficie"
+msgid "Surface Points+Normal (Directed)"
+msgstr "Puntos de Superficia+Normal (Dirigida)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "Volumen"
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr "Fuente de Emisión: "
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "Generar AABB"
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr "Remover Punto de Curva"
#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "Mover Out-Control en Curva"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "Remover Punto de Curva"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr "Agregar Punto a Curva"
@@ -3928,6 +4196,16 @@ msgstr "Partir Path"
msgid "Remove Path Point"
msgstr "Quitar Punto del Path"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Mover Out-Control en Curva"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "Mover In-Control en Curva"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "Crear Mapa UV"
@@ -4081,6 +4359,11 @@ msgid "Pitch"
msgstr "Altura"
#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "Reestablecer Huesos"
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr "Error al guardar el tema"
@@ -4168,10 +4451,6 @@ msgstr "Encontrar.."
msgid "Find Next"
msgstr "Encontrar Siguiente"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "Debuguear"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr "Step Over"
@@ -4205,16 +4484,9 @@ msgid "Move Right"
msgstr "Mover a la Derecha"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "Tutoriales"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "Abrir https://godotengine.org en la sección de tutoriales."
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "Clases"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "Buscar en la documentación de referencia."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
@@ -4233,9 +4505,8 @@ msgid "Go to next edited document."
msgstr "Ir a siguiente documento editado."
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Discard"
-msgstr "Discreto"
+msgstr "Descartar"
#: editor/plugins/script_editor_plugin.cpp
msgid "Create Script"
@@ -4273,6 +4544,23 @@ msgid "Pick Color"
msgstr "Elegir Color"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "Convirtiendo Imágenes"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4323,6 +4611,14 @@ msgid "Trim Trailing Whitespace"
msgstr "Eliminar Espacios Sobrantes al Final"
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr "Auto Indentar"
@@ -4344,6 +4640,16 @@ msgid "Goto Previous Breakpoint"
msgstr "Ir a Anterior Breakpoint"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "Convertir A.."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Convertir A.."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "Encontrar Anterior"
@@ -4366,6 +4672,10 @@ msgstr "Ir a Línea.."
msgid "Contextual Help"
msgstr "Ayuda Contextual"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr "Cambiar Constante Escalar"
@@ -4583,36 +4893,106 @@ msgid "Animation Key Inserted."
msgstr "Clave de Animación Insertada."
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Avanzar"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "Hacia Atrás"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Rueda Abajo."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Actualizar Cambios"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Actualizar Cambios"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "Actualizar Cambios"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "Vértice"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr "Alinear con vista"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
-msgstr "Entorno"
+msgid "Display Normal"
+msgstr "Mostrar Normal"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
-msgstr "Oyente de Audio"
+msgid "Display Wireframe"
+msgstr "Mostrar Wireframe"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
-msgstr "Gizmos"
+msgid "Display Overdraw"
+msgstr "Mostrar Overdraw"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
-msgstr "Dialogo XForm"
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Mostrar sin Sombreado"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Environment"
+msgstr "Entorno"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "Ninguna escena seleccionada a la instancia!"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Gizmos"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Instancia en Cursor"
+msgid "View Information"
+msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "No se pudo instanciar la escena!"
+msgid "Audio Listener"
+msgstr "Oyente de Audio"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "Dialogo XForm"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4671,6 +5051,26 @@ msgid "Align Selection With View"
msgstr "Alinear Selección Con Vista"
#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "Seleccionar"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "Mover"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: Rotar"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "Escala:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
msgstr "Transformar"
@@ -4683,14 +5083,6 @@ msgid "Transform Dialog.."
msgstr "Dialogo de Transformación.."
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr "Usar Luz por Defecto"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "Usar sRGB por Defecto"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
msgstr "1 Viewport"
@@ -4715,22 +5107,6 @@ msgid "4 Viewports"
msgstr "4 Viewports"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr "Mostrar Normales"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr "Mostrar Wireframe"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr "Mostrar Overdraw"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr "Mostrar sin Sombreado"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr "Ver Origen"
@@ -4739,6 +5115,10 @@ msgid "View Grid"
msgstr "Ver Grilla"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Configuración"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "Ajustes de Snap"
@@ -4759,14 +5139,6 @@ msgid "Viewport Settings"
msgstr "Ajustes de Viewport"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr "Normales de Luces por Defecto:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr "Color de Luz Ambiental:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr "FOV de Perspectiva (grados.):"
@@ -4941,11 +5313,11 @@ msgstr "Quitar Items de Clases"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Create Empty Template"
-msgstr "Crear Template Vacío"
+msgstr "Crear Plantilla Vacía"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Create Empty Editor Template"
-msgstr "Crear Template de Editor Vacío"
+msgstr "Crear Plantilla de Editor Vacía"
#: editor/plugins/theme_editor_plugin.cpp
msgid "CheckBox Radio1"
@@ -5105,24 +5477,20 @@ msgid "Error"
msgstr "Error"
#: editor/project_export.cpp
-#, fuzzy
msgid "Runnable"
-msgstr "Activar"
+msgstr "Ejecutable"
#: editor/project_export.cpp
-#, fuzzy
msgid "Delete patch '"
-msgstr "Eliminar Entrada"
+msgstr "Eliminar parche '"
#: editor/project_export.cpp
-#, fuzzy
msgid "Delete preset '%s'?"
-msgstr "Eliminar archivos seleccionados?"
+msgstr "Eliminar preset '%s'?"
#: editor/project_export.cpp
-#, fuzzy
msgid "Presets"
-msgstr "Preseteo.."
+msgstr "Presets"
#: editor/project_export.cpp editor/project_settings.cpp
msgid "Add.."
@@ -5133,74 +5501,67 @@ msgid "Resources"
msgstr "Recursos"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export all resources in the project"
-msgstr "Exportar todos los recursos en el proyecto."
+msgstr "Exportar todos los recursos en el proyecto"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export selected scenes (and dependencies)"
-msgstr "Exportar los recursos seleccionado (incluyendo dependencias)."
+msgstr "Exportar escenas seleccionadas (y dependencias)"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export selected resources (and dependencies)"
-msgstr "Exportar los recursos seleccionado (incluyendo dependencias)."
+msgstr "Exportar ecursos seleccionados (y dependencias)"
#: editor/project_export.cpp
msgid "Export Mode:"
msgstr "Modo de Exportación:"
#: editor/project_export.cpp
-#, fuzzy
msgid "Resources to export:"
-msgstr "Recursos a Exportar:"
+msgstr "Recursos a exportar:"
#: editor/project_export.cpp
-#, fuzzy
msgid ""
"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"
msgstr ""
"Filtros para exportar archivos que no son recursos (separados por comas, ej: "
-"*.json, *.txt):"
+"*.json, *.txt)"
#: editor/project_export.cpp
-#, fuzzy
msgid ""
"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)"
msgstr ""
-"Filtros para excluir de la exportación (separados por comas, ej: *.json, *."
-"txt):"
+"Filtros para excluir archivos del proyecto (separados por comas, ej: *.json, "
+"*.txt)"
#: editor/project_export.cpp
-#, fuzzy
msgid "Patches"
-msgstr "Coincidencias:"
+msgstr "Parches"
#: editor/project_export.cpp
-#, fuzzy
msgid "Make Patch"
-msgstr "Ruta de Destino:"
+msgstr "Crear Parche"
#: editor/project_export.cpp
msgid "Export templates for this platform are missing:"
-msgstr ""
+msgstr "Faltan las plantillas de exportación para esta plataforma:"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export With Debug"
-msgstr "Exportar Tile Set"
+msgstr "Exportar Como Debug"
#: editor/project_manager.cpp
msgid "Invalid project path, the path must exist!"
msgstr "Ruta de proyecto inválida, la ruta debe existir!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
msgstr "Ruta de proyecto inválida, godot.cfg no debe existir."
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
msgstr "Ruta de proyecto inválida, godot.cfg debe existir."
#: editor/project_manager.cpp
@@ -5212,7 +5573,8 @@ msgid "Invalid project path (changed anything?)."
msgstr "Ruta de proyecto inválida (cambiaste algo?)."
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
msgstr "No se pudo crear godot.cfg en la ruta de proyecto."
#: editor/project_manager.cpp
@@ -5248,10 +5610,6 @@ msgid "Install Project:"
msgstr "Instalar Proyecto:"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "Instalar"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "Examinar"
@@ -5314,6 +5672,11 @@ msgid "New Project"
msgstr "Proyecto Nuevo"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Remover Plantilla"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "Salir"
@@ -5413,18 +5776,16 @@ msgid "Button 9"
msgstr "Botón 9"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Axis Index:"
-msgstr "Indice de Ejes de Joystick:"
+msgstr "Indice del Eje del Gamepad:"
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Axis"
msgstr "Eje"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Button Index:"
-msgstr "Indice de Botones de Joystick:"
+msgstr "Indice del Boton del Gamepad:"
#: editor/project_settings.cpp
msgid "Add Input Action"
@@ -5434,6 +5795,11 @@ msgstr "Agregar Acción de Entrada"
msgid "Erase Input Action Event"
msgstr "Borrar Evento de Acción de Entrada"
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "Agregar Vacío"
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Dispositivo"
@@ -5499,8 +5865,9 @@ msgid "Remove Resource Remap Option"
msgstr "Remover Opción de Remapeo de Recursos"
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr "Ajustes de Proyecto (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Configuración de Proyecto (godot.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5566,14 +5933,9 @@ msgstr "Locale"
msgid "AutoLoad"
msgstr "AutoLoad"
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "Plugins"
-
#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Viewport"
-msgstr "1 Viewport"
+msgstr "Seleccionar un Viewport"
#: editor/property_editor.cpp
msgid "Ease In"
@@ -5612,20 +5974,14 @@ msgid "New Script"
msgstr "Nuevo Script"
#: editor/property_editor.cpp
-#, fuzzy
msgid "Show in File System"
-msgstr "FileSystem"
+msgstr "Mostrar en Sistema de Archivos"
#: editor/property_editor.cpp
msgid "Error loading file: Not a resource!"
msgstr "Error al cargar el archivo: No es un recurso!"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "No se pudo cargar la imagen"
-
-#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Node"
msgstr "Seleccionar un Nodo"
@@ -5772,7 +6128,7 @@ msgstr "Esta operación no puede hacerse sin una escena."
#: editor/scene_tree_dock.cpp
msgid "Can not perform with the root node."
-msgstr ""
+msgstr "No se puede realizar sobre el nodo raíz."
#: editor/scene_tree_dock.cpp
msgid "This operation can't be done on instanced scenes."
@@ -5816,6 +6172,11 @@ msgid "Error duplicating scene to save it."
msgstr "Error al duplicar escena para guardarla."
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Recursos:"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "Editar Grupos"
@@ -5856,9 +6217,8 @@ msgid "Save Branch as Scene"
msgstr "Guardar Rama como Escena"
#: editor/scene_tree_dock.cpp
-#, fuzzy
msgid "Copy Node Path"
-msgstr "Copiar Ruta"
+msgstr "Copiar Ruta del Nodo"
#: editor/scene_tree_dock.cpp
msgid "Delete (No Confirm)"
@@ -5893,10 +6253,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "Act/Desact. CanvasItem Visible"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Opciones de debugueo"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "Instancia:"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Script siguiente"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Act/Desact. Espacial Visible"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr "Nobre de nodo inválido, los siguientes caracteres no estan permitidos:"
@@ -5941,75 +6350,93 @@ msgid "Select a Node"
msgstr "Seleccionar un Nodo"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "Nombre de clase padre inválido"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "No se puede crear el script en el sistema de archivos."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "Caracteres válidos:"
+msgid "Error loading script from %s"
+msgstr "Error al cargar el script desde %s"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "Nombre de clase inválido"
+msgid "Path is empty"
+msgstr "La ruta está vacia"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "Nombre válido"
+msgid "Path is not local"
+msgstr "La ruta no es local"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "N/A"
+msgid "Invalid base path"
+msgstr "Ruta base inválida"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "El nombre de clase es inválido!"
+msgid "Invalid extension"
+msgstr "Extensión invalida"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "El nombre de la clase padre es inválido!"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "Ruta inválida!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Ruta inválida."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "No se puede crear el script en el sistema de archivos."
+msgid "Invalid class name"
+msgstr "Nombre de clase inválido"
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
-msgstr "Error al cargar el script desde %s"
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "Nombre de propiedad indíce inválido."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "La ruta está vacia"
+#, fuzzy
+msgid "Script valid"
+msgstr "Script"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "La ruta no es local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "Ruta base inválida"
+msgid "N/A"
+msgstr "N/A"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "Extensión invalida"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+#, fuzzy
+msgid "Create new script file"
msgstr "Crear script nuevo"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+#, fuzzy
+msgid "Load existing script file"
msgstr "Cargar script existente"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "Hereda:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "Nombre de Clase:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Remover Plantilla"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "Script Integrado (Built-In)"
#: editor/script_create_dialog.cpp
@@ -6181,9 +6608,12 @@ msgid "Change Notifier Extents"
msgstr "Cambiar Alcances de Notificadores"
#: editor/spatial_editor_gizmos.cpp
-#, fuzzy
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
-msgstr "Cambiar Alcances de Notificadores"
+msgstr "Cambiar Extensión de Sonda"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6236,8 +6666,8 @@ msgid ""
"A node yielded without working memory, please read the docs on how to yield "
"properly!"
msgstr ""
-"Un nodo rindió(yielded) sin memoria de trabajo, por favor lee los docs sobre "
-"como usar yield correctamente!"
+"Un nodo realizó un yield sin memoria de trabajo, por favor leé la "
+"documentacion sobre como usar yield correctamente!"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -6518,6 +6948,26 @@ msgstr "recién presionado"
msgid "just released"
msgstr "recién soltado"
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr "Ejecutar en el Navegador"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr "Ejecutar HTML exportado en el navegador por defecto del sistema."
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr "No se pudo escribir el archivo:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr "No se pudo leer el archivo:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr "No se pudo abrir la plantilla para exportar:\n"
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6538,8 +6988,8 @@ msgid ""
"No export templates found.\n"
"Download and install export templates."
msgstr ""
-"No se encontraron export templates.\n"
-"Descargá o instalá export templates."
+"No se encontraron plantillas de exportación.\n"
+"Descargá o instalá plantillas de exportación."
#: platform/uwp/export/export.cpp
msgid "Custom debug package not found."
@@ -6694,10 +7144,11 @@ msgstr ""
"ParallaxLayer node solo funciona cuando esta seteado como hijo de un nodo "
"ParallaxBackground."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"La propiedad Path debe apuntar a un nodo Particles2D valido para funcionar."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6777,6 +7228,11 @@ msgstr ""
"NavigationMeshInstance debe ser un hijo o nieto de un nodo Navigation. Solo "
"provee datos de navegación."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6797,6 +7253,15 @@ msgstr ""
"Un recurso SpriteFrames debe ser creado o asignado en la propiedad 'Frames' "
"para que AnimatedSprite3D pueda mostrar frames."
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "Modo de Ejecución:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Alerta!"
@@ -6841,6 +7306,15 @@ msgid ""
"Use a container as child (VBox,HBox,etc), or a Control and set the custom "
"minimum size manually."
msgstr ""
+"ScrollContainer esta diseñado para trabajan con un unico control hijo.\n"
+"Usá un container como hijo (VBox, HBox, etc), o un Control y seteá el tamaño "
+"mínimo personalizado de forma manual."
+
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
#: scene/main/viewport.cpp
msgid ""
@@ -6854,6 +7328,74 @@ msgstr ""
"que pueda obtener un tamaño. Alternativamente, hacelo un RenderTarget y "
"asigná su textura interna a algún otro nodo para mostrar."
+#~ msgid "Node From Scene"
+#~ msgstr "Nodo desde Escena"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Importar assets al proyecto."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Exportar el proyecto a munchas plataformas."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "Alerta cuando un recurso externo haya cambiado."
+
+#~ msgid "Tutorials"
+#~ msgstr "Tutoriales"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "Abrir https://godotengine.org en la sección de tutoriales."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "Ninguna escena seleccionada a la instancia!"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "Instancia en Cursor"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "No se pudo instanciar la escena!"
+
+#~ msgid "Use Default Light"
+#~ msgstr "Usar Luz por Defecto"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "Usar sRGB por Defecto"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "Normales de Luces por Defecto:"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "Color de Luz Ambiental:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "No se pudo cargar la imagen"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "Nombre de clase padre inválido"
+
+#~ msgid "Valid chars:"
+#~ msgstr "Caracteres válidos:"
+
+#~ msgid "Valid name"
+#~ msgstr "Nombre válido"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "El nombre de clase es inválido!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "El nombre de la clase padre es inválido!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "Ruta inválida!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "La propiedad Path debe apuntar a un nodo Particles2D valido para "
+#~ "funcionar."
+
+#~ msgid "Surface"
+#~ msgstr "Superficie"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
@@ -6898,33 +7440,51 @@ msgstr ""
#~ msgid "No exporter for platform '%s' yet."
#~ msgstr "No hay exportador para la plataforma '%s' aun."
-#, fuzzy
#~ msgid "Create Android keystore"
-#~ msgstr "Crear Nuevo Recurso"
+#~ msgstr "Crear keystore de Android"
-#, fuzzy
#~ msgid "Full name"
-#~ msgstr "Nombre válido"
+#~ msgstr "Nombre completo"
+
+#~ msgid "Organizational unit"
+#~ msgstr "Unidad organizativa"
-#, fuzzy
#~ msgid "Organization"
-#~ msgstr "Transición"
+#~ msgstr "Organización"
+
+#~ msgid "City"
+#~ msgstr "Ciudad"
-#, fuzzy
#~ msgid "State"
-#~ msgstr "Estado:"
+#~ msgstr "Estado"
+
+#~ msgid "2 letter country code"
+#~ msgstr "Código de país de dos letras"
+
+#~ msgid "User alias"
+#~ msgstr "Alias de usuario"
-#, fuzzy
#~ msgid "Password"
-#~ msgstr "Contraseña:"
+#~ msgstr "Contraseña"
-#, fuzzy
#~ msgid "at least 6 characters"
-#~ msgstr "Caracteres válidos:"
+#~ msgstr "al menos 6 caracteres"
-#, fuzzy
#~ msgid "File name"
-#~ msgstr "Nuevo nombre:"
+#~ msgstr "Nombre de archivo"
+
+#~ msgid "Path : (better to save outside of project)"
+#~ msgstr "Ruta : (es mejor guardar fuera del proyecto)"
+
+#~ msgid ""
+#~ "Release keystore is not set.\n"
+#~ "Do you want to create one?"
+#~ msgstr ""
+#~ "No esta seteado el release keystore.\n"
+#~ "¿Querés crear uno?"
+
+#~ msgid "Fill Keystore/Release User and Release Password"
+#~ msgstr "Completa con Keystore/Usuario Release y Cntraseña Release"
#~ msgid "Include"
#~ msgstr "Incluir"
@@ -7052,9 +7612,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "Silencio Sobrante al Final:"
-#~ msgid "Script"
-#~ msgstr "Script"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Modo de Exportación de Scipts:"
@@ -7088,9 +7645,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance no contiene un recurso BakedLight."
-#~ msgid "Vertex"
-#~ msgstr "Vértice"
-
#~ msgid "Fragment"
#~ msgstr "Fragmento"
@@ -7133,9 +7687,6 @@ msgstr ""
#~ msgid "Cannot go into subdir:"
#~ msgstr "No se puede acceder al subdir:"
-#~ msgid "Help"
-#~ msgstr "Ayuda"
-
#~ msgid "Imported Resources"
#~ msgstr "Importar Recursos"
diff --git a/editor/translations/extract.py b/editor/translations/extract.py
index 616fec17a0..5e6c894936 100755
--- a/editor/translations/extract.py
+++ b/editor/translations/extract.py
@@ -38,7 +38,8 @@ unique_str = []
unique_loc = {}
main_po = """
# LANGUAGE translation of the Godot Engine editor
-# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
+# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
+# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
# This file is distributed under the same license as the Godot source code.
#
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
diff --git a/editor/translations/fa.po b/editor/translations/fa.po
index 8cf167b3d7..e8132b9936 100644
--- a/editor/translations/fa.po
+++ b/editor/translations/fa.po
@@ -360,6 +360,182 @@ msgstr "نوع مقدار آرایه را تغییر بده"
msgid "Change Array Value"
msgstr "مقدار آرایه را تغییر بده"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "نسخه:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "مستمر"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "پرونده:"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "توضیح:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "بستن"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "در حال اتصال..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "اتصال به گره:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "در حال اتصال..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "آزمودن"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "خطای بارگذاری قلم."
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "خطاهای بارگذاری"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "همه"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -367,6 +543,30 @@ msgstr "مقدار آرایه را تغییر بده"
msgid "Search:"
msgstr "جستجو:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "جستجو"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "مرتب‌سازی:"
@@ -380,10 +580,6 @@ msgid "Category:"
msgstr "طبقه‌بندی:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "همه"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "تارنما:"
@@ -395,7 +591,7 @@ msgstr "پشتیبانی.."
msgid "Official"
msgstr "Ø¯ÙØªØ±ÛŒ"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "انجمن"
@@ -415,20 +611,6 @@ msgstr "لیست متد برای 's%' :"
msgid "Call"
msgstr "ÙØ±Ø§Ø®ÙˆØ§Ù†ÛŒ"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "بستن"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Ùهرست متدها:"
@@ -479,13 +661,6 @@ msgid "Selection Only"
msgstr "تنها در قسمت انتخاب شده"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "جستجو"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "ÛŒØ§ÙØªÙ†"
@@ -560,6 +735,7 @@ msgstr "Ø§ÙØ²ÙˆØ¯Ù†"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "برداشتن"
@@ -636,11 +812,6 @@ msgstr ""
msgid "Matches:"
msgstr "تطبیق‌ها:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "توضیح:"
-
#: editor/dependency_editor.cpp
#, fuzzy
msgid "Search Replacement For:"
@@ -676,6 +847,7 @@ msgstr "منبع"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "مسیر"
@@ -780,8 +952,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -791,6 +962,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Ù¾ÛŒØ´ÙØ±Ø¶"
@@ -859,8 +1031,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "مسیر:"
@@ -926,7 +1097,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1052,7 +1223,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr "در حال وارد کردن دوباره..."
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1069,7 +1241,6 @@ msgid "Class:"
msgstr "کلاس:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "میراث:"
@@ -1125,10 +1296,6 @@ msgstr " خروجی:"
msgid "Clear"
msgstr "پاک کردن"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1244,8 +1411,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1299,6 +1466,10 @@ msgid "Save Scene As.."
msgstr "ذخیره صحنه در ..."
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1355,7 +1526,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1393,6 +1564,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "صحنه"
@@ -1445,7 +1620,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1473,50 +1648,24 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr ""
+#, fuzzy
+msgid "Project"
+msgstr "صادر کردن پروژه"
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "ابزارها"
-
-#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1524,47 +1673,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "پخش"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
+msgid "Tools"
+msgstr "ابزارها"
#: editor/editor_node.cpp
-msgid "Play the edited scene."
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "پخش صحنه"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "پخش Ø³ÙØ§Ø±Ø´ÛŒ صحنه"
-
-#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "پخش Ø³ÙØ§Ø±Ø´ÛŒ صحنه"
-
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1635,9 +1752,10 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "ترجیحات"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "ویرایش کردن"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1657,13 +1775,69 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr "معرÙÛŒ"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
msgstr ""
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "پخش"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "پخش صحنه"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "پخش Ø³ÙØ§Ø±Ø´ÛŒ صحنه"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "پخش Ø³ÙØ§Ø±Ø´ÛŒ صحنه"
+
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
msgstr ""
@@ -1745,6 +1919,14 @@ msgid "Thanks!"
msgstr "تشکرات!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "واردکردن قالب ها از درون یک ÙØ§ÛŒÙ„ ZIP"
@@ -1772,15 +1954,40 @@ msgstr "باز کردن و اجرای یک اسکریپت"
msgid "Load Errors"
msgstr "خطاهای بارگذاری"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "یک دیکشنری را باز کن"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "یک دیکشنری را باز کن"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "ویرایشگر بستگی"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "صادکردن ÙØ§ÛŒÙ„ کتابخانه ای"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "ویرایشگر بستگی"
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
+msgstr ""
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "Ø§ÙØ²ÙˆÙ†Ù‡ های نصب شده:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "نسخه:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "خالق:"
@@ -2024,6 +2231,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2052,10 +2263,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2223,7 +2430,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2700,7 +2907,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3362,7 +3569,7 @@ msgid "Change default type"
msgstr "نوع مقدار آرایه را تغییر بده"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "مواÙقت"
@@ -3411,15 +3618,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3450,6 +3648,34 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Signal را اضاÙÙ‡ Ú©Ù†"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "برداشتن موج"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "خطاهای بارگذاری"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3720,6 +3946,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3732,7 +3971,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3743,6 +3982,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3752,6 +4008,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3764,11 +4024,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3780,26 +4040,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3854,6 +4130,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "برداشتن نقش"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -4007,6 +4292,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4095,10 +4384,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4132,15 +4417,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4196,6 +4473,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4246,6 +4539,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4267,6 +4568,15 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "اتصال به گره:"
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4289,6 +4599,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4506,35 +4820,98 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "به سمت عقب"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "غلطاندن به پایین."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "تغییر بده"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4594,23 +4971,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "همه‌ی انتخاب ها"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Local Coords"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4638,22 +5024,6 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr ""
@@ -4662,6 +5032,10 @@ msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "ترجیحات"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr ""
@@ -4682,14 +5056,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5105,11 +5471,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5121,7 +5487,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5157,10 +5523,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5221,6 +5583,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "برداشتن انتخاب شده"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5339,6 +5706,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "دستگاه"
@@ -5404,7 +5775,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5471,10 +5842,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5525,10 +5892,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "مسیر به سمت گره:"
@@ -5716,6 +6079,11 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "منبع"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5792,10 +6160,57 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "باز کردن و اجرای یک اسکریپت"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5840,77 +6255,91 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr ""
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "نمی‌تواند یک پوشه ایجاد شود."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr ""
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "خطای بارگذاری قلم."
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr ""
+#, fuzzy
+msgid "Invalid Path"
+msgstr "مسیر نامعتبر."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Error loading script from %s"
-msgstr "خطای بارگذاری قلم."
+msgid "Invalid inherited parent name or path"
+msgstr "نام دارایی ایندکس نامعتبر."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "جدید ایجاد کن"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
-msgstr ""
+#, fuzzy
+msgid "Inherits"
+msgstr "میراث:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
+msgstr "کلاس:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr "برداشتن انتخاب شده"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6083,6 +6512,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6426,6 +6859,29 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "نمی‌تواند یک پوشه ایجاد شود."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "نمی‌تواند یک پوشه ایجاد شود."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "نمی‌تواند یک پوشه ایجاد شود."
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6590,9 +7046,11 @@ msgstr ""
"گره ParallaxLayer تنها در زمانی Ú©Ù‡ به عنوان ÙØ±Ø²Ù†Ø¯ یک گره ParallaxBackground "
"تنظیم شود کار می‌کند."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
-msgstr "دارایی Path باید به یک گره Particles2D معتبر اشاره کند تا کار کند."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6674,6 +7132,11 @@ msgstr ""
"NavigationMeshInstance باید یک ÙØ±Ø²Ù†Ø¯ یا نوه‌ی یک گره Navigation باشد. این "
"تنها داده‌ی پیمایش را ÙØ±Ø§Ù‡Ù… می‌کند."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6694,6 +7157,14 @@ msgstr ""
"یک منبع SpriteFrames باید در دارایی Frames ایجاد شده باشد تا "
"AnimatedSprite3D ÙØ±ÛŒÙ…‌ها را نمایش دهد."
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "هشدار!"
@@ -6739,6 +7210,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6751,6 +7228,9 @@ msgstr ""
"تا بتواند یک اندازه بگیرد. در غیر اینصورت، آن را یک RenderTarget قرار دهید و "
"Ø¨Ø§ÙØª داخلی آن را برای نمایش به تعدادی گره تخصیص دهید."
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr "دارایی Path باید به یک گره Particles2D معتبر اشاره کند تا کار کند."
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
diff --git a/editor/translations/fi.po b/editor/translations/fi.po
new file mode 100644
index 0000000000..d2b6a98223
--- /dev/null
+++ b/editor/translations/fi.po
@@ -0,0 +1,7260 @@
+# Finnish translation of the Godot Engine editor
+# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
+# This file is distributed under the same license as the Godot source code.
+#
+# ekeimaja <ekeimaja@gmail.com>, 2017.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Godot Engine editor\n"
+"PO-Revision-Date: 2017-04-16 13:21+0000\n"
+"Last-Translator: ekeimaja <ekeimaja@gmail.com>\n"
+"Language-Team: Finnish <https://hosted.weblate.org/projects/godot-engine/"
+"godot/fi/>\n"
+"Language: fi\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 2.14-dev\n"
+
+#: editor/animation_editor.cpp
+msgid "Disabled"
+msgstr "Poistettu käytöstä"
+
+#: editor/animation_editor.cpp
+msgid "All Selection"
+msgstr "Koko valinta"
+
+#: editor/animation_editor.cpp
+#, fuzzy
+msgid "Move Add Key"
+msgstr "Siirrä lisäyspainiketta"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Transition"
+msgstr "Vaihda animaation siirtymää"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Transform"
+msgstr "Vaihda animaation muunnosta"
+
+#: editor/animation_editor.cpp
+#, fuzzy
+msgid "Anim Change Value"
+msgstr "Animaation muutosarvo"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Call"
+msgstr ""
+
+#: editor/animation_editor.cpp
+#, fuzzy
+msgid "Anim Add Track"
+msgstr "Lisää animaatioraita"
+
+#: editor/animation_editor.cpp
+msgid "Anim Duplicate Keys"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Move Anim Track Up"
+msgstr "Siirrä animaatioraita ylös"
+
+#: editor/animation_editor.cpp
+msgid "Move Anim Track Down"
+msgstr "Siirrä animaatioraita alas"
+
+#: editor/animation_editor.cpp
+msgid "Remove Anim Track"
+msgstr "Poista animaation raita"
+
+#: editor/animation_editor.cpp
+msgid "Set Transitions to:"
+msgstr "Aseta siirtymät:"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Rename"
+msgstr "Nimeä animaatioraita uudelleen"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Interpolation"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Value Mode"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Wrap Mode"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Edit Node Curve"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Edit Selection Curve"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Delete Keys"
+msgstr "Poista avaimet"
+
+#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
+msgid "Duplicate Selection"
+msgstr "Monista valinta"
+
+#: editor/animation_editor.cpp
+msgid "Duplicate Transposed"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Remove Selection"
+msgstr "Poista valinta"
+
+#: editor/animation_editor.cpp
+msgid "Continuous"
+msgstr "Jatkuva"
+
+#: editor/animation_editor.cpp
+msgid "Discrete"
+msgstr "Erillinen"
+
+#: editor/animation_editor.cpp
+msgid "Trigger"
+msgstr "Liipaisin"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Key"
+msgstr "Lisää avain"
+
+#: editor/animation_editor.cpp
+msgid "Anim Move Keys"
+msgstr "SIirrä avaimia"
+
+#: editor/animation_editor.cpp
+msgid "Scale Selection"
+msgstr "Skaalaa valintaa"
+
+#: editor/animation_editor.cpp
+msgid "Scale From Cursor"
+msgstr "Skaalaa kursorista"
+
+#: editor/animation_editor.cpp
+msgid "Goto Next Step"
+msgstr "Mene seuraavaan vaiheeseen"
+
+#: editor/animation_editor.cpp
+msgid "Goto Prev Step"
+msgstr "Mene edelliseen vaiheeseen"
+
+#: editor/animation_editor.cpp editor/property_editor.cpp
+msgid "Linear"
+msgstr "Lineaarinen"
+
+#: editor/animation_editor.cpp editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Constant"
+msgstr "Jatkuva"
+
+#: editor/animation_editor.cpp
+msgid "In"
+msgstr "Sisään"
+
+#: editor/animation_editor.cpp
+msgid "Out"
+msgstr "Ulos"
+
+#: editor/animation_editor.cpp
+msgid "In-Out"
+msgstr "Sisältä ulos"
+
+#: editor/animation_editor.cpp
+msgid "Out-In"
+msgstr "Ulkoa sisään"
+
+#: editor/animation_editor.cpp
+msgid "Transitions"
+msgstr "Siirtymät"
+
+#: editor/animation_editor.cpp
+msgid "Optimize Animation"
+msgstr "Optimoi animaatio"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up Animation"
+msgstr "Siivoa animaatio"
+
+#: editor/animation_editor.cpp
+msgid "Create NEW track for %s and insert key?"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Create %d NEW tracks and insert keys?"
+msgstr ""
+
+#: editor/animation_editor.cpp editor/create_dialog.cpp
+#: editor/editor_audio_buses.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp editor/project_manager.cpp
+#: editor/script_create_dialog.cpp
+msgid "Create"
+msgstr "Luo"
+
+#: editor/animation_editor.cpp
+msgid "Anim Create & Insert"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert Track & Key"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert Key"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Change Anim Len"
+msgstr ""
+
+#: editor/animation_editor.cpp
+#, fuzzy
+msgid "Change Anim Loop"
+msgstr "Vaihda animaation toistoa"
+
+#: editor/animation_editor.cpp
+msgid "Anim Create Typed Value Key"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Scale Keys"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Call Track"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Animation zoom."
+msgstr "Animaation zoom."
+
+#: editor/animation_editor.cpp
+msgid "Length (s):"
+msgstr "Pituus (s):"
+
+#: editor/animation_editor.cpp
+msgid "Animation length (in seconds)."
+msgstr "Animaation pituus (sekunteina)."
+
+#: editor/animation_editor.cpp
+msgid "Step (s):"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Cursor step snap (in seconds)."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Enable/Disable looping in animation."
+msgstr "Ota käyttöön/poista käytöstä animaation toisto."
+
+#: editor/animation_editor.cpp
+msgid "Add new tracks."
+msgstr "Lisää uusia raitoja."
+
+#: editor/animation_editor.cpp
+msgid "Move current track up."
+msgstr "Siirrä nykyinen raita ylös."
+
+#: editor/animation_editor.cpp
+msgid "Move current track down."
+msgstr "Siirrä nykyinen raita alas."
+
+#: editor/animation_editor.cpp
+msgid "Remove selected track."
+msgstr "Poista valittu raita."
+
+#: editor/animation_editor.cpp
+msgid "Track tools"
+msgstr "Raidan työkalut"
+
+#: editor/animation_editor.cpp
+msgid "Enable editing of individual keys by clicking them."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim. Optimizer"
+msgstr "Animaation optimoija"
+
+#: editor/animation_editor.cpp
+msgid "Max. Linear Error:"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Max. Angular Error:"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Max Optimizable Angle:"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Optimize"
+msgstr "Optimoi"
+
+#: editor/animation_editor.cpp
+msgid "Select an AnimationPlayer from the Scene Tree to edit animations."
+msgstr "Valitse AnimationPlayer Scenepuusta muokataksesi animaatioita."
+
+#: editor/animation_editor.cpp
+msgid "Key"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Transition"
+msgstr "Siirtymä"
+
+#: editor/animation_editor.cpp
+msgid "Scale Ratio:"
+msgstr "Skaalaussuhde:"
+
+#: editor/animation_editor.cpp
+msgid "Call Functions in Which Node?"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Remove invalid keys"
+msgstr "Poista virheelliset avaimet"
+
+#: editor/animation_editor.cpp
+msgid "Remove unresolved and empty tracks"
+msgstr "Poista ratkaisemattomat ja tyhjät raidat"
+
+#: editor/animation_editor.cpp
+msgid "Clean-up all animations"
+msgstr "Siivoa kaikki animaatiot"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up Animation(s) (NO UNDO!)"
+msgstr "Siivoa animaatio(t) (EI VOI KUMOTA)"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up"
+msgstr "Siivoa"
+
+#: editor/array_property_edit.cpp
+msgid "Resize Array"
+msgstr "Muuta taulukon kokoa"
+
+#: editor/array_property_edit.cpp
+msgid "Change Array Value Type"
+msgstr "Vaihda taulukon arvon tyyppiä"
+
+#: editor/array_property_edit.cpp
+msgid "Change Array Value"
+msgstr "Vaihda taulukon arvoa"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "Versio:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Vakiot:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr " Tiedostot"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Kuvaus:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "Asenna"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Sulje"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Yhdistä..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Yhdistä Nodeen:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Pyydetty tiedostomuoto tuntematon:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Tallennetaan..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Yhdistä..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Testaus"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Virhe tallennettaessa resurssia!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Lataa"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Kaikki"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
+#: editor/quick_open.cpp editor/settings_config_dialog.cpp
+msgid "Search:"
+msgstr "Hae:"
+
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Hae"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "Tuo"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Sort:"
+msgstr "Lajittele:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Reverse"
+msgstr "Käänteinen"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Category:"
+msgstr "Kategoria:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Site:"
+msgstr "Sivu:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Support.."
+msgstr "Tuki..."
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Official"
+msgstr "Virallinen"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+msgid "Community"
+msgstr "Yhteisö"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Testing"
+msgstr "Testaus"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Assets ZIP File"
+msgstr ""
+
+#: editor/call_dialog.cpp
+msgid "Method List For '%s':"
+msgstr ""
+
+#: editor/call_dialog.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Call"
+msgstr "Kutsu"
+
+#: editor/call_dialog.cpp
+msgid "Method List:"
+msgstr "Metodilista:"
+
+#: editor/call_dialog.cpp
+msgid "Arguments:"
+msgstr "Argumentit:"
+
+#: editor/call_dialog.cpp
+msgid "Return:"
+msgstr "Palaa:"
+
+#: editor/code_editor.cpp
+msgid "Go to Line"
+msgstr "Mene riville"
+
+#: editor/code_editor.cpp
+msgid "Line Number:"
+msgstr "RIvinumero:"
+
+#: editor/code_editor.cpp
+msgid "No Matches"
+msgstr "Ei osumia"
+
+#: editor/code_editor.cpp
+msgid "Replaced %d occurrence(s)."
+msgstr "Korvattu %d osuvuutta."
+
+#: editor/code_editor.cpp
+msgid "Replace"
+msgstr "Korvaa"
+
+#: editor/code_editor.cpp
+msgid "Replace All"
+msgstr "Korvaa kaikki"
+
+#: editor/code_editor.cpp
+msgid "Match Case"
+msgstr "Huomioi kirjainkoko"
+
+#: editor/code_editor.cpp
+msgid "Whole Words"
+msgstr "Kokonaisia sanoja"
+
+#: editor/code_editor.cpp
+msgid "Selection Only"
+msgstr "Pelkkä valinta"
+
+#: editor/code_editor.cpp editor/editor_help.cpp
+msgid "Find"
+msgstr "Etsi"
+
+#: editor/code_editor.cpp
+msgid "Next"
+msgstr "Seuraava"
+
+#: editor/code_editor.cpp
+msgid "Not found!"
+msgstr "Ei löytynyt!"
+
+#: editor/code_editor.cpp
+msgid "Replace By"
+msgstr "Korvaa"
+
+#: editor/code_editor.cpp
+msgid "Case Sensitive"
+msgstr "Merkkikokoriippuvainen"
+
+#: editor/code_editor.cpp
+msgid "Backwards"
+msgstr "Taaksepäin"
+
+#: editor/code_editor.cpp
+msgid "Prompt On Replace"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Skip"
+msgstr "Ohita"
+
+#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom In"
+msgstr "Lähennä"
+
+#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Out"
+msgstr "Loitonna"
+
+#: editor/code_editor.cpp
+msgid "Reset Zoom"
+msgstr "Nollaa lähennys"
+
+#: editor/code_editor.cpp editor/script_editor_debugger.cpp
+msgid "Line:"
+msgstr "Rivi:"
+
+#: editor/code_editor.cpp
+msgid "Col:"
+msgstr "Kolumni:"
+
+#: editor/connections_dialog.cpp
+msgid "Method in target Node must be specified!"
+msgstr "Kohdenoden metodi täytyy määrittää!"
+
+#: editor/connections_dialog.cpp
+msgid ""
+"Target method not found! Specify a valid method or attach a script to target "
+"Node."
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Connect To Node:"
+msgstr "Yhdistä Nodeen:"
+
+#: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp
+#: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_settings.cpp
+msgid "Add"
+msgstr "Lisää"
+
+#: editor/connections_dialog.cpp editor/dependency_editor.cpp
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
+msgid "Remove"
+msgstr "Poista"
+
+#: editor/connections_dialog.cpp
+msgid "Add Extra Call Argument:"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Extra Call Arguments:"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Path to Node:"
+msgstr "Polku Nodeen:"
+
+#: editor/connections_dialog.cpp
+msgid "Make Function"
+msgstr "Tee funktio"
+
+#: editor/connections_dialog.cpp
+msgid "Deferred"
+msgstr "Lykätty"
+
+#: editor/connections_dialog.cpp
+#, fuzzy
+msgid "Oneshot"
+msgstr "Ainoa"
+
+#: editor/connections_dialog.cpp
+msgid "Connect"
+msgstr "Yhdistä"
+
+#: editor/connections_dialog.cpp
+msgid "Connect '%s' to '%s'"
+msgstr "Yhdistä '%s' '%s':n"
+
+#: editor/connections_dialog.cpp
+msgid "Connecting Signal:"
+msgstr "Yhdistävä signaali:"
+
+#: editor/connections_dialog.cpp
+msgid "Create Subscription"
+msgstr "Luo tilaus"
+
+#: editor/connections_dialog.cpp
+msgid "Connect.."
+msgstr "Yhdistä..."
+
+#: editor/connections_dialog.cpp
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Disconnect"
+msgstr "Katkaise yhteys"
+
+#: editor/connections_dialog.cpp editor/node_dock.cpp
+msgid "Signals"
+msgstr "Signaalit"
+
+#: editor/create_dialog.cpp
+msgid "Create New"
+msgstr "Luo uusi"
+
+#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/filesystem_dock.cpp
+msgid "Favorites:"
+msgstr "Suosikit:"
+
+#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
+#, fuzzy
+msgid "Recent:"
+msgstr "Viimeaikainen / Viimeaikaiset:"
+
+#: editor/create_dialog.cpp editor/editor_help.cpp
+#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
+#: editor/quick_open.cpp
+msgid "Matches:"
+msgstr "Osumat:"
+
+#: editor/dependency_editor.cpp
+msgid "Search Replacement For:"
+msgstr "Hae korvattava:"
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies For:"
+msgstr "Riippuvuudet:"
+
+#: editor/dependency_editor.cpp
+msgid ""
+"Scene '%s' is currently being edited.\n"
+"Changes will not take effect unless reloaded."
+msgstr ""
+"Sceneä '%s' muokataan parhaillaan.\n"
+"Muutokset tulevat voimaan vasta päivityksen jälkeen."
+
+#: editor/dependency_editor.cpp
+msgid ""
+"Resource '%s' is in use.\n"
+"Changes will take effect when reloaded."
+msgstr ""
+"Resurssi '%s' on käytössä.\n"
+"Muutokset tulevat voimaan päivitettäessä."
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies"
+msgstr "Riippuvuudet"
+
+#: editor/dependency_editor.cpp
+msgid "Resource"
+msgstr "Resurssi"
+
+#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
+#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
+msgid "Path"
+msgstr "Polku"
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies:"
+msgstr "Riippuvuudet:"
+
+#: editor/dependency_editor.cpp
+msgid "Fix Broken"
+msgstr "Korjaa rikkinäinen"
+
+#: editor/dependency_editor.cpp
+msgid "Dependency Editor"
+msgstr "Riippuvuusmuokkain"
+
+#: editor/dependency_editor.cpp
+msgid "Search Replacement Resource:"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Owners Of:"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid ""
+"The files being removed are required by other resources in order for them to "
+"work.\n"
+"Remove them anyway? (no undo)"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Remove selected files from the project? (no undo)"
+msgstr "Poista valitut tiedostot projektista? (ei voi kumota)"
+
+#: editor/dependency_editor.cpp
+msgid "Error loading:"
+msgstr "Virhe ladatessa:"
+
+#: editor/dependency_editor.cpp
+msgid "Scene failed to load due to missing dependencies:"
+msgstr "Scenen lataaminen epäonnistui puuttuvan riippuvuuden takia:"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+msgid "Open Anyway"
+msgstr "Avaa kuitenkin"
+
+#: editor/dependency_editor.cpp
+#, fuzzy
+msgid "Which action should be taken?"
+msgstr "Mikä toiminto pitäisi tehdä? / Mitkä toiminnot"
+
+#: editor/dependency_editor.cpp
+msgid "Fix Dependencies"
+msgstr "Korjaa riippuvuudet"
+
+#: editor/dependency_editor.cpp
+msgid "Errors loading!"
+msgstr "Virheitä ladatessa!"
+
+#: editor/dependency_editor.cpp
+#, fuzzy
+msgid "Permanently delete %d item(s)? (No undo!)"
+msgstr "Poista pysyvästi %d ? (Ei voi kumota!)"
+
+#: editor/dependency_editor.cpp
+msgid "Owns"
+msgstr "Omistaa"
+
+#: editor/dependency_editor.cpp
+msgid "Resources Without Explicit Ownership:"
+msgstr "Resurssit, joilla ei ole selvää omistajaa:"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+msgid "Orphan Resource Explorer"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Delete selected files?"
+msgstr "Poista valitut tiedostot?"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+#: editor/filesystem_dock.cpp editor/plugins/item_list_editor_plugin.cpp
+#: editor/project_export.cpp editor/scene_tree_dock.cpp
+msgid "Delete"
+msgstr "Poista"
+
+#: editor/editor_audio_buses.cpp
+msgid "Save Audio Bus Layout As.."
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Location for New Layout.."
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Open Audio Bus Layout"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Add Bus"
+msgstr "Lisää väylä"
+
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
+msgid "Load"
+msgstr "Lataa"
+
+#: editor/editor_audio_buses.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Save As"
+msgstr "Tallenna nimellä"
+
+#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
+msgid "Default"
+msgstr "Oletus"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name."
+msgstr "Virheellinen nimi."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Valid characters:"
+msgstr "Kelvolliset merkit:"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing engine class name."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing buit-in type name."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing global constant name."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid Path."
+msgstr "Virheellinen polku."
+
+#: editor/editor_autoload_settings.cpp
+msgid "File does not exist."
+msgstr "Tiedostoa ei ole olemassa."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Not in resource path."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Add AutoLoad"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Autoload '%s' already exists!"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Rename Autoload"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Toggle AutoLoad Globals"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Move Autoload"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Remove Autoload"
+msgstr "Poista automaattinen lataus"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Enable"
+msgstr "Ota käyttöön"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Rearrange Autoloads"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
+msgid "Path:"
+msgstr "Polku:"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Node Name:"
+msgstr "Noden nimi:"
+
+#: editor/editor_autoload_settings.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Name"
+msgstr "Nimi"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Singleton"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "List:"
+msgstr "Lista:"
+
+#: editor/editor_data.cpp
+msgid "Updating Scene"
+msgstr "Päivitetään sceneä"
+
+#: editor/editor_data.cpp
+msgid "Storing local changes.."
+msgstr "Varastoidaan paikalliset muutokset..."
+
+#: editor/editor_data.cpp
+msgid "Updating scene.."
+msgstr "Päivitetään sceneä..."
+
+#: editor/editor_dir_dialog.cpp
+msgid "Choose a Directory"
+msgstr "Valitse hakemisto"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: scene/gui/file_dialog.cpp
+msgid "Create Folder"
+msgstr "Luo kansio"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/editor_plugin_settings.cpp editor/plugins/theme_editor_plugin.cpp
+#: editor/project_export.cpp scene/gui/file_dialog.cpp
+msgid "Name:"
+msgstr "Nimi:"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: scene/gui/file_dialog.cpp
+msgid "Could not create folder."
+msgstr "Kansiota ei voitu luoda."
+
+#: editor/editor_dir_dialog.cpp
+msgid "Choose"
+msgstr "Valitse"
+
+#: editor/editor_export.cpp
+msgid "Storing File:"
+msgstr "Varastoidaan tiedostoa:"
+
+#: editor/editor_export.cpp
+msgid "Packing"
+msgstr "Pakataan"
+
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
+msgid "Template file not found:\n"
+msgstr "Mallitiedostoa ei löytynyt:\n"
+
+#: editor/editor_export.cpp
+msgid "Added:"
+msgstr "Lisätty:"
+
+#: editor/editor_export.cpp
+msgid "Removed:"
+msgstr "Poistettu:"
+
+#: editor/editor_export.cpp
+msgid "Error saving atlas:"
+msgstr "Virhe tallennettaessa atlas-kuvaa:"
+
+#: editor/editor_export.cpp
+msgid "Could not save atlas subtexture:"
+msgstr ""
+
+#: editor/editor_export.cpp
+msgid "Exporting for %s"
+msgstr ""
+
+#: editor/editor_export.cpp
+msgid "Setting Up.."
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "File Exists, Overwrite?"
+msgstr "Tiedosto on jo olemassa, korvaa?"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "All Recognized"
+msgstr "Kaikki tunnistettu"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "All Files (*)"
+msgstr "Kaikki tiedostot (*)"
+
+#: editor/editor_file_dialog.cpp editor/editor_help.cpp editor/editor_node.cpp
+#: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/property_selector.cpp editor/quick_open.cpp scene/gui/file_dialog.cpp
+msgid "Open"
+msgstr "Avaa"
+
+#: editor/editor_file_dialog.cpp editor/editor_node.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp scene/gui/file_dialog.cpp
+msgid "Save"
+msgstr "Tallenna"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Save a File"
+msgstr "Tallenna tiedosto"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Back"
+msgstr "Mene taaksepäin"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Forward"
+msgstr "Mene eteenpäin"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Up"
+msgstr "Mene ylös"
+
+#: editor/editor_file_dialog.cpp
+msgid "Refresh"
+msgstr "Päivitä"
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Hidden Files"
+msgstr "Näytä piilotiedostot"
+
+#: editor/editor_file_dialog.cpp
+#, fuzzy
+msgid "Toggle Favorite"
+msgstr "Näytä suosikit"
+
+#: editor/editor_file_dialog.cpp
+#, fuzzy
+msgid "Toggle Mode"
+msgstr "Näytä/piilota"
+
+#: editor/editor_file_dialog.cpp
+msgid "Focus Path"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Move Favorite Up"
+msgstr "Siirrä suosikkia ylös"
+
+#: editor/editor_file_dialog.cpp
+msgid "Move Favorite Down"
+msgstr "Siirrä suosikkia alas"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Directories & Files:"
+msgstr "Hakemistot & tiedostot:"
+
+#: editor/editor_file_dialog.cpp
+msgid "Preview:"
+msgstr "Esikatselu:"
+
+#: editor/editor_file_dialog.cpp editor/script_editor_debugger.cpp
+#: scene/gui/file_dialog.cpp
+msgid "File:"
+msgstr "Tiedosto:"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Filter:"
+msgstr "Suodatin:"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+#, fuzzy
+msgid "Must use a valid extension."
+msgstr "Käytä sopivaa laajennusta"
+
+#: editor/editor_file_system.cpp
+msgid "ScanSources"
+msgstr ""
+
+#: editor/editor_file_system.cpp
+msgid "(Re)Importing Assets"
+msgstr "Tuodaan (uudelleen) Assetteja"
+
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Search Help"
+msgstr "Hae oppaasta"
+
+#: editor/editor_help.cpp
+msgid "Class List:"
+msgstr "Luokkaluettelo:"
+
+#: editor/editor_help.cpp
+msgid "Search Classes"
+msgstr "Etsi luokkia"
+
+#: editor/editor_help.cpp editor/property_editor.cpp
+msgid "Class:"
+msgstr "Luokka:"
+
+#: editor/editor_help.cpp editor/scene_tree_editor.cpp
+msgid "Inherits:"
+msgstr "Perii:"
+
+#: editor/editor_help.cpp
+#, fuzzy
+msgid "Inherited by:"
+msgstr "Peritty:"
+
+#: editor/editor_help.cpp
+msgid "Brief Description:"
+msgstr "Lyhyt kuvaus:"
+
+#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Members:"
+msgstr "Jäsenet:"
+
+#: editor/editor_help.cpp
+msgid "Public Methods:"
+msgstr "Julkiset metodit:"
+
+#: editor/editor_help.cpp
+msgid "GUI Theme Items:"
+msgstr ""
+
+#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Signals:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Constants:"
+msgstr "Vakiot:"
+
+#: editor/editor_help.cpp
+#, fuzzy
+msgid "Property Description:"
+msgstr "Ominaisuuden kuvaus:"
+
+#: editor/editor_help.cpp
+msgid "Method Description:"
+msgstr "Metodin kuvaus:"
+
+#: editor/editor_help.cpp
+msgid "Search Text"
+msgstr "Hae tekstiä"
+
+#: editor/editor_log.cpp
+msgid " Output:"
+msgstr " Tuloste:"
+
+#: editor/editor_log.cpp editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/rich_text_editor_plugin.cpp editor/property_editor.cpp
+#: editor/script_editor_debugger.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Clear"
+msgstr "Tyhjennä"
+
+#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
+#: editor/resources_dock.cpp
+msgid "Error saving resource!"
+msgstr "Virhe tallennettaessa resurssia!"
+
+#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
+#: editor/resources_dock.cpp
+msgid "Save Resource As.."
+msgstr "Tallenna resurssi nimellä..."
+
+#: editor/editor_node.cpp editor/export_template_manager.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "I see.."
+msgstr "Ymmärrän..."
+
+#: editor/editor_node.cpp
+msgid "Can't open file for writing:"
+msgstr "Ei voida avata tiedostoa kirjoitettavaksi:"
+
+#: editor/editor_node.cpp
+msgid "Requested file format unknown:"
+msgstr "Pyydetty tiedostomuoto tuntematon:"
+
+#: editor/editor_node.cpp
+msgid "Error while saving."
+msgstr "Virhe tallennettaessa."
+
+#: editor/editor_node.cpp
+msgid "Saving Scene"
+msgstr "Tallennetaan sceneä"
+
+#: editor/editor_node.cpp
+msgid "Analyzing"
+msgstr "Analysoidaan"
+
+#: editor/editor_node.cpp
+msgid "Creating Thumbnail"
+msgstr "Luodaan pienoiskuvaa"
+
+#: editor/editor_node.cpp
+msgid ""
+"Couldn't save scene. Likely dependencies (instances) couldn't be satisfied."
+msgstr "Sceneä ei voitu tallentaa. Riippuvuuksia ei voitu tyydyttää."
+
+#: editor/editor_node.cpp
+msgid "Failed to load resource."
+msgstr "Resurssin lataaminen epäonnistui."
+
+#: editor/editor_node.cpp
+msgid "Can't load MeshLibrary for merging!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Error saving MeshLibrary!"
+msgstr "Virhe tallennettaessa MeshLibrarya!"
+
+#: editor/editor_node.cpp
+msgid "Can't load TileSet for merging!"
+msgstr "Ei voida ladata tilesetiä tuontia varten!"
+
+#: editor/editor_node.cpp
+msgid "Error saving TileSet!"
+msgstr "Virhe tallennettaessa tilesetiä!"
+
+#: editor/editor_node.cpp
+msgid "Error trying to save layout!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Default editor layout overridden."
+msgstr "Editorin oletusulkoasu ylikirjoitettu."
+
+#: editor/editor_node.cpp
+msgid "Layout name not found!"
+msgstr "Layoutin nimeä ei löytynyt!"
+
+#: editor/editor_node.cpp
+msgid "Restored default layout to base settings."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Copy Params"
+msgstr "Kopioi parametrit"
+
+#: editor/editor_node.cpp
+msgid "Paste Params"
+msgstr "Liitä parametrit"
+
+#: editor/editor_node.cpp editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Paste Resource"
+msgstr "Liitä resurssi"
+
+#: editor/editor_node.cpp
+msgid "Copy Resource"
+msgstr "Kopioi resurssi"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Make Built-In"
+msgstr "Tee sisäänrakennettu"
+
+#: editor/editor_node.cpp
+msgid "Make Sub-Resources Unique"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open in Help"
+msgstr "Avaa ohjeessa"
+
+#: editor/editor_node.cpp
+msgid "There is no defined scene to run."
+msgstr "Suoritettavaa sceneä ei ole määritetty."
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid ""
+"No main scene has ever been defined, select one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+"Pääsceneä ei ole määritetty, haluatko valita sen?\n"
+"Voit muuttaa sitä myöhemmin projektin asetuksista."
+
+#: editor/editor_node.cpp
+msgid ""
+"Selected scene '%s' does not exist, select a valid one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+"Valittua sceneä '%s' ei ole olemassa, valitse kelvollinen?\n"
+"Voit muuttaa sitä myöhemmin projektin asetuksista."
+
+#: editor/editor_node.cpp
+msgid ""
+"Selected scene '%s' is not a scene file, select a valid one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+"Valittu scene '%s' ei ole scene-tiedosto, valitse kelvollinen?\n"
+"Voit muuttaa sitä myöhemmin projektin asetuksista."
+
+#: editor/editor_node.cpp
+msgid "Current scene was never saved, please save it prior to running."
+msgstr ""
+"Nykyistä sceneä ei ole vielä tallennettu. Tallenna se ennen suorittamista."
+
+#: editor/editor_node.cpp
+msgid "Could not start subprocess!"
+msgstr "Aliprosessia ei voitu käynnistää!"
+
+#: editor/editor_node.cpp
+msgid "Open Scene"
+msgstr "Avaa scene"
+
+#: editor/editor_node.cpp
+msgid "Open Base Scene"
+msgstr "Avaa kantascene"
+
+#: editor/editor_node.cpp
+msgid "Quick Open Scene.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Quick Open Script.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Yes"
+msgstr "Kyllä"
+
+#: editor/editor_node.cpp
+msgid "Close scene? (Unsaved changes will be lost)"
+msgstr "Sulje scene? (tallentamattomat muutokset menetetään)"
+
+#: editor/editor_node.cpp
+msgid "Save Scene As.."
+msgstr "Tallenna scene nimellä..."
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Node"
+
+#: editor/editor_node.cpp
+msgid "This scene has never been saved. Save before running?"
+msgstr "Tätä sceneä ei ole koskaan tallennettu. Tallenna ennen suorittamista?"
+
+#: editor/editor_node.cpp
+msgid "Export Mesh Library"
+msgstr "Tuo Mesh-kirjasto"
+
+#: editor/editor_node.cpp
+msgid "Export Tile Set"
+msgstr "Tuo tileset"
+
+#: editor/editor_node.cpp
+msgid "Quit"
+msgstr "Lopeta"
+
+#: editor/editor_node.cpp
+msgid "Exit the editor?"
+msgstr "Poistu editorista?"
+
+#: editor/editor_node.cpp
+msgid "Current scene not saved. Open anyway?"
+msgstr "Nykyistä sceneä ei ole tallennettu. Avaa joka tapauksessa?"
+
+#: editor/editor_node.cpp
+msgid "Can't reload a scene that was never saved."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Revert"
+msgstr "Palauta"
+
+#: editor/editor_node.cpp
+msgid "This action cannot be undone. Revert anyway?"
+msgstr "Tätä toimintoa ei voida peruttaa. Palauta joka tapauksessa?"
+
+#: editor/editor_node.cpp
+msgid "Quick Run Scene.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Open Project Manager? \n"
+"(Unsaved changes will be lost)"
+msgstr ""
+"Avaa projektinhallinta?\n"
+"(tallentamattomat muutokset menetetään)"
+
+#: editor/editor_node.cpp
+msgid "Pick a Main Scene"
+msgstr "Valitse pääscene"
+
+#: editor/editor_node.cpp
+msgid ""
+"Scene '%s' was automatically imported, so it can't be modified.\n"
+"To make changes to it, a new inherited scene can be created."
+msgstr ""
+"Scene '%s' tuotiin automaattisesti, joten sitä ei voida muokata.\n"
+"Muokataksesi sitä voit luoda uuden perityn Scenen."
+
+#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/scene_tree_dock.cpp
+msgid "Ugh"
+msgstr "Äh"
+
+#: editor/editor_node.cpp
+msgid ""
+"Error loading scene, it must be inside the project path. Use 'Import' to "
+"open the scene, then save it inside the project path."
+msgstr ""
+"Virhe Scenen latauksessa, sen täytyy sijaita projektin polussa. Käytä 'Tuo' -"
+"toimintoa avataksesi Scenen ja tallenna se projektin polkuun."
+
+#: editor/editor_node.cpp
+msgid "Error loading scene."
+msgstr "Virhe ladatessa Sceneä."
+
+#: editor/editor_node.cpp
+msgid "Scene '%s' has broken dependencies:"
+msgstr "Scenellä '%s' on rikkinäisiä riippuvuuksia:"
+
+#: editor/editor_node.cpp
+msgid "Save Layout"
+msgstr "Tallenna Layout"
+
+#: editor/editor_node.cpp
+msgid "Delete Layout"
+msgstr "Poista Layout"
+
+#: editor/editor_node.cpp
+msgid "Switch Scene Tab"
+msgstr "Vaihda Scenen välilehteä"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "%d more file(s)"
+msgstr "%d muuta tiedostoa"
+
+#: editor/editor_node.cpp
+msgid "%d more file(s) or folder(s)"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
+#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Scene"
+msgstr "Scene"
+
+#: editor/editor_node.cpp
+msgid "Go to previously opened scene."
+msgstr "Mene aiemmin avattuun sceneen."
+
+#: editor/editor_node.cpp
+msgid "Next tab"
+msgstr "Seuraava välilehti"
+
+#: editor/editor_node.cpp
+msgid "Previous tab"
+msgstr "Edellinen välilehti"
+
+#: editor/editor_node.cpp
+msgid "Filter Files.."
+msgstr "Suodata tiedostot..."
+
+#: editor/editor_node.cpp
+msgid "Operations with scene files."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "New Scene"
+msgstr "Uusi Scene"
+
+#: editor/editor_node.cpp
+msgid "New Inherited Scene.."
+msgstr "Uusi peritty Scene..."
+
+#: editor/editor_node.cpp
+msgid "Open Scene.."
+msgstr "Avaa Scene..."
+
+#: editor/editor_node.cpp
+msgid "Save Scene"
+msgstr "Tallenna scene"
+
+#: editor/editor_node.cpp
+msgid "Save all Scenes"
+msgstr "Tallenna kaikki scenet"
+
+#: editor/editor_node.cpp
+msgid "Close Scene"
+msgstr "Sulje scene"
+
+#: editor/editor_node.cpp
+msgid "Close Goto Prev. Scene"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Open Recent"
+msgstr "Avaa viimeaikainen"
+
+#: editor/editor_node.cpp
+msgid "Convert To.."
+msgstr "Muunna..."
+
+#: editor/editor_node.cpp
+msgid "MeshLibrary.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "TileSet.."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Undo"
+msgstr "Peru"
+
+#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Redo"
+msgstr "Tee uudelleen"
+
+#: editor/editor_node.cpp
+msgid "Revert Scene"
+msgstr "Palauta Scene"
+
+#: editor/editor_node.cpp
+msgid "Miscellaneous project or scene-wide tools."
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Project"
+msgstr "Uusi projekti"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "Projektin asetukset"
+
+#: editor/editor_node.cpp
+msgid "Run Script"
+msgstr "Suorita skripti"
+
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Export"
+msgstr "Vie"
+
+#: editor/editor_node.cpp
+msgid "Tools"
+msgstr "Työkalut"
+
+#: editor/editor_node.cpp
+msgid "Quit to Project List"
+msgstr "Lopeta ja palaa projektiluetteloon"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Deploy with Remote Debug"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"When exporting or deploying, the resulting executable will attempt to "
+"connect to the IP of this computer in order to be debugged."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Small Deploy with Network FS"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is enabled, export or deploy will produce a minimal "
+"executable.\n"
+"The filesystem will be provided from the project by the editor over the "
+"network.\n"
+"On Android, deploy will use the USB cable for faster performance. This "
+"option speeds up testing for games with a large footprint."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Visible Collision Shapes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Collision shapes and raycast nodes (for 2D and 3D) will be visible on the "
+"running game if this option is turned on."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Visible Navigation"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Navigation meshes and polygons will be visible on the running game if this "
+"option is turned on."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Sync Scene Changes"
+msgstr "Synkronoi Scenen muutokset"
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is turned on, any changes made to the scene in the editor "
+"will be replicated in the running game.\n"
+"When used remotely on a device, this is more efficient with network "
+"filesystem."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Sync Script Changes"
+msgstr "Synkronoi skriptin muutokset"
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is turned on, any script that is saved will be reloaded on "
+"the running game.\n"
+"When used remotely on a device, this is more efficient with network "
+"filesystem."
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Muokkaa"
+
+#: editor/editor_node.cpp editor/settings_config_dialog.cpp
+msgid "Editor Settings"
+msgstr "Editorin asetukset"
+
+#: editor/editor_node.cpp
+msgid "Editor Layout"
+msgstr "Editorin ulkoasu"
+
+#: editor/editor_node.cpp
+msgid "Toggle Fullscreen"
+msgstr "Siirry koko näytön tilaan"
+
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Manage Export Templates"
+msgstr "Hallitse vietäviä Templateja"
+
+#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "Luokat"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "Sulje dokumentaatio"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "About"
+msgstr "Tietoja"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Play the project."
+msgstr "Toista projekti"
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+#, fuzzy
+msgid "Play"
+msgstr "Toista"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "Pysäytä Scene"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "Pysäytä Scene"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Lopeta Scene."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "Pysäytä"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Toista Scene"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Spins when the editor window repaints!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Update Always"
+msgstr "Päivitä aina"
+
+#: editor/editor_node.cpp
+msgid "Update Changes"
+msgstr "Päivitä muutokset"
+
+#: editor/editor_node.cpp
+msgid "Disable Update Spinner"
+msgstr "Poista päivitysanimaatio"
+
+#: editor/editor_node.cpp
+msgid "Inspector"
+msgstr "Tarkastaja"
+
+#: editor/editor_node.cpp
+msgid "Create a new resource in memory and edit it."
+msgstr "Luo uusi resurssi muistiin ja muokkaa sitä."
+
+#: editor/editor_node.cpp
+msgid "Load an existing resource from disk and edit it."
+msgstr "Lataa olemassaoleva resurssi levyltä ja muokkaa sitä."
+
+#: editor/editor_node.cpp
+msgid "Save the currently edited resource."
+msgstr "Tallenna tällä hetkellä muokattu resurssi."
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Save As.."
+msgstr "Tallenna nimellä..."
+
+#: editor/editor_node.cpp
+msgid "Go to the previous edited object in history."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Go to the next edited object in history."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "History of recently edited objects."
+msgstr "Viimeisimmin muokatut objektit."
+
+#: editor/editor_node.cpp
+msgid "Object properties."
+msgstr "Objektin ominaisuudet."
+
+#: editor/editor_node.cpp
+msgid "FileSystem"
+msgstr "Tiedostojärjestelmä"
+
+#: editor/editor_node.cpp editor/node_dock.cpp
+msgid "Node"
+msgstr "Node"
+
+#: editor/editor_node.cpp
+msgid "Output"
+msgstr "Tuloste"
+
+#: editor/editor_node.cpp editor/editor_reimport_dialog.cpp
+msgid "Re-Import"
+msgstr "Tuo uudelleen"
+
+#: editor/editor_node.cpp editor/editor_plugin_settings.cpp
+msgid "Update"
+msgstr "Päivitä"
+
+#: editor/editor_node.cpp
+msgid "Thanks from the Godot community!"
+msgstr "Kiitos Godot-yhteisöltä!"
+
+#: editor/editor_node.cpp
+msgid "Thanks!"
+msgstr "Kiitos!"
+
+#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Import Templates From ZIP File"
+msgstr "Tuo mallit ZIP-tiedostosta"
+
+#: editor/editor_node.cpp
+msgid "Export Project"
+msgstr "Vie projekti"
+
+#: editor/editor_node.cpp
+msgid "Export Library"
+msgstr "Vie kirjasto"
+
+#: editor/editor_node.cpp
+msgid "Merge With Existing"
+msgstr "Yhdistä olemassaolevaan"
+
+#: editor/editor_node.cpp
+msgid "Password:"
+msgstr "Salasana:"
+
+#: editor/editor_node.cpp
+msgid "Open & Run a Script"
+msgstr "Avaa & suorita skripti"
+
+#: editor/editor_node.cpp
+msgid "Load Errors"
+msgstr "Lataa virheet"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Avaa editorissa"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Avaa editorissa"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Avaa editorissa"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "Vie kirjasto"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Avaa editorissa"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "Avaa editorissa"
+
+#: editor/editor_plugin_settings.cpp
+msgid "Installed Plugins:"
+msgstr "Asennetut lisäosat:"
+
+#: editor/editor_plugin_settings.cpp
+msgid "Author:"
+msgstr "Tekijä:"
+
+#: editor/editor_plugin_settings.cpp
+msgid "Status:"
+msgstr "Tila:"
+
+#: editor/editor_profiler.cpp
+msgid "Stop Profiling"
+msgstr "Lopeta profilointi"
+
+#: editor/editor_profiler.cpp
+msgid "Start Profiling"
+msgstr "Aloita profilointi"
+
+#: editor/editor_profiler.cpp
+#, fuzzy
+msgid "Measure:"
+msgstr "Mittayksikkö:"
+
+#: editor/editor_profiler.cpp
+msgid "Frame Time (sec)"
+msgstr "Framen aika (sek)"
+
+#: editor/editor_profiler.cpp
+msgid "Average Time (sec)"
+msgstr "Keskimääräinen aika (sek)"
+
+#: editor/editor_profiler.cpp
+msgid "Frame %"
+msgstr "Frame %"
+
+#: editor/editor_profiler.cpp
+msgid "Fixed Frame %"
+msgstr "Kiinteä Frame %"
+
+#: editor/editor_profiler.cpp editor/script_editor_debugger.cpp
+msgid "Time:"
+msgstr "Aika:"
+
+#: editor/editor_profiler.cpp
+msgid "Inclusive"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Self"
+msgstr "Itse"
+
+#: editor/editor_profiler.cpp
+msgid "Frame #:"
+msgstr ""
+
+#: editor/editor_reimport_dialog.cpp
+#, fuzzy
+msgid "Please wait for scan to complete."
+msgstr "Ole hyvä ja odota läpikäynnin valmistumista."
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Current scene must be saved to re-import."
+msgstr "Nykyinen Scene täytyy tallentaa, jotta se voidaan tuoda uudelleen."
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Save & Re-Import"
+msgstr "Tallenna & tuo uudelleen"
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Re-Importing"
+msgstr "Tuodaan uudelleen"
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Re-Import Changed Resources"
+msgstr "Tuo uudelleen vaihtuneet resurssit"
+
+#: editor/editor_run_script.cpp
+msgid "Write your logic in the _run() method."
+msgstr "Kirjoita logiikka _run() -metodiin."
+
+#: editor/editor_run_script.cpp
+msgid "There is an edited scene already."
+msgstr "Muokattu Scene on jo olemassa."
+
+#: editor/editor_run_script.cpp
+msgid "Couldn't instance script:"
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "Did you forget the 'tool' keyword?"
+msgstr "Unohditko 'tool' hakusanan?"
+
+#: editor/editor_run_script.cpp
+msgid "Couldn't run script:"
+msgstr "Skriptiä ei voitu suorittaa:"
+
+#: editor/editor_run_script.cpp
+msgid "Did you forget the '_run' method?"
+msgstr "Unohditko '_run' -metodin?"
+
+#: editor/editor_settings.cpp
+msgid "Default (Same as Editor)"
+msgstr "Oletus (sama kuin editori)"
+
+#: editor/editor_sub_scene.cpp
+msgid "Select Node(s) to Import"
+msgstr "Valitse tuotava(t) node(t)"
+
+#: editor/editor_sub_scene.cpp
+msgid "Scene Path:"
+msgstr "Scenen polku:"
+
+#: editor/editor_sub_scene.cpp
+msgid "Import From Node:"
+msgstr "Tuo Nodesta:"
+
+#: editor/export_template_manager.cpp
+msgid "Re-Download"
+msgstr "Lataa uudelleen"
+
+#: editor/export_template_manager.cpp
+msgid "Uninstall"
+msgstr "Poista"
+
+#: editor/export_template_manager.cpp
+msgid "(Installed)"
+msgstr "(Asennettu)"
+
+#: editor/export_template_manager.cpp
+msgid "Download"
+msgstr "Lataa"
+
+#: editor/export_template_manager.cpp
+msgid "(Missing)"
+msgstr "(Puuttuva)"
+
+#: editor/export_template_manager.cpp
+msgid "(Current)"
+msgstr "(Nykyinen)"
+
+#: editor/export_template_manager.cpp
+msgid "Remove template version '%s'?"
+msgstr "Poista mallin versio '%s'?"
+
+#: editor/export_template_manager.cpp
+msgid "Can't open export templates zip."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Invalid version.txt format inside templates."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid ""
+"Invalid version.txt format inside templates. Revision is not a valid "
+"identifier."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "No version.txt found inside templates."
+msgstr "version.txt -tiedostoa ei löytynyt."
+
+#: editor/export_template_manager.cpp
+msgid "Error creating path for templates:\n"
+msgstr "Virhe luotaessa polkua mallille:\n"
+
+#: editor/export_template_manager.cpp
+msgid "Extracting Export Templates"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Importing:"
+msgstr "Tuodaan:"
+
+#: editor/export_template_manager.cpp
+msgid "Loading Export Templates"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Current Version:"
+msgstr "Nykyinen versio:"
+
+#: editor/export_template_manager.cpp
+msgid "Installed Versions:"
+msgstr "Asennetut versiot:"
+
+#: editor/export_template_manager.cpp
+msgid "Install From File"
+msgstr "Asenna tiedostosta"
+
+#: editor/export_template_manager.cpp
+msgid "Remove Template"
+msgstr "Poista malli"
+
+#: editor/export_template_manager.cpp
+msgid "Select template file"
+msgstr "Valitse mallin tiedosto"
+
+#: editor/export_template_manager.cpp
+msgid "Export Template Manager"
+msgstr ""
+
+#: editor/file_type_cache.cpp
+msgid "Can't open file_type_cache.cch for writing, not saving file type cache!"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Cannot navigate to '"
+msgstr "Ei voida navigoida '"
+
+#: editor/filesystem_dock.cpp
+msgid "Same source and destination files, doing nothing."
+msgstr "Sama lähde ja kohdetiedosto, ei toimenpiteitä."
+
+#: editor/filesystem_dock.cpp
+msgid "Same source and destination paths, doing nothing."
+msgstr "Sama lähde ja kohdepolku, ei toimenpiteitä."
+
+#: editor/filesystem_dock.cpp
+msgid "Can't move directories to within themselves."
+msgstr "Hakemisto(j)a ei voida siirtää itseensä."
+
+#: editor/filesystem_dock.cpp
+msgid "Can't operate on '..'"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Pick New Name and Location For:"
+msgstr "Valitse uusi nimi ja sijainti:"
+
+#: editor/filesystem_dock.cpp
+msgid "No files selected!"
+msgstr "Ei valittuja tiedostoja!"
+
+#: editor/filesystem_dock.cpp
+msgid "Expand all"
+msgstr "Laajenna kaikki"
+
+#: editor/filesystem_dock.cpp
+msgid "Collapse all"
+msgstr "Pienennä kaikki"
+
+#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "Näytä tiedostonhallinnassa"
+
+#: editor/filesystem_dock.cpp
+msgid "Instance"
+msgstr "Instanssi"
+
+#: editor/filesystem_dock.cpp
+msgid "Edit Dependencies.."
+msgstr "Muokkaa riippuvuuksia..."
+
+#: editor/filesystem_dock.cpp
+msgid "View Owners.."
+msgstr "Tarkastele omistajia..."
+
+#: editor/filesystem_dock.cpp
+msgid "Copy Path"
+msgstr "Kopioi polku"
+
+#: editor/filesystem_dock.cpp
+msgid "Rename or Move.."
+msgstr "Nimeä uudelleen tai siirrä..."
+
+#: editor/filesystem_dock.cpp
+msgid "Move To.."
+msgstr "Siirrä..."
+
+#: editor/filesystem_dock.cpp
+msgid "Info"
+msgstr "Tietoja"
+
+#: editor/filesystem_dock.cpp
+msgid "Re-Import.."
+msgstr "Tuo uudelleen..."
+
+#: editor/filesystem_dock.cpp
+msgid "Previous Directory"
+msgstr "Edellinen hakemisto"
+
+#: editor/filesystem_dock.cpp
+msgid "Next Directory"
+msgstr "Seuraava hakemisto"
+
+#: editor/filesystem_dock.cpp
+msgid "Re-Scan Filesystem"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Toggle folder status as Favorite"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Instance the selected scene(s) as child of the selected node."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Move"
+msgstr "Siirrä"
+
+#: editor/groups_editor.cpp
+msgid "Add to Group"
+msgstr "Lisää ryhmään"
+
+#: editor/groups_editor.cpp
+msgid "Remove from Group"
+msgstr "Poista ryhmästä"
+
+#: editor/import/resource_importer_obj.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Surface %d"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Import Scene"
+msgstr "Tuo Scene"
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Importing Scene.."
+msgstr "Tuodaan Scene..."
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Running Custom Script.."
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't load post-import script:"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Invalid/broken script for post-import (check console):"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Error running post-import script:"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Saving.."
+msgstr "Tallennetaan..."
+
+#: editor/import_dock.cpp
+msgid " Files"
+msgstr " Tiedostot"
+
+#: editor/import_dock.cpp
+msgid "Import As:"
+msgstr "Tuo nimellä:"
+
+#: editor/import_dock.cpp editor/property_editor.cpp
+#, fuzzy
+msgid "Preset.."
+msgstr "Esiasetus..."
+
+#: editor/import_dock.cpp
+msgid "Reimport"
+msgstr "Tuo uudelleen"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "No bit masks to import!"
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path is empty."
+msgstr "Kohdepolku on tyhjä."
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path must be a complete resource path."
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path must exist."
+msgstr "Kohdepolku täytyy olla olemassa."
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Save path is empty!"
+msgstr "Tallennuspolku on tyhjä!"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "Import BitMasks"
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture(s):"
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Target Path:"
+msgstr "Kohdepolku:"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Accept"
+msgstr "Hyväksy"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "Bit Mask"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "No source font file!"
+msgstr "Ei fontin lähdetiedostoa!"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "No target font resource!"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
+msgid ""
+"Invalid file extension.\n"
+"Please use .font."
+msgstr ""
+"Virheellinen tiedostolaajennus.\n"
+"Käytä .fnt -tiedostoa."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Can't load/process source font."
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Couldn't save font."
+msgstr "Fonttia ei voitu tallentaa."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Source Font:"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Source Font Size:"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Dest Resource:"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "The quick brown fox jumps over the lazy dog."
+msgstr "Ovela kettu punaturkki laiskan koiran takaa kurkki."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Test:"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Options:"
+msgstr "Asetukset:"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Font Import"
+msgstr "Fontin tuonti"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid ""
+"This file is already a Godot font file, please supply a BMFont type file "
+"instead."
+msgstr ""
+"Tämä tiedosto on jo Godotin fonttitiedosto, ole hyvä ja syötä BMFont -"
+"tiedosto."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Failed opening as BMFont file."
+msgstr "BMFont -tiedoston avaus epäonnistui."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Error initializing FreeType."
+msgstr "Virhe FreetType:n alustamisessa."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Unknown font format."
+msgstr "Tuntematon fonttimuoto."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Error loading font."
+msgstr "Virhe fontin latauksessa."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Invalid font size."
+msgstr "Virheellinen fonttikoko."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Invalid font custom source."
+msgstr "Virheellinen fontin lähde."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Font"
+msgstr "Fontti"
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "No meshes to import!"
+msgstr ""
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Single Mesh Import"
+msgstr ""
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Source Mesh(es):"
+msgstr ""
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh"
+msgstr ""
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "No samples to import!"
+msgstr ""
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Import Audio Samples"
+msgstr ""
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Source Sample(s):"
+msgstr ""
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Audio Sample"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "New Clip"
+msgstr "Uusi klippi"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Animation Options"
+msgstr "Animaation asetukset"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Flags"
+msgstr "Liput"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Bake FPS:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Optimizer"
+msgstr "Optimoija"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Linear Error"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Angular Error"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Angle"
+msgstr "Enimmäiskulma"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Clips"
+msgstr "Klippejä"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#, fuzzy
+msgid "Start(s)"
+msgstr "Alkaa"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#, fuzzy
+msgid "End(s)"
+msgstr "Loppu(u)"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+#, fuzzy
+msgid "Loop"
+msgstr "Toisto"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Filters"
+msgstr "Suodattimet"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Source path is empty."
+msgstr "Lähdepolku on tyhjä."
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't load post-import script."
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Invalid/broken script for post-import."
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Error importing scene."
+msgstr "Virhe tuotaessa Sceneä."
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import 3D Scene"
+msgstr "Tuo 3D Scene"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Source Scene:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Same as Target Scene"
+msgstr "Sama kuin kohdescene"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Shared"
+msgstr "Jaettu"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#, fuzzy
+msgid "Target Texture Folder:"
+msgstr "Kohdetekstuurin kansio:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Post-Process Script:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Custom Root Node Type:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Auto"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Root Node Name:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "The Following Files are Missing:"
+msgstr "Seuraavat tiedostot puuttuvat:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import Anyway"
+msgstr "Tuo joka tapauksessa"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp scene/gui/dialogs.cpp
+msgid "Cancel"
+msgstr "Peru"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import & Open"
+msgstr "Tuo & Avaa"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Edited scene has not been saved, open imported scene anyway?"
+msgstr ""
+"Muokattua Sceneä ei ole tallennettu, avaa tuotu Scene joka tapauksessa?"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import Image:"
+msgstr "Tuo kuva:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Can't import a file over itself:"
+msgstr "Tiedostoa ei voi tuoda itseensä:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't localize path: %s (already local)"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "3D Scene Animation"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Uncompressed"
+msgstr "Purettu"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress Lossless (PNG)"
+msgstr "Pakkaa häviötön (PNG)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress Lossy (WebP)"
+msgstr "Pakkaa häviöllinen (WebP)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress (VRAM)"
+msgstr "Pakkaa (VRAM)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Format"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Compression Quality (WebP):"
+msgstr "Tekstuurin pakkauksen latu (WebP):"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Options"
+msgstr "Tekstuurin asetukset"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Please specify some files!"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "At least one file needed for Atlas."
+msgstr "Ainakin yksi tiedosto tarvitaan Atlas-kuvaa varten."
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Error importing:"
+msgstr "Virhe tuotaessa:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Only one file is required for large texture."
+msgstr "Vain yksi tiedosto vaaditaan suurikokoiselle tekstuurille."
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Max Texture Size:"
+msgstr "Tekstuurin enimmäiskoko:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for Atlas (2D)"
+msgstr "Tuo tekstuuri Atlakselle (2D)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Cell Size:"
+msgstr "Solun koko:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Large Texture"
+msgstr "Suurikokoinen tekstuuri"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Large Textures (2D)"
+msgstr "Tuo suurikokoisia tekstuureita (2D)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture"
+msgstr "Lähdetekstuuri"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Base Atlas Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture(s)"
+msgstr "Lähdetekstuuri(t)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for 2D"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for 3D"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures"
+msgstr "Tuo tekstuurit"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "2D Texture"
+msgstr "2D tekstuuri"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "3D Texture"
+msgstr "Kolmiulotteinen tekstuuri"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Atlas Texture"
+msgstr "Atlastekstuuri"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid ""
+"NOTICE: Importing 2D textures is not mandatory. Just copy png/jpg files to "
+"the project."
+msgstr ""
+"HUOMAA: 2D tekstuurin tuonti ei ole pakollista. Voit kopioida png/jpg -"
+"tiedostot projektiin."
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Crop empty space."
+msgstr "Leikkaa pois tyhjä tila."
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture"
+msgstr "Tekstuuri"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Large Texture"
+msgstr "Tuo suurikokoinen tekstuuri"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Load Source Image"
+msgstr "Lataa lähdekuva"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#, fuzzy
+msgid "Slicing"
+msgstr "Siivutus"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Inserting"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Saving"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save large texture:"
+msgstr "Isoa tekstuuria ei voitu tallentaa:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#, fuzzy
+msgid "Build Atlas For:"
+msgstr "Luo atlas:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Loading Image:"
+msgstr "Ladataan kuvaa:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't load image:"
+msgstr "Kuvaa ei voitu ladata:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Converting Images"
+msgstr "Muunnetaan kuvia"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Cropping Images"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Blitting Images"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save atlas image:"
+msgstr "Atlas-kuvaa ei voitu tallentaa:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save converted texture:"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Invalid source!"
+msgstr "Virheellinen lähde!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Invalid translation source!"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Column"
+msgstr "Kolumni"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/script_create_dialog.cpp
+msgid "Language"
+msgstr "Kieli"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#, fuzzy
+msgid "No items to import!"
+msgstr "Ei tuotavia asioita!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "No target path!"
+msgstr "Ei kohdepolkua!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Translations"
+msgstr "Tuo käännökset"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Couldn't import!"
+msgstr "Ei voitu tuoda!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Translation"
+msgstr "Tuo käännös"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Source CSV:"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Ignore First Row"
+msgstr "Sivuuta ensimmäinen rivi"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Compress"
+msgstr "Tiivistä"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "Lisää projektiin (godot.cfg)"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Languages:"
+msgstr "Tuo kielet:"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Translation"
+msgstr "Siirtymä"
+
+#: editor/multi_node_edit.cpp
+msgid "MultiNode Set"
+msgstr ""
+
+#: editor/node_dock.cpp
+msgid "Groups"
+msgstr "Ryhmät"
+
+#: editor/node_dock.cpp
+msgid "Select a Node to edit Signals and Groups."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Toggle Autoplay"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "New Animation Name:"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "New Anim"
+msgstr "Uusi animaatio"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Change Animation Name:"
+msgstr "Vaihda animaation nimi:"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Delete Animation?"
+msgstr "Poista animaatio?"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Remove Animation"
+msgstr "Poista animaatio"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: Invalid animation name!"
+msgstr "VIRHE: Virheellinen animaation nimi!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: Animation name already exists!"
+msgstr "VIrhe: Samanniminen animaatio on jo olemassa!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Rename Animation"
+msgstr "Nimeä animaatio uudelleen"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Animation"
+msgstr "Lisää animaatio"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Blend Next Changed"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Change Blend Time"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load Animation"
+msgstr "Lataa animaatio"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Duplicate Animation"
+msgstr "Monista animaatio"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation to copy!"
+msgstr "VIRHE: Ei kopioitavaa animaatiota!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation resource on clipboard!"
+msgstr "VIRHE: Ei animaation resurssia leikepöydällä!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Pasted Animation"
+msgstr "Liitetty animaatio"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Paste Animation"
+msgstr "Liitä animaatio"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation to edit!"
+msgstr "VIRHE: Ei muokattavaa animaatiota!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation backwards from current pos. (A)"
+msgstr "Toista valittu animaatio takaperin nykyisestä kohdasta. (A)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation backwards from end. (Shift+A)"
+msgstr "Toista valittu animaatio takaperin lopusta. (Shift+A)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Stop animation playback. (S)"
+msgstr "Lopeta animaation toisto. (S)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation from start. (Shift+D)"
+msgstr "Toista valittu animaatio alusta. (Shift+D)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation from current pos. (D)"
+msgstr "Toista valittu animaatio nykyisestä kohdasta. (D)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation position (in seconds)."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Scale animation playback globally for the node."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Create new animation in player."
+msgstr "Luo uusi animaatio soittimessa."
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load animation from disk."
+msgstr "Lataa animaatio levyltä."
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load an animation from disk."
+msgstr "Lataa animaatio levyltä."
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Save the current animation"
+msgstr "Tallenna nykyinen animaatio"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Display list of animations in player."
+msgstr "Näytä lista animaatioista soittimessa."
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Autoplay on Load"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Edit Target Blend Times"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation Tools"
+msgstr "Animaatiotyökalut"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Copy Animation"
+msgstr "Kopioi animaatio"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Create New Animation"
+msgstr "Luo uusi animaatio"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation Name:"
+msgstr "Animaation nimi:"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
+#: editor/script_create_dialog.cpp
+msgid "Error!"
+msgstr "Virhe!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Blend Times:"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Next (Auto Queue):"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Cross-Animation Blend Times"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Animation"
+msgstr "Animaatio"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "New name:"
+msgstr "Uusi nimi:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Scale:"
+msgstr "Skaalaus:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Fade In (s):"
+msgstr "Häivytys sisään (s):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Fade Out (s):"
+msgstr "Häivytys ulos (s):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend"
+msgstr "Sekoita"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Mix"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Auto Restart:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Restart (s):"
+msgstr "Käynnistä uudelleen (s):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Random Restart (s):"
+msgstr "Satunnainen uudelleenaloitus (s):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Start!"
+msgstr "Aloita!"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Amount:"
+msgstr "Määrä:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend 0:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend 1:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "X-Fade Time (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Current:"
+msgstr "Nykyinen:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Add Input"
+msgstr "Lisää syöte"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Clear Auto-Advance"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Set Auto-Advance"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Delete Input"
+msgstr "Poista syöte"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Rename"
+msgstr "Nimeä uudelleen"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation tree is valid."
+msgstr "Animaatiopuu on kelvollinen."
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation tree is invalid."
+msgstr "Animaatiopuu ei ole kelvollinen."
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation Node"
+msgstr "Animaationode"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "OneShot Node"
+msgstr "OneShot Node"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Mix Node"
+msgstr "Mix Node"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend2 Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend3 Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend4 Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "TimeScale Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "TimeSeek Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Transition Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Import Animations.."
+msgstr "Tuo animaatiot..."
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Edit Node Filters"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Filters.."
+msgstr "Suodattimet..."
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Parsing %d Triangles:"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Triangle #"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Light Baker Setup:"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Parsing Geometry"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Fixing Lights"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Making BVH"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Creating Light Octree"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Creating Octree Texture"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Transfer to Lightmaps:"
+msgstr "Muunna Lightmapiksi:"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Allocating Texture #"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Baking Triangle #"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Post-Processing Texture #"
+msgstr ""
+
+#: editor/plugins/baked_light_editor_plugin.cpp
+msgid "Bake!"
+msgstr ""
+
+#: editor/plugins/baked_light_editor_plugin.cpp
+msgid "Reset the lightmap octree baking process (start over)."
+msgstr ""
+
+#: editor/plugins/camera_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Preview"
+msgstr "Esikatselu"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Configure Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid Offset:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid Step:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotation Offset:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotation Step:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Pivot"
+msgstr "Siirrä keskikohtaa"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Action"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Edit IK Chain"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Edit CanvasItem"
+msgstr "Muokkaa CanvasItemiä"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Change Anchors"
+msgstr "Muuta ankkureita"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom (%):"
+msgstr "Lähennä (%):"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Paste Pose"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Select Mode"
+msgstr "Valitse tila"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Drag: Rotate"
+msgstr "Vedä: Kierrä"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Alt+Drag: Move"
+msgstr "Alt+Vedä: Siirrä"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving)."
+msgstr ""
+"Paina 'V' vaihtaaksesi kääntökeskiötä. 'Shift+V' vetääksesi keskiötä "
+"(liikkuessa)."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Alt+RMB: Depth list selection"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Mode"
+msgstr "Siirtotila"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotate Mode"
+msgstr "Kääntötila"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid ""
+"Show a list of all objects at the position clicked\n"
+"(same as Alt+RMB in select mode)."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Click to change object's rotation pivot."
+msgstr "Klikkaa vaihtaaksesi objektin kääntökeskiötä."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Pan Mode"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Lock the selected object in place (can't be moved)."
+msgstr "Lukitse valitut objektit paikalleen (ei voi liikutella)."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Unlock the selected object (can be moved)."
+msgstr "Poista valittujen objektien lukitus (voi liikutella)."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Makes sure the object's children are not selectable."
+msgstr "Varmistaa ettei objektin lapsia voi valita."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Restores the object's children's ability to be selected."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_manager.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit"
+msgstr "Muokkaa"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Use Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Show Grid"
+msgstr "Näytä ruudukko"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Use Rotation Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap Relative"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Configure Snap.."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Use Pixel Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Expand to Parent"
+msgstr "Laajenna Parentiin"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Skeleton.."
+msgstr "Luuranko..."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Make Bones"
+msgstr "Tee luut"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear Bones"
+msgstr "Tyhjennä luut"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Bones"
+msgstr "Näytä luut"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Make IK Chain"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear IK Chain"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View"
+msgstr "Näytä/Tarkastele"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Reset"
+msgstr "Palauta lähennys"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Set.."
+msgstr "Aseta Zoomaus..."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Center Selection"
+msgstr "Valinta keskikohtaan"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Frame Selection"
+msgstr "Framen valinta"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Anchor"
+msgstr "Ankkuri"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Keys"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Key"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Key (Existing Tracks)"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Copy Pose"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear Pose"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Set a Value"
+msgstr "Aseta arvo"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap (Pixels):"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Add %s"
+msgstr "Lisää %s"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Adding %s..."
+msgstr "Lisätään %s..."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Create Node"
+msgstr "Luo Node"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Error instancing scene from %s"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "OK :("
+msgstr "Asia kunnossa :("
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "No parent to instance a child at."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "This operation requires a single selected node."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Change default type"
+msgstr "Muuta oletustyyppiä"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
+msgid "OK"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid ""
+"Drag & drop + Shift : Add node as sibling\n"
+"Drag & drop + Alt : Change node type"
+msgstr ""
+"Vedä & pudota + Shift: Lisää Node sisarena\n"
+"Vedä & pudota + Alt: Muuta Noden tyyppiä"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Create Poly"
+msgstr "Luo polygoni"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Edit Poly"
+msgstr "Muokkaa polygonia"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Edit Poly (Remove Point)"
+msgstr "Muokkaa polygonia (poista piste)"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Create a new polygon from scratch."
+msgstr "Luo uusi piste tyhjästä."
+
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+msgid "Create Poly3D"
+msgstr "Luo Poly3D"
+
+#: editor/plugins/collision_shape_2d_editor_plugin.cpp
+msgid "Set Handle"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Creating Mesh Library"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Thumbnail.."
+msgstr "Pienoiskuva..."
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Remove item %d?"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+#, fuzzy
+msgid "Add Item"
+msgstr "Lisää"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Selected Item"
+msgstr "Poista valitut"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Import from Scene"
+msgstr "Tuo Scenestä"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Update from Scene"
+msgstr "Päivitä Scenestä"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Lisää syöte"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Siirrä pistettä"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "Lataa resurssi"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr "Muokkaa käyrää"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Item %d"
+msgstr ""
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Items"
+msgstr ""
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Item List Editor"
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "Create Occluder Polygon"
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Edit existing polygon:"
+msgstr "Muokkaa olemassaolevaa polygonia:"
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "LMB: Move Point."
+msgstr "VHP: Siirrä pistettä."
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Ctrl+LMB: Split Segment."
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "RMB: Erase Point."
+msgstr "OHP: Pyyhi piste."
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Remove Point from Line2D"
+msgstr "Poista piste Line2D:stä"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Add Point to Line2D"
+msgstr "Lisää piste Line2D:hen"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Move Point in Line2D"
+msgstr "Siirrä pistettä LIne 2D:ssä"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Select Points"
+msgstr "Valitse pisteet"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Shift+Drag: Select Control Points"
+msgstr ""
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Click: Add Point"
+msgstr "Klikkaa: lisää piste"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Right Click: Delete Point"
+msgstr "Oikea klikkaus: Poista piste"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Add Point (in empty space)"
+msgstr "Lisää piste (tyhjyydessä)"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Split Segment (in line)"
+msgstr ""
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Delete Point"
+msgstr "Poista piste"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh is empty!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Static Trimesh Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Static Convex Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+#, fuzzy
+msgid "This doesn't work on scene root!"
+msgstr "Tämä ei toimi root-Scenessä!"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Shape"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Shape"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Navigation Mesh"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "MeshInstance lacks a Mesh!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh has not surface to create outlines from!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Could not create outline!"
+msgstr "Ääriviivoja ei voitu luoda!"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline"
+msgstr "Luo ääriviivat"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Static Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Static Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Collision Sibling"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Collision Sibling"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline Mesh.."
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline Mesh"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Outline Size:"
+msgstr "Ääriviivojen koko:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+#, fuzzy
+msgid "No mesh source specified (and no MultiMesh set in node)."
+msgstr "Mesh:in lähdettä ei määritetty"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No mesh source specified (and MultiMesh contains no Mesh)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (invalid path)."
+msgstr "Virheellinen Mesh:in lähde (virheellinen polku)."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (not a MeshInstance)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (contains no Mesh resource)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No surface source specified."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (invalid path)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (no geometry)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (no faces)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Parent has no solid faces to populate."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Couldn't map area."
+msgstr "Aluetta ei voitu kartoittaa."
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Select a Source Mesh:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Select a Target Surface:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate Surface"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate MultiMesh"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Target Surface:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Source Mesh:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "X-Axis"
+msgstr "X-akseli"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Y-Axis"
+msgstr "Y-akseli"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Z-Axis"
+msgstr "Z-akseli"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh Up Axis:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Rotation:"
+msgstr "Satunnainen kierto:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Tilt:"
+msgstr "Satunnainen kallistus:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Scale:"
+msgstr "Satunnainen skaalaus:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate"
+msgstr ""
+
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Create Navigation Polygon"
+msgstr ""
+
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Remove Poly And Point"
+msgstr "Poista polygoni ja piste"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "Luo AABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Error loading image:"
+msgstr "Virhe ladattaessa kuvaa:"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "No pixels with transparency > 128 in image.."
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Set Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Generate Visibility Rect"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Load Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Generated Point Count:"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Keskimääräinen aika (sek)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "Luo Scenestä"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Node does not contain geometry."
+msgstr "Node ei sisällä geometriaa."
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Node does not contain geometry (faces)."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Faces contain no area!"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "No faces!"
+msgstr "Ei pintoja!"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate AABB"
+msgstr "Luo AABB"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emission Points From Mesh"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emission Points From Node"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Clear Emitter"
+msgstr "Tyhjennä säteilijä/lähetin"
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Create Emitter"
+msgstr "Luo säteilijä/lähetin"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Points:"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Surface Points"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Surface Points+Normal (Directed)"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Volume"
+msgstr "Äänenvoimakkuus"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "Luo AABB"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
+msgstr "Poista pisteet käyrästä"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "Poista pisteet käyrästä"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "Poista pisteet käyrästä"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Add Point to Curve"
+msgstr "Lisää käyrään piste"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move Point in Curve"
+msgstr "Siirrä pistettä käyrällä"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move In-Control in Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move Out-Control in Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Select Control Points (Shift+Drag)"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Split Segment (in curve)"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Close Curve"
+msgstr "Sulje käyrä"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Curve Point #"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve Point Pos"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve In Pos"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve Out Pos"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Split Path"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove Path Point"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Poista polygoni ja piste"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "Poista polygoni ja piste"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Create UV Map"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Transform UV Map"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Polygon 2D UV Editor"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Move Point"
+msgstr "Siirrä pistettä"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Ctrl: Rotate"
+msgstr "Ctrl: Pyöritä/kierrä"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Shift: Move All"
+msgstr "Shift: Siirrä kaikkia"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Shift+Ctrl: Scale"
+msgstr "Shift+Ctrl: Skaalaa"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Move Polygon"
+msgstr "Siirrä polygonia"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Rotate Polygon"
+msgstr "Käännä polygonia"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Scale Polygon"
+msgstr "Skaalaa polygonia"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Polygon->UV"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "UV->Polygon"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Clear UV"
+msgstr "Tyhjennä UV"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Snap"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Enable Snap"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid"
+msgstr "Ruudukko"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "ERROR: Couldn't load resource!"
+msgstr "VIRHE: Resurssia ei voitu ladata!"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Add Resource"
+msgstr "Lisää resurssi"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Rename Resource"
+msgstr "Nimeä resurssi uudelleen"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Delete Resource"
+msgstr "Poista resurssi"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Resource clipboard is empty!"
+msgstr "Resurssien leikepöytä on tyhjä!"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Load Resource"
+msgstr "Lataa resurssi"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
+#: editor/resources_dock.cpp scene/gui/line_edit.cpp scene/gui/text_edit.cpp
+msgid "Paste"
+msgstr "Liitä"
+
+#: editor/plugins/rich_text_editor_plugin.cpp
+msgid "Parse BBCode"
+msgstr "Liitä BBCode"
+
+#: editor/plugins/sample_editor_plugin.cpp
+msgid "Length:"
+msgstr "Pituus:"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Open Sample File(s)"
+msgstr "Avaa Sample-tiedosto(t)"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "ERROR: Couldn't load sample!"
+msgstr "VIRHE: Samplea ei voitu ladata!"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Add Sample"
+msgstr "Lisää Sample"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Rename Sample"
+msgstr "Nimeä Sample uudelleen"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Delete Sample"
+msgstr "Poista Sample"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "16 Bits"
+msgstr "16 bittiä"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "8 Bits"
+msgstr "8 bittiä"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stereo"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Mono"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Format"
+msgstr "Muoto"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Pitch"
+msgstr "Sävelkorkeus"
+
+#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "Tyhjennä luut"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error while saving theme"
+msgstr "Virhe tallennettaessa teemaa"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error saving"
+msgstr "Virhe tallennettaessa"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error importing theme"
+msgstr "Virhe tuotaessa teemaa"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error importing"
+msgstr "Virhe tuonnissa"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Import Theme"
+msgstr "Tuo teema"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme As.."
+msgstr "Tallenna teema nimellä..."
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Next script"
+msgstr "Seuraava skripti"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Previous script"
+msgstr "Edellinen skripti"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "File"
+msgstr "Tiedosto"
+
+#: editor/plugins/script_editor_plugin.cpp editor/property_editor.cpp
+msgid "New"
+msgstr "Uusi"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save All"
+msgstr "Tallenna kaikki"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Soft Reload Script"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "History Prev"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "History Next"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Reload Theme"
+msgstr "Lataa teema uudelleen"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme"
+msgstr "Tallenna teema"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme As"
+msgstr "Tallenna teema nimellä"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close Docs"
+msgstr "Sulje dokumentaatio"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close All"
+msgstr "Sulje kaikki"
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find.."
+msgstr "Etsi..."
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find Next"
+msgstr "Etsi seuraava"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+#, fuzzy
+msgid "Step Over"
+msgstr "Ohita"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Step Into"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Break"
+msgstr "Keskeytä"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Continue"
+msgstr "Jatka"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Keep Debugger Open"
+msgstr "Pidä debuggeri auki"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Window"
+msgstr "Ikkuna"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Move Left"
+msgstr "Siirry vasemmalle"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Move Right"
+msgstr "Siirry oikealle"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Open Godot online documentation"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search the class hierarchy."
+msgstr "Etsi luokkahierarkia."
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search the reference documentation."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Go to previous edited document."
+msgstr "Mene edelliseen muokattuun dokumenttiin."
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Go to next edited document."
+msgstr "Mene seuraavaan muokattuun dokumenttiin."
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Discard"
+msgstr "Hylkää"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Create Script"
+msgstr "Luo skripti"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid ""
+"The following files are newer on disk.\n"
+"What action should be taken?:"
+msgstr ""
+"Seuraavat tiedostot ovat uudempia.\n"
+"MItä toimenpiteitä tulisi suorittaa?:"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Reload"
+msgstr "Lataa uudelleen"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Resave"
+msgstr "Tallenna uudelleen"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Debugger"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid ""
+"Built-in scripts can only be edited when the scene they belong to is loaded"
+msgstr ""
+"Sisäänrakennettuja skriptejä voi muokata ainoastaan kun Scene, johon ne "
+"kuuluvat, on ladattu"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Pick Color"
+msgstr "Poimi väri"
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "Muunnetaan kuvia"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Cut"
+msgstr "Leikkaa"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/property_editor.cpp
+#: editor/resources_dock.cpp scene/gui/line_edit.cpp scene/gui/text_edit.cpp
+msgid "Copy"
+msgstr "Kopioi"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Select All"
+msgstr "Valitse kaikki"
+
+#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
+msgid "Move Up"
+msgstr "Siirrä ylös"
+
+#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
+msgid "Move Down"
+msgstr "Siirrä alas"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Indent Left"
+msgstr "Sisennä vasemmalle"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Indent Right"
+msgstr "Sisennä oikealle"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Toggle Comment"
+msgstr "Näytä/Piilota kommentit"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Clone Down"
+msgstr "Kloonaa alas"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Complete Symbol"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Trim Trailing Whitespace"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Auto Indent"
+msgstr "Automaattinen sisennys"
+
+#: editor/plugins/script_text_editor.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Toggle Breakpoint"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Remove All Breakpoints"
+msgstr "Poista kaikki breakpointit"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Next Breakpoint"
+msgstr "Mene seuraavaan breakpointiin"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Previous Breakpoint"
+msgstr "Mene edelliseen breakpointiin"
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "Muunna..."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Muunna..."
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find Previous"
+msgstr "Etsi edellinen"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Replace.."
+msgstr "Korvaa..."
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Function.."
+msgstr "Mene funktioon..."
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Goto Line.."
+msgstr "Mene riville..."
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Contextual Help"
+msgstr ""
+
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Scalar Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Toggle Rot Only"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Function"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Function"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Default Value"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change XForm Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Texture Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Cubemap Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Comment"
+msgstr "Vaihda kommenttia"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add/Remove to Color Ramp"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add/Remove to Curve Map"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Curve Map"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Input Name"
+msgstr "Vaihda syötteen nimi"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Connect Graph Nodes"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Disconnect Graph Nodes"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Remove Shader Graph Node"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Move Shader Graph Node"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Duplicate Graph Node(s)"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Delete Shader Graph Node(s)"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Error: Cyclic Connection Link"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Error: Missing Input Connections"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add Shader Graph Node"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Orthogonal"
+msgstr "Ortogonaalinen"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Perspective"
+msgstr "Perspektiivi"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Aborted."
+msgstr "Muunnos keskeytetty."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "X-Axis Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Y-Axis Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Z-Axis Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Plane Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scaling to %s%%."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotating %s degrees."
+msgstr "Kierto %s astetta."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom View."
+msgstr "Pohjanäkymä."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom"
+msgstr "Pohja"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top View."
+msgstr "Pintanäkymä."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top"
+msgstr "Pinta"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear View."
+msgstr "Takanäkymä."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Rear"
+msgstr "Taka/perä"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front View."
+msgstr "Etunäkymä."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front"
+msgstr "Etu"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left View."
+msgstr "Vasen näkymä."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left"
+msgstr "Vasen"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right View."
+msgstr "Oikea näkymä."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right"
+msgstr "OIkea"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Keying is disabled (no key inserted)."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Animation Key Inserted."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Mene eteenpäin"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "Taaksepäin"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Rulla alas."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Päivitä muutokset"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Päivitä muutokset"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "Päivitä muutokset"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "Ominaisuudet:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align with view"
+msgstr "Kohdista näkymään"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Normal"
+msgstr "Näytä normaali"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Wireframe"
+msgstr "Näytä rautalankamalli"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Overdraw"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Näytä varjoton"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Environment"
+msgstr "Ympäristö"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Näytä ruudukko"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Move Mode (W)"
+msgstr "Siirtotila (W)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate Mode (E)"
+msgstr "Kääntötila (E)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale Mode (R)"
+msgstr "Skaalaustila (R)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom View"
+msgstr "Pohjanäkymä"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top View"
+msgstr "Huippunäkymä"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear View"
+msgstr "Takanäkymä"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front View"
+msgstr "Etunäkymä"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left View"
+msgstr "Vasen näkymä"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right View"
+msgstr "Oikea näkymä"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Switch Perspective/Orthogonal view"
+msgstr "Vaihda perspektiiviseen/ortogonaaliseen näkymään"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Insert Animation Key"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Focus Origin"
+msgstr "Kohdista origoon"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Focus Selection"
+msgstr "Kohdista valintaan"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align Selection With View"
+msgstr "Kohdista valinta näkymään"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "Valitse"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "Siirrä"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: Pyöritä/kierrä"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "Skaalaus:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform"
+msgstr "Muunna"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Local Coords"
+msgstr "Paikalliset koordinaatit"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "1 Viewport"
+msgstr "1 näyttöruutu"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "2 Viewports"
+msgstr "2 näyttöruutua"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "2 Viewports (Alt)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "3 Viewports"
+msgstr "3 näyttöruutua"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "3 Viewports (Alt)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "4 Viewports"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Origin"
+msgstr "Näytä origo"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Grid"
+msgstr "Näytä ruudukko"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Asetukset"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Snap Settings"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Translate Snap:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate Snap (deg.):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale Snap (%):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Viewport Settings"
+msgstr "Näyttöruudun asetukset"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Perspective FOV (deg.):"
+msgstr "Näkökentän perspektiivi (ast.):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Z-Near:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Z-Far:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Change"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Translate:"
+msgstr "Käännä:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate (deg.):"
+msgstr "Kierrä (ast.):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale (ratio):"
+msgstr "Skaalaa (kuvasuhde):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Type"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Pre"
+msgstr "Esi"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Post"
+msgstr "Jälki"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "ERROR: Couldn't load frame resource!"
+msgstr "VIRHE: Ei voitu ladata framen resurssia!"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Frame"
+msgstr "Lisää frame"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Resource clipboard is empty or not a texture!"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Paste Frame"
+msgstr "Liitä frame"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Empty"
+msgstr "Lisää tyhjä"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Change Animation Loop"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Change Animation FPS"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "(empty)"
+msgstr "(tyhjä)"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Animations"
+msgstr "Animaatiot"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Speed (FPS):"
+msgstr "Nopeus (FPS):"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Animation Frames"
+msgstr "Animaatioframet"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Insert Empty (Before)"
+msgstr "Syötä tyhjä (ennen)"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Insert Empty (After)"
+msgstr "Syötä tyhjä (jälkeen)"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Up"
+msgstr "Ylös"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Down"
+msgstr "Alas"
+
+#: editor/plugins/style_box_editor_plugin.cpp
+msgid "StyleBox Preview:"
+msgstr "StyleBox:in esikatselu:"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Snap Mode:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "<None>"
+msgstr "<Ei mitään>"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Pixel Snap"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Grid Snap"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Auto Slice"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Offset:"
+msgstr "Offset:"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Step:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Separation:"
+msgstr "Erotus:"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Texture Region"
+msgstr "Tekstuurialue"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Texture Region Editor"
+msgstr "Tekstuurialueen editori"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Can't save theme to file:"
+msgstr "Teemaa ei voi tallentaa tiedostoon:"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Add All Items"
+msgstr "Lisää kaikki"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add All"
+msgstr "Lisää kaikki"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Remove Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Theme"
+msgstr "Teema"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add Class Items"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Remove Class Items"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Create Empty Template"
+msgstr "Luo tyhjä Template"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Create Empty Editor Template"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "CheckBox Radio1"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "CheckBox Radio2"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Check Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Has"
+msgstr "On"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Many"
+msgstr "Moni(a)/Monta"
+
+#: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp
+msgid "Options"
+msgstr "Asetukset"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Have,Many,Several,Options!"
+msgstr "On,Monia,Useita,Asetuksia"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 1"
+msgstr "Välilehti 1"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 2"
+msgstr "Välilehti 2"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 3"
+msgstr "Välilehti 3"
+
+#: editor/plugins/theme_editor_plugin.cpp editor/project_settings.cpp
+#: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp
+msgid "Type:"
+msgstr "Tyyppi:"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Data Type:"
+msgstr "Tietotyyppi:"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Icon"
+msgstr "Kuvake"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Style"
+msgstr "Tyyli"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Color"
+msgstr "Väri"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Paint TileMap"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Duplicate"
+msgstr "Monista"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Erase TileMap"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Erase selection"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Find tile"
+msgstr "Etsi tile"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Transpose"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Mirror X"
+msgstr "Peilaa X"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Mirror Y"
+msgstr "Peilaa Y"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Bucket"
+msgstr "Sanko"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Pick Tile"
+msgstr "Poimi tile"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Select"
+msgstr "Valitse"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 0 degrees"
+msgstr "Käännä 0 astetta"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 90 degrees"
+msgstr "Käännä 90 astetta"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 180 degrees"
+msgstr "Käännä 180 astetta"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 270 degrees"
+msgstr "Käännä 270 astetta"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Could not find tile:"
+msgstr "Tileä ei löytynyt:"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Item name or ID:"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Create from scene?"
+msgstr "Luo Scenestä?"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Merge from scene?"
+msgstr "Yhdistä Scenestä?"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Create from Scene"
+msgstr "Luo Scenestä"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Merge from Scene"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Error"
+msgstr "Virhe"
+
+#: editor/project_export.cpp
+msgid "Runnable"
+msgstr "Suoritettava"
+
+#: editor/project_export.cpp
+msgid "Delete patch '"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Delete preset '%s'?"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Presets"
+msgstr ""
+
+#: editor/project_export.cpp editor/project_settings.cpp
+msgid "Add.."
+msgstr "Lisää..."
+
+#: editor/project_export.cpp
+msgid "Resources"
+msgstr "Resurssit"
+
+#: editor/project_export.cpp
+msgid "Export all resources in the project"
+msgstr "Vie kaikki projektin resurssit"
+
+#: editor/project_export.cpp
+msgid "Export selected scenes (and dependencies)"
+msgstr "Vie valitut Scenet (ja riippuvuudet)"
+
+#: editor/project_export.cpp
+msgid "Export selected resources (and dependencies)"
+msgstr "Vie valitut resurssit (ja riippuvuudet)"
+
+#: editor/project_export.cpp
+msgid "Export Mode:"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Resources to export:"
+msgstr "Vietävät resurssit:"
+
+#: editor/project_export.cpp
+msgid ""
+"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid ""
+"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Patches"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Make Patch"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export templates for this platform are missing:"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export With Debug"
+msgstr "Vie debugaten"
+
+#: editor/project_manager.cpp
+msgid "Invalid project path, the path must exist!"
+msgstr "Virheellinen projektin polku, polku täytyy olla olemassa!"
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Virheellinen projektin polku, godot.cfg -tiedostoa ei saa olla."
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr ""
+"Virheellinen projektin polku, godot.cfg -tiedosto täytyy olla olemassa."
+
+#: editor/project_manager.cpp
+msgid "Imported Project"
+msgstr "Tuotu projekti"
+
+#: editor/project_manager.cpp
+msgid "Invalid project path (changed anything?)."
+msgstr "Virheellinen projektin polku (muuttuiko mikään?)."
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "Ei voitu luoda godot.cfg -tiedostoa projektin polkuun."
+
+#: editor/project_manager.cpp
+msgid "The following files failed extraction from package:"
+msgstr "Seuraavien tiedostojen purku paketista epäonnistui:"
+
+#: editor/project_manager.cpp
+msgid "Package Installed Successfully!"
+msgstr "Paketti asennettu onnistuneesti!"
+
+#: editor/project_manager.cpp
+msgid "Import Existing Project"
+msgstr "Tuo olemassaoleva projekti"
+
+#: editor/project_manager.cpp
+msgid "Project Path (Must Exist):"
+msgstr "Projektin polku (täytyy olla olemassa):"
+
+#: editor/project_manager.cpp
+msgid "Project Name:"
+msgstr "Projektin nimi:"
+
+#: editor/project_manager.cpp
+msgid "Create New Project"
+msgstr "Luo uusi projekti"
+
+#: editor/project_manager.cpp
+msgid "Project Path:"
+msgstr "Projektin polku:"
+
+#: editor/project_manager.cpp
+msgid "Install Project:"
+msgstr "Asenna projekti:"
+
+#: editor/project_manager.cpp
+msgid "Browse"
+msgstr "Selaa"
+
+#: editor/project_manager.cpp
+msgid "New Game Project"
+msgstr "Uusi peliprojekti"
+
+#: editor/project_manager.cpp
+msgid "That's a BINGO!"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Unnamed Project"
+msgstr "Nimetön projekti"
+
+#: editor/project_manager.cpp
+msgid "Are you sure to open more than one project?"
+msgstr "Haluatko varmasti avata useamman kuin yhden projektin?"
+
+#: editor/project_manager.cpp
+msgid "Are you sure to run more than one project?"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Remove project from the list? (Folder contents will not be modified)"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid ""
+"You are about the scan %s folders for existing Godot projects. Do you "
+"confirm?"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Project Manager"
+msgstr "Projektinhallinta"
+
+#: editor/project_manager.cpp
+msgid "Project List"
+msgstr "Projektiluettelo"
+
+#: editor/project_manager.cpp
+msgid "Run"
+msgstr "Aja"
+
+#: editor/project_manager.cpp
+msgid "Scan"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Select a Folder to Scan"
+msgstr "Valitse skannattava kansio"
+
+#: editor/project_manager.cpp
+msgid "New Project"
+msgstr "Uusi projekti"
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Poista malli"
+
+#: editor/project_manager.cpp
+msgid "Exit"
+msgstr "Poistu"
+
+#: editor/project_settings.cpp
+msgid "Key "
+msgstr "Näppäin... "
+
+#: editor/project_settings.cpp
+msgid "Joy Button"
+msgstr "Joystick-painike"
+
+#: editor/project_settings.cpp
+msgid "Joy Axis"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Mouse Button"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Invalid action (anything goes but '/' or ':')."
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Action '%s' already exists!"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Rename Input Action Event"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Add Input Action Event"
+msgstr ""
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Meta+"
+msgstr ""
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Shift+"
+msgstr ""
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Alt+"
+msgstr ""
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "Control+"
+msgstr ""
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "Press a Key.."
+msgstr "Paina näppäintä..."
+
+#: editor/project_settings.cpp
+msgid "Mouse Button Index:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Left Button"
+msgstr "Vasen painike"
+
+#: editor/project_settings.cpp
+msgid "Right Button"
+msgstr "Oikea painike"
+
+#: editor/project_settings.cpp
+msgid "Middle Button"
+msgstr "Keskipainike"
+
+#: editor/project_settings.cpp
+msgid "Wheel Up Button"
+msgstr "Rulla ylös painike"
+
+#: editor/project_settings.cpp
+msgid "Wheel Down Button"
+msgstr "Rulla alas painike"
+
+#: editor/project_settings.cpp
+msgid "Button 6"
+msgstr "Painike 6"
+
+#: editor/project_settings.cpp
+msgid "Button 7"
+msgstr "Painike 7"
+
+#: editor/project_settings.cpp
+msgid "Button 8"
+msgstr "Painike 8"
+
+#: editor/project_settings.cpp
+msgid "Button 9"
+msgstr "Painike 9"
+
+#: editor/project_settings.cpp
+msgid "Joypad Axis Index:"
+msgstr ""
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Axis"
+msgstr "Akseli"
+
+#: editor/project_settings.cpp
+msgid "Joypad Button Index:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Add Input Action"
+msgstr "Lisää syöttötapahtuma"
+
+#: editor/project_settings.cpp
+msgid "Erase Input Action Event"
+msgstr ""
+
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "Lisää tyhjä"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Device"
+msgstr "Laite"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Button"
+msgstr "Painike"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Left Button."
+msgstr "Vasen painike."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Right Button."
+msgstr "Oikea painike."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Middle Button."
+msgstr "Keskimmäinen painike."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Wheel Up."
+msgstr "Rulla ylös."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Wheel Down."
+msgstr "Rulla alas."
+
+#: editor/project_settings.cpp
+msgid "Error saving settings."
+msgstr "Virhe tallennettaessa asetuksia."
+
+#: editor/project_settings.cpp
+msgid "Settings saved OK."
+msgstr "Asetukset tallennettu onnistuneesti."
+
+#: editor/project_settings.cpp
+msgid "Add Translation"
+msgstr "Lisää käännös"
+
+#: editor/project_settings.cpp
+msgid "Remove Translation"
+msgstr "Poista käännös"
+
+#: editor/project_settings.cpp
+msgid "Add Remapped Path"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Resource Remap Add Remap"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Change Resource Remap Language"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Remove Resource Remap"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Remove Resource Remap Option"
+msgstr ""
+
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Projektin asetukset"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "General"
+msgstr ""
+
+#: editor/project_settings.cpp editor/property_editor.cpp
+msgid "Property:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Del"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Copy To Platform.."
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Input Map"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Action:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Device:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Index:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Localization"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Translations"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Translations:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Remaps"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Resources:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Remaps by Locale:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Locale"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "AutoLoad"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Pick a Viewport"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Ease In"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Ease Out"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Zero"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Easing In-Out"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Easing Out-In"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "File.."
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Dir.."
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Assign"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "New Script"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Show in File System"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Error loading file: Not a resource!"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Pick a Node"
+msgstr "Poimi Node"
+
+#: editor/property_editor.cpp
+msgid "Bit %d, val %d."
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "On"
+msgstr ""
+
+#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Set"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Properties:"
+msgstr "Ominaisuudet:"
+
+#: editor/property_editor.cpp
+msgid "Sections:"
+msgstr ""
+
+#: editor/property_selector.cpp
+msgid "Select Property"
+msgstr "Valitse ominaisuus"
+
+#: editor/property_selector.cpp
+msgid "Select Method"
+msgstr "Valitse metodi"
+
+#: editor/pvrtc_compress.cpp
+msgid "Could not execute PVRTC tool:"
+msgstr ""
+
+#: editor/pvrtc_compress.cpp
+msgid "Can't load back converted image using PVRTC tool:"
+msgstr ""
+
+#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
+msgid "Reparent Node"
+msgstr ""
+
+#: editor/reparent_dialog.cpp
+msgid "Reparent Location (Select new Parent):"
+msgstr ""
+
+#: editor/reparent_dialog.cpp
+msgid "Keep Global Transform"
+msgstr ""
+
+#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
+msgid "Reparent"
+msgstr ""
+
+#: editor/resources_dock.cpp
+msgid "Create New Resource"
+msgstr ""
+
+#: editor/resources_dock.cpp
+msgid "Open Resource"
+msgstr ""
+
+#: editor/resources_dock.cpp
+msgid "Save Resource"
+msgstr ""
+
+#: editor/resources_dock.cpp
+msgid "Resource Tools"
+msgstr ""
+
+#: editor/resources_dock.cpp
+msgid "Make Local"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Run Mode:"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Current Scene"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Main Scene"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Main Scene Arguments:"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Scene Run Settings"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "No parent to instance the scenes at."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Error loading scene from %s"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Ok"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Cannot instance the scene '%s' because the current scene exists within one "
+"of its nodes."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Instance Scene(s)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done on the tree root."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Move Node In Parent"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Move Nodes In Parent"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Duplicate Node(s)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete Node(s)?"
+msgstr "Poista Node(t)?"
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done without a scene."
+msgstr "Tätä toimintoa ei voi tehdä ilman Sceneä."
+
+#: editor/scene_tree_dock.cpp
+msgid "Can not perform with the root node."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done on instanced scenes."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Save New Scene As.."
+msgstr "Tallenna uusi scene nimellä..."
+
+#: editor/scene_tree_dock.cpp
+msgid "Makes Sense!"
+msgstr "Käy järkeen!"
+
+#: editor/scene_tree_dock.cpp
+msgid "Can't operate on nodes from a foreign scene!"
+msgstr "Ei voida käyttää ulkopuolisen scenen nodeja!"
+
+#: editor/scene_tree_dock.cpp
+msgid "Can't operate on nodes the current scene inherits from!"
+msgstr "Ei voida käyttää nodeja, jotka periytyvät nykyisestä scenestä!"
+
+#: editor/scene_tree_dock.cpp
+msgid "Remove Node(s)"
+msgstr "Poista Node(t)"
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Couldn't save new scene. Likely dependencies (instances) couldn't be "
+"satisfied."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Error saving scene."
+msgstr "Virhe tallennettaessa sceneä."
+
+#: editor/scene_tree_dock.cpp
+msgid "Error duplicating scene to save it."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Resurssit"
+
+#: editor/scene_tree_dock.cpp
+msgid "Edit Groups"
+msgstr "Muokkaa ryhmiä"
+
+#: editor/scene_tree_dock.cpp
+msgid "Edit Connections"
+msgstr "Muokkaa yhteyksiä"
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete Node(s)"
+msgstr "Poista Node(t)"
+
+#: editor/scene_tree_dock.cpp
+msgid "Add Child Node"
+msgstr "Lisää lapsinode"
+
+#: editor/scene_tree_dock.cpp
+msgid "Instance Child Scene"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Change Type"
+msgstr "Muuta tyyppiä"
+
+#: editor/scene_tree_dock.cpp
+msgid "Attach Script"
+msgstr "Liitä skripti"
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear Script"
+msgstr "Tyhjennä skripti"
+
+#: editor/scene_tree_dock.cpp
+msgid "Merge From Scene"
+msgstr "Yhdistä scenestä"
+
+#: editor/scene_tree_dock.cpp
+msgid "Save Branch as Scene"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Copy Node Path"
+msgstr "Kopioi Noden polku"
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete (No Confirm)"
+msgstr "Poista (ei varmistusta)"
+
+#: editor/scene_tree_dock.cpp
+msgid "Add/Create a New Node"
+msgstr "Lisää/Luo uusi Node"
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Instance a scene file as a Node. Creates an inherited scene if no root node "
+"exists."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Attach a new or existing script for the selected node."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear a script for the selected node."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Spatial Visible"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle CanvasItem Visible"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Debug-asetukset"
+
+#: editor/scene_tree_editor.cpp
+msgid "Instance:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Seuraava skripti"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Invalid node name, the following characters are not allowed:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Rename Node"
+msgstr "Nimeä Node uudelleen"
+
+#: editor/scene_tree_editor.cpp
+msgid "Scene Tree (Nodes):"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Editable Children"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Load As Placeholder"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Discard Instancing"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Open in Editor"
+msgstr "Avaa editorissa"
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear Inheritance"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear Inheritance? (No Undo!)"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear!"
+msgstr "Tyhjennä!"
+
+#: editor/scene_tree_editor.cpp
+msgid "Select a Node"
+msgstr "Valitse Node"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Ei voitu luoda skriptiä tiedostojärjestelmään."
+
+#: editor/script_create_dialog.cpp
+msgid "Error loading script from %s"
+msgstr "Virhe ladattaessa skripti %s:stä"
+
+#: editor/script_create_dialog.cpp
+msgid "Path is empty"
+msgstr "Polku on tyhjä"
+
+#: editor/script_create_dialog.cpp
+msgid "Path is not local"
+msgstr "Polku ei ole paikallinen"
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid base path"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid extension"
+msgstr "Virheellinen laajennus"
+
+#: editor/script_create_dialog.cpp
+msgid "Wrong extension chosen"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Virheellinen polku."
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid class name"
+msgstr "Virheellinen luokan nimi"
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid inherited parent name or path"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Script valid"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "N/A"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in script (into scene file)"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Create new script file"
+msgstr "Luo uusi skripti"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Load existing script file"
+msgstr "Lataa olemassaoleva skripti"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Inherits"
+msgstr "Perii:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
+msgstr "Luokan nimi:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr "Poista malli"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
+msgstr "Sisäänrakennettu skripti"
+
+#: editor/script_create_dialog.cpp
+msgid "Attach Node Script"
+msgstr "Liitä Noden skripti"
+
+#: editor/script_editor_debugger.cpp
+msgid "Bytes:"
+msgstr "Tavu(j)a:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Warning"
+msgstr "Varoitus"
+
+#: editor/script_editor_debugger.cpp
+msgid "Error:"
+msgstr "Virhe:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Source:"
+msgstr "Lähde:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Function:"
+msgstr "Funktio:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Errors"
+msgstr "Virheet"
+
+#: editor/script_editor_debugger.cpp
+msgid "Child Process Connected"
+msgstr "Lapsiprosessi yhdistetty"
+
+#: editor/script_editor_debugger.cpp
+msgid "Inspect Previous Instance"
+msgstr "Tarkastele edellistä instanssia"
+
+#: editor/script_editor_debugger.cpp
+msgid "Inspect Next Instance"
+msgstr "Tarkastele seuraavaa instanssia"
+
+#: editor/script_editor_debugger.cpp
+msgid "Stack Frames"
+msgstr "Pinoa Framet"
+
+#: editor/script_editor_debugger.cpp
+msgid "Variable"
+msgstr "Muuttuja"
+
+#: editor/script_editor_debugger.cpp
+msgid "Errors:"
+msgstr "Virheet:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Stack Trace (if applicable):"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Remote Inspector"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Live Scene Tree:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Remote Object Properties: "
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Profiler"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Monitor"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Value"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Monitors"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "List of Video Memory Usage by Resource:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Total:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Video Mem"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Resource Path"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Type"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Usage"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Misc"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Clicked Control:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Clicked Control Type:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Live Edit Root:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Set From Tree"
+msgstr ""
+
+#: editor/settings_config_dialog.cpp
+msgid "Shortcuts"
+msgstr "Pikakuvakkeet"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Light Radius"
+msgstr "Muuta valon sädettä"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Camera FOV"
+msgstr "Muuta kameran näkökenttää"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Camera Size"
+msgstr "Muuta kameran kokoa"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Sphere Shape Radius"
+msgstr "Muuta pallon sädettä"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Box Shape Extents"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Capsule Shape Radius"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Capsule Shape Height"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Ray Shape Length"
+msgstr "Vaihda säteen muodon pituutta"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Notifier Extents"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Probe Extents"
+msgstr ""
+
+#: modules/gdscript/gd_functions.cpp
+#: modules/visual_script/visual_script_builtin_funcs.cpp
+msgid "Invalid type argument to convert(), use TYPE_* constants."
+msgstr ""
+
+#: modules/gdscript/gd_functions.cpp
+#: modules/visual_script/visual_script_builtin_funcs.cpp
+msgid "Not enough bytes for decoding bytes, or invalid format."
+msgstr ""
+
+#: modules/gdscript/gd_functions.cpp
+msgid "step argument is zero!"
+msgstr ""
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not a script with an instance"
+msgstr ""
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not based on a script"
+msgstr ""
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not based on a resource file"
+msgstr ""
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (missing @path)"
+msgstr ""
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (can't load script at @path)"
+msgstr ""
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (invalid script at @path)"
+msgstr ""
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary (invalid subclasses)"
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"A node yielded without working memory, please read the docs on how to yield "
+"properly!"
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"Node yielded, but did not return a function state in the first working "
+"memory."
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"Return value must be assigned to first element of node working memory! Fix "
+"your node please."
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid "Node returned an invalid sequence output: "
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid "Found sequence bit but not the node in the stack, report bug!"
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid "Stack overflow with stack depth: "
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Functions:"
+msgstr "Funktiot:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Variables:"
+msgstr "Muuttujat:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Name is not a valid identifier:"
+msgstr "Nimi ei ole kelvollinen tunniste:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Name already in use by another func/var/signal:"
+msgstr "Nimi on jo toisen funktion/muuttujan/signaalin käytössä:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Function"
+msgstr "Nimeä funktio uudelleen"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Variable"
+msgstr "Nimeä muuttuja uudelleen"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Signal"
+msgstr "Nimeä signaali uudelleen"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Function"
+msgstr "Lisää funktio"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Variable"
+msgstr "Lisää muuttuja"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Signal"
+msgstr "Lisää signaali"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Function"
+msgstr "Poista funktio"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Variable"
+msgstr "Poista muuttuja"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Editing Variable:"
+msgstr "Muokataan muuttujaa:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Signal"
+msgstr "Poista signaali"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Editing Signal:"
+msgstr "Muokataan signaalia:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change Expression"
+msgstr "Vaihda lauseketta"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Node"
+msgstr "Lisää Node"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a simple reference to the node."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a simple reference to the node."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a Variable Setter."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a Variable Setter."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Preload Node"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Node(s) From Tree"
+msgstr "Lisää Nodet puusta"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Getter Property"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Setter Property"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Condition"
+msgstr "Ehtolause"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Sequence"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Switch"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Iterator"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "While"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Return"
+msgstr "Palauta"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Get"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Base Type:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Available Nodes:"
+msgstr "Saatavilla olevat Nodet:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Select or create a function to edit graph"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Signal Arguments:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Variable:"
+msgstr "Muokkaa muuttujaa:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change"
+msgstr "Muuta"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Delete Selected"
+msgstr "Poista valitut"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Find Node Type"
+msgstr "Etsi Noden tyyppi"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Copy Nodes"
+msgstr "Kopioi Nodet"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Cut Nodes"
+msgstr "Leikkaa Nodet"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Paste Nodes"
+msgstr "Liitä Nodet"
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Input type not iterable: "
+msgstr ""
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Iterator became invalid"
+msgstr ""
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Iterator became invalid: "
+msgstr ""
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Invalid index property name."
+msgstr ""
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Base object is not a Node!"
+msgstr ""
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Path does not lead Node!"
+msgstr "Polku ei vie Nodeen!"
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Invalid index property name '%s' in node %s."
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ": Invalid argument of type: "
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ": Invalid arguments: "
+msgstr ": Virheelliset argumentit: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "VariableGet not found in script: "
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "VariableSet not found in script: "
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "Custom node has no _step() method, can't process graph."
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ""
+"Invalid return value from _step(), must be integer (seq out), or string "
+"(error)."
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "just pressed"
+msgstr "juuri painettu"
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "just released"
+msgstr "juuri julkaistu"
+
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr "Suorita selaimessa"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr "Suorita viety HTML järjestelmän oletusselaimessa."
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr "Ei voitu kirjoittaa tiedostoa:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr "Ei voitu lukea tiedostoa:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid ""
+"Couldn't read the certificate file. Are the path and password both correct?"
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Error creating the signature object."
+msgstr "Virhe luotaessa allekirjoitusoliota."
+
+#: platform/uwp/export/export.cpp
+msgid "Error creating the package signature."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid ""
+"No export templates found.\n"
+"Download and install export templates."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Custom debug package not found."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Custom release package not found."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid unique name."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid product GUID."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid publisher GUID."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid background color."
+msgstr "Virheellinen taustaväri."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid Store Logo image dimensions (should be 50x50)."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 44x44 logo image dimensions (should be 44x44)."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 71x71 logo image dimensions (should be 71x71)."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 150x150 logo image dimensions (should be 150x150)."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 310x310 logo image dimensions (should be 310x310)."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)."
+msgstr ""
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid splash screen image dimensions (should be 620x300)."
+msgstr ""
+
+#: scene/2d/animated_sprite.cpp
+msgid ""
+"A SpriteFrames resource must be created or set in the 'Frames' property in "
+"order for AnimatedSprite to display frames."
+msgstr ""
+
+#: scene/2d/canvas_modulate.cpp
+msgid ""
+"Only one visible CanvasModulate is allowed per scene (or set of instanced "
+"scenes). The first created one will work, while the rest will be ignored."
+msgstr ""
+
+#: scene/2d/collision_polygon_2d.cpp
+msgid ""
+"CollisionPolygon2D only serves to provide a collision shape to a "
+"CollisionObject2D derived node. Please only use it as a child of Area2D, "
+"StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."
+msgstr ""
+
+#: scene/2d/collision_polygon_2d.cpp
+msgid "An empty CollisionPolygon2D has no effect on collision."
+msgstr "Tyhjällä CollisionPolygon2D:llä ei ole vaikutusta törmäyksessä."
+
+#: scene/2d/collision_shape_2d.cpp
+msgid ""
+"CollisionShape2D only serves to provide a collision shape to a "
+"CollisionObject2D derived node. Please only use it as a child of Area2D, "
+"StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."
+msgstr ""
+
+#: scene/2d/collision_shape_2d.cpp
+msgid ""
+"A shape must be provided for CollisionShape2D to function. Please create a "
+"shape resource for it!"
+msgstr ""
+
+#: scene/2d/light_2d.cpp
+msgid ""
+"A texture with the shape of the light must be supplied to the 'texture' "
+"property."
+msgstr ""
+
+#: scene/2d/light_occluder_2d.cpp
+msgid ""
+"An occluder polygon must be set (or drawn) for this occluder to take effect."
+msgstr ""
+
+#: scene/2d/light_occluder_2d.cpp
+msgid "The occluder polygon for this occluder is empty. Please draw a polygon!"
+msgstr ""
+
+#: scene/2d/navigation_polygon.cpp
+msgid ""
+"A NavigationPolygon resource must be set or created for this node to work. "
+"Please set a property or draw a polygon."
+msgstr ""
+
+#: scene/2d/navigation_polygon.cpp
+msgid ""
+"NavigationPolygonInstance must be a child or grandchild to a Navigation2D "
+"node. It only provides navigation data."
+msgstr ""
+
+#: scene/2d/parallax_layer.cpp
+msgid ""
+"ParallaxLayer node only works when set as child of a ParallaxBackground node."
+msgstr ""
+
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
+
+#: scene/2d/path_2d.cpp
+msgid "PathFollow2D only works when set as a child of a Path2D node."
+msgstr ""
+"PathFollow2D toimii ainoastaan ollessaan asetettuna Path2D Node:n "
+"lapsiolioksi."
+
+#: scene/2d/remote_transform_2d.cpp
+msgid "Path property must point to a valid Node2D node to work."
+msgstr "Polku täytyy olla määritetty toimivaan Node2D solmuun toimiakseen."
+
+#: scene/2d/sprite.cpp
+msgid ""
+"Path property must point to a valid Viewport node to work. Such Viewport "
+"must be set to 'render target' mode."
+msgstr ""
+
+#: scene/2d/sprite.cpp
+msgid ""
+"The Viewport set in the path property must be set as 'render target' in "
+"order for this sprite to work."
+msgstr ""
+
+#: scene/2d/visibility_notifier_2d.cpp
+msgid ""
+"VisibilityEnable2D works best when used with the edited scene root directly "
+"as parent."
+msgstr ""
+
+#: scene/3d/body_shape.cpp
+msgid ""
+"CollisionShape only serves to provide a collision shape to a CollisionObject "
+"derived node. Please only use it as a child of Area, StaticBody, RigidBody, "
+"KinematicBody, etc. to give them a shape."
+msgstr ""
+
+#: scene/3d/body_shape.cpp
+msgid ""
+"A shape must be provided for CollisionShape to function. Please create a "
+"shape resource for it!"
+msgstr ""
+
+#: scene/3d/collision_polygon.cpp
+msgid ""
+"CollisionPolygon only serves to provide a collision shape to a "
+"CollisionObject derived node. Please only use it as a child of Area, "
+"StaticBody, RigidBody, KinematicBody, etc. to give them a shape."
+msgstr ""
+
+#: scene/3d/collision_polygon.cpp
+msgid "An empty CollisionPolygon has no effect on collision."
+msgstr "Tyhjällä CollisionPolygon:illa ei ole vaikutusta törmäyksessä."
+
+#: scene/3d/navigation_mesh.cpp
+msgid "A NavigationMesh resource must be set or created for this node to work."
+msgstr ""
+
+#: scene/3d/navigation_mesh.cpp
+msgid ""
+"NavigationMeshInstance must be a child or grandchild to a Navigation node. "
+"It only provides navigation data."
+msgstr ""
+
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
+#: scene/3d/remote_transform.cpp
+msgid "Path property must point to a valid Spatial node to work."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
+msgstr ""
+
+#: scene/3d/sprite_3d.cpp
+msgid ""
+"A SpriteFrames resource must be created or set in the 'Frames' property in "
+"order for AnimatedSprite3D to display frames."
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "Kääntötila"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
+#: scene/gui/dialogs.cpp
+msgid "Alert!"
+msgstr "Huomio!"
+
+#: scene/gui/dialogs.cpp
+msgid "Please Confirm..."
+msgstr "Ole hyvä ja vahvista..."
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a File"
+msgstr "Avaa tiedosto"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open File(s)"
+msgstr "Avaa tiedosto(t)"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a Directory"
+msgstr "Avaa hakemisto"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a File or Directory"
+msgstr "Avaa tiedosto tai hakemisto"
+
+#: scene/gui/input_action.cpp
+msgid "Ctrl+"
+msgstr "Ctrl+"
+
+#: scene/gui/popup.cpp
+msgid ""
+"Popups will hide by default unless you call popup() or any of the popup*() "
+"functions. Making them visible for editing is fine though, but they will "
+"hide upon running."
+msgstr ""
+"Pop-upit piilotetaan oletusarvoisesti ellet kutsu popup() tai jotain muuta "
+"popup*() -funktiota. Ne saadaan näkyville muokatessa, mutta eivät näy "
+"suoritettaessa."
+
+#: scene/gui/scroll_container.cpp
+msgid ""
+"ScrollContainer is intended to work with a single child control.\n"
+"Use a container as child (VBox,HBox,etc), or a Control and set the custom "
+"minimum size manually."
+msgstr ""
+"ScrollContainer on tarkoitettu toimimaan yhdellä lapsikontrollilla.\n"
+"Käytä containeria lapsena (VBox, HBox, jne), tai Control:ia ja aseta haluttu "
+"minimikoko manuaalisesti."
+
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
+#: scene/main/viewport.cpp
+msgid ""
+"This viewport is not set as render target. If you intend for it to display "
+"its contents directly to the screen, make it a child of a Control so it can "
+"obtain a size. Otherwise, make it a RenderTarget and assign its internal "
+"texture to some node for display."
+msgstr ""
+"Tätä näyttöruutua ei ole asetettu renderöitäväksi. Jos haluat sen näyttävän "
+"sisältöä suoraan näytölle, tee sitä Control:in lapsi, jotta se voi saada "
+"koon. Muutoin tee siitä RenderTarget ja aseta sen sisäinen tekstuuri "
+"johonkin Nodeen näkyväksi."
+
+#~ msgid "Node From Scene"
+#~ msgstr "Node Scenestä"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Tuo Assetit projektiin."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Vie projekti usealle alustalle."
+
+#~ msgid "Tutorials"
+#~ msgstr "Oppaat"
+
+#, fuzzy
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "Avaa https://godotengine.org \"tutorials\"-alueelle."
+
+#~ msgid "Use Default Light"
+#~ msgstr "Käytä oletusvaloa"
+
+#~ msgid "Valid chars:"
+#~ msgstr "Kelvolliset merkit:"
+
+#~ msgid "Valid name"
+#~ msgstr "Kelvollinen nimi"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "Luokan nimi on virheellinen!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "Kantaluokan nimi on virheellinen!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "Virheellinen polku!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Polun ominaisuuden täytyy osoittaa kelvolliseen Particles2D Nodeen "
+#~ "toimiakseen."
diff --git a/editor/translations/fr.po b/editor/translations/fr.po
index 741b27711d..bb60c74475 100644
--- a/editor/translations/fr.po
+++ b/editor/translations/fr.po
@@ -3,16 +3,18 @@
# This file is distributed under the same license as the Godot source code.
#
# Brice <bbric@free.fr>, 2016.
-# Chenebel Dorian <LoubiTek54@gmail.com>, 2016.
+# Chenebel Dorian <LoubiTek54@gmail.com>, 2016-2017.
# derderder77 <derderder77380@gmail.com>, 2016.
# finkiki <specialpopol@gmx.fr>, 2016.
-# Hugo Locurcio <hugo.l@openmailbox.org>, 2016.
-# Marc <marc.gilleron@gmail.com>, 2016.
+# Gilles Roudiere <gilles.roudiere@gmail.com>, 2017.
+# Hugo Locurcio <hugo.l@openmailbox.org>, 2016-2017.
+# Marc <marc.gilleron@gmail.com>, 2016-2017.
+# Nathan Lovato <nathan.lovato.art@gmail.com>, 2017.
# Nicolas Lehuen <nicolas@lehuen.com>, 2016.
# Omicron <tritonic.dev@gmail.com>, 2016.
# Onyx Steinheim <thevoxelmanonyx@gmail.com>, 2016.
-# rafeu <duchainer@gmail.com>, 2016.
-# Rémi Verschelde <rverschelde@gmail.com>, 2016.
+# rafeu <duchainer@gmail.com>, 2016-2017.
+# Rémi Verschelde <rverschelde@gmail.com>, 2016-2017.
# Roger BR <drai_kin@hotmail.com>, 2016.
# Thomas Baijot <thomasbaijot@gmail.com>, 2016.
#
@@ -20,8 +22,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2016-12-15 22:36+0000\n"
-"Last-Translator: Nicolas Lehuen <nicolas@lehuen.com>\n"
+"PO-Revision-Date: 2017-05-25 09:31+0000\n"
+"Last-Translator: Nathan Lovato <nathan.lovato.art@gmail.com>\n"
"Language-Team: French <https://hosted.weblate.org/projects/godot-engine/"
"godot/fr/>\n"
"Language: fr\n"
@@ -29,7 +31,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
-"X-Generator: Weblate 2.10\n"
+"X-Generator: Weblate 2.14.1\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -102,7 +104,7 @@ msgstr "Modifier le mode de valeur de la piste d'animation"
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
-msgstr "Modifier Courbe du Noeud"
+msgstr "Modifier la courbe du nœud"
#: editor/animation_editor.cpp
msgid "Edit Selection Curve"
@@ -110,7 +112,7 @@ msgstr "Modifier la courbe de sélection"
#: editor/animation_editor.cpp
msgid "Anim Delete Keys"
-msgstr "Animation Supprimer les clés"
+msgstr "Anim Supprimer Clés"
#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
msgid "Duplicate Selection"
@@ -118,7 +120,7 @@ msgstr "Dupliquer la sélection"
#: editor/animation_editor.cpp
msgid "Duplicate Transposed"
-msgstr "Double transposé"
+msgstr "Dupliquer Transposé"
#: editor/animation_editor.cpp
msgid "Remove Selection"
@@ -138,11 +140,11 @@ msgstr "Déclencheur"
#: editor/animation_editor.cpp
msgid "Anim Add Key"
-msgstr "Animation Ajouter une clé"
+msgstr "Anim Ajouter Clé"
#: editor/animation_editor.cpp
msgid "Anim Move Keys"
-msgstr "Animation Déplacer les clés"
+msgstr "Anim Déplacer Clés"
#: editor/animation_editor.cpp
msgid "Scale Selection"
@@ -150,7 +152,7 @@ msgstr "Mettre à l'échelle la sélection"
#: editor/animation_editor.cpp
msgid "Scale From Cursor"
-msgstr "Echelle Du Curseur"
+msgstr "Mettre à l’Échelle Avec Curseur"
#: editor/animation_editor.cpp
msgid "Goto Next Step"
@@ -158,7 +160,7 @@ msgstr "Aller à l'étape suivante"
#: editor/animation_editor.cpp
msgid "Goto Prev Step"
-msgstr "Revenir à l'étape précédente"
+msgstr "Aller à l'étape précédente"
#: editor/animation_editor.cpp editor/property_editor.cpp
msgid "Linear"
@@ -228,11 +230,11 @@ msgstr "Animation Inserer une clé"
#: editor/animation_editor.cpp
msgid "Change Anim Len"
-msgstr "Modifier la longueur de l'animation"
+msgstr "Changer durée d'animation"
#: editor/animation_editor.cpp
msgid "Change Anim Loop"
-msgstr "Changer l'animation de la boucle"
+msgstr "Modifier le bouclage de l'animation"
#: editor/animation_editor.cpp
msgid "Anim Create Typed Value Key"
@@ -244,11 +246,11 @@ msgstr "Insérer une animation"
#: editor/animation_editor.cpp
msgid "Anim Scale Keys"
-msgstr "Images-clés d'échelle de l'animation"
+msgstr "Anim Mettre à l’Échelle les Clés"
#: editor/animation_editor.cpp
msgid "Anim Add Call Track"
-msgstr "Animation ajouter une piste d'appel"
+msgstr "Anim Ajouter Piste d'Appel"
#: editor/animation_editor.cpp
msgid "Animation zoom."
@@ -296,7 +298,7 @@ msgstr "Outils de piste"
#: editor/animation_editor.cpp
msgid "Enable editing of individual keys by clicking them."
-msgstr "Activer la modification de pistes individuelles en cliquant dessus."
+msgstr "Activer la modification de chaque clé en cliquant dessus."
#: editor/animation_editor.cpp
msgid "Anim. Optimizer"
@@ -321,7 +323,7 @@ msgstr "Optimiser"
#: editor/animation_editor.cpp
msgid "Select an AnimationPlayer from the Scene Tree to edit animations."
msgstr ""
-"Sélectionnez un AnimationPlayer de l'arbre de scène pour éditer les "
+"Sélectionnez un AnimationPlayer de l'arbre de scène pour modifier les "
"animations."
#: editor/animation_editor.cpp
@@ -366,11 +368,189 @@ msgstr "Redimensionner le tableau"
#: editor/array_property_edit.cpp
msgid "Change Array Value Type"
-msgstr "Changer les types des valeurs du tableau"
+msgstr "Modifier type de valeur du tableau"
#: editor/array_property_edit.cpp
msgid "Change Array Value"
-msgstr "Changer les valeurs du tableau"
+msgstr "Modifier valeur du tableau"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "Version :"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Constantes :"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Fichier"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Description :"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "Installer"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Fermer"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Connecter…"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Connecter au nœud :"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Format de fichier demandé inconnu :"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Enregistrement…"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Connecter…"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "En test"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Erreur d'enregistrement de la ressource !"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Télécharger"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Tout"
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
@@ -379,6 +559,30 @@ msgstr "Changer les valeurs du tableau"
msgid "Search:"
msgstr "Rechercher :"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Rechercher"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "Importer"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "Extensions"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Trier :"
@@ -392,10 +596,6 @@ msgid "Category:"
msgstr "Catégorie :"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Tout"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Site :"
@@ -407,7 +607,7 @@ msgstr "Support…"
msgid "Official"
msgstr "Officiel"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Communauté"
@@ -427,20 +627,6 @@ msgstr "Liste des méthodes pour « %s » :"
msgid "Call"
msgstr "Appel"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Fermer"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Liste des méthodes :"
@@ -466,7 +652,6 @@ msgid "No Matches"
msgstr "Pas de correspondances"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replaced %d occurrence(s)."
msgstr "%d occurrence(s) remplacée(s)."
@@ -491,13 +676,6 @@ msgid "Selection Only"
msgstr "Sélection uniquement"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Rechercher"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Trouver"
@@ -574,6 +752,7 @@ msgstr "Ajouter"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Supprimer"
@@ -615,7 +794,7 @@ msgstr "Connecter un signal :"
#: editor/connections_dialog.cpp
msgid "Create Subscription"
-msgstr "Créer une souscription"
+msgstr "Créer une connexion"
#: editor/connections_dialog.cpp
msgid "Connect.."
@@ -649,11 +828,6 @@ msgstr "Récents :"
msgid "Matches:"
msgstr "Correspondances :"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "Description :"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Rechercher un remplacement pour :"
@@ -688,6 +862,7 @@ msgstr "Ressource"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Chemin"
@@ -705,7 +880,7 @@ msgstr "Éditeur de dépendances"
#: editor/dependency_editor.cpp
msgid "Search Replacement Resource:"
-msgstr "Recherche une ressource de remplacement :"
+msgstr "Recherche ressource de remplacement :"
#: editor/dependency_editor.cpp
msgid "Owners Of:"
@@ -717,18 +892,19 @@ msgid ""
"work.\n"
"Remove them anyway? (no undo)"
msgstr ""
-"Les fichiers supprimés sont requis par d'autres ressources pour leur "
-"fonctionnement.\n"
-"Les supprimer quand même ? (aucune annulation possible)"
+"Les fichiers qui vont être supprimés sont utilisés par d'autres ressources "
+"pour leur fonctionnement.\n"
+"Les supprimer tout de même ? (pas d'annulation possible)"
#: editor/dependency_editor.cpp
msgid "Remove selected files from the project? (no undo)"
msgstr ""
-"Supprimer les fichiers sélectionnés du projet ? (aucune annulation possible)"
+"Supprimer les fichiers sélectionnés de ce projet ? (pas d'annulation "
+"possible)"
#: editor/dependency_editor.cpp
msgid "Error loading:"
-msgstr "Erreur de chargement :"
+msgstr "Erreur au chargement :"
#: editor/dependency_editor.cpp
msgid "Scene failed to load due to missing dependencies:"
@@ -779,24 +955,24 @@ msgid "Delete"
msgstr "Supprimer"
#: editor/editor_audio_buses.cpp
+#, fuzzy
msgid "Save Audio Bus Layout As.."
-msgstr ""
+msgstr "Enregistrer la Disposition des Bus Audio Sous.."
#: editor/editor_audio_buses.cpp
msgid "Location for New Layout.."
-msgstr ""
+msgstr "Emplacement de la Nouvelle Mise en Page.."
#: editor/editor_audio_buses.cpp
+#, fuzzy
msgid "Open Audio Bus Layout"
-msgstr ""
+msgstr "Ouvrir la Mise en Page des Bus Audio"
#: editor/editor_audio_buses.cpp
-#, fuzzy
msgid "Add Bus"
-msgstr "Tout ajouter"
+msgstr "Ajouter un bus"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "Charger"
@@ -806,6 +982,7 @@ msgid "Save As"
msgstr "Enregistrer sous"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Par défaut"
@@ -880,8 +1057,7 @@ msgid "Rearrange Autoloads"
msgstr "Ré-organiser les AutoLoads"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Chemin :"
@@ -947,9 +1123,9 @@ msgstr "Stockage du fichier :"
msgid "Packing"
msgstr "Empaquetage"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "Fichier modèle introuvable :\n"
#: editor/editor_export.cpp
msgid "Added:"
@@ -964,7 +1140,6 @@ msgid "Error saving atlas:"
msgstr "Erreur de sauvegarde de l'atlas :"
#: editor/editor_export.cpp
-#, fuzzy
msgid "Could not save atlas subtexture:"
msgstr "Impossible d'enregistrer la sous-texture atlas :"
@@ -1070,11 +1245,11 @@ msgid "ScanSources"
msgstr "Scanner les sources"
#: editor/editor_file_system.cpp
-#, fuzzy
msgid "(Re)Importing Assets"
-msgstr "Ré-importation"
+msgstr "Ré-importation des assets"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "Chercher dans l'aide"
@@ -1091,7 +1266,6 @@ msgid "Class:"
msgstr "Classe :"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "Hérite de :"
@@ -1124,9 +1298,8 @@ msgid "Constants:"
msgstr "Constantes :"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Property Description:"
-msgstr "Brève description :"
+msgstr "Description des propriétés :"
#: editor/editor_help.cpp
msgid "Method Description:"
@@ -1147,10 +1320,6 @@ msgstr " Sortie :"
msgid "Clear"
msgstr "Effacer"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Nœud à partir d'une scène"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1266,10 +1435,11 @@ msgid "There is no defined scene to run."
msgstr "Il n'y a pas de scène définie pour être lancée."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"Aucune scène principale n'a jamais été définie, en sélectionner une ?\n"
"Vous pouvez la modifier ultérieurement dans les « Paramètres du projet » "
@@ -1335,6 +1505,11 @@ msgid "Save Scene As.."
msgstr "Enregistrer la scène sous…"
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Nœud"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
"Cette scène n'a jamais été enregistrée. L'enregistrer avant de la lancer ?"
@@ -1392,9 +1567,12 @@ msgid ""
"Scene '%s' was automatically imported, so it can't be modified.\n"
"To make changes to it, a new inherited scene can be created."
msgstr ""
+"La scène « %s » a été automatiquement importée, elle ne peut donc pas être "
+"modifiée.\n"
+"Pour y apporter des modification, une scène fille peut être créée."
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "Oups"
@@ -1435,6 +1613,10 @@ msgstr "%d fichier(s) supplémentaire(s)"
msgid "%d more file(s) or folder(s)"
msgstr "%s fichier(s) ou dossier(s) supplémentaire(s)"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "Mode sans distraction"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Scène"
@@ -1452,9 +1634,8 @@ msgid "Previous tab"
msgstr "Onglet precedent"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Filter Files.."
-msgstr "Filtre rapide d'un fichier…"
+msgstr "Filtrer des fichiers…"
#: editor/editor_node.cpp
msgid "Operations with scene files."
@@ -1488,7 +1669,7 @@ msgstr "Fermer la scène"
msgid "Close Goto Prev. Scene"
msgstr "Fermer, aller à la scène précédente"
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "Fichiers récents"
@@ -1516,100 +1697,41 @@ msgid "Redo"
msgstr "Refaire"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "Lancer le script"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Paramètres du projet"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "Réinitialiser la scène"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Quitter vers la liste des projets"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Mode sans distraction"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "Importer des ressources dans le projet."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "Importer"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "Outils divers liés au projet ou à la scène."
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "Outils"
+#, fuzzy
+msgid "Project"
+msgstr "Nouveau projet"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "Paramètres du projet"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "Exporter le projet vers diverses plate-formes."
+msgid "Run Script"
+msgstr "Lancer le script"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "Exporter"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "Lancer le projet."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "Jouer"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "Mettre en pause la scène"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "Mettre en pause la scène"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "Arrêter la scène."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "Arrêter"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "Lancer la scène actuellement en cours d'édition."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "Lancer la scène"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "Jouer une scène personnalisée"
+msgid "Tools"
+msgstr "Outils"
#: editor/editor_node.cpp
-#, fuzzy
-msgid "Play Custom Scene"
-msgstr "Jouer une scène personnalisée"
+msgid "Quit to Project List"
+msgstr "Quitter vers la liste des projets"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "Options de débogage"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "Débogage"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1624,12 +1746,10 @@ msgstr ""
"connecter à l'adresse IP de cet ordinateur afin de procéder au débogage."
#: editor/editor_node.cpp
-#, fuzzy
msgid "Small Deploy with Network FS"
-msgstr "Petit déploiement avec le réseau FS"
+msgstr "Petit déploiement avec le réseau"
#: editor/editor_node.cpp
-#, fuzzy
msgid ""
"When this option is enabled, export or deploy will produce a minimal "
"executable.\n"
@@ -1640,11 +1760,11 @@ msgid ""
msgstr ""
"Lorsque cette option est activée, l'exportation ou le déploiement produira "
"un exécutable minimal.\n"
-"Le système de fichiers sera fourni à partir du projet par l'éditeur sur le "
+"L'éditeur fournira le système de fichiers à partir du projet, via le "
"réseau.\n"
-"Sur Androïd, le déploiement va utiliser le câble USB pour une meilleure "
-"performance. Cette option accélère les tests pour les jeux avec une grande "
-"empreinte."
+"Sur Android, le déploiement utilisera le câble USB pour une meilleure "
+"performance. Cette option accélère les tests pour les jeux gourmands en "
+"ressources."
#: editor/editor_node.cpp
msgid "Visible Collision Shapes"
@@ -1671,9 +1791,8 @@ msgstr ""
"option est activée."
#: editor/editor_node.cpp
-#, fuzzy
msgid "Sync Scene Changes"
-msgstr "Changement de synchronisation de scène"
+msgstr "Synchroniser les changements de scène"
#: editor/editor_node.cpp
msgid ""
@@ -1692,21 +1811,21 @@ msgid "Sync Script Changes"
msgstr "Synchroniser les modifications de script"
#: editor/editor_node.cpp
-#, fuzzy
msgid ""
"When this option is turned on, any script that is saved will be reloaded on "
"the running game.\n"
"When used remotely on a device, this is more efficient with network "
"filesystem."
msgstr ""
-"Lorsque cette option est activée, chaque script enregistré sera rechargé en "
-"jeu.\n"
-"Lorsque c'est utilisé à distance sur un périphérique, c'est plus efficace "
-"avec le système de fichiers réseau."
+"Lorsque cette option est activée, tout script enregistré sera de nouveau "
+"chargé pendant le déroulement du jeu.\n"
+"Quand elle est utilisée à distance sur un périphérique, cette option est "
+"plus efficace avec le système de fichiers réseau."
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "Paramètres"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Modifier"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1721,17 +1840,73 @@ msgid "Toggle Fullscreen"
msgstr "Basculer le mode plein écran"
#: editor/editor_node.cpp editor/project_export.cpp
-#, fuzzy
msgid "Manage Export Templates"
-msgstr "Chargement des modèles d'exportation"
+msgstr "Gérer les modèles d'exportation"
+
+#: editor/editor_node.cpp
+msgid "Help"
+msgstr "Aide"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "Classes"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "Fermer les documentations"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
#: editor/editor_node.cpp
msgid "About"
msgstr "À propos"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "Alerte lorsqu'une ressource externe a été modifiée."
+msgid "Play the project."
+msgstr "Lancer le projet."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "Jouer"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "Mettre en pause la scène"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "Mettre en pause la scène"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Arrêter la scène."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "Arrêter"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "Lancer la scène actuellement en cours d'édition."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Lancer la scène"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Jouer une scène personnalisée"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "Jouer une scène personnalisée"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1747,7 +1922,7 @@ msgstr "Repeindre quand modifié"
#: editor/editor_node.cpp
msgid "Disable Update Spinner"
-msgstr ""
+msgstr "Désactiver l'indicateur d'activité"
#: editor/editor_node.cpp
msgid "Inspector"
@@ -1814,6 +1989,14 @@ msgid "Thanks!"
msgstr "Merci !"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "Importer des modèles depuis un fichier ZIP"
@@ -1841,13 +2024,39 @@ msgstr "Ouvrir et exécuter un script"
msgid "Load Errors"
msgstr "Erreurs de chargement"
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
-msgstr "Extensions Installées :"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Ouvrir dans l'éditeur"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Ouvrir dans l'éditeur"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Ouvrir dans l'éditeur"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "Bibliothèque d'exportation"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Ouvrir dans l'éditeur"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "Ouvrir dans l'éditeur"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "Version :"
+msgid "Installed Plugins:"
+msgstr "Extensions installées :"
#: editor/editor_plugin_settings.cpp
msgid "Author:"
@@ -1867,7 +2076,7 @@ msgstr "Démarrer le profilage"
#: editor/editor_profiler.cpp
msgid "Measure:"
-msgstr "Mesure:"
+msgstr "Mesure :"
#: editor/editor_profiler.cpp
msgid "Frame Time (sec)"
@@ -1878,9 +2087,8 @@ msgid "Average Time (sec)"
msgstr "Temps moyen (seconde)"
#: editor/editor_profiler.cpp
-#, fuzzy
msgid "Frame %"
-msgstr "Image %"
+msgstr "% d'image"
#: editor/editor_profiler.cpp
#, fuzzy
@@ -1966,28 +2174,24 @@ msgid "Import From Node:"
msgstr "Importer à partir d'un nœud :"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Re-Download"
-msgstr "Recharger"
+msgstr "Télécharger à nouveau"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Uninstall"
-msgstr "Installer"
+msgstr "Désinstaller"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "(Installed)"
-msgstr "Installer"
+msgstr "(Installé)"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Download"
-msgstr "Bas"
+msgstr "Télécharger"
#: editor/export_template_manager.cpp
msgid "(Missing)"
-msgstr ""
+msgstr "(Manquant)"
#: editor/export_template_manager.cpp
#, fuzzy
@@ -1996,25 +2200,30 @@ msgstr "Actuel :"
#: editor/export_template_manager.cpp
msgid "Remove template version '%s'?"
-msgstr ""
+msgstr "Supprimer la version '%s' du modèle ?"
#: editor/export_template_manager.cpp
msgid "Can't open export templates zip."
msgstr "Impossible d'ouvrir le ZIP de modèles d'exportation."
#: editor/export_template_manager.cpp
+#, fuzzy
msgid "Invalid version.txt format inside templates."
-msgstr ""
+msgstr "Le format de version.txt invalide dans les modèles."
#: editor/export_template_manager.cpp
+#, fuzzy
msgid ""
"Invalid version.txt format inside templates. Revision is not a valid "
"identifier."
msgstr ""
+"Le format de version.txt invalide dans les modèles. Revision n'est pas un "
+"identifiant valide."
#: editor/export_template_manager.cpp
+#, fuzzy
msgid "No version.txt found inside templates."
-msgstr ""
+msgstr "Le fichier version.txt n'a pas été trouvé dans les modèles."
#: editor/export_template_manager.cpp
#, fuzzy
@@ -2037,12 +2246,12 @@ msgstr "Chargement des modèles d'exportation"
#: editor/export_template_manager.cpp
#, fuzzy
msgid "Current Version:"
-msgstr "Scène actuelle"
+msgstr "Version actuelle :"
#: editor/export_template_manager.cpp
#, fuzzy
msgid "Installed Versions:"
-msgstr "Extensions Installées :"
+msgstr "Extensions installées :"
#: editor/export_template_manager.cpp
#, fuzzy
@@ -2072,7 +2281,7 @@ msgstr ""
#: editor/filesystem_dock.cpp
msgid "Cannot navigate to '"
-msgstr ""
+msgstr "Ne peux pas acceder à '"
#: editor/filesystem_dock.cpp
msgid "Same source and destination files, doing nothing."
@@ -2105,7 +2314,11 @@ msgstr "Étendre au parent"
#: editor/filesystem_dock.cpp
msgid "Collapse all"
-msgstr ""
+msgstr "Réduire tout"
+
+#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "Montrer dans le gestionnaire de fichiers"
#: editor/filesystem_dock.cpp
msgid "Instance"
@@ -2136,10 +2349,6 @@ msgid "Info"
msgstr "Information"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "Montrer dans le gestionnaire de fichiers"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Ré-importer…"
@@ -2153,7 +2362,7 @@ msgstr "Répertoire suivant"
#: editor/filesystem_dock.cpp
msgid "Re-Scan Filesystem"
-msgstr "Re-scanner le système de fichiers"
+msgstr "Analyser à nouveau le système de fichiers"
#: editor/filesystem_dock.cpp
msgid "Toggle folder status as Favorite"
@@ -2161,7 +2370,9 @@ msgstr "Basculer l'état favori du dossier"
#: editor/filesystem_dock.cpp
msgid "Instance the selected scene(s) as child of the selected node."
-msgstr "Instancie la/les scènes sélectionnées en tant qu'enfant du nœud."
+msgstr ""
+"Instancie la(les) scène(s) sélectionnée(s) en tant qu'enfant(s) du nœud "
+"sélectionné."
#: editor/filesystem_dock.cpp
msgid "Move"
@@ -2204,7 +2415,8 @@ msgstr "Impossible de charger le script de post-importation :"
#: editor/import/resource_importer_scene.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Invalid/broken script for post-import (check console):"
-msgstr "Script de post-importation invalide ou cassé (vérifiez la console):"
+msgstr ""
+"Script de post-importation invalide ou corrompu (vérifiez la console) :"
#: editor/import/resource_importer_scene.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
@@ -2308,9 +2520,10 @@ msgid "No target font resource!"
msgstr "Pas de ressource de police de destination !"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"Extension de fichier non valide.\n"
"Veuillez utiliser .fnt."
@@ -2369,7 +2582,7 @@ msgstr "Impossible d'ouvrir le fichier en tant que fichier BMFont."
#: editor/io_plugins/editor_font_import_plugin.cpp
#: scene/resources/dynamic_font.cpp
msgid "Error initializing FreeType."
-msgstr "Erreur d'initialisation de Freetype."
+msgstr "Erreur à l'initialisation de Freetype."
#: editor/io_plugins/editor_font_import_plugin.cpp
#: scene/resources/dynamic_font.cpp
@@ -2495,7 +2708,7 @@ msgstr "Script invalide ou cassé de post-importation."
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Error importing scene."
-msgstr "Erreur d'importation de la scène."
+msgstr "Erreur à l'importation de la scène."
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Import 3D Scene"
@@ -2507,7 +2720,7 @@ msgstr "Scène source :"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Same as Target Scene"
-msgstr "Le même que la scène de destination"
+msgstr "Identique à la scène de destination"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Shared"
@@ -2522,18 +2735,16 @@ msgid "Post-Process Script:"
msgstr "Script de post-traitement :"
#: editor/io_plugins/editor_scene_import_plugin.cpp
-#, fuzzy
msgid "Custom Root Node Type:"
-msgstr "Type de racine de nœud personnalisé:"
+msgstr "Type de nœud racine personnalisé :"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Auto"
msgstr "Auto."
#: editor/io_plugins/editor_scene_import_plugin.cpp
-#, fuzzy
msgid "Root Node Name:"
-msgstr "Nom de nœud :"
+msgstr "Nom de nœud racine :"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "The Following Files are Missing:"
@@ -2678,8 +2889,8 @@ msgid ""
"NOTICE: Importing 2D textures is not mandatory. Just copy png/jpg files to "
"the project."
msgstr ""
-"REMARQUE : Il n'est pas obligatoire d'importer les textures en 2D. Copiez "
-"directement les fichiers PNG ou JPEG dans le projet."
+"REMARQUE : L'import de textures 2D n'est pas obligatoire. Copiez directement "
+"les fichiers PNG ou JPEG dans le projet."
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Crop empty space."
@@ -2795,8 +3006,9 @@ msgid "Compress"
msgstr "Compresser"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr "Ajouter au projet (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "Ajouter au projet (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -2807,9 +3019,8 @@ msgid "Translation"
msgstr "Traduction"
#: editor/multi_node_edit.cpp
-#, fuzzy
msgid "MultiNode Set"
-msgstr "Réglage multi-nœuds"
+msgstr "Ensemble multi-nœud"
#: editor/node_dock.cpp
msgid "Groups"
@@ -2905,7 +3116,7 @@ msgstr "ERREUR : Pas d'animation à modifier !"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Play selected animation backwards from current pos. (A)"
msgstr ""
-"Jouer l'animation sélectionnée à l'envers depuis la position actuelle. (A)"
+"Jouer l'animation sélectionnée à rebours depuis la position actuelle. (A)"
#: editor/plugins/animation_player_editor_plugin.cpp
#, fuzzy
@@ -2930,9 +3141,8 @@ msgid "Animation position (in seconds)."
msgstr "Position de l'animation (en secondes)."
#: editor/plugins/animation_player_editor_plugin.cpp
-#, fuzzy
msgid "Scale animation playback globally for the node."
-msgstr "Echelle de lecture de l'animation dans sa globalité pour le noeud."
+msgstr "Redimensionner la lecture de l'animation pour tout le nœud."
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Create new animation in player."
@@ -2994,12 +3204,11 @@ msgstr "Temps de mélange"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Next (Auto Queue):"
-msgstr "Suivant (file d'attente automatique) :"
+msgstr "Suivant (file d'attente automatique) :"
#: editor/plugins/animation_player_editor_plugin.cpp
-#, fuzzy
msgid "Cross-Animation Blend Times"
-msgstr "Temps de mélange des Cross-animation"
+msgstr "Temps de mélange des entre animations"
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/canvas_item_editor_plugin.cpp
@@ -3033,15 +3242,15 @@ msgstr "Mixer"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Auto Restart:"
-msgstr "Redémarrage automatique :"
+msgstr "Redémarrage automatique :"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Restart (s):"
-msgstr "Redémarrer (s) :"
+msgstr "Redémarrer (s) :"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Random Restart (s):"
-msgstr "Redémarrage aléatoire (s) :"
+msgstr "Redémarrage aléatoire (s) :"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Start!"
@@ -3066,7 +3275,7 @@ msgstr "Mélange 1 :"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "X-Fade Time (s):"
-msgstr ""
+msgstr "Durée du fondu (s) :"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Current:"
@@ -3446,7 +3655,7 @@ msgstr "Tout ajouter"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Adding %s..."
-msgstr ""
+msgstr "Ajout de %s..."
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Create Node"
@@ -3476,7 +3685,7 @@ msgid "Change default type"
msgstr "Changer la valeur par défaut"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "OK"
@@ -3485,6 +3694,8 @@ msgid ""
"Drag & drop + Shift : Add node as sibling\n"
"Drag & drop + Alt : Change node type"
msgstr ""
+"Glisser-déposer + Maj : Ajouter un nœud frère\n"
+"Glisser-déposer + Alt : Modifier le type de nœud"
#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
@@ -3525,15 +3736,6 @@ msgstr "Créer un Poly3D"
msgid "Set Handle"
msgstr "Définir la poignée"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "Ajouter/supprimer un point de rampe de couleur"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr "Modifier une rampe de couleurs"
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr "Création de la bibliothèque de maillages"
@@ -3564,6 +3766,35 @@ msgstr "Importer depuis la scène"
msgid "Update from Scene"
msgstr "Mettre à jour depuis la scène"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Ajouter une entrée"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Supprimer le chemin du point"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "Charger une ressource"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Modify Curve"
+msgstr "Modifier la carte de courbes"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "Ajouter/supprimer un point de rampe de couleur"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "Modifier une rampe de couleurs"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "Objet %d"
@@ -3666,7 +3897,7 @@ msgstr "Créer un corps statique de type Trimesh"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Static Convex Body"
-msgstr "Créer un corps statique de type convexe"
+msgstr "Créer corps convexe statique"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "This doesn't work on scene root!"
@@ -3711,11 +3942,11 @@ msgstr "Créer un corps statique convexe"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Trimesh Collision Sibling"
-msgstr ""
+msgstr "Créer une collision Trimesh"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Convex Collision Sibling"
-msgstr ""
+msgstr "Créer une collision convexe"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Outline Mesh.."
@@ -3843,6 +4074,20 @@ msgid "Remove Poly And Point"
msgstr "Supprimer le polygone et le point"
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "Effacer le masque d'émission"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "Générer un AABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "Erreur de chargement de l'image :"
@@ -3855,8 +4100,8 @@ msgid "Set Emission Mask"
msgstr "Définir le masque d'émission"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
-msgstr "Effacer le masque d'émission"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -3864,7 +4109,28 @@ msgstr "Charger le masque d'émission"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Generated Point Count:"
-msgstr "Compte de points générés:"
+msgstr "Compte de points générés :"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Temps moyen (seconde)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "Définir le masque d'émission"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "Créer depuis la scène"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Positions d'émission :"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
@@ -3875,6 +4141,10 @@ msgid "Node does not contain geometry (faces)."
msgstr "Le nœud ne contient pas de géométrie (faces)."
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "Les faces n'ont pas de surface !"
@@ -3887,11 +4157,13 @@ msgid "Generate AABB"
msgstr "Générer un AABB"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+#, fuzzy
+msgid "Create Emission Points From Mesh"
msgstr "Créer un émetteur à partir d'un maillage"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+#, fuzzy
+msgid "Create Emission Points From Node"
msgstr "Créer un émetteur à partir d'un nœud"
#: editor/plugins/particles_editor_plugin.cpp
@@ -3903,26 +4175,48 @@ msgid "Create Emitter"
msgstr "Créer un émetteur"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+#, fuzzy
+msgid "Emission Points:"
msgstr "Positions d'émission :"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr "Remplissage d'émission :"
+#, fuzzy
+msgid "Surface Points"
+msgstr "Surface %d"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "Surface"
+msgid "Surface Points+Normal (Directed)"
+msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "Volume"
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Source: "
+msgstr "Remplissage d'émission :"
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "Générer un AABB"
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr "Supprimer le point d'une courbe"
#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "Supprimer le point d'une courbe"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "Supprimer le point d'une courbe"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr "Ajouter un point à la courbe"
@@ -3977,6 +4271,16 @@ msgstr "Diviser le chemin"
msgid "Remove Path Point"
msgstr "Supprimer le chemin du point"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Supprimer le chemin du point"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "Supprimer le chemin du point"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "Créer une carte UV"
@@ -4130,6 +4434,11 @@ msgid "Pitch"
msgstr "Hauteur"
#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "Effacer les os"
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr "Erreur d'enregistrement du thème"
@@ -4218,10 +4527,6 @@ msgstr "Trouver…"
msgid "Find Next"
msgstr "Trouver le suivant"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "Débogage"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr "Sortir"
@@ -4255,16 +4560,9 @@ msgid "Move Right"
msgstr "Aller à droite"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "Tutoriels"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "Ouvre https://godotengine.org dans la section des tutoriels."
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "Classes"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "Chercher dans la documentation de référence."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
@@ -4272,7 +4570,7 @@ msgstr "Cherche dans la hiérarchie des classes."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the reference documentation."
-msgstr "Cherche dans la documentation de référence."
+msgstr "Chercher dans la documentation de référence."
#: editor/plugins/script_editor_plugin.cpp
msgid "Go to previous edited document."
@@ -4323,6 +4621,23 @@ msgid "Pick Color"
msgstr "Prélever une couleur"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "Conversion des images"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4373,6 +4688,14 @@ msgid "Trim Trailing Whitespace"
msgstr "Supprimer les espaces de fin de ligne"
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr "Indentation automatique"
@@ -4394,6 +4717,16 @@ msgid "Goto Previous Breakpoint"
msgstr "Aller au point d'arrêt précédent"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "Convertir vers…"
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Convertir vers…"
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "trouver précédente"
@@ -4416,6 +4749,10 @@ msgstr "Aller à la ligne…"
msgid "Contextual Help"
msgstr "Aide contextuelle"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr "Modifier une constante scalaire"
@@ -4633,36 +4970,106 @@ msgid "Animation Key Inserted."
msgstr "Clé d'animation insérée."
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Avancer"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "À l'envers"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Molette vers le bas."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Repeindre quand modifié"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Repeindre quand modifié"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "Repeindre quand modifié"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "Vertex"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr "Aligner avec la vue"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
-msgstr "Environnement"
+msgid "Display Normal"
+msgstr "Affichage normal"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
-msgstr "Écouteur audio"
+msgid "Display Wireframe"
+msgstr "Affichage en fil de fer"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
-msgstr "Gizmos"
+msgid "Display Overdraw"
+msgstr "Affichage des surimpressions"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
-msgstr "Dialogue XForm"
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Affichage sans ombrage"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "Pas de scène sélectionnée à instancier !"
+#, fuzzy
+msgid "View Environment"
+msgstr "Environnement"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Instancier sur le cursuer"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Gizmos"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "Impossible d'instancier la scène !"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr "Écouteur audio"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "Dialogue XForm"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4721,6 +5128,26 @@ msgid "Align Selection With View"
msgstr "Aligner la sélection avec la vue"
#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "Sélectionner"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "Déplacer"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Contrôle: Tourner"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "Échelle :"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
msgstr "Transformation"
@@ -4733,14 +5160,6 @@ msgid "Transform Dialog.."
msgstr "Dialogue de transformation…"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr "Utiliser la lumière par défaut"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "Utiliser sRGB par défaut"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
msgstr "1 vue"
@@ -4765,22 +5184,6 @@ msgid "4 Viewports"
msgstr "4 vues"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr "Affichage normal"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr "Affichage en fil de fer"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr "Affichage des surimpressions"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr "Affichage sans ombrage"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr "Afficher l'origine"
@@ -4789,6 +5192,10 @@ msgid "View Grid"
msgstr "Afficher la grille"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Paramètres"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "Paramètres d'alignement"
@@ -4809,16 +5216,8 @@ msgid "Viewport Settings"
msgstr "Paramètres de la vue"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr "Normale de l'éclairage par défaut :"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr "Couleur de l'éclairage ambient :"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
-msgstr "Champ de vision de perspective (degrés) :"
+msgstr "Champ visuel de la perspective (degrés) :"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Z-Near:"
@@ -4942,7 +5341,7 @@ msgstr "Coupe automatique"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Offset:"
-msgstr "Décalage:"
+msgstr "Décalage :"
#: editor/plugins/texture_region_editor_plugin.cpp
#, fuzzy
@@ -4951,7 +5350,7 @@ msgstr "Pas (s) :"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Separation:"
-msgstr "Séparation:"
+msgstr "Séparation :"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Texture Region"
@@ -5247,12 +5646,14 @@ msgid "Invalid project path, the path must exist!"
msgstr "Chemin de projet invalide, le chemin doit exister !"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "Chemin de projet invalide, godot.cfg ne doit pas exister."
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Chemin de projet invalide, engine.cfg ne doit pas exister."
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr "Chemin de projet invalide, godot.cfg doit exister."
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "Chemin de projet invalide, engine.cfg doit exister."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5263,8 +5664,10 @@ msgid "Invalid project path (changed anything?)."
msgstr "Chemin de projet non valide (avez-vous changé quelque chose ?)."
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
-msgstr "Impossible de créer le fichier godot.cfg dans le répertoire du projet."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr ""
+"Impossible de créer le fichier engine.cfg dans le répertoire du projet."
#: editor/project_manager.cpp
#, fuzzy
@@ -5303,10 +5706,6 @@ msgid "Install Project:"
msgstr "Projets récents :"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "Installer"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "Parcourir"
@@ -5370,6 +5769,11 @@ msgid "New Project"
msgstr "Nouveau projet"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Supprimer l'item"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "Quitter"
@@ -5490,6 +5894,11 @@ msgstr "Ajouter une action d'entrée"
msgid "Erase Input Action Event"
msgstr "Effacer l'événement d'action d'entrée"
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "Ajouter vide"
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Périphérique"
@@ -5555,8 +5964,9 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr "Paramètres du projet (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Paramètres du projet (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5622,10 +6032,6 @@ msgstr "Langue"
msgid "AutoLoad"
msgstr "AutoLoad"
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "Extensions"
-
#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Viewport"
@@ -5677,10 +6083,6 @@ msgid "Error loading file: Not a resource!"
msgstr "Erreur de chargement du fichier : ce n'est pas une ressource !"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "Impossible de charger l'image"
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "Sélectionner un nœud"
@@ -5720,7 +6122,7 @@ msgstr "Impossible d'exécuter l'outil PVRTC :"
#: editor/pvrtc_compress.cpp
msgid "Can't load back converted image using PVRTC tool:"
msgstr ""
-"L'image convertie n'a pas pu être rechargée en utilisant l'outil PVRTC:"
+"L'image convertie n'a pas pu être rechargée en utilisant l'outil PVRTC :"
#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
msgid "Reparent Node"
@@ -5871,6 +6273,11 @@ msgid "Error duplicating scene to save it."
msgstr "Erreur de duplication de la scène afin de l'enregistrer."
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Ressources :"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "Modifier les groupes"
@@ -5900,9 +6307,8 @@ msgid "Attach Script"
msgstr "Ajouter un script"
#: editor/scene_tree_dock.cpp
-#, fuzzy
msgid "Clear Script"
-msgstr "Créer un script"
+msgstr "Supprimer le script"
#: editor/scene_tree_dock.cpp
msgid "Merge From Scene"
@@ -5952,10 +6358,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "Afficher/cacher le CanvasItem"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Options de débogage"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "Instance :"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Script suivant"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Afficher/cacher le Spatial"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr "Nom de nœud invalide, les caractères suivants ne sont pas autorisés :"
@@ -6000,78 +6455,94 @@ msgid "Select a Node"
msgstr "Sélectionner un nœud"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "Nom de classe parent invalide"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Impossible de créer le script dans le système de fichiers."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "Caractères valides :"
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "Erreur de chargement de la scène depuis %s"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "Nom de classe invalide"
+msgid "Path is empty"
+msgstr "Le chemin est vide"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "Nom valide"
+msgid "Path is not local"
+msgstr "Le chemin n'est pas local"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "N/A"
+msgid "Invalid base path"
+msgstr "Chemin de base invalide"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "Le nom de classe est invalide !"
+msgid "Invalid extension"
+msgstr "Extension invalide"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "Le nom de classe parent est invalide !"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "Chemin invalide !"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Chemin invalide."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "Impossible de créer le script dans le système de fichiers."
+msgid "Invalid class name"
+msgstr "Nom de classe invalide"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Error loading script from %s"
-msgstr "Erreur de chargement de la scène depuis %s"
+msgid "Invalid inherited parent name or path"
+msgstr "Indice de nom de propriété invalide."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "Le chemin est vide"
+#, fuzzy
+msgid "Script valid"
+msgstr "Script"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "Le chemin n'est pas local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "Chemin de base invalide"
+msgid "N/A"
+msgstr "N/A"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "Extension invalide"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "Créer un script"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr "Script suivant"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "Hérite de :"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "Nom de classe :"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Supprimer l'item"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "Script intégré"
#: editor/script_create_dialog.cpp
@@ -6233,7 +6704,7 @@ msgstr "Changer le rayon d'une forme en capsule"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Capsule Shape Height"
-msgstr "Changer la hauteur d'une forme en capsule"
+msgstr "Changer la hauteur de la forme capsule"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Ray Shape Length"
@@ -6244,6 +6715,10 @@ msgid "Change Notifier Extents"
msgstr "Changer les extents d'un notificateur"
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
#, fuzzy
msgid "Change Probe Extents"
msgstr "Changer les extents d'un notificateur"
@@ -6251,7 +6726,8 @@ msgstr "Changer les extents d'un notificateur"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
msgid "Invalid type argument to convert(), use TYPE_* constants."
-msgstr "Argument invalide de type convertir(), utiliser le TYPE * constantes."
+msgstr ""
+"Argument de type incorrect dans convert(), utilisez les constantes TYPE_*."
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6260,7 +6736,7 @@ msgstr "Pas assez d'octets pour les octets de décodage, ou format non valide."
#: modules/gdscript/gd_functions.cpp
msgid "step argument is zero!"
-msgstr "L'argument du pas est zéro!"
+msgstr "L'argument du pas est zéro !"
#: modules/gdscript/gd_functions.cpp
msgid "Not a script with an instance"
@@ -6299,6 +6775,8 @@ msgid ""
"A node yielded without working memory, please read the docs on how to yield "
"properly!"
msgstr ""
+"Une node utilise yield sans mémoire de travail; veuillez lire la "
+"documentation sur l'utilisation de yield !"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -6324,7 +6802,7 @@ msgstr "Le nœud a retourné une séquence de sortie invalide: "
msgid "Found sequence bit but not the node in the stack, report bug!"
msgstr ""
"Une séquence d'octets a été trouvée mais pas le nœud dans la pile, signalez "
-"le bug!"
+"le bug !"
#: modules/visual_script/visual_script.cpp
msgid "Stack overflow with stack depth: "
@@ -6340,11 +6818,11 @@ msgstr "Variables :"
#: modules/visual_script/visual_script_editor.cpp
msgid "Name is not a valid identifier:"
-msgstr "Le nom n'est pas un identifiant valide:"
+msgstr "Le nom n'est pas un identifiant valide :"
#: modules/visual_script/visual_script_editor.cpp
msgid "Name already in use by another func/var/signal:"
-msgstr "Le nom est déjà utilisé dans une autre func/var/signal:"
+msgstr "Le nom est déjà utilisé dans une autre func/var/signal :"
#: modules/visual_script/visual_script_editor.cpp
msgid "Rename Function"
@@ -6380,7 +6858,7 @@ msgstr "Supprimer la variable"
#: modules/visual_script/visual_script_editor.cpp
msgid "Editing Variable:"
-msgstr "Éditer la variable:"
+msgstr "Modification de la variable :"
#: modules/visual_script/visual_script_editor.cpp
msgid "Remove Signal"
@@ -6388,7 +6866,7 @@ msgstr "Supprimer le signal"
#: modules/visual_script/visual_script_editor.cpp
msgid "Editing Signal:"
-msgstr "Éditer le signal :"
+msgstr "Modification du signal :"
#: modules/visual_script/visual_script_editor.cpp
msgid "Change Expression"
@@ -6428,7 +6906,7 @@ msgstr "Maintenir Ctrl pour déposer un mutateur de variable."
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Preload Node"
-msgstr "Ajouter un nœud 'preload'"
+msgstr "Ajouter un nœud préchargé"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Node(s) From Tree"
@@ -6472,23 +6950,23 @@ msgstr "Récupérer"
#: modules/visual_script/visual_script_editor.cpp
msgid "Base Type:"
-msgstr "Type de base"
+msgstr "Type de base :"
#: modules/visual_script/visual_script_editor.cpp
msgid "Available Nodes:"
-msgstr "Nœuds disponibles:"
+msgstr "Nœuds disponibles :"
#: modules/visual_script/visual_script_editor.cpp
msgid "Select or create a function to edit graph"
-msgstr "Sélectionner ou créer une fonction pour éditer le graph"
+msgstr "Sélectionner ou créer une fonction pour éditer le graphe"
#: modules/visual_script/visual_script_editor.cpp
msgid "Edit Signal Arguments:"
-msgstr "Éditer les arguments du signal:"
+msgstr "Modifier les arguments du signal :"
#: modules/visual_script/visual_script_editor.cpp
msgid "Edit Variable:"
-msgstr "Éditer la variable:"
+msgstr "Modifier la variable :"
#: modules/visual_script/visual_script_editor.cpp
msgid "Change"
@@ -6524,7 +7002,7 @@ msgstr "L'itérateur est devenu invalide"
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Iterator became invalid: "
-msgstr "L'itérateur est devenu invalide "
+msgstr "L'itérateur est devenu invalide: "
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Invalid index property name."
@@ -6574,18 +7052,43 @@ msgstr ""
#: modules/visual_script/visual_script_nodes.cpp
msgid "just pressed"
-msgstr "seulement pressé"
+msgstr "vient d'être appuyé"
#: modules/visual_script/visual_script_nodes.cpp
msgid "just released"
-msgstr "seulement relâché"
+msgstr "vient d'être relâché"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Run in Browser"
+msgstr "Parcourir"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "Impossible de trouver la tuile :"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "Impossible de trouver la tuile :"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "Impossible de créer le dossier."
#: platform/uwp/export/export.cpp
+#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr ""
-"Le fichier certificat ne pourrait pas être lu. Les chemin et mot de passe "
-"sont t-ils tous deux corrects ?"
+"Le fichier certificat n'a pas pu être lu. Le chemin et le mot de passe sont-"
+"ils tous deux corrects ?"
#: platform/uwp/export/export.cpp
msgid "Error creating the signature object."
@@ -6629,7 +7132,7 @@ msgstr "Couleur d'arrière-plan invalide."
#: platform/uwp/export/export.cpp
msgid "Invalid Store Logo image dimensions (should be 50x50)."
-msgstr "Dimensions d'image de logo magasin invalides (devraient être 50x50)."
+msgstr "Dimensions de l'image incorrectes (devraient être 50x50)."
#: platform/uwp/export/export.cpp
msgid "Invalid square 44x44 logo image dimensions (should be 44x44)."
@@ -6754,11 +7257,11 @@ msgstr ""
"Le nœud ParallaxLayer ne fonctionne que lorsqu'il s'agit d'un enfant d'un "
"nœud de type ParallaxBackground."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"La propriété Path doit pointer à un nœud de type Particles2D valide pour "
-"fonctionner."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6840,6 +7343,11 @@ msgstr ""
"Un NavigationMeshInstance doit être enfant ou sous-enfant d'un nœud de type "
"Navigation. Il fournit uniquement des données de navigation."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6860,6 +7368,15 @@ msgstr ""
"Une ressource de type SampleFrames doit être créée ou définie dans la "
"propriété « Frames » afin qu'une AnimatedSprite3D fonctionne."
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "Mode d'exécution :"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Alerte !"
@@ -6906,6 +7423,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6913,10 +7436,78 @@ msgid ""
"obtain a size. Otherwise, make it a RenderTarget and assign its internal "
"texture to some node for display."
msgstr ""
-"Ce Viewport n'est pas sélectionné comme cible du rendu. Si vous avez "
+"Ce Viewport n'est pas sélectionné comme cible de rendu. Si vous avez "
"l'intention d'afficher son contenu directement à l'écran, rattachez-le à un "
-"nœud de type Control afin qu'il en obtienne une taille. Sinon, faites-en un "
-"RenderTarget et assignez sa texture à un nœud quelquonque pour son affichage."
+"nœud de type Control afin qu'il en obtienne une taille. Sinon, faites-en une "
+"RenderTarget et assignez sa texture à un nœud pouvant l'afficher."
+
+#~ msgid "Node From Scene"
+#~ msgstr "Nœud à partir d'une scène"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Importer des ressources dans le projet."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Exporter le projet vers diverses plate-formes."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "Alerte lorsqu'une ressource externe a été modifiée."
+
+#~ msgid "Tutorials"
+#~ msgstr "Tutoriels"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "Ouvre https://godotengine.org dans la section des tutoriels."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "Pas de scène sélectionnée à instancier !"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "Instancier sur le cursuer"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "Impossible d'instancier la scène !"
+
+#~ msgid "Use Default Light"
+#~ msgstr "Utiliser la lumière par défaut"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "Utiliser sRGB par défaut"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "Normale de l'éclairage par défaut :"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "Couleur de l'éclairage ambient :"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "Impossible de charger l'image"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "Nom de classe parent invalide"
+
+#~ msgid "Valid chars:"
+#~ msgstr "Caractères valides :"
+
+#~ msgid "Valid name"
+#~ msgstr "Nom valide"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "Le nom de classe est invalide !"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "Le nom de classe parent est invalide !"
+
+#~ msgid "Invalid path!"
+#~ msgstr "Chemin invalide !"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "La propriété Path doit pointer à un nœud de type Particles2D valide pour "
+#~ "fonctionner."
+
+#~ msgid "Surface"
+#~ msgstr "Surface"
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
@@ -6970,14 +7561,23 @@ msgstr ""
#~ msgid "Full name"
#~ msgstr "Nom valide"
+#~ msgid "Organizational unit"
+#~ msgstr "Unité d'organisation"
+
#, fuzzy
#~ msgid "Organization"
#~ msgstr "Transition"
+#~ msgid "City"
+#~ msgstr "Ville"
+
#, fuzzy
#~ msgid "State"
#~ msgstr "État :"
+#~ msgid "2 letter country code"
+#~ msgstr "Code de pays à 2 lettres"
+
#, fuzzy
#~ msgid "Password"
#~ msgstr "Mot de passe :"
@@ -7117,9 +7717,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "Silence de fin :"
-#~ msgid "Script"
-#~ msgstr "Script"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Mode d'exportation des scripts :"
@@ -7153,9 +7750,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "La BakedLightInstance ne contient pas de ressource BakedLight."
-#~ msgid "Vertex"
-#~ msgstr "Vertex"
-
#~ msgid "Fragment"
#~ msgstr "Fragment"
@@ -7191,9 +7785,6 @@ msgstr ""
#~ msgid "Cannot go into subdir:"
#~ msgstr "Impossible d'aller dans le sous-répertoire :"
-#~ msgid "Help"
-#~ msgstr "Aide"
-
#~ msgid "Imported Resources"
#~ msgstr "Ressources importées"
diff --git a/editor/translations/hu.po b/editor/translations/hu.po
index 7ee105d267..d6f3caa1e9 100644
--- a/editor/translations/hu.po
+++ b/editor/translations/hu.po
@@ -355,6 +355,174 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "View Files"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connecting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Error making request"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -362,6 +530,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -375,10 +567,6 @@ msgid "Category:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr ""
@@ -390,7 +578,7 @@ msgstr ""
msgid "Official"
msgstr ""
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr ""
@@ -410,20 +598,6 @@ msgstr ""
msgid "Call"
msgstr ""
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr ""
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr ""
@@ -473,13 +647,6 @@ msgid "Selection Only"
msgstr ""
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr ""
@@ -554,6 +721,7 @@ msgstr ""
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr ""
@@ -629,11 +797,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -664,6 +827,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -764,8 +928,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -775,6 +938,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -843,8 +1007,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr ""
@@ -910,7 +1073,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1035,7 +1198,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1052,7 +1216,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1107,10 +1270,6 @@ msgstr ""
msgid "Clear"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1226,8 +1385,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1281,6 +1440,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1337,7 +1500,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1375,6 +1538,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1427,7 +1594,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1455,50 +1622,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1506,47 +1646,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1617,8 +1725,8 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
+#: editor/editor_node.cpp
+msgid "Editor"
msgstr ""
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
@@ -1638,11 +1746,67 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1726,6 +1890,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1753,12 +1925,32 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+msgid "Open 2D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 3D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2000,6 +2192,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2028,10 +2224,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2197,7 +2389,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2672,7 +2864,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3332,7 +3524,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr ""
@@ -3381,15 +3573,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3420,6 +3603,31 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Add point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Remove point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3689,6 +3897,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3701,7 +3922,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3712,6 +3933,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3721,6 +3959,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3733,11 +3975,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3749,26 +3991,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3823,6 +4081,14 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove Out-Control Point"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3976,6 +4242,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4063,10 +4333,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4100,15 +4366,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4163,6 +4421,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4213,6 +4487,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4234,6 +4516,14 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4256,6 +4546,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4473,35 +4767,95 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Shader Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "Audio Listener"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4561,71 +4915,67 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Select"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "1 Viewport"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "2 Viewports"
+msgid "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "2 Viewports (Alt)"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "3 Viewports"
+msgid "1 Viewport"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "3 Viewports (Alt)"
+msgid "2 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "4 Viewports"
+msgid "2 Viewports (Alt)"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
+msgid "3 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
+msgid "3 Viewports (Alt)"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
+msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4649,14 +4999,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5069,11 +5411,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5085,7 +5427,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5121,10 +5463,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5183,6 +5521,10 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+msgid "Templates"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5301,6 +5643,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr ""
@@ -5366,7 +5712,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5433,10 +5779,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5486,10 +5828,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
msgid "Pick a Node"
msgstr ""
@@ -5674,6 +6012,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5748,10 +6090,56 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Open script"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5796,75 +6184,83 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
+msgid "Error - Could not create script in filesystem."
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
+msgid "Error loading script from %s"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
+msgid "Invalid Path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
+msgid "Invalid inherited parent name or path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+msgid "Create new script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Class Name"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Template"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6036,6 +6432,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6353,6 +6753,26 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr ""
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6492,8 +6912,10 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
#: scene/2d/path_2d.cpp
@@ -6556,6 +6978,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6571,6 +6998,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr ""
@@ -6613,6 +7048,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
diff --git a/editor/translations/id.po b/editor/translations/id.po
index 3600ad3152..15221690f2 100644
--- a/editor/translations/id.po
+++ b/editor/translations/id.po
@@ -5,21 +5,22 @@
# Abdul Aziz Muslim Alqudsy <abdul.aziz.muslim.alqudsy@gmail.com>, 2016.
# Andevid Dynmyn <doyan4forum@gmail.com>, 2016.
# Andinawan Asa <asaandinawan@gmail.com>, 2016.
+# Damar S. M <the.last.walla@gmail.com>, 2017.
# Khairul Hidayat <khairulcyber4rt@gmail.com>, 2016.
# yursan9 <rizal.sagi@gmail.com>, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2016-10-15 04:17+0000\n"
-"Last-Translator: Andevid Dynmyn <doyan4forum@gmail.com>\n"
+"PO-Revision-Date: 2017-01-18 13:18+0000\n"
+"Last-Translator: Damar S. M. <the.last.walla@gmail.com>\n"
"Language-Team: Indonesian <https://hosted.weblate.org/projects/godot-engine/"
"godot/id/>\n"
"Language: id\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.9-dev\n"
+"X-Generator: Weblate 2.11-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -379,6 +380,182 @@ msgstr "Ubah Tipe Nilai Array"
msgid "Change Array Value"
msgstr "Ubah Nilai Array"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Konstanta:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "File:"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Deskripsi:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Tutup"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Menyambungkan.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Sambungkan Ke Node:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Format file yang diminta tidak diketahui:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Menyambungkan.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Menguji"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Error menyimpan resource!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Semua"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -386,6 +563,30 @@ msgstr "Ubah Nilai Array"
msgid "Search:"
msgstr "Cari:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Cari"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Sortir:"
@@ -399,10 +600,6 @@ msgid "Category:"
msgstr "Kategori:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Semua"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Situs:"
@@ -414,7 +611,7 @@ msgstr "Dukungan.."
msgid "Official"
msgstr "Resmi"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Komunitas"
@@ -434,20 +631,6 @@ msgstr "Daftar Fungsi Untuk '%s':"
msgid "Call"
msgstr "Panggil"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Tutup"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Daftar Fungsi:"
@@ -499,13 +682,6 @@ msgid "Selection Only"
msgstr "Hanya yang Dipilih"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Cari"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Cari"
@@ -582,6 +758,7 @@ msgstr "Tambah"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Hapus"
@@ -658,11 +835,6 @@ msgstr "Saat ini:"
msgid "Matches:"
msgstr "Kecocokan:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "Deskripsi:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Cari Ganti Untuk:"
@@ -697,6 +869,7 @@ msgstr "Resource"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Path"
@@ -806,8 +979,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -817,6 +989,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Bawaan"
@@ -888,8 +1061,7 @@ msgid "Rearrange Autoloads"
msgstr "Mengatur kembali Autoload-autoload"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Path:"
@@ -955,7 +1127,7 @@ msgstr "Menyimpan File:"
msgid "Packing"
msgstr "Mengemas"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1084,7 +1256,8 @@ msgstr "Sumber Pemindaian"
msgid "(Re)Importing Assets"
msgstr "Mengimpor ulang"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "Mencari Bantuan"
@@ -1101,7 +1274,6 @@ msgid "Class:"
msgstr "Kelas:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "Turunan:"
@@ -1157,10 +1329,6 @@ msgstr " Keluaran:"
msgid "Clear"
msgstr "Bersihkan"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Node Dari Scene"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1277,10 +1445,11 @@ msgid "There is no defined scene to run."
msgstr "Tidak ada definisi scene untuk dijalankan."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"Tidak ada scene utama yang pernah didefinisikan, pilih satu?\n"
"Anda dapat mengubahnya nanti di akhir dalam \"Project Settings\" dibawah "
@@ -1345,6 +1514,10 @@ msgid "Save Scene As.."
msgstr "Simpan Scene Sebagai.."
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr "Scene ini belum pernah disimpan. Simpan sebelum menjalankan?"
@@ -1403,7 +1576,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
#, fuzzy
msgid "Ugh"
msgstr "Wadoo"
@@ -1444,6 +1617,10 @@ msgstr "%d file lagi"
msgid "%d more file(s) or folder(s)"
msgstr "%d file atau folder lagi"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "Mode Tanpa Gangguan"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Suasana"
@@ -1496,7 +1673,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1524,50 +1701,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Mode Tanpa Gangguan"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1575,47 +1725,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1686,9 +1804,10 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr ""
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Edit"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1709,11 +1828,67 @@ msgid "Manage Export Templates"
msgstr "Memuat Ekspor Template-template."
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1797,6 +1972,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1824,12 +2007,36 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Buka sebuah Direktori"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Buka sebuah Direktori"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Editor Ketergantungan"
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Editor Ketergantungan"
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2076,6 +2283,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2104,10 +2315,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2276,7 +2483,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2752,7 +2959,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3414,7 +3621,7 @@ msgid "Change default type"
msgstr "Ubah Tipe Nilai Array"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "Oke"
@@ -3463,15 +3670,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3502,6 +3700,33 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Tambahkan Sinyal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Hapus Sinyal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3772,6 +3997,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3784,7 +4022,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3795,6 +4033,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3804,6 +4059,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3816,11 +4075,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3832,26 +4091,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3906,6 +4181,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Hapus Autoload"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -4059,6 +4343,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4147,10 +4435,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4184,15 +4468,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4248,6 +4524,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4298,6 +4590,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4319,6 +4619,15 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Sambungkan Ke Node:"
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4341,6 +4650,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4558,35 +4871,100 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Maju"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "Ke belakang"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Scroll kebawah."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Menyimpan perubahan-perubahan lokal.."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Ubah"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Unshaded"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4646,23 +5024,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "Semua pilihan"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Local Coords"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4690,27 +5077,15 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4734,14 +5109,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5159,11 +5526,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5175,7 +5542,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5211,10 +5578,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5273,6 +5636,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Hapus Pilihan"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5391,6 +5759,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Perangkat"
@@ -5458,7 +5830,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5525,10 +5897,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5579,10 +5947,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "Path ke Node:"
@@ -5770,6 +6134,11 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Resource"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5847,10 +6216,57 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Buka Cepat Script.."
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5895,77 +6311,91 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr ""
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Tidak dapat membuat folder."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr ""
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "Error memuat font."
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr ""
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Path Tidak Sah."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Error loading script from %s"
-msgstr "Error memuat font."
+msgid "Invalid inherited parent name or path"
+msgstr "Nama properti index tidak sah."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "Buat Subskribsi"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
-msgstr ""
+#, fuzzy
+msgid "Inherits"
+msgstr "Turunan:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
+msgstr "Kelas:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Hapus Pilihan"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6141,6 +6571,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6157,20 +6591,19 @@ msgstr "Tidak cukup bytes untuk menerjemahkan, atau format tidak sah."
#: modules/gdscript/gd_functions.cpp
msgid "step argument is zero!"
-msgstr "Langkah argumen adalah nol!"
+msgstr "Argumen langkah adalah nol!"
#: modules/gdscript/gd_functions.cpp
-#, fuzzy
msgid "Not a script with an instance"
-msgstr "Skrip tidak mempunyai turunannya"
+msgstr "Bukan skrip dengan contoh"
#: modules/gdscript/gd_functions.cpp
msgid "Not based on a script"
-msgstr "Tidak berbasis skrip"
+msgstr "Tidak berbasis pada skrip"
#: modules/gdscript/gd_functions.cpp
msgid "Not based on a resource file"
-msgstr "Tidak berbasis resource file"
+msgstr "Tidak berbasis pada resource file"
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary format (missing @path)"
@@ -6201,8 +6634,8 @@ msgid ""
"Node yielded, but did not return a function state in the first working "
"memory."
msgstr ""
-"Node dihasilkan, tetapi keadaan sebuah fungsi tidak kembali saat kerja "
-"memori pertama."
+"Node dihasilkan, tetapi keadaan sebuah fungsi tidak kembali saat memori "
+"pertama bekerja."
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -6287,9 +6720,8 @@ msgid "Editing Signal:"
msgstr "Mengedit Sinyal:"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Change Expression"
-msgstr "Ubah Transisi Anim"
+msgstr "Ubah Pernyataan"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Node"
@@ -6298,6 +6730,8 @@ msgstr "Tambahkan Node"
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature."
msgstr ""
+"Tahan Meta untuk meletakkan sebuah Getter. Tahan Shift untuk meletakkan "
+"generic signature."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature."
@@ -6478,6 +6912,29 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "Tidak dapat membuat folder."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "Tidak dapat membuat folder."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "Tidak dapat membuat folder."
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6645,11 +7102,11 @@ msgstr ""
"Node ParallaxLayer hanya bekerja ketika diatur sebagai child dari sebuah "
"node ParallaxBackground."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"Properti path harus menunjuk ke sebuah node Particles2D yang sah agar "
-"bekerja."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6734,6 +7191,11 @@ msgstr ""
"NavigationMeshInstance harus menjadi child atau grandchild untuk sebuah node "
"Navigation. Ini hanya menyediakan data navigasi."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6756,6 +7218,14 @@ msgstr ""
"Sebuah resource SpriteFrames harus diciptakan atau diatur didalam properti "
"'Frames' agar AnimatedSprite3D menampilkan frame-frame."
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Peringatan!"
@@ -6801,6 +7271,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
#, fuzzy
msgid ""
@@ -6815,6 +7291,14 @@ msgstr ""
"sebuah RenderTarget dan tetapkannya tekstur internal untuk beberapa node "
"untuk ditampilkan."
+#~ msgid "Node From Scene"
+#~ msgstr "Node Dari Scene"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Properti path harus menunjuk ke sebuah node Particles2D yang sah agar "
+#~ "bekerja."
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
diff --git a/editor/translations/it.po b/editor/translations/it.po
index af6699da21..28ed2d5b0a 100644
--- a/editor/translations/it.po
+++ b/editor/translations/it.po
@@ -2,13 +2,15 @@
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
-# Dario Bonfanti <bonfi.96@hotmail.it>, 2016.
+# Dario Bonfanti <bonfi.96@hotmail.it>, 2016-2017.
+# Marco Melorio <m.melorio@icloud.com>, 2017.
+# RealAquilus <JamesHeller@live.it>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2016-11-22 20:27+0000\n"
+"PO-Revision-Date: 2017-05-23 14:21+0000\n"
"Last-Translator: Dario Bonfanti <bonfi.96@hotmail.it>\n"
"Language-Team: Italian <https://hosted.weblate.org/projects/godot-engine/"
"godot/it/>\n"
@@ -17,7 +19,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.10-dev\n"
+"X-Generator: Weblate 2.14.1-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -84,9 +86,8 @@ msgid "Anim Track Change Value Mode"
msgstr "Traccia Anim Cambia Modalità Valore"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Track Change Wrap Mode"
-msgstr "Traccia Anim Cambia Modalità Valore"
+msgstr "Traccia Anim Cambia Modalità avvolgimento"
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
@@ -359,6 +360,184 @@ msgstr "Cambia Tipo del Valore Array"
msgid "Change Array Value"
msgstr "Cambia Valore Array"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "Versione:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Costanti:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr " Files"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Descrizione:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "Installa"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Chiudi"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Connetti.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Connetti A Nodo:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Formato file richiesto sconosciuto:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Salvataggio.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Connetti.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Testing"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Errore salvando la Risorsa!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Scarica"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Tutti"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -366,6 +545,30 @@ msgstr "Cambia Valore Array"
msgid "Search:"
msgstr "Cerca:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Cerca"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "Importa"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "Plugins"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Ordina:"
@@ -379,10 +582,6 @@ msgid "Category:"
msgstr "Categoria:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Tutti"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Sito:"
@@ -394,7 +593,7 @@ msgstr "Supporta.."
msgid "Official"
msgstr "Ufficiale"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Comunità"
@@ -414,20 +613,6 @@ msgstr "Lista Metodi Per '%s':"
msgid "Call"
msgstr "Chiama"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Chiudi"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Lista Metodi:"
@@ -453,7 +638,6 @@ msgid "No Matches"
msgstr "Nessuna Corrispondenza"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replaced %d occurrence(s)."
msgstr "Rimpiazzate %d occorrenze."
@@ -478,13 +662,6 @@ msgid "Selection Only"
msgstr "Solo Selezione"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Cerca"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Trova"
@@ -561,6 +738,7 @@ msgstr "Aggiungi"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Rimuovi"
@@ -636,11 +814,6 @@ msgstr "Recenti:"
msgid "Matches:"
msgstr "Corrispondenze:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "Descrizione:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Cerca Rimpiazzo Per:"
@@ -675,6 +848,7 @@ msgstr "Risorsa"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Percorso"
@@ -764,23 +938,21 @@ msgstr "Elimina"
#: editor/editor_audio_buses.cpp
msgid "Save Audio Bus Layout As.."
-msgstr ""
+msgstr "Salva Layout Bus Audio Come..."
#: editor/editor_audio_buses.cpp
msgid "Location for New Layout.."
-msgstr ""
+msgstr "Posizione di Nuovo Layout..."
#: editor/editor_audio_buses.cpp
msgid "Open Audio Bus Layout"
-msgstr ""
+msgstr "Apri Layout Audio Bus"
#: editor/editor_audio_buses.cpp
-#, fuzzy
msgid "Add Bus"
-msgstr "Aggiungi %s"
+msgstr "Aggiungi Bus"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "Carica"
@@ -790,6 +962,7 @@ msgid "Save As"
msgstr "Salva Come"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Default"
@@ -864,8 +1037,7 @@ msgid "Rearrange Autoloads"
msgstr "Riordina gli Autoload"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Percorso:"
@@ -931,9 +1103,9 @@ msgstr "Memorizzazione File:"
msgid "Packing"
msgstr "Impacchettando"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "File template non trovato:\n"
#: editor/editor_export.cpp
msgid "Added:"
@@ -1053,11 +1225,11 @@ msgid "ScanSources"
msgstr "ScansionaSorgenti"
#: editor/editor_file_system.cpp
-#, fuzzy
msgid "(Re)Importing Assets"
-msgstr "Re-Importando"
+msgstr "(Re)Importando gli Assets"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "Cerca Aiuto"
@@ -1074,7 +1246,6 @@ msgid "Class:"
msgstr "Classe:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "Eredita:"
@@ -1107,9 +1278,8 @@ msgid "Constants:"
msgstr "Costanti:"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Property Description:"
-msgstr "Breve Descrizione:"
+msgstr "Descrizione Proprietà:"
#: editor/editor_help.cpp
msgid "Method Description:"
@@ -1130,10 +1300,6 @@ msgstr " Output:"
msgid "Clear"
msgstr "Rimuovi"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Nodo Da Scena"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1249,10 +1415,11 @@ msgid "There is no defined scene to run."
msgstr "Non c'è nessuna scena definita da eseguire."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"Nessuna scena principale è mai stata definita, selezionarne una?\n"
"Puoi cambiarla successivamente da \"Impostazioni Progetto\" sotto la "
@@ -1317,6 +1484,11 @@ msgid "Save Scene As.."
msgstr "Salva Scena Come.."
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Nodo"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr "Questa scena non è mai stata salvata. Salvare prima di eseguire?"
@@ -1373,9 +1545,12 @@ msgid ""
"Scene '%s' was automatically imported, so it can't be modified.\n"
"To make changes to it, a new inherited scene can be created."
msgstr ""
+"La scena '%s' é stata automaticamente importata, pertanto non puo essere "
+"modificata.\n"
+"Per effettuare cambiamenti, puo essere creata una nuova scena ereditata."
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "Ugh"
@@ -1416,6 +1591,10 @@ msgstr "%d altri file"
msgid "%d more file(s) or folder(s)"
msgstr "% altri file o cartelle"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "Modalità Senza Distrazioni"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Scena"
@@ -1433,9 +1612,8 @@ msgid "Previous tab"
msgstr "Scheda precedente"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Filter Files.."
-msgstr "Filtro Files Rapido.."
+msgstr "Filtra Files.."
#: editor/editor_node.cpp
msgid "Operations with scene files."
@@ -1469,7 +1647,7 @@ msgstr "Chiudi Scena"
msgid "Close Goto Prev. Scene"
msgstr "Vai a Scena Preced."
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "Apri Recente"
@@ -1497,99 +1675,41 @@ msgid "Redo"
msgstr "Redo"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "Esegui Script"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Impostazioni Progetto"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "Ripristina Scena"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Esci alla Lista Progetti"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Modalità Senza Distrazioni"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "Importa asset nel progetto."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "Importa"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "Strumenti di progetto o scena vari."
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "Strumenti"
+#, fuzzy
+msgid "Project"
+msgstr "Nuovo Progetto"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "Impostazioni Progetto"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "Esporta il progetto a diverse piattaforme."
+msgid "Run Script"
+msgstr "Esegui Script"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "Esporta"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "Esegui il progetto."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "Play"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "Metti in pausa la scena"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "Pausa Scena"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "Ferma la scena."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "Stop"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "Esegui la scena in modifica."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "Esegui Scena"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "Esegui scena personalizzata"
+msgid "Tools"
+msgstr "Strumenti"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "Esegui Scena Personalizzata"
+msgid "Quit to Project List"
+msgstr "Esci alla Lista Progetti"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "Opzioni di Debug"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "Debug"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1678,9 +1798,10 @@ msgstr ""
"Quando usata remotamente su un dispositivo, essa è più efficiente con il "
"filesystem in rete."
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "Impostazioni"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Modifica"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1695,17 +1816,73 @@ msgid "Toggle Fullscreen"
msgstr "Abilita/Disabilita Fullscreen"
#: editor/editor_node.cpp editor/project_export.cpp
-#, fuzzy
msgid "Manage Export Templates"
-msgstr "Caricamento Template d'Esportazione"
+msgstr "Gestisci Template d'Esportazione"
+
+#: editor/editor_node.cpp
+msgid "Help"
+msgstr "Aiuto"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "Classi"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "Chiudi Documentazione"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
#: editor/editor_node.cpp
msgid "About"
msgstr "Riguardo a"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "Avverti quando una risorsa esterna è stata modificata."
+msgid "Play the project."
+msgstr "Esegui il progetto."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "Play"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "Metti in pausa la scena"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "Pausa Scena"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Ferma la scena."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "Stop"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "Esegui la scena in modifica."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Esegui Scena"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Esegui scena personalizzata"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "Esegui Scena Personalizzata"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1788,6 +1965,14 @@ msgid "Thanks!"
msgstr "Grazie!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "Importa templates Da File ZIP"
@@ -1815,15 +2000,41 @@ msgstr "Apri e Esegui uno Script"
msgid "Load Errors"
msgstr "Carica Errori"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Apri nell Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Apri nell Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Apri nell Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "Esporta Libreria"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Apri nell Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "Apri nell Editor"
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "Plugins Installati:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "Versione:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "Autore:"
@@ -1936,37 +2147,32 @@ msgid "Import From Node:"
msgstr "Importa Da Nodo:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Re-Download"
-msgstr "Ricarica"
+msgstr "Ri-Scarica"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Uninstall"
-msgstr "Installa"
+msgstr "Disinstalla"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "(Installed)"
-msgstr "Installa"
+msgstr "(Installato)"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Download"
-msgstr "Giù"
+msgstr "Scarica"
#: editor/export_template_manager.cpp
msgid "(Missing)"
-msgstr ""
+msgstr "(Mancante)"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "(Current)"
-msgstr "Corrente:"
+msgstr "(Corrente)"
#: editor/export_template_manager.cpp
msgid "Remove template version '%s'?"
-msgstr ""
+msgstr "Rimuovere versione '%s' del template?"
#: editor/export_template_manager.cpp
msgid "Can't open export templates zip."
@@ -1974,27 +2180,27 @@ msgstr "Impossibile aprire zip dei template d'esportazionie."
#: editor/export_template_manager.cpp
msgid "Invalid version.txt format inside templates."
-msgstr ""
+msgstr "Formato di version.txt invalido nelle templates."
#: editor/export_template_manager.cpp
msgid ""
"Invalid version.txt format inside templates. Revision is not a valid "
"identifier."
msgstr ""
+"Formato di version.txt invalido nelle templates. Revision non é un "
+"identificatore valido."
#: editor/export_template_manager.cpp
msgid "No version.txt found inside templates."
-msgstr ""
+msgstr "Non é stato trovato version.txt all'interno di templates."
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Error creating path for templates:\n"
-msgstr "Errore di salvataggio dell'atlas:"
+msgstr "Errore di creazione del percorso per le template:\n"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Extracting Export Templates"
-msgstr "Caricamento Template d'Esportazione"
+msgstr "Estrazione Templates d'Esportazione"
#: editor/export_template_manager.cpp
msgid "Importing:"
@@ -2005,34 +2211,28 @@ msgid "Loading Export Templates"
msgstr "Caricamento Template d'Esportazione"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Current Version:"
-msgstr "Scena Corrente"
+msgstr "Versione Corrente:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Installed Versions:"
-msgstr "Plugins Installati:"
+msgstr "Versioni Installate:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Install From File"
-msgstr "Installa Progetto:"
+msgstr "Installa Da File"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Remove Template"
-msgstr "Rimuovi Elemento"
+msgstr "Rimuovi Template"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Select template file"
-msgstr "Eliminare i file selezionati?"
+msgstr "Seleziona file template"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Export Template Manager"
-msgstr "Caricamento Template d'Esportazione"
+msgstr "Gestore Template Esportazione"
#: editor/file_type_cache.cpp
msgid "Can't open file_type_cache.cch for writing, not saving file type cache!"
@@ -2042,7 +2242,7 @@ msgstr ""
#: editor/filesystem_dock.cpp
msgid "Cannot navigate to '"
-msgstr ""
+msgstr "Impossibile navigare a '"
#: editor/filesystem_dock.cpp
msgid "Same source and destination files, doing nothing."
@@ -2071,13 +2271,16 @@ msgid "No files selected!"
msgstr "Nessun File selezionato!"
#: editor/filesystem_dock.cpp
-#, fuzzy
msgid "Expand all"
-msgstr "Espandi a Genitore"
+msgstr "Espandi tutto"
#: editor/filesystem_dock.cpp
msgid "Collapse all"
-msgstr ""
+msgstr "Comprimi tutto"
+
+#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "Mostra nel File Manager"
#: editor/filesystem_dock.cpp
msgid "Instance"
@@ -2108,10 +2311,6 @@ msgid "Info"
msgstr "Info"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "Mostra nel File Manager"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Re-Importa.."
@@ -2189,23 +2388,20 @@ msgid "Saving.."
msgstr "Salvataggio.."
#: editor/import_dock.cpp
-#, fuzzy
msgid " Files"
-msgstr "File"
+msgstr " Files"
#: editor/import_dock.cpp
-#, fuzzy
msgid "Import As:"
-msgstr "Importa"
+msgstr "Importa Come:"
#: editor/import_dock.cpp editor/property_editor.cpp
msgid "Preset.."
msgstr "Preset.."
#: editor/import_dock.cpp
-#, fuzzy
msgid "Reimport"
-msgstr "Re-Importa"
+msgstr "Reimporta"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
msgid "No bit masks to import!"
@@ -2279,9 +2475,10 @@ msgid "No target font resource!"
msgstr "Nessuna risorsa font di destinazione!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"Estensione file invalida.\n"
"Si prega di usare .fnt."
@@ -2763,7 +2960,8 @@ msgid "Compress"
msgstr "Comprimi"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
msgstr "Aggiungi a Progetto (godot.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -2803,9 +3001,8 @@ msgid "Change Animation Name:"
msgstr "Cambia Nome Animazione:"
#: editor/plugins/animation_player_editor_plugin.cpp
-#, fuzzy
msgid "Delete Animation?"
-msgstr "Duplica Animazione"
+msgstr "Eliminare Animazione?"
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
@@ -3429,7 +3626,7 @@ msgid "Change default type"
msgstr "Cambia tipo di default"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "OK"
@@ -3480,15 +3677,6 @@ msgstr "Crea Poly3D"
msgid "Set Handle"
msgstr "Imposta Maniglia"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "Aggiungi/Rimuovi Punto Rampa Colori"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr "Modifica Rampa Colori"
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr "Creazione Libreria Mesh"
@@ -3519,6 +3707,34 @@ msgstr "Importa da Scena"
msgid "Update from Scene"
msgstr "Aggiorna da Scena"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Aggiungi Input"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Rimuovi Punto Percorso"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "Carica Risorsa"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr "Modifica Curva"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "Aggiungi/Rimuovi Punto Rampa Colori"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "Modifica Rampa Colori"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "Elemento %d"
@@ -3556,19 +3772,16 @@ msgid "RMB: Erase Point."
msgstr "RMB: Elimina Punto."
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Remove Point from Line2D"
-msgstr "Rimuovi Punto da Curva"
+msgstr "Rimuovi Punto da Line2D"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Add Point to Line2D"
-msgstr "Aggiungi Punto a Curva"
+msgstr "Aggiungi Punto a Line2D"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Move Point in Line2D"
-msgstr "Sposta Punto in curva"
+msgstr "Sposta Punto in Line2D"
#: editor/plugins/line_2d_editor_plugin.cpp
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -3601,9 +3814,8 @@ msgid "Add Point (in empty space)"
msgstr "Aggiungi Punto (in sapzio vuoto)"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Split Segment (in line)"
-msgstr "Spezza Segmento (in curva)"
+msgstr "Spezza Segmento (in linea)"
#: editor/plugins/line_2d_editor_plugin.cpp
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -3794,6 +4006,20 @@ msgid "Remove Poly And Point"
msgstr "Rimuovi Poligono e Punto"
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "Cancella Maschera Emissione"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "Genera AABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "Errore di caricamento immagine:"
@@ -3806,8 +4032,8 @@ msgid "Set Emission Mask"
msgstr "Imposta Maschera Emissione"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
-msgstr "Cancella Maschera Emissione"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -3817,6 +4043,27 @@ msgstr "Carica Maschera Emissione"
msgid "Generated Point Count:"
msgstr "Conteggio Punti Generati:"
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Tempo Medio (sec)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "Imposta Maschera Emissione"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "Crea da Scena"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Punti Emissione:"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr "Il nodo non contiene geometria."
@@ -3826,6 +4073,10 @@ msgid "Node does not contain geometry (faces)."
msgstr "Il nodo non contiene geometria (facce)."
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr "Un processor material di tipo 'ParticlesMaterial' é richiesto."
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "Le facce non contengono area!"
@@ -3838,12 +4089,12 @@ msgid "Generate AABB"
msgstr "Genera AABB"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
-msgstr "Crea Emitter Da Mesh"
+msgid "Create Emission Points From Mesh"
+msgstr "Crea Punti Emissione Da Mesh"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
-msgstr "Crea Emitter Da Nodo"
+msgid "Create Emission Points From Node"
+msgstr "Crea Punti Emissione Da Nodo"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Clear Emitter"
@@ -3854,26 +4105,45 @@ msgid "Create Emitter"
msgstr "Crea Emitter"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
-msgstr "Posizioni di Emissione:"
+msgid "Emission Points:"
+msgstr "Punti Emissione:"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr "Riempimento Emissione:"
+msgid "Surface Points"
+msgstr "Punti Superficie"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "Superficie"
+msgid "Surface Points+Normal (Directed)"
+msgstr "Punti superficie+Normali (Dirette)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "Volume"
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr "Sorgente Emissione: "
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "Genera AABB"
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr "Rimuovi Punto da Curva"
#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "Sposta Out-Control sulla Curva"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "Rimuovi Punto da Curva"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr "Aggiungi Punto a Curva"
@@ -3928,6 +4198,16 @@ msgstr "Dividi Percorso"
msgid "Remove Path Point"
msgstr "Rimuovi Punto Percorso"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Sposta Out-Control sulla Curva"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "Sposta In-Control sulla Curva"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "Crea UV Map"
@@ -4081,6 +4361,11 @@ msgid "Pitch"
msgstr "Pitch"
#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "Elimina Ossa"
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr "Errore durante il salvataggio del tema"
@@ -4168,10 +4453,6 @@ msgstr "Trova.."
msgid "Find Next"
msgstr "Trova Successivo"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "Debug"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr "Step Over"
@@ -4205,16 +4486,9 @@ msgid "Move Right"
msgstr "Sposta a Destra"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "Tutorials"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "Apri https://godotengine.org alla sezione tutorial."
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "Classi"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "Cerca Riferimenti nella documentazione."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
@@ -4233,9 +4507,8 @@ msgid "Go to next edited document."
msgstr "Vai al documento successivo."
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Discard"
-msgstr "Discreto"
+msgstr "Scarta"
#: editor/plugins/script_editor_plugin.cpp
msgid "Create Script"
@@ -4273,6 +4546,23 @@ msgid "Pick Color"
msgstr "Scegli Colore"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "Convertendo Immagini"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4323,6 +4613,14 @@ msgid "Trim Trailing Whitespace"
msgstr "Taglia Spazi in Coda"
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr "Auto Indenta"
@@ -4344,6 +4642,16 @@ msgid "Goto Previous Breakpoint"
msgstr "Vai a Breakpoint Precedente"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "Converti In.."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Converti In.."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "Trova Precedente"
@@ -4366,6 +4674,10 @@ msgstr "Vai a Linea.."
msgid "Contextual Help"
msgstr "Aiuto Contestuale"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr "Cambia Costante Scalare"
@@ -4583,36 +4895,106 @@ msgid "Animation Key Inserted."
msgstr "Key d'Animazione Inserito."
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Vai Avanti"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "All'indietro"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Rotellina Giù."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Aggiorna Cambiamenti"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Aggiorna Cambiamenti"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "Aggiorna Cambiamenti"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "Vertice"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr "Allinea a vista"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
-msgstr "Ambientazione"
+msgid "Display Normal"
+msgstr "Mostra Normale"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
-msgstr "Audio Listener"
+msgid "Display Wireframe"
+msgstr "Mostra Wireframe"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
-msgstr "Gizmos"
+msgid "Display Overdraw"
+msgstr "Mostra Overdraw"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
-msgstr "Finestra di XForm"
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Mostra senza Shader"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "Nessuna scena da istanziare selezionata!"
+#, fuzzy
+msgid "View Environment"
+msgstr "Ambientazione"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Istanzia a Cursore"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Gizmos"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "Impossibile istanziare la scena!"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr "Audio Listener"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "Finestra di XForm"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4671,6 +5053,26 @@ msgid "Align Selection With View"
msgstr "Allinea Selezione Con Vista"
#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "Seleziona"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "Sposta"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: Ruota"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "Scala:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
msgstr "Transform"
@@ -4683,14 +5085,6 @@ msgid "Transform Dialog.."
msgstr "Finestra di Transform.."
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr "Usa Luce Default"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "Usa sRGB Default"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
msgstr "1 Vista"
@@ -4715,22 +5109,6 @@ msgid "4 Viewports"
msgstr "4 Viste"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr "Mostra Normale"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr "Mostra Wireframe"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr "Mostra Overdraw"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr "Mostra senza Shader"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr "Visualizza Origine"
@@ -4739,6 +5117,10 @@ msgid "View Grid"
msgstr "Visualizza Griglia"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Impostazioni"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "Impostazioni Snap"
@@ -4759,14 +5141,6 @@ msgid "Viewport Settings"
msgstr "Impostazioni Viewport"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr "Normale Luce di Default:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr "Colore Luce Ambiente:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr "FOV Prospettiva (deg.):"
@@ -5105,24 +5479,20 @@ msgid "Error"
msgstr "Errore"
#: editor/project_export.cpp
-#, fuzzy
msgid "Runnable"
-msgstr "Abilita"
+msgstr "Eseguibile"
#: editor/project_export.cpp
-#, fuzzy
msgid "Delete patch '"
-msgstr "Elimina Input"
+msgstr "Elimina patch '"
#: editor/project_export.cpp
-#, fuzzy
msgid "Delete preset '%s'?"
-msgstr "Eliminare i file selezionati?"
+msgstr "Eliminare preset '%s'?"
#: editor/project_export.cpp
-#, fuzzy
msgid "Presets"
-msgstr "Preset.."
+msgstr "Presets"
#: editor/project_export.cpp editor/project_settings.cpp
msgid "Add.."
@@ -5133,74 +5503,67 @@ msgid "Resources"
msgstr "Risorse"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export all resources in the project"
-msgstr "Esporta tutte le risorse nel progetto."
+msgstr "Esporta tutte le risorse nel progetto"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export selected scenes (and dependencies)"
-msgstr "Esporta le risorse selezionate (incluse le dipendenze)."
+msgstr "Esporta le scene selezionate (incluse le dipendenze)"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export selected resources (and dependencies)"
-msgstr "Esporta le risorse selezionate (incluse le dipendenze)."
+msgstr "Esporta le risorse selezionate (incluse le dipendenze)"
#: editor/project_export.cpp
msgid "Export Mode:"
msgstr "Modalità d'Esportazione:"
#: editor/project_export.cpp
-#, fuzzy
msgid "Resources to export:"
-msgstr "Risorse da Esportare:"
+msgstr "Risorse da esportare:"
#: editor/project_export.cpp
-#, fuzzy
msgid ""
"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"
msgstr ""
"Filtri per esportare file che non son risorse (separati con virgola, es.: *."
-"json, *.txt):"
+"json, *.txt)"
#: editor/project_export.cpp
-#, fuzzy
msgid ""
"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)"
msgstr ""
"Filtri per escludere dall'esportazione (separati con virgola, es.: *.json, *."
-"txt):"
+"txt)"
#: editor/project_export.cpp
-#, fuzzy
msgid "Patches"
-msgstr "Corrispondenze:"
+msgstr "Patches"
#: editor/project_export.cpp
-#, fuzzy
msgid "Make Patch"
-msgstr "Percorso di destinazione:"
+msgstr "Crea Patch"
#: editor/project_export.cpp
msgid "Export templates for this platform are missing:"
-msgstr ""
+msgstr "Le export templates per questa piattaforma sono mancanti:"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export With Debug"
-msgstr "Esporta Tile Set"
+msgstr "Esporta Con Debug"
#: editor/project_manager.cpp
msgid "Invalid project path, the path must exist!"
msgstr "Percorso di progetto invalido, il percorso deve esistere!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "Percorso di progetto invalido, godot.cfg non deve esistere."
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Percorso di progetto invalido, godot.cfg non esiste."
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
msgstr "Percorso di progetto invalido, godot.cfg deve esistere."
#: editor/project_manager.cpp
@@ -5212,7 +5575,8 @@ msgid "Invalid project path (changed anything?)."
msgstr "Percorso di progetto invalido (cambiato qualcosa?)."
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
msgstr "Impossibile creare godot.cfg nel percorso di progetto."
#: editor/project_manager.cpp
@@ -5248,10 +5612,6 @@ msgid "Install Project:"
msgstr "Installa Progetto:"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "Installa"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "Sfoglia"
@@ -5312,6 +5672,11 @@ msgid "New Project"
msgstr "Nuovo Progetto"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Rimuovi Template"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "Esci"
@@ -5411,18 +5776,16 @@ msgid "Button 9"
msgstr "Pulsante 9"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Axis Index:"
-msgstr "Indice Asse Joystick:"
+msgstr "Indice Asse Joypad:"
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Axis"
msgstr "Asse"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Button Index:"
-msgstr "Indice Pulsante Joystick:"
+msgstr "Indice Pulsante Joypad:"
#: editor/project_settings.cpp
msgid "Add Input Action"
@@ -5432,6 +5795,11 @@ msgstr "Aggiungi azione di input"
msgid "Erase Input Action Event"
msgstr "Elimina Evento di Azione Input"
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "Aggiungi vuoto"
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Dispositivo"
@@ -5497,7 +5865,8 @@ msgid "Remove Resource Remap Option"
msgstr "Rimuovi Opzione di Remap Rimorse"
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
msgstr "Impostazioni Progetto (godot.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5564,14 +5933,9 @@ msgstr "Locale"
msgid "AutoLoad"
msgstr "AutoLoad"
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "Plugins"
-
#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Viewport"
-msgstr "1 Vista"
+msgstr "Scegli una Vista"
#: editor/property_editor.cpp
msgid "Ease In"
@@ -5610,20 +5974,14 @@ msgid "New Script"
msgstr "Nuovo Script"
#: editor/property_editor.cpp
-#, fuzzy
msgid "Show in File System"
-msgstr "FileSystem"
+msgstr "Mostra nel File System"
#: editor/property_editor.cpp
msgid "Error loading file: Not a resource!"
msgstr "Errore caricamento file: Non è una risorsa!"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "Impossibile caricare l'immagine"
-
-#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Node"
msgstr "Scegli un Nodo"
@@ -5769,7 +6127,7 @@ msgstr "Questa operazione non può essere eseguita senza una scena."
#: editor/scene_tree_dock.cpp
msgid "Can not perform with the root node."
-msgstr ""
+msgstr "Impossibile effettuare con il nodo di root."
#: editor/scene_tree_dock.cpp
msgid "This operation can't be done on instanced scenes."
@@ -5812,6 +6170,11 @@ msgid "Error duplicating scene to save it."
msgstr "Errore duplicando la scena per salvarla."
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Risorse:"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "Modifica Gruppi"
@@ -5852,9 +6215,8 @@ msgid "Save Branch as Scene"
msgstr "Salva Ramo come Scena"
#: editor/scene_tree_dock.cpp
-#, fuzzy
msgid "Copy Node Path"
-msgstr "Copia Percorso"
+msgstr "Copia Percorso Nodo"
#: editor/scene_tree_dock.cpp
msgid "Delete (No Confirm)"
@@ -5889,10 +6251,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "Abilita CanvasItem Visibile"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Opzioni di Debug"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "Istanza:"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Script successivo"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Abilita Spatial Visibile"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr "Nome nodo invalido, i caratteri seguenti non sono consentiti:"
@@ -5937,75 +6348,93 @@ msgid "Select a Node"
msgstr "Scegli un Nodo"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "Nome classe genitore invalido"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Impossibile creare script in filesystem."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "Caratteri Validi:"
+msgid "Error loading script from %s"
+msgstr "Errore caricamento script da %s"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "Nome classe invalido"
+msgid "Path is empty"
+msgstr "Percorso vuoto"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "Nome valido"
+msgid "Path is not local"
+msgstr "Percorso non locale"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "N/A"
+msgid "Invalid base path"
+msgstr "Percorso di base invalido"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "Nome classe invalido!"
+msgid "Invalid extension"
+msgstr "Estensione Invalida"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "Nome classe genitore invalido!"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "Percorso Invalido!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Percorso Invalido."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "Impossibile creare script in filesystem."
+msgid "Invalid class name"
+msgstr "Nome classe invalido"
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
-msgstr "Errore caricamento script da %s"
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "Nome proprietà indice invalido."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "Percorso vuoto"
+#, fuzzy
+msgid "Script valid"
+msgstr "Script"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "Percorso non locale"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "Percorso di base invalido"
+msgid "N/A"
+msgstr "N/A"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "Estensione Invalida"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+#, fuzzy
+msgid "Create new script file"
msgstr "Crea nuovo script"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+#, fuzzy
+msgid "Load existing script file"
msgstr "Carica script esistente"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "Eredita:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "Nome Classe:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Rimuovi Template"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "Built-In Script"
#: editor/script_create_dialog.cpp
@@ -6177,9 +6606,12 @@ msgid "Change Notifier Extents"
msgstr "Cambia Estensione di Notifier"
#: editor/spatial_editor_gizmos.cpp
-#, fuzzy
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
-msgstr "Cambia Estensione di Notifier"
+msgstr "Cambia Estensione Probe"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6512,11 +6944,31 @@ msgstr "appena premuto"
msgid "just released"
msgstr "appena rilasciato"
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr "Esegui nel Browser"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr "Esegui HTML esportato all'interno del browser di sistema di default."
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr "Impossibile scrivere file:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr "Impossibile leggere file:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr "Impossibile aprire template per l'esportazione:\n"
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr ""
-"Impossibile leggere il file del certificatio. Il percorso e la pasword sono "
+"Impossibile leggere il file del certificatio. Il percorso e la password sono "
"entrambi corretti?"
#: platform/uwp/export/export.cpp
@@ -6696,11 +7148,11 @@ msgstr ""
"Il nodo ParallaxLayer funziona solamente quando impostato come figlio di un "
"nodo ParallaxBackground."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"La proprietà path deve puntare a un nodo Particles2D valido per poter "
-"funzionare."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6784,6 +7236,11 @@ msgstr ""
"NavigationMeshInstance deve essere un figlio o nipote di un nodo Navigation. "
"Fornisce solamente dati per la navigazione."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6805,13 +7262,22 @@ msgstr ""
"Una risorsa SpriteFrames deve essere creata o impostata nella proprietà "
"'Frames' affinché AnimatedSprite3D mostri i frame."
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "Modalità esecuzione:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Attenzione!"
#: scene/gui/dialogs.cpp
msgid "Please Confirm..."
-msgstr "Si Prega Di Confermare..."
+msgstr "Per Favore Conferma..."
#: scene/gui/file_dialog.cpp
msgid "Open a File"
@@ -6849,6 +7315,15 @@ msgid ""
"Use a container as child (VBox,HBox,etc), or a Control and set the custom "
"minimum size manually."
msgstr ""
+"ScrollContainer é fatto per funzionare con un solo controllo figlio.\n"
+"Usa un container come figlio (VBox,HBox,etc), o un Control impostando la "
+"dimensione minima manualmente."
+
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
#: scene/main/viewport.cpp
msgid ""
@@ -6862,6 +7337,74 @@ msgstr ""
"Control, in modo che possa ottenere una dimensione. Altrimenti, renderlo un "
"RenderTarget e assegnare alla sua texture interna qualche nodo da mostrare."
+#~ msgid "Node From Scene"
+#~ msgstr "Nodo Da Scena"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Importa asset nel progetto."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Esporta il progetto a diverse piattaforme."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "Avverti quando una risorsa esterna è stata modificata."
+
+#~ msgid "Tutorials"
+#~ msgstr "Tutorials"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "Apri https://godotengine.org alla sezione tutorial."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "Nessuna scena da istanziare selezionata!"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "Istanzia a Cursore"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "Impossibile istanziare la scena!"
+
+#~ msgid "Use Default Light"
+#~ msgstr "Usa Luce Default"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "Usa sRGB Default"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "Normale Luce di Default:"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "Colore Luce Ambiente:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "Impossibile caricare l'immagine"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "Nome classe genitore invalido"
+
+#~ msgid "Valid chars:"
+#~ msgstr "Caratteri Validi:"
+
+#~ msgid "Valid name"
+#~ msgstr "Nome valido"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "Nome classe invalido!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "Nome classe genitore invalido!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "Percorso Invalido!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "La proprietà path deve puntare a un nodo Particles2D valido per poter "
+#~ "funzionare."
+
+#~ msgid "Surface"
+#~ msgstr "Superficie"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
@@ -6906,33 +7449,51 @@ msgstr ""
#~ msgid "No exporter for platform '%s' yet."
#~ msgstr "Per ora non vi è esportatore per la piattaforma '%s'."
-#, fuzzy
#~ msgid "Create Android keystore"
-#~ msgstr "Crea Nuova Risorsa"
+#~ msgstr "Crea keystore Android"
-#, fuzzy
#~ msgid "Full name"
-#~ msgstr "Nome valido"
+#~ msgstr "Nome completo"
+
+#~ msgid "Organizational unit"
+#~ msgstr "Unità organizzativa"
-#, fuzzy
#~ msgid "Organization"
-#~ msgstr "Transizione"
+#~ msgstr "Organizzazione"
+
+#~ msgid "City"
+#~ msgstr "Città"
-#, fuzzy
#~ msgid "State"
-#~ msgstr "Stato:"
+#~ msgstr "Stato"
+
+#~ msgid "2 letter country code"
+#~ msgstr "Codice nazione di 2 lettere"
+
+#~ msgid "User alias"
+#~ msgstr "Alias user"
-#, fuzzy
#~ msgid "Password"
-#~ msgstr "Password:"
+#~ msgstr "Password"
-#, fuzzy
#~ msgid "at least 6 characters"
-#~ msgstr "Caratteri validi:"
+#~ msgstr "almeno 6 caratteri"
-#, fuzzy
#~ msgid "File name"
-#~ msgstr "Nuovo nome:"
+#~ msgstr "Nome file"
+
+#~ msgid "Path : (better to save outside of project)"
+#~ msgstr "Percorso: (meglio salvare fuori dal progetto)"
+
+#~ msgid ""
+#~ "Release keystore is not set.\n"
+#~ "Do you want to create one?"
+#~ msgstr ""
+#~ "Keystore di release non impostato.\n"
+#~ "Vuoi crearne uno?"
+
+#~ msgid "Fill Keystore/Release User and Release Password"
+#~ msgstr "Completa Keystore/Utente Release e Password Release"
#~ msgid "Include"
#~ msgstr "Includi"
@@ -7060,9 +7621,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "Silenzio di coda:"
-#~ msgid "Script"
-#~ msgstr "Script"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Modalità Esportazione Script:"
@@ -7096,9 +7654,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance non contiene una risorsa BakedLight."
-#~ msgid "Vertex"
-#~ msgstr "Vertice"
-
#~ msgid "Fragment"
#~ msgstr "Frammento"
@@ -7141,9 +7696,6 @@ msgstr ""
#~ msgid "Cannot go into subdir:"
#~ msgstr "Impossibile accedere alla subdirectory:"
-#~ msgid "Help"
-#~ msgstr "Aiuto"
-
#~ msgid "Imported Resources"
#~ msgstr "Risorse Importate"
diff --git a/editor/translations/ja.po b/editor/translations/ja.po
index dbabe4d31f..8fa50e4512 100644
--- a/editor/translations/ja.po
+++ b/editor/translations/ja.po
@@ -4,19 +4,21 @@
#
# akirakido <achts.y@gmail.com>, 2016.
# hopping tappy (ãŸã£ã´ã•ã‚“) <hopping.tappy@gmail.com>, 2016.
+# Lexi Grafen <shfeedly@gmail.com>, 2017.
+# Tohru Ike (rokujyouhitoma) <rokujyouhitomajp@gmail.com>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2016-11-12 15:11+0000\n"
-"Last-Translator: akirakido <achts.y@gmail.com>\n"
+"PO-Revision-Date: 2017-06-10 13:13+0000\n"
+"Last-Translator: Tohru Ike (rokujyouhitoma) <rokujyouhitomajp@gmail.com>\n"
"Language-Team: Japanese <https://hosted.weblate.org/projects/godot-engine/"
"godot/ja/>\n"
"Language: ja\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.9\n"
+"X-Generator: Weblate 2.15-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -40,7 +42,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Anim Change Value"
-msgstr ""
+msgstr "値を変更"
#: editor/animation_editor.cpp
msgid "Anim Change Call"
@@ -357,6 +359,181 @@ msgstr "é…列ã®å€¤ã®ç¨®é¡žã®å¤‰æ›´"
msgid "Change Array Value"
msgstr "é…列ã®å€¤ã‚’変更"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "継続的"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "ファイル:"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "é–‰ã˜ã‚‹"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "接続"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "ãƒŽãƒ¼ãƒ‰ã«æŽ¥ç¶šã—ã¾ã™ã€‚"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "接続"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "テスト中"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "フォント読ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼ã€‚"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "ã™ã¹ã¦"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -364,6 +541,30 @@ msgstr "é…列ã®å€¤ã‚’変更"
msgid "Search:"
msgstr "検索:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "検索"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "ä¸¦ã¹æ›¿ãˆ:"
@@ -377,10 +578,6 @@ msgid "Category:"
msgstr "カテゴリー:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "ã™ã¹ã¦"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "サイト:"
@@ -392,7 +589,7 @@ msgstr "サãƒãƒ¼ãƒˆ."
msgid "Official"
msgstr "å…¬å¼"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "コミュニティ"
@@ -412,20 +609,6 @@ msgstr "'%s' ã®ãƒ¡ã‚½ãƒƒãƒ‰ä¸€è¦§ï¼š"
msgid "Call"
msgstr "呼ã³å‡ºã—"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "é–‰ã˜ã‚‹"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "メソッド一覧:"
@@ -476,13 +659,6 @@ msgid "Selection Only"
msgstr "é¸æŠžç¯„å›²ã®ã¿"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "検索"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "検索"
@@ -516,11 +692,11 @@ msgstr "スキップ"
#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
msgid "Zoom In"
-msgstr ""
+msgstr "ズームイン"
#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
msgid "Zoom Out"
-msgstr ""
+msgstr "ズームアウト"
#: editor/code_editor.cpp
msgid "Reset Zoom"
@@ -557,6 +733,7 @@ msgstr "追加"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "削除"
@@ -633,11 +810,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -670,6 +842,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -770,8 +943,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -781,6 +953,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -849,8 +1022,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Path:"
@@ -916,7 +1088,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1041,7 +1213,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1058,7 +1231,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1113,11 +1285,6 @@ msgstr ""
msgid "Clear"
msgstr "削除"
-#: editor/editor_node.cpp
-#, fuzzy
-msgid "Node From Scene"
-msgstr "シーンã‹ã‚‰ã®ãƒŽãƒ¼ãƒ‰"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1235,11 +1402,15 @@ msgid "There is no defined scene to run."
msgstr "実行ã™ã‚‹å®šç¾©æ¸ˆã¿ã®ã‚·ãƒ¼ãƒ³ã¯ã‚りã¾ã›ã‚“。"
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
+"é¸æŠžã—ãŸã‚·ãƒ¼ãƒ³ '%s' ã¯ã€ã‚·ãƒ¼ãƒ³ ファイルã§ã¯ã‚りã¾ã›ã‚“ã€æœ‰åйãªã‚‚ã®ã‚’é¸æŠžã—ã¦ã„"
+"ã¾ã™ã‹ï¼Ÿ\n"
+"'アプリケーション' カテゴリã®ä¸‹ã®'プロジェクトã®è¨­å®š'ã§å¤‰æ›´ã§ãã¾ã™ã€‚"
#: editor/editor_node.cpp
msgid ""
@@ -1298,6 +1469,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1354,7 +1529,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1392,6 +1567,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1445,7 +1624,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1473,50 +1652,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "終了ã—ã¦ãƒ—ロジェクトリストを開ã"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1524,47 +1676,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr ""
+msgid "Quit to Project List"
+msgstr "終了ã—ã¦ãƒ—ロジェクトリストを開ã"
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1635,8 +1755,8 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
+#: editor/editor_node.cpp
+msgid "Editor"
msgstr ""
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
@@ -1656,11 +1776,68 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "é–‰ã˜ã‚‹"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1744,6 +1921,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1771,12 +1956,35 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "ディレクトリを開ã"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "ディレクトリを開ã"
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "エディターを終了ã—ã¾ã™ã‹ï¼Ÿ"
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2020,6 +2228,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2048,10 +2260,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2218,7 +2426,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2693,7 +2901,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3357,7 +3565,7 @@ msgid "Change default type"
msgstr "é…列ã®å€¤ã®ç¨®é¡žã®å¤‰æ›´"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "決定"
@@ -3406,15 +3614,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3445,6 +3644,32 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Add point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "é¸æŠžã—ã¦ã„ã‚‹ã‚‚ã®ã‚’削除"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3715,6 +3940,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3727,7 +3965,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3738,6 +3976,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3747,6 +4002,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3759,11 +4018,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3775,26 +4034,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3849,6 +4124,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "é¸æŠžã—ã¦ã„ã‚‹ã‚‚ã®ã‚’削除"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -4002,6 +4286,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4091,10 +4379,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4128,15 +4412,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4192,6 +4468,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4242,6 +4534,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4263,6 +4563,15 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "ãƒŽãƒ¼ãƒ‰ã«æŽ¥ç¶šã—ã¾ã™ã€‚"
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4285,6 +4594,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4502,35 +4815,97 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "後方"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "ホイール下"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Shader Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4590,23 +4965,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "ã™ã¹ã¦é¸æŠž"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Local Coords"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4634,27 +5018,15 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4678,14 +5050,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5099,11 +5463,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5115,7 +5479,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5151,10 +5515,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5213,6 +5573,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "é¸æŠžã—ã¦ã„ã‚‹ã‚‚ã®ã‚’削除"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "終了"
@@ -5331,6 +5696,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "デãƒã‚¤ã‚¹"
@@ -5396,7 +5765,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5463,10 +5832,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5516,10 +5881,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "ノードã¸ã®ãƒ‘ス:"
@@ -5707,6 +6068,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5782,10 +6147,57 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "フォルダを作æˆ"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5830,77 +6242,88 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr ""
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "フォルダを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚"
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr ""
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "フォント読ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼ã€‚"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr ""
+#, fuzzy
+msgid "Invalid Path"
+msgstr "無効ãªãƒ•ォント サイズã§ã™ã€‚"
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-#, fuzzy
-msgid "Error loading script from %s"
-msgstr "フォント読ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼ã€‚"
+msgid "Invalid inherited parent name or path"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "フォルダを作æˆ"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Class Name"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr "é¸æŠžã—ã¦ã„ã‚‹ã‚‚ã®ã‚’削除"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6072,6 +6495,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6128,6 +6555,8 @@ msgid ""
"A node yielded without working memory, please read the docs on how to yield "
"properly!"
msgstr ""
+"使用メモリ外ã§ãƒŽãƒ¼ãƒ‰ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚æ­£ã—ã発生ã•ã›ã‚‹ãŸã‚ã«ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’ãŠèª­"
+"ã¿ãã ã•ã„。"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -6184,9 +6613,8 @@ msgid "Rename Signal"
msgstr ""
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Add Function"
-msgstr "関数を作æˆ"
+msgstr "関数を追加"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Variable"
@@ -6408,6 +6836,29 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "フォルダを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "フォルダを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "フォルダを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚"
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6571,11 +7022,11 @@ msgstr ""
"ParallaxLayer ノードã¯ã€ParallaxBackground ノードã®å­ã¨ã—ã¦è¨­å®šã•れã¦ã„ã‚‹å ´åˆ"
"ã®ã¿å‹•作ã—ã¾ã™ã€‚"
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"Path プロパティã¯ã€å‹•作ã™ã‚‹ã‚ˆã†ã«æœ‰åŠ¹ãª Particles2D ノードを示ã™å¿…è¦ãŒã‚りã¾"
-"ã™ã€‚"
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6659,6 +7110,11 @@ msgstr ""
"NavigationMeshInstance ã¯ã€ãƒŠãƒ“ゲーションノードã®å­ã‚„å­«ã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚"
"ã“れã¯ãƒŠãƒ“ゲーションデータã®ã¿æä¾›ã—ã¾ã™ã€‚"
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6682,6 +7138,14 @@ msgstr ""
"SpriteFrames リソースを作æˆã¾ãŸã¯ AnimatedSprite3D フレームを表示ã™ã‚‹ãŸã‚ã«"
"㯠'Frames' プロパティã«è¨­å®šã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚"
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "警告!"
@@ -6727,6 +7191,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6739,6 +7209,15 @@ msgstr ""
"ãりã¾ã™ã€‚ãれ以外ã®å ´åˆã€ãƒ¬ãƒ³ãƒ€ãƒ¼ ターゲットã—ã€ãã®å†…部ã®ãƒ†ã‚¯ã‚¹ãƒãƒ£è¡¨ç¤ºã®ã„"
"ãã¤ã‹ã®ãƒŽãƒ¼ãƒ‰ã«å‰²ã‚Šå½“ã¦ã¾ã™ã€‚"
+#, fuzzy
+#~ msgid "Node From Scene"
+#~ msgstr "シーンã‹ã‚‰ã®ãƒŽãƒ¼ãƒ‰"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Path プロパティã¯ã€å‹•作ã™ã‚‹ã‚ˆã†ã«æœ‰åŠ¹ãª Particles2D ノードを示ã™å¿…è¦ãŒã‚り"
+#~ "ã¾ã™ã€‚"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
diff --git a/editor/translations/ko.po b/editor/translations/ko.po
index 20d1aed61e..ee409ab97f 100644
--- a/editor/translations/ko.po
+++ b/editor/translations/ko.po
@@ -2,13 +2,13 @@
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
-# 박한얼 (volzhs) <volzhs@gmail.com>, 2016.
+# 박한얼 (volzhs) <volzhs@gmail.com>, 2016-2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2016-11-23 14:38+0000\n"
+"PO-Revision-Date: 2017-02-08 16:38+0000\n"
"Last-Translator: 박한얼 <volzhs@gmail.com>\n"
"Language-Team: Korean <https://hosted.weblate.org/projects/godot-engine/"
"godot/ko/>\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.10-dev\n"
+"X-Generator: Weblate 2.12-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -358,6 +358,184 @@ msgstr "배열 값 타입 변경"
msgid "Change Array Value"
msgstr "배열 값 변경"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "버전:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "ìƒìˆ˜:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "파ì¼"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "설명:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "설치"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "닫기"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "연결하기.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "연결할 노드:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "요청한 íŒŒì¼ í˜•ì‹ì„ 알 수 ì—†ìŒ:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "저장 중.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "연결하기.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "테스팅"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "리소스 저장 중 ì—러!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "아래"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "모ë‘"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -365,6 +543,30 @@ msgstr "배열 값 변경"
msgid "Search:"
msgstr "검색:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "검색"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "가져오기"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "플러그ì¸"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "ì •ë ¬:"
@@ -378,10 +580,6 @@ msgid "Category:"
msgstr "카테고리:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "모ë‘"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "사ì´íЏ:"
@@ -393,7 +591,7 @@ msgstr "ì§€ì›.."
msgid "Official"
msgstr "ê³µì‹"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "커뮤니티"
@@ -413,20 +611,6 @@ msgstr "'%s' 함수 목ë¡:"
msgid "Call"
msgstr "호출"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "닫기"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "함수 목ë¡:"
@@ -477,13 +661,6 @@ msgid "Selection Only"
msgstr "ì„ íƒì˜ì—­ë§Œ"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "검색"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "찾기"
@@ -560,6 +737,7 @@ msgstr "추가"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "삭제"
@@ -635,11 +813,6 @@ msgstr "최근:"
msgid "Matches:"
msgstr "ì¼ì¹˜:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "설명:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "대체할 ëŒ€ìƒ ì°¾ê¸°:"
@@ -674,6 +847,7 @@ msgstr "리소스"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "경로"
@@ -777,8 +951,7 @@ msgstr ""
msgid "Add Bus"
msgstr "%s 추가"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "로드"
@@ -788,6 +961,7 @@ msgid "Save As"
msgstr "다른 ì´ë¦„으로 저장"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Default"
@@ -858,8 +1032,7 @@ msgid "Rearrange Autoloads"
msgstr "ìžë™ 로드 위치 변경"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "경로:"
@@ -925,7 +1098,7 @@ msgstr "íŒŒì¼ ì €ìž¥ 중:"
msgid "Packing"
msgstr "패킹중"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1051,7 +1224,8 @@ msgstr "소스 조사"
msgid "(Re)Importing Assets"
msgstr "다시 가져오기"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "ë„ì›€ë§ ê²€ìƒ‰"
@@ -1068,7 +1242,6 @@ msgid "Class:"
msgstr "í´ëž˜ìФ:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "ìƒì†:"
@@ -1101,9 +1274,8 @@ msgid "Constants:"
msgstr "ìƒìˆ˜:"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Property Description:"
-msgstr "간단한 설명:"
+msgstr "ì†ì„± 설명:"
#: editor/editor_help.cpp
msgid "Method Description:"
@@ -1124,10 +1296,6 @@ msgstr " 출력:"
msgid "Clear"
msgstr "지우기"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "씬으로부터 노드 가져오기"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1242,10 +1410,11 @@ msgid "There is no defined scene to run."
msgstr "실행하기 위해 ì •ì˜ëœ ì”¬ì´ ì—†ìŠµë‹ˆë‹¤."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"ë©”ì¸ ì”¬ì´ ì§€ì •ë˜ì§€ 않았습니다. ì„ íƒí•˜ì‹œê² ìŠµë‹ˆê¹Œ?\n"
"ë‚˜ì¤‘ì— \"프로ì íЏ 설정\"ì˜ 'Application' 항목ì—서 변경할 수 있습니다."
@@ -1305,6 +1474,11 @@ msgid "Save Scene As.."
msgstr "ì”¬ì„ ë‹¤ë¥¸ ì´ë¦„으로 저장.."
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "노드"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr "ì´ ì”¬ì€ ì €ìž¥ë˜ì§€ 않았습니다. ì‹¤í–‰ì „ì— ì €ìž¥í•˜ì‹œê² ìŠµë‹ˆê¹Œ?"
@@ -1363,7 +1537,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "오우"
@@ -1403,6 +1577,10 @@ msgstr "%dê°œ 추가파ì¼"
msgid "%d more file(s) or folder(s)"
msgstr "%dê°œ 추가 íŒŒì¼ ë˜ëŠ” í´ë”"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "초집중 모드"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "씬"
@@ -1456,7 +1634,7 @@ msgstr "씬 닫기"
msgid "Close Goto Prev. Scene"
msgstr "ë‹«ê³  ì´ì „ 씬으로 ì´ë™"
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "최근 ì—´ì—ˆë˜ í•­ëª©"
@@ -1484,99 +1662,41 @@ msgid "Redo"
msgstr "다시 실행"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "스í¬ë¦½íЏ 실행"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "프로ì íЏ 설정"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "씬 ë˜ëŒë¦¬ê¸°"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "종료하고 프로ì íЏ 목ë¡ìœ¼ë¡œ ëŒì•„가기"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "초집중 모드"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "프로ì íŠ¸ë¡œ ì—ì…‹ 가져오기."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "가져오기"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "프로ì íЏ ë˜ëŠ” 씬 관련 여러가지 ë„구들."
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "ë„구"
+#, fuzzy
+msgid "Project"
+msgstr "새 프로ì íЏ"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "프로ì íŠ¸ë¥¼ ë§Žì€ í”Œëž«í¼ìœ¼ë¡œ 내보내기."
+msgid "Project Settings"
+msgstr "프로ì íЏ 설정"
+
+#: editor/editor_node.cpp
+msgid "Run Script"
+msgstr "스í¬ë¦½íЏ 실행"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "내보내기"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "프로ì íЏ 실행."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "재성"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "씬 ì¼ì‹œ ì •ì§€"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "씬 ì¼ì‹œ ì •ì§€"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "씬 정지."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "ì •ì§€"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "편집 ì¤‘ì¸ ì”¬ 실행."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "씬 실행"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "다른 씬 실행"
+msgid "Tools"
+msgstr "ë„구"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "커스텀 씬 실행"
+msgid "Quit to Project List"
+msgstr "종료하고 프로ì íЏ 목ë¡ìœ¼ë¡œ ëŒì•„가기"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "디버그 옵션"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "디버그"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1666,9 +1786,10 @@ msgstr ""
"ê¸°ê¸°ì— ì›ê²©ìœ¼ë¡œ 사용ë˜ëŠ” 경우, ë„¤íŠ¸ì›Œí¬ íŒŒì¼ ì‹œìŠ¤í…œê³¼ 함께하면 ë”ìš± 효과ì ìž…"
"니다."
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "설정"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "편집"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1688,12 +1809,69 @@ msgid "Manage Export Templates"
msgstr "내보내기 템플릿 로딩 중"
#: editor/editor_node.cpp
+msgid "Help"
+msgstr "ë„움ë§"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "í´ëž˜ìФ"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "문서 닫기"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr "ì •ë³´"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "외부 리소스가 변경ë˜ì—ˆì„ 때 알림."
+msgid "Play the project."
+msgstr "프로ì íЏ 실행."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "재성"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "씬 ì¼ì‹œ ì •ì§€"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "씬 ì¼ì‹œ ì •ì§€"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "씬 정지."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "ì •ì§€"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "편집 ì¤‘ì¸ ì”¬ 실행."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "씬 실행"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "다른 씬 실행"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "커스텀 씬 실행"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1776,6 +1954,14 @@ msgid "Thanks!"
msgstr "ê°ì‚¬í•©ë‹ˆë‹¤!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "ZIP 파ì¼ë¡œë¶€í„° í…œí”Œë¦¿ì„ ê°€ì ¸ì˜¤ê¸°"
@@ -1803,15 +1989,41 @@ msgstr "스í¬ë¦½íŠ¸ë¥¼ ì—´ê³  실행"
msgid "Load Errors"
msgstr "로드 ì—러"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "ì—디터ì—서 열기"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "ì—디터ì—서 열기"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "ì—디터ì—서 열기"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "ë¼ì´ë¸ŒëŸ¬ë¦¬ 내보내기"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "ì—디터ì—서 열기"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "ì—디터ì—서 열기"
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "ì„¤ì¹˜ëœ í”ŒëŸ¬ê·¸ì¸:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "버전:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "ì €ìž:"
@@ -2064,6 +2276,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "íŒŒì¼ ë§¤ë‹ˆì €ì—서 보기"
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr "ì¸ìŠ¤í„´ìŠ¤"
@@ -2092,10 +2308,6 @@ msgid "Info"
msgstr "ì •ë³´"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "íŒŒì¼ ë§¤ë‹ˆì €ì—서 보기"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "다시 가져오기.."
@@ -2263,9 +2475,10 @@ msgid "No target font resource!"
msgstr "í°íЏ 리소스 경로가 없습니다!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"유효하지 ì•Šì€ íŒŒì¼ í™•ìž¥ìž.\n"
".fnt 를 사용하세요."
@@ -2746,8 +2959,9 @@ msgid "Compress"
msgstr "ì••ì¶•"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr "프로ì íŠ¸ì— ì¶”ê°€ (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "프로ì íŠ¸ì— ì¶”ê°€ (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -3409,7 +3623,7 @@ msgid "Change default type"
msgstr "기본 타입 변경"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "확ì¸"
@@ -3460,15 +3674,6 @@ msgstr "í´ë¦¬ê³¤3D 만들기"
msgid "Set Handle"
msgstr "핸들 설정"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "ì¹¼ë¼ ëž¨í”„ í¬ì¸íЏ 추가/ì‚­ì œ"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr "ì¹¼ë¼ ëž¨í”„ 수정"
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr "메쉬 ë¼ì´ë¸ŒëŸ¬ë¦¬ ìƒì„± 중"
@@ -3499,6 +3704,35 @@ msgstr "씬으로부터 가져오기"
msgid "Update from Scene"
msgstr "씬으로부터 갱신하기"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "입력 추가"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "경로 í¬ì¸íЏ ì‚­ì œ"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "리소스 로드"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Modify Curve"
+msgstr "커브맵 수정"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "ì¹¼ë¼ ëž¨í”„ í¬ì¸íЏ 추가/ì‚­ì œ"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "ì¹¼ë¼ ëž¨í”„ 수정"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "항목 %d"
@@ -3772,6 +4006,20 @@ msgid "Remove Poly And Point"
msgstr "í´ë¦¬ê³¤ê³¼ í¬ì¸íЏ ì‚­ì œ"
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "ì—미션 ë§ˆìŠ¤í¬ ì •ë¦¬"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "AABB ìƒì„±"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "ì´ë¯¸ì§€ 로드 ì—러:"
@@ -3784,8 +4032,8 @@ msgid "Set Emission Mask"
msgstr "ì—미션 ë§ˆìŠ¤í¬ ì„¤ì •"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
-msgstr "ì—미션 ë§ˆìŠ¤í¬ ì •ë¦¬"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -3795,6 +4043,27 @@ msgstr "ì—미션 ë§ˆìŠ¤í¬ ë¡œë“œ"
msgid "Generated Point Count:"
msgstr "ìƒì„±ëœ í¬ì¸íЏ 개수:"
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "í‰ê·  시간 (ì´ˆ)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "ì—미션 ë§ˆìŠ¤í¬ ì„¤ì •"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "씬으로부터 만들기"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "ì—미션 위치:"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr "노드가 지오미트리를 í¬í•¨í•˜ê³  있지 않습니다."
@@ -3804,6 +4073,10 @@ msgid "Node does not contain geometry (faces)."
msgstr "노드가 지오미트리를 í¬í•¨í•˜ê³  있지 않습니다 (페ì´ìФ)."
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "페ì´ìŠ¤ê°€ ì˜ì—­ì„ 가지고 있지 않습니다!"
@@ -3816,11 +4089,13 @@ msgid "Generate AABB"
msgstr "AABB ìƒì„±"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+#, fuzzy
+msgid "Create Emission Points From Mesh"
msgstr "메쉬로부터 ì—미터 만들기"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+#, fuzzy
+msgid "Create Emission Points From Node"
msgstr "노드로부터 ì—미터 만들기"
#: editor/plugins/particles_editor_plugin.cpp
@@ -3832,26 +4107,48 @@ msgid "Create Emitter"
msgstr "ì—미터 만들기"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+#, fuzzy
+msgid "Emission Points:"
msgstr "ì—미션 위치:"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr "ì—미션 채움:"
+#, fuzzy
+msgid "Surface Points"
+msgstr "서페ì´ìФ %d"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "출사면"
+msgid "Surface Points+Normal (Directed)"
+msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "배출량"
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Source: "
+msgstr "ì—미션 채움:"
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "AABB ìƒì„±"
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr "커브ì—서 í¬ì¸íЏ ì‚­ì œ"
#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "ì»¤ë¸Œì˜ ì•„ì›ƒ-컨트롤 ì´ë™"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "커브ì—서 í¬ì¸íЏ ì‚­ì œ"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr "ì»¤ë¸Œì— í¬ì¸íЏ 추가"
@@ -3906,6 +4203,16 @@ msgstr "경로 나누기"
msgid "Remove Path Point"
msgstr "경로 í¬ì¸íЏ ì‚­ì œ"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "ì»¤ë¸Œì˜ ì•„ì›ƒ-컨트롤 ì´ë™"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "ì»¤ë¸Œì˜ ì¸-컨트롤 ì´ë™"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "UV 맵 만들기"
@@ -4059,6 +4366,11 @@ msgid "Pitch"
msgstr "피치"
#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "Bones 없애기"
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr "테마 저장 중 ì—러"
@@ -4146,10 +4458,6 @@ msgstr "찾기.."
msgid "Find Next"
msgstr "ë‹¤ìŒ ì°¾ê¸°"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "디버그"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr "한 ë‹¨ê³„ì‹ ì½”ë“œ 실행"
@@ -4183,16 +4491,9 @@ msgid "Move Right"
msgstr "오른쪽으로 ì´ë™"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "튜토리얼"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "https://godotengine.orgì˜ íŠœí† ë¦¬ì–¼ ë¶€ë¶„ì„ ì—½ë‹ˆë‹¤."
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "í´ëž˜ìФ"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "ë ˆí¼ëŸ°ìФ 문서 검색."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
@@ -4249,6 +4550,23 @@ msgid "Pick Color"
msgstr "ìƒ‰ìƒ ì„ íƒ"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "ì´ë¯¸ì§€ 변환 중"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4299,6 +4617,14 @@ msgid "Trim Trailing Whitespace"
msgstr "후행 공백 ë¬¸ìž ì œê±°"
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr "ìžë™ 들여쓰기"
@@ -4320,6 +4646,16 @@ msgid "Goto Previous Breakpoint"
msgstr "ì´ì „ 중단ì ìœ¼ë¡œ ì´ë™"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "변환.."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "변환.."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "ì´ì „ 찾기"
@@ -4342,6 +4678,10 @@ msgstr "ë¼ì¸ìœ¼ë¡œ ì´ë™.."
msgid "Contextual Help"
msgstr "ë„ì›€ë§ ë³´ê¸°"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr "Scalar ìƒìˆ˜ 변경"
@@ -4559,36 +4899,106 @@ msgid "Animation Key Inserted."
msgstr "애니메ì´ì…˜ 키가 삽입ë˜ì—ˆìŠµë‹ˆë‹¤."
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "앞으로 가기"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "뒤로"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "휠 아래로."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "변경사항만 갱신"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "변경사항만 갱신"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "변경사항만 갱신"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "버í…스"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr "ë·°ì— ì •ë ¬"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
-msgstr "환경"
+msgid "Display Normal"
+msgstr "Normal 표시"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
-msgstr "오디오 리스너"
+msgid "Display Wireframe"
+msgstr "Wireframe 표시"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
-msgstr "기즈모"
+msgid "Display Overdraw"
+msgstr "Overdraw 표시"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
-msgstr "변환 다ì´ì–¼ë¡œê·¸"
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Shadeless 표시"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "ì¸ìŠ¤í„´ìŠ¤í•  ì”¬ì´ ì„ íƒë˜ì§€ 않았습니다!"
+#, fuzzy
+msgid "View Environment"
+msgstr "환경"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "ì»¤ì„œì— ì¸ìŠ¤í„´ìŠ¤ 만들기"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "기즈모"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Information"
+msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "ì”¬ì„ ì¸ìŠ¤í„´ìŠ¤ í•  수 없습니다!"
+msgid "Audio Listener"
+msgstr "오디오 리스너"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "변환 다ì´ì–¼ë¡œê·¸"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4647,6 +5057,26 @@ msgid "Align Selection With View"
msgstr "ì„ íƒ í•­ëª©ì„ ë·°ì— ì •ë ¬"
#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "ì„ íƒ"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "ì´ë™"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "컨트롤: 회전"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "í¬ê¸°:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
msgstr "변환"
@@ -4659,14 +5089,6 @@ msgid "Transform Dialog.."
msgstr "변환 다ì´ì–¼ë¡œê·¸.."
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr "기본 Light 사용"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "기본 sRGB 사용"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
msgstr "1ê°œ ë·°í¬íЏ"
@@ -4691,22 +5113,6 @@ msgid "4 Viewports"
msgstr "4ê°œ ë·°í¬íЏ"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr "Normal 표시"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr "Wireframe 표시"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr "Overdraw 표시"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr "Shadeless 표시"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr "ì›ì  보기"
@@ -4715,6 +5121,10 @@ msgid "View Grid"
msgstr "그리드 보기"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "설정"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "스냅 설정"
@@ -4735,14 +5145,6 @@ msgid "Viewport Settings"
msgstr "ë·°í¬íЏ 설정"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr "기본 ë¼ì´íЏ ë…¸ë§:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr "환경 ê´‘ 색ìƒ:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr "ì›ê·¼ 시야 (ë„):"
@@ -5168,12 +5570,14 @@ msgid "Invalid project path, the path must exist!"
msgstr "프로ì íЏ 경로가 유효하지 않습니다. 경로가 반드시 존재해야 합니다!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "프로ì íЏ 경로가 유효하지 않습니다. godot.cfgê°€ 있으면 안ë©ë‹ˆë‹¤."
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "프로ì íЏ 경로가 유효하지 않습니다. engine.cfgê°€ 있으면 안ë©ë‹ˆë‹¤."
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr "프로ì íЏ 경로가 유효하지 않습니다. godot.cfgê°€ 존재해야합니다."
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "프로ì íЏ 경로가 유효하지 않습니다. engine.cfgê°€ 존재해야합니다."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5184,8 +5588,9 @@ msgid "Invalid project path (changed anything?)."
msgstr "유효하지 ì•Šì€ í”„ë¡œì íЏ 경로 (뭔가 변경하신 ê±°ë¼ë„?)."
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
-msgstr "프로ì íЏ ê²½ë¡œì— godot.cfg를 ìƒì„±í•  수 없습니다."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "프로ì íЏ ê²½ë¡œì— engine.cfg를 ìƒì„±í•  수 없습니다."
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
@@ -5220,10 +5625,6 @@ msgid "Install Project:"
msgstr "프로ì íЏ 설치:"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "설치"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "찾아보기"
@@ -5283,6 +5684,11 @@ msgid "New Project"
msgstr "새 프로ì íЏ"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "ì•„ì´í…œ ì‚­ì œ"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "종료"
@@ -5403,6 +5809,11 @@ msgstr "입력 액션 추가"
msgid "Erase Input Action Event"
msgstr "ìž…ë ¥ ì•¡ì…˜ ì´ë²¤íЏ ì‚­ì œ"
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "빈 프레임 추가"
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "기기"
@@ -5468,8 +5879,9 @@ msgid "Remove Resource Remap Option"
msgstr "리소스 리맵핑 옵션 제거"
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr "프로ì íЏ 설정 (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "프로ì íЏ 설정 (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5535,10 +5947,6 @@ msgstr "지역"
msgid "AutoLoad"
msgstr "ìžë™ 로드"
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "플러그ì¸"
-
#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Viewport"
@@ -5590,10 +5998,6 @@ msgid "Error loading file: Not a resource!"
msgstr "íŒŒì¼ ë¡œë“œ ì—러: 리소스가 아닙니다!"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "ì´ë¯¸ì§€ë¥¼ 로드할 수 ì—†ìŒ"
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "노드 ì„ íƒ"
@@ -5780,6 +6184,11 @@ msgid "Error duplicating scene to save it."
msgstr "저장하기 위해 ì”¬ì„ ë³µì œí•˜ëŠ” ì¤‘ì— ì—러가 ë°œìƒí–ˆìŠµë‹ˆë‹¤."
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "리소스:"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "그룹 편집"
@@ -5856,10 +6265,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "CanvasItem ë³´ì´ê¸° 토글"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "디버그 옵션"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "ì¸ìŠ¤í„´ìŠ¤:"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "ë‹¤ìŒ ìŠ¤í¬ë¦½íЏ"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Spatial ë³´ì´ê¸° 토글"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr "유효하지 ì•Šì€ ë…¸ë“œ ì´ë¦„입니다. 다ìŒì˜ 문ìžëŠ” 허용ë˜ì§€ 않습니다:"
@@ -5904,75 +6362,93 @@ msgid "Select a Node"
msgstr "노드 ì„ íƒ"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "유요하지 ì•Šì€ ë¶€ëª¨ í´ëž˜ìŠ¤ëª…"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "íŒŒì¼ ì‹œìŠ¤í…œì— ìŠ¤í¬ë¦½íŠ¸ë¥¼ ìƒì„±í•  수 없습니다."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "유요한 문ìž:"
+msgid "Error loading script from %s"
+msgstr "'%s' 스í¬ë¦½íЏ 로딩 중 ì—러"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "유요하지 ì•Šì€ í´ëž˜ìŠ¤ëª…"
+msgid "Path is empty"
+msgstr "경로가 비어 있ìŒ"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "유요한 ì´ë¦„"
+msgid "Path is not local"
+msgstr "경로가 ë¡œì»¬ì´ ì•„ë‹˜"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "해당 ì—†ìŒ"
+msgid "Invalid base path"
+msgstr "기본 경로가 유요하지 않ìŒ"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "í´ëž˜ìŠ¤ëª…ì´ ìœ íš¨í•˜ì§€ 않습니다!"
+msgid "Invalid extension"
+msgstr "확장ìžê°€ 유요하지 않ìŒ"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "부모 í´ëž˜ìŠ¤ëª…ì´ ìœ íš¨í•˜ì§€ 않습니다!"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "경로가 유효하지 않습니다!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "유효하지 ì•Šì€ ê²½ë¡œ."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "íŒŒì¼ ì‹œìŠ¤í…œì— ìŠ¤í¬ë¦½íŠ¸ë¥¼ ìƒì„±í•  수 없습니다."
+msgid "Invalid class name"
+msgstr "유요하지 ì•Šì€ í´ëž˜ìŠ¤ëª…"
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
-msgstr "'%s' 스í¬ë¦½íЏ 로딩 중 ì—러"
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "유요하지 ì•Šì€ ì¸ë±ìФ ì†ì„±ëª…."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "경로가 비어 있ìŒ"
+#, fuzzy
+msgid "Script valid"
+msgstr "스í¬ë¦½íЏ"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "경로가 ë¡œì»¬ì´ ì•„ë‹˜"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "기본 경로가 유요하지 않ìŒ"
+msgid "N/A"
+msgstr "해당 ì—†ìŒ"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "확장ìžê°€ 유요하지 않ìŒ"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+#, fuzzy
+msgid "Create new script file"
msgstr "새 스í¬ë¦½íЏ 만들기"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+#, fuzzy
+msgid "Load existing script file"
msgstr "기존 스í¬ë¦½íЏ 로드하기"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "ìƒì†:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "í´ëž˜ìŠ¤ëª…:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "ì•„ì´í…œ ì‚­ì œ"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "내장 스í¬ë¦½íЏ"
#: editor/script_create_dialog.cpp
@@ -6144,9 +6620,12 @@ msgid "Change Notifier Extents"
msgstr "Notifier 범위 변경"
#: editor/spatial_editor_gizmos.cpp
-#, fuzzy
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
-msgstr "Notifier 범위 변경"
+msgstr "프로브 범위 변경"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6465,7 +6944,32 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Run in Browser"
+msgstr "찾아보기"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "타ì¼ì„ ì°¾ì„ ìˆ˜ ì—†ìŒ:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "타ì¼ì„ ì°¾ì„ ìˆ˜ ì—†ìŒ:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "í´ë”를 만들 수 없습니다."
+
#: platform/uwp/export/export.cpp
+#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr "ì¸ì¦ì„œ 파ì¼ì„ ì½ì„ 수 없습니다. 경로와 비밀번호가 정확합니까?"
@@ -6625,9 +7129,11 @@ msgid ""
msgstr ""
"ParallaxLayer는 ParallaxBackground ë…¸ë“œì˜ ìžì‹ë…¸ë“œë¡œ ìžˆì„ ë•Œë§Œ ë™ìž‘합니다."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
-msgstr "Path ì†ì„±ì€ 유효한 Particles2D 노드를 가리켜야 합니다."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6707,6 +7213,11 @@ msgstr ""
"NavigationMeshInstanceì€ Navigation ë…¸ë“œì˜ í•˜ìœ„ì— ìžˆì–´ì•¼ 합니다. ì´ê²ƒì€ 네비"
"게ì´ì…˜ ë°ì´íƒ€ë§Œì„ 제공합니다."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr "Path ì†ì„±ì€ 유효한 Spatial 노드를 가리켜야 합니다."
@@ -6724,6 +7235,15 @@ msgstr ""
"AnimatedSprite3Dê°€ í”„ë ˆìž„ì„ ë³´ì—¬ì£¼ê¸° 위해서는 'Frames' ì†ì„±ì— SpriteFrames 리"
"소스 만들거나 지정해야 합니다."
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "실행 모드:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "경고!"
@@ -6768,6 +7288,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6780,6 +7306,72 @@ msgstr ""
"합니다. 그렇지 ì•Šì„ ê²½ìš°, í™”ë©´ì— í‘œì‹œí•˜ê¸° 위해서는 Render target으로 설정하"
"ê³  ë‚´ë¶€ì ì¸ í…스ì³ë¥¼ 다른 ë…¸ë“œì— í• ë‹¹í•´ì•¼ 합니다."
+#~ msgid "Node From Scene"
+#~ msgstr "씬으로부터 노드 가져오기"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "프로ì íŠ¸ë¡œ ì—ì…‹ 가져오기."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "프로ì íŠ¸ë¥¼ ë§Žì€ í”Œëž«í¼ìœ¼ë¡œ 내보내기."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "외부 리소스가 변경ë˜ì—ˆì„ 때 알림."
+
+#~ msgid "Tutorials"
+#~ msgstr "튜토리얼"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "https://godotengine.orgì˜ íŠœí† ë¦¬ì–¼ ë¶€ë¶„ì„ ì—½ë‹ˆë‹¤."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "ì¸ìŠ¤í„´ìŠ¤í•  ì”¬ì´ ì„ íƒë˜ì§€ 않았습니다!"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "ì»¤ì„œì— ì¸ìŠ¤í„´ìŠ¤ 만들기"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "ì”¬ì„ ì¸ìŠ¤í„´ìŠ¤ í•  수 없습니다!"
+
+#~ msgid "Use Default Light"
+#~ msgstr "기본 Light 사용"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "기본 sRGB 사용"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "기본 ë¼ì´íЏ ë…¸ë§:"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "환경 ê´‘ 색ìƒ:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "ì´ë¯¸ì§€ë¥¼ 로드할 수 ì—†ìŒ"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "유요하지 ì•Šì€ ë¶€ëª¨ í´ëž˜ìŠ¤ëª…"
+
+#~ msgid "Valid chars:"
+#~ msgstr "유요한 문ìž:"
+
+#~ msgid "Valid name"
+#~ msgstr "유요한 ì´ë¦„"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "í´ëž˜ìŠ¤ëª…ì´ ìœ íš¨í•˜ì§€ 않습니다!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "부모 í´ëž˜ìŠ¤ëª…ì´ ìœ íš¨í•˜ì§€ 않습니다!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "경로가 유효하지 않습니다!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr "Path ì†ì„±ì€ 유효한 Particles2D 노드를 가리켜야 합니다."
+
+#~ msgid "Surface"
+#~ msgstr "출사면"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
@@ -6824,33 +7416,26 @@ msgstr ""
#~ msgid "No exporter for platform '%s' yet."
#~ msgstr "'%s' 플랫í¼ìœ¼ë¡œ 내보내기 위한 템플릿 파ì¼ì´ 없습니다."
-#, fuzzy
#~ msgid "Create Android keystore"
-#~ msgstr "새 리소스 만들기"
+#~ msgstr "안드로ì´ë“œ 키스토어 만들기"
-#, fuzzy
#~ msgid "Full name"
-#~ msgstr "유요한 ì´ë¦„"
+#~ msgstr "성명"
-#, fuzzy
#~ msgid "Organization"
-#~ msgstr "전환"
+#~ msgstr "ì¡°ì§"
-#, fuzzy
#~ msgid "State"
-#~ msgstr "ìƒíƒœ:"
+#~ msgstr "주(State)"
-#, fuzzy
#~ msgid "Password"
-#~ msgstr "암호:"
+#~ msgstr "암호"
-#, fuzzy
#~ msgid "at least 6 characters"
-#~ msgstr "유효한 문ìž:"
+#~ msgstr "최소 6 글ìž"
-#, fuzzy
#~ msgid "File name"
-#~ msgstr "새 ì´ë¦„:"
+#~ msgstr "파ì¼ëª…"
#~ msgid "Include"
#~ msgstr "í¬í•¨"
@@ -6978,9 +7563,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "ëì˜ ë¬´ìŒ:"
-#~ msgid "Script"
-#~ msgstr "스í¬ë¦½íЏ"
-
#~ msgid "Script Export Mode:"
#~ msgstr "스í¬ë¦½íЏ 내보내기 모드:"
@@ -7014,9 +7596,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance가 BakedLight 리소스를 가지고 있지 않습니다."
-#~ msgid "Vertex"
-#~ msgstr "버í…스"
-
#~ msgid "Fragment"
#~ msgstr "프래그먼트"
@@ -7052,9 +7631,6 @@ msgstr ""
#~ msgid "Cannot go into subdir:"
#~ msgstr "하위 디렉토리로 ì´ë™í•  수 없습니다:"
-#~ msgid "Help"
-#~ msgstr "ë„움ë§"
-
#~ msgid "Imported Resources"
#~ msgstr "가져온 리소스"
diff --git a/editor/translations/nb.po b/editor/translations/nb.po
index c9dc30e246..3e522bbe49 100644
--- a/editor/translations/nb.po
+++ b/editor/translations/nb.po
@@ -2,24 +2,25 @@
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
+# Anonymous <GentleSaucepan@protonmail.com>, 2017.
# Jørgen Aarmo Lund <jorgen.aarmo@gmail.com>, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2016-08-29 19:46+0000\n"
-"Last-Translator: Jørgen Aarmo Lund <jorgen.aarmo@gmail.com>\n"
+"PO-Revision-Date: 2017-04-08 17:45+0000\n"
+"Last-Translator: Anonymous <GentleSaucepan@protonmail.com>\n"
"Language-Team: Norwegian Bokmål <https://hosted.weblate.org/projects/godot-"
"engine/godot/nb/>\n"
"Language: nb\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.8-dev\n"
+"X-Generator: Weblate 2.13-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
-msgstr ""
+msgstr "Avslått"
#: editor/animation_editor.cpp
msgid "All Selection"
@@ -27,11 +28,11 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Move Add Key"
-msgstr ""
+msgstr "Flytt Legg til Nøkkel"
#: editor/animation_editor.cpp
msgid "Anim Change Transition"
-msgstr ""
+msgstr "Anim Forandre Overgang"
#: editor/animation_editor.cpp
msgid "Anim Change Transform"
@@ -39,39 +40,39 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Anim Change Value"
-msgstr ""
+msgstr "Anim Forandre Verdi"
#: editor/animation_editor.cpp
msgid "Anim Change Call"
-msgstr ""
+msgstr "Anim Forandre Anrop"
#: editor/animation_editor.cpp
msgid "Anim Add Track"
-msgstr ""
+msgstr "Anim Legg til Spor"
#: editor/animation_editor.cpp
msgid "Anim Duplicate Keys"
-msgstr ""
+msgstr "Anim Dupliser Nøkler"
#: editor/animation_editor.cpp
msgid "Move Anim Track Up"
-msgstr ""
+msgstr "Flytt Anim Spor Opp"
#: editor/animation_editor.cpp
msgid "Move Anim Track Down"
-msgstr ""
+msgstr "Flytt Anim Spor Ned"
#: editor/animation_editor.cpp
msgid "Remove Anim Track"
-msgstr ""
+msgstr "Fjern Anim Spor"
#: editor/animation_editor.cpp
msgid "Set Transitions to:"
-msgstr ""
+msgstr "Sett Overganger til:"
#: editor/animation_editor.cpp
msgid "Anim Track Rename"
-msgstr ""
+msgstr "Anim Spor Endre navn"
#: editor/animation_editor.cpp
msgid "Anim Track Change Interpolation"
@@ -79,7 +80,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Anim Track Change Value Mode"
-msgstr ""
+msgstr "Anim Spor Forandre Verdi Modus"
#: editor/animation_editor.cpp
msgid "Anim Track Change Wrap Mode"
@@ -87,47 +88,47 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
-msgstr ""
+msgstr "Forandre Node Kurve"
#: editor/animation_editor.cpp
msgid "Edit Selection Curve"
-msgstr ""
+msgstr "Forandre Utvalgskurve"
#: editor/animation_editor.cpp
msgid "Anim Delete Keys"
-msgstr ""
+msgstr "Anim Fjern Nøkler"
#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
msgid "Duplicate Selection"
-msgstr ""
+msgstr "Dupliser Utvalg"
#: editor/animation_editor.cpp
msgid "Duplicate Transposed"
-msgstr ""
+msgstr "Dupliser Transponert"
#: editor/animation_editor.cpp
msgid "Remove Selection"
-msgstr ""
+msgstr "Fjern Utvalg"
#: editor/animation_editor.cpp
msgid "Continuous"
-msgstr ""
+msgstr "Kontinuerlig"
#: editor/animation_editor.cpp
msgid "Discrete"
-msgstr ""
+msgstr "Diskret"
#: editor/animation_editor.cpp
msgid "Trigger"
-msgstr ""
+msgstr "Avtrekker"
#: editor/animation_editor.cpp
msgid "Anim Add Key"
-msgstr ""
+msgstr "Anim Legg til Nøkkel"
#: editor/animation_editor.cpp
msgid "Anim Move Keys"
-msgstr ""
+msgstr "Anim Flytt Nøkler"
#: editor/animation_editor.cpp
msgid "Scale Selection"
@@ -139,7 +140,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Goto Next Step"
-msgstr ""
+msgstr "GÃ¥ til Neste Steg"
#: editor/animation_editor.cpp
msgid "Goto Prev Step"
@@ -355,6 +356,175 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Kontinuerlig"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "View Files"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Lukk"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connecting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Error making request"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -362,6 +532,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -375,10 +569,6 @@ msgid "Category:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr ""
@@ -390,7 +580,7 @@ msgstr ""
msgid "Official"
msgstr ""
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr ""
@@ -408,21 +598,7 @@ msgstr ""
#: editor/call_dialog.cpp modules/visual_script/visual_script_editor.cpp
msgid "Call"
-msgstr ""
-
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr ""
+msgstr "Ring"
#: editor/call_dialog.cpp
msgid "Method List:"
@@ -473,13 +649,6 @@ msgid "Selection Only"
msgstr ""
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr ""
@@ -554,6 +723,7 @@ msgstr ""
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr ""
@@ -629,11 +799,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -664,6 +829,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -764,8 +930,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -775,6 +940,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -843,8 +1009,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr ""
@@ -910,7 +1075,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1035,7 +1200,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1052,7 +1218,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1066,7 +1231,7 @@ msgstr ""
#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
msgid "Members:"
-msgstr ""
+msgstr "Medlemmer:"
#: editor/editor_help.cpp
msgid "Public Methods:"
@@ -1078,7 +1243,7 @@ msgstr ""
#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
msgid "Signals:"
-msgstr ""
+msgstr "Signaler:"
#: editor/editor_help.cpp
msgid "Constants:"
@@ -1107,10 +1272,6 @@ msgstr ""
msgid "Clear"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1226,8 +1387,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1281,6 +1442,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1337,7 +1502,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1375,6 +1540,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1427,7 +1596,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1455,50 +1624,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1506,47 +1648,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1617,9 +1727,10 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr ""
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Rediger"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1638,11 +1749,67 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1726,6 +1893,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1753,12 +1928,32 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+msgid "Open 2D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 3D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2000,6 +2195,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2028,10 +2227,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2197,7 +2392,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2672,7 +2867,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3189,7 +3384,7 @@ msgstr ""
#: editor/plugins/shader_editor_plugin.cpp editor/project_manager.cpp
#: modules/visual_script/visual_script_editor.cpp
msgid "Edit"
-msgstr ""
+msgstr "Rediger"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
@@ -3332,7 +3527,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr ""
@@ -3381,15 +3576,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3420,6 +3606,32 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Add point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Fjern Funksjon"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3689,6 +3901,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3701,7 +3926,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3712,6 +3937,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3721,6 +3963,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3733,11 +3979,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3749,26 +3995,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3823,6 +4085,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Fjern Funksjon"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3976,6 +4247,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4063,10 +4338,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4100,15 +4371,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4163,6 +4426,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4213,6 +4492,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4234,6 +4521,14 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4256,6 +4551,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4473,35 +4772,96 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Forandre"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4561,23 +4921,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "Slett Valgte"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Local Coords"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4605,27 +4974,15 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4649,14 +5006,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5069,11 +5418,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5085,7 +5434,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5121,10 +5470,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5183,6 +5528,10 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+msgid "Templates"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5301,6 +5650,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr ""
@@ -5366,7 +5719,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5433,10 +5786,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5486,12 +5835,9 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
+#, fuzzy
msgid "Pick a Node"
-msgstr ""
+msgstr "Lim inn Noder"
#: editor/property_editor.cpp
msgid "Bit %d, val %d."
@@ -5503,7 +5849,7 @@ msgstr ""
#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
msgid "Set"
-msgstr ""
+msgstr "Sett"
#: editor/property_editor.cpp
msgid "Properties:"
@@ -5674,6 +6020,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5714,8 +6064,9 @@ msgid "Save Branch as Scene"
msgstr ""
#: editor/scene_tree_dock.cpp
+#, fuzzy
msgid "Copy Node Path"
-msgstr ""
+msgstr "Kopier Noder"
#: editor/scene_tree_dock.cpp
msgid "Delete (No Confirm)"
@@ -5748,10 +6099,56 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Open script"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5796,75 +6193,84 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
+msgid "Error - Could not create script in filesystem."
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
+msgid "Error loading script from %s"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr ": Ugyldige argumenter: "
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid inherited parent name or path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Create new script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Class Name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Template"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6036,6 +6442,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6059,11 +6469,11 @@ msgstr ""
#: modules/gdscript/gd_functions.cpp
msgid "Not based on a script"
-msgstr ""
+msgstr "Ikke basert på et skript"
#: modules/gdscript/gd_functions.cpp
msgid "Not based on a resource file"
-msgstr ""
+msgstr "Ikke basert på en ressursfil"
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary format (missing @path)"
@@ -6098,6 +6508,8 @@ msgid ""
"Return value must be assigned to first element of node working memory! Fix "
"your node please."
msgstr ""
+"Returverdi må bli tidelt til det første elementet av node fungerende minne! "
+"Fiks noden din vær så snill."
#: modules/visual_script/visual_script.cpp
msgid "Node returned an invalid sequence output: "
@@ -6113,19 +6525,19 @@ msgstr ""
#: modules/visual_script/visual_script_editor.cpp
msgid "Functions:"
-msgstr ""
+msgstr "Funksjoner:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Variables:"
-msgstr ""
+msgstr "Variabler:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Name is not a valid identifier:"
-msgstr ""
+msgstr "Navn er ikke en gyldig identifikator:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Name already in use by another func/var/signal:"
-msgstr ""
+msgstr "Navn er allerede brykt av en annen funksjon/var/signal:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Rename Function"
@@ -6153,7 +6565,7 @@ msgstr ""
#: modules/visual_script/visual_script_editor.cpp
msgid "Remove Function"
-msgstr ""
+msgstr "Fjern Funksjon"
#: modules/visual_script/visual_script_editor.cpp
msgid "Remove Variable"
@@ -6182,6 +6594,8 @@ msgstr ""
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature."
msgstr ""
+"Hold Meta for å slippe en Getter. Hold Skift for å slippe en generisk "
+"signatur."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature."
@@ -6189,11 +6603,11 @@ msgstr ""
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a simple reference to the node."
-msgstr ""
+msgstr "Hold Meta for å slippe en enkel referanse til noden."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Ctrl to drop a simple reference to the node."
-msgstr ""
+msgstr "Hold Ctrl for å slippe en simpel referanse til noden."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a Variable Setter."
@@ -6209,7 +6623,7 @@ msgstr ""
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Node(s) From Tree"
-msgstr ""
+msgstr "Legg til node(r) fra tre"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Getter Property"
@@ -6221,15 +6635,15 @@ msgstr ""
#: modules/visual_script/visual_script_editor.cpp
msgid "Condition"
-msgstr ""
+msgstr "Betingelse"
#: modules/visual_script/visual_script_editor.cpp
msgid "Sequence"
-msgstr ""
+msgstr "Sekvens"
#: modules/visual_script/visual_script_editor.cpp
msgid "Switch"
-msgstr ""
+msgstr "Bryter"
#: modules/visual_script/visual_script_editor.cpp
msgid "Iterator"
@@ -6237,15 +6651,15 @@ msgstr ""
#: modules/visual_script/visual_script_editor.cpp
msgid "While"
-msgstr ""
+msgstr "Mens"
#: modules/visual_script/visual_script_editor.cpp
msgid "Return"
-msgstr ""
+msgstr "Returner"
#: modules/visual_script/visual_script_editor.cpp
msgid "Get"
-msgstr ""
+msgstr "FÃ¥"
#: modules/visual_script/visual_script_editor.cpp
msgid "Base Type:"
@@ -6253,55 +6667,56 @@ msgstr ""
#: modules/visual_script/visual_script_editor.cpp
msgid "Available Nodes:"
-msgstr ""
+msgstr "Tilgjengelige Noder:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Select or create a function to edit graph"
-msgstr ""
+msgstr "Velg eller lag en funksjon for å redigere graf"
#: modules/visual_script/visual_script_editor.cpp
msgid "Edit Signal Arguments:"
-msgstr ""
+msgstr "Forandre Signal Argumenter:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Edit Variable:"
-msgstr ""
+msgstr "Rediger Variabel:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Change"
-msgstr ""
+msgstr "Forandre"
#: modules/visual_script/visual_script_editor.cpp
msgid "Delete Selected"
-msgstr ""
+msgstr "Slett Valgte"
#: modules/visual_script/visual_script_editor.cpp
msgid "Find Node Type"
-msgstr ""
+msgstr "Finn Node Type"
#: modules/visual_script/visual_script_editor.cpp
msgid "Copy Nodes"
-msgstr ""
+msgstr "Kopier Noder"
#: modules/visual_script/visual_script_editor.cpp
+#, fuzzy
msgid "Cut Nodes"
-msgstr ""
+msgstr "Kutt Noder"
#: modules/visual_script/visual_script_editor.cpp
msgid "Paste Nodes"
-msgstr ""
+msgstr "Lim inn Noder"
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Input type not iterable: "
-msgstr ""
+msgstr "Tilførseltype ikke itererbar: "
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Iterator became invalid"
-msgstr ""
+msgstr "Iterator ble ugyldig"
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Iterator became invalid: "
-msgstr ""
+msgstr "Iterator ble ugyldig: "
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Invalid index property name."
@@ -6309,23 +6724,23 @@ msgstr ""
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Base object is not a Node!"
-msgstr ""
+msgstr "Baseobjekt er ikke en Node!"
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Path does not lead Node!"
-msgstr ""
+msgstr "Sti leder ikke Node!"
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Invalid index property name '%s' in node %s."
-msgstr ""
+msgstr "Ugyldig indeks egenskap navn '%s' i node %s."
#: modules/visual_script/visual_script_nodes.cpp
msgid ": Invalid argument of type: "
-msgstr ""
+msgstr ": Ugyldig argument av type: "
#: modules/visual_script/visual_script_nodes.cpp
msgid ": Invalid arguments: "
-msgstr ""
+msgstr ": Ugyldige argumenter: "
#: modules/visual_script/visual_script_nodes.cpp
msgid "VariableGet not found in script: "
@@ -6353,6 +6768,26 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr ""
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6492,8 +6927,10 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
#: scene/2d/path_2d.cpp
@@ -6556,6 +6993,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6571,6 +7013,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr ""
@@ -6613,6 +7063,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
diff --git a/editor/translations/nl.po b/editor/translations/nl.po
new file mode 100644
index 0000000000..212397fd88
--- /dev/null
+++ b/editor/translations/nl.po
@@ -0,0 +1,7254 @@
+# Dutch translation of the Godot Engine editor
+# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
+# This file is distributed under the same license as the Godot source code.
+#
+# Aram Nap <xyphex.aram@gmail.com>, 2017
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Godot Engine editor\n"
+"PO-Revision-Date: 2017-04-13 18:15+0000\n"
+"Last-Translator: Aram Nap <xyphex.aram@gmail.com>\n"
+"Language-Team: Dutch <https://hosted.weblate.org/projects/godot-engine/godot/"
+"nl/>\n"
+"Language: nl\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 2.14-dev\n"
+
+#: editor/animation_editor.cpp
+msgid "Disabled"
+msgstr "Uitgeschakeld"
+
+#: editor/animation_editor.cpp
+msgid "All Selection"
+msgstr "Alle Selectie"
+
+#: editor/animation_editor.cpp
+msgid "Move Add Key"
+msgstr "Verplaats Key Toevoegen"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Transition"
+msgstr "Anim Wijzig Overgang"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Transform"
+msgstr "Anim Wijzig Transform"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Value"
+msgstr "Anim Wijzig Waarde"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Call"
+msgstr "Anim Wijzig Aanroep"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Track"
+msgstr "Anim Track Toevoegen"
+
+#: editor/animation_editor.cpp
+msgid "Anim Duplicate Keys"
+msgstr "Anim Dupliceer Keys"
+
+#: editor/animation_editor.cpp
+msgid "Move Anim Track Up"
+msgstr "Verplaats Anim Track Omhoog"
+
+#: editor/animation_editor.cpp
+msgid "Move Anim Track Down"
+msgstr "Verplaats Anim Track Omlaag"
+
+#: editor/animation_editor.cpp
+msgid "Remove Anim Track"
+msgstr "Verwijder Anim Track"
+
+#: editor/animation_editor.cpp
+msgid "Set Transitions to:"
+msgstr "Zet Overgangen Naar:"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Rename"
+msgstr "Anim Track Hernoemen"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Interpolation"
+msgstr "Anim Track Wijzig Interpolatie"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Value Mode"
+msgstr "Anim Track Wijzig Waarde Modus"
+
+#: editor/animation_editor.cpp
+#, fuzzy
+msgid "Anim Track Change Wrap Mode"
+msgstr "Anim Track Wijzig Waarde Modus"
+
+#: editor/animation_editor.cpp
+msgid "Edit Node Curve"
+msgstr "Wijzig Node Curve"
+
+#: editor/animation_editor.cpp
+msgid "Edit Selection Curve"
+msgstr "Wijzig Selectie Curve"
+
+#: editor/animation_editor.cpp
+msgid "Anim Delete Keys"
+msgstr "Anim Verwijder Keys"
+
+#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
+msgid "Duplicate Selection"
+msgstr "Dupliceer Selectie"
+
+#: editor/animation_editor.cpp
+msgid "Duplicate Transposed"
+msgstr "Dupliceer Getransponeerde"
+
+#: editor/animation_editor.cpp
+msgid "Remove Selection"
+msgstr "Verwijder Selectie"
+
+#: editor/animation_editor.cpp
+msgid "Continuous"
+msgstr "Doorlopend"
+
+#: editor/animation_editor.cpp
+msgid "Discrete"
+msgstr "Discreet"
+
+#: editor/animation_editor.cpp
+msgid "Trigger"
+msgstr "Trigger"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Key"
+msgstr "Anim Key Toevoegen"
+
+#: editor/animation_editor.cpp
+msgid "Anim Move Keys"
+msgstr "Anim Verplaats Keys"
+
+#: editor/animation_editor.cpp
+msgid "Scale Selection"
+msgstr "Schaal Selectie"
+
+#: editor/animation_editor.cpp
+msgid "Scale From Cursor"
+msgstr "Schaal Vanaf Cursor"
+
+#: editor/animation_editor.cpp
+msgid "Goto Next Step"
+msgstr "Ga Naar Volgende Stap"
+
+#: editor/animation_editor.cpp
+msgid "Goto Prev Step"
+msgstr "Ga Naar Vorige Stap"
+
+#: editor/animation_editor.cpp editor/property_editor.cpp
+msgid "Linear"
+msgstr "Lineair"
+
+#: editor/animation_editor.cpp editor/plugins/theme_editor_plugin.cpp
+msgid "Constant"
+msgstr "Constant"
+
+#: editor/animation_editor.cpp
+msgid "In"
+msgstr "In"
+
+#: editor/animation_editor.cpp
+msgid "Out"
+msgstr "Uit"
+
+#: editor/animation_editor.cpp
+msgid "In-Out"
+msgstr "In-Uit"
+
+#: editor/animation_editor.cpp
+msgid "Out-In"
+msgstr "Uit-In"
+
+#: editor/animation_editor.cpp
+msgid "Transitions"
+msgstr "Transities"
+
+#: editor/animation_editor.cpp
+msgid "Optimize Animation"
+msgstr "Optimaliseer Animatie"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up Animation"
+msgstr "Animatie Opschonen"
+
+#: editor/animation_editor.cpp
+msgid "Create NEW track for %s and insert key?"
+msgstr "NIEUWE track aanmaken voor %s en key invoegen?"
+
+#: editor/animation_editor.cpp
+msgid "Create %d NEW tracks and insert keys?"
+msgstr "Maak %d NIEUWE tracks aan en keys invoeren?"
+
+#: editor/animation_editor.cpp editor/create_dialog.cpp
+#: editor/editor_audio_buses.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp editor/project_manager.cpp
+#: editor/script_create_dialog.cpp
+msgid "Create"
+msgstr "Maken"
+
+#: editor/animation_editor.cpp
+msgid "Anim Create & Insert"
+msgstr "Anim Maken & Invoegen"
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert Track & Key"
+msgstr "Anim Track & Key Invoegen"
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert Key"
+msgstr "Anim Key Invoegen"
+
+#: editor/animation_editor.cpp
+msgid "Change Anim Len"
+msgstr "Wijzig Anim Lengte"
+
+#: editor/animation_editor.cpp
+msgid "Change Anim Loop"
+msgstr "Wijzig Anim Lus"
+
+#: editor/animation_editor.cpp
+msgid "Anim Create Typed Value Key"
+msgstr "Anim Getypeerd Waarde Key Aanmaken"
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert"
+msgstr "Anim Invoegen"
+
+#: editor/animation_editor.cpp
+msgid "Anim Scale Keys"
+msgstr "Anim Schaal Keys"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Call Track"
+msgstr "Anim Aanroep Track Toevoegen"
+
+#: editor/animation_editor.cpp
+msgid "Animation zoom."
+msgstr "Animatie zoom."
+
+#: editor/animation_editor.cpp
+msgid "Length (s):"
+msgstr "Lengte(s):"
+
+#: editor/animation_editor.cpp
+msgid "Animation length (in seconds)."
+msgstr "Animatie lengte (in seconden)."
+
+#: editor/animation_editor.cpp
+msgid "Step (s):"
+msgstr "Stap(pen):"
+
+#: editor/animation_editor.cpp
+msgid "Cursor step snap (in seconds)."
+msgstr "Cursor stap snap (in seconden)."
+
+#: editor/animation_editor.cpp
+msgid "Enable/Disable looping in animation."
+msgstr "In- en uitschakelen van loopen in animatie."
+
+#: editor/animation_editor.cpp
+msgid "Add new tracks."
+msgstr "Nieuwe tracks toevoegen."
+
+#: editor/animation_editor.cpp
+msgid "Move current track up."
+msgstr "Verplaats huidige track naar boven."
+
+#: editor/animation_editor.cpp
+msgid "Move current track down."
+msgstr "Verplaats huidige track naar beneden."
+
+#: editor/animation_editor.cpp
+msgid "Remove selected track."
+msgstr "Verwijder geselecteerde track."
+
+#: editor/animation_editor.cpp
+msgid "Track tools"
+msgstr "Track tools"
+
+#: editor/animation_editor.cpp
+msgid "Enable editing of individual keys by clicking them."
+msgstr "Schakel het individueel aanpassen van keys in door op ze te klikken."
+
+#: editor/animation_editor.cpp
+msgid "Anim. Optimizer"
+msgstr "Anim. Optimalisator"
+
+#: editor/animation_editor.cpp
+msgid "Max. Linear Error:"
+msgstr "Max. Lineair Error:"
+
+#: editor/animation_editor.cpp
+msgid "Max. Angular Error:"
+msgstr "Max. Hoekig Error:"
+
+#: editor/animation_editor.cpp
+msgid "Max Optimizable Angle:"
+msgstr "Maximale Optimaliseerbare Hoek:"
+
+#: editor/animation_editor.cpp
+msgid "Optimize"
+msgstr "Optimaliseren"
+
+#: editor/animation_editor.cpp
+msgid "Select an AnimationPlayer from the Scene Tree to edit animations."
+msgstr ""
+"Selecteer een AnimationPlayer uit de Scene Tree om animaties te wijzigen."
+
+#: editor/animation_editor.cpp
+msgid "Key"
+msgstr "Key"
+
+#: editor/animation_editor.cpp
+msgid "Transition"
+msgstr "Transitie"
+
+#: editor/animation_editor.cpp
+msgid "Scale Ratio:"
+msgstr "Schaal Ratio:"
+
+#: editor/animation_editor.cpp
+msgid "Call Functions in Which Node?"
+msgstr "Roep Functies Aan in Welke Node?"
+
+#: editor/animation_editor.cpp
+msgid "Remove invalid keys"
+msgstr "Verwijder ongeldige keys"
+
+#: editor/animation_editor.cpp
+msgid "Remove unresolved and empty tracks"
+msgstr "Verwijder onopgeloste en lege tracks"
+
+#: editor/animation_editor.cpp
+msgid "Clean-up all animations"
+msgstr "Alle animaties opruimen"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up Animation(s) (NO UNDO!)"
+msgstr "Animatie(s) Opruimen (KAN NIET ONGEDAAN WORDEN!)"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up"
+msgstr "Opruimen"
+
+#: editor/array_property_edit.cpp
+msgid "Resize Array"
+msgstr "Array van Grootte Veranderen"
+
+#: editor/array_property_edit.cpp
+msgid "Change Array Value Type"
+msgstr "Wijzig Array Waarde Type"
+
+#: editor/array_property_edit.cpp
+msgid "Change Array Value"
+msgstr "Wijzig Array Waarde"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Constanten:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Bestand:"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Omschrijving:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Sluiten"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Verbind.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Verbind Aan Node:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Opgevraagde bestandsformaat onbekend:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Verbind.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Testen"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Error bij het opslaan van resource!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Alle"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
+#: editor/quick_open.cpp editor/settings_config_dialog.cpp
+msgid "Search:"
+msgstr "Zoeken:"
+
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Zoeken"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Sort:"
+msgstr "Sorteren:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Reverse"
+msgstr "Omkeren"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Category:"
+msgstr "Categorie:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Site:"
+msgstr "Site:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Support.."
+msgstr "Ondersteuning.."
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Official"
+msgstr "Officieel"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+msgid "Community"
+msgstr "Gemeenschap"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Testing"
+msgstr "Testen"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Assets ZIP File"
+msgstr "Assets ZIP Bestand"
+
+#: editor/call_dialog.cpp
+msgid "Method List For '%s':"
+msgstr "Methode Lijst Voor '%s':"
+
+#: editor/call_dialog.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Call"
+msgstr "Aanroep"
+
+#: editor/call_dialog.cpp
+msgid "Method List:"
+msgstr "Methode Lijst:"
+
+#: editor/call_dialog.cpp
+msgid "Arguments:"
+msgstr "Argumenten:"
+
+#: editor/call_dialog.cpp
+msgid "Return:"
+msgstr "Teruggave:"
+
+#: editor/code_editor.cpp
+msgid "Go to Line"
+msgstr "Ga naar Regel"
+
+#: editor/code_editor.cpp
+msgid "Line Number:"
+msgstr "Regel Nummer:"
+
+#: editor/code_editor.cpp
+msgid "No Matches"
+msgstr "Geen Matches"
+
+#: editor/code_editor.cpp
+#, fuzzy
+msgid "Replaced %d occurrence(s)."
+msgstr "%d voorgekomen waarde(s) vervangen."
+
+#: editor/code_editor.cpp
+msgid "Replace"
+msgstr "Vervangen"
+
+#: editor/code_editor.cpp
+msgid "Replace All"
+msgstr "Alle Vervangen"
+
+#: editor/code_editor.cpp
+msgid "Match Case"
+msgstr "Hoofdlettergevoelig"
+
+#: editor/code_editor.cpp
+msgid "Whole Words"
+msgstr "Hele Woorden"
+
+#: editor/code_editor.cpp
+msgid "Selection Only"
+msgstr "Alleen Selectie"
+
+#: editor/code_editor.cpp editor/editor_help.cpp
+msgid "Find"
+msgstr "Zoeken"
+
+#: editor/code_editor.cpp
+msgid "Next"
+msgstr "Volgende"
+
+#: editor/code_editor.cpp
+msgid "Not found!"
+msgstr "Niet gevonden!"
+
+#: editor/code_editor.cpp
+msgid "Replace By"
+msgstr "Vervangen Door"
+
+#: editor/code_editor.cpp
+msgid "Case Sensitive"
+msgstr "Hoofdlettergevoelig"
+
+#: editor/code_editor.cpp
+msgid "Backwards"
+msgstr "Achterwaarts"
+
+#: editor/code_editor.cpp
+msgid "Prompt On Replace"
+msgstr "Vragen Bij Vervangen"
+
+#: editor/code_editor.cpp
+msgid "Skip"
+msgstr "Overslaan"
+
+#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom In"
+msgstr "Inzoomen"
+
+#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Out"
+msgstr "Uitzoomen"
+
+#: editor/code_editor.cpp
+msgid "Reset Zoom"
+msgstr "Reset Zoom"
+
+#: editor/code_editor.cpp editor/script_editor_debugger.cpp
+msgid "Line:"
+msgstr "Regel:"
+
+#: editor/code_editor.cpp
+msgid "Col:"
+msgstr "Kolom:"
+
+#: editor/connections_dialog.cpp
+msgid "Method in target Node must be specified!"
+msgstr "Methode in target Node moet gespecificeerd worden!"
+
+#: editor/connections_dialog.cpp
+msgid ""
+"Target method not found! Specify a valid method or attach a script to target "
+"Node."
+msgstr ""
+"Target methode niet gevonden! Specificeer een geldige methode of koppel een "
+"script aan de target Node."
+
+#: editor/connections_dialog.cpp
+msgid "Connect To Node:"
+msgstr "Verbind Aan Node:"
+
+#: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp
+#: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_settings.cpp
+msgid "Add"
+msgstr "Toevoegen"
+
+#: editor/connections_dialog.cpp editor/dependency_editor.cpp
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
+msgid "Remove"
+msgstr "Verwijderen"
+
+#: editor/connections_dialog.cpp
+msgid "Add Extra Call Argument:"
+msgstr "Extra Aanroep Argument Toevoegen:"
+
+#: editor/connections_dialog.cpp
+msgid "Extra Call Arguments:"
+msgstr "Extra Aanroep Argumenten:"
+
+#: editor/connections_dialog.cpp
+msgid "Path to Node:"
+msgstr "Pad naar Node:"
+
+#: editor/connections_dialog.cpp
+msgid "Make Function"
+msgstr "Maak Functie"
+
+#: editor/connections_dialog.cpp
+msgid "Deferred"
+msgstr "Uitgesteld"
+
+#: editor/connections_dialog.cpp
+msgid "Oneshot"
+msgstr "Eénschots"
+
+#: editor/connections_dialog.cpp
+msgid "Connect"
+msgstr "Verbinden"
+
+#: editor/connections_dialog.cpp
+msgid "Connect '%s' to '%s'"
+msgstr "Verbind '%s' met '%s'"
+
+#: editor/connections_dialog.cpp
+msgid "Connecting Signal:"
+msgstr "Signaal aan het Verbinden:"
+
+#: editor/connections_dialog.cpp
+#, fuzzy
+msgid "Create Subscription"
+msgstr "Subscriptie Maken"
+
+#: editor/connections_dialog.cpp
+msgid "Connect.."
+msgstr "Verbind.."
+
+#: editor/connections_dialog.cpp
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Disconnect"
+msgstr "Losmaken"
+
+#: editor/connections_dialog.cpp editor/node_dock.cpp
+msgid "Signals"
+msgstr "Signalen"
+
+#: editor/create_dialog.cpp
+msgid "Create New"
+msgstr "Nieuwe Maken"
+
+#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/filesystem_dock.cpp
+msgid "Favorites:"
+msgstr "Favorieten:"
+
+#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
+msgid "Recent:"
+msgstr "Recente:"
+
+#: editor/create_dialog.cpp editor/editor_help.cpp
+#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
+#: editor/quick_open.cpp
+msgid "Matches:"
+msgstr "Matches:"
+
+#: editor/dependency_editor.cpp
+msgid "Search Replacement For:"
+msgstr "Zoek Vervanging Voor:"
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies For:"
+msgstr "Afhankelijkheden Voor:"
+
+#: editor/dependency_editor.cpp
+msgid ""
+"Scene '%s' is currently being edited.\n"
+"Changes will not take effect unless reloaded."
+msgstr ""
+"Scene '%s' wordt op dit moment gewijzigd.\n"
+"Wijzigingen hebben geen effect tenzij ze herladen worden."
+
+#: editor/dependency_editor.cpp
+msgid ""
+"Resource '%s' is in use.\n"
+"Changes will take effect when reloaded."
+msgstr ""
+"Resource '%s' is in gebruik.\n"
+"Wijzigingen zullen effect hebben wanneer herladen."
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies"
+msgstr "Afhankelijkheden"
+
+#: editor/dependency_editor.cpp
+msgid "Resource"
+msgstr "Resource"
+
+#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
+#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
+msgid "Path"
+msgstr "Pad"
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies:"
+msgstr "Afhankelijkheden:"
+
+#: editor/dependency_editor.cpp
+msgid "Fix Broken"
+msgstr "Gebroken Repareren"
+
+#: editor/dependency_editor.cpp
+msgid "Dependency Editor"
+msgstr "Afhankelijkheden Editor"
+
+#: editor/dependency_editor.cpp
+msgid "Search Replacement Resource:"
+msgstr "Zoek Vervangende Resource:"
+
+#: editor/dependency_editor.cpp
+msgid "Owners Of:"
+msgstr "Eigenaren Van:"
+
+#: editor/dependency_editor.cpp
+msgid ""
+"The files being removed are required by other resources in order for them to "
+"work.\n"
+"Remove them anyway? (no undo)"
+msgstr ""
+"De bestanden die verwijderd worden zijn vereist door andere resources om ze "
+"te laten werken.\n"
+"Toch verwijderen? (Kan niet ongedaan worden.)"
+
+#: editor/dependency_editor.cpp
+msgid "Remove selected files from the project? (no undo)"
+msgstr ""
+"Verwijder geselecteerde bestanden van het project? (Kan niet ongedaan "
+"worden.)"
+
+#: editor/dependency_editor.cpp
+msgid "Error loading:"
+msgstr "Error bij het laden van:"
+
+#: editor/dependency_editor.cpp
+msgid "Scene failed to load due to missing dependencies:"
+msgstr "Scene faalde om te laden door ontbrekende afhankelijkheden:"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+msgid "Open Anyway"
+msgstr "Toch Openen"
+
+#: editor/dependency_editor.cpp
+msgid "Which action should be taken?"
+msgstr "Welke actie moet ondernomen worden?"
+
+#: editor/dependency_editor.cpp
+msgid "Fix Dependencies"
+msgstr "Repareer Afhankelijkheden"
+
+#: editor/dependency_editor.cpp
+msgid "Errors loading!"
+msgstr "Errors bij het laden!"
+
+#: editor/dependency_editor.cpp
+msgid "Permanently delete %d item(s)? (No undo!)"
+msgstr "%d item(s) permanent verwijderen? (Kan niet ongedaan worden!)"
+
+#: editor/dependency_editor.cpp
+msgid "Owns"
+msgstr "Eigenaar Van"
+
+#: editor/dependency_editor.cpp
+msgid "Resources Without Explicit Ownership:"
+msgstr "Resources Zonder Expliciet Bezit:"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+msgid "Orphan Resource Explorer"
+msgstr "Wees Resource Verkenner"
+
+#: editor/dependency_editor.cpp
+msgid "Delete selected files?"
+msgstr "Verwijder geselecteerde bestanden?"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+#: editor/filesystem_dock.cpp editor/plugins/item_list_editor_plugin.cpp
+#: editor/project_export.cpp editor/scene_tree_dock.cpp
+msgid "Delete"
+msgstr "Verwijder"
+
+#: editor/editor_audio_buses.cpp
+msgid "Save Audio Bus Layout As.."
+msgstr "Sla Audio Bus Layout Op Als.."
+
+#: editor/editor_audio_buses.cpp
+msgid "Location for New Layout.."
+msgstr "Locatie voor Nieuwe Layout.."
+
+#: editor/editor_audio_buses.cpp
+msgid "Open Audio Bus Layout"
+msgstr "Open Audio Bus Layout"
+
+#: editor/editor_audio_buses.cpp
+msgid "Add Bus"
+msgstr "Bus Toevoegen"
+
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
+msgid "Load"
+msgstr "Laden"
+
+#: editor/editor_audio_buses.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Save As"
+msgstr "Opslaan Als"
+
+#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
+msgid "Default"
+msgstr "Standaard"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name."
+msgstr "Ongeldige naam."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Valid characters:"
+msgstr "Geldige karakters:"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing engine class name."
+msgstr "Ongeldige naam. Moet niet botsen met een bestaande engine klasse naam."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing buit-in type name."
+msgstr ""
+"Ongeldige naam. Mag niet botsen met een bestaande ingebouwde type naam."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing global constant name."
+msgstr ""
+"Ongeldige naam. Mag niet botsen met de naam van een bestaande globale "
+"constante."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid Path."
+msgstr "Ongeldig Pad."
+
+#: editor/editor_autoload_settings.cpp
+msgid "File does not exist."
+msgstr "Bestand bestaat niet."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Not in resource path."
+msgstr "Niet in resource pad."
+
+#: editor/editor_autoload_settings.cpp
+msgid "Add AutoLoad"
+msgstr "AutoLoad Toevoegen"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Autoload '%s' already exists!"
+msgstr "Autoload '%s' bestaat al!"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Rename Autoload"
+msgstr "Autoload Hernoemen"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Toggle AutoLoad Globals"
+msgstr "Toggle AutoLoad Globals"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Move Autoload"
+msgstr "Verplaats Autoload"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Remove Autoload"
+msgstr "Verwijder Autoload"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Enable"
+msgstr "Inschakelen"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Rearrange Autoloads"
+msgstr "Herschik Autoloads"
+
+#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
+msgid "Path:"
+msgstr "Pad:"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Node Name:"
+msgstr "Node Naam:"
+
+#: editor/editor_autoload_settings.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Name"
+msgstr "Naam"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Singleton"
+msgstr "Singleton"
+
+#: editor/editor_autoload_settings.cpp
+msgid "List:"
+msgstr "Lijst:"
+
+#: editor/editor_data.cpp
+msgid "Updating Scene"
+msgstr "Scene aan het Updaten"
+
+#: editor/editor_data.cpp
+msgid "Storing local changes.."
+msgstr "Lokale wijziging aan het opslaan.."
+
+#: editor/editor_data.cpp
+msgid "Updating scene.."
+msgstr "Scene aan het updaten.."
+
+#: editor/editor_dir_dialog.cpp
+msgid "Choose a Directory"
+msgstr "Kies een Map"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: scene/gui/file_dialog.cpp
+msgid "Create Folder"
+msgstr "Map Maken"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/editor_plugin_settings.cpp editor/plugins/theme_editor_plugin.cpp
+#: editor/project_export.cpp scene/gui/file_dialog.cpp
+msgid "Name:"
+msgstr "Naam:"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: scene/gui/file_dialog.cpp
+msgid "Could not create folder."
+msgstr "Map kon niet gemaakt worden."
+
+#: editor/editor_dir_dialog.cpp
+msgid "Choose"
+msgstr "Kies"
+
+#: editor/editor_export.cpp
+#, fuzzy
+msgid "Storing File:"
+msgstr "Opslag Bestand:"
+
+#: editor/editor_export.cpp
+#, fuzzy
+msgid "Packing"
+msgstr "Inpakken"
+
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
+msgid "Template file not found:\n"
+msgstr "Template bestand niet gevonden:\n"
+
+#: editor/editor_export.cpp
+msgid "Added:"
+msgstr "Toegevoegd:"
+
+#: editor/editor_export.cpp
+msgid "Removed:"
+msgstr "Verwijderd:"
+
+#: editor/editor_export.cpp
+msgid "Error saving atlas:"
+msgstr "Error bij het opslaan van atlas:"
+
+#: editor/editor_export.cpp
+msgid "Could not save atlas subtexture:"
+msgstr "Kon atlas subtexture niet opslaan:"
+
+#: editor/editor_export.cpp
+msgid "Exporting for %s"
+msgstr "Aan het exporteren voor %s"
+
+#: editor/editor_export.cpp
+msgid "Setting Up.."
+msgstr "Aan Het Opzetten.."
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "File Exists, Overwrite?"
+msgstr "Bestand Bestaat, Overschrijven?"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "All Recognized"
+msgstr "Alles Herkend"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "All Files (*)"
+msgstr "Alle Bestanden (*)"
+
+#: editor/editor_file_dialog.cpp editor/editor_help.cpp editor/editor_node.cpp
+#: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/property_selector.cpp editor/quick_open.cpp scene/gui/file_dialog.cpp
+msgid "Open"
+msgstr "Openen"
+
+#: editor/editor_file_dialog.cpp editor/editor_node.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp scene/gui/file_dialog.cpp
+msgid "Save"
+msgstr "Opslaan"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Save a File"
+msgstr "Sla een Bestand Op"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Back"
+msgstr "Ga Terug"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Forward"
+msgstr "Ga Verder"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Up"
+msgstr "Ga Omhoog"
+
+#: editor/editor_file_dialog.cpp
+msgid "Refresh"
+msgstr "Verversen"
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Hidden Files"
+msgstr "Toggle Verborgen Bestanden"
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Favorite"
+msgstr "Toggle Favoriet"
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Mode"
+msgstr "Toggle Modus"
+
+#: editor/editor_file_dialog.cpp
+msgid "Focus Path"
+msgstr "Focus Pad"
+
+#: editor/editor_file_dialog.cpp
+msgid "Move Favorite Up"
+msgstr "Verplaats Favoriet Naar Boven"
+
+#: editor/editor_file_dialog.cpp
+msgid "Move Favorite Down"
+msgstr "Verplaats Favoriet Naar Beneden"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Directories & Files:"
+msgstr "Mappen & Bestanden:"
+
+#: editor/editor_file_dialog.cpp
+msgid "Preview:"
+msgstr "Preview:"
+
+#: editor/editor_file_dialog.cpp editor/script_editor_debugger.cpp
+#: scene/gui/file_dialog.cpp
+msgid "File:"
+msgstr "Bestand:"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Filter:"
+msgstr "Filter:"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Must use a valid extension."
+msgstr "Een geldige extensie moet gebruikt worden."
+
+#: editor/editor_file_system.cpp
+#, fuzzy
+msgid "ScanSources"
+msgstr "Scan Bronnen"
+
+#: editor/editor_file_system.cpp
+#, fuzzy
+msgid "(Re)Importing Assets"
+msgstr "Aan Het Herimporteren"
+
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search Help"
+msgstr "Zoek Hulp"
+
+#: editor/editor_help.cpp
+msgid "Class List:"
+msgstr "Klasse Lijst:"
+
+#: editor/editor_help.cpp
+msgid "Search Classes"
+msgstr "Zoek Klasses"
+
+#: editor/editor_help.cpp editor/property_editor.cpp
+msgid "Class:"
+msgstr "Klasse:"
+
+#: editor/editor_help.cpp editor/scene_tree_editor.cpp
+msgid "Inherits:"
+msgstr "Erft:"
+
+#: editor/editor_help.cpp
+msgid "Inherited by:"
+msgstr "Geërfd door:"
+
+#: editor/editor_help.cpp
+msgid "Brief Description:"
+msgstr "Korte Beschrijving:"
+
+#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Members:"
+msgstr "Leden:"
+
+#: editor/editor_help.cpp
+msgid "Public Methods:"
+msgstr "Publieke Methodes:"
+
+#: editor/editor_help.cpp
+msgid "GUI Theme Items:"
+msgstr "GUI Thema Items:"
+
+#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Signals:"
+msgstr "Signalen:"
+
+#: editor/editor_help.cpp
+msgid "Constants:"
+msgstr "Constanten:"
+
+#: editor/editor_help.cpp
+msgid "Property Description:"
+msgstr "Eigenschap Beschrijving:"
+
+#: editor/editor_help.cpp
+msgid "Method Description:"
+msgstr "Methode Beschrijving:"
+
+#: editor/editor_help.cpp
+msgid "Search Text"
+msgstr "Zoek Tekst"
+
+#: editor/editor_log.cpp
+msgid " Output:"
+msgstr " Uitvoer:"
+
+#: editor/editor_log.cpp editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/rich_text_editor_plugin.cpp editor/property_editor.cpp
+#: editor/script_editor_debugger.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Clear"
+msgstr "Leegmaken"
+
+#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
+#: editor/resources_dock.cpp
+msgid "Error saving resource!"
+msgstr "Error bij het opslaan van resource!"
+
+#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
+#: editor/resources_dock.cpp
+msgid "Save Resource As.."
+msgstr "Resource Opslaan Als.."
+
+#: editor/editor_node.cpp editor/export_template_manager.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "I see.."
+msgstr "Ik snap het.."
+
+#: editor/editor_node.cpp
+msgid "Can't open file for writing:"
+msgstr "Kan bestand niet openen om te schrijven:"
+
+#: editor/editor_node.cpp
+msgid "Requested file format unknown:"
+msgstr "Opgevraagde bestandsformaat onbekend:"
+
+#: editor/editor_node.cpp
+msgid "Error while saving."
+msgstr "Error bij het opslaan."
+
+#: editor/editor_node.cpp
+msgid "Saving Scene"
+msgstr "Scene Aan Het Opslaan"
+
+#: editor/editor_node.cpp
+msgid "Analyzing"
+msgstr "Aan Het Analyseren"
+
+#: editor/editor_node.cpp
+msgid "Creating Thumbnail"
+msgstr "Thumbnail Aan Het Maken"
+
+#: editor/editor_node.cpp
+msgid ""
+"Couldn't save scene. Likely dependencies (instances) couldn't be satisfied."
+msgstr ""
+"Kon scene niet opslaan. Waarschijnlijk konden afhankelijkheden (instanties) "
+"niet voldaan worden."
+
+#: editor/editor_node.cpp
+msgid "Failed to load resource."
+msgstr "Mislukt om resource te laden."
+
+#: editor/editor_node.cpp
+msgid "Can't load MeshLibrary for merging!"
+msgstr "Kan MeshLibrary niet laden om te samenvoegen!"
+
+#: editor/editor_node.cpp
+msgid "Error saving MeshLibrary!"
+msgstr "Error bij het opslaan van MeshLibrary!"
+
+#: editor/editor_node.cpp
+msgid "Can't load TileSet for merging!"
+msgstr "Kan TileSet niet laden om te samenvoegen!"
+
+#: editor/editor_node.cpp
+msgid "Error saving TileSet!"
+msgstr "Error bij het opslaan van TileSet!"
+
+#: editor/editor_node.cpp
+msgid "Error trying to save layout!"
+msgstr "Error bij het opslaan van layout!"
+
+#: editor/editor_node.cpp
+msgid "Default editor layout overridden."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Layout name not found!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Restored default layout to base settings."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Copy Params"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Paste Params"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Paste Resource"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Copy Resource"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Make Built-In"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Make Sub-Resources Unique"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open in Help"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "There is no defined scene to run."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"No main scene has ever been defined, select one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Selected scene '%s' does not exist, select a valid one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Selected scene '%s' is not a scene file, select a valid one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Current scene was never saved, please save it prior to running."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Could not start subprocess!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Base Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Quick Open Scene.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Quick Open Script.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Yes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Close scene? (Unsaved changes will be lost)"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save Scene As.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "This scene has never been saved. Save before running?"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Export Mesh Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Export Tile Set"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Quit"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Exit the editor?"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Current scene not saved. Open anyway?"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Can't reload a scene that was never saved."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Revert"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "This action cannot be undone. Revert anyway?"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Quick Run Scene.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Open Project Manager? \n"
+"(Unsaved changes will be lost)"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pick a Main Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Scene '%s' was automatically imported, so it can't be modified.\n"
+"To make changes to it, a new inherited scene can be created."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/scene_tree_dock.cpp
+msgid "Ugh"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Error loading scene, it must be inside the project path. Use 'Import' to "
+"open the scene, then save it inside the project path."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Error loading scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Scene '%s' has broken dependencies:"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save Layout"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Delete Layout"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Switch Scene Tab"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "%d more file(s)"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "%d more file(s) or folder(s)"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
+#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Go to previously opened scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Next tab"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Previous tab"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Filter Files.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Operations with scene files."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "New Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "New Inherited Scene.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Scene.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save all Scenes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Close Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Close Goto Prev. Scene"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Open Recent"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Convert To.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "MeshLibrary.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "TileSet.."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Undo"
+msgstr "Ongedaan Maken"
+
+#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Redo"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Revert Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Miscellaneous project or scene-wide tools."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Project"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Run Script"
+msgstr ""
+
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Export"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Tools"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Quit to Project List"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Deploy with Remote Debug"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"When exporting or deploying, the resulting executable will attempt to "
+"connect to the IP of this computer in order to be debugged."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Small Deploy with Network FS"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is enabled, export or deploy will produce a minimal "
+"executable.\n"
+"The filesystem will be provided from the project by the editor over the "
+"network.\n"
+"On Android, deploy will use the USB cable for faster performance. This "
+"option speeds up testing for games with a large footprint."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Visible Collision Shapes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Collision shapes and raycast nodes (for 2D and 3D) will be visible on the "
+"running game if this option is turned on."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Visible Navigation"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Navigation meshes and polygons will be visible on the running game if this "
+"option is turned on."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Sync Scene Changes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is turned on, any changes made to the scene in the editor "
+"will be replicated in the running game.\n"
+"When used remotely on a device, this is more efficient with network "
+"filesystem."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Sync Script Changes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is turned on, any script that is saved will be reloaded on "
+"the running game.\n"
+"When used remotely on a device, this is more efficient with network "
+"filesystem."
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Bewerken"
+
+#: editor/editor_node.cpp editor/settings_config_dialog.cpp
+msgid "Editor Settings"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Editor Layout"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Toggle Fullscreen"
+msgstr ""
+
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Manage Export Templates"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "About"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Spins when the editor window repaints!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Update Always"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Update Changes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Disable Update Spinner"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Inspector"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Create a new resource in memory and edit it."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Load an existing resource from disk and edit it."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save the currently edited resource."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Save As.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Go to the previous edited object in history."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Go to the next edited object in history."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "History of recently edited objects."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Object properties."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "FileSystem"
+msgstr ""
+
+#: editor/editor_node.cpp editor/node_dock.cpp
+msgid "Node"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Output"
+msgstr ""
+
+#: editor/editor_node.cpp editor/editor_reimport_dialog.cpp
+msgid "Re-Import"
+msgstr ""
+
+#: editor/editor_node.cpp editor/editor_plugin_settings.cpp
+msgid "Update"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Thanks from the Godot community!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Thanks!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Import Templates From ZIP File"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Export Project"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Export Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Merge With Existing"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Password:"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open & Run a Script"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Load Errors"
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Open een Map"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Open een Map"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Afhankelijkheden Editor"
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Afhankelijkheden Editor"
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
+msgstr ""
+
+#: editor/editor_plugin_settings.cpp
+msgid "Installed Plugins:"
+msgstr ""
+
+#: editor/editor_plugin_settings.cpp
+msgid "Author:"
+msgstr ""
+
+#: editor/editor_plugin_settings.cpp
+msgid "Status:"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Stop Profiling"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Start Profiling"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Measure:"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Frame Time (sec)"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Average Time (sec)"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Frame %"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Fixed Frame %"
+msgstr ""
+
+#: editor/editor_profiler.cpp editor/script_editor_debugger.cpp
+msgid "Time:"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Inclusive"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Self"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Frame #:"
+msgstr ""
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Please wait for scan to complete."
+msgstr ""
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Current scene must be saved to re-import."
+msgstr ""
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Save & Re-Import"
+msgstr ""
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Re-Importing"
+msgstr "Aan Het Herimporteren"
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Re-Import Changed Resources"
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "Write your logic in the _run() method."
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "There is an edited scene already."
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "Couldn't instance script:"
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "Did you forget the 'tool' keyword?"
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "Couldn't run script:"
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "Did you forget the '_run' method?"
+msgstr ""
+
+#: editor/editor_settings.cpp
+msgid "Default (Same as Editor)"
+msgstr ""
+
+#: editor/editor_sub_scene.cpp
+msgid "Select Node(s) to Import"
+msgstr ""
+
+#: editor/editor_sub_scene.cpp
+msgid "Scene Path:"
+msgstr ""
+
+#: editor/editor_sub_scene.cpp
+msgid "Import From Node:"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Re-Download"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Uninstall"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "(Installed)"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Download"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "(Missing)"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "(Current)"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Remove template version '%s'?"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Can't open export templates zip."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Invalid version.txt format inside templates."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid ""
+"Invalid version.txt format inside templates. Revision is not a valid "
+"identifier."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "No version.txt found inside templates."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+#, fuzzy
+msgid "Error creating path for templates:\n"
+msgstr "Error bij het opslaan van atlas:"
+
+#: editor/export_template_manager.cpp
+msgid "Extracting Export Templates"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Importing:"
+msgstr "Aan Het Importeren:"
+
+#: editor/export_template_manager.cpp
+msgid "Loading Export Templates"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Current Version:"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Installed Versions:"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Install From File"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+#, fuzzy
+msgid "Remove Template"
+msgstr "Verwijder Selectie"
+
+#: editor/export_template_manager.cpp
+#, fuzzy
+msgid "Select template file"
+msgstr "Verwijder geselecteerde bestanden?"
+
+#: editor/export_template_manager.cpp
+msgid "Export Template Manager"
+msgstr ""
+
+#: editor/file_type_cache.cpp
+msgid "Can't open file_type_cache.cch for writing, not saving file type cache!"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Cannot navigate to '"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Same source and destination files, doing nothing."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Same source and destination paths, doing nothing."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Can't move directories to within themselves."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Can't operate on '..'"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Pick New Name and Location For:"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "No files selected!"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Expand all"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Collapse all"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Instance"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Edit Dependencies.."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "View Owners.."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Copy Path"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Rename or Move.."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Move To.."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Info"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Re-Import.."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Previous Directory"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Next Directory"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Re-Scan Filesystem"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Toggle folder status as Favorite"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Instance the selected scene(s) as child of the selected node."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Move"
+msgstr ""
+
+#: editor/groups_editor.cpp
+msgid "Add to Group"
+msgstr ""
+
+#: editor/groups_editor.cpp
+msgid "Remove from Group"
+msgstr ""
+
+#: editor/import/resource_importer_obj.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Surface %d"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Import Scene"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Importing Scene.."
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Running Custom Script.."
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't load post-import script:"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Invalid/broken script for post-import (check console):"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Error running post-import script:"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Saving.."
+msgstr ""
+
+#: editor/import_dock.cpp
+#, fuzzy
+msgid " Files"
+msgstr "Bestand:"
+
+#: editor/import_dock.cpp
+#, fuzzy
+msgid "Import As:"
+msgstr "Aan Het Importeren:"
+
+#: editor/import_dock.cpp editor/property_editor.cpp
+msgid "Preset.."
+msgstr ""
+
+#: editor/import_dock.cpp
+#, fuzzy
+msgid "Reimport"
+msgstr "Aan Het Herimporteren"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "No bit masks to import!"
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path is empty."
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path must be a complete resource path."
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path must exist."
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Save path is empty!"
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "Import BitMasks"
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture(s):"
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Target Path:"
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Accept"
+msgstr ""
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "Bit Mask"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "No source font file!"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "No target font resource!"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid ""
+"Invalid file extension.\n"
+"Please use .font."
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Can't load/process source font."
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Couldn't save font."
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Source Font:"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Source Font Size:"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Dest Resource:"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "The quick brown fox jumps over the lazy dog."
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Test:"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Options:"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Font Import"
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid ""
+"This file is already a Godot font file, please supply a BMFont type file "
+"instead."
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Failed opening as BMFont file."
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Error initializing FreeType."
+msgstr "Error bij het initialiseren van FreeType."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Unknown font format."
+msgstr "Onbekende lettertype formaat."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Error loading font."
+msgstr "Error bij het laden van lettertype."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Invalid font size."
+msgstr "Ongeldige lettertype grootte."
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Invalid font custom source."
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Font"
+msgstr ""
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "No meshes to import!"
+msgstr ""
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Single Mesh Import"
+msgstr ""
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Source Mesh(es):"
+msgstr ""
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh"
+msgstr ""
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "No samples to import!"
+msgstr ""
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Import Audio Samples"
+msgstr ""
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Source Sample(s):"
+msgstr ""
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Audio Sample"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "New Clip"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Animation Options"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Flags"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Bake FPS:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Optimizer"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Linear Error"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Angular Error"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Angle"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Clips"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Start(s)"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "End(s)"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Loop"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Filters"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Source path is empty."
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't load post-import script."
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Invalid/broken script for post-import."
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Error importing scene."
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import 3D Scene"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Source Scene:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Same as Target Scene"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Shared"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Target Texture Folder:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Post-Process Script:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Custom Root Node Type:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Auto"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Root Node Name:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "The Following Files are Missing:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import Anyway"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp scene/gui/dialogs.cpp
+msgid "Cancel"
+msgstr "Annuleren"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import & Open"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Edited scene has not been saved, open imported scene anyway?"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import Image:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Can't import a file over itself:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't localize path: %s (already local)"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "3D Scene Animation"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Uncompressed"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress Lossless (PNG)"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress Lossy (WebP)"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress (VRAM)"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Format"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Compression Quality (WebP):"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Options"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Please specify some files!"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "At least one file needed for Atlas."
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Error importing:"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Only one file is required for large texture."
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Max Texture Size:"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for Atlas (2D)"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Cell Size:"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Large Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Large Textures (2D)"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Base Atlas Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture(s)"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for 2D"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for 3D"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "2D Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "3D Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Atlas Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid ""
+"NOTICE: Importing 2D textures is not mandatory. Just copy png/jpg files to "
+"the project."
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Crop empty space."
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Large Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Load Source Image"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Slicing"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Inserting"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Saving"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save large texture:"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Build Atlas For:"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Loading Image:"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't load image:"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Converting Images"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Cropping Images"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Blitting Images"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save atlas image:"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save converted texture:"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Invalid source!"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Invalid translation source!"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Column"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/script_create_dialog.cpp
+msgid "Language"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "No items to import!"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "No target path!"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Translations"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Couldn't import!"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Translation"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Source CSV:"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Ignore First Row"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Compress"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Add to Project (project.godot)"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Languages:"
+msgstr ""
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Translation"
+msgstr ""
+
+#: editor/multi_node_edit.cpp
+msgid "MultiNode Set"
+msgstr ""
+
+#: editor/node_dock.cpp
+msgid "Groups"
+msgstr ""
+
+#: editor/node_dock.cpp
+msgid "Select a Node to edit Signals and Groups."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Toggle Autoplay"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "New Animation Name:"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "New Anim"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Change Animation Name:"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#, fuzzy
+msgid "Delete Animation?"
+msgstr "Optimaliseer Animatie"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Remove Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: Invalid animation name!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: Animation name already exists!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Rename Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Blend Next Changed"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Change Blend Time"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Duplicate Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation to copy!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation resource on clipboard!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Pasted Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Paste Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation to edit!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation backwards from current pos. (A)"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation backwards from end. (Shift+A)"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Stop animation playback. (S)"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation from start. (Shift+D)"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation from current pos. (D)"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation position (in seconds)."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Scale animation playback globally for the node."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Create new animation in player."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load animation from disk."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load an animation from disk."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Save the current animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Display list of animations in player."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Autoplay on Load"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Edit Target Blend Times"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation Tools"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Copy Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Create New Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation Name:"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
+#: editor/script_create_dialog.cpp
+msgid "Error!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Blend Times:"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Next (Auto Queue):"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Cross-Animation Blend Times"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Animation"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "New name:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Scale:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Fade In (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Fade Out (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Mix"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Auto Restart:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Restart (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Random Restart (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Start!"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Amount:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend 0:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend 1:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "X-Fade Time (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Current:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Add Input"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Clear Auto-Advance"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Set Auto-Advance"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Delete Input"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Rename"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation tree is valid."
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation tree is invalid."
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "OneShot Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Mix Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend2 Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend3 Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend4 Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "TimeScale Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "TimeSeek Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Transition Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Import Animations.."
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Edit Node Filters"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Filters.."
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Parsing %d Triangles:"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Triangle #"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Light Baker Setup:"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Parsing Geometry"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Fixing Lights"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Making BVH"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Creating Light Octree"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Creating Octree Texture"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Transfer to Lightmaps:"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Allocating Texture #"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Baking Triangle #"
+msgstr ""
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Post-Processing Texture #"
+msgstr ""
+
+#: editor/plugins/baked_light_editor_plugin.cpp
+msgid "Bake!"
+msgstr ""
+
+#: editor/plugins/baked_light_editor_plugin.cpp
+msgid "Reset the lightmap octree baking process (start over)."
+msgstr ""
+
+#: editor/plugins/camera_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Preview"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Configure Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid Offset:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid Step:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotation Offset:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotation Step:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Pivot"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Action"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Edit IK Chain"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Edit CanvasItem"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Change Anchors"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom (%):"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Paste Pose"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Select Mode"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Drag: Rotate"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Alt+Drag: Move"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving)."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Alt+RMB: Depth list selection"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Mode"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotate Mode"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid ""
+"Show a list of all objects at the position clicked\n"
+"(same as Alt+RMB in select mode)."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Click to change object's rotation pivot."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Pan Mode"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Lock the selected object in place (can't be moved)."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Unlock the selected object (can be moved)."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Makes sure the object's children are not selectable."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Restores the object's children's ability to be selected."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_manager.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit"
+msgstr "Bewerken"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Use Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Show Grid"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Use Rotation Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap Relative"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Configure Snap.."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Use Pixel Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Expand to Parent"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Skeleton.."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Make Bones"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear Bones"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Bones"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Make IK Chain"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear IK Chain"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Reset"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Set.."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Center Selection"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Frame Selection"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Anchor"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Keys"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Key"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Key (Existing Tracks)"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Copy Pose"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear Pose"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Set a Value"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap (Pixels):"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Add %s"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Adding %s..."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Create Node"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Error instancing scene from %s"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "OK :("
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "No parent to instance a child at."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "This operation requires a single selected node."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Change default type"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
+msgid "OK"
+msgstr "Oké"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid ""
+"Drag & drop + Shift : Add node as sibling\n"
+"Drag & drop + Alt : Change node type"
+msgstr ""
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Create Poly"
+msgstr ""
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Edit Poly"
+msgstr ""
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Edit Poly (Remove Point)"
+msgstr ""
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Create a new polygon from scratch."
+msgstr ""
+
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+msgid "Create Poly3D"
+msgstr ""
+
+#: editor/plugins/collision_shape_2d_editor_plugin.cpp
+msgid "Set Handle"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Creating Mesh Library"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Thumbnail.."
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Remove item %d?"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Add Item"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Remove Selected Item"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Import from Scene"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Update from Scene"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Signaal Toevoegen"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Verwijder Signaal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Item %d"
+msgstr ""
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Items"
+msgstr ""
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Item List Editor"
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "Create Occluder Polygon"
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Edit existing polygon:"
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "LMB: Move Point."
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Ctrl+LMB: Split Segment."
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "RMB: Erase Point."
+msgstr ""
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Remove Point from Line2D"
+msgstr ""
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Add Point to Line2D"
+msgstr "Ga naar Regel"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Move Point in Line2D"
+msgstr ""
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Select Points"
+msgstr ""
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Shift+Drag: Select Control Points"
+msgstr ""
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Click: Add Point"
+msgstr ""
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Right Click: Delete Point"
+msgstr ""
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Add Point (in empty space)"
+msgstr ""
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Split Segment (in line)"
+msgstr ""
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Delete Point"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh is empty!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Static Trimesh Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Static Convex Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "This doesn't work on scene root!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Shape"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Shape"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Navigation Mesh"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "MeshInstance lacks a Mesh!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh has not surface to create outlines from!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Could not create outline!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Static Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Static Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Collision Sibling"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Collision Sibling"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline Mesh.."
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline Mesh"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Outline Size:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No mesh source specified (and no MultiMesh set in node)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No mesh source specified (and MultiMesh contains no Mesh)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (invalid path)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (not a MeshInstance)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (contains no Mesh resource)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No surface source specified."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (invalid path)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (no geometry)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (no faces)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Parent has no solid faces to populate."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Couldn't map area."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Select a Source Mesh:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Select a Target Surface:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate Surface"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate MultiMesh"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Target Surface:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Source Mesh:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "X-Axis"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Y-Axis"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Z-Axis"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh Up Axis:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Rotation:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Tilt:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Scale:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate"
+msgstr ""
+
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Create Navigation Polygon"
+msgstr ""
+
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Remove Poly And Point"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Error loading image:"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "No pixels with transparency > 128 in image.."
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Set Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Generate Visibility Rect"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Load Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Generated Point Count:"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Node does not contain geometry."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Node does not contain geometry (faces)."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Faces contain no area!"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "No faces!"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate AABB"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emission Points From Mesh"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emission Points From Node"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Clear Emitter"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emitter"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Points:"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Surface Points"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Surface Points+Normal (Directed)"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Volume"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Add Point to Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move Point in Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move In-Control in Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move Out-Control in Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Select Control Points (Shift+Drag)"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Split Segment (in curve)"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Close Curve"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Curve Point #"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve Point Pos"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve In Pos"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve Out Pos"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Split Path"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove Path Point"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Verwijder Autoload"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Create UV Map"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Transform UV Map"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Polygon 2D UV Editor"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Move Point"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Ctrl: Rotate"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Shift: Move All"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Shift+Ctrl: Scale"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Move Polygon"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Rotate Polygon"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Scale Polygon"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Polygon->UV"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "UV->Polygon"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Clear UV"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Snap"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Enable Snap"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "ERROR: Couldn't load resource!"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Add Resource"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Rename Resource"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Delete Resource"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Resource clipboard is empty!"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Load Resource"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
+#: editor/resources_dock.cpp scene/gui/line_edit.cpp scene/gui/text_edit.cpp
+msgid "Paste"
+msgstr "Plakken"
+
+#: editor/plugins/rich_text_editor_plugin.cpp
+msgid "Parse BBCode"
+msgstr ""
+
+#: editor/plugins/sample_editor_plugin.cpp
+msgid "Length:"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Open Sample File(s)"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "ERROR: Couldn't load sample!"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Add Sample"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Rename Sample"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Delete Sample"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "16 Bits"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "8 Bits"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stereo"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Mono"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Format"
+msgstr ""
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Pitch"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error while saving theme"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error saving"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error importing theme"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error importing"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Import Theme"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme As.."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Next script"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Previous script"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "File"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/property_editor.cpp
+msgid "New"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save All"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Soft Reload Script"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "History Prev"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "History Next"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Reload Theme"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme As"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close Docs"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close All"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find.."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find Next"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Step Over"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Step Into"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Break"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Continue"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Keep Debugger Open"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Window"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Move Left"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Move Right"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Open Godot online documentation"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search the class hierarchy."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search the reference documentation."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Go to previous edited document."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Go to next edited document."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Discard"
+msgstr "Discreet"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Create Script"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid ""
+"The following files are newer on disk.\n"
+"What action should be taken?:"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Reload"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Resave"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Debugger"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid ""
+"Built-in scripts can only be edited when the scene they belong to is loaded"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Pick Color"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Cut"
+msgstr "Knippen"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/property_editor.cpp
+#: editor/resources_dock.cpp scene/gui/line_edit.cpp scene/gui/text_edit.cpp
+msgid "Copy"
+msgstr "Kopiëren"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Select All"
+msgstr "Alles Selecteren"
+
+#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
+msgid "Move Up"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
+msgid "Move Down"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Indent Left"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Indent Right"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Toggle Comment"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Clone Down"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Complete Symbol"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Trim Trailing Whitespace"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Auto Indent"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Toggle Breakpoint"
+msgstr "Breekpunt Aan- of Uitschakelen"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Remove All Breakpoints"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Next Breakpoint"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Previous Breakpoint"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Verbind Aan Node:"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find Previous"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Replace.."
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Function.."
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Goto Line.."
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Contextual Help"
+msgstr ""
+
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Scalar Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Toggle Rot Only"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Function"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Function"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Default Value"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change XForm Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Texture Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Cubemap Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Comment"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add/Remove to Color Ramp"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add/Remove to Curve Map"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Curve Map"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Input Name"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Connect Graph Nodes"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Disconnect Graph Nodes"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Remove Shader Graph Node"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Move Shader Graph Node"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Duplicate Graph Node(s)"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Delete Shader Graph Node(s)"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Error: Cyclic Connection Link"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Error: Missing Input Connections"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add Shader Graph Node"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Orthogonal"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Perspective"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Aborted."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "X-Axis Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Y-Axis Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Z-Axis Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Plane Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scaling to %s%%."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotating %s degrees."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Keying is disabled (no key inserted)."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Animation Key Inserted."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Ga Verder"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "Achterwaarts"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Scrollwiel Omlaag."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Lokale wijziging aan het opslaan.."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Wijzig"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align with view"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Normal"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Wireframe"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Overdraw"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Gizmos"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Move Mode (W)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate Mode (E)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale Mode (R)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Switch Perspective/Orthogonal view"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Insert Animation Key"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Focus Origin"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Focus Selection"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align Selection With View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "Alle Selectie"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Rotate"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Scale"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Local Coords"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "1 Viewport"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "2 Viewports"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "2 Viewports (Alt)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "3 Viewports"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "3 Viewports (Alt)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "4 Viewports"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Origin"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Grid"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Snap Settings"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Translate Snap:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate Snap (deg.):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale Snap (%):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Viewport Settings"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Perspective FOV (deg.):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Z-Near:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Z-Far:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Change"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Translate:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate (deg.):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale (ratio):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Type"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Pre"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Post"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "ERROR: Couldn't load frame resource!"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Frame"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Resource clipboard is empty or not a texture!"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Paste Frame"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Empty"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Change Animation Loop"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Change Animation FPS"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "(empty)"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Animations"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Speed (FPS):"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Animation Frames"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Insert Empty (Before)"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Insert Empty (After)"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Up"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Down"
+msgstr ""
+
+#: editor/plugins/style_box_editor_plugin.cpp
+msgid "StyleBox Preview:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Snap Mode:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "<None>"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Pixel Snap"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Grid Snap"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Auto Slice"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Offset:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Step:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Separation:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Texture Region"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Texture Region Editor"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Can't save theme to file:"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add All Items"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add All"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Remove Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Theme"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add Class Items"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Remove Class Items"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Create Empty Template"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Create Empty Editor Template"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "CheckBox Radio1"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "CheckBox Radio2"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Check Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Has"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Many"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp
+msgid "Options"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Have,Many,Several,Options!"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 1"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 2"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 3"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp editor/project_settings.cpp
+#: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp
+msgid "Type:"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Data Type:"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Icon"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Style"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Color"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Paint TileMap"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Duplicate"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Erase TileMap"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Erase selection"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Find tile"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Transpose"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Mirror X"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Mirror Y"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Bucket"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Pick Tile"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Select"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 0 degrees"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 90 degrees"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 180 degrees"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 270 degrees"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Could not find tile:"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Item name or ID:"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Create from scene?"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Merge from scene?"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Create from Scene"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Merge from Scene"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Error"
+msgstr ""
+
+#: editor/project_export.cpp
+#, fuzzy
+msgid "Runnable"
+msgstr "Inschakelen"
+
+#: editor/project_export.cpp
+#, fuzzy
+msgid "Delete patch '"
+msgstr "Verwijder"
+
+#: editor/project_export.cpp
+#, fuzzy
+msgid "Delete preset '%s'?"
+msgstr "Verwijder geselecteerde bestanden?"
+
+#: editor/project_export.cpp
+msgid "Presets"
+msgstr ""
+
+#: editor/project_export.cpp editor/project_settings.cpp
+msgid "Add.."
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Resources"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export all resources in the project"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export selected scenes (and dependencies)"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export selected resources (and dependencies)"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export Mode:"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Resources to export:"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid ""
+"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid ""
+"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)"
+msgstr ""
+
+#: editor/project_export.cpp
+#, fuzzy
+msgid "Patches"
+msgstr "Matches:"
+
+#: editor/project_export.cpp
+msgid "Make Patch"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export templates for this platform are missing:"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export With Debug"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Invalid project path, the path must exist!"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Invalid project path, project.godot must not exist."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Invalid project path, project.godot must exist."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Imported Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Invalid project path (changed anything?)."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Couldn't create project.godot in project path."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "The following files failed extraction from package:"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Package Installed Successfully!"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Import Existing Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Project Path (Must Exist):"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Project Name:"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Create New Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Project Path:"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Install Project:"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Browse"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "New Game Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "That's a BINGO!"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Unnamed Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Are you sure to open more than one project?"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Are you sure to run more than one project?"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Remove project from the list? (Folder contents will not be modified)"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid ""
+"You are about the scan %s folders for existing Godot projects. Do you "
+"confirm?"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Project Manager"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Project List"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Run"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Scan"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Select a Folder to Scan"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "New Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Verwijder Selectie"
+
+#: editor/project_manager.cpp
+msgid "Exit"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Key "
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Joy Button"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Joy Axis"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Mouse Button"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Invalid action (anything goes but '/' or ':')."
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Action '%s' already exists!"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Rename Input Action Event"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Add Input Action Event"
+msgstr ""
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Meta+"
+msgstr "Meta+"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Shift+"
+msgstr "Shift+"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Alt+"
+msgstr "Alt+"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "Control+"
+msgstr ""
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "Press a Key.."
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Mouse Button Index:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Left Button"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Right Button"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Middle Button"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Wheel Up Button"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Wheel Down Button"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Button 6"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Button 7"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Button 8"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Button 9"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Joypad Axis Index:"
+msgstr ""
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Axis"
+msgstr "As"
+
+#: editor/project_settings.cpp
+msgid "Joypad Button Index:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Add Input Action"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Erase Input Action Event"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Device"
+msgstr "Apparaat"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Button"
+msgstr "Knop"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Left Button."
+msgstr "Linker Knop."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Right Button."
+msgstr "Rechter Knop."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Middle Button."
+msgstr "Middelste Knop."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Wheel Up."
+msgstr "Scrollwiel Omhoog."
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Wheel Down."
+msgstr "Scrollwiel Omlaag."
+
+#: editor/project_settings.cpp
+msgid "Error saving settings."
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Settings saved OK."
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Add Translation"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Remove Translation"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Add Remapped Path"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Resource Remap Add Remap"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Change Resource Remap Language"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Remove Resource Remap"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Remove Resource Remap Option"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Project Settings (project.godot)"
+msgstr ""
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "General"
+msgstr ""
+
+#: editor/project_settings.cpp editor/property_editor.cpp
+msgid "Property:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Del"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Copy To Platform.."
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Input Map"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Action:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Device:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Index:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Localization"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Translations"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Translations:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Remaps"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Resources:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Remaps by Locale:"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "Locale"
+msgstr ""
+
+#: editor/project_settings.cpp
+msgid "AutoLoad"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Pick a Viewport"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Ease In"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Ease Out"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Zero"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Easing In-Out"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Easing Out-In"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "File.."
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Dir.."
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Assign"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "New Script"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Show in File System"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Error loading file: Not a resource!"
+msgstr ""
+
+#: editor/property_editor.cpp
+#, fuzzy
+msgid "Pick a Node"
+msgstr "Plak Nodes"
+
+#: editor/property_editor.cpp
+msgid "Bit %d, val %d."
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "On"
+msgstr ""
+
+#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Set"
+msgstr "Zet"
+
+#: editor/property_editor.cpp
+msgid "Properties:"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Sections:"
+msgstr ""
+
+#: editor/property_selector.cpp
+msgid "Select Property"
+msgstr ""
+
+#: editor/property_selector.cpp
+msgid "Select Method"
+msgstr ""
+
+#: editor/pvrtc_compress.cpp
+msgid "Could not execute PVRTC tool:"
+msgstr ""
+
+#: editor/pvrtc_compress.cpp
+msgid "Can't load back converted image using PVRTC tool:"
+msgstr ""
+
+#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
+msgid "Reparent Node"
+msgstr ""
+
+#: editor/reparent_dialog.cpp
+msgid "Reparent Location (Select new Parent):"
+msgstr ""
+
+#: editor/reparent_dialog.cpp
+msgid "Keep Global Transform"
+msgstr ""
+
+#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
+msgid "Reparent"
+msgstr ""
+
+#: editor/resources_dock.cpp
+msgid "Create New Resource"
+msgstr ""
+
+#: editor/resources_dock.cpp
+msgid "Open Resource"
+msgstr ""
+
+#: editor/resources_dock.cpp
+msgid "Save Resource"
+msgstr ""
+
+#: editor/resources_dock.cpp
+msgid "Resource Tools"
+msgstr ""
+
+#: editor/resources_dock.cpp
+msgid "Make Local"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Run Mode:"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Current Scene"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Main Scene"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Main Scene Arguments:"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Scene Run Settings"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "No parent to instance the scenes at."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Error loading scene from %s"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Ok"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Cannot instance the scene '%s' because the current scene exists within one "
+"of its nodes."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Instance Scene(s)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done on the tree root."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Move Node In Parent"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Move Nodes In Parent"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Duplicate Node(s)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete Node(s)?"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done without a scene."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Can not perform with the root node."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done on instanced scenes."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Save New Scene As.."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Makes Sense!"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Can't operate on nodes from a foreign scene!"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Can't operate on nodes the current scene inherits from!"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Remove Node(s)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Couldn't save new scene. Likely dependencies (instances) couldn't be "
+"satisfied."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Error saving scene."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Error duplicating scene to save it."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Resource"
+
+#: editor/scene_tree_dock.cpp
+msgid "Edit Groups"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Edit Connections"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete Node(s)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Add Child Node"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Instance Child Scene"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Change Type"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Attach Script"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear Script"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Merge From Scene"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Save Branch as Scene"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Copy Node Path"
+msgstr "Kopiëer Nodes"
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete (No Confirm)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Add/Create a New Node"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Instance a scene file as a Node. Creates an inherited scene if no root node "
+"exists."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Attach a new or existing script for the selected node."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear a script for the selected node."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Spatial Visible"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle CanvasItem Visible"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Instance:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Omschrijving:"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Invalid node name, the following characters are not allowed:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Rename Node"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Scene Tree (Nodes):"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Editable Children"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Load As Placeholder"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Discard Instancing"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Open in Editor"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear Inheritance"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear Inheritance? (No Undo!)"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear!"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Select a Node"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Map kon niet gemaakt worden."
+
+#: editor/script_create_dialog.cpp
+msgid "Error loading script from %s"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Path is empty"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Path is not local"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid base path"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid extension"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Wrong extension chosen"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Ongeldig Pad."
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid class name"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "Ongeldige index eigenschap naam."
+
+#: editor/script_create_dialog.cpp
+msgid "Script valid"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "N/A"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in script (into scene file)"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Create new script file"
+msgstr "Subscriptie Maken"
+
+#: editor/script_create_dialog.cpp
+msgid "Load existing script file"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Inherits"
+msgstr "Erft:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
+msgstr "Klasse:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr "Verwijder Selectie"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Attach Node Script"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Bytes:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Warning"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Error:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Source:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Function:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Errors"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Child Process Connected"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Inspect Previous Instance"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Inspect Next Instance"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Stack Frames"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Variable"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Errors:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Stack Trace (if applicable):"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Remote Inspector"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Live Scene Tree:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Remote Object Properties: "
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Profiler"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Monitor"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Value"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Monitors"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "List of Video Memory Usage by Resource:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Total:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Video Mem"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Resource Path"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Type"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Usage"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Misc"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Clicked Control:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Clicked Control Type:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Live Edit Root:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Set From Tree"
+msgstr ""
+
+#: editor/settings_config_dialog.cpp
+msgid "Shortcuts"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Light Radius"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Camera FOV"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Camera Size"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Sphere Shape Radius"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Box Shape Extents"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Capsule Shape Radius"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Capsule Shape Height"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Ray Shape Length"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Notifier Extents"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Probe Extents"
+msgstr ""
+
+#: modules/gdscript/gd_functions.cpp
+#: modules/visual_script/visual_script_builtin_funcs.cpp
+msgid "Invalid type argument to convert(), use TYPE_* constants."
+msgstr "Ongeldige type argument voor convert(), gebruik TYPE_* constanten."
+
+#: modules/gdscript/gd_functions.cpp
+#: modules/visual_script/visual_script_builtin_funcs.cpp
+msgid "Not enough bytes for decoding bytes, or invalid format."
+msgstr "Niet genoeg bytes om bytes te decoderen, of ongeldig formaat."
+
+#: modules/gdscript/gd_functions.cpp
+msgid "step argument is zero!"
+msgstr "step argument is nul!"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not a script with an instance"
+msgstr "Niet een script met een instantie"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not based on a script"
+msgstr "Niet gebaseerd op een script"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not based on a resource file"
+msgstr "Niet gebaseerd op een resource bestand"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (missing @path)"
+msgstr "Ongeldige dictionary formaat van instantie (mist @path)"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (can't load script at @path)"
+msgstr ""
+"Ongeldige dictionary formaat van instantie (kan script niet laden uit @path)"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (invalid script at @path)"
+msgstr "Ongeldige dictionary formaat van instantie (ongeldige script op @path)"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary (invalid subclasses)"
+msgstr "Ongeldige dictionary van instantie (ongeldige subklassen)"
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"A node yielded without working memory, please read the docs on how to yield "
+"properly!"
+msgstr ""
+"Een node yieldde zonder werkgeheugen, lees alsjeblieft de documentatie over "
+"het correct gebruik van yield!"
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"Node yielded, but did not return a function state in the first working "
+"memory."
+msgstr ""
+"Node yieldde, maar gaf geen functie toestand terug in het eerste "
+"werkgeheugen."
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"Return value must be assigned to first element of node working memory! Fix "
+"your node please."
+msgstr ""
+"Een return waarde moet toegekend worden aan het eerste element van een node "
+"zijn werkgeheugen! Repareer alsjeblieft je node."
+
+#: modules/visual_script/visual_script.cpp
+msgid "Node returned an invalid sequence output: "
+msgstr "Node gaf een ongeldige sequentie uitvoer: "
+
+#: modules/visual_script/visual_script.cpp
+msgid "Found sequence bit but not the node in the stack, report bug!"
+msgstr ""
+"Een sequentie bit was gevonden, maar niet de node in de stack. Rapporteer "
+"een bug!"
+
+#: modules/visual_script/visual_script.cpp
+msgid "Stack overflow with stack depth: "
+msgstr "Stack overloop met stack diepte: "
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Functions:"
+msgstr "Functies:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Variables:"
+msgstr "Variabelen:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Name is not a valid identifier:"
+msgstr "Naam is geen geldige identifier:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Name already in use by another func/var/signal:"
+msgstr "Naam wordt al gebruikt door een andere functie, variabele of signaal:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Function"
+msgstr "Hernoem Functie"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Variable"
+msgstr "Hernoem Variabele"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Signal"
+msgstr "Hernoem Signaal"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Function"
+msgstr "Functie Toevoegen"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Variable"
+msgstr "Variabele Toevoegen"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Signal"
+msgstr "Signaal Toevoegen"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Function"
+msgstr "Verwijder Functie"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Variable"
+msgstr "Verwijder Variabele"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Editing Variable:"
+msgstr "Variabele Bewerken:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Signal"
+msgstr "Verwijder Signaal"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Editing Signal:"
+msgstr "Signaal Bewerken:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change Expression"
+msgstr "Verander Expressie"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Node"
+msgstr "Node Toevoegen"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature."
+msgstr ""
+"Houdt Meta ingedrukt om een Getter te plaatsen. Houdt Shift ingedrukt om een "
+"generiek signatuur te plaatsen."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature."
+msgstr ""
+"Houdt Ctrl ingedrukt om een Getter te plaatsen. Houdt Shift ingedrukt om een "
+"generiek signatuur te plaatsen."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a simple reference to the node."
+msgstr ""
+"Houdt Meta ingedrukt om een simpele referentie naar de node te plaatsen."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a simple reference to the node."
+msgstr ""
+"Houdt Ctrl ingedrukt om een simpele referentie naar de node te plaatsen."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a Variable Setter."
+msgstr "Houdt Meta ingedrukt om een Variable Setter te plaatsen."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a Variable Setter."
+msgstr "Houdt Ctrl ingedrukt om een Variable Setter te plaatsen."
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Preload Node"
+msgstr "Preload Node Toevoegen"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Node(s) From Tree"
+msgstr "Voeg Node(s) Toe Uit Tree"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Getter Property"
+msgstr "Getter Property Toevoegen"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Setter Property"
+msgstr "Setter Property Toevoegen"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Condition"
+msgstr "Conditie"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Sequence"
+msgstr "Sequentie"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Switch"
+msgstr "Schakelaar"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Iterator"
+msgstr "Iterator"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "While"
+msgstr "Terwijl"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Return"
+msgstr "Teruggave"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Get"
+msgstr "Krijg"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Base Type:"
+msgstr "Basis Type:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Available Nodes:"
+msgstr "Beschikbare Nodes:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Select or create a function to edit graph"
+msgstr "Selecteer of maak een functie om de grafiek te bewerken"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Signal Arguments:"
+msgstr "Signaal Argumenten Bewerken:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Variable:"
+msgstr "Variabele Bewerken:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change"
+msgstr "Wijzig"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Delete Selected"
+msgstr "Geselecteerde Verwijderen"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Find Node Type"
+msgstr "Vind Node Type"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Copy Nodes"
+msgstr "Kopiëer Nodes"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Cut Nodes"
+msgstr "Knip Nodes"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Paste Nodes"
+msgstr "Plak Nodes"
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Input type not iterable: "
+msgstr "Invoer type is niet iterabel: "
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Iterator became invalid"
+msgstr "Iterator werd ongeldig"
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Iterator became invalid: "
+msgstr "Iterator werd ongeldig: "
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Invalid index property name."
+msgstr "Ongeldige index eigenschap naam."
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Base object is not a Node!"
+msgstr "Basis object is geen Node!"
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Path does not lead Node!"
+msgstr "Pad leidt niet tot Node!"
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Invalid index property name '%s' in node %s."
+msgstr "Ongeldige index eigenschap naam '%s' in node %s."
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ": Invalid argument of type: "
+msgstr ": Ongeldig argument van type: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ": Invalid arguments: "
+msgstr ": Ongeldige argumenten: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "VariableGet not found in script: "
+msgstr "VariableGet niet gevonden in script: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "VariableSet not found in script: "
+msgstr "VariableSet niet gevonden in script: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "Custom node has no _step() method, can't process graph."
+msgstr ""
+"Zelfgemaakte node heeft geen _step() methode, kan grafiek niet verwerken."
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ""
+"Invalid return value from _step(), must be integer (seq out), or string "
+"(error)."
+msgstr ""
+"Ongeldige return waarde van _step(), moet een geheel getal (seq out) of "
+"string (error) zijn."
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "just pressed"
+msgstr "reeds ingedrukt"
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "just released"
+msgstr "reeds losgelaten"
+
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "Map kon niet gemaakt worden."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "Map kon niet gemaakt worden."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "Map kon niet gemaakt worden."
+
+#: platform/uwp/export/export.cpp
+#, fuzzy
+msgid ""
+"Couldn't read the certificate file. Are the path and password both correct?"
+msgstr ""
+"Kon het certificaat bestand niet lezen. Zijn het pad en wachtwoord beide "
+"correct?"
+
+#: platform/uwp/export/export.cpp
+msgid "Error creating the signature object."
+msgstr "Error bij het maken van het signatuur object."
+
+#: platform/uwp/export/export.cpp
+msgid "Error creating the package signature."
+msgstr "Error bij het maken van het pakket signatuur."
+
+#: platform/uwp/export/export.cpp
+msgid ""
+"No export templates found.\n"
+"Download and install export templates."
+msgstr ""
+"Geen export templates gevonden.\n"
+"Download en installeer export templates."
+
+#: platform/uwp/export/export.cpp
+msgid "Custom debug package not found."
+msgstr "Custom debug pakket niet gevonden."
+
+#: platform/uwp/export/export.cpp
+msgid "Custom release package not found."
+msgstr "Custom release pakket niet gevonden."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid unique name."
+msgstr "Ongeldige unieke naam."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid product GUID."
+msgstr "Ongeldig product GUID."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid publisher GUID."
+msgstr "Ongeldige uitgever GUID."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid background color."
+msgstr "Ongeldige achtergrondkleur."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid Store Logo image dimensions (should be 50x50)."
+msgstr "Ongeldige afmetingen voor Store Logo afbeelding (moet 50×50 zijn)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 44x44 logo image dimensions (should be 44x44)."
+msgstr ""
+"Ongeldige afmetingen van vierkante 44×44 logo afbeelding (moet 44×44 zijn)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 71x71 logo image dimensions (should be 71x71)."
+msgstr ""
+"Ongeldige afmetingen van vierkante 71×71 logo afbeelding (moet 71×71 zijn)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 150x150 logo image dimensions (should be 150x150)."
+msgstr ""
+"Ongeldige afmetingen van vierkante 150×150 logo afbeelding (moet 150×150 "
+"zijn)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 310x310 logo image dimensions (should be 310x310)."
+msgstr ""
+"Ongeldige afmetingen van vierkante 310×310 logo afbeelding (moet 310×310 "
+"zijn)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)."
+msgstr ""
+"Ongeldige afmetingen van brede 310×150 logo afbeelding (moet 310×150 zijn)."
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid splash screen image dimensions (should be 620x300)."
+msgstr "Ongeldige afmetingen van splash screen afbeelding (moet 620×300 zijn)."
+
+#: scene/2d/animated_sprite.cpp
+msgid ""
+"A SpriteFrames resource must be created or set in the 'Frames' property in "
+"order for AnimatedSprite to display frames."
+msgstr ""
+"Een SpriteFrames resource moet gemaakt of gekozen worden in de 'Frames' "
+"eigenschap om AnimatedSprite frames te laten tonen."
+
+#: scene/2d/canvas_modulate.cpp
+msgid ""
+"Only one visible CanvasModulate is allowed per scene (or set of instanced "
+"scenes). The first created one will work, while the rest will be ignored."
+msgstr ""
+"Maar één zichtbare CanvasModulate is toegestaan per scene (of set van "
+"geïnstantieerde scenes). De eerst gemaakte zal werken, terwijl de rest "
+"genegeerd wordt."
+
+#: scene/2d/collision_polygon_2d.cpp
+msgid ""
+"CollisionPolygon2D only serves to provide a collision shape to a "
+"CollisionObject2D derived node. Please only use it as a child of Area2D, "
+"StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."
+msgstr ""
+"CollisionPolygon2D dient enkel om een bots vorm te koppelen aan een node "
+"afgeleid van CollisionObject2D. Gebruik het alsjeblieft als een child van "
+"Area2D, StaticBody2D, RigidBody2D, KinematicBody2D etc. om ze een vorm te "
+"geven."
+
+#: scene/2d/collision_polygon_2d.cpp
+msgid "An empty CollisionPolygon2D has no effect on collision."
+msgstr "Een lege CollisionPolygon2D heeft geen effect op botsingen."
+
+#: scene/2d/collision_shape_2d.cpp
+msgid ""
+"CollisionShape2D only serves to provide a collision shape to a "
+"CollisionObject2D derived node. Please only use it as a child of Area2D, "
+"StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."
+msgstr ""
+"CollisionShape2D dient enkel om een bots vorm te koppelen aan een node "
+"afgeleid van CollisionObject2D. Gebruik het alsjeblieft als een child van "
+"Area2D, StaticBody2D, RigidBody2D, KinematicBody2D etc. om ze een vorm te "
+"geven."
+
+#: scene/2d/collision_shape_2d.cpp
+msgid ""
+"A shape must be provided for CollisionShape2D to function. Please create a "
+"shape resource for it!"
+msgstr ""
+"Een vorm moet voorzien worden om CollisionShape2D te laten functioneren. "
+"Creëer hiervoor alsjeblieft een vorm resource!"
+
+#: scene/2d/light_2d.cpp
+msgid ""
+"A texture with the shape of the light must be supplied to the 'texture' "
+"property."
+msgstr ""
+"Een textuur met de vorm van het licht moet worden aangeboden in de 'texture' "
+"eigenschap."
+
+#: scene/2d/light_occluder_2d.cpp
+msgid ""
+"An occluder polygon must be set (or drawn) for this occluder to take effect."
+msgstr ""
+"Een occluder polygon moet gegeven (of getekend) worden om deze occluder te "
+"laten werken."
+
+#: scene/2d/light_occluder_2d.cpp
+msgid "The occluder polygon for this occluder is empty. Please draw a polygon!"
+msgstr ""
+"De occluder polygoon van deze occluder is leeg. Teken alsjeblieft een "
+"polygoon!"
+
+#: scene/2d/navigation_polygon.cpp
+msgid ""
+"A NavigationPolygon resource must be set or created for this node to work. "
+"Please set a property or draw a polygon."
+msgstr ""
+"Een NavigatorPolygon resource moet gegeven of gemaakt worden om deze node te "
+"laten werken. Geef alsjeblieft een eigenschap of teken een polygoon."
+
+#: scene/2d/navigation_polygon.cpp
+msgid ""
+"NavigationPolygonInstance must be a child or grandchild to a Navigation2D "
+"node. It only provides navigation data."
+msgstr ""
+"NavigationPolygonInstance moet een kind of kleinkind zijn van een "
+"Navigation2D node. Het geeft alleen navigatie data."
+
+#: scene/2d/parallax_layer.cpp
+msgid ""
+"ParallaxLayer node only works when set as child of a ParallaxBackground node."
+msgstr ""
+"ParallaxLayer node werkt alleen wanneer het een kind is van een "
+"ParallaxBackground node."
+
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
+
+#: scene/2d/path_2d.cpp
+msgid "PathFollow2D only works when set as a child of a Path2D node."
+msgstr "PathFollow2D werkt alleen wanneer het een kind van een Path2D node is."
+
+#: scene/2d/remote_transform_2d.cpp
+msgid "Path property must point to a valid Node2D node to work."
+msgstr ""
+"Path eigenschap moet verwijzen naar een geldige Node2D node om te werken."
+
+#: scene/2d/sprite.cpp
+msgid ""
+"Path property must point to a valid Viewport node to work. Such Viewport "
+"must be set to 'render target' mode."
+msgstr ""
+"Path eigenschap moet verwijzen naar een geldige Viewport node om te werken. "
+"Zo een Viewport moet in 'render target' modus gezet worden."
+
+#: scene/2d/sprite.cpp
+msgid ""
+"The Viewport set in the path property must be set as 'render target' in "
+"order for this sprite to work."
+msgstr ""
+"De Viewport gegeven in de pad eigenschap moet als 'render target' ingesteld "
+"zijn om deze sprite te laten werken."
+
+#: scene/2d/visibility_notifier_2d.cpp
+msgid ""
+"VisibilityEnable2D works best when used with the edited scene root directly "
+"as parent."
+msgstr ""
+"VisibilityEnable2D werkt het beste wanneer het gebruikt wordt met de "
+"aangepaste scene root direct als ouder."
+
+#: scene/3d/body_shape.cpp
+msgid ""
+"CollisionShape only serves to provide a collision shape to a CollisionObject "
+"derived node. Please only use it as a child of Area, StaticBody, RigidBody, "
+"KinematicBody, etc. to give them a shape."
+msgstr ""
+"CollisionShape dient alleen om een bots vorm te bieden aan een node die "
+"afstamt van de CollisionObject node. Gebruik het alsjeblieft alleen als kind "
+"van Area, StaticBody, RigidBody, KinematicBody etc. om ze een vorm te geven."
+
+#: scene/3d/body_shape.cpp
+msgid ""
+"A shape must be provided for CollisionShape to function. Please create a "
+"shape resource for it!"
+msgstr ""
+"Een vorm moet gegeven worden om CollisionShape te laten werken. Maak "
+"alsjeblieft een vorm resource voor deze!"
+
+#: scene/3d/collision_polygon.cpp
+msgid ""
+"CollisionPolygon only serves to provide a collision shape to a "
+"CollisionObject derived node. Please only use it as a child of Area, "
+"StaticBody, RigidBody, KinematicBody, etc. to give them a shape."
+msgstr ""
+"CollisionPolygon dient alleen om een bots vorm te bieden aan een node die "
+"afstamt van CollisionObject. Gebruik het alsjeblieft alleen als een kind van "
+"van Area, StaticBody, RigidBody, KinematicBody etc. om ze een vorm te geven."
+
+#: scene/3d/collision_polygon.cpp
+msgid "An empty CollisionPolygon has no effect on collision."
+msgstr "Een lege CollisionPolygon heeft geen effect op botsingen."
+
+#: scene/3d/navigation_mesh.cpp
+msgid "A NavigationMesh resource must be set or created for this node to work."
+msgstr ""
+"Een NavigationMesh resource moet gegeven of gemaakt worden om deze node te "
+"laten werken."
+
+#: scene/3d/navigation_mesh.cpp
+msgid ""
+"NavigationMeshInstance must be a child or grandchild to a Navigation node. "
+"It only provides navigation data."
+msgstr ""
+"NavigationMeshInstance moet een kind of kleinkind zijn van een Navigation "
+"node. Het biedt alleen navigatie data."
+
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
+#: scene/3d/remote_transform.cpp
+msgid "Path property must point to a valid Spatial node to work."
+msgstr ""
+"Pad eigenschap moet verwijzen naar een geldige Spatial node om te werken."
+
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
+msgstr ""
+"Slechts één WorldEnvironment is toegestaan per scene (of set van "
+"geïnstantieerde scenes)."
+
+#: scene/3d/sprite_3d.cpp
+msgid ""
+"A SpriteFrames resource must be created or set in the 'Frames' property in "
+"order for AnimatedSprite3D to display frames."
+msgstr ""
+"Een SpriteFrames resource moet gemaakt of gegeven worden in de 'Frames' "
+"eigenschap om AnimatedSprite3D frames te laten tonen."
+
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
+#: scene/gui/dialogs.cpp
+msgid "Alert!"
+msgstr "Alarm!"
+
+#: scene/gui/dialogs.cpp
+msgid "Please Confirm..."
+msgstr "Bevestig Alsjeblieft..."
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a File"
+msgstr "Open een Bestand"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open File(s)"
+msgstr "Open Bestand(en)"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a Directory"
+msgstr "Open een Map"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a File or Directory"
+msgstr "Open een Bestand of Map"
+
+#: scene/gui/input_action.cpp
+msgid "Ctrl+"
+msgstr "Ctrl+"
+
+#: scene/gui/popup.cpp
+msgid ""
+"Popups will hide by default unless you call popup() or any of the popup*() "
+"functions. Making them visible for editing is fine though, but they will "
+"hide upon running."
+msgstr ""
+"Standaard verbergen pop-ups zich tenzij je popup() aanroept of één van de "
+"popup*() functies. Ze zichtbaar maken om te bewerken is prima, maar ze "
+"zullen zich verbergen bij het uitvoeren."
+
+#: scene/gui/scroll_container.cpp
+msgid ""
+"ScrollContainer is intended to work with a single child control.\n"
+"Use a container as child (VBox,HBox,etc), or a Control and set the custom "
+"minimum size manually."
+msgstr ""
+
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
+#: scene/main/viewport.cpp
+msgid ""
+"This viewport is not set as render target. If you intend for it to display "
+"its contents directly to the screen, make it a child of a Control so it can "
+"obtain a size. Otherwise, make it a RenderTarget and assign its internal "
+"texture to some node for display."
+msgstr ""
+"Deze viewport is niet ingesteld als render target. Maak het een kind van een "
+"Control zodat het een grootte kan ontvangen, als je de bedoeling hebt zijn "
+"inhoud direct op het scherm te weergeven. Anders, maak er een RenderTarget "
+"van en wijs zijn interne texture toe aan een node om te tonen."
+
+#~ msgid "Node From Scene"
+#~ msgstr "Node Uit Scene"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Path eigenschap moet verwijzen naar een geldige Particles2D node om te "
+#~ "werken."
+
+#~ msgid ""
+#~ "A SampleLibrary resource must be created or set in the 'samples' property "
+#~ "in order for SamplePlayer to play sound."
+#~ msgstr ""
+#~ "Een SampleLibrary resource moet gemaakt of gegeven worden in de 'samples' "
+#~ "eigenschap om SamplePlayer geluid af te laten spelen."
+
+#~ msgid ""
+#~ "A SampleLibrary resource must be created or set in the 'samples' property "
+#~ "in order for SpatialSamplePlayer to play sound."
+#~ msgstr ""
+#~ "Een SampleLibrary resource moet gemaakt of gegeven worden in de 'samples' "
+#~ "eigenschap om SpatialSamplePlayer geluid te laten afspelen."
+
+#, fuzzy
+#~ msgid "Replaced %d Ocurrence(s)."
+#~ msgstr "%d Voorgekomen Waarde(s) Vervangen."
diff --git a/editor/translations/pl.po b/editor/translations/pl.po
index 06a0ca2386..79dc614836 100644
--- a/editor/translations/pl.po
+++ b/editor/translations/pl.po
@@ -8,6 +8,7 @@
# Kajetan Kuszczyński <kajetanek99@gmail.com>, 2016.
# Kamil Lewan <lewan.kamil@gmail.com>, 2016.
# Karol Walasek <coreconviction@gmail.com>, 2016.
+# Maksymilian Świąć <maksymilian.swiac@gmail.com>, 2017.
# Mietek Szcześniak <ravaging@go2.pl>, 2016.
# Rafal Brozio <rafal.brozio@gmail.com>, 2016.
# siatek papieros <sbigneu@gmail.com>, 2016.
@@ -15,8 +16,8 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2016-12-29 16:37+0000\n"
-"Last-Translator: 8-bit Pixel <dawdejw@gmail.com>\n"
+"PO-Revision-Date: 2017-06-23 19:32+0000\n"
+"Last-Translator: Daniel Lewan <vision360.daniel@gmail.com>\n"
"Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/"
"godot/pl/>\n"
"Language: pl\n"
@@ -24,7 +25,7 @@ msgstr ""
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2;\n"
-"X-Generator: Weblate 2.11-dev\n"
+"X-Generator: Weblate 2.15-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -64,12 +65,14 @@ msgid "Anim Duplicate Keys"
msgstr "Duplikuj klucze"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Move Anim Track Up"
-msgstr ""
+msgstr "Przesuń ścieżkę animacji w górę"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Move Anim Track Down"
-msgstr ""
+msgstr "Przesuń ścieżkę animacji w dół"
#: editor/animation_editor.cpp
msgid "Remove Anim Track"
@@ -103,7 +106,7 @@ msgstr "Edytuj krzywe"
#: editor/animation_editor.cpp
msgid "Edit Selection Curve"
-msgstr ""
+msgstr "Edytuj krzywÄ… selekcji"
#: editor/animation_editor.cpp
msgid "Anim Delete Keys"
@@ -126,8 +129,9 @@ msgid "Continuous"
msgstr "Ciągłe"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Discrete"
-msgstr "Dyskretne"
+msgstr "Oddzielne"
#: editor/animation_editor.cpp
msgid "Trigger"
@@ -138,8 +142,9 @@ msgid "Anim Add Key"
msgstr "Dodaj klucz animacji"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Anim Move Keys"
-msgstr ""
+msgstr "Przemieść klucze"
#: editor/animation_editor.cpp
msgid "Scale Selection"
@@ -147,7 +152,7 @@ msgstr "Skaluj zaznaczone"
#: editor/animation_editor.cpp
msgid "Scale From Cursor"
-msgstr ""
+msgstr "Skaluj od kursora"
#: editor/animation_editor.cpp
msgid "Goto Next Step"
@@ -212,16 +217,18 @@ msgid "Create"
msgstr "Utwórz"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Anim Create & Insert"
-msgstr ""
+msgstr "Utwórz i wstaw"
#: editor/animation_editor.cpp
msgid "Anim Insert Track & Key"
msgstr ""
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Anim Insert Key"
-msgstr ""
+msgstr "Wstaw klatkÄ™ kluczowÄ…"
#: editor/animation_editor.cpp
msgid "Change Anim Len"
@@ -240,8 +247,9 @@ msgid "Anim Insert"
msgstr "Wstaw animacjÄ™"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Anim Scale Keys"
-msgstr ""
+msgstr "Przeskaluj klatki kluczowe"
#: editor/animation_editor.cpp
msgid "Anim Add Call Track"
@@ -264,8 +272,9 @@ msgid "Step (s):"
msgstr "Krok:"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Cursor step snap (in seconds)."
-msgstr "Krok kursora (sekundy)."
+msgstr "Krok kursora (w sekundach)."
#: editor/animation_editor.cpp
msgid "Enable/Disable looping in animation."
@@ -309,7 +318,7 @@ msgstr "Maks. błąd kątowy:"
#: editor/animation_editor.cpp
msgid "Max Optimizable Angle:"
-msgstr ""
+msgstr "Maksymalny kÄ…t do optymalizacji:"
#: editor/animation_editor.cpp
msgid "Optimize"
@@ -317,7 +326,7 @@ msgstr "Zoptymalizuj"
#: editor/animation_editor.cpp
msgid "Select an AnimationPlayer from the Scene Tree to edit animations."
-msgstr ""
+msgstr "Zaznacz węzeł AnimationPlayer w drzewie sceny aby edytować animacje."
#: editor/animation_editor.cpp
msgid "Key"
@@ -329,7 +338,7 @@ msgstr "Przejście"
#: editor/animation_editor.cpp
msgid "Scale Ratio:"
-msgstr ""
+msgstr "Współczynnik skali:"
#: editor/animation_editor.cpp
msgid "Call Functions in Which Node?"
@@ -337,11 +346,12 @@ msgstr "Z którego węzła wywołać funkcję?"
#: editor/animation_editor.cpp
msgid "Remove invalid keys"
-msgstr "Usuń wadliwe klucze"
+msgstr "Usuń wadliwe klatki kluczowe"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Remove unresolved and empty tracks"
-msgstr ""
+msgstr "Usuń nierozwiązane i puste ścieżki"
#: editor/animation_editor.cpp
msgid "Clean-up all animations"
@@ -367,6 +377,184 @@ msgstr "Zmień Typ Tablicy"
msgid "Change Array Value"
msgstr "Zmień Wartość Tablicy"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "Wersja:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Stałe:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Plik"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Opis:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "Instaluj"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Zamknij"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Połącz.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Podłącz do węzła:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Nieznany format pliku:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Zapisywanie.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Połącz.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Testowanie"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Błąd podczas zapisu zasobu!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Pobierz"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Wszystko"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -374,6 +562,30 @@ msgstr "Zmień Wartość Tablicy"
msgid "Search:"
msgstr "Szukaj:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Szukaj"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "Importuj"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "Wtyczki"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Sortuj:"
@@ -387,10 +599,6 @@ msgid "Category:"
msgstr "Kategoria:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Wszystko"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Źródło:"
@@ -402,7 +610,7 @@ msgstr "Wsparcie.."
msgid "Official"
msgstr "Oficjalny"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Społeczność"
@@ -411,8 +619,9 @@ msgid "Testing"
msgstr "Testowanie"
#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
msgid "Assets ZIP File"
-msgstr ""
+msgstr "Plik ZIP assetów"
#: editor/call_dialog.cpp
msgid "Method List For '%s':"
@@ -422,20 +631,6 @@ msgstr "Lista metod '%s':"
msgid "Call"
msgstr "Wywołanie"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Zamknij"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Lista metod:"
@@ -486,13 +681,6 @@ msgid "Selection Only"
msgstr "Tylko zaznaczenie"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Szukaj"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Szukaj"
@@ -553,10 +741,13 @@ msgid ""
"Target method not found! Specify a valid method or attach a script to target "
"Node."
msgstr ""
+"Nie znaleziono wybranej metody! Podaj właściwą metodę, lub dołącz skrypt do "
+"wybranego węzła."
#: editor/connections_dialog.cpp
+#, fuzzy
msgid "Connect To Node:"
-msgstr "Podłączanie Do Węzła:"
+msgstr "Podłącz do węzła:"
#: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp
#: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp
@@ -567,6 +758,7 @@ msgstr "Dodaj"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Usuń"
@@ -608,8 +800,9 @@ msgid "Connecting Signal:"
msgstr "Połączony sygnał:"
#: editor/connections_dialog.cpp
+#, fuzzy
msgid "Create Subscription"
-msgstr "Utwórz subskrypcje"
+msgstr "Utwórz subskrypcję"
#: editor/connections_dialog.cpp
msgid "Connect.."
@@ -643,11 +836,6 @@ msgstr "Ostatnie:"
msgid "Matches:"
msgstr "PasujÄ…ce:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "Opis:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Znajdź i zamień:"
@@ -657,16 +845,21 @@ msgid "Dependencies For:"
msgstr "Zależności:"
#: editor/dependency_editor.cpp
+#, fuzzy
msgid ""
"Scene '%s' is currently being edited.\n"
"Changes will not take effect unless reloaded."
msgstr ""
+"Scena '%s' jest obecnie edytowana.\n"
+"Zmiany nie zajdą do czasu przeładowania."
#: editor/dependency_editor.cpp
msgid ""
"Resource '%s' is in use.\n"
"Changes will take effect when reloaded."
msgstr ""
+"Zasób '%s' jest w użyciu.\n"
+"Zmiany zajdą dopiero po jego przeładowaniu."
#: editor/dependency_editor.cpp
msgid "Dependencies"
@@ -678,6 +871,7 @@ msgstr "Zasoby"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Ścieżka"
@@ -712,7 +906,7 @@ msgstr ""
#: editor/dependency_editor.cpp
msgid "Remove selected files from the project? (no undo)"
-msgstr "Usunąć wybrane pliki z projektu? (Nie można tego cofnąć)"
+msgstr "Usunąć wybrane pliki z projektu? (Nie można tego cofnąć)"
#: editor/dependency_editor.cpp
msgid "Error loading:"
@@ -724,11 +918,11 @@ msgstr "Scena nie została wczytana z powodu brakujących zależności:"
#: editor/dependency_editor.cpp editor/editor_node.cpp
msgid "Open Anyway"
-msgstr "Otwórz Pomimo"
+msgstr "Otwórz pomimo"
#: editor/dependency_editor.cpp
msgid "Which action should be taken?"
-msgstr "Jaka działanie powinno zostać podjęte?"
+msgstr "Jakie działanie powinno zostać podjęte?"
#: editor/dependency_editor.cpp
msgid "Fix Dependencies"
@@ -766,23 +960,21 @@ msgstr "Usuń"
#: editor/editor_audio_buses.cpp
msgid "Save Audio Bus Layout As.."
-msgstr ""
+msgstr "Zapisz układ magistrali audio jako..."
#: editor/editor_audio_buses.cpp
msgid "Location for New Layout.."
-msgstr ""
+msgstr "Lokalizacja nowego układu..."
#: editor/editor_audio_buses.cpp
msgid "Open Audio Bus Layout"
-msgstr ""
+msgstr "Otwórz układ magistrali audio"
#: editor/editor_audio_buses.cpp
-#, fuzzy
msgid "Add Bus"
-msgstr "Dodaj wszystko"
+msgstr "Dodaj magistralÄ™"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "Wczytaj"
@@ -792,6 +984,7 @@ msgid "Save As"
msgstr "Zapisz jako"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Domyślny"
@@ -825,8 +1018,9 @@ msgid "File does not exist."
msgstr "Plik nie istnieje."
#: editor/editor_autoload_settings.cpp
+#, fuzzy
msgid "Not in resource path."
-msgstr ""
+msgstr "Nie znaleziono w ścieżce zasobów."
#: editor/editor_autoload_settings.cpp
msgid "Add AutoLoad"
@@ -834,7 +1028,7 @@ msgstr "Dodaj AutoLoad"
#: editor/editor_autoload_settings.cpp
msgid "Autoload '%s' already exists!"
-msgstr "Autoload '%s' już istnieje!"
+msgstr "AutoLoad '%s' już istnieje!"
#: editor/editor_autoload_settings.cpp
msgid "Rename Autoload"
@@ -846,7 +1040,7 @@ msgstr ""
#: editor/editor_autoload_settings.cpp
msgid "Move Autoload"
-msgstr ""
+msgstr "Przemieść Autoload"
#: editor/editor_autoload_settings.cpp
msgid "Remove Autoload"
@@ -858,11 +1052,10 @@ msgstr "Włącz"
#: editor/editor_autoload_settings.cpp
msgid "Rearrange Autoloads"
-msgstr ""
+msgstr "Przestaw Autoloady"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Ścieżka:"
@@ -898,7 +1091,7 @@ msgstr "Aktualizacja sceny .."
#: editor/editor_dir_dialog.cpp
msgid "Choose a Directory"
-msgstr "Wybierz Katalog"
+msgstr "Wybierz katalog"
#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
#: scene/gui/file_dialog.cpp
@@ -922,15 +1115,15 @@ msgstr "Wybierz"
#: editor/editor_export.cpp
msgid "Storing File:"
-msgstr "Zapisywanie Pliku:"
+msgstr "Zapisywanie pliku:"
#: editor/editor_export.cpp
msgid "Packing"
msgstr "Pakowanie"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "Nie znaleziono pliku szablonu:\n"
#: editor/editor_export.cpp
msgid "Added:"
@@ -1014,7 +1207,7 @@ msgstr "Przełącz tryby"
#: editor/editor_file_dialog.cpp
msgid "Focus Path"
-msgstr ""
+msgstr "Przejdź do wprowadzania ścieżki"
#: editor/editor_file_dialog.cpp
msgid "Move Favorite Up"
@@ -1054,13 +1247,14 @@ msgstr "Przeszukaj źródła"
msgid "(Re)Importing Assets"
msgstr "Prze-Importowanie"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "Wyszukaj w Pomocy"
#: editor/editor_help.cpp
msgid "Class List:"
-msgstr "List Klas:"
+msgstr "List klas:"
#: editor/editor_help.cpp
msgid "Search Classes"
@@ -1071,7 +1265,6 @@ msgid "Class:"
msgstr "Klasa:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "Dziedziczy:"
@@ -1089,7 +1282,7 @@ msgstr "Członkowie:"
#: editor/editor_help.cpp
msgid "Public Methods:"
-msgstr "Metody Publiczne:"
+msgstr "Metody publiczne:"
#: editor/editor_help.cpp
msgid "GUI Theme Items:"
@@ -1110,7 +1303,7 @@ msgstr "Krótki opis:"
#: editor/editor_help.cpp
msgid "Method Description:"
-msgstr "Opis Metody:"
+msgstr "Opis metody:"
#: editor/editor_help.cpp
msgid "Search Text"
@@ -1127,10 +1320,6 @@ msgstr " Konsola:"
msgid "Clear"
msgstr "Wyczyść"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Węzeł ze Sceny"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1199,19 +1388,19 @@ msgstr "Błąd podczas zapisywania TileSet!"
#: editor/editor_node.cpp
msgid "Error trying to save layout!"
-msgstr "Błąd podczas zapisu layoutu!"
+msgstr "Błąd podczas zapisu układu!"
#: editor/editor_node.cpp
msgid "Default editor layout overridden."
-msgstr "Domyślny layout edytora został nadpisany."
+msgstr "Domyślny układ edytora został nadpisany."
#: editor/editor_node.cpp
msgid "Layout name not found!"
-msgstr "Nie znaleziono nazwy layoutu!"
+msgstr "Nie znaleziono nazwy układu!"
#: editor/editor_node.cpp
msgid "Restored default layout to base settings."
-msgstr "Przywrócono domyślny layout do ustawień bazowych."
+msgstr "Przywrócono domyślny układ do ustawień bazowych."
#: editor/editor_node.cpp
msgid "Copy Params"
@@ -1236,7 +1425,7 @@ msgstr "Skrypt wbudowany"
#: editor/editor_node.cpp
msgid "Make Sub-Resources Unique"
-msgstr ""
+msgstr "Utwórz unikalne pod-zasoby"
#: editor/editor_node.cpp
msgid "Open in Help"
@@ -1247,10 +1436,11 @@ msgid "There is no defined scene to run."
msgstr "Nie ma zdefiniowanej sceny do uruchomienia."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"Nie zdefiniowano głównej sceny, chcesz jakąś wybrać?\n"
"Można to później zmienić w \"Ustawienia projektu\" w kategorii \"aplikacja\"."
@@ -1312,6 +1502,11 @@ msgid "Save Scene As.."
msgstr "Zapisz scenÄ™ jako.."
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Węzeł"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr "Ta scena nie została zapisana. Zapisać przed uruchomieniem?"
@@ -1364,13 +1559,17 @@ msgid "Pick a Main Scene"
msgstr "Wybierz główną scenę"
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"Scene '%s' was automatically imported, so it can't be modified.\n"
"To make changes to it, a new inherited scene can be created."
msgstr ""
+"Scena '%s' została automatycznie zaimportowana, i nie może być "
+"zmodyfikowana.\n"
+"Aby dokonać na niej zmian, można utworzyć nową odziedziczoną scenę."
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
#, fuzzy
msgid "Ugh"
msgstr "Błąd"
@@ -1394,11 +1593,11 @@ msgstr "Scena '%s' ma niespełnione zależności:"
#: editor/editor_node.cpp
msgid "Save Layout"
-msgstr "Zapisz layout"
+msgstr "Zapisz układ"
#: editor/editor_node.cpp
msgid "Delete Layout"
-msgstr "Usuń layout"
+msgstr "Usuń układ"
#: editor/editor_node.cpp
msgid "Switch Scene Tab"
@@ -1412,6 +1611,10 @@ msgstr "Pozostało %d plików"
msgid "%d more file(s) or folder(s)"
msgstr "Pozostało %d plików lub folderów"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "Tryb bez rozproszeń"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Scena"
@@ -1443,7 +1646,7 @@ msgstr "Nowa scena"
#: editor/editor_node.cpp
msgid "New Inherited Scene.."
-msgstr "Nowa odziedziczona scena.."
+msgstr "Nowa dziedziczÄ…ca scena.."
#: editor/editor_node.cpp
msgid "Open Scene.."
@@ -1465,7 +1668,7 @@ msgstr "Zamknij scenÄ™"
msgid "Close Goto Prev. Scene"
msgstr "Zamknij i przejdź do poprzedniej sceny"
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "Ostatnio otwierane"
@@ -1493,99 +1696,41 @@ msgid "Redo"
msgstr "Ponów"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "Uruchom skrypt"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Ustawienia projektu"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "Resetuj scenÄ™"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Wyjdź do Listy Projektów"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Tryb bez rozproszeń"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "Importuj zasoby do projektu."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "Importuj"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "Narzędzia"
+#, fuzzy
+msgid "Project"
+msgstr "Nowy projekt"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "Ustawienia projektu"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "Eksportuj projekt na inne platformy."
+msgid "Run Script"
+msgstr "Uruchom skrypt"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "Eksport"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "Uruchom projekt."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "Uruchom"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "Zapauzuj scenÄ™"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "Zapauzuj scenÄ™"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "Zatrzymaj scene."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "Stop"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "Uruchom aktualnie edytowanÄ… scenÄ™."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "Odtwórz Scene"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "Uruchom niestandardowÄ… scenÄ™"
+msgid "Tools"
+msgstr "Narzędzia"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "Uruchom niestandardowÄ… scenÄ™"
+msgid "Quit to Project List"
+msgstr "Wyjdź do Listy Projektów"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "Opcje debugowania"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "Debug"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1601,7 +1746,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Small Deploy with Network FS"
-msgstr ""
+msgstr "Testuj z sieciowym systemem plików"
#: editor/editor_node.cpp
msgid ""
@@ -1671,9 +1816,10 @@ msgstr ""
"(działające instancje będą zrestartowane). Opcja ta działa szybciej z "
"użyciem sieciowych systemów plików."
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "Ustawienia"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Edycja"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1681,7 +1827,7 @@ msgstr "Ustawienia edytora"
#: editor/editor_node.cpp
msgid "Editor Layout"
-msgstr "Layout edytora"
+msgstr "Układ edytora"
#: editor/editor_node.cpp
#, fuzzy
@@ -1691,15 +1837,72 @@ msgstr "Pełny ekran"
#: editor/editor_node.cpp editor/project_export.cpp
#, fuzzy
msgid "Manage Export Templates"
-msgstr "Åadowanie szablonów eksportu"
+msgstr "ZarzÄ…dzanie szablonami eksportu"
+
+#: editor/editor_node.cpp
+msgid "Help"
+msgstr "Pomoc"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "Klasy"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "Zamknij pliki pomocy"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
#: editor/editor_node.cpp
msgid "About"
msgstr "O programie"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "Powiadomienie o zmianie stanu zasobu zewnętrznego."
+msgid "Play the project."
+msgstr "Uruchom projekt."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "Uruchom"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "Zapauzuj scenÄ™"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "Zapauzuj scenÄ™"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Zatrzymaj scene."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "Stop"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "Uruchom aktualnie edytowanÄ… scenÄ™."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Odtwórz Scene"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Wybierz scenę do uruchomienia"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "Uruchom niestandardowÄ… scenÄ™"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1714,8 +1917,9 @@ msgid "Update Changes"
msgstr "Odśwież Zmiany"
#: editor/editor_node.cpp
+#, fuzzy
msgid "Disable Update Spinner"
-msgstr ""
+msgstr "Wyłącz wiatraczek aktualizacji"
#: editor/editor_node.cpp
msgid "Inspector"
@@ -1723,7 +1927,7 @@ msgstr "Inspektor"
#: editor/editor_node.cpp
msgid "Create a new resource in memory and edit it."
-msgstr "Utwórz nowy zasób wewnątrz pamięci i edytuj go."
+msgstr "Utwórz nowy zasób w pamięci i edytuj go."
#: editor/editor_node.cpp
msgid "Load an existing resource from disk and edit it."
@@ -1767,7 +1971,7 @@ msgstr "Konsola"
#: editor/editor_node.cpp editor/editor_reimport_dialog.cpp
msgid "Re-Import"
-msgstr "Prze-Importuj"
+msgstr "Importuj ponownie"
#: editor/editor_node.cpp editor/editor_plugin_settings.cpp
msgid "Update"
@@ -1782,6 +1986,14 @@ msgid "Thanks!"
msgstr "Dzięki!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "Zaimportuj Szablony z pliku ZIP"
@@ -1809,15 +2021,41 @@ msgstr "Otwórz i Uruchom Skrypt"
msgid "Load Errors"
msgstr "Wczytaj błędy"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Otwórz w edytorze"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Otwórz w edytorze"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Otwórz w edytorze"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "Wyeksportuj biblioteke"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Otwórz w edytorze"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "Otwórz w edytorze"
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "Zainstalowane wtyczki:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "Wersja:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "Autor:"
@@ -1880,7 +2118,7 @@ msgstr "Bieżąca scena musi być zapisana aby ponownie zaimportować."
#: editor/editor_reimport_dialog.cpp
msgid "Save & Re-Import"
-msgstr "Zapisz i Prze-Importuj"
+msgstr "Zapisz i importuj ponownie"
#: editor/editor_reimport_dialog.cpp
msgid "Re-Importing"
@@ -1947,11 +2185,11 @@ msgstr "Instaluj"
#: editor/export_template_manager.cpp
msgid "Download"
-msgstr ""
+msgstr "Pobierz"
#: editor/export_template_manager.cpp
msgid "(Missing)"
-msgstr ""
+msgstr "(Nie znaleziono)"
#: editor/export_template_manager.cpp
#, fuzzy
@@ -1960,7 +2198,7 @@ msgstr "Bieżący:"
#: editor/export_template_manager.cpp
msgid "Remove template version '%s'?"
-msgstr ""
+msgstr "Usunąć wersję '%s' szablonu?"
#: editor/export_template_manager.cpp
msgid "Can't open export templates zip."
@@ -1968,17 +2206,20 @@ msgstr "Nie można otworzyć pliku zip szablonów eksportu."
#: editor/export_template_manager.cpp
msgid "Invalid version.txt format inside templates."
-msgstr ""
+msgstr "Nieprawidłowy format pliku version.txt w szablonach."
#: editor/export_template_manager.cpp
msgid ""
"Invalid version.txt format inside templates. Revision is not a valid "
"identifier."
msgstr ""
+"nieprawidłowy format pliku version.txt wewnątrz szablonów. Zmiana nie jest "
+"prawidłowym identyfikatorem."
#: editor/export_template_manager.cpp
+#, fuzzy
msgid "No version.txt found inside templates."
-msgstr ""
+msgstr "Nie znaleziono pliku version.txt w szablonach."
#: editor/export_template_manager.cpp
#, fuzzy
@@ -1986,9 +2227,8 @@ msgid "Error creating path for templates:\n"
msgstr "Błąd podczas zapisywania atlasu:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Extracting Export Templates"
-msgstr "Åadowanie szablonów eksportu"
+msgstr "Wypakowywanie szablonów eksportu"
#: editor/export_template_manager.cpp
msgid "Importing:"
@@ -1996,7 +2236,7 @@ msgstr "Importowanie:"
#: editor/export_template_manager.cpp
msgid "Loading Export Templates"
-msgstr "Åadowanie szablonów eksportu"
+msgstr "Wczytywanie szablonów eksportu"
#: editor/export_template_manager.cpp
#, fuzzy
@@ -2004,14 +2244,12 @@ msgid "Current Version:"
msgstr "Aktualna scena"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Installed Versions:"
-msgstr "Zainstalowane wtyczki:"
+msgstr "Zainstalowane szablony:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Install From File"
-msgstr "Zainstaluj projekt:"
+msgstr "Zainstaluj z pliku"
#: editor/export_template_manager.cpp
#, fuzzy
@@ -2024,9 +2262,8 @@ msgid "Select template file"
msgstr "Usunąć zaznaczone pliki?"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Export Template Manager"
-msgstr "Åadowanie szablonów eksportu"
+msgstr "Menedżer szablonów eksportu"
#: editor/file_type_cache.cpp
msgid "Can't open file_type_cache.cch for writing, not saving file type cache!"
@@ -2036,11 +2273,12 @@ msgstr ""
#: editor/filesystem_dock.cpp
msgid "Cannot navigate to '"
-msgstr ""
+msgstr "Nie można przejść do '"
#: editor/filesystem_dock.cpp
+#, fuzzy
msgid "Same source and destination files, doing nothing."
-msgstr ""
+msgstr "Pliki źródłowe i docelowe są te same, nie podjęto żadnej akcji."
#: editor/filesystem_dock.cpp
msgid "Same source and destination paths, doing nothing."
@@ -2054,7 +2292,7 @@ msgstr "Nie możesz przenieść danego katalogu do jego wnętrza."
#: editor/filesystem_dock.cpp
msgid "Can't operate on '..'"
-msgstr ""
+msgstr "Nie można operować na '..'"
#: editor/filesystem_dock.cpp
msgid "Pick New Name and Location For:"
@@ -2066,11 +2304,15 @@ msgstr "Nie wybrano pliku!"
#: editor/filesystem_dock.cpp
msgid "Expand all"
-msgstr ""
+msgstr "Rozwiń foldery"
#: editor/filesystem_dock.cpp
msgid "Collapse all"
-msgstr ""
+msgstr "Zwiń foldery"
+
+#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "Pokaż w menadżerze plików"
#: editor/filesystem_dock.cpp
msgid "Instance"
@@ -2101,10 +2343,6 @@ msgid "Info"
msgstr "Informacje"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "Pokaż w menadżerze plików"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Importuj ponownie.."
@@ -2149,7 +2387,7 @@ msgstr "Powierzchnia %d"
#: editor/io_plugins/editor_scene_import_plugin.cpp
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Import Scene"
-msgstr "Importuj Scene"
+msgstr "Importuj ScenÄ™"
#: editor/import/resource_importer_scene.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
@@ -2195,16 +2433,15 @@ msgstr "Importuj"
#: editor/import_dock.cpp editor/property_editor.cpp
msgid "Preset.."
-msgstr ""
+msgstr "Ustawienie predefiniowane.."
#: editor/import_dock.cpp
-#, fuzzy
msgid "Reimport"
-msgstr "Prze-Importuj"
+msgstr "Importuj ponownie"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
msgid "No bit masks to import!"
-msgstr ""
+msgstr "Brak mask bitowych do zaimportowania!"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
#: editor/io_plugins/editor_sample_import_plugin.cpp
@@ -2266,39 +2503,40 @@ msgstr "BitMask"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "No source font file!"
-msgstr "Brak pliku źródłowego czcionki!"
+msgstr "Brak pliku źródłowego fontu!"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "No target font resource!"
-msgstr "Brak docelowego zasobu czcionki!"
+msgstr "Brak docelowego zasobu fontu!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"Błędne rozszerzenie pliku.\n"
"Proszę użyć .fnt."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Can't load/process source font."
-msgstr ""
+msgstr "Nie można wczytać/przetworzyć źródłowego fontu."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Couldn't save font."
-msgstr "Nie udało się zapisać czcionki."
+msgstr "Nie udało się zapisać fontu."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Source Font:"
-msgstr "Źródło czcionki:"
+msgstr "Źródło fontu:"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Source Font Size:"
-msgstr "Wielkość oryginalna czcionki:"
+msgstr "Wielkość oryginalna fontu:"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Dest Resource:"
-msgstr "Wielkość docelowa czcionki:"
+msgstr "Zasób docelowy:"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "The quick brown fox jumps over the lazy dog."
@@ -2317,17 +2555,17 @@ msgstr "Opcje:"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Font Import"
-msgstr "Import czcionki"
+msgstr "Import fontu"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"This file is already a Godot font file, please supply a BMFont type file "
"instead."
-msgstr ""
+msgstr "Ten plik jest już plikiem fontu Godot, proszę podać plik typu BMFont."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Failed opening as BMFont file."
-msgstr ""
+msgstr "Nie powiodło się, otwarcie pliku jako BMFont."
#: editor/io_plugins/editor_font_import_plugin.cpp
#: scene/resources/dynamic_font.cpp
@@ -2351,12 +2589,12 @@ msgstr "Niepoprawny rozmiar fonta."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Invalid font custom source."
-msgstr "Nie rozpoznano typu czcionki."
+msgstr "Nie rozpoznano typu fontu."
#: editor/io_plugins/editor_font_import_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp
msgid "Font"
-msgstr "Czcionka"
+msgstr "Font"
#: editor/io_plugins/editor_mesh_import_plugin.cpp
msgid "No meshes to import!"
@@ -2405,7 +2643,7 @@ msgstr "Flagi"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Bake FPS:"
-msgstr ""
+msgstr "Wypal FPS:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Optimizer"
@@ -2528,7 +2766,7 @@ msgstr "Nie można zaimportować pliku wewnątrz siebie samego:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Couldn't localize path: %s (already local)"
-msgstr ""
+msgstr "Nie można zlokalizować ścieżki: %s (już jest lokalna)"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "3D Scene Animation"
@@ -2620,7 +2858,7 @@ msgstr "Importuj tekstury dla 3D"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Import Textures"
-msgstr "Zaimportuj Textury"
+msgstr "Zaimportuj Tekstury"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "2D Texture"
@@ -2676,7 +2914,7 @@ msgstr "Nie udało się zapisać dużej tekstury:"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Build Atlas For:"
-msgstr ""
+msgstr "Zbuduj Atlas dla:"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Loading Image:"
@@ -2700,11 +2938,12 @@ msgstr ""
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Couldn't save atlas image:"
-msgstr ""
+msgstr "Nie można zapisać obrazu atlasu:"
#: editor/io_plugins/editor_texture_import_plugin.cpp
+#, fuzzy
msgid "Couldn't save converted texture:"
-msgstr ""
+msgstr "Nie można zapisać zkonwertowanej tekstury:"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Invalid source!"
@@ -2756,8 +2995,9 @@ msgid "Compress"
msgstr "Skompresuj"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr "Dodaj do projektu (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "Dodaj do projektu (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -2845,7 +3085,7 @@ msgstr "BÅÄ„D: Brak animacji do skopiowania!"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "ERROR: No animation resource on clipboard!"
-msgstr ""
+msgstr "BÅÄ„D: Brak zasobu animacji w schowku!"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Pasted Animation"
@@ -2865,7 +3105,7 @@ msgstr "Odtwórz zaznaczoną animację od tyłu z aktualnej poz. (A)"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Play selected animation backwards from end. (Shift+A)"
-msgstr ""
+msgstr "Odtwarzaj zaznaczoną animację od końca. (Shift+A)"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Stop animation playback. (S)"
@@ -2893,11 +3133,11 @@ msgstr "Stwórz nową animację."
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Load animation from disk."
-msgstr "Załaduj animację z dysku."
+msgstr "Wczytaj animacjÄ™ z dysku."
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Load an animation from disk."
-msgstr "Załaduj animacje z dysku."
+msgstr "Wczytaj animacje z dysku."
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Save the current animation"
@@ -2945,7 +3185,7 @@ msgstr ""
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Next (Auto Queue):"
-msgstr ""
+msgstr "Następny (automatyczna kolejka):"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Cross-Animation Blend Times"
@@ -2991,7 +3231,7 @@ msgstr "Restart(y):"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Random Restart (s):"
-msgstr ""
+msgstr "Losowy restart (s):"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Start!"
@@ -3000,7 +3240,7 @@ msgstr "Start!"
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Amount:"
-msgstr ""
+msgstr "Ilośc:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend:"
@@ -3044,15 +3284,15 @@ msgstr "Zmień nazwę"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Animation tree is valid."
-msgstr ""
+msgstr "Drzewo animacji jest poprawne."
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Animation tree is invalid."
-msgstr ""
+msgstr "Drzewo animacji jest wadliwe."
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Animation Node"
-msgstr ""
+msgstr "Węzeł animacji"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "OneShot Node"
@@ -3092,7 +3332,7 @@ msgstr "Zaimportuj animacje.."
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Edit Node Filters"
-msgstr ""
+msgstr "Edytuj filtry węzłów"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Filters.."
@@ -3161,7 +3401,7 @@ msgstr "PodglÄ…d"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Configure Snap"
-msgstr "Konfiguruj krokowanie"
+msgstr "Konfiguruj przyciÄ…ganie"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/polygon_2d_editor_plugin.cpp
@@ -3246,6 +3486,8 @@ msgid ""
"Show a list of all objects at the position clicked\n"
"(same as Alt+RMB in select mode)."
msgstr ""
+"Pokaż listę obiektów w miejscu kliknięcia\n"
+"(tak samo jak Alt+RMB w trybie zaznaczania)."
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Click to change object's rotation pivot."
@@ -3287,7 +3529,7 @@ msgstr "Użyj przyciągania"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Show Grid"
-msgstr "Pokaż kratownicę"
+msgstr "Pokaż siatkę"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Use Rotation Snap"
@@ -3386,7 +3628,7 @@ msgstr "Ustaw Wartość"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap (Pixels):"
-msgstr ""
+msgstr "PrzyciÄ…ganie (piksele):"
#: editor/plugins/canvas_item_editor_plugin.cpp
#, fuzzy
@@ -3395,7 +3637,7 @@ msgstr "Dodaj wszystko"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Adding %s..."
-msgstr ""
+msgstr "Dodawanie %s..."
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Create Node"
@@ -3403,19 +3645,20 @@ msgstr "Utwórz węzeł"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Error instancing scene from %s"
-msgstr ""
+msgstr "Błąd instancjacji sceny z %s"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "OK :("
msgstr "OK :("
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+#, fuzzy
msgid "No parent to instance a child at."
-msgstr ""
+msgstr "Brak elementu nadrzędnego do stworzenia instancji."
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "This operation requires a single selected node."
-msgstr ""
+msgstr "Ta operacja wymaga pojedynczego wybranego węzła."
#: editor/plugins/canvas_item_editor_plugin.cpp
#, fuzzy
@@ -3423,7 +3666,7 @@ msgid "Change default type"
msgstr "Zmień Wartość Domyślną"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "OK"
@@ -3432,6 +3675,8 @@ msgid ""
"Drag & drop + Shift : Add node as sibling\n"
"Drag & drop + Alt : Change node type"
msgstr ""
+"Przeciągnij i upuść + Shift: dodaj węzeł równorzędny\n"
+"Przeciągnij i upuść + Alt: Zmień typ węzła"
#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
@@ -3462,7 +3707,7 @@ msgstr ""
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
#: editor/plugins/navigation_polygon_editor_plugin.cpp
msgid "Create a new polygon from scratch."
-msgstr ""
+msgstr "Utwórz nowy wielokąt."
#: editor/plugins/collision_polygon_editor_plugin.cpp
msgid "Create Poly3D"
@@ -3472,18 +3717,9 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
-msgstr ""
+msgstr "Tworzenie Mesh Library"
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Thumbnail.."
@@ -3511,6 +3747,35 @@ msgstr "Import ze sceny"
msgid "Update from Scene"
msgstr "Aktualizuj ze sceny"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Dodaj Wejście"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Usuń punkt ścieżki"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "Wczytaj Zasób"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Modify Curve"
+msgstr "Zamknij krzywÄ…"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "Dodaj/Usuń punkty w Color Ramp"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "Modyfikuj Color Ramp"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "Element %d"
@@ -3540,7 +3805,7 @@ msgstr "LMB: Przesuń Punkt."
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
#: editor/plugins/navigation_polygon_editor_plugin.cpp
msgid "Ctrl+LMB: Split Segment."
-msgstr ""
+msgstr "Ctrl + LPM: Podziału segmentu."
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
#: editor/plugins/navigation_polygon_editor_plugin.cpp
@@ -3605,19 +3870,19 @@ msgstr "Usuń Punkt"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Mesh is empty!"
-msgstr ""
+msgstr "Siatka jest pusta!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Static Trimesh Body"
-msgstr ""
+msgstr "Stwórz Static Trimesh Body"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Static Convex Body"
-msgstr ""
+msgstr "Stwórz statycznych ciało wypukłe"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "This doesn't work on scene root!"
-msgstr ""
+msgstr "Nie działa na głównym węźle sceny!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Trimesh Shape"
@@ -3761,15 +4026,15 @@ msgstr ""
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Random Rotation:"
-msgstr ""
+msgstr "Obrót losowy:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Random Tilt:"
-msgstr ""
+msgstr "Losowe nachylenie:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Random Scale:"
-msgstr ""
+msgstr "Losowa skala:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Populate"
@@ -3784,6 +4049,20 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "Usuń maskę emisji"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "Generuj AABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "Błąd wczytywania obrazu:"
@@ -3793,47 +4072,72 @@ msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Set Emission Mask"
-msgstr ""
+msgstr "Ustaw maskÄ™ emisji"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
-msgstr ""
+msgstr "Wczytaj maskÄ™ emisji"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Generated Point Count:"
-msgstr ""
+msgstr "Wygeneruj chmurę punktów:"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Åšredni Czas (sek)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "Ustaw maskÄ™ emisji"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "Utwórz ze sceny"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Punkty emisji:"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
-msgstr ""
+msgstr "Węzeł nie zawiera geometrii."
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry (faces)."
+msgstr "Węzeł nie zawiera geometrii (ściany)."
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
-msgstr ""
+msgstr "Åšciana nie ma powierzchni!"
#: editor/plugins/particles_editor_plugin.cpp
msgid "No faces!"
-msgstr ""
+msgstr "Brak ścian!"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Generate AABB"
msgstr "Generuj AABB"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
-msgstr ""
+msgid "Create Emission Points From Mesh"
+msgstr "Twórz punkty emisji z siatki"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
-msgstr ""
+msgid "Create Emission Points From Node"
+msgstr "Twórz punkty emisji z węzła"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Clear Emitter"
@@ -3844,33 +4148,53 @@ msgid "Create Emitter"
msgstr "Utwórz Emiter"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
-msgstr ""
+msgid "Emission Points:"
+msgstr "Punkty emisji:"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr ""
+#, fuzzy
+msgid "Surface Points"
+msgstr "Powierzchnia %d"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "Powierzchnia"
+msgid "Surface Points+Normal (Directed)"
+msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "Głośność"
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr "Źródła emisji: "
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "Generuj AABB"
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
-msgstr ""
+msgstr "Usuń punkt z krzywej"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "Usuń punkt z krzywej"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "Usuń punkt z krzywej"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
-msgstr ""
+msgstr "Dodaj punkt do krzywej"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Move Point in Curve"
-msgstr ""
+msgstr "PrzenieÅ› punkt krzywej"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Move In-Control in Curve"
@@ -3900,7 +4224,7 @@ msgstr "Punkt Krzywej #"
#: editor/plugins/path_editor_plugin.cpp
msgid "Set Curve Point Pos"
-msgstr ""
+msgstr "Ustaw pozycje punktu krzywej"
#: editor/plugins/path_editor_plugin.cpp
msgid "Set Curve In Pos"
@@ -3918,6 +4242,16 @@ msgstr "Podziel Ścieżkę"
msgid "Remove Path Point"
msgstr "Usuń punkt ścieżki"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Usuń punkt ścieżki"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "Usuń punkt ścieżki"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "Utwórz Mapę UV"
@@ -3973,11 +4307,11 @@ msgstr "Wyczyść UV"
#: editor/plugins/polygon_2d_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap"
-msgstr ""
+msgstr "PrzyciÄ…gaj"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Enable Snap"
-msgstr ""
+msgstr "Włączyć przyciąganie"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Grid"
@@ -4002,7 +4336,7 @@ msgstr "Usuń zasób"
#: editor/plugins/resource_preloader_editor_plugin.cpp
msgid "Resource clipboard is empty!"
-msgstr ""
+msgstr "Schowka zasobów jest pusty!"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
@@ -4019,7 +4353,7 @@ msgstr "Wklej"
#: editor/plugins/rich_text_editor_plugin.cpp
msgid "Parse BBCode"
-msgstr ""
+msgstr "Parsuj BBCode"
#: editor/plugins/sample_editor_plugin.cpp
msgid "Length:"
@@ -4027,7 +4361,7 @@ msgstr "Długość:"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Open Sample File(s)"
-msgstr ""
+msgstr "Otwórz plik(i) sampli"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "ERROR: Couldn't load sample!"
@@ -4035,15 +4369,15 @@ msgstr ""
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Add Sample"
-msgstr ""
+msgstr "Dodaj sampel"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Rename Sample"
-msgstr ""
+msgstr "Zmień nazwę sampla"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Delete Sample"
-msgstr ""
+msgstr "Usuń sampel"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "16 Bits"
@@ -4071,6 +4405,11 @@ msgid "Pitch"
msgstr "Wysokość"
#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "Wyczyść Kości"
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr "Błąd podczas zapisywania motywu"
@@ -4116,15 +4455,15 @@ msgstr "Zapisz wszystko"
#: editor/plugins/script_editor_plugin.cpp
msgid "Soft Reload Script"
-msgstr ""
+msgstr "Miękkie przeładowania skryptu"
#: editor/plugins/script_editor_plugin.cpp
msgid "History Prev"
-msgstr ""
+msgstr "Poprzedni plik"
#: editor/plugins/script_editor_plugin.cpp
msgid "History Next"
-msgstr ""
+msgstr "Następny plik"
#: editor/plugins/script_editor_plugin.cpp
msgid "Reload Theme"
@@ -4159,21 +4498,20 @@ msgstr "Znajdź.."
msgid "Find Next"
msgstr "Znajdź następny"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "Debug"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+#, fuzzy
msgid "Step Over"
-msgstr ""
+msgstr "Przekrocz"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+#, fuzzy
msgid "Step Into"
-msgstr ""
+msgstr "Krok w"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+#, fuzzy
msgid "Break"
-msgstr ""
+msgstr "Przerwa"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Continue"
@@ -4196,16 +4534,9 @@ msgid "Move Right"
msgstr "Przesuń w prawo"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "Poradniki"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "Otwórz https://godotengine.org na sekcji poradników."
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "Klasy"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "Poszukaj w dokumentacji referencyjnej."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
@@ -4213,7 +4544,7 @@ msgstr "Szukaj w hierarchii klas."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the reference documentation."
-msgstr ""
+msgstr "Poszukaj w dokumentacji referencyjnej."
#: editor/plugins/script_editor_plugin.cpp
msgid "Go to previous edited document."
@@ -4237,6 +4568,8 @@ msgid ""
"The following files are newer on disk.\n"
"What action should be taken?:"
msgstr ""
+"Następujące pliki są nowsze na dysku.\n"
+"Jakie działania należy podjąć?:"
#: editor/plugins/script_editor_plugin.cpp
msgid "Reload"
@@ -4254,6 +4587,8 @@ msgstr "Debugger"
msgid ""
"Built-in scripts can only be edited when the scene they belong to is loaded"
msgstr ""
+"Wbudowany skrypty mogą być edytowane tylko, po załadowaniu sceny do której "
+"należą"
#: editor/plugins/script_text_editor.cpp
#, fuzzy
@@ -4261,6 +4596,23 @@ msgid "Pick Color"
msgstr "Kolor"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "Konwersja obrazków"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4300,21 +4652,29 @@ msgstr "Ustaw komentarz"
#: editor/plugins/script_text_editor.cpp
msgid "Clone Down"
-msgstr ""
+msgstr "Duplikuj liniÄ™"
#: editor/plugins/script_text_editor.cpp
msgid "Complete Symbol"
-msgstr ""
+msgstr "Uzupełnij symbol"
#: editor/plugins/script_text_editor.cpp
msgid "Trim Trailing Whitespace"
+msgstr "Przytnij końcowe spacje"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
msgstr ""
#: editor/plugins/script_text_editor.cpp
-msgid "Auto Indent"
+msgid "Convert Indent To Tabs"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Auto Indent"
+msgstr "Automatyczne wcięcie"
+
+#: editor/plugins/script_text_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
msgid "Toggle Breakpoint"
msgstr "Przełącz pułapkę"
@@ -4332,6 +4692,16 @@ msgid "Goto Previous Breakpoint"
msgstr "Przejdź do poprzedniej pułapki"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "Konwertuje na.."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Konwertuje na.."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "Znajdź poprzedni"
@@ -4354,37 +4724,41 @@ msgstr "Przejdź do linii.."
msgid "Contextual Help"
msgstr "Pomoc kontekstowa"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
-msgstr ""
+msgstr "Zmień wartość stałej skalarnej"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Constant"
-msgstr ""
+msgstr "Zmień stałą Vec"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change RGB Constant"
-msgstr ""
+msgstr "Zmień stałą RGB"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Operator"
-msgstr ""
+msgstr "Zmień operator skalara"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Operator"
-msgstr ""
+msgstr "Zmień operator Vec"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Scalar Operator"
-msgstr ""
+msgstr "Zmień operator Vec Scalar"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change RGB Operator"
-msgstr ""
+msgstr "Zmień operator RGB"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Toggle Rot Only"
-msgstr ""
+msgstr "Przełącz tylko rotacje"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Function"
@@ -4480,11 +4854,11 @@ msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Orthogonal"
-msgstr ""
+msgstr "Ortogonalny"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective"
-msgstr ""
+msgstr "Perspektywa"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform Aborted."
@@ -4508,31 +4882,31 @@ msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scaling to %s%%."
-msgstr ""
+msgstr "Skalowanie do %s%%."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotating %s degrees."
-msgstr ""
+msgstr "Obracanie o %s stopni."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom View."
-msgstr ""
+msgstr "Widok z dołu."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom"
-msgstr ""
+msgstr "Dół"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Top View."
-msgstr ""
+msgstr "Widok z góry."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Top"
-msgstr ""
+msgstr "Góra"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rear View."
-msgstr ""
+msgstr "Widok z tyłu."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rear"
@@ -4540,7 +4914,7 @@ msgstr "Tył"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Front View."
-msgstr ""
+msgstr "Widok z przodu."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Front"
@@ -4548,19 +4922,19 @@ msgstr "Przód"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Left View."
-msgstr ""
+msgstr "Widok z lewej."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Left"
-msgstr ""
+msgstr "Lewa"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Right View."
-msgstr ""
+msgstr "Widok z prawej."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Right"
-msgstr ""
+msgstr "Prawa"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Keying is disabled (no key inserted)."
@@ -4571,38 +4945,108 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Align with view"
+msgid "Freelook Left"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Freelook Right"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Dalej"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "Wstecz"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Kółko myszy w dół."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Odśwież Zmiany"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Odśwież Zmiany"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "Odśwież Zmiany"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+#, fuzzy
+msgid "Vertices"
+msgstr "Wierzchołek"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align with view"
+msgstr "Wyrównaj z widokiem"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Normal"
+msgstr "Widok normalny"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Wireframe"
+msgstr "Widok siatki"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Widok bezcieniowy"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Environment"
+msgstr "Åšrodowisko"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Uchwyty"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "Audio Listener"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "Okno dialogowe XForm"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
msgstr "Tryb Przesuwania (W)"
@@ -4612,35 +5056,35 @@ msgstr "Tryb Rotacji (E)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scale Mode (R)"
-msgstr ""
+msgstr "Tryb skalowania (R)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom View"
-msgstr ""
+msgstr "Widok z dołu"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Top View"
-msgstr ""
+msgstr "Widok z góry"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rear View"
-msgstr ""
+msgstr "Widok z tyłu"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Front View"
-msgstr ""
+msgstr "Widok z przodu"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Left View"
-msgstr ""
+msgstr "Widok z lewej"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Right View"
-msgstr ""
+msgstr "Widok z prawej"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Switch Perspective/Orthogonal view"
-msgstr ""
+msgstr "Przełącz widok perspektywiczny/ortogonalny"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Insert Animation Key"
@@ -4648,123 +5092,115 @@ msgstr "Wstaw klucz animacji"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Focus Origin"
-msgstr ""
+msgstr "Wycentruj na pozycji poczÄ…tkowej"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Focus Selection"
-msgstr ""
+msgstr "Wycentruj na zaznaczeniu"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align Selection With View"
-msgstr ""
+msgstr "Dopasuj zaznaczenie do widoku"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
-msgstr ""
+#, fuzzy
+msgid "Tool Select"
+msgstr "Zaznacz"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
-msgstr ""
+#, fuzzy
+msgid "Tool Move"
+msgstr "PrzenieÅ›"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
-msgstr ""
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: Obróć"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr ""
+#, fuzzy
+msgid "Tool Scale"
+msgstr "Skala:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform"
+msgstr "Przekształcanie"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "Użyj domyślnie sRGB"
+msgid "Local Coords"
+msgstr "Koordynaty lokalne"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
+msgstr "Okno transformowania.."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
-msgstr ""
+msgstr "1 widok"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "2 Viewports"
-msgstr ""
+msgstr "2 widoki"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "2 Viewports (Alt)"
-msgstr ""
+msgstr "2 widoki (Alt)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "3 Viewports"
-msgstr ""
+msgstr "3 widoki"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "3 Viewports (Alt)"
-msgstr ""
+msgstr "3 widoki (Alt)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "4 Viewports"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr ""
+msgstr "4 widoki"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
-msgstr ""
+msgstr "Pokaż pozycję początkową"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Grid"
-msgstr ""
+msgstr "Pokaż siatkę"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Ustawienia"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
-msgstr ""
+msgstr "Ustawienia przyciÄ…gania"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Translate Snap:"
-msgstr ""
+msgstr "Przekształcenie przyciągania:"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotate Snap (deg.):"
-msgstr ""
+msgstr "Obrót przyciągania (stopnie):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scale Snap (%):"
-msgstr ""
+msgstr "Skala przyciÄ…gania (%):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Viewport Settings"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
+msgstr "Ustawienia widoku"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
-msgstr ""
+msgstr "Pole widzenia w perspektywie (stopnie):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Z-Near:"
-msgstr ""
+msgstr "Widok Z-Blisko:"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Z-Far:"
-msgstr ""
+msgstr "Widok Z-Daleko:"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform Change"
@@ -4780,7 +5216,7 @@ msgstr "Obrót (stopnie):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scale (ratio):"
-msgstr ""
+msgstr "Skala (proporcja):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform Type"
@@ -4796,19 +5232,19 @@ msgstr ""
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "ERROR: Couldn't load frame resource!"
-msgstr ""
+msgstr "Błąd: Nie można załadować zasobu klatki!"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Add Frame"
-msgstr ""
+msgstr "Dodaj klatkÄ™"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Resource clipboard is empty or not a texture!"
-msgstr ""
+msgstr "Schowek zasobów jest pusty lub nie zawiera tekstury!"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Paste Frame"
-msgstr ""
+msgstr "Wklej klatkÄ™"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Add Empty"
@@ -4816,7 +5252,7 @@ msgstr "Dodaj pusty"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Change Animation Loop"
-msgstr ""
+msgstr "Zmień pętle animacji"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Change Animation FPS"
@@ -4836,7 +5272,7 @@ msgstr "Prędkość (FPS):"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Animation Frames"
-msgstr ""
+msgstr "Klatki animacji"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Insert Empty (Before)"
@@ -4848,19 +5284,19 @@ msgstr "Dodaj pusty (później)"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Up"
-msgstr ""
+msgstr "Góra"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Down"
-msgstr ""
+msgstr "Dół"
#: editor/plugins/style_box_editor_plugin.cpp
msgid "StyleBox Preview:"
-msgstr ""
+msgstr "PodglÄ…d StyleBox:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Snap Mode:"
-msgstr ""
+msgstr "Tryb przyciÄ…gania:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "<None>"
@@ -4868,19 +5304,19 @@ msgstr "<żaden>"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Pixel Snap"
-msgstr ""
+msgstr "PrzyciÄ…gaj do pikseli"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Grid Snap"
-msgstr ""
+msgstr "PrzyciÄ…gaj do siatki"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Auto Slice"
-msgstr ""
+msgstr "Tnij automatycznie"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Offset:"
-msgstr ""
+msgstr "Przesunięcie:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Step:"
@@ -4888,7 +5324,7 @@ msgstr "Krok:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Separation:"
-msgstr ""
+msgstr "Separacja:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Texture Region"
@@ -4896,7 +5332,7 @@ msgstr ""
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Texture Region Editor"
-msgstr ""
+msgstr "Edytor regionu tekstury"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Can't save theme to file:"
@@ -4922,11 +5358,11 @@ msgstr "Zapisz motyw"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Add Class Items"
-msgstr ""
+msgstr "Dodaj klasę elementów"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Remove Class Items"
-msgstr ""
+msgstr "Usuń klasę elementów"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Create Empty Template"
@@ -4934,7 +5370,7 @@ msgstr "Utwórz pusty szablon"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Create Empty Editor Template"
-msgstr ""
+msgstr "Utworzyć pusty szablon edytora"
#: editor/plugins/theme_editor_plugin.cpp
msgid "CheckBox Radio1"
@@ -4949,8 +5385,9 @@ msgid "Item"
msgstr "Element"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
msgid "Check Item"
-msgstr ""
+msgstr "Sprawdź element"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Checked Item"
@@ -5007,7 +5444,7 @@ msgstr "Kolor"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Paint TileMap"
-msgstr ""
+msgstr "Maluj TileMap"
#: editor/plugins/tile_map_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Duplicate"
@@ -5015,35 +5452,35 @@ msgstr "Duplikuj"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Erase TileMap"
-msgstr ""
+msgstr "Wyczyść TileMap"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Erase selection"
-msgstr ""
+msgstr "Usuń zaznaczenie"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Find tile"
-msgstr ""
+msgstr "Znajdź tile"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Transpose"
-msgstr ""
+msgstr "Transpozycja"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Mirror X"
-msgstr ""
+msgstr "Odbij X"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Mirror Y"
-msgstr ""
+msgstr "Odbij Y"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Bucket"
-msgstr ""
+msgstr "Wiadro"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Pick Tile"
-msgstr ""
+msgstr "Wybierz tile"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Select"
@@ -5067,7 +5504,7 @@ msgstr "Obróć o 270 stopni"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Could not find tile:"
-msgstr ""
+msgstr "Nie mogłem znaleźć tile:"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Item name or ID:"
@@ -5110,7 +5547,7 @@ msgstr "Usunąć zaznaczone pliki?"
#: editor/project_export.cpp
msgid "Presets"
-msgstr ""
+msgstr "Profile eksportu"
#: editor/project_export.cpp editor/project_settings.cpp
msgid "Add.."
@@ -5127,7 +5564,7 @@ msgstr "Eksportuj wszystkie zasoby w projekcie."
#: editor/project_export.cpp
msgid "Export selected scenes (and dependencies)"
-msgstr ""
+msgstr "Eksportuj wybrane sceny (i zależności)"
#: editor/project_export.cpp
#, fuzzy
@@ -5147,11 +5584,15 @@ msgstr "Zasoby do eksportu:"
msgid ""
"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"
msgstr ""
+"Filtry do eksportowania plików nie będących zasobami (oddzielone "
+"przecinkami, np. *.json, *.txt)"
#: editor/project_export.cpp
msgid ""
"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)"
msgstr ""
+"Filtry do wykluczenia plików z projektu (rozdzielone przecinkami, np. *."
+"json, *.txt)"
#: editor/project_export.cpp
#, fuzzy
@@ -5165,7 +5606,7 @@ msgstr "Ścieżka docelowa:"
#: editor/project_export.cpp
msgid "Export templates for this platform are missing:"
-msgstr ""
+msgstr "Brakuje eksportu szablonów dla tej platformy:"
#: editor/project_export.cpp
#, fuzzy
@@ -5177,12 +5618,14 @@ msgid "Invalid project path, the path must exist!"
msgstr "Niepoprawna ścieżka projektu, ścieżka musi istnieć!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "Niepoprawna ścieżka projektu, godot.cfg nie może istnieć."
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Niepoprawna ścieżka projektu, engine.cfg nie może istnieć."
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr "Niepoprawna ścieżka projektu, godot.cfg musi istnieć."
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "Niepoprawna ścieżka projektu, engine.cfg musi istnieć."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5193,12 +5636,13 @@ msgid "Invalid project path (changed anything?)."
msgstr "Niepoprawna ścieżka projektu (zmienić cokolwiek?)."
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
-msgstr "Nie można było utworzyć godot.cfg w ścieżce projektu."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "Nie można było utworzyć engine.cfg w ścieżce projektu."
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
-msgstr ""
+msgstr "Nie powiodło się wypakowanie z pakietu następujących plików:"
#: editor/project_manager.cpp
msgid "Package Installed Successfully!"
@@ -5229,10 +5673,6 @@ msgid "Install Project:"
msgstr "Zainstaluj projekt:"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "Instaluj"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "Szukaj"
@@ -5242,7 +5682,7 @@ msgstr "Nowy projekt gry"
#: editor/project_manager.cpp
msgid "That's a BINGO!"
-msgstr ""
+msgstr "To BINGO!"
#: editor/project_manager.cpp
msgid "Unnamed Project"
@@ -5258,13 +5698,15 @@ msgstr "Czy jesteś pewny że chcesz uruchomić więcej niż jeden projekt?"
#: editor/project_manager.cpp
msgid "Remove project from the list? (Folder contents will not be modified)"
-msgstr ""
+msgstr "Usunąć projekt z listy? (Zawartość folderu nie zostanie zmodyfikowana)"
#: editor/project_manager.cpp
msgid ""
"You are about the scan %s folders for existing Godot projects. Do you "
"confirm?"
msgstr ""
+"Masz zamiar przeskanować %s folderów w poszukiwaniu projektów Godot. "
+"Potwierdzasz?"
#: editor/project_manager.cpp
msgid "Project Manager"
@@ -5291,6 +5733,11 @@ msgid "New Project"
msgstr "Nowy projekt"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Usuń element"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "Wyjdź"
@@ -5320,11 +5767,11 @@ msgstr "Akcja %s już istnieje!"
#: editor/project_settings.cpp
msgid "Rename Input Action Event"
-msgstr ""
+msgstr "Zmień nazwę zdarzenia akcji wejścia"
#: editor/project_settings.cpp
msgid "Add Input Action Event"
-msgstr ""
+msgstr "Dodaj zdarzenie akcji wejścia"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
#: scene/gui/input_action.cpp
@@ -5343,7 +5790,7 @@ msgstr "Alt+"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "Control+"
-msgstr ""
+msgstr "Control+"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "Press a Key.."
@@ -5351,7 +5798,7 @@ msgstr "Naciśnij klawisz.."
#: editor/project_settings.cpp
msgid "Mouse Button Index:"
-msgstr ""
+msgstr "Indeks przycisku myszy:"
#: editor/project_settings.cpp
msgid "Left Button"
@@ -5367,11 +5814,11 @@ msgstr "Åšrodkowy guzik"
#: editor/project_settings.cpp
msgid "Wheel Up Button"
-msgstr ""
+msgstr "Kółko myszy w górę"
#: editor/project_settings.cpp
msgid "Wheel Down Button"
-msgstr ""
+msgstr "Kółko myszy w dół"
#: editor/project_settings.cpp
msgid "Button 6"
@@ -5405,11 +5852,16 @@ msgstr "Przycisk joysticka"
#: editor/project_settings.cpp
msgid "Add Input Action"
-msgstr ""
+msgstr "Dodawanie akcji Wejścia"
#: editor/project_settings.cpp
msgid "Erase Input Action Event"
-msgstr ""
+msgstr "Wyczyść zdarzenie akcji wejścia"
+
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "Dodaj pusty"
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
@@ -5449,15 +5901,15 @@ msgstr "Ustawienia zapisane pomyślnie."
#: editor/project_settings.cpp
msgid "Add Translation"
-msgstr ""
+msgstr "Dodaj tłumaczenie"
#: editor/project_settings.cpp
msgid "Remove Translation"
-msgstr ""
+msgstr "Usuń tłumaczenie"
#: editor/project_settings.cpp
msgid "Add Remapped Path"
-msgstr ""
+msgstr "Dodaj zmapowaną ścieżkę"
#: editor/project_settings.cpp
msgid "Resource Remap Add Remap"
@@ -5465,19 +5917,20 @@ msgstr ""
#: editor/project_settings.cpp
msgid "Change Resource Remap Language"
-msgstr ""
+msgstr "Zmień język mapowania zasobu"
#: editor/project_settings.cpp
msgid "Remove Resource Remap"
-msgstr ""
+msgstr "Usuń mapowanie zasobu"
#: editor/project_settings.cpp
msgid "Remove Resource Remap Option"
-msgstr ""
+msgstr "Usuń opcję mapowania zasobu"
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr "Ustawienia projektu (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Ustawienia projektu (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5497,7 +5950,7 @@ msgstr "Kopiuj na platformÄ™..."
#: editor/project_settings.cpp
msgid "Input Map"
-msgstr ""
+msgstr "Mapowanie wejścia"
#: editor/project_settings.cpp
msgid "Action:"
@@ -5525,7 +5978,7 @@ msgstr "Tłumaczenia:"
#: editor/project_settings.cpp
msgid "Remaps"
-msgstr ""
+msgstr "Mapowanie zasobów"
#: editor/project_settings.cpp
msgid "Resources:"
@@ -5533,23 +5986,20 @@ msgstr "Zasoby:"
#: editor/project_settings.cpp
msgid "Remaps by Locale:"
-msgstr ""
+msgstr "Mapowanie w zależności od lokalizacji:"
#: editor/project_settings.cpp
msgid "Locale"
-msgstr ""
+msgstr "Lokalizacja"
#: editor/project_settings.cpp
+#, fuzzy
msgid "AutoLoad"
-msgstr ""
-
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "Wtyczki"
+msgstr "Autoładowanie"
#: editor/property_editor.cpp
msgid "Pick a Viewport"
-msgstr ""
+msgstr "Wybierz Viewport"
#: editor/property_editor.cpp
msgid "Ease In"
@@ -5581,12 +6031,11 @@ msgstr "Katalog.."
#: editor/property_editor.cpp
msgid "Assign"
-msgstr ""
+msgstr "Przypisz"
#: editor/property_editor.cpp
-#, fuzzy
msgid "New Script"
-msgstr "Następny skrypt"
+msgstr "Nowy skrypt"
#: editor/property_editor.cpp
#, fuzzy
@@ -5598,10 +6047,6 @@ msgid "Error loading file: Not a resource!"
msgstr "Błąd wczytania pliku: Brak zasobu!"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "Nie można wczytać obrazu"
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "Wybierz węzeł"
@@ -5612,7 +6057,7 @@ msgstr ""
#: editor/property_editor.cpp
msgid "On"
-msgstr ""
+msgstr "Włącz"
#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
msgid "Set"
@@ -5624,7 +6069,7 @@ msgstr "Właściwości:"
#: editor/property_editor.cpp
msgid "Sections:"
-msgstr ""
+msgstr "Kategorie:"
#: editor/property_selector.cpp
#, fuzzy
@@ -5638,23 +6083,24 @@ msgstr "Tryb zaznaczenia"
#: editor/pvrtc_compress.cpp
msgid "Could not execute PVRTC tool:"
-msgstr ""
+msgstr "Nie można wykonać narzędzia PVRTC:"
#: editor/pvrtc_compress.cpp
msgid "Can't load back converted image using PVRTC tool:"
msgstr ""
+"Nie można załadować przekonwertowanego obrazka używając narzędzia PVRTC:"
#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
msgid "Reparent Node"
-msgstr ""
+msgstr "Zmień nadrzędny węzeł"
#: editor/reparent_dialog.cpp
msgid "Reparent Location (Select new Parent):"
-msgstr ""
+msgstr "Wybierz nowego rodzica dla węzła:"
#: editor/reparent_dialog.cpp
msgid "Keep Global Transform"
-msgstr ""
+msgstr "Zachowaj globalnÄ… transformacjÄ™"
#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
msgid "Reparent"
@@ -5677,12 +6123,13 @@ msgid "Resource Tools"
msgstr "Narzędzia zasobów"
#: editor/resources_dock.cpp
+#, fuzzy
msgid "Make Local"
-msgstr ""
+msgstr "Uczyń lokalnym"
#: editor/run_settings_dialog.cpp
msgid "Run Mode:"
-msgstr ""
+msgstr "Tryb uruchamiania:"
#: editor/run_settings_dialog.cpp
msgid "Current Scene"
@@ -5702,7 +6149,7 @@ msgstr "Ustawienia uruchomienia sceny"
#: editor/scene_tree_dock.cpp
msgid "No parent to instance the scenes at."
-msgstr ""
+msgstr "Brak elementu nadrzędnego do stworzenia instancji sceny."
#: editor/scene_tree_dock.cpp
msgid "Error loading scene from %s"
@@ -5769,7 +6216,7 @@ msgstr ""
#: editor/scene_tree_dock.cpp
msgid "Can't operate on nodes the current scene inherits from!"
-msgstr ""
+msgstr "Nie można działać na węzłach z których dziedziczy obecna scena!"
#: editor/scene_tree_dock.cpp
msgid "Remove Node(s)"
@@ -5793,6 +6240,11 @@ msgid "Error duplicating scene to save it."
msgstr "Błąd duplikowania sceny przy zapisywaniu."
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Zasoby:"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "Edytuj grupy"
@@ -5805,12 +6257,13 @@ msgid "Delete Node(s)"
msgstr "Usuń węzeł (węzły)"
#: editor/scene_tree_dock.cpp
+#, fuzzy
msgid "Add Child Node"
-msgstr "Dodaj dziecko węzła"
+msgstr "Dodaj węzeł"
#: editor/scene_tree_dock.cpp
msgid "Instance Child Scene"
-msgstr "Instancjonuj dziecko sceny"
+msgstr "Dodaj instancje sceny"
#: editor/scene_tree_dock.cpp
msgid "Change Type"
@@ -5822,9 +6275,8 @@ msgid "Attach Script"
msgstr "Dodaj skrypt"
#: editor/scene_tree_dock.cpp
-#, fuzzy
msgid "Clear Script"
-msgstr "Utwórz Skrypt"
+msgstr "Usuń skrypt"
#: editor/scene_tree_dock.cpp
msgid "Merge From Scene"
@@ -5852,6 +6304,8 @@ msgid ""
"Instance a scene file as a Node. Creates an inherited scene if no root node "
"exists."
msgstr ""
+"Stwórz instancję sceny jako węzeł. Tworzy dziedziczącą scenę jeśli węzeł "
+"główny nie istnieje."
#: editor/scene_tree_dock.cpp
#, fuzzy
@@ -5872,10 +6326,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "Przełącz widoczność CanvasItem"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Opcje debugowania"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "Instancja:"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Następny skrypt"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Przełącz widoczność Spatial"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr "Nieprawidłowa nazwa węzła, następujące znaki są niedozwolone:"
@@ -5893,7 +6396,7 @@ msgstr "Edytowalne dzieci"
#: editor/scene_tree_editor.cpp
msgid "Load As Placeholder"
-msgstr "Załaduj jako zastępczy"
+msgstr "Wczytaj jako zastępczy"
#: editor/scene_tree_editor.cpp
#, fuzzy
@@ -5921,78 +6424,94 @@ msgid "Select a Node"
msgstr "Wybierz węzeł"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "Nieprawidłowa nazwa klasy bazowej"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Nie można było utworzyć skryptu w systemie plików."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "Poprawne znaki:"
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "Błąd przy ładowaniu sceny z %s"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "Niepoprawna nazwa klasy"
+msgid "Path is empty"
+msgstr "Ścieżka jest pusta"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "Poprawna nazwa"
+msgid "Path is not local"
+msgstr "Ścieżka nie jest lokalna"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "N/A"
+msgid "Invalid base path"
+msgstr "Niepoprawna ścieżka bazowa"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "Nazwa klasy jest niepoprawna!"
+msgid "Invalid extension"
+msgstr "Niepoprawne rozszerzenie"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "Nazwa klasy nadrzędnej jest niepoprawna!"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "Niepoprawna ścieżka!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Niewłaściwa ścieżka."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "Nie można było utworzyć skryptu w systemie plików."
+msgid "Invalid class name"
+msgstr "Niepoprawna nazwa klasy"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Error loading script from %s"
-msgstr "Błąd przy ładowaniu sceny z %s"
+msgid "Invalid inherited parent name or path"
+msgstr "Nieprawidłowa nazwa klasy bazowej"
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "Ścieżka jest pusta"
+#, fuzzy
+msgid "Script valid"
+msgstr "Skrypt"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "Ścieżka nie jest lokalna"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "Niepoprawna ścieżka bazowa"
+msgid "N/A"
+msgstr "N/A"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "Niepoprawne rozszerzenie"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "Utwórz Skrypt"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr "Następny skrypt"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "Dziedziczy:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "Nazwa klasy:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Usuń element"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "Wbudowany skrypt"
#: editor/script_create_dialog.cpp
@@ -6130,7 +6649,7 @@ msgstr "Skróty"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Light Radius"
-msgstr "Zmień promień światła"
+msgstr "Zmień promień światła"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Camera FOV"
@@ -6158,13 +6677,17 @@ msgstr "Zmień wysokośc Capsule Shape"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Ray Shape Length"
-msgstr "Zmień długość Ray Shape"
+msgstr "Zmień długość Ray Shape"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
#, fuzzy
msgid "Change Probe Extents"
msgstr "Zmień rozmiar Box Shape"
@@ -6498,6 +7021,30 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Run in Browser"
+msgstr "Szukaj"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "Nie można utworzyć katalogu."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "Nie można utworzyć katalogu."
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "Nie można utworzyć katalogu."
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6542,9 +7089,8 @@ msgid "Invalid publisher GUID."
msgstr "Niepoprawna ścieżka bazowa"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid "Invalid background color."
-msgstr "Nie rozpoznano typu czcionki."
+msgstr "Kolor tła nieprawidłowy."
#: platform/uwp/export/export.cpp
msgid "Invalid Store Logo image dimensions (should be 50x50)."
@@ -6573,6 +7119,7 @@ msgstr ""
#: platform/uwp/export/export.cpp
msgid "Invalid splash screen image dimensions (should be 620x300)."
msgstr ""
+"Nieprawidłowe wymiary obrazka ekranu powitalnego (powinno być 620x300)."
#: scene/2d/animated_sprite.cpp
msgid ""
@@ -6631,12 +7178,10 @@ msgstr ""
"Tekstura z kształtem promieni światła musi być dodana do pola Tekstura."
#: scene/2d/light_occluder_2d.cpp
-#, fuzzy
msgid ""
"An occluder polygon must be set (or drawn) for this occluder to take effect."
msgstr ""
-"Poligon zasłaniający musi być ustawiony (lub narysowany) aby Occluder "
-"zadziałał."
+"Occluder polygon musi być ustawiony (lub narysowany) aby Occluder zadziałał."
#: scene/2d/light_occluder_2d.cpp
msgid "The occluder polygon for this occluder is empty. Please draw a polygon!"
@@ -6665,10 +7210,11 @@ msgstr ""
"Węzeł typu ParallaxLayer zadziała, jeśli będzie dzieckiem węzła "
"ParallaxBackground."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"Żeby zadziałało, pole Path musi wskazywać na istniejący węzeł Particles2D."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6749,6 +7295,11 @@ msgstr ""
"NavigationMeshInstance musi być dzieckiem lub wnukiem węzła typu Navigation. "
"Udostępnia on tylko dane nawigacyjne."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6770,6 +7321,15 @@ msgstr ""
"Zasób SpriteFrames musi być ustawiony jako wartość właściwości 'Frames' żeby "
"AnimatedSprite3D wyświetlał klatki."
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "Tryb uruchamiania:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Alarm!"
@@ -6814,6 +7374,16 @@ msgid ""
"Use a container as child (VBox,HBox,etc), or a Control and set the custom "
"minimum size manually."
msgstr ""
+"ScrollContainer jest zaprojektowany do działania z jednym dzieckiem klasy "
+"Control.\n"
+"Użyj kontenera jako dziecko (VBox,HBox,etc), lub węzła klasy Control i ustaw "
+"ręcznie minimalny rozmiar."
+
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
#: scene/main/viewport.cpp
msgid ""
@@ -6827,6 +7397,71 @@ msgstr ""
"otrzymał jakiś rozmiar. W przeciwnym wypadku ustawi opcję RenderTarget i "
"przyporządkuj jego teksturę dla któregoś węzła."
+#~ msgid "Node From Scene"
+#~ msgstr "Węzeł ze Sceny"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Importuj zasoby do projektu."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Eksportuj projekt na inne platformy."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "Powiadomienie o zmianie stanu zasobu zewnętrznego."
+
+#~ msgid "Tutorials"
+#~ msgstr "Poradniki"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "Otwórz https://godotengine.org na sekcji poradników."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "Nie wybrano sceny do instancjonowania!"
+
+#, fuzzy
+#~ msgid "Instance at Cursor"
+#~ msgstr "Instancja w miejscu kursora"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "Nie można stworzyć instancji sceny!"
+
+#~ msgid "Use Default Light"
+#~ msgstr "Użyj domyślnego światła"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "Użyj domyślnie sRGB"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "Kolor światła otoczenia:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "Nie można wczytać obrazu"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "Nieprawidłowa nazwa klasy bazowej"
+
+#~ msgid "Valid chars:"
+#~ msgstr "Poprawne znaki:"
+
+#~ msgid "Valid name"
+#~ msgstr "Poprawna nazwa"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "Nazwa klasy jest niepoprawna!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "Nazwa klasy nadrzędnej jest niepoprawna!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "Niepoprawna ścieżka!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Żeby zadziałało, pole Path musi wskazywać na istniejący węzeł Particles2D."
+
+#~ msgid "Surface"
+#~ msgstr "Powierzchnia"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
@@ -6968,9 +7603,6 @@ msgstr ""
#~ msgid "Trim"
#~ msgstr "Przytnij"
-#~ msgid "Script"
-#~ msgstr "Skrypt"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Tryb eksportu skryptów:"
@@ -7001,9 +7633,6 @@ msgstr ""
#~ msgid "Export Preset:"
#~ msgstr "Szablon eksportu:"
-#~ msgid "Vertex"
-#~ msgstr "Wierzchołek"
-
#~ msgid "Global"
#~ msgstr "Globalne"
@@ -7029,6 +7658,3 @@ msgstr ""
#~ msgid "Cannot go into subdir:"
#~ msgstr "Nie można iść do podkatalogu:"
-
-#~ msgid "Help"
-#~ msgstr "Pomoc"
diff --git a/editor/translations/pr.po b/editor/translations/pr.po
index 0b8ecb0bda..905c263061 100644
--- a/editor/translations/pr.po
+++ b/editor/translations/pr.po
@@ -2,12 +2,12 @@
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
-# Zion Nimchuk <zionnimchuk@gmail.com>, 2016.
+# Zion Nimchuk <zionnimchuk@gmail.com>, 2016-2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2016-11-14 19:48+0000\n"
+"PO-Revision-Date: 2017-03-24 19:48+0000\n"
"Last-Translator: Zion Nimchuk <zionnimchuk@gmail.com>\n"
"Language-Team: Pirate <https://hosted.weblate.org/projects/godot-engine/"
"godot/pr/>\n"
@@ -15,7 +15,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.10-dev\n"
+"X-Generator: Weblate 2.12\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -355,6 +355,174 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "View Files"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Close"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connecting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Error making request"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -362,6 +530,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -375,10 +567,6 @@ msgid "Category:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr ""
@@ -390,7 +578,7 @@ msgstr ""
msgid "Official"
msgstr ""
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr ""
@@ -408,21 +596,7 @@ msgstr ""
#: editor/call_dialog.cpp modules/visual_script/visual_script_editor.cpp
msgid "Call"
-msgstr ""
-
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr ""
+msgstr "Call"
#: editor/call_dialog.cpp
msgid "Method List:"
@@ -473,13 +647,6 @@ msgid "Selection Only"
msgstr ""
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr ""
@@ -554,6 +721,7 @@ msgstr ""
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr ""
@@ -629,11 +797,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -664,6 +827,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -764,8 +928,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -775,6 +938,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -843,8 +1007,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr ""
@@ -910,7 +1073,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1035,7 +1198,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1052,7 +1216,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1066,7 +1229,7 @@ msgstr ""
#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
msgid "Members:"
-msgstr ""
+msgstr "th' Members:"
#: editor/editor_help.cpp
msgid "Public Methods:"
@@ -1107,10 +1270,6 @@ msgstr ""
msgid "Clear"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1226,8 +1385,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1281,6 +1440,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1337,7 +1500,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1375,6 +1538,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1427,7 +1594,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1455,50 +1622,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1506,47 +1646,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1617,9 +1725,10 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr ""
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Edit"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1638,11 +1747,67 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1726,6 +1891,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1753,12 +1926,32 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+msgid "Open 2D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 3D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -1920,8 +2113,9 @@ msgid "No version.txt found inside templates."
msgstr ""
#: editor/export_template_manager.cpp
+#, fuzzy
msgid "Error creating path for templates:\n"
-msgstr ""
+msgstr "Blimey! I can't make th' signature object!"
#: editor/export_template_manager.cpp
msgid "Extracting Export Templates"
@@ -2001,6 +2195,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2029,10 +2227,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2198,7 +2392,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2673,7 +2867,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3190,7 +3384,7 @@ msgstr ""
#: editor/plugins/shader_editor_plugin.cpp editor/project_manager.cpp
#: modules/visual_script/visual_script_editor.cpp
msgid "Edit"
-msgstr ""
+msgstr "Edit"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
@@ -3333,7 +3527,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr ""
@@ -3382,15 +3576,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3421,6 +3606,33 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Add Signal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Discharge ye' Signal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3690,6 +3902,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3702,7 +3927,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3713,6 +3938,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3722,6 +3964,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3734,11 +3980,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3750,26 +3996,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3824,6 +4086,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Discharge ye' Function"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3977,6 +4248,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4064,10 +4339,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4101,15 +4372,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4164,6 +4427,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4214,13 +4493,21 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
#: editor/plugins/script_text_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
msgid "Toggle Breakpoint"
-msgstr ""
+msgstr "Toggle ye Breakpoint"
#: editor/plugins/script_text_editor.cpp
msgid "Remove All Breakpoints"
@@ -4235,6 +4522,14 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4257,6 +4552,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4474,35 +4773,96 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Change"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4562,23 +4922,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "Yar, Blow th' Selected Down!"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Local Coords"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4606,27 +4975,15 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4650,14 +5007,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5070,11 +5419,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5086,7 +5435,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5122,10 +5471,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5184,6 +5529,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Discharge ye' Variable"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5302,6 +5652,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr ""
@@ -5367,7 +5721,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5434,10 +5788,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5487,12 +5837,9 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
+#, fuzzy
msgid "Pick a Node"
-msgstr ""
+msgstr "Paste yer Node"
#: editor/property_editor.cpp
msgid "Bit %d, val %d."
@@ -5504,7 +5851,7 @@ msgstr ""
#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
msgid "Set"
-msgstr ""
+msgstr "Set"
#: editor/property_editor.cpp
msgid "Properties:"
@@ -5675,6 +6022,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5715,8 +6066,9 @@ msgid "Save Branch as Scene"
msgstr ""
#: editor/scene_tree_dock.cpp
+#, fuzzy
msgid "Copy Node Path"
-msgstr ""
+msgstr "Forge yer Node!"
#: editor/scene_tree_dock.cpp
msgid "Delete (No Confirm)"
@@ -5749,10 +6101,56 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Open script"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5797,75 +6195,86 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
+msgid "Error - Could not create script in filesystem."
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
+msgid "Error loading script from %s"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr ""
+#, fuzzy
+msgid "Invalid Path"
+msgstr ": Evil arguments: "
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "Yer index property name be thrown overboard!"
+
+#: editor/script_create_dialog.cpp
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Create new script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Class Name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Discharge ye' Variable"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6037,6 +6446,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6197,251 +6610,277 @@ msgstr "Add Node"
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature."
msgstr ""
-"Smash yer Meta t' sink yer Getter. Smash yer Shift t' sink a generic "
+"Smash yer Meta key t' sink yer Getter. Smash yer Shift t' sink a generic "
"signature."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature."
msgstr ""
-"Smash yer Ctrl t' sink yer Getter. Smash yer Shift t' sink a generic "
+"Smash yer Ctrl key t' sink yer Getter. Smash yer Shift t' sink a generic "
"signature."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a simple reference to the node."
-msgstr ""
+msgstr "Smash yer Meta key t' sink a naked reference t' th' node."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Ctrl to drop a simple reference to the node."
-msgstr ""
+msgstr "Smash yer Ctrl key t' sink a naked reference t' th' node."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a Variable Setter."
-msgstr ""
+msgstr "Smash yer Meta key t' sink a Variable Setter."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Ctrl to drop a Variable Setter."
-msgstr ""
+msgstr "Smash yer Ctrl key t' sink a Variable Setter."
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Preload Node"
-msgstr ""
+msgstr "Add yer Preload Node"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Node(s) From Tree"
-msgstr ""
+msgstr "Add Node(s) From yer Tree"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Getter Property"
-msgstr ""
+msgstr "Add yer Getter Property"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Setter Property"
-msgstr ""
+msgstr "Add yer Setter Property"
#: modules/visual_script/visual_script_editor.cpp
msgid "Condition"
-msgstr ""
+msgstr "Condition"
#: modules/visual_script/visual_script_editor.cpp
msgid "Sequence"
-msgstr ""
+msgstr "Sequence"
#: modules/visual_script/visual_script_editor.cpp
msgid "Switch"
-msgstr ""
+msgstr "Switch"
#: modules/visual_script/visual_script_editor.cpp
msgid "Iterator"
-msgstr ""
+msgstr "Iterator"
#: modules/visual_script/visual_script_editor.cpp
msgid "While"
-msgstr ""
+msgstr "While"
#: modules/visual_script/visual_script_editor.cpp
msgid "Return"
-msgstr ""
+msgstr "Return"
#: modules/visual_script/visual_script_editor.cpp
msgid "Get"
-msgstr ""
+msgstr "Get"
#: modules/visual_script/visual_script_editor.cpp
msgid "Base Type:"
-msgstr ""
+msgstr "th' Base Type:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Available Nodes:"
-msgstr ""
+msgstr "yer Nodes doing nothin':"
#: modules/visual_script/visual_script_editor.cpp
msgid "Select or create a function to edit graph"
-msgstr ""
+msgstr "Grab or make yer function t' edit ye graph"
#: modules/visual_script/visual_script_editor.cpp
msgid "Edit Signal Arguments:"
-msgstr ""
+msgstr "Edit ye Signal Arguments:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Edit Variable:"
-msgstr ""
+msgstr "Edit yer Variable:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Change"
-msgstr ""
+msgstr "Change"
#: modules/visual_script/visual_script_editor.cpp
msgid "Delete Selected"
-msgstr ""
+msgstr "Yar, Blow th' Selected Down!"
#: modules/visual_script/visual_script_editor.cpp
msgid "Find Node Type"
-msgstr ""
+msgstr "Find ye Node Type"
#: modules/visual_script/visual_script_editor.cpp
msgid "Copy Nodes"
-msgstr ""
+msgstr "Forge yer Node!"
#: modules/visual_script/visual_script_editor.cpp
msgid "Cut Nodes"
-msgstr ""
+msgstr "Slit th' Node"
#: modules/visual_script/visual_script_editor.cpp
msgid "Paste Nodes"
-msgstr ""
+msgstr "Paste yer Node"
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Input type not iterable: "
-msgstr ""
+msgstr "Yar! Yer input aint iterable: "
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Iterator became invalid"
-msgstr ""
+msgstr "Yer Iterator be no good"
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Iterator became invalid: "
-msgstr ""
+msgstr "Yer Iterator be no good: "
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Invalid index property name."
-msgstr ""
+msgstr "Yer index property name be thrown overboard!"
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Base object is not a Node!"
-msgstr ""
+msgstr "Yer Base object aint' a Node!"
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Path does not lead Node!"
-msgstr ""
+msgstr "There be no Node at ye path's end!"
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Invalid index property name '%s' in node %s."
-msgstr ""
+msgstr "Yer index property name '%s' in node %s be walkin' th' plank!"
#: modules/visual_script/visual_script_nodes.cpp
msgid ": Invalid argument of type: "
-msgstr ""
+msgstr ": Evil argument of th' type: "
#: modules/visual_script/visual_script_nodes.cpp
msgid ": Invalid arguments: "
-msgstr ""
+msgstr ": Evil arguments: "
#: modules/visual_script/visual_script_nodes.cpp
msgid "VariableGet not found in script: "
-msgstr ""
+msgstr "VariableGet be in davy jones locker! Not in th' script: "
#: modules/visual_script/visual_script_nodes.cpp
msgid "VariableSet not found in script: "
-msgstr ""
+msgstr "VariableSet be in davy jones locker! Not in th' script: "
#: modules/visual_script/visual_script_nodes.cpp
msgid "Custom node has no _step() method, can't process graph."
-msgstr ""
+msgstr "Yer fancy node got no _step() method, we can't get th' graph."
#: modules/visual_script/visual_script_nodes.cpp
msgid ""
"Invalid return value from _step(), must be integer (seq out), or string "
"(error)."
msgstr ""
+"Yer return value from _step() be no good! She must be th' integer (seq out) "
+"or th' string (error)."
#: modules/visual_script/visual_script_nodes.cpp
msgid "just pressed"
-msgstr ""
+msgstr "just smashed"
#: modules/visual_script/visual_script_nodes.cpp
msgid "just released"
+msgstr "just released"
+
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
msgstr ""
#: platform/uwp/export/export.cpp
+#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr ""
+"Blimey! I can't read th' certificate file! Are yer path n' password trusty?"
#: platform/uwp/export/export.cpp
msgid "Error creating the signature object."
-msgstr ""
+msgstr "Blimey! I can't make th' signature object!"
#: platform/uwp/export/export.cpp
msgid "Error creating the package signature."
-msgstr ""
+msgstr "Blimey! I can't create th' package signature."
#: platform/uwp/export/export.cpp
msgid ""
"No export templates found.\n"
"Download and install export templates."
msgstr ""
+"Ye got no export templates!\n"
+"Download and install yer export templates."
#: platform/uwp/export/export.cpp
msgid "Custom debug package not found."
-msgstr ""
+msgstr "Yer fancy debug package be nowhere."
#: platform/uwp/export/export.cpp
msgid "Custom release package not found."
-msgstr ""
+msgstr "Yer fancy release package be nowhere."
#: platform/uwp/export/export.cpp
msgid "Invalid unique name."
-msgstr ""
+msgstr "Yer unique name be evil."
#: platform/uwp/export/export.cpp
msgid "Invalid product GUID."
-msgstr ""
+msgstr "Yer product GUID be evil."
#: platform/uwp/export/export.cpp
msgid "Invalid publisher GUID."
-msgstr ""
+msgstr "Yer publisher GUID be evil! Walk th' plank!"
#: platform/uwp/export/export.cpp
msgid "Invalid background color."
-msgstr ""
+msgstr "Yer background color be evil!"
#: platform/uwp/export/export.cpp
msgid "Invalid Store Logo image dimensions (should be 50x50)."
-msgstr ""
+msgstr "Yer Store Logo got th' wrong dimensions! She should be 50x50 I reckon."
#: platform/uwp/export/export.cpp
msgid "Invalid square 44x44 logo image dimensions (should be 44x44)."
-msgstr ""
+msgstr "Yer square 44x44 logo image dimensions aint' 44x44!"
#: platform/uwp/export/export.cpp
msgid "Invalid square 71x71 logo image dimensions (should be 71x71)."
-msgstr ""
+msgstr "Yer square 71x71 logo image dimensions aint' 71x71!"
#: platform/uwp/export/export.cpp
msgid "Invalid square 150x150 logo image dimensions (should be 150x150)."
-msgstr ""
+msgstr "Yer square 150x150 logo image dimensions aint' 150x150!"
#: platform/uwp/export/export.cpp
msgid "Invalid square 310x310 logo image dimensions (should be 310x310)."
-msgstr ""
+msgstr "Yer square 310x310 logo image dimensions aint' 310x310!"
#: platform/uwp/export/export.cpp
msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)."
-msgstr ""
+msgstr "Yer wide 310x150 logo image dimensions aint' 310x150!"
#: platform/uwp/export/export.cpp
msgid "Invalid splash screen image dimensions (should be 620x300)."
-msgstr ""
+msgstr "Yer splash screen image dimensions aint' 620x300!"
#: scene/2d/animated_sprite.cpp
msgid ""
@@ -6511,8 +6950,10 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
#: scene/2d/path_2d.cpp
@@ -6575,6 +7016,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6590,6 +7036,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr ""
@@ -6632,6 +7086,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
diff --git a/editor/translations/pt_BR.po b/editor/translations/pt_BR.po
index abb688da42..b812b6f8ef 100644
--- a/editor/translations/pt_BR.po
+++ b/editor/translations/pt_BR.po
@@ -2,17 +2,19 @@
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
+# Allyson Souza <allyson_as@outlook.com>, 2017.
# António Sarmento <antonio.luis.sarmento@gmail.com>, 2016.
# George Marques <george@gmarqu.es>, 2016.
# Joaquim Ferreira <joaquimferreira1996@bol.com.br>, 2016.
+# jonathan railarem <railarem@gmail.com>, 2017.
# Mailson Silva Marins <mailsons335@gmail.com>, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: 2016-05-30\n"
-"PO-Revision-Date: 2016-09-02 21:07+0000\n"
-"Last-Translator: Mailson Silva Marins <mailsons335@gmail.com>\n"
+"PO-Revision-Date: 2017-03-27 19:34+0000\n"
+"Last-Translator: jonathan railarem <railarem@gmail.com>\n"
"Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/"
"godot-engine/godot/pt_BR/>\n"
"Language: pt_BR\n"
@@ -20,7 +22,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
-"X-Generator: Weblate 2.8\n"
+"X-Generator: Weblate 2.13-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -361,6 +363,184 @@ msgstr "Alterar Tipo de Valor do Vetor"
msgid "Change Array Value"
msgstr "Alterar Valor do Vetor"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "Versão:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Constantes:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Arquivo"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Descrição:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "Instalar"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Fechar"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "Conectar..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Conectar ao Nó:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "Formato de arquivo requisitado desconhecido:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Salvando..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "Conectar..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Em teste"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Erro ao salvar Recurso!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Abaixo"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Todos"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -368,6 +548,30 @@ msgstr "Alterar Valor do Vetor"
msgid "Search:"
msgstr "Pesquisar:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Pesquisar"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "Importar"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "Plugins"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Ordenar:"
@@ -381,10 +585,6 @@ msgid "Category:"
msgstr "Categoria:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Todos"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Site:"
@@ -396,7 +596,7 @@ msgstr "Suportado..."
msgid "Official"
msgstr "Oficial"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Comunidade"
@@ -416,20 +616,6 @@ msgstr "Lista de Métodos para \"%s\":"
msgid "Call"
msgstr "Chamar"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Fechar"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Lista de Métodos:"
@@ -480,13 +666,6 @@ msgid "Selection Only"
msgstr "Apenas na Seleção"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Pesquisar"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Localizar"
@@ -561,6 +740,7 @@ msgstr "Adicionar"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Remover"
@@ -636,11 +816,6 @@ msgstr "Recente:"
msgid "Matches:"
msgstr "Combinações:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "Descrição:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Buscar Substituição Para:"
@@ -675,6 +850,7 @@ msgstr "Recurso"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Caminho"
@@ -779,8 +955,7 @@ msgstr ""
msgid "Add Bus"
msgstr "Adicionar Todos"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "Carregar"
@@ -790,6 +965,7 @@ msgid "Save As"
msgstr "Salvar Como"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Padrão"
@@ -861,8 +1037,7 @@ msgid "Rearrange Autoloads"
msgstr "Reordenar Autoloads"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Caminho:"
@@ -928,7 +1103,7 @@ msgstr "Armazenando Arquivo:"
msgid "Packing"
msgstr "Empacotando"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1054,7 +1229,8 @@ msgstr "BuscarFontes"
msgid "(Re)Importing Assets"
msgstr "Re-Importando"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "Pesquisar Ajuda"
@@ -1071,7 +1247,6 @@ msgid "Class:"
msgstr "Classe:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "Herda de:"
@@ -1127,10 +1302,6 @@ msgstr " Saída:"
msgid "Clear"
msgstr "Limpar"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Nó a Partir de Cena"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1246,10 +1417,11 @@ msgid "There is no defined scene to run."
msgstr "Não há cena definida para rodar."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"A cena principal não foi definida, selecionar uma?\n"
"Você pode alterá-la mais tarde nas \"Configurações do Projeto\" na categoria "
@@ -1312,6 +1484,11 @@ msgid "Save Scene As.."
msgstr "Salvar Cena Como..."
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Nó"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr "Esta cena nunca foi salva. Salvar antes de rodar?"
@@ -1370,7 +1547,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "Ugh"
@@ -1410,6 +1587,10 @@ msgstr "Mais %d arquivo(s)"
msgid "%d more file(s) or folder(s)"
msgstr "Mais %d arquivo(s) ou pasta(s)"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "Modo Sem Distrações"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Cena"
@@ -1463,7 +1644,7 @@ msgstr "Fechar Cena"
msgid "Close Goto Prev. Scene"
msgstr "Ir a Cena Fechada Anterior"
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "Abrir Recente"
@@ -1491,99 +1672,41 @@ msgid "Redo"
msgstr "Refazer"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "Rodar Script"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Configurações do Projeto"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "Reverter Cena"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Sair para a Lista de Projetos"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Modo Sem Distrações"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "Importar assets ao projeto."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "Importar"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "Ferramentas diversas atuantes no projeto ou cena."
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "Ferramentas"
+#, fuzzy
+msgid "Project"
+msgstr "Novo Projeto"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "Configurações do Projeto"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "Exportar o projeto para diversas plataformas."
+msgid "Run Script"
+msgstr "Rodar Script"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "Exportar"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "Roda o projeto."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "Tocar"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "Pausar a cena"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "Pausa a cena"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "Para a cena."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "Parar"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "Roda a cena editada."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "Rodar Cena"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "Rodar outra cena"
+msgid "Tools"
+msgstr "Ferramentas"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "Rodar outra cena"
+msgid "Quit to Project List"
+msgstr "Sair para a Lista de Projetos"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "Opções de depuração"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "Depurar"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1672,9 +1795,10 @@ msgstr ""
"Quando usado remotamente em um dispositivo, isso é mais eficiente com o "
"sistema de arquivos via rede."
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "Configurações"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Editar"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1695,12 +1819,69 @@ msgid "Manage Export Templates"
msgstr "Carregando Modelos de Exportação"
#: editor/editor_node.cpp
+msgid "Help"
+msgstr "Ajuda"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "Classes"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "Fechar Docs"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr "Sobre"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "Alerta quando um recurso externo foi alterado."
+msgid "Play the project."
+msgstr "Roda o projeto."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "Tocar"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "Pausar a cena"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "Pausa a cena"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Para a cena."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "Parar"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "Roda a cena editada."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Rodar Cena"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Rodar outra cena"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "Rodar outra cena"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1783,6 +1964,14 @@ msgid "Thanks!"
msgstr "Obrigado!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "Importar Modelos de um Arquivo ZIP"
@@ -1810,15 +1999,41 @@ msgstr "Abrir e Rodar um Script"
msgid "Load Errors"
msgstr "Erros de Carregamento"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Abrir no Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Abrir no Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Abrir no Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "Exportar Biblioteca"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Abrir no Editor"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "Abrir no Editor"
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "Plugins Instalados:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "Versão:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "Autor:"
@@ -2073,6 +2288,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "Mostrar no Gerenciador de Arquivos"
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr "Instanciar"
@@ -2101,10 +2320,6 @@ msgid "Info"
msgstr "Informação"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "Mostrar no Gerenciador de Arquivos"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Re-importar..."
@@ -2271,9 +2486,10 @@ msgid "No target font resource!"
msgstr "Falta recurso de fonte destino!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"Extensão de arquivo inválida.\n"
"Por favor use .fnt."
@@ -2757,8 +2973,9 @@ msgid "Compress"
msgstr "Comprimir"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr "Adicionar ao Projeto (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "Adicionar ao Projeto (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -3431,7 +3648,7 @@ msgid "Change default type"
msgstr "Alterar Valor Padrão"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "OK"
@@ -3480,15 +3697,6 @@ msgstr "Criar Polígono 3D"
msgid "Set Handle"
msgstr "Definir Manipulador"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "Adicionar/Remover Ponto na Curva de Cor"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr "Modificar Curva de Cores"
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr "Criando MeshLibrary"
@@ -3519,6 +3727,35 @@ msgstr "Importar da Cena"
msgid "Update from Scene"
msgstr "Atualizar a partir de Cena"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Adicionar Entrada"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Remover Ponto do Caminho"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "Carregar Recurso"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Modify Curve"
+msgstr "Modificar Curve Map"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "Adicionar/Remover Ponto na Curva de Cor"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "Modificar Curva de Cores"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "Item %d"
@@ -3793,6 +4030,20 @@ msgid "Remove Poly And Point"
msgstr "Remover Polígono e Ponto"
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "Limpar Máscara de Emissão"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "Gerar AABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "Erro ao carregar imagem:"
@@ -3805,8 +4056,8 @@ msgid "Set Emission Mask"
msgstr "Definir Máscara de Emissão"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
-msgstr "Limpar Máscara de Emissão"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -3816,6 +4067,27 @@ msgstr "Carregar Máscara de Emissão"
msgid "Generated Point Count:"
msgstr "Gerar Contagem de Pontos:"
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Tempo Médio (seg)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "Definir Máscara de Emissão"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "Criar a partir de Cena"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Posições de Emissão:"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr "O nó não contém geometria."
@@ -3825,6 +4097,10 @@ msgid "Node does not contain geometry (faces)."
msgstr "O nó não contém geometria (faces)."
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "As faces não têm área!"
@@ -3837,11 +4113,13 @@ msgid "Generate AABB"
msgstr "Gerar AABB"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+#, fuzzy
+msgid "Create Emission Points From Mesh"
msgstr "Criar Emissor a partir de Mesh"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+#, fuzzy
+msgid "Create Emission Points From Node"
msgstr "Criar Emissor a partir de Nó"
#: editor/plugins/particles_editor_plugin.cpp
@@ -3853,26 +4131,48 @@ msgid "Create Emitter"
msgstr "Criar Emissor"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+#, fuzzy
+msgid "Emission Points:"
msgstr "Posições de Emissão:"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr "Preenchimento de Emissão:"
+#, fuzzy
+msgid "Surface Points"
+msgstr "Superfície %d"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "Superfície"
+msgid "Surface Points+Normal (Directed)"
+msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "Volume"
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Source: "
+msgstr "Preenchimento de Emissão:"
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "Gerar AABB"
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr "Remover Ponto da Curva"
#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "Mover Controle de Saída na Curva"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "Remover Ponto da Curva"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr "Adicionar Ponto à Curva"
@@ -3927,6 +4227,16 @@ msgstr "Dividir Caminho"
msgid "Remove Path Point"
msgstr "Remover Ponto do Caminho"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Mover Controle de Saída na Curva"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "Mover Controle de Entrada na Curva"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "Criar Mapa UV"
@@ -4080,6 +4390,11 @@ msgid "Pitch"
msgstr "Pitch"
#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "Limpar Ossos"
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr "Erro ao salvar tema"
@@ -4168,10 +4483,6 @@ msgstr "Localizar..."
msgid "Find Next"
msgstr "Localizar próximo"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "Depurar"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr "Passo por cima"
@@ -4205,16 +4516,9 @@ msgid "Move Right"
msgstr "Mover para Direita"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "Tutoriais"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "Abre https://godotengine.org na seção tutoriais."
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "Classes"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "Pesquise a documentação de referência."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
@@ -4274,6 +4578,23 @@ msgid "Pick Color"
msgstr "Cor"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "Convertendo Imagens"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4324,6 +4645,14 @@ msgid "Trim Trailing Whitespace"
msgstr "Apagar Espaços em Branco"
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr "Auto Recuar"
@@ -4345,6 +4674,16 @@ msgid "Goto Previous Breakpoint"
msgstr "Ir ao Ponto de Interrupção Anterior"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "Converter Para..."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Converter Para..."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "Encontrar Anterior"
@@ -4367,6 +4706,10 @@ msgstr "Ir para linha..."
msgid "Contextual Help"
msgstr "Ajuda Contextual"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr "Alterar Constante Escalar"
@@ -4584,36 +4927,106 @@ msgid "Animation Key Inserted."
msgstr "Chave de Animação Inserida."
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Avançar"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "Para trás"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Roda para Baixo."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Atualizar nas Mudanças"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Atualizar nas Mudanças"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "Atualizar nas Mudanças"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "Vértice"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr "Alinhar com Visão"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
-msgstr "Ambiente"
+msgid "Display Normal"
+msgstr "Exibição Normal"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
-msgstr "Ouvinte de Ãudio"
+msgid "Display Wireframe"
+msgstr "Exibição Wireframe"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
-msgstr "Gizmos"
+msgid "Display Overdraw"
+msgstr "Exibição Overdraw"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
-msgstr "Diálogo XForm"
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Exibição Shadeless"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "Nenhuma cena selecionada para instanciar!"
+#, fuzzy
+msgid "View Environment"
+msgstr "Ambiente"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Instanciar no Cursor"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Gizmos"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "Não foi possível instanciar cena!"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr "Ouvinte de Ãudio"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "Diálogo XForm"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4673,6 +5086,26 @@ msgid "Align Selection With View"
msgstr "Alinhar Seleção com Visualização"
#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "Selecionar"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "Mover"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: Rotaciona"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "Escala:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
msgstr "Transformação"
@@ -4685,14 +5118,6 @@ msgid "Transform Dialog.."
msgstr "Diálogo Transformação..."
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr "Usar Luz Padrão"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "Usar sRGB Padrão"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
msgstr "1 Viewport"
@@ -4717,22 +5142,6 @@ msgid "4 Viewports"
msgstr "4 Viewports"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr "Exibição Normal"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr "Exibição Wireframe"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr "Exibição Overdraw"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr "Exibição Shadeless"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr "Ver Origem"
@@ -4741,6 +5150,10 @@ msgid "View Grid"
msgstr "Ver Grade"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Configurações"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "Configurações do Snap"
@@ -4761,14 +5174,6 @@ msgid "Viewport Settings"
msgstr "Configurações da Viewport"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr "Luz Normal Padrão:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr "Cor de Luz Ambiente:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr "FOV Perspectiva (deg.):"
@@ -5199,12 +5604,14 @@ msgid "Invalid project path, the path must exist!"
msgstr "Caminho de projeto inválido, o caminho deve existir!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "Caminho de projeto inválido, godot.cfg não deve existir."
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Caminho de projeto inválido, engine.cfg não deve existir."
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr "Caminho de projeto inválido, godot.cfg deve existir."
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "Caminho de projeto inválido, engine.cfg deve existir."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5215,8 +5622,9 @@ msgid "Invalid project path (changed anything?)."
msgstr "Caminho de projeto inválido (mudou alguma coisa?)."
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
-msgstr "Não se pôde criar godot.cfg no caminho do projeto."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "Não se pôde criar engine.cfg no caminho do projeto."
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
@@ -5251,10 +5659,6 @@ msgid "Install Project:"
msgstr "Instalar Projeto:"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "Instalar"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "Navegar"
@@ -5316,6 +5720,11 @@ msgid "New Project"
msgstr "Novo Projeto"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Remover Item"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "Sair"
@@ -5436,6 +5845,11 @@ msgstr "Adicionar Ação de Entrada"
msgid "Erase Input Action Event"
msgstr "Apagar Evento Ação de Entrada"
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "Adicionar Vazio"
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Dispositivo"
@@ -5501,8 +5915,9 @@ msgid "Remove Resource Remap Option"
msgstr "Remover Opção de Remapeamento de Recurso"
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr "Configurações do Projeto (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Configurações do Projeto (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5568,10 +5983,6 @@ msgstr "Localidade"
msgid "AutoLoad"
msgstr "AutoLoad"
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "Plugins"
-
#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Viewport"
@@ -5624,10 +6035,6 @@ msgid "Error loading file: Not a resource!"
msgstr "Erro ao carregar arquivo: Não é um recurso!"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "Não pôde carregar a imagem"
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "Selecione um Nó"
@@ -5820,6 +6227,11 @@ msgid "Error duplicating scene to save it."
msgstr "Erro duplicando cena ao salvar."
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Recursos:"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "Editar Grupos"
@@ -5901,10 +6313,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "Alternar CanvasItem Visível"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Opções de depuração"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "Instância:"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Próximo Script"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Alternar Spatial Visível"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr "Nome de nó Inválido, os seguintes caracteres não são permitidos:"
@@ -5949,78 +6410,94 @@ msgid "Select a Node"
msgstr "Selecione um Nó"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "Nome de classe pai inválido"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Não foi possível criar o script no sistema de arquivos."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "Caracteres válidos:"
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "Erro ao carregar cena de %s"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "Nome de classe inválido"
+msgid "Path is empty"
+msgstr "O caminho está vazio"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "Nome Válido"
+msgid "Path is not local"
+msgstr "O caminho não é local"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "N/D"
+msgid "Invalid base path"
+msgstr "Caminho base inválido"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "O nome da classe é inválido!"
+msgid "Invalid extension"
+msgstr "Extensão inválida"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "O nome da classe pai é inválido!"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "Caminho inválido!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Caminho inválido."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "Não foi possível criar o script no sistema de arquivos."
+msgid "Invalid class name"
+msgstr "Nome de classe inválido"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Error loading script from %s"
-msgstr "Erro ao carregar cena de %s"
+msgid "Invalid inherited parent name or path"
+msgstr "Nome da propriedade de índice inválido."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "O caminho está vazio"
+#, fuzzy
+msgid "Script valid"
+msgstr "Script"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "O caminho não é local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "Caminho base inválido"
+msgid "N/A"
+msgstr "N/D"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "Extensão inválida"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "Criar Script"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr "Próximo Script"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "Herda de:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "Nome da Classe:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Remover Item"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "Script Embutido"
#: editor/script_create_dialog.cpp
@@ -6193,6 +6670,10 @@ msgid "Change Notifier Extents"
msgstr "Alterar a Extensão do Notificador"
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
#, fuzzy
msgid "Change Probe Extents"
msgstr "Alterar a Extensão do Notificador"
@@ -6200,7 +6681,7 @@ msgstr "Alterar a Extensão do Notificador"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
msgid "Invalid type argument to convert(), use TYPE_* constants."
-msgstr "Argumento de tipo inválido para converter(), use constantes TYPE_*."
+msgstr "Argumento de tipo inválido para convert(), use constantes TYPE_*."
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6217,11 +6698,11 @@ msgstr "Não é um script com uma instância"
#: modules/gdscript/gd_functions.cpp
msgid "Not based on a script"
-msgstr "Não é baseado num script"
+msgstr "Não é baseado em um script"
#: modules/gdscript/gd_functions.cpp
msgid "Not based on a resource file"
-msgstr "Não é baseado num arquivo de recurso"
+msgstr "Não é baseado em um arquivo de recurso"
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary format (missing @path)"
@@ -6230,8 +6711,8 @@ msgstr "Formato de dicionário de instância inválido (faltando @path)"
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary format (can't load script at @path)"
msgstr ""
-"Formato de dicionário de instância inválido (não se pôde carregar o script "
-"em @path)"
+"Formato de dicionário de instância inválido (não foi possível carregar o "
+"script em @path)"
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary format (invalid script at @path)"
@@ -6261,7 +6742,7 @@ msgstr ""
#: modules/visual_script/visual_script.cpp
msgid "Node returned an invalid sequence output: "
-msgstr ""
+msgstr "O nó retornou uma saída de sequência inválida: "
#: modules/visual_script/visual_script.cpp
msgid "Found sequence bit but not the node in the stack, report bug!"
@@ -6281,11 +6762,11 @@ msgstr "Variáveis:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Name is not a valid identifier:"
-msgstr ""
+msgstr "O nome não é um identificador valido:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Name already in use by another func/var/signal:"
-msgstr ""
+msgstr "Nome já utilizado por outra func/var/sinal:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Rename Function"
@@ -6293,7 +6774,7 @@ msgstr "Renomear Função"
#: modules/visual_script/visual_script_editor.cpp
msgid "Rename Variable"
-msgstr "renomeie variável"
+msgstr "Renomear Variável"
#: modules/visual_script/visual_script_editor.cpp
msgid "Rename Signal"
@@ -6334,7 +6815,7 @@ msgstr "Editando Sinal:"
#: modules/visual_script/visual_script_editor.cpp
#, fuzzy
msgid "Change Expression"
-msgstr "Alterar Tipo"
+msgstr "Alterar Expressão"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Node"
@@ -6343,76 +6824,76 @@ msgstr "Adicionar Nó"
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature."
msgstr ""
+"Segure Meta para aplicar um Getter. Segure Shift para aplicar uma assinatura "
+"genérica."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature."
msgstr ""
+"Segure Ctrl para aplicar um Getter. Segure Shift para aplicar uma assinatura "
+"genérica."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a simple reference to the node."
-msgstr ""
+msgstr "Segure Meta para aplicar uma referência simples ao nó."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Ctrl to drop a simple reference to the node."
-msgstr ""
+msgstr "Segure Ctrl para aplicar uma referência ao nó."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Meta to drop a Variable Setter."
-msgstr ""
+msgstr "Segure Meta para aplicar um Setter de Variável."
#: modules/visual_script/visual_script_editor.cpp
msgid "Hold Ctrl to drop a Variable Setter."
-msgstr ""
+msgstr "Segure Ctrl para aplicar um Setter de Variável."
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Add Preload Node"
-msgstr "Adicionar Nó Filho"
+msgstr "Adicionar Nó de Pré-carregamento"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Add Node(s) From Tree"
-msgstr "Nó a Partir de Cena"
+msgstr "Adicionar Nó(s) a partir de árvore"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Getter Property"
-msgstr ""
+msgstr "Adicionar Getter de Propriedade"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Setter Property"
-msgstr ""
+msgstr "Adicionar Setter de Propriedade"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Condition"
-msgstr "Copiar Animação"
+msgstr "Condição"
#: modules/visual_script/visual_script_editor.cpp
msgid "Sequence"
-msgstr ""
+msgstr "Sequência"
#: modules/visual_script/visual_script_editor.cpp
#, fuzzy
msgid "Switch"
-msgstr "Pitch"
+msgstr "Mudar"
#: modules/visual_script/visual_script_editor.cpp
msgid "Iterator"
-msgstr ""
+msgstr "Iterador"
#: modules/visual_script/visual_script_editor.cpp
msgid "While"
-msgstr ""
+msgstr "Enquanto"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Return"
-msgstr "Retornar:"
+msgstr "Retornar"
#: modules/visual_script/visual_script_editor.cpp
#, fuzzy
msgid "Get"
-msgstr "Definir"
+msgstr "Obter"
#: modules/visual_script/visual_script_editor.cpp
msgid "Base Type:"
@@ -6424,7 +6905,7 @@ msgstr "Nós Disponíveis:"
#: modules/visual_script/visual_script_editor.cpp
msgid "Select or create a function to edit graph"
-msgstr ""
+msgstr "Selecione ou crie uma função para editar o grafo"
#: modules/visual_script/visual_script_editor.cpp
msgid "Edit Signal Arguments:"
@@ -6443,41 +6924,36 @@ msgid "Delete Selected"
msgstr "Excluir Selecionados"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Find Node Type"
msgstr "Localizar Tipo de Nó"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Copy Nodes"
-msgstr "Copiar Pose"
+msgstr "Copiar Nós"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Cut Nodes"
-msgstr "Criar Nó"
+msgstr "Recortar Nós"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Paste Nodes"
-msgstr "Colar Pose"
+msgstr "Colar Nós"
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Input type not iterable: "
-msgstr ""
+msgstr "Tipo de entrada não iterável: "
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Iterator became invalid"
-msgstr ""
+msgstr "Iterador tornou-se inválido"
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Iterator became invalid: "
-msgstr ""
+msgstr "Iterador tornou-se inválido: "
#: modules/visual_script/visual_script_func_nodes.cpp
-#, fuzzy
msgid "Invalid index property name."
-msgstr "Nome de classe pai inválido"
+msgstr "Nome da propriedade de índice inválido."
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Base object is not a Node!"
@@ -6527,6 +7003,30 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Run in Browser"
+msgstr "Navegar"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "Não se pôde achar tile:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "Não se pôde achar tile:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "Não foi possível criar a pasta."
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6694,9 +7194,11 @@ msgstr ""
"O nó ParallaxLayer apenas funciona quando definido como filho de um nó "
"ParallaxBackground."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
-msgstr "A propriedade Caminho deve apontar a um nó Particles2D para funcionar."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6779,6 +7281,11 @@ msgstr ""
"NavigationMeshInstance deve ser filho ou neto de um nó Navigation. Ele "
"apenas fornece dados de navegação."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6799,6 +7306,15 @@ msgstr ""
"Um recurso do tipo SpriteFrames deve ser criado ou definido na propriedade "
"\"Frames\" para que o nó AnimatedSprite mostre quadros."
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "Modo de Início:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Alerta!"
@@ -6844,6 +7360,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6856,6 +7378,73 @@ msgstr ""
"para que ele possa ter um tamanho. Caso contrário, defina-o como destino de "
"render e atribua sua textura interna a algum nó para exibir."
+#~ msgid "Node From Scene"
+#~ msgstr "Nó a Partir de Cena"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Importar assets ao projeto."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Exportar o projeto para diversas plataformas."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "Alerta quando um recurso externo foi alterado."
+
+#~ msgid "Tutorials"
+#~ msgstr "Tutoriais"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "Abre https://godotengine.org na seção tutoriais."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "Nenhuma cena selecionada para instanciar!"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "Instanciar no Cursor"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "Não foi possível instanciar cena!"
+
+#~ msgid "Use Default Light"
+#~ msgstr "Usar Luz Padrão"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "Usar sRGB Padrão"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "Luz Normal Padrão:"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "Cor de Luz Ambiente:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "Não pôde carregar a imagem"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "Nome de classe pai inválido"
+
+#~ msgid "Valid chars:"
+#~ msgstr "Caracteres válidos:"
+
+#~ msgid "Valid name"
+#~ msgstr "Nome Válido"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "O nome da classe é inválido!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "O nome da classe pai é inválido!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "Caminho inválido!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "A propriedade Caminho deve apontar a um nó Particles2D para funcionar."
+
+#~ msgid "Surface"
+#~ msgstr "Superfície"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
@@ -7055,9 +7644,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "Silêncio no Fim:"
-#~ msgid "Script"
-#~ msgstr "Script"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Modo de Exportação de Scripts:"
@@ -7091,9 +7677,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance não contém um recurso BakedLight ."
-#~ msgid "Vertex"
-#~ msgstr "Vértice"
-
#~ msgid "Fragment"
#~ msgstr "Fragmento"
@@ -7122,9 +7705,6 @@ msgstr ""
#~ msgid "Cannot go into subdir:"
#~ msgstr "Não é possível ir ao subdiretório:"
-#~ msgid "Help"
-#~ msgstr "Ajuda"
-
#~ msgid "Imported Resources"
#~ msgstr "Recursos Importados"
diff --git a/editor/translations/pt_PT.po b/editor/translations/pt_PT.po
index dae8f12829..738eea37a9 100644
--- a/editor/translations/pt_PT.po
+++ b/editor/translations/pt_PT.po
@@ -355,6 +355,174 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "View Files"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Fechar"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connecting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Error making request"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -362,6 +530,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -375,10 +567,6 @@ msgid "Category:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr ""
@@ -390,7 +578,7 @@ msgstr ""
msgid "Official"
msgstr ""
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr ""
@@ -410,20 +598,6 @@ msgstr ""
msgid "Call"
msgstr ""
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Fechar"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr ""
@@ -473,13 +647,6 @@ msgid "Selection Only"
msgstr ""
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr ""
@@ -554,6 +721,7 @@ msgstr ""
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr ""
@@ -629,11 +797,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -664,6 +827,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -764,8 +928,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -775,6 +938,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -843,8 +1007,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr ""
@@ -910,7 +1073,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1035,7 +1198,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1052,7 +1216,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1107,10 +1270,6 @@ msgstr ""
msgid "Clear"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1226,8 +1385,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1281,6 +1440,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1337,7 +1500,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1375,6 +1538,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1427,7 +1594,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1455,50 +1622,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1506,47 +1646,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1617,9 +1725,10 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr ""
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Editar"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1638,11 +1747,67 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1726,6 +1891,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1753,12 +1926,32 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+msgid "Open 2D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 3D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2001,6 +2194,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2029,10 +2226,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2198,7 +2391,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2673,7 +2866,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3333,7 +3526,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr ""
@@ -3382,15 +3575,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3421,6 +3605,33 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Adicionar Sinal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Remover Sinal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3690,6 +3901,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3702,7 +3926,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3713,6 +3937,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3722,6 +3963,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3734,11 +3979,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3750,26 +3995,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3824,6 +4085,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Remover Função"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3977,6 +4247,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4065,10 +4339,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4102,15 +4372,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4165,6 +4427,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4215,6 +4493,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4236,6 +4522,14 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4258,6 +4552,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4475,35 +4773,96 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Alterar"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4563,23 +4922,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "Apagar Seleccionados"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4607,27 +4975,15 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4651,14 +5007,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5071,11 +5419,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5087,7 +5435,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5123,10 +5471,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5185,6 +5529,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Remover Variável"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5303,6 +5652,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr ""
@@ -5368,7 +5721,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5435,10 +5788,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5488,10 +5837,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
msgid "Pick a Node"
msgstr ""
@@ -5677,6 +6022,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5751,10 +6100,56 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Open script"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5799,75 +6194,86 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
+msgid "Error - Could not create script in filesystem."
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
+msgid "Error loading script from %s"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr ""
+#, fuzzy
+msgid "Invalid Path"
+msgstr ": Argumentos inválidos: "
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "Nome de índice propriedade inválido."
+
+#: editor/script_create_dialog.cpp
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Create new script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Class Name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Remover Variável"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6039,6 +6445,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6368,6 +6778,26 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr ""
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6508,8 +6938,10 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
#: scene/2d/path_2d.cpp
@@ -6572,6 +7004,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6587,6 +7024,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr ""
@@ -6629,6 +7074,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
diff --git a/editor/translations/ru.po b/editor/translations/ru.po
index d7302c58d7..3acaa82736 100644
--- a/editor/translations/ru.po
+++ b/editor/translations/ru.po
@@ -2,7 +2,8 @@
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
-# DimOkGamer <dimokgamer@gmail.com>, 2016.
+# DimOkGamer <dimokgamer@gmail.com>, 2016-2017.
+# ijet <my-ijet@mail.ru>, 2017.
# Maxim Kim <habamax@gmail.com>, 2016.
# Maxim toby3d Lebedev <mail@toby3d.ru>, 2016.
#
@@ -10,8 +11,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2016-12-14 17:04+0000\n"
-"Last-Translator: DimOkGamer <dimokgamer@gmail.com>\n"
+"PO-Revision-Date: 2017-05-10 20:34+0000\n"
+"Last-Translator: DimOkGamer <salnikov.mine@yandex.ru>\n"
"Language-Team: Russian <https://hosted.weblate.org/projects/godot-engine/"
"godot/ru/>\n"
"Language: ru\n"
@@ -20,11 +21,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
-"X-Generator: Weblate 2.10-dev\n"
+"X-Generator: Weblate 2.14-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
-msgstr "Отключить"
+msgstr "Отключено"
#: editor/animation_editor.cpp
msgid "All Selection"
@@ -36,72 +37,71 @@ msgstr "Подвинут ключ"
#: editor/animation_editor.cpp
msgid "Anim Change Transition"
-msgstr "Изменён переход анимации"
+msgstr "Изменить переход"
#: editor/animation_editor.cpp
msgid "Anim Change Transform"
-msgstr "Изменено преобразование анимации"
+msgstr "Изменить положение"
#: editor/animation_editor.cpp
msgid "Anim Change Value"
-msgstr "Изменено значение анимации"
+msgstr "Изменить значение"
#: editor/animation_editor.cpp
msgid "Anim Change Call"
-msgstr "Изменён вызов анимации"
+msgstr "Изменить вызов анимации"
#: editor/animation_editor.cpp
msgid "Anim Add Track"
-msgstr "Добавлен новый трек"
+msgstr "Добавить новую дорожку"
#: editor/animation_editor.cpp
msgid "Anim Duplicate Keys"
-msgstr "Дублированы ключи анимации"
+msgstr "Дублировать ключи"
#: editor/animation_editor.cpp
msgid "Move Anim Track Up"
-msgstr "Трек передвинут вверх"
+msgstr "Передвинуть дорожку вверх"
#: editor/animation_editor.cpp
msgid "Move Anim Track Down"
-msgstr "Трек передвинут вниз"
+msgstr "Передвинуть дорожку вниз"
#: editor/animation_editor.cpp
msgid "Remove Anim Track"
-msgstr "Трек удалён"
+msgstr "Удалить дорожку"
#: editor/animation_editor.cpp
msgid "Set Transitions to:"
-msgstr "УÑтановлен переход на:"
+msgstr "УÑтановить переход на:"
#: editor/animation_editor.cpp
msgid "Anim Track Rename"
-msgstr "ТрÑк переименован"
+msgstr "Переименовать дорожку"
#: editor/animation_editor.cpp
msgid "Anim Track Change Interpolation"
-msgstr "Изменена интреполÑциÑ"
+msgstr "Изменить интреполÑцию"
#: editor/animation_editor.cpp
msgid "Anim Track Change Value Mode"
-msgstr "Изменён режим значений"
+msgstr "Изменить режим значений"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Track Change Wrap Mode"
-msgstr "Изменён режим значений"
+msgstr "Изменить режим цикла"
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
-msgstr "ÐšÑ€Ð¸Ð²Ð°Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð°"
+msgstr "Редактировать кривую узла"
#: editor/animation_editor.cpp
msgid "Edit Selection Curve"
-msgstr "Выбор кривой изменён"
+msgstr "Редактировать выбранную кривую"
#: editor/animation_editor.cpp
msgid "Anim Delete Keys"
-msgstr "Ключ удалён"
+msgstr "Удалить ключи"
#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
msgid "Duplicate Selection"
@@ -109,7 +109,7 @@ msgstr "Дублировать выделенное"
#: editor/animation_editor.cpp
msgid "Duplicate Transposed"
-msgstr "Дублировать перемещённый"
+msgstr "Дублировать и перемеÑтить"
#: editor/animation_editor.cpp
msgid "Remove Selection"
@@ -129,19 +129,19 @@ msgstr "Триггер"
#: editor/animation_editor.cpp
msgid "Anim Add Key"
-msgstr "Ключ добавлен"
+msgstr "Добавить ключ"
#: editor/animation_editor.cpp
msgid "Anim Move Keys"
-msgstr "Ключ передвинут"
+msgstr "ПеремеÑтить ключи"
#: editor/animation_editor.cpp
msgid "Scale Selection"
-msgstr "МаÑштаб выбранного промежутка"
+msgstr "МаÑштабировать выбранное"
#: editor/animation_editor.cpp
msgid "Scale From Cursor"
-msgstr "МаÑштаб отноÑительно курÑора"
+msgstr "МаÑштабировать от курÑора"
#: editor/animation_editor.cpp
msgid "Goto Next Step"
@@ -207,39 +207,39 @@ msgstr "Создать"
#: editor/animation_editor.cpp
msgid "Anim Create & Insert"
-msgstr "ÐÐ½Ð¸Ð¼Ð°Ñ†Ð¸Ñ Ñоздать и вÑтавить"
+msgstr "Создать и Ð’Ñтавить"
#: editor/animation_editor.cpp
msgid "Anim Insert Track & Key"
-msgstr "ÐÐ½Ð¸Ð¼Ð°Ñ†Ð¸Ñ Ð²Ñтавка дорожки и ключа"
+msgstr "Ð’Ñтавить Дорожку и Ключ"
#: editor/animation_editor.cpp
msgid "Anim Insert Key"
-msgstr "Ð’Ñтавка ключа анимации"
+msgstr "Ð’Ñтавить ключ"
#: editor/animation_editor.cpp
msgid "Change Anim Len"
-msgstr "Изменена длинна анимации"
+msgstr "Изменить длину анимации"
#: editor/animation_editor.cpp
msgid "Change Anim Loop"
-msgstr "Изменено зацикливание анимации"
+msgstr "Изменить зацикливание анимации"
#: editor/animation_editor.cpp
msgid "Anim Create Typed Value Key"
-msgstr "Создан ключ Ñ Ð²Ð²Ð¾Ð´Ð¸Ð¼Ñ‹Ð¼ значением"
+msgstr "Создать ключ Ñ Ð²Ð²Ð¾Ð´Ð¸Ð¼Ñ‹Ð¼ значением"
#: editor/animation_editor.cpp
msgid "Anim Insert"
-msgstr "Ð’Ñтавка на анимацию"
+msgstr "Ð’Ñтавить"
#: editor/animation_editor.cpp
msgid "Anim Scale Keys"
-msgstr "МаÑштабирование ключей анимации"
+msgstr "МаÑштабировать ключи"
#: editor/animation_editor.cpp
msgid "Anim Add Call Track"
-msgstr "Добавлен ключ вызова в анимацию"
+msgstr "Добавить дорожку вызова"
#: editor/animation_editor.cpp
msgid "Animation zoom."
@@ -271,15 +271,15 @@ msgstr "Добавить новые дорожки."
#: editor/animation_editor.cpp
msgid "Move current track up."
-msgstr "Подвинуть текущую дорожку вверх."
+msgstr "Передвинуть текущую дорожку вверх."
#: editor/animation_editor.cpp
msgid "Move current track down."
-msgstr "Подвинуть текущую дорожку вниз."
+msgstr "Передвинуть текущую дорожку вниз."
#: editor/animation_editor.cpp
msgid "Remove selected track."
-msgstr "Удалить текущую дорожку."
+msgstr "Удалить выделенную дорожку."
#: editor/animation_editor.cpp
msgid "Track tools"
@@ -287,7 +287,7 @@ msgstr "ИнÑтрументы дорожек"
#: editor/animation_editor.cpp
msgid "Enable editing of individual keys by clicking them."
-msgstr "Включить индивидуальное редактирование ключей, ÐºÐ»Ð¸ÐºÐ°Ñ Ð¿Ð¾ ним."
+msgstr "Включить редактирование ключей, ÐºÐ»Ð¸ÐºÐ°Ñ Ð¿Ð¾ ним."
#: editor/animation_editor.cpp
msgid "Anim. Optimizer"
@@ -303,7 +303,7 @@ msgstr "МакÑ. Угловые погрешноÑти:"
#: editor/animation_editor.cpp
msgid "Max Optimizable Angle:"
-msgstr "МакÑимальный оптимизируемы угол:"
+msgstr "МакÑимальный оптимизируемый угол:"
#: editor/animation_editor.cpp
msgid "Optimize"
@@ -327,7 +327,7 @@ msgstr "КоÑффициент маÑштабированиÑ:"
#: editor/animation_editor.cpp
msgid "Call Functions in Which Node?"
-msgstr "Вызвать функции в каком узле?"
+msgstr "Из какого узла вызвать функцию?"
#: editor/animation_editor.cpp
msgid "Remove invalid keys"
@@ -361,6 +361,184 @@ msgstr "Изменение типа Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¼Ð°ÑÑива"
msgid "Change Array Value"
msgstr "Изменить значение маÑÑива"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "ВерÑиÑ:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "КонÑтанты:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr " Файлы"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "ОпиÑание:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "УÑтановить"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Закрыть"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "ПриÑоединить.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "ПриÑоединить к узлу:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "ÐеизвеÑтный формат запрашиваемого файла:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Сохранение.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "ПриÑоединить.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "ТеÑтируемые"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Ошибка при Ñохранении реÑурÑа!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Загрузка"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Ð’Ñе"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -368,23 +546,43 @@ msgstr "Изменить значение маÑÑива"
msgid "Search:"
msgstr "ПоиÑк:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "ПоиÑк"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "Импорт"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "Плагины"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Сортировать:"
#: editor/asset_library_editor_plugin.cpp
msgid "Reverse"
-msgstr "Обратный"
+msgstr "Обратно"
#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
msgid "Category:"
msgstr "КатегориÑ:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Ð’Ñе"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Сайт:"
@@ -394,11 +592,11 @@ msgstr "Поддержка.."
#: editor/asset_library_editor_plugin.cpp
msgid "Official"
-msgstr "Официально"
+msgstr "Официальные"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
-msgstr "СообщеÑтво"
+msgstr "ОбщеÑтвенные"
#: editor/asset_library_editor_plugin.cpp
msgid "Testing"
@@ -410,26 +608,12 @@ msgstr "ZIP файл аÑÑетов"
#: editor/call_dialog.cpp
msgid "Method List For '%s':"
-msgstr "СпиÑок ÑпоÑоб Ð´Ð»Ñ '%s':"
+msgstr "СпиÑок методов Ð´Ð»Ñ '%s':"
#: editor/call_dialog.cpp modules/visual_script/visual_script_editor.cpp
msgid "Call"
msgstr "Вызов"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Закрыть"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "СпиÑок методов:"
@@ -455,7 +639,6 @@ msgid "No Matches"
msgstr "Ðет Ñовпадений"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replaced %d occurrence(s)."
msgstr "Заменено %d Ñовпадений."
@@ -480,13 +663,6 @@ msgid "Selection Only"
msgstr "Только выделÑть"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "ПоиÑк"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Ðайти"
@@ -500,7 +676,7 @@ msgstr "Ðе найдено!"
#: editor/code_editor.cpp
msgid "Replace By"
-msgstr "Заменить чем"
+msgstr "Заменить на"
#: editor/code_editor.cpp
msgid "Case Sensitive"
@@ -563,6 +739,7 @@ msgstr "Добавить"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Удалить"
@@ -638,11 +815,6 @@ msgstr "Ðедавнее:"
msgid "Matches:"
msgstr "СовпадениÑ:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "ОпиÑание:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "ПоиÑк замены длÑ:"
@@ -677,6 +849,7 @@ msgstr "РеÑурÑ"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Путь"
@@ -765,23 +938,21 @@ msgstr "Удалить"
#: editor/editor_audio_buses.cpp
msgid "Save Audio Bus Layout As.."
-msgstr ""
+msgstr "Сохранить раÑкладку звуковой шины как.."
#: editor/editor_audio_buses.cpp
msgid "Location for New Layout.."
-msgstr ""
+msgstr "МеÑтоположение новой раÑкладки.."
#: editor/editor_audio_buses.cpp
msgid "Open Audio Bus Layout"
-msgstr ""
+msgstr "Открыть раÑкладку звуковой шины"
#: editor/editor_audio_buses.cpp
-#, fuzzy
msgid "Add Bus"
-msgstr "Добавить %s"
+msgstr "Добавить"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "Загрузить"
@@ -791,6 +962,7 @@ msgid "Save As"
msgstr "Сохранить как"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "По-умолчанию"
@@ -834,7 +1006,7 @@ msgstr "Ðе в пути реÑурÑов."
#: editor/editor_autoload_settings.cpp
msgid "Add AutoLoad"
-msgstr "Добавлена автозагрузка"
+msgstr "Добавить автозагрузку"
#: editor/editor_autoload_settings.cpp
msgid "Autoload '%s' already exists!"
@@ -846,15 +1018,15 @@ msgstr "Переименовать автозагрузку"
#: editor/editor_autoload_settings.cpp
msgid "Toggle AutoLoad Globals"
-msgstr "Переключена автозагрузка глобальных Ñкриптов"
+msgstr "Переключить автозагрузку глобальных Ñкриптов"
#: editor/editor_autoload_settings.cpp
msgid "Move Autoload"
-msgstr "Передвинута автозагрузка"
+msgstr "ПеремеÑтить автозагрузку"
#: editor/editor_autoload_settings.cpp
msgid "Remove Autoload"
-msgstr "Удалена автозагрузка"
+msgstr "Удалить автозагрузку"
#: editor/editor_autoload_settings.cpp
msgid "Enable"
@@ -865,8 +1037,7 @@ msgid "Rearrange Autoloads"
msgstr "ПереÑтановка автозагрузок"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Путь:"
@@ -932,9 +1103,9 @@ msgstr "Сохранение файла:"
msgid "Packing"
msgstr "Упаковывание"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "Файл шаблона не найден:\n"
#: editor/editor_export.cpp
msgid "Added:"
@@ -1051,16 +1222,16 @@ msgstr "Ðужно иÑпользовать доÑтупное раÑширенÐ
#: editor/editor_file_system.cpp
msgid "ScanSources"
-msgstr "ПроÑканировать иÑходники"
+msgstr "Сканировать иÑходники"
#: editor/editor_file_system.cpp
-#, fuzzy
msgid "(Re)Importing Assets"
-msgstr "Переимпортировать"
+msgstr "(Ре)Импортировать"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
-msgstr "ПоиÑк внутри клаÑÑов"
+msgstr "Помощь (ПоиÑк)"
#: editor/editor_help.cpp
msgid "Class List:"
@@ -1075,7 +1246,6 @@ msgid "Class:"
msgstr "КлаÑÑ:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "ÐаÑледует:"
@@ -1108,9 +1278,8 @@ msgid "Constants:"
msgstr "КонÑтанты:"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Property Description:"
-msgstr "Краткое опиÑание:"
+msgstr "ОпиÑание ÑвойÑтва:"
#: editor/editor_help.cpp
msgid "Method Description:"
@@ -1131,10 +1300,6 @@ msgstr " Вывод:"
msgid "Clear"
msgstr "ОчиÑтить"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Узел Ñо Ñцены"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1250,10 +1415,11 @@ msgid "There is no defined scene to run."
msgstr "Ðет определённой Ñцены, чтобы работать."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"Ðе назначена Ð³Ð»Ð°Ð²Ð½Ð°Ñ Ñцена. Хотите выбрать?\n"
"Позже вы можете указать её в параметре \"main_scene\" раÑположенном\n"
@@ -1316,6 +1482,11 @@ msgid "Save Scene As.."
msgstr "Сохранить Ñцену как.."
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Узел"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr "Эта Ñцена никогда не была Ñохранена. Сохранить перед запуÑком?"
@@ -1372,9 +1543,12 @@ msgid ""
"Scene '%s' was automatically imported, so it can't be modified.\n"
"To make changes to it, a new inherited scene can be created."
msgstr ""
+"Сцена '%s' автоматичеÑки импортирована, поÑтому модифицирована быть не "
+"может.\n"
+"Чтобы её изменить нужно Ñоздать новую унаÑледованную Ñцену."
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "ЯÑно"
@@ -1415,6 +1589,10 @@ msgstr "Ещё %d файла(ов)"
msgid "%d more file(s) or folder(s)"
msgstr "Ещё %d файла(ов) или папка(ок)"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "Свободный режим"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Сцена"
@@ -1432,9 +1610,8 @@ msgid "Previous tab"
msgstr "ÐŸÑ€ÐµÐ´Ñ‹Ð´ÑƒÑ‰Ð°Ñ Ð²ÐºÐ»Ð°Ð´ÐºÐ°"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Filter Files.."
-msgstr "БыÑтро отÑортировать файлы.."
+msgstr "ОтÑортировать файлы.."
#: editor/editor_node.cpp
msgid "Operations with scene files."
@@ -1468,7 +1645,7 @@ msgstr "Закрыть Ñцену"
msgid "Close Goto Prev. Scene"
msgstr "Закрыть и перейти к предыдущей Ñцене"
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "Открыть поÑледнее"
@@ -1496,99 +1673,41 @@ msgid "Redo"
msgstr "Повторить"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "ЗапуÑтить Ñкрипт"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Параметры проекта"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "ВоÑÑтановить Ñцену"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Выйти в ÑпиÑок проектов"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Свободный режим"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "Импортировать аÑÑеты в проект."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "Импорт"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "Прочие инÑтрументы."
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "ИнÑтрументы"
+#, fuzzy
+msgid "Project"
+msgstr "Ðовый проект"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "Параметры проекта"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "ЭкÑпортировать проект на многие платформы."
+msgid "Run Script"
+msgstr "ЗапуÑтить Ñкрипт"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "ЭкÑпорт"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "ЗапуÑтить проект."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "ВоÑпроизвеÑти"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "ПриоÑтановить Ñцену"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "ПриоÑтановить Ñцену"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "ОÑтановить Ñцену."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "ОÑтановить"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "ЗапуÑтить текущую Ñцену."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "ЗапуÑтить Ñцену"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "ЗапуÑтить выборочную Ñцену"
+msgid "Tools"
+msgstr "ИнÑтрументы"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "ЗапуÑтить произвольную Ñцену"
+msgid "Quit to Project List"
+msgstr "Выйти в ÑпиÑок проектов"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "Параметры отладки"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "Отладка"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1677,9 +1796,10 @@ msgstr ""
"При удалённом иÑпользовании на уÑтройÑтве, Ñто работает более Ñффективно Ñ "
"Ñетевой файловой ÑиÑтемой."
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "ÐаÑтройки"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Редактировать"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1694,17 +1814,73 @@ msgid "Toggle Fullscreen"
msgstr "Переключить полноÑкранный режим"
#: editor/editor_node.cpp editor/project_export.cpp
-#, fuzzy
msgid "Manage Export Templates"
-msgstr "Загрузка шаблонов ÑкÑпорта"
+msgstr "Управление шаблонами ÑкÑпорта"
+
+#: editor/editor_node.cpp
+msgid "Help"
+msgstr "Справка"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "КлаÑÑÑ‹"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "Закрыть документацию"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
#: editor/editor_node.cpp
msgid "About"
msgstr "О движке"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "ОповещениÑ, когда внешний реÑÑƒÑ€Ñ Ð±Ñ‹Ð» изменён."
+msgid "Play the project."
+msgstr "ЗапуÑтить проект."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "ВоÑпроизвеÑти"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "ПриоÑтановить Ñцену"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "ПриоÑтановить Ñцену"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "ОÑтановить Ñцену."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "ОÑтановить"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "ЗапуÑтить текущую Ñцену."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "ЗапуÑтить Ñцену"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "ЗапуÑтить выборочную Ñцену"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "ЗапуÑтить произвольную Ñцену"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1772,7 +1948,7 @@ msgstr "Вывод"
#: editor/editor_node.cpp editor/editor_reimport_dialog.cpp
msgid "Re-Import"
-msgstr "Импортировать Ñнова"
+msgstr "Переимпортировать"
#: editor/editor_node.cpp editor/editor_plugin_settings.cpp
msgid "Update"
@@ -1787,6 +1963,14 @@ msgid "Thanks!"
msgstr "СпаÑибо!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "Импортировать шаблоны из ZIP файла"
@@ -1814,15 +1998,41 @@ msgstr "Открыть и запуÑтить Ñкрипт"
msgid "Load Errors"
msgstr "Ошибки загрузки"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Открыть в редакторе"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Открыть в редакторе"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Открыть в редакторе"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "ЭкÑпортировать библиотеку"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Открыть в редакторе"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "Открыть в редакторе"
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "УÑтановленные плагины:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "ВерÑиÑ:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "Ðвтор:"
@@ -1935,37 +2145,32 @@ msgid "Import From Node:"
msgstr "Импортировать из Узла:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Re-Download"
msgstr "Перезагрузить"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Uninstall"
-msgstr "УÑтановить"
+msgstr "Удалить"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "(Installed)"
-msgstr "УÑтановить"
+msgstr "(УÑтановлено)"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Download"
-msgstr "Вниз"
+msgstr "Загрузка"
#: editor/export_template_manager.cpp
msgid "(Missing)"
-msgstr ""
+msgstr "(ОтÑутÑтвует)"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "(Current)"
-msgstr "Выбранный:"
+msgstr "(Текущий)"
#: editor/export_template_manager.cpp
msgid "Remove template version '%s'?"
-msgstr ""
+msgstr "Удалить верÑию шаблона '%s'?"
#: editor/export_template_manager.cpp
msgid "Can't open export templates zip."
@@ -1973,27 +2178,27 @@ msgstr "Ðе удаётÑÑ Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚ÑŒ архив шаблонов ÑкÑпÐ
#: editor/export_template_manager.cpp
msgid "Invalid version.txt format inside templates."
-msgstr ""
+msgstr "Ðеверный формат version.txt файла внутри шаблонов."
#: editor/export_template_manager.cpp
msgid ""
"Invalid version.txt format inside templates. Revision is not a valid "
"identifier."
msgstr ""
+"Ðеверный формат version.txt файла внутри шаблонов. Идентификатор ревизии не "
+"верен."
#: editor/export_template_manager.cpp
msgid "No version.txt found inside templates."
-msgstr ""
+msgstr "Ðе найден version.txt файл в шаблонах."
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Error creating path for templates:\n"
-msgstr "Ошибка ÑÐ¾Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ð°Ñ‚Ð»Ð°Ñа:"
+msgstr "Ошибка ÑÐ¾Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ ÑˆÐ°Ð±Ð»Ð¾Ð½Ð¾Ð²:\n"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Extracting Export Templates"
-msgstr "Загрузка шаблонов ÑкÑпорта"
+msgstr "РаÑпаковка шаблонов ÑкÑпорта"
#: editor/export_template_manager.cpp
msgid "Importing:"
@@ -2004,34 +2209,28 @@ msgid "Loading Export Templates"
msgstr "Загрузка шаблонов ÑкÑпорта"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Current Version:"
-msgstr "Ð¢ÐµÐºÑƒÑ‰Ð°Ñ Ñцена"
+msgstr "Ð¢ÐµÐºÑƒÑ‰Ð°Ñ Ð²ÐµÑ€ÑиÑ:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Installed Versions:"
-msgstr "УÑтановленные плагины:"
+msgstr "УÑтановленные верÑии:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Install From File"
-msgstr "УÑтановить проект:"
+msgstr "УÑтановить из файла"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Remove Template"
-msgstr "Удалить Ñлемент"
+msgstr "Удалить шаблон"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Select template file"
-msgstr "Удалить выбранные файлы?"
+msgstr "Выбрать файл шаблона"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Export Template Manager"
-msgstr "Загрузка шаблонов ÑкÑпорта"
+msgstr "Менеджер шаблонов ÑкÑпорта"
#: editor/file_type_cache.cpp
msgid "Can't open file_type_cache.cch for writing, not saving file type cache!"
@@ -2041,7 +2240,7 @@ msgstr ""
#: editor/filesystem_dock.cpp
msgid "Cannot navigate to '"
-msgstr ""
+msgstr "Ðе удалоÑÑŒ перейти к '"
#: editor/filesystem_dock.cpp
msgid "Same source and destination files, doing nothing."
@@ -2068,13 +2267,16 @@ msgid "No files selected!"
msgstr "Файлы не выбраны!"
#: editor/filesystem_dock.cpp
-#, fuzzy
msgid "Expand all"
-msgstr "РаÑÑ‚Ñнуть до размера родителей"
+msgstr "Развернуть вÑе"
#: editor/filesystem_dock.cpp
msgid "Collapse all"
-msgstr ""
+msgstr "Свернуть вÑе"
+
+#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "ПроÑмотреть в проводнике"
#: editor/filesystem_dock.cpp
msgid "Instance"
@@ -2105,10 +2307,6 @@ msgid "Info"
msgstr "ИнформациÑ"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "ПроÑмотреть в проводнике"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Переимпортировать.."
@@ -2122,7 +2320,7 @@ msgstr "Следующий каталог"
#: editor/filesystem_dock.cpp
msgid "Re-Scan Filesystem"
-msgstr "Повторное Ñканирование файловой ÑиÑтемы"
+msgstr "ПереÑканировать файловую ÑиÑтему"
#: editor/filesystem_dock.cpp
msgid "Toggle folder status as Favorite"
@@ -2130,7 +2328,7 @@ msgstr "Переключить ÑÑ‚Ð°Ñ‚ÑƒÑ Ð¿Ð°Ð¿ÐºÐ¸ как избранной
#: editor/filesystem_dock.cpp
msgid "Instance the selected scene(s) as child of the selected node."
-msgstr "Добавить выбранную Ñцену(Ñцены), как потомка выбранного узла."
+msgstr "Добавить выбранную Ñцену(Ñ‹), в качеÑтве потомка выбранного узла."
#: editor/filesystem_dock.cpp
msgid "Move"
@@ -2186,23 +2384,20 @@ msgid "Saving.."
msgstr "Сохранение.."
#: editor/import_dock.cpp
-#, fuzzy
msgid " Files"
-msgstr "Файл"
+msgstr " Файлы"
#: editor/import_dock.cpp
-#, fuzzy
msgid "Import As:"
-msgstr "Импорт"
+msgstr "Импортировать как:"
#: editor/import_dock.cpp editor/property_editor.cpp
msgid "Preset.."
msgstr "ПредуÑтановка.."
#: editor/import_dock.cpp
-#, fuzzy
msgid "Reimport"
-msgstr "Импортировать Ñнова"
+msgstr "Переимпортировать"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
msgid "No bit masks to import!"
@@ -2275,9 +2470,10 @@ msgid "No target font resource!"
msgstr "Ðет целевого реÑурÑа шрифта!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"ÐедопуÑтимое раÑширение файла.\n"
"ПожалуйÑта, иÑпользуйте .fnt."
@@ -2318,7 +2514,7 @@ msgstr "Проверка:"
#: editor/io_plugins/editor_sample_import_plugin.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Options:"
-msgstr "Параметры:"
+msgstr "Опции:"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Font Import"
@@ -2329,7 +2525,7 @@ msgid ""
"This file is already a Godot font file, please supply a BMFont type file "
"instead."
msgstr ""
-"Это уже файл шрифта Godot, пожалуйÑта иÑпользуйте BitMapFont за меÑто него."
+"Это итак файл шрифта Godot, пожалуйÑта иÑпользуйте BitMapFont вмеÑто него."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Failed opening as BMFont file."
@@ -2357,7 +2553,7 @@ msgstr "ÐедопуÑтимый размер шрифта."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Invalid font custom source."
-msgstr "ÐедопуÑтимый шрифт пользовательÑкого иÑточника."
+msgstr "Ðеверный пользовательÑкий иÑточник Ð´Ð»Ñ ÑˆÑ€Ð¸Ñ„Ñ‚Ð°."
#: editor/io_plugins/editor_font_import_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp
@@ -2399,7 +2595,7 @@ msgstr "Ðудио ÑÑмпл"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "New Clip"
-msgstr "Ðовый клип"
+msgstr "ÐÐ¾Ð²Ð°Ñ Ð´Ð¾Ñ€Ð¾Ð¶ÐºÐ°"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Animation Options"
@@ -2431,7 +2627,7 @@ msgstr "МакÑ. угол"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Clips"
-msgstr "Клипы"
+msgstr "Дорожки"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Start(s)"
@@ -2460,7 +2656,7 @@ msgstr "Ðе могу загрузить Ñкрипт поÑÑ‚-процеÑÑа.
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Invalid/broken script for post-import."
-msgstr "Поврежденный/Ñломанный Ñценарий Ð´Ð»Ñ Ð¿Ð¾ÑÑ‚-импорта."
+msgstr "Ðекорректный/поврежденный Ñценарий Ð´Ð»Ñ Ð¿Ð¾ÑÑ‚-импорта."
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Error importing scene."
@@ -2476,11 +2672,11 @@ msgstr "ИÑÑ…Ð¾Ð´Ð½Ð°Ñ Ñцена:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Same as Target Scene"
-msgstr "Та же, что и у Ñцены"
+msgstr "Та же, что и у целевой Ñцены"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Shared"
-msgstr "Раздельно"
+msgstr "Общий"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Target Texture Folder:"
@@ -2492,7 +2688,7 @@ msgstr "Скрипт поÑÑ‚-процеÑÑа:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Custom Root Node Type:"
-msgstr "ÐаÑтраиваемый тип корневого узла:"
+msgstr "ПользовательÑкий тип корневого узла:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Auto"
@@ -2508,7 +2704,7 @@ msgstr "ОтÑутÑтвуют Ñледующие файлы:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Import Anyway"
-msgstr "Импорт в любом Ñлучае"
+msgstr "Импортировать в любом Ñлучае"
#: editor/io_plugins/editor_scene_import_plugin.cpp scene/gui/dialogs.cpp
msgid "Cancel"
@@ -2762,8 +2958,9 @@ msgid "Compress"
msgstr "Сжимать"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr "Добавить в проект (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "Добавить к проекту (godot.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -2802,9 +2999,8 @@ msgid "Change Animation Name:"
msgstr "Изменить Ð¸Ð¼Ñ Ð°Ð½Ð¸Ð¼Ð°Ñ†Ð¸Ð¸:"
#: editor/plugins/animation_player_editor_plugin.cpp
-#, fuzzy
msgid "Delete Animation?"
-msgstr "Дублировать анимацию"
+msgstr "Удалить анимацию?"
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
@@ -3430,7 +3626,7 @@ msgid "Change default type"
msgstr "Изменить тип по умолчанию"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "Ок"
@@ -3481,15 +3677,6 @@ msgstr "Создан Poly3D"
msgid "Set Handle"
msgstr "УÑтановить обработчик"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "Добавить/Удалить точку Color Ramp"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr "Изменена Color Ramp"
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr "Создание библиотеки полиÑеток"
@@ -3520,6 +3707,34 @@ msgstr "Импортировать из Ñцены"
msgid "Update from Scene"
msgstr "Обновить из Ñцены"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Добавить вход"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Удалить точку пути"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "Загрузить реÑурÑ"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr "Изменить кривую"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "Добавить/Удалить точку Color Ramp"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "Изменена Color Ramp"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "Элемент %d"
@@ -3557,19 +3772,16 @@ msgid "RMB: Erase Point."
msgstr "ПКМ: Удалить точку."
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Remove Point from Line2D"
-msgstr "Удалена точка Ñ ÐºÑ€Ð¸Ð²Ð¾Ð¹"
+msgstr "Удалить точку Ñ ÐºÑ€Ð¸Ð²Ð¾Ð¹"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Add Point to Line2D"
msgstr "Добавить точку к кривой"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Move Point in Line2D"
-msgstr "Точка кривой передвинута"
+msgstr "Двигать точку в кривой"
#: editor/plugins/line_2d_editor_plugin.cpp
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -3581,7 +3793,7 @@ msgstr "Выбрать точки"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Shift+Drag: Select Control Points"
-msgstr "Shift+Тащить: Выбрать точки управлениÑ"
+msgstr "Shift+Drag: Выбрать точки управлениÑ"
#: editor/plugins/line_2d_editor_plugin.cpp
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -3602,7 +3814,6 @@ msgid "Add Point (in empty space)"
msgstr "Добавить точку (в пуÑтом проÑтранÑтрве)"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Split Segment (in line)"
msgstr "Разделить Ñегмент (в кривой)"
@@ -3793,6 +4004,20 @@ msgid "Remove Poly And Point"
msgstr "Удалить полигон и точку"
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "МаÑка выброÑа очищена"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "Генерировать AABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "Ошибка при загрузке изображениÑ:"
@@ -3805,8 +4030,8 @@ msgid "Set Emission Mask"
msgstr "УÑтановлена маÑка выброÑа"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
-msgstr "МаÑка выброÑа очищена"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -3816,6 +4041,27 @@ msgstr "МаÑка выброÑа загружена"
msgid "Generated Point Count:"
msgstr "КоличеÑтво Ñоздаваемых точек:"
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Среднее Ð²Ñ€ÐµÐ¼Ñ (Ñек.)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "УÑтановлена маÑка выброÑа"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "Создать из Ñцены"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Точек излучениÑ:"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr "Узел не Ñодержит геометрии."
@@ -3825,6 +4071,10 @@ msgid "Node does not contain geometry (faces)."
msgstr "Узел не Ñодержит геометрии (грани)."
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr "ТребуетÑÑ Ð¼Ð°Ñ‚ÐµÑ€Ð¸Ð°Ð» типа 'ParticlesMaterial'."
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "Грани не Ñодержат зоны!"
@@ -3834,14 +4084,14 @@ msgstr "Ðет граней!"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Generate AABB"
-msgstr "Сгенерировать AABB"
+msgstr "Генерировать AABB"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr "Создать излучатель из полиÑетки"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr "Создать излучатель из узла"
#: editor/plugins/particles_editor_plugin.cpp
@@ -3853,26 +4103,45 @@ msgid "Create Emitter"
msgstr "Создать излучатель"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
-msgstr "КоличеÑтво выброÑов:"
+msgid "Emission Points:"
+msgstr "Точек излучениÑ:"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr "Заполнение излучателÑ:"
+msgid "Surface Points"
+msgstr "Точки поверхноÑти"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "ПоверхноÑть"
+msgid "Surface Points+Normal (Directed)"
+msgstr "Точки поверхноÑти + Ðормаль(ÐаправленнаÑ)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "Объём"
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr "ИÑточник излучениÑ: "
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "Генерировать AABB"
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr "Удалена точка Ñ ÐºÑ€Ð¸Ð²Ð¾Ð¹"
#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "Передвинут выходной луч у кривой"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "Удалена точка Ñ ÐºÑ€Ð¸Ð²Ð¾Ð¹"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr "Добавить точку к кривой"
@@ -3927,6 +4196,16 @@ msgstr "Разделить путь"
msgid "Remove Path Point"
msgstr "Удалить точку пути"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Передвинут выходной луч у кривой"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "Передвинут входной луч у кривой"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "Создать UV карту"
@@ -4080,6 +4359,11 @@ msgid "Pitch"
msgstr "Ð’Ñ‹Ñота"
#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "ОчиÑтить коÑти"
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr "Ошибка во Ð²Ñ€ÐµÐ¼Ñ ÑÐ¾Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ñ‚ÐµÐ¼Ñ‹"
@@ -4167,10 +4451,6 @@ msgstr "Ðайти.."
msgid "Find Next"
msgstr "Ðайти Ñледующее"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "Отладка"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr "Шаг через"
@@ -4204,16 +4484,9 @@ msgid "Move Right"
msgstr "Двигать вправо"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "Уроки"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "Открыть https://godotengine.org Ñ Ñ€Ð°Ð·Ð´ÐµÐ»Ð¾Ð¼ уроков."
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "КлаÑÑÑ‹"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "ПоиÑк Ñправочной документации."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
@@ -4232,9 +4505,8 @@ msgid "Go to next edited document."
msgstr "Перейти к Ñледующему редактируемому документу."
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Discard"
-msgstr "ДиÑкретнаÑ"
+msgstr "СброÑ"
#: editor/plugins/script_editor_plugin.cpp
msgid "Create Script"
@@ -4272,6 +4544,23 @@ msgid "Pick Color"
msgstr "Выбрать цвет"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "Преобразование изображений"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4322,8 +4611,16 @@ msgid "Trim Trailing Whitespace"
msgstr "Удаление пробелов в конце Ñтрок"
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
-msgstr "ÐвтоотÑтуп"
+msgstr "Ðвто отÑтуп"
#: editor/plugins/script_text_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
@@ -4343,6 +4640,16 @@ msgid "Goto Previous Breakpoint"
msgstr "Перейти к предыдущей точке оÑтановки"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "Конвертировать в.."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Конвертировать в.."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "Ðайти предыдущее"
@@ -4365,6 +4672,10 @@ msgstr "Перейти к Ñтроке.."
msgid "Contextual Help"
msgstr "КонтекÑÑ‚Ð½Ð°Ñ Ñправка"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr "Изменена чиÑÐ»Ð¾Ð²Ð°Ñ ÐºÐ¾Ð½Ñтанта"
@@ -4582,36 +4893,106 @@ msgid "Animation Key Inserted."
msgstr "Ключ анимации вÑтавлен."
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Вперёд"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "В обратном направлении"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "КолёÑико вниз."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "ОбновлÑть при изменениÑÑ…"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "ОбновлÑть при изменениÑÑ…"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "ОбновлÑть при изменениÑÑ…"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "ВертекÑ"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr "СовмеÑтить Ñ Ð²Ð¸Ð´Ð¾Ð¼"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
-msgstr "Окружение"
+msgid "Display Normal"
+msgstr "Режим нормалей"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
-msgstr "ПроÑлушиватель звука"
+msgid "Display Wireframe"
+msgstr "Режим Ñетки"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
-msgstr "Вещицы"
+msgid "Display Overdraw"
+msgstr "Режим проÑвечиваниÑ"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
-msgstr "XForm диалоговое окно"
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Режим без теней"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Environment"
+msgstr "Окружение"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "Ðе выбрана Ñцена!"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Вещицы"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "ЭкземплÑÑ€ на курÑор"
+msgid "View Information"
+msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "Ðе возможно добавить Ñцену!"
+msgid "Audio Listener"
+msgstr "ПроÑлушиватель звука"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "XForm диалоговое окно"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4670,6 +5051,26 @@ msgid "Align Selection With View"
msgstr "СовмеÑтить выбранное Ñ Ð²Ð¸Ð´Ð¾Ð¼"
#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "Выделение"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "ПеремеÑтить"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: Поворот"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "МаÑштаб:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
msgstr "Преобразование"
@@ -4682,14 +5083,6 @@ msgid "Transform Dialog.."
msgstr "Окно преобразованиÑ.."
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr "ИÑпользовать Ñтандартный Ñвет"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "ИÑпользовать sRGB"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
msgstr "1 Окно"
@@ -4714,22 +5107,6 @@ msgid "4 Viewports"
msgstr "4 Окна"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr "Режим нормалей"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr "Режим Ñетки"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr "Режим проÑвечиваниÑ"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr "Режим без теней"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr "Отображать начало координат"
@@ -4738,6 +5115,10 @@ msgid "View Grid"
msgstr "Отображать Ñетку"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "ÐаÑтройки"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "Параметры привÑзки"
@@ -4758,14 +5139,6 @@ msgid "Viewport Settings"
msgstr "ÐаÑтройки окна проÑмотра"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr "Образец Ñтандартного оÑвещениÑ:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr "Цвет окружающего Ñвета:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr "FOV перÑпективы (градуÑÑ‹):"
@@ -4940,7 +5313,7 @@ msgstr "Удалить Ñлемент клаÑÑа"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Create Empty Template"
-msgstr "Создать пуÑтой образец"
+msgstr "Создать пуÑтой шаблон"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Create Empty Editor Template"
@@ -5104,24 +5477,20 @@ msgid "Error"
msgstr "Ошибка"
#: editor/project_export.cpp
-#, fuzzy
msgid "Runnable"
-msgstr "Включить"
+msgstr "Ðктивный"
#: editor/project_export.cpp
-#, fuzzy
msgid "Delete patch '"
-msgstr "Удалить вход"
+msgstr "Удалить заплатку '"
#: editor/project_export.cpp
-#, fuzzy
msgid "Delete preset '%s'?"
-msgstr "Удалить выбранные файлы?"
+msgstr "Удалить '%s'?"
#: editor/project_export.cpp
-#, fuzzy
msgid "Presets"
-msgstr "ПредуÑтановка.."
+msgstr "ПредуÑтановки"
#: editor/project_export.cpp editor/project_settings.cpp
msgid "Add.."
@@ -5132,73 +5501,66 @@ msgid "Resources"
msgstr "РеÑурÑÑ‹"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export all resources in the project"
-msgstr "ЭкÑпортировать вÑе реÑурÑÑ‹ проекта."
+msgstr "ЭкÑпортировать вÑе реÑурÑÑ‹ проекта"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export selected scenes (and dependencies)"
-msgstr "ЭкÑпортировать выбранные реÑурÑÑ‹ (Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ð·Ð°Ð²Ð¸ÑимоÑти)."
+msgstr "ЭкÑпортировать выбранные Ñцены (Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ð·Ð°Ð²Ð¸ÑимоÑти)"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export selected resources (and dependencies)"
-msgstr "ЭкÑпортировать выбранные реÑурÑÑ‹ (Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ð·Ð°Ð²Ð¸ÑимоÑти)."
+msgstr "ЭкÑпортировать выбранные реÑурÑÑ‹ (Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ð·Ð°Ð²Ð¸ÑимоÑти)"
#: editor/project_export.cpp
msgid "Export Mode:"
msgstr "Режим ÑкÑпортированиÑ:"
#: editor/project_export.cpp
-#, fuzzy
msgid "Resources to export:"
msgstr "РеÑурÑÑ‹ Ð´Ð»Ñ ÑкÑпорта:"
#: editor/project_export.cpp
-#, fuzzy
msgid ""
"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"
msgstr ""
"Фильтр Ð´Ð»Ñ ÑкÑпорта не реÑурÑных файлов (через запÑтую, например: *.json, *."
-"txt):"
+"txt)"
#: editor/project_export.cpp
-#, fuzzy
msgid ""
"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)"
-msgstr "Фильтр Ð´Ð»Ñ Ð¸ÑÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ (через запÑтую, например: *.json, *.txt):"
+msgstr "Фильтр Ð´Ð»Ñ Ð¸ÑÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ (через запÑтую, например: *.json, *.txt)"
#: editor/project_export.cpp
-#, fuzzy
msgid "Patches"
-msgstr "СовпадениÑ:"
+msgstr "Латки"
#: editor/project_export.cpp
-#, fuzzy
msgid "Make Patch"
-msgstr "Целевой путь:"
+msgstr "Создать латку"
#: editor/project_export.cpp
msgid "Export templates for this platform are missing:"
-msgstr ""
+msgstr "Шаблоны ÑкÑпорта Ð´Ð»Ñ Ñтой платформы отÑутÑтвуют:"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export With Debug"
-msgstr "ЭкÑпортировать набор тайлов"
+msgstr "ЭкÑпорт в режиме отладки"
#: editor/project_manager.cpp
msgid "Invalid project path, the path must exist!"
msgstr "Ðеверный путь к проекту, путь должен ÑущеÑтвовать!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "ÐедопуÑтимый путь к проекту, godot.cfg не должен ÑущеÑтвовать."
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "ÐедопуÑтимый путь, не должен приÑутÑтвовать godot.cfg."
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr "ÐедопуÑтимый путь к проекту, godot.cfg должен ÑущеÑтвовать."
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "ÐедопуÑтимый путь, должен приÑутÑтвовать godot.cfg."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5209,8 +5571,9 @@ msgid "Invalid project path (changed anything?)."
msgstr "Ðеверный путь к проекту (Что-то изменили?)."
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
-msgstr "Ðе могу Ñоздать godot.cfg в папке проекта."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "Ðе удалоÑÑŒ Ñоздать godot.cfg в папке проекта."
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
@@ -5245,10 +5608,6 @@ msgid "Install Project:"
msgstr "УÑтановить проект:"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "УÑтановить"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "Обзор"
@@ -5309,6 +5668,11 @@ msgid "New Project"
msgstr "Ðовый проект"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Удалить шаблон"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "Выход"
@@ -5408,7 +5772,6 @@ msgid "Button 9"
msgstr "Кнопка 9"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Axis Index:"
msgstr "Ð˜Ð½Ð´ÐµÐºÑ Ð¾Ñи джойÑтика:"
@@ -5417,7 +5780,6 @@ msgid "Axis"
msgstr "ОÑÑŒ"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Button Index:"
msgstr "Ð˜Ð½Ð´ÐµÐºÑ ÐºÐ½Ð¾Ð¿ÐºÐ¸ джойÑтика:"
@@ -5429,6 +5791,11 @@ msgstr "Добавить дейÑтвие"
msgid "Erase Input Action Event"
msgstr "Удалить дейÑтвие"
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "Добавить пуÑтоту"
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "УÑтройÑтво"
@@ -5494,8 +5861,9 @@ msgid "Remove Resource Remap Option"
msgstr "Удалён параметр реÑурÑа перенаправлениÑ"
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr "ÐаÑтройки проекта (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "ÐаÑтройки проекта (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5561,22 +5929,17 @@ msgstr "Язык"
msgid "AutoLoad"
msgstr "Ðвтозагрузка"
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "Плагины"
-
#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Viewport"
-msgstr "1 Окно"
+msgstr "Выберите Viewport"
#: editor/property_editor.cpp
msgid "Ease In"
-msgstr "Легко в"
+msgstr "Переход В"
#: editor/property_editor.cpp
msgid "Ease Out"
-msgstr "Легко из"
+msgstr "Переход ИЗ"
#: editor/property_editor.cpp
msgid "Zero"
@@ -5584,11 +5947,11 @@ msgstr "Ðоль"
#: editor/property_editor.cpp
msgid "Easing In-Out"
-msgstr "Легко в-из"
+msgstr "Переход В-ИЗ"
#: editor/property_editor.cpp
msgid "Easing Out-In"
-msgstr "Легко из-в"
+msgstr "Переход ИЗ-В"
#: editor/property_editor.cpp
msgid "File.."
@@ -5607,22 +5970,16 @@ msgid "New Script"
msgstr "Ðовый Ñкрипт"
#: editor/property_editor.cpp
-#, fuzzy
msgid "Show in File System"
-msgstr "Ð¤Ð°Ð¹Ð»Ð¾Ð²Ð°Ñ ÑиÑтема"
+msgstr "Показать в файловой ÑиÑтеме"
#: editor/property_editor.cpp
msgid "Error loading file: Not a resource!"
msgstr "Ошибка загрузки файла: Это не реÑурÑ!"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "Ðевозможно загрузить изображение"
-
-#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Node"
-msgstr "Выбрать узел"
+msgstr "Выберите узел"
#: editor/property_editor.cpp
msgid "Bit %d, val %d."
@@ -5634,7 +5991,7 @@ msgstr "Вкл"
#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
msgid "Set"
-msgstr "Задан"
+msgstr "Задать"
#: editor/property_editor.cpp
msgid "Properties:"
@@ -5768,7 +6125,7 @@ msgstr "Эта Ð¾Ð¿ÐµÑ€Ð°Ñ†Ð¸Ñ Ð½Ðµ может быть выполнена бе
#: editor/scene_tree_dock.cpp
msgid "Can not perform with the root node."
-msgstr ""
+msgstr "Ðевозможно выполнить Ñ ÐºÐ¾Ñ€Ð½ÐµÐ¼."
#: editor/scene_tree_dock.cpp
msgid "This operation can't be done on instanced scenes."
@@ -5811,6 +6168,11 @@ msgid "Error duplicating scene to save it."
msgstr "Ошибка Ð´ÑƒÐ±Ð»Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ñцены, при её Ñохранении."
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "РеÑурÑÑ‹:"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "Редактировать группы"
@@ -5851,7 +6213,6 @@ msgid "Save Branch as Scene"
msgstr "Сохранить ветку, как Ñцену"
#: editor/scene_tree_dock.cpp
-#, fuzzy
msgid "Copy Node Path"
msgstr "Копировать путь"
@@ -5888,10 +6249,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "Переключена видимоÑть CanvasItem"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Параметры отладки"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "ЭкземплÑÑ€:"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Следующий Ñкрипт"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Переключена видимоÑть Spatial"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr "Ðекорректное Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð°, Ñледующие Ñимволы недопуÑтимы:"
@@ -5936,75 +6346,93 @@ msgid "Select a Node"
msgstr "Выбрать узел"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "ÐедопуÑтимое Ð¸Ð¼Ñ Ð²Ñ‹ÑˆÐµÑтоÑщего клаÑÑа"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Ðе удалоÑÑŒ Ñоздать Ñкрипт в файловой ÑиÑтеме."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "ДопуÑтимые Ñимволы:"
+msgid "Error loading script from %s"
+msgstr "Ошибка при загрузке Ñкрипта из %s"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "ÐедопуÑтимое Ð¸Ð¼Ñ ÐºÐ»Ð°ÑÑа"
+msgid "Path is empty"
+msgstr "Ðе указан путь"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "ДопуÑтимое имÑ"
+msgid "Path is not local"
+msgstr "Путь не локальный"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "Ð/Д"
+msgid "Invalid base path"
+msgstr "ÐедопуÑтимый базовый путь"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "Ð˜Ð¼Ñ ÐºÐ»Ð°ÑÑа ÑвлÑетÑÑ Ð½ÐµÐ´ÐµÐ¹Ñтвительным!"
+msgid "Invalid extension"
+msgstr "ÐедопуÑтимое раÑширение"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "Ð˜Ð¼Ñ Ð²Ñ‹ÑˆÐµÑтоÑщего клаÑÑа ÑвлÑетÑÑ Ð½ÐµÐ´ÐµÐ¹Ñтвительным!"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "ÐедопуÑтимый путь!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "ÐедопуÑтимый путь."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "Ðе удалоÑÑŒ Ñоздать Ñкрипт в файловой ÑиÑтеме."
+msgid "Invalid class name"
+msgstr "ÐедопуÑтимое Ð¸Ð¼Ñ ÐºÐ»Ð°ÑÑа"
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
-msgstr "Ошибка при загрузке Ñкрипта из %s"
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "Ðеверный Ð¸Ð½Ð´ÐµÐºÑ ÑвойÑтва имени."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "Ðе указан путь"
+#, fuzzy
+msgid "Script valid"
+msgstr "Скрипт"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "Путь не локальный"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "ÐедопуÑтимый базовый путь"
+msgid "N/A"
+msgstr "Ð/Д"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "ÐедопуÑтимое раÑширение"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+#, fuzzy
+msgid "Create new script file"
msgstr "Создать новый Ñкрипт"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+#, fuzzy
+msgid "Load existing script file"
msgstr "Загрузить ÑущеÑтвующий Ñкрипт"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "ÐаÑледует:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "Ð˜Ð¼Ñ ÐšÐ»Ð°ÑÑа:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Удалить шаблон"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "Ð’Ñтроенный Скрипт"
#: editor/script_create_dialog.cpp
@@ -6176,9 +6604,12 @@ msgid "Change Notifier Extents"
msgstr "Изменены границы уведомителÑ"
#: editor/spatial_editor_gizmos.cpp
-#, fuzzy
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
-msgstr "Изменены границы уведомителÑ"
+msgstr "Изменены Probe Extents"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6508,6 +6939,26 @@ msgstr "проÑто нажата"
msgid "just released"
msgstr "проÑто отпущена"
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr "ЗапуÑтить в браузере"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr "ЗапуÑтить HTML в Ñтандартном браузере ÑиÑтемы."
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr "Ðе удалоÑÑŒ запиÑать файл:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr "Ðе удалоÑÑŒ прочитать файл:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr "Ðе удалоÑÑŒ открыть шаблон Ð´Ð»Ñ ÑкÑпорта:\n"
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6673,11 +7124,11 @@ msgstr ""
"Узел ParallaxLayer работает только при уÑтановке его в качеÑтве дочернего "
"узла ParallaxBackground."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"Ð”Ð»Ñ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð¾Ð¹ работы ÑвойÑтво Path должно указывать на дейÑтвующий узел "
-"Particles2D."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6760,6 +7211,11 @@ msgstr ""
"NavigationMeshInstance должен быть дочерним или под-дочерним узлом "
"Navigation. Он предоÑтавлÑет только навигационные данные."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr "СвойÑтво Path должно указывать на дейÑтвительный Spatial узел."
@@ -6779,6 +7235,15 @@ msgstr ""
"Чтобы AnimatedSprite3D отображал кадры, пожалуйÑта уÑтановите или Ñоздайте "
"реÑÑƒÑ€Ñ SpriteFrames в параметре 'Frames'."
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "Режим запуÑка:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Внимание!"
@@ -6813,9 +7278,8 @@ msgid ""
"functions. Making them visible for editing is fine though, but they will "
"hide upon running."
msgstr ""
-"Ð’Ñплывающие окна будут ÑкрыватьÑÑ Ð¿Ð¾-умолчанию, еÑли Ð’Ñ‹ не вызовете popup() "
-"или любой из popup*(). Ð”ÐµÐ»Ð°Ñ Ð¸Ñ… доÑтупными Ð´Ð»Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ñ…Ð¾Ñ€Ð¾ÑˆÐ°Ñ Ð¼Ñ‹Ñль, "
-"Ñ…Ð¾Ñ‚Ñ Ð¾Ð½Ð¸ будут прÑтатьÑÑ Ð¿Ñ€Ð¸ запуÑке."
+"ПоÑле запуÑка вÑплывающие окна по-умолчанию Ñкрыты, Ð´Ð»Ñ Ð¸Ñ… Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ "
+"иÑпользуйте функцию popup() или любую из popup_*()."
#: scene/gui/scroll_container.cpp
msgid ""
@@ -6823,6 +7287,17 @@ msgid ""
"Use a container as child (VBox,HBox,etc), or a Control and set the custom "
"minimum size manually."
msgstr ""
+"ScrollContainer предназначен Ð´Ð»Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ Ñ Ð¾Ð´Ð½Ð¸Ð¼ дочерним Ñлементом "
+"управлениÑ.\n"
+"ИÑпользуйте дочерний контейнер (VBox, HBox и Ñ‚.д.), или Control и "
+"уÑтановите\n"
+"минимальный размер вручную."
+
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
#: scene/main/viewport.cpp
msgid ""
@@ -6837,6 +7312,74 @@ msgstr ""
"Ñделайте его целью рендеринга и передайте его внутренние текÑтуры какому-то "
"другому узлу Ð´Ð»Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ."
+#~ msgid "Node From Scene"
+#~ msgstr "Узел Ñо Ñцены"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Импортировать аÑÑеты в проект."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "ЭкÑпортировать проект на многие платформы."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "ОповещениÑ, когда внешний реÑÑƒÑ€Ñ Ð±Ñ‹Ð» изменён."
+
+#~ msgid "Tutorials"
+#~ msgstr "Уроки"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "Открыть https://godotengine.org Ñ Ñ€Ð°Ð·Ð´ÐµÐ»Ð¾Ð¼ уроков."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "Ðе выбрана Ñцена!"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "ЭкземплÑÑ€ на курÑор"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "Ðе возможно добавить Ñцену!"
+
+#~ msgid "Use Default Light"
+#~ msgstr "ИÑпользовать Ñтандартный Ñвет"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "ИÑпользовать sRGB"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "Образец Ñтандартного оÑвещениÑ:"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "Цвет окружающего Ñвета:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "Ðевозможно загрузить изображение"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "ÐедопуÑтимое Ð¸Ð¼Ñ Ð²Ñ‹ÑˆÐµÑтоÑщего клаÑÑа"
+
+#~ msgid "Valid chars:"
+#~ msgstr "ДопуÑтимые Ñимволы:"
+
+#~ msgid "Valid name"
+#~ msgstr "ДопуÑтимое имÑ"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "Ð˜Ð¼Ñ ÐºÐ»Ð°ÑÑа ÑвлÑетÑÑ Ð½ÐµÐ´ÐµÐ¹Ñтвительным!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "Ð˜Ð¼Ñ Ð²Ñ‹ÑˆÐµÑтоÑщего клаÑÑа ÑвлÑетÑÑ Ð½ÐµÐ´ÐµÐ¹Ñтвительным!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "ÐедопуÑтимый путь!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Ð”Ð»Ñ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð¾Ð¹ работы ÑвойÑтво Path должно указывать на дейÑтвующий узел "
+#~ "Particles2D."
+
+#~ msgid "Surface"
+#~ msgstr "ПоверхноÑть"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
@@ -6881,33 +7424,51 @@ msgstr ""
#~ msgid "No exporter for platform '%s' yet."
#~ msgstr "Платформа '%s' пока не поддерживаетÑÑ."
-#, fuzzy
#~ msgid "Create Android keystore"
-#~ msgstr "Создать новый реÑурÑ"
+#~ msgstr "Создать keystore Ð´Ð»Ñ Android"
-#, fuzzy
#~ msgid "Full name"
-#~ msgstr "ДопуÑтимое имÑ"
+#~ msgstr "Полное имÑ"
+
+#~ msgid "Organizational unit"
+#~ msgstr "Подразделение"
-#, fuzzy
#~ msgid "Organization"
-#~ msgstr "Переход"
+#~ msgstr "ОрганизациÑ"
+
+#~ msgid "City"
+#~ msgstr "Город"
-#, fuzzy
#~ msgid "State"
-#~ msgstr "СтатуÑ:"
+#~ msgstr "ГоÑударÑтво"
+
+#~ msgid "2 letter country code"
+#~ msgstr "Двух буквенный код Ñтраны"
+
+#~ msgid "User alias"
+#~ msgstr "ПÑевдоним пользователÑ"
-#, fuzzy
#~ msgid "Password"
-#~ msgstr "Пароль:"
+#~ msgstr "Пароль"
-#, fuzzy
#~ msgid "at least 6 characters"
-#~ msgstr "ДопуÑтимые Ñимволы:"
+#~ msgstr "минимум 6 Ñимволов"
-#, fuzzy
#~ msgid "File name"
-#~ msgstr "Ðовое имÑ:"
+#~ msgstr "Ð˜Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð°"
+
+#~ msgid "Path : (better to save outside of project)"
+#~ msgstr "Путь: (лучше Ñохранить за пределами проекта)"
+
+#~ msgid ""
+#~ "Release keystore is not set.\n"
+#~ "Do you want to create one?"
+#~ msgstr ""
+#~ "Релизный keystore не задан.\n"
+#~ "Хотите Ñоздать новый?"
+
+#~ msgid "Fill Keystore/Release User and Release Password"
+#~ msgstr "Заполните раздел Keystore"
#~ msgid "Include"
#~ msgstr "Включить"
@@ -7035,9 +7596,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "Удаление тишины:"
-#~ msgid "Script"
-#~ msgstr "Скрипт"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Режим ÑкÑÐ¿Ð¾Ñ€Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ñкриптов:"
@@ -7071,9 +7629,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance не Ñодержит BakedLight реÑурÑ."
-#~ msgid "Vertex"
-#~ msgstr "ВертекÑ"
-
#~ msgid "Fragment"
#~ msgstr "Фрагмент"
@@ -7116,9 +7671,6 @@ msgstr ""
#~ msgid "Cannot go into subdir:"
#~ msgstr "Ðевозможно перейти в подпапку:"
-#~ msgid "Help"
-#~ msgstr "Справка"
-
#~ msgid "Imported Resources"
#~ msgstr "Импортированные реÑурÑÑ‹"
diff --git a/editor/translations/sk.po b/editor/translations/sk.po
index 162b618e73..0b30bc80f4 100644
--- a/editor/translations/sk.po
+++ b/editor/translations/sk.po
@@ -356,6 +356,176 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Konštanty:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Súbor:"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Popis:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connecting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Error making request"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -363,6 +533,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -376,10 +570,6 @@ msgid "Category:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Stránka:"
@@ -391,7 +581,7 @@ msgstr ""
msgid "Official"
msgstr ""
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Komunita"
@@ -411,20 +601,6 @@ msgstr ""
msgid "Call"
msgstr ""
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr ""
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr ""
@@ -474,13 +650,6 @@ msgid "Selection Only"
msgstr ""
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr ""
@@ -555,6 +724,7 @@ msgstr ""
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr ""
@@ -630,11 +800,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "Popis:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -665,6 +830,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -765,8 +931,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -776,6 +941,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -844,8 +1010,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Cesta:"
@@ -911,7 +1076,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1036,7 +1201,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1053,7 +1219,6 @@ msgid "Class:"
msgstr "Trieda:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1109,10 +1274,6 @@ msgstr ""
msgid "Clear"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1228,8 +1389,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1283,6 +1444,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1339,7 +1504,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1377,6 +1542,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1430,7 +1599,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1458,50 +1627,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1509,47 +1651,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1620,8 +1730,8 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
+#: editor/editor_node.cpp
+msgid "Editor"
msgstr ""
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
@@ -1641,11 +1751,67 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1729,6 +1895,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1756,12 +1930,34 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Otvorit prieÄinok"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Otvorit prieÄinok"
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2004,6 +2200,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2032,10 +2232,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2202,7 +2398,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2677,7 +2873,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3337,7 +3533,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr ""
@@ -3386,15 +3582,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3425,6 +3612,33 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Signály:"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Všetky vybrané"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3694,6 +3908,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3706,7 +3933,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3717,6 +3944,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3726,6 +3970,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3738,11 +3986,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3754,26 +4002,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3828,6 +4092,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Všetky vybrané"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3981,6 +4254,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4069,10 +4346,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4106,15 +4379,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4169,6 +4434,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4219,6 +4500,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4240,6 +4529,14 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4262,6 +4559,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4479,35 +4780,95 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Shader Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4569,23 +4930,32 @@ msgid "Align Selection With View"
msgstr "Všetky vybrané"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "Všetky vybrané"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4613,27 +4983,15 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4657,14 +5015,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5078,11 +5428,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5094,7 +5444,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5130,10 +5480,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5192,6 +5538,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Všetky vybrané"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5310,6 +5661,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Zariadenie"
@@ -5375,7 +5730,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5442,10 +5797,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5496,10 +5847,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "Vložiť"
@@ -5685,6 +6032,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5761,10 +6112,57 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Popis:"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5809,77 +6207,87 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
+msgid "Error - Could not create script in filesystem."
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
+msgid "Error loading script from %s"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
+msgid "Invalid Path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
+msgid "Invalid inherited parent name or path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "Popis:"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr "Popis:"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Class Name"
+msgstr "Trieda:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr "Všetky vybrané"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6052,6 +6460,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6375,6 +6787,26 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr ""
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6521,8 +6953,10 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
#: scene/2d/path_2d.cpp
@@ -6585,6 +7019,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6600,6 +7039,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr ""
@@ -6642,6 +7089,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
diff --git a/editor/translations/sl.po b/editor/translations/sl.po
index b8965f6ca2..e50f907b65 100644
--- a/editor/translations/sl.po
+++ b/editor/translations/sl.po
@@ -356,6 +356,174 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "View Files"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Zapri"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connecting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Error making request"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -363,6 +531,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -376,10 +568,6 @@ msgid "Category:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr ""
@@ -391,7 +579,7 @@ msgstr ""
msgid "Official"
msgstr ""
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr ""
@@ -411,20 +599,6 @@ msgstr ""
msgid "Call"
msgstr ""
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Zapri"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr ""
@@ -474,13 +648,6 @@ msgid "Selection Only"
msgstr ""
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr ""
@@ -555,6 +722,7 @@ msgstr ""
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr ""
@@ -630,11 +798,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -665,6 +828,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -765,8 +929,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -776,6 +939,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -844,8 +1008,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr ""
@@ -911,7 +1074,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1036,7 +1199,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1053,7 +1217,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1108,10 +1271,6 @@ msgstr ""
msgid "Clear"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1227,8 +1386,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1282,6 +1441,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1338,7 +1501,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1376,6 +1539,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1428,7 +1595,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1456,50 +1623,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1507,47 +1647,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1618,9 +1726,10 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr ""
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Uredi"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1639,11 +1748,67 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1727,6 +1892,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1754,12 +1927,32 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+msgid "Open 2D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 3D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2002,6 +2195,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2030,10 +2227,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2199,7 +2392,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2674,7 +2867,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3334,7 +3527,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr ""
@@ -3383,15 +3576,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3422,6 +3606,33 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "Dodaj Signal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Odstrani Signal"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3691,6 +3902,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3703,7 +3927,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3714,6 +3938,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3723,6 +3964,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3735,11 +3980,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3751,26 +3996,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3825,6 +4086,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Odstrani Funkcijo"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3978,6 +4248,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4066,10 +4340,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4103,15 +4373,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4166,6 +4428,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4216,6 +4494,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4237,6 +4523,14 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4259,6 +4553,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4476,35 +4774,96 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Spremeni"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4564,23 +4923,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "Izbriši Izbrano"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4608,27 +4976,15 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4652,14 +5008,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5072,11 +5420,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5088,7 +5436,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5124,10 +5472,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5186,6 +5530,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Odstrani Spremenljivko"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5304,6 +5653,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr ""
@@ -5369,7 +5722,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5436,10 +5789,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5489,10 +5838,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
msgid "Pick a Node"
msgstr ""
@@ -5678,6 +6023,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5752,10 +6101,56 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Open script"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5800,75 +6195,86 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
+msgid "Error - Could not create script in filesystem."
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
+msgid "Error loading script from %s"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr ""
+#, fuzzy
+msgid "Invalid Path"
+msgstr ": Neveljavni argumenti: "
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "Neveljaven indeks lastnosti imena."
+
+#: editor/script_create_dialog.cpp
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Create new script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Class Name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Odstrani Spremenljivko"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6040,6 +6446,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6368,6 +6778,26 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr ""
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6520,8 +6950,10 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
#: scene/2d/path_2d.cpp
@@ -6584,6 +7016,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6599,6 +7036,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr ""
@@ -6641,6 +7086,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
diff --git a/editor/translations/th.po b/editor/translations/th.po
new file mode 100644
index 0000000000..9e140b2375
--- /dev/null
+++ b/editor/translations/th.po
@@ -0,0 +1,7477 @@
+# Thai translation of the Godot Engine editor
+# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
+# This file is distributed under the same license as the Godot source code.
+#
+# Kaveeta Vivatchai <goodytong@gmail.com>, 2017.
+# Poommetee Ketson (Noshyaar) <poommetee@protonmail.com>, 2017.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Godot Engine editor\n"
+"PO-Revision-Date: 2017-05-08 10:38+0000\n"
+"Last-Translator: Noshyaar <poommetee@protonmail.com>\n"
+"Language-Team: Thai <https://hosted.weblate.org/projects/godot-engine/godot/"
+"th/>\n"
+"Language: th\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: Weblate 2.14-dev\n"
+
+#: editor/animation_editor.cpp
+msgid "Disabled"
+msgstr "ปิดใช้งาน"
+
+#: editor/animation_editor.cpp
+msgid "All Selection"
+msgstr "เลือà¸à¸—ั้งหมด"
+
+#: editor/animation_editor.cpp
+#, fuzzy
+msgid "Move Add Key"
+msgstr "เลื่อนหรือเพิ่มคีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Transition"
+msgstr "à¹à¸à¹‰à¹„ขทรานสิชันà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Transform"
+msgstr "เคลื่อนย้ายà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Value"
+msgstr "à¹à¸à¹‰à¹„ขค่าà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Call"
+msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¹€à¸£à¸µà¸¢à¸à¸Ÿà¸±à¸‡à¸à¹Œà¸Šà¸±à¸™à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Track"
+msgstr "เพิ่มà¹à¸—ร็à¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Duplicate Keys"
+msgstr "ทำซ้ำคีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Move Anim Track Up"
+msgstr "เลื่อนà¹à¸—ร็à¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸‚ึ้น"
+
+#: editor/animation_editor.cpp
+msgid "Move Anim Track Down"
+msgstr "เลื่อนà¹à¸—ร็à¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸¥à¸‡"
+
+#: editor/animation_editor.cpp
+msgid "Remove Anim Track"
+msgstr "ลบà¹à¸—ร็à¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Set Transitions to:"
+msgstr "à¸à¸³à¸«à¸™à¸”ทรานสิชันเป็น:"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Rename"
+msgstr "เปลี่ยนชื่อà¹à¸—ร็à¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Interpolation"
+msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¹€à¸Šà¸·à¹ˆà¸­à¸¡à¹à¸—ร็à¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Value Mode"
+msgstr "เปลี่ยนโหมดà¹à¸—ร็à¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Wrap Mode"
+msgstr "เปลี่ยนโหมดวนซ้ำà¹à¸—ร็à¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Edit Node Curve"
+msgstr "à¹à¸à¹‰à¹„ขเส้นโค้งโหนด"
+
+#: editor/animation_editor.cpp
+msgid "Edit Selection Curve"
+msgstr "à¹à¸à¹‰à¹„ขเส้นโค้งà¸à¸²à¸£à¹€à¸¥à¸·à¸­à¸"
+
+#: editor/animation_editor.cpp
+msgid "Anim Delete Keys"
+msgstr "ลบคีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
+msgid "Duplicate Selection"
+msgstr "ทำซ้ำในà¹à¸—ร็à¸à¹€à¸”ิม"
+
+#: editor/animation_editor.cpp
+msgid "Duplicate Transposed"
+msgstr "ทำซ้ำในà¹à¸—ร็à¸à¸—ี่เลือà¸"
+
+#: editor/animation_editor.cpp
+msgid "Remove Selection"
+msgstr "ลบที่เลือà¸"
+
+#: editor/animation_editor.cpp
+msgid "Continuous"
+msgstr "ผันà¹à¸›à¸£"
+
+#: editor/animation_editor.cpp
+msgid "Discrete"
+msgstr "ค้าง"
+
+#: editor/animation_editor.cpp
+msgid "Trigger"
+msgstr "ไม่ค้าง"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Key"
+msgstr "เพิ่มคีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Move Keys"
+msgstr "ย้ายคีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Scale Selection"
+msgstr "ปรับอัตราส่วนเวลาคีย์ที่เลือà¸"
+
+#: editor/animation_editor.cpp
+msgid "Scale From Cursor"
+msgstr "ปรับอัตราส่วนเวลาตามเคอร์เซอร์"
+
+#: editor/animation_editor.cpp
+msgid "Goto Next Step"
+msgstr "ถัดไป"
+
+#: editor/animation_editor.cpp
+msgid "Goto Prev Step"
+msgstr "à¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+
+#: editor/animation_editor.cpp editor/property_editor.cpp
+msgid "Linear"
+msgstr "เส้นตรง"
+
+#: editor/animation_editor.cpp editor/plugins/theme_editor_plugin.cpp
+msgid "Constant"
+msgstr "คงที่"
+
+#: editor/animation_editor.cpp
+msgid "In"
+msgstr "เข้า"
+
+#: editor/animation_editor.cpp
+msgid "Out"
+msgstr "ออà¸"
+
+#: editor/animation_editor.cpp
+msgid "In-Out"
+msgstr "เข้า-ออà¸"
+
+#: editor/animation_editor.cpp
+msgid "Out-In"
+msgstr "ออà¸-เข้า"
+
+#: editor/animation_editor.cpp
+msgid "Transitions"
+msgstr "ทรานสิชัน"
+
+#: editor/animation_editor.cpp
+msgid "Optimize Animation"
+msgstr "เพิ่มประสิทธิภาพà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up Animation"
+msgstr "เà¸à¹‡à¸šà¸à¸§à¸²à¸”à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Create NEW track for %s and insert key?"
+msgstr "เพิ่มà¹à¸—ร็à¸à¹ƒà¸«à¸¡à¹ˆà¸ªà¸³à¸«à¸£à¸±à¸š %s à¹à¸¥à¸°à¹€à¸žà¸´à¹ˆà¸¡à¸„ีย์?"
+
+#: editor/animation_editor.cpp
+msgid "Create %d NEW tracks and insert keys?"
+msgstr "เพิ่ม %d à¹à¸—ร็à¸à¹ƒà¸«à¸¡à¹ˆà¹à¸¥à¸°à¹€à¸žà¸´à¹ˆà¸¡à¸„ีย์?"
+
+#: editor/animation_editor.cpp editor/create_dialog.cpp
+#: editor/editor_audio_buses.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp editor/project_manager.cpp
+#: editor/script_create_dialog.cpp
+msgid "Create"
+msgstr "สร้าง"
+
+#: editor/animation_editor.cpp
+msgid "Anim Create & Insert"
+msgstr "สร้างà¹à¸¥à¸°à¹à¸—รà¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert Track & Key"
+msgstr "เพิ่มà¹à¸—ร็à¸à¹à¸¥à¸°à¸„ีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert Key"
+msgstr "à¹à¸—รà¸à¸„ีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Change Anim Len"
+msgstr "ปรับความยาวà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Change Anim Loop"
+msgstr "ปรับà¸à¸²à¸£à¸§à¸™à¸‹à¹‰à¸³à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Create Typed Value Key"
+msgstr "สร้างคีย์ระบุประเภทà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert"
+msgstr "à¹à¸—รà¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Scale Keys"
+msgstr "ปรับคีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Call Track"
+msgstr "เพิ่มà¹à¸—ร็à¸à¸Ÿà¸±à¸‡à¸à¹Œà¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Animation zoom."
+msgstr "ซูมà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Length (s):"
+msgstr "ความยาว (วินาที):"
+
+#: editor/animation_editor.cpp
+msgid "Animation length (in seconds)."
+msgstr "ความยาวà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™ (วินาที)"
+
+#: editor/animation_editor.cpp
+msgid "Step (s):"
+msgstr "ช่วง (วินาที):"
+
+#: editor/animation_editor.cpp
+msgid "Cursor step snap (in seconds)."
+msgstr "เลื่อนเคอร์เซอร์ในช่วง (วินาที)"
+
+#: editor/animation_editor.cpp
+msgid "Enable/Disable looping in animation."
+msgstr "เปิด/ปิดà¸à¸²à¸£à¸§à¸™à¸‹à¹‰à¸³à¸‚องà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Add new tracks."
+msgstr "เพิ่มà¹à¸—ร็à¸à¹ƒà¸«à¸¡à¹ˆ"
+
+#: editor/animation_editor.cpp
+msgid "Move current track up."
+msgstr "เลื่อนà¹à¸—ร็à¸à¸‚ึ้น"
+
+#: editor/animation_editor.cpp
+msgid "Move current track down."
+msgstr "เลื่อนà¹à¸—ร็à¸à¸¥à¸‡"
+
+#: editor/animation_editor.cpp
+msgid "Remove selected track."
+msgstr "ลบà¹à¸—ร็à¸à¸—ี่เลือà¸"
+
+#: editor/animation_editor.cpp
+msgid "Track tools"
+msgstr "เครื่องมือà¹à¸—ร็à¸"
+
+#: editor/animation_editor.cpp
+msgid "Enable editing of individual keys by clicking them."
+msgstr "เปิดà¸à¸²à¸£à¹à¸à¹‰à¹„ขคีย์โดยà¸à¸²à¸£à¸„ลิà¸"
+
+#: editor/animation_editor.cpp
+msgid "Anim. Optimizer"
+msgstr "ตัวเพิ่มประสิทธิภาพà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Max. Linear Error:"
+msgstr "คลาดเคลื่อนเชิงเส้นมาà¸à¸—ี่สุด:"
+
+#: editor/animation_editor.cpp
+msgid "Max. Angular Error:"
+msgstr "คลาดเคลื่อนเชิงมุมมาà¸à¸—ี่สุด:"
+
+#: editor/animation_editor.cpp
+msgid "Max Optimizable Angle:"
+msgstr "ปรับà¹à¸à¹‰à¹€à¸Šà¸´à¸‡à¸¡à¸¸à¸¡à¸¡à¸²à¸à¸—ี่สุด:"
+
+#: editor/animation_editor.cpp
+msgid "Optimize"
+msgstr "เพิ่มประสิทธิภาพ"
+
+#: editor/animation_editor.cpp
+msgid "Select an AnimationPlayer from the Scene Tree to edit animations."
+msgstr "เลือภAnimationPlayer จาà¸à¸œà¸±à¸‡à¸‰à¸²à¸à¹€à¸žà¸·à¹ˆà¸­à¹à¸à¹‰à¹„ขà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Key"
+msgstr "คีย์"
+
+#: editor/animation_editor.cpp
+msgid "Transition"
+msgstr "ทรานสิชัน"
+
+#: editor/animation_editor.cpp
+msgid "Scale Ratio:"
+msgstr "อัตราส่วนเวลา:"
+
+#: editor/animation_editor.cpp
+msgid "Call Functions in Which Node?"
+msgstr "เรียà¸à¸Ÿà¸±à¸‡à¸à¹Œà¸Šà¸±à¸™à¸‚องโหนดใด?"
+
+#: editor/animation_editor.cpp
+msgid "Remove invalid keys"
+msgstr "ลบคีย์ที่ผิดพลาด"
+
+#: editor/animation_editor.cpp
+msgid "Remove unresolved and empty tracks"
+msgstr "ลบà¹à¸—ร็à¸à¸§à¹ˆà¸²à¸‡à¹€à¸›à¸¥à¹ˆà¸²"
+
+#: editor/animation_editor.cpp
+msgid "Clean-up all animations"
+msgstr "เà¸à¹‡à¸šà¸à¸§à¸²à¸”ทุà¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up Animation(s) (NO UNDO!)"
+msgstr "เà¸à¹‡à¸šà¸à¸§à¸²à¸”à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™ (ย้อนà¸à¸¥à¸±à¸šà¹„ม่ได้!)"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up"
+msgstr "เà¸à¹‡à¸šà¸à¸§à¸²à¸”"
+
+#: editor/array_property_edit.cpp
+msgid "Resize Array"
+msgstr "ปรับขนาดอาร์เรย์"
+
+#: editor/array_property_edit.cpp
+msgid "Change Array Value Type"
+msgstr "เปลี่ยนประเภทตัวà¹à¸›à¸£à¹ƒà¸™à¸­à¸²à¸£à¹Œà¹€à¸£à¸¢à¹Œ"
+
+#: editor/array_property_edit.cpp
+msgid "Change Array Value"
+msgstr "เปลี่ยนค่าในอาร์เรย์"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "รุ่น:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "ค่าคงที่:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr " ไฟล์"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "รายละเอียด:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "ติดตั้ง"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "ปิด"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "เชื่อมโยง.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "เชื่อมไปยังโหนด:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "ไม่ทราบรูปà¹à¸šà¸šà¹„ฟล์ที่ร้องขอ:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸šà¸±à¸™à¸—ึà¸.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "เชื่อมโยง.."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "ทดสอบ"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "บันทึà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ªà¸œà¸´à¸”พลาด!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "ดาวน์โหลด"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "ทั้งหมด"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
+#: editor/quick_open.cpp editor/settings_config_dialog.cpp
+msgid "Search:"
+msgstr "ค้นหา:"
+
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "ค้นหา"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "นำเข้า"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "ปลั๊à¸à¸­à¸´à¸™"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Sort:"
+msgstr "เรียงตาม:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Reverse"
+msgstr "ย้อนà¸à¸¥à¸±à¸š"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Category:"
+msgstr "หมวดหมู่:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Site:"
+msgstr "ไซต์:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Support.."
+msgstr "à¸à¸²à¸£à¸ªà¸™à¸±à¸šà¸ªà¸™à¸¸à¸™.."
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Official"
+msgstr "ผู้พัฒนา"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+msgid "Community"
+msgstr "ชุมชน"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Testing"
+msgstr "ทดสอบ"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Assets ZIP File"
+msgstr "ไฟล์ ZIP"
+
+#: editor/call_dialog.cpp
+msgid "Method List For '%s':"
+msgstr "รายชื่อเมท็อดของ '%s':"
+
+#: editor/call_dialog.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Call"
+msgstr "เรียà¸"
+
+#: editor/call_dialog.cpp
+msgid "Method List:"
+msgstr "รายชื่อเมท็อด:"
+
+#: editor/call_dialog.cpp
+msgid "Arguments:"
+msgstr "ตัวà¹à¸›à¸£:"
+
+#: editor/call_dialog.cpp
+msgid "Return:"
+msgstr "คืนค่า:"
+
+#: editor/code_editor.cpp
+msgid "Go to Line"
+msgstr "ไปยังบรรทัด"
+
+#: editor/code_editor.cpp
+msgid "Line Number:"
+msgstr "บรรทัดที่:"
+
+#: editor/code_editor.cpp
+msgid "No Matches"
+msgstr "ไม่พบ"
+
+#: editor/code_editor.cpp
+msgid "Replaced %d occurrence(s)."
+msgstr "à¹à¸—นที่à¹à¸¥à¹‰à¸§ %d ครั้ง"
+
+#: editor/code_editor.cpp
+msgid "Replace"
+msgstr "à¹à¸—นที่"
+
+#: editor/code_editor.cpp
+msgid "Replace All"
+msgstr "à¹à¸—นที่ทั้งหมด"
+
+#: editor/code_editor.cpp
+msgid "Match Case"
+msgstr "ตรงตามอัà¸à¸©à¸£à¸žà¸´à¸¡à¸žà¹Œà¹€à¸¥à¹‡à¸-ใหà¸à¹ˆ"
+
+#: editor/code_editor.cpp
+msgid "Whole Words"
+msgstr "ทั้งคำ"
+
+#: editor/code_editor.cpp
+msgid "Selection Only"
+msgstr "เฉพาะที่à¸à¸³à¸¥à¸±à¸‡à¹€à¸¥à¸·à¸­à¸"
+
+#: editor/code_editor.cpp editor/editor_help.cpp
+msgid "Find"
+msgstr "ค้นหา"
+
+#: editor/code_editor.cpp
+msgid "Next"
+msgstr "ต่อไป"
+
+#: editor/code_editor.cpp
+msgid "Not found!"
+msgstr "ไม่พบ!"
+
+#: editor/code_editor.cpp
+msgid "Replace By"
+msgstr "à¹à¸—นที่ด้วย"
+
+#: editor/code_editor.cpp
+msgid "Case Sensitive"
+msgstr "ตรงตามอัà¸à¸©à¸£à¸žà¸´à¸¡à¸žà¹Œà¹€à¸¥à¹‡à¸-ใหà¸à¹ˆ"
+
+#: editor/code_editor.cpp
+msgid "Backwards"
+msgstr "ย้อนà¸à¸¥à¸±à¸š"
+
+#: editor/code_editor.cpp
+msgid "Prompt On Replace"
+msgstr "เตือนà¸à¹ˆà¸­à¸™à¹à¸—นที่"
+
+#: editor/code_editor.cpp
+msgid "Skip"
+msgstr "ข้าม"
+
+#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom In"
+msgstr "ขยาย"
+
+#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Out"
+msgstr "ย่อ"
+
+#: editor/code_editor.cpp
+msgid "Reset Zoom"
+msgstr "รีเซ็ตซูม"
+
+#: editor/code_editor.cpp editor/script_editor_debugger.cpp
+msgid "Line:"
+msgstr "บรรทัด:"
+
+#: editor/code_editor.cpp
+msgid "Col:"
+msgstr "คอลัมน์:"
+
+#: editor/connections_dialog.cpp
+msgid "Method in target Node must be specified!"
+msgstr "ต้องระบุเมท็อดในโหนดปลายทาง!"
+
+#: editor/connections_dialog.cpp
+msgid ""
+"Target method not found! Specify a valid method or attach a script to target "
+"Node."
+msgstr "ไม่พบเมท็อดปลายทาง! ระบุเมท็อดให้ถูà¸à¸•้องหรือเพิ่มสคริปต์ในโหนดปลายทาง"
+
+#: editor/connections_dialog.cpp
+msgid "Connect To Node:"
+msgstr "เชื่อมไปยังโหนด:"
+
+#: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp
+#: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_settings.cpp
+msgid "Add"
+msgstr "เพิ่ม"
+
+#: editor/connections_dialog.cpp editor/dependency_editor.cpp
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
+msgid "Remove"
+msgstr "ลบ"
+
+#: editor/connections_dialog.cpp
+msgid "Add Extra Call Argument:"
+msgstr "เพิ่มตัวà¹à¸›à¸£:"
+
+#: editor/connections_dialog.cpp
+msgid "Extra Call Arguments:"
+msgstr "ตัวà¹à¸›à¸£à¹€à¸žà¸´à¹ˆà¸¡à¹€à¸•ิม:"
+
+#: editor/connections_dialog.cpp
+msgid "Path to Node:"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่โหนด:"
+
+#: editor/connections_dialog.cpp
+msgid "Make Function"
+msgstr "สร้างฟังà¸à¹Œà¸Šà¸±à¸™"
+
+#: editor/connections_dialog.cpp
+msgid "Deferred"
+msgstr "เรียà¸à¸ à¸²à¸¢à¸«à¸¥à¸±à¸‡"
+
+#: editor/connections_dialog.cpp
+msgid "Oneshot"
+msgstr "ครั้งเดียว"
+
+#: editor/connections_dialog.cpp
+msgid "Connect"
+msgstr "เชื่อม"
+
+#: editor/connections_dialog.cpp
+msgid "Connect '%s' to '%s'"
+msgstr "เชื่อม '%s' à¸à¸±à¸š '%s'"
+
+#: editor/connections_dialog.cpp
+msgid "Connecting Signal:"
+msgstr "เชื่อมโยงสัà¸à¸à¸²à¸“:"
+
+#: editor/connections_dialog.cpp
+msgid "Create Subscription"
+msgstr "ลบà¸à¸²à¸£à¹€à¸Šà¸·à¹ˆà¸­à¸¡à¹‚ยง"
+
+#: editor/connections_dialog.cpp
+msgid "Connect.."
+msgstr "เชื่อมโยง.."
+
+#: editor/connections_dialog.cpp
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Disconnect"
+msgstr "ลบà¸à¸²à¸£à¹€à¸Šà¸·à¹ˆà¸­à¸¡à¹‚ยง"
+
+#: editor/connections_dialog.cpp editor/node_dock.cpp
+msgid "Signals"
+msgstr "สัà¸à¸à¸²à¸“"
+
+#: editor/create_dialog.cpp
+msgid "Create New"
+msgstr "สร้างใหม่"
+
+#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/filesystem_dock.cpp
+msgid "Favorites:"
+msgstr "ที่ชื่นชอบ:"
+
+#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
+msgid "Recent:"
+msgstr "ล่าสุด:"
+
+#: editor/create_dialog.cpp editor/editor_help.cpp
+#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
+#: editor/quick_open.cpp
+msgid "Matches:"
+msgstr "พบ:"
+
+#: editor/dependency_editor.cpp
+msgid "Search Replacement For:"
+msgstr "หาตัวà¹à¸—นของ:"
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies For:"
+msgstr "à¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¸‚อง:"
+
+#: editor/dependency_editor.cpp
+msgid ""
+"Scene '%s' is currently being edited.\n"
+"Changes will not take effect unless reloaded."
+msgstr ""
+"ฉาภ'%s' à¸à¸³à¸¥à¸±à¸‡à¸–ูà¸à¹€à¸›à¸´à¸”à¹à¸à¹‰à¹„ข\n"
+"à¸à¸²à¸£à¹à¸à¹‰à¹„ขจะไม่ส่งผลจนà¸à¸§à¹ˆà¸²à¸ˆà¸°à¹‚หลดใหม่"
+
+#: editor/dependency_editor.cpp
+msgid ""
+"Resource '%s' is in use.\n"
+"Changes will take effect when reloaded."
+msgstr ""
+"รีซอร์ส '%s' à¸à¸³à¸¥à¸±à¸‡à¸–ูà¸à¹ƒà¸Šà¹‰à¸‡à¸²à¸™\n"
+"à¸à¸²à¸£à¹à¸à¹‰à¹„ขจะไม่ส่งผลจนà¸à¸§à¹ˆà¸²à¸ˆà¸°à¹‚หลดใหม่"
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies"
+msgstr "à¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡"
+
+#: editor/dependency_editor.cpp
+msgid "Resource"
+msgstr "รีซอร์ส"
+
+#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
+#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
+msgid "Path"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡"
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies:"
+msgstr "à¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡:"
+
+#: editor/dependency_editor.cpp
+msgid "Fix Broken"
+msgstr "ซ่อมà¹à¸‹à¸¡"
+
+#: editor/dependency_editor.cpp
+msgid "Dependency Editor"
+msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡"
+
+#: editor/dependency_editor.cpp
+msgid "Search Replacement Resource:"
+msgstr "ค้นหารีซอร์สมาà¹à¸—นที่:"
+
+#: editor/dependency_editor.cpp
+msgid "Owners Of:"
+msgstr "เจ้าของของ:"
+
+#: editor/dependency_editor.cpp
+msgid ""
+"The files being removed are required by other resources in order for them to "
+"work.\n"
+"Remove them anyway? (no undo)"
+msgstr ""
+"มีรีซอร์สอื่นต้องà¸à¸²à¸£à¹„ฟล์ที่à¸à¸³à¸¥à¸±à¸‡à¸¥à¸š\n"
+"ยืนยันจะลบหรือไม่? (ย้อนà¸à¸¥à¸±à¸šà¹„ม่ได้)"
+
+#: editor/dependency_editor.cpp
+msgid "Remove selected files from the project? (no undo)"
+msgstr "ลบไฟล์ที่เลือà¸à¸­à¸­à¸à¸ˆà¸²à¸à¹‚ปรเจà¸à¸•์? (ย้อนà¸à¸¥à¸±à¸šà¹„ม่ได้)"
+
+#: editor/dependency_editor.cpp
+msgid "Error loading:"
+msgstr "ผิดพลาดขณะโหลด:"
+
+#: editor/dependency_editor.cpp
+msgid "Scene failed to load due to missing dependencies:"
+msgstr "โหลดฉาà¸à¹„ม่ได้เนื่องจาà¸à¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¸ªà¸¹à¸à¸«à¸²à¸¢:"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+msgid "Open Anyway"
+msgstr "ยืนยันเปิดไฟล์"
+
+#: editor/dependency_editor.cpp
+msgid "Which action should be taken?"
+msgstr "จะทำอย่างไรต่อไป?"
+
+#: editor/dependency_editor.cpp
+msgid "Fix Dependencies"
+msgstr "ซ่อมà¹à¸‹à¸¡à¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡"
+
+#: editor/dependency_editor.cpp
+msgid "Errors loading!"
+msgstr "ผิดพลาดขณะโหลด!"
+
+#: editor/dependency_editor.cpp
+msgid "Permanently delete %d item(s)? (No undo!)"
+msgstr "ลบ %d ไฟล์ถาวร? (ย้อนà¸à¸¥à¸±à¸šà¹„ม่ได้!)"
+
+#: editor/dependency_editor.cpp
+msgid "Owns"
+msgstr "เป็นเจ้าของ"
+
+#: editor/dependency_editor.cpp
+msgid "Resources Without Explicit Ownership:"
+msgstr "รีซอร์สที่ไม่มีเจ้าของที่ชัดเจน:"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+msgid "Orphan Resource Explorer"
+msgstr "ตัวจัดà¸à¸²à¸£à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ªà¸—ี่ไม่มีเจ้าของ"
+
+#: editor/dependency_editor.cpp
+msgid "Delete selected files?"
+msgstr "ลบไฟล์ที่เลือ�"
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+#: editor/filesystem_dock.cpp editor/plugins/item_list_editor_plugin.cpp
+#: editor/project_export.cpp editor/scene_tree_dock.cpp
+msgid "Delete"
+msgstr "ลบ"
+
+#: editor/editor_audio_buses.cpp
+msgid "Save Audio Bus Layout As.."
+msgstr "บันทึà¸à¹€à¸¥à¸¢à¹Œà¹€à¸­à¸²à¸•์ของ Audio Bus เป็น.."
+
+#: editor/editor_audio_buses.cpp
+msgid "Location for New Layout.."
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸‚องเลย์เอาต์ใหม่.."
+
+#: editor/editor_audio_buses.cpp
+msgid "Open Audio Bus Layout"
+msgstr "เปิดเลย์เอาต์ของ Audio Bus"
+
+#: editor/editor_audio_buses.cpp
+msgid "Add Bus"
+msgstr "เพิ่ม Bus"
+
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
+msgid "Load"
+msgstr "โหลด"
+
+#: editor/editor_audio_buses.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Save As"
+msgstr "บันทึà¸à¹€à¸›à¹‡à¸™"
+
+#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
+msgid "Default"
+msgstr "ค่าเริ่มต้น"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name."
+msgstr "ชื่อผิดพลาด"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Valid characters:"
+msgstr "ตัวอัà¸à¸©à¸£à¸—ี่ใช้ได้:"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing engine class name."
+msgstr "ชื่อผิดพลาด ต้องไม่ใช้ชื่อเดียวà¸à¸±à¸šà¸„ลาสของโปรà¹à¸à¸£à¸¡"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing buit-in type name."
+msgstr "ชื่อผิดพลาด ต้องไม่ใช้ชื่อเดียวà¸à¸±à¸šà¸Šà¸™à¸´à¸”ตัวà¹à¸›à¸£"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing global constant name."
+msgstr "ชื่อผิดพลาด ต้องไม่ใช้ชื่อเดียวà¸à¸±à¸šà¸„่าคงที่"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid Path."
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸œà¸´à¸”พลาด"
+
+#: editor/editor_autoload_settings.cpp
+msgid "File does not exist."
+msgstr "ไม่พบไฟล์"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Not in resource path."
+msgstr "ไม่อยู่ในโฟลเดอร์รีซอร์ส"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Add AutoLoad"
+msgstr "เพิ่มออโต้โหลด"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Autoload '%s' already exists!"
+msgstr "มีออโต้โหลด '%s' อยู่à¹à¸¥à¹‰à¸§!"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Rename Autoload"
+msgstr "เปลี่ยนชื่อออโต้โหลด"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Toggle AutoLoad Globals"
+msgstr "เปิด/ปิดซิงเà¸à¸´à¸¥à¸•ัน"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Move Autoload"
+msgstr "เลื่อนออโต้โหลด"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Remove Autoload"
+msgstr "ลบออโต้โหลด"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Enable"
+msgstr "เปิด"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Rearrange Autoloads"
+msgstr "จัดลำดับออโต้โหลด"
+
+#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
+msgid "Path:"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡:"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Node Name:"
+msgstr "ชื่อโหนด:"
+
+#: editor/editor_autoload_settings.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Name"
+msgstr "ชื่อ"
+
+#: editor/editor_autoload_settings.cpp
+msgid "Singleton"
+msgstr "ซิงเà¸à¸´à¸¥à¸•ัน"
+
+#: editor/editor_autoload_settings.cpp
+msgid "List:"
+msgstr "รายชื่อ:"
+
+#: editor/editor_data.cpp
+msgid "Updating Scene"
+msgstr "อัพเดทฉาà¸"
+
+#: editor/editor_data.cpp
+msgid "Storing local changes.."
+msgstr "เà¸à¹‡à¸šà¸à¸²à¸£à¹€à¸›à¸¥à¸µà¹ˆà¸¢à¸™à¹à¸›à¸¥à¸‡à¸ à¸²à¸¢à¹ƒà¸™.."
+
+#: editor/editor_data.cpp
+msgid "Updating scene.."
+msgstr "อัพเดทฉาà¸.."
+
+#: editor/editor_dir_dialog.cpp
+msgid "Choose a Directory"
+msgstr "เลือà¸à¹‚ฟลเดอร์"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: scene/gui/file_dialog.cpp
+msgid "Create Folder"
+msgstr "สร้างโฟลเดอร์"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/editor_plugin_settings.cpp editor/plugins/theme_editor_plugin.cpp
+#: editor/project_export.cpp scene/gui/file_dialog.cpp
+msgid "Name:"
+msgstr "ชื่อ:"
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: scene/gui/file_dialog.cpp
+msgid "Could not create folder."
+msgstr "ไม่สามารถสร้างโฟลเดอร์"
+
+#: editor/editor_dir_dialog.cpp
+msgid "Choose"
+msgstr "เลือà¸"
+
+#: editor/editor_export.cpp
+msgid "Storing File:"
+msgstr "เà¸à¹‡à¸šà¹„ฟล์:"
+
+#: editor/editor_export.cpp
+msgid "Packing"
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸£à¸§à¸šà¸£à¸§à¸¡"
+
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
+msgid "Template file not found:\n"
+msgstr "ไม่พบà¹à¸¡à¹ˆà¹à¸šà¸š:\n"
+
+#: editor/editor_export.cpp
+msgid "Added:"
+msgstr "เพิ่ม:"
+
+#: editor/editor_export.cpp
+msgid "Removed:"
+msgstr "ลบ:"
+
+#: editor/editor_export.cpp
+msgid "Error saving atlas:"
+msgstr "ผิดพลาดขณะบันทึภatlas:"
+
+#: editor/editor_export.cpp
+msgid "Could not save atlas subtexture:"
+msgstr "บันทึภtexture ย่อยของ atlas ไม่ได้:"
+
+#: editor/editor_export.cpp
+msgid "Exporting for %s"
+msgstr "ส่งออà¸à¸ªà¸³à¸«à¸£à¸±à¸š %s"
+
+#: editor/editor_export.cpp
+msgid "Setting Up.."
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸•ั้งค่า.."
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "File Exists, Overwrite?"
+msgstr "มีไฟล์นี้อยู่à¹à¸¥à¹‰à¸§ จะเขียนทับหรือไม่?"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "All Recognized"
+msgstr "ทุà¸à¸™à¸²à¸¡à¸ªà¸¸à¸à¸¥à¸—ี่รู้จัà¸"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "All Files (*)"
+msgstr "ทุà¸à¹„ฟล์ (*)"
+
+#: editor/editor_file_dialog.cpp editor/editor_help.cpp editor/editor_node.cpp
+#: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/property_selector.cpp editor/quick_open.cpp scene/gui/file_dialog.cpp
+msgid "Open"
+msgstr "เปิด"
+
+#: editor/editor_file_dialog.cpp editor/editor_node.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp scene/gui/file_dialog.cpp
+msgid "Save"
+msgstr "บันทึà¸"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Save a File"
+msgstr "บันทึà¸à¹„ฟล์"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Back"
+msgstr "ย้อนà¸à¸¥à¸±à¸š"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Forward"
+msgstr "ไปหน้า"
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Up"
+msgstr "ขึ้นบน"
+
+#: editor/editor_file_dialog.cpp
+msgid "Refresh"
+msgstr "รีเฟรช"
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Hidden Files"
+msgstr "เปิด/ปิดไฟล์ที่ซ่อน"
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Favorite"
+msgstr "เลือà¸/ลบโฟลเดอร์ที่ชอบ"
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Mode"
+msgstr "สลับโหมด"
+
+#: editor/editor_file_dialog.cpp
+#, fuzzy
+msgid "Focus Path"
+msgstr "à¹à¸à¹‰à¹„ขตำà¹à¸«à¸™à¹ˆà¸‡"
+
+#: editor/editor_file_dialog.cpp
+msgid "Move Favorite Up"
+msgstr "เลื่อนโฟลเดอร์ที่ชอบขึ้น"
+
+#: editor/editor_file_dialog.cpp
+msgid "Move Favorite Down"
+msgstr "เลื่อนโฟลเดอร์ที่ชอบลง"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Directories & Files:"
+msgstr "ไฟล์à¹à¸¥à¸°à¹‚ฟลเดอร์:"
+
+#: editor/editor_file_dialog.cpp
+msgid "Preview:"
+msgstr "ตัวอย่าง:"
+
+#: editor/editor_file_dialog.cpp editor/script_editor_debugger.cpp
+#: scene/gui/file_dialog.cpp
+msgid "File:"
+msgstr "ไฟล์:"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Filter:"
+msgstr "ตัวà¸à¸£à¸­à¸‡:"
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Must use a valid extension."
+msgstr "นามสà¸à¸¸à¸¥à¹„ฟล์ไม่ถูà¸à¸•้อง"
+
+#: editor/editor_file_system.cpp
+msgid "ScanSources"
+msgstr ""
+
+#: editor/editor_file_system.cpp
+msgid "(Re)Importing Assets"
+msgstr "นำเข้าอีà¸à¸„รั้ง"
+
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search Help"
+msgstr "ค้นหาในคู่มือ"
+
+#: editor/editor_help.cpp
+msgid "Class List:"
+msgstr "รายชื่อคลาส:"
+
+#: editor/editor_help.cpp
+msgid "Search Classes"
+msgstr "ค้นหาคลาส"
+
+#: editor/editor_help.cpp editor/property_editor.cpp
+msgid "Class:"
+msgstr "คลาส:"
+
+#: editor/editor_help.cpp editor/scene_tree_editor.cpp
+msgid "Inherits:"
+msgstr "สืบทอดจาà¸:"
+
+#: editor/editor_help.cpp
+msgid "Inherited by:"
+msgstr "สืบทอดโดย:"
+
+#: editor/editor_help.cpp
+msgid "Brief Description:"
+msgstr "รายละเอียด:"
+
+#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Members:"
+msgstr "ตัวà¹à¸›à¸£:"
+
+#: editor/editor_help.cpp
+msgid "Public Methods:"
+msgstr "เมท็อด:"
+
+#: editor/editor_help.cpp
+#, fuzzy
+msgid "GUI Theme Items:"
+msgstr "ธีมหน้าต่าง:"
+
+#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Signals:"
+msgstr "สัà¸à¸à¸²à¸“:"
+
+#: editor/editor_help.cpp
+msgid "Constants:"
+msgstr "ค่าคงที่:"
+
+#: editor/editor_help.cpp
+msgid "Property Description:"
+msgstr "รายละเอียดตัวà¹à¸›à¸£:"
+
+#: editor/editor_help.cpp
+msgid "Method Description:"
+msgstr "รายละเอียดเมท็อด:"
+
+#: editor/editor_help.cpp
+msgid "Search Text"
+msgstr "ค้นหาคำ"
+
+#: editor/editor_log.cpp
+msgid " Output:"
+msgstr " ข้อความ:"
+
+#: editor/editor_log.cpp editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/rich_text_editor_plugin.cpp editor/property_editor.cpp
+#: editor/script_editor_debugger.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Clear"
+msgstr "ลบ"
+
+#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
+#: editor/resources_dock.cpp
+msgid "Error saving resource!"
+msgstr "บันทึà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ªà¸œà¸´à¸”พลาด!"
+
+#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
+#: editor/resources_dock.cpp
+msgid "Save Resource As.."
+msgstr "บันทึà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ªà¹€à¸›à¹‡à¸™.."
+
+#: editor/editor_node.cpp editor/export_template_manager.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "I see.."
+msgstr "ตà¸à¸¥à¸‡.."
+
+#: editor/editor_node.cpp
+msgid "Can't open file for writing:"
+msgstr "เปิดไฟล์เพื่อเขียนไม่ได้:"
+
+#: editor/editor_node.cpp
+msgid "Requested file format unknown:"
+msgstr "ไม่ทราบรูปà¹à¸šà¸šà¹„ฟล์ที่ร้องขอ:"
+
+#: editor/editor_node.cpp
+msgid "Error while saving."
+msgstr "ผิดพลาดขณะบันทึà¸"
+
+#: editor/editor_node.cpp
+msgid "Saving Scene"
+msgstr "บันทึà¸à¸‰à¸²à¸"
+
+#: editor/editor_node.cpp
+msgid "Analyzing"
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸§à¸´à¹€à¸„ราะห์"
+
+#: editor/editor_node.cpp
+msgid "Creating Thumbnail"
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸ªà¸£à¹‰à¸²à¸‡à¸£à¸¹à¸›à¸•ัวอย่าง"
+
+#: editor/editor_node.cpp
+msgid ""
+"Couldn't save scene. Likely dependencies (instances) couldn't be satisfied."
+msgstr "บันทึà¸à¸‰à¸²à¸à¹„ม่ได้ อาจจะมีà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¹„ม่สมบูรณ์"
+
+#: editor/editor_node.cpp
+msgid "Failed to load resource."
+msgstr "โหลดรีซอร์สไม่ได้"
+
+#: editor/editor_node.cpp
+msgid "Can't load MeshLibrary for merging!"
+msgstr "โหลด MeshLibrary เพื่อรวมไม่ได้!"
+
+#: editor/editor_node.cpp
+msgid "Error saving MeshLibrary!"
+msgstr "ผิดพลาดขณะบันทึภMeshLibrary!"
+
+#: editor/editor_node.cpp
+msgid "Can't load TileSet for merging!"
+msgstr "โหลด TileSet เพื่อรวมไม่ได้!"
+
+#: editor/editor_node.cpp
+msgid "Error saving TileSet!"
+msgstr "ผิดพลาดขณะบันทึภTileSet!"
+
+#: editor/editor_node.cpp
+msgid "Error trying to save layout!"
+msgstr "ผิดพลาดขณะบันทึà¸à¹€à¸¥à¸¢à¹Œà¹€à¸­à¸²à¸•์!"
+
+#: editor/editor_node.cpp
+msgid "Default editor layout overridden."
+msgstr "à¹à¸—นที่เลย์เอาต์เริ่มต้น"
+
+#: editor/editor_node.cpp
+msgid "Layout name not found!"
+msgstr "ไม่พบชื่อเลย์เอาต์!"
+
+#: editor/editor_node.cpp
+msgid "Restored default layout to base settings."
+msgstr "คืนเลย์เอาต์เป็นค่าเริ่มต้น"
+
+#: editor/editor_node.cpp
+msgid "Copy Params"
+msgstr "คัดลอà¸à¸•ัวà¹à¸›à¸£"
+
+#: editor/editor_node.cpp
+msgid "Paste Params"
+msgstr "วางตัวà¹à¸›à¸£"
+
+#: editor/editor_node.cpp editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Paste Resource"
+msgstr "วางรีซอร์ส"
+
+#: editor/editor_node.cpp
+msgid "Copy Resource"
+msgstr "คัดลอà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ª"
+
+#: editor/editor_node.cpp
+msgid "Make Built-In"
+msgstr "à¸à¸±à¸‡"
+
+#: editor/editor_node.cpp
+msgid "Make Sub-Resources Unique"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open in Help"
+msgstr "เปิดในคู่มือ"
+
+#: editor/editor_node.cpp
+msgid "There is no defined scene to run."
+msgstr "ไม่ได้à¸à¸³à¸«à¸™à¸”ฉาà¸à¹€à¸£à¸´à¹ˆà¸¡à¸•้น"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid ""
+"No main scene has ever been defined, select one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+"ยังไม่ได้à¸à¸³à¸«à¸™à¸”ฉาà¸à¹€à¸£à¸´à¹ˆà¸¡à¸•้น à¸à¸³à¸«à¸™à¸”ตอนนี้หรือไม่?\n"
+"สามารถà¹à¸à¹‰à¹„ขภายหลังที่ \"ตัวเลือà¸à¹‚ปรเจà¸à¸•์\" ใต้หัวข้อ 'application'"
+
+#: editor/editor_node.cpp
+msgid ""
+"Selected scene '%s' does not exist, select a valid one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+"ไม่มีฉาภ'%s' ที่เลือà¸à¹„ว้ เลือà¸à¹ƒà¸«à¸¡à¹ˆà¸•อนนี้หรือไม่?\n"
+"สามารถà¹à¸à¹‰à¹„ขภายหลังที่ \"ตัวเลือà¸à¹‚ปรเจà¸à¸•์\" ใต้หัวข้อ 'application'"
+
+#: editor/editor_node.cpp
+msgid ""
+"Selected scene '%s' is not a scene file, select a valid one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+"'%s' ไม่ใช่ไฟล์ฉาภเลือà¸à¹ƒà¸«à¸¡à¹ˆà¸•อนนี้หรือไม่?\n"
+"สามารถà¹à¸à¹‰à¹„ขภายหลังที่ \"ตัวเลือà¸à¹‚ปรเจà¸à¸•์\" ใต้หัวข้อ 'application'"
+
+#: editor/editor_node.cpp
+msgid "Current scene was never saved, please save it prior to running."
+msgstr "ฉาà¸à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™à¸¢à¸±à¸‡à¹„ม่ได้บันทึภà¸à¸£à¸¸à¸“าบันทึà¸à¸à¹ˆà¸­à¸™à¹€à¸£à¸´à¹ˆà¸¡à¹‚ปรà¹à¸à¸£à¸¡"
+
+#: editor/editor_node.cpp
+msgid "Could not start subprocess!"
+msgstr "ไม่สามารถเริ่มขั้นตอนย่อย!"
+
+#: editor/editor_node.cpp
+msgid "Open Scene"
+msgstr "เปิดไฟล์ฉาà¸"
+
+#: editor/editor_node.cpp
+msgid "Open Base Scene"
+msgstr "เปิดไฟล์ฉาà¸à¸—ี่ใช้สืบทอด"
+
+#: editor/editor_node.cpp
+msgid "Quick Open Scene.."
+msgstr "เปิดไฟล์ฉาà¸à¸”่วน.."
+
+#: editor/editor_node.cpp
+msgid "Quick Open Script.."
+msgstr "เปิดไฟล์สคริปต์ด่วน.."
+
+#: editor/editor_node.cpp
+msgid "Yes"
+msgstr "ใช่"
+
+#: editor/editor_node.cpp
+msgid "Close scene? (Unsaved changes will be lost)"
+msgstr "ปิดไฟล์ฉาà¸? (à¸à¸²à¸£à¹à¸à¹‰à¹„ขที่ไม่ได้บันทึà¸à¸ˆà¸°à¸ªà¸¹à¸à¸«à¸²à¸¢)"
+
+#: editor/editor_node.cpp
+msgid "Save Scene As.."
+msgstr "บันทึà¸à¸‰à¸²à¸à¹€à¸›à¹‡à¸™.."
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "โหนด"
+
+#: editor/editor_node.cpp
+msgid "This scene has never been saved. Save before running?"
+msgstr "ฉาà¸à¸™à¸µà¹‰à¸¢à¸±à¸‡à¹„ม่ได้บันทึภบันทึà¸à¸à¹ˆà¸­à¸™à¹€à¸£à¸´à¹ˆà¸¡?"
+
+#: editor/editor_node.cpp
+msgid "Export Mesh Library"
+msgstr "ส่งออภMesh Library"
+
+#: editor/editor_node.cpp
+msgid "Export Tile Set"
+msgstr "ส่งออภTile Set"
+
+#: editor/editor_node.cpp
+msgid "Quit"
+msgstr "ออà¸"
+
+#: editor/editor_node.cpp
+msgid "Exit the editor?"
+msgstr "ออà¸à¹‚ปรà¹à¸à¸£à¸¡?"
+
+#: editor/editor_node.cpp
+msgid "Current scene not saved. Open anyway?"
+msgstr "ฉาà¸à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™à¸¢à¸±à¸‡à¹„ม่ได้บันทึภจะเปิดไฟล์หรือไม่?"
+
+#: editor/editor_node.cpp
+msgid "Can't reload a scene that was never saved."
+msgstr "ฉาà¸à¸¢à¸±à¸‡à¹„ม่ได้บันทึภไม่สามารถโหลดใหม่ได้"
+
+#: editor/editor_node.cpp
+msgid "Revert"
+msgstr "คืนà¸à¸¥à¸±à¸š"
+
+#: editor/editor_node.cpp
+msgid "This action cannot be undone. Revert anyway?"
+msgstr "à¸à¸²à¸£à¸„ืนà¸à¸¥à¸±à¸šà¹„ม่สามารถยà¸à¹€à¸¥à¸´à¸à¹„ด้ คืนà¸à¸¥à¸±à¸š?"
+
+#: editor/editor_node.cpp
+msgid "Quick Run Scene.."
+msgstr "เริ่มฉาà¸à¸”่วน.."
+
+#: editor/editor_node.cpp
+msgid ""
+"Open Project Manager? \n"
+"(Unsaved changes will be lost)"
+msgstr ""
+"เปิดตัวจัดà¸à¸²à¸£à¹‚ปรเจà¸à¸•์?\n"
+"(à¸à¸²à¸£à¹à¸à¹‰à¹„ขที่ไม่ได้บันทึà¸à¸ˆà¸°à¸ªà¸¹à¸à¸«à¸²à¸¢)"
+
+#: editor/editor_node.cpp
+msgid "Pick a Main Scene"
+msgstr "เลือà¸à¸‰à¸²à¸à¹€à¸£à¸´à¹ˆà¸¡à¸•้น"
+
+#: editor/editor_node.cpp
+msgid ""
+"Scene '%s' was automatically imported, so it can't be modified.\n"
+"To make changes to it, a new inherited scene can be created."
+msgstr ""
+"ฉาภ'%s' ถูà¸à¸™à¸³à¹€à¸‚้าโดยอัตโนมัติจึงไม่สามารถถูà¸à¹à¸à¹‰à¹„ข\n"
+"สามารถสืบทอดไปยังฉาà¸à¹ƒà¸«à¸¡à¹ˆà¹€à¸žà¸·à¹ˆà¸­à¸—ำà¸à¸²à¸£à¹à¸à¹‰à¹„ข"
+
+#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/scene_tree_dock.cpp
+msgid "Ugh"
+msgstr "เออะ"
+
+#: editor/editor_node.cpp
+msgid ""
+"Error loading scene, it must be inside the project path. Use 'Import' to "
+"open the scene, then save it inside the project path."
+msgstr ""
+"ผิดพลาดขณะโหลดฉาภฉาà¸à¸•้องอยู่ในโฟลเดอร์โปรเจà¸à¸•์ ใช้ 'Import' เพื่อเปิดไฟล์ฉาภ"
+"à¹à¸¥à¹‰à¸§à¸šà¸±à¸™à¸—ึà¸à¸¥à¸‡à¹ƒà¸™à¹‚ฟลเดอร์โปรเจà¸à¸•์"
+
+#: editor/editor_node.cpp
+msgid "Error loading scene."
+msgstr "ผิดพลาดขณะโหลดฉาà¸"
+
+#: editor/editor_node.cpp
+msgid "Scene '%s' has broken dependencies:"
+msgstr "ฉาภ'%s' มีà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¸ªà¸¹à¸à¸«à¸²à¸¢:"
+
+#: editor/editor_node.cpp
+msgid "Save Layout"
+msgstr "บันทึà¸à¹€à¸¥à¸¢à¹Œà¹€à¸­à¸²à¸•์"
+
+#: editor/editor_node.cpp
+msgid "Delete Layout"
+msgstr "ลบเลย์เอาต์"
+
+#: editor/editor_node.cpp
+msgid "Switch Scene Tab"
+msgstr "สลับฉาà¸"
+
+#: editor/editor_node.cpp
+msgid "%d more file(s)"
+msgstr "à¹à¸¥à¸°à¸­à¸µà¸ %d ไฟล์"
+
+#: editor/editor_node.cpp
+msgid "%d more file(s) or folder(s)"
+msgstr "à¹à¸¥à¸°à¸­à¸µà¸ %d ไฟล์หรือโฟลเดอร์"
+
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "โหมดไร้สิ่งรบà¸à¸§à¸™"
+
+#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Scene"
+msgstr "ฉาà¸"
+
+#: editor/editor_node.cpp
+msgid "Go to previously opened scene."
+msgstr "ไปยังฉาà¸à¸—ี่เพิ่งเปิด"
+
+#: editor/editor_node.cpp
+msgid "Next tab"
+msgstr "à¹à¸—็บต่อไป"
+
+#: editor/editor_node.cpp
+msgid "Previous tab"
+msgstr "à¹à¸—็บà¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+
+#: editor/editor_node.cpp
+msgid "Filter Files.."
+msgstr "คัดà¸à¸£à¸­à¸‡à¹„ฟล์.."
+
+#: editor/editor_node.cpp
+msgid "Operations with scene files."
+msgstr "à¸à¸²à¸£à¸ˆà¸±à¸”à¸à¸²à¸£à¸à¸±à¸šà¹„ฟล์ฉาà¸"
+
+#: editor/editor_node.cpp
+msgid "New Scene"
+msgstr "ฉาà¸à¹ƒà¸«à¸¡à¹ˆ"
+
+#: editor/editor_node.cpp
+msgid "New Inherited Scene.."
+msgstr "สืบทอดฉาà¸à¹ƒà¸«à¸¡à¹ˆ.."
+
+#: editor/editor_node.cpp
+msgid "Open Scene.."
+msgstr "เปิดไฟล์ฉาà¸.."
+
+#: editor/editor_node.cpp
+msgid "Save Scene"
+msgstr "บันทึà¸à¸‰à¸²à¸"
+
+#: editor/editor_node.cpp
+msgid "Save all Scenes"
+msgstr "บันทึà¸à¸—ุà¸à¸‰à¸²à¸"
+
+#: editor/editor_node.cpp
+msgid "Close Scene"
+msgstr "ปิดไฟล์ฉาà¸"
+
+#: editor/editor_node.cpp
+msgid "Close Goto Prev. Scene"
+msgstr "ปิดไปยังฉาà¸à¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Open Recent"
+msgstr "เปิดไฟล์ล่าสุด"
+
+#: editor/editor_node.cpp
+msgid "Convert To.."
+msgstr "à¹à¸›à¸¥à¸‡à¹€à¸›à¹‡à¸™.."
+
+#: editor/editor_node.cpp
+msgid "MeshLibrary.."
+msgstr "MeshLibrary.."
+
+#: editor/editor_node.cpp
+msgid "TileSet.."
+msgstr "TileSet.."
+
+#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Undo"
+msgstr "เลิà¸à¸—ำ"
+
+#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Redo"
+msgstr "ทำซ้ำ"
+
+#: editor/editor_node.cpp
+msgid "Revert Scene"
+msgstr "คืนà¸à¸¥à¸±à¸šà¸‰à¸²à¸"
+
+#: editor/editor_node.cpp
+msgid "Miscellaneous project or scene-wide tools."
+msgstr "โปรเจà¸à¸•์à¹à¸¥à¸°à¹€à¸„รื่องมืออื่น ๆ"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Project"
+msgstr "โปรเจà¸à¸•์ใหม่"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "ตัวเลือà¸à¹‚ปรเจà¸à¸•์"
+
+#: editor/editor_node.cpp
+msgid "Run Script"
+msgstr "รันสคริปต์"
+
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Export"
+msgstr "ส่งออà¸"
+
+#: editor/editor_node.cpp
+msgid "Tools"
+msgstr "เครื่องมือ"
+
+#: editor/editor_node.cpp
+msgid "Quit to Project List"
+msgstr "ปิดà¹à¸¥à¸°à¸à¸¥à¸±à¸šà¸ªà¸¹à¹ˆà¸£à¸²à¸¢à¸Šà¸·à¹ˆà¸­à¹‚ปรเจà¸à¸•์"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "ดีบัค"
+
+#: editor/editor_node.cpp
+msgid "Deploy with Remote Debug"
+msgstr "ส่งออà¸à¸”้วยรีโมทดีบัค"
+
+#: editor/editor_node.cpp
+msgid ""
+"When exporting or deploying, the resulting executable will attempt to "
+"connect to the IP of this computer in order to be debugged."
+msgstr "เมื่อส่งออภโปรà¹à¸à¸£à¸¡à¸ˆà¸°à¸žà¸¢à¸²à¸¢à¸²à¸¡à¹€à¸Šà¸·à¹ˆà¸­à¸¡à¸•่อมายังคอมพิวเตอร์เครื่องนี้เพื่อทำà¸à¸²à¸£à¸”ีบัค"
+
+#: editor/editor_node.cpp
+msgid "Small Deploy with Network FS"
+msgstr "ส่งออà¸à¹‚ดยใช้ระบบไฟล์เครือข่าย"
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is enabled, export or deploy will produce a minimal "
+"executable.\n"
+"The filesystem will be provided from the project by the editor over the "
+"network.\n"
+"On Android, deploy will use the USB cable for faster performance. This "
+"option speeds up testing for games with a large footprint."
+msgstr ""
+"ถ้าเปิดตัวเลือà¸à¸™à¸µà¹‰ ตัวเà¸à¸¡à¸—ี่ส่งออà¸à¸ˆà¸°à¸¡à¸µà¸‚นาดà¹à¸„่พอใช้งานได้\n"
+"ตัวเà¸à¸¡à¸ˆà¸°à¹„ด้รับระบบไฟล์จาà¸à¹‚ปรà¹à¸à¸£à¸¡à¹à¸à¹‰à¹„ขผ่านเครือข่าย\n"
+"à¸à¸²à¸£à¸ªà¹ˆà¸‡à¸­à¸­à¸à¸šà¸™ Android จะใช้สาย USB เพื่อให้เร็วขึ้น ตัวเลือà¸à¸™à¸µà¹‰à¸ˆà¸°à¸Šà¹ˆà¸§à¸¢à¹ƒà¸™à¸à¸²à¸£à¸—ดสอบเà¸à¸¡à¸—ี่มีขนาดใหà¸à¹ˆ"
+
+#: editor/editor_node.cpp
+msgid "Visible Collision Shapes"
+msgstr "รูปทรงà¸à¸²à¸¢à¸ à¸²à¸žà¸¡à¸­à¸‡à¹€à¸«à¹‡à¸™à¹„ด้"
+
+#: editor/editor_node.cpp
+msgid ""
+"Collision shapes and raycast nodes (for 2D and 3D) will be visible on the "
+"running game if this option is turned on."
+msgstr "รูปทรงà¸à¸²à¸¢à¸ à¸²à¸žà¹à¸¥à¸°à¸£à¸±à¸‡à¸ªà¸µ (2D à¹à¸¥à¸° 3D) จะมองเห็นได้ขณะเริ่มโปรà¹à¸à¸£à¸¡à¸–้าเปิดตัวเลือà¸à¸™à¸µà¹‰"
+
+#: editor/editor_node.cpp
+msgid "Visible Navigation"
+msgstr "เส้นนำทางมองเห็นได้"
+
+#: editor/editor_node.cpp
+msgid ""
+"Navigation meshes and polygons will be visible on the running game if this "
+"option is turned on."
+msgstr "รูปทรงที่มีเส้นนำทางจะมองเห็นได้เมื่อเริ่มโปรà¹à¸à¸£à¸¡à¸–้าเปิดตัวเลือà¸à¸™à¸µà¹‰"
+
+#: editor/editor_node.cpp
+msgid "Sync Scene Changes"
+msgstr "ซิงค์à¸à¸²à¸£à¹€à¸›à¸¥à¸µà¹ˆà¸¢à¸™à¹à¸›à¸¥à¸‡à¸‰à¸²à¸"
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is turned on, any changes made to the scene in the editor "
+"will be replicated in the running game.\n"
+"When used remotely on a device, this is more efficient with network "
+"filesystem."
+msgstr ""
+"ถ้าเปิดตัวเลือà¸à¸™à¸µà¹‰ โปรà¹à¸à¸£à¸¡à¸—ี่รันอยู่จะได้รับà¸à¸²à¸£à¹à¸à¹‰à¹„ขทันที\n"
+"เมื่อใช้à¸à¸±à¸šà¸­à¸¸à¸›à¸à¸£à¸“์à¹à¸šà¸šà¸£à¸µà¹‚มท จะดีà¸à¸§à¹ˆà¸²à¸–้าเปิดระบบไฟล์เครือข่ายด้วย"
+
+#: editor/editor_node.cpp
+msgid "Sync Script Changes"
+msgstr "ซิงค์à¸à¸²à¸£à¹à¸à¹‰à¹„ขสคริปต์"
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is turned on, any script that is saved will be reloaded on "
+"the running game.\n"
+"When used remotely on a device, this is more efficient with network "
+"filesystem."
+msgstr ""
+"เมื่อเปิดตัวเลือà¸à¸™à¸µà¹‰ สคริปต์ที่บันทึà¸à¸ˆà¸°à¹‚หลดในเà¸à¸¡à¸—ันที\n"
+"ถ้าใช้à¸à¸±à¸šà¸­à¸¸à¸›à¸à¸£à¸“์รีโมท จะดีà¸à¸§à¹ˆà¸²à¸–้าเปิดระบบไฟล์เครือข่ายด้วย"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "à¹à¸à¹‰à¹„ข"
+
+#: editor/editor_node.cpp editor/settings_config_dialog.cpp
+msgid "Editor Settings"
+msgstr "ตัวเลือà¸à¹‚ปรà¹à¸à¸£à¸¡à¸ªà¸£à¹‰à¸²à¸‡à¹€à¸à¸¡"
+
+#: editor/editor_node.cpp
+msgid "Editor Layout"
+msgstr "เลย์เอาต์โปรà¹à¸à¸£à¸¡"
+
+#: editor/editor_node.cpp
+msgid "Toggle Fullscreen"
+msgstr "สลับเต็มจอ"
+
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Manage Export Templates"
+msgstr "จัดà¸à¸²à¸£à¹à¸¡à¹ˆà¹à¸šà¸šà¸ªà¹ˆà¸‡à¸­à¸­à¸"
+
+#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "คลาส"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "ปิดคู่มือ"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "About"
+msgstr "เà¸à¸µà¹ˆà¸¢à¸§à¸à¸±à¸š"
+
+#: editor/editor_node.cpp
+msgid "Play the project."
+msgstr "เล่นโปรเจà¸à¸•์"
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "เล่น"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "หยุดชั่วคราว"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "หยุดชั่วคราว"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "หยุด"
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "หยุด"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "เล่นฉาà¸à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™"
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "เล่น"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "เลือà¸à¹€à¸¥à¹ˆà¸™à¸‰à¸²à¸"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "เลือà¸à¹€à¸¥à¹ˆà¸™à¸‰à¸²à¸"
+
+#: editor/editor_node.cpp
+msgid "Spins when the editor window repaints!"
+msgstr "หมุนเมื่อมีà¸à¸²à¸£à¸§à¸²à¸”หน้าต่างโปรà¹à¸à¸£à¸¡à¹ƒà¸«à¸¡à¹ˆ!"
+
+#: editor/editor_node.cpp
+msgid "Update Always"
+msgstr "อัพเดทตลอดเวลา"
+
+#: editor/editor_node.cpp
+msgid "Update Changes"
+msgstr "อัพเดทเมื่อเปลี่ยนà¹à¸›à¸¥à¸‡"
+
+#: editor/editor_node.cpp
+msgid "Disable Update Spinner"
+msgstr "ปิดà¸à¸²à¸£à¸­à¸±à¸žà¹€à¸”ทตัวหมุน"
+
+#: editor/editor_node.cpp
+msgid "Inspector"
+msgstr "คุณสมบัติ"
+
+#: editor/editor_node.cpp
+msgid "Create a new resource in memory and edit it."
+msgstr "สร้างรีซอร์สใหม่ในหน่วยความจำà¹à¸¥à¸°à¸—ำà¸à¸²à¸£à¸›à¸£à¸±à¸šà¹à¸•่ง"
+
+#: editor/editor_node.cpp
+msgid "Load an existing resource from disk and edit it."
+msgstr "โหลดรีซอร์สที่มีอยู่à¹à¸¥à¹‰à¸§à¹ƒà¸™à¸”ิสà¸à¹Œà¹à¸¥à¸°à¸—ำà¸à¸²à¸£à¸›à¸£à¸±à¸šà¹à¸•่ง"
+
+#: editor/editor_node.cpp
+msgid "Save the currently edited resource."
+msgstr "บันทึà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ªà¸—ี่à¸à¸³à¸¥à¸±à¸‡à¸›à¸£à¸±à¸šà¹à¸•่ง"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Save As.."
+msgstr "บันทึà¸à¹€à¸›à¹‡à¸™.."
+
+#: editor/editor_node.cpp
+msgid "Go to the previous edited object in history."
+msgstr "ไปยังวัตถุที่ปรับà¹à¸•่งà¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+
+#: editor/editor_node.cpp
+msgid "Go to the next edited object in history."
+msgstr "ไปยังวัตถุที่ปรับà¹à¸•่งต่อไป"
+
+#: editor/editor_node.cpp
+msgid "History of recently edited objects."
+msgstr "ประวัติà¸à¸²à¸£à¸›à¸£à¸±à¸šà¹à¸•่งวัตถุ"
+
+#: editor/editor_node.cpp
+msgid "Object properties."
+msgstr "คุณสมบัติวัตถุ"
+
+#: editor/editor_node.cpp
+msgid "FileSystem"
+msgstr "ระบบไฟล์"
+
+#: editor/editor_node.cpp editor/node_dock.cpp
+msgid "Node"
+msgstr "โหนด"
+
+#: editor/editor_node.cpp
+msgid "Output"
+msgstr "เอาท์พุต"
+
+#: editor/editor_node.cpp editor/editor_reimport_dialog.cpp
+msgid "Re-Import"
+msgstr "นำเข้าอีà¸à¸„รั้ง"
+
+#: editor/editor_node.cpp editor/editor_plugin_settings.cpp
+msgid "Update"
+msgstr "อัพเดท"
+
+#: editor/editor_node.cpp
+msgid "Thanks from the Godot community!"
+msgstr "ขอขอบคุณจาà¸à¸Šà¸¸à¸¡à¸Šà¸™à¸œà¸¹à¹‰à¹ƒà¸Šà¹‰ Godot!"
+
+#: editor/editor_node.cpp
+msgid "Thanks!"
+msgstr "ขอบคุณ!"
+
+#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Import Templates From ZIP File"
+msgstr "นำเข้าà¹à¸¡à¹ˆà¹à¸šà¸šà¸ˆà¸²à¸à¹„ฟล์ ZIP"
+
+#: editor/editor_node.cpp
+msgid "Export Project"
+msgstr "ส่งออà¸à¹‚ปรเจà¸à¸•์"
+
+#: editor/editor_node.cpp
+msgid "Export Library"
+msgstr "ส่งออà¸à¹„ลบรารี"
+
+#: editor/editor_node.cpp
+msgid "Merge With Existing"
+msgstr "รวมà¸à¸±à¸šà¸—ี่มีอยู่เดิม"
+
+#: editor/editor_node.cpp
+msgid "Password:"
+msgstr "รหัสผ่าน:"
+
+#: editor/editor_node.cpp
+msgid "Open & Run a Script"
+msgstr "เปิดà¹à¸¥à¸°à¸£à¸±à¸™à¸ªà¸„ริปต์"
+
+#: editor/editor_node.cpp
+msgid "Load Errors"
+msgstr "โหลดผิดพลาด"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "เปิดในโปรà¹à¸à¸£à¸¡à¹à¸à¹‰à¹„ข"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "เปิดในโปรà¹à¸à¸£à¸¡à¹à¸à¹‰à¹„ข"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "เปิดในโปรà¹à¸à¸£à¸¡à¹à¸à¹‰à¹„ข"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "ส่งออà¸à¹„ลบรารี"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "เปิดในโปรà¹à¸à¸£à¸¡à¹à¸à¹‰à¹„ข"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "เปิดในโปรà¹à¸à¸£à¸¡à¹à¸à¹‰à¹„ข"
+
+#: editor/editor_plugin_settings.cpp
+msgid "Installed Plugins:"
+msgstr "ปลั๊à¸à¸­à¸´à¸™à¸—ี่ติดตั้งà¹à¸¥à¹‰à¸§:"
+
+#: editor/editor_plugin_settings.cpp
+msgid "Author:"
+msgstr "โดย:"
+
+#: editor/editor_plugin_settings.cpp
+msgid "Status:"
+msgstr "สถานะ:"
+
+#: editor/editor_profiler.cpp
+msgid "Stop Profiling"
+msgstr "หยุดบันทึà¸"
+
+#: editor/editor_profiler.cpp
+msgid "Start Profiling"
+msgstr "เริ่มบันทึà¸"
+
+#: editor/editor_profiler.cpp
+msgid "Measure:"
+msgstr "วัด:"
+
+#: editor/editor_profiler.cpp
+msgid "Frame Time (sec)"
+msgstr "เวลาเฟรม (วินาที)"
+
+#: editor/editor_profiler.cpp
+msgid "Average Time (sec)"
+msgstr "เวลาเฉลี่ย (วินาที)"
+
+#: editor/editor_profiler.cpp
+msgid "Frame %"
+msgstr "เฟรม %"
+
+#: editor/editor_profiler.cpp
+msgid "Fixed Frame %"
+msgstr "เฟรมคงที่ %"
+
+#: editor/editor_profiler.cpp editor/script_editor_debugger.cpp
+msgid "Time:"
+msgstr "เวลา:"
+
+#: editor/editor_profiler.cpp
+msgid "Inclusive"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Self"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Frame #:"
+msgstr "เฟรมที่:"
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Please wait for scan to complete."
+msgstr "à¸à¸£à¸¸à¸“ารอให้à¸à¸²à¸£à¸ªà¹à¸à¸™à¹€à¸ªà¸£à¹‡à¸ˆ"
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Current scene must be saved to re-import."
+msgstr "ฉาà¸à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™à¸•้องบันทึà¸à¸à¹ˆà¸­à¸™à¸™à¸³à¹€à¸‚้าอีà¸à¸„รั้ง"
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Save & Re-Import"
+msgstr "บันทึà¸à¹à¸¥à¸°à¸™à¸³à¹€à¸‚้าอีà¸à¸„รั้ง"
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Re-Importing"
+msgstr "นำเข้าอีà¸à¸„รั้ง"
+
+#: editor/editor_reimport_dialog.cpp
+msgid "Re-Import Changed Resources"
+msgstr "นำเข้ารีซอร์สที่à¹à¸à¹‰à¹„ขอีà¸à¸„รั้ง"
+
+#: editor/editor_run_script.cpp
+msgid "Write your logic in the _run() method."
+msgstr "เขียนโปรà¹à¸à¸£à¸¡à¹ƒà¸™à¹€à¸¡à¸—็อด _run()"
+
+#: editor/editor_run_script.cpp
+msgid "There is an edited scene already."
+msgstr "มีฉาà¸à¸—ี่à¹à¸à¹‰à¹„ขอยู่à¹à¸¥à¹‰à¸§"
+
+#: editor/editor_run_script.cpp
+msgid "Couldn't instance script:"
+msgstr "สร้างอินสà¹à¸•นซ์ของสคริปต์ไม่ได้:"
+
+#: editor/editor_run_script.cpp
+msgid "Did you forget the 'tool' keyword?"
+msgstr "ลืมคีย์เวิร์ด 'tool' หรือไม่?"
+
+#: editor/editor_run_script.cpp
+msgid "Couldn't run script:"
+msgstr "รันสคริปต์ไม่ได้:"
+
+#: editor/editor_run_script.cpp
+msgid "Did you forget the '_run' method?"
+msgstr "ลืมใส่เมท็อด '_run' หรือไม่?"
+
+#: editor/editor_settings.cpp
+msgid "Default (Same as Editor)"
+msgstr "ค่าเริ่มต้น (เหมือนà¸à¸±à¸šà¹‚ปรà¹à¸à¸£à¸¡à¸ªà¸£à¹‰à¸²à¸‡à¹€à¸à¸¡)"
+
+#: editor/editor_sub_scene.cpp
+msgid "Select Node(s) to Import"
+msgstr "เลือà¸à¹‚หนดเพื่อนำเข้า"
+
+#: editor/editor_sub_scene.cpp
+msgid "Scene Path:"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่ฉาà¸:"
+
+#: editor/editor_sub_scene.cpp
+msgid "Import From Node:"
+msgstr "นำเข้าจาà¸à¹‚หนด:"
+
+#: editor/export_template_manager.cpp
+msgid "Re-Download"
+msgstr "ดาวน์โหลดอีà¸à¸„รั้ง"
+
+#: editor/export_template_manager.cpp
+msgid "Uninstall"
+msgstr "ถอนà¸à¸²à¸£à¸•ิดตั้ง"
+
+#: editor/export_template_manager.cpp
+msgid "(Installed)"
+msgstr "(ติดตั้งà¹à¸¥à¹‰à¸§)"
+
+#: editor/export_template_manager.cpp
+msgid "Download"
+msgstr "ดาวน์โหลด"
+
+#: editor/export_template_manager.cpp
+msgid "(Missing)"
+msgstr "(ไม่พบ)"
+
+#: editor/export_template_manager.cpp
+msgid "(Current)"
+msgstr "(ปัจจุบัน)"
+
+#: editor/export_template_manager.cpp
+msgid "Remove template version '%s'?"
+msgstr "ลบà¹à¸¡à¹ˆà¹à¸šà¸šà¸£à¸¸à¹ˆà¸™ '%s'?"
+
+#: editor/export_template_manager.cpp
+msgid "Can't open export templates zip."
+msgstr "เปิดไฟล์ zip à¹à¸¡à¹ˆà¹à¸šà¸šà¸ªà¹ˆà¸‡à¸­à¸­à¸à¹„ม่ได้"
+
+#: editor/export_template_manager.cpp
+msgid "Invalid version.txt format inside templates."
+msgstr "รูปà¹à¸šà¸šà¸‚อง version.txt ในà¹à¸¡à¹ˆà¹à¸šà¸šà¹„ม่ถูà¸à¸•้อง"
+
+#: editor/export_template_manager.cpp
+#, fuzzy
+msgid ""
+"Invalid version.txt format inside templates. Revision is not a valid "
+"identifier."
+msgstr "รูปà¹à¸šà¸šà¸‚อง version.txt ในà¹à¸¡à¹ˆà¹à¸šà¸šà¹„ม่ถูà¸à¸•้อง"
+
+#: editor/export_template_manager.cpp
+msgid "No version.txt found inside templates."
+msgstr "ไม่พบ version.txt ในà¹à¸¡à¹ˆà¹à¸šà¸š"
+
+#: editor/export_template_manager.cpp
+msgid "Error creating path for templates:\n"
+msgstr "ผิดพลาดขณะสร้างตำà¹à¸«à¸™à¹ˆà¸‡à¹à¸¡à¹ˆà¹à¸šà¸š:\n"
+
+#: editor/export_template_manager.cpp
+#, fuzzy
+msgid "Extracting Export Templates"
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¹‚หลดà¹à¸¡à¹ˆà¹à¸šà¸šà¸ªà¹ˆà¸‡à¸­à¸­à¸"
+
+#: editor/export_template_manager.cpp
+msgid "Importing:"
+msgstr "นำเข้า:"
+
+#: editor/export_template_manager.cpp
+msgid "Loading Export Templates"
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¹‚หลดà¹à¸¡à¹ˆà¹à¸šà¸šà¸ªà¹ˆà¸‡à¸­à¸­à¸"
+
+#: editor/export_template_manager.cpp
+msgid "Current Version:"
+msgstr "รุ่นปัจจุบัน:"
+
+#: editor/export_template_manager.cpp
+msgid "Installed Versions:"
+msgstr "รุ่นที่ติดตั้งà¹à¸¥à¹‰à¸§:"
+
+#: editor/export_template_manager.cpp
+msgid "Install From File"
+msgstr "ติดตั้งไฟล์à¹à¸¡à¹ˆà¹à¸šà¸š"
+
+#: editor/export_template_manager.cpp
+msgid "Remove Template"
+msgstr "ลบà¹à¸¡à¹ˆà¹à¸šà¸š"
+
+#: editor/export_template_manager.cpp
+msgid "Select template file"
+msgstr "เลือà¸à¹„ฟล์à¹à¸¡à¹ˆà¹à¸šà¸š"
+
+#: editor/export_template_manager.cpp
+msgid "Export Template Manager"
+msgstr "จัดà¸à¸²à¸£à¹à¸¡à¹ˆà¹à¸šà¸šà¸ªà¹ˆà¸‡à¸­à¸­à¸"
+
+#: editor/file_type_cache.cpp
+msgid "Can't open file_type_cache.cch for writing, not saving file type cache!"
+msgstr "เปิดไฟล์ file_type_cache.cch เพื่อเขียนไม่ได้ จะไม่บันทึà¸à¹à¸„ชของชนิดไฟล์!"
+
+#: editor/filesystem_dock.cpp
+msgid "Cannot navigate to '"
+msgstr "ไม่สามารถไปยัง '"
+
+#: editor/filesystem_dock.cpp
+msgid "Same source and destination files, doing nothing."
+msgstr "ไฟล์ต้นทางà¹à¸¥à¸°à¸›à¸¥à¸²à¸¢à¸—างเหมือนà¸à¸±à¸™ ไม่ทำอะไร"
+
+#: editor/filesystem_dock.cpp
+msgid "Same source and destination paths, doing nothing."
+msgstr "ไฟล์ต้นทางà¹à¸¥à¸°à¸›à¸¥à¸²à¸¢à¸—างอยู่ที่เดียวà¸à¸±à¸™ ไม่ทำอะไร"
+
+#: editor/filesystem_dock.cpp
+msgid "Can't move directories to within themselves."
+msgstr "ย้ายโฟลเดอร์เข้ามาในตัวเองไม่ได้"
+
+#: editor/filesystem_dock.cpp
+msgid "Can't operate on '..'"
+msgstr "ทำงานใน '..' ไม่ได้"
+
+#: editor/filesystem_dock.cpp
+msgid "Pick New Name and Location For:"
+msgstr "เลือà¸à¸Šà¸·à¹ˆà¸­à¹à¸¥à¸°à¸•ำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่ใหม่ให้à¸à¸±à¸š:"
+
+#: editor/filesystem_dock.cpp
+msgid "No files selected!"
+msgstr "ไม่ได้เลือà¸à¹„ฟล์ไว้!"
+
+#: editor/filesystem_dock.cpp
+msgid "Expand all"
+msgstr "ขยายโฟลเดอร์"
+
+#: editor/filesystem_dock.cpp
+msgid "Collapse all"
+msgstr "ยุบโฟลเดอร์"
+
+#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "à¹à¸ªà¸”งในตัวจัดà¸à¸²à¸£à¹„ฟล์"
+
+#: editor/filesystem_dock.cpp
+msgid "Instance"
+msgstr "อินสà¹à¸•นซ์"
+
+#: editor/filesystem_dock.cpp
+msgid "Edit Dependencies.."
+msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡.."
+
+#: editor/filesystem_dock.cpp
+msgid "View Owners.."
+msgstr "ดูเจ้าของ.."
+
+#: editor/filesystem_dock.cpp
+msgid "Copy Path"
+msgstr "คัดลอà¸à¸•ำà¹à¸«à¸™à¹ˆà¸‡"
+
+#: editor/filesystem_dock.cpp
+msgid "Rename or Move.."
+msgstr "เปลี่ยนชื่อหรือย้าย.."
+
+#: editor/filesystem_dock.cpp
+msgid "Move To.."
+msgstr "ย้ายไป.."
+
+#: editor/filesystem_dock.cpp
+msgid "Info"
+msgstr "ข้อมูล"
+
+#: editor/filesystem_dock.cpp
+msgid "Re-Import.."
+msgstr "นำเข้าอีà¸à¸„รั้ง.."
+
+#: editor/filesystem_dock.cpp
+msgid "Previous Directory"
+msgstr "โฟลเดอร์à¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+
+#: editor/filesystem_dock.cpp
+msgid "Next Directory"
+msgstr "โฟลเดอร์ถัดไป"
+
+#: editor/filesystem_dock.cpp
+msgid "Re-Scan Filesystem"
+msgstr "สà¹à¸à¸™à¸£à¸°à¸šà¸šà¹„ฟล์ใหม่"
+
+#: editor/filesystem_dock.cpp
+msgid "Toggle folder status as Favorite"
+msgstr "สลับà¸à¸²à¸£à¹€à¸›à¹‡à¸™à¹‚ฟลเดอร์ที่ชื่นชอบ"
+
+#: editor/filesystem_dock.cpp
+msgid "Instance the selected scene(s) as child of the selected node."
+msgstr "อินสà¹à¸•นซ์ฉาà¸à¸—ี่เลือà¸à¹ƒà¸«à¹‰à¹€à¸›à¹‡à¸™à¹‚หนดลูà¸à¸‚องโหนดที่เลือà¸"
+
+#: editor/filesystem_dock.cpp
+msgid "Move"
+msgstr "ย้าย"
+
+#: editor/groups_editor.cpp
+msgid "Add to Group"
+msgstr "เพิ่มไปยังà¸à¸¥à¸¸à¹ˆà¸¡"
+
+#: editor/groups_editor.cpp
+msgid "Remove from Group"
+msgstr "ลบออà¸à¸ˆà¸²à¸à¸à¸¥à¸¸à¹ˆà¸¡"
+
+#: editor/import/resource_importer_obj.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Surface %d"
+msgstr "%d พื้นผิว"
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Import Scene"
+msgstr "นำเข้าฉาà¸"
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Importing Scene.."
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸™à¸³à¹€à¸‚้าฉาà¸.."
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Running Custom Script.."
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸£à¸±à¸™à¸ªà¸„ริปต์.."
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't load post-import script:"
+msgstr "โหลดสคริปต์หลังนำเข้าไม่ได้:"
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Invalid/broken script for post-import (check console):"
+msgstr "สคริปต์หลังนำเข้าผิดพลาด (ตรวจสอบคอนโซล):"
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Error running post-import script:"
+msgstr "ผิดพลาดขณะรันสคริปต์หลังนำเข้า:"
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Saving.."
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸šà¸±à¸™à¸—ึà¸.."
+
+#: editor/import_dock.cpp
+msgid " Files"
+msgstr " ไฟล์"
+
+#: editor/import_dock.cpp
+msgid "Import As:"
+msgstr "นำเข้าเป็น:"
+
+#: editor/import_dock.cpp editor/property_editor.cpp
+msgid "Preset.."
+msgstr "à¹à¸šà¸š.."
+
+#: editor/import_dock.cpp
+msgid "Reimport"
+msgstr "นำเข้าใหม่"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "No bit masks to import!"
+msgstr "ไม่มีบิตà¹à¸¡à¸ªà¸à¹Œà¹ƒà¸«à¹‰à¸™à¸³à¹€à¸‚้า!"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path is empty."
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่ว่างเปล่า"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path must be a complete resource path."
+msgstr "ต้องเป็นตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่à¹à¸šà¸šà¹€à¸•็ม"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Target path must exist."
+msgstr "ต้องมีตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Save path is empty!"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸šà¸±à¸™à¸—ึà¸à¸§à¹ˆà¸²à¸‡à¹€à¸›à¸¥à¹ˆà¸²!"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "Import BitMasks"
+msgstr "นำเข้า BitMasks"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture(s):"
+msgstr "Texture ต้นฉบับ:"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Target Path:"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่:"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Accept"
+msgstr "ยอมรับ"
+
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+msgid "Bit Mask"
+msgstr "บิตà¹à¸¡à¸ªà¸à¹Œ"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "No source font file!"
+msgstr "ไม่ได้เลือà¸à¹„ฟล์ฟอนต์ต้นฉบับ!"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "No target font resource!"
+msgstr "ไม่ได้เลือà¸à¸§à¹ˆà¸²à¸ˆà¸°à¸™à¸³à¹€à¸‚้ามาเป็นไฟล์ฟอนต์ชื่ออะไร!"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
+msgid ""
+"Invalid file extension.\n"
+"Please use .font."
+msgstr ""
+"นามสà¸à¸¸à¸¥à¹„ม่ถูà¸à¸•้อง\n"
+"à¸à¸£à¸¸à¸“าใช้ .fnt"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Can't load/process source font."
+msgstr "ไม่สามารถโหลด/ประมวลผลฟอนต์ต้นฉบับ"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Couldn't save font."
+msgstr "บันทึà¸à¸Ÿà¸­à¸™à¸•์ไม่ได้"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Source Font:"
+msgstr "ฟอนต์ต้นฉบับ:"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Source Font Size:"
+msgstr "ขนาดฟอนต์ต้นฉบับ:"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Dest Resource:"
+msgstr "นำเข้ามาเป็นรีซอร์ส:"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "The quick brown fox jumps over the lazy dog."
+msgstr ""
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Test:"
+msgstr "ทดสอบ:"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Options:"
+msgstr "ตัวเลือà¸:"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Font Import"
+msgstr "นำเข้าฟอนต์"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid ""
+"This file is already a Godot font file, please supply a BMFont type file "
+"instead."
+msgstr "ไฟล์นี้เป็นฟอนต์ของ Godot อยู่à¹à¸¥à¹‰à¸§ à¸à¸£à¸¸à¸“าเลือà¸à¸Ÿà¸­à¸™à¸•์ที่มาจาภBMFont"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+msgid "Failed opening as BMFont file."
+msgstr "ผิดพลาดขณะเปิดไฟล์เป็น BMFont"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Error initializing FreeType."
+msgstr "ผิดพลาดขณะเริ่มต้น FreeType"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Unknown font format."
+msgstr "ไม่ทราบประเภทของฟอนต์"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Error loading font."
+msgstr "ผิดพลาดขณะโหลดฟอนต์"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: scene/resources/dynamic_font.cpp
+msgid "Invalid font size."
+msgstr "ขนาดฟอนต์ผิดพลาด"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
+msgid "Invalid font custom source."
+msgstr "ต้นฉบับฟอนต์ที่à¸à¸³à¸«à¸™à¸”เองไม่ถูà¸à¸•้อง"
+
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Font"
+msgstr "ฟอนต์"
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "No meshes to import!"
+msgstr "ไม่มี mesh ให้นำเข้า!"
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Single Mesh Import"
+msgstr "นำเข้า Mesh เดี่ยว"
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+msgid "Source Mesh(es):"
+msgstr "Mesh ต้นฉบับ:"
+
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh"
+msgstr "Mesh"
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "No samples to import!"
+msgstr "ไม่มีไฟล์เสียงให้นำเข้า!"
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Import Audio Samples"
+msgstr "นำเข้าไฟล์เสียง"
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Source Sample(s):"
+msgstr "ไฟล์เสียงต้นฉบับ:"
+
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+msgid "Audio Sample"
+msgstr "ไฟล์เสียง"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "New Clip"
+msgstr "คลิปใหม่"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Animation Options"
+msgstr "ตัวเลือà¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Flags"
+msgstr "ตัวเลือà¸"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Bake FPS:"
+msgstr ""
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Optimizer"
+msgstr "ตัวเพิ่มประสิทธิภาพ"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Linear Error"
+msgstr "ผิดพลาดเชิงเส้นมาà¸à¸—ี่สุด"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Angular Error"
+msgstr "ผิดพลาดเชิงมุมมาà¸à¸—ี่สุด"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Max Angle"
+msgstr "มุมมาà¸à¸ªà¸¸à¸”"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Clips"
+msgstr "คลิป"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Start(s)"
+msgstr "เริ่ม"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "End(s)"
+msgstr "จบ"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Loop"
+msgstr "วน"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Filters"
+msgstr "ตัวà¸à¸£à¸­à¸‡"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Source path is empty."
+msgstr "ที่อยู่ไฟล์ต้นฉบับว่างเปล่า"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't load post-import script."
+msgstr "โหลดสคริปต์หลังนำเข้าไม่ได้"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Invalid/broken script for post-import."
+msgstr "สคริปต์หลังนำเข้ามีข้อผิดพลาด"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Error importing scene."
+msgstr "ผิดพลาดขณะนำเข้าฉาà¸"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import 3D Scene"
+msgstr "นำเข้าฉาภ3D"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Source Scene:"
+msgstr "ฉาà¸à¸•้นฉบับ:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Same as Target Scene"
+msgstr "เหมือนà¸à¸±à¸™à¸à¸±à¸šà¸‰à¸²à¸à¸›à¸¥à¸²à¸¢à¸—าง"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Shared"
+msgstr "ใช้ร่วมà¸à¸±à¸™"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Target Texture Folder:"
+msgstr "โฟลเดอร์ Texture ปลายทาง:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Post-Process Script:"
+msgstr "สคริปต์หลังประมวลผล:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Custom Root Node Type:"
+msgstr "ประเภทโหนดราà¸à¸à¸³à¸«à¸™à¸”เอง:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Auto"
+msgstr "อัตโนมัติ"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Root Node Name:"
+msgstr "ชื่อโหนดราà¸:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "The Following Files are Missing:"
+msgstr "ไฟล์ต่อไปนี้หายไป:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import Anyway"
+msgstr "ยืนยันนำเข้า"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp scene/gui/dialogs.cpp
+msgid "Cancel"
+msgstr "ยà¸à¹€à¸¥à¸´à¸"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import & Open"
+msgstr "นำเข้าà¹à¸¥à¸°à¹€à¸›à¸´à¸”"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Edited scene has not been saved, open imported scene anyway?"
+msgstr "ฉาà¸à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™à¸¢à¸±à¸‡à¹„ม่ได้บันทึภยืนยันเปิดไฟล์ฉาà¸à¸—ี่นำเข้า?"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Import Image:"
+msgstr "นำเข้าไฟล์รูป:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Can't import a file over itself:"
+msgstr "นำเข้าไฟล์ทับตัวเองไม่ได้:"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "Couldn't localize path: %s (already local)"
+msgstr "ทำที่อยู่ไฟล์ให้เป็นภายในไม่ได้: %s (เป็นภายในอยู่à¹à¸¥à¹‰à¸§)"
+
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+msgid "3D Scene Animation"
+msgstr "à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸‰à¸²à¸ 3D"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Uncompressed"
+msgstr "ไม่บีบอัด"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress Lossless (PNG)"
+msgstr "บีบอัดà¹à¸šà¸šà¹„ม่เสียคุณภาพ (PNG)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress Lossy (WebP)"
+msgstr "บีบอัดà¹à¸šà¸šà¹€à¸ªà¸µà¸¢à¸„ุณภาพ (WebP)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Compress (VRAM)"
+msgstr "บีบอัด (VRAM)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Format"
+msgstr "รูปà¹à¸šà¸š Texture"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Compression Quality (WebP):"
+msgstr "คุณภาพà¸à¸²à¸£à¸šà¸µà¸šà¸­à¸±à¸” Texture (WebP):"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture Options"
+msgstr "ตัวเลือภTexture"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Please specify some files!"
+msgstr "à¸à¸£à¸¸à¸“าเลือà¸à¸ªà¸±à¸à¹„ฟล์!"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "At least one file needed for Atlas."
+msgstr "Atlas ต้องà¸à¸²à¸£à¹„ฟล์อย่างน้อย 1 ไฟล์"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Error importing:"
+msgstr "ผิดพลาดขณะนำเข้า:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Only one file is required for large texture."
+msgstr "Texture ขนาดใหà¸à¹ˆà¸•้องà¸à¸²à¸£à¹à¸„่ไฟล์เดียว"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Max Texture Size:"
+msgstr "ขนาด Texture ที่ใหà¸à¹ˆà¸—ี่สุด:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for Atlas (2D)"
+msgstr "นำเข้า Texture สำหรับ Atlas (2D)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Cell Size:"
+msgstr "ขนาดเซลล์:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Large Texture"
+msgstr "Texture ขนาดใหà¸à¹ˆ"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Large Textures (2D)"
+msgstr "นำเข้า Texture ขนาดใหà¸à¹ˆ (2D)"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture"
+msgstr "Texture ต้นฉบับ"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Base Atlas Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Source Texture(s)"
+msgstr "Texture ต้นฉบับ"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for 2D"
+msgstr "นำเข้า Texture สำหรับ 2D"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures for 3D"
+msgstr "นำเข้า Texture สำหรับ 3D"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Textures"
+msgstr "นำเข้า Texture"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "2D Texture"
+msgstr "Texture 2D"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "3D Texture"
+msgstr "Texture 3D"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Atlas Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid ""
+"NOTICE: Importing 2D textures is not mandatory. Just copy png/jpg files to "
+"the project."
+msgstr "โปรดทราบ: ไม่จำเป็นต้องนำเข้า Texture 2D à¹à¸„่คัดลอà¸à¹„ฟล์ png/jpg เข้าสู่โปรเจà¸à¸•์"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Crop empty space."
+msgstr "ครอบตัดพื้นที่ว่าง"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Texture"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Import Large Texture"
+msgstr "นำเข้า Texture ขนาดใหà¸à¹ˆ"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Load Source Image"
+msgstr "โหลดรูปต้นฉบับ"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Slicing"
+msgstr "ตัด"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Inserting"
+msgstr "à¹à¸—รà¸"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Saving"
+msgstr "บันทึà¸"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save large texture:"
+msgstr "บันทึภTexture ขนาดใหà¸à¹ˆà¹„ม่ได้:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Build Atlas For:"
+msgstr "สร้าง Atlas สำหรับ:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Loading Image:"
+msgstr "โหลดรูป:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't load image:"
+msgstr "โหลดรูปไม่ได้:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Converting Images"
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¹à¸›à¸¥à¸‡à¸£à¸¹à¸›"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Cropping Images"
+msgstr "ครอบตัดรูป"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Blitting Images"
+msgstr ""
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save atlas image:"
+msgstr "บันทึภAtlas ไม่ได้:"
+
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+msgid "Couldn't save converted texture:"
+msgstr "บันทึภTexture ที่à¹à¸›à¸¥à¸‡à¹à¸¥à¹‰à¸§à¹„ม่ได้:"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Invalid source!"
+msgstr "ต้นฉบับไม่ถูà¸à¸•้อง!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Invalid translation source!"
+msgstr "ต้นฉบับà¸à¸²à¸£à¹à¸›à¸¥à¹„ม่ถูà¸à¸•้อง!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Column"
+msgstr "คอลัมน์"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/script_create_dialog.cpp
+msgid "Language"
+msgstr "ภาษา"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "No items to import!"
+msgstr "ไม่มีอะไรให้นำเข้า!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "No target path!"
+msgstr "ไม่มีที่อยู่ปลายทาง!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Translations"
+msgstr "นำเข้าà¸à¸²à¸£à¹à¸›à¸¥"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Couldn't import!"
+msgstr "นำเข้าไม่ได้!"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Translation"
+msgstr "นำเข้าà¸à¸²à¸£à¹à¸›à¸¥"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Source CSV:"
+msgstr "CSV ต้นฉบับ:"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Ignore First Row"
+msgstr "ไม่สนใจà¹à¸–วà¹à¸£à¸"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Compress"
+msgstr "บีบอัด"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "เพิ่มเข้าโปรเจà¸à¸•์ (godot.cfg)"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Import Languages:"
+msgstr "นำเข้าภาษา:"
+
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+msgid "Translation"
+msgstr "à¸à¸²à¸£à¹à¸›à¸¥"
+
+#: editor/multi_node_edit.cpp
+msgid "MultiNode Set"
+msgstr "à¸à¸³à¸«à¸™à¸” MultiNode"
+
+#: editor/node_dock.cpp
+msgid "Groups"
+msgstr "à¸à¸¥à¸¸à¹ˆà¸¡"
+
+#: editor/node_dock.cpp
+msgid "Select a Node to edit Signals and Groups."
+msgstr "เลือà¸à¹‚หนดเพื่อà¹à¸à¹‰à¹„ขสัà¸à¸à¸²à¸“à¹à¸¥à¸°à¸à¸¥à¸¸à¹ˆà¸¡"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Toggle Autoplay"
+msgstr "เปิดปิดà¸à¸²à¸£à¹€à¸¥à¹ˆà¸™à¸­à¸±à¸•โนมัติ"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "New Animation Name:"
+msgstr "ชื่อà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¹ƒà¸«à¸¡à¹ˆ:"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "New Anim"
+msgstr "à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¹ƒà¸«à¸¡à¹ˆ"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Change Animation Name:"
+msgstr "เปลี่ยนชื่อà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™:"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Delete Animation?"
+msgstr "ลบà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™?"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Remove Animation"
+msgstr "ลบà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: Invalid animation name!"
+msgstr "ผิดพลาด: ชื่อà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¹„ม่ถูà¸à¸•้อง!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: Animation name already exists!"
+msgstr "ผิดพลาด: มีชื่อà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸™à¸µà¹‰à¸­à¸¢à¸¹à¹ˆà¹à¸¥à¹‰à¸§!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Rename Animation"
+msgstr "เปลี่ยนชื่อà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Animation"
+msgstr "เพิ่มà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Blend Next Changed"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Change Blend Time"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load Animation"
+msgstr "โหลดà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Duplicate Animation"
+msgstr "ทำซ้ำà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation to copy!"
+msgstr "ผิดพลาด: ไม่มีà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¹ƒà¸«à¹‰à¸„ัดลอà¸!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation resource on clipboard!"
+msgstr "ผิดพลาด: ไม่มีà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¹ƒà¸™à¸„ลิปบอร์ด!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Pasted Animation"
+msgstr "วางà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¹à¸¥à¹‰à¸§"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Paste Animation"
+msgstr "วางà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation to edit!"
+msgstr "ผิดพลาด: ไม่มีà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¹ƒà¸«à¹‰à¹à¸à¹‰à¹„ข!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation backwards from current pos. (A)"
+msgstr "เล่นà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸—ี่เลือà¸à¸¢à¹‰à¸­à¸™à¸«à¸¥à¸±à¸‡à¸ˆà¸²à¸à¸•ำà¹à¸«à¸™à¹ˆà¸‡à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™ (A)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation backwards from end. (Shift+A)"
+msgstr "เล่นà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸—ี่เลือà¸à¸¢à¹‰à¸­à¸™à¸«à¸¥à¸±à¸‡à¸ˆà¸²à¸à¸—้ายสุด (Shift+A)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Stop animation playback. (S)"
+msgstr "หยุดà¸à¸²à¸£à¹€à¸¥à¹ˆà¸™à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™ (S)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation from start. (Shift+D)"
+msgstr "เล่นà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸—ี่เลือà¸à¸ˆà¸²à¸à¹€à¸£à¸´à¹ˆà¸¡à¸•้น (Shift+D)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation from current pos. (D)"
+msgstr "เล่นà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸—ี่เลือà¸à¸ˆà¸²à¸à¸•ำà¹à¸«à¸™à¹ˆà¸‡à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™ (D)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation position (in seconds)."
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™ (วินาที)"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Scale animation playback globally for the node."
+msgstr "ปรับอัตราส่วนเวลาทุà¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸‚องโหนด"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Create new animation in player."
+msgstr "สร้างà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¹ƒà¸«à¸¡à¹ˆà¹ƒà¸™à¸•ัวเล่น"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load animation from disk."
+msgstr "โหลดà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸ˆà¸²à¸à¸”ิสà¸à¹Œ"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load an animation from disk."
+msgstr "โหลดà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸ˆà¸²à¸à¸”ิสà¸à¹Œ"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Save the current animation"
+msgstr "บันทึà¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Display list of animations in player."
+msgstr "à¹à¸ªà¸”งรายชื่อà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¹ƒà¸™à¸•ัวเล่น"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Autoplay on Load"
+msgstr "เล่นอัตโนมัติเมื่อโหลด"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Edit Target Blend Times"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation Tools"
+msgstr "เครื่องมือà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Copy Animation"
+msgstr "คัดลอà¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Create New Animation"
+msgstr "สร้างà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¹ƒà¸«à¸¡à¹ˆ"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation Name:"
+msgstr "ชื่อà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™:"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
+#: editor/script_create_dialog.cpp
+msgid "Error!"
+msgstr "ผิดพลาด!"
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Blend Times:"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Next (Auto Queue):"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Cross-Animation Blend Times"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Animation"
+msgstr "à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "New name:"
+msgstr "ชื่อใหม่:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Scale:"
+msgstr "อัตราส่วน:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Fade In (s):"
+msgstr "เฟดเข้า (วิ):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Fade Out (s):"
+msgstr "เฟดออภ(วิ):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend"
+msgstr "ผสม"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#, fuzzy
+msgid "Mix"
+msgstr "ร่วม"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Auto Restart:"
+msgstr "เริ่มใหม่อัตโนมัติ:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Restart (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Random Restart (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Start!"
+msgstr "เริ่ม!"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Amount:"
+msgstr "จำนวน:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend:"
+msgstr "ผสม:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend 0:"
+msgstr "ผสม 0:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend 1:"
+msgstr "ผสม 1:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "X-Fade Time (s):"
+msgstr "ระยะเวลาเฟด (วินาที):"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Current:"
+msgstr "ปัจจุบัน:"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Add Input"
+msgstr "เพิ่มอินพุต"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Clear Auto-Advance"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Set Auto-Advance"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Delete Input"
+msgstr "ลบอินพุต"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Rename"
+msgstr "เปลี่ยนชื่อ"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation tree is valid."
+msgstr "ผังà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¸–ูà¸à¸•้อง"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation tree is invalid."
+msgstr "ผังà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™à¹„ม่ถูà¸à¸•้อง"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation Node"
+msgstr "โหนดà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "OneShot Node"
+msgstr "โหนด OneShot"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Mix Node"
+msgstr "โหนด Mix"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend2 Node"
+msgstr "โหนด Blend2"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend3 Node"
+msgstr "โหนด Blend3"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend4 Node"
+msgstr "โหนด Blend4"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "TimeScale Node"
+msgstr "โหนดอัตราส่วนเวลา"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "TimeSeek Node"
+msgstr "โหนด TimeSeek"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Transition Node"
+msgstr "โหนดทรานสิชัน"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Import Animations.."
+msgstr "นำเข้าà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™.."
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Edit Node Filters"
+msgstr "à¹à¸à¹‰à¹„ขตัวà¸à¸£à¸­à¸‡à¹‚หนด"
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Filters.."
+msgstr "ตัวà¸à¸£à¸­à¸‡.."
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Parsing %d Triangles:"
+msgstr "วิเคราะห์สามเหลี่ยม %d อัน:"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Triangle #"
+msgstr "สามเหลี่ยม #"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Light Baker Setup:"
+msgstr "ตั้งค่า Light Baker:"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Parsing Geometry"
+msgstr "วิเคราะห์ Geometry"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Fixing Lights"
+msgstr "ซ่อมà¹à¸‹à¸¡à¹à¸ªà¸‡"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Making BVH"
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸ªà¸£à¹‰à¸²à¸‡ BVH"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Creating Light Octree"
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸ªà¸£à¹‰à¸²à¸‡ Light Octree"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Creating Octree Texture"
+msgstr "สร้าง Texture Octree"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Transfer to Lightmaps:"
+msgstr "ส่งผ่านไปยัง Lightmaps:"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Allocating Texture #"
+msgstr "จัดสรร Texture #"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Baking Triangle #"
+msgstr "à¸à¸³à¸¥à¸±à¸‡ Bake สามเหลี่ยม #"
+
+#: editor/plugins/baked_light_baker.cpp
+msgid "Post-Processing Texture #"
+msgstr "ประมวลผล Texture #"
+
+#: editor/plugins/baked_light_editor_plugin.cpp
+msgid "Bake!"
+msgstr ""
+
+#: editor/plugins/baked_light_editor_plugin.cpp
+msgid "Reset the lightmap octree baking process (start over)."
+msgstr "รีเซ็ตขั้นตอนà¸à¸²à¸£ bake lightmap octree (เริ่มใหม่)"
+
+#: editor/plugins/camera_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Preview"
+msgstr "ตัวอย่าง"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Configure Snap"
+msgstr "ตั้งค่า Snap"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid Offset:"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡ Grid:"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid Step:"
+msgstr "ระยะ Grid:"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotation Offset:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotation Step:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Pivot"
+msgstr "ย้ายจุดหมุน"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Action"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Edit IK Chain"
+msgstr "à¹à¸à¹‰à¹„ข IK Chain"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Edit CanvasItem"
+msgstr "à¹à¸à¹‰à¹„ข CanvasItem"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Change Anchors"
+msgstr "à¹à¸à¹‰à¹„ขหมุด"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom (%):"
+msgstr "ซูม (%):"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Paste Pose"
+msgstr "วางท่าทาง"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Select Mode"
+msgstr "โหมดเลือà¸"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Drag: Rotate"
+msgstr "ลาà¸: หมุน"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Alt+Drag: Move"
+msgstr "Alt+ลาà¸: ย้าย"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving)."
+msgstr "à¸à¸” 'v' เพื่อเปลี่ยนจุดหมุน 'Shift+v' เพื่อลาà¸à¸ˆà¸¸à¸”หมุน"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Alt+RMB: Depth list selection"
+msgstr "Alt+คลิà¸à¸‚วา: เลือà¸à¸—ี่ซ้อนà¸à¸±à¸™"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Mode"
+msgstr "โหมดเคลื่อนย้าย"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotate Mode"
+msgstr "โหมดหมุน"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid ""
+"Show a list of all objects at the position clicked\n"
+"(same as Alt+RMB in select mode)."
+msgstr ""
+"à¹à¸ªà¸”งวัตถุทั้งหมด ณ ตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่คลิà¸\n"
+"(เหมือน Alt+คลิà¸à¸‚วา ในโหมดเลือà¸)"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Click to change object's rotation pivot."
+msgstr "คลิà¸à¹€à¸žà¸·à¹ˆà¸­à¹€à¸›à¸¥à¸µà¹ˆà¸¢à¸™à¸ˆà¸¸à¸”หมุนของวัตถุ"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Pan Mode"
+msgstr "โหมดมุมมอง"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Lock the selected object in place (can't be moved)."
+msgstr "ล็อคไม่ให้วัตถุที่เลือà¸à¸¢à¹‰à¸²à¸¢à¸•ำà¹à¸«à¸™à¹ˆà¸‡"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Unlock the selected object (can be moved)."
+msgstr "ปลดล็อควัตถุที่เลือà¸"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Makes sure the object's children are not selectable."
+msgstr "ทำให้เลือà¸à¹‚หนดลูà¸à¹„ม่ได้"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Restores the object's children's ability to be selected."
+msgstr "ทำให้เลือà¸à¹‚หนดลูà¸à¹„ด้เหมือนเดิม"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_manager.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit"
+msgstr "à¹à¸à¹‰à¹„ข"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Use Snap"
+msgstr "ใช้ Snap"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Show Grid"
+msgstr "à¹à¸ªà¸”ง Grid"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Use Rotation Snap"
+msgstr "ใช้ Snap à¸à¸±à¸šà¸à¸²à¸£à¸«à¸¡à¸¸à¸™"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap Relative"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Configure Snap.."
+msgstr "ตั้งค่า Snap.."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Use Pixel Snap"
+msgstr "ใช้ Snap พิà¸à¹€à¸‹à¸¥"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Expand to Parent"
+msgstr "ขยายให้เต็มโหนดà¹à¸¡à¹ˆ"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Skeleton.."
+msgstr "โครงà¸à¸£à¸°à¸”ูà¸.."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Make Bones"
+msgstr "สร้างà¸à¸£à¸°à¸”ูà¸"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear Bones"
+msgstr "ลบà¸à¸£à¸°à¸”ูà¸"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Bones"
+msgstr "à¹à¸ªà¸”งà¸à¸£à¸°à¸”ูà¸"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Make IK Chain"
+msgstr "สร้าง IK Chain"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear IK Chain"
+msgstr "ลบ IK Chain"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View"
+msgstr "มุมมอง"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Reset"
+msgstr "รีเซ็ตà¸à¸²à¸£à¸‹à¸¹à¸¡"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Zoom Set.."
+msgstr "ตั้งค่าà¸à¸²à¸£à¸‹à¸¹à¸¡.."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Center Selection"
+msgstr "ให้สิ่งที่เลือà¸à¸­à¸¢à¸¹à¹ˆà¸à¸¥à¸²à¸‡à¸ˆà¸­"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Frame Selection"
+msgstr "ให้สิ่งที่เลือà¸à¹€à¸•็มจอ"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Anchor"
+msgstr "หมุด"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Keys"
+msgstr "เพิ่มคีย์"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Key"
+msgstr "เพิ่มคีย์"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Key (Existing Tracks)"
+msgstr "เพิ่มคีย์ (à¹à¸—ร็à¸à¸—ี่มีอยู่à¹à¸¥à¹‰à¸§)"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Copy Pose"
+msgstr "คัดลอà¸à¸—่าทาง"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear Pose"
+msgstr "ลบท่าทาง"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Set a Value"
+msgstr "เซ็ตค่า"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap (Pixels):"
+msgstr "Snap (พิà¸à¹€à¸‹à¸¥):"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Add %s"
+msgstr "เพิ่ม %s"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Adding %s..."
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¹€à¸žà¸´à¹ˆà¸¡ %s..."
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Create Node"
+msgstr "สร้างโหนด"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Error instancing scene from %s"
+msgstr "ผิดพลาดขณะอินสà¹à¸•นซ์ฉาà¸à¸ˆà¸²à¸ %s"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "OK :("
+msgstr "ตà¸à¸¥à¸‡ :("
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "No parent to instance a child at."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "This operation requires a single selected node."
+msgstr "ต้องเลือà¸à¹€à¸žà¸µà¸¢à¸‡à¹‚หนดเดียว"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Change default type"
+msgstr "เปลี่ยนประเภท"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
+msgid "OK"
+msgstr "ตà¸à¸¥à¸‡"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid ""
+"Drag & drop + Shift : Add node as sibling\n"
+"Drag & drop + Alt : Change node type"
+msgstr ""
+"ลาภ& วาง + Shift: เพิ่มเป็นโหนดà¸à¸²à¸•ิ\n"
+"ลาภ& วาง + Alt: เปลี่ยนประเภทโหนด"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Create Poly"
+msgstr "สร้างรูปหลายเหลี่ยม"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Edit Poly"
+msgstr "à¹à¸à¹‰à¹„ขรูปหลายเหลี่ยม"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Edit Poly (Remove Point)"
+msgstr "à¹à¸à¹‰à¹„ขรูปหลายเหลี่ยม (ลบจุด)"
+
+#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Create a new polygon from scratch."
+msgstr "สร้างรูปหลายเหลี่ยมจาà¸à¸„วามว่างเปล่า"
+
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+msgid "Create Poly3D"
+msgstr "à¹à¸à¹‰à¹„ขรูปหลายเหลี่ยม 3D"
+
+#: editor/plugins/collision_shape_2d_editor_plugin.cpp
+msgid "Set Handle"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Creating Mesh Library"
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸ªà¸£à¹‰à¸²à¸‡ Mesh Library"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Thumbnail.."
+msgstr "รูปตัวอย่าง.."
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Remove item %d?"
+msgstr "ลบไอเทม %d?"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Add Item"
+msgstr "เพิ่มไอเทม"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Remove Selected Item"
+msgstr "ลบไอเทมที่เลือà¸"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Import from Scene"
+msgstr "นำเข้าจาà¸à¸‰à¸²à¸"
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Update from Scene"
+msgstr "อัพเดตจาà¸à¸‰à¸²à¸"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "เพิ่มอินพุต"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "ลบจุด"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "โหลดรีซอร์ส"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr "à¹à¸à¹‰à¹„ขเส้นโค้ง"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "เพิ่ม/ลบตำà¹à¸«à¸™à¹ˆà¸‡à¸ªà¸µ"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¹„ล่สี"
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Item %d"
+msgstr "ไอเทม %d"
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Items"
+msgstr "ไอเทม"
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Item List Editor"
+msgstr "à¹à¸à¹‰à¹„ขรายชื่อไอเทม"
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "Create Occluder Polygon"
+msgstr "สร้างรูปหลายเหลี่ยมà¸à¸±à¹‰à¸™à¹à¸ªà¸‡"
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Edit existing polygon:"
+msgstr "à¹à¸à¹‰à¹„ขรูปหลายเหลี่ยมเดิม:"
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "LMB: Move Point."
+msgstr "คลิà¸à¸‹à¹‰à¸²à¸¢: ย้ายจุด"
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Ctrl+LMB: Split Segment."
+msgstr "Ctrl+คลิà¸à¸‹à¹‰à¸²à¸¢: à¹à¸¢à¸à¸ªà¹ˆà¸§à¸™"
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "RMB: Erase Point."
+msgstr "คลิà¸à¸‚วา: ลบจุด"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Remove Point from Line2D"
+msgstr "ลบจุดจาà¸à¹€à¸ªà¹‰à¸™"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Add Point to Line2D"
+msgstr "เพิ่มจุดในเส้น"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Move Point in Line2D"
+msgstr "ย้ายจุดในเส้น"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Select Points"
+msgstr "เลือà¸à¸ˆà¸¸à¸”"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Shift+Drag: Select Control Points"
+msgstr "Shift+ลาà¸: เลือà¸à¹€à¸ªà¹‰à¸™à¸ªà¸±à¸¡à¸œà¸±à¸ª"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Click: Add Point"
+msgstr "คลิà¸: เพิ่มจุด"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Right Click: Delete Point"
+msgstr "คลิà¸à¸‚วา: ลบจุด"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Add Point (in empty space)"
+msgstr "เพิ่มจุด (ในที่ว่าง)"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+msgid "Split Segment (in line)"
+msgstr "à¹à¸¢à¸à¸ªà¹ˆà¸§à¸™ (ในเส้น)"
+
+#: editor/plugins/line_2d_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Delete Point"
+msgstr "ลบจุด"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh is empty!"
+msgstr "Mesh ว่างเปล่า!"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Static Trimesh Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Static Convex Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "This doesn't work on scene root!"
+msgstr "ทำà¸à¸±à¸šà¹‚หนดราà¸à¹„ม่ได้!"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Shape"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Shape"
+msgstr "สร้างรูปทรงนูน"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Navigation Mesh"
+msgstr "สร้าง Mesh นำทาง"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "MeshInstance lacks a Mesh!"
+msgstr "MeshInstance ไม่มี Mesh!"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh has not surface to create outlines from!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Could not create outline!"
+msgstr "สร้างเส้นรอบรูปไม่ได้!"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline"
+msgstr "สร้างเส้นรอบรูป"
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Static Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Static Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Collision Sibling"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Collision Sibling"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline Mesh.."
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline Mesh"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Outline Size:"
+msgstr "ขนาดเส้นรอบรูป:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No mesh source specified (and no MultiMesh set in node)."
+msgstr "ไม่ได้ระบุ mesh ต้นฉบับ (à¹à¸¥à¸°à¹„ม่ได้ระบุ MultiMesh ไว้ในโหนด)"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No mesh source specified (and MultiMesh contains no Mesh)."
+msgstr "ไม่ได้ระบุ mesh ต้นฉบับ (à¹à¸¥à¸° MultiMesh ไม่มี Mesh)"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (invalid path)."
+msgstr "Mesh ต้นฉบับไม่ถูà¸à¸•้อง (ที่อยู่ผิดพลาด)"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (not a MeshInstance)."
+msgstr "Mesh ต้นฉบับไม่ถูà¸à¸•้อง (ไม่ใช่ MeshInstance)"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (contains no Mesh resource)."
+msgstr "Mesh ต้นฉบับไม่ถูà¸à¸•้อง (ไม่มีรีซอร์ส Mesh)"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No surface source specified."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (invalid path)."
+msgstr "พื้นผิวต้นฉบับไม่ถูà¸à¸•้อง (ตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่ไม่ถูà¸à¸•้อง)"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (no geometry)."
+msgstr "พื้นผิวต้นฉบับไม่ถูà¸à¸•้อง (ไม่มี geometry)"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (no faces)."
+msgstr "พื้นผิวต้นฉบับไม่ถูà¸à¸•้อง (ไม่มีหน้า)"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Parent has no solid faces to populate."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Couldn't map area."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Select a Source Mesh:"
+msgstr "เลือภMesh ต้นฉบับ:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Select a Target Surface:"
+msgstr "เลือà¸à¸žà¸·à¹‰à¸™à¸œà¸´à¸§à¸›à¸¥à¸²à¸¢à¸—าง:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate Surface"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate MultiMesh"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Target Surface:"
+msgstr "พื้นผิวปลายทาง:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Source Mesh:"
+msgstr "Mesh ต้นฉบับ:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "X-Axis"
+msgstr "à¹à¸à¸™ X"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Y-Axis"
+msgstr "à¹à¸à¸™ Y"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Z-Axis"
+msgstr "à¹à¸à¸™ Z"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh Up Axis:"
+msgstr "à¹à¸à¸™à¸‚ึ้นของ Mesh:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Rotation:"
+msgstr "สุ่มà¸à¸²à¸£à¸«à¸¡à¸¸à¸™:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Tilt:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Scale:"
+msgstr "สุ่มขนาด:"
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate"
+msgstr ""
+
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Create Navigation Polygon"
+msgstr "สร้างรูปทรงนำทาง"
+
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Remove Poly And Point"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "ลบ Mask à¸à¸²à¸£à¸›à¸¥à¹ˆà¸­à¸¢"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "สร้าง AABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Error loading image:"
+msgstr "ผิดพลาดขณะโหลดรูป:"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "No pixels with transparency > 128 in image.."
+msgstr "รูปไม่มีพิà¸à¹€à¸‹à¸¥à¹ƒà¸”ที่ความโปร่งà¹à¸ªà¸‡ > 128 .."
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Set Emission Mask"
+msgstr "à¸à¸³à¸«à¸™à¸” Mask à¸à¸²à¸£à¸›à¸¥à¹ˆà¸­à¸¢"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Generate Visibility Rect"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Load Emission Mask"
+msgstr "โหลด Mask à¸à¸²à¸£à¸›à¸¥à¹ˆà¸­à¸¢"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Generated Point Count:"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "เวลาเฉลี่ย (วินาที)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "à¸à¸³à¸«à¸™à¸” Mask à¸à¸²à¸£à¸›à¸¥à¹ˆà¸­à¸¢"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "สร้างจาà¸à¸‰à¸²à¸"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "à¸à¸³à¸«à¸™à¸” Mask à¸à¸²à¸£à¸›à¸¥à¹ˆà¸­à¸¢"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Node does not contain geometry."
+msgstr "โหนดไม่มี geometry"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Node does not contain geometry (faces)."
+msgstr "โหนดไม่มี geometry (หน้า)"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Faces contain no area!"
+msgstr "หน้าไม่มีพื้นที่!"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "No faces!"
+msgstr "ไม่มีหน้า!"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate AABB"
+msgstr "สร้าง AABB"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emission Points From Mesh"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emission Points From Node"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Clear Emitter"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emitter"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Points:"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Surface Points"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Surface Points+Normal (Directed)"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Volume"
+msgstr "ปริมาตร"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "สร้าง AABB"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
+msgstr "ลบจุดในเส้นโค้ง"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "ลบจุดในเส้นโค้ง"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "ลบจุดในเส้นโค้ง"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Add Point to Curve"
+msgstr "เพิ่มจุดในเส้นโค้ง"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move Point in Curve"
+msgstr "ย้ายจุดในเส้นโค้ง"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move In-Control in Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move Out-Control in Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Select Control Points (Shift+Drag)"
+msgstr "เลือà¸à¹€à¸ªà¹‰à¸™à¸ªà¸±à¸¡à¸œà¸±à¸ª (Shift+ลาà¸)"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Split Segment (in curve)"
+msgstr "à¹à¸¢à¸à¸ªà¹ˆà¸§à¸™ (ในเส้นโค้ง)"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Close Curve"
+msgstr "ปิดเส้นโค้ง"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Curve Point #"
+msgstr "จุดเส้นโค้ง #"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve Point Pos"
+msgstr "à¸à¸³à¸«à¸™à¸”พิà¸à¸±à¸”จุดเส้นโค้ง"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve In Pos"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve Out Pos"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Split Path"
+msgstr "ตัดเส้น"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove Path Point"
+msgstr "ลบจุด"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "ลบจุด"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "ลบจุด"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Create UV Map"
+msgstr "สร้าง UV Map"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Transform UV Map"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Polygon 2D UV Editor"
+msgstr "à¹à¸à¹‰à¹„ข UV รูปหลายเหลี่ยม 2D"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Move Point"
+msgstr "ย้ายจุด"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Ctrl: Rotate"
+msgstr "Ctrl: หมุน"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Shift: Move All"
+msgstr "Shift: ย้ายทั้งหมด"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Shift+Ctrl: Scale"
+msgstr "Shift+Ctrl: ปรับขนาด"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Move Polygon"
+msgstr "ย้ายรูปหลายเหลี่ยม"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Rotate Polygon"
+msgstr "หมุนรูปหลายเหลี่ยม"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Scale Polygon"
+msgstr "ปรับขนาดรูปหลายเหลี่ยม"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Polygon->UV"
+msgstr "รูปหลายเหลี่ยม->UV"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "UV->Polygon"
+msgstr "UV->รูปหลายเหลี่ยม"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Clear UV"
+msgstr "ลบ UV"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Snap"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Enable Snap"
+msgstr "เปิด Snap"
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid"
+msgstr "เส้นตาราง"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "ERROR: Couldn't load resource!"
+msgstr "ผิดพลาด: โหลดรีซอร์สไม่ได้!"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Add Resource"
+msgstr "เพิ่มรีซอร์ส"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Rename Resource"
+msgstr "เปลี่ยนชื่อรีซอร์ส"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Delete Resource"
+msgstr "ลบรีซอร์ส"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Resource clipboard is empty!"
+msgstr "คลิปบอร์ดไม่มีรีซอร์ส!"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Load Resource"
+msgstr "โหลดรีซอร์ส"
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
+#: editor/resources_dock.cpp scene/gui/line_edit.cpp scene/gui/text_edit.cpp
+msgid "Paste"
+msgstr "วาง"
+
+#: editor/plugins/rich_text_editor_plugin.cpp
+msgid "Parse BBCode"
+msgstr "ประมวลผล BBCode"
+
+#: editor/plugins/sample_editor_plugin.cpp
+msgid "Length:"
+msgstr "ความยาว:"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Open Sample File(s)"
+msgstr "เปิดไฟล์เสียง"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "ERROR: Couldn't load sample!"
+msgstr "ผิดพลาด: โหลดไฟล์เสียงไม่ได้!"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Add Sample"
+msgstr "เพิ่มไฟล์เสียง"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Rename Sample"
+msgstr "เปลี่ยนชื่อไฟล์เสียง"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Delete Sample"
+msgstr "ลบไฟล์เสียง"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "16 Bits"
+msgstr "16 บิต"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "8 Bits"
+msgstr "8 บิต"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stereo"
+msgstr "สเตอริโอ"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Mono"
+msgstr "โมโน"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Format"
+msgstr "รูปà¹à¸šà¸š"
+
+#: editor/plugins/sample_library_editor_plugin.cpp
+msgid "Pitch"
+msgstr "เสียงสูงต่ำ"
+
+#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "ลบà¸à¸£à¸°à¸”ูà¸"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error while saving theme"
+msgstr "ผิดพลาดขณะบันทึà¸à¸˜à¸µà¸¡"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error saving"
+msgstr "ผิดพลาดขณะบันทึà¸"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error importing theme"
+msgstr "ผิดพลาดขณะนำเข้าธีม"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error importing"
+msgstr "ผิดพลาดขณะนำเข้า"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Import Theme"
+msgstr "นำเข้าธีม"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme As.."
+msgstr "บันทึà¸à¸˜à¸µà¸¡à¹€à¸›à¹‡à¸™"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Next script"
+msgstr "สคริปต์ต่อไป"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Previous script"
+msgstr "สคริปต์à¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "File"
+msgstr "ไฟล์"
+
+#: editor/plugins/script_editor_plugin.cpp editor/property_editor.cpp
+msgid "New"
+msgstr "ไฟล์ใหม่"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save All"
+msgstr "บันทึà¸à¸—ั้งหมด"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Soft Reload Script"
+msgstr "โหลดสคริปต์ใหม่"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "History Prev"
+msgstr "ประวัติà¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "History Next"
+msgstr "ประวัติถัดไป"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Reload Theme"
+msgstr "โหลดธีมใหม่"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme"
+msgstr "บันทึà¸à¸˜à¸µà¸¡"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme As"
+msgstr "บันทึà¸à¸˜à¸µà¸¡à¹€à¸›à¹‡à¸™"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close Docs"
+msgstr "ปิดคู่มือ"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close All"
+msgstr "ปิดทั้งหมด"
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find.."
+msgstr "ค้นหา.."
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find Next"
+msgstr "ค้นหาต่อไป"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Step Over"
+msgstr "บรรทัดต่อไป"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Step Into"
+msgstr "คำสั่งต่อไป"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Break"
+msgstr "หยุดพัà¸"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Continue"
+msgstr "ทำต่อไป"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Keep Debugger Open"
+msgstr "เปิดตัวดีบัคค้างไว้"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Window"
+msgstr "หน้าต่าง"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Move Left"
+msgstr "ย้ายไปซ้าย"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Move Right"
+msgstr "ย้ายไปขวา"
+
+#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "ค้นหาคู่มือ"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search the class hierarchy."
+msgstr "ค้นหาคลาส"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search the reference documentation."
+msgstr "ค้นหาคู่มือ"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Go to previous edited document."
+msgstr "ไปเอà¸à¸ªà¸²à¸£à¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Go to next edited document."
+msgstr "ไปเอà¸à¸ªà¸²à¸£à¸–ัดไป"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Discard"
+msgstr "ละทิ้ง"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Create Script"
+msgstr "สร้างสคริปต์"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid ""
+"The following files are newer on disk.\n"
+"What action should be taken?:"
+msgstr ""
+"ไฟล์ต่อไปนี้ในดิสà¸à¹Œà¹ƒà¸«à¸¡à¹ˆà¸à¸§à¹ˆà¸²\n"
+"จะทำอย่างไรต่อไป?:"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Reload"
+msgstr "โหลดใหม่"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Resave"
+msgstr "บันทึà¸à¸­à¸µà¸à¸„รั้ง"
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Debugger"
+msgstr "ตัวดีบัค"
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid ""
+"Built-in scripts can only be edited when the scene they belong to is loaded"
+msgstr "สคริปต์à¸à¸±à¸‡à¸ˆà¸°à¹à¸à¹‰à¹„ขได้ต่อเมื่อฉาà¸à¸—ี่à¸à¸±à¸‡à¸ªà¸„ริปต์นั้นถูà¸à¹€à¸›à¸´à¸”อยู่"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Pick Color"
+msgstr "เลือà¸à¸ªà¸µ"
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¹à¸›à¸¥à¸‡à¸£à¸¹à¸›"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Cut"
+msgstr "ตัด"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/property_editor.cpp
+#: editor/resources_dock.cpp scene/gui/line_edit.cpp scene/gui/text_edit.cpp
+msgid "Copy"
+msgstr "คัดลอà¸"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Select All"
+msgstr "เลือà¸à¸—ั้งหมด"
+
+#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
+msgid "Move Up"
+msgstr "ย้ายขึ้น"
+
+#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
+msgid "Move Down"
+msgstr "ย้ายลง"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Indent Left"
+msgstr "ย่อหน้าซ้าย"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Indent Right"
+msgstr "ย่อหน้าขวา"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Toggle Comment"
+msgstr "เปิด/ปิด ความคิดเห็น"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Clone Down"
+msgstr "คัดลอà¸à¸šà¸£à¸£à¸—ัดลงมา"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Complete Symbol"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Trim Trailing Whitespace"
+msgstr "ลบตัวอัà¸à¸©à¸£à¸—ี่มองไม่เห็น"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Auto Indent"
+msgstr "ย่อหน้าอัตโนมัติ"
+
+#: editor/plugins/script_text_editor.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Toggle Breakpoint"
+msgstr "เปิด/ปิด จุดพัà¸à¹‚ปรà¹à¸à¸£à¸¡"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Remove All Breakpoints"
+msgstr "ลบจุดพัà¸à¸—ั้งหมด"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Next Breakpoint"
+msgstr "ไปจุดพัà¸à¸•่อไป"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Previous Breakpoint"
+msgstr "ไปจุดพัà¸à¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "à¹à¸›à¸¥à¸‡à¹€à¸›à¹‡à¸™.."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "à¹à¸›à¸¥à¸‡à¹€à¸›à¹‡à¸™.."
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Find Previous"
+msgstr "ค้นหาà¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Replace.."
+msgstr "à¹à¸—นที่.."
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Function.."
+msgstr "ไปยังฟังà¸à¹Œà¸Šà¸±à¸™.."
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Goto Line.."
+msgstr "ไปยังบรรทัด.."
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Contextual Help"
+msgstr "ค้นหาคำที่เลือà¸à¹ƒà¸™à¸„ู่มือ"
+
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Scalar Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Toggle Rot Only"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Function"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Function"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Default Value"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change XForm Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Texture Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Cubemap Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Comment"
+msgstr "เปลี่ยนข้อคิดเห็น"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add/Remove to Color Ramp"
+msgstr "เพิ่ม/ลบในà¸à¸²à¸£à¹„ล่สี"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add/Remove to Curve Map"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Curve Map"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Input Name"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Connect Graph Nodes"
+msgstr "เชื่อมต่อโหนด"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Disconnect Graph Nodes"
+msgstr "ตัดà¸à¸²à¸£à¹€à¸Šà¸·à¹ˆà¸­à¸¡à¸•่อโหนด"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Remove Shader Graph Node"
+msgstr "ลบโหนด"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Move Shader Graph Node"
+msgstr "ย้ายโหนด"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Duplicate Graph Node(s)"
+msgstr "ทำซ้ำโหนด"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Delete Shader Graph Node(s)"
+msgstr "ลบโหนด"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Error: Cyclic Connection Link"
+msgstr "ผิดพลาด: เชื่อมต่อเป็นวง"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Error: Missing Input Connections"
+msgstr "ผิดพลาด: ไม่มีขาเข้า"
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add Shader Graph Node"
+msgstr "เพิ่มโหนด"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Orthogonal"
+msgstr "ขนาน"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Perspective"
+msgstr "เพอร์สเปà¸à¸—ีฟ"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Aborted."
+msgstr "ยà¸à¹€à¸¥à¸´à¸à¸à¸²à¸£à¹€à¸„ลื่อนย้าย"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "X-Axis Transform."
+msgstr "ย้ายตามà¹à¸à¸™ X"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Y-Axis Transform."
+msgstr "ย้ายตามà¹à¸à¸™ Y"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Z-Axis Transform."
+msgstr "ย้ายตามà¹à¸à¸™ Z"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Plane Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scaling to %s%%."
+msgstr "ปรับขนาดเป็น %s%%"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotating %s degrees."
+msgstr "หมุน %s องศา"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom View."
+msgstr "มุมล่าง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom"
+msgstr "ล่าง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top View."
+msgstr "มุมบน"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top"
+msgstr "บน"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear View."
+msgstr "มุมหลัง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear"
+msgstr "หลัง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front View."
+msgstr "มุมหน้า"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front"
+msgstr "หน้า"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left View."
+msgstr "มุมซ้าย"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left"
+msgstr "ซ้าย"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right View."
+msgstr "มุมขวา"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right"
+msgstr "ขวา"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Keying is disabled (no key inserted)."
+msgstr "ยà¸à¹€à¸¥à¸´à¸à¸à¸²à¸£à¸ªà¸£à¹‰à¸²à¸‡à¸„ีย์ (ไม่ได้à¹à¸—รà¸à¸„ีย์)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Animation Key Inserted."
+msgstr "à¹à¸—รà¸à¸„ีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "ไปหน้า"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "ย้อนà¸à¸¥à¸±à¸š"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "ล้อเมาส์ลง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "อัพเดทเมื่อเปลี่ยนà¹à¸›à¸¥à¸‡"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "อัพเดทเมื่อเปลี่ยนà¹à¸›à¸¥à¸‡"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "อัพเดทเมื่อเปลี่ยนà¹à¸›à¸¥à¸‡"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "คุณสมบัติ:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align with view"
+msgstr "ย้ายมาที่à¸à¸¥à¹‰à¸­à¸‡"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Normal"
+msgstr "à¹à¸ªà¸”งปà¸à¸•ิ"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Wireframe"
+msgstr "à¹à¸ªà¸”งโครงร่าง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Display Overdraw"
+msgstr "à¹à¸ªà¸”งà¸à¸²à¸£à¸§à¸²à¸”ซ้ำซ้อน"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "à¹à¸ªà¸”งà¹à¸šà¸šà¹„ร้เงา"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Environment"
+msgstr "สภาพà¹à¸§à¸”ล้อม"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Gizmos"
+msgstr "เครื่องมือเคลื่อนย้าย 3D"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr "ตัวรับเสียง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Move Mode (W)"
+msgstr "โหมดเคลื่อนย้าย (W)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate Mode (E)"
+msgstr "โหมดหมุน (E)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale Mode (R)"
+msgstr "โหมดปรับขนาด (R)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom View"
+msgstr "มุมล่าง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top View"
+msgstr "มุมบน"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear View"
+msgstr "มุมหลัง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front View"
+msgstr "มุมหน้า"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left View"
+msgstr "มุมซ้าย"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right View"
+msgstr "มุมขวา"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Switch Perspective/Orthogonal view"
+msgstr "สลับมุมมองเพอร์สเปà¸à¸—ีฟ/ขนาน"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Insert Animation Key"
+msgstr "à¹à¸—รà¸à¸„ีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Focus Origin"
+msgstr "มองไปที่จุดà¸à¸³à¹€à¸™à¸´à¸”"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Focus Selection"
+msgstr "มองวัตถุที่เลือà¸"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align Selection With View"
+msgstr "ย้ายวัตถุที่เลือà¸à¸¡à¸²à¸—ี่à¸à¸¥à¹‰à¸­à¸‡"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "เลือà¸"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "ย้าย"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: หมุน"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "อัตราส่วน:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform"
+msgstr "เคลื่อนย้าย"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Local Coords"
+msgstr "พิà¸à¸±à¸”ภายใน"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "1 Viewport"
+msgstr "1 มุมมอง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "2 Viewports"
+msgstr "2 มุมมอง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "2 Viewports (Alt)"
+msgstr "2 มุมมอง (อีà¸à¹à¸šà¸š)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "3 Viewports"
+msgstr "3 มุมมอง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "3 Viewports (Alt)"
+msgstr "3 มุมมอง (อีà¸à¹à¸šà¸š)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "4 Viewports"
+msgstr "4 มุมมอง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Origin"
+msgstr "à¹à¸ªà¸”งจุดà¸à¸³à¹€à¸™à¸´à¸”"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Grid"
+msgstr "à¹à¸ªà¸”งเส้นตาราง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "ตัวเลือà¸"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Snap Settings"
+msgstr "ตั้งค่า Snap"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Translate Snap:"
+msgstr "Snap à¸à¸²à¸£à¸¢à¹‰à¸²à¸¢:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate Snap (deg.):"
+msgstr "Snap à¸à¸²à¸£à¸«à¸¡à¸¸à¸™ (องศา):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale Snap (%):"
+msgstr "Snap ปรับขนาด (%):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Viewport Settings"
+msgstr "ตั้งค่ามุมมอง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Perspective FOV (deg.):"
+msgstr "FOV เพอร์สเปà¸à¸—ีฟ (องศา):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Z-Near:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Z-Far:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Change"
+msgstr "เคลื่อนย้าย"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Translate:"
+msgstr "เคลื่อนย้าย:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate (deg.):"
+msgstr "หมุน (องศา):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale (ratio):"
+msgstr "ปรับขนาด (อัตราส่วน):"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Type"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Pre"
+msgstr "à¸à¹ˆà¸­à¸™"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Post"
+msgstr "หลัง"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "ERROR: Couldn't load frame resource!"
+msgstr "ผิดพลาด: โหลดรีซอร์สเฟรมไม่ได้!"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Frame"
+msgstr "เพิ่มเฟรม"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Resource clipboard is empty or not a texture!"
+msgstr "คลิปบอร์ดว่าง หรือไม่ใช่ texture!"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Paste Frame"
+msgstr "วางเฟรม"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Empty"
+msgstr "เพิ่มà¹à¸šà¸šà¸§à¹ˆà¸²à¸‡à¹€à¸›à¸¥à¹ˆà¸²"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Change Animation Loop"
+msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¸§à¸™à¸‹à¹‰à¸³à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Change Animation FPS"
+msgstr "à¹à¸à¹‰à¹„ขความเร็วà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "(empty)"
+msgstr "(ว่างเปล่า)"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Animations"
+msgstr "à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Speed (FPS):"
+msgstr "ความเร็ว (เฟรมต่อวินาที):"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Animation Frames"
+msgstr "เฟรมà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Insert Empty (Before)"
+msgstr "เพิ่มà¹à¸šà¸šà¸§à¹ˆà¸²à¸‡à¹€à¸›à¸¥à¹ˆà¸² (à¸à¹ˆà¸­à¸™)"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Insert Empty (After)"
+msgstr "เพิ่มà¹à¸šà¸šà¸§à¹ˆà¸²à¸‡à¹€à¸›à¸¥à¹ˆà¸² (หลัง)"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Up"
+msgstr "ขึ้น"
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Down"
+msgstr "ลง"
+
+#: editor/plugins/style_box_editor_plugin.cpp
+msgid "StyleBox Preview:"
+msgstr "ตัวอย่าง StyleBox:"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Snap Mode:"
+msgstr "โหมด Snap:"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "<None>"
+msgstr "<ไม่มี>"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Pixel Snap"
+msgstr "Snap พิà¸à¹€à¸‹à¸¥"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Grid Snap"
+msgstr "Snap เส้นตาราง"
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Auto Slice"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Offset:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Step:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Separation:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Texture Region"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Texture Region Editor"
+msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¹à¸šà¹ˆà¸‡à¸ªà¹ˆà¸§à¸™ Texture"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Can't save theme to file:"
+msgstr "บันทึà¸à¸˜à¸µà¸¡à¹„ม่ได้:"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add All Items"
+msgstr "เพิ่มทุà¸à¹„อเทม"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add All"
+msgstr "เพิ่มทั้งหมด"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Remove Item"
+msgstr "ลบไอเทม"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Theme"
+msgstr "ธีม"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add Class Items"
+msgstr "เพิ่มไอเทมคลาส"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Remove Class Items"
+msgstr "ลบไอเทมคลาส"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Create Empty Template"
+msgstr "สร้างà¹à¸¡à¹ˆà¹à¸šà¸šà¹€à¸›à¸¥à¹ˆà¸²"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Create Empty Editor Template"
+msgstr "สร้างà¹à¸¡à¹ˆà¹à¸šà¸šà¹€à¸›à¸¥à¹ˆà¸²"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "CheckBox Radio1"
+msgstr "ปุ่มเรดิโอ 1"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "CheckBox Radio2"
+msgstr "ปุ่มเรดิโอ 2"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Item"
+msgstr "ไอเทม"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Check Item"
+msgstr "ทำเครื่องหมายไอเทม"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Item"
+msgstr "ไอเทมมีเครื่องหมาย"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Has"
+msgstr "มี"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Many"
+msgstr "หลาย"
+
+#: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp
+msgid "Options"
+msgstr "ตัวเลือà¸"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Have,Many,Several,Options!"
+msgstr "มี,มาà¸à¸¡à¸²à¸¢,หลาย,ตัวเลือà¸!"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 1"
+msgstr "à¹à¸—็บ 1"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 2"
+msgstr "à¹à¸—็บ 2"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 3"
+msgstr "à¹à¸—็บ 3"
+
+#: editor/plugins/theme_editor_plugin.cpp editor/project_settings.cpp
+#: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp
+msgid "Type:"
+msgstr "ประเภท:"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Data Type:"
+msgstr "ชนิดข้อมูล:"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Icon"
+msgstr "รูปย่อ"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Style"
+msgstr "รูปà¹à¸šà¸š"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Color"
+msgstr "สี"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Paint TileMap"
+msgstr "วาด TileMap"
+
+#: editor/plugins/tile_map_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Duplicate"
+msgstr "ทำซ้ำ"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Erase TileMap"
+msgstr "ลบ TileMap"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Erase selection"
+msgstr "ลบที่เลือà¸"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Find tile"
+msgstr "ค้นหา tile"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Transpose"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Mirror X"
+msgstr "สะท้อนบนล่าง"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Mirror Y"
+msgstr "สะท้อนซ้ายขวา"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Bucket"
+msgstr "ถัง"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Pick Tile"
+msgstr "เลือภTile"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Select"
+msgstr "เลือà¸"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 0 degrees"
+msgstr "หมุน 0 องศา"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 90 degrees"
+msgstr "หมุน 90 องศา"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 180 degrees"
+msgstr "หมุน 180 องศา"
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 270 degrees"
+msgstr "หมุน 270 องศา"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Could not find tile:"
+msgstr "ไม่พบ tile:"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Item name or ID:"
+msgstr "ชื่อหรือ ID ไอเทม:"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Create from scene?"
+msgstr "สร้างจาà¸à¸‰à¸²à¸?"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Merge from scene?"
+msgstr "รวมจาà¸à¸‰à¸²à¸?"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Create from Scene"
+msgstr "สร้างจาà¸à¸‰à¸²à¸"
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Merge from Scene"
+msgstr "รวมจาà¸à¸‰à¸²à¸"
+
+#: editor/plugins/tile_set_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Error"
+msgstr "ผิดพลาด"
+
+#: editor/project_export.cpp
+msgid "Runnable"
+msgstr "รันได้"
+
+#: editor/project_export.cpp
+#, fuzzy
+msgid "Delete patch '"
+msgstr "ลบ '"
+
+#: editor/project_export.cpp
+#, fuzzy
+msgid "Delete preset '%s'?"
+msgstr "ลบ '%s'?"
+
+#: editor/project_export.cpp
+msgid "Presets"
+msgstr "à¸à¸²à¸£à¸ªà¹ˆà¸‡à¸­à¸­à¸"
+
+#: editor/project_export.cpp editor/project_settings.cpp
+msgid "Add.."
+msgstr "เพิ่ม.."
+
+#: editor/project_export.cpp
+msgid "Resources"
+msgstr "รีซอร์ส"
+
+#: editor/project_export.cpp
+msgid "Export all resources in the project"
+msgstr "ส่งออà¸à¸—ุà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ªà¹ƒà¸™à¹‚ปรเจà¸à¸•์"
+
+#: editor/project_export.cpp
+msgid "Export selected scenes (and dependencies)"
+msgstr "ส่งออà¸à¸‰à¸²à¸à¸—ี่เลือภ(รวมถึงà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡)"
+
+#: editor/project_export.cpp
+msgid "Export selected resources (and dependencies)"
+msgstr "ส่งออà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ªà¸—ี่เลือภ(รวมถึงà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡)"
+
+#: editor/project_export.cpp
+msgid "Export Mode:"
+msgstr "วิธีà¸à¸²à¸£à¸ªà¹ˆà¸‡à¸­à¸­à¸:"
+
+#: editor/project_export.cpp
+msgid "Resources to export:"
+msgstr "รีซอร์สที่จะส่งออà¸:"
+
+#: editor/project_export.cpp
+msgid ""
+"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"
+msgstr "ตัวà¸à¸£à¸­à¸‡à¹„ฟล์ที่จะส่งออà¸à¹€à¸žà¸´à¹ˆà¸¡à¹€à¸•ิม (คั่นด้วยจุลภาค ตัวอย่างเช่น: *.json, *.txt)"
+
+#: editor/project_export.cpp
+msgid ""
+"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)"
+msgstr "ตัวà¸à¸£à¸­à¸‡à¹„ฟล์ที่จะไม่ส่งออภ(คั่นด้วยจุลภาค ตัวอย่างเช่น: *.json, *.txt)"
+
+#: editor/project_export.cpp
+msgid "Patches"
+msgstr "à¹à¸žà¸•ช์"
+
+#: editor/project_export.cpp
+msgid "Make Patch"
+msgstr "สร้างà¹à¸žà¸•ช์"
+
+#: editor/project_export.cpp
+msgid "Export templates for this platform are missing:"
+msgstr "ไม่พบà¹à¸¡à¹ˆà¹à¸šà¸šà¸ªà¹ˆà¸‡à¸­à¸­à¸à¸ªà¸³à¸«à¸£à¸±à¸šà¹à¸žà¸¥à¸•ฟอร์มนี้:"
+
+#: editor/project_export.cpp
+msgid "Export With Debug"
+msgstr "ส่งออà¸à¸žà¸£à¹‰à¸­à¸¡à¸•ัวดีบัค"
+
+#: editor/project_manager.cpp
+msgid "Invalid project path, the path must exist!"
+msgstr "ที่อยู่โปรเจà¸à¸•์ผิดพลาด ต้องมีอยู่จริง!"
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "ที่อยู่โปรเจà¸à¸•์ผิดพลาด ต้องไม่มี godot.cfg"
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "ที่อยู่โปรเจà¸à¸•์ผิดพลาด ต้องมี godot.cfg"
+
+#: editor/project_manager.cpp
+msgid "Imported Project"
+msgstr "นำเข้าโปรเจà¸à¸•์à¹à¸¥à¹‰à¸§"
+
+#: editor/project_manager.cpp
+msgid "Invalid project path (changed anything?)."
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¹‚ปรเจà¸à¸•์ผิดพลาด (ได้à¹à¸à¹‰à¹„ขอะไรไปหรือไม่?)"
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "สร้างไฟล์ godot.cfg ไม่ได้"
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "The following files failed extraction from package:"
+msgstr "ผิดพลาดขณะà¹à¸¢à¸à¹„ฟล์ต่อไปนี้จาà¸à¹à¸žà¸„เà¸à¸ˆ:"
+
+#: editor/project_manager.cpp
+msgid "Package Installed Successfully!"
+msgstr "ติดตั้งà¹à¸žà¸„เà¸à¸ˆà¹€à¸ªà¸£à¹‡à¸ˆà¸ªà¸¡à¸šà¸¹à¸£à¸“์!"
+
+#: editor/project_manager.cpp
+msgid "Import Existing Project"
+msgstr "นำเข้าโปรเจà¸à¸•์ที่มีอยู่เดิม"
+
+#: editor/project_manager.cpp
+msgid "Project Path (Must Exist):"
+msgstr "ที่อยู่โปรเจà¸à¸•์ (ต้องมีอยู่จริง):"
+
+#: editor/project_manager.cpp
+msgid "Project Name:"
+msgstr "ชื่อโปรเจà¸à¸•์:"
+
+#: editor/project_manager.cpp
+msgid "Create New Project"
+msgstr "สร้างโปรเจà¸à¸•์ใหม่"
+
+#: editor/project_manager.cpp
+msgid "Project Path:"
+msgstr "ที่อยู่โปรเจà¸à¸•์:"
+
+#: editor/project_manager.cpp
+msgid "Install Project:"
+msgstr "ติดตั้งโปรเจà¸à¸•์:"
+
+#: editor/project_manager.cpp
+msgid "Browse"
+msgstr "เลือà¸"
+
+#: editor/project_manager.cpp
+msgid "New Game Project"
+msgstr "โปรเจà¸à¸•์ใหม่"
+
+#: editor/project_manager.cpp
+msgid "That's a BINGO!"
+msgstr "บิงโà¸!"
+
+#: editor/project_manager.cpp
+msgid "Unnamed Project"
+msgstr "โปรเจà¸à¸•์ไม่มีชื่อ"
+
+#: editor/project_manager.cpp
+msgid "Are you sure to open more than one project?"
+msgstr "ยืนยันà¸à¸²à¸£à¹€à¸›à¸´à¸”โปรเจà¸à¸•์มาà¸à¸à¸§à¹ˆà¸² 1 โปรเจà¸à¸•์?"
+
+#: editor/project_manager.cpp
+msgid "Are you sure to run more than one project?"
+msgstr "ยืนยันà¸à¸²à¸£à¸£à¸±à¸™à¹‚ปรเจà¸à¸•์มาà¸à¸à¸§à¹ˆà¸² 1 โปรเจà¸à¸•์?"
+
+#: editor/project_manager.cpp
+msgid "Remove project from the list? (Folder contents will not be modified)"
+msgstr "ลบโปรเจà¸à¸•์ออà¸à¸ˆà¸²à¸à¸£à¸²à¸¢à¸Šà¸·à¹ˆà¸­? (โฟลเดอร์จะไม่ถูà¸à¸¥à¸š)"
+
+#: editor/project_manager.cpp
+msgid ""
+"You are about the scan %s folders for existing Godot projects. Do you "
+"confirm?"
+msgstr "จะทำà¸à¸²à¸£à¸ªà¹à¸à¸™à¸«à¸²à¹‚ปรเจà¸à¸•์ใน %s โฟลเดอร์ ยืนยัน?"
+
+#: editor/project_manager.cpp
+msgid "Project Manager"
+msgstr "ตัวจัดà¸à¸²à¸£à¹‚ปรเจà¸à¸•์"
+
+#: editor/project_manager.cpp
+msgid "Project List"
+msgstr "รายชื่อโปรเจà¸à¸•์"
+
+#: editor/project_manager.cpp
+msgid "Run"
+msgstr "รัน"
+
+#: editor/project_manager.cpp
+msgid "Scan"
+msgstr "สà¹à¸à¸™"
+
+#: editor/project_manager.cpp
+msgid "Select a Folder to Scan"
+msgstr "เลือà¸à¹‚ฟลเดอร์เพื่อสà¹à¸à¸™"
+
+#: editor/project_manager.cpp
+msgid "New Project"
+msgstr "โปรเจà¸à¸•์ใหม่"
+
+#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "ลบà¹à¸¡à¹ˆà¹à¸šà¸š"
+
+#: editor/project_manager.cpp
+msgid "Exit"
+msgstr "ออà¸"
+
+#: editor/project_settings.cpp
+msgid "Key "
+msgstr "ปุ่ม "
+
+#: editor/project_settings.cpp
+msgid "Joy Button"
+msgstr "ปุ่มจอย"
+
+#: editor/project_settings.cpp
+msgid "Joy Axis"
+msgstr "คันบังคับจอย"
+
+#: editor/project_settings.cpp
+msgid "Mouse Button"
+msgstr "ปุ่มเมาส์"
+
+#: editor/project_settings.cpp
+msgid "Invalid action (anything goes but '/' or ':')."
+msgstr "ใช้ชื่อนี้ไม่ได้ (มี '/' หรือ ':')"
+
+#: editor/project_settings.cpp
+msgid "Action '%s' already exists!"
+msgstr "มีà¸à¸²à¸£à¸à¸£à¸°à¸—ำ '%s' อยู่à¹à¸¥à¹‰à¸§!"
+
+#: editor/project_settings.cpp
+msgid "Rename Input Action Event"
+msgstr "เปลี่ยนชื่อà¸à¸²à¸£à¸à¸£à¸°à¸—ำ"
+
+#: editor/project_settings.cpp
+msgid "Add Input Action Event"
+msgstr "เพิ่มà¸à¸²à¸£à¸à¸£à¸°à¸—ำ"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Meta+"
+msgstr "Meta+"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Shift+"
+msgstr "Shift+"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+#: scene/gui/input_action.cpp
+msgid "Alt+"
+msgstr "Alt+"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "Control+"
+msgstr "Control+"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "Press a Key.."
+msgstr "à¸à¸”ปุ่ม.."
+
+#: editor/project_settings.cpp
+msgid "Mouse Button Index:"
+msgstr "ปุ่มเมาส์:"
+
+#: editor/project_settings.cpp
+msgid "Left Button"
+msgstr "เมาส์ซ้าย"
+
+#: editor/project_settings.cpp
+msgid "Right Button"
+msgstr "เมาส์ขวา"
+
+#: editor/project_settings.cpp
+msgid "Middle Button"
+msgstr "เมาส์à¸à¸¥à¸²à¸‡"
+
+#: editor/project_settings.cpp
+msgid "Wheel Up Button"
+msgstr "ล้อเมาส์ขึ้น"
+
+#: editor/project_settings.cpp
+msgid "Wheel Down Button"
+msgstr "ล้อเมาส์ลง"
+
+#: editor/project_settings.cpp
+msgid "Button 6"
+msgstr "ปุ่ม 6"
+
+#: editor/project_settings.cpp
+msgid "Button 7"
+msgstr "ปุ่ม 7"
+
+#: editor/project_settings.cpp
+msgid "Button 8"
+msgstr "ปุ่ม 8"
+
+#: editor/project_settings.cpp
+msgid "Button 9"
+msgstr "ปุ่ม 9"
+
+#: editor/project_settings.cpp
+msgid "Joypad Axis Index:"
+msgstr "คันบังคับจอย:"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Axis"
+msgstr "à¹à¸à¸™"
+
+#: editor/project_settings.cpp
+msgid "Joypad Button Index:"
+msgstr "ปุ่มจอย:"
+
+#: editor/project_settings.cpp
+msgid "Add Input Action"
+msgstr "เพิ่มà¸à¸²à¸£à¸à¸£à¸°à¸—ำ"
+
+#: editor/project_settings.cpp
+msgid "Erase Input Action Event"
+msgstr "ลบà¸à¸²à¸£à¸à¸£à¸°à¸—ำ"
+
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "เพิ่มà¹à¸šà¸šà¸§à¹ˆà¸²à¸‡à¹€à¸›à¸¥à¹ˆà¸²"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Device"
+msgstr "อุปà¸à¸£à¸“์"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Button"
+msgstr "ปุ่ม"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Left Button."
+msgstr "ปุ่มเมาส์ซ้าย"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Right Button."
+msgstr "ปุ่มเมาส์ขวา"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Middle Button."
+msgstr "ปุ่มเมาส์à¸à¸¥à¸²à¸‡"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Wheel Up."
+msgstr "ล้อเมาส์ขึ้น"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
+msgid "Wheel Down."
+msgstr "ล้อเมาส์ลง"
+
+#: editor/project_settings.cpp
+msgid "Error saving settings."
+msgstr "ผิดพลาดขณะบันทึà¸à¸„่า"
+
+#: editor/project_settings.cpp
+msgid "Settings saved OK."
+msgstr "บันทึà¸à¹à¸¥à¹‰à¸§"
+
+#: editor/project_settings.cpp
+msgid "Add Translation"
+msgstr "เพิ่มà¸à¸²à¸£à¹à¸›à¸¥"
+
+#: editor/project_settings.cpp
+msgid "Remove Translation"
+msgstr "ลบà¸à¸²à¸£à¹à¸›à¸¥"
+
+#: editor/project_settings.cpp
+msgid "Add Remapped Path"
+msgstr "เพิ่มตำà¹à¸«à¸™à¹ˆà¸‡à¹à¸—นที่"
+
+#: editor/project_settings.cpp
+msgid "Resource Remap Add Remap"
+msgstr "เพิ่มà¸à¸²à¸£à¹à¸—นที่"
+
+#: editor/project_settings.cpp
+msgid "Change Resource Remap Language"
+msgstr "เปลี่ยนภาษาที่ใช้à¹à¸—นที่ไฟล์"
+
+#: editor/project_settings.cpp
+msgid "Remove Resource Remap"
+msgstr "ลบà¸à¸²à¸£à¹à¸—นที่"
+
+#: editor/project_settings.cpp
+msgid "Remove Resource Remap Option"
+msgstr "ลบà¸à¸²à¸£à¹à¸—นที่"
+
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "ตัวเลือà¸à¹‚ปรเจà¸à¸•์ (godot.cfg)"
+
+#: editor/project_settings.cpp editor/settings_config_dialog.cpp
+msgid "General"
+msgstr "ทั่วไป"
+
+#: editor/project_settings.cpp editor/property_editor.cpp
+msgid "Property:"
+msgstr "คุณสมบัติ:"
+
+#: editor/project_settings.cpp
+msgid "Del"
+msgstr "ลบ"
+
+#: editor/project_settings.cpp
+msgid "Copy To Platform.."
+msgstr "คัดลอà¸à¹„ปยังà¹à¸žà¸¥à¸•ฟอร์ม.."
+
+#: editor/project_settings.cpp
+msgid "Input Map"
+msgstr "ปุ่มà¸à¸”"
+
+#: editor/project_settings.cpp
+msgid "Action:"
+msgstr "à¸à¸²à¸£à¸à¸£à¸°à¸—ำ:"
+
+#: editor/project_settings.cpp
+msgid "Device:"
+msgstr "อุปà¸à¸£à¸“์:"
+
+#: editor/project_settings.cpp
+msgid "Index:"
+msgstr "ดัชนี:"
+
+#: editor/project_settings.cpp
+msgid "Localization"
+msgstr "à¸à¸²à¸£à¹à¸›à¸¥"
+
+#: editor/project_settings.cpp
+msgid "Translations"
+msgstr "à¸à¸²à¸£à¹à¸›à¸¥"
+
+#: editor/project_settings.cpp
+msgid "Translations:"
+msgstr "à¸à¸²à¸£à¹à¸›à¸¥:"
+
+#: editor/project_settings.cpp
+msgid "Remaps"
+msgstr "à¸à¸²à¸£à¹à¸—นที่"
+
+#: editor/project_settings.cpp
+msgid "Resources:"
+msgstr "รีซอร์ส:"
+
+#: editor/project_settings.cpp
+msgid "Remaps by Locale:"
+msgstr "à¹à¸—นที่ตามท้องถิ่น:"
+
+#: editor/project_settings.cpp
+msgid "Locale"
+msgstr "ท้องถิ่น"
+
+#: editor/project_settings.cpp
+msgid "AutoLoad"
+msgstr "ออโต้โหลด"
+
+#: editor/property_editor.cpp
+msgid "Pick a Viewport"
+msgstr "เลือภViewport"
+
+#: editor/property_editor.cpp
+msgid "Ease In"
+msgstr "เข้านุ่มนวล"
+
+#: editor/property_editor.cpp
+msgid "Ease Out"
+msgstr "ออà¸à¸™à¸¸à¹ˆà¸¡à¸™à¸§à¸¥"
+
+#: editor/property_editor.cpp
+msgid "Zero"
+msgstr "ศูนย์"
+
+#: editor/property_editor.cpp
+msgid "Easing In-Out"
+msgstr "เข้า-ออà¸à¸™à¸¸à¹ˆà¸¡à¸™à¸§à¸¥"
+
+#: editor/property_editor.cpp
+msgid "Easing Out-In"
+msgstr "ออà¸-เข้านุ่มนวล"
+
+#: editor/property_editor.cpp
+msgid "File.."
+msgstr "ไฟล์.."
+
+#: editor/property_editor.cpp
+msgid "Dir.."
+msgstr "โฟลเดอร์.."
+
+#: editor/property_editor.cpp
+msgid "Assign"
+msgstr "ระบุ"
+
+#: editor/property_editor.cpp
+msgid "New Script"
+msgstr "สคริปต์ใหม่"
+
+#: editor/property_editor.cpp
+msgid "Show in File System"
+msgstr "เปิดในตัวจัดà¸à¸²à¸£à¹„ฟล์"
+
+#: editor/property_editor.cpp
+msgid "Error loading file: Not a resource!"
+msgstr "ผิดพลาดขณะโหลดไฟล์: ไม่ใช่รีซอร์ส!"
+
+#: editor/property_editor.cpp
+msgid "Pick a Node"
+msgstr "เลือà¸à¹‚หนด"
+
+#: editor/property_editor.cpp
+msgid "Bit %d, val %d."
+msgstr "บิต %d, ค่า %d"
+
+#: editor/property_editor.cpp
+msgid "On"
+msgstr "เปิด"
+
+#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Set"
+msgstr "à¸à¸³à¸«à¸™à¸”"
+
+#: editor/property_editor.cpp
+msgid "Properties:"
+msgstr "คุณสมบัติ:"
+
+#: editor/property_editor.cpp
+msgid "Sections:"
+msgstr "หัวข้อ:"
+
+#: editor/property_selector.cpp
+msgid "Select Property"
+msgstr "เลือà¸à¸„ุณสมบัติ"
+
+#: editor/property_selector.cpp
+msgid "Select Method"
+msgstr "เลือà¸à¹€à¸¡à¸—็อด"
+
+#: editor/pvrtc_compress.cpp
+msgid "Could not execute PVRTC tool:"
+msgstr "ใช้เครื่องมือ PVRTC ไม่ได้:"
+
+#: editor/pvrtc_compress.cpp
+msgid "Can't load back converted image using PVRTC tool:"
+msgstr "โหลดรูปที่à¹à¸›à¸¥à¸‡à¹à¸¥à¹‰à¸§à¸”้วยเครื่องมือ PVRTC ไม่ได้:"
+
+#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
+msgid "Reparent Node"
+msgstr "หาโหนดà¹à¸¡à¹ˆà¹ƒà¸«à¸¡à¹ˆ"
+
+#: editor/reparent_dialog.cpp
+msgid "Reparent Location (Select new Parent):"
+msgstr "เลือà¸à¹‚หนดà¹à¸¡à¹ˆà¹ƒà¸«à¸¡à¹ˆ:"
+
+#: editor/reparent_dialog.cpp
+msgid "Keep Global Transform"
+msgstr ""
+
+#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
+msgid "Reparent"
+msgstr "เลือà¸à¹‚หนดà¹à¸¡à¹ˆà¹ƒà¸«à¸¡à¹ˆ"
+
+#: editor/resources_dock.cpp
+msgid "Create New Resource"
+msgstr "สร้างรีซอร์สใหม่"
+
+#: editor/resources_dock.cpp
+msgid "Open Resource"
+msgstr "เปิดรีซอร์ส"
+
+#: editor/resources_dock.cpp
+msgid "Save Resource"
+msgstr "บันทึà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ª"
+
+#: editor/resources_dock.cpp
+msgid "Resource Tools"
+msgstr "เครื่องมือรีซอร์ส"
+
+#: editor/resources_dock.cpp
+msgid "Make Local"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Run Mode:"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Current Scene"
+msgstr "ฉาà¸à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™"
+
+#: editor/run_settings_dialog.cpp
+msgid "Main Scene"
+msgstr "ฉาà¸à¸«à¸¥à¸±à¸"
+
+#: editor/run_settings_dialog.cpp
+msgid "Main Scene Arguments:"
+msgstr "ตัวà¹à¸›à¸£à¸‰à¸²à¸à¸«à¸¥à¸±à¸:"
+
+#: editor/run_settings_dialog.cpp
+msgid "Scene Run Settings"
+msgstr "ตัวเลือà¸à¸à¸²à¸£à¸£à¸±à¸™à¸‰à¸²à¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "No parent to instance the scenes at."
+msgstr "ไม่มีโหนดà¹à¸¡à¹ˆà¹€à¸›à¹‡à¸™à¸—ี่อินสà¹à¸•นซ์ฉาà¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "Error loading scene from %s"
+msgstr "ผิดพลาดขณะโหลดฉาà¸à¸ˆà¸²à¸ %s"
+
+#: editor/scene_tree_dock.cpp
+msgid "Ok"
+msgstr "ตà¸à¸¥à¸‡"
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Cannot instance the scene '%s' because the current scene exists within one "
+"of its nodes."
+msgstr "อินสà¹à¸•นซ์ฉาภ'%s' ไม่ได้เนื่องจาà¸à¸‰à¸²à¸à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™à¹€à¸›à¹‡à¸™à¹‚หนดของฉาà¸à¸™à¸±à¹‰à¸™"
+
+#: editor/scene_tree_dock.cpp
+msgid "Instance Scene(s)"
+msgstr "อินสà¹à¸•นซ์ฉาà¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done on the tree root."
+msgstr "ทำà¸à¸±à¸šà¹‚หนดราà¸à¹„ม่ได้"
+
+#: editor/scene_tree_dock.cpp
+msgid "Move Node In Parent"
+msgstr "ย้ายโหนดในโหนดà¹à¸¡à¹ˆ"
+
+#: editor/scene_tree_dock.cpp
+msgid "Move Nodes In Parent"
+msgstr "ย้ายโหนดในโหนดà¹à¸¡à¹ˆ"
+
+#: editor/scene_tree_dock.cpp
+msgid "Duplicate Node(s)"
+msgstr "ทำซ้ำโหนด"
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete Node(s)?"
+msgstr "ลบโหนด?"
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done without a scene."
+msgstr "ทำไม่ได้ถ้าไม่มีฉาà¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "Can not perform with the root node."
+msgstr "ไม่สามารถทำได้โดยที่ไม่มีโหนดราà¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done on instanced scenes."
+msgstr "ทำà¸à¸±à¸šà¸‰à¸²à¸à¸—ี่เป็นอินสà¹à¸•นซ์ไม่ได้"
+
+#: editor/scene_tree_dock.cpp
+msgid "Save New Scene As.."
+msgstr "บันทึà¸à¸‰à¸²à¸à¹ƒà¸«à¸¡à¹ˆà¹€à¸›à¹‡à¸™.."
+
+#: editor/scene_tree_dock.cpp
+msgid "Makes Sense!"
+msgstr "เข้าใจ!"
+
+#: editor/scene_tree_dock.cpp
+msgid "Can't operate on nodes from a foreign scene!"
+msgstr "ทำà¸à¸±à¸šà¹‚หนดของฉาà¸à¸­à¸·à¹ˆà¸™à¹„ม่ได้!"
+
+#: editor/scene_tree_dock.cpp
+msgid "Can't operate on nodes the current scene inherits from!"
+msgstr "ทำà¸à¸±à¸šà¹‚หนดที่ฉาà¸à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™à¸ªà¸·à¸šà¸—อดมาไม่ได้!"
+
+#: editor/scene_tree_dock.cpp
+msgid "Remove Node(s)"
+msgstr "ลบโหนด"
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Couldn't save new scene. Likely dependencies (instances) couldn't be "
+"satisfied."
+msgstr "บันทึà¸à¸‰à¸²à¸à¹ƒà¸«à¸¡à¹ˆà¹„ม่ได้ อาจจะมีà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¹„ม่สมบูรณ์"
+
+#: editor/scene_tree_dock.cpp
+msgid "Error saving scene."
+msgstr "ผิดพลาดขณะบันทึà¸à¸‰à¸²à¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "Error duplicating scene to save it."
+msgstr "ผิดพลาดขณะทำซ้ำฉาà¸à¹€à¸žà¸·à¹ˆà¸­à¸šà¸±à¸™à¸—ึà¸"
+
+#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "รีซอร์ส:"
+
+#: editor/scene_tree_dock.cpp
+msgid "Edit Groups"
+msgstr "à¹à¸à¹‰à¹„ขà¸à¸¥à¸¸à¹ˆà¸¡"
+
+#: editor/scene_tree_dock.cpp
+msgid "Edit Connections"
+msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¹€à¸Šà¸·à¹ˆà¸­à¸¡à¹‚ยง"
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete Node(s)"
+msgstr "ลบโหนด"
+
+#: editor/scene_tree_dock.cpp
+msgid "Add Child Node"
+msgstr "เพิ่มโหนดลูà¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "Instance Child Scene"
+msgstr "อินสà¹à¸•นซ์ฉาà¸à¸¥à¸¹à¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "Change Type"
+msgstr "เปลี่ยนประเภท"
+
+#: editor/scene_tree_dock.cpp
+msgid "Attach Script"
+msgstr "เชื่อมสคริปต์"
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear Script"
+msgstr "ลบสคริปต์"
+
+#: editor/scene_tree_dock.cpp
+msgid "Merge From Scene"
+msgstr "รวมจาà¸à¸‰à¸²à¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "Save Branch as Scene"
+msgstr "บันทึà¸à¸à¸´à¹ˆà¸‡à¹€à¸›à¹‡à¸™à¸‰à¸²à¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "Copy Node Path"
+msgstr "คัดลอà¸à¸•ำà¹à¸«à¸™à¹ˆà¸‡à¹‚หนด"
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete (No Confirm)"
+msgstr "ลบ (ไม่ยืนยัน)"
+
+#: editor/scene_tree_dock.cpp
+msgid "Add/Create a New Node"
+msgstr "เพิ่ม/สร้างโหนดใหม่"
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Instance a scene file as a Node. Creates an inherited scene if no root node "
+"exists."
+msgstr "อินสà¹à¸•นซ์ฉาà¸à¹€à¸›à¹‡à¸™à¹‚หนด สร้างฉาà¸à¸ªà¸·à¸šà¸—อดถ้าไม่มีโหนดราà¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "Attach a new or existing script for the selected node."
+msgstr "เชื่อมสคริปต์ใหม่หรือที่มีอยู่เดิมให้à¸à¸±à¸šà¹‚หนดที่เลือà¸"
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear a script for the selected node."
+msgstr "ลบสคริปต์ของโหนดที่เลือà¸"
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Spatial Visible"
+msgstr "ซ่อน/à¹à¸ªà¸”งโหนด Spatial"
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle CanvasItem Visible"
+msgstr "ซ่อน/à¹à¸ªà¸”งโหนด CanvasItem"
+
+#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "ตัวเลือà¸à¸”ีบัค"
+
+#: editor/scene_tree_editor.cpp
+msgid "Instance:"
+msgstr "อินสà¹à¸•นซ์:"
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "สคริปต์ต่อไป"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "ซ่อน/à¹à¸ªà¸”งโหนด Spatial"
+
+#: editor/scene_tree_editor.cpp
+msgid "Invalid node name, the following characters are not allowed:"
+msgstr "ชื่อโหนดไม่ถูà¸à¸•้อง ใช้ตัวอัà¸à¸©à¸£à¸•่อไปนี้ไม่ได้:"
+
+#: editor/scene_tree_editor.cpp
+msgid "Rename Node"
+msgstr "เปลี่ยนชื่อโหนด"
+
+#: editor/scene_tree_editor.cpp
+msgid "Scene Tree (Nodes):"
+msgstr "ผังฉาภ(โหนด):"
+
+#: editor/scene_tree_editor.cpp
+msgid "Editable Children"
+msgstr "à¹à¸à¹‰à¹„ขโหนดลูà¸à¹„ด้"
+
+#: editor/scene_tree_editor.cpp
+msgid "Load As Placeholder"
+msgstr "โหลดเป็นตัวà¹à¸—น"
+
+#: editor/scene_tree_editor.cpp
+msgid "Discard Instancing"
+msgstr "ยà¸à¹€à¸¥à¸´à¸à¸à¸²à¸£à¸­à¸´à¸™à¸ªà¹à¸•นซ์"
+
+#: editor/scene_tree_editor.cpp
+msgid "Open in Editor"
+msgstr "เปิดในโปรà¹à¸à¸£à¸¡à¹à¸à¹‰à¹„ข"
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear Inheritance"
+msgstr "ลบà¸à¸²à¸£à¸ªà¸·à¸šà¸—อด"
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear Inheritance? (No Undo!)"
+msgstr "ลบà¸à¸²à¸£à¸ªà¸·à¸šà¸—อด? (ย้อนà¸à¸¥à¸±à¸šà¹„ม่ได้!)"
+
+#: editor/scene_tree_editor.cpp
+msgid "Clear!"
+msgstr "ลบ!"
+
+#: editor/scene_tree_editor.cpp
+msgid "Select a Node"
+msgstr "เลือà¸à¹‚หนด"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "สร้างสคริปต์ในระบบไฟล์ไม่ได้"
+
+#: editor/script_create_dialog.cpp
+msgid "Error loading script from %s"
+msgstr "ผิดพลาดขณะโหลดสคริปต์จาภ%s"
+
+#: editor/script_create_dialog.cpp
+msgid "Path is empty"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่ว่างเปล่า"
+
+#: editor/script_create_dialog.cpp
+msgid "Path is not local"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่ไม่ใช่ภายใน"
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid base path"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid extension"
+msgstr "นามสà¸à¸¸à¸¥à¹„ม่ถูà¸à¸•้อง"
+
+#: editor/script_create_dialog.cpp
+msgid "Wrong extension chosen"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Invalid Path"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸œà¸´à¸”พลาด"
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid class name"
+msgstr "ชื่อคลาสไม่ถูà¸à¸•้อง"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "ไม่พบคุณสมบัติ"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Script valid"
+msgstr "สคริปต์"
+
+#: editor/script_create_dialog.cpp
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "N/A"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in script (into scene file)"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Create new script file"
+msgstr "สร้างสคริปต์ใหม่"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Load existing script file"
+msgstr "โหลดสคริปต์ที่มีอยู่เดิม"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Inherits"
+msgstr "สืบทอดจาà¸:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
+msgstr "ชื่อคลาส:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr "ลบà¹à¸¡à¹ˆà¹à¸šà¸š"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
+msgstr "à¸à¸±à¸‡à¸ªà¸„ริปต์"
+
+#: editor/script_create_dialog.cpp
+msgid "Attach Node Script"
+msgstr "เชื่อมสคริปต์ให้โหนด"
+
+#: editor/script_editor_debugger.cpp
+msgid "Bytes:"
+msgstr "ไบต์:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Warning"
+msgstr "คำเตือน"
+
+#: editor/script_editor_debugger.cpp
+msgid "Error:"
+msgstr "ผิดพลาด:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Source:"
+msgstr "ต้นฉบับ:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Function:"
+msgstr "ฟังà¸à¹Œà¸Šà¸±à¸™:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Errors"
+msgstr "ข้อผิดพลาด"
+
+#: editor/script_editor_debugger.cpp
+msgid "Child Process Connected"
+msgstr "เชื่อมà¸à¸£à¸°à¸šà¸§à¸™à¸à¸²à¸£à¹à¸¥à¹‰à¸§"
+
+#: editor/script_editor_debugger.cpp
+msgid "Inspect Previous Instance"
+msgstr "ตรวจสอบอินสà¹à¸•นซ์à¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+
+#: editor/script_editor_debugger.cpp
+msgid "Inspect Next Instance"
+msgstr "ตรวจสอบอินสà¹à¸•นซ์ถัดไป"
+
+#: editor/script_editor_debugger.cpp
+msgid "Stack Frames"
+msgstr "สà¹à¸•ค"
+
+#: editor/script_editor_debugger.cpp
+msgid "Variable"
+msgstr "ตัวà¹à¸›à¸£"
+
+#: editor/script_editor_debugger.cpp
+msgid "Errors:"
+msgstr "ข้อผิดพลาด:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Stack Trace (if applicable):"
+msgstr "สà¹à¸•ค (ถ้ามี):"
+
+#: editor/script_editor_debugger.cpp
+msgid "Remote Inspector"
+msgstr "คุณสมบัติ"
+
+#: editor/script_editor_debugger.cpp
+msgid "Live Scene Tree:"
+msgstr "ผังฉาà¸à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Remote Object Properties: "
+msgstr "คุณสมบัติ: "
+
+#: editor/script_editor_debugger.cpp
+msgid "Profiler"
+msgstr "ประสิทธิภาพ"
+
+#: editor/script_editor_debugger.cpp
+msgid "Monitor"
+msgstr "ข้อมูล"
+
+#: editor/script_editor_debugger.cpp
+msgid "Value"
+msgstr "ค่า"
+
+#: editor/script_editor_debugger.cpp
+msgid "Monitors"
+msgstr "à¸à¸²à¸£à¸ªà¸±à¸‡à¹€à¸à¸•à¸à¸²à¸£à¸“์"
+
+#: editor/script_editor_debugger.cpp
+msgid "List of Video Memory Usage by Resource:"
+msgstr "รายชื่อรีซอร์สที่ใช้หน่วยความจำวีดีโอ:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Total:"
+msgstr "ทั้งหมด:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Video Mem"
+msgstr "หน่วยความจำวีดีโอ"
+
+#: editor/script_editor_debugger.cpp
+msgid "Resource Path"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ª"
+
+#: editor/script_editor_debugger.cpp
+msgid "Type"
+msgstr "ประเภท"
+
+#: editor/script_editor_debugger.cpp
+msgid "Usage"
+msgstr "ใช้"
+
+#: editor/script_editor_debugger.cpp
+msgid "Misc"
+msgstr "อื่น ๆ"
+
+#: editor/script_editor_debugger.cpp
+msgid "Clicked Control:"
+msgstr "คอนโทรลที่คลิà¸:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Clicked Control Type:"
+msgstr "ประเภทของคอนโทรลที่คลิà¸:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Live Edit Root:"
+msgstr "ราà¸à¸œà¸±à¸‡à¸‰à¸²à¸:"
+
+#: editor/script_editor_debugger.cpp
+msgid "Set From Tree"
+msgstr "à¸à¸³à¸«à¸™à¸”จาà¸à¸œà¸±à¸‡"
+
+#: editor/settings_config_dialog.cpp
+msgid "Shortcuts"
+msgstr "ทางลัด"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Light Radius"
+msgstr "ปรับรัศมีà¹à¸ªà¸‡"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Camera FOV"
+msgstr "ปรับ FOV à¸à¸¥à¹‰à¸­à¸‡"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Camera Size"
+msgstr "ปรับขนาดà¸à¸¥à¹‰à¸­à¸‡"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Sphere Shape Radius"
+msgstr "ปรับรัศมีทรงà¸à¸¥à¸¡"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Box Shape Extents"
+msgstr "ปรับขนาดทรงสี่เหลี่ยม"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Capsule Shape Radius"
+msgstr "ปรับรัศมีทรงà¹à¸„ปซูล"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Capsule Shape Height"
+msgstr "ปรับความสูงทรงà¹à¸„ปซูล"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Ray Shape Length"
+msgstr "ปรับความยาวรังสี"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Notifier Extents"
+msgstr "à¹à¸à¹‰à¹„ขขนาด Notifier"
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Probe Extents"
+msgstr "à¹à¸à¹‰à¹„ขขนาด Probe"
+
+#: modules/gdscript/gd_functions.cpp
+#: modules/visual_script/visual_script_builtin_funcs.cpp
+msgid "Invalid type argument to convert(), use TYPE_* constants."
+msgstr "ตัวà¹à¸›à¸£à¹ƒà¸™ convert() ผิดพลาด ใช้ค่าคงที่ TYPE_* เท่านั้น"
+
+#: modules/gdscript/gd_functions.cpp
+#: modules/visual_script/visual_script_builtin_funcs.cpp
+msgid "Not enough bytes for decoding bytes, or invalid format."
+msgstr "ไบต์ไม่ครบหรือผิดรูปà¹à¸šà¸š ไม่สามารถà¹à¸›à¸¥à¸‡à¸„่าได้"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "step argument is zero!"
+msgstr "ตัวà¹à¸›à¸£ step เป็นศูนย์!"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not a script with an instance"
+msgstr "ไม่ใช่สคริปต์ที่มีอินสà¹à¸•นซ์"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not based on a script"
+msgstr "ไม่ได้มีต้นà¸à¸³à¹€à¸™à¸´à¸”จาà¸à¸ªà¸„ริปต์"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Not based on a resource file"
+msgstr "ไม่ได้มีต้นà¸à¸³à¹€à¸™à¸´à¸”มาจาà¸à¹„ฟล์รีซอร์ส"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (missing @path)"
+msgstr "รูปà¹à¸šà¸šà¸”ิà¸à¸Šà¸±à¸™à¸™à¸²à¸£à¸µà¸—ี่เà¸à¹‡à¸šà¸­à¸´à¸™à¸ªà¹à¸•นซ์ไม่ถูà¸à¸•้อง (ไม่มี @path)"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (can't load script at @path)"
+msgstr "รูปà¹à¸šà¸šà¸”ิà¸à¸Šà¸±à¸™à¸™à¸²à¸£à¸µà¸—ี่เà¸à¹‡à¸šà¸­à¸´à¸™à¸ªà¹à¸•นซ์ไม่ถูà¸à¸•้อง (โหลดสคริปต์ที่ @path ไม่ได้)"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary format (invalid script at @path)"
+msgstr "รูปà¹à¸šà¸šà¸”ิà¸à¸Šà¸±à¸™à¸™à¸²à¸£à¸µà¸—ี่เà¸à¹‡à¸šà¸­à¸´à¸™à¸ªà¹à¸•นซ์ไม่ถูà¸à¸•้อง (สคริปต์ที่ @path ผิดพลาด)"
+
+#: modules/gdscript/gd_functions.cpp
+msgid "Invalid instance dictionary (invalid subclasses)"
+msgstr "ดิà¸à¸Šà¸±à¸™à¸™à¸²à¸£à¸µà¸—ี่เà¸à¹‡à¸šà¸­à¸´à¸™à¸ªà¹à¸•นซ์ผิดพลาด (คลาสย่อยผิดพลาด)"
+
+#: modules/visual_script/visual_script.cpp
+#, fuzzy
+msgid ""
+"A node yielded without working memory, please read the docs on how to yield "
+"properly!"
+msgstr ""
+"โหนดหยุดพัà¸à¹‚ปรà¹à¸à¸£à¸¡à¹‚ดยที่ไม่มีหน่วยความจำทำงาน à¸à¸£à¸¸à¸“าอ่านคู่มือเพื่อหยุดพัà¸à¹‚ปรà¹à¸à¸£à¸¡à¹ƒà¸«à¹‰à¸–ูà¸à¸•้อง!"
+
+#: modules/visual_script/visual_script.cpp
+#, fuzzy
+msgid ""
+"Node yielded, but did not return a function state in the first working "
+"memory."
+msgstr "โหนดหยุดพัภà¹à¸•่ไม่ได้คืนสถานะฟังà¸à¹Œà¸Šà¸±à¸™à¹ƒà¸™à¸«à¸™à¹ˆà¸§à¸¢à¸„วามจำทำงานà¹à¸£à¸"
+
+#: modules/visual_script/visual_script.cpp
+#, fuzzy
+msgid ""
+"Return value must be assigned to first element of node working memory! Fix "
+"your node please."
+msgstr "ค่าที่คืนจะต้องà¸à¸³à¸«à¸™à¸”ในหน่วยความจำทำงานà¹à¸£à¸! à¸à¸£à¸¸à¸“าà¹à¸à¹‰à¹„ขโหนด"
+
+#: modules/visual_script/visual_script.cpp
+msgid "Node returned an invalid sequence output: "
+msgstr "โหนดคืนค่าผิดลำดับ: "
+
+#: modules/visual_script/visual_script.cpp
+msgid "Found sequence bit but not the node in the stack, report bug!"
+msgstr "พบบิตลำดับà¹à¸•่ไม่พบโหนดในสà¹à¸•ค à¸à¸£à¸¸à¸“ารายงานข้อผิดพลาด!"
+
+#: modules/visual_script/visual_script.cpp
+msgid "Stack overflow with stack depth: "
+msgstr "สà¹à¸•คล้น ความสูงสà¹à¸•ค: "
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Functions:"
+msgstr "ฟังà¸à¹Œà¸Šà¸±à¸™:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Variables:"
+msgstr "ตัวà¹à¸›à¸£:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Name is not a valid identifier:"
+msgstr "ไม่สามารถใช้ชื่อนี้ได้:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Name already in use by another func/var/signal:"
+msgstr "มีฟังà¸à¹Œà¸Šà¸±à¸™/ตัวà¹à¸›à¸£/สัà¸à¸à¸²à¸“อื่นใช้ชื่อนี้à¹à¸¥à¹‰à¸§:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Function"
+msgstr "เปลี่ยนชื่อฟังà¸à¹Œà¸Šà¸±à¸™"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Variable"
+msgstr "เปลี่ยนชื่อตัวà¹à¸›à¸£"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Signal"
+msgstr "เปลี่ยนชื่อสัà¸à¸à¸²à¸“"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Function"
+msgstr "เพิ่มฟังà¸à¹Œà¸Šà¸±à¸™"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Variable"
+msgstr "เพิ่มตัวà¹à¸›à¸£"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Signal"
+msgstr "เพิ่มสัà¸à¸à¸²à¸“"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Function"
+msgstr "ลบฟังà¸à¹Œà¸Šà¸±à¸™"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Variable"
+msgstr "ลบตัวà¹à¸›à¸£"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Editing Variable:"
+msgstr "à¹à¸à¹‰à¹„ขตัวà¹à¸›à¸£:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Signal"
+msgstr "ลบสัà¸à¸à¸²à¸“"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Editing Signal:"
+msgstr "à¹à¸à¹‰à¹„ขสัà¸à¸à¸²à¸“:"
+
+#: modules/visual_script/visual_script_editor.cpp
+#, fuzzy
+msgid "Change Expression"
+msgstr "à¹à¸à¹‰à¹„ขสมà¸à¸²à¸£"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Node"
+msgstr "เพิ่มโหนด"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature."
+msgstr "à¸à¸”ปุ่ม Meta ค้างเพื่อวาง Getter à¸à¸” Shift ค้างเพื่อวาง generic signature"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature."
+msgstr "à¸à¸” Ctrl ค้างเพื่อวาง Getter à¸à¸” Shift ค้างเพื่อวาง generic signature"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a simple reference to the node."
+msgstr "à¸à¸”ปุ่ม Meta เพื่อวางà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¹„ปยังโหนดอย่างง่าย"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a simple reference to the node."
+msgstr "à¸à¸” Ctrl เพื่อวางà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¹„ปยังโหนดอย่างง่าย"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Meta to drop a Variable Setter."
+msgstr "à¸à¸”ปุ่ม Meta ค้างเพื่อวาง Setter ของตัวà¹à¸›à¸£"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a Variable Setter."
+msgstr "à¸à¸” Ctrl ค้างเพื่อวาง Setter ของตัวà¹à¸›à¸£"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Preload Node"
+msgstr "เพิ่มโหนด Preload"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Node(s) From Tree"
+msgstr "เพิ่มโหนดจาà¸à¸œà¸±à¸‡"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Getter Property"
+msgstr "เพิ่มตัวรับคุณสมบัติ"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Setter Property"
+msgstr "เพิ่มตัวà¸à¸³à¸«à¸™à¸”คุณสมบัติ"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Condition"
+msgstr "เงื่อนไข"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Sequence"
+msgstr "ลำดับ"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Switch"
+msgstr "ทางเลือà¸"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Iterator"
+msgstr "ตัววนซ้ำ"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "While"
+msgstr "ทำซ้ำถ้าเงื่อนไขเป็นจริง"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Return"
+msgstr "คืนค่า"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Get"
+msgstr "รับ"
+
+#: modules/visual_script/visual_script_editor.cpp
+#, fuzzy
+msgid "Base Type:"
+msgstr "ชนิด:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Available Nodes:"
+msgstr "โหนดที่มีให้ใช้:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Select or create a function to edit graph"
+msgstr "เลือà¸à¸«à¸£à¸·à¸­à¸ªà¸£à¹‰à¸²à¸‡à¸Ÿà¸±à¸‡à¸à¹Œà¸Šà¸±à¸™à¹€à¸žà¸·à¹ˆà¸­à¹à¸à¹‰à¹„ขà¸à¸£à¸²à¸Ÿ"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Signal Arguments:"
+msgstr "à¹à¸à¹‰à¹„ขตัวà¹à¸›à¸£à¸ªà¸±à¸à¸à¸²à¸“:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Variable:"
+msgstr "à¹à¸à¹‰à¹„ขตัวà¹à¸›à¸£:"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change"
+msgstr "เปลี่ยน"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Delete Selected"
+msgstr "ลบสิ่งที่เลือà¸"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Find Node Type"
+msgstr "หาประเภทของโหนด"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Copy Nodes"
+msgstr "คัดลอà¸à¹‚หนด"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Cut Nodes"
+msgstr "ตัดโหนด"
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Paste Nodes"
+msgstr "วางโหนด"
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Input type not iterable: "
+msgstr "ตัวà¹à¸›à¸£à¸›à¸£à¸°à¹€à¸ à¸—นี้ใช้วนซ้ำไม่ได้: "
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Iterator became invalid"
+msgstr "ตัววนซ้ำใช้ไม่ได้อีà¸à¸•่อไป"
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Iterator became invalid: "
+msgstr "ตัววนซ้ำใช้ไม่ได้: "
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Invalid index property name."
+msgstr "ไม่พบคุณสมบัติ"
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+#, fuzzy
+msgid "Base object is not a Node!"
+msgstr "วัตถุนี้ไม่ใช่โหนด!"
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+#, fuzzy
+msgid "Path does not lead Node!"
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่ระบุไม่ได้นำไปยังโหนด!"
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Invalid index property name '%s' in node %s."
+msgstr "ไม่พบคุณสมบัติ '%s' ในโหนด %s"
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ": Invalid argument of type: "
+msgstr ": ประเภทตัวà¹à¸›à¸£à¹„ม่ถูà¸à¸•้อง: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ": Invalid arguments: "
+msgstr ": ตัวà¹à¸›à¸£à¹„ม่ถูà¸à¸•้อง: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "VariableGet not found in script: "
+msgstr "ไม่พบ VariableGet ในสคริปต์: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "VariableSet not found in script: "
+msgstr "ไม่พบ VariableSet ในสคริปต์: "
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "Custom node has no _step() method, can't process graph."
+msgstr "โหนดà¸à¸³à¸«à¸™à¸”เองไม่มีเมท็อด _step() ไม่สามารถประมวลผลà¸à¸£à¸²à¸Ÿà¹„ด้"
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ""
+"Invalid return value from _step(), must be integer (seq out), or string "
+"(error)."
+msgstr "ค่าคืนจาภ_step() ผิดพลาด ต้องเป็นจำนวนเต็ม (ลำดับ) หรือสตริง (ข้อผิดพลาด)"
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "just pressed"
+msgstr "เพิ่งà¸à¸”"
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "just released"
+msgstr "เพิ่งปล่อย"
+
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr "รันในเบราเซอร์"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr "รันไฟล์ HTML ที่ส่งออà¸à¹ƒà¸™à¹€à¸šà¸£à¸²à¹€à¸‹à¸­à¸£à¹Œ"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr "เขียนไฟล์ไม่ได้:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr "อ่านไฟล์ไม่ได้:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr "เปิดà¹à¸¡à¹ˆà¹à¸šà¸šà¹€à¸žà¸·à¹ˆà¸­à¸ªà¹ˆà¸‡à¸­à¸­à¸à¹„ม่ได้:\n"
+
+#: platform/uwp/export/export.cpp
+msgid ""
+"Couldn't read the certificate file. Are the path and password both correct?"
+msgstr "ไม่สามารถอ่านไฟล์ใบรับรองได้ ตำà¹à¸«à¸™à¹ˆà¸‡à¹„ฟล์à¹à¸¥à¸°à¸£à¸«à¸±à¸ªà¸œà¹ˆà¸²à¸™à¸–ูà¸à¸•้องหรือไม่?"
+
+#: platform/uwp/export/export.cpp
+msgid "Error creating the signature object."
+msgstr "ผิดพลาดขณะสร้าง signature object"
+
+#: platform/uwp/export/export.cpp
+msgid "Error creating the package signature."
+msgstr "ผิดพลาดขณะสร้าง signature ของà¹à¸žà¸„เà¸à¸ˆ"
+
+#: platform/uwp/export/export.cpp
+msgid ""
+"No export templates found.\n"
+"Download and install export templates."
+msgstr ""
+"ไม่มีà¹à¸¡à¹ˆà¹à¸šà¸šà¸ªà¸³à¸«à¸£à¸±à¸šà¸ªà¹ˆà¸‡à¸­à¸­à¸\n"
+"ดาวน์โหลดà¹à¸¥à¸°à¸•ิดตั้งà¹à¸¡à¹ˆà¹à¸šà¸š"
+
+#: platform/uwp/export/export.cpp
+msgid "Custom debug package not found."
+msgstr "ไม่พบà¹à¸žà¸„เà¸à¸ˆà¸”ีบัคที่à¸à¸³à¸«à¸™à¸”"
+
+#: platform/uwp/export/export.cpp
+msgid "Custom release package not found."
+msgstr "ไม่พบà¹à¸žà¸„เà¸à¸ˆà¸ˆà¸³à¸«à¸™à¹ˆà¸²à¸¢à¸—ี่à¸à¸³à¸«à¸™à¸”"
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid unique name."
+msgstr "ชื่อเฉพาะไม่ถูà¸à¸•้อง"
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid product GUID."
+msgstr "GUID ของโปรà¹à¸à¸£à¸¡à¹„ม่ถูà¸à¸•้อง"
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid publisher GUID."
+msgstr "GUID ของผู้จัดจำหน่ายไม่ถูà¸à¸•้อง"
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid background color."
+msgstr "สีพื้นหลังผิดพลาด"
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid Store Logo image dimensions (should be 50x50)."
+msgstr "ขนาดรูปโลโà¸à¹‰ Store ผิดพลาด (ต้องเป็น 50x50)"
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 44x44 logo image dimensions (should be 44x44)."
+msgstr "ขนาดโลโà¸à¹‰à¸ˆà¸±à¸•ุรัส 44x44 ผิดพลาด (ต้องเป็น 44x44)"
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 71x71 logo image dimensions (should be 71x71)."
+msgstr "ขนาดโลโà¸à¹‰à¸ˆà¸±à¸•ุรัส 71x71 ผิดพลาด (ต้องเป็น 71x71)"
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 150x150 logo image dimensions (should be 150x150)."
+msgstr "ขนาดโลโà¸à¹‰à¸ˆà¸±à¸•ุรัส 150x150 ผิดพลาด (ต้องเป็น 150x150)"
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid square 310x310 logo image dimensions (should be 310x310)."
+msgstr "ขนาดโลโà¸à¹‰à¸ˆà¸±à¸•ุรัส 310x310 ผิดพลาด (ต้องเป็น 310x310)"
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)."
+msgstr "ขนาดโลโà¸à¹‰à¸à¸§à¹‰à¸²à¸‡ 310x150 ผิดพลาด (ต้องเป็น 310x150)"
+
+#: platform/uwp/export/export.cpp
+msgid "Invalid splash screen image dimensions (should be 620x300)."
+msgstr "ขนาดรูปหน้าจอเริ่มโปรà¹à¸à¸£à¸¡à¸œà¸´à¸”พลาด (ต้องเป็น 620x300)"
+
+#: scene/2d/animated_sprite.cpp
+msgid ""
+"A SpriteFrames resource must be created or set in the 'Frames' property in "
+"order for AnimatedSprite to display frames."
+msgstr "ต้องมี SpriteFrames ใน 'Frames' เพื่อให้ AnimatedSprite à¹à¸ªà¸”งผลได้"
+
+#: scene/2d/canvas_modulate.cpp
+msgid ""
+"Only one visible CanvasModulate is allowed per scene (or set of instanced "
+"scenes). The first created one will work, while the rest will be ignored."
+msgstr ""
+"จะมี CanvasModulate ที่มองเห็นได้เพียงโหนดเดียวในฉาภ(หรือà¸à¸¥à¸¸à¹ˆà¸¡à¸‚องฉาà¸à¸—ี่เป็นอินสà¹à¸•นซ์) "
+"โหนดà¹à¸£à¸à¹€à¸—่านั้นที่จะทำงานได้ปà¸à¸•ิ ที่เหลือจะไม่ทำงาน"
+
+#: scene/2d/collision_polygon_2d.cpp
+msgid ""
+"CollisionPolygon2D only serves to provide a collision shape to a "
+"CollisionObject2D derived node. Please only use it as a child of Area2D, "
+"StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."
+msgstr ""
+"CollisionPolygon2D ใช้เป็นรูปทรงสำหรับโหนดà¸à¸¥à¸¸à¹ˆà¸¡ CollisionObject2D "
+"จึงควรให้เป็นโหนดลูà¸à¸‚อง Area2D, StaticBody2D, RigidBody2D, KinematicBody2D ฯลฯ "
+"เพื่อให้มีรูปทรง"
+
+#: scene/2d/collision_polygon_2d.cpp
+msgid "An empty CollisionPolygon2D has no effect on collision."
+msgstr "CollisionPolygon2D ที่ว่างเปล่าจะไม่มีผลทางà¸à¸²à¸¢à¸ à¸²à¸ž"
+
+#: scene/2d/collision_shape_2d.cpp
+msgid ""
+"CollisionShape2D only serves to provide a collision shape to a "
+"CollisionObject2D derived node. Please only use it as a child of Area2D, "
+"StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."
+msgstr ""
+"CollisionShape2D ใช้เป็นรูปทรงสำหรับโหนดà¸à¸¥à¸¸à¹ˆà¸¡ CollisionObject2D "
+"จึงควรให้เป็นโหนดลูà¸à¸‚อง Area2D, StaticBody2D, RigidBody2D, KinematicBody2D ฯลฯ "
+"เพื่อให้มีรูปทรง"
+
+#: scene/2d/collision_shape_2d.cpp
+msgid ""
+"A shape must be provided for CollisionShape2D to function. Please create a "
+"shape resource for it!"
+msgstr "ต้องมีรูปทรงเพื่อให้ CollisionShape2D ทำงานได้ à¸à¸£à¸¸à¸“าสร้างรูปทรง!"
+
+#: scene/2d/light_2d.cpp
+msgid ""
+"A texture with the shape of the light must be supplied to the 'texture' "
+"property."
+msgstr "ต้องมีรูปร่างของà¹à¸ªà¸‡à¸­à¸¢à¸¹à¹ˆà¹ƒà¸™ 'texture'"
+
+#: scene/2d/light_occluder_2d.cpp
+msgid ""
+"An occluder polygon must be set (or drawn) for this occluder to take effect."
+msgstr "ต้องมีรูปหลายเหลี่ยมเพื่อให้ตัวบังà¹à¸ªà¸‡à¸™à¸µà¹‰à¸—ำงานได้"
+
+#: scene/2d/light_occluder_2d.cpp
+msgid "The occluder polygon for this occluder is empty. Please draw a polygon!"
+msgstr "รูปหลายเหลี่ยมของตัวบังà¹à¸ªà¸‡à¸™à¸µà¹‰à¸§à¹ˆà¸²à¸‡à¹€à¸›à¸¥à¹ˆà¸² à¸à¸£à¸¸à¸“าวาดรูปหลายเหลี่ยม!"
+
+#: scene/2d/navigation_polygon.cpp
+msgid ""
+"A NavigationPolygon resource must be set or created for this node to work. "
+"Please set a property or draw a polygon."
+msgstr ""
+"ต้องมี NavigationPolygon เพื่อให้โหนดนี้ทำงานได้ à¸à¸£à¸¸à¸“าà¹à¸à¹‰à¹„ขคุณสมบัติหรือวาดรูปหลายเหลี่ยม"
+
+#: scene/2d/navigation_polygon.cpp
+msgid ""
+"NavigationPolygonInstance must be a child or grandchild to a Navigation2D "
+"node. It only provides navigation data."
+msgstr ""
+"NavigationPolygonInstance ต้องเป็นโหนดลูà¸/หลานของโหนด Navigation2D "
+"เนื่องจาà¸à¹‚หนดนี้ใช้เà¸à¹‡à¸šà¸‚้อมูลà¸à¸²à¸£à¸™à¸³à¸—างเท่านั้น"
+
+#: scene/2d/parallax_layer.cpp
+msgid ""
+"ParallaxLayer node only works when set as child of a ParallaxBackground node."
+msgstr "ParallaxLayer จะทำงานได้ต้องเป็นโหนดลูà¸à¸‚องโหนด ParallaxBackground"
+
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
+
+#: scene/2d/path_2d.cpp
+msgid "PathFollow2D only works when set as a child of a Path2D node."
+msgstr "PathFollow2D จะทำงานได้ต้องเป็นโหนดลูà¸à¸‚องโหนด Path2D"
+
+#: scene/2d/remote_transform_2d.cpp
+msgid "Path property must point to a valid Node2D node to work."
+msgstr "ต้องà¹à¸à¹‰à¹„ข Path ให้ชี้ไปยังโหนด Node2D จึงจะทำงานได้"
+
+#: scene/2d/sprite.cpp
+msgid ""
+"Path property must point to a valid Viewport node to work. Such Viewport "
+"must be set to 'render target' mode."
+msgstr ""
+"ต้องà¹à¸à¹‰à¹„ข Path ให้ชี้ไปยังโหนด Viewport จึงจะทำงานได้ à¹à¸¥à¸° Viewport นั้นต้องปรับโหมดเป็น "
+"'render target'"
+
+#: scene/2d/sprite.cpp
+msgid ""
+"The Viewport set in the path property must be set as 'render target' in "
+"order for this sprite to work."
+msgstr "Viewport ใน path จะต้องปรับโหมดเป็น 'render target' จึงจะทำงานได้"
+
+#: scene/2d/visibility_notifier_2d.cpp
+msgid ""
+"VisibilityEnable2D works best when used with the edited scene root directly "
+"as parent."
+msgstr "VisibilityEnable2D ควรจะเป็นโหนดลูà¸à¸‚องโหนดหลัà¸à¹ƒà¸™à¸‰à¸²à¸à¸™à¸µà¹‰"
+
+#: scene/3d/body_shape.cpp
+msgid ""
+"CollisionShape only serves to provide a collision shape to a CollisionObject "
+"derived node. Please only use it as a child of Area, StaticBody, RigidBody, "
+"KinematicBody, etc. to give them a shape."
+msgstr ""
+"CollisionShape ใช้เป็นรูปทรงสำหรับโหนดà¸à¸¥à¸¸à¹ˆà¸¡ CollisionObject จึงควรให้เป็นโหนดลูà¸à¸‚อง "
+"Area, StaticBody, RigidBody, KinematicBody ฯลฯ เพื่อให้มีรูปทรง"
+
+#: scene/3d/body_shape.cpp
+msgid ""
+"A shape must be provided for CollisionShape to function. Please create a "
+"shape resource for it!"
+msgstr "ต้องมีรูปทรงเพื่อให้ CollisionShape ทำงานได้ à¸à¸£à¸¸à¸“าสร้างรูปทรง!"
+
+#: scene/3d/collision_polygon.cpp
+msgid ""
+"CollisionPolygon only serves to provide a collision shape to a "
+"CollisionObject derived node. Please only use it as a child of Area, "
+"StaticBody, RigidBody, KinematicBody, etc. to give them a shape."
+msgstr ""
+"CollisionPolygon ใช้เป็นรูปทรงสำหรับโหนดà¸à¸¥à¸¸à¹ˆà¸¡ CollisionObject จึงควรให้เป็นโหนดลูà¸à¸‚อง "
+"Area, StaticBody, RigidBody, KinematicBody ฯลฯ เพื่อให้มีรูปทรง"
+
+#: scene/3d/collision_polygon.cpp
+msgid "An empty CollisionPolygon has no effect on collision."
+msgstr "CollisionPolygon ที่ว่างเปล่าจะไม่มีผลทางà¸à¸²à¸¢à¸ à¸²à¸ž"
+
+#: scene/3d/navigation_mesh.cpp
+msgid "A NavigationMesh resource must be set or created for this node to work."
+msgstr "ต้องมี NavigationMesh เพื่อให้โหนดนี้ทำงานได้"
+
+#: scene/3d/navigation_mesh.cpp
+msgid ""
+"NavigationMeshInstance must be a child or grandchild to a Navigation node. "
+"It only provides navigation data."
+msgstr ""
+"NavigationMeshInstance ต้องเป็นโหนดลูà¸/หลานของโหนด Navigation "
+"โหนดนี้ใช้เพื่อเป็นข้อมูลในà¸à¸²à¸£à¸™à¸³à¸—างเท่านั้น"
+
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
+#: scene/3d/remote_transform.cpp
+msgid "Path property must point to a valid Spatial node to work."
+msgstr "ต้องà¹à¸à¹‰à¹„ข Path ให้ชี้ไปยังโหนด Spatial จึงจะทำงานได้"
+
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
+msgstr "จะมี WorldEnvironment ได้เพียงโหนดเดียวในฉาภ(หรือà¸à¸¥à¸¸à¹ˆà¸¡à¸‚องฉาà¸à¸—ี่เป็นอินสà¹à¸•นซ์)"
+
+#: scene/3d/sprite_3d.cpp
+msgid ""
+"A SpriteFrames resource must be created or set in the 'Frames' property in "
+"order for AnimatedSprite3D to display frames."
+msgstr "ต้องมี SpriteFrames ใน 'Frames' เพื่อให้ AnimatedSprite3D à¹à¸ªà¸”งผลได้"
+
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "โหมดหมุน"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
+#: scene/gui/dialogs.cpp
+msgid "Alert!"
+msgstr "à¹à¸ˆà¹‰à¸‡à¹€à¸•ือน!"
+
+#: scene/gui/dialogs.cpp
+msgid "Please Confirm..."
+msgstr "à¸à¸£à¸¸à¸“ายืนยัน..."
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a File"
+msgstr "เปิดไฟล์"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open File(s)"
+msgstr "เปิดไฟล์"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a Directory"
+msgstr "เปิดโฟลเดอร์"
+
+#: scene/gui/file_dialog.cpp
+msgid "Open a File or Directory"
+msgstr "เปิดไฟล์หรือโฟลเดอร์"
+
+#: scene/gui/input_action.cpp
+msgid "Ctrl+"
+msgstr "Ctrl+"
+
+#: scene/gui/popup.cpp
+msgid ""
+"Popups will hide by default unless you call popup() or any of the popup*() "
+"functions. Making them visible for editing is fine though, but they will "
+"hide upon running."
+msgstr ""
+"ปà¸à¸•ิป๊อปอัพจะถูà¸à¸‹à¹ˆà¸­à¸™à¸ˆà¸™à¸à¸§à¹ˆà¸²à¸ˆà¸°à¸¡à¸µà¸à¸²à¸£à¹€à¸£à¸µà¸¢à¸à¹ƒà¸Šà¹‰à¸Ÿà¸±à¸‡à¸à¹Œà¸Šà¸±à¸™ popup() หรือ popup*() "
+"โดยขณะà¹à¸à¹‰à¹„ขสามารถเปิดให้มองเห็นได้ à¹à¸•่เมื่อเริ่มโปรà¹à¸à¸£à¸¡à¸›à¹Šà¸­à¸›à¸­à¸±à¸žà¸ˆà¸°à¸–ูà¸à¸‹à¹ˆà¸­à¸™"
+
+#: scene/gui/scroll_container.cpp
+msgid ""
+"ScrollContainer is intended to work with a single child control.\n"
+"Use a container as child (VBox,HBox,etc), or a Control and set the custom "
+"minimum size manually."
+msgstr ""
+"ScrollContainer ทำงานได้เมื่อมีโหนดลูà¸à¹€à¸žà¸µà¸¢à¸‡à¸«à¸™à¸¶à¹ˆà¸‡à¹‚หนดเท่านั้น\n"
+"ใช้ container เป็นโหนดลูภ(VBox,HBox,ฯลฯ) หรือโหนดà¸à¸¥à¸¸à¹ˆà¸¡ Control "
+"à¹à¸¥à¸°à¸›à¸£à¸±à¸šà¸‚นาดเล็à¸à¸ªà¸¸à¸”ด้วยตนเอง"
+
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
+#: scene/main/viewport.cpp
+msgid ""
+"This viewport is not set as render target. If you intend for it to display "
+"its contents directly to the screen, make it a child of a Control so it can "
+"obtain a size. Otherwise, make it a RenderTarget and assign its internal "
+"texture to some node for display."
+msgstr ""
+"Viewport นี้ไม่ได้เป็น render target ถ้าท่านต้องà¸à¸²à¸£à¹à¸ªà¸”งผลบนหน้าจอโดยตรง "
+"ให้à¹à¸à¹‰à¹„ขโหนดนี้ให้เป็นโหนดลูà¸à¸‚อง Control à¹à¸•่ถ้าไม่ ให้ปรับเป็น render target à¹à¸¥à¸°à¸™à¸³à¹„ปใช้เป็น "
+"texture ของโหนดอื่น"
+
+#~ msgid "Node From Scene"
+#~ msgstr "โหนดจาà¸à¸‰à¸²à¸"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "นำเข้าไฟล์มายังโปรเจà¸à¸•์"
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "ส่งออà¸à¹‚ปรเจà¸à¸•์ไปยังà¹à¸žà¸¥à¸•ฟอร์มต่าง ๆ"
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "เตือนเมื่อมีà¸à¸²à¸£à¹à¸à¹‰à¹„ขรีซอร์สภายนอà¸"
+
+#~ msgid "Tutorials"
+#~ msgstr "คู่มือ"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "เปิดคู่มือจาภhttps://godotengine.org"
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "ไม่ได้เลือà¸à¸‰à¸²à¸à¸—ี่จะอินสà¹à¸•นซ์!"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "อินสà¹à¸•นซ์ที่เคอร์เซอร์"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "อินสà¹à¸•นซ์ฉาà¸à¹„ม่ได้!"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "สีของà¹à¸ªà¸‡à¹‚ดยรอบ:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "โหลดภาพไม่ได้"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "ชื่อคลาสà¹à¸¡à¹ˆà¹„ม่ถูà¸à¸•้อง"
+
+#~ msgid "Valid chars:"
+#~ msgstr "อัà¸à¸‚ระที่ใช้ได้:"
+
+#~ msgid "Valid name"
+#~ msgstr "ชื่อที่ใช้ได้"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "ชื่อคลาสไม่ถูà¸à¸•้อง!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "ชื่อคลาสà¹à¸¡à¹ˆà¹„ม่ถูà¸à¸•้อง!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่ไม่ถูà¸à¸•้อง!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr "ต้องà¹à¸à¹‰à¹„ข Path ให้ชี้ไปยังโหนด Particles2D จึงจะทำงานได้"
+
+#~ msgid "Surface"
+#~ msgstr "พื้นผิว"
+
+#, fuzzy
+#~ msgid ""
+#~ "A SampleLibrary resource must be created or set in the 'samples' property "
+#~ "in order for SamplePlayer to play sound."
+#~ msgstr "ต้องมี SampleLibrary ใน 'samples' เพื่อให้ SamplePlayer เล่นเสียงได้"
+
+#, fuzzy
+#~ msgid ""
+#~ "A SampleLibrary resource must be created or set in the 'samples' property "
+#~ "in order for SpatialSamplePlayer to play sound."
+#~ msgstr "ต้องมี SampleLibrary ใน 'samples' เพื่อให้ SpatialSamplePlayer เล่นเสียงได้"
+
+#, fuzzy
+#~ msgid "Replaced %d Ocurrence(s)."
+#~ msgstr "à¹à¸—นที่à¹à¸¥à¹‰à¸§ %d ครั้ง"
+
+#~ msgid "Please save the scene first."
+#~ msgstr "à¸à¸£à¸¸à¸“าบันทึà¸à¸‰à¸²à¸à¸à¹ˆà¸­à¸™"
+
+#, fuzzy
+#~ msgid "Save Translatable Strings"
+#~ msgstr "บันทึà¸à¸ªà¸•ริงหลายภาษา"
+
+#~ msgid "Translatable Strings.."
+#~ msgstr "สตริงหลายภาษา.."
+
+#~ msgid "Install Export Templates"
+#~ msgstr "ติดตั้งà¹à¸¡à¹ˆà¹à¸šà¸šà¸ªà¹ˆà¸‡à¸­à¸­à¸"
+
+#~ msgid "Edit Script Options"
+#~ msgstr "à¹à¸à¹‰à¹„ขตัวเลือà¸à¸ªà¸„ริปต์"
+
+#~ msgid "Please export outside the project folder!"
+#~ msgstr "à¸à¸£à¸¸à¸“าส่งออà¸à¹„ปนอà¸à¹‚ฟลเดอร์โปรเจà¸à¸•์!"
+
+#~ msgid "Error exporting project!"
+#~ msgstr "ผิดพลาดขณะส่งออà¸à¹‚ปรเจà¸à¸•์!"
+
+#~ msgid "Error writing the project PCK!"
+#~ msgstr "ผิดพลาดขณะเขียนไฟล์ PCK!"
+
+#~ msgid "No exporter for platform '%s' yet."
+#~ msgstr "ยังไม่มีตัวส่งออà¸à¸ªà¸³à¸«à¸£à¸±à¸šà¹à¸žà¸¥à¸•ฟอร์ม '%s'"
+
+#~ msgid "Create Android keystore"
+#~ msgstr "สร้าง Android keystore"
+
+#~ msgid "Full name"
+#~ msgstr "ชื่อเต็ม"
+
+#~ msgid "Organization"
+#~ msgstr "องค์à¸à¸£"
+
+#~ msgid "City"
+#~ msgstr "เมือง"
+
+#~ msgid "State"
+#~ msgstr "รัà¸"
+
+#~ msgid "2 letter country code"
+#~ msgstr "รหัสประเทศ 2 ตัวอัà¸à¸©à¸£"
+
+#~ msgid "Password"
+#~ msgstr "รหัสผ่าน"
+
+#~ msgid "at least 6 characters"
+#~ msgstr "อย่างน้อย 6 ตัวอัà¸à¸©à¸£"
+
+#~ msgid "File name"
+#~ msgstr "ชื่อไฟล์"
+
+#~ msgid "Path : (better to save outside of project)"
+#~ msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¹„ฟล์ : (ควรบันทึà¸à¸™à¸­à¸à¹‚ปรเจà¸à¸•์)"
+
+#~ msgid ""
+#~ "Release keystore is not set.\n"
+#~ "Do you want to create one?"
+#~ msgstr ""
+#~ "ยังไม่มี keystore สำหรับส่งออà¸\n"
+#~ "สร้างใหม่?"
+
+#~ msgid "Fill Keystore/Release User and Release Password"
+#~ msgstr "ใส่ Keystore/ชื่อผู้ใช้à¹à¸¥à¸°à¸£à¸«à¸±à¸ªà¸œà¹ˆà¸²à¸™à¸ªà¸³à¸«à¸£à¸±à¸šà¸ªà¹ˆà¸‡à¸­à¸­à¸"
+
+#~ msgid "Group name can't be empty!"
+#~ msgstr "ชื่อà¸à¸¥à¸¸à¹ˆà¸¡à¹€à¸§à¹‰à¸™à¸§à¹ˆà¸²à¸‡à¹„ม่ได้!"
+
+#~ msgid "Invalid character in group name!"
+#~ msgstr "ใช้อัà¸à¸©à¸£à¸šà¸²à¸‡à¸•ัวในชื่อà¸à¸¥à¸¸à¹ˆà¸¡à¹„ม่ได้!"
+
+#~ msgid "Group name already exists!"
+#~ msgstr "มีชื่อà¸à¸¥à¸¸à¹ˆà¸¡à¸™à¸µà¹‰à¸­à¸¢à¸¹à¹ˆà¹à¸¥à¹‰à¸§!"
+
+#~ msgid "Atlas Preview"
+#~ msgstr "ตัวอย่าง Atlas"
+
+#~ msgid "Project Export Settings"
+#~ msgstr "ตั้งค่าส่งออà¸à¹‚ปรเจà¸à¸•์"
+
+#~ msgid "Export to Platform"
+#~ msgstr "ส่งออà¸à¹„ปยังà¹à¸žà¸¥à¸•ฟอร์ม"
+
+#~ msgid "Convert text scenes to binary on export."
+#~ msgstr "à¹à¸›à¸¥à¸‡à¹„ฟล์ฉาà¸à¹à¸šà¸šà¸•ัวอัà¸à¸©à¸£à¹ƒà¸«à¹‰à¹€à¸›à¹‡à¸™à¹„บนารีสำหรับส่งออà¸"
+
+#~ msgid "Images"
+#~ msgstr "รูป"
+
+#~ msgid "Keep Original"
+#~ msgstr "เà¸à¹‡à¸šà¸•้นฉบับ"
+
+#~ msgid "Compress for Disk (Lossy, WebP)"
+#~ msgstr "บีบอัดสำหรับดิสà¸à¹Œ (Lossy, WebP)"
+
+#~ msgid "Compress for RAM (BC/PVRTC/ETC)"
+#~ msgstr "บีบอัดสำหรับà¹à¸£à¸¡ (BC/PVRTC/ETC)"
+
+#~ msgid "Convert Images (*.png):"
+#~ msgstr "à¹à¸›à¸¥à¸‡à¸£à¸¹à¸› (*.png):"
+
+#~ msgid "Compress for Disk (Lossy) Quality:"
+#~ msgstr "บีบอัดสำหรับดิสà¸à¹Œ (Lossy) คุณภาพ:"
+
+#~ msgid "Shrink All Images:"
+#~ msgstr "ลดขนาดทุà¸à¸£à¸¹à¸›:"
+
+#~ msgid "Compress Formats:"
+#~ msgstr "à¸à¸²à¸£à¸šà¸µà¸šà¸­à¸±à¸”:"
+
+#~ msgid "Compress Disk"
+#~ msgstr "บีบอัดดิสà¸à¹Œ"
+
+#~ msgid "Compress RAM"
+#~ msgstr "บีบอัดà¹à¸£à¸¡"
+
+#~ msgid "Compress Mode:"
+#~ msgstr "โหมดบีบอัด:"
+
+#~ msgid "Lossy Quality:"
+#~ msgstr "เสียคุณภาพ:"
+
+#~ msgid "Shrink By:"
+#~ msgstr "ลดไป:"
+
+#~ msgid "Preview Atlas"
+#~ msgstr "ตัวอย่าง Atlas"
+
+#~ msgid "Select None"
+#~ msgstr "ไม่เลือà¸"
+
+#~ msgid "Samples"
+#~ msgstr "ไฟล์เสียง"
+
+#~ msgid "Sample Conversion Mode: (.wav files):"
+#~ msgstr "à¸à¸²à¸£à¹à¸›à¸¥à¸‡à¹„ฟล์เสียง: (ไฟล์ .wav):"
+
+#~ msgid "Keep"
+#~ msgstr "เà¸à¹‡à¸š"
+
+#~ msgid "Compress (RAM - IMA-ADPCM)"
+#~ msgstr "บีบอัด (RAM - IMA-ADPCM)"
+
+#~ msgid "Sampling Rate Limit (Hz):"
+#~ msgstr "จำà¸à¸±à¸”ความถี่ (Hz):"
+
+#~ msgid "Trim"
+#~ msgstr "ตัดปลาย"
+
+#~ msgid "Trailing Silence:"
+#~ msgstr "ส่วนที่เงียบตรงปลาย:"
+
+#~ msgid "Script Export Mode:"
+#~ msgstr "โหมดส่งออà¸à¸ªà¸„ริปต์:"
+
+#~ msgid "Text"
+#~ msgstr "ตัวอัà¸à¸©à¸£"
+
+#~ msgid "Compiled"
+#~ msgstr "คอมไพล์à¹à¸¥à¹‰à¸§"
+
+#~ msgid "Encrypted (Provide Key Below)"
+#~ msgstr "เข้ารหัส (ใส่คีย์ด้านล่าง)"
+
+#~ msgid "Script Encryption Key (256-bits as hex):"
+#~ msgstr "คีย์เข้ารหัสสคริปต์ (256 บิต à¸à¸²à¸™ 16):"
+
+#~ msgid "Export PCK/Zip"
+#~ msgstr "ส่งออภPCK/Zip"
+
+#~ msgid "Export Project PCK"
+#~ msgstr "ส่งออภPCK โปรเจà¸à¸•์"
+
+#~ msgid "Export.."
+#~ msgstr "ส่งออà¸.."
+
+#~ msgid "Project Export"
+#~ msgstr "ส่งออà¸à¹‚ปรเจà¸à¸•์"
diff --git a/editor/translations/tr.po b/editor/translations/tr.po
index d1b82ede28..b041ed0901 100644
--- a/editor/translations/tr.po
+++ b/editor/translations/tr.po
@@ -2,7 +2,7 @@
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
-# Aprın Çor Tigin <kabusturk38@gmail.com>, 2016.
+# Aprın Çor Tigin <kabusturk38@gmail.com>, 2016-2017.
# Ceyhun Can Ulker <ceyhuncanu@gmail.com>, 2016.
# Enes Kaya Öcal <ekayaocal@hotmail.com>, 2016.
# M. Yavuz Uzun <myavuzuzun@yandex.com>, 2016.
@@ -11,8 +11,8 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2017-01-02 19:10+0000\n"
-"Last-Translator: Orkun Turan <holygatestudio@yandex.com>\n"
+"PO-Revision-Date: 2017-01-22 12:30+0000\n"
+"Last-Translator: Aprın Çor Tigin <kabusturk38@gmail.com>\n"
"Language-Team: Turkish <https://hosted.weblate.org/projects/godot-engine/"
"godot/tr/>\n"
"Language: tr\n"
@@ -362,6 +362,184 @@ msgstr "Dizinin türünü degistir"
msgid "Change Array Value"
msgstr "Dizi DeÄŸerini DeÄŸiÅŸtir"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "Sürüm:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "Sabitler:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "Dizeç"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "Açıklama:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "Kur"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "Kapat"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "BaÄŸlan..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "Düğüme Bağlan:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "İstenilen dizeç formatı bilinmiyor:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "Kaydediliyor..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "BaÄŸlan..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "Deneme"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "Kaynak kaydedilirken sorun!"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "Aşağı"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "Hepsi"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -369,6 +547,30 @@ msgstr "Dizi DeÄŸerini DeÄŸiÅŸtir"
msgid "Search:"
msgstr "Ara:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "Ara"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "İçe Aktar"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "Eklentiler"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "Sırala:"
@@ -382,10 +584,6 @@ msgid "Category:"
msgstr "Katman:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "Hepsi"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "Yer:"
@@ -397,7 +595,7 @@ msgstr "Destek..."
msgid "Official"
msgstr "Resmi"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Topluluk"
@@ -417,20 +615,6 @@ msgstr "'%s' İçin Yöntem Dizelgesi:"
msgid "Call"
msgstr "Çağır"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "Kapat"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "Yöntem Dizelgesi:"
@@ -481,13 +665,6 @@ msgid "Selection Only"
msgstr "Yalnızca Seçim"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "Ara"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "Bul"
@@ -564,6 +741,7 @@ msgstr "Ekle"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "Kaldır"
@@ -639,11 +817,6 @@ msgstr "Yakın zamanda:"
msgid "Matches:"
msgstr "EÅŸleÅŸmeler:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "Açıklama:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "Şunun İçin Değişikliği Ara:"
@@ -678,6 +851,7 @@ msgstr "Kaynak"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "Yol"
@@ -781,8 +955,7 @@ msgstr ""
msgid "Add Bus"
msgstr "Ekle %s"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "Yükle"
@@ -792,6 +965,7 @@ msgid "Save As"
msgstr "BaÅŸkaca Kaydet"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "Önyüklü"
@@ -860,8 +1034,7 @@ msgid "Rearrange Autoloads"
msgstr "KendindenYüklenme'leri Yeniden Sırala"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "Dizeç yolu:"
@@ -927,7 +1100,7 @@ msgstr "Dizeci Depoluyor:"
msgid "Packing"
msgstr "Çıkınla"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1053,7 +1226,8 @@ msgstr "KaynaklarıTara"
msgid "(Re)Importing Assets"
msgstr "Yeniden-İçe Aktarım"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "Yardım Ara"
@@ -1070,7 +1244,6 @@ msgid "Class:"
msgstr "Bölüt:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "Kalıtçılar:"
@@ -1103,9 +1276,8 @@ msgid "Constants:"
msgstr "Sabitler:"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Property Description:"
-msgstr "Kısa Açıklama:"
+msgstr "Özellik Açıklaması:"
#: editor/editor_help.cpp
msgid "Method Description:"
@@ -1126,10 +1298,6 @@ msgstr " Çıktı:"
msgid "Clear"
msgstr "Temizle"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "Sahneden Düğüm(node)"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1243,10 +1411,11 @@ msgid "There is no defined scene to run."
msgstr "Çalıştırmak için herhangi bir sahne seçilmedi."
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"Hiçbir ana sahne tanımlanmadı, birini seçiniz?\n"
"Daha sonra \"uygulama\" kategorisinin altındaki \"Tasarı Ayarları\" ndan "
@@ -1309,6 +1478,11 @@ msgid "Save Scene As.."
msgstr "Sahneyi BaÅŸkaca Kaydet.."
#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "Düğüm"
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr "Sahne hiç kaydedilmedi. Çalıştırmadan önce kaydedilsin mi?"
@@ -1367,7 +1541,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "Öff"
@@ -1408,6 +1582,10 @@ msgstr "%d daha çok dizeç(ler)"
msgid "%d more file(s) or folder(s)"
msgstr "%d daha çok dizeç(ler) veya dizin(ler)"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "Dikkat Dağıtmayan Biçim"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "Sahne"
@@ -1461,7 +1639,7 @@ msgstr "Sahneyi Kapat"
msgid "Close Goto Prev. Scene"
msgstr "Önc. Sahneye Git sekmesini Kapat"
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "En Sonuncuyu Aç"
@@ -1489,99 +1667,41 @@ msgid "Redo"
msgstr "Geri"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "Betiği Çalıştır"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Tasarı Ayarları"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "Sahneyi Eski Durumuna Çevir"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "Tasarı Dizelgesine Git"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Dikkat Dağıtmayan Biçim"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "Varlıkları tasarının içine aktar."
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "İçe Aktar"
-
-#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
msgstr "Türlü tasarı ya da sahne genişliğinde araçlar."
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "Araçlar"
+#, fuzzy
+msgid "Project"
+msgstr "Yeni Tasarı"
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr "Tasarı Ayarları"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "Tasarıyı pek çok ortama aktarın."
+msgid "Run Script"
+msgstr "Betiği Çalıştır"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "Dışa Aktar"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "Tasarıyı oynat."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "Oynat"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "Sahneyi duraklat"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "Sahneyi Duraklat"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "Sahneyi durdur."
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "Durdur"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "Düzenlenmiş sahneyi oynat."
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "Sahneyi Oynat"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "Özel sahneyi oynat"
+msgid "Tools"
+msgstr "Araçlar"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "Özel Sahneyi Oynat"
+msgid "Quit to Project List"
+msgstr "Tasarı Dizelgesine Git"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "Sorun ayıklama seçenekleri"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "Kusur Ayıkla"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1670,9 +1790,10 @@ msgstr ""
"Bir cihazda uzaktan kullanıldığında, ağ dizeç düzeni ile bu işlem daha "
"verimli olur."
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "Ayarlar"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "Düzenle"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1692,12 +1813,69 @@ msgid "Manage Export Templates"
msgstr "Dışa Aktarım Kalıpları Yükleniyor"
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "Bölütler"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "Belgeleri Kapat"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr "İlişkin"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "Dış kaynaklar değişince uyarır."
+msgid "Play the project."
+msgstr "Tasarıyı oynat."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "Oynat"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "Sahneyi duraklat"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "Sahneyi Duraklat"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "Sahneyi durdur."
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "Durdur"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "Düzenlenmiş sahneyi oynat."
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "Sahneyi Oynat"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "Özel sahneyi oynat"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "Özel Sahneyi Oynat"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1780,6 +1958,14 @@ msgid "Thanks!"
msgstr "SaÄŸ olun!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "Kalıpları ZIP Dizecinden İçe Aktar"
@@ -1807,15 +1993,41 @@ msgstr "Aç & Bir Betik Çalıştır"
msgid "Load Errors"
msgstr "Sorunları Yükle"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "Düzenleyicide Aç"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "Düzenleyicide Aç"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "Düzenleyicide Aç"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "Betikevini Dışa Aktar"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "Düzenleyicide Aç"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "Düzenleyicide Aç"
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "Yüklü Eklentiler:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "Sürüm:"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
msgstr "Yazar:"
@@ -2070,6 +2282,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "Dizeç Yöneticisinde Göster"
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr "Örnek"
@@ -2098,10 +2314,6 @@ msgid "Info"
msgstr "Bilgi"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "Dizeç Yöneticisinde Göster"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Yeniden İçe Aktar.."
@@ -2270,9 +2482,10 @@ msgid "No target font resource!"
msgstr "Amaçlanan yazı türü kaynağı yok!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"Geçersiz dizeç uzantısı.\n"
"Lütfen .fnt uzantısını kullanın."
@@ -2753,8 +2966,9 @@ msgid "Compress"
msgstr "Sıkıştır"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr "Tasarıya Ekle (godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "Tasarıya Ekle (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -3418,7 +3632,7 @@ msgid "Change default type"
msgstr "Önyüklü tipi değiştir"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "Tamam"
@@ -3469,15 +3683,6 @@ msgstr "Çoklu3B Oluştur"
msgid "Set Handle"
msgstr "Tutamacı Ayarla"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "Renk Yokuşu Noktası Ekle / Kaldır"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr "Renk YokuÅŸunu DeÄŸiÅŸtir"
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr "Örüntü Betikevi Oluştur"
@@ -3508,6 +3713,35 @@ msgstr "Sahneden İçe Aktar"
msgid "Update from Scene"
msgstr "Sahneden Güncelle"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "GiriÅŸ Ekle"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "Yol Noktasını Kaldır"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "Kaynak Yükle"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Modify Curve"
+msgstr "Eğri Haritasını Değiştir"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "Renk Yokuşu Noktası Ekle / Kaldır"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "Renk YokuÅŸunu DeÄŸiÅŸtir"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "Öğe%d"
@@ -3781,6 +4015,20 @@ msgid "Remove Poly And Point"
msgstr "Çokluyu ve Noktayı Kaldır"
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "Yayma Örtecini Temizle"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "AABB Üret"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "Bediz yüklenirken sorun oluştu:"
@@ -3793,8 +4041,8 @@ msgid "Set Emission Mask"
msgstr "Yayma Örtecini Ayarla"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
-msgstr "Yayma Örtecini Temizle"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -3804,6 +4052,27 @@ msgstr "Yayma Örtecini Yükle"
msgid "Generated Point Count:"
msgstr "Üretilen Nokta Say:"
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "Ortalama Zaman (sn)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "Yayma Örtecini Ayarla"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "Sahneden OluÅŸtur"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "Yayma Konumları:"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr "Düğüm uzambilgisi içermiyor."
@@ -3813,6 +4082,10 @@ msgid "Node does not contain geometry (faces)."
msgstr "Düğüm uzambilgisi (yüzler) içermiyor."
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "Yüzler alan içermez!"
@@ -3825,11 +4098,13 @@ msgid "Generate AABB"
msgstr "AABB Üret"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+#, fuzzy
+msgid "Create Emission Points From Mesh"
msgstr "Örüntüden Yayıcı Oluştur"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+#, fuzzy
+msgid "Create Emission Points From Node"
msgstr "Düğümden Yayıcı Oluştur"
#: editor/plugins/particles_editor_plugin.cpp
@@ -3841,26 +4116,48 @@ msgid "Create Emitter"
msgstr "Yayıcı Oluştur"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+#, fuzzy
+msgid "Emission Points:"
msgstr "Yayma Konumları:"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr "Yayma Dolumu:"
+#, fuzzy
+msgid "Surface Points"
+msgstr "Yüzey %d"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr "Yüzey"
+msgid "Surface Points+Normal (Directed)"
+msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "Oylum"
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Source: "
+msgstr "Yayma Dolumu:"
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "AABB Üret"
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr "Noktayı Eğriden Kaldır"
#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "Eğriye Denetimsiz Taşı"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "Noktayı Eğriden Kaldır"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr "Noktayı Eğriye Ekle"
@@ -3915,6 +4212,16 @@ msgstr "Yolu Ayır"
msgid "Remove Path Point"
msgstr "Yol Noktasını Kaldır"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "Eğriye Denetimsiz Taşı"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "Eğriye Denetimli Taşı"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "UV Haritası Oluştur"
@@ -4068,6 +4375,11 @@ msgid "Pitch"
msgstr "Perde"
#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "Kemikleri Temizle"
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr "Kalıp kaydedilirken sorun oluştu"
@@ -4155,10 +4467,6 @@ msgstr "Bul.."
msgid "Find Next"
msgstr "Sonraki Bul"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "Kusur Ayıkla"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr "Adımla"
@@ -4192,16 +4500,9 @@ msgid "Move Right"
msgstr "Sağa Taşı"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "Öğreticiler"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "https://godotengine.org bağlantısını öğreticiler bölümünde aç."
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "Bölütler"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "BaÅŸvuru belgelerinde arama yap."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
@@ -4260,6 +4561,23 @@ msgid "Pick Color"
msgstr "Renk Seç"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "Bedizleri Dönüştürüyor"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4310,6 +4628,14 @@ msgid "Trim Trailing Whitespace"
msgstr "İzleyenin Boşluklarını Kırp"
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr "Kendinden Girintili"
@@ -4331,6 +4657,16 @@ msgid "Goto Previous Breakpoint"
msgstr "Önceki Kesme Noktasına Git"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "Şuna Dönüştür.."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "Şuna Dönüştür.."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "Öncekini Bul"
@@ -4353,6 +4689,10 @@ msgstr "Dizeye Git.."
msgid "Contextual Help"
msgstr "Bağlamsal Yardım"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr "Basamaklı Sabiti Değiştir"
@@ -4570,36 +4910,106 @@ msgid "Animation Key Inserted."
msgstr "Canlandırma Açarı Eklendi."
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "İleri Git"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "Terse doÄŸru"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Tekerlek Aşağı."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "Değişiklikleri güncelle"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "Değişiklikleri güncelle"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "Değişiklikleri güncelle"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "BaÅŸucu"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr "Görünüme Ayarla"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
-msgstr "Çevre"
+msgid "Display Normal"
+msgstr "Olağanı Görüntüle"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
-msgstr "Ses Dinleyici"
+msgid "Display Wireframe"
+msgstr "Telkafes Görüntüle"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
-msgstr "Zımbırtılar"
+msgid "Display Overdraw"
+msgstr "Abartı Görüntüle"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
-msgstr "XForm İletişim Kutusu"
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "Gölgesiz Görüntüle"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "Örnek vermek için hiçbir sahne seçilmedi!"
+#, fuzzy
+msgid "View Environment"
+msgstr "Çevre"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Göstergede Örnekle"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Zımbırtılar"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "Sahne Örneklenemedi!"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr "Ses Dinleyici"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "XForm İletişim Kutusu"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4658,6 +5068,26 @@ msgid "Align Selection With View"
msgstr "Seçimi Görünüme Ayarla"
#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "Seç"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "Taşı"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: Döndür"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "Ölçekle:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
msgstr "Dönüşüm"
@@ -4670,14 +5100,6 @@ msgid "Transform Dialog.."
msgstr "Dönüştürme İletişim Kutusu.."
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr "Önyüklü Işık Kullan"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "Önyüklü sRGB'yi Kullan"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
msgstr "1 Görünüm"
@@ -4702,22 +5124,6 @@ msgid "4 Viewports"
msgstr "4 Görünüm"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr "Olağanı Görüntüle"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr "Telkafes Görüntüle"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr "Abartı Görüntüle"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr "Gölgesiz Görüntüle"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr "Başlatım Görünümü"
@@ -4726,6 +5132,10 @@ msgid "View Grid"
msgstr "Izgara Görünümü"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Ayarlar"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "Yapışma Ayarları"
@@ -4746,14 +5156,6 @@ msgid "Viewport Settings"
msgstr "Görüntüleme Ayarları"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr "Önyüklü Işığın Olağanı:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr "Ortam Işığı Rengi:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr "Perspektif FOV (düzey):"
@@ -5183,12 +5585,14 @@ msgid "Invalid project path, the path must exist!"
msgstr "Geçersiz tasarı yolu, yolun var olması gerekir!"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "Geçersiz tasarı yolu, godot.cfg var olmaması gerekir."
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Geçersiz tasarı yolu, engine.cfg var olmaması gerekir."
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr "Geçersiz tasarı yolu, godot.cfg var olması gerekir."
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "Geçersiz tasarı yolu, engine.cfg var olması gerekir."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5199,8 +5603,9 @@ msgid "Invalid project path (changed anything?)."
msgstr "Geçersiz tasarı yolu (bir şey değişti mi?)."
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
-msgstr "godot.cfg tasarı yolunda oluşturulamadı."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
+msgstr "engine.cfg tasarı yolunda oluşturulamadı."
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
@@ -5235,10 +5640,6 @@ msgid "Install Project:"
msgstr "Tasarıyı Kur:"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "Kur"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "Gözat"
@@ -5300,6 +5701,11 @@ msgid "New Project"
msgstr "Yeni Tasarı"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "Öğeyi Kaldır"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "Çık"
@@ -5420,6 +5826,11 @@ msgstr "GiriÅŸ Eylemi Ekle"
msgid "Erase Input Action Event"
msgstr "Giriş Eylemi Olayını Sil"
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "BoÅŸ Ekle"
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "Aygıt"
@@ -5485,8 +5896,9 @@ msgid "Remove Resource Remap Option"
msgstr "Kaynak Yeniden Eşle Seçeneğini Kaldır"
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr "Tasarı Ayarları (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "Tasarı Ayarları (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5552,10 +5964,6 @@ msgstr "Yerel"
msgid "AutoLoad"
msgstr "KendindenYükle"
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "Eklentiler"
-
#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Viewport"
@@ -5607,10 +6015,6 @@ msgid "Error loading file: Not a resource!"
msgstr "Dizeç yüklenirken sorun oluştu: Bir kaynak değil!"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "Bediz yüklenemedi"
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "Bir Düğüm Seç"
@@ -5799,6 +6203,11 @@ msgid "Error duplicating scene to save it."
msgstr "Kaydetmek için sahne ikilenirken sorun oluştu."
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "Kaynaklar:"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "Öbekleri Düzenle"
@@ -5876,10 +6285,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "CanvasItem'ı Görünür Duruma Getir"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "Sorun ayıklama seçenekleri"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "Örnek:"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "Sonraki betik"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "Uzaysal Görünürlüğü Aç / Kapat"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr "Geçersiz düğüm adı, aşağıdaki damgalara izin verilmiyor:"
@@ -5924,75 +6382,93 @@ msgid "Select a Node"
msgstr "Bir Düğüm Seç"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "Geçersiz ata bölüt adı"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "Dizeç düzeninde betik oluşturulamadı."
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "Geçerli damgalar:"
+msgid "Error loading script from %s"
+msgstr "Yazı tipi %s yüklerken sorun oluştu"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "Geçersiz bölüt adı"
+msgid "Path is empty"
+msgstr "Yol boÅŸ"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "Uygun ad"
+msgid "Path is not local"
+msgstr "Yol yerel deÄŸil"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "Uygulanamaz"
+msgid "Invalid base path"
+msgstr "Geçersiz üst yol"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "Bölüt adı geçersiz!"
+msgid "Invalid extension"
+msgstr "Geçersiz uzantı"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "Ata bölüt adı geçersiz!"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "Geçersiz yol!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "Gecersiz Yol."
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "Dizeç düzeninde betik oluşturulamadı."
+msgid "Invalid class name"
+msgstr "Geçersiz bölüt adı"
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
-msgstr "Yazı tipi %s yüklerken sorun oluştu"
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "Geçersiz dizin özelliği adı."
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "Yol boÅŸ"
+#, fuzzy
+msgid "Script valid"
+msgstr "Betik"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "Yol yerel deÄŸil"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "Geçersiz üst yol"
+msgid "N/A"
+msgstr "Uygulanamaz"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "Geçersiz uzantı"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+#, fuzzy
+msgid "Create new script file"
msgstr "Yeni Betik OluÅŸtur"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+#, fuzzy
+msgid "Load existing script file"
msgstr "Var olan betiği yükle"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "Kalıtçılar:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "Bölüt Adı:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Öğeyi Kaldır"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "Gömme Betik"
#: editor/script_create_dialog.cpp
@@ -6164,9 +6640,12 @@ msgid "Change Notifier Extents"
msgstr "Bildirim Kapsamını Değiştir"
#: editor/spatial_editor_gizmos.cpp
-#, fuzzy
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
-msgstr "Bildirim Kapsamını Değiştir"
+msgstr "DeÅŸme GeniÅŸlemesini DeÄŸiÅŸtir"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6495,7 +6974,32 @@ msgstr "yeni basıldı"
msgid "just released"
msgstr "yeni bırakıldı"
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Run in Browser"
+msgstr "Gözat"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "Karo Bulunamadı:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "Karo Bulunamadı:"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "Dizin oluşturulamadı."
+
#: platform/uwp/export/export.cpp
+#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr ""
@@ -6661,11 +7165,11 @@ msgstr ""
"ParallaxLayer, yalnızca ParallaxBackground düğümünün çocuğu olduğu zaman "
"çalışır."
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
-"Yol niteliği çalışması için geçerli bir Particles2D düğümünü işaret "
-"etmelidir."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6748,6 +7252,11 @@ msgstr ""
"NavigationMeshInstance, bir Navigation düğümünün çocuğu ya da torunu "
"olmalıdır. O yalnızca yönlendirme verisi sağlar."
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6768,6 +7277,15 @@ msgstr ""
"AnimatedSprite3D 'nin çerçeveleri görüntülemek için bir SpriteFrames kaynağı "
"oluşturulmalı veya 'Çerçeveler' niteliğinde ayarlanmalıdır."
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "Çalışma Biçimi:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Uyarı!"
@@ -6813,6 +7331,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6825,6 +7349,74 @@ msgstr ""
"bir boyut elde edin. Ya da, onu bir RenderTarget yapın ve iç dokusunu "
"görüntülemesi için bir düğüme atayın."
+#~ msgid "Node From Scene"
+#~ msgstr "Sahneden Düğüm(node)"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "Varlıkları tasarının içine aktar."
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "Tasarıyı pek çok ortama aktarın."
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "Dış kaynaklar değişince uyarır."
+
+#~ msgid "Tutorials"
+#~ msgstr "Öğreticiler"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "https://godotengine.org bağlantısını öğreticiler bölümünde aç."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "Örnek vermek için hiçbir sahne seçilmedi!"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "Göstergede Örnekle"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "Sahne Örneklenemedi!"
+
+#~ msgid "Use Default Light"
+#~ msgstr "Önyüklü Işık Kullan"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "Önyüklü sRGB'yi Kullan"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "Önyüklü Işığın Olağanı:"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "Ortam Işığı Rengi:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "Bediz yüklenemedi"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "Geçersiz ata bölüt adı"
+
+#~ msgid "Valid chars:"
+#~ msgstr "Geçerli damgalar:"
+
+#~ msgid "Valid name"
+#~ msgstr "Uygun ad"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "Bölüt adı geçersiz!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "Ata bölüt adı geçersiz!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "Geçersiz yol!"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr ""
+#~ "Yol niteliği çalışması için geçerli bir Particles2D düğümünü işaret "
+#~ "etmelidir."
+
+#~ msgid "Surface"
+#~ msgstr "Yüzey"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
@@ -6869,33 +7461,51 @@ msgstr ""
#~ msgid "No exporter for platform '%s' yet."
#~ msgstr "Şu anda '%s' ortamı için dışa aktarıcı yok."
-#, fuzzy
#~ msgid "Create Android keystore"
-#~ msgstr "Yeni Kaynak OluÅŸtur"
+#~ msgstr "Android Dokunaç Yığımı Oluştur"
-#, fuzzy
#~ msgid "Full name"
-#~ msgstr "Uygun ad"
+#~ msgstr "Tam adı"
+
+#~ msgid "Organizational unit"
+#~ msgstr "KuruluÅŸsal birim"
-#, fuzzy
#~ msgid "Organization"
-#~ msgstr "Geçiş"
+#~ msgstr "KuruluÅŸ"
+
+#~ msgid "City"
+#~ msgstr "Åžehir"
-#, fuzzy
#~ msgid "State"
-#~ msgstr "Durum:"
+#~ msgstr "Ülke"
+
+#~ msgid "2 letter country code"
+#~ msgstr "2 damgalı ülke imi"
+
+#~ msgid "User alias"
+#~ msgstr "Kullanıcı takma adı"
-#, fuzzy
#~ msgid "Password"
-#~ msgstr "Gizyazı:"
+#~ msgstr "Gizyazı"
-#, fuzzy
#~ msgid "at least 6 characters"
-#~ msgstr "Geçerli damgalar:"
+#~ msgstr "en az 6 geçerli damga"
-#, fuzzy
#~ msgid "File name"
-#~ msgstr "Yeni ad:"
+#~ msgstr "Dizeç adı"
+
+#~ msgid "Path : (better to save outside of project)"
+#~ msgstr "Yol: (tasarının dışında kaydetmek daha iyi)"
+
+#~ msgid ""
+#~ "Release keystore is not set.\n"
+#~ "Do you want to create one?"
+#~ msgstr ""
+#~ "Serbest bırakma dokunaç yığımı ayarlanmadı.Bir tane oluşturmak mı ister "
+#~ "misin?"
+
+#~ msgid "Fill Keystore/Release User and Release Password"
+#~ msgstr "Dokunaç Yığımını Doldur/Kullanıcıyı Bırak ve Gizyazıyı Bırak"
#~ msgid "Include"
#~ msgstr "Katıştır"
@@ -7023,9 +7633,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "Sessizliği İzliyor:"
-#~ msgid "Script"
-#~ msgstr "Betik"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Betik Dışa Aktarım Biçimi:"
@@ -7059,9 +7666,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance, bir BakedLight kaynağı içermez."
-#~ msgid "Vertex"
-#~ msgstr "BaÅŸucu"
-
#~ msgid "Fragment"
#~ msgstr "Bölümlenme"
diff --git a/editor/translations/ur_PK.po b/editor/translations/ur_PK.po
index 381f3d3fdd..a154df0565 100644
--- a/editor/translations/ur_PK.po
+++ b/editor/translations/ur_PK.po
@@ -356,6 +356,174 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "View Files"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connecting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Error making request"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -363,6 +531,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr ""
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -376,10 +568,6 @@ msgid "Category:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "سائٹ:"
@@ -391,7 +579,7 @@ msgstr ".سپورٹ"
msgid "Official"
msgstr ""
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "کمیونٹی"
@@ -411,20 +599,6 @@ msgstr ""
msgid "Call"
msgstr ""
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr ""
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr ""
@@ -474,13 +648,6 @@ msgid "Selection Only"
msgstr ""
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr ""
@@ -555,6 +722,7 @@ msgstr ""
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr ""
@@ -630,11 +798,6 @@ msgstr ""
msgid "Matches:"
msgstr ""
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -665,6 +828,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr ""
@@ -765,8 +929,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -776,6 +939,7 @@ msgid "Save As"
msgstr ""
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr ""
@@ -845,8 +1009,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr ""
@@ -912,7 +1075,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1039,7 +1202,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr ""
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1056,7 +1220,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1112,10 +1275,6 @@ msgstr ""
msgid "Clear"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1231,8 +1390,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1286,6 +1445,10 @@ msgid "Save Scene As.."
msgstr ""
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1343,7 +1506,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1381,6 +1544,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr ""
@@ -1433,7 +1600,7 @@ msgstr ""
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr ""
@@ -1461,50 +1628,23 @@ msgid "Redo"
msgstr ""
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
@@ -1512,47 +1652,15 @@ msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1623,8 +1731,8 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
+#: editor/editor_node.cpp
+msgid "Editor"
msgstr ""
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
@@ -1644,11 +1752,67 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1732,6 +1896,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1759,12 +1931,32 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+msgid "Open 2D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 3D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2007,6 +2199,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2035,10 +2231,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2204,7 +2396,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2679,7 +2871,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3340,7 +3532,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr ""
@@ -3389,15 +3581,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3428,6 +3611,32 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Add point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr ".تمام کا انتخاب"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3697,6 +3906,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3709,7 +3931,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3720,6 +3942,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3729,6 +3968,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3741,11 +3984,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3757,26 +4000,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3831,6 +4090,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr ".تمام کا انتخاب"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3984,6 +4252,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4072,10 +4344,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4109,15 +4377,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4172,6 +4432,22 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4222,6 +4498,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4243,6 +4527,14 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4265,6 +4557,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4482,35 +4778,95 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Shader Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Unshaded"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4572,23 +4928,32 @@ msgid "Align Selection With View"
msgstr ".تمام کا انتخاب"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr ".تمام کا انتخاب"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Local Coords"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4616,27 +4981,15 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4660,14 +5013,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5080,11 +5425,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5096,7 +5441,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5132,10 +5477,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5194,6 +5535,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr ".تمام کا انتخاب"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5312,6 +5658,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr ""
@@ -5377,7 +5727,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5444,10 +5794,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5498,10 +5844,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
msgid "Pick a Node"
msgstr ""
@@ -5686,6 +6028,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5762,10 +6108,57 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "سب سکریپشن بنائیں"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5810,77 +6203,86 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
+msgid "Error - Could not create script in filesystem."
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
+msgid "Error loading script from %s"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
+msgid "Invalid Path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
+msgid "Invalid inherited parent name or path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "سب سکریپشن بنائیں"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr "سب سکریپشن بنائیں"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Class Name"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Template"
+msgstr ".تمام کا انتخاب"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6053,6 +6455,10 @@ msgid "Change Notifier Extents"
msgstr ".Ù†ÙˆÙ¹ÙØ¦Ø± Ú©Û’ اکسٹنٹ Ú©Ùˆ تبدیل کیجیۓ"
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
#, fuzzy
msgid "Change Probe Extents"
msgstr ".Ù†ÙˆÙ¹ÙØ¦Ø± Ú©Û’ اکسٹنٹ Ú©Ùˆ تبدیل کیجیۓ"
@@ -6375,6 +6781,26 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr ""
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6514,8 +6940,10 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
#: scene/2d/path_2d.cpp
@@ -6578,6 +7006,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6593,6 +7026,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr ""
@@ -6635,6 +7076,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
diff --git a/editor/translations/zh_CN.po b/editor/translations/zh_CN.po
index 8d0b9d44d9..bddb77c731 100644
--- a/editor/translations/zh_CN.po
+++ b/editor/translations/zh_CN.po
@@ -4,27 +4,28 @@
#
# 纯æ´çš„å蛋 <tqj.zyy@gmail.com>, 2016.
# 孤月è“风 <trlanfeng@foxmail.com>, 2016.
+# å´äº®å¼Ÿ <wu@liangdi.me>, 2017.
# ageazrael <ageazrael@gmail.com>, 2016.
# Bruce Guo <guoboism@hotmail.com>, 2016.
# Geequlim <geequlim@gmail.com>, 2016-2017.
# Luo Jun <vipsbpig@gmail.com>, 2016.
# oberon-tonya <360119124@qq.com>, 2016.
# wanfang liu <wanfang.liu@gmail.com>, 2016.
+# Youmu <konpaku.w@gmail.com>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2017-01-04 14:55+0000\n"
+"PO-Revision-Date: 2017-06-22 20:49+0800\n"
"Last-Translator: Geequlim <geequlim@gmail.com>\n"
-"Language-Team: Chinese (China) <https://hosted.weblate.org/projects/godot-"
-"engine/godot/zh_CN/>\n"
+"Language-Team: 汉语 <geequlim@gmail.com>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.11-dev\n"
+"X-Generator: Gtranslator 2.91.7\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -91,9 +92,8 @@ msgid "Anim Track Change Value Mode"
msgstr "轨é“修改为值模å¼"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Track Change Wrap Mode"
-msgstr "轨é“修改为值模å¼"
+msgstr "轨é“修改为包装模å¼"
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
@@ -193,7 +193,7 @@ msgstr "清ç†åŠ¨ç”»"
#: editor/animation_editor.cpp
msgid "Create NEW track for %s and insert key?"
-msgstr "为%s创建新轨é“å¹¶æ’入关键帧?"
+msgstr "为'%s'创建新轨é“å¹¶æ’入关键帧?"
#: editor/animation_editor.cpp
msgid "Create %d NEW tracks and insert keys?"
@@ -247,7 +247,7 @@ msgstr "添加回调轨é“"
#: editor/animation_editor.cpp
msgid "Animation zoom."
-msgstr "动画时间缩放"
+msgstr "动画时间缩放。"
#: editor/animation_editor.cpp
msgid "Length (s):"
@@ -255,35 +255,35 @@ msgstr "时长(秒):"
#: editor/animation_editor.cpp
msgid "Animation length (in seconds)."
-msgstr "动画时长(秒)"
+msgstr "动画时长(秒)。"
#: editor/animation_editor.cpp
msgid "Step (s):"
-msgstr "步长(秒)"
+msgstr "步长(秒):"
#: editor/animation_editor.cpp
msgid "Cursor step snap (in seconds)."
-msgstr "步进å¸é™„(秒)"
+msgstr "步进å¸é™„(秒)。"
#: editor/animation_editor.cpp
msgid "Enable/Disable looping in animation."
-msgstr "å¯ç”¨/ç¦ç”¨å¾ªçޝ"
+msgstr "å¯ç”¨/ç¦ç”¨å¾ªçŽ¯ã€‚"
#: editor/animation_editor.cpp
msgid "Add new tracks."
-msgstr "新建轨é“"
+msgstr "新建轨é“。"
#: editor/animation_editor.cpp
msgid "Move current track up."
-msgstr "上移当å‰è½¨é“"
+msgstr "上移当å‰è½¨é“。"
#: editor/animation_editor.cpp
msgid "Move current track down."
-msgstr "下移当å‰è½¨é“"
+msgstr "下移当å‰è½¨é“。"
#: editor/animation_editor.cpp
msgid "Remove selected track."
-msgstr "移除选中轨é“"
+msgstr "移除选中轨é“。"
#: editor/animation_editor.cpp
msgid "Track tools"
@@ -327,7 +327,7 @@ msgstr "过渡"
#: editor/animation_editor.cpp
msgid "Scale Ratio:"
-msgstr "缩放比率"
+msgstr "缩放比率:"
#: editor/animation_editor.cpp
msgid "Call Functions in Which Node?"
@@ -347,7 +347,7 @@ msgstr "清除所有动画"
#: editor/animation_editor.cpp
msgid "Clean-Up Animation(s) (NO UNDO!)"
-msgstr "清除所有动画å—(无法撤销)?"
+msgstr "清除所有动画å—(无法撤销ï¼ï¼‰"
#: editor/animation_editor.cpp
msgid "Clean-Up"
@@ -365,6 +365,184 @@ msgstr "修改数组类型"
msgid "Change Array Value"
msgstr "修改数组值"
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr "版本:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Contents:"
+msgstr "常é‡:"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "文件"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "æè¿°:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr "安装"
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "关闭"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "连接事件。"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "连接到节点:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Request failed, return code:"
+msgstr "未知的文件类型请求:"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Resolving.."
+msgstr "ä¿å­˜ä¸­..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "连接事件。"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "测试"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "ä¿å­˜èµ„æºå‡ºé”™ï¼"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Download Error"
+msgstr "下载"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "全部"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -372,6 +550,30 @@ msgstr "修改数组值"
msgid "Search:"
msgstr "æœç´¢:"
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "æœç´¢"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "导入"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "æ’ä»¶"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr "排åº:"
@@ -385,10 +587,6 @@ msgid "Category:"
msgstr "分类:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "全部"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "站点:"
@@ -400,7 +598,7 @@ msgstr "支æŒ.."
msgid "Official"
msgstr "官方"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "社区"
@@ -414,26 +612,12 @@ msgstr "ZIP资æºåŒ…"
#: editor/call_dialog.cpp
msgid "Method List For '%s':"
-msgstr "%s的方法列表"
+msgstr "'%s'的方法列表:"
#: editor/call_dialog.cpp modules/visual_script/visual_script_editor.cpp
msgid "Call"
msgstr "调用到"
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "关闭"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr "方法列表:"
@@ -459,7 +643,6 @@ msgid "No Matches"
msgstr "无匹é…项"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replaced %d occurrence(s)."
msgstr "替æ¢äº†%d项。"
@@ -484,13 +667,6 @@ msgid "Selection Only"
msgstr "仅选中"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "æœç´¢"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "查找"
@@ -550,7 +726,7 @@ msgstr "必须设置方法的对象节点ï¼"
msgid ""
"Target method not found! Specify a valid method or attach a script to target "
"Node."
-msgstr ""
+msgstr "找ä¸åˆ°ç›®æ ‡æ–¹æ³•ï¼ æŒ‡å®šä¸€ä¸ªæœ‰æ•ˆçš„æ–¹æ³•æˆ–æŠŠè„šæœ¬é™„åŠ åˆ°ç›®æ ‡èŠ‚ç‚¹ã€‚"
#: editor/connections_dialog.cpp
msgid "Connect To Node:"
@@ -565,6 +741,7 @@ msgstr "添加"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "移除"
@@ -610,7 +787,7 @@ msgstr "创建订阅"
#: editor/connections_dialog.cpp
msgid "Connect.."
-msgstr "连接事件"
+msgstr "连接事件。"
#: editor/connections_dialog.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
@@ -640,11 +817,6 @@ msgstr "最近文件:"
msgid "Matches:"
msgstr "匹é…项:"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr "æè¿°:"
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr "æœç´¢æ›¿æ¢:"
@@ -657,13 +829,13 @@ msgstr "ä¾èµ–项:"
msgid ""
"Scene '%s' is currently being edited.\n"
"Changes will not take effect unless reloaded."
-msgstr "场景%så·²è¢«ä¿®æ”¹ï¼Œé‡æ–°åŠ è½½åŽç”Ÿæ•ˆã€‚"
+msgstr "场景'%s'å·²è¢«ä¿®æ”¹ï¼Œé‡æ–°åŠ è½½åŽç”Ÿæ•ˆã€‚"
#: editor/dependency_editor.cpp
msgid ""
"Resource '%s' is in use.\n"
"Changes will take effect when reloaded."
-msgstr "资æº%sæ­£åœ¨ä½¿ç”¨ä¸­ï¼Œä¿®æ”¹å°†åœ¨é‡æ–°åŠ è½½åŽç”Ÿæ•ˆã€‚"
+msgstr "资æº'%s'æ­£åœ¨ä½¿ç”¨ä¸­ï¼Œä¿®æ”¹å°†åœ¨é‡æ–°åŠ è½½åŽç”Ÿæ•ˆã€‚"
#: editor/dependency_editor.cpp
msgid "Dependencies"
@@ -675,6 +847,7 @@ msgstr "资æº"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "路径"
@@ -703,11 +876,11 @@ msgid ""
"The files being removed are required by other resources in order for them to "
"work.\n"
"Remove them anyway? (no undo)"
-msgstr "è¦åˆ é™¤çš„æ–‡ä»¶è¢«å…¶ä»–èµ„æºæ‰€ä¾èµ–,ä»ç„¶è¦åˆ é™¤å—(无法撤销)?"
+msgstr "è¦åˆ é™¤çš„æ–‡ä»¶è¢«å…¶ä»–èµ„æºæ‰€ä¾èµ–,ä»ç„¶è¦åˆ é™¤å—?(无法撤销)"
#: editor/dependency_editor.cpp
msgid "Remove selected files from the project? (no undo)"
-msgstr "确定从项目中删除文件(此æ“作无法撤销)?"
+msgstr "确定从项目中删除文件?(此æ“作无法撤销)"
#: editor/dependency_editor.cpp
msgid "Error loading:"
@@ -735,7 +908,7 @@ msgstr "加载出错ï¼"
#: editor/dependency_editor.cpp
msgid "Permanently delete %d item(s)? (No undo!)"
-msgstr "永久删除选中的%dæ¡é¡¹ç›®å—(此æ“作无法撤销ï¼ï¼‰ï¼Ÿ"
+msgstr "永久删除选中的%dæ¡é¡¹ç›®å—?(此æ“作无法撤销ï¼ï¼‰"
#: editor/dependency_editor.cpp
msgid "Owns"
@@ -761,23 +934,21 @@ msgstr "删除"
#: editor/editor_audio_buses.cpp
msgid "Save Audio Bus Layout As.."
-msgstr ""
+msgstr "将音频Bus布局ä¿å­˜ä¸º.."
#: editor/editor_audio_buses.cpp
msgid "Location for New Layout.."
-msgstr ""
+msgstr "新布局的ä½ç½®.."
#: editor/editor_audio_buses.cpp
msgid "Open Audio Bus Layout"
-msgstr ""
+msgstr "打开音频Bus布局"
#: editor/editor_audio_buses.cpp
-#, fuzzy
msgid "Add Bus"
-msgstr "添加 %s"
+msgstr "添加Bus"
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr "加载"
@@ -787,12 +958,13 @@ msgid "Save As"
msgstr "å¦å­˜ä¸º"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "默认"
#: editor/editor_autoload_settings.cpp
msgid "Invalid name."
-msgstr "åç§°éžæ³•:"
+msgstr "åç§°éžæ³•:。"
#: editor/editor_autoload_settings.cpp
msgid "Valid characters:"
@@ -812,15 +984,15 @@ msgstr "åç§°éžæ³•,与已存在的全局常é‡å称冲çªã€‚"
#: editor/editor_autoload_settings.cpp
msgid "Invalid Path."
-msgstr "è·¯å¾„éžæ³•ï¼"
+msgstr "è·¯å¾„éžæ³•。"
#: editor/editor_autoload_settings.cpp
msgid "File does not exist."
-msgstr "文件ä¸å­˜åœ¨"
+msgstr "文件ä¸å­˜åœ¨ã€‚"
#: editor/editor_autoload_settings.cpp
msgid "Not in resource path."
-msgstr "ä¸åœ¨èµ„æºè·¯å¾„下"
+msgstr "ä¸åœ¨èµ„æºè·¯å¾„下。"
#: editor/editor_autoload_settings.cpp
msgid "Add AutoLoad"
@@ -828,7 +1000,7 @@ msgstr "添加Autoload"
#: editor/editor_autoload_settings.cpp
msgid "Autoload '%s' already exists!"
-msgstr "Autoload %s已存在ï¼"
+msgstr "Autoload '%s'已存在ï¼"
#: editor/editor_autoload_settings.cpp
msgid "Rename Autoload"
@@ -855,8 +1027,7 @@ msgid "Rearrange Autoloads"
msgstr "釿ޒåºAutoload"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "路径:"
@@ -872,7 +1043,7 @@ msgstr "åç§°"
#: editor/editor_autoload_settings.cpp
msgid "Singleton"
-msgstr "Singleton"
+msgstr "å•独(Singleton)"
#: editor/editor_autoload_settings.cpp
msgid "List:"
@@ -922,9 +1093,9 @@ msgstr "文件排åº:"
msgid "Packing"
msgstr "打包中"
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "找ä¸åˆ°æ¨¡æ¿æ–‡ä»¶:"
#: editor/editor_export.cpp
msgid "Added:"
@@ -1024,7 +1195,7 @@ msgstr "目录|文件:"
#: editor/editor_file_dialog.cpp
msgid "Preview:"
-msgstr "预览"
+msgstr "预览:"
#: editor/editor_file_dialog.cpp editor/script_editor_debugger.cpp
#: scene/gui/file_dialog.cpp
@@ -1044,17 +1215,17 @@ msgid "ScanSources"
msgstr "æ‰«ææºæ–‡ä»¶"
#: editor/editor_file_system.cpp
-#, fuzzy
msgid "(Re)Importing Assets"
-msgstr "釿–°å¯¼å…¥"
+msgstr "导入(釿–°)资æº"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr "æœç´¢å¸®åŠ©"
#: editor/editor_help.cpp
msgid "Class List:"
-msgstr "类型列表"
+msgstr "类型列表:"
#: editor/editor_help.cpp
msgid "Search Classes"
@@ -1065,7 +1236,6 @@ msgid "Class:"
msgstr "ç±»:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "基类:"
@@ -1098,9 +1268,8 @@ msgid "Constants:"
msgstr "常é‡:"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Property Description:"
-msgstr "简介:"
+msgstr "属性æè¿°ï¼š"
#: editor/editor_help.cpp
msgid "Method Description:"
@@ -1112,7 +1281,7 @@ msgstr "æœç´¢æ–‡æœ¬"
#: editor/editor_log.cpp
msgid " Output:"
-msgstr " 输出"
+msgstr " 输出:"
#: editor/editor_log.cpp editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/rich_text_editor_plugin.cpp editor/property_editor.cpp
@@ -1121,10 +1290,6 @@ msgstr " 输出"
msgid "Clear"
msgstr "清除"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr "从场景导入节点"
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1175,7 +1340,7 @@ msgstr "加载资æºå¤±è´¥ã€‚"
#: editor/editor_node.cpp
msgid "Can't load MeshLibrary for merging!"
-msgstr "无法加载è¦åˆå¹¶çš„MeshLibrary"
+msgstr "无法加载è¦åˆå¹¶çš„MeshLibraryï¼"
#: editor/editor_node.cpp
msgid "Error saving MeshLibrary!"
@@ -1238,10 +1403,11 @@ msgid "There is no defined scene to run."
msgstr "æ²¡æœ‰è®¾ç½®è¦æ‰§è¡Œçš„场景。"
#: editor/editor_node.cpp
+#, fuzzy
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
"尚未定义主场景。\n"
"请在项目设置的application分类下设置选择主场景。"
@@ -1252,8 +1418,8 @@ msgid ""
"You can change it later in \"Project Settings\" under the 'application' "
"category."
msgstr ""
-"尚未定义主场景。\n"
-"请在项目设置的application分类下设置选择主场景。"
+"所选场景'ï¼…s'ä¸å­˜åœ¨ï¼Œé€‰æ‹©ä¸€ä¸ªæœ‰æ•ˆçš„场景?\n"
+"请在项目设置的application(应用程åº)分类下设置选择主场景。"
#: editor/editor_node.cpp
msgid ""
@@ -1262,7 +1428,7 @@ msgid ""
"category."
msgstr ""
"选中的%s场景并éžä¸€ä¸ªåœºæ™¯æ–‡ä»¶ï¼Œè¯·é€‰æ‹©åˆæ³•的场景。\n"
-"请在项目设置的application分类下设置选择主场景。"
+"请在项目设置的application(应用程åº)分类下设置选择主场景。"
#: editor/editor_node.cpp
msgid "Current scene was never saved, please save it prior to running."
@@ -1294,11 +1460,16 @@ msgstr "是"
#: editor/editor_node.cpp
msgid "Close scene? (Unsaved changes will be lost)"
-msgstr "确定è¦å…³é—­åœºæ™¯å—,未ä¿å­˜çš„修改将丢失?"
+msgstr "确定è¦å…³é—­åœºæ™¯å—?(未ä¿å­˜çš„修改将丢失)"
#: editor/editor_node.cpp
msgid "Save Scene As.."
-msgstr "场景å¦å­˜ä¸º"
+msgstr "场景å¦å­˜ä¸º.."
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "No"
+msgstr "节点"
#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
@@ -1338,13 +1509,15 @@ msgstr "æ­¤æ“作无法撤销,确定è¦ç»§ç»­å—?"
#: editor/editor_node.cpp
msgid "Quick Run Scene.."
-msgstr "快速è¿è¡Œåœºæ™¯"
+msgstr "快速è¿è¡Œåœºæ™¯.."
#: editor/editor_node.cpp
msgid ""
"Open Project Manager? \n"
"(Unsaved changes will be lost)"
-msgstr "退出到项目管ç†çª—å£(未ä¿å­˜çš„修改将丢失)?"
+msgstr ""
+"退出到项目管ç†çª—å£ï¼Ÿ\n"
+"(未ä¿å­˜çš„修改将丢失)"
#: editor/editor_node.cpp
msgid "Pick a Main Scene"
@@ -1355,9 +1528,11 @@ msgid ""
"Scene '%s' was automatically imported, so it can't be modified.\n"
"To make changes to it, a new inherited scene can be created."
msgstr ""
+"自动导入的场景'%s'无法修改。\n"
+"è¦è¿›è¡Œæ›´æ”¹ï¼Œå¯ä»¥åˆ›å»ºä¸€ä¸ªæ–°çš„场景继承自它。"
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr "é¢"
@@ -1374,7 +1549,7 @@ msgstr "加载场景出错。"
#: editor/editor_node.cpp
msgid "Scene '%s' has broken dependencies:"
-msgstr "场景%sçš„ä¾èµ–已被破å:"
+msgstr "场景'%s'çš„ä¾èµ–已被破å:"
#: editor/editor_node.cpp
msgid "Save Layout"
@@ -1396,6 +1571,10 @@ msgstr "更多的%d个文件"
msgid "%d more file(s) or folder(s)"
msgstr "更多的%d个文件或目录"
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr "无干扰模å¼"
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "场景"
@@ -1410,12 +1589,11 @@ msgstr "下一项"
#: editor/editor_node.cpp
msgid "Previous tab"
-msgstr "上一个目录:"
+msgstr "上一个目录"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Filter Files.."
-msgstr "快速筛选文件.."
+msgstr "筛选文件.."
#: editor/editor_node.cpp
msgid "Operations with scene files."
@@ -1431,7 +1609,7 @@ msgstr "从现有场景中创建.."
#: editor/editor_node.cpp
msgid "Open Scene.."
-msgstr "打开场景"
+msgstr "打开场景.."
#: editor/editor_node.cpp
msgid "Save Scene"
@@ -1449,7 +1627,7 @@ msgstr "关闭场景"
msgid "Close Goto Prev. Scene"
msgstr "关闭并å‰å¾€ä¸Šä¸€ä¸ªåœºæ™¯"
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "最近打开"
@@ -1459,7 +1637,7 @@ msgstr "转æ¢ä¸º.."
#: editor/editor_node.cpp
msgid "MeshLibrary.."
-msgstr "MeshLibrary.."
+msgstr "MeshLibrary(网格库).."
#: editor/editor_node.cpp
msgid "TileSet.."
@@ -1477,99 +1655,41 @@ msgid "Redo"
msgstr "é‡åš"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "è¿è¡Œè„šæœ¬"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "项目设置"
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr "æ¢å¤åœºæ™¯"
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr "退出到项目列表"
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "无干扰模å¼"
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr "导入资æº"
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "导入"
+msgid "Miscellaneous project or scene-wide tools."
+msgstr "其他工程或全场景工具。"
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
-msgstr "其他工程或全场景工具"
+#, fuzzy
+msgid "Project"
+msgstr "新建"
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "工具"
+msgid "Project Settings"
+msgstr "项目设置"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr "导出项目到多个平å°ã€‚"
+msgid "Run Script"
+msgstr "è¿è¡Œè„šæœ¬"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr "导出"
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr "è¿è¡Œæ­¤é¡¹ç›®ï¼ˆF5)"
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr "播放"
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr "æš‚åœè¿è¡Œåœºæ™¯"
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "æš‚åœè¿è¡Œåœºæ™¯"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr "åœæ­¢è¿è¡Œåœºæ™¯"
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr "åœæ­¢"
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "打开并è¿è¡Œåœºæ™¯"
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "è¿è¡Œåœºæ™¯"
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr "è¿è¡Œè‡ªå®šä¹‰åœºæ™¯"
+msgid "Tools"
+msgstr "工具"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "è¿è¡Œè‡ªå®šä¹‰åœºæ™¯"
+msgid "Quit to Project List"
+msgstr "退出到项目列表"
-#: editor/editor_node.cpp
-msgid "Debug options"
-msgstr "调试选项"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr "调试"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -1648,9 +1768,10 @@ msgstr ""
"开坿­¤é¡¹åŽï¼Œæ‰€æœ‰è„šæœ¬åœ¨ä¿å­˜æ—¶éƒ½ä¼šè¢«æ­£åœ¨è¿è¡Œçš„æ¸¸æˆé‡æ–°åŠ è½½ã€‚\n"
"当使用远程设备调试时,使用网络文件系统能有效æé«˜ç¼–辑效率。"
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "设置"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "编辑"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1665,17 +1786,73 @@ msgid "Toggle Fullscreen"
msgstr "免屿¨¡å¼"
#: editor/editor_node.cpp editor/project_export.cpp
-#, fuzzy
msgid "Manage Export Templates"
-msgstr "正在加载导出模æ¿"
+msgstr "管ç†å¯¼å‡ºæ¨¡æ¿"
+
+#: editor/editor_node.cpp
+msgid "Help"
+msgstr "帮助"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr "类型"
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "关闭文档"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
#: editor/editor_node.cpp
msgid "About"
msgstr "关于"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
-msgstr "å¤–éƒ¨èµ„æºæ”¹å˜åŽå¼¹å‡ºæç¤ºã€‚"
+msgid "Play the project."
+msgstr "è¿è¡Œæ­¤é¡¹ç›®ï¼ˆF5)。"
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "播放"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "æš‚åœè¿è¡Œåœºæ™¯"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "æš‚åœè¿è¡Œåœºæ™¯"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "åœæ­¢è¿è¡Œåœºæ™¯ã€‚"
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "åœæ­¢"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "打开并è¿è¡Œåœºæ™¯ã€‚"
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "è¿è¡Œåœºæ™¯"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr "è¿è¡Œè‡ªå®šä¹‰åœºæ™¯"
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "è¿è¡Œè‡ªå®šä¹‰åœºæ™¯"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -1691,7 +1868,7 @@ msgstr "有更改时更新UI"
#: editor/editor_node.cpp
msgid "Disable Update Spinner"
-msgstr ""
+msgstr "ç¦ç”¨è‡ªåŠ¨æ›´æ–°"
#: editor/editor_node.cpp
msgid "Inspector"
@@ -1711,7 +1888,7 @@ msgstr "ä¿å­˜å½“å‰ç¼–辑的资æºã€‚"
#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Save As.."
-msgstr "å¦å­˜ä¸º"
+msgstr "å¦å­˜ä¸º.."
#: editor/editor_node.cpp
msgid "Go to the previous edited object in history."
@@ -1751,13 +1928,21 @@ msgstr "æ›´æ–°"
#: editor/editor_node.cpp
msgid "Thanks from the Godot community!"
-msgstr "感谢Godot社区"
+msgstr "感谢Godot社区!"
#: editor/editor_node.cpp
msgid "Thanks!"
msgstr "谢谢ï¼"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr "从ZIP文件中导入模æ¿"
@@ -1775,7 +1960,7 @@ msgstr "与现有åˆå¹¶"
#: editor/editor_node.cpp
msgid "Password:"
-msgstr "密ç "
+msgstr "密ç :"
#: editor/editor_node.cpp
msgid "Open & Run a Script"
@@ -1785,21 +1970,47 @@ msgstr "打开并è¿è¡Œè„šæœ¬"
msgid "Load Errors"
msgstr "加载错误"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "在编辑器中打开"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "在编辑器中打开"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Script Editor"
+msgstr "在编辑器中打开"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open Asset Library"
+msgstr "导出库"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "在编辑器中打开"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the previous Editor"
+msgstr "在编辑器中打开"
+
#: editor/editor_plugin_settings.cpp
msgid "Installed Plugins:"
msgstr "已安装æ’ä»¶:"
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
-msgstr "版本"
-
-#: editor/editor_plugin_settings.cpp
msgid "Author:"
-msgstr "作者"
+msgstr "作者:"
#: editor/editor_plugin_settings.cpp
msgid "Status:"
-msgstr "状æ€"
+msgstr "状æ€ï¼š"
#: editor/editor_profiler.cpp
msgid "Stop Profiling"
@@ -1906,65 +2117,58 @@ msgid "Import From Node:"
msgstr "从节点中导入:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Re-Download"
-msgstr "釿–°åŠ è½½"
+msgstr "釿–°ä¸‹è½½"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Uninstall"
-msgstr "安装"
+msgstr "å¸è½½"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "(Installed)"
-msgstr "安装"
+msgstr "(安装)"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Download"
-msgstr "å‘下"
+msgstr "下载"
#: editor/export_template_manager.cpp
msgid "(Missing)"
-msgstr ""
+msgstr "(丢失)"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "(Current)"
-msgstr "当å‰:"
+msgstr "(当å‰)"
#: editor/export_template_manager.cpp
msgid "Remove template version '%s'?"
-msgstr ""
+msgstr "移除版本为 '%s' 的模æ¿"
#: editor/export_template_manager.cpp
msgid "Can't open export templates zip."
-msgstr "无法打开ZIP导出模æ¿"
+msgstr "无法打开ZIP导出模æ¿ã€‚"
#: editor/export_template_manager.cpp
msgid "Invalid version.txt format inside templates."
-msgstr ""
+msgstr "æ¨¡æ¿æ–‡ä»¶ä¸­çš„version.txtä¸åˆæ³•。"
#: editor/export_template_manager.cpp
msgid ""
"Invalid version.txt format inside templates. Revision is not a valid "
"identifier."
-msgstr ""
+msgstr "模æ¿ä¸­çš„ version.txt文件格å¼ä¸åˆæ³•,无效的版本标识符。"
#: editor/export_template_manager.cpp
msgid "No version.txt found inside templates."
-msgstr ""
+msgstr "模æ¿ä¸­æ²¡æœ‰æ‰¾åˆ°version.txt文件。"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Error creating path for templates:\n"
-msgstr "ä¿å­˜è´´å›¾é›†å‡ºé”™:"
+msgstr "无法将模æ¿ä¿å­˜åˆ°ä»¥ä¸‹æ–‡ä»¶:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Extracting Export Templates"
-msgstr "正在加载导出模æ¿"
+msgstr "正在解压导出模æ¿"
#: editor/export_template_manager.cpp
msgid "Importing:"
@@ -1975,34 +2179,28 @@ msgid "Loading Export Templates"
msgstr "正在加载导出模æ¿"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Current Version:"
-msgstr "当å‰åœºæ™¯"
+msgstr "当å‰ç‰ˆæœ¬:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Installed Versions:"
-msgstr "已安装æ’ä»¶:"
+msgstr "已安装版本:"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Install From File"
-msgstr "安装项目:"
+msgstr "从文件安装"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Remove Template"
-msgstr "移除项目"
+msgstr "移除模æ¿"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Select template file"
-msgstr "删除选中的文件?"
+msgstr "åˆ é™¤é€‰ä¸­æ¨¡æ¿æ–‡ä»¶"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "Export Template Manager"
-msgstr "正在加载导出模æ¿"
+msgstr "模æ¿å¯¼å‡ºå·¥å…·"
#: editor/file_type_cache.cpp
msgid "Can't open file_type_cache.cch for writing, not saving file type cache!"
@@ -2010,7 +2208,7 @@ msgstr "无法以å¯å†™æ–¹å¼æ‰“å¼€file_type_cache.cchï¼"
#: editor/filesystem_dock.cpp
msgid "Cannot navigate to '"
-msgstr ""
+msgstr "无法导航到 "
#: editor/filesystem_dock.cpp
msgid "Same source and destination files, doing nothing."
@@ -2026,7 +2224,7 @@ msgstr "无法将目录移动到自身下。"
#: editor/filesystem_dock.cpp
msgid "Can't operate on '..'"
-msgstr "无法对'..'引用æ“作。"
+msgstr "无法对'..'引用æ“作"
#: editor/filesystem_dock.cpp
msgid "Pick New Name and Location For:"
@@ -2037,13 +2235,16 @@ msgid "No files selected!"
msgstr "没有选中任何文件ï¼"
#: editor/filesystem_dock.cpp
-#, fuzzy
msgid "Expand all"
-msgstr "展开父节点"
+msgstr "展开所有"
#: editor/filesystem_dock.cpp
msgid "Collapse all"
-msgstr ""
+msgstr "收起所有"
+
+#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "在资æºç®¡ç†å™¨ä¸­æ‰“å¼€"
#: editor/filesystem_dock.cpp
msgid "Instance"
@@ -2055,7 +2256,7 @@ msgstr "编辑ä¾èµ–.."
#: editor/filesystem_dock.cpp
msgid "View Owners.."
-msgstr "查看所有者"
+msgstr "查看所有者.."
#: editor/filesystem_dock.cpp
msgid "Copy Path"
@@ -2063,31 +2264,27 @@ msgstr "æ‹·è´è·¯å¾„"
#: editor/filesystem_dock.cpp
msgid "Rename or Move.."
-msgstr "移动或é‡å‘½å"
+msgstr "移动或é‡å‘½å.."
#: editor/filesystem_dock.cpp
msgid "Move To.."
-msgstr "移动"
+msgstr "移动.."
#: editor/filesystem_dock.cpp
msgid "Info"
msgstr "ä¿¡æ¯"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "在资æºç®¡ç†å™¨ä¸­æ‰“å¼€"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "釿–°å¯¼å…¥.."
#: editor/filesystem_dock.cpp
msgid "Previous Directory"
-msgstr "上一个目录:"
+msgstr "上一个目录"
#: editor/filesystem_dock.cpp
msgid "Next Directory"
-msgstr "下一个目录:"
+msgstr "下一个目录"
#: editor/filesystem_dock.cpp
msgid "Re-Scan Filesystem"
@@ -2116,7 +2313,7 @@ msgstr "从分组中移除"
#: editor/import/resource_importer_obj.cpp
#: editor/io_plugins/editor_mesh_import_plugin.cpp
msgid "Surface %d"
-msgstr ""
+msgstr "è¡¨é¢ %d"
#: editor/import/resource_importer_scene.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
@@ -2127,7 +2324,7 @@ msgstr "导入场景"
#: editor/import/resource_importer_scene.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Importing Scene.."
-msgstr "导入场景"
+msgstr "导入场景.."
#: editor/import/resource_importer_scene.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
@@ -2147,7 +2344,7 @@ msgstr "åŽå¤„ç†è„šæœ¬è¢«æŸå或ä¸åˆæ³•(查看控制å°ï¼‰:"
#: editor/import/resource_importer_scene.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Error running post-import script:"
-msgstr "åŽå¤„ç†è„šæœ¬è¿è¡Œå‘生错误"
+msgstr "åŽå¤„ç†è„šæœ¬è¿è¡Œå‘生错误:"
#: editor/import/resource_importer_scene.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
@@ -2155,21 +2352,18 @@ msgid "Saving.."
msgstr "ä¿å­˜ä¸­..."
#: editor/import_dock.cpp
-#, fuzzy
msgid " Files"
msgstr "文件"
#: editor/import_dock.cpp
-#, fuzzy
msgid "Import As:"
-msgstr "导入"
+msgstr "导入为:"
#: editor/import_dock.cpp editor/property_editor.cpp
msgid "Preset.."
msgstr "预设.."
#: editor/import_dock.cpp
-#, fuzzy
msgid "Reimport"
msgstr "釿–°å¯¼å…¥"
@@ -2233,7 +2427,7 @@ msgstr "接å—"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
msgid "Bit Mask"
-msgstr ""
+msgstr "使ީç ï¼ˆBitMask)"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "No source font file!"
@@ -2244,12 +2438,13 @@ msgid "No target font resource!"
msgstr "请设置目标字体资æºï¼"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
"文件扩展åä¸åˆæ³•\n"
-"请使用.fnt文件"
+"请使用.fnt文件。"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Can't load/process source font."
@@ -2333,7 +2528,7 @@ msgstr "字体"
#: editor/io_plugins/editor_mesh_import_plugin.cpp
msgid "No meshes to import!"
-msgstr "没有è¦å¯¼å…¥çš„Mesh"
+msgstr "没有è¦å¯¼å…¥çš„Meshï¼"
#: editor/io_plugins/editor_mesh_import_plugin.cpp
msgid "Single Mesh Import"
@@ -2423,11 +2618,11 @@ msgstr "æºè·¯å¾„为空。"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Couldn't load post-import script."
-msgstr "无法载入åŽå¯¼å…¥è„šæœ¬"
+msgstr "无法载入åŽå¯¼å…¥è„šæœ¬ã€‚"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Invalid/broken script for post-import."
-msgstr "åŽå¯¼å…¥è„šæœ¬è¢«æŸå或ä¸åˆæ³•"
+msgstr "åŽå¯¼å…¥è„šæœ¬è¢«æŸå或ä¸åˆæ³•。"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Error importing scene."
@@ -2571,7 +2766,7 @@ msgstr "导入2D大图"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Source Texture"
-msgstr "æºè´´å›¾:"
+msgstr "æºè´´å›¾"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Base Atlas Texture"
@@ -2579,7 +2774,7 @@ msgstr "基础图集纹ç†"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Source Texture(s)"
-msgstr "æºè´´å›¾:"
+msgstr "æºè´´å›¾(s)"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Import Textures for 2D"
@@ -2666,7 +2861,7 @@ msgstr "剪è£å›¾ç‰‡"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Blitting Images"
-msgstr ""
+msgstr "Blitting 图片"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Couldn't save atlas image:"
@@ -2691,7 +2886,7 @@ msgstr "列"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#: editor/script_create_dialog.cpp
msgid "Language"
-msgstr "语言:"
+msgstr "语言"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "No items to import!"
@@ -2726,8 +2921,9 @@ msgid "Compress"
msgstr "压缩"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr "添加到项目(godot.cfg)"
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "添加到项目 (godot.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -2743,7 +2939,7 @@ msgstr "多节点组"
#: editor/node_dock.cpp
msgid "Groups"
-msgstr "分组:"
+msgstr "分组"
#: editor/node_dock.cpp
msgid "Select a Node to edit Signals and Groups."
@@ -2766,9 +2962,8 @@ msgid "Change Animation Name:"
msgstr "é‡å‘½å动画:"
#: editor/plugins/animation_player_editor_plugin.cpp
-#, fuzzy
msgid "Delete Animation?"
-msgstr "å¤åˆ¶åŠ¨ç”»"
+msgstr "删除动画"
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
@@ -2795,7 +2990,7 @@ msgstr "添加动画"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Blend Next Changed"
-msgstr ""
+msgstr "æ··åˆä¸‹ä¸€æ­¥å˜æ›´"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Change Blend Time"
@@ -2851,11 +3046,11 @@ msgstr "从当å‰ä½ç½®æ’­æ”¾é€‰ä¸­åŠ¨ç”»ï¼ˆD)"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Animation position (in seconds)."
-msgstr "动画ä½ç½®ï¼ˆå•ä½:秒)"
+msgstr "动画ä½ç½®ï¼ˆå•ä½:秒)。"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Scale animation playback globally for the node."
-msgstr "节点全局缩放动画回放"
+msgstr "节点全局缩放动画回放。"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Create new animation in player."
@@ -2933,15 +3128,15 @@ msgstr "æ–°åç§°:"
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Scale:"
-msgstr "缩放"
+msgstr "缩放:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Fade In (s):"
-msgstr "淡入(秒)"
+msgstr "淡入(秒):"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Fade Out (s):"
-msgstr "淡出(秒)"
+msgstr "淡出(秒):"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend"
@@ -2986,7 +3181,7 @@ msgstr "æ··åˆ1:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "X-Fade Time (s):"
-msgstr ""
+msgstr "X-Fade(äº¤å‰æ·¡åŒ–)æ—¶é—´(s):"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Current:"
@@ -3026,23 +3221,23 @@ msgstr "动画节点"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "OneShot Node"
-msgstr ""
+msgstr "å•项节点"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Mix Node"
-msgstr ""
+msgstr "æ··åˆ(Mix)节点"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend2 Node"
-msgstr ""
+msgstr "æ··åˆ2(Blend) 节点"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend3 Node"
-msgstr ""
+msgstr "æ··åˆ3(Blend) 节点"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend4 Node"
-msgstr ""
+msgstr "æ··åˆ4(Blend) 节点"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "TimeScale Node"
@@ -3050,7 +3245,7 @@ msgstr "时间缩放节点"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "TimeSeek Node"
-msgstr ""
+msgstr "TimeSeek(时间寻找) 节点"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Transition Node"
@@ -3058,7 +3253,7 @@ msgstr "过渡节点"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Import Animations.."
-msgstr "导入动画"
+msgstr "导入动画.."
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Edit Node Filters"
@@ -3090,19 +3285,19 @@ msgstr "修正光照"
#: editor/plugins/baked_light_baker.cpp
msgid "Making BVH"
-msgstr ""
+msgstr "制作BVH(动作骨骼)"
#: editor/plugins/baked_light_baker.cpp
msgid "Creating Light Octree"
-msgstr ""
+msgstr "创建光的 Octree(八剿 ‘)"
#: editor/plugins/baked_light_baker.cpp
msgid "Creating Octree Texture"
-msgstr ""
+msgstr "创建 Octree (八剿 ‘) 纹ç†"
#: editor/plugins/baked_light_baker.cpp
msgid "Transfer to Lightmaps:"
-msgstr ""
+msgstr "转移到光照贴图:"
#: editor/plugins/baked_light_baker.cpp
msgid "Allocating Texture #"
@@ -3114,7 +3309,7 @@ msgstr "烘培三角形 #"
#: editor/plugins/baked_light_baker.cpp
msgid "Post-Processing Texture #"
-msgstr ""
+msgstr "åŽåŠ å·¥çº¹ç† #"
#: editor/plugins/baked_light_editor_plugin.cpp
msgid "Bake!"
@@ -3122,7 +3317,7 @@ msgstr "烘培ï¼"
#: editor/plugins/baked_light_editor_plugin.cpp
msgid "Reset the lightmap octree baking process (start over)."
-msgstr ""
+msgstr "é‡ç½®è´´å›¾çƒ˜ç„™è¿‡ç¨‹ ï¼ˆé‡æ–°å¼€å§‹ï¼‰ çš„ octree (八剿 ‘)。"
#: editor/plugins/camera_editor_plugin.cpp
#: editor/plugins/sample_library_editor_plugin.cpp
@@ -3173,7 +3368,7 @@ msgstr "编辑锚点"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Zoom (%):"
-msgstr "缩放(%)"
+msgstr "缩放(%):"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Paste Pose"
@@ -3212,7 +3407,7 @@ msgstr "旋转模å¼"
msgid ""
"Show a list of all objects at the position clicked\n"
"(same as Alt+RMB in select mode)."
-msgstr "显示鼠标点击ä½ç½®çš„æ‰€æœ‰èŠ‚ç‚¹ï¼ˆåŒAlt+é¼ æ ‡å³é”®ï¼‰"
+msgstr "显示鼠标点击ä½ç½®çš„æ‰€æœ‰èŠ‚ç‚¹ï¼ˆåŒAlt+é¼ æ ‡å³é”®ï¼‰ã€‚"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Click to change object's rotation pivot."
@@ -3356,11 +3551,11 @@ msgstr "å¸é™„(åƒç´ ï¼‰ï¼š"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Add %s"
-msgstr "添加 %s"
+msgstr "添加(Add) %s"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Adding %s..."
-msgstr ""
+msgstr "添加(Adding) %s..."
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Create Node"
@@ -3368,7 +3563,7 @@ msgstr "新节点"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Error instancing scene from %s"
-msgstr "从%s实例化场景出错ï¼"
+msgstr "从%s实例化场景出错"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "OK :("
@@ -3387,7 +3582,7 @@ msgid "Change default type"
msgstr "修改默认值"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "好的"
@@ -3396,6 +3591,8 @@ msgid ""
"Drag & drop + Shift : Add node as sibling\n"
"Drag & drop + Alt : Change node type"
msgstr ""
+"拖放+ Shift:将节点添加为兄弟节点\n"
+"拖放+ Alt:更改节点类型"
#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
@@ -3426,32 +3623,23 @@ msgstr "编辑多边形(移除顶点)"
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
#: editor/plugins/navigation_polygon_editor_plugin.cpp
msgid "Create a new polygon from scratch."
-msgstr ""
+msgstr "从头开始创建一个新的多边形。"
#: editor/plugins/collision_polygon_editor_plugin.cpp
msgid "Create Poly3D"
-msgstr ""
+msgstr "创建 Poly3D (多边型3D)"
#: editor/plugins/collision_shape_2d_editor_plugin.cpp
msgid "Set Handle"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
+msgstr "设置处ç†ç¨‹åº"
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
-msgstr ""
+msgstr "创建 Mesh(网格) 库"
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Thumbnail.."
-msgstr ""
+msgstr "缩略图.."
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Remove item %d?"
@@ -3475,6 +3663,34 @@ msgstr "从场景中导入"
msgid "Update from Scene"
msgstr "从场景中更新"
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "添加输入事件"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "移除路径顶点"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Load preset"
+msgstr "加载资æº"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr "修改曲线"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr "添加/删除色彩æ¸å˜ç‚¹"
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr "修改色彩曲线图"
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr "第%d项"
@@ -3499,32 +3715,29 @@ msgstr "编辑已存在的多边形:"
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
#: editor/plugins/navigation_polygon_editor_plugin.cpp
msgid "LMB: Move Point."
-msgstr "鼠标左键:移动点"
+msgstr "鼠标左键:移动点。"
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
#: editor/plugins/navigation_polygon_editor_plugin.cpp
msgid "Ctrl+LMB: Split Segment."
-msgstr "Ctrl+鼠标左键:分割视图å—"
+msgstr "Ctrl+鼠标左键:分割视图å—。"
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
#: editor/plugins/navigation_polygon_editor_plugin.cpp
msgid "RMB: Erase Point."
-msgstr "é¼ æ ‡å³é”®:移除点"
+msgstr "é¼ æ ‡å³é”®:移除点。"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Remove Point from Line2D"
-msgstr "从曲线中移除顶点"
+msgstr "从Line2D中移除顶点"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Add Point to Line2D"
-msgstr "呿›²çº¿æ·»åŠ é¡¶ç‚¹"
+msgstr "å‘Line2D添加顶点"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Move Point in Line2D"
-msgstr "在曲线中移动顶点"
+msgstr "在Line2D中移动顶点"
#: editor/plugins/line_2d_editor_plugin.cpp
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -3554,11 +3767,11 @@ msgstr "é¼ æ ‡å³é”®:删除点"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point (in empty space)"
-msgstr ""
+msgstr "添加点(在空白处)"
#: editor/plugins/line_2d_editor_plugin.cpp
msgid "Split Segment (in line)"
-msgstr ""
+msgstr "拆分片段(使用线段)"
#: editor/plugins/line_2d_editor_plugin.cpp
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -3572,11 +3785,11 @@ msgstr "Mesh为空ï¼"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Static Trimesh Body"
-msgstr ""
+msgstr "åˆ›å»ºé™æ€ä¸‰ç»´èº«ä½“"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Static Convex Body"
-msgstr ""
+msgstr "åˆ›å»ºé™æ€å‡¸ä½“(Convex Body)"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "This doesn't work on scene root!"
@@ -3584,99 +3797,99 @@ msgstr "æ­¤æ“作无法引用在根节点上ï¼"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Trimesh Shape"
-msgstr ""
+msgstr "创建Trimesh(三维网格)形状"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Convex Shape"
-msgstr ""
+msgstr "创建 凸(Convex) 形状"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Navigation Mesh"
-msgstr ""
+msgstr "创建导航Mesh(网格)"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "MeshInstance lacks a Mesh!"
-msgstr ""
+msgstr "MeshInstance (网格实例) 缺少 Mesh(网格)ï¼"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Mesh has not surface to create outlines from!"
-msgstr ""
+msgstr "Mesh(网格)æ²¡æœ‰è¡¨é¢æ¥åˆ›å»ºè½®å»“(outlines)ï¼"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
-msgstr ""
+msgstr "无法创建轮廓(outlines)ï¼"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Outline"
-msgstr ""
+msgstr "创建轮廓(outlines)"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Trimesh Static Body"
-msgstr ""
+msgstr "åˆ›å»ºä¸‰ç»´é™æ€èº«ä½“(Body)"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Convex Static Body"
-msgstr ""
+msgstr "创建凸(Convex ) 陿€ä½“"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Trimesh Collision Sibling"
-msgstr ""
+msgstr "创建三维碰撞åŒçº§"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Convex Collision Sibling"
-msgstr ""
+msgstr "创建凸(Convex)碰撞åŒçº§"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Outline Mesh.."
-msgstr ""
+msgstr "创建轮廓网格(Outline Mesh).."
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Outline Mesh"
-msgstr ""
+msgstr "创建轮廓网格(Outline Mesh)"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Outline Size:"
-msgstr ""
+msgstr "轮廓(outlines)尺寸:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "No mesh source specified (and no MultiMesh set in node)."
-msgstr ""
+msgstr "未指定网格(Mesh)æºï¼ˆä¸”节点中没有设置多网格物体(MultiMesh))。"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "No mesh source specified (and MultiMesh contains no Mesh)."
-msgstr ""
+msgstr "未指定网格(Mesh)æºï¼ˆä¸”多网格(MultiMesh)ä¸åŒ…å«ç½‘æ ¼(Mesh))。"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Mesh source is invalid (invalid path)."
-msgstr ""
+msgstr "网格(Mesh)æºæ— æ•ˆï¼ˆè·¯å¾„无效)。"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Mesh source is invalid (not a MeshInstance)."
-msgstr ""
+msgstr "网格(Mesh)æºæ— æ•ˆï¼ˆä¸æ˜¯ç½‘格实例(MeshInstance))。"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Mesh source is invalid (contains no Mesh resource)."
-msgstr ""
+msgstr "网格(Mesh)æºæ— æ•ˆï¼ˆä¸åŒ…å«ç½‘æ ¼(Mesh)资æºï¼‰ã€‚"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "No surface source specified."
-msgstr ""
+msgstr "æ²¡æœ‰æŒ‡å®šçš„è¡¨é¢æºã€‚"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Surface source is invalid (invalid path)."
-msgstr ""
+msgstr "表é¢çš„æºæ— æ•ˆï¼ˆè·¯å¾„æ— æ•ˆï¼‰ã€‚"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Surface source is invalid (no geometry)."
-msgstr ""
+msgstr "表é¢çš„æºæ— æ•ˆï¼ˆæ— å‡ ä½•ï¼‰ã€‚"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Surface source is invalid (no faces)."
-msgstr ""
+msgstr "表é¢çš„æºæ— æ•ˆï¼ˆæ— é¢ï¼‰ã€‚"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Parent has no solid faces to populate."
-msgstr ""
+msgstr "çˆ¶çº§æ²¡æœ‰å®žä½“é¢æ¥å¡«å……。"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Couldn't map area."
@@ -3692,11 +3905,11 @@ msgstr "选择一个目标曲é¢ï¼š"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Populate Surface"
-msgstr ""
+msgstr "填充表é¢"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Populate MultiMesh"
-msgstr ""
+msgstr "填充MultiMesh(多网格)"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Target Surface:"
@@ -3720,7 +3933,7 @@ msgstr "Zè½´"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Mesh Up Axis:"
-msgstr ""
+msgstr "Mesh (网格)上轴:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Random Rotation:"
@@ -3736,7 +3949,7 @@ msgstr "éšæœºç¼©æ”¾:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Populate"
-msgstr ""
+msgstr "å¡«å……"
#: editor/plugins/navigation_polygon_editor_plugin.cpp
msgid "Create Navigation Polygon"
@@ -3747,86 +3960,144 @@ msgid "Remove Poly And Point"
msgstr "移除多边形åŠé¡¶ç‚¹"
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr "清除Emission Mask(å‘å°„å±è”½ï¼‰"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generating AABB"
+msgstr "生æˆAABB"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr "加载图片出错:"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "No pixels with transparency > 128 in image.."
-msgstr ""
+msgstr "å›¾ç‰‡ä¸­æ²¡æœ‰é€æ˜Žåº¦> 128çš„åƒç´ .."
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Set Emission Mask"
-msgstr ""
+msgstr "设置Emission Mask(å‘å°„å±è”½ï¼‰"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
-msgstr ""
+msgstr "加载Emission Mask(å‘å°„å±è”½ï¼‰"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Generated Point Count:"
msgstr "生æˆé¡¶ç‚¹è®¡æ•°:"
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generation Time (sec):"
+msgstr "å¹³å‡å¸§æ—¶é—´ï¼ˆç§’)"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Mask"
+msgstr "设置Emission Mask(å‘å°„å±è”½ï¼‰"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Capture from Pixel"
+msgstr "从场景中创建"
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Emission Colors"
+msgstr "å‘å°„ä½ç½®:"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
-msgstr ""
+msgstr "节点ä¸åŒ…å«å‡ ä½•。"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry (faces)."
-msgstr ""
+msgstr "节点ä¸åŒ…å«å‡ ä½•(é¢ï¼‰ã€‚"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr "需è¦ä½¿ç”¨â€œParticlesMaterialâ€ç±»åž‹çš„å¤„ç†æè´¨ã€‚"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
-msgstr ""
+msgstr "é¢ä¸å«æœ‰åŒºåŸŸï¼"
#: editor/plugins/particles_editor_plugin.cpp
msgid "No faces!"
-msgstr ""
+msgstr "没有é¢ï¼"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Generate AABB"
msgstr "生æˆAABB"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
-msgstr ""
+msgid "Create Emission Points From Mesh"
+msgstr "从网格( Mesh)创建å‘射器(Emission)"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
-msgstr ""
+msgid "Create Emission Points From Node"
+msgstr "从节点创建å‘射器(Emission)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Clear Emitter"
-msgstr ""
+msgstr "清除å‘射器(Emitter)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Create Emitter"
-msgstr ""
+msgstr "创建å‘射器(Emitter)"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
-msgstr ""
+msgid "Emission Points:"
+msgstr "å‘å°„ä½ç½®:"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
-msgstr ""
+msgid "Surface Points"
+msgstr "表é¢é¡¶ç‚¹"
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
-msgstr ""
+msgid "Surface Points+Normal (Directed)"
+msgstr "表é¢å®šç‚¹+法线(方å‘å‘é‡ï¼‰"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
-msgstr ""
+msgstr "体积"
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr "å‘å°„æºï¼š"
+
+#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
+msgid "Generate Visibility AABB"
+msgstr "生æˆAABB"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr "从曲线中移除顶点"
#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control from Curve"
+msgstr "移动曲线外控制点"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control from Curve"
+msgstr "从曲线中移除顶点"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr "呿›²çº¿æ·»åŠ é¡¶ç‚¹"
@@ -3850,7 +4121,7 @@ msgstr "选择控制点(Shift+拖动)"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Split Segment (in curve)"
-msgstr ""
+msgstr "拆分(曲线)"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
@@ -3867,20 +4138,30 @@ msgstr "è®¾ç½®æ›²çº¿é¡¶ç‚¹åæ ‡"
#: editor/plugins/path_editor_plugin.cpp
msgid "Set Curve In Pos"
-msgstr ""
+msgstr "设置的曲线输入ä½ç½®ï¼ˆPos)"
#: editor/plugins/path_editor_plugin.cpp
msgid "Set Curve Out Pos"
-msgstr ""
+msgstr "设置曲线输出ä½ç½®ï¼ˆPos)"
#: editor/plugins/path_editor_plugin.cpp
msgid "Split Path"
-msgstr ""
+msgstr "拆分路径"
#: editor/plugins/path_editor_plugin.cpp
msgid "Remove Path Point"
msgstr "移除路径顶点"
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "移动曲线外控制点"
+
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove In-Control Point"
+msgstr "移动曲线内控制点"
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr "创建UV贴图"
@@ -4022,7 +4303,7 @@ msgstr "立体声"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Mono"
-msgstr ""
+msgstr "å•声é“"
#: editor/plugins/sample_library_editor_plugin.cpp
#: editor/script_editor_debugger.cpp
@@ -4031,11 +4312,16 @@ msgstr "æ ¼å¼"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Pitch"
-msgstr ""
+msgstr "音调"
+
+#: editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Clear Recent Files"
+msgstr "清除骨骼"
#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
-msgstr "ä¿å­˜ä¸»é¢˜å‡ºé”™ã€‚"
+msgstr "ä¿å­˜ä¸»é¢˜å‡ºé”™"
#: editor/plugins/script_editor_plugin.cpp
msgid "Error saving"
@@ -4043,7 +4329,7 @@ msgstr "ä¿å­˜å‡ºé”™"
#: editor/plugins/script_editor_plugin.cpp
msgid "Error importing theme"
-msgstr "导入主题出错。"
+msgstr "导入主题出错"
#: editor/plugins/script_editor_plugin.cpp
msgid "Error importing"
@@ -4055,7 +4341,7 @@ msgstr "导入主题"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save Theme As.."
-msgstr "主题å¦å­˜ä¸º"
+msgstr "主题å¦å­˜ä¸º.."
#: editor/plugins/script_editor_plugin.cpp
msgid "Next script"
@@ -4121,10 +4407,6 @@ msgstr "查找.."
msgid "Find Next"
msgstr "查找下一项"
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr "调试"
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr "啿­¥è·³è¿‡"
@@ -4158,37 +4440,29 @@ msgid "Move Right"
msgstr "å‘å³ç§»åЍ"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr "教程"
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr "打开 https://godotengine.org 中的教程."
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
-msgstr "类型"
+#, fuzzy
+msgid "Open Godot online documentation"
+msgstr "æœç´¢æ–‡æ¡£ã€‚"
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
-msgstr "æœç´¢ç±»"
+msgstr "æœç´¢ç±»ã€‚"
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the reference documentation."
-msgstr "æœç´¢æ–‡æ¡£"
+msgstr "æœç´¢æ–‡æ¡£ã€‚"
#: editor/plugins/script_editor_plugin.cpp
msgid "Go to previous edited document."
-msgstr "å‰å¾€ä¸Šä¸€ä¸ªç¼–辑文档"
+msgstr "å‰å¾€ä¸Šä¸€ä¸ªç¼–辑文档。"
#: editor/plugins/script_editor_plugin.cpp
msgid "Go to next edited document."
-msgstr "å‰å¾€ä¸‹ä¸€ä¸ªç¼–辑文档"
+msgstr "å‰å¾€ä¸‹ä¸€ä¸ªç¼–辑文档。"
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Discard"
-msgstr "分离"
+msgstr "忽略"
#: editor/plugins/script_editor_plugin.cpp
msgid "Create Script"
@@ -4224,6 +4498,23 @@ msgid "Pick Color"
msgstr "拾å–颜色"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "正在转æ¢å›¾ç‰‡"
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4274,6 +4565,14 @@ msgid "Trim Trailing Whitespace"
msgstr "修剪行åŽç©ºç™½"
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr "自动缩进"
@@ -4295,6 +4594,16 @@ msgid "Goto Previous Breakpoint"
msgstr "å‰å¾€ä¸Šä¸€ä¸ªæ–­ç‚¹"
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "转æ¢ä¸º.."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "转æ¢ä¸º.."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr "查找上一项"
@@ -4317,6 +4626,10 @@ msgstr "å‰å¾€è¡Œ.."
msgid "Contextual Help"
msgstr "æœç´¢å…‰æ ‡ä½ç½®"
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr "修改Scalar常é‡ç³»æ•°"
@@ -4331,19 +4644,19 @@ msgstr "修改RGB常é‡ç³»æ•°"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Operator"
-msgstr ""
+msgstr "更改标é‡è¿ç®—符(Scalar Operator)"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Operator"
-msgstr ""
+msgstr "更改 Vec è¿ç®—符(Vec Operator)"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Scalar Operator"
-msgstr ""
+msgstr "更改Vecæ ‡é‡è¿ç®—符(Vec Scalar Operator)"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change RGB Operator"
-msgstr ""
+msgstr "更改RGBè¿ç®—符(RGB Operator)"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Toggle Rot Only"
@@ -4391,15 +4704,15 @@ msgstr "修改注释"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Add/Remove to Color Ramp"
-msgstr ""
+msgstr "添加/删除颜色å¡åº¦"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Add/Remove to Curve Map"
-msgstr ""
+msgstr "添加/删除曲线地图"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Modify Curve Map"
-msgstr ""
+msgstr "修改曲线图"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Input Name"
@@ -4467,103 +4780,173 @@ msgstr "Zè½´å˜æ¢ã€‚"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Plane Transform."
-msgstr ""
+msgstr "视图平é¢å˜æ¢ã€‚"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scaling to %s%%."
-msgstr "缩放到%s%%"
+msgstr "缩放到%s%%。"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotating %s degrees."
-msgstr "旋转%s度"
+msgstr "旋转%s度。"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom View."
-msgstr ""
+msgstr "仰视图(Bottom View)。"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom"
-msgstr ""
+msgstr "底部"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Top View."
-msgstr ""
+msgstr "俯视图(Top View)。"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Top"
-msgstr ""
+msgstr "顶部"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rear View."
-msgstr ""
+msgstr "åŽè§†å›¾ã€‚"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rear"
-msgstr ""
+msgstr "åŽæ–¹"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Front View."
-msgstr ""
+msgstr "正视图。"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Front"
-msgstr ""
+msgstr "å‰é¢"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Left View."
-msgstr ""
+msgstr "左视图。"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Left"
-msgstr ""
+msgstr "左方"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Right View."
-msgstr ""
+msgstr "å³è§†å›¾ã€‚"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Right"
-msgstr ""
+msgstr "峿–¹"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Keying is disabled (no key inserted)."
-msgstr ""
+msgstr "键控被ç¦ç”¨ï¼ˆæœªæ’入键)。"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Animation Key Inserted."
+msgstr "æ’入动画键。"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Align with view"
+msgid "Freelook Right"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
-msgstr "环境"
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "å‰è¿›"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "å‘åŽ"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+#, fuzzy
+msgid "Freelook Down"
+msgstr "滚轮å‘下滚动。"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
-msgstr "XFormå¯¹è¯æ¡†"
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "有更改时更新UI"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "有更改时更新UI"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "有更改时更新UI"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Vertices"
+msgstr "顶点"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align with view"
+msgstr "与视图对é½"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Normal"
+msgstr "显示法线"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Wireframe"
+msgstr "显示线框"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Overdraw"
+msgstr "显示过度绘制"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Display Unshaded"
+msgstr "显示无阴影"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Environment"
+msgstr "环境"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "没有选用è¦å®žä¾‹åŒ–的场景ï¼"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Gizmos(å¯è§†åŒ–调试工具)"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "无法实例化场景ï¼"
+msgid "Audio Listener"
+msgstr "音频监å¬å™¨"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr "XFormå¯¹è¯æ¡†"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4579,7 +4962,7 @@ msgstr "缩放模å¼ï¼ˆR)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom View"
-msgstr ""
+msgstr "底部视图"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Top View"
@@ -4622,6 +5005,26 @@ msgid "Align Selection With View"
msgstr "选中项与视图对é½"
#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Select"
+msgstr "选择"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Move"
+msgstr "移动"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl:旋转"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Tool Scale"
+msgstr "缩放:"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
msgstr "å˜æ¢"
@@ -4634,14 +5037,6 @@ msgid "Transform Dialog.."
msgstr "å˜æ¢å¯¹è¯æ¡†.."
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr "使用默认光照"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "使用默认sRGB"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
msgstr "1个视å£"
@@ -4666,22 +5061,6 @@ msgid "4 Viewports"
msgstr "4个视å£"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr "显示法线"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr "显示线框"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr "显示原点"
@@ -4690,44 +5069,40 @@ msgid "View Grid"
msgstr "显示网格"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "设置"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
-msgstr ""
+msgstr "æ•æ‰(snap)设置"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Translate Snap:"
-msgstr ""
+msgstr "ç§»åŠ¨æ•æ‰ï¼ˆSnap):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotate Snap (deg.):"
-msgstr ""
+msgstr "æ—‹è½¬æ•æ‰(Snap)(度):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scale Snap (%):"
-msgstr ""
+msgstr "ç¼©æ”¾æ•æ‰ï¼ˆï¼…):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Viewport Settings"
msgstr "Viewport设置"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr "默认光照法线:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr "环境光颜色:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr "é€è§†è§†è§’(角度):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Z-Near:"
-msgstr "查看Z-Near"
+msgstr "查看Z-Near:"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Z-Far:"
-msgstr "查看Z-Far"
+msgstr "查看Z-Far:"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform Change"
@@ -4751,11 +5126,11 @@ msgstr "å˜æ¢ç±»åž‹"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Pre"
-msgstr ""
+msgstr "å‰ï¼ˆper)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Post"
-msgstr ""
+msgstr "å‘布(Post)"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "ERROR: Couldn't load frame resource!"
@@ -4795,7 +5170,7 @@ msgstr "动画"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Speed (FPS):"
-msgstr "速度(FPS)"
+msgstr "速度(FPS):"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Animation Frames"
@@ -4847,7 +5222,7 @@ msgstr "网格åç§»é‡:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Step:"
-msgstr "步长(秒)"
+msgstr "步长(秒):"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Separation:"
@@ -4908,23 +5283,23 @@ msgstr "å¤é€‰æ¡† 选项2"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Item"
-msgstr ""
+msgstr "项目(Item)"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Check Item"
-msgstr ""
+msgstr "检查项目(Item)"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Checked Item"
-msgstr ""
+msgstr "已选项目(Checked Item)"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
-msgstr ""
+msgstr "有(Has)"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Many"
-msgstr ""
+msgstr "许多(Many)"
#: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp
msgid "Options"
@@ -4932,7 +5307,7 @@ msgstr "选项"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Have,Many,Several,Options!"
-msgstr ""
+msgstr "有,很多,几个,选项(Have,Many,Several,Options)ï¼"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Tab 1"
@@ -5001,7 +5376,7 @@ msgstr "沿Y轴翻转"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Bucket"
-msgstr ""
+msgstr "æ¡¶(Bucket)"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Pick Tile"
@@ -5033,7 +5408,7 @@ msgstr "找ä¸åˆ°ç –å—:"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Item name or ID:"
-msgstr "项目å称或ID"
+msgstr "项目å称或ID:"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Create from scene?"
@@ -5056,99 +5431,88 @@ msgid "Error"
msgstr "错误"
#: editor/project_export.cpp
-#, fuzzy
msgid "Runnable"
msgstr "å¯ç”¨"
#: editor/project_export.cpp
-#, fuzzy
msgid "Delete patch '"
-msgstr "删除输入事件"
+msgstr "删除Patch"
#: editor/project_export.cpp
-#, fuzzy
msgid "Delete preset '%s'?"
-msgstr "删除选中的文件?"
+msgstr "删除选中的 '%s'?"
#: editor/project_export.cpp
-#, fuzzy
msgid "Presets"
-msgstr "预设.."
+msgstr "预设"
#: editor/project_export.cpp editor/project_settings.cpp
msgid "Add.."
-msgstr "添加:"
+msgstr "添加.."
#: editor/project_export.cpp
msgid "Resources"
msgstr "资æº"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export all resources in the project"
-msgstr "导出项目中的所有资æº"
+msgstr "导出项目中的所有资æºã€‚"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export selected scenes (and dependencies)"
-msgstr "导出选中的资æºï¼ˆåŒ…括其ä¾èµ–资æºï¼‰"
+msgstr "导出选中的场景(包括其ä¾èµ–)。"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export selected resources (and dependencies)"
-msgstr "导出选中的资æºï¼ˆåŒ…括其ä¾èµ–资æºï¼‰"
+msgstr "导出选中的资æºï¼ˆåŒ…括其ä¾èµ–资æºï¼‰ã€‚"
#: editor/project_export.cpp
msgid "Export Mode:"
msgstr "导出模å¼:"
#: editor/project_export.cpp
-#, fuzzy
msgid "Resources to export:"
msgstr "导出的资æº:"
#: editor/project_export.cpp
-#, fuzzy
msgid ""
"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"
msgstr "导出éžèµ„æºæ–‡ä»¶ç­›é€‰ï¼ˆä½¿ç”¨è‹±æ–‡é€—å·åˆ†éš”,如:*.json,*.txt):"
#: editor/project_export.cpp
-#, fuzzy
msgid ""
"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)"
msgstr "排除导出的éžèµ„æºæ–‡ä»¶ç­›é€‰ï¼ˆä½¿ç”¨è‹±æ–‡é€—å·åˆ†éš”,如:*.json,*.txt):"
#: editor/project_export.cpp
-#, fuzzy
msgid "Patches"
-msgstr "匹é…项:"
+msgstr "Patch"
#: editor/project_export.cpp
-#, fuzzy
msgid "Make Patch"
-msgstr "目标路径:"
+msgstr "制作Patch"
#: editor/project_export.cpp
msgid "Export templates for this platform are missing:"
-msgstr ""
+msgstr "没有下列平å°çš„导出模æ¿:"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export With Debug"
-msgstr "导出砖å—集"
+msgstr "导出为调试"
#: editor/project_manager.cpp
msgid "Invalid project path, the path must exist!"
msgstr "项目目录ä¸å­˜åœ¨ï¼"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
-msgstr "项目目录下必须包å«engin.cfg文件。"
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "项目目录下ä¸èƒ½åŒ…å«godot.cfg文件。"
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
-msgstr "项目目录下必须包å«engin.cfg文件。"
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "项目目录下必须包å«godot.cfg文件。"
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5159,7 +5523,8 @@ msgid "Invalid project path (changed anything?)."
msgstr "é¡¹ç›®è·¯å¾„éžæ³•(被外部修改?)。"
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+#, fuzzy
+msgid "Couldn't create project.godot in project path."
msgstr "无法在项目目录下创建godot.cfg文件。"
#: editor/project_manager.cpp
@@ -5168,7 +5533,7 @@ msgstr "æå–以下文件失败:"
#: editor/project_manager.cpp
msgid "Package Installed Successfully!"
-msgstr ""
+msgstr "软件包安装æˆåŠŸï¼"
#: editor/project_manager.cpp
msgid "Import Existing Project"
@@ -5176,7 +5541,7 @@ msgstr "导入现有项目"
#: editor/project_manager.cpp
msgid "Project Path (Must Exist):"
-msgstr "项目目录(必须存在)"
+msgstr "项目目录(必须存在):"
#: editor/project_manager.cpp
msgid "Project Name:"
@@ -5188,17 +5553,13 @@ msgstr "新建项目"
#: editor/project_manager.cpp
msgid "Project Path:"
-msgstr "项目目录"
+msgstr "项目目录:"
#: editor/project_manager.cpp
msgid "Install Project:"
msgstr "安装项目:"
#: editor/project_manager.cpp
-msgid "Install"
-msgstr "安装"
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "æµè§ˆ"
@@ -5257,6 +5618,11 @@ msgid "New Project"
msgstr "新建"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "移除模æ¿"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "退出"
@@ -5274,11 +5640,11 @@ msgstr "摇æ†è½´"
#: editor/project_settings.cpp
msgid "Mouse Button"
-msgstr "鼠标按键:"
+msgstr "鼠标按键"
#: editor/project_settings.cpp
msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Actionåéžæ³•(ä¸å¾—包å«'/'或':')"
+msgstr "Actionåéžæ³•(ä¸å¾—包å«'/'或':')。"
#: editor/project_settings.cpp
msgid "Action '%s' already exists!"
@@ -5356,18 +5722,16 @@ msgid "Button 9"
msgstr "按键 9"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Axis Index:"
-msgstr "手柄摇æ†"
+msgstr "手柄摇æ†åºå·:"
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Axis"
msgstr "è½´"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Button Index:"
-msgstr "手柄按钮"
+msgstr "手柄按钮:"
#: editor/project_settings.cpp
msgid "Add Input Action"
@@ -5377,6 +5741,11 @@ msgstr "添加输入动作"
msgid "Erase Input Action Event"
msgstr "移除输入事件"
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "添加空白帧"
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "设备"
@@ -5387,23 +5756,23 @@ msgstr "按钮"
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Left Button."
-msgstr "左键"
+msgstr "左键。"
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Right Button."
-msgstr "å³é”®"
+msgstr "å³é”®ã€‚"
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Middle Button."
-msgstr "中键(滚轮)"
+msgstr "中键(滚轮)。"
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Wheel Up."
-msgstr "滚轮å‘上滚动"
+msgstr "滚轮å‘上滚动。"
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Wheel Down."
-msgstr "滚轮å‘下滚动"
+msgstr "滚轮å‘下滚动。"
#: editor/project_settings.cpp
msgid "Error saving settings."
@@ -5442,7 +5811,8 @@ msgid "Remove Resource Remap Option"
msgstr "移除资æºé‡å®šå‘选项"
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+#, fuzzy
+msgid "Project Settings (project.godot)"
msgstr "项目设置(godot.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5507,16 +5877,11 @@ msgstr "地区"
#: editor/project_settings.cpp
msgid "AutoLoad"
-msgstr "AutoLoad"
-
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "æ’ä»¶"
+msgstr "自动加载(AutoLoad)"
#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Viewport"
-msgstr "1个视å£"
+msgstr "选择1个视å£"
#: editor/property_editor.cpp
msgid "Ease In"
@@ -5548,33 +5913,27 @@ msgstr "目录.."
#: editor/property_editor.cpp
msgid "Assign"
-msgstr ""
+msgstr "分é…(Assign)"
#: editor/property_editor.cpp
msgid "New Script"
msgstr "新建脚本"
#: editor/property_editor.cpp
-#, fuzzy
msgid "Show in File System"
-msgstr "文件系统"
+msgstr "在资æºç®¡ç†å™¨ä¸­å±•示"
#: editor/property_editor.cpp
msgid "Error loading file: Not a resource!"
msgstr "加载文件出错:䏿˜¯èµ„æºæ–‡ä»¶ï¼"
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr "无法加载图片"
-
-#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Node"
msgstr "选择一个节点"
#: editor/property_editor.cpp
msgid "Bit %d, val %d."
-msgstr ""
+msgstr "(Bit)ä½ %d, val %d."
#: editor/property_editor.cpp
msgid "On"
@@ -5614,7 +5973,7 @@ msgstr "é‡è®¾çˆ¶èŠ‚ç‚¹"
#: editor/reparent_dialog.cpp
msgid "Reparent Location (Select new Parent):"
-msgstr "é‡è®¾ä½ç½®ï¼ˆé€‰æ‹©çˆ¶èŠ‚ç‚¹ï¼‰"
+msgstr "é‡è®¾ä½ç½®ï¼ˆé€‰æ‹©çˆ¶èŠ‚ç‚¹ï¼‰:"
#: editor/reparent_dialog.cpp
msgid "Keep Global Transform"
@@ -5642,7 +6001,7 @@ msgstr "资æºå·¥å…·"
#: editor/resources_dock.cpp
msgid "Make Local"
-msgstr ""
+msgstr "使用本地"
#: editor/run_settings_dialog.cpp
msgid "Run Mode:"
@@ -5670,7 +6029,7 @@ msgstr "æ²¡æœ‰é€‰ä¸­èŠ‚ç‚¹æ¥æ·»åŠ å®žä¾‹ã€‚"
#: editor/scene_tree_dock.cpp
msgid "Error loading scene from %s"
-msgstr "从%s加载场景出错ï¼"
+msgstr "从%s加载场景出错"
#: editor/scene_tree_dock.cpp
msgid "Ok"
@@ -5712,7 +6071,7 @@ msgstr "æ­¤æ“ä½œå¿…é¡»åœ¨æ‰“å¼€ä¸€ä¸ªåœºæ™¯åŽæ‰èƒ½æ‰§è¡Œã€‚"
#: editor/scene_tree_dock.cpp
msgid "Can not perform with the root node."
-msgstr ""
+msgstr "无法对根节点执行此æ“作。"
#: editor/scene_tree_dock.cpp
msgid "This operation can't be done on instanced scenes."
@@ -5753,6 +6112,11 @@ msgid "Error duplicating scene to save it."
msgstr "å¤åˆ¶åœºæ™¯å‡ºé”™ã€‚"
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "资æº:"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr "编辑分组"
@@ -5793,9 +6157,8 @@ msgid "Save Branch as Scene"
msgstr "将分支ä¿å­˜ä¸ºåœºæ™¯"
#: editor/scene_tree_dock.cpp
-#, fuzzy
msgid "Copy Node Path"
-msgstr "æ‹·è´è·¯å¾„"
+msgstr "æ‹·è´èŠ‚ç‚¹è·¯å¾„"
#: editor/scene_tree_dock.cpp
msgid "Delete (No Confirm)"
@@ -5813,11 +6176,11 @@ msgstr "实例化场景文件为一个节点,如果没有根节点则创建一
#: editor/scene_tree_dock.cpp
msgid "Attach a new or existing script for the selected node."
-msgstr "为选中节点创建或设置脚本"
+msgstr "为选中节点创建或设置脚本。"
#: editor/scene_tree_dock.cpp
msgid "Clear a script for the selected node."
-msgstr "清除选中节点的脚本"
+msgstr "清除选中节点的脚本。"
#: editor/scene_tree_editor.cpp
msgid "Toggle Spatial Visible"
@@ -5828,10 +6191,59 @@ msgid "Toggle CanvasItem Visible"
msgstr "切æ¢CanvasItemå¯è§"
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "调试选项"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr "实例:"
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "下一个脚本"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Toggle Visibility"
+msgstr "切æ¢Spatialå¯è§"
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr "节点åç§°éžæ³•,ä¸å…许包å«ä»¥ä¸‹å­—符:"
@@ -5853,7 +6265,7 @@ msgstr "加载为å ä½ç¬¦"
#: editor/scene_tree_editor.cpp
msgid "Discard Instancing"
-msgstr ""
+msgstr "废弃实例化"
#: editor/scene_tree_editor.cpp
msgid "Open in Editor"
@@ -5865,7 +6277,7 @@ msgstr "清除继承"
#: editor/scene_tree_editor.cpp
msgid "Clear Inheritance? (No Undo!)"
-msgstr "ç¡®å®šè¦æ¸…除继承å—(无法撤销ï¼ï¼‰ï¼Ÿ"
+msgstr "ç¡®å®šè¦æ¸…除继承å—?(无法撤销ï¼ï¼‰"
#: editor/scene_tree_editor.cpp
msgid "Clear!"
@@ -5876,75 +6288,93 @@ msgid "Select a Node"
msgstr "选择一个节点"
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr "基类åç§°éžæ³•"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "无法创建脚本。"
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr "åˆæ³•的字符:"
+msgid "Error loading script from %s"
+msgstr "从%s加载脚本出错"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
-msgstr "ç±»åéžæ³•"
+msgid "Path is empty"
+msgstr "文件路径为空"
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "åç§°å¯ç”¨"
+msgid "Path is not local"
+msgstr "必须是项目路径"
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "N/A"
+msgid "Invalid base path"
+msgstr "çˆ¶è·¯å¾„éžæ³•"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
-msgstr "ç±»åéžæ³•"
+msgid "Invalid extension"
+msgstr "扩展åéžæ³•"
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr "基类åç§°éžæ³•"
+msgid "Wrong extension chosen"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
-msgstr "è·¯å¾„éžæ³•ï¼"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "è·¯å¾„éžæ³•。"
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
-msgstr "无法创建脚本。"
+msgid "Invalid class name"
+msgstr "ç±»åéžæ³•"
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
-msgstr "从%s加载脚本出错ï¼"
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "属性åç§°éžæ³•。"
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "文件路径为空"
+#, fuzzy
+msgid "Script valid"
+msgstr "脚本"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
-msgstr "必须是项目路径"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr "çˆ¶è·¯å¾„éžæ³•"
+msgid "N/A"
+msgstr "N/A"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "扩展åéžæ³•"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+#, fuzzy
+msgid "Create new script file"
msgstr "创建新脚本"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+#, fuzzy
+msgid "Load existing script file"
msgstr "加载现有脚本"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+#, fuzzy
+msgid "Inherits"
+msgstr "基类:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
msgstr "ç±»å:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "移除模æ¿"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
msgstr "内置脚本"
#: editor/script_create_dialog.cpp
@@ -5957,7 +6387,7 @@ msgstr "字节:"
#: editor/script_editor_debugger.cpp
msgid "Warning"
-msgstr "警告:"
+msgstr "警告"
#: editor/script_editor_debugger.cpp
msgid "Error:"
@@ -5989,7 +6419,7 @@ msgstr "编辑下一个实例"
#: editor/script_editor_debugger.cpp
msgid "Stack Frames"
-msgstr ""
+msgstr "堆栈帧(Frames)"
#: editor/script_editor_debugger.cpp
msgid "Variable"
@@ -6116,9 +6546,12 @@ msgid "Change Notifier Extents"
msgstr "更改通知器级别"
#: editor/spatial_editor_gizmos.cpp
-#, fuzzy
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
-msgstr "更改通知器级别"
+msgstr "更改探针(Probe)范围"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6387,7 +6820,7 @@ msgstr "迭代器失效: "
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Invalid index property name."
-msgstr "属性åç§°éžæ³•"
+msgstr "属性åç§°éžæ³•。"
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Base object is not a Node!"
@@ -6395,11 +6828,11 @@ msgstr "åŸºç¡€å¯¹è±¡ä¸æ˜¯ä¸€ä¸ªèŠ‚ç‚¹ï¼"
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Path does not lead Node!"
-msgstr "路径必须指å‘节点"
+msgstr "路径必须指å‘节点ï¼"
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Invalid index property name '%s' in node %s."
-msgstr "节点%sçš„'%s'为无效索引属性å。"
+msgstr "节点 '%s' çš„ '%s' 为无效索引属性å。"
#: modules/visual_script/visual_script_nodes.cpp
msgid ": Invalid argument of type: "
@@ -6435,6 +6868,26 @@ msgstr "正好按下"
msgid "just released"
msgstr "刚好释放"
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr "在æµè§ˆå™¨ä¸­è¿è¡Œ"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr "使用默认æµè§ˆå™¨æ‰“开导出的HTML文件."
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr "无法写入文件:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr "æ— æ³•è¯»å–æ–‡ä»¶:\n"
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr "无法打开导出模æ¿ï¼š\n"
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6458,15 +6911,15 @@ msgstr ""
#: platform/uwp/export/export.cpp
msgid "Custom debug package not found."
-msgstr ""
+msgstr "找ä¸åˆ°è‡ªå®šä¹‰è°ƒè¯•包。"
#: platform/uwp/export/export.cpp
msgid "Custom release package not found."
-msgstr ""
+msgstr "找ä¸åˆ°è‡ªå®šä¹‰å‘布包。"
#: platform/uwp/export/export.cpp
msgid "Invalid unique name."
-msgstr "åç§°éžæ³•:"
+msgstr "åç§°éžæ³•。"
#: platform/uwp/export/export.cpp
msgid "Invalid product GUID."
@@ -6474,7 +6927,7 @@ msgstr "产å“GUIDéžæ³•。"
#: platform/uwp/export/export.cpp
msgid "Invalid publisher GUID."
-msgstr "å‘布GUIDéžæ³•"
+msgstr "å‘布GUIDéžæ³•。"
#: platform/uwp/export/export.cpp
msgid "Invalid background color."
@@ -6486,27 +6939,27 @@ msgstr "Logo图片尺寸无效(图åƒå°ºå¯¸å¿…须是50x50)。"
#: platform/uwp/export/export.cpp
msgid "Invalid square 44x44 logo image dimensions (should be 44x44)."
-msgstr ""
+msgstr "正方形的 44x44 Logo图片尺寸无效(应为44x44)。"
#: platform/uwp/export/export.cpp
msgid "Invalid square 71x71 logo image dimensions (should be 71x71)."
-msgstr ""
+msgstr "正方形的 71x71 Logo标志图片尺寸无效(应为71x71)。"
#: platform/uwp/export/export.cpp
msgid "Invalid square 150x150 logo image dimensions (should be 150x150)."
-msgstr ""
+msgstr "正方的 150x150 Logo图片尺寸无效(应为150x150)。"
#: platform/uwp/export/export.cpp
msgid "Invalid square 310x310 logo image dimensions (should be 310x310)."
-msgstr ""
+msgstr "正方形的 310x310 Logo图片尺寸无效(应为310x310)。"
#: platform/uwp/export/export.cpp
msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)."
-msgstr ""
+msgstr "宽幅310x150 Logo图片尺寸无效(应为310x150)。"
#: platform/uwp/export/export.cpp
msgid "Invalid splash screen image dimensions (should be 620x300)."
-msgstr ""
+msgstr "å¯åŠ¨ç”»é¢å›¾ç‰‡å°ºå¯¸æ— æ•ˆï¼ˆåº”为620x300)。"
#: scene/2d/animated_sprite.cpp
msgid ""
@@ -6588,9 +7041,11 @@ msgid ""
msgstr ""
"ParallaxLayer类型的节点必须作为ParallaxBackgroundçš„å­èŠ‚ç‚¹æ‰èƒ½æ­£å¸¸å·¥ä½œã€‚"
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
-msgstr "path属性必须指å‘ä¸€ä¸ªåˆæ³•çš„Particles2D节点æ‰èƒ½æ­£å¸¸å·¥ä½œã€‚"
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6662,6 +7117,11 @@ msgid ""
msgstr ""
"NavigationMeshInstance类型节点必须作为Navigation节点的å­å­™æ‰èƒ½æä¾›å¯¼èˆªæ•°æ®ã€‚"
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr "path属性必须指å‘ä¸€ä¸ªåˆæ³•çš„Spatial节点æ‰èƒ½æ­£å¸¸å·¥ä½œã€‚"
@@ -6679,6 +7139,15 @@ msgstr ""
"SpriteFrame资æºå¿…须是通过AnimatedSprite3D节点的Frames属性创建的,å¦åˆ™æ— æ³•显示"
"动画帧。"
+#: scene/gui/color_picker.cpp
+#, fuzzy
+msgid "RAW Mode"
+msgstr "è¿è¡Œæ¨¡å¼:"
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "æç¤ºï¼"
@@ -6722,6 +7191,15 @@ msgid ""
"Use a container as child (VBox,HBox,etc), or a Control and set the custom "
"minimum size manually."
msgstr ""
+"ScrollContainer旨在与å•ä¸ªå­æŽ§ä»¶é…åˆä½¿ç”¨ã€‚\n"
+"使用Container(VBox,HBoxç­‰ï¼‰ä½œä¸ºå…¶å­æŽ§ä»¶å¹¶æ‰‹åŠ¨æˆ–è®¾ç½®Control的自定义最å°å°º"
+"寸。"
+
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
#: scene/main/viewport.cpp
msgid ""
@@ -6734,6 +7212,72 @@ msgstr ""
"使其æˆä¸ºå­æŽ§ä»¶çš„æ‰€ä»¥å®ƒå¯ä»¥æœ‰ä¸€ä¸ªå°ºå¯¸å¤§å°å€¼ã€‚å¦åˆ™è¯·è®¾ç½®ä¸ºRender target,并将其"
"内部纹ç†åˆ†é…给一些节点以显示。"
+#~ msgid "Node From Scene"
+#~ msgstr "从场景导入节点"
+
+#~ msgid "Import assets to the project."
+#~ msgstr "导入资æºã€‚"
+
+#~ msgid "Export the project to many platforms."
+#~ msgstr "导出项目到多个平å°ã€‚"
+
+#~ msgid "Alerts when an external resource has changed."
+#~ msgstr "å¤–éƒ¨èµ„æºæ”¹å˜åŽå¼¹å‡ºæç¤ºã€‚"
+
+#~ msgid "Tutorials"
+#~ msgstr "教程"
+
+#~ msgid "Open https://godotengine.org at tutorials section."
+#~ msgstr "打开 https://godotengine.org 中的教程."
+
+#~ msgid "No scene selected to instance!"
+#~ msgstr "没有选用è¦å®žä¾‹åŒ–的场景ï¼"
+
+#~ msgid "Instance at Cursor"
+#~ msgstr "光标处实例"
+
+#~ msgid "Could not instance scene!"
+#~ msgstr "无法实例化场景ï¼"
+
+#~ msgid "Use Default Light"
+#~ msgstr "使用默认光照"
+
+#~ msgid "Use Default sRGB"
+#~ msgstr "使用默认sRGB"
+
+#~ msgid "Default Light Normal:"
+#~ msgstr "默认光照法线:"
+
+#~ msgid "Ambient Light Color:"
+#~ msgstr "环境光颜色:"
+
+#~ msgid "Couldn't load image"
+#~ msgstr "无法加载图片"
+
+#~ msgid "Invalid parent class name"
+#~ msgstr "基类åç§°éžæ³•"
+
+#~ msgid "Valid chars:"
+#~ msgstr "åˆæ³•的字符:"
+
+#~ msgid "Valid name"
+#~ msgstr "åç§°å¯ç”¨"
+
+#~ msgid "Class name is invalid!"
+#~ msgstr "ç±»åéžæ³•!"
+
+#~ msgid "Parent class name is invalid!"
+#~ msgstr "基类åç§°éžæ³•!"
+
+#~ msgid "Invalid path!"
+#~ msgstr "è·¯å¾„éžæ³•ï¼"
+
+#~ msgid "Path property must point to a valid Particles2D node to work."
+#~ msgstr "path属性必须指å‘ä¸€ä¸ªåˆæ³•çš„Particles2D节点æ‰èƒ½æ­£å¸¸å·¥ä½œã€‚"
+
+#~ msgid "Surface"
+#~ msgstr "表é¢"
+
#~ msgid ""
#~ "A SampleLibrary resource must be created or set in the 'samples' property "
#~ "in order for SamplePlayer to play sound."
@@ -6749,7 +7293,7 @@ msgstr ""
#~ "æ‰èƒ½æ­£å¸¸æ’­æ”¾å£°éŸ³ã€‚"
#~ msgid "Replaced %d Ocurrence(s)."
-#~ msgstr "替æ¢äº†%d项"
+#~ msgstr "替æ¢äº†%d项。"
#~ msgid "Please save the scene first."
#~ msgstr "请先ä¿å­˜åœºæ™¯ã€‚"
@@ -6758,7 +7302,7 @@ msgstr ""
#~ msgstr "ä¿å­˜å¯ç¿»è¯‘字符串"
#~ msgid "Translatable Strings.."
-#~ msgstr "å¯ç¿»è¯‘字符串"
+#~ msgstr "å¯ç¿»è¯‘字符串.."
#~ msgid "Install Export Templates"
#~ msgstr "安装导出模æ¿"
@@ -6778,33 +7322,51 @@ msgstr ""
#~ msgid "No exporter for platform '%s' yet."
#~ msgstr "没有针对'%s'å¹³å°çš„导出模æ¿ã€‚"
-#, fuzzy
#~ msgid "Create Android keystore"
-#~ msgstr "创建资æº"
+#~ msgstr "创建 Android 的密钥库"
-#, fuzzy
#~ msgid "Full name"
-#~ msgstr "åç§°å¯ç”¨"
+#~ msgstr "å…¨å"
+
+#~ msgid "Organizational unit"
+#~ msgstr "组织å•å…ƒ"
-#, fuzzy
#~ msgid "Organization"
-#~ msgstr "过渡"
+#~ msgstr "组织"
+
+#~ msgid "City"
+#~ msgstr "城市(City)"
-#, fuzzy
#~ msgid "State"
-#~ msgstr "状æ€"
+#~ msgstr "å·ž(State)"
+
+#~ msgid "2 letter country code"
+#~ msgstr "2个字æ¯çš„国家代ç "
+
+#~ msgid "User alias"
+#~ msgstr "用户别å"
-#, fuzzy
#~ msgid "Password"
#~ msgstr "密ç "
-#, fuzzy
#~ msgid "at least 6 characters"
-#~ msgstr "å­—ç¬¦åˆæ³•:"
+#~ msgstr "至少6个字符"
-#, fuzzy
#~ msgid "File name"
-#~ msgstr "æ–°åç§°:"
+#~ msgstr "文件å"
+
+#~ msgid "Path : (better to save outside of project)"
+#~ msgstr "路径:(更好的ä¿å­˜é¡¹ç›®å¤–)"
+
+#~ msgid ""
+#~ "Release keystore is not set.\n"
+#~ "Do you want to create one?"
+#~ msgstr ""
+#~ "未设置å‘布密钥库。\n"
+#~ "您è¦åˆ›å»ºä¸€ä¸ªå—?"
+
+#~ msgid "Fill Keystore/Release User and Release Password"
+#~ msgstr "填写密钥库/å‘布用户和å‘布密ç "
#~ msgid "Include"
#~ msgstr "包å«"
@@ -6840,7 +7402,7 @@ msgstr ""
#~ msgstr "导出到平å°"
#~ msgid "Export all files in the project directory."
-#~ msgstr "导出项目目录下的所有文件"
+#~ msgstr "导出项目目录下的所有文件。"
#~ msgid "Action"
#~ msgstr "动作"
@@ -6864,7 +7426,7 @@ msgstr ""
#~ msgstr "转æ¢å›¾ç‰‡(*.png):"
#~ msgid "Compress for Disk (Lossy) Quality:"
-#~ msgstr "高质é‡ï¼ˆæœ‰æŸï¼‰èŠ‚çœç£ç›˜ç©ºé—´"
+#~ msgstr "高质é‡ï¼ˆæœ‰æŸï¼‰èŠ‚çœç£ç›˜ç©ºé—´:"
#~ msgid "Shrink All Images:"
#~ msgstr "收缩所有图片:"
@@ -6897,13 +7459,13 @@ msgstr ""
#~ msgstr "收缩方å¼:"
#~ msgid "Preview Atlas"
-#~ msgstr "ç²¾çµé›†é¢„览:"
+#~ msgstr "ç²¾çµé›†é¢„览"
#~ msgid "Image Filter:"
-#~ msgstr "纹ç†è¿‡æ»¤:\t\t"
+#~ msgstr "纹ç†è¿‡æ»¤:"
#~ msgid "Images:"
-#~ msgstr "图片"
+#~ msgstr "图片:"
#~ msgid "Select None"
#~ msgstr "å–æ¶ˆé€‰æ‹©"
@@ -6929,8 +7491,8 @@ msgstr ""
#~ msgid "Trim"
#~ msgstr "修剪"
-#~ msgid "Script"
-#~ msgstr "脚本"
+#~ msgid "Trailing Silence:"
+#~ msgstr "å°¾éšæ²‰é»˜(Trailing Silence):"
#~ msgid "Script Export Mode:"
#~ msgstr "脚本导出方å¼:"
@@ -6945,7 +7507,7 @@ msgstr ""
#~ msgstr "使用下列密ç åР坆"
#~ msgid "Script Encryption Key (256-bits as hex):"
-#~ msgstr "脚本密匙(256ä½16进制ç ï¼‰"
+#~ msgstr "脚本密匙(256ä½16进制ç ï¼‰:"
#~ msgid "Export PCK/Zip"
#~ msgstr "导出 PCK/ZIP"
@@ -6960,14 +7522,11 @@ msgstr ""
#~ msgstr "项目导出"
#~ msgid "Export Preset:"
-#~ msgstr "导出预设"
+#~ msgstr "导出预设:"
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance未包å«BakedLight资æºã€‚"
-#~ msgid "Vertex"
-#~ msgstr "顶点"
-
#~ msgid "Fragment"
#~ msgstr "片段"
@@ -6997,9 +7556,6 @@ msgstr ""
#~ msgid "Cannot go into subdir:"
#~ msgstr "无法打开目录:"
-#~ msgid "Help"
-#~ msgstr "帮助"
-
#~ msgid "Imported Resources"
#~ msgstr "已导入的资æº"
diff --git a/editor/translations/zh_HK.po b/editor/translations/zh_HK.po
index bc02a0a593..110f5b6fab 100644
--- a/editor/translations/zh_HK.po
+++ b/editor/translations/zh_HK.po
@@ -1,4 +1,4 @@
-# Chinese (Honk Kong) translation of the Godot Engine editor
+# Chinese (Hong Kong) translation of the Godot Engine editor
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
@@ -359,6 +359,180 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "檔案"
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr "關閉"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "連到..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect to host:"
+msgstr "連到"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "連到..."
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Requesting.."
+msgstr "測試"
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "載入字形出ç¾éŒ¯èª¤"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "全部"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
@@ -366,6 +540,30 @@ msgstr ""
msgid "Search:"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "æœå°‹"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr "å°Žå…¥"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
+msgstr "æ’ä»¶"
+
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
msgstr ""
@@ -379,10 +577,6 @@ msgid "Category:"
msgstr "分類:"
#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr "全部"
-
-#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
msgstr "地å€:"
@@ -394,7 +588,7 @@ msgstr ""
msgid "Official"
msgstr "官方"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "社群"
@@ -414,20 +608,6 @@ msgstr ""
msgid "Call"
msgstr ""
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr "關閉"
-
#: editor/call_dialog.cpp
msgid "Method List:"
msgstr ""
@@ -477,13 +657,6 @@ msgid "Selection Only"
msgstr "åªé™é¸ä¸­"
#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr "æœå°‹"
-
-#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
msgstr "查找"
@@ -560,6 +733,7 @@ msgstr "添加"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "移除"
@@ -636,11 +810,6 @@ msgstr "最近:"
msgid "Matches:"
msgstr "å»åˆ"
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
-
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
msgstr ""
@@ -671,6 +840,7 @@ msgstr "資æº"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "路徑"
@@ -771,8 +941,7 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
msgstr ""
@@ -782,6 +951,7 @@ msgid "Save As"
msgstr "å¦å­˜ç‚º"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
msgstr "é è¨­"
@@ -852,8 +1022,7 @@ msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "路徑:"
@@ -919,7 +1088,7 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
@@ -1047,7 +1216,8 @@ msgstr ""
msgid "(Re)Importing Assets"
msgstr "導入中:"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1064,7 +1234,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1119,10 +1288,6 @@ msgstr ""
msgid "Clear"
msgstr "清空"
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
-
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
msgid "Error saving resource!"
@@ -1241,8 +1406,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1296,6 +1461,10 @@ msgid "Save Scene As.."
msgstr "把場景å¦å­˜ç‚º"
#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
msgstr ""
@@ -1352,7 +1521,7 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
msgstr ""
@@ -1390,6 +1559,10 @@ msgstr ""
msgid "%d more file(s) or folder(s)"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Scene"
msgstr "場景"
@@ -1443,7 +1616,7 @@ msgstr "關閉場景"
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
msgstr "開啓最近的"
@@ -1471,98 +1644,39 @@ msgid "Redo"
msgstr "é‡è£½"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "é‹è¡Œè…³æœ¬"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
-
-#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Import assets to the project."
+msgid "Project"
msgstr ""
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
-msgstr "å°Žå…¥"
-
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
+msgid "Project Settings"
msgstr ""
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr "工具"
-
-#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
-msgstr ""
+msgid "Run Script"
+msgstr "é‹è¡Œè…³æœ¬"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr "æš«åœå ´æ™¯"
-
-#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr "é‹è¡Œä¿®æ”¹çš„場景"
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr "é‹è¡Œå ´æ™¯"
+msgid "Tools"
+msgstr "工具"
#: editor/editor_node.cpp
-msgid "Play custom scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Play Custom Scene"
-msgstr "é‹è¡Œå ´æ™¯"
-
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1633,9 +1747,10 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
-msgstr "設定"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Editor"
+msgstr "編輯"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1654,14 +1769,71 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+#, fuzzy
+msgid "Online Docs"
+msgstr "關閉場景"
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr "關於"
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "æš«åœå ´æ™¯"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr "é‹è¡Œä¿®æ”¹çš„場景"
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr "é‹è¡Œå ´æ™¯"
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
msgstr ""
#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr "é‹è¡Œå ´æ™¯"
+
+#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
msgstr ""
@@ -1742,6 +1914,14 @@ msgid "Thanks!"
msgstr "多è¬!"
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1769,12 +1949,35 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 2D Editor"
+msgstr "開啟資料夾"
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open 3D Editor"
+msgstr "開啟資料夾"
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "è¦é›¢é–‹ç·¨è¼¯å™¨å—Ž?"
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2019,6 +2222,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2047,10 +2254,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2219,7 +2422,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2694,7 +2897,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3354,7 +3557,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr "OK"
@@ -3403,15 +3606,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3442,6 +3636,33 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Add point"
+msgstr "新增訊號"
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "åªé™é¸ä¸­"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3711,6 +3932,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3723,7 +3957,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3734,6 +3968,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3743,6 +3994,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3755,11 +4010,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3771,26 +4026,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3845,6 +4116,15 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+#, fuzzy
+msgid "Remove Out-Control Point"
+msgstr "åªé™é¸ä¸­"
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3998,6 +4278,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4087,10 +4371,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4124,15 +4404,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4188,6 +4460,23 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "轉為..."
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4238,6 +4527,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4259,6 +4556,16 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "轉為..."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "轉為..."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4281,6 +4588,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4498,35 +4809,99 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Down"
+msgstr "下滾"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "當改變時更新"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Shader Changes"
+msgstr "當改變時更新"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Surface Changes"
+msgstr "當改變時更新"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Information"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "Audio Listener"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4587,23 +4962,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "所有é¸é …"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Local Coords"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4631,22 +5015,6 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
msgstr ""
@@ -4655,6 +5023,10 @@ msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "設定"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr ""
@@ -4675,14 +5047,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5100,11 +5464,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5116,7 +5480,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5152,10 +5516,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr "ç€è¦½"
@@ -5214,6 +5574,11 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Templates"
+msgstr "移除é¸é …"
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr "離開"
@@ -5333,6 +5698,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "設備"
@@ -5398,7 +5767,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5465,10 +5834,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr "æ’ä»¶"
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5519,10 +5884,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
#, fuzzy
msgid "Pick a Node"
msgstr "貼上"
@@ -5710,6 +6071,11 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "資æº"
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5787,10 +6153,57 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Subscene options"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "下一個腳本"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5835,82 +6248,95 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
-msgstr ""
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "無法新增資料夾"
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
-msgstr ""
+#, fuzzy
+msgid "Error loading script from %s"
+msgstr "載入字形出ç¾éŒ¯èª¤"
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is empty"
+msgstr "路徑為空"
+
+#: editor/script_create_dialog.cpp
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
-msgstr "有效å稱"
+msgid "Invalid base path"
+msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
-msgstr "N/A"
+msgid "Invalid extension"
+msgstr "無效副檔å"
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
-msgstr ""
+#, fuzzy
+msgid "Invalid Path"
+msgstr "有效的路徑"
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Invalid inherited parent name or path"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Error loading script from %s"
-msgstr "載入字形出ç¾éŒ¯èª¤"
-
-#: editor/script_create_dialog.cpp
-msgid "Path is empty"
-msgstr "路徑為空"
+msgid "Script valid"
+msgstr "腳本"
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
-msgstr ""
+msgid "N/A"
+msgstr "N/A"
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
-msgstr "無效副檔å"
+msgid "Built-in script (into scene file)"
+msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Create new script"
+msgid "Create new script file"
msgstr "新增"
#: editor/script_create_dialog.cpp
#, fuzzy
-msgid "Load existing script"
+msgid "Load existing script file"
msgstr "下一個腳本"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Class Name"
msgstr ""
#: editor/script_create_dialog.cpp
#, fuzzy
+msgid "Template"
+msgstr "移除é¸é …"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Built-in Script"
+msgstr "é‹è¡Œè…³æœ¬"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
msgid "Attach Node Script"
msgstr "下一個腳本"
@@ -6080,6 +6506,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
msgstr ""
@@ -6406,6 +6836,30 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Run in Browser"
+msgstr "ç€è¦½"
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not write file:\n"
+msgstr "無法新增資料夾"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not read file:\n"
+msgstr "無法新增資料夾"
+
+#: platform/javascript/export/export.cpp
+#, fuzzy
+msgid "Could not open template for export:\n"
+msgstr "無法新增資料夾"
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6547,8 +7001,10 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
#: scene/2d/path_2d.cpp
@@ -6611,6 +7067,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6626,6 +7087,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "警告!"
@@ -6668,6 +7137,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
@@ -6676,6 +7151,9 @@ msgid ""
"texture to some node for display."
msgstr ""
+#~ msgid "Valid name"
+#~ msgstr "有效å稱"
+
#~ msgid "Please save the scene first."
#~ msgstr "請先儲存場景"
@@ -6730,9 +7208,6 @@ msgstr ""
#~ msgid "Keep"
#~ msgstr "ä¿ç•™"
-#~ msgid "Script"
-#~ msgstr "腳本"
-
#~ msgid "Text"
#~ msgstr "文字"
diff --git a/editor/translations/zh_TW.po b/editor/translations/zh_TW.po
index 17e37bdfe2..c5a1f6994c 100644
--- a/editor/translations/zh_TW.po
+++ b/editor/translations/zh_TW.po
@@ -2,29 +2,30 @@
# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community
# This file is distributed under the same license as the Godot source code.
#
+# Allen H <w84miracle@gmail.com>, 2017.
# popcade <popcade@gmail.com>, 2016.
# Sam Pan <sampan66@gmail.com>, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2016-10-23 19:47+0000\n"
-"Last-Translator: Sam Pan <sampan66@gmail.com>\n"
-"Language-Team: Chinese (Taiwan) <https://hosted.weblate.org/projects/godot-"
-"engine/godot/zh_TW/>\n"
+"PO-Revision-Date: 2017-05-12 07:06+0000\n"
+"Last-Translator: Allen H. <w84miracle@gmail.com>\n"
+"Language-Team: Chinese (Traditional) <https://hosted.weblate.org/projects/"
+"godot-engine/godot/zh_Hant/>\n"
"Language: zh_TW\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.9-dev\n"
+"X-Generator: Weblate 2.14-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
-msgstr ""
+msgstr "å·²åœç”¨"
#: editor/animation_editor.cpp
msgid "All Selection"
-msgstr ""
+msgstr "æ‰€æœ‰çš„é¸æ“‡"
#: editor/animation_editor.cpp
msgid "Move Add Key"
@@ -88,11 +89,11 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
-msgstr ""
+msgstr "編輯節點曲線"
#: editor/animation_editor.cpp
msgid "Edit Selection Curve"
-msgstr ""
+msgstr "ç·¨è¼¯æ‰€é¸æ›²ç·š"
#: editor/animation_editor.cpp
msgid "Anim Delete Keys"
@@ -100,7 +101,7 @@ msgstr ""
#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
msgid "Duplicate Selection"
-msgstr ""
+msgstr "複製所é¸"
#: editor/animation_editor.cpp
msgid "Duplicate Transposed"
@@ -108,7 +109,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Remove Selection"
-msgstr ""
+msgstr "移除所é¸"
#: editor/animation_editor.cpp
msgid "Continuous"
@@ -120,7 +121,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Trigger"
-msgstr ""
+msgstr "觸發器"
#: editor/animation_editor.cpp
msgid "Anim Add Key"
@@ -140,15 +141,15 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Goto Next Step"
-msgstr ""
+msgstr "往下一步"
#: editor/animation_editor.cpp
msgid "Goto Prev Step"
-msgstr ""
+msgstr "往上一步"
#: editor/animation_editor.cpp editor/property_editor.cpp
msgid "Linear"
-msgstr ""
+msgstr "線性"
#: editor/animation_editor.cpp editor/plugins/theme_editor_plugin.cpp
msgid "Constant"
@@ -176,7 +177,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Optimize Animation"
-msgstr ""
+msgstr "最佳化動畫"
#: editor/animation_editor.cpp
msgid "Clean-Up Animation"
@@ -198,7 +199,7 @@ msgstr ""
#: editor/plugins/particles_editor_plugin.cpp editor/project_manager.cpp
#: editor/script_create_dialog.cpp
msgid "Create"
-msgstr ""
+msgstr "新增"
#: editor/animation_editor.cpp
msgid "Anim Create & Insert"
@@ -246,11 +247,11 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Animation length (in seconds)."
-msgstr ""
+msgstr "動畫長度 (秒)"
#: editor/animation_editor.cpp
msgid "Step (s):"
-msgstr ""
+msgstr "步驟 :"
#: editor/animation_editor.cpp
msgid "Cursor step snap (in seconds)."
@@ -356,28 +357,220 @@ msgstr ""
msgid "Change Array Value"
msgstr ""
+#: editor/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "View Files"
+msgstr "éŽæ¿¾æª”案.."
+
+#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
+#: editor/editor_help.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr "æè¿°:"
+
+#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
+#: editor/connections_dialog.cpp editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sample_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
+#: editor/property_editor.cpp editor/run_settings_dialog.cpp
+#: editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Can't connect."
+msgstr "連接..."
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Req. Failed."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Connecting.."
+msgstr "連接..."
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
+msgid "Error making request"
+msgstr "載入場景時發生錯誤"
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp
+msgid "All"
+msgstr "全部"
+
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
#: editor/quick_open.cpp editor/settings_config_dialog.cpp
msgid "Search:"
+msgstr "æœå°‹:"
+
+#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
+msgid "Search"
+msgstr "æœå°‹"
+
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
+#: editor/io_plugins/editor_bitmask_import_plugin.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp
+#: editor/io_plugins/editor_mesh_import_plugin.cpp
+#: editor/io_plugins/editor_sample_import_plugin.cpp
+#: editor/io_plugins/editor_scene_import_plugin.cpp
+#: editor/io_plugins/editor_texture_import_plugin.cpp
+#: editor/io_plugins/editor_translation_import_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
+msgid "Plugins"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
-msgstr ""
+msgstr "排åº:"
#: editor/asset_library_editor_plugin.cpp
msgid "Reverse"
-msgstr ""
+msgstr "å轉"
#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
msgid "Category:"
-msgstr ""
-
-#: editor/asset_library_editor_plugin.cpp
-msgid "All"
-msgstr ""
+msgstr "類別:"
#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
@@ -389,9 +582,9 @@ msgstr ""
#: editor/asset_library_editor_plugin.cpp
msgid "Official"
-msgstr ""
+msgstr "官方"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr ""
@@ -411,59 +604,45 @@ msgstr ""
msgid "Call"
msgstr ""
-#: editor/call_dialog.cpp editor/connections_dialog.cpp
-#: editor/export_template_manager.cpp
-#: editor/plugins/animation_player_editor_plugin.cpp
-#: editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/plugins/resource_preloader_editor_plugin.cpp
-#: editor/plugins/sample_library_editor_plugin.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_settings.cpp
-#: editor/property_editor.cpp editor/run_settings_dialog.cpp
-#: editor/settings_config_dialog.cpp
-#: modules/visual_script/visual_script_editor.cpp
-msgid "Close"
-msgstr ""
-
#: editor/call_dialog.cpp
msgid "Method List:"
-msgstr ""
+msgstr "方法:"
#: editor/call_dialog.cpp
msgid "Arguments:"
-msgstr ""
+msgstr "è¼¸å…¥åƒæ•¸"
#: editor/call_dialog.cpp
msgid "Return:"
-msgstr ""
+msgstr "回傳值:"
#: editor/code_editor.cpp
msgid "Go to Line"
-msgstr ""
+msgstr "å‰å¾€ç¬¬...行"
#: editor/code_editor.cpp
msgid "Line Number:"
-msgstr ""
+msgstr "行號:"
#: editor/code_editor.cpp
msgid "No Matches"
-msgstr ""
+msgstr "ç„¡ç¬¦åˆæ¢ä»¶"
#: editor/code_editor.cpp
msgid "Replaced %d occurrence(s)."
-msgstr ""
+msgstr "å–代了 %d 個"
#: editor/code_editor.cpp
msgid "Replace"
-msgstr ""
+msgstr "å–代"
#: editor/code_editor.cpp
msgid "Replace All"
-msgstr ""
+msgstr "å–代全部"
#: editor/code_editor.cpp
msgid "Match Case"
-msgstr ""
+msgstr "符åˆå¤§å°å¯«"
#: editor/code_editor.cpp
msgid "Whole Words"
@@ -471,34 +650,27 @@ msgstr ""
#: editor/code_editor.cpp
msgid "Selection Only"
-msgstr ""
-
-#: editor/code_editor.cpp editor/editor_help.cpp
-#: editor/plugins/script_editor_plugin.cpp
-#: editor/plugins/script_text_editor.cpp
-#: editor/plugins/shader_editor_plugin.cpp editor/project_settings.cpp
-msgid "Search"
-msgstr ""
+msgstr "åƒ…é¸æ“‡å€åŸŸ"
#: editor/code_editor.cpp editor/editor_help.cpp
msgid "Find"
-msgstr ""
+msgstr "尋找"
#: editor/code_editor.cpp
msgid "Next"
-msgstr ""
+msgstr "下一個"
#: editor/code_editor.cpp
msgid "Not found!"
-msgstr ""
+msgstr "找ä¸åˆ°!"
#: editor/code_editor.cpp
msgid "Replace By"
-msgstr ""
+msgstr "用...å–代"
#: editor/code_editor.cpp
msgid "Case Sensitive"
-msgstr ""
+msgstr "å€åˆ†å¤§å°å¯«"
#: editor/code_editor.cpp
msgid "Backwards"
@@ -506,31 +678,31 @@ msgstr ""
#: editor/code_editor.cpp
msgid "Prompt On Replace"
-msgstr ""
+msgstr "æ¯æ¬¡å–代都è¦å…ˆè©¢å•我"
#: editor/code_editor.cpp
msgid "Skip"
-msgstr ""
+msgstr "è·³éŽ"
#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
msgid "Zoom In"
-msgstr ""
+msgstr "放大"
#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
msgid "Zoom Out"
-msgstr ""
+msgstr "縮å°"
#: editor/code_editor.cpp
msgid "Reset Zoom"
-msgstr ""
+msgstr "é‡è¨­ç¸®æ”¾å¤§å°"
#: editor/code_editor.cpp editor/script_editor_debugger.cpp
msgid "Line:"
-msgstr ""
+msgstr "行:"
#: editor/code_editor.cpp
msgid "Col:"
-msgstr ""
+msgstr "列:"
#: editor/connections_dialog.cpp
msgid "Method in target Node must be specified!"
@@ -550,13 +722,14 @@ msgstr ""
#: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_settings.cpp
msgid "Add"
-msgstr ""
+msgstr "新增"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings.cpp
msgid "Remove"
-msgstr ""
+msgstr "移除"
#: editor/connections_dialog.cpp
msgid "Add Extra Call Argument:"
@@ -572,11 +745,12 @@ msgstr ""
#: editor/connections_dialog.cpp
msgid "Make Function"
-msgstr ""
+msgstr "建立函å¼"
#: editor/connections_dialog.cpp
+#, fuzzy
msgid "Deferred"
-msgstr ""
+msgstr "å»¶é²"
#: editor/connections_dialog.cpp
msgid "Oneshot"
@@ -600,12 +774,12 @@ msgstr ""
#: editor/connections_dialog.cpp
msgid "Connect.."
-msgstr ""
+msgstr "連接..."
#: editor/connections_dialog.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Disconnect"
-msgstr ""
+msgstr "æ–·ç·š"
#: editor/connections_dialog.cpp editor/node_dock.cpp
msgid "Signals"
@@ -613,27 +787,22 @@ msgstr ""
#: editor/create_dialog.cpp
msgid "Create New"
-msgstr ""
+msgstr "新增"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
#: editor/filesystem_dock.cpp
msgid "Favorites:"
-msgstr ""
+msgstr "我的最愛:"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
msgid "Recent:"
-msgstr ""
+msgstr "最近存å–:"
#: editor/create_dialog.cpp editor/editor_help.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
#: editor/quick_open.cpp
msgid "Matches:"
-msgstr ""
-
-#: editor/create_dialog.cpp editor/editor_help.cpp editor/property_selector.cpp
-#: editor/script_editor_debugger.cpp
-msgid "Description:"
-msgstr ""
+msgstr "ç¬¦åˆæ¢ä»¶:"
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
@@ -648,6 +817,8 @@ msgid ""
"Scene '%s' is currently being edited.\n"
"Changes will not take effect unless reloaded."
msgstr ""
+"場景 '%s' 已被變更\n"
+"釿–°è¼‰å…¥æ‰èƒ½ä½¿è®Šæ›´ç”Ÿæ•ˆ"
#: editor/dependency_editor.cpp
msgid ""
@@ -665,8 +836,9 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
+#: editor/script_create_dialog.cpp
msgid "Path"
-msgstr ""
+msgstr "路徑"
#: editor/dependency_editor.cpp
msgid "Dependencies:"
@@ -694,26 +866,29 @@ msgid ""
"work.\n"
"Remove them anyway? (no undo)"
msgstr ""
+"刪除這些檔案å¯èƒ½é€ æˆå…¶ä»–資æºç„¡æ³•正常é‹ä½œ\n"
+"此動作無法復原, 確定è¦åˆªé™¤å—Ž?"
#: editor/dependency_editor.cpp
msgid "Remove selected files from the project? (no undo)"
-msgstr ""
+msgstr "此動作無法復原, 確定è¦å¾žå°ˆæ¡ˆä¸­åˆªé™¤æ‰€é¸çš„æª”案?"
#: editor/dependency_editor.cpp
+#, fuzzy
msgid "Error loading:"
-msgstr ""
+msgstr "載入時發生錯誤:"
#: editor/dependency_editor.cpp
msgid "Scene failed to load due to missing dependencies:"
-msgstr ""
+msgstr "場景缺少了æŸäº›è³‡æºä»¥è‡³æ–¼ç„¡æ³•載入"
#: editor/dependency_editor.cpp editor/editor_node.cpp
msgid "Open Anyway"
-msgstr ""
+msgstr "強制開啟"
#: editor/dependency_editor.cpp
msgid "Which action should be taken?"
-msgstr ""
+msgstr "該執行什麼æ“作呢?"
#: editor/dependency_editor.cpp
msgid "Fix Dependencies"
@@ -725,11 +900,11 @@ msgstr ""
#: editor/dependency_editor.cpp
msgid "Permanently delete %d item(s)? (No undo!)"
-msgstr ""
+msgstr "ç¢ºå®šè¦æ°¸ä¹…刪除 %d 個物件 ? (無法復原)"
#: editor/dependency_editor.cpp
msgid "Owns"
-msgstr ""
+msgstr "æ“æœ‰"
#: editor/dependency_editor.cpp
msgid "Resources Without Explicit Ownership:"
@@ -741,13 +916,13 @@ msgstr ""
#: editor/dependency_editor.cpp
msgid "Delete selected files?"
-msgstr ""
+msgstr "ç¢ºå®šåˆªé™¤æ‰€é¸æ“‡çš„æª”案嗎?"
#: editor/dependency_editor.cpp editor/editor_node.cpp
#: editor/filesystem_dock.cpp editor/plugins/item_list_editor_plugin.cpp
#: editor/project_export.cpp editor/scene_tree_dock.cpp
msgid "Delete"
-msgstr ""
+msgstr "刪除"
#: editor/editor_audio_buses.cpp
msgid "Save Audio Bus Layout As.."
@@ -765,19 +940,19 @@ msgstr ""
msgid "Add Bus"
msgstr ""
-#: editor/editor_audio_buses.cpp editor/property_editor.cpp
-#: editor/script_create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/script_create_dialog.cpp
msgid "Load"
-msgstr ""
+msgstr "載入"
#: editor/editor_audio_buses.cpp
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Save As"
-msgstr ""
+msgstr "å¦å­˜æ–°æª”"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
-msgstr ""
+msgstr "é è¨­"
#: editor/editor_autoload_settings.cpp
msgid "Invalid name."
@@ -793,23 +968,23 @@ msgstr ""
#: editor/editor_autoload_settings.cpp
msgid "Invalid name. Must not collide with an existing buit-in type name."
-msgstr ""
+msgstr "å稱已存在, ä¸èƒ½è·Ÿå·²ç¶“存在的內建類別é‡è¤‡"
#: editor/editor_autoload_settings.cpp
msgid "Invalid name. Must not collide with an existing global constant name."
-msgstr ""
+msgstr "å稱已存在, ä¸èƒ½è·Ÿå·²ç¶“存在的全域變數å稱é‡è¤‡"
#: editor/editor_autoload_settings.cpp
msgid "Invalid Path."
-msgstr ""
+msgstr "無效的路徑"
#: editor/editor_autoload_settings.cpp
msgid "File does not exist."
-msgstr ""
+msgstr "檔案ä¸å­˜åœ¨"
#: editor/editor_autoload_settings.cpp
msgid "Not in resource path."
-msgstr ""
+msgstr "在資æºè·¯å¾‘中找ä¸åˆ°"
#: editor/editor_autoload_settings.cpp
msgid "Add AutoLoad"
@@ -837,27 +1012,26 @@ msgstr ""
#: editor/editor_autoload_settings.cpp
msgid "Enable"
-msgstr ""
+msgstr "啟用"
#: editor/editor_autoload_settings.cpp
msgid "Rearrange Autoloads"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
-msgstr ""
+msgstr "路徑:"
#: editor/editor_autoload_settings.cpp
msgid "Node Name:"
-msgstr ""
+msgstr "節點å稱:"
#: editor/editor_autoload_settings.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
#: editor/plugins/sample_library_editor_plugin.cpp editor/project_manager.cpp
msgid "Name"
-msgstr ""
+msgstr "å稱"
#: editor/editor_autoload_settings.cpp
msgid "Singleton"
@@ -865,43 +1039,44 @@ msgstr ""
#: editor/editor_autoload_settings.cpp
msgid "List:"
-msgstr ""
+msgstr "列表:"
#: editor/editor_data.cpp
+#, fuzzy
msgid "Updating Scene"
-msgstr ""
+msgstr "更新場景"
#: editor/editor_data.cpp
msgid "Storing local changes.."
-msgstr ""
+msgstr "正在儲存變更.."
#: editor/editor_data.cpp
msgid "Updating scene.."
-msgstr ""
+msgstr "更新場景中.."
#: editor/editor_dir_dialog.cpp
msgid "Choose a Directory"
-msgstr ""
+msgstr "鏿“‡è³‡æ–™å¤¾"
#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
#: scene/gui/file_dialog.cpp
msgid "Create Folder"
-msgstr ""
+msgstr "新增資料夾"
#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
#: editor/editor_plugin_settings.cpp editor/plugins/theme_editor_plugin.cpp
#: editor/project_export.cpp scene/gui/file_dialog.cpp
msgid "Name:"
-msgstr ""
+msgstr "å稱:"
#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
#: scene/gui/file_dialog.cpp
msgid "Could not create folder."
-msgstr ""
+msgstr "無法新增資料夾"
#: editor/editor_dir_dialog.cpp
msgid "Choose"
-msgstr ""
+msgstr "鏿“‡"
#: editor/editor_export.cpp
msgid "Storing File:"
@@ -911,17 +1086,17 @@ msgstr ""
msgid "Packing"
msgstr ""
-#: editor/editor_export.cpp
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
msgstr ""
#: editor/editor_export.cpp
msgid "Added:"
-msgstr ""
+msgstr "已新增:"
#: editor/editor_export.cpp
msgid "Removed:"
-msgstr ""
+msgstr "已刪除:"
#: editor/editor_export.cpp
msgid "Error saving atlas:"
@@ -941,7 +1116,7 @@ msgstr ""
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "File Exists, Overwrite?"
-msgstr ""
+msgstr "檔案已經存在, è¦è¦†å¯«å—Ž?"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "All Recognized"
@@ -949,19 +1124,19 @@ msgstr ""
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "All Files (*)"
-msgstr ""
+msgstr "所有類型檔案"
#: editor/editor_file_dialog.cpp editor/editor_help.cpp editor/editor_node.cpp
#: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp
#: editor/property_selector.cpp editor/quick_open.cpp scene/gui/file_dialog.cpp
msgid "Open"
-msgstr ""
+msgstr "開啟"
#: editor/editor_file_dialog.cpp editor/editor_node.cpp
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/script_editor_plugin.cpp scene/gui/file_dialog.cpp
msgid "Save"
-msgstr ""
+msgstr "儲存"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Save a File"
@@ -969,19 +1144,19 @@ msgstr ""
#: editor/editor_file_dialog.cpp
msgid "Go Back"
-msgstr ""
+msgstr "往後"
#: editor/editor_file_dialog.cpp
msgid "Go Forward"
-msgstr ""
+msgstr "å¾€å‰"
#: editor/editor_file_dialog.cpp
msgid "Go Up"
-msgstr ""
+msgstr "往上"
#: editor/editor_file_dialog.cpp
msgid "Refresh"
-msgstr ""
+msgstr "釿–°æ•´ç†"
#: editor/editor_file_dialog.cpp
msgid "Toggle Hidden Files"
@@ -1009,20 +1184,20 @@ msgstr ""
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Directories & Files:"
-msgstr ""
+msgstr "資料夾 & 檔案:"
#: editor/editor_file_dialog.cpp
msgid "Preview:"
-msgstr ""
+msgstr "é è¦½:"
#: editor/editor_file_dialog.cpp editor/script_editor_debugger.cpp
#: scene/gui/file_dialog.cpp
msgid "File:"
-msgstr ""
+msgstr "檔案:"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Filter:"
-msgstr ""
+msgstr "éŽæ¿¾å™¨:"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Must use a valid extension."
@@ -1034,9 +1209,10 @@ msgstr ""
#: editor/editor_file_system.cpp
msgid "(Re)Importing Assets"
-msgstr ""
+msgstr "(釿–°)載入素æ"
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
msgid "Search Help"
msgstr ""
@@ -1053,7 +1229,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1095,22 +1270,18 @@ msgstr ""
#: editor/editor_help.cpp
msgid "Search Text"
-msgstr ""
+msgstr "æœå°‹è©žå½™"
#: editor/editor_log.cpp
msgid " Output:"
-msgstr ""
+msgstr " 輸出:"
#: editor/editor_log.cpp editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/rich_text_editor_plugin.cpp editor/property_editor.cpp
#: editor/script_editor_debugger.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Clear"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Node From Scene"
-msgstr ""
+msgstr "清除"
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
@@ -1125,7 +1296,7 @@ msgstr ""
#: editor/editor_node.cpp editor/export_template_manager.cpp
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "I see.."
-msgstr ""
+msgstr "我知é“了"
#: editor/editor_node.cpp
msgid "Can't open file for writing:"
@@ -1145,11 +1316,11 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Analyzing"
-msgstr ""
+msgstr "分æžä¸­"
#: editor/editor_node.cpp
msgid "Creating Thumbnail"
-msgstr ""
+msgstr "正在建立縮圖"
#: editor/editor_node.cpp
msgid ""
@@ -1194,19 +1365,19 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Copy Params"
-msgstr ""
+msgstr "è¤‡è£½åƒæ•¸"
#: editor/editor_node.cpp
msgid "Paste Params"
-msgstr ""
+msgstr "è²¼ä¸Šåƒæ•¸"
#: editor/editor_node.cpp editor/plugins/resource_preloader_editor_plugin.cpp
msgid "Paste Resource"
-msgstr ""
+msgstr "貼上資æº"
#: editor/editor_node.cpp
msgid "Copy Resource"
-msgstr ""
+msgstr "複製資æº"
#: editor/editor_node.cpp
msgid "Make Built-In"
@@ -1218,7 +1389,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Open in Help"
-msgstr ""
+msgstr "在幫助界é¢ä¸­é–‹å•Ÿ"
#: editor/editor_node.cpp
msgid "There is no defined scene to run."
@@ -1227,8 +1398,8 @@ msgstr ""
#: editor/editor_node.cpp
msgid ""
"No main scene has ever been defined, select one?\n"
-"You can change it later in later in \"Project Settings\" under the "
-"'application' category."
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
msgstr ""
#: editor/editor_node.cpp
@@ -1247,15 +1418,15 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Current scene was never saved, please save it prior to running."
-msgstr ""
+msgstr "請先存檔æ‰èƒ½åŸ·è¡Œè©²å ´æ™¯"
#: editor/editor_node.cpp
msgid "Could not start subprocess!"
-msgstr ""
+msgstr "無法啟動å­ç¨‹åº"
#: editor/editor_node.cpp
msgid "Open Scene"
-msgstr ""
+msgstr "開啟場景"
#: editor/editor_node.cpp
msgid "Open Base Scene"
@@ -1263,7 +1434,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Quick Open Scene.."
-msgstr ""
+msgstr "快速開啟場景"
#: editor/editor_node.cpp
msgid "Quick Open Script.."
@@ -1271,19 +1442,23 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Yes"
-msgstr ""
+msgstr "是"
#: editor/editor_node.cpp
msgid "Close scene? (Unsaved changes will be lost)"
-msgstr ""
+msgstr "沒有儲存的變更都會éºå¤±, 確定è¦é—œé–‰?"
#: editor/editor_node.cpp
msgid "Save Scene As.."
+msgstr "å¦å­˜å ´æ™¯ç‚º.."
+
+#: editor/editor_node.cpp
+msgid "No"
msgstr ""
#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
-msgstr ""
+msgstr "此場景尚未存檔, 執行å‰è«‹å…ˆå­˜æª”"
#: editor/editor_node.cpp
msgid "Export Mesh Library"
@@ -1295,41 +1470,41 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Quit"
-msgstr ""
+msgstr "離開"
#: editor/editor_node.cpp
msgid "Exit the editor?"
-msgstr ""
+msgstr "離開編輯器嗎?"
#: editor/editor_node.cpp
msgid "Current scene not saved. Open anyway?"
-msgstr ""
+msgstr "ç›®å‰çš„場景尚未存檔, ä¾ç„¶è¦é–‹å•Ÿå—Ž?"
#: editor/editor_node.cpp
msgid "Can't reload a scene that was never saved."
-msgstr ""
+msgstr "ç„¡æ³•é‡æ–°è¼‰å…¥æœªå­˜æª”的場景"
#: editor/editor_node.cpp
msgid "Revert"
-msgstr ""
+msgstr "還原"
#: editor/editor_node.cpp
msgid "This action cannot be undone. Revert anyway?"
-msgstr ""
+msgstr "æ­¤æ“作無法復原, 確定è¦é‚„原嗎?"
#: editor/editor_node.cpp
msgid "Quick Run Scene.."
-msgstr ""
+msgstr "快速執行場景.."
#: editor/editor_node.cpp
msgid ""
"Open Project Manager? \n"
"(Unsaved changes will be lost)"
-msgstr ""
+msgstr "未ä¿å­˜çš„變更將éºå¤±, è¦é–‹å•Ÿå°ˆæ¡ˆç®¡ç†å“¡å—Ž?"
#: editor/editor_node.cpp
msgid "Pick a Main Scene"
-msgstr ""
+msgstr "挑一個主è¦å ´æ™¯"
#: editor/editor_node.cpp
msgid ""
@@ -1338,9 +1513,9 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: editor/scene_tree_dock.cpp
msgid "Ugh"
-msgstr ""
+msgstr "呃"
#: editor/editor_node.cpp
msgid ""
@@ -1350,7 +1525,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Error loading scene."
-msgstr ""
+msgstr "載入場景時發生錯誤"
#: editor/editor_node.cpp
msgid "Scene '%s' has broken dependencies:"
@@ -1366,19 +1541,24 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Switch Scene Tab"
-msgstr ""
+msgstr "切æ›å ´æ™¯åˆ†é "
#: editor/editor_node.cpp
msgid "%d more file(s)"
-msgstr ""
+msgstr "還有 %d 個檔案"
#: editor/editor_node.cpp
msgid "%d more file(s) or folder(s)"
+msgstr "還有 %d 個檔案或資料夾"
+
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
msgstr ""
#: editor/editor_node.cpp editor/io_plugins/editor_scene_import_plugin.cpp
+#, fuzzy
msgid "Scene"
-msgstr ""
+msgstr "場景"
#: editor/editor_node.cpp
msgid "Go to previously opened scene."
@@ -1386,15 +1566,15 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Next tab"
-msgstr ""
+msgstr "下個分é "
#: editor/editor_node.cpp
msgid "Previous tab"
-msgstr ""
+msgstr "上個分é "
#: editor/editor_node.cpp
msgid "Filter Files.."
-msgstr ""
+msgstr "éŽæ¿¾æª”案.."
#: editor/editor_node.cpp
msgid "Operations with scene files."
@@ -1410,31 +1590,31 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Open Scene.."
-msgstr ""
+msgstr "開啟場景.."
#: editor/editor_node.cpp
msgid "Save Scene"
-msgstr ""
+msgstr "儲存場景"
#: editor/editor_node.cpp
msgid "Save all Scenes"
-msgstr ""
+msgstr "儲存全部場景"
#: editor/editor_node.cpp
msgid "Close Scene"
-msgstr ""
+msgstr "關閉場景"
#: editor/editor_node.cpp
msgid "Close Goto Prev. Scene"
msgstr ""
-#: editor/editor_node.cpp
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
-msgstr ""
+msgstr "開啟最近存å–"
#: editor/editor_node.cpp
msgid "Convert To.."
-msgstr ""
+msgstr "è½‰æ›æˆ.."
#: editor/editor_node.cpp
msgid "MeshLibrary.."
@@ -1448,106 +1628,48 @@ msgstr ""
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Undo"
-msgstr ""
+msgstr "復原"
#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Redo"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr ""
+msgstr "å–æ¶ˆã€Œå¾©åŽŸã€"
#: editor/editor_node.cpp
msgid "Revert Scene"
msgstr ""
#: editor/editor_node.cpp
-msgid "Quit to Project List"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Import assets to the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/io_plugins/editor_bitmask_import_plugin.cpp
-#: editor/io_plugins/editor_font_import_plugin.cpp
-#: editor/io_plugins/editor_mesh_import_plugin.cpp
-#: editor/io_plugins/editor_sample_import_plugin.cpp
-#: editor/io_plugins/editor_scene_import_plugin.cpp
-#: editor/io_plugins/editor_texture_import_plugin.cpp
-#: editor/io_plugins/editor_translation_import_plugin.cpp
-#: editor/project_manager.cpp
-msgid "Import"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
-msgstr ""
+#, fuzzy
+msgid "Project"
+msgstr "專案設定"
#: editor/editor_node.cpp
-msgid "Tools"
-msgstr ""
+msgid "Project Settings"
+msgstr "專案設定"
#: editor/editor_node.cpp
-msgid "Export the project to many platforms."
+msgid "Run Script"
msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the project."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Play"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause the scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Pause Scene"
-msgstr ""
+msgstr "輸出"
#: editor/editor_node.cpp
-msgid "Stop the scene."
-msgstr ""
-
-#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
-msgid "Stop"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play the edited scene."
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play Scene"
-msgstr ""
-
-#: editor/editor_node.cpp
-msgid "Play custom scene"
-msgstr ""
+msgid "Tools"
+msgstr "工具"
#: editor/editor_node.cpp
-msgid "Play Custom Scene"
+msgid "Quit to Project List"
msgstr ""
-#: editor/editor_node.cpp
-msgid "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1618,8 +1740,8 @@ msgid ""
"filesystem."
msgstr ""
-#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
-msgid "Settings"
+#: editor/editor_node.cpp
+msgid "Editor"
msgstr ""
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
@@ -1639,11 +1761,67 @@ msgid "Manage Export Templates"
msgstr ""
#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "About"
msgstr ""
#: editor/editor_node.cpp
-msgid "Alerts when an external resource has changed."
+msgid "Play the project."
+msgstr "éŠçŽ©æ­¤å°ˆæ¡ˆ"
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Play"
+msgstr "é–‹å§‹"
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr "æš«åœæ­¤å ´æ™¯"
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr "æš«åœå ´æ™¯"
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr "åœæ­¢æ­¤å ´æ™¯"
+
+#: editor/editor_node.cpp editor/plugins/sample_library_editor_plugin.cpp
+msgid "Stop"
+msgstr "åœæ­¢"
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
msgstr ""
#: editor/editor_node.cpp
@@ -1727,6 +1905,14 @@ msgid "Thanks!"
msgstr ""
#: editor/editor_node.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_node.cpp
msgid "Import Templates From ZIP File"
msgstr ""
@@ -1754,12 +1940,33 @@ msgstr ""
msgid "Load Errors"
msgstr ""
-#: editor/editor_plugin_settings.cpp
-msgid "Installed Plugins:"
+#: editor/editor_node.cpp
+msgid "Open 2D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 3D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+#, fuzzy
+msgid "Open the next Editor"
+msgstr "離開編輯器嗎?"
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
msgstr ""
#: editor/editor_plugin_settings.cpp
-msgid "Version:"
+msgid "Installed Plugins:"
msgstr ""
#: editor/editor_plugin_settings.cpp
@@ -2001,6 +2208,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2029,10 +2240,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2198,7 +2405,7 @@ msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2673,7 +2880,7 @@ msgid "Compress"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3333,7 +3540,7 @@ msgid "Change default type"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
-#: scene/gui/dialogs.cpp
+#: editor/script_create_dialog.cpp scene/gui/dialogs.cpp
msgid "OK"
msgstr ""
@@ -3382,15 +3589,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-msgid "Modify Color Ramp"
-msgstr ""
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr ""
@@ -3421,6 +3619,32 @@ msgstr ""
msgid "Update from Scene"
msgstr ""
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Add point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+#, fuzzy
+msgid "Remove point"
+msgstr "移除"
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item %d"
msgstr ""
@@ -3690,6 +3914,19 @@ msgid "Remove Poly And Point"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
msgstr ""
@@ -3702,7 +3939,7 @@ msgid "Set Emission Mask"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
+msgid "Generate Visibility Rect"
msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
@@ -3713,6 +3950,23 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr ""
@@ -3722,6 +3976,10 @@ msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr ""
@@ -3734,11 +3992,11 @@ msgid "Generate AABB"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Mesh"
+msgid "Create Emission Points From Mesh"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Create Emitter From Node"
+msgid "Create Emission Points From Node"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3750,26 +4008,42 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Positions:"
+msgid "Emission Points:"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Emission Fill:"
+msgid "Surface Points"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Surface"
+msgid "Surface Points+Normal (Directed)"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr ""
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
msgstr ""
@@ -3824,6 +4098,14 @@ msgstr ""
msgid "Remove Path Point"
msgstr ""
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove Out-Control Point"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
msgstr ""
@@ -3977,6 +4259,10 @@ msgid "Pitch"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
msgstr ""
@@ -4064,10 +4350,6 @@ msgstr ""
msgid "Find Next"
msgstr ""
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Debug"
-msgstr ""
-
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
msgstr ""
@@ -4101,15 +4383,7 @@ msgid "Move Right"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Classes"
+msgid "Open Godot online documentation"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
@@ -4164,6 +4438,23 @@ msgid "Pick Color"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert Case"
+msgstr "è½‰æ›æˆ.."
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Cut"
@@ -4214,6 +4505,14 @@ msgid "Trim Trailing Whitespace"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
msgstr ""
@@ -4235,6 +4534,16 @@ msgid "Goto Previous Breakpoint"
msgstr ""
#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Uppercase"
+msgstr "è½‰æ›æˆ.."
+
+#: editor/plugins/script_text_editor.cpp
+#, fuzzy
+msgid "Convert To Lowercase"
+msgstr "è½‰æ›æˆ.."
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4257,6 +4566,10 @@ msgstr ""
msgid "Contextual Help"
msgstr ""
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
msgstr ""
@@ -4474,35 +4787,97 @@ msgid "Animation Key Inserted."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "å¾€å‰"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "Material Changes"
+msgstr "正在儲存變更.."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Shader Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Environment"
+msgid "Display Normal"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+msgid "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+msgid "Display Overdraw"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+msgid "Display Unshaded"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "View Environment"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+msgid "View Gizmos"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4562,23 +4937,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "æ‰€æœ‰çš„é¸æ“‡"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
+msgid "Tool Rotate"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
+msgid "Tool Scale"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
+msgid "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4606,27 +4990,15 @@ msgid "4 Viewports"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Normal"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Wireframe"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Overdraw"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Display Shadeless"
+msgid "View Origin"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Origin"
+msgid "View Grid"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "View Grid"
+msgid "Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4650,14 +5022,6 @@ msgid "Viewport Settings"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Ambient Light Color:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr ""
@@ -5036,9 +5400,8 @@ msgid "Export Mode:"
msgstr ""
#: editor/project_export.cpp
-#, fuzzy
msgid "Resources to export:"
-msgstr "資æºè·¯å¾‘"
+msgstr "è¦è¼¸å‡ºçš„資æº:"
#: editor/project_export.cpp
msgid ""
@@ -5071,11 +5434,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, godot.cfg must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5087,7 +5450,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create godot.cfg in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5123,10 +5486,6 @@ msgid "Install Project:"
msgstr ""
#: editor/project_manager.cpp
-msgid "Install"
-msgstr ""
-
-#: editor/project_manager.cpp
msgid "Browse"
msgstr ""
@@ -5185,6 +5544,10 @@ msgid "New Project"
msgstr ""
#: editor/project_manager.cpp
+msgid "Templates"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Exit"
msgstr ""
@@ -5303,6 +5666,10 @@ msgstr ""
msgid "Erase Input Action Event"
msgstr ""
+#: editor/project_settings.cpp
+msgid "Add Event"
+msgstr ""
+
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr ""
@@ -5368,8 +5735,9 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings (godot.cfg)"
-msgstr ""
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "專案設定"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5435,10 +5803,6 @@ msgstr ""
msgid "AutoLoad"
msgstr ""
-#: editor/project_settings.cpp
-msgid "Plugins"
-msgstr ""
-
#: editor/property_editor.cpp
msgid "Pick a Viewport"
msgstr ""
@@ -5488,10 +5852,6 @@ msgid "Error loading file: Not a resource!"
msgstr ""
#: editor/property_editor.cpp
-msgid "Couldn't load image"
-msgstr ""
-
-#: editor/property_editor.cpp
msgid "Pick a Node"
msgstr ""
@@ -5676,6 +6036,10 @@ msgid "Error duplicating scene to save it."
msgstr ""
#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources:"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
msgstr ""
@@ -5750,10 +6114,58 @@ msgid "Toggle CanvasItem Visible"
msgstr ""
#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Subscene options"
+msgstr "除錯é¸é …"
+
+#: editor/scene_tree_editor.cpp
msgid "Instance:"
msgstr ""
#: editor/scene_tree_editor.cpp
+#, fuzzy
+msgid "Open script"
+msgstr "開啟最近存å–"
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
msgstr ""
@@ -5798,75 +6210,85 @@ msgid "Select a Node"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid parent class name"
+#, fuzzy
+msgid "Error - Could not create script in filesystem."
+msgstr "無法新增資料夾"
+
+#: editor/script_create_dialog.cpp
+msgid "Error loading script from %s"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid chars:"
+msgid "Path is empty"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid class name"
+msgid "Path is not local"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Valid name"
+msgid "Invalid base path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "N/A"
+msgid "Invalid extension"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class name is invalid!"
+msgid "Wrong extension chosen"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Parent class name is invalid!"
+#, fuzzy
+msgid "Invalid Path"
+msgstr "無效的路徑"
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid class name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid path!"
+msgid "Invalid inherited parent name or path"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Could not create script in filesystem."
+msgid "Script valid"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Error loading script from %s"
+msgid "Allowed: a-z, A-Z, 0-9 and _"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is empty"
+msgid "N/A"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Path is not local"
+msgid "Built-in script (into scene file)"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid base path"
+msgid "Create new script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Invalid extension"
+msgid "Load existing script file"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Create new script"
+msgid "Inherits"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
+msgid "Class Name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
+msgid "Template"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6042,6 +6464,10 @@ msgid "Change Notifier Extents"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
#, fuzzy
msgid "Change Probe Extents"
msgstr "變更框型範åœ"
@@ -6367,6 +6793,26 @@ msgstr ""
msgid "just released"
msgstr ""
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read file:\n"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:\n"
+msgstr ""
+
#: platform/uwp/export/export.cpp
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
@@ -6512,8 +6958,10 @@ msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr ""
-#: scene/2d/particles_2d.cpp
-msgid "Path property must point to a valid Particles2D node to work."
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
msgstr ""
#: scene/2d/path_2d.cpp
@@ -6576,6 +7024,11 @@ msgid ""
"It only provides navigation data."
msgstr ""
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6591,6 +7044,14 @@ msgid ""
"order for AnimatedSprite3D to display frames."
msgstr ""
+#: scene/gui/color_picker.cpp
+msgid "RAW Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr ""
@@ -6633,6 +7094,12 @@ msgid ""
"minimum size manually."
msgstr ""
+#: scene/main/scene_main_loop.cpp
+msgid ""
+"Default Environment as specified in Project Setings (Rendering -> Viewport -"
+"> Default Environment) could not be loaded."
+msgstr ""
+
#: scene/main/viewport.cpp
msgid ""
"This viewport is not set as render target. If you intend for it to display "
diff --git a/icon.png b/icon.png
index 7abb58ca7b..29c4a7b8fc 100644
--- a/icon.png
+++ b/icon.png
Binary files differ
diff --git a/icon.svg b/icon.svg
index 34747d34fe..5d075125e3 100644
--- a/icon.svg
+++ b/icon.svg
@@ -13,11 +13,11 @@
height="1024"
id="svg3030"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.1 r15371"
sodipodi:docname="icon.svg"
inkscape:export-filename="/home/akien/Projects/godot/godot.git/icon.png"
- inkscape:export-xdpi="22.5"
- inkscape:export-ydpi="22.5">
+ inkscape:export-xdpi="24"
+ inkscape:export-ydpi="24">
<defs
id="defs3032" />
<sodipodi:namedview
@@ -28,13 +28,13 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
- inkscape:cx="-560.15123"
- inkscape:cy="190.62119"
+ inkscape:cx="707.24666"
+ inkscape:cy="14.063809"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
- inkscape:window-height="1015"
+ inkscape:window-height="1011"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
@@ -54,79 +54,86 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
- transform="translate(0,-28.362183)">
+ transform="translate(0,-98.519719)">
<g
- id="g4149"
- transform="matrix(1.0688992,0,0,1.1334985,-45.061194,-81.689066)">
+ id="g78"
+ transform="matrix(4.162611,0,0,-4.162611,919.24059,771.67186)"
+ style="stroke-width:0.32031175">
<path
- sodipodi:nodetypes="cccccccccc"
- inkscape:connector-curvature="0"
- id="path3239"
- d="m 116.99388,715.36604 43.13957,-74.51381 75.99672,-171.42666 271.088,-13.63746 282.06373,14.1696 138.45065,255.56931 -25.0756,66.96734 -376.12685,53.39482 -367.70391,-40.32222 z"
- style="fill:#ffffff;fill-opacity:1;stroke:none" />
- <g
- transform="matrix(12.995388,0,0,-12.995388,898.37246,704.73082)"
- id="g3412">
- <path
- id="path3414"
- style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 0,-3.942 c 0,-0.39 -0.25,-0.734 -0.621,-0.852 L -6.835,-6.8 c -0.273,-0.091 -0.57,-0.042 -0.8,0.128 -0.232,0.168 -0.37,0.437 -0.37,0.721 l 0,4.305 -5.818,-1.108 0,-4.381 c 0,-0.447 -0.332,-0.824 -0.775,-0.885 l -8.41,-1.152 c -0.039,-0.003 -0.081,-0.008 -0.121,-0.008 -0.214,0 -0.424,0.078 -0.588,0.22 -0.195,0.172 -0.306,0.416 -0.306,0.676 l 0,4.638 -4.341,-0.018 0,-10e-4 -0.318,10e-4 -0.319,-10e-4 0,10e-4 -4.34,0.018 0,-4.638 c 0,-0.26 -0.112,-0.504 -0.307,-0.676 -0.164,-0.142 -0.374,-0.22 -0.587,-0.22 -0.041,0 -0.082,0.005 -0.123,0.008 l -8.41,1.152 c -0.442,0.061 -0.774,0.438 -0.774,0.885 l 0,4.381 -5.819,1.108 0,-4.305 c 0,-0.284 -0.137,-0.553 -0.368,-0.721 -0.232,-0.17 -0.529,-0.219 -0.802,-0.128 l -6.215,2.006 c -0.369,0.118 -0.619,0.462 -0.619,0.852 l 0,3.942 -3.837,1.29 c -0.19,-0.811 -0.295,-1.642 -0.295,-2.481 0,-10.301 14.512,-18.252 32.448,-18.309 l 0.022,0 0.023,0 c 17.936,0.057 32.448,8.008 32.448,18.309 0,0.766 -0.088,1.521 -0.247,2.266 L 0,0 Z"
- inkscape:connector-curvature="0" />
- </g>
- <g
- transform="matrix(12.995388,0,0,-12.995388,140.10982,467.34929)"
- id="g3416">
- <path
- id="path3418"
- style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 0,-16.047 2.163,-0.729 c 0.364,-0.122 0.61,-0.462 0.61,-0.847 l 0,-3.936 4.426,-1.428 0,4.154 c 0,0.27 0.118,0.52 0.323,0.689 0.206,0.172 0.474,0.241 0.739,0.192 l 7.608,-1.452 c 0.422,-0.079 0.728,-0.448 0.728,-0.877 l 0,-4.338 6.62,-0.904 0,4.509 c 0,0.241 0.096,0.467 0.264,0.635 0.167,0.166 0.394,0.259 0.633,0.259 l 0.002,0 5.551,-0.022 5.549,0.022 c 0.245,-10e-4 0.468,-0.093 0.635,-0.259 0.169,-0.168 0.264,-0.394 0.264,-0.635 l 0,-4.509 6.621,0.904 0,4.338 c 0,0.429 0.304,0.798 0.726,0.877 l 7.609,1.452 c 0.262,0.049 0.533,-0.02 0.738,-0.192 0.205,-0.169 0.325,-0.419 0.325,-0.689 l 0,-4.154 4.425,1.428 0,3.936 c 0,0.385 0.245,0.725 0.609,0.847 l 1.475,0.497 0,16.279 0.04,0 c 1.437,1.834 2.767,3.767 4.042,5.828 -1.694,2.883 -3.768,5.459 -5.986,7.846 -2.057,-1.035 -4.055,-2.208 -5.942,-3.456 -0.944,0.938 -2.008,1.706 -3.052,2.509 -1.027,0.824 -2.183,1.428 -3.281,2.132 0.327,2.433 0.489,4.828 0.554,7.327 -2.831,1.424 -5.85,2.369 -8.903,3.047 -1.219,-2.048 -2.334,-4.267 -3.304,-6.436 -1.152,0.192 -2.309,0.264 -3.467,0.277 l 0,0.002 c -0.008,0 -0.015,-0.002 -0.022,-0.002 -0.008,0 -0.015,0.002 -0.022,0.002 l 0,-0.002 c -1.16,-0.013 -2.316,-0.085 -3.468,-0.277 -0.97,2.169 -2.084,4.388 -3.305,6.436 C 19.475,24.555 16.456,23.61 13.626,22.186 13.69,19.687 13.852,17.292 14.18,14.859 13.081,14.155 11.925,13.551 10.898,12.727 9.855,11.924 8.79,11.156 7.846,10.218 5.958,11.466 3.961,12.639 1.904,13.674 -0.314,11.287 -2.388,8.711 -4.082,5.828 -2.807,3.767 -1.477,1.834 -0.04,0 L 0,0 Z"
- inkscape:connector-curvature="0" />
- </g>
- <g
- transform="matrix(12.995388,0,0,-12.995388,411.4457,567.42812)"
- id="g3420">
- <path
- id="path3422"
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c 0,-3.611 -2.926,-6.537 -6.537,-6.537 -3.608,0 -6.535,2.926 -6.535,6.537 0,3.609 2.927,6.533 6.535,6.533 C -2.926,6.533 0,3.609 0,0"
- inkscape:connector-curvature="0" />
- </g>
- <g
- transform="matrix(12.995388,0,0,-12.995388,391.00655,572.46636)"
- id="g3424">
- <path
- id="path3426"
- style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c 0,-2.396 -1.941,-4.337 -4.339,-4.337 -2.396,0 -4.339,1.941 -4.339,4.337 0,2.396 1.943,4.339 4.339,4.339 C -1.941,4.339 0,2.396 0,0"
- inkscape:connector-curvature="0" />
- </g>
- <g
- transform="matrix(12.995388,0,0,-12.995388,526.30933,660.10985)"
- id="g3428">
- <path
- id="path3430"
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c -1.162,0 -2.104,0.856 -2.104,1.912 l 0,6.018 c 0,1.054 0.942,1.912 2.104,1.912 1.162,0 2.106,-0.858 2.106,-1.912 l 0,-6.018 C 2.106,0.856 1.162,0 0,0"
- inkscape:connector-curvature="0" />
- </g>
- <g
- transform="matrix(12.995388,0,0,-12.995388,641.18731,567.42812)"
- id="g3432">
- <path
- id="path3434"
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c 0,-3.611 2.926,-6.537 6.537,-6.537 3.609,0 6.535,2.926 6.535,6.537 0,3.609 -2.926,6.533 -6.535,6.533 C 2.926,6.533 0,3.609 0,0"
- inkscape:connector-curvature="0" />
- </g>
- <g
- transform="matrix(12.995388,0,0,-12.995388,661.63165,572.46636)"
- id="g3436">
- <path
- id="path3438"
- style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c 0,-2.396 1.941,-4.337 4.336,-4.337 2.398,0 4.339,1.941 4.339,4.337 0,2.396 -1.941,4.339 -4.339,4.339 C 1.941,4.339 0,2.396 0,0"
- inkscape:connector-curvature="0" />
- </g>
+ d="m 0,0 c 0,0 -0.325,1.994 -0.515,1.976 l -36.182,-3.491 c -2.879,-0.278 -5.115,-2.574 -5.317,-5.459 l -0.994,-14.247 -27.992,-1.997 -1.904,12.912 c -0.424,2.872 -2.932,5.037 -5.835,5.037 h -38.188 c -2.902,0 -5.41,-2.165 -5.834,-5.037 l -1.905,-12.912 -27.992,1.997 -0.994,14.247 c -0.202,2.886 -2.438,5.182 -5.317,5.46 l -36.2,3.49 c -0.187,0.018 -0.324,-1.978 -0.511,-1.978 l -0.049,-7.83 30.658,-4.944 1.004,-14.374 c 0.203,-2.91 2.551,-5.263 5.463,-5.472 l 38.551,-2.75 c 0.146,-0.01 0.29,-0.016 0.434,-0.016 2.897,0 5.401,2.166 5.825,5.038 l 1.959,13.286 h 28.005 l 1.959,-13.286 c 0.423,-2.871 2.93,-5.037 5.831,-5.037 0.142,0 0.284,0.005 0.423,0.015 l 38.556,2.75 c 2.911,0.209 5.26,2.562 5.463,5.472 l 1.003,14.374 30.645,4.966 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ id="path80"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g82-3"
+ transform="matrix(4.162611,0,0,-4.162611,104.69892,525.90697)"
+ style="stroke-width:0.32031175">
+ <path
+ d="m 0,0 v -47.514 -6.035 -5.492 c 0.108,-0.001 0.216,-0.005 0.323,-0.015 l 36.196,-3.49 c 1.896,-0.183 3.382,-1.709 3.514,-3.609 l 1.116,-15.978 31.574,-2.253 2.175,14.747 c 0.282,1.912 1.922,3.329 3.856,3.329 h 38.188 c 1.933,0 3.573,-1.417 3.855,-3.329 l 2.175,-14.747 31.575,2.253 1.115,15.978 c 0.133,1.9 1.618,3.425 3.514,3.609 l 36.182,3.49 c 0.107,0.01 0.214,0.014 0.322,0.015 v 4.711 l 0.015,0.005 V 0 h 0.134 c 4.795,6.12 9.232,12.569 13.487,19.449 -5.651,9.62 -12.575,18.217 -19.976,26.182 -6.864,-3.455 -13.531,-7.369 -19.828,-11.534 -3.151,3.132 -6.7,5.694 -10.186,8.372 -3.425,2.751 -7.285,4.768 -10.946,7.118 1.09,8.117 1.629,16.108 1.846,24.448 -9.446,4.754 -19.519,7.906 -29.708,10.17 -4.068,-6.837 -7.788,-14.241 -11.028,-21.479 -3.842,0.642 -7.702,0.88 -11.567,0.926 v 0.006 c -0.027,0 -0.052,-0.006 -0.075,-0.006 -0.024,0 -0.049,0.006 -0.073,0.006 V 63.652 C 93.903,63.606 90.046,63.368 86.203,62.726 82.965,69.964 79.247,77.368 75.173,84.205 64.989,81.941 54.915,78.789 45.47,74.035 45.686,65.695 46.225,57.704 47.318,49.587 43.65,47.237 39.795,45.22 36.369,42.469 32.888,39.791 29.333,37.229 26.181,34.097 19.884,38.262 13.219,42.176 6.353,45.631 -1.048,37.666 -7.968,29.069 -13.621,19.449 -9.368,12.569 -4.928,6.12 -0.134,0 Z"
+ style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ id="path84-6"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g86-7"
+ transform="matrix(4.162611,0,0,-4.162611,784.07144,817.24284)"
+ style="stroke-width:0.32031175">
+ <path
+ d="m 0,0 -1.121,-16.063 c -0.135,-1.936 -1.675,-3.477 -3.611,-3.616 l -38.555,-2.751 c -0.094,-0.007 -0.188,-0.01 -0.281,-0.01 -1.916,0 -3.569,1.406 -3.852,3.33 l -2.211,14.994 H -81.09 l -2.211,-14.994 c -0.297,-2.018 -2.101,-3.469 -4.133,-3.32 l -38.555,2.751 c -1.936,0.139 -3.476,1.68 -3.611,3.616 L -130.721,0 -163.268,3.138 c 0.015,-3.498 0.06,-7.33 0.06,-8.093 0,-34.374 43.605,-50.896 97.781,-51.086 h 0.066 0.067 c 54.176,0.19 97.766,16.712 97.766,51.086 0,0.777 0.047,4.593 0.063,8.093 z"
+ style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ id="path88-5"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g90-3"
+ transform="matrix(4.162611,0,0,-4.162611,389.21484,625.67104)"
+ style="stroke-width:0.32031175">
+ <path
+ d="m 0,0 c 0,-12.052 -9.765,-21.815 -21.813,-21.815 -12.042,0 -21.81,9.763 -21.81,21.815 0,12.044 9.768,21.802 21.81,21.802 C -9.765,21.802 0,12.044 0,0"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ id="path92-5"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g94-6"
+ transform="matrix(4.162611,0,0,-4.162611,367.36686,631.05679)"
+ style="stroke-width:0.32031175">
+ <path
+ d="m 0,0 c 0,-7.994 -6.479,-14.473 -14.479,-14.473 -7.996,0 -14.479,6.479 -14.479,14.473 0,7.994 6.483,14.479 14.479,14.479 C -6.479,14.479 0,7.994 0,0"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ id="path96-2"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g98-9"
+ transform="matrix(4.162611,0,0,-4.162611,511.99336,724.73954)"
+ style="stroke-width:0.32031175">
+ <path
+ d="m 0,0 c -3.878,0 -7.021,2.858 -7.021,6.381 v 20.081 c 0,3.52 3.143,6.381 7.021,6.381 3.878,0 7.028,-2.861 7.028,-6.381 V 6.381 C 7.028,2.858 3.878,0 0,0"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ id="path100-1"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g102-2"
+ transform="matrix(4.162611,0,0,-4.162611,634.78706,625.67104)"
+ style="stroke-width:0.32031175">
+ <path
+ d="m 0,0 c 0,-12.052 9.765,-21.815 21.815,-21.815 12.041,0 21.808,9.763 21.808,21.815 0,12.044 -9.767,21.802 -21.808,21.802 C 9.765,21.802 0,12.044 0,0"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ id="path104-7"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g106-0"
+ transform="matrix(4.162611,0,0,-4.162611,656.64056,631.05679)"
+ style="stroke-width:0.32031175">
+ <path
+ d="m 0,0 c 0,-7.994 6.477,-14.473 14.471,-14.473 8.002,0 14.479,6.479 14.479,14.473 0,7.994 -6.477,14.479 -14.479,14.479 C 6.477,14.479 0,7.994 0,0"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175"
+ id="path108-9"
+ inkscape:connector-curvature="0" />
</g>
</g>
</svg>
diff --git a/logo.png b/logo.png
index d6cab7f11b..8cf3e15ebc 100644
--- a/logo.png
+++ b/logo.png
Binary files differ
diff --git a/logo.svg b/logo.svg
index 98dcddfd2b..865712b345 100644
--- a/logo.svg
+++ b/logo.svg
@@ -1,134 +1,219 @@
<?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"
- viewBox="0 0 236.27499 84.6875"
- height="84.6875"
- width="236.27499"
- xml:space="preserve"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ id="svg2"
version="1.1"
- id="svg3336"><metadata
- id="metadata3342"><rdf:RDF><cc:Work
+ inkscape:version="0.92.1 r15371"
+ xml:space="preserve"
+ width="1024"
+ height="414"
+ viewBox="0 0 959.99998 388.125"
+ sodipodi:docname="logo.svg"
+ inkscape:export-filename="/home/akien/Projects/godot/godot.git/logo.png"
+ inkscape:export-xdpi="48"
+ inkscape:export-ydpi="48"><metadata
+ id="metadata8"><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><defs
- id="defs3340"><clipPath
- id="clipPath3350"
- clipPathUnits="userSpaceOnUse"><path
- id="path3352"
- d="m 0,67.75 189.02,0 L 189.02,0 0,0 0,67.75 Z" /></clipPath></defs><g
- transform="matrix(1.25,0,0,-1.25,0,84.6875)"
- id="g3344"><g
- id="g3346"><g
- clip-path="url(#clipPath3350)"
- id="g3348"><g
- transform="translate(112.7847,43.5176)"
- id="g3354"><path
- id="path3356"
- style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c -1.082,0 -1.989,-0.497 -2.724,-1.488 -0.732,-0.992 -1.099,-2.385 -1.099,-4.177 0,-1.796 0.349,-3.171 1.05,-4.129 0.699,-0.961 1.617,-1.439 2.756,-1.439 1.139,0 2.064,0.484 2.775,1.457 0.71,0.968 1.066,2.355 1.066,4.161 0,1.803 -0.367,3.192 -1.1,4.162 C 1.992,-0.484 1.083,0 0,0 m -0.017,-17.828 c -3.168,0 -5.752,1.037 -7.749,3.11 -1.994,2.075 -2.991,5.104 -2.991,9.084 0,3.984 1.008,6.999 3.027,9.053 2.018,2.051 4.624,3.077 7.815,3.077 3.191,0 5.769,-1.008 7.73,-3.029 1.964,-2.018 2.945,-5.076 2.945,-9.167 0,-4.094 -1.004,-7.139 -3.012,-9.137 -2.008,-1.994 -4.595,-2.991 -7.765,-2.991" /></g><g
- transform="translate(133.0269,43.2832)"
- id="g3358"><path
- id="path3360"
- style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 0,-10.119 c 0,-0.473 0.035,-0.771 0.103,-0.896 0.066,-0.124 0.27,-0.186 0.607,-0.186 1.242,0 2.183,0.464 2.826,1.388 0.645,0.924 0.964,2.462 0.964,4.617 0,2.155 -0.334,3.559 -0.997,4.212 C 2.837,-0.33 1.782,0 0.338,0 L 0,0 Z m -6.495,-15.7 0,20.298 c 0,0.564 0.14,1.009 0.423,1.34 0.281,0.325 0.648,0.49 1.1,0.49 l 5.65,0 c 3.586,0 6.309,-0.905 8.168,-2.709 1.862,-1.804 2.794,-4.645 2.794,-8.525 0,-8.3 -3.543,-12.45 -10.625,-12.45 l -5.785,0 c -1.149,0 -1.725,0.518 -1.725,1.556" /></g><g
- transform="translate(157.6558,43.5176)"
- id="g3362"><path
- id="path3364"
- style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c -1.083,0 -1.991,-0.497 -2.726,-1.488 -0.731,-0.992 -1.097,-2.385 -1.097,-4.177 0,-1.796 0.35,-3.171 1.049,-4.129 0.698,-0.961 1.617,-1.439 2.756,-1.439 1.14,0 2.065,0.484 2.775,1.457 0.711,0.968 1.067,2.355 1.067,4.161 0,1.803 -0.367,3.192 -1.1,4.162 C 1.99,-0.484 1.083,0 0,0 m -0.018,-17.828 c -3.169,0 -5.751,1.037 -7.746,3.11 -1.997,2.075 -2.995,5.104 -2.995,9.084 0,3.984 1.009,6.999 3.027,9.053 2.02,2.051 4.624,3.077 7.817,3.077 3.192,0 5.768,-1.008 7.73,-3.029 1.963,-2.018 2.944,-5.076 2.944,-9.167 0,-4.094 -1.004,-7.139 -3.012,-9.137 -2.007,-1.994 -4.596,-2.991 -7.765,-2.991" /></g><g
- transform="translate(181.0239,26.5664)"
- id="g3366"><path
- id="path3368"
- style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c 0,-0.448 -1.115,-0.676 -3.349,-0.676 -2.232,0 -3.35,0.228 -3.35,0.676 l 0,16.985 -4.059,0 c -0.384,0 -0.655,0.518 -0.812,1.558 -0.068,0.495 -0.1,1.002 -0.1,1.521 0,0.517 0.032,1.026 0.1,1.522 0.157,1.037 0.428,1.559 0.812,1.559 l 14.717,0 c 0.383,0 0.653,-0.522 0.812,-1.559 0.067,-0.496 0.101,-1.005 0.101,-1.522 0,-0.519 -0.034,-1.026 -0.101,-1.521 C 4.612,17.503 4.342,16.985 3.959,16.985 L 0,16.985 0,0 Z" /></g><g
- transform="translate(96.0444,38.5889)"
- id="g3370"><path
- id="path3372"
- style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c -1.821,0.028 -3.906,-0.352 -3.906,-0.352 l 0,-3.554 2.096,0 -0.023,-1.585 c 0,-0.587 -0.582,-0.882 -1.743,-0.882 -1.162,0 -2.188,0.492 -3.078,1.474 -0.893,0.982 -1.337,2.419 -1.337,4.311 0,1.897 0.434,3.295 1.303,4.197 0.866,0.902 2.002,1.354 3.399,1.354 0.587,0 1.195,-0.095 1.827,-0.288 0.632,-0.192 1.055,-0.371 1.27,-0.539 0.214,-0.173 0.417,-0.255 0.609,-0.255 0.191,0 0.501,0.223 0.929,0.676 0.429,0.451 0.813,1.134 1.152,2.046 0.337,0.916 0.506,1.618 0.506,2.116 0,0.494 -0.01,0.835 -0.032,1.014 -0.474,0.519 -1.348,0.93 -2.624,1.236 -1.273,0.304 -2.7,0.456 -4.279,0.456 -3.474,0 -6.191,-1.094 -8.153,-3.281 -1.963,-2.189 -2.943,-5.03 -2.943,-8.527 0,-4.105 1.003,-7.218 3.008,-9.338 2.01,-2.12 4.648,-3.178 7.919,-3.178 1.759,0 3.321,0.151 4.684,0.456 1.366,0.303 2.274,0.615 2.726,0.93 L 3.445,-0.926 C 3.445,-0.311 1.821,-0.031 0,0" /></g><g
- transform="translate(88.9126,11.8398)"
- id="g3374"><path
- id="path3376"
- style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c -0.187,-0.384 -0.531,-0.735 -1.034,-1.054 -0.502,-0.32 -1.14,-0.479 -1.915,-0.479 -1.022,0 -1.844,0.322 -2.469,0.973 -0.622,0.647 -0.934,1.579 -0.934,2.794 l 0,3.032 c 0,1.189 0.294,2.101 0.883,2.738 0.588,0.632 1.376,0.952 2.359,0.952 0.962,0 1.707,-0.253 2.234,-0.753 C -0.35,7.701 -0.074,7 -0.05,6.104 l -0.013,-0.04 -0.785,0 C -0.876,6.751 -1.075,7.28 -1.45,7.654 -1.823,8.025 -2.377,8.213 -3.11,8.213 -3.851,8.213 -4.438,7.962 -4.868,7.459 -5.296,6.957 -5.51,6.229 -5.51,5.273 l 0,-3.048 c 0,-0.992 0.231,-1.747 0.693,-2.268 0.461,-0.517 1.083,-0.775 1.868,-0.775 0.574,0 1.034,0.101 1.379,0.309 0.346,0.205 0.587,0.455 0.722,0.752 l 0,2.655 -2.115,0 0,0.739 L 0,3.637 0,0 Z" /></g><g
- transform="translate(92.7988,11.0645)"
- id="g3378"><path
- id="path3380"
- style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c 0.465,0 0.88,0.132 1.242,0.4 0.362,0.27 0.616,0.611 0.767,1.026 l 0,1.638 -1.346,0 C 0.091,3.064 -0.368,2.902 -0.711,2.578 -1.055,2.256 -1.225,1.854 -1.225,1.375 -1.225,0.971 -1.119,0.639 -0.903,0.383 -0.688,0.126 -0.387,0 0,0 M 2.135,-0.611 C 2.093,-0.349 2.06,-0.136 2.04,0.031 2.02,0.201 2.009,0.37 2.009,0.542 1.779,0.166 1.483,-0.146 1.116,-0.39 0.75,-0.636 0.343,-0.758 -0.105,-0.758 c -0.627,0 -1.109,0.195 -1.45,0.583 -0.34,0.391 -0.511,0.917 -0.511,1.581 0,0.702 0.247,1.266 0.741,1.684 0.494,0.418 1.166,0.627 2.011,0.627 l 1.323,0 0,0.93 C 2.009,5.183 1.873,5.604 1.604,5.909 1.331,6.21 0.954,6.362 0.468,6.362 0.017,6.362 -0.356,6.219 -0.649,5.928 -0.94,5.639 -1.085,5.285 -1.085,4.864 l -0.786,0.007 -0.014,0.041 c -0.022,0.571 0.194,1.076 0.65,1.524 0.454,0.446 1.036,0.668 1.745,0.668 0.701,0 1.265,-0.213 1.696,-0.638 0.428,-0.429 0.643,-1.04 0.643,-1.835 l 0,-3.715 c 0,-0.27 0.012,-0.533 0.036,-0.784 0.024,-0.254 0.063,-0.499 0.125,-0.743 l -0.875,0 z" /></g><g
- transform="translate(98.2871,18.0273)"
- id="g3382"><path
- id="path3384"
- style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 0.072,-1.176 c 0.199,0.421 0.466,0.745 0.796,0.976 0.332,0.227 0.722,0.341 1.171,0.341 0.457,0 0.843,-0.133 1.154,-0.403 0.311,-0.268 0.541,-0.675 0.687,-1.22 0.186,0.503 0.451,0.902 0.794,1.19 0.343,0.289 0.759,0.433 1.242,0.433 0.664,0 1.179,-0.269 1.544,-0.807 0.367,-0.539 0.55,-1.366 0.55,-2.483 l 0,-4.425 -0.846,0 0,4.439 c 0,0.929 -0.128,1.583 -0.378,1.959 -0.252,0.377 -0.612,0.567 -1.078,0.567 -0.491,0 -0.874,-0.207 -1.149,-0.628 C 4.285,-1.658 4.116,-2.185 4.054,-2.82 l 0,-0.197 0,-4.557 -0.842,0 0,4.434 c 0,0.908 -0.127,1.557 -0.387,1.945 -0.259,0.387 -0.619,0.58 -1.081,0.58 -0.442,0 -0.8,-0.135 -1.068,-0.403 C 0.407,-1.286 0.215,-1.654 0.099,-2.121 l 0,-5.453 -0.841,0 0,7.574 L 0,0 Z" /></g><g
- transform="translate(110.499,17.4268)"
- id="g3386"><path
- id="path3388"
- style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c -0.527,0 -0.959,-0.24 -1.299,-0.72 -0.339,-0.481 -0.514,-1.074 -0.529,-1.781 l 3.495,0 0,0.324 c 0,0.625 -0.147,1.146 -0.441,1.559 C 0.931,-0.205 0.523,0 0,0 m 0.119,-7.12 c -0.817,0 -1.485,0.307 -2.003,0.921 -0.517,0.612 -0.777,1.395 -0.777,2.349 l 0,1.258 c 0,0.956 0.26,1.753 0.78,2.387 0.521,0.631 1.147,0.946 1.881,0.946 0.793,0 1.408,-0.281 1.847,-0.845 0.44,-0.566 0.66,-1.326 0.66,-2.279 l 0,-0.831 -4.335,0 0,-0.63 c 0,-0.733 0.176,-1.344 0.525,-1.831 0.35,-0.488 0.826,-0.73 1.422,-0.73 0.414,0 0.775,0.073 1.075,0.217 0.301,0.147 0.558,0.353 0.773,0.624 L 2.311,-6.16 C 2.083,-6.45 1.786,-6.685 1.424,-6.858 1.063,-7.031 0.627,-7.12 0.119,-7.12" /></g><g
- transform="translate(119.8403,17.4268)"
- id="g3390"><path
- id="path3392"
- style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c -0.528,0 -0.962,-0.24 -1.301,-0.72 -0.337,-0.481 -0.513,-1.074 -0.528,-1.781 l 3.495,0 0,0.324 c 0,0.625 -0.146,1.146 -0.442,1.559 C 0.93,-0.205 0.522,0 0,0 m 0.118,-7.12 c -0.817,0 -1.484,0.307 -2.001,0.921 -0.52,0.612 -0.78,1.395 -0.78,2.349 l 0,1.258 c 0,0.956 0.262,1.753 0.78,2.387 C -1.36,0.426 -0.734,0.741 0,0.741 0.792,0.741 1.409,0.46 1.847,-0.104 2.286,-0.67 2.505,-1.43 2.505,-2.383 l 0,-0.831 -4.334,0 0,-0.63 c 0,-0.733 0.176,-1.344 0.527,-1.831 0.348,-0.488 0.822,-0.73 1.42,-0.73 0.416,0 0.775,0.073 1.074,0.217 0.302,0.147 0.559,0.353 0.776,0.624 L 2.31,-6.16 C 2.081,-6.45 1.786,-6.685 1.423,-6.858 1.063,-7.031 0.627,-7.12 0.118,-7.12" /></g><g
- transform="translate(124.5659,18.0273)"
- id="g3394"><path
- id="path3396"
- style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 0.069,-1.252 c 0.202,0.444 0.469,0.789 0.804,1.029 0.332,0.242 0.723,0.364 1.172,0.364 0.677,0 1.196,-0.25 1.556,-0.753 0.363,-0.502 0.544,-1.283 0.544,-2.341 l 0,-4.621 -0.847,0 0,4.613 c 0,0.865 -0.127,1.47 -0.379,1.82 -0.251,0.351 -0.619,0.526 -1.098,0.526 -0.43,0 -0.791,-0.14 -1.08,-0.424 C 0.451,-1.32 0.234,-1.695 0.09,-2.168 l 0,-5.406 -0.84,0 L -0.75,0 0,0 Z" /></g><g
- transform="translate(131.1768,13.5771)"
- id="g3398"><path
- id="path3400"
- style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c 0,-0.769 0.146,-1.38 0.441,-1.835 0.292,-0.459 0.736,-0.686 1.33,-0.686 0.406,0 0.748,0.109 1.029,0.331 0.28,0.221 0.501,0.53 0.664,0.921 l 0,3.752 C 3.307,2.887 3.091,3.213 2.818,3.464 2.545,3.711 2.2,3.835 1.785,3.835 1.193,3.835 0.746,3.577 0.448,3.06 0.149,2.541 0,1.865 0,1.035 L 0,0 Z m -0.849,1.035 c 0,1.073 0.217,1.936 0.652,2.585 0.432,0.647 1.033,0.971 1.8,0.971 0.425,0 0.798,-0.104 1.117,-0.312 C 3.039,4.075 3.303,3.776 3.515,3.396 l 0.082,1.054 0.714,0 0,-7.581 c 0,-0.971 -0.226,-1.723 -0.678,-2.255 -0.452,-0.53 -1.095,-0.799 -1.926,-0.799 -0.298,0 -0.619,0.047 -0.962,0.138 -0.344,0.091 -0.648,0.21 -0.915,0.359 l 0.233,0.739 c 0.227,-0.148 0.481,-0.262 0.763,-0.342 0.279,-0.083 0.568,-0.123 0.867,-0.123 0.602,0 1.049,0.193 1.337,0.579 0.289,0.391 0.434,0.956 0.434,1.704 l 0,0.916 C 3.25,-2.556 2.986,-2.817 2.673,-2.998 2.362,-3.18 1.998,-3.271 1.588,-3.271 c -0.761,0 -1.358,0.298 -1.789,0.894 -0.431,0.595 -0.648,1.388 -0.648,2.377 l 0,1.035 z" /></g><path
- id="path3402"
- style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 138.318,10.453 -0.848,0 0,7.574 0.848,0 0,-7.574 z m 0,9.731 -0.848,0 0,1.193 0.848,0 0,-1.193 z" /><g
- transform="translate(141.0552,18.0273)"
- id="g3404"><path
- id="path3406"
- style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 0.069,-1.252 c 0.202,0.444 0.468,0.789 0.803,1.029 0.334,0.242 0.725,0.364 1.173,0.364 0.677,0 1.197,-0.25 1.558,-0.753 0.363,-0.502 0.542,-1.283 0.542,-2.341 l 0,-4.621 -0.847,0 0,4.613 c 0,0.865 -0.127,1.47 -0.378,1.82 -0.253,0.351 -0.618,0.526 -1.099,0.526 -0.43,0 -0.79,-0.14 -1.079,-0.424 C 0.453,-1.32 0.235,-1.695 0.092,-2.168 l 0,-5.406 -0.842,0 L -0.75,0 0,0 Z" /></g><g
- transform="translate(149.4155,17.4268)"
- id="g3408"><path
- id="path3410"
- style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c -0.528,0 -0.961,-0.24 -1.299,-0.72 -0.338,-0.481 -0.514,-1.074 -0.53,-1.781 l 3.495,0 0,0.324 c 0,0.625 -0.145,1.146 -0.44,1.559 C 0.932,-0.205 0.523,0 0,0 m 0.12,-7.12 c -0.819,0 -1.486,0.307 -2.002,0.921 -0.518,0.612 -0.778,1.395 -0.778,2.349 l 0,1.258 c 0,0.956 0.26,1.753 0.78,2.387 0.521,0.631 1.148,0.946 1.88,0.946 0.793,0 1.41,-0.281 1.85,-0.845 0.438,-0.566 0.657,-1.326 0.657,-2.279 l 0,-0.831 -4.336,0 0,-0.63 c 0,-0.733 0.177,-1.344 0.527,-1.831 0.349,-0.488 0.823,-0.73 1.422,-0.73 0.414,0 0.773,0.073 1.072,0.217 0.304,0.147 0.56,0.353 0.777,0.624 L 2.313,-6.16 C 2.082,-6.45 1.787,-6.685 1.425,-6.858 1.064,-7.031 0.628,-7.12 0.12,-7.12" /></g><g
- transform="translate(64.312,21.7949)"
- id="g3412"><path
- id="path3414"
- style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 0,-3.942 c 0,-0.39 -0.25,-0.734 -0.621,-0.852 L -6.835,-6.8 c -0.273,-0.091 -0.57,-0.042 -0.8,0.128 -0.232,0.168 -0.37,0.437 -0.37,0.721 l 0,4.305 -5.818,-1.108 0,-4.381 c 0,-0.447 -0.332,-0.824 -0.775,-0.885 l -8.41,-1.152 c -0.039,-0.003 -0.081,-0.008 -0.121,-0.008 -0.214,0 -0.424,0.078 -0.588,0.22 -0.195,0.172 -0.306,0.416 -0.306,0.676 l 0,4.638 -4.341,-0.018 0,-10e-4 -0.318,10e-4 -0.319,-10e-4 0,10e-4 -4.34,0.018 0,-4.638 c 0,-0.26 -0.112,-0.504 -0.307,-0.676 -0.164,-0.142 -0.374,-0.22 -0.587,-0.22 -0.041,0 -0.082,0.005 -0.123,0.008 l -8.41,1.152 c -0.442,0.061 -0.774,0.438 -0.774,0.885 l 0,4.381 -5.819,1.108 0,-4.305 c 0,-0.284 -0.137,-0.553 -0.368,-0.721 -0.232,-0.17 -0.529,-0.219 -0.802,-0.128 l -6.215,2.006 c -0.369,0.118 -0.619,0.462 -0.619,0.852 l 0,3.942 -3.837,1.29 c -0.19,-0.811 -0.295,-1.642 -0.295,-2.481 0,-10.301 14.512,-18.252 32.448,-18.309 l 0.022,0 0.023,0 c 17.936,0.057 32.448,8.008 32.448,18.309 0,0.766 -0.088,1.521 -0.247,2.266 L 0,0 Z" /></g><g
- transform="translate(5.9634,40.0615)"
- id="g3416"><path
- id="path3418"
- style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 0,-16.047 2.163,-0.729 c 0.364,-0.122 0.61,-0.462 0.61,-0.847 l 0,-3.936 4.426,-1.428 0,4.154 c 0,0.27 0.118,0.52 0.323,0.689 0.206,0.172 0.474,0.241 0.739,0.192 l 7.608,-1.452 c 0.422,-0.079 0.728,-0.448 0.728,-0.877 l 0,-4.338 6.62,-0.904 0,4.509 c 0,0.241 0.096,0.467 0.264,0.635 0.167,0.166 0.394,0.259 0.633,0.259 l 0.002,0 5.551,-0.022 5.549,0.022 c 0.245,-10e-4 0.468,-0.093 0.635,-0.259 0.169,-0.168 0.264,-0.394 0.264,-0.635 l 0,-4.509 6.621,0.904 0,4.338 c 0,0.429 0.304,0.798 0.726,0.877 l 7.609,1.452 c 0.262,0.049 0.533,-0.02 0.738,-0.192 0.205,-0.169 0.325,-0.419 0.325,-0.689 l 0,-4.154 4.425,1.428 0,3.936 c 0,0.385 0.245,0.725 0.609,0.847 l 1.475,0.497 0,16.279 0.04,0 c 1.437,1.834 2.767,3.767 4.042,5.828 -1.694,2.883 -3.768,5.459 -5.986,7.846 -2.057,-1.035 -4.055,-2.208 -5.942,-3.456 -0.944,0.938 -2.008,1.706 -3.052,2.509 -1.027,0.824 -2.183,1.428 -3.281,2.132 0.327,2.433 0.489,4.828 0.554,7.327 -2.831,1.424 -5.85,2.369 -8.903,3.047 -1.219,-2.048 -2.334,-4.267 -3.304,-6.436 -1.152,0.192 -2.309,0.264 -3.467,0.277 l 0,0.002 c -0.008,0 -0.015,-0.002 -0.022,-0.002 -0.008,0 -0.015,0.002 -0.022,0.002 l 0,-0.002 c -1.16,-0.013 -2.316,-0.085 -3.468,-0.277 -0.97,2.169 -2.084,4.388 -3.305,6.436 C 19.475,24.555 16.456,23.61 13.626,22.186 13.69,19.687 13.852,17.292 14.18,14.859 13.081,14.155 11.925,13.551 10.898,12.727 9.855,11.924 8.79,11.156 7.846,10.218 5.958,11.466 3.961,12.639 1.904,13.674 -0.314,11.287 -2.388,8.711 -4.082,5.828 -2.807,3.767 -1.477,1.834 -0.04,0 L 0,0 Z" /></g><g
- transform="translate(26.8428,32.3604)"
- id="g3420"><path
- id="path3422"
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c 0,-3.611 -2.926,-6.537 -6.537,-6.537 -3.608,0 -6.535,2.926 -6.535,6.537 0,3.609 2.927,6.533 6.535,6.533 C -2.926,6.533 0,3.609 0,0" /></g><g
- transform="translate(25.27,31.9727)"
- id="g3424"><path
- id="path3426"
- style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c 0,-2.396 -1.941,-4.337 -4.339,-4.337 -2.396,0 -4.339,1.941 -4.339,4.337 0,2.396 1.943,4.339 4.339,4.339 C -1.941,4.339 0,2.396 0,0" /></g><g
- transform="translate(35.6816,25.2285)"
- id="g3428"><path
- id="path3430"
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c -1.162,0 -2.104,0.856 -2.104,1.912 l 0,6.018 c 0,1.054 0.942,1.912 2.104,1.912 1.162,0 2.106,-0.858 2.106,-1.912 l 0,-6.018 C 2.106,0.856 1.162,0 0,0" /></g><g
- transform="translate(44.5215,32.3604)"
- id="g3432"><path
- id="path3434"
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c 0,-3.611 2.926,-6.537 6.537,-6.537 3.609,0 6.535,2.926 6.535,6.537 0,3.609 -2.926,6.533 -6.535,6.533 C 2.926,6.533 0,3.609 0,0" /></g><g
- transform="translate(46.0947,31.9727)"
- id="g3436"><path
- id="path3438"
- style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 0,0 c 0,-2.396 1.941,-4.337 4.336,-4.337 2.398,0 4.339,1.941 4.339,4.337 0,2.396 -1.941,4.339 -4.339,4.339 C 1.941,4.339 0,2.396 0,0" /></g></g></g></g></svg> \ No newline at end of file
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
+ id="defs6"><clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath16"><path
+ d="M 0,595.276 H 841.89 V 0 H 0 Z"
+ id="path18"
+ inkscape:connector-curvature="0" /></clipPath></defs><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1011"
+ id="namedview4"
+ showgrid="false"
+ inkscape:zoom="0.63432763"
+ inkscape:cx="166.44059"
+ inkscape:cy="101.14582"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g14"
+ fit-margin-top="48"
+ fit-margin-left="48"
+ fit-margin-right="48"
+ fit-margin-bottom="48" /><g
+ id="g10"
+ inkscape:groupmode="layer"
+ inkscape:label="godot_engine_logo_2017_curves-01"
+ transform="matrix(1.25,0,0,-1.25,-94.249997,597.49874)"><g
+ id="g12"><g
+ id="g14"
+ clip-path="url(#clipPath16)"><g
+ id="g20"
+ transform="matrix(1.1310535,0,0,1.1310535,531.44953,355.31567)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c -3.611,0 -6.636,-1.659 -9.09,-4.967 -2.441,-3.311 -3.668,-7.958 -3.668,-13.938 0,-5.993 1.166,-10.581 3.503,-13.778 2.333,-3.207 5.398,-4.804 9.2,-4.804 3.8,0 6.887,1.617 9.258,4.862 2.371,3.233 3.559,7.861 3.559,13.886 0,6.02 -1.227,10.654 -3.673,13.89 C 6.646,-1.617 3.616,0 0,0 m -0.055,-59.493 c -10.573,0 -19.195,3.46 -25.859,10.379 -6.655,6.925 -9.984,17.03 -9.984,30.314 0,13.292 3.367,23.356 10.101,30.209 6.736,6.844 15.431,10.269 26.082,10.269 10.649,0 19.251,-3.363 25.794,-10.109 6.555,-6.733 9.827,-16.94 9.827,-30.591 0,-13.661 -3.348,-23.822 -10.05,-30.49 -6.702,-6.654 -15.333,-9.981 -25.911,-9.981"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path22"
+ inkscape:connector-curvature="0" /></g><g
+ id="g24"
+ transform="matrix(1.1310535,0,0,1.1310535,607.8515,354.43097)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 v -33.768 c 0,-1.577 0.116,-2.571 0.342,-2.988 0.224,-0.415 0.903,-0.623 2.029,-0.623 4.144,0 7.283,1.548 9.429,4.634 2.151,3.083 3.215,8.216 3.215,15.405 0,7.192 -1.113,11.878 -3.325,14.055 C 9.467,-1.102 5.946,0 1.129,0 Z m -21.675,-52.392 v 67.735 c 0,1.883 0.468,3.369 1.413,4.471 0.939,1.085 2.161,1.636 3.671,1.636 H 2.263 c 11.965,0 21.053,-3.018 27.257,-9.04 6.215,-6.02 9.322,-15.499 9.322,-28.447 0,-27.7 -11.821,-41.547 -35.456,-41.547 h -19.302 c -3.836,0 -5.759,1.727 -5.759,5.192"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path26"
+ inkscape:connector-curvature="0" /></g><g
+ id="g28"
+ transform="matrix(1.1310535,0,0,1.1310535,700.81066,355.31567)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c -3.612,0 -6.645,-1.659 -9.095,-4.967 -2.44,-3.311 -3.662,-7.958 -3.662,-13.938 0,-5.993 1.169,-10.581 3.499,-13.778 2.33,-3.207 5.398,-4.804 9.2,-4.804 3.801,0 6.89,1.617 9.258,4.862 2.372,3.233 3.56,7.861 3.56,13.886 0,6.02 -1.225,10.654 -3.671,13.89 C 6.642,-1.617 3.616,0 0,0 m -0.058,-59.493 c -10.577,0 -19.193,3.46 -25.851,10.379 -6.663,6.925 -9.993,17.03 -9.993,30.314 0,13.292 3.367,23.356 10.1,30.209 6.741,6.844 15.431,10.269 26.086,10.269 10.651,0 19.246,-3.363 25.797,-10.109 6.55,-6.733 9.822,-16.94 9.822,-30.591 0,-13.661 -3.349,-23.822 -10.05,-30.49 -6.699,-6.654 -15.338,-9.981 -25.911,-9.981"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path30"
+ inkscape:connector-curvature="0" /></g><g
+ id="g32"
+ transform="matrix(1.1310535,0,0,1.1310535,789.01132,291.33514)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c 0,-1.496 -3.721,-2.255 -11.176,-2.255 -7.448,0 -11.18,0.759 -11.18,2.255 v 56.681 h -13.545 c -1.281,0 -2.185,1.727 -2.71,5.198 -0.226,1.652 -0.334,3.343 -0.334,5.077 0,1.724 0.108,3.422 0.334,5.077 0.525,3.462 1.429,5.202 2.71,5.202 h 49.112 c 1.279,0 2.179,-1.74 2.712,-5.202 0.221,-1.655 0.335,-3.353 0.335,-5.077 0,-1.734 -0.114,-3.425 -0.335,-5.077 C 15.39,58.408 14.49,56.681 13.211,56.681 H 0 Z"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path34"
+ inkscape:connector-curvature="0" /></g><g
+ id="g36"
+ transform="matrix(1.1310535,0,0,1.1310535,468.26549,336.71278)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c -6.078,0.094 -13.034,-1.173 -13.034,-1.173 v -11.863 h 6.995 l -0.078,-5.288 c 0,-1.959 -1.942,-2.943 -5.815,-2.943 -3.878,0 -7.303,1.642 -10.274,4.917 -2.978,3.279 -4.459,8.072 -4.459,14.388 0,6.329 1.447,10.995 4.345,14.006 2.892,3.008 6.683,4.517 11.346,4.517 1.959,0 3.987,-0.316 6.096,-0.961 2.11,-0.639 3.519,-1.238 4.238,-1.799 0.713,-0.577 1.391,-0.85 2.032,-0.85 0.638,0 1.671,0.746 3.1,2.255 1.431,1.505 2.713,3.786 3.844,6.827 1.126,3.057 1.69,5.4 1.69,7.062 0,1.649 -0.036,2.786 -0.109,3.386 -1.581,1.73 -4.499,3.102 -8.755,4.122 -4.248,1.017 -9.011,1.522 -14.28,1.522 -11.594,0 -20.66,-3.65 -27.207,-10.95 -6.552,-7.303 -9.822,-16.783 -9.822,-28.452 0,-13.701 3.347,-24.087 10.041,-31.162 6.706,-7.074 15.51,-10.607 26.425,-10.607 5.87,0 11.08,0.505 15.632,1.522 4.557,1.013 7.586,2.053 9.093,3.105 l 0.452,35.33 C 11.496,-1.036 6.078,-0.104 0,0"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path38"
+ inkscape:connector-curvature="0" /></g><g
+ id="g40"
+ transform="matrix(1.1310535,0,0,1.1310535,441.34721,235.75121)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c -0.624,-1.28 -1.771,-2.454 -3.449,-3.516 -1.676,-1.069 -3.805,-1.6 -6.391,-1.6 -3.412,0 -6.156,1.075 -8.24,3.249 -2.076,2.157 -3.116,5.266 -3.116,9.323 v 10.116 c 0,3.969 0.98,7.013 2.946,9.138 1.962,2.108 4.59,3.177 7.872,3.177 3.208,0 5.695,-0.844 7.455,-2.513 1.755,-1.675 2.677,-4.015 2.757,-7.003 L -0.21,20.238 h -2.619 c -0.094,2.29 -0.759,4.057 -2.01,5.305 -1.244,1.238 -3.095,1.864 -5.539,1.864 -2.473,0 -4.432,-0.837 -5.866,-2.516 -1.43,-1.675 -2.143,-4.103 -2.143,-7.293 V 7.424 c 0,-3.308 0.771,-5.83 2.311,-7.567 1.54,-1.724 3.616,-2.588 6.236,-2.588 1.913,0 3.451,0.339 4.602,1.033 1.155,0.684 1.956,1.519 2.409,2.51 v 8.861 h -7.06 v 2.463 H 0 Z"
+ style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path42"
+ inkscape:connector-curvature="0" /></g><g
+ id="g44"
+ transform="matrix(1.1310535,0,0,1.1310535,456.01527,232.82495)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c 1.553,0 2.936,0.44 4.144,1.336 1.21,0.9 2.058,2.037 2.561,3.422 v 5.468 H 2.213 c -1.91,0 -3.44,-0.541 -4.585,-1.623 C -3.52,7.528 -4.088,6.185 -4.088,4.588 -4.088,3.239 -3.733,2.131 -3.014,1.277 -2.296,0.42 -1.292,0 0,0 M 7.124,-2.04 C 6.984,-1.164 6.875,-0.453 6.806,0.104 6.739,0.671 6.705,1.235 6.705,1.808 5.938,0.554 4.948,-0.486 3.725,-1.301 2.504,-2.122 1.146,-2.529 -0.35,-2.529 c -2.092,0 -3.701,0.648 -4.84,1.946 -1.132,1.303 -1.704,3.059 -1.704,5.276 0,2.343 0.823,4.223 2.473,5.618 1.649,1.395 3.89,2.092 6.709,2.092 h 4.417 v 3.106 c 0,1.786 -0.456,3.193 -1.351,4.21 -0.914,1.004 -2.17,1.512 -3.791,1.512 -1.508,0 -2.752,-0.479 -3.728,-1.45 -0.973,-0.965 -1.456,-2.144 -1.456,-3.549 l -2.623,0.023 -0.046,0.137 c -0.074,1.906 0.647,3.591 2.168,5.084 1.515,1.489 3.459,2.229 5.825,2.229 2.338,0 4.22,-0.711 5.657,-2.128 1.429,-1.431 2.146,-3.471 2.146,-6.124 V 3.057 c 0,-0.903 0.042,-1.78 0.121,-2.617 0.081,-0.848 0.212,-1.665 0.417,-2.48 z"
+ style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path46"
+ inkscape:connector-curvature="0" /></g><g
+ id="g48"
+ transform="matrix(1.1310535,0,0,1.1310535,476.7303,259.10521)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 0.24,-3.923 c 0.664,1.404 1.554,2.486 2.657,3.255 1.107,0.759 2.41,1.138 3.906,1.138 1.527,0 2.814,-0.444 3.852,-1.343 1.039,-0.896 1.805,-2.252 2.292,-4.074 0.623,1.682 1.505,3.011 2.65,3.973 1.145,0.964 2.534,1.444 4.143,1.444 2.217,0 3.937,-0.897 5.156,-2.692 1.224,-1.799 1.834,-4.559 1.834,-8.288 v -14.765 h -2.823 v 14.814 c 0,3.1 -0.429,5.283 -1.263,6.538 -0.839,1.257 -2.042,1.89 -3.598,1.89 -1.637,0 -2.915,-0.691 -3.834,-2.096 -0.914,-1.405 -1.478,-3.161 -1.683,-5.282 v -0.655 -15.209 H 10.72 v 14.798 c 0,3.027 -0.424,5.194 -1.292,6.488 -0.864,1.294 -2.066,1.936 -3.609,1.936 -1.475,0 -2.668,-0.45 -3.562,-1.342 -0.9,-0.897 -1.54,-2.125 -1.928,-3.683 V -25.275 H -2.477 V 0 Z"
+ style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path50"
+ inkscape:connector-curvature="0" /></g><g
+ id="g52"
+ transform="matrix(1.1310535,0,0,1.1310535,522.82277,256.83868)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c -1.758,0 -3.202,-0.802 -4.334,-2.402 -1.133,-1.606 -1.718,-3.585 -1.765,-5.944 h 11.66 v 1.082 c 0,2.086 -0.489,3.823 -1.469,5.201 C 3.106,-0.684 1.745,0 0,0 m 0.397,-23.76 c -2.725,0 -4.954,1.026 -6.685,3.073 -1.726,2.043 -2.591,4.657 -2.591,7.841 v 4.197 c 0,3.19 0.867,5.85 2.602,7.965 1.739,2.105 3.828,3.158 6.277,3.158 2.648,0 4.699,-0.939 6.164,-2.823 1.468,-1.887 2.201,-4.422 2.201,-7.603 v -2.773 H -6.099 v -2.102 c 0,-2.447 0.586,-4.484 1.752,-6.11 1.168,-1.63 2.755,-2.438 4.744,-2.438 1.382,0 2.585,0.244 3.588,0.724 1.003,0.491 1.863,1.179 2.578,2.082 l 1.149,-1.988 C 6.949,-21.525 5.96,-22.307 4.753,-22.887 3.549,-23.464 2.094,-23.76 0.397,-23.76"
+ style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path54"
+ inkscape:connector-curvature="0" /></g><g
+ id="g56"
+ transform="matrix(1.1310535,0,0,1.1310535,558.0805,256.83868)"
+ style="stroke-width:0.88413143"><path
+ d="M 0,0 C -1.763,0 -3.21,-0.802 -4.341,-2.402 -5.467,-4.008 -6.053,-5.987 -6.104,-8.346 H 5.559 v 1.082 c 0,2.086 -0.488,3.823 -1.474,5.201 C 3.104,-0.684 1.744,0 0,0 m 0.394,-23.76 c -2.726,0 -4.951,1.026 -6.679,3.073 -1.733,2.043 -2.6,4.657 -2.6,7.841 v 4.197 c 0,3.19 0.871,5.85 2.602,7.965 1.744,2.105 3.834,3.158 6.283,3.158 2.643,0 4.703,-0.939 6.164,-2.823 1.463,-1.887 2.197,-4.422 2.197,-7.603 v -2.773 H -6.104 v -2.102 c 0,-2.447 0.587,-4.484 1.76,-6.11 1.162,-1.63 2.742,-2.438 4.738,-2.438 1.387,0 2.585,0.244 3.585,0.724 1.007,0.491 1.866,1.179 2.589,2.082 l 1.141,-1.988 c -0.764,-0.968 -1.75,-1.75 -2.959,-2.33 -1.204,-0.577 -2.658,-0.873 -4.356,-0.873"
+ style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path58"
+ inkscape:connector-curvature="0" /></g><g
+ id="g60"
+ transform="matrix(1.1310535,0,0,1.1310535,575.91679,259.10521)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 0.23,-4.178 c 0.674,1.483 1.564,2.634 2.682,3.435 1.108,0.805 2.413,1.213 3.914,1.213 2.258,0 3.988,-0.835 5.189,-2.513 1.214,-1.675 1.815,-4.279 1.815,-7.812 v -15.42 h -2.825 v 15.394 c 0,2.888 -0.423,4.905 -1.264,6.075 -0.836,1.17 -2.065,1.753 -3.665,1.753 -1.435,0 -2.638,-0.466 -3.603,-1.414 C 1.504,-4.406 0.782,-5.657 0.301,-7.234 V -25.275 H -2.504 V 0 Z"
+ style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path62"
+ inkscape:connector-curvature="0" /></g><g
+ id="g64"
+ transform="matrix(1.1310535,0,0,1.1310535,600.8685,242.30884)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c 0,-2.565 0.486,-4.605 1.472,-6.123 0.974,-1.532 2.457,-2.288 4.436,-2.288 1.356,0 2.498,0.361 3.435,1.101 0.934,0.74 1.672,1.77 2.218,3.077 v 12.52 c -0.525,1.346 -1.246,2.434 -2.157,3.272 -0.91,0.824 -2.062,1.238 -3.448,1.238 -1.975,0 -3.468,-0.86 -4.46,-2.587 C 0.497,8.48 0,6.224 0,3.454 Z m -2.833,3.454 c 0,3.582 0.723,6.459 2.177,8.627 1.442,2.157 3.448,3.239 6.004,3.239 1.419,0 2.664,-0.346 3.728,-1.04 1.066,-0.681 1.947,-1.678 2.654,-2.946 l 0.274,3.516 h 2.381 v -25.298 c 0,-3.239 -0.751,-5.749 -2.26,-7.525 -1.511,-1.769 -3.657,-2.665 -6.428,-2.665 -0.996,0 -2.067,0.156 -3.212,0.459 -1.147,0.303 -2.162,0.701 -3.052,1.2 l 0.776,2.463 c 0.759,-0.492 1.608,-0.873 2.548,-1.141 0.932,-0.277 1.895,-0.41 2.894,-0.41 2.009,0 3.498,0.645 4.46,1.932 0.966,1.304 1.45,3.19 1.45,5.687 v 3.057 c -0.717,-1.138 -1.597,-2.011 -2.64,-2.614 -1.039,-0.606 -2.253,-0.909 -3.622,-0.909 -2.539,0 -4.53,0.994 -5.968,2.982 C -2.11,-5.948 -2.833,-3.301 -2.833,0 Z"
+ style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path66"
+ inkscape:connector-curvature="0" /></g><path
+ d="m 627.82321,230.5176 h -3.20089 v 28.58738 h 3.20089 z m 0,36.72644 h -3.20089 v 4.50385 h 3.20089 z"
+ style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994"
+ id="path68"
+ inkscape:connector-curvature="0" /><g
+ id="g70"
+ transform="matrix(1.1310535,0,0,1.1310535,638.15379,259.10521)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 0.23,-4.178 c 0.676,1.483 1.562,2.634 2.678,3.435 1.115,0.805 2.422,1.213 3.916,1.213 2.258,0 3.995,-0.835 5.199,-2.513 1.211,-1.675 1.807,-4.279 1.807,-7.812 v -15.42 h -2.825 v 15.394 c 0,2.888 -0.422,4.905 -1.261,6.075 -0.843,1.17 -2.063,1.753 -3.668,1.753 -1.434,0 -2.635,-0.466 -3.599,-1.414 C 1.51,-4.406 0.785,-5.657 0.306,-7.234 V -25.275 H -2.503 V 0 Z"
+ style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path72"
+ inkscape:connector-curvature="0" /></g><g
+ id="g74"
+ transform="matrix(1.1310535,0,0,1.1310535,669.70883,256.83868)"
+ style="stroke-width:0.88413143"><path
+ d="M 0,0 C -1.763,0 -3.208,-0.802 -4.334,-2.402 -5.463,-4.008 -6.052,-5.987 -6.102,-8.346 H 5.56 v 1.082 c 0,2.086 -0.486,3.823 -1.47,5.201 C 3.109,-0.684 1.747,0 0,0 m 0.401,-23.76 c -2.733,0 -4.958,1.026 -6.681,3.073 -1.73,2.043 -2.595,4.657 -2.595,7.841 v 4.197 c 0,3.19 0.865,5.85 2.6,7.965 1.739,2.105 3.831,3.158 6.275,3.158 2.646,0 4.706,-0.939 6.172,-2.823 1.462,-1.887 2.195,-4.422 2.195,-7.603 v -2.773 H -6.102 v -2.102 c 0,-2.447 0.59,-4.484 1.757,-6.11 1.166,-1.63 2.748,-2.438 4.746,-2.438 1.382,0 2.579,0.244 3.578,0.724 1.012,0.491 1.869,1.179 2.591,2.082 l 1.147,-1.988 c -0.769,-0.968 -1.755,-1.75 -2.962,-2.33 -1.203,-0.577 -2.658,-0.873 -4.354,-0.873"
+ style="fill:#6d6e71;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path76"
+ inkscape:connector-curvature="0" /></g><g
+ id="g78"
+ transform="matrix(1.1310535,0,0,1.1310535,348.13109,279.2668)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c 0,0 -0.325,1.994 -0.515,1.976 l -36.182,-3.491 c -2.879,-0.278 -5.115,-2.574 -5.317,-5.459 l -0.994,-14.247 -27.992,-1.997 -1.904,12.912 c -0.424,2.872 -2.932,5.037 -5.835,5.037 h -38.188 c -2.902,0 -5.41,-2.165 -5.834,-5.037 l -1.905,-12.912 -27.992,1.997 -0.994,14.247 c -0.202,2.886 -2.438,5.182 -5.317,5.46 l -36.2,3.49 c -0.187,0.018 -0.324,-1.978 -0.511,-1.978 l -0.049,-7.83 30.658,-4.944 1.004,-14.374 c 0.203,-2.91 2.551,-5.263 5.463,-5.472 l 38.551,-2.75 c 0.146,-0.01 0.29,-0.016 0.434,-0.016 2.897,0 5.401,2.166 5.825,5.038 l 1.959,13.286 h 28.005 l 1.959,-13.286 c 0.423,-2.871 2.93,-5.037 5.831,-5.037 0.142,0 0.284,0.005 0.423,0.015 l 38.556,2.75 c 2.911,0.209 5.26,2.562 5.463,5.472 l 1.003,14.374 30.645,4.966 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path80"
+ inkscape:connector-curvature="0" /></g><g
+ id="g82"
+ transform="matrix(1.1310535,0,0,1.1310535,126.80608,346.04533)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 v -47.514 -6.035 -5.492 c 0.108,-0.001 0.216,-0.005 0.323,-0.015 l 36.196,-3.49 c 1.896,-0.183 3.382,-1.709 3.514,-3.609 l 1.116,-15.978 31.574,-2.253 2.175,14.747 c 0.282,1.912 1.922,3.329 3.856,3.329 h 38.188 c 1.933,0 3.573,-1.417 3.855,-3.329 l 2.175,-14.747 31.575,2.253 1.115,15.978 c 0.133,1.9 1.618,3.425 3.514,3.609 l 36.182,3.49 c 0.107,0.01 0.214,0.014 0.322,0.015 v 4.711 l 0.015,0.005 V 0 h 0.134 c 4.795,6.12 9.232,12.569 13.487,19.449 -5.651,9.62 -12.575,18.217 -19.976,26.182 -6.864,-3.455 -13.531,-7.369 -19.828,-11.534 -3.151,3.132 -6.7,5.694 -10.186,8.372 -3.425,2.751 -7.285,4.768 -10.946,7.118 1.09,8.117 1.629,16.108 1.846,24.448 -9.446,4.754 -19.519,7.906 -29.708,10.17 -4.068,-6.837 -7.788,-14.241 -11.028,-21.479 -3.842,0.642 -7.702,0.88 -11.567,0.926 v 0.006 c -0.027,0 -0.052,-0.006 -0.075,-0.006 -0.024,0 -0.049,0.006 -0.073,0.006 V 63.652 C 93.903,63.606 90.046,63.368 86.203,62.726 82.965,69.964 79.247,77.368 75.173,84.205 64.989,81.941 54.915,78.789 45.47,74.035 45.686,65.695 46.225,57.704 47.318,49.587 43.65,47.237 39.795,45.22 36.369,42.469 32.888,39.791 29.333,37.229 26.181,34.097 19.884,38.262 13.219,42.176 6.353,45.631 -1.048,37.666 -7.968,29.069 -13.621,19.449 -9.368,12.569 -4.928,6.12 -0.134,0 Z"
+ style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path84"
+ inkscape:connector-curvature="0" /></g><g
+ id="g86"
+ transform="matrix(1.1310535,0,0,1.1310535,311.40329,266.88437)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 -1.121,-16.063 c -0.135,-1.936 -1.675,-3.477 -3.611,-3.616 l -38.555,-2.751 c -0.094,-0.007 -0.188,-0.01 -0.281,-0.01 -1.916,0 -3.569,1.406 -3.852,3.33 l -2.211,14.994 H -81.09 l -2.211,-14.994 c -0.297,-2.018 -2.101,-3.469 -4.133,-3.32 l -38.555,2.751 c -1.936,0.139 -3.476,1.68 -3.611,3.616 L -130.721,0 -163.268,3.138 c 0.015,-3.498 0.06,-7.33 0.06,-8.093 0,-34.374 43.605,-50.896 97.781,-51.086 h 0.066 0.067 c 54.176,0.19 97.766,16.712 97.766,51.086 0,0.777 0.047,4.593 0.063,8.093 z"
+ style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path88"
+ inkscape:connector-curvature="0" /></g><g
+ id="g90"
+ transform="matrix(1.1310535,0,0,1.1310535,204.11393,318.93771)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c 0,-12.052 -9.765,-21.815 -21.813,-21.815 -12.042,0 -21.81,9.763 -21.81,21.815 0,12.044 9.768,21.802 21.81,21.802 C -9.765,21.802 0,12.044 0,0"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path92"
+ inkscape:connector-curvature="0" /></g><g
+ id="g94"
+ transform="matrix(1.1310535,0,0,1.1310535,198.17748,317.47435)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c 0,-7.994 -6.479,-14.473 -14.479,-14.473 -7.996,0 -14.479,6.479 -14.479,14.473 0,7.994 6.483,14.479 14.479,14.479 C -6.479,14.479 0,7.994 0,0"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path96"
+ inkscape:connector-curvature="0" /></g><g
+ id="g98"
+ transform="matrix(1.1310535,0,0,1.1310535,237.47503,292.01909)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c -3.878,0 -7.021,2.858 -7.021,6.381 v 20.081 c 0,3.52 3.143,6.381 7.021,6.381 3.878,0 7.028,-2.861 7.028,-6.381 V 6.381 C 7.028,2.858 3.878,0 0,0"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path100"
+ inkscape:connector-curvature="0" /></g><g
+ id="g102"
+ transform="matrix(1.1310535,0,0,1.1310535,270.84021,318.93771)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c 0,-12.052 9.765,-21.815 21.815,-21.815 12.041,0 21.808,9.763 21.808,21.815 0,12.044 -9.767,21.802 -21.808,21.802 C 9.765,21.802 0,12.044 0,0"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path104"
+ inkscape:connector-curvature="0" /></g><g
+ id="g106"
+ transform="matrix(1.1310535,0,0,1.1310535,276.77813,317.47435)"
+ style="stroke-width:0.88413143"><path
+ d="m 0,0 c 0,-7.994 6.477,-14.473 14.471,-14.473 8.002,0 14.479,6.479 14.479,14.473 0,7.994 -6.477,14.479 -14.479,14.479 C 6.477,14.479 0,7.994 0,0"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.88413143"
+ id="path108"
+ inkscape:connector-curvature="0" /></g></g></g></g></svg> \ No newline at end of file
diff --git a/main/SCsub b/main/SCsub
index a09b7c4396..1675a6e6ab 100644
--- a/main/SCsub
+++ b/main/SCsub
@@ -2,11 +2,57 @@
Import('env')
+
+def make_splash(target, source, env):
+
+ src = source[0].srcnode().abspath
+ dst = target[0].srcnode().abspath
+ f = open(src, "rb")
+ g = open(dst, "wb")
+
+ buf = f.read()
+
+ g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
+ g.write("#ifndef BOOT_SPLASH_H\n")
+ g.write("#define BOOT_SPLASH_H\n")
+ g.write("static const Color boot_splash_bg_color = Color(1,1,1,1);\n");
+ g.write("static const unsigned char boot_splash_png[] = {\n")
+ for i in range(len(buf)):
+ g.write(str(ord(buf[i])) + ",\n")
+ g.write("};\n")
+ g.write("#endif")
+
+
+def make_app_icon(target, source, env):
+
+ src = source[0].srcnode().abspath
+ dst = target[0].srcnode().abspath
+ f = open(src, "rb")
+ g = open(dst, "wb")
+
+ buf = f.read()
+
+ g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
+ g.write("#ifndef APP_ICON_H\n")
+ g.write("#define APP_ICON_H\n")
+ g.write("static const unsigned char app_icon_png[] = {\n")
+ for i in range(len(buf)):
+ g.write(str(ord(buf[i])) + ",\n")
+ g.write("};\n")
+ g.write("#endif")
+
+
env.main_sources = []
env.add_source_files(env.main_sources, "*.cpp")
Export('env')
+env.Depends("#main/splash.gen.h", "#main/splash.png")
+env.Command("#main/splash.gen.h", "#main/splash.png", make_splash)
+
+env.Depends("#main/app_icon.gen.h", "#main/app_icon.png")
+env.Command("#main/app_icon.gen.h", "#main/app_icon.png", make_app_icon)
+
SConscript('tests/SCsub')
lib = env.Library("main", env.main_sources)
diff --git a/main/app_icon.png b/main/app_icon.png
new file mode 100644
index 0000000000..1d75cdc710
--- /dev/null
+++ b/main/app_icon.png
Binary files differ
diff --git a/main/input_default.cpp b/main/input_default.cpp
index 125bd8c8d7..d496717460 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -114,19 +115,19 @@ bool InputDefault::is_action_pressed(const StringName &p_action) const {
case InputEvent::KEY: {
const InputEventKey &iek=E->get().key;
- if ((keys_pressed.has(iek.scancode)))
+ if ((keys_pressed.has(iek->get_scancode())))
return true;
} break;
case InputEvent::MOUSE_BUTTON: {
const InputEventMouseButton &iemb=E->get().mouse_button;
- if(mouse_button_mask&(1<<iemb.button_index))
+ if(mouse_button_mask&(1<<iemb->get_button_index()))
return true;
} break;
case InputEvent::JOYPAD_BUTTON: {
const InputEventJoypadButton &iejb=E->get().joy_button;
- int c = _combine_device(iejb.button_index,device);
+ int c = _combine_device(iejb->get_button_index(),device);
if (joy_buttons_pressed.has(c))
return true;
} break;
@@ -296,94 +297,86 @@ Vector3 InputDefault::get_gyroscope() const {
return gyroscope;
}
-void InputDefault::parse_input_event(const InputEvent &p_event) {
+void InputDefault::parse_input_event(const Ref<InputEvent> &p_event) {
_THREAD_SAFE_METHOD_
- switch (p_event.type) {
-
- case InputEvent::KEY: {
-
- if (p_event.key.echo)
- break;
- if (p_event.key.scancode == 0)
- break;
-
- //print_line(p_event);
-
- if (p_event.key.pressed)
- keys_pressed.insert(p_event.key.scancode);
- else
- keys_pressed.erase(p_event.key.scancode);
- } break;
- case InputEvent::MOUSE_BUTTON: {
-
- if (p_event.mouse_button.doubleclick)
- break;
-
- if (p_event.mouse_button.pressed)
- mouse_button_mask |= (1 << p_event.mouse_button.button_index);
- else
- mouse_button_mask &= ~(1 << p_event.mouse_button.button_index);
-
- if (main_loop && emulate_touch && p_event.mouse_button.button_index == 1) {
- InputEventScreenTouch touch_event;
- touch_event.index = 0;
- touch_event.pressed = p_event.mouse_button.pressed;
- touch_event.x = p_event.mouse_button.x;
- touch_event.y = p_event.mouse_button.y;
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.screen_touch = touch_event;
- main_loop->input_event(ev);
- }
- Point2 pos = Point2(p_event.mouse_button.global_x, p_event.mouse_button.global_y);
- if (mouse_pos != pos) {
- set_mouse_pos(pos);
- }
- } break;
- case InputEvent::MOUSE_MOTION: {
-
- if (main_loop && emulate_touch && p_event.mouse_motion.button_mask & 1) {
- InputEventScreenDrag drag_event;
- drag_event.index = 0;
- drag_event.x = p_event.mouse_motion.x;
- drag_event.y = p_event.mouse_motion.y;
- drag_event.relative_x = p_event.mouse_motion.relative_x;
- drag_event.relative_y = p_event.mouse_motion.relative_y;
- drag_event.speed_x = p_event.mouse_motion.speed_x;
- drag_event.speed_y = p_event.mouse_motion.speed_y;
-
- InputEvent ev;
- ev.type = InputEvent::SCREEN_DRAG;
- ev.screen_drag = drag_event;
-
- main_loop->input_event(ev);
- }
+ Ref<InputEventKey> k = p_event;
+ if (k.is_valid() && !k->is_echo() && k->get_scancode() != 0) {
+
+ //print_line(p_event);
+
+ if (k->is_pressed())
+ keys_pressed.insert(k->get_scancode());
+ else
+ keys_pressed.erase(k->get_scancode());
+ }
+
+ Ref<InputEventMouseButton> mb = p_event;
- } break;
- case InputEvent::JOYPAD_BUTTON: {
+ if (mb.is_valid() && !mb->is_doubleclick()) {
+
+ if (mb->is_pressed())
+ mouse_button_mask |= (1 << mb->get_button_index());
+ else
+ mouse_button_mask &= ~(1 << mb->get_button_index());
+
+ if (main_loop && emulate_touch && mb->get_button_index() == 1) {
+ Ref<InputEventScreenTouch> touch_event;
+ touch_event.instance();
+ touch_event->set_pressed(mb->is_pressed());
+ touch_event->set_position(mb->get_position());
+ main_loop->input_event(touch_event);
+ }
+
+ Point2 pos = mb->get_global_position();
+ if (mouse_pos != pos) {
+ set_mouse_position(pos);
+ }
+ }
+
+ Ref<InputEventMouseMotion> mm = p_event;
+
+ if (mm.is_valid()) {
+
+ if (main_loop && emulate_touch && mm->get_button_mask() & 1) {
+ Ref<InputEventScreenDrag> drag_event;
+ drag_event.instance();
+
+ drag_event->set_position(mm->get_position());
+ drag_event->set_relative(mm->get_relative());
+ drag_event->set_speed(mm->get_speed());
+
+ main_loop->input_event(drag_event);
+ }
+ }
+
+ Ref<InputEventJoypadButton> jb = p_event;
+
+ if (jb.is_valid()) {
+
+ int c = _combine_device(jb->get_button_index(), jb->get_device());
+
+ if (jb->is_pressed())
+ joy_buttons_pressed.insert(c);
+ else
+ joy_buttons_pressed.erase(c);
+ }
- int c = _combine_device(p_event.joy_button.button_index, p_event.device);
+ Ref<InputEventJoypadMotion> jm = p_event;
- if (p_event.joy_button.pressed)
- joy_buttons_pressed.insert(c);
- else
- joy_buttons_pressed.erase(c);
- } break;
- case InputEvent::JOYPAD_MOTION: {
- set_joy_axis(p_event.device, p_event.joy_motion.axis, p_event.joy_motion.axis_value);
- } break;
+ if (jm.is_valid()) {
+ set_joy_axis(jm->get_device(), jm->get_axis(), jm->get_axis_value());
}
- if (!p_event.is_echo()) {
+ if (!p_event->is_echo()) {
for (const Map<StringName, InputMap::Action>::Element *E = InputMap::get_singleton()->get_action_map().front(); E; E = E->next()) {
- if (InputMap::get_singleton()->event_is_action(p_event, E->key()) && is_action_pressed(E->key()) != p_event.is_pressed()) {
+ if (InputMap::get_singleton()->event_is_action(p_event, E->key()) && is_action_pressed(E->key()) != p_event->is_pressed()) {
Action action;
action.fixed_frame = Engine::get_singleton()->get_fixed_frames();
action.idle_frame = Engine::get_singleton()->get_idle_frames();
- action.pressed = p_event.is_pressed();
+ action.pressed = p_event->is_pressed();
action_state[E->key()] = action;
}
}
@@ -455,16 +448,17 @@ void InputDefault::set_main_loop(MainLoop *p_main_loop) {
main_loop = p_main_loop;
}
-void InputDefault::set_mouse_pos(const Point2 &p_posf) {
+void InputDefault::set_mouse_position(const Point2 &p_posf) {
mouse_speed_track.update(p_posf - mouse_pos);
mouse_pos = p_posf;
if (custom_cursor.is_valid()) {
- VisualServer::get_singleton()->cursor_set_pos(get_mouse_pos());
+ //removed, please insist that we implement hardware cursors
+ // VisualServer::get_singleton()->cursor_set_pos(get_mouse_position());
}
}
-Point2 InputDefault::get_mouse_pos() const {
+Point2 InputDefault::get_mouse_position() const {
return mouse_pos;
}
@@ -483,14 +477,29 @@ void InputDefault::warp_mouse_pos(const Vector2 &p_to) {
OS::get_singleton()->warp_mouse_pos(p_to);
}
-Point2i InputDefault::warp_mouse_motion(const InputEventMouseMotion &p_motion, const Rect2 &p_rect) {
+Point2i InputDefault::warp_mouse_motion(const Ref<InputEventMouseMotion> &p_motion, const Rect2 &p_rect) {
+
+ // The relative distance reported for the next event after a warp is in the boundaries of the
+ // size of the rect on that axis, but it may be greater, in which case there's not problem as fmod()
+ // will warp it, but if the pointer has moved in the opposite direction between the pointer relocation
+ // and the subsequent event, the reported relative distance will be less than the size of the rect
+ // and thus fmod() will be disabled for handling the situation.
+ // And due to this mouse warping mechanism being stateless, we need to apply some heuristics to
+ // detect the warp: if the relative distance is greater than the half of the size of the relevant rect
+ // (checked per each axis), it will be considered as the consequence of a former pointer warp.
- const Point2i rel_warped(Math::fmod(p_motion.relative_x, p_rect.size.x), Math::fmod(p_motion.relative_y, p_rect.size.y));
- const Point2i pos_local = Point2i(p_motion.global_x, p_motion.global_y) - p_rect.pos;
+ const Point2i rel_sgn(p_motion->get_relative().x >= 0.0f ? 1 : -1, p_motion->get_relative().y >= 0.0 ? 1 : -1);
+ const Size2i warp_margin = p_rect.size * 0.5f;
+ const Point2i rel_warped(
+ Math::fmod(p_motion->get_relative().x + rel_sgn.x * warp_margin.x, p_rect.size.x) - rel_sgn.x * warp_margin.x,
+ Math::fmod(p_motion->get_relative().y + rel_sgn.y * warp_margin.y, p_rect.size.y) - rel_sgn.y * warp_margin.y);
+
+ const Point2i pos_local = p_motion->get_global_position() - p_rect.position;
const Point2i pos_warped(Math::fposmod(pos_local.x, p_rect.size.x), Math::fposmod(pos_local.y, p_rect.size.y));
if (pos_warped != pos_local) {
- OS::get_singleton()->warp_mouse_pos(pos_warped + p_rect.pos);
+ OS::get_singleton()->warp_mouse_pos(pos_warped + p_rect.position);
}
+
return rel_warped;
}
@@ -530,6 +539,7 @@ bool InputDefault::is_emulating_touchscreen() const {
}
void InputDefault::set_custom_mouse_cursor(const RES &p_cursor, const Vector2 &p_hotspot) {
+ /* no longer supported, leaving this for reference to anyone who might want to implement hardware cursors
if (custom_cursor == p_cursor)
return;
@@ -537,19 +547,21 @@ void InputDefault::set_custom_mouse_cursor(const RES &p_cursor, const Vector2 &p
if (p_cursor.is_null()) {
set_mouse_mode(MOUSE_MODE_VISIBLE);
- VisualServer::get_singleton()->cursor_set_visible(false);
+ //removed, please insist us to implement hardare cursors
+ //VisualServer::get_singleton()->cursor_set_visible(false);
} else {
Ref<AtlasTexture> atex = custom_cursor;
Rect2 region = atex.is_valid() ? atex->get_region() : Rect2();
set_mouse_mode(MOUSE_MODE_HIDDEN);
VisualServer::get_singleton()->cursor_set_visible(true);
VisualServer::get_singleton()->cursor_set_texture(custom_cursor->get_rid(), p_hotspot, 0, region);
- VisualServer::get_singleton()->cursor_set_pos(get_mouse_pos());
+ VisualServer::get_singleton()->cursor_set_pos(get_mouse_position());
}
+ */
}
void InputDefault::set_mouse_in_window(bool p_in_window) {
-
+ /* no longer supported, leaving this for reference to anyone who might want to implement hardware cursors
if (custom_cursor.is_valid()) {
if (p_in_window) {
@@ -560,6 +572,7 @@ void InputDefault::set_mouse_in_window(bool p_in_window) {
VisualServer::get_singleton()->cursor_set_visible(false);
}
}
+ */
}
// from github.com/gabomdq/SDL_GameControllerDB
@@ -571,6 +584,7 @@ static const char *s_ControllerMappings[] = {
"0d0f4900000000000000504944564944,Hatsune Miku Sho Controller,a:b1,b:b2,x:b0,y:b3,back:b8,guide:b12,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
"0d0f6e00000000000000504944564944,HORIPAD 4,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
"10080100000000000000504944564944,PS1 USB,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftshoulder:b6,rightshoulder:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b4,righttrigger:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,",
+ "100801e5000000000000504944564944,NEXT Classic USB Game Controller,a:b0,b:b1,back:b8,start:b9,rightx:a2,righty:a3,leftx:a0,lefty:a1,",
"10080300000000000000504944564944,PS2 USB,a:b2,b:b1,y:b0,x:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a4,righty:a2,lefttrigger:b4,righttrigger:b5,",
"10280900000000000000504944564944,8Bitdo SFC30 GamePad,a:b1,b:b0,y:b3,x:b4,start:b11,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,",
"20380900000000000000504944564944,8Bitdo NES30 PRO Wireless,a:b0,b:b1,x:b3,y:b4,leftshoulder:b6,rightshoulder:b7,lefttrigger:b8,righttrigger:b9,back:b10,start:b11,leftstick:b13,rightstick:b14,leftx:a0,lefty:a1,rightx:a3,righty:a4,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,",
@@ -581,25 +595,28 @@ static const char *s_ControllerMappings[] = {
"341a0108000000000000504944564944,EXEQ RF USB Gamepad 8206,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,leftstick:b8,rightstick:b7,back:b8,start:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
"341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
"36280100000000000000504944564944,OUYA Controller,a:b0,b:b3,y:b2,x:b1,start:b14,guide:b15,leftstick:b6,rightstick:b7,leftshoulder:b4,rightshoulder:b5,dpup:b8,dpleft:b10,dpdown:b9,dpright:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b12,righttrigger:b13,",
- "49190204000000000000504944564944,Ipega PG-9023,a:b0,b:b1,x:b3,y:b4,back:b10,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b8,righttrigger:b9",
+ "49190204000000000000504944564944,Ipega PG-9023,a:b0,b:b1,x:b3,y:b4,back:b10,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b8,righttrigger:b9,",
"4b12014d000000000000504944564944,NYKO AIRFLO,a:b0,b:b1,x:b2,y:b3,back:b8,guide:b10,start:b9,leftstick:a0,rightstick:a2,leftshoulder:a3,rightshoulder:b5,dpup:h0.1,dpdown:h0.0,dpleft:h0.8,dpright:h0.2,leftx:h0.6,lefty:h0.12,rightx:h0.9,righty:h0.4,lefttrigger:b6,righttrigger:b7,",
"4c056802000000000000504944564944,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
+ "4c05a00b000000000000504944564944,Sony DualShock 4 Wireless Adaptor,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b13,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,",
"4c05c405000000000000504944564944,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
+ "4c05cc09000000000000504944564944,Sony DualShock 4,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b13,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,",
"4f0400b3000000000000504944564944,Thrustmaster Firestorm Dual Power,a:b0,b:b2,y:b3,x:b1,start:b10,guide:b8,back:b9,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,",
"4f0415b3000000000000504944564944,Thrustmaster Dual Analog 3.2,x:b1,a:b0,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
- "4f0423b3000000000000504944564944,Dual Trigger 3-in-1,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:b7",
+ "4f0423b3000000000000504944564944,Dual Trigger 3-in-1,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:b7,",
"63252305000000000000504944564944,USB Vibration Joystick (BM),x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
"6d0416c2000000000000504944564944,Generic DirectInput Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
"6d0418c2000000000000504944564944,Logitech RumblePad 2 USB,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
"6d0419c2000000000000504944564944,Logitech F710 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
"6f0e1e01000000000000504944564944,Rock Candy Gamepad for PS3,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,guide:b12,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,",
"79000018000000000000504944564944,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
- "79000600000000000000504944564944,G-Shark GS-GP702,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7",
+ "79000600000000000000504944564944,G-Shark GS-GP702,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,",
+ "79000600000000000000504944564944,NGS Phantom,a:b2,b:b3,y:b1,x:b0,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,",
"79004318000000000000504944564944,Mayflash GameCube Controller Adapter,a:b1,b:b2,x:b0,y:b3,back:b0,start:b9,guide:b0,leftshoulder:b4,rightshoulder:b7,leftstick:b0,rightstick:b0,leftx:a0,lefty:a1,rightx:a5,righty:a2,lefttrigger:a3,righttrigger:a4,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,",
"79000600000000000000504944564944,Generic Speedlink,a:b2,b:b1,y:b0,x:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,",
"83056020000000000000504944564944,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,y:b2,x:b3,start:b7,back:b6,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,",
"88880803000000000000504944564944,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b9,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b0,y:b3,",
- "8f0e0300000000000000504944564944,Trust GXT 28,a:b2,b:b1,y:b0,x:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
+ "8f0e0300000000000000504944564944,Piranha xtreme,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,",
"8f0e0d31000000000000504944564944,Multilaser JS071 USB,a:b1,b:b2,y:b3,x:b0,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
"8f0e1200000000000000504944564944,Acme,x:b2,a:b0,b:b1,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,",
"9000318000000000000504944564944,Mayflash Wiimote PC Adapter,a:b2,b:h0.4,x:b0,y:b1,back:b4,start:b5,guide:b11,leftshoulder:b6,rightshoulder:b3,leftx:a0,lefty:a1,",
@@ -624,21 +641,27 @@ static const char *s_ControllerMappings[] = {
"351200000000000021ab000000000000,SFC30 Joystick,a:b1,b:b0,x:b4,y:b3,back:b10,start:b11,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
"4c050000000000006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
"4c05000000000000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
+ "4c05000000000000cc09000000000000,Sony DualShock 4 V2,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b13,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,",
"4f0400000000000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,y:b3,x:b1,start:b10,guide:b8,back:b9,leftstick:b11,rightstick:,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,",
"4f0400000000000015b3000000000000,Thrustmaster Dual Analog 3.2,x:b1,a:b0,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
"5e040000000000008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,",
"5e04000000000000dd02000000000000,Xbox One Wired Controller,x:b2,a:b0,b:b1,y:b3,back:b9,guide:b10,start:b8,dpleft:b13,dpdown:b12,dpright:b14,dpup:b11,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b6,rightstick:b7,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
+ "5e04000000000000e002000000000000,Xbox Wireless Controller,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b10,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
+ "5e04000000000000ea02000000000000,Xbox Wireless Controller,x:b2,a:b0,b:b1,y:b3,back:b9,guide:b10,start:b8,dpleft:b13,dpdown:b12,dpright:b14,dpup:b11,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b6,rightstick:b7,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
"6d0400000000000016c2000000000000,Logitech F310 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */
"6d0400000000000018c2000000000000,Logitech F510 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
"6d0400000000000019c2000000000000,Logitech Wireless Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* This includes F710 in DInput mode and the "Logitech Cordless RumblePad 2", at the very least. */
"6d040000000000001fc2000000000000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,",
"79000000000000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b4,b:b8,x:b0,y:b12,back:b32,start:b36,leftstick:b40,rightstick:b44,leftshoulder:b16,rightshoulder:b20,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a4,rightx:a8,righty:a12,lefttrigger:b24,righttrigger:b28,",
"79000000000000000600000000000000,G-Shark GP-702,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b6,righttrigger:b7,",
+ "79000000000000001100000000000000,Retrolink Classic Controller,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a3,lefty:a4,",
+ "81170000000000007e05000000000000,Sega Saturn,x:b0,a:b2,b:b4,y:b6,start:b13,dpleft:b15,dpdown:b16,dpright:b14,dpup:b17,leftshoulder:b8,lefttrigger:a5,lefttrigger:b10,rightshoulder:b9,righttrigger:a4,righttrigger:b11,leftx:a0,lefty:a2,",
"83050000000000006020000000000000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,x:b3,y:b2,back:b6,start:b7,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,",
"891600000000000000fd000000000000,Razer Onza Tournament,a:b0,b:b1,y:b3,x:b2,start:b8,guide:b10,back:b9,leftstick:b6,rightstick:b7,leftshoulder:b4,rightshoulder:b5,dpup:b11,dpleft:b13,dpdown:b12,dpright:b14,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,",
"8f0e0000000000000300000000000000,Piranha xtreme,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,",
"ad1b00000000000001f9000000000000,Gamestop BB-070 X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,",
"b4040000000000000a01000000000000,Sega Saturn USB Gamepad,a:b0,b:b1,x:b3,y:b4,back:b5,guide:b2,start:b8,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
+ "bd1200000000000015d0000000000000,Tomee SNES USB Controller,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,",
"d814000000000000cecf000000000000,MC Cthulhu,leftx:,lefty:,rightx:,righty:,lefttrigger:b6,a:b1,b:b2,y:b3,x:b0,start:b9,back:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,righttrigger:b7,",
#endif
@@ -646,24 +669,31 @@ static const char *s_ControllerMappings[] = {
"0000000058626f782047616d65706100,Xbox Gamepad (userspace driver),a:b0,b:b1,x:b2,y:b3,start:b7,back:b6,guide:b8,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,lefttrigger:a5,righttrigger:a4,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
"0300000000f000000300000000010000,RetroUSB.com RetroPad,a:b1,b:b5,x:b0,y:b4,back:b2,start:b3,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
"0300000000f00000f100000000010000,RetroUSB.com Super RetroPort,a:b1,b:b5,x:b0,y:b4,back:b2,start:b3,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
+ "030000000d0f00000d00000000010000,hori,a:b0,b:b6,y:b2,x:b1,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,start:b9,guide:b10,back:b8,leftshoulder:b3,rightshoulder:b7,leftx:b4,lefty:b5,",
"030000000d0f00001000000011010000,HORI CO.,LTD. FIGHTING STICK 3,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7",
"030000000d0f00002200000011010000,HORI CO.,LTD. REAL ARCADE Pro.V3,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,",
"030000000d0f00004d00000011010000,HORI Gem Pad 3,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
"03000000100800000100000010010000,Twin USB PS2 Adapter,a:b2,b:b1,y:b0,x:b3,start:b9,guide:,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b4,righttrigger:b5,",
+ "030000001008000001e5000010010000,NEXT Classic USB Game Controller,a:b0,b:b1,back:b8,start:b9,rightx:a2,righty:a3,leftx:a0,lefty:a1,",
+ "03000000100800000300000010010000,USB Gamepad,a:b2,b:b1,x:b3,y:b0,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b4,righttrigger:b5,",
"03000000250900000500000000010000,Sony PS2 pad with SmartJoy adapter,a:b2,b:b1,y:b0,x:b3,start:b8,back:b9,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b4,righttrigger:b5,",
"03000000260900008888000000010000,GameCube {WiseGroup USB box},a:b0,b:b2,y:b3,x:b1,start:b7,leftshoulder:,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,rightstick:,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,",
"03000000280400000140000000010000,Gravis GamePad Pro USB ,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftx:a0,lefty:a1,",
"03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,y:b3,x:b0,start:b9,guide:,back:,leftstick:,rightstick:,leftshoulder:,dpleft:b15,dpdown:b14,dpright:b13,leftx:a0,lefty:a1,rightx:a5,righty:a2,lefttrigger:a3,righttrigger:a4,rightshoulder:b7,dpup:b12,",
"03000000380700001647000010040000,Mad Catz Wired Xbox 360 Controller,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
"030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
+ "030000004c050000a00b000011010000,Sony DualShock 4 Wireless Adaptor,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b13,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,",
"030000004c050000c405000011010000,Sony DualShock 4,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,",
+ "030000004c050000c405000011810000,Sony Computer Entertainment Wireless Controller,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:h0.1,rightshoulder:b5,rightx:a3,start:b9,righty:a4,dpleft:h0.8,lefttrigger:a2,x:b3,dpup:h0.1,back:b8,leftstick:b11,leftshoulder:b4,y:b2,a:b0,dpright:h0.2,righttrigger:a5,b:b1,",
+ "030000004c050000cc09000011010000,Sony DualShock 4 V2,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b13,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,",
"030000004f04000000b3000010010000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,y:b3,x:b1,start:b10,guide:b8,back:b9,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,",
"030000004f04000008d0000000010000,Thrustmaster Run N Drive Wireless,a:b1,b:b2,x:b0,y:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:b7,",
"030000004f04000009d0000000010000,Thrustmaster Run N Drive Wireless PS3,a:b1,b:b2,x:b0,y:b3,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
"030000004f04000015b3000010010000,Thrustmaster Dual Analog 4,a:b0,b:b2,x:b1,y:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,",
"030000004f04000020b3000010010000,Thrustmaster 2 in 1 DT,a:b0,b:b2,y:b3,x:b1,start:b9,guide:,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,",
"030000004f04000023b3000000010000,Thrustmaster Dual Trigger 3-in-1,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a5,",
- "030000005e0400001907000000010000,X360 Wireless Controller,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b10,rightshoulder:b5,rightx:a3,start:b7,righty:a4,dpleft:h0.8,lefttrigger:a2,x:b2,dpup:h0.1,back:b6,leftstick:b9,leftshoulder:b4,y:b3,a:b0,dpright:h0.2,righttrigger:a5,b:b1,",
+ "030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
+ "030000005e0400008502000000010000,Microsoft X-Box pad (Japan),x:b3,a:b0,b:b1,y:b4,back:b6,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b5,lefttrigger:a2,rightshoulder:b2,righttrigger:a5,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
"030000005e0400008902000021010000,Microsoft X-Box pad v2 (US),x:b3,a:b0,b:b1,y:b4,back:b6,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b5,lefttrigger:a2,rightshoulder:b2,righttrigger:a5,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
"030000005e0400008e02000001000000,Microsoft X-Box 360 pad,leftstick:b9,leftx:a0,lefty:a1,dpdown:h0.1,rightstick:b10,rightshoulder:b5,rightx:a3,start:b7,righty:a4,dpleft:h0.2,lefttrigger:a2,x:b2,dpup:h0.4,back:b6,leftshoulder:b4,y:b3,a:b0,dpright:h0.8,righttrigger:a5,b:b1,",
"030000005e0400008e02000004010000,Microsoft X-Box 360 pad,a:b0,b:b1,x:b2,y:b3,back:b6,start:b7,guide:b8,leftshoulder:b4,rightshoulder:b5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,",
@@ -671,12 +701,15 @@ static const char *s_ControllerMappings[] = {
"030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
"030000005e0400008e02000020200000,SpeedLink XEOX Pro Analog Gamepad pad,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
"030000005e0400008e02000062230000,Microsoft X-Box 360 pad,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
- "030000005e0400009102000007010000,X360 Wireless Controller,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpleft:b11,dpdown:b14,dpright:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,",
+ "030000005e0400008e02000073050000,Speedlink TORID Wireless Gamepad,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
+ "030000005e0400009102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
+ "030000005e040000a102000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
"030000005e040000d102000001010000,Microsoft X-Box One pad,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
"030000005e040000dd02000003020000,Microsoft X-Box One pad v2,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
"03000000666600000488000000010000,Super Joy Box 5 Pro,a:b2,b:b1,x:b3,y:b0,back:b9,start:b8,leftshoulder:b6,rightshoulder:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b4,righttrigger:b5,dpup:b12,dpleft:b15,dpdown:b14,dpright:b13,",
"030000006d04000011c2000010010000,Logitech WingMan Cordless RumblePad,a:b0,b:b1,y:b4,x:b3,start:b8,guide:b5,back:b2,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b9,righttrigger:b10,",
"030000006d04000016c2000010010000,Logitech Logitech Dual Action,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
+ "030000006d04000016c2000011010000,Logitech F310 Gamepad (DInput),x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
"030000006d04000018c2000010010000,Logitech Logitech RumblePad 2 USB,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
"030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
"030000006d04000019c2000011010000,Logitech F710 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
@@ -693,6 +726,7 @@ static const char *s_ControllerMappings[] = {
"030000006f0e00003901000020060000,Afterglow Wired Controller for Xbox One,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
"030000006f0e00004601000001010000,Rock Candy Wired Controller for Xbox One,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,guide:b8,leftstick:b9,rightstick:b10,lefttrigger:a2,righttrigger:a5,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
"03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
+ "03000000790000001100000010010000,Retrolink Classic Controller,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,",
"03000000790000001100000010010000,RetroLink Saturn Classic Controller,x:b3,a:b0,b:b1,y:b4,back:b5,guide:b2,start:b8,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
"03000000830500006020000010010000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,x:b3,y:b2,back:b6,start:b7,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,",
"030000008916000000fd000024010000,Razer Onza Tournament,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpleft:b11,dpdown:b14,dpright:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,",
@@ -705,24 +739,30 @@ static const char *s_ControllerMappings[] = {
"03000000a306000023f6000011010000,Saitek Cyborg V.1 Game Pad,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,",
"03000000ad1b000001f5000033050000,Hori Pad EX Turbo 2,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,",
"03000000ad1b000016f0000090040000,Mad Catz Xbox 360 Controller,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,",
+ "03000000ad1b00002ef0000090040000,Mad Catz Fightpad SFxT,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,lefttrigger:a2,righttrigger:a5,",
"03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,",
+ "03000000bd12000015d0000010010000,Tomee SNES USB Controller,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,",
"03000000c9110000f055000011010000,HJC Game GAMEPAD,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b4,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
"03000000d814000007cd000011010000,Toodles 2008 Chimp PC/PS3,a:b0,b:b1,y:b2,x:b3,start:b9,back:b8,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,lefttrigger:b6,righttrigger:b7,",
"03000000d81400000862000011010000,HitBox (PS3/PC) Analog Mode,a:b1,b:b2,y:b3,x:b0,start:b12,guide:b9,back:b8,leftshoulder:b4,rightshoulder:b5,lefttrigger:b6,righttrigger:b7,leftx:a0,lefty:a1,",
"03000000de280000ff11000001000000,Valve Streaming Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
"03000000f0250000c183000010010000,Goodbetterbest Ltd USB Controller,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
+ "03000000fd0500000030000000010000,InterAct GoPad I-73000 (Fighting Game Layout),a:b3,b:b4,y:b1,x:b0,start:b7,back:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,",
"03000000fd0500002a26000000010000,3dfx InterAct HammerHead FX,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b5,rightshoulder:b7,rightx:a2,start:b11,righty:a3,dpleft:h0.8,lefttrigger:b8,x:b0,dpup:h0.1,back:b10,leftstick:b2,leftshoulder:b6,y:b1,a:b3,dpright:h0.2,righttrigger:b9,b:b4,",
"03000000ff1100003133000010010000,PC Game Controller,a:b2,b:b1,y:b0,x:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
"05000000010000000100000003000000,Nintendo Wiimote,a:b0,b:b1,y:b3,x:b2,start:b9,guide:b10,back:b8,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
"05000000102800000900000000010000,8Bitdo SFC30 GamePad,x:b4,a:b1,b:b0,y:b3,back:b10,start:b11,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
- "05000000362800000100000002010000,OUYA Game Controller,leftx:a0,lefty:a1,dpdown:b9,rightstick:b7,rightshoulder:b5,rightx:a3,start:b16,righty:a4,dpleft:b10,lefttrigger:b12,x:b1,dpup:b8,back:b14,leftstick:b6,leftshoulder:b4,y:b2,a:b0,dpright:b11,righttrigger:b13,b:b3,",
- "05000000362800000100000003010000,OUYA Game Controller,leftx:a0,lefty:a1,dpdown:b9,rightstick:b7,rightshoulder:b5,rightx:a3,start:b16,righty:a4,dpleft:b10,lefttrigger:b12,x:b1,dpup:b8,back:b14,leftstick:b6,leftshoulder:b4,y:b2,a:b0,dpright:b11,righttrigger:b13,b:b3,",
+ "05000000362800000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,",
+ "05000000362800000100000003010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,",
"05000000362800000100000004010000,OUYA Game Controller,leftx:a0,lefty:a1,dpdown:b9,rightstick:b7,rightshoulder:b5,rightx:a3,start:b16,righty:a4,dpleft:b10,lefttrigger:b12,x:b1,dpup:b8,back:b14,leftstick:b6,leftshoulder:b4,y:b2,a:b0,dpright:b11,righttrigger:b13,b:b3,",
- "05000000380700006652000025010000,Mad Catz C.T.R.L.R,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
+ "05000000380700006652000025010000,Mad Catz C.T.R.L.R ,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
"0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
"050000004c0500006802000000010000,PS3 Controller (Bluetooth),a:b14,b:b13,y:b12,x:b15,start:b3,guide:b16,back:b0,leftstick:b1,rightstick:b2,leftshoulder:b10,rightshoulder:b11,dpup:b4,dpleft:b7,dpdown:b6,dpright:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b8,righttrigger:b9,",
"050000004c050000c405000000010000,PS4 Controller (Bluetooth),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
+ "050000004c050000cc09000000010000,Sony DualShock 4 V2 BT,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b13,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,",
"050000007e0500003003000001000000,Nintendo Wii U Pro Controller,a:b0,b:b1,x:b3,y:b2,back:b8,start:b9,guide:b10,leftshoulder:b4,rightshoulder:b5,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,dpup:b13,dpleft:b15,dpdown:b14,dpright:b16,",
+ "05000000a00500003232000001000000,8Bitdo Zero GamePad,a:b0,b:b1,x:b3,y:b4,back:b10,start:b11,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
+ "05000000ac0500003232000001000000,VR-BOX,a:b0,b:b1,x:b2,y:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b4,righttrigger:b5,",
"05000000d6200000ad0d000001000000,Moga Pro,a:b0,b:b1,y:b3,x:b2,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,",
"060000004c0500006802000000010000,PS3 Controller (Bluetooth),a:b14,b:b13,y:b12,x:b15,start:b3,guide:b16,back:b0,leftstick:b1,rightstick:b2,leftshoulder:b10,rightshoulder:b11,dpup:b4,dpleft:b7,dpdown:b6,dpright:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b8,righttrigger:b9,",
#endif
@@ -735,6 +775,7 @@ static const char *s_ControllerMappings[] = {
"4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
"532e542e442e20496e74657261637420,3dfx InterAct HammerHead FX,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b25,rightshoulder:b27,rightx:a2,start:b31,righty:a3,dpleft:h0.8,lefttrigger:b28,x:b20,dpup:h0.1,back:b30,leftstick:b22,leftshoulder:b26,y:b21,a:b23,dpright:h0.2,righttrigger:b29,b:b24,",
"506572666f726d616e63652044657369,PDP Rock Candy Wireless Controller for PS3,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b6,rightshoulder:b18,rightx:a2,start:b16,righty:a3,dpleft:h0.8,lefttrigger:b9,x:b0,dpup:h0.1,back:h0.2,leftstick:b4,leftshoulder:b3,y:b2,a:b1,dpright:h0.2,righttrigger:b10,b:b17,",
+ "4f5559412047616d6520436f6e74726f,OUYA Game Controller,leftx:a1,lefty:a3,dpdown:b12,rightstick:b8,rightshoulder:b10,rightx:a6,start:b-86,righty:a7,dpleft:b13,lefttrigger:b15,x:b2,dpup:b11,leftstick:b7,leftshoulder:b9,y:b3,a:b0,dpright:b14,righttrigger:b16,b:b1,",
#endif
#ifdef JAVASCRIPT_ENABLED
@@ -795,25 +836,25 @@ InputDefault::InputDefault() {
};
}
-uint32_t InputDefault::joy_button(uint32_t p_last_id, int p_device, int p_button, bool p_pressed) {
+void InputDefault::joy_button(int p_device, int p_button, bool p_pressed) {
_THREAD_SAFE_METHOD_;
Joypad &joy = joy_names[p_device];
//printf("got button %i, mapping is %i\n", p_button, joy.mapping);
if (joy.last_buttons[p_button] == p_pressed) {
- return p_last_id;
- //printf("same button value\n");
+ return;
}
joy.last_buttons[p_button] = p_pressed;
if (joy.mapping == -1) {
- return _button_event(p_last_id, p_device, p_button, p_pressed);
+ _button_event(p_device, p_button, p_pressed);
+ return;
};
Map<int, JoyEvent>::Element *el = map_db[joy.mapping].buttons.find(p_button);
if (!el) {
//don't process un-mapped events for now, it could mess things up badly for devices with additional buttons/axis
//return _button_event(p_last_id, p_device, p_button, p_pressed);
- return p_last_id;
+ return;
};
JoyEvent map = el->get();
@@ -822,58 +863,68 @@ uint32_t InputDefault::joy_button(uint32_t p_last_id, int p_device, int p_button
if (map.index == JOY_L2 || map.index == JOY_R2) {
float value = p_pressed ? 1.0f : 0.0f;
int axis = map.index == JOY_L2 ? JOY_ANALOG_L2 : JOY_ANALOG_R2;
- p_last_id = _axis_event(p_last_id, p_device, axis, value);
+ _axis_event(p_device, axis, value);
}
- return _button_event(p_last_id, p_device, map.index, p_pressed);
+ _button_event(p_device, map.index, p_pressed);
+ return;
};
if (map.type == TYPE_AXIS) {
- return _axis_event(p_last_id, p_device, map.index, p_pressed ? 1.0 : 0.0);
+ _axis_event(p_device, map.index, p_pressed ? 1.0 : 0.0);
};
- return p_last_id; // no event?
+ return; // no event?
};
-uint32_t InputDefault::joy_axis(uint32_t p_last_id, int p_device, int p_axis, const JoyAxis &p_value) {
+void InputDefault::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
_THREAD_SAFE_METHOD_;
+ ERR_FAIL_INDEX(p_axis, JOY_AXIS_MAX);
+
Joypad &joy = joy_names[p_device];
if (joy.last_axis[p_axis] == p_value.value) {
- return p_last_id;
+ return;
}
if (p_value.value > joy.last_axis[p_axis]) {
if (p_value.value < joy.last_axis[p_axis] + joy.filter) {
- return p_last_id;
+ return;
}
} else if (p_value.value > joy.last_axis[p_axis] - joy.filter) {
- return p_last_id;
+ return;
}
- if (ABS(joy.last_axis[p_axis]) > 0.5 && joy.last_axis[p_axis] * p_value.value < 0) {
- //changed direction quickly, insert fake event to release pending inputmap actions
+ //when changing direction quickly, insert fake event to release pending inputmap actions
+ float last = joy.last_axis[p_axis];
+ if (p_value.min == 0 && (last < 0.25 || last > 0.75) && (last - 0.5) * (p_value.value - 0.5) < 0) {
+ JoyAxis jx;
+ jx.min = p_value.min;
+ jx.value = p_value.value < 0.5 ? 0.6 : 0.4;
+ joy_axis(p_device, p_axis, jx);
+ } else if (ABS(last) > 0.5 && last * p_value.value < 0) {
JoyAxis jx;
jx.min = p_value.min;
jx.value = p_value.value < 0 ? 0.1 : -0.1;
- p_last_id = joy_axis(p_last_id, p_device, p_axis, jx);
+ joy_axis(p_device, p_axis, jx);
}
joy.last_axis[p_axis] = p_value.value;
float val = p_value.min == 0 ? -1.0f + 2.0f * p_value.value : p_value.value;
if (joy.mapping == -1) {
- return _axis_event(p_last_id, p_device, p_axis, val);
+ _axis_event(p_device, p_axis, val);
+ return;
};
Map<int, JoyEvent>::Element *el = map_db[joy.mapping].axis.find(p_axis);
if (!el) {
//return _axis_event(p_last_id, p_device, p_axis, p_value);
- return p_last_id;
+ return;
};
JoyEvent map = el->get();
@@ -883,7 +934,7 @@ uint32_t InputDefault::joy_axis(uint32_t p_last_id, int p_device, int p_axis, co
if (map.index == JOY_L2 || map.index == JOY_R2) {
float value = p_value.min == 0 ? p_value.value : 0.5f + p_value.value / 2.0f;
int axis = map.index == JOY_L2 ? JOY_ANALOG_L2 : JOY_ANALOG_R2;
- p_last_id = _axis_event(p_last_id, p_device, axis, value);
+ _axis_event(p_device, axis, value);
}
if (map.index == JOY_DPAD_UP || map.index == JOY_DPAD_DOWN) {
@@ -892,16 +943,17 @@ uint32_t InputDefault::joy_axis(uint32_t p_last_id, int p_device, int p_axis, co
if (!pressed) {
if (joy_buttons_pressed.has(_combine_device(JOY_DPAD_UP, p_device))) {
- p_last_id = _button_event(p_last_id, p_device, JOY_DPAD_UP, false);
+ _button_event(p_device, JOY_DPAD_UP, false);
}
if (joy_buttons_pressed.has(_combine_device(JOY_DPAD_DOWN, p_device))) {
- p_last_id = _button_event(p_last_id, p_device, JOY_DPAD_DOWN, false);
+ _button_event(p_device, JOY_DPAD_DOWN, false);
}
}
if (pressed == joy_buttons_pressed.has(_combine_device(button, p_device))) {
- return p_last_id;
+ return;
}
- return _button_event(p_last_id, p_device, button, true);
+ _button_event(p_device, button, true);
+ return;
}
if (map.index == JOY_DPAD_LEFT || map.index == JOY_DPAD_RIGHT) {
bool pressed = p_value.value != 0.0f;
@@ -909,35 +961,38 @@ uint32_t InputDefault::joy_axis(uint32_t p_last_id, int p_device, int p_axis, co
if (!pressed) {
if (joy_buttons_pressed.has(_combine_device(JOY_DPAD_LEFT, p_device))) {
- p_last_id = _button_event(p_last_id, p_device, JOY_DPAD_LEFT, false);
+ _button_event(p_device, JOY_DPAD_LEFT, false);
}
if (joy_buttons_pressed.has(_combine_device(JOY_DPAD_RIGHT, p_device))) {
- p_last_id = _button_event(p_last_id, p_device, JOY_DPAD_RIGHT, false);
+ _button_event(p_device, JOY_DPAD_RIGHT, false);
}
}
if (pressed == joy_buttons_pressed.has(_combine_device(button, p_device))) {
- return p_last_id;
+ return;
}
- return _button_event(p_last_id, p_device, button, true);
+ _button_event(p_device, button, true);
+ return;
}
float deadzone = p_value.min == 0 ? 0.5f : 0.0f;
bool pressed = p_value.value > deadzone ? true : false;
if (pressed == joy_buttons_pressed.has(_combine_device(map.index, p_device))) {
// button already pressed or released, this is an axis bounce value
- return p_last_id;
+ return;
};
- return _button_event(p_last_id, p_device, map.index, pressed);
+ _button_event(p_device, map.index, pressed);
+ return;
};
if (map.type == TYPE_AXIS) {
- return _axis_event(p_last_id, p_device, map.index, val);
+ _axis_event(p_device, map.index, val);
+ return;
};
//printf("invalid mapping\n");
- return p_last_id;
+ return;
};
-uint32_t InputDefault::joy_hat(uint32_t p_last_id, int p_device, int p_val) {
+void InputDefault::joy_hat(int p_device, int p_val) {
_THREAD_SAFE_METHOD_;
const Joypad &joy = joy_names[p_device];
@@ -953,50 +1008,42 @@ uint32_t InputDefault::joy_hat(uint32_t p_last_id, int p_device, int p_val) {
int cur_val = joy_names[p_device].hat_current;
if ((p_val & HAT_MASK_UP) != (cur_val & HAT_MASK_UP)) {
- p_last_id = _button_event(p_last_id, p_device, map[HAT_UP].index, p_val & HAT_MASK_UP);
+ _button_event(p_device, map[HAT_UP].index, p_val & HAT_MASK_UP);
};
if ((p_val & HAT_MASK_RIGHT) != (cur_val & HAT_MASK_RIGHT)) {
- p_last_id = _button_event(p_last_id, p_device, map[HAT_RIGHT].index, p_val & HAT_MASK_RIGHT);
+ _button_event(p_device, map[HAT_RIGHT].index, p_val & HAT_MASK_RIGHT);
};
if ((p_val & HAT_MASK_DOWN) != (cur_val & HAT_MASK_DOWN)) {
- p_last_id = _button_event(p_last_id, p_device, map[HAT_DOWN].index, p_val & HAT_MASK_DOWN);
+ _button_event(p_device, map[HAT_DOWN].index, p_val & HAT_MASK_DOWN);
};
if ((p_val & HAT_MASK_LEFT) != (cur_val & HAT_MASK_LEFT)) {
- p_last_id = _button_event(p_last_id, p_device, map[HAT_LEFT].index, p_val & HAT_MASK_LEFT);
+ _button_event(p_device, map[HAT_LEFT].index, p_val & HAT_MASK_LEFT);
};
joy_names[p_device].hat_current = p_val;
-
- return p_last_id;
};
-uint32_t InputDefault::_button_event(uint32_t p_last_id, int p_device, int p_index, bool p_pressed) {
+void InputDefault::_button_event(int p_device, int p_index, bool p_pressed) {
- InputEvent ievent;
- ievent.type = InputEvent::JOYPAD_BUTTON;
- ievent.device = p_device;
- ievent.ID = ++p_last_id;
- ievent.joy_button.button_index = p_index;
- ievent.joy_button.pressed = p_pressed;
+ Ref<InputEventJoypadButton> ievent;
+ ievent.instance();
+ ievent->set_device(p_device);
+ ievent->set_button_index(p_index);
+ ievent->set_pressed(p_pressed);
parse_input_event(ievent);
-
- return p_last_id;
};
-uint32_t InputDefault::_axis_event(uint32_t p_last_id, int p_device, int p_axis, float p_value) {
+void InputDefault::_axis_event(int p_device, int p_axis, float p_value) {
- InputEvent ievent;
- ievent.type = InputEvent::JOYPAD_MOTION;
- ievent.device = p_device;
- ievent.ID = ++p_last_id;
- ievent.joy_motion.axis = p_axis;
- ievent.joy_motion.axis_value = p_value;
+ Ref<InputEventJoypadMotion> ievent;
+ ievent.instance();
+ ievent->set_device(p_device);
+ ievent->set_axis(p_axis);
+ ievent->set_axis_value(p_value);
parse_input_event(ievent);
-
- return p_last_id;
};
InputDefault::JoyEvent InputDefault::_find_to_event(String p_to) {
@@ -1041,6 +1088,8 @@ void InputDefault::parse_mapping(String p_mapping) {
_THREAD_SAFE_METHOD_;
JoyDeviceMapping mapping;
+ for (int i = 0; i < HAT_MAX; ++i)
+ mapping.hat[i].index = 1024 + i;
Vector<String> entry = p_mapping.split(",");
CharString uid;
diff --git a/main/input_default.h b/main/input_default.h
index 4f298d6d55..92ef67c7b5 100644
--- a/main/input_default.h
+++ b/main/input_default.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -169,8 +170,8 @@ private:
Vector<JoyDeviceMapping> map_db;
JoyEvent _find_to_event(String p_to);
- uint32_t _button_event(uint32_t p_last_id, int p_device, int p_index, bool p_pressed);
- uint32_t _axis_event(uint32_t p_last_id, int p_device, int p_axis, float p_value);
+ void _button_event(int p_device, int p_index, bool p_pressed);
+ void _axis_event(int p_device, int p_axis, float p_value);
float _handle_deadzone(int p_device, int p_axis, float p_value);
public:
@@ -195,14 +196,14 @@ public:
virtual Vector3 get_magnetometer() const;
virtual Vector3 get_gyroscope() const;
- virtual Point2 get_mouse_pos() const;
+ virtual Point2 get_mouse_position() const;
virtual Point2 get_last_mouse_speed() const;
virtual int get_mouse_button_mask() const;
virtual void warp_mouse_pos(const Vector2 &p_to);
- virtual Point2i warp_mouse_motion(const InputEventMouseMotion &p_motion, const Rect2 &p_rect);
+ virtual Point2i warp_mouse_motion(const Ref<InputEventMouseMotion> &p_motion, const Rect2 &p_rect);
- virtual void parse_input_event(const InputEvent &p_event);
+ virtual void parse_input_event(const Ref<InputEvent> &p_event);
void set_gravity(const Vector3 &p_gravity);
void set_accelerometer(const Vector3 &p_accel);
@@ -213,8 +214,8 @@ public:
virtual void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration = 0);
virtual void stop_joy_vibration(int p_device);
- void set_main_loop(MainLoop *main_loop);
- void set_mouse_pos(const Point2 &p_posf);
+ void set_main_loop(MainLoop *p_main_loop);
+ void set_mouse_position(const Point2 &p_posf);
void action_press(const StringName &p_action);
void action_release(const StringName &p_action);
@@ -228,9 +229,9 @@ public:
virtual void set_mouse_in_window(bool p_in_window);
void parse_mapping(String p_mapping);
- uint32_t joy_button(uint32_t p_last_id, int p_device, int p_button, bool p_pressed);
- uint32_t joy_axis(uint32_t p_last_id, int p_device, int p_axis, const JoyAxis &p_value);
- uint32_t joy_hat(uint32_t p_last_id, int p_device, int p_val);
+ void joy_button(int p_device, int p_button, bool p_pressed);
+ void joy_axis(int p_device, int p_axis, const JoyAxis &p_value);
+ void joy_hat(int p_device, int p_val);
virtual void add_joy_mapping(String p_mapping, bool p_update_existing = false);
virtual void remove_joy_mapping(String p_guid);
diff --git a/main/main.cpp b/main/main.cpp
index f905e22070..e00a482bde 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,21 +28,22 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "main.h"
+#include "app_icon.gen.h"
#include "core/register_core_types.h"
#include "drivers/register_driver_types.h"
-#include "global_config.h"
#include "message_queue.h"
#include "modules/register_module_types.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/register_scene_types.h"
#include "script_debugger_local.h"
#include "script_debugger_remote.h"
#include "servers/register_server_types.h"
-#include "splash.h"
+#include "splash.gen.h"
#include "input_map.h"
#include "io/resource_loader.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
#include "servers/audio_server.h"
#include "io/resource_loader.h"
@@ -72,7 +74,7 @@
#include "translation.h"
#include "version.h"
-static GlobalConfig *globals = NULL;
+static ProjectSettings *globals = NULL;
static Engine *engine = NULL;
static InputMap *input_map = NULL;
static bool _start_success = false;
@@ -94,8 +96,10 @@ static bool init_maximized = false;
static bool init_windowed = false;
static bool init_fullscreen = false;
static bool init_use_custom_pos = false;
+#ifdef DEBUG_ENABLED
static bool debug_collisions = false;
static bool debug_navigation = false;
+#endif
static int frame_delay = 0;
static Vector2 init_custom_pos;
static int video_driver_idx = -1;
@@ -125,7 +129,7 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(VERSION_FULL_NAME " (c) 2008-2017 Juan Linietsky, Ariel Manzur.\n");
OS::get_singleton()->print("Usage: %s [options] [scene]\n", p_binary);
OS::get_singleton()->print("Options:\n");
- OS::get_singleton()->print("\t-path [dir] : Path to a game, containing godot.cfg\n");
+ OS::get_singleton()->print("\t-path [dir] : Path to a game, containing project.godot\n");
#ifdef TOOLS_ENABLED
OS::get_singleton()->print("\t-e,-editor : Bring up the editor instead of running the scene.\n");
#endif
@@ -199,16 +203,16 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
MAIN_PRINT("Main: Initialize Globals");
- Thread::_main_thread_id = Thread::get_caller_ID();
+ Thread::_main_thread_id = Thread::get_caller_id();
- globals = memnew(GlobalConfig);
+ globals = memnew(ProjectSettings);
input_map = memnew(InputMap);
register_core_settings(); //here globals is present
translation_server = memnew(TranslationServer);
performance = memnew(Performance);
- globals->add_singleton(GlobalConfig::Singleton("Performance", performance));
+ globals->add_singleton(ProjectSettings::Singleton("Performance", performance));
MAIN_PRINT("Main: Parse CMDLine");
@@ -443,6 +447,23 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} else {
goto error;
}
+ } else if (I->get().ends_with("project.godot")) {
+ String path;
+ String file = I->get();
+ int sep = MAX(file.find_last("/"), file.find_last("\\"));
+ if (sep == -1)
+ path = ".";
+ else {
+ path = file.substr(0, sep);
+ }
+ if (OS::get_singleton()->set_cwd(path) == OK) {
+ // path already specified, don't override
+ } else {
+ game_path = path;
+ }
+#ifdef TOOLS_ENABLED
+ editor = true;
+#endif
} else if (I->get() == "-bp") { // /breakpoints
if (I->next()) {
@@ -498,15 +519,17 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} else if (I->get() == "-debug" || I->get() == "-d") {
debug_mode = "local";
+#ifdef DEBUG_ENABLED
} else if (I->get() == "-debugcol" || I->get() == "-dc") {
debug_collisions = true;
} else if (I->get() == "-debugnav" || I->get() == "-dn") {
debug_navigation = true;
+#endif
} else if (I->get() == "-editor_scene") {
if (I->next()) {
- GlobalConfig::get_singleton()->set("editor_scene", game_path = I->next()->get());
+ ProjectSettings::get_singleton()->set("editor_scene", game_path = I->next()->get());
} else {
goto error;
}
@@ -528,7 +551,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (I->next()) {
int editor_pid = I->next()->get().to_int();
- GlobalConfig::get_singleton()->set("editor_pid", editor_pid);
+ ProjectSettings::get_singleton()->set("editor_pid", editor_pid);
N = I->next()->next();
} else {
goto error;
@@ -555,18 +578,17 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
I = N;
}
- GLOBAL_DEF("memory/multithread/thread_rid_pool_prealloc", 60);
-
- GLOBAL_DEF("network/debug/max_remote_stdout_chars_per_second", 2048);
- GLOBAL_DEF("network/debug/remote_port", 6007);
+ GLOBAL_DEF("memory/limits/multithreaded_server/rid_pool_prealloc", 60);
+ GLOBAL_DEF("network/limits/debugger_stdout/max_chars_per_second", 2048);
if (debug_mode == "remote") {
ScriptDebuggerRemote *sdr = memnew(ScriptDebuggerRemote);
- uint16_t debug_port = GLOBAL_GET("network/debug/remote_port");
+ uint16_t debug_port = 6007;
if (debug_host.find(":") != -1) {
- debug_port = debug_host.get_slicec(':', 1).to_int();
- debug_host = debug_host.get_slicec(':', 0);
+ int sep_pos = debug_host.find_last(":");
+ debug_port = debug_host.substr(sep_pos + 1, debug_host.length()).to_int();
+ debug_host = debug_host.substr(0, sep_pos);
}
Error derr = sdr->connect_to_host(debug_host, debug_port);
@@ -620,7 +642,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
#ifdef TOOLS_ENABLED
if (editor) {
packed_data->set_disabled(true);
- globals->set_disable_platform_override(true);
+ globals->set_disable_feature_overrides(true);
StreamPeerSSL::initialize_certs = false; //will be initialized by editor
}
@@ -643,10 +665,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
use_custom_res = false;
}
- if (bool(GlobalConfig::get_singleton()->get("application/disable_stdout"))) {
+ if (bool(ProjectSettings::get_singleton()->get("application/run/disable_stdout"))) {
quiet_stdout = true;
}
- if (bool(GlobalConfig::get_singleton()->get("application/disable_stderr"))) {
+ if (bool(ProjectSettings::get_singleton()->get("application/run/disable_stderr"))) {
_print_error_enabled = false;
};
@@ -657,7 +679,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
#ifdef TOOLS_ENABLED
- if (main_args.size() == 0 && (!GlobalConfig::get_singleton()->has("application/main_loop_type")) && (!GlobalConfig::get_singleton()->has("application/main_scene") || String(GlobalConfig::get_singleton()->get("application/main_scene")) == ""))
+ if (main_args.size() == 0 && (!ProjectSettings::get_singleton()->has("application/run/main_loop_type")) && (!ProjectSettings::get_singleton()->has("application/run/main_scene") || String(ProjectSettings::get_singleton()->get("application/run/main_scene")) == ""))
use_custom_res = false; //project manager (run without arguments)
#endif
@@ -667,43 +689,46 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
else
input_map->load_from_globals(); //keys for game
- if (video_driver == "") // specified in godot.cfg
- video_driver = GLOBAL_DEF("display/driver/name", Variant((const char *)OS::get_singleton()->get_video_driver_name(0)));
+ //if (video_driver == "") // useless for now, so removing
+ // video_driver = GLOBAL_DEF("display/driver/name", Variant((const char *)OS::get_singleton()->get_video_driver_name(0)));
- if (!force_res && use_custom_res && globals->has("display/window/width"))
- video_mode.width = globals->get("display/window/width");
- if (!force_res && use_custom_res && globals->has("display/window/height"))
- video_mode.height = globals->get("display/window/height");
- if (!editor && (!bool(globals->get("display/window/allow_hidpi")) || force_lowdpi)) {
+ if (!force_res && use_custom_res && globals->has("display/window/size/width"))
+ video_mode.width = globals->get("display/window/size/width");
+ if (!force_res && use_custom_res && globals->has("display/window/size/height"))
+ video_mode.height = globals->get("display/window/size/height");
+ if (!editor && ((globals->has("display/window/dpi/allow_hidpi") && !globals->get("display/window/dpi/allow_hidpi")) || force_lowdpi)) {
OS::get_singleton()->_allow_hidpi = false;
}
- if (use_custom_res && globals->has("display/window/fullscreen"))
- video_mode.fullscreen = globals->get("display/window/fullscreen");
- if (use_custom_res && globals->has("display/window/resizable"))
- video_mode.resizable = globals->get("display/window/resizable");
- if (use_custom_res && globals->has("display/window/borderless"))
- video_mode.borderless_window = globals->get("display/window/borderless");
-
- if (!force_res && use_custom_res && globals->has("display/window/test_width") && globals->has("display/window/test_height")) {
- int tw = globals->get("display/window/test_width");
- int th = globals->get("display/window/test_height");
+ if (use_custom_res && globals->has("display/window/size/fullscreen"))
+ video_mode.fullscreen = globals->get("display/window/size/fullscreen");
+ if (use_custom_res && globals->has("display/window/size/resizable"))
+ video_mode.resizable = globals->get("display/window/size/resizable");
+ if (use_custom_res && globals->has("display/window/size/borderless"))
+ video_mode.borderless_window = globals->get("display/window/size/borderless");
+
+ if (!force_res && use_custom_res && globals->has("display/window/size/test_width") && globals->has("display/window/size/test_height")) {
+ int tw = globals->get("display/window/size/test_width");
+ int th = globals->get("display/window/size/test_height");
if (tw > 0 && th > 0) {
video_mode.width = tw;
video_mode.height = th;
}
}
- GLOBAL_DEF("display/window/width", video_mode.width);
- GLOBAL_DEF("display/window/height", video_mode.height);
- GLOBAL_DEF("display/window/allow_hidpi", false);
- GLOBAL_DEF("display/window/fullscreen", video_mode.fullscreen);
- GLOBAL_DEF("display/window/resizable", video_mode.resizable);
- GLOBAL_DEF("display/window/borderless", video_mode.borderless_window);
- use_vsync = GLOBAL_DEF("display/window/use_vsync", use_vsync);
- GLOBAL_DEF("display/window/test_width", 0);
- GLOBAL_DEF("display/window/test_height", 0);
- Engine::get_singleton()->_pixel_snap = GLOBAL_DEF("rendering/2d/use_pixel_snap", false);
- OS::get_singleton()->_keep_screen_on = GLOBAL_DEF("display/energy_saving/keep_screen_on", true);
+ GLOBAL_DEF("display/window/size/width", video_mode.width);
+ GLOBAL_DEF("display/window/size/height", video_mode.height);
+ GLOBAL_DEF("display/window/dpi/allow_hidpi", false);
+ GLOBAL_DEF("display/window/size/fullscreen", video_mode.fullscreen);
+ GLOBAL_DEF("display/window/size/resizable", video_mode.resizable);
+ GLOBAL_DEF("display/window/size/borderless", video_mode.borderless_window);
+ use_vsync = GLOBAL_DEF("display/window/vsync/use_vsync", use_vsync);
+ GLOBAL_DEF("display/window/size/test_width", 0);
+ GLOBAL_DEF("display/window/size/test_height", 0);
+ GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_allocation", 2);
+ GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_allocation.mobile", 3);
+
+ Engine::get_singleton()->_pixel_snap = GLOBAL_DEF("rendering/quality/2d/use_pixel_snap", false);
+ OS::get_singleton()->_keep_screen_on = GLOBAL_DEF("display/window/energy_saving/keep_screen_on", true);
if (rtm == -1) {
rtm = GLOBAL_DEF("rendering/threads/thread_model", OS::RENDER_THREAD_SAFE);
if (rtm >= 1) //hack for now
@@ -719,7 +744,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
/* Determine Video Driver */
- if (audio_driver == "") { // specified in godot.cfg
+ if (audio_driver == "") { // specified in project.godot
audio_driver = GLOBAL_DEF("audio/driver", OS::get_singleton()->get_audio_driver_name(0));
}
@@ -734,7 +759,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (video_driver_idx < 0) {
- OS::get_singleton()->alert("Invalid Video Driver: " + video_driver);
+ //OS::get_singleton()->alert("Invalid Video Driver: " + video_driver);
video_driver_idx = 0;
//goto error;
}
@@ -756,7 +781,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
{
- String orientation = GLOBAL_DEF("display/handheld/orientation", "landscape");
+ String orientation = GLOBAL_DEF("display/window/handheld/orientation", "landscape");
if (orientation == "portrait")
OS::get_singleton()->set_screen_orientation(OS::SCREEN_PORTRAIT);
@@ -775,22 +800,22 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
Engine::get_singleton()->set_iterations_per_second(GLOBAL_DEF("physics/common/fixed_fps", 60));
- Engine::get_singleton()->set_target_fps(GLOBAL_DEF("debug/fps/force_fps", 0));
+ Engine::get_singleton()->set_target_fps(GLOBAL_DEF("debug/settings/fps/force_fps", 0));
- GLOBAL_DEF("debug/stdout/print_fps", OS::get_singleton()->is_stdout_verbose());
+ GLOBAL_DEF("debug/settings/stdout/print_fps", OS::get_singleton()->is_stdout_verbose());
if (!OS::get_singleton()->_verbose_stdout) //overrided
- OS::get_singleton()->_verbose_stdout = GLOBAL_DEF("debug/stdout/verbose_stdout", false);
+ OS::get_singleton()->_verbose_stdout = GLOBAL_DEF("debug/settings/stdout/verbose_stdout", false);
if (frame_delay == 0) {
- frame_delay = GLOBAL_DEF("application/frame_delay_msec", 0);
+ frame_delay = GLOBAL_DEF("application/run/frame_delay_msec", 0);
}
Engine::get_singleton()->set_frame_delay(frame_delay);
message_queue = memnew(MessageQueue);
- GlobalConfig::get_singleton()->register_global_defaults();
+ ProjectSettings::get_singleton()->register_global_defaults();
if (p_second_phase)
return setup2();
@@ -880,41 +905,45 @@ Error Main::setup2() {
} else if (init_fullscreen) {
OS::get_singleton()->set_window_fullscreen(true);
}
+
+ register_server_types();
+
MAIN_PRINT("Main: Load Remaps");
- Color clear = GLOBAL_DEF("rendering/viewport/default_clear_color", Color(0.3, 0.3, 0.3));
+ Color clear = GLOBAL_DEF("rendering/environment/default_clear_color", Color(0.3, 0.3, 0.3));
VisualServer::get_singleton()->set_default_clear_color(clear);
if (show_logo) { //boot logo!
- String boot_logo_path = GLOBAL_DEF("application/boot_splash", String());
- bool boot_logo_scale = GLOBAL_DEF("application/boot_splash_fullsize", true);
- GlobalConfig::get_singleton()->set_custom_property_info("application/boot_splash", PropertyInfo(Variant::STRING, "application/boot_splash", PROPERTY_HINT_FILE, "*.png"));
+ String boot_logo_path = GLOBAL_DEF("application/boot_splash/image", String());
+ bool boot_logo_scale = GLOBAL_DEF("application/boot_splash/fullsize", true);
+ ProjectSettings::get_singleton()->set_custom_property_info("application/boot_splash/image", PropertyInfo(Variant::STRING, "application/boot_splash/image", PROPERTY_HINT_FILE, "*.png"));
- Image boot_logo;
+ Ref<Image> boot_logo;
boot_logo_path = boot_logo_path.strip_edges();
if (boot_logo_path != String() /*&& FileAccess::exists(boot_logo_path)*/) {
print_line("Boot splash path: " + boot_logo_path);
- Error err = boot_logo.load(boot_logo_path);
+ boot_logo.instance();
+ Error err = boot_logo->load(boot_logo_path);
if (err)
ERR_PRINTS("Non-existing or invalid boot splash at: " + boot_logo_path + ". Loading default splash.");
}
- if (!boot_logo.empty()) {
+ if (boot_logo.is_valid()) {
OS::get_singleton()->_msec_splash = OS::get_singleton()->get_ticks_msec();
- Color boot_bg = GLOBAL_DEF("application/boot_bg_color", clear);
+ Color boot_bg = GLOBAL_DEF("application/boot_splash/bg_color", clear);
VisualServer::get_singleton()->set_boot_image(boot_logo, boot_bg, boot_logo_scale);
#ifndef TOOLS_ENABLED
//no tools, so free the boot logo (no longer needed)
-//GlobalConfig::get_singleton()->set("application/boot_logo",Image());
+//ProjectSettings::get_singleton()->set("application/boot_logo",Image());
#endif
} else {
#ifndef NO_DEFAULT_BOOT_LOGO
MAIN_PRINT("Main: Create bootsplash");
- Image splash(boot_splash_png);
+ Ref<Image> splash = memnew(Image(boot_splash_png));
MAIN_PRINT("Main: ClearColor");
VisualServer::get_singleton()->set_default_clear_color(boot_splash_bg_color);
@@ -923,18 +952,18 @@ Error Main::setup2() {
#endif
}
- Image icon(app_icon_png);
+ Ref<Image> icon = memnew(Image(app_icon_png));
OS::get_singleton()->set_icon(icon);
}
MAIN_PRINT("Main: DCC");
- VisualServer::get_singleton()->set_default_clear_color(GLOBAL_DEF("rendering/viewport/default_clear_color", Color(0.3, 0.3, 0.3)));
+ VisualServer::get_singleton()->set_default_clear_color(GLOBAL_DEF("rendering/environment/default_clear_color", Color(0.3, 0.3, 0.3)));
MAIN_PRINT("Main: END");
- GLOBAL_DEF("application/icon", String());
- GlobalConfig::get_singleton()->set_custom_property_info("application/icon", PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "*.png,*.webp"));
+ GLOBAL_DEF("application/config/icon", String());
+ ProjectSettings::get_singleton()->set_custom_property_info("application/config/icon", PropertyInfo(Variant::STRING, "application/config/icon", PROPERTY_HINT_FILE, "*.png,*.webp"));
- if (bool(GLOBAL_DEF("display/handheld/emulate_touchscreen", false))) {
+ if (bool(GLOBAL_DEF("display/window/handheld/emulate_touchscreen", false))) {
if (!OS::get_singleton()->has_touchscreen_ui_hint() && Input::get_singleton() && !editor) {
//only if no touchscreen ui hint, set emulation
InputDefault *id = Input::get_singleton()->cast_to<InputDefault>();
@@ -948,19 +977,18 @@ Error Main::setup2() {
MAIN_PRINT("Main: Load Scene Types");
register_scene_types();
- register_server_types();
GLOBAL_DEF("display/mouse_cursor/custom_image", String());
GLOBAL_DEF("display/mouse_cursor/custom_image_hotspot", Vector2());
- GlobalConfig::get_singleton()->set_custom_property_info("display/mouse_cursor/custom_image", PropertyInfo(Variant::STRING, "display/mouse_cursor/custom_image", PROPERTY_HINT_FILE, "*.png,*.webp"));
+ ProjectSettings::get_singleton()->set_custom_property_info("display/mouse_cursor/custom_image", PropertyInfo(Variant::STRING, "display/mouse_cursor/custom_image", PROPERTY_HINT_FILE, "*.png,*.webp"));
- if (String(GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image")) != String()) {
+ if (String(ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image")) != String()) {
//print_line("use custom cursor");
- Ref<Texture> cursor = ResourceLoader::load(GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image"));
+ Ref<Texture> cursor = ResourceLoader::load(ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image"));
if (cursor.is_valid()) {
//print_line("loaded ok");
- Vector2 hotspot = GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image_hotspot");
+ Vector2 hotspot = ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image_hotspot");
Input::get_singleton()->set_custom_mouse_cursor(cursor, hotspot);
}
}
@@ -987,6 +1015,7 @@ Error Main::setup2() {
translation_server->set_locale(locale);
}
translation_server->load_translations();
+ ResourceLoader::load_translation_remaps(); //load remaps for resources
audio_server->load_default_bus_layout();
@@ -1019,7 +1048,7 @@ bool Main::start() {
String script;
String test;
String screen;
- String _export_platform;
+ String _export_preset;
String _import;
String _import_script;
bool noquit = false;
@@ -1054,10 +1083,10 @@ bool Main::start() {
test = args[i + 1];
} else if (args[i] == "-export") {
editor = true; //needs editor
- _export_platform = args[i + 1];
+ _export_preset = args[i + 1];
} else if (args[i] == "-export_debug") {
editor = true; //needs editor
- _export_platform = args[i + 1];
+ _export_preset = args[i + 1];
export_debug = true;
} else if (args[i] == "-import") {
editor = true; //needs editor
@@ -1107,7 +1136,7 @@ bool Main::start() {
#endif
- if (_export_platform != "") {
+ if (_export_preset != "") {
if (game_path == "") {
String err = "Command line param ";
err += export_debug ? "-export_debug" : "-export";
@@ -1118,8 +1147,8 @@ bool Main::start() {
}
}
- if (script == "" && game_path == "" && String(GLOBAL_DEF("application/main_scene", "")) != "") {
- game_path = GLOBAL_DEF("application/main_scene", "");
+ if (script == "" && game_path == "" && String(GLOBAL_DEF("application/run/main_scene", "")) != "") {
+ game_path = GLOBAL_DEF("application/run/main_scene", "");
}
MainLoop *main_loop = NULL;
@@ -1162,7 +1191,7 @@ bool Main::start() {
}
} else {
- main_loop_type = GLOBAL_DEF("application/main_loop_type", "");
+ main_loop_type = GLOBAL_DEF("application/run/main_loop_type", "");
}
if (!main_loop && main_loop_type == "")
@@ -1194,12 +1223,15 @@ bool Main::start() {
SceneTree *sml = main_loop->cast_to<SceneTree>();
+#ifdef DEBUG_ENABLED
if (debug_collisions) {
sml->set_debug_collisions_hint(true);
}
if (debug_navigation) {
sml->set_debug_navigation_hint(true);
}
+#endif
+
#ifdef TOOLS_ENABLED
EditorNode *editor_node = NULL;
@@ -1211,20 +1243,24 @@ bool Main::start() {
//root_node->set_editor(editor);
//startup editor
- if (_export_platform != "") {
+ if (_export_preset != "") {
- editor_node->export_platform(_export_platform, game_path, export_debug, "", true);
+ editor_node->export_preset(_export_preset, game_path, export_debug, "", true);
game_path = ""; //no load anything
}
}
#endif
+ {
+ }
+
if (!editor) {
//standard helpers that can be changed from main config
- String stretch_mode = GLOBAL_DEF("display/stretch/mode", "disabled");
- String stretch_aspect = GLOBAL_DEF("display/stretch/aspect", "ignore");
- Size2i stretch_size = Size2(GLOBAL_DEF("display/screen/width", 0), GLOBAL_DEF("display/screen/height", 0));
+ String stretch_mode = GLOBAL_DEF("display/window/stretch/mode", "disabled");
+ String stretch_aspect = GLOBAL_DEF("display/window/stretch/aspect", "ignore");
+ Size2i stretch_size = Size2(GLOBAL_DEF("display/window/size/width", 0), GLOBAL_DEF("display/window/size/height", 0));
+ int stretch_shrink = GLOBAL_DEF("display/window/stretch/shrink", 1);
SceneTree::StretchMode sml_sm = SceneTree::STRETCH_MODE_DISABLED;
if (stretch_mode == "2d")
@@ -1239,46 +1275,40 @@ bool Main::start() {
sml_aspect = SceneTree::STRETCH_ASPECT_KEEP_WIDTH;
else if (stretch_aspect == "keep_height")
sml_aspect = SceneTree::STRETCH_ASPECT_KEEP_HEIGHT;
+ else if (stretch_aspect == "expand")
+ sml_aspect = SceneTree::STRETCH_ASPECT_EXPAND;
- sml->set_screen_stretch(sml_sm, sml_aspect, stretch_size);
+ sml->set_screen_stretch(sml_sm, sml_aspect, stretch_size, stretch_shrink);
- sml->set_auto_accept_quit(GLOBAL_DEF("application/auto_accept_quit", true));
- sml->set_quit_on_go_back(GLOBAL_DEF("application/quit_on_go_back", true));
- String appname = GlobalConfig::get_singleton()->get("application/name");
+ sml->set_auto_accept_quit(GLOBAL_DEF("application/config/auto_accept_quit", true));
+ sml->set_quit_on_go_back(GLOBAL_DEF("application/config/quit_on_go_back", true));
+ String appname = ProjectSettings::get_singleton()->get("application/config/name");
appname = TranslationServer::get_singleton()->translate(appname);
OS::get_singleton()->set_window_title(appname);
- int shadow_atlas_size = GLOBAL_DEF("rendering/shadow_atlas/size", 2048);
- int shadow_atlas_q0_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_0_subdiv", 2);
- int shadow_atlas_q1_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_1_subdiv", 2);
- int shadow_atlas_q2_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_2_subdiv", 3);
- int shadow_atlas_q3_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_3_subdiv", 4);
+ int shadow_atlas_size = GLOBAL_GET("rendering/quality/shadow_atlas/size");
+ int shadow_atlas_q0_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_0_subdiv");
+ int shadow_atlas_q1_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_1_subdiv");
+ int shadow_atlas_q2_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_2_subdiv");
+ int shadow_atlas_q3_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_3_subdiv");
sml->get_root()->set_shadow_atlas_size(shadow_atlas_size);
sml->get_root()->set_shadow_atlas_quadrant_subdiv(0, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q0_subdiv));
sml->get_root()->set_shadow_atlas_quadrant_subdiv(1, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q1_subdiv));
sml->get_root()->set_shadow_atlas_quadrant_subdiv(2, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q2_subdiv));
sml->get_root()->set_shadow_atlas_quadrant_subdiv(3, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q3_subdiv));
+ Viewport::Usage usage = Viewport::Usage(int(GLOBAL_GET("rendering/quality/intended_usage/framebuffer_allocation")));
+ sml->get_root()->set_usage(usage);
} else {
- GLOBAL_DEF("display/stretch/mode", "disabled");
- GlobalConfig::get_singleton()->set_custom_property_info("display/stretch/mode", PropertyInfo(Variant::STRING, "display/stretch/mode", PROPERTY_HINT_ENUM, "disabled,2d,viewport"));
- GLOBAL_DEF("display/stretch/aspect", "ignore");
- GlobalConfig::get_singleton()->set_custom_property_info("display/stretch/aspect", PropertyInfo(Variant::STRING, "display/stretch/aspect", PROPERTY_HINT_ENUM, "ignore,keep,keep_width,keep_height"));
- sml->set_auto_accept_quit(GLOBAL_DEF("application/auto_accept_quit", true));
- sml->set_quit_on_go_back(GLOBAL_DEF("application/quit_on_go_back", true));
-
- GLOBAL_DEF("rendering/shadow_atlas/size", 2048);
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/size", PropertyInfo(Variant::INT, "rendering/shadow_atlas/size", PROPERTY_HINT_RANGE, "256,16384"));
-
- GLOBAL_DEF("rendering/shadow_atlas/quadrant_0_subdiv", 2);
- GLOBAL_DEF("rendering/shadow_atlas/quadrant_1_subdiv", 2);
- GLOBAL_DEF("rendering/shadow_atlas/quadrant_2_subdiv", 3);
- GLOBAL_DEF("rendering/shadow_atlas/quadrant_3_subdiv", 4);
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_0_subdiv", PropertyInfo(Variant::INT, "rendering/shadow_atlas/quadrant_0_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"));
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_1_subdiv", PropertyInfo(Variant::INT, "rendering/shadow_atlas/quadrant_1_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"));
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_2_subdiv", PropertyInfo(Variant::INT, "rendering/shadow_atlas/quadrant_2_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"));
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_3_subdiv", PropertyInfo(Variant::INT, "rendering/shadow_atlas/quadrant_3_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"));
+ GLOBAL_DEF("display/window/stretch/mode", "disabled");
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/mode", PropertyInfo(Variant::STRING, "display/window/stretch/mode", PROPERTY_HINT_ENUM, "disabled,2d,viewport"));
+ GLOBAL_DEF("display/window/stretch/aspect", "ignore");
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/aspect", PropertyInfo(Variant::STRING, "display/window/stretch/aspect", PROPERTY_HINT_ENUM, "ignore,keep,keep_width,keep_height,expand"));
+ GLOBAL_DEF("display/window/stretch/shrink", 1);
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::STRING, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1,8,1"));
+ sml->set_auto_accept_quit(GLOBAL_DEF("application/config/auto_accept_quit", true));
+ sml->set_quit_on_go_back(GLOBAL_DEF("application/config/quit_on_go_back", true));
}
String local_game_path;
@@ -1291,7 +1321,7 @@ bool Main::start() {
if (!absolute) {
- if (GlobalConfig::get_singleton()->is_using_datapack()) {
+ if (ProjectSettings::get_singleton()->is_using_datapack()) {
local_game_path = "res://" + local_game_path;
@@ -1314,7 +1344,7 @@ bool Main::start() {
}
}
- local_game_path = GlobalConfig::get_singleton()->localize_path(local_game_path);
+ local_game_path = ProjectSettings::get_singleton()->localize_path(local_game_path);
#ifdef TOOLS_ENABLED
if (editor) {
@@ -1340,7 +1370,7 @@ bool Main::start() {
if (game_path != "" || script != "") {
//autoload
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
//first pass, add the constants so they exist before any script is loaded
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -1349,7 +1379,7 @@ bool Main::start() {
if (!s.begins_with("autoload/"))
continue;
String name = s.get_slicec('/', 1);
- String path = GlobalConfig::get_singleton()->get(s);
+ String path = ProjectSettings::get_singleton()->get(s);
bool global_var = false;
if (path.begins_with("*")) {
global_var = true;
@@ -1370,7 +1400,7 @@ bool Main::start() {
if (!s.begins_with("autoload/"))
continue;
String name = s.get_slicec('/', 1);
- String path = GlobalConfig::get_singleton()->get(s);
+ String path = ProjectSettings::get_singleton()->get(s);
bool global_var = false;
if (path.begins_with("*")) {
global_var = true;
@@ -1433,10 +1463,11 @@ bool Main::start() {
//sml->get_root()->add_child(scene);
sml->add_current_scene(scene);
- String iconpath = GLOBAL_DEF("application/icon", "Variant()");
+ String iconpath = GLOBAL_DEF("application/config/icon", "Variant()");
if (iconpath != "") {
- Image icon;
- if (icon.load(iconpath) == OK)
+ Ref<Image> icon;
+ icon.instance();
+ if (icon->load(iconpath) == OK)
OS::get_singleton()->set_icon(icon);
}
}
@@ -1495,11 +1526,15 @@ static uint64_t idle_process_max = 0;
bool Main::iteration() {
uint64_t ticks = OS::get_singleton()->get_ticks_usec();
+ Engine::get_singleton()->_frame_ticks = ticks;
+
uint64_t ticks_elapsed = ticks - last_ticks;
double step = (double)ticks_elapsed / 1000000.0;
float frame_slice = 1.0 / Engine::get_singleton()->get_iterations_per_second();
+ Engine::get_singleton()->_frame_step = step;
+
/*
if (time_accum+step < frame_slice)
return false;
@@ -1607,7 +1642,7 @@ bool Main::iteration() {
if (frame > 1000000) {
- if (GLOBAL_DEF("debug/stdout/print_fps", OS::get_singleton()->is_stdout_verbose())) {
+ if (GLOBAL_DEF("debug/settings/stdout/print_fps", OS::get_singleton()->is_stdout_verbose())) {
print_line("FPS: " + itos(frames));
};
@@ -1665,14 +1700,17 @@ void Main::cleanup() {
OS::get_singleton()->_execpath = "";
OS::get_singleton()->_local_clipboard = "";
- if (audio_server) {
- memdelete(audio_server);
- }
+ ScriptServer::finish_languages();
#ifdef TOOLS_ENABLED
EditorNode::unregister_editor_types();
#endif
+ if (audio_server) {
+ audio_server->finish();
+ memdelete(audio_server);
+ }
+
unregister_driver_types();
unregister_module_types();
unregister_scene_types();
diff --git a/main/main.h b/main/main.h
index dadf45dfde..ca96e397ca 100644
--- a/main/main.h
+++ b/main/main.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/main/performance.cpp b/main/performance.cpp
index d566bc325f..3d8e21bf33 100644
--- a/main/performance.cpp
+++ b/main/performance.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,7 @@
#include "performance.h"
#include "message_queue.h"
#include "os/os.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
#include "servers/physics_2d_server.h"
#include "servers/physics_server.h"
#include "servers/visual_server.h"
@@ -116,8 +117,8 @@ float Performance::get_monitor(Monitor p_monitor) const {
case TIME_FIXED_PROCESS: return _fixed_process_time;
case MEMORY_STATIC: return Memory::get_mem_usage();
case MEMORY_DYNAMIC: return MemoryPool::total_memory;
- case MEMORY_STATIC_MAX: return MemoryPool::max_memory;
- case MEMORY_DYNAMIC_MAX: return 0;
+ case MEMORY_STATIC_MAX: return Memory::get_mem_max_usage();
+ case MEMORY_DYNAMIC_MAX: return MemoryPool::max_memory;
case MEMORY_MESSAGE_BUFFER_MAX: return MessageQueue::get_singleton()->get_max_buffer_usage();
case OBJECT_COUNT: return ObjectDB::get_object_count();
case OBJECT_RESOURCE_COUNT: return ResourceCache::get_cached_resource_count();
diff --git a/main/performance.h b/main/performance.h
index 03bec11296..75583c6c38 100644
--- a/main/performance.h
+++ b/main/performance.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/main/splash.h b/main/splash.h
deleted file mode 100644
index 401cf5a022..0000000000
--- a/main/splash.h
+++ /dev/null
@@ -1,1423 +0,0 @@
-/*************************************************************************/
-/* splash.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 BOOT_SPLASH_H
-#define BOOT_SPLASH_H
-
-static const unsigned char boot_splash_png[] = {
- 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
- 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x01, 0x03,
- 0x08, 0x06, 0x00, 0x00, 0x00, 0xdd, 0x81, 0x53, 0xf4, 0x00, 0x00, 0x00,
- 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x32, 0xdf, 0x00, 0x00, 0x32,
- 0xdf, 0x01, 0x17, 0xbe, 0xe4, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49,
- 0x4d, 0x45, 0x07, 0xde, 0x01, 0x19, 0x13, 0x08, 0x19, 0x46, 0x43, 0xd9,
- 0xbb, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d,
- 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64,
- 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81,
- 0x0e, 0x17, 0x00, 0x00, 0x20, 0x00, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda,
- 0xed, 0x9d, 0x79, 0x78, 0x54, 0xd5, 0xf9, 0xc7, 0x3f, 0xef, 0x9d, 0x49,
- 0xc2, 0x0e, 0xb2, 0xb9, 0xaf, 0xb8, 0x2f, 0x3f, 0xb5, 0xa8, 0xb4, 0xa2,
- 0x66, 0x66, 0x02, 0x04, 0xea, 0x5a, 0xad, 0x5a, 0x6d, 0xb5, 0x2e, 0xad,
- 0x56, 0x24, 0x1b, 0x04, 0xb5, 0x5a, 0x2b, 0xb6, 0x6a, 0x55, 0x02, 0x09,
- 0x09, 0xae, 0x5d, 0xd4, 0x5a, 0x6b, 0x15, 0xad, 0x15, 0x15, 0x48, 0x48,
- 0x66, 0x26, 0x50, 0x10, 0x17, 0x0a, 0x2a, 0x56, 0x51, 0x11, 0xd7, 0x8a,
- 0xec, 0x90, 0x00, 0x59, 0x66, 0xee, 0xfb, 0xfb, 0x63, 0x82, 0x04, 0x32,
- 0x09, 0x99, 0x9b, 0x99, 0x64, 0x92, 0x9c, 0xcf, 0xf3, 0xcc, 0x43, 0xb8,
- 0x33, 0xf7, 0xdc, 0x73, 0xde, 0x73, 0xbe, 0xe7, 0xbc, 0xe7, 0xdc, 0xb3,
- 0x80, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18,
- 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60,
- 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83,
- 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c,
- 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30,
- 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1,
- 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06,
- 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18,
- 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60,
- 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x86, 0x16,
- 0x19, 0x53, 0xe0, 0xdf, 0xaf, 0xbd, 0x9e, 0x95, 0x71, 0x5f, 0x79, 0x2f,
- 0x63, 0xf1, 0xce, 0x87, 0x18, 0x13, 0x24, 0x81, 0x50, 0xa7, 0x96, 0x0a,
- 0x92, 0x76, 0xb4, 0xc0, 0x39, 0xa0, 0xe7, 0x00, 0xe7, 0x00, 0x43, 0x4a,
- 0xf3, 0xbd, 0x09, 0x17, 0x55, 0x66, 0x81, 0xdf, 0x07, 0x52, 0x0e, 0x2c,
- 0x05, 0x16, 0x00, 0x0b, 0xdc, 0x96, 0x1d, 0x7c, 0x6d, 0x62, 0xc6, 0x16,
- 0x93, 0x33, 0x46, 0xbc, 0x86, 0x28, 0x8c, 0x9b, 0x56, 0xe9, 0xb2, 0x35,
- 0xec, 0x01, 0xb9, 0x00, 0x38, 0x0f, 0x38, 0xa2, 0x69, 0xee, 0xc8, 0x43,
- 0xa5, 0x93, 0x3c, 0x13, 0x12, 0x2b, 0xde, 0x40, 0x15, 0xd0, 0x27, 0xca,
- 0x57, 0x0b, 0x15, 0x5e, 0x01, 0x99, 0x5d, 0x96, 0xef, 0x59, 0x69, 0x72,
- 0xcc, 0x88, 0xb7, 0x5b, 0xf3, 0xc3, 0x82, 0x0a, 0xcb, 0xc6, 0xf2, 0x2a,
- 0xfc, 0x1c, 0xb8, 0x08, 0xe8, 0xbb, 0x97, 0x5b, 0xea, 0x43, 0x75, 0xe1,
- 0xfe, 0x15, 0xb7, 0x8f, 0xda, 0x91, 0x10, 0xe1, 0x4e, 0x0d, 0xdc, 0x88,
- 0xf0, 0x68, 0x2b, 0x7e, 0xfa, 0x11, 0xf0, 0xac, 0xad, 0xfa, 0xd4, 0xfc,
- 0xc9, 0xbe, 0xd5, 0x26, 0x27, 0x8d, 0x78, 0xbb, 0x0d, 0x63, 0x0b, 0x02,
- 0x47, 0x2a, 0x5c, 0x0b, 0x5c, 0x05, 0x1c, 0x1c, 0xe3, 0xed, 0xf3, 0x4b,
- 0xf3, 0xbd, 0x63, 0x12, 0xd4, 0xea, 0xd6, 0x03, 0xee, 0x18, 0x6f, 0x5b,
- 0x08, 0x3c, 0x95, 0x52, 0x5f, 0xfb, 0xb7, 0x57, 0x7f, 0x3d, 0xb6, 0xd6,
- 0xe4, 0xae, 0x11, 0x6f, 0x97, 0xe3, 0xfc, 0x29, 0xaf, 0x48, 0x5d, 0xdf,
- 0x3e, 0x67, 0xa1, 0xe4, 0x03, 0x17, 0xb4, 0x21, 0xa8, 0xb0, 0x25, 0x1c,
- 0x32, 0x77, 0x92, 0xf7, 0x7f, 0x71, 0x16, 0x6e, 0x09, 0xd0, 0x16, 0x97,
- 0x7c, 0x1b, 0x50, 0x62, 0xa1, 0xd3, 0xe7, 0xe6, 0xfb, 0xd6, 0x99, 0x1c,
- 0x37, 0xe2, 0xed, 0x12, 0x8c, 0x29, 0x08, 0x64, 0x0a, 0xdc, 0x0d, 0x8c,
- 0x88, 0x53, 0x90, 0x1f, 0x96, 0xe6, 0x7b, 0x8f, 0x8b, 0x5b, 0x7f, 0xbb,
- 0x78, 0x4e, 0x9a, 0x5d, 0xd7, 0x73, 0x3b, 0x60, 0xc5, 0x21, 0x38, 0x1b,
- 0xf8, 0x6b, 0x8a, 0x86, 0xb2, 0x5e, 0x9d, 0x3c, 0xba, 0xda, 0xe4, 0x7e,
- 0xfb, 0x61, 0x19, 0x13, 0x24, 0xa4, 0x46, 0x1c, 0x1f, 0x47, 0xe1, 0x02,
- 0x1c, 0x93, 0x39, 0x3d, 0x70, 0x54, 0xbc, 0x02, 0xb3, 0xeb, 0x7a, 0x3e,
- 0x17, 0xc7, 0xbc, 0xb7, 0x80, 0x6b, 0xea, 0xc5, 0x3d, 0xc0, 0xe4, 0xbc,
- 0x11, 0x6f, 0x57, 0x60, 0x6d, 0xdc, 0xeb, 0x03, 0x9b, 0x57, 0xe3, 0xd4,
- 0xea, 0xba, 0x80, 0xf3, 0x13, 0x90, 0xe6, 0xb0, 0xc9, 0x76, 0x23, 0x5e,
- 0x23, 0xde, 0xe8, 0x1c, 0x39, 0x66, 0xaa, 0xff, 0x80, 0x38, 0xb4, 0xba,
- 0x7f, 0x4a, 0x50, 0xbe, 0x1b, 0xf1, 0x1a, 0xf1, 0x1a, 0xf1, 0x36, 0x97,
- 0x57, 0x22, 0xf2, 0x4a, 0x1c, 0xc2, 0xb9, 0x3a, 0x41, 0x9d, 0x05, 0x23,
- 0x5e, 0x23, 0xde, 0x2e, 0x80, 0x26, 0x44, 0xbc, 0x00, 0xa7, 0x8c, 0x2a,
- 0x2c, 0x77, 0xdc, 0xb7, 0xcc, 0x2c, 0x08, 0x4c, 0x4b, 0x54, 0x9e, 0x4b,
- 0x64, 0xe0, 0xca, 0xd0, 0x8e, 0xb8, 0x8d, 0x09, 0x12, 0x52, 0x92, 0x13,
- 0x25, 0x5e, 0xcb, 0x15, 0x76, 0xbd, 0x04, 0x78, 0x77, 0x5e, 0x18, 0x53,
- 0x10, 0x18, 0xec, 0xb2, 0xb4, 0x4f, 0xd8, 0x96, 0x5e, 0x88, 0xf4, 0x06,
- 0x3b, 0x84, 0x6d, 0x6d, 0x03, 0x7b, 0x5b, 0x38, 0xc5, 0xde, 0x52, 0x91,
- 0x3b, 0xaa, 0xf1, 0x08, 0x70, 0x6e, 0xe2, 0xea, 0x2b, 0x35, 0x2d, 0xaf,
- 0x11, 0x6f, 0x57, 0x68, 0x78, 0x59, 0x9b, 0xc0, 0x77, 0x70, 0xe7, 0x64,
- 0x16, 0x04, 0xca, 0x80, 0x43, 0x81, 0x43, 0x80, 0x1e, 0xb6, 0x2d, 0x91,
- 0x77, 0x7e, 0xaa, 0x91, 0x36, 0x50, 0x22, 0xff, 0xba, 0x43, 0x2e, 0x32,
- 0x0b, 0x02, 0x1b, 0x80, 0xcf, 0x81, 0x4d, 0x09, 0xf6, 0xb4, 0x8c, 0x78,
- 0x8d, 0x78, 0xbb, 0x42, 0xc3, 0x4b, 0x55, 0x82, 0xbb, 0x3a, 0xa3, 0x63,
- 0xf8, 0xfd, 0xa0, 0x86, 0x4f, 0xa2, 0xab, 0xac, 0x7a, 0x93, 0xf3, 0xa6,
- 0xcf, 0xdb, 0xf9, 0xc5, 0x2b, 0x52, 0xd3, 0xcd, 0x92, 0x1c, 0xaa, 0x75,
- 0x89, 0x11, 0xaf, 0x11, 0x6f, 0x17, 0x70, 0x9b, 0x95, 0xee, 0x36, 0xe7,
- 0xf7, 0x83, 0x60, 0x9e, 0x57, 0x4d, 0xce, 0x1b, 0xf1, 0x76, 0x05, 0xf5,
- 0x76, 0x37, 0xf1, 0xbe, 0x63, 0x32, 0xdd, 0x88, 0xb7, 0x4b, 0x60, 0x63,
- 0xd5, 0x18, 0xf1, 0x1a, 0x8c, 0x78, 0x3b, 0x21, 0xf3, 0x27, 0xa7, 0xdb,
- 0x44, 0x46, 0x78, 0xbb, 0x49, 0x27, 0x5f, 0x97, 0x9b, 0x5c, 0x37, 0xe2,
- 0xed, 0x4a, 0xac, 0xe8, 0x36, 0xda, 0xb5, 0xd5, 0xec, 0xb4, 0xd1, 0x11,
- 0x76, 0x37, 0x26, 0x88, 0x2f, 0x63, 0xa7, 0xf9, 0x53, 0x54, 0xe5, 0x76,
- 0xe0, 0x4e, 0xc0, 0xd5, 0x4d, 0x92, 0xbd, 0x5a, 0x85, 0x5f, 0x95, 0x4d,
- 0xf2, 0x96, 0x99, 0x12, 0x60, 0xc4, 0xdb, 0x29, 0xc9, 0x2c, 0x08, 0x8c,
- 0x06, 0x1e, 0x01, 0x86, 0x75, 0x53, 0x13, 0x3c, 0x6f, 0x5b, 0xf6, 0xcd,
- 0xf3, 0x27, 0x66, 0xac, 0x37, 0xa5, 0xc1, 0x88, 0x37, 0x21, 0x8c, 0x7b,
- 0x20, 0xe0, 0xb2, 0x5d, 0x72, 0xbf, 0xaa, 0xce, 0x2e, 0x9b, 0xec, 0x5d,
- 0xd8, 0xd6, 0xf0, 0x46, 0x15, 0x2f, 0xe8, 0xe9, 0xaa, 0x0f, 0x17, 0xa3,
- 0xfc, 0xc2, 0x14, 0x29, 0x6a, 0x54, 0xf9, 0xa5, 0x1d, 0x0e, 0x3d, 0x53,
- 0x7e, 0xdb, 0xe8, 0x36, 0xbd, 0x3e, 0x1a, 0xfe, 0xd8, 0xdb, 0xd6, 0xe0,
- 0xad, 0x55, 0x13, 0x10, 0xde, 0x2f, 0xcd, 0xf7, 0x56, 0x18, 0xd3, 0x1a,
- 0xf1, 0x92, 0x59, 0x10, 0xb8, 0x1b, 0xf8, 0x2d, 0xa0, 0xc0, 0x6c, 0x41,
- 0x7f, 0x3d, 0x2f, 0xdf, 0xf7, 0x81, 0xa3, 0xb0, 0xa6, 0xfa, 0x47, 0x22,
- 0xf2, 0x2c, 0xb1, 0xef, 0x4d, 0xd5, 0xd5, 0x79, 0xc1, 0x25, 0xae, 0xeb,
- 0xe7, 0x4c, 0x3a, 0x67, 0xab, 0xb3, 0x3c, 0x0a, 0x5e, 0x0e, 0xfa, 0x00,
- 0x91, 0x69, 0xa0, 0x21, 0x41, 0x4f, 0x99, 0x97, 0xef, 0x7b, 0xdf, 0x98,
- 0xb5, 0x1b, 0x8b, 0x37, 0xb3, 0x20, 0x70, 0x25, 0xf0, 0xcc, 0x1e, 0x97,
- 0x43, 0xc0, 0x13, 0x02, 0x77, 0xce, 0xcb, 0xf7, 0x7e, 0xdb, 0x9a, 0x70,
- 0xc6, 0x14, 0x04, 0x5c, 0x12, 0xe9, 0xd7, 0xde, 0x65, 0x8a, 0x51, 0xb3,
- 0x6c, 0x14, 0xe4, 0xfc, 0x79, 0xf9, 0x9e, 0xc5, 0xad, 0xbd, 0x61, 0xcc,
- 0xb4, 0x80, 0x4f, 0x94, 0x07, 0x81, 0xe1, 0x7b, 0x7c, 0xb5, 0x49, 0x2c,
- 0xfb, 0xb8, 0x79, 0x13, 0x33, 0xbe, 0x35, 0x66, 0xed, 0x86, 0xe2, 0xcd,
- 0x2c, 0xf0, 0xff, 0x00, 0x64, 0x51, 0x0b, 0xe9, 0xde, 0x01, 0x4c, 0x4d,
- 0xad, 0xae, 0xfe, 0xfd, 0x2b, 0x53, 0xce, 0x0f, 0x35, 0x17, 0xce, 0xe8,
- 0xe9, 0xc1, 0xfe, 0x96, 0xad, 0xcf, 0x01, 0x99, 0xa6, 0x08, 0xb5, 0x8a,
- 0x5b, 0xc2, 0xa1, 0xd0, 0xb4, 0xf2, 0xdb, 0x46, 0xdb, 0x2d, 0x78, 0x30,
- 0xc3, 0x10, 0x29, 0x06, 0xc6, 0xb5, 0x90, 0x3f, 0x1f, 0x28, 0x32, 0xa2,
- 0x2c, 0xdf, 0x53, 0x65, 0x4c, 0xda, 0x8d, 0xc4, 0x3b, 0xf6, 0x41, 0xff,
- 0xe1, 0x6a, 0xc9, 0x7b, 0x40, 0xef, 0x56, 0xfc, 0xfc, 0x33, 0x81, 0x5f,
- 0xcd, 0xcb, 0xf7, 0x96, 0x36, 0x09, 0xa7, 0x20, 0x78, 0x82, 0xa2, 0x15,
- 0xc0, 0xbe, 0xa6, 0xf8, 0xc4, 0xc4, 0x4b, 0x82, 0x5e, 0x39, 0x2f, 0xdf,
- 0x57, 0xb3, 0x67, 0xbf, 0x76, 0x50, 0x55, 0xd5, 0x6f, 0x04, 0xee, 0x00,
- 0x52, 0x5b, 0x11, 0xce, 0x5c, 0x4b, 0xac, 0x8b, 0xe6, 0x4e, 0x4a, 0xaf,
- 0x33, 0xe2, 0xed, 0x06, 0x8c, 0x9b, 0xea, 0x1f, 0x68, 0x8b, 0x2c, 0x23,
- 0xb2, 0x84, 0xae, 0xb5, 0x28, 0xf0, 0x0f, 0x45, 0xb3, 0xcb, 0xf2, 0x7d,
- 0xeb, 0x1b, 0x5c, 0xee, 0x4c, 0xe0, 0x15, 0x20, 0xc5, 0x68, 0xd1, 0x11,
- 0xff, 0xc1, 0xd2, 0x8c, 0xd2, 0x89, 0xbe, 0xcd, 0x0d, 0xfd, 0xda, 0x0c,
- 0xd0, 0xc7, 0x89, 0x76, 0x5a, 0x44, 0xcb, 0x14, 0xd7, 0xf6, 0x24, 0x37,
- 0x78, 0x73, 0xf7, 0x9e, 0x4f, 0xdd, 0xe5, 0xc5, 0x9b, 0x39, 0x35, 0xd0,
- 0x13, 0x61, 0x3e, 0x30, 0xd2, 0x61, 0x10, 0xd5, 0x0a, 0xb7, 0xa2, 0x84,
- 0xa5, 0x75, 0xa7, 0x0b, 0x18, 0x5a, 0xe6, 0x7f, 0xaa, 0x7a, 0xae, 0x88,
- 0x4c, 0x04, 0x7e, 0x8a, 0xc3, 0x89, 0x42, 0x02, 0x37, 0xcf, 0xcb, 0xf7,
- 0x3e, 0x6c, 0xc4, 0xdb, 0x45, 0x19, 0x33, 0xb5, 0x54, 0x44, 0x52, 0x9f,
- 0x24, 0x61, 0xfb, 0x36, 0x19, 0x3a, 0xb8, 0xf0, 0x7a, 0xe7, 0xe5, 0x7b,
- 0x83, 0xdd, 0x35, 0xfd, 0x5d, 0x7a, 0x7a, 0xa4, 0x48, 0xea, 0xe5, 0x46,
- 0xb8, 0x5d, 0x17, 0x85, 0x57, 0x32, 0x0b, 0x82, 0x43, 0x4d, 0xcb, 0xdb,
- 0xf5, 0xdc, 0xe5, 0xc3, 0x11, 0x56, 0x9a, 0xfe, 0x69, 0x97, 0xa7, 0x52,
- 0x61, 0x74, 0x59, 0xbe, 0xb7, 0xdb, 0x6d, 0x06, 0xd0, 0x25, 0x5b, 0xde,
- 0xb1, 0xd3, 0xfc, 0x3d, 0x11, 0x66, 0x1b, 0xe1, 0x76, 0x0b, 0xd2, 0x45,
- 0xc8, 0x32, 0x6e, 0x73, 0x57, 0x71, 0xa7, 0x54, 0xee, 0x04, 0x4e, 0x34,
- 0xe5, 0xba, 0xdb, 0xf8, 0xcf, 0xd3, 0x32, 0xa7, 0x06, 0x4e, 0x30, 0x6e,
- 0x73, 0x67, 0x77, 0x97, 0x0b, 0xfc, 0x27, 0x81, 0xbc, 0x6b, 0x4a, 0x74,
- 0xb7, 0xe3, 0x43, 0x81, 0x53, 0xe7, 0xe5, 0x7b, 0xbb, 0xcd, 0x46, 0x08,
- 0x5d, 0xaa, 0xe5, 0x1d, 0x53, 0xe0, 0x4f, 0x03, 0xf9, 0x87, 0x29, 0xc7,
- 0xdd, 0x92, 0x63, 0x51, 0x7e, 0x69, 0xdc, 0xe6, 0xce, 0xea, 0x46, 0xa8,
- 0xdc, 0x00, 0x1c, 0x6f, 0xca, 0x71, 0x37, 0xf5, 0x9e, 0x85, 0xa2, 0x31,
- 0x85, 0xc1, 0x43, 0x8d, 0x78, 0x3b, 0x9b, 0xbb, 0x3c, 0xbd, 0xb2, 0x07,
- 0xc2, 0xfd, 0xa6, 0x08, 0x77, 0x6b, 0x2c, 0x09, 0xeb, 0x8d, 0x46, 0xbc,
- 0x9d, 0x8c, 0xd2, 0x89, 0xe9, 0x35, 0xc0, 0x4d, 0xa6, 0xfc, 0x76, 0x6b,
- 0x6a, 0x41, 0x4b, 0x8c, 0x78, 0x3b, 0x21, 0x29, 0x96, 0xfd, 0x77, 0x60,
- 0xa1, 0x29, 0xc3, 0xdd, 0x96, 0x6b, 0x4b, 0xf3, 0x7d, 0xdf, 0x18, 0xf1,
- 0x76, 0x42, 0x5e, 0x9d, 0x98, 0x11, 0x02, 0xae, 0x22, 0xb2, 0x3e, 0xd7,
- 0xd0, 0xbd, 0xa8, 0xb4, 0xc2, 0xcc, 0xea, 0x56, 0x7d, 0x84, 0xae, 0x96,
- 0xa0, 0xd2, 0x7c, 0xef, 0xe7, 0xc0, 0x04, 0x53, 0x96, 0xbb, 0x15, 0x21,
- 0xb5, 0xf8, 0xd9, 0xdc, 0x5b, 0xbd, 0x21, 0x23, 0xde, 0x4e, 0x8e, 0xc2,
- 0x13, 0xc0, 0x52, 0x53, 0xa6, 0xbb, 0x09, 0xca, 0x8d, 0x65, 0x13, 0xbd,
- 0x5f, 0x75, 0xb7, 0x64, 0x77, 0x49, 0xf1, 0x96, 0xe5, 0x7b, 0xeb, 0x54,
- 0xb9, 0xcc, 0xb8, 0xcf, 0xdd, 0x82, 0x85, 0x61, 0xb7, 0xf5, 0x74, 0x77,
- 0x4c, 0x78, 0x97, 0x5d, 0x55, 0x54, 0x36, 0xd9, 0xfb, 0xa9, 0x98, 0x15,
- 0x45, 0x5d, 0x9d, 0x6a, 0x55, 0x7e, 0x5c, 0x9e, 0x97, 0x5e, 0x6f, 0xc4,
- 0xdb, 0xc5, 0xb0, 0xb5, 0xee, 0x1f, 0x34, 0xdd, 0x6c, 0xce, 0xd0, 0x45,
- 0x10, 0x95, 0x0b, 0xca, 0x26, 0x7b, 0xd7, 0x76, 0xdb, 0xf4, 0x77, 0xf5,
- 0x04, 0x8e, 0x29, 0x08, 0xf6, 0x13, 0x74, 0x05, 0x66, 0x6b, 0xd6, 0xae,
- 0xc6, 0x83, 0xa5, 0xf9, 0xde, 0x5b, 0xbb, 0xb3, 0x01, 0xba, 0xfc, 0x59,
- 0x45, 0x65, 0xf9, 0x9e, 0xad, 0xaa, 0x7a, 0x2e, 0x91, 0x3d, 0xa9, 0x0c,
- 0x5d, 0x83, 0x77, 0xb1, 0xcc, 0x96, 0xbb, 0xdd, 0xe2, 0xa0, 0xb1, 0xb2,
- 0xc9, 0xbe, 0xf7, 0x80, 0x9b, 0x4d, 0x99, 0xef, 0x12, 0xd4, 0xdb, 0x22,
- 0xe7, 0x96, 0x4e, 0xf4, 0xd6, 0x18, 0xf1, 0x76, 0x1f, 0xca, 0x4d, 0xb9,
- 0xef, 0x12, 0x6c, 0x98, 0x3f, 0xc9, 0xf3, 0x95, 0x31, 0x83, 0x39, 0xe2,
- 0xd3, 0x60, 0xe8, 0xb4, 0xb8, 0x8d, 0x09, 0xda, 0x8e, 0x00, 0x47, 0x0c,
- 0xed, 0xc3, 0x0f, 0x8e, 0x1c, 0xcc, 0x89, 0x07, 0xf6, 0x67, 0x50, 0x9f,
- 0x34, 0x06, 0xf6, 0x4e, 0x65, 0x7b, 0x5d, 0x98, 0x0d, 0xd5, 0xb5, 0x7c,
- 0xb5, 0x69, 0x07, 0x4b, 0x3e, 0x59, 0xcf, 0x5b, 0xab, 0x37, 0x50, 0x1b,
- 0xb2, 0x3b, 0x7f, 0x7a, 0x05, 0x4e, 0x39, 0x64, 0x1f, 0x7e, 0x30, 0x6c,
- 0x30, 0xc3, 0x86, 0xf6, 0x61, 0x50, 0x9f, 0x34, 0xfa, 0xf7, 0x4a, 0x61,
- 0xf3, 0xb6, 0x3a, 0xd6, 0x57, 0xd7, 0xf2, 0xc9, 0xb7, 0xd5, 0xbc, 0xbe,
- 0x6a, 0x3d, 0x2b, 0xbe, 0xda, 0x82, 0xad, 0x66, 0xa8, 0xc1, 0x88, 0x37,
- 0x49, 0x45, 0x7b, 0xea, 0x61, 0xfb, 0x70, 0xfd, 0xd9, 0xc3, 0x18, 0x36,
- 0xb4, 0x4f, 0x93, 0xef, 0x7b, 0xa7, 0xb9, 0x19, 0xd2, 0x37, 0x8d, 0x63,
- 0xf7, 0xef, 0xc7, 0xa8, 0xe3, 0xf7, 0x25, 0x14, 0xb6, 0x99, 0xf5, 0xd6,
- 0x97, 0xfc, 0xfd, 0x8d, 0xcf, 0xa9, 0xef, 0xa4, 0x22, 0x3e, 0xef, 0xe4,
- 0x03, 0xf8, 0xf9, 0x59, 0x47, 0xd0, 0xb7, 0x47, 0xd3, 0xa2, 0xd3, 0x73,
- 0x40, 0x4f, 0xf6, 0x1f, 0xd0, 0x93, 0x93, 0x0e, 0x1a, 0xc0, 0x8f, 0x86,
- 0x1f, 0xc4, 0x86, 0xea, 0x3a, 0x9e, 0xfa, 0xf7, 0xa7, 0x94, 0xff, 0xf7,
- 0x5b, 0x23, 0xe2, 0x04, 0x95, 0xbf, 0x6e, 0x41, 0x66, 0x41, 0xe0, 0x28,
- 0xe0, 0xa3, 0x78, 0x85, 0x97, 0xe6, 0xb6, 0xb8, 0xf5, 0xdc, 0xe3, 0x38,
- 0xf3, 0xc8, 0x21, 0x31, 0xdf, 0x5b, 0x5d, 0x1b, 0xe2, 0x77, 0x2f, 0xaf,
- 0xe0, 0xdd, 0x2f, 0x37, 0x77, 0x1a, 0xfb, 0x0d, 0xe9, 0x9b, 0xc6, 0x03,
- 0x97, 0x9d, 0xc2, 0x01, 0x03, 0x7a, 0xc6, 0x7c, 0xef, 0xaa, 0xb5, 0xd5,
- 0xdc, 0xf1, 0xe2, 0xbb, 0x6c, 0xde, 0x1e, 0x97, 0x13, 0x4a, 0xd6, 0x94,
- 0xe6, 0x7b, 0xf7, 0x37, 0xd2, 0x35, 0x7d, 0x5e, 0x47, 0xf4, 0xef, 0x95,
- 0x4a, 0xc9, 0xcf, 0x4e, 0x73, 0x24, 0x5c, 0x80, 0x3e, 0x69, 0x6e, 0xfe,
- 0xf0, 0xe3, 0x93, 0x39, 0xff, 0x94, 0x03, 0x3a, 0x45, 0x7a, 0xff, 0xef,
- 0xe0, 0x01, 0xfc, 0xf9, 0xba, 0x11, 0x8e, 0x84, 0x0b, 0x30, 0x6c, 0x68,
- 0x1f, 0xfe, 0x7c, 0xfd, 0x19, 0x51, 0xbd, 0x13, 0x83, 0x11, 0x6f, 0xbb,
- 0xd1, 0x23, 0xc5, 0x45, 0xd1, 0x15, 0xa7, 0x72, 0xc8, 0xa0, 0x5e, 0x6d,
- 0x0a, 0xc7, 0x65, 0x09, 0x37, 0xf9, 0x8e, 0xe2, 0xfb, 0xc3, 0x06, 0x25,
- 0x75, 0x7a, 0x87, 0xf6, 0xeb, 0xc1, 0x7d, 0x97, 0x9c, 0x4c, 0xaa, 0xbb,
- 0x6d, 0x45, 0xa5, 0x77, 0xaa, 0x9b, 0xa2, 0x2b, 0xbf, 0xc7, 0xa0, 0x3e,
- 0x69, 0xa6, 0x10, 0x99, 0x3e, 0x6f, 0x07, 0xd4, 0x74, 0x22, 0xfc, 0xfa,
- 0xbc, 0xe3, 0xd9, 0xbf, 0x85, 0x16, 0x68, 0xe5, 0xca, 0x95, 0x94, 0x97,
- 0x57, 0xf0, 0xce, 0x3b, 0xef, 0xb0, 0x61, 0xfd, 0x06, 0x5c, 0x2e, 0x17,
- 0x43, 0x86, 0x0c, 0x61, 0xf8, 0xf0, 0xef, 0x31, 0x6a, 0xf4, 0x28, 0x0e,
- 0x39, 0xe4, 0x90, 0xdd, 0xc2, 0xbb, 0xe3, 0xfc, 0x13, 0xb8, 0xe6, 0x4f,
- 0x6f, 0xb0, 0xa1, 0xba, 0x36, 0x29, 0xd3, 0xfc, 0xd0, 0x55, 0xc3, 0x71,
- 0xbb, 0x76, 0xef, 0x5d, 0x55, 0x55, 0x55, 0x31, 0xe7, 0xb5, 0x39, 0x2c,
- 0x59, 0xb2, 0x84, 0x35, 0x6b, 0xbe, 0x65, 0xc7, 0x8e, 0x1d, 0x0c, 0x1a,
- 0x34, 0x90, 0xe3, 0x8e, 0x3b, 0x8e, 0xb3, 0xcf, 0x3e, 0x9b, 0x33, 0x46,
- 0x9c, 0x81, 0x48, 0xd3, 0x1e, 0x59, 0x8a, 0xcb, 0xa2, 0xf0, 0x8a, 0x53,
- 0xf9, 0xe5, 0x13, 0x6f, 0x76, 0x89, 0x81, 0x3b, 0xd3, 0xe7, 0xed, 0x44,
- 0x7d, 0xde, 0x63, 0xf7, 0xef, 0x47, 0xd1, 0x95, 0xdf, 0x8b, 0xfa, 0x5d,
- 0x4d, 0x4d, 0x0d, 0x0f, 0xdc, 0xff, 0x20, 0x95, 0x95, 0x95, 0xcd, 0x8b,
- 0xdf, 0xb2, 0x38, 0xff, 0xfc, 0xf3, 0xc8, 0xc9, 0xcd, 0xd9, 0xed, 0xfa,
- 0xea, 0x75, 0xd5, 0xdc, 0xf4, 0xd7, 0xb7, 0x93, 0xce, 0x66, 0x37, 0x67,
- 0x1c, 0xc5, 0xf9, 0xa7, 0x1c, 0xb8, 0xdb, 0xb5, 0x67, 0x9f, 0xfd, 0x07,
- 0x4f, 0x3e, 0xf1, 0x24, 0xf5, 0xf5, 0xcd, 0xaf, 0x05, 0x38, 0xf1, 0xc4,
- 0x13, 0xb9, 0xf3, 0xb7, 0xbf, 0x61, 0xc8, 0x90, 0xe8, 0xdd, 0x8a, 0x87,
- 0xfd, 0x1f, 0x33, 0x7b, 0xd9, 0xd7, 0xa6, 0xcf, 0x6b, 0xdc, 0xe6, 0x76,
- 0x72, 0x51, 0x2c, 0xe1, 0xf6, 0xf3, 0xa2, 0x6f, 0x4c, 0xb9, 0x65, 0xcb,
- 0x16, 0xae, 0xbb, 0xf6, 0xfa, 0x16, 0x85, 0x0b, 0x60, 0xdb, 0x36, 0x2f,
- 0xbf, 0x3c, 0x9b, 0x1b, 0x6f, 0xf8, 0x15, 0xb6, 0xbd, 0xab, 0xe5, 0x39,
- 0x6c, 0x70, 0x1f, 0x0e, 0x1f, 0xd2, 0xbb, 0x4d, 0xf1, 0x73, 0x59, 0x42,
- 0xfa, 0x31, 0x43, 0xb9, 0xe6, 0xac, 0xc3, 0x19, 0x7d, 0xc2, 0x7e, 0x51,
- 0x47, 0x83, 0x63, 0x4d, 0xef, 0xb8, 0xff, 0xdb, 0xbd, 0x4f, 0x7e, 0xef,
- 0x3d, 0xf7, 0xf2, 0xc7, 0xc7, 0xff, 0xd8, 0xa2, 0x70, 0x01, 0x56, 0xac,
- 0x58, 0xc1, 0xd5, 0x57, 0xfd, 0x9c, 0xcf, 0x56, 0x7f, 0x16, 0xf5, 0xfb,
- 0x5f, 0x79, 0x8f, 0xa4, 0x4f, 0x9a, 0x71, 0xfa, 0x8c, 0x78, 0xdb, 0x89,
- 0x21, 0xfd, 0x7a, 0x30, 0xb4, 0x5f, 0x8f, 0x26, 0xd7, 0x6b, 0x6b, 0x6b,
- 0xc9, 0xce, 0xca, 0x61, 0xcd, 0x9a, 0x35, 0xad, 0x0e, 0xeb, 0xe3, 0x8f,
- 0x3f, 0x66, 0x72, 0xfe, 0xe4, 0x5d, 0xee, 0x8f, 0x40, 0xce, 0xe8, 0x63,
- 0x1c, 0xc7, 0xed, 0xc8, 0xa1, 0x7d, 0x78, 0xf6, 0x57, 0x67, 0xf2, 0xeb,
- 0xf3, 0x8e, 0xe7, 0x27, 0x23, 0x0e, 0x65, 0xd2, 0xd8, 0x63, 0xf9, 0xc7,
- 0x4d, 0x23, 0x19, 0x7b, 0x92, 0xf3, 0x06, 0xea, 0x82, 0xef, 0x1d, 0x84,
- 0xdb, 0xda, 0xe5, 0x98, 0x3d, 0xf6, 0xe8, 0x63, 0x54, 0x54, 0xf8, 0x5b,
- 0x7d, 0x7f, 0x6d, 0x6d, 0x2d, 0xe3, 0xc7, 0xdf, 0x4c, 0x55, 0x55, 0x55,
- 0xd4, 0xee, 0xc7, 0xf1, 0x07, 0xf4, 0x37, 0x85, 0xca, 0x88, 0xb7, 0x7d,
- 0x38, 0xfb, 0xe8, 0xe8, 0x2e, 0x60, 0x69, 0x69, 0x29, 0x5f, 0x7e, 0xf9,
- 0x65, 0xcc, 0xe1, 0x2d, 0x5f, 0xfe, 0x0e, 0xff, 0xf9, 0xcf, 0xb2, 0x46,
- 0xad, 0xaf, 0xb3, 0x96, 0xd7, 0x65, 0x09, 0x45, 0x3f, 0x1d, 0x4e, 0xbf,
- 0x9e, 0x29, 0x4d, 0xae, 0xe7, 0x8e, 0x39, 0x86, 0x81, 0xbd, 0x53, 0x1d,
- 0x85, 0x7b, 0xe9, 0x69, 0x07, 0x37, 0xea, 0xe3, 0x56, 0xf3, 0xc2, 0x0b,
- 0x2f, 0xc6, 0x1c, 0x46, 0x4d, 0x4d, 0x0d, 0x0f, 0x3e, 0x30, 0x35, 0xea,
- 0x77, 0x3f, 0x3b, 0xf3, 0x30, 0x53, 0xa8, 0x8c, 0x78, 0xdb, 0xa9, 0xcf,
- 0x7c, 0xe2, 0xfe, 0x51, 0x5b, 0x97, 0x92, 0xe2, 0x99, 0x8e, 0xc2, 0x53,
- 0x55, 0xee, 0xbb, 0xf7, 0xbe, 0xef, 0xfe, 0x9f, 0x96, 0xe2, 0xc2, 0x65,
- 0xc5, 0x3e, 0x04, 0x71, 0xf8, 0xe0, 0x3e, 0xbb, 0xb5, 0x90, 0x7b, 0xf2,
- 0x93, 0x11, 0xce, 0xf6, 0x20, 0xef, 0xd3, 0xc8, 0xed, 0xbe, 0xe7, 0x9e,
- 0x7b, 0x08, 0x87, 0xc3, 0x8e, 0xc2, 0x59, 0xb4, 0x68, 0x11, 0x9b, 0x37,
- 0x37, 0x7d, 0x9f, 0x7d, 0xf4, 0x7e, 0x7d, 0x49, 0x73, 0x9b, 0xe2, 0x67,
- 0xc4, 0x9b, 0x68, 0x23, 0x09, 0xec, 0x3f, 0xa0, 0xa9, 0xcb, 0xbc, 0x61,
- 0xfd, 0x06, 0xc7, 0x85, 0x1a, 0x60, 0xeb, 0xd6, 0xad, 0xbb, 0x5c, 0x67,
- 0xe0, 0xe0, 0x81, 0xb1, 0xbf, 0x7e, 0x3a, 0xed, 0xf0, 0x81, 0x2d, 0x7e,
- 0x3f, 0xc2, 0xe1, 0xab, 0x28, 0xab, 0xd1, 0x68, 0xf1, 0x7b, 0xef, 0xbe,
- 0xd7, 0x26, 0xfb, 0xad, 0x58, 0xb1, 0x22, 0xea, 0xf5, 0x54, 0xb7, 0xcb,
- 0x14, 0x2e, 0x23, 0xde, 0xc4, 0x92, 0xea, 0x76, 0xed, 0x56, 0x98, 0x77,
- 0xf2, 0x85, 0x03, 0x77, 0xb9, 0x31, 0xa1, 0x50, 0x88, 0xf5, 0xeb, 0xd7,
- 0xef, 0x72, 0x9d, 0x07, 0xf5, 0x76, 0x54, 0xb1, 0xb4, 0x84, 0xd3, 0xd7,
- 0x09, 0x8d, 0xbd, 0x80, 0x50, 0xa8, 0x6d, 0x5b, 0x81, 0xbd, 0xf5, 0x56,
- 0xf4, 0x91, 0xf4, 0x14, 0xb7, 0x98, 0xc2, 0x65, 0xc4, 0x9b, 0x58, 0x42,
- 0x76, 0xf4, 0x77, 0x92, 0x6b, 0xbf, 0x6d, 0xfb, 0x0e, 0x2c, 0xdf, 0x7c,
- 0xb3, 0x6b, 0xa0, 0x6b, 0xc3, 0xb6, 0xba, 0xa4, 0x49, 0x73, 0xe3, 0xb9,
- 0xc8, 0xb6, 0xdd, 0xb6, 0x77, 0xb2, 0xdf, 0xae, 0xf9, 0x36, 0xea, 0xf5,
- 0xb0, 0x6d, 0xe6, 0x3b, 0x1b, 0xf1, 0x26, 0x5a, 0xbc, 0x61, 0xa5, 0x6a,
- 0x47, 0xd3, 0xd7, 0x23, 0x07, 0x1c, 0xd8, 0xf6, 0xd7, 0x8d, 0x07, 0x1d,
- 0xb4, 0xeb, 0x3d, 0xea, 0xa7, 0xeb, 0xaa, 0x93, 0x48, 0xbc, 0x8d, 0x0a,
- 0x89, 0xd5, 0xb6, 0x62, 0x72, 0xe0, 0x81, 0xd1, 0xa7, 0x81, 0xd6, 0x99,
- 0x89, 0x1a, 0x46, 0xbc, 0xed, 0xc1, 0xf2, 0x28, 0x8b, 0x08, 0x0e, 0x3c,
- 0xf0, 0xc0, 0x36, 0x85, 0x99, 0x92, 0x92, 0xc2, 0x3e, 0xfb, 0xec, 0xf3,
- 0x5d, 0x05, 0xb1, 0xad, 0x36, 0x79, 0x76, 0xaa, 0x0d, 0x85, 0xed, 0xdd,
- 0xe2, 0xd9, 0x16, 0xce, 0x18, 0x71, 0x46, 0x93, 0x6b, 0xdb, 0x6a, 0x43,
- 0xd4, 0xd6, 0x1b, 0xf1, 0x1a, 0xf1, 0xb6, 0x03, 0x2f, 0x2d, 0x6d, 0xba,
- 0x79, 0xc3, 0xe0, 0xc1, 0x83, 0x49, 0x4d, 0x4d, 0x75, 0x1c, 0xe6, 0x4e,
- 0xe1, 0x02, 0x54, 0xd5, 0x24, 0xd7, 0xee, 0xa5, 0xcb, 0x3e, 0xdf, 0xf4,
- 0xdd, 0xdf, 0xa7, 0x9f, 0x7e, 0x7a, 0x9b, 0xc2, 0x3a, 0xee, 0xd8, 0xe3,
- 0x9a, 0x5c, 0xfb, 0xe7, 0xd2, 0x2f, 0xcd, 0x32, 0x41, 0x23, 0xde, 0xf6,
- 0xe1, 0x8b, 0x0d, 0xdb, 0xa2, 0xb6, 0x9c, 0xb7, 0xdc, 0x32, 0xd9, 0x51,
- 0x78, 0x22, 0xc2, 0xdd, 0xbf, 0x9b, 0xf2, 0xdd, 0xff, 0x5f, 0x78, 0xfb,
- 0xcb, 0xa4, 0x4a, 0xef, 0xe3, 0xc1, 0x4f, 0xbe, 0xdb, 0xb1, 0xef, 0xd7,
- 0xb7, 0xdf, 0x86, 0xdb, 0xed, 0x6c, 0x46, 0xd4, 0xd8, 0x71, 0x63, 0xe9,
- 0xd7, 0xbf, 0x5f, 0x93, 0xeb, 0xe5, 0xef, 0x7f, 0x6b, 0x0a, 0x95, 0x11,
- 0x6f, 0xfb, 0x50, 0x5d, 0x1b, 0xe2, 0xc9, 0x7f, 0xaf, 0x6e, 0x72, 0xfd,
- 0xec, 0x73, 0xce, 0xe6, 0xb8, 0xe3, 0x8e, 0x8b, 0x39, 0xbc, 0xb3, 0xcf,
- 0x3e, 0x9b, 0x63, 0x8e, 0x89, 0xcc, 0xaa, 0xaa, 0xa9, 0x0f, 0xf3, 0x62,
- 0x92, 0x89, 0xf7, 0x9b, 0x2d, 0x35, 0xac, 0xd9, 0xbc, 0x03, 0x80, 0xb4,
- 0xb4, 0x34, 0xae, 0xbf, 0xfe, 0xba, 0xa8, 0x8b, 0x0d, 0x5a, 0xa2, 0x7f,
- 0xff, 0xfe, 0x64, 0x65, 0x35, 0x3d, 0x36, 0x6a, 0xc5, 0x57, 0x9b, 0x59,
- 0x5b, 0x55, 0x63, 0x0a, 0x95, 0x11, 0x6f, 0xfb, 0x31, 0x7b, 0xd9, 0x57,
- 0x4d, 0xfa, 0x69, 0x29, 0x29, 0x29, 0x4c, 0x2d, 0x78, 0x90, 0x61, 0xc3,
- 0x86, 0xb5, 0x3a, 0x9c, 0xe1, 0xc3, 0x87, 0x33, 0xe5, 0xee, 0x5d, 0x3b,
- 0x97, 0x3e, 0xe2, 0xff, 0x24, 0x29, 0xd3, 0xfb, 0xeb, 0x17, 0xde, 0xf9,
- 0xce, 0xb5, 0xbd, 0xfc, 0x27, 0x97, 0x73, 0xd1, 0x8f, 0x2e, 0x6a, 0xb5,
- 0x80, 0xfb, 0xf5, 0xeb, 0xc7, 0xa3, 0x8f, 0x3d, 0x42, 0xcf, 0x9e, 0x4d,
- 0x57, 0x60, 0x3d, 0x38, 0xf7, 0x43, 0x8c, 0xc7, 0x6c, 0xc4, 0xdb, 0xae,
- 0x6c, 0xaf, 0x0b, 0x73, 0xcb, 0xf3, 0xcb, 0x9a, 0x5c, 0xef, 0xd5, 0xab,
- 0x17, 0x0f, 0x3d, 0x3c, 0x93, 0x0b, 0x2e, 0xbc, 0xa0, 0xc5, 0xfb, 0x53,
- 0x52, 0x52, 0xb8, 0xfa, 0xea, 0xab, 0x98, 0x5a, 0xf0, 0xe0, 0x77, 0xd7,
- 0xde, 0xfc, 0x74, 0x03, 0xa5, 0x2b, 0x92, 0xf3, 0x48, 0xd9, 0x35, 0x5b,
- 0x6a, 0x78, 0x7a, 0xf1, 0x67, 0xdf, 0xfd, 0x3f, 0x2b, 0x6b, 0x02, 0x93,
- 0xf2, 0x27, 0xd1, 0xb7, 0x6f, 0xdf, 0x16, 0xef, 0x3b, 0xeb, 0xac, 0x91,
- 0x3c, 0xfd, 0xb7, 0xbf, 0xb2, 0xef, 0xbe, 0xfb, 0x36, 0xf9, 0x6e, 0xc6,
- 0xfc, 0x95, 0xac, 0xdd, 0x6a, 0x5a, 0xdd, 0x78, 0x60, 0x96, 0x76, 0xc4,
- 0xc8, 0xca, 0x35, 0x55, 0x14, 0xcc, 0xfd, 0x90, 0xfc, 0x71, 0xc7, 0xee,
- 0x76, 0x3d, 0x35, 0x35, 0x95, 0xdc, 0xdc, 0x1c, 0xae, 0xb8, 0xe2, 0x0a,
- 0x2a, 0xca, 0xcb, 0x59, 0xb6, 0x7c, 0x79, 0xa3, 0xf5, 0xbc, 0x83, 0x39,
- 0xed, 0xf4, 0xd3, 0xc9, 0xc8, 0xf0, 0xd1, 0xbf, 0xff, 0xae, 0x09, 0xf9,
- 0xab, 0xd7, 0x55, 0xf3, 0xdb, 0x97, 0xde, 0x4b, 0xea, 0xf4, 0x3e, 0xbb,
- 0xe4, 0x73, 0x0e, 0x1d, 0xd4, 0x0b, 0xcf, 0xb1, 0x11, 0x21, 0xfe, 0xf0,
- 0x87, 0xe3, 0x18, 0x33, 0x66, 0x34, 0xfe, 0x0a, 0x3f, 0x8b, 0x17, 0x2f,
- 0xde, 0x6d, 0x3d, 0xef, 0xf1, 0xc7, 0x1f, 0xcf, 0x39, 0xe9, 0xe7, 0x70,
- 0xf4, 0xd1, 0x47, 0x47, 0x0d, 0xeb, 0x95, 0x65, 0x5f, 0x33, 0xef, 0xbd,
- 0x6f, 0x4c, 0x21, 0x32, 0xe2, 0xed, 0x38, 0xca, 0xff, 0xbb, 0x86, 0xaa,
- 0x9a, 0x7a, 0xee, 0xbc, 0xf0, 0x04, 0xdc, 0x7b, 0xbc, 0x03, 0xdd, 0x77,
- 0xdf, 0xa1, 0x5c, 0xf9, 0xd3, 0x2b, 0xb9, 0xf2, 0xa7, 0x57, 0xb6, 0x18,
- 0xc6, 0x82, 0x95, 0x6b, 0xf9, 0xc3, 0x6b, 0xff, 0x6d, 0x73, 0x5c, 0xf6,
- 0x36, 0xcf, 0x21, 0x1e, 0xee, 0xe9, 0xfd, 0xaf, 0x7d, 0xc0, 0xd7, 0x9b,
- 0x76, 0x70, 0xe5, 0xf7, 0x0f, 0x43, 0x04, 0xdc, 0x6e, 0x37, 0x63, 0x32,
- 0xc7, 0x30, 0x26, 0x73, 0x4c, 0xab, 0xc3, 0xf8, 0x53, 0xe5, 0x2a, 0x5e,
- 0x5c, 0xfa, 0xa5, 0x71, 0x97, 0x8d, 0xdb, 0xdc, 0xf1, 0xbc, 0xf1, 0xe9,
- 0x06, 0x7e, 0xf1, 0x97, 0x37, 0x59, 0xb2, 0x6a, 0x7d, 0x4c, 0xf7, 0x6d,
- 0xd9, 0x51, 0x4f, 0x51, 0xd9, 0x4a, 0xee, 0x7b, 0xf5, 0xbf, 0x71, 0x29,
- 0xc8, 0x6f, 0xad, 0xde, 0xd8, 0xe2, 0xf7, 0x4b, 0x3e, 0xdd, 0x10, 0x97,
- 0xf4, 0x3e, 0xbd, 0xf8, 0x33, 0x7e, 0xfb, 0xd2, 0xbb, 0x7c, 0x1e, 0x65,
- 0xd4, 0xbd, 0x25, 0x3e, 0x5a, 0x53, 0xc5, 0xe4, 0xe7, 0x96, 0xf3, 0xc2,
- 0xdb, 0x46, 0xb8, 0xa6, 0xe5, 0x4d, 0xb2, 0x3e, 0xe1, 0x94, 0x7f, 0xad,
- 0xe0, 0x84, 0x03, 0xfb, 0x33, 0xfa, 0x84, 0xfd, 0xf8, 0xfe, 0xb0, 0x41,
- 0x0c, 0xe8, 0x95, 0x1a, 0xa5, 0x75, 0x54, 0x56, 0x7c, 0xb5, 0x85, 0x45,
- 0x9f, 0xac, 0xe7, 0xd5, 0xe5, 0x5f, 0xc7, 0x75, 0x5a, 0xe0, 0x67, 0xeb,
- 0xab, 0x09, 0xd9, 0xda, 0xec, 0xca, 0xa2, 0xe7, 0xde, 0xf8, 0x3c, 0x6e,
- 0xcf, 0x7a, 0x6b, 0xf5, 0x46, 0xde, 0x5a, 0xbd, 0x11, 0xdf, 0x71, 0xfb,
- 0x72, 0xf6, 0xd1, 0x43, 0x38, 0xfd, 0xf0, 0x81, 0xb8, 0x5d, 0x4d, 0xeb,
- 0xff, 0xda, 0x50, 0x98, 0xb7, 0x3e, 0xdd, 0x48, 0xe5, 0xca, 0xb5, 0xfc,
- 0xfb, 0xe3, 0x75, 0x46, 0xb4, 0x46, 0xbc, 0xc9, 0xcb, 0xfb, 0x5f, 0x6f,
- 0xe1, 0xfd, 0xaf, 0xb7, 0x20, 0x22, 0x1c, 0xb4, 0x4f, 0x4f, 0x06, 0xf7,
- 0x49, 0x63, 0x60, 0x9f, 0x5d, 0x9b, 0xae, 0xff, 0x6f, 0xd3, 0x0e, 0xaa,
- 0x13, 0x34, 0x7b, 0x2a, 0x6c, 0x2b, 0xb9, 0xcf, 0x2c, 0xe5, 0xbe, 0x1f,
- 0x9f, 0xbc, 0xdb, 0x9a, 0xde, 0xb0, 0xad, 0x94, 0x94, 0x7f, 0xc4, 0xc6,
- 0x04, 0xcc, 0x97, 0xf6, 0x7f, 0xf0, 0x2d, 0xfe, 0x0f, 0xbe, 0xc5, 0xed,
- 0x12, 0x0e, 0x19, 0xd8, 0x9b, 0x41, 0x7d, 0xd2, 0x18, 0xd0, 0x2b, 0x85,
- 0x4d, 0xdb, 0xeb, 0xd8, 0x50, 0x5d, 0xcb, 0x17, 0x1b, 0xb6, 0x9b, 0x79,
- 0xcb, 0x46, 0xbc, 0x9d, 0x0b, 0x55, 0xe5, 0xcb, 0x8d, 0xdb, 0xf9, 0x72,
- 0xe3, 0xf6, 0x76, 0x7d, 0xee, 0x27, 0x6b, 0xab, 0xb9, 0xe2, 0xd1, 0xc5,
- 0x8c, 0x3c, 0x6a, 0x08, 0x87, 0x0e, 0xea, 0xc5, 0x37, 0x5b, 0x6a, 0x78,
- 0x63, 0xd5, 0x7a, 0xaa, 0x6a, 0x12, 0x3b, 0xdd, 0x32, 0x14, 0x56, 0x3e,
- 0x5d, 0x57, 0x9d, 0x54, 0x73, 0xb2, 0x8d, 0x78, 0x0d, 0x9d, 0x8e, 0xb0,
- 0xad, 0x2c, 0x58, 0xb9, 0xd6, 0x18, 0xa2, 0x1b, 0xd1, 0x9d, 0x06, 0xac,
- 0xc2, 0x26, 0xbb, 0x0d, 0x46, 0xbc, 0x9d, 0x90, 0xd2, 0x7c, 0xef, 0xa7,
- 0x88, 0x1e, 0x02, 0x92, 0x0f, 0xbc, 0x69, 0xb2, 0xbe, 0x53, 0xb2, 0x04,
- 0xf8, 0x9d, 0x31, 0x43, 0x84, 0x2e, 0xb9, 0x95, 0xc1, 0x98, 0x82, 0xc0,
- 0x71, 0x67, 0x56, 0x57, 0x7e, 0x38, 0x65, 0xca, 0x94, 0x66, 0x47, 0x4d,
- 0x32, 0xa7, 0xf9, 0x0f, 0x43, 0xe5, 0x77, 0xc0, 0x55, 0xa6, 0x18, 0x24,
- 0x3d, 0x4f, 0x22, 0x3a, 0xa5, 0x74, 0x92, 0xef, 0x73, 0x63, 0x8a, 0x2e,
- 0x2c, 0xde, 0xe1, 0x8f, 0xbd, 0x2d, 0x83, 0xab, 0xaa, 0xd6, 0x03, 0x75,
- 0xc0, 0xf3, 0x82, 0xce, 0x9a, 0x97, 0xef, 0xfb, 0x77, 0xb4, 0xdf, 0xfe,
- 0xb0, 0xa0, 0x22, 0x2d, 0x8c, 0xb5, 0x09, 0xe8, 0x69, 0x8a, 0x42, 0xd2,
- 0xb2, 0xdd, 0x85, 0xbd, 0xcf, 0x9c, 0xfc, 0x8c, 0xa8, 0xc3, 0xe6, 0x63,
- 0x0b, 0xfc, 0x67, 0x2b, 0x72, 0x19, 0xb0, 0xb0, 0x34, 0xdf, 0xfb, 0xbc,
- 0x11, 0x6f, 0x27, 0x66, 0x6c, 0x41, 0x60, 0x90, 0xc2, 0x9e, 0x33, 0x27,
- 0xbe, 0x06, 0x66, 0x21, 0x3c, 0x5f, 0x3a, 0xc9, 0xfb, 0xfa, 0x6e, 0x2d,
- 0x70, 0x41, 0xe0, 0x7d, 0xe0, 0xf8, 0xbd, 0x04, 0xbb, 0x0e, 0xf8, 0x17,
- 0x70, 0x00, 0x70, 0x6a, 0xc3, 0xbf, 0x06, 0x67, 0x7c, 0x0d, 0x2c, 0x03,
- 0xbe, 0x01, 0x2e, 0x06, 0xf6, 0xb6, 0x43, 0xde, 0x8a, 0xd2, 0x7c, 0xef,
- 0x49, 0xbb, 0x7b, 0x4d, 0x81, 0x33, 0x51, 0x2e, 0x03, 0x2e, 0x03, 0x76,
- 0x6e, 0x67, 0x32, 0xa3, 0x34, 0xdf, 0x9b, 0xdb, 0x9d, 0x0c, 0xd9, 0xf5,
- 0x46, 0x9b, 0x95, 0x81, 0x51, 0xaa, 0xa4, 0x03, 0x81, 0x5c, 0x94, 0xdc,
- 0xcc, 0x82, 0xc0, 0x82, 0xd2, 0x7c, 0x6f, 0x7a, 0x2c, 0x35, 0x3f, 0xb6,
- 0x7d, 0x7c, 0xe9, 0x2d, 0x19, 0xeb, 0x1b, 0x15, 0x9e, 0xa1, 0xa8, 0x9c,
- 0x0a, 0x7a, 0x2a, 0x70, 0x72, 0x83, 0xa0, 0x8f, 0x31, 0xba, 0x6c, 0xc2,
- 0xca, 0x06, 0xa1, 0x2e, 0x07, 0x59, 0x86, 0xe8, 0xf2, 0xd2, 0x49, 0xde,
- 0xb5, 0xbb, 0x2a, 0xda, 0xe0, 0x6f, 0x14, 0xfd, 0x1c, 0xe8, 0xd1, 0xda,
- 0x00, 0x33, 0x0b, 0x02, 0x8b, 0x51, 0x7e, 0x10, 0xe5, 0xab, 0xe3, 0xba,
- 0x9b, 0x71, 0xbb, 0x9c, 0x78, 0x55, 0xf6, 0x5a, 0x10, 0xf6, 0x89, 0x31,
- 0xc8, 0xf5, 0x8d, 0x85, 0x0b, 0xd0, 0x50, 0x00, 0x4b, 0x1b, 0x3e, 0x00,
- 0x9c, 0xfb, 0xc0, 0x82, 0x5e, 0xf5, 0x2e, 0xfb, 0x14, 0x89, 0x08, 0xfa,
- 0x94, 0x06, 0x41, 0x9f, 0x04, 0xa4, 0x76, 0x83, 0x72, 0x54, 0x07, 0xbc,
- 0x1b, 0x11, 0x29, 0xcb, 0x14, 0x59, 0x9e, 0x12, 0xb6, 0x96, 0xbf, 0x76,
- 0xeb, 0x39, 0x2d, 0xbe, 0xf0, 0x9e, 0x97, 0xef, 0x59, 0x9b, 0x59, 0x10,
- 0xd8, 0x18, 0xa3, 0x27, 0x33, 0xa0, 0x99, 0xeb, 0x46, 0xbc, 0x5d, 0x80,
- 0x78, 0x8b, 0xa5, 0x55, 0x53, 0x85, 0x1a, 0x0a, 0xea, 0xe2, 0x86, 0x0f,
- 0x00, 0x23, 0xff, 0xf8, 0xa6, 0xab, 0xef, 0xd6, 0xed, 0x27, 0xa8, 0xad,
- 0xa7, 0x21, 0xdc, 0x0e, 0x0c, 0xeb, 0x42, 0x76, 0xfe, 0x04, 0xe5, 0x5e,
- 0xb1, 0x64, 0xe9, 0xe6, 0x81, 0x7d, 0xde, 0x5f, 0x72, 0xed, 0x69, 0x76,
- 0x22, 0xed, 0xdb, 0x0a, 0x0e, 0x3a, 0x7f, 0xca, 0x6c, 0x79, 0x65, 0xca,
- 0x05, 0x6a, 0xc4, 0xdb, 0x79, 0xdb, 0xde, 0xed, 0x89, 0xec, 0xca, 0x67,
- 0x16, 0x04, 0xc6, 0x03, 0x35, 0x08, 0xcb, 0xd4, 0xae, 0x5b, 0x51, 0x36,
- 0x39, 0xb3, 0xd9, 0xcd, 0xa7, 0x16, 0xfd, 0xf2, 0x8c, 0x70, 0x43, 0x8b,
- 0xf4, 0x6e, 0x66, 0x41, 0xe0, 0x65, 0x9a, 0xf6, 0xc5, 0x5b, 0x5b, 0xb8,
- 0x3f, 0x04, 0xb6, 0x37, 0x8c, 0x51, 0x48, 0xa3, 0xf1, 0x8a, 0x3d, 0xff,
- 0x96, 0x3d, 0x04, 0xa1, 0x7b, 0xf9, 0xbb, 0x57, 0x1b, 0x5a, 0xac, 0xd3,
- 0x4a, 0x27, 0x7b, 0xb7, 0xb4, 0xe6, 0x87, 0x63, 0xa6, 0x96, 0xa6, 0x88,
- 0x95, 0x7a, 0x12, 0xca, 0x29, 0x40, 0x5a, 0x69, 0xbe, 0xf7, 0x91, 0x04,
- 0x64, 0xcd, 0x86, 0xee, 0x24, 0xdc, 0x2e, 0xda, 0xe7, 0x95, 0xaa, 0x84,
- 0x0e, 0xc3, 0x09, 0x3f, 0x46, 0xf1, 0xa2, 0x20, 0x92, 0x1a, 0xca, 0x2c,
- 0x08, 0xac, 0x68, 0xdc, 0xaf, 0x73, 0x11, 0x5e, 0x3e, 0x27, 0x3f, 0xa3,
- 0xc9, 0xe9, 0x5a, 0x6a, 0x6b, 0x95, 0xc4, 0x7e, 0x9c, 0x89, 0xa2, 0x7a,
- 0x59, 0xe9, 0x64, 0xdf, 0x0b, 0x89, 0xab, 0x8c, 0x82, 0x57, 0x80, 0x3e,
- 0x43, 0x8c, 0x35, 0x9e, 0xda, 0x1a, 0xd5, 0x25, 0xfe, 0x61, 0x41, 0x45,
- 0xbf, 0x30, 0xae, 0x93, 0x1b, 0xc6, 0x03, 0x76, 0x7e, 0x4e, 0x40, 0x1b,
- 0xca, 0x9a, 0x50, 0x01, 0x24, 0x42, 0xbc, 0x9f, 0x19, 0xb7, 0xb9, 0xb3,
- 0x23, 0x5a, 0xdd, 0x8e, 0x83, 0xe8, 0xee, 0x86, 0xfe, 0xed, 0x29, 0x3b,
- 0xb5, 0x16, 0xc6, 0xd2, 0xcc, 0x82, 0xc0, 0xaa, 0x06, 0x41, 0xcf, 0x29,
- 0xcd, 0xf7, 0x3e, 0x19, 0xf9, 0x46, 0x9c, 0xc4, 0xaa, 0x36, 0x91, 0xc2,
- 0x05, 0x28, 0xcd, 0xf7, 0x3c, 0x9b, 0x59, 0x10, 0x78, 0x0a, 0x48, 0x89,
- 0xad, 0x56, 0x91, 0xc6, 0xde, 0xc8, 0x75, 0xc0, 0x38, 0xe0, 0xd4, 0x30,
- 0x1c, 0x01, 0xda, 0x11, 0x6f, 0x31, 0x56, 0x1b, 0xf1, 0x76, 0x72, 0xc2,
- 0xa1, 0xf0, 0x56, 0x97, 0x3b, 0x65, 0x03, 0x68, 0x6b, 0x0f, 0xe9, 0x29,
- 0x07, 0x0e, 0x6b, 0x70, 0x21, 0xe3, 0xd3, 0x36, 0xc3, 0x91, 0x0d, 0x9f,
- 0xfd, 0x80, 0x27, 0x13, 0xdd, 0xdf, 0x4e, 0x02, 0x6e, 0x00, 0x46, 0x24,
- 0x20, 0xdc, 0x6d, 0x0d, 0xf9, 0xd3, 0x1a, 0x8f, 0xeb, 0x0d, 0x23, 0xde,
- 0x4e, 0x4e, 0xf9, 0x6d, 0xa3, 0xed, 0xcc, 0x82, 0xc0, 0xdf, 0x80, 0x9c,
- 0xd6, 0xb5, 0x3c, 0xde, 0x9c, 0xd1, 0x33, 0x17, 0xde, 0xe2, 0xda, 0x11,
- 0x1a, 0xab, 0xc2, 0xc5, 0xc0, 0x05, 0x34, 0x3f, 0xa2, 0xd9, 0xa1, 0x64,
- 0x16, 0x04, 0xb2, 0x81, 0xf3, 0x1a, 0xf5, 0x59, 0x9b, 0xfb, 0x58, 0x2d,
- 0xf4, 0x89, 0x05, 0x98, 0x5d, 0x9a, 0xef, 0x9d, 0x99, 0xa4, 0x59, 0xb8,
- 0x19, 0x78, 0x59, 0x94, 0x7f, 0x86, 0x7a, 0xb9, 0xe7, 0x95, 0xdf, 0x7c,
- 0x76, 0x5d, 0x94, 0xca, 0x31, 0x9a, 0xc7, 0x55, 0x6e, 0xc4, 0xdb, 0x25,
- 0xfa, 0xbd, 0xbc, 0x84, 0x34, 0x2b, 0xde, 0x03, 0x2f, 0x9d, 0xbe, 0xd8,
- 0x35, 0x6b, 0xe2, 0x99, 0xdf, 0x2d, 0x54, 0x98, 0x3f, 0xe1, 0xec, 0x5a,
- 0xe0, 0x65, 0xe0, 0xe5, 0x71, 0x05, 0xe5, 0x6e, 0x5b, 0xdc, 0x19, 0xa8,
- 0x5e, 0x02, 0x5c, 0x98, 0x64, 0x29, 0x3b, 0x16, 0x18, 0x1d, 0x87, 0x70,
- 0x56, 0x26, 0x59, 0xba, 0xd6, 0x02, 0x2f, 0x21, 0xf2, 0x4f, 0x4b, 0x43,
- 0xfe, 0xb9, 0xf9, 0xa3, 0xa2, 0xae, 0x65, 0xbc, 0x74, 0xfa, 0x62, 0xf7,
- 0x56, 0xbb, 0x76, 0xdf, 0x66, 0xfc, 0x9d, 0x4f, 0x8d, 0x78, 0xbb, 0x42,
- 0xb7, 0xd7, 0xe2, 0xc3, 0x16, 0x76, 0x6f, 0x18, 0xb8, 0xd5, 0xae, 0x7d,
- 0x27, 0xb3, 0x20, 0x70, 0x57, 0xc8, 0x1d, 0x9e, 0x53, 0x91, 0x3b, 0x6a,
- 0x47, 0xe3, 0x2f, 0x1b, 0x0a, 0x4e, 0x29, 0x50, 0x3a, 0x66, 0x5a, 0xe5,
- 0x4d, 0xa2, 0xf6, 0x29, 0x18, 0x12, 0xc9, 0x85, 0x2a, 0xd6, 0xf2, 0xb2,
- 0x49, 0xe9, 0xcd, 0xae, 0xfa, 0xca, 0x2c, 0x5c, 0xd0, 0x8b, 0x70, 0xf8,
- 0xdc, 0xad, 0x76, 0xed, 0xef, 0x88, 0xfe, 0x9e, 0x3e, 0x50, 0x3a, 0xc9,
- 0x5b, 0x65, 0xc4, 0xdb, 0x05, 0x98, 0x37, 0xc9, 0xfb, 0xed, 0x98, 0xa9,
- 0x81, 0x7f, 0x88, 0xf0, 0x93, 0x66, 0x7e, 0x72, 0x02, 0xf0, 0x82, 0x3b,
- 0xe4, 0xaa, 0xc9, 0x2c, 0x08, 0xcc, 0x05, 0xfe, 0x69, 0xdb, 0xd6, 0xec,
- 0xf9, 0xb7, 0xa4, 0x6f, 0x6d, 0xfc, 0xa3, 0x86, 0x02, 0xb5, 0xd4, 0xe8,
- 0x2b, 0x71, 0x94, 0xe6, 0x7b, 0xa3, 0xda, 0x77, 0xec, 0x03, 0xfe, 0x01,
- 0xea, 0x92, 0x0b, 0x80, 0x8b, 0x09, 0x87, 0xc7, 0x02, 0x69, 0xcd, 0xd7,
- 0xd6, 0x72, 0x57, 0x77, 0xb4, 0x5d, 0xd7, 0x5d, 0x8c, 0x6f, 0x71, 0x2f,
- 0xda, 0xac, 0x78, 0x77, 0xd2, 0x03, 0xf8, 0x11, 0xf0, 0x23, 0xcb, 0xb2,
- 0xeb, 0x33, 0x0b, 0x02, 0x15, 0xc0, 0x3f, 0x71, 0xd9, 0xff, 0x2a, 0xcd,
- 0xcb, 0x58, 0xd7, 0x8c, 0x4b, 0x6e, 0x4e, 0x84, 0x6e, 0x5b, 0x97, 0xa6,
- 0xd9, 0x32, 0x37, 0x66, 0xaa, 0x7f, 0x5f, 0x11, 0xb9, 0x10, 0xb8, 0x44,
- 0xc1, 0xd7, 0xca, 0xf2, 0xf9, 0x0d, 0xe1, 0xf0, 0x1b, 0x46, 0xbc, 0x5d,
- 0x88, 0xba, 0x2a, 0xde, 0x4f, 0xeb, 0xcd, 0x9b, 0x08, 0x67, 0xb4, 0xf2,
- 0x96, 0x14, 0x60, 0x2c, 0x30, 0x96, 0xb0, 0xf5, 0x48, 0x66, 0x41, 0x60,
- 0xa1, 0x20, 0xff, 0x0c, 0xdb, 0xe1, 0x7f, 0xcd, 0xbf, 0x25, 0xe3, 0x4b,
- 0x80, 0x31, 0xd3, 0x02, 0xbd, 0x51, 0x67, 0xa3, 0xaa, 0x16, 0xe1, 0x30,
- 0xb8, 0x4a, 0x80, 0x23, 0x88, 0xcc, 0xb4, 0x1a, 0x46, 0x8c, 0xaf, 0x67,
- 0x3a, 0xda, 0xa4, 0xc0, 0xa7, 0xc0, 0x2a, 0x60, 0x55, 0x24, 0x3d, 0x8e,
- 0x18, 0x31, 0x66, 0x5a, 0xa0, 0x67, 0xd9, 0x24, 0xef, 0x0e, 0x80, 0xb1,
- 0x05, 0xfe, 0x43, 0xc0, 0xba, 0x48, 0xd1, 0x4b, 0x80, 0x91, 0x10, 0x73,
- 0xe5, 0x98, 0x53, 0x7a, 0x4b, 0x46, 0x9d, 0x11, 0x6f, 0x17, 0x22, 0x38,
- 0xc5, 0xab, 0x63, 0x0b, 0x02, 0x13, 0xd4, 0xd9, 0xc2, 0x7b, 0x17, 0xe0,
- 0x51, 0xd4, 0x63, 0x59, 0x56, 0x51, 0x66, 0x41, 0xe0, 0x2d, 0xe0, 0x6d,
- 0x94, 0x73, 0x5a, 0x74, 0xdf, 0x5a, 0x72, 0x0f, 0x6f, 0x19, 0x15, 0x06,
- 0xb2, 0x77, 0xb5, 0x32, 0xa5, 0x62, 0x91, 0x76, 0x30, 0xe8, 0x91, 0x2a,
- 0xdf, 0x89, 0x79, 0xa7, 0xb0, 0x8f, 0x04, 0xfa, 0x75, 0x80, 0xd9, 0xb6,
- 0xec, 0x14, 0xe7, 0xce, 0x8f, 0x28, 0xab, 0x40, 0x56, 0xd9, 0xd4, 0x7e,
- 0x59, 0x36, 0x39, 0x33, 0x1e, 0xaf, 0xae, 0x7a, 0x88, 0xf2, 0x7a, 0x66,
- 0x41, 0xe0, 0xdf, 0xc0, 0xe9, 0x0a, 0xa7, 0xb7, 0xe1, 0xbd, 0xf0, 0xd7,
- 0x22, 0xcc, 0xe9, 0xae, 0x4e, 0x4c, 0x97, 0xde, 0xc3, 0x6a, 0x5e, 0xbe,
- 0xf7, 0xad, 0xcc, 0x82, 0xc0, 0x43, 0xc0, 0xcd, 0x6d, 0x72, 0xc0, 0x23,
- 0xef, 0x30, 0x9d, 0xb4, 0xb8, 0x87, 0x35, 0xf7, 0x45, 0x83, 0x10, 0xbe,
- 0x68, 0xf8, 0xf8, 0xf7, 0xfc, 0x7e, 0xdc, 0xb4, 0x8a, 0xc1, 0xb6, 0x6d,
- 0x1d, 0xde, 0x4e, 0xae, 0xec, 0x48, 0x97, 0x15, 0x5e, 0x3d, 0x67, 0xd2,
- 0xa8, 0xf5, 0x0e, 0x43, 0x38, 0x34, 0xc6, 0xdf, 0x9f, 0xdc, 0xf0, 0x69,
- 0x13, 0x02, 0x3f, 0x9a, 0x37, 0xc9, 0xbb, 0xcd, 0x88, 0xb7, 0xab, 0x22,
- 0xfa, 0x1b, 0x54, 0x2e, 0x07, 0x06, 0x77, 0xc0, 0xd3, 0x0f, 0xcc, 0x2c,
- 0x08, 0x3c, 0x24, 0xe8, 0x5f, 0xc4, 0xd6, 0x55, 0x73, 0x6f, 0xc9, 0xd8,
- 0xdc, 0xda, 0x1b, 0xe7, 0x4e, 0xca, 0x58, 0x8f, 0xb3, 0xb9, 0xd0, 0xb1,
- 0x7b, 0x05, 0x93, 0xbd, 0x6f, 0xc5, 0x7a, 0xcf, 0xb8, 0x07, 0x2b, 0x06,
- 0xa8, 0x25, 0xc3, 0x14, 0xf9, 0x25, 0x30, 0xb4, 0xdd, 0xb3, 0x15, 0x1e,
- 0x9a, 0x97, 0x1f, 0x7b, 0xbc, 0x8d, 0x78, 0x3b, 0x11, 0xa5, 0x93, 0x7c,
- 0x9b, 0xc7, 0x16, 0x04, 0x2f, 0x51, 0xb4, 0xb2, 0x03, 0x1e, 0x6f, 0x01,
- 0xe3, 0x15, 0x19, 0xaf, 0x96, 0x90, 0x59, 0x10, 0xd8, 0xb0, 0xbb, 0x5b,
- 0x2a, 0x9f, 0xaa, 0xe8, 0x2a, 0xcb, 0x96, 0x55, 0xf3, 0x26, 0x7b, 0xbe,
- 0x6e, 0x45, 0x78, 0x07, 0xc5, 0x29, 0x5e, 0x07, 0xb7, 0xe6, 0x47, 0x63,
- 0xa7, 0x06, 0x0f, 0xb4, 0x2d, 0x1d, 0x26, 0x2a, 0xc3, 0x40, 0x77, 0x73,
- 0xed, 0xed, 0xbd, 0x2f, 0xa2, 0x4f, 0x24, 0x5f, 0x28, 0x7a, 0x3b, 0xdd,
- 0x1c, 0xe9, 0x2e, 0x09, 0xcd, 0x2c, 0x08, 0x4c, 0x00, 0x4a, 0x92, 0x38,
- 0x8a, 0x35, 0x7b, 0xf4, 0x37, 0x3f, 0x05, 0x56, 0x89, 0xe8, 0x2a, 0xf7,
- 0xb6, 0x1d, 0x9f, 0xd5, 0xf7, 0xea, 0x95, 0x09, 0xcc, 0x8e, 0xe3, 0xf3,
- 0xce, 0x4d, 0xd9, 0xb6, 0xad, 0x3c, 0xd4, 0xa7, 0xd7, 0x61, 0xaa, 0xb2,
- 0x53, 0x98, 0x7b, 0xf6, 0xbd, 0x7b, 0x24, 0xa1, 0x9d, 0xb6, 0xab, 0x70,
- 0x7c, 0xd9, 0x24, 0x6f, 0xb7, 0xdf, 0xcf, 0xaa, 0xdb, 0xec, 0xdb, 0xac,
- 0x5a, 0xf7, 0x90, 0x48, 0xea, 0xb1, 0x6d, 0xec, 0xff, 0x26, 0x92, 0x1e,
- 0x44, 0xde, 0x3f, 0x9f, 0xb0, 0x7b, 0xbc, 0x85, 0xfa, 0x5e, 0xbd, 0x12,
- 0xf1, 0xbc, 0xd7, 0xea, 0x7b, 0xf7, 0xee, 0x3c, 0xb3, 0xa7, 0x77, 0x91,
- 0x61, 0x84, 0xbb, 0xcb, 0xad, 0xeb, 0x16, 0x94, 0x4d, 0xce, 0x54, 0x4b,
- 0xac, 0x89, 0xc0, 0xab, 0x26, 0xdb, 0x3b, 0x6d, 0x15, 0x7c, 0x65, 0x69,
- 0xbe, 0x77, 0x89, 0xb1, 0x43, 0x37, 0x13, 0x2f, 0xc0, 0xdc, 0x49, 0xe9,
- 0x75, 0xaa, 0xfa, 0x63, 0xe0, 0x19, 0x93, 0xf5, 0x9d, 0x4b, 0xb5, 0xa2,
- 0x72, 0x69, 0x69, 0xbe, 0xef, 0x59, 0x63, 0x8a, 0x6e, 0xd8, 0xe7, 0x6d,
- 0xcc, 0xd8, 0xc2, 0x80, 0x5b, 0xc3, 0x14, 0x02, 0x13, 0x4c, 0x11, 0x48,
- 0x7a, 0xea, 0x05, 0xcd, 0x9c, 0x97, 0xef, 0x0b, 0x18, 0x53, 0x74, 0xe3,
- 0x96, 0x77, 0x27, 0xf3, 0xf2, 0xbc, 0xa1, 0x70, 0x28, 0x94, 0x83, 0x70,
- 0xa7, 0x29, 0x02, 0x49, 0xcd, 0x7a, 0x90, 0x11, 0x46, 0xb8, 0xa6, 0xe5,
- 0x8d, 0x4a, 0x66, 0x41, 0xc0, 0x0b, 0xcc, 0xa2, 0x63, 0x5f, 0x7d, 0x18,
- 0x9a, 0x52, 0x66, 0x69, 0xf8, 0x27, 0x73, 0x27, 0x8f, 0xda, 0x64, 0x4c,
- 0x61, 0x5a, 0xde, 0xa8, 0x94, 0xe6, 0x7b, 0x03, 0x60, 0x1f, 0x0b, 0x54,
- 0x98, 0xe2, 0x90, 0x34, 0xfc, 0xd6, 0xb2, 0xed, 0x1f, 0x1a, 0xe1, 0x9a,
- 0x96, 0xb7, 0x75, 0x2d, 0xf0, 0xf4, 0x80, 0x1b, 0x25, 0x07, 0xe5, 0x5e,
- 0x1c, 0xce, 0x5f, 0x36, 0xb4, 0x99, 0xf7, 0x11, 0xb9, 0xa1, 0x74, 0x92,
- 0x67, 0xb1, 0x31, 0x85, 0x11, 0x6f, 0xcc, 0x8c, 0x79, 0xb0, 0x62, 0x3f,
- 0xb1, 0xac, 0x87, 0x89, 0x2c, 0x15, 0x34, 0xb4, 0x0f, 0xf5, 0xc0, 0x9d,
- 0xaa, 0x3a, 0xbd, 0x6c, 0xb2, 0xaf, 0xde, 0x98, 0xc3, 0x88, 0xd7, 0x31,
- 0xc3, 0x1f, 0x7b, 0x5b, 0x06, 0x55, 0x55, 0x9d, 0x2b, 0x50, 0x44, 0xd7,
- 0xda, 0x28, 0x3d, 0x19, 0xf9, 0x97, 0x4b, 0xf4, 0xe6, 0x39, 0x93, 0x7c,
- 0xff, 0x33, 0xa6, 0x30, 0xe2, 0x8d, 0x5f, 0x2b, 0x3c, 0x35, 0xe0, 0x16,
- 0xf8, 0x39, 0xc2, 0x6f, 0x68, 0x61, 0x85, 0x90, 0xc1, 0x11, 0x73, 0x10,
- 0xbd, 0xab, 0x74, 0x92, 0xef, 0x6d, 0x63, 0x0a, 0x23, 0xde, 0xc4, 0xf5,
- 0x87, 0x1f, 0xac, 0x48, 0xc1, 0xb2, 0xae, 0x05, 0x7e, 0x43, 0x2b, 0x27,
- 0xf5, 0x1b, 0x9a, 0xa5, 0x14, 0xd5, 0xbb, 0x4a, 0x27, 0xfb, 0xde, 0x30,
- 0xa6, 0x30, 0xe2, 0x6d, 0x37, 0x7e, 0x38, 0xbd, 0xd2, 0x1d, 0xb6, 0xed,
- 0x1f, 0x01, 0xe3, 0x01, 0x8f, 0xb1, 0x48, 0xab, 0xa9, 0x05, 0x9e, 0x12,
- 0xe1, 0xe1, 0x79, 0x93, 0xbc, 0xef, 0x18, 0x73, 0x18, 0xf1, 0x76, 0x6c,
- 0x6b, 0x5c, 0x10, 0x3c, 0x1e, 0x74, 0x3c, 0x70, 0x2d, 0xf1, 0xdb, 0xb0,
- 0xbd, 0xab, 0xf1, 0x01, 0x22, 0x8f, 0xa6, 0xaa, 0xfc, 0xf9, 0x95, 0xfc,
- 0xf4, 0x6d, 0xc6, 0x1c, 0x46, 0xbc, 0x49, 0xc5, 0xa8, 0xfb, 0x2b, 0xd2,
- 0xac, 0x14, 0xeb, 0x02, 0x89, 0x1c, 0xf6, 0x7c, 0x3e, 0xe6, 0x35, 0xd3,
- 0x17, 0xc0, 0x2c, 0x54, 0x9e, 0xaf, 0x75, 0xeb, 0x5b, 0xc1, 0x3c, 0xaf,
- 0x9a, 0x52, 0x62, 0xc4, 0x9b, 0xf4, 0x9c, 0xfb, 0x40, 0x69, 0x8f, 0x90,
- 0x2b, 0xe5, 0x42, 0x90, 0xcb, 0x80, 0x31, 0x40, 0x9f, 0x6e, 0x92, 0xf4,
- 0x55, 0xc0, 0x6c, 0x11, 0x66, 0xa5, 0x28, 0x4b, 0x5e, 0xc9, 0x37, 0x82,
- 0x35, 0xe2, 0xed, 0xc4, 0x8c, 0x29, 0x08, 0xb8, 0x40, 0xbe, 0x2f, 0xe8,
- 0x28, 0x22, 0xa7, 0x1c, 0x9c, 0xd9, 0x85, 0xec, 0xbd, 0x99, 0xc8, 0x8c,
- 0xb4, 0xf9, 0x8a, 0x5d, 0x5e, 0x96, 0x9f, 0xb1, 0xca, 0xe4, 0xb8, 0x11,
- 0x6f, 0xd7, 0x15, 0xf3, 0x03, 0x15, 0x7d, 0x2c, 0x97, 0x9c, 0xa3, 0x30,
- 0x1c, 0xe4, 0x34, 0xe0, 0x34, 0x62, 0x3b, 0x11, 0xbe, 0xa3, 0x50, 0x60,
- 0x05, 0xb0, 0x54, 0xe1, 0x6d, 0xd0, 0x37, 0x51, 0xd7, 0xd2, 0xb2, 0xc9,
- 0xe9, 0xb6, 0xc9, 0x55, 0x23, 0xde, 0x6e, 0xcb, 0xb8, 0x69, 0x95, 0xfb,
- 0x87, 0x55, 0x4f, 0x13, 0xf4, 0x24, 0x22, 0xdb, 0xbd, 0x1e, 0xdd, 0xf0,
- 0xef, 0xbe, 0x1d, 0x10, 0x1d, 0x9b, 0xc8, 0xd6, 0x3b, 0x1f, 0x03, 0x1f,
- 0xa3, 0x7c, 0xac, 0x22, 0xff, 0x09, 0xa5, 0xda, 0xff, 0xf1, 0x67, 0xfb,
- 0x6a, 0x4c, 0x6e, 0x19, 0xf1, 0x1a, 0x5a, 0x41, 0xe6, 0xf4, 0xca, 0x7e,
- 0x12, 0xb6, 0x8f, 0x52, 0xe4, 0x10, 0x2c, 0x86, 0xa2, 0x3a, 0x14, 0x18,
- 0x42, 0x64, 0x97, 0xc6, 0xa1, 0x44, 0x56, 0x40, 0xf5, 0x88, 0xf2, 0x49,
- 0x6d, 0x68, 0x29, 0x6b, 0xa2, 0x7c, 0xb6, 0x01, 0xeb, 0x88, 0x1c, 0xea,
- 0xb5, 0x16, 0x64, 0x1d, 0xe8, 0x5a, 0x15, 0x59, 0x6b, 0x61, 0xaf, 0xaa,
- 0xdb, 0x6e, 0xad, 0xf2, 0xdf, 0xe9, 0x09, 0x1b, 0xeb, 0x1b, 0x0c, 0x1d,
- 0xc0, 0x8f, 0x9f, 0x9f, 0x65, 0x19, 0x2b, 0x18, 0x0c, 0x06, 0x83, 0xc1,
- 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06,
- 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18,
- 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60,
- 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x43,
- 0xdb, 0xe9, 0x90, 0x9d, 0x34, 0x32, 0x32, 0x32, 0xd2, 0x34, 0xac, 0x67,
- 0xa8, 0x70, 0x00, 0x36, 0x43, 0x91, 0xef, 0x76, 0x89, 0xe8, 0x0d, 0x54,
- 0x03, 0x55, 0x91, 0x8f, 0x6c, 0x11, 0xf4, 0x23, 0x1b, 0x79, 0x3f, 0x18,
- 0xac, 0xf8, 0xb2, 0x3d, 0xe3, 0xe8, 0xf5, 0x78, 0x0f, 0x04, 0x4e, 0x07,
- 0x6b, 0x28, 0xe8, 0xce, 0xf8, 0x0d, 0x24, 0xb2, 0xf9, 0xda, 0x5a, 0x60,
- 0x1d, 0xe8, 0x5a, 0x84, 0x77, 0x03, 0x81, 0xc0, 0x27, 0x89, 0x8a, 0x87,
- 0xc7, 0xe3, 0x11, 0xa0, 0x7f, 0x0c, 0xb7, 0xd4, 0x04, 0x83, 0xc1, 0xa4,
- 0xde, 0xb6, 0xc6, 0xe3, 0xf1, 0xec, 0x23, 0xc8, 0x0f, 0xc0, 0xda, 0x0f,
- 0xbe, 0xdb, 0x25, 0x64, 0x08, 0x91, 0xdd, 0x3e, 0x1a, 0xdb, 0x76, 0xa5,
- 0xcb, 0xe5, 0x7a, 0xaf, 0xbc, 0xbc, 0x3c, 0x2e, 0xfb, 0x65, 0xa5, 0xa7,
- 0xa7, 0xf7, 0x17, 0x91, 0x76, 0x2b, 0xf3, 0x22, 0x12, 0x0a, 0x04, 0x02,
- 0xd5, 0x9d, 0x5e, 0xbc, 0xe9, 0xe9, 0x19, 0x47, 0x59, 0x62, 0x8f, 0x05,
- 0xc9, 0x04, 0xbc, 0xc4, 0xbe, 0x51, 0xf9, 0x56, 0x60, 0x39, 0xf0, 0x32,
- 0xa2, 0x2f, 0x04, 0x02, 0x81, 0x2f, 0xe2, 0x19, 0xbf, 0x73, 0xce, 0x19,
- 0xe3, 0x72, 0x5b, 0x21, 0xaf, 0x42, 0x26, 0x30, 0x16, 0x38, 0x31, 0x86,
- 0xdb, 0x57, 0x01, 0x65, 0x08, 0xa5, 0x5b, 0xb7, 0x6e, 0x79, 0x65, 0xe9,
- 0xd2, 0xa5, 0x6d, 0x2e, 0x6c, 0x5e, 0xaf, 0xd7, 0x85, 0xca, 0x03, 0xc0,
- 0x0d, 0x40, 0xdf, 0x18, 0x6f, 0xdf, 0x01, 0x6c, 0x6a, 0xf4, 0xf9, 0x00,
- 0x58, 0x8c, 0xe8, 0xa2, 0x40, 0x20, 0xf0, 0x71, 0x47, 0x08, 0xd6, 0xe7,
- 0xf1, 0x9d, 0xae, 0x30, 0xae, 0xc1, 0xb6, 0x23, 0x68, 0xfd, 0xd9, 0xd0,
- 0xdf, 0x02, 0xf3, 0x11, 0xca, 0x6c, 0x3b, 0xfc, 0x52, 0x65, 0x65, 0xa5,
- 0x23, 0x31, 0x78, 0x3d, 0xbe, 0xd7, 0x80, 0x1f, 0xb6, 0x73, 0xb2, 0x15,
- 0xc8, 0x09, 0x04, 0xfd, 0x25, 0x9d, 0x52, 0xbc, 0x5e, 0x4f, 0xc6, 0xb1,
- 0xa0, 0x7f, 0x00, 0x2e, 0x8a, 0x63, 0xb0, 0x36, 0xb0, 0x48, 0x21, 0x2b,
- 0x18, 0xf4, 0xb7, 0xe9, 0xf8, 0x8c, 0xb3, 0xce, 0x3a, 0xcb, 0x4a, 0x49,
- 0x49, 0xbb, 0x08, 0xd5, 0xbb, 0x63, 0x14, 0x6c, 0x73, 0xfc, 0x0f, 0xb8,
- 0x2b, 0x10, 0xf4, 0xff, 0xa9, 0x6d, 0xe2, 0xcd, 0xb8, 0x1c, 0xd5, 0x7f,
- 0x24, 0x20, 0x4b, 0xd6, 0x01, 0x73, 0x14, 0x99, 0x1e, 0x0c, 0x56, 0xbc,
- 0x9b, 0xf0, 0xfc, 0xf7, 0x66, 0x8c, 0x44, 0xf5, 0xf7, 0x44, 0x8e, 0x87,
- 0x69, 0x6b, 0x79, 0xab, 0x02, 0x1e, 0xb4, 0x35, 0x3c, 0xbd, 0xb2, 0xb2,
- 0x72, 0x7b, 0x6b, 0x6f, 0x1a, 0x35, 0x6a, 0x54, 0xef, 0x70, 0xc8, 0xde,
- 0x48, 0x64, 0x8f, 0xaf, 0xf6, 0xe6, 0xb3, 0x40, 0xd0, 0x7f, 0x78, 0xa7,
- 0x12, 0xaf, 0xcf, 0xeb, 0x3b, 0x40, 0x95, 0xbb, 0x81, 0xeb, 0x62, 0xa8,
- 0x65, 0x63, 0xa5, 0x06, 0xc8, 0x0b, 0x04, 0xfd, 0x8f, 0x3a, 0x73, 0xdf,
- 0x32, 0x3c, 0x82, 0x4e, 0x25, 0xb2, 0x0d, 0x6b, 0xbc, 0x59, 0xad, 0x70,
- 0x5b, 0x30, 0xe8, 0x7f, 0xde, 0x61, 0x4b, 0xb1, 0x05, 0xe8, 0x97, 0xe0,
- 0x82, 0x35, 0x1f, 0x91, 0x69, 0x81, 0x40, 0x45, 0x69, 0xfc, 0x5d, 0xe3,
- 0x8c, 0x63, 0x05, 0x9d, 0x46, 0xa4, 0xb5, 0x8d, 0x77, 0x39, 0xdb, 0xa8,
- 0x70, 0x4f, 0x38, 0x5c, 0x5f, 0xbc, 0x70, 0xe1, 0xc2, 0x70, 0x2b, 0x6c,
- 0x79, 0x1d, 0xf0, 0xe7, 0x8e, 0xea, 0x26, 0x28, 0x7a, 0x54, 0x30, 0x18,
- 0xff, 0xae, 0x55, 0x42, 0x44, 0xe5, 0xf3, 0x64, 0x9c, 0xae, 0xca, 0x3b,
- 0xc0, 0x2f, 0x12, 0x28, 0x5c, 0x88, 0xec, 0x98, 0xf8, 0xe3, 0x58, 0x6f,
- 0x1a, 0x39, 0x72, 0xa4, 0xe5, 0xf5, 0xf8, 0x26, 0x09, 0x1a, 0x48, 0x90,
- 0x70, 0x01, 0x0e, 0x17, 0x78, 0xd6, 0xeb, 0xf1, 0xdd, 0x13, 0x7b, 0x6b,
- 0x35, 0xca, 0xdd, 0x0e, 0xc2, 0x05, 0x18, 0x8d, 0xea, 0x3c, 0xaf, 0xc7,
- 0xf7, 0xd7, 0x11, 0x23, 0xbe, 0xef, 0x8a, 0x63, 0x6b, 0x7b, 0x91, 0xa0,
- 0xcb, 0x1a, 0xdc, 0xd4, 0x44, 0x34, 0x10, 0x03, 0x05, 0xa6, 0xbb, 0x5d,
- 0x29, 0x7f, 0xf7, 0xa5, 0xfb, 0x5a, 0xd3, 0xfd, 0x3a, 0xbb, 0x43, 0x07,
- 0x96, 0x54, 0x12, 0xd2, 0xf2, 0x5a, 0xf1, 0x17, 0xae, 0xef, 0x3c, 0x45,
- 0x2b, 0x81, 0xc1, 0xed, 0x64, 0x1b, 0x57, 0x6c, 0x05, 0xcb, 0xdb, 0x23,
- 0x35, 0x25, 0xed, 0xcf, 0x40, 0x41, 0x3b, 0xc4, 0xcd, 0x02, 0xee, 0xf0,
- 0x7a, 0x7c, 0x2f, 0x0c, 0x1f, 0x3e, 0xbc, 0xd5, 0xb6, 0x56, 0x6d, 0xf7,
- 0x81, 0xc4, 0xab, 0x7a, 0xf5, 0xec, 0xb5, 0xd2, 0xeb, 0xf5, 0x1e, 0xd6,
- 0xf6, 0x6e, 0x92, 0xef, 0x76, 0x54, 0x5f, 0x68, 0xa8, 0x58, 0x13, 0xcd,
- 0x65, 0x2a, 0x2c, 0xf0, 0xf9, 0x32, 0x86, 0xee, 0xe5, 0x77, 0xfb, 0xd2,
- 0xa1, 0xea, 0x4d, 0x4c, 0x45, 0x1c, 0x57, 0xf1, 0x7a, 0x3d, 0xbe, 0x6b,
- 0x15, 0x5e, 0x06, 0x7a, 0xb6, 0xa3, 0x69, 0xbe, 0x89, 0x41, 0xb8, 0xbd,
- 0x50, 0x29, 0x03, 0xae, 0x69, 0xe7, 0xec, 0xbb, 0xa4, 0x5f, 0xdf, 0xfe,
- 0xc9, 0x7e, 0x88, 0xf4, 0x30, 0x54, 0x56, 0xf9, 0x7c, 0x19, 0x87, 0x3a,
- 0xce, 0xff, 0x74, 0xdf, 0x13, 0xc0, 0xbd, 0xb1, 0x56, 0xa8, 0x6d, 0x64,
- 0xb8, 0xda, 0xfa, 0xae, 0x37, 0xdd, 0xd7, 0x92, 0x40, 0x3b, 0xfa, 0xcc,
- 0xa8, 0xbe, 0x49, 0x2d, 0x5e, 0xaf, 0xc7, 0x77, 0x06, 0xf0, 0xc7, 0x04,
- 0xbb, 0xc9, 0xd1, 0x08, 0xb6, 0xca, 0x23, 0xf0, 0xf9, 0xdc, 0xa8, 0x3c,
- 0xd1, 0x81, 0x2e, 0xd4, 0xa9, 0x5e, 0x8f, 0xef, 0xe5, 0x24, 0x17, 0xb0,
- 0xa5, 0xb6, 0x2e, 0x1f, 0x37, 0x6e, 0x5c, 0x9a, 0x83, 0xfc, 0x9f, 0x82,
- 0xf0, 0xf3, 0x0e, 0x8a, 0xf7, 0xbe, 0x08, 0xf3, 0xbd, 0x5e, 0x6f, 0x73,
- 0x22, 0xed, 0xe8, 0xa3, 0x59, 0xc2, 0x49, 0x2b, 0x5e, 0xaf, 0xd7, 0xbb,
- 0x0f, 0xf0, 0x7c, 0x3b, 0xd7, 0xb8, 0x00, 0xb5, 0x62, 0xf1, 0x4c, 0x6b,
- 0x7e, 0x68, 0xdb, 0xfc, 0x1c, 0xb8, 0xac, 0x83, 0x33, 0xf1, 0x7c, 0xaf,
- 0xc7, 0x77, 0x75, 0x92, 0x0b, 0x78, 0x40, 0xcd, 0x8e, 0xda, 0x0a, 0xaf,
- 0xd7, 0xdb, 0xea, 0xb2, 0x91, 0x9e, 0xee, 0xfb, 0x1e, 0x70, 0x07, 0x1d,
- 0x7b, 0x02, 0xc7, 0x49, 0xa8, 0x34, 0x37, 0xbe, 0x50, 0xd5, 0xc1, 0x36,
- 0xad, 0x4a, 0x5a, 0xf1, 0xa2, 0xf2, 0x08, 0x70, 0x68, 0x07, 0x18, 0xe5,
- 0x3d, 0xbf, 0xdf, 0xbf, 0xd7, 0x43, 0x9b, 0xbd, 0x1e, 0xdf, 0xc1, 0x02,
- 0x8f, 0x25, 0x81, 0x30, 0x04, 0x78, 0x64, 0xdc, 0xb8, 0x71, 0xae, 0x24,
- 0x17, 0xf0, 0x48, 0x51, 0x69, 0xf5, 0x40, 0xa0, 0x25, 0x94, 0x02, 0xee,
- 0x24, 0x88, 0x77, 0x8e, 0xcf, 0x9b, 0x71, 0x72, 0xd3, 0xf2, 0xc9, 0xff,
- 0x3a, 0x38, 0xd3, 0xb7, 0x26, 0xa5, 0x78, 0xbd, 0x5e, 0xef, 0x58, 0xe0,
- 0xf2, 0x8e, 0x30, 0x8a, 0xb6, 0x7e, 0xd0, 0x69, 0x72, 0x07, 0x78, 0x05,
- 0xcd, 0xd1, 0xab, 0x66, 0x47, 0xed, 0x1f, 0x92, 0x5c, 0xbc, 0x28, 0x3c,
- 0x99, 0x9e, 0xee, 0xdb, 0xab, 0x20, 0xbd, 0x1e, 0xdf, 0x35, 0xb4, 0xdf,
- 0xe0, 0xe4, 0xde, 0xe3, 0xad, 0xfa, 0x60, 0x13, 0xf1, 0x08, 0x73, 0x3a,
- 0x34, 0x4e, 0x22, 0x1f, 0x24, 0x67, 0xcb, 0xab, 0x72, 0x5b, 0x07, 0xd9,
- 0xe4, 0xb3, 0x60, 0xd0, 0xff, 0x5c, 0x2b, 0xfa, 0xba, 0xfb, 0x02, 0x13,
- 0x92, 0x4c, 0x1b, 0x37, 0x92, 0xfc, 0xf4, 0x14, 0xd1, 0x53, 0x5b, 0xf1,
- 0xbb, 0x82, 0x24, 0x8b, 0xf7, 0x18, 0xaf, 0xc7, 0x77, 0x44, 0xe3, 0x0b,
- 0xbd, 0xfb, 0xf6, 0x7e, 0x0d, 0xd8, 0xde, 0x41, 0xf1, 0x79, 0x27, 0x10,
- 0xa8, 0xf8, 0x26, 0xe9, 0xc4, 0xeb, 0xf5, 0x64, 0x9c, 0x0e, 0xa4, 0xc7,
- 0x31, 0x3e, 0xdb, 0x81, 0xaf, 0x5b, 0x61, 0x68, 0x5b, 0x91, 0x89, 0xad,
- 0xab, 0x89, 0xf9, 0x69, 0x1c, 0xfb, 0x62, 0xf1, 0x2a, 0x00, 0xfd, 0xbc,
- 0x1e, 0xef, 0x65, 0xc9, 0xae, 0x5e, 0x41, 0x5e, 0xf4, 0x78, 0x3c, 0x56,
- 0xf3, 0x5e, 0x57, 0xc6, 0x59, 0x44, 0xe6, 0x7b, 0x27, 0x93, 0x6d, 0x41,
- 0xb8, 0xa9, 0xf1, 0x7f, 0x5f, 0x79, 0xe5, 0x95, 0x10, 0xf0, 0x10, 0xf0,
- 0x19, 0xf0, 0x79, 0x0b, 0x1f, 0x75, 0xf0, 0xb4, 0x2f, 0x5a, 0x08, 0xef,
- 0x13, 0xe0, 0xce, 0x44, 0xf6, 0xc1, 0xda, 0x20, 0x5e, 0xdf, 0xb3, 0xc0,
- 0x4f, 0xda, 0xe6, 0x9d, 0x31, 0x1b, 0x78, 0xc6, 0x85, 0xe5, 0x2f, 0x0f,
- 0x96, 0x6f, 0x68, 0xe4, 0x8e, 0x0f, 0x05, 0x19, 0x89, 0x72, 0x71, 0x83,
- 0x5b, 0x9e, 0xd2, 0xe8, 0xbe, 0x47, 0x03, 0x41, 0xff, 0x4d, 0x7b, 0x0b,
- 0xdc, 0xe3, 0xf1, 0xf4, 0x11, 0xac, 0x6f, 0x89, 0x7d, 0x1e, 0x75, 0xe3,
- 0xf8, 0xbd, 0x2a, 0xf0, 0x90, 0xe5, 0xb6, 0x16, 0x95, 0x97, 0x97, 0x57,
- 0xa7, 0x9f, 0x33, 0x7a, 0xb0, 0x25, 0xf6, 0x68, 0x44, 0xb3, 0x81, 0xef,
- 0xb7, 0x21, 0xed, 0x6b, 0x02, 0x41, 0xff, 0xfe, 0xd1, 0xe3, 0x3d, 0x2a,
- 0x45, 0xb0, 0xeb, 0x62, 0x0c, 0xaf, 0x16, 0x98, 0x48, 0x64, 0x72, 0xc7,
- 0x60, 0x22, 0xf3, 0x87, 0xcf, 0x8a, 0x83, 0xff, 0xdc, 0x27, 0x50, 0x19,
- 0x7d, 0x5c, 0xc1, 0xeb, 0xf1, 0x7d, 0x0a, 0xb4, 0x65, 0x02, 0xc2, 0x1b,
- 0x02, 0x45, 0xe2, 0xb2, 0xca, 0x2a, 0x2a, 0xca, 0x37, 0x7a, 0x3c, 0x9e,
- 0xbe, 0x82, 0x8c, 0x04, 0xf9, 0x15, 0x70, 0x41, 0x1b, 0xca, 0x67, 0x58,
- 0x60, 0xb0, 0x3f, 0xe8, 0xdf, 0x1c, 0x63, 0x79, 0xae, 0x01, 0xd2, 0x62,
- 0x33, 0x8f, 0xdd, 0x2b, 0x18, 0x0c, 0xee, 0xe8, 0x88, 0xca, 0xd5, 0xf1,
- 0x20, 0x83, 0xc7, 0xe3, 0xe9, 0x07, 0x5c, 0xda, 0x86, 0x67, 0x7f, 0x81,
- 0xf0, 0x93, 0x40, 0xc0, 0xff, 0x7a, 0xb4, 0x2f, 0x03, 0x81, 0xc0, 0x5a,
- 0xe0, 0x25, 0xe0, 0x25, 0x5f, 0xba, 0x6f, 0xa2, 0x0a, 0x37, 0x12, 0x79,
- 0x3f, 0xfb, 0x62, 0x20, 0xe8, 0xbf, 0xb5, 0x75, 0x35, 0x93, 0x6b, 0x18,
- 0xa8, 0x53, 0xe1, 0xd6, 0x01, 0x37, 0x06, 0x82, 0xfe, 0x27, 0x1b, 0x5f,
- 0xac, 0x5c, 0x30, 0x7f, 0x3d, 0xf0, 0xac, 0xcf, 0xe7, 0x9b, 0xa5, 0x36,
- 0x77, 0x03, 0xb7, 0x3b, 0x0c, 0x7f, 0x9f, 0x38, 0xe7, 0x65, 0x7d, 0x20,
- 0xe8, 0x7f, 0xb8, 0xf1, 0x85, 0x8c, 0x8c, 0x8c, 0x21, 0x76, 0x48, 0x6f,
- 0x45, 0x98, 0xd4, 0x06, 0xdf, 0xec, 0x10, 0x22, 0x0b, 0x1b, 0xa2, 0xb1,
- 0x7f, 0x1b, 0xe2, 0x7b, 0x2f, 0xa2, 0x53, 0xfc, 0x81, 0x40, 0x68, 0xe7,
- 0x85, 0x60, 0x30, 0x58, 0x05, 0xcc, 0x03, 0xe6, 0xf9, 0xbc, 0xbe, 0xab,
- 0x55, 0xf9, 0x23, 0xce, 0xe6, 0x23, 0xbb, 0x80, 0x23, 0x80, 0xff, 0xd0,
- 0x85, 0x71, 0xec, 0x36, 0x0b, 0xd6, 0xe9, 0x6d, 0x18, 0x04, 0xfa, 0x40,
- 0x2c, 0x4e, 0x6b, 0x4e, 0xb8, 0x7b, 0xe2, 0xaf, 0xf4, 0xaf, 0x0b, 0x04,
- 0xfd, 0xf7, 0x04, 0x82, 0xfe, 0x23, 0x5b, 0x2b, 0xdc, 0x86, 0x7a, 0xd1,
- 0xe9, 0xd4, 0x47, 0x5b, 0x84, 0xac, 0x3d, 0x85, 0xbb, 0x5b, 0x9c, 0xfc,
- 0xfe, 0x90, 0x62, 0xdf, 0x09, 0x14, 0x3a, 0x7c, 0x46, 0x9a, 0xd7, 0xeb,
- 0x3d, 0x3e, 0x91, 0x99, 0x5b, 0x51, 0x51, 0xb1, 0x2e, 0x50, 0xe9, 0xcf,
- 0x47, 0x9d, 0x0f, 0x28, 0x8a, 0x72, 0x43, 0x33, 0x63, 0x09, 0x47, 0xe3,
- 0x70, 0x16, 0x95, 0x40, 0xb1, 0x62, 0xff, 0x36, 0xd0, 0x48, 0xb8, 0x4d,
- 0xec, 0x1b, 0xf0, 0xff, 0x15, 0xe5, 0x26, 0x1c, 0xbe, 0xa3, 0x55, 0x18,
- 0x4e, 0x17, 0xa7, 0x2d, 0x7d, 0xde, 0x91, 0x0e, 0xef, 0xab, 0x16, 0xb8,
- 0xc4, 0xef, 0xf7, 0xaf, 0x6b, 0x87, 0xf4, 0x39, 0x2d, 0xb4, 0x8b, 0xfc,
- 0x01, 0xff, 0xe3, 0x7b, 0xfb, 0x51, 0x30, 0x18, 0xb4, 0x2d, 0xe4, 0x76,
- 0x22, 0x2b, 0x75, 0x9c, 0x94, 0xb0, 0x5f, 0xb6, 0x47, 0x26, 0x07, 0x2a,
- 0xfd, 0xcf, 0x03, 0x6f, 0x3b, 0x14, 0xc1, 0x35, 0x19, 0x19, 0x19, 0x4d,
- 0xdc, 0x57, 0xb5, 0xd5, 0xe9, 0x20, 0xe0, 0x7a, 0x11, 0xb9, 0x35, 0x18,
- 0x0c, 0xda, 0xad, 0x88, 0xf7, 0x5f, 0x80, 0x05, 0x0e, 0x9f, 0x73, 0x89,
- 0x11, 0x6f, 0xf3, 0x8c, 0x71, 0x78, 0xdf, 0x53, 0xfe, 0xa0, 0xff, 0x83,
- 0x44, 0x27, 0xcc, 0xe3, 0xf1, 0xf4, 0x00, 0x7c, 0x4e, 0xdc, 0x65, 0xc5,
- 0x6a, 0xf5, 0x60, 0x52, 0x45, 0xb0, 0xa2, 0x06, 0x07, 0x8b, 0x23, 0x1a,
- 0xda, 0xa0, 0x8b, 0xdb, 0x2b, 0xa3, 0x15, 0xf9, 0xa9, 0xc3, 0x5b, 0x07,
- 0xd8, 0x21, 0x8d, 0xe2, 0xba, 0xca, 0x25, 0x4e, 0xd3, 0x5c, 0x11, 0xa8,
- 0xa8, 0x69, 0x7d, 0xbc, 0xed, 0xcb, 0x80, 0x7a, 0x07, 0x0f, 0xf2, 0x65,
- 0x64, 0x64, 0xa4, 0x1a, 0xf1, 0xee, 0x41, 0x46, 0x46, 0x46, 0x4a, 0xc3,
- 0x80, 0x48, 0xcc, 0xfd, 0x32, 0xb1, 0x68, 0xa7, 0x77, 0x9c, 0xd6, 0x81,
- 0x0e, 0xdd, 0xfa, 0x55, 0xc1, 0x60, 0xf9, 0x9a, 0x18, 0xa5, 0xb1, 0x14,
- 0x67, 0x23, 0x95, 0x03, 0xda, 0x2b, 0xa3, 0x83, 0xc1, 0x8a, 0x8f, 0x1c,
- 0xbb, 0xa0, 0x12, 0xd5, 0x8e, 0xfd, 0x1c, 0x05, 0x25, 0xba, 0x34, 0xb6,
- 0x78, 0x07, 0xd7, 0xa1, 0xac, 0x72, 0xf0, 0xac, 0x14, 0xdb, 0x6e, 0x53,
- 0x9f, 0xbc, 0x6b, 0x8a, 0x57, 0xc3, 0x3a, 0x00, 0x67, 0x83, 0x5d, 0x1f,
- 0xf8, 0xfd, 0xfe, 0xaf, 0xdb, 0x23, 0x61, 0x82, 0x38, 0x9d, 0x8c, 0xfe,
- 0x5c, 0xac, 0x37, 0x04, 0x82, 0x81, 0x6d, 0x40, 0x99, 0x83, 0x67, 0xb5,
- 0xf7, 0xac, 0x24, 0x75, 0x66, 0xcb, 0xa8, 0xe2, 0x75, 0x12, 0xf7, 0x97,
- 0xfd, 0x01, 0xff, 0x76, 0x07, 0x11, 0x70, 0x36, 0x27, 0x5c, 0xb5, 0xb7,
- 0x11, 0x6f, 0xfc, 0x5a, 0x8c, 0xff, 0xb6, 0x57, 0xc2, 0x04, 0x75, 0xb6,
- 0xb2, 0x49, 0xe4, 0x55, 0x87, 0x0f, 0xfc, 0xa7, 0x83, 0xbb, 0xda, 0x7b,
- 0xd6, 0xd7, 0x57, 0x0e, 0xc5, 0x6b, 0xc5, 0x25, 0xee, 0x22, 0x2f, 0x39,
- 0xb3, 0xad, 0xbe, 0xe2, 0x30, 0xbd, 0x3d, 0x8c, 0x78, 0x9b, 0x54, 0x68,
- 0x8e, 0xc5, 0xfb, 0x51, 0x3b, 0x36, 0x31, 0x4e, 0xc4, 0x1b, 0x1a, 0x3c,
- 0x78, 0xe0, 0x7f, 0x9c, 0x95, 0x2f, 0x58, 0x74, 0x8b, 0x17, 0x00, 0x00,
- 0x13, 0xdf, 0x49, 0x44, 0x41, 0x54, 0x59, 0x98, 0xf4, 0x2d, 0xaf, 0xf2,
- 0x99, 0x43, 0x5b, 0xc6, 0xa5, 0xe5, 0x15, 0x78, 0xdd, 0x91, 0x02, 0x7b,
- 0xf4, 0x58, 0xe2, 0xc8, 0xe5, 0xd7, 0x76, 0x5d, 0x9a, 0xda, 0xee, 0x38,
- 0x2d, 0x3c, 0x0e, 0xc5, 0xab, 0x1b, 0xf6, 0xf6, 0x0b, 0x8f, 0xc7, 0xe3,
- 0xb2, 0xb0, 0x0e, 0xb5, 0x91, 0xa1, 0x16, 0xba, 0x8f, 0x2a, 0x03, 0x44,
- 0xd8, 0x47, 0x23, 0xcf, 0x0c, 0xa3, 0x6c, 0x41, 0x74, 0xa3, 0xa8, 0x7c,
- 0x64, 0xa5, 0x58, 0x1f, 0x95, 0x97, 0x97, 0x37, 0xe7, 0x86, 0x39, 0x79,
- 0x8f, 0x5a, 0x33, 0x6b, 0xd6, 0x2c, 0x75, 0x56, 0xc0, 0xb5, 0xd6, 0x49,
- 0xcb, 0x7b, 0xe9, 0xa5, 0x97, 0xba, 0x66, 0xcd, 0x9a, 0x15, 0x6e, 0x8f,
- 0xcc, 0x16, 0x61, 0x9d, 0x3a, 0xcb, 0xb7, 0x7e, 0xc0, 0xc6, 0x9d, 0xff,
- 0xf3, 0xf9, 0x7c, 0x03, 0xd4, 0x8e, 0x7d, 0x02, 0x85, 0xda, 0x8e, 0x6c,
- 0xc4, 0xdc, 0xb9, 0x73, 0xc3, 0x5e, 0x8f, 0xaf, 0x2e, 0xd6, 0x96, 0x54,
- 0x2c, 0xe9, 0x65, 0xc4, 0xdb, 0xb4, 0x10, 0xf4, 0x70, 0x56, 0x08, 0xd8,
- 0xd4, 0xd2, 0x97, 0x5e, 0x8f, 0xef, 0xaf, 0xc0, 0xe5, 0x0a, 0xa9, 0x82,
- 0x46, 0x3a, 0x68, 0xb2, 0x47, 0x47, 0x4d, 0x1a, 0x9c, 0x62, 0x81, 0x70,
- 0xc8, 0xae, 0xf3, 0x7a, 0x7c, 0xaf, 0x20, 0x3a, 0xb1, 0xc9, 0x6e, 0x92,
- 0xc2, 0x7e, 0x0e, 0x7a, 0x78, 0x75, 0x4e, 0x0d, 0xa9, 0x10, 0x72, 0x32,
- 0x1d, 0x68, 0xc3, 0x86, 0x0d, 0xfb, 0x3b, 0x75, 0x67, 0x1d, 0x78, 0x4c,
- 0x9b, 0x9c, 0xcd, 0x59, 0x92, 0x3d, 0x67, 0x10, 0x1d, 0xec, 0xb0, 0xf6,
- 0x08, 0xb5, 0x21, 0xfa, 0xf5, 0xb1, 0x8a, 0x57, 0x55, 0x87, 0x1a, 0xf1,
- 0xee, 0x81, 0x0d, 0x5b, 0xc5, 0x51, 0x01, 0xdf, 0xdb, 0x20, 0x92, 0x1e,
- 0x00, 0x12, 0xcb, 0xf0, 0x7e, 0x2a, 0x70, 0x09, 0x2a, 0x5b, 0x80, 0xeb,
- 0xe3, 0x25, 0x44, 0x67, 0xfd, 0x42, 0x11, 0x27, 0xe3, 0x41, 0xed, 0xb8,
- 0x8d, 0x30, 0x88, 0xf4, 0x73, 0x38, 0x66, 0x55, 0x17, 0x1f, 0xdb, 0xda,
- 0xd2, 0x26, 0x13, 0x1b, 0xda, 0xde, 0xe7, 0x15, 0xc4, 0xd1, 0xfa, 0x44,
- 0x51, 0x06, 0x25, 0xa8, 0x2f, 0x27, 0x51, 0xae, 0xad, 0x71, 0x10, 0x92,
- 0xf3, 0xf7, 0x82, 0xaa, 0x4e, 0x2a, 0x42, 0xdd, 0xbc, 0x79, 0x73, 0x3b,
- 0xae, 0x35, 0xb5, 0x9d, 0xda, 0xdf, 0xde, 0xa3, 0xc2, 0x71, 0xb6, 0x67,
- 0xb6, 0x4a, 0x5b, 0xfa, 0xf8, 0x31, 0xe7, 0x8d, 0x88, 0xac, 0x35, 0xe2,
- 0x6d, 0x22, 0x42, 0xdd, 0xe2, 0xb0, 0xee, 0x3c, 0x24, 0x41, 0xcd, 0x5e,
- 0xb4, 0x97, 0xf8, 0x4e, 0x76, 0x2f, 0xe8, 0x71, 0xe9, 0xa5, 0x97, 0x3a,
- 0x1b, 0x81, 0x17, 0x75, 0xd2, 0xc7, 0x0e, 0xc7, 0x63, 0x83, 0xf6, 0x18,
- 0x22, 0x79, 0xb0, 0x33, 0xf3, 0xee, 0x2e, 0xde, 0x8a, 0x8a, 0x8a, 0x1d,
- 0x38, 0x18, 0x40, 0x12, 0x4b, 0x1c, 0x0d, 0x20, 0x79, 0x3c, 0x9e, 0xbe,
- 0xec, 0xbe, 0x30, 0xa5, 0xb5, 0x7d, 0xec, 0xed, 0x46, 0xbc, 0x4d, 0x9c,
- 0x1f, 0xdb, 0xe9, 0xce, 0x00, 0x27, 0x26, 0x28, 0x1d, 0xa1, 0x28, 0x2d,
- 0xaf, 0x93, 0x8c, 0x73, 0xaf, 0x5f, 0xbf, 0xfe, 0x74, 0x87, 0x71, 0x18,
- 0xe7, 0x44, 0xbc, 0xed, 0x9c, 0xdf, 0xc3, 0x1c, 0x3a, 0x36, 0xe1, 0x56,
- 0xd9, 0x7c, 0xef, 0x7d, 0xd0, 0x73, 0x1c, 0x7a, 0x7a, 0x19, 0x8e, 0xdc,
- 0x66, 0x61, 0x87, 0x11, 0xef, 0x9e, 0x37, 0x59, 0xd6, 0x16, 0x9c, 0x75,
- 0x9e, 0x4e, 0xc8, 0xc8, 0xc8, 0x48, 0x8b, 0x7b, 0x2a, 0xb4, 0x69, 0xcb,
- 0x2b, 0x4e, 0x33, 0x4e, 0x2d, 0x87, 0x27, 0x3b, 0x88, 0x93, 0xf5, 0xb9,
- 0xa1, 0xce, 0x90, 0xdf, 0x88, 0x86, 0xe3, 0x54, 0xf1, 0x38, 0x9d, 0x52,
- 0xf9, 0x23, 0x87, 0xe9, 0xad, 0x31, 0xe2, 0xdd, 0x03, 0xbf, 0xdf, 0x5f,
- 0x0f, 0x7c, 0xe8, 0xe0, 0xd6, 0x7e, 0x76, 0x48, 0xe3, 0xbf, 0x8b, 0x44,
- 0x14, 0xb7, 0xd9, 0x76, 0xbc, 0x6f, 0x90, 0xc6, 0x3c, 0xdf, 0xd8, 0xeb,
- 0xf1, 0x0d, 0x74, 0xe8, 0x55, 0xb4, 0x9b, 0x78, 0x1b, 0xe6, 0x7a, 0x3b,
- 0x19, 0xf4, 0xd9, 0xa6, 0x1a, 0x75, 0x6d, 0xb1, 0x93, 0xf9, 0xc6, 0x63,
- 0x3c, 0x9e, 0x0c, 0x27, 0xdb, 0xa0, 0x7a, 0x9d, 0x95, 0x0b, 0xd9, 0x66,
- 0xc4, 0x1b, 0x9d, 0xa0, 0x43, 0xa1, 0x4d, 0xc8, 0xcc, 0xcc, 0x4c, 0x6d,
- 0xa6, 0x4f, 0x74, 0xb1, 0x62, 0x0f, 0xd9, 0xf9, 0x21, 0xb2, 0x9e, 0xd7,
- 0x91, 0x08, 0xc2, 0xe1, 0xfa, 0xaf, 0x89, 0x9c, 0x38, 0x18, 0x2b, 0x87,
- 0xfb, 0xd2, 0x7d, 0x87, 0xc5, 0x56, 0x46, 0xb8, 0xd0, 0xa1, 0x0d, 0xd7,
- 0xb7, 0x5b, 0x6f, 0x57, 0xac, 0x89, 0x8e, 0xc4, 0xab, 0xbc, 0x14, 0x0c,
- 0x06, 0xa3, 0x79, 0x59, 0x6b, 0x1c, 0x15, 0x38, 0xd5, 0x98, 0xb6, 0xde,
- 0xcd, 0xf0, 0x66, 0x8c, 0x00, 0x0e, 0x74, 0xf0, 0xa8, 0xda, 0x50, 0x48,
- 0xbf, 0x31, 0xe2, 0x8d, 0x9e, 0xa9, 0x8b, 0x1d, 0xde, 0x79, 0x54, 0x5d,
- 0x6d, 0x7d, 0x71, 0x33, 0x2d, 0xfa, 0xd6, 0x60, 0x30, 0xb8, 0x7e, 0xe7,
- 0x07, 0x55, 0x6d, 0x65, 0x5c, 0x9a, 0xb4, 0x02, 0x0b, 0x17, 0x2e, 0x0c,
- 0x0b, 0x38, 0x99, 0x56, 0x97, 0xa2, 0x42, 0xab, 0xcf, 0x17, 0xf2, 0x79,
- 0x7d, 0x03, 0x54, 0x79, 0xdc, 0xa1, 0xa4, 0x9e, 0x69, 0xb7, 0x9c, 0x56,
- 0xa6, 0x38, 0x2b, 0x21, 0xfa, 0xb7, 0xe8, 0x75, 0x30, 0x4f, 0x3a, 0x8a,
- 0x86, 0xf0, 0x9c, 0xcf, 0xe3, 0x6b, 0xf5, 0x9c, 0x63, 0x5b, 0xf5, 0x19,
- 0x67, 0xe5, 0x54, 0xca, 0x16, 0x2e, 0xf4, 0xd7, 0x19, 0xf1, 0x46, 0xbf,
- 0xb3, 0x2d, 0xbb, 0x14, 0xdc, 0xe0, 0xf5, 0xf8, 0xf6, 0xba, 0x03, 0x85,
- 0x48, 0xeb, 0x5e, 0x2d, 0x88, 0x44, 0x77, 0x3f, 0x15, 0x79, 0xd1, 0x61,
- 0xfc, 0x4e, 0xf3, 0x7a, 0x7c, 0xbf, 0xdf, 0xab, 0x70, 0xd3, 0x7d, 0x3d,
- 0x54, 0x79, 0x0d, 0xa7, 0x93, 0x5d, 0x2c, 0xfd, 0x63, 0xfb, 0xb8, 0xcc,
- 0xbe, 0xbb, 0x71, 0x30, 0x5a, 0xdb, 0xa0, 0xb6, 0x25, 0xd1, 0x2f, 0xa7,
- 0xfc, 0xc9, 0xe1, 0xb8, 0x47, 0x1f, 0x85, 0xbf, 0x79, 0xbd, 0xde, 0xd6,
- 0xec, 0x4c, 0xf9, 0x17, 0x1c, 0x0e, 0xb2, 0x21, 0xbc, 0x40, 0x17, 0xc7,
- 0xb1, 0x78, 0x55, 0xed, 0x95, 0x44, 0x0e, 0x9a, 0x76, 0x66, 0x5a, 0xb8,
- 0xd7, 0xeb, 0xf1, 0x3d, 0xe1, 0xf3, 0xf9, 0xa2, 0x6e, 0x60, 0x36, 0x7c,
- 0xf8, 0x70, 0x51, 0x38, 0xa6, 0x75, 0x8d, 0x8a, 0x34, 0xd3, 0xff, 0xb2,
- 0xff, 0xdb, 0x86, 0xf8, 0xdd, 0xee, 0xf5, 0xf8, 0x8a, 0x7e, 0xf0, 0x83,
- 0x1f, 0x44, 0x2d, 0x64, 0x19, 0xbe, 0x51, 0x07, 0x6a, 0x64, 0xbf, 0xe2,
- 0x33, 0x1d, 0x3e, 0x63, 0x87, 0xdf, 0xef, 0x8f, 0xe7, 0xcc, 0xaa, 0xb4,
- 0x66, 0x3c, 0x83, 0x6b, 0x04, 0x7e, 0xdb, 0x06, 0x7f, 0x3b, 0xea, 0xc0,
- 0x5f, 0x20, 0x50, 0xba, 0x0e, 0x1c, 0x8f, 0xe6, 0x5e, 0x84, 0xca, 0x0b,
- 0xe9, 0xe9, 0x9e, 0xa8, 0xd3, 0x6c, 0x47, 0x8f, 0x1e, 0xdd, 0xcb, 0xeb,
- 0xf1, 0x3d, 0x4d, 0x5b, 0x8e, 0xa5, 0x51, 0x96, 0x77, 0x75, 0xf1, 0x3a,
- 0x7e, 0x69, 0x1e, 0x0c, 0x06, 0xc3, 0x5e, 0x8f, 0xef, 0x51, 0xa0, 0x2d,
- 0x5b, 0xbf, 0x5e, 0xa3, 0x36, 0x17, 0x79, 0x3d, 0xbe, 0xbf, 0x23, 0xcc,
- 0x51, 0x8d, 0x4c, 0x13, 0x14, 0xd5, 0x83, 0x10, 0xb9, 0x92, 0x56, 0x8a,
- 0x17, 0xd1, 0xa8, 0xe2, 0x0d, 0xdb, 0xae, 0x55, 0x2e, 0xcb, 0xfe, 0x06,
- 0x67, 0x7b, 0x2d, 0x59, 0x40, 0x4e, 0x8f, 0xb4, 0x9e, 0x57, 0x78, 0x3d,
- 0xbe, 0xbf, 0xa3, 0x2c, 0x53, 0x61, 0xbd, 0x20, 0x07, 0x83, 0x7a, 0x6d,
- 0xdb, 0xbe, 0xd8, 0x71, 0x6b, 0x16, 0x21, 0xde, 0x93, 0x33, 0xac, 0x5d,
- 0x2d, 0xad, 0xc7, 0x2d, 0xea, 0x1a, 0x8d, 0xe8, 0x8d, 0xaa, 0x8e, 0xfb,
- 0xe3, 0x80, 0xfc, 0x25, 0x10, 0xa8, 0x68, 0xc9, 0xf5, 0x5c, 0x01, 0x9c,
- 0xe1, 0x30, 0xf0, 0x0b, 0x2d, 0xb1, 0xbe, 0xf2, 0x7a, 0x7c, 0xcf, 0xa3,
- 0x2c, 0x52, 0xe1, 0x7f, 0x82, 0xec, 0x07, 0x3a, 0x22, 0x54, 0x1f, 0xbe,
- 0x92, 0xb6, 0x9d, 0xef, 0x53, 0xa3, 0xf0, 0xa9, 0x11, 0x6f, 0xcb, 0xcd,
- 0xef, 0xe3, 0x88, 0xdc, 0x42, 0xdb, 0x06, 0xbe, 0x06, 0x00, 0xe3, 0x51,
- 0xc6, 0x4b, 0x23, 0x3f, 0x38, 0xa6, 0x22, 0xa6, 0xd1, 0x47, 0x3e, 0x17,
- 0x2c, 0x28, 0xaf, 0xf3, 0xa4, 0xfb, 0x26, 0x89, 0xf0, 0xf7, 0x36, 0xc4,
- 0x6f, 0x28, 0x90, 0x8b, 0xec, 0x1c, 0xed, 0xd1, 0x78, 0xd8, 0x5d, 0x41,
- 0xaf, 0x8d, 0x73, 0x5e, 0xba, 0xbc, 0x1e, 0xdf, 0x56, 0x22, 0xaf, 0x47,
- 0x86, 0x20, 0x6d, 0x8f, 0xa7, 0xad, 0xe1, 0x5b, 0x5b, 0xfe, 0x9e, 0x9f,
- 0x58, 0xc2, 0x27, 0x6d, 0xc8, 0xff, 0xde, 0xc0, 0xb5, 0x08, 0xd7, 0xc6,
- 0xd1, 0xb6, 0x00, 0x53, 0x82, 0xc1, 0x8a, 0xea, 0xae, 0x2e, 0xde, 0x36,
- 0xed, 0xdb, 0x1c, 0xa8, 0x0c, 0xac, 0x06, 0x5e, 0xec, 0xe8, 0x44, 0x68,
- 0x4b, 0xaf, 0x2d, 0x84, 0xd7, 0x48, 0xbe, 0xf7, 0x7d, 0x1b, 0x03, 0xc1,
- 0xc0, 0xc2, 0x04, 0x84, 0xdb, 0x17, 0x18, 0x12, 0xa7, 0xb0, 0x36, 0x58,
- 0x96, 0x6c, 0x6c, 0xe9, 0x07, 0x95, 0x95, 0xfe, 0xd5, 0xc0, 0x97, 0x49,
- 0x57, 0xaa, 0x85, 0xbf, 0xd2, 0x0d, 0x88, 0xc7, 0x59, 0x45, 0x33, 0x92,
- 0x20, 0xb3, 0x42, 0xcd, 0xbb, 0xf7, 0xfe, 0xad, 0x0a, 0x77, 0x27, 0x57,
- 0xd9, 0x4a, 0xdc, 0x46, 0xdc, 0x71, 0x8b, 0xa3, 0xc8, 0xd5, 0x81, 0x40,
- 0x60, 0xaf, 0x53, 0x20, 0x15, 0xbd, 0x2e, 0xc9, 0xa2, 0xfe, 0xc7, 0x40,
- 0xc0, 0xff, 0x8d, 0x11, 0x6f, 0x6b, 0x5a, 0xdf, 0xa0, 0x7f, 0x11, 0xb4,
- 0xfe, 0xd5, 0x4a, 0x82, 0x9a, 0xde, 0xfa, 0x96, 0xdd, 0x6a, 0x7d, 0x1c,
- 0xf8, 0x36, 0x49, 0x6c, 0xbe, 0xd9, 0x1f, 0xf4, 0x3f, 0x92, 0xe4, 0xe5,
- 0xe2, 0x4d, 0x5b, 0x65, 0x5e, 0xeb, 0xc6, 0x3e, 0x02, 0x7e, 0xe0, 0x9d,
- 0x24, 0x89, 0xb7, 0x2a, 0xfc, 0x81, 0x6e, 0x42, 0x7c, 0x4e, 0x09, 0xb4,
- 0x35, 0x1b, 0xd8, 0xd0, 0x51, 0x89, 0x90, 0xbd, 0xcc, 0xf6, 0x09, 0x54,
- 0x06, 0x36, 0x22, 0x8e, 0xe6, 0x1e, 0xc7, 0x9b, 0xb0, 0xa2, 0xe7, 0x27,
- 0x79, 0x99, 0x50, 0xdb, 0x0e, 0x67, 0x04, 0x83, 0xe5, 0xad, 0x5e, 0x78,
- 0x20, 0x16, 0x67, 0xe1, 0x6c, 0x42, 0x4c, 0xbc, 0xc9, 0x09, 0x06, 0xfd,
- 0xab, 0x8d, 0x78, 0x63, 0x69, 0x7d, 0x17, 0x04, 0xbe, 0x15, 0xb8, 0x10,
- 0x67, 0x53, 0xe6, 0xda, 0x5e, 0xda, 0x5a, 0xb1, 0xc8, 0x3b, 0x10, 0xf0,
- 0x2f, 0x93, 0x8e, 0x3f, 0x70, 0xac, 0x20, 0x18, 0x0c, 0xfc, 0x3b, 0xb9,
- 0xa5, 0xab, 0x97, 0x55, 0x2e, 0xa8, 0x8c, 0x49, 0x88, 0x7e, 0xbf, 0xbf,
- 0x5a, 0x22, 0x0b, 0x33, 0x42, 0x1d, 0x18, 0xf3, 0x97, 0xc3, 0xb6, 0xf5,
- 0x28, 0xdd, 0x88, 0xb8, 0x9d, 0x62, 0xef, 0x0f, 0xfa, 0x17, 0x21, 0x5c,
- 0x49, 0x3b, 0x2f, 0x82, 0x6f, 0x28, 0x70, 0xad, 0xaa, 0x34, 0xea, 0xc3,
- 0xf5, 0x8f, 0xa2, 0x3c, 0xdd, 0x41, 0xb6, 0x7e, 0x3a, 0x10, 0xf4, 0xdf,
- 0x96, 0xe4, 0xe5, 0x21, 0xd7, 0x72, 0x5b, 0x2f, 0x3a, 0xcc, 0xff, 0x7f,
- 0xa3, 0xdc, 0x45, 0xc7, 0x9c, 0x42, 0xbf, 0x58, 0x91, 0x9f, 0x2e, 0x58,
- 0x50, 0x5e, 0x6f, 0xc4, 0xeb, 0xb4, 0x05, 0x0e, 0xf8, 0x5f, 0x00, 0xf1,
- 0xd0, 0x8e, 0x73, 0x76, 0x63, 0x11, 0xef, 0xc2, 0x85, 0x0b, 0xc3, 0x2a,
- 0xf6, 0x35, 0x88, 0xc3, 0xa9, 0x82, 0x0e, 0x5d, 0x65, 0xe0, 0x8e, 0x40,
- 0xd0, 0x7f, 0x75, 0x72, 0xb7, 0xb8, 0x5c, 0x11, 0x08, 0xfa, 0x67, 0x54,
- 0x54, 0x54, 0x38, 0x7e, 0x5f, 0x13, 0xa8, 0xf4, 0xdf, 0x27, 0xc2, 0x55,
- 0xed, 0x5c, 0x81, 0x3f, 0x81, 0x68, 0x46, 0x30, 0x58, 0xb1, 0x8d, 0x6e,
- 0x86, 0x15, 0xef, 0x00, 0x03, 0xc1, 0x8a, 0xd7, 0x11, 0xce, 0xa0, 0x1d,
- 0xb7, 0x79, 0xc5, 0x6a, 0xfd, 0xde, 0x48, 0xc1, 0x60, 0xd0, 0x0e, 0x04,
- 0xfc, 0x77, 0x6b, 0xe4, 0x74, 0xc3, 0x44, 0xaf, 0xa7, 0xdd, 0x01, 0x72,
- 0x51, 0x20, 0xe8, 0xbf, 0x2f, 0xc6, 0x3e, 0x7c, 0x7b, 0xf2, 0x99, 0x82,
- 0x2f, 0x50, 0xe9, 0xff, 0x47, 0x5c, 0x3c, 0xb0, 0x80, 0xff, 0xef, 0x0a,
- 0x67, 0x03, 0x5b, 0xda, 0x21, 0xee, 0xb9, 0x29, 0xa9, 0xee, 0xeb, 0x03,
- 0x81, 0x40, 0x0d, 0xdd, 0x10, 0x2b, 0x11, 0x81, 0x06, 0x02, 0xfe, 0xd5,
- 0x96, 0xca, 0x08, 0x22, 0xd3, 0xf2, 0xaa, 0x12, 0x9c, 0x06, 0x55, 0x8d,
- 0x7d, 0xf9, 0x5f, 0x30, 0xe8, 0x7f, 0x4e, 0x84, 0x13, 0x71, 0xb6, 0x78,
- 0x61, 0x6f, 0xd8, 0xc0, 0x73, 0x88, 0x1e, 0x1f, 0x08, 0x56, 0xc4, 0xbc,
- 0x0f, 0x74, 0xd8, 0xb6, 0x42, 0xed, 0xd0, 0x7a, 0x6d, 0x04, 0xc6, 0x5b,
- 0x2a, 0x47, 0x04, 0x83, 0xfe, 0x40, 0x3c, 0x03, 0x0e, 0x06, 0xfd, 0x6f,
- 0x5a, 0x2e, 0x39, 0x12, 0x78, 0x3c, 0x41, 0x15, 0x64, 0x25, 0xe8, 0xf7,
- 0x03, 0x41, 0xff, 0x8c, 0xb2, 0xb2, 0x32, 0xa5, 0x9b, 0x92, 0xf0, 0x4a,
- 0xde, 0xe7, 0x1b, 0x35, 0x58, 0x6d, 0xfb, 0x0e, 0x60, 0x3c, 0x6d, 0xd9,
- 0x23, 0xaa, 0x29, 0x5b, 0x81, 0xd9, 0x0a, 0xd3, 0x83, 0x41, 0xff, 0xb2,
- 0xb6, 0x04, 0xe4, 0xf1, 0x64, 0x8c, 0x14, 0xf4, 0x0f, 0x44, 0x5a, 0x8c,
- 0xb6, 0x8a, 0xf6, 0x25, 0x81, 0xbb, 0xfd, 0x41, 0xff, 0x7b, 0x6d, 0x09,
- 0xc8, 0x9b, 0xee, 0xcb, 0x46, 0xe2, 0xfe, 0x0e, 0xbd, 0x1a, 0x28, 0x07,
- 0xe6, 0x2b, 0xf6, 0x63, 0xc1, 0x60, 0x30, 0xe1, 0x3b, 0x79, 0x78, 0x3c,
- 0x19, 0x47, 0x0b, 0x7a, 0x0f, 0x91, 0x85, 0xf8, 0x6d, 0x6d, 0x2c, 0x16,
- 0x83, 0xde, 0x35, 0x78, 0xc8, 0xe0, 0x0a, 0xa7, 0x5b, 0xf4, 0xb6, 0x68,
- 0x73, 0x8f, 0x6f, 0x3b, 0xb1, 0xed, 0xf7, 0x6d, 0x37, 0x9c, 0xcf, 0x5b,
- 0xdb, 0x25, 0xc5, 0xbb, 0x93, 0x8c, 0x8c, 0x8c, 0xfe, 0xe1, 0xb0, 0x8e,
- 0x16, 0x18, 0x4b, 0xe4, 0x73, 0x60, 0x8c, 0xa2, 0xf8, 0x1c, 0x58, 0x09,
- 0xbc, 0x89, 0x48, 0x69, 0x8f, 0x1e, 0xa9, 0x4b, 0xe6, 0xce, 0x9d, 0x1b,
- 0xb7, 0xc1, 0x91, 0x71, 0xe3, 0xc6, 0x49, 0xed, 0xf6, 0xda, 0xe3, 0x10,
- 0xc6, 0x69, 0x24, 0x7e, 0xe9, 0xb4, 0x6e, 0xee, 0x72, 0x15, 0x30, 0x1f,
- 0xa5, 0x4c, 0x45, 0xca, 0x82, 0xc1, 0x8a, 0xb8, 0xbc, 0xaa, 0xc8, 0x48,
- 0xcf, 0xb0, 0x6c, 0xf4, 0x46, 0x84, 0x4b, 0x80, 0x43, 0x62, 0x28, 0xf8,
- 0x4a, 0x64, 0xc1, 0xc8, 0x7a, 0x22, 0xaf, 0xef, 0xd6, 0x03, 0x6b, 0x11,
- 0x09, 0x04, 0x02, 0x15, 0xaf, 0xd3, 0x41, 0x64, 0xa4, 0x67, 0x1c, 0xa2,
- 0xa2, 0x63, 0x15, 0x32, 0x89, 0x1c, 0x52, 0xd7, 0x9a, 0xe3, 0x68, 0xea,
- 0x80, 0x4a, 0x81, 0x32, 0x15, 0x2d, 0xab, 0xa9, 0xa9, 0x79, 0xef, 0xf5,
- 0xd7, 0x5f, 0x4f, 0x58, 0x4b, 0xeb, 0xf5, 0xf8, 0xae, 0x05, 0xae, 0x06,
- 0x0e, 0x22, 0xb2, 0xef, 0xf7, 0x00, 0x76, 0xdf, 0x70, 0x3e, 0xd4, 0x60,
- 0xdb, 0x4d, 0x0d, 0xe5, 0xf1, 0xf1, 0x40, 0xd0, 0x3f, 0xab, 0xcb, 0xb6,
- 0xbc, 0xd1, 0x18, 0x3e, 0x7c, 0xb8, 0xf4, 0xed, 0xbb, 0xcf, 0x30, 0x0b,
- 0x7b, 0x3f, 0x15, 0x86, 0x60, 0x33, 0x04, 0x61, 0x08, 0x8a, 0x85, 0x50,
- 0x0d, 0xb2, 0x0d, 0xa8, 0x46, 0xa9, 0x12, 0xf4, 0x73, 0x57, 0xaa, 0xeb,
- 0xe3, 0xf9, 0xf3, 0xe7, 0xb7, 0xeb, 0x7e, 0x44, 0xe9, 0x67, 0xa5, 0xf7,
- 0x10, 0xb7, 0xfb, 0x58, 0xd0, 0xa1, 0xc0, 0x10, 0x41, 0x87, 0x82, 0xf4,
- 0x03, 0x36, 0x28, 0xac, 0xb3, 0x60, 0x9d, 0x8a, 0xae, 0x1d, 0x3c, 0x78,
- 0xf0, 0xfb, 0x89, 0x68, 0x05, 0xba, 0x32, 0xc3, 0x87, 0x0f, 0xb7, 0xfa,
- 0xf6, 0x1d, 0x70, 0x1c, 0xe8, 0xbe, 0x8d, 0x6c, 0x3b, 0x10, 0xd8, 0xd2,
- 0xc8, 0xb6, 0xeb, 0x52, 0xac, 0x94, 0xff, 0x96, 0x55, 0x94, 0xd5, 0x76,
- 0x54, 0x3c, 0x2f, 0xbd, 0xf4, 0x52, 0x59, 0xbf, 0x7e, 0x7d, 0x3f, 0x94,
- 0x3e, 0x2e, 0xb7, 0xab, 0x6a, 0xd3, 0xa6, 0x4d, 0x55, 0x4b, 0x97, 0x2e,
- 0x35, 0x79, 0x6d, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18,
- 0x0c, 0x06, 0x83, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x83, 0xc1, 0x60,
- 0xe8, 0x68, 0x5c, 0xc6, 0x04, 0x86, 0xf6, 0x60, 0x42, 0x6e, 0xee, 0x61,
- 0xc3, 0x87, 0x8f, 0xb4, 0xdf, 0x7e, 0xeb, 0xf5, 0x5a, 0x63, 0x8d, 0xf8,
- 0x60, 0x19, 0x13, 0x18, 0xda, 0x03, 0xb1, 0x65, 0x55, 0x8a, 0xcb, 0xbe,
- 0xde, 0x58, 0x22, 0x7e, 0xb8, 0xbb, 0x42, 0x22, 0xc6, 0x8f, 0x1f, 0x6f,
- 0xb9, 0x5c, 0x69, 0x17, 0x21, 0x5c, 0x0b, 0x9c, 0x06, 0xf4, 0x03, 0x3e,
- 0x03, 0x3e, 0x02, 0xfe, 0x52, 0x52, 0x5c, 0xf8, 0x8a, 0xc9, 0x6a, 0x83,
- 0x69, 0x79, 0x93, 0x8c, 0x9c, 0x9c, 0x49, 0x3d, 0x5d, 0xee, 0xb4, 0x7f,
- 0x20, 0xbc, 0x48, 0xe4, 0xb0, 0xaf, 0x32, 0xe0, 0x7e, 0xe0, 0xdf, 0xc0,
- 0x11, 0xc0, 0xec, 0xac, 0xec, 0xbc, 0x97, 0x4c, 0x56, 0x77, 0x30, 0x2a,
- 0xc3, 0x6d, 0xdb, 0xfa, 0x9b, 0x31, 0x44, 0x1c, 0xbd, 0x99, 0xce, 0x9e,
- 0x80, 0xac, 0xec, 0xbc, 0x62, 0x22, 0xdb, 0xdb, 0x94, 0xd4, 0xd6, 0x6c,
- 0x9b, 0xf4, 0xf8, 0xe3, 0x8f, 0x87, 0x76, 0x09, 0x3b, 0xc7, 0x6d, 0xab,
- 0x35, 0x11, 0x78, 0x00, 0xb8, 0xaf, 0xa4, 0xb8, 0xf0, 0x0e, 0x93, 0xe5,
- 0x06, 0x23, 0xde, 0xe4, 0x10, 0xee, 0x91, 0xc0, 0xc7, 0xc0, 0xe2, 0x92,
- 0xe2, 0xc2, 0x91, 0x51, 0x7f, 0x93, 0x95, 0x65, 0x21, 0xee, 0x57, 0x81,
- 0x33, 0x4b, 0x8a, 0x0b, 0x07, 0x98, 0x2c, 0x37, 0x18, 0xb7, 0x39, 0x39,
- 0x6a, 0x9e, 0xb3, 0x00, 0x6c, 0x25, 0xab, 0xb9, 0xdf, 0x94, 0x94, 0x94,
- 0xd8, 0xc0, 0x54, 0xa0, 0x7f, 0x76, 0x76, 0xde, 0xe1, 0x26, 0xcb, 0x0d,
- 0x5d, 0x85, 0x4e, 0x3d, 0x60, 0xa5, 0x30, 0x1c, 0xa8, 0x7a, 0xa8, 0xa4,
- 0x70, 0x2f, 0x27, 0x16, 0xca, 0x47, 0xa0, 0x4f, 0x01, 0xfb, 0x01, 0xab,
- 0x9b, 0xb6, 0xe0, 0x13, 0x8f, 0x01, 0xbd, 0x1d, 0x38, 0xa1, 0xc1, 0x26,
- 0xef, 0xa1, 0x94, 0x94, 0x94, 0x14, 0xbe, 0x19, 0xa5, 0xb5, 0xbf, 0x0b,
- 0xe8, 0x59, 0x52, 0x5c, 0x78, 0x5b, 0x56, 0xf6, 0x44, 0x0f, 0xe8, 0x2d,
- 0xc0, 0x91, 0xc0, 0x1a, 0x84, 0xc7, 0x4a, 0x66, 0x14, 0x3e, 0x03, 0x30,
- 0x61, 0x42, 0x6e, 0x8a, 0x58, 0x92, 0x43, 0x64, 0x11, 0x7a, 0x1f, 0x60,
- 0x91, 0xcb, 0xd2, 0xdb, 0x8b, 0x8a, 0x8a, 0xa2, 0x9e, 0x42, 0x30, 0x7e,
- 0xe2, 0x44, 0xb1, 0x42, 0x7a, 0x83, 0xc0, 0x68, 0xe0, 0x64, 0xe0, 0x3d,
- 0x60, 0x41, 0x49, 0x71, 0x61, 0x51, 0xcc, 0x1e, 0x49, 0xce, 0xc4, 0x4b,
- 0x50, 0xbd, 0x08, 0xf8, 0x7e, 0x83, 0x67, 0xf2, 0xb6, 0x0a, 0x77, 0xcd,
- 0x9c, 0x51, 0xa8, 0x7b, 0xa4, 0xe5, 0x0f, 0xc0, 0xfe, 0x25, 0xc5, 0x85,
- 0xd7, 0x64, 0x65, 0xe5, 0x9e, 0x8c, 0xc8, 0x94, 0x06, 0x1b, 0x7c, 0x01,
- 0x1a, 0xb0, 0x2d, 0xfe, 0xf0, 0x50, 0x51, 0x51, 0xd4, 0x35, 0xd3, 0x13,
- 0xb2, 0x27, 0xa6, 0x0b, 0x3a, 0x19, 0x38, 0x0e, 0xd8, 0xa4, 0xf0, 0x12,
- 0x22, 0x0f, 0x12, 0x96, 0x11, 0x62, 0xd9, 0xbf, 0x50, 0xdb, 0xfa, 0xd5,
- 0xcc, 0x99, 0xd3, 0x6a, 0x1a, 0x3d, 0xeb, 0x2f, 0x28, 0xcf, 0x95, 0x94,
- 0x14, 0x96, 0xee, 0x8a, 0x67, 0xde, 0x9d, 0x28, 0x47, 0x94, 0x14, 0x17,
- 0x5e, 0x9b, 0x95, 0x93, 0x77, 0x22, 0xca, 0x6f, 0x80, 0x53, 0x88, 0x9c,
- 0xe3, 0xe4, 0x77, 0x59, 0x7a, 0x7f, 0x51, 0x51, 0x51, 0xd4, 0x2d, 0x8e,
- 0x72, 0x73, 0x73, 0x07, 0x84, 0x6d, 0xb9, 0x85, 0x48, 0x05, 0xde, 0x1b,
- 0xf8, 0x8f, 0x0a, 0x33, 0x67, 0xce, 0x28, 0x7c, 0xa7, 0xbb, 0x88, 0xb7,
- 0xb3, 0x0f, 0x58, 0x9d, 0x46, 0x2b, 0xf6, 0x8b, 0x2e, 0x29, 0x9e, 0xfe,
- 0x75, 0x49, 0x71, 0xe1, 0x35, 0xc5, 0xc5, 0x85, 0xaf, 0x37, 0x15, 0x63,
- 0xee, 0x15, 0xa0, 0xff, 0x25, 0xb2, 0x48, 0x7c, 0x45, 0x83, 0x68, 0x46,
- 0x21, 0x2c, 0x9a, 0x90, 0x9d, 0x97, 0x1d, 0x25, 0xb8, 0xf3, 0x80, 0xcb,
- 0xb2, 0xb2, 0xf3, 0x2e, 0x06, 0x9d, 0x43, 0x64, 0x77, 0x8a, 0xa5, 0xc0,
- 0x49, 0x28, 0x4f, 0x67, 0x65, 0xe7, 0xdd, 0x9c, 0x9d, 0x3d, 0xd1, 0x2d,
- 0x96, 0xcc, 0x02, 0x26, 0x03, 0xab, 0x80, 0xaf, 0x80, 0x1b, 0xc3, 0xb6,
- 0x7c, 0x38, 0x61, 0x42, 0x7e, 0xff, 0xa6, 0xae, 0xfd, 0x44, 0xb7, 0x2b,
- 0xa4, 0x4f, 0x0a, 0x3c, 0x42, 0x64, 0x93, 0x82, 0x52, 0x22, 0x87, 0xa3,
- 0x15, 0x66, 0x65, 0xe7, 0xc5, 0xb4, 0x9b, 0x63, 0x56, 0x76, 0xde, 0x3d,
- 0xa8, 0xbe, 0x00, 0x9c, 0xd4, 0x10, 0x4e, 0x0f, 0xe0, 0x4e, 0x51, 0x96,
- 0x5e, 0x77, 0xfd, 0x2f, 0xf6, 0x7c, 0xaf, 0x7f, 0x31, 0xf0, 0xf3, 0x09,
- 0xd9, 0x79, 0x23, 0x10, 0x59, 0x4a, 0x64, 0x17, 0x89, 0xca, 0x48, 0x1c,
- 0xe4, 0x1e, 0xcb, 0x96, 0xe7, 0x73, 0x73, 0x73, 0x25, 0xca, 0x33, 0x2e,
- 0x15, 0xb4, 0x02, 0xc8, 0x20, 0x32, 0xa2, 0xff, 0x5f, 0x81, 0x5c, 0x51,
- 0x0d, 0x88, 0xa5, 0x63, 0x81, 0x9f, 0x8b, 0xe8, 0x9e, 0x0d, 0xc3, 0xcf,
- 0x45, 0x38, 0x7e, 0x8f, 0x6b, 0xe7, 0x02, 0xd7, 0x64, 0x65, 0xe5, 0x7d,
- 0x1f, 0xe5, 0x0d, 0x60, 0x30, 0x91, 0x81, 0xc6, 0xfd, 0x80, 0xdf, 0x87,
- 0x6d, 0x79, 0x71, 0xfc, 0xc4, 0x89, 0x4d, 0xe6, 0x22, 0x64, 0x67, 0xe7,
- 0x9e, 0x14, 0xb6, 0xe5, 0xfd, 0x86, 0xb1, 0x8e, 0x0d, 0xc0, 0x07, 0xc0,
- 0x05, 0xa2, 0x2c, 0x9d, 0x90, 0x9d, 0x77, 0x85, 0x69, 0x79, 0x3b, 0x07,
- 0x87, 0x03, 0x6b, 0x9d, 0xde, 0x3c, 0x21, 0x3b, 0xef, 0x10, 0xe0, 0x6f,
- 0xc0, 0x12, 0xb7, 0x0b, 0x5f, 0x61, 0x61, 0x61, 0x6d, 0x64, 0xa0, 0x2b,
- 0xaf, 0xaf, 0xad, 0x2c, 0x16, 0xb8, 0x27, 0x37, 0x37, 0xf7, 0x89, 0xa2,
- 0xa2, 0xa2, 0x3d, 0xf7, 0xe1, 0x1a, 0x02, 0x14, 0x5b, 0x62, 0x1f, 0x3e,
- 0x63, 0xc6, 0x8c, 0x6f, 0x23, 0x2d, 0x6d, 0xce, 0xfe, 0x62, 0x59, 0x1f,
- 0x03, 0xf7, 0x80, 0xae, 0x02, 0x4e, 0xac, 0xaf, 0x73, 0x1d, 0xfe, 0xe8,
- 0xa3, 0x05, 0xdb, 0x1b, 0x04, 0x3a, 0x0e, 0xd1, 0x39, 0x62, 0x85, 0x67,
- 0x02, 0x57, 0xed, 0x5e, 0x85, 0xea, 0xaf, 0x51, 0x7e, 0x06, 0x72, 0x73,
- 0x49, 0xf1, 0xf4, 0x47, 0x22, 0x71, 0xc8, 0x11, 0x1b, 0x6b, 0x22, 0x4a,
- 0xc1, 0x84, 0x9c, 0xbc, 0xab, 0x66, 0xce, 0x28, 0xdc, 0xeb, 0x96, 0xb5,
- 0x59, 0x59, 0xb9, 0x63, 0x80, 0x3b, 0x80, 0xa9, 0x25, 0xc5, 0x85, 0xb7,
- 0x7c, 0x97, 0xce, 0xac, 0xbc, 0x8b, 0x45, 0x78, 0xa1, 0x77, 0xef, 0xbe,
- 0x7f, 0x04, 0xae, 0x8b, 0xd2, 0xfd, 0xf0, 0x23, 0x72, 0x56, 0xc9, 0x8c,
- 0xe9, 0x4b, 0x1a, 0x09, 0xb4, 0x3c, 0xe2, 0x35, 0xb8, 0x06, 0xd1, 0x74,
- 0x37, 0xd0, 0x27, 0x80, 0x1d, 0xb6, 0x25, 0xc7, 0x3c, 0x54, 0x34, 0xfd,
- 0x7f, 0x00, 0xf9, 0xf9, 0xf9, 0x29, 0xb5, 0x75, 0xe1, 0x72, 0xd0, 0xd8,
- 0xdf, 0xe5, 0x0a, 0x2f, 0xab, 0x70, 0xfe, 0xcc, 0x19, 0x85, 0xfe, 0x46,
- 0xcf, 0x9f, 0x0d, 0x5c, 0x60, 0xd5, 0x73, 0x74, 0x83, 0x38, 0x1b, 0x79,
- 0x5c, 0x32, 0x07, 0xb0, 0x55, 0xe5, 0xc4, 0x99, 0x25, 0xd3, 0xbf, 0x68,
- 0x68, 0x89, 0xfb, 0x84, 0x6d, 0xa9, 0x14, 0x78, 0x3a, 0x2b, 0x2b, 0xaf,
- 0xbc, 0xa4, 0xa4, 0x70, 0x9d, 0x69, 0x79, 0xbb, 0xf0, 0x80, 0x9b, 0x08,
- 0x67, 0x03, 0x8a, 0xca, 0x05, 0x3b, 0x85, 0x0b, 0x30, 0x63, 0x46, 0x61,
- 0x15, 0x2a, 0xd7, 0x02, 0x7d, 0xc3, 0xb6, 0x5c, 0x10, 0xe5, 0xd6, 0xde,
- 0x02, 0x97, 0xef, 0x14, 0x2e, 0xc0, 0xcc, 0x99, 0x33, 0xbe, 0x01, 0xfd,
- 0x35, 0x30, 0x40, 0xe1, 0x39, 0x4b, 0xb8, 0x60, 0xa7, 0x70, 0x01, 0xdc,
- 0x6e, 0x2d, 0x6d, 0x70, 0x07, 0x77, 0x3b, 0x31, 0xe1, 0xa6, 0x9b, 0xb3,
- 0xfa, 0xa2, 0xfc, 0x0e, 0x58, 0xb4, 0x53, 0xb8, 0x91, 0x38, 0xcc, 0x50,
- 0x6c, 0x2d, 0x02, 0xd6, 0x8a, 0xf2, 0xc8, 0xde, 0x85, 0x9b, 0x67, 0x21,
- 0xf2, 0x0a, 0xb0, 0xbe, 0xb1, 0x70, 0x01, 0x66, 0x96, 0x14, 0xfe, 0x13,
- 0x58, 0x04, 0x5c, 0x9b, 0x95, 0x9d, 0x17, 0x6d, 0x56, 0xdd, 0x84, 0xc6,
- 0xc2, 0x05, 0x08, 0xbb, 0xb8, 0x14, 0xb0, 0x43, 0xb6, 0xbd, 0xdb, 0x21,
- 0xe8, 0xd9, 0x39, 0xb9, 0x57, 0x37, 0xa4, 0x7f, 0xcc, 0x4e, 0xe1, 0x02,
- 0x14, 0x14, 0x14, 0xd4, 0x0f, 0x1a, 0xd8, 0xdf, 0x47, 0xeb, 0xb6, 0xb7,
- 0xd9, 0x23, 0x13, 0xe5, 0xf7, 0x8d, 0x85, 0x0b, 0xe0, 0xb2, 0xf4, 0x5a,
- 0xa0, 0x4e, 0x44, 0xb3, 0xf7, 0x68, 0xf5, 0x27, 0x03, 0x07, 0x81, 0x5e,
- 0xbc, 0x53, 0xb8, 0x00, 0x45, 0x45, 0x45, 0xd5, 0x02, 0x97, 0x47, 0x7a,
- 0x53, 0x72, 0x8d, 0x71, 0x9b, 0xbb, 0x38, 0xaa, 0xf2, 0x25, 0x68, 0x4e,
- 0x49, 0xc9, 0xf4, 0x0d, 0x4d, 0x85, 0xad, 0x5f, 0x37, 0xfc, 0x95, 0x1e,
- 0xe5, 0xd6, 0x4d, 0xc5, 0xc5, 0x85, 0x8b, 0xa2, 0x14, 0xc3, 0x7f, 0x35,
- 0xfc, 0xb1, 0x63, 0xc6, 0x8c, 0xc2, 0xdd, 0xb6, 0xbe, 0x2d, 0x2c, 0x2c,
- 0xb4, 0x89, 0xb8, 0xc5, 0xbd, 0x1a, 0x5f, 0x4f, 0x71, 0xb9, 0x7d, 0x80,
- 0x6d, 0x89, 0x7d, 0x49, 0xd3, 0xc1, 0xb6, 0xa2, 0x30, 0xca, 0x7d, 0x0d,
- 0xae, 0x6f, 0xcb, 0x02, 0xb0, 0xb4, 0x1f, 0x90, 0xaa, 0xc8, 0xc5, 0x51,
- 0x33, 0x5a, 0xec, 0x5f, 0x00, 0xa4, 0xb8, 0x5d, 0x3d, 0xa3, 0x18, 0xe2,
- 0x99, 0x3d, 0x2f, 0x3d, 0x5c, 0x58, 0xb8, 0x09, 0xa8, 0xdd, 0x39, 0x28,
- 0xd8, 0xc8, 0x66, 0x0f, 0x44, 0x5a, 0x3f, 0x6d, 0xb2, 0xe9, 0xdf, 0x94,
- 0x29, 0x53, 0xc2, 0xc0, 0x27, 0x0e, 0x72, 0xa2, 0xc9, 0x59, 0x57, 0x45,
- 0x45, 0x45, 0x1b, 0x1a, 0x5c, 0xe2, 0xef, 0xed, 0xf1, 0xd5, 0xf5, 0xc0,
- 0x1a, 0xb7, 0x4b, 0x9a, 0x8c, 0x73, 0x14, 0x17, 0x17, 0x7e, 0x02, 0x7c,
- 0x8e, 0xe8, 0x85, 0xdd, 0xa1, 0xfc, 0xba, 0xbb, 0x62, 0xa2, 0xb2, 0xb2,
- 0x26, 0x1e, 0x81, 0xe8, 0x83, 0x51, 0x46, 0xb8, 0x5e, 0x2b, 0x29, 0x29,
- 0x7c, 0xe2, 0xbb, 0x16, 0xa9, 0x78, 0xfa, 0x02, 0x60, 0x41, 0x33, 0xc2,
- 0xae, 0x8f, 0x9c, 0x71, 0xab, 0x07, 0x44, 0xf9, 0x3a, 0xd4, 0x4c, 0x13,
- 0x52, 0xdb, 0x70, 0xc4, 0xec, 0x9a, 0x66, 0xdc, 0x84, 0x8f, 0x14, 0xdc,
- 0xe3, 0xc7, 0x8f, 0x4f, 0x79, 0xf8, 0xe1, 0x87, 0xeb, 0x23, 0xcf, 0x61,
- 0x14, 0x42, 0xdd, 0x8c, 0x19, 0x33, 0xa2, 0xbb, 0x79, 0x2e, 0x16, 0x60,
- 0xe3, 0xca, 0xca, 0xca, 0xea, 0x55, 0x52, 0x52, 0xb2, 0xbd, 0xd9, 0xe2,
- 0x6f, 0x93, 0x81, 0xa0, 0x33, 0x8b, 0xa7, 0x47, 0x3d, 0x3a, 0x74, 0xc6,
- 0x8c, 0x19, 0x2b, 0xb3, 0xb2, 0xf3, 0xa8, 0xaf, 0x0f, 0x9f, 0x0e, 0xec,
- 0xb1, 0xd5, 0xab, 0xd5, 0xdc, 0x46, 0x7e, 0x61, 0x22, 0x13, 0x5f, 0x1a,
- 0xd3, 0x03, 0xd8, 0x56, 0x52, 0x5c, 0x54, 0xd3, 0xc2, 0x3d, 0xb1, 0xd2,
- 0xdc, 0x7c, 0xe7, 0x1a, 0xe0, 0xe8, 0x3d, 0xae, 0xed, 0x03, 0x04, 0x0b,
- 0x0b, 0x0b, 0x9b, 0x7b, 0xce, 0x16, 0xe0, 0x94, 0x29, 0x53, 0xa6, 0xc8,
- 0x94, 0x29, 0x53, 0xd4, 0x88, 0xb7, 0xf3, 0x39, 0xd3, 0xee, 0x86, 0xc1,
- 0x8f, 0xc6, 0x05, 0x6e, 0x04, 0xc2, 0x57, 0xcd, 0xdd, 0x32, 0x7e, 0xfc,
- 0xc4, 0xfe, 0x6e, 0xb7, 0x1e, 0x09, 0x1c, 0xaa, 0xaa, 0x16, 0xd8, 0x7d,
- 0x63, 0xf5, 0xca, 0x55, 0xa9, 0x6f, 0xb8, 0x23, 0xea, 0x89, 0x84, 0x8a,
- 0x7c, 0x0e, 0x2a, 0xae, 0xd4, 0xd4, 0xc3, 0x88, 0x8c, 0x02, 0x43, 0xc4,
- 0x75, 0x77, 0x65, 0x65, 0xe7, 0xfd, 0x29, 0x6a, 0xa0, 0x36, 0xbd, 0x01,
- 0x5c, 0x2e, 0xd7, 0x11, 0x0d, 0x03, 0x6a, 0xcd, 0xf9, 0x50, 0x19, 0x28,
- 0x34, 0x1b, 0xce, 0x2e, 0xdb, 0x1c, 0xd7, 0x54, 0xbc, 0xcd, 0x62, 0x03,
- 0x7d, 0x26, 0x4c, 0x98, 0x68, 0xcd, 0x9c, 0x39, 0x7d, 0xa7, 0xc0, 0x53,
- 0x1a, 0x06, 0xf5, 0xda, 0x83, 0x7a, 0x60, 0xc0, 0x0d, 0x37, 0xdc, 0x6a,
- 0x3d, 0xfe, 0xf8, 0x03, 0x3b, 0x9f, 0x3f, 0x00, 0x38, 0xaa, 0x85, 0x74,
- 0x1e, 0x0c, 0xf4, 0xde, 0xbc, 0x79, 0x73, 0x1a, 0xc9, 0x77, 0x2e, 0xb3,
- 0x11, 0xef, 0xde, 0x28, 0x29, 0x9e, 0xfe, 0x11, 0xe0, 0xf9, 0xae, 0x25,
- 0xce, 0xc9, 0x1b, 0x86, 0x46, 0x77, 0xe7, 0xb2, 0xb2, 0x73, 0x0f, 0x01,
- 0xb9, 0x1f, 0xf4, 0x8a, 0x86, 0x6a, 0x7a, 0x2b, 0x22, 0xea, 0xa4, 0x3f,
- 0x2d, 0x2a, 0xb4, 0x74, 0x22, 0xbd, 0xda, 0x12, 0x12, 0x4b, 0x71, 0xed,
- 0xbe, 0x7f, 0x75, 0x9f, 0x86, 0xee, 0xcb, 0xb1, 0x2d, 0x04, 0xbd, 0x08,
- 0xd8, 0xb1, 0x97, 0x2e, 0x40, 0x1f, 0x89, 0xc4, 0x79, 0x2f, 0xe1, 0xe8,
- 0x9a, 0x58, 0xd3, 0x65, 0xdb, 0xae, 0xdd, 0x7d, 0x01, 0xd5, 0x76, 0x3d,
- 0x2e, 0xb5, 0xae, 0xae, 0xe7, 0xee, 0xcf, 0x8f, 0xb4, 0xbe, 0xcd, 0xa5,
- 0xf3, 0x23, 0xe0, 0x23, 0xdb, 0x76, 0xd9, 0x74, 0x71, 0x3a, 0xbb, 0x78,
- 0xab, 0x89, 0x6d, 0x93, 0xec, 0x3d, 0x84, 0x3b, 0x71, 0x10, 0xe8, 0xf2,
- 0x06, 0xf1, 0xfc, 0x42, 0x08, 0xbf, 0x54, 0x5c, 0x5c, 0xbc, 0xb1, 0xc1,
- 0xf5, 0x1e, 0x8c, 0x68, 0x7b, 0x8d, 0x58, 0x56, 0x97, 0x14, 0x17, 0x9e,
- 0x15, 0x87, 0x70, 0xec, 0x38, 0x85, 0x93, 0xdc, 0x63, 0x15, 0xa2, 0x8f,
- 0xcd, 0x9c, 0x51, 0x74, 0x3f, 0xdd, 0x9c, 0xce, 0x2e, 0xde, 0x2f, 0x88,
- 0x4c, 0x68, 0x70, 0x5a, 0x0c, 0xee, 0x07, 0xfa, 0xa0, 0xe2, 0x2d, 0x29,
- 0x99, 0xbe, 0xa8, 0x83, 0xd2, 0xf0, 0x29, 0x91, 0xf7, 0x9a, 0x6d, 0xc2,
- 0x82, 0x8f, 0xb5, 0x7d, 0xa6, 0xbb, 0x86, 0x11, 0xd9, 0xbf, 0x03, 0xf3,
- 0x7c, 0x87, 0x68, 0x87, 0x3e, 0x3f, 0x69, 0xe8, 0xec, 0xa3, 0xcd, 0x7e,
- 0x60, 0xc0, 0x84, 0x09, 0xb9, 0x43, 0x62, 0xbd, 0xf1, 0x86, 0x1b, 0x6e,
- 0x10, 0x22, 0xb3, 0x9f, 0x3e, 0xeb, 0x40, 0xe1, 0x02, 0x32, 0x9f, 0x38,
- 0x1c, 0x03, 0x23, 0x22, 0xaf, 0x01, 0x72, 0xf3, 0xcd, 0x37, 0xf7, 0x4c,
- 0x70, 0x84, 0xeb, 0x81, 0xff, 0xeb, 0xc0, 0x3c, 0xdf, 0x08, 0xfa, 0x3d,
- 0x23, 0xdd, 0x4e, 0x2e, 0x5e, 0x55, 0x9d, 0x03, 0x88, 0x58, 0xf2, 0xf0,
- 0x5e, 0xfa, 0x83, 0x4d, 0x5a, 0xa4, 0xb4, 0xbe, 0x7d, 0xdd, 0x0d, 0x83,
- 0x1f, 0xcd, 0x1d, 0x0d, 0x79, 0x50, 0xbb, 0xa4, 0xc1, 0xb6, 0xe7, 0x02,
- 0x29, 0x59, 0xd9, 0x79, 0xbf, 0x68, 0x93, 0xbf, 0xac, 0xfa, 0x2e, 0x80,
- 0xe5, 0x4a, 0x7d, 0x2c, 0xc1, 0x51, 0xfe, 0x16, 0xe8, 0x91, 0x95, 0x95,
- 0xd7, 0xdc, 0xfb, 0xdc, 0xbe, 0x89, 0xf7, 0xb6, 0xe4, 0xcc, 0xac, 0xac,
- 0xbc, 0xc1, 0x46, 0xbc, 0x9d, 0x98, 0x1e, 0x69, 0xee, 0x65, 0x40, 0x05,
- 0x70, 0xc1, 0x84, 0xec, 0xbc, 0x0b, 0xa2, 0xb7, 0xb0, 0xb7, 0x5a, 0x82,
- 0xde, 0x04, 0x20, 0xe8, 0xdb, 0x3b, 0xaf, 0x97, 0x4c, 0x9b, 0x56, 0x4f,
- 0xe4, 0xec, 0xa3, 0x83, 0xae, 0xb9, 0x66, 0xca, 0x6e, 0x23, 0x32, 0x39,
- 0x39, 0x13, 0x07, 0x22, 0xfa, 0x42, 0xa4, 0x49, 0xdb, 0xfb, 0x3b, 0xd6,
- 0x36, 0x89, 0xd7, 0x65, 0x7d, 0xd8, 0xe0, 0xfe, 0x4f, 0xcf, 0xc9, 0xc9,
- 0xe9, 0xbd, 0xe7, 0xf7, 0x39, 0x39, 0xb9, 0x43, 0xb3, 0x9b, 0x49, 0x5b,
- 0x63, 0x4a, 0x8a, 0x0b, 0x43, 0x0d, 0xb6, 0xf8, 0x59, 0x76, 0xf6, 0xa4,
- 0x26, 0x6e, 0x65, 0x7e, 0x7e, 0x7e, 0x4a, 0x56, 0xf6, 0xc4, 0xfc, 0x36,
- 0xb7, 0xf0, 0xe8, 0x15, 0x80, 0x22, 0xe4, 0xe6, 0xe7, 0xe7, 0xef, 0x56,
- 0x29, 0x66, 0x67, 0xe7, 0x9d, 0x45, 0x64, 0x0d, 0x75, 0xc2, 0xb0, 0xe1,
- 0x5a, 0x20, 0x84, 0x70, 0xdb, 0x0d, 0x37, 0xdc, 0x6a, 0x35, 0x1d, 0xc7,
- 0xc8, 0xfb, 0x59, 0x76, 0xf6, 0xc4, 0x81, 0xa6, 0xcf, 0x9b, 0xe4, 0x14,
- 0x14, 0x14, 0xd8, 0x59, 0x59, 0xb9, 0x57, 0x22, 0xb2, 0x40, 0xe0, 0xa5,
- 0xac, 0xec, 0xbc, 0x3f, 0x82, 0xcc, 0x42, 0x59, 0x01, 0xea, 0xc6, 0xe2,
- 0x04, 0xb4, 0x6e, 0x02, 0x91, 0x59, 0x4d, 0x7f, 0x2e, 0x2e, 0x2e, 0xda,
- 0x73, 0x31, 0xf8, 0x6d, 0xc0, 0xbf, 0xfa, 0xf6, 0xdb, 0x32, 0x77, 0x42,
- 0x4e, 0xde, 0x9d, 0x62, 0xb3, 0x5d, 0x84, 0x33, 0x6d, 0xd5, 0x3b, 0x14,
- 0x9e, 0x12, 0xf8, 0x0d, 0x4a, 0x42, 0x0b, 0xc2, 0x43, 0x33, 0xa6, 0x87,
- 0x26, 0xe4, 0xe4, 0x8e, 0x11, 0x95, 0x15, 0xb6, 0x5a, 0x1f, 0x67, 0xe5,
- 0xe4, 0xde, 0xe8, 0x12, 0x96, 0x84, 0x6c, 0x39, 0x58, 0xe0, 0x0c, 0x5b,
- 0x99, 0x0e, 0x7c, 0x0d, 0xcc, 0xde, 0x5b, 0x58, 0x29, 0x6e, 0xeb, 0xbc,
- 0xfa, 0x90, 0xbd, 0x56, 0xb1, 0x57, 0x67, 0x67, 0xe7, 0x5d, 0xad, 0xca,
- 0x22, 0xb5, 0xa4, 0xbf, 0xa0, 0xa7, 0xd5, 0xd6, 0x85, 0x1f, 0x00, 0x06,
- 0x4c, 0xc8, 0xc9, 0x9b, 0x3e, 0x73, 0x46, 0xa1, 0xe3, 0x91, 0xd8, 0xe2,
- 0xe2, 0xa2, 0x65, 0x59, 0xd9, 0x79, 0x2b, 0x80, 0xdf, 0xd7, 0xd6, 0x85,
- 0x7b, 0x66, 0x67, 0xe7, 0xbe, 0x0a, 0xb2, 0x45, 0x61, 0x9c, 0xc2, 0xbd,
- 0x44, 0xa6, 0x52, 0xee, 0x97, 0x30, 0x7b, 0x15, 0x17, 0x7e, 0xd2, 0xf0,
- 0x9a, 0x68, 0x52, 0x5a, 0xcf, 0xba, 0xfe, 0xd9, 0xd9, 0x79, 0x7f, 0xb2,
- 0x2d, 0xfd, 0x4c, 0xc2, 0x72, 0x0a, 0xc2, 0x45, 0xc0, 0x0d, 0x36, 0xf6,
- 0xb9, 0xc0, 0x3c, 0xd3, 0xf2, 0x26, 0x39, 0x25, 0x25, 0x45, 0x6b, 0x11,
- 0x19, 0x01, 0x3c, 0x04, 0x5c, 0x0d, 0x5a, 0x8e, 0xe8, 0x1a, 0x84, 0xaf,
- 0x50, 0x4a, 0x81, 0xa3, 0x80, 0xeb, 0x4a, 0x8a, 0x0b, 0x9b, 0xb8, 0xa5,
- 0x76, 0x58, 0x5e, 0x03, 0x0a, 0x80, 0xd1, 0xa2, 0x2c, 0x41, 0x78, 0x57,
- 0xe1, 0x41, 0x85, 0x3f, 0x84, 0xea, 0xec, 0x29, 0x44, 0x26, 0x63, 0xf4,
- 0x4f, 0x74, 0x1a, 0x66, 0xce, 0x28, 0x5a, 0xa9, 0xa2, 0x47, 0x03, 0x55,
- 0xa8, 0xcc, 0x0e, 0xdb, 0xb2, 0x56, 0x22, 0x8b, 0x1d, 0x1e, 0x06, 0x5e,
- 0x45, 0x43, 0xad, 0x1a, 0x94, 0x9b, 0x3e, 0x7d, 0x5a, 0x4d, 0x7d, 0x9d,
- 0xeb, 0x00, 0xe0, 0x6d, 0x85, 0xe7, 0x10, 0xbe, 0x12, 0xd5, 0xf7, 0x51,
- 0x9e, 0x02, 0x3e, 0x42, 0x65, 0x58, 0x5b, 0x84, 0xbb, 0xcb, 0x5d, 0x08,
- 0x9d, 0x0a, 0xcc, 0x05, 0x6e, 0x57, 0x64, 0xb1, 0xc2, 0xfb, 0x44, 0x2a,
- 0xba, 0x4b, 0x1a, 0x2a, 0x9a, 0xc4, 0xe6, 0x79, 0x71, 0xe1, 0xcd, 0xc0,
- 0xcd, 0x28, 0x57, 0x2a, 0x2c, 0x11, 0x5b, 0xd6, 0x20, 0xcc, 0x23, 0x32,
- 0x3d, 0x32, 0xc7, 0x0e, 0xd5, 0x95, 0x99, 0x96, 0xb7, 0xb3, 0x08, 0x78,
- 0xc6, 0xf4, 0x2d, 0x40, 0x76, 0x56, 0xd6, 0xc4, 0xc9, 0x58, 0x7a, 0x86,
- 0x28, 0xfb, 0x02, 0x55, 0xaa, 0xfa, 0x79, 0x49, 0x49, 0xd1, 0x87, 0xcd,
- 0xd6, 0xe2, 0x0f, 0x4d, 0x0f, 0x01, 0x93, 0xb3, 0xb3, 0x73, 0x66, 0x28,
- 0xd6, 0xff, 0x09, 0xd4, 0x86, 0x42, 0xee, 0xc5, 0x0f, 0x3f, 0x3c, 0x75,
- 0x47, 0xc4, 0x0d, 0xcc, 0x1e, 0x24, 0xe2, 0xda, 0x43, 0xf0, 0x2e, 0x5f,
- 0x4a, 0x4a, 0xa8, 0x99, 0x4a, 0xaf, 0x7e, 0xb3, 0xcb, 0x72, 0xed, 0x23,
- 0x22, 0x51, 0x67, 0x60, 0xd5, 0xd6, 0x6e, 0x5d, 0xde, 0xbb, 0x77, 0xef,
- 0x7d, 0x06, 0x0c, 0x18, 0x50, 0x15, 0x45, 0xc0, 0xab, 0x81, 0x63, 0x26,
- 0x4c, 0xc8, 0x3b, 0x08, 0x8b, 0xd3, 0x44, 0x74, 0xbb, 0xa8, 0xbd, 0xac,
- 0xb8, 0xb8, 0x38, 0xa6, 0xd7, 0x55, 0x8f, 0x3e, 0x5a, 0x50, 0x0d, 0x9c,
- 0x95, 0x9b, 0x9b, 0x3b, 0x24, 0x6c, 0x5b, 0xa7, 0x03, 0x58, 0x12, 0x7e,
- 0x7f, 0xc6, 0x8c, 0x19, 0x9f, 0x47, 0x11, 0xe1, 0xe9, 0x2e, 0x97, 0xcb,
- 0x2a, 0x2a, 0x2a, 0x8c, 0x1a, 0x5f, 0x97, 0xa5, 0x87, 0x00, 0x52, 0xf2,
- 0xf0, 0x54, 0x7b, 0xf7, 0x0a, 0xb3, 0x24, 0x0c, 0xfc, 0x70, 0xc2, 0x84,
- 0xbc, 0xfd, 0xc4, 0x92, 0x11, 0x02, 0xd5, 0xd5, 0xd5, 0xd5, 0x95, 0x7f,
- 0xf9, 0xcb, 0xe3, 0xa1, 0xac, 0xec, 0xbc, 0x22, 0x00, 0x15, 0x3b, 0xbc,
- 0x47, 0x58, 0x83, 0x5c, 0x2e, 0xd7, 0x8e, 0xdd, 0x5b, 0x0e, 0x7b, 0x94,
- 0x58, 0xe2, 0x76, 0xbb, 0xdd, 0x51, 0x0f, 0x47, 0xb7, 0x84, 0xd3, 0x45,
- 0xd4, 0x7a, 0xf2, 0xc9, 0x29, 0x76, 0x14, 0x01, 0x3f, 0x7c, 0xcd, 0x35,
- 0x53, 0x1e, 0xeb, 0xd3, 0x6f, 0xcb, 0xff, 0x89, 0xc8, 0x11, 0xa2, 0xf6,
- 0x37, 0x21, 0x97, 0xbc, 0xf5, 0x70, 0x61, 0x61, 0x7d, 0x77, 0xe9, 0xf3,
- 0x0a, 0x06, 0x43, 0x1c, 0xc9, 0xca, 0xce, 0xfb, 0x1f, 0x30, 0x30, 0x54,
- 0x9f, 0xd6, 0xf3, 0x91, 0x47, 0xee, 0x37, 0xc7, 0x61, 0x1a, 0xb7, 0xd9,
- 0xd0, 0x19, 0xb8, 0xe9, 0xa6, 0xdb, 0x7a, 0x10, 0x99, 0xfd, 0xe4, 0x37,
- 0xc2, 0x35, 0xe2, 0x35, 0x24, 0x21, 0x37, 0xe7, 0xe5, 0x0d, 0xce, 0xc9,
- 0xc9, 0xdd, 0x6d, 0x20, 0x6f, 0xca, 0x94, 0x29, 0xe2, 0x4e, 0xa9, 0x7d,
- 0x0e, 0xe8, 0x21, 0xc2, 0x4d, 0xc6, 0x4a, 0xa6, 0xcf, 0x6b, 0x48, 0xc6,
- 0x1a, 0xdf, 0xe6, 0x5e, 0x5b, 0xe5, 0xfa, 0xac, 0xec, 0xbc, 0xb9, 0x44,
- 0x16, 0x58, 0xf4, 0xdd, 0xb0, 0x71, 0x4b, 0x3a, 0x70, 0x14, 0x22, 0xc5,
- 0xa1, 0xfa, 0x9a, 0x2f, 0x8c, 0x95, 0x8c, 0x78, 0x0d, 0x49, 0x88, 0x86,
- 0xf5, 0x5e, 0xb1, 0x64, 0x0d, 0x30, 0x8e, 0xc8, 0x7a, 0xdf, 0xed, 0xc0,
- 0xbb, 0x82, 0xe4, 0x17, 0xcf, 0x98, 0x3e, 0xdb, 0x58, 0xa8, 0x7d, 0xf8,
- 0x7f, 0x49, 0xf1, 0x1a, 0x6f, 0x4b, 0xd5, 0x18, 0xc6, 0x00, 0x00, 0x00,
- 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
-};
-
-static const unsigned char app_icon_png[] = {
- 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
- 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40,
- 0x08, 0x06, 0x00, 0x00, 0x00, 0xaa, 0x69, 0x71, 0xde, 0x00, 0x00, 0x00,
- 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64,
- 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00,
- 0xdd, 0x00, 0x00, 0x00, 0xdd, 0x01, 0x70, 0x53, 0xa2, 0x07, 0x00, 0x00,
- 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61,
- 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63,
- 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00,
- 0x00, 0x0b, 0xe0, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0xed, 0x9b, 0x7b,
- 0x74, 0xd4, 0xd7, 0x71, 0xc7, 0x3f, 0x77, 0x57, 0x2b, 0xed, 0x4a, 0xbb,
- 0x7a, 0x20, 0xb4, 0x12, 0x12, 0x7e, 0x80, 0x1e, 0x08, 0xb0, 0x31, 0x36,
- 0x9c, 0x02, 0xb5, 0x63, 0xd0, 0x0a, 0x24, 0x70, 0x93, 0xda, 0x24, 0x81,
- 0xf8, 0x1c, 0xc7, 0x39, 0xf5, 0x49, 0x6d, 0x62, 0x37, 0x07, 0x6c, 0x04,
- 0xd8, 0x75, 0x82, 0xab, 0xc4, 0x75, 0x4a, 0x8c, 0x54, 0x3b, 0xad, 0xc3,
- 0x69, 0x4c, 0xeb, 0xe4, 0x70, 0xda, 0xb4, 0x91, 0x0d, 0x7e, 0x61, 0x1e,
- 0x32, 0x48, 0x22, 0xad, 0xeb, 0x1a, 0x0c, 0x18, 0x4c, 0x8c, 0x41, 0x36,
- 0xa0, 0x37, 0x7a, 0x3f, 0x56, 0x48, 0x2b, 0x69, 0xf7, 0x37, 0xfd, 0x43,
- 0x42, 0x68, 0xd9, 0xdf, 0xae, 0x56, 0xab, 0x45, 0xd4, 0x29, 0xdf, 0x73,
- 0xf4, 0x87, 0xee, 0xcc, 0x6f, 0xee, 0xcc, 0xec, 0xbd, 0x73, 0xef, 0xcc,
- 0x6f, 0x7e, 0x70, 0x03, 0x37, 0xf0, 0xff, 0x1a, 0xea, 0x5a, 0x09, 0x5e,
- 0x55, 0x52, 0x62, 0xec, 0xac, 0x9e, 0x3c, 0xd7, 0x20, 0xea, 0x1b, 0xa2,
- 0xf8, 0xba, 0xc0, 0x4b, 0xa5, 0x1b, 0x72, 0xfe, 0x2d, 0x98, 0x67, 0xf3,
- 0x8b, 0x2a, 0x1e, 0x56, 0x50, 0xa8, 0x29, 0x76, 0x2b, 0x4d, 0xde, 0x8d,
- 0xbd, 0xd4, 0xfc, 0xfb, 0xd7, 0x0b, 0x57, 0xf7, 0x5f, 0x0b, 0x3d, 0xc3,
- 0xee, 0x80, 0xbc, 0xa2, 0xb2, 0x79, 0x88, 0x7a, 0x54, 0x29, 0xbe, 0x03,
- 0xc4, 0x8f, 0x20, 0x7d, 0xd1, 0x62, 0xb3, 0xcd, 0x3a, 0xba, 0x66, 0xfe,
- 0x40, 0xa0, 0xe7, 0xe7, 0xfd, 0xea, 0x63, 0xd3, 0x64, 0xa7, 0xf3, 0x34,
- 0x90, 0x3e, 0x62, 0xb8, 0x43, 0x84, 0xdf, 0xa1, 0x64, 0x7b, 0xe9, 0x06,
- 0xc7, 0xd1, 0x70, 0xea, 0x1b, 0x36, 0x07, 0xe4, 0x6d, 0x2d, 0x5b, 0x60,
- 0x50, 0x86, 0x9f, 0x09, 0xe2, 0xf0, 0xcb, 0x24, 0xea, 0xb1, 0xfd, 0x1b,
- 0x97, 0x6c, 0x0f, 0x24, 0x67, 0x79, 0x71, 0xf9, 0x1a, 0x11, 0xfe, 0xc9,
- 0x1f, 0x5d, 0xa1, 0xca, 0x34, 0xd1, 0x9e, 0x2d, 0xdd, 0xe8, 0xf8, 0x68,
- 0x1c, 0xea, 0x0e, 0xc3, 0x10, 0x0e, 0x21, 0x83, 0x50, 0x8f, 0x04, 0x34,
- 0x1e, 0x40, 0xc9, 0x5f, 0xaf, 0x2a, 0x29, 0x31, 0xfa, 0x23, 0xaf, 0x2a,
- 0x29, 0x31, 0x8a, 0xb0, 0x31, 0x90, 0x08, 0x41, 0x1c, 0x4a, 0xa9, 0xbf,
- 0x08, 0x4d, 0x47, 0x5f, 0x84, 0xcd, 0x01, 0x4a, 0xd1, 0x1d, 0x04, 0xdb,
- 0xb4, 0xae, 0x9a, 0xc9, 0x0f, 0xf8, 0x23, 0x3a, 0x6b, 0xec, 0xdf, 0xc4,
- 0x7b, 0xe9, 0xeb, 0xcf, 0x25, 0x41, 0xcd, 0x15, 0x14, 0x22, 0xc2, 0x25,
- 0x48, 0x09, 0xdd, 0x12, 0xcc, 0x86, 0x12, 0x55, 0x90, 0x57, 0x7c, 0xe8,
- 0xb0, 0x28, 0x2d, 0xd9, 0x28, 0x62, 0x07, 0xf0, 0x28, 0xd5, 0xa4, 0xc4,
- 0xd0, 0xa8, 0x89, 0xb6, 0x3e, 0xc8, 0x3d, 0x79, 0x69, 0x1c, 0xaa, 0x7a,
- 0x21, 0x6c, 0x0e, 0xd0, 0x94, 0xea, 0x54, 0x48, 0x30, 0xac, 0x8b, 0x94,
- 0x68, 0xd5, 0x4a, 0x40, 0x86, 0x42, 0x90, 0x41, 0x00, 0xb4, 0xa0, 0xe7,
- 0x12, 0xe8, 0x08, 0x45, 0x47, 0x3d, 0x84, 0x2f, 0x06, 0x88, 0x34, 0x84,
- 0x4d, 0xd6, 0xe8, 0x93, 0xd5, 0x87, 0x4b, 0x52, 0xd8, 0x1c, 0x60, 0x34,
- 0x4e, 0x9c, 0x03, 0x44, 0xc9, 0xc5, 0x70, 0xc9, 0x0a, 0x9b, 0x03, 0x3c,
- 0x9a, 0x4a, 0x08, 0x97, 0xac, 0xd1, 0x61, 0x98, 0x14, 0x36, 0x49, 0x01,
- 0xa9, 0x22, 0x2a, 0xaf, 0xa8, 0x3c, 0x3b, 0x10, 0xcb, 0x92, 0xc2, 0x72,
- 0x73, 0x5e, 0x71, 0xc5, 0x2f, 0x14, 0xb2, 0x33, 0x5c, 0x4a, 0x8d, 0x06,
- 0x85, 0xec, 0xcc, 0x2f, 0x2a, 0x7f, 0x79, 0x49, 0x61, 0xb9, 0x39, 0x10,
- 0x5f, 0x5e, 0x51, 0x79, 0x36, 0x12, 0x38, 0x34, 0x07, 0x24, 0xe6, 0x15,
- 0x97, 0xff, 0x8d, 0x12, 0x79, 0x0e, 0xd4, 0x6b, 0xee, 0x08, 0xcf, 0x8f,
- 0x0f, 0x3e, 0xb9, 0xb4, 0x71, 0x24, 0x7d, 0xd9, 0x8b, 0x87, 0x32, 0x0d,
- 0x06, 0x79, 0x03, 0x64, 0x4e, 0xf0, 0xea, 0x87, 0x13, 0xea, 0xa4, 0xa6,
- 0xa9, 0x6f, 0xbf, 0xbf, 0x69, 0x71, 0xe5, 0xc8, 0xd1, 0xdc, 0x97, 0x0f,
- 0x24, 0x1b, 0x3d, 0xc6, 0x17, 0x94, 0xc8, 0x23, 0xa2, 0xd4, 0x4f, 0x4b,
- 0x0b, 0x72, 0x7e, 0xe2, 0x57, 0x82, 0x3f, 0x42, 0xfe, 0xd6, 0xb2, 0xfb,
- 0x51, 0xec, 0x02, 0x75, 0x79, 0x95, 0x74, 0x0a, 0xb2, 0xa9, 0xb4, 0x20,
- 0x67, 0x3b, 0x4a, 0x49, 0xfe, 0xd6, 0xf2, 0xa5, 0x28, 0x4a, 0x80, 0x09,
- 0x5c, 0xfa, 0xba, 0x68, 0x57, 0x4a, 0x56, 0xed, 0x2b, 0x70, 0x1c, 0x44,
- 0x44, 0x2d, 0xff, 0xfb, 0x8a, 0xc7, 0x44, 0xd4, 0x8b, 0x20, 0xb1, 0x83,
- 0x64, 0xd1, 0x94, 0x62, 0xe5, 0xbe, 0x02, 0xc7, 0x3b, 0x7a, 0x0f, 0xeb,
- 0x3a, 0x60, 0x45, 0xd1, 0x81, 0x59, 0x1a, 0xc6, 0xff, 0x01, 0x6c, 0x3a,
- 0xe4, 0x83, 0xa2, 0xd4, 0x4e, 0x25, 0xf2, 0x12, 0x10, 0x15, 0x26, 0x23,
- 0xc6, 0x8b, 0x3e, 0x51, 0xea, 0x29, 0x25, 0xf2, 0x2d, 0x20, 0xd7, 0x97,
- 0xac, 0xba, 0x3c, 0x46, 0xb5, 0xf0, 0xc0, 0x53, 0x8b, 0x4f, 0xfb, 0x50,
- 0xae, 0x1e, 0x58, 0x55, 0x58, 0x12, 0xd9, 0x65, 0x4d, 0x3a, 0x0a, 0xdc,
- 0x76, 0x2d, 0x34, 0xbd, 0x7e, 0x50, 0x27, 0x5b, 0x6c, 0xd6, 0xf9, 0x57,
- 0x27, 0x63, 0x3e, 0x41, 0xb0, 0xcb, 0x66, 0x7f, 0x9a, 0x3f, 0x3a, 0xe3,
- 0x01, 0x64, 0x4e, 0x62, 0xb7, 0x73, 0xd3, 0xd5, 0xa3, 0x5e, 0x2b, 0xe0,
- 0xbe, 0xe2, 0x03, 0x59, 0x1e, 0x31, 0x9e, 0x00, 0x02, 0x46, 0xd7, 0xaf,
- 0x30, 0xfa, 0x0c, 0x78, 0xee, 0xda, 0xbb, 0x61, 0xe9, 0x67, 0x97, 0x07,
- 0xbc, 0x56, 0x80, 0x47, 0x22, 0xb6, 0xf3, 0xc7, 0x6b, 0x3c, 0x40, 0x94,
- 0x47, 0x8c, 0xdb, 0x46, 0x0e, 0x5c, 0xb5, 0x05, 0xe4, 0xec, 0x44, 0x6a,
- 0x73, 0x3d, 0xa0, 0x0c, 0xde, 0x36, 0x7a, 0x3b, 0xc0, 0xd0, 0xf7, 0x34,
- 0x42, 0xf3, 0x84, 0x6a, 0x34, 0xb1, 0x68, 0x8d, 0x14, 0xf5, 0xec, 0xc8,
- 0x01, 0x2f, 0x07, 0xec, 0x5f, 0xbf, 0xbc, 0x4d, 0x54, 0xe0, 0x82, 0xc4,
- 0x57, 0x1a, 0x4a, 0xd6, 0xbf, 0xbb, 0x21, 0xa7, 0xc5, 0x6b, 0x48, 0x8f,
- 0x2f, 0x7f, 0x6b, 0xf9, 0x1b, 0x28, 0xbe, 0x35, 0x31, 0x5a, 0x4d, 0x10,
- 0x14, 0x6f, 0xef, 0x2f, 0xc8, 0xf1, 0x29, 0xc6, 0xe8, 0xe6, 0x02, 0x86,
- 0x28, 0xe3, 0xe3, 0x40, 0xd8, 0x32, 0xae, 0xeb, 0x0e, 0xa1, 0xd9, 0x6d,
- 0xf4, 0xac, 0xd1, 0x23, 0xe9, 0x3a, 0x60, 0xef, 0xda, 0x7b, 0x9b, 0x45,
- 0xf1, 0xca, 0xb5, 0xd5, 0x6a, 0xe2, 0x20, 0x06, 0x7e, 0x71, 0x75, 0x1e,
- 0x73, 0x19, 0x7e, 0x2b, 0x42, 0x06, 0x4d, 0xf5, 0x8b, 0x1a, 0xbd, 0xc2,
- 0x93, 0x68, 0x8d, 0xc2, 0x31, 0x33, 0x99, 0x69, 0x49, 0x31, 0x00, 0x9c,
- 0x6b, 0xee, 0xa6, 0xec, 0xb3, 0x46, 0xda, 0x2e, 0x85, 0xbf, 0x8c, 0x9f,
- 0x95, 0x62, 0xe3, 0x6b, 0x59, 0x49, 0xd8, 0x63, 0xcd, 0xb8, 0xfa, 0x3d,
- 0x9c, 0xa8, 0xe9, 0xe0, 0xf7, 0x67, 0x9b, 0x71, 0x7b, 0x02, 0x57, 0x93,
- 0x0c, 0x9a, 0xf2, 0xab, 0xcc, 0xb8, 0x4a, 0x62, 0xcb, 0x6f, 0x9f, 0xc2,
- 0x0f, 0x72, 0x32, 0x30, 0x9b, 0xae, 0x14, 0x7a, 0x1d, 0x33, 0x93, 0x79,
- 0x68, 0xd1, 0xad, 0x6c, 0x3b, 0x58, 0xc9, 0xfb, 0x7f, 0x08, 0xcf, 0x2e,
- 0x32, 0x19, 0x0d, 0xac, 0x5d, 0x96, 0xc5, 0xb2, 0xd9, 0x29, 0x5e, 0xe3,
- 0xf9, 0xb7, 0x4f, 0xe1, 0xa1, 0x45, 0xb7, 0xf2, 0xfc, 0x3b, 0xa7, 0xb8,
- 0xd0, 0x12, 0x5a, 0x99, 0x30, 0xe4, 0x82, 0x88, 0x63, 0x66, 0x32, 0x4f,
- 0xe6, 0xcd, 0x18, 0x36, 0xbe, 0xb6, 0xb6, 0x8e, 0xc3, 0x1f, 0x1d, 0xa6,
- 0xaa, 0xaa, 0x0a, 0x8b, 0xc9, 0x48, 0xc1, 0xf2, 0x6c, 0x96, 0x64, 0xdb,
- 0x43, 0x15, 0xef, 0x85, 0x8d, 0x2b, 0xb2, 0x59, 0x36, 0x3b, 0x05, 0xb7,
- 0xdb, 0xcd, 0xa9, 0x53, 0xa7, 0x38, 0x7c, 0xf8, 0x08, 0x4e, 0xa7, 0x13,
- 0x80, 0xb4, 0x04, 0x0b, 0x2f, 0xae, 0x9e, 0x8b, 0x3d, 0x36, 0xb4, 0xfb,
- 0x5b, 0x48, 0x2b, 0x20, 0x26, 0x2a, 0x82, 0xc7, 0x1d, 0x19, 0x00, 0xf4,
- 0xf7, 0xf7, 0xf3, 0xca, 0x3f, 0xfe, 0x92, 0xdd, 0xbb, 0x77, 0x0f, 0xd3,
- 0x1d, 0xb9, 0x0e, 0xd6, 0xaf, 0x7f, 0x8a, 0x27, 0x1c, 0x99, 0x1c, 0x3e,
- 0xd7, 0x46, 0x4f, 0xbf, 0x5b, 0x57, 0x8e, 0xc9, 0x68, 0x20, 0x21, 0x26,
- 0x92, 0xe6, 0x2e, 0x97, 0xdf, 0x72, 0xea, 0x82, 0xe9, 0x89, 0xdc, 0x3b,
- 0xc3, 0xce, 0xb9, 0x73, 0xe7, 0x78, 0xfe, 0xa7, 0xcf, 0x53, 0x55, 0x55,
- 0x0d, 0x40, 0x74, 0x74, 0x34, 0xeb, 0xd6, 0xad, 0x65, 0x59, 0xde, 0x32,
- 0x62, 0x2d, 0x26, 0x1e, 0x5d, 0x9c, 0xce, 0x0b, 0xef, 0xfe, 0x61, 0xcc,
- 0xb6, 0x84, 0xb4, 0x02, 0xee, 0x9d, 0x91, 0x84, 0xcd, 0x6c, 0x02, 0xe0,
- 0xb5, 0xd7, 0x7e, 0xed, 0x65, 0x3c, 0x40, 0xd9, 0xc1, 0x32, 0xb6, 0xfd,
- 0x72, 0x1b, 0xb1, 0x16, 0x13, 0x77, 0x67, 0x4e, 0xd6, 0x95, 0x61, 0x8f,
- 0x35, 0xf3, 0x9b, 0xbf, 0x5c, 0xc0, 0x8e, 0x47, 0x17, 0xf2, 0xdc, 0xfd,
- 0xb7, 0xf9, 0x2d, 0x4c, 0xac, 0x98, 0x33, 0x05, 0x97, 0xcb, 0xc5, 0xe6,
- 0x1f, 0x6f, 0x1e, 0x36, 0x1e, 0xa0, 0xa7, 0xa7, 0x87, 0x2d, 0x5b, 0x7e,
- 0xce, 0xa7, 0x9f, 0x9e, 0x02, 0xe0, 0x9e, 0xcc, 0xc9, 0xc4, 0x47, 0x47,
- 0x8e, 0xd9, 0x96, 0x90, 0x1c, 0x90, 0x95, 0x3c, 0x58, 0x6b, 0xe8, 0xee,
- 0xee, 0x66, 0xd7, 0xce, 0x5d, 0xba, 0x3c, 0x7b, 0xf7, 0xee, 0xa3, 0xa9,
- 0xa9, 0x89, 0x19, 0x53, 0x62, 0x75, 0xe9, 0xf7, 0x64, 0x26, 0x91, 0x68,
- 0x1d, 0x2c, 0x27, 0x2c, 0xca, 0x98, 0x4c, 0x4a, 0x9c, 0x45, 0x7f, 0xae,
- 0x94, 0x58, 0xf6, 0xec, 0xd9, 0x43, 0x43, 0x83, 0x6f, 0x3c, 0x11, 0x11,
- 0x76, 0xec, 0xd8, 0x01, 0x80, 0x52, 0x8a, 0xcc, 0x64, 0xeb, 0x98, 0x6d,
- 0x09, 0xc9, 0x01, 0x96, 0xc8, 0xc1, 0x7d, 0x5f, 0x57, 0x57, 0x87, 0xdb,
- 0xad, 0xbf, 0xbc, 0x45, 0x84, 0xaa, 0xaa, 0x2a, 0xa2, 0x23, 0xf5, 0xdf,
- 0x84, 0x45, 0x45, 0x78, 0x4f, 0x1d, 0x65, 0xd2, 0x57, 0xc5, 0x12, 0x69,
- 0xa4, 0xba, 0xba, 0xc6, 0xaf, 0x2e, 0xd5, 0x23, 0x56, 0x85, 0x25, 0x72,
- 0xec, 0x3b, 0x3a, 0x24, 0x07, 0xb4, 0x74, 0xf7, 0x01, 0x10, 0x17, 0x17,
- 0x17, 0x90, 0x2f, 0x3e, 0x3e, 0x9e, 0x16, 0x67, 0x5f, 0x28, 0x53, 0x0c,
- 0xa3, 0xd5, 0xd9, 0x47, 0x6c, 0xac, 0xfe, 0x2a, 0xba, 0x5a, 0x87, 0x50,
- 0xe6, 0x0a, 0xc9, 0x01, 0xc7, 0x2e, 0xb4, 0x01, 0x90, 0x92, 0x92, 0xc2,
- 0x9c, 0x39, 0xfa, 0xf5, 0xd0, 0xf4, 0xf4, 0x74, 0x32, 0xd2, 0x33, 0x38,
- 0x3a, 0xc4, 0x1b, 0x2a, 0x8e, 0x56, 0xb5, 0x93, 0x9b, 0xeb, 0x20, 0x22,
- 0x42, 0xff, 0xd7, 0xcd, 0xcf, 0xcf, 0x03, 0xc0, 0xe9, 0x1a, 0xe0, 0xec,
- 0xc5, 0xae, 0x31, 0xcb, 0x0f, 0xc9, 0x01, 0xc7, 0xab, 0xda, 0x39, 0x33,
- 0x34, 0xd9, 0x86, 0x8d, 0x05, 0xd8, 0xed, 0xde, 0xc7, 0x5d, 0x42, 0x42,
- 0x02, 0x9b, 0x9e, 0xde, 0xc4, 0xe9, 0x8b, 0x5d, 0x9c, 0xa8, 0x19, 0xdf,
- 0x5b, 0xac, 0x37, 0x8f, 0xd6, 0x30, 0x25, 0xed, 0x26, 0x7e, 0xf0, 0xf8,
- 0x1a, 0x0c, 0x06, 0x6f, 0x75, 0x17, 0x2d, 0x5a, 0xc8, 0xca, 0x6f, 0xae,
- 0x04, 0xe0, 0x8d, 0x23, 0x35, 0xb8, 0xb5, 0xa0, 0x5e, 0xcd, 0x79, 0x21,
- 0xa4, 0x63, 0x50, 0x80, 0x9f, 0xbf, 0x77, 0x9a, 0xe2, 0x07, 0xef, 0x64,
- 0xea, 0xd4, 0xa9, 0x6c, 0xff, 0xe7, 0x57, 0x79, 0xeb, 0xcd, 0xb7, 0xa8,
- 0xae, 0xae, 0x21, 0x35, 0x2d, 0x95, 0x07, 0x1e, 0xb8, 0x1f, 0xcd, 0x14,
- 0x4d, 0xc1, 0x7f, 0x1c, 0x0f, 0x45, 0xbc, 0x17, 0x2e, 0x76, 0xba, 0x78,
- 0xb9, 0xf4, 0x0c, 0x1b, 0x56, 0xae, 0x24, 0x3b, 0x3b, 0x9b, 0xf7, 0x4b,
- 0x0f, 0xd0, 0xdb, 0xdb, 0xcb, 0xbc, 0xf9, 0xf3, 0x58, 0xba, 0x34, 0x17,
- 0xa5, 0x14, 0x47, 0xce, 0xb7, 0xf1, 0xfa, 0x11, 0xff, 0x71, 0x22, 0x10,
- 0x42, 0xbe, 0x09, 0xd6, 0x77, 0xf4, 0xb2, 0xee, 0xb7, 0xc7, 0x78, 0xc2,
- 0x91, 0xc1, 0x82, 0xe9, 0x89, 0x3c, 0xfc, 0xbd, 0x87, 0x81, 0xc1, 0xe0,
- 0xf7, 0xe1, 0x17, 0xad, 0x6c, 0x2b, 0x3f, 0x16, 0x70, 0x4f, 0xb6, 0xf7,
- 0x5c, 0xb9, 0x9d, 0x8a, 0x08, 0x1d, 0x3d, 0xfe, 0x1b, 0x47, 0xca, 0x4e,
- 0x37, 0xd2, 0xde, 0xd3, 0xcf, 0xe3, 0x8e, 0x4c, 0xd6, 0x3d, 0xb9, 0x76,
- 0x78, 0xbc, 0x77, 0xc0, 0xc3, 0x9b, 0x47, 0x6b, 0xf9, 0xed, 0x87, 0x17,
- 0xd0, 0x64, 0xec, 0xbf, 0x3e, 0x8c, 0xf3, 0x2a, 0xdc, 0xd4, 0xe5, 0xa2,
- 0xf0, 0xad, 0x53, 0x4c, 0x8a, 0x89, 0x24, 0xdd, 0x3e, 0x58, 0x41, 0xff,
- 0xb2, 0xc9, 0x19, 0x54, 0x1e, 0x50, 0x76, 0xba, 0x91, 0xd9, 0x69, 0x71,
- 0x64, 0xa5, 0xd8, 0x78, 0xe7, 0x78, 0x1d, 0x1d, 0x3d, 0x81, 0x9f, 0x39,
- 0x5e, 0xd5, 0xce, 0x63, 0xbf, 0x3e, 0xcc, 0xb4, 0x24, 0x2b, 0x29, 0x71,
- 0x66, 0xba, 0x5d, 0x6e, 0xce, 0x36, 0x3a, 0xe9, 0x1b, 0xf0, 0x8c, 0xc7,
- 0x04, 0xff, 0x0e, 0x98, 0x96, 0x14, 0x93, 0x7a, 0xae, 0x25, 0xb8, 0x3e,
- 0x84, 0xb6, 0x4b, 0xfd, 0xb4, 0x9d, 0x6f, 0x1d, 0xd3, 0xc4, 0xfd, 0x6e,
- 0x8d, 0xe2, 0x7d, 0x9f, 0x8f, 0xe9, 0x19, 0x80, 0xf3, 0xcd, 0xdd, 0x9c,
- 0x6f, 0x1e, 0x5b, 0x7f, 0x44, 0x4a, 0xbc, 0xd9, 0xef, 0xbb, 0x44, 0x9f,
- 0x20, 0xb8, 0xe2, 0x1f, 0xf6, 0x44, 0x01, 0x14, 0x3f, 0x38, 0x77, 0xee,
- 0x33, 0x7f, 0x36, 0x8b, 0xd9, 0x69, 0x81, 0x8f, 0xba, 0xff, 0xcb, 0x88,
- 0x30, 0x1a, 0xb8, 0xff, 0xae, 0xa9, 0x3c, 0xfb, 0xf5, 0x59, 0x7e, 0xbb,
- 0x4e, 0xbc, 0x6e, 0xa0, 0x4b, 0x0a, 0xcb, 0x23, 0xa2, 0xac, 0x34, 0xa7,
- 0x25, 0x44, 0x1f, 0x7b, 0xc2, 0x91, 0xe1, 0xb8, 0xf3, 0x96, 0x04, 0xba,
- 0x5d, 0x6e, 0x56, 0x6f, 0xfb, 0xc0, 0xeb, 0xa1, 0x8c, 0x64, 0x1b, 0xcd,
- 0x5d, 0x2e, 0x3a, 0x7b, 0x03, 0x36, 0x7c, 0x4d, 0x18, 0x0c, 0x4a, 0x31,
- 0x75, 0x52, 0x34, 0x97, 0xfa, 0xdc, 0xb4, 0x76, 0x5f, 0x89, 0x3b, 0x77,
- 0x67, 0x26, 0xb1, 0xf9, 0xcf, 0x67, 0xd3, 0xd5, 0x3b, 0xe0, 0x79, 0xa6,
- 0xe4, 0x93, 0x17, 0xce, 0xb7, 0x5e, 0xca, 0x55, 0xa6, 0xde, 0xdc, 0xbd,
- 0x6b, 0xef, 0x1b, 0x66, 0xf2, 0xda, 0x02, 0x11, 0x66, 0x77, 0x2a, 0x44,
- 0xc4, 0xd7, 0xb5, 0xf7, 0x38, 0x7e, 0xb4, 0xf3, 0x24, 0xeb, 0x96, 0xcd,
- 0x60, 0xc9, 0x4c, 0xef, 0x23, 0xee, 0xe6, 0x49, 0xd1, 0xbc, 0xf2, 0xdd,
- 0x79, 0xc0, 0x60, 0x0c, 0xa8, 0x6c, 0x74, 0x52, 0xd9, 0xd8, 0x4d, 0x65,
- 0xa3, 0x93, 0xb3, 0x17, 0x9d, 0x38, 0x5d, 0xd7, 0xd6, 0x29, 0x4a, 0x41,
- 0x5a, 0x42, 0x34, 0x59, 0xc9, 0x36, 0x32, 0x92, 0x6d, 0x64, 0x25, 0xdb,
- 0x48, 0x4f, 0xb6, 0x62, 0x31, 0x19, 0xf9, 0xb4, 0xb6, 0x83, 0x8d, 0xbf,
- 0xfb, 0x64, 0x98, 0x37, 0x72, 0xe8, 0xb6, 0xf9, 0xa3, 0x9d, 0x27, 0x8d,
- 0xe7, 0x5a, 0x2e, 0x3d, 0x07, 0x80, 0xc7, 0x32, 0x05, 0xb8, 0x30, 0x6c,
- 0xb3, 0x97, 0xf4, 0xa8, 0xc8, 0x18, 0x46, 0x14, 0x17, 0x44, 0x27, 0x47,
- 0x33, 0x0f, 0x5d, 0x6d, 0x3f, 0xad, 0xed, 0x20, 0xca, 0x64, 0x64, 0xc1,
- 0xf4, 0x44, 0xee, 0xce, 0x4c, 0x1a, 0xa6, 0x1f, 0x39, 0xdf, 0xc6, 0xe6,
- 0x5d, 0x27, 0x75, 0x95, 0xcf, 0x4a, 0xb1, 0x11, 0x13, 0x35, 0x38, 0xa5,
- 0xdb, 0x23, 0xb8, 0x86, 0x02, 0x98, 0x02, 0x62, 0xcc, 0x57, 0x54, 0xa9,
- 0x6e, 0xed, 0xf1, 0xfa, 0x25, 0x2f, 0x23, 0xdd, 0x6e, 0x65, 0xcb, 0xaa,
- 0x3b, 0x86, 0x13, 0x31, 0x80, 0x8e, 0x9e, 0x7e, 0x4e, 0xd5, 0x76, 0x32,
- 0x3d, 0x29, 0x06, 0x8b, 0xc9, 0x6f, 0x03, 0xda, 0x30, 0xdc, 0x18, 0xbc,
- 0x92, 0x0e, 0x2f, 0x07, 0x98, 0x8c, 0xaa, 0x45, 0x0b, 0x32, 0xa8, 0xbe,
- 0x77, 0xa2, 0x9e, 0x8a, 0xcf, 0x9b, 0x88, 0x30, 0x28, 0xa6, 0x25, 0x59,
- 0xc9, 0x4c, 0xb6, 0xf1, 0x8d, 0xb9, 0xa9, 0xdc, 0x36, 0x55, 0x3f, 0x66,
- 0xcc, 0x4e, 0x8b, 0xa3, 0xf8, 0xc1, 0x3b, 0x83, 0x92, 0x5d, 0xd5, 0x7a,
- 0x89, 0x35, 0xbf, 0x39, 0xe2, 0x33, 0x7e, 0x4b, 0x62, 0x0c, 0x36, 0xb3,
- 0x89, 0x3d, 0x27, 0xeb, 0xf9, 0xf8, 0x42, 0x1b, 0x5f, 0x34, 0x76, 0xd3,
- 0xd4, 0xe5, 0x02, 0xe0, 0xc5, 0xd5, 0x73, 0xfd, 0xe6, 0x1d, 0x23, 0x21,
- 0xbd, 0x03, 0x4d, 0x23, 0xff, 0xf7, 0x72, 0xc0, 0xde, 0xb5, 0xf7, 0x36,
- 0xe7, 0x17, 0x55, 0xd4, 0x83, 0xa4, 0x02, 0x68, 0x9a, 0x60, 0x36, 0x19,
- 0xf9, 0xbb, 0x6f, 0xdf, 0xc1, 0xa1, 0x33, 0x4d, 0x7c, 0x50, 0xe9, 0x55,
- 0x51, 0x06, 0xc0, 0xad, 0xc9, 0xd0, 0x36, 0x70, 0x92, 0x91, 0x6c, 0x25,
- 0x25, 0x5e, 0x3f, 0xab, 0xb3, 0x0d, 0xfd, 0xc2, 0xbb, 0x8e, 0xd6, 0x50,
- 0xdb, 0xd6, 0xeb, 0x57, 0xc1, 0xe5, 0xb7, 0x4f, 0x21, 0xd1, 0x1a, 0x38,
- 0xad, 0xdd, 0x7b, 0xb2, 0x81, 0xca, 0x46, 0xa7, 0x5f, 0xfa, 0xf4, 0x24,
- 0x2b, 0x8b, 0xb3, 0xed, 0xe4, 0x0c, 0x15, 0x64, 0x3c, 0x57, 0x6e, 0x88,
- 0xb5, 0x07, 0x9f, 0x5d, 0xea, 0x75, 0x5c, 0xf9, 0x1e, 0x83, 0xc2, 0x01,
- 0x14, 0xdf, 0x03, 0x78, 0xfb, 0x78, 0x1d, 0x56, 0xb3, 0x89, 0x85, 0xe9,
- 0x89, 0xdc, 0x79, 0x4b, 0x02, 0x3f, 0xcc, 0xcd, 0xe4, 0x5c, 0x88, 0xa5,
- 0xa7, 0xcb, 0xf8, 0xe8, 0xcb, 0xd6, 0x80, 0xd7, 0xe3, 0x39, 0x37, 0xc5,
- 0x8f, 0xea, 0x00, 0x7f, 0x48, 0x8e, 0x33, 0xb3, 0xfd, 0x91, 0x3f, 0xe1,
- 0xa6, 0x49, 0xd1, 0xc0, 0xe0, 0x65, 0x6d, 0xc7, 0x07, 0xe7, 0x47, 0x96,
- 0xcb, 0x0e, 0x5c, 0xfd, 0x8c, 0x8f, 0x03, 0x94, 0x92, 0xed, 0xc2, 0xa0,
- 0x03, 0x6a, 0xda, 0x7a, 0xd8, 0xf2, 0xde, 0x67, 0x44, 0x99, 0x8c, 0x2c,
- 0x9c, 0x9e, 0xc8, 0xe2, 0x19, 0x76, 0xe6, 0x4f, 0x1b, 0x3c, 0x52, 0xfb,
- 0xfd, 0x14, 0x22, 0x0d, 0x0c, 0x06, 0x9f, 0x7e, 0x77, 0xf0, 0x6d, 0x6f,
- 0xc1, 0x22, 0x32, 0xc2, 0x7f, 0xea, 0x32, 0xe0, 0xd1, 0xb0, 0x99, 0x4d,
- 0xf4, 0xf6, 0x7b, 0x78, 0xe3, 0xe3, 0x1a, 0x0e, 0x7d, 0xde, 0xe4, 0xb3,
- 0x4a, 0x44, 0x69, 0x3e, 0x6d, 0xba, 0x3e, 0x0e, 0xd8, 0xb7, 0x21, 0xe7,
- 0xbf, 0xf2, 0xb6, 0x96, 0x1f, 0x52, 0x8a, 0xc5, 0x97, 0xc7, 0xfa, 0x06,
- 0x3c, 0x1c, 0x3a, 0xd3, 0xc4, 0xa1, 0x33, 0x4d, 0x44, 0x47, 0x46, 0x30,
- 0x3b, 0x2d, 0x96, 0xe3, 0x55, 0xed, 0x3e, 0x4a, 0xb8, 0x3d, 0x42, 0x94,
- 0xc9, 0xc8, 0xdb, 0x6b, 0xbf, 0x46, 0xb3, 0xb3, 0x8f, 0xfa, 0x8e, 0x5e,
- 0xea, 0xda, 0x07, 0xff, 0xe2, 0x2c, 0x26, 0x1f, 0x7e, 0x7f, 0x30, 0x19,
- 0x0d, 0x38, 0x66, 0x26, 0x93, 0x96, 0x60, 0x21, 0x2d, 0x21, 0x9a, 0xd4,
- 0x04, 0x0b, 0xa9, 0xf1, 0x16, 0xac, 0x43, 0x01, 0x74, 0x40, 0xc7, 0xf9,
- 0xaf, 0x1c, 0xa8, 0x24, 0x3e, 0xc6, 0xc4, 0xe7, 0xf5, 0x5d, 0xba, 0xe5,
- 0x35, 0x85, 0x2a, 0xdb, 0x5f, 0x90, 0xfb, 0xdf, 0xa3, 0x3a, 0x00, 0x40,
- 0x19, 0xe5, 0xaf, 0xd0, 0x0c, 0xc7, 0x40, 0x7c, 0xd6, 0x62, 0x4f, 0xbf,
- 0x9b, 0x23, 0xe7, 0xf5, 0x53, 0xdc, 0xd7, 0x8f, 0x54, 0xd3, 0xd1, 0xd3,
- 0xcf, 0xd4, 0x49, 0xd1, 0xa4, 0xc6, 0x5b, 0x48, 0xb7, 0x5b, 0x99, 0x7b,
- 0xb3, 0x77, 0x07, 0xcd, 0x68, 0x19, 0x9b, 0x47, 0x13, 0x62, 0x2d, 0x26,
- 0x36, 0xdd, 0x37, 0x13, 0x00, 0x4d, 0x84, 0xa6, 0xae, 0x3e, 0xce, 0x34,
- 0x74, 0x51, 0xdf, 0xd1, 0xcb, 0x17, 0x8d, 0xdd, 0x54, 0xe9, 0x6c, 0xc3,
- 0x86, 0xce, 0x5e, 0x1a, 0x3a, 0xfd, 0xc6, 0x96, 0x3e, 0xb7, 0x51, 0xfd,
- 0x50, 0x8f, 0x10, 0xa0, 0x47, 0xa8, 0xe2, 0x51, 0x94, 0xbc, 0x1a, 0x50,
- 0xdb, 0x20, 0x10, 0x6b, 0x31, 0x91, 0x1a, 0x6f, 0x21, 0x2d, 0xc1, 0x82,
- 0xd5, 0x6c, 0x62, 0xf7, 0x27, 0x75, 0x23, 0x83, 0x92, 0x0f, 0x6e, 0x4e,
- 0x8c, 0x61, 0xfe, 0xad, 0x09, 0x34, 0x74, 0xba, 0xa8, 0x6d, 0xeb, 0x91,
- 0xfa, 0x4e, 0x17, 0x1e, 0x8f, 0x36, 0xae, 0xae, 0x76, 0x51, 0xf2, 0xfd,
- 0xd2, 0x02, 0xc7, 0x6b, 0x7a, 0xb4, 0x80, 0x82, 0xf3, 0x8b, 0xcb, 0xb7,
- 0x20, 0x3c, 0x3d, 0x9e, 0xc9, 0xaf, 0x37, 0x04, 0xfe, 0xb6, 0x74, 0x43,
- 0xce, 0x66, 0x7f, 0xf4, 0x80, 0x05, 0x91, 0xfd, 0x05, 0x39, 0xcf, 0x28,
- 0xe1, 0x27, 0x83, 0x72, 0xbe, 0x72, 0x10, 0x94, 0x7a, 0x2e, 0x90, 0xf1,
- 0x10, 0xe4, 0x07, 0x13, 0xf9, 0x5b, 0xcb, 0x56, 0xa3, 0xd4, 0xbf, 0x00,
- 0x63, 0x2f, 0xbb, 0x5e, 0x1f, 0x38, 0x51, 0xf2, 0xc8, 0xfe, 0x02, 0xc7,
- 0xa8, 0xcd, 0x9b, 0x41, 0xef, 0xad, 0xbc, 0xad, 0x87, 0xa6, 0x29, 0xa5,
- 0xbd, 0x0a, 0x2c, 0x1d, 0x97, 0x6a, 0xd7, 0x1a, 0x8a, 0xff, 0xd4, 0x3c,
- 0x86, 0xef, 0x5f, 0xdd, 0x3c, 0xe9, 0x9f, 0x7d, 0x2c, 0x10, 0x51, 0x79,
- 0x45, 0x15, 0xdf, 0x51, 0x8a, 0xe7, 0x81, 0x8c, 0x50, 0xf4, 0xbb, 0x86,
- 0xa8, 0x14, 0xc5, 0xe6, 0xd2, 0xf5, 0x4b, 0x4a, 0x50, 0x41, 0xbc, 0xd5,
- 0x1d, 0x42, 0x48, 0xd1, 0x75, 0xde, 0xaf, 0x3e, 0x36, 0x25, 0x75, 0x3b,
- 0x1f, 0x12, 0xe1, 0x49, 0xe0, 0x8e, 0x50, 0x64, 0x84, 0x11, 0x9f, 0xa0,
- 0xe4, 0xa5, 0x16, 0x6b, 0xec, 0xbf, 0x8f, 0xf6, 0x41, 0x96, 0x1e, 0xc6,
- 0xfd, 0xd1, 0xd4, 0xf2, 0xa2, 0xf2, 0x7b, 0x34, 0xe1, 0xbb, 0x4a, 0xa9,
- 0x55, 0x20, 0x61, 0xeb, 0xe2, 0x1e, 0x05, 0xad, 0xc0, 0xeb, 0x9a, 0x26,
- 0xff, 0xfa, 0xfe, 0x26, 0xc7, 0x07, 0xa3, 0x72, 0x07, 0x40, 0xd8, 0xbe,
- 0x1a, 0x5b, 0x52, 0x58, 0x1e, 0x11, 0x69, 0xd5, 0xfe, 0xd4, 0x80, 0x61,
- 0x85, 0xc0, 0x62, 0xe0, 0x2e, 0xc2, 0xd7, 0x4a, 0xeb, 0x02, 0x8e, 0x8b,
- 0x92, 0x0a, 0xe5, 0x31, 0xec, 0xed, 0xeb, 0x91, 0x0f, 0x2b, 0x0a, 0x73,
- 0xf4, 0x5f, 0x49, 0x8d, 0x11, 0xd7, 0xee, 0xc3, 0xc9, 0xc2, 0x92, 0x48,
- 0xa7, 0xd5, 0x7e, 0x87, 0x86, 0xcc, 0x42, 0xc9, 0x0c, 0x25, 0x6a, 0x3a,
- 0x8a, 0x54, 0x84, 0x24, 0x50, 0x76, 0x10, 0xc5, 0x95, 0x46, 0xeb, 0x76,
- 0x50, 0x02, 0xd2, 0x04, 0xaa, 0x09, 0xa4, 0x01, 0xd4, 0x97, 0x28, 0xed,
- 0x8c, 0xa6, 0xd4, 0x67, 0x6d, 0x31, 0xb6, 0x13, 0xa1, 0x2c, 0xef, 0x1b,
- 0xb8, 0x81, 0x1b, 0x18, 0x15, 0xff, 0x0b, 0x12, 0x38, 0x4d, 0x79, 0xd2,
- 0x8f, 0xa8, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
- 0x42, 0x60, 0x82
-};
-
-static const Color boot_splash_bg_color = Color(224 / 255.0, 224 / 255.0, 224 / 255.0);
-#endif // SPLASH_H
diff --git a/main/splash.png b/main/splash.png
new file mode 100644
index 0000000000..894a7d7aba
--- /dev/null
+++ b/main/splash.png
Binary files differ
diff --git a/main/tests/test_containers.cpp b/main/tests/test_containers.cpp
index d860d9940e..956be5d169 100644
--- a/main/tests/test_containers.cpp
+++ b/main/tests/test_containers.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -54,18 +55,6 @@ MainLoop *test() {
{
- Image img;
- img.create(default_mouse_cursor_xpm);
-
- {
- for (int i = 0; i < 8; i++) {
-
- Image mipmap;
- //img.make_mipmap(mipmap);
- img = mipmap;
- if (img.get_width() <= 4) break;
- };
- };
};
#if 0
diff --git a/main/tests/test_containers.h b/main/tests/test_containers.h
index 990bf4f819..7b589d4057 100644
--- a/main/tests/test_containers.h
+++ b/main/tests/test_containers.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 fcbecc768b..0607360d88 100644
--- a/main/tests/test_gdscript.cpp
+++ b/main/tests/test_gdscript.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -910,7 +911,7 @@ static void _disassemble_class(const Ref<GDScript> &p_class, const Vector<String
}
}
-MainLoop *test(TestType p_test) {
+MainLoop *test(TestType p_type) {
List<String> cmdlargs = OS::get_singleton()->get_cmdline_args();
@@ -949,7 +950,7 @@ MainLoop *test(TestType p_test) {
}
}
- if (p_test == TEST_TOKENIZER) {
+ if (p_type == TEST_TOKENIZER) {
GDTokenizerText tk;
tk.set_code(code);
@@ -992,7 +993,7 @@ MainLoop *test(TestType p_test) {
}
}
- if (p_test == TEST_PARSER) {
+ if (p_type == TEST_PARSER) {
GDParser parser;
Error err = parser.parse(code);
@@ -1009,7 +1010,7 @@ MainLoop *test(TestType p_test) {
_parser_show_class(cnode, 0, lines);
}
- if (p_test == TEST_COMPILER) {
+ if (p_type == TEST_COMPILER) {
GDParser parser;
@@ -1043,7 +1044,7 @@ MainLoop *test(TestType p_test) {
current = current->get_base();
}
- } else if (p_test == TEST_BYTECODE) {
+ } else if (p_type == TEST_BYTECODE) {
Vector<uint8_t> buf = GDTokenizerBuffer::parse_code_string(code);
String dst = test.get_basename() + ".gdc";
@@ -1072,7 +1073,7 @@ MainLoop *test(TestType p_test) {
namespace TestGDScript {
-MainLoop *test(TestType p_test) {
+MainLoop *test(TestType p_type) {
return NULL;
}
diff --git a/main/tests/test_gdscript.h b/main/tests/test_gdscript.h
index 3b2a4aa4ec..b4e1665de5 100644
--- a/main/tests/test_gdscript.h
+++ b/main/tests/test_gdscript.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 a2dd950af6..44d4464aac 100644
--- a/main/tests/test_gui.cpp
+++ b/main/tests/test_gui.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -49,10 +50,9 @@
#include "scene/gui/tab_container.h"
#include "scene/gui/texture_rect.h"
#include "scene/gui/tree.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
#include "scene/3d/camera.h"
-#include "scene/3d/test_cube.h"
#include "scene/main/viewport.h"
namespace TestGUI {
@@ -86,14 +86,10 @@ public:
vp->add_child(camera);
camera->make_current();
- TestCube *testcube = memnew( TestCube );
- vp->add_child(testcube);
- testcube->set_transform(Transform( Basis().rotated(Vector3(0,1,0),Math_PI*0.25), Vector3(0,0,-8)));
-
Sprite *sp = memnew( Sprite );
sp->set_texture( vp->get_render_target_texture() );
//sp->set_texture( ResourceLoader::load("res://ball.png") );
- sp->set_pos(Point2(300,300));
+ sp->set_position(Point2(300,300));
get_root()->add_child(sp);
@@ -112,7 +108,7 @@ public:
Label *label = memnew(Label);
- label->set_pos(Point2(80, 90));
+ label->set_position(Point2(80, 90));
label->set_size(Point2(170, 80));
label->set_align(Label::ALIGN_FILL);
//label->set_text("There");
@@ -122,7 +118,7 @@ public:
Button *button = memnew(Button);
- button->set_pos(Point2(20, 20));
+ button->set_position(Point2(20, 20));
button->set_size(Point2(1, 1));
button->set_text("This is a biggie button");
@@ -140,7 +136,7 @@ public:
Ref<ImageTexture> tt = memnew( ImageTexture );
tt->create_from_image(img);
tf->set_texture(tt);
- tf->set_pos(Point2(50,50));
+ tf->set_position(Point2(50,50));
//tf->set_scale(Point2(0.3,0.3));
@@ -150,7 +146,7 @@ public:
Tree *tree = memnew(Tree);
tree->set_columns(2);
- tree->set_pos(Point2(230, 210));
+ tree->set_position(Point2(230, 210));
tree->set_size(Point2(150, 250));
TreeItem *item = tree->create_item();
@@ -191,14 +187,14 @@ public:
LineEdit *line_edit = memnew(LineEdit);
- line_edit->set_pos(Point2(30, 190));
+ line_edit->set_position(Point2(30, 190));
line_edit->set_size(Point2(180, 1));
frame->add_child(line_edit);
HScrollBar *hscroll = memnew(HScrollBar);
- hscroll->set_pos(Point2(30, 290));
+ hscroll->set_position(Point2(30, 290));
hscroll->set_size(Point2(180, 1));
hscroll->set_max(10);
hscroll->set_page(4);
@@ -207,7 +203,7 @@ public:
SpinBox *spin = memnew(SpinBox);
- spin->set_pos(Point2(30, 260));
+ spin->set_position(Point2(30, 260));
spin->set_size(Point2(120, 1));
frame->add_child(spin);
@@ -215,7 +211,7 @@ public:
ProgressBar *progress = memnew(ProgressBar);
- progress->set_pos(Point2(30, 330));
+ progress->set_position(Point2(30, 330));
progress->set_size(Point2(120, 1));
frame->add_child(progress);
@@ -224,7 +220,7 @@ public:
MenuButton *menu_button = memnew(MenuButton);
menu_button->set_text("I'm a menu!");
- menu_button->set_pos(Point2(30, 380));
+ menu_button->set_position(Point2(30, 380));
menu_button->set_size(Point2(1, 1));
frame->add_child(menu_button);
@@ -243,7 +239,7 @@ public:
options->add_item("Hello, testing");
options->add_item("My Dearest");
- options->set_pos(Point2(230, 180));
+ options->set_position(Point2(230, 180));
options->set_size(Point2(1, 1));
frame->add_child(options);
@@ -252,7 +248,7 @@ public:
Tree * tree = memnew( Tree );
tree->set_columns(2);
- tree->set_pos( Point2( 230,210 ) );
+ tree->set_position( Point2( 230,210 ) );
tree->set_size( Point2( 150,250 ) );
@@ -280,9 +276,9 @@ public:
RichTextLabel *richtext = memnew(RichTextLabel);
- richtext->set_pos(Point2(600, 210));
+ richtext->set_position(Point2(600, 210));
richtext->set_size(Point2(180, 250));
- richtext->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, 20);
+ richtext->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -20);
frame->add_child(richtext);
@@ -323,8 +319,6 @@ public:
///richtext->add_text("Hello!\n");
//richtext->pop();
- richtext->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END);
-
TabContainer *tabc = memnew(TabContainer);
Control *ctl = memnew(Control);
@@ -336,21 +330,21 @@ public:
tabc->add_child(ctl);
label = memnew(Label);
label->set_text("Some Label");
- label->set_pos(Point2(20, 20));
+ label->set_position(Point2(20, 20));
ctl->add_child(label);
ctl = memnew(Control);
ctl->set_name("tab 3");
button = memnew(Button);
button->set_text("Some Button");
- button->set_pos(Point2(30, 50));
+ button->set_position(Point2(30, 50));
ctl->add_child(button);
tabc->add_child(ctl);
frame->add_child(tabc);
- tabc->set_pos(Point2(400, 210));
+ tabc->set_position(Point2(400, 210));
tabc->set_size(Point2(180, 250));
/*Ref<ImageTexture> text = memnew( ImageTexture );
@@ -358,14 +352,14 @@ public:
Sprite* sprite = memnew(Sprite);
sprite->set_texture(text);
- sprite->set_pos(Point2(300, 300));
+ sprite->set_position(Point2(300, 300));
frame->add_child(sprite);
sprite->show();
Sprite* sprite2 = memnew(Sprite);
sprite->set_texture(text);
sprite->add_child(sprite2);
- sprite2->set_pos(Point2(50, 50));
+ sprite2->set_position(Point2(50, 50));
sprite2->show();*/
}
};
@@ -374,6 +368,6 @@ MainLoop *test() {
return memnew(TestMainLoop);
}
-}
+} // namespace TestGUI
#endif
diff --git a/main/tests/test_gui.h b/main/tests/test_gui.h
index 5ffa077dc9..881ff96956 100644
--- a/main/tests/test_gui.h
+++ b/main/tests/test_gui.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 c57968ad10..0b120f87d5 100644
--- a/main/tests/test_image.cpp
+++ b/main/tests/test_image.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -40,7 +41,7 @@ class TestMainLoop : public MainLoop {
bool quit;
public:
- virtual void input_event(const InputEvent &p_event) {
+ virtual void input_event(const Ref<InputEvent> &p_event) {
}
virtual void init() {
@@ -62,11 +63,6 @@ public:
MainLoop *test() {
- Image img;
- ImageLoader::load_image("as1.png", &img);
-
- img.resize(512, 512);
-
return memnew(TestMainLoop);
}
}
diff --git a/main/tests/test_image.h b/main/tests/test_image.h
index f520462429..3b1783ded7 100644
--- a/main/tests/test_image.h
+++ b/main/tests/test_image.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 dfc1f05383..f7c49c9249 100644
--- a/main/tests/test_io.cpp
+++ b/main/tests/test_io.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,7 +31,7 @@
#ifdef MINIZIP_ENABLED
-#include "core/global_config.h"
+#include "core/project_settings.h"
#include "io/resource_loader.h"
#include "io/resource_saver.h"
#include "os/dir_access.h"
@@ -90,10 +91,10 @@ MainLoop *test() {
ResourceSaver::save("test_data/rock.xml", texture);
print_line("localize paths");
- print_line(GlobalConfig::get_singleton()->localize_path("algo.xml"));
- print_line(GlobalConfig::get_singleton()->localize_path("c:\\windows\\algo.xml"));
- print_line(GlobalConfig::get_singleton()->localize_path(GlobalConfig::get_singleton()->get_resource_path() + "/something/something.xml"));
- print_line(GlobalConfig::get_singleton()->localize_path("somedir/algo.xml"));
+ print_line(ProjectSettings::get_singleton()->localize_path("algo.xml"));
+ print_line(ProjectSettings::get_singleton()->localize_path("c:\\windows\\algo.xml"));
+ print_line(ProjectSettings::get_singleton()->localize_path(ProjectSettings::get_singleton()->get_resource_path() + "/something/something.xml"));
+ print_line(ProjectSettings::get_singleton()->localize_path("somedir/algo.xml"));
{
diff --git a/main/tests/test_io.h b/main/tests/test_io.h
index 21c1356c35..765c083955 100644
--- a/main/tests/test_io.h
+++ b/main/tests/test_io.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 ca039402c1..f3ed4604e1 100644
--- a/main/tests/test_main.cpp
+++ b/main/tests/test_main.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 729f2ca1f8..da890a4b96 100644
--- a/main/tests/test_main.h
+++ b/main/tests/test_main.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 c82ae1abf5..d21be24dab 100644
--- a/main/tests/test_math.cpp
+++ b/main/tests/test_math.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -461,6 +462,59 @@ uint32_t ihash3(uint32_t a) {
MainLoop *test() {
+ {
+ float r = 1;
+ float g = 0.5;
+ float b = 0.1;
+
+ const float pow2to9 = 512.0f;
+ const float B = 15.0f;
+ //const float Emax = 31.0f;
+ const float N = 9.0f;
+
+ float sharedexp = 65408.000f; //(( pow2to9 - 1.0f)/ pow2to9)*powf( 2.0f, 31.0f - 15.0f);
+
+ float cRed = MAX(0.0f, MIN(sharedexp, r));
+ float cGreen = MAX(0.0f, MIN(sharedexp, g));
+ float cBlue = MAX(0.0f, MIN(sharedexp, b));
+
+ float cMax = MAX(cRed, MAX(cGreen, cBlue));
+
+ // expp = MAX(-B - 1, log2(maxc)) + 1 + B
+
+ float expp = MAX(-B - 1.0f, floor(Math::log(cMax) / Math_LN2)) + 1.0f + B;
+
+ float sMax = (float)floor((cMax / Math::pow(2.0f, expp - B - N)) + 0.5f);
+
+ float exps = expp + 1.0f;
+
+ if (0.0 <= sMax && sMax < pow2to9) {
+ exps = expp;
+ }
+
+ float sRed = Math::floor((cRed / pow(2.0f, exps - B - N)) + 0.5f);
+ float sGreen = Math::floor((cGreen / pow(2.0f, exps - B - N)) + 0.5f);
+ float sBlue = Math::floor((cBlue / pow(2.0f, exps - B - N)) + 0.5f);
+
+ print_line("R: " + rtos(sRed) + " G: " + rtos(sGreen) + " B: " + rtos(sBlue) + " EXP: " + rtos(exps));
+
+ uint32_t rgbe = (Math::fast_ftoi(sRed) & 0x1FF) | ((Math::fast_ftoi(sGreen) & 0x1FF) << 9) | ((Math::fast_ftoi(sBlue) & 0x1FF) << 18) | ((Math::fast_ftoi(exps) & 0x1F) << 27);
+
+ float rb = rgbe & 0x1ff;
+ float gb = (rgbe >> 9) & 0x1ff;
+ float bb = (rgbe >> 18) & 0x1ff;
+ float eb = (rgbe >> 27);
+ float mb = Math::pow(2, eb - 15.0 - 9.0);
+ ;
+ float rd = rb * mb;
+ float gd = gb * mb;
+ float bd = bb * mb;
+
+ print_line("RGBE: " + Color(rd, gd, bd));
+
+ return NULL;
+ }
+
print_line("Dvectors: " + itos(MemoryPool::allocs_used));
print_line("Mem used: " + itos(MemoryPool::total_memory));
print_line("MAx mem used: " + itos(MemoryPool::max_memory));
@@ -601,7 +655,7 @@ MainLoop *test() {
print_line(q3);
print_line("before v: " + v + " a: " + rtos(a));
- q.get_axis_and_angle(v, a);
+ q.get_axis_angle(v, a);
print_line("after v: " + v + " a: " + rtos(a));
}
diff --git a/main/tests/test_math.h b/main/tests/test_math.h
index 239f16f6b0..24fd442dd0 100644
--- a/main/tests/test_math.h
+++ b/main/tests/test_math.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 6637139c86..5a233e818e 100644
--- a/main/tests/test_physics.cpp
+++ b/main/tests/test_physics.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -262,18 +263,19 @@ protected:
}
public:
- virtual void input_event(const InputEvent &p_event) {
+ virtual void input_event(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::MOUSE_MOTION && p_event.mouse_motion.button_mask & 4) {
+ Ref<InputEventMouseMotion> mm = p_event;
+ if (mm.is_valid() && mm->get_button_mask() & 4) {
- ofs_y -= p_event.mouse_motion.relative_y / 200.0;
- ofs_x += p_event.mouse_motion.relative_x / 200.0;
+ ofs_y -= mm->get_relative().y / 200.0;
+ ofs_x += mm->get_relative().x / 200.0;
}
- if (p_event.type == InputEvent::MOUSE_MOTION && p_event.mouse_motion.button_mask & 1) {
+ if (mm.is_valid() && mm->get_button_mask() & 1) {
- float y = -p_event.mouse_motion.relative_y / 20.0;
- float x = p_event.mouse_motion.relative_x / 20.0;
+ float y = -mm->get_relative().y / 20.0;
+ float x = mm->get_relative().x / 20.0;
if (mover.is_valid()) {
@@ -284,19 +286,6 @@ public:
ps->body_set_state(mover, PhysicsServer::BODY_STATE_TRANSFORM, t);
}
}
-
- if (p_event.type == InputEvent::JOYPAD_MOTION) {
-
- if (p_event.joy_motion.axis == 0) {
-
- joy_direction.x = p_event.joy_motion.axis_value;
- };
-
- if (p_event.joy_motion.axis == 1) {
-
- joy_direction.y = p_event.joy_motion.axis_value;
- };
- };
}
virtual void request_quit() {
diff --git a/main/tests/test_physics.h b/main/tests/test_physics.h
index a0dc15e421..9c9f2fa883 100644
--- a/main/tests/test_physics.h
+++ b/main/tests/test_physics.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 8818c4b595..2c9b51aadb 100644
--- a/main/tests/test_physics_2d.cpp
+++ b/main/tests/test_physics_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -81,7 +82,7 @@ class TestPhysics2DMainLoop : public MainLoop {
}
}
- Image image(32, 2, 0, Image::FORMAT_LA8, pixels);
+ Ref<Image> image = memnew(Image(32, 2, 0, Image::FORMAT_LA8, pixels));
body_shape_data[Physics2DServer::SHAPE_SEGMENT].image = vs->texture_create_from_image(image);
@@ -108,7 +109,7 @@ class TestPhysics2DMainLoop : public MainLoop {
}
}
- Image image(32, 32, 0, Image::FORMAT_LA8, pixels);
+ Ref<Image> image = memnew(Image(32, 32, 0, Image::FORMAT_LA8, pixels));
body_shape_data[Physics2DServer::SHAPE_CIRCLE].image = vs->texture_create_from_image(image);
@@ -135,7 +136,7 @@ class TestPhysics2DMainLoop : public MainLoop {
}
}
- Image image(32, 32, 0, Image::FORMAT_LA8, pixels);
+ Ref<Image> image = memnew(Image(32, 32, 0, Image::FORMAT_LA8, pixels));
body_shape_data[Physics2DServer::SHAPE_RECTANGLE].image = vs->texture_create_from_image(image);
@@ -163,7 +164,7 @@ class TestPhysics2DMainLoop : public MainLoop {
}
}
- Image image(32, 64, 0, Image::FORMAT_LA8, pixels);
+ Ref<Image> image = memnew(Image(32, 64, 0, Image::FORMAT_LA8, pixels));
body_shape_data[Physics2DServer::SHAPE_CAPSULE].image = vs->texture_create_from_image(image);
@@ -177,7 +178,7 @@ class TestPhysics2DMainLoop : public MainLoop {
{
- Image image(convex_png);
+ Ref<Image> image = memnew(Image(convex_png));
body_shape_data[Physics2DServer::SHAPE_CONVEX_POLYGON].image = vs->texture_create_from_image(image);
@@ -207,35 +208,36 @@ class TestPhysics2DMainLoop : public MainLoop {
}
protected:
- void input_event(const InputEvent &p_event) {
+ void input_event(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::MOUSE_BUTTON) {
+ Ref<InputEventMouseButton> mb = p_event;
- const InputEventMouseButton &mb = p_event.mouse_button;
+ if (mb.is_valid()) {
- if (mb.pressed) {
+ if (mb->is_pressed()) {
- Point2 p(mb.x, mb.y);
+ Point2 p(mb->get_position().x, mb->get_position().y);
- if (mb.button_index == 1) {
+ if (mb->get_button_index() == 1) {
ray_to = p;
_do_ray_query();
- } else if (mb.button_index == 2) {
+ } else if (mb->get_button_index() == 2) {
ray_from = p;
_do_ray_query();
}
}
}
- if (p_event.type == InputEvent::MOUSE_MOTION) {
- const InputEventMouseMotion &mm = p_event.mouse_motion;
+ Ref<InputEventMouseMotion> mm = p_event;
- Point2 p(mm.x, mm.y);
+ if (mm.is_valid()) {
- if (mm.button_mask & BUTTON_MASK_LEFT) {
+ Point2 p = mm->get_position();
+
+ if (mm->get_button_mask() & BUTTON_MASK_LEFT) {
ray_to = p;
_do_ray_query();
- } else if (mm.button_mask & BUTTON_MASK_RIGHT) {
+ } else if (mm->get_button_mask() & BUTTON_MASK_RIGHT) {
ray_from = p;
_do_ray_query();
}
diff --git a/main/tests/test_physics_2d.h b/main/tests/test_physics_2d.h
index 883bf15201..e2022cb1f9 100644
--- a/main/tests/test_physics_2d.h
+++ b/main/tests/test_physics_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 188d736ff6..74f7453d1b 100644
--- a/main/tests/test_render.cpp
+++ b/main/tests/test_render.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -63,9 +64,9 @@ class TestMainLoop : public MainLoop {
protected:
public:
- virtual void input_event(const InputEvent &p_event) {
+ virtual void input_event(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::KEY && p_event.key.pressed)
+ if (p_event->is_pressed())
quit = true;
}
diff --git a/main/tests/test_render.h b/main/tests/test_render.h
index 1dbf3c7f29..d7849c45ca 100644
--- a/main/tests/test_render.h
+++ b/main/tests/test_render.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 4ca09fe656..dc581a71e2 100644
--- a/main/tests/test_shader_lang.cpp
+++ b/main/tests/test_shader_lang.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -323,8 +324,10 @@ MainLoop *test() {
Set<String> rm;
rm.insert("popo");
+ Set<String> types;
+ types.insert("spatial");
- Error err = sl.compile(code, dt, rm);
+ Error err = sl.compile(code, dt, rm, types);
if (err) {
diff --git a/main/tests/test_shader_lang.h b/main/tests/test_shader_lang.h
index 3a3797ecdc..7d871b72e7 100644
--- a/main/tests/test_shader_lang.h
+++ b/main/tests/test_shader_lang.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 9683faf1e5..d8737f6c8d 100644
--- a/main/tests/test_sound.cpp
+++ b/main/tests/test_sound.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 1246e3b9c5..f55f25fa18 100644
--- a/main/tests/test_sound.h
+++ b/main/tests/test_sound.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 41ec113845..5531b71c96 100644
--- a/main/tests/test_string.cpp
+++ b/main/tests/test_string.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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.h b/main/tests/test_string.h
index c8116a0c53..1060adbc8d 100644
--- a/main/tests/test_string.h
+++ b/main/tests/test_string.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/methods.py b/methods.py
index 03216fb58b..30a1f3caed 100644
--- a/methods.py
+++ b/methods.py
@@ -29,7 +29,7 @@ def build_shader_header(target, source, env):
name = name.replace(".", "_")
fs = open(str(x), "r")
- fd = open(str(x) + ".h", "w")
+ fd = open(str(x) + ".gen.h", "w")
fd.write("/* this file has been generated by SCons, do not edit! */\n")
fd.write("static const char *" + name + "=\n")
line = fs.readline()
@@ -192,7 +192,7 @@ def build_glsl_header(filename):
fs.close()
- out_file = filename + ".h"
+ out_file = filename + ".gen.h"
fd = open(out_file, "w")
fd.write("/* WARNING, THIS FILE WAS GENERATED, DO NOT EDIT */\n")
@@ -244,6 +244,7 @@ def build_glsl_header(filename):
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Color& p_color) { _FU GLfloat col[4]={p_color.r,p_color.g,p_color.b,p_color.a}; glUniform4fv(get_uniform(p_uniform),1,col); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Vector2& p_vec2) { _FU GLfloat vec2[2]={p_vec2.x,p_vec2.y}; glUniform2fv(get_uniform(p_uniform),1,vec2); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Vector3& p_vec3) { _FU GLfloat vec3[3]={p_vec3.x,p_vec3.y,p_vec3.z}; glUniform3fv(get_uniform(p_uniform),1,vec3); }\n\n")
+ fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Plane& p_plane) { _FU GLfloat plane[4]={p_plane.normal.x,p_plane.normal.y,p_plane.normal.z,p_plane.d}; glUniform4fv(get_uniform(p_uniform),1,plane); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_a, float p_b) { _FU glUniform2f(get_uniform(p_uniform),p_a,p_b); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_a, float p_b, float p_c) { _FU glUniform3f(get_uniform(p_uniform),p_a,p_b,p_c); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_a, float p_b, float p_c, float p_d) { _FU glUniform4f(get_uniform(p_uniform),p_a,p_b,p_c,p_d); }\n\n")
@@ -486,7 +487,7 @@ def build_hlsl_dx9_header(filename):
fs.close()
- out_file = filename + ".h"
+ out_file = filename + ".gen.h"
fd = open(out_file, "w")
fd.write("/* WARNING, THIS FILE WAS GENERATED, DO NOT EDIT */\n")
@@ -843,7 +844,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs):
header_data = LegacyGLHeaderStruct()
include_file_in_legacygl_header(filename, header_data, 0)
- out_file = filename + ".h"
+ out_file = filename + ".gen.h"
fd = open(out_file, "w")
enum_constants = []
@@ -858,7 +859,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs):
fd.write("#ifndef " + out_file_ifdef + class_suffix + "_120\n")
fd.write("#define " + out_file_ifdef + class_suffix + "_120\n")
- out_file_class = out_file_base.replace(".glsl.h", "").title().replace("_", "").replace(".", "") + "Shader" + class_suffix
+ out_file_class = out_file_base.replace(".glsl.gen.h", "").title().replace("_", "").replace(".", "") + "Shader" + class_suffix
fd.write("\n\n")
fd.write("#include \"" + include + "\"\n\n\n")
fd.write("class " + out_file_class + " : public Shader" + class_suffix + " {\n\n")
@@ -1165,7 +1166,7 @@ def update_version():
print("Using custom revision: " + rev)
import version
- f = open("core/version.h", "wb")
+ f = open("core/version_generated.gen.h", "wb")
f.write("#define VERSION_SHORT_NAME " + str(version.short_name) + "\n")
f.write("#define VERSION_NAME " + str(version.name) + "\n")
f.write("#define VERSION_MAJOR " + str(version.major) + "\n")
@@ -1176,6 +1177,20 @@ def update_version():
f.write("#define VERSION_STATUS " + str(version.status) + "\n")
import datetime
f.write("#define VERSION_YEAR " + str(datetime.datetime.now().year) + "\n")
+ f.close()
+
+ fhash = open("core/version_hash.gen.h", "wb")
+ githash = ""
+ if os.path.isfile(".git/HEAD"):
+ head = open(".git/HEAD", "rb").readline().strip()
+ if head.startswith("ref: "):
+ head = ".git/" + head[5:]
+ if os.path.isfile(head):
+ githash = open(head, "rb").readline().strip()
+ else:
+ githash = head
+ fhash.write("#define VERSION_HASH \"" + githash + "\"")
+ fhash.close()
def parse_cg_file(fname, uniforms, sizes, conditionals):
@@ -1224,7 +1239,7 @@ def build_cg_shader(sname):
parse_cg_file("fp_" + sname + ".cg", fp_uniforms, fp_uniform_sizes, fp_conditionals)
- fd = open("shader_" + sname + ".cg.h", "w")
+ fd = open("shader_" + sname + ".cg.gen.h", "w")
fd.write('\n#include "shader_cell.h"\n')
fd.write("\nclass Shader_" + sname + " : public ShaderCell {\n")
@@ -1299,7 +1314,7 @@ void unregister_module_types() {
"""
- f = open("modules/register_module_types.cpp", "wb")
+ f = open("modules/register_module_types.gen.cpp", "wb")
f.write(modules_cpp)
return module_list
@@ -1353,66 +1368,64 @@ def win32_spawn(sh, escape, cmd, args, spawnenv):
return exit_code
"""
-
def android_add_maven_repository(self, url):
- self.android_maven_repos.append(url)
-
+ if (url not in self.android_maven_repos):
+ self.android_maven_repos.append(url)
def android_add_dependency(self, depline):
- self.android_dependencies.append(depline)
-
+ if (depline not in self.android_dependencies):
+ self.android_dependencies.append(depline)
def android_add_java_dir(self, subpath):
base_path = self.Dir(".").abspath + "/modules/" + self.current_module + "/" + subpath
- self.android_java_dirs.append(base_path)
-
+ if (base_path not in self.android_java_dirs):
+ self.android_java_dirs.append(base_path)
def android_add_res_dir(self, subpath):
base_path = self.Dir(".").abspath + "/modules/" + self.current_module + "/" + subpath
- self.android_res_dirs.append(base_path)
-
+ if (base_path not in self.android_res_dirs):
+ self.android_res_dirs.append(base_path)
def android_add_aidl_dir(self, subpath):
base_path = self.Dir(".").abspath + "/modules/" + self.current_module + "/" + subpath
- self.android_aidl_dirs.append(base_path)
-
+ if (base_path not in self.android_aidl_dirs):
+ self.android_aidl_dirs.append(base_path)
def android_add_jni_dir(self, subpath):
base_path = self.Dir(".").abspath + "/modules/" + self.current_module + "/" + subpath
- self.android_jni_dirs.append(base_path)
+ if (base_path not in self.android_jni_dirs):
+ self.android_jni_dirs.append(base_path)
def android_add_gradle_plugin(self, plugin):
- self.android_gradle_plugins.append(plugin)
+ if (plugin not in self.android_gradle_plugins):
+ self.android_gradle_plugins.append(plugin)
def android_add_gradle_classpath(self, classpath):
- self.android_gradle_classpath.append(classpath)
+ if (classpath not in self.android_gradle_classpath):
+ self.android_gradle_classpath.append(classpath)
def android_add_default_config(self, config):
- self.android_default_config.append(config)
-
+ if (config not in self.android_default_config):
+ self.android_default_config.append(config)
def android_add_to_manifest(self, file):
base_path = self.Dir(".").abspath + "/modules/" + self.current_module + "/" + file
f = open(base_path, "rb")
self.android_manifest_chunk += f.read()
-
def android_add_to_permissions(self, file):
base_path = self.Dir(".").abspath + "/modules/" + self.current_module + "/" + file
f = open(base_path, "rb")
self.android_permission_chunk += f.read()
-
def android_add_to_attributes(self, file):
base_path = self.Dir(".").abspath + "/modules/" + self.current_module + "/" + file
f = open(base_path, "rb")
self.android_appattributes_chunk += f.read()
-
def disable_module(self):
self.disabled_modules.append(self.current_module)
-
def use_windows_spawn_fix(self, platform=None):
if (os.name != "nt"):
@@ -1515,23 +1528,26 @@ def split_lib(self, libname):
def save_active_platforms(apnames, ap):
for x in ap:
- pth = x + "/logo.png"
-# print("open path: "+pth)
- pngf = open(pth, "rb")
- b = pngf.read(1)
- str = " /* AUTOGENERATED FILE, DO NOT EDIT */ \n"
- str += " static const unsigned char _" + x[9:] + "_logo[]={"
- while(len(b) == 1):
- str += hex(ord(b))
+ names = ['logo']
+ if os.path.isfile(x + "/run_icon.png"):
+ names.append('run_icon')
+
+ for name in names:
+ pngf = open(x + "/" + name + ".png", "rb")
b = pngf.read(1)
- if (len(b) == 1):
- str += ","
+ str = " /* AUTOGENERATED FILE, DO NOT EDIT */ \n"
+ str += " static const unsigned char _" + x[9:] + "_" + name + "[]={"
+ while(len(b) == 1):
+ str += hex(ord(b))
+ b = pngf.read(1)
+ if (len(b) == 1):
+ str += ","
- str += "};\n"
+ str += "};\n"
- wf = x + "/logo.h"
- logow = open(wf, "wb")
- logow.write(str)
+ wf = x + "/" + name + ".gen.h"
+ pngw = open(wf, "wb")
+ pngw.write(str)
def no_verbose(sys, env):
@@ -1596,34 +1612,69 @@ def detect_visual_c_compiler_version(tools_env):
vc_chosen_compiler_index = -1
vc_chosen_compiler_str = ""
- # find() works with -1 so big ifs bellow are needed... the simplest solution, in fact
- # First test if amd64 and amd64_x86 compilers are present in the path
- vc_amd64_compiler_detection_index = tools_env["PATH"].find(tools_env["VCINSTALLDIR"] + "BIN\\amd64;")
- if(vc_amd64_compiler_detection_index > -1):
- vc_chosen_compiler_index = vc_amd64_compiler_detection_index
- vc_chosen_compiler_str = "amd64"
-
- vc_amd64_x86_compiler_detection_index = tools_env["PATH"].find(tools_env["VCINSTALLDIR"] + "BIN\\amd64_x86;")
- if(vc_amd64_x86_compiler_detection_index > -1
- and (vc_chosen_compiler_index == -1
- or vc_chosen_compiler_index > vc_amd64_x86_compiler_detection_index)):
- vc_chosen_compiler_index = vc_amd64_x86_compiler_detection_index
- vc_chosen_compiler_str = "amd64_x86"
-
- # Now check the 32 bit compilers
- vc_x86_compiler_detection_index = tools_env["PATH"].find(tools_env["VCINSTALLDIR"] + "BIN;")
- if(vc_x86_compiler_detection_index > -1
- and (vc_chosen_compiler_index == -1
- or vc_chosen_compiler_index > vc_x86_compiler_detection_index)):
- vc_chosen_compiler_index = vc_x86_compiler_detection_index
- vc_chosen_compiler_str = "x86"
-
- vc_x86_amd64_compiler_detection_index = tools_env["PATH"].find(tools_env['VCINSTALLDIR'] + "BIN\\x86_amd64;")
- if(vc_x86_amd64_compiler_detection_index > -1
- and (vc_chosen_compiler_index == -1
- or vc_chosen_compiler_index > vc_x86_amd64_compiler_detection_index)):
- vc_chosen_compiler_index = vc_x86_amd64_compiler_detection_index
- vc_chosen_compiler_str = "x86_amd64"
+ # Start with Pre VS 2017 checks which uses VCINSTALLDIR:
+ if 'VCINSTALLDIR' in tools_env:
+ # print "Checking VCINSTALLDIR"
+
+ # find() works with -1 so big ifs bellow are needed... the simplest solution, in fact
+ # First test if amd64 and amd64_x86 compilers are present in the path
+ vc_amd64_compiler_detection_index = tools_env["PATH"].find(tools_env["VCINSTALLDIR"] + "BIN\\amd64;")
+ if(vc_amd64_compiler_detection_index > -1):
+ vc_chosen_compiler_index = vc_amd64_compiler_detection_index
+ vc_chosen_compiler_str = "amd64"
+
+ vc_amd64_x86_compiler_detection_index = tools_env["PATH"].find(tools_env["VCINSTALLDIR"] + "BIN\\amd64_x86;")
+ if(vc_amd64_x86_compiler_detection_index > -1
+ and (vc_chosen_compiler_index == -1
+ or vc_chosen_compiler_index > vc_amd64_x86_compiler_detection_index)):
+ vc_chosen_compiler_index = vc_amd64_x86_compiler_detection_index
+ vc_chosen_compiler_str = "amd64_x86"
+
+ # Now check the 32 bit compilers
+ vc_x86_compiler_detection_index = tools_env["PATH"].find(tools_env["VCINSTALLDIR"] + "BIN;")
+ if(vc_x86_compiler_detection_index > -1
+ and (vc_chosen_compiler_index == -1
+ or vc_chosen_compiler_index > vc_x86_compiler_detection_index)):
+ vc_chosen_compiler_index = vc_x86_compiler_detection_index
+ vc_chosen_compiler_str = "x86"
+
+ vc_x86_amd64_compiler_detection_index = tools_env["PATH"].find(tools_env['VCINSTALLDIR'] + "BIN\\x86_amd64;")
+ if(vc_x86_amd64_compiler_detection_index > -1
+ and (vc_chosen_compiler_index == -1
+ or vc_chosen_compiler_index > vc_x86_amd64_compiler_detection_index)):
+ vc_chosen_compiler_index = vc_x86_amd64_compiler_detection_index
+ vc_chosen_compiler_str = "x86_amd64"
+
+ # and for VS 2017 and newer we check VCTOOLSINSTALLDIR:
+ if 'VCTOOLSINSTALLDIR' in tools_env:
+ # print "Checking VCTOOLSINSTALLDIR"
+
+ # Newer versions have a different path available
+ vc_amd64_compiler_detection_index = tools_env["PATH"].upper().find(tools_env['VCTOOLSINSTALLDIR'].upper() + "BIN\\HOSTX64\\X64;")
+ if(vc_amd64_compiler_detection_index > -1):
+ vc_chosen_compiler_index = vc_amd64_compiler_detection_index
+ vc_chosen_compiler_str = "amd64"
+
+ vc_amd64_x86_compiler_detection_index = tools_env["PATH"].upper().find(tools_env['VCTOOLSINSTALLDIR'].upper() + "BIN\\HOSTX64\\X86;")
+ if(vc_amd64_x86_compiler_detection_index > -1
+ and (vc_chosen_compiler_index == -1
+ or vc_chosen_compiler_index > vc_amd64_x86_compiler_detection_index)):
+ vc_chosen_compiler_index = vc_amd64_x86_compiler_detection_index
+ vc_chosen_compiler_str = "amd64_x86"
+
+ vc_x86_compiler_detection_index = tools_env["PATH"].upper().find(tools_env['VCTOOLSINSTALLDIR'].upper() + "BIN\\HOSTX86\\X86;")
+ if(vc_x86_compiler_detection_index > -1
+ and (vc_chosen_compiler_index == -1
+ or vc_chosen_compiler_index > vc_x86_compiler_detection_index)):
+ vc_chosen_compiler_index = vc_x86_compiler_detection_index
+ vc_chosen_compiler_str = "x86"
+
+ vc_x86_amd64_compiler_detection_index = tools_env["PATH"].upper().find(tools_env['VCTOOLSINSTALLDIR'].upper() + "BIN\\HOSTX86\\X64;")
+ if(vc_x86_amd64_compiler_detection_index > -1
+ and (vc_chosen_compiler_index == -1
+ or vc_chosen_compiler_index > vc_x86_amd64_compiler_detection_index)):
+ vc_chosen_compiler_index = vc_x86_amd64_compiler_detection_index
+ vc_chosen_compiler_str = "x86_amd64"
# debug help
# print vc_amd64_compiler_detection_index
diff --git a/misc/dist/html_fs/godotfs.js b/misc/dist/html_fs/godotfs.js
index 2c59344cf5..676ee689fb 100644
--- a/misc/dist/html_fs/godotfs.js
+++ b/misc/dist/html_fs/godotfs.js
@@ -8,6 +8,8 @@ if (!Module.expectedDataFileDownloads) {
Module.expectedDataFileDownloads++;
(function() {
+ const PACK_FILE_NAME = '$GODOT_PACK_NAME';
+ const PACK_FILE_SIZE = $GODOT_PACK_SIZE;
function fetchRemotePackage(packageName, callback, errback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', packageName, true);
@@ -52,7 +54,7 @@ Module.expectedDataFileDownloads++;
};
var fetched = null, fetchedCallback = null;
- fetchRemotePackage('data.pck', function(data) {
+ fetchRemotePackage(PACK_FILE_NAME, function(data) {
if (fetchedCallback) {
fetchedCallback(data);
fetchedCallback = null;
@@ -101,7 +103,7 @@ function assert(check, msg) {
this.requests[this.name] = null;
},
};
- new DataRequest(0, $DPLEN, 0, 0).open('GET', '/data.pck');
+ new DataRequest(0, PACK_FILE_SIZE, 0, 0).open('GET', '/' + PACK_FILE_NAME);
var PACKAGE_PATH;
if (typeof window === 'object') {
@@ -110,8 +112,8 @@ function assert(check, msg) {
// worker
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
}
- var PACKAGE_NAME = 'data.pck';
- var REMOTE_PACKAGE_NAME = 'data.pck';
+ var PACKAGE_NAME = PACK_FILE_NAME;
+ var REMOTE_PACKAGE_NAME = PACK_FILE_NAME;
var PACKAGE_UUID = 'b39761ce-0348-4959-9b16-302ed8e1592e';
function processPackageData(arrayBuffer) {
@@ -122,7 +124,7 @@ function assert(check, msg) {
// Reuse the bytearray from the XHR as the source for file reads.
DataRequest.prototype.byteArray = byteArray;
- DataRequest.prototype.requests["/data.pck"].onload();
+ DataRequest.prototype.requests['/' + PACK_FILE_NAME].onload();
Module['removeRunDependency']('datafile_datapack');
};
diff --git a/misc/dist/ios_xcode/godot_xcode/data.pck b/misc/dist/ios_xcode/data.pck
index e69de29bb2..e69de29bb2 100644
--- a/misc/dist/ios_xcode/godot_xcode/data.pck
+++ b/misc/dist/ios_xcode/data.pck
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_debug.iphone b/misc/dist/ios_xcode/godot_debug.iphone
index e69de29bb2..e69de29bb2 100755
--- a/misc/dist/ios_xcode/godot_xcode/godot_debug.iphone
+++ b/misc/dist/ios_xcode/godot_debug.iphone
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
index bdba8488c8..bdba8488c8 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.pbxproj
+++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata
index 3c9ba38bbe..3c9ba38bbe 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-568h@2x~iphone.png b/misc/dist/ios_xcode/godot_ios/Default-568h@2x~iphone.png
index 1d5e472665..1d5e472665 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-568h@2x~iphone.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-568h@2x~iphone.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h.png b/misc/dist/ios_xcode/godot_ios/Default-667h.png
index b13a399c83..b13a399c83 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-667h.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h@2x.png b/misc/dist/ios_xcode/godot_ios/Default-667h@2x.png
index b51598fed0..b51598fed0 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h@2x.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-667h@2x.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h.png b/misc/dist/ios_xcode/godot_ios/Default-736h.png
index 8c44edbccd..8c44edbccd 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-736h.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h@3x.png b/misc/dist/ios_xcode/godot_ios/Default-736h@3x.png
index 33847ac136..33847ac136 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h@3x.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-736h@3x.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape-736h.png b/misc/dist/ios_xcode/godot_ios/Default-Landscape-736h.png
index 2a025b745b..2a025b745b 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape-736h.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-Landscape-736h.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape@2x~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Landscape@2x~ipad.png
index 7099f3e18d..7099f3e18d 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape@2x~ipad.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-Landscape@2x~ipad.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Landscape~ipad.png
index 4a761c339a..4a761c339a 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape~ipad.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-Landscape~ipad.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait@2x~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x~ipad.png
index b09cf21186..b09cf21186 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait@2x~ipad.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x~ipad.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait~ipad.png
index fa698eb70c..fa698eb70c 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait~ipad.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-Portrait~ipad.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default@2x~iphone.png b/misc/dist/ios_xcode/godot_ios/Default@2x~iphone.png
index ddf2861f4d..ddf2861f4d 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default@2x~iphone.png
+++ b/misc/dist/ios_xcode/godot_ios/Default@2x~iphone.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default~iphone.png b/misc/dist/ios_xcode/godot_ios/Default~iphone.png
index c485a33b03..c485a33b03 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Default~iphone.png
+++ b/misc/dist/ios_xcode/godot_ios/Default~iphone.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json
index a458b67873..a458b67873 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png
index 165f4423b3..165f4423b3 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png
index 2e205e920c..2e205e920c 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png
index 6245f83f48..6245f83f48 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png
index 7b24e01bc6..7b24e01bc6 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png
index 344b470fa3..344b470fa3 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png
index 0dcebbc3f2..0dcebbc3f2 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png
index 9ae94e9aaf..9ae94e9aaf 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png
index 569f24df91..569f24df91 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png
index 9e69ed3121..9e69ed3121 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png
index b970fa3067..b970fa3067 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png
index 6097a6c73b..6097a6c73b 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png
index 21b9622eb6..21b9622eb6 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png
index 34dea8e6ad..34dea8e6ad 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png
index f72eb0b345..f72eb0b345 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png
index 793c9b1f5f..793c9b1f5f 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png
index 7cd0e054ab..7cd0e054ab 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png
index e9b2429754..e9b2429754 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes
index e328a62cb6..e328a62cb6 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes
+++ b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/en.lproj/InfoPlist.strings b/misc/dist/ios_xcode/godot_ios/en.lproj/InfoPlist.strings
index 477b28ff8f..477b28ff8f 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/en.lproj/InfoPlist.strings
+++ b/misc/dist/ios_xcode/godot_ios/en.lproj/InfoPlist.strings
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/godot_ios-Info.plist b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist
index f97b0fca36..f97b0fca36 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/godot_ios-Info.plist
+++ b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_ios/main.m b/misc/dist/ios_xcode/godot_ios/main.m
index 88b8e60670..ad53cf7fea 100644
--- a/misc/dist/ios_xcode/godot_xcode/godot_ios/main.m
+++ b/misc/dist/ios_xcode/godot_ios/main.m
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,9 +32,8 @@
#import "AppDelegate.h"
-int main(int argc, char * argv[])
-{
- @autoreleasepool {
- return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
- }
+int main(int argc, char *argv[]) {
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
}
diff --git a/misc/dist/ios_xcode/godot_xcode/godot_opt.iphone b/misc/dist/ios_xcode/godot_opt.iphone
index e69de29bb2..e69de29bb2 100755
--- a/misc/dist/ios_xcode/godot_xcode/godot_opt.iphone
+++ b/misc/dist/ios_xcode/godot_opt.iphone
diff --git a/misc/dist/osx_template.app/Contents/Resources/icon.icns b/misc/dist/osx_template.app/Contents/Resources/icon.icns
index 375f61437d..be9254630c 100644
--- a/misc/dist/osx_template.app/Contents/Resources/icon.icns
+++ b/misc/dist/osx_template.app/Contents/Resources/icon.icns
Binary files differ
diff --git a/misc/dist/osx_tools.app/Contents/Resources/Godot.icns b/misc/dist/osx_tools.app/Contents/Resources/Godot.icns
index 375f61437d..be9254630c 100644
--- a/misc/dist/osx_tools.app/Contents/Resources/Godot.icns
+++ b/misc/dist/osx_tools.app/Contents/Resources/Godot.icns
Binary files differ
diff --git a/misc/dist/project_icon.svg b/misc/dist/project_icon.svg
new file mode 100644
index 0000000000..650c71fd12
--- /dev/null
+++ b/misc/dist/project_icon.svg
@@ -0,0 +1,138 @@
+<?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="1024"
+ height="1024"
+ id="svg3030"
+ version="1.1"
+ inkscape:version="0.92.1 r15371"
+ sodipodi:docname="icon_default_project_icon.svg"
+ inkscape:export-filename="/home/akien/Projects/godot/godot.git/icon3.png"
+ inkscape:export-xdpi="6"
+ inkscape:export-ydpi="6">
+ <defs
+ id="defs3032" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.5"
+ inkscape:cx="601.35476"
+ inkscape:cy="346.09731"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1920"
+ inkscape:window-height="1011"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata3035">
+ <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,-98.519719)">
+ <rect
+ style="fill:#1e1a21;fill-opacity:1;stroke:#2e2832;stroke-width:16;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect33"
+ width="1008"
+ height="1008"
+ x="8"
+ y="106.51972"
+ rx="176.28572"
+ ry="176.28572" />
+ <g
+ id="g82-3"
+ transform="matrix(4.2343801,0,0,-4.2343764,97.676491,522.86238)"
+ style="stroke-width:0.31488276">
+ <path
+ d="m 0,0 v -47.514 -6.035 -5.492 c 0.108,-0.001 0.216,-0.005 0.323,-0.015 l 36.196,-3.49 c 1.896,-0.183 3.382,-1.709 3.514,-3.609 l 1.116,-15.978 31.574,-2.253 2.175,14.747 c 0.282,1.912 1.922,3.329 3.856,3.329 h 38.188 c 1.933,0 3.573,-1.417 3.855,-3.329 l 2.175,-14.747 31.575,2.253 1.115,15.978 c 0.133,1.9 1.618,3.425 3.514,3.609 l 36.182,3.49 c 0.107,0.01 0.214,0.014 0.322,0.015 v 4.711 l 0.015,0.005 V 0 h 0.134 c 4.795,6.12 9.232,12.569 13.487,19.449 -5.651,9.62 -12.575,18.217 -19.976,26.182 -6.864,-3.455 -13.531,-7.369 -19.828,-11.534 -3.151,3.132 -6.7,5.694 -10.186,8.372 -3.425,2.751 -7.285,4.768 -10.946,7.118 1.09,8.117 1.629,16.108 1.846,24.448 -9.446,4.754 -19.519,7.906 -29.708,10.17 -4.068,-6.837 -7.788,-14.241 -11.028,-21.479 -3.842,0.642 -7.702,0.88 -11.567,0.926 v 0.006 c -0.027,0 -0.052,-0.006 -0.075,-0.006 -0.024,0 -0.049,0.006 -0.073,0.006 V 63.652 C 93.903,63.606 90.046,63.368 86.203,62.726 82.965,69.964 79.247,77.368 75.173,84.205 64.989,81.941 54.915,78.789 45.47,74.035 45.686,65.695 46.225,57.704 47.318,49.587 43.65,47.237 39.795,45.22 36.369,42.469 32.888,39.791 29.333,37.229 26.181,34.097 19.884,38.262 13.219,42.176 6.353,45.631 -1.048,37.666 -7.968,29.069 -13.621,19.449 -9.368,12.569 -4.928,6.12 -0.134,0 Z"
+ style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.31488276"
+ id="path84-6"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g86-7"
+ transform="matrix(4.2343801,0,0,-4.2343764,788.7623,819.22103)"
+ style="stroke-width:0.31488276">
+ <path
+ d="m 0,0 -1.121,-16.063 c -0.135,-1.936 -1.675,-3.477 -3.611,-3.616 l -38.555,-2.751 c -0.094,-0.007 -0.188,-0.01 -0.281,-0.01 -1.916,0 -3.569,1.406 -3.852,3.33 l -2.211,14.994 H -81.09 l -2.211,-14.994 c -0.297,-2.018 -2.101,-3.469 -4.133,-3.32 l -38.555,2.751 c -1.936,0.139 -3.476,1.68 -3.611,3.616 L -130.721,0 -163.268,3.138 c 0.015,-3.498 0.06,-7.33 0.06,-8.093 0,-34.374 43.605,-50.896 97.781,-51.086 h 0.066 0.067 c 54.176,0.19 97.766,16.712 97.766,51.086 0,0.777 0.047,4.593 0.063,8.093 z"
+ style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.31488276"
+ id="path88-5"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g90-3"
+ transform="matrix(4.2343801,0,0,-4.2343764,387.09785,624.34645)"
+ style="stroke-width:0.31488276">
+ <path
+ d="m 0,0 c 0,-12.052 -9.765,-21.815 -21.813,-21.815 -12.042,0 -21.81,9.763 -21.81,21.815 0,12.044 9.768,21.802 21.81,21.802 C -9.765,21.802 0,12.044 0,0"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.31488276"
+ id="path92-5"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g94-6"
+ transform="matrix(4.2343801,0,0,-4.2343764,364.87318,629.82505)"
+ style="stroke-width:0.31488276">
+ <path
+ d="m 0,0 c 0,-7.994 -6.479,-14.473 -14.479,-14.473 -7.996,0 -14.479,6.479 -14.479,14.473 0,7.994 6.483,14.479 14.479,14.479 C -6.479,14.479 0,7.994 0,0"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.31488276"
+ id="path96-2"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g98-9"
+ transform="matrix(4.2343801,0,0,-4.2343764,511.99324,725.12292)"
+ style="stroke-width:0.31488276">
+ <path
+ d="m 0,0 c -3.878,0 -7.021,2.858 -7.021,6.381 v 20.081 c 0,3.52 3.143,6.381 7.021,6.381 3.878,0 7.028,-2.861 7.028,-6.381 V 6.381 C 7.028,2.858 3.878,0 0,0"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.31488276"
+ id="path100-1"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g102-2"
+ transform="matrix(4.2343801,0,0,-4.2343764,636.90407,624.34645)"
+ style="stroke-width:0.31488276">
+ <path
+ d="m 0,0 c 0,-12.052 9.765,-21.815 21.815,-21.815 12.041,0 21.808,9.763 21.808,21.815 0,12.044 -9.767,21.802 -21.808,21.802 C 9.765,21.802 0,12.044 0,0"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.31488276"
+ id="path104-7"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g106-0"
+ transform="matrix(4.2343801,0,0,-4.2343764,659.13434,629.82505)"
+ style="stroke-width:0.31488276">
+ <path
+ d="m 0,0 c 0,-7.994 6.477,-14.473 14.471,-14.473 8.002,0 14.479,6.479 14.479,14.473 0,7.994 -6.477,14.479 -14.479,14.479 C 6.477,14.479 0,7.994 0,0"
+ style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.31488276"
+ id="path108-9"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+</svg>
diff --git a/misc/dist/uwp_template/Assets/Square150x150Logo.scale-100.png b/misc/dist/uwp_template/Assets/Square150x150Logo.scale-100.png
index 6cff663eb5..6e307e5eb8 100644
--- a/misc/dist/uwp_template/Assets/Square150x150Logo.scale-100.png
+++ b/misc/dist/uwp_template/Assets/Square150x150Logo.scale-100.png
Binary files differ
diff --git a/misc/dist/uwp_template/Assets/Square310x310Logo.scale-100.png b/misc/dist/uwp_template/Assets/Square310x310Logo.scale-100.png
index 12ec232c87..cb2516d7a0 100644
--- a/misc/dist/uwp_template/Assets/Square310x310Logo.scale-100.png
+++ b/misc/dist/uwp_template/Assets/Square310x310Logo.scale-100.png
Binary files differ
diff --git a/misc/dist/uwp_template/Assets/Square44x44Logo.scale-100.png b/misc/dist/uwp_template/Assets/Square44x44Logo.scale-100.png
index ad059994ed..6e14223e87 100644
--- a/misc/dist/uwp_template/Assets/Square44x44Logo.scale-100.png
+++ b/misc/dist/uwp_template/Assets/Square44x44Logo.scale-100.png
Binary files differ
diff --git a/misc/dist/uwp_template/Assets/Square71x71Logo.scale-100.png b/misc/dist/uwp_template/Assets/Square71x71Logo.scale-100.png
index b1bf331365..0d4bd54da8 100644
--- a/misc/dist/uwp_template/Assets/Square71x71Logo.scale-100.png
+++ b/misc/dist/uwp_template/Assets/Square71x71Logo.scale-100.png
Binary files differ
diff --git a/misc/dist/uwp_template/Assets/StoreLogo.scale-100.png b/misc/dist/uwp_template/Assets/StoreLogo.scale-100.png
index 8d7a625c82..1501a09557 100644
--- a/misc/dist/uwp_template/Assets/StoreLogo.scale-100.png
+++ b/misc/dist/uwp_template/Assets/StoreLogo.scale-100.png
Binary files differ
diff --git a/misc/dist/uwp_template/Assets/Wide310x150Logo.scale-100.png b/misc/dist/uwp_template/Assets/Wide310x150Logo.scale-100.png
index b06f1ad50f..593568e980 100644
--- a/misc/dist/uwp_template/Assets/Wide310x150Logo.scale-100.png
+++ b/misc/dist/uwp_template/Assets/Wide310x150Logo.scale-100.png
Binary files differ
diff --git a/misc/hooks/pre-commit-clang-format b/misc/hooks/pre-commit-clang-format
index f7620fe2c5..0971ebe23a 100755
--- a/misc/hooks/pre-commit-clang-format
+++ b/misc/hooks/pre-commit-clang-format
@@ -31,7 +31,7 @@ PARSE_EXTS=true
# File types to parse. Only effective when PARSE_EXTS is true.
# FILE_EXTS=".c .h .cpp .hpp"
-FILE_EXTS=".c .h .cpp .hpp .cc .hh .cxx .m"
+FILE_EXTS=".c .h .cpp .hpp .cc .hh .cxx .m .mm .inc"
# Use pygmentize instead of cat to parse diff with highlighting.
# Install it with `pip install pygments` (Linux) or `easy_install Pygments` (Mac)
@@ -82,6 +82,11 @@ $DELETE_OLD_PATCHES && rm -f /tmp/$prefix*.patch
# create one patch containing all changes to the files
git diff-index --cached --diff-filter=ACMR --name-only $against -- | while read file;
do
+ # ignore thirdparty files
+ if grep -q "thirdparty" <<< $file; then
+ continue;
+ fi
+
# ignore file if we do check for file extensions and the file
# does not match any of the extensions specified in $FILE_EXTS
if $PARSE_EXTS && ! matches_extension "$file"; then
diff --git a/misc/scripts/addheader.py b/misc/scripts/addheader.py
index 056e807c81..acb517b5bd 100644
--- a/misc/scripts/addheader.py
+++ b/misc/scripts/addheader.py
@@ -7,6 +7,7 @@ header = """\
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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/scripts/makeargs.py b/misc/scripts/makeargs.py
index 2cd47ae087..26d9cc5a00 100644
--- a/misc/scripts/makeargs.py
+++ b/misc/scripts/makeargs.py
@@ -2,7 +2,7 @@
text = """
#define FUNC$numR(m_r,m_func,$argt)\\
virtual m_r m_func($argtp) { \\
- if (Thread::get_caller_ID()!=server_thread) {\\
+ if (Thread::get_caller_id()!=server_thread) {\\
m_r ret;\\
command_queue.push_and_ret( visual_server, &VisualServer::m_func,$argp,&ret);\\
return ret;\\
@@ -13,7 +13,7 @@ text = """
#define FUNC$numRC(m_r,m_func,$argt)\\
virtual m_r m_func($argtp) const { \\
- if (Thread::get_caller_ID()!=server_thread) {\\
+ if (Thread::get_caller_id()!=server_thread) {\\
m_r ret;\\
command_queue.push_and_ret( visual_server, &VisualServer::m_func,$argp,&ret);\\
return ret;\\
@@ -25,7 +25,7 @@ text = """
#define FUNC$numS(m_func,$argt)\\
virtual void m_func($argtp) { \\
- if (Thread::get_caller_ID()!=server_thread) {\\
+ if (Thread::get_caller_id()!=server_thread) {\\
command_queue.push_and_sync( visual_server, &VisualServer::m_func,$argp);\\
} else {\\
visual_server->m_func($argp);\\
@@ -34,7 +34,7 @@ text = """
#define FUNC$numSC(m_func,$argt)\\
virtual void m_func($argtp) const { \\
- if (Thread::get_caller_ID()!=server_thread) {\\
+ if (Thread::get_caller_id()!=server_thread) {\\
command_queue.push_and_sync( visual_server, &VisualServer::m_func,$argp);\\
} else {\\
visual_server->m_func($argp);\\
@@ -44,7 +44,7 @@ text = """
#define FUNC$num(m_func,$argt)\\
virtual void m_func($argtp) { \\
- if (Thread::get_caller_ID()!=server_thread) {\\
+ if (Thread::get_caller_id()!=server_thread) {\\
command_queue.push( visual_server, &VisualServer::m_func,$argp);\\
} else {\\
visual_server->m_func($argp);\\
@@ -53,7 +53,7 @@ text = """
#define FUNC$numC(m_func,$argt)\\
virtual void m_func($argtp) const { \\
- if (Thread::get_caller_ID()!=server_thread) {\\
+ if (Thread::get_caller_id()!=server_thread) {\\
command_queue.push( visual_server, &VisualServer::m_func,$argp);\\
} else {\\
visual_server->m_func($argp);\\
diff --git a/misc/scripts/sort-demos.sh b/misc/scripts/sort-demos.sh
index 2121d78c15..5e01b86b46 100644
--- a/misc/scripts/sort-demos.sh
+++ b/misc/scripts/sort-demos.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# When scanning for demos, the project manager sorts them based on their
# timestamp, i.e. last modification date. This can make for a pretty
-# messy output, so this script 'touches' each godot.cfg file in reverse
+# messy output, so this script 'touches' each project.godot file in reverse
# alphabetical order to ensure a nice listing.
#
# It's good practice to run it once before packaging demos on the build
@@ -17,7 +17,7 @@ if [ -e demos.list ]; then
fi
for dir in 2d 3d gui misc viewport; do
- find "demos/$dir" -name "godot.cfg" |sort >> demos.list
+ find "demos/$dir" -name "project.godot" |sort >> demos.list
done
cat demos.list |sort -r > demos_r.list
diff --git a/misc/scripts/svgs_2_pngs.py b/misc/scripts/svgs_2_pngs.py
index b24324dcd7..ff6d6d851f 100644
--- a/misc/scripts/svgs_2_pngs.py
+++ b/misc/scripts/svgs_2_pngs.py
@@ -16,7 +16,7 @@ last_svg_data = None
SCRIPT_FOLDER = dirname(realpath(__file__)) + '/'
theme_dir_base = SCRIPT_FOLDER + '../../scene/resources/default_theme/'
theme_dir_source = theme_dir_base + 'source/'
-icons_dir_base = SCRIPT_FOLDER + '../editor/icons/'
+icons_dir_base = SCRIPT_FOLDER + '../../editor/icons/'
icons_dir_2x = icons_dir_base + '2x/'
icons_dir_source = icons_dir_base + 'source/'
@@ -108,8 +108,10 @@ special_icons = {
theme_output_names=['icon_reload']
),
'icon_multi_edit': dict(output_names=['icon_multi_node_edit']),
+ 'icon_load': dict(
+ output_names=['icon_open']
+ ),
'icon_folder': dict(
- output_names=['icon_load', 'icon_open'],
theme_output_names=['icon_folder']
),
'icon_file_list': dict(output_names=['icon_enum']),
diff --git a/misc/travis/clang-format.sh b/misc/travis/clang-format.sh
index 5ecc1b37d8..741d3bff1b 100755
--- a/misc/travis/clang-format.sh
+++ b/misc/travis/clang-format.sh
@@ -11,7 +11,7 @@ else
RANGE=HEAD
fi
-FILES=$(git diff-tree --no-commit-id --name-only -r $RANGE | grep -v thirdparty/ | grep -e "\.cpp$" -e "\.h$" -e "\.inc$")
+FILES=$(git diff-tree --no-commit-id --name-only -r $RANGE | grep -v thirdparty/ | grep -E "\.(c|h|cpp|hpp|cc|hh|cxx|m|mm|inc)$")
echo "Checking files:\n$FILES"
# create a random filename to store our generated patch
diff --git a/modules/SCsub b/modules/SCsub
index 4b9c08cf78..d1c0cdc05c 100644
--- a/modules/SCsub
+++ b/modules/SCsub
@@ -7,7 +7,7 @@ env_modules = env.Clone()
Export('env_modules')
env.modules_sources = [
- "register_module_types.cpp",
+ "register_module_types.gen.cpp",
]
# env.add_source_files(env.modules_sources,"*.cpp")
Export('env')
diff --git a/modules/cscript/godot_c.h b/modules/cscript/godot_c.h
deleted file mode 100644
index 58acbf8bf9..0000000000
--- a/modules/cscript/godot_c.h
+++ /dev/null
@@ -1,567 +0,0 @@
-/*************************************************************************/
-/* 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
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(GDAPI_BUILT_IN) || !defined(WINDOWS_ENABLED)
-#define GDAPI
-#elif defined(GDAPI_EXPORTS)
-#define GDAPI __declspec(dllexport)
-#else
-#define GDAPI __declspec(dllimport)
-#endif
-
-#define GODOT_API_VERSION 1
-
-typedef int godot_bool;
-
-#define GODOT_FALSE 0
-#define GODOT_TRUE 1
-
-////// Image
-
-#define GODOT_IMAGE_FORMAT_GRAYSCALE 0
-#define GODOT_IMAGE_FORMAT_INTENSITY 1
-#define GODOT_IMAGE_FORMAT_GRAYSCALE_ALPHA 2
-#define GODOT_IMAGE_FORMAT_RGB 3
-#define GODOT_IMAGE_FORMAT_RGBA 4
-#define GODOT_IMAGE_FORMAT_INDEXED 5
-#define GODOT_IMAGE_FORMAT_INDEXED_ALPHA 6
-#define GODOT_IMAGE_FORMAT_YUV_422 7
-#define GODOT_IMAGE_FORMAT_YUV_444 8
-#define GODOT_IMAGE_FORMAT_BC1 9
-#define GODOT_IMAGE_FORMAT_BC2 10
-#define GODOT_IMAGE_FORMAT_BC3 11
-#define GODOT_IMAGE_FORMAT_BC4 12
-#define GODOT_IMAGE_FORMAT_BC5 13
-#define GODOT_IMAGE_FORMAT_PVRTC2 14
-#define GODOT_IMAGE_FORMAT_PVRTC2_ALPHA 15
-#define GODOT_IMAGE_FORMAT_PVRTC4 16
-#define GODOT_IMAGE_FORMAT_PVRTC4_ALPHA 17
-#define GODOT_IMAGE_FORMAT_ETC 18
-#define GODOT_IMAGE_FORMAT_ATC 19
-#define GODOT_IMAGE_FORMAT_ATC_ALPHA_EXPLICIT 20
-#define GODOT_IMAGE_FORMAT_ATC_ALPHA_INTERPOLATED 21
-
-typedef void *godot_image;
-
-godot_image GDAPI godot_image_create_empty();
-godot_image GDAPI godot_image_create(int p_width, int p_height, int p_format, int p_use_mipmaps);
-godot_image GDAPI godot_image_create_with_data(int p_width, int p_height, int p_format, int p_use_mipmaps, unsigned char *p_buffer);
-int GDAPI godot_image_get_width(godot_image p_image);
-int GDAPI godot_image_get_height(godot_image p_image);
-int GDAPI godot_image_get_format(godot_image p_image);
-int GDAPI godot_image_get_mipmap_count(godot_image p_image);
-godot_image GDAPI godot_image_copy(godot_image p_image);
-void GDAPI godot_image_free(godot_image p_image);
-
-////// RID
-
-typedef void *godot_rid;
-
-godot_rid GDAPI godot_rid_create();
-godot_rid GDAPI godot_rid_copy(godot_rid p_rid);
-void GDAPI godot_rid_free(godot_rid p_rid);
-
-////// Variant (forward declared)
-
-typedef void *godot_variant;
-
-////// Dictionary
-
-typedef void *godot_dictionary;
-
-godot_dictionary GDAPI godot_dictionary_create();
-void GDAPI godot_dictionary_has(godot_dictionary p_dictionary, godot_variant p_key);
-godot_variant GDAPI godot_dictionary_get(godot_dictionary p_dictionary, godot_variant p_key);
-void GDAPI godot_dictionary_insert(godot_dictionary p_dictionary, godot_variant p_key, godot_variant p_value);
-void GDAPI godot_dictionary_remove(godot_dictionary p_dictionary, godot_variant p_key);
-void GDAPI godot_dictionary_clear(godot_dictionary p_dictionary);
-int GDAPI godot_dictionary_get_size(godot_dictionary p_dictionary);
-void GDAPI godot_dictionary_get_keys(godot_dictionary p_dictionary, godot_variant *p_keys);
-godot_dictionary GDAPI godot_dictionary_copy(godot_dictionary p_dictionary);
-void GDAPI godot_dictionary_free(godot_dictionary p_dictionary);
-
-////// Array
-
-typedef void *godot_array;
-
-godot_array GDAPI godot_array_create();
-godot_variant GDAPI godot_array_get(godot_array p_array, int p_index);
-void GDAPI godot_array_set(godot_array p_array, int p_index, godot_variant p_value);
-void GDAPI godot_array_resize(godot_array p_array, int p_size);
-void GDAPI godot_array_insert(godot_array p_array, int p_position, godot_variant p_value);
-void GDAPI godot_array_remove(godot_array p_array, int p_position);
-void GDAPI godot_array_clear(godot_array p_array);
-int GDAPI godot_array_get_size(godot_array p_array);
-int GDAPI godot_array_find(godot_array p_array, godot_variant p_value, int p_from_pos = -1);
-godot_array GDAPI godot_array_copy(godot_array p_array);
-void GDAPI godot_array_free(godot_array p_array);
-
-////// InputEvent
-
-#define INPUT_EVENT_BUTTON_LEFT 1
-#define INPUT_EVENT_BUTTON_RIGHT 2
-#define INPUT_EVENT_BUTTON_MIDDLE 3
-#define INPUT_EVENT_BUTTON_WHEEL_UP 4
-#define INPUT_EVENT_BUTTON_WHEEL_DOWN 5
-#define INPUT_EVENT_BUTTON_WHEEL_LEFT 6
-#define INPUT_EVENT_BUTTON_WHEEL_RIGHT 7
-#define INPUT_EVENT_BUTTON_MASK_LEFT (1 << (INPUT_EVENT_BUTTON_LEFT - 1))
-#define INPUT_EVENT_BUTTON_MASK_RIGHT (1 << (INPUT_EVENT_BUTTON_RIGHT - 1))
-#define INPUT_EVENT_BUTTON_MASK_MIDDLE (1 << (INPUT_EVENT_BUTTON_MIDDLE - 1))
-
-#define INPUT_EVENT_TYPE_NONE 0
-#define INPUT_EVENT_TYPE_KEY 1
-#define INPUT_EVENT_TYPE_MOUSE_MOTION 2
-#define INPUT_EVENT_TYPE_MOUSE_BUTTON 3
-#define INPUT_EVENT_TYPE_JOYPAD_MOTION 4
-#define INPUT_EVENT_TYPE_JOYPAD_BUTTON 5
-#define INPUT_EVENT_TYPE_SCREEN_TOUCH 6
-#define INPUT_EVENT_TYPE_SCREEN_DRAG 7
-#define INPUT_EVENT_TYPE_ACTION 8
-
-typedef void *godot_input_event;
-
-godot_input_event GDAPI godot_input_event_create();
-godot_input_event GDAPI godot_input_event_copy(godot_input_event p_input_event);
-void GDAPI godot_input_event_free(godot_input_event p_input_event);
-
-int GDAPI godot_input_event_get_type(godot_input_event p_event);
-int GDAPI godot_input_event_get_device(godot_input_event p_event);
-
-godot_bool GDAPI godot_input_event_mod_has_alt(godot_input_event p_event);
-godot_bool GDAPI godot_input_event_mod_has_ctrl(godot_input_event p_event);
-godot_bool GDAPI godot_input_event_mod_has_command(godot_input_event p_event);
-godot_bool GDAPI godot_input_event_mod_has_shift(godot_input_event p_event);
-godot_bool GDAPI godot_input_event_mod_has_meta(godot_input_event p_event);
-
-int GDAPI godot_input_event_key_get_scancode(godot_input_event p_event);
-int GDAPI godot_input_event_key_get_unicode(godot_input_event p_event);
-godot_bool GDAPI godot_input_event_key_is_pressed(godot_input_event p_event);
-godot_bool GDAPI godot_input_event_key_is_echo(godot_input_event p_event);
-
-int GDAPI godot_input_event_mouse_get_x(godot_input_event p_event);
-int GDAPI godot_input_event_mouse_get_y(godot_input_event p_event);
-int GDAPI godot_input_event_mouse_get_global_x(godot_input_event p_event);
-int GDAPI godot_input_event_mouse_get_global_y(godot_input_event p_event);
-int GDAPI godot_input_event_mouse_get_button_mask(godot_input_event p_event);
-
-int GDAPI godot_input_event_mouse_button_get_button_index(godot_input_event p_event);
-godot_bool GDAPI godot_input_event_mouse_button_is_pressed(godot_input_event p_event);
-godot_bool GDAPI godot_input_event_mouse_button_is_doubleclick(godot_input_event p_event);
-
-int GDAPI godot_input_event_mouse_motion_get_relative_x(godot_input_event p_event);
-int GDAPI godot_input_event_mouse_motion_get_relative_y(godot_input_event p_event);
-
-int GDAPI godot_input_event_mouse_motion_get_speed_x(godot_input_event p_event);
-int GDAPI godot_input_event_mouse_motion_get_speed_y(godot_input_event p_event);
-
-int GDAPI godot_input_event_joypad_motion_get_axis(godot_input_event p_event);
-float GDAPI godot_input_event_joypad_motion_get_axis_value(godot_input_event p_event);
-
-int GDAPI godot_input_event_joypad_button_get_button_index(godot_input_event p_event);
-godot_bool GDAPI godot_input_event_joypad_button_is_pressed(godot_input_event p_event);
-float GDAPI godot_input_event_joypad_button_get_pressure(godot_input_event p_event);
-
-int GDAPI godot_input_event_screen_touch_get_index(godot_input_event p_event);
-int GDAPI godot_input_event_screen_touch_get_x(godot_input_event p_event);
-int GDAPI godot_input_event_screen_touch_get_y(godot_input_event p_event);
-int GDAPI godot_input_event_screen_touch_is_pressed(godot_input_event p_event);
-
-int GDAPI godot_input_event_screen_drag_get_index(godot_input_event p_event);
-int GDAPI godot_input_event_screen_drag_get_x(godot_input_event p_event);
-int GDAPI godot_input_event_screen_drag_get_y(godot_input_event p_event);
-int GDAPI godot_input_event_screen_drag_get_relative_x(godot_input_event p_event);
-int GDAPI godot_input_event_screen_drag_get_relative_y(godot_input_event p_event);
-int GDAPI godot_input_event_screen_drag_get_speed_x(godot_input_event p_event);
-int GDAPI godot_input_event_screen_drag_get_speed_y(godot_input_event p_event);
-
-int GDAPI godot_input_event_is_action(godot_input_event p_event, char *p_action);
-int GDAPI godot_input_event_is_action_pressed(godot_input_event p_event, char *p_action);
-
-////// ByteArray
-
-typedef void *godot_byte_array;
-
-godot_byte_array GDAPI godot_byte_array_create();
-godot_byte_array GDAPI godot_byte_array_copy(godot_byte_array p_byte_array);
-void GDAPI godot_byte_array_free(godot_byte_array p_byte_array);
-
-int GDAPI godot_byte_array_get_size(godot_byte_array p_byte_array);
-unsigned char GDAPI godot_byte_array_get(godot_byte_array p_byte_array, int p_index);
-void GDAPI godot_byte_array_set(godot_byte_array p_byte_array, int p_index, unsigned char p_value);
-void GDAPI godot_byte_array_remove(godot_byte_array p_byte_array, int p_index);
-void GDAPI godot_byte_array_clear(godot_byte_array p_byte_array);
-
-typedef void *godot_byte_array_lock;
-
-godot_byte_array_lock GDAPI godot_byte_array_get_lock(godot_byte_array p_byte_array);
-unsigned char GDAPI *godot_byte_array_lock_get_pointer(godot_byte_array_lock p_byte_array_lock);
-void GDAPI godot_byte_array_lock_free(godot_byte_array_lock p_byte_array_lock);
-
-godot_image GDAPI godot_image_create_with_array(int p_width, int p_height, int p_format, int p_use_mipmaps, godot_array p_array);
-godot_byte_array GDAPI godot_image_get_data(godot_image p_image);
-
-////// IntArray
-
-typedef void *godot_int_array;
-
-godot_int_array GDAPI godot_int_array_create();
-godot_int_array GDAPI godot_int_array_copy(godot_int_array p_int_array);
-void GDAPI godot_int_array_free(godot_int_array p_int_array);
-
-int GDAPI godot_int_array_get_size(godot_int_array p_int_array);
-int GDAPI godot_int_array_get(godot_int_array p_int_array, int p_index);
-void GDAPI godot_int_array_set(godot_int_array p_int_array, int p_index, int p_value);
-void GDAPI godot_int_array_remove(godot_int_array p_int_array, int p_index);
-void GDAPI godot_int_array_clear(godot_int_array p_int_array);
-
-typedef void *godot_int_array_lock;
-
-godot_int_array_lock GDAPI godot_int_array_get_lock(godot_int_array p_int_array);
-int GDAPI *godot_int_array_lock_get_pointer(godot_int_array_lock p_int_array_lock);
-void GDAPI godot_int_array_lock_free(godot_int_array_lock p_int_array_lock);
-
-////// RealArray
-
-typedef void *godot_real_array;
-
-godot_real_array GDAPI godot_real_array_create();
-godot_real_array GDAPI godot_real_array_copy(godot_real_array p_real_array);
-void GDAPI godot_real_array_free(godot_real_array p_real_array);
-
-int GDAPI godot_real_array_get_size(godot_real_array p_real_array);
-float GDAPI godot_real_array_get(godot_real_array p_real_array, int p_index);
-void GDAPI godot_real_array_set(godot_real_array p_real_array, int p_index, float p_value);
-void GDAPI godot_real_array_remove(godot_real_array p_real_array, int p_index);
-void GDAPI godot_real_array_clear(godot_real_array p_real_array);
-
-typedef void *godot_real_array_lock;
-
-godot_real_array_lock GDAPI godot_real_array_get_lock(godot_real_array p_real_array);
-float GDAPI *godot_real_array_lock_get_pointer(godot_real_array_lock p_real_array_lock);
-void GDAPI godot_real_array_lock_free(godot_real_array_lock p_real_array_lock);
-
-////// StringArray
-
-typedef void *godot_string_array;
-
-godot_string_array GDAPI godot_string_array_create();
-godot_string_array GDAPI godot_string_array_copy(godot_string_array p_string_array);
-void GDAPI godot_string_array_free(godot_string_array p_string_array);
-
-int GDAPI godot_string_array_get_size(godot_string_array p_string_array);
-int GDAPI godot_string_array_get(godot_string_array p_string_array, int p_index, unsigned char *p_string, int p_max_len);
-void GDAPI godot_string_array_set(godot_string_array p_string_array, int p_index, unsigned char *p_string);
-void GDAPI godot_string_array_remove(godot_string_array p_string_array, int p_index);
-void GDAPI godot_string_array_clear(godot_string_array p_string_array);
-
-////// Vector2Array
-
-typedef void *godot_vector2_array;
-
-godot_vector2_array GDAPI godot_vector2_array_create();
-godot_vector2_array GDAPI godot_vector2_array_copy(godot_vector2_array p_vector2_array);
-void GDAPI godot_vector2_array_free(godot_vector2_array p_vector2_array);
-
-int GDAPI godot_vector2_array_get_size(godot_vector2_array p_vector2_array);
-int GDAPI godot_vector2_array_get_stride(godot_vector2_array p_vector2_array);
-void GDAPI godot_vector2_array_get(godot_vector2_array p_vector2_array, int p_index, float *p_vector2);
-void GDAPI godot_vector2_array_set(godot_vector2_array p_vector2_array, int p_index, float *p_vector2);
-void GDAPI godot_vector2_array_remove(godot_vector2_array p_vector2_array, int p_index);
-void GDAPI godot_vector2_array_clear(godot_vector2_array p_vector2_array);
-
-typedef void *godot_vector2_array_lock;
-
-godot_vector2_array_lock GDAPI godot_vector2_array_get_lock(godot_vector2_array p_vector2_array);
-float GDAPI *godot_vector2_array_lock_get_pointer(godot_vector2_array_lock p_vector2_array_lock);
-void GDAPI godot_vector2_array_lock_free(godot_vector2_array_lock p_vector2_array_lock);
-
-////// Vector3Array
-
-typedef void *godot_vector3_array;
-
-godot_vector3_array GDAPI godot_vector3_array_create();
-godot_vector3_array GDAPI godot_vector3_array_copy(godot_vector3_array p_vector3_array);
-void GDAPI godot_vector3_array_free(godot_vector3_array p_vector3_array);
-
-int GDAPI godot_vector3_array_get_size(godot_vector3_array p_vector3_array);
-int GDAPI godot_vector3_array_get_stride(godot_vector3_array p_vector3_array);
-void GDAPI godot_vector3_array_get(godot_vector3_array p_vector3_array, int p_index, float *p_vector3);
-void GDAPI godot_vector3_array_set(godot_vector3_array p_vector3_array, int p_index, float *p_vector3);
-void GDAPI godot_vector3_array_remove(godot_vector3_array p_vector3_array, int p_index);
-void GDAPI godot_vector3_array_clear(godot_vector3_array p_vector3_array);
-
-typedef void *godot_vector3_array_lock;
-
-godot_vector3_array_lock GDAPI godot_vector3_array_get_lock(godot_vector3_array p_vector3_array);
-float GDAPI *godot_vector3_array_lock_get_pointer(godot_vector3_array_lock p_vector3_array_lock);
-void GDAPI godot_vector3_array_lock_free(godot_vector3_array_lock p_vector3_array_lock);
-
-////// ColorArray
-
-typedef void *godot_color_array;
-
-godot_color_array GDAPI godot_color_array_create();
-godot_color_array GDAPI godot_color_array_copy(godot_color_array p_color_array);
-void GDAPI godot_color_array_free(godot_color_array p_color_array);
-
-int GDAPI godot_color_array_get_size(godot_color_array p_color_array);
-int GDAPI godot_color_array_get_stride(godot_color_array p_color_array);
-void GDAPI godot_color_array_get(godot_color_array p_color_array, int p_index, float *p_color);
-void GDAPI godot_color_array_set(godot_color_array p_color_array, int p_index, float *p_color);
-void GDAPI godot_color_array_remove(godot_color_array p_color_array, int p_index);
-void GDAPI godot_color_array_clear(godot_color_array p_color_array);
-
-typedef void *godot_color_array_lock;
-
-godot_color_array_lock GDAPI godot_color_array_get_lock(godot_color_array p_color_array);
-float GDAPI *godot_color_array_lock_get_pointer(godot_color_array_lock p_color_array_lock);
-void GDAPI godot_color_array_lock_free(godot_color_array_lock p_color_array_lock);
-
-////// Instance (forward declared)
-
-typedef void *godot_instance;
-
-////// Variant
-
-#define GODOT_VARIANT_NIL 0
-#define GODOT_VARIANT_BOOL 1
-#define GODOT_VARIANT_INT 2
-#define GODOT_VARIANT_REAL 3
-#define GODOT_VARIANT_STRING 4
-#define GODOT_VARIANT_VECTOR2 5
-#define GODOT_VARIANT_RECT2 6
-#define GODOT_VARIANT_VECTOR3 7
-#define GODOT_VARIANT_MATRIX32 8
-#define GODOT_VARIANT_PLANE 9
-#define GODOT_VARIANT_QUAT 10
-#define GODOT_VARIANT_AABB 11
-#define GODOT_VARIANT_MATRIX3 12
-#define GODOT_VARIANT_TRANSFORM 13
-#define GODOT_VARIANT_COLOR 14
-#define GODOT_VARIANT_IMAGE 15
-#define GODOT_VARIANT_NODE_PATH 16
-#define GODOT_VARIANT_RID 17
-#define GODOT_VARIANT_OBJECT 18
-#define GODOT_VARIANT_INPUT_EVENT 19
-#define GODOT_VARIANT_DICTIONARY 20
-#define GODOT_VARIANT_ARRAY 21
-#define GODOT_VARIANT_BYTE_ARRAY 22
-#define GODOT_VARIANT_INT_ARRAY 23
-#define GODOT_VARIANT_REAL_ARRAY 24
-#define GODOT_VARIANT_STRING_ARRAY 25
-#define GODOT_VARIANT_VECTOR2_ARRAY 26
-#define GODOT_VARIANT_VECTOR3_ARRAY 27
-#define GODOT_VARIANT_COLOR_ARRAY 28
-#define GODOT_VARIANT_MAX 29
-
-godot_variant *godot_variant_new();
-
-int GDAPI godot_variant_get_type(godot_variant p_variant);
-
-void GDAPI godot_variant_set_null(godot_variant p_variant);
-void GDAPI godot_variant_set_bool(godot_variant p_variant, godot_bool p_bool);
-void GDAPI godot_variant_set_int(godot_variant p_variant, int p_int);
-void GDAPI godot_variant_set_float(godot_variant p_variant, int p_float);
-void GDAPI godot_variant_set_string(godot_variant p_variant, char *p_string);
-void GDAPI godot_variant_set_vector2(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_set_rect2(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_set_vector3(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_set_matrix32(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_set_plane(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_set_aabb(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_set_matrix3(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_set_transform(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_set_color(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_set_image(godot_variant p_variant, godot_image *p_image);
-void GDAPI godot_variant_set_node_path(godot_variant p_variant, char *p_path);
-void GDAPI godot_variant_set_rid(godot_variant p_variant, char *p_path);
-void GDAPI godot_variant_set_instance(godot_variant p_variant, godot_instance p_instance);
-void GDAPI godot_variant_set_input_event(godot_variant p_variant, godot_input_event p_instance);
-void GDAPI godot_variant_set_dictionary(godot_variant p_variant, godot_dictionary p_dictionary);
-void GDAPI godot_variant_set_array(godot_variant p_variant, godot_array p_array);
-void GDAPI godot_variant_set_byte_array(godot_variant p_variant, godot_byte_array p_array);
-void GDAPI godot_variant_set_int_array(godot_variant p_variant, godot_byte_array p_array);
-void GDAPI godot_variant_set_string_array(godot_variant p_variant, godot_string_array p_array);
-void GDAPI godot_variant_set_vector2_array(godot_variant p_variant, godot_vector2_array p_array);
-void GDAPI godot_variant_set_vector3_array(godot_variant p_variant, godot_vector3_array p_array);
-void GDAPI godot_variant_set_color_array(godot_variant p_variant, godot_color_array p_array);
-
-godot_bool GDAPI godot_variant_get_bool(godot_variant p_variant);
-int GDAPI godot_variant_get_int(godot_variant p_variant);
-float GDAPI godot_variant_get_float(godot_variant p_variant);
-int GDAPI godot_variant_get_string(godot_variant p_variant, char *p_string, int p_bufsize);
-void GDAPI godot_variant_get_vector2(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_get_rect2(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_get_vector3(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_get_matrix32(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_get_plane(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_get_aabb(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_get_matrix3(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_get_transform(godot_variant p_variant, float *p_elems);
-void GDAPI godot_variant_get_color(godot_variant p_variant, float *p_elems);
-godot_image GDAPI *godot_variant_get_image(godot_variant p_variant);
-int GDAPI godot_variant_get_node_path(godot_variant p_variant, char *p_path, int p_bufsize);
-godot_rid GDAPI godot_variant_get_rid(godot_variant p_variant);
-godot_instance GDAPI godot_variant_get_instance(godot_variant p_variant);
-void GDAPI godot_variant_get_input_event(godot_variant p_variant, godot_input_event);
-void GDAPI godot_variant_get_dictionary(godot_variant p_variant, godot_dictionary);
-godot_array GDAPI godot_variant_get_array(godot_variant p_variant);
-godot_byte_array GDAPI godot_variant_get_byte_array(godot_variant p_variant);
-godot_byte_array GDAPI godot_variant_get_int_array(godot_variant p_variant);
-godot_string_array GDAPI godot_variant_get_string_array(godot_variant p_variant);
-godot_vector2_array GDAPI godot_variant_get_vector2_array(godot_variant p_variant);
-godot_vector3_array GDAPI godot_variant_get_vector3_array(godot_variant p_variant);
-godot_color_array GDAPI godot_variant_get_color_array(godot_variant p_variant);
-
-void GDAPI godot_variant_delete(godot_variant p_variant);
-
-////// Class
-///
-
-char GDAPI **godot_class_get_list(); //get list of classes in array to array of strings, must be freed, use godot_list_free()
-
-int GDAPI godot_class_get_base(char *p_class, char *p_base, int p_max_len);
-int GDAPI godot_class_get_name(char *p_class, char *p_base, int p_max_len);
-
-char GDAPI **godot_class_get_method_list(char *p_class); //free with godot_list_free()
-int GDAPI godot_class_method_get_argument_count(char *p_class, char *p_method);
-int GDAPI godot_class_method_get_argument_type(char *p_class, char *p_method, int p_argument);
-godot_variant GDAPI godot_class_method_get_argument_default_value(char *p_class, char *p_method, int p_argument);
-
-char GDAPI **godot_class_get_constant_list(char *p_class); //free with godot_list_free()
-int GDAPI godot_class_constant_get_value(char *p_class, char *p_constant);
-
-////// Instance
-
-typedef int godot_call_error;
-
-#define GODOT_CALL_OK
-#define GODOT_CALL_ERROR_WRONG_ARGUMENTS
-#define GODOT_CALL_ERROR_INVALID_INSTANCE
-
-godot_instance GDAPI godot_instance_new(char *p_class);
-int GDAPI godot_instance_get_class(godot_instance p_instance, char *p_class, int p_max_len);
-
-typedef struct {
- char *name;
- int hint;
- char *hint_string;
- int usage;
-} godot_property_info;
-
-godot_call_error GDAPI godot_instance_call(godot_instance p_instance, char *p_method, ...);
-godot_call_error GDAPI godot_instance_call_ret(godot_instance p_instance, godot_variant r_return, char *p_method, ...);
-godot_bool GDAPI godot_instance_set(godot_instance p_instance, char *p_prop, godot_variant p_value);
-godot_variant GDAPI godot_instance_get(godot_instance p_instance, char *p_prop);
-
-#define GODOT_PROPERTY_HINT_NONE 0 ///< no hint provided.
-#define GODOT_PROPERTY_HINT_RANGE 1 ///< hint_text = "min,max,step,slider; //slider is optional"
-#define GODOT_PROPERTY_HINT_EXP_RANGE 2 ///< hint_text = "min,max,step", exponential edit
-#define GODOT_PROPERTY_HINT_ENUM 3 ///< hint_text= "val1,val2,val3,etc"
-#define GODOT_PROPERTY_HINT_EXP_EASING 4 /// exponential easing function (Math::ease)
-#define GODOT_PROPERTY_HINT_LENGTH 5 ///< hint_text= "length" (as integer)
-#define GODOT_PROPERTY_HINT_SPRITE_FRAME 6
-#define GODOT_PROPERTY_HINT_KEY_ACCEL 7 ///< hint_text= "length" (as integer)
-#define GODOT_PROPERTY_HINT_FLAGS 8 ///< hint_text= "flag1,flag2,etc" (as bit flags)
-#define GODOT_PROPERTY_HINT_ALL_FLAGS 9
-#define GODOT_PROPERTY_HINT_FILE 10 ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,"
-#define GODOT_PROPERTY_HINT_DIR 11 ///< a directort path must be passed
-#define GODOT_PROPERTY_HINT_GLOBAL_FILE 12 ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,"
-#define GODOT_PROPERTY_HINT_GLOBAL_DIR 13 ///< a directort path must be passed
-#define GODOT_PROPERTY_HINT_RESOURCE_TYPE 14 ///< a resource object type
-#define GODOT_PROPERTY_HINT_MULTILINE_TEXT 15 ///< used for string properties that can contain multiple lines
-#define GODOT_PROPERTY_HINT_COLOR_NO_ALPHA 16 ///< used for ignoring alpha component when editing a color
-#define GODOT_PROPERTY_HINT_IMAGE_COMPRESS_LOSSY 17
-#define GODOT_PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS 18
-#define GODOT_PROPERTY_HINT_OBJECT_ID 19
-
-#define GODOT_PROPERTY_USAGE_STORAGE 1
-#define GODOT_PROPERTY_USAGE_EDITOR 2
-#define GODOT_PROPERTY_USAGE_NETWORK 4
-#define GODOT_PROPERTY_USAGE_EDITOR_HELPER 8
-#define GODOT_PROPERTY_USAGE_CHECKABLE 16 //used for editing global variables
-#define GODOT_PROPERTY_USAGE_CHECKED 32 //used for editing global variables
-#define GODOT_PROPERTY_USAGE_INTERNATIONALIZED 64 //hint for internationalized strings
-#define GODOT_PROPERTY_USAGE_BUNDLE 128 //used for optimized bundles
-#define GODOT_PROPERTY_USAGE_CATEGORY 256
-#define GODOT_PROPERTY_USAGE_STORE_IF_NONZERO 512 //only store if nonzero
-#define GODOT_PROPERTY_USAGE_STORE_IF_NONONE 1024 //only store if false
-#define GODOT_PROPERTY_USAGE_NO_INSTANCE_STATE 2048
-#define GODOT_PROPERTY_USAGE_RESTART_IF_CHANGED 4096
-#define GODOT_PROPERTY_USAGE_SCRIPT_VARIABLE 8192
-#define GODOT_PROPERTY_USAGE_STORE_IF_NULL 16384
-#define GODOT_PROPERTY_USAGE_ANIMATE_AS_TRIGGER 32768
-
-#define GODOT_PROPERTY_USAGE_DEFAULT GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_EDITOR | GODOT_PROPERTY_USAGE_NETWORK
-#define GODOT_PROPERTY_USAGE_DEFAULT_INTL GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_EDITOR | GODOT_PROPERTY_USAGE_NETWORK | GODOT_PROPERTY_USAGE_INTERNATIONALIZED
-#define GODOT_PROPERTY_USAGE_NOEDITOR GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_NETWORK
-
-godot_property_info GDAPI **godot_instance_get_property_list(godot_instance p_instance);
-void GDAPI godot_instance_free_property_list(godot_instance p_instance, godot_property_info **p_list);
-
-void GDAPI godot_list_free(char **p_name); //helper to free all the class list
-
-////// Script API
-
-typedef void *(godot_script_instance_func)(godot_instance); //passed an instance, return a pointer to your userdata
-typedef void(godot_script_free_func)(godot_instance, void *); //passed an instance, please free your userdata
-
-void GDAPI godot_script_register(char *p_base, char *p_name, godot_script_instance_func p_instance_func, godot_script_free_func p_free_func);
-void GDAPI godot_script_unregister(char *p_name);
-
-typedef GDAPI godot_variant(godot_script_func)(godot_instance, void *, godot_variant *, int); //instance,userdata,arguments,argument count. Return something or NULL. Arguments must not be freed.
-
-void GDAPI godot_script_add_function(char *p_name, char *p_function_name, godot_script_func p_func);
-void GDAPI godot_script_add_validated_function(char *p_name, char *p_function_name, godot_script_func p_func, int *p_arg_types, int p_arg_count, godot_variant *p_default_args, int p_default_arg_count);
-
-typedef void(godot_set_property_func)(godot_instance, void *, godot_variant); //instance,userdata,value. Value must not be freed.
-typedef godot_variant(godot_get_property_func)(godot_instance, void *); //instance,userdata. Return a value or NULL.
-
-void GDAPI godot_script_add_property(char *p_name, char *p_path, godot_set_property_func p_set_func, godot_get_property_func p_get_func);
-void GDAPI godot_script_add_listed_property(char *p_name, char *p_path, godot_set_property_func p_set_func, godot_get_property_func p_get_func, int p_type, int p_hint, char *p_hint_string, int p_usage);
-
-////// System Functions
-
-//using these will help Godot track how much memory is in use in debug mode
-void GDAPI *godot_alloc(int p_bytes);
-void GDAPI *godot_realloc(void *p_ptr, int p_bytes);
-void GDAPI godot_free(void *p_ptr);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // GODOT_C_H
diff --git a/modules/dds/register_types.cpp b/modules/dds/register_types.cpp
index d0eaf3f995..4a758fe033 100644
--- a/modules/dds/register_types.cpp
+++ b/modules/dds/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/dds/register_types.h b/modules/dds/register_types.h
index 69f47006e2..4807c7dd5b 100644
--- a/modules/dds/register_types.h
+++ b/modules/dds/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp
index ac981d2b1a..71593ebfa9 100644
--- a/modules/dds/texture_loader_dds.cpp
+++ b/modules/dds/texture_loader_dds.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -75,8 +76,6 @@ static const DDSFormatInfo dds_format_info[DDS_MAX] = {
{ "DXT1", true, false, 4, 8, Image::FORMAT_DXT1 },
{ "DXT3", true, false, 4, 16, Image::FORMAT_DXT3 },
{ "DXT5", true, false, 4, 16, Image::FORMAT_DXT5 },
- { "ATI1", true, false, 4, 8, Image::FORMAT_ATI1 },
- { "ATI2", true, false, 4, 16, Image::FORMAT_ATI2 },
{ "BGRA8", false, false, 1, 4, Image::FORMAT_RGBA8 },
{ "BGR8", false, false, 1, 3, Image::FORMAT_RGB8 },
{ "RGBA8", false, false, 1, 4, Image::FORMAT_RGBA8 },
@@ -143,12 +142,14 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path,
f->get_32();
f->get_32();
- /*print_line("DDS width: "+itos(width));
+ /*
+ print_line("DDS width: "+itos(width));
print_line("DDS height: "+itos(height));
- print_line("DDS mipmaps: "+itos(mipmaps));*/
+ print_line("DDS mipmaps: "+itos(mipmaps));
- //printf("fourcc: %x fflags: %x, rgbbits: %x, fsize: %x\n",format_fourcc,format_flags,format_rgb_bits,format_size);
- //printf("rmask: %x gmask: %x, bmask: %x, amask: %x\n",format_red_mask,format_green_mask,format_blue_mask,format_alpha_mask);
+ printf("fourcc: %x fflags: %x, rgbbits: %x, fsize: %x\n",format_fourcc,format_flags,format_rgb_bits,format_size);
+ printf("rmask: %x gmask: %x, bmask: %x, amask: %x\n",format_red_mask,format_green_mask,format_blue_mask,format_alpha_mask);
+ */
//must avoid this later
while (f->get_pos() < 128)
@@ -438,7 +439,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path,
wb = PoolVector<uint8_t>::Write();
}
- Image img(width, height, mipmaps - 1, info.format, src_data);
+ Ref<Image> img = memnew(Image(width, height, mipmaps - 1, info.format, src_data));
Ref<ImageTexture> texture = memnew(ImageTexture);
texture->create_from_image(img);
diff --git a/modules/dds/texture_loader_dds.h b/modules/dds/texture_loader_dds.h
index c347937cd5..3b36e7f1eb 100644
--- a/modules/dds/texture_loader_dds.h
+++ b/modules/dds/texture_loader_dds.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp
index 13760b33aa..68d5c9e611 100644
--- a/modules/enet/networked_multiplayer_enet.cpp
+++ b/modules/enet/networked_multiplayer_enet.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -507,7 +508,7 @@ uint32_t NetworkedMultiplayerENet::_gen_unique_id() const {
(uint32_t)OS::get_singleton()->get_data_dir().hash64(), hash);
/*
hash = hash_djb2_one_32(
- (uint32_t)OS::get_singleton()->get_unique_ID().hash64(), hash );
+ (uint32_t)OS::get_singleton()->get_unique_id().hash64(), hash );
*/
hash = hash_djb2_one_32(
(uint32_t)((uint64_t)this), hash); //rely on aslr heap
@@ -574,6 +575,9 @@ size_t NetworkedMultiplayerENet::enet_compress(void *context, const ENetBuffer *
case COMPRESS_ZLIB: {
mode = Compression::MODE_DEFLATE;
} break;
+ case COMPRESS_ZSTD: {
+ mode = Compression::MODE_ZSTD;
+ } break;
default: { ERR_FAIL_V(0); }
}
@@ -607,6 +611,10 @@ size_t NetworkedMultiplayerENet::enet_decompress(void *context, const enet_uint8
ret = Compression::decompress(outData, outLimit, inData, inLimit, Compression::MODE_DEFLATE);
} break;
+ case COMPRESS_ZSTD: {
+
+ ret = Compression::decompress(outData, outLimit, inData, inLimit, Compression::MODE_ZSTD);
+ } break;
default: {}
}
if (ret < 0) {
@@ -628,7 +636,8 @@ void NetworkedMultiplayerENet::_setup_compressor() {
enet_host_compress_with_range_coder(host);
} break;
case COMPRESS_FASTLZ:
- case COMPRESS_ZLIB: {
+ case COMPRESS_ZLIB:
+ case COMPRESS_ZSTD: {
enet_host_compress(host, &enet_compressor);
} break;
@@ -653,6 +662,7 @@ void NetworkedMultiplayerENet::_bind_methods() {
BIND_CONSTANT(COMPRESS_RANGE_CODER);
BIND_CONSTANT(COMPRESS_FASTLZ);
BIND_CONSTANT(COMPRESS_ZLIB);
+ BIND_CONSTANT(COMPRESS_ZSTD);
}
NetworkedMultiplayerENet::NetworkedMultiplayerENet() {
diff --git a/modules/enet/networked_multiplayer_enet.h b/modules/enet/networked_multiplayer_enet.h
index deddf4ecc7..f2c3b838e4 100644
--- a/modules/enet/networked_multiplayer_enet.h
+++ b/modules/enet/networked_multiplayer_enet.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -42,7 +43,8 @@ public:
COMPRESS_NONE,
COMPRESS_RANGE_CODER,
COMPRESS_FASTLZ,
- COMPRESS_ZLIB
+ COMPRESS_ZLIB,
+ COMPRESS_ZSTD
};
private:
@@ -111,7 +113,7 @@ public:
virtual int get_packet_peer() const;
- Error create_server(int p_port, int p_max_peers = 32, int p_in_bandwidth = 0, int p_out_bandwidth = 0);
+ Error create_server(int p_port, int p_max_clients = 32, int p_in_bandwidth = 0, int p_out_bandwidth = 0);
Error create_client(const IP_Address &p_ip, int p_port, int p_in_bandwidth = 0, int p_out_bandwidth = 0);
void close_connection();
diff --git a/modules/enet/register_types.cpp b/modules/enet/register_types.cpp
index 0dea038520..a6e6c87c14 100644
--- a/modules/enet/register_types.cpp
+++ b/modules/enet/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/enet/register_types.h b/modules/enet/register_types.h
index 14cb1ba868..9bcb35a92b 100644
--- a/modules/enet/register_types.h
+++ b/modules/enet/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/etc/SCsub b/modules/etc/SCsub
new file mode 100644
index 0000000000..8f5937017e
--- /dev/null
+++ b/modules/etc/SCsub
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+
+Import('env')
+Import('env_modules')
+
+env_etc = env_modules.Clone()
+
+# Thirdparty source files
+# Not unbundled so far since not widespread as shared library
+thirdparty_dir = "#thirdparty/etc2comp/"
+thirdparty_sources = [
+ "EtcBlock4x4.cpp",
+ "EtcBlock4x4Encoding.cpp",
+ "EtcBlock4x4Encoding_ETC1.cpp",
+ "EtcBlock4x4Encoding_R11.cpp",
+ "EtcBlock4x4Encoding_RG11.cpp",
+ "EtcBlock4x4Encoding_RGB8A1.cpp",
+ "EtcBlock4x4Encoding_RGB8.cpp",
+ "EtcBlock4x4Encoding_RGBA8.cpp",
+ "Etc.cpp",
+ "EtcDifferentialTrys.cpp",
+ "EtcFilter.cpp",
+ "EtcImage.cpp",
+ "EtcIndividualTrys.cpp",
+ "EtcMath.cpp",
+ "EtcSortedBlockList.cpp",
+]
+thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+
+env_etc.add_source_files(env.modules_sources, thirdparty_sources)
+env_etc.Append(CPPPATH=[thirdparty_dir])
+
+# Godot source files
+env_etc.add_source_files(env.modules_sources, "*.cpp")
+
+# upstream uses c++11
+env_etc.Append(CXXFLAGS="-std=gnu++11")
diff --git a/modules/etc/config.py b/modules/etc/config.py
new file mode 100644
index 0000000000..4b0b01b78e
--- /dev/null
+++ b/modules/etc/config.py
@@ -0,0 +1,11 @@
+
+def can_build(platform):
+ return True
+
+
+def configure(env):
+ # Tools only, disabled for non-tools
+ # TODO: Find a cleaner way to achieve that
+ if (env["tools"] == "no"):
+ env["module_etc_enabled"] = "no"
+ env.disabled_modules.append("etc")
diff --git a/modules/etc/image_etc.cpp b/modules/etc/image_etc.cpp
new file mode 100644
index 0000000000..353bd1274a
--- /dev/null
+++ b/modules/etc/image_etc.cpp
@@ -0,0 +1,203 @@
+/*************************************************************************/
+/* image_etc.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "image_etc.h"
+#include "Etc.h"
+#include "EtcFilter.h"
+#include "image.h"
+#include "os/copymem.h"
+#include "os/os.h"
+#include "print_string.h"
+
+static Image::Format _get_etc2_mode(Image::DetectChannels format) {
+ switch (format) {
+ case Image::DETECTED_L:
+ case Image::DETECTED_R:
+ return Image::FORMAT_ETC2_R11;
+
+ case Image::DETECTED_RG:
+ return Image::FORMAT_ETC2_RG11;
+
+ case Image::DETECTED_RGB:
+ return Image::FORMAT_ETC2_RGB8;
+
+ case Image::DETECTED_RGBA:
+ return Image::FORMAT_ETC2_RGBA8;
+
+ // TODO: would be nice if we could use FORMAT_ETC2_RGB8A1 for FORMAT_RGBA5551
+ }
+
+ ERR_FAIL_COND_V(true, Image::FORMAT_MAX);
+}
+
+static Etc::Image::Format _image_format_to_etc2comp_format(Image::Format format) {
+ switch (format) {
+ case Image::FORMAT_ETC:
+ return Etc::Image::Format::ETC1;
+
+ case Image::FORMAT_ETC2_R11:
+ return Etc::Image::Format::R11;
+
+ case Image::FORMAT_ETC2_R11S:
+ return Etc::Image::Format::SIGNED_R11;
+
+ case Image::FORMAT_ETC2_RG11:
+ return Etc::Image::Format::RG11;
+
+ case Image::FORMAT_ETC2_RG11S:
+ return Etc::Image::Format::SIGNED_RG11;
+
+ case Image::FORMAT_ETC2_RGB8:
+ return Etc::Image::Format::RGB8;
+
+ case Image::FORMAT_ETC2_RGBA8:
+ return Etc::Image::Format::RGBA8;
+
+ case Image::FORMAT_ETC2_RGB8A1:
+ return Etc::Image::Format::RGB8A1;
+ }
+
+ ERR_FAIL_COND_V(true, Etc::Image::Format::UNKNOWN);
+}
+
+static void _decompress_etc1(Image *p_img) {
+ // not implemented, to be removed
+}
+
+static void _decompress_etc2(Image *p_img) {
+ // not implemented, to be removed
+}
+
+static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_format, Image::CompressSource p_source) {
+ Image::Format img_format = p_img->get_format();
+ Image::DetectChannels detected_channels = p_img->get_detected_channels();
+
+ if (p_source == Image::COMPRESS_SOURCE_SRGB && (detected_channels == Image::DETECTED_R || detected_channels == Image::DETECTED_RG)) {
+ //R and RG do not support SRGB
+ detected_channels = Image::DETECTED_RGB;
+ }
+
+ if (p_source == Image::COMPRESS_SOURCE_NORMAL) {
+ //use RG channels only for normal
+ detected_channels = Image::DETECTED_RG;
+ }
+
+ if (img_format >= Image::FORMAT_DXT1) {
+ return; //do not compress, already compressed
+ }
+
+ if (img_format > Image::FORMAT_RGBA8) {
+ // TODO: we should be able to handle FORMAT_RGBA4444 and FORMAT_RGBA5551 eventually
+ return;
+ }
+
+ int imgw = p_img->get_width(), imgh = p_img->get_height();
+ ERR_FAIL_COND(nearest_power_of_2(imgw) != imgw || nearest_power_of_2(imgh) != imgh);
+
+ Image::Format etc_format = force_etc1_format ? Image::FORMAT_ETC : _get_etc2_mode(detected_channels);
+
+ Ref<Image> img = p_img->duplicate();
+
+ if (img->get_format() != Image::FORMAT_RGBA8)
+ img->convert(Image::FORMAT_RGBA8); //still uses RGBA to convert
+
+ PoolVector<uint8_t>::Read r = img->get_data().read();
+
+ int target_size = Image::get_image_data_size(imgw, imgh, etc_format, p_img->has_mipmaps() ? -1 : 0);
+ int mmc = p_img->has_mipmaps() ? Image::get_image_required_mipmaps(imgw, imgh, etc_format) : 0;
+
+ PoolVector<uint8_t> dst_data;
+ dst_data.resize(target_size);
+
+ PoolVector<uint8_t>::Write w = dst_data.write();
+
+ // prepare parameters to be passed to etc2comp
+ int num_cpus = OS::get_singleton()->get_processor_count();
+ int encoding_time = 0;
+ float effort = 0.0; //default, reasonable time
+
+ if (p_lossy_quality > 0.75)
+ effort = 0.4;
+ else if (p_lossy_quality > 0.85)
+ effort = 0.6;
+ else if (p_lossy_quality > 0.95)
+ effort = 0.8;
+
+ Etc::ErrorMetric error_metric = Etc::ErrorMetric::RGBX; // NOTE: we can experiment with other error metrics
+ Etc::Image::Format etc2comp_etc_format = _image_format_to_etc2comp_format(etc_format);
+
+ int wofs = 0;
+
+ print_line("begin encoding, format: " + Image::get_format_name(etc_format));
+ uint64_t t = OS::get_singleton()->get_ticks_msec();
+ for (int i = 0; i < mmc + 1; i++) {
+ // convert source image to internal etc2comp format (which is equivalent to Image::FORMAT_RGBAF)
+ // NOTE: We can alternatively add a case to Image::convert to handle Image::FORMAT_RGBAF conversion.
+ int mipmap_ofs = 0, mipmap_size = 0, mipmap_w = 0, mipmap_h = 0;
+ img->get_mipmap_offset_size_and_dimensions(i, mipmap_ofs, mipmap_size, mipmap_w, mipmap_h);
+ const uint8_t *src = &r[mipmap_ofs];
+
+ Etc::ColorFloatRGBA *src_rgba_f = new Etc::ColorFloatRGBA[mipmap_w * mipmap_h];
+ for (int i = 0; i < mipmap_w * mipmap_h; i++) {
+ int si = i * 4; // RGBA8
+ src_rgba_f[i] = Etc::ColorFloatRGBA::ConvertFromRGBA8(src[si], src[si + 1], src[si + 2], src[si + 3]);
+ }
+
+ unsigned char *etc_data = NULL;
+ unsigned int etc_data_len = 0;
+ unsigned int extended_width = 0, extended_height = 0;
+ Etc::Encode((float *)src_rgba_f, mipmap_w, mipmap_h, etc2comp_etc_format, error_metric, effort, num_cpus, num_cpus, &etc_data, &etc_data_len, &extended_width, &extended_height, &encoding_time);
+
+ memcpy(&w[wofs], etc_data, etc_data_len);
+ wofs += etc_data_len;
+
+ delete[] etc_data;
+ delete[] src_rgba_f;
+ }
+ print_line("time encoding: " + rtos(OS::get_singleton()->get_ticks_msec() - t));
+
+ p_img->create(imgw, imgh, mmc > 1 ? true : false, etc_format, dst_data);
+}
+
+static void _compress_etc1(Image *p_img, float p_lossy_quality) {
+ _compress_etc(p_img, p_lossy_quality, true, Image::COMPRESS_SOURCE_GENERIC);
+}
+
+static void _compress_etc2(Image *p_img, float p_lossy_quality, Image::CompressSource p_source) {
+ _compress_etc(p_img, p_lossy_quality, false, p_source);
+}
+
+void _register_etc_compress_func() {
+
+ Image::_image_compress_etc1_func = _compress_etc1;
+ //Image::_image_decompress_etc1 = _decompress_etc1;
+
+ Image::_image_compress_etc2_func = _compress_etc2;
+ //Image::_image_decompress_etc2 = _decompress_etc2;
+}
diff --git a/modules/etc1/image_etc.h b/modules/etc/image_etc.h
index 18461819d6..3cbadef6fa 100644
--- a/modules/etc1/image_etc.h
+++ b/modules/etc/image_etc.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,6 @@
#ifndef IMAGE_ETC1_H
#define IMAGE_ETC1_H
-void _register_etc1_compress_func();
+void _register_etc_compress_func();
#endif // IMAGE_ETC_H
diff --git a/modules/etc1/register_types.cpp b/modules/etc/register_types.cpp
index b3b6419d26..e777859a8f 100644
--- a/modules/etc1/register_types.cpp
+++ b/modules/etc/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,15 +34,15 @@
static ResourceFormatPKM *resource_loader_pkm = NULL;
-void register_etc1_types() {
+void register_etc_types() {
resource_loader_pkm = memnew(ResourceFormatPKM);
ResourceLoader::add_resource_format_loader(resource_loader_pkm);
- _register_etc1_compress_func();
+ _register_etc_compress_func();
}
-void unregister_etc1_types() {
+void unregister_etc_types() {
memdelete(resource_loader_pkm);
}
diff --git a/modules/etc1/register_types.h b/modules/etc/register_types.h
index fe92496cea..44399376f3 100644
--- a/modules/etc1/register_types.h
+++ b/modules/etc/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,5 +27,5 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-void register_etc1_types();
-void unregister_etc1_types();
+void register_etc_types();
+void unregister_etc_types();
diff --git a/modules/etc1/texture_loader_pkm.cpp b/modules/etc/texture_loader_pkm.cpp
index bce10e691e..c04528d2a0 100644
--- a/modules/etc1/texture_loader_pkm.cpp
+++ b/modules/etc/texture_loader_pkm.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -84,7 +85,7 @@ RES ResourceFormatPKM::load(const String &p_path, const String &p_original_path,
int width = h.origWidth;
int height = h.origHeight;
- Image img(width, height, mipmaps, Image::FORMAT_ETC, src_data);
+ Ref<Image> img = memnew(Image(width, height, mipmaps, Image::FORMAT_ETC, src_data));
Ref<ImageTexture> texture = memnew(ImageTexture);
texture->create_from_image(img);
diff --git a/modules/etc1/texture_loader_pkm.h b/modules/etc/texture_loader_pkm.h
index 19d15d21fc..8a0f06a51a 100644
--- a/modules/etc1/texture_loader_pkm.h
+++ b/modules/etc/texture_loader_pkm.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/etc1/SCsub b/modules/etc1/SCsub
deleted file mode 100644
index 0c5dc66d2e..0000000000
--- a/modules/etc1/SCsub
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-
-Import('env')
-Import('env_modules')
-
-env_etc1 = env_modules.Clone()
-
-# Thirdparty source files
-# Not unbundled so far since not widespread as shared library
-thirdparty_dir = "#thirdparty/rg-etc1/"
-thirdparty_sources = [
- "rg_etc1.cpp",
-]
-thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
-
-env_etc1.add_source_files(env.modules_sources, thirdparty_sources)
-env_etc1.Append(CPPPATH=[thirdparty_dir])
-
-# Godot source files
-env_etc1.add_source_files(env.modules_sources, "*.cpp")
diff --git a/modules/etc1/image_etc.cpp b/modules/etc1/image_etc.cpp
deleted file mode 100644
index 642ec027f3..0000000000
--- a/modules/etc1/image_etc.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/*************************************************************************/
-/* image_etc.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 "image_etc.h"
-#include "image.h"
-#include "os/copymem.h"
-#include "print_string.h"
-#include "rg_etc1.h"
-static void _decompress_etc(Image *p_img) {
-
- ERR_FAIL_COND(p_img->get_format() != Image::FORMAT_ETC);
-
- int imgw = p_img->get_width();
- int imgh = p_img->get_height();
- PoolVector<uint8_t> src = p_img->get_data();
- PoolVector<uint8_t> dst;
-
- PoolVector<uint8_t>::Read r = src.read();
-
- int mmc = p_img->get_mipmap_count();
-
- for (int i = 0; i <= mmc; i++) {
-
- dst.resize(dst.size() + imgw * imgh * 3);
- const uint8_t *srcbr = &r[p_img->get_mipmap_offset(i)];
- PoolVector<uint8_t>::Write w = dst.write();
-
- uint8_t *wptr = &w[dst.size() - imgw * imgh * 3];
-
- int bw = MAX(imgw / 4, 1);
- int bh = MAX(imgh / 4, 1);
-
- for (int y = 0; y < bh; y++) {
-
- for (int x = 0; x < bw; x++) {
-
- uint8_t block[4 * 4 * 4];
-
- rg_etc1::unpack_etc1_block(srcbr, (unsigned int *)block);
- srcbr += 8;
-
- int maxx = MIN(imgw, 4);
- int maxy = MIN(imgh, 4);
-
- for (int yy = 0; yy < maxy; yy++) {
-
- for (int xx = 0; xx < maxx; xx++) {
-
- uint32_t src_ofs = (yy * 4 + xx) * 4;
- uint32_t dst_ofs = ((y * 4 + yy) * imgw + x * 4 + xx) * 3;
- wptr[dst_ofs + 0] = block[src_ofs + 0];
- wptr[dst_ofs + 1] = block[src_ofs + 1];
- wptr[dst_ofs + 2] = block[src_ofs + 2];
- }
- }
- }
- }
-
- imgw = MAX(1, imgw / 2);
- imgh = MAX(1, imgh / 2);
- }
-
- r = PoolVector<uint8_t>::Read();
- //print_line("Re Creating ETC into regular image: w "+itos(p_img->get_width())+" h "+itos(p_img->get_height())+" mm "+itos(p_img->get_mipmaps()));
- *p_img = Image(p_img->get_width(), p_img->get_height(), p_img->has_mipmaps(), Image::FORMAT_RGB8, dst);
- if (p_img->has_mipmaps())
- p_img->generate_mipmaps();
-}
-
-static void _compress_etc(Image *p_img) {
-
- Image img = *p_img;
-
- int imgw = img.get_width(), imgh = img.get_height();
-
- ERR_FAIL_COND(nearest_power_of_2(imgw) != imgw || nearest_power_of_2(imgh) != imgh);
-
- if (img.get_format() != Image::FORMAT_RGB8)
- img.convert(Image::FORMAT_RGB8);
-
- PoolVector<uint8_t> res_data;
- PoolVector<uint8_t> dst_data;
- PoolVector<uint8_t>::Read r = img.get_data().read();
-
- int target_size = Image::get_image_data_size(p_img->get_width(), p_img->get_height(), Image::FORMAT_ETC, p_img->has_mipmaps() ? -1 : 0);
- int mmc = p_img->has_mipmaps() ? Image::get_image_required_mipmaps(p_img->get_width(), p_img->get_height(), Image::FORMAT_ETC) : 0;
-
- dst_data.resize(target_size);
- int mc = 0;
- int ofs = 0;
- PoolVector<uint8_t>::Write w = dst_data.write();
-
- rg_etc1::etc1_pack_params pp;
- pp.m_quality = rg_etc1::cLowQuality;
- for (int i = 0; i <= mmc; i++) {
-
- int bw = MAX(imgw / 4, 1);
- int bh = MAX(imgh / 4, 1);
- const uint8_t *src = &r[img.get_mipmap_offset(i)];
- int mmsize = MAX(bw, 1) * MAX(bh, 1) * 8;
-
- uint8_t *dst = &w[ofs];
- ofs += mmsize;
-
- //print_line("bh: "+itos(bh)+" bw: "+itos(bw));
-
- for (int y = 0; y < bh; y++) {
-
- for (int x = 0; x < bw; x++) {
-
- //print_line("x: "+itos(x)+" y: "+itos(y));
-
- uint8_t block[4 * 4 * 4];
- zeromem(block, 4 * 4 * 4);
- uint8_t cblock[8];
-
- int maxy = MIN(imgh, 4);
- int maxx = MIN(imgw, 4);
-
- for (int yy = 0; yy < maxy; yy++) {
-
- for (int xx = 0; xx < maxx; xx++) {
-
- uint32_t dst_ofs = (yy * 4 + xx) * 4;
- uint32_t src_ofs = ((y * 4 + yy) * imgw + x * 4 + xx) * 3;
- block[dst_ofs + 0] = src[src_ofs + 0];
- block[dst_ofs + 1] = src[src_ofs + 1];
- block[dst_ofs + 2] = src[src_ofs + 2];
- block[dst_ofs + 3] = 255;
- }
- }
-
- rg_etc1::pack_etc1_block(cblock, (const unsigned int *)block, pp);
- for (int j = 0; j < 8; j++) {
-
- dst[j] = cblock[j];
- }
-
- dst += 8;
- }
- }
-
- imgw = MAX(1, imgw / 2);
- imgh = MAX(1, imgh / 2);
- mc++;
- }
-
- *p_img = Image(p_img->get_width(), p_img->get_height(), (mc - 1) ? true : false, Image::FORMAT_ETC, dst_data);
-}
-
-void _register_etc1_compress_func() {
-
- rg_etc1::pack_etc1_block_init();
- Image::_image_compress_etc_func = _compress_etc;
- Image::_image_decompress_etc = _decompress_etc;
-}
diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub
index 5b1e1c189f..6a89e8e087 100644
--- a/modules/freetype/SCsub
+++ b/modules/freetype/SCsub
@@ -34,10 +34,13 @@ if (env['builtin_freetype'] != 'no'):
"src/base/fttype1.c",
"src/base/ftwinfnt.c",
"src/bdf/bdf.c",
+ "src/bzip2/ftbzip2.c",
"src/cache/ftcache.c",
"src/cff/cff.c",
"src/cid/type1cid.c",
"src/gxvalid/gxvalid.c",
+ "src/gzip/ftgzip.c",
+ "src/lzw/ftlzw.c",
"src/otvalid/otvalid.c",
"src/pcf/pcf.c",
"src/pfr/pfr.c",
@@ -70,7 +73,6 @@ if (env['builtin_freetype'] != 'no'):
# LIBS contains first SCons Library objects ("SCons.Node.FS.File object")
# and then plain strings for system library. We insert between the two.
inserted = False
- print(env["LIBS"])
for idx, linklib in enumerate(env["LIBS"]):
if isinstance(linklib, basestring): # first system lib such as "X11", otherwise SCons lib object
env["LIBS"].insert(idx, lib)
@@ -78,6 +80,9 @@ if (env['builtin_freetype'] != 'no'):
break
if not inserted:
env.Append(LIBS=[lib])
+ env.Append(CCFLAGS=['-DFT2_BUILD_LIBRARY'])
+ if (env['target'] != 'release'):
+ env.Append(CCFLAGS=['-DZLIB_DEBUG'])
# Godot source files
env.add_source_files(env.modules_sources, "*.cpp")
diff --git a/modules/freetype/register_types.cpp b/modules/freetype/register_types.cpp
index 2579a925d4..3f290c2138 100644
--- a/modules/freetype/register_types.cpp
+++ b/modules/freetype/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/freetype/register_types.h b/modules/freetype/register_types.h
index 2837898123..c3ba324ed1 100644
--- a/modules/freetype/register_types.h
+++ b/modules/freetype/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/freetype/uwpdef.h b/modules/freetype/uwpdef.h
index b4aabb1929..c29b14dd12 100644
--- a/modules/freetype/uwpdef.h
+++ b/modules/freetype/uwpdef.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub
new file mode 100644
index 0000000000..65970d48c1
--- /dev/null
+++ b/modules/gdnative/SCsub
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+Import('env')
+
+env.add_source_files(env.modules_sources, "*.cpp")
+env.add_source_files(env.modules_sources, "godot/*.cpp")
+
+env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN'])
+env.Append(CPPPATH=['#modules/gdnative/'])
+
+if "platform" in env and env["platform"] == "x11": # there has to be a better solution?
+ env.Append(LINKFLAGS=["-rdynamic"])
+env.use_ptrcall = True
diff --git a/modules/gdnative/config.py b/modules/gdnative/config.py
new file mode 100644
index 0000000000..9f57b9bb74
--- /dev/null
+++ b/modules/gdnative/config.py
@@ -0,0 +1,8 @@
+
+
+def can_build(platform):
+ return True
+
+
+def configure(env):
+ env.use_ptrcall = True
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
new file mode 100644
index 0000000000..440cc45479
--- /dev/null
+++ b/modules/gdnative/gdnative.cpp
@@ -0,0 +1,340 @@
+/*************************************************************************/
+/* gdnative.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "gdnative.h"
+
+#include "global_constants.h"
+#include "io/file_access_encrypted.h"
+#include "os/file_access.h"
+#include "os/os.h"
+#include "project_settings.h"
+
+#include "scene/main/scene_tree.h"
+
+const String init_symbol = "godot_gdnative_init";
+const String terminate_symbol = "godot_gdnative_terminate";
+
+String GDNativeLibrary::platform_names[NUM_PLATFORMS] = {
+ "X11_32bit",
+ "X11_64bit",
+ "Windows_32bit",
+ "Windows_64bit",
+ "OSX",
+
+ "Android",
+ "iOS",
+
+ "WebAssembly"
+};
+String GDNativeLibrary::platform_lib_ext[NUM_PLATFORMS] = {
+ "so",
+ "so",
+ "dll",
+ "dll",
+ "dylib",
+
+ "so",
+ "dylib",
+
+ "wasm"
+};
+
+// TODO(karroffel): make this actually do the right thing.
+GDNativeLibrary::Platform GDNativeLibrary::current_platform =
+#if defined(X11_ENABLED)
+ X11_64BIT;
+#elif defined(WINDOWS_ENABLED)
+ WINDOWS_64BIT;
+#elif defined(OSX_ENABLED)
+ OSX;
+#else
+ X11_64BIT; // need a sensible default..
+#endif
+
+GDNativeLibrary::GDNativeLibrary()
+ : library_paths() {
+}
+
+GDNativeLibrary::~GDNativeLibrary() {
+}
+
+void GDNativeLibrary::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_library_path", "platform", "path"), &GDNativeLibrary::set_library_path);
+ ClassDB::bind_method(D_METHOD("get_library_path", "platform"), &GDNativeLibrary::get_library_path);
+}
+
+bool GDNativeLibrary::_set(const StringName &p_name, const Variant &p_value) {
+ String name = p_name;
+ if (name.begins_with("platform/")) {
+ set_library_path(name.get_slice("/", 1), p_value);
+ return true;
+ }
+ return false;
+}
+
+bool GDNativeLibrary::_get(const StringName &p_name, Variant &r_ret) const {
+ String name = p_name;
+ if (name.begins_with("platform/")) {
+ r_ret = get_library_path(name.get_slice("/", 1));
+ return true;
+ }
+ return false;
+}
+
+void GDNativeLibrary::_get_property_list(List<PropertyInfo> *p_list) const {
+ for (int i = 0; i < NUM_PLATFORMS; i++) {
+ p_list->push_back(PropertyInfo(Variant::STRING,
+ "platform/" + platform_names[i],
+ PROPERTY_HINT_FILE,
+ "*." + platform_lib_ext[i]));
+ }
+}
+
+void GDNativeLibrary::set_library_path(StringName p_platform, String p_path) {
+ int i;
+ for (i = 0; i <= NUM_PLATFORMS; i++) {
+ if (i == NUM_PLATFORMS) break;
+ if (platform_names[i] == p_platform) {
+ break;
+ }
+ }
+
+ if (i == NUM_PLATFORMS) {
+ ERR_EXPLAIN(String("No such platform: ") + p_platform);
+ ERR_FAIL();
+ }
+
+ library_paths[i] = p_path;
+}
+
+String GDNativeLibrary::get_library_path(StringName p_platform) const {
+ int i;
+ for (i = 0; i <= NUM_PLATFORMS; i++) {
+ if (i == NUM_PLATFORMS) break;
+ if (platform_names[i] == p_platform) {
+ break;
+ }
+ }
+
+ if (i == NUM_PLATFORMS) {
+ ERR_EXPLAIN(String("No such platform: ") + p_platform);
+ ERR_FAIL_V("");
+ }
+
+ return library_paths[i];
+}
+
+String GDNativeLibrary::get_active_library_path() const {
+ return library_paths[GDNativeLibrary::current_platform];
+}
+
+GDNative::GDNative() {
+ native_handle = NULL;
+}
+
+GDNative::~GDNative() {
+ // TODO(karroffel): implement ALL the things!
+}
+
+extern "C" void _api_anchor();
+
+void GDNative::_compile_dummy_for_api() {
+ _api_anchor();
+}
+
+void GDNative::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_library", "library"), &GDNative::set_library);
+ ClassDB::bind_method(D_METHOD("get_library"), &GDNative::get_library);
+
+ ClassDB::bind_method(D_METHOD("initialize"), &GDNative::initialize);
+ ClassDB::bind_method(D_METHOD("terminate"), &GDNative::terminate);
+
+ // TODO(karroffel): get_native_(raw_)call_types binding?
+
+ // TODO(karroffel): make this a varargs function?
+ ClassDB::bind_method(D_METHOD("call_native", "procedure_name", "arguments"), &GDNative::call_native);
+
+ ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "library", PROPERTY_HINT_RESOURCE_TYPE, "GDNativeLibrary"), "set_library", "get_library");
+}
+
+void GDNative::set_library(Ref<GDNativeLibrary> p_library) {
+ ERR_EXPLAIN("Tried to change library of GDNative when it is already set");
+ ERR_FAIL_COND(library.is_valid());
+ library = p_library;
+}
+
+Ref<GDNativeLibrary> GDNative::get_library() {
+ return library;
+}
+
+bool GDNative::initialize() {
+ if (library.is_null()) {
+ ERR_PRINT("No library set, can't initialize GDNative object");
+ return false;
+ }
+
+ String lib_path = library->get_active_library_path();
+ if (lib_path.empty()) {
+ ERR_PRINT("No library set for this platform");
+ return false;
+ }
+
+ String path = ProjectSettings::get_singleton()->globalize_path(lib_path);
+ Error err = OS::get_singleton()->open_dynamic_library(path, native_handle);
+ if (err != OK) {
+ return false;
+ }
+
+ void *library_init;
+ err = OS::get_singleton()->get_dynamic_library_symbol_handle(
+ native_handle,
+ init_symbol,
+ library_init);
+
+ if (err || !library_init) {
+ OS::get_singleton()->close_dynamic_library(native_handle);
+ native_handle = NULL;
+ ERR_PRINT("Failed to obtain godot_gdnative_init symbol");
+ return false;
+ }
+
+ godot_gdnative_init_fn library_init_fpointer;
+ library_init_fpointer = (godot_gdnative_init_fn)library_init;
+
+ godot_gdnative_init_options options;
+
+ options.in_editor = SceneTree::get_singleton()->is_editor_hint();
+ options.core_api_hash = ClassDB::get_api_hash(ClassDB::API_CORE);
+ options.editor_api_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR);
+ options.no_api_hash = ClassDB::get_api_hash(ClassDB::API_NONE);
+ options.gd_native_library = (godot_object *)(get_library().ptr());
+
+ library_init_fpointer(&options);
+
+ return true;
+}
+
+bool GDNative::terminate() {
+
+ if (native_handle == NULL) {
+ ERR_PRINT("No valid library handle, can't terminate GDNative object");
+ return false;
+ }
+
+ Error error = OK;
+ void *library_terminate;
+ error = OS::get_singleton()->get_dynamic_library_symbol_handle(
+ native_handle,
+ terminate_symbol,
+ library_terminate);
+ if (error) {
+ OS::get_singleton()->close_dynamic_library(native_handle);
+ native_handle = NULL;
+ return true;
+ }
+
+ godot_gdnative_terminate_fn library_terminate_pointer;
+ library_terminate_pointer = (godot_gdnative_terminate_fn)library_terminate;
+
+ // TODO(karroffel): remove this? Should be part of NativeScript, not
+ // GDNative IMO
+ godot_gdnative_terminate_options options;
+ options.in_editor = SceneTree::get_singleton()->is_editor_hint();
+
+ library_terminate_pointer(&options);
+
+ // GDNativeScriptLanguage::get_singleton()->initialized_libraries.erase(p_native_lib->path);
+
+ OS::get_singleton()->close_dynamic_library(native_handle);
+ native_handle = NULL;
+
+ return true;
+}
+
+bool GDNative::is_initialized() {
+ return (native_handle != NULL);
+}
+
+void GDNativeCallRegistry::register_native_call_type(StringName p_call_type, native_call_cb p_callback) {
+ native_calls.insert(p_call_type, p_callback);
+}
+
+void GDNativeCallRegistry::register_native_raw_call_type(StringName p_raw_call_type, native_raw_call_cb p_callback) {
+ native_raw_calls.insert(p_raw_call_type, p_callback);
+}
+
+Vector<StringName> GDNativeCallRegistry::get_native_call_types() {
+ Vector<StringName> call_types;
+ call_types.resize(native_calls.size());
+
+ size_t idx = 0;
+ for (Map<StringName, native_call_cb>::Element *E = native_calls.front(); E; E = E->next(), idx++) {
+ call_types[idx] = E->key();
+ }
+
+ return call_types;
+}
+
+Vector<StringName> GDNativeCallRegistry::get_native_raw_call_types() {
+ Vector<StringName> call_types;
+ call_types.resize(native_raw_calls.size());
+
+ size_t idx = 0;
+ for (Map<StringName, native_raw_call_cb>::Element *E = native_raw_calls.front(); E; E = E->next(), idx++) {
+ call_types[idx] = E->key();
+ }
+
+ return call_types;
+}
+
+Variant GDNative::call_native(StringName p_native_call_type, StringName p_procedure_name, Array p_arguments) {
+
+ Map<StringName, native_call_cb>::Element *E = GDNativeCallRegistry::singleton->native_calls.find(p_native_call_type);
+ if (!E) {
+ ERR_PRINT((String("No handler for native call type \"" + p_native_call_type) + "\" found").utf8().get_data());
+ return Variant();
+ }
+
+ String procedure_name = p_procedure_name;
+ godot_variant result = E->get()(native_handle, (godot_string *)&procedure_name, (godot_array *)&p_arguments);
+
+ return *(Variant *)&result;
+}
+
+void GDNative::call_native_raw(StringName p_raw_call_type, StringName p_procedure_name, void *data, int num_args, void **args, void *r_return) {
+
+ Map<StringName, native_raw_call_cb>::Element *E = GDNativeCallRegistry::singleton->native_raw_calls.find(p_raw_call_type);
+ if (!E) {
+ ERR_PRINT((String("No handler for native raw call type \"" + p_raw_call_type) + "\" found").utf8().get_data());
+ return;
+ }
+
+ String procedure_name = p_procedure_name;
+ E->get()(native_handle, (godot_string *)&procedure_name, data, num_args, args, r_return);
+}
diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h
new file mode 100644
index 0000000000..003ec46a25
--- /dev/null
+++ b/modules/gdnative/gdnative.h
@@ -0,0 +1,144 @@
+/*************************************************************************/
+/* gdnative.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 GDNATIVE_H
+#define GDNATIVE_H
+
+#include "io/resource_loader.h"
+#include "io/resource_saver.h"
+#include "os/thread_safe.h"
+#include "resource.h"
+
+#include <godot/gdnative.h>
+
+class GDNativeLibrary : public Resource {
+ GDCLASS(GDNativeLibrary, Resource)
+
+ enum Platform {
+ X11_32BIT,
+ X11_64BIT,
+ WINDOWS_32BIT,
+ WINDOWS_64BIT,
+ // NOTE(karroffel): I heard OSX 32 bit is dead, so 64 only
+ OSX,
+
+ // TODO(karroffel): all different android versions and archs
+ ANDROID,
+
+ // TODO(karroffe): all different iOS versions and archs
+ IOS,
+
+ // TODO(karroffel): figure out how to deal with web stuff at all...
+ WASM,
+
+ // TODO(karroffel): does UWP have different libs??
+ // UWP,
+
+ NUM_PLATFORMS
+
+ };
+
+ static String platform_names[NUM_PLATFORMS];
+ static String platform_lib_ext[NUM_PLATFORMS];
+
+ // TODO(karroffel): make this actually do something lol.
+ static Platform current_platform;
+
+ String library_paths[NUM_PLATFORMS];
+
+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:
+ GDNativeLibrary();
+ ~GDNativeLibrary();
+
+ static void _bind_methods();
+
+ void set_library_path(StringName p_platform, String p_path);
+ String get_library_path(StringName p_platform) const;
+
+ String get_active_library_path() const;
+};
+
+typedef godot_variant (*native_call_cb)(void *, godot_string *, godot_array *);
+typedef void (*native_raw_call_cb)(void *, godot_string *, void *, int, void **, void *);
+
+struct GDNativeCallRegistry {
+ static GDNativeCallRegistry *singleton;
+
+ inline GDNativeCallRegistry *get_singleton() {
+ return singleton;
+ }
+
+ inline GDNativeCallRegistry()
+ : native_calls(),
+ native_raw_calls() {}
+
+ Map<StringName, native_call_cb> native_calls;
+ Map<StringName, native_raw_call_cb> native_raw_calls;
+
+ void register_native_call_type(StringName p_call_type, native_call_cb p_callback);
+ void register_native_raw_call_type(StringName p_raw_call_type, native_raw_call_cb p_callback);
+
+ Vector<StringName> get_native_call_types();
+ Vector<StringName> get_native_raw_call_types();
+};
+
+class GDNative : public Reference {
+ GDCLASS(GDNative, Reference)
+
+ Ref<GDNativeLibrary> library;
+
+ // TODO(karroffel): different platforms? WASM????
+ void *native_handle;
+
+ void _compile_dummy_for_api();
+
+public:
+ GDNative();
+ ~GDNative();
+
+ static void _bind_methods();
+
+ void set_library(Ref<GDNativeLibrary> p_library);
+ Ref<GDNativeLibrary> get_library();
+
+ bool is_initialized();
+
+ bool initialize();
+ bool terminate();
+
+ Variant call_native(StringName p_native_call_type, StringName p_procedure_name, Array p_arguments = Array());
+ void call_native_raw(StringName p_raw_call_type, StringName p_procedure_name, void *data, int num_args, void **args, void *r_return);
+};
+
+#endif // GDNATIVE_H
diff --git a/modules/gdnative/godot/array.cpp b/modules/gdnative/godot/array.cpp
new file mode 100644
index 0000000000..97c73dc253
--- /dev/null
+++ b/modules/gdnative/godot/array.cpp
@@ -0,0 +1,309 @@
+/*************************************************************************/
+/* array.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/array.h>
+
+#include "core/array.h"
+#include "core/os/memory.h"
+
+#include "core/color.h"
+#include "core/dvector.h"
+
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _array_api_anchor() {
+}
+
+void GDAPI godot_array_new(godot_array *r_dest) {
+ Array *dest = (Array *)r_dest;
+ memnew_placement(dest, Array);
+}
+
+void GDAPI godot_array_new_copy(godot_array *r_dest, const godot_array *p_src) {
+ Array *dest = (Array *)r_dest;
+ const Array *src = (const Array *)p_src;
+ memnew_placement(dest, Array(*src));
+}
+
+void GDAPI godot_array_new_pool_color_array(godot_array *r_dest, const godot_pool_color_array *p_pca) {
+ Array *dest = (Array *)r_dest;
+ PoolVector<Color> *pca = (PoolVector<Color> *)p_pca;
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
+
+ for (size_t i = 0; i < dest->size(); i++) {
+ Variant v = pca->operator[](i);
+ dest->operator[](i) = v;
+ }
+}
+
+void GDAPI godot_array_new_pool_vector3_array(godot_array *r_dest, const godot_pool_vector3_array *p_pv3a) {
+ Array *dest = (Array *)r_dest;
+ PoolVector<Vector3> *pca = (PoolVector<Vector3> *)p_pv3a;
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
+
+ for (size_t i = 0; i < dest->size(); i++) {
+ Variant v = pca->operator[](i);
+ dest->operator[](i) = v;
+ }
+}
+
+void GDAPI godot_array_new_pool_vector2_array(godot_array *r_dest, const godot_pool_vector2_array *p_pv2a) {
+ Array *dest = (Array *)r_dest;
+ PoolVector<Vector2> *pca = (PoolVector<Vector2> *)p_pv2a;
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
+
+ for (size_t i = 0; i < dest->size(); i++) {
+ Variant v = pca->operator[](i);
+ dest->operator[](i) = v;
+ }
+}
+
+void GDAPI godot_array_new_pool_string_array(godot_array *r_dest, const godot_pool_string_array *p_psa) {
+ Array *dest = (Array *)r_dest;
+ PoolVector<String> *pca = (PoolVector<String> *)p_psa;
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
+
+ for (size_t i = 0; i < dest->size(); i++) {
+ Variant v = pca->operator[](i);
+ dest->operator[](i) = v;
+ }
+}
+
+void GDAPI godot_array_new_pool_real_array(godot_array *r_dest, const godot_pool_real_array *p_pra) {
+ Array *dest = (Array *)r_dest;
+ PoolVector<godot_real> *pca = (PoolVector<godot_real> *)p_pra;
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
+
+ for (size_t i = 0; i < dest->size(); i++) {
+ Variant v = pca->operator[](i);
+ dest->operator[](i) = v;
+ }
+}
+
+void GDAPI godot_array_new_pool_int_array(godot_array *r_dest, const godot_pool_int_array *p_pia) {
+ Array *dest = (Array *)r_dest;
+ PoolVector<godot_int> *pca = (PoolVector<godot_int> *)p_pia;
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
+
+ for (size_t i = 0; i < dest->size(); i++) {
+ Variant v = pca->operator[](i);
+ dest->operator[](i) = v;
+ }
+}
+
+void GDAPI godot_array_new_pool_byte_array(godot_array *r_dest, const godot_pool_byte_array *p_pba) {
+ Array *dest = (Array *)r_dest;
+ PoolVector<uint8_t> *pca = (PoolVector<uint8_t> *)p_pba;
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
+
+ for (size_t i = 0; i < dest->size(); i++) {
+ Variant v = pca->operator[](i);
+ dest->operator[](i) = v;
+ }
+}
+
+void GDAPI godot_array_set(godot_array *p_self, const godot_int p_idx, const godot_variant *p_value) {
+ Array *self = (Array *)p_self;
+ Variant *val = (Variant *)p_value;
+ self->operator[](p_idx) = *val;
+}
+
+godot_variant GDAPI godot_array_get(const godot_array *p_self, const godot_int p_idx) {
+ godot_variant raw_dest;
+ Variant *dest = (Variant *)&raw_dest;
+ const Array *self = (const Array *)p_self;
+ memnew_placement(dest, Variant(self->operator[](p_idx)));
+ return raw_dest;
+}
+
+godot_variant GDAPI *godot_array_operator_index(godot_array *p_self, const godot_int p_idx) {
+ Array *self = (Array *)p_self;
+ return (godot_variant *)&self->operator[](p_idx);
+}
+
+void GDAPI godot_array_append(godot_array *p_self, const godot_variant *p_value) {
+ Array *self = (Array *)p_self;
+ Variant *val = (Variant *)p_value;
+ self->append(*val);
+}
+
+void GDAPI godot_array_clear(godot_array *p_self) {
+ Array *self = (Array *)p_self;
+ self->clear();
+}
+
+godot_int GDAPI godot_array_count(const godot_array *p_self, const godot_variant *p_value) {
+ const Array *self = (const Array *)p_self;
+ const Variant *val = (const Variant *)p_value;
+ return self->count(*val);
+}
+
+godot_bool GDAPI godot_array_empty(const godot_array *p_self) {
+ const Array *self = (const Array *)p_self;
+ return self->empty();
+}
+
+void GDAPI godot_array_erase(godot_array *p_self, const godot_variant *p_value) {
+ Array *self = (Array *)p_self;
+ const Variant *val = (const Variant *)p_value;
+ self->erase(*val);
+}
+
+godot_variant GDAPI godot_array_front(const godot_array *p_self) {
+ const Array *self = (const Array *)p_self;
+ godot_variant v;
+ Variant *val = (Variant *)&v;
+ memnew_placement(val, Variant);
+ *val = self->front();
+ return v;
+}
+
+godot_variant GDAPI godot_array_back(const godot_array *p_self) {
+ const Array *self = (const Array *)p_self;
+ godot_variant v;
+ Variant *val = (Variant *)&v;
+ memnew_placement(val, Variant);
+ *val = self->back();
+ return v;
+}
+
+godot_int GDAPI godot_array_find(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from) {
+ const Array *self = (const Array *)p_self;
+ const Variant *val = (const Variant *)p_what;
+ return self->find(*val, p_from);
+}
+
+godot_int GDAPI godot_array_find_last(const godot_array *p_self, const godot_variant *p_what) {
+ const Array *self = (const Array *)p_self;
+ const Variant *val = (const Variant *)p_what;
+ return self->find_last(*val);
+}
+
+godot_bool GDAPI godot_array_has(const godot_array *p_self, const godot_variant *p_value) {
+ const Array *self = (const Array *)p_self;
+ const Variant *val = (const Variant *)p_value;
+ return self->has(*val);
+}
+
+godot_int GDAPI godot_array_hash(const godot_array *p_self) {
+ const Array *self = (const Array *)p_self;
+ return self->hash();
+}
+
+void GDAPI godot_array_insert(godot_array *p_self, const godot_int p_pos, const godot_variant *p_value) {
+ Array *self = (Array *)p_self;
+ const Variant *val = (const Variant *)p_value;
+ self->insert(p_pos, *val);
+}
+
+void GDAPI godot_array_invert(godot_array *p_self) {
+ Array *self = (Array *)p_self;
+ self->invert();
+}
+
+godot_variant GDAPI godot_array_pop_back(godot_array *p_self) {
+ Array *self = (Array *)p_self;
+ godot_variant v;
+ Variant *val = (Variant *)&v;
+ memnew_placement(val, Variant);
+ *val = self->pop_back();
+ return v;
+}
+
+godot_variant GDAPI godot_array_pop_front(godot_array *p_self) {
+ Array *self = (Array *)p_self;
+ godot_variant v;
+ Variant *val = (Variant *)&v;
+ memnew_placement(val, Variant);
+ *val = self->pop_front();
+ return v;
+}
+
+void GDAPI godot_array_push_back(godot_array *p_self, const godot_variant *p_value) {
+ Array *self = (Array *)p_self;
+ const Variant *val = (const Variant *)p_value;
+ self->push_back(*val);
+}
+
+void GDAPI godot_array_push_front(godot_array *p_self, const godot_variant *p_value) {
+ Array *self = (Array *)p_self;
+ const Variant *val = (const Variant *)p_value;
+ self->push_front(*val);
+}
+
+void GDAPI godot_array_remove(godot_array *p_self, const godot_int p_idx) {
+ Array *self = (Array *)p_self;
+ self->remove(p_idx);
+}
+
+void GDAPI godot_array_resize(godot_array *p_self, const godot_int p_size) {
+ Array *self = (Array *)p_self;
+ self->resize(p_size);
+}
+
+godot_int GDAPI godot_array_rfind(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from) {
+ const Array *self = (const Array *)p_self;
+ const Variant *val = (const Variant *)p_what;
+ return self->rfind(*val, p_from);
+}
+
+godot_int GDAPI godot_array_size(const godot_array *p_self) {
+ const Array *self = (const Array *)p_self;
+ return self->size();
+}
+
+void GDAPI godot_array_sort(godot_array *p_self) {
+ Array *self = (Array *)p_self;
+ self->sort();
+}
+
+void GDAPI godot_array_sort_custom(godot_array *p_self, godot_object *p_obj, const godot_string *p_func) {
+ Array *self = (Array *)p_self;
+ const String *func = (const String *)p_func;
+ self->sort_custom((Object *)p_obj, *func);
+}
+
+void GDAPI godot_array_destroy(godot_array *p_self) {
+ ((Array *)p_self)->~Array();
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/array.h b/modules/gdnative/godot/array.h
new file mode 100644
index 0000000000..158170ba0e
--- /dev/null
+++ b/modules/gdnative/godot/array.h
@@ -0,0 +1,122 @@
+/*************************************************************************/
+/* array.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_ARRAY_H
+#define GODOT_ARRAY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_ARRAY_SIZE 8
+
+#ifndef GODOT_CORE_API_GODOT_ARRAY_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_ARRAY_SIZE];
+} godot_array;
+#endif
+
+#include <godot/pool_arrays.h>
+#include <godot/variant.h>
+
+#include <godot/gdnative.h>
+
+void GDAPI godot_array_new(godot_array *r_dest);
+void GDAPI godot_array_new_copy(godot_array *r_dest, const godot_array *p_src);
+void GDAPI godot_array_new_pool_color_array(godot_array *r_dest, const godot_pool_color_array *p_pca);
+void GDAPI godot_array_new_pool_vector3_array(godot_array *r_dest, const godot_pool_vector3_array *p_pv3a);
+void GDAPI godot_array_new_pool_vector2_array(godot_array *r_dest, const godot_pool_vector2_array *p_pv2a);
+void GDAPI godot_array_new_pool_string_array(godot_array *r_dest, const godot_pool_string_array *p_psa);
+void GDAPI godot_array_new_pool_real_array(godot_array *r_dest, const godot_pool_real_array *p_pra);
+void GDAPI godot_array_new_pool_int_array(godot_array *r_dest, const godot_pool_int_array *p_pia);
+void GDAPI godot_array_new_pool_byte_array(godot_array *r_dest, const godot_pool_byte_array *p_pba);
+
+void GDAPI godot_array_set(godot_array *p_self, const godot_int p_idx, const godot_variant *p_value);
+
+godot_variant GDAPI godot_array_get(const godot_array *p_self, const godot_int p_idx);
+
+godot_variant GDAPI *godot_array_operator_index(godot_array *p_self, const godot_int p_idx);
+
+void GDAPI godot_array_append(godot_array *p_self, const godot_variant *p_value);
+
+void GDAPI godot_array_clear(godot_array *p_self);
+
+godot_int GDAPI godot_array_count(const godot_array *p_self, const godot_variant *p_value);
+
+godot_bool GDAPI godot_array_empty(const godot_array *p_self);
+
+void GDAPI godot_array_erase(godot_array *p_self, const godot_variant *p_value);
+
+godot_variant GDAPI godot_array_front(const godot_array *p_self);
+
+godot_variant GDAPI godot_array_back(const godot_array *p_self);
+
+godot_int GDAPI godot_array_find(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from);
+
+godot_int GDAPI godot_array_find_last(const godot_array *p_self, const godot_variant *p_what);
+
+godot_bool GDAPI godot_array_has(const godot_array *p_self, const godot_variant *p_value);
+
+godot_int GDAPI godot_array_hash(const godot_array *p_self);
+
+void GDAPI godot_array_insert(godot_array *p_self, const godot_int p_pos, const godot_variant *p_value);
+
+void GDAPI godot_array_invert(godot_array *p_self);
+
+godot_variant GDAPI godot_array_pop_back(godot_array *p_self);
+
+godot_variant GDAPI godot_array_pop_front(godot_array *p_self);
+
+void GDAPI godot_array_push_back(godot_array *p_self, const godot_variant *p_value);
+
+void GDAPI godot_array_push_front(godot_array *p_self, const godot_variant *p_value);
+
+void GDAPI godot_array_remove(godot_array *p_self, const godot_int p_idx);
+
+void GDAPI godot_array_resize(godot_array *p_self, const godot_int p_size);
+
+godot_int GDAPI godot_array_rfind(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from);
+
+godot_int GDAPI godot_array_size(const godot_array *p_self);
+
+void GDAPI godot_array_sort(godot_array *p_self);
+
+void GDAPI godot_array_sort_custom(godot_array *p_self, godot_object *p_obj, const godot_string *p_func);
+
+void GDAPI godot_array_destroy(godot_array *p_self);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_ARRAY_H
diff --git a/modules/gdnative/godot/basis.cpp b/modules/gdnative/godot/basis.cpp
new file mode 100644
index 0000000000..5cf379b7d5
--- /dev/null
+++ b/modules/gdnative/godot/basis.cpp
@@ -0,0 +1,272 @@
+/*************************************************************************/
+/* basis.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/basis.h>
+
+#include "core/math/matrix3.h"
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _basis_api_anchor() {}
+
+void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis) {
+ const Vector3 *x_axis = (const Vector3 *)p_x_axis;
+ const Vector3 *y_axis = (const Vector3 *)p_y_axis;
+ const Vector3 *z_axis = (const Vector3 *)p_z_axis;
+ Basis *dest = (Basis *)r_dest;
+ *dest = Basis(*x_axis, *y_axis, *z_axis);
+}
+
+void GDAPI godot_basis_new_with_axis_and_angle(godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi) {
+ const Vector3 *axis = (const Vector3 *)p_axis;
+ Basis *dest = (Basis *)r_dest;
+ *dest = Basis(*axis, p_phi);
+}
+
+void GDAPI godot_basis_new_with_euler(godot_basis *r_dest, const godot_vector3 *p_euler) {
+ const Vector3 *euler = (const Vector3 *)p_euler;
+ Basis *dest = (Basis *)r_dest;
+ *dest = Basis(*euler);
+}
+
+godot_string GDAPI godot_basis_as_string(const godot_basis *p_self) {
+ godot_string ret;
+ const Basis *self = (const Basis *)p_self;
+ memnew_placement(&ret, String(*self));
+ return ret;
+}
+
+godot_basis GDAPI godot_basis_inverse(const godot_basis *p_self) {
+ godot_basis dest;
+ const Basis *self = (const Basis *)p_self;
+ *((Basis *)&dest) = self->inverse();
+ return dest;
+}
+
+godot_basis GDAPI godot_basis_transposed(const godot_basis *p_self) {
+ godot_basis dest;
+ const Basis *self = (const Basis *)p_self;
+ *((Basis *)&dest) = self->transposed();
+ return dest;
+}
+
+godot_basis GDAPI godot_basis_orthonormalized(const godot_basis *p_self) {
+ godot_basis dest;
+ const Basis *self = (const Basis *)p_self;
+ *((Basis *)&dest) = self->orthonormalized();
+ return dest;
+}
+
+godot_real GDAPI godot_basis_determinant(const godot_basis *p_self) {
+ const Basis *self = (const Basis *)p_self;
+ return self->determinant();
+}
+
+godot_basis GDAPI godot_basis_rotated(const godot_basis *p_self, const godot_vector3 *p_axis, const godot_real p_phi) {
+ godot_basis dest;
+ const Basis *self = (const Basis *)p_self;
+ const Vector3 *axis = (const Vector3 *)p_axis;
+ *((Basis *)&dest) = self->rotated(*axis, p_phi);
+ return dest;
+}
+
+godot_basis GDAPI godot_basis_scaled(const godot_basis *p_self, const godot_vector3 *p_scale) {
+ godot_basis dest;
+ const Basis *self = (const Basis *)p_self;
+ const Vector3 *scale = (const Vector3 *)p_scale;
+ *((Basis *)&dest) = self->scaled(*scale);
+ return dest;
+}
+
+void GDAPI godot_basis_set_scale(godot_basis *p_self, const godot_vector3 *p_scale) {
+ Basis *self = (Basis *)p_self;
+ const Vector3 *scale = (const Vector3 *)p_scale;
+ self->set_scale(*scale);
+}
+
+void GDAPI godot_basis_set_rotation_euler(godot_basis *p_self, const godot_vector3 *p_euler) {
+ Basis *self = (Basis *)p_self;
+ const Vector3 *euler = (const Vector3 *)p_euler;
+ self->set_rotation_euler(*euler);
+}
+
+void GDAPI godot_basis_set_rotation_axis_angle(godot_basis *p_self, const godot_vector3 *p_axis, const godot_real p_angle) {
+ Basis *self = (Basis *)p_self;
+ const Vector3 *axis = (const Vector3 *)p_axis;
+ self->set_rotation_axis_angle(*axis, p_angle);
+}
+
+godot_vector3 GDAPI godot_basis_get_scale(const godot_basis *p_self) {
+ godot_vector3 dest;
+ const Basis *self = (const Basis *)p_self;
+ *((Vector3 *)&dest) = self->get_scale();
+ return dest;
+}
+
+godot_vector3 GDAPI godot_basis_get_euler(const godot_basis *p_self) {
+ godot_vector3 dest;
+ const Basis *self = (const Basis *)p_self;
+ *((Vector3 *)&dest) = self->get_euler();
+ return dest;
+}
+
+godot_real GDAPI godot_basis_tdotx(const godot_basis *p_self, const godot_vector3 *p_with) {
+ const Basis *self = (const Basis *)p_self;
+ const Vector3 *with = (const Vector3 *)p_with;
+ return self->tdotx(*with);
+}
+
+godot_real GDAPI godot_basis_tdoty(const godot_basis *p_self, const godot_vector3 *p_with) {
+ const Basis *self = (const Basis *)p_self;
+ const Vector3 *with = (const Vector3 *)p_with;
+ return self->tdoty(*with);
+}
+
+godot_real GDAPI godot_basis_tdotz(const godot_basis *p_self, const godot_vector3 *p_with) {
+ const Basis *self = (const Basis *)p_self;
+ const Vector3 *with = (const Vector3 *)p_with;
+ return self->tdotz(*with);
+}
+
+godot_vector3 GDAPI godot_basis_xform(const godot_basis *p_self, const godot_vector3 *p_v) {
+ godot_vector3 dest;
+ const Basis *self = (const Basis *)p_self;
+ const Vector3 *v = (const Vector3 *)p_v;
+ *((Vector3 *)&dest) = self->xform(*v);
+ return dest;
+}
+
+godot_vector3 GDAPI godot_basis_xform_inv(const godot_basis *p_self, const godot_vector3 *p_v) {
+ godot_vector3 dest;
+ const Basis *self = (const Basis *)p_self;
+ const Vector3 *v = (const Vector3 *)p_v;
+ *((Vector3 *)&dest) = self->xform_inv(*v);
+ return dest;
+}
+
+godot_int GDAPI godot_basis_get_orthogonal_index(const godot_basis *p_self) {
+ const Basis *self = (const Basis *)p_self;
+ return self->get_orthogonal_index();
+}
+
+void GDAPI godot_basis_new(godot_basis *r_dest) {
+ Basis *dest = (Basis *)r_dest;
+ *dest = Basis();
+}
+
+void GDAPI godot_basis_new_with_euler_quat(godot_basis *r_dest, const godot_quat *p_euler) {
+ Basis *dest = (Basis *)r_dest;
+ const Quat *euler = (const Quat *)p_euler;
+ *dest = Basis(*euler);
+}
+
+// p_elements is a pointer to an array of 3 (!!) vector3
+void GDAPI godot_basis_get_elements(godot_basis *p_self, godot_vector3 *p_elements) {
+ const Basis *self = (const Basis *)p_self;
+ Vector3 *elements = (Vector3 *)p_elements;
+ elements[0] = self->elements[0];
+ elements[1] = self->elements[1];
+ elements[2] = self->elements[2];
+}
+
+godot_vector3 GDAPI godot_basis_get_axis(const godot_basis *p_self, const godot_int p_axis) {
+ godot_vector3 dest;
+ Vector3 *d = (Vector3 *)&dest;
+ const Basis *self = (const Basis *)p_self;
+ *d = self->get_axis(p_axis);
+ return dest;
+}
+
+void GDAPI godot_basis_set_axis(godot_basis *p_self, const godot_int p_axis, const godot_vector3 *p_value) {
+ Basis *self = (Basis *)p_self;
+ const Vector3 *value = (const Vector3 *)p_value;
+ self->set_axis(p_axis, *value);
+}
+
+godot_vector3 GDAPI godot_basis_get_row(const godot_basis *p_self, const godot_int p_row) {
+ godot_vector3 dest;
+ Vector3 *d = (Vector3 *)&dest;
+ const Basis *self = (const Basis *)p_self;
+ *d = self->get_row(p_row);
+ return dest;
+}
+
+void GDAPI godot_basis_set_row(godot_basis *p_self, const godot_int p_row, const godot_vector3 *p_value) {
+ Basis *self = (Basis *)p_self;
+ const Vector3 *value = (const Vector3 *)p_value;
+ self->set_row(p_row, *value);
+}
+
+godot_bool GDAPI godot_basis_operator_equal(const godot_basis *p_self, const godot_basis *p_b) {
+ const Basis *self = (const Basis *)p_self;
+ const Basis *b = (const Basis *)p_b;
+ return *self == *b;
+}
+
+godot_basis GDAPI godot_basis_operator_add(const godot_basis *p_self, const godot_basis *p_b) {
+ godot_basis raw_dest;
+ Basis *dest = (Basis *)&raw_dest;
+ const Basis *self = (const Basis *)p_self;
+ const Basis *b = (const Basis *)p_b;
+ *dest = *self + *b;
+ return raw_dest;
+}
+
+godot_basis GDAPI godot_basis_operator_substract(const godot_basis *p_self, const godot_basis *p_b) {
+ godot_basis raw_dest;
+ Basis *dest = (Basis *)&raw_dest;
+ const Basis *self = (const Basis *)p_self;
+ const Basis *b = (const Basis *)p_b;
+ *dest = *self - *b;
+ return raw_dest;
+}
+
+godot_basis GDAPI godot_basis_operator_multiply_vector(const godot_basis *p_self, const godot_basis *p_b) {
+ godot_basis raw_dest;
+ Basis *dest = (Basis *)&raw_dest;
+ const Basis *self = (const Basis *)p_self;
+ const Basis *b = (const Basis *)p_b;
+ *dest = *self * *b;
+ return raw_dest;
+}
+
+godot_basis GDAPI godot_basis_operator_multiply_scalar(const godot_basis *p_self, const godot_real p_b) {
+ godot_basis raw_dest;
+ Basis *dest = (Basis *)&raw_dest;
+ const Basis *self = (const Basis *)p_self;
+ *dest = *self * p_b;
+ return raw_dest;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/basis.h b/modules/gdnative/godot/basis.h
new file mode 100644
index 0000000000..e96b8b730d
--- /dev/null
+++ b/modules/gdnative/godot/basis.h
@@ -0,0 +1,121 @@
+/*************************************************************************/
+/* basis.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_BASIS_H
+#define GODOT_BASIS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_BASIS_SIZE 36
+
+#ifndef GODOT_CORE_API_GODOT_BASIS_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_BASIS_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_BASIS_SIZE];
+} godot_basis;
+#endif
+
+#include <godot/gdnative.h>
+#include <godot/quat.h>
+#include <godot/vector3.h>
+
+void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis);
+void GDAPI godot_basis_new_with_axis_and_angle(godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi);
+void GDAPI godot_basis_new_with_euler(godot_basis *r_dest, const godot_vector3 *p_euler);
+
+godot_string GDAPI godot_basis_as_string(const godot_basis *p_self);
+
+godot_basis GDAPI godot_basis_inverse(const godot_basis *p_self);
+
+godot_basis GDAPI godot_basis_transposed(const godot_basis *p_self);
+
+godot_basis GDAPI godot_basis_orthonormalized(const godot_basis *p_self);
+
+godot_real GDAPI godot_basis_determinant(const godot_basis *p_self);
+
+godot_basis GDAPI godot_basis_rotated(const godot_basis *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
+
+godot_basis GDAPI godot_basis_scaled(const godot_basis *p_self, const godot_vector3 *p_scale);
+
+void GDAPI godot_basis_set_scale(godot_basis *p_self, const godot_vector3 *p_scale);
+
+void GDAPI godot_basis_set_rotation_euler(godot_basis *p_self, const godot_vector3 *p_euler);
+
+void GDAPI godot_basis_set_rotation_axis_angle(godot_basis *p_self, const godot_vector3 *p_axis, const godot_real p_angle);
+
+godot_vector3 GDAPI godot_basis_get_scale(const godot_basis *p_self);
+
+godot_vector3 GDAPI godot_basis_get_euler(const godot_basis *p_self);
+
+godot_real GDAPI godot_basis_tdotx(const godot_basis *p_self, const godot_vector3 *p_with);
+
+godot_real GDAPI godot_basis_tdoty(const godot_basis *p_self, const godot_vector3 *p_with);
+
+godot_real GDAPI godot_basis_tdotz(const godot_basis *p_self, const godot_vector3 *p_with);
+
+godot_vector3 GDAPI godot_basis_xform(const godot_basis *p_self, const godot_vector3 *p_v);
+
+godot_vector3 GDAPI godot_basis_xform_inv(const godot_basis *p_self, const godot_vector3 *p_v);
+
+godot_int GDAPI godot_basis_get_orthogonal_index(const godot_basis *p_self);
+
+void GDAPI godot_basis_new(godot_basis *r_dest);
+
+void GDAPI godot_basis_new_with_euler_quat(godot_basis *r_dest, const godot_quat *p_euler);
+
+// p_elements is a pointer to an array of 3 (!!) vector3
+void GDAPI godot_basis_get_elements(godot_basis *p_self, godot_vector3 *p_elements);
+
+godot_vector3 GDAPI godot_basis_get_axis(const godot_basis *p_self, const godot_int p_axis);
+
+void GDAPI godot_basis_set_axis(godot_basis *p_self, const godot_int p_axis, const godot_vector3 *p_value);
+
+godot_vector3 GDAPI godot_basis_get_row(const godot_basis *p_self, const godot_int p_row);
+
+void GDAPI godot_basis_set_row(godot_basis *p_self, const godot_int p_row, const godot_vector3 *p_value);
+
+godot_bool GDAPI godot_basis_operator_equal(const godot_basis *p_self, const godot_basis *p_b);
+
+godot_basis GDAPI godot_basis_operator_add(const godot_basis *p_self, const godot_basis *p_b);
+
+godot_basis GDAPI godot_basis_operator_substract(const godot_basis *p_self, const godot_basis *p_b);
+
+godot_basis GDAPI godot_basis_operator_multiply_vector(const godot_basis *p_self, const godot_basis *p_b);
+
+godot_basis GDAPI godot_basis_operator_multiply_scalar(const godot_basis *p_self, const godot_real p_b);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_BASIS_H
diff --git a/modules/gdnative/godot/color.cpp b/modules/gdnative/godot/color.cpp
new file mode 100644
index 0000000000..a5ffee1e0b
--- /dev/null
+++ b/modules/gdnative/godot/color.cpp
@@ -0,0 +1,182 @@
+/*************************************************************************/
+/* color.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/color.h>
+
+#include "core/color.h"
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _color_api_anchor() {}
+
+void GDAPI godot_color_new_rgba(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a) {
+
+ Color *dest = (Color *)r_dest;
+ *dest = Color(p_r, p_g, p_b, p_a);
+}
+
+void GDAPI godot_color_new_rgb(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b) {
+
+ Color *dest = (Color *)r_dest;
+ *dest = Color(p_r, p_g, p_b);
+}
+
+godot_real godot_color_get_r(const godot_color *p_self) {
+ const Color *self = (const Color *)p_self;
+ return self->r;
+}
+
+void godot_color_set_r(godot_color *p_self, const godot_real val) {
+ Color *self = (Color *)p_self;
+ self->r = val;
+}
+
+godot_real godot_color_get_g(const godot_color *p_self) {
+ const Color *self = (const Color *)p_self;
+ return self->g;
+}
+
+void godot_color_set_g(godot_color *p_self, const godot_real val) {
+ Color *self = (Color *)p_self;
+ self->g = val;
+}
+
+godot_real godot_color_get_b(const godot_color *p_self) {
+ const Color *self = (const Color *)p_self;
+ return self->b;
+}
+
+void godot_color_set_b(godot_color *p_self, const godot_real val) {
+ Color *self = (Color *)p_self;
+ self->b = val;
+}
+
+godot_real godot_color_get_a(const godot_color *p_self) {
+ const Color *self = (const Color *)p_self;
+ return self->a;
+}
+
+void godot_color_set_a(godot_color *p_self, const godot_real val) {
+ Color *self = (Color *)p_self;
+ self->a = val;
+}
+
+godot_real godot_color_get_h(const godot_color *p_self) {
+ const Color *self = (const Color *)p_self;
+ return self->get_h();
+}
+
+godot_real godot_color_get_s(const godot_color *p_self) {
+ const Color *self = (const Color *)p_self;
+ return self->get_s();
+}
+
+godot_real godot_color_get_v(const godot_color *p_self) {
+ const Color *self = (const Color *)p_self;
+ return self->get_v();
+}
+
+godot_string GDAPI godot_color_as_string(const godot_color *p_self) {
+ godot_string ret;
+ const Color *self = (const Color *)p_self;
+ memnew_placement(&ret, String(*self));
+ return ret;
+}
+
+godot_int GDAPI godot_color_to_32(const godot_color *p_self) {
+ const Color *self = (const Color *)p_self;
+ return self->to_32();
+}
+
+godot_int GDAPI godot_color_to_ARGB32(const godot_color *p_self) {
+ const Color *self = (const Color *)p_self;
+ return self->to_ARGB32();
+}
+
+godot_real GDAPI godot_color_gray(const godot_color *p_self) {
+ const Color *self = (const Color *)p_self;
+ return self->gray();
+}
+
+godot_color GDAPI godot_color_inverted(const godot_color *p_self) {
+ godot_color dest;
+ const Color *self = (const Color *)p_self;
+ *((Color *)&dest) = self->inverted();
+ return dest;
+}
+
+godot_color GDAPI godot_color_contrasted(const godot_color *p_self) {
+ godot_color dest;
+ const Color *self = (const Color *)p_self;
+ *((Color *)&dest) = self->contrasted();
+ return dest;
+}
+
+godot_color GDAPI godot_color_linear_interpolate(const godot_color *p_self, const godot_color *p_b, const godot_real p_t) {
+ godot_color dest;
+ const Color *self = (const Color *)p_self;
+ const Color *b = (const Color *)p_b;
+ *((Color *)&dest) = self->linear_interpolate(*b, p_t);
+ return dest;
+}
+
+godot_color GDAPI godot_color_blend(const godot_color *p_self, const godot_color *p_over) {
+ godot_color dest;
+ const Color *self = (const Color *)p_self;
+ const Color *over = (const Color *)p_over;
+ *((Color *)&dest) = self->blend(*over);
+ return dest;
+}
+
+godot_string GDAPI godot_color_to_html(const godot_color *p_self, const godot_bool p_with_alpha) {
+ godot_string dest;
+ const Color *self = (const Color *)p_self;
+
+ memnew_placement(&dest, String(self->to_html(p_with_alpha)));
+ return dest;
+}
+
+godot_bool GDAPI godot_color_operator_equal(const godot_color *p_self, const godot_color *p_b) {
+ const Color *self = (const Color *)p_self;
+ const Color *b = (const Color *)p_b;
+ return *self == *b;
+}
+
+godot_bool GDAPI godot_color_operator_less(const godot_color *p_self, const godot_color *p_b) {
+ const Color *self = (const Color *)p_self;
+ const Color *b = (const Color *)p_b;
+ return *self < *b;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/color.h b/modules/gdnative/godot/color.h
new file mode 100644
index 0000000000..2cd6b48b48
--- /dev/null
+++ b/modules/gdnative/godot/color.h
@@ -0,0 +1,96 @@
+/*************************************************************************/
+/* color.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_COLOR_H
+#define GODOT_COLOR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_COLOR_SIZE 16
+
+#ifndef GODOT_CORE_API_GODOT_COLOR_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_COLOR_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_COLOR_SIZE];
+} godot_color;
+#endif
+
+#include <godot/gdnative.h>
+#include <godot/string.h>
+
+void GDAPI godot_color_new_rgba(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a);
+void GDAPI godot_color_new_rgb(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b);
+
+godot_real godot_color_get_r(const godot_color *p_self);
+void godot_color_set_r(godot_color *p_self, const godot_real r);
+
+godot_real godot_color_get_g(const godot_color *p_self);
+void godot_color_set_g(godot_color *p_self, const godot_real g);
+
+godot_real godot_color_get_b(const godot_color *p_self);
+void godot_color_set_b(godot_color *p_self, const godot_real b);
+
+godot_real godot_color_get_a(const godot_color *p_self);
+void godot_color_set_a(godot_color *p_self, const godot_real a);
+
+godot_real godot_color_get_h(const godot_color *p_self);
+godot_real godot_color_get_s(const godot_color *p_self);
+godot_real godot_color_get_v(const godot_color *p_self);
+
+godot_string GDAPI godot_color_as_string(const godot_color *p_self);
+
+godot_int GDAPI godot_color_to_32(const godot_color *p_self);
+
+godot_int GDAPI godot_color_to_ARGB32(const godot_color *p_self);
+
+godot_real GDAPI godot_color_gray(const godot_color *p_self);
+
+godot_color GDAPI godot_color_inverted(const godot_color *p_self);
+
+godot_color GDAPI godot_color_contrasted(const godot_color *p_self);
+
+godot_color GDAPI godot_color_linear_interpolate(const godot_color *p_self, const godot_color *p_b, const godot_real p_t);
+
+godot_color GDAPI godot_color_blend(const godot_color *p_self, const godot_color *p_over);
+
+godot_string GDAPI godot_color_to_html(const godot_color *p_self, const godot_bool p_with_alpha);
+
+godot_bool GDAPI godot_color_operator_equal(const godot_color *p_self, const godot_color *p_b);
+
+godot_bool GDAPI godot_color_operator_less(const godot_color *p_self, const godot_color *p_b);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_COLOR_H
diff --git a/modules/gdnative/godot/dictionary.cpp b/modules/gdnative/godot/dictionary.cpp
new file mode 100644
index 0000000000..c538456432
--- /dev/null
+++ b/modules/gdnative/godot/dictionary.cpp
@@ -0,0 +1,155 @@
+/*************************************************************************/
+/* dictionary.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/dictionary.h>
+
+#include "core/variant.h"
+// core/variant.h before to avoid compile errors with MSVC
+#include "core/dictionary.h"
+#include "core/io/json.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _dictionary_api_anchor() {}
+
+void GDAPI godot_dictionary_new(godot_dictionary *r_dest) {
+ Dictionary *dest = (Dictionary *)r_dest;
+ memnew_placement(dest, Dictionary);
+}
+
+void GDAPI godot_dictionary_new_copy(godot_dictionary *r_dest, const godot_dictionary *p_src) {
+ Dictionary *dest = (Dictionary *)r_dest;
+ const Dictionary *src = (const Dictionary *)p_src;
+ memnew_placement(dest, Dictionary(*src));
+}
+
+void GDAPI godot_dictionary_destroy(godot_dictionary *p_self) {
+ Dictionary *self = (Dictionary *)p_self;
+ self->~Dictionary();
+}
+
+godot_int GDAPI godot_dictionary_size(const godot_dictionary *p_self) {
+ const Dictionary *self = (const Dictionary *)p_self;
+ return self->size();
+}
+
+godot_bool GDAPI godot_dictionary_empty(const godot_dictionary *p_self) {
+ const Dictionary *self = (const Dictionary *)p_self;
+ return self->empty();
+}
+
+void GDAPI godot_dictionary_clear(godot_dictionary *p_self) {
+ Dictionary *self = (Dictionary *)p_self;
+ self->clear();
+}
+
+godot_bool GDAPI godot_dictionary_has(const godot_dictionary *p_self, const godot_variant *p_key) {
+ const Dictionary *self = (const Dictionary *)p_self;
+ const Variant *key = (const Variant *)p_key;
+ return self->has(*key);
+}
+
+godot_bool GDAPI godot_dictionary_has_all(const godot_dictionary *p_self, const godot_array *p_keys) {
+ const Dictionary *self = (const Dictionary *)p_self;
+ const Array *keys = (const Array *)p_keys;
+ return self->has_all(*keys);
+}
+
+void GDAPI godot_dictionary_erase(godot_dictionary *p_self, const godot_variant *p_key) {
+ Dictionary *self = (Dictionary *)p_self;
+ const Variant *key = (const Variant *)p_key;
+ self->erase(*key);
+}
+
+godot_int GDAPI godot_dictionary_hash(const godot_dictionary *p_self) {
+ const Dictionary *self = (const Dictionary *)p_self;
+ return self->hash();
+}
+
+godot_array GDAPI godot_dictionary_keys(const godot_dictionary *p_self) {
+ godot_array dest;
+ const Dictionary *self = (const Dictionary *)p_self;
+ memnew_placement(&dest, Array(self->keys()));
+ return dest;
+}
+
+godot_array GDAPI godot_dictionary_values(const godot_dictionary *p_self) {
+ godot_array dest;
+ const Dictionary *self = (const Dictionary *)p_self;
+ memnew_placement(&dest, Array(self->values()));
+ return dest;
+}
+
+godot_variant GDAPI godot_dictionary_get(const godot_dictionary *p_self, const godot_variant *p_key) {
+ godot_variant raw_dest;
+ Variant *dest = (Variant *)&raw_dest;
+ const Dictionary *self = (const Dictionary *)p_self;
+ const Variant *key = (const Variant *)p_key;
+ memnew_placement(dest, Variant(self->operator[](*key)));
+ return raw_dest;
+}
+
+void GDAPI godot_dictionary_set(godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_value) {
+ Dictionary *self = (Dictionary *)p_self;
+ const Variant *key = (const Variant *)p_key;
+ const Variant *value = (const Variant *)p_value;
+ self->operator[](*key) = *value;
+}
+
+godot_variant GDAPI *godot_dictionary_operator_index(godot_dictionary *p_self, const godot_variant *p_key) {
+ Dictionary *self = (Dictionary *)p_self;
+ const Variant *key = (const Variant *)p_key;
+ return (godot_variant *)&self->operator[](*key);
+}
+
+godot_variant GDAPI *godot_dictionary_next(const godot_dictionary *p_self, const godot_variant *p_key) {
+ Dictionary *self = (Dictionary *)p_self;
+ const Variant *key = (const Variant *)p_key;
+ return (godot_variant *)self->next(key);
+}
+
+godot_bool GDAPI godot_dictionary_operator_equal(const godot_dictionary *p_self, const godot_dictionary *p_b) {
+ const Dictionary *self = (const Dictionary *)p_self;
+ const Dictionary *b = (const Dictionary *)p_b;
+ return *self == *b;
+}
+
+godot_string GDAPI godot_dictionary_to_json(const godot_dictionary *p_self) {
+ godot_string raw_dest;
+ String *dest = (String *)&raw_dest;
+ const Dictionary *self = (const Dictionary *)p_self;
+ memnew_placement(dest, String(JSON::print(Variant(*self))));
+ return raw_dest;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/dictionary.h b/modules/gdnative/godot/dictionary.h
new file mode 100644
index 0000000000..594b02b4dd
--- /dev/null
+++ b/modules/gdnative/godot/dictionary.h
@@ -0,0 +1,89 @@
+/*************************************************************************/
+/* dictionary.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_DICTIONARY_H
+#define GODOT_DICTIONARY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_DICTIONARY_SIZE 8
+
+#ifndef GODOT_CORE_API_GODOT_DICTIONARY_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_DICTIONARY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_DICTIONARY_SIZE];
+} godot_dictionary;
+#endif
+
+#include <godot/array.h>
+#include <godot/gdnative.h>
+#include <godot/variant.h>
+
+void GDAPI godot_dictionary_new(godot_dictionary *r_dest);
+void GDAPI godot_dictionary_new_copy(godot_dictionary *r_dest, const godot_dictionary *p_src);
+void GDAPI godot_dictionary_destroy(godot_dictionary *p_self);
+
+godot_int GDAPI godot_dictionary_size(const godot_dictionary *p_self);
+
+godot_bool GDAPI godot_dictionary_empty(const godot_dictionary *p_self);
+
+void GDAPI godot_dictionary_clear(godot_dictionary *p_self);
+
+godot_bool GDAPI godot_dictionary_has(const godot_dictionary *p_self, const godot_variant *p_key);
+
+godot_bool GDAPI godot_dictionary_has_all(const godot_dictionary *p_self, const godot_array *p_keys);
+
+void GDAPI godot_dictionary_erase(godot_dictionary *p_self, const godot_variant *p_key);
+
+godot_int GDAPI godot_dictionary_hash(const godot_dictionary *p_self);
+
+godot_array GDAPI godot_dictionary_keys(const godot_dictionary *p_self);
+
+godot_array GDAPI godot_dictionary_values(const godot_dictionary *p_self);
+
+godot_variant GDAPI godot_dictionary_get(const godot_dictionary *p_self, const godot_variant *p_key);
+void GDAPI godot_dictionary_set(godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_value);
+
+godot_variant GDAPI *godot_dictionary_operator_index(godot_dictionary *p_self, const godot_variant *p_key);
+
+godot_variant GDAPI *godot_dictionary_next(const godot_dictionary *p_self, const godot_variant *p_key);
+
+godot_bool GDAPI godot_dictionary_operator_equal(const godot_dictionary *p_self, const godot_dictionary *p_b);
+
+godot_string GDAPI godot_dictionary_to_json(const godot_dictionary *p_self);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_DICTIONARY_H
diff --git a/modules/gdnative/godot/gdnative.cpp b/modules/gdnative/godot/gdnative.cpp
new file mode 100644
index 0000000000..4cda1f4560
--- /dev/null
+++ b/modules/gdnative/godot/gdnative.cpp
@@ -0,0 +1,190 @@
+/*************************************************************************/
+/* gdnative.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/gdnative.h>
+
+#include "class_db.h"
+#include "error_macros.h"
+#include "gdnative.h"
+#include "global_constants.h"
+#include "os/os.h"
+#include "project_settings.h"
+#include "variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern "C" void _string_api_anchor();
+extern "C" void _vector2_api_anchor();
+extern "C" void _rect2_api_anchor();
+extern "C" void _vector3_api_anchor();
+extern "C" void _transform2d_api_anchor();
+extern "C" void _plane_api_anchor();
+extern "C" void _quat_api_anchor();
+extern "C" void _basis_api_anchor();
+extern "C" void _rect3_api_anchor();
+extern "C" void _transform_api_anchor();
+extern "C" void _color_api_anchor();
+extern "C" void _node_path_api_anchor();
+extern "C" void _rid_api_anchor();
+extern "C" void _dictionary_api_anchor();
+extern "C" void _array_api_anchor();
+extern "C" void _pool_arrays_api_anchor();
+extern "C" void _variant_api_anchor();
+
+void _api_anchor() {
+
+ _string_api_anchor();
+ _vector2_api_anchor();
+ _rect2_api_anchor();
+ _vector3_api_anchor();
+ _transform2d_api_anchor();
+ _plane_api_anchor();
+ _quat_api_anchor();
+ _rect3_api_anchor();
+ _basis_api_anchor();
+ _transform_api_anchor();
+ _color_api_anchor();
+ _node_path_api_anchor();
+ _rid_api_anchor();
+ _dictionary_api_anchor();
+ _array_api_anchor();
+ _pool_arrays_api_anchor();
+ _variant_api_anchor();
+}
+
+void GDAPI godot_object_destroy(godot_object *p_o) {
+ memdelete((Object *)p_o);
+}
+
+// Singleton API
+
+godot_object GDAPI *godot_global_get_singleton(char *p_name) {
+ return (godot_object *)ProjectSettings::get_singleton()->get_singleton_object(String(p_name));
+} // result shouldn't be freed
+
+void GDAPI *godot_get_stack_bottom() {
+ return OS::get_singleton()->get_stack_bottom();
+}
+
+// MethodBind API
+
+godot_method_bind GDAPI *godot_method_bind_get_method(const char *p_classname, const char *p_methodname) {
+
+ MethodBind *mb = ClassDB::get_method(StringName(p_classname), StringName(p_methodname));
+ // MethodBind *mb = ClassDB::get_method("Node", "get_name");
+ return (godot_method_bind *)mb;
+}
+
+void GDAPI godot_method_bind_ptrcall(godot_method_bind *p_method_bind, godot_object *p_instance, const void **p_args, void *p_ret) {
+
+ MethodBind *mb = (MethodBind *)p_method_bind;
+ Object *o = (Object *)p_instance;
+ mb->ptrcall(o, p_args, p_ret);
+}
+
+godot_variant GDAPI godot_method_bind_call(godot_method_bind *p_method_bind, godot_object *p_instance, const godot_variant **p_args, const int p_arg_count, godot_variant_call_error *p_call_error) {
+ MethodBind *mb = (MethodBind *)p_method_bind;
+ Object *o = (Object *)p_instance;
+ const Variant **args = (const Variant **)p_args;
+
+ godot_variant ret;
+ godot_variant_new_nil(&ret);
+
+ Variant *ret_val = (Variant *)&ret;
+
+ Variant::CallError r_error;
+ *ret_val = mb->call(o, args, p_arg_count, r_error);
+
+ if (p_call_error) {
+ p_call_error->error = (godot_variant_call_error_error)r_error.error;
+ p_call_error->argument = r_error.argument;
+ p_call_error->expected = (godot_variant_type)r_error.expected;
+ }
+
+ return ret;
+}
+
+// @Todo
+/*
+void GDAPI godot_method_bind_varcall(godot_method_bind *p_method_bind)
+{
+
+}
+*/
+
+godot_class_constructor GDAPI godot_get_class_constructor(const char *p_classname) {
+ ClassDB::ClassInfo *class_info = ClassDB::classes.getptr(StringName(p_classname));
+ if (class_info)
+ return (godot_class_constructor)class_info->creation_func;
+ return NULL;
+}
+
+godot_dictionary GDAPI godot_get_global_constants() {
+ godot_dictionary constants;
+ godot_dictionary_new(&constants);
+ Dictionary *p_constants = (Dictionary *)&constants;
+ const int constants_count = GlobalConstants::get_global_constant_count();
+ for (int i = 0; i < constants_count; ++i) {
+ const char *name = GlobalConstants::get_global_constant_name(i);
+ int value = GlobalConstants::get_global_constant_value(i);
+ (*p_constants)[name] = value;
+ }
+ return constants;
+}
+
+// System functions
+void GDAPI *godot_alloc(int p_bytes) {
+ return memalloc(p_bytes);
+}
+
+void GDAPI *godot_realloc(void *p_ptr, int p_bytes) {
+ return memrealloc(p_ptr, p_bytes);
+}
+
+void GDAPI godot_free(void *p_ptr) {
+ memfree(p_ptr);
+}
+
+void GDAPI godot_print_error(const char *p_description, const char *p_function, const char *p_file, int p_line) {
+ _err_print_error(p_function, p_file, p_line, p_description, ERR_HANDLER_ERROR);
+}
+
+void GDAPI godot_print_warning(const char *p_description, const char *p_function, const char *p_file, int p_line) {
+ _err_print_error(p_function, p_file, p_line, p_description, ERR_HANDLER_WARNING);
+}
+
+void GDAPI godot_print(const godot_string *p_message) {
+ print_line(*(String *)p_message);
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/gdnative.h b/modules/gdnative/godot/gdnative.h
new file mode 100644
index 0000000000..d849999079
--- /dev/null
+++ b/modules/gdnative/godot/gdnative.h
@@ -0,0 +1,303 @@
+/*************************************************************************/
+/* gdnative.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_GDNATIVE_H
+#define GODOT_GDNATIVE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef GDAPI_BUILT_IN
+#define GDAPI_EXPORT
+#endif
+
+#ifdef _WIN32
+#if defined(GDAPI_EXPORT)
+#define GDCALLINGCONV
+#define GDAPI __declspec(dllexport) GDCALLINGCONV
+#else
+#define GDCALLINGCONV
+#define GDAPI __declspec(dllimport) GDCALLINGCONV
+#endif
+#elif defined(__APPLE__)
+#include "TargetConditionals.h"
+#if TARGET_OS_IPHONE
+#define GDCALLINGCONV
+#define GDAPI
+#elif TARGET_OS_MAC
+#define GDCALLINGCONV __attribute__((sysv_abi))
+#define GDAPI GDCALLINGCONV
+#endif
+#else
+#define GDCALLINGCONV __attribute__((sysv_abi))
+#define GDAPI GDCALLINGCONV
+#endif
+
+// This is for libraries *using* the header, NOT GODOT EXPOSING STUFF!!
+#ifdef _WIN32
+#define GDN_EXPORT __declspec(dllexport)
+#else
+#define GDN_EXPORT
+#endif
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#define GODOT_API_VERSION 1
+
+////// Error
+
+typedef enum {
+ GODOT_OK,
+ GODOT_FAILED, ///< Generic fail error
+ GODOT_ERR_UNAVAILABLE, ///< What is requested is unsupported/unavailable
+ GODOT_ERR_UNCONFIGURED, ///< The object being used hasnt been properly set up yet
+ GODOT_ERR_UNAUTHORIZED, ///< Missing credentials for requested resource
+ GODOT_ERR_PARAMETER_RANGE_ERROR, ///< Parameter given out of range (5)
+ GODOT_ERR_OUT_OF_MEMORY, ///< Out of memory
+ GODOT_ERR_FILE_NOT_FOUND,
+ GODOT_ERR_FILE_BAD_DRIVE,
+ GODOT_ERR_FILE_BAD_PATH,
+ GODOT_ERR_FILE_NO_PERMISSION, // (10)
+ GODOT_ERR_FILE_ALREADY_IN_USE,
+ GODOT_ERR_FILE_CANT_OPEN,
+ GODOT_ERR_FILE_CANT_WRITE,
+ GODOT_ERR_FILE_CANT_READ,
+ GODOT_ERR_FILE_UNRECOGNIZED, // (15)
+ GODOT_ERR_FILE_CORRUPT,
+ GODOT_ERR_FILE_MISSING_DEPENDENCIES,
+ GODOT_ERR_FILE_EOF,
+ GODOT_ERR_CANT_OPEN, ///< Can't open a resource/socket/file
+ GODOT_ERR_CANT_CREATE, // (20)
+ GODOT_ERR_QUERY_FAILED,
+ GODOT_ERR_ALREADY_IN_USE,
+ GODOT_ERR_LOCKED, ///< resource is locked
+ GODOT_ERR_TIMEOUT,
+ GODOT_ERR_CANT_CONNECT, // (25)
+ GODOT_ERR_CANT_RESOLVE,
+ GODOT_ERR_CONNECTION_ERROR,
+ GODOT_ERR_CANT_AQUIRE_RESOURCE,
+ GODOT_ERR_CANT_FORK,
+ GODOT_ERR_INVALID_DATA, ///< Data passed is invalid (30)
+ GODOT_ERR_INVALID_PARAMETER, ///< Parameter passed is invalid
+ GODOT_ERR_ALREADY_EXISTS, ///< When adding, item already exists
+ GODOT_ERR_DOES_NOT_EXIST, ///< When retrieving/erasing, it item does not exist
+ GODOT_ERR_DATABASE_CANT_READ, ///< database is full
+ GODOT_ERR_DATABASE_CANT_WRITE, ///< database is full (35)
+ GODOT_ERR_COMPILATION_FAILED,
+ GODOT_ERR_METHOD_NOT_FOUND,
+ GODOT_ERR_LINK_FAILED,
+ GODOT_ERR_SCRIPT_FAILED,
+ GODOT_ERR_CYCLIC_LINK, // (40)
+ GODOT_ERR_INVALID_DECLARATION,
+ GODOT_ERR_DUPLICATE_SYMBOL,
+ GODOT_ERR_PARSE_ERROR,
+ GODOT_ERR_BUSY,
+ GODOT_ERR_SKIP, // (45)
+ GODOT_ERR_HELP, ///< user requested help!!
+ GODOT_ERR_BUG, ///< a bug in the software certainly happened, due to a double check failing or unexpected behavior.
+ GODOT_ERR_PRINTER_ON_FIRE, /// the parallel port printer is engulfed in flames
+ GODOT_ERR_OMFG_THIS_IS_VERY_VERY_BAD, ///< shit happens, has never been used, though
+ GODOT_ERR_WTF = GODOT_ERR_OMFG_THIS_IS_VERY_VERY_BAD ///< short version of the above
+} godot_error;
+
+////// bool
+
+typedef bool godot_bool;
+
+#define GODOT_TRUE 1
+#define GODOT_FALSE 0
+
+/////// int
+
+typedef int godot_int;
+
+/////// real
+
+typedef float godot_real;
+
+/////// Object (forward declared)
+typedef void godot_object;
+
+/////// Brute force forward declarations for the rest
+/*
+typedef struct godot_variant godot_variant;
+typedef struct godot_string godot_string;
+typedef struct godot_vector2 godot_vector2;
+typedef struct godot_rect2 godot_rect2;
+typedef struct godot_vector3 godot_vector3;
+typedef struct godot_transform2d godot_transform2d;
+typedef struct godot_plane godot_plane;
+typedef struct godot_quat godot_quat;
+typedef struct godot_rect3 godot_rect3;
+typedef struct godot_basis godot_basis;
+typedef struct godot_transform godot_transform;
+typedef struct godot_color godot_color;
+typedef struct godot_node_path godot_node_path;
+typedef struct godot_rid godot_rid;
+typedef struct godot_dictionary godot_dictionary;
+typedef struct godot_array godot_array;
+typedef struct godot_pool_byte_array godot_pool_byte_array;
+typedef struct godot_pool_int_array godot_pool_int_array;
+typedef struct godot_pool_real_array godot_pool_real_array;
+typedef struct godot_pool_string_array godot_pool_string_array;
+typedef struct godot_pool_vector2_array godot_pool_vector2_array;
+typedef struct godot_pool_vector3_array godot_pool_vector3_array;
+typedef struct godot_pool_color_array godot_pool_color_array;
+*/
+/////// String
+
+#include <godot/string.h>
+
+////// Vector2
+
+#include <godot/vector2.h>
+
+////// Rect2
+
+#include <godot/rect2.h>
+
+////// Vector3
+
+#include <godot/vector3.h>
+
+////// Transform2D
+
+#include <godot/transform2d.h>
+
+/////// Plane
+
+#include <godot/plane.h>
+
+/////// Quat
+
+#include <godot/quat.h>
+
+/////// Rect3
+
+#include <godot/rect3.h>
+
+/////// Basis
+
+#include <godot/basis.h>
+
+/////// Transform
+
+#include <godot/transform.h>
+
+/////// Color
+
+#include <godot/color.h>
+
+/////// NodePath
+
+#include <godot/node_path.h>
+
+/////// RID
+
+#include <godot/rid.h>
+
+/////// Dictionary
+
+#include <godot/dictionary.h>
+
+/////// Array
+
+#include <godot/array.h>
+
+// single API file for Pool*Array
+#include <godot/pool_arrays.h>
+
+void GDAPI godot_object_destroy(godot_object *p_o);
+
+////// Variant
+
+#include <godot/variant.h>
+
+////// Singleton API
+
+godot_object GDAPI *godot_global_get_singleton(char *p_name); // result shouldn't be freed
+
+////// OS API
+
+void GDAPI *godot_get_stack_bottom(); // returns stack bottom of the main thread
+
+////// MethodBind API
+
+typedef struct {
+ uint8_t _dont_touch_that[1]; // TODO
+} godot_method_bind;
+
+godot_method_bind GDAPI *godot_method_bind_get_method(const char *p_classname, const char *p_methodname);
+void GDAPI godot_method_bind_ptrcall(godot_method_bind *p_method_bind, godot_object *p_instance, const void **p_args, void *p_ret);
+godot_variant GDAPI godot_method_bind_call(godot_method_bind *p_method_bind, godot_object *p_instance, const godot_variant **p_args, const int p_arg_count, godot_variant_call_error *p_call_error);
+////// Script API
+
+typedef struct {
+ godot_bool in_editor;
+ uint64_t core_api_hash;
+ uint64_t editor_api_hash;
+ uint64_t no_api_hash;
+ godot_object *gd_native_library; // pointer to GDNativeLibrary that is being initialized
+} godot_gdnative_init_options;
+
+typedef struct {
+ godot_bool in_editor;
+} godot_gdnative_terminate_options;
+
+// Calling convention?
+typedef godot_object *(*godot_class_constructor)();
+
+godot_class_constructor GDAPI godot_get_class_constructor(const char *p_classname);
+
+godot_dictionary GDAPI godot_get_global_constants();
+
+////// GDNative procedure types
+typedef void (*godot_gdnative_init_fn)(godot_gdnative_init_options *);
+typedef void (*godot_gdnative_terminate_fn)(godot_gdnative_terminate_options *);
+typedef godot_variant (*godot_gdnative_procedure_fn)(void *, godot_array *);
+
+////// System Functions
+
+//using these will help Godot track how much memory is in use in debug mode
+void GDAPI *godot_alloc(int p_bytes);
+void GDAPI *godot_realloc(void *p_ptr, int p_bytes);
+void GDAPI godot_free(void *p_ptr);
+
+//print using Godot's error handler list
+void GDAPI godot_print_error(const char *p_description, const char *p_function, const char *p_file, int p_line);
+void GDAPI godot_print_warning(const char *p_description, const char *p_function, const char *p_file, int p_line);
+void GDAPI godot_print(const godot_string *p_message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_C_H
diff --git a/modules/gdnative/godot/icon.png.import b/modules/gdnative/godot/icon.png.import
new file mode 100644
index 0000000000..27920124f9
--- /dev/null
+++ b/modules/gdnative/godot/icon.png.import
@@ -0,0 +1,23 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/icon.png-aa47d037a37fb38b3b7e7828e4eec407.stex"
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=true
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+stream=false
+size_limit=0
+detect_3d=true
diff --git a/modules/gdnative/godot/node_path.cpp b/modules/gdnative/godot/node_path.cpp
new file mode 100644
index 0000000000..f4179361be
--- /dev/null
+++ b/modules/gdnative/godot/node_path.cpp
@@ -0,0 +1,116 @@
+/*************************************************************************/
+/* node_path.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/node_path.h>
+
+#include "core/node_path.h"
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _node_path_api_anchor() {}
+
+void GDAPI godot_node_path_new(godot_node_path *r_dest, const godot_string *p_from) {
+ NodePath *dest = (NodePath *)r_dest;
+ const String *from = (const String *)p_from;
+ memnew_placement(dest, NodePath(*from));
+}
+
+void GDAPI godot_node_path_new_copy(godot_node_path *r_dest, const godot_node_path *p_src) {
+ NodePath *dest = (NodePath *)r_dest;
+ const NodePath *src = (const NodePath *)p_src;
+ memnew_placement(dest, NodePath(*src));
+}
+
+void GDAPI godot_node_path_destroy(godot_node_path *p_self) {
+ NodePath *self = (NodePath *)p_self;
+ self->~NodePath();
+}
+
+godot_string GDAPI godot_node_path_as_string(const godot_node_path *p_self) {
+ godot_string ret;
+ const NodePath *self = (const NodePath *)p_self;
+ memnew_placement(&ret, String(*self));
+ return ret;
+}
+
+godot_bool GDAPI godot_node_path_is_absolute(const godot_node_path *p_self) {
+ const NodePath *self = (const NodePath *)p_self;
+ return self->is_absolute();
+}
+
+godot_int GDAPI godot_node_path_get_name_count(const godot_node_path *p_self) {
+ const NodePath *self = (const NodePath *)p_self;
+ return self->get_name_count();
+}
+
+godot_string GDAPI godot_node_path_get_name(const godot_node_path *p_self, const godot_int p_idx) {
+ godot_string dest;
+ const NodePath *self = (const NodePath *)p_self;
+
+ memnew_placement(&dest, String(self->get_name(p_idx)));
+ return dest;
+}
+
+godot_int GDAPI godot_node_path_get_subname_count(const godot_node_path *p_self) {
+ const NodePath *self = (const NodePath *)p_self;
+ return self->get_subname_count();
+}
+
+godot_string GDAPI godot_node_path_get_subname(const godot_node_path *p_self, const godot_int p_idx) {
+ godot_string dest;
+ const NodePath *self = (const NodePath *)p_self;
+
+ memnew_placement(&dest, String(self->get_subname(p_idx)));
+ return dest;
+}
+
+godot_string GDAPI godot_node_path_get_property(const godot_node_path *p_self) {
+ godot_string dest;
+ const NodePath *self = (const NodePath *)p_self;
+ memnew_placement(&dest, String(self->get_property()));
+ return dest;
+}
+
+godot_bool GDAPI godot_node_path_is_empty(const godot_node_path *p_self) {
+ const NodePath *self = (const NodePath *)p_self;
+ return self->is_empty();
+}
+
+godot_bool GDAPI godot_node_path_operator_equal(const godot_node_path *p_self, const godot_node_path *p_b) {
+ const NodePath *self = (const NodePath *)p_self;
+ const NodePath *b = (const NodePath *)p_b;
+ return *self == *b;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/platform/osx/context_gl_osx.cpp b/modules/gdnative/godot/node_path.h
index 0737e3d3c6..4d3dc4e0ee 100644
--- a/platform/osx/context_gl_osx.cpp
+++ b/modules/gdnative/godot/node_path.h
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* context_gl_osx.cpp */
+/* node_path.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,77 +27,51 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "context_gl_osx.h"
+#ifndef GODOT_NODE_PATH_H
+#define GODOT_NODE_PATH_H
-#ifdef OSX_ENABLED
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
-
-void ContextGL_OSX::release_current() {
-
- aglSetCurrentContext(context);
-}
-
-void ContextGL_OSX::make_current() {
-
- aglSetCurrentContext(NULL);
-}
-void ContextGL_OSX::swap_buffers() {
-
- aglSwapBuffers(context);
-}
+#ifdef __cplusplus
+extern "C" {
+#endif
-Error ContextGL_OSX::initialize() {
+#include <stdint.h>
- if ((Ptr)kUnresolvedCFragSymbolAddress == (Ptr)aglChoosePixelFormat)
- return FAILED;
+#define GODOT_NODE_PATH_SIZE 8
- GLint attributes[] = { AGL_RGBA,
- AGL_DOUBLEBUFFER,
- AGL_DEPTH_SIZE, 32,
- AGL_NO_RECOVERY,
- AGL_NONE,
- AGL_NONE };
+#ifndef GODOT_CORE_API_GODOT_NODE_PATH_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_NODE_PATH_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_NODE_PATH_SIZE];
+} godot_node_path;
+#endif
- AGLPixelFormat format = NULL;
+#include <godot/gdnative.h>
+#include <godot/string.h>
- format = aglChoosePixelFormat(NULL, 0, attributes);
+void GDAPI godot_node_path_new(godot_node_path *r_dest, const godot_string *p_from);
+void GDAPI godot_node_path_new_copy(godot_node_path *r_dest, const godot_node_path *p_src);
+void GDAPI godot_node_path_destroy(godot_node_path *p_self);
- if (!format)
- return FAILED;
+godot_string GDAPI godot_node_path_as_string(const godot_node_path *p_self);
- context = aglCreateContext(format, 0);
+godot_bool GDAPI godot_node_path_is_absolute(const godot_node_path *p_self);
- if (!context)
- return FAILED;
+godot_int GDAPI godot_node_path_get_name_count(const godot_node_path *p_self);
- aglDestroyPixelFormat(format);
+godot_string GDAPI godot_node_path_get_name(const godot_node_path *p_self, const godot_int p_idx);
- aglSetWindowRef(context, window);
+godot_int GDAPI godot_node_path_get_subname_count(const godot_node_path *p_self);
- GLint swapInterval = 1;
- aglSetInteger(context, AGL_SWAP_INTERVAL, &swapInterval);
+godot_string GDAPI godot_node_path_get_subname(const godot_node_path *p_self, const godot_int p_idx);
- aglSetCurrentContext(context);
+godot_string GDAPI godot_node_path_get_property(const godot_node_path *p_self);
- return OK;
-}
+godot_bool GDAPI godot_node_path_is_empty(const godot_node_path *p_self);
-ContextGL_OSX::ContextGL_OSX(WindowRef p_window) {
+godot_bool GDAPI godot_node_path_operator_equal(const godot_node_path *p_self, const godot_node_path *p_b);
- window = p_window;
+#ifdef __cplusplus
}
-
-ContextGL_OSX::~ContextGL_OSX() {
-
- if (context)
- aglDestroyContext(context);
-}
-
-#endif
#endif
+
+#endif // GODOT_NODE_PATH_H
diff --git a/modules/gdnative/godot/plane.cpp b/modules/gdnative/godot/plane.cpp
new file mode 100644
index 0000000000..5c5b302345
--- /dev/null
+++ b/modules/gdnative/godot/plane.cpp
@@ -0,0 +1,178 @@
+/*************************************************************************/
+/* plane.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/plane.h>
+
+#include "core/math/plane.h"
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _plane_api_anchor() {}
+
+void GDAPI godot_plane_new_with_reals(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d) {
+
+ Plane *dest = (Plane *)r_dest;
+ *dest = Plane(p_a, p_b, p_c, p_d);
+}
+
+void GDAPI godot_plane_new_with_vectors(godot_plane *r_dest, const godot_vector3 *p_v1, const godot_vector3 *p_v2, const godot_vector3 *p_v3) {
+ const Vector3 *v1 = (const Vector3 *)p_v1;
+ const Vector3 *v2 = (const Vector3 *)p_v2;
+ const Vector3 *v3 = (const Vector3 *)p_v3;
+ Plane *dest = (Plane *)r_dest;
+ *dest = Plane(*v1, *v2, *v3);
+}
+
+void GDAPI godot_plane_new_with_normal(godot_plane *r_dest, const godot_vector3 *p_normal, const godot_real p_d) {
+ const Vector3 *normal = (const Vector3 *)p_normal;
+ Plane *dest = (Plane *)r_dest;
+ *dest = Plane(*normal, p_d);
+}
+
+godot_string GDAPI godot_plane_as_string(const godot_plane *p_self) {
+ godot_string ret;
+ const Plane *self = (const Plane *)p_self;
+ memnew_placement(&ret, String(*self));
+ return ret;
+}
+
+godot_plane GDAPI godot_plane_normalized(const godot_plane *p_self) {
+ godot_plane dest;
+ const Plane *self = (const Plane *)p_self;
+ *((Plane *)&dest) = self->normalized();
+ return dest;
+}
+
+godot_vector3 GDAPI godot_plane_center(const godot_plane *p_self) {
+ godot_vector3 dest;
+ const Plane *self = (const Plane *)p_self;
+ *((Vector3 *)&dest) = self->center();
+ return dest;
+}
+
+godot_vector3 GDAPI godot_plane_get_any_point(const godot_plane *p_self) {
+ godot_vector3 dest;
+ const Plane *self = (const Plane *)p_self;
+ *((Vector3 *)&dest) = self->get_any_point();
+ return dest;
+}
+
+godot_bool GDAPI godot_plane_is_point_over(const godot_plane *p_self, const godot_vector3 *p_point) {
+ const Plane *self = (const Plane *)p_self;
+ const Vector3 *point = (const Vector3 *)p_point;
+ return self->is_point_over(*point);
+}
+
+godot_real GDAPI godot_plane_distance_to(const godot_plane *p_self, const godot_vector3 *p_point) {
+ const Plane *self = (const Plane *)p_self;
+ const Vector3 *point = (const Vector3 *)p_point;
+ return self->distance_to(*point);
+}
+
+godot_bool GDAPI godot_plane_has_point(const godot_plane *p_self, const godot_vector3 *p_point, const godot_real p_epsilon) {
+ const Plane *self = (const Plane *)p_self;
+ const Vector3 *point = (const Vector3 *)p_point;
+ return self->has_point(*point, p_epsilon);
+}
+
+godot_vector3 GDAPI godot_plane_project(const godot_plane *p_self, const godot_vector3 *p_point) {
+ godot_vector3 dest;
+ const Plane *self = (const Plane *)p_self;
+ const Vector3 *point = (const Vector3 *)p_point;
+ *((Vector3 *)&dest) = self->project(*point);
+ return dest;
+}
+
+godot_bool GDAPI godot_plane_intersect_3(const godot_plane *p_self, godot_vector3 *r_dest, const godot_plane *p_b, const godot_plane *p_c) {
+ const Plane *self = (const Plane *)p_self;
+ const Plane *b = (const Plane *)p_b;
+ const Plane *c = (const Plane *)p_c;
+ Vector3 *dest = (Vector3 *)r_dest;
+ return self->intersect_3(*b, *c, dest);
+}
+
+godot_bool GDAPI godot_plane_intersects_ray(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_from, const godot_vector3 *p_dir) {
+ const Plane *self = (const Plane *)p_self;
+ const Vector3 *from = (const Vector3 *)p_from;
+ const Vector3 *dir = (const Vector3 *)p_dir;
+ Vector3 *dest = (Vector3 *)r_dest;
+ return self->intersects_ray(*from, *dir, dest);
+}
+
+godot_bool GDAPI godot_plane_intersects_segment(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_begin, const godot_vector3 *p_end) {
+ const Plane *self = (const Plane *)p_self;
+ const Vector3 *begin = (const Vector3 *)p_begin;
+ const Vector3 *end = (const Vector3 *)p_end;
+ Vector3 *dest = (Vector3 *)r_dest;
+ return self->intersects_segment(*begin, *end, dest);
+}
+
+godot_plane GDAPI godot_plane_operator_neg(const godot_plane *p_self) {
+ godot_plane raw_dest;
+ Plane *dest = (Plane *)&raw_dest;
+ const Plane *self = (const Plane *)p_self;
+ *dest = -(*self);
+ return raw_dest;
+}
+
+godot_bool GDAPI godot_plane_operator_equal(const godot_plane *p_self, const godot_plane *p_b) {
+ const Plane *self = (const Plane *)p_self;
+ const Plane *b = (const Plane *)p_b;
+ return *self == *b;
+}
+
+void GDAPI godot_plane_set_normal(godot_plane *p_self, const godot_vector3 *p_normal) {
+ Plane *self = (Plane *)p_self;
+ const Vector3 *normal = (const Vector3 *)p_normal;
+ self->set_normal(*normal);
+}
+
+godot_vector3 GDAPI godot_plane_get_normal(const godot_plane *p_self) {
+ const Plane *self = (const Plane *)p_self;
+ const Vector3 normal = self->get_normal();
+ godot_vector3 *v3 = (godot_vector3 *)&normal;
+ return *v3;
+}
+
+godot_real GDAPI godot_plane_get_d(const godot_plane *p_self) {
+ const Plane *self = (const Plane *)p_self;
+ return self->d;
+}
+
+void GDAPI godot_plane_set_d(godot_plane *p_self, const godot_real p_d) {
+ Plane *self = (Plane *)p_self;
+ self->d = p_d;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/plane.h b/modules/gdnative/godot/plane.h
new file mode 100644
index 0000000000..8519ac60c4
--- /dev/null
+++ b/modules/gdnative/godot/plane.h
@@ -0,0 +1,93 @@
+/*************************************************************************/
+/* plane.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_PLANE_H
+#define GODOT_PLANE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_PLANE_SIZE 16
+
+#ifndef GODOT_CORE_API_GODOT_PLANE_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_PLANE_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_PLANE_SIZE];
+} godot_plane;
+#endif
+
+#include <godot/gdnative.h>
+#include <godot/vector3.h>
+
+void GDAPI godot_plane_new_with_reals(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d);
+void GDAPI godot_plane_new_with_vectors(godot_plane *r_dest, const godot_vector3 *p_v1, const godot_vector3 *p_v2, const godot_vector3 *p_v3);
+void GDAPI godot_plane_new_with_normal(godot_plane *r_dest, const godot_vector3 *p_normal, const godot_real p_d);
+
+godot_string GDAPI godot_plane_as_string(const godot_plane *p_self);
+
+godot_plane GDAPI godot_plane_normalized(const godot_plane *p_self);
+
+godot_vector3 GDAPI godot_plane_center(const godot_plane *p_self);
+
+godot_vector3 GDAPI godot_plane_get_any_point(const godot_plane *p_self);
+
+godot_bool GDAPI godot_plane_is_point_over(const godot_plane *p_self, const godot_vector3 *p_point);
+
+godot_real GDAPI godot_plane_distance_to(const godot_plane *p_self, const godot_vector3 *p_point);
+
+godot_bool GDAPI godot_plane_has_point(const godot_plane *p_self, const godot_vector3 *p_point, const godot_real p_epsilon);
+
+godot_vector3 GDAPI godot_plane_project(const godot_plane *p_self, const godot_vector3 *p_point);
+
+godot_bool GDAPI godot_plane_intersect_3(const godot_plane *p_self, godot_vector3 *r_dest, const godot_plane *p_b, const godot_plane *p_c);
+
+godot_bool GDAPI godot_plane_intersects_ray(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_from, const godot_vector3 *p_dir);
+
+godot_bool GDAPI godot_plane_intersects_segment(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_begin, const godot_vector3 *p_end);
+
+godot_plane GDAPI godot_plane_operator_neg(const godot_plane *p_self);
+
+godot_bool GDAPI godot_plane_operator_equal(const godot_plane *p_self, const godot_plane *p_b);
+
+void GDAPI godot_plane_set_normal(godot_plane *p_self, const godot_vector3 *p_normal);
+
+godot_vector3 GDAPI godot_plane_get_normal(const godot_plane *p_self);
+
+godot_real GDAPI godot_plane_get_d(const godot_plane *p_self);
+
+void GDAPI godot_plane_set_d(godot_plane *p_self, const godot_real p_d);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_PLANE_H
diff --git a/modules/gdnative/godot/pool_arrays.cpp b/modules/gdnative/godot/pool_arrays.cpp
new file mode 100644
index 0000000000..fa460be8bc
--- /dev/null
+++ b/modules/gdnative/godot/pool_arrays.cpp
@@ -0,0 +1,633 @@
+/*************************************************************************/
+/* pool_arrays.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/pool_arrays.h>
+
+#include "array.h"
+#include "core/variant.h"
+#include "dvector.h"
+
+#include "core/color.h"
+#include "core/math/math_2d.h"
+#include "core/math/vector3.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _pool_arrays_api_anchor() {
+}
+
+#define memnew_placement_custom(m_placement, m_class, m_constr) _post_initialize(new (m_placement, sizeof(m_class), "") m_constr)
+
+// byte
+
+void GDAPI godot_pool_byte_array_new(godot_pool_byte_array *r_dest) {
+ PoolVector<uint8_t> *dest = (PoolVector<uint8_t> *)r_dest;
+ memnew_placement(dest, PoolVector<uint8_t>);
+}
+
+void GDAPI godot_pool_byte_array_new_copy(godot_pool_byte_array *r_dest, const godot_pool_byte_array *p_src) {
+ PoolVector<uint8_t> *dest = (PoolVector<uint8_t> *)r_dest;
+ const PoolVector<uint8_t> *src = (const PoolVector<uint8_t> *)p_src;
+ memnew_placement(dest, PoolVector<uint8_t>(*src));
+}
+
+void GDAPI godot_pool_byte_array_new_with_array(godot_pool_byte_array *r_dest, const godot_array *p_a) {
+ PoolVector<uint8_t> *dest = (PoolVector<uint8_t> *)r_dest;
+ Array *a = (Array *)p_a;
+ memnew_placement(dest, PoolVector<uint8_t>);
+
+ dest->resize(a->size());
+ for (size_t i = 0; i < a->size(); i++) {
+ dest->set(i, (*a)[i]);
+ }
+}
+
+void GDAPI godot_pool_byte_array_append(godot_pool_byte_array *p_self, const uint8_t p_data) {
+ PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self;
+ self->append(p_data);
+}
+
+void GDAPI godot_pool_byte_array_append_array(godot_pool_byte_array *p_self, const godot_pool_byte_array *p_array) {
+ PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self;
+ PoolVector<uint8_t> *array = (PoolVector<uint8_t> *)p_array;
+ self->append_array(*array);
+}
+
+godot_error GDAPI godot_pool_byte_array_insert(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data) {
+ PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self;
+ return (godot_error)self->insert(p_idx, p_data);
+}
+
+void GDAPI godot_pool_byte_array_invert(godot_pool_byte_array *p_self) {
+ PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self;
+ self->invert();
+}
+
+void GDAPI godot_pool_byte_array_push_back(godot_pool_byte_array *p_self, const uint8_t p_data) {
+ PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self;
+ self->push_back(p_data);
+}
+
+void GDAPI godot_pool_byte_array_remove(godot_pool_byte_array *p_self, const godot_int p_idx) {
+ PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self;
+ self->remove(p_idx);
+}
+
+void GDAPI godot_pool_byte_array_resize(godot_pool_byte_array *p_self, const godot_int p_size) {
+ PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self;
+ self->resize(p_size);
+}
+
+void GDAPI godot_pool_byte_array_set(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data) {
+ PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self;
+ self->set(p_idx, p_data);
+}
+
+uint8_t GDAPI godot_pool_byte_array_get(const godot_pool_byte_array *p_self, const godot_int p_idx) {
+ const PoolVector<uint8_t> *self = (const PoolVector<uint8_t> *)p_self;
+ return self->get(p_idx);
+}
+
+godot_int GDAPI godot_pool_byte_array_size(const godot_pool_byte_array *p_self) {
+ const PoolVector<uint8_t> *self = (const PoolVector<uint8_t> *)p_self;
+ return self->size();
+}
+
+void GDAPI godot_pool_byte_array_destroy(godot_pool_byte_array *p_self) {
+ ((PoolVector<uint8_t> *)p_self)->~PoolVector();
+}
+
+// int
+
+void GDAPI godot_pool_int_array_new(godot_pool_int_array *r_dest) {
+ PoolVector<godot_int> *dest = (PoolVector<godot_int> *)r_dest;
+ memnew_placement(dest, PoolVector<godot_int>);
+}
+
+void GDAPI godot_pool_int_array_new_copy(godot_pool_int_array *r_dest, const godot_pool_int_array *p_src) {
+ PoolVector<godot_int> *dest = (PoolVector<godot_int> *)r_dest;
+ const PoolVector<godot_int> *src = (const PoolVector<godot_int> *)p_src;
+ memnew_placement(dest, PoolVector<godot_int>(*src));
+}
+
+void GDAPI godot_pool_int_array_new_with_array(godot_pool_int_array *r_dest, const godot_array *p_a) {
+ PoolVector<godot_int> *dest = (PoolVector<godot_int> *)r_dest;
+ Array *a = (Array *)p_a;
+ memnew_placement(dest, PoolVector<godot_int>);
+
+ dest->resize(a->size());
+ for (size_t i = 0; i < a->size(); i++) {
+ dest->set(i, (*a)[i]);
+ }
+}
+
+void GDAPI godot_pool_int_array_append(godot_pool_int_array *p_self, const godot_int p_data) {
+ PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self;
+ self->append(p_data);
+}
+
+void GDAPI godot_pool_int_array_append_array(godot_pool_int_array *p_self, const godot_pool_int_array *p_array) {
+ PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self;
+ PoolVector<godot_int> *array = (PoolVector<godot_int> *)p_array;
+ self->append_array(*array);
+}
+
+godot_error GDAPI godot_pool_int_array_insert(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data) {
+ PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self;
+ return (godot_error)self->insert(p_idx, p_data);
+}
+
+void GDAPI godot_pool_int_array_invert(godot_pool_int_array *p_self) {
+ PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self;
+ self->invert();
+}
+
+void GDAPI godot_pool_int_array_push_back(godot_pool_int_array *p_self, const godot_int p_data) {
+ PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self;
+ self->push_back(p_data);
+}
+
+void GDAPI godot_pool_int_array_remove(godot_pool_int_array *p_self, const godot_int p_idx) {
+ PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self;
+ self->remove(p_idx);
+}
+
+void GDAPI godot_pool_int_array_resize(godot_pool_int_array *p_self, const godot_int p_size) {
+ PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self;
+ self->resize(p_size);
+}
+
+void GDAPI godot_pool_int_array_set(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data) {
+ PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self;
+ self->set(p_idx, p_data);
+}
+
+godot_int GDAPI godot_pool_int_array_get(const godot_pool_int_array *p_self, const godot_int p_idx) {
+ const PoolVector<godot_int> *self = (const PoolVector<godot_int> *)p_self;
+ return self->get(p_idx);
+}
+
+godot_int GDAPI godot_pool_int_array_size(const godot_pool_int_array *p_self) {
+ const PoolVector<godot_int> *self = (const PoolVector<godot_int> *)p_self;
+ return self->size();
+}
+
+void GDAPI godot_pool_int_array_destroy(godot_pool_int_array *p_self) {
+ ((PoolVector<godot_int> *)p_self)->~PoolVector();
+}
+
+// real
+
+void GDAPI godot_pool_real_array_new(godot_pool_real_array *r_dest) {
+ PoolVector<godot_real> *dest = (PoolVector<godot_real> *)r_dest;
+ memnew_placement(dest, PoolVector<godot_real>);
+}
+
+void GDAPI godot_pool_real_array_new_copy(godot_pool_real_array *r_dest, const godot_pool_real_array *p_src) {
+ PoolVector<godot_real> *dest = (PoolVector<godot_real> *)r_dest;
+ const PoolVector<godot_real> *src = (const PoolVector<godot_real> *)p_src;
+ memnew_placement(dest, PoolVector<godot_real>(*src));
+}
+
+void GDAPI godot_pool_real_array_new_with_array(godot_pool_real_array *r_dest, const godot_array *p_a) {
+ PoolVector<godot_real> *dest = (PoolVector<godot_real> *)r_dest;
+ Array *a = (Array *)p_a;
+ memnew_placement(dest, PoolVector<godot_real>);
+
+ dest->resize(a->size());
+ for (size_t i = 0; i < a->size(); i++) {
+ dest->set(i, (*a)[i]);
+ }
+}
+
+void GDAPI godot_pool_real_array_append(godot_pool_real_array *p_self, const godot_real p_data) {
+ PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self;
+ self->append(p_data);
+}
+
+void GDAPI godot_pool_real_array_append_array(godot_pool_real_array *p_self, const godot_pool_real_array *p_array) {
+ PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self;
+ PoolVector<godot_real> *array = (PoolVector<godot_real> *)p_array;
+ self->append_array(*array);
+}
+
+godot_error GDAPI godot_pool_real_array_insert(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data) {
+ PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self;
+ return (godot_error)self->insert(p_idx, p_data);
+}
+
+void GDAPI godot_pool_real_array_invert(godot_pool_real_array *p_self) {
+ PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self;
+ self->invert();
+}
+
+void GDAPI godot_pool_real_array_push_back(godot_pool_real_array *p_self, const godot_real p_data) {
+ PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self;
+ self->push_back(p_data);
+}
+
+void GDAPI godot_pool_real_array_remove(godot_pool_real_array *p_self, const godot_int p_idx) {
+ PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self;
+ self->remove(p_idx);
+}
+
+void GDAPI godot_pool_real_array_resize(godot_pool_real_array *p_self, const godot_int p_size) {
+ PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self;
+ self->resize(p_size);
+}
+
+void GDAPI godot_pool_real_array_set(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data) {
+ PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self;
+ self->set(p_idx, p_data);
+}
+
+godot_real GDAPI godot_pool_real_array_get(const godot_pool_real_array *p_self, const godot_int p_idx) {
+ const PoolVector<godot_real> *self = (const PoolVector<godot_real> *)p_self;
+ return self->get(p_idx);
+}
+
+godot_int GDAPI godot_pool_real_array_size(const godot_pool_real_array *p_self) {
+ const PoolVector<godot_real> *self = (const PoolVector<godot_real> *)p_self;
+ return self->size();
+}
+
+void GDAPI godot_pool_real_array_destroy(godot_pool_real_array *p_self) {
+ ((PoolVector<godot_real> *)p_self)->~PoolVector();
+}
+
+// string
+
+void GDAPI godot_pool_string_array_new(godot_pool_string_array *r_dest) {
+ PoolVector<String> *dest = (PoolVector<String> *)r_dest;
+ memnew_placement(dest, PoolVector<String>);
+}
+
+void GDAPI godot_pool_string_array_new_copy(godot_pool_string_array *r_dest, const godot_pool_string_array *p_src) {
+ PoolVector<String> *dest = (PoolVector<String> *)r_dest;
+ const PoolVector<String> *src = (const PoolVector<String> *)p_src;
+ memnew_placement(dest, PoolVector<String>(*src));
+}
+
+void GDAPI godot_pool_string_array_new_with_array(godot_pool_string_array *r_dest, const godot_array *p_a) {
+ PoolVector<String> *dest = (PoolVector<String> *)r_dest;
+ Array *a = (Array *)p_a;
+ memnew_placement(dest, PoolVector<String>);
+
+ dest->resize(a->size());
+ for (size_t i = 0; i < a->size(); i++) {
+ dest->set(i, (*a)[i]);
+ }
+}
+
+void GDAPI godot_pool_string_array_append(godot_pool_string_array *p_self, const godot_string *p_data) {
+ PoolVector<String> *self = (PoolVector<String> *)p_self;
+ String &s = *(String *)p_data;
+ self->append(s);
+}
+
+void GDAPI godot_pool_string_array_append_array(godot_pool_string_array *p_self, const godot_pool_string_array *p_array) {
+ PoolVector<String> *self = (PoolVector<String> *)p_self;
+ PoolVector<String> *array = (PoolVector<String> *)p_array;
+ self->append_array(*array);
+}
+
+godot_error GDAPI godot_pool_string_array_insert(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data) {
+ PoolVector<String> *self = (PoolVector<String> *)p_self;
+ String &s = *(String *)p_data;
+ return (godot_error)self->insert(p_idx, s);
+}
+
+void GDAPI godot_pool_string_array_invert(godot_pool_string_array *p_self) {
+ PoolVector<String> *self = (PoolVector<String> *)p_self;
+ self->invert();
+}
+
+void GDAPI godot_pool_string_array_push_back(godot_pool_string_array *p_self, const godot_string *p_data) {
+ PoolVector<String> *self = (PoolVector<String> *)p_self;
+ String &s = *(String *)p_data;
+ self->push_back(s);
+}
+
+void GDAPI godot_pool_string_array_remove(godot_pool_string_array *p_self, const godot_int p_idx) {
+ PoolVector<String> *self = (PoolVector<String> *)p_self;
+ self->remove(p_idx);
+}
+
+void GDAPI godot_pool_string_array_resize(godot_pool_string_array *p_self, const godot_int p_size) {
+ PoolVector<String> *self = (PoolVector<String> *)p_self;
+ self->resize(p_size);
+}
+
+void GDAPI godot_pool_string_array_set(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data) {
+ PoolVector<String> *self = (PoolVector<String> *)p_self;
+ String &s = *(String *)p_data;
+ self->set(p_idx, s);
+}
+
+godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_self, const godot_int p_idx) {
+ const PoolVector<String> *self = (const PoolVector<String> *)p_self;
+ godot_string str;
+ String *s = (String *)&str;
+ memnew_placement(s, String);
+ *s = self->get(p_idx);
+ return str;
+}
+
+godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_self) {
+ const PoolVector<String> *self = (const PoolVector<String> *)p_self;
+ return self->size();
+}
+
+void GDAPI godot_pool_string_array_destroy(godot_pool_string_array *p_self) {
+ ((PoolVector<String> *)p_self)->~PoolVector();
+}
+
+// vector2
+
+void GDAPI godot_pool_vector2_array_new(godot_pool_vector2_array *r_dest) {
+ PoolVector<Vector2> *dest = (PoolVector<Vector2> *)r_dest;
+ memnew_placement(dest, PoolVector<Vector2>);
+}
+
+void GDAPI godot_pool_vector2_array_new_copy(godot_pool_vector2_array *r_dest, const godot_pool_vector2_array *p_src) {
+ PoolVector<Vector2> *dest = (PoolVector<Vector2> *)r_dest;
+ const PoolVector<Vector2> *src = (const PoolVector<Vector2> *)p_src;
+ memnew_placement(dest, PoolVector<Vector2>(*src));
+}
+
+void GDAPI godot_pool_vector2_array_new_with_array(godot_pool_vector2_array *r_dest, const godot_array *p_a) {
+ PoolVector<Vector2> *dest = (PoolVector<Vector2> *)r_dest;
+ Array *a = (Array *)p_a;
+ memnew_placement(dest, PoolVector<Vector2>);
+
+ dest->resize(a->size());
+ for (size_t i = 0; i < a->size(); i++) {
+ dest->set(i, (*a)[i]);
+ }
+}
+
+void GDAPI godot_pool_vector2_array_append(godot_pool_vector2_array *p_self, const godot_vector2 *p_data) {
+ PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self;
+ Vector2 &s = *(Vector2 *)p_data;
+ self->append(s);
+}
+
+void GDAPI godot_pool_vector2_array_append_array(godot_pool_vector2_array *p_self, const godot_pool_vector2_array *p_array) {
+ PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self;
+ PoolVector<Vector2> *array = (PoolVector<Vector2> *)p_array;
+ self->append_array(*array);
+}
+
+godot_error GDAPI godot_pool_vector2_array_insert(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data) {
+ PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self;
+ Vector2 &s = *(Vector2 *)p_data;
+ return (godot_error)self->insert(p_idx, s);
+}
+
+void GDAPI godot_pool_vector2_array_invert(godot_pool_vector2_array *p_self) {
+ PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self;
+ self->invert();
+}
+
+void GDAPI godot_pool_vector2_array_push_back(godot_pool_vector2_array *p_self, const godot_vector2 *p_data) {
+ PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self;
+ Vector2 &s = *(Vector2 *)p_data;
+ self->push_back(s);
+}
+
+void GDAPI godot_pool_vector2_array_remove(godot_pool_vector2_array *p_self, const godot_int p_idx) {
+ PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self;
+ self->remove(p_idx);
+}
+
+void GDAPI godot_pool_vector2_array_resize(godot_pool_vector2_array *p_self, const godot_int p_size) {
+ PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self;
+ self->resize(p_size);
+}
+
+void GDAPI godot_pool_vector2_array_set(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data) {
+ PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self;
+ Vector2 &s = *(Vector2 *)p_data;
+ self->set(p_idx, s);
+}
+
+godot_vector2 GDAPI godot_pool_vector2_array_get(const godot_pool_vector2_array *p_self, const godot_int p_idx) {
+ const PoolVector<Vector2> *self = (const PoolVector<Vector2> *)p_self;
+ godot_vector2 v;
+ Vector2 *s = (Vector2 *)&v;
+ *s = self->get(p_idx);
+ return v;
+}
+
+godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_self) {
+ const PoolVector<Vector2> *self = (const PoolVector<Vector2> *)p_self;
+ return self->size();
+}
+
+void GDAPI godot_pool_vector2_array_destroy(godot_pool_vector2_array *p_self) {
+ ((PoolVector<Vector2> *)p_self)->~PoolVector();
+}
+
+// vector3
+
+void GDAPI godot_pool_vector3_array_new(godot_pool_vector3_array *r_dest) {
+ PoolVector<Vector3> *dest = (PoolVector<Vector3> *)r_dest;
+ memnew_placement(dest, PoolVector<Vector3>);
+}
+
+void GDAPI godot_pool_vector3_array_new_copy(godot_pool_vector3_array *r_dest, const godot_pool_vector3_array *p_src) {
+ PoolVector<Vector3> *dest = (PoolVector<Vector3> *)r_dest;
+ const PoolVector<Vector3> *src = (const PoolVector<Vector3> *)p_src;
+ memnew_placement(dest, PoolVector<Vector3>(*src));
+}
+
+void GDAPI godot_pool_vector3_array_new_with_array(godot_pool_vector3_array *r_dest, const godot_array *p_a) {
+ PoolVector<Vector3> *dest = (PoolVector<Vector3> *)r_dest;
+ Array *a = (Array *)p_a;
+ memnew_placement(dest, PoolVector<Vector3>);
+
+ dest->resize(a->size());
+ for (size_t i = 0; i < a->size(); i++) {
+ dest->set(i, (*a)[i]);
+ }
+}
+
+void GDAPI godot_pool_vector3_array_append(godot_pool_vector3_array *p_self, const godot_vector3 *p_data) {
+ PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self;
+ Vector3 &s = *(Vector3 *)p_data;
+ self->append(s);
+}
+
+void GDAPI godot_pool_vector3_array_append_array(godot_pool_vector3_array *p_self, const godot_pool_vector3_array *p_array) {
+ PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self;
+ PoolVector<Vector3> *array = (PoolVector<Vector3> *)p_array;
+ self->append_array(*array);
+}
+
+godot_error GDAPI godot_pool_vector3_array_insert(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data) {
+ PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self;
+ Vector3 &s = *(Vector3 *)p_data;
+ return (godot_error)self->insert(p_idx, s);
+}
+
+void GDAPI godot_pool_vector3_array_invert(godot_pool_vector3_array *p_self) {
+ PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self;
+ self->invert();
+}
+
+void GDAPI godot_pool_vector3_array_push_back(godot_pool_vector3_array *p_self, const godot_vector3 *p_data) {
+ PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self;
+ Vector3 &s = *(Vector3 *)p_data;
+ self->push_back(s);
+}
+
+void GDAPI godot_pool_vector3_array_remove(godot_pool_vector3_array *p_self, const godot_int p_idx) {
+ PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self;
+ self->remove(p_idx);
+}
+
+void GDAPI godot_pool_vector3_array_resize(godot_pool_vector3_array *p_self, const godot_int p_size) {
+ PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self;
+ self->resize(p_size);
+}
+
+void GDAPI godot_pool_vector3_array_set(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data) {
+ PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self;
+ Vector3 &s = *(Vector3 *)p_data;
+ self->set(p_idx, s);
+}
+
+godot_vector3 GDAPI godot_pool_vector3_array_get(const godot_pool_vector3_array *p_self, const godot_int p_idx) {
+ const PoolVector<Vector3> *self = (const PoolVector<Vector3> *)p_self;
+ godot_vector3 v;
+ Vector3 *s = (Vector3 *)&v;
+ *s = self->get(p_idx);
+ return v;
+}
+
+godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_self) {
+ const PoolVector<Vector3> *self = (const PoolVector<Vector3> *)p_self;
+ return self->size();
+}
+
+void GDAPI godot_pool_vector3_array_destroy(godot_pool_vector3_array *p_self) {
+ ((PoolVector<Vector3> *)p_self)->~PoolVector();
+}
+
+// color
+
+void GDAPI godot_pool_color_array_new(godot_pool_color_array *r_dest) {
+ PoolVector<Color> *dest = (PoolVector<Color> *)r_dest;
+ memnew_placement(dest, PoolVector<Color>);
+}
+
+void GDAPI godot_pool_color_array_new_copy(godot_pool_color_array *r_dest, const godot_pool_color_array *p_src) {
+ PoolVector<Color> *dest = (PoolVector<Color> *)r_dest;
+ const PoolVector<Color> *src = (const PoolVector<Color> *)p_src;
+ memnew_placement(dest, PoolVector<Color>(*src));
+}
+
+void GDAPI godot_pool_color_array_new_with_array(godot_pool_color_array *r_dest, const godot_array *p_a) {
+ PoolVector<Color> *dest = (PoolVector<Color> *)r_dest;
+ Array *a = (Array *)p_a;
+ memnew_placement(dest, PoolVector<Color>);
+
+ dest->resize(a->size());
+ for (size_t i = 0; i < a->size(); i++) {
+ dest->set(i, (*a)[i]);
+ }
+}
+
+void GDAPI godot_pool_color_array_append(godot_pool_color_array *p_self, const godot_color *p_data) {
+ PoolVector<Color> *self = (PoolVector<Color> *)p_self;
+ Color &s = *(Color *)p_data;
+ self->append(s);
+}
+
+void GDAPI godot_pool_color_array_append_array(godot_pool_color_array *p_self, const godot_pool_color_array *p_array) {
+ PoolVector<Color> *self = (PoolVector<Color> *)p_self;
+ PoolVector<Color> *array = (PoolVector<Color> *)p_array;
+ self->append_array(*array);
+}
+
+godot_error GDAPI godot_pool_color_array_insert(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data) {
+ PoolVector<Color> *self = (PoolVector<Color> *)p_self;
+ Color &s = *(Color *)p_data;
+ return (godot_error)self->insert(p_idx, s);
+}
+
+void GDAPI godot_pool_color_array_invert(godot_pool_color_array *p_self) {
+ PoolVector<Color> *self = (PoolVector<Color> *)p_self;
+ self->invert();
+}
+
+void GDAPI godot_pool_color_array_push_back(godot_pool_color_array *p_self, const godot_color *p_data) {
+ PoolVector<Color> *self = (PoolVector<Color> *)p_self;
+ Color &s = *(Color *)p_data;
+ self->push_back(s);
+}
+
+void GDAPI godot_pool_color_array_remove(godot_pool_color_array *p_self, const godot_int p_idx) {
+ PoolVector<Color> *self = (PoolVector<Color> *)p_self;
+ self->remove(p_idx);
+}
+
+void GDAPI godot_pool_color_array_resize(godot_pool_color_array *p_self, const godot_int p_size) {
+ PoolVector<Color> *self = (PoolVector<Color> *)p_self;
+ self->resize(p_size);
+}
+
+void GDAPI godot_pool_color_array_set(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data) {
+ PoolVector<Color> *self = (PoolVector<Color> *)p_self;
+ Color &s = *(Color *)p_data;
+ self->set(p_idx, s);
+}
+
+godot_color GDAPI godot_pool_color_array_get(const godot_pool_color_array *p_self, const godot_int p_idx) {
+ const PoolVector<Color> *self = (const PoolVector<Color> *)p_self;
+ godot_color v;
+ Color *s = (Color *)&v;
+ *s = self->get(p_idx);
+ return v;
+}
+
+godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self) {
+ const PoolVector<Color> *self = (const PoolVector<Color> *)p_self;
+ return self->size();
+}
+
+void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self) {
+ ((PoolVector<Color> *)p_self)->~PoolVector();
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/pool_arrays.h b/modules/gdnative/godot/pool_arrays.h
new file mode 100644
index 0000000000..29517d21ac
--- /dev/null
+++ b/modules/gdnative/godot/pool_arrays.h
@@ -0,0 +1,316 @@
+/*************************************************************************/
+/* pool_arrays.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_POOL_ARRAYS_H
+#define GODOT_POOL_ARRAYS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+/////// PoolByteArray
+
+#define GODOT_POOL_BYTE_ARRAY_SIZE 8
+
+#ifndef GODOT_CORE_API_GODOT_POOL_BYTE_ARRAY_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_POOL_BYTE_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_BYTE_ARRAY_SIZE];
+} godot_pool_byte_array;
+#endif
+
+/////// PoolIntArray
+
+#define GODOT_POOL_INT_ARRAY_SIZE 8
+
+#ifndef GODOT_CORE_API_GODOT_POOL_INT_ARRAY_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_POOL_INT_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_INT_ARRAY_SIZE];
+} godot_pool_int_array;
+#endif
+
+/////// PoolRealArray
+
+#define GODOT_POOL_REAL_ARRAY_SIZE 8
+
+#ifndef GODOT_CORE_API_GODOT_POOL_REAL_ARRAY_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_POOL_REAL_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_REAL_ARRAY_SIZE];
+} godot_pool_real_array;
+#endif
+
+/////// PoolStringArray
+
+#define GODOT_POOL_STRING_ARRAY_SIZE 8
+
+#ifndef GODOT_CORE_API_GODOT_POOL_STRING_ARRAY_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_POOL_STRING_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_STRING_ARRAY_SIZE];
+} godot_pool_string_array;
+#endif
+
+/////// PoolVector2Array
+
+#define GODOT_POOL_VECTOR2_ARRAY_SIZE 8
+
+#ifndef GODOT_CORE_API_GODOT_POOL_VECTOR2_ARRAY_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_POOL_VECTOR2_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_VECTOR2_ARRAY_SIZE];
+} godot_pool_vector2_array;
+#endif
+
+/////// PoolVector3Array
+
+#define GODOT_POOL_VECTOR3_ARRAY_SIZE 8
+
+#ifndef GODOT_CORE_API_GODOT_POOL_VECTOR3_ARRAY_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_POOL_VECTOR3_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_VECTOR3_ARRAY_SIZE];
+} godot_pool_vector3_array;
+#endif
+
+/////// PoolColorArray
+
+#define GODOT_POOL_COLOR_ARRAY_SIZE 8
+
+#ifndef GODOT_CORE_API_GODOT_POOL_COLOR_ARRAY_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_POOL_COLOR_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_COLOR_ARRAY_SIZE];
+} godot_pool_color_array;
+#endif
+
+#include <godot/array.h>
+#include <godot/color.h>
+#include <godot/vector2.h>
+#include <godot/vector3.h>
+
+#include <godot/gdnative.h>
+
+// byte
+
+void GDAPI godot_pool_byte_array_new(godot_pool_byte_array *r_dest);
+void GDAPI godot_pool_byte_array_new_copy(godot_pool_byte_array *r_dest, const godot_pool_byte_array *p_src);
+void GDAPI godot_pool_byte_array_new_with_array(godot_pool_byte_array *r_dest, const godot_array *p_a);
+
+void GDAPI godot_pool_byte_array_append(godot_pool_byte_array *p_self, const uint8_t p_data);
+
+void GDAPI godot_pool_byte_array_append_array(godot_pool_byte_array *p_self, const godot_pool_byte_array *p_array);
+
+godot_error GDAPI godot_pool_byte_array_insert(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data);
+
+void GDAPI godot_pool_byte_array_invert(godot_pool_byte_array *p_self);
+
+void GDAPI godot_pool_byte_array_push_back(godot_pool_byte_array *p_self, const uint8_t p_data);
+
+void GDAPI godot_pool_byte_array_remove(godot_pool_byte_array *p_self, const godot_int p_idx);
+
+void GDAPI godot_pool_byte_array_resize(godot_pool_byte_array *p_self, const godot_int p_size);
+
+void GDAPI godot_pool_byte_array_set(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data);
+uint8_t GDAPI godot_pool_byte_array_get(const godot_pool_byte_array *p_self, const godot_int p_idx);
+
+godot_int GDAPI godot_pool_byte_array_size(const godot_pool_byte_array *p_self);
+
+void GDAPI godot_pool_byte_array_destroy(godot_pool_byte_array *p_self);
+
+// int
+
+void GDAPI godot_pool_int_array_new(godot_pool_int_array *r_dest);
+void GDAPI godot_pool_int_array_new_copy(godot_pool_int_array *r_dest, const godot_pool_int_array *p_src);
+void GDAPI godot_pool_int_array_new_with_array(godot_pool_int_array *r_dest, const godot_array *p_a);
+
+void GDAPI godot_pool_int_array_append(godot_pool_int_array *p_self, const godot_int p_data);
+
+void GDAPI godot_pool_int_array_append_array(godot_pool_int_array *p_self, const godot_pool_int_array *p_array);
+
+godot_error GDAPI godot_pool_int_array_insert(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data);
+
+void GDAPI godot_pool_int_array_invert(godot_pool_int_array *p_self);
+
+void GDAPI godot_pool_int_array_push_back(godot_pool_int_array *p_self, const godot_int p_data);
+
+void GDAPI godot_pool_int_array_remove(godot_pool_int_array *p_self, const godot_int p_idx);
+
+void GDAPI godot_pool_int_array_resize(godot_pool_int_array *p_self, const godot_int p_size);
+
+void GDAPI godot_pool_int_array_set(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data);
+godot_int GDAPI godot_pool_int_array_get(const godot_pool_int_array *p_self, const godot_int p_idx);
+
+godot_int GDAPI godot_pool_int_array_size(const godot_pool_int_array *p_self);
+
+void GDAPI godot_pool_int_array_destroy(godot_pool_int_array *p_self);
+
+// real
+
+void GDAPI godot_pool_real_array_new(godot_pool_real_array *r_dest);
+void GDAPI godot_pool_real_array_new_copy(godot_pool_real_array *r_dest, const godot_pool_real_array *p_src);
+void GDAPI godot_pool_real_array_new_with_array(godot_pool_real_array *r_dest, const godot_array *p_a);
+
+void GDAPI godot_pool_real_array_append(godot_pool_real_array *p_self, const godot_real p_data);
+
+void GDAPI godot_pool_real_array_append_array(godot_pool_real_array *p_self, const godot_pool_real_array *p_array);
+
+godot_error GDAPI godot_pool_real_array_insert(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data);
+
+void GDAPI godot_pool_real_array_invert(godot_pool_real_array *p_self);
+
+void GDAPI godot_pool_real_array_push_back(godot_pool_real_array *p_self, const godot_real p_data);
+
+void GDAPI godot_pool_real_array_remove(godot_pool_real_array *p_self, const godot_int p_idx);
+
+void GDAPI godot_pool_real_array_resize(godot_pool_real_array *p_self, const godot_int p_size);
+
+void GDAPI godot_pool_real_array_set(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data);
+godot_real GDAPI godot_pool_real_array_get(const godot_pool_real_array *p_self, const godot_int p_idx);
+
+godot_int GDAPI godot_pool_real_array_size(const godot_pool_real_array *p_self);
+
+void GDAPI godot_pool_real_array_destroy(godot_pool_real_array *p_self);
+
+// string
+
+void GDAPI godot_pool_string_array_new(godot_pool_string_array *r_dest);
+void GDAPI godot_pool_string_array_new_copy(godot_pool_string_array *r_dest, const godot_pool_string_array *p_src);
+void GDAPI godot_pool_string_array_new_with_array(godot_pool_string_array *r_dest, const godot_array *p_a);
+
+void GDAPI godot_pool_string_array_append(godot_pool_string_array *p_self, const godot_string *p_data);
+
+void GDAPI godot_pool_string_array_append_array(godot_pool_string_array *p_self, const godot_pool_string_array *p_array);
+
+godot_error GDAPI godot_pool_string_array_insert(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data);
+
+void GDAPI godot_pool_string_array_invert(godot_pool_string_array *p_self);
+
+void GDAPI godot_pool_string_array_push_back(godot_pool_string_array *p_self, const godot_string *p_data);
+
+void GDAPI godot_pool_string_array_remove(godot_pool_string_array *p_self, const godot_int p_idx);
+
+void GDAPI godot_pool_string_array_resize(godot_pool_string_array *p_self, const godot_int p_size);
+
+void GDAPI godot_pool_string_array_set(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data);
+godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_self, const godot_int p_idx);
+
+godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_self);
+
+void GDAPI godot_pool_string_array_destroy(godot_pool_string_array *p_self);
+
+// vector2
+
+void GDAPI godot_pool_vector2_array_new(godot_pool_vector2_array *r_dest);
+void GDAPI godot_pool_vector2_array_new_copy(godot_pool_vector2_array *r_dest, const godot_pool_vector2_array *p_src);
+void GDAPI godot_pool_vector2_array_new_with_array(godot_pool_vector2_array *r_dest, const godot_array *p_a);
+
+void GDAPI godot_pool_vector2_array_append(godot_pool_vector2_array *p_self, const godot_vector2 *p_data);
+
+void GDAPI godot_pool_vector2_array_append_array(godot_pool_vector2_array *p_self, const godot_pool_vector2_array *p_array);
+
+godot_error GDAPI godot_pool_vector2_array_insert(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data);
+
+void GDAPI godot_pool_vector2_array_invert(godot_pool_vector2_array *p_self);
+
+void GDAPI godot_pool_vector2_array_push_back(godot_pool_vector2_array *p_self, const godot_vector2 *p_data);
+
+void GDAPI godot_pool_vector2_array_remove(godot_pool_vector2_array *p_self, const godot_int p_idx);
+
+void GDAPI godot_pool_vector2_array_resize(godot_pool_vector2_array *p_self, const godot_int p_size);
+
+void GDAPI godot_pool_vector2_array_set(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data);
+godot_vector2 GDAPI godot_pool_vector2_array_get(const godot_pool_vector2_array *p_self, const godot_int p_idx);
+
+godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_self);
+
+void GDAPI godot_pool_vector2_array_destroy(godot_pool_vector2_array *p_self);
+
+// vector3
+
+void GDAPI godot_pool_vector3_array_new(godot_pool_vector3_array *r_dest);
+void GDAPI godot_pool_vector3_array_new_copy(godot_pool_vector3_array *r_dest, const godot_pool_vector3_array *p_src);
+void GDAPI godot_pool_vector3_array_new_with_array(godot_pool_vector3_array *r_dest, const godot_array *p_a);
+
+void GDAPI godot_pool_vector3_array_append(godot_pool_vector3_array *p_self, const godot_vector3 *p_data);
+
+void GDAPI godot_pool_vector3_array_append_array(godot_pool_vector3_array *p_self, const godot_pool_vector3_array *p_array);
+
+godot_error GDAPI godot_pool_vector3_array_insert(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data);
+
+void GDAPI godot_pool_vector3_array_invert(godot_pool_vector3_array *p_self);
+
+void GDAPI godot_pool_vector3_array_push_back(godot_pool_vector3_array *p_self, const godot_vector3 *p_data);
+
+void GDAPI godot_pool_vector3_array_remove(godot_pool_vector3_array *p_self, const godot_int p_idx);
+
+void GDAPI godot_pool_vector3_array_resize(godot_pool_vector3_array *p_self, const godot_int p_size);
+
+void GDAPI godot_pool_vector3_array_set(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data);
+godot_vector3 GDAPI godot_pool_vector3_array_get(const godot_pool_vector3_array *p_self, const godot_int p_idx);
+
+godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_self);
+
+void GDAPI godot_pool_vector3_array_destroy(godot_pool_vector3_array *p_self);
+
+// color
+
+void GDAPI godot_pool_color_array_new(godot_pool_color_array *r_dest);
+void GDAPI godot_pool_color_array_new_copy(godot_pool_color_array *r_dest, const godot_pool_color_array *p_src);
+void GDAPI godot_pool_color_array_new_with_array(godot_pool_color_array *r_dest, const godot_array *p_a);
+
+void GDAPI godot_pool_color_array_append(godot_pool_color_array *p_self, const godot_color *p_data);
+
+void GDAPI godot_pool_color_array_append_array(godot_pool_color_array *p_self, const godot_pool_color_array *p_array);
+
+godot_error GDAPI godot_pool_color_array_insert(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data);
+
+void GDAPI godot_pool_color_array_invert(godot_pool_color_array *p_self);
+
+void GDAPI godot_pool_color_array_push_back(godot_pool_color_array *p_self, const godot_color *p_data);
+
+void GDAPI godot_pool_color_array_remove(godot_pool_color_array *p_self, const godot_int p_idx);
+
+void GDAPI godot_pool_color_array_resize(godot_pool_color_array *p_self, const godot_int p_size);
+
+void GDAPI godot_pool_color_array_set(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data);
+godot_color GDAPI godot_pool_color_array_get(const godot_pool_color_array *p_self, const godot_int p_idx);
+
+godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self);
+
+void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_POOL_ARRAYS_H
diff --git a/modules/gdnative/godot/quat.cpp b/modules/gdnative/godot/quat.cpp
new file mode 100644
index 0000000000..37ee4d6b15
--- /dev/null
+++ b/modules/gdnative/godot/quat.cpp
@@ -0,0 +1,219 @@
+/*************************************************************************/
+/* quat.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/quat.h>
+
+#include "core/math/quat.h"
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _quat_api_anchor() {}
+
+void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w) {
+
+ Quat *dest = (Quat *)r_dest;
+ *dest = Quat(p_x, p_y, p_z, p_w);
+}
+
+void GDAPI godot_quat_new_with_axis_angle(godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle) {
+ const Vector3 *axis = (const Vector3 *)p_axis;
+ Quat *dest = (Quat *)r_dest;
+ *dest = Quat(*axis, p_angle);
+}
+
+godot_real GDAPI godot_quat_get_x(const godot_quat *p_self) {
+ const Quat *self = (const Quat *)p_self;
+ return self->x;
+}
+
+void GDAPI godot_quat_set_x(godot_quat *p_self, const godot_real val) {
+ Quat *self = (Quat *)p_self;
+ self->x = val;
+}
+
+godot_real GDAPI godot_quat_get_y(const godot_quat *p_self) {
+ const Quat *self = (const Quat *)p_self;
+ return self->y;
+}
+
+void GDAPI godot_quat_set_y(godot_quat *p_self, const godot_real val) {
+ Quat *self = (Quat *)p_self;
+ self->y = val;
+}
+
+godot_real GDAPI godot_quat_get_z(const godot_quat *p_self) {
+ const Quat *self = (const Quat *)p_self;
+ return self->z;
+}
+
+void GDAPI godot_quat_set_z(godot_quat *p_self, const godot_real val) {
+ Quat *self = (Quat *)p_self;
+ self->z = val;
+}
+
+godot_real GDAPI godot_quat_get_w(const godot_quat *p_self) {
+ const Quat *self = (const Quat *)p_self;
+ return self->w;
+}
+
+void GDAPI godot_quat_set_w(godot_quat *p_self, const godot_real val) {
+ Quat *self = (Quat *)p_self;
+ self->w = val;
+}
+
+godot_string GDAPI godot_quat_as_string(const godot_quat *p_self) {
+ godot_string ret;
+ const Quat *self = (const Quat *)p_self;
+ memnew_placement(&ret, String(*self));
+ return ret;
+}
+
+godot_real GDAPI godot_quat_length(const godot_quat *p_self) {
+ const Quat *self = (const Quat *)p_self;
+ return self->length();
+}
+
+godot_real GDAPI godot_quat_length_squared(const godot_quat *p_self) {
+ const Quat *self = (const Quat *)p_self;
+ return self->length_squared();
+}
+
+godot_quat GDAPI godot_quat_normalized(const godot_quat *p_self) {
+ godot_quat dest;
+ const Quat *self = (const Quat *)p_self;
+ *((Quat *)&dest) = self->normalized();
+ return dest;
+}
+
+godot_bool GDAPI godot_quat_is_normalized(const godot_quat *p_self) {
+ const Quat *self = (const Quat *)p_self;
+ return self->is_normalized();
+}
+
+godot_quat GDAPI godot_quat_inverse(const godot_quat *p_self) {
+ godot_quat dest;
+ const Quat *self = (const Quat *)p_self;
+ *((Quat *)&dest) = self->inverse();
+ return dest;
+}
+
+godot_real GDAPI godot_quat_dot(const godot_quat *p_self, const godot_quat *p_b) {
+ const Quat *self = (const Quat *)p_self;
+ const Quat *b = (const Quat *)p_b;
+ return self->dot(*b);
+}
+
+godot_vector3 GDAPI godot_quat_xform(const godot_quat *p_self, const godot_vector3 *p_v) {
+ godot_vector3 dest;
+ const Quat *self = (const Quat *)p_self;
+ const Vector3 *v = (const Vector3 *)p_v;
+ *((Vector3 *)&dest) = self->xform(*v);
+ return dest;
+}
+
+godot_quat GDAPI godot_quat_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t) {
+ godot_quat dest;
+ const Quat *self = (const Quat *)p_self;
+ const Quat *b = (const Quat *)p_b;
+ *((Quat *)&dest) = self->slerp(*b, p_t);
+ return dest;
+}
+
+godot_quat GDAPI godot_quat_slerpni(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t) {
+ godot_quat dest;
+ const Quat *self = (const Quat *)p_self;
+ const Quat *b = (const Quat *)p_b;
+ *((Quat *)&dest) = self->slerpni(*b, p_t);
+ return dest;
+}
+
+godot_quat GDAPI godot_quat_cubic_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_quat *p_pre_a, const godot_quat *p_post_b, const godot_real p_t) {
+ godot_quat dest;
+ const Quat *self = (const Quat *)p_self;
+ const Quat *b = (const Quat *)p_b;
+ const Quat *pre_a = (const Quat *)p_pre_a;
+ const Quat *post_b = (const Quat *)p_post_b;
+ *((Quat *)&dest) = self->cubic_slerp(*b, *pre_a, *post_b, p_t);
+ return dest;
+}
+
+godot_quat GDAPI godot_quat_operator_multiply(const godot_quat *p_self, const godot_real p_b) {
+ godot_quat raw_dest;
+ Quat *dest = (Quat *)&raw_dest;
+ const Quat *self = (const Quat *)p_self;
+ *dest = *self * p_b;
+ return raw_dest;
+}
+
+godot_quat GDAPI godot_quat_operator_add(const godot_quat *p_self, const godot_quat *p_b) {
+ godot_quat raw_dest;
+ Quat *dest = (Quat *)&raw_dest;
+ const Quat *self = (const Quat *)p_self;
+ const Quat *b = (const Quat *)p_b;
+ *dest = *self + *b;
+ return raw_dest;
+}
+
+godot_quat GDAPI godot_quat_operator_substract(const godot_quat *p_self, const godot_quat *p_b) {
+ godot_quat raw_dest;
+ Quat *dest = (Quat *)&raw_dest;
+ const Quat *self = (const Quat *)p_self;
+ const Quat *b = (const Quat *)p_b;
+ *dest = *self - *b;
+ return raw_dest;
+}
+
+godot_quat GDAPI godot_quat_operator_divide(const godot_quat *p_self, const godot_real p_b) {
+ godot_quat raw_dest;
+ Quat *dest = (Quat *)&raw_dest;
+ const Quat *self = (const Quat *)p_self;
+ *dest = *self / p_b;
+ return raw_dest;
+}
+
+godot_bool GDAPI godot_quat_operator_equal(const godot_quat *p_self, const godot_quat *p_b) {
+ const Quat *self = (const Quat *)p_self;
+ const Quat *b = (const Quat *)p_b;
+ return *self == *b;
+}
+
+godot_quat GDAPI godot_quat_operator_neg(const godot_quat *p_self) {
+ godot_quat raw_dest;
+ Quat *dest = (Quat *)&raw_dest;
+ const Quat *self = (const Quat *)p_self;
+ *dest = -(*self);
+ return raw_dest;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/quat.h b/modules/gdnative/godot/quat.h
new file mode 100644
index 0000000000..0979653d93
--- /dev/null
+++ b/modules/gdnative/godot/quat.h
@@ -0,0 +1,104 @@
+/*************************************************************************/
+/* quat.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_QUAT_H
+#define GODOT_QUAT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_QUAT_SIZE 16
+
+#ifndef GODOT_CORE_API_GODOT_QUAT_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_QUAT_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_QUAT_SIZE];
+} godot_quat;
+#endif
+
+#include <godot/gdnative.h>
+#include <godot/vector3.h>
+
+void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w);
+void GDAPI godot_quat_new_with_axis_angle(godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle);
+
+godot_real GDAPI godot_quat_get_x(const godot_quat *p_self);
+void GDAPI godot_quat_set_x(godot_quat *p_self, const godot_real val);
+
+godot_real GDAPI godot_quat_get_y(const godot_quat *p_self);
+void GDAPI godot_quat_set_y(godot_quat *p_self, const godot_real val);
+
+godot_real GDAPI godot_quat_get_z(const godot_quat *p_self);
+void GDAPI godot_quat_set_z(godot_quat *p_self, const godot_real val);
+
+godot_real GDAPI godot_quat_get_w(const godot_quat *p_self);
+void GDAPI godot_quat_set_w(godot_quat *p_self, const godot_real val);
+
+godot_string GDAPI godot_quat_as_string(const godot_quat *p_self);
+
+godot_real GDAPI godot_quat_length(const godot_quat *p_self);
+
+godot_real GDAPI godot_quat_length_squared(const godot_quat *p_self);
+
+godot_quat GDAPI godot_quat_normalized(const godot_quat *p_self);
+
+godot_bool GDAPI godot_quat_is_normalized(const godot_quat *p_self);
+
+godot_quat GDAPI godot_quat_inverse(const godot_quat *p_self);
+
+godot_real GDAPI godot_quat_dot(const godot_quat *p_self, const godot_quat *p_b);
+
+godot_vector3 GDAPI godot_quat_xform(const godot_quat *p_self, const godot_vector3 *p_v);
+
+godot_quat GDAPI godot_quat_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t);
+
+godot_quat GDAPI godot_quat_slerpni(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t);
+
+godot_quat GDAPI godot_quat_cubic_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_quat *p_pre_a, const godot_quat *p_post_b, const godot_real p_t);
+
+godot_quat GDAPI godot_quat_operator_multiply(const godot_quat *p_self, const godot_real p_b);
+
+godot_quat GDAPI godot_quat_operator_add(const godot_quat *p_self, const godot_quat *p_b);
+
+godot_quat GDAPI godot_quat_operator_substract(const godot_quat *p_self, const godot_quat *p_b);
+
+godot_quat GDAPI godot_quat_operator_divide(const godot_quat *p_self, const godot_real p_b);
+
+godot_bool GDAPI godot_quat_operator_equal(const godot_quat *p_self, const godot_quat *p_b);
+
+godot_quat GDAPI godot_quat_operator_neg(const godot_quat *p_self);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_QUAT_H
diff --git a/modules/gdnative/godot/rect2.cpp b/modules/gdnative/godot/rect2.cpp
new file mode 100644
index 0000000000..023584c4f6
--- /dev/null
+++ b/modules/gdnative/godot/rect2.cpp
@@ -0,0 +1,157 @@
+/*************************************************************************/
+/* rect2.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/rect2.h>
+
+#include "core/math/math_2d.h"
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _rect2_api_anchor() {}
+
+void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size) {
+ const Vector2 *position = (const Vector2 *)p_pos;
+ const Vector2 *size = (const Vector2 *)p_size;
+ Rect2 *dest = (Rect2 *)r_dest;
+ *dest = Rect2(*position, *size);
+}
+
+void GDAPI godot_rect2_new(godot_rect2 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_width, const godot_real p_height) {
+
+ Rect2 *dest = (Rect2 *)r_dest;
+ *dest = Rect2(p_x, p_y, p_width, p_height);
+}
+
+godot_string GDAPI godot_rect2_as_string(const godot_rect2 *p_self) {
+ godot_string ret;
+ const Rect2 *self = (const Rect2 *)p_self;
+ memnew_placement(&ret, String(*self));
+ return ret;
+}
+
+godot_real GDAPI godot_rect2_get_area(const godot_rect2 *p_self) {
+ const Rect2 *self = (const Rect2 *)p_self;
+ return self->get_area();
+}
+
+godot_bool GDAPI godot_rect2_intersects(const godot_rect2 *p_self, const godot_rect2 *p_b) {
+ const Rect2 *self = (const Rect2 *)p_self;
+ const Rect2 *b = (const Rect2 *)p_b;
+ return self->intersects(*b);
+}
+
+godot_bool GDAPI godot_rect2_encloses(const godot_rect2 *p_self, const godot_rect2 *p_b) {
+ const Rect2 *self = (const Rect2 *)p_self;
+ const Rect2 *b = (const Rect2 *)p_b;
+ return self->encloses(*b);
+}
+
+godot_bool GDAPI godot_rect2_has_no_area(const godot_rect2 *p_self) {
+ const Rect2 *self = (const Rect2 *)p_self;
+ return self->has_no_area();
+}
+
+godot_rect2 GDAPI godot_rect2_clip(const godot_rect2 *p_self, const godot_rect2 *p_b) {
+ godot_rect2 dest;
+ const Rect2 *self = (const Rect2 *)p_self;
+ const Rect2 *b = (const Rect2 *)p_b;
+ *((Rect2 *)&dest) = self->clip(*b);
+ return dest;
+}
+
+godot_rect2 GDAPI godot_rect2_merge(const godot_rect2 *p_self, const godot_rect2 *p_b) {
+ godot_rect2 dest;
+ const Rect2 *self = (const Rect2 *)p_self;
+ const Rect2 *b = (const Rect2 *)p_b;
+ *((Rect2 *)&dest) = self->merge(*b);
+ return dest;
+}
+
+godot_bool GDAPI godot_rect2_has_point(const godot_rect2 *p_self, const godot_vector2 *p_point) {
+ const Rect2 *self = (const Rect2 *)p_self;
+ const Vector2 *point = (const Vector2 *)p_point;
+ return self->has_point(*point);
+}
+
+godot_rect2 GDAPI godot_rect2_grow(const godot_rect2 *p_self, const godot_real p_by) {
+ godot_rect2 dest;
+ const Rect2 *self = (const Rect2 *)p_self;
+
+ *((Rect2 *)&dest) = self->grow(p_by);
+ return dest;
+}
+
+godot_rect2 GDAPI godot_rect2_expand(const godot_rect2 *p_self, const godot_vector2 *p_to) {
+ godot_rect2 dest;
+ const Rect2 *self = (const Rect2 *)p_self;
+ const Vector2 *to = (const Vector2 *)p_to;
+ *((Rect2 *)&dest) = self->expand(*to);
+ return dest;
+}
+
+godot_bool GDAPI godot_rect2_operator_equal(const godot_rect2 *p_self, const godot_rect2 *p_b) {
+ const Rect2 *self = (const Rect2 *)p_self;
+ const Rect2 *b = (const Rect2 *)p_b;
+ return *self == *b;
+}
+
+godot_vector2 GDAPI godot_rect2_get_position(const godot_rect2 *p_self) {
+ godot_vector2 dest;
+ Vector2 *d = (Vector2 *)&dest;
+ const Rect2 *self = (const Rect2 *)p_self;
+ *d = self->get_position();
+ return dest;
+}
+
+godot_vector2 GDAPI godot_rect2_get_size(const godot_rect2 *p_self) {
+ godot_vector2 dest;
+ Vector2 *d = (Vector2 *)&dest;
+ const Rect2 *self = (const Rect2 *)p_self;
+ *d = self->get_size();
+ return dest;
+}
+
+void GDAPI godot_rect2_set_position(godot_rect2 *p_self, const godot_vector2 *p_pos) {
+ Rect2 *self = (Rect2 *)p_self;
+ const Vector2 *position = (const Vector2 *)p_pos;
+ self->set_position(*position);
+}
+
+void GDAPI godot_rect2_set_size(godot_rect2 *p_self, const godot_vector2 *p_size) {
+ Rect2 *self = (Rect2 *)p_self;
+ const Vector2 *size = (const Vector2 *)p_size;
+ self->set_size(*size);
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/rect2.h b/modules/gdnative/godot/rect2.h
new file mode 100644
index 0000000000..cb1ddb58cf
--- /dev/null
+++ b/modules/gdnative/godot/rect2.h
@@ -0,0 +1,86 @@
+/*************************************************************************/
+/* rect2.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_RECT2_H
+#define GODOT_RECT2_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#ifndef GODOT_CORE_API_GODOT_RECT2_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_RECT2_TYPE_DEFINED
+typedef struct godot_rect2 {
+ uint8_t _dont_touch_that[16];
+} godot_rect2;
+#endif
+
+#include <godot/gdnative.h>
+#include <godot/vector2.h>
+
+void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size);
+void GDAPI godot_rect2_new(godot_rect2 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_width, const godot_real p_height);
+
+godot_string GDAPI godot_rect2_as_string(const godot_rect2 *p_self);
+
+godot_real GDAPI godot_rect2_get_area(const godot_rect2 *p_self);
+
+godot_bool GDAPI godot_rect2_intersects(const godot_rect2 *p_self, const godot_rect2 *p_b);
+
+godot_bool GDAPI godot_rect2_encloses(const godot_rect2 *p_self, const godot_rect2 *p_b);
+
+godot_bool GDAPI godot_rect2_has_no_area(const godot_rect2 *p_self);
+
+godot_rect2 GDAPI godot_rect2_clip(const godot_rect2 *p_self, const godot_rect2 *p_b);
+
+godot_rect2 GDAPI godot_rect2_merge(const godot_rect2 *p_self, const godot_rect2 *p_b);
+
+godot_bool GDAPI godot_rect2_has_point(const godot_rect2 *p_self, const godot_vector2 *p_point);
+
+godot_rect2 GDAPI godot_rect2_grow(const godot_rect2 *p_self, const godot_real p_by);
+
+godot_rect2 GDAPI godot_rect2_expand(const godot_rect2 *p_self, const godot_vector2 *p_to);
+
+godot_bool GDAPI godot_rect2_operator_equal(const godot_rect2 *p_self, const godot_rect2 *p_b);
+
+godot_vector2 GDAPI godot_rect2_get_position(const godot_rect2 *p_self);
+
+godot_vector2 GDAPI godot_rect2_get_size(const godot_rect2 *p_self);
+
+void GDAPI godot_rect2_set_position(godot_rect2 *p_self, const godot_vector2 *p_pos);
+
+void GDAPI godot_rect2_set_size(godot_rect2 *p_self, const godot_vector2 *p_size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_RECT2_H
diff --git a/modules/gdnative/godot/rect3.cpp b/modules/gdnative/godot/rect3.cpp
new file mode 100644
index 0000000000..708d2987f2
--- /dev/null
+++ b/modules/gdnative/godot/rect3.cpp
@@ -0,0 +1,219 @@
+/*************************************************************************/
+/* rect3.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/rect3.h>
+
+#include "core/math/rect3.h"
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _rect3_api_anchor() {}
+
+void GDAPI godot_rect3_new(godot_rect3 *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size) {
+ const Vector3 *pos = (const Vector3 *)p_pos;
+ const Vector3 *size = (const Vector3 *)p_size;
+ Rect3 *dest = (Rect3 *)r_dest;
+ *dest = Rect3(*pos, *size);
+}
+
+godot_vector3 GDAPI godot_rect3_get_position(const godot_rect3 *p_self) {
+ godot_vector3 raw_ret;
+ const Rect3 *self = (const Rect3 *)p_self;
+ Vector3 *ret = (Vector3 *)&raw_ret;
+ *ret = self->position;
+ return raw_ret;
+}
+
+void GDAPI godot_rect3_set_position(const godot_rect3 *p_self, const godot_vector3 *p_v) {
+ Rect3 *self = (Rect3 *)p_self;
+ const Vector3 *v = (const Vector3 *)p_v;
+ self->position = *v;
+}
+
+godot_vector3 GDAPI godot_rect3_get_size(const godot_rect3 *p_self) {
+ godot_vector3 raw_ret;
+ const Rect3 *self = (const Rect3 *)p_self;
+ Vector3 *ret = (Vector3 *)&raw_ret;
+ *ret = self->size;
+ return raw_ret;
+}
+
+void GDAPI godot_rect3_set_size(const godot_rect3 *p_self, const godot_vector3 *p_v) {
+ Rect3 *self = (Rect3 *)p_self;
+ const Vector3 *v = (const Vector3 *)p_v;
+ self->size = *v;
+}
+
+godot_string GDAPI godot_rect3_as_string(const godot_rect3 *p_self) {
+ godot_string ret;
+ const Rect3 *self = (const Rect3 *)p_self;
+ memnew_placement(&ret, String(*self));
+ return ret;
+}
+
+godot_real GDAPI godot_rect3_get_area(const godot_rect3 *p_self) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ return self->get_area();
+}
+
+godot_bool GDAPI godot_rect3_has_no_area(const godot_rect3 *p_self) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ return self->has_no_area();
+}
+
+godot_bool GDAPI godot_rect3_has_no_surface(const godot_rect3 *p_self) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ return self->has_no_surface();
+}
+
+godot_bool GDAPI godot_rect3_intersects(const godot_rect3 *p_self, const godot_rect3 *p_with) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ const Rect3 *with = (const Rect3 *)p_with;
+ return self->intersects(*with);
+}
+
+godot_bool GDAPI godot_rect3_encloses(const godot_rect3 *p_self, const godot_rect3 *p_with) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ const Rect3 *with = (const Rect3 *)p_with;
+ return self->encloses(*with);
+}
+
+godot_rect3 GDAPI godot_rect3_merge(const godot_rect3 *p_self, const godot_rect3 *p_with) {
+ godot_rect3 dest;
+ const Rect3 *self = (const Rect3 *)p_self;
+ const Rect3 *with = (const Rect3 *)p_with;
+ *((Rect3 *)&dest) = self->merge(*with);
+ return dest;
+}
+
+godot_rect3 GDAPI godot_rect3_intersection(const godot_rect3 *p_self, const godot_rect3 *p_with) {
+ godot_rect3 dest;
+ const Rect3 *self = (const Rect3 *)p_self;
+ const Rect3 *with = (const Rect3 *)p_with;
+ *((Rect3 *)&dest) = self->intersection(*with);
+ return dest;
+}
+
+godot_bool GDAPI godot_rect3_intersects_plane(const godot_rect3 *p_self, const godot_plane *p_plane) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ const Plane *plane = (const Plane *)p_plane;
+ return self->intersects_plane(*plane);
+}
+
+godot_bool GDAPI godot_rect3_intersects_segment(const godot_rect3 *p_self, const godot_vector3 *p_from, const godot_vector3 *p_to) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ const Vector3 *from = (const Vector3 *)p_from;
+ const Vector3 *to = (const Vector3 *)p_to;
+ return self->intersects_segment(*from, *to);
+}
+
+godot_bool GDAPI godot_rect3_has_point(const godot_rect3 *p_self, const godot_vector3 *p_point) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ const Vector3 *point = (const Vector3 *)p_point;
+ return self->has_point(*point);
+}
+
+godot_vector3 GDAPI godot_rect3_get_support(const godot_rect3 *p_self, const godot_vector3 *p_dir) {
+ godot_vector3 dest;
+ const Rect3 *self = (const Rect3 *)p_self;
+ const Vector3 *dir = (const Vector3 *)p_dir;
+ *((Vector3 *)&dest) = self->get_support(*dir);
+ return dest;
+}
+
+godot_vector3 GDAPI godot_rect3_get_longest_axis(const godot_rect3 *p_self) {
+ godot_vector3 dest;
+ const Rect3 *self = (const Rect3 *)p_self;
+ *((Vector3 *)&dest) = self->get_longest_axis();
+ return dest;
+}
+
+godot_int GDAPI godot_rect3_get_longest_axis_index(const godot_rect3 *p_self) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ return self->get_longest_axis_index();
+}
+
+godot_real GDAPI godot_rect3_get_longest_axis_size(const godot_rect3 *p_self) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ return self->get_longest_axis_size();
+}
+
+godot_vector3 GDAPI godot_rect3_get_shortest_axis(const godot_rect3 *p_self) {
+ godot_vector3 dest;
+ const Rect3 *self = (const Rect3 *)p_self;
+ *((Vector3 *)&dest) = self->get_shortest_axis();
+ return dest;
+}
+
+godot_int GDAPI godot_rect3_get_shortest_axis_index(const godot_rect3 *p_self) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ return self->get_shortest_axis_index();
+}
+
+godot_real GDAPI godot_rect3_get_shortest_axis_size(const godot_rect3 *p_self) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ return self->get_shortest_axis_size();
+}
+
+godot_rect3 GDAPI godot_rect3_expand(const godot_rect3 *p_self, const godot_vector3 *p_to_point) {
+ godot_rect3 dest;
+ const Rect3 *self = (const Rect3 *)p_self;
+ const Vector3 *to_point = (const Vector3 *)p_to_point;
+ *((Rect3 *)&dest) = self->expand(*to_point);
+ return dest;
+}
+
+godot_rect3 GDAPI godot_rect3_grow(const godot_rect3 *p_self, const godot_real p_by) {
+ godot_rect3 dest;
+ const Rect3 *self = (const Rect3 *)p_self;
+
+ *((Rect3 *)&dest) = self->grow(p_by);
+ return dest;
+}
+
+godot_vector3 GDAPI godot_rect3_get_endpoint(const godot_rect3 *p_self, const godot_int p_idx) {
+ godot_vector3 dest;
+ const Rect3 *self = (const Rect3 *)p_self;
+
+ *((Vector3 *)&dest) = self->get_endpoint(p_idx);
+ return dest;
+}
+
+godot_bool GDAPI godot_rect3_operator_equal(const godot_rect3 *p_self, const godot_rect3 *p_b) {
+ const Rect3 *self = (const Rect3 *)p_self;
+ const Rect3 *b = (const Rect3 *)p_b;
+ return *self == *b;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/rect3.h b/modules/gdnative/godot/rect3.h
new file mode 100644
index 0000000000..69279351c4
--- /dev/null
+++ b/modules/gdnative/godot/rect3.h
@@ -0,0 +1,108 @@
+/*************************************************************************/
+/* rect3.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_RECT3_H
+#define GODOT_RECT3_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_RECT3_SIZE 24
+
+#ifndef GODOT_CORE_API_GODOT_RECT3_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_RECT3_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_RECT3_SIZE];
+} godot_rect3;
+#endif
+
+#include <godot/gdnative.h>
+#include <godot/plane.h>
+#include <godot/vector3.h>
+
+void GDAPI godot_rect3_new(godot_rect3 *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size);
+
+godot_vector3 GDAPI godot_rect3_get_position(const godot_rect3 *p_self);
+void GDAPI godot_rect3_set_position(const godot_rect3 *p_self, const godot_vector3 *p_v);
+
+godot_vector3 GDAPI godot_rect3_get_size(const godot_rect3 *p_self);
+void GDAPI godot_rect3_set_size(const godot_rect3 *p_self, const godot_vector3 *p_v);
+
+godot_string GDAPI godot_rect3_as_string(const godot_rect3 *p_self);
+
+godot_real GDAPI godot_rect3_get_area(const godot_rect3 *p_self);
+
+godot_bool GDAPI godot_rect3_has_no_area(const godot_rect3 *p_self);
+
+godot_bool GDAPI godot_rect3_has_no_surface(const godot_rect3 *p_self);
+
+godot_bool GDAPI godot_rect3_intersects(const godot_rect3 *p_self, const godot_rect3 *p_with);
+
+godot_bool GDAPI godot_rect3_encloses(const godot_rect3 *p_self, const godot_rect3 *p_with);
+
+godot_rect3 GDAPI godot_rect3_merge(const godot_rect3 *p_self, const godot_rect3 *p_with);
+
+godot_rect3 GDAPI godot_rect3_intersection(const godot_rect3 *p_self, const godot_rect3 *p_with);
+
+godot_bool GDAPI godot_rect3_intersects_plane(const godot_rect3 *p_self, const godot_plane *p_plane);
+
+godot_bool GDAPI godot_rect3_intersects_segment(const godot_rect3 *p_self, const godot_vector3 *p_from, const godot_vector3 *p_to);
+
+godot_bool GDAPI godot_rect3_has_point(const godot_rect3 *p_self, const godot_vector3 *p_point);
+
+godot_vector3 GDAPI godot_rect3_get_support(const godot_rect3 *p_self, const godot_vector3 *p_dir);
+
+godot_vector3 GDAPI godot_rect3_get_longest_axis(const godot_rect3 *p_self);
+
+godot_int GDAPI godot_rect3_get_longest_axis_index(const godot_rect3 *p_self);
+
+godot_real GDAPI godot_rect3_get_longest_axis_size(const godot_rect3 *p_self);
+
+godot_vector3 GDAPI godot_rect3_get_shortest_axis(const godot_rect3 *p_self);
+
+godot_int GDAPI godot_rect3_get_shortest_axis_index(const godot_rect3 *p_self);
+
+godot_real GDAPI godot_rect3_get_shortest_axis_size(const godot_rect3 *p_self);
+
+godot_rect3 GDAPI godot_rect3_expand(const godot_rect3 *p_self, const godot_vector3 *p_to_point);
+
+godot_rect3 GDAPI godot_rect3_grow(const godot_rect3 *p_self, const godot_real p_by);
+
+godot_vector3 GDAPI godot_rect3_get_endpoint(const godot_rect3 *p_self, const godot_int p_idx);
+
+godot_bool GDAPI godot_rect3_operator_equal(const godot_rect3 *p_self, const godot_rect3 *p_b);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_RECT3_H
diff --git a/modules/gdnative/godot/rid.cpp b/modules/gdnative/godot/rid.cpp
new file mode 100644
index 0000000000..eb9538e692
--- /dev/null
+++ b/modules/gdnative/godot/rid.cpp
@@ -0,0 +1,75 @@
+/*************************************************************************/
+/* rid.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/rid.h>
+
+#include "core/resource.h"
+#include "core/rid.h"
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _rid_api_anchor() {}
+
+void GDAPI godot_rid_new(godot_rid *r_dest) {
+ RID *dest = (RID *)r_dest;
+ memnew_placement(dest, RID);
+}
+
+godot_int GDAPI godot_rid_get_id(const godot_rid *p_self) {
+ const RID *self = (const RID *)p_self;
+ return self->get_id();
+}
+
+void GDAPI godot_rid_new_with_resource(godot_rid *r_dest, const godot_object *p_from) {
+ const Resource *res_from = ((const Object *)p_from)->cast_to<Resource>();
+ godot_rid_new(r_dest);
+ if (res_from) {
+ RID *dest = (RID *)r_dest;
+ *dest = RID(res_from->get_rid());
+ }
+}
+
+godot_bool GDAPI godot_rid_operator_equal(const godot_rid *p_self, const godot_rid *p_b) {
+ const RID *self = (const RID *)p_self;
+ const RID *b = (const RID *)p_b;
+ return *self == *b;
+}
+
+godot_bool GDAPI godot_rid_operator_less(const godot_rid *p_self, const godot_rid *p_b) {
+ const RID *self = (const RID *)p_self;
+ const RID *b = (const RID *)p_b;
+ return *self < *b;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/platform/bb10/payment_service.h b/modules/gdnative/godot/rid.h
index d5b4cc3d60..ac5b5383d9 100644
--- a/platform/bb10/payment_service.h
+++ b/modules/gdnative/godot/rid.h
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* payment_service.h */
+/* rid.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,38 +27,38 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifdef PAYMENT_SERVICE_ENABLED
+#ifndef GODOT_RID_H
+#define GODOT_RID_H
-#ifndef PAYMENT_SERVICE_H
-#define PAYMENT_SERVICE_H
-
-#include <bps/bps.h>
-#include <bps/event.h>
-#include <bps/paymentservice.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
-#include "core/object.h"
+#include <stdint.h>
-class PaymentService : public Object {
+#define GODOT_RID_SIZE 8
- GDCLASS(PaymentService, Object);
+#ifndef GODOT_CORE_API_GODOT_RID_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_RID_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_RID_SIZE];
+} godot_rid;
+#endif
- static void _bind_methods();
+#include <godot/gdnative.h>
- List<Variant> pending_events;
+void GDAPI godot_rid_new(godot_rid *r_dest);
-public:
- Error request_product_info(Variant p_params);
- Error purchase(Variant p_params);
+godot_int GDAPI godot_rid_get_id(const godot_rid *p_self);
- int get_pending_event_count();
- Variant pop_pending_event();
+void GDAPI godot_rid_new_with_resource(godot_rid *r_dest, const godot_object *p_from);
- bool handle_event(bps_event_t *p_event);
+godot_bool GDAPI godot_rid_operator_equal(const godot_rid *p_self, const godot_rid *p_b);
- PaymentService();
- ~PaymentService();
-};
+godot_bool GDAPI godot_rid_operator_less(const godot_rid *p_self, const godot_rid *p_b);
+#ifdef __cplusplus
+}
#endif
-#endif
+#endif // GODOT_RID_H
diff --git a/modules/gdnative/godot/string.cpp b/modules/gdnative/godot/string.cpp
new file mode 100644
index 0000000000..2235c12a2d
--- /dev/null
+++ b/modules/gdnative/godot/string.cpp
@@ -0,0 +1,1267 @@
+/*************************************************************************/
+/* string.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/string.h>
+
+#include "core/variant.h"
+#include "string_db.h"
+#include "ustring.h"
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _string_api_anchor() {
+}
+
+void GDAPI godot_string_new(godot_string *r_dest) {
+ String *dest = (String *)r_dest;
+ memnew_placement(dest, String);
+}
+
+void GDAPI godot_string_new_copy(godot_string *r_dest, const godot_string *p_src) {
+ String *dest = (String *)r_dest;
+ const String *src = (const String *)p_src;
+ memnew_placement(dest, String(*src));
+}
+
+void GDAPI godot_string_new_data(godot_string *r_dest, const char *p_contents, const int p_size) {
+ String *dest = (String *)r_dest;
+ memnew_placement(dest, String(String::utf8(p_contents, p_size)));
+}
+
+void GDAPI godot_string_new_unicode_data(godot_string *r_dest, const wchar_t *p_contents, const int p_size) {
+ String *dest = (String *)r_dest;
+ memnew_placement(dest, String(p_contents, p_size));
+}
+
+void GDAPI godot_string_get_data(const godot_string *p_self, char *p_dest, int *p_size) {
+ String *self = (String *)p_self;
+ if (p_size != NULL) {
+ *p_size = self->utf8().length();
+ }
+ if (p_dest != NULL) {
+ memcpy(p_dest, self->utf8().get_data(), *p_size);
+ }
+}
+
+wchar_t GDAPI *godot_string_operator_index(godot_string *p_self, const godot_int p_idx) {
+ String *self = (String *)p_self;
+ return &(self->operator[](p_idx));
+}
+
+const char GDAPI *godot_string_c_str(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ return self->utf8().get_data();
+}
+
+const wchar_t GDAPI *godot_string_unicode_str(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ return self->c_str();
+}
+
+godot_bool GDAPI godot_string_operator_equal(const godot_string *p_self, const godot_string *p_b) {
+ const String *self = (const String *)p_self;
+ const String *b = (const String *)p_b;
+ return *self == *b;
+}
+
+godot_bool GDAPI godot_string_operator_less(const godot_string *p_self, const godot_string *p_b) {
+ const String *self = (const String *)p_self;
+ const String *b = (const String *)p_b;
+ return *self < *b;
+}
+
+godot_string GDAPI godot_string_operator_plus(const godot_string *p_self, const godot_string *p_b) {
+ godot_string ret;
+ const String *self = (const String *)p_self;
+ const String *b = (const String *)p_b;
+ memnew_placement(&ret, String(*self + *b));
+ return ret;
+}
+
+void GDAPI godot_string_destroy(godot_string *p_self) {
+ String *self = (String *)p_self;
+ self->~String();
+}
+
+/* Standard size stuff */
+
+godot_int GDAPI godot_string_length(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->length();
+}
+
+/* Helpers */
+
+godot_bool GDAPI godot_string_begins_with(const godot_string *p_self, const godot_string *p_string) {
+ const String *self = (const String *)p_self;
+ const String *string = (const String *)p_string;
+
+ return self->begins_with(*string);
+}
+
+godot_bool GDAPI godot_string_begins_with_char_array(const godot_string *p_self, const char *p_char_array) {
+ const String *self = (const String *)p_self;
+
+ return self->begins_with(p_char_array);
+}
+
+godot_array GDAPI godot_string_bigrams(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ Vector<String> return_value = self->bigrams();
+
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_string GDAPI godot_string_chr(wchar_t p_character) {
+ godot_string result;
+ memnew_placement(&result, String(String::chr(p_character)));
+
+ return result;
+}
+
+godot_bool GDAPI godot_string_ends_with(const godot_string *p_self, const godot_string *p_string) {
+ const String *self = (const String *)p_self;
+ const String *string = (const String *)p_string;
+
+ return self->ends_with(*string);
+}
+
+godot_int GDAPI godot_string_find(const godot_string *p_self, godot_string p_what) {
+ const String *self = (const String *)p_self;
+ String *what = (String *)&p_what;
+
+ return self->find(*what);
+}
+
+godot_int GDAPI godot_string_find_from(const godot_string *p_self, godot_string p_what, godot_int p_from) {
+ const String *self = (const String *)p_self;
+ String *what = (String *)&p_what;
+
+ return self->find(*what, p_from);
+}
+
+godot_int GDAPI godot_string_findmk(const godot_string *p_self, const godot_array *p_keys) {
+ const String *self = (const String *)p_self;
+
+ Vector<String> keys;
+ Array *keys_proxy = (Array *)p_keys;
+ keys.resize(keys_proxy->size());
+ for (int i = 0; i < keys_proxy->size(); i++) {
+ keys[i] = (*keys_proxy)[i];
+ }
+
+ return self->findmk(keys);
+}
+
+godot_int GDAPI godot_string_findmk_from(const godot_string *p_self, const godot_array *p_keys, godot_int p_from) {
+ const String *self = (const String *)p_self;
+
+ Vector<String> keys;
+ Array *keys_proxy = (Array *)p_keys;
+ keys.resize(keys_proxy->size());
+ for (int i = 0; i < keys_proxy->size(); i++) {
+ keys[i] = (*keys_proxy)[i];
+ }
+
+ return self->findmk(keys, p_from);
+}
+
+godot_int GDAPI godot_string_findmk_from_in_place(const godot_string *p_self, const godot_array *p_keys, godot_int p_from, godot_int *r_key) {
+ const String *self = (const String *)p_self;
+
+ Vector<String> keys;
+ Array *keys_proxy = (Array *)p_keys;
+ keys.resize(keys_proxy->size());
+ for (int i = 0; i < keys_proxy->size(); i++) {
+ keys[i] = (*keys_proxy)[i];
+ }
+
+ return self->findmk(keys, p_from, r_key);
+}
+
+godot_int GDAPI godot_string_findn(const godot_string *p_self, godot_string p_what) {
+ const String *self = (const String *)p_self;
+ String *what = (String *)&p_what;
+
+ return self->findn(*what);
+}
+
+godot_int GDAPI godot_string_findn_from(const godot_string *p_self, godot_string p_what, godot_int p_from) {
+ const String *self = (const String *)p_self;
+ String *what = (String *)&p_what;
+
+ return self->findn(*what, p_from);
+}
+
+godot_int GDAPI find_last(const godot_string *p_self, godot_string p_what) {
+ const String *self = (const String *)p_self;
+ String *what = (String *)&p_what;
+
+ return self->find_last(*what);
+}
+
+godot_string GDAPI godot_string_format(const godot_string *p_self, const godot_variant *p_values) {
+ const String *self = (const String *)p_self;
+ const Variant *values = (const Variant *)p_values;
+ godot_string result;
+ memnew_placement(&result, String(self->format(*values)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_format_with_custom_placeholder(const godot_string *p_self, const godot_variant *p_values, const char *p_placeholder) {
+ const String *self = (const String *)p_self;
+ const Variant *values = (const Variant *)p_values;
+ String placeholder = String(p_placeholder);
+ godot_string result;
+ memnew_placement(&result, String(self->format(*values, placeholder)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_hex_encode_buffer(const uint8_t *p_buffer, godot_int p_len) {
+ godot_string result;
+ memnew_placement(&result, String(String::hex_encode_buffer(p_buffer, p_len)));
+
+ return result;
+}
+
+godot_int GDAPI godot_string_hex_to_int(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->hex_to_int();
+}
+
+godot_int GDAPI godot_string_hex_to_int_without_prefix(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->hex_to_int(true);
+}
+
+godot_string GDAPI godot_string_insert(const godot_string *p_self, godot_int p_at_pos, godot_string p_string) {
+ const String *self = (const String *)p_self;
+ String *content = (String *)&p_string;
+ godot_string result;
+ memnew_placement(&result, String(self->insert(p_at_pos, *content)));
+
+ return result;
+}
+
+godot_bool GDAPI godot_string_is_numeric(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->is_numeric();
+}
+
+godot_bool GDAPI godot_string_is_subsequence_of(const godot_string *p_self, const godot_string *p_string) {
+ const String *self = (const String *)p_self;
+ const String *string = (const String *)p_string;
+
+ return self->is_subsequence_of(*string);
+}
+
+godot_bool GDAPI godot_string_is_subsequence_ofi(const godot_string *p_self, const godot_string *p_string) {
+ const String *self = (const String *)p_self;
+ const String *string = (const String *)p_string;
+
+ return self->is_subsequence_ofi(*string);
+}
+
+godot_string GDAPI godot_string_lpad(const godot_string *p_self, godot_int p_min_length) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->lpad(p_min_length)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_lpad_with_custom_character(const godot_string *p_self, godot_int p_min_length, const godot_string *p_character) {
+ const String *self = (const String *)p_self;
+ const String *character = (const String *)p_character;
+ godot_string result;
+ memnew_placement(&result, String(self->lpad(p_min_length, *character)));
+
+ return result;
+}
+
+godot_bool GDAPI godot_string_match(const godot_string *p_self, const godot_string *p_wildcard) {
+ const String *self = (const String *)p_self;
+ const String *wildcard = (const String *)p_wildcard;
+
+ return self->match(*wildcard);
+}
+
+godot_bool GDAPI godot_string_matchn(const godot_string *p_self, const godot_string *p_wildcard) {
+ const String *self = (const String *)p_self;
+ const String *wildcard = (const String *)p_wildcard;
+
+ return self->matchn(*wildcard);
+}
+
+godot_string GDAPI godot_string_md5(const uint8_t *p_md5) {
+ godot_string result;
+ memnew_placement(&result, String(String::md5(p_md5)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_num(double p_num) {
+ godot_string result;
+ memnew_placement(&result, String(String::num(p_num)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_num_int64(int64_t p_num, godot_int p_base) {
+ godot_string result;
+ memnew_placement(&result, String(String::num_int64(p_num, p_base)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_num_int64_capitalized(int64_t p_num, godot_int p_base, godot_bool p_capitalize_hex) {
+ godot_string result;
+ memnew_placement(&result, String(String::num_int64(p_num, p_base, true)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_num_real(double p_num) {
+ godot_string result;
+ memnew_placement(&result, String(String::num_real(p_num)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_num_scientific(double p_num) {
+ godot_string result;
+ memnew_placement(&result, String(String::num_scientific(p_num)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_num_with_decimals(double p_num, godot_int p_decimals) {
+ godot_string result;
+ memnew_placement(&result, String(String::num(p_num, p_decimals)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_pad_decimals(const godot_string *p_self, godot_int p_digits) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->pad_decimals(p_digits)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_pad_zeros(const godot_string *p_self, godot_int p_digits) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->pad_zeros(p_digits)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_replace(const godot_string *p_self, godot_string p_key, godot_string p_with) {
+ const String *self = (const String *)p_self;
+ String *key = (String *)&p_key;
+ String *with = (String *)&p_with;
+ godot_string result;
+ memnew_placement(&result, String(self->replace(*key, *with)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_replacen(const godot_string *p_self, godot_string p_key, godot_string p_with) {
+ const String *self = (const String *)p_self;
+ String *key = (String *)&p_key;
+ String *with = (String *)&p_with;
+ godot_string result;
+ memnew_placement(&result, String(self->replacen(*key, *with)));
+
+ return result;
+}
+
+godot_int GDAPI godot_string_rfind(const godot_string *p_self, godot_string p_what) {
+ const String *self = (const String *)p_self;
+ String *what = (String *)&p_what;
+
+ return self->rfind(*what);
+}
+
+godot_int GDAPI godot_string_rfindn(const godot_string *p_self, godot_string p_what) {
+ const String *self = (const String *)p_self;
+ String *what = (String *)&p_what;
+
+ return self->rfindn(*what);
+}
+
+godot_int GDAPI godot_string_rfind_from(const godot_string *p_self, godot_string p_what, godot_int p_from) {
+ const String *self = (const String *)p_self;
+ String *what = (String *)&p_what;
+
+ return self->rfind(*what, p_from);
+}
+
+godot_int GDAPI godot_string_rfindn_from(const godot_string *p_self, godot_string p_what, godot_int p_from) {
+ const String *self = (const String *)p_self;
+ String *what = (String *)&p_what;
+
+ return self->rfindn(*what, p_from);
+}
+
+godot_string GDAPI godot_string_replace_first(const godot_string *p_self, godot_string p_key, godot_string p_with) {
+ const String *self = (const String *)p_self;
+ String *key = (String *)&p_key;
+ String *with = (String *)&p_with;
+ godot_string result;
+ memnew_placement(&result, String(self->replace_first(*key, *with)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_rpad(const godot_string *p_self, godot_int p_min_length) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->rpad(p_min_length)));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_rpad_with_custom_character(const godot_string *p_self, godot_int p_min_length, const godot_string *p_character) {
+ const String *self = (const String *)p_self;
+ const String *character = (const String *)p_character;
+ godot_string result;
+ memnew_placement(&result, String(self->rpad(p_min_length, *character)));
+
+ return result;
+}
+
+godot_real GDAPI godot_string_similarity(const godot_string *p_self, const godot_string *p_string) {
+ const String *self = (const String *)p_self;
+ const String *string = (const String *)p_string;
+
+ return self->similarity(*string);
+}
+
+godot_string GDAPI godot_string_sprintf(const godot_string *p_self, const godot_array *p_values, godot_bool *p_error) {
+ const String *self = (const String *)p_self;
+ const Array *values = (const Array *)p_values;
+
+ godot_string result;
+ String return_value = self->sprintf(*values, p_error);
+ memnew_placement(&result, String(return_value));
+
+ return result;
+}
+
+godot_string GDAPI godot_string_substr(const godot_string *p_self, godot_int p_from, godot_int p_chars) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->substr(p_from, p_chars)));
+
+ return result;
+}
+
+double GDAPI godot_string_to_double(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->to_double();
+}
+
+godot_real GDAPI godot_string_to_float(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->to_float();
+}
+
+godot_int GDAPI godot_string_to_int(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->to_int();
+}
+
+godot_string GDAPI godot_string_capitalize(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->capitalize()));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_camelcase_to_underscore(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->camelcase_to_underscore(false)));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_camelcase_to_underscore_lowercased(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->camelcase_to_underscore()));
+
+ return result;
+};
+
+double GDAPI godot_string_char_to_double(const char *p_what) {
+ return String::to_double(p_what);
+};
+
+godot_int GDAPI godot_string_char_to_int(const char *p_what) {
+ return String::to_int(p_what);
+};
+
+int64_t GDAPI godot_string_wchar_to_int(const wchar_t *p_str) {
+ return String::to_int(p_str);
+};
+
+godot_int GDAPI godot_string_char_to_int_with_len(const char *p_what, godot_int p_len) {
+ return String::to_int(p_what, p_len);
+};
+
+int64_t GDAPI godot_string_char_to_int64_with_len(const wchar_t *p_str, int p_len) {
+ return String::to_int(p_str, p_len);
+};
+
+int64_t GDAPI godot_string_hex_to_int64(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->hex_to_int64(false);
+};
+
+int64_t GDAPI godot_string_hex_to_int64_with_prefix(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->hex_to_int64();
+};
+
+int64_t GDAPI godot_string_to_int64(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->to_int64();
+};
+
+double GDAPI godot_string_unicode_char_to_double(const wchar_t *p_str, const wchar_t **r_end) {
+ return String::to_double(p_str, r_end);
+}
+
+godot_string GDAPI godot_string_get_slice(const godot_string *p_self, godot_string p_splitter, godot_int p_slice) {
+ const String *self = (const String *)p_self;
+ String *splitter = (String *)&p_splitter;
+ godot_string result;
+ memnew_placement(&result, String(self->get_slice(*splitter, p_slice)));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_get_slicec(const godot_string *p_self, wchar_t p_splitter, godot_int p_slice) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->get_slicec(p_splitter, p_slice)));
+
+ return result;
+};
+
+godot_array GDAPI godot_string_split(const godot_string *p_self, const godot_string *p_splitter) {
+ const String *self = (const String *)p_self;
+ const String *splitter = (const String *)p_splitter;
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ Vector<String> return_value = self->split(*splitter, false);
+
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_array GDAPI godot_string_split_allow_empty(const godot_string *p_self, const godot_string *p_splitter) {
+ const String *self = (const String *)p_self;
+ const String *splitter = (const String *)p_splitter;
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ Vector<String> return_value = self->split(*splitter);
+
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_array GDAPI godot_string_split_floats(const godot_string *p_self, const godot_string *p_splitter) {
+ const String *self = (const String *)p_self;
+ const String *splitter = (const String *)p_splitter;
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ Vector<float> return_value = self->split_floats(*splitter, false);
+
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_array GDAPI godot_string_split_floats_allows_empty(const godot_string *p_self, const godot_string *p_splitter) {
+ const String *self = (const String *)p_self;
+ const String *splitter = (const String *)p_splitter;
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ Vector<float> return_value = self->split_floats(*splitter);
+
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_array GDAPI godot_string_split_floats_mk(const godot_string *p_self, const godot_array *p_splitters) {
+ const String *self = (const String *)p_self;
+
+ Vector<String> splitters;
+ Array *splitter_proxy = (Array *)p_splitters;
+ splitters.resize(splitter_proxy->size());
+ for (int i = 0; i < splitter_proxy->size(); i++) {
+ splitters[i] = (*splitter_proxy)[i];
+ }
+
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ Vector<float> return_value = self->split_floats_mk(splitters, false);
+
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_array GDAPI godot_string_split_floats_mk_allows_empty(const godot_string *p_self, const godot_array *p_splitters) {
+ const String *self = (const String *)p_self;
+
+ Vector<String> splitters;
+ Array *splitter_proxy = (Array *)p_splitters;
+ splitters.resize(splitter_proxy->size());
+ for (int i = 0; i < splitter_proxy->size(); i++) {
+ splitters[i] = (*splitter_proxy)[i];
+ }
+
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ Vector<float> return_value = self->split_floats_mk(splitters);
+
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_array GDAPI godot_string_split_ints(const godot_string *p_self, const godot_string *p_splitter) {
+ const String *self = (const String *)p_self;
+ const String *splitter = (const String *)p_splitter;
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ Vector<int> return_value = self->split_ints(*splitter, false);
+
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_array GDAPI godot_string_split_ints_allows_empty(const godot_string *p_self, const godot_string *p_splitter) {
+ const String *self = (const String *)p_self;
+ const String *splitter = (const String *)p_splitter;
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ Vector<int> return_value = self->split_ints(*splitter);
+
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_array GDAPI godot_string_split_ints_mk(const godot_string *p_self, const godot_array *p_splitters) {
+ const String *self = (const String *)p_self;
+
+ Vector<String> splitters;
+ Array *splitter_proxy = (Array *)p_splitters;
+ splitters.resize(splitter_proxy->size());
+ for (int i = 0; i < splitter_proxy->size(); i++) {
+ splitters[i] = (*splitter_proxy)[i];
+ }
+
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ Vector<int> return_value = self->split_ints_mk(splitters, false);
+
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_array GDAPI godot_string_split_ints_mk_allows_empty(const godot_string *p_self, const godot_array *p_splitters) {
+ const String *self = (const String *)p_self;
+
+ Vector<String> splitters;
+ Array *splitter_proxy = (Array *)p_splitters;
+ splitters.resize(splitter_proxy->size());
+ for (int i = 0; i < splitter_proxy->size(); i++) {
+ splitters[i] = (*splitter_proxy)[i];
+ }
+
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ Vector<int> return_value = self->split_ints_mk(splitters);
+
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_array GDAPI godot_string_split_spaces(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_array result;
+ memnew_placement(&result, Array);
+ Array *proxy = (Array *)&result;
+ Vector<String> return_value = self->split_spaces();
+
+ proxy->resize(return_value.size());
+ for (int i = 0; i < return_value.size(); i++) {
+ (*proxy)[i] = return_value[i];
+ }
+
+ return result;
+};
+
+godot_int GDAPI godot_string_get_slice_count(const godot_string *p_self, godot_string p_splitter) {
+ const String *self = (const String *)p_self;
+ String *splitter = (String *)&p_splitter;
+
+ return self->get_slice_count(*splitter);
+};
+
+wchar_t GDAPI godot_string_char_lowercase(wchar_t p_char) {
+ return String::char_lowercase(p_char);
+};
+
+wchar_t GDAPI godot_string_char_uppercase(wchar_t p_char) {
+ return String::char_uppercase(p_char);
+};
+
+godot_string GDAPI godot_string_to_lower(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->to_lower()));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_to_upper(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->to_upper()));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_get_basename(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->get_basename()));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_get_extension(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->get_extension()));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_left(const godot_string *p_self, godot_int p_pos) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->left(p_pos)));
+
+ return result;
+};
+
+wchar_t GDAPI godot_string_ord_at(const godot_string *p_self, godot_int p_idx) {
+ const String *self = (const String *)p_self;
+
+ return self->ord_at(p_idx);
+};
+
+godot_string GDAPI godot_string_plus_file(const godot_string *p_self, const godot_string *p_file) {
+ const String *self = (const String *)p_self;
+ const String *file = (const String *)p_file;
+ godot_string result;
+ memnew_placement(&result, String(self->plus_file(*file)));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_right(const godot_string *p_self, godot_int p_pos) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->right(p_pos)));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_strip_edges(const godot_string *p_self, godot_bool p_left, godot_bool p_right) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->strip_edges(p_left, p_right)));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_strip_escapes(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->strip_escapes()));
+
+ return result;
+};
+
+void GDAPI godot_string_erase(godot_string *p_self, godot_int p_pos, godot_int p_chars) {
+ String *self = (String *)p_self;
+
+ return self->erase(p_pos, p_chars);
+};
+
+void GDAPI godot_string_ascii(godot_string *p_self, char *result) {
+ String *self = (String *)p_self;
+ Vector<char> return_value = self->ascii();
+
+ for (int i = 0; i < return_value.size(); i++) {
+ result[i] = return_value[i];
+ }
+}
+
+void GDAPI godot_string_ascii_extended(godot_string *p_self, char *result) {
+ String *self = (String *)p_self;
+ Vector<char> return_value = self->ascii(true);
+
+ for (int i = 0; i < return_value.size(); i++) {
+ result[i] = return_value[i];
+ }
+}
+
+void GDAPI godot_string_utf8(godot_string *p_self, char *result) {
+ String *self = (String *)p_self;
+ Vector<char> return_value = self->utf8();
+
+ for (int i = 0; i < return_value.size(); i++) {
+ result[i] = return_value[i];
+ }
+}
+
+godot_bool GDAPI godot_string_parse_utf8(godot_string *p_self, const char *p_utf8) {
+ String *self = (String *)p_self;
+
+ return self->parse_utf8(p_utf8);
+};
+
+godot_bool GDAPI godot_string_parse_utf8_with_len(godot_string *p_self, const char *p_utf8, godot_int p_len) {
+ String *self = (String *)p_self;
+
+ return self->parse_utf8(p_utf8, p_len);
+};
+
+godot_string GDAPI godot_string_chars_to_utf8(const char *p_utf8) {
+ godot_string result;
+ memnew_placement(&result, String(String::utf8(p_utf8)));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_chars_to_utf8_with_len(const char *p_utf8, godot_int p_len) {
+ godot_string result;
+ memnew_placement(&result, String(String::utf8(p_utf8, p_len)));
+
+ return result;
+};
+
+uint32_t GDAPI godot_string_hash(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->hash();
+};
+
+uint64_t GDAPI godot_string_hash64(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->hash64();
+};
+
+uint32_t GDAPI godot_string_hash_chars(const char *p_cstr) {
+ return String::hash(p_cstr);
+};
+
+uint32_t GDAPI godot_string_hash_chars_with_len(const char *p_cstr, godot_int p_len) {
+ return String::hash(p_cstr, p_len);
+};
+
+uint32_t GDAPI godot_string_hash_utf8_chars(const wchar_t *p_str) {
+ return String::hash(p_str);
+};
+
+uint32_t GDAPI godot_string_hash_utf8_chars_with_len(const wchar_t *p_str, godot_int p_len) {
+ return String::hash(p_str, p_len);
+};
+
+godot_pool_byte_array GDAPI godot_string_md5_buffer(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ Vector<uint8_t> tmp_result = self->md5_buffer();
+
+ godot_pool_byte_array result;
+ memnew_placement(&result, PoolByteArray);
+ PoolByteArray *proxy = (PoolByteArray *)&result;
+ PoolByteArray::Write proxy_writer = proxy->write();
+ proxy->resize(tmp_result.size());
+
+ for (int i = 0; i < tmp_result.size(); i++) {
+ proxy_writer[i] = tmp_result[i];
+ }
+
+ return result;
+};
+
+godot_string GDAPI godot_string_md5_text(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->md5_text()));
+
+ return result;
+};
+
+godot_pool_byte_array GDAPI godot_string_sha256_buffer(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ Vector<uint8_t> tmp_result = self->sha256_buffer();
+
+ godot_pool_byte_array result;
+ memnew_placement(&result, PoolByteArray);
+ PoolByteArray *proxy = (PoolByteArray *)&result;
+ PoolByteArray::Write proxy_writer = proxy->write();
+ proxy->resize(tmp_result.size());
+
+ for (int i = 0; i < tmp_result.size(); i++) {
+ proxy_writer[i] = tmp_result[i];
+ }
+
+ return result;
+};
+
+godot_string GDAPI godot_string_sha256_text(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ memnew_placement(&result, String(self->sha256_text()));
+
+ return result;
+};
+
+godot_bool godot_string_empty(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->empty();
+};
+
+// path functions
+godot_string GDAPI godot_string_get_base_dir(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->get_base_dir();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_get_file(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->get_file();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_humanize_size(size_t p_size) {
+ godot_string result;
+ String return_value = String::humanize_size(p_size);
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_bool GDAPI godot_string_is_abs_path(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->is_abs_path();
+};
+
+godot_bool GDAPI godot_string_is_rel_path(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->is_rel_path();
+};
+
+godot_bool GDAPI godot_string_is_resource_file(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->is_resource_file();
+};
+
+godot_string GDAPI godot_string_path_to(const godot_string *p_self, const godot_string *p_path) {
+ const String *self = (const String *)p_self;
+ String *path = (String *)p_path;
+ godot_string result;
+ String return_value = self->path_to(*path);
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_path_to_file(const godot_string *p_self, const godot_string *p_path) {
+ const String *self = (const String *)p_self;
+ String *path = (String *)p_path;
+ godot_string result;
+ String return_value = self->path_to_file(*path);
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_simplify_path(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->simplify_path();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_c_escape(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->c_escape();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_c_escape_multiline(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->c_escape_multiline();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_c_unescape(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->c_unescape();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_http_escape(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->http_escape();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_http_unescape(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->http_unescape();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_json_escape(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->json_escape();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_word_wrap(const godot_string *p_self, godot_int p_chars_per_line) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->word_wrap(p_chars_per_line);
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_xml_escape(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->xml_escape();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_xml_escape_with_quotes(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->xml_escape(true);
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_xml_unescape(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->xml_unescape();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_percent_decode(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->percent_decode();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_string GDAPI godot_string_percent_encode(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+ godot_string result;
+ String return_value = self->percent_encode();
+ memnew_placement(&result, String(return_value));
+
+ return result;
+};
+
+godot_bool GDAPI godot_string_is_valid_float(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->is_valid_float();
+};
+
+godot_bool GDAPI godot_string_is_valid_hex_number(const godot_string *p_self, godot_bool p_with_prefix) {
+ const String *self = (const String *)p_self;
+
+ return self->is_valid_hex_number(p_with_prefix);
+};
+
+godot_bool GDAPI godot_string_is_valid_html_color(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->is_valid_html_color();
+};
+
+godot_bool GDAPI godot_string_is_valid_identifier(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->is_valid_identifier();
+};
+
+godot_bool GDAPI godot_string_is_valid_integer(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->is_valid_integer();
+};
+
+godot_bool GDAPI godot_string_is_valid_ip_address(const godot_string *p_self) {
+ const String *self = (const String *)p_self;
+
+ return self->is_valid_ip_address();
+};
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/string.h b/modules/gdnative/godot/string.h
new file mode 100644
index 0000000000..c901ce36e6
--- /dev/null
+++ b/modules/gdnative/godot/string.h
@@ -0,0 +1,228 @@
+/*************************************************************************/
+/* string.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_STRING_H
+#define GODOT_STRING_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <wchar.h>
+
+#define GODOT_STRING_SIZE 8
+
+#ifndef GODOT_CORE_API_GODOT_STRING_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_STRING_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_STRING_SIZE];
+} godot_string;
+#endif
+
+#include <godot/gdnative.h>
+#include <godot/variant.h>
+
+void GDAPI godot_string_new(godot_string *r_dest);
+void GDAPI godot_string_new_copy(godot_string *r_dest, const godot_string *p_src);
+void GDAPI godot_string_new_data(godot_string *r_dest, const char *p_contents, const int p_size);
+void GDAPI godot_string_new_unicode_data(godot_string *r_dest, const wchar_t *p_contents, const int p_size);
+
+void GDAPI godot_string_get_data(const godot_string *p_self, char *p_dest, int *p_size);
+
+wchar_t GDAPI *godot_string_operator_index(godot_string *p_self, const godot_int p_idx);
+const char GDAPI *godot_string_c_str(const godot_string *p_self);
+const wchar_t GDAPI *godot_string_unicode_str(const godot_string *p_self);
+
+godot_bool GDAPI godot_string_operator_equal(const godot_string *p_self, const godot_string *p_b);
+godot_bool GDAPI godot_string_operator_less(const godot_string *p_self, const godot_string *p_b);
+godot_string GDAPI godot_string_operator_plus(const godot_string *p_self, const godot_string *p_b);
+
+/* Standard size stuff */
+
+godot_int GDAPI godot_string_length(const godot_string *p_self);
+
+/* Helpers */
+
+godot_bool GDAPI godot_string_begins_with(const godot_string *p_self, const godot_string *p_string);
+godot_bool GDAPI godot_string_begins_with_char_array(const godot_string *p_self, const char *p_char_array);
+godot_array GDAPI godot_string_bigrams(const godot_string *p_self);
+godot_string GDAPI godot_string_chr(wchar_t p_character);
+godot_bool GDAPI godot_string_ends_with(const godot_string *p_self, const godot_string *p_string);
+godot_int GDAPI godot_string_find(const godot_string *p_self, godot_string p_what);
+godot_int GDAPI godot_string_find_from(const godot_string *p_self, godot_string p_what, godot_int p_from);
+godot_int GDAPI godot_string_findmk(const godot_string *p_self, const godot_array *p_keys);
+godot_int GDAPI godot_string_findmk_from(const godot_string *p_self, const godot_array *p_keys, godot_int p_from);
+godot_int GDAPI godot_string_findmk_from_in_place(const godot_string *p_self, const godot_array *p_keys, godot_int p_from, godot_int *r_key);
+godot_int GDAPI godot_string_findn(const godot_string *p_self, godot_string p_what);
+godot_int GDAPI godot_string_findn_from(const godot_string *p_self, godot_string p_what, godot_int p_from);
+godot_int GDAPI find_last(const godot_string *p_self, godot_string p_what);
+godot_string GDAPI godot_string_format(const godot_string *p_self, const godot_variant *p_values);
+godot_string GDAPI godot_string_format_with_custom_placeholder(const godot_string *p_self, const godot_variant *p_values, const char *p_placeholder);
+godot_string GDAPI godot_string_hex_encode_buffer(const uint8_t *p_buffer, godot_int p_len);
+godot_int GDAPI godot_string_hex_to_int(const godot_string *p_self);
+godot_int GDAPI godot_string_hex_to_int_without_prefix(const godot_string *p_self);
+godot_string GDAPI godot_string_insert(const godot_string *p_self, godot_int p_at_pos, godot_string p_string);
+godot_bool GDAPI godot_string_is_numeric(const godot_string *p_self);
+godot_bool GDAPI godot_string_is_subsequence_of(const godot_string *p_self, const godot_string *p_string);
+godot_bool GDAPI godot_string_is_subsequence_ofi(const godot_string *p_self, const godot_string *p_string);
+godot_string GDAPI godot_string_lpad(const godot_string *p_self, godot_int p_min_length);
+godot_string GDAPI godot_string_lpad_with_custom_character(const godot_string *p_self, godot_int p_min_length, const godot_string *p_character);
+godot_bool GDAPI godot_string_match(const godot_string *p_self, const godot_string *p_wildcard);
+godot_bool GDAPI godot_string_matchn(const godot_string *p_self, const godot_string *p_wildcard);
+godot_string GDAPI godot_string_md5(const uint8_t *p_md5);
+godot_string GDAPI godot_string_num(double p_num);
+godot_string GDAPI godot_string_num_int64(int64_t p_num, godot_int p_base);
+godot_string GDAPI godot_string_num_int64_capitalized(int64_t p_num, godot_int p_base, godot_bool p_capitalize_hex);
+godot_string GDAPI godot_string_num_real(double p_num);
+godot_string GDAPI godot_string_num_scientific(double p_num);
+godot_string GDAPI godot_string_num_with_decimals(double p_num, godot_int p_decimals);
+godot_string GDAPI godot_string_pad_decimals(const godot_string *p_self, godot_int p_digits);
+godot_string GDAPI godot_string_pad_zeros(const godot_string *p_self, godot_int p_digits);
+godot_string GDAPI godot_string_replace_first(const godot_string *p_self, godot_string p_key, godot_string p_with);
+godot_string GDAPI godot_string_replace(const godot_string *p_self, godot_string p_key, godot_string p_with);
+godot_string GDAPI godot_string_replacen(const godot_string *p_self, godot_string p_key, godot_string p_with);
+godot_int GDAPI godot_string_rfind(const godot_string *p_self, godot_string p_what);
+godot_int GDAPI godot_string_rfindn(const godot_string *p_self, godot_string p_what);
+godot_int GDAPI godot_string_rfind_from(const godot_string *p_self, godot_string p_what, godot_int p_from);
+godot_int GDAPI godot_string_rfindn_from(const godot_string *p_self, godot_string p_what, godot_int p_from);
+godot_string GDAPI godot_string_rpad(const godot_string *p_self, godot_int p_min_length);
+godot_string GDAPI godot_string_rpad_with_custom_character(const godot_string *p_self, godot_int p_min_length, const godot_string *p_character);
+godot_real GDAPI godot_string_similarity(const godot_string *p_self, const godot_string *p_string);
+godot_string GDAPI godot_string_sprintf(const godot_string *p_self, const godot_array *p_values, godot_bool *p_error);
+godot_string GDAPI godot_string_substr(const godot_string *p_self, godot_int p_from, godot_int p_chars);
+double GDAPI godot_string_to_double(const godot_string *p_self);
+godot_real GDAPI godot_string_to_float(const godot_string *p_self);
+godot_int GDAPI godot_string_to_int(const godot_string *p_self);
+
+godot_string GDAPI godot_string_camelcase_to_underscore(const godot_string *p_self);
+godot_string GDAPI godot_string_camelcase_to_underscore_lowercased(const godot_string *p_self);
+godot_string GDAPI godot_string_capitalize(const godot_string *p_self);
+double GDAPI godot_string_char_to_double(const char *p_what);
+godot_int GDAPI godot_string_char_to_int(const char *p_what);
+int64_t GDAPI godot_string_wchar_to_int(const wchar_t *p_str);
+godot_int GDAPI godot_string_char_to_int_with_len(const char *p_what, godot_int p_len);
+int64_t GDAPI godot_string_char_to_int64_with_len(const wchar_t *p_str, int p_len);
+int64_t GDAPI godot_string_hex_to_int64(const godot_string *p_self);
+int64_t GDAPI godot_string_hex_to_int64_with_prefix(const godot_string *p_self);
+int64_t GDAPI godot_string_to_int64(const godot_string *p_self);
+double GDAPI godot_string_unicode_char_to_double(const wchar_t *p_str, const wchar_t **r_end);
+
+godot_int GDAPI godot_string_get_slice_count(const godot_string *p_self, godot_string p_splitter);
+godot_string GDAPI godot_string_get_slice(const godot_string *p_self, godot_string p_splitter, godot_int p_slice);
+godot_string GDAPI godot_string_get_slicec(const godot_string *p_self, wchar_t p_splitter, godot_int p_slice);
+
+godot_array GDAPI godot_string_split(const godot_string *p_self, const godot_string *p_splitter);
+godot_array GDAPI godot_string_split_allow_empty(const godot_string *p_self, const godot_string *p_splitter);
+godot_array GDAPI godot_string_split_floats(const godot_string *p_self, const godot_string *p_splitter);
+godot_array GDAPI godot_string_split_floats_allows_empty(const godot_string *p_self, const godot_string *p_splitter);
+godot_array GDAPI godot_string_split_floats_mk(const godot_string *p_self, const godot_array *p_splitters);
+godot_array GDAPI godot_string_split_floats_mk_allows_empty(const godot_string *p_self, const godot_array *p_splitters);
+godot_array GDAPI godot_string_split_ints(const godot_string *p_self, const godot_string *p_splitter);
+godot_array GDAPI godot_string_split_ints_allows_empty(const godot_string *p_self, const godot_string *p_splitter);
+godot_array GDAPI godot_string_split_ints_mk(const godot_string *p_self, const godot_array *p_splitters);
+godot_array GDAPI godot_string_split_ints_mk_allows_empty(const godot_string *p_self, const godot_array *p_splitters);
+godot_array GDAPI godot_string_split_spaces(const godot_string *p_self);
+
+wchar_t GDAPI godot_string_char_lowercase(wchar_t p_char);
+wchar_t GDAPI godot_string_char_uppercase(wchar_t p_char);
+godot_string GDAPI godot_string_to_lower(const godot_string *p_self);
+godot_string GDAPI godot_string_to_upper(const godot_string *p_self);
+
+godot_string GDAPI godot_string_get_basename(const godot_string *p_self);
+godot_string GDAPI godot_string_get_extension(const godot_string *p_self);
+godot_string GDAPI godot_string_left(const godot_string *p_self, godot_int p_pos);
+wchar_t GDAPI godot_string_ord_at(const godot_string *p_self, godot_int p_idx);
+godot_string GDAPI godot_string_plus_file(const godot_string *p_self, const godot_string *p_file);
+godot_string GDAPI godot_string_right(const godot_string *p_self, godot_int p_pos);
+godot_string GDAPI godot_string_strip_edges(const godot_string *p_self, godot_bool p_left, godot_bool p_right);
+godot_string GDAPI godot_string_strip_escapes(const godot_string *p_self);
+
+void GDAPI godot_string_erase(godot_string *p_self, godot_int p_pos, godot_int p_chars);
+
+void GDAPI godot_string_ascii(godot_string *p_self, char *result);
+void GDAPI godot_string_ascii_extended(godot_string *p_self, char *result);
+void GDAPI godot_string_utf8(godot_string *p_self, char *result);
+godot_bool GDAPI godot_string_parse_utf8(godot_string *p_self, const char *p_utf8);
+godot_bool GDAPI godot_string_parse_utf8_with_len(godot_string *p_self, const char *p_utf8, godot_int p_len);
+godot_string GDAPI godot_string_chars_to_utf8(const char *p_utf8);
+godot_string GDAPI godot_string_chars_utf8_with_len(const char *p_utf8, godot_int p_len);
+
+uint32_t GDAPI godot_string_hash(const godot_string *p_self);
+uint64_t GDAPI godot_string_hash64(const godot_string *p_self);
+uint32_t GDAPI godot_string_hash_chars(const char *p_cstr);
+uint32_t GDAPI godot_string_hash_chars_with_len(const char *p_cstr, godot_int p_len);
+uint32_t GDAPI godot_string_hash_utf8_chars(const wchar_t *p_str);
+uint32_t GDAPI godot_string_hash_utf8_chars_with_len(const wchar_t *p_str, godot_int p_len);
+godot_pool_byte_array GDAPI godot_string_md5_buffer(const godot_string *p_self);
+godot_string GDAPI godot_string_md5_text(const godot_string *p_self);
+godot_pool_byte_array GDAPI godot_string_sha256_buffer(const godot_string *p_self);
+godot_string GDAPI godot_string_sha256_text(const godot_string *p_self);
+
+godot_bool godot_string_empty(const godot_string *p_self);
+
+// path functions
+godot_string GDAPI godot_string_get_base_dir(const godot_string *p_self);
+godot_string GDAPI godot_string_get_file(const godot_string *p_self);
+godot_string GDAPI godot_string_humanize_size(size_t p_size);
+godot_bool GDAPI godot_string_is_abs_path(const godot_string *p_self);
+godot_bool GDAPI godot_string_is_rel_path(const godot_string *p_self);
+godot_bool GDAPI godot_string_is_resource_file(const godot_string *p_self);
+godot_string GDAPI godot_string_path_to(const godot_string *p_self, const godot_string *p_path);
+godot_string GDAPI godot_string_path_to_file(const godot_string *p_self, const godot_string *p_path);
+godot_string GDAPI godot_string_simplify_path(const godot_string *p_self);
+
+godot_string GDAPI godot_string_c_escape(const godot_string *p_self);
+godot_string GDAPI godot_string_c_escape_multiline(const godot_string *p_self);
+godot_string GDAPI godot_string_c_unescape(const godot_string *p_self);
+godot_string GDAPI godot_string_http_escape(const godot_string *p_self);
+godot_string GDAPI godot_string_http_unescape(const godot_string *p_self);
+godot_string GDAPI godot_string_json_escape(const godot_string *p_self);
+godot_string GDAPI godot_string_word_wrap(const godot_string *p_self, godot_int p_chars_per_line);
+godot_string GDAPI godot_string_xml_escape(const godot_string *p_self);
+godot_string GDAPI godot_string_xml_escape_with_quotes(const godot_string *p_self);
+godot_string GDAPI godot_string_xml_unescape(const godot_string *p_self);
+
+godot_string GDAPI godot_string_percent_decode(const godot_string *p_self);
+godot_string GDAPI godot_string_percent_encode(const godot_string *p_self);
+
+godot_bool GDAPI godot_string_is_valid_float(const godot_string *p_self);
+godot_bool GDAPI godot_string_is_valid_hex_number(const godot_string *p_self, godot_bool p_with_prefix);
+godot_bool GDAPI godot_string_is_valid_html_color(const godot_string *p_self);
+godot_bool GDAPI godot_string_is_valid_identifier(const godot_string *p_self);
+godot_bool GDAPI godot_string_is_valid_integer(const godot_string *p_self);
+godot_bool GDAPI godot_string_is_valid_ip_address(const godot_string *p_self);
+
+void GDAPI godot_string_destroy(godot_string *p_self);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_STRING_H
diff --git a/modules/gdnative/godot/transform.cpp b/modules/gdnative/godot/transform.cpp
new file mode 100644
index 0000000000..87fee918bd
--- /dev/null
+++ b/modules/gdnative/godot/transform.cpp
@@ -0,0 +1,223 @@
+/*************************************************************************/
+/* transform.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/transform.h>
+
+#include "core/math/transform.h"
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _transform_api_anchor() {}
+
+void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin) {
+ const Vector3 *x_axis = (const Vector3 *)p_x_axis;
+ const Vector3 *y_axis = (const Vector3 *)p_y_axis;
+ const Vector3 *z_axis = (const Vector3 *)p_z_axis;
+ const Vector3 *origin = (const Vector3 *)p_origin;
+ Transform *dest = (Transform *)r_dest;
+ dest->basis.set_axis(0, *x_axis);
+ dest->basis.set_axis(1, *y_axis);
+ dest->basis.set_axis(2, *z_axis);
+ dest->origin = *origin;
+}
+
+void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin) {
+ const Basis *basis = (const Basis *)p_basis;
+ const Vector3 *origin = (const Vector3 *)p_origin;
+ Transform *dest = (Transform *)r_dest;
+ *dest = Transform(*basis, *origin);
+}
+
+godot_basis GDAPI godot_transform_get_basis(const godot_transform *p_self) {
+ godot_basis dest;
+ const Transform *self = (const Transform *)p_self;
+ *((Basis *)&dest) = self->basis;
+ return dest;
+}
+
+void GDAPI godot_transform_set_basis(godot_transform *p_self, godot_basis *p_v) {
+ Transform *self = (Transform *)p_self;
+ const Basis *v = (const Basis *)p_v;
+ self->basis = *v;
+}
+
+godot_vector3 GDAPI godot_transform_get_origin(const godot_transform *p_self) {
+ godot_vector3 dest;
+ const Transform *self = (const Transform *)p_self;
+ *((Vector3 *)&dest) = self->origin;
+ return dest;
+}
+
+void GDAPI godot_transform_set_origin(godot_transform *p_self, godot_vector3 *p_v) {
+ Transform *self = (Transform *)p_self;
+ const Vector3 *v = (const Vector3 *)p_v;
+ self->origin = *v;
+}
+
+godot_string GDAPI godot_transform_as_string(const godot_transform *p_self) {
+ godot_string ret;
+ const Transform *self = (const Transform *)p_self;
+ memnew_placement(&ret, String(*self));
+ return ret;
+}
+
+godot_transform GDAPI godot_transform_inverse(const godot_transform *p_self) {
+ godot_transform dest;
+ const Transform *self = (const Transform *)p_self;
+ *((Transform *)&dest) = self->inverse();
+ return dest;
+}
+
+godot_transform GDAPI godot_transform_affine_inverse(const godot_transform *p_self) {
+ godot_transform dest;
+ const Transform *self = (const Transform *)p_self;
+ *((Transform *)&dest) = self->affine_inverse();
+ return dest;
+}
+
+godot_transform GDAPI godot_transform_orthonormalized(const godot_transform *p_self) {
+ godot_transform dest;
+ const Transform *self = (const Transform *)p_self;
+ *((Transform *)&dest) = self->orthonormalized();
+ return dest;
+}
+
+godot_transform GDAPI godot_transform_rotated(const godot_transform *p_self, const godot_vector3 *p_axis, const godot_real p_phi) {
+ godot_transform dest;
+ const Transform *self = (const Transform *)p_self;
+ const Vector3 *axis = (const Vector3 *)p_axis;
+ *((Transform *)&dest) = self->rotated(*axis, p_phi);
+ return dest;
+}
+
+godot_transform GDAPI godot_transform_scaled(const godot_transform *p_self, const godot_vector3 *p_scale) {
+ godot_transform dest;
+ const Transform *self = (const Transform *)p_self;
+ const Vector3 *scale = (const Vector3 *)p_scale;
+ *((Transform *)&dest) = self->scaled(*scale);
+ return dest;
+}
+
+godot_transform GDAPI godot_transform_translated(const godot_transform *p_self, const godot_vector3 *p_ofs) {
+ godot_transform dest;
+ const Transform *self = (const Transform *)p_self;
+ const Vector3 *ofs = (const Vector3 *)p_ofs;
+ *((Transform *)&dest) = self->translated(*ofs);
+ return dest;
+}
+
+godot_transform GDAPI godot_transform_looking_at(const godot_transform *p_self, const godot_vector3 *p_target, const godot_vector3 *p_up) {
+ godot_transform dest;
+ const Transform *self = (const Transform *)p_self;
+ const Vector3 *target = (const Vector3 *)p_target;
+ const Vector3 *up = (const Vector3 *)p_up;
+ *((Transform *)&dest) = self->looking_at(*target, *up);
+ return dest;
+}
+
+godot_plane GDAPI godot_transform_xform_plane(const godot_transform *p_self, const godot_plane *p_v) {
+ godot_plane raw_dest;
+ Plane *dest = (Plane *)&raw_dest;
+ const Transform *self = (const Transform *)p_self;
+ const Plane *v = (const Plane *)p_v;
+ *dest = self->xform(*v);
+ return raw_dest;
+}
+
+godot_plane GDAPI godot_transform_xform_inv_plane(const godot_transform *p_self, const godot_plane *p_v) {
+ godot_plane raw_dest;
+ Plane *dest = (Plane *)&raw_dest;
+ const Transform *self = (const Transform *)p_self;
+ const Plane *v = (const Plane *)p_v;
+ *dest = self->xform_inv(*v);
+ return raw_dest;
+}
+
+void GDAPI godot_transform_new_identity(godot_transform *r_dest) {
+ Transform *dest = (Transform *)r_dest;
+ *dest = Transform();
+}
+
+godot_bool GDAPI godot_transform_operator_equal(const godot_transform *p_self, const godot_transform *p_b) {
+ const Transform *self = (const Transform *)p_self;
+ const Transform *b = (const Transform *)p_b;
+ return *self == *b;
+}
+
+godot_transform GDAPI godot_transform_operator_multiply(const godot_transform *p_self, const godot_transform *p_b) {
+ godot_transform raw_dest;
+ Transform *dest = (Transform *)&raw_dest;
+ const Transform *self = (const Transform *)p_self;
+ const Transform *b = (const Transform *)p_b;
+ *dest = *self * *b;
+ return raw_dest;
+}
+
+godot_vector3 GDAPI godot_transform_xform_vector3(const godot_transform *p_self, const godot_vector3 *p_v) {
+ godot_vector3 raw_dest;
+ Vector3 *dest = (Vector3 *)&raw_dest;
+ const Transform *self = (const Transform *)p_self;
+ const Vector3 *v = (const Vector3 *)p_v;
+ *dest = self->xform(*v);
+ return raw_dest;
+}
+
+godot_vector3 GDAPI godot_transform_xform_inv_vector3(const godot_transform *p_self, const godot_vector3 *p_v) {
+ godot_vector3 raw_dest;
+ Vector3 *dest = (Vector3 *)&raw_dest;
+ const Transform *self = (const Transform *)p_self;
+ const Vector3 *v = (const Vector3 *)p_v;
+ *dest = self->xform_inv(*v);
+ return raw_dest;
+}
+
+godot_rect3 GDAPI godot_transform_xform_rect3(const godot_transform *p_self, const godot_rect3 *p_v) {
+ godot_rect3 raw_dest;
+ Rect3 *dest = (Rect3 *)&raw_dest;
+ const Transform *self = (const Transform *)p_self;
+ const Rect3 *v = (const Rect3 *)p_v;
+ *dest = self->xform(*v);
+ return raw_dest;
+}
+
+godot_rect3 GDAPI godot_transform_xform_inv_rect3(const godot_transform *p_self, const godot_rect3 *p_v) {
+ godot_rect3 raw_dest;
+ Rect3 *dest = (Rect3 *)&raw_dest;
+ const Transform *self = (const Transform *)p_self;
+ const Rect3 *v = (const Rect3 *)p_v;
+ *dest = self->xform_inv(*v);
+ return raw_dest;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/transform.h b/modules/gdnative/godot/transform.h
new file mode 100644
index 0000000000..30b9970f67
--- /dev/null
+++ b/modules/gdnative/godot/transform.h
@@ -0,0 +1,100 @@
+/*************************************************************************/
+/* transform.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_TRANSFORM_H
+#define GODOT_TRANSFORM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_TRANSFORM_SIZE 48
+
+#ifndef GODOT_CORE_API_GODOT_TRANSFORM_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_TRANSFORM_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_TRANSFORM_SIZE];
+} godot_transform;
+#endif
+
+#include <godot/basis.h>
+#include <godot/gdnative.h>
+#include <godot/variant.h>
+#include <godot/vector3.h>
+
+void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin);
+void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin);
+
+godot_basis GDAPI godot_transform_get_basis(const godot_transform *p_self);
+void GDAPI godot_transform_set_basis(godot_transform *p_self, godot_basis *p_v);
+
+godot_vector3 GDAPI godot_transform_get_origin(const godot_transform *p_self);
+void GDAPI godot_transform_set_origin(godot_transform *p_self, godot_vector3 *p_v);
+
+godot_string GDAPI godot_transform_as_string(const godot_transform *p_self);
+
+godot_transform GDAPI godot_transform_inverse(const godot_transform *p_self);
+
+godot_transform GDAPI godot_transform_affine_inverse(const godot_transform *p_self);
+
+godot_transform GDAPI godot_transform_orthonormalized(const godot_transform *p_self);
+
+godot_transform GDAPI godot_transform_rotated(const godot_transform *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
+
+godot_transform GDAPI godot_transform_scaled(const godot_transform *p_self, const godot_vector3 *p_scale);
+
+godot_transform GDAPI godot_transform_translated(const godot_transform *p_self, const godot_vector3 *p_ofs);
+
+godot_transform GDAPI godot_transform_looking_at(const godot_transform *p_self, const godot_vector3 *p_target, const godot_vector3 *p_up);
+
+godot_plane GDAPI godot_transform_xform_plane(const godot_transform *p_self, const godot_plane *p_v);
+
+godot_plane GDAPI godot_transform_xform_inv_plane(const godot_transform *p_self, const godot_plane *p_v);
+
+void GDAPI godot_transform_new_identity(godot_transform *r_dest);
+
+godot_bool GDAPI godot_transform_operator_equal(const godot_transform *p_self, const godot_transform *p_b);
+
+godot_transform GDAPI godot_transform_operator_multiply(const godot_transform *p_self, const godot_transform *p_b);
+
+godot_vector3 GDAPI godot_transform_xform_vector3(const godot_transform *p_self, const godot_vector3 *p_v);
+
+godot_vector3 GDAPI godot_transform_xform_inv_vector3(const godot_transform *p_self, const godot_vector3 *p_v);
+
+godot_rect3 GDAPI godot_transform_xform_rect3(const godot_transform *p_self, const godot_rect3 *p_v);
+
+godot_rect3 GDAPI godot_transform_xform_inv_rect3(const godot_transform *p_self, const godot_rect3 *p_v);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_TRANSFORM_H
diff --git a/modules/gdnative/godot/transform2d.cpp b/modules/gdnative/godot/transform2d.cpp
new file mode 100644
index 0000000000..65f9f8ee32
--- /dev/null
+++ b/modules/gdnative/godot/transform2d.cpp
@@ -0,0 +1,210 @@
+/*************************************************************************/
+/* transform2d.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/transform2d.h>
+
+#include "core/math/math_2d.h"
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _transform2d_api_anchor() {}
+
+void GDAPI godot_transform2d_new(godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos) {
+ const Vector2 *pos = (const Vector2 *)p_pos;
+ Transform2D *dest = (Transform2D *)r_dest;
+ *dest = Transform2D(p_rot, *pos);
+}
+
+void GDAPI godot_transform2d_new_axis_origin(godot_transform2d *r_dest, const godot_vector2 *p_x_axis, const godot_vector2 *p_y_axis, const godot_vector2 *p_origin) {
+ const Vector2 *x_axis = (const Vector2 *)p_x_axis;
+ const Vector2 *y_axis = (const Vector2 *)p_y_axis;
+ const Vector2 *origin = (const Vector2 *)p_origin;
+ Transform2D *dest = (Transform2D *)r_dest;
+ *dest = Transform2D(x_axis->x, x_axis->y, y_axis->x, y_axis->y, origin->x, origin->y);
+}
+
+godot_string GDAPI godot_transform2d_as_string(const godot_transform2d *p_self) {
+ godot_string ret;
+ const Transform2D *self = (const Transform2D *)p_self;
+ memnew_placement(&ret, String(*self));
+ return ret;
+}
+
+godot_transform2d GDAPI godot_transform2d_inverse(const godot_transform2d *p_self) {
+ godot_transform2d dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ *((Transform2D *)&dest) = self->inverse();
+ return dest;
+}
+
+godot_transform2d GDAPI godot_transform2d_affine_inverse(const godot_transform2d *p_self) {
+ godot_transform2d dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ *((Transform2D *)&dest) = self->affine_inverse();
+ return dest;
+}
+
+godot_real GDAPI godot_transform2d_get_rotation(const godot_transform2d *p_self) {
+ const Transform2D *self = (const Transform2D *)p_self;
+ return self->get_rotation();
+}
+
+godot_vector2 GDAPI godot_transform2d_get_origin(const godot_transform2d *p_self) {
+ godot_vector2 dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ *((Vector2 *)&dest) = self->get_origin();
+ return dest;
+}
+
+godot_vector2 GDAPI godot_transform2d_get_scale(const godot_transform2d *p_self) {
+ godot_vector2 dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ *((Vector2 *)&dest) = self->get_scale();
+ return dest;
+}
+
+godot_transform2d GDAPI godot_transform2d_orthonormalized(const godot_transform2d *p_self) {
+ godot_transform2d dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ *((Transform2D *)&dest) = self->orthonormalized();
+ return dest;
+}
+
+godot_transform2d GDAPI godot_transform2d_rotated(const godot_transform2d *p_self, const godot_real p_phi) {
+ godot_transform2d dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+
+ *((Transform2D *)&dest) = self->rotated(p_phi);
+ return dest;
+}
+
+godot_transform2d GDAPI godot_transform2d_scaled(const godot_transform2d *p_self, const godot_vector2 *p_scale) {
+ godot_transform2d dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ const Vector2 *scale = (const Vector2 *)p_scale;
+ *((Transform2D *)&dest) = self->scaled(*scale);
+ return dest;
+}
+
+godot_transform2d GDAPI godot_transform2d_translated(const godot_transform2d *p_self, const godot_vector2 *p_offset) {
+ godot_transform2d dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ const Vector2 *offset = (const Vector2 *)p_offset;
+ *((Transform2D *)&dest) = self->translated(*offset);
+ return dest;
+}
+
+godot_vector2 GDAPI godot_transform2d_xform_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v) {
+ godot_vector2 raw_dest;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ const Vector2 *v = (const Vector2 *)p_v;
+ *dest = self->xform(*v);
+ return raw_dest;
+}
+
+godot_vector2 GDAPI godot_transform2d_xform_inv_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v) {
+ godot_vector2 raw_dest;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ const Vector2 *v = (const Vector2 *)p_v;
+ *dest = self->xform_inv(*v);
+ return raw_dest;
+}
+
+godot_vector2 GDAPI godot_transform2d_basis_xform_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v) {
+ godot_vector2 raw_dest;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ const Vector2 *v = (const Vector2 *)p_v;
+ *dest = self->basis_xform(*v);
+ return raw_dest;
+}
+
+godot_vector2 GDAPI godot_transform2d_basis_xform_inv_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v) {
+ godot_vector2 raw_dest;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ const Vector2 *v = (const Vector2 *)p_v;
+ *dest = self->basis_xform_inv(*v);
+ return raw_dest;
+}
+
+godot_transform2d GDAPI godot_transform2d_interpolate_with(const godot_transform2d *p_self, const godot_transform2d *p_m, const godot_real p_c) {
+ godot_transform2d dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ const Transform2D *m = (const Transform2D *)p_m;
+ *((Transform2D *)&dest) = self->interpolate_with(*m, p_c);
+ return dest;
+}
+
+godot_bool GDAPI godot_transform2d_operator_equal(const godot_transform2d *p_self, const godot_transform2d *p_b) {
+ const Transform2D *self = (const Transform2D *)p_self;
+ const Transform2D *b = (const Transform2D *)p_b;
+ return *self == *b;
+}
+
+godot_transform2d GDAPI godot_transform2d_operator_multiply(const godot_transform2d *p_self, const godot_transform2d *p_b) {
+ godot_transform2d raw_dest;
+ Transform2D *dest = (Transform2D *)&raw_dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ const Transform2D *b = (const Transform2D *)p_b;
+ *dest = *self * *b;
+ return raw_dest;
+}
+
+void GDAPI godot_transform2d_new_identity(godot_transform2d *r_dest) {
+ Transform2D *dest = (Transform2D *)r_dest;
+ *dest = Transform2D();
+}
+
+godot_rect2 GDAPI godot_transform2d_xform_rect2(const godot_transform2d *p_self, const godot_rect2 *p_v) {
+ godot_rect2 raw_dest;
+ Rect2 *dest = (Rect2 *)&raw_dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ const Rect2 *v = (const Rect2 *)p_v;
+ *dest = self->xform(*v);
+ return raw_dest;
+}
+
+godot_rect2 GDAPI godot_transform2d_xform_inv_rect2(const godot_transform2d *p_self, const godot_rect2 *p_v) {
+ godot_rect2 raw_dest;
+ Rect2 *dest = (Rect2 *)&raw_dest;
+ const Transform2D *self = (const Transform2D *)p_self;
+ const Rect2 *v = (const Rect2 *)p_v;
+ *dest = self->xform_inv(*v);
+ return raw_dest;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/transform2d.h b/modules/gdnative/godot/transform2d.h
new file mode 100644
index 0000000000..41c8ba982c
--- /dev/null
+++ b/modules/gdnative/godot/transform2d.h
@@ -0,0 +1,99 @@
+/*************************************************************************/
+/* transform2d.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_TRANSFORM2D_H
+#define GODOT_TRANSFORM2D_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_TRANSFORM2D_SIZE 24
+
+#ifndef GODOT_CORE_API_GODOT_TRANSFORM2D_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_TRANSFORM2D_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_TRANSFORM2D_SIZE];
+} godot_transform2d;
+#endif
+
+#include <godot/gdnative.h>
+#include <godot/variant.h>
+#include <godot/vector2.h>
+
+void GDAPI godot_transform2d_new(godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos);
+void GDAPI godot_transform2d_new_axis_origin(godot_transform2d *r_dest, const godot_vector2 *p_x_axis, const godot_vector2 *p_y_axis, const godot_vector2 *p_origin);
+
+godot_string GDAPI godot_transform2d_as_string(const godot_transform2d *p_self);
+
+godot_transform2d GDAPI godot_transform2d_inverse(const godot_transform2d *p_self);
+
+godot_transform2d GDAPI godot_transform2d_affine_inverse(const godot_transform2d *p_self);
+
+godot_real GDAPI godot_transform2d_get_rotation(const godot_transform2d *p_self);
+
+godot_vector2 GDAPI godot_transform2d_get_origin(const godot_transform2d *p_self);
+
+godot_vector2 GDAPI godot_transform2d_get_scale(const godot_transform2d *p_self);
+
+godot_transform2d GDAPI godot_transform2d_orthonormalized(const godot_transform2d *p_self);
+
+godot_transform2d GDAPI godot_transform2d_rotated(const godot_transform2d *p_self, const godot_real p_phi);
+
+godot_transform2d GDAPI godot_transform2d_scaled(const godot_transform2d *p_self, const godot_vector2 *p_scale);
+
+godot_transform2d GDAPI godot_transform2d_translated(const godot_transform2d *p_self, const godot_vector2 *p_offset);
+
+godot_vector2 GDAPI godot_transform2d_xform_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
+
+godot_vector2 GDAPI godot_transform2d_xform_inv_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
+
+godot_vector2 GDAPI godot_transform2d_basis_xform_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
+
+godot_vector2 GDAPI godot_transform2d_basis_xform_inv_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
+
+godot_transform2d GDAPI godot_transform2d_interpolate_with(const godot_transform2d *p_self, const godot_transform2d *p_m, const godot_real p_c);
+
+godot_bool GDAPI godot_transform2d_operator_equal(const godot_transform2d *p_self, const godot_transform2d *p_b);
+
+godot_transform2d GDAPI godot_transform2d_operator_multiply(const godot_transform2d *p_self, const godot_transform2d *p_b);
+
+void GDAPI godot_transform2d_new_identity(godot_transform2d *r_dest);
+
+godot_rect2 GDAPI godot_transform2d_xform_rect2(const godot_transform2d *p_self, const godot_rect2 *p_v);
+
+godot_rect2 GDAPI godot_transform2d_xform_inv_rect2(const godot_transform2d *p_self, const godot_rect2 *p_v);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_TRANSFORM2D_H
diff --git a/modules/gdnative/godot/variant.cpp b/modules/gdnative/godot/variant.cpp
new file mode 100644
index 0000000000..d814ef913c
--- /dev/null
+++ b/modules/gdnative/godot/variant.cpp
@@ -0,0 +1,481 @@
+/*************************************************************************/
+/* variant.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/variant.h>
+
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _variant_api_anchor() {}
+
+#define memnew_placement_custom(m_placement, m_class, m_constr) _post_initialize(new (m_placement, sizeof(m_class), "") m_constr)
+
+// Constructors
+
+godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_self) {
+ const Variant *self = (const Variant *)p_self;
+ return (godot_variant_type)self->get_type();
+}
+
+void GDAPI godot_variant_new_copy(godot_variant *p_dest, const godot_variant *p_src) {
+ Variant *dest = (Variant *)p_dest;
+ Variant *src = (Variant *)p_src;
+ memnew_placement(dest, Variant(*src));
+}
+
+void GDAPI godot_variant_new_nil(godot_variant *r_dest) {
+ Variant *dest = (Variant *)r_dest;
+ memnew_placement(dest, Variant);
+}
+
+void GDAPI godot_variant_new_bool(godot_variant *r_dest, const godot_bool p_b) {
+ Variant *dest = (Variant *)r_dest;
+ memnew_placement_custom(dest, Variant, Variant(p_b));
+}
+
+void GDAPI godot_variant_new_uint(godot_variant *r_dest, const uint64_t p_i) {
+ Variant *dest = (Variant *)r_dest;
+ memnew_placement_custom(dest, Variant, Variant(p_i));
+}
+
+void GDAPI godot_variant_new_int(godot_variant *r_dest, const int64_t p_i) {
+ Variant *dest = (Variant *)r_dest;
+ memnew_placement_custom(dest, Variant, Variant(p_i));
+}
+
+void GDAPI godot_variant_new_real(godot_variant *r_dest, const double p_r) {
+ Variant *dest = (Variant *)r_dest;
+ memnew_placement_custom(dest, Variant, Variant(p_r));
+}
+
+void GDAPI godot_variant_new_string(godot_variant *r_dest, const godot_string *p_s) {
+ Variant *dest = (Variant *)r_dest;
+ String *s = (String *)p_s;
+ memnew_placement_custom(dest, Variant, Variant(*s));
+}
+
+void GDAPI godot_variant_new_vector2(godot_variant *r_dest, const godot_vector2 *p_v2) {
+ Variant *dest = (Variant *)r_dest;
+ Vector2 *v2 = (Vector2 *)p_v2;
+ memnew_placement_custom(dest, Variant, Variant(*v2));
+}
+
+void GDAPI godot_variant_new_rect2(godot_variant *r_dest, const godot_rect2 *p_rect2) {
+ Variant *dest = (Variant *)r_dest;
+ Rect2 *rect2 = (Rect2 *)p_rect2;
+ memnew_placement_custom(dest, Variant, Variant(*rect2));
+}
+
+void GDAPI godot_variant_new_vector3(godot_variant *r_dest, const godot_vector3 *p_v3) {
+ Variant *dest = (Variant *)r_dest;
+ Vector3 *v3 = (Vector3 *)p_v3;
+ memnew_placement_custom(dest, Variant, Variant(*v3));
+}
+
+void GDAPI godot_variant_new_transform2d(godot_variant *r_dest, const godot_transform2d *p_t2d) {
+ Variant *dest = (Variant *)r_dest;
+ Transform2D *t2d = (Transform2D *)p_t2d;
+ memnew_placement_custom(dest, Variant, Variant(*t2d));
+}
+
+void GDAPI godot_variant_new_plane(godot_variant *r_dest, const godot_plane *p_plane) {
+ Variant *dest = (Variant *)r_dest;
+ Plane *plane = (Plane *)p_plane;
+ memnew_placement_custom(dest, Variant, Variant(*plane));
+}
+
+void GDAPI godot_variant_new_quat(godot_variant *r_dest, const godot_quat *p_quat) {
+ Variant *dest = (Variant *)r_dest;
+ Quat *quat = (Quat *)p_quat;
+ memnew_placement_custom(dest, Variant, Variant(*quat));
+}
+
+void GDAPI godot_variant_new_rect3(godot_variant *r_dest, const godot_rect3 *p_rect3) {
+ Variant *dest = (Variant *)r_dest;
+ Rect3 *rect3 = (Rect3 *)p_rect3;
+ memnew_placement_custom(dest, Variant, Variant(*rect3));
+}
+
+void GDAPI godot_variant_new_basis(godot_variant *r_dest, const godot_basis *p_basis) {
+ Variant *dest = (Variant *)r_dest;
+ Basis *basis = (Basis *)p_basis;
+ memnew_placement_custom(dest, Variant, Variant(*basis));
+}
+
+void GDAPI godot_variant_new_transform(godot_variant *r_dest, const godot_transform *p_trans) {
+ Variant *dest = (Variant *)r_dest;
+ Transform *trans = (Transform *)p_trans;
+ memnew_placement_custom(dest, Variant, Variant(*trans));
+}
+
+void GDAPI godot_variant_new_color(godot_variant *r_dest, const godot_color *p_color) {
+ Variant *dest = (Variant *)r_dest;
+ Color *color = (Color *)p_color;
+ memnew_placement_custom(dest, Variant, Variant(*color));
+}
+
+void GDAPI godot_variant_new_node_path(godot_variant *r_dest, const godot_node_path *p_np) {
+ Variant *dest = (Variant *)r_dest;
+ NodePath *np = (NodePath *)p_np;
+ memnew_placement_custom(dest, Variant, Variant(*np));
+}
+
+void GDAPI godot_variant_new_rid(godot_variant *r_dest, const godot_rid *p_rid) {
+ Variant *dest = (Variant *)r_dest;
+ RID *rid = (RID *)p_rid;
+ memnew_placement_custom(dest, Variant, Variant(*rid));
+}
+
+void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj) {
+ Variant *dest = (Variant *)r_dest;
+ Object *obj = (Object *)p_obj;
+ memnew_placement_custom(dest, Variant, Variant(obj));
+}
+
+void GDAPI godot_variant_new_dictionary(godot_variant *r_dest, const godot_dictionary *p_dict) {
+ Variant *dest = (Variant *)r_dest;
+ Dictionary *dict = (Dictionary *)p_dict;
+ memnew_placement_custom(dest, Variant, Variant(*dict));
+}
+
+void GDAPI godot_variant_new_array(godot_variant *r_dest, const godot_array *p_arr) {
+ Variant *dest = (Variant *)r_dest;
+ Array *arr = (Array *)p_arr;
+ memnew_placement_custom(dest, Variant, Variant(*arr));
+}
+
+void GDAPI godot_variant_new_pool_byte_array(godot_variant *r_dest, const godot_pool_byte_array *p_pba) {
+ Variant *dest = (Variant *)r_dest;
+ PoolByteArray *pba = (PoolByteArray *)p_pba;
+ memnew_placement_custom(dest, Variant, Variant(*pba));
+}
+
+void GDAPI godot_variant_new_pool_int_array(godot_variant *r_dest, const godot_pool_int_array *p_pia) {
+ Variant *dest = (Variant *)r_dest;
+ PoolIntArray *pia = (PoolIntArray *)p_pia;
+ memnew_placement_custom(dest, Variant, Variant(*pia));
+}
+
+void GDAPI godot_variant_new_pool_real_array(godot_variant *r_dest, const godot_pool_real_array *p_pra) {
+ Variant *dest = (Variant *)r_dest;
+ PoolRealArray *pra = (PoolRealArray *)p_pra;
+ memnew_placement_custom(dest, Variant, Variant(*pra));
+}
+
+void GDAPI godot_variant_new_pool_string_array(godot_variant *r_dest, const godot_pool_string_array *p_psa) {
+ Variant *dest = (Variant *)r_dest;
+ PoolStringArray *psa = (PoolStringArray *)p_psa;
+ memnew_placement_custom(dest, Variant, Variant(*psa));
+}
+
+void GDAPI godot_variant_new_pool_vector2_array(godot_variant *r_dest, const godot_pool_vector2_array *p_pv2a) {
+ Variant *dest = (Variant *)r_dest;
+ PoolVector2Array *pv2a = (PoolVector2Array *)p_pv2a;
+ memnew_placement_custom(dest, Variant, Variant(*pv2a));
+}
+
+void GDAPI godot_variant_new_pool_vector3_array(godot_variant *r_dest, const godot_pool_vector3_array *p_pv3a) {
+ Variant *dest = (Variant *)r_dest;
+ PoolVector3Array *pv3a = (PoolVector3Array *)p_pv3a;
+ memnew_placement_custom(dest, Variant, Variant(*pv3a));
+}
+
+void GDAPI godot_variant_new_pool_color_array(godot_variant *r_dest, const godot_pool_color_array *p_pca) {
+ Variant *dest = (Variant *)r_dest;
+ PoolColorArray *pca = (PoolColorArray *)p_pca;
+ memnew_placement_custom(dest, Variant, Variant(*pca));
+}
+
+godot_bool GDAPI godot_variant_as_bool(const godot_variant *p_self) {
+ const Variant *self = (const Variant *)p_self;
+ return self->operator bool();
+}
+
+uint64_t GDAPI godot_variant_as_uint(const godot_variant *p_self) {
+ const Variant *self = (const Variant *)p_self;
+ return self->operator uint64_t();
+}
+
+int64_t GDAPI godot_variant_as_int(const godot_variant *p_self) {
+ const Variant *self = (const Variant *)p_self;
+ return self->operator int64_t();
+}
+
+double GDAPI godot_variant_as_real(const godot_variant *p_self) {
+ const Variant *self = (const Variant *)p_self;
+ return self->operator double();
+}
+
+godot_string GDAPI godot_variant_as_string(const godot_variant *p_self) {
+ godot_string raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ String *dest = (String *)&raw_dest;
+ memnew_placement(dest, String(self->operator String())); // operator = is overloaded by String
+ return raw_dest;
+}
+
+godot_vector2 GDAPI godot_variant_as_vector2(const godot_variant *p_self) {
+ godot_vector2 raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_rect2 GDAPI godot_variant_as_rect2(const godot_variant *p_self) {
+ godot_rect2 raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Rect2 *dest = (Rect2 *)&raw_dest;
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_vector3 GDAPI godot_variant_as_vector3(const godot_variant *p_self) {
+ godot_vector3 raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Vector3 *dest = (Vector3 *)&raw_dest;
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_transform2d GDAPI godot_variant_as_transform2d(const godot_variant *p_self) {
+ godot_transform2d raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Transform2D *dest = (Transform2D *)&raw_dest;
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_plane GDAPI godot_variant_as_plane(const godot_variant *p_self) {
+ godot_plane raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Plane *dest = (Plane *)&raw_dest;
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_quat GDAPI godot_variant_as_quat(const godot_variant *p_self) {
+ godot_quat raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Quat *dest = (Quat *)&raw_dest;
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_rect3 GDAPI godot_variant_as_rect3(const godot_variant *p_self) {
+ godot_rect3 raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Rect3 *dest = (Rect3 *)&raw_dest;
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_basis GDAPI godot_variant_as_basis(const godot_variant *p_self) {
+ godot_basis raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Basis *dest = (Basis *)&raw_dest;
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_transform GDAPI godot_variant_as_transform(const godot_variant *p_self) {
+ godot_transform raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Transform *dest = (Transform *)&raw_dest;
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_color GDAPI godot_variant_as_color(const godot_variant *p_self) {
+ godot_color raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Color *dest = (Color *)&raw_dest;
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_node_path GDAPI godot_variant_as_node_path(const godot_variant *p_self) {
+ godot_node_path raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ NodePath *dest = (NodePath *)&raw_dest;
+ memnew_placement(dest, NodePath(self->operator NodePath())); // operator = is overloaded by NodePath
+ return raw_dest;
+}
+
+godot_rid GDAPI godot_variant_as_rid(const godot_variant *p_self) {
+ godot_rid raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ RID *dest = (RID *)&raw_dest;
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_object GDAPI *godot_variant_as_object(const godot_variant *p_self) {
+ const Variant *self = (const Variant *)p_self;
+ Object *dest;
+ dest = *self;
+ return (godot_object *)dest;
+}
+
+godot_dictionary GDAPI godot_variant_as_dictionary(const godot_variant *p_self) {
+ godot_dictionary raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Dictionary *dest = (Dictionary *)&raw_dest;
+ memnew_placement(dest, Dictionary(self->operator Dictionary())); // operator = is overloaded by Dictionary
+ return raw_dest;
+}
+
+godot_array GDAPI godot_variant_as_array(const godot_variant *p_self) {
+ godot_array raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ Array *dest = (Array *)&raw_dest;
+ memnew_placement(dest, Array(self->operator Array())); // operator = is overloaded by Array
+ return raw_dest;
+}
+
+godot_pool_byte_array GDAPI godot_variant_as_pool_byte_array(const godot_variant *p_self) {
+ godot_pool_byte_array raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ PoolByteArray *dest = (PoolByteArray *)&raw_dest;
+ memnew_placement(dest, PoolByteArray(self->operator PoolByteArray())); // operator = is overloaded by PoolByteArray
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_pool_int_array GDAPI godot_variant_as_pool_int_array(const godot_variant *p_self) {
+ godot_pool_int_array raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ PoolIntArray *dest = (PoolIntArray *)&raw_dest;
+ memnew_placement(dest, PoolIntArray(self->operator PoolIntArray())); // operator = is overloaded by PoolIntArray
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_pool_real_array GDAPI godot_variant_as_pool_real_array(const godot_variant *p_self) {
+ godot_pool_real_array raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ PoolRealArray *dest = (PoolRealArray *)&raw_dest;
+ memnew_placement(dest, PoolRealArray(self->operator PoolRealArray())); // operator = is overloaded by PoolRealArray
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_pool_string_array GDAPI godot_variant_as_pool_string_array(const godot_variant *p_self) {
+ godot_pool_string_array raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ PoolStringArray *dest = (PoolStringArray *)&raw_dest;
+ memnew_placement(dest, PoolStringArray(self->operator PoolStringArray())); // operator = is overloaded by PoolStringArray
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_pool_vector2_array GDAPI godot_variant_as_pool_vector2_array(const godot_variant *p_self) {
+ godot_pool_vector2_array raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ PoolVector2Array *dest = (PoolVector2Array *)&raw_dest;
+ memnew_placement(dest, PoolVector2Array(self->operator PoolVector2Array())); // operator = is overloaded by PoolVector2Array
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_pool_vector3_array GDAPI godot_variant_as_pool_vector3_array(const godot_variant *p_self) {
+ godot_pool_vector3_array raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ PoolVector3Array *dest = (PoolVector3Array *)&raw_dest;
+ memnew_placement(dest, PoolVector3Array(self->operator PoolVector3Array())); // operator = is overloaded by PoolVector3Array
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_pool_color_array GDAPI godot_variant_as_pool_color_array(const godot_variant *p_self) {
+ godot_pool_color_array raw_dest;
+ const Variant *self = (const Variant *)p_self;
+ PoolColorArray *dest = (PoolColorArray *)&raw_dest;
+ memnew_placement(dest, PoolColorArray(self->operator PoolColorArray())); // operator = is overloaded by PoolColorArray
+ *dest = *self;
+ return raw_dest;
+}
+
+godot_variant GDAPI godot_variant_call(godot_variant *p_self, const godot_string *p_method, const godot_variant **p_args, const godot_int p_argcount, godot_variant_call_error *r_error) {
+ Variant *self = (Variant *)p_self;
+ String *method = (String *)p_method;
+ const Variant **args = (const Variant **)p_args;
+ godot_variant raw_dest;
+ Variant *dest = (Variant *)&raw_dest;
+ Variant::CallError error;
+ memnew_placement_custom(dest, Variant, Variant(self->call(*method, args, p_argcount, error)));
+ if (r_error) {
+ r_error->error = (godot_variant_call_error_error)error.error;
+ r_error->argument = error.argument;
+ r_error->expected = (godot_variant_type)error.expected;
+ }
+ return raw_dest;
+}
+
+godot_bool GDAPI godot_variant_has_method(const godot_variant *p_self, const godot_string *p_method) {
+ const Variant *self = (const Variant *)p_self;
+ const String *method = (const String *)p_method;
+ return self->has_method(*method);
+}
+
+godot_bool GDAPI godot_variant_operator_equal(const godot_variant *p_self, const godot_variant *p_other) {
+ const Variant *self = (const Variant *)p_self;
+ const Variant *other = (const Variant *)p_other;
+ return self->operator==(*other);
+}
+
+godot_bool GDAPI godot_variant_operator_less(const godot_variant *p_self, const godot_variant *p_other) {
+ const Variant *self = (const Variant *)p_self;
+ const Variant *other = (const Variant *)p_other;
+ return self->operator<(*other);
+}
+
+godot_bool GDAPI godot_variant_hash_compare(const godot_variant *p_self, const godot_variant *p_other) {
+ const Variant *self = (const Variant *)p_self;
+ const Variant *other = (const Variant *)p_other;
+ return self->hash_compare(*other);
+}
+
+godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self, godot_bool *r_valid) {
+ const Variant *self = (const Variant *)p_self;
+ bool &valid = *r_valid;
+ return self->booleanize(valid);
+}
+
+void GDAPI godot_variant_destroy(godot_variant *p_self) {
+ Variant *self = (Variant *)p_self;
+ self->~Variant();
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/variant.h b/modules/gdnative/godot/variant.h
new file mode 100644
index 0000000000..1c19d2a25b
--- /dev/null
+++ b/modules/gdnative/godot/variant.h
@@ -0,0 +1,201 @@
+/*************************************************************************/
+/* variant.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_VARIANT_H
+#define GODOT_VARIANT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_VARIANT_SIZE 24
+
+#ifndef GODOT_CORE_API_GODOT_VARIANT_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_VARIANT_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_VARIANT_SIZE];
+} godot_variant;
+#endif
+
+typedef enum godot_variant_type {
+ GODOT_VARIANT_TYPE_NIL,
+
+ // atomic types
+ GODOT_VARIANT_TYPE_BOOL,
+ GODOT_VARIANT_TYPE_INT,
+ GODOT_VARIANT_TYPE_REAL,
+ GODOT_VARIANT_TYPE_STRING,
+
+ // math types
+
+ GODOT_VARIANT_TYPE_VECTOR2, // 5
+ GODOT_VARIANT_TYPE_RECT2,
+ GODOT_VARIANT_TYPE_VECTOR3,
+ GODOT_VARIANT_TYPE_TRANSFORM2D,
+ GODOT_VARIANT_TYPE_PLANE,
+ GODOT_VARIANT_TYPE_QUAT, // 10
+ GODOT_VARIANT_TYPE_RECT3,
+ GODOT_VARIANT_TYPE_BASIS,
+ GODOT_VARIANT_TYPE_TRANSFORM,
+
+ // misc types
+ GODOT_VARIANT_TYPE_COLOR,
+ GODOT_VARIANT_TYPE_NODE_PATH, // 15
+ GODOT_VARIANT_TYPE_RID,
+ GODOT_VARIANT_TYPE_OBJECT,
+ GODOT_VARIANT_TYPE_DICTIONARY,
+ GODOT_VARIANT_TYPE_ARRAY, // 20
+
+ // arrays
+ GODOT_VARIANT_TYPE_POOL_BYTE_ARRAY,
+ GODOT_VARIANT_TYPE_POOL_INT_ARRAY,
+ GODOT_VARIANT_TYPE_POOL_REAL_ARRAY,
+ GODOT_VARIANT_TYPE_POOL_STRING_ARRAY,
+ GODOT_VARIANT_TYPE_POOL_VECTOR2_ARRAY, // 25
+ GODOT_VARIANT_TYPE_POOL_VECTOR3_ARRAY,
+ GODOT_VARIANT_TYPE_POOL_COLOR_ARRAY,
+} godot_variant_type;
+
+typedef enum godot_variant_call_error_error {
+ GODOT_CALL_ERROR_CALL_OK,
+ GODOT_CALL_ERROR_CALL_ERROR_INVALID_METHOD,
+ GODOT_CALL_ERROR_CALL_ERROR_INVALID_ARGUMENT,
+ GODOT_CALL_ERROR_CALL_ERROR_TOO_MANY_ARGUMENTS,
+ GODOT_CALL_ERROR_CALL_ERROR_TOO_FEW_ARGUMENTS,
+ GODOT_CALL_ERROR_CALL_ERROR_INSTANCE_IS_NULL,
+} godot_variant_call_error_error;
+
+typedef struct godot_variant_call_error {
+ godot_variant_call_error_error error;
+ int argument;
+ godot_variant_type expected;
+} godot_variant_call_error;
+
+#include <godot/array.h>
+#include <godot/basis.h>
+#include <godot/color.h>
+#include <godot/dictionary.h>
+#include <godot/node_path.h>
+#include <godot/plane.h>
+#include <godot/pool_arrays.h>
+#include <godot/quat.h>
+#include <godot/rect2.h>
+#include <godot/rect3.h>
+#include <godot/rid.h>
+#include <godot/string.h>
+#include <godot/transform.h>
+#include <godot/transform2d.h>
+#include <godot/variant.h>
+#include <godot/vector2.h>
+#include <godot/vector3.h>
+
+#include <godot/gdnative.h>
+
+godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_v);
+
+void GDAPI godot_variant_new_copy(godot_variant *r_dest, const godot_variant *p_src);
+
+void GDAPI godot_variant_new_nil(godot_variant *r_dest);
+
+void GDAPI godot_variant_new_bool(godot_variant *p_v, const godot_bool p_b);
+void GDAPI godot_variant_new_uint(godot_variant *r_dest, const uint64_t p_i);
+void GDAPI godot_variant_new_int(godot_variant *r_dest, const int64_t p_i);
+void GDAPI godot_variant_new_real(godot_variant *r_dest, const double p_r);
+void GDAPI godot_variant_new_string(godot_variant *r_dest, const godot_string *p_s);
+void GDAPI godot_variant_new_vector2(godot_variant *r_dest, const godot_vector2 *p_v2);
+void GDAPI godot_variant_new_rect2(godot_variant *r_dest, const godot_rect2 *p_rect2);
+void GDAPI godot_variant_new_vector3(godot_variant *r_dest, const godot_vector3 *p_v3);
+void GDAPI godot_variant_new_transform2d(godot_variant *r_dest, const godot_transform2d *p_t2d);
+void GDAPI godot_variant_new_plane(godot_variant *r_dest, const godot_plane *p_plane);
+void GDAPI godot_variant_new_quat(godot_variant *r_dest, const godot_quat *p_quat);
+void GDAPI godot_variant_new_rect3(godot_variant *r_dest, const godot_rect3 *p_rect3);
+void GDAPI godot_variant_new_basis(godot_variant *r_dest, const godot_basis *p_basis);
+void GDAPI godot_variant_new_transform(godot_variant *r_dest, const godot_transform *p_trans);
+void GDAPI godot_variant_new_color(godot_variant *r_dest, const godot_color *p_color);
+void GDAPI godot_variant_new_node_path(godot_variant *r_dest, const godot_node_path *p_np);
+void GDAPI godot_variant_new_rid(godot_variant *r_dest, const godot_rid *p_rid);
+void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj);
+void GDAPI godot_variant_new_dictionary(godot_variant *r_dest, const godot_dictionary *p_dict);
+void GDAPI godot_variant_new_array(godot_variant *r_dest, const godot_array *p_arr);
+void GDAPI godot_variant_new_pool_byte_array(godot_variant *r_dest, const godot_pool_byte_array *p_pba);
+void GDAPI godot_variant_new_pool_int_array(godot_variant *r_dest, const godot_pool_int_array *p_pia);
+void GDAPI godot_variant_new_pool_real_array(godot_variant *r_dest, const godot_pool_real_array *p_pra);
+void GDAPI godot_variant_new_pool_string_array(godot_variant *r_dest, const godot_pool_string_array *p_psa);
+void GDAPI godot_variant_new_pool_vector2_array(godot_variant *r_dest, const godot_pool_vector2_array *p_pv2a);
+void GDAPI godot_variant_new_pool_vector3_array(godot_variant *r_dest, const godot_pool_vector3_array *p_pv3a);
+void GDAPI godot_variant_new_pool_color_array(godot_variant *r_dest, const godot_pool_color_array *p_pca);
+
+godot_bool GDAPI godot_variant_as_bool(const godot_variant *p_self);
+uint64_t GDAPI godot_variant_as_uint(const godot_variant *p_self);
+int64_t GDAPI godot_variant_as_int(const godot_variant *p_self);
+double GDAPI godot_variant_as_real(const godot_variant *p_self);
+godot_string GDAPI godot_variant_as_string(const godot_variant *p_self);
+godot_vector2 GDAPI godot_variant_as_vector2(const godot_variant *p_self);
+godot_rect2 GDAPI godot_variant_as_rect2(const godot_variant *p_self);
+godot_vector3 GDAPI godot_variant_as_vector3(const godot_variant *p_self);
+godot_transform2d GDAPI godot_variant_as_transform2d(const godot_variant *p_self);
+godot_plane GDAPI godot_variant_as_plane(const godot_variant *p_self);
+godot_quat GDAPI godot_variant_as_quat(const godot_variant *p_self);
+godot_rect3 GDAPI godot_variant_as_rect3(const godot_variant *p_self);
+godot_basis GDAPI godot_variant_as_basis(const godot_variant *p_self);
+godot_transform GDAPI godot_variant_as_transform(const godot_variant *p_self);
+godot_color GDAPI godot_variant_as_color(const godot_variant *p_self);
+godot_node_path GDAPI godot_variant_as_node_path(const godot_variant *p_self);
+godot_rid GDAPI godot_variant_as_rid(const godot_variant *p_self);
+godot_object GDAPI *godot_variant_as_object(const godot_variant *p_self);
+godot_dictionary GDAPI godot_variant_as_dictionary(const godot_variant *p_self);
+godot_array GDAPI godot_variant_as_array(const godot_variant *p_self);
+godot_pool_byte_array GDAPI godot_variant_as_pool_byte_array(const godot_variant *p_self);
+godot_pool_int_array GDAPI godot_variant_as_pool_int_array(const godot_variant *p_self);
+godot_pool_real_array GDAPI godot_variant_as_pool_real_array(const godot_variant *p_self);
+godot_pool_string_array GDAPI godot_variant_as_pool_string_array(const godot_variant *p_self);
+godot_pool_vector2_array GDAPI godot_variant_as_pool_vector2_array(const godot_variant *p_self);
+godot_pool_vector3_array GDAPI godot_variant_as_pool_vector3_array(const godot_variant *p_self);
+godot_pool_color_array GDAPI godot_variant_as_pool_color_array(const godot_variant *p_self);
+
+godot_variant GDAPI godot_variant_call(godot_variant *p_self, const godot_string *p_method, const godot_variant **p_args, const godot_int p_argcount, godot_variant_call_error *r_error);
+
+godot_bool GDAPI godot_variant_has_method(const godot_variant *p_self, const godot_string *p_method);
+
+godot_bool GDAPI godot_variant_operator_equal(const godot_variant *p_self, const godot_variant *p_other);
+godot_bool GDAPI godot_variant_operator_less(const godot_variant *p_self, const godot_variant *p_other);
+
+godot_bool GDAPI godot_variant_hash_compare(const godot_variant *p_self, const godot_variant *p_other);
+
+godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self, godot_bool *r_valid);
+
+void GDAPI godot_variant_destroy(godot_variant *p_self);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/modules/gdnative/godot/vector2.cpp b/modules/gdnative/godot/vector2.cpp
new file mode 100644
index 0000000000..05d4b1acc8
--- /dev/null
+++ b/modules/gdnative/godot/vector2.cpp
@@ -0,0 +1,297 @@
+/*************************************************************************/
+/* vector2.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/vector2.h>
+
+#include "core/math/math_2d.h"
+#include "core/variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _vector2_api_anchor() {}
+
+void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y) {
+
+ Vector2 *dest = (Vector2 *)r_dest;
+ *dest = Vector2(p_x, p_y);
+}
+
+godot_string GDAPI godot_vector2_as_string(const godot_vector2 *p_self) {
+ godot_string ret;
+ const Vector2 *self = (const Vector2 *)p_self;
+ memnew_placement(&ret, String(*self));
+ return ret;
+}
+
+godot_vector2 GDAPI godot_vector2_normalized(const godot_vector2 *p_self) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ *((Vector2 *)&dest) = self->normalized();
+ return dest;
+}
+
+godot_real GDAPI godot_vector2_length(const godot_vector2 *p_self) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ return self->length();
+}
+
+godot_real GDAPI godot_vector2_angle(const godot_vector2 *p_self) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ return self->angle();
+}
+
+godot_real GDAPI godot_vector2_length_squared(const godot_vector2 *p_self) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ return self->length_squared();
+}
+
+godot_bool GDAPI godot_vector2_is_normalized(const godot_vector2 *p_self) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ return self->is_normalized();
+}
+
+godot_real GDAPI godot_vector2_distance_to(const godot_vector2 *p_self, const godot_vector2 *p_to) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *to = (const Vector2 *)p_to;
+ return self->distance_to(*to);
+}
+
+godot_real GDAPI godot_vector2_distance_squared_to(const godot_vector2 *p_self, const godot_vector2 *p_to) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *to = (const Vector2 *)p_to;
+ return self->distance_squared_to(*to);
+}
+
+godot_real GDAPI godot_vector2_angle_to(const godot_vector2 *p_self, const godot_vector2 *p_to) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *to = (const Vector2 *)p_to;
+ return self->angle_to(*to);
+}
+
+godot_real GDAPI godot_vector2_angle_to_point(const godot_vector2 *p_self, const godot_vector2 *p_to) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *to = (const Vector2 *)p_to;
+ return self->angle_to_point(*to);
+}
+
+godot_vector2 GDAPI godot_vector2_linear_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *b = (const Vector2 *)p_b;
+ *((Vector2 *)&dest) = self->linear_interpolate(*b, p_t);
+ return dest;
+}
+
+godot_vector2 GDAPI godot_vector2_cubic_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_vector2 *p_pre_a, const godot_vector2 *p_post_b, const godot_real p_t) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *b = (const Vector2 *)p_b;
+ const Vector2 *pre_a = (const Vector2 *)p_pre_a;
+ const Vector2 *post_b = (const Vector2 *)p_post_b;
+ *((Vector2 *)&dest) = self->cubic_interpolate(*b, *pre_a, *post_b, p_t);
+ return dest;
+}
+
+godot_vector2 GDAPI godot_vector2_rotated(const godot_vector2 *p_self, const godot_real p_phi) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+
+ *((Vector2 *)&dest) = self->rotated(p_phi);
+ return dest;
+}
+
+godot_vector2 GDAPI godot_vector2_tangent(const godot_vector2 *p_self) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ *((Vector2 *)&dest) = self->tangent();
+ return dest;
+}
+
+godot_vector2 GDAPI godot_vector2_floor(const godot_vector2 *p_self) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ *((Vector2 *)&dest) = self->floor();
+ return dest;
+}
+
+godot_vector2 GDAPI godot_vector2_snapped(const godot_vector2 *p_self, const godot_vector2 *p_by) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *by = (const Vector2 *)p_by;
+ *((Vector2 *)&dest) = self->snapped(*by);
+ return dest;
+}
+
+godot_real GDAPI godot_vector2_aspect(const godot_vector2 *p_self) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ return self->aspect();
+}
+
+godot_real GDAPI godot_vector2_dot(const godot_vector2 *p_self, const godot_vector2 *p_with) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *with = (const Vector2 *)p_with;
+ return self->dot(*with);
+}
+
+godot_vector2 GDAPI godot_vector2_slide(const godot_vector2 *p_self, const godot_vector2 *p_n) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *n = (const Vector2 *)p_n;
+ *((Vector2 *)&dest) = self->slide(*n);
+ return dest;
+}
+
+godot_vector2 GDAPI godot_vector2_bounce(const godot_vector2 *p_self, const godot_vector2 *p_n) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *n = (const Vector2 *)p_n;
+ *((Vector2 *)&dest) = self->bounce(*n);
+ return dest;
+}
+
+godot_vector2 GDAPI godot_vector2_reflect(const godot_vector2 *p_self, const godot_vector2 *p_n) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *n = (const Vector2 *)p_n;
+ *((Vector2 *)&dest) = self->reflect(*n);
+ return dest;
+}
+
+godot_vector2 GDAPI godot_vector2_abs(const godot_vector2 *p_self) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ *((Vector2 *)&dest) = self->abs();
+ return dest;
+}
+
+godot_vector2 GDAPI godot_vector2_clamped(const godot_vector2 *p_self, const godot_real p_length) {
+ godot_vector2 dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+
+ *((Vector2 *)&dest) = self->clamped(p_length);
+ return dest;
+}
+
+godot_vector2 GDAPI godot_vector2_operator_add(const godot_vector2 *p_self, const godot_vector2 *p_b) {
+ godot_vector2 raw_dest;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *b = (const Vector2 *)p_b;
+ *dest = *self + *b;
+ return raw_dest;
+}
+
+godot_vector2 GDAPI godot_vector2_operator_substract(const godot_vector2 *p_self, const godot_vector2 *p_b) {
+ godot_vector2 raw_dest;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *b = (const Vector2 *)p_b;
+ *dest = *self - *b;
+ return raw_dest;
+}
+
+godot_vector2 GDAPI godot_vector2_operator_multiply_vector(const godot_vector2 *p_self, const godot_vector2 *p_b) {
+ godot_vector2 raw_dest;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *b = (const Vector2 *)p_b;
+ *dest = *self * *b;
+ return raw_dest;
+}
+
+godot_vector2 GDAPI godot_vector2_operator_multiply_scalar(const godot_vector2 *p_self, const godot_real p_b) {
+ godot_vector2 raw_dest;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ *dest = *self * p_b;
+ return raw_dest;
+}
+
+godot_vector2 GDAPI godot_vector2_operator_divide_vector(const godot_vector2 *p_self, const godot_vector2 *p_b) {
+ godot_vector2 raw_dest;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *b = (const Vector2 *)p_b;
+ *dest = *self / *b;
+ return raw_dest;
+}
+
+godot_vector2 GDAPI godot_vector2_operator_divide_scalar(const godot_vector2 *p_self, const godot_real p_b) {
+ godot_vector2 raw_dest;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ *dest = *self / p_b;
+ return raw_dest;
+}
+
+godot_bool GDAPI godot_vector2_operator_equal(const godot_vector2 *p_self, const godot_vector2 *p_b) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *b = (const Vector2 *)p_b;
+ return *self == *b;
+}
+
+godot_bool GDAPI godot_vector2_operator_less(const godot_vector2 *p_self, const godot_vector2 *p_b) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ const Vector2 *b = (const Vector2 *)p_b;
+ return *self < *b;
+}
+
+godot_vector2 GDAPI godot_vector2_operator_neg(const godot_vector2 *p_self) {
+ godot_vector2 raw_dest;
+ Vector2 *dest = (Vector2 *)&raw_dest;
+ const Vector2 *self = (const Vector2 *)p_self;
+ *dest = -(*self);
+ return raw_dest;
+}
+
+void GDAPI godot_vector2_set_x(godot_vector2 *p_self, const godot_real p_x) {
+ Vector2 *self = (Vector2 *)p_self;
+ self->x = p_x;
+}
+
+void GDAPI godot_vector2_set_y(godot_vector2 *p_self, const godot_real p_y) {
+ Vector2 *self = (Vector2 *)p_self;
+ self->y = p_y;
+}
+
+godot_real GDAPI godot_vector2_get_x(const godot_vector2 *p_self) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ return self->x;
+}
+
+godot_real GDAPI godot_vector2_get_y(const godot_vector2 *p_self) {
+ const Vector2 *self = (const Vector2 *)p_self;
+ return self->y;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/vector2.h b/modules/gdnative/godot/vector2.h
new file mode 100644
index 0000000000..9db238b4fd
--- /dev/null
+++ b/modules/gdnative/godot/vector2.h
@@ -0,0 +1,128 @@
+/*************************************************************************/
+/* vector2.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_VECTOR2_H
+#define GODOT_VECTOR2_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_VECTOR2_SIZE 8
+
+#ifndef GODOT_CORE_API_GODOT_VECTOR2_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_VECTOR2_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_VECTOR2_SIZE];
+} godot_vector2;
+#endif
+
+#include <godot/gdnative.h>
+
+void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y);
+
+godot_string GDAPI godot_vector2_as_string(const godot_vector2 *p_self);
+
+godot_vector2 GDAPI godot_vector2_normalized(const godot_vector2 *p_self);
+
+godot_real GDAPI godot_vector2_length(const godot_vector2 *p_self);
+
+godot_real GDAPI godot_vector2_angle(const godot_vector2 *p_self);
+
+godot_real GDAPI godot_vector2_length_squared(const godot_vector2 *p_self);
+
+godot_bool GDAPI godot_vector2_is_normalized(const godot_vector2 *p_self);
+
+godot_real GDAPI godot_vector2_distance_to(const godot_vector2 *p_self, const godot_vector2 *p_to);
+
+godot_real GDAPI godot_vector2_distance_squared_to(const godot_vector2 *p_self, const godot_vector2 *p_to);
+
+godot_real GDAPI godot_vector2_angle_to(const godot_vector2 *p_self, const godot_vector2 *p_to);
+
+godot_real GDAPI godot_vector2_angle_to_point(const godot_vector2 *p_self, const godot_vector2 *p_to);
+
+godot_vector2 GDAPI godot_vector2_linear_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t);
+
+godot_vector2 GDAPI godot_vector2_cubic_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_vector2 *p_pre_a, const godot_vector2 *p_post_b, const godot_real p_t);
+
+godot_vector2 GDAPI godot_vector2_rotated(const godot_vector2 *p_self, const godot_real p_phi);
+
+godot_vector2 GDAPI godot_vector2_tangent(const godot_vector2 *p_self);
+
+godot_vector2 GDAPI godot_vector2_floor(const godot_vector2 *p_self);
+
+godot_vector2 GDAPI godot_vector2_snapped(const godot_vector2 *p_self, const godot_vector2 *p_by);
+
+godot_real GDAPI godot_vector2_aspect(const godot_vector2 *p_self);
+
+godot_real GDAPI godot_vector2_dot(const godot_vector2 *p_self, const godot_vector2 *p_with);
+
+godot_vector2 GDAPI godot_vector2_slide(const godot_vector2 *p_self, const godot_vector2 *p_n);
+
+godot_vector2 GDAPI godot_vector2_bounce(const godot_vector2 *p_self, const godot_vector2 *p_n);
+
+godot_vector2 GDAPI godot_vector2_reflect(const godot_vector2 *p_self, const godot_vector2 *p_n);
+
+godot_vector2 GDAPI godot_vector2_abs(const godot_vector2 *p_self);
+
+godot_vector2 GDAPI godot_vector2_clamped(const godot_vector2 *p_self, const godot_real p_length);
+
+godot_vector2 GDAPI godot_vector2_operator_add(const godot_vector2 *p_self, const godot_vector2 *p_b);
+
+godot_vector2 GDAPI godot_vector2_operator_substract(const godot_vector2 *p_self, const godot_vector2 *p_b);
+
+godot_vector2 GDAPI godot_vector2_operator_multiply_vector(const godot_vector2 *p_self, const godot_vector2 *p_b);
+
+godot_vector2 GDAPI godot_vector2_operator_multiply_scalar(const godot_vector2 *p_self, const godot_real p_b);
+
+godot_vector2 GDAPI godot_vector2_operator_divide_vector(const godot_vector2 *p_self, const godot_vector2 *p_b);
+
+godot_vector2 GDAPI godot_vector2_operator_divide_scalar(const godot_vector2 *p_self, const godot_real p_b);
+
+godot_bool GDAPI godot_vector2_operator_equal(const godot_vector2 *p_self, const godot_vector2 *p_b);
+
+godot_bool GDAPI godot_vector2_operator_less(const godot_vector2 *p_self, const godot_vector2 *p_b);
+
+godot_vector2 GDAPI godot_vector2_operator_neg(const godot_vector2 *p_self);
+
+void GDAPI godot_vector2_set_x(godot_vector2 *p_self, const godot_real p_x);
+
+void GDAPI godot_vector2_set_y(godot_vector2 *p_self, const godot_real p_y);
+
+godot_real GDAPI godot_vector2_get_x(const godot_vector2 *p_self);
+
+godot_real GDAPI godot_vector2_get_y(const godot_vector2 *p_self);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_VECTOR2_H
diff --git a/modules/gdnative/godot/vector3.cpp b/modules/gdnative/godot/vector3.cpp
new file mode 100644
index 0000000000..fe27e740e2
--- /dev/null
+++ b/modules/gdnative/godot/vector3.cpp
@@ -0,0 +1,304 @@
+/*************************************************************************/
+/* vector3.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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/vector3.h>
+
+#include "core/variant.h"
+#include "core/vector.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _vector3_api_anchor() {}
+
+void GDAPI godot_vector3_new(godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z) {
+
+ Vector3 *dest = (Vector3 *)r_dest;
+ *dest = Vector3(p_x, p_y, p_z);
+}
+
+godot_string GDAPI godot_vector3_as_string(const godot_vector3 *p_self) {
+ godot_string ret;
+ const Vector3 *self = (const Vector3 *)p_self;
+ memnew_placement(&ret, String(*self));
+ return ret;
+}
+
+godot_int GDAPI godot_vector3_min_axis(const godot_vector3 *p_self) {
+ const Vector3 *self = (const Vector3 *)p_self;
+ return self->min_axis();
+}
+
+godot_int GDAPI godot_vector3_max_axis(const godot_vector3 *p_self) {
+ const Vector3 *self = (const Vector3 *)p_self;
+ return self->max_axis();
+}
+
+godot_real GDAPI godot_vector3_length(const godot_vector3 *p_self) {
+ const Vector3 *self = (const Vector3 *)p_self;
+ return self->length();
+}
+
+godot_real GDAPI godot_vector3_length_squared(const godot_vector3 *p_self) {
+ const Vector3 *self = (const Vector3 *)p_self;
+ return self->length_squared();
+}
+
+godot_bool GDAPI godot_vector3_is_normalized(const godot_vector3 *p_self) {
+ const Vector3 *self = (const Vector3 *)p_self;
+ return self->is_normalized();
+}
+
+godot_vector3 GDAPI godot_vector3_normalized(const godot_vector3 *p_self) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ *((Vector3 *)&dest) = self->normalized();
+ return dest;
+}
+
+godot_vector3 GDAPI godot_vector3_inverse(const godot_vector3 *p_self) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ *((Vector3 *)&dest) = self->inverse();
+ return dest;
+}
+
+godot_vector3 GDAPI godot_vector3_snapped(const godot_vector3 *p_self, const godot_vector3 *p_by) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *snap_axis = (const Vector3 *)p_by;
+
+ *((Vector3 *)&dest) = self->snapped(*snap_axis);
+ return dest;
+}
+
+godot_vector3 GDAPI godot_vector3_rotated(const godot_vector3 *p_self, const godot_vector3 *p_axis, const godot_real p_phi) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *axis = (const Vector3 *)p_axis;
+ *((Vector3 *)&dest) = self->rotated(*axis, p_phi);
+ return dest;
+}
+
+godot_vector3 GDAPI godot_vector3_linear_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ *((Vector3 *)&dest) = self->linear_interpolate(*b, p_t);
+ return dest;
+}
+
+godot_vector3 GDAPI godot_vector3_cubic_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_vector3 *p_pre_a, const godot_vector3 *p_post_b, const godot_real p_t) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ const Vector3 *pre_a = (const Vector3 *)p_pre_a;
+ const Vector3 *post_b = (const Vector3 *)p_post_b;
+ *((Vector3 *)&dest) = self->cubic_interpolate(*b, *pre_a, *post_b, p_t);
+ return dest;
+}
+
+godot_real GDAPI godot_vector3_dot(const godot_vector3 *p_self, const godot_vector3 *p_b) {
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ return self->dot(*b);
+}
+
+godot_vector3 GDAPI godot_vector3_cross(const godot_vector3 *p_self, const godot_vector3 *p_b) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ *((Vector3 *)&dest) = self->cross(*b);
+ return dest;
+}
+
+godot_basis GDAPI godot_vector3_outer(const godot_vector3 *p_self, const godot_vector3 *p_b) {
+ godot_basis dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ *((Basis *)&dest) = self->outer(*b);
+ return dest;
+}
+
+godot_basis GDAPI godot_vector3_to_diagonal_matrix(const godot_vector3 *p_self) {
+ godot_basis dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ *((Basis *)&dest) = self->to_diagonal_matrix();
+ return dest;
+}
+
+godot_vector3 GDAPI godot_vector3_abs(const godot_vector3 *p_self) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ *((Vector3 *)&dest) = self->abs();
+ return dest;
+}
+
+godot_vector3 GDAPI godot_vector3_floor(const godot_vector3 *p_self) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ *((Vector3 *)&dest) = self->floor();
+ return dest;
+}
+
+godot_vector3 GDAPI godot_vector3_ceil(const godot_vector3 *p_self) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ *((Vector3 *)&dest) = self->ceil();
+ return dest;
+}
+
+godot_real GDAPI godot_vector3_distance_to(const godot_vector3 *p_self, const godot_vector3 *p_b) {
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ return self->distance_to(*b);
+}
+
+godot_real GDAPI godot_vector3_distance_squared_to(const godot_vector3 *p_self, const godot_vector3 *p_b) {
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ return self->distance_squared_to(*b);
+}
+
+godot_real GDAPI godot_vector3_angle_to(const godot_vector3 *p_self, const godot_vector3 *p_to) {
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *to = (const Vector3 *)p_to;
+ return self->angle_to(*to);
+}
+
+godot_vector3 GDAPI godot_vector3_slide(const godot_vector3 *p_self, const godot_vector3 *p_n) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *n = (const Vector3 *)p_n;
+ *((Vector3 *)&dest) = self->slide(*n);
+ return dest;
+}
+
+godot_vector3 GDAPI godot_vector3_bounce(const godot_vector3 *p_self, const godot_vector3 *p_n) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *n = (const Vector3 *)p_n;
+ *((Vector3 *)&dest) = self->bounce(*n);
+ return dest;
+}
+
+godot_vector3 GDAPI godot_vector3_reflect(const godot_vector3 *p_self, const godot_vector3 *p_n) {
+ godot_vector3 dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ const Vector3 *n = (const Vector3 *)p_n;
+ *((Vector3 *)&dest) = self->reflect(*n);
+ return dest;
+}
+
+godot_vector3 GDAPI godot_vector3_operator_add(const godot_vector3 *p_self, const godot_vector3 *p_b) {
+ godot_vector3 raw_dest;
+ Vector3 *dest = (Vector3 *)&raw_dest;
+ Vector3 *self = (Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ *dest = *self + *b;
+ return raw_dest;
+}
+
+godot_vector3 GDAPI godot_vector3_operator_substract(const godot_vector3 *p_self, const godot_vector3 *p_b) {
+ godot_vector3 raw_dest;
+ Vector3 *dest = (Vector3 *)&raw_dest;
+ Vector3 *self = (Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ *dest = *self - *b;
+ return raw_dest;
+}
+
+godot_vector3 GDAPI godot_vector3_operator_multiply_vector(const godot_vector3 *p_self, const godot_vector3 *p_b) {
+ godot_vector3 raw_dest;
+ Vector3 *dest = (Vector3 *)&raw_dest;
+ Vector3 *self = (Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ *dest = *self * *b;
+ return raw_dest;
+}
+
+godot_vector3 GDAPI godot_vector3_operator_multiply_scalar(const godot_vector3 *p_self, const godot_real p_b) {
+ godot_vector3 raw_dest;
+ Vector3 *dest = (Vector3 *)&raw_dest;
+ Vector3 *self = (Vector3 *)p_self;
+ *dest = *self * p_b;
+ return raw_dest;
+}
+
+godot_vector3 GDAPI godot_vector3_operator_divide_vector(const godot_vector3 *p_self, const godot_vector3 *p_b) {
+ godot_vector3 raw_dest;
+ Vector3 *dest = (Vector3 *)&raw_dest;
+ Vector3 *self = (Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ *dest = *self / *b;
+ return raw_dest;
+}
+
+godot_vector3 GDAPI godot_vector3_operator_divide_scalar(const godot_vector3 *p_self, const godot_real p_b) {
+ godot_vector3 raw_dest;
+ Vector3 *dest = (Vector3 *)&raw_dest;
+ Vector3 *self = (Vector3 *)p_self;
+ *dest = *self / p_b;
+ return raw_dest;
+}
+
+godot_bool GDAPI godot_vector3_operator_equal(const godot_vector3 *p_self, const godot_vector3 *p_b) {
+ Vector3 *self = (Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ return *self == *b;
+}
+
+godot_bool GDAPI godot_vector3_operator_less(const godot_vector3 *p_self, const godot_vector3 *p_b) {
+ Vector3 *self = (Vector3 *)p_self;
+ const Vector3 *b = (const Vector3 *)p_b;
+ return *self < *b;
+}
+
+godot_vector3 GDAPI godot_vector3_operator_neg(const godot_vector3 *p_self) {
+ godot_vector3 raw_dest;
+ Vector3 *dest = (Vector3 *)&raw_dest;
+ const Vector3 *self = (const Vector3 *)p_self;
+ *dest = -(*self);
+ return raw_dest;
+}
+
+void GDAPI godot_vector3_set_axis(godot_vector3 *p_self, const godot_vector3_axis p_axis, const godot_real p_val) {
+ Vector3 *self = (Vector3 *)p_self;
+ self->set_axis(p_axis, p_val);
+}
+
+godot_real GDAPI godot_vector3_get_axis(const godot_vector3 *p_self, const godot_vector3_axis p_axis) {
+ const Vector3 *self = (const Vector3 *)p_self;
+ return self->get_axis(p_axis);
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/vector3.h b/modules/gdnative/godot/vector3.h
new file mode 100644
index 0000000000..8aba1d9a85
--- /dev/null
+++ b/modules/gdnative/godot/vector3.h
@@ -0,0 +1,135 @@
+/*************************************************************************/
+/* vector3.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_VECTOR3_H
+#define GODOT_VECTOR3_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define GODOT_VECTOR3_SIZE 12
+
+#ifndef GODOT_CORE_API_GODOT_VECTOR3_TYPE_DEFINED
+#define GODOT_CORE_API_GODOT_VECTOR3_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_VECTOR3_SIZE];
+} godot_vector3;
+#endif
+
+#include <godot/basis.h>
+#include <godot/gdnative.h>
+
+typedef enum {
+ GODOT_VECTOR3_AXIS_X,
+ GODOT_VECTOR3_AXIS_Y,
+ GODOT_VECTOR3_AXIS_Z,
+} godot_vector3_axis;
+
+void GDAPI godot_vector3_new(godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z);
+
+godot_string GDAPI godot_vector3_as_string(const godot_vector3 *p_self);
+
+godot_int GDAPI godot_vector3_min_axis(const godot_vector3 *p_self);
+
+godot_int GDAPI godot_vector3_max_axis(const godot_vector3 *p_self);
+
+godot_real GDAPI godot_vector3_length(const godot_vector3 *p_self);
+
+godot_real GDAPI godot_vector3_length_squared(const godot_vector3 *p_self);
+
+godot_bool GDAPI godot_vector3_is_normalized(const godot_vector3 *p_self);
+
+godot_vector3 GDAPI godot_vector3_normalized(const godot_vector3 *p_self);
+
+godot_vector3 GDAPI godot_vector3_inverse(const godot_vector3 *p_self);
+
+godot_vector3 GDAPI godot_vector3_snapped(const godot_vector3 *p_self, const godot_vector3 *p_by);
+
+godot_vector3 GDAPI godot_vector3_rotated(const godot_vector3 *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
+
+godot_vector3 GDAPI godot_vector3_linear_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t);
+
+godot_vector3 GDAPI godot_vector3_cubic_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_vector3 *p_pre_a, const godot_vector3 *p_post_b, const godot_real p_t);
+
+godot_real GDAPI godot_vector3_dot(const godot_vector3 *p_self, const godot_vector3 *p_b);
+
+godot_vector3 GDAPI godot_vector3_cross(const godot_vector3 *p_self, const godot_vector3 *p_b);
+
+godot_basis GDAPI godot_vector3_outer(const godot_vector3 *p_self, const godot_vector3 *p_b);
+
+godot_basis GDAPI godot_vector3_to_diagonal_matrix(const godot_vector3 *p_self);
+
+godot_vector3 GDAPI godot_vector3_abs(const godot_vector3 *p_self);
+
+godot_vector3 GDAPI godot_vector3_floor(const godot_vector3 *p_self);
+
+godot_vector3 GDAPI godot_vector3_ceil(const godot_vector3 *p_self);
+
+godot_real GDAPI godot_vector3_distance_to(const godot_vector3 *p_self, const godot_vector3 *p_b);
+
+godot_real GDAPI godot_vector3_distance_squared_to(const godot_vector3 *p_self, const godot_vector3 *p_b);
+
+godot_real GDAPI godot_vector3_angle_to(const godot_vector3 *p_self, const godot_vector3 *p_to);
+
+godot_vector3 GDAPI godot_vector3_slide(const godot_vector3 *p_self, const godot_vector3 *p_n);
+
+godot_vector3 GDAPI godot_vector3_bounce(const godot_vector3 *p_self, const godot_vector3 *p_n);
+
+godot_vector3 GDAPI godot_vector3_reflect(const godot_vector3 *p_self, const godot_vector3 *p_n);
+
+godot_vector3 GDAPI godot_vector3_operator_add(const godot_vector3 *p_self, const godot_vector3 *p_b);
+
+godot_vector3 GDAPI godot_vector3_operator_substract(const godot_vector3 *p_self, const godot_vector3 *p_b);
+
+godot_vector3 GDAPI godot_vector3_operator_multiply_vector(const godot_vector3 *p_self, const godot_vector3 *p_b);
+
+godot_vector3 GDAPI godot_vector3_operator_multiply_scalar(const godot_vector3 *p_self, const godot_real p_b);
+
+godot_vector3 GDAPI godot_vector3_operator_divide_vector(const godot_vector3 *p_self, const godot_vector3 *p_b);
+
+godot_vector3 GDAPI godot_vector3_operator_divide_scalar(const godot_vector3 *p_self, const godot_real p_b);
+
+godot_bool GDAPI godot_vector3_operator_equal(const godot_vector3 *p_self, const godot_vector3 *p_b);
+
+godot_bool GDAPI godot_vector3_operator_less(const godot_vector3 *p_self, const godot_vector3 *p_b);
+
+godot_vector3 GDAPI godot_vector3_operator_neg(const godot_vector3 *p_self);
+
+void GDAPI godot_vector3_set_axis(godot_vector3 *p_self, const godot_vector3_axis p_axis, const godot_real p_val);
+
+godot_real GDAPI godot_vector3_get_axis(const godot_vector3 *p_self, const godot_vector3_axis p_axis);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_VECTOR3_H
diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp
new file mode 100644
index 0000000000..da50104e26
--- /dev/null
+++ b/modules/gdnative/register_types.cpp
@@ -0,0 +1,101 @@
+/*************************************************************************/
+/* register_types.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "register_types.h"
+#include "gdnative.h"
+
+#include "io/resource_loader.h"
+#include "io/resource_saver.h"
+
+#include "core/os/os.h"
+
+godot_variant cb_standard_varcall(void *handle, godot_string *p_procedure, godot_array *p_args) {
+ if (handle == NULL) {
+ ERR_PRINT("No valid library handle, can't call standard varcall procedure");
+ godot_variant ret;
+ godot_variant_new_nil(&ret);
+ return ret;
+ }
+
+ void *library_proc;
+ Error err = OS::get_singleton()->get_dynamic_library_symbol_handle(
+ handle,
+ *(String *)p_procedure,
+ library_proc,
+ true); // we roll our own message
+ if (err != OK) {
+ ERR_PRINT((String("GDNative procedure \"" + *(String *)p_procedure) + "\" does not exists and can't be called").utf8().get_data());
+ godot_variant ret;
+ godot_variant_new_nil(&ret);
+ return ret;
+ }
+
+ godot_gdnative_procedure_fn proc;
+ proc = (godot_gdnative_procedure_fn)library_proc;
+
+ return proc(NULL, p_args);
+}
+
+GDNativeCallRegistry *GDNativeCallRegistry::singleton;
+
+void register_gdnative_types() {
+
+ ClassDB::register_class<GDNativeLibrary>();
+ ClassDB::register_class<GDNative>();
+
+ GDNativeCallRegistry::singleton = memnew(GDNativeCallRegistry);
+
+ GDNativeCallRegistry::singleton->register_native_call_type("standard_varcall", cb_standard_varcall);
+}
+
+void unregister_gdnative_types() {
+ memdelete(GDNativeCallRegistry::singleton);
+
+ // This is for printing out the sizes of the core types
+
+ /*
+ print_line(String("array:\t") + itos(sizeof(Array)));
+ print_line(String("basis:\t") + itos(sizeof(Basis)));
+ print_line(String("color:\t") + itos(sizeof(Color)));
+ print_line(String("dict:\t" ) + itos(sizeof(Dictionary)));
+ print_line(String("node_path:\t") + itos(sizeof(NodePath)));
+ print_line(String("plane:\t") + itos(sizeof(Plane)));
+ print_line(String("poolarray:\t") + itos(sizeof(PoolByteArray)));
+ print_line(String("quat:\t") + itos(sizeof(Quat)));
+ print_line(String("rect2:\t") + itos(sizeof(Rect2)));
+ print_line(String("rect3:\t") + itos(sizeof(Rect3)));
+ print_line(String("rid:\t") + itos(sizeof(RID)));
+ print_line(String("string:\t") + itos(sizeof(String)));
+ print_line(String("transform:\t") + itos(sizeof(Transform)));
+ print_line(String("transfo2D:\t") + itos(sizeof(Transform2D)));
+ print_line(String("variant:\t") + itos(sizeof(Variant)));
+ print_line(String("vector2:\t") + itos(sizeof(Vector2)));
+ print_line(String("vector3:\t") + itos(sizeof(Vector3)));
+ */
+}
diff --git a/modules/gdnative/register_types.h b/modules/gdnative/register_types.h
new file mode 100644
index 0000000000..48e778cb2c
--- /dev/null
+++ b/modules/gdnative/register_types.h
@@ -0,0 +1,31 @@
+/*************************************************************************/
+/* register_types.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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. */
+/*************************************************************************/
+void register_gdnative_types();
+void unregister_gdnative_types();
diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp
index 245f44887c..d4ede4cb17 100644
--- a/modules/gdscript/gd_compiler.cpp
+++ b/modules/gdscript/gd_compiler.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -1013,7 +1014,7 @@ int GDCompiler::_parse_expression(CodeGen &codegen, const GDParser::Node *p_expr
}
} break;
- case GDParser::OperatorNode::OP_EXTENDS: {
+ case GDParser::OperatorNode::OP_IS: {
ERR_FAIL_COND_V(on->arguments.size() != 2, false);
diff --git a/modules/gdscript/gd_compiler.h b/modules/gdscript/gd_compiler.h
index c84bd97246..b7ff092eba 100644
--- a/modules/gdscript/gd_compiler.h
+++ b/modules/gdscript/gd_compiler.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index 1499f167c4..f8b45af85a 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,10 +27,15 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+#include "editor/editor_settings.h"
#include "gd_compiler.h"
#include "gd_script.h"
-#include "global_config.h"
#include "os/file_access.h"
+#include "project_settings.h"
+#ifdef TOOLS_ENABLED
+#include "editor/editor_file_system.h"
+#include "editor/editor_settings.h"
+#endif
void GDScriptLanguage::get_comment_delimiters(List<String> *p_delimiters) const {
@@ -49,11 +55,12 @@ Ref<Script> GDScriptLanguage::get_template(const String &p_class_name, const Str
"# var a = 2\n" +
"# var b = \"textvar\"\n\n" +
"func _ready():\n" +
- "\t# Called every time the node is added to the scene.\n" +
- "\t# Initialization here\n" +
- "\tpass\n";
+ "%TS%# Called every time the node is added to the scene.\n" +
+ "%TS%# Initialization here\n" +
+ "%TS%pass\n";
_template = _template.replace("%BASE%", p_base_class_name);
+ _template = _template.replace("%TS%", _get_indentation());
Ref<GDScript> script;
script.instance();
@@ -62,6 +69,19 @@ Ref<Script> GDScriptLanguage::get_template(const String &p_class_name, const Str
return script;
}
+bool GDScriptLanguage::is_using_templates() {
+
+ return true;
+}
+
+void GDScriptLanguage::make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script) {
+
+ String src = p_script->get_source_code();
+ src = src.replace("%BASE%", p_base_class_name);
+ src = src.replace("%TS%", _get_indentation());
+ p_script->set_source_code(src);
+}
+
bool GDScriptLanguage::validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List<String> *r_functions) const {
GDParser parser;
@@ -137,7 +157,7 @@ Script *GDScriptLanguage::create_script() const {
bool GDScriptLanguage::debug_break_parse(const String &p_file, int p_line, const String &p_error) {
//break because of parse error
- if (ScriptDebugger::get_singleton() && Thread::get_caller_ID() == Thread::get_main_ID()) {
+ if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) {
_debug_parse_err_line = p_line;
_debug_parse_err_file = p_file;
@@ -151,7 +171,7 @@ bool GDScriptLanguage::debug_break_parse(const String &p_file, int p_line, const
bool GDScriptLanguage::debug_break(const String &p_error, bool p_allow_continue) {
- if (ScriptDebugger::get_singleton() && Thread::get_caller_ID() == Thread::get_main_ID()) {
+ if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) {
_debug_parse_err_line = -1;
_debug_parse_err_file = "";
@@ -618,7 +638,7 @@ static bool _guess_expression_type(GDCompletionContext &context, const GDParser:
String which = arg1.get_slice("/", 2);
if (which != "") {
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
//print_line("find singleton");
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -630,7 +650,7 @@ static bool _guess_expression_type(GDCompletionContext &context, const GDParser:
String name = s.get_slice("/", 1);
//print_line("name: "+name+", which: "+which);
if (name == which) {
- String script = GlobalConfig::get_singleton()->get(s);
+ String script = ProjectSettings::get_singleton()->get(s);
if (!script.begins_with("res://")) {
script = "res://" + script;
@@ -1085,7 +1105,7 @@ static bool _guess_identifier_type(GDCompletionContext &context, int p_line, con
//autoloads as singletons
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -1095,7 +1115,7 @@ static bool _guess_identifier_type(GDCompletionContext &context, int p_line, con
String name = s.get_slice("/", 1);
if (name == String(p_identifier)) {
- String path = GlobalConfig::get_singleton()->get(s);
+ String path = ProjectSettings::get_singleton()->get(s);
if (path.begins_with("*")) {
String script = path.substr(1, path.length());
@@ -1256,7 +1276,7 @@ static void _find_identifiers_in_class(GDCompletionContext &context, bool p_stat
}
}
List<MethodInfo> methods;
- ClassDB::get_method_list(type, &methods);
+ ClassDB::get_method_list(type, &methods, false, true);
for (List<MethodInfo>::Element *E = methods.front(); E; E = E->next()) {
if (E->get().name.begins_with("_"))
continue;
@@ -1314,8 +1334,8 @@ static void _find_identifiers(GDCompletionContext &context, int p_line, bool p_o
static const char *_type_names[Variant::VARIANT_MAX] = {
"null", "bool", "int", "float", "String", "Vector2", "Rect2", "Vector3", "Transform2D", "Plane", "Quat", "AABB", "Basis", "Transform",
- "Color", "Image", "NodePath", "RID", "Object", "InputEvent", "Dictionary", "Array", "RawArray", "IntArray", "FloatArray", "StringArray",
- "Vector2Array", "Vector3Array", "ColorArray"
+ "Color", "NodePath", "RID", "Object", "Dictionary", "Array", "PoolByteArray", "PoolIntArray", "PoolRealArray", "PoolStringArray",
+ "PoolVector2Array", "PoolVector3Array", "PoolColorArray"
};
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
@@ -1324,7 +1344,7 @@ static void _find_identifiers(GDCompletionContext &context, int p_line, bool p_o
//autoload singletons
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -1332,7 +1352,7 @@ static void _find_identifiers(GDCompletionContext &context, int p_line, bool p_o
if (!s.begins_with("autoload/"))
continue;
String name = s.get_slice("/", 1);
- String path = GlobalConfig::get_singleton()->get(s);
+ String path = ProjectSettings::get_singleton()->get(s);
if (path.begins_with("*")) {
result.insert(name);
}
@@ -1404,25 +1424,21 @@ static void _make_function_hint(const GDParser::FunctionNode *p_func, int p_argi
arghint += ")";
}
-static void _find_type_arguments(GDCompletionContext &context, const GDParser::Node *p_node, int p_line, const StringName &p_method, const GDCompletionIdentifier &id, int p_argidx, Set<String> &result, String &arghint) {
-
- //print_line("find type arguments?");
- if (id.type == Variant::INPUT_EVENT && String(p_method) == "is_action" && p_argidx == 0) {
-
- List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+void get_directory_contents(EditorFileSystemDirectory *p_dir, Set<String> &r_list) {
- for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
- const PropertyInfo &pi = E->get();
+ for (int i = 0; i < p_dir->get_subdir_count(); i++) {
+ get_directory_contents(p_dir->get_subdir(i), r_list);
+ }
- if (!pi.name.begins_with("input/"))
- continue;
+ for (int i = 0; i < p_dir->get_file_count(); i++) {
+ r_list.insert("\"" + p_dir->get_file_path(i) + "\"");
+ }
+}
- String name = pi.name.substr(pi.name.find("/") + 1, pi.name.length());
- result.insert("\"" + name + "\"");
- }
+static void _find_type_arguments(GDCompletionContext &context, const GDParser::Node *p_node, int p_line, const StringName &p_method, const GDCompletionIdentifier &id, int p_argidx, Set<String> &result, String &arghint) {
- } else if (id.type == Variant::OBJECT && id.obj_type != StringName()) {
+ //print_line("find type arguments?");
+ if (id.type == Variant::OBJECT && id.obj_type != StringName()) {
MethodBind *m = ClassDB::get_method(id.obj_type, p_method);
if (!m) {
@@ -1627,7 +1643,7 @@ static void _find_type_arguments(GDCompletionContext &context, const GDParser::N
} else {
//regular method
- if (p_method.operator String() == "connect") {
+ if (p_method.operator String() == "connect" || (p_method.operator String() == "emit_signal" && p_argidx == 0)) {
if (p_argidx == 0) {
List<MethodInfo> sigs;
@@ -1669,7 +1685,7 @@ static void _find_type_arguments(GDCompletionContext &context, const GDParser::N
if (p_argidx == 0 && (String(p_method) == "get_node" || String(p_method) == "has_node") && ClassDB::is_parent_class(id.obj_type, "Node")) {
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -1752,6 +1768,10 @@ static void _find_call_arguments(GDCompletionContext &context, const GDParser::N
const GDParser::BuiltInFunctionNode *fn = static_cast<const GDParser::BuiltInFunctionNode *>(op->arguments[0]);
MethodInfo mi = GDFunctions::get_info(fn->function);
+ if (mi.name == "load" && bool(EditorSettings::get_singleton()->get("text_editor/completion/complete_file_paths"))) {
+ get_directory_contents(EditorFileSystem::get_singleton()->get_filesystem(), result);
+ }
+
arghint = _get_visual_datatype(mi.return_val, false) + " " + GDFunctions::get_func_name(fn->function) + String("(");
for (int i = 0; i < mi.arguments.size(); i++) {
if (i > 0)
@@ -2231,7 +2251,7 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base
}
List<MethodInfo> mi;
- ClassDB::get_method_list(t.obj_type, &mi);
+ ClassDB::get_method_list(t.obj_type, &mi, false, true);
for (List<MethodInfo>::Element *E = mi.front(); E; E = E->next()) {
if (E->get().name.begins_with("_"))
@@ -2244,54 +2264,8 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base
}
} else {
- if (t.type == Variant::INPUT_EVENT) {
-
- //this is hardcoded otherwise it's not obvious
- Set<String> exclude;
-
- for (int i = 0; i < InputEvent::TYPE_MAX; i++) {
-
- InputEvent ie;
- ie.type = InputEvent::Type(i);
- static const char *evnames[] = {
- "# Common",
- "# Key",
- "# MouseMotion",
- "# MouseButton",
- "# JoypadMotion",
- "# JoypadButton",
- "# ScreenTouch",
- "# ScreenDrag",
- "# Action"
- };
-
- r_options->push_back(evnames[i]);
-
- Variant v = ie;
-
- if (i == 0) {
- List<MethodInfo> mi;
- v.get_method_list(&mi);
- for (List<MethodInfo>::Element *E = mi.front(); E; E = E->next()) {
- r_options->push_back(E->get().name + "(");
- }
- }
-
- List<PropertyInfo> pi;
- v.get_property_list(&pi);
-
- for (List<PropertyInfo>::Element *E = pi.front(); E; E = E->next()) {
-
- if (i == 0)
- exclude.insert(E->get().name);
- else if (exclude.has(E->get().name))
- continue;
-
- r_options->push_back(E->get().name);
- }
- }
- return OK;
- } else {
+ //check InputEvent hint
+ {
if (t.value.get_type() == Variant::NIL) {
Variant::CallError ce;
t.value = Variant::construct(t.type, NULL, 0, ce);
@@ -2373,6 +2347,11 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base
}
} break;
+ case GDParser::COMPLETION_RESOURCE_PATH: {
+
+ if (EditorSettings::get_singleton()->get("text_editor/completion/complete_file_paths"))
+ get_directory_contents(EditorFileSystem::get_singleton()->get_filesystem(), options);
+ } break;
}
for (Set<String>::Element *E = options.front(); E; E = E->next()) {
@@ -2390,8 +2369,29 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base
#endif
+String GDScriptLanguage::_get_indentation() const {
+#ifdef TOOLS_ENABLED
+ if (SceneTree::get_singleton()->is_editor_hint()) {
+ bool use_space_indentation = EDITOR_DEF("text_editor/indent/type", 0);
+
+ if (use_space_indentation) {
+ int indent_size = EDITOR_DEF("text_editor/indent/size", 4);
+
+ String space_indent = "";
+ for (int i = 0; i < indent_size; i++) {
+ space_indent += " ";
+ }
+ return space_indent;
+ }
+ }
+#endif
+ return "\t";
+}
+
void GDScriptLanguage::auto_indent_code(String &p_code, int p_from_line, int p_to_line) const {
+ String indent = _get_indentation();
+
Vector<String> lines = p_code.split("\n");
List<int> indent_stack;
@@ -2431,8 +2431,9 @@ void GDScriptLanguage::auto_indent_code(String &p_code, int p_from_line, int p_t
if (i >= p_from_line) {
l = "";
- for (int j = 0; j < indent_stack.size(); j++)
- l += "\t";
+ for (int j = 0; j < indent_stack.size(); j++) {
+ l += indent;
+ }
l += st;
} else if (i > p_to_line) {
@@ -2659,7 +2660,7 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
//guess in autoloads as singletons
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -2669,7 +2670,7 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
String name = s.get_slice("/", 1);
if (name == String(p_symbol)) {
- String path = GlobalConfig::get_singleton()->get(s);
+ String path = ProjectSettings::get_singleton()->get(s);
if (path.begins_with("*")) {
String script = path.substr(1, path.length());
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index 0e7ba981f4..13a7480a36 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -357,12 +358,12 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
if (a->get_type() != Variant::OBJECT || a->operator Object *() == NULL) {
- err_text = "Left operand of 'extends' is not an instance of anything.";
+ err_text = "Left operand of 'is' is not an instance of anything.";
break;
}
if (b->get_type() != Variant::OBJECT || b->operator Object *() == NULL) {
- err_text = "Right operand of 'extends' is not a class.";
+ err_text = "Right operand of 'is' is not a class.";
break;
}
#endif
@@ -400,7 +401,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
if (!nc) {
- err_text = "Right operand of 'extends' is not a class (type: '" + obj_B->get_class() + "').";
+ err_text = "Right operand of 'is' is not a class (type: '" + obj_B->get_class() + "').";
break;
}
@@ -887,8 +888,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
gdfs->state._class = _class;
gdfs->state.ip = ip + ipofs;
gdfs->state.line = line;
- gdfs->state.instance_id = (p_instance && p_instance->get_owner()) ? p_instance->get_owner()->get_instance_ID() : 0;
- gdfs->state.script_id = _class->get_instance_ID();
+ gdfs->state.instance_id = (p_instance && p_instance->get_owner()) ? p_instance->get_owner()->get_instance_id() : 0;
+ gdfs->state.script_id = _class->get_instance_id();
//gdfs->state.result_pos=ip+ipofs-1;
gdfs->state.defarg = defarg;
gdfs->state.instance = p_instance;
@@ -1232,10 +1233,10 @@ int GDFunction::get_default_argument_count() const {
return default_arguments.size();
}
-int GDFunction::get_default_argument_addr(int p_arg) const {
+int GDFunction::get_default_argument_addr(int p_idx) const {
- ERR_FAIL_INDEX_V(p_arg, default_arguments.size(), -1);
- return default_arguments[p_arg];
+ ERR_FAIL_INDEX_V(p_idx, default_arguments.size(), -1);
+ return default_arguments[p_idx];
}
StringName GDFunction::get_name() const {
@@ -1427,14 +1428,42 @@ Variant GDFunctionState::_signal_callback(const Variant **p_args, int p_argcount
state.result = arg;
Variant ret = function->call(NULL, NULL, 0, r_error, &state);
+
+ bool completed = true;
+
+ // If the return value is a GDFunctionState reference,
+ // then the function did yield again after resuming.
+ if (ret.is_ref()) {
+ GDFunctionState *gdfs = ret.operator Object *()->cast_to<GDFunctionState>();
+ if (gdfs && gdfs->function == function)
+ completed = false;
+ }
+
function = NULL; //cleaned up;
state.result = Variant();
+
+ if (completed) {
+ emit_signal("completed", ret);
+ }
+
return ret;
}
-bool GDFunctionState::is_valid() const {
+bool GDFunctionState::is_valid(bool p_extended_check) const {
+
+ if (function == NULL)
+ return false;
+
+ if (p_extended_check) {
+ //class instance gone?
+ if (state.instance_id && !ObjectDB::get_instance(state.instance_id))
+ return false;
+ //script gone?
+ if (state.script_id && !ObjectDB::get_instance(state.script_id))
+ return false;
+ }
- return function != NULL;
+ return true;
}
Variant GDFunctionState::resume(const Variant &p_arg) {
@@ -1455,16 +1484,34 @@ Variant GDFunctionState::resume(const Variant &p_arg) {
state.result = p_arg;
Variant::CallError err;
Variant ret = function->call(NULL, NULL, 0, err, &state);
+
+ bool completed = true;
+
+ // If the return value is a GDFunctionState reference,
+ // then the function did yield again after resuming.
+ if (ret.is_ref()) {
+ GDFunctionState *gdfs = ret.operator Object *()->cast_to<GDFunctionState>();
+ if (gdfs && gdfs->function == function)
+ completed = false;
+ }
+
function = NULL; //cleaned up;
state.result = Variant();
+
+ if (completed) {
+ emit_signal("completed", ret);
+ }
+
return ret;
}
void GDFunctionState::_bind_methods() {
- ClassDB::bind_method(D_METHOD("resume:Variant", "arg"), &GDFunctionState::resume, DEFVAL(Variant()));
- ClassDB::bind_method(D_METHOD("is_valid"), &GDFunctionState::is_valid);
+ ClassDB::bind_method(D_METHOD("resume", "arg"), &GDFunctionState::resume, DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("is_valid", "extended_check"), &GDFunctionState::is_valid, DEFVAL(false));
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "_signal_callback", &GDFunctionState::_signal_callback, MethodInfo("_signal_callback"));
+
+ ADD_SIGNAL(MethodInfo("completed", PropertyInfo(Variant::NIL, "result")));
}
GDFunctionState::GDFunctionState() {
diff --git a/modules/gdscript/gd_function.h b/modules/gdscript/gd_function.h
index 321b3b6cfa..6d20b19777 100644
--- a/modules/gdscript/gd_function.h
+++ b/modules/gdscript/gd_function.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -236,7 +237,7 @@ protected:
static void _bind_methods();
public:
- bool is_valid() const;
+ bool is_valid(bool p_extended_check = false) const;
Variant resume(const Variant &p_arg = Variant());
GDFunctionState();
~GDFunctionState();
diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp
index fa92f0a194..209bdadd67 100644
--- a/modules/gdscript/gd_functions.cpp
+++ b/modules/gdscript/gd_functions.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -112,6 +113,7 @@ const char *GDFunctions::get_func_name(Function p_func) {
"ColorN",
"print_stack",
"instance_from_id",
+ "len",
};
return _names[p_func];
@@ -1153,6 +1155,62 @@ void GDFunctions::call(Function p_func, const Variant **p_args, int p_arg_count,
r_ret = ObjectDB::get_instance(id);
} break;
+ case LEN: {
+
+ VALIDATE_ARG_COUNT(1);
+ switch (p_args[0]->get_type()) {
+ case Variant::DICTIONARY: {
+ Dictionary d = *p_args[0];
+ r_ret = d.size();
+ } break;
+ case Variant::ARRAY: {
+ Array d = *p_args[0];
+ r_ret = d.size();
+ } break;
+ case Variant::POOL_BYTE_ARRAY: {
+ PoolVector<uint8_t> d = *p_args[0];
+ r_ret = d.size();
+
+ } break;
+ case Variant::POOL_INT_ARRAY: {
+ PoolVector<int> d = *p_args[0];
+ r_ret = d.size();
+ } break;
+ case Variant::POOL_REAL_ARRAY: {
+
+ PoolVector<real_t> d = *p_args[0];
+ r_ret = d.size();
+ } break;
+ case Variant::POOL_STRING_ARRAY: {
+ PoolVector<String> d = *p_args[0];
+ r_ret = d.size();
+
+ } break;
+ case Variant::POOL_VECTOR2_ARRAY: {
+ PoolVector<Vector2> d = *p_args[0];
+ r_ret = d.size();
+
+ } break;
+ case Variant::POOL_VECTOR3_ARRAY: {
+
+ PoolVector<Vector3> d = *p_args[0];
+ r_ret = d.size();
+ } break;
+ case Variant::POOL_COLOR_ARRAY: {
+
+ PoolVector<Color> d = *p_args[0];
+ r_ret = d.size();
+ } break;
+ default: {
+ r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.argument = 0;
+ r_error.expected = Variant::OBJECT;
+ r_ret = Variant();
+ r_ret = RTR("Object can't provide a length.");
+ }
+ }
+
+ } break;
case FUNC_MAX: {
ERR_FAIL();
@@ -1209,6 +1267,7 @@ bool GDFunctions::is_deterministic(Function p_func) {
case TEXT_CHAR:
case TEXT_STR:
case COLOR8:
+ case LEN:
// enable for debug only, otherwise not desirable - case GEN_RANGE:
return true;
default:
@@ -1586,13 +1645,13 @@ MethodInfo GDFunctions::get_info(Function p_func) {
} break;
case TO_JSON: {
- MethodInfo mi("to_json", PropertyInfo(Variant::NIL, "var:Variant"));
+ MethodInfo mi("to_json", PropertyInfo(Variant::NIL, "var"));
mi.return_val.type = Variant::STRING;
return mi;
} break;
case HASH: {
- MethodInfo mi("hash", PropertyInfo(Variant::NIL, "var:Variant"));
+ MethodInfo mi("hash", PropertyInfo(Variant::NIL, "var"));
mi.return_val.type = Variant::INT;
return mi;
} break;
@@ -1620,6 +1679,11 @@ MethodInfo GDFunctions::get_info(Function p_func) {
mi.return_val.type = Variant::OBJECT;
return mi;
} break;
+ case LEN: {
+ MethodInfo mi("len", PropertyInfo(Variant::NIL, "var"));
+ mi.return_val.type = Variant::INT;
+ return mi;
+ } break;
case FUNC_MAX: {
diff --git a/modules/gdscript/gd_functions.h b/modules/gdscript/gd_functions.h
index cde1a9210d..93cb524118 100644
--- a/modules/gdscript/gd_functions.h
+++ b/modules/gdscript/gd_functions.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -104,6 +105,7 @@ public:
COLORN,
PRINT_STACK,
INSTANCE_FROM_ID,
+ LEN,
FUNC_MAX
};
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 1540bb51f8..9023fd4bf4 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -184,8 +185,8 @@ void GDParser::_make_completable_call(int p_arg) {
bool GDParser::_get_completable_identifier(CompletionType p_type, StringName &identifier) {
identifier = StringName();
- if (tokenizer->get_token() == GDTokenizer::TK_IDENTIFIER) {
- identifier = tokenizer->get_token_identifier();
+ if (tokenizer->is_token_literal()) {
+ identifier = tokenizer->get_token_literal();
tokenizer->advance();
}
if (tokenizer->get_token() == GDTokenizer::TK_CURSOR) {
@@ -200,8 +201,8 @@ bool GDParser::_get_completable_identifier(CompletionType p_type, StringName &id
completion_ident_is_call = false;
tokenizer->advance();
- if (tokenizer->get_token() == GDTokenizer::TK_IDENTIFIER) {
- identifier = identifier.operator String() + tokenizer->get_token_identifier().operator String();
+ if (tokenizer->is_token_literal()) {
+ identifier = identifier.operator String() + tokenizer->get_token_literal().operator String();
tokenizer->advance();
}
@@ -295,17 +296,6 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
need_identifier = false;
} break;
- case GDTokenizer::TK_IDENTIFIER: {
- if (!need_identifier) {
- done = true;
- break;
- }
-
- path += String(tokenizer->get_token_identifier());
- tokenizer->advance();
- need_identifier = false;
-
- } break;
case GDTokenizer::TK_OP_DIV: {
if (need_identifier) {
@@ -319,7 +309,15 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
} break;
default: {
- done = true;
+ // Instead of checking for TK_IDENTIFIER, we check with is_token_literal, as this allows us to use match/sync/etc. as a name
+ if (need_identifier && tokenizer->is_token_literal()) {
+ path += String(tokenizer->get_token_literal());
+ tokenizer->advance();
+ need_identifier = false;
+ } else {
+ done = true;
+ }
+
break;
}
}
@@ -388,6 +386,19 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
}
tokenizer->advance();
+ if (tokenizer->get_token() == GDTokenizer::TK_CURSOR) {
+ completion_cursor = StringName();
+ completion_node = p_parent;
+ completion_type = COMPLETION_RESOURCE_PATH;
+ completion_class = current_class;
+ completion_function = current_function;
+ completion_line = tokenizer->get_token_line();
+ completion_block = current_block;
+ completion_argument = 0;
+ completion_found = true;
+ tokenizer->advance();
+ }
+
String path;
bool found_constant = false;
bool valid = false;
@@ -459,10 +470,10 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
_set_error("Expected ')' after 'preload' path");
return NULL;
}
+ tokenizer->advance();
ConstantNode *constant = alloc_node<ConstantNode>();
constant->value = res;
- tokenizer->advance();
expr = constant;
} else if (tokenizer->get_token() == GDTokenizer::TK_PR_YIELD) {
@@ -571,7 +582,8 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
cn->value = Variant::get_numeric_constant_value(bi_type, identifier);
expr = cn;
- } else if (tokenizer->get_token(1) == GDTokenizer::TK_PARENTHESIS_OPEN && (tokenizer->get_token() == GDTokenizer::TK_BUILT_IN_TYPE || tokenizer->get_token() == GDTokenizer::TK_IDENTIFIER || tokenizer->get_token() == GDTokenizer::TK_BUILT_IN_FUNC)) {
+ } else if (tokenizer->get_token(1) == GDTokenizer::TK_PARENTHESIS_OPEN && tokenizer->is_token_literal()) {
+ // We check with is_token_literal, as this allows us to use match/sync/etc. as a name
//function or constructor
OperatorNode *op = alloc_node<OperatorNode>();
@@ -613,7 +625,8 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
expr = op;
- } else if (tokenizer->get_token() == GDTokenizer::TK_IDENTIFIER) {
+ } else if (tokenizer->is_token_literal(0, true)) {
+ // We check with is_token_literal, as this allows us to use match/sync/etc. as a name
//identifier (reference)
const ClassNode *cln = current_class;
@@ -813,10 +826,11 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
if (expecting == DICT_EXPECT_KEY) {
- if (tokenizer->get_token() == GDTokenizer::TK_IDENTIFIER && tokenizer->get_token(1) == GDTokenizer::TK_OP_ASSIGN) {
+ if (tokenizer->is_token_literal() && tokenizer->get_token(1) == GDTokenizer::TK_OP_ASSIGN) {
+ // We check with is_token_literal, as this allows us to use match/sync/etc. as a name
//lua style identifier, easier to write
ConstantNode *cn = alloc_node<ConstantNode>();
- cn->value = tokenizer->get_token_identifier();
+ cn->value = tokenizer->get_token_literal();
key = cn;
tokenizer->advance(2);
expecting = DICT_EXPECT_VALUE;
@@ -856,7 +870,8 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
expr = dict;
- } else if (tokenizer->get_token() == GDTokenizer::TK_PERIOD && (tokenizer->get_token(1) == GDTokenizer::TK_IDENTIFIER || tokenizer->get_token(1) == GDTokenizer::TK_CURSOR) && tokenizer->get_token(2) == GDTokenizer::TK_PARENTHESIS_OPEN) {
+ } else if (tokenizer->get_token() == GDTokenizer::TK_PERIOD && (tokenizer->is_token_literal(1) || tokenizer->get_token(1) == GDTokenizer::TK_CURSOR) && tokenizer->get_token(2) == GDTokenizer::TK_PARENTHESIS_OPEN) {
+ // We check with is_token_literal, as this allows us to use match/sync/etc. as a name
// parent call
tokenizer->advance(); //goto identifier
@@ -908,7 +923,8 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
//indexing using "."
- if (tokenizer->get_token(1) != GDTokenizer::TK_CURSOR && tokenizer->get_token(1) != GDTokenizer::TK_IDENTIFIER && tokenizer->get_token(1) != GDTokenizer::TK_BUILT_IN_FUNC) {
+ if (tokenizer->get_token(1) != GDTokenizer::TK_CURSOR && !tokenizer->is_token_literal(1)) {
+ // We check with is_token_literal, as this allows us to use match/sync/etc. as a name
_set_error("Expected identifier as member");
return NULL;
} else if (tokenizer->get_token(2) == GDTokenizer::TK_PARENTHESIS_OPEN) {
@@ -1063,7 +1079,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
case GDTokenizer::TK_OP_BIT_AND: op = OperatorNode::OP_BIT_AND; break;
case GDTokenizer::TK_OP_BIT_OR: op = OperatorNode::OP_BIT_OR; break;
case GDTokenizer::TK_OP_BIT_XOR: op = OperatorNode::OP_BIT_XOR; break;
- case GDTokenizer::TK_PR_EXTENDS: op = OperatorNode::OP_EXTENDS; break;
+ case GDTokenizer::TK_PR_IS: op = OperatorNode::OP_IS; break;
case GDTokenizer::TK_CF_IF: op = OperatorNode::OP_TERNARY_IF; break;
case GDTokenizer::TK_CF_ELSE: op = OperatorNode::OP_TERNARY_ELSE; break;
default: valid = false; break;
@@ -1103,7 +1119,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
switch (expression[i].op) {
- case OperatorNode::OP_EXTENDS:
+ case OperatorNode::OP_IS:
priority = -1;
break; //before anything
@@ -1406,7 +1422,7 @@ GDParser::Node *GDParser::_reduce_expression(Node *p_node, bool p_to_const) {
}
}
- if (op->op == OperatorNode::OP_EXTENDS) {
+ if (op->op == OperatorNode::OP_IS) {
//nothing much
return op;
}
@@ -2264,6 +2280,7 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
if (!is_first_line && tab_level.back()->prev() && tab_level.back()->prev()->get() == indent_level) {
// pythonic single-line expression, don't parse future lines
tab_level.pop_back();
+ p_block->end_line = tokenizer->get_token_line();
return;
}
is_first_line = false;
@@ -2326,12 +2343,12 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
//variale declaration and (eventual) initialization
tokenizer->advance();
- if (tokenizer->get_token() != GDTokenizer::TK_IDENTIFIER) {
+ if (!tokenizer->is_token_literal(0, true)) {
_set_error("Expected identifier for local variable name.");
return;
}
- StringName n = tokenizer->get_token_identifier();
+ StringName n = tokenizer->get_token_literal();
tokenizer->advance();
if (current_function) {
for (int i = 0; i < current_function->arguments.size(); i++) {
@@ -2352,8 +2369,7 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
check_block = check_block->parent_block;
}
- p_block->variables.push_back(n); //line?
- p_block->variable_lines.push_back(tokenizer->get_token_line());
+ int var_line = tokenizer->get_token_line();
//must know when the local variable is declared
LocalVarNode *lv = alloc_node<LocalVarNode>();
@@ -2383,6 +2399,10 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
c->value = Variant();
assigned = c;
}
+ //must be added later, to avoid self-referencing.
+ p_block->variables.push_back(n); //line?
+ p_block->variable_lines.push_back(var_line);
+
IdentifierNode *id = alloc_node<IdentifierNode>();
id->name = n;
@@ -2420,7 +2440,7 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
p_block->sub_blocks.push_back(cf_if->body);
if (!_enter_indent_block(cf_if->body)) {
- _set_error("Expected intended block after 'if'");
+ _set_error("Expected indented block after 'if'");
p_block->end_line = tokenizer->get_token_line();
return;
}
@@ -2435,9 +2455,8 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
while (true) {
- while (tokenizer->get_token() == GDTokenizer::TK_NEWLINE) {
- tokenizer->advance();
- }
+ while (tokenizer->get_token() == GDTokenizer::TK_NEWLINE && _parse_newline())
+ ;
if (tab_level.back()->get() < indent_level) { //not at current indent level
p_block->end_line = tokenizer->get_token_line();
@@ -2557,7 +2576,7 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
tokenizer->advance();
- if (tokenizer->get_token() != GDTokenizer::TK_IDENTIFIER) {
+ if (!tokenizer->is_token_literal(0, true)) {
_set_error("identifier expected after 'for'");
}
@@ -2612,7 +2631,7 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
ConstantNode *cn = alloc_node<ConstantNode>();
switch (args.size()) {
- case 1: cn->value = constants[0]; break;
+ case 1: cn->value = (int)constants[0]; break;
case 2: cn->value = Vector2(constants[0], constants[1]); break;
case 3: cn->value = Vector3(constants[0], constants[1], constants[2]); break;
}
@@ -2625,7 +2644,7 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
on->arguments.push_back(tn);
switch (args.size()) {
- case 1: tn->vtype = Variant::REAL; break;
+ case 1: tn->vtype = Variant::INT; break;
case 2: tn->vtype = Variant::VECTOR2; break;
case 3: tn->vtype = Variant::VECTOR3; break;
}
@@ -3094,7 +3113,7 @@ void GDParser::_parse_class(ClassNode *p_class) {
tokenizer->advance(); //var before the identifier is allowed
}
- if (tokenizer->get_token() != GDTokenizer::TK_IDENTIFIER) {
+ if (!tokenizer->is_token_literal(0, true)) {
_set_error("Expected identifier for argument.");
return;
@@ -3246,7 +3265,7 @@ void GDParser::_parse_class(ClassNode *p_class) {
case GDTokenizer::TK_PR_SIGNAL: {
tokenizer->advance();
- if (tokenizer->get_token() != GDTokenizer::TK_IDENTIFIER) {
+ if (!tokenizer->is_token_literal()) {
_set_error("Expected identifier after 'signal'.");
return;
}
@@ -3268,7 +3287,7 @@ void GDParser::_parse_class(ClassNode *p_class) {
break;
}
- if (tokenizer->get_token() != GDTokenizer::TK_IDENTIFIER) {
+ if (!tokenizer->is_token_literal(0, true)) {
_set_error("Expected identifier in signal argument.");
return;
}
@@ -3833,13 +3852,13 @@ void GDParser::_parse_class(ClassNode *p_class) {
bool onready = tokenizer->get_token(-1) == GDTokenizer::TK_PR_ONREADY;
tokenizer->advance();
- if (tokenizer->get_token() != GDTokenizer::TK_IDENTIFIER) {
+ if (!tokenizer->is_token_literal(0, true)) {
_set_error("Expected identifier for member variable name.");
return;
}
- member.identifier = tokenizer->get_token_identifier();
+ member.identifier = tokenizer->get_token_literal();
member.expression = NULL;
member._export.name = member.identifier;
member.line = tokenizer->get_token_line();
@@ -3965,11 +3984,11 @@ void GDParser::_parse_class(ClassNode *p_class) {
if (tokenizer->get_token() != GDTokenizer::TK_COMMA) {
//just comma means using only getter
- if (tokenizer->get_token() != GDTokenizer::TK_IDENTIFIER) {
- _set_error("Expected identifier for setter function after 'notify'.");
+ if (!tokenizer->is_token_literal()) {
+ _set_error("Expected identifier for setter function after 'setget'.");
}
- member.setter = tokenizer->get_token_identifier();
+ member.setter = tokenizer->get_token_literal();
tokenizer->advance();
}
@@ -3978,11 +3997,11 @@ void GDParser::_parse_class(ClassNode *p_class) {
//there is a getter
tokenizer->advance();
- if (tokenizer->get_token() != GDTokenizer::TK_IDENTIFIER) {
+ if (!tokenizer->is_token_literal()) {
_set_error("Expected identifier for getter function after ','.");
}
- member.getter = tokenizer->get_token_identifier();
+ member.getter = tokenizer->get_token_literal();
tokenizer->advance();
}
}
@@ -4000,13 +4019,13 @@ void GDParser::_parse_class(ClassNode *p_class) {
ClassNode::Constant constant;
tokenizer->advance();
- if (tokenizer->get_token() != GDTokenizer::TK_IDENTIFIER) {
+ if (!tokenizer->is_token_literal(0, true)) {
_set_error("Expected name (identifier) for constant.");
return;
}
- constant.identifier = tokenizer->get_token_identifier();
+ constant.identifier = tokenizer->get_token_literal();
tokenizer->advance();
if (tokenizer->get_token() != GDTokenizer::TK_OP_ASSIGN) {
@@ -4047,8 +4066,8 @@ void GDParser::_parse_class(ClassNode *p_class) {
Dictionary enum_dict;
tokenizer->advance();
- if (tokenizer->get_token() == GDTokenizer::TK_IDENTIFIER) {
- enum_name = tokenizer->get_token_identifier();
+ if (tokenizer->is_token_literal(0, true)) {
+ enum_name = tokenizer->get_token_literal();
tokenizer->advance();
}
if (tokenizer->get_token() != GDTokenizer::TK_CURLY_BRACKET_OPEN) {
@@ -4065,7 +4084,7 @@ void GDParser::_parse_class(ClassNode *p_class) {
tokenizer->advance();
break; // End of enum
- } else if (tokenizer->get_token() != GDTokenizer::TK_IDENTIFIER) {
+ } else if (!tokenizer->is_token_literal(0, true)) {
if (tokenizer->get_token() == GDTokenizer::TK_EOF) {
_set_error("Unexpected end of file.");
@@ -4074,10 +4093,10 @@ void GDParser::_parse_class(ClassNode *p_class) {
}
return;
- } else { // tokenizer->get_token()==GDTokenizer::TK_IDENTIFIER
+ } else { // tokenizer->is_token_literal(0, true)
ClassNode::Constant constant;
- constant.identifier = tokenizer->get_token_identifier();
+ constant.identifier = tokenizer->get_token_literal();
tokenizer->advance();
diff --git a/modules/gdscript/gd_parser.h b/modules/gdscript/gd_parser.h
index 8d2c136818..3ad3466624 100644
--- a/modules/gdscript/gd_parser.h
+++ b/modules/gdscript/gd_parser.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -215,7 +216,7 @@ public:
OP_CALL,
OP_PARENT_CALL,
OP_YIELD,
- OP_EXTENDS,
+ OP_IS,
//indexing operator
OP_INDEX,
OP_INDEX_NAMED,
@@ -436,6 +437,7 @@ public:
COMPLETION_PARENT_FUNCTION,
COMPLETION_METHOD,
COMPLETION_CALL_ARGUMENTS,
+ COMPLETION_RESOURCE_PATH,
COMPLETION_INDEX,
COMPLETION_VIRTUAL_FUNC,
COMPLETION_YIELD,
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index 9aafe41a0c..2d06c0f5d2 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,11 +29,11 @@
/*************************************************************************/
#include "gd_script.h"
#include "gd_compiler.h"
-#include "global_config.h"
#include "global_constants.h"
#include "io/file_access_encrypted.h"
#include "os/file_access.h"
#include "os/os.h"
+#include "project_settings.h"
///////////////////////////
@@ -478,7 +479,7 @@ bool GDScript::_update_exports() {
const GDParser::ClassNode *c = static_cast<const GDParser::ClassNode *>(root);
if (base_cache.is_valid()) {
- base_cache->inheriters_cache.erase(get_instance_ID());
+ base_cache->inheriters_cache.erase(get_instance_id());
base_cache = Ref<GDScript>();
}
@@ -504,7 +505,7 @@ bool GDScript::_update_exports() {
//print_line("parent is: "+bf->get_path());
base_cache = bf;
- bf->inheriters_cache.insert(get_instance_ID());
+ bf->inheriters_cache.insert(get_instance_id());
//bf->_update_exports(p_instances,true,false);
}
@@ -614,6 +615,11 @@ Error GDScript::reload(bool p_keep_state) {
if (basedir != "")
basedir = basedir.get_base_dir();
+ if (basedir != "" && basedir.find("res://") == -1 && basedir.find("user://") == -1) {
+ //loading a template, don't parse
+ return OK;
+ }
+
valid = false;
GDParser parser;
Error err = parser.parse(source, basedir, false, path);
@@ -1448,9 +1454,9 @@ void GDScriptLanguage::init() {
//populate singletons
- List<GlobalConfig::Singleton> singletons;
- GlobalConfig::get_singleton()->get_singletons(&singletons);
- for (List<GlobalConfig::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
+ List<ProjectSettings::Singleton> singletons;
+ ProjectSettings::get_singleton()->get_singletons(&singletons);
+ for (List<ProjectSettings::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
_add_global(E->get().name, E->get().ptr);
}
@@ -1687,7 +1693,7 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
if (obj->get_script_instance()) {
obj->get_script_instance()->get_property_state(state);
- map[obj->get_instance_ID()] = state;
+ map[obj->get_instance_id()] = state;
obj->set_script(RefPtr());
}
}
@@ -1696,15 +1702,18 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
#ifdef TOOLS_ENABLED
while (E->get()->placeholders.size()) {
-
Object *obj = E->get()->placeholders.front()->get()->get_owner();
+
//save instance info
List<Pair<StringName, Variant> > state;
if (obj->get_script_instance()) {
obj->get_script_instance()->get_property_state(state);
- map[obj->get_instance_ID()] = state;
+ map[obj->get_instance_id()] = state;
obj->set_script(RefPtr());
+ } else {
+ // no instance found. Let's remove it so we don't loop forever
+ E->get()->placeholders.erase(E->get()->placeholders.front()->get());
}
}
#endif
@@ -1734,8 +1743,8 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
obj->set_script(scr.get_ref_ptr());
if (!obj->get_script_instance()) {
//failed, save reload state for next time if not saved
- if (!scr->pending_reload_state.has(obj->get_instance_ID())) {
- scr->pending_reload_state[obj->get_instance_ID()] = F->get();
+ if (!scr->pending_reload_state.has(obj->get_instance_id())) {
+ scr->pending_reload_state[obj->get_instance_id()] = F->get();
}
continue;
}
@@ -1744,7 +1753,7 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
obj->get_script_instance()->set(G->get().first, G->get().second);
}
- scr->pending_reload_state.erase(obj->get_instance_ID()); //as it reloaded, remove pending state
+ scr->pending_reload_state.erase(obj->get_instance_id()); //as it reloaded, remove pending state
}
//if instance states were saved, set them!
@@ -1808,6 +1817,7 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const {
"breakpoint",
"class",
"extends",
+ "is",
"func",
"preload",
"setget",
@@ -1875,7 +1885,7 @@ GDScriptLanguage::GDScriptLanguage() {
script_frame_time = 0;
_debug_call_stack_pos = 0;
- int dmcs = GLOBAL_DEF("debug/script/max_call_stack", 1024);
+ int dmcs = GLOBAL_DEF("debug/settings/gdscript/max_call_stack", 1024);
if (ScriptDebugger::get_singleton()) {
//debugging enabled!
diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h
index d64cc9798d..17e7b0bc03 100644
--- a/modules/gdscript/gd_script.h
+++ b/modules/gdscript/gd_script.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -297,7 +298,7 @@ public:
_FORCE_INLINE_ void enter_function(GDInstance *p_instance, GDFunction *p_function, Variant *p_stack, int *p_ip, int *p_line) {
- if (Thread::get_main_ID() != Thread::get_caller_ID())
+ if (Thread::get_main_id() != Thread::get_caller_id())
return; //no support for other threads than main for now
if (ScriptDebugger::get_singleton()->get_lines_left() > 0 && ScriptDebugger::get_singleton()->get_depth() >= 0)
@@ -320,7 +321,7 @@ public:
_FORCE_INLINE_ void exit_function() {
- if (Thread::get_main_ID() != Thread::get_caller_ID())
+ if (Thread::get_main_id() != Thread::get_caller_id())
return; //no support for other threads than main for now
if (ScriptDebugger::get_singleton()->get_lines_left() > 0 && ScriptDebugger::get_singleton()->get_depth() >= 0)
@@ -337,7 +338,7 @@ public:
}
virtual Vector<StackInfo> debug_get_current_stack_info() {
- if (Thread::get_main_ID() != Thread::get_caller_ID())
+ if (Thread::get_main_id() != Thread::get_caller_id())
return Vector<StackInfo>();
Vector<StackInfo> csi;
@@ -380,15 +381,20 @@ public:
virtual void get_comment_delimiters(List<String> *p_delimiters) const;
virtual void get_string_delimiters(List<String> *p_delimiters) const;
virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const;
+ virtual bool is_using_templates();
+ virtual void make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script);
virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List<String> *r_functions = NULL) const;
virtual Script *create_script() const;
virtual bool has_named_classes() const;
+ virtual bool can_inherit_from_file() { return true; }
virtual int find_function(const String &p_function, const String &p_code) const;
virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const;
+ virtual Error open_in_external_editor(const Ref<Script> &p_script, int p_line, int p_col) { return OK; }
virtual Error complete_code(const String &p_code, const String &p_base_path, Object *p_owner, List<String> *r_options, String &r_call_hint);
#ifdef TOOLS_ENABLED
virtual Error lookup_code(const String &p_code, const String &p_symbol, const String &p_base_path, Object *p_owner, LookupResult &r_result);
#endif
+ virtual String _get_indentation() const;
virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const;
virtual void add_global_constant(const StringName &p_variable, const Variant &p_value);
diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp
index 981924191f..5803046185 100644
--- a/modules/gdscript/gd_tokenizer.cpp
+++ b/modules/gdscript/gd_tokenizer.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -89,6 +90,7 @@ const char *GDTokenizer::token_names[TK_MAX] = {
"func",
"class",
"extends",
+ "is",
"onready",
"tool",
"static",
@@ -117,6 +119,7 @@ const char *GDTokenizer::token_names[TK_MAX] = {
"'.'",
"'?'",
"':'",
+ "'$'",
"'\\n'",
"PI",
"_",
@@ -127,12 +130,222 @@ const char *GDTokenizer::token_names[TK_MAX] = {
"Cursor"
};
+struct _bit {
+ Variant::Type type;
+ const char *text;
+};
+//built in types
+
+static const _bit _type_list[] = {
+ //types
+ { Variant::BOOL, "bool" },
+ { Variant::INT, "int" },
+ { Variant::REAL, "float" },
+ { Variant::STRING, "String" },
+ { Variant::VECTOR2, "Vector2" },
+ { Variant::RECT2, "Rect2" },
+ { Variant::TRANSFORM2D, "Transform2D" },
+ { Variant::VECTOR3, "Vector3" },
+ { Variant::RECT3, "Rect3" },
+ { Variant::PLANE, "Plane" },
+ { Variant::QUAT, "Quat" },
+ { Variant::BASIS, "Basis" },
+ { Variant::TRANSFORM, "Transform" },
+ { Variant::COLOR, "Color" },
+ { Variant::_RID, "RID" },
+ { Variant::OBJECT, "Object" },
+ { Variant::NODE_PATH, "NodePath" },
+ { Variant::DICTIONARY, "Dictionary" },
+ { Variant::ARRAY, "Array" },
+ { Variant::POOL_BYTE_ARRAY, "PoolByteArray" },
+ { Variant::POOL_INT_ARRAY, "PoolIntArray" },
+ { Variant::POOL_REAL_ARRAY, "PoolRealArray" },
+ { Variant::POOL_STRING_ARRAY, "PoolStringArray" },
+ { Variant::POOL_VECTOR2_ARRAY, "PoolVector2Array" },
+ { Variant::POOL_VECTOR3_ARRAY, "PoolVector3Array" },
+ { Variant::POOL_COLOR_ARRAY, "PoolColorArray" },
+ { Variant::VARIANT_MAX, NULL },
+};
+
+struct _kws {
+ GDTokenizer::Token token;
+ const char *text;
+};
+
+static const _kws _keyword_list[] = {
+ //ops
+ { GDTokenizer::TK_OP_IN, "in" },
+ { GDTokenizer::TK_OP_NOT, "not" },
+ { GDTokenizer::TK_OP_OR, "or" },
+ { GDTokenizer::TK_OP_AND, "and" },
+ //func
+ { GDTokenizer::TK_PR_FUNCTION, "func" },
+ { GDTokenizer::TK_PR_CLASS, "class" },
+ { GDTokenizer::TK_PR_EXTENDS, "extends" },
+ { GDTokenizer::TK_PR_IS, "is" },
+ { GDTokenizer::TK_PR_ONREADY, "onready" },
+ { GDTokenizer::TK_PR_TOOL, "tool" },
+ { GDTokenizer::TK_PR_STATIC, "static" },
+ { GDTokenizer::TK_PR_EXPORT, "export" },
+ { GDTokenizer::TK_PR_SETGET, "setget" },
+ { GDTokenizer::TK_PR_VAR, "var" },
+ { GDTokenizer::TK_PR_PRELOAD, "preload" },
+ { GDTokenizer::TK_PR_ASSERT, "assert" },
+ { GDTokenizer::TK_PR_YIELD, "yield" },
+ { GDTokenizer::TK_PR_SIGNAL, "signal" },
+ { GDTokenizer::TK_PR_BREAKPOINT, "breakpoint" },
+ { GDTokenizer::TK_PR_REMOTE, "remote" },
+ { GDTokenizer::TK_PR_MASTER, "master" },
+ { GDTokenizer::TK_PR_SLAVE, "slave" },
+ { GDTokenizer::TK_PR_SYNC, "sync" },
+ { GDTokenizer::TK_PR_CONST, "const" },
+ { GDTokenizer::TK_PR_ENUM, "enum" },
+ //controlflow
+ { GDTokenizer::TK_CF_IF, "if" },
+ { GDTokenizer::TK_CF_ELIF, "elif" },
+ { GDTokenizer::TK_CF_ELSE, "else" },
+ { GDTokenizer::TK_CF_FOR, "for" },
+ { GDTokenizer::TK_CF_WHILE, "while" },
+ { GDTokenizer::TK_CF_DO, "do" },
+ { GDTokenizer::TK_CF_SWITCH, "switch" },
+ { GDTokenizer::TK_CF_CASE, "case" },
+ { GDTokenizer::TK_CF_BREAK, "break" },
+ { GDTokenizer::TK_CF_CONTINUE, "continue" },
+ { GDTokenizer::TK_CF_RETURN, "return" },
+ { GDTokenizer::TK_CF_MATCH, "match" },
+ { GDTokenizer::TK_CF_PASS, "pass" },
+ { GDTokenizer::TK_SELF, "self" },
+ { GDTokenizer::TK_CONST_PI, "PI" },
+ { GDTokenizer::TK_WILDCARD, "_" },
+ { GDTokenizer::TK_CONST_INF, "INF" },
+ { GDTokenizer::TK_CONST_NAN, "NAN" },
+ { GDTokenizer::TK_ERROR, NULL }
+};
+
const char *GDTokenizer::get_token_name(Token p_token) {
ERR_FAIL_INDEX_V(p_token, TK_MAX, "<error>");
return token_names[p_token];
}
+bool GDTokenizer::is_token_literal(int p_offset, bool variable_safe) const {
+ switch (get_token(p_offset)) {
+ // Can always be literal:
+ case TK_IDENTIFIER:
+
+ case TK_PR_ONREADY:
+ case TK_PR_TOOL:
+ case TK_PR_STATIC:
+ case TK_PR_EXPORT:
+ case TK_PR_SETGET:
+ case TK_PR_SIGNAL:
+ case TK_PR_REMOTE:
+ case TK_PR_MASTER:
+ case TK_PR_SLAVE:
+ case TK_PR_SYNC:
+ return true;
+
+ // Literal for non-variables only:
+ case TK_BUILT_IN_TYPE:
+ case TK_BUILT_IN_FUNC:
+
+ case TK_OP_IN:
+ //case TK_OP_NOT:
+ //case TK_OP_OR:
+ //case TK_OP_AND:
+
+ case TK_PR_CLASS:
+ case TK_PR_CONST:
+ case TK_PR_ENUM:
+ case TK_PR_PRELOAD:
+ case TK_PR_FUNCTION:
+ case TK_PR_EXTENDS:
+ case TK_PR_ASSERT:
+ case TK_PR_YIELD:
+ case TK_PR_VAR:
+
+ case TK_CF_IF:
+ case TK_CF_ELIF:
+ case TK_CF_ELSE:
+ case TK_CF_FOR:
+ case TK_CF_WHILE:
+ case TK_CF_DO:
+ case TK_CF_SWITCH:
+ case TK_CF_CASE:
+ case TK_CF_BREAK:
+ case TK_CF_CONTINUE:
+ case TK_CF_RETURN:
+ case TK_CF_MATCH:
+ case TK_CF_PASS:
+ case TK_SELF:
+ case TK_CONST_PI:
+ case TK_WILDCARD:
+ case TK_CONST_INF:
+ case TK_CONST_NAN:
+ case TK_ERROR:
+ return !variable_safe;
+
+ case TK_CONSTANT: {
+ switch (get_token_constant(p_offset).get_type()) {
+ case Variant::NIL:
+ case Variant::BOOL:
+ return true;
+ default:
+ return false;
+ }
+ }
+ default:
+ return false;
+ }
+}
+
+StringName GDTokenizer::get_token_literal(int p_offset) const {
+ Token token = get_token(p_offset);
+ switch (token) {
+ case TK_IDENTIFIER:
+ return get_token_identifier(p_offset);
+ case TK_BUILT_IN_TYPE: {
+ Variant::Type type = get_token_type(p_offset);
+ int idx = 0;
+
+ while (_type_list[idx].text) {
+ if (type == _type_list[idx].type) {
+ return _type_list[idx].text;
+ }
+ idx++;
+ }
+ } break; // Shouldn't get here, stuff happens
+ case TK_BUILT_IN_FUNC:
+ return GDFunctions::get_func_name(get_token_built_in_func(p_offset));
+ case TK_CONSTANT: {
+ const Variant value = get_token_constant(p_offset);
+
+ switch (value.get_type()) {
+ case Variant::NIL:
+ return "null";
+ case Variant::BOOL:
+ return value ? "true" : "false";
+ default: {}
+ }
+ }
+ case TK_OP_AND:
+ case TK_OP_OR:
+ break; // Don't get into default, since they can be non-literal
+ default: {
+ int idx = 0;
+
+ while (_keyword_list[idx].text) {
+ if (token == _keyword_list[idx].token) {
+ return _keyword_list[idx].text;
+ }
+ idx++;
+ }
+ }
+ }
+ ERR_EXPLAIN("Failed to get token literal");
+ ERR_FAIL_V("");
+}
+
static bool _is_text_char(CharType c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_';
@@ -776,53 +989,14 @@ void GDTokenizerText::_advance() {
bool found = false;
- struct _bit {
- Variant::Type type;
- const char *text;
- };
- //built in types
-
- static const _bit type_list[] = {
- //types
- { Variant::BOOL, "bool" },
- { Variant::INT, "int" },
- { Variant::REAL, "float" },
- { Variant::STRING, "String" },
- { Variant::VECTOR2, "Vector2" },
- { Variant::RECT2, "Rect2" },
- { Variant::TRANSFORM2D, "Transform2D" },
- { Variant::VECTOR3, "Vector3" },
- { Variant::RECT3, "Rect3" },
- { Variant::PLANE, "Plane" },
- { Variant::QUAT, "Quat" },
- { Variant::BASIS, "Basis" },
- { Variant::TRANSFORM, "Transform" },
- { Variant::COLOR, "Color" },
- { Variant::IMAGE, "Image" },
- { Variant::_RID, "RID" },
- { Variant::OBJECT, "Object" },
- { Variant::INPUT_EVENT, "InputEvent" },
- { Variant::NODE_PATH, "NodePath" },
- { Variant::DICTIONARY, "Dictionary" },
- { Variant::ARRAY, "Array" },
- { Variant::POOL_BYTE_ARRAY, "PoolByteArray" },
- { Variant::POOL_INT_ARRAY, "PoolIntArray" },
- { Variant::POOL_REAL_ARRAY, "PoolFloatArray" },
- { Variant::POOL_STRING_ARRAY, "PoolStringArray" },
- { Variant::POOL_VECTOR2_ARRAY, "PoolVector2Array" },
- { Variant::POOL_VECTOR3_ARRAY, "PoolVector3Array" },
- { Variant::POOL_COLOR_ARRAY, "PoolColorArray" },
- { Variant::VARIANT_MAX, NULL },
- };
-
{
int idx = 0;
- while (type_list[idx].text) {
+ while (_type_list[idx].text) {
- if (str == type_list[idx].text) {
- _make_type(type_list[idx].type);
+ if (str == _type_list[idx].text) {
+ _make_type(_type_list[idx].type);
found = true;
break;
}
@@ -843,73 +1017,18 @@ void GDTokenizerText::_advance() {
break;
}
}
-
- //keywor
}
if (!found) {
-
- struct _kws {
- Token token;
- const char *text;
- };
-
- static const _kws keyword_list[] = {
- //ops
- { TK_OP_IN, "in" },
- { TK_OP_NOT, "not" },
- { TK_OP_OR, "or" },
- { TK_OP_AND, "and" },
- //func
- { TK_PR_FUNCTION, "func" },
- { TK_PR_CLASS, "class" },
- { TK_PR_EXTENDS, "extends" },
- { TK_PR_ONREADY, "onready" },
- { TK_PR_TOOL, "tool" },
- { TK_PR_STATIC, "static" },
- { TK_PR_EXPORT, "export" },
- { TK_PR_SETGET, "setget" },
- { TK_PR_VAR, "var" },
- { TK_PR_PRELOAD, "preload" },
- { TK_PR_ASSERT, "assert" },
- { TK_PR_YIELD, "yield" },
- { TK_PR_SIGNAL, "signal" },
- { TK_PR_BREAKPOINT, "breakpoint" },
- { TK_PR_REMOTE, "remote" },
- { TK_PR_MASTER, "master" },
- { TK_PR_SLAVE, "slave" },
- { TK_PR_SYNC, "sync" },
- { TK_PR_CONST, "const" },
- { TK_PR_ENUM, "enum" },
- //controlflow
- { TK_CF_IF, "if" },
- { TK_CF_ELIF, "elif" },
- { TK_CF_ELSE, "else" },
- { TK_CF_FOR, "for" },
- { TK_CF_WHILE, "while" },
- { TK_CF_DO, "do" },
- { TK_CF_SWITCH, "switch" },
- { TK_CF_CASE, "case" },
- { TK_CF_BREAK, "break" },
- { TK_CF_CONTINUE, "continue" },
- { TK_CF_RETURN, "return" },
- { TK_CF_MATCH, "match" },
- { TK_CF_PASS, "pass" },
- { TK_SELF, "self" },
- { TK_CONST_PI, "PI" },
- { TK_WILDCARD, "_" },
- { TK_CONST_INF, "INF" },
- { TK_CONST_NAN, "NAN" },
- { TK_ERROR, NULL }
- };
+ //keyword
int idx = 0;
found = false;
- while (keyword_list[idx].text) {
+ while (_keyword_list[idx].text) {
- if (str == keyword_list[idx].text) {
- _make_token(keyword_list[idx].token);
+ if (str == _keyword_list[idx].text) {
+ _make_token(_keyword_list[idx].token);
found = true;
break;
}
@@ -990,6 +1109,7 @@ const Variant &GDTokenizerText::get_token_constant(int p_offset) const {
ERR_FAIL_COND_V(tk_rb[ofs].type != TK_CONSTANT, tk_rb[0].constant);
return tk_rb[ofs].constant;
}
+
StringName GDTokenizerText::get_token_identifier(int p_offset) const {
ERR_FAIL_COND_V(p_offset <= -MAX_LOOKAHEAD, StringName());
diff --git a/modules/gdscript/gd_tokenizer.h b/modules/gdscript/gd_tokenizer.h
index c1ed8ad92e..4e868301a3 100644
--- a/modules/gdscript/gd_tokenizer.h
+++ b/modules/gdscript/gd_tokenizer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -95,6 +96,7 @@ public:
TK_PR_FUNCTION,
TK_PR_CLASS,
TK_PR_EXTENDS,
+ TK_PR_IS,
TK_PR_ONREADY,
TK_PR_TOOL,
TK_PR_STATIC,
@@ -147,6 +149,9 @@ protected:
public:
static const char *get_token_name(Token p_token);
+ bool is_token_literal(int p_offset = 0, bool variable_safe = false) const;
+ StringName get_token_literal(int p_offset = 0) const;
+
virtual const Variant &get_token_constant(int p_offset = 0) const = 0;
virtual Token get_token(int p_offset = 0) const = 0;
virtual StringName get_token_identifier(int p_offset = 0) const = 0;
diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp
index 5acd412f7e..41ea0c2a26 100644
--- a/modules/gdscript/register_types.cpp
+++ b/modules/gdscript/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/gdscript/register_types.h b/modules/gdscript/register_types.h
index 5778dfcadc..4e969f5bd4 100644
--- a/modules/gdscript/register_types.h
+++ b/modules/gdscript/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 128592fa29..1205776882 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -344,7 +345,7 @@ void GridMap::set_cell_item(int p_x, int p_y, int p_z, int p_item, int p_rot) {
Octant *g = memnew(Octant);
g->dirty = true;
g->static_body = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC);
- PhysicsServer::get_singleton()->body_attach_object_instance_ID(g->static_body, get_instance_ID());
+ PhysicsServer::get_singleton()->body_attach_object_instance_id(g->static_body, get_instance_id());
if (is_inside_world())
PhysicsServer::get_singleton()->body_set_space(g->static_body, get_world()->get_space());
@@ -379,6 +380,7 @@ void GridMap::set_cell_item(int p_x, int p_y, int p_z, int p_item, int p_rot) {
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_flag(ii.multimesh_instance, VS::INSTANCE_FLAG_USE_BAKED_LIGHT, true);
g.items[p_item] = ii;
}
@@ -828,8 +830,8 @@ void GridMap::_update_dirty_map_callback() {
void GridMap::_bind_methods() {
- 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(D_METHOD("set_theme", "theme"), &GridMap::set_theme);
+ ClassDB::bind_method(D_METHOD("get_theme"), &GridMap::get_theme);
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);
@@ -855,7 +857,7 @@ void GridMap::_bind_methods() {
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_get_bounds", "area"), &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);
@@ -865,7 +867,7 @@ void GridMap::_bind_methods() {
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::bind_method(D_METHOD("get_unused_area_id"), &GridMap::get_unused_area_id);
ClassDB::bind_method(D_METHOD("clear"), &GridMap::clear);
@@ -1047,21 +1049,21 @@ void GridMap::_update_area_instances() {
}
}
-Error GridMap::create_area(int p_id, const Rect3 &p_bounds) {
+Error GridMap::create_area(int p_id, const Rect3 &p_area) {
ERR_FAIL_COND_V(area_map.has(p_id), ERR_ALREADY_EXISTS);
ERR_EXPLAIN("ID 0 is taken as global area, start from 1");
ERR_FAIL_COND_V(p_id == 0, ERR_INVALID_PARAMETER);
- ERR_FAIL_COND_V(p_bounds.has_no_area(), ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(p_area.has_no_area(), ERR_INVALID_PARAMETER);
// FIRST VALIDATE AREA
IndexKey from, to;
- from.x = p_bounds.pos.x;
- from.y = p_bounds.pos.y;
- from.z = p_bounds.pos.z;
- to.x = p_bounds.pos.x + p_bounds.size.x;
- to.y = p_bounds.pos.y + p_bounds.size.y;
- to.z = p_bounds.pos.z + p_bounds.size.z;
+ from.x = p_area.position.x;
+ from.y = p_area.position.y;
+ from.z = p_area.position.z;
+ to.x = p_area.position.x + p_area.size.x;
+ to.y = p_area.position.y + p_area.size.y;
+ to.z = p_area.position.z + p_area.size.z;
for (Map<int, Area *>::Element *E = area_map.front(); E; E = E->next()) {
//this should somehow be faster...
@@ -1100,8 +1102,8 @@ Rect3 GridMap::area_get_bounds(int p_area) const {
const Area *a = area_map[p_area];
Rect3 aabb;
- aabb.pos = Vector3(a->from.x, a->from.y, a->from.z);
- aabb.size = Vector3(a->to.x, a->to.y, a->to.z) - aabb.pos;
+ aabb.position = Vector3(a->from.x, a->from.y, a->from.z);
+ aabb.size = Vector3(a->to.x, a->to.y, a->to.z) - aabb.position;
return aabb;
}
diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h
index 2a0c2b9646..106bf82dc2 100644
--- a/modules/gridmap/grid_map.h
+++ b/modules/gridmap/grid_map.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -241,7 +242,7 @@ public:
void set_center_z(bool p_enable);
bool get_center_z() const;
- void set_cell_item(int p_x, int p_y, int p_z, int p_item, int p_orientation = 0);
+ void set_cell_item(int p_x, int p_y, int p_z, int p_item, int p_rot = 0);
int get_cell_item(int p_x, int p_y, int p_z) const;
int get_cell_item_orientation(int p_x, int p_y, int p_z) const;
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index a6a3a03503..38f58799df 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -507,146 +508,150 @@ void GridMapEditor::_duplicate_paste() {
}
}
-bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const InputEvent &p_event) {
+bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<InputEvent> &p_event) {
if (!node) {
return false;
}
if (edit_mode->get_selected() == 0) { // regular click
- switch (p_event.type) {
- case InputEvent::MOUSE_BUTTON: {
- if (p_event.mouse_button.button_index == BUTTON_WHEEL_UP && (p_event.mouse_button.mod.command || p_event.mouse_button.mod.shift)) {
- if (p_event.mouse_button.pressed)
- floor->set_value(floor->get_value() + 1);
+ Ref<InputEventMouseButton> mb = p_event;
- return true; //eaten
- } else if (p_event.mouse_button.button_index == BUTTON_WHEEL_DOWN && (p_event.mouse_button.mod.command || p_event.mouse_button.mod.shift)) {
- if (p_event.mouse_button.pressed)
- floor->set_value(floor->get_value() - 1);
- return true;
- }
+ if (mb.is_valid()) {
- if (p_event.mouse_button.pressed) {
+ if (mb->get_button_index() == BUTTON_WHEEL_UP && (mb->get_command() || mb->get_shift())) {
+ if (mb->is_pressed())
+ floor->set_value(floor->get_value() + mb->get_factor());
- if (p_event.mouse_button.button_index == BUTTON_LEFT) {
+ return true; //eaten
+ } else if (mb->get_button_index() == BUTTON_WHEEL_DOWN && (mb->get_command() || mb->get_shift())) {
+ if (mb->is_pressed())
+ floor->set_value(floor->get_value() - mb->get_factor());
+ return true;
+ }
- if (input_action == INPUT_DUPLICATE) {
+ if (mb->is_pressed()) {
- //paste
- _duplicate_paste();
- input_action = INPUT_NONE;
- _update_duplicate_indicator();
- } else if (p_event.mouse_button.mod.shift) {
- input_action = INPUT_SELECT;
- } else if (p_event.mouse_button.mod.command)
- input_action = INPUT_COPY;
- else {
- input_action = INPUT_PAINT;
- set_items.clear();
- }
- } else if (p_event.mouse_button.button_index == BUTTON_RIGHT)
- if (input_action == INPUT_DUPLICATE) {
-
- input_action = INPUT_NONE;
- _update_duplicate_indicator();
- } else {
- input_action = INPUT_ERASE;
- set_items.clear();
- }
- else
- return false;
+ if (mb->get_button_index() == BUTTON_LEFT) {
- return do_input_action(p_camera, Point2(p_event.mouse_button.x, p_event.mouse_button.y), true);
- } else {
+ if (input_action == INPUT_DUPLICATE) {
- if (
- (p_event.mouse_button.button_index == BUTTON_RIGHT && input_action == INPUT_ERASE) ||
- (p_event.mouse_button.button_index == BUTTON_LEFT && input_action == INPUT_PAINT)) {
+ //paste
+ _duplicate_paste();
+ input_action = INPUT_NONE;
+ _update_duplicate_indicator();
+ } else if (mb->get_shift()) {
+ input_action = INPUT_SELECT;
+ } else if (mb->get_command())
+ input_action = INPUT_COPY;
+ else {
+ input_action = INPUT_PAINT;
+ set_items.clear();
+ }
+ } else if (mb->get_button_index() == BUTTON_RIGHT)
+ if (input_action == INPUT_DUPLICATE) {
- if (set_items.size()) {
- undo_redo->create_action("GridMap Paint");
- for (List<SetItem>::Element *E = set_items.front(); E; E = E->next()) {
+ input_action = INPUT_NONE;
+ _update_duplicate_indicator();
+ } else {
+ input_action = INPUT_ERASE;
+ set_items.clear();
+ }
+ else
+ return false;
+
+ return do_input_action(p_camera, Point2(mb->get_position().x, mb->get_position().y), true);
+ } else {
- const SetItem &si = E->get();
- undo_redo->add_do_method(node, "set_cell_item", si.pos.x, si.pos.y, si.pos.z, si.new_value, si.new_orientation);
- }
- for (List<SetItem>::Element *E = set_items.back(); E; E = E->prev()) {
+ if (
+ (mb->get_button_index() == BUTTON_RIGHT && input_action == INPUT_ERASE) ||
+ (mb->get_button_index() == BUTTON_LEFT && input_action == INPUT_PAINT)) {
- const SetItem &si = E->get();
- undo_redo->add_undo_method(node, "set_cell_item", si.pos.x, si.pos.y, si.pos.z, si.old_value, si.old_orientation);
- }
+ if (set_items.size()) {
+ undo_redo->create_action("GridMap Paint");
+ for (List<SetItem>::Element *E = set_items.front(); E; E = E->next()) {
- undo_redo->commit_action();
+ const SetItem &si = E->get();
+ undo_redo->add_do_method(node, "set_cell_item", si.pos.x, si.pos.y, si.pos.z, si.new_value, si.new_orientation);
}
- set_items.clear();
- input_action = INPUT_NONE;
- return true;
- }
+ for (List<SetItem>::Element *E = set_items.back(); E; E = E->prev()) {
- if (p_event.mouse_button.button_index == BUTTON_LEFT && input_action != INPUT_NONE) {
+ const SetItem &si = E->get();
+ undo_redo->add_undo_method(node, "set_cell_item", si.pos.x, si.pos.y, si.pos.z, si.old_value, si.old_orientation);
+ }
- set_items.clear();
- input_action = INPUT_NONE;
- return true;
- }
- if (p_event.mouse_button.button_index == BUTTON_RIGHT && (input_action == INPUT_ERASE || input_action == INPUT_DUPLICATE)) {
- input_action = INPUT_NONE;
- return true;
+ undo_redo->commit_action();
}
+ set_items.clear();
+ input_action = INPUT_NONE;
+ return true;
+ }
+
+ if (mb->get_button_index() == BUTTON_LEFT && input_action != INPUT_NONE) {
+
+ set_items.clear();
+ input_action = INPUT_NONE;
+ return true;
+ }
+ if (mb->get_button_index() == BUTTON_RIGHT && (input_action == INPUT_ERASE || input_action == INPUT_DUPLICATE)) {
+ input_action = INPUT_NONE;
+ return true;
}
- } break;
- case InputEvent::MOUSE_MOTION: {
+ }
+ }
+
+ Ref<InputEventMouseMotion> mm = p_event;
- return do_input_action(p_camera, Point2(p_event.mouse_motion.x, p_event.mouse_motion.y), false);
- } break;
+ if (mm.is_valid()) {
+
+ return do_input_action(p_camera, mm->get_position(), false);
}
} else if (edit_mode->get_selected() == 1) {
//area mode, select an area
- switch (p_event.type) {
- case InputEvent::MOUSE_BUTTON: {
+ Ref<InputEventMouseButton> mb = p_event;
- if (p_event.mouse_button.button_index == BUTTON_LEFT && p_event.mouse_button.pressed) {
+ if (mb.is_valid()) {
- Point2 point = Point2(p_event.mouse_motion.x, p_event.mouse_motion.y);
+ if (mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
- Camera *camera = p_camera;
- Vector3 from = camera->project_ray_origin(point);
- Vector3 normal = camera->project_ray_normal(point);
- Transform local_xform = node->get_global_transform().affine_inverse();
- from = local_xform.xform(from);
- normal = local_xform.basis.xform(normal).normalized();
+ Point2 point = mb->get_position();
- List<int> areas;
- node->get_area_list(&areas);
+ Camera *camera = p_camera;
+ Vector3 from = camera->project_ray_origin(point);
+ Vector3 normal = camera->project_ray_normal(point);
+ Transform local_xform = node->get_global_transform().affine_inverse();
+ from = local_xform.xform(from);
+ normal = local_xform.basis.xform(normal).normalized();
- float min_d = 1e10;
- int min_area = -1;
+ List<int> areas;
+ node->get_area_list(&areas);
- for (List<int>::Element *E = areas.front(); E; E = E->next()) {
+ float min_d = 1e10;
+ int min_area = -1;
- int area = E->get();
- Rect3 aabb = node->area_get_bounds(area);
- aabb.pos *= node->get_cell_size();
- aabb.size *= node->get_cell_size();
+ for (List<int>::Element *E = areas.front(); E; E = E->next()) {
- Vector3 rclip, rnormal;
- if (!aabb.intersects_segment(from, from + normal * 10000, &rclip, &rnormal))
- continue;
+ int area = E->get();
+ Rect3 aabb = node->area_get_bounds(area);
+ aabb.position *= node->get_cell_size();
+ aabb.size *= node->get_cell_size();
- float d = normal.dot(rclip);
- if (d < min_d) {
- min_d = d;
- min_area = area;
- }
- }
+ Vector3 rclip, rnormal;
+ if (!aabb.intersects_segment(from, from + normal * 10000, &rclip, &rnormal))
+ continue;
- selected_area = min_area;
- update_areas();
+ float d = normal.dot(rclip);
+ if (d < min_d) {
+ min_d = d;
+ min_area = area;
+ }
}
- } break;
+
+ selected_area = min_area;
+ update_areas();
+ }
}
}
@@ -834,9 +839,9 @@ void GridMapEditor::edit(GridMap *p_gridmap) {
//update grids
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_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ indicator_mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ indicator_mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
indicator_mat->set_albedo(Color(0.8, 0.5, 0.1));
Vector<Vector3> grid_points[3];
@@ -1198,7 +1203,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
edit_mode = memnew(OptionButton);
edit_mode->set_area_as_parent_rect();
edit_mode->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 24);
- edit_mode->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 14);
+ edit_mode->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -14);
edit_mode->add_item("Tiles");
edit_mode->add_item("Areas");
hb->add_child(edit_mode);
@@ -1309,9 +1314,9 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
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);
+ inner_mat->set_flag(SpatialMaterial::FLAG_ONTOP, true);
+ inner_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ inner_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
d[VS::ARRAY_VERTEX] = triangles;
VisualServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh, VS::PRIMITIVE_TRIANGLES, d);
@@ -1319,10 +1324,10 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
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_flag(SpatialMaterial::FLAG_ONTOP, true);
+ outer_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
outer_mat->set_line_width(3.0);
- outer_mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ outer_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
d[VS::ARRAY_VERTEX] = lines;
VisualServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh, VS::PRIMITIVE_LINES, d);
diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h
index 27a063ee41..a1b2c96ccd 100644
--- a/modules/gridmap/grid_map_editor_plugin.h
+++ b/modules/gridmap/grid_map_editor_plugin.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -112,9 +113,9 @@ class GridMapEditor : public VBoxContainer {
RID duplicate_mesh;
RID duplicate_instance;
- Ref<FixedSpatialMaterial> indicator_mat;
- Ref<FixedSpatialMaterial> inner_mat;
- Ref<FixedSpatialMaterial> outer_mat;
+ Ref<SpatialMaterial> indicator_mat;
+ Ref<SpatialMaterial> inner_mat;
+ Ref<SpatialMaterial> outer_mat;
bool updating;
@@ -219,7 +220,7 @@ protected:
static void _bind_methods();
public:
- bool forward_spatial_input_event(Camera *p_camera, const InputEvent &p_event);
+ bool forward_spatial_input_event(Camera *p_camera, const Ref<InputEvent> &p_event);
void edit(GridMap *p_gridmap);
GridMapEditor() {}
@@ -235,11 +236,11 @@ class GridMapEditorPlugin : public EditorPlugin {
EditorNode *editor;
public:
- virtual bool forward_spatial_input_event(Camera *p_camera, const InputEvent &p_event) { return gridmap_editor->forward_spatial_input_event(p_camera, p_event); }
+ virtual bool forward_spatial_input_event(Camera *p_camera, const Ref<InputEvent> &p_event) { return gridmap_editor->forward_spatial_input_event(p_camera, p_event); }
virtual String get_name() const { return "GridMap"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
GridMapEditorPlugin(EditorNode *p_node);
diff --git a/modules/gridmap/register_types.cpp b/modules/gridmap/register_types.cpp
index 4035caea78..e4def9378f 100644
--- a/modules/gridmap/register_types.cpp
+++ b/modules/gridmap/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/gridmap/register_types.h b/modules/gridmap/register_types.h
index cc7c13961a..1978353fc3 100644
--- a/modules/gridmap/register_types.h
+++ b/modules/gridmap/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/hdr/SCsub b/modules/hdr/SCsub
new file mode 100644
index 0000000000..c960e8126b
--- /dev/null
+++ b/modules/hdr/SCsub
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+
+Import('env')
+Import('env_modules')
+
+env_hdr = env_modules.Clone()
+
+# Godot's own source files
+env_hdr.add_source_files(env.modules_sources, "*.cpp")
diff --git a/modules/etc1/config.py b/modules/hdr/config.py
index fb920482f5..fb920482f5 100644
--- a/modules/etc1/config.py
+++ b/modules/hdr/config.py
diff --git a/modules/hdr/image_loader_hdr.cpp b/modules/hdr/image_loader_hdr.cpp
new file mode 100644
index 0000000000..19df27b962
--- /dev/null
+++ b/modules/hdr/image_loader_hdr.cpp
@@ -0,0 +1,161 @@
+/*************************************************************************/
+/* image_loader_jpegd.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "image_loader_hdr.h"
+
+#include "os/os.h"
+#include "print_string.h"
+
+#include "thirdparty/tinyexr/tinyexr.h"
+
+Error ImageLoaderHDR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear) {
+
+ String header = f->get_token();
+
+ print_line("HEADER: " + header);
+ ERR_FAIL_COND_V(header != "#?RADIANCE" && header != "#?RGBE", ERR_FILE_UNRECOGNIZED);
+
+ while (true) {
+ String format = f->get_token();
+ ERR_FAIL_COND_V(f->eof_reached(), ERR_FILE_UNRECOGNIZED);
+ if (format.begins_with("FORMAT=") && format != "FORMAT=32-bit_rle_rgbe") {
+ ERR_EXPLAIN("Only 32-bit_rle_rgbe is supported for .hdr files.");
+ return ERR_FILE_UNRECOGNIZED;
+ }
+ if (format == "FORMAT=32-bit_rle_rgbe")
+ break;
+ }
+
+ String token = f->get_token();
+
+ ERR_FAIL_COND_V(token != "-Y", ERR_FILE_CORRUPT);
+
+ int height = f->get_token().to_int();
+
+ token = f->get_token();
+
+ ERR_FAIL_COND_V(token != "+X", ERR_FILE_CORRUPT);
+
+ int width = f->get_line().to_int();
+
+ print_line("HDR w: " + itos(width) + " h:" + itos(height));
+
+ PoolVector<uint8_t> imgdata;
+
+ imgdata.resize(height * width * sizeof(uint32_t));
+
+ {
+
+ PoolVector<uint8_t>::Write w = imgdata.write();
+
+ uint8_t *ptr = (uint8_t *)w.ptr();
+
+ if (width < 8 || width >= 32768) {
+ // Read flat data
+
+ f->get_buffer(ptr, width * height * 4);
+ } else {
+ // Read RLE-encoded data
+
+ for (int j = 0; j < height; ++j) {
+ int c1 = f->get_8();
+ int c2 = f->get_8();
+ int len = f->get_8();
+ if (c1 != 2 || c2 != 2 || (len & 0x80)) {
+ // not run-length encoded, so we have to actually use THIS data as a decoded
+ // pixel (note this can't be a valid pixel--one of RGB must be >= 128)
+
+ ptr[(j * width) * 4 + 0] = uint8_t(c1);
+ ptr[(j * width) * 4 + 1] = uint8_t(c2);
+ ptr[(j * width) * 4 + 2] = uint8_t(len);
+ ptr[(j * width) * 4 + 3] = f->get_8();
+
+ f->get_buffer(&ptr[(j * width + 1) * 4], (width - 1) * 4);
+ continue;
+ }
+ len <<= 8;
+ len |= f->get_8();
+
+ print_line("line: " + itos(len));
+ if (len != width) {
+ ERR_EXPLAIN("invalid decoded scanline length, corrupt HDR");
+ ERR_FAIL_V(ERR_FILE_CORRUPT);
+ }
+
+ for (int k = 0; k < 4; ++k) {
+ int i = 0;
+ while (i < width) {
+ int count = f->get_8();
+ if (count > 128) {
+ // Run
+ int value = f->get_8();
+ count -= 128;
+ for (int z = 0; z < count; ++z)
+ ptr[(j * width + i++) * 4 + k] = uint8_t(value);
+ } else {
+ // Dump
+ for (int z = 0; z < count; ++z)
+ ptr[(j * width + i++) * 4 + k] = f->get_8();
+ }
+ }
+ }
+ }
+ }
+
+ //convert
+ for (int i = 0; i < width * height; i++) {
+
+ float exp = pow(2.0f, ptr[3] - 128.0f);
+
+ Color c(
+ ptr[0] * exp / 255.0,
+ ptr[1] * exp / 255.0,
+ ptr[2] * exp / 255.0);
+
+ if (p_force_linear) {
+ c = c.to_linear();
+ }
+
+ *(uint32_t *)ptr = c.to_rgbe9995();
+ ptr += 4;
+ }
+ }
+
+ p_image->create(width, height, false, Image::FORMAT_RGBE9995, imgdata);
+
+ return OK;
+}
+
+void ImageLoaderHDR::get_recognized_extensions(List<String> *p_extensions) const {
+
+ p_extensions->push_back("hdr");
+}
+
+ImageLoaderHDR::ImageLoaderHDR() {
+}
diff --git a/scene/3d/test_cube.h b/modules/hdr/image_loader_hdr.h
index d03bea7b68..127833ebd0 100644
--- a/scene/3d/test_cube.h
+++ b/modules/hdr/image_loader_hdr.h
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* test_cube.h */
+/* image_loader_jpegd.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,27 +27,20 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef TEST_CUBE_H
-#define TEST_CUBE_H
+#ifndef IMAGE_LOADER_HDR_H
+#define IMAGE_LOADER_HDR_H
-#include "rid.h"
-#include "scene/3d/visual_instance.h"
+#include "io/image_loader.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
-class TestCube : public GeometryInstance {
-
- GDCLASS(TestCube, GeometryInstance);
-
- RID instance;
+class ImageLoaderHDR : public ImageFormatLoader {
public:
- virtual Rect3 get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
-
- TestCube();
- ~TestCube();
+ virtual Error load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear);
+ virtual void get_recognized_extensions(List<String> *p_extensions) const;
+ ImageLoaderHDR();
};
#endif
diff --git a/scene/3d/test_cube.cpp b/modules/hdr/register_types.cpp
index bab1d1e1c8..e4f7c14aa7 100644
--- a/scene/3d/test_cube.cpp
+++ b/modules/hdr/register_types.cpp
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* test_cube.cpp */
+/* register_types.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,22 +27,19 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "test_cube.h"
-#include "servers/visual_server.h"
+#include "register_types.h"
-Rect3 TestCube::get_aabb() const {
+#include "image_loader_hdr.h"
- return Rect3(Vector3(-1, -1, -1), Vector3(2, 2, 2));
-}
-PoolVector<Face3> TestCube::get_faces(uint32_t p_usage_flags) const {
-
- return PoolVector<Face3>();
-}
+static ImageLoaderHDR *image_loader_hdr = NULL;
-TestCube::TestCube() {
+void register_hdr_types() {
- set_base(VisualServer::get_singleton()->get_test_cube());
+ image_loader_hdr = memnew(ImageLoaderHDR);
+ ImageLoader::add_image_format_loader(image_loader_hdr);
}
-TestCube::~TestCube() {
+void unregister_hdr_types() {
+
+ memdelete(image_loader_hdr);
}
diff --git a/modules/cscript/register_types.h b/modules/hdr/register_types.h
index 6614ee3a19..3d901ea003 100644
--- a/modules/cscript/register_types.h
+++ b/modules/hdr/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,5 +27,5 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-void register_cscript_types();
-void unregister_cscript_types();
+void register_hdr_types();
+void unregister_hdr_types();
diff --git a/modules/jpg/image_loader_jpegd.cpp b/modules/jpg/image_loader_jpegd.cpp
index ca928c4fe6..8c73b69f1b 100644
--- a/modules/jpg/image_loader_jpegd.cpp
+++ b/modules/jpg/image_loader_jpegd.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -88,7 +89,7 @@ Error jpeg_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p
return OK;
}
-Error ImageLoaderJPG::load_image(Image *p_image, FileAccess *f) {
+Error ImageLoaderJPG::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear) {
PoolVector<uint8_t> src_image;
int src_image_len = f->get_len();
@@ -101,7 +102,7 @@ Error ImageLoaderJPG::load_image(Image *p_image, FileAccess *f) {
f->close();
- Error err = jpeg_load_image_from_buffer(p_image, w.ptr(), src_image_len);
+ Error err = jpeg_load_image_from_buffer(p_image.ptr(), w.ptr(), src_image_len);
w = PoolVector<uint8_t>::Write();
@@ -114,10 +115,11 @@ void ImageLoaderJPG::get_recognized_extensions(List<String> *p_extensions) const
p_extensions->push_back("jpeg");
}
-static Image _jpegd_mem_loader_func(const uint8_t *p_png, int p_size) {
+static Ref<Image> _jpegd_mem_loader_func(const uint8_t *p_png, int p_size) {
- Image img;
- Error err = jpeg_load_image_from_buffer(&img, p_png, p_size);
+ Ref<Image> img;
+ img.instance();
+ Error err = jpeg_load_image_from_buffer(img.ptr(), p_png, p_size);
if (err)
ERR_PRINT("Couldn't initialize ImageLoaderJPG with the given resource.");
diff --git a/modules/jpg/image_loader_jpegd.h b/modules/jpg/image_loader_jpegd.h
index 0803cfba1e..aa073b493d 100644
--- a/modules/jpg/image_loader_jpegd.h
+++ b/modules/jpg/image_loader_jpegd.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,7 +38,7 @@
class ImageLoaderJPG : public ImageFormatLoader {
public:
- virtual Error load_image(Image *p_image, FileAccess *f);
+ virtual Error load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear);
virtual void get_recognized_extensions(List<String> *p_extensions) const;
ImageLoaderJPG();
};
diff --git a/modules/jpg/register_types.cpp b/modules/jpg/register_types.cpp
index ce0330643a..2379bee0df 100644
--- a/modules/jpg/register_types.cpp
+++ b/modules/jpg/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/jpg/register_types.h b/modules/jpg/register_types.h
index 62132bf461..c14f860742 100644
--- a/modules/jpg/register_types.h
+++ b/modules/jpg/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/nativescript/SCsub b/modules/nativescript/SCsub
new file mode 100644
index 0000000000..e980e40e8e
--- /dev/null
+++ b/modules/nativescript/SCsub
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+Import('env')
+
+mod_env = env.Clone()
+mod_env.add_source_files(env.modules_sources, "*.cpp")
+mod_env.Append(CPPPATH='#modules/gdnative')
+mod_env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN'])
+
+Export('mod_env')
diff --git a/modules/nativescript/api_generator.cpp b/modules/nativescript/api_generator.cpp
new file mode 100644
index 0000000000..47162bfc49
--- /dev/null
+++ b/modules/nativescript/api_generator.cpp
@@ -0,0 +1,444 @@
+/*************************************************************************/
+/* api_generator.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "api_generator.h"
+
+#ifdef TOOLS_ENABLED
+
+#include "class_db.h"
+#include "core/global_constants.h"
+#include "core/project_settings.h"
+#include "os/file_access.h"
+
+// helper stuff
+
+static Error save_file(const String &p_path, const List<String> &p_content) {
+
+ FileAccessRef file = FileAccess::open(p_path, FileAccess::WRITE);
+
+ ERR_FAIL_COND_V(!file, ERR_FILE_CANT_WRITE);
+
+ for (const List<String>::Element *e = p_content.front(); e != NULL; e = e->next()) {
+ file->store_string(e->get());
+ }
+
+ file->close();
+
+ return OK;
+}
+
+// helper stuff end
+
+struct MethodAPI {
+ String method_name;
+ String return_type;
+
+ List<String> argument_types;
+ List<String> argument_names;
+
+ Map<int, Variant> default_arguments;
+
+ int argument_count;
+ bool has_varargs;
+ bool is_editor;
+ bool is_noscript;
+ bool is_const;
+ bool is_reverse;
+ bool is_virtual;
+ bool is_from_script;
+};
+
+struct PropertyAPI {
+ String name;
+ String getter;
+ String setter;
+ String type;
+};
+
+struct ConstantAPI {
+ String constant_name;
+ int constant_value;
+};
+
+struct SignalAPI {
+ String name;
+ List<String> argument_types;
+ List<String> argument_names;
+ Map<int, Variant> default_arguments;
+};
+
+struct ClassAPI {
+ String class_name;
+ String super_class_name;
+
+ ClassDB::APIType api_type;
+
+ bool is_singleton;
+ bool is_instanciable;
+ // @Unclear
+ bool is_creatable;
+ bool is_reference;
+
+ List<MethodAPI> methods;
+ List<PropertyAPI> properties;
+ List<ConstantAPI> constants;
+ List<SignalAPI> signals_;
+};
+
+/*
+ * Reads the entire Godot API to a list
+ */
+List<ClassAPI> generate_c_api_classes() {
+
+ List<ClassAPI> api;
+
+ List<StringName> classes;
+ ClassDB::get_class_list(&classes);
+
+ // Register global constants as a fake GlobalConstants singleton class
+ {
+ ClassAPI global_constants_api;
+ global_constants_api.class_name = L"GlobalConstants";
+ global_constants_api.api_type = ClassDB::API_CORE;
+ global_constants_api.is_singleton = true;
+ global_constants_api.is_instanciable = false;
+ const int constants_count = GlobalConstants::get_global_constant_count();
+ for (int i = 0; i < constants_count; ++i) {
+ ConstantAPI constant_api;
+ constant_api.constant_name = GlobalConstants::get_global_constant_name(i);
+ constant_api.constant_value = GlobalConstants::get_global_constant_value(i);
+ global_constants_api.constants.push_back(constant_api);
+ }
+ api.push_back(global_constants_api);
+ }
+
+ for (List<StringName>::Element *e = classes.front(); e != NULL; e = e->next()) {
+ StringName class_name = e->get();
+
+ ClassAPI class_api;
+ class_api.api_type = ClassDB::get_api_type(e->get());
+ class_api.class_name = class_name;
+ class_api.super_class_name = ClassDB::get_parent_class(class_name);
+ {
+ String name = class_name;
+ if (name.begins_with("_")) {
+ name.remove(0);
+ }
+ class_api.is_singleton = ProjectSettings::get_singleton()->has_singleton(name);
+ }
+ class_api.is_instanciable = !class_api.is_singleton && ClassDB::can_instance(class_name);
+
+ {
+ bool is_reference = false;
+ List<StringName> inheriters;
+ ClassDB::get_inheriters_from_class("Reference", &inheriters);
+ is_reference = !!inheriters.find(class_name);
+ // @Unclear
+ class_api.is_reference = !class_api.is_singleton && is_reference;
+ }
+
+ // constants
+ {
+ List<String> constant;
+ ClassDB::get_integer_constant_list(class_name, &constant, true);
+ for (List<String>::Element *c = constant.front(); c != NULL; c = c->next()) {
+ ConstantAPI constant_api;
+ constant_api.constant_name = c->get();
+ constant_api.constant_value = ClassDB::get_integer_constant(class_name, c->get());
+
+ class_api.constants.push_back(constant_api);
+ }
+ }
+
+ // signals
+ {
+ List<MethodInfo> signals_;
+ ClassDB::get_signal_list(class_name, &signals_, true);
+
+ for (int i = 0; i < signals_.size(); i++) {
+ SignalAPI signal;
+
+ MethodInfo method_info = signals_[i];
+ signal.name = method_info.name;
+
+ for (int j = 0; j < method_info.arguments.size(); j++) {
+ PropertyInfo argument = method_info.arguments[j];
+ String type;
+ String name = argument.name;
+
+ if (argument.name.find(":") != -1) {
+ type = argument.name.get_slice(":", 1);
+ name = argument.name.get_slice(":", 0);
+ } else if (argument.hint == PROPERTY_HINT_RESOURCE_TYPE) {
+ type = argument.hint_string;
+ } else if (argument.type == Variant::NIL) {
+ type = "Variant";
+ } else {
+ type = Variant::get_type_name(argument.type);
+ }
+
+ signal.argument_names.push_back(name);
+ signal.argument_types.push_back(type);
+ }
+
+ Vector<Variant> default_arguments = method_info.default_arguments;
+
+ int default_start = signal.argument_names.size() - default_arguments.size();
+
+ for (int j = 0; j < default_arguments.size(); j++) {
+ signal.default_arguments[default_start + j] = default_arguments[j];
+ }
+
+ class_api.signals_.push_back(signal);
+ }
+ }
+
+ //properties
+ {
+ List<PropertyInfo> properties;
+ ClassDB::get_property_list(class_name, &properties, true);
+
+ for (List<PropertyInfo>::Element *p = properties.front(); p != NULL; p = p->next()) {
+ PropertyAPI property_api;
+
+ property_api.name = p->get().name;
+ property_api.getter = ClassDB::get_property_getter(class_name, p->get().name);
+ property_api.setter = ClassDB::get_property_setter(class_name, p->get().name);
+
+ if (p->get().name.find(":") != -1) {
+ property_api.type = p->get().name.get_slice(":", 1);
+ property_api.name = p->get().name.get_slice(":", 0);
+ } else if (p->get().hint == PROPERTY_HINT_RESOURCE_TYPE) {
+ property_api.type = p->get().hint_string;
+ } else if (p->get().type == Variant::NIL) {
+ property_api.type = "Variant";
+ } else {
+ property_api.type = Variant::get_type_name(p->get().type);
+ }
+
+ if (!property_api.setter.empty() || !property_api.getter.empty()) {
+ class_api.properties.push_back(property_api);
+ }
+ }
+ }
+
+ //methods
+ {
+ List<MethodInfo> methods;
+ ClassDB::get_method_list(class_name, &methods, true);
+
+ for (List<MethodInfo>::Element *m = methods.front(); m != NULL; m = m->next()) {
+ MethodAPI method_api;
+ MethodBind *method_bind = ClassDB::get_method(class_name, m->get().name);
+ MethodInfo &method_info = m->get();
+
+ //method name
+ method_api.method_name = m->get().name;
+ //method return type
+ if (method_bind && method_bind->get_return_type() != StringName()) {
+ method_api.return_type = method_bind->get_return_type();
+ } else if (method_api.method_name.find(":") != -1) {
+ method_api.return_type = method_api.method_name.get_slice(":", 1);
+ method_api.method_name = method_api.method_name.get_slice(":", 0);
+ } else if (m->get().return_val.type != Variant::NIL) {
+ method_api.return_type = m->get().return_val.hint == PROPERTY_HINT_RESOURCE_TYPE ? m->get().return_val.hint_string : Variant::get_type_name(m->get().return_val.type);
+ } else if (m->get().return_val.name != "") {
+ method_api.return_type = m->get().return_val.name;
+ } else {
+ method_api.return_type = "void";
+ }
+
+ method_api.argument_count = method_info.arguments.size();
+ method_api.has_varargs = method_bind && method_bind->is_vararg();
+
+ // Method flags
+ if (method_info.flags) {
+ const uint32_t flags = method_info.flags;
+ method_api.is_editor = flags & METHOD_FLAG_EDITOR;
+ method_api.is_noscript = flags & METHOD_FLAG_NOSCRIPT;
+ method_api.is_const = flags & METHOD_FLAG_CONST;
+ method_api.is_reverse = flags & METHOD_FLAG_REVERSE;
+ method_api.is_virtual = flags & METHOD_FLAG_VIRTUAL;
+ method_api.is_from_script = flags & METHOD_FLAG_FROM_SCRIPT;
+ }
+
+ method_api.is_virtual = method_api.is_virtual || method_api.method_name[0] == '_';
+
+ // method argument name and type
+
+ for (int i = 0; i < method_api.argument_count; i++) {
+ String arg_name;
+ String arg_type;
+ PropertyInfo arg_info = method_info.arguments[i];
+
+ arg_name = arg_info.name;
+
+ if (arg_info.name.find(":") != -1) {
+ arg_type = arg_info.name.get_slice(":", 1);
+ arg_name = arg_info.name.get_slice(":", 0);
+ } else if (arg_info.hint == PROPERTY_HINT_RESOURCE_TYPE) {
+ arg_type = arg_info.hint_string;
+ } else if (arg_info.type == Variant::NIL) {
+ arg_type = "Variant";
+ } else {
+ arg_type = Variant::get_type_name(arg_info.type);
+ }
+
+ method_api.argument_names.push_back(arg_name);
+ method_api.argument_types.push_back(arg_type);
+
+ if (method_bind && method_bind->has_default_argument(i)) {
+ method_api.default_arguments[i] = method_bind->get_default_argument(i);
+ }
+ }
+
+ class_api.methods.push_back(method_api);
+ }
+ }
+
+ api.push_back(class_api);
+ }
+
+ return api;
+}
+
+/*
+ * Generates the JSON source from the API in p_api
+ */
+static List<String> generate_c_api_json(const List<ClassAPI> &p_api) {
+
+ // I'm sorry for the \t mess
+
+ List<String> source;
+
+ source.push_back("[\n");
+
+ for (const List<ClassAPI>::Element *c = p_api.front(); c != NULL; c = c->next()) {
+ ClassAPI api = c->get();
+
+ source.push_back("\t{\n");
+
+ source.push_back("\t\t\"name\": \"" + api.class_name + "\",\n");
+ source.push_back("\t\t\"base_class\": \"" + api.super_class_name + "\",\n");
+ source.push_back(String("\t\t\"api_type\": \"") + (api.api_type == ClassDB::API_CORE ? "core" : (api.api_type == ClassDB::API_EDITOR ? "tools" : "none")) + "\",\n");
+ source.push_back(String("\t\t\"singleton\": ") + (api.is_singleton ? "true" : "false") + ",\n");
+ source.push_back(String("\t\t\"instanciable\": ") + (api.is_instanciable ? "true" : "false") + ",\n");
+ source.push_back(String("\t\t\"is_reference\": ") + (api.is_reference ? "true" : "false") + ",\n");
+ // @Unclear
+ // source.push_back(String("\t\t\"createable\": ") + (api.is_creatable ? "true" : "false") + ",\n");
+
+ source.push_back("\t\t\"constants\": {\n");
+ for (List<ConstantAPI>::Element *e = api.constants.front(); e; e = e->next()) {
+ source.push_back("\t\t\t\"" + e->get().constant_name + "\": " + String::num_int64(e->get().constant_value) + (e->next() ? "," : "") + "\n");
+ }
+ source.push_back("\t\t},\n");
+
+ source.push_back("\t\t\"properties\": [\n");
+ for (List<PropertyAPI>::Element *e = api.properties.front(); e; e = e->next()) {
+ source.push_back("\t\t\t{\n");
+ source.push_back("\t\t\t\t\"name\": \"" + e->get().name + "\",\n");
+ source.push_back("\t\t\t\t\"type\": \"" + e->get().type + "\",\n");
+ source.push_back("\t\t\t\t\"getter\": \"" + e->get().getter + "\",\n");
+ source.push_back("\t\t\t\t\"setter\": \"" + e->get().setter + "\"\n");
+ source.push_back(String("\t\t\t}") + (e->next() ? "," : "") + "\n");
+ }
+ source.push_back("\t\t],\n");
+
+ source.push_back("\t\t\"signals\": [\n");
+ for (List<SignalAPI>::Element *e = api.signals_.front(); e; e = e->next()) {
+ source.push_back("\t\t\t{\n");
+ source.push_back("\t\t\t\t\"name\": \"" + e->get().name + "\",\n");
+ source.push_back("\t\t\t\t\"arguments\": [\n");
+ for (int i = 0; i < e->get().argument_names.size(); i++) {
+ source.push_back("\t\t\t\t\t{\n");
+ source.push_back("\t\t\t\t\t\t\"name\": \"" + e->get().argument_names[i] + "\",\n");
+ source.push_back("\t\t\t\t\t\t\"type\": \"" + e->get().argument_types[i] + "\",\n");
+ source.push_back("\t\t\t\t\t\t\"default_value\": \"" + (e->get().default_arguments.has(i) ? (String)e->get().default_arguments[i] : "") + "\"\n");
+ source.push_back(String("\t\t\t\t\t}") + ((i < e->get().argument_names.size() - 1) ? "," : "") + "\n");
+ }
+ source.push_back("\t\t\t\t]\n");
+ source.push_back(String("\t\t\t}") + (e->next() ? "," : "") + "\n");
+ }
+ source.push_back("\t\t],\n");
+
+ source.push_back("\t\t\"methods\": [\n");
+ for (List<MethodAPI>::Element *e = api.methods.front(); e; e = e->next()) {
+ source.push_back("\t\t\t{\n");
+ source.push_back("\t\t\t\t\"name\": \"" + e->get().method_name + "\",\n");
+ source.push_back("\t\t\t\t\"return_type\": \"" + e->get().return_type + "\",\n");
+ source.push_back(String("\t\t\t\t\"is_editor\": ") + (e->get().is_editor ? "true" : "false") + ",\n");
+ source.push_back(String("\t\t\t\t\"is_noscript\": ") + (e->get().is_noscript ? "true" : "false") + ",\n");
+ source.push_back(String("\t\t\t\t\"is_const\": ") + (e->get().is_const ? "true" : "false") + ",\n");
+ source.push_back(String("\t\t\t\t\"is_reverse\": ") + (e->get().is_reverse ? "true" : "false") + ",\n");
+ source.push_back(String("\t\t\t\t\"is_virtual\": ") + (e->get().is_virtual ? "true" : "false") + ",\n");
+ source.push_back(String("\t\t\t\t\"has_varargs\": ") + (e->get().has_varargs ? "true" : "false") + ",\n");
+ source.push_back(String("\t\t\t\t\"is_from_script\": ") + (e->get().is_from_script ? "true" : "false") + ",\n");
+ source.push_back("\t\t\t\t\"arguments\": [\n");
+ for (int i = 0; i < e->get().argument_names.size(); i++) {
+ source.push_back("\t\t\t\t\t{\n");
+ source.push_back("\t\t\t\t\t\t\"name\": \"" + e->get().argument_names[i] + "\",\n");
+ source.push_back("\t\t\t\t\t\t\"type\": \"" + e->get().argument_types[i] + "\",\n");
+ source.push_back(String("\t\t\t\t\t\t\"has_default_value\": ") + (e->get().default_arguments.has(i) ? "true" : "false") + ",\n");
+ source.push_back("\t\t\t\t\t\t\"default_value\": \"" + (e->get().default_arguments.has(i) ? (String)e->get().default_arguments[i] : "") + "\"\n");
+ source.push_back(String("\t\t\t\t\t}") + ((i < e->get().argument_names.size() - 1) ? "," : "") + "\n");
+ }
+ source.push_back("\t\t\t\t]\n");
+ source.push_back(String("\t\t\t}") + (e->next() ? "," : "") + "\n");
+ }
+ source.push_back("\t\t]\n");
+
+ source.push_back(String("\t}") + (c->next() ? "," : "") + "\n");
+ }
+
+ source.push_back("]");
+
+ return source;
+}
+
+//
+
+#endif
+
+/*
+ * Saves the whole Godot API to a JSON file located at
+ * p_path
+ */
+Error generate_c_api(const String &p_path) {
+
+#ifndef TOOLS_ENABLED
+ return ERR_BUG;
+#else
+
+ List<ClassAPI> api = generate_c_api_classes();
+
+ List<String> json_source = generate_c_api_json(api);
+
+ return save_file(p_path, json_source);
+#endif
+}
diff --git a/platform/osx/godot_osx.h b/modules/nativescript/api_generator.h
index b6f2b06f26..a108d7a7b6 100644
--- a/platform/osx/godot_osx.h
+++ b/modules/nativescript/api_generator.h
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* godot_osx.h */
+/* api_generator.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,12 +27,12 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef GODOT_OSX_H
-#define GODOT_OSX_H
+#ifndef API_GENERATOR_H
+#define API_GENERATOR_H
-#import <Cocoa/Cocoa.h>
+#include "core/ustring.h"
+#include "typedefs.h"
-@interface GodotMain : NSObject
-@end
+Error generate_c_api(const String &p_path);
-#endif
+#endif // API_GENERATOR_H
diff --git a/modules/nativescript/config.py b/modules/nativescript/config.py
new file mode 100644
index 0000000000..9f57b9bb74
--- /dev/null
+++ b/modules/nativescript/config.py
@@ -0,0 +1,8 @@
+
+
+def can_build(platform):
+ return True
+
+
+def configure(env):
+ env.use_ptrcall = True
diff --git a/modules/nativescript/godot_nativescript.cpp b/modules/nativescript/godot_nativescript.cpp
new file mode 100644
index 0000000000..453cee3a18
--- /dev/null
+++ b/modules/nativescript/godot_nativescript.cpp
@@ -0,0 +1,205 @@
+/*************************************************************************/
+/* godot_nativescript.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_nativescript.h"
+
+#include "nativescript.h"
+
+#include "class_db.h"
+#include "error_macros.h"
+#include "gdnative.h"
+#include "global_constants.h"
+#include "project_settings.h"
+#include "variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern "C" void _native_script_hook() {
+}
+
+#define NSL NativeScriptLanguage::get_singleton()
+
+// Script API
+
+void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func) {
+
+ String *s = (String *)p_gdnative_handle;
+
+ Map<StringName, NativeScriptDesc> *classes = &NSL->library_classes[*s];
+
+ NativeScriptDesc desc;
+
+ desc.create_func = p_create_func;
+ desc.destroy_func = p_destroy_func;
+ desc.is_tool = false;
+
+ desc.base = p_base;
+
+ if (classes->has(p_base)) {
+ desc.base_data = &(*classes)[p_base];
+ desc.base_native_type = desc.base_data->base_native_type;
+ } else {
+ desc.base_data = NULL;
+ desc.base_native_type = p_base;
+ }
+
+ classes->insert(p_name, desc);
+}
+
+void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func) {
+
+ String *s = (String *)p_gdnative_handle;
+
+ Map<StringName, NativeScriptDesc> *classes = &NSL->library_classes[*s];
+
+ NativeScriptDesc desc;
+
+ desc.create_func = p_create_func;
+ desc.destroy_func = p_destroy_func;
+ desc.is_tool = true;
+ desc.base = p_base;
+
+ if (classes->has(p_base)) {
+ desc.base_data = &(*classes)[p_base];
+ desc.base_native_type = desc.base_data->base_native_type;
+ } else {
+ desc.base_data = NULL;
+ desc.base_native_type = p_base;
+ }
+
+ classes->insert(p_name, desc);
+}
+
+void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_method_attributes p_attr, godot_instance_method p_method) {
+
+ String *s = (String *)p_gdnative_handle;
+
+ Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name);
+
+ if (!E) {
+ ERR_EXPLAIN("Attempt to register method on non-existant class!");
+ ERR_FAIL();
+ }
+
+ NativeScriptDesc::Method method;
+ method.method = p_method;
+ method.rpc_mode = p_attr.rpc_type;
+ method.info = MethodInfo(p_function_name);
+
+ E->get().methods.insert(p_function_name, method);
+}
+
+void GDAPI godot_nativescript_register_property(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_property_attributes *p_attr, godot_property_set_func p_set_func, godot_property_get_func p_get_func) {
+
+ String *s = (String *)p_gdnative_handle;
+
+ Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name);
+
+ if (!E) {
+ ERR_EXPLAIN("Attempt to register method on non-existant class!");
+ ERR_FAIL();
+ }
+
+ NativeScriptDesc::Property property;
+ property.default_value = *(Variant *)&p_attr->default_value;
+ property.getter = p_get_func;
+ property.rset_mode = p_attr->rset_type;
+ property.setter = p_set_func;
+ property.info = PropertyInfo((Variant::Type)p_attr->type,
+ p_path,
+ (PropertyHint)p_attr->hint,
+ *(String *)&p_attr->hint_string,
+ (PropertyUsageFlags)p_attr->usage);
+
+ E->get().properties.insert(p_path, property);
+}
+
+void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const char *p_name, const godot_signal *p_signal) {
+
+ String *s = (String *)p_gdnative_handle;
+
+ Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name);
+
+ if (!E) {
+ ERR_EXPLAIN("Attempt to register method on non-existant class!");
+ ERR_FAIL();
+ }
+
+ List<PropertyInfo> args;
+ Vector<Variant> default_args;
+
+ for (int i = 0; i < p_signal->num_args; i++) {
+ PropertyInfo info;
+
+ godot_signal_argument arg = p_signal->args[i];
+
+ info.hint = (PropertyHint)arg.hint;
+ info.hint_string = *(String *)&arg.hint_string;
+ info.name = *(String *)&arg.name;
+ info.type = (Variant::Type)arg.type;
+ info.usage = (PropertyUsageFlags)arg.usage;
+
+ args.push_back(info);
+ }
+
+ for (int i = 0; i < p_signal->num_default_args; i++) {
+ Variant *v;
+ godot_signal_argument attrib = p_signal->args[i];
+
+ v = (Variant *)&attrib.default_value;
+
+ default_args.push_back(*v);
+ }
+
+ MethodInfo method_info;
+ method_info.name = *(String *)&p_signal->name;
+ method_info.arguments = args;
+ method_info.default_arguments = default_args;
+
+ NativeScriptDesc::Signal signal;
+ signal.signal = method_info;
+
+ E->get().signals_.insert(*(String *)&p_signal->name, signal);
+}
+
+void GDAPI *godot_nativescript_get_userdata(godot_object *p_instance) {
+ Object *instance = (Object *)p_instance;
+ if (!instance)
+ return NULL;
+ if (instance->get_script_instance() && instance->get_script_instance()->get_language() == NativeScriptLanguage::get_singleton()) {
+ return ((NativeScriptInstance *)instance->get_script_instance())->userdata;
+ }
+ return NULL;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/nativescript/godot_nativescript.h b/modules/nativescript/godot_nativescript.h
new file mode 100644
index 0000000000..cfd445086b
--- /dev/null
+++ b/modules/nativescript/godot_nativescript.h
@@ -0,0 +1,227 @@
+/*************************************************************************/
+/* godot.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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_NATIVESCRIPT_H
+#define GODOT_NATIVESCRIPT_H
+
+#include <godot/gdnative.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef GDAPI_BUILT_IN
+#define GDAPI_EXPORT
+#endif
+
+#ifdef _WIN32
+#if defined(GDAPI_EXPORT)
+#define GDCALLINGCONV
+#define GDAPI __declspec(dllexport) GDCALLINGCONV
+#else
+#define GDCALLINGCONV
+#define GDAPI __declspec(dllimport) GDCALLINGCONV
+#endif
+#elif defined(__APPLE__)
+#include "TargetConditionals.h"
+#if TARGET_OS_IPHONE
+#define GDCALLINGCONV
+#define GDAPI
+#elif TARGET_OS_MAC
+#define GDCALLINGCONV __attribute__((sysv_abi))
+#define GDAPI GDCALLINGCONV
+#endif
+#else
+#define GDCALLINGCONV __attribute__((sysv_abi))
+#define GDAPI GDCALLINGCONV
+#endif
+
+// This is for libraries *using* the header, NOT GODOT EXPOSING STUFF!!
+#ifdef _WIN32
+#define GDN_EXPORT __declspec(dllexport)
+#else
+#define GDN_EXPORT
+#endif
+
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef enum {
+ GODOT_METHOD_RPC_MODE_DISABLED,
+ GODOT_METHOD_RPC_MODE_REMOTE,
+ GODOT_METHOD_RPC_MODE_SYNC,
+ GODOT_METHOD_RPC_MODE_MASTER,
+ GODOT_METHOD_RPC_MODE_SLAVE,
+} godot_method_rpc_mode;
+
+typedef enum {
+ GODOT_PROPERTY_HINT_NONE, ///< no hint provided.
+ GODOT_PROPERTY_HINT_RANGE, ///< hint_text = "min,max,step,slider; //slider is optional"
+ GODOT_PROPERTY_HINT_EXP_RANGE, ///< hint_text = "min,max,step", exponential edit
+ GODOT_PROPERTY_HINT_ENUM, ///< hint_text= "val1,val2,val3,etc"
+ GODOT_PROPERTY_HINT_EXP_EASING, /// exponential easing funciton (Math::ease)
+ GODOT_PROPERTY_HINT_LENGTH, ///< hint_text= "length" (as integer)
+ GODOT_PROPERTY_HINT_SPRITE_FRAME,
+ GODOT_PROPERTY_HINT_KEY_ACCEL, ///< hint_text= "length" (as integer)
+ GODOT_PROPERTY_HINT_FLAGS, ///< hint_text= "flag1,flag2,etc" (as bit flags)
+ GODOT_PROPERTY_HINT_LAYERS_2D_RENDER,
+ GODOT_PROPERTY_HINT_LAYERS_2D_PHYSICS,
+ GODOT_PROPERTY_HINT_LAYERS_3D_RENDER,
+ GODOT_PROPERTY_HINT_LAYERS_3D_PHYSICS,
+ GODOT_PROPERTY_HINT_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,"
+ GODOT_PROPERTY_HINT_DIR, ///< a directort path must be passed
+ GODOT_PROPERTY_HINT_GLOBAL_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,"
+ GODOT_PROPERTY_HINT_GLOBAL_DIR, ///< a directort path must be passed
+ GODOT_PROPERTY_HINT_RESOURCE_TYPE, ///< a resource object type
+ GODOT_PROPERTY_HINT_MULTILINE_TEXT, ///< used for string properties that can contain multiple lines
+ GODOT_PROPERTY_HINT_COLOR_NO_ALPHA, ///< used for ignoring alpha component when editing a color
+ GODOT_PROPERTY_HINT_IMAGE_COMPRESS_LOSSY,
+ GODOT_PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS,
+ GODOT_PROPERTY_HINT_OBJECT_ID,
+ GODOT_PROPERTY_HINT_TYPE_STRING, ///< a type string, the hint is the base type to choose
+ GODOT_PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE, ///< so something else can provide this (used in scripts)
+ GODOT_PROPERTY_HINT_METHOD_OF_VARIANT_TYPE, ///< a method of a type
+ GODOT_PROPERTY_HINT_METHOD_OF_BASE_TYPE, ///< a method of a base type
+ GODOT_PROPERTY_HINT_METHOD_OF_INSTANCE, ///< a method of an instance
+ GODOT_PROPERTY_HINT_METHOD_OF_SCRIPT, ///< a method of a script & base
+ GODOT_PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE, ///< a property of a type
+ GODOT_PROPERTY_HINT_PROPERTY_OF_BASE_TYPE, ///< a property of a base type
+ GODOT_PROPERTY_HINT_PROPERTY_OF_INSTANCE, ///< a property of an instance
+ GODOT_PROPERTY_HINT_PROPERTY_OF_SCRIPT, ///< a property of a script & base
+ GODOT_PROPERTY_HINT_MAX,
+} godot_property_hint;
+
+typedef enum {
+
+ GODOT_PROPERTY_USAGE_STORAGE = 1,
+ GODOT_PROPERTY_USAGE_EDITOR = 2,
+ GODOT_PROPERTY_USAGE_NETWORK = 4,
+ GODOT_PROPERTY_USAGE_EDITOR_HELPER = 8,
+ GODOT_PROPERTY_USAGE_CHECKABLE = 16, //used for editing global variables
+ GODOT_PROPERTY_USAGE_CHECKED = 32, //used for editing global variables
+ GODOT_PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings
+ GODOT_PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor
+ GODOT_PROPERTY_USAGE_CATEGORY = 256,
+ GODOT_PROPERTY_USAGE_STORE_IF_NONZERO = 512, //only store if nonzero
+ GODOT_PROPERTY_USAGE_STORE_IF_NONONE = 1024, //only store if false
+ GODOT_PROPERTY_USAGE_NO_INSTANCE_STATE = 2048,
+ GODOT_PROPERTY_USAGE_RESTART_IF_CHANGED = 4096,
+ GODOT_PROPERTY_USAGE_SCRIPT_VARIABLE = 8192,
+ GODOT_PROPERTY_USAGE_STORE_IF_NULL = 16384,
+ GODOT_PROPERTY_USAGE_ANIMATE_AS_TRIGGER = 32768,
+ GODOT_PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED = 65536,
+
+ GODOT_PROPERTY_USAGE_DEFAULT = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_EDITOR | GODOT_PROPERTY_USAGE_NETWORK,
+ GODOT_PROPERTY_USAGE_DEFAULT_INTL = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_EDITOR | GODOT_PROPERTY_USAGE_NETWORK | GODOT_PROPERTY_USAGE_INTERNATIONALIZED,
+ GODOT_PROPERTY_USAGE_NOEDITOR = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_NETWORK,
+} godot_property_usage_flags;
+
+typedef struct {
+ godot_method_rpc_mode rset_type;
+
+ godot_int type;
+ godot_property_hint hint;
+ godot_string hint_string;
+ godot_property_usage_flags usage;
+ godot_variant default_value;
+} godot_property_attributes;
+
+typedef struct {
+ // instance pointer, method_data - return user data
+ GDCALLINGCONV void *(*create_func)(godot_object *, void *);
+ void *method_data;
+ GDCALLINGCONV void (*free_func)(void *);
+} godot_instance_create_func;
+
+typedef struct {
+ // instance pointer, method data, user data
+ GDCALLINGCONV void (*destroy_func)(godot_object *, void *, void *);
+ void *method_data;
+ GDCALLINGCONV void (*free_func)(void *);
+} godot_instance_destroy_func;
+
+void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func);
+
+void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func);
+
+typedef struct {
+ godot_method_rpc_mode rpc_type;
+} godot_method_attributes;
+
+typedef struct {
+ // instance pointer, method data, user data, num args, args - return result as varaint
+ GDCALLINGCONV godot_variant (*method)(godot_object *, void *, void *, int, godot_variant **);
+ void *method_data;
+ GDCALLINGCONV void (*free_func)(void *);
+} godot_instance_method;
+
+void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_method_attributes p_attr, godot_instance_method p_method);
+
+typedef struct {
+ // instance pointer, method data, user data, value
+ GDCALLINGCONV void (*set_func)(godot_object *, void *, void *, godot_variant *);
+ void *method_data;
+ GDCALLINGCONV void (*free_func)(void *);
+} godot_property_set_func;
+
+typedef struct {
+ // instance pointer, method data, user data, value
+ GDCALLINGCONV godot_variant (*get_func)(godot_object *, void *, void *);
+ void *method_data;
+ GDCALLINGCONV void (*free_func)(void *);
+} godot_property_get_func;
+
+void GDAPI godot_nativescript_register_property(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_property_attributes *p_attr, godot_property_set_func p_set_func, godot_property_get_func p_get_func);
+
+typedef struct {
+ godot_string name;
+ godot_int type;
+ godot_property_hint hint;
+ godot_string hint_string;
+ godot_property_usage_flags usage;
+ godot_variant default_value;
+} godot_signal_argument;
+
+typedef struct {
+ godot_string name;
+ int num_args;
+ godot_signal_argument *args;
+ int num_default_args;
+ godot_variant *default_args;
+} godot_signal;
+
+void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const char *p_name, const godot_signal *p_signal);
+
+void GDAPI *godot_nativescript_get_userdata(godot_object *p_instance);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/modules/nativescript/nativescript.cpp b/modules/nativescript/nativescript.cpp
new file mode 100644
index 0000000000..d428834d59
--- /dev/null
+++ b/modules/nativescript/nativescript.cpp
@@ -0,0 +1,1213 @@
+/*************************************************************************/
+/* nativescript.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "nativescript.h"
+
+#include "modules/gdnative/godot/gdnative.h"
+
+#include "global_constants.h"
+#include "io/file_access_encrypted.h"
+#include "os/file_access.h"
+#include "os/os.h"
+#include "project_settings.h"
+
+#include "scene/main/scene_tree.h"
+#include "scene/resources/scene_format_text.h"
+
+#ifndef NO_THREADS
+#include "os/thread.h"
+#endif
+
+#if defined(TOOLS_ENABLED) && defined(DEBUG_METHODS_ENABLED)
+#include "api_generator.h"
+#endif
+
+#ifdef TOOLS_ENABLED
+#include "editor/editor_node.h"
+#endif
+
+////// Script stuff
+
+void NativeScript::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_class_name", "class_name"), &NativeScript::set_class_name);
+ ClassDB::bind_method(D_METHOD("get_class_name"), &NativeScript::get_class_name);
+
+ ClassDB::bind_method(D_METHOD("set_library", "library"), &NativeScript::set_library);
+ ClassDB::bind_method(D_METHOD("get_library"), &NativeScript::get_library);
+
+ ADD_PROPERTYNZ(PropertyInfo(Variant::STRING, "class_name"), "set_class_name", "get_class_name");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "library", PROPERTY_HINT_RESOURCE_TYPE, "GDNativeLibrary"), "set_library", "get_library");
+
+ ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "new", &NativeScript::_new, MethodInfo(Variant::OBJECT, "new"));
+}
+
+#define NSL NativeScriptLanguage::get_singleton()
+
+#ifdef TOOLS_ENABLED
+
+void NativeScript::_update_placeholder(PlaceHolderScriptInstance *p_placeholder) {
+ NativeScriptDesc *script_data = get_script_desc();
+
+ ERR_FAIL_COND(!script_data);
+
+ List<PropertyInfo> info;
+ get_script_property_list(&info);
+ Map<StringName, Variant> values;
+ for (List<PropertyInfo>::Element *E = info.front(); E; E = E->next()) {
+ Variant value;
+ get_property_default_value(E->get().name, value);
+ values[E->get().name] = value;
+ }
+
+ p_placeholder->update(info, values);
+}
+
+void NativeScript::_placeholder_erased(PlaceHolderScriptInstance *p_placeholder) {
+ placeholders.erase(p_placeholder);
+}
+
+#endif
+
+void NativeScript::set_class_name(String p_class_name) {
+ class_name = p_class_name;
+}
+
+String NativeScript::get_class_name() const {
+ return class_name;
+}
+
+void NativeScript::set_library(Ref<GDNativeLibrary> p_library) {
+ if (!library.is_null()) {
+ WARN_PRINT("library on NativeScript already set. Do nothing.");
+ return;
+ }
+ library = p_library;
+ lib_path = library->get_active_library_path();
+
+#ifndef NO_THREADS
+ if (Thread::get_caller_id() != Thread::get_main_id()) {
+ NSL->defer_init_library(p_library, this);
+ } else
+#endif
+ {
+ NSL->init_library(p_library);
+ NSL->register_script(this);
+ }
+}
+
+Ref<GDNativeLibrary> NativeScript::get_library() const {
+ return library;
+}
+
+bool NativeScript::can_instance() const {
+
+ NativeScriptDesc *script_data = get_script_desc();
+
+#ifdef TOOLS_ENABLED
+
+ return script_data || (!is_tool() && !ScriptServer::is_scripting_enabled());
+#else
+ return script_data;
+#endif
+}
+
+// TODO(karroffel): implement this
+Ref<Script> NativeScript::get_base_script() const {
+ NativeScriptDesc *script_data = get_script_desc();
+
+ if (!script_data)
+ return Ref<Script>();
+
+ Ref<NativeScript> ns = Ref<NativeScript>(NSL->create_script());
+ ns->set_class_name(script_data->base);
+ ns->set_library(get_library());
+ return ns;
+}
+
+StringName NativeScript::get_instance_base_type() const {
+ NativeScriptDesc *script_data = get_script_desc();
+
+ if (!script_data)
+ return "";
+
+ return script_data->base_native_type;
+}
+
+ScriptInstance *NativeScript::instance_create(Object *p_this) {
+
+ NativeScriptDesc *script_data = get_script_desc();
+
+ if (!script_data) {
+ return NULL;
+ }
+
+#ifdef TOOLS_ENABLED
+ if (!ScriptServer::is_scripting_enabled() && !is_tool()) {
+ // placeholder for nodes. For tools we want the rool thing.
+
+ PlaceHolderScriptInstance *sins = memnew(PlaceHolderScriptInstance(NSL, Ref<Script>(this), p_this));
+ placeholders.insert(sins);
+
+ if (script_data->create_func.create_func) {
+ script_data->create_func.create_func(
+ (godot_object *)p_this,
+ script_data->create_func.method_data);
+ }
+
+ _update_placeholder(sins);
+
+ return sins;
+ }
+#endif
+
+ NativeScriptInstance *nsi = memnew(NativeScriptInstance);
+
+ nsi->owner = p_this;
+ nsi->script = Ref<NativeScript>(this);
+
+#ifndef TOOLS_ENABLED
+ if (!ScriptServer::is_scripting_enabled()) {
+ nsi->userdata = NULL;
+ } else {
+ nsi->userdata = script_data->create_func.create_func((godot_object *)p_this, script_data->create_func.method_data);
+ }
+#else
+ nsi->userdata = script_data->create_func.create_func((godot_object *)p_this, script_data->create_func.method_data);
+#endif
+
+#ifndef NO_THREADS
+ owners_lock->lock();
+#endif
+
+ instance_owners.insert(p_this);
+
+#ifndef NO_THREADS
+ owners_lock->unlock();
+#endif
+
+ return nsi;
+}
+
+bool NativeScript::instance_has(const Object *p_this) const {
+ return instance_owners.has((Object *)p_this);
+}
+
+bool NativeScript::has_source_code() const {
+ return false;
+}
+
+String NativeScript::get_source_code() const {
+ return "";
+}
+
+void NativeScript::set_source_code(const String &p_code) {
+}
+
+Error NativeScript::reload(bool p_keep_state) {
+ return FAILED;
+}
+
+bool NativeScript::has_method(const StringName &p_method) const {
+ NativeScriptDesc *script_data = get_script_desc();
+
+ while (script_data) {
+ if (script_data->methods.has(p_method))
+ return true;
+
+ script_data = script_data->base_data;
+ }
+ return false;
+}
+
+MethodInfo NativeScript::get_method_info(const StringName &p_method) const {
+ NativeScriptDesc *script_data = get_script_desc();
+
+ if (!script_data)
+ return MethodInfo();
+
+ while (script_data) {
+ Map<StringName, NativeScriptDesc::Method>::Element *M = script_data->methods.find(p_method);
+
+ if (M)
+ return M->get().info;
+
+ script_data = script_data->base_data;
+ }
+ return MethodInfo();
+}
+
+bool NativeScript::is_tool() const {
+ NativeScriptDesc *script_data = get_script_desc();
+
+ if (script_data)
+ return script_data->is_tool;
+
+ return false;
+}
+
+String NativeScript::get_node_type() const {
+ return ""; // NOTE(karroffel): uhm?
+}
+
+ScriptLanguage *NativeScript::get_language() const {
+ return NativeScriptLanguage::get_singleton();
+}
+
+bool NativeScript::has_script_signal(const StringName &p_signal) const {
+ NativeScriptDesc *script_data = get_script_desc();
+
+ while (script_data) {
+ if (script_data->signals_.has(p_signal))
+ return true;
+ script_data = script_data->base_data;
+ }
+ return false;
+}
+
+void NativeScript::get_script_signal_list(List<MethodInfo> *r_signals) const {
+ NativeScriptDesc *script_data = get_script_desc();
+
+ if (!script_data)
+ return;
+
+ Set<MethodInfo> signals_;
+
+ while (script_data) {
+
+ for (Map<StringName, NativeScriptDesc::Signal>::Element *S = script_data->signals_.front(); S; S = S->next()) {
+ signals_.insert(S->get().signal);
+ }
+
+ script_data = script_data->base_data;
+ }
+
+ for (Set<MethodInfo>::Element *E = signals_.front(); E; E = E->next()) {
+ r_signals->push_back(E->get());
+ }
+}
+
+bool NativeScript::get_property_default_value(const StringName &p_property, Variant &r_value) const {
+ NativeScriptDesc *script_data = get_script_desc();
+
+ Map<StringName, NativeScriptDesc::Property>::Element *P = NULL;
+ while (!P && script_data) {
+ P = script_data->properties.find(p_property);
+ script_data = script_data->base_data;
+ }
+ if (!P)
+ return false;
+
+ r_value = P->get().default_value;
+ return true;
+}
+
+void NativeScript::update_exports() {
+}
+
+void NativeScript::get_script_method_list(List<MethodInfo> *p_list) const {
+ NativeScriptDesc *script_data = get_script_desc();
+
+ if (!script_data)
+ return;
+
+ Set<MethodInfo> methods;
+
+ while (script_data) {
+
+ for (Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.front(); E; E = E->next()) {
+ methods.insert(E->get().info);
+ }
+
+ script_data = script_data->base_data;
+ }
+
+ for (Set<MethodInfo>::Element *E = methods.front(); E; E = E->next()) {
+ p_list->push_back(E->get());
+ }
+}
+
+void NativeScript::get_script_property_list(List<PropertyInfo> *p_list) const {
+ NativeScriptDesc *script_data = get_script_desc();
+
+ if (!script_data)
+ return;
+
+ Set<PropertyInfo> properties;
+
+ while (script_data) {
+
+ for (Map<StringName, NativeScriptDesc::Property>::Element *E = script_data->properties.front(); E; E = E->next()) {
+ properties.insert(E->get().info);
+ }
+
+ script_data = script_data->base_data;
+ }
+
+ for (Set<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
+ p_list->push_back(E->get());
+ }
+}
+
+Variant NativeScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+
+ if (lib_path.empty() || class_name.empty() || library.is_null()) {
+ r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL;
+ return Variant();
+ }
+
+ NativeScriptDesc *script_data = get_script_desc();
+
+ if (!script_data) {
+ r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL;
+ return Variant();
+ }
+
+ r_error.error = Variant::CallError::CALL_OK;
+
+ REF ref;
+ Object *owner = NULL;
+
+ if (!(script_data->base_native_type == "")) {
+ owner = ClassDB::instance(script_data->base_native_type);
+ } else {
+ owner = memnew(Reference);
+ }
+
+ Reference *r = owner->cast_to<Reference>();
+ if (r) {
+ ref = REF(r);
+ }
+
+ NativeScriptInstance *instance = (NativeScriptInstance *)instance_create(owner);
+
+ owner->set_script_instance(instance);
+
+ if (!instance) {
+ if (ref.is_null()) {
+ memdelete(owner); //no owner, sorry
+ }
+ return Variant();
+ }
+
+ if (ref.is_valid()) {
+ return ref;
+ } else {
+ return owner;
+ }
+}
+
+// TODO(karroffel): implement this
+NativeScript::NativeScript() {
+ library = Ref<GDNative>();
+ lib_path = "";
+ class_name = "";
+#ifndef NO_THREADS
+ owners_lock = Mutex::create();
+#endif
+}
+
+// TODO(karroffel): implement this
+NativeScript::~NativeScript() {
+ NSL->unregister_script(this);
+
+#ifndef NO_THREADS
+ memdelete(owners_lock);
+#endif
+}
+
+////// ScriptInstance stuff
+
+#define GET_SCRIPT_DESC() script->get_script_desc()
+
+void NativeScriptInstance::_ml_call_reversed(NativeScriptDesc *script_data, const StringName &p_method, const Variant **p_args, int p_argcount) {
+ if (script_data->base_data) {
+ _ml_call_reversed(script_data->base_data, p_method, p_args, p_argcount);
+ }
+
+ Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.find(p_method);
+ if (E) {
+ godot_variant res = E->get().method.method((godot_object *)owner, E->get().method.method_data, userdata, p_argcount, (godot_variant **)p_args);
+ godot_variant_destroy(&res);
+ }
+}
+
+bool NativeScriptInstance::set(const StringName &p_name, const Variant &p_value) {
+ NativeScriptDesc *script_data = GET_SCRIPT_DESC();
+
+ while (script_data) {
+ Map<StringName, NativeScriptDesc::Property>::Element *P = script_data->properties.find(p_name);
+ if (P) {
+ P->get().setter.set_func((godot_object *)owner,
+ P->get().setter.method_data,
+ userdata,
+ (godot_variant *)&p_value);
+ return true;
+ }
+
+ Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.find("_set");
+ if (E) {
+ Variant name = p_name;
+ const Variant *args[2] = { &name, &p_value };
+
+ E->get().method.method((godot_object *)owner,
+ E->get().method.method_data,
+ userdata,
+ 2,
+ (godot_variant **)args);
+ return true;
+ }
+
+ script_data = script_data->base_data;
+ }
+ return false;
+}
+bool NativeScriptInstance::get(const StringName &p_name, Variant &r_ret) const {
+ NativeScriptDesc *script_data = GET_SCRIPT_DESC();
+
+ while (script_data) {
+ Map<StringName, NativeScriptDesc::Property>::Element *P = script_data->properties.find(p_name);
+ if (P) {
+ godot_variant value;
+ value = P->get().getter.get_func((godot_object *)owner,
+ P->get().getter.method_data,
+ userdata);
+ r_ret = *(Variant *)&value;
+ godot_variant_destroy(&value);
+ return true;
+ }
+
+ Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.find("_get");
+ if (E) {
+ Variant name = p_name;
+ const Variant *args[1] = { &name };
+
+ godot_variant result;
+ result = E->get().method.method((godot_object *)owner,
+ E->get().method.method_data,
+ userdata,
+ 1,
+ (godot_variant **)args);
+ r_ret = *(Variant *)&result;
+ godot_variant_destroy(&result);
+ if (r_ret.get_type() == Variant::NIL) {
+ return false;
+ }
+ return true;
+ }
+
+ script_data = script_data->base_data;
+ }
+ return false;
+}
+
+void NativeScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const {
+ script->get_script_property_list(p_properties);
+
+ NativeScriptDesc *script_data = GET_SCRIPT_DESC();
+
+ while (script_data) {
+
+ Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.find("_get_property_list");
+ if (E) {
+
+ godot_variant result;
+ result = E->get().method.method((godot_object *)owner,
+ E->get().method.method_data,
+ userdata,
+ 0,
+ NULL);
+ Variant res = *(Variant *)&result;
+ godot_variant_destroy(&result);
+
+ if (res.get_type() != Variant::ARRAY) {
+ ERR_EXPLAIN("_get_property_list must return an array of dictionaries");
+ ERR_FAIL();
+ }
+
+ Array arr = res;
+ for (int i = 0; i < arr.size(); i++) {
+ Dictionary d = arr[i];
+
+ ERR_CONTINUE(!d.has("name"));
+ ERR_CONTINUE(!d.has("type"));
+
+ PropertyInfo info;
+
+ info.type = Variant::Type(d["type"].operator int64_t());
+ ERR_CONTINUE(info.type < 0 || info.type >= Variant::VARIANT_MAX);
+
+ info.name = d["name"];
+ ERR_CONTINUE(info.name == "");
+
+ if (d.has("hint")) {
+ info.hint = PropertyHint(d["hint"].operator int64_t());
+ }
+
+ if (d.has("hint_string")) {
+ info.hint_string = d["hint_string"];
+ }
+
+ if (d.has("usage")) {
+ info.usage = d["usage"];
+ }
+
+ p_properties->push_back(info);
+ }
+ }
+
+ script_data = script_data->base_data;
+ }
+ return;
+}
+
+Variant::Type NativeScriptInstance::get_property_type(const StringName &p_name, bool *r_is_valid) const {
+
+ NativeScriptDesc *script_data = GET_SCRIPT_DESC();
+
+ while (script_data) {
+
+ Map<StringName, NativeScriptDesc::Property>::Element *P = script_data->properties.find(p_name);
+ if (P) {
+ *r_is_valid = true;
+ return P->get().info.type;
+ }
+
+ script_data = script_data->base_data;
+ }
+ return Variant::NIL;
+}
+
+void NativeScriptInstance::get_method_list(List<MethodInfo> *p_list) const {
+ script->get_method_list(p_list);
+}
+
+bool NativeScriptInstance::has_method(const StringName &p_method) const {
+ return script->has_method(p_method);
+}
+
+Variant NativeScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+
+ NativeScriptDesc *script_data = GET_SCRIPT_DESC();
+
+ while (script_data) {
+ Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.find(p_method);
+ if (E) {
+ godot_variant result;
+ result = E->get().method.method((godot_object *)owner,
+ E->get().method.method_data,
+ userdata,
+ p_argcount,
+ (godot_variant **)p_args);
+ Variant res = *(Variant *)&result;
+ godot_variant_destroy(&result);
+ r_error.error = Variant::CallError::CALL_OK;
+ return res;
+ }
+
+ script_data = script_data->base_data;
+ }
+
+ r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ return Variant();
+}
+
+void NativeScriptInstance::notification(int p_notification) {
+ Variant value = p_notification;
+ const Variant *args[1] = { &value };
+ call_multilevel("_notification", args, 1);
+}
+
+void NativeScriptInstance::refcount_incremented() {
+ Variant::CallError err;
+ call("_refcount_incremented", NULL, 0, err);
+ if (err.error != Variant::CallError::CALL_OK && err.error != Variant::CallError::CALL_ERROR_INVALID_METHOD) {
+ ERR_PRINT("Failed to invoke _refcount_incremented - should not happen");
+ }
+}
+
+bool NativeScriptInstance::refcount_decremented() {
+ Variant::CallError err;
+ Variant ret = call("_refcount_decremented", NULL, 0, err);
+ if (err.error != Variant::CallError::CALL_OK && err.error != Variant::CallError::CALL_ERROR_INVALID_METHOD) {
+ ERR_PRINT("Failed to invoke _refcount_decremented - should not happen");
+ return true; // assume we can destroy the object
+ }
+ if (err.error == Variant::CallError::CALL_ERROR_INVALID_METHOD) {
+ // the method does not exist, default is true
+ return true;
+ }
+ return ret;
+}
+
+Ref<Script> NativeScriptInstance::get_script() const {
+ return script;
+}
+
+NativeScriptInstance::RPCMode NativeScriptInstance::get_rpc_mode(const StringName &p_method) const {
+
+ NativeScriptDesc *script_data = GET_SCRIPT_DESC();
+
+ while (script_data) {
+
+ Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.find(p_method);
+ if (E) {
+ switch (E->get().rpc_mode) {
+ case GODOT_METHOD_RPC_MODE_DISABLED:
+ return RPC_MODE_DISABLED;
+ case GODOT_METHOD_RPC_MODE_REMOTE:
+ return RPC_MODE_REMOTE;
+ case GODOT_METHOD_RPC_MODE_SYNC:
+ return RPC_MODE_SYNC;
+ case GODOT_METHOD_RPC_MODE_MASTER:
+ return RPC_MODE_MASTER;
+ case GODOT_METHOD_RPC_MODE_SLAVE:
+ return RPC_MODE_SLAVE;
+ default:
+ return RPC_MODE_DISABLED;
+ }
+ }
+
+ script_data = script_data->base_data;
+ }
+
+ return RPC_MODE_DISABLED;
+}
+
+// TODO(karroffel): implement this
+NativeScriptInstance::RPCMode NativeScriptInstance::get_rset_mode(const StringName &p_variable) const {
+
+ NativeScriptDesc *script_data = GET_SCRIPT_DESC();
+
+ while (script_data) {
+
+ Map<StringName, NativeScriptDesc::Property>::Element *E = script_data->properties.find(p_variable);
+ if (E) {
+ switch (E->get().rset_mode) {
+ case GODOT_METHOD_RPC_MODE_DISABLED:
+ return RPC_MODE_DISABLED;
+ case GODOT_METHOD_RPC_MODE_REMOTE:
+ return RPC_MODE_REMOTE;
+ case GODOT_METHOD_RPC_MODE_SYNC:
+ return RPC_MODE_SYNC;
+ case GODOT_METHOD_RPC_MODE_MASTER:
+ return RPC_MODE_MASTER;
+ case GODOT_METHOD_RPC_MODE_SLAVE:
+ return RPC_MODE_SLAVE;
+ default:
+ return RPC_MODE_DISABLED;
+ }
+ }
+
+ script_data = script_data->base_data;
+ }
+
+ return RPC_MODE_DISABLED;
+}
+
+ScriptLanguage *NativeScriptInstance::get_language() {
+ return NativeScriptLanguage::get_singleton();
+}
+
+void NativeScriptInstance::call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount) {
+ NativeScriptDesc *script_data = GET_SCRIPT_DESC();
+
+ while (script_data) {
+ Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.find(p_method);
+ if (E) {
+ godot_variant res = E->get().method.method((godot_object *)owner,
+ E->get().method.method_data,
+ userdata,
+ p_argcount,
+ (godot_variant **)p_args);
+ godot_variant_destroy(&res);
+ }
+ script_data = script_data->base_data;
+ }
+}
+
+void NativeScriptInstance::call_multilevel_reversed(const StringName &p_method, const Variant **p_args, int p_argcount) {
+ NativeScriptDesc *script_data = GET_SCRIPT_DESC();
+
+ if (script_data) {
+ _ml_call_reversed(script_data, p_method, p_args, p_argcount);
+ }
+}
+
+NativeScriptInstance::~NativeScriptInstance() {
+
+ NativeScriptDesc *script_data = GET_SCRIPT_DESC();
+
+ if (!script_data)
+ return;
+
+ script_data->destroy_func.destroy_func((godot_object *)owner, script_data->destroy_func.method_data, userdata);
+
+ if (owner) {
+
+#ifndef NO_THREADS
+ script->owners_lock->lock();
+#endif
+
+ script->instance_owners.erase(owner);
+
+#ifndef NO_THREADS
+ script->owners_lock->unlock();
+#endif
+ }
+}
+
+////// ScriptingLanguage stuff
+
+NativeScriptLanguage *NativeScriptLanguage::singleton;
+
+extern "C" void _native_script_hook();
+void NativeScriptLanguage::_hacky_api_anchor() {
+ _native_script_hook();
+}
+
+void NativeScriptLanguage::_unload_stuff() {
+ for (Map<String, Map<StringName, NativeScriptDesc> >::Element *L = library_classes.front(); L; L = L->next()) {
+ for (Map<StringName, NativeScriptDesc>::Element *C = L->get().front(); C; C = C->next()) {
+
+ // free property stuff first
+ for (Map<StringName, NativeScriptDesc::Property>::Element *P = C->get().properties.front(); P; P = P->next()) {
+ if (P->get().getter.free_func)
+ P->get().getter.free_func(P->get().getter.method_data);
+
+ if (P->get().setter.free_func)
+ P->get().setter.free_func(P->get().setter.method_data);
+ }
+
+ // free method stuff
+ for (Map<StringName, NativeScriptDesc::Method>::Element *M = C->get().methods.front(); M; M = M->next()) {
+ if (M->get().method.free_func)
+ M->get().method.free_func(M->get().method.method_data);
+ }
+
+ // free constructor/destructor
+ if (C->get().create_func.free_func)
+ C->get().create_func.free_func(C->get().create_func.method_data);
+
+ if (C->get().destroy_func.free_func)
+ C->get().destroy_func.free_func(C->get().destroy_func.method_data);
+ }
+ }
+}
+
+NativeScriptLanguage::NativeScriptLanguage() {
+ NativeScriptLanguage::singleton = this;
+#ifndef NO_THREADS
+ mutex = Mutex::create();
+#endif
+}
+
+// TODO(karroffel): implement this
+NativeScriptLanguage::~NativeScriptLanguage() {
+ // _unload_stuff(); // NOTE(karroffel): This gets called in ::finish()
+
+ for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) {
+
+ L->get()->terminate();
+ NSL->library_classes.clear();
+ NSL->library_gdnatives.clear();
+ NSL->library_script_users.clear();
+ }
+
+#ifndef NO_THREADS
+ memdelete(mutex);
+#endif
+}
+
+String NativeScriptLanguage::get_name() const {
+ return "NativeScript";
+}
+
+void _add_reload_node() {
+#ifdef TOOLS_ENABLED
+ NativeReloadNode *rn = memnew(NativeReloadNode);
+ EditorNode::get_singleton()->add_child(rn);
+#endif
+}
+
+// TODO(karroffel): implement this
+void NativeScriptLanguage::init() {
+
+#if defined(TOOLS_ENABLED) && defined(DEBUG_METHODS_ENABLED)
+
+ List<String> args = OS::get_singleton()->get_cmdline_args();
+
+ List<String>::Element *E = args.find("--gdnative-generate-json-api");
+
+ if (E && E->next()) {
+ if (generate_c_api(E->next()->get()) != OK) {
+ ERR_PRINT("Failed to generate C API\n");
+ }
+ }
+#endif
+
+#ifdef TOOLS_ENABLED
+ EditorNode::add_init_callback(&_add_reload_node);
+#endif
+}
+String NativeScriptLanguage::get_type() const {
+ return "NativeScript";
+}
+String NativeScriptLanguage::get_extension() const {
+ return "gdns";
+}
+Error NativeScriptLanguage::execute_file(const String &p_path) {
+ return OK; // Qué?
+}
+void NativeScriptLanguage::finish() {
+ _unload_stuff();
+}
+void NativeScriptLanguage::get_reserved_words(List<String> *p_words) const {
+}
+void NativeScriptLanguage::get_comment_delimiters(List<String> *p_delimiters) const {
+}
+void NativeScriptLanguage::get_string_delimiters(List<String> *p_delimiters) const {
+}
+
+// TODO(karroffel): implement this
+Ref<Script> NativeScriptLanguage::get_template(const String &p_class_name, const String &p_base_class_name) const {
+ NativeScript *s = memnew(NativeScript);
+ s->set_class_name(p_class_name);
+ // TODO(karroffel): use p_base_class_name
+ return Ref<NativeScript>(s);
+}
+bool NativeScriptLanguage::validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List<String> *r_functions) const {
+ return false;
+}
+
+Script *NativeScriptLanguage::create_script() const {
+ NativeScript *script = memnew(NativeScript);
+ return script;
+}
+bool NativeScriptLanguage::has_named_classes() const {
+ return true;
+}
+int NativeScriptLanguage::find_function(const String &p_function, const String &p_code) const {
+ return -1;
+}
+String NativeScriptLanguage::make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const {
+ return "";
+}
+void NativeScriptLanguage::auto_indent_code(String &p_code, int p_from_line, int p_to_line) const {
+}
+void NativeScriptLanguage::add_global_constant(const StringName &p_variable, const Variant &p_value) {
+}
+
+// Debugging stuff here. Not used for now.
+String NativeScriptLanguage::debug_get_error() const {
+ return "";
+}
+int NativeScriptLanguage::debug_get_stack_level_count() const {
+ return -1;
+}
+int NativeScriptLanguage::debug_get_stack_level_line(int p_level) const {
+ return -1;
+}
+String NativeScriptLanguage::debug_get_stack_level_function(int p_level) const {
+ return "";
+}
+String NativeScriptLanguage::debug_get_stack_level_source(int p_level) const {
+ return "";
+}
+void NativeScriptLanguage::debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {
+}
+void NativeScriptLanguage::debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {
+}
+void NativeScriptLanguage::debug_get_globals(List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {
+}
+String NativeScriptLanguage::debug_parse_stack_level_expression(int p_level, const String &p_expression, int p_max_subitems, int p_max_depth) {
+ return "";
+}
+// Debugging stuff end.
+
+void NativeScriptLanguage::reload_all_scripts() {
+}
+
+void NativeScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) {
+}
+void NativeScriptLanguage::get_recognized_extensions(List<String> *p_extensions) const {
+ p_extensions->push_back("gdns");
+}
+
+void NativeScriptLanguage::get_public_functions(List<MethodInfo> *p_functions) const {
+}
+
+void NativeScriptLanguage::get_public_constants(List<Pair<String, Variant> > *p_constants) const {
+}
+
+void NativeScriptLanguage::profiling_start() {
+}
+
+void NativeScriptLanguage::profiling_stop() {
+}
+
+int NativeScriptLanguage::profiling_get_accumulated_data(ProfilingInfo *p_info_arr, int p_info_max) {
+ return 0;
+}
+
+int NativeScriptLanguage::profiling_get_frame_data(ProfilingInfo *p_info_arr, int p_info_max) {
+ return 0;
+}
+
+#ifndef NO_THREADS
+void NativeScriptLanguage::defer_init_library(Ref<GDNativeLibrary> lib, NativeScript *script) {
+ MutexLock lock(mutex);
+ libs_to_init.insert(lib);
+ scripts_to_register.insert(script);
+ has_objects_to_register = true;
+}
+#endif
+
+void NativeScriptLanguage::init_library(const Ref<GDNativeLibrary> &lib) {
+#ifndef NO_THREADS
+ MutexLock lock(mutex);
+#endif
+ // See if this library was "registered" already.
+ const String &lib_path = lib->get_active_library_path();
+ Map<String, Ref<GDNative> >::Element *E = library_gdnatives.find(lib_path);
+
+ if (!E) {
+ Ref<GDNative> gdn;
+ gdn.instance();
+ gdn->set_library(lib);
+
+ // TODO(karroffel): check the return value?
+ gdn->initialize();
+
+ library_gdnatives.insert(lib_path, gdn);
+
+ library_classes.insert(lib_path, Map<StringName, NativeScriptDesc>());
+
+ if (!library_script_users.has(lib_path))
+ library_script_users.insert(lib_path, Set<NativeScript *>());
+
+ void *args[1] = {
+ (void *)&lib_path
+ };
+
+ // here the library registers all the classes and stuff.
+ gdn->call_native_raw(_init_call_type,
+ _init_call_name,
+ NULL,
+ 1,
+ args,
+ NULL);
+ } else {
+ // already initialized. Nice.
+ }
+}
+
+void NativeScriptLanguage::register_script(NativeScript *script) {
+#ifndef NO_THREADS
+ MutexLock lock(mutex);
+#endif
+ library_script_users[script->lib_path].insert(script);
+}
+
+void NativeScriptLanguage::unregister_script(NativeScript *script) {
+#ifndef NO_THREADS
+ MutexLock lock(mutex);
+#endif
+ Map<String, Set<NativeScript *> >::Element *S = library_script_users.find(script->lib_path);
+ if (S) {
+ S->get().erase(script);
+ if (S->get().size() == 0) {
+ library_script_users.erase(S);
+ }
+ }
+#ifndef NO_THREADS
+ scripts_to_register.erase(script);
+#endif
+}
+
+void NativeScriptLanguage::call_libraries_cb(const StringName &name) {
+ // library_gdnatives is modified only from the main thread, so it's safe not to use mutex here
+ for (Map<String, Ref<GDNative> >::Element *L = library_gdnatives.front(); L; L = L->next()) {
+ if (L->get()->is_initialized()) {
+ L->get()->call_native_raw(
+ _noarg_call_type,
+ name,
+ NULL,
+ 0,
+ NULL,
+ NULL);
+ }
+ }
+}
+
+void NativeScriptLanguage::frame() {
+#ifndef NO_THREADS
+ if (has_objects_to_register) {
+ MutexLock lock(mutex);
+ for (Set<Ref<GDNativeLibrary> >::Element *L = libs_to_init.front(); L; L = L->next()) {
+ init_library(L->get());
+ }
+ libs_to_init.clear();
+ for (Set<NativeScript *>::Element *S = scripts_to_register.front(); S; S = S->next()) {
+ register_script(S->get());
+ }
+ scripts_to_register.clear();
+ has_objects_to_register = false;
+ }
+#endif
+ call_libraries_cb(_frame_call_name);
+}
+
+#ifndef NO_THREADS
+
+void NativeScriptLanguage::thread_enter() {
+ call_libraries_cb(_thread_enter_call_name);
+}
+
+void NativeScriptLanguage::thread_exit() {
+ call_libraries_cb(_thread_exit_call_name);
+}
+
+#endif // NO_THREADS
+
+void NativeReloadNode::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("_notification"), &NativeReloadNode::_notification);
+}
+
+void NativeReloadNode::_notification(int p_what) {
+#ifdef TOOLS_ENABLED
+
+ switch (p_what) {
+ case MainLoop::NOTIFICATION_WM_FOCUS_OUT: {
+
+ if (unloaded)
+ break;
+#ifndef NO_THREADS
+ MutexLock lock(NSL->mutex);
+#endif
+ NSL->_unload_stuff();
+ for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) {
+
+ L->get()->terminate();
+ NSL->library_classes.erase(L->key());
+ }
+
+ unloaded = true;
+
+ } break;
+
+ case MainLoop::NOTIFICATION_WM_FOCUS_IN: {
+
+ if (!unloaded)
+ break;
+#ifndef NO_THREADS
+ MutexLock lock(NSL->mutex);
+#endif
+ Set<StringName> libs_to_remove;
+ for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) {
+
+ if (!L->get()->initialize()) {
+ libs_to_remove.insert(L->key());
+ continue;
+ }
+
+ NSL->library_classes.insert(L->key(), Map<StringName, NativeScriptDesc>());
+
+ void *args[1] = {
+ (void *)&L->key()
+ };
+
+ // here the library registers all the classes and stuff.
+ L->get()->call_native_raw(NSL->_init_call_type,
+ NSL->_init_call_name,
+ NULL,
+ 1,
+ args,
+ NULL);
+
+ for (Map<String, Set<NativeScript *> >::Element *U = NSL->library_script_users.front(); U; U = U->next()) {
+ for (Set<NativeScript *>::Element *S = U->get().front(); S; S = S->next()) {
+ NativeScript *script = S->get();
+
+ if (script->placeholders.size() == 0)
+ continue;
+
+ for (Set<PlaceHolderScriptInstance *>::Element *P = script->placeholders.front(); P; P = P->next()) {
+ script->_update_placeholder(P->get());
+ }
+ }
+ }
+ }
+
+ unloaded = false;
+
+ for (Set<StringName>::Element *R = libs_to_remove.front(); R; R = R->next()) {
+ NSL->library_gdnatives.erase(R->get());
+ }
+
+ } break;
+ default: {
+ };
+ }
+#endif
+}
+
+RES ResourceFormatLoaderNativeScript::load(const String &p_path, const String &p_original_path, Error *r_error) {
+ ResourceFormatLoaderText rsflt;
+ return rsflt.load(p_path, p_original_path, r_error);
+}
+
+void ResourceFormatLoaderNativeScript::get_recognized_extensions(List<String> *p_extensions) const {
+ p_extensions->push_back("gdns");
+}
+
+bool ResourceFormatLoaderNativeScript::handles_type(const String &p_type) const {
+ return (p_type == "Script" || p_type == "NativeScript");
+}
+
+String ResourceFormatLoaderNativeScript::get_resource_type(const String &p_path) const {
+ String el = p_path.get_extension().to_lower();
+ if (el == "gdns")
+ return "NativeScript";
+ return "";
+}
+
+Error ResourceFormatSaverNativeScript::save(const String &p_path, const RES &p_resource, uint32_t p_flags) {
+ ResourceFormatSaverText rfst;
+ return rfst.save(p_path, p_resource, p_flags);
+}
+
+bool ResourceFormatSaverNativeScript::recognize(const RES &p_resource) const {
+ return p_resource->cast_to<NativeScript>() != NULL;
+}
+
+void ResourceFormatSaverNativeScript::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const {
+ if (p_resource->cast_to<NativeScript>()) {
+ p_extensions->push_back("gdns");
+ }
+}
diff --git a/modules/nativescript/nativescript.h b/modules/nativescript/nativescript.h
new file mode 100644
index 0000000000..b62fefec40
--- /dev/null
+++ b/modules/nativescript/nativescript.h
@@ -0,0 +1,325 @@
+/*************************************************************************/
+/* nativescript.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 NATIVE_SCRIPT_H
+#define NATIVE_SCRIPT_H
+
+#include "io/resource_loader.h"
+#include "io/resource_saver.h"
+#include "os/thread_safe.h"
+#include "resource.h"
+#include "scene/main/node.h"
+#include "script_language.h"
+#include "self_list.h"
+
+#include "godot_nativescript.h"
+#include "modules/gdnative/gdnative.h"
+
+#ifndef NO_THREADS
+#include "os/mutex.h"
+#endif
+
+struct NativeScriptDesc {
+
+ struct Method {
+ godot_instance_method method;
+ MethodInfo info;
+ int rpc_mode;
+ };
+ struct Property {
+ godot_property_set_func setter;
+ godot_property_get_func getter;
+ PropertyInfo info;
+ Variant default_value;
+ int rset_mode;
+ };
+
+ struct Signal {
+ MethodInfo signal;
+ };
+
+ Map<StringName, Method> methods;
+ Map<StringName, Property> properties;
+ Map<StringName, Signal> signals_; // QtCreator doesn't like the name signals
+ StringName base;
+ StringName base_native_type;
+ NativeScriptDesc *base_data;
+ godot_instance_create_func create_func;
+ godot_instance_destroy_func destroy_func;
+
+ bool is_tool;
+
+ inline NativeScriptDesc()
+ : methods(),
+ properties(),
+ signals_(),
+ base(),
+ base_native_type() {
+ zeromem(&create_func, sizeof(godot_instance_create_func));
+ zeromem(&destroy_func, sizeof(godot_instance_destroy_func));
+ }
+};
+
+class NativeScript : public Script {
+ GDCLASS(NativeScript, Script)
+
+#ifdef TOOLS_ENABLED
+ Set<PlaceHolderScriptInstance *> placeholders;
+ void _update_placeholder(PlaceHolderScriptInstance *p_placeholder);
+ virtual void _placeholder_erased(PlaceHolderScriptInstance *p_placeholder);
+#endif
+
+ friend class NativeScriptInstance;
+ friend class NativeScriptLanguage;
+ friend class NativeReloadNode;
+ friend class GDNativeLibrary;
+
+ Ref<GDNativeLibrary> library;
+
+ String lib_path;
+
+ String class_name;
+
+#ifndef NO_THREADS
+ Mutex *owners_lock;
+#endif
+ Set<Object *> instance_owners;
+
+protected:
+ static void _bind_methods();
+
+public:
+ inline NativeScriptDesc *get_script_desc() const;
+
+ void set_class_name(String p_class_name);
+ String get_class_name() const;
+
+ void set_library(Ref<GDNativeLibrary> p_library);
+ Ref<GDNativeLibrary> get_library() const;
+
+ virtual bool can_instance() const;
+
+ virtual Ref<Script> get_base_script() const; //for script inheritance
+
+ virtual StringName get_instance_base_type() const; // this may not work in all scripts, will return empty if so
+ virtual ScriptInstance *instance_create(Object *p_this);
+ virtual bool instance_has(const Object *p_this) const;
+
+ virtual bool has_source_code() const;
+ virtual String get_source_code() const;
+ virtual void set_source_code(const String &p_code);
+ virtual Error reload(bool p_keep_state = false);
+
+ virtual bool has_method(const StringName &p_method) const;
+ virtual MethodInfo get_method_info(const StringName &p_method) const;
+
+ virtual bool is_tool() const;
+
+ virtual String get_node_type() const;
+
+ virtual ScriptLanguage *get_language() const;
+
+ virtual bool has_script_signal(const StringName &p_signal) const;
+ virtual void get_script_signal_list(List<MethodInfo> *r_signals) const;
+
+ virtual bool get_property_default_value(const StringName &p_property, Variant &r_value) const;
+
+ virtual void update_exports(); //editor tool
+ virtual void get_script_method_list(List<MethodInfo> *p_list) const;
+ virtual void get_script_property_list(List<PropertyInfo> *p_list) const;
+
+ Variant _new(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+
+ NativeScript();
+ ~NativeScript();
+};
+
+class NativeScriptInstance : public ScriptInstance {
+
+ friend class NativeScript;
+
+ Object *owner;
+ Ref<NativeScript> script;
+
+ void _ml_call_reversed(NativeScriptDesc *script_data, const StringName &p_method, const Variant **p_args, int p_argcount);
+
+public:
+ void *userdata;
+
+ virtual bool set(const StringName &p_name, const Variant &p_value);
+ virtual bool get(const StringName &p_name, Variant &r_ret) const;
+ virtual void get_property_list(List<PropertyInfo> *p_properties) const;
+ virtual Variant::Type get_property_type(const StringName &p_name, bool *r_is_valid) const;
+ virtual void get_method_list(List<MethodInfo> *p_list) const;
+ virtual bool has_method(const StringName &p_method) const;
+ virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ virtual void notification(int p_notification);
+ virtual Ref<Script> get_script() const;
+ virtual RPCMode get_rpc_mode(const StringName &p_method) const;
+ virtual RPCMode get_rset_mode(const StringName &p_variable) const;
+ virtual ScriptLanguage *get_language();
+
+ virtual void call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount);
+ virtual void call_multilevel_reversed(const StringName &p_method, const Variant **p_args, int p_argcount);
+
+ virtual void refcount_incremented();
+ virtual bool refcount_decremented();
+
+ ~NativeScriptInstance();
+};
+
+class NativeReloadNode;
+
+class NativeScriptLanguage : public ScriptLanguage {
+
+ friend class NativeScript;
+ friend class NativeScriptInstance;
+ friend class NativeReloadNode;
+
+private:
+ static NativeScriptLanguage *singleton;
+
+ void _unload_stuff();
+
+#ifndef NO_THREADS
+ Mutex *mutex;
+
+ Set<Ref<GDNativeLibrary> > libs_to_init;
+ Set<NativeScript *> scripts_to_register;
+ volatile bool has_objects_to_register; // so that we don't lock mutex every frame - it's rarely needed
+ void defer_init_library(Ref<GDNativeLibrary> lib, NativeScript *script);
+#endif
+
+ void init_library(const Ref<GDNativeLibrary> &lib);
+ void register_script(NativeScript *script);
+ void unregister_script(NativeScript *script);
+
+ void call_libraries_cb(const StringName &name);
+
+public:
+ // These two maps must only be touched on the main thread
+ Map<String, Map<StringName, NativeScriptDesc> > library_classes;
+ Map<String, Ref<GDNative> > library_gdnatives;
+
+ Map<String, Set<NativeScript *> > library_script_users;
+
+ const StringName _init_call_type = "nativescript_init";
+ const StringName _init_call_name = "godot_nativescript_init";
+
+ const StringName _noarg_call_type = "nativescript_no_arg";
+
+ const StringName _frame_call_name = "godot_nativescript_frame";
+
+#ifndef NO_THREADS
+ const StringName _thread_enter_call_name = "godot_nativescript_thread_enter";
+ const StringName _thread_exit_call_name = "godot_nativescript_thread_exit";
+#endif
+
+ NativeScriptLanguage();
+ ~NativeScriptLanguage();
+
+ inline static NativeScriptLanguage *get_singleton() {
+ return singleton;
+ }
+
+ void _hacky_api_anchor();
+
+#ifndef NO_THREADS
+ virtual void thread_enter();
+ virtual void thread_exit();
+#endif
+
+ virtual void frame();
+
+ virtual String get_name() const;
+ virtual void init();
+ virtual String get_type() const;
+ virtual String get_extension() const;
+ virtual Error execute_file(const String &p_path);
+ virtual void finish();
+ virtual void get_reserved_words(List<String> *p_words) const;
+ virtual void get_comment_delimiters(List<String> *p_delimiters) const;
+ virtual void get_string_delimiters(List<String> *p_delimiters) const;
+ virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const;
+ virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List<String> *r_functions) const;
+ virtual Script *create_script() const;
+ virtual bool has_named_classes() const;
+ virtual int find_function(const String &p_function, const String &p_code) const;
+ virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const;
+ virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const;
+ virtual void add_global_constant(const StringName &p_variable, const Variant &p_value);
+ virtual String debug_get_error() const;
+ virtual int debug_get_stack_level_count() const;
+ virtual int debug_get_stack_level_line(int p_level) const;
+ virtual String debug_get_stack_level_function(int p_level) const;
+ virtual String debug_get_stack_level_source(int p_level) const;
+ virtual void debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth);
+ virtual void debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth);
+ virtual void debug_get_globals(List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth);
+ virtual String debug_parse_stack_level_expression(int p_level, const String &p_expression, int p_max_subitems, int p_max_depth);
+ virtual void reload_all_scripts();
+ virtual void reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload);
+ virtual void get_recognized_extensions(List<String> *p_extensions) const;
+ virtual void get_public_functions(List<MethodInfo> *p_functions) const;
+ virtual void get_public_constants(List<Pair<String, Variant> > *p_constants) const;
+ virtual void profiling_start();
+ virtual void profiling_stop();
+ virtual int profiling_get_accumulated_data(ProfilingInfo *p_info_arr, int p_info_max);
+ virtual int profiling_get_frame_data(ProfilingInfo *p_info_arr, int p_info_max);
+};
+
+inline NativeScriptDesc *NativeScript::get_script_desc() const {
+ Map<StringName, NativeScriptDesc>::Element *E = NativeScriptLanguage::singleton->library_classes[lib_path].find(class_name);
+ return E ? &E->get() : NULL;
+}
+
+class NativeReloadNode : public Node {
+ GDCLASS(NativeReloadNode, Node)
+ bool unloaded = false;
+
+public:
+ static void _bind_methods();
+ void _notification(int p_what);
+};
+
+class ResourceFormatLoaderNativeScript : public ResourceFormatLoader {
+public:
+ virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL);
+ virtual void get_recognized_extensions(List<String> *p_extensions) const;
+ virtual bool handles_type(const String &p_type) const;
+ virtual String get_resource_type(const String &p_path) const;
+};
+
+class ResourceFormatSaverNativeScript : public ResourceFormatSaver {
+ virtual Error save(const String &p_path, const RES &p_resource, uint32_t p_flags = 0);
+ virtual bool recognize(const RES &p_resource) const;
+ virtual void get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const;
+};
+
+#endif // GDNATIVE_H
diff --git a/modules/nativescript/register_types.cpp b/modules/nativescript/register_types.cpp
new file mode 100644
index 0000000000..c28b982884
--- /dev/null
+++ b/modules/nativescript/register_types.cpp
@@ -0,0 +1,118 @@
+/*************************************************************************/
+/* register_types.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "register_types.h"
+
+#include "io/resource_loader.h"
+#include "io/resource_saver.h"
+
+#include "nativescript.h"
+
+#include "core/os/os.h"
+
+NativeScriptLanguage *native_script_language;
+
+typedef void (*native_script_init_fn)(void *);
+
+void init_call_cb(void *p_handle, godot_string *p_proc_name, void *p_data, int p_num_args, void **args, void *r_ret) {
+ if (p_handle == NULL) {
+ ERR_PRINT("No valid library handle, can't call nativescript init procedure");
+ return;
+ }
+
+ void *library_proc;
+ Error err = OS::get_singleton()->get_dynamic_library_symbol_handle(
+ p_handle,
+ *(String *)p_proc_name,
+ library_proc,
+ true); // we print our own message
+ if (err != OK) {
+ ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data());
+ return;
+ }
+
+ native_script_init_fn fn = (native_script_init_fn)library_proc;
+
+ fn(args[0]);
+}
+
+typedef void (*native_script_empty_callback)();
+
+void noarg_call_cb(void *p_handle, godot_string *p_proc_name, void *p_data, int p_num_args, void **args, void *r_ret) {
+ if (p_handle == NULL) {
+ ERR_PRINT("No valid library handle, can't call nativescript callback");
+ return;
+ }
+
+ void *library_proc;
+ Error err = OS::get_singleton()->get_dynamic_library_symbol_handle(
+ p_handle,
+ *(String *)p_proc_name,
+ library_proc,
+ true);
+ if (err != OK) {
+ // it's fine if thread callbacks are not present in the library.
+ return;
+ }
+
+ native_script_empty_callback fn = (native_script_empty_callback)library_proc;
+ fn();
+}
+
+ResourceFormatLoaderNativeScript *resource_loader_gdns = NULL;
+ResourceFormatSaverNativeScript *resource_saver_gdns = NULL;
+
+void register_nativescript_types() {
+ native_script_language = memnew(NativeScriptLanguage);
+
+ ClassDB::register_class<NativeScript>();
+
+ ScriptServer::register_language(native_script_language);
+
+ GDNativeCallRegistry::singleton->register_native_raw_call_type(native_script_language->_init_call_type, init_call_cb);
+ GDNativeCallRegistry::singleton->register_native_raw_call_type(native_script_language->_noarg_call_type, noarg_call_cb);
+
+ resource_saver_gdns = memnew(ResourceFormatSaverNativeScript);
+ ResourceSaver::add_resource_format_saver(resource_saver_gdns);
+
+ resource_loader_gdns = memnew(ResourceFormatLoaderNativeScript);
+ ResourceLoader::add_resource_format_loader(resource_loader_gdns);
+}
+
+void unregister_nativescript_types() {
+
+ memdelete(resource_loader_gdns);
+
+ memdelete(resource_saver_gdns);
+
+ if (native_script_language) {
+ ScriptServer::unregister_language(native_script_language);
+ memdelete(native_script_language);
+ }
+}
diff --git a/modules/nativescript/register_types.h b/modules/nativescript/register_types.h
new file mode 100644
index 0000000000..319da9c42f
--- /dev/null
+++ b/modules/nativescript/register_types.h
@@ -0,0 +1,31 @@
+/*************************************************************************/
+/* register_types.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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. */
+/*************************************************************************/
+void register_nativescript_types();
+void unregister_nativescript_types();
diff --git a/modules/ogg/register_types.cpp b/modules/ogg/register_types.cpp
index ed796ec092..9837ae12d9 100644
--- a/modules/ogg/register_types.cpp
+++ b/modules/ogg/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/ogg/register_types.h b/modules/ogg/register_types.h
index cc67b4d2f0..dc84227b80 100644
--- a/modules/ogg/register_types.h
+++ b/modules/ogg/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/openssl/SCsub b/modules/openssl/SCsub
index 0e811ce8c9..add7d4dcfc 100644
--- a/modules/openssl/SCsub
+++ b/modules/openssl/SCsub
@@ -677,7 +677,16 @@ if (env['builtin_openssl'] != 'no'):
# Module sources
env_openssl.add_source_files(env.modules_sources, "*.cpp")
-env_openssl.add_source_files(env.modules_sources, "*.c")
+
+
+# Other thirdparty dependencies
+thirdparty_misc_dir = "#thirdparty/misc/"
+thirdparty_misc_sources = [
+ "curl_hostcheck.c",
+]
+thirdparty_misc_sources = [thirdparty_misc_dir + file for file in thirdparty_misc_sources]
+env_openssl.add_source_files(env.modules_sources, thirdparty_misc_sources)
+
# platform/uwp need to know openssl is available, pass to main env
if "platform" in env and env["platform"] == "uwp":
diff --git a/modules/openssl/register_types.cpp b/modules/openssl/register_types.cpp
index 6cc9fa3669..e1ae581caf 100644
--- a/modules/openssl/register_types.cpp
+++ b/modules/openssl/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/openssl/register_types.h b/modules/openssl/register_types.h
index 3bcee59bfd..ff39ec8798 100644
--- a/modules/openssl/register_types.h
+++ b/modules/openssl/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/openssl/stream_peer_openssl.cpp b/modules/openssl/stream_peer_openssl.cpp
index 3b25b8a50e..7a9d5195a9 100644
--- a/modules/openssl/stream_peer_openssl.cpp
+++ b/modules/openssl/stream_peer_openssl.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -559,7 +560,7 @@ void StreamPeerOpenSSL::initialize_ssl() {
ERR_load_BIO_strings(); // Load BIO error strings
OpenSSL_add_all_algorithms(); // Load all available encryption algorithms
String certs_path = GLOBAL_DEF("network/ssl/certificates", "");
- GlobalConfig::get_singleton()->set_custom_property_info("network/ssl/certificates", PropertyInfo(Variant::STRING, "network/ssl/certificates", PROPERTY_HINT_FILE, "*.crt"));
+ ProjectSettings::get_singleton()->set_custom_property_info("network/ssl/certificates", PropertyInfo(Variant::STRING, "network/ssl/certificates", PROPERTY_HINT_FILE, "*.crt"));
if (certs_path != "") {
FileAccess *f = FileAccess::open(certs_path, FileAccess::READ);
@@ -580,7 +581,7 @@ void StreamPeerOpenSSL::initialize_ssl() {
}
}
String config_path = GLOBAL_DEF("network/ssl/config", "");
- GlobalConfig::get_singleton()->set_custom_property_info("network/ssl/config", PropertyInfo(Variant::STRING, "network/ssl/config", PROPERTY_HINT_FILE, "*.cnf"));
+ ProjectSettings::get_singleton()->set_custom_property_info("network/ssl/config", PropertyInfo(Variant::STRING, "network/ssl/config", PROPERTY_HINT_FILE, "*.cnf"));
if (config_path != "") {
Vector<uint8_t> data = FileAccess::get_file_as_array(config_path);
diff --git a/modules/openssl/stream_peer_openssl.h b/modules/openssl/stream_peer_openssl.h
index 56b45802df..b1da5e1d95 100644
--- a/modules/openssl/stream_peer_openssl.h
+++ b/modules/openssl/stream_peer_openssl.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,17 +30,19 @@
#ifndef STREAM_PEER_OPEN_SSL_H
#define STREAM_PEER_OPEN_SSL_H
-#include "curl_hostcheck.h"
-#include "global_config.h"
#include "io/stream_peer_ssl.h"
#include "os/file_access.h"
-#include <stdio.h> // If you don't know what this is for stop reading now.
+#include "project_settings.h"
+
+#include "thirdparty/misc/curl_hostcheck.h"
#include <openssl/bio.h> // BIO objects for I/O
#include <openssl/err.h> // Error reporting
#include <openssl/ssl.h> // SSL and SSL_CTX for SSL connections
#include <openssl/x509v3.h>
+#include <stdio.h>
+
class StreamPeerOpenSSL : public StreamPeerSSL {
private:
static int _bio_create(BIO *b);
diff --git a/modules/opus/audio_stream_opus.cpp b/modules/opus/audio_stream_opus.cpp
index 52b055ca82..e361ebf019 100644
--- a/modules/opus/audio_stream_opus.cpp
+++ b/modules/opus/audio_stream_opus.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Author: George Marques <george@gmarqu.es> */
/* */
diff --git a/modules/opus/audio_stream_opus.h b/modules/opus/audio_stream_opus.h
index f1bee121b2..daf3958c2a 100644
--- a/modules/opus/audio_stream_opus.h
+++ b/modules/opus/audio_stream_opus.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Author: George Marques <george@gmarqu.es> */
/* */
diff --git a/modules/opus/register_types.cpp b/modules/opus/register_types.cpp
index 8a48c5084e..e8bff58cbb 100644
--- a/modules/opus/register_types.cpp
+++ b/modules/opus/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/opus/register_types.h b/modules/opus/register_types.h
index 09181b4f03..4517dc5df7 100644
--- a/modules/opus/register_types.h
+++ b/modules/opus/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/pbm/bitmap_loader_pbm.cpp b/modules/pbm/bitmap_loader_pbm.cpp
index 04051fc38f..c8f25ad68c 100644
--- a/modules/pbm/bitmap_loader_pbm.cpp
+++ b/modules/pbm/bitmap_loader_pbm.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/pbm/bitmap_loader_pbm.h b/modules/pbm/bitmap_loader_pbm.h
index 5e5062f435..7a72edaeee 100644
--- a/modules/pbm/bitmap_loader_pbm.h
+++ b/modules/pbm/bitmap_loader_pbm.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/pbm/register_types.cpp b/modules/pbm/register_types.cpp
index abfc08c909..c9531ba14f 100644
--- a/modules/pbm/register_types.cpp
+++ b/modules/pbm/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/pbm/register_types.h b/modules/pbm/register_types.h
index c9a125083d..3888fd6f77 100644
--- a/modules/pbm/register_types.h
+++ b/modules/pbm/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/pvr/register_types.cpp b/modules/pvr/register_types.cpp
index 76fe7970d3..04e20558ce 100644
--- a/modules/pvr/register_types.cpp
+++ b/modules/pvr/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/pvr/register_types.h b/modules/pvr/register_types.h
index ac2ab748df..7ff5237c03 100644
--- a/modules/pvr/register_types.h
+++ b/modules/pvr/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp
index 0409998408..bdd4779e28 100644
--- a/modules/pvr/texture_loader_pvr.cpp
+++ b/modules/pvr/texture_loader_pvr.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -163,8 +164,8 @@ RES ResourceFormatPVR::load(const String &p_path, const String &p_original_path,
print_line("flip: " + itos(flags & PVR_VFLIP));
- Image image(width, height, mipmaps, format, data);
- ERR_FAIL_COND_V(image.empty(), RES());
+ Ref<Image> image = memnew(Image(width, height, mipmaps, format, data));
+ ERR_FAIL_COND_V(image->empty(), RES());
Ref<ImageTexture> texture = memnew(ImageTexture);
texture->create_from_image(image, tex_flags);
@@ -192,30 +193,32 @@ String ResourceFormatPVR::get_resource_type(const String &p_path) const {
static void _compress_pvrtc4(Image *p_img) {
- Image img = *p_img;
+ Ref<Image> img = p_img->duplicate();
bool make_mipmaps = false;
- if (img.get_width() % 8 || img.get_height() % 8) {
- make_mipmaps = img.has_mipmaps();
- img.resize(img.get_width() + (8 - (img.get_width() % 8)), img.get_height() + (8 - (img.get_height() % 8)));
+ if (img->get_width() % 8 || img->get_height() % 8) {
+ make_mipmaps = img->has_mipmaps();
+ img->resize(img->get_width() + (8 - (img->get_width() % 8)), img->get_height() + (8 - (img->get_height() % 8)));
}
- img.convert(Image::FORMAT_RGBA8);
- if (!img.has_mipmaps() && make_mipmaps)
- img.generate_mipmaps();
+ img->convert(Image::FORMAT_RGBA8);
+ if (!img->has_mipmaps() && make_mipmaps)
+ img->generate_mipmaps();
- bool use_alpha = img.detect_alpha();
+ bool use_alpha = img->detect_alpha();
- Image new_img;
- new_img.create(img.get_width(), img.get_height(), true, use_alpha ? Image::FORMAT_PVRTC4A : Image::FORMAT_PVRTC4);
- PoolVector<uint8_t> data = new_img.get_data();
+ Ref<Image> new_img;
+ new_img.instance();
+ new_img->create(img->get_width(), img->get_height(), true, use_alpha ? Image::FORMAT_PVRTC4A : Image::FORMAT_PVRTC4);
+
+ PoolVector<uint8_t> data = new_img->get_data();
{
PoolVector<uint8_t>::Write wr = data.write();
- PoolVector<uint8_t>::Read r = img.get_data().read();
+ PoolVector<uint8_t>::Read r = img->get_data().read();
- for (int i = 0; i <= new_img.get_mipmap_count(); i++) {
+ for (int i = 0; i <= new_img->get_mipmap_count(); i++) {
int ofs, size, w, h;
- img.get_mipmap_offset_size_and_dimensions(i, ofs, size, w, h);
+ img->get_mipmap_offset_size_and_dimensions(i, ofs, size, w, h);
Javelin::RgbaBitmap bm(w, h);
copymem(bm.GetData(), &r[ofs], size);
{
@@ -225,12 +228,12 @@ static void _compress_pvrtc4(Image *p_img) {
}
}
- new_img.get_mipmap_offset_size_and_dimensions(i, ofs, size, w, h);
+ new_img->get_mipmap_offset_size_and_dimensions(i, ofs, size, w, h);
Javelin::PvrTcEncoder::EncodeRgba4Bpp(&wr[ofs], bm);
}
}
- *p_img = Image(new_img.get_width(), new_img.get_height(), new_img.has_mipmaps(), new_img.get_format(), data);
+ p_img->create(new_img->get_width(), new_img->get_height(), new_img->has_mipmaps(), new_img->get_format(), data);
}
ResourceFormatPVR::ResourceFormatPVR() {
@@ -675,8 +678,7 @@ static void _pvrtc_decompress(Image *p_img) {
r = PoolVector<uint8_t>::Read();
bool make_mipmaps = p_img->has_mipmaps();
- Image newimg(p_img->get_width(), p_img->get_height(), false, Image::FORMAT_RGBA8, newdata);
+ p_img->create(p_img->get_width(), p_img->get_height(), false, Image::FORMAT_RGBA8, newdata);
if (make_mipmaps)
- newimg.generate_mipmaps();
- *p_img = newimg;
+ p_img->generate_mipmaps();
}
diff --git a/modules/pvr/texture_loader_pvr.h b/modules/pvr/texture_loader_pvr.h
index 768070ee61..7d60831175 100644
--- a/modules/pvr/texture_loader_pvr.h
+++ b/modules/pvr/texture_loader_pvr.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp
index e8fed382b5..c728657d6b 100644
--- a/modules/regex/regex.cpp
+++ b/modules/regex/regex.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -589,6 +590,11 @@ struct RegExNodeGroup : public RegExNode {
memdelete(childset[i]);
}
+ virtual void test_success(RegExSearch &s, int pos) const {
+
+ return;
+ }
+
virtual int test(RegExSearch &s, int pos) const {
for (int i = 0; i < childset.size(); ++i) {
@@ -597,10 +603,8 @@ struct RegExNodeGroup : public RegExNode {
int res = childset[i]->test(s, pos);
- if (s.complete)
- return res;
-
if (inverse) {
+ s.complete = false;
if (res < 0)
res = pos + 1;
else
@@ -610,9 +614,13 @@ struct RegExNodeGroup : public RegExNode {
continue;
}
+ if (s.complete)
+ return res;
+
if (res >= 0) {
if (reset_pos)
res = pos;
+ this->test_success(s, res);
return next ? next->test(s, res) : res;
}
}
@@ -667,6 +675,12 @@ struct RegExNodeCapturing : public RegExNodeGroup {
id = p_id;
}
+ virtual void test_success(RegExSearch &s, int pos) const {
+
+ RegExMatch::Group &ref = s.match->captures[id];
+ ref.length = pos - ref.start;
+ }
+
virtual int test(RegExSearch &s, int pos) const {
RegExMatch::Group &ref = s.match->captures[id];
@@ -675,13 +689,8 @@ struct RegExNodeCapturing : public RegExNodeGroup {
int res = RegExNodeGroup::test(s, pos);
- if (res >= 0) {
- if (!s.complete)
- ref.length = res - pos;
- } else {
+ if (res < 0)
ref.start = old_start;
- }
-
return res;
}
diff --git a/modules/regex/regex.h b/modules/regex/regex.h
index 7aecf9b3ec..106d2649a5 100644
--- a/modules/regex/regex.h
+++ b/modules/regex/regex.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/regex/register_types.cpp b/modules/regex/register_types.cpp
index 2e24edcd84..eaa8f41e33 100644
--- a/modules/regex/register_types.cpp
+++ b/modules/regex/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/regex/register_types.h b/modules/regex/register_types.h
index 5d676b6daa..3b977edd32 100644
--- a/modules/regex/register_types.h
+++ b/modules/regex/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/register_module_types.h b/modules/register_module_types.h
index 7d9a130ea1..e30dab2819 100644
--- a/modules/register_module_types.h
+++ b/modules/register_module_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp
index dd46dac234..efce76c805 100644
--- a/modules/squish/image_compress_squish.cpp
+++ b/modules/squish/image_compress_squish.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,65 +31,143 @@
#include "print_string.h"
-#include <squish.h>
+#if defined(__SSE2__)
+#define SQUISH_USE_SSE 2
+#elif defined(__SSE__)
+#define SQUISH_USE_SSE 1
+#endif
-void image_compress_squish(Image *p_image) {
+#include <squish.h>
+void image_decompress_squish(Image *p_image) {
int w = p_image->get_width();
int h = p_image->get_height();
- if (!p_image->has_mipmaps()) {
- ERR_FAIL_COND(!w || w % 4 != 0);
- ERR_FAIL_COND(!h || h % 4 != 0);
+ Image::Format target_format = Image::FORMAT_RGBA8;
+ PoolVector<uint8_t> data;
+ int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps() ? -1 : 0);
+ int mm_count = p_image->get_mipmap_count();
+ data.resize(target_size);
+
+ PoolVector<uint8_t>::Read rb = p_image->get_data().read();
+ PoolVector<uint8_t>::Write wb = data.write();
+
+ int squish_flags = Image::FORMAT_MAX;
+ if (p_image->get_format() == Image::FORMAT_DXT1) {
+ squish_flags = squish::kDxt1;
+ } else if (p_image->get_format() == Image::FORMAT_DXT3) {
+ squish_flags = squish::kDxt3;
+ } else if (p_image->get_format() == Image::FORMAT_DXT5) {
+ squish_flags = squish::kDxt5;
+ } else if (p_image->get_format() == Image::FORMAT_RGTC_R) {
+ squish_flags = squish::kBc4;
+ } else if (p_image->get_format() == Image::FORMAT_RGTC_RG) {
+ squish_flags = squish::kBc5;
} else {
- ERR_FAIL_COND(!w || w != nearest_power_of_2(w));
- ERR_FAIL_COND(!h || h != nearest_power_of_2(h));
- };
+ print_line("wtf askd to decompress.. " + itos(p_image->get_format()));
+ ERR_FAIL_COND(true);
+ return;
+ }
+
+ int dst_ofs = 0;
+
+ for (int i = 0; i <= mm_count; i++) {
+ int src_ofs = 0, mipmap_size = 0, mipmap_w = 0, mipmap_h = 0;
+ p_image->get_mipmap_offset_size_and_dimensions(i, src_ofs, mipmap_size, mipmap_w, mipmap_h);
+ squish::DecompressImage(&wb[dst_ofs], mipmap_w, mipmap_h, &rb[src_ofs], squish_flags);
+ }
+
+ p_image->create(p_image->get_width(), p_image->get_height(), p_image->has_mipmaps(), target_format, data);
+}
+
+void image_compress_squish(Image *p_image, Image::CompressSource p_source) {
if (p_image->get_format() >= Image::FORMAT_DXT1)
return; //do not compress, already compressed
- int shift = 0;
- int squish_comp = squish::kColourRangeFit;
- Image::Format target_format;
+ int w = p_image->get_width();
+ int h = p_image->get_height();
- if (p_image->get_format() == Image::FORMAT_LA8) {
- //compressed normalmap
- target_format = Image::FORMAT_DXT5;
- squish_comp |= squish::kDxt5;
- } else if (p_image->detect_alpha() != Image::ALPHA_NONE) {
+ if (p_image->get_format() <= Image::FORMAT_RGBA8) {
- target_format = Image::FORMAT_DXT3;
- squish_comp |= squish::kDxt3;
- } else {
- target_format = Image::FORMAT_DXT1;
- shift = 1;
- squish_comp |= squish::kDxt1;
- }
+ int squish_comp = squish::kColourRangeFit;
+ Image::Format target_format;
- p_image->convert(Image::FORMAT_RGBA8); //always expects rgba
+ Image::DetectChannels dc = p_image->get_detected_channels();
- PoolVector<uint8_t> data;
- int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps() ? -1 : 0);
- int mm_count = p_image->has_mipmaps() ? Image::get_image_required_mipmaps(w, h, target_format) : 0;
- data.resize(target_size);
+ p_image->convert(Image::FORMAT_RGBA8); //still uses RGBA to convert
- PoolVector<uint8_t>::Read rb = p_image->get_data().read();
- PoolVector<uint8_t>::Write wb = data.write();
+ if (p_source == Image::COMPRESS_SOURCE_SRGB && (dc == Image::DETECTED_R || dc == Image::DETECTED_RG)) {
+ //R and RG do not support SRGB
+ dc = Image::DETECTED_RGB;
+ }
- int dst_ofs = 0;
+ if (p_source == Image::COMPRESS_SOURCE_NORMAL) {
+ //R and RG do not support SRGB
+ dc = Image::DETECTED_RG;
+ }
- for (int i = 0; i <= mm_count; i++) {
+ switch (dc) {
+ case Image::DETECTED_L: {
- int src_ofs = p_image->get_mipmap_offset(i);
- squish::CompressImage(&rb[src_ofs], w, h, &wb[dst_ofs], squish_comp);
- dst_ofs += (MAX(4, w) * MAX(4, h)) >> shift;
- w >>= 1;
- h >>= 1;
- }
+ target_format = Image::FORMAT_DXT1;
+ squish_comp |= squish::kDxt1;
+ } break;
+ case Image::DETECTED_LA: {
- rb = PoolVector<uint8_t>::Read();
- wb = PoolVector<uint8_t>::Write();
+ target_format = Image::FORMAT_DXT5;
+ squish_comp |= squish::kDxt5;
+ } break;
+ case Image::DETECTED_R: {
- p_image->create(p_image->get_width(), p_image->get_height(), p_image->has_mipmaps(), target_format, data);
+ target_format = Image::FORMAT_RGTC_R;
+ squish_comp |= squish::kBc4;
+ } break;
+ case Image::DETECTED_RG: {
+
+ target_format = Image::FORMAT_RGTC_RG;
+ squish_comp |= squish::kBc5;
+ } break;
+ case Image::DETECTED_RGB: {
+
+ target_format = Image::FORMAT_DXT1;
+ squish_comp |= squish::kDxt1;
+ } break;
+ case Image::DETECTED_RGBA: {
+
+ //TODO, should convert both, then measure which one does a better job
+ target_format = Image::FORMAT_DXT5;
+ squish_comp |= squish::kDxt5;
+
+ } break;
+ }
+
+ PoolVector<uint8_t> data;
+ int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps() ? -1 : 0);
+ int mm_count = p_image->has_mipmaps() ? Image::get_image_required_mipmaps(w, h, target_format) : 0;
+ data.resize(target_size);
+ int shift = Image::get_format_pixel_rshift(target_format);
+
+ PoolVector<uint8_t>::Read rb = p_image->get_data().read();
+ PoolVector<uint8_t>::Write wb = data.write();
+
+ int dst_ofs = 0;
+
+ for (int i = 0; i <= mm_count; i++) {
+
+ int bw = w % 4 != 0 ? w + (4 - w % 4) : w;
+ int bh = h % 4 != 0 ? h + (4 - h % 4) : h;
+
+ int src_ofs = p_image->get_mipmap_offset(i);
+ squish::CompressImage(&rb[src_ofs], w, h, &wb[dst_ofs], squish_comp);
+ dst_ofs += (MAX(4, bw) * MAX(4, bh)) >> shift;
+ w >>= 1;
+ h >>= 1;
+ }
+
+ rb = PoolVector<uint8_t>::Read();
+ wb = PoolVector<uint8_t>::Write();
+
+ p_image->create(p_image->get_width(), p_image->get_height(), p_image->has_mipmaps(), target_format, data);
+ }
}
diff --git a/modules/squish/image_compress_squish.h b/modules/squish/image_compress_squish.h
index 198889402a..68aaeefc30 100644
--- a/modules/squish/image_compress_squish.h
+++ b/modules/squish/image_compress_squish.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,6 +32,7 @@
#include "image.h"
-void image_compress_squish(Image *p_image);
+void image_compress_squish(Image *p_image, Image::CompressSource p_source);
+void image_decompress_squish(Image *p_image);
#endif // IMAGE_COMPRESS_SQUISH_H
diff --git a/modules/squish/register_types.cpp b/modules/squish/register_types.cpp
index 995711c758..2eeea59836 100644
--- a/modules/squish/register_types.cpp
+++ b/modules/squish/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,6 +36,7 @@
void register_squish_types() {
Image::set_compress_bc_func(image_compress_squish);
+ Image::_image_decompress_bc = image_decompress_squish;
}
void unregister_squish_types() {}
diff --git a/modules/squish/register_types.h b/modules/squish/register_types.h
index 0db4301997..3bf1b19dec 100644
--- a/modules/squish/register_types.h
+++ b/modules/squish/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp
index 1c6e7e461d..7b8b2abebb 100644
--- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp
+++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,8 @@
#include "audio_stream_ogg_vorbis.h"
#include "os/file_access.h"
-#include "thirdparty/stb_vorbis/stb_vorbis.c"
+
+#include "thirdparty/misc/stb_vorbis.c"
void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_frames) {
@@ -37,10 +39,11 @@ void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_fra
int todo = p_frames;
- while (todo) {
+ while (todo && active) {
int mixed = stb_vorbis_get_samples_float_interleaved(ogg_stream, 2, (float *)p_buffer, todo * 2);
todo -= mixed;
+ frames_mixed += mixed;
if (todo) {
//end of file!
@@ -65,8 +68,8 @@ float AudioStreamPlaybackOGGVorbis::get_stream_sampling_rate() {
void AudioStreamPlaybackOGGVorbis::start(float p_from_pos) {
- seek_pos(p_from_pos);
active = true;
+ seek_pos(p_from_pos);
loops = 0;
_begin_resample();
}
@@ -94,7 +97,12 @@ void AudioStreamPlaybackOGGVorbis::seek_pos(float p_time) {
if (!active)
return;
- stb_vorbis_seek(ogg_stream, uint32_t(p_time * vorbis_stream->sample_rate));
+ if (p_time >= get_length()) {
+ p_time = 0;
+ }
+ frames_mixed = uint32_t(vorbis_stream->sample_rate * p_time);
+
+ stb_vorbis_seek(ogg_stream, frames_mixed);
}
float AudioStreamPlaybackOGGVorbis::get_length() const {
diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.h b/modules/stb_vorbis/audio_stream_ogg_vorbis.h
index c32b3e578d..46cdfd3f2d 100644
--- a/modules/stb_vorbis/audio_stream_ogg_vorbis.h
+++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,7 +34,7 @@
#include "servers/audio/audio_stream.h"
#define STB_VORBIS_HEADER_ONLY
-#include "thirdparty/stb_vorbis/stb_vorbis.c"
+#include "thirdparty/misc/stb_vorbis.c"
#undef STB_VORBIS_HEADER_ONLY
class AudioStreamOGGVorbis;
@@ -76,7 +77,7 @@ class AudioStreamOGGVorbis : public AudioStream {
GDCLASS(AudioStreamOGGVorbis, AudioStream)
OBJ_SAVE_TYPE(AudioStream) //children are all saved as AudioStream, so they can be exchanged
- RES_BASE_EXTENSION("asogg");
+ RES_BASE_EXTENSION("oggstr");
friend class AudioStreamPlaybackOGGVorbis;
diff --git a/modules/stb_vorbis/register_types.cpp b/modules/stb_vorbis/register_types.cpp
index 36b7ebc11a..726260b45c 100644
--- a/modules/stb_vorbis/register_types.cpp
+++ b/modules/stb_vorbis/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/stb_vorbis/register_types.h b/modules/stb_vorbis/register_types.h
index 2824aa9f0c..c17e1eafe9 100644
--- a/modules/stb_vorbis/register_types.h
+++ b/modules/stb_vorbis/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp
index 11d8551db5..f0a7ee1ec6 100644
--- a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp
+++ b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -47,7 +48,7 @@ void ResourceImporterOGGVorbis::get_recognized_extensions(List<String> *p_extens
}
String ResourceImporterOGGVorbis::get_save_extension() const {
- return "asogg";
+ return "oggstr";
}
String ResourceImporterOGGVorbis::get_resource_type() const {
@@ -98,7 +99,7 @@ Error ResourceImporterOGGVorbis::import(const String &p_source_file, const Strin
ogg_stream->set_data(data);
ogg_stream->set_loop(loop);
- return ResourceSaver::save(p_save_path + ".asogg", ogg_stream);
+ return ResourceSaver::save(p_save_path + ".oggstr", ogg_stream);
}
ResourceImporterOGGVorbis::ResourceImporterOGGVorbis() {
diff --git a/modules/stb_vorbis/resource_importer_ogg_vorbis.h b/modules/stb_vorbis/resource_importer_ogg_vorbis.h
index 2f0fcbe9a1..c588b58fb2 100644
--- a/modules/stb_vorbis/resource_importer_ogg_vorbis.h
+++ b/modules/stb_vorbis/resource_importer_ogg_vorbis.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/tga/SCsub b/modules/tga/SCsub
new file mode 100644
index 0000000000..7e405f405c
--- /dev/null
+++ b/modules/tga/SCsub
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+
+Import('env')
+Import('env_modules')
+
+env_tga = env_modules.Clone()
+
+# Godot's own source files
+env_tga.add_source_files(env.modules_sources, "*.cpp")
diff --git a/modules/cscript/config.py b/modules/tga/config.py
index 5698a37295..fb920482f5 100644
--- a/modules/cscript/config.py
+++ b/modules/tga/config.py
@@ -1,5 +1,4 @@
-
def can_build(platform):
return True
diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp
new file mode 100644
index 0000000000..5b8610b975
--- /dev/null
+++ b/modules/tga/image_loader_tga.cpp
@@ -0,0 +1,314 @@
+/*************************************************************************/
+/* image_loader_jpegd.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "image_loader_tga.h"
+
+#include "os/os.h"
+#include "print_string.h"
+
+Error ImageLoaderTGA::decode_tga_rle(const uint8_t *p_compressed_buffer, size_t p_pixel_size, uint8_t *p_uncompressed_buffer, size_t p_output_size) {
+ Error error;
+
+ PoolVector<uint8_t> pixels;
+ error = pixels.resize(p_pixel_size);
+ if (error != OK)
+ return error;
+
+ PoolVector<uint8_t>::Write pixels_w = pixels.write();
+
+ size_t compressed_pos = 0;
+ size_t output_pos = 0;
+ size_t c = 0;
+ size_t count = 0;
+
+ while (output_pos < p_output_size) {
+ c = p_compressed_buffer[compressed_pos];
+ compressed_pos += 1;
+ count = (c & 0x7f) + 1;
+
+ if (c & 0x80) {
+ for (int i = 0; i < p_pixel_size; i++) {
+ pixels_w.ptr()[i] = p_compressed_buffer[compressed_pos];
+ compressed_pos += 1;
+ }
+ for (int i = 0; i < count; i++) {
+ for (int j = 0; j < p_pixel_size; j++) {
+ p_uncompressed_buffer[output_pos + j] = pixels_w.ptr()[j];
+ }
+ output_pos += p_pixel_size;
+ }
+ } else {
+ count *= p_pixel_size;
+ for (int i = 0; i < count; i++) {
+ p_uncompressed_buffer[output_pos] = p_compressed_buffer[compressed_pos];
+ compressed_pos += 1;
+ output_pos += 1;
+ }
+ }
+ }
+ return OK;
+}
+
+Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const tga_header_s &p_header, const uint8_t *p_palette, const bool p_is_monochrome) {
+
+#define TGA_PUT_PIXEL(r, g, b, a) \
+ int image_data_ofs = ((y * width) + x); \
+ image_data_w[image_data_ofs * 4 + 0] = r; \
+ image_data_w[image_data_ofs * 4 + 1] = g; \
+ image_data_w[image_data_ofs * 4 + 2] = b; \
+ image_data_w[image_data_ofs * 4 + 3] = a;
+
+ uint32_t width = p_header.image_width;
+ uint32_t height = p_header.image_height;
+ tga_origin_e origin = static_cast<tga_origin_e>((p_header.image_descriptor & TGA_ORIGIN_MASK) >> TGA_ORIGIN_SHIFT);
+
+ uint32_t x_start;
+ int32_t x_step;
+ uint32_t x_end;
+ uint32_t y_start;
+ int32_t y_step;
+ uint32_t y_end;
+
+ if (origin == TGA_ORIGIN_TOP_LEFT || origin == TGA_ORIGIN_TOP_RIGHT) {
+ y_start = 0;
+ y_step = 1;
+ y_end = height;
+ } else {
+ y_start = height - 1;
+ y_step = -1;
+ y_end = -1;
+ }
+
+ if (origin == TGA_ORIGIN_TOP_LEFT || origin == TGA_ORIGIN_BOTTOM_LEFT) {
+ x_start = 0;
+ x_step = 1;
+ x_end = width;
+ } else {
+ x_start = width - 1;
+ x_step = -1;
+ x_end = -1;
+ }
+
+ PoolVector<uint8_t> image_data;
+ image_data.resize(width * height * sizeof(uint32_t));
+ PoolVector<uint8_t>::Write image_data_w = image_data.write();
+
+ size_t i = 0;
+ uint32_t x = x_start;
+ uint32_t y = y_start;
+
+ if (p_header.pixel_depth == 8) {
+ if (p_is_monochrome) {
+ while (y != y_end) {
+ while (x != x_end) {
+ uint8_t shade = p_buffer[i];
+
+ TGA_PUT_PIXEL(shade, shade, shade, 0xff)
+
+ x += x_step;
+ i += 1;
+ }
+ x = x_start;
+ y += y_step;
+ }
+ } else {
+ while (y != y_end) {
+ while (x != x_end) {
+ uint8_t index = p_buffer[i];
+ uint8_t r = 0x00;
+ uint8_t g = 0x00;
+ uint8_t b = 0x00;
+ uint8_t a = 0xff;
+
+ if (p_header.color_map_depth == 24) {
+ r = (p_palette[(index * 3) + 0]);
+ g = (p_palette[(index * 3) + 1]);
+ b = (p_palette[(index * 3) + 2]);
+ } else {
+ return ERR_INVALID_DATA;
+ }
+
+ TGA_PUT_PIXEL(r, g, b, a)
+
+ x += x_step;
+ i += 1;
+ }
+ x = x_start;
+ y += y_step;
+ }
+ }
+ } else if (p_header.pixel_depth == 24) {
+ while (y != y_end) {
+ while (x != x_end) {
+ uint8_t r = p_buffer[i + 2];
+ uint8_t g = p_buffer[i + 1];
+ uint8_t b = p_buffer[i + 0];
+
+ TGA_PUT_PIXEL(r, g, b, 0xff)
+
+ x += x_step;
+ i += 3;
+ }
+ x = x_start;
+ y += y_step;
+ }
+ } else if (p_header.pixel_depth == 32) {
+ while (y != y_end) {
+ while (x != x_end) {
+ uint8_t a = p_buffer[i + 3];
+ uint8_t r = p_buffer[i + 2];
+ uint8_t g = p_buffer[i + 1];
+ uint8_t b = p_buffer[i + 0];
+
+ TGA_PUT_PIXEL(r, g, b, a)
+
+ x += x_step;
+ i += 4;
+ }
+ x = x_start;
+ y += y_step;
+ }
+ }
+
+ image_data_w = PoolVector<uint8_t>::Write();
+
+ p_image->create(width, height, 0, Image::FORMAT_RGBA8, image_data);
+
+ return OK;
+}
+
+Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear) {
+
+ PoolVector<uint8_t> src_image;
+ int src_image_len = f->get_len();
+ ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
+ ERR_FAIL_COND_V(src_image_len < sizeof(tga_header_s), ERR_FILE_CORRUPT);
+ src_image.resize(src_image_len);
+
+ Error err = OK;
+
+ tga_header_s tga_header;
+ tga_header.id_length = f->get_8();
+ tga_header.color_map_type = f->get_8();
+ tga_header.image_type = static_cast<tga_type_e>(f->get_8());
+
+ tga_header.first_color_entry = f->get_16();
+ tga_header.color_map_length = f->get_16();
+ tga_header.color_map_depth = f->get_8();
+
+ tga_header.x_origin = f->get_16();
+ tga_header.y_origin = f->get_16();
+ tga_header.image_width = f->get_16();
+ tga_header.image_height = f->get_16();
+ tga_header.pixel_depth = f->get_8();
+ tga_header.image_descriptor = f->get_8();
+
+ bool is_encoded = (tga_header.image_type == TGA_TYPE_RLE_INDEXED || tga_header.image_type == TGA_TYPE_RLE_RGB || tga_header.image_type == TGA_TYPE_RLE_MONOCHROME);
+ bool has_color_map = (tga_header.image_type == TGA_TYPE_RLE_INDEXED || tga_header.image_type == TGA_TYPE_INDEXED);
+ bool is_monochrome = (tga_header.image_type == TGA_TYPE_RLE_MONOCHROME || tga_header.image_type == TGA_TYPE_MONOCHROME);
+
+ if (tga_header.image_type == TGA_TYPE_NO_DATA)
+ err = FAILED;
+
+ if (has_color_map) {
+ if (tga_header.color_map_length > 256 || (tga_header.color_map_depth != 24) || tga_header.color_map_type != 1) {
+ err = FAILED;
+ }
+ } else {
+ if (tga_header.color_map_type) {
+ err = FAILED;
+ }
+ }
+
+ if (tga_header.image_width <= 0 || tga_header.image_height <= 0)
+ err = FAILED;
+
+ if (tga_header.pixel_depth != 8 && tga_header.pixel_depth != 24 && tga_header.pixel_depth != 32)
+ err = FAILED;
+
+ if (err == OK) {
+ f->seek(f->get_pos() + tga_header.id_length);
+
+ PoolVector<uint8_t> palette;
+
+ if (has_color_map) {
+ size_t color_map_size = tga_header.color_map_length * (tga_header.color_map_depth >> 3);
+ err = palette.resize(color_map_size);
+ if (err == OK) {
+ PoolVector<uint8_t>::Write palette_w = palette.write();
+ f->get_buffer(&palette_w[0], color_map_size);
+ } else {
+ return OK;
+ }
+ }
+
+ PoolVector<uint8_t>::Write src_image_w = src_image.write();
+ f->get_buffer(&src_image_w[0], src_image_len - f->get_pos());
+
+ PoolVector<uint8_t>::Read src_image_r = src_image.read();
+
+ const size_t pixel_size = tga_header.pixel_depth >> 3;
+ const size_t buffer_size = (tga_header.image_width * tga_header.image_height) * pixel_size;
+
+ PoolVector<uint8_t> uncompressed_buffer;
+ uncompressed_buffer.resize(buffer_size);
+ PoolVector<uint8_t>::Write uncompressed_buffer_w = uncompressed_buffer.write();
+ PoolVector<uint8_t>::Read uncompressed_buffer_r;
+
+ const uint8_t *buffer = NULL;
+
+ if (is_encoded) {
+
+ err = decode_tga_rle(src_image_r.ptr(), pixel_size, uncompressed_buffer_w.ptr(), buffer_size);
+
+ if (err == OK) {
+ uncompressed_buffer_r = uncompressed_buffer.read();
+ buffer = uncompressed_buffer_r.ptr();
+ }
+ } else {
+ buffer = src_image_r.ptr();
+ };
+
+ if (err == OK) {
+ PoolVector<uint8_t>::Read palette_r = palette.read();
+ err = convert_to_image(p_image, buffer, tga_header, palette_r.ptr(), is_monochrome);
+ }
+ }
+
+ f->close();
+ return err;
+}
+
+void ImageLoaderTGA::get_recognized_extensions(List<String> *p_extensions) const {
+
+ p_extensions->push_back("tga");
+}
+
+ImageLoaderTGA::ImageLoaderTGA() {
+}
diff --git a/modules/tga/image_loader_tga.h b/modules/tga/image_loader_tga.h
new file mode 100644
index 0000000000..11329ec68a
--- /dev/null
+++ b/modules/tga/image_loader_tga.h
@@ -0,0 +1,83 @@
+/*************************************************************************/
+/* image_loader_jpegd.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 IMAGE_LOADER_TGA_H
+#define IMAGE_LOADER_TGA_H
+
+#include "io/image_loader.h"
+
+/**
+ @author SaracenOne
+*/
+class ImageLoaderTGA : public ImageFormatLoader {
+ enum tga_type_e {
+ TGA_TYPE_NO_DATA = 0,
+ TGA_TYPE_INDEXED = 1,
+ TGA_TYPE_RGB = 2,
+ TGA_TYPE_MONOCHROME = 3,
+ TGA_TYPE_RLE_INDEXED = 9,
+ TGA_TYPE_RLE_RGB = 10,
+ TGA_TYPE_RLE_MONOCHROME = 11
+ };
+
+ enum tga_origin_e {
+ TGA_ORIGIN_BOTTOM_LEFT = 0x00,
+ TGA_ORIGIN_BOTTOM_RIGHT = 0x01,
+ TGA_ORIGIN_TOP_LEFT = 0x02,
+ TGA_ORIGIN_TOP_RIGHT = 0x03,
+ TGA_ORIGIN_SHIFT = 0x04,
+ TGA_ORIGIN_MASK = 0x30
+ };
+
+ struct tga_header_s {
+ uint8_t id_length;
+ uint8_t color_map_type;
+ tga_type_e image_type;
+
+ uint16_t first_color_entry;
+ uint16_t color_map_length;
+ uint8_t color_map_depth;
+
+ uint16_t x_origin;
+ uint16_t y_origin;
+ uint16_t image_width;
+ uint16_t image_height;
+ uint8_t pixel_depth;
+ uint8_t image_descriptor;
+ };
+ static Error decode_tga_rle(const uint8_t *p_compressed_buffer, size_t p_pixel_size, uint8_t *p_uncompressed_buffer, size_t p_output_size);
+ static Error convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const tga_header_s &p_header, const uint8_t *p_palette, const bool p_is_monochrome);
+
+public:
+ virtual Error load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear);
+ virtual void get_recognized_extensions(List<String> *p_extensions) const;
+ ImageLoaderTGA();
+};
+
+#endif
diff --git a/platform/bb10/godot_bb10.cpp b/modules/tga/register_types.cpp
index e1826450a6..6e120fa3bf 100644
--- a/platform/bb10/godot_bb10.cpp
+++ b/modules/tga/register_types.cpp
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* godot_bb10.cpp */
+/* register_types.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,22 +27,19 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "main/main.h"
-#include "os_bb10.h"
+#include "register_types.h"
-#include <unistd.h>
+#include "image_loader_tga.h"
-int main(int argc, char *argv[]) {
+static ImageLoaderTGA *image_loader_tga = NULL;
- OSBB10 os;
+void register_tga_types() {
- Error err = Main::setup(argv[0], argc - 1, &argv[1]);
- if (err != OK)
- return 255;
+ image_loader_tga = memnew(ImageLoaderTGA);
+ ImageLoader::add_image_format_loader(image_loader_tga);
+}
- if (Main::start())
- os.run(); // it is actually the OS that decides how to run
- Main::cleanup();
+void unregister_tga_types() {
- return os.get_exit_code();
+ memdelete(image_loader_tga);
}
diff --git a/modules/cscript/register_types.cpp b/modules/tga/register_types.h
index 2477bc51e2..079b7bf291 100644
--- a/modules/cscript/register_types.cpp
+++ b/modules/tga/register_types.h
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* register_types.cpp */
+/* register_types.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,9 +27,5 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "register_types.h"
-
-void register_cscript_types() {
-}
-void unregister_cscript_types() {
-}
+void register_tga_types();
+void unregister_tga_types();
diff --git a/modules/theora/register_types.cpp b/modules/theora/register_types.cpp
index deb54b5d80..1bea5439a3 100644
--- a/modules/theora/register_types.cpp
+++ b/modules/theora/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/theora/register_types.h b/modules/theora/register_types.h
index 582aa785c7..cb9f9d1848 100644
--- a/modules/theora/register_types.h
+++ b/modules/theora/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp
index c390701adb..977062dd14 100644
--- a/modules/theora/video_stream_theora.cpp
+++ b/modules/theora/video_stream_theora.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,9 +29,10 @@
/*************************************************************************/
#include "video_stream_theora.h"
-#include "global_config.h"
#include "os/os.h"
-#include "yuv2rgb.h"
+#include "project_settings.h"
+
+#include "thirdparty/misc/yuv2rgb.h"
int VideoStreamPlaybackTheora::buffer_data() {
@@ -136,7 +138,7 @@ void VideoStreamPlaybackTheora::video_write(void) {
format = Image::FORMAT_RGBA8;
}
- Image img(size.x, size.y, 0, Image::FORMAT_RGBA8, frame_data); //zero copy image creation
+ Ref<Image> img = memnew(Image(size.x, size.y, 0, Image::FORMAT_RGBA8, frame_data)); //zero copy image creation
texture->set_data(img); //zero copy send to visual server
@@ -726,7 +728,7 @@ void VideoStreamPlaybackTheora::play() {
}
playing = true;
- delay_compensation = GlobalConfig::get_singleton()->get("audio/video_delay_compensation_ms");
+ delay_compensation = ProjectSettings::get_singleton()->get("audio/video_delay_compensation_ms");
delay_compensation /= 1000.0;
};
diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h
index ea568906da..84b665382b 100644
--- a/modules/theora/video_stream_theora.h
+++ b/modules/theora/video_stream_theora.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/tinyexr/SCsub b/modules/tinyexr/SCsub
new file mode 100644
index 0000000000..38fd00cc65
--- /dev/null
+++ b/modules/tinyexr/SCsub
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+Import('env')
+Import('env_modules')
+
+env_tinyexr = env_modules.Clone()
+
+# Thirdparty source files
+# Not unbundled for now as they are not commonly available as shared library
+thirdparty_dir = "#thirdparty/tinyexr/"
+thirdparty_sources = [
+ "tinyexr.cc",
+]
+thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+
+env_tinyexr.add_source_files(env.modules_sources, thirdparty_sources)
+env_tinyexr.Append(CPPPATH=[thirdparty_dir])
+
+# Godot's own source files
+env_tinyexr.add_source_files(env.modules_sources, "*.cpp")
diff --git a/modules/tinyexr/config.py b/modules/tinyexr/config.py
new file mode 100644
index 0000000000..2e4b96a6b0
--- /dev/null
+++ b/modules/tinyexr/config.py
@@ -0,0 +1,11 @@
+
+def can_build(platform):
+ return True
+
+
+def configure(env):
+ # Tools only, disabled for non-tools
+ # TODO: Find a cleaner way to achieve that
+ if (env["tools"] == "no"):
+ env["module_tinyexr_enabled"] = "no"
+ env.disabled_modules.append("tinyexr")
diff --git a/modules/tinyexr/image_loader_tinyexr.cpp b/modules/tinyexr/image_loader_tinyexr.cpp
new file mode 100644
index 0000000000..4eb91da10b
--- /dev/null
+++ b/modules/tinyexr/image_loader_tinyexr.cpp
@@ -0,0 +1,168 @@
+/*************************************************************************/
+/* image_loader_jpegd.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "image_loader_tinyexr.h"
+
+#include "os/os.h"
+#include "print_string.h"
+
+#include "thirdparty/tinyexr/tinyexr.h"
+
+Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear) {
+
+ PoolVector<uint8_t> src_image;
+ int src_image_len = f->get_len();
+ ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
+ src_image.resize(src_image_len);
+
+ PoolVector<uint8_t>::Write w = src_image.write();
+
+ f->get_buffer(&w[0], src_image_len);
+
+ f->close();
+
+ EXRVersion exr_version;
+ EXRImage exr_image;
+ EXRHeader exr_header;
+ const char *err = NULL;
+
+ InitEXRHeader(&exr_header);
+
+ int ret = ParseEXRVersionFromMemory(&exr_version, w.ptr(), src_image_len);
+ if (ret != TINYEXR_SUCCESS) {
+
+ return ERR_FILE_CORRUPT;
+ }
+
+ ret = ParseEXRHeaderFromMemory(&exr_header, &exr_version, w.ptr(), src_image_len, &err);
+ if (ret != TINYEXR_SUCCESS) {
+ if (err) {
+ ERR_PRINTS(String(err));
+ }
+ return ERR_FILE_CORRUPT;
+ }
+
+ InitEXRImage(&exr_image);
+ ret = LoadEXRImageFromMemory(&exr_image, &exr_header, w.ptr(), src_image_len, &err);
+ if (ret != TINYEXR_SUCCESS) {
+ if (err) {
+ ERR_PRINTS(String(err));
+ }
+ return ERR_FILE_CORRUPT;
+ }
+
+ // RGBA
+ int idxR = -1;
+ int idxG = -1;
+ int idxB = -1;
+ int idxA = -1;
+ for (int c = 0; c < exr_header.num_channels; c++) {
+ if (strcmp(exr_header.channels[c].name, "R") == 0) {
+ idxR = c;
+ } else if (strcmp(exr_header.channels[c].name, "G") == 0) {
+ idxG = c;
+ } else if (strcmp(exr_header.channels[c].name, "B") == 0) {
+ idxB = c;
+ } else if (strcmp(exr_header.channels[c].name, "A") == 0) {
+ idxA = c;
+ }
+ }
+
+ if (idxR == -1) {
+ ERR_PRINT("R channel not found");
+ // @todo { free exr_image }
+ return ERR_FILE_CORRUPT;
+ }
+
+ if (idxG == -1) {
+ ERR_PRINT("G channel not found\n")
+ // @todo { free exr_image }
+ return ERR_FILE_CORRUPT;
+ }
+
+ if (idxB == -1) {
+ ERR_PRINT("B channel not found\n")
+ // @todo { free exr_image }
+ return ERR_FILE_CORRUPT;
+ }
+
+ PoolVector<uint8_t> imgdata;
+ Image::Format format;
+
+ if (idxA > 0) {
+
+ imgdata.resize(exr_image.width * exr_image.height * 8); //RGBA16
+ format = Image::FORMAT_RGBAH;
+ } else {
+
+ imgdata.resize(exr_image.width * exr_image.height * 6); //RGB16
+ format = Image::FORMAT_RGBH;
+ }
+
+ {
+
+ PoolVector<uint8_t>::Write wd = imgdata.write();
+ uint16_t *iw = (uint16_t *)wd.ptr();
+
+ // Assume `out_rgba` have enough memory allocated.
+ for (int i = 0; i < exr_image.width * exr_image.height; i++) {
+
+ Color color(
+ reinterpret_cast<float **>(exr_image.images)[idxR][i],
+ reinterpret_cast<float **>(exr_image.images)[idxG][i],
+ reinterpret_cast<float **>(exr_image.images)[idxB][i]);
+
+ if (p_force_linear)
+ color = color.to_linear();
+
+ *iw++ = Math::make_half_float(color.r);
+ *iw++ = Math::make_half_float(color.g);
+ *iw++ = Math::make_half_float(color.b);
+
+ if (idxA > 0) {
+ *iw++ = Math::make_half_float(reinterpret_cast<float **>(exr_image.images)[idxA][i]);
+ }
+ }
+ }
+
+ print_line("EXR w: " + itos(exr_image.width) + " h:" + itos(exr_image.height) + " format " + Image::get_format_name(format));
+ p_image->create(exr_image.width, exr_image.height, false, format, imgdata);
+
+ w = PoolVector<uint8_t>::Write();
+
+ return OK;
+}
+
+void ImageLoaderTinyEXR::get_recognized_extensions(List<String> *p_extensions) const {
+
+ p_extensions->push_back("exr");
+}
+
+ImageLoaderTinyEXR::ImageLoaderTinyEXR() {
+}
diff --git a/modules/tinyexr/image_loader_tinyexr.h b/modules/tinyexr/image_loader_tinyexr.h
new file mode 100644
index 0000000000..a52894b12b
--- /dev/null
+++ b/modules/tinyexr/image_loader_tinyexr.h
@@ -0,0 +1,46 @@
+/*************************************************************************/
+/* image_loader_jpegd.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 IMAGE_LOADER_TINYEXR_H
+#define IMAGE_LOADER_TINYEXR_H
+
+#include "io/image_loader.h"
+
+/**
+ @author Juan Linietsky <reduzio@gmail.com>
+*/
+class ImageLoaderTinyEXR : public ImageFormatLoader {
+
+public:
+ virtual Error load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear);
+ virtual void get_recognized_extensions(List<String> *p_extensions) const;
+ ImageLoaderTinyEXR();
+};
+
+#endif
diff --git a/modules/tinyexr/register_types.cpp b/modules/tinyexr/register_types.cpp
new file mode 100644
index 0000000000..73f3131276
--- /dev/null
+++ b/modules/tinyexr/register_types.cpp
@@ -0,0 +1,45 @@
+/*************************************************************************/
+/* register_types.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "register_types.h"
+
+#include "image_loader_tinyexr.h"
+
+static ImageLoaderTinyEXR *image_loader_tinyexr = NULL;
+
+void register_tinyexr_types() {
+
+ image_loader_tinyexr = memnew(ImageLoaderTinyEXR);
+ ImageLoader::add_image_format_loader(image_loader_tinyexr);
+}
+
+void unregister_tinyexr_types() {
+
+ memdelete(image_loader_tinyexr);
+}
diff --git a/modules/cscript/godot_c.cpp b/modules/tinyexr/register_types.h
index f754f2bb21..f3c7372359 100644
--- a/modules/cscript/godot_c.cpp
+++ b/modules/tinyexr/register_types.h
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* godot_c.cpp */
+/* register_types.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,4 +27,5 @@
/* 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"
+void register_tinyexr_types();
+void unregister_tinyexr_types();
diff --git a/modules/visual_script/register_types.cpp b/modules/visual_script/register_types.cpp
index b05ea716ed..a54d306aff 100644
--- a/modules/visual_script/register_types.cpp
+++ b/modules/visual_script/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -87,8 +88,9 @@ void register_visual_script_types() {
ClassDB::register_class<VisualScriptWhile>();
ClassDB::register_class<VisualScriptIterator>();
ClassDB::register_class<VisualScriptSequence>();
- ClassDB::register_class<VisualScriptInputFilter>();
+ //ClassDB::register_class<VisualScriptInputFilter>();
ClassDB::register_class<VisualScriptSwitch>();
+ ClassDB::register_class<VisualScriptSelect>();
ClassDB::register_class<VisualScriptYield>();
ClassDB::register_class<VisualScriptYieldSignal>();
diff --git a/modules/visual_script/register_types.h b/modules/visual_script/register_types.h
index f6904420bd..2c0ee56268 100644
--- a/modules/visual_script/register_types.h
+++ b/modules/visual_script/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp
index 610309afca..d1cf0f1dce 100644
--- a/modules/visual_script/visual_script.cpp
+++ b/modules/visual_script/visual_script.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "visual_script.h"
-#include "global_config.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/main/node.h"
#include "visual_script_nodes.h"
@@ -121,9 +122,9 @@ Array VisualScriptNode::_get_default_input_values() const {
void VisualScriptNode::_bind_methods() {
- 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("get_visual_script"), &VisualScriptNode::get_visual_script);
+ ClassDB::bind_method(D_METHOD("set_default_input_value", "port_idx", "value"), &VisualScriptNode::set_default_input_value);
+ ClassDB::bind_method(D_METHOD("get_default_input_value", "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);
@@ -139,7 +140,7 @@ VisualScriptNode::TypeGuess VisualScriptNode::guess_output_type(TypeGuess *p_inp
tg.type = pinfo.type;
if (pinfo.hint == PROPERTY_HINT_RESOURCE_TYPE) {
- tg.GDCLASS = pinfo.hint_string;
+ tg.gdclass = pinfo.hint_string;
}
return tg;
@@ -659,6 +660,9 @@ void VisualScript::set_variable_export(const StringName &p_name, bool p_export)
ERR_FAIL_COND(!variables.has(p_name));
variables[p_name]._export = p_export;
+#ifdef TOOLS_ENABLED
+ _update_placeholders();
+#endif
}
bool VisualScript::get_variable_export(const StringName &p_name) const {
@@ -1054,6 +1058,10 @@ MethodInfo VisualScript::get_method_info(const StringName &p_method) const {
arg.type = func->get_argument_type(i);
mi.arguments.push_back(arg);
}
+
+ if (!func->is_sequenced()) {
+ mi.flags |= METHOD_FLAG_CONST;
+ }
}
}
@@ -1066,12 +1074,26 @@ void VisualScript::get_script_property_list(List<PropertyInfo> *p_list) const {
get_variable_list(&vars);
for (List<StringName>::Element *E = vars.front(); E; E = E->next()) {
- if (!variables[E->get()]._export)
- continue;
- p_list->push_back(variables[E->get()].info);
+ //if (!variables[E->get()]._export)
+ // continue;
+ PropertyInfo pi = variables[E->get()].info;
+ pi.usage |= PROPERTY_USAGE_SCRIPT_VARIABLE;
+ p_list->push_back(pi);
}
}
+int VisualScript::get_member_line(const StringName &p_member) const {
+#ifdef TOOLS_ENABLED
+ if (has_function(p_member)) {
+ for (Map<int, Function::NodeData>::Element *E = functions[p_member].nodes.front(); E; E = E->next()) {
+ if (E->get().node->cast_to<VisualScriptFunction>())
+ return E->key();
+ }
+ }
+#endif
+ return -1;
+}
+
#ifdef TOOLS_ENABLED
bool VisualScript::are_subnodes_edited() const {
@@ -1246,8 +1268,8 @@ void VisualScript::_bind_methods() {
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(D_METHOD("set_function_scroll", "name", "ofs"), &VisualScript::set_function_scroll);
+ ClassDB::bind_method(D_METHOD("get_function_scroll", "name"), &VisualScript::get_function_scroll);
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);
@@ -1284,7 +1306,7 @@ void VisualScript::_bind_methods() {
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_remove_argument", "name", "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);
@@ -1345,6 +1367,7 @@ void VisualScriptInstance::get_property_list(List<PropertyInfo> *p_properties) c
continue;
PropertyInfo p = E->get().info;
p.name = String(E->key());
+ p.usage |= PROPERTY_USAGE_SCRIPT_VARIABLE;
p_properties->push_back(p);
}
}
@@ -1382,6 +1405,10 @@ void VisualScriptInstance::get_method_list(List<MethodInfo> *p_list) const {
mi.arguments.push_back(arg);
}
+ if (!vsf->is_sequenced()) { //assumed constant if not sequenced
+ mi.flags |= METHOD_FLAG_CONST;
+ }
+
//vsf->Get_ for now at least it does not return..
}
}
@@ -1588,8 +1615,8 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
}
//step 1, capture all state
- state->instance_id = get_owner_ptr()->get_instance_ID();
- state->script_id = get_script()->get_instance_ID();
+ state->instance_id = get_owner_ptr()->get_instance_id();
+ state->script_id = get_script()->get_instance_id();
state->instance = this;
state->function = p_method;
state->working_mem_index = node->working_mem_idx;
@@ -2299,7 +2326,7 @@ Variant VisualScriptFunctionState::resume(Array p_args) {
void VisualScriptFunctionState::_bind_methods() {
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("resume", "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"));
}
@@ -2356,6 +2383,17 @@ Ref<Script> VisualScriptLanguage::get_template(const String &p_class_name, const
script->set_instance_base_type(p_base_class_name);
return script;
}
+
+bool VisualScriptLanguage::is_using_templates() {
+
+ return true;
+}
+
+void VisualScriptLanguage::make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script) {
+ Ref<VisualScript> script = p_script;
+ script->set_instance_base_type(p_base_class_name);
+}
+
bool VisualScriptLanguage::validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List<String> *r_functions) const {
return false;
@@ -2387,7 +2425,7 @@ void VisualScriptLanguage::add_global_constant(const StringName &p_variable, con
bool VisualScriptLanguage::debug_break_parse(const String &p_file, int p_node, const String &p_error) {
//break because of parse error
- if (ScriptDebugger::get_singleton() && Thread::get_caller_ID() == Thread::get_main_ID()) {
+ if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) {
_debug_parse_err_node = p_node;
_debug_parse_err_file = p_file;
@@ -2401,7 +2439,7 @@ bool VisualScriptLanguage::debug_break_parse(const String &p_file, int p_node, c
bool VisualScriptLanguage::debug_break(const String &p_error, bool p_allow_continue) {
- if (ScriptDebugger::get_singleton() && Thread::get_caller_ID() == Thread::get_main_ID()) {
+ if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) {
_debug_parse_err_node = -1;
_debug_parse_err_file = "";
@@ -2628,7 +2666,7 @@ VisualScriptLanguage::VisualScriptLanguage() {
_debug_parse_err_node = -1;
_debug_parse_err_file = "";
_debug_call_stack_pos = 0;
- int dmcs = GLOBAL_DEF("debug/script/max_call_stack", 1024);
+ int dmcs = GLOBAL_DEF("debug/settings/visual_script/max_call_stack", 1024);
if (ScriptDebugger::get_singleton()) {
//debugging enabled!
_debug_max_call_stack = dmcs;
diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h
index e3af3f4a1b..b61b67a890 100644
--- a/modules/visual_script/visual_script.h
+++ b/modules/visual_script/visual_script.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -88,13 +89,11 @@ public:
struct TypeGuess {
Variant::Type type;
- InputEvent::Type ev_type;
- StringName GDCLASS;
+ StringName gdclass;
Ref<Script> script;
TypeGuess() {
type = Variant::NIL;
- ev_type = InputEvent::NONE;
}
};
@@ -292,8 +291,8 @@ public:
void data_disconnect(const StringName &p_func, int p_from_node, int p_from_port, int p_to_node, int p_to_port);
bool has_data_connection(const StringName &p_func, int p_from_node, int p_from_port, int p_to_node, int p_to_port) const;
void get_data_connection_list(const StringName &p_func, List<DataConnection> *r_connection) const;
- bool is_input_value_port_connected(const StringName &p_name, int p_node, int p_port) const;
- bool get_input_value_port_connection_source(const StringName &p_name, int p_node, int p_port, int *r_node, int *r_port) const;
+ bool is_input_value_port_connected(const StringName &p_func, int p_node, int p_port) const;
+ bool get_input_value_port_connection_source(const StringName &p_func, int p_node, int p_port, int *r_node, int *r_port) const;
void add_variable(const StringName &p_name, const Variant &p_default_value = Variant(), bool p_export = false);
bool has_variable(const StringName &p_name) const;
@@ -355,6 +354,8 @@ public:
virtual void get_script_property_list(List<PropertyInfo> *p_list) const;
+ virtual int get_member_line(const StringName &p_member) const;
+
#ifdef TOOLS_ENABLED
virtual bool are_subnodes_edited() const;
#endif
@@ -508,7 +509,7 @@ public:
_FORCE_INLINE_ void enter_function(VisualScriptInstance *p_instance, const StringName *p_function, Variant *p_stack, Variant **p_work_mem, int *current_id) {
- if (Thread::get_main_ID() != Thread::get_caller_ID())
+ if (Thread::get_main_id() != Thread::get_caller_id())
return; //no support for other threads than main for now
if (ScriptDebugger::get_singleton()->get_lines_left() > 0 && ScriptDebugger::get_singleton()->get_depth() >= 0)
@@ -531,7 +532,7 @@ public:
_FORCE_INLINE_ void exit_function() {
- if (Thread::get_main_ID() != Thread::get_caller_ID())
+ if (Thread::get_main_id() != Thread::get_caller_id())
return; //no support for other threads than main for now
if (ScriptDebugger::get_singleton()->get_lines_left() > 0 && ScriptDebugger::get_singleton()->get_depth() >= 0)
@@ -563,11 +564,14 @@ public:
virtual void get_comment_delimiters(List<String> *p_delimiters) const;
virtual void get_string_delimiters(List<String> *p_delimiters) const;
virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const;
+ virtual bool is_using_templates();
+ virtual void make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script);
virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List<String> *r_functions = NULL) const;
virtual Script *create_script() const;
virtual bool has_named_classes() const;
virtual int find_function(const String &p_function, const String &p_code) const;
virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const;
+ virtual Error open_in_external_editor(const Ref<Script> &p_script, int p_line, int p_col) { return ERR_UNAVAILABLE; }
virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const;
virtual void add_global_constant(const StringName &p_variable, const Variant &p_value);
diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp
index 378ca06f90..203e0bb483 100644
--- a/modules/visual_script/visual_script_builtin_funcs.cpp
+++ b/modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/visual_script/visual_script_builtin_funcs.h b/modules/visual_script/visual_script_builtin_funcs.h
index 7246239513..8e9c0eca76 100644
--- a/modules/visual_script/visual_script_builtin_funcs.h
+++ b/modules/visual_script/visual_script_builtin_funcs.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index ae2d4d5df3..0f6b47c56d 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -51,11 +52,13 @@ public:
protected:
static void _bind_methods() {
ClassDB::bind_method("_sig_changed", &VisualScriptEditorSignalEdit::_sig_changed);
+ ADD_SIGNAL(MethodInfo("changed"));
}
void _sig_changed() {
_change_notify();
+ emit_signal("changed");
}
bool _set(const StringName &p_name, const Variant &p_value) {
@@ -190,15 +193,18 @@ protected:
static void _bind_methods() {
ClassDB::bind_method("_var_changed", &VisualScriptEditorVariableEdit::_var_changed);
ClassDB::bind_method("_var_value_changed", &VisualScriptEditorVariableEdit::_var_value_changed);
+ ADD_SIGNAL(MethodInfo("changed"));
}
void _var_changed() {
_change_notify();
+ emit_signal("changed");
}
void _var_value_changed() {
_change_notify("value"); //so the whole tree is not redrawn, makes editing smoother in general
+ emit_signal("changed");
}
bool _set(const StringName &p_name, const Variant &p_value) {
@@ -260,6 +266,7 @@ protected:
if (String(p_name) == "export") {
script->set_variable_export(var, p_value);
+ EditorNode::get_singleton()->get_property_editor()->update_tree();
return true;
}
@@ -345,11 +352,9 @@ static Color _color_from_type(Variant::Type p_type) {
case Variant::TRANSFORM: color = Color::html("f6a86e"); break;
case Variant::COLOR: color = Color::html("9dff70"); break;
- case Variant::IMAGE: color = Color::html("93f1b9"); break;
case Variant::NODE_PATH: color = Color::html("6993ec"); break;
case Variant::_RID: color = Color::html("69ec9a"); break;
case Variant::OBJECT: color = Color::html("79f3e8"); break;
- case Variant::INPUT_EVENT: color = Color::html("adf18f"); break;
case Variant::DICTIONARY: color = Color::html("77edb1"); break;
case Variant::ARRAY: color = Color::html("e0e0e0"); break;
@@ -450,11 +455,9 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
Control::get_icon("MiniBasis", "EditorIcons"),
Control::get_icon("MiniTransform", "EditorIcons"),
Control::get_icon("MiniColor", "EditorIcons"),
- Control::get_icon("MiniImage", "EditorIcons"),
Control::get_icon("MiniPath", "EditorIcons"),
Control::get_icon("MiniRid", "EditorIcons"),
Control::get_icon("MiniObject", "EditorIcons"),
- Control::get_icon("MiniInput", "EditorIcons"),
Control::get_icon("MiniDictionary", "EditorIcons"),
Control::get_icon("MiniArray", "EditorIcons"),
Control::get_icon("MiniRawArray", "EditorIcons"),
@@ -489,7 +492,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
}
if (EditorSettings::get_singleton()->has("editors/visual_script/color_" + node->get_category())) {
- gnode->set_modulate(EditorSettings::get_singleton()->get("editors/visual_script/color_" + node->get_category()));
+ Color c = EditorSettings::get_singleton()->get("editors/visual_script/color_" + node->get_category());
+ gnode->set_self_modulate(c);
}
gnode->set_meta("__vnode", node);
@@ -611,7 +615,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
Ref<Resource> res = value;
Array arr;
- arr.push_back(button->get_instance_ID());
+ arr.push_back(button->get_instance_id());
arr.push_back(String(value));
EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res, this, "_button_resource_previewed", arr);
@@ -702,7 +706,7 @@ void VisualScriptEditor::_update_members() {
ti->set_selectable(0, true);
ti->set_editable(0, true);
//ti->add_button(0,Control::get_icon("Edit","EditorIcons"),0); function arguments are in the node now
- ti->add_button(0, Control::get_icon("Del", "EditorIcons"), 1);
+ //ti->add_button(0, Control::get_icon("Del", "EditorIcons"), 1);
ti->set_metadata(0, E->get());
if (E->get() == edited_func) {
ti->set_custom_bg_color(0, get_color("prop_category", "Editor"));
@@ -734,11 +738,9 @@ void VisualScriptEditor::_update_members() {
Control::get_icon("MiniMatrix3", "EditorIcons"),
Control::get_icon("MiniTransform", "EditorIcons"),
Control::get_icon("MiniColor", "EditorIcons"),
- Control::get_icon("MiniImage", "EditorIcons"),
Control::get_icon("MiniPath", "EditorIcons"),
Control::get_icon("MiniRid", "EditorIcons"),
Control::get_icon("MiniObject", "EditorIcons"),
- Control::get_icon("MiniInput", "EditorIcons"),
Control::get_icon("MiniDictionary", "EditorIcons"),
Control::get_icon("MiniArray", "EditorIcons"),
Control::get_icon("MiniRawArray", "EditorIcons"),
@@ -762,8 +764,8 @@ void VisualScriptEditor::_update_members() {
ti->set_selectable(0, true);
ti->set_editable(0, true);
- ti->add_button(0, Control::get_icon("Edit", "EditorIcons"), 0);
- ti->add_button(0, Control::get_icon("Del", "EditorIcons"), 1);
+ //ti->add_button(0, Control::get_icon("Edit", "EditorIcons"), 0);
+ //ti->add_button(0, Control::get_icon("Del", "EditorIcons"), 1);
ti->set_metadata(0, E->get());
if (selected == E->get())
ti->select(0);
@@ -782,8 +784,8 @@ void VisualScriptEditor::_update_members() {
ti->set_text(0, E->get());
ti->set_selectable(0, true);
ti->set_editable(0, true);
- ti->add_button(0, Control::get_icon("Edit", "EditorIcons"), 0);
- ti->add_button(0, Control::get_icon("Del", "EditorIcons"), 1);
+ //ti->add_button(0, Control::get_icon("Edit", "EditorIcons"), 0);
+ //ti->add_button(0, Control::get_icon("Del", "EditorIcons"), 1);
ti->set_metadata(0, E->get());
if (selected == E->get())
ti->select(0);
@@ -867,15 +869,27 @@ void VisualScriptEditor::_member_edited() {
}
selected = new_name;
- _update_graph();
-
+ int node_id = script->get_function_node_id(name);
+ Ref<VisualScriptFunction> func;
+ if (script->has_node(name, node_id)) {
+ func = script->get_node(name, node_id);
+ }
undo_redo->create_action(TTR("Rename Function"));
undo_redo->add_do_method(script.ptr(), "rename_function", name, new_name);
undo_redo->add_undo_method(script.ptr(), "rename_function", new_name, name);
+ if (func.is_valid()) {
+
+ undo_redo->add_do_method(func.ptr(), "set_name", new_name);
+ undo_redo->add_undo_method(func.ptr(), "set_name", name);
+ }
undo_redo->add_do_method(this, "_update_members");
undo_redo->add_undo_method(this, "_update_members");
+ undo_redo->add_do_method(this, "_update_graph");
+ undo_redo->add_undo_method(this, "_update_graph");
undo_redo->commit_action();
+ // _update_graph();
+
return; //or crash because it will become invalid
}
@@ -1016,7 +1030,7 @@ void VisualScriptEditor::_member_button(Object *p_item, int p_column, int p_butt
}
Rect2 pos = members->get_item_rect(ti);
- new_function_menu->set_pos(members->get_global_pos() + pos.pos + Vector2(0, pos.size.y));
+ new_function_menu->set_position(members->get_global_position() + pos.position + Vector2(0, pos.size.y));
new_function_menu->popup();
return;
} else if (p_button == 0) {
@@ -1073,105 +1087,6 @@ void VisualScriptEditor::_member_button(Object *p_item, int p_column, int p_butt
undo_redo->commit_action();
return; //or crash because it will become invalid
}
-
- } else {
-
- if (ti->get_parent() == root->get_children()) {
- //edit/remove function
- String name = ti->get_metadata(0);
-
- if (p_button == 1) {
- //delete the function
- undo_redo->create_action(TTR("Remove Function"));
- undo_redo->add_do_method(script.ptr(), "remove_function", name);
- undo_redo->add_undo_method(script.ptr(), "add_function", name);
- List<int> nodes;
- script->get_node_list(name, &nodes);
- for (List<int>::Element *E = nodes.front(); E; E = E->next()) {
- undo_redo->add_undo_method(script.ptr(), "add_node", name, E->get(), script->get_node(name, E->get()), script->get_node_pos(name, E->get()));
- }
-
- List<VisualScript::SequenceConnection> seq_connections;
-
- script->get_sequence_connection_list(name, &seq_connections);
-
- for (List<VisualScript::SequenceConnection>::Element *E = seq_connections.front(); E; E = E->next()) {
- undo_redo->add_undo_method(script.ptr(), "sequence_connect", name, E->get().from_node, E->get().from_output, E->get().to_node);
- }
-
- List<VisualScript::DataConnection> data_connections;
-
- script->get_data_connection_list(name, &data_connections);
-
- for (List<VisualScript::DataConnection>::Element *E = data_connections.front(); E; E = E->next()) {
- undo_redo->add_undo_method(script.ptr(), "data_connect", name, E->get().from_node, E->get().from_port, E->get().to_node, E->get().to_port);
- }
-
- /*
- for(int i=0;i<script->function_get_argument_count(name);i++) {
- undo_redo->add_undo_method(script.ptr(),"function_add_argument",name,script->function_get_argument_name(name,i),script->function_get_argument_type(name,i));
- }
- */
- undo_redo->add_do_method(this, "_update_members");
- undo_redo->add_undo_method(this, "_update_members");
- undo_redo->add_do_method(this, "_update_graph");
- undo_redo->add_undo_method(this, "_update_graph");
- undo_redo->commit_action();
-
- } else if (p_button == 0) {
- }
- return; //or crash because it will become invalid
- }
-
- if (ti->get_parent() == root->get_children()->get_next()) {
- //edit/remove variable
-
- String name = ti->get_metadata(0);
-
- if (p_button == 1) {
-
- undo_redo->create_action(TTR("Remove Variable"));
- undo_redo->add_do_method(script.ptr(), "remove_variable", name);
- undo_redo->add_undo_method(script.ptr(), "add_variable", name, script->get_variable_default_value(name));
- undo_redo->add_undo_method(script.ptr(), "set_variable_info", name, script->call("get_variable_info", name)); //return as dict
- undo_redo->add_do_method(this, "_update_members");
- undo_redo->add_undo_method(this, "_update_members");
- undo_redo->commit_action();
- return; //or crash because it will become invalid
- } else if (p_button == 0) {
-
- variable_editor->edit(name);
- edit_variable_dialog->set_title(TTR("Editing Variable:") + " " + name);
- edit_variable_dialog->popup_centered_minsize(Size2(400, 200) * EDSCALE);
- }
- }
-
- if (ti->get_parent() == root->get_children()->get_next()->get_next()) {
- //edit/remove variable
- String name = ti->get_metadata(0);
-
- if (p_button == 1) {
-
- undo_redo->create_action(TTR("Remove Signal"));
- undo_redo->add_do_method(script.ptr(), "remove_custom_signal", name);
- undo_redo->add_undo_method(script.ptr(), "add_custom_signal", name);
-
- for (int i = 0; i < script->custom_signal_get_argument_count(name); i++) {
- undo_redo->add_undo_method(script.ptr(), "custom_signal_add_argument", name, script->custom_signal_get_argument_name(name, i), script->custom_signal_get_argument_type(name, i));
- }
-
- undo_redo->add_do_method(this, "_update_members");
- undo_redo->add_undo_method(this, "_update_members");
- undo_redo->commit_action();
- } else if (p_button == 0) {
-
- signal_editor->edit(name);
- edit_signal_dialog->set_title(TTR("Editing Signal:") + " " + name);
- edit_signal_dialog->popup_centered_minsize(Size2(400, 300) * EDSCALE);
- }
-
- return; //or crash because it will become invalid
- }
}
}
@@ -1421,9 +1336,11 @@ void VisualScriptEditor::_on_nodes_duplicate() {
}
}
-void VisualScriptEditor::_input(const InputEvent &p_event) {
+void VisualScriptEditor::_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::MOUSE_BUTTON && !p_event.mouse_button.pressed && p_event.mouse_button.button_index == BUTTON_LEFT) {
+ Ref<InputEventMouseButton> mb = p_event;
+
+ if (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
revert_on_drag = String(); //so we can still drag functions
}
}
@@ -2064,7 +1981,7 @@ String VisualScriptEditor::get_name() {
} else if (script->get_name() != "")
name = script->get_name();
else
- name = script->get_class() + "(" + itos(script->get_instance_ID()) + ")";
+ name = script->get_class() + "(" + itos(script->get_instance_id()) + ")";
return name;
}
@@ -2152,7 +2069,7 @@ void VisualScriptEditor::goto_line(int p_line, bool p_with_error) {
_update_graph();
_update_members();
- call_deferred("_center_on_node", p_line); //editor might be just created and size might not exist yet
+ call_deferred("call_deferred", "_center_on_node", p_line); //editor might be just created and size might not exist yet
return;
}
@@ -2162,6 +2079,12 @@ void VisualScriptEditor::goto_line(int p_line, bool p_with_error) {
void VisualScriptEditor::trim_trailing_whitespace() {
}
+void VisualScriptEditor::convert_indent_to_spaces() {
+}
+
+void VisualScriptEditor::convert_indent_to_tabs() {
+}
+
void VisualScriptEditor::ensure_focus() {
graph->grab_focus();
@@ -2191,18 +2114,6 @@ void VisualScriptEditor::get_breakpoints(List<int> *p_breakpoints) {
}
}
-bool VisualScriptEditor::goto_method(const String &p_method) {
-
- if (!script->has_function(p_method))
- return false;
-
- edited_func = p_method;
- selected = edited_func;
- _update_members();
- _update_graph();
- return true;
-}
-
void VisualScriptEditor::add_callback(const String &p_function, PoolStringArray p_args) {
if (script->has_function(p_function)) {
@@ -2249,6 +2160,10 @@ void VisualScriptEditor::add_callback(const String &p_function, PoolStringArray
//undo_redo->clear_history();
}
+bool VisualScriptEditor::show_members_overview() {
+ return false;
+}
+
void VisualScriptEditor::update_settings() {
_update_graph();
@@ -2274,6 +2189,11 @@ void VisualScriptEditor::_change_base_type() {
select_base_type->popup_create(true);
}
+void VisualScriptEditor::clear_edit_menu() {
+ memdelete(edit_menu);
+ memdelete(left_vsplit);
+}
+
void VisualScriptEditor::_change_base_type_callback() {
String bt = select_base_type->get_selected_type();
@@ -2420,6 +2340,16 @@ void VisualScriptEditor::_graph_connected(const String &p_from, int p_from_slot,
undo_redo->add_do_method(script.ptr(), "sequence_connect", edited_func, p_from.to_int(), from_port, p_to.to_int());
undo_redo->add_undo_method(script.ptr(), "sequence_disconnect", edited_func, p_from.to_int(), from_port, p_to.to_int());
} else {
+
+ // disconect current, and connect the new one
+ if (script->is_input_value_port_connected(edited_func, p_to.to_int(), to_port)) {
+ int conn_from;
+ int conn_port;
+ script->get_input_value_port_connection_source(edited_func, p_to.to_int(), to_port, &conn_from, &conn_port);
+ undo_redo->add_do_method(script.ptr(), "data_disconnect", edited_func, conn_from, conn_port, p_to.to_int(), to_port);
+ undo_redo->add_undo_method(script.ptr(), "data_connect", edited_func, conn_from, conn_port, p_to.to_int(), to_port);
+ }
+
undo_redo->add_do_method(script.ptr(), "data_connect", edited_func, p_from.to_int(), from_port, p_to.to_int(), to_port);
undo_redo->add_undo_method(script.ptr(), "data_disconnect", edited_func, p_from.to_int(), from_port, p_to.to_int(), to_port);
//update nodes in sgraph
@@ -2516,21 +2446,21 @@ void VisualScriptEditor::_graph_connect_to_empty(const String &p_from, int p_fro
port_action_pos = p_release_pos;
port_action_popup->set_size(Size2(1, 1));
- port_action_popup->set_pos(graph->get_global_pos() + p_release_pos);
+ port_action_popup->set_position(graph->get_global_position() + p_release_pos);
port_action_popup->popup();
}
-VisualScriptNode::TypeGuess VisualScriptEditor::_guess_output_type(int p_node, int p_output, Set<int> &visited_nodes) {
+VisualScriptNode::TypeGuess VisualScriptEditor::_guess_output_type(int p_port_action_node, int p_port_action_output, Set<int> &visited_nodes) {
VisualScriptNode::TypeGuess tg;
tg.type = Variant::NIL;
- if (visited_nodes.has(p_node))
+ if (visited_nodes.has(p_port_action_node))
return tg; //no loop
- visited_nodes.insert(p_node);
+ visited_nodes.insert(p_port_action_node);
- Ref<VisualScriptNode> node = script->get_node(edited_func, p_node);
+ Ref<VisualScriptNode> node = script->get_node(edited_func, p_port_action_node);
if (!node.is_valid()) {
@@ -2549,7 +2479,7 @@ VisualScriptNode::TypeGuess VisualScriptEditor::_guess_output_type(int p_node, i
int from_node;
int from_port;
- if (script->get_input_value_port_connection_source(edited_func, p_node, i, &from_node, &from_port)) {
+ if (script->get_input_value_port_connection_source(edited_func, p_port_action_node, i, &from_node, &from_port)) {
g = _guess_output_type(from_node, from_port, visited_nodes);
} else {
@@ -2561,7 +2491,7 @@ VisualScriptNode::TypeGuess VisualScriptEditor::_guess_output_type(int p_node, i
if (obj) {
g.type = Variant::OBJECT;
- g.GDCLASS = obj->get_class();
+ g.gdclass = obj->get_class();
g.script = obj->get_script();
}
}
@@ -2571,7 +2501,7 @@ VisualScriptNode::TypeGuess VisualScriptEditor::_guess_output_type(int p_node, i
in_guesses.push_back(g);
}
- return node->guess_output_type(in_guesses.ptr(), p_output);
+ return node->guess_output_type(in_guesses.ptr(), p_port_action_output);
}
void VisualScriptEditor::_port_action_menu(int p_option) {
@@ -2601,8 +2531,8 @@ void VisualScriptEditor::_port_action_menu(int p_option) {
if (tg.type == Variant::OBJECT) {
n->set_call_mode(VisualScriptFunctionCall::CALL_MODE_INSTANCE);
- if (tg.GDCLASS != StringName()) {
- n->set_base_type(tg.GDCLASS);
+ if (tg.gdclass != StringName()) {
+ n->set_base_type(tg.gdclass);
} else {
n->set_base_type("Object");
}
@@ -2632,8 +2562,8 @@ void VisualScriptEditor::_port_action_menu(int p_option) {
if (tg.type == Variant::OBJECT) {
n->set_call_mode(VisualScriptPropertySet::CALL_MODE_INSTANCE);
- if (tg.GDCLASS != StringName()) {
- n->set_base_type(tg.GDCLASS);
+ if (tg.gdclass != StringName()) {
+ n->set_base_type(tg.gdclass);
} else {
n->set_base_type("Object");
}
@@ -2648,7 +2578,7 @@ void VisualScriptEditor::_port_action_menu(int p_option) {
} else {
n->set_call_mode(VisualScriptPropertySet::CALL_MODE_BASIC_TYPE);
n->set_basic_type(tg.type);
- new_connect_node_select->select_property_from_basic_type(tg.type, tg.ev_type);
+ new_connect_node_select->select_property_from_basic_type(tg.type);
}
} break;
case CREATE_GET: {
@@ -2662,8 +2592,8 @@ void VisualScriptEditor::_port_action_menu(int p_option) {
if (tg.type == Variant::OBJECT) {
n->set_call_mode(VisualScriptPropertyGet::CALL_MODE_INSTANCE);
- if (tg.GDCLASS != StringName()) {
- n->set_base_type(tg.GDCLASS);
+ if (tg.gdclass != StringName()) {
+ n->set_base_type(tg.gdclass);
} else {
n->set_base_type("Object");
}
@@ -2678,7 +2608,7 @@ void VisualScriptEditor::_port_action_menu(int p_option) {
} else {
n->set_call_mode(VisualScriptPropertyGet::CALL_MODE_BASIC_TYPE);
n->set_basic_type(tg.type);
- new_connect_node_select->select_property_from_basic_type(tg.type, tg.ev_type);
+ new_connect_node_select->select_property_from_basic_type(tg.type);
}
} break;
@@ -2805,7 +2735,7 @@ void VisualScriptEditor::_default_value_edited(Node *p_button, int p_id, int p_i
existing = Variant::construct(pinfo.type, &existingp, 1, ce, false);
}
- default_value_edit->set_pos(p_button->cast_to<Control>()->get_global_pos() + Vector2(0, p_button->cast_to<Control>()->get_size().y));
+ default_value_edit->set_position(p_button->cast_to<Control>()->get_global_position() + Vector2(0, p_button->cast_to<Control>()->get_size().y));
default_value_edit->set_size(Size2(1, 1));
if (default_value_edit->edit(NULL, pinfo.name, pinfo.type, existing, pinfo.hint, pinfo.hint_string)) {
if (pinfo.hint == PROPERTY_HINT_MULTILINE_TEXT)
@@ -2838,13 +2768,18 @@ void VisualScriptEditor::_node_filter_changed(const String &p_text) {
void VisualScriptEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_READY) {
- node_filter_icon->set_texture(Control::get_icon("Zoom", "EditorIcons"));
+ node_filter->add_icon_override("right_icon", Control::get_icon("Search", "EditorIcons"));
+ variable_editor->connect("changed", this, "_update_members");
+ signal_editor->connect("changed", this, "_update_members");
+ }
+ if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
+ left_vsplit->set_visible(is_visible_in_tree());
}
}
void VisualScriptEditor::_graph_ofs_changed(const Vector2 &p_ofs) {
- if (updating_graph)
+ if (updating_graph || !script.is_valid())
return;
updating_graph = true;
@@ -3058,6 +2993,142 @@ void VisualScriptEditor::_menu_option(int p_what) {
}
}
+void VisualScriptEditor::_member_rmb_selected(const Vector2 &p_pos) {
+
+ TreeItem *ti = members->get_selected();
+ ERR_FAIL_COND(!ti);
+
+ member_popup->clear();
+ member_popup->set_position(members->get_global_position() + p_pos);
+ member_popup->set_size(Vector2());
+
+ TreeItem *root = members->get_root();
+
+ Ref<Texture> del_icon = Control::get_icon("Del", "EditorIcons");
+
+ Ref<Texture> edit_icon = Control::get_icon("Edit", "EditorIcons");
+
+ if (ti->get_parent() == root->get_children()) {
+
+ member_type = MEMBER_FUNCTION;
+ member_name = ti->get_text(0);
+ member_popup->add_icon_item(del_icon, TTR("Remove Function"), MEMBER_REMOVE);
+ member_popup->popup();
+ return;
+ }
+
+ if (ti->get_parent() == root->get_children()->get_next()) {
+
+ member_type = MEMBER_VARIABLE;
+ member_name = ti->get_text(0);
+ member_popup->add_icon_item(edit_icon, TTR("Edit Variable"), MEMBER_EDIT);
+ member_popup->add_separator();
+ member_popup->add_icon_item(del_icon, TTR("Remove Variable"), MEMBER_REMOVE);
+ member_popup->popup();
+ return;
+ }
+
+ if (ti->get_parent() == root->get_children()->get_next()->get_next()) {
+
+ member_type = MEMBER_SIGNAL;
+ member_name = ti->get_text(0);
+ member_popup->add_icon_item(edit_icon, TTR("Edit Signal"), MEMBER_EDIT);
+ member_popup->add_separator();
+ member_popup->add_icon_item(del_icon, TTR("Remove Signal"), MEMBER_REMOVE);
+ member_popup->popup();
+ return;
+ }
+}
+
+void VisualScriptEditor::_member_option(int p_option) {
+
+ switch (member_type) {
+ case MEMBER_FUNCTION: {
+
+ if (p_option == MEMBER_REMOVE) {
+ //delete the function
+ String name = member_name;
+
+ undo_redo->create_action(TTR("Remove Function"));
+ undo_redo->add_do_method(script.ptr(), "remove_function", name);
+ undo_redo->add_undo_method(script.ptr(), "add_function", name);
+ List<int> nodes;
+ script->get_node_list(name, &nodes);
+ for (List<int>::Element *E = nodes.front(); E; E = E->next()) {
+ undo_redo->add_undo_method(script.ptr(), "add_node", name, E->get(), script->get_node(name, E->get()), script->get_node_pos(name, E->get()));
+ }
+
+ List<VisualScript::SequenceConnection> seq_connections;
+
+ script->get_sequence_connection_list(name, &seq_connections);
+
+ for (List<VisualScript::SequenceConnection>::Element *E = seq_connections.front(); E; E = E->next()) {
+ undo_redo->add_undo_method(script.ptr(), "sequence_connect", name, E->get().from_node, E->get().from_output, E->get().to_node);
+ }
+
+ List<VisualScript::DataConnection> data_connections;
+
+ script->get_data_connection_list(name, &data_connections);
+
+ for (List<VisualScript::DataConnection>::Element *E = data_connections.front(); E; E = E->next()) {
+ undo_redo->add_undo_method(script.ptr(), "data_connect", name, E->get().from_node, E->get().from_port, E->get().to_node, E->get().to_port);
+ }
+
+ /*
+ for(int i=0;i<script->function_get_argument_count(name);i++) {
+ undo_redo->add_undo_method(script.ptr(),"function_add_argument",name,script->function_get_argument_name(name,i),script->function_get_argument_type(name,i));
+ }
+ */
+ undo_redo->add_do_method(this, "_update_members");
+ undo_redo->add_undo_method(this, "_update_members");
+ undo_redo->add_do_method(this, "_update_graph");
+ undo_redo->add_undo_method(this, "_update_graph");
+ undo_redo->commit_action();
+ }
+ } break;
+ case MEMBER_VARIABLE: {
+
+ String name = member_name;
+
+ if (p_option == MEMBER_REMOVE) {
+ undo_redo->create_action(TTR("Remove Variable"));
+ undo_redo->add_do_method(script.ptr(), "remove_variable", name);
+ undo_redo->add_undo_method(script.ptr(), "add_variable", name, script->get_variable_default_value(name));
+ undo_redo->add_undo_method(script.ptr(), "set_variable_info", name, script->call("get_variable_info", name)); //return as dict
+ undo_redo->add_do_method(this, "_update_members");
+ undo_redo->add_undo_method(this, "_update_members");
+ undo_redo->commit_action();
+ } else if (p_option == MEMBER_EDIT) {
+ variable_editor->edit(name);
+ edit_variable_dialog->set_title(TTR("Editing Variable:") + " " + name);
+ edit_variable_dialog->popup_centered_minsize(Size2(400, 200) * EDSCALE);
+ }
+ } break;
+ case MEMBER_SIGNAL: {
+ String name = member_name;
+
+ if (p_option == MEMBER_REMOVE) {
+ undo_redo->create_action(TTR("Remove Signal"));
+ undo_redo->add_do_method(script.ptr(), "remove_custom_signal", name);
+ undo_redo->add_undo_method(script.ptr(), "add_custom_signal", name);
+
+ for (int i = 0; i < script->custom_signal_get_argument_count(name); i++) {
+ undo_redo->add_undo_method(script.ptr(), "custom_signal_add_argument", name, script->custom_signal_get_argument_name(name, i), script->custom_signal_get_argument_type(name, i));
+ }
+
+ undo_redo->add_do_method(this, "_update_members");
+ undo_redo->add_undo_method(this, "_update_members");
+ undo_redo->commit_action();
+ } else if (p_option == MEMBER_EDIT) {
+
+ signal_editor->edit(name);
+ edit_signal_dialog->set_title(TTR("Editing Signal:") + " " + name);
+ edit_signal_dialog->popup_centered_minsize(Size2(400, 300) * EDSCALE);
+ }
+ } break;
+ }
+}
+
void VisualScriptEditor::_bind_methods() {
ClassDB::bind_method("_member_button", &VisualScriptEditor::_member_button);
@@ -3106,6 +3177,10 @@ void VisualScriptEditor::_bind_methods() {
ClassDB::bind_method("_selected_method", &VisualScriptEditor::_selected_method);
ClassDB::bind_method("_draw_color_over_button", &VisualScriptEditor::_draw_color_over_button);
+
+ ClassDB::bind_method("_member_rmb_selected", &VisualScriptEditor::_member_rmb_selected);
+
+ ClassDB::bind_method("_member_option", &VisualScriptEditor::_member_option);
}
VisualScriptEditor::VisualScriptEditor() {
@@ -3127,17 +3202,16 @@ VisualScriptEditor::VisualScriptEditor() {
edit_menu->get_popup()->connect("id_pressed", this, "_menu_option");
- main_hsplit = memnew(HSplitContainer);
- add_child(main_hsplit);
- main_hsplit->set_area_as_parent_rect();
-
left_vsplit = memnew(VSplitContainer);
- main_hsplit->add_child(left_vsplit);
+ ScriptEditor::get_singleton()->get_left_list_split()->call_deferred("add_child", left_vsplit); //add but wait until done settig up this
+ left_vsplit->set_v_size_flags(SIZE_EXPAND_FILL);
+ left_vsplit->set_stretch_ratio(2);
+ left_vsplit->hide();
VBoxContainer *left_vb = memnew(VBoxContainer);
left_vsplit->add_child(left_vb);
left_vb->set_v_size_flags(SIZE_EXPAND_FILL);
- left_vb->set_custom_minimum_size(Size2(230, 1) * EDSCALE);
+ //left_vb->set_custom_minimum_size(Size2(230, 1) * EDSCALE);
base_type_select = memnew(Button);
left_vb->add_margin_child(TTR("Base Type:"), base_type_select);
@@ -3163,9 +3237,6 @@ VisualScriptEditor::VisualScriptEditor() {
node_filter->connect("text_changed", this, "_node_filter_changed");
hbc_nodes->add_child(node_filter);
node_filter->set_h_size_flags(SIZE_EXPAND_FILL);
- node_filter_icon = memnew(TextureRect);
- node_filter_icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
- hbc_nodes->add_child(node_filter_icon);
vbc_nodes->add_child(hbc_nodes);
nodes = memnew(Tree);
@@ -3179,7 +3250,8 @@ VisualScriptEditor::VisualScriptEditor() {
nodes->set_drag_forwarding(this);
graph = memnew(GraphEdit);
- main_hsplit->add_child(graph);
+ add_child(graph);
+ graph->set_area_as_parent_rect();
graph->set_h_size_flags(SIZE_EXPAND_FILL);
graph->connect("node_selected", this, "_node_selected");
graph->connect("_begin_node_move", this, "_begin_node_move");
@@ -3195,10 +3267,11 @@ VisualScriptEditor::VisualScriptEditor() {
select_func_text->set_align(Label::ALIGN_CENTER);
select_func_text->set_valign(Label::VALIGN_CENTER);
select_func_text->set_h_size_flags(SIZE_EXPAND_FILL);
- main_hsplit->add_child(select_func_text);
+ add_child(select_func_text);
+ graph->set_area_as_parent_rect();
hint_text = memnew(Label);
- hint_text->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, 100);
+ hint_text->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, -100);
hint_text->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0);
hint_text->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0);
hint_text->set_align(Label::ALIGN_CENTER);
@@ -3285,6 +3358,12 @@ VisualScriptEditor::VisualScriptEditor() {
port_action_popup = memnew(PopupMenu);
add_child(port_action_popup);
port_action_popup->connect("id_pressed", this, "_port_action_menu");
+
+ member_popup = memnew(PopupMenu);
+ add_child(member_popup);
+ members->connect("item_rmb_selected", this, "_member_rmb_selected");
+ members->set_allow_rmb_select(true);
+ member_popup->connect("id_pressed", this, "_member_option");
}
VisualScriptEditor::~VisualScriptEditor() {
@@ -3316,7 +3395,7 @@ static void register_editor_callback() {
EditorSettings::get_singleton()->set("editors/visual_script/color_functions", Color(1, 0.9, 0.9));
EditorSettings::get_singleton()->set("editors/visual_script/color_data", Color(0.9, 1.0, 0.9));
EditorSettings::get_singleton()->set("editors/visual_script/color_operators", Color(0.9, 0.9, 1.0));
- EditorSettings::get_singleton()->set("editors/visual_script/color_flow_control", Color(1.0, 1.0, 0.8));
+ EditorSettings::get_singleton()->set("editors/visual_script/color_flow_control", Color(1.0, 1.0, 1.0));
EditorSettings::get_singleton()->set("editors/visual_script/color_custom", Color(0.8, 1.0, 1.0));
EditorSettings::get_singleton()->set("editors/visual_script/color_constants", Color(1.0, 0.8, 1.0));
diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h
index 5ece1c9e2c..fee4e27bd5 100644
--- a/modules/visual_script/visual_script_editor.h
+++ b/modules/visual_script/visual_script_editor.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -71,15 +72,25 @@ class VisualScriptEditor : public ScriptEditorBase {
CREATE_RETURN,
};
+ enum MemberAction {
+ MEMBER_EDIT,
+ MEMBER_REMOVE
+
+ };
+
+ enum MemberType {
+ MEMBER_FUNCTION,
+ MEMBER_VARIABLE,
+ MEMBER_SIGNAL
+ };
+
+ VSplitContainer *left_vsplit;
MenuButton *edit_menu;
Ref<VisualScript> script;
Button *base_type_select;
- HSplitContainer *main_hsplit;
- VSplitContainer *left_vsplit;
-
GraphEdit *graph;
LineEdit *node_filter;
@@ -153,6 +164,10 @@ class VisualScriptEditor : public ScriptEditorBase {
static Clipboard *clipboard;
PopupMenu *port_action_popup;
+ PopupMenu *member_popup;
+
+ MemberType member_type;
+ String member_name;
PortAction port_action;
int port_action_node;
@@ -195,7 +210,7 @@ class VisualScriptEditor : public ScriptEditorBase {
String revert_on_drag;
- void _input(const InputEvent &p_event);
+ void _input(const Ref<InputEvent> &p_event);
void _on_nodes_delete();
void _on_nodes_duplicate();
@@ -222,6 +237,9 @@ class VisualScriptEditor : public ScriptEditorBase {
VisualScriptNode::TypeGuess _guess_output_type(int p_port_action_node, int p_port_action_output, Set<int> &visited_nodes);
+ void _member_rmb_selected(const Vector2 &p_pos);
+ void _member_option(int p_option);
+
protected:
void _notification(int p_what);
static void _bind_methods();
@@ -239,16 +257,19 @@ public:
virtual void set_edit_state(const Variant &p_state);
virtual void goto_line(int p_line, bool p_with_error = false);
virtual void trim_trailing_whitespace();
+ virtual void convert_indent_to_spaces();
+ virtual void convert_indent_to_tabs();
virtual void ensure_focus();
virtual void tag_saved_version();
virtual void reload(bool p_soft);
virtual void get_breakpoints(List<int> *p_breakpoints);
- virtual bool goto_method(const String &p_method);
virtual void add_callback(const String &p_function, PoolStringArray p_args);
virtual void update_settings();
+ virtual bool show_members_overview();
virtual void set_debugger_active(bool p_active);
virtual void set_tooltip_request_func(String p_method, Object *p_obj);
virtual Control *get_edit_menu();
+ virtual void clear_edit_menu();
virtual bool can_lose_focus_on_node_selection() { return false; }
static void register_editor();
diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp
index 96864b4bf6..78b70934c0 100644
--- a/modules/visual_script/visual_script_expression.cpp
+++ b/modules/visual_script/visual_script_expression.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -67,12 +68,12 @@ bool VisualScriptExpression::_set(const StringName &p_name, const Variant &p_val
return true;
}
- if (String(p_name).begins_with("input/")) {
+ if (String(p_name).begins_with("input_")) {
- int idx = String(p_name).get_slice("/", 1).to_int();
+ int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int();
ERR_FAIL_INDEX_V(idx, inputs.size(), false);
- String what = String(p_name).get_slice("/", 2);
+ String what = String(p_name).get_slice("/", 1);
if (what == "type") {
@@ -114,12 +115,12 @@ bool VisualScriptExpression::_get(const StringName &p_name, Variant &r_ret) cons
return true;
}
- if (String(p_name).begins_with("input/")) {
+ if (String(p_name).begins_with("input_")) {
- int idx = String(p_name).get_slice("/", 1).to_int();
+ int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int();
ERR_FAIL_INDEX_V(idx, inputs.size(), false);
- String what = String(p_name).get_slice("/", 2);
+ String what = String(p_name).get_slice("/", 1);
if (what == "type") {
@@ -150,8 +151,8 @@ void VisualScriptExpression::_get_property_list(List<PropertyInfo> *p_list) cons
for (int i = 0; i < inputs.size(); i++) {
- p_list->push_back(PropertyInfo(Variant::INT, "input/" + itos(i) + "/type", PROPERTY_HINT_ENUM, argt));
- p_list->push_back(PropertyInfo(Variant::STRING, "input/" + itos(i) + "/name"));
+ p_list->push_back(PropertyInfo(Variant::INT, "input_" + itos(i) + "/type", PROPERTY_HINT_ENUM, argt));
+ p_list->push_back(PropertyInfo(Variant::STRING, "input_" + itos(i) + "/name"));
}
}
diff --git a/modules/visual_script/visual_script_expression.h b/modules/visual_script/visual_script_expression.h
index 59a7d9fba0..4a9f59ebc3 100644
--- a/modules/visual_script/visual_script_expression.h
+++ b/modules/visual_script/visual_script_expression.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp
index 78847fb588..77f3111d94 100644
--- a/modules/visual_script/visual_script_flow_control.cpp
+++ b/modules/visual_script/visual_script_flow_control.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,9 @@
/*************************************************************************/
#include "visual_script_flow_control.h"
-#include "global_config.h"
+#include "io/resource_loader.h"
#include "os/keyboard.h"
+#include "project_settings.h"
//////////////////////////////////////////
////////////////RETURN////////////////////
@@ -118,8 +120,8 @@ void VisualScriptReturn::_bind_methods() {
argt += "," + Variant::get_type_name(Variant::Type(i));
}
- 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");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "return_enabled"), "set_enable_return_value", "is_return_value_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "return_type", PROPERTY_HINT_ENUM, argt), "set_return_type", "get_return_type");
}
class VisualScriptNodeInstanceReturn : public VisualScriptNodeInstance {
@@ -136,11 +138,11 @@ public:
if (with_value) {
*p_working_mem = *p_inputs[0];
+ return STEP_EXIT_FUNCTION_BIT;
} else {
*p_working_mem = Variant();
+ return 0;
}
-
- return 0;
}
};
@@ -733,6 +735,7 @@ VisualScriptSwitch::VisualScriptSwitch() {
////////////////EVENT ACTION FILTER///////////
//////////////////////////////////////////
+#if 0
int VisualScriptInputFilter::get_output_sequence_port_count() const {
return filters.size();
@@ -757,86 +760,86 @@ String VisualScriptInputFilter::get_output_sequence_port_text(int p_port) const
String text;
switch (filters[p_port].type) {
- case InputEvent::NONE: {
+ case Ref<InputEvent>::NONE: {
text = "None";
} break;
- case InputEvent::KEY: {
+ case Ref<InputEvent>::KEY: {
InputEventKey k = filters[p_port].key;
- if (k.scancode == 0 && k.unicode == 0) {
+ if (k->get_scancode() == 0 && k.unicode == 0) {
text = "No Key";
} else {
- if (k.scancode != 0) {
- text = "KeyCode: " + keycode_get_string(k.scancode);
+ if (k->get_scancode() != 0) {
+ text = "KeyCode: " + keycode_get_string(k->get_scancode());
} else if (k.unicode != 0) {
text = "Uniode: " + String::chr(k.unicode);
}
- if (k.pressed)
+ if (k->is_pressed())
text += ", Pressed";
else
text += ", Released";
if (k.echo)
text += ", Echo";
- if (k.mod.alt)
+ if (k->get_alt())
text = "Alt+" + text;
- if (k.mod.shift)
+ if (k->get_shift())
text = "Shift+" + text;
- if (k.mod.control)
+ if (k->get_control())
text = "Ctrl+" + text;
- if (k.mod.meta)
+ if (k->get_metakey())
text = "Meta+" + text;
}
} break;
- case InputEvent::MOUSE_MOTION: {
+ case Ref<InputEvent>::MOUSE_MOTION: {
InputEventMouseMotion mm = filters[p_port].mouse_motion;
text = "Mouse Motion";
String b = "Left,Right,Middle,WheelUp,WheelDown,WheelLeft,WheelRight";
for (int i = 0; i < 7; i++) {
- if (mm.button_mask & (1 << i)) {
+ if (mm->get_button_mask() & (1 << i)) {
text = b.get_slice(",", i) + "+" + text;
}
}
- if (mm.mod.alt)
+ if (mm->get_alt())
text = "Alt+" + text;
- if (mm.mod.shift)
+ if (mm->get_shift())
text = "Shift+" + text;
- if (mm.mod.control)
+ if (mm->get_control())
text = "Ctrl+" + text;
- if (mm.mod.meta)
+ if (mm->get_metakey())
text = "Meta+" + text;
} break;
- case InputEvent::MOUSE_BUTTON: {
+ case Ref<InputEvent>::MOUSE_BUTTON: {
InputEventMouseButton mb = filters[p_port].mouse_button;
String b = "Any,Left,Right,Middle,WheelUp,WheelDown,WheelLeft,WheelRight";
- text = b.get_slice(",", mb.button_index) + " Mouse Button";
+ text = b.get_slice(",", mb->get_button_index()) + " Mouse Button";
- if (mb.pressed)
+ if (mb->is_pressed())
text += ", Pressed";
else
text += ", Released";
if (mb.doubleclick)
text += ", DblClick";
- if (mb.mod.alt)
+ if (mb->get_alt())
text = "Alt+" + text;
- if (mb.mod.shift)
+ if (mb->get_shift())
text = "Shift+" + text;
- if (mb.mod.control)
+ if (mb->get_control())
text = "Ctrl+" + text;
- if (mb.mod.meta)
+ if (mb->get_metakey())
text = "Meta+" + text;
} break;
- case InputEvent::JOYPAD_MOTION: {
+ case Ref<InputEvent>::JOYPAD_MOTION: {
InputEventJoypadMotion jm = filters[p_port].joy_motion;
@@ -847,32 +850,32 @@ String VisualScriptInputFilter::get_output_sequence_port_text(int p_port) const
text += " < " + rtos(-jm.axis_value);
} break;
- case InputEvent::JOYPAD_BUTTON: {
+ case Ref<InputEvent>::JOYPAD_BUTTON: {
InputEventJoypadButton jb = filters[p_port].joy_button;
- text = "JoyButton " + itos(jb.button_index);
- if (jb.pressed)
+ text = "JoyButton " + itos(jb->get_button_index());
+ if (jb->is_pressed())
text += ", Pressed";
else
text += ", Released";
} break;
- case InputEvent::SCREEN_TOUCH: {
+ case Ref<InputEvent>::SCREEN_TOUCH: {
InputEventScreenTouch sd = filters[p_port].screen_touch;
text = "Touch Finger " + itos(sd.index);
- if (sd.pressed)
+ if (sd->is_pressed())
text += ", Pressed";
else
text += ", Released";
} break;
- case InputEvent::SCREEN_DRAG: {
+ case Ref<InputEvent>::SCREEN_DRAG: {
InputEventScreenDrag sd = filters[p_port].screen_drag;
text = "Drag Finger " + itos(sd.index);
} break;
- case InputEvent::ACTION: {
+ case Ref<InputEvent>::ACTION: {
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
int index = 1;
text = "No Action";
@@ -889,7 +892,7 @@ String VisualScriptInputFilter::get_output_sequence_port_text(int p_port) const
index++;
}
- if (filters[p_port].action.pressed)
+ if (filters[p_port].action->is_pressed())
text += ", Pressed";
else
text += ", Released";
@@ -938,20 +941,20 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va
String what = String(p_name).get_slice("/", 1);
if (what == "type") {
- filters[idx] = InputEvent();
- filters[idx].type = InputEvent::Type(int(p_value));
- if (filters[idx].type == InputEvent::JOYPAD_MOTION) {
- filters[idx].joy_motion.axis_value = 0.5; //for treshold
- } else if (filters[idx].type == InputEvent::KEY) {
- filters[idx].key.pressed = true; //put these as true to make it more user friendly
- } else if (filters[idx].type == InputEvent::MOUSE_BUTTON) {
- filters[idx].mouse_button.pressed = true;
- } else if (filters[idx].type == InputEvent::JOYPAD_BUTTON) {
- filters[idx].joy_button.pressed = true;
- } else if (filters[idx].type == InputEvent::SCREEN_TOUCH) {
- filters[idx].screen_touch.pressed = true;
- } else if (filters[idx].type == InputEvent::ACTION) {
- filters[idx].action.pressed = true;
+ filters[idx] = Ref<InputEvent>();
+ filters[idx].type = Ref<InputEvent>::Type(int(p_value));
+ if (filters[idx].type == Ref<InputEvent>::JOYPAD_MOTION) {
+ filters[idx].joy_motion.axis_value = 0.5; //for threshold
+ } else if (filters[idx].type == Ref<InputEvent>::KEY) {
+ filters[idx]->is_pressed() = true; //put these as true to make it more user friendly
+ } else if (filters[idx].type == Ref<InputEvent>::MOUSE_BUTTON) {
+ filters[idx]->is_pressed() = true;
+ } else if (filters[idx].type == Ref<InputEvent>::JOYPAD_BUTTON) {
+ filters[idx].joy_button->is_pressed() = true;
+ } else if (filters[idx].type == Ref<InputEvent>::SCREEN_TOUCH) {
+ filters[idx].screen_touch->is_pressed() = true;
+ } else if (filters[idx].type == Ref<InputEvent>::ACTION) {
+ filters[idx].action->is_pressed() = true;
}
_change_notify();
ports_changed_notify();
@@ -966,14 +969,14 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va
switch (filters[idx].type) {
- case InputEvent::KEY: {
+ case Ref<InputEvent>::KEY: {
if (what == "scancode") {
String sc = p_value;
if (sc == String()) {
- filters[idx].key.scancode = 0;
+ filters[idx]->get_scancode() = 0;
} else {
- filters[idx].key.scancode = find_keycode(p_value);
+ filters[idx]->get_scancode() = find_keycode(p_value);
}
} else if (what == "unicode") {
@@ -988,22 +991,22 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va
} else if (what == "pressed") {
- filters[idx].key.pressed = p_value;
+ filters[idx]->is_pressed() = p_value;
} else if (what == "echo") {
- filters[idx].key.echo = p_value;
+ filters[idx]->is_echo() = p_value;
} else if (what == "mod_alt") {
- filters[idx].key.mod.alt = p_value;
+ filters[idx]->get_alt() = p_value;
} else if (what == "mod_shift") {
- filters[idx].key.mod.shift = p_value;
+ filters[idx]->get_shift() = p_value;
} else if (what == "mod_ctrl") {
- filters[idx].key.mod.control = p_value;
+ filters[idx]->get_control() = p_value;
} else if (what == "mod_meta") {
- filters[idx].key.mod.meta = p_value;
+ filters[idx]->get_metakey() = p_value;
} else {
return false;
}
@@ -1011,22 +1014,22 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va
return true;
} break;
- case InputEvent::MOUSE_MOTION: {
+ case Ref<InputEvent>::MOUSE_MOTION: {
if (what == "button_mask") {
- filters[idx].mouse_motion.button_mask = p_value;
+ filters[idx]->get_button_mask() = p_value;
} else if (what == "mod_alt") {
- filters[idx].mouse_motion.mod.alt = p_value;
+ filters[idx].mouse_motion->get_alt() = p_value;
} else if (what == "mod_shift") {
- filters[idx].mouse_motion.mod.shift = p_value;
+ filters[idx].mouse_motion->get_shift() = p_value;
} else if (what == "mod_ctrl") {
- filters[idx].mouse_motion.mod.control = p_value;
+ filters[idx].mouse_motion->get_control() = p_value;
} else if (what == "mod_meta") {
- filters[idx].mouse_motion.mod.meta = p_value;
+ filters[idx].mouse_motion->get_metakey() = p_value;
} else {
return false;
}
@@ -1035,26 +1038,26 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va
return true;
} break;
- case InputEvent::MOUSE_BUTTON: {
+ case Ref<InputEvent>::MOUSE_BUTTON: {
if (what == "button_index") {
- filters[idx].mouse_button.button_index = p_value;
+ filters[idx]->get_button_index() = p_value;
} else if (what == "pressed") {
- filters[idx].mouse_button.pressed = p_value;
+ filters[idx]->is_pressed() = p_value;
} else if (what == "doubleclicked") {
filters[idx].mouse_button.doubleclick = p_value;
} else if (what == "mod_alt") {
- filters[idx].mouse_button.mod.alt = p_value;
+ filters[idx].mouse_button->get_alt() = p_value;
} else if (what == "mod_shift") {
- filters[idx].mouse_button.mod.shift = p_value;
+ filters[idx].mouse_button->get_shift() = p_value;
} else if (what == "mod_ctrl") {
- filters[idx].mouse_button.mod.control = p_value;
+ filters[idx].mouse_button->get_control() = p_value;
} else if (what == "mod_meta") {
- filters[idx].mouse_button.mod.meta = p_value;
+ filters[idx].mouse_button->get_metakey() = p_value;
} else {
return false;
}
@@ -1062,13 +1065,13 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va
return true;
} break;
- case InputEvent::JOYPAD_MOTION: {
+ case Ref<InputEvent>::JOYPAD_MOTION: {
if (what == "axis") {
filters[idx].joy_motion.axis = int(p_value) << 1 | filters[idx].joy_motion.axis;
} else if (what == "mode") {
filters[idx].joy_motion.axis |= int(p_value);
- } else if (what == "treshold") {
+ } else if (what == "threshold") {
filters[idx].joy_motion.axis_value = p_value;
} else {
return false;
@@ -1077,12 +1080,12 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va
return true;
} break;
- case InputEvent::JOYPAD_BUTTON: {
+ case Ref<InputEvent>::JOYPAD_BUTTON: {
if (what == "button_index") {
- filters[idx].joy_button.button_index = p_value;
+ filters[idx].joy_button->get_button_index() = p_value;
} else if (what == "pressed") {
- filters[idx].joy_button.pressed = p_value;
+ filters[idx].joy_button->is_pressed() = p_value;
} else {
return false;
}
@@ -1090,19 +1093,19 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va
return true;
} break;
- case InputEvent::SCREEN_TOUCH: {
+ case Ref<InputEvent>::SCREEN_TOUCH: {
if (what == "finger_index") {
filters[idx].screen_touch.index = p_value;
} else if (what == "pressed") {
- filters[idx].screen_touch.pressed = p_value;
+ filters[idx].screen_touch->is_pressed() = p_value;
} else {
return false;
}
ports_changed_notify();
return true;
} break;
- case InputEvent::SCREEN_DRAG: {
+ case Ref<InputEvent>::SCREEN_DRAG: {
if (what == "finger_index") {
filters[idx].screen_drag.index = p_value;
} else {
@@ -1111,12 +1114,12 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va
ports_changed_notify();
return true;
} break;
- case InputEvent::ACTION: {
+ case Ref<InputEvent>::ACTION: {
if (what == "action_name") {
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
int index = 1;
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
@@ -1143,7 +1146,7 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va
} else if (what == "pressed") {
- filters[idx].action.pressed = p_value;
+ filters[idx].action->is_pressed() = p_value;
ports_changed_notify();
return true;
}
@@ -1180,14 +1183,14 @@ bool VisualScriptInputFilter::_get(const StringName &p_name, Variant &r_ret) con
switch (filters[idx].type) {
- case InputEvent::KEY: {
+ case Ref<InputEvent>::KEY: {
if (what == "scancode") {
- if (filters[idx].key.scancode == 0)
+ if (filters[idx]->get_scancode() == 0)
r_ret = String();
else {
- r_ret = keycode_get_string(filters[idx].key.scancode);
+ r_ret = keycode_get_string(filters[idx]->get_scancode());
}
} else if (what == "unicode") {
@@ -1201,44 +1204,44 @@ bool VisualScriptInputFilter::_get(const StringName &p_name, Variant &r_ret) con
} else if (what == "pressed") {
- r_ret = filters[idx].key.pressed;
+ r_ret = filters[idx]->is_pressed();
} else if (what == "echo") {
- r_ret = filters[idx].key.echo;
+ r_ret = filters[idx]->is_echo();
} else if (what == "mod_alt") {
- r_ret = filters[idx].key.mod.alt;
+ r_ret = filters[idx]->get_alt();
} else if (what == "mod_shift") {
- r_ret = filters[idx].key.mod.shift;
+ r_ret = filters[idx]->get_shift();
} else if (what == "mod_ctrl") {
- r_ret = filters[idx].key.mod.control;
+ r_ret = filters[idx]->get_control();
} else if (what == "mod_meta") {
- r_ret = filters[idx].key.mod.meta;
+ r_ret = filters[idx]->get_metakey();
} else {
return false;
}
return true;
} break;
- case InputEvent::MOUSE_MOTION: {
+ case Ref<InputEvent>::MOUSE_MOTION: {
if (what == "button_mask") {
- r_ret = filters[idx].mouse_motion.button_mask;
+ r_ret = filters[idx]->get_button_mask();
} else if (what == "mod_alt") {
- r_ret = filters[idx].mouse_motion.mod.alt;
+ r_ret = filters[idx].mouse_motion->get_alt();
} else if (what == "mod_shift") {
- r_ret = filters[idx].mouse_motion.mod.shift;
+ r_ret = filters[idx].mouse_motion->get_shift();
} else if (what == "mod_ctrl") {
- r_ret = filters[idx].mouse_motion.mod.control;
+ r_ret = filters[idx].mouse_motion->get_control();
} else if (what == "mod_meta") {
- r_ret = filters[idx].mouse_motion.mod.meta;
+ r_ret = filters[idx].mouse_motion->get_metakey();
} else {
return false;
}
@@ -1246,39 +1249,39 @@ bool VisualScriptInputFilter::_get(const StringName &p_name, Variant &r_ret) con
return true;
} break;
- case InputEvent::MOUSE_BUTTON: {
+ case Ref<InputEvent>::MOUSE_BUTTON: {
if (what == "button_index") {
- r_ret = filters[idx].mouse_button.button_index;
+ r_ret = filters[idx]->get_button_index();
} else if (what == "pressed") {
- r_ret = filters[idx].mouse_button.pressed;
+ r_ret = filters[idx]->is_pressed();
} else if (what == "doubleclicked") {
r_ret = filters[idx].mouse_button.doubleclick;
} else if (what == "mod_alt") {
- r_ret = filters[idx].mouse_button.mod.alt;
+ r_ret = filters[idx].mouse_button->get_alt();
} else if (what == "mod_shift") {
- r_ret = filters[idx].mouse_button.mod.shift;
+ r_ret = filters[idx].mouse_button->get_shift();
} else if (what == "mod_ctrl") {
- r_ret = filters[idx].mouse_button.mod.control;
+ r_ret = filters[idx].mouse_button->get_control();
} else if (what == "mod_meta") {
- r_ret = filters[idx].mouse_button.mod.meta;
+ r_ret = filters[idx].mouse_button->get_metakey();
} else {
return false;
}
return true;
} break;
- case InputEvent::JOYPAD_MOTION: {
+ case Ref<InputEvent>::JOYPAD_MOTION: {
if (what == "axis_index") {
r_ret = filters[idx].joy_motion.axis >> 1;
} else if (what == "mode") {
r_ret = filters[idx].joy_motion.axis & 1;
- } else if (what == "treshold") {
+ } else if (what == "threshold") {
r_ret = filters[idx].joy_motion.axis_value;
} else {
return false;
@@ -1286,30 +1289,30 @@ bool VisualScriptInputFilter::_get(const StringName &p_name, Variant &r_ret) con
return true;
} break;
- case InputEvent::JOYPAD_BUTTON: {
+ case Ref<InputEvent>::JOYPAD_BUTTON: {
if (what == "button_index") {
- r_ret = filters[idx].joy_button.button_index;
+ r_ret = filters[idx].joy_button->get_button_index();
} else if (what == "pressed") {
- r_ret = filters[idx].joy_button.pressed;
+ r_ret = filters[idx].joy_button->is_pressed();
} else {
return false;
}
return true;
} break;
- case InputEvent::SCREEN_TOUCH: {
+ case Ref<InputEvent>::SCREEN_TOUCH: {
if (what == "finger_index") {
r_ret = filters[idx].screen_touch.index;
} else if (what == "pressed") {
- r_ret = filters[idx].screen_touch.pressed;
+ r_ret = filters[idx].screen_touch->is_pressed();
} else {
return false;
}
return true;
} break;
- case InputEvent::SCREEN_DRAG: {
+ case Ref<InputEvent>::SCREEN_DRAG: {
if (what == "finger_index") {
r_ret = filters[idx].screen_drag.index;
} else {
@@ -1317,12 +1320,12 @@ bool VisualScriptInputFilter::_get(const StringName &p_name, Variant &r_ret) con
}
return true;
} break;
- case InputEvent::ACTION: {
+ case Ref<InputEvent>::ACTION: {
if (what == "action_name") {
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
int index = 1;
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
@@ -1343,7 +1346,7 @@ bool VisualScriptInputFilter::_get(const StringName &p_name, Variant &r_ret) con
} else if (what == "pressed") {
- r_ret = filters[idx].action.pressed;
+ r_ret = filters[idx].action->is_pressed();
return true;
}
@@ -1353,7 +1356,7 @@ bool VisualScriptInputFilter::_get(const StringName &p_name, Variant &r_ret) con
return false;
}
-static const char *event_type_names[InputEvent::TYPE_MAX] = {
+static const char *event_type_names[Ref<InputEvent>::TYPE_MAX] = {
"None",
"Key",
"MouseMotion",
@@ -1370,7 +1373,7 @@ void VisualScriptInputFilter::_get_property_list(List<PropertyInfo> *p_list) con
p_list->push_back(PropertyInfo(Variant::INT, "filter_count", PROPERTY_HINT_RANGE, "0,64"));
String et;
- for (int i = 0; i < InputEvent::TYPE_MAX; i++) {
+ for (int i = 0; i < Ref<InputEvent>::TYPE_MAX; i++) {
if (i > 0)
et += ",";
@@ -1387,10 +1390,10 @@ void VisualScriptInputFilter::_get_property_list(List<PropertyInfo> *p_list) con
p_list->push_back(PropertyInfo(Variant::INT, base + "device"));
switch (filters[i].type) {
- case InputEvent::NONE: {
+ case Ref<InputEvent>::NONE: {
} break;
- case InputEvent::KEY: {
+ case Ref<InputEvent>::KEY: {
if (kc == String()) {
int kcc = keycode_get_count();
kc = "None";
@@ -1409,7 +1412,7 @@ void VisualScriptInputFilter::_get_property_list(List<PropertyInfo> *p_list) con
p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_meta"));
} break;
- case InputEvent::MOUSE_MOTION: {
+ case Ref<InputEvent>::MOUSE_MOTION: {
p_list->push_back(PropertyInfo(Variant::INT, base + "button_mask", PROPERTY_HINT_FLAGS, "Left,Right,Middle,WheelUp,WheelDown,WheelLeft,WheelRight"));
p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_alt"));
p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_shift"));
@@ -1417,7 +1420,7 @@ void VisualScriptInputFilter::_get_property_list(List<PropertyInfo> *p_list) con
p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_meta"));
} break;
- case InputEvent::MOUSE_BUTTON: {
+ case Ref<InputEvent>::MOUSE_BUTTON: {
p_list->push_back(PropertyInfo(Variant::INT, base + "button_index", PROPERTY_HINT_ENUM, "Any,Left,Right,Middle,WheelUp,WheelDown,WheelLeft,WheelRight"));
p_list->push_back(PropertyInfo(Variant::BOOL, base + "pressed"));
p_list->push_back(PropertyInfo(Variant::BOOL, base + "doubleclicked"));
@@ -1427,33 +1430,33 @@ void VisualScriptInputFilter::_get_property_list(List<PropertyInfo> *p_list) con
p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_meta"));
} break;
- case InputEvent::JOYPAD_MOTION: {
+ case Ref<InputEvent>::JOYPAD_MOTION: {
p_list->push_back(PropertyInfo(Variant::INT, base + "axis_index"));
p_list->push_back(PropertyInfo(Variant::INT, base + "mode", PROPERTY_HINT_ENUM, "Min,Max"));
- p_list->push_back(PropertyInfo(Variant::REAL, base + "treshold", PROPERTY_HINT_RANGE, "0,1,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, base + "threshold", PROPERTY_HINT_RANGE, "0,1,0.01"));
} break;
- case InputEvent::JOYPAD_BUTTON: {
+ case Ref<InputEvent>::JOYPAD_BUTTON: {
p_list->push_back(PropertyInfo(Variant::INT, base + "button_index"));
p_list->push_back(PropertyInfo(Variant::BOOL, base + "pressed"));
} break;
- case InputEvent::SCREEN_TOUCH: {
+ case Ref<InputEvent>::SCREEN_TOUCH: {
p_list->push_back(PropertyInfo(Variant::INT, base + "finger_index"));
p_list->push_back(PropertyInfo(Variant::BOOL, base + "pressed"));
} break;
- case InputEvent::SCREEN_DRAG: {
+ case Ref<InputEvent>::SCREEN_DRAG: {
p_list->push_back(PropertyInfo(Variant::INT, base + "finger_index"));
} break;
- case InputEvent::ACTION: {
+ case Ref<InputEvent>::ACTION: {
if (actions == String()) {
actions = "None";
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
Vector<String> al;
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
@@ -1484,7 +1487,7 @@ void VisualScriptInputFilter::_get_property_list(List<PropertyInfo> *p_list) con
class VisualScriptNodeInstanceInputFilter : public VisualScriptNodeInstance {
public:
VisualScriptInstance *instance;
- Vector<InputEvent> filters;
+ Vector<Ref<InputEvent>> filters;
//virtual int get_working_memory_size() const { return 0; }
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
@@ -1498,11 +1501,11 @@ public:
return 0;
}
- InputEvent event = *p_inputs[0];
+ Ref<InputEvent> event = *p_inputs[0];
for (int i = 0; i < filters.size(); i++) {
- const InputEvent &ie = filters[i];
+ const Ref<InputEvent> &ie = filters[i];
if (ie.type != event.type)
continue;
@@ -1510,25 +1513,25 @@ public:
switch (ie.type) {
- case InputEvent::NONE: {
+ case Ref<InputEvent>::NONE: {
match = true;
} break;
- case InputEvent::KEY: {
+ case Ref<InputEvent>::KEY: {
InputEventKey k = ie.key;
InputEventKey k2 = event.key;
- if (k.scancode == 0 && k.unicode == 0 && k2.scancode == 0 && k2.unicode == 0) {
+ if (k->get_scancode() == 0 && k.unicode == 0 && k2->get_scancode() == 0 && k2.unicode == 0) {
match = true;
} else {
- if ((k.scancode != 0 && k.scancode == k2.scancode) || (k.unicode != 0 && k.unicode == k2.unicode)) {
+ if ((k->get_scancode() != 0 && k->get_scancode() == k2->get_scancode()) || (k.unicode != 0 && k.unicode == k2.unicode)) {
//key valid
if (
- k.pressed == k2.pressed &&
+ k->is_pressed() == k2->is_pressed() &&
k.echo == k2.echo &&
k.mod == k2.mod) {
match = true;
@@ -1537,30 +1540,30 @@ public:
}
} break;
- case InputEvent::MOUSE_MOTION: {
+ case Ref<InputEvent>::MOUSE_MOTION: {
InputEventMouseMotion mm = ie.mouse_motion;
InputEventMouseMotion mm2 = event.mouse_motion;
- if (mm.button_mask == mm2.button_mask &&
+ if (mm->get_button_mask() == mm2->get_button_mask() &&
mm.mod == mm2.mod) {
match = true;
}
} break;
- case InputEvent::MOUSE_BUTTON: {
+ case Ref<InputEvent>::MOUSE_BUTTON: {
InputEventMouseButton mb = ie.mouse_button;
InputEventMouseButton mb2 = event.mouse_button;
- if (mb.button_index == mb2.button_index &&
- mb.pressed == mb2.pressed &&
+ if (mb->get_button_index() == mb2->get_button_index() &&
+ mb->is_pressed() == mb2->is_pressed() &&
mb.doubleclick == mb2.doubleclick &&
mb.mod == mb2.mod) {
match = true;
}
} break;
- case InputEvent::JOYPAD_MOTION: {
+ case Ref<InputEvent>::JOYPAD_MOTION: {
InputEventJoypadMotion jm = ie.joy_motion;
InputEventJoypadMotion jm2 = event.joy_motion;
@@ -1583,26 +1586,26 @@ public:
}
} break;
- case InputEvent::JOYPAD_BUTTON: {
+ case Ref<InputEvent>::JOYPAD_BUTTON: {
InputEventJoypadButton jb = ie.joy_button;
InputEventJoypadButton jb2 = event.joy_button;
- if (jb.button_index == jb2.button_index &&
- jb.pressed == jb2.pressed) {
+ if (jb->get_button_index() == jb2->get_button_index() &&
+ jb->is_pressed() == jb2->is_pressed()) {
match = true;
}
} break;
- case InputEvent::SCREEN_TOUCH: {
+ case Ref<InputEvent>::SCREEN_TOUCH: {
InputEventScreenTouch st = ie.screen_touch;
InputEventScreenTouch st2 = event.screen_touch;
if (st.index == st2.index &&
- st.pressed == st2.pressed) {
+ st->is_pressed() == st2->is_pressed()) {
match = true;
}
} break;
- case InputEvent::SCREEN_DRAG: {
+ case Ref<InputEvent>::SCREEN_DRAG: {
InputEventScreenDrag sd = ie.screen_drag;
InputEventScreenDrag sd2 = event.screen_drag;
@@ -1610,13 +1613,13 @@ public:
match = true;
}
} break;
- case InputEvent::ACTION: {
+ case Ref<InputEvent>::ACTION: {
InputEventAction ia = ie.action;
InputEventAction ia2 = event.action;
if (ia.action == ia2.action &&
- ia.pressed == ia2.pressed) {
+ ia->is_pressed() == ia2->is_pressed()) {
match = true;
}
} break;
@@ -1642,7 +1645,7 @@ VisualScriptNodeInstance *VisualScriptInputFilter::instance(VisualScriptInstance
VisualScriptInputFilter::VisualScriptInputFilter() {
}
-
+#endif
//////////////////////////////////////////
////////////////TYPE CAST///////////
//////////////////////////////////////////
@@ -1723,6 +1726,20 @@ String VisualScriptTypeCast::get_base_script() const {
return script;
}
+VisualScriptTypeCast::TypeGuess VisualScriptTypeCast::guess_output_type(TypeGuess *p_inputs, int p_output) const {
+
+ TypeGuess tg;
+ tg.type = Variant::OBJECT;
+ if (script != String()) {
+ tg.script = ResourceLoader::load(script);
+ }
+ //if (!tg.script.is_valid()) {
+ // tg.gdclass = base_type;
+ //}
+
+ return tg;
+}
+
class VisualScriptNodeInstanceTypeCast : public VisualScriptNodeInstance {
public:
VisualScriptInstance *instance;
@@ -1813,8 +1830,8 @@ void VisualScriptTypeCast::_bind_methods() {
script_ext_hint += "*." + E->get();
}
- 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");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_type", PROPERTY_HINT_TYPE_STRING, "Object"), "set_base_type", "get_base_type");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_script", PROPERTY_HINT_FILE, script_ext_hint), "set_base_script", "get_base_script");
}
VisualScriptTypeCast::VisualScriptTypeCast() {
@@ -1831,6 +1848,6 @@ void register_visual_script_flow_control_nodes() {
VisualScriptLanguage::singleton->add_register_func("flow_control/iterator", create_node_generic<VisualScriptIterator>);
VisualScriptLanguage::singleton->add_register_func("flow_control/sequence", create_node_generic<VisualScriptSequence>);
VisualScriptLanguage::singleton->add_register_func("flow_control/switch", create_node_generic<VisualScriptSwitch>);
- VisualScriptLanguage::singleton->add_register_func("flow_control/input_filter", create_node_generic<VisualScriptInputFilter>);
+ //VisualScriptLanguage::singleton->add_register_func("flow_control/input_filter", create_node_generic<VisualScriptInputFilter>);
VisualScriptLanguage::singleton->add_register_func("flow_control/type_cast", create_node_generic<VisualScriptTypeCast>);
}
diff --git a/modules/visual_script/visual_script_flow_control.h b/modules/visual_script/visual_script_flow_control.h
index 1739f67b5b..d27fd47f84 100644
--- a/modules/visual_script/visual_script_flow_control.h
+++ b/modules/visual_script/visual_script_flow_control.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -227,11 +228,12 @@ public:
VisualScriptSwitch();
};
+#if 0
class VisualScriptInputFilter : public VisualScriptNode {
GDCLASS(VisualScriptInputFilter, VisualScriptNode)
- Vector<InputEvent> filters;
+ Vector<Ref<InputEvent>> filters;
protected:
bool _set(const StringName &p_name, const Variant &p_value);
@@ -258,6 +260,7 @@ public:
VisualScriptInputFilter();
};
+#endif
class VisualScriptTypeCast : public VisualScriptNode {
@@ -291,6 +294,8 @@ public:
void set_base_script(const String &p_path);
String get_base_script() const;
+ virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const;
+
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
VisualScriptTypeCast();
diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp
index 3cd20050ce..afdf50027e 100644
--- a/modules/visual_script/visual_script_func_nodes.cpp
+++ b/modules/visual_script/visual_script_func_nodes.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,11 +29,11 @@
/*************************************************************************/
#include "visual_script_func_nodes.h"
-#include "global_config.h"
#include "io/resource_loader.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/main/node.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
#include "visual_script_nodes.h"
//////////////////////////////////////////
@@ -340,13 +341,13 @@ String VisualScriptFunctionCall::get_base_script() const {
return base_script;
}
-void VisualScriptFunctionCall::set_singleton(const StringName &p_path) {
+void VisualScriptFunctionCall::set_singleton(const StringName &p_type) {
- if (singleton == p_path)
+ if (singleton == p_type)
return;
- singleton = p_path;
- Object *obj = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ singleton = p_type;
+ Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
if (obj) {
base_type = obj->get_class();
}
@@ -382,7 +383,7 @@ void VisualScriptFunctionCall::_update_method_cache() {
} else if (call_mode == CALL_MODE_SINGLETON) {
- Object *obj = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
if (obj) {
type = obj->get_class();
script = obj->get_script();
@@ -545,33 +546,33 @@ Dictionary VisualScriptFunctionCall::_get_argument_cache() const {
void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const {
- if (property.name == "function/base_type") {
+ if (property.name == "base_type") {
if (call_mode != CALL_MODE_INSTANCE) {
property.usage = PROPERTY_USAGE_NOEDITOR;
}
}
- if (property.name == "function/base_script") {
+ if (property.name == "base_script") {
if (call_mode != CALL_MODE_INSTANCE) {
property.usage = 0;
}
}
- if (property.name == "function/basic_type") {
+ if (property.name == "basic_type") {
if (call_mode != CALL_MODE_BASIC_TYPE) {
property.usage = 0;
}
}
- if (property.name == "function/singleton") {
+ if (property.name == "singleton") {
if (call_mode != CALL_MODE_SINGLETON) {
property.usage = 0;
} else {
- List<GlobalConfig::Singleton> names;
- GlobalConfig::get_singleton()->get_singletons(&names);
+ List<ProjectSettings::Singleton> names;
+ ProjectSettings::get_singleton()->get_singletons(&names);
property.hint = PROPERTY_HINT_ENUM;
String sl;
- for (List<GlobalConfig::Singleton>::Element *E = names.front(); E; E = E->next()) {
+ for (List<ProjectSettings::Singleton>::Element *E = names.front(); E; E = E->next()) {
if (sl != String())
sl += ",";
sl += E->get().name;
@@ -580,7 +581,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
}
}
- if (property.name == "function/node_path") {
+ if (property.name == "node_path") {
if (call_mode != CALL_MODE_NODE_PATH) {
property.usage = 0;
} else {
@@ -593,7 +594,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
}
}
- if (property.name == "function/function") {
+ if (property.name == "function") {
if (call_mode == CALL_MODE_BASIC_TYPE) {
@@ -602,13 +603,13 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
} else if (call_mode == CALL_MODE_SELF && get_visual_script().is_valid()) {
property.hint = PROPERTY_HINT_METHOD_OF_SCRIPT;
- property.hint_string = itos(get_visual_script()->get_instance_ID());
+ property.hint_string = itos(get_visual_script()->get_instance_id());
} else if (call_mode == CALL_MODE_SINGLETON) {
- Object *obj = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
if (obj) {
property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE;
- property.hint_string = itos(obj->get_instance_ID());
+ property.hint_string = itos(obj->get_instance_id());
} else {
property.hint = PROPERTY_HINT_METHOD_OF_BASE_TYPE;
@@ -630,7 +631,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
if (script.is_valid()) {
property.hint = PROPERTY_HINT_METHOD_OF_SCRIPT;
- property.hint_string = itos(script->get_instance_ID());
+ property.hint_string = itos(script->get_instance_id());
}
}
}
@@ -639,7 +640,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
Node *node = _get_base_node();
if (node) {
property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE;
- property.hint_string = itos(node->get_instance_ID());
+ property.hint_string = itos(node->get_instance_id());
} else {
property.hint = PROPERTY_HINT_METHOD_OF_BASE_TYPE;
property.hint_string = get_base_type();
@@ -647,7 +648,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
}
}
- if (property.name == "function/use_default_args") {
+ if (property.name == "use_default_args") {
property.hint = PROPERTY_HINT_RANGE;
@@ -672,7 +673,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
}
}
- if (property.name == "rpc/call_mode") {
+ if (property.name == "rpc_call_mode") {
if (call_mode == CALL_MODE_BASIC_TYPE) {
property.usage = 0;
}
@@ -734,17 +735,17 @@ void VisualScriptFunctionCall::_bind_methods() {
script_ext_hint += "*." + E->get();
}
- 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.
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "call_mode", PROPERTY_HINT_ENUM, "Self,Node Path,Instance,Basic Type,Singleton"), "set_call_mode", "get_call_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_type", PROPERTY_HINT_TYPE_STRING, "Object"), "set_base_type", "get_base_type");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_script", PROPERTY_HINT_FILE, script_ext_hint), "set_base_script", "get_base_script");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "singleton"), "set_singleton", "get_singleton");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "basic_type", PROPERTY_HINT_ENUM, bt), "set_basic_type", "get_basic_type");
+ ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "node_path", PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE), "set_base_path", "get_base_path");
+ ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "argument_cache", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_argument_cache", "_get_argument_cache");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "function"), "set_function", "get_function"); //when set, if loaded properly, will override argument count.
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "use_default_args"), "set_use_default_args", "get_use_default_args");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "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);
@@ -866,7 +867,7 @@ public:
} break;
case VisualScriptFunctionCall::CALL_MODE_SINGLETON: {
- Object *object = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ Object *object = ProjectSettings::get_singleton()->get_singleton_object(singleton);
if (!object) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Invalid singleton name: '" + String(singleton) + "'";
@@ -942,18 +943,6 @@ static Ref<VisualScriptNode> create_function_call_node(const String &p_name) {
////////////////SET//////////////////////
//////////////////////////////////////////
-static const char *event_type_names[InputEvent::TYPE_MAX] = {
- "None",
- "Key",
- "MouseMotion",
- "MouseButton",
- "JoypadMotion",
- "JoypadButton",
- "ScreenTouch",
- "ScreenDrag",
- "Action"
-};
-
int VisualScriptPropertySet::get_output_sequence_port_count() const {
return call_mode != CALL_MODE_BASIC_TYPE ? 1 : 0;
@@ -1031,6 +1020,18 @@ String VisualScriptPropertySet::get_output_sequence_port_text(int p_port) const
return String();
}
+void VisualScriptPropertySet::_adjust_input_index(PropertyInfo &pinfo) const {
+
+ if (index != StringName()) {
+
+ Variant v;
+ Variant::CallError ce;
+ v = Variant::construct(pinfo.type, NULL, 0, ce);
+ Variant i = v.get(index);
+ pinfo.type = i.get_type();
+ }
+}
+
PropertyInfo VisualScriptPropertySet::get_input_value_port_info(int p_idx) const {
if (call_mode == CALL_MODE_INSTANCE || call_mode == CALL_MODE_BASIC_TYPE) {
@@ -1038,6 +1039,7 @@ PropertyInfo VisualScriptPropertySet::get_input_value_port_info(int p_idx) const
PropertyInfo pi;
pi.type = (call_mode == CALL_MODE_INSTANCE ? Variant::OBJECT : basic_type);
pi.name = (call_mode == CALL_MODE_INSTANCE ? String("instance") : Variant::get_type_name(basic_type).to_lower());
+ _adjust_input_index(pi);
return pi;
} else {
p_idx--;
@@ -1046,6 +1048,7 @@ PropertyInfo VisualScriptPropertySet::get_input_value_port_info(int p_idx) const
PropertyInfo pinfo = type_cache;
pinfo.name = "value";
+ _adjust_input_index(pinfo);
return pinfo;
}
@@ -1062,13 +1065,16 @@ PropertyInfo VisualScriptPropertySet::get_output_value_port_info(int p_idx) cons
String VisualScriptPropertySet::get_caption() const {
static const char *cname[4] = {
- "SelfSet",
- "NodeSet",
- "InstanceSet",
- "BasicSet"
+ "Self",
+ "Node",
+ "Instance",
+ "Basic"
};
- return cname[call_mode];
+ static const char *opname[ASSIGN_OP_MAX] = {
+ "Set", "Add", "Sub", "Mul", "Div", "Mod", "ShiftLeft", "ShiftRight", "BitAnd", "BitOr", "BitXor"
+ };
+ return String(cname[call_mode]) + opname[assign_op];
}
String VisualScriptPropertySet::get_text() const {
@@ -1084,6 +1090,9 @@ String VisualScriptPropertySet::get_text() const {
else if (call_mode == CALL_MODE_INSTANCE)
prop = String(base_type) + ":" + property;
+ if (index != StringName()) {
+ prop += "." + String(index);
+ }
return prop;
}
@@ -1118,24 +1127,6 @@ Variant::Type VisualScriptPropertySet::get_basic_type() const {
return basic_type;
}
-void VisualScriptPropertySet::set_event_type(InputEvent::Type p_type) {
-
- if (event_type == p_type)
- return;
- event_type = p_type;
- if (call_mode == CALL_MODE_BASIC_TYPE) {
- _update_cache();
- }
- _change_notify();
- _update_base_type();
- ports_changed_notify();
-}
-
-InputEvent::Type VisualScriptPropertySet::get_event_type() const {
-
- return event_type;
-}
-
void VisualScriptPropertySet::set_base_type(const StringName &p_type) {
if (base_type == p_type)
@@ -1181,14 +1172,8 @@ void VisualScriptPropertySet::_update_cache() {
//not super efficient..
Variant v;
- if (basic_type == Variant::INPUT_EVENT) {
- InputEvent ev;
- ev.type = event_type;
- v = ev;
- } else {
- Variant::CallError ce;
- v = Variant::construct(basic_type, NULL, 0, ce);
- }
+ Variant::CallError ce;
+ v = Variant::construct(basic_type, NULL, 0, ce);
List<PropertyInfo> pinfo;
v.get_property_list(&pinfo);
@@ -1271,6 +1256,7 @@ void VisualScriptPropertySet::set_property(const StringName &p_type) {
return;
property = p_type;
+ index = StringName();
_update_cache();
_change_notify();
ports_changed_notify();
@@ -1320,33 +1306,58 @@ Dictionary VisualScriptPropertySet::_get_type_cache() const {
return type_cache;
}
+void VisualScriptPropertySet::set_index(const StringName &p_type) {
+
+ if (index == p_type)
+ return;
+ index = p_type;
+ _update_cache();
+ _change_notify();
+ ports_changed_notify();
+}
+
+StringName VisualScriptPropertySet::get_index() const {
+
+ return index;
+}
+
+void VisualScriptPropertySet::set_assign_op(AssignOp p_op) {
+
+ ERR_FAIL_INDEX(p_op, ASSIGN_OP_MAX);
+ if (assign_op == p_op)
+ return;
+
+ assign_op = p_op;
+ _update_cache();
+ _change_notify();
+ ports_changed_notify();
+}
+
+VisualScriptPropertySet::AssignOp VisualScriptPropertySet::get_assign_op() const {
+ return assign_op;
+}
+
void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const {
- if (property.name == "property/base_type") {
+ if (property.name == "base_type") {
if (call_mode != CALL_MODE_INSTANCE) {
property.usage = PROPERTY_USAGE_NOEDITOR;
}
}
- if (property.name == "property/base_script") {
+ if (property.name == "base_script") {
if (call_mode != CALL_MODE_INSTANCE) {
property.usage = 0;
}
}
- if (property.name == "property/basic_type") {
+ if (property.name == "basic_type") {
if (call_mode != CALL_MODE_BASIC_TYPE) {
property.usage = 0;
}
}
- if (property.name == "property/event_type") {
- if (call_mode != CALL_MODE_BASIC_TYPE || basic_type != Variant::INPUT_EVENT) {
- property.usage = 0;
- }
- }
-
- if (property.name == "property/node_path") {
+ if (property.name == "node_path") {
if (call_mode != CALL_MODE_NODE_PATH) {
property.usage = 0;
} else {
@@ -1359,7 +1370,7 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const {
}
}
- if (property.name == "property/property") {
+ if (property.name == "property") {
if (call_mode == CALL_MODE_BASIC_TYPE) {
@@ -1368,7 +1379,7 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const {
} else if (call_mode == CALL_MODE_SELF && get_visual_script().is_valid()) {
property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
- property.hint_string = itos(get_visual_script()->get_instance_ID());
+ property.hint_string = itos(get_visual_script()->get_instance_id());
} else if (call_mode == CALL_MODE_INSTANCE) {
property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
property.hint_string = base_type;
@@ -1385,7 +1396,7 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const {
if (script.is_valid()) {
property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
- property.hint_string = itos(script->get_instance_ID());
+ property.hint_string = itos(script->get_instance_id());
}
}
}
@@ -1394,13 +1405,31 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const {
Node *node = _get_base_node();
if (node) {
property.hint = PROPERTY_HINT_PROPERTY_OF_INSTANCE;
- property.hint_string = itos(node->get_instance_ID());
+ property.hint_string = itos(node->get_instance_id());
} else {
property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
property.hint_string = get_base_type();
}
}
}
+
+ if (property.name == "index") {
+
+ Variant::CallError ce;
+ Variant v = Variant::construct(type_cache.type, NULL, 0, ce);
+ List<PropertyInfo> plist;
+ v.get_property_list(&plist);
+ String options = "";
+ for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
+ options += "," + E->get().name;
+ }
+
+ property.hint = PROPERTY_HINT_ENUM;
+ property.hint_string = options;
+ property.type = Variant::STRING;
+ if (options == "")
+ property.usage = 0; //hide if type has no usable index
+ }
}
void VisualScriptPropertySet::_bind_methods() {
@@ -1417,9 +1446,6 @@ void VisualScriptPropertySet::_bind_methods() {
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(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(D_METHOD("set_property", "property"), &VisualScriptPropertySet::set_property);
ClassDB::bind_method(D_METHOD("get_property"), &VisualScriptPropertySet::get_property);
@@ -1429,6 +1455,12 @@ void VisualScriptPropertySet::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("set_index", "index"), &VisualScriptPropertySet::set_index);
+ ClassDB::bind_method(D_METHOD("get_index"), &VisualScriptPropertySet::get_index);
+
+ ClassDB::bind_method(D_METHOD("set_assign_op", "assign_op"), &VisualScriptPropertySet::set_assign_op);
+ ClassDB::bind_method(D_METHOD("get_assign_op"), &VisualScriptPropertySet::get_assign_op);
+
String bt;
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
if (i > 0)
@@ -1437,14 +1469,6 @@ void VisualScriptPropertySet::_bind_methods() {
bt += Variant::get_type_name(Variant::Type(i));
}
- String et;
- for (int i = 0; i < InputEvent::TYPE_MAX; i++) {
- if (i > 0)
- et += ",";
-
- et += event_type_names[i];
- }
-
List<String> script_extensions;
for (int i = 0; i < ScriptServer::get_language_count(); i++) {
ScriptServer::get_language(i)->get_recognized_extensions(&script_extensions);
@@ -1457,15 +1481,15 @@ 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"), "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");
-
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "set_mode", PROPERTY_HINT_ENUM, "Self,Node Path,Instance,Basic Type"), "set_call_mode", "get_call_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_type", PROPERTY_HINT_TYPE_STRING, "Object"), "set_base_type", "get_base_type");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_script", PROPERTY_HINT_FILE, script_ext_hint), "set_base_script", "get_base_script");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "type_cache", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_type_cache", "_get_type_cache");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "basic_type", PROPERTY_HINT_ENUM, bt), "set_basic_type", "get_basic_type");
+ ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "node_path", PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE), "set_base_path", "get_base_path");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "property"), "set_property", "get_property");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "index"), "set_index", "get_index");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "assign_op", PROPERTY_HINT_ENUM, "Assign,Add,Sub,Mul,Div,Mod,ShiftLeft,ShiftRight,BitAnd,BitOr,Bitxor"), "set_assign_op", "get_assign_op");
BIND_CONSTANT(CALL_MODE_SELF);
BIND_CONSTANT(CALL_MODE_NODE_PATH);
BIND_CONSTANT(CALL_MODE_INSTANCE);
@@ -1479,11 +1503,72 @@ public:
VisualScriptPropertySet *node;
VisualScriptInstance *instance;
+ VisualScriptPropertySet::AssignOp assign_op;
+ StringName index;
+ bool needs_get;
//virtual int get_working_memory_size() const { return 0; }
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; }
+ _FORCE_INLINE_ void _process_get(Variant &source, const Variant &p_argument, bool &valid) {
+
+ if (index != StringName() && assign_op == VisualScriptPropertySet::ASSIGN_OP_NONE) {
+ source.set_named(index, p_argument, &valid);
+ } else {
+
+ Variant value;
+ if (index != StringName()) {
+ value = source.get_named(index, &valid);
+ } else {
+ value = source;
+ }
+
+ switch (assign_op) {
+ case VisualScriptPropertySet::ASSIGN_OP_NONE: {
+ //should never get here
+ } break;
+ case VisualScriptPropertySet::ASSIGN_OP_ADD: {
+ value = Variant::evaluate(Variant::OP_ADD, value, p_argument);
+ } break;
+ case VisualScriptPropertySet::ASSIGN_OP_SUB: {
+ value = Variant::evaluate(Variant::OP_SUBSTRACT, value, p_argument);
+ } break;
+ case VisualScriptPropertySet::ASSIGN_OP_MUL: {
+ value = Variant::evaluate(Variant::OP_MULTIPLY, value, p_argument);
+ } break;
+ case VisualScriptPropertySet::ASSIGN_OP_DIV: {
+ value = Variant::evaluate(Variant::OP_DIVIDE, value, p_argument);
+ } break;
+ case VisualScriptPropertySet::ASSIGN_OP_MOD: {
+ value = Variant::evaluate(Variant::OP_MODULE, value, p_argument);
+ } break;
+ case VisualScriptPropertySet::ASSIGN_OP_SHIFT_LEFT: {
+ value = Variant::evaluate(Variant::OP_SHIFT_LEFT, value, p_argument);
+ } break;
+ case VisualScriptPropertySet::ASSIGN_OP_SHIFT_RIGHT: {
+ value = Variant::evaluate(Variant::OP_SHIFT_RIGHT, value, p_argument);
+ } break;
+ case VisualScriptPropertySet::ASSIGN_OP_BIT_AND: {
+ value = Variant::evaluate(Variant::OP_BIT_AND, value, p_argument);
+ } break;
+ case VisualScriptPropertySet::ASSIGN_OP_BIT_OR: {
+ value = Variant::evaluate(Variant::OP_BIT_OR, value, p_argument);
+ } break;
+ case VisualScriptPropertySet::ASSIGN_OP_BIT_XOR: {
+ value = Variant::evaluate(Variant::OP_BIT_XOR, value, p_argument);
+ } break;
+ default: {}
+ }
+
+ if (index != StringName()) {
+ source.set_named(index, value, &valid);
+ } else {
+ source = value;
+ }
+ }
+ }
+
virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
switch (call_mode) {
@@ -1494,7 +1579,13 @@ public:
bool valid;
- object->set(property, *p_inputs[0], &valid);
+ if (needs_get) {
+ Variant value = object->get(property, &valid);
+ _process_get(value, *p_inputs[0], valid);
+ object->set(property, value, &valid);
+ } else {
+ object->set(property, *p_inputs[0], &valid);
+ }
if (!valid) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
@@ -1519,7 +1610,14 @@ public:
bool valid;
- another->set(property, *p_inputs[0], &valid);
+ if (needs_get) {
+
+ Variant value = another->get(property, &valid);
+ _process_get(value, *p_inputs[0], valid);
+ another->set(property, value, &valid);
+ } else {
+ another->set(property, *p_inputs[0], &valid);
+ }
if (!valid) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
@@ -1534,7 +1632,14 @@ public:
bool valid;
- v.set(property, *p_inputs[1], &valid);
+ if (needs_get) {
+ Variant value = v.get_named(property, &valid);
+ _process_get(value, *p_inputs[1], valid);
+ v.set_named(property, value, &valid);
+
+ } else {
+ v.set_named(property, *p_inputs[1], &valid);
+ }
if (!valid) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
@@ -1557,6 +1662,9 @@ VisualScriptNodeInstance *VisualScriptPropertySet::instance(VisualScriptInstance
instance->property = property;
instance->call_mode = call_mode;
instance->node_path = base_path;
+ instance->assign_op = assign_op;
+ instance->index = index;
+ instance->needs_get = index != StringName() || assign_op != ASSIGN_OP_NONE;
return instance;
}
@@ -1570,10 +1678,10 @@ VisualScriptPropertySet::TypeGuess VisualScriptPropertySet::guess_output_type(Ty
}
VisualScriptPropertySet::VisualScriptPropertySet() {
+ assign_op = ASSIGN_OP_NONE;
call_mode = CALL_MODE_SELF;
base_type = "Object";
basic_type = Variant::NIL;
- event_type = InputEvent::NONE;
}
template <VisualScriptPropertySet::CallMode cmode>
@@ -1695,6 +1803,15 @@ PropertyInfo VisualScriptPropertyGet::get_input_value_port_info(int p_idx) const
PropertyInfo VisualScriptPropertyGet::get_output_value_port_info(int p_idx) const {
+ if (index != StringName()) {
+
+ Variant v;
+ Variant::CallError ce;
+ v = Variant::construct(type_cache, NULL, 0, ce);
+ Variant i = v.get(index);
+ return PropertyInfo(i.get_type(), "value." + String(index));
+ }
+
return PropertyInfo(type_cache, "value");
}
@@ -1763,14 +1880,8 @@ void VisualScriptPropertyGet::_update_cache() {
//not super efficient..
Variant v;
- if (basic_type == Variant::INPUT_EVENT) {
- InputEvent ev;
- ev.type = event_type;
- v = ev;
- } else {
- Variant::CallError ce;
- v = Variant::construct(basic_type, NULL, 0, ce);
- }
+ Variant::CallError ce;
+ v = Variant::construct(basic_type, NULL, 0, ce);
List<PropertyInfo> pinfo;
v.get_property_list(&pinfo);
@@ -1918,59 +2029,51 @@ Variant::Type VisualScriptPropertyGet::get_basic_type() const {
return basic_type;
}
-void VisualScriptPropertyGet::set_event_type(InputEvent::Type p_type) {
-
- if (event_type == p_type)
- return;
- event_type = p_type;
- if (call_mode == CALL_MODE_BASIC_TYPE) {
- _update_cache();
- }
- _change_notify();
- _update_base_type();
- ports_changed_notify();
+void VisualScriptPropertyGet::_set_type_cache(Variant::Type p_type) {
+ type_cache = p_type;
}
-InputEvent::Type VisualScriptPropertyGet::get_event_type() const {
+Variant::Type VisualScriptPropertyGet::_get_type_cache() const {
- return event_type;
+ return type_cache;
}
-void VisualScriptPropertyGet::_set_type_cache(Variant::Type p_type) {
- type_cache = p_type;
+void VisualScriptPropertyGet::set_index(const StringName &p_type) {
+
+ if (index == p_type)
+ return;
+ index = p_type;
+ _update_cache();
+ _change_notify();
+ ports_changed_notify();
}
-Variant::Type VisualScriptPropertyGet::_get_type_cache() const {
+StringName VisualScriptPropertyGet::get_index() const {
- return type_cache;
+ return index;
}
void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const {
- if (property.name == "property/base_type") {
+ if (property.name == "base_type") {
if (call_mode != CALL_MODE_INSTANCE) {
property.usage = PROPERTY_USAGE_NOEDITOR;
}
}
- if (property.name == "property/base_script") {
+ if (property.name == "base_script") {
if (call_mode != CALL_MODE_INSTANCE) {
property.usage = 0;
}
}
- if (property.name == "property/basic_type") {
+ if (property.name == "basic_type") {
if (call_mode != CALL_MODE_BASIC_TYPE) {
property.usage = 0;
}
}
- if (property.name == "property/event_type") {
- if (call_mode != CALL_MODE_BASIC_TYPE || basic_type != Variant::INPUT_EVENT) {
- property.usage = 0;
- }
- }
- if (property.name == "property/node_path") {
+ if (property.name == "node_path") {
if (call_mode != CALL_MODE_NODE_PATH) {
property.usage = 0;
} else {
@@ -1983,7 +2086,7 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const {
}
}
- if (property.name == "property/property") {
+ if (property.name == "property") {
if (call_mode == CALL_MODE_BASIC_TYPE) {
@@ -1992,7 +2095,7 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const {
} else if (call_mode == CALL_MODE_SELF && get_visual_script().is_valid()) {
property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
- property.hint_string = itos(get_visual_script()->get_instance_ID());
+ property.hint_string = itos(get_visual_script()->get_instance_id());
} else if (call_mode == CALL_MODE_INSTANCE) {
property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
property.hint_string = base_type;
@@ -2009,7 +2112,7 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const {
if (script.is_valid()) {
property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
- property.hint_string = itos(script->get_instance_ID());
+ property.hint_string = itos(script->get_instance_id());
}
}
}
@@ -2017,13 +2120,31 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const {
Node *node = _get_base_node();
if (node) {
property.hint = PROPERTY_HINT_PROPERTY_OF_INSTANCE;
- property.hint_string = itos(node->get_instance_ID());
+ property.hint_string = itos(node->get_instance_id());
} else {
property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
property.hint_string = get_base_type();
}
}
}
+
+ if (property.name == "index") {
+
+ Variant::CallError ce;
+ Variant v = Variant::construct(type_cache, NULL, 0, ce);
+ List<PropertyInfo> plist;
+ v.get_property_list(&plist);
+ String options = "";
+ for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
+ options += "," + E->get().name;
+ }
+
+ property.hint = PROPERTY_HINT_ENUM;
+ property.hint_string = options;
+ property.type = Variant::STRING;
+ if (options == "")
+ property.usage = 0; //hide if type has no usable index
+ }
}
void VisualScriptPropertyGet::_bind_methods() {
@@ -2040,9 +2161,6 @@ void VisualScriptPropertyGet::_bind_methods() {
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(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(D_METHOD("set_property", "property"), &VisualScriptPropertyGet::set_property);
ClassDB::bind_method(D_METHOD("get_property"), &VisualScriptPropertyGet::get_property);
@@ -2052,6 +2170,9 @@ void VisualScriptPropertyGet::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("set_index", "index"), &VisualScriptPropertyGet::set_index);
+ ClassDB::bind_method(D_METHOD("get_index"), &VisualScriptPropertyGet::get_index);
+
String bt;
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
if (i > 0)
@@ -2060,14 +2181,6 @@ void VisualScriptPropertyGet::_bind_methods() {
bt += Variant::get_type_name(Variant::Type(i));
}
- String et;
- for (int i = 0; i < InputEvent::TYPE_MAX; i++) {
- if (i > 0)
- et += ",";
-
- et += event_type_names[i];
- }
-
List<String> script_extensions;
for (int i = 0; i < ScriptServer::get_language_count(); i++) {
ScriptServer::get_language(i)->get_recognized_extensions(&script_extensions);
@@ -2080,14 +2193,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"), "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");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "set_mode", PROPERTY_HINT_ENUM, "Self,Node Path,Instance,Basic Type"), "set_call_mode", "get_call_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_type", PROPERTY_HINT_TYPE_STRING, "Object"), "set_base_type", "get_base_type");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_script", PROPERTY_HINT_FILE, script_ext_hint), "set_base_script", "get_base_script");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "type_cache", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_type_cache", "_get_type_cache");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "basic_type", PROPERTY_HINT_ENUM, bt), "set_basic_type", "get_basic_type");
+ ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "node_path", PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE), "set_base_path", "get_base_path");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "property"), "set_property", "get_property");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "index", PROPERTY_HINT_ENUM), "set_index", "get_index");
BIND_CONSTANT(CALL_MODE_SELF);
BIND_CONSTANT(CALL_MODE_NODE_PATH);
@@ -2099,6 +2212,7 @@ public:
VisualScriptPropertyGet::CallMode call_mode;
NodePath node_path;
StringName property;
+ StringName index;
VisualScriptPropertyGet *node;
VisualScriptInstance *instance;
@@ -2115,6 +2229,10 @@ public:
*p_outputs[0] = object->get(property, &valid);
+ if (index != StringName()) {
+ *p_outputs[0] = p_outputs[0]->get_named(index);
+ }
+
if (!valid) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("Invalid index property name.");
@@ -2141,6 +2259,10 @@ public:
*p_outputs[0] = another->get(property, &valid);
+ if (index != StringName()) {
+ *p_outputs[0] = p_outputs[0]->get_named(index);
+ }
+
if (!valid) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = vformat(RTR("Invalid index property name '%s' in node %s."), String(property), another->get_name());
@@ -2154,6 +2276,9 @@ public:
Variant v = *p_inputs[0];
*p_outputs[0] = v.get(property, &valid);
+ if (index != StringName()) {
+ *p_outputs[0] = p_outputs[0]->get_named(index);
+ }
if (!valid) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
@@ -2174,6 +2299,7 @@ VisualScriptNodeInstance *VisualScriptPropertyGet::instance(VisualScriptInstance
instance->property = property;
instance->call_mode = call_mode;
instance->node_path = base_path;
+ instance->index = index;
return instance;
}
@@ -2183,7 +2309,6 @@ VisualScriptPropertyGet::VisualScriptPropertyGet() {
call_mode = CALL_MODE_SELF;
base_type = "Object";
basic_type = Variant::NIL;
- event_type = InputEvent::NONE;
type_cache = Variant::NIL;
}
@@ -2278,7 +2403,7 @@ StringName VisualScriptEmitSignal::get_signal() const {
void VisualScriptEmitSignal::_validate_property(PropertyInfo &property) const {
- if (property.name == "signal/signal") {
+ if (property.name == "signal") {
property.hint = PROPERTY_HINT_ENUM;
List<StringName> sigs;
@@ -2306,7 +2431,7 @@ void VisualScriptEmitSignal::_bind_methods() {
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"), "set_signal", "get_signal");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "signal"), "set_signal", "get_signal");
}
class VisualScriptNodeInstanceEmitSignal : public VisualScriptNodeInstance {
diff --git a/modules/visual_script/visual_script_func_nodes.h b/modules/visual_script/visual_script_func_nodes.h
index 3f82edc5f0..3b38d0d08f 100644
--- a/modules/visual_script/visual_script_func_nodes.h
+++ b/modules/visual_script/visual_script_func_nodes.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -69,7 +70,7 @@ private:
MethodInfo method_cache;
void _update_method_cache();
- void _set_argument_cache(const Dictionary &p_args);
+ void _set_argument_cache(const Dictionary &p_cache);
Dictionary _get_argument_cache() const;
protected:
@@ -145,6 +146,21 @@ public:
};
+ enum AssignOp {
+ ASSIGN_OP_NONE,
+ ASSIGN_OP_ADD,
+ ASSIGN_OP_SUB,
+ ASSIGN_OP_MUL,
+ ASSIGN_OP_DIV,
+ ASSIGN_OP_MOD,
+ ASSIGN_OP_SHIFT_LEFT,
+ ASSIGN_OP_SHIFT_RIGHT,
+ ASSIGN_OP_BIT_AND,
+ ASSIGN_OP_BIT_OR,
+ ASSIGN_OP_BIT_XOR,
+ ASSIGN_OP_MAX
+ };
+
private:
PropertyInfo type_cache;
@@ -154,7 +170,8 @@ private:
String base_script;
NodePath base_path;
StringName property;
- InputEvent::Type event_type;
+ StringName index;
+ AssignOp assign_op;
Node *_get_base_node() const;
StringName _get_base_type() const;
@@ -166,6 +183,8 @@ private:
void _set_type_cache(const Dictionary &p_type);
Dictionary _get_type_cache() const;
+ void _adjust_input_index(PropertyInfo &pinfo) const;
+
protected:
virtual void _validate_property(PropertyInfo &property) const;
@@ -196,9 +215,6 @@ public:
void set_basic_type(Variant::Type p_type);
Variant::Type get_basic_type() const;
- void set_event_type(InputEvent::Type p_type);
- InputEvent::Type get_event_type() const;
-
void set_property(const StringName &p_type);
StringName get_property() const;
@@ -208,6 +224,12 @@ public:
void set_call_mode(CallMode p_mode);
CallMode get_call_mode() const;
+ void set_index(const StringName &p_type);
+ StringName get_index() const;
+
+ void set_assign_op(AssignOp p_op);
+ AssignOp get_assign_op() const;
+
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const;
@@ -215,6 +237,7 @@ public:
};
VARIANT_ENUM_CAST(VisualScriptPropertySet::CallMode);
+VARIANT_ENUM_CAST(VisualScriptPropertySet::AssignOp);
class VisualScriptPropertyGet : public VisualScriptNode {
@@ -237,7 +260,7 @@ private:
String base_script;
NodePath base_path;
StringName property;
- InputEvent::Type event_type;
+ StringName index;
void _update_base_type();
Node *_get_base_node() const;
@@ -278,9 +301,6 @@ public:
void set_basic_type(Variant::Type p_type);
Variant::Type get_basic_type() const;
- void set_event_type(InputEvent::Type p_type);
- InputEvent::Type get_event_type() const;
-
void set_property(const StringName &p_type);
StringName get_property() const;
@@ -290,6 +310,9 @@ public:
void set_call_mode(CallMode p_mode);
CallMode get_call_mode() const;
+ void set_index(const StringName &p_type);
+ StringName get_index() const;
+
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
VisualScriptPropertyGet();
diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp
index 68bd1e6d4c..4f9cd4a33b 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,12 +29,12 @@
/*************************************************************************/
#include "visual_script_nodes.h"
-#include "global_config.h"
#include "global_constants.h"
#include "os/input.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/main/node.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
//////////////////////////////////////////
////////////////FUNCTION//////////////////
@@ -58,10 +59,10 @@ bool VisualScriptFunction::_set(const StringName &p_name, const Variant &p_value
_change_notify();
return true;
}
- if (String(p_name).begins_with("argument/")) {
- int idx = String(p_name).get_slice("/", 1).to_int() - 1;
+ if (String(p_name).begins_with("argument_")) {
+ int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int() - 1;
ERR_FAIL_INDEX_V(idx, arguments.size(), false);
- String what = String(p_name).get_slice("/", 2);
+ String what = String(p_name).get_slice("/", 1);
if (what == "type") {
Variant::Type new_type = Variant::Type(int(p_value));
@@ -94,6 +95,12 @@ bool VisualScriptFunction::_set(const StringName &p_name, const Variant &p_value
return true;
}
+ if (p_name == "sequenced/sequenced") {
+ sequenced = p_value;
+ ports_changed_notify();
+ return true;
+ }
+
return false;
}
@@ -103,10 +110,10 @@ bool VisualScriptFunction::_get(const StringName &p_name, Variant &r_ret) const
r_ret = arguments.size();
return true;
}
- if (String(p_name).begins_with("argument/")) {
- int idx = String(p_name).get_slice("/", 1).to_int() - 1;
+ if (String(p_name).begins_with("argument_")) {
+ int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int() - 1;
ERR_FAIL_INDEX_V(idx, arguments.size(), false);
- String what = String(p_name).get_slice("/", 2);
+ String what = String(p_name).get_slice("/", 1);
if (what == "type") {
r_ret = arguments[idx].type;
return true;
@@ -132,6 +139,11 @@ bool VisualScriptFunction::_get(const StringName &p_name, Variant &r_ret) const
return true;
}
+ if (p_name == "sequenced/sequenced") {
+ r_ret = sequenced;
+ return true;
+ }
+
return false;
}
void VisualScriptFunction::_get_property_list(List<PropertyInfo> *p_list) const {
@@ -143,9 +155,12 @@ void VisualScriptFunction::_get_property_list(List<PropertyInfo> *p_list) const
}
for (int i = 0; i < arguments.size(); i++) {
- p_list->push_back(PropertyInfo(Variant::INT, "argument/" + itos(i + 1) + "/type", PROPERTY_HINT_ENUM, argt));
- p_list->push_back(PropertyInfo(Variant::STRING, "argument/" + itos(i + 1) + "/name"));
+ p_list->push_back(PropertyInfo(Variant::INT, "argument_" + itos(i + 1) + "/type", PROPERTY_HINT_ENUM, argt));
+ p_list->push_back(PropertyInfo(Variant::STRING, "argument_" + itos(i + 1) + "/name"));
}
+
+ p_list->push_back(PropertyInfo(Variant::BOOL, "sequenced/sequenced"));
+
if (!stack_less) {
p_list->push_back(PropertyInfo(Variant::INT, "stack/size", PROPERTY_HINT_RANGE, "1,100000"));
}
@@ -301,6 +316,7 @@ VisualScriptFunction::VisualScriptFunction() {
stack_size = 256;
stack_less = false;
+ sequenced = true;
rpc_mode = ScriptInstance::RPC_MODE_DISABLED;
}
@@ -313,6 +329,16 @@ bool VisualScriptFunction::is_stack_less() const {
return stack_less;
}
+void VisualScriptFunction::set_sequenced(bool p_enable) {
+
+ sequenced = p_enable;
+}
+
+bool VisualScriptFunction::is_sequenced() const {
+
+ return sequenced;
+}
+
void VisualScriptFunction::set_stack_size(int p_size) {
ERR_FAIL_COND(p_size < 1 || p_size > 100000);
@@ -558,8 +584,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), "set_operator", "get_operator");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "typed_value/typed", PROPERTY_HINT_ENUM, argt), "set_typed", "get_typed");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "operator", PROPERTY_HINT_ENUM, types), "set_operator", "get_operator");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, argt), "set_typed", "get_typed");
}
class VisualScriptNodeInstanceOperator : public VisualScriptNodeInstance {
@@ -620,6 +646,113 @@ static Ref<VisualScriptNode> create_op_node(const String &p_name) {
}
//////////////////////////////////////////
+////////////////OPERATOR//////////////////
+//////////////////////////////////////////
+
+int VisualScriptSelect::get_output_sequence_port_count() const {
+
+ return 0;
+}
+
+bool VisualScriptSelect::has_input_sequence_port() const {
+
+ return false;
+}
+
+int VisualScriptSelect::get_input_value_port_count() const {
+
+ return 3;
+}
+int VisualScriptSelect::get_output_value_port_count() const {
+
+ return 1;
+}
+
+String VisualScriptSelect::get_output_sequence_port_text(int p_port) const {
+
+ return String();
+}
+
+PropertyInfo VisualScriptSelect::get_input_value_port_info(int p_idx) const {
+
+ if (p_idx == 0) {
+ return PropertyInfo(Variant::BOOL, "cond");
+ } else if (p_idx == 1) {
+ return PropertyInfo(typed, "a");
+ } else {
+ return PropertyInfo(typed, "b");
+ }
+}
+PropertyInfo VisualScriptSelect::get_output_value_port_info(int p_idx) const {
+
+ return PropertyInfo(typed, "out");
+}
+
+String VisualScriptSelect::get_caption() const {
+
+ return "Select";
+}
+
+String VisualScriptSelect::get_text() const {
+
+ return "a if cond, else b";
+}
+
+void VisualScriptSelect::set_typed(Variant::Type p_op) {
+
+ if (typed == p_op)
+ return;
+
+ typed = p_op;
+ ports_changed_notify();
+}
+
+Variant::Type VisualScriptSelect::get_typed() const {
+
+ return typed;
+}
+
+void VisualScriptSelect::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_typed", "type"), &VisualScriptSelect::set_typed);
+ ClassDB::bind_method(D_METHOD("get_typed"), &VisualScriptSelect::get_typed);
+
+ String argt = "Any";
+ for (int i = 1; i < Variant::VARIANT_MAX; i++) {
+ argt += "," + Variant::get_type_name(Variant::Type(i));
+ }
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, argt), "set_typed", "get_typed");
+}
+
+class VisualScriptNodeInstanceSelect : public VisualScriptNodeInstance {
+public:
+ //virtual int get_working_memory_size() const { return 0; }
+
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+
+ bool cond = *p_inputs[0];
+ if (cond)
+ *p_outputs[0] = *p_inputs[1];
+ else
+ *p_outputs[0] = *p_inputs[2];
+
+ return 0;
+ }
+};
+
+VisualScriptNodeInstance *VisualScriptSelect::instance(VisualScriptInstance *p_instance) {
+
+ VisualScriptNodeInstanceSelect *instance = memnew(VisualScriptNodeInstanceSelect);
+ return instance;
+}
+
+VisualScriptSelect::VisualScriptSelect() {
+
+ typed = Variant::NIL;
+}
+
+//////////////////////////////////////////
////////////////VARIABLE GET//////////////////
//////////////////////////////////////////
@@ -690,7 +823,7 @@ StringName VisualScriptVariableGet::get_variable() const {
void VisualScriptVariableGet::_validate_property(PropertyInfo &property) const {
- if (property.name == "variable/name" && get_visual_script().is_valid()) {
+ if (property.name == "var_name" && get_visual_script().is_valid()) {
Ref<VisualScript> vs = get_visual_script();
List<StringName> vars;
vs->get_variable_list(&vars);
@@ -713,7 +846,7 @@ void VisualScriptVariableGet::_bind_methods() {
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"), "set_variable", "get_variable");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "var_name"), "set_variable", "get_variable");
}
class VisualScriptNodeInstanceVariableGet : public VisualScriptNodeInstance {
@@ -815,7 +948,7 @@ StringName VisualScriptVariableSet::get_variable() const {
void VisualScriptVariableSet::_validate_property(PropertyInfo &property) const {
- if (property.name == "variable/name" && get_visual_script().is_valid()) {
+ if (property.name == "var_name" && get_visual_script().is_valid()) {
Ref<VisualScript> vs = get_visual_script();
List<StringName> vars;
vs->get_variable_list(&vars);
@@ -838,7 +971,7 @@ void VisualScriptVariableSet::_bind_methods() {
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"), "set_variable", "get_variable");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "var_name"), "set_variable", "get_variable");
}
class VisualScriptNodeInstanceVariableSet : public VisualScriptNodeInstance {
@@ -955,7 +1088,7 @@ Variant VisualScriptConstant::get_constant_value() const {
void VisualScriptConstant::_validate_property(PropertyInfo &property) const {
- if (property.name == "constant/value") {
+ if (property.name == "value") {
property.type = type;
if (type == Variant::NIL)
property.usage = 0; //do not save if nil
@@ -975,8 +1108,8 @@ void VisualScriptConstant::_bind_methods() {
argt += "," + Variant::get_type_name(Variant::Type(i));
}
- 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");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, argt), "set_constant_type", "get_constant_type");
+ ADD_PROPERTY(PropertyInfo(Variant::NIL, "value"), "set_constant_value", "get_constant_value");
}
class VisualScriptNodeInstanceConstant : public VisualScriptNodeInstance {
@@ -1075,6 +1208,7 @@ void VisualScriptPreload::set_preload(const Ref<Resource> &p_preload) {
preload = p_preload;
ports_changed_notify();
}
+
Ref<Resource> VisualScriptPreload::get_preload() const {
return preload;
@@ -1359,7 +1493,7 @@ void VisualScriptGlobalConstant::_bind_methods() {
cc += ",";
cc += GlobalConstants::get_global_constant_name(i);
}
- ADD_PROPERTY(PropertyInfo(Variant::INT, "constant", PROPERTY_HINT_ENUM, cc), "set_global_constant", "get_global_constant");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "constant/constant", PROPERTY_HINT_ENUM, cc), "set_global_constant", "get_global_constant");
}
VisualScriptGlobalConstant::VisualScriptGlobalConstant() {
@@ -1464,7 +1598,7 @@ VisualScriptNodeInstance *VisualScriptClassConstant::instance(VisualScriptInstan
void VisualScriptClassConstant::_validate_property(PropertyInfo &property) const {
- if (property.name == "constant") {
+ if (property.name == "constant/constant") {
List<String> constants;
ClassDB::get_integer_constant_list(base_type, &constants, true);
@@ -1488,7 +1622,7 @@ void VisualScriptClassConstant::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_base_type"), &VisualScriptClassConstant::get_base_type);
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");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "constant/constant", PROPERTY_HINT_ENUM, ""), "set_class_constant", "get_class_constant");
}
VisualScriptClassConstant::VisualScriptClassConstant() {
@@ -1593,7 +1727,7 @@ VisualScriptNodeInstance *VisualScriptBasicTypeConstant::instance(VisualScriptIn
void VisualScriptBasicTypeConstant::_validate_property(PropertyInfo &property) const {
- if (property.name == "constant") {
+ if (property.name == "constant/constant") {
List<StringName> constants;
Variant::get_numeric_constants_for_type(type, &constants);
@@ -1626,7 +1760,7 @@ void VisualScriptBasicTypeConstant::_bind_methods() {
}
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");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "constant/constant", PROPERTY_HINT_ENUM, ""), "set_basic_type_constant", "get_basic_type_constant");
}
VisualScriptBasicTypeConstant::VisualScriptBasicTypeConstant() {
@@ -1747,7 +1881,7 @@ void VisualScriptMathConstant::_bind_methods() {
cc += ",";
cc += const_name[i];
}
- ADD_PROPERTY(PropertyInfo(Variant::INT, "constant", PROPERTY_HINT_ENUM, cc), "set_math_constant", "get_math_constant");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "constant/constant", PROPERTY_HINT_ENUM, cc), "set_math_constant", "get_math_constant");
}
VisualScriptMathConstant::VisualScriptMathConstant() {
@@ -1831,17 +1965,17 @@ public:
VisualScriptNodeInstance *VisualScriptEngineSingleton::instance(VisualScriptInstance *p_instance) {
VisualScriptNodeInstanceEngineSingleton *instance = memnew(VisualScriptNodeInstanceEngineSingleton);
- instance->singleton = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ instance->singleton = ProjectSettings::get_singleton()->get_singleton_object(singleton);
return instance;
}
VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output_type(TypeGuess *p_inputs, int p_output) const {
- Object *obj = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
TypeGuess tg;
tg.type = Variant::OBJECT;
if (obj) {
- tg.GDCLASS = obj->get_class();
+ tg.gdclass = obj->get_class();
tg.script = obj->get_script();
}
@@ -1855,11 +1989,11 @@ void VisualScriptEngineSingleton::_bind_methods() {
String cc;
- List<GlobalConfig::Singleton> singletons;
+ List<ProjectSettings::Singleton> singletons;
- GlobalConfig::get_singleton()->get_singletons(&singletons);
+ ProjectSettings::get_singleton()->get_singletons(&singletons);
- for (List<GlobalConfig::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
+ for (List<ProjectSettings::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
if (E->get().name == "VS" || E->get().name == "PS" || E->get().name == "PS2D" || E->get().name == "AS" || E->get().name == "TS" || E->get().name == "SS" || E->get().name == "SS2D")
continue; //skip these, too simple named
@@ -1868,7 +2002,7 @@ void VisualScriptEngineSingleton::_bind_methods() {
cc += E->get().name;
}
- ADD_PROPERTY(PropertyInfo(Variant::STRING, "constant", PROPERTY_HINT_ENUM, cc), "set_singleton", "get_singleton");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "constant/constant", PROPERTY_HINT_ENUM, cc), "set_singleton", "get_singleton");
}
VisualScriptEngineSingleton::VisualScriptEngineSingleton() {
@@ -2001,7 +2135,7 @@ VisualScriptSceneNode::TypeGuess VisualScriptSceneNode::guess_output_type(TypeGu
VisualScriptSceneNode::TypeGuess tg;
tg.type = Variant::OBJECT;
- tg.GDCLASS = "Node";
+ tg.gdclass = "Node";
#ifdef TOOLS_ENABLED
Ref<Script> script = get_visual_script();
@@ -2030,7 +2164,7 @@ VisualScriptSceneNode::TypeGuess VisualScriptSceneNode::guess_output_type(TypeGu
Node *another = script_node->get_node(path);
if (another) {
- tg.GDCLASS = another->get_class();
+ tg.gdclass = another->get_class();
tg.script = another->get_script();
}
#endif
@@ -2172,7 +2306,7 @@ VisualScriptSceneTree::TypeGuess VisualScriptSceneTree::guess_output_type(TypeGu
TypeGuess tg;
tg.type = Variant::OBJECT;
- tg.GDCLASS = "SceneTree";
+ tg.gdclass = "SceneTree";
return tg;
}
@@ -2352,13 +2486,13 @@ VisualScriptSelf::TypeGuess VisualScriptSelf::guess_output_type(TypeGuess *p_inp
VisualScriptSceneNode::TypeGuess tg;
tg.type = Variant::OBJECT;
- tg.GDCLASS = "Object";
+ tg.gdclass = "Object";
Ref<Script> script = get_visual_script();
if (!script.is_valid())
return tg;
- tg.GDCLASS = script->get_instance_base_type();
+ tg.gdclass = script->get_instance_base_type();
tg.script = script;
return tg;
@@ -2488,10 +2622,10 @@ public:
in_values.resize(in_count);
for (int i = 0; i < in_count; i++) {
- in_values[i] = p_inputs[i];
+ in_values[i] = *p_inputs[i];
}
- out_values.resize(in_count);
+ out_values.resize(out_count);
work_mem.resize(work_mem_size);
@@ -2537,6 +2671,7 @@ VisualScriptNodeInstance *VisualScriptCustomNode::instance(VisualScriptInstance
VisualScriptNodeInstanceCustomNode *instance = memnew(VisualScriptNodeInstanceCustomNode);
instance->instance = p_instance;
+ instance->node = this;
instance->in_count = get_input_value_port_count();
instance->out_count = get_output_value_port_count();
@@ -2549,6 +2684,10 @@ VisualScriptNodeInstance *VisualScriptCustomNode::instance(VisualScriptInstance
return instance;
}
+void VisualScriptCustomNode::_script_changed() {
+ ports_changed_notify();
+}
+
void VisualScriptCustomNode::_bind_methods() {
BIND_VMETHOD(MethodInfo(Variant::INT, "_get_output_sequence_port_count"));
@@ -2571,6 +2710,8 @@ void VisualScriptCustomNode::_bind_methods() {
BIND_VMETHOD(MethodInfo(Variant::INT, "_get_working_memory_size"));
BIND_VMETHOD(MethodInfo(Variant::NIL, "_step:Variant", PropertyInfo(Variant::ARRAY, "inputs"), PropertyInfo(Variant::ARRAY, "outputs"), PropertyInfo(Variant::INT, "start_mode"), PropertyInfo(Variant::ARRAY, "working_mem")));
+ ClassDB::bind_method(D_METHOD("_script_changed"), &VisualScriptCustomNode::_script_changed);
+
BIND_CONSTANT(START_MODE_BEGIN_SEQUENCE);
BIND_CONSTANT(START_MODE_CONTINUE_SEQUENCE);
BIND_CONSTANT(START_MODE_RESUME_YIELD);
@@ -2583,6 +2724,7 @@ void VisualScriptCustomNode::_bind_methods() {
}
VisualScriptCustomNode::VisualScriptCustomNode() {
+ connect("script_changed", this, "_script_changed");
}
//////////////////////////////////////////
@@ -2682,7 +2824,7 @@ public:
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
return 0;
}
- *p_outputs[0] = subcall->call(VisualScriptLanguage::singleton->_subcall, p_inputs, input_args, r_error_str);
+ *p_outputs[0] = subcall->call(VisualScriptLanguage::singleton->_subcall, p_inputs, input_args, r_error);
return 0;
}
};
@@ -2703,7 +2845,7 @@ VisualScriptNodeInstance *VisualScriptSubCall::instance(VisualScriptInstance *p_
void VisualScriptSubCall::_bind_methods() {
- BIND_VMETHOD(MethodInfo(Variant::NIL, "_subcall", PropertyInfo(Variant::NIL, "arguments:Variant")));
+ BIND_VMETHOD(MethodInfo(Variant::NIL, "_subcall:Variant", PropertyInfo(Variant::NIL, "arguments:Variant")));
}
VisualScriptSubCall::VisualScriptSubCall() {
@@ -3087,8 +3229,8 @@ void VisualScriptLocalVar::_bind_methods() {
argt += "," + Variant::get_type_name(Variant::Type(i));
}
- 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");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "var_name"), "set_var_name", "get_var_name");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, argt), "set_var_type", "get_var_type");
}
VisualScriptLocalVar::VisualScriptLocalVar() {
@@ -3209,8 +3351,8 @@ void VisualScriptLocalVarSet::_bind_methods() {
argt += "," + Variant::get_type_name(Variant::Type(i));
}
- 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");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "var_name"), "set_var_name", "get_var_name");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, argt), "set_var_type", "get_var_type");
}
VisualScriptLocalVarSet::VisualScriptLocalVarSet() {
@@ -3252,32 +3394,33 @@ PropertyInfo VisualScriptInputAction::get_input_value_port_info(int p_idx) const
}
PropertyInfo VisualScriptInputAction::get_output_value_port_info(int p_idx) const {
- return PropertyInfo(Variant::BOOL, "pressed");
-}
-
-String VisualScriptInputAction::get_caption() const {
-
- return "Action";
-}
-
-String VisualScriptInputAction::get_text() const {
-
+ String mstr;
switch (mode) {
case MODE_PRESSED: {
- return name;
+ mstr = "pressed";
} break;
case MODE_RELEASED: {
- return "not " + name;
+ mstr = "not pressed";
} break;
case MODE_JUST_PRESSED: {
- return String(name) + " " + TTR("just pressed");
+ mstr = "just pressed";
} break;
case MODE_JUST_RELEASED: {
- return String(name) + " " + TTR("just released");
+ mstr = "just released";
} break;
}
- return String();
+ return PropertyInfo(Variant::BOOL, mstr);
+}
+
+String VisualScriptInputAction::get_caption() const {
+
+ return "Action";
+}
+
+String VisualScriptInputAction::get_text() const {
+
+ return name;
}
String VisualScriptInputAction::get_category() const {
@@ -3318,8 +3461,6 @@ public:
StringName action;
VisualScriptInputAction::Mode mode;
- virtual int get_working_memory_size() const { return 1; }
-
virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
switch (mode) {
@@ -3359,7 +3500,7 @@ void VisualScriptInputAction::_validate_property(PropertyInfo &property) const {
String actions;
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
Vector<String> al;
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
@@ -3459,14 +3600,8 @@ void VisualScriptDeconstruct::_update_elements() {
elements.clear();
Variant v;
- if (type == Variant::INPUT_EVENT) {
- InputEvent ie;
- ie.type = input_type;
- v = ie;
- } else {
- Variant::CallError ce;
- v = Variant::construct(type, NULL, 0, ce);
- }
+ Variant::CallError ce;
+ v = Variant::construct(type, NULL, 0, ce);
List<PropertyInfo> pinfo;
v.get_property_list(&pinfo);
@@ -3496,21 +3631,6 @@ Variant::Type VisualScriptDeconstruct::get_deconstruct_type() const {
return type;
}
-void VisualScriptDeconstruct::set_deconstruct_input_type(InputEvent::Type p_input_type) {
-
- if (input_type == p_input_type)
- return;
-
- input_type = p_input_type;
- _update_elements();
- ports_changed_notify();
-}
-
-InputEvent::Type VisualScriptDeconstruct::get_deconstruct_input_type() const {
-
- return input_type;
-}
-
void VisualScriptDeconstruct::_set_elem_cache(const Array &p_elements) {
ERR_FAIL_COND(p_elements.size() % 2 == 1);
@@ -3569,12 +3689,6 @@ VisualScriptNodeInstance *VisualScriptDeconstruct::instance(VisualScriptInstance
}
void VisualScriptDeconstruct::_validate_property(PropertyInfo &property) const {
-
- if (property.name == "input_type") {
- if (type != Variant::INPUT_EVENT) {
- property.usage = 0;
- }
- }
}
void VisualScriptDeconstruct::_bind_methods() {
@@ -3582,9 +3696,6 @@ void VisualScriptDeconstruct::_bind_methods() {
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(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(D_METHOD("_set_elem_cache", "_cache"), &VisualScriptDeconstruct::_set_elem_cache);
ClassDB::bind_method(D_METHOD("_get_elem_cache"), &VisualScriptDeconstruct::_get_elem_cache);
@@ -3593,17 +3704,13 @@ void VisualScriptDeconstruct::_bind_methods() {
argt += "," + Variant::get_type_name(Variant::Type(i));
}
- String iet = "None,Key,MouseMotion,MouseButton,JoypadMotion,JoypadButton,ScreenTouch,ScreenDrag,Action";
-
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");
}
VisualScriptDeconstruct::VisualScriptDeconstruct() {
type = Variant::NIL;
- input_type = InputEvent::NONE;
}
void register_visual_script_nodes() {
@@ -3621,11 +3728,11 @@ void register_visual_script_nodes() {
VisualScriptLanguage::singleton->add_register_func("data/preload", create_node_generic<VisualScriptPreload>);
VisualScriptLanguage::singleton->add_register_func("data/action", create_node_generic<VisualScriptInputAction>);
- VisualScriptLanguage::singleton->add_register_func("constants/constant", create_node_generic<VisualScriptConstant>);
- VisualScriptLanguage::singleton->add_register_func("constants/math_constant", create_node_generic<VisualScriptMathConstant>);
- VisualScriptLanguage::singleton->add_register_func("constants/class_constant", create_node_generic<VisualScriptClassConstant>);
- VisualScriptLanguage::singleton->add_register_func("constants/global_constant", create_node_generic<VisualScriptGlobalConstant>);
- VisualScriptLanguage::singleton->add_register_func("constants/basic_type_constant", create_node_generic<VisualScriptBasicTypeConstant>);
+ VisualScriptLanguage::singleton->add_register_func("constant/constants/constant", create_node_generic<VisualScriptConstant>);
+ VisualScriptLanguage::singleton->add_register_func("constant/constants/math_constant", create_node_generic<VisualScriptMathConstant>);
+ VisualScriptLanguage::singleton->add_register_func("constant/constants/class_constant", create_node_generic<VisualScriptClassConstant>);
+ VisualScriptLanguage::singleton->add_register_func("constant/constants/global_constant", create_node_generic<VisualScriptGlobalConstant>);
+ VisualScriptLanguage::singleton->add_register_func("constant/constants/basic_type_constant", create_node_generic<VisualScriptBasicTypeConstant>);
VisualScriptLanguage::singleton->add_register_func("custom/custom_node", create_node_generic<VisualScriptCustomNode>);
VisualScriptLanguage::singleton->add_register_func("custom/sub_call", create_node_generic<VisualScriptSubCall>);
@@ -3661,6 +3768,7 @@ void register_visual_script_nodes() {
VisualScriptLanguage::singleton->add_register_func("operators/logic/xor", create_op_node<Variant::OP_XOR>);
VisualScriptLanguage::singleton->add_register_func("operators/logic/not", create_op_node<Variant::OP_NOT>);
VisualScriptLanguage::singleton->add_register_func("operators/logic/in", create_op_node<Variant::OP_IN>);
+ VisualScriptLanguage::singleton->add_register_func("operators/logic/select", create_node_generic<VisualScriptSelect>);
VisualScriptLanguage::singleton->add_register_func("functions/deconstruct", create_node_generic<VisualScriptDeconstruct>);
diff --git a/modules/visual_script/visual_script_nodes.h b/modules/visual_script/visual_script_nodes.h
index b2fc115660..6ce906efe0 100644
--- a/modules/visual_script/visual_script_nodes.h
+++ b/modules/visual_script/visual_script_nodes.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -45,6 +46,7 @@ class VisualScriptFunction : public VisualScriptNode {
bool stack_less;
int stack_size;
ScriptInstance::RPCMode rpc_mode;
+ bool sequenced;
protected:
bool _set(const StringName &p_name, const Variant &p_value);
@@ -78,9 +80,18 @@ public:
void set_stack_less(bool p_enable);
bool is_stack_less() const;
+ void set_sequenced(bool p_enable);
+ bool is_sequenced() const;
+
void set_stack_size(int p_size);
int get_stack_size() const;
+ void set_return_type_enabled(bool p_returns);
+ bool is_return_type_enabled() const;
+
+ void set_return_type(Variant::Type p_type);
+ Variant::Type get_return_type() const;
+
void set_rpc_mode(ScriptInstance::RPCMode p_mode);
ScriptInstance::RPCMode get_rpc_mode() const;
@@ -126,6 +137,39 @@ public:
VisualScriptOperator();
};
+class VisualScriptSelect : public VisualScriptNode {
+
+ GDCLASS(VisualScriptSelect, VisualScriptNode)
+
+ Variant::Type typed;
+
+protected:
+ static void _bind_methods();
+
+public:
+ virtual int get_output_sequence_port_count() const;
+ virtual bool has_input_sequence_port() const;
+
+ virtual String get_output_sequence_port_text(int p_port) const;
+
+ virtual int get_input_value_port_count() const;
+ virtual int get_output_value_port_count() const;
+
+ virtual PropertyInfo get_input_value_port_info(int p_idx) const;
+ virtual PropertyInfo get_output_value_port_info(int p_idx) const;
+
+ virtual String get_caption() const;
+ virtual String get_text() const;
+ virtual String get_category() const { return "operators"; }
+
+ void set_typed(Variant::Type p_op);
+ Variant::Type get_typed() const;
+
+ virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
+
+ VisualScriptSelect();
+};
+
class VisualScriptVariableGet : public VisualScriptNode {
GDCLASS(VisualScriptVariableGet, VisualScriptNode)
@@ -152,7 +196,7 @@ public:
virtual String get_text() const;
virtual String get_category() const { return "data"; }
- void set_variable(StringName p_var);
+ void set_variable(StringName p_variable);
StringName get_variable() const;
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
@@ -186,7 +230,7 @@ public:
virtual String get_text() const;
virtual String get_category() const { return "data"; }
- void set_variable(StringName p_var);
+ void set_variable(StringName p_variable);
StringName get_variable() const;
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
@@ -257,7 +301,7 @@ public:
virtual String get_text() const;
virtual String get_category() const { return "data"; }
- void set_preload(const Ref<Resource> &p_value);
+ void set_preload(const Ref<Resource> &p_preload);
Ref<Resource> get_preload() const;
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
@@ -678,6 +722,8 @@ public:
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
+ void _script_changed();
+
VisualScriptCustomNode();
};
@@ -922,7 +968,6 @@ class VisualScriptDeconstruct : public VisualScriptNode {
void _update_elements();
Variant::Type type;
- InputEvent::Type input_type;
void _set_elem_cache(const Array &p_elements);
Array _get_elem_cache() const;
@@ -951,9 +996,6 @@ public:
void set_deconstruct_type(Variant::Type p_type);
Variant::Type get_deconstruct_type() const;
- void set_deconstruct_input_type(InputEvent::Type p_input_type);
- InputEvent::Type get_deconstruct_input_type() const;
-
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
VisualScriptDeconstruct();
diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp
index 919ced74b9..2e111511b7 100644
--- a/modules/visual_script/visual_script_yield_nodes.cpp
+++ b/modules/visual_script/visual_script_yield_nodes.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,7 +31,7 @@
#include "os/os.h"
#include "scene/main/node.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
#include "visual_script_nodes.h"
//////////////////////////////////////////
@@ -418,13 +419,13 @@ VisualScriptYieldSignal::CallMode VisualScriptYieldSignal::get_call_mode() const
void VisualScriptYieldSignal::_validate_property(PropertyInfo &property) const {
- if (property.name == "signal/base_type") {
+ if (property.name == "base_type") {
if (call_mode != CALL_MODE_INSTANCE) {
property.usage = PROPERTY_USAGE_NOEDITOR;
}
}
- if (property.name == "signal/node_path") {
+ if (property.name == "node_path") {
if (call_mode != CALL_MODE_NODE_PATH) {
property.usage = 0;
} else {
@@ -437,7 +438,7 @@ void VisualScriptYieldSignal::_validate_property(PropertyInfo &property) const {
}
}
- if (property.name == "signal/signal") {
+ if (property.name == "signal") {
property.hint = PROPERTY_HINT_ENUM;
List<MethodInfo> methods;
@@ -487,10 +488,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"), "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");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "call_mode", PROPERTY_HINT_ENUM, "Self,Node Path,Instance"), "set_call_mode", "get_call_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_type", PROPERTY_HINT_TYPE_STRING, "Object"), "set_base_type", "get_base_type");
+ ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "node_path", PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE), "set_base_path", "get_base_path");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "signal"), "set_signal", "get_signal");
BIND_CONSTANT(CALL_MODE_SELF);
BIND_CONSTANT(CALL_MODE_NODE_PATH);
diff --git a/modules/visual_script/visual_script_yield_nodes.h b/modules/visual_script/visual_script_yield_nodes.h
index 35f72cdfad..638b7b5b41 100644
--- a/modules/visual_script/visual_script_yield_nodes.h
+++ b/modules/visual_script/visual_script_yield_nodes.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp
index 88c8ecc0df..1b10637fdc 100644
--- a/modules/vorbis/audio_stream_ogg_vorbis.cpp
+++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/vorbis/audio_stream_ogg_vorbis.h b/modules/vorbis/audio_stream_ogg_vorbis.h
index a13e934f2a..519ceaaea1 100644
--- a/modules/vorbis/audio_stream_ogg_vorbis.h
+++ b/modules/vorbis/audio_stream_ogg_vorbis.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/vorbis/register_types.cpp b/modules/vorbis/register_types.cpp
index b405acd16b..d9865072b9 100644
--- a/modules/vorbis/register_types.cpp
+++ b/modules/vorbis/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/vorbis/register_types.h b/modules/vorbis/register_types.h
index b2adb55acd..e7cde7a66c 100644
--- a/modules/vorbis/register_types.h
+++ b/modules/vorbis/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub
index 241d6e30cd..0ee2ed45b8 100644
--- a/modules/webm/libvpx/SCsub
+++ b/modules/webm/libvpx/SCsub
@@ -273,7 +273,7 @@ else:
webm_cpu_x86 = True
else:
webm_cpu_x86 = not is_x11_or_server_arm and (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86 or is_ios_x86)
- webm_cpu_arm = is_x11_or_server_arm or (not is_ios_x86 and env["platform"] == 'iphone') or env["platform"] == 'bb10' or (not is_android_x86 and env["platform"] == 'android')
+ webm_cpu_arm = is_x11_or_server_arm or (not is_ios_x86 and env["platform"] == 'iphone') or (not is_android_x86 and env["platform"] == 'android')
if webm_cpu_x86:
import subprocess
diff --git a/modules/webm/register_types.cpp b/modules/webm/register_types.cpp
index e50eb337ae..c234f81097 100644
--- a/modules/webm/register_types.cpp
+++ b/modules/webm/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/webm/register_types.h b/modules/webm/register_types.h
index 3df0d7bbaa..cf412e601e 100644
--- a/modules/webm/register_types.h
+++ b/modules/webm/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp
index 8d6fbdfe75..72f10b4f45 100644
--- a/modules/webm/video_stream_webm.cpp
+++ b/modules/webm/video_stream_webm.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,11 +32,12 @@
#include "OpusVorbisDecoder.hpp"
#include "VPXDecoder.hpp"
-#include "../theora/yuv2rgb.h"
#include "mkvparser/mkvparser.h"
-#include "global_config.h"
#include "os/file_access.h"
+#include "project_settings.h"
+
+#include "thirdparty/misc/yuv2rgb.h"
#include <string.h>
@@ -166,7 +168,7 @@ void VideoStreamPlaybackWebm::play() {
stop();
- delay_compensation = GlobalConfig::get_singleton()->get("audio/video_delay_compensation_ms");
+ delay_compensation = ProjectSettings::get_singleton()->get("audio/video_delay_compensation_ms");
delay_compensation /= 1000.0;
playing = true;
diff --git a/modules/webm/video_stream_webm.h b/modules/webm/video_stream_webm.h
index 2b62cf48b6..b2e88347aa 100644
--- a/modules/webm/video_stream_webm.h
+++ b/modules/webm/video_stream_webm.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/webp/image_loader_webp.cpp b/modules/webp/image_loader_webp.cpp
index 829e77873a..87c2e811b3 100644
--- a/modules/webp/image_loader_webp.cpp
+++ b/modules/webp/image_loader_webp.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,23 +37,23 @@
#include <webp/decode.h>
#include <webp/encode.h>
-static PoolVector<uint8_t> _webp_lossy_pack(const Image &p_image, float p_quality) {
+static PoolVector<uint8_t> _webp_lossy_pack(const Ref<Image> &p_image, float p_quality) {
- ERR_FAIL_COND_V(p_image.empty(), PoolVector<uint8_t>());
+ ERR_FAIL_COND_V(p_image.is_null() || p_image->empty(), PoolVector<uint8_t>());
- Image img = p_image;
- if (img.detect_alpha())
- img.convert(Image::FORMAT_RGBA8);
+ Ref<Image> img = p_image->duplicate();
+ if (img->detect_alpha())
+ img->convert(Image::FORMAT_RGBA8);
else
- img.convert(Image::FORMAT_RGB8);
+ img->convert(Image::FORMAT_RGB8);
- Size2 s(img.get_width(), img.get_height());
- PoolVector<uint8_t> data = img.get_data();
+ Size2 s(img->get_width(), img->get_height());
+ PoolVector<uint8_t> data = img->get_data();
PoolVector<uint8_t>::Read r = data.read();
uint8_t *dst_buff = NULL;
size_t dst_size = 0;
- if (img.get_format() == Image::FORMAT_RGB8) {
+ if (img->get_format() == Image::FORMAT_RGB8) {
dst_size = WebPEncodeRGB(r.ptr(), s.width, s.height, 3 * s.width, CLAMP(p_quality * 100.0, 0, 100.0), &dst_buff);
} else {
@@ -73,22 +74,24 @@ static PoolVector<uint8_t> _webp_lossy_pack(const Image &p_image, float p_qualit
return dst;
}
-static Image _webp_lossy_unpack(const PoolVector<uint8_t> &p_buffer) {
+static Ref<Image> _webp_lossy_unpack(const PoolVector<uint8_t> &p_buffer) {
int size = p_buffer.size() - 4;
- ERR_FAIL_COND_V(size <= 0, Image());
+ ERR_FAIL_COND_V(size <= 0, Ref<Image>());
PoolVector<uint8_t>::Read r = p_buffer.read();
- ERR_FAIL_COND_V(r[0] != 'W' || r[1] != 'E' || r[2] != 'B' || r[3] != 'P', Image());
+ ERR_FAIL_COND_V(r[0] != 'W' || r[1] != 'E' || r[2] != 'B' || r[3] != 'P', Ref<Image>());
WebPBitstreamFeatures features;
if (WebPGetFeatures(&r[4], size, &features) != VP8_STATUS_OK) {
ERR_EXPLAIN("Error unpacking WEBP image:");
- ERR_FAIL_V(Image());
+ ERR_FAIL_V(Ref<Image>());
}
- //print_line("width: "+itos(features.width));
- //print_line("height: "+itos(features.height));
- //print_line("alpha: "+itos(features.has_alpha));
+ /*
+ print_line("width: "+itos(features.width));
+ print_line("height: "+itos(features.height));
+ print_line("alpha: "+itos(features.has_alpha));
+ */
PoolVector<uint8_t> dst_image;
int datasize = features.width * features.height * (features.has_alpha ? 4 : 3);
@@ -104,14 +107,15 @@ static Image _webp_lossy_unpack(const PoolVector<uint8_t> &p_buffer) {
}
//ERR_EXPLAIN("Error decoding webp! - "+p_file);
- ERR_FAIL_COND_V(errdec, Image());
+ ERR_FAIL_COND_V(errdec, Ref<Image>());
dst_w = PoolVector<uint8_t>::Write();
- return Image(features.width, features.height, 0, features.has_alpha ? Image::FORMAT_RGBA8 : Image::FORMAT_RGB8, dst_image);
+ Ref<Image> img = memnew(Image(features.width, features.height, 0, features.has_alpha ? Image::FORMAT_RGBA8 : Image::FORMAT_RGB8, dst_image));
+ return img;
}
-Error ImageLoaderWEBP::load_image(Image *p_image, FileAccess *f) {
+Error ImageLoaderWEBP::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear) {
uint32_t size = f->get_len();
PoolVector<uint8_t> src_image;
@@ -129,9 +133,11 @@ Error ImageLoaderWEBP::load_image(Image *p_image, FileAccess *f) {
ERR_FAIL_V(ERR_FILE_CORRUPT);
}
+ /*
print_line("width: " + itos(features.width));
print_line("height: " + itos(features.height));
print_line("alpha: " + itos(features.has_alpha));
+ */
src_w = PoolVector<uint8_t>::Write();
@@ -155,7 +161,7 @@ Error ImageLoaderWEBP::load_image(Image *p_image, FileAccess *f) {
src_r = PoolVector<uint8_t>::Read();
dst_w = PoolVector<uint8_t>::Write();
- *p_image = Image(features.width, features.height, 0, features.has_alpha ? Image::FORMAT_RGBA8 : Image::FORMAT_RGB8, dst_image);
+ p_image->create(features.width, features.height, 0, features.has_alpha ? Image::FORMAT_RGBA8 : Image::FORMAT_RGB8, dst_image);
return OK;
}
diff --git a/modules/webp/image_loader_webp.h b/modules/webp/image_loader_webp.h
index ccf22bae13..1ac2196a71 100644
--- a/modules/webp/image_loader_webp.h
+++ b/modules/webp/image_loader_webp.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,7 +38,7 @@
class ImageLoaderWEBP : public ImageFormatLoader {
public:
- virtual Error load_image(Image *p_image, FileAccess *f);
+ virtual Error load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear);
virtual void get_recognized_extensions(List<String> *p_extensions) const;
ImageLoaderWEBP();
};
diff --git a/modules/webp/register_types.cpp b/modules/webp/register_types.cpp
index 8a708aae6a..6e29986740 100644
--- a/modules/webp/register_types.cpp
+++ b/modules/webp/register_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/webp/register_types.h b/modules/webp/register_types.h
index ce1f29937b..d0aa148079 100644
--- a/modules/webp/register_types.h
+++ b/modules/webp/register_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/SCsub b/platform/android/SCsub
index 02a8c3bc42..b124a1a5a8 100644
--- a/platform/android/SCsub
+++ b/platform/android/SCsub
@@ -52,13 +52,13 @@ if len(env.android_maven_repos) > 0:
gradle_maven_repos_text += ""
for x in env.android_maven_repos:
gradle_maven_repos_text += "\tmaven {\n"
- gradle_maven_repos_text += "\t\t" + x + "\n"
+ gradle_maven_repos_text += "\t" + x + "\n"
gradle_maven_repos_text += "\t}\n"
gradle_maven_dependencies_text = ""
for x in env.android_dependencies:
- gradle_maven_dependencies_text += x + "\n"
+ gradle_maven_dependencies_text += x + "\n\t"
gradle_java_dirs_text = ""
@@ -92,9 +92,23 @@ gradle_asset_dirs_text = ""
gradle_default_config_text = ""
+minSdk = 14
+targetSdk = 23
+
for x in env.android_default_config:
+ if x.startswith("minSdkVersion") and int(x.split(" ")[-1]) < minSdk:
+ x = "minSdkVersion " + str(minSdk)
+ if x.startswith("targetSdkVersion") and int(x.split(" ")[-1]) > targetSdk:
+ x = "targetSdkVersion " + str(targetSdk)
+
gradle_default_config_text += x + "\n\t\t"
+if "minSdkVersion" not in gradle_default_config_text:
+ gradle_default_config_text += ("minSdkVersion " + str(minSdk) + "\n\t\t")
+
+if "targetSdkVersion" not in gradle_default_config_text:
+ gradle_default_config_text += ("targetSdkVersion " + str(targetSdk) + "\n\t\t")
+
gradle_text = gradle_text.replace("$$GRADLE_REPOSITORY_URLS$$", gradle_maven_repos_text)
gradle_text = gradle_text.replace("$$GRADLE_DEPENDENCIES$$", gradle_maven_dependencies_text)
gradle_text = gradle_text.replace("$$GRADLE_JAVA_DIRS$$", gradle_java_dirs_text)
@@ -127,6 +141,8 @@ if env['android_arch'] == 'armv6':
lib_arch_dir = 'armeabi'
elif env['android_arch'] == 'armv7':
lib_arch_dir = 'armeabi-v7a'
+elif env['android_arch'] == 'arm64v8':
+ lib_arch_dir = 'arm64-v8a'
elif env['android_arch'] == 'x86':
lib_arch_dir = 'x86'
else:
diff --git a/platform/android/audio_driver_jandroid.cpp b/platform/android/audio_driver_jandroid.cpp
index 5e30289310..d293f3ed30 100644
--- a/platform/android/audio_driver_jandroid.cpp
+++ b/platform/android/audio_driver_jandroid.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "audio_driver_jandroid.h"
-#include "global_config.h"
#include "os/os.h"
+#include "project_settings.h"
#include "thread_jandroid.h"
#ifndef ANDROID_NATIVE_ACTIVITY
diff --git a/platform/android/audio_driver_jandroid.h b/platform/android/audio_driver_jandroid.h
index 4b5131cdc0..3697ca6f21 100644
--- a/platform/android/audio_driver_jandroid.h
+++ b/platform/android/audio_driver_jandroid.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -70,7 +71,7 @@ public:
virtual void set_pause(bool p_pause);
- static void setup(jobject act);
+ static void setup(jobject p_io);
static void thread_func(JNIEnv *env);
AudioDriverAndroid();
diff --git a/platform/android/audio_driver_opensl.cpp b/platform/android/audio_driver_opensl.cpp
index bba98dd623..acd94d2bdd 100644
--- a/platform/android/audio_driver_opensl.cpp
+++ b/platform/android/audio_driver_opensl.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/audio_driver_opensl.h b/platform/android/audio_driver_opensl.h
index 306589aa23..f6270a3084 100644
--- a/platform/android/audio_driver_opensl.h
+++ b/platform/android/audio_driver_opensl.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/build.gradle.template b/platform/android/build.gradle.template
index 24aab8e01f..1df56ce621 100644
--- a/platform/android/build.gradle.template
+++ b/platform/android/build.gradle.template
@@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.1.0'
+ classpath 'com.android.tools.build:gradle:2.3.3'
$$GRADLE_CLASSPATH$$
}
}
@@ -12,6 +12,7 @@ apply plugin: 'com.android.application'
allprojects {
repositories {
+ jcenter()
mavenCentral()
$$GRADLE_REPOSITORY_URLS$$
}
@@ -30,7 +31,7 @@ android {
}
compileSdkVersion 23
- buildToolsVersion "23.0.3"
+ buildToolsVersion "26.0.1"
useLibrary 'org.apache.http.legacy'
packagingOptions {
@@ -38,8 +39,6 @@ android {
exclude 'META-INF/NOTICE'
}
defaultConfig {
- minSdkVersion 14
- targetSdkVersion 23
$$GRADLE_DEFAULT_CONFIG$$
}
// Both signing and zip-aligning will be done at export time
@@ -57,7 +56,6 @@ android {
'res'
$$GRADLE_RES_DIRS$$
]
- // libs.srcDirs = ['libs']
aidl.srcDirs = [
'aidl'
$$GRADLE_AIDL_DIRS$$
@@ -66,9 +64,6 @@ android {
'assets'
$$GRADLE_ASSET_DIRS$$
]
- jniLibs.srcDirs = [
- $$GRADLE_JNI_DIRS$$
- ]
}
debug.jniLibs.srcDirs = [
'libs/debug'
diff --git a/platform/android/detect.py b/platform/android/detect.py
index d1b33fe649..ad5bfb4949 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -14,22 +14,17 @@ def get_name():
def can_build():
- import os
- if (not os.environ.has_key("ANDROID_NDK_ROOT")):
- return False
-
- return True
+ return (os.environ.has_key("ANDROID_NDK_ROOT"))
def get_opts():
return [
- ('ANDROID_NDK_ROOT', 'the path to Android NDK',
- os.environ.get("ANDROID_NDK_ROOT", 0)),
- ('ndk_platform', 'compile for platform: (android-<api> , example: android-18)', "android-18"),
- ('android_arch', 'select compiler architecture: (armv7/armv6/x86)', "armv7"),
- ('android_neon', 'enable neon (armv7 only)', "yes"),
- ('android_stl', 'enable STL support in android port (for modules)', "no")
+ ('ANDROID_NDK_ROOT', 'Path to the Android NDK', os.environ.get("ANDROID_NDK_ROOT", 0)),
+ ('ndk_platform', 'Target platform (android-<api>, e.g. "android-18")', "android-18"),
+ ('android_arch', 'Target architecture (armv7/armv6/arm64v8/x86)', "armv7"),
+ ('android_neon', 'Enable NEON support (armv7 only)', "yes"),
+ ('android_stl', 'Enable Android STL support (for modules)', "no")
]
@@ -41,6 +36,7 @@ def get_flags():
def create(env):
+
tools = env['TOOLS']
if "mingw" in tools:
tools.remove('mingw')
@@ -54,7 +50,6 @@ def configure(env):
# Workaround for MinGW. See:
# http://www.scons.org/wiki/LongCmdLinesOnWin32
- import os
if (os.name == "nt"):
import subprocess
@@ -92,36 +87,33 @@ def configure(env):
env['SPAWN'] = mySpawn
- ndk_platform = env['ndk_platform']
+ ## Architecture
- if env['android_arch'] not in ['armv7', 'armv6', 'x86']:
+ if env['android_arch'] not in ['armv7', 'armv6', 'arm64v8', 'x86']:
env['android_arch'] = 'armv7'
- if env['android_arch'] == 'x86':
- env["x86_libtheora_opt_gcc"] = True
-
- if env['PLATFORM'] == 'win32':
- env.Tool('gcc')
- env['SHLIBSUFFIX'] = '.so'
-
neon_text = ""
if env["android_arch"] == "armv7" and env['android_neon'] == 'yes':
- neon_text = " (with neon)"
- print("Godot Android!!!!! (" + env['android_arch'] + ")" + neon_text)
-
- env.Append(CPPPATH=['#platform/android'])
+ neon_text = " (with NEON)"
+ print("Building for Android (" + env['android_arch'] + ")" + neon_text)
+ can_vectorize = True
if env['android_arch'] == 'x86':
+ env['ARCH'] = 'arch-x86'
env.extra_suffix = ".x86" + env.extra_suffix
target_subpath = "x86-4.9"
abi_subpath = "i686-linux-android"
arch_subpath = "x86"
+ env["x86_libtheora_opt_gcc"] = True
elif env['android_arch'] == 'armv6':
+ env['ARCH'] = 'arch-arm'
env.extra_suffix = ".armv6" + env.extra_suffix
target_subpath = "arm-linux-androideabi-4.9"
abi_subpath = "arm-linux-androideabi"
arch_subpath = "armeabi"
+ can_vectorize = False
elif env["android_arch"] == "armv7":
+ env['ARCH'] = 'arch-arm'
target_subpath = "arm-linux-androideabi-4.9"
abi_subpath = "arm-linux-androideabi"
arch_subpath = "armeabi-v7a"
@@ -129,6 +121,34 @@ def configure(env):
env.extra_suffix = ".armv7.neon" + env.extra_suffix
else:
env.extra_suffix = ".armv7" + env.extra_suffix
+ elif env["android_arch"] == "arm64v8":
+ env['ARCH'] = 'arch-arm64'
+ target_subpath = "aarch64-linux-android-4.9"
+ abi_subpath = "aarch64-linux-android"
+ arch_subpath = "arm64-v8a"
+ env.extra_suffix = ".armv8" + env.extra_suffix
+
+ ## Build type
+
+ if (env["target"].startswith("release")):
+ env.Append(LINKFLAGS=['-O2'])
+ env.Append(CPPFLAGS=['-O2', '-DNDEBUG', '-ffast-math', '-funsafe-math-optimizations', '-fomit-frame-pointer'])
+ if (can_vectorize):
+ env.Append(CPPFLAGS=['-ftree-vectorize'])
+ if (env["target"] == "release_debug"):
+ env.Append(CPPFLAGS=['-DDEBUG_ENABLED'])
+ elif (env["target"] == "debug"):
+ env.Append(LINKFLAGS=['-O0'])
+ env.Append(CPPFLAGS=['-O0', '-D_DEBUG', '-UNDEBUG', '-DDEBUG_ENABLED',
+ '-DDEBUG_MEMORY_ENABLED', '-g', '-fno-limit-debug-info'])
+
+ ## Compiler configuration
+
+ env['SHLIBSUFFIX'] = '.so'
+
+ if env['PLATFORM'] == 'win32':
+ env.Tool('gcc')
+ env.use_windows_spawn_fix()
mt_link = True
if (sys.platform.startswith("linux")):
@@ -138,14 +158,14 @@ def configure(env):
elif (sys.platform.startswith('win')):
if (platform.machine().endswith('64')):
host_subpath = "windows-x86_64"
+ if env["android_arch"] == "arm64v8":
+ mt_link = False
else:
mt_link = False
host_subpath = "windows"
- compiler_path = env["ANDROID_NDK_ROOT"] + \
- "/toolchains/llvm/prebuilt/" + host_subpath + "/bin"
- gcc_toolchain_path = env["ANDROID_NDK_ROOT"] + \
- "/toolchains/" + target_subpath + "/prebuilt/" + host_subpath
+ compiler_path = env["ANDROID_NDK_ROOT"] + "/toolchains/llvm/prebuilt/" + host_subpath + "/bin"
+ gcc_toolchain_path = env["ANDROID_NDK_ROOT"] + "/toolchains/" + target_subpath + "/prebuilt/" + host_subpath
tools_path = gcc_toolchain_path + "/" + abi_subpath + "/bin"
# For Clang to find NDK tools in preference of those system-wide
@@ -157,60 +177,57 @@ def configure(env):
env['RANLIB'] = tools_path + "/ranlib"
env['AS'] = tools_path + "/as"
- if env['android_arch'] == 'x86':
- env['ARCH'] = 'arch-x86'
- else:
- env['ARCH'] = 'arch-arm'
-
- sysroot = env["ANDROID_NDK_ROOT"] + \
- "/platforms/" + ndk_platform + "/" + env['ARCH']
+ sysroot = env["ANDROID_NDK_ROOT"] + "/platforms/" + env['ndk_platform'] + "/" + env['ARCH']
common_opts = ['-fno-integrated-as', '-gcc-toolchain', gcc_toolchain_path]
+ ## Compile flags
+
env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include"])
- env.Append(CPPFLAGS=string.split(
- '-Wno-invalid-command-line-argument -Wno-unused-command-line-argument'))
- env.Append(CPPFLAGS=string.split(
- '-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing -Wa,--noexecstack'))
- env.Append(CPPFLAGS=string.split('-DANDROID -DNO_STATVFS -DGLES2_ENABLED'))
+ env.Append(CPPFLAGS=string.split('-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'))
+ env.Append(CPPFLAGS=string.split('-DNO_STATVFS -DGLES2_ENABLED'))
env['neon_enabled'] = False
if env['android_arch'] == 'x86':
- can_vectorize = True
target_opts = ['-target', 'i686-none-linux-android']
+ # The NDK adds this if targeting API < 21, so we can drop it when Godot targets it at least
+ env.Append(CPPFLAGS=['-mstackrealign'])
+
elif env["android_arch"] == "armv6":
- can_vectorize = False
target_opts = ['-target', 'armv6-none-linux-androideabi']
- env.Append(CPPFLAGS=string.split(
- '-D__ARM_ARCH_6__ -march=armv6 -mfpu=vfp -mfloat-abi=softfp'))
+ env.Append(CPPFLAGS=string.split('-D__ARM_ARCH_6__ -march=armv6 -mfpu=vfp -mfloat-abi=softfp'))
+
elif env["android_arch"] == "armv7":
- can_vectorize = True
target_opts = ['-target', 'armv7-none-linux-androideabi']
- env.Append(CPPFLAGS=string.split(
- '-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-abi=softfp'))
+ env.Append(CPPFLAGS=string.split('-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-abi=softfp'))
if env['android_neon'] == 'yes':
env['neon_enabled'] = True
env.Append(CPPFLAGS=['-mfpu=neon', '-D__ARM_NEON__'])
else:
env.Append(CPPFLAGS=['-mfpu=vfpv3-d16'])
+ elif env["android_arch"] == "arm64v8":
+ target_opts = ['-target', 'aarch64-none-linux-android']
+ env.Append(CPPFLAGS=['-D__ARM_ARCH_8A__'])
+ env.Append(CPPFLAGS=['-mfix-cortex-a53-835769'])
+
env.Append(CPPFLAGS=target_opts)
env.Append(CPPFLAGS=common_opts)
- env.Append(LIBS=['OpenSLES'])
- env.Append(LIBS=['EGL', 'OpenSLES', 'android'])
- env.Append(LIBS=['log', 'GLESv1_CM', 'GLESv2', 'GLESv3','z'])
-
- if (sys.platform.startswith("darwin")):
- env['SHLIBSUFFIX'] = '.so'
-
- env['LINKFLAGS'] = ['-shared', '--sysroot=' +
- sysroot, '-Wl,--warn-shared-textrel']
- env.Append(LINKFLAGS=string.split(
- '-Wl,--fix-cortex-a8'))
- env.Append(LINKFLAGS=string.split(
- '-Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now'))
- env.Append(LINKFLAGS=string.split(
- '-Wl,-soname,libgodot_android.so -Wl,--gc-sections'))
+ if (env['android_stl'] == 'yes'):
+ env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/include"])
+ env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/" + arch_subpath + "/include"])
+ env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/" + arch_subpath])
+ env.Append(LIBS=["gnustl_static"])
+ else:
+ env.Append(CXXFLAGS=['-fno-rtti', '-fno-exceptions', '-DNO_SAFE_CAST'])
+
+ ## Link flags
+
+ env['LINKFLAGS'] = ['-shared', '--sysroot=' + sysroot, '-Wl,--warn-shared-textrel']
+ if env["android_arch"] == "armv7":
+ env.Append(LINKFLAGS=string.split('-Wl,--fix-cortex-a8'))
+ env.Append(LINKFLAGS=string.split('-Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now'))
+ env.Append(LINKFLAGS=string.split('-Wl,-soname,libgodot_android.so -Wl,--gc-sections'))
if mt_link:
env.Append(LINKFLAGS=['-Wl,--threads'])
env.Append(LINKFLAGS=target_opts)
@@ -221,45 +238,12 @@ def configure(env):
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] +
'/toolchains/arm-linux-androideabi-4.9/prebuilt/' + host_subpath + '/' + abi_subpath + '/lib'])
- if (env["target"].startswith("release")):
- env.Append(LINKFLAGS=['-O2'])
- env.Append(CPPFLAGS=['-O2', '-DNDEBUG', '-ffast-math',
- '-funsafe-math-optimizations', '-fomit-frame-pointer'])
- if (can_vectorize):
- env.Append(CPPFLAGS=['-ftree-vectorize'])
- if (env["target"] == "release_debug"):
- env.Append(CPPFLAGS=['-DDEBUG_ENABLED'])
- elif (env["target"] == "debug"):
- env.Append(LINKFLAGS=['-O0'])
- env.Append(CPPFLAGS=['-O0', '-D_DEBUG', '-UNDEBUG', '-DDEBUG_ENABLED',
- '-DDEBUG_MEMORY_ALLOC', '-g', '-fno-limit-debug-info'])
-
- env.Append(CPPFLAGS=['-DANDROID_ENABLED',
- '-DUNIX_ENABLED', '-DNO_FCNTL', '-DMPC_FIXED_POINT'])
+ env.Append(CPPPATH=['#platform/android'])
+ env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL', '-DMPC_FIXED_POINT'])
+ env.Append(LIBS=['OpenSLES', 'EGL', 'GLESv3', 'android', 'log', 'z'])
# TODO: Move that to opus module's config
if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"):
if (env["android_arch"] == "armv6" or env["android_arch"] == "armv7"):
env.Append(CFLAGS=["-DOPUS_ARM_OPT"])
env.opus_fixed_point = "yes"
-
- if (env['android_stl'] == 'yes'):
- env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] +
- "/sources/cxx-stl/gnu-libstdc++/4.9/include"])
- env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] +
- "/sources/cxx-stl/gnu-libstdc++/4.9/libs/" + arch_subpath + "/include"])
- env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] +
- "/sources/cxx-stl/gnu-libstdc++/4.9/libs/" + arch_subpath])
- env.Append(LIBS=["gnustl_static"])
- else:
- env.Append(CXXFLAGS=['-fno-rtti', '-fno-exceptions', '-DNO_SAFE_CAST'])
-
- import methods
- env.Append(BUILDERS={'GLSL120': env.Builder(
- action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'GLSL': env.Builder(
- action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'GLSL120GLES': env.Builder(
- action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')})
-
- env.use_windows_spawn_fix()
diff --git a/platform/android/dir_access_android.cpp b/platform/android/dir_access_android.cpp
index 989bd02bd9..67aa7750cd 100644
--- a/platform/android/dir_access_android.cpp
+++ b/platform/android/dir_access_android.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/dir_access_android.h b/platform/android/dir_access_android.h
index 640800584a..32986f524b 100644
--- a/platform/android/dir_access_android.h
+++ b/platform/android/dir_access_android.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/dir_access_jandroid.cpp b/platform/android/dir_access_jandroid.cpp
index 68446302ff..34f4afa331 100644
--- a/platform/android/dir_access_jandroid.cpp
+++ b/platform/android/dir_access_jandroid.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/dir_access_jandroid.h b/platform/android/dir_access_jandroid.h
index 096858ddf7..21d1f697b7 100644
--- a/platform/android/dir_access_jandroid.h
+++ b/platform/android/dir_access_jandroid.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -78,7 +79,7 @@ public:
//virtual FileType get_file_type() const;
size_t get_space_left();
- static void setup(jobject io);
+ static void setup(jobject p_io);
DirAccessJAndroid();
~DirAccessJAndroid();
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 2342829965..3c52834d92 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,12 +31,13 @@
#include "editor/editor_export.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
-#include "global_config.h"
#include "io/marshalls.h"
#include "io/zip_io.h"
#include "os/file_access.h"
#include "os/os.h"
-#include "platform/android/logo.h"
+#include "platform/android/logo.gen.h"
+#include "platform/android/run_icon.gen.h"
+#include "project_settings.h"
#include "version.h"
#include <string.h>
#if 0
@@ -217,6 +219,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
bool use_32_fb;
bool immersive;
bool export_arm;
+ bool export_arm64;
bool export_x86;
String apk_expansion_salt;
String apk_expansion_pkey;
@@ -317,6 +320,8 @@ bool EditorExportPlatformAndroid::_set(const StringName& p_name, const Variant&
_signed=p_value;
else if (n=="architecture/arm")
export_arm=p_value;
+ else if (n=="architecture/arm64")
+ export_arm64=p_value;
else if (n=="architecture/x86")
export_x86=p_value;
else if (n=="screen/use_32_bits_view")
@@ -390,6 +395,8 @@ bool EditorExportPlatformAndroid::_get(const StringName& p_name,Variant &r_ret)
r_ret=_signed;
else if (n=="architecture/arm")
r_ret=export_arm;
+ else if (n=="architecture/arm64")
+ r_ret=export_arm64;
else if (n=="architecture/x86")
r_ret=export_x86;
else if (n=="screen/use_32_bits_view")
@@ -552,9 +559,9 @@ void EditorExportPlatformAndroid::_fix_resources(Vector<uint8_t>& p_manifest) {
} else {
String lang = str.substr(str.find_last("-")+1,str.length()).replace("-","_");
- String prop = "application/name_"+lang;
- if (GlobalConfig::get_singleton()->has(prop)) {
- str = GlobalConfig::get_singleton()->get(prop);
+ String prop = "application/config/name_"+lang;
+ if (ProjectSettings::get_singleton()->has(prop)) {
+ str = ProjectSettings::get_singleton()->get(prop);
} else {
str = get_project_name();
}
@@ -626,7 +633,7 @@ String EditorExportPlatformAndroid::get_project_name() const {
if (this->name!="") {
aname=this->name;
} else {
- aname = GlobalConfig::get_singleton()->get("application/name");
+ aname = ProjectSettings::get_singleton()->get("application/config/name");
}
@@ -1142,7 +1149,7 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
if (!found) {
- String appicon = GlobalConfig::get_singleton()->get("application/icon");
+ String appicon = ProjectSettings::get_singleton()->get("application/config/icon");
if (appicon!="" && appicon.ends_with(".png")) {
FileAccess*f = FileAccess::open(appicon,FileAccess::READ);
if (f) {
@@ -1162,6 +1169,10 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
skip=true;
}
+ if (file.match("lib/arm64*/libgodot_android.so") && !export_arm64) {
+ skip = true;
+ }
+
if (file.begins_with("META-INF") && _signed) {
skip=true;
}
@@ -1713,7 +1724,7 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) {
args.push_back("--remove-all");
err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv);
- int port = GlobalConfig::get_singleton()->get("network/debug/remote_port");
+ int port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
args.clear();
args.push_back("reverse");
args.push_back("tcp:"+itos(port));
@@ -1761,7 +1772,7 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) {
String EditorExportPlatformAndroid::get_package_name() {
String pname = package;
- String basename = GlobalConfig::get_singleton()->get("application/name");
+ String basename = ProjectSettings::get_singleton()->get("application/config/name");
basename=basename.to_lower();
String name;
@@ -1799,6 +1810,7 @@ EditorExportPlatformAndroid::EditorExportPlatformAndroid() {
immersive=true;
export_arm=true;
+ export_arm64=false;
export_x86=false;
@@ -2041,12 +2053,14 @@ class EditorExportAndroid : public EditorExportPlatform {
GDCLASS(EditorExportAndroid, EditorExportPlatform)
Ref<ImageTexture> logo;
+ Ref<ImageTexture> run_icon;
struct Device {
String id;
String name;
String description;
+ int release;
};
struct APKExportData {
@@ -2120,6 +2134,7 @@ class EditorExportAndroid : public EditorExportPlatform {
if (ea->devices[j].id == ldevices[i]) {
d.description = ea->devices[j].description;
d.name = ea->devices[j].name;
+ d.release = ea->devices[j].release;
}
}
@@ -2140,6 +2155,7 @@ class EditorExportAndroid : public EditorExportPlatform {
String vendor;
String device;
d.description + "Device ID: " + d.id + "\n";
+ d.release = 0;
for (int j = 0; j < props.size(); j++) {
String p = props[j];
@@ -2150,7 +2166,9 @@ class EditorExportAndroid : public EditorExportPlatform {
} else if (p.begins_with("ro.build.display.id=")) {
d.description += "Build: " + p.get_slice("=", 1).strip_edges() + "\n";
} else if (p.begins_with("ro.build.version.release=")) {
- d.description += "Release: " + p.get_slice("=", 1).strip_edges() + "\n";
+ const String release_str = p.get_slice("=", 1).strip_edges();
+ d.description += "Release: " + release_str + "\n";
+ d.release = release_str.to_int();
} else if (p.begins_with("ro.product.cpu.abi=")) {
d.description += "CPU: " + p.get_slice("=", 1).strip_edges() + "\n";
} else if (p.begins_with("ro.product.manufacturer=")) {
@@ -2205,7 +2223,7 @@ class EditorExportAndroid : public EditorExportPlatform {
if (p_name != "") {
aname = p_name;
} else {
- aname = GlobalConfig::get_singleton()->get("application/name");
+ aname = ProjectSettings::get_singleton()->get("application/config/name");
}
if (aname == "") {
@@ -2218,7 +2236,7 @@ class EditorExportAndroid : public EditorExportPlatform {
String get_package_name(const String &p_package) {
String pname = p_package;
- String basename = GlobalConfig::get_singleton()->get("application/name");
+ String basename = ProjectSettings::get_singleton()->get("application/config/name");
basename = basename.to_lower();
String name;
@@ -2534,6 +2552,10 @@ class EditorExportAndroid : public EditorExportPlatform {
}*/
}
+ if (tname == "uses-feature" && /*nspace=="android" &&*/ attrname == "glEsVersion") {
+ print_line("version number: " + itos(decode_uint32(&p_manifest[iofs + 16])));
+ }
+
if (tname == "uses-permission" && /*nspace=="android" &&*/ attrname == "name") {
if (value.begins_with("godot.custom")) {
@@ -2747,9 +2769,9 @@ class EditorExportAndroid : public EditorExportPlatform {
} else {
String lang = str.substr(str.find_last("-") + 1, str.length()).replace("-", "_");
- String prop = "application/name_" + lang;
- if (GlobalConfig::get_singleton()->has(prop)) {
- str = GlobalConfig::get_singleton()->get(prop);
+ String prop = "application/config/name_" + lang;
+ if (ProjectSettings::get_singleton()->has(prop)) {
+ str = ProjectSettings::get_singleton()->get(prop);
} else {
str = get_project_name(package_name);
}
@@ -2823,11 +2845,17 @@ public:
public:
virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) {
- r_features->push_back("etc");
+ int api = p_preset->get("graphics/api");
+ if (api == 0)
+ r_features->push_back("etc");
+ else
+ r_features->push_back("etc2");
}
virtual void get_export_options(List<ExportOption> *r_options) {
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "graphics/api", PROPERTY_HINT_ENUM, "OpenGL ES 2.0,OpenGL ES 3.0"), 1));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "graphics/32_bits_framebuffer"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "one_click_deploy/clear_previous_install"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE, "apk"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/release", PROPERTY_HINT_GLOBAL_FILE, "apk"), ""));
@@ -2840,7 +2868,6 @@ public:
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/signed"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "architecture/arm"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "architecture/x86"), false));
- r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/use_32_bits_view"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/immersive_mode"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "screen/orientation", PROPERTY_HINT_ENUM, "Landscape,Portrait"), 0));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_small"), true));
@@ -2872,6 +2899,11 @@ public:
virtual String get_name() const {
return "Android";
}
+
+ virtual String get_os_name() const {
+ return "Android";
+ }
+
virtual Ref<Texture> get_logo() const {
return logo;
}
@@ -2988,15 +3020,19 @@ public:
if (use_adb_over_usb) {
args.clear();
+ args.push_back("-s");
+ args.push_back(devices[p_device].id);
args.push_back("reverse");
args.push_back("--remove-all");
err = OS::get_singleton()->execute(adb, args, true, NULL, NULL, &rv);
- int port = GlobalConfig::get_singleton()->get("network/debug/remote_port");
+ int dbg_port = EditorSettings::get_singleton()->get("network/debug/remote_port");
args.clear();
+ args.push_back("-s");
+ args.push_back(devices[p_device].id);
args.push_back("reverse");
- args.push_back("tcp:" + itos(port));
- args.push_back("tcp:" + itos(port));
+ args.push_back("tcp:" + itos(dbg_port));
+ args.push_back("tcp:" + itos(dbg_port));
err = OS::get_singleton()->execute(adb, args, true, NULL, NULL, &rv);
print_line("Reverse result: " + itos(rv));
@@ -3004,6 +3040,8 @@ public:
int fs_port = EditorSettings::get_singleton()->get("filesystem/file_server/port");
args.clear();
+ args.push_back("-s");
+ args.push_back(devices[p_device].id);
args.push_back("reverse");
args.push_back("tcp:" + itos(fs_port));
args.push_back("tcp:" + itos(fs_port));
@@ -3019,7 +3057,10 @@ public:
args.push_back("shell");
args.push_back("am");
args.push_back("start");
- args.push_back("--user 0");
+ if ((bool)EditorSettings::get_singleton()->get("export/android/force_system_user") && devices[p_device].release >= 17) { // Multi-user introduced in Android 17
+ args.push_back("--user");
+ args.push_back("0");
+ }
args.push_back("-a");
args.push_back("android.intent.action.MAIN");
args.push_back("-n");
@@ -3027,7 +3068,7 @@ public:
err = OS::get_singleton()->execute(adb, args, true, NULL, NULL, &rv);
if (err || rv != 0) {
- EditorNode::add_io_error("Could not execute ondevice.");
+ EditorNode::add_io_error("Could not execute on device.");
device_lock->unlock();
return ERR_CANT_CREATE;
}
@@ -3035,6 +3076,10 @@ public:
return OK;
}
+ virtual Ref<Texture> get_run_icon() const {
+ return run_icon;
+ }
+
virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
r_missing_templates = find_export_template("android_debug.apk") == String() || find_export_template("android_release.apk") == String();
@@ -3141,6 +3186,7 @@ public:
bool export_x86 = p_preset->get("architecture/x86");
bool export_arm = p_preset->get("architecture/arm");
+ bool export_arm64 = p_preset->get("architecture/arm64");
bool use_32_fb = p_preset->get("screen/use_32_bits_view");
bool immersive = p_preset->get("screen/immersive_mode");
@@ -3212,7 +3258,7 @@ public:
if (!found) {
- String appicon = GlobalConfig::get_singleton()->get("application/icon");
+ String appicon = ProjectSettings::get_singleton()->get("application/config/icon");
if (appicon != "" && appicon.ends_with(".png")) {
FileAccess *f = FileAccess::open(appicon, FileAccess::READ);
if (f) {
@@ -3232,6 +3278,10 @@ public:
skip = true;
}
+ if (file.match("lib/arm64*/libgodot_android.so") && !export_arm64) {
+ skip = true;
+ }
+
if (file.begins_with("META-INF") && _signed) {
skip = true;
}
@@ -3520,17 +3570,34 @@ public:
return OK;
}
+ virtual void get_platform_features(List<String> *r_features) {
+
+ r_features->push_back("mobile");
+ r_features->push_back("Android");
+ }
+
EditorExportAndroid() {
- Image img(_android_logo);
- logo = Ref<ImageTexture>(memnew(ImageTexture));
+ Ref<Image> img = memnew(Image(_android_logo));
+ logo.instance();
logo->create_from_image(img);
+ img = Ref<Image>(memnew(Image(_android_run_icon)));
+ run_icon.instance();
+ run_icon->create_from_image(img);
+
device_lock = Mutex::create();
device_thread = Thread::create(_device_poll_thread, this);
devices_changed = true;
quit_request = false;
}
+
+ ~EditorExportAndroid() {
+ quit_request = true;
+ Thread::wait_to_finish(device_thread);
+ memdelete(device_lock);
+ memdelete(device_thread);
+ }
};
void register_android_exporter() {
@@ -3548,6 +3615,7 @@ void register_android_exporter() {
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/android/debug_keystore", PROPERTY_HINT_GLOBAL_FILE, "keystore"));
EDITOR_DEF("export/android/debug_keystore_user", "androiddebugkey");
EDITOR_DEF("export/android/debug_keystore_pass", "android");
+ EDITOR_DEF("export/android/force_system_user", false);
EDITOR_DEF("export/android/timestamping_authority_url", "");
EDITOR_DEF("export/android/use_remote_debug_over_adb", false);
diff --git a/platform/android/export/export.h b/platform/android/export/export.h
index 468b484177..e3b0b4aab6 100644
--- a/platform/android/export/export.h
+++ b/platform/android/export/export.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/file_access_android.cpp b/platform/android/file_access_android.cpp
index 4426af4dad..be19f056b0 100644
--- a/platform/android/file_access_android.cpp
+++ b/platform/android/file_access_android.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/file_access_android.h b/platform/android/file_access_android.h
index de131f19bc..0ee8cd7efe 100644
--- a/platform/android/file_access_android.h
+++ b/platform/android/file_access_android.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/file_access_jandroid.cpp b/platform/android/file_access_jandroid.cpp
index b3624e9f26..e20ffd4f8a 100644
--- a/platform/android/file_access_jandroid.cpp
+++ b/platform/android/file_access_jandroid.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/file_access_jandroid.h b/platform/android/file_access_jandroid.h
index b78d5e603c..a04f28d0d7 100644
--- a/platform/android/file_access_jandroid.h
+++ b/platform/android/file_access_jandroid.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -70,7 +71,7 @@ public:
virtual bool file_exists(const String &p_path); ///< return true if a file exists
- static void setup(jobject io);
+ static void setup(jobject p_io);
virtual uint64_t _get_modified_time(const String &p_file) { return 0; }
diff --git a/platform/android/globals/global_defaults.cpp b/platform/android/globals/global_defaults.cpp
index 60d7d8cb6b..6bdc6b337c 100644
--- a/platform/android/globals/global_defaults.cpp
+++ b/platform/android/globals/global_defaults.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "global_defaults.h"
-#include "global_config.h"
+#include "project_settings.h"
void register_android_global_defaults() {
@@ -36,6 +37,6 @@ void register_android_global_defaults() {
GLOBAL_DEF("display.Android/driver","GLES2");
//GLOBAL_DEF("rasterizer.Android/trilinear_mipmap_filter",false);
- GlobalConfig::get_singleton()->set_custom_property_info("display.Android/driver",PropertyInfo(Variant::STRING,"display.Android/driver",PROPERTY_HINT_ENUM,"GLES2"));
+ ProjectSettings::get_singleton()->set_custom_property_info("display.Android/driver",PropertyInfo(Variant::STRING,"display.Android/driver",PROPERTY_HINT_ENUM,"GLES2"));
*/
}
diff --git a/platform/android/globals/global_defaults.h b/platform/android/globals/global_defaults.h
index 49d7f6393c..d524b56af6 100644
--- a/platform/android/globals/global_defaults.h
+++ b/platform/android/globals/global_defaults.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp
index 9d300940b0..6fbd42d7b3 100644
--- a/platform/android/godot_android.cpp
+++ b/platform/android/godot_android.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,9 +36,9 @@
#include <GLES2/gl2.h>
#include "file_access_android.h"
-#include "global_config.h"
#include "main/main.h"
#include "os_android.h"
+#include "project_settings.h"
#include <android/log.h>
#include <android/sensor.h>
#include <android/window.h>
@@ -622,7 +623,7 @@ static void engine_handle_cmd(struct android_app *app, int32_t cmd) {
#else
Error err = Main::setup("apk", 0, NULL);
- String modules = GlobalConfig::get_singleton()->get("android/modules");
+ String modules = ProjectSettings::get_singleton()->get("android/modules");
Vector<String> mods = modules.split(",", false);
mods.push_back("GodotOS");
__android_log_print(ANDROID_LOG_INFO, "godot", "mod count: %i", mods.size());
@@ -738,21 +739,21 @@ static void engine_handle_cmd(struct android_app *app, int32_t cmd) {
}
}
-void android_main(struct android_app *state) {
+void android_main(struct android_app *app) {
struct engine engine;
// Make sure glue isn't stripped.
app_dummy();
memset(&engine, 0, sizeof(engine));
- state->userData = &engine;
- state->onAppCmd = engine_handle_cmd;
- state->onInputEvent = engine_handle_input;
- engine.app = state;
+ app->userData = &engine;
+ app->onAppCmd = engine_handle_cmd;
+ app->onInputEvent = engine_handle_input;
+ engine.app = app;
engine.requested_quit = false;
engine.os = NULL;
engine.display_active = false;
- FileAccessAndroid::asset_manager = state->activity->assetManager;
+ FileAccessAndroid::asset_manager = app->activity->assetManager;
// Prepare to monitor sensors
engine.sensorManager = ASensorManager_getInstance();
@@ -763,11 +764,11 @@ void android_main(struct android_app *state) {
engine.gyroscopeSensor = ASensorManager_getDefaultSensor(engine.sensorManager,
ASENSOR_TYPE_GYROSCOPE);
engine.sensorEventQueue = ASensorManager_createEventQueue(engine.sensorManager,
- state->looper, LOOPER_ID_USER, NULL, NULL);
+ app->looper, LOOPER_ID_USER, NULL, NULL);
- ANativeActivity_setWindowFlags(state->activity, AWINDOW_FLAG_FULLSCREEN | AWINDOW_FLAG_KEEP_SCREEN_ON, 0);
+ ANativeActivity_setWindowFlags(app->activity, AWINDOW_FLAG_FULLSCREEN | AWINDOW_FLAG_KEEP_SCREEN_ON, 0);
- state->activity->vm->AttachCurrentThread(&engine.jni, NULL);
+ app->activity->vm->AttachCurrentThread(&engine.jni, NULL);
// loop waiting for stuff to do.
@@ -789,7 +790,7 @@ void android_main(struct android_app *state) {
if (source != NULL) {
// LOGI("process\n");
- source->process(state, source);
+ source->process(app, source);
} else {
nullmax--;
if (nullmax < 0)
@@ -823,11 +824,11 @@ void android_main(struct android_app *state) {
}
// Check if we are exiting.
- if (state->destroyRequested != 0) {
+ if (app->destroyRequested != 0) {
if (engine.os) {
engine.os->main_loop_request_quit();
}
- state->destroyRequested = 0;
+ app->destroyRequested = 0;
}
if (engine.requested_quit) {
@@ -858,7 +859,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerSingleton(JNIEnv
s->set_instance(env->NewGlobalRef(p_object));
jni_singletons[singname] = s;
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton(singname, s));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton(singname, s));
}
static Variant::Type get_jni_type(const String &p_type) {
@@ -925,7 +926,7 @@ JNIEXPORT jstring JNICALL Java_org_godotengine_godot_Godot_getGlobal(JNIEnv *env
String js = env->GetStringUTFChars(path, NULL);
- return env->NewStringUTF(GlobalConfig::get_singleton()->get(js).operator String().utf8().get_data());
+ return env->NewStringUTF(ProjectSettings::get_singleton()->get(js).operator String().utf8().get_data());
}
JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerMethod(JNIEnv *env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args) {
diff --git a/platform/android/java/gradle.properties b/platform/android/java/gradle.properties
new file mode 100644
index 0000000000..aac7c9b461
--- /dev/null
+++ b/platform/android/java/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/platform/android/java/gradle/wrapper/gradle-wrapper.jar b/platform/android/java/gradle/wrapper/gradle-wrapper.jar
index 8c0fb64a86..13372aef5e 100644
--- a/platform/android/java/gradle/wrapper/gradle-wrapper.jar
+++ b/platform/android/java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/platform/android/java/gradle/wrapper/gradle-wrapper.properties b/platform/android/java/gradle/wrapper/gradle-wrapper.properties
index d57051703e..ee6901c9d7 100644
--- a/platform/android/java/gradle/wrapper/gradle-wrapper.properties
+++ b/platform/android/java/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Wed Apr 10 15:27:10 PDT 2013
+#Sat Jul 29 16:10:03 ICT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
diff --git a/platform/android/java/gradlew b/platform/android/java/gradlew
index 91a7e269e1..9d82f78915 100755
--- a/platform/android/java/gradlew
+++ b/platform/android/java/gradlew
@@ -42,11 +42,6 @@ case "`uname`" in
;;
esac
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@@ -61,9 +56,9 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
+cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
+cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -114,6 +109,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
diff --git a/platform/android/java/res/drawable/icon.png b/platform/android/java/res/drawable/icon.png
index a0a0f4af25..29c4a7b8fc 100644
--- a/platform/android/java/res/drawable/icon.png
+++ b/platform/android/java/res/drawable/icon.png
Binary files differ
diff --git a/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.java b/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.java
index d90d6eac7b..63720999a7 100644
--- a/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.java
+++ b/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.java
@@ -1,4 +1,20 @@
/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+/*
* This file is auto-generated. DO NOT MODIFY.
* Original file: aidl/ILicenseResultListener.aidl
*/
diff --git a/platform/android/java/src/com/android/vending/licensing/ILicensingService.java b/platform/android/java/src/com/android/vending/licensing/ILicensingService.java
index 95599544e4..36afc0537d 100644
--- a/platform/android/java/src/com/android/vending/licensing/ILicensingService.java
+++ b/platform/android/java/src/com/android/vending/licensing/ILicensingService.java
@@ -1,4 +1,20 @@
/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+/*
* This file is auto-generated. DO NOT MODIFY.
* Original file: aidl/ILicensingService.aidl
*/
diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java
index ae3fe957cb..fb56f917be 100644
--- a/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java
@@ -221,7 +221,11 @@ public class Helpers {
static public String getSaveFilePath(Context c) {
File root = Environment.getExternalStorageDirectory();
- String path = Build.VERSION.SDK_INT >= 23 ? Constants.EXP_PATH_API23 : Constants.EXP_PATH;
+ // this makes several issues with Android SDK >= 23 devices.
+ // https://github.com/danikula/Google-Play-Expansion-File/commit/93a03bd34acad67c6ea34cfb6c3f02c93bdcea85
+ // https://issuetracker.google.com/issues/37075181
+ //String path = Build.VERSION.SDK_INT >= 23 ? Constants.EXP_PATH_API23 : Constants.EXP_PATH;
+ String path = Constants.EXP_PATH;
return root.toString() + path + c.getPackageName();
}
diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java
index 627bf3eedd..e83faa2756 100644
--- a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java
@@ -569,10 +569,10 @@ public abstract class DownloaderService extends CustomIntentService implements I
*/
void pollNetworkState() {
if (null == mConnectivityManager) {
- mConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
+ mConnectivityManager = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
}
if (null == mWifiManager) {
- mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
+ mWifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
}
if (mConnectivityManager == null) {
Log.w(Constants.TAG,
diff --git a/platform/android/java/src/org/godotengine/godot/Dictionary.java b/platform/android/java/src/org/godotengine/godot/Dictionary.java
index 72f0b7a60e..b9501e0858 100644
--- a/platform/android/java/src/org/godotengine/godot/Dictionary.java
+++ b/platform/android/java/src/org/godotengine/godot/Dictionary.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java
index 0cec0c5773..d620b2b9c4 100644
--- a/platform/android/java/src/org/godotengine/godot/Godot.java
+++ b/platform/android/java/src/org/godotengine/godot/Godot.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -272,7 +273,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
mView = new GodotView(getApplication(),io,use_gl2,use_32_bits, this);
layout.addView(mView,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
- setKeepScreenOn(GodotLib.getGlobal("display/keep_screen_on").equals("True"));
+ setKeepScreenOn(GodotLib.getGlobal("display/driver/keep_screen_on").equals("True"));
edittext.setView(mView);
io.setEdit(edittext);
diff --git a/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java b/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java
index 5a07d680b3..6cdc6be793 100644
--- a/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java b/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java
index fba082e80d..38d30c108c 100644
--- a/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/GodotIO.java b/platform/android/java/src/org/godotengine/godot/GodotIO.java
index d6ceef8768..ecb623452c 100644
--- a/platform/android/java/src/org/godotengine/godot/GodotIO.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotIO.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/GodotLib.java b/platform/android/java/src/org/godotengine/godot/GodotLib.java
index 57856cfd6b..1ed04d9d27 100644
--- a/platform/android/java/src/org/godotengine/godot/GodotLib.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotLib.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java b/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java
index 6eee8da91b..3cb8fd3da8 100644
--- a/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java
index a209bc7f5b..c6c68c36b0 100644
--- a/platform/android/java/src/org/godotengine/godot/GodotView.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotView.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java b/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java
index f0dae03a81..bf5239aa77 100644
--- a/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java
+++ b/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java b/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java
index 3c8207fae1..1dbcb78ada 100644
--- a/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java
+++ b/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java b/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java
index 67293df2a8..c37821ffd9 100644
--- a/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java b/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java
index dfa363ed75..72126a8f64 100644
--- a/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java b/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java
index 3850453a77..e223bbb8c0 100644
--- a/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java b/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java
index 4678dae1b3..fa5564a3f4 100644
--- a/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java
index 73d1cc3bc8..6f308af360 100644
--- a/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -354,36 +355,35 @@ public class PaymentsManager {
tempList.add(s);
}
packs.add(tempList);
-
- for (ArrayList<String> skuPartList : packs) {
- Bundle querySkus = new Bundle();
- querySkus.putStringArrayList("ITEM_ID_LIST", skuPartList);
- Bundle skuDetails = null;
- try {
- skuDetails = mService.getSkuDetails(3, activity.getPackageName(), "inapp", querySkus);
- if (!skuDetails.containsKey("DETAILS_LIST")) {
- int response = getResponseCodeFromBundle(skuDetails);
- if (response != BILLING_RESPONSE_RESULT_OK) {
- godotPaymentV3.errorSkuDetail(getResponseDesc(response));
- } else {
- godotPaymentV3.errorSkuDetail("No error but no detail list.");
- }
- return;
+ }
+ for (ArrayList<String> skuPartList : packs) {
+ Bundle querySkus = new Bundle();
+ querySkus.putStringArrayList("ITEM_ID_LIST", skuPartList);
+ Bundle skuDetails = null;
+ try {
+ skuDetails = mService.getSkuDetails(3, activity.getPackageName(), "inapp", querySkus);
+ if (!skuDetails.containsKey("DETAILS_LIST")) {
+ int response = getResponseCodeFromBundle(skuDetails);
+ if (response != BILLING_RESPONSE_RESULT_OK) {
+ godotPaymentV3.errorSkuDetail(getResponseDesc(response));
+ } else {
+ godotPaymentV3.errorSkuDetail("No error but no detail list.");
}
+ return;
+ }
- ArrayList<String> responseList = skuDetails.getStringArrayList("DETAILS_LIST");
+ ArrayList<String> responseList = skuDetails.getStringArrayList("DETAILS_LIST");
- for (String thisResponse : responseList) {
- Log.d("godot", "response = "+thisResponse);
- godotPaymentV3.addSkuDetail(thisResponse);
- }
- } catch (RemoteException e) {
- e.printStackTrace();
- godotPaymentV3.errorSkuDetail("RemoteException error!");
+ for (String thisResponse : responseList) {
+ Log.d("godot", "response = "+thisResponse);
+ godotPaymentV3.addSkuDetail(thisResponse);
}
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ godotPaymentV3.errorSkuDetail("RemoteException error!");
}
- godotPaymentV3.completeSkuDetail();
}
+ godotPaymentV3.completeSkuDetail();
}
})).start();
}
diff --git a/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java b/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java
index 5ad96b35ee..81352b0cf4 100644
--- a/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java b/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java
index 60a43a9070..9d40371b9b 100644
--- a/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java b/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java
index f09bcbf9a4..09f80df403 100644
--- a/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/utils/Crypt.java b/platform/android/java/src/org/godotengine/godot/utils/Crypt.java
index f8936bef2b..02a2fba854 100644
--- a/platform/android/java/src/org/godotengine/godot/utils/Crypt.java
+++ b/platform/android/java/src/org/godotengine/godot/utils/Crypt.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java b/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java
index 823c75d186..7881754fb2 100644
--- a/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java
+++ b/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java b/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java
index faefbbd2c6..b314fb721b 100644
--- a/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java
+++ b/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java b/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java
index bb00f1f468..41d26ba70f 100644
--- a/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java
+++ b/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java_class_wrapper.cpp b/platform/android/java_class_wrapper.cpp
index eb208f0ee0..bd266c76bf 100644
--- a/platform/android/java_class_wrapper.cpp
+++ b/platform/android/java_class_wrapper.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -189,7 +190,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method,
argv[i].i = *p_args[i];
} break;
case ARG_TYPE_LONG: {
- argv[i].j = *p_args[i];
+ argv[i].j = (int64_t)*p_args[i];
} break;
case ARG_TYPE_FLOAT: {
argv[i].f = *p_args[i];
@@ -349,7 +350,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method,
Array arr = *p_args[i];
jlongArray a = env->NewLongArray(arr.size());
for (int j = 0; j < arr.size(); j++) {
- jlong val = arr[j];
+ jlong val = (int64_t)arr[j];
env->SetLongArrayRegion(a, j, 1, &val);
}
argv[i].l = a;
@@ -459,9 +460,9 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method,
case ARG_TYPE_LONG: {
if (method->_static) {
- ret = env->CallStaticLongMethodA(_class, method->method, argv);
+ ret = (int64_t)env->CallStaticLongMethodA(_class, method->method, argv);
} else {
- ret = env->CallLongMethodA(p_instance->instance, method->method, argv);
+ ret = (int64_t)env->CallLongMethodA(p_instance->instance, method->method, argv);
}
} break;
@@ -545,7 +546,7 @@ JavaObject::~JavaObject() {
void JavaClassWrapper::_bind_methods() {
- ClassDB::bind_method(D_METHOD("wrap:JavaClass", "name"), &JavaClassWrapper::wrap);
+ ClassDB::bind_method(D_METHOD("wrap", "name"), &JavaClassWrapper::wrap);
}
bool JavaClassWrapper::_get_type_sig(JNIEnv *env, jobject obj, uint32_t &sig, String &strsig) {
@@ -679,7 +680,7 @@ bool JavaClass::_convert_object_to_variant(JNIEnv *env, jobject obj, Variant &va
} break;
case ARG_TYPE_LONG | ARG_NUMBER_CLASS_BIT: {
- var = env->CallLongMethod(obj, JavaClassWrapper::singleton->Long_longValue);
+ var = (int64_t)env->CallLongMethod(obj, JavaClassWrapper::singleton->Long_longValue);
return true;
} break;
@@ -801,7 +802,7 @@ bool JavaClass::_convert_object_to_variant(JNIEnv *env, jobject obj, Variant &va
jlong val;
env->GetLongArrayRegion((jlongArray)arr, 0, 1, &val);
- ret.push_back(val);
+ ret.push_back((int64_t)val);
}
var = ret;
diff --git a/platform/android/java_class_wrapper.h b/platform/android/java_class_wrapper.h
index 12ef92c45b..f990708bdf 100644
--- a/platform/android/java_class_wrapper.h
+++ b/platform/android/java_class_wrapper.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp
index 06ef581813..683e1cfb22 100644
--- a/platform/android/java_glue.cpp
+++ b/platform/android/java_glue.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,11 +36,11 @@
#include "dir_access_jandroid.h"
#include "file_access_android.h"
#include "file_access_jandroid.h"
-#include "global_config.h"
#include "java_class_wrapper.h"
#include "main/input_default.h"
#include "main/main.h"
#include "os_android.h"
+#include "project_settings.h"
#include "thread_jandroid.h"
#include <unistd.h>
@@ -609,7 +610,7 @@ struct JAndroidPointerEvent {
};
static List<JAndroidPointerEvent> pointer_events;
-static List<InputEvent> key_events;
+static List<Ref<InputEvent> > key_events;
static List<OS_Android::JoypadEvent> joy_events;
static bool initialized = false;
static Mutex *input_mutex = NULL;
@@ -882,7 +883,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en
__android_log_print(ANDROID_LOG_INFO, "godot", "*****SETUP OK");
//video driver is determined here, because once initialized, it can't be changed
- String vd = GlobalConfig::get_singleton()->get("display/driver");
+ String vd = ProjectSettings::get_singleton()->get("display/driver");
env->CallVoidMethod(_godot_instance, _on_video_init, (jboolean) true);
@@ -894,7 +895,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, jobject obj, jint width, jint height, jboolean reload) {
- __android_log_print(ANDROID_LOG_INFO, "godot", "^_^_^_^_^ resize %lld, %i, %i\n", Thread::get_caller_ID(), width, height);
+ __android_log_print(ANDROID_LOG_INFO, "godot", "^_^_^_^_^ resize %lld, %i, %i\n", Thread::get_caller_id(), width, height);
if (os_android)
os_android->set_display_size(Size2(width, height));
@@ -908,7 +909,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, j
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv *env, jobject obj, bool p_32_bits) {
- __android_log_print(ANDROID_LOG_INFO, "godot", "^_^_^_^_^ newcontext %lld\n", Thread::get_caller_ID());
+ __android_log_print(ANDROID_LOG_INFO, "godot", "^_^_^_^_^ newcontext %lld\n", Thread::get_caller_id());
if (os_android) {
os_android->set_context_is_16_bits(!p_32_bits);
@@ -929,12 +930,12 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_back(JNIEnv *env, job
static void _initialize_java_modules() {
- if (!GlobalConfig::get_singleton()->has("android/modules")) {
+ if (!ProjectSettings::get_singleton()->has("android/modules")) {
print_line("ANDROID MODULES: Nothing to load, aborting");
return;
}
- String modules = GlobalConfig::get_singleton()->get("android/modules");
+ String modules = ProjectSettings::get_singleton()->get("android/modules");
modules = modules.strip_edges();
if (modules == String()) {
return;
@@ -994,7 +995,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, job
ThreadAndroid::setup_thread();
- //__android_log_print(ANDROID_LOG_INFO,"godot","**STEP EVENT! - %p-%i\n",env,Thread::get_caller_ID());
+ //__android_log_print(ANDROID_LOG_INFO,"godot","**STEP EVENT! - %p-%i\n",env,Thread::get_caller_id());
suspend_mutex->lock();
input_mutex->lock();
@@ -1004,7 +1005,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, job
// because of the way android forces you to do everything with threads
java_class_wrapper = memnew(JavaClassWrapper(_godot_instance));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("JavaClassWrapper", java_class_wrapper));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JavaClassWrapper", java_class_wrapper));
_initialize_java_modules();
Main::setup2();
@@ -1035,7 +1036,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, job
while (key_events.size()) {
- InputEvent event = key_events.front()->get();
+ Ref<InputEvent> event = key_events.front()->get();
os_android->process_event(event);
key_events.pop_front();
@@ -1068,7 +1069,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, job
jclass cls = env->FindClass("org/godotengine/godot/Godot");
jmethodID _finish = env->GetMethodID(cls, "forceQuit", "()V");
env->CallVoidMethod(_godot_instance, _finish);
- __android_log_print(ANDROID_LOG_INFO, "godot", "**FINISH REQUEST!!! - %p-%i\n", env, Thread::get_caller_ID());
+ __android_log_print(ANDROID_LOG_INFO, "godot", "**FINISH REQUEST!!! - %p-%i\n", env, Thread::get_caller_id());
}
suspend_mutex->unlock();
@@ -1076,7 +1077,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, job
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch(JNIEnv *env, jobject obj, jint ev, jint pointer, jint count, jintArray positions) {
- //__android_log_print(ANDROID_LOG_INFO,"godot","**TOUCH EVENT! - %p-%i\n",env,Thread::get_caller_ID());
+ //__android_log_print(ANDROID_LOG_INFO,"godot","**TOUCH EVENT! - %p-%i\n",env,Thread::get_caller_id());
Vector<OS_Android::TouchPos> points;
for (int i = 0; i < count; i++) {
@@ -1418,30 +1419,23 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyconnectionchanged(
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_key(JNIEnv *env, jobject obj, jint p_scancode, jint p_unicode_char, jboolean p_pressed) {
- InputEvent ievent;
- ievent.type = InputEvent::KEY;
- ievent.device = 0;
+ Ref<InputEventKey> ievent;
int val = p_unicode_char;
int scancode = android_get_keysym(p_scancode);
- ievent.key.scancode = scancode;
- ievent.key.unicode = val;
- ievent.key.pressed = p_pressed;
+ ievent->set_scancode(scancode);
+ ievent->set_unicode(val);
+ ievent->set_pressed(p_pressed);
- print_line("Scancode: " + String::num(p_scancode) + ":" + String::num(ievent.key.scancode) + " Unicode: " + String::num(val));
-
- ievent.key.mod.shift = false;
- ievent.key.mod.alt = false;
- ievent.key.mod.control = false;
- ievent.key.echo = false;
+ print_line("Scancode: " + String::num(p_scancode) + ":" + String::num(ievent->get_scancode()) + " Unicode: " + String::num(val));
if (val == '\n') {
- ievent.key.scancode = KEY_ENTER;
+ ievent->set_scancode(KEY_ENTER);
} else if (val == 61448) {
- ievent.key.scancode = KEY_BACKSPACE;
- ievent.key.unicode = KEY_BACKSPACE;
+ ievent->set_scancode(KEY_BACKSPACE);
+ ievent->set_unicode(KEY_BACKSPACE);
} else if (val == 61453) {
- ievent.key.scancode = KEY_ENTER;
- ievent.key.unicode = KEY_ENTER;
+ ievent->set_scancode(KEY_ENTER);
+ ievent->set_unicode(KEY_ENTER);
} else if (p_scancode == 4) {
go_back_request = true;
@@ -1510,8 +1504,8 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_singleton(JNIEnv *env
s->set_instance(env->NewGlobalRef(p_object));
jni_singletons[singname] = s;
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton(singname, s));
- GlobalConfig::get_singleton()->set(singname, s);
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton(singname, s));
+ ProjectSettings::get_singleton()->set(singname, s);
}
static Variant::Type get_jni_type(const String &p_type) {
@@ -1584,7 +1578,7 @@ JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getGlobal(JNIEnv *
String js = env->GetStringUTFChars(path, NULL);
- return env->NewStringUTF(GlobalConfig::get_singleton()->get(js).operator String().utf8().get_data());
+ return env->NewStringUTF(ProjectSettings::get_singleton()->get(js).operator String().utf8().get_data());
}
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_method(JNIEnv *env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args) {
diff --git a/platform/android/java_glue.h b/platform/android/java_glue.h
index 51a2031867..bcb3304c3e 100644
--- a/platform/android/java_glue.h
+++ b/platform/android/java_glue.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -55,8 +56,8 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusout(JNIEnv *env,
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_singleton(JNIEnv *env, jobject obj, jstring name, jobject p_object);
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_method(JNIEnv *env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args);
JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getGlobal(JNIEnv *env, jobject obj, jstring path);
-JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv *env, jobject obj, jint ID, jstring method, jobjectArray params);
-JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv *env, jobject obj, jint ID, jstring method, jobjectArray params);
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv *env, jobject p_obj, jint ID, jstring method, jobjectArray params);
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv *env, jobject p_obj, jint ID, jstring method, jobjectArray params);
}
#endif
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index 1484ccfb8c..a027e78de9 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "os_android.h"
-#include "core/global_config.h"
#include "core/io/file_access_buffered_fa.h"
+#include "core/project_settings.h"
#include "drivers/gles3/rasterizer_gles3.h"
#include "drivers/unix/dir_access_unix.h"
#include "drivers/unix/file_access_unix.h"
@@ -129,12 +130,12 @@ void OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int
RasterizerGLES3::make_current();
visual_server = memnew(VisualServerRaster);
-/* if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
+ /* if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
visual_server = memnew(VisualServerWrapMT(visual_server, false));
};*/
visual_server->init();
- visual_server->cursor_set_visible(false, 0);
+ // visual_server->cursor_set_visible(false, 0);
AudioDriverManager::get_driver(p_audio_driver)->set_singleton();
@@ -244,7 +245,7 @@ bool OS_Android::is_mouse_grab_enabled() const {
return false;
}
-Point2 OS_Android::get_mouse_pos() const {
+Point2 OS_Android::get_mouse_position() const {
return Point2();
}
@@ -343,25 +344,24 @@ void OS_Android::process_joy_event(OS_Android::JoypadEvent p_event) {
switch (p_event.type) {
case JOY_EVENT_BUTTON:
- last_id = input->joy_button(last_id, p_event.device, p_event.index, p_event.pressed);
+ input->joy_button(p_event.device, p_event.index, p_event.pressed);
break;
case JOY_EVENT_AXIS:
InputDefault::JoyAxis value;
value.min = -1;
value.value = p_event.value;
- last_id = input->joy_axis(last_id, p_event.device, p_event.index, value);
+ input->joy_axis(p_event.device, p_event.index, value);
break;
case JOY_EVENT_HAT:
- last_id = input->joy_hat(last_id, p_event.device, p_event.hat);
+ input->joy_hat(p_event.device, p_event.hat);
break;
default:
return;
}
}
-void OS_Android::process_event(InputEvent p_event) {
+void OS_Android::process_event(Ref<InputEvent> p_event) {
- p_event.ID = last_id++;
input->parse_input_event(p_event);
}
@@ -374,27 +374,24 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
if (touch.size()) {
//end all if exist
- InputEvent ev;
- ev.type = InputEvent::MOUSE_BUTTON;
- ev.ID = last_id++;
- ev.mouse_button.button_index = BUTTON_LEFT;
- ev.mouse_button.button_mask = BUTTON_MASK_LEFT;
- ev.mouse_button.pressed = false;
- ev.mouse_button.x = touch[0].pos.x;
- ev.mouse_button.y = touch[0].pos.y;
- ev.mouse_button.global_x = touch[0].pos.x;
- ev.mouse_button.global_y = touch[0].pos.y;
- input->parse_input_event(ev);
+ {
+ Ref<InputEventMouseButton> ev;
+ ev.instance();
+ ev->set_button_index(BUTTON_LEFT);
+ ev->set_button_mask(BUTTON_MASK_LEFT);
+ ev->set_pressed(false);
+ ev->set_position(touch[0].pos);
+ ev->set_global_position(touch[0].pos);
+ input->parse_input_event(ev);
+ }
for (int i = 0; i < touch.size(); i++) {
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.ID = last_id++;
- ev.screen_touch.index = touch[i].id;
- ev.screen_touch.pressed = false;
- ev.screen_touch.x = touch[i].pos.x;
- ev.screen_touch.y = touch[i].pos.y;
+ Ref<InputEventScreenTouch> ev;
+ ev.instance();
+ ev->set_index(touch[i].id);
+ ev->set_pressed(false);
+ ev->set_position(touch[i].pos);
input->parse_input_event(ev);
}
}
@@ -407,17 +404,15 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
{
//send mouse
- InputEvent ev;
- ev.type = InputEvent::MOUSE_BUTTON;
- ev.ID = last_id++;
- ev.mouse_button.button_index = BUTTON_LEFT;
- ev.mouse_button.button_mask = BUTTON_MASK_LEFT;
- ev.mouse_button.pressed = true;
- ev.mouse_button.x = touch[0].pos.x;
- ev.mouse_button.y = touch[0].pos.y;
- ev.mouse_button.global_x = touch[0].pos.x;
- ev.mouse_button.global_y = touch[0].pos.y;
- input->set_mouse_pos(Point2(touch[0].pos.x,touch[0].pos.y));
+ Ref<InputEventMouseButton> ev;
+ ev.instance();
+ // ev.type = Ref<InputEvent>::MOUSE_BUTTON;
+ ev->set_button_index(BUTTON_LEFT);
+ ev->set_button_mask(BUTTON_MASK_LEFT);
+ ev->set_pressed(true);
+ ev->set_position(touch[0].pos);
+ ev->set_global_position(touch[0].pos);
+ input->set_mouse_position(Point2(touch[0].pos.x, touch[0].pos.y));
last_mouse = touch[0].pos;
input->parse_input_event(ev);
}
@@ -425,13 +420,11 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
//send touch
for (int i = 0; i < touch.size(); i++) {
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.ID = last_id++;
- ev.screen_touch.index = touch[i].id;
- ev.screen_touch.pressed = true;
- ev.screen_touch.x = touch[i].pos.x;
- ev.screen_touch.y = touch[i].pos.y;
+ Ref<InputEventScreenTouch> ev;
+ ev.instance();
+ ev->set_index(touch[i].id);
+ ev->set_pressed(true);
+ ev->set_position(touch[i].pos);
input->parse_input_event(ev);
}
@@ -440,17 +433,13 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
if (p_points.size()) {
//send mouse, should look for point 0?
- InputEvent ev;
- ev.type = InputEvent::MOUSE_MOTION;
- ev.ID = last_id++;
- ev.mouse_motion.button_mask = BUTTON_MASK_LEFT;
- ev.mouse_motion.x = p_points[0].pos.x;
- ev.mouse_motion.y = p_points[0].pos.y;
- input->set_mouse_pos(Point2(ev.mouse_motion.x, ev.mouse_motion.y));
- ev.mouse_motion.speed_x = input->get_last_mouse_speed().x;
- ev.mouse_motion.speed_y = input->get_last_mouse_speed().y;
- ev.mouse_motion.relative_x = p_points[0].pos.x - last_mouse.x;
- ev.mouse_motion.relative_y = p_points[0].pos.y - last_mouse.y;
+ Ref<InputEventMouseMotion> ev;
+ ev.instance();
+ ev->set_button_mask(BUTTON_MASK_LEFT);
+ ev->set_position(p_points[0].pos);
+ input->set_mouse_position(Point2(ev->get_position().x, ev->get_position().y));
+ ev->set_speed(input->get_last_mouse_speed());
+ ev->set_relative(p_points[0].pos - last_mouse);
last_mouse = p_points[0].pos;
input->parse_input_event(ev);
}
@@ -473,14 +462,11 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
if (touch[i].pos == p_points[idx].pos)
continue; //no move unncesearily
- InputEvent ev;
- ev.type = InputEvent::SCREEN_DRAG;
- ev.ID = last_id++;
- ev.screen_drag.index = touch[i].id;
- ev.screen_drag.x = p_points[idx].pos.x;
- ev.screen_drag.y = p_points[idx].pos.y;
- ev.screen_drag.relative_x = p_points[idx].pos.x - touch[i].pos.x;
- ev.screen_drag.relative_y = p_points[idx].pos.y - touch[i].pos.y;
+ Ref<InputEventScreenDrag> ev;
+ ev.instance();
+ ev->set_index(touch[i].id);
+ ev->set_position(p_points[idx].pos);
+ ev->set_relative(p_points[idx].pos - touch[i].pos);
input->parse_input_event(ev);
touch[i].pos = p_points[idx].pos;
}
@@ -490,28 +476,23 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
if (touch.size()) {
//end all if exist
- InputEvent ev;
- ev.type = InputEvent::MOUSE_BUTTON;
- ev.ID = last_id++;
- ev.mouse_button.button_index = BUTTON_LEFT;
- ev.mouse_button.button_mask = BUTTON_MASK_LEFT;
- ev.mouse_button.pressed = false;
- ev.mouse_button.x = touch[0].pos.x;
- ev.mouse_button.y = touch[0].pos.y;
- ev.mouse_button.global_x = touch[0].pos.x;
- ev.mouse_button.global_y = touch[0].pos.y;
- input->set_mouse_pos(Point2(touch[0].pos.x,touch[0].pos.y));
+ Ref<InputEventMouseButton> ev;
+ ev.instance();
+ ev->set_button_index(BUTTON_LEFT);
+ ev->set_button_mask(BUTTON_MASK_LEFT);
+ ev->set_pressed(false);
+ ev->set_position(touch[0].pos);
+ ev->set_global_position(touch[0].pos);
+ input->set_mouse_position(Point2(touch[0].pos.x, touch[0].pos.y));
input->parse_input_event(ev);
for (int i = 0; i < touch.size(); i++) {
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.ID = last_id++;
- ev.screen_touch.index = touch[i].id;
- ev.screen_touch.pressed = false;
- ev.screen_touch.x = touch[i].pos.x;
- ev.screen_touch.y = touch[i].pos.y;
+ Ref<InputEventScreenTouch> ev;
+ ev.instance();
+ ev->set_index(touch[i].id);
+ ev->set_pressed(false);
+ ev->set_position(touch[i].pos);
input->parse_input_event(ev);
}
touch.clear();
@@ -525,13 +506,12 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
TouchPos tp = p_points[p_pointer];
touch.push_back(tp);
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.ID = last_id++;
- ev.screen_touch.index = tp.id;
- ev.screen_touch.pressed = true;
- ev.screen_touch.x = tp.pos.x;
- ev.screen_touch.y = tp.pos.y;
+ Ref<InputEventScreenTouch> ev;
+ ev.instance();
+
+ ev->set_index(tp.id);
+ ev->set_pressed(true);
+ ev->set_position(tp.pos);
input->parse_input_event(ev);
} break;
@@ -540,13 +520,11 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
for (int i = 0; i < touch.size(); i++) {
if (touch[i].id == p_pointer) {
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.ID = last_id++;
- ev.screen_touch.index = touch[i].id;
- ev.screen_touch.pressed = false;
- ev.screen_touch.x = touch[i].pos.x;
- ev.screen_touch.y = touch[i].pos.y;
+ Ref<InputEventScreenTouch> ev;
+ ev.instance();
+ ev->set_index(touch[i].id);
+ ev->set_pressed(false);
+ ev->set_position(touch[i].pos);
input->parse_input_event(ev);
touch.remove(i);
i--;
@@ -627,8 +605,8 @@ void OS_Android::reload_gfx() {
if (gfx_init_func)
gfx_init_func(gfx_init_ud, use_gl2);
-// if (rasterizer)
-// rasterizer->reload_vram();
+ //if (rasterizer)
+ // rasterizer->reload_vram();
}
Error OS_Android::shell_open(String p_uri) {
@@ -699,7 +677,7 @@ String OS_Android::get_data_dir() const {
}
return ".";
- //return GlobalConfig::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir");
+ //return ProjectSettings::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir");
}
void OS_Android::set_screen_orientation(ScreenOrientation p_orientation) {
@@ -708,11 +686,11 @@ void OS_Android::set_screen_orientation(ScreenOrientation p_orientation) {
set_screen_orientation_func(p_orientation);
}
-String OS_Android::get_unique_ID() const {
+String OS_Android::get_unique_id() const {
if (get_unique_id_func)
return get_unique_id_func();
- return OS::get_unique_ID();
+ return OS::get_unique_id();
}
Error OS_Android::native_video_play(String p_path, float p_volume) {
@@ -746,9 +724,9 @@ void OS_Android::native_video_stop() {
void OS_Android::set_context_is_16_bits(bool p_is_16) {
-// use_16bits_fbo = p_is_16;
-// if (rasterizer)
-// rasterizer->set_force_16_bits_fbo(p_is_16);
+ //use_16bits_fbo = p_is_16;
+ //if (rasterizer)
+ // rasterizer->set_force_16_bits_fbo(p_is_16);
}
void OS_Android::joy_connection_changed(int p_device, bool p_connected, String p_name) {
@@ -763,6 +741,10 @@ String OS_Android::get_joy_guid(int p_device) const {
return input->get_joy_guid_remapped(p_device);
}
+bool OS_Android::_check_internal_feature_support(const String &p_feature) {
+ return p_feature == "mobile" || p_feature == "etc" || p_feature == "etc2"; //TODO support etc2 only if GLES3 driver is selected
+}
+
OS_Android::OS_Android(GFXInitFunc p_gfx_init_func, void *p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetDataDirFunc p_get_data_dir_func, GetLocaleFunc p_get_locale_func, GetModelFunc p_get_model_func, GetScreenDPIFunc p_get_screen_dpi_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, SetScreenOrientationFunc p_screen_orient, GetUniqueIDFunc p_get_unique_id, GetSystemDirFunc p_get_sdir_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, AlertFunc p_alert_func, bool p_use_apk_expansion) {
use_apk_expansion = p_use_apk_expansion;
@@ -774,9 +756,8 @@ OS_Android::OS_Android(GFXInitFunc p_gfx_init_func, void *p_gfx_init_ud, OpenURI
gfx_init_func = p_gfx_init_func;
gfx_init_ud = p_gfx_init_ud;
main_loop = NULL;
- last_id = 1;
gl_extensions = NULL;
-// rasterizer = NULL;
+ //rasterizer = NULL;
use_gl2 = false;
open_uri_func = p_open_uri_func;
diff --git a/platform/android/os_android.h b/platform/android/os_android.h
index ad438d8626..54d7e562e0 100644
--- a/platform/android/os_android.h
+++ b/platform/android/os_android.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -94,7 +95,6 @@ private:
Vector<TouchPos> touch;
Point2 last_mouse;
- unsigned int last_id;
GFXInitFunc gfx_init_func;
void *gfx_init_ud;
@@ -171,7 +171,7 @@ public:
virtual void set_mouse_show(bool p_show);
virtual void set_mouse_grab(bool p_grab);
virtual bool is_mouse_grab_enabled() const;
- virtual Point2 get_mouse_pos() const;
+ virtual Point2 get_mouse_position() const;
virtual int get_mouse_button_state() const;
virtual void set_window_title(const String &p_title);
@@ -222,7 +222,7 @@ public:
virtual String get_model_name() const;
virtual int get_screen_dpi(int p_screen = 0) const;
- virtual String get_unique_ID() const;
+ virtual String get_unique_id() const;
virtual String get_system_dir(SystemDir p_dir) const;
@@ -231,7 +231,7 @@ public:
void process_gyroscope(const Vector3 &p_gyroscope);
void process_touch(int p_what, int p_pointer, const Vector<TouchPos> &p_points);
void process_joy_event(JoypadEvent p_event);
- void process_event(InputEvent p_event);
+ void process_event(Ref<InputEvent> p_event);
void init_video_mode(int p_video_width, int p_video_height);
virtual Error native_video_play(String p_path, float p_volume);
@@ -243,6 +243,7 @@ public:
virtual String get_joy_guid(int p_device) const;
void joy_connection_changed(int p_device, bool p_connected, String p_name);
+ virtual bool _check_internal_feature_support(const String &p_feature);
OS_Android(GFXInitFunc p_gfx_init_func, void *p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetDataDirFunc p_get_data_dir_func, GetLocaleFunc p_get_locale_func, GetModelFunc p_get_model_func, GetScreenDPIFunc p_get_screen_dpi_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, SetScreenOrientationFunc p_screen_orient, GetUniqueIDFunc p_get_unique_id, GetSystemDirFunc p_get_sdir_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, AlertFunc p_alert_func, bool p_use_apk_expansion);
~OS_Android();
};
diff --git a/platform/android/platform_config.h b/platform/android/platform_config.h
index cdef185ff0..48bcadcc29 100644
--- a/platform/android/platform_config.h
+++ b/platform/android/platform_config.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/power_android.cpp b/platform/android/power_android.cpp
index aa37dc51e2..bb5a1db250 100644
--- a/platform/android/power_android.cpp
+++ b/platform/android/power_android.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,10 +28,35 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "core/error_macros.h"
+/*
+Adapted from corresponding SDL 2.0 code.
+*/
+
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
#include "power_android.h"
+#include "core/error_macros.h"
+
static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder) {
if (refholder->m_env) {
JNIEnv *env = refholder->m_env;
diff --git a/platform/android/power_android.h b/platform/android/power_android.h
index df4983bbf3..328a4506a1 100644
--- a/platform/android/power_android.h
+++ b/platform/android/power_android.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/android/run_icon.png b/platform/android/run_icon.png
new file mode 100644
index 0000000000..e53f8e9da5
--- /dev/null
+++ b/platform/android/run_icon.png
Binary files differ
diff --git a/platform/android/thread_jandroid.cpp b/platform/android/thread_jandroid.cpp
index 854cdb1e34..924ae3fe43 100644
--- a/platform/android/thread_jandroid.cpp
+++ b/platform/android/thread_jandroid.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,7 +32,7 @@
#include "os/memory.h"
#include "script_language.h"
-Thread::ID ThreadAndroid::get_ID() const {
+Thread::ID ThreadAndroid::get_id() const {
return id;
}
@@ -65,7 +66,7 @@ Thread *ThreadAndroid::create_func_jandroid(ThreadCreateCallback p_callback, voi
return tr;
}
-Thread::ID ThreadAndroid::get_thread_ID_func_jandroid() {
+Thread::ID ThreadAndroid::get_thread_id_func_jandroid() {
return (ID)pthread_self();
}
@@ -106,7 +107,7 @@ void ThreadAndroid::make_default(JavaVM *p_java_vm) {
java_vm = p_java_vm;
create_func = create_func_jandroid;
- get_thread_ID_func = get_thread_ID_func_jandroid;
+ get_thread_id_func = get_thread_id_func_jandroid;
wait_to_finish_func = wait_to_finish_func_jandroid;
pthread_key_create(&jvm_key, _thread_destroyed);
setup_thread();
diff --git a/platform/android/thread_jandroid.h b/platform/android/thread_jandroid.h
index a8d8a4d8b1..5267329744 100644
--- a/platform/android/thread_jandroid.h
+++ b/platform/android/thread_jandroid.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -51,7 +52,7 @@ class ThreadAndroid : public Thread {
static void *thread_callback(void *userdata);
static Thread *create_func_jandroid(ThreadCreateCallback p_callback, void *, const Settings &);
- static ID get_thread_ID_func_jandroid();
+ static ID get_thread_id_func_jandroid();
static void wait_to_finish_func_jandroid(Thread *p_thread);
static void _thread_destroyed(void *value);
@@ -61,7 +62,7 @@ class ThreadAndroid : public Thread {
static JavaVM *java_vm;
public:
- virtual ID get_ID() const;
+ virtual ID get_id() const;
static void make_default(JavaVM *p_java_vm);
static void setup_thread();
diff --git a/platform/bb10/SCsub b/platform/bb10/SCsub
deleted file mode 100644
index c19f46d579..0000000000
--- a/platform/bb10/SCsub
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-
-Import('env')
-
-bb10_lib = [
-
- 'bbutil.c',
- 'os_bb10.cpp',
- 'audio_driver_bb10.cpp',
- 'godot_bb10.cpp',
- 'payment_service.cpp',
-]
-
-env_bps = env.Clone()
-if env['bb10_payment_service'] == "yes":
- env_bps.Append(CPPFLAGS=['-DPAYMENT_SERVICE_ENABLED'])
-
-if env['bb10_lgles_override'] == "yes":
- env_bps.Append(CPPFLAGS=['-DBB10_LGLES_OVERRIDE'])
-
-
-prog = None
-prog = env_bps.Program('#bin/godot', bb10_lib)
diff --git a/platform/bb10/audio_driver_bb10.cpp b/platform/bb10/audio_driver_bb10.cpp
deleted file mode 100644
index 5416fc5f02..0000000000
--- a/platform/bb10/audio_driver_bb10.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-/*************************************************************************/
-/* audio_driver_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 "audio_driver_bb10.h"
-
-#include <errno.h>
-
-Error AudioDriverBB10::init() {
- return init(NULL);
-};
-
-Error AudioDriverBB10::init(const char *p_name) {
-
- active = false;
- thread_exited = false;
- exit_thread = false;
- pcm_open = false;
- samples_in = NULL;
- samples_out = NULL;
-
- mix_rate = 44100;
- speaker_mode = SPEAKER_MODE_STEREO;
-
- char *dev_name;
- if (p_name == NULL) {
- dev_name = "pcmPreferred";
- } else {
- dev_name = (char *)p_name;
- }
- printf("******** reconnecting to device %s\n", dev_name);
- int ret = snd_pcm_open_name(&pcm_handle, dev_name, SND_PCM_OPEN_PLAYBACK);
- ERR_FAIL_COND_V(ret < 0, FAILED);
- pcm_open = true;
-
- snd_pcm_channel_info_t cinfo;
- zeromem(&cinfo, sizeof(cinfo));
- cinfo.channel = SND_PCM_CHANNEL_PLAYBACK;
- snd_pcm_plugin_info(pcm_handle, &cinfo);
-
- printf("rates %i, %i, %i, %i, %i\n", cinfo.rates, cinfo.rates & SND_PCM_RATE_44100, cinfo.rates & SND_PCM_RATE_32000, cinfo.rates & SND_PCM_RATE_22050, cinfo.max_rate);
-
- mix_rate = cinfo.max_rate;
-
- printf("formats %i, %i, %i\n", cinfo.formats, cinfo.formats & SND_PCM_FMT_S16_BE, cinfo.formats & SND_PCM_FMT_S16_LE);
- ERR_FAIL_COND_V(!(cinfo.formats & SND_PCM_FMT_S16_LE), FAILED);
-
- printf("voices %i\n", cinfo.max_voices);
- speaker_mode = SPEAKER_MODE_STEREO;
-
- snd_pcm_channel_params_t cp;
- zeromem(&cp, sizeof(cp));
- cp.mode = SND_PCM_MODE_BLOCK;
- cp.channel = SND_PCM_CHANNEL_PLAYBACK;
- cp.start_mode = SND_PCM_START_DATA;
- cp.stop_mode = SND_PCM_STOP_STOP;
- //cp.buf.block.frag_size = cinfo.max_fragment_size;
- cp.buf.block.frag_size = 512;
- cp.buf.block.frags_max = 1;
- cp.buf.block.frags_min = 1;
- cp.format.interleave = 1;
- cp.format.rate = mix_rate;
- cp.format.voices = speaker_mode;
- cp.format.format = SND_PCM_SFMT_S16_LE;
-
- ret = snd_pcm_plugin_params(pcm_handle, &cp);
- printf("ret is %i, %i\n", ret, cp.why_failed);
- ERR_FAIL_COND_V(ret < 0, FAILED);
-
- ret = snd_pcm_plugin_prepare(pcm_handle, SND_PCM_CHANNEL_PLAYBACK);
- ERR_FAIL_COND_V(ret < 0, FAILED);
-
- snd_mixer_group_t group;
- zeromem(&group, sizeof(group));
- snd_pcm_channel_setup_t setup;
- zeromem(&setup, sizeof(setup));
- setup.channel = SND_PCM_CHANNEL_PLAYBACK;
- setup.mode = SND_PCM_MODE_BLOCK;
- setup.mixer_gid = &group.gid;
- ret = snd_pcm_plugin_setup(pcm_handle, &setup);
- ERR_FAIL_COND_V(ret < 0, FAILED);
-
- pcm_frag_size = setup.buf.block.frag_size;
- pcm_max_frags = 1;
-
- sample_buf_count = pcm_frag_size * pcm_max_frags / 2;
- printf("sample count %i, %i, %i\n", sample_buf_count, pcm_frag_size, pcm_max_frags);
- samples_in = memnew_arr(int32_t, sample_buf_count);
- samples_out = memnew_arr(int16_t, sample_buf_count);
-
- thread = Thread::create(AudioDriverBB10::thread_func, this);
-
- return OK;
-};
-
-void AudioDriverBB10::thread_func(void *p_udata) {
-
- AudioDriverBB10 *ad = (AudioDriverBB10 *)p_udata;
-
- int channels = speaker_mode;
- int frame_count = ad->sample_buf_count / channels;
- int bytes_out = frame_count * channels * 2;
-
- while (!ad->exit_thread) {
-
- if (!ad->active) {
-
- for (int i = 0; i < ad->sample_buf_count; i++) {
-
- ad->samples_out[i] = 0;
- };
- } else {
-
- ad->lock();
-
- ad->audio_server_process(frame_count, ad->samples_in);
-
- ad->unlock();
-
- for (int i = 0; i < frame_count * channels; i++) {
-
- ad->samples_out[i] = ad->samples_in[i] >> 16;
- }
- };
-
- int todo = bytes_out;
- int total = 0;
-
- while (todo) {
-
- uint8_t *src = (uint8_t *)ad->samples_out;
- int wrote = snd_pcm_plugin_write(ad->pcm_handle, (void *)(src + total), todo);
- if (wrote < 0) {
- // error?
- break;
- };
- total += wrote;
- todo -= wrote;
- if (wrote < todo) {
- if (ad->thread_exited) {
- break;
- };
- printf("pcm_write underrun %i, errno %i\n", (int)ad->thread_exited, errno);
- snd_pcm_channel_status_t status;
- zeromem(&status, sizeof(status));
- // put in non-blocking mode
- snd_pcm_nonblock_mode(ad->pcm_handle, 1);
- status.channel = SND_PCM_CHANNEL_PLAYBACK;
- int ret = snd_pcm_plugin_status(ad->pcm_handle, &status);
- //printf("status return %i, %i, %i, %i, %i\n", ret, errno, status.status, SND_PCM_STATUS_READY, SND_PCM_STATUS_UNDERRUN);
- snd_pcm_nonblock_mode(ad->pcm_handle, 0);
- if (ret < 0) {
- break;
- };
- if (status.status == SND_PCM_STATUS_READY ||
- status.status == SND_PCM_STATUS_UNDERRUN) {
- snd_pcm_plugin_prepare(ad->pcm_handle, SND_PCM_CHANNEL_PLAYBACK);
- } else {
- break;
- };
- };
- };
- };
-
- snd_pcm_plugin_flush(ad->pcm_handle, SND_PCM_CHANNEL_PLAYBACK);
-
- ad->thread_exited = true;
- printf("**************** audio thread exit\n");
-};
-
-void AudioDriverBB10::start() {
-
- active = true;
-};
-
-int AudioDriverBB10::get_mix_rate() const {
-
- return mix_rate;
-};
-
-AudioDriver::SpeakerMode AudioDriverBB10::get_speaker_mode() const {
-
- return speaker_mode;
-};
-
-void AudioDriverBB10::lock() {
-
- if (!thread)
- return;
- mutex->lock();
-};
-
-void AudioDriverBB10::unlock() {
-
- if (!thread)
- return;
- mutex->unlock();
-};
-
-void AudioDriverBB10::finish() {
-
- if (!thread)
- return;
-
- exit_thread = true;
- Thread::wait_to_finish(thread);
-
- if (pcm_open)
- snd_pcm_close(pcm_handle);
-
- if (samples_in) {
- memdelete_arr(samples_in);
- memdelete_arr(samples_out);
- };
-
- memdelete(thread);
- thread = NULL;
-};
-
-AudioDriverBB10::AudioDriverBB10() {
-
- mutex = Mutex::create();
-};
-
-AudioDriverBB10::~AudioDriverBB10() {
-
- memdelete(mutex);
- mutex = NULL;
-};
diff --git a/platform/bb10/audio_driver_bb10.h b/platform/bb10/audio_driver_bb10.h
deleted file mode 100644
index 2a0ed9c545..0000000000
--- a/platform/bb10/audio_driver_bb10.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*************************************************************************/
-/* audio_driver_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. */
-/*************************************************************************/
-#include "servers/audio_server.h"
-
-#include "core/os/mutex.h"
-#include "core/os/thread.h"
-
-#include <sys/asoundlib.h>
-
-class AudioDriverBB10 : public AudioDriver {
-
- Thread *thread;
- Mutex *mutex;
-
- snd_pcm_t *pcm_handle;
-
- int32_t *samples_in;
- int16_t *samples_out;
- int sample_buf_count;
-
- static void thread_func(void *p_udata);
-
- int mix_rate;
- SpeakerMode speaker_mode;
-
- int pcm_frag_size;
- int pcm_max_frags;
-
- bool active;
- bool thread_exited;
- mutable bool exit_thread;
- bool pcm_open;
-
-public:
- const char *get_name() const {
- return "BB10";
- };
-
- virtual Error init();
- virtual Error init(const char *p_name);
- virtual void start();
- virtual int get_mix_rate() const;
- virtual SpeakerMode get_speaker_mode() const;
- virtual void lock();
- virtual void unlock();
- virtual void finish();
-
- AudioDriverBB10();
- ~AudioDriverBB10();
-};
diff --git a/platform/bb10/bar/bar-descriptor.xml b/platform/bb10/bar/bar-descriptor.xml
deleted file mode 100644
index 0ba70b7180..0000000000
--- a/platform/bb10/bar/bar-descriptor.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version='1.0' encoding='utf-8' standalone='no'?>
-<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
- <!-- BlackBerry® 10 application descriptor file.
-
- Specifies parameters for identifying, installing, and launching native applications on BlackBerry® 10 OS.
--->
- <!-- A universally unique application identifier. Must be unique across all BlackBerry applications.
- Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
- <id>com.godot.game</id>
- <!-- The name that is displayed in the BlackBerry application installer.
- May have multiple values for each language. See samples or xsd schema file. Optional. -->
- <name>Godot Game</name>
- <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
- Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
- An updated version of application must have a versionNumber value higher than the previous version. Required. -->
- <versionNumber>0.0.1</versionNumber>
- <!-- Fourth digit segment of the package version. First three segments are taken from the
- <versionNumber> element. Must be an integer from 0 to 2^16-1 -->
- <buildId>0</buildId>
- <!-- Description, displayed in the BlackBerry application installer.
- May have multiple values for each language. See samples or xsd schema file. Optional. -->
- <description>Game made with Godot Engine</description>
- <!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
- <author>You Name or Company</author>
- <authorId>authorIDherePlease</authorId>
- <!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
- <!-- <authorId>ABC1234YjsnUk235h</authorId> -->
- <initialWindow>
- <aspectRatio>landscape</aspectRatio>
- <autoOrients>false</autoOrients>
- <systemChrome>none</systemChrome>
- <transparent>false</transparent>
- </initialWindow>
- <!-- The category where the application appears. Either core.games or core.media. -->
- <category>core.games</category>
- <permission>read_device_identifying_information</permission>
- <permission>access_internet</permission>
- <asset path="data.pck">data.pck</asset>
- <configuration name="Device-Debug">
- <platformArchitecture>armle-v7</platformArchitecture>
- <asset type="Qnx/Elf" path="godot.bb10.debug.qnx.armle" entry="true">godot.bb10.debug.qnx.armle</asset>
- </configuration>
- <configuration name="Device-Release">
- <platformArchitecture>armle-v7</platformArchitecture>
- <asset type="Qnx/Elf" path="godot.bb10.opt.qnx.armle" entry="true">godot.bb10.opt.qnx.armle</asset>
- </configuration>
- <!-- The icon for the application. -->
- <icon>
- <image>icon.png</image>
- </icon>
- <!-- Ensure that shared libraries in the package are found at run-time. -->
- <env value="app/native/lib:/usr/lib/qt4/lib" var="LD_LIBRARY_PATH"/>
-</qnx>
diff --git a/platform/bb10/bar/icon.png b/platform/bb10/bar/icon.png
deleted file mode 100644
index 2161402438..0000000000
--- a/platform/bb10/bar/icon.png
+++ /dev/null
Binary files differ
diff --git a/platform/bb10/bbutil.c b/platform/bb10/bbutil.c
deleted file mode 100644
index ab3dcf69b2..0000000000
--- a/platform/bb10/bbutil.c
+++ /dev/null
@@ -1,513 +0,0 @@
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/keycodes.h>
-#include <time.h>
-
-#include "bbutil.h"
-
-EGLDisplay egl_disp;
-EGLSurface egl_surf;
-
-static EGLConfig egl_conf;
-static EGLContext egl_ctx;
-
-static screen_context_t screen_ctx;
-static screen_window_t screen_win;
-static screen_display_t screen_disp;
-
-
-static void
-bbutil_egl_perror(const char *msg) {
- static const char *errmsg[] = {
- "function succeeded",
- "EGL is not initialized, or could not be initialized, for the specified display",
- "cannot access a requested resource",
- "failed to allocate resources for the requested operation",
- "an unrecognized attribute or attribute value was passed in an attribute list",
- "an EGLConfig argument does not name a valid EGLConfig",
- "an EGLContext argument does not name a valid EGLContext",
- "the current surface of the calling thread is no longer valid",
- "an EGLDisplay argument does not name a valid EGLDisplay",
- "arguments are inconsistent",
- "an EGLNativePixmapType argument does not refer to a valid native pixmap",
- "an EGLNativeWindowType argument does not refer to a valid native window",
- "one or more argument values are invalid",
- "an EGLSurface argument does not name a valid surface configured for rendering",
- "a power management event has occurred",
- };
-
- fprintf(stderr, "%s: %s\n", msg, errmsg[eglGetError() - EGL_SUCCESS]);
-}
-EGLConfig bbutil_choose_config(EGLDisplay egl_disp, enum RENDERING_API api) {
- EGLConfig egl_conf = (EGLConfig)0;
- EGLConfig *egl_configs;
- EGLint egl_num_configs;
- EGLint val;
- EGLBoolean rc;
- EGLint i;
-
- rc = eglGetConfigs(egl_disp, NULL, 0, &egl_num_configs);
- if (rc != EGL_TRUE) {
- bbutil_egl_perror("eglGetConfigs");
- return egl_conf;
- }
- if (egl_num_configs == 0) {
- fprintf(stderr, "eglGetConfigs: could not find a configuration\n");
- return egl_conf;
- }
-
- egl_configs = malloc(egl_num_configs * sizeof(*egl_configs));
- if (egl_configs == NULL) {
- fprintf(stderr, "could not allocate memory for %d EGL configs\n", egl_num_configs);
- return egl_conf;
- }
-
- rc = eglGetConfigs(egl_disp, egl_configs,
- egl_num_configs, &egl_num_configs);
- if (rc != EGL_TRUE) {
- bbutil_egl_perror("eglGetConfigs");
- free(egl_configs);
- return egl_conf;
- }
-
- for (i = 0; i < egl_num_configs; i++) {
- eglGetConfigAttrib(egl_disp, egl_configs[i], EGL_SURFACE_TYPE, &val);
- if (!(val & EGL_WINDOW_BIT)) {
- continue;
- }
-
- eglGetConfigAttrib(egl_disp, egl_configs[i], EGL_RENDERABLE_TYPE, &val);
- if (!(val & api)) {
- continue;
- }
-
- eglGetConfigAttrib(egl_disp, egl_configs[i], EGL_DEPTH_SIZE, &val);
- if ((api & (GL_ES_1|GL_ES_2)) && (val == 0)) {
- continue;
- }
-
- eglGetConfigAttrib(egl_disp, egl_configs[i], EGL_RED_SIZE, &val);
- if (val != 8) {
- continue;
- }
- eglGetConfigAttrib(egl_disp, egl_configs[i], EGL_GREEN_SIZE, &val);
- if (val != 8) {
- continue;
- }
-
- eglGetConfigAttrib(egl_disp, egl_configs[i], EGL_BLUE_SIZE, &val);
- if (val != 8) {
- continue;
- }
-
- eglGetConfigAttrib(egl_disp, egl_configs[i], EGL_BUFFER_SIZE, &val);
- if (val != 32) {
- continue;
- }
-
- egl_conf = egl_configs[i];
- break;
- }
-
- free(egl_configs);
-
- if (egl_conf == (EGLConfig)0) {
- fprintf(stderr, "bbutil_choose_config: could not find a matching configuration\n");
- }
-
- return egl_conf;
-}
-
-int
-bbutil_init_egl(screen_context_t ctx, enum RENDERING_API api) {
- int usage;
- int format = SCREEN_FORMAT_RGBX8888;
- int nbuffers = 2;
- EGLint interval = 1;
- int rc;
- EGLint attributes[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
-
- if (api == GL_ES_1) {
- usage = SCREEN_USAGE_OPENGL_ES1 | SCREEN_USAGE_ROTATION;
- } else if (api == GL_ES_2) {
- usage = SCREEN_USAGE_OPENGL_ES2 | SCREEN_USAGE_ROTATION;
- } else if (api == VG) {
- usage = SCREEN_USAGE_OPENVG | SCREEN_USAGE_ROTATION;
- } else {
- fprintf(stderr, "invalid api setting\n");
- return EXIT_FAILURE;
- }
-
- //Simple egl initialization
- screen_ctx = ctx;
-
- egl_disp = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- if (egl_disp == EGL_NO_DISPLAY) {
- bbutil_egl_perror("eglGetDisplay");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- rc = eglInitialize(egl_disp, NULL, NULL);
- if (rc != EGL_TRUE) {
- bbutil_egl_perror("eglInitialize");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- if ((api == GL_ES_1) || (api == GL_ES_2)) {
- rc = eglBindAPI(EGL_OPENGL_ES_API);
- } else if (api == VG) {
- rc = eglBindAPI(EGL_OPENVG_API);
- }
-
- if (rc != EGL_TRUE) {
- bbutil_egl_perror("eglBindApi");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- egl_conf = bbutil_choose_config(egl_disp, api);
- if (egl_conf == (EGLConfig)0) {
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- if (api == GL_ES_2) {
- egl_ctx = eglCreateContext(egl_disp, egl_conf, EGL_NO_CONTEXT, attributes);
- } else {
- egl_ctx = eglCreateContext(egl_disp, egl_conf, EGL_NO_CONTEXT, NULL);
- }
-
- if (egl_ctx == EGL_NO_CONTEXT) {
- bbutil_egl_perror("eglCreateContext");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- rc = screen_create_window(&screen_win, screen_ctx);
- if (rc) {
- perror("screen_create_window");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_FORMAT, &format);
- if (rc) {
- perror("screen_set_window_property_iv(SCREEN_PROPERTY_FORMAT)");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_USAGE, &usage);
- if (rc) {
- perror("screen_set_window_property_iv(SCREEN_PROPERTY_USAGE)");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- rc = screen_get_window_property_pv(screen_win, SCREEN_PROPERTY_DISPLAY, (void **)&screen_disp);
- if (rc) {
- perror("screen_get_window_property_pv");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- int screen_resolution[2];
-
- rc = screen_get_display_property_iv(screen_disp, SCREEN_PROPERTY_SIZE, screen_resolution);
- if (rc) {
- perror("screen_get_display_property_iv");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- int angle = atoi(getenv("ORIENTATION"));
-
- screen_display_mode_t screen_mode;
- rc = screen_get_display_property_pv(screen_disp, SCREEN_PROPERTY_MODE, (void**)&screen_mode);
- if (rc) {
- perror("screen_get_display_property_pv");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- int size[2];
- rc = screen_get_window_property_iv(screen_win, SCREEN_PROPERTY_BUFFER_SIZE, size);
- if (rc) {
- perror("screen_get_window_property_iv");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- int buffer_size[2] = {size[0], size[1]};
-
- if ((angle == 0) || (angle == 180)) {
- if (((screen_mode.width > screen_mode.height) && (size[0] < size[1])) ||
- ((screen_mode.width < screen_mode.height) && (size[0] > size[1]))) {
- buffer_size[1] = size[0];
- buffer_size[0] = size[1];
- }
- } else if ((angle == 90) || (angle == 270)){
- if (((screen_mode.width > screen_mode.height) && (size[0] > size[1])) ||
- ((screen_mode.width < screen_mode.height && size[0] < size[1]))) {
- buffer_size[1] = size[0];
- buffer_size[0] = size[1];
- }
- } else {
- fprintf(stderr, "Navigator returned an unexpected orientation angle.\n");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_BUFFER_SIZE, buffer_size);
- if (rc) {
- perror("screen_set_window_property_iv");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_ROTATION, &angle);
- if (rc) {
- perror("screen_set_window_property_iv");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- rc = screen_create_window_buffers(screen_win, nbuffers);
- if (rc) {
- perror("screen_create_window_buffers");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- rc = screen_create_window_group(screen_win, get_window_group_id());
- if (rc) {
- perror("screen_create_window_group");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
- /* if (screen_create_window_group(screen_win, get_window_group_id()) != 0) goto fail; */
-
- int idle_mode = SCREEN_IDLE_MODE_KEEP_AWAKE;
- screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_IDLE_MODE, &idle_mode);
-
- egl_surf = eglCreateWindowSurface(egl_disp, egl_conf, screen_win, NULL);
- if (egl_surf == EGL_NO_SURFACE) {
- bbutil_egl_perror("eglCreateWindowSurface");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- rc = eglMakeCurrent(egl_disp, egl_surf, egl_surf, egl_ctx);
- if (rc != EGL_TRUE) {
- bbutil_egl_perror("eglMakeCurrent");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- rc = eglSwapInterval(egl_disp, interval);
- if (rc != EGL_TRUE) {
- bbutil_egl_perror("eglSwapInterval");
- bbutil_terminate();
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-}
-
-int
-bbutil_init_gl2d() {
-#if 0
- EGLint surface_width, surface_height;
-
- if ((egl_disp == EGL_NO_DISPLAY) || (egl_surf == EGL_NO_SURFACE) ){
- return EXIT_FAILURE;
- }
-
- eglQuerySurface(egl_disp, egl_surf, EGL_WIDTH, &surface_width);
- eglQuerySurface(egl_disp, egl_surf, EGL_HEIGHT, &surface_height);
-
- glShadeModel(GL_SMOOTH);
-
- glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
-
- glViewport(0, 0, surface_width, surface_height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-
- glOrthof(0.0f, (float)(surface_width) / (float)(surface_height), 0.0f, 1.0f, -1.0f, 1.0f);
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-#endif
-
- return EXIT_SUCCESS;
-}
-
-int
-bbutil_init(screen_context_t ctx, enum RENDERING_API api) {
- if (EXIT_SUCCESS != bbutil_init_egl(ctx, api)) {
- return EXIT_FAILURE;
- }
-
- if ((GL_ES_1 == api) && (EXIT_SUCCESS != bbutil_init_gl2d())) {
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-}
-
-int bbutil_is_flipped() {
-
- int ret;
- screen_get_window_property_iv(screen_win, SCREEN_PROPERTY_FLIP, &ret);
- return ret;
-};
-
-int bbutil_get_rotation() {
-
- int ret;
- screen_get_window_property_iv(screen_win, SCREEN_PROPERTY_ROTATION, &ret);
- return ret;
-};
-
-
-void
-bbutil_terminate() {
- //Typical EGL cleanup
- if (egl_disp != EGL_NO_DISPLAY) {
- eglMakeCurrent(egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- if (egl_surf != EGL_NO_SURFACE) {
- eglDestroySurface(egl_disp, egl_surf);
- egl_surf = EGL_NO_SURFACE;
- }
- if (egl_ctx != EGL_NO_CONTEXT) {
- eglDestroyContext(egl_disp, egl_ctx);
- egl_ctx = EGL_NO_CONTEXT;
- }
- if (screen_win != NULL) {
- screen_destroy_window(screen_win);
- screen_win = NULL;
- }
- eglTerminate(egl_disp);
- egl_disp = EGL_NO_DISPLAY;
- }
- eglReleaseThread();
-}
-
-void
-bbutil_swap() {
- int rc = eglSwapBuffers(egl_disp, egl_surf);
- if (rc != EGL_TRUE) {
- bbutil_egl_perror("eglSwapBuffers");
- }
-}
-
-void
-bbutil_clear() {
- glClear(GL_COLOR_BUFFER_BIT);
-}
-
-char *
-get_window_group_id()
-{
- static char s_window_group_id[16] = "";
-
- if (s_window_group_id[0] == '\0') {
- snprintf(s_window_group_id, sizeof(s_window_group_id), "%d", getpid());
- }
-
- return s_window_group_id;
-}
-
-
-int bbutil_rotate_screen_surface(int angle) {
- int rc, rotation, skip = 1, temp;
- EGLint interval = 1;
- int size[2];
-
- if ((angle != 0) && (angle != 90) && (angle != 180) && (angle != 270)) {
- fprintf(stderr, "Invalid angle\n");
- return EXIT_FAILURE;
- }
-
- rc = screen_get_window_property_iv(screen_win, SCREEN_PROPERTY_ROTATION, &rotation);
- if (rc) {
- perror("screen_set_window_property_iv");
- return EXIT_FAILURE;
- }
-
- rc = screen_get_window_property_iv(screen_win, SCREEN_PROPERTY_BUFFER_SIZE, size);
- if (rc) {
- perror("screen_set_window_property_iv");
- return EXIT_FAILURE;
- }
-
- switch (angle - rotation) {
- case -270:
- case -90:
- case 90:
- case 270:
- temp = size[0];
- size[0] = size[1];
- size[1] = temp;
- skip = 0;
- break;
- }
-
- if (!skip) {
- rc = eglMakeCurrent(egl_disp, NULL, NULL, NULL);
- if (rc != EGL_TRUE) {
- bbutil_egl_perror("eglMakeCurrent");
- return EXIT_FAILURE;
- }
-
- rc = eglDestroySurface(egl_disp, egl_surf);
- if (rc != EGL_TRUE) {
- bbutil_egl_perror("eglMakeCurrent");
- return EXIT_FAILURE;
- }
-
- rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_SOURCE_SIZE, size);
- if (rc) {
- perror("screen_set_window_property_iv");
- return EXIT_FAILURE;
- }
-
- rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_BUFFER_SIZE, size);
- if (rc) {
- perror("screen_set_window_property_iv");
- return EXIT_FAILURE;
- }
- egl_surf = eglCreateWindowSurface(egl_disp, egl_conf, screen_win, NULL);
- if (egl_surf == EGL_NO_SURFACE) {
- bbutil_egl_perror("eglCreateWindowSurface");
- return EXIT_FAILURE;
- }
-
- rc = eglMakeCurrent(egl_disp, egl_surf, egl_surf, egl_ctx);
- if (rc != EGL_TRUE) {
- bbutil_egl_perror("eglMakeCurrent");
- return EXIT_FAILURE;
- }
-
- rc = eglSwapInterval(egl_disp, interval);
- if (rc != EGL_TRUE) {
- bbutil_egl_perror("eglSwapInterval");
- return EXIT_FAILURE;
- }
- }
-
- rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_ROTATION, &angle);
- if (rc) {
- perror("screen_set_window_property_iv");
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-}
-
diff --git a/platform/bb10/bbutil.h b/platform/bb10/bbutil.h
deleted file mode 100644
index 77f4402fbd..0000000000
--- a/platform/bb10/bbutil.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef _UTILITY_H_INCLUDED
-#define _UTILITY_H_INCLUDED
-
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <screen/screen.h>
-#include <sys/platform.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern EGLDisplay egl_disp;
-extern EGLSurface egl_surf;
-
-enum RENDERING_API {
- GL_ES_1 = EGL_OPENGL_ES_BIT,
- GL_ES_2 = EGL_OPENGL_ES2_BIT,
- VG = EGL_OPENVG_BIT
-};
-
-/**
- * Initializes EGL, GL and loads a default font
- *
- * \param libscreen context that will be used for EGL setup
- * \return EXIT_SUCCESS if initialization succeeded otherwise EXIT_FAILURE
- */
-int bbutil_init(screen_context_t ctx, enum RENDERING_API api);
-
-/**
- * Initializes EGL
- *
- * \param libscreen context that will be used for EGL setup
- * \return EXIT_SUCCESS if initialization succeeded otherwise EXIT_FAILURE
- */
-int bbutil_init_egl(screen_context_t ctx, enum RENDERING_API api);
-
-/**
- * Initializes GL 1.1 for simple 2D rendering. GL2 initialization will be added at a later point.
- *
- * \return EXIT_SUCCESS if initialization succeeded otherwise EXIT_FAILURE
- */
-int bbutil_init_gl2d();
-
-int bbutil_is_flipped();
-int bbutil_get_rotation();
-
-char *get_window_group_id();
-
-int bbutil_rotate_screen_surface(int angle);
-
-/**
- * Terminates EGL
- */
-void bbutil_terminate();
-
-/**
- * Swaps default bbutil window surface to the screen
- */
-void bbutil_swap();
-
-/**
- * Clears the screen of any existing text.
- * NOTE: must be called after a successful return from bbutil_init() or bbutil_init_egl() call
- */
-void bbutil_clear();
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif
diff --git a/platform/bb10/detect.py b/platform/bb10/detect.py
deleted file mode 100644
index d3ee9f0124..0000000000
--- a/platform/bb10/detect.py
+++ /dev/null
@@ -1,92 +0,0 @@
-import os
-import sys
-import string
-import methods
-
-
-def is_active():
- return True
-
-
-def get_name():
- return "BlackBerry 10"
-
-
-def can_build():
-
- import os
- if (not os.environ.has_key("QNX_TARGET")):
- return False
- return True
-
-
-def get_opts():
-
- return [
- ('QNX_HOST', 'path to qnx host', os.environ.get("QNX_HOST", 0)),
- ('QNX_TARGET', 'path to qnx target', os.environ.get("QNX_TARGET", 0)),
- ('QNX_CONFIGURATION', 'path to qnx configuration', os.environ.get("QNX_CONFIGURATION", 0)),
- ('qnx_target', 'Qnx target (armle or x86', 'armle'),
- ('bb10_payment_service', 'Enable Payment Service for BlackBerry10', 'yes'),
- ('bb10_lgles_override', 'Force legacy GLES (1.1) on iOS', 'no'),
- ('bb10_exceptions', 'Use exceptions when compiling on bb10', 'no'),
- ]
-
-
-def get_flags():
-
- return [
- ('tools', 'no'),
- ('module_theora_enabled', 'no'),
- ]
-
-
-def configure(env):
-
- if env['PLATFORM'] == 'win32':
- env.Tool('mingw')
- env['SPAWN'] = methods.win32_spawn
-
- env['qnx_target_ver'] = env['qnx_target']
- if env['qnx_target'] == "armle":
- env['qnx_prefix'] = 'ntoarmv7'
- env['qnx_target_ver'] = 'armle-v7'
- else:
- env['qnx_prefix'] = 'ntox86'
-
- env['OBJSUFFIX'] = ".qnx.${qnx_target}.o"
- env['LIBSUFFIX'] = ".qnx.${qnx_target}.a"
- env['PROGSUFFIX'] = ".qnx.${qnx_target}"
- print("PROGSUFFIX: " + env['PROGSUFFIX'] + " target: " + env['qnx_target'])
-
- env.PrependENVPath('PATH', env['QNX_CONFIGURATION'] + '/bin')
- env.PrependENVPath('PATH', env['QNX_CONFIGURATION'] + '/usr/bin')
- env['ENV']['QNX_HOST'] = env['QNX_HOST']
- env['ENV']['QNX_TARGET'] = env['QNX_TARGET']
- env['ENV']['QNX_CONFIGURATION'] = env['QNX_CONFIGURATION']
-
- env['CC'] = '$qnx_prefix-gcc'
- env['CXX'] = '$qnx_prefix-g++'
- env['AR'] = '$qnx_prefix-ar'
- env['RANLIB'] = '$qnx_prefix-ranlib'
-
- env.Append(CPPPATH=['#platform/bb10'])
- env.Append(LIBPATH=['#platform/bb10/lib/$qnx_target', '#platform/bb10/lib/$qnx_target_ver'])
- env.Append(CCFLAGS=string.split('-DBB10_ENABLED -DUNIX_ENABLED -DGLES2_ENABLED -DGLES1_ENABLED -D_LITTLE_ENDIAN -DNO_THREADS -DNO_FCNTL'))
- if env['bb10_exceptions'] == "yes":
- env.Append(CCFLAGS=['-fexceptions'])
- else:
- env.Append(CCFLAGS=['-fno-exceptions'])
-
- # env.Append(LINKFLAGS = string.split()
-
- if (env["target"] == "release"):
-
- env.Append(CCFLAGS=['-O3', '-DRELEASE_BUILD'])
-
- elif (env["target"] == "debug"):
-
- env.Append(CCFLAGS=['-g', '-O0', '-DDEBUG_ENABLED', '-D_DEBUG'])
- env.Append(LINKFLAGS=['-g'])
-
- env.Append(LIBS=['bps', 'pps', 'screen', 'socket', 'EGL', 'GLESv2', 'GLESv1_CM', 'm', 'asound'])
diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp
deleted file mode 100644
index c958bf7ff4..0000000000
--- a/platform/bb10/export/export.cpp
+++ /dev/null
@@ -1,828 +0,0 @@
-/*************************************************************************/
-/* 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 "export.h"
-#include "editor/editor_export.h"
-#include "editor/editor_node.h"
-#include "editor/editor_settings.h"
-#include "global_config.h"
-#include "io/marshalls.h"
-#include "io/xml_parser.h"
-#include "io/zip_io.h"
-#include "os/file_access.h"
-#include "os/os.h"
-#include "platform/bb10/logo.h"
-#include "version.h"
-
-#define MAX_DEVICES 5
-#if 0
-class EditorExportPlatformBB10 : public EditorExportPlatform {
-
- GDCLASS( EditorExportPlatformBB10,EditorExportPlatform );
-
- String custom_package;
-
- int version_code;
- String version_name;
- String package;
- String name;
- String category;
- String description;
- String author_name;
- String author_id;
- String icon;
-
-
-
- struct Device {
-
- int index;
- String name;
- String description;
- };
-
- Vector<Device> devices;
- bool devices_changed;
- Mutex *device_lock;
- Thread *device_thread;
- Ref<ImageTexture> logo;
-
- volatile bool quit_request;
-
-
- static void _device_poll_thread(void *ud);
-
- void _fix_descriptor(Vector<uint8_t>& p_manifest);
-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 "BlackBerry 10"; }
- virtual ImageCompression get_image_compression() const { return IMAGE_COMPRESSION_ETC1; }
- virtual Ref<Texture> get_logo() const { return logo; }
-
-
- virtual bool poll_devices();
- virtual int get_device_count() const;
- virtual String get_device_name(int p_device) const;
- virtual String get_device_info(int p_device) const;
- virtual Error run(int p_device,int p_flags=0);
-
- virtual bool requires_password(bool p_debug) const { return !p_debug; }
- virtual String get_binary_extension() const { return "bar"; }
- virtual Error export_project(const String& p_path,bool p_debug,int p_flags=0);
-
- virtual bool can_export(String *r_error=NULL) const;
-
- EditorExportPlatformBB10();
- ~EditorExportPlatformBB10();
-};
-
-bool EditorExportPlatformBB10::_set(const StringName& p_name, const Variant& p_value) {
-
- String n=p_name;
-
- if (n=="version/code")
- version_code=p_value;
- else if (n=="version/name")
- version_name=p_value;
- else if (n=="package/unique_name")
- package=p_value;
- else if (n=="package/category")
- category=p_value;
- else if (n=="package/name")
- name=p_value;
- else if (n=="package/description")
- description=p_value;
- else if (n=="package/icon")
- icon=p_value;
- else if (n=="package/custom_template")
- custom_package=p_value;
- else if (n=="release/author")
- author_name=p_value;
- else if (n=="release/author_id")
- author_id=p_value;
- else
- return false;
-
- return true;
-}
-
-bool EditorExportPlatformBB10::_get(const StringName& p_name,Variant &r_ret) const{
-
- String n=p_name;
-
- if (n=="version/code")
- r_ret=version_code;
- else if (n=="version/name")
- r_ret=version_name;
- else if (n=="package/unique_name")
- r_ret=package;
- else if (n=="package/category")
- r_ret=category;
- else if (n=="package/name")
- r_ret=name;
- else if (n=="package/description")
- r_ret=description;
- else if (n=="package/icon")
- r_ret=icon;
- else if (n=="package/custom_template")
- r_ret=custom_package;
- else if (n=="release/author")
- r_ret=author_name;
- else if (n=="release/author_id")
- r_ret=author_id;
- else
- return false;
-
- return true;
-}
-void EditorExportPlatformBB10::_get_property_list( List<PropertyInfo> *p_list) const{
-
- p_list->push_back( PropertyInfo( Variant::INT, "version/code", PROPERTY_HINT_RANGE,"1,65535,1"));
- p_list->push_back( PropertyInfo( Variant::STRING, "version/name") );
- p_list->push_back( PropertyInfo( Variant::STRING, "package/unique_name") );
- p_list->push_back( PropertyInfo( Variant::STRING, "package/category") );
- p_list->push_back( PropertyInfo( Variant::STRING, "package/name") );
- p_list->push_back( PropertyInfo( Variant::STRING, "package/description",PROPERTY_HINT_MULTILINE_TEXT) );
- p_list->push_back( PropertyInfo( Variant::STRING, "package/icon",PROPERTY_HINT_FILE,"png") );
- p_list->push_back( PropertyInfo( Variant::STRING, "package/custom_template", PROPERTY_HINT_GLOBAL_FILE,"zip"));
- p_list->push_back( PropertyInfo( Variant::STRING, "release/author") );
- p_list->push_back( PropertyInfo( Variant::STRING, "release/author_id") );
-
- //p_list->push_back( PropertyInfo( Variant::INT, "resources/pack_mode", PROPERTY_HINT_ENUM,"Copy,Single Exec.,Pack (.pck),Bundles (Optical)"));
-
-}
-
-void EditorExportPlatformBB10::_fix_descriptor(Vector<uint8_t>& p_descriptor) {
-
- String fpath = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp_bar-settings.xml");
- {
- FileAccessRef f = FileAccess::open(fpath,FileAccess::WRITE);
- f->store_buffer(p_descriptor.ptr(),p_descriptor.size());
- }
-
- Ref<XMLParser> parser = memnew( XMLParser );
- Error err = parser->open(fpath);
- ERR_FAIL_COND(err!=OK);
-
- String txt;
- err = parser->read();
- Vector<String> depth;
-
- while(err!=ERR_FILE_EOF) {
-
- ERR_FAIL_COND(err!=OK);
-
- switch(parser->get_node_type()) {
-
- case XMLParser::NODE_NONE: {
- print_line("???");
- } break;
- case XMLParser::NODE_ELEMENT: {
- String e="<";
- e+=parser->get_node_name();
- for(int i=0;i<parser->get_attribute_count();i++) {
- e+=" ";
- e+=parser->get_attribute_name(i)+"=\"";
- e+=parser->get_attribute_value(i)+"\" ";
- }
-
-
-
- if (parser->is_empty()) {
- e+="/";
- } else {
- depth.push_back(parser->get_node_name());
- }
-
- e+=">";
- txt+=e;
-
- } break;
- case XMLParser::NODE_ELEMENT_END: {
-
- txt+="</"+parser->get_node_name()+">";
- if (depth.size() && depth[depth.size()-1]==parser->get_node_name()) {
- depth.resize(depth.size()-1);
- }
-
-
- } break;
- case XMLParser::NODE_TEXT: {
- if (depth.size()==2 && depth[0]=="qnx" && depth[1]=="id") {
-
- txt+=package;
- } else if (depth.size()==2 && depth[0]=="qnx" && depth[1]=="name") {
-
- String aname;
- if (this->name!="") {
- aname=this->name;
- } else {
- aname = GlobalConfig::get_singleton()->get("application/name");
-
- }
-
- if (aname=="") {
- aname=_MKSTR(VERSION_NAME);
- }
-
- txt+=aname;
-
- } else if (depth.size()==2 && depth[0]=="qnx" && depth[1]=="versionNumber") {
- txt+=itos(version_code);
- } else if (depth.size()==2 && depth[0]=="qnx" && depth[1]=="description") {
- txt+=description;
- } else if (depth.size()==2 && depth[0]=="qnx" && depth[1]=="author") {
- txt+=author_name;
- } else if (depth.size()==2 && depth[0]=="qnx" && depth[1]=="authorId") {
- txt+=author_id;
- } else if (depth.size()==2 && depth[0]=="qnx" && depth[1]=="category") {
- txt+=category;
- } else {
- txt+=parser->get_node_data();
- }
- } break;
- case XMLParser::NODE_COMMENT: {
- txt+="<!--"+parser->get_node_name()+"-->";
- } break;
- case XMLParser::NODE_CDATA: {
- //ignore
- //print_line("cdata");
- } break;
- case XMLParser::NODE_UNKNOWN: {
- //ignore
- txt+="<"+parser->get_node_name()+">";
- } break;
- }
-
- err = parser->read();
- }
-
-
- CharString cs = txt.utf8();
- p_descriptor.resize(cs.length());
- for(int i=0;i<cs.length();i++)
- p_descriptor[i]=cs[i];
-
-}
-
-
-
-Error EditorExportPlatformBB10::export_project(const String& p_path, bool p_debug, int p_flags) {
-
-
- EditorProgress ep("export","Exporting for BlackBerry 10",104);
-
- String src_template=custom_package;
-
- if (src_template=="") {
- String err;
- src_template = find_export_template("bb10.zip", &err);
- if (src_template=="") {
- EditorNode::add_io_error(err);
- return ERR_FILE_NOT_FOUND;
- }
- }
-
- FileAccess *src_f=NULL;
- zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
-
- ep.step("Creating FileSystem for BAR",0);
-
- unzFile pkg = unzOpen2(src_template.utf8().get_data(), &io);
- if (!pkg) {
-
- EditorNode::add_io_error("Could not find template zip to export:\n"+src_template);
- return ERR_FILE_NOT_FOUND;
- }
-
- DirAccessRef da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
- da->change_dir(EditorSettings::get_singleton()->get_settings_path());
-
-
- if (da->change_dir("tmp")!=OK) {
- da->make_dir("tmp");
- if (da->change_dir("tmp")!=OK)
- return ERR_CANT_CREATE;
- }
-
- if (da->change_dir("bb10_export")!=OK) {
- da->make_dir("bb10_export");
- if (da->change_dir("bb10_export")!=OK) {
- return ERR_CANT_CREATE;
- }
- }
-
-
- String bar_dir = da->get_current_dir();
- if (bar_dir.ends_with("/")) {
- bar_dir=bar_dir.substr(0,bar_dir.length()-1);
- }
-
- //THIS IS SUPER, SUPER DANGEROUS!!!!
- //CAREFUL WITH THIS CODE, MIGHT DELETE USERS HARD DRIVE OR HOME DIR
- //EXTRA CHECKS ARE IN PLACE EVERYWERE TO MAKE SURE NOTHING BAD HAPPENS BUT STILL....
- //BE SUPER CAREFUL WITH THIS PLEASE!!!
- //BLACKBERRY THIS IS YOUR FAULT FOR NOT MAKING A BETTER WAY!!
-
- bool berr = bar_dir.ends_with("bb10_export");
- if (berr) {
- if (da->list_dir_begin()) {
- EditorNode::add_io_error("Can't ensure that dir is empty:\n"+bar_dir);
- ERR_FAIL_COND_V(berr,FAILED);
- };
-
- String f = da->get_next();
- while (f != "") {
-
- if (f == "." || f == "..") {
- f = da->get_next();
- continue;
- };
- Error err = da->remove(bar_dir + "/" + f);
- if (err != OK) {
- EditorNode::add_io_error("Can't ensure that dir is empty:\n"+bar_dir);
- ERR_FAIL_COND_V(err!=OK,err);
- };
- f = da->get_next();
- };
-
- da->list_dir_end();
-
- } else {
- print_line("ARE YOU CRAZY??? THIS IS A SERIOUS BUG HERE!!!");
- ERR_FAIL_V(ERR_OMFG_THIS_IS_VERY_VERY_BAD);
- }
-
-
- ERR_FAIL_COND_V(!pkg, ERR_CANT_OPEN);
- int ret = unzGoToFirstFile(pkg);
-
-
-
- while(ret==UNZ_OK) {
-
- //get filename
- unz_file_info info;
- char fname[16384];
- ret = unzGetCurrentFileInfo(pkg,&info,fname,16384,NULL,0,NULL,0);
-
- String file=fname;
-
- Vector<uint8_t> data;
- data.resize(info.uncompressed_size);
-
- //read
- unzOpenCurrentFile(pkg);
- unzReadCurrentFile(pkg,data.ptr(),data.size());
- unzCloseCurrentFile(pkg);
-
- //write
-
- if (file=="bar-descriptor.xml") {
-
- _fix_descriptor(data);
- }
-
- if (file=="icon.png") {
- bool found=false;
-
- if (this->icon!="" && this->icon.ends_with(".png")) {
-
- FileAccess *f = FileAccess::open(this->icon,FileAccess::READ);
- if (f) {
-
- data.resize(f->get_len());
- f->get_buffer(data.ptr(),data.size());
- memdelete(f);
- found=true;
- }
-
- }
-
- if (!found) {
-
- String appicon = GlobalConfig::get_singleton()->get("application/icon");
- if (appicon!="" && appicon.ends_with(".png")) {
- FileAccess*f = FileAccess::open(appicon,FileAccess::READ);
- if (f) {
- data.resize(f->get_len());
- f->get_buffer(data.ptr(),data.size());
- memdelete(f);
- }
- }
- }
- }
-
-
- if (file.find("/")) {
-
- da->make_dir_recursive(file.get_base_dir());
- }
-
- FileAccessRef wf = FileAccess::open(bar_dir.plus_file(file),FileAccess::WRITE);
- wf->store_buffer(data.ptr(),data.size());
-
- ret = unzGoToNextFile(pkg);
- }
-
- ep.step("Adding Files..",2);
-
- FileAccess* dst = FileAccess::open(bar_dir+"/data.pck", FileAccess::WRITE);
- if (!dst) {
- EditorNode::add_io_error("Can't copy executable file to:\n "+p_path);
- return ERR_FILE_CANT_WRITE;
- }
- save_pack(dst, false, 1024);
- dst->close();
- memdelete(dst);
-
- ep.step("Creating BAR Package..",104);
-
- String bb_packager=EditorSettings::get_singleton()->get("export/blackberry/host_tools");
- bb_packager=bb_packager.plus_file("blackberry-nativepackager");
- if (OS::get_singleton()->get_name()=="Windows")
- bb_packager+=".bat";
-
-
- if (!FileAccess::exists(bb_packager)) {
- EditorNode::add_io_error("Can't find packager:\n"+bb_packager);
- return ERR_CANT_OPEN;
- }
-
- List<String> args;
- args.push_back("-package");
- args.push_back(p_path);
- if (p_debug) {
-
- String debug_token=EditorSettings::get_singleton()->get("export/blackberry/debug_token");
- if (!FileAccess::exists(debug_token)) {
- EditorNode::add_io_error("Debug token not found!");
- } else {
- args.push_back("-debugToken");
- args.push_back(debug_token);
- }
- args.push_back("-devMode");
- args.push_back("-configuration");
- args.push_back("Device-Debug");
- } else {
-
- args.push_back("-configuration");
- args.push_back("Device-Release");
- }
- args.push_back(bar_dir.plus_file("bar-descriptor.xml"));
-
- int ec;
-
- Error err = OS::get_singleton()->execute(bb_packager,args,true,NULL,NULL,&ec);
-
- if (err!=OK)
- return err;
- if (ec!=0)
- return ERR_CANT_CREATE;
-
- return OK;
-
-}
-
-bool EditorExportPlatformBB10::poll_devices() {
-
- bool dc=devices_changed;
- devices_changed=false;
- return dc;
-}
-
-int EditorExportPlatformBB10::get_device_count() const {
-
- device_lock->lock();
- int dc=devices.size();
- device_lock->unlock();
-
- return dc;
-
-}
-String EditorExportPlatformBB10::get_device_name(int p_device) const {
-
- ERR_FAIL_INDEX_V(p_device,devices.size(),"");
- device_lock->lock();
- String s=devices[p_device].name;
- device_lock->unlock();
- return s;
-}
-String EditorExportPlatformBB10::get_device_info(int p_device) const {
-
- ERR_FAIL_INDEX_V(p_device,devices.size(),"");
- device_lock->lock();
- String s=devices[p_device].description;
- device_lock->unlock();
- return s;
-}
-
-void EditorExportPlatformBB10::_device_poll_thread(void *ud) {
-
- EditorExportPlatformBB10 *ea=(EditorExportPlatformBB10 *)ud;
-
- while(!ea->quit_request) {
-
- String bb_deploy=EditorSettings::get_singleton()->get("export/blackberry/host_tools");
- bb_deploy=bb_deploy.plus_file("blackberry-deploy");
- bool windows = OS::get_singleton()->get_name()=="Windows";
- if (windows)
- bb_deploy+=".bat";
-
- if (FileAccess::exists(bb_deploy)) {
-
- Vector<Device> devices;
-
-
- for (int i=0;i<MAX_DEVICES;i++) {
-
- String host = EditorSettings::get_singleton()->get("export/blackberry/device_"+itos(i+1)+"/host");
- if (host==String())
- continue;
- String pass = EditorSettings::get_singleton()->get("export/blackberry/device_"+itos(i+1)+"/password");
- if (pass==String())
- continue;
-
- List<String> args;
- args.push_back("-listDeviceInfo");
- args.push_back(host);
- args.push_back("-password");
- args.push_back(pass);
-
-
- int ec;
- String dp;
-
- Error err = OS::get_singleton()->execute(bb_deploy,args,true,NULL,&dp,&ec);
-
- if (err==OK && ec==0) {
-
- Device dev;
- dev.index=i;
- String descr;
- Vector<String> ls=dp.split("\n");
-
- for(int i=0;i<ls.size();i++) {
-
- String l = ls[i].strip_edges();
- if (l.begins_with("modelfullname::")) {
- dev.name=l.get_slice("::",1);
- descr+="Model: "+dev.name+"\n";
- }
- if (l.begins_with("modelnumber::")) {
- String s = l.get_slice("::",1);
- dev.name+=" ("+s+")";
- descr+="Model Number: "+s+"\n";
- }
- if (l.begins_with("scmbundle::"))
- descr+="OS Version: "+l.get_slice("::",1)+"\n";
- if (l.begins_with("[n]debug_token_expiration::"))
- descr+="Debug Token Expires:: "+l.get_slice("::",1)+"\n";
-
- }
-
- dev.description=descr;
- devices.push_back(dev);
- }
-
- }
-
- bool changed=false;
-
-
- ea->device_lock->lock();
-
- if (ea->devices.size()!=devices.size()) {
- changed=true;
- } else {
-
- for(int i=0;i<ea->devices.size();i++) {
-
- if (ea->devices[i].index!=devices[i].index) {
- changed=true;
- break;
- }
- }
- }
-
- if (changed) {
-
- ea->devices=devices;
- ea->devices_changed=true;
- }
-
- ea->device_lock->unlock();
- }
-
-
- uint64_t wait = 3000000;
- uint64_t time = OS::get_singleton()->get_ticks_usec();
- while(OS::get_singleton()->get_ticks_usec() - time < wait ) {
- OS::get_singleton()->delay_usec(1000);
- if (ea->quit_request)
- break;
- }
- }
-
-}
-
-Error EditorExportPlatformBB10::run(int p_device, int p_flags) {
-
- ERR_FAIL_INDEX_V(p_device,devices.size(),ERR_INVALID_PARAMETER);
-
- String bb_deploy=EditorSettings::get_singleton()->get("export/blackberry/host_tools");
- bb_deploy=bb_deploy.plus_file("blackberry-deploy");
- if (OS::get_singleton()->get_name()=="Windows")
- bb_deploy+=".bat";
-
- if (!FileAccess::exists(bb_deploy)) {
- EditorNode::add_io_error("Blackberry Deploy not found:\n"+bb_deploy);
- return ERR_FILE_NOT_FOUND;
- }
-
-
- device_lock->lock();
-
-
- EditorProgress ep("run","Running on "+devices[p_device].name,3);
-
- //export_temp
- ep.step("Exporting APK",0);
-
- String export_to=EditorSettings::get_singleton()->get_settings_path().plus_file("/tmp/tmpexport.bar");
- Error err = export_project(export_to,true,p_flags);
- if (err) {
- device_lock->unlock();
- return err;
- }
-#if 0
- ep.step("Uninstalling..",1);
-
- print_line("Uninstalling previous version: "+devices[p_device].name);
- List<String> args;
- args.push_back("-s");
- args.push_back(devices[p_device].id);
- args.push_back("uninstall");
- args.push_back(package);
- int rv;
- err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv);
-
- if (err || rv!=0) {
- EditorNode::add_io_error("Could not install to device.");
- device_lock->unlock();
- return ERR_CANT_CREATE;
- }
-
- print_line("Installing into device (please wait..): "+devices[p_device].name);
-
-#endif
- ep.step("Installing to Device (please wait..)..",2);
-
- List<String> args;
- args.clear();
- args.push_back("-installApp");
- args.push_back("-launchApp");
- args.push_back("-device");
- String host = EditorSettings::get_singleton()->get("export/blackberry/device_"+itos(p_device+1)+"/host");
- String pass = EditorSettings::get_singleton()->get("export/blackberry/device_"+itos(p_device+1)+"/password");
- args.push_back(host);
- args.push_back("-password");
- args.push_back(pass);
- args.push_back(export_to);
-
- int rv;
- err = OS::get_singleton()->execute(bb_deploy,args,true,NULL,NULL,&rv);
- if (err || rv!=0) {
- EditorNode::add_io_error("Could not install to device.");
- device_lock->unlock();
- return ERR_CANT_CREATE;
- }
-
- device_lock->unlock();
- return OK;
-
-
-}
-
-
-EditorExportPlatformBB10::EditorExportPlatformBB10() {
-
- version_code=1;
- version_name="1.0";
- package="com.godot.noname";
- category="core.games";
- name="";
- author_name="Cert. Name";
- author_id="Cert. ID";
- description="Game made with Godot Engine";
-
- device_lock = Mutex::create();
- quit_request=false;
-
- device_thread=Thread::create(_device_poll_thread,this);
- devices_changed=true;
-
- Image img( _bb10_logo );
- logo = Ref<ImageTexture>( memnew( ImageTexture ));
- logo->create_from_image(img);
-}
-
-bool EditorExportPlatformBB10::can_export(String *r_error) const {
-
- bool valid=true;
- String bb_deploy=EditorSettings::get_singleton()->get("export/blackberry/host_tools");
- String err;
-
- if (!FileAccess::exists(bb_deploy.plus_file("blackberry-deploy"))) {
-
- valid=false;
- err+="Blackberry host tools not configured in editor settings.\n";
- }
-
- if (!exists_export_template("bb10.zip")) {
- valid=false;
- err+="No export template found.\nDownload and install export templates.\n";
- }
-
- String debug_token=EditorSettings::get_singleton()->get("export/blackberry/debug_token");
-
- if (!FileAccess::exists(debug_token)) {
- valid=false;
- err+="No debug token set, will not be able to test on device.\n";
- }
-
-
- if (custom_package!="" && !FileAccess::exists(custom_package)) {
- valid=false;
- err+="Custom release package not found.\n";
- }
-
- if (r_error)
- *r_error=err;
-
- return valid;
-}
-
-
-EditorExportPlatformBB10::~EditorExportPlatformBB10() {
-
- quit_request=true;
- Thread::wait_to_finish(device_thread);
- memdelete(device_lock);
- 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","");
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"export/blackberry/debug_token",PROPERTY_HINT_GLOBAL_FILE,"bar"));
- EDITOR_DEF("export/blackberry/device_1/host","");
- EDITOR_DEF("export/blackberry/device_1/password","");
- EDITOR_DEF("export/blackberry/device_2/host","");
- EDITOR_DEF("export/blackberry/device_2/password","");
- EDITOR_DEF("export/blackberry/device_3/host","");
- EDITOR_DEF("export/blackberry/device_3/password","");
- EDITOR_DEF("export/blackberry/device_4/host","");
- EDITOR_DEF("export/blackberry/device_4/password","");
- EDITOR_DEF("export/blackberry/device_5/host","");
- EDITOR_DEF("export/blackberry/device_5/password","");
-
- Ref<EditorExportPlatformBB10> exporter = Ref<EditorExportPlatformBB10>( memnew(EditorExportPlatformBB10) );
- EditorImportExport::get_singleton()->add_export_platform(exporter);
-
-#endif
-}
diff --git a/platform/bb10/logo.png b/platform/bb10/logo.png
deleted file mode 100644
index abf0d2cc69..0000000000
--- a/platform/bb10/logo.png
+++ /dev/null
Binary files differ
diff --git a/platform/bb10/os_bb10.cpp b/platform/bb10/os_bb10.cpp
deleted file mode 100644
index 80e846d3cd..0000000000
--- a/platform/bb10/os_bb10.cpp
+++ /dev/null
@@ -1,613 +0,0 @@
-/*************************************************************************/
-/* os_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 "os_bb10.h"
-
-#include "bbutil.h"
-#include "core/global_config.h"
-#include "core/os/dir_access.h"
-#include "core/os/keyboard.h"
-#include "drivers/gles2/rasterizer_gles2.h"
-#include "main/main.h"
-#include "servers/visual/visual_server_raster.h"
-
-#include <assert.h>
-#include <bps/accelerometer.h>
-#include <bps/audiodevice.h>
-#include <bps/bps.h>
-#include <bps/navigator.h>
-#include <bps/orientation.h>
-#include <bps/screen.h>
-#include <bps/virtualkeyboard.h>
-#include <stdbool.h>
-#include <stdlib.h>
-
-#ifdef BB10_SCORELOOP_ENABLED
-#include "modules/scoreloop/scoreloop_bb10.h"
-#endif
-
-static char launch_dir[512];
-char *launch_dir_ptr;
-
-int OSBB10::get_video_driver_count() const {
-
- return 1;
-}
-const char *OSBB10::get_video_driver_name(int p_driver) const {
-
- return "GLES2";
-}
-
-OS::VideoMode OSBB10::get_default_video_mode() const {
-
- return OS::VideoMode();
-}
-
-int OSBB10::get_audio_driver_count() const {
-
- return 1;
-}
-const char *OSBB10::get_audio_driver_name(int p_driver) const {
-
- return "BB10";
-}
-
-void OSBB10::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
-
- data_dir = getenv("HOME");
-
- //Create a screen context that will be used to create an EGL surface to to receive libscreen events
- screen_create_context(&screen_cxt, 0);
-
- //Initialize BPS library
- bps_initialize();
-
- //Use utility code to initialize EGL for 2D rendering with GL ES 1.1
- enum RENDERING_API api = GL_ES_2;
-#ifdef BB10_LGLES_OVERRIDE
- api = GL_ES_1;
-#endif
- if (EXIT_SUCCESS != bbutil_init(screen_cxt, api)) {
- bbutil_terminate();
- screen_destroy_context(screen_cxt);
- return;
- };
-
- EGLint surface_width, surface_height;
-
- eglQuerySurface(egl_disp, egl_surf, EGL_WIDTH, &surface_width);
- eglQuerySurface(egl_disp, egl_surf, EGL_HEIGHT, &surface_height);
- printf("screen size: %ix%i\n", surface_width, surface_height);
- VideoMode mode;
- mode.width = surface_width;
- mode.height = surface_height;
- mode.fullscreen = true;
- mode.resizable = false;
- set_video_mode(mode);
-
- //Signal BPS library that navigator and screen events will be requested
- screen_request_events(screen_cxt);
- navigator_request_events(0);
- virtualkeyboard_request_events(0);
- audiodevice_request_events(0);
-
-#ifdef DEBUG_ENABLED
- bps_set_verbosity(3);
-#endif
-
- accel_supported = accelerometer_is_supported();
- if (accel_supported)
- accelerometer_set_update_frequency(FREQ_40_HZ);
- pitch = 0;
- roll = 0;
-
-#ifdef BB10_LGLES_OVERRIDE
- rasterizer = memnew(RasterizerGLES1(false));
-#else
- rasterizer = memnew(RasterizerGLES2(false, false));
-#endif
-
- visual_server = memnew(VisualServerRaster(rasterizer));
- visual_server->init();
- visual_server->cursor_set_visible(false, 0);
-
- audio_driver = memnew(AudioDriverBB10);
- audio_driver->set_singleton();
- audio_driver->init(NULL);
-
- physics_server = memnew(PhysicsServerSW);
- physics_server->init();
- physics_2d_server = memnew(Physics2DServerSW);
- physics_2d_server->init();
-
- input = memnew(InputDefault);
-
- power_manager = memnew(PowerBB10);
-
-#ifdef PAYMENT_SERVICE_ENABLED
- payment_service = memnew(PaymentService);
- Globals::get_singleton()->add_singleton(Globals::Singleton("InAppStore", payment_service));
-#endif
-}
-
-void OSBB10::set_main_loop(MainLoop *p_main_loop) {
-
- input->set_main_loop(p_main_loop);
- main_loop = p_main_loop;
-}
-
-void OSBB10::delete_main_loop() {
-
- memdelete(main_loop);
- main_loop = NULL;
-}
-
-void OSBB10::finalize() {
-
- if (main_loop)
- memdelete(main_loop);
- main_loop = NULL;
-
- /*
- if (debugger_connection_console) {
- memdelete(debugger_connection_console);
- }
- */
-
- visual_server->finish();
- memdelete(visual_server);
- memdelete(rasterizer);
-
- physics_server->finish();
- memdelete(physics_server);
-
- physics_2d_server->finish();
- memdelete(physics_2d_server);
-
-#ifdef PAYMENT_SERVICE_ENABLED
- memdelete(payment_service);
-#endif
-
- memdelete(input);
-
- bbutil_terminate();
- screen_destroy_context(screen_cxt);
-
- bps_shutdown();
-}
-
-void OSBB10::set_mouse_show(bool p_show) {
-
- //android has no mouse...
-}
-
-void OSBB10::set_mouse_grab(bool p_grab) {
-
- //it really has no mouse...!
-}
-
-bool OSBB10::is_mouse_grab_enabled() const {
-
- //*sigh* technology has evolved so much since i was a kid..
- return false;
-}
-Point2 OSBB10::get_mouse_pos() const {
-
- return Point2();
-}
-int OSBB10::get_mouse_button_state() const {
-
- return 0;
-}
-void OSBB10::set_window_title(const String &p_title) {
-}
-
-//interesting byt not yet
-//void set_clipboard(const String& p_text);
-//String get_clipboard() const;
-
-void OSBB10::set_video_mode(const VideoMode &p_video_mode, int p_screen) {
-
- default_videomode = p_video_mode;
-}
-
-OS::VideoMode OSBB10::get_video_mode(int p_screen) const {
-
- return default_videomode;
-}
-void OSBB10::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) const {
-
- p_list->push_back(default_videomode);
-}
-
-String OSBB10::get_name() {
-
- return "BlackBerry 10";
-}
-
-MainLoop *OSBB10::get_main_loop() const {
-
- return main_loop;
-}
-
-bool OSBB10::can_draw() const {
-
- return !minimized;
-}
-
-void OSBB10::set_cursor_shape(CursorShape p_shape) {
-
- //android really really really has no mouse.. how amazing..
-}
-
-void OSBB10::handle_screen_event(bps_event_t *event) {
-
- screen_event_t screen_event = screen_event_get_event(event);
-
- int screen_val;
- screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TYPE, &screen_val);
-
- int pos[2];
-
- switch (screen_val) {
- case SCREEN_EVENT_MTOUCH_TOUCH:
- case SCREEN_EVENT_MTOUCH_RELEASE: {
-
- screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_POSITION, pos);
-
- InputEvent ievent;
- ievent.type = InputEvent::SCREEN_TOUCH;
- ievent.ID = ++last_id;
- ievent.device = 0;
- ievent.screen_touch.pressed = (screen_val == SCREEN_EVENT_MTOUCH_TOUCH);
- ievent.screen_touch.x = pos[0];
- ievent.screen_touch.y = pos[1];
- Point2 mpos(ievent.screen_touch.x, ievent.screen_touch.y);
-
- screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TOUCH_ID, &pos[0]);
- ievent.screen_touch.index = pos[0];
-
- last_touch_x[pos[0]] = ievent.screen_touch.x;
- last_touch_y[pos[0]] = ievent.screen_touch.y;
-
- input->parse_input_event(ievent);
-
- if (ievent.screen_touch.index == 0) {
-
- InputEvent ievent;
- ievent.type = InputEvent::MOUSE_BUTTON;
- ievent.ID = ++last_id;
- ievent.device = 0;
- ievent.mouse_button.pressed = (screen_val == SCREEN_EVENT_MTOUCH_TOUCH);
- ievent.mouse_button.button_index = BUTTON_LEFT;
- ievent.mouse_button.doubleclick = 0;
- ievent.mouse_button.x = ievent.mouse_button.global_x = mpos.x;
- ievent.mouse_button.y = ievent.mouse_button.global_y = mpos.y;
- input->parse_input_event(ievent);
- };
-
- } break;
- case SCREEN_EVENT_MTOUCH_MOVE: {
-
- screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_POSITION, pos);
-
- InputEvent ievent;
- ievent.type = InputEvent::SCREEN_DRAG;
- ievent.ID = ++last_id;
- ievent.device = 0;
- ievent.screen_drag.x = pos[0];
- ievent.screen_drag.y = pos[1];
-
- /*
- screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_SOURCE_POSITION, pos);
- ievent.screen_drag.relative_x = ievent.screen_drag.x - pos[0];
- ievent.screen_drag.relative_y = ievent.screen_drag.y - pos[1];
- */
-
- screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TOUCH_ID, &pos[0]);
- ievent.screen_drag.index = pos[0];
-
- ievent.screen_drag.relative_x = ievent.screen_drag.x - last_touch_x[ievent.screen_drag.index];
- ievent.screen_drag.relative_y = ievent.screen_drag.y - last_touch_y[ievent.screen_drag.index];
-
- last_touch_x[ievent.screen_drag.index] = ievent.screen_drag.x;
- last_touch_y[ievent.screen_drag.index] = ievent.screen_drag.y;
-
- Point2 mpos(ievent.screen_drag.x, ievent.screen_drag.y);
- Point2 mrel(ievent.screen_drag.relative_x, ievent.screen_drag.relative_y);
-
- input->parse_input_event(ievent);
-
- if (ievent.screen_touch.index == 0) {
-
- InputEvent ievent;
- ievent.type = InputEvent::MOUSE_MOTION;
- ievent.ID = ++last_id;
- ievent.device = 0;
- ievent.mouse_motion.x = ievent.mouse_motion.global_x = mpos.x;
- ievent.mouse_motion.y = ievent.mouse_motion.global_y = mpos.y;
- input->set_mouse_pos(Point2(ievent.mouse_motion.x, ievent.mouse_motion.y));
- ievent.mouse_motion.speed_x = input->get_last_mouse_speed().x;
- ievent.mouse_motion.speed_y = input->get_last_mouse_speed().y;
- ievent.mouse_motion.relative_x = mrel.x;
- ievent.mouse_motion.relative_y = mrel.y;
- ievent.mouse_motion.button_mask = 1; // pressed
-
- input->parse_input_event(ievent);
- };
- } break;
-
- case SCREEN_EVENT_KEYBOARD: {
-
- InputEvent ievent;
- ievent.type = InputEvent::KEY;
- ievent.ID = ++last_id;
- ievent.device = 0;
- int val = 0;
- screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_KEY_SCAN, &val);
- ievent.key.scancode = val;
- screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_KEY_SYM, &val);
- ievent.key.unicode = val;
- if (val == 61448) {
- ievent.key.scancode = KEY_BACKSPACE;
- ievent.key.unicode = KEY_BACKSPACE;
- };
- if (val == 61453) {
- ievent.key.scancode = KEY_ENTER;
- ievent.key.unicode = KEY_ENTER;
- };
-
- int flags;
- screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_KEY_FLAGS, &flags);
- ievent.key.pressed = flags & 1; // bit 1 is pressed apparently
-
- int mod;
- screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_KEY_MODIFIERS, &mod);
-
- input->parse_input_event(ievent);
- } break;
-
- default:
- break;
- }
-};
-
-void OSBB10::handle_accelerometer() {
-
- if (!accel_supported)
- return;
-
- if (!fullscreen)
- return;
-
- double force_x, force_y, force_z;
- accelerometer_read_forces(&force_x, &force_y, &force_z);
- Vector3 accel = Vector3(force_x, flip_accelerometer ? force_y : -force_y, force_z);
- input->set_accelerometer(accel);
- // rotate 90 degrees
- //input->set_accelerometer(Vector3(force_y, flip_accelerometer?force_x:(-force_x), force_z));
-};
-
-void OSBB10::_resize(bps_event_t *event) {
-
- int angle = navigator_event_get_orientation_angle(event);
- bbutil_rotate_screen_surface(angle);
-
- EGLint surface_width, surface_height;
- eglQuerySurface(egl_disp, egl_surf, EGL_WIDTH, &surface_width);
- eglQuerySurface(egl_disp, egl_surf, EGL_HEIGHT, &surface_height);
-
- VideoMode mode;
- mode.width = surface_width;
- mode.height = surface_height;
- mode.fullscreen = true;
- mode.resizable = false;
- set_video_mode(mode);
-};
-
-void OSBB10::process_events() {
-
- handle_accelerometer();
-
- bps_event_t *event = NULL;
-
- do {
- int rc = bps_get_event(&event, 0);
- assert(rc == BPS_SUCCESS);
-
- if (!event) break;
-
-#ifdef BB10_SCORELOOP_ENABLED
- ScoreloopBB10 *sc = Globals::get_singleton()->get_singleton_object("Scoreloop")->cast_to<ScoreloopBB10>();
- if (sc->handle_event(event))
- continue;
-#endif
-
-#ifdef PAYMENT_SERVICE_ENABLED
- if (payment_service->handle_event(event))
- continue;
-#endif
-
- int domain = bps_event_get_domain(event);
- if (domain == screen_get_domain()) {
-
- handle_screen_event(event);
-
- } else if (domain == navigator_get_domain()) {
-
- if (NAVIGATOR_EXIT == bps_event_get_code(event)) {
- if (main_loop)
- main_loop->notification(MainLoop::NOTIFICATION_WM_QUIT_REQUEST);
- bps_event_destroy(event);
- exit(0);
- return;
- /*
- } else if (bps_event_get_code(event) == NAVIGATOR_ORIENTATION_CHECK) {
-
- int angle = navigator_event_get_orientation_angle(event);
- navigator_orientation_check_response(event, false);
-
- } else if (bps_event_get_code(event) == NAVIGATOR_ORIENTATION) {
-
- _resize(event);
- */
- } else if (bps_event_get_code(event) == NAVIGATOR_WINDOW_STATE) {
-
- int state = navigator_event_get_window_state(event);
- bool was_fullscreen = fullscreen;
- minimized = state == NAVIGATOR_WINDOW_INVISIBLE;
- fullscreen = state == NAVIGATOR_WINDOW_FULLSCREEN;
- set_low_processor_usage_mode(!fullscreen);
- if (fullscreen != was_fullscreen) {
- if (fullscreen) {
- audio_server->set_fx_global_volume_scale(fullscreen_mixer_volume);
- audio_server->set_stream_global_volume_scale(fullscreen_stream_volume);
- } else {
- fullscreen_mixer_volume = audio_server->get_fx_global_volume_scale();
- fullscreen_stream_volume = audio_server->get_stream_global_volume_scale();
- audio_server->set_fx_global_volume_scale(0);
- audio_server->set_stream_global_volume_scale(0);
- };
- };
- };
- } else if (domain == audiodevice_get_domain()) {
-
- const char *audiodevice_path = audiodevice_event_get_path(event);
- printf("************* got audiodevice event, path %s\n", audiodevice_path);
- audio_driver->finish();
- audio_driver->init(audiodevice_path);
- audio_driver->start();
- };
-
- //bps_event_destroy(event);
- } while (event);
-};
-
-bool OSBB10::has_virtual_keyboard() const {
-
- return true;
-};
-
-void OSBB10::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect) {
-
- virtualkeyboard_show();
-};
-
-void OSBB10::hide_virtual_keyboard() {
-
- virtualkeyboard_hide();
-};
-
-void OSBB10::run() {
-
- if (!main_loop)
- return;
-
- main_loop->init();
-
- int flip = bbutil_is_flipped();
- int rot = bbutil_get_rotation();
- flip_accelerometer = rot == 90;
- printf("**************** rot is %i, flip %i\n", rot, (int)flip_accelerometer);
- /*
- orientation_direction_t orientation;
- int angle;
- orientation_get(&orientation, &angle);
- printf("******************** orientation %i, %i, %i\n", orientation, ORIENTATION_BOTTOM_UP, ORIENTATION_TOP_UP);
- if (orientation == ORIENTATION_BOTTOM_UP) {
- flip_accelerometer = true;
- };
- */
-
- while (true) {
-
- process_events(); // get rid of pending events
- if (Main::iteration() == true)
- break;
- bbutil_swap();
- //#ifdef DEBUG_ENABLED
- fflush(stdout);
- //#endif
- };
-
- main_loop->finish();
-};
-
-bool OSBB10::has_touchscreen_ui_hint() const {
-
- return true;
-}
-
-Error OSBB10::shell_open(String p_uri) {
-
- char *msg = NULL;
- int ret = navigator_invoke(p_uri.utf8().get_data(), &msg);
-
- return ret == BPS_SUCCESS ? OK : FAILED;
-};
-
-String OSBB10::get_data_dir() const {
-
- return data_dir;
-};
-
-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;
- last_id = 1;
- minimized = false;
- fullscreen = true;
- flip_accelerometer = true;
- fullscreen_mixer_volume = 1;
- fullscreen_stream_volume = 1;
-
- printf("godot bb10!\n");
- getcwd(launch_dir, sizeof(launch_dir));
- printf("launch dir %s\n", launch_dir);
- chdir("app/native");
- launch_dir_ptr = launch_dir;
-}
-
-OSBB10::~OSBB10() {
-}
diff --git a/platform/bb10/os_bb10.h b/platform/bb10/os_bb10.h
deleted file mode 100644
index 313f9c9e6b..0000000000
--- a/platform/bb10/os_bb10.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*************************************************************************/
-/* os_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 OS_BB10_H
-#define OS_BB10_H
-
-#include "audio_driver_bb10.h"
-#include "drivers/unix/os_unix.h"
-#include "main/input_default.h"
-#include "os/input.h"
-#include "os/main_loop.h"
-#include "payment_service.h"
-#include "power_bb10.h"
-#include "servers/audio_server.h"
-#include "servers/physics/physics_server_sw.h"
-#include "servers/physics_2d/physics_2d_server_sw.h"
-#include "servers/visual/rasterizer.h"
-
-#include <bps/event.h>
-#include <screen/screen.h>
-#include <stdint.h>
-#include <sys/platform.h>
-
-class OSBB10 : public OS_Unix {
-
- unsigned int last_id;
-
- screen_context_t screen_cxt;
- float fullscreen_mixer_volume;
- float fullscreen_stream_volume;
-
- Rasterizer *rasterizer;
- VisualServer *visual_server;
- PhysicsServer *physics_server;
- Physics2DServer *physics_2d_server;
- AudioDriverBB10 *audio_driver;
- PowerBB10 *power_manager;
-
-#ifdef PAYMENT_SERVICE_ENABLED
- PaymentService *payment_service;
-#endif
-
- VideoMode default_videomode;
- MainLoop *main_loop;
-
- void process_events();
-
- void _resize(bps_event_t *event);
- void handle_screen_event(bps_event_t *event);
- void handle_accelerometer();
-
- int last_touch_x[16];
- int last_touch_y[16];
-
- bool accel_supported;
- float pitch;
- float roll;
-
- bool minimized;
- bool fullscreen;
- bool flip_accelerometer;
- String data_dir;
-
- InputDefault *input;
-
-public:
- // functions used by main to initialize/deintialize the OS
- virtual int get_video_driver_count() const;
- virtual const char *get_video_driver_name(int p_driver) const;
-
- virtual VideoMode get_default_video_mode() const;
-
- virtual String get_data_dir() const;
-
- virtual int get_audio_driver_count() const;
- virtual const char *get_audio_driver_name(int p_driver) const;
-
- virtual void initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver);
-
- virtual void set_main_loop(MainLoop *p_main_loop);
- virtual void delete_main_loop();
-
- virtual void finalize();
-
- typedef int64_t ProcessID;
-
- static OS *get_singleton();
-
- virtual void set_mouse_show(bool p_show);
- virtual void set_mouse_grab(bool p_grab);
- virtual bool is_mouse_grab_enabled() const;
- virtual Point2 get_mouse_pos() const;
- virtual int get_mouse_button_state() const;
- virtual void set_window_title(const String &p_title);
-
- //virtual void set_clipboard(const String& p_text);
- //virtual String get_clipboard() const;
-
- virtual bool has_virtual_keyboard() const;
- virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect);
- virtual void hide_virtual_keyboard();
-
- virtual void set_video_mode(const VideoMode &p_video_mode, int p_screen = 0);
- 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 Size2 get_window_size() const;
- virtual String get_name();
- virtual MainLoop *get_main_loop() const;
-
- virtual bool can_draw() const;
-
- virtual void set_cursor_shape(CursorShape p_shape);
-
- virtual bool has_touchscreen_ui_hint() const;
-
- virtual Error shell_open(String p_uri);
-
- void run();
-
- virtual PowerState get_power_state();
- virtual int get_power_seconds_left();
- virtual int get_power_percent_left();
-
- OSBB10();
- ~OSBB10();
-};
-
-#endif
diff --git a/platform/bb10/payment_service.cpp b/platform/bb10/payment_service.cpp
deleted file mode 100644
index e78326e8b1..0000000000
--- a/platform/bb10/payment_service.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/*************************************************************************/
-/* payment_service.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 PAYMENT_SERVICE_ENABLED
-
-#include "payment_service.h"
-
-#include "bbutil.h"
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-extern char *launch_dir_ptr;
-
-void PaymentService::_bind_methods() {
-
- ClassDB::bind_method(D_METHOD("request_product_info"), &PaymentService::request_product_info);
- ClassDB::bind_method(D_METHOD("purchase"), &PaymentService::purchase);
-
- 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) {
-
- return ERR_UNAVAILABLE;
-};
-
-Error PaymentService::purchase(Variant p_params) {
-
- Dictionary params = p_params;
- ERR_FAIL_COND_V((!params.has("product_id")) && (!params.has("product_sku")), ERR_INVALID_PARAMETER);
-
- char *id = NULL;
- char *sku = NULL;
-
- CharString p_id = params.has("product_id") ? String(params["product_id"]).ascii() : CharString();
- CharString p_sku = params.has("product_sku") ? String(params["product_sku"]).ascii() : CharString();
- unsigned int request_id;
- chdir(launch_dir_ptr);
- int ret = paymentservice_purchase_request(params.has("product_sku") ? NULL : p_id.get_data(),
- params.has("product_sku") ? p_sku.get_data() : NULL,
- NULL, NULL, NULL, NULL, get_window_group_id(), &request_id);
- chdir("app/native");
-
- if (ret != BPS_SUCCESS) {
- int eret = errno;
- printf("purchase error %i, %x, %i, %x\n", ret, ret, eret, eret);
- ERR_FAIL_V((Error)eret);
- return (Error)eret;
- };
- return OK;
-};
-
-bool PaymentService::handle_event(bps_event_t *p_event) {
-
- if (bps_event_get_domain(p_event) != paymentservice_get_domain()) {
- return false;
- };
-
- Dictionary dict;
- int res = paymentservice_event_get_response_code(p_event);
- if (res == SUCCESS_RESPONSE) {
- dict["result"] = "ok";
-
- res = bps_event_get_code(p_event);
- if (res == PURCHASE_RESPONSE) {
- dict["type"] = "purchase";
- const char *pid = paymentservice_event_get_digital_good_id(p_event, 0);
- dict["product_id"] = String(pid ? pid : "");
- };
-
- } else {
- const char *desc = paymentservice_event_get_error_text(p_event);
- if (strcmp(desc, "alreadyPurchased") == 0) {
- dict["result"] = "ok";
- } else {
- dict["result"] = "error";
- dict["error_description"] = paymentservice_event_get_error_text(p_event);
- dict["error_code"] = paymentservice_event_get_error_id(p_event);
- printf("error code is %i\n", paymentservice_event_get_error_id(p_event));
- printf("error description is %s\n", paymentservice_event_get_error_text(p_event));
- };
- dict["product_id"] = "";
- };
-
- res = bps_event_get_code(p_event);
- if (res == PURCHASE_RESPONSE) {
- dict["type"] = "purchase";
- };
-
- printf("********** adding event with result %ls\n", String(dict["result"]).c_str());
- pending_events.push_back(dict);
-
- return true;
-};
-
-int PaymentService::get_pending_event_count() {
- return pending_events.size();
-};
-
-Variant PaymentService::pop_pending_event() {
-
- Variant front = pending_events.front()->get();
- pending_events.pop_front();
-
- return front;
-};
-
-PaymentService::PaymentService() {
-
- paymentservice_request_events(0);
-#ifdef DEBUG_ENABLED
- paymentservice_set_connection_mode(true);
-#else
- paymentservice_set_connection_mode(false);
-#endif
-};
-
-PaymentService::~PaymentService(){
-
-};
-
-#endif
diff --git a/platform/bb10/platform_config.h b/platform/bb10/platform_config.h
deleted file mode 100644
index cdef185ff0..0000000000
--- a/platform/bb10/platform_config.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*************************************************************************/
-/* platform_config.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 <alloca.h>
diff --git a/platform/haiku/audio_driver_media_kit.cpp b/platform/haiku/audio_driver_media_kit.cpp
index 0f969d25ab..93351e0799 100644
--- a/platform/haiku/audio_driver_media_kit.cpp
+++ b/platform/haiku/audio_driver_media_kit.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,7 +31,7 @@
#ifdef MEDIA_KIT_ENABLED
-#include "global_config.h"
+#include "project_settings.h"
int32_t *AudioDriverMediaKit::samples_in = NULL;
diff --git a/platform/haiku/audio_driver_media_kit.h b/platform/haiku/audio_driver_media_kit.h
index e9282c8471..2cceb279e8 100644
--- a/platform/haiku/audio_driver_media_kit.h
+++ b/platform/haiku/audio_driver_media_kit.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/haiku/context_gl_haiku.cpp b/platform/haiku/context_gl_haiku.cpp
index f345928005..eb5e60152f 100644
--- a/platform/haiku/context_gl_haiku.cpp
+++ b/platform/haiku/context_gl_haiku.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/haiku/context_gl_haiku.h b/platform/haiku/context_gl_haiku.h
index c0030fad41..074b4bf0d1 100644
--- a/platform/haiku/context_gl_haiku.h
+++ b/platform/haiku/context_gl_haiku.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py
index 71202a9a49..c0e003a3d2 100644
--- a/platform/haiku/detect.py
+++ b/platform/haiku/detect.py
@@ -11,57 +11,58 @@ def get_name():
def can_build():
- if (os.name != "posix"):
- return False
- if (sys.platform == "darwin"):
+ if (os.name != "posix" or sys.platform == "darwin"):
return False
return True
def get_opts():
+
return [
('debug_release', 'Add debug symbols to release version', 'no')
]
def get_flags():
+
return [
]
def configure(env):
- is64 = sys.maxsize > 2**32
-
- if (env["bits"] == "default"):
- if (is64):
- env["bits"] = "64"
- else:
- env["bits"] = "32"
-
- env.Append(CPPPATH=['#platform/haiku'])
- env["CC"] = "gcc-x86"
- env["CXX"] = "g++-x86"
+ ## Build type
if (env["target"] == "release"):
if (env["debug_release"] == "yes"):
- env.Append(CCFLAGS=['-g2'])
+ env.Prepend(CCFLAGS=['-g2'])
else:
- env.Append(CCFLAGS=['-O3', '-ffast-math'])
+ env.Prepend(CCFLAGS=['-O3', '-ffast-math'])
+
elif (env["target"] == "release_debug"):
- env.Append(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
+ env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
+
elif (env["target"] == "debug"):
- env.Append(CCFLAGS=['-g2', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+ env.Prepend(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+
+ ## Architecture
+
+ is64 = sys.maxsize > 2**32
+ if (env["bits"] == "default"):
+ env["bits"] = "64" if is64 else "32"
+
+ ## Compiler configuration
+ env["CC"] = "gcc-x86"
+ env["CXX"] = "g++-x86"
+
+ ## Flags
+
+ env.Append(CPPPATH=['#platform/haiku'])
+ env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
+ env.Append(CPPFLAGS=['-DMEDIA_KIT_ENABLED'])
# env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
- env.Append(CPPFLAGS=['-DOPENGL_ENABLED', '-DMEDIA_KIT_ENABLED'])
- env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
env.Append(LIBS=['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL'])
-
- import methods
- env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')})
diff --git a/platform/haiku/godot_haiku.cpp b/platform/haiku/godot_haiku.cpp
index 47cfbe55d7..3a8206d9d5 100644
--- a/platform/haiku/godot_haiku.cpp
+++ b/platform/haiku/godot_haiku.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/haiku/haiku_application.cpp b/platform/haiku/haiku_application.cpp
index f675d4216d..1f0c9fdcbf 100644
--- a/platform/haiku/haiku_application.cpp
+++ b/platform/haiku/haiku_application.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/haiku/haiku_application.h b/platform/haiku/haiku_application.h
index 7fbce5dcbc..6e690d4ab8 100644
--- a/platform/haiku/haiku_application.h
+++ b/platform/haiku/haiku_application.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/haiku/haiku_direct_window.cpp b/platform/haiku/haiku_direct_window.cpp
index 3ed7a84eb5..4a9f8c780d 100644
--- a/platform/haiku/haiku_direct_window.cpp
+++ b/platform/haiku/haiku_direct_window.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -150,36 +151,35 @@ void HaikuDirectWindow::HandleMouseButton(BMessage *message) {
}
*/
- InputEvent mouse_event;
- mouse_event.ID = ++event_id;
- mouse_event.type = InputEvent::MOUSE_BUTTON;
+ Ref<InputEvent> mouse_event;
+ mouse_event.type = Ref<InputEvent>::MOUSE_BUTTON;
mouse_event.device = 0;
mouse_event.mouse_button.mod = GetKeyModifierState(modifiers);
- mouse_event.mouse_button.button_mask = GetMouseButtonState(buttons);
- mouse_event.mouse_button.x = where.x;
- mouse_event.mouse_button.y = where.y;
+ mouse_event->get_button_mask() = GetMouseButtonState(buttons);
+ mouse_event->get_pos().x = where.x;
+ mouse_event->get_pos().y = where.y;
mouse_event.mouse_button.global_x = where.x;
mouse_event.mouse_button.global_y = where.y;
switch (button) {
default:
case B_PRIMARY_MOUSE_BUTTON:
- mouse_event.mouse_button.button_index = 1;
+ mouse_event->get_button_index() = 1;
break;
case B_SECONDARY_MOUSE_BUTTON:
- mouse_event.mouse_button.button_index = 2;
+ mouse_event->get_button_index() = 2;
break;
case B_TERTIARY_MOUSE_BUTTON:
- mouse_event.mouse_button.button_index = 3;
+ mouse_event->get_button_index() = 3;
break;
}
- mouse_event.mouse_button.pressed = (message->what == B_MOUSE_DOWN);
+ mouse_event->is_pressed() = (message->what == B_MOUSE_DOWN);
- if (message->what == B_MOUSE_DOWN && mouse_event.mouse_button.button_index == 1) {
+ if (message->what == B_MOUSE_DOWN && mouse_event->get_button_index() == 1) {
int32 clicks = message->FindInt32("clicks");
if (clicks > 1) {
@@ -207,23 +207,22 @@ void HaikuDirectWindow::HandleMouseMoved(BMessage *message) {
Point2i rel = pos - last_mouse_position;
- InputEvent motion_event;
- motion_event.ID = ++event_id;
- motion_event.type = InputEvent::MOUSE_MOTION;
+ Ref<InputEvent> motion_event;
+ motion_event.type = Ref<InputEvent>::MOUSE_MOTION;
motion_event.device = 0;
motion_event.mouse_motion.mod = GetKeyModifierState(modifiers);
- motion_event.mouse_motion.button_mask = GetMouseButtonState(buttons);
+ motion_event->get_button_mask() = GetMouseButtonState(buttons);
motion_event.mouse_motion.x = pos.x;
motion_event.mouse_motion.y = pos.y;
- input->set_mouse_pos(pos);
+ input->set_mouse_position(pos);
motion_event.mouse_motion.global_x = pos.x;
motion_event.mouse_motion.global_y = pos.y;
motion_event.mouse_motion.speed_x = input->get_last_mouse_speed().x;
motion_event.mouse_motion.speed_y = input->get_last_mouse_speed().y;
- motion_event.mouse_motion.relative_x = rel.x;
- motion_event.mouse_motion.relative_y = rel.y;
+ motion_event->get_relative().x = rel.x;
+ motion_event->get_relative().y = rel.y;
last_mouse_position = pos;
@@ -236,24 +235,22 @@ void HaikuDirectWindow::HandleMouseWheelChanged(BMessage *message) {
return;
}
- InputEvent mouse_event;
- mouse_event.ID = ++event_id;
- mouse_event.type = InputEvent::MOUSE_BUTTON;
+ Ref<InputEvent> mouse_event;
+ mouse_event.type = Ref<InputEvent>::MOUSE_BUTTON;
mouse_event.device = 0;
- mouse_event.mouse_button.button_index = wheel_delta_y < 0 ? 4 : 5;
+ mouse_event->get_button_index() = wheel_delta_y < 0 ? 4 : 5;
mouse_event.mouse_button.mod = GetKeyModifierState(last_key_modifier_state);
- mouse_event.mouse_button.button_mask = last_button_mask;
- mouse_event.mouse_button.x = last_mouse_position.x;
- mouse_event.mouse_button.y = last_mouse_position.y;
+ mouse_event->get_button_mask() = last_button_mask;
+ mouse_event->get_pos().x = last_mouse_position.x;
+ mouse_event->get_pos().y = last_mouse_position.y;
mouse_event.mouse_button.global_x = last_mouse_position.x;
mouse_event.mouse_button.global_y = last_mouse_position.y;
- mouse_event.mouse_button.pressed = true;
+ mouse_event->is_pressed() = true;
input->parse_input_event(mouse_event);
- mouse_event.ID = ++event_id;
- mouse_event.mouse_button.pressed = false;
+ mouse_event->is_pressed() = false;
input->parse_input_event(mouse_event);
}
@@ -274,14 +271,13 @@ void HaikuDirectWindow::HandleKeyboardEvent(BMessage *message) {
return;
}
- InputEvent event;
- event.ID = ++event_id;
- event.type = InputEvent::KEY;
+ Ref<InputEvent> event;
+ event.type = Ref<InputEvent>::KEY;
event.device = 0;
event.key.mod = GetKeyModifierState(modifiers);
- event.key.pressed = (message->what == B_KEY_DOWN);
- event.key.scancode = KeyMappingHaiku::get_keysym(raw_char, key);
- event.key.echo = message->HasInt32("be:key_repeat");
+ event->is_pressed() = (message->what == B_KEY_DOWN);
+ event->get_scancode() = KeyMappingHaiku::get_keysym(raw_char, key);
+ event->is_echo() = message->HasInt32("be:key_repeat");
event.key.unicode = 0;
const char *bytes = NULL;
@@ -290,9 +286,9 @@ void HaikuDirectWindow::HandleKeyboardEvent(BMessage *message) {
}
//make it consistent across platforms.
- if (event.key.scancode == KEY_BACKTAB) {
- event.key.scancode = KEY_TAB;
- event.key.mod.shift = true;
+ if (event->get_scancode() == KEY_BACKTAB) {
+ event->get_scancode() = KEY_TAB;
+ event->get_shift() = true;
}
input->parse_input_event(event);
@@ -312,14 +308,13 @@ void HaikuDirectWindow::HandleKeyboardModifierEvent(BMessage *message) {
int32 key = old_modifiers ^ modifiers;
- InputEvent event;
- event.ID = ++event_id;
- event.type = InputEvent::KEY;
+ Ref<InputEvent> event;
+ event.type = Ref<InputEvent>::KEY;
event.device = 0;
event.key.mod = GetKeyModifierState(modifiers);
- event.key.pressed = ((modifiers & key) != 0);
- event.key.scancode = KeyMappingHaiku::get_modifier_keysym(key);
- event.key.echo = false;
+ event->is_pressed() = ((modifiers & key) != 0);
+ event->get_scancode() = KeyMappingHaiku::get_modifier_keysym(key);
+ event->is_echo() = false;
event.key.unicode = 0;
input->parse_input_event(event);
diff --git a/platform/haiku/haiku_direct_window.h b/platform/haiku/haiku_direct_window.h
index 7fcea7a6f6..3671c3c9cb 100644
--- a/platform/haiku/haiku_direct_window.h
+++ b/platform/haiku/haiku_direct_window.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,7 +44,6 @@
class HaikuDirectWindow : public BDirectWindow {
private:
- unsigned int event_id;
Point2i last_mouse_position;
bool last_mouse_pos_valid;
uint32 last_buttons_state;
diff --git a/platform/haiku/haiku_gl_view.cpp b/platform/haiku/haiku_gl_view.cpp
index ded15e12a7..dd568f281e 100644
--- a/platform/haiku/haiku_gl_view.cpp
+++ b/platform/haiku/haiku_gl_view.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/haiku/haiku_gl_view.h b/platform/haiku/haiku_gl_view.h
index f06bc64794..14e2889d6c 100644
--- a/platform/haiku/haiku_gl_view.h
+++ b/platform/haiku/haiku_gl_view.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/haiku/key_mapping_haiku.cpp b/platform/haiku/key_mapping_haiku.cpp
index 1bc3467914..3db31fa3e4 100644
--- a/platform/haiku/key_mapping_haiku.cpp
+++ b/platform/haiku/key_mapping_haiku.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -82,7 +83,7 @@ static _HaikuTranslatePair _fn_to_keycode[] = {
static _HaikuTranslatePair _hb_to_keycode[] = {
{ KEY_BACKSPACE, B_BACKSPACE },
{ KEY_TAB, B_TAB },
- { KEY_RETURN, B_RETURN },
+ { KEY_ENTER, B_RETURN },
{ KEY_CAPSLOCK, B_CAPS_LOCK },
{ KEY_ESCAPE, B_ESCAPE },
{ KEY_SPACE, B_SPACE },
diff --git a/platform/haiku/key_mapping_haiku.h b/platform/haiku/key_mapping_haiku.h
index 0f2e2e64bd..8d09203737 100644
--- a/platform/haiku/key_mapping_haiku.h
+++ b/platform/haiku/key_mapping_haiku.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp
index 0853fac393..e897d4c385 100644
--- a/platform/haiku/os_haiku.cpp
+++ b/platform/haiku/os_haiku.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -206,7 +207,7 @@ void OS_Haiku::swap_buffers() {
context_gl->swap_buffers();
}
-Point2 OS_Haiku::get_mouse_pos() const {
+Point2 OS_Haiku::get_mouse_position() const {
return window->GetLastMousePosition();
}
@@ -330,3 +331,8 @@ void OS_Haiku::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) c
String OS_Haiku::get_executable_path() const {
return OS::get_executable_path();
}
+
+bool OS_Haiku::_check_internal_feature_support(const String &p_feature) {
+
+ return p_feature == "pc" || p_feature == "s3tc";
+}
diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h
index 827814c7e9..256c9eecf7 100644
--- a/platform/haiku/os_haiku.h
+++ b/platform/haiku/os_haiku.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -88,7 +89,7 @@ public:
virtual void make_rendering_thread();
virtual void swap_buffers();
- virtual Point2 get_mouse_pos() const;
+ virtual Point2 get_mouse_position() const;
virtual int get_mouse_button_state() const;
virtual void set_cursor_shape(CursorShape p_shape);
@@ -119,6 +120,8 @@ public:
virtual PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
+
+ virtual bool _check_internal_feature_support(const String &p_feature);
};
#endif
diff --git a/platform/haiku/platform_config.h b/platform/haiku/platform_config.h
index a3aa918ba8..e59b9bac80 100644
--- a/platform/haiku/platform_config.h
+++ b/platform/haiku/platform_config.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/haiku/power_haiku.cpp b/platform/haiku/power_haiku.cpp
index d70aad9d5f..b0d01df982 100644
--- a/platform/haiku/power_haiku.cpp
+++ b/platform/haiku/power_haiku.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/haiku/power_haiku.h b/platform/haiku/power_haiku.h
index 8e7b050cd6..711ad86a02 100644
--- a/platform/haiku/power_haiku.h
+++ b/platform/haiku/power_haiku.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub
index 5d3267cff3..998d0a3f0d 100644
--- a/platform/iphone/SCsub
+++ b/platform/iphone/SCsub
@@ -5,7 +5,6 @@ Import('env')
iphone_lib = [
'os_iphone.cpp',
- #'rasterizer_iphone.cpp',
'audio_driver_iphone.cpp',
'sem_iphone.cpp',
'gl_view.mm',
@@ -18,17 +17,8 @@ iphone_lib = [
'ios.mm',
]
-# env.Depends('#core/math/vector3.h', 'vector3_psp.h')
-
-#iphone_lib = env.Library('iphone', iphone_lib)
-
env_ios = env.Clone()
-
-if env['ios_gles22_override'] == "yes":
- env_ios.Append(CPPFLAGS=['-DGLES2_OVERRIDE'])
-
-
obj = env_ios.Object('godot_iphone.cpp')
prog = None
diff --git a/platform/iphone/app_delegate.h b/platform/iphone/app_delegate.h
index eaa74946ee..f357427144 100644
--- a/platform/iphone/app_delegate.h
+++ b/platform/iphone/app_delegate.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm
index e82649692c..362cfd1478 100644
--- a/platform/iphone/app_delegate.mm
+++ b/platform/iphone/app_delegate.mm
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,11 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#import "app_delegate.h"
-#import "gl_view.h"
-#include "os_iphone.h"
-#include "core/global_config.h"
+#include "audio_driver_iphone.h"
+#include "core/project_settings.h"
+#import "gl_view.h"
#include "main/main.h"
+#include "os_iphone.h"
#ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED
#include "modules/FacebookScorer_ios/FacebookScorer.h"
@@ -44,24 +46,26 @@
#endif
#ifdef MODULE_PARSE_ENABLED
-#import <Parse/Parse.h>
#import "FBSDKCoreKit/FBSDKCoreKit.h"
+#import <Parse/Parse.h>
#endif
-#define kFilteringFactor 0.1
-#define kRenderingFrequency 60
-#define kAccelerometerFrequency 100.0 // Hz
+#import "GameController/GameController.h"
+
+#define kFilteringFactor 0.1
+#define kRenderingFrequency 60
+#define kAccelerometerFrequency 100.0 // Hz
Error _shell_open(String);
void _set_keep_screen_on(bool p_enabled);
Error _shell_open(String p_uri) {
- NSString* url = [[NSString alloc] initWithUTF8String:p_uri.utf8().get_data()];
+ NSString *url = [[NSString alloc] initWithUTF8String:p_uri.utf8().get_data()];
- if (![[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:url]])
- return ERR_CANT_OPEN;
+ if (![[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:url]])
+ return ERR_CANT_OPEN;
- printf("opening url %ls\n", p_uri.c_str());
+ printf("opening url %ls\n", p_uri.c_str());
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
[url release];
return OK;
@@ -76,325 +80,664 @@ void _set_keep_screen_on(bool p_enabled) {
@synthesize window;
extern int gargc;
-extern char** gargv;
-extern int iphone_main(int, int, int, char**);
+extern char **gargv;
+extern int iphone_main(int, int, int, char **);
extern void iphone_finish();
CMMotionManager *motionManager;
-bool motionInitialised;
+bool motionInitialised;
-static ViewController* mainViewController = nil;
-+ (ViewController*) getViewController
-{
+static ViewController *mainViewController = nil;
++ (ViewController *)getViewController {
return mainViewController;
}
-static int frame_count = 0;
-- (void)drawView:(GLView*)view; {
+NSMutableDictionary *ios_joysticks = nil;
+
+- (GCControllerPlayerIndex)getFreePlayerIndex {
+ bool have_player_1 = false;
+ bool have_player_2 = false;
+ bool have_player_3 = false;
+ bool have_player_4 = false;
+
+ if (ios_joysticks == nil) {
+ NSArray *keys = [ios_joysticks allKeys];
+ for (NSNumber *key in keys) {
+ GCController *controller = [ios_joysticks objectForKey:key];
+ if (controller.playerIndex == GCControllerPlayerIndex1) {
+ have_player_1 = true;
+ } else if (controller.playerIndex == GCControllerPlayerIndex2) {
+ have_player_2 = true;
+ } else if (controller.playerIndex == GCControllerPlayerIndex3) {
+ have_player_3 = true;
+ } else if (controller.playerIndex == GCControllerPlayerIndex4) {
+ have_player_4 = true;
+ };
+ };
+ };
- switch (frame_count) {
+ if (!have_player_1) {
+ return GCControllerPlayerIndex1;
+ } else if (!have_player_2) {
+ return GCControllerPlayerIndex2;
+ } else if (!have_player_3) {
+ return GCControllerPlayerIndex3;
+ } else if (!have_player_4) {
+ return GCControllerPlayerIndex4;
+ } else {
+ return GCControllerPlayerIndexUnset;
+ };
+};
- case 0: {
- int backingWidth;
- int backingHeight;
- glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
- glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
+- (void)controllerWasConnected:(NSNotification *)notification {
+ // create our dictionary if we don't have one yet
+ if (ios_joysticks == nil) {
+ ios_joysticks = [[NSMutableDictionary alloc] init];
+ };
+ // get our controller
+ GCController *controller = (GCController *)notification.object;
+ if (controller == nil) {
+ printf("Couldn't retrieve new controller\n");
+ } else if ([[ios_joysticks allKeysForObject:controller] count] != 0) {
+ printf("Controller is already registered\n");
+ } else {
+ // get a new id for our controller
+ int joy_id = OSIPhone::get_singleton()->get_unused_joy_id();
+ if (joy_id != -1) {
+ // assign our player index
+ if (controller.playerIndex == GCControllerPlayerIndexUnset) {
+ controller.playerIndex = [self getFreePlayerIndex];
+ };
- OS::VideoMode vm;
- vm.fullscreen = true;
- vm.width = backingWidth;
- vm.height = backingHeight;
- vm.resizable = false;
- OS::get_singleton()->set_video_mode(vm);
+ // tell Godot about our new controller
+ OSIPhone::get_singleton()->joy_connection_changed(
+ joy_id, true, [controller.vendorName UTF8String]);
- if (!OS::get_singleton()) {
- exit(0);
+ // add it to our dictionary, this will retain our controllers
+ [ios_joysticks setObject:controller
+ forKey:[NSNumber numberWithInt:joy_id]];
+
+ // set our input handler
+ [self setControllerInputHandler:controller];
+ } else {
+ printf("Couldn't retrieve new joy id\n");
};
- ++frame_count;
-
- NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
- NSString *documentsDirectory = [paths objectAtIndex:0];
- //NSString *documentsDirectory = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
- OSIPhone::get_singleton()->set_data_dir(String::utf8([documentsDirectory UTF8String]));
-
- NSString *locale_code = [[[NSLocale preferredLanguages] objectAtIndex:0] substringToIndex:2];
- OSIPhone::get_singleton()->set_locale(String::utf8([locale_code UTF8String]));
-
- NSString* uuid;
- if ([[UIDevice currentDevice]respondsToSelector:@selector(identifierForVendor)]) {
- uuid = [UIDevice currentDevice].identifierForVendor.UUIDString;
- }else{
-
- // before iOS 6, so just generate an identifier and store it
- uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"identiferForVendor"];
- if( !uuid ) {
- CFUUIDRef cfuuid = CFUUIDCreate(NULL);
- uuid = (__bridge_transfer NSString*)CFUUIDCreateString(NULL, cfuuid);
- CFRelease(cfuuid);
- [[NSUserDefaults standardUserDefaults] setObject:uuid forKey:@"identifierForVendor"];
- }
- }
+ };
+};
- OSIPhone::get_singleton()->set_unique_ID(String::utf8([uuid UTF8String]));
+- (void)controllerWasDisconnected:(NSNotification *)notification {
+ if (ios_joysticks != nil) {
+ // find our joystick, there should be only one in our dictionary
+ GCController *controller = (GCController *)notification.object;
+ NSArray *keys = [ios_joysticks allKeysForObject:controller];
+ for (NSNumber *key in keys) {
+ // tell Godot this joystick is no longer there
+ int joy_id = [key intValue];
+ OSIPhone::get_singleton()->joy_connection_changed(joy_id, false, "");
+
+ // and remove it from our dictionary
+ [ios_joysticks removeObjectForKey:key];
+ };
+ };
+};
- }; break;
-/*
- case 1: {
- ++frame_count;
- } break;
-*/
- case 1: {
+- (int)getJoyIdForController:(GCController *)controller {
+ if (ios_joysticks != nil) {
+ // find our joystick, there should be only one in our dictionary
+ NSArray *keys = [ios_joysticks allKeysForObject:controller];
+ for (NSNumber *key in keys) {
+ int joy_id = [key intValue];
+ return joy_id;
+ };
+ };
- Main::setup2();
- ++frame_count;
+ return -1;
+};
- // this might be necessary before here
- NSDictionary* dict = [[NSBundle mainBundle] infoDictionary];
- for (NSString* key in dict) {
- NSObject* value = [dict objectForKey:key];
- String ukey = String::utf8([key UTF8String]);
+- (void)setControllerInputHandler:(GCController *)controller {
+ // Hook in the callback handler for the correct gamepad profile.
+ // This is a bit of a weird design choice on Apples part.
+ // You need to select the most capable gamepad profile for the
+ // gamepad attached.
+ if (controller.extendedGamepad != nil) {
+ // The extended gamepad profile has all the input you could possibly find on
+ // a gamepad but will only be active if your gamepad actually has all of
+ // these...
+ controller.extendedGamepad.valueChangedHandler = ^(
+ GCExtendedGamepad *gamepad, GCControllerElement *element) {
+ int joy_id = [self getJoyIdForController:controller];
+
+ if (element == gamepad.buttonA) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_0,
+ gamepad.buttonA.isPressed);
+ } else if (element == gamepad.buttonB) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_1,
+ gamepad.buttonB.isPressed);
+ } else if (element == gamepad.buttonX) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_2,
+ gamepad.buttonX.isPressed);
+ } else if (element == gamepad.buttonY) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_3,
+ gamepad.buttonY.isPressed);
+ } else if (element == gamepad.leftShoulder) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_L,
+ gamepad.leftShoulder.isPressed);
+ } else if (element == gamepad.rightShoulder) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_R,
+ gamepad.rightShoulder.isPressed);
+ } else if (element == gamepad.leftTrigger) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_L2,
+ gamepad.leftTrigger.isPressed);
+ } else if (element == gamepad.rightTrigger) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_R2,
+ gamepad.rightTrigger.isPressed);
+ } else if (element == gamepad.dpad) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_UP,
+ gamepad.dpad.up.isPressed);
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_DOWN,
+ gamepad.dpad.down.isPressed);
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_LEFT,
+ gamepad.dpad.left.isPressed);
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_RIGHT,
+ gamepad.dpad.right.isPressed);
+ };
- // we need a NSObject to Variant conversor
+ InputDefault::JoyAxis jx;
+ jx.min = -1;
+ if (element == gamepad.leftThumbstick) {
+ jx.value = gamepad.leftThumbstick.xAxis.value;
+ OSIPhone::get_singleton()->joy_axis(joy_id, JOY_ANALOG_LX, jx);
+ jx.value = -gamepad.leftThumbstick.yAxis.value;
+ OSIPhone::get_singleton()->joy_axis(joy_id, JOY_ANALOG_LY, jx);
+ } else if (element == gamepad.rightThumbstick) {
+ jx.value = gamepad.rightThumbstick.xAxis.value;
+ OSIPhone::get_singleton()->joy_axis(joy_id, JOY_ANALOG_RX, jx);
+ jx.value = -gamepad.rightThumbstick.yAxis.value;
+ OSIPhone::get_singleton()->joy_axis(joy_id, JOY_ANALOG_RY, jx);
+ } else if (element == gamepad.leftTrigger) {
+ jx.value = gamepad.leftTrigger.value;
+ OSIPhone::get_singleton()->joy_axis(joy_id, JOY_ANALOG_L2, jx);
+ } else if (element == gamepad.rightTrigger) {
+ jx.value = gamepad.rightTrigger.value;
+ OSIPhone::get_singleton()->joy_axis(joy_id, JOY_ANALOG_R2, jx);
+ };
+ };
+ } else if (controller.gamepad != nil) {
+ // gamepad is the standard profile with 4 buttons, shoulder buttons and a
+ // D-pad
+ controller.gamepad.valueChangedHandler = ^(GCGamepad *gamepad,
+ GCControllerElement *element) {
+ int joy_id = [self getJoyIdForController:controller];
+
+ if (element == gamepad.buttonA) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_0,
+ gamepad.buttonA.isPressed);
+ } else if (element == gamepad.buttonB) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_1,
+ gamepad.buttonB.isPressed);
+ } else if (element == gamepad.buttonX) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_2,
+ gamepad.buttonX.isPressed);
+ } else if (element == gamepad.buttonY) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_3,
+ gamepad.buttonY.isPressed);
+ } else if (element == gamepad.leftShoulder) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_L,
+ gamepad.leftShoulder.isPressed);
+ } else if (element == gamepad.rightShoulder) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_R,
+ gamepad.rightShoulder.isPressed);
+ } else if (element == gamepad.dpad) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_UP,
+ gamepad.dpad.up.isPressed);
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_DOWN,
+ gamepad.dpad.down.isPressed);
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_LEFT,
+ gamepad.dpad.left.isPressed);
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_RIGHT,
+ gamepad.dpad.right.isPressed);
+ };
+ };
+#ifdef ADD_MICRO_GAMEPAD // disabling this for now, only available on iOS 9+,
+ // while we are setting that as the minimum, seems our
+ // build environment doesn't like it
+ } else if (controller.microGamepad != nil) {
+ // micro gamepads were added in OS 9 and feature just 2 buttons and a d-pad
+ controller.microGamepad.valueChangedHandler =
+ ^(GCMicroGamepad *gamepad, GCControllerElement *element) {
+ int joy_id = [self getJoyIdForController:controller];
+
+ if (element == gamepad.buttonA) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_0,
+ gamepad.buttonA.isPressed);
+ } else if (element == gamepad.buttonX) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_2,
+ gamepad.buttonX.isPressed);
+ } else if (element == gamepad.dpad) {
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_UP,
+ gamepad.dpad.up.isPressed);
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_DOWN,
+ gamepad.dpad.down.isPressed);
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_LEFT,
+ gamepad.dpad.left.isPressed);
+ OSIPhone::get_singleton()->joy_button(joy_id, JOY_DPAD_RIGHT,
+ gamepad.dpad.right.isPressed);
+ };
+ };
+#endif
+ };
- if ([value isKindOfClass:[NSString class]]) {
- NSString* str = (NSString*)value;
- String uval = String::utf8([str UTF8String]);
+ ///@TODO need to add support for controller.motion which gives us access to
+ /// the orientation of the device (if supported)
- GlobalConfig::get_singleton()->set("Info.plist/"+ukey, uval);
+ ///@TODO need to add support for controllerPausedHandler which should be a
+ /// toggle
+};
- } else if ([value isKindOfClass:[NSNumber class]]) {
+- (void)initGameControllers {
+ // get told when controllers connect, this will be called right away for
+ // already connected controllers
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(controllerWasConnected:)
+ name:GCControllerDidConnectNotification
+ object:nil];
+
+ // get told when controllers disconnect
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(controllerWasDisconnected:)
+ name:GCControllerDidDisconnectNotification
+ object:nil];
+};
- NSNumber* n = (NSNumber*)value;
- double dval = [n doubleValue];
+- (void)deinitGameControllers {
+ [[NSNotificationCenter defaultCenter]
+ removeObserver:self
+ name:GCControllerDidConnectNotification
+ object:nil];
+ [[NSNotificationCenter defaultCenter]
+ removeObserver:self
+ name:GCControllerDidDisconnectNotification
+ object:nil];
+
+ if (ios_joysticks != nil) {
+ [ios_joysticks dealloc];
+ ios_joysticks = nil;
+ };
+};
- GlobalConfig::get_singleton()->set("Info.plist/"+ukey, dval);
+static int frame_count = 0;
+- (void)drawView:(GLView *)view;
+{
+
+ switch (frame_count) {
+ case 0: {
+ int backingWidth;
+ int backingHeight;
+ glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES,
+ GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
+ glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES,
+ GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
+
+ OS::VideoMode vm;
+ vm.fullscreen = true;
+ vm.width = backingWidth;
+ vm.height = backingHeight;
+ vm.resizable = false;
+ OS::get_singleton()->set_video_mode(vm);
+
+ if (!OS::get_singleton()) {
+ exit(0);
};
- // do stuff
- }
+ ++frame_count;
+
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
+ NSUserDomainMask, YES);
+ NSString *documentsDirectory = [paths objectAtIndex:0];
+ // NSString *documentsDirectory = [[[NSFileManager defaultManager]
+ // URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask]
+ // lastObject];
+ OSIPhone::get_singleton()->set_data_dir(
+ String::utf8([documentsDirectory UTF8String]));
+
+ NSString *locale_code = [[NSLocale currentLocale] localeIdentifier];
+ OSIPhone::get_singleton()->set_locale(
+ String::utf8([locale_code UTF8String]));
+
+ NSString *uuid;
+ if ([[UIDevice currentDevice]
+ respondsToSelector:@selector(identifierForVendor)]) {
+ uuid = [UIDevice currentDevice].identifierForVendor.UUIDString;
+ } else {
+ // before iOS 6, so just generate an identifier and store it
+ uuid = [[NSUserDefaults standardUserDefaults]
+ objectForKey:@"identiferForVendor"];
+ if (!uuid) {
+ CFUUIDRef cfuuid = CFUUIDCreate(NULL);
+ uuid = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, cfuuid);
+ CFRelease(cfuuid);
+ [[NSUserDefaults standardUserDefaults]
+ setObject:uuid
+ forKey:@"identifierForVendor"];
+ }
+ }
- } break;
-/*
- case 3: {
- ++frame_count;
- } break;
+ OSIPhone::get_singleton()->set_unique_id(String::utf8([uuid UTF8String]));
+
+ }; break;
+ /*
+ case 1: {
+ ++frame_count;
+ }; break;
*/
- case 2: {
-
- Main::start();
- ++frame_count;
-
- }; break; // no fallthrough
-
- default: {
- if (OSIPhone::get_singleton()) {
-// OSIPhone::get_singleton()->update_accelerometer(accel[0], accel[1], accel[2]);
- if (motionInitialised) {
- // Just using polling approach for now, we can set this up so it sends data to us in intervals, might be better.
- // See Apple reference pages for more details:
- // https://developer.apple.com/reference/coremotion/cmmotionmanager?language=objc
-
- // Apple splits our accelerometer date into a gravity and user movement component. We add them back together
- CMAcceleration gravity = motionManager.deviceMotion.gravity;
- CMAcceleration acceleration = motionManager.deviceMotion.userAcceleration;
-
- ///@TODO We don't seem to be getting data here, is my device broken or is this code incorrect?
- CMMagneticField magnetic = motionManager.deviceMotion.magneticField.field;
-
- ///@TODO we can access rotationRate as a CMRotationRate variable (processed date) or CMGyroData (raw data), have to see what works best
- CMRotationRate rotation = motionManager.deviceMotion.rotationRate;
-
- // Adjust for screen orientation.
- // [[UIDevice currentDevice] orientation] changes even if we've fixed our orientation which is not
- // a good thing when you're trying to get your user to move the screen in all directions and want consistent output
-
- ///@TODO Using [[UIApplication sharedApplication] statusBarOrientation] is a bit of a hack. Godot obviously knows the orientation so maybe we
- // can use that instead? (note that left and right seem swapped)
-
- switch ([[UIApplication sharedApplication] statusBarOrientation]) {
- case UIDeviceOrientationLandscapeLeft: {
- OSIPhone::get_singleton()->update_gravity(-gravity.y, gravity.x, gravity.z);
- OSIPhone::get_singleton()->update_accelerometer(-(acceleration.y + gravity.y), (acceleration.x + gravity.x), acceleration.z + gravity.z);
- OSIPhone::get_singleton()->update_magnetometer(-magnetic.y, magnetic.x, magnetic.z);
- OSIPhone::get_singleton()->update_gyroscope(-rotation.y, rotation.x, rotation.z);
- }; break;
- case UIDeviceOrientationLandscapeRight: {
- OSIPhone::get_singleton()->update_gravity(gravity.y, -gravity.x, gravity.z);
- OSIPhone::get_singleton()->update_accelerometer((acceleration.y + gravity.y), -(acceleration.x + gravity.x), acceleration.z + gravity.z);
- OSIPhone::get_singleton()->update_magnetometer(magnetic.y, -magnetic.x, magnetic.z);
- OSIPhone::get_singleton()->update_gyroscope(rotation.y, -rotation.x, rotation.z);
- }; break;
- case UIDeviceOrientationPortraitUpsideDown: {
- OSIPhone::get_singleton()->update_gravity(-gravity.x, gravity.y, gravity.z);
- OSIPhone::get_singleton()->update_accelerometer(-(acceleration.x + gravity.x), (acceleration.y + gravity.y), acceleration.z + gravity.z);
- OSIPhone::get_singleton()->update_magnetometer(-magnetic.x, magnetic.y, magnetic.z);
- OSIPhone::get_singleton()->update_gyroscope(-rotation.x, rotation.y, rotation.z);
- }; break;
- default: { // assume portrait
- OSIPhone::get_singleton()->update_gravity(gravity.x, gravity.y, gravity.z);
- OSIPhone::get_singleton()->update_accelerometer(acceleration.x + gravity.x, acceleration.y + gravity.y, acceleration.z + gravity.z);
- OSIPhone::get_singleton()->update_magnetometer(magnetic.x, magnetic.y, magnetic.z);
- OSIPhone::get_singleton()->update_gyroscope(rotation.x, rotation.y, rotation.z);
- }; break;
+ case 1: {
+
+ Main::setup2();
+ ++frame_count;
+
+ // this might be necessary before here
+ NSDictionary *dict = [[NSBundle mainBundle] infoDictionary];
+ for (NSString *key in dict) {
+ NSObject *value = [dict objectForKey:key];
+ String ukey = String::utf8([key UTF8String]);
+
+ // we need a NSObject to Variant conversor
+
+ if ([value isKindOfClass:[NSString class]]) {
+ NSString *str = (NSString *)value;
+ String uval = String::utf8([str UTF8String]);
+
+ ProjectSettings::get_singleton()->set("Info.plist/" + ukey, uval);
+
+ } else if ([value isKindOfClass:[NSNumber class]]) {
+
+ NSNumber *n = (NSNumber *)value;
+ double dval = [n doubleValue];
+
+ ProjectSettings::get_singleton()->set("Info.plist/" + ukey, dval);
};
+ // do stuff
}
- bool quit_request = OSIPhone::get_singleton()->iterate();
- };
-
- };
+ }; break;
+ /*
+ case 3: {
+ ++frame_count;
+ }; break;
+*/
+ case 2: {
+
+ Main::start();
+ ++frame_count;
+
+ }; break; // no fallthrough
+
+ default: {
+ if (OSIPhone::get_singleton()) {
+ // OSIPhone::get_singleton()->update_accelerometer(accel[0], accel[1],
+ // accel[2]);
+ if (motionInitialised) {
+ // Just using polling approach for now, we can set this up so it sends
+ // data to us in intervals, might be better. See Apple reference pages
+ // for more details:
+ // https://developer.apple.com/reference/coremotion/cmmotionmanager?language=objc
+
+ // Apple splits our accelerometer date into a gravity and user movement
+ // component. We add them back together
+ CMAcceleration gravity = motionManager.deviceMotion.gravity;
+ CMAcceleration acceleration =
+ motionManager.deviceMotion.userAcceleration;
+
+ ///@TODO We don't seem to be getting data here, is my device broken or
+ /// is this code incorrect?
+ CMMagneticField magnetic =
+ motionManager.deviceMotion.magneticField.field;
+
+ ///@TODO we can access rotationRate as a CMRotationRate variable
+ ///(processed date) or CMGyroData (raw data), have to see what works
+ /// best
+ CMRotationRate rotation = motionManager.deviceMotion.rotationRate;
+
+ // Adjust for screen orientation.
+ // [[UIDevice currentDevice] orientation] changes even if we've fixed
+ // our orientation which is not a good thing when you're trying to get
+ // your user to move the screen in all directions and want consistent
+ // output
+
+ ///@TODO Using [[UIApplication sharedApplication] statusBarOrientation]
+ /// is a bit of a hack. Godot obviously knows the orientation so maybe
+ /// we
+ // can use that instead? (note that left and right seem swapped)
+
+ switch ([[UIApplication sharedApplication] statusBarOrientation]) {
+ case UIDeviceOrientationLandscapeLeft: {
+ OSIPhone::get_singleton()->update_gravity(-gravity.y, gravity.x,
+ gravity.z);
+ OSIPhone::get_singleton()->update_accelerometer(
+ -(acceleration.y + gravity.y), (acceleration.x + gravity.x),
+ acceleration.z + gravity.z);
+ OSIPhone::get_singleton()->update_magnetometer(
+ -magnetic.y, magnetic.x, magnetic.z);
+ OSIPhone::get_singleton()->update_gyroscope(-rotation.y, rotation.x,
+ rotation.z);
+ }; break;
+ case UIDeviceOrientationLandscapeRight: {
+ OSIPhone::get_singleton()->update_gravity(gravity.y, -gravity.x,
+ gravity.z);
+ OSIPhone::get_singleton()->update_accelerometer(
+ (acceleration.y + gravity.y), -(acceleration.x + gravity.x),
+ acceleration.z + gravity.z);
+ OSIPhone::get_singleton()->update_magnetometer(
+ magnetic.y, -magnetic.x, magnetic.z);
+ OSIPhone::get_singleton()->update_gyroscope(rotation.y, -rotation.x,
+ rotation.z);
+ }; break;
+ case UIDeviceOrientationPortraitUpsideDown: {
+ OSIPhone::get_singleton()->update_gravity(-gravity.x, gravity.y,
+ gravity.z);
+ OSIPhone::get_singleton()->update_accelerometer(
+ -(acceleration.x + gravity.x), (acceleration.y + gravity.y),
+ acceleration.z + gravity.z);
+ OSIPhone::get_singleton()->update_magnetometer(
+ -magnetic.x, magnetic.y, magnetic.z);
+ OSIPhone::get_singleton()->update_gyroscope(-rotation.x, rotation.y,
+ rotation.z);
+ }; break;
+ default: { // assume portrait
+ OSIPhone::get_singleton()->update_gravity(gravity.x, gravity.y,
+ gravity.z);
+ OSIPhone::get_singleton()->update_accelerometer(
+ acceleration.x + gravity.x, acceleration.y + gravity.y,
+ acceleration.z + gravity.z);
+ OSIPhone::get_singleton()->update_magnetometer(magnetic.x, magnetic.y,
+ magnetic.z);
+ OSIPhone::get_singleton()->update_gyroscope(rotation.x, rotation.y,
+ rotation.z);
+ }; break;
+ };
+ }
+
+ bool quit_request = OSIPhone::get_singleton()->iterate();
+ };
+ }; break;
};
};
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
printf("****************** did receive memory warning!\n");
- OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_OS_MEMORY_WARNING);
+ OS::get_singleton()->get_main_loop()->notification(
+ MainLoop::NOTIFICATION_OS_MEMORY_WARNING);
};
-- (void)applicationDidFinishLaunching:(UIApplication*)application {
+- (void)applicationDidFinishLaunching:(UIApplication *)application {
printf("**************** app delegate init\n");
CGRect rect = [[UIScreen mainScreen] bounds];
[application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
// disable idle timer
- //application.idleTimerDisabled = YES;
+ // application.idleTimerDisabled = YES;
- //Create a full-screen window
+ // Create a full-screen window
window = [[UIWindow alloc] initWithFrame:rect];
- //window.autoresizesSubviews = YES;
- //[window setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth];
+ // window.autoresizesSubviews = YES;
+ //[window setAutoresizingMask:UIViewAutoresizingFlexibleWidth |
+ // UIViewAutoresizingFlexibleWidth];
- //Create the OpenGL ES view and add it to the window
+ // Create the OpenGL ES view and add it to the window
GLView *glView = [[GLView alloc] initWithFrame:rect];
printf("glview is %p\n", glView);
//[window addSubview:glView];
glView.delegate = self;
- //glView.autoresizesSubviews = YES;
- //[glView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth];
+ // glView.autoresizesSubviews = YES;
+ //[glView setAutoresizingMask:UIViewAutoresizingFlexibleWidth |
+ // UIViewAutoresizingFlexibleWidth];
int backingWidth;
int backingHeight;
- glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
- glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
-
- iphone_main(backingWidth, backingHeight, gargc, gargv);
+ glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES,
+ GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
+ glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES,
+ GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
+
+ int err = iphone_main(backingWidth, backingHeight, gargc, gargv);
+ if (err != 0) {
+ // bail, things did not go very well for us, should probably output a message on screen with our error code...
+ exit(0);
+ return;
+ };
view_controller = [[ViewController alloc] init];
view_controller.view = glView;
window.rootViewController = view_controller;
- _set_keep_screen_on(bool(GLOBAL_DEF("display/keep_screen_on",true)) ? YES : NO);
- glView.useCADisplayLink = bool(GLOBAL_DEF("display.iOS/use_cadisplaylink",true)) ? YES : NO;
+ _set_keep_screen_on(bool(GLOBAL_DEF("display/window/keep_screen_on", true)) ? YES : NO);
+ glView.useCADisplayLink =
+ bool(GLOBAL_DEF("display.iOS/use_cadisplaylink", true)) ? YES : NO;
printf("cadisaplylink: %d", glView.useCADisplayLink);
glView.animationInterval = 1.0 / kRenderingFrequency;
[glView startAnimation];
- //Show the window
+ // Show the window
[window makeKeyAndVisible];
- //Configure and start accelerometer
+ // Configure and start accelerometer
if (!motionInitialised) {
motionManager = [[CMMotionManager alloc] init];
if (motionManager.deviceMotionAvailable) {
- motionManager.deviceMotionUpdateInterval = 1.0/70.0;
- [motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXMagneticNorthZVertical];
+ motionManager.deviceMotionUpdateInterval = 1.0 / 70.0;
+ [motionManager startDeviceMotionUpdatesUsingReferenceFrame:
+ CMAttitudeReferenceFrameXMagneticNorthZVertical];
motionInitialised = YES;
};
};
- //OSIPhone::screen_width = rect.size.width - rect.origin.x;
- //OSIPhone::screen_height = rect.size.height - rect.origin.y;
+ [self initGameControllers];
+
+ // OSIPhone::screen_width = rect.size.width - rect.origin.x;
+ // OSIPhone::screen_height = rect.size.height - rect.origin.y;
mainViewController = view_controller;
#ifdef MODULE_GAME_ANALYTICS_ENABLED
- printf("********************* didFinishLaunchingWithOptions\n");
- if(!GlobalConfig::get_singleton()->has("mobileapptracker/advertiser_id"))
- {
- return;
- }
- if(!GlobalConfig::get_singleton()->has("mobileapptracker/conversion_key"))
- {
- return;
- }
-
- String adid = GLOBAL_DEF("mobileapptracker/advertiser_id","");
- String convkey = GLOBAL_DEF("mobileapptracker/conversion_key","");
-
- NSString * advertiser_id = [NSString stringWithUTF8String:adid.utf8().get_data()];
- NSString * conversion_key = [NSString stringWithUTF8String:convkey.utf8().get_data()];
-
- // Account Configuration info - must be set
- [MobileAppTracker initializeWithMATAdvertiserId:advertiser_id
- MATConversionKey:conversion_key];
-
- // Used to pass us the IFA, enables highly accurate 1-to-1 attribution.
- // Required for many advertising networks.
- [MobileAppTracker setAppleAdvertisingIdentifier:[[ASIdentifierManager sharedManager] advertisingIdentifier]
- advertisingTrackingEnabled:[[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]];
+ printf("********************* didFinishLaunchingWithOptions\n");
+ if (!ProjectSettings::get_singleton()->has("mobileapptracker/advertiser_id")) {
+ return;
+ }
+ if (!ProjectSettings::get_singleton()->has("mobileapptracker/conversion_key")) {
+ return;
+ }
-#endif
+ String adid = GLOBAL_DEF("mobileapptracker/advertiser_id", "");
+ String convkey = GLOBAL_DEF("mobileapptracker/conversion_key", "");
+
+ NSString *advertiser_id =
+ [NSString stringWithUTF8String:adid.utf8().get_data()];
+ NSString *conversion_key =
+ [NSString stringWithUTF8String:convkey.utf8().get_data()];
+
+ // Account Configuration info - must be set
+ [MobileAppTracker initializeWithMATAdvertiserId:advertiser_id
+ MATConversionKey:conversion_key];
+ // Used to pass us the IFA, enables highly accurate 1-to-1 attribution.
+ // Required for many advertising networks.
+ [MobileAppTracker
+ setAppleAdvertisingIdentifier:[[ASIdentifierManager sharedManager]
+ advertisingIdentifier]
+ advertisingTrackingEnabled:[[ASIdentifierManager sharedManager]
+ isAdvertisingTrackingEnabled]];
+
+#endif
};
-- (void)applicationWillTerminate:(UIApplication*)application {
+- (void)applicationWillTerminate:(UIApplication *)application {
printf("********************* will terminate\n");
+ [self deinitGameControllers];
+
if (motionInitialised) {
///@TODO is this the right place to clean this up?
[motionManager stopDeviceMotionUpdates];
[motionManager release];
motionManager = nil;
- motionInitialised = NO;
+ motionInitialised = NO;
};
iphone_finish();
};
-- (void)applicationDidEnterBackground:(UIApplication *)application
-{
+- (void)applicationDidEnterBackground:(UIApplication *)application {
printf("********************* did enter background\n");
///@TODO maybe add pause motionManager? and where would we unpause it?
if (OS::get_singleton()->get_main_loop())
- OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT);
+ OS::get_singleton()->get_main_loop()->notification(
+ MainLoop::NOTIFICATION_WM_FOCUS_OUT);
+
[view_controller.view stopAnimation];
if (OS::get_singleton()->native_video_is_playing()) {
OSIPhone::get_singleton()->native_video_focus_out();
};
}
-- (void)applicationWillEnterForeground:(UIApplication *)application
-{
+- (void)applicationWillEnterForeground:(UIApplication *)application {
printf("********************* did enter foreground\n");
- //OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
+ // OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
[view_controller.view startAnimation];
}
-- (void) applicationWillResignActive:(UIApplication *)application
-{
+- (void)applicationWillResignActive:(UIApplication *)application {
printf("********************* will resign active\n");
- //OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT);
- [view_controller.view stopAnimation]; // FIXME: pause seems to be recommended elsewhere
+ // OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT);
+ [view_controller.view
+ stopAnimation]; // FIXME: pause seems to be recommended elsewhere
}
-- (void) applicationDidBecomeActive:(UIApplication *)application
-{
+- (void)applicationDidBecomeActive:(UIApplication *)application {
printf("********************* did become active\n");
#ifdef MODULE_GAME_ANALYTICS_ENABLED
- printf("********************* mobile app tracker found\n");
+ printf("********************* mobile app tracker found\n");
[MobileAppTracker measureSession];
#endif
if (OS::get_singleton()->get_main_loop())
- OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
- [view_controller.view startAnimation]; // FIXME: resume seems to be recommended elsewhere
+ OS::get_singleton()->get_main_loop()->notification(
+ MainLoop::NOTIFICATION_WM_FOCUS_IN);
+
+ [view_controller.view
+ startAnimation]; // FIXME: resume seems to be recommended elsewhere
if (OSIPhone::get_singleton()->native_video_is_playing()) {
OSIPhone::get_singleton()->native_video_unpause();
};
+
+ // Fixed audio can not resume if it is interrupted cause by an incoming phone call
+ if (AudioDriverIphone::get_singleton() != NULL)
+ AudioDriverIphone::get_singleton()->start();
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
@@ -406,16 +749,19 @@ static int frame_count = 0;
}
// For 4.2+ support
-- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
+- (BOOL)application:(UIApplication *)application
+ openURL:(NSURL *)url
+ sourceApplication:(NSString *)sourceApplication
+ annotation:(id)annotation {
#ifdef MODULE_PARSE_ENABLED
NSLog(@"Handling application openURL");
- return [[FBSDKApplicationDelegate sharedInstance] application:application
- openURL:url
- sourceApplication:sourceApplication
- annotation:annotation];
+ return
+ [[FBSDKApplicationDelegate sharedInstance] application:application
+ openURL:url
+ sourceApplication:sourceApplication
+ annotation:annotation];
#endif
-
#ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED
return [[[FacebookScorer sharedInstance] facebook] handleOpenURL:url];
#else
@@ -423,21 +769,25 @@ static int frame_count = 0;
#endif
}
-- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
+- (void)application:(UIApplication *)application
+ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
#ifdef MODULE_PARSE_ENABLED
// Store the deviceToken in the current installation and save it to Parse.
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
- //NSString* token = [[NSString alloc] initWithData:deviceToken encoding:NSUTF8StringEncoding];
+ // NSString* token = [[NSString alloc] initWithData:deviceToken
+ // encoding:NSUTF8StringEncoding];
NSLog(@"Device Token : %@ ", deviceToken);
[currentInstallation setDeviceTokenFromData:deviceToken];
[currentInstallation saveInBackground];
#endif
}
-- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
+- (void)application:(UIApplication *)application
+ didReceiveRemoteNotification:(NSDictionary *)userInfo {
#ifdef MODULE_PARSE_ENABLED
[PFPush handlePush:userInfo];
- NSDictionary *aps = [userInfo objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
+ NSDictionary *aps =
+ [userInfo objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSLog(@"Push Notification Payload (app active) %@", aps);
@@ -449,8 +799,7 @@ static int frame_count = 0;
#endif
}
-- (void)dealloc
-{
+- (void)dealloc {
[window release];
[super dealloc];
}
diff --git a/platform/iphone/audio_driver_iphone.cpp b/platform/iphone/audio_driver_iphone.cpp
index eff91fa40f..57b6388016 100644
--- a/platform/iphone/audio_driver_iphone.cpp
+++ b/platform/iphone/audio_driver_iphone.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -147,6 +148,11 @@ OSStatus AudioDriverIphone::output_callback(void *inRefCon,
void AudioDriverIphone::start() {
active = true;
+ // Resume audio
+ // iOS audio-thread stoped if it is interrupted cause by an incoming phone call
+ // Use AudioOutputUnitStart to re-create audio-thread
+ OSStatus result = AudioOutputUnitStart(audio_unit);
+ ERR_FAIL_COND(result != noErr);
};
int AudioDriverIphone::get_mix_rate() const {
diff --git a/platform/iphone/audio_driver_iphone.h b/platform/iphone/audio_driver_iphone.h
index 8a0d92e070..c620e9068c 100644
--- a/platform/iphone/audio_driver_iphone.h
+++ b/platform/iphone/audio_driver_iphone.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py
index fa6082a5a7..1d802ff288 100644
--- a/platform/iphone/detect.py
+++ b/platform/iphone/detect.py
@@ -1,4 +1,5 @@
import os
+import string
import sys
@@ -12,8 +13,6 @@ def get_name():
def can_build():
- import sys
- import os
if sys.platform == 'darwin' or os.environ.has_key("OSXCROSS_IOS"):
return True
@@ -23,14 +22,13 @@ def can_build():
def get_opts():
return [
- ('IPHONEPLATFORM', 'name of the iphone platform', 'iPhoneOS'),
- ('IPHONEPATH', 'the path to iphone toolchain', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain'),
- ('IPHONESDK', 'path to the iphone SDK', '/Applications/Xcode.app/Contents/Developer/Platforms/${IPHONEPLATFORM}.platform/Developer/SDKs/${IPHONEPLATFORM}.sdk/'),
+ ('IPHONEPLATFORM', 'Name of the iPhone platform', 'iPhoneOS'),
+ ('IPHONEPATH', 'Path to iPhone toolchain', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain'),
+ ('IPHONESDK', 'Path to the iPhone SDK', '/Applications/Xcode.app/Contents/Developer/Platforms/${IPHONEPLATFORM}.platform/Developer/SDKs/${IPHONEPLATFORM}.sdk/'),
('game_center', 'Support for game center', 'yes'),
('store_kit', 'Support for in-app store', 'yes'),
('icloud', 'Support for iCloud', 'yes'),
- ('ios_gles22_override', 'Force GLES2.0 on iOS', 'yes'),
- ('ios_exceptions', 'Use exceptions when compiling on playbook', 'yes'),
+ ('ios_exceptions', 'Enable exceptions', 'no'),
('ios_triple', 'Triple for ios toolchain', ''),
('ios_sim', 'Build simulator binary', 'no'),
]
@@ -45,7 +43,32 @@ def get_flags():
def configure(env):
- env.Append(CPPPATH=['#platform/iphone'])
+ ## Build type
+
+ if (env["target"].startswith("release")):
+ env.Append(CPPFLAGS=['-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1'])
+ env.Append(CPPFLAGS=['-O2', '-flto', '-ftree-vectorize', '-fomit-frame-pointer', '-ffast-math', '-funsafe-math-optimizations'])
+ env.Append(LINKFLAGS=['-O2', '-flto'])
+
+ if env["target"] == "release_debug":
+ env.Append(CPPFLAGS=['-DDEBUG_ENABLED'])
+
+ elif (env["target"] == "debug"):
+ env.Append(CPPFLAGS=['-D_DEBUG', '-DDEBUG=1', '-gdwarf-2', '-O0', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+
+ ## Architecture
+
+ if (env["ios_sim"] == "yes" or env["arch"] == "x86"): # i386, simulator
+ env["arch"] = "x86"
+ env["bits"] = "32"
+ elif (env["arch"] == "arm" or env["arch"] == "arm32" or env["arch"] == "armv7" or env["bits"] == "32"): # arm
+ env["arch"] = "arm"
+ env["bits"] = "32"
+ else: # armv64
+ env["arch"] = "arm64"
+ env["bits"] = "64"
+
+ ## Compiler configuration
env['ENV']['PATH'] = env['IPHONEPATH'] + "/Developer/usr/bin/:" + env['ENV']['PATH']
@@ -53,85 +76,61 @@ def configure(env):
env['CXX'] = '$IPHONEPATH/usr/bin/${ios_triple}clang++'
env['AR'] = '$IPHONEPATH/usr/bin/${ios_triple}ar'
env['RANLIB'] = '$IPHONEPATH/usr/bin/${ios_triple}ranlib'
+ env['S_compiler'] = '$IPHONEPATH/Developer/usr/bin/gcc'
- import string
- if (env["ios_sim"] == "yes" or env["arch"] == "x86"): # i386, simulator
- env["arch"] = "x86"
- env["bits"] = "32"
- env['CCFLAGS'] = string.split('-arch i386 -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fasm-blocks -Wall -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -isysroot $IPHONESDK -mios-simulator-version-min=4.3 -DCUSTOM_MATRIX_TRANSFORM_H=\\\"build/iphone/matrix4_iphone.h\\\" -DCUSTOM_VECTOR3_TRANSFORM_H=\\\"build/iphone/vector3_iphone.h\\\"')
- elif (env["arch"] == "arm64"): # arm64
- env["bits"] = "64"
- env['CCFLAGS'] = string.split('-fno-objc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -fvisibility=hidden -Wno-sign-conversion -MMD -MT dependencies -miphoneos-version-min=7.0 -isysroot $IPHONESDK')
+ ## Compile flags
+
+ if (env["arch"] == "x86"):
+ env['IPHONEPLATFORM'] = 'iPhoneSimulator'
+ env['ENV']['MACOSX_DEPLOYMENT_TARGET'] = '10.6'
+ env.Append(CCFLAGS=string.split('-arch i386 -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fblocks -fasm-blocks -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -isysroot $IPHONESDK -mios-simulator-version-min=4.3 -DCUSTOM_MATRIX_TRANSFORM_H=\\\"build/iphone/matrix4_iphone.h\\\" -DCUSTOM_VECTOR3_TRANSFORM_H=\\\"build/iphone/vector3_iphone.h\\\"'))
+ elif (env["arch"] == "arm"):
+ env.Append(CCFLAGS=string.split('-fno-objc-arc -arch armv7 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -isysroot $IPHONESDK -fvisibility=hidden -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=9.0 -MMD -MT dependencies'))
+ elif (env["arch"] == "arm64"):
+ env.Append(CCFLAGS=string.split('-fno-objc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -miphoneos-version-min=9.0 -isysroot $IPHONESDK'))
env.Append(CPPFLAGS=['-DNEED_LONG_INT'])
env.Append(CPPFLAGS=['-DLIBYUV_DISABLE_NEON'])
- else: # armv7
- env["arch"] = "arm"
- env["bits"] = "32"
- env['CCFLAGS'] = string.split('-fno-objc-arc -arch armv7 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -isysroot $IPHONESDK -fvisibility=hidden -Wno-sign-conversion -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=7.0 -MMD -MT dependencies -isysroot $IPHONESDK')
+
+ if env['ios_exceptions'] == 'yes':
+ env.Append(CPPFLAGS=['-fexceptions'])
+ else:
+ env.Append(CPPFLAGS=['-fno-exceptions'])
+
+ ## Link flags
if (env["arch"] == "x86"):
- env['IPHONEPLATFORM'] = 'iPhoneSimulator'
env.Append(LINKFLAGS=['-arch', 'i386', '-mios-simulator-version-min=4.3',
'-isysroot', '$IPHONESDK',
- #'-mmacosx-version-min=10.6',
'-Xlinker',
'-objc_abi_version',
'-Xlinker', '2',
- '-framework', 'AudioToolbox',
- '-framework', 'AVFoundation',
- '-framework', 'CoreAudio',
- '-framework', 'CoreGraphics',
- '-framework', 'CoreMedia',
- '-framework', 'CoreMotion',
- '-framework', 'Foundation',
- '-framework', 'Security',
- '-framework', 'UIKit',
- '-framework', 'MediaPlayer',
- '-framework', 'OpenGLES',
- '-framework', 'QuartzCore',
- '-framework', 'SystemConfiguration',
'-F$IPHONESDK',
])
- elif (env["arch"] == "arm64"):
- env.Append(LINKFLAGS=['-arch', 'arm64', '-Wl,-dead_strip', '-miphoneos-version-min=7.0',
- '-isysroot', '$IPHONESDK',
- #'-stdlib=libc++',
- '-framework', 'Foundation',
- '-framework', 'UIKit',
- '-framework', 'CoreGraphics',
- '-framework', 'OpenGLES',
- '-framework', 'QuartzCore',
- '-framework', 'CoreAudio',
- '-framework', 'AudioToolbox',
- '-framework', 'SystemConfiguration',
- '-framework', 'Security',
- #'-framework', 'AdSupport',
- '-framework', 'MediaPlayer',
- '-framework', 'AVFoundation',
- '-framework', 'CoreMedia',
- '-framework', 'CoreMotion',
- ])
- else:
- env.Append(LINKFLAGS=['-arch', 'armv7', '-Wl,-dead_strip', '-miphoneos-version-min=7.0',
- '-isysroot', '$IPHONESDK',
- '-framework', 'Foundation',
- '-framework', 'UIKit',
- '-framework', 'CoreGraphics',
- '-framework', 'OpenGLES',
- '-framework', 'QuartzCore',
- '-framework', 'CoreAudio',
- '-framework', 'AudioToolbox',
- '-framework', 'SystemConfiguration',
- '-framework', 'Security',
- #'-framework', 'AdSupport',
- '-framework', 'MediaPlayer',
- '-framework', 'AVFoundation',
- '-framework', 'CoreMedia',
- '-framework', 'CoreMotion',
- ])
-
+ elif (env["arch"] == "arm"):
+ env.Append(LINKFLAGS=['-arch', 'armv7', '-Wl,-dead_strip', '-miphoneos-version-min=9.0'])
+ if (env["arch"] == "arm64"):
+ env.Append(LINKFLAGS=['-arch', 'arm64', '-Wl,-dead_strip', '-miphoneos-version-min=9.0'])
+
+ env.Append(LINKFLAGS=['-isysroot', '$IPHONESDK',
+ '-framework', 'AudioToolbox',
+ '-framework', 'AVFoundation',
+ '-framework', 'CoreAudio',
+ '-framework', 'CoreGraphics',
+ '-framework', 'CoreMedia',
+ '-framework', 'CoreMotion',
+ '-framework', 'Foundation',
+ '-framework', 'GameController',
+ '-framework', 'MediaPlayer',
+ '-framework', 'OpenGLES',
+ '-framework', 'QuartzCore',
+ '-framework', 'Security',
+ '-framework', 'SystemConfiguration',
+ '-framework', 'UIKit',
+ ])
+
+ # Feature options
if env['game_center'] == 'yes':
- env.Append(CPPFLAGS=['-fblocks', '-DGAME_CENTER_ENABLED'])
+ env.Append(CPPFLAGS=['-DGAME_CENTER_ENABLED'])
env.Append(LINKFLAGS=['-framework', 'GameKit'])
if env['store_kit'] == 'yes':
@@ -141,51 +140,20 @@ def configure(env):
if env['icloud'] == 'yes':
env.Append(CPPFLAGS=['-DICLOUD_ENABLED'])
- env.Append(CPPPATH=['$IPHONESDK/usr/include', '$IPHONESDK/System/Library/Frameworks/OpenGLES.framework/Headers', '$IPHONESDK/System/Library/Frameworks/AudioUnit.framework/Headers'])
-
- if (env["target"] == "release"):
-
- env.Append(CCFLAGS=['-O3', '-DNS_BLOCK_ASSERTIONS=1', '-Wall', '-gdwarf-2']) # removed -ffast-math
- env.Append(LINKFLAGS=['-O3'])
-
- elif env["target"] == "release_debug":
- env.Append(CCFLAGS=['-Os', '-DNS_BLOCK_ASSERTIONS=1', '-Wall', '-DDEBUG_ENABLED'])
- env.Append(LINKFLAGS=['-Os'])
- env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED'])
-
- elif (env["target"] == "debug"):
-
- env.Append(CCFLAGS=['-D_DEBUG', '-DDEBUG=1', '-gdwarf-2', '-Wall', '-O0', '-DDEBUG_ENABLED'])
- env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED'])
+ env.Append(CPPPATH=['$IPHONESDK/usr/include',
+ '$IPHONESDK/System/Library/Frameworks/OpenGLES.framework/Headers',
+ '$IPHONESDK/System/Library/Frameworks/AudioUnit.framework/Headers',
+ ])
- elif (env["target"] == "profile"):
-
- env.Append(CCFLAGS=['-g', '-pg', '-Os'])
- env.Append(LINKFLAGS=['-pg'])
-
- if (env["ios_sim"] == "yes"): # TODO: Check if needed?
- env['ENV']['MACOSX_DEPLOYMENT_TARGET'] = '10.6'
env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate'
+
+ env.Append(CPPPATH=['#platform/iphone'])
env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DMPC_FIXED_POINT'])
# TODO: Move that to opus module's config
if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"):
env.opus_fixed_point = "yes"
- if env["arch"] == "x86":
- pass
- elif(env["arch"] == "arm64"):
- env.Append(CFLAGS=["-DOPUS_ARM64_OPT"])
- else:
+ if (env["arch"] == "arm"):
env.Append(CFLAGS=["-DOPUS_ARM_OPT"])
-
- if env['ios_exceptions'] == 'yes':
- env.Append(CPPFLAGS=['-fexceptions'])
- else:
- env.Append(CPPFLAGS=['-fno-exceptions'])
- # env['neon_enabled']=True
- env['S_compiler'] = '$IPHONEPATH/Developer/usr/bin/gcc'
-
- import methods
- env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')})
+ elif (env["arch"] == "arm64"):
+ env.Append(CFLAGS=["-DOPUS_ARM64_OPT"])
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
new file mode 100644
index 0000000000..6ae2a0692d
--- /dev/null
+++ b/platform/iphone/export/export.cpp
@@ -0,0 +1,366 @@
+/*************************************************************************/
+/* export.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "export.h"
+#include "editor/editor_export.h"
+#include "editor/editor_node.h"
+#include "editor/editor_settings.h"
+#include "io/marshalls.h"
+#include "io/resource_saver.h"
+#include "io/zip_io.h"
+#include "os/file_access.h"
+#include "os/os.h"
+#include "platform/osx/logo.gen.h"
+#include "project_settings.h"
+#include "string.h"
+#include "version.h"
+
+#include <sys/stat.h>
+
+class EditorExportPlatformIOS : public EditorExportPlatform {
+
+ GDCLASS(EditorExportPlatformIOS, EditorExportPlatform);
+
+ int version_code;
+
+ Ref<ImageTexture> logo;
+
+ void _fix_config_file(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &pfile, const String &p_name, const String &p_binary);
+
+protected:
+ virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features);
+ virtual void get_export_options(List<ExportOption> *r_options);
+
+public:
+ virtual String get_name() const { return "iOS"; }
+ virtual String get_os_name() const { return "iOS"; }
+ virtual Ref<Texture> get_logo() const { return logo; }
+
+ virtual String get_binary_extension() const { return "xcodeproj"; }
+ virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
+
+ virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const;
+
+ virtual void get_platform_features(List<String> *r_features) {
+
+ r_features->push_back("mobile");
+ r_features->push_back("iOS");
+ }
+
+ EditorExportPlatformIOS();
+ ~EditorExportPlatformIOS();
+};
+
+void EditorExportPlatformIOS::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 EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options) {
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/release", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/name"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/info"), "Made with Godot Engine"));
+ // r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "png"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/identifier"), "org.godotengine.iosgame"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/signature"), "godotiosgame"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/short_version"), "1.0"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version"), "1.0"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/bits_mode", PROPERTY_HINT_ENUM, "Fat (32 & 64 bits),64 bits,32 bits"), 1));
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), true));
+
+ /* probably need some more info */
+}
+
+void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &pfile, const String &p_name, const String &p_binary) {
+
+ String str;
+ String strnew;
+ str.parse_utf8((const char *)pfile.ptr(), pfile.size());
+ Vector<String> lines = str.split("\n");
+ for (int i = 0; i < lines.size(); i++) {
+ if (lines[i].find("$binary") != -1) {
+ strnew += lines[i].replace("$binary", p_binary) + "\n";
+ } else if (lines[i].find("$name") != -1) {
+ strnew += lines[i].replace("$name", p_name) + "\n";
+ } else if (lines[i].find("$info") != -1) {
+ strnew += lines[i].replace("$info", p_preset->get("application/info")) + "\n";
+ } else if (lines[i].find("$identifier") != -1) {
+ strnew += lines[i].replace("$identifier", p_preset->get("application/identifier")) + "\n";
+ } else if (lines[i].find("$short_version") != -1) {
+ strnew += lines[i].replace("$short_version", p_preset->get("application/short_version")) + "\n";
+ } else if (lines[i].find("$version") != -1) {
+ strnew += lines[i].replace("$version", p_preset->get("application/version")) + "\n";
+ } else if (lines[i].find("$signature") != -1) {
+ strnew += lines[i].replace("$signature", p_preset->get("application/signature")) + "\n";
+ } else if (lines[i].find("$copyright") != -1) {
+ strnew += lines[i].replace("$copyright", p_preset->get("application/copyright")) + "\n";
+ } else {
+ strnew += lines[i] + "\n";
+ }
+ }
+
+ // !BAS! I'm assuming the 9 in the original code was a typo. I've added -1 or else it seems to also be adding our terminating zero...
+ // should apply the same fix in our OSX export.
+ CharString cs = strnew.utf8();
+ pfile.resize(cs.size() - 1);
+ for (int i = 0; i < cs.size() - 1; i++) {
+ pfile[i] = cs[i];
+ }
+}
+
+Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
+ String src_pkg_name;
+ String dest_dir = p_path.get_base_dir() + "/";
+ String binary_name = p_path.get_file().get_basename();
+
+ EditorProgress ep("export", "Exporting for iOS", 3);
+
+ if (p_debug)
+ src_pkg_name = p_preset->get("custom_package/debug");
+ else
+ src_pkg_name = p_preset->get("custom_package/release");
+
+ if (src_pkg_name == "") {
+ String err;
+ src_pkg_name = find_export_template("iphone.zip", &err);
+ if (src_pkg_name == "") {
+ EditorNode::add_io_error(err);
+ return ERR_FILE_NOT_FOUND;
+ }
+ }
+
+ FileAccess *src_f = NULL;
+ zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
+
+ ep.step("Creating app", 0);
+
+ unzFile src_pkg_zip = unzOpen2(src_pkg_name.utf8().get_data(), &io);
+ if (!src_pkg_zip) {
+
+ EditorNode::add_io_error("Could not find template app to export:\n" + src_pkg_name);
+ return ERR_FILE_NOT_FOUND;
+ }
+
+ ERR_FAIL_COND_V(!src_pkg_zip, ERR_CANT_OPEN);
+ int ret = unzGoToFirstFile(src_pkg_zip);
+
+ String binary_to_use = "godot.iphone." + String(p_debug ? "debug" : "release") + ".";
+ int bits_mode = p_preset->get("application/bits_mode");
+ binary_to_use += String(bits_mode == 0 ? "fat" : bits_mode == 1 ? "arm64" : "armv7");
+
+ print_line("binary: " + binary_to_use);
+ String pkg_name;
+ if (p_preset->get("application/name") != "")
+ pkg_name = p_preset->get("application/name"); // app_name
+ else if (String(ProjectSettings::get_singleton()->get("application/config/name")) != "")
+ pkg_name = String(ProjectSettings::get_singleton()->get("application/config/name"));
+ else
+ pkg_name = "Unnamed";
+
+ DirAccess *tmp_app_path = DirAccess::create_for_path(dest_dir);
+ ERR_FAIL_COND_V(!tmp_app_path, ERR_CANT_CREATE)
+
+ /* Now process our template */
+ bool found_binary = false;
+ int total_size = 0;
+
+ while (ret == UNZ_OK) {
+ bool is_execute = false;
+
+ //get filename
+ unz_file_info info;
+ char fname[16384];
+ ret = unzGetCurrentFileInfo(src_pkg_zip, &info, fname, 16384, NULL, 0, NULL, 0);
+
+ String file = fname;
+
+ print_line("READ: " + file);
+ Vector<uint8_t> data;
+ data.resize(info.uncompressed_size);
+
+ //read
+ unzOpenCurrentFile(src_pkg_zip);
+ unzReadCurrentFile(src_pkg_zip, data.ptr(), data.size());
+ unzCloseCurrentFile(src_pkg_zip);
+
+ //write
+
+ file = file.replace_first("iphone/", "");
+
+ if (file == "godot_ios.xcodeproj/project.pbxproj") {
+ print_line("parse pbxproj");
+ _fix_config_file(p_preset, data, pkg_name, binary_name);
+ } else if (file == "godot_ios/godot_ios-Info.plist") {
+ print_line("parse plist");
+ _fix_config_file(p_preset, data, pkg_name, binary_name);
+ } else if (file.begins_with("godot.iphone")) {
+ if (file != binary_to_use) {
+ ret = unzGoToNextFile(src_pkg_zip);
+ continue; //ignore!
+ }
+ found_binary = true;
+ is_execute = true;
+ file = "godot_ios.iphone";
+ }
+
+ ///@TODO need to parse logo files
+
+ if (data.size() > 0) {
+ file = file.replace("godot_ios", binary_name);
+
+ print_line("ADDING: " + file + " size: " + itos(data.size()));
+ total_size += data.size();
+
+ /* write it into our folder structure */
+ file = dest_dir + file;
+
+ /* make sure this folder exists */
+ String dir_name = file.get_base_dir();
+ if (!tmp_app_path->dir_exists(dir_name)) {
+ print_line("Creating " + dir_name);
+ Error dir_err = tmp_app_path->make_dir_recursive(dir_name);
+ if (dir_err) {
+ ERR_PRINTS("Can't create '" + dir_name + "'.");
+ unzClose(src_pkg_zip);
+ return ERR_CANT_CREATE;
+ }
+ }
+
+ /* write the file */
+ FileAccess *f = FileAccess::open(file, FileAccess::WRITE);
+ if (!f) {
+ ERR_PRINTS("Can't write '" + file + "'.");
+ unzClose(src_pkg_zip);
+ return ERR_CANT_CREATE;
+ };
+ f->store_buffer(data.ptr(), data.size());
+ f->close();
+ memdelete(f);
+
+#ifdef OSX_ENABLED
+ if (is_execute) {
+ // we need execute rights on this file
+ chmod(file.utf8().get_data(), 0755);
+ }
+#endif
+ }
+
+ ret = unzGoToNextFile(src_pkg_zip);
+ }
+
+ /* we're done with our source zip */
+ unzClose(src_pkg_zip);
+
+ if (!found_binary) {
+ ERR_PRINTS("Requested template binary '" + binary_to_use + "' not found. It might be missing from your template archive.");
+ unzClose(src_pkg_zip);
+ return ERR_FILE_NOT_FOUND;
+ }
+
+ ep.step("Making PKG", 1);
+
+ String pack_path = dest_dir + binary_name + ".pck";
+ Error err = save_pack(p_preset, pack_path);
+
+ if (err) {
+ return err;
+ }
+
+#ifdef OSX_ENABLED
+ /* and open up xcode with our new project.... */
+ List<String> args;
+ args.push_back(p_path);
+ err = OS::get_singleton()->execute("/usr/bin/open", args, false);
+ ERR_FAIL_COND_V(err, err);
+
+#endif
+
+ return OK;
+}
+
+bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
+
+ bool valid = true;
+ String err;
+
+ if (!exists_export_template("iphone.zip", &err)) {
+ valid = false;
+ }
+
+ if (p_preset->get("custom_package/debug") != "" && !FileAccess::exists(p_preset->get("custom_package/debug"))) {
+ valid = false;
+ err += "Custom debug package not found.\n";
+ }
+
+ if (p_preset->get("custom_package/release") != "" && !FileAccess::exists(p_preset->get("custom_package/release"))) {
+ valid = false;
+ err += "Custom release package not found.\n";
+ }
+
+ if (!err.empty())
+ r_error = err;
+
+ return valid;
+}
+
+EditorExportPlatformIOS::EditorExportPlatformIOS() {
+
+ ///@TODO need to create the correct logo
+ // Ref<Image> img = memnew(Image(_iphone_logo));
+ Ref<Image> img = memnew(Image(_osx_logo));
+ logo.instance();
+ logo->create_from_image(img);
+}
+
+EditorExportPlatformIOS::~EditorExportPlatformIOS() {
+}
+
+void register_iphone_exporter() {
+
+ Ref<EditorExportPlatformIOS> platform;
+ platform.instance();
+
+ EditorExport::get_singleton()->add_export_platform(platform);
+}
diff --git a/platform/bb10/export/export.h b/platform/iphone/export/export.h
index d8407c4152..6e9324aed7 100644
--- a/platform/bb10/export/export.h
+++ b/platform/iphone/export/export.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,4 +27,4 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-void register_bb10_exporter();
+void register_iphone_exporter();
diff --git a/platform/iphone/game_center.h b/platform/iphone/game_center.h
index a732a97a4c..cda6f78a1f 100644
--- a/platform/iphone/game_center.h
+++ b/platform/iphone/game_center.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm
index 4cfa64ae4b..f9bc70b7c4 100644
--- a/platform/iphone/game_center.mm
+++ b/platform/iphone/game_center.mm
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -45,24 +46,23 @@ extern "C" {
#import "app_delegate.h"
};
-GameCenter* GameCenter::instance = NULL;
+GameCenter *GameCenter::instance = NULL;
void GameCenter::_bind_methods() {
- 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);
+ 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);
};
-
Error GameCenter::connect() {
//if this class isn't available, game center isn't implemented
@@ -71,33 +71,34 @@ Error GameCenter::connect() {
return ERR_UNAVAILABLE;
}
- GKLocalPlayer* player = [GKLocalPlayer localPlayer];
+ GKLocalPlayer *player = [GKLocalPlayer localPlayer];
ERR_FAIL_COND_V(![player respondsToSelector:@selector(authenticateHandler)], ERR_UNAVAILABLE);
- ViewController *root_controller=(ViewController *)((AppDelegate *)[[UIApplication sharedApplication] delegate]).window.rootViewController;
+ ViewController *root_controller = (ViewController *)((AppDelegate *)[[UIApplication sharedApplication] delegate]).window.rootViewController;
ERR_FAIL_COND_V(!root_controller, FAILED);
- //this handler is called serveral times. first when the view needs to be shown, then again after the view is cancelled or the user logs in. or if the user's already logged in, it's called just once to confirm they're authenticated. This is why no result needs to be specified in the presentViewController phase. in this case, more calls to this function will follow.
+ // This handler is called several times. First when the view needs to be shown, then again
+ // after the view is cancelled or the user logs in. Or if the user's already logged in, it's
+ // called just once to confirm they're authenticated. This is why no result needs to be specified
+ // in the presentViewController phase. In this case, more calls to this function will follow.
player.authenticateHandler = (^(UIViewController *controller, NSError *error) {
- if (controller) {
- [root_controller presentViewController:controller animated:YES completion:nil];
- }
- else {
- Dictionary ret;
- ret["type"] = "authentication";
- if (player.isAuthenticated) {
- ret["result"] = "ok";
- GameCenter::get_singleton()->connected = true;
- } else {
- ret["result"] = "error";
- ret["error_code"] = error.code;
- ret["error_description"] = [error.localizedDescription UTF8String];
- GameCenter::get_singleton()->connected = false;
- };
-
- pending_events.push_back(ret);
- };
-
+ if (controller) {
+ [root_controller presentViewController:controller animated:YES completion:nil];
+ } else {
+ Dictionary ret;
+ ret["type"] = "authentication";
+ if (player.isAuthenticated) {
+ ret["result"] = "ok";
+ GameCenter::get_singleton()->connected = true;
+ } else {
+ ret["result"] = "error";
+ ret["error_code"] = error.code;
+ ret["error_description"] = [error.localizedDescription UTF8String];
+ GameCenter::get_singleton()->connected = false;
+ };
+
+ pending_events.push_back(ret);
+ };
});
return OK;
@@ -114,26 +115,27 @@ Error GameCenter::post_score(Variant p_score) {
float score = params["score"];
String category = params["category"];
- NSString* cat_str = [[[NSString alloc] initWithUTF8String:category.utf8().get_data()] autorelease];
- GKScore* reporter = [[[GKScore alloc] initWithCategory:cat_str] autorelease];
+ NSString *cat_str = [[[NSString alloc] initWithUTF8String:category.utf8().get_data()] autorelease];
+ GKScore *reporter = [[[GKScore alloc] initWithCategory:cat_str] autorelease];
reporter.value = score;
ERR_FAIL_COND_V([GKScore respondsToSelector:@selector(reportScores)], ERR_UNAVAILABLE);
- [GKScore reportScores:@[reporter] withCompletionHandler:^(NSError* error) {
+ [GKScore reportScores:@[ reporter ]
+ withCompletionHandler:^(NSError *error) {
- Dictionary ret;
- ret["type"] = "post_score";
- if (error == nil) {
- ret["result"] = "ok";
- } else {
- ret["result"] = "error";
- ret["error_code"] = error.code;
- ret["error_description"] = [error.localizedDescription UTF8String];
- };
+ Dictionary ret;
+ ret["type"] = "post_score";
+ if (error == nil) {
+ ret["result"] = "ok";
+ } else {
+ ret["result"] = "error";
+ ret["error_code"] = error.code;
+ ret["error_description"] = [error.localizedDescription UTF8String];
+ };
- pending_events.push_back(ret);
- }];
+ pending_events.push_back(ret);
+ }];
return OK;
};
@@ -145,8 +147,8 @@ Error GameCenter::award_achievement(Variant p_params) {
String name = params["name"];
float progress = params["progress"];
- NSString* name_str = [[[NSString alloc] initWithUTF8String:name.utf8().get_data()] autorelease];
- GKAchievement* achievement = [[[GKAchievement alloc] initWithIdentifier: name_str] autorelease];
+ NSString *name_str = [[[NSString alloc] initWithUTF8String:name.utf8().get_data()] autorelease];
+ GKAchievement *achievement = [[[GKAchievement alloc] initWithIdentifier:name_str] autorelease];
ERR_FAIL_COND_V(!achievement, FAILED);
ERR_FAIL_COND_V([GKAchievement respondsToSelector:@selector(reportAchievements)], ERR_UNAVAILABLE);
@@ -157,19 +159,20 @@ Error GameCenter::award_achievement(Variant p_params) {
achievement.showsCompletionBanner = params["show_completion_banner"] ? YES : NO;
}
- [GKAchievement reportAchievements:@[achievement] withCompletionHandler:^(NSError *error) {
+ [GKAchievement reportAchievements:@[ achievement ]
+ withCompletionHandler:^(NSError *error) {
- Dictionary ret;
- ret["type"] = "award_achievement";
- if (error == nil) {
- ret["result"] = "ok";
- } else {
- ret["result"] = "error";
- ret["error_code"] = error.code;
- };
+ Dictionary ret;
+ ret["type"] = "award_achievement";
+ if (error == nil) {
+ ret["result"] = "ok";
+ } else {
+ ret["result"] = "error";
+ ret["error_code"] = error.code;
+ };
- pending_events.push_back(ret);
- }];
+ pending_events.push_back(ret);
+ }];
return OK;
};
@@ -190,11 +193,11 @@ void GameCenter::request_achievement_descriptions() {
Array hidden;
Array replayable;
- for (int i=0; i<[descriptions count]; i++) {
+ for (int i = 0; i < [descriptions count]; i++) {
- GKAchievementDescription* description = [descriptions objectAtIndex:i];
+ GKAchievementDescription *description = [descriptions objectAtIndex:i];
- const char* str = [description.identifier UTF8String];
+ const char *str = [description.identifier UTF8String];
names.push_back(String::utf8(str != NULL ? str : ""));
str = [description.title UTF8String];
@@ -230,7 +233,6 @@ void GameCenter::request_achievement_descriptions() {
}];
};
-
void GameCenter::request_achievements() {
[GKAchievement loadAchievementsWithCompletionHandler:^(NSArray *achievements, NSError *error) {
@@ -242,10 +244,10 @@ void GameCenter::request_achievements() {
PoolStringArray names;
PoolRealArray percentages;
- for (int i=0; i<[achievements count]; i++) {
+ for (int i = 0; i < [achievements count]; i++) {
- GKAchievement* achievement = [achievements objectAtIndex:i];
- const char* str = [achievement.identifier UTF8String];
+ GKAchievement *achievement = [achievements objectAtIndex:i];
+ const char *str = [achievement.identifier UTF8String];
names.push_back(String::utf8(str != NULL ? str : ""));
percentages.push_back(achievement.percentComplete);
@@ -265,8 +267,7 @@ void GameCenter::request_achievements() {
void GameCenter::reset_achievements() {
- [GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error)
- {
+ [GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error) {
Dictionary ret;
ret["type"] = "reset_achievements";
if (error == nil) {
@@ -291,17 +292,13 @@ Error GameCenter::show_game_center(Variant p_params) {
String view_name = params["view"];
if (view_name == "default") {
view_state = GKGameCenterViewControllerStateDefault;
- }
- else if (view_name == "leaderboards") {
+ } else if (view_name == "leaderboards") {
view_state = GKGameCenterViewControllerStateLeaderboards;
- }
- else if (view_name == "achievements") {
+ } else if (view_name == "achievements") {
view_state = GKGameCenterViewControllerStateAchievements;
- }
- else if (view_name == "challenges") {
+ } else if (view_name == "challenges") {
view_state = GKGameCenterViewControllerStateChallenges;
- }
- else {
+ } else {
return ERR_INVALID_PARAMETER;
}
}
@@ -309,7 +306,7 @@ Error GameCenter::show_game_center(Variant p_params) {
GKGameCenterViewController *controller = [[GKGameCenterViewController alloc] init];
ERR_FAIL_COND_V(!controller, FAILED);
- ViewController *root_controller=(ViewController *)((AppDelegate *)[[UIApplication sharedApplication] delegate]).window.rootViewController;
+ ViewController *root_controller = (ViewController *)((AppDelegate *)[[UIApplication sharedApplication] delegate]).window.rootViewController;
ERR_FAIL_COND_V(!root_controller, FAILED);
controller.gameCenterDelegate = root_controller;
@@ -318,12 +315,12 @@ Error GameCenter::show_game_center(Variant p_params) {
controller.leaderboardIdentifier = nil;
if (params.has("leaderboard_name")) {
String name = params["leaderboard_name"];
- NSString* name_str = [[[NSString alloc] initWithUTF8String:name.utf8().get_data()] autorelease];
+ NSString *name_str = [[[NSString alloc] initWithUTF8String:name.utf8().get_data()] autorelease];
controller.leaderboardIdentifier = name_str;
}
}
- [root_controller presentViewController: controller animated: YES completion:nil];
+ [root_controller presentViewController:controller animated:YES completion:nil];
return OK;
};
@@ -331,7 +328,7 @@ Error GameCenter::show_game_center(Variant p_params) {
void GameCenter::game_center_closed() {
Dictionary ret;
- ret["type"] = "show_game_center";
+ ret["type"] = "show_game_center";
ret["result"] = "ok";
pending_events.push_back(ret);
}
@@ -349,7 +346,7 @@ Variant GameCenter::pop_pending_event() {
return front;
};
-GameCenter* GameCenter::get_singleton() {
+GameCenter *GameCenter::get_singleton() {
return instance;
};
@@ -359,9 +356,6 @@ GameCenter::GameCenter() {
connected = false;
};
-
-GameCenter::~GameCenter() {
-
-};
+GameCenter::~GameCenter(){};
#endif
diff --git a/platform/iphone/gl_view.h b/platform/iphone/gl_view.h
index 555e34a895..14e9a66a4a 100644
--- a/platform/iphone/gl_view.h
+++ b/platform/iphone/gl_view.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm
index 6850b6be38..f2778e8165 100755..100644
--- a/platform/iphone/gl_view.mm
+++ b/platform/iphone/gl_view.mm
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,15 +27,15 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+#import "gl_view.h"
-#import <QuartzCore/QuartzCore.h>
-#import <OpenGLES/EAGLDrawable.h>
-#include "os_iphone.h"
#include "core/os/keyboard.h"
-#include "core/global_config.h"
+#include "core/project_settings.h"
+#include "os_iphone.h"
#include "servers/audio_server.h"
-#import "gl_view.h"
+#import <OpenGLES/EAGLDrawable.h>
+#import <QuartzCore/QuartzCore.h>
/*
@interface GLView (private)
@@ -47,7 +48,7 @@
int gl_view_base_fb;
static String keyboard_text;
-static GLView* _instance = NULL;
+static GLView *_instance = NULL;
static bool video_found_error = false;
static bool video_playing = false;
@@ -76,23 +77,24 @@ void _hide_keyboard() {
};
bool _play_video(String p_path, float p_volume, String p_audio_track, String p_subtitle_track) {
- p_path = GlobalConfig::get_singleton()->globalize_path(p_path);
+ p_path = ProjectSettings::get_singleton()->globalize_path(p_path);
- NSString* file_path = [[[NSString alloc] initWithUTF8String:p_path.utf8().get_data()] autorelease];
+ NSString *file_path = [[[NSString alloc] initWithUTF8String:p_path.utf8().get_data()] autorelease];
_instance.avAsset = [AVAsset assetWithURL:[NSURL fileURLWithPath:file_path]];
- _instance.avPlayerItem =[[AVPlayerItem alloc]initWithAsset:_instance.avAsset];
+ _instance.avPlayerItem = [[AVPlayerItem alloc] initWithAsset:_instance.avAsset];
[_instance.avPlayerItem addObserver:_instance forKeyPath:@"status" options:0 context:nil];
- _instance.avPlayer = [[AVPlayer alloc]initWithPlayerItem:_instance.avPlayerItem];
- _instance.avPlayerLayer =[AVPlayerLayer playerLayerWithPlayer:_instance.avPlayer];
+ _instance.avPlayer = [[AVPlayer alloc] initWithPlayerItem:_instance.avPlayerItem];
+ _instance.avPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:_instance.avPlayer];
[_instance.avPlayer addObserver:_instance forKeyPath:@"status" options:0 context:nil];
- [[NSNotificationCenter defaultCenter] addObserver:_instance
- selector:@selector(playerItemDidReachEnd:)
- name:AVPlayerItemDidPlayToEndTimeNotification
- object:[_instance.avPlayer currentItem]];
+ [[NSNotificationCenter defaultCenter]
+ addObserver:_instance
+ selector:@selector(playerItemDidReachEnd:)
+ name:AVPlayerItemDidPlayToEndTimeNotification
+ object:[_instance.avPlayer currentItem]];
[_instance.avPlayer addObserver:_instance forKeyPath:@"rate" options:NSKeyValueObservingOptionNew context:0];
@@ -100,16 +102,14 @@ bool _play_video(String p_path, float p_volume, String p_audio_track, String p_s
[_instance.layer addSublayer:_instance.avPlayerLayer];
[_instance.avPlayer play];
- AVMediaSelectionGroup *audioGroup = [_instance.avAsset mediaSelectionGroupForMediaCharacteristic: AVMediaCharacteristicAudible];
+ AVMediaSelectionGroup *audioGroup = [_instance.avAsset mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicAudible];
NSMutableArray *allAudioParams = [NSMutableArray array];
- for (id track in audioGroup.options)
- {
- NSString* language = [[track locale] localeIdentifier];
+ for (id track in audioGroup.options) {
+ NSString *language = [[track locale] localeIdentifier];
NSLog(@"subtitle lang: %@", language);
- if ([language isEqualToString:[NSString stringWithUTF8String:p_audio_track.utf8()]])
- {
+ if ([language isEqualToString:[NSString stringWithUTF8String:p_audio_track.utf8()]]) {
AVMutableAudioMixInputParameters *audioInputParams = [AVMutableAudioMixInputParameters audioMixInputParameters];
[audioInputParams setVolume:p_volume atTime:kCMTimeZero];
[audioInputParams setTrackID:[track trackID]];
@@ -118,26 +118,24 @@ bool _play_video(String p_path, float p_volume, String p_audio_track, String p_s
AVMutableAudioMix *audioMix = [AVMutableAudioMix audioMix];
[audioMix setInputParameters:allAudioParams];
- [_instance.avPlayer.currentItem selectMediaOption:track inMediaSelectionGroup: audioGroup];
+ [_instance.avPlayer.currentItem selectMediaOption:track inMediaSelectionGroup:audioGroup];
[_instance.avPlayer.currentItem setAudioMix:audioMix];
- break;
- }
+ break;
+ }
}
- AVMediaSelectionGroup *subtitlesGroup = [_instance.avAsset mediaSelectionGroupForMediaCharacteristic: AVMediaCharacteristicLegible];
+ AVMediaSelectionGroup *subtitlesGroup = [_instance.avAsset mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicLegible];
NSArray *useableTracks = [AVMediaSelectionGroup mediaSelectionOptionsFromArray:subtitlesGroup.options withoutMediaCharacteristics:[NSArray arrayWithObject:AVMediaCharacteristicContainsOnlyForcedSubtitles]];
- for (id track in useableTracks)
- {
- NSString* language = [[track locale] localeIdentifier];
+ for (id track in useableTracks) {
+ NSString *language = [[track locale] localeIdentifier];
NSLog(@"subtitle lang: %@", language);
- if ([language isEqualToString:[NSString stringWithUTF8String:p_subtitle_track.utf8()]])
- {
- [_instance.avPlayer.currentItem selectMediaOption:track inMediaSelectionGroup: subtitlesGroup];
- break;
- }
+ if ([language isEqualToString:[NSString stringWithUTF8String:p_subtitle_track.utf8()]]) {
+ [_instance.avPlayer.currentItem selectMediaOption:track inMediaSelectionGroup:subtitlesGroup];
+ break;
+ }
}
video_playing = true;
@@ -181,19 +179,19 @@ void _stop_video() {
@synthesize animationInterval;
static const int max_touches = 8;
-static UITouch* touches[max_touches];
+static UITouch *touches[max_touches];
static void init_touches() {
- for (int i=0; i<max_touches; i++) {
+ for (int i = 0; i < max_touches; i++) {
touches[i] = NULL;
};
};
-static int get_touch_id(UITouch* p_touch) {
+static int get_touch_id(UITouch *p_touch) {
int first = -1;
- for (int i=0; i<max_touches; i++) {
+ for (int i = 0; i < max_touches; i++) {
if (first == -1 && touches[i] == NULL) {
first = i;
continue;
@@ -210,10 +208,10 @@ static int get_touch_id(UITouch* p_touch) {
return -1;
};
-static int remove_touch(UITouch* p_touch) {
+static int remove_touch(UITouch *p_touch) {
int remaining = 0;
- for (int i=0; i<max_touches; i++) {
+ for (int i = 0; i < max_touches; i++) {
if (touches[i] == NULL)
continue;
@@ -225,9 +223,9 @@ static int remove_touch(UITouch* p_touch) {
return remaining;
};
-static int get_first_id(UITouch* p_touch) {
+static int get_first_id(UITouch *p_touch) {
- for (int i=0; i<max_touches; i++) {
+ for (int i = 0; i < max_touches; i++) {
if (touches[i] != NULL)
return i;
@@ -237,7 +235,7 @@ static int get_first_id(UITouch* p_touch) {
static void clear_touches() {
- for (int i=0; i<max_touches; i++) {
+ for (int i = 0; i < max_touches; i++) {
touches[i] = NULL;
};
@@ -245,39 +243,36 @@ static void clear_touches() {
// Implement this to override the default layer class (which is [CALayer class]).
// We do this so that our view will be backed by a layer that is capable of OpenGL ES rendering.
-+ (Class) layerClass
-{
++ (Class)layerClass {
return [CAEAGLLayer class];
}
//The GL view is stored in the nib file. When it's unarchived it's sent -initWithCoder:
-- (id)initWithCoder:(NSCoder*)coder
-{
+- (id)initWithCoder:(NSCoder *)coder {
active = FALSE;
- if((self = [super initWithCoder:coder]))
- {
+ if ((self = [super initWithCoder:coder])) {
self = [self initGLES];
}
return self;
}
--(id)initGLES
-{
+- (id)initGLES {
// Get our backing layer
- CAEAGLLayer *eaglLayer = (CAEAGLLayer*) self.layer;
+ CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
// Configure it so that it is opaque, does not retain the contents of the backbuffer when displayed, and uses RGBA8888 color.
eaglLayer.opaque = YES;
- eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking,
- kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat,
- nil];
+ eaglLayer.drawableProperties = [NSDictionary
+ dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:FALSE],
+ kEAGLDrawablePropertyRetainedBacking,
+ kEAGLColorFormatRGBA8,
+ kEAGLDrawablePropertyColorFormat,
+ nil];
// Create our EAGLContext, and if successful make it current and create our framebuffer.
context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
- if(!context || ![EAGLContext setCurrentContext:context] || ![self createFramebuffer])
- {
+ if (!context || ![EAGLContext setCurrentContext:context] || ![self createFramebuffer]) {
[self release];
return nil;
}
@@ -287,14 +282,12 @@ static void clear_touches() {
return self;
}
--(id<GLViewDelegate>)delegate
-{
+- (id<GLViewDelegate>)delegate {
return delegate;
}
// Update the delegate, and if it needs a -setupView: call, set our internal flag so that it will be called.
--(void)setDelegate:(id<GLViewDelegate>)d
-{
+- (void)setDelegate:(id<GLViewDelegate>)d {
delegate = d;
delegateSetup = ![delegate respondsToSelector:@selector(setupView:)];
}
@@ -305,21 +298,18 @@ static void clear_touches() {
// This is the perfect opportunity to also update the framebuffer so that it is
// the same size as our display area.
--(void)layoutSubviews
-{
+- (void)layoutSubviews {
//printf("HERE\n");
[EAGLContext setCurrentContext:context];
[self destroyFramebuffer];
[self createFramebuffer];
[self drawView];
[self drawView];
-
}
-- (BOOL)createFramebuffer
-{
+- (BOOL)createFramebuffer {
// Generate IDs for a framebuffer object and a color renderbuffer
- UIScreen* mainscr = [UIScreen mainScreen];
+ UIScreen *mainscr = [UIScreen mainScreen];
printf("******** screen size %i, %i\n", (int)mainscr.currentMode.size.width, (int)mainscr.currentMode.size.height);
float minPointSize = MIN(mainscr.bounds.size.width, mainscr.bounds.size.height);
float minScreenSize = MIN(mainscr.currentMode.size.width, mainscr.currentMode.size.height);
@@ -344,8 +334,7 @@ static void clear_touches() {
glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT16_OES, backingWidth, backingHeight);
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer);
- if(glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES)
- {
+ if (glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) {
NSLog(@"failed to make complete framebuffer object %x", glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES));
return NO;
}
@@ -365,22 +354,19 @@ static void clear_touches() {
}
// Clean up any buffers we have allocated.
-- (void)destroyFramebuffer
-{
+- (void)destroyFramebuffer {
glDeleteFramebuffersOES(1, &viewFramebuffer);
viewFramebuffer = 0;
glDeleteRenderbuffersOES(1, &viewRenderbuffer);
viewRenderbuffer = 0;
- if(depthRenderbuffer)
- {
+ if (depthRenderbuffer) {
glDeleteRenderbuffersOES(1, &depthRenderbuffer);
depthRenderbuffer = 0;
}
}
-- (void)startAnimation
-{
+- (void)startAnimation {
if (active)
return;
active = TRUE;
@@ -389,26 +375,23 @@ static void clear_touches() {
// Approximate frame rate
// assumes device refreshes at 60 fps
- int frameInterval = (int) floor(animationInterval * 60.0f);
+ int frameInterval = (int)floor(animationInterval * 60.0f);
displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(drawView)];
[displayLink setFrameInterval:frameInterval];
// Setup DisplayLink in main thread
[displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
- }
- else {
+ } else {
animationTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval target:self selector:@selector(drawView) userInfo:nil repeats:YES];
}
- if (video_playing)
- {
+ if (video_playing) {
_unpause_video();
}
}
-- (void)stopAnimation
-{
+- (void)stopAnimation {
if (!active)
return;
active = FALSE;
@@ -417,41 +400,38 @@ static void clear_touches() {
if (useCADisplayLink) {
[displayLink invalidate];
displayLink = nil;
- }
- else {
+ } else {
[animationTimer invalidate];
animationTimer = nil;
}
clear_touches();
- if (video_playing)
- {
+ if (video_playing) {
// save position
}
}
-- (void)setAnimationInterval:(NSTimeInterval)interval
-{
+- (void)setAnimationInterval:(NSTimeInterval)interval {
animationInterval = interval;
- if ( (useCADisplayLink && displayLink) || ( !useCADisplayLink && animationTimer ) ) {
+ if ((useCADisplayLink && displayLink) || (!useCADisplayLink && animationTimer)) {
[self stopAnimation];
[self startAnimation];
}
}
// Updates the OpenGL view when the timer fires
-- (void)drawView
-{
+- (void)drawView {
if (useCADisplayLink) {
// Pause the CADisplayLink to avoid recursion
- [displayLink setPaused: YES];
+ [displayLink setPaused:YES];
// Process all input events
- while(CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE) == kCFRunLoopRunHandledSource);
+ while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE) == kCFRunLoopRunHandledSource)
+ ;
// We are good to go, resume the CADisplayLink
- [displayLink setPaused: NO];
+ [displayLink setPaused:NO];
}
if (!active) {
@@ -463,8 +443,7 @@ static void clear_touches() {
[EAGLContext setCurrentContext:context];
// If our drawing delegate needs to have the view setup, then call -setupView: and flag that it won't need to be called again.
- if(!delegateSetup)
- {
+ if (!delegateSetup) {
[delegate setupView:self];
delegateSetup = YES;
}
@@ -478,19 +457,18 @@ static void clear_touches() {
#ifdef DEBUG_ENABLED
GLenum err = glGetError();
- if(err)
+ if (err)
NSLog(@"%x error", err);
#endif
}
-- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
-{
- NSArray* tlist = [[event allTouches] allObjects];
- for (unsigned int i=0; i< [tlist count]; i++) {
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ NSArray *tlist = [[event allTouches] allObjects];
+ for (unsigned int i = 0; i < [tlist count]; i++) {
- if ( [touches containsObject:[tlist objectAtIndex:i]] ) {
+ if ([touches containsObject:[tlist objectAtIndex:i]]) {
- UITouch* touch = [tlist objectAtIndex:i];
+ UITouch *touch = [tlist objectAtIndex:i];
if (touch.phase != UITouchPhaseBegan)
continue;
int tid = get_touch_id(touch);
@@ -501,15 +479,14 @@ static void clear_touches() {
};
}
-- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
-{
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
- NSArray* tlist = [[event allTouches] allObjects];
- for (unsigned int i=0; i< [tlist count]; i++) {
+ NSArray *tlist = [[event allTouches] allObjects];
+ for (unsigned int i = 0; i < [tlist count]; i++) {
- if ( [touches containsObject:[tlist objectAtIndex:i]] ) {
+ if ([touches containsObject:[tlist objectAtIndex:i]]) {
- UITouch* touch = [tlist objectAtIndex:i];
+ UITouch *touch = [tlist objectAtIndex:i];
if (touch.phase != UITouchPhaseMoved)
continue;
int tid = get_touch_id(touch);
@@ -520,17 +497,15 @@ static void clear_touches() {
OSIPhone::get_singleton()->mouse_move(tid, prev_point.x * self.contentScaleFactor, prev_point.y * self.contentScaleFactor, touchPoint.x * self.contentScaleFactor, touchPoint.y * self.contentScaleFactor, first == tid);
};
};
-
}
-- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
-{
- NSArray* tlist = [[event allTouches] allObjects];
- for (unsigned int i=0; i< [tlist count]; i++) {
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
+ NSArray *tlist = [[event allTouches] allObjects];
+ for (unsigned int i = 0; i < [tlist count]; i++) {
- if ( [touches containsObject:[tlist objectAtIndex:i]] ) {
+ if ([touches containsObject:[tlist objectAtIndex:i]]) {
- UITouch* touch = [tlist objectAtIndex:i];
+ UITouch *touch = [tlist objectAtIndex:i];
if (touch.phase != UITouchPhaseEnded)
continue;
int tid = get_touch_id(touch);
@@ -552,7 +527,6 @@ static void clear_touches() {
return YES;
};
-
- (void)open_keyboard {
//keyboard_text = p_existing;
[self becomeFirstResponder];
@@ -577,12 +551,11 @@ static void clear_touches() {
String character;
character.parse_utf8([p_text UTF8String]);
keyboard_text = keyboard_text + character;
- OSIPhone::get_singleton()->key(character[0] == 10 ? KEY_ENTER : character[0] , true);
+ OSIPhone::get_singleton()->key(character[0] == 10 ? KEY_ENTER : character[0], true);
printf("inserting text with character %i\n", character[0]);
};
-- (void)audioRouteChangeListenerCallback:(NSNotification*)notification
-{
+- (void)audioRouteChangeListenerCallback:(NSNotification *)notification {
printf("*********** route changed!\n");
NSDictionary *interuptionDict = notification.userInfo;
@@ -590,49 +563,48 @@ static void clear_touches() {
switch (routeChangeReason) {
- case AVAudioSessionRouteChangeReasonNewDeviceAvailable:
+ case AVAudioSessionRouteChangeReasonNewDeviceAvailable: {
NSLog(@"AVAudioSessionRouteChangeReasonNewDeviceAvailable");
NSLog(@"Headphone/Line plugged in");
- break;
+ }; break;
- case AVAudioSessionRouteChangeReasonOldDeviceUnavailable:
+ case AVAudioSessionRouteChangeReasonOldDeviceUnavailable: {
NSLog(@"AVAudioSessionRouteChangeReasonOldDeviceUnavailable");
NSLog(@"Headphone/Line was pulled. Resuming video play....");
if (_is_video_playing()) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5f * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
- [_instance.avPlayer play]; // NOTE: change this line according your current player implementation
- NSLog(@"resumed play");
+ [_instance.avPlayer play]; // NOTE: change this line according your current player implementation
+ NSLog(@"resumed play");
});
};
- break;
+ }; break;
- case AVAudioSessionRouteChangeReasonCategoryChange:
+ case AVAudioSessionRouteChangeReasonCategoryChange: {
// called at start - also when other audio wants to play
NSLog(@"AVAudioSessionRouteChangeReasonCategoryChange");
- break;
+ }; break;
}
}
-
// When created via code however, we get initWithFrame
--(id)initWithFrame:(CGRect)frame
-{
+- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
_instance = self;
printf("after init super %p\n", self);
- if(self != nil)
- {
+ if (self != nil) {
self = [self initGLES];
printf("after init gles %p\n", self);
}
init_touches();
- self. multipleTouchEnabled = YES;
+ self.multipleTouchEnabled = YES;
printf("******** adding observer for sound routing changes\n");
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(audioRouteChangeListenerCallback:)
- name:AVAudioSessionRouteChangeNotification
- object:nil];
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(audioRouteChangeListenerCallback:)
+ name:AVAudioSessionRouteChangeNotification
+ object:nil];
//self.autoresizesSubviews = YES;
//[self setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth];
@@ -640,21 +612,19 @@ static void clear_touches() {
return self;
}
-// -(BOOL)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers {
-// return YES;
-// }
+//- (BOOL)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers {
+// return YES;
+//}
-// - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
-// return YES;
-// }
+//- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
+// return YES;
+//}
// Stop animating and release resources when they are no longer needed.
-- (void)dealloc
-{
+- (void)dealloc {
[self stopAnimation];
- if([EAGLContext currentContext] == context)
- {
+ if ([EAGLContext currentContext] == context) {
[EAGLContext setCurrentContext:nil];
}
@@ -664,32 +634,31 @@ static void clear_touches() {
[super dealloc];
}
-- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
- change:(NSDictionary *)change context:(void *)context {
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if (object == _instance.avPlayerItem && [keyPath isEqualToString:@"status"]) {
- if (_instance.avPlayerItem.status == AVPlayerStatusFailed || _instance.avPlayer.status == AVPlayerStatusFailed) {
- _stop_video();
- video_found_error = true;
- }
+ if (_instance.avPlayerItem.status == AVPlayerStatusFailed || _instance.avPlayer.status == AVPlayerStatusFailed) {
+ _stop_video();
+ video_found_error = true;
+ }
- if(_instance.avPlayer.status == AVPlayerStatusReadyToPlay &&
- _instance.avPlayerItem.status == AVPlayerItemStatusReadyToPlay &&
- CMTIME_COMPARE_INLINE(video_current_time, ==, kCMTimeZero)) {
+ if (_instance.avPlayer.status == AVPlayerStatusReadyToPlay &&
+ _instance.avPlayerItem.status == AVPlayerItemStatusReadyToPlay &&
+ CMTIME_COMPARE_INLINE(video_current_time, ==, kCMTimeZero)) {
- //NSLog(@"time: %@", video_current_time);
+ //NSLog(@"time: %@", video_current_time);
- [_instance.avPlayer seekToTime:video_current_time];
- video_current_time = kCMTimeZero;
+ [_instance.avPlayer seekToTime:video_current_time];
+ video_current_time = kCMTimeZero;
}
- }
+ }
if (object == _instance.avPlayer && [keyPath isEqualToString:@"rate"]) {
NSLog(@"Player playback rate changed: %.5f", _instance.avPlayer.rate);
if (_is_video_playing() && _instance.avPlayer.rate == 0.0 && !_instance.avPlayer.error) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5f * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
- [_instance.avPlayer play]; // NOTE: change this line according your current player implementation
- NSLog(@"resumed play");
+ [_instance.avPlayer play]; // NOTE: change this line according your current player implementation
+ NSLog(@"resumed play");
});
NSLog(@" . . . PAUSED (or just started)");
@@ -698,40 +667,40 @@ static void clear_touches() {
}
- (void)playerItemDidReachEnd:(NSNotification *)notification {
- _stop_video();
+ _stop_video();
}
/*
- (void)moviePlayBackDidFinish:(NSNotification*)notification {
- NSNumber* reason = [[notification userInfo] objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey];
- switch ([reason intValue]) {
- case MPMovieFinishReasonPlaybackEnded:
- //NSLog(@"Playback Ended");
- break;
- case MPMovieFinishReasonPlaybackError:
- //NSLog(@"Playback Error");
- video_found_error = true;
- break;
- case MPMovieFinishReasonUserExited:
- //NSLog(@"User Exited");
- video_found_error = true;
- break;
- default:
- //NSLog(@"Unsupported reason!");
- break;
- }
-
- MPMoviePlayerController *player = [notification object];
-
- [[NSNotificationCenter defaultCenter]
- removeObserver:self
- name:MPMoviePlayerPlaybackDidFinishNotification
- object:player];
-
- [_instance.moviePlayerController stop];
- [_instance.moviePlayerController.view removeFromSuperview];
+ NSNumber* reason = [[notification userInfo] objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey];
+ switch ([reason intValue]) {
+ case MPMovieFinishReasonPlaybackEnded:
+ //NSLog(@"Playback Ended");
+ break;
+ case MPMovieFinishReasonPlaybackError:
+ //NSLog(@"Playback Error");
+ video_found_error = true;
+ break;
+ case MPMovieFinishReasonUserExited:
+ //NSLog(@"User Exited");
+ video_found_error = true;
+ break;
+ default:
+ //NSLog(@"Unsupported reason!");
+ break;
+ }
+
+ MPMoviePlayerController *player = [notification object];
+
+ [[NSNotificationCenter defaultCenter]
+ removeObserver:self
+ name:MPMoviePlayerPlaybackDidFinishNotification
+ object:player];
+
+ [_instance.moviePlayerController stop];
+ [_instance.moviePlayerController.view removeFromSuperview];
//[[MPMusicPlayerController applicationMusicPlayer] setVolume: video_previous_volume];
video_playing = false;
diff --git a/platform/iphone/globals/global_defaults.cpp b/platform/iphone/globals/global_defaults.cpp
index b3067dc0c4..aa4662302d 100644
--- a/platform/iphone/globals/global_defaults.cpp
+++ b/platform/iphone/globals/global_defaults.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,14 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "global_defaults.h"
-#include "global_config.h"
+#include "project_settings.h"
void register_iphone_global_defaults() {
/*GLOBAL_DEF("rasterizer.iOS/use_fragment_lighting",false);
GLOBAL_DEF("rasterizer.iOS/fp16_framebuffer",false);
GLOBAL_DEF("display.iOS/driver","GLES2");
- GlobalConfig::get_singleton()->set_custom_property_info("display.iOS/driver",PropertyInfo(Variant::STRING,"display.iOS/driver",PROPERTY_HINT_ENUM,"GLES1,GLES2"));
+ ProjectSettings::get_singleton()->set_custom_property_info("display.iOS/driver",PropertyInfo(Variant::STRING,"display.iOS/driver",PROPERTY_HINT_ENUM,"GLES1,GLES2"));
GLOBAL_DEF("display.iOS/use_cadisplaylink",true);
*/
}
diff --git a/platform/iphone/globals/global_defaults.h b/platform/iphone/globals/global_defaults.h
index 1432b74425..6fe1027287 100644
--- a/platform/iphone/globals/global_defaults.h
+++ b/platform/iphone/globals/global_defaults.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/godot_iphone.cpp b/platform/iphone/godot_iphone.cpp
index 626c78fdf4..4d34ebedf9 100644
--- a/platform/iphone/godot_iphone.cpp
+++ b/platform/iphone/godot_iphone.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/icloud.h b/platform/iphone/icloud.h
index 743a9a5de3..67d12a990a 100644
--- a/platform/iphone/icloud.h
+++ b/platform/iphone/icloud.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/icloud.mm b/platform/iphone/icloud.mm
index a9b23baaeb..94c3d2ef91 100644
--- a/platform/iphone/icloud.mm
+++ b/platform/iphone/icloud.mm
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,24 +35,25 @@
extern "C" {
#endif
-#import <Foundation/Foundation.h>
#import "app_delegate.h"
+#import <Foundation/Foundation.h>
+
#ifndef __IPHONE_9_0
};
#endif
-ICloud* ICloud::instance = NULL;
+ICloud *ICloud::instance = NULL;
void ICloud::_bind_methods() {
- 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);
+ 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() {
@@ -67,19 +69,18 @@ Variant ICloud::pop_pending_event() {
return front;
};
-ICloud* ICloud::get_singleton() {
+ICloud *ICloud::get_singleton() {
return instance;
};
//convert from apple's abstract type to godot's abstract type....
-Variant nsobject_to_variant(NSObject* object) {
+Variant nsobject_to_variant(NSObject *object) {
if ([object isKindOfClass:[NSString class]]) {
- const char* str = [(NSString*)object UTF8String];
+ const char *str = [(NSString *)object UTF8String];
return String::utf8(str != NULL ? str : "");
- }
- else if ([object isKindOfClass:[NSData class]]) {
+ } else if ([object isKindOfClass:[NSData class]]) {
PoolByteArray ret;
- NSData* data = (NSData*)object;
+ NSData *data = (NSData *)object;
if ([data length] > 0) {
ret.resize([data length]);
{
@@ -88,95 +89,78 @@ Variant nsobject_to_variant(NSObject* object) {
}
}
return ret;
- }
- else if ([object isKindOfClass:[NSArray class]]) {
+ } else if ([object isKindOfClass:[NSArray class]]) {
Array result;
- NSArray* array = (NSArray*)object;
+ NSArray *array = (NSArray *)object;
for (unsigned int i = 0; i < [array count]; ++i) {
- NSObject* value = [array objectAtIndex:i];
+ NSObject *value = [array objectAtIndex:i];
result.push_back(nsobject_to_variant(value));
}
return result;
- }
- else if ([object isKindOfClass:[NSDictionary class]]) {
+ } else if ([object isKindOfClass:[NSDictionary class]]) {
Dictionary result;
- NSDictionary* dic = (NSDictionary*)object;
+ NSDictionary *dic = (NSDictionary *)object;
-
- NSArray* keys = [dic allKeys];
+ NSArray *keys = [dic allKeys];
int count = [keys count];
- for (int i=0; i < count; ++i) {
- NSObject* k = [ keys objectAtIndex:i];
- NSObject* v = [dic objectForKey:k];
+ for (int i = 0; i < count; ++i) {
+ NSObject *k = [keys objectAtIndex:i];
+ NSObject *v = [dic objectForKey:k];
result[nsobject_to_variant(k)] = nsobject_to_variant(v);
}
return result;
- }
- else if ([object isKindOfClass:[NSNumber class]]) {
+ } else if ([object isKindOfClass:[NSNumber class]]) {
//Every type except numbers can reliably identify its type. The following is comparing to the *internal* representation, which isn't guaranteed to match the type that was used to create it, and is not advised, particularly when dealing with potential platform differences (ie, 32/64 bit)
//To avoid errors, we'll cast as broadly as possible, and only return int or float.
//bool, char, int, uint, longlong -> int
//float, double -> float
- NSNumber* num = (NSNumber*)object;
- if(strcmp([num objCType], @encode(BOOL)) == 0) {
+ NSNumber *num = (NSNumber *)object;
+ if (strcmp([num objCType], @encode(BOOL)) == 0) {
return Variant((int)[num boolValue]);
- }
- else if(strcmp([num objCType], @encode(char)) == 0) {
+ } else if (strcmp([num objCType], @encode(char)) == 0) {
return Variant((int)[num charValue]);
- }
- else if(strcmp([num objCType], @encode(int)) == 0) {
+ } else if (strcmp([num objCType], @encode(int)) == 0) {
return Variant([num intValue]);
- }
- else if(strcmp([num objCType], @encode(unsigned int)) == 0) {
+ } else if (strcmp([num objCType], @encode(unsigned int)) == 0) {
return Variant((int)[num unsignedIntValue]);
- }
- else if(strcmp([num objCType], @encode(long long)) == 0) {
+ } else if (strcmp([num objCType], @encode(long long)) == 0) {
return Variant((int)[num longValue]);
- }
- else if(strcmp([num objCType], @encode(float)) == 0) {
+ } else if (strcmp([num objCType], @encode(float)) == 0) {
return Variant([num floatValue]);
- }
- else if(strcmp([num objCType], @encode(double)) == 0) {
+ } else if (strcmp([num objCType], @encode(double)) == 0) {
return Variant((float)[num doubleValue]);
}
- }
- else if ([object isKindOfClass:[NSDate class]]) {
+ } else if ([object isKindOfClass:[NSDate class]]) {
//this is a type that icloud supports...but how did you submit it in the first place?
//I guess this is a type that *might* show up, if you were, say, trying to make your game
//compatible with existing cloud data written by another engine's version of your game
WARN_PRINT("NSDate unsupported, returning null Variant")
return Variant();
- }
- else if ([object isKindOfClass:[NSNull class]] or object == nil) {
+ } else if ([object isKindOfClass:[NSNull class]] or object == nil) {
return Variant();
- }
- else {
+ } else {
WARN_PRINT("Trying to convert unknown NSObject type to Variant");
return Variant();
}
}
-NSObject* variant_to_nsobject(Variant v) {
+NSObject *variant_to_nsobject(Variant v) {
if (v.get_type() == Variant::STRING) {
return [[[NSString alloc] initWithUTF8String:((String)v).utf8().get_data()] autorelease];
- }
- else if (v.get_type() == Variant::REAL) {
+ } else if (v.get_type() == Variant::REAL) {
return [NSNumber numberWithDouble:(double)v];
- }
- else if (v.get_type() == Variant::INT) {
+ } else if (v.get_type() == Variant::INT) {
return [NSNumber numberWithLongLong:(long)(int)v];
- }
- else if (v.get_type() == Variant::BOOL) {
+ } else if (v.get_type() == Variant::BOOL) {
return [NSNumber numberWithBool:BOOL((bool)v)];
- }
- else if (v.get_type() == Variant::DICTIONARY) {
- NSMutableDictionary* result = [[[NSMutableDictionary alloc] init] autorelease];
+ } else if (v.get_type() == Variant::DICTIONARY) {
+ NSMutableDictionary *result = [[[NSMutableDictionary alloc] init] autorelease];
Dictionary dic = v;
Array keys = dic.keys();
for (unsigned int i = 0; i < keys.size(); ++i) {
- NSString* key = [[[NSString alloc] initWithUTF8String:((String)(keys[i])).utf8().get_data()] autorelease];
- NSObject* value = variant_to_nsobject(dic[keys[i]]);
+ NSString *key = [[[NSString alloc] initWithUTF8String:((String)(keys[i])).utf8().get_data()] autorelease];
+ NSObject *value = variant_to_nsobject(dic[keys[i]]);
if (key == NULL || value == NULL) {
return NULL;
@@ -185,12 +169,11 @@ NSObject* variant_to_nsobject(Variant v) {
[result setObject:value forKey:key];
}
return result;
- }
- else if (v.get_type() == Variant::ARRAY) {
- NSMutableArray* result = [[[NSMutableArray alloc] init] autorelease];
+ } else if (v.get_type() == Variant::ARRAY) {
+ NSMutableArray *result = [[[NSMutableArray alloc] init] autorelease];
Array arr = v;
for (unsigned int i = 0; i < arr.size(); ++i) {
- NSObject* value = variant_to_nsobject(arr[i]);
+ NSObject *value = variant_to_nsobject(arr[i]);
if (value == NULL) {
//trying to add something unsupported to the array. cancel the whole array
return NULL;
@@ -198,21 +181,19 @@ NSObject* variant_to_nsobject(Variant v) {
[result addObject:value];
}
return result;
- }
- else if (v.get_type() == Variant::POOL_BYTE_ARRAY) {
+ } else if (v.get_type() == Variant::POOL_BYTE_ARRAY) {
PoolByteArray arr = v;
PoolByteArray::Read r = arr.read();
- NSData* result = [NSData dataWithBytes:r.ptr() length:arr.size()];
+ NSData *result = [NSData dataWithBytes:r.ptr() length:arr.size()];
return result;
}
- WARN_PRINT(String("Could not add unsupported type to iCloud: '" + Variant::get_type_name(v.get_type())+"'").utf8().get_data());
+ WARN_PRINT(String("Could not add unsupported type to iCloud: '" + Variant::get_type_name(v.get_type()) + "'").utf8().get_data());
return NULL;
}
-
Error ICloud::remove_key(Variant p_param) {
String param = p_param;
- NSString* key = [[[NSString alloc] initWithUTF8String:param.utf8().get_data()] autorelease];
+ NSString *key = [[[NSString alloc] initWithUTF8String:param.utf8().get_data()] autorelease];
NSUbiquitousKeyValueStore *store = [NSUbiquitousKeyValueStore defaultStore];
@@ -235,13 +216,13 @@ Variant ICloud::set_key_values(Variant p_params) {
String variant_key = keys[i];
Variant variant_value = params[variant_key];
- NSString* key = [[[NSString alloc] initWithUTF8String:variant_key.utf8().get_data()] autorelease];
+ NSString *key = [[[NSString alloc] initWithUTF8String:variant_key.utf8().get_data()] autorelease];
if (key == NULL) {
error_keys.push_back(variant_key);
continue;
}
- NSObject* value = variant_to_nsobject(variant_value);
+ NSObject *value = variant_to_nsobject(variant_value);
if (value == NULL) {
error_keys.push_back(variant_key);
@@ -258,7 +239,7 @@ Variant ICloud::set_key_values(Variant p_params) {
Variant ICloud::get_key_value(Variant p_param) {
String param = p_param;
- NSString* key = [[[NSString alloc] initWithUTF8String:param.utf8().get_data()] autorelease];
+ NSString *key = [[[NSString alloc] initWithUTF8String:param.utf8().get_data()] autorelease];
NSUbiquitousKeyValueStore *store = [NSUbiquitousKeyValueStore defaultStore];
if (![[store dictionaryRepresentation] objectForKey:key]) {
@@ -273,16 +254,16 @@ Variant ICloud::get_key_value(Variant p_param) {
Variant ICloud::get_all_key_values() {
Dictionary result;
- NSUbiquitousKeyValueStore* store = [NSUbiquitousKeyValueStore defaultStore];
- NSDictionary* store_dictionary = [store dictionaryRepresentation];
+ NSUbiquitousKeyValueStore *store = [NSUbiquitousKeyValueStore defaultStore];
+ NSDictionary *store_dictionary = [store dictionaryRepresentation];
- NSArray* keys = [store_dictionary allKeys];
+ NSArray *keys = [store_dictionary allKeys];
int count = [keys count];
- for (int i=0; i < count; ++i) {
- NSString* k = [ keys objectAtIndex:i];
- NSObject* v = [store_dictionary objectForKey:k];
+ for (int i = 0; i < count; ++i) {
+ NSString *k = [keys objectAtIndex:i];
+ NSObject *v = [store_dictionary objectForKey:k];
- const char* str = [k UTF8String];
+ const char *str = [k UTF8String];
if (str != NULL) {
result[String::utf8(str)] = nsobject_to_variant(v);
}
@@ -296,8 +277,7 @@ Error ICloud::synchronize_key_values() {
BOOL result = [store synchronize];
if (result == YES) {
return OK;
- }
- else {
+ } else {
return FAILED;
}
}
@@ -306,14 +286,14 @@ Error ICloud::initial_sync() {
//you sometimes have to write something to the store to get it to download new data. go apple!
NSUbiquitousKeyValueStore *store = [NSUbiquitousKeyValueStore defaultStore];
if ([store boolForKey:@"isb"])
- {
- [store setBool:NO forKey:@"isb"];
- }
- else
- {
- [store setBool:YES forKey:@"isb"];
- }
- return synchronize();
+ {
+ [store setBool:NO forKey:@"isb"];
+ }
+ else
+ {
+ [store setBool:YES forKey:@"isb"];
+ }
+ return synchronize();
}
*/
ICloud::ICloud() {
@@ -321,65 +301,56 @@ ICloud::ICloud() {
instance = this;
//connected = false;
- [
- //[NSNotificationCenter defaultCenter] addObserverForName: @"notify"
- [NSNotificationCenter defaultCenter] addObserverForName: NSUbiquitousKeyValueStoreDidChangeExternallyNotification
- object: [NSUbiquitousKeyValueStore defaultStore]
- queue: nil
- usingBlock: ^ (NSNotification * notification) {
- NSDictionary* userInfo = [notification userInfo];
- NSInteger change = [[userInfo objectForKey:NSUbiquitousKeyValueStoreChangeReasonKey] integerValue];
-
- Dictionary ret;
- ret["type"] = "key_value_changed";
-
- //PoolStringArray result_keys;
- //Array result_values;
- Dictionary keyValues;
- String reason = "";
-
- if (change == NSUbiquitousKeyValueStoreServerChange) {
- reason = "server";
- }
- else if (change == NSUbiquitousKeyValueStoreInitialSyncChange) {
- reason = "initial_sync";
- }
- else if (change == NSUbiquitousKeyValueStoreQuotaViolationChange) {
- reason = "quota_violation";
- }
- else if (change == NSUbiquitousKeyValueStoreAccountChange) {
- reason = "account";
- }
-
- ret["reason"] = reason;
-
-
- NSUbiquitousKeyValueStore *store = [NSUbiquitousKeyValueStore defaultStore];
-
- NSArray * keys = [userInfo objectForKey:NSUbiquitousKeyValueStoreChangedKeysKey];
- for (NSString* key in keys) {
- const char* str = [key UTF8String];
- if (str == NULL) {
- continue;
- }
-
- NSObject* object = [store objectForKey:key];
-
- //figure out what kind of object it is
- Variant value = nsobject_to_variant(object);
-
- keyValues[String::utf8(str)] = value;
- }
-
- ret["changed_values"] = keyValues;
- pending_events.push_back(ret);
- }
- ];
+ [[NSNotificationCenter defaultCenter]
+ addObserverForName:NSUbiquitousKeyValueStoreDidChangeExternallyNotification
+ object:[NSUbiquitousKeyValueStore defaultStore]
+ queue:nil
+ usingBlock:^(NSNotification *notification) {
+ NSDictionary *userInfo = [notification userInfo];
+ NSInteger change = [[userInfo objectForKey:NSUbiquitousKeyValueStoreChangeReasonKey] integerValue];
+
+ Dictionary ret;
+ ret["type"] = "key_value_changed";
+
+ //PoolStringArray result_keys;
+ //Array result_values;
+ Dictionary keyValues;
+ String reason = "";
+
+ if (change == NSUbiquitousKeyValueStoreServerChange) {
+ reason = "server";
+ } else if (change == NSUbiquitousKeyValueStoreInitialSyncChange) {
+ reason = "initial_sync";
+ } else if (change == NSUbiquitousKeyValueStoreQuotaViolationChange) {
+ reason = "quota_violation";
+ } else if (change == NSUbiquitousKeyValueStoreAccountChange) {
+ reason = "account";
+ }
+
+ ret["reason"] = reason;
+
+ NSUbiquitousKeyValueStore *store = [NSUbiquitousKeyValueStore defaultStore];
+
+ NSArray *keys = [userInfo objectForKey:NSUbiquitousKeyValueStoreChangedKeysKey];
+ for (NSString *key in keys) {
+ const char *str = [key UTF8String];
+ if (str == NULL) {
+ continue;
+ }
+
+ NSObject *object = [store objectForKey:key];
+
+ //figure out what kind of object it is
+ Variant value = nsobject_to_variant(object);
+
+ keyValues[String::utf8(str)] = value;
+ }
+
+ ret["changed_values"] = keyValues;
+ pending_events.push_back(ret);
+ }];
}
-
-ICloud::~ICloud() {
-
-};
+ICloud::~ICloud(){};
#endif
diff --git a/platform/iphone/in_app_store.h b/platform/iphone/in_app_store.h
index b2ed6f70e4..153c46bd7b 100644
--- a/platform/iphone/in_app_store.h
+++ b/platform/iphone/in_app_store.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm
index b63d7b42ab..710df0f757 100644
--- a/platform/iphone/in_app_store.mm
+++ b/platform/iphone/in_app_store.mm
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,30 +29,29 @@
/*************************************************************************/
#ifdef STOREKIT_ENABLED
+#include "in_app_store.h"
+
#ifdef MODULE_FUSEBOXX_ENABLED
#import "modules/fuseboxx/ios/FuseSDK.h"
#endif
-#include "in_app_store.h"
-
extern "C" {
-#import <StoreKit/StoreKit.h>
#import <Foundation/Foundation.h>
+#import <StoreKit/StoreKit.h>
};
bool auto_finish_transactions = true;
-NSMutableDictionary* pending_transactions = [NSMutableDictionary dictionary];
+NSMutableDictionary *pending_transactions = [NSMutableDictionary dictionary];
@interface SKProduct (LocalizedPrice)
-@property (nonatomic, readonly) NSString *localizedPrice;
+@property(nonatomic, readonly) NSString *localizedPrice;
@end
//----------------------------------//
// SKProduct extension
//----------------------------------//
@implementation SKProduct (LocalizedPrice)
-- (NSString *)localizedPrice
-{
+- (NSString *)localizedPrice {
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
[numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
@@ -62,30 +62,28 @@ NSMutableDictionary* pending_transactions = [NSMutableDictionary dictionary];
}
@end
-
-InAppStore* InAppStore::instance = NULL;
+InAppStore *InAppStore::instance = NULL;
void InAppStore::_bind_methods() {
- ClassDB::bind_method(D_METHOD("request_product_info"),&InAppStore::request_product_info);
- ClassDB::bind_method(D_METHOD("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(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);
+ 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> {
-
+@interface ProductsDelegate : NSObject <SKProductsRequestDelegate> {
};
@end
@implementation ProductsDelegate
-- (void)productsRequest:(SKProductsRequest*)request didReceiveResponse:(SKProductsResponse*)response {
+- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
- NSArray* products = response.products;
+ NSArray *products = response.products;
Dictionary ret;
ret["type"] = "product_info";
ret["result"] = "ok";
@@ -95,11 +93,11 @@ void InAppStore::_bind_methods() {
PoolStringArray ids;
PoolStringArray localized_prices;
- for (int i=0; i<[products count]; i++) {
+ for (int i = 0; i < [products count]; i++) {
- SKProduct* product = [products objectAtIndex:i];
+ SKProduct *product = [products objectAtIndex:i];
- const char* str = [product.localizedTitle UTF8String];
+ const char *str = [product.localizedTitle UTF8String];
titles.push_back(String::utf8(str != NULL ? str : ""));
str = [product.localizedDescription UTF8String];
@@ -116,7 +114,7 @@ void InAppStore::_bind_methods() {
PoolStringArray invalid_ids;
- for (NSString* ipid in response.invalidProductIdentifiers) {
+ for (NSString *ipid in response.invalidProductIdentifiers) {
invalid_ids.push_back(String::utf8([ipid UTF8String]));
};
@@ -137,15 +135,15 @@ Error InAppStore::request_product_info(Variant p_params) {
PoolStringArray pids = params["product_ids"];
printf("************ request product info! %i\n", pids.size());
- NSMutableArray* array = [[[NSMutableArray alloc] initWithCapacity:pids.size()] autorelease];
- for (int i=0; i<pids.size(); i++) {
+ NSMutableArray *array = [[[NSMutableArray alloc] initWithCapacity:pids.size()] autorelease];
+ for (int i = 0; i < pids.size(); i++) {
printf("******** adding %ls to product list\n", pids[i].c_str());
- NSString* pid = [[[NSString alloc] initWithUTF8String:pids[i].utf8().get_data()] autorelease];
+ NSString *pid = [[[NSString alloc] initWithUTF8String:pids[i].utf8().get_data()] autorelease];
[array addObject:pid];
};
- NSSet* products = [[[NSSet alloc] initWithArray:array] autorelease];
- SKProductsRequest* request = [[SKProductsRequest alloc] initWithProductIdentifiers:products];
+ NSSet *products = [[[NSSet alloc] initWithArray:array] autorelease];
+ SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:products];
ProductsDelegate *delegate = [[ProductsDelegate alloc] init];
@@ -155,131 +153,123 @@ Error InAppStore::request_product_info(Variant p_params) {
return OK;
};
-@interface TransObserver : NSObject<SKPaymentTransactionObserver> {
-
+@interface TransObserver : NSObject <SKPaymentTransactionObserver> {
};
@end
@implementation TransObserver
-- (void)paymentQueue:(SKPaymentQueue*)queue updatedTransactions:(NSArray*) transactions {
+- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
- printf("transactions updated!\n");
- for (SKPaymentTransaction* transaction in transactions) {
+ printf("transactions updated!\n");
+ for (SKPaymentTransaction *transaction in transactions) {
switch (transaction.transactionState) {
+ case SKPaymentTransactionStatePurchased: {
+ printf("status purchased!\n");
+ String pid = String::utf8([transaction.payment.productIdentifier UTF8String]);
+ String transactionId = String::utf8([transaction.transactionIdentifier UTF8String]);
+ InAppStore::get_singleton()->_record_purchase(pid);
+ Dictionary ret;
+ ret["type"] = "purchase";
+ ret["result"] = "ok";
+ ret["product_id"] = pid;
+ ret["transaction_id"] = transactionId;
+
+ NSData *receipt = nil;
+ int sdk_version = 6;
+
+ if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
+
+ NSURL *receiptFileURL = nil;
+ NSBundle *bundle = [NSBundle mainBundle];
+ if ([bundle respondsToSelector:@selector(appStoreReceiptURL)]) {
+
+ // Get the transaction receipt file path location in the app bundle.
+ receiptFileURL = [bundle appStoreReceiptURL];
+
+ // Read in the contents of the transaction file.
+ receipt = [NSData dataWithContentsOfURL:receiptFileURL];
+ sdk_version = 7;
+
+ } else {
+ // Fall back to deprecated transaction receipt,
+ // which is still available in iOS 7.
+
+ // Use SKPaymentTransaction's transactionReceipt.
+ receipt = transaction.transactionReceipt;
+ }
+
+ } else {
+ receipt = transaction.transactionReceipt;
+ }
+
+ NSString *receipt_to_send = nil;
+ if (receipt != nil) {
+ receipt_to_send = [receipt description];
+ }
+ Dictionary receipt_ret;
+ receipt_ret["receipt"] = String::utf8(receipt_to_send != nil ? [receipt_to_send UTF8String] : "");
+ receipt_ret["sdk"] = sdk_version;
+ ret["receipt"] = receipt_ret;
+
+ InAppStore::get_singleton()->_post_event(ret);
+
+ if (auto_finish_transactions) {
+ [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
+ } else {
+ [pending_transactions setObject:transaction forKey:transaction.payment.productIdentifier];
+ }
- case SKPaymentTransactionStatePurchased: {
- printf("status purchased!\n");
- String pid = String::utf8([transaction.payment.productIdentifier UTF8String]);
- String transactionId = String::utf8([transaction.transactionIdentifier UTF8String]);
- InAppStore::get_singleton()->_record_purchase(pid);
- Dictionary ret;
- ret["type"] = "purchase";
- ret["result"] = "ok";
- ret["product_id"] = pid;
- ret["transaction_id"] = transactionId;
-
- NSData* receipt = nil;
- int sdk_version = 6;
-
- if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){
-
- NSURL *receiptFileURL = nil;
- NSBundle *bundle = [NSBundle mainBundle];
- if ([bundle respondsToSelector:@selector(appStoreReceiptURL)]) {
-
- // Get the transaction receipt file path location in the app bundle.
- receiptFileURL = [bundle appStoreReceiptURL];
-
- // Read in the contents of the transaction file.
- receipt = [NSData dataWithContentsOfURL:receiptFileURL];
- sdk_version = 7;
-
- } else {
- // Fall back to deprecated transaction receipt,
- // which is still available in iOS 7.
-
- // Use SKPaymentTransaction's transactionReceipt.
- receipt = transaction.transactionReceipt;
- }
-
- }else{
- receipt = transaction.transactionReceipt;
- }
-
- NSString* receipt_to_send = nil;
- if (receipt != nil)
- {
- receipt_to_send = [receipt description];
- }
- Dictionary receipt_ret;
- receipt_ret["receipt"] = String::utf8(receipt_to_send != nil ? [receipt_to_send UTF8String] : "");
- receipt_ret["sdk"] = sdk_version;
- ret["receipt"] = receipt_ret;
-
- InAppStore::get_singleton()->_post_event(ret);
-
- if (auto_finish_transactions){
- [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
- }
- else{
- [pending_transactions setObject:transaction forKey:transaction.payment.productIdentifier];
- }
-
- #ifdef MODULE_FUSEBOXX_ENABLED
- printf("Registering transaction on Fuseboxx!\n");
- [FuseSDK registerInAppPurchase: transaction];
- #endif
- } break;
- case SKPaymentTransactionStateFailed: {
- printf("status transaction failed!\n");
- String pid = String::utf8([transaction.payment.productIdentifier UTF8String]);
- Dictionary ret;
- ret["type"] = "purchase";
- ret["result"] = "error";
- ret["product_id"] = pid;
- InAppStore::get_singleton()->_post_event(ret);
- [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
- } break;
- case SKPaymentTransactionStateRestored: {
- printf("status transaction restored!\n");
- String pid = String::utf8([transaction.originalTransaction.payment.productIdentifier UTF8String]);
- InAppStore::get_singleton()->_record_purchase(pid);
- [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
- } break;
-
- default:
- printf("status default %i!\n", (int)transaction.transactionState);
-
- break;
+#ifdef MODULE_FUSEBOXX_ENABLED
+ printf("Registering transaction on Fuseboxx!\n");
+ [FuseSDK registerInAppPurchase:transaction];
+#endif
+ }; break;
+ case SKPaymentTransactionStateFailed: {
+ printf("status transaction failed!\n");
+ String pid = String::utf8([transaction.payment.productIdentifier UTF8String]);
+ Dictionary ret;
+ ret["type"] = "purchase";
+ ret["result"] = "error";
+ ret["product_id"] = pid;
+ InAppStore::get_singleton()->_post_event(ret);
+ [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
+ } break;
+ case SKPaymentTransactionStateRestored: {
+ printf("status transaction restored!\n");
+ String pid = String::utf8([transaction.originalTransaction.payment.productIdentifier UTF8String]);
+ InAppStore::get_singleton()->_record_purchase(pid);
+ [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
+ } break;
+ default: {
+ printf("status default %i!\n", (int)transaction.transactionState);
+ }; break;
};
};
};
@end
-
Error InAppStore::purchase(Variant p_params) {
ERR_FAIL_COND_V(![SKPaymentQueue canMakePayments], ERR_UNAVAILABLE);
if (![SKPaymentQueue canMakePayments])
return ERR_UNAVAILABLE;
- printf("purchasing!\n");
+ printf("purchasing!\n");
Dictionary params = p_params;
ERR_FAIL_COND_V(!params.has("product_id"), ERR_INVALID_PARAMETER);
NSString *pid = [[[NSString alloc] initWithUTF8String:String(params["product_id"]).utf8().get_data()] autorelease];
SKPayment *payment = [SKPayment paymentWithProductIdentifier:pid];
- SKPaymentQueue* defq = [SKPaymentQueue defaultQueue];
+ SKPaymentQueue *defq = [SKPaymentQueue defaultQueue];
[defq addPayment:payment];
- printf("purchase sent!\n");
+ printf("purchase sent!\n");
return OK;
};
-
int InAppStore::get_pending_event_count() {
return pending_events.size();
};
@@ -299,13 +289,13 @@ void InAppStore::_post_event(Variant p_event) {
void InAppStore::_record_purchase(String product_id) {
- String skey = "purchased/"+product_id;
- NSString* key = [[[NSString alloc] initWithUTF8String:skey.utf8().get_data()] autorelease];
+ String skey = "purchased/" + product_id;
+ NSString *key = [[[NSString alloc] initWithUTF8String:skey.utf8().get_data()] autorelease];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:key];
[[NSUserDefaults standardUserDefaults] synchronize];
};
-InAppStore* InAppStore::get_singleton() {
+InAppStore *InAppStore::get_singleton() {
return instance;
};
@@ -315,27 +305,24 @@ InAppStore::InAppStore() {
instance = this;
auto_finish_transactions = false;
- TransObserver* observer = [[TransObserver alloc] init];
+ TransObserver *observer = [[TransObserver alloc] init];
[[SKPaymentQueue defaultQueue] addTransactionObserver:observer];
- //pending_transactions = [NSMutableDictionary dictionary];
+ //pending_transactions = [NSMutableDictionary dictionary];
};
-void InAppStore::finish_transaction(String product_id){
- NSString* prod_id = [NSString stringWithCString:product_id.utf8().get_data() encoding:NSUTF8StringEncoding];
+void InAppStore::finish_transaction(String product_id) {
+ NSString *prod_id = [NSString stringWithCString:product_id.utf8().get_data() encoding:NSUTF8StringEncoding];
- if ([pending_transactions objectForKey:prod_id]){
+ if ([pending_transactions objectForKey:prod_id]) {
[[SKPaymentQueue defaultQueue] finishTransaction:[pending_transactions objectForKey:prod_id]];
- [pending_transactions removeObjectForKey:prod_id];
+ [pending_transactions removeObjectForKey:prod_id];
}
};
-void InAppStore::set_auto_finish_transaction(bool b){
- auto_finish_transactions = b;
+void InAppStore::set_auto_finish_transaction(bool b) {
+ auto_finish_transactions = b;
}
-InAppStore::~InAppStore() {
-
-};
-
+InAppStore::~InAppStore(){};
#endif
diff --git a/platform/iphone/ios.h b/platform/iphone/ios.h
index e5baf8f4d2..2572d626d2 100644
--- a/platform/iphone/ios.h
+++ b/platform/iphone/ios.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,6 +39,8 @@ class iOS : public Object {
static void _bind_methods();
public:
+ static void alert(const char *p_alert, const char *p_title);
+
String get_rate_url(int p_app_id) const;
iOS();
diff --git a/platform/iphone/ios.mm b/platform/iphone/ios.mm
index 4aca85dafc..6c95903241 100644
--- a/platform/iphone/ios.mm
+++ b/platform/iphone/ios.mm
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,9 +33,14 @@
void iOS::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_rate_url","app_id"),&iOS::get_rate_url);
+ ClassDB::bind_method(D_METHOD("get_rate_url", "app_id"), &iOS::get_rate_url);
};
+void iOS::alert(const char *p_alert, const char *p_title) {
+ UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:[NSString stringWithUTF8String:p_title] message:[NSString stringWithUTF8String:p_alert] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] autorelease];
+ [alert show];
+}
+
String iOS::get_rate_url(int p_app_id) const {
String templ = "itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=APP_ID";
String templ_iOS7 = "itms-apps://itunes.apple.com/app/idAPP_ID";
@@ -43,14 +49,11 @@ String iOS::get_rate_url(int p_app_id) const {
//ios7 before
String ret = templ;
- // iOS 7 needs a different templateReviewURL @see https://github.com/arashpayan/appirater/issues/131
- if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 && [[[UIDevice currentDevice] systemVersion] floatValue] < 7.1)
- {
+ if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 && [[[UIDevice currentDevice] systemVersion] floatValue] < 7.1) {
+ // iOS 7 needs a different templateReviewURL @see https://github.com/arashpayan/appirater/issues/131
ret = templ_iOS7;
- }
- // iOS 8 needs a different templateReviewURL also @see https://github.com/arashpayan/appirater/issues/182
- else if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
- {
+ } else if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
+ // iOS 8 needs a different templateReviewURL also @see https://github.com/arashpayan/appirater/issues/182
ret = templ_iOS8;
}
@@ -61,4 +64,4 @@ String iOS::get_rate_url(int p_app_id) const {
return ret;
};
-iOS::iOS() {};
+iOS::iOS(){};
diff --git a/platform/iphone/main.m b/platform/iphone/main.m
index 02a45737c5..6757cc8146 100644
--- a/platform/iphone/main.m
+++ b/platform/iphone/main.m
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,25 +27,24 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#import <UIKit/UIKit.h>
#import "app_delegate.h"
+
+#import <UIKit/UIKit.h>
#include <stdio.h>
int gargc;
-char** gargv;
+char **gargv;
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
printf("*********** main.m\n");
gargc = argc;
gargv = argv;
NSAutoreleasePool *pool = [NSAutoreleasePool new];
- AppDelegate* app = [AppDelegate alloc];
+ AppDelegate *app = [AppDelegate alloc];
printf("running app main\n");
UIApplicationMain(argc, argv, nil, @"AppDelegate");
printf("main done, pool release\n");
[pool release];
return 0;
}
-
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp
index 752690762e..df497349ae 100644
--- a/platform/iphone/os_iphone.cpp
+++ b/platform/iphone/os_iphone.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,10 +38,10 @@
#include "audio_driver_iphone.h"
#include "main/main.h"
-#include "core/global_config.h"
#include "core/io/file_access_pack.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
+#include "core/project_settings.h"
#include "sem_iphone.h"
@@ -82,12 +83,12 @@ void OSIPhone::set_data_dir(String p_dir) {
memdelete(da);
};
-void OSIPhone::set_unique_ID(String p_ID) {
+void OSIPhone::set_unique_id(String p_ID) {
unique_ID = p_ID;
};
-String OSIPhone::get_unique_ID() const {
+String OSIPhone::get_unique_id() const {
return unique_ID;
};
@@ -108,7 +109,6 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_
RasterizerGLES3::register_config();
RasterizerGLES3::make_current();
- RasterizerStorageGLES3::system_fbo = gl_view_base_fb;
visual_server = memnew(VisualServerRaster());
/*
@@ -119,7 +119,10 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_
*/
visual_server->init();
- visual_server->cursor_set_visible(false, 0);
+ // visual_server->cursor_set_visible(false, 0);
+
+ // reset this to what it should be, it will have been set to 0 after visual_server->init() is called
+ RasterizerStorageGLES3::system_fbo = gl_view_base_fb;
audio_driver = memnew(AudioDriverIphone);
audio_driver->set_singleton();
@@ -137,28 +140,28 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_
/*
#ifdef IOS_SCORELOOP_ENABLED
scoreloop = memnew(ScoreloopIOS);
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("Scoreloop", scoreloop));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Scoreloop", scoreloop));
scoreloop->connect();
#endif
*/
#ifdef GAME_CENTER_ENABLED
game_center = memnew(GameCenter);
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("GameCenter", game_center));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("GameCenter", game_center));
game_center->connect();
#endif
#ifdef STOREKIT_ENABLED
store_kit = memnew(InAppStore);
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("InAppStore", store_kit));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("InAppStore", store_kit));
#endif
#ifdef ICLOUD_ENABLED
icloud = memnew(ICloud);
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("ICloud", icloud));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ICloud", icloud));
//icloud->connect();
#endif
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("iOS", memnew(iOS)));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("iOS", memnew(iOS)));
};
MainLoop *OSIPhone::get_main_loop() const {
@@ -194,26 +197,24 @@ bool OSIPhone::iterate() {
void OSIPhone::key(uint32_t p_key, bool p_pressed) {
- InputEvent ev;
- ev.type = InputEvent::KEY;
- ev.ID = ++last_event_id;
- ev.key.echo = false;
- ev.key.pressed = p_pressed;
- ev.key.scancode = p_key;
- ev.key.unicode = p_key;
+ Ref<InputEventKey> ev;
+ ev.instance();
+ ev->set_echo(false);
+ ev->set_pressed(p_pressed);
+ ev->set_scancode(p_key);
+ ev->set_unicode(p_key);
queue_event(ev);
};
void OSIPhone::mouse_button(int p_idx, int p_x, int p_y, bool p_pressed, bool p_doubleclick, bool p_use_as_mouse) {
if (!GLOBAL_DEF("debug/disable_touch", false)) {
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.ID = ++last_event_id;
- ev.screen_touch.index = p_idx;
- ev.screen_touch.pressed = p_pressed;
- ev.screen_touch.x = p_x;
- ev.screen_touch.y = p_y;
+ Ref<InputEventScreenTouch> ev;
+ ev.instance();
+
+ ev->set_index(p_idx);
+ ev->set_pressed(p_pressed);
+ ev->set_position(Vector2(p_x, p_y));
queue_event(ev);
};
@@ -221,24 +222,18 @@ void OSIPhone::mouse_button(int p_idx, int p_x, int p_y, bool p_pressed, bool p_
if (p_use_as_mouse) {
- InputEvent ev;
- ev.type = InputEvent::MOUSE_BUTTON;
- ev.device = 0;
- ev.mouse_button.pointer_index = p_idx;
- ev.ID = ++last_event_id;
+ Ref<InputEventMouseButton> ev;
+ ev.instance();
- // swaped it for tilted screen
- //ev.mouse_button.x = ev.mouse_button.global_x = video_mode.height - p_y;
- //ev.mouse_button.y = ev.mouse_button.global_y = p_x;
- ev.mouse_button.x = ev.mouse_button.global_x = p_x;
- ev.mouse_button.y = ev.mouse_button.global_y = p_y;
+ ev->set_position(Vector2(p_x, p_y));
+ ev->set_global_position(Vector2(p_x, p_y));
//mouse_list.pressed[p_idx] = p_pressed;
- input->set_mouse_pos(Point2(ev.mouse_motion.x, ev.mouse_motion.y));
- ev.mouse_button.button_index = BUTTON_LEFT;
- ev.mouse_button.doubleclick = p_doubleclick;
- ev.mouse_button.pressed = p_pressed;
+ input->set_mouse_position(ev->get_position());
+ ev->set_button_index(BUTTON_LEFT);
+ ev->set_doubleclick(p_doubleclick);
+ ev->set_pressed(p_pressed);
queue_event(ev);
};
@@ -248,48 +243,31 @@ void OSIPhone::mouse_move(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_
if (!GLOBAL_DEF("debug/disable_touch", false)) {
- InputEvent ev;
- ev.type = InputEvent::SCREEN_DRAG;
- ev.ID = ++last_event_id;
- ev.screen_drag.index = p_idx;
- ev.screen_drag.x = p_x;
- ev.screen_drag.y = p_y;
- ev.screen_drag.relative_x = p_x - p_prev_x;
- ev.screen_drag.relative_y = p_y - p_prev_y;
+ Ref<InputEventScreenDrag> ev;
+ ev.instance();
+ ev->set_index(p_idx);
+ ev->set_position(Vector2(p_x, p_y));
+ ev->set_relative(Vector2(p_x - p_prev_x, p_y - p_prev_y));
queue_event(ev);
};
if (p_use_as_mouse) {
- InputEvent ev;
- ev.type = InputEvent::MOUSE_MOTION;
- ev.device = 0;
- ev.mouse_motion.pointer_index = p_idx;
- ev.ID = ++last_event_id;
+ Ref<InputEventMouseMotion> ev;
+ ev.instance();
- if (true) { // vertical
+ ev->set_position(Vector2(p_x, p_y));
+ ev->set_global_position(Vector2(p_x, p_y));
+ ev->set_relative(Vector2(p_x - p_prev_x, p_y - p_prev_y));
- ev.mouse_motion.x = ev.mouse_button.global_x = p_x;
- ev.mouse_motion.y = ev.mouse_button.global_y = p_y;
- ev.mouse_motion.relative_x = ev.mouse_motion.x - p_prev_x;
- ev.mouse_motion.relative_y = ev.mouse_motion.y - p_prev_y;
-
- } else { // horizontal?
- ev.mouse_motion.x = ev.mouse_button.global_x = video_mode.height - p_y;
- ev.mouse_motion.y = ev.mouse_button.global_y = p_x;
- ev.mouse_motion.relative_x = ev.mouse_motion.x - (video_mode.height - p_prev_x);
- ev.mouse_motion.relative_y = ev.mouse_motion.y - p_prev_x;
- };
-
- input->set_mouse_pos(Point2(ev.mouse_motion.x, ev.mouse_motion.y));
- ev.mouse_motion.speed_x = input->get_last_mouse_speed().x;
- ev.mouse_motion.speed_y = input->get_last_mouse_speed().y;
- ev.mouse_motion.button_mask = 1; // pressed
+ input->set_mouse_position(ev->get_position());
+ ev->set_speed(input->get_last_mouse_speed());
+ ev->set_button_mask(BUTTON_LEFT); // pressed
queue_event(ev);
};
};
-void OSIPhone::queue_event(const InputEvent &p_event) {
+void OSIPhone::queue_event(const Ref<InputEvent> &p_event) {
ERR_FAIL_INDEX(event_count, MAX_EVENTS);
@@ -327,7 +305,6 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) {
ev.device = 0;
ev.joy_motion.axis = JOY_ANALOG_0;
ev.joy_motion.axis_value = (p_x / (float)ACCEL_RANGE);
- ev.ID = ++last_event_id;
last_accel.x = p_x;
queue_event(ev);
};
@@ -338,7 +315,6 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) {
ev.device = 0;
ev.joy_motion.axis = JOY_ANALOG_1;
ev.joy_motion.axis_value = (p_y / (float)ACCEL_RANGE);
- ev.ID = ++last_event_id;
last_accel.y = p_y;
queue_event(ev);
};
@@ -349,7 +325,6 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) {
ev.device = 0;
ev.joy_motion.axis = JOY_ANALOG_2;
ev.joy_motion.axis_value = ( (1.0 - p_z) / (float)ACCEL_RANGE);
- ev.ID = ++last_event_id;
last_accel.z = p_z;
queue_event(ev);
};
@@ -364,6 +339,22 @@ void OSIPhone::update_gyroscope(float p_x, float p_y, float p_z) {
input->set_gyroscope(Vector3(p_x, p_y, p_z));
};
+int OSIPhone::get_unused_joy_id() {
+ return input->get_unused_joy_id();
+};
+
+void OSIPhone::joy_connection_changed(int p_idx, bool p_connected, String p_name) {
+ input->joy_connection_changed(p_idx, p_connected, p_name);
+};
+
+void OSIPhone::joy_button(int p_device, int p_button, bool p_pressed) {
+ input->joy_button(p_device, p_button, p_pressed);
+};
+
+void OSIPhone::joy_axis(int p_device, int p_axis, const InputDefault::JoyAxis &p_value) {
+ input->joy_axis(p_device, p_axis, p_value);
+};
+
void OSIPhone::delete_main_loop() {
if (main_loop) {
@@ -400,7 +391,7 @@ bool OSIPhone::is_mouse_grab_enabled() const {
return true;
};
-Point2 OSIPhone::get_mouse_pos() const {
+Point2 OSIPhone::get_mouse_position() const {
return Point2();
};
@@ -412,6 +403,13 @@ int OSIPhone::get_mouse_button_state() const {
void OSIPhone::set_window_title(const String &p_title){};
+void OSIPhone::alert(const String &p_alert, const String &p_title) {
+
+ const CharString utf8_alert = p_alert.utf8();
+ const CharString utf8_title = p_title.utf8();
+ iOS::alert(utf8_alert.get_data(), utf8_title.get_data());
+}
+
void OSIPhone::set_video_mode(const VideoMode &p_video_mode, int p_screen) {
video_mode = p_video_mode;
@@ -436,7 +434,8 @@ bool OSIPhone::can_draw() const {
int OSIPhone::set_base_framebuffer(int p_fb) {
- RasterizerStorageGLES3::system_fbo = gl_view_base_fb;
+ // gl_view_base_fb has not been updated yet
+ RasterizerStorageGLES3::system_fbo = p_fb;
return 0;
};
@@ -519,7 +518,7 @@ Error OSIPhone::native_video_play(String p_path, float p_volume, String p_audio_
print("Unable to play %S using the native player as it resides in a .pck file\n", p_path.c_str());
return ERR_INVALID_PARAMETER;
} else {
- p_path = p_path.replace("res:/", GlobalConfig::get_singleton()->get_resource_path());
+ p_path = p_path.replace("res:/", ProjectSettings::get_singleton()->get_resource_path());
}
} else if (p_path.begins_with("user://"))
p_path = p_path.replace("user:/", get_data_dir());
@@ -554,6 +553,11 @@ void OSIPhone::native_video_stop() {
_stop_video();
}
+bool OSIPhone::_check_internal_feature_support(const String &p_feature) {
+
+ return p_feature == "mobile" || p_feature == "etc" || p_feature == "pvrtc" || p_feature == "etc2";
+}
+
OSIPhone::OSIPhone(int width, int height) {
main_loop = NULL;
@@ -566,7 +570,6 @@ OSIPhone::OSIPhone(int width, int height) {
vm.resizable = false;
set_video_mode(vm);
event_count = 0;
- last_event_id = 0;
};
OSIPhone::~OSIPhone() {
diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h
index 36261a62c2..cf2766bb33 100644
--- a/platform/iphone/os_iphone.h
+++ b/platform/iphone/os_iphone.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -117,10 +118,9 @@ private:
Vector3 last_accel;
- InputEvent event_queue[MAX_EVENTS];
+ Ref<InputEvent> event_queue[MAX_EVENTS];
int event_count;
- int last_event_id;
- void queue_event(const InputEvent &p_event);
+ void queue_event(const Ref<InputEvent> &p_event);
String data_dir;
String unique_ID;
@@ -145,15 +145,22 @@ public:
void update_magnetometer(float p_x, float p_y, float p_z);
void update_gyroscope(float p_x, float p_y, float p_z);
+ int get_unused_joy_id();
+ void joy_connection_changed(int p_idx, bool p_connected, String p_name);
+ void joy_button(int p_device, int p_button, bool p_pressed);
+ void joy_axis(int p_device, int p_axis, const InputDefault::JoyAxis &p_value);
+
static OSIPhone *get_singleton();
virtual void set_mouse_show(bool p_show);
virtual void set_mouse_grab(bool p_grab);
virtual bool is_mouse_grab_enabled() const;
- virtual Point2 get_mouse_pos() const;
+ virtual Point2 get_mouse_position() const;
virtual int get_mouse_button_state() const;
virtual void set_window_title(const String &p_title);
+ virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
+
virtual void set_video_mode(const VideoMode &p_video_mode, int p_screen = 0);
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;
@@ -183,8 +190,8 @@ public:
void set_locale(String p_locale);
String get_locale() const;
- void set_unique_ID(String p_ID);
- String get_unique_ID() const;
+ void set_unique_id(String p_ID);
+ String get_unique_id() const;
virtual Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track);
virtual bool native_video_is_playing() const;
@@ -193,6 +200,7 @@ public:
virtual void native_video_focus_out();
virtual void native_video_stop();
+ virtual bool _check_internal_feature_support(const String &p_feature);
OSIPhone(int width, int height);
~OSIPhone();
};
diff --git a/platform/iphone/platform_config.h b/platform/iphone/platform_config.h
index 64e9388910..7e4b533254 100644
--- a/platform/iphone/platform_config.h
+++ b/platform/iphone/platform_config.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/platform_refcount.h b/platform/iphone/platform_refcount.h
index 6cfdc49369..c02e709ea1 100644
--- a/platform/iphone/platform_refcount.h
+++ b/platform/iphone/platform_refcount.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/power_iphone.cpp b/platform/iphone/power_iphone.cpp
index 7b1f9246f4..5192f8e593 100644
--- a/platform/iphone/power_iphone.cpp
+++ b/platform/iphone/power_iphone.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/power_iphone.h b/platform/iphone/power_iphone.h
index 8890c33e74..174ee6c63b 100644
--- a/platform/iphone/power_iphone.h
+++ b/platform/iphone/power_iphone.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/rasterizer_iphone.cpp b/platform/iphone/rasterizer_iphone.cpp
deleted file mode 100644
index 14288e4ba0..0000000000
--- a/platform/iphone/rasterizer_iphone.cpp
+++ /dev/null
@@ -1,2584 +0,0 @@
-/*************************************************************************/
-/* rasterizer_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. */
-/*************************************************************************/
-#ifdef IPHONE_ENABLED
-
-#include "rasterizer_iphone.h"
-#include "global_config.h"
-#include "os/os.h"
-#include <stdio.h>
-
-_FORCE_INLINE_ static void _gl_load_transform(const Transform &tr) {
-
- GLfloat matrix[16] = { /* build a 16x16 matrix */
- tr.basis.elements[0][0],
- tr.basis.elements[1][0],
- tr.basis.elements[2][0],
- 0,
- tr.basis.elements[0][1],
- tr.basis.elements[1][1],
- tr.basis.elements[2][1],
- 0,
- tr.basis.elements[0][2],
- tr.basis.elements[1][2],
- tr.basis.elements[2][2],
- 0,
- tr.origin.x,
- tr.origin.y,
- tr.origin.z,
- 1
- };
-
- glLoadMatrixf(matrix);
-};
-
-_FORCE_INLINE_ static void _gl_mult_transform(const Transform &tr) {
-
- GLfloat matrix[16] = { /* build a 16x16 matrix */
- tr.basis.elements[0][0],
- tr.basis.elements[1][0],
- tr.basis.elements[2][0],
- 0,
- tr.basis.elements[0][1],
- tr.basis.elements[1][1],
- tr.basis.elements[2][1],
- 0,
- tr.basis.elements[0][2],
- tr.basis.elements[1][2],
- tr.basis.elements[2][2],
- 0,
- tr.origin.x,
- tr.origin.y,
- tr.origin.z,
- 1
- };
-
- glMultMatrixf(matrix);
-};
-
-static const GLenum prim_type[] = { GL_POINTS, GL_LINES, GL_TRIANGLES, GL_TRIANGLE_FAN };
-
-static void _draw_primitive(int p_points, const float *p_vertices, const float *p_normals, const float *p_colors, const float *p_uvs, const Plane *p_tangents = NULL, int p_instanced = 1) {
-
- ERR_FAIL_COND(!p_vertices);
- ERR_FAIL_COND(p_points < 1 || p_points > 4);
-
- GLenum type = prim_type[p_points - 1];
-
- if (!p_colors) {
- glColor4f(1, 1, 1, 1);
- };
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glVertexPointer(3, GL_FLOAT, 0, (GLvoid *)p_vertices);
-
- if (p_normals) {
-
- glEnableClientState(GL_NORMAL_ARRAY);
- glNormalPointer(GL_FLOAT, 0, (GLvoid *)p_normals);
- };
-
- if (p_colors) {
- glEnableClientState(GL_COLOR_ARRAY);
- glColorPointer(4, GL_FLOAT, 0, p_colors);
- };
-
- if (p_uvs) {
-
- glClientActiveTexture(GL_TEXTURE0);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexCoordPointer(2, GL_FLOAT, 0, p_uvs);
- };
-
- glDrawArrays(type, 0, p_points);
-
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-};
-
-/* TEXTURE API */
-
-static Image _get_gl_image_and_format(const Image &p_image, Image::Format p_format, uint32_t p_flags, GLenum &r_gl_format, int &r_gl_components, bool &r_has_alpha_cache) {
-
- r_has_alpha_cache = false;
- Image image = p_image;
-
- switch (p_format) {
-
- case Image::FORMAT_L8: {
- r_gl_components = 1;
- r_gl_format = GL_LUMINANCE;
-
- } break;
- case Image::FORMAT_INTENSITY: {
-
- image.convert(Image::FORMAT_RGBA8);
- r_gl_components = 4;
- r_gl_format = GL_RGBA;
- r_has_alpha_cache = true;
- } break;
- case Image::FORMAT_LA8: {
-
- image.convert(Image::FORMAT_RGBA8);
- r_gl_components = 4;
- r_gl_format = GL_RGBA;
- r_has_alpha_cache = true;
- } break;
-
- case Image::FORMAT_INDEXED: {
-
- image.convert(Image::FORMAT_RGB8);
- r_gl_components = 3;
- r_gl_format = GL_RGB;
-
- } break;
-
- case Image::FORMAT_INDEXED_ALPHA: {
-
- image.convert(Image::FORMAT_RGBA8);
- r_gl_components = 4;
- r_gl_format = GL_RGB;
- r_has_alpha_cache = true;
-
- } break;
- case Image::FORMAT_RGB8: {
-
- r_gl_components = 3;
- r_gl_format = GL_RGB;
- } break;
- case Image::FORMAT_RGBA8: {
-
- r_gl_components = 4;
- r_gl_format = GL_RGBA;
- r_has_alpha_cache = true;
- } break;
- default: {
-
- ERR_FAIL_V(Image());
- }
- }
-
- return image;
-}
-
-RID RasterizerIPhone::texture_create() {
-
- Texture *texture = memnew(Texture);
- ERR_FAIL_COND_V(!texture, RID());
- glGenTextures(1, &texture->tex_id);
- texture->active = false;
-
- return texture_owner.make_rid(texture);
-}
-
-void RasterizerIPhone::texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags) {
-
- bool has_alpha_cache;
- int components;
- GLenum format;
-
- Texture *texture = texture_owner.get(p_texture);
- ERR_FAIL_COND(!texture);
- texture->width = p_width;
- texture->height = p_height;
- texture->format = p_format;
- texture->flags = p_flags;
- //texture->target = (p_flags & VS::TEXTURE_FLAG_CUBEMAP) ? GL_TEXTURE_CUBE_MAP : GL_TEXTURE_2D;
- texture->target = GL_TEXTURE_2D;
-
- _get_gl_image_and_format(Image(), texture->format, texture->flags, format, components, has_alpha_cache);
-
- texture->gl_components_cache = components;
- texture->gl_format_cache = format;
- texture->format_has_alpha = has_alpha_cache;
- texture->has_alpha = false; //by default it doesn't have alpha unless something with alpha is blitteds
-
- glBindTexture(texture->target, texture->tex_id);
-
- if (texture->flags & VS::TEXTURE_FLAG_MIPMAPS) {
- glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
- }
-
- if (texture->target == GL_TEXTURE_2D) {
- glTexImage2D(texture->target, 0, format, texture->width, texture->height, 0, format, GL_UNSIGNED_BYTE, NULL);
- }
-
- /*
- else {
- //cubemappor
- for (int i=0;i<6;i++)
- glTexImage2D(_cube_side_enum[i], 0, format, texture->width, texture->height, 0, format, GL_UNSIGNED_BYTE,NULL);
- }
- */
-
- glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // Linear Filtering
-
- if (texture->flags & VS::TEXTURE_FLAG_FILTER) {
-
- glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Linear Filtering
- if (texture->flags & VS::TEXTURE_FLAG_MIPMAPS) {
- //glTexParameteri(texture->target,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
- };
- }
-
- if (texture->flags & VS::TEXTURE_FLAG_REPEAT /* && texture->target != GL_TEXTURE_CUBE_MAP*/) {
-
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- } else {
-
- //glTexParameterf( texture->target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE );
- glTexParameterf(texture->target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(texture->target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- }
-
- texture->active = true;
-}
-
-void RasterizerIPhone::texture_blit_rect(RID p_texture, int p_x, int p_y, const Image &p_image, VS::CubeMapSide p_cube_side) {
-
- Texture *texture = texture_owner.get(p_texture);
-
- ERR_FAIL_COND(!texture);
- ERR_FAIL_COND(!texture->active);
- ERR_FAIL_COND(texture->format != p_image.get_format());
-
- int components;
- GLenum format;
- bool alpha;
-
- Image img = _get_gl_image_and_format(p_image, p_image.get_format(), texture->flags, format, components, alpha);
-
- if (img.detect_alpha())
- texture->has_alpha = true;
-
- GLenum blit_target = GL_TEXTURE_2D; //(texture->target == GL_TEXTURE_CUBE_MAP)?_cube_side_enum[p_cube_side]:GL_TEXTURE_2D;
-
- PoolVector<uint8_t>::Read read = img.get_data().read();
-
- glBindTexture(texture->target, texture->tex_id);
- glTexSubImage2D(blit_target, 0, p_x, p_y, img.get_width(), img.get_height(), format, GL_UNSIGNED_BYTE, read.ptr());
-
- //glGenerateMipmap( texture->target );
-}
-
-Image RasterizerIPhone::texture_get_rect(RID p_texture, int p_x, int p_y, int p_width, int p_height, VS::CubeMapSide p_cube_side) const {
-
- return Image();
-}
-void RasterizerIPhone::texture_set_flags(RID p_texture, uint32_t p_flags) {
-
- Texture *texture = texture_owner.get(p_texture);
- ERR_FAIL_COND(!texture);
-
- glBindTexture(texture->target, texture->tex_id);
- uint32_t cube = texture->flags & VS::TEXTURE_FLAG_CUBEMAP;
- texture->flags = p_flags | cube; // can't remove a cube from being a cube
-
- if (texture->flags & VS::TEXTURE_FLAG_REPEAT /*&& texture->target != GL_TEXTURE_CUBE_MAP*/) {
-
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- } else {
- //glTexParameterf( texture->target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE );
- glTexParameterf(texture->target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(texture->target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- }
-
- if (texture->flags & VS::TEXTURE_FLAG_FILTER) {
-
- glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Linear Filtering
- if (texture->flags & VS::TEXTURE_FLAG_MIPMAPS)
- glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
-
- } else {
-
- glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // nearest
- }
-}
-uint32_t RasterizerIPhone::texture_get_flags(RID p_texture) const {
-
- Texture *texture = texture_owner.get(p_texture);
-
- ERR_FAIL_COND_V(!texture, 0);
-
- return texture->flags;
-}
-Image::Format RasterizerIPhone::texture_get_format(RID p_texture) const {
-
- Texture *texture = texture_owner.get(p_texture);
-
- ERR_FAIL_COND_V(!texture, Image::FORMAT_L8);
-
- return texture->format;
-}
-uint32_t RasterizerIPhone::texture_get_width(RID p_texture) const {
-
- Texture *texture = texture_owner.get(p_texture);
-
- ERR_FAIL_COND_V(!texture, 0);
-
- return texture->width;
-}
-uint32_t RasterizerIPhone::texture_get_height(RID p_texture) const {
-
- Texture *texture = texture_owner.get(p_texture);
-
- ERR_FAIL_COND_V(!texture, 0);
-
- return texture->height;
-}
-
-bool RasterizerIPhone::texture_has_alpha(RID p_texture) const {
-
- Texture *texture = texture_owner.get(p_texture);
-
- ERR_FAIL_COND_V(!texture, 0);
-
- return texture->has_alpha;
-}
-
-/* SHADER API */
-
-RID RasterizerIPhone::shader_create() {
-
- return RID();
-}
-
-void RasterizerIPhone::shader_node_add(RID p_shader, VS::ShaderNodeType p_type, int p_id) {
-}
-void RasterizerIPhone::shader_node_remove(RID p_shader, int p_id) {
-}
-void RasterizerIPhone::shader_node_change_type(RID p_shader, int p_id, VS::ShaderNodeType p_type) {
-}
-void RasterizerIPhone::shader_node_set_param(RID p_shader, int p_id, const Variant &p_value) {
-}
-
-void RasterizerIPhone::shader_get_node_list(RID p_shader, List<int> *p_node_list) const {
-}
-VS::ShaderNodeType RasterizerIPhone::shader_node_get_type(RID p_shader, int p_id) const {
-
- return VS::NODE_ADD;
-}
-Variant RasterizerIPhone::shader_node_get_param(RID p_shader, int p_id) const {
-
- return Variant();
-}
-
-void RasterizerIPhone::shader_connect(RID p_shader, int p_src_id, int p_src_slot, int p_dst_id, int p_dst_slot) {
-}
-bool RasterizerIPhone::shader_is_connected(RID p_shader, int p_src_id, int p_src_slot, int p_dst_id, int p_dst_slot) const {
-
- return false;
-}
-
-void RasterizerIPhone::shader_disconnect(RID p_shader, int p_src_id, int p_src_slot, int p_dst_id, int p_dst_slot) {
-}
-
-void RasterizerIPhone::shader_get_connections(RID p_shader, List<VS::ShaderConnection> *p_connections) const {
-}
-
-void RasterizerIPhone::shader_clear(RID p_shader) {
-}
-
-/* COMMON MATERIAL API */
-
-void RasterizerIPhone::material_set_param(RID p_material, const StringName &p_param, const Variant &p_value) {
-}
-Variant RasterizerIPhone::material_get_param(RID p_material, const StringName &p_param) const {
-
- return Variant();
-}
-void RasterizerIPhone::material_get_param_list(RID p_material, List<String> *p_param_list) const {
-}
-
-void RasterizerIPhone::material_set_flag(RID p_material, VS::MaterialFlag p_flag, bool p_enabled) {
-}
-bool RasterizerIPhone::material_get_flag(RID p_material, VS::MaterialFlag p_flag) const {
-
- return false;
-}
-
-void RasterizerIPhone::material_set_blend_mode(RID p_material, VS::MaterialBlendMode p_mode) {
-}
-VS::MaterialBlendMode RasterizerIPhone::material_get_blend_mode(RID p_material) const {
-
- return VS::MATERIAL_BLEND_MODE_ADD;
-}
-
-void RasterizerIPhone::material_set_line_width(RID p_material, float p_line_width) {
-}
-float RasterizerIPhone::material_get_line_width(RID p_material) const {
-
- return 0;
-}
-
-/* FIXED MATERIAL */
-
-RID RasterizerIPhone::material_create() {
-
- return material_owner.make_rid(memnew(Material));
-}
-
-void RasterizerIPhone::fixed_material_set_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter, const Variant &p_value) {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND(!m);
- ERR_FAIL_INDEX(p_parameter, VisualServer::FIXED_MATERIAL_PARAM_MAX);
-
- m->parameters[p_parameter] = p_value;
-}
-Variant RasterizerIPhone::fixed_material_get_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND_V(!m, Variant());
- ERR_FAIL_INDEX_V(p_parameter, VisualServer::FIXED_MATERIAL_PARAM_MAX, Variant());
-
- return m->parameters[p_parameter];
-}
-
-void RasterizerIPhone::fixed_material_set_texture(RID p_material, VS::FixedSpatialMaterialParam p_parameter, RID p_texture) {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND(!m);
- ERR_FAIL_INDEX(p_parameter, VisualServer::FIXED_MATERIAL_PARAM_MAX);
-
- m->textures[p_parameter] = p_texture;
-}
-RID RasterizerIPhone::fixed_material_get_texture(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND_V(!m, RID());
- ERR_FAIL_INDEX_V(p_parameter, VisualServer::FIXED_MATERIAL_PARAM_MAX, Variant());
-
- return m->textures[p_parameter];
-}
-
-void RasterizerIPhone::fixed_material_set_detail_blend_mode(RID p_material, VS::MaterialBlendMode p_mode) {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND(!m);
-
- m->detail_blend_mode = p_mode;
-}
-VS::MaterialBlendMode RasterizerIPhone::fixed_material_get_detail_blend_mode(RID p_material) const {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND_V(!m, VS::MATERIAL_BLEND_MODE_MIX);
-
- return m->detail_blend_mode;
-}
-
-void RasterizerIPhone::fixed_material_set_texcoord_mode(RID p_material, VS::FixedSpatialMaterialParam p_parameter, VS::FixedSpatialMaterialTexCoordMode p_mode) {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND(!m);
- ERR_FAIL_INDEX(p_parameter, VisualServer::FIXED_MATERIAL_PARAM_MAX);
-
- m->texcoord_mode[p_parameter] = p_mode;
-}
-VS::FixedSpatialMaterialTexCoordMode RasterizerIPhone::fixed_material_get_texcoord_mode(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND_V(!m, VS::FIXED_MATERIAL_TEXCOORD_TEXGEN);
- ERR_FAIL_INDEX_V(p_parameter, VisualServer::FIXED_MATERIAL_PARAM_MAX, VS::FIXED_MATERIAL_TEXCOORD_UV);
-
- return m->texcoord_mode[p_parameter]; // for now
-}
-
-void RasterizerIPhone::fixed_material_set_texgen_mode(RID p_material, VS::FixedSpatialMaterialTexGenMode p_mode) {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND(!m);
-
- m->texgen_mode = p_mode;
-};
-
-VS::FixedSpatialMaterialTexGenMode RasterizerIPhone::fixed_material_get_texgen_mode(RID p_material) const {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND_V(!m, VS::FIXED_MATERIAL_TEXGEN_SPHERE);
-
- return m->texgen_mode;
-};
-
-void RasterizerIPhone::fixed_material_set_uv_transform(RID p_material, const Transform &p_transform) {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND(!m);
-
- m->uv_transform = p_transform;
-}
-Transform RasterizerIPhone::fixed_material_get_uv_transform(RID p_material) const {
-
- Material *m = material_owner.get(p_material);
- ERR_FAIL_COND_V(!m, Transform());
-
- return m->uv_transform;
-}
-
-/* SHADER MATERIAL */
-
-RID RasterizerIPhone::shader_material_create() const {
-
- return RID();
-}
-
-void RasterizerIPhone::shader_material_set_vertex_shader(RID p_material, RID p_shader, bool p_owned) {
-}
-RID RasterizerIPhone::shader_material_get_vertex_shader(RID p_material) const {
-
- return RID();
-}
-
-void RasterizerIPhone::shader_material_set_fragment_shader(RID p_material, RID p_shader, bool p_owned) {
-}
-RID RasterizerIPhone::shader_material_get_fragment_shader(RID p_material) const {
-
- return RID();
-}
-
-/* MESH API */
-
-RID RasterizerIPhone::mesh_create() {
-
- return mesh_owner.make_rid(memnew(Mesh));
-}
-
-void RasterizerIPhone::mesh_add_surface(RID p_mesh, VS::PrimitiveType p_primitive, uint32_t p_format, int p_array_len, int p_index_array_len) {
-
- Mesh *mesh = mesh_owner.get(p_mesh);
- ERR_FAIL_COND(!mesh);
-
- ERR_FAIL_COND((p_format & VS::ARRAY_FORMAT_VERTEX) == 0); // mandatory
- ERR_FAIL_COND(p_array_len <= 0);
- ERR_FAIL_COND(p_index_array_len == 0);
- ERR_FAIL_INDEX(p_primitive, VS::PRIMITIVE_MAX);
-
- Surface *surface = memnew(Surface);
- ERR_FAIL_COND(!surface);
-
- int total_elem_size = 0;
-
- bool use_VBO = true; //glGenBuffersARB!=NULL; // TODO detect if it's in there
- if (p_format & VS::ARRAY_FORMAT_WEIGHTS) {
-
- use_VBO = false;
- }
-
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
-
- Surface::ArrayData &ad = surface->array[i];
- ad.size = 0;
- ad.configured = false;
- ad.ofs = 0;
- int elem_size = 0;
- int elem_count = 0;
-
- if (!(p_format & (1 << i))) // no array
- continue;
-
- switch (i) {
-
- case VS::ARRAY_VERTEX:
- case VS::ARRAY_NORMAL: {
-
- elem_size = 3 * sizeof(GLfloat); // vertex
- elem_count = 3;
- } break;
- case VS::ARRAY_TANGENT: {
- elem_size = 4 * sizeof(GLfloat); // vertex
- elem_count = 4;
-
- } break;
- case VS::ARRAY_COLOR: {
-
- elem_size = 4; /* RGBA */
- elem_count = 4;
- } break;
- case VS::ARRAY_TEX_UV: {
- elem_size = 2 * sizeof(GLfloat);
- elem_count = 2;
-
- } break;
- case VS::ARRAY_WEIGHTS:
- case VS::ARRAY_BONES: {
-
- elem_size = VS::ARRAY_WEIGHTS_SIZE * sizeof(GLfloat);
- elem_count = VS::ARRAY_WEIGHTS_SIZE;
-
- } break;
- case VS::ARRAY_INDEX: {
-
- if (p_index_array_len <= 0) {
- ERR_PRINT("p_index_array_len==NO_INDEX_ARRAY");
- break;
- }
- /* determine wether using 8 or 16 bits indices */
- if (p_index_array_len > (1 << 8)) {
-
- elem_size = 2;
- } else {
- elem_size = 1;
- }
-
- if (use_VBO) {
-
- glGenBuffers(1, &surface->index_id);
- ERR_FAIL_COND(surface->index_id == 0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, surface->index_id);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, p_index_array_len * elem_size, NULL, GL_STATIC_DRAW);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); //unbind
- } else {
- surface->index_array_local = (uint8_t *)memalloc(p_index_array_len * elem_size);
- };
-
- surface->index_array_len = p_index_array_len; // only way it can exist
- ad.ofs = 0;
- ad.size = elem_size;
- ad.configured = false;
- ad.components = 1;
-
- continue;
- } break;
- default: {
- ERR_FAIL();
- }
- }
-
- ad.ofs = total_elem_size;
- ad.size = elem_size;
- ad.components = elem_count;
- total_elem_size += elem_size;
- ad.configured = false;
- }
-
- surface->stride = total_elem_size;
- surface->array_len = p_array_len;
- surface->format = p_format;
- surface->primitive = p_primitive;
-
- /* bind the bigass buffers */
- if (use_VBO) {
-
- glGenBuffers(1, &surface->vertex_id);
- ERR_FAIL_COND(surface->vertex_id == 0);
- glBindBuffer(GL_ARRAY_BUFFER, surface->vertex_id);
- glBufferData(GL_ARRAY_BUFFER, surface->array_len * surface->stride, NULL, GL_STATIC_DRAW);
- glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind
- } else {
- surface->array_local = (uint8_t *)memalloc(surface->array_len * surface->stride);
- };
-
- mesh->surfaces.push_back(surface);
-}
-
-Error RasterizerIPhone::mesh_surface_set_array(RID p_mesh, int p_surface, VS::ArrayType p_type, const Variant &p_array) {
-
- ERR_FAIL_INDEX_V(p_type, VS::ARRAY_MAX, ERR_INVALID_PARAMETER);
-
- Mesh *mesh = mesh_owner.get(p_mesh);
- ERR_FAIL_COND_V(!mesh, ERR_INVALID_PARAMETER);
- ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), ERR_INVALID_PARAMETER);
- Surface *surface = mesh->surfaces[p_surface];
- ERR_FAIL_COND_V(!surface, ERR_INVALID_PARAMETER);
-
- ERR_FAIL_COND_V(surface->array[p_type].size == 0, ERR_INVALID_PARAMETER);
-
- Surface::ArrayData &a = surface->array[p_type];
-
- switch (p_type) {
-
- case VS::ARRAY_INDEX: {
- ERR_FAIL_COND_V(surface->index_array_len <= 0, ERR_INVALID_DATA);
- ERR_FAIL_COND_V(p_array.get_type() != Variant::INT_ARRAY, ERR_INVALID_PARAMETER);
-
- PoolVector<int> indices = p_array;
- ERR_FAIL_COND_V(indices.size() == 0, ERR_INVALID_PARAMETER);
- ERR_FAIL_COND_V(indices.size() != surface->index_array_len, ERR_INVALID_PARAMETER);
-
- /* determine wether using 16 or 32 bits indices */
-
- if (surface->index_array_local == 0) {
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, surface->index_id);
- };
-
- PoolVector<int>::Read read = indices.read();
- const int *src = read.ptr();
-
- for (int i = 0; i < surface->index_array_len; i++) {
-
- if (surface->index_array_local) {
-
- if (a.size <= (1 << 8)) {
- uint8_t v = src[i];
-
- copymem(&surface->array_local[i * a.size], &v, a.size);
- } else {
- uint16_t v = src[i];
-
- copymem(&surface->array_local[i * a.size], &v, a.size);
- }
-
- } else {
- if (a.size <= (1 << 8)) {
- uint8_t v = src[i];
-
- glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, i * a.size, a.size, &v);
- } else {
- uint16_t v = src[i];
-
- glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, i * a.size, a.size, &v);
- }
- };
- }
- if (surface->index_array_local == 0) {
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- };
- a.configured = true;
- return OK;
- } break;
- case VS::ARRAY_VERTEX:
- case VS::ARRAY_NORMAL: {
-
- ERR_FAIL_COND_V(p_array.get_type() != Variant::VECTOR3_ARRAY, ERR_INVALID_PARAMETER);
-
- PoolVector<Vector3> array = p_array;
- ERR_FAIL_COND_V(array.size() != surface->array_len, ERR_INVALID_PARAMETER);
-
- if (surface->array_local == 0) {
- glBindBuffer(GL_ARRAY_BUFFER, surface->vertex_id);
- };
-
- PoolVector<Vector3>::Read read = array.read();
- const Vector3 *src = read.ptr();
-
- // setting vertices means regenerating the AABB
- if (p_type == VS::ARRAY_VERTEX)
- surface->aabb = AABB();
-
- for (int i = 0; i < surface->array_len; i++) {
-
- GLfloat vector[3] = { src[i].x, src[i].y, src[i].z };
-
- if (surface->array_local == 0) {
- glBufferSubData(GL_ARRAY_BUFFER, a.ofs + i * surface->stride, a.size, vector);
- } else {
- copymem(&surface->array_local[a.ofs + i * surface->stride], vector, a.size);
- }
-
- if (p_type == VS::ARRAY_VERTEX) {
-
- if (i == 0) {
-
- surface->aabb = AABB(src[i], Vector3());
- } else {
-
- surface->aabb.expand_to(src[i]);
- }
- }
- }
-
- if (surface->array_local == 0) {
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- };
-
- } break;
- case VS::ARRAY_TANGENT: {
-
- ERR_FAIL_COND_V(p_array.get_type() != Variant::REAL_ARRAY, ERR_INVALID_PARAMETER);
-
- PoolVector<real_t> array = p_array;
-
- ERR_FAIL_COND_V(array.size() != surface->array_len * 4, ERR_INVALID_PARAMETER);
-
- if (surface->array_local == 0) {
- glBindBuffer(GL_ARRAY_BUFFER, surface->vertex_id);
- };
-
- PoolVector<real_t>::Read read = array.read();
- const real_t *src = read.ptr();
-
- for (int i = 0; i < surface->array_len; i++) {
-
- GLfloat xyzw[4] = {
- src[i * 4 + 0],
- src[i * 4 + 1],
- src[i * 4 + 2],
- src[i * 4 + 3]
- };
-
- if (surface->array_local == 0) {
-
- glBufferSubData(GL_ARRAY_BUFFER, a.ofs + i * surface->stride, a.size, xyzw);
- } else {
-
- copymem(&surface->array_local[a.ofs + i * surface->stride], xyzw, a.size);
- };
- }
-
- if (surface->array_local == 0) {
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- };
- } break;
- case VS::ARRAY_COLOR: {
-
- ERR_FAIL_COND_V(p_array.get_type() != Variant::COLOR_ARRAY, ERR_INVALID_PARAMETER);
-
- PoolVector<Color> array = p_array;
-
- ERR_FAIL_COND_V(array.size() != surface->array_len, ERR_INVALID_PARAMETER);
-
- if (surface->array_local == 0)
- glBindBuffer(GL_ARRAY_BUFFER, surface->vertex_id);
-
- PoolVector<Color>::Read read = array.read();
- const Color *src = read.ptr();
- surface->has_alpha_cache = false;
-
- for (int i = 0; i < surface->array_len; i++) {
-
- if (src[i].a < 0.98) // tolerate alpha a bit, for crappy exporters
- surface->has_alpha_cache = true;
- uint8_t colors[4] = { src[i].r * 255.0, src[i].g * 255.0, src[i].b * 255.0, src[i].a * 255.0 };
- // I'm not sure if this is correct, endianness-wise, i should re-check the GL spec
-
- if (surface->array_local == 0)
- glBufferSubData(GL_ARRAY_BUFFER, a.ofs + i * surface->stride, a.size, colors);
- else
- copymem(&surface->array_local[a.ofs + i * surface->stride], colors, a.size);
- }
-
- if (surface->array_local == 0)
- glBindBuffer(GL_ARRAY_BUFFER, 0);
-
- } break;
- case VS::ARRAY_TEX_UV: {
-
- ERR_FAIL_COND_V(p_array.get_type() != Variant::VECTOR3_ARRAY, ERR_INVALID_PARAMETER);
-
- PoolVector<Vector3> array = p_array;
-
- ERR_FAIL_COND_V(array.size() != surface->array_len, ERR_INVALID_PARAMETER);
-
- if (surface->array_local == 0)
- glBindBuffer(GL_ARRAY_BUFFER, surface->vertex_id);
-
- PoolVector<Vector3>::Read read = array.read();
-
- const Vector3 *src = read.ptr();
-
- for (int i = 0; i < surface->array_len; i++) {
-
- GLfloat uv[2] = { src[i].x, src[i].y };
-
- if (surface->array_local == 0)
- glBufferSubData(GL_ARRAY_BUFFER, a.ofs + i * surface->stride, a.size, uv);
- else
- copymem(&surface->array_local[a.ofs + i * surface->stride], uv, a.size);
- }
-
- if (surface->array_local == 0)
- glBindBuffer(GL_ARRAY_BUFFER, 0);
-
- } break;
- case VS::ARRAY_BONES:
- case VS::ARRAY_WEIGHTS: {
-
- ERR_FAIL_COND_V(p_array.get_type() != Variant::REAL_ARRAY, ERR_INVALID_PARAMETER);
-
- PoolVector<real_t> array = p_array;
-
- ERR_FAIL_COND_V(array.size() != surface->array_len * VS::ARRAY_WEIGHTS_SIZE, ERR_INVALID_PARAMETER);
-
- if (surface->array_local == 0)
- glBindBuffer(GL_ARRAY_BUFFER, surface->vertex_id);
-
- PoolVector<real_t>::Read read = array.read();
-
- const real_t *src = read.ptr();
-
- for (int i = 0; i < surface->array_len; i++) {
-
- GLfloat data[VS::ARRAY_WEIGHTS_SIZE];
- for (int j = 0; j < VS::ARRAY_WEIGHTS_SIZE; j++)
- data[j] = src[i * VS::ARRAY_WEIGHTS_SIZE + j];
-
- if (surface->array_local == 0)
- glBufferSubData(GL_ARRAY_BUFFER, a.ofs + i * surface->stride, a.size, data);
- else
- copymem(&surface->array_local[a.ofs + i * surface->stride], data, a.size);
- }
-
- if (surface->array_local == 0)
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- } break;
- default: { ERR_FAIL_V(ERR_INVALID_PARAMETER); }
- }
-
- a.configured = true;
-
- return OK;
-}
-Variant RasterizerIPhone::mesh_surface_get_array(RID p_mesh, int p_surface, VS::ArrayType p_type) const {
-
- return Variant();
-}
-
-void RasterizerIPhone::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material, bool p_owned) {
-
- Mesh *mesh = mesh_owner.get(p_mesh);
- ERR_FAIL_COND(!mesh);
- ERR_FAIL_INDEX(p_surface, mesh->surfaces.size());
- Surface *surface = mesh->surfaces[p_surface];
- ERR_FAIL_COND(!surface);
-
- if (surface->material_owned && surface->material.is_valid())
- free(surface->material);
-
- surface->material_owned = p_owned;
-
- surface->material = p_material;
-}
-
-RID RasterizerIPhone::mesh_surface_get_material(RID p_mesh, int p_surface) const {
-
- Mesh *mesh = mesh_owner.get(p_mesh);
- ERR_FAIL_COND_V(!mesh, RID());
- ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), RID());
- Surface *surface = mesh->surfaces[p_surface];
- ERR_FAIL_COND_V(!surface, RID());
-
- return surface->material;
-}
-
-int RasterizerIPhone::mesh_surface_get_array_len(RID p_mesh, int p_surface) const {
-
- Mesh *mesh = mesh_owner.get(p_mesh);
- ERR_FAIL_COND_V(!mesh, -1);
- ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), -1);
- Surface *surface = mesh->surfaces[p_surface];
- ERR_FAIL_COND_V(!surface, -1);
-
- return surface->array_len;
-}
-int RasterizerIPhone::mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const {
-
- Mesh *mesh = mesh_owner.get(p_mesh);
- ERR_FAIL_COND_V(!mesh, -1);
- ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), -1);
- Surface *surface = mesh->surfaces[p_surface];
- ERR_FAIL_COND_V(!surface, -1);
-
- return surface->index_array_len;
-}
-uint32_t RasterizerIPhone::mesh_surface_get_format(RID p_mesh, int p_surface) const {
-
- Mesh *mesh = mesh_owner.get(p_mesh);
- ERR_FAIL_COND_V(!mesh, 0);
- ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), 0);
- Surface *surface = mesh->surfaces[p_surface];
- ERR_FAIL_COND_V(!surface, 0);
-
- return surface->format;
-}
-VS::PrimitiveType RasterizerIPhone::mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const {
-
- Mesh *mesh = mesh_owner.get(p_mesh);
- ERR_FAIL_COND_V(!mesh, VS::PRIMITIVE_POINTS);
- ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), VS::PRIMITIVE_POINTS);
- Surface *surface = mesh->surfaces[p_surface];
- ERR_FAIL_COND_V(!surface, VS::PRIMITIVE_POINTS);
-
- return surface->primitive;
-}
-
-void RasterizerIPhone::mesh_erase_surface(RID p_mesh, int p_index) {
-
- Mesh *mesh = mesh_owner.get(p_mesh);
- ERR_FAIL_COND(!mesh);
- ERR_FAIL_INDEX(p_index, mesh->surfaces.size());
- Surface *surface = mesh->surfaces[p_index];
- ERR_FAIL_COND(!surface);
-
- memdelete(mesh->surfaces[p_index]);
- mesh->surfaces.remove(p_index);
-}
-int RasterizerIPhone::mesh_get_surface_count(RID p_mesh) const {
-
- Mesh *mesh = mesh_owner.get(p_mesh);
- ERR_FAIL_COND_V(!mesh, -1);
-
- return mesh->surfaces.size();
-}
-
-AABB RasterizerIPhone::mesh_get_aabb(RID p_mesh) const {
-
- Mesh *mesh = mesh_owner.get(p_mesh);
- ERR_FAIL_COND_V(!mesh, AABB());
-
- AABB aabb;
-
- for (int i = 0; i < mesh->surfaces.size(); i++) {
-
- if (i == 0)
- aabb = mesh->surfaces[i]->aabb;
- else
- aabb.merge_with(mesh->surfaces[i]->aabb);
- }
-
- return aabb;
-}
-
-/* MULTIMESH API */
-
-RID RasterizerIPhone::multimesh_create() {
-
- return RID();
-}
-
-void RasterizerIPhone::multimesh_set_instance_count(RID p_multimesh, int p_count) {
-}
-int RasterizerIPhone::multimesh_get_instance_count(RID p_multimesh) const {
-
- return 0;
-}
-
-void RasterizerIPhone::multimesh_set_mesh(RID p_multimesh, RID p_mesh) {
-}
-void RasterizerIPhone::multimesh_set_aabb(RID p_multimesh, const AABB &p_aabb) {
-}
-void RasterizerIPhone::multimesh_instance_set_transform(RID p_multimesh, int p_index, const Transform &p_transform) {
-}
-void RasterizerIPhone::multimesh_instance_set_color(RID p_multimesh, int p_index, const Color &p_color) {
-}
-
-RID RasterizerIPhone::multimesh_get_mesh(RID p_multimesh) const {
-
- return RID();
-}
-AABB RasterizerIPhone::multimesh_get_aabb(RID p_multimesh) const {
-
- return AABB();
-}
-
-Transform RasterizerIPhone::multimesh_instance_get_transform(RID p_multimesh, int p_index) const {
-
- return Transform();
-}
-Color RasterizerIPhone::multimesh_instance_get_color(RID p_multimesh, int p_index) const {
-
- return Color();
-}
-
-/* POLY API */
-
-RID RasterizerIPhone::poly_create() {
-
- return RID();
-}
-void RasterizerIPhone::poly_set_material(RID p_poly, RID p_material, bool p_owned) {
-}
-void RasterizerIPhone::poly_add_primitive(RID p_poly, const Vector<Vector3> &p_points, const Vector<Vector3> &p_normals, const Vector<Color> &p_colors, const Vector<Vector3> &p_uvs) {
-}
-void RasterizerIPhone::poly_clear(RID p_poly) {
-}
-
-AABB RasterizerIPhone::poly_get_aabb(RID p_poly) const {
-
- return AABB();
-}
-
-/* PARTICLES API */
-
-RID RasterizerIPhone::particles_create() {
-
- return RID();
-}
-
-void RasterizerIPhone::particles_set_amount(RID p_particles, int p_amount) {
-}
-int RasterizerIPhone::particles_get_amount(RID p_particles) const {
-
- return 0;
-}
-
-void RasterizerIPhone::particles_set_emitting(RID p_particles, bool p_emitting) {
-}
-
-bool RasterizerIPhone::particles_is_emitting(RID p_particles) const {
-
- return false;
-}
-
-void RasterizerIPhone::particles_set_visibility_aabb(RID p_particles, const AABB &p_visibility) {
-}
-AABB RasterizerIPhone::particles_get_visibility_aabb(RID p_particles) const {
-
- return AABB();
-}
-
-void RasterizerIPhone::particles_set_emission_half_extents(RID p_particles, const Vector3 &p_half_extents) {
-}
-Vector3 RasterizerIPhone::particles_get_emission_half_extents(RID p_particles) const {
-
- return Vector3();
-}
-
-void RasterizerIPhone::particles_set_gravity_normal(RID p_particles, const Vector3 &p_normal) {
-}
-Vector3 RasterizerIPhone::particles_get_gravity_normal(RID p_particles) const {
-
- return Vector3();
-}
-
-void RasterizerIPhone::particles_set_variable(RID p_particles, VS::ParticleVariable p_variable, float p_value) {
-}
-float RasterizerIPhone::particles_get_variable(RID p_particles, VS::ParticleVariable p_variable) const {
-
- return 0;
-}
-
-void RasterizerIPhone::particles_set_randomness(RID p_particles, VS::ParticleVariable p_variable, float p_randomness) {
-}
-float RasterizerIPhone::particles_get_randomness(RID p_particles, VS::ParticleVariable p_variable) const {
-
- return 0;
-}
-
-void RasterizerIPhone::particles_set_color_phase_pos(RID p_particles, int p_phase, float p_pos) {
-}
-float RasterizerIPhone::particles_get_color_phase_pos(RID p_particles, int p_phase) const {
-
- return 0;
-}
-
-void RasterizerIPhone::particles_set_color_phases(RID p_particles, int p_phases) {
-}
-int RasterizerIPhone::particles_get_color_phases(RID p_particles) const {
-
- return 0;
-}
-
-void RasterizerIPhone::particles_set_color_phase_color(RID p_particles, int p_phase, const Color &p_color) {
-}
-Color RasterizerIPhone::particles_get_color_phase_color(RID p_particles, int p_phase) const {
-
- return Color();
-}
-
-void RasterizerIPhone::particles_set_attractors(RID p_particles, int p_attractors) {
-}
-int RasterizerIPhone::particles_get_attractors(RID p_particles) const {
-
- return 0;
-}
-
-void RasterizerIPhone::particles_set_attractor_pos(RID p_particles, int p_attractor, const Vector3 &p_pos) {
-}
-Vector3 RasterizerIPhone::particles_get_attractor_pos(RID p_particles, int p_attractor) const {
-
- return Vector3();
-}
-
-void RasterizerIPhone::particles_set_attractor_strength(RID p_particles, int p_attractor, float p_force) {
-}
-float RasterizerIPhone::particles_get_attractor_strength(RID p_particles, int p_attractor) const {
-
- return 0;
-}
-
-void RasterizerIPhone::particles_set_material(RID p_particles, RID p_material, bool p_owned) {
-}
-
-RID RasterizerIPhone::particles_get_material(RID p_particles) const {
-
- return RID();
-}
-
-AABB RasterizerIPhone::particles_get_aabb(RID p_particles) const {
-
- return AABB();
-}
-/* BEAM API */
-
-RID RasterizerIPhone::beam_create() {
-
- return RID();
-}
-
-void RasterizerIPhone::beam_set_point_count(RID p_beam, int p_count) {
-}
-int RasterizerIPhone::beam_get_point_count(RID p_beam) const {
-
- return 0;
-}
-void RasterizerIPhone::beam_clear(RID p_beam) {
-}
-
-void RasterizerIPhone::beam_set_point(RID p_beam, int p_point, Vector3 &p_pos) {
-}
-Vector3 RasterizerIPhone::beam_get_point(RID p_beam, int p_point) const {
-
- return Vector3();
-}
-
-void RasterizerIPhone::beam_set_primitive(RID p_beam, VS::BeamPrimitive p_primitive) {
-}
-
-VS::BeamPrimitive RasterizerIPhone::beam_get_primitive(RID p_beam) const {
-
- return VS::BEAM_CUBIC;
-}
-
-void RasterizerIPhone::beam_set_material(RID p_beam, RID p_material) {
-}
-RID RasterizerIPhone::beam_get_material(RID p_beam) const {
-
- return RID();
-}
-
-AABB RasterizerIPhone::beam_get_aabb(RID p_particles) const {
-
- return AABB();
-}
-/* SKELETON API */
-
-RID RasterizerIPhone::skeleton_create() {
-
- Skeleton *skeleton = memnew(Skeleton);
- ERR_FAIL_COND_V(!skeleton, RID());
- return skeleton_owner.make_rid(skeleton);
-}
-void RasterizerIPhone::skeleton_resize(RID p_skeleton, int p_bones) {
-
- Skeleton *skeleton = skeleton_owner.get(p_skeleton);
- ERR_FAIL_COND(!skeleton);
- if (p_bones == skeleton->bones.size()) {
- return;
- };
- ERR_FAIL_COND(p_bones < 0 || p_bones > 256);
-
- skeleton->bones.resize(p_bones);
-}
-int RasterizerIPhone::skeleton_get_bone_count(RID p_skeleton) const {
-
- Skeleton *skeleton = skeleton_owner.get(p_skeleton);
- ERR_FAIL_COND_V(!skeleton, -1);
- return skeleton->bones.size();
-}
-void RasterizerIPhone::skeleton_bone_set_transform(RID p_skeleton, int p_bone, const Transform &p_transform) {
-
- Skeleton *skeleton = skeleton_owner.get(p_skeleton);
- ERR_FAIL_COND(!skeleton);
- ERR_FAIL_INDEX(p_bone, skeleton->bones.size());
-
- skeleton->bones[p_bone] = p_transform;
-}
-Transform RasterizerIPhone::skeleton_bone_get_transform(RID p_skeleton, int p_bone) {
-
- Skeleton *skeleton = skeleton_owner.get(p_skeleton);
- ERR_FAIL_COND_V(!skeleton, Transform());
- ERR_FAIL_INDEX_V(p_bone, skeleton->bones.size(), Transform());
-
- // something
- return skeleton->bones[p_bone];
-}
-
-/* LIGHT API */
-
-RID RasterizerIPhone::light_create(VS::LightType p_type) {
-
- Light *light = memnew(Light);
- light->type = p_type;
- return light_owner.make_rid(light);
-}
-
-VS::LightType RasterizerIPhone::light_get_type(RID p_light) const {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND_V(!light, VS::LIGHT_OMNI);
- return light->type;
-}
-
-void RasterizerIPhone::light_set_color(RID p_light, VS::LightColor p_type, const Color &p_color) {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND(!light);
- ERR_FAIL_INDEX(p_type, 3);
- light->colors[p_type] = p_color;
-}
-Color RasterizerIPhone::light_get_color(RID p_light, VS::LightColor p_type) const {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND_V(!light, Color());
- ERR_FAIL_INDEX_V(p_type, 3, Color());
- return light->colors[p_type];
-}
-
-void RasterizerIPhone::light_set_shadow(RID p_light, bool p_enabled) {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND(!light);
- light->shadow_enabled = p_enabled;
-}
-
-bool RasterizerIPhone::light_has_shadow(RID p_light) const {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND_V(!light, false);
- return light->shadow_enabled;
-}
-
-void RasterizerIPhone::light_set_volumetric(RID p_light, bool p_enabled) {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND(!light);
- light->volumetric_enabled = p_enabled;
-}
-bool RasterizerIPhone::light_is_volumetric(RID p_light) const {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND_V(!light, false);
- return light->volumetric_enabled;
-}
-
-void RasterizerIPhone::light_set_projector(RID p_light, RID p_texture) {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND(!light);
- light->projector = p_texture;
-}
-RID RasterizerIPhone::light_get_projector(RID p_light) const {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND_V(!light, RID());
- return light->projector;
-}
-
-void RasterizerIPhone::light_set_var(RID p_light, VS::LightParam p_var, float p_value) {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND(!light);
- ERR_FAIL_INDEX(p_var, VS::LIGHT_PARAM_MAX);
-
- light->vars[p_var] = p_value;
-}
-float RasterizerIPhone::light_get_var(RID p_light, VS::LightParam p_var) const {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND_V(!light, 0);
-
- ERR_FAIL_INDEX_V(p_var, VS::LIGHT_PARAM_MAX, 0);
-
- return light->vars[p_var];
-}
-
-AABB RasterizerIPhone::light_get_aabb(RID p_light) const {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND_V(!light, AABB());
-
- switch (light->type) {
-
- case VS::LIGHT_SPOT: {
-
- float len = light->vars[VS::LIGHT_PARAM_RADIUS];
- float size = Math::tan(Math::deg2rad(light->vars[VS::LIGHT_PARAM_SPOT_ANGLE])) * len;
- return AABB(Vector3(-size, -size, -len), Vector3(size * 2, size * 2, len));
- } break;
- case VS::LIGHT_OMNI: {
-
- float r = light->vars[VS::LIGHT_PARAM_RADIUS];
- return AABB(-Vector3(r, r, r), Vector3(r, r, r) * 2);
- } break;
- case VS::LIGHT_DIRECTIONAL: {
-
- return AABB();
- } break;
- default: {}
- }
-
- ERR_FAIL_V(AABB());
-}
-
-RID RasterizerIPhone::light_instance_create(RID p_light) {
-
- Light *light = light_owner.get(p_light);
- ERR_FAIL_COND_V(!light, RID());
-
- LightInstance *light_instance = memnew(LightInstance);
-
- light_instance->light = p_light;
- light_instance->base = light;
- light_instance->last_pass = 0;
-
- return light_instance_owner.make_rid(light_instance);
-}
-void RasterizerIPhone::light_instance_set_transform(RID p_light_instance, const Transform &p_transform) {
-
- LightInstance *lighti = light_instance_owner.get(p_light_instance);
- ERR_FAIL_COND(!lighti);
- lighti->transform = p_transform;
-}
-
-void RasterizerIPhone::light_instance_set_active_hint(RID p_light_instance) {
-
- LightInstance *lighti = light_instance_owner.get(p_light_instance);
- ERR_FAIL_COND(!lighti);
- lighti->last_pass = frame;
-}
-bool RasterizerIPhone::light_instance_has_shadow(RID p_light_instance) const {
-
- return false;
-}
-bool RasterizerIPhone::light_instance_assign_shadow(RID p_light_instance) {
-
- return false;
-}
-Rasterizer::ShadowType RasterizerIPhone::light_instance_get_shadow_type(RID p_light_instance) const {
-
- return Rasterizer::SHADOW_CUBE;
-}
-int RasterizerIPhone::light_instance_get_shadow_passes(RID p_light_instance) const {
-
- return 0;
-}
-void RasterizerIPhone::light_instance_set_pssm_split_info(RID p_light_instance, int p_split, float p_near, float p_far, const CameraMatrix &p_camera, const Transform &p_transform) {
-}
-
-/* PARTICLES INSTANCE */
-
-RID RasterizerIPhone::particles_instance_create(RID p_particles) {
-
- return RID();
-}
-void RasterizerIPhone::particles_instance_set_transform(RID p_particles_instance, const Transform &p_transform) {
-}
-
-/* RENDER API */
-/* all calls (inside begin/end shadow) are always warranted to be in the following order: */
-
-static GLfloat rtri; // Angle For The Triangle ( NEW )
-static GLfloat rquad; // Angle For The Quad ( NEW )
-
-void RasterizerIPhone::begin_frame() {
-
- window_size = Size2(OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height);
-
- double time = (OS::get_singleton()->get_ticks_usec() / 1000); // get msec
- time /= 1000.0; // make secs
- time_delta = time - last_time;
- last_time = time;
- frame++;
- glClearColor(0, 0, 1, 1);
- glClear(GL_COLOR_BUFFER_BIT);
-
-/* nehe ?*/
-
-#if 0
- glViewport(0,0,window_size.width,window_size.height); // Reset The Current Viewport
-
- glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
- glLoadIdentity(); // Reset The Projection Matrix
-
- // Calculate The Aspect Ratio Of The Window
- gluPerspective(45.0f,(GLfloat)window_size.width/(GLfloat)window_size.height,0.1f,100.0f);
-
- glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
- glLoadIdentity(); // Reset The Modelview Matrix
-
-
-
- glShadeModel(GL_SMOOTH); // Enable Smooth Shading
- glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background
- glClearDepth(1.0f); // Depth Buffer Setup
- glEnable(GL_DEPTH_TEST); // Enables Depth Testing
- glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
- glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer
- glLoadIdentity(); // Reset The Current Modelview Matrix
- glTranslatef(-1.5f,0.0f,-6.0f); // Move Left 1.5 Units And Into The Screen 6.0
- glRotatef(rtri,0.0f,1.0f,0.0f); // Rotate The Triangle On The Y axis ( NEW )
- glBegin(GL_TRIANGLES); // Start Drawing A Triangle
- glColor3f(1.0f,0.0f,0.0f); // Red
- glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Front)
- glColor3f(0.0f,1.0f,0.0f); // Green
- glVertex3f(-1.0f,-1.0f, 1.0f); // Left Of Triangle (Front)
- glColor3f(0.0f,0.0f,1.0f); // Blue
- glVertex3f( 1.0f,-1.0f, 1.0f); // Right Of Triangle (Front)
- glColor3f(1.0f,0.0f,0.0f); // Red
- glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Right)
- glColor3f(0.0f,0.0f,1.0f); // Blue
- glVertex3f( 1.0f,-1.0f, 1.0f); // Left Of Triangle (Right)
- glColor3f(0.0f,1.0f,0.0f); // Green
- glVertex3f( 1.0f,-1.0f, -1.0f); // Right Of Triangle (Right)
- glColor3f(1.0f,0.0f,0.0f); // Red
- glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Back)
- glColor3f(0.0f,1.0f,0.0f); // Green
- glVertex3f( 1.0f,-1.0f, -1.0f); // Left Of Triangle (Back)
- glColor3f(0.0f,0.0f,1.0f); // Blue
- glVertex3f(-1.0f,-1.0f, -1.0f); // Right Of Triangle (Back)
- glColor3f(1.0f,0.0f,0.0f); // Red
- glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Left)
- glColor3f(0.0f,0.0f,1.0f); // Blue
- glVertex3f(-1.0f,-1.0f,-1.0f); // Left Of Triangle (Left)
- glColor3f(0.0f,1.0f,0.0f); // Green
- glVertex3f(-1.0f,-1.0f, 1.0f); // Right Of Triangle (Left)
- glEnd(); // Done Drawing The Pyramid
-
- glLoadIdentity(); // Reset The Current Modelview Matrix
- glTranslatef(1.5f,0.0f,-7.0f); // Move Right 1.5 Units And Into The Screen 7.0
- glRotatef(rquad,1.0f,1.0f,1.0f); // Rotate The Quad On The X axis ( NEW )
- glBegin(GL_QUADS); // Draw A Quad
- glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green
- glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Top)
- glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Top)
- glVertex3f(-1.0f, 1.0f, 1.0f); // Bottom Left Of The Quad (Top)
- glVertex3f( 1.0f, 1.0f, 1.0f); // Bottom Right Of The Quad (Top)
- glColor3f(1.0f,0.5f,0.0f); // Set The Color To Orange
- glVertex3f( 1.0f,-1.0f, 1.0f); // Top Right Of The Quad (Bottom)
- glVertex3f(-1.0f,-1.0f, 1.0f); // Top Left Of The Quad (Bottom)
- glVertex3f(-1.0f,-1.0f,-1.0f); // Bottom Left Of The Quad (Bottom)
- glVertex3f( 1.0f,-1.0f,-1.0f); // Bottom Right Of The Quad (Bottom)
- glColor3f(1.0f,0.0f,0.0f); // Set The Color To Red
- glVertex3f( 1.0f, 1.0f, 1.0f); // Top Right Of The Quad (Front)
- glVertex3f(-1.0f, 1.0f, 1.0f); // Top Left Of The Quad (Front)
- glVertex3f(-1.0f,-1.0f, 1.0f); // Bottom Left Of The Quad (Front)
- glVertex3f( 1.0f,-1.0f, 1.0f); // Bottom Right Of The Quad (Front)
- glColor3f(1.0f,1.0f,0.0f); // Set The Color To Yellow
- glVertex3f( 1.0f,-1.0f,-1.0f); // Top Right Of The Quad (Back)
- glVertex3f(-1.0f,-1.0f,-1.0f); // Top Left Of The Quad (Back)
- glVertex3f(-1.0f, 1.0f,-1.0f); // Bottom Left Of The Quad (Back)
- glVertex3f( 1.0f, 1.0f,-1.0f); // Bottom Right Of The Quad (Back)
- glColor3f(0.0f,0.0f,1.0f); // Set The Color To Blue
- glVertex3f(-1.0f, 1.0f, 1.0f); // Top Right Of The Quad (Left)
- glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Left)
- glVertex3f(-1.0f,-1.0f,-1.0f); // Bottom Left Of The Quad (Left)
- glVertex3f(-1.0f,-1.0f, 1.0f); // Bottom Right Of The Quad (Left)
- glColor3f(1.0f,0.0f,1.0f); // Set The Color To Violet
- glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Right)
- glVertex3f( 1.0f, 1.0f, 1.0f); // Top Left Of The Quad (Right)
- glVertex3f( 1.0f,-1.0f, 1.0f); // Bottom Left Of The Quad (Right)
- glVertex3f( 1.0f,-1.0f,-1.0f); // Bottom Right Of The Quad (Right)
- glEnd(); // Done Drawing The Quad
-
- rtri+=0.2f; // Increase The Rotation Variable For The Triangle ( NEW )
- rquad-=0.15f; // Decrease The Rotation Variable For The Quad ( NEW )
-
-#endif
-}
-
-void RasterizerIPhone::set_viewport(const VS::ViewportRect &p_viewport) {
-
- viewport = p_viewport;
- canvas_transform = Transform();
- canvas_transform.translate(-(viewport.width / 2.0f), -(viewport.height / 2.0f), 0.0f);
- canvas_transform.scale(Vector3(2.0f / viewport.width, -2.0f / viewport.height, 1.0f));
-
- glViewport(viewport.x, window_size.height - (viewport.height + viewport.y), viewport.width, viewport.height);
-}
-
-void RasterizerIPhone::begin_scene(RID p_fx, VS::ScenarioDebugMode p_debug) {
-
- opaque_render_list.clear();
- alpha_render_list.clear();
- light_instance_count = 0;
- scene_fx = p_fx.is_valid() ? fx_owner.get(p_fx) : NULL;
-};
-
-void RasterizerIPhone::begin_shadow_map(RID p_light_instance, int p_shadow_pass) {
-}
-
-void RasterizerIPhone::set_camera(const Transform &p_world, const CameraMatrix &p_projection) {
-
- camera_transform = p_world;
- camera_transform_inverse = camera_transform.inverse();
- camera_projection = p_projection;
- camera_plane = Plane(camera_transform.origin, camera_transform.basis.get_axis(2));
- camera_z_near = camera_projection.get_z_near();
- camera_z_far = camera_projection.get_z_far();
- camera_projection.get_viewport_size(camera_vp_size.x, camera_vp_size.y);
-}
-
-void RasterizerIPhone::add_light(RID p_light_instance) {
-
-#define LIGHT_FADE_TRESHOLD 0.05
-
- ERR_FAIL_COND(light_instance_count >= MAX_LIGHTS);
-
- LightInstance *li = light_instance_owner.get(p_light_instance);
- ERR_FAIL_COND(!li);
-
- /* make light hash */
-
- // actually, not really a hash, but helps to sort the lights
- // and avoid recompiling redudant shader versions
-
- li->hash_aux = li->base->type;
-
- if (li->base->shadow_enabled)
- li->hash_aux |= (1 << 3);
-
- if (li->base->projector.is_valid())
- li->hash_aux |= (1 << 4);
-
- if (li->base->shadow_enabled && li->base->volumetric_enabled)
- li->hash_aux |= (1 << 5);
-
- switch (li->base->type) {
-
- case VisualServer::LIGHT_DIRECTIONAL: {
-
- Vector3 dir = li->transform.basis.get_axis(2);
- li->light_vector.x = dir.x;
- li->light_vector.y = dir.y;
- li->light_vector.z = dir.z;
-
- } break;
- case VisualServer::LIGHT_OMNI: {
-
- float radius = li->base->vars[VisualServer::LIGHT_PARAM_RADIUS];
- if (radius == 0)
- radius = 0.0001;
- li->linear_att = (1 / LIGHT_FADE_TRESHOLD) / radius;
- li->light_vector.x = li->transform.origin.x;
- li->light_vector.y = li->transform.origin.y;
- li->light_vector.z = li->transform.origin.z;
-
- } break;
- case VisualServer::LIGHT_SPOT: {
-
- float radius = li->base->vars[VisualServer::LIGHT_PARAM_RADIUS];
- if (radius == 0)
- radius = 0.0001;
- li->linear_att = (1 / LIGHT_FADE_TRESHOLD) / radius;
- li->light_vector.x = li->transform.origin.x;
- li->light_vector.y = li->transform.origin.y;
- li->light_vector.z = li->transform.origin.z;
- Vector3 dir = -li->transform.basis.get_axis(2);
- li->spot_vector.x = dir.x;
- li->spot_vector.y = dir.y;
- li->spot_vector.z = dir.z;
-
- } break;
- }
-
- light_instances[light_instance_count++] = li;
-}
-
-void RasterizerIPhone::_add_geometry(const Geometry *p_geometry, const Transform &p_world, uint32_t p_vertex_format, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides, const Skeleton *p_skeleton, GeometryOwner *p_owner) {
-
- Material *m = NULL;
-
- if (p_geometry->material.is_valid())
- m = material_owner.get(p_geometry->material);
-
- if (!m) {
- m = material_owner.get(default_material);
- }
-
- ERR_FAIL_COND(!m);
-
- LightInstance *lights[RenderList::MAX_LIGHTS];
- int light_count = 0;
-
- RenderList *render_list = &opaque_render_list;
- if (p_geometry->has_alpha || m->detail_blend_mode != VS::MATERIAL_BLEND_MODE_MIX) {
- render_list = &alpha_render_list;
- };
-
- if (!m->flags[VS::MATERIAL_FLAG_UNSHADED]) {
-
- light_count = p_light_count;
- for (int i = 0; i < light_count; i++) {
- lights[i] = light_instance_owner.get(p_light_instances[i]);
- }
- }
-
- render_list->add_element(p_geometry, m, p_world, lights, light_count, p_material_overrides, p_skeleton, camera_plane.distance(p_world.origin), p_owner);
-}
-
-void RasterizerIPhone::add_mesh(RID p_mesh, const Transform *p_world, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides, RID p_skeleton) {
-
- Mesh *mesh = mesh_owner.get(p_mesh);
-
- int ssize = mesh->surfaces.size();
-
- for (int i = 0; i < ssize; i++) {
-
- Surface *s = mesh->surfaces[i];
- Skeleton *sk = p_skeleton.is_valid() ? skeleton_owner.get(p_skeleton) : NULL;
-
- _add_geometry(s, *p_world, s->format, p_light_instances, p_light_count, p_material_overrides, sk, NULL);
- }
-
- mesh->last_pass = frame;
-}
-
-void RasterizerIPhone::add_multimesh(RID p_multimesh, const Transform *p_world, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides) {
-}
-
-void RasterizerIPhone::add_poly(RID p_poly, const Transform *p_world, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides) {
-
- Poly *p = poly_owner.get(p_poly);
- if (!p->primitives.empty()) {
- const Poly::Primitive *pp = &p->primitives[0];
-
- uint32_t format = VisualServer::ARRAY_FORMAT_VERTEX;
-
- if (!pp->normals.empty())
- format |= VisualServer::ARRAY_FORMAT_NORMAL;
- if (!pp->colors.empty())
- format |= VisualServer::ARRAY_FORMAT_COLOR;
- if (!pp->uvs.empty())
- format |= VisualServer::ARRAY_TEX_UV;
-
- _add_geometry(p, *p_world, format, p_light_instances, p_light_count, p_material_overrides, NULL, NULL);
- }
-}
-
-void RasterizerIPhone::add_beam(RID p_beam, const Transform *p_world, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides) {
-}
-
-void RasterizerIPhone::add_particles(RID p_particle_instance, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides) {
-}
-
-void RasterizerIPhone::_setup_material(const Geometry *p_geometry, const Material *p_material) {
-
- if (p_material->flags[VS::MATERIAL_FLAG_DOUBLE_SIDED])
- glDisable(GL_CULL_FACE);
- else {
- glEnable(GL_CULL_FACE);
- glCullFace((p_material->flags[VS::MATERIAL_FLAG_INVERT_FACES]) ? GL_FRONT : GL_BACK);
- }
-
- glEnable(GL_COLOR_MATERIAL); /* unused, unless color array */
- //glColorMaterial( GL_FRONT_AND_BACK, GL_DIFFUSE );
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- ///ambient @TODO offer global ambient group option
- float ambient_rgba[4] = {
- 1,
- 1,
- 1,
- 1.0
- };
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, ambient_rgba);
-
- ///diffuse
- const Color &diffuse_color = p_material->parameters[VS::FIXED_MATERIAL_PARAM_DIFFUSE];
- float diffuse_rgba[4] = {
- (float)diffuse_color.r,
- (float)diffuse_color.g,
- (float)diffuse_color.b,
- (float)diffuse_color.a
- };
-
- glColor4f(diffuse_rgba[0], diffuse_rgba[1], diffuse_rgba[2], diffuse_rgba[3]);
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse_rgba);
-
- //specular
-
- const Color &specular_color = p_material->parameters[VS::FIXED_MATERIAL_PARAM_SPECULAR];
- float specular_rgba[4] = {
- (float)specular_color.r,
- (float)specular_color.g,
- (float)specular_color.b,
- 1.0
- };
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular_rgba);
-
- const Color &emission_color = p_material->parameters[VS::FIXED_MATERIAL_PARAM_EMISSION];
- float emission_rgba[4] = {
- (float)emission_color.r,
- (float)emission_color.g,
- (float)emission_color.b,
- 1.0
- };
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, emission_rgba);
-
- glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, p_material->parameters[VS::FIXED_MATERIAL_PARAM_SPECULAR_EXP]);
-
- if (p_material->flags[VS::MATERIAL_FLAG_UNSHADED]) {
- glDisable(GL_LIGHTING);
- } else {
- glEnable(GL_LIGHTING);
- glDisable(GL_LIGHTING);
- }
-
- //depth test?
- /*
- if (p_material->flags[VS::MATERIAL_FLAG_WIREFRAME])
- glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
- else
- glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
- */
- if (p_material->textures[VS::FIXED_MATERIAL_PARAM_DIFFUSE]) {
-
- Texture *texture = texture_owner.get(p_material->textures[VS::FIXED_MATERIAL_PARAM_DIFFUSE]);
- ERR_FAIL_COND(!texture);
- glActiveTexture(GL_TEXTURE0);
- glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, texture->tex_id);
- };
-};
-
-void RasterizerIPhone::_setup_light(LightInstance *p_instance, int p_idx) {
-
- Light *ld = p_instance->base;
-
- int glid = GL_LIGHT0 + p_idx;
- glLightfv(glid, GL_AMBIENT, ld->colors[VS::LIGHT_COLOR_AMBIENT].components);
- glLightfv(glid, GL_DIFFUSE, ld->colors[VS::LIGHT_COLOR_DIFFUSE].components);
- glLightfv(glid, GL_SPECULAR, ld->colors[VS::LIGHT_COLOR_SPECULAR].components);
-
- switch (ld->type) {
-
- case VS::LIGHT_DIRECTIONAL: {
- /* This doesn't have attenuation */
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
- Vector3 v(0.0, 0.0, -1.0); // directional lights point up by default
- v = p_instance->transform.get_basis().xform(v);
- v = camera_transform_inverse.get_basis().xform(v);
- v.normalize(); // this sucks, so it will be optimized at some point
- v = -v;
- float lightpos[4] = { v.x, v.y, v.z, 0.0 };
-
- glLightfv(glid, GL_POSITION, lightpos); //at modelview
-
- glPopMatrix();
-
- } break;
- case VS::LIGHT_OMNI: {
-
- glLightf(glid, GL_SPOT_CUTOFF, 180.0);
- glLightf(glid, GL_CONSTANT_ATTENUATION, ld->vars[VS::LIGHT_PARAM_ATTENUATION]);
- glLightf(glid, GL_LINEAR_ATTENUATION, ld->vars[VS::LIGHT_PARAM_RADIUS]);
- glLightf(glid, GL_QUADRATIC_ATTENUATION, ld->vars[VS::LIGHT_PARAM_ENERGY]); // wut?
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
- Vector3 pos = p_instance->transform.get_origin();
- pos = camera_transform_inverse.xform(pos);
- float lightpos[4] = { pos.x, pos.y, pos.z, 1.0 };
- glLightfv(glid, GL_POSITION, lightpos); //at modelview
-
- glPopMatrix();
-
- } break;
- case VS::LIGHT_SPOT: {
-
- glLightf(glid, GL_SPOT_CUTOFF, ld->vars[VS::LIGHT_PARAM_SPOT_ANGLE]);
- glLightf(glid, GL_SPOT_EXPONENT, ld->vars[VS::LIGHT_PARAM_SPOT_ATTENUATION]);
- glLightf(glid, GL_CONSTANT_ATTENUATION, ld->vars[VS::LIGHT_PARAM_ATTENUATION]);
- glLightf(glid, GL_LINEAR_ATTENUATION, ld->vars[VS::LIGHT_PARAM_RADIUS]);
- glLightf(glid, GL_QUADRATIC_ATTENUATION, ld->vars[VS::LIGHT_PARAM_ENERGY]); // wut?
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
-
- Vector3 v(0.0, 0.0, -1.0); // directional lights point up by default
- v = p_instance->transform.get_basis().xform(v);
- v = camera_transform_inverse.get_basis().xform(v);
- v.normalize(); // this sucks, so it will be optimized at some point
- float lightdir[4] = { v.x, v.y, v.z, 1.0 };
- glLightfv(glid, GL_SPOT_DIRECTION, lightdir); //at modelview
-
- v = p_instance->transform.get_origin();
- v = camera_transform_inverse.xform(v);
- float lightpos[4] = { v.x, v.y, v.z, 1.0 };
- glLightfv(glid, GL_POSITION, lightpos); //at modelview
-
- glPopMatrix();
-
- } break;
- default: break;
- }
-};
-
-void RasterizerIPhone::_setup_lights(LightInstance **p_lights, int p_light_count) {
-
- for (int i = 0; i < MAX_LIGHTS; i++) {
-
- if (i < p_light_count) {
- glEnable(GL_LIGHT0 + i);
- _setup_light(p_lights[i], i);
- } else {
- glDisable(GL_LIGHT0 + i);
- }
- }
-}
-
-static const int gl_client_states[] = {
-
- GL_VERTEX_ARRAY,
- GL_NORMAL_ARRAY,
- -1, // ARRAY_TANGENT
- GL_COLOR_ARRAY,
- GL_TEXTURE_COORD_ARRAY, // ARRAY_TEX_UV
- GL_TEXTURE_COORD_ARRAY, // ARRAY_TEX_UV2
- -1, // ARRAY_BONES
- -1, // ARRAY_WEIGHTS
- -1, // ARRAY_INDEX
-};
-
-void RasterizerIPhone::_setup_geometry(const Geometry *p_geometry, const Material *p_material) {
-
- switch (p_geometry->type) {
-
- case Geometry::GEOMETRY_SURFACE: {
-
- Surface *surf = (Surface *)p_geometry;
- uint8_t *base = 0;
- bool use_VBO = (surf->array_local == 0);
-
- if (!use_VBO) {
-
- base = surf->array_local;
- glBindBuffer(GL_ARRAY_BUFFER, 0);
-
- } else {
-
- glBindBuffer(GL_ARRAY_BUFFER, surf->vertex_id);
- };
-
- const Surface::ArrayData *a = surf->array;
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
-
- const Surface::ArrayData &ad = surf->array[i];
- if (ad.size == 0) {
- if (gl_client_states[i] != -1) {
- glDisableClientState(gl_client_states[i]);
- };
- continue; // this one is disabled.
- }
- ERR_CONTINUE(!ad.configured);
-
- if (gl_client_states[i] != -1) {
- glEnableClientState(gl_client_states[i]);
- };
-
- switch (i) {
-
- case VS::ARRAY_VERTEX:
- if (!use_VBO)
- glVertexPointer(3, GL_FLOAT, surf->stride, (GLvoid *)&base[a->ofs]);
- else if (surf->array[VS::ARRAY_BONES].size)
- glVertexPointer(3, GL_FLOAT, 0, skinned_buffer);
- else
- glVertexPointer(3, GL_FLOAT, surf->stride, (GLvoid *)a->ofs);
- break;
-
- case VS::ARRAY_NORMAL:
- if (use_VBO)
- glNormalPointer(GL_FLOAT, surf->stride, (GLvoid *)a->ofs);
- else
- glNormalPointer(GL_FLOAT, surf->stride, (GLvoid *)&base[a->ofs]);
- break;
- case VS::ARRAY_TANGENT:
- break;
- case VS::ARRAY_COLOR:
- if (use_VBO)
- glColorPointer(4, GL_UNSIGNED_BYTE, surf->stride, (GLvoid *)a->ofs);
- else
- glColorPointer(4, GL_UNSIGNED_BYTE, surf->stride, (GLvoid *)&base[a->ofs]);
- break;
- case VS::ARRAY_TEX_UV:
- case VS::ARRAY_TEX_UV2:
- if (use_VBO)
- glTexCoordPointer(2, GL_FLOAT, surf->stride, (GLvoid *)a->ofs);
- else
- glTexCoordPointer(2, GL_FLOAT, surf->stride, &base[a->ofs]);
- break;
- case VS::ARRAY_BONES:
- case VS::ARRAY_WEIGHTS:
- case VS::ARRAY_INDEX:
- break;
- };
- }
-
- // process skeleton here
-
- } break;
-
- default: break;
- };
-};
-
-static const GLenum gl_primitive[] = {
- GL_POINTS,
- GL_LINES,
- GL_LINE_STRIP,
- GL_LINE_LOOP,
- GL_TRIANGLES,
- GL_TRIANGLE_STRIP,
- GL_TRIANGLE_FAN
-};
-
-void RasterizerIPhone::_render(const Geometry *p_geometry, const Material *p_material, const Skeleton *p_skeleton) {
-
- switch (p_geometry->type) {
-
- case Geometry::GEOMETRY_SURFACE: {
-
- Surface *s = (Surface *)p_geometry;
-
- if (s->index_array_len > 0) {
-
- if (s->index_array_local) {
-
- glDrawElements(gl_primitive[s->primitive], s->index_array_len, (s->index_array_len > (1 << 8)) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_BYTE, s->index_array_local);
-
- } else {
-
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->index_id);
- glDrawElements(gl_primitive[s->primitive], s->index_array_len, (s->index_array_len > (1 << 8)) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_BYTE, 0);
- }
-
- } else {
-
- glDrawArrays(gl_primitive[s->primitive], 0, s->array_len);
- };
- } break;
-
- default: break;
- };
-};
-
-void RasterizerIPhone::_render_list_forward(RenderList *p_render_list) {
-
- const Material *prev_material = NULL;
- uint64_t prev_light_hash = 0;
- const Skeleton *prev_skeleton = NULL;
- const Geometry *prev_geometry = NULL;
- const ParamOverrideMap *prev_overrides = NULL; // make it different than NULL
-
- Geometry::Type prev_geometry_type = Geometry::GEOMETRY_INVALID;
-
- glMatrixMode(GL_PROJECTION);
- glLoadMatrixf(&camera_projection.matrix[0][0]);
-
- for (int i = 0; i < p_render_list->element_count; i++) {
-
- RenderList::Element *e = p_render_list->elements[i];
- const Material *material = e->material;
- uint64_t light_hash = e->light_hash;
- const Skeleton *skeleton = e->skeleton;
- const Geometry *geometry = e->geometry;
- const ParamOverrideMap *material_overrides = e->material_overrides;
-
- if (material != prev_material || geometry->type != prev_geometry_type) {
- _setup_material(e->geometry, material);
- //_setup_material_overrides(e->material,NULL,material_overrides);
- //_setup_material_skeleton(material,skeleton);
- } else {
-
- if (material_overrides != prev_overrides) {
-
- //_setup_material_overrides(e->material,prev_overrides,material_overrides);
- }
-
- if (prev_skeleton != skeleton) {
- //_setup_material_skeleton(material,skeleton);
- };
- }
-
- if (geometry != prev_geometry || geometry->type != prev_geometry_type) {
-
- _setup_geometry(geometry, material);
- };
-
- if (i == 0 || light_hash != prev_light_hash)
- _setup_lights(e->lights, e->light_count);
-
- glMatrixMode(GL_MODELVIEW);
- _gl_load_transform(camera_transform_inverse);
- _gl_mult_transform(e->transform);
-
- _render(geometry, material, skeleton);
-
- prev_material = material;
- prev_skeleton = skeleton;
- prev_geometry = geometry;
- prev_light_hash = e->light_hash;
- prev_geometry_type = geometry->type;
- prev_overrides = material_overrides;
- }
-};
-
-void RasterizerIPhone::end_scene() {
-
- glEnable(GL_BLEND);
- glDepthMask(GL_FALSE);
-
- opaque_render_list.sort_mat_light();
- _render_list_forward(&opaque_render_list);
-
- glDisable(GL_BLEND);
- glDepthMask(GL_TRUE);
-
- alpha_render_list.sort_z();
- _render_list_forward(&alpha_render_list);
-}
-void RasterizerIPhone::end_shadow_map() {
-}
-
-void RasterizerIPhone::end_frame() {
-
- //ContextGL::get_singleton()->swap_buffers();
-}
-
-/* CANVAS API */
-
-void RasterizerIPhone::canvas_begin() {
-
- glDisable(GL_CULL_FACE);
- glDisable(GL_DEPTH_TEST);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glLineWidth(1.0);
- glDisable(GL_LIGHTING);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-}
-void RasterizerIPhone::canvas_set_transparency(float p_transparency) {
-}
-
-void RasterizerIPhone::canvas_set_rect(const Rect2 &p_rect, bool p_clip) {
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glScalef(2.0 / window_size.x, -2.0 / window_size.y, 0);
- glTranslatef((-(window_size.x / 2.0)) + p_rect.pos.x, (-(window_size.y / 2.0)) + p_rect.pos.y, 0);
-
- if (p_clip) {
-
- glEnable(GL_SCISSOR_TEST);
- glScissor(viewport.x + p_rect.pos.x, viewport.y + (viewport.height - (p_rect.pos.y + p_rect.size.height)),
- p_rect.size.width, p_rect.size.height);
- } else {
-
- glDisable(GL_SCISSOR_TEST);
- }
-}
-void RasterizerIPhone::canvas_draw_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width) {
-
- glColor4f(1, 1, 1, 1);
-
- float verts[6] = {
- p_from.x, p_from.y, 0,
- p_to.x, p_to.y, 0
- };
-
- float colors[] = {
- p_color.r, p_color.g, p_color.b, p_color.a,
- p_color.r, p_color.g, p_color.b, p_color.a,
- };
- glLineWidth(p_width);
- _draw_primitive(2, verts, 0, colors, 0);
-}
-
-static void _draw_textured_quad(const Rect2 &p_rect, const Rect2 &p_src_region, const Size2 &p_tex_size) {
-
- float texcoords[] = {
- p_src_region.pos.x / p_tex_size.width,
- p_src_region.pos.y / p_tex_size.height,
-
- (p_src_region.pos.x + p_src_region.size.width) / p_tex_size.width,
- p_src_region.pos.y / p_tex_size.height,
-
- (p_src_region.pos.x + p_src_region.size.width) / p_tex_size.width,
- (p_src_region.pos.y + p_src_region.size.height) / p_tex_size.height,
-
- p_src_region.pos.x / p_tex_size.width,
- (p_src_region.pos.y + p_src_region.size.height) / p_tex_size.height,
- };
-
- float coords[] = {
- p_rect.pos.x, p_rect.pos.y, 0,
- p_rect.pos.x + p_rect.size.width, p_rect.pos.y, 0,
- p_rect.pos.x + p_rect.size.width, p_rect.pos.y + p_rect.size.height, 0,
- p_rect.pos.x, p_rect.pos.y + p_rect.size.height, 0
- };
-
- _draw_primitive(4, coords, 0, 0, texcoords);
-}
-
-static void _draw_quad(const Rect2 &p_rect) {
-
- float coords[] = {
- p_rect.pos.x, p_rect.pos.y, 0,
- p_rect.pos.x + p_rect.size.width, p_rect.pos.y, 0,
- p_rect.pos.x + p_rect.size.width, p_rect.pos.y + p_rect.size.height, 0,
- p_rect.pos.x, p_rect.pos.y + p_rect.size.height, 0
- };
-
- _draw_primitive(4, coords, 0, 0, 0);
-}
-
-void RasterizerIPhone::canvas_draw_rect(const Rect2 &p_rect, bool p_region, const Rect2 &p_source, bool p_tile, RID p_texture, const Color &p_modulate) {
-
- glColor4f(p_modulate.r, p_modulate.g, p_modulate.b, p_modulate.a);
-
- if (p_texture.is_valid()) {
-
- glEnable(GL_TEXTURE_2D);
- Texture *texture = texture_owner.get(p_texture);
- ERR_FAIL_COND(!texture);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, texture->tex_id);
-
- if (!p_region) {
-
- Rect2 region = Rect2(0, 0, texture->width, texture->height);
- _draw_textured_quad(p_rect, region, region.size);
-
- } else {
-
- _draw_textured_quad(p_rect, p_source, Size2(texture->width, texture->height));
- }
- } else {
-
- _draw_quad(p_rect);
- }
-}
-void RasterizerIPhone::canvas_draw_style_box(const Rect2 &p_rect, const Rect2 &p_src_region, RID p_texture, const float *p_margin, bool p_draw_center) {
-
- glColor4f(1, 1, 1, 1);
-
- Texture *texture = texture_owner.get(p_texture);
- ERR_FAIL_COND(!texture);
-
- glEnable(GL_TEXTURE_2D);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, texture->tex_id);
-
- Rect2 region = p_src_region;
- if (region.size.width <= 0)
- region.size.width = texture->width;
- if (region.size.height <= 0)
- region.size.height = texture->height;
- /* CORNERS */
- _draw_textured_quad( // top left
- Rect2(p_rect.pos, Size2(p_margin[MARGIN_LEFT], p_margin[MARGIN_TOP])),
- Rect2(region.pos, Size2(p_margin[MARGIN_LEFT], p_margin[MARGIN_TOP])),
- Size2(texture->width, texture->height));
-
- _draw_textured_quad( // top right
- Rect2(Point2(p_rect.pos.x + p_rect.size.width - p_margin[MARGIN_RIGHT], p_rect.pos.y), Size2(p_margin[MARGIN_RIGHT], p_margin[MARGIN_TOP])),
- Rect2(Point2(region.pos.x + region.size.width - p_margin[MARGIN_RIGHT], region.pos.y), Size2(p_margin[MARGIN_RIGHT], p_margin[MARGIN_TOP])),
- Size2(texture->width, texture->height));
-
- _draw_textured_quad( // bottom left
- Rect2(Point2(p_rect.pos.x, p_rect.pos.y + p_rect.size.height - p_margin[MARGIN_BOTTOM]), Size2(p_margin[MARGIN_LEFT], p_margin[MARGIN_BOTTOM])),
- Rect2(Point2(region.pos.x, region.pos.y + region.size.height - p_margin[MARGIN_BOTTOM]), Size2(p_margin[MARGIN_LEFT], p_margin[MARGIN_BOTTOM])),
- Size2(texture->width, texture->height));
-
- _draw_textured_quad( // bottom right
- Rect2(Point2(p_rect.pos.x + p_rect.size.width - p_margin[MARGIN_RIGHT], p_rect.pos.y + p_rect.size.height - p_margin[MARGIN_BOTTOM]), Size2(p_margin[MARGIN_RIGHT], p_margin[MARGIN_BOTTOM])),
- Rect2(Point2(region.pos.x + region.size.width - p_margin[MARGIN_RIGHT], region.pos.y + region.size.height - p_margin[MARGIN_BOTTOM]), Size2(p_margin[MARGIN_RIGHT], p_margin[MARGIN_BOTTOM])),
- Size2(texture->width, texture->height));
-
- Rect2 rect_center(p_rect.pos + Point2(p_margin[MARGIN_LEFT], p_margin[MARGIN_TOP]), Size2(p_rect.size.width - p_margin[MARGIN_LEFT] - p_margin[MARGIN_RIGHT], p_rect.size.height - p_margin[MARGIN_TOP] - p_margin[MARGIN_BOTTOM]));
-
- Rect2 src_center(Point2(region.pos.x + p_margin[MARGIN_LEFT], region.pos.y + p_margin[MARGIN_TOP]), Size2(region.size.width - p_margin[MARGIN_LEFT] - p_margin[MARGIN_RIGHT], region.size.height - p_margin[MARGIN_TOP] - p_margin[MARGIN_BOTTOM]));
-
- _draw_textured_quad( // top
- Rect2(Point2(rect_center.pos.x, p_rect.pos.y), Size2(rect_center.size.width, p_margin[MARGIN_TOP])),
- Rect2(Point2(src_center.pos.x, region.pos.y), Size2(src_center.size.width, p_margin[MARGIN_TOP])),
- Size2(texture->width, texture->height));
-
- _draw_textured_quad( // bottom
- Rect2(Point2(rect_center.pos.x, rect_center.pos.y + rect_center.size.height), Size2(rect_center.size.width, p_margin[MARGIN_BOTTOM])),
- Rect2(Point2(src_center.pos.x, src_center.pos.y + src_center.size.height), Size2(src_center.size.width, p_margin[MARGIN_BOTTOM])),
- Size2(texture->width, texture->height));
-
- _draw_textured_quad( // left
- Rect2(Point2(p_rect.pos.x, rect_center.pos.y), Size2(p_margin[MARGIN_LEFT], rect_center.size.height)),
- Rect2(Point2(region.pos.x, region.pos.y + p_margin[MARGIN_TOP]), Size2(p_margin[MARGIN_LEFT], src_center.size.height)),
- Size2(texture->width, texture->height));
-
- _draw_textured_quad( // right
- Rect2(Point2(rect_center.pos.x + rect_center.size.width, rect_center.pos.y), Size2(p_margin[MARGIN_RIGHT], rect_center.size.height)),
- Rect2(Point2(src_center.pos.x + src_center.size.width, region.pos.y + p_margin[MARGIN_TOP]), Size2(p_margin[MARGIN_RIGHT], src_center.size.height)),
- Size2(texture->width, texture->height));
-
- if (p_draw_center) {
-
- _draw_textured_quad(
- rect_center,
- src_center,
- Size2(texture->width, texture->height));
- }
-}
-void RasterizerIPhone::canvas_draw_primitive(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture) {
-
- ERR_FAIL_COND(p_points.size() < 1);
- float verts[12];
- float uvs[8];
- float colors[16];
-
- glColor4f(1, 1, 1, 1);
-
- int idx = 0;
- for (int i = 0; i < p_points.size(); i++) {
-
- verts[idx++] = p_points[i].x;
- verts[idx++] = p_points[i].y;
- verts[idx++] = 0;
- }
-
- idx = 0;
- for (int i = 0; i < p_uvs.size(); i++) {
-
- uvs[idx++] = p_uvs[i].x;
- uvs[idx++] = p_uvs[i].y;
- }
-
- idx = 0;
- for (int i = 0; i < p_colors.size(); i++) {
-
- colors[idx++] = p_colors[i].r;
- colors[idx++] = p_colors[i].g;
- colors[idx++] = p_colors[i].b;
- colors[idx++] = p_colors[i].a;
- };
-
- if (p_texture.is_valid()) {
- glEnable(GL_TEXTURE_2D);
- Texture *texture = texture_owner.get(p_texture);
- if (texture) {
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, texture->tex_id);
- }
- }
-
- _draw_primitive(p_points.size(), &verts[0], NULL, p_colors.size() ? &colors[0] : NULL, p_uvs.size() ? uvs : NULL);
-}
-
-/* FX */
-
-RID RasterizerIPhone::fx_create() {
-
- return RID();
-}
-void RasterizerIPhone::fx_get_effects(RID p_fx, List<String> *p_effects) const {
-}
-void RasterizerIPhone::fx_set_active(RID p_fx, const String &p_effect, bool p_active) {
-}
-bool RasterizerIPhone::fx_is_active(RID p_fx, const String &p_effect) const {
-
- return false;
-}
-void RasterizerIPhone::fx_get_effect_params(RID p_fx, const String &p_effect, List<PropertyInfo> *p_params) const {
-}
-Variant RasterizerIPhone::fx_get_effect_param(RID p_fx, const String &p_effect, const String &p_param) const {
-
- return Variant();
-}
-void RasterizerIPhone::fx_set_effect_param(RID p_fx, const String &p_effect, const String &p_param, const Variant &p_pvalue) {
-}
-
-/*MISC*/
-
-bool RasterizerIPhone::is_texture(const RID &p_rid) const {
-
- return texture_owner.owns(p_rid);
-}
-bool RasterizerIPhone::is_material(const RID &p_rid) const {
-
- return material_owner.owns(p_rid);
-}
-bool RasterizerIPhone::is_mesh(const RID &p_rid) const {
-
- return mesh_owner.owns(p_rid);
-}
-bool RasterizerIPhone::is_multimesh(const RID &p_rid) const {
-
- return false;
-}
-bool RasterizerIPhone::is_poly(const RID &p_rid) const {
-
- return poly_owner.owns(p_rid);
-}
-bool RasterizerIPhone::is_particles(const RID &p_beam) const {
-
- return false;
-}
-
-bool RasterizerIPhone::is_beam(const RID &p_beam) const {
-
- return false;
-}
-
-bool RasterizerIPhone::is_light(const RID &p_rid) const {
-
- return light_owner.owns(p_rid);
-}
-bool RasterizerIPhone::is_light_instance(const RID &p_rid) const {
-
- return light_instance_owner.owns(p_rid);
-}
-bool RasterizerIPhone::is_particles_instance(const RID &p_rid) const {
-
- return false;
-}
-bool RasterizerIPhone::is_skeleton(const RID &p_rid) const {
-
- return skeleton_owner.owns(p_rid);
-}
-bool RasterizerIPhone::is_fx(const RID &p_rid) const {
-
- return fx_owner.owns(p_rid);
-}
-bool RasterizerIPhone::is_shader(const RID &p_rid) const {
-
- return false;
-}
-
-void RasterizerIPhone::free(const RID &p_rid) const {
-
- if (texture_owner.owns(p_rid)) {
-
- // delete the texture
- Texture *texture = texture_owner.get(p_rid);
-
- glDeleteTextures(1, &texture->tex_id);
-
- texture_owner.free(p_rid);
- memdelete(texture);
-
- } else if (material_owner.owns(p_rid)) {
-
- Material *material = material_owner.get(p_rid);
- ERR_FAIL_COND(!material);
-
- material_owner.free(p_rid);
- memdelete(material);
-
- } else if (mesh_owner.owns(p_rid)) {
-
- Mesh *mesh = mesh_owner.get(p_rid);
- ERR_FAIL_COND(!mesh);
- for (int i = 0; i < mesh->surfaces.size(); i++) {
-
- Surface *surface = mesh->surfaces[i];
- if (surface->array_local != 0) {
- memfree(surface->array_local);
- };
- if (surface->index_array_local != 0) {
- memfree(surface->index_array_local);
- };
-
- if (surface->vertex_id)
- glDeleteBuffers(1, &surface->vertex_id);
- if (surface->index_id)
- glDeleteBuffers(1, &surface->index_id);
-
- memdelete(surface);
- };
-
- mesh->surfaces.clear();
-
- mesh_owner.free(p_rid);
- memdelete(mesh);
-
- } else if (skeleton_owner.owns(p_rid)) {
-
- Skeleton *skeleton = skeleton_owner.get(p_rid);
- ERR_FAIL_COND(!skeleton)
-
- skeleton_owner.free(p_rid);
- memdelete(skeleton);
-
- } else if (light_owner.owns(p_rid)) {
-
- Light *light = light_owner.get(p_rid);
- ERR_FAIL_COND(!light)
-
- light_owner.free(p_rid);
- memdelete(light);
-
- } else if (light_instance_owner.owns(p_rid)) {
-
- LightInstance *light_instance = light_instance_owner.get(p_rid);
- ERR_FAIL_COND(!light_instance);
-
- light_instance_owner.free(p_rid);
- memdelete(light_instance);
-
- } else if (fx_owner.owns(p_rid)) {
-
- FX *fx = fx_owner.get(p_rid);
- ERR_FAIL_COND(!fx);
-
- fx_owner.free(p_rid);
- memdelete(fx);
- };
-}
-
-void RasterizerIPhone::init() {
-
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LEQUAL);
- glFrontFace(GL_CW);
-
- glEnable(GL_TEXTURE_2D);
-}
-
-void RasterizerIPhone::finish() {
-}
-
-int RasterizerIPhone::get_render_info(VS::RenderInfo p_info) {
-
- return false;
-}
-
-RasterizerIPhone::RasterizerIPhone() {
-
- frame = 0;
-};
-
-RasterizerIPhone::~RasterizerIPhone(){
-
-};
-
-#endif
diff --git a/platform/iphone/rasterizer_iphone.h b/platform/iphone/rasterizer_iphone.h
deleted file mode 100644
index 02cb985dc8..0000000000
--- a/platform/iphone/rasterizer_iphone.h
+++ /dev/null
@@ -1,880 +0,0 @@
-/*************************************************************************/
-/* rasterizer_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. */
-/*************************************************************************/
-#ifdef IPHONE_ENABLED
-
-#ifndef RASTERIZER_IPHONE_H
-#define RASTERIZER_IPHONE_H
-
-#include "servers/visual/rasterizer.h"
-
-#include "camera_matrix.h"
-#include "image.h"
-#include "list.h"
-#include "map.h"
-#include "rid.h"
-#include "servers/visual_server.h"
-#include "sort.h"
-#include <ES1/gl.h>
-
-/**
- @author Juan Linietsky <reduzio@gmail.com>
-*/
-class RasterizerIPhone : public Rasterizer {
-
- enum {
- SKINNED_BUFFER_SIZE = 1024 * 128, // 10k vertices
- MAX_LIGHTS = 8,
- };
-
- uint8_t skinned_buffer[SKINNED_BUFFER_SIZE];
-
- struct Texture {
-
- uint32_t flags;
- int width, height;
- Image::Format format;
-
- GLenum target;
- GLenum gl_format_cache;
- int gl_components_cache;
- bool has_alpha;
- bool format_has_alpha;
-
- bool active;
- GLuint tex_id;
- bool mipmap_dirty;
-
- Texture() {
-
- flags = width = height = 0;
- tex_id = 0;
- format = Image::FORMAT_L8;
- gl_components_cache = 0;
- format_has_alpha = false;
- has_alpha = false;
- active = false;
- mipmap_dirty = true;
- }
-
- ~Texture() {
-
- if (tex_id != 0) {
-
- glDeleteTextures(1, &tex_id);
- }
- }
- };
-
- mutable RID_Owner<Texture> texture_owner;
-
- struct Material {
-
- bool flags[VS::MATERIAL_FLAG_MAX];
- Variant parameters[VisualServer::FIXED_MATERIAL_PARAM_MAX];
- RID textures[VisualServer::FIXED_MATERIAL_PARAM_MAX];
-
- Transform uv_transform;
- VS::FixedSpatialMaterialTexCoordMode texcoord_mode[VisualServer::FIXED_MATERIAL_PARAM_MAX];
-
- VS::MaterialBlendMode detail_blend_mode;
-
- VS::FixedSpatialMaterialTexGenMode texgen_mode;
-
- Material() {
-
- flags[VS::MATERIAL_FLAG_VISIBLE] = true;
- flags[VS::MATERIAL_FLAG_DOUBLE_SIDED] = false;
- flags[VS::MATERIAL_FLAG_INVERT_FACES] = false;
- flags[VS::MATERIAL_FLAG_UNSHADED] = false;
- flags[VS::MATERIAL_FLAG_WIREFRAME] = false;
-
- parameters[VS::FIXED_MATERIAL_PARAM_DIFFUSE] = Color(0.8, 0.8, 0.8);
- parameters[VS::FIXED_MATERIAL_PARAM_SPECULAR_EXP] = 12;
-
- for (int i = 0; i < VisualServer::FIXED_MATERIAL_PARAM_MAX; i++) {
- texcoord_mode[i] = VS::FIXED_MATERIAL_TEXCOORD_UV;
- };
- detail_blend_mode = VS::MATERIAL_BLEND_MODE_MIX;
- texgen_mode = VS::FIXED_MATERIAL_TEXGEN_SPHERE;
- }
- };
- mutable RID_Owner<Material> material_owner;
-
- struct Geometry {
-
- enum Type {
- GEOMETRY_INVALID,
- GEOMETRY_SURFACE,
- GEOMETRY_POLY,
- GEOMETRY_PARTICLES,
- GEOMETRY_BEAM,
- GEOMETRY_DETAILER,
- };
-
- Type type;
- RID material;
- bool has_alpha;
- bool material_owned;
-
- Vector3 scale;
- Vector3 uv_scale;
-
- Geometry()
- : scale(1, 1, 1) {
- has_alpha = false;
- material_owned = false;
- }
- virtual ~Geometry(){};
- };
-
- struct GeometryOwner {
-
- virtual ~GeometryOwner() {}
- };
-
- struct Surface : public Geometry {
-
- struct ArrayData {
-
- uint32_t ofs, size;
- bool configured;
- int components;
- ArrayData() {
- ofs = 0;
- size = 0;
- configured = false;
- }
- };
-
- ArrayData array[VS::ARRAY_MAX];
- // support for vertex array objects
- GLuint array_object_id;
- // support for vertex buffer object
- GLuint vertex_id; // 0 means, unconfigured
- GLuint index_id; // 0 means, unconfigured
- // no support for the above, array in localmem.
- uint8_t *array_local;
- uint8_t *index_array_local;
-
- AABB aabb;
-
- int array_len;
- int index_array_len;
-
- VS::PrimitiveType primitive;
-
- uint32_t format;
-
- int stride;
-
- bool active;
-
- Point2 uv_min;
- Point2 uv_max;
-
- bool has_alpha_cache;
-
- Surface() {
-
- array_len = 0;
- type = GEOMETRY_SURFACE;
- primitive = VS::PRIMITIVE_POINTS;
- index_array_len = VS::NO_INDEX_ARRAY;
- format = 0;
- stride = 0;
-
- array_local = index_array_local = 0;
- vertex_id = index_id = 0;
-
- active = false;
- }
-
- ~Surface() {
- }
- };
-
- struct Mesh {
-
- bool active;
- Vector<Surface *> surfaces;
-
- mutable uint64_t last_pass;
- Mesh() {
- last_pass = 0;
- active = false;
- }
- };
- mutable RID_Owner<Mesh> mesh_owner;
-
- struct Poly : public Geometry {
-
- struct Primitive {
-
- Vector<Vector3> vertices;
- Vector<Vector3> normals;
- Vector<Vector3> uvs;
- Vector<Color> colors;
- };
-
- AABB aabb;
- List<Primitive> primitives;
- Poly() {
-
- type = GEOMETRY_POLY;
- }
- };
-
- mutable RID_Owner<Poly> poly_owner;
-
- struct Skeleton {
-
- Vector<Transform> bones;
- };
-
- mutable RID_Owner<Skeleton> skeleton_owner;
-
- struct Light {
-
- VS::LightType type;
- float vars[VS::LIGHT_PARAM_MAX];
- Color colors[3];
- bool shadow_enabled;
- RID projector;
- bool volumetric_enabled;
- Color volumetric_color;
-
- Light() {
-
- vars[VS::LIGHT_PARAM_SPOT_ATTENUATION] = 1;
- vars[VS::LIGHT_PARAM_SPOT_ANGLE] = 45;
- vars[VS::LIGHT_PARAM_ATTENUATION] = 1.0;
- vars[VS::LIGHT_PARAM_ENERGY] = 1.0;
- vars[VS::LIGHT_PARAM_RADIUS] = 1.0;
- colors[VS::LIGHT_COLOR_AMBIENT] = Color(0, 0, 0);
- colors[VS::LIGHT_COLOR_DIFFUSE] = Color(1, 1, 1);
- colors[VS::LIGHT_COLOR_SPECULAR] = Color(1, 1, 1);
- shadow_enabled = false;
- volumetric_enabled = false;
- }
- };
-
- struct ShadowBuffer;
-
- struct LightInstance {
-
- struct SplitInfo {
-
- CameraMatrix camera;
- Transform transform;
- float near;
- float far;
- };
-
- RID light;
- Light *base;
- uint64_t last_pass;
- Transform transform;
-
- CameraMatrix projection;
- Vector<SplitInfo> splits;
-
- Vector3 light_vector;
- Vector3 spot_vector;
- float linear_att;
-
- uint64_t hash_aux;
- };
- mutable RID_Owner<Light> light_owner;
- mutable RID_Owner<LightInstance> light_instance_owner;
-
- LightInstance *light_instances[MAX_LIGHTS];
- int light_instance_count;
-
- struct RenderList {
-
- enum {
- MAX_ELEMENTS = 4096,
- MAX_LIGHTS = 4
- };
-
- struct Element {
-
- float depth;
- const Skeleton *skeleton;
- Transform transform;
- LightInstance *lights[MAX_LIGHTS];
- int light_count;
- const Geometry *geometry;
- const Material *material;
- uint64_t light_hash;
- GeometryOwner *owner;
- const ParamOverrideMap *material_overrides;
- };
-
- Element _elements[MAX_ELEMENTS];
- Element *elements[MAX_ELEMENTS];
- int element_count;
-
- void clear() {
-
- element_count = 0;
- }
-
- struct SortZ {
-
- _FORCE_INLINE_ bool operator()(const Element *A, const Element *B) const {
-
- return A->depth > B->depth;
- }
- };
-
- void sort_z() {
-
- SortArray<Element *, SortZ> sorter;
- sorter.sort(elements, element_count);
- }
-
- struct SortSkel {
-
- _FORCE_INLINE_ bool operator()(const Element *A, const Element *B) const {
-
- if (A->geometry < B->geometry)
- return true;
- else if (A->geometry > B->geometry)
- return false;
- else
- return (!A->skeleton && B->skeleton);
- }
- };
-
- void sort_skel() {
-
- SortArray<Element *, SortSkel> sorter;
- sorter.sort(elements, element_count);
- }
-
- struct SortMat {
-
- _FORCE_INLINE_ bool operator()(const Element *A, const Element *B) const {
-
- if (A->geometry == B->geometry) {
-
- if (A->material == B->material) {
-
- return (A->material_overrides < B->material_overrides);
- } else {
-
- return (A->material < B->material);
- }
- } else {
-
- return (A->geometry < B->geometry);
- }
- }
- };
-
- void sort_mat() {
-
- SortArray<Element *, SortMat> sorter;
- sorter.sort(elements, element_count);
- }
-
- struct SortMatLight {
-
- _FORCE_INLINE_ bool operator()(const Element *A, const Element *B) const {
-
- if (A->geometry == B->geometry) {
-
- if (A->material == B->material) {
-
- if (A->light_hash == B->light_hash)
- return (A->material_overrides < B->material_overrides);
- else
- return A->light_hash < B->light_hash;
- } else {
-
- return (A->material < B->material);
- }
- } else {
-
- return (A->geometry < B->geometry);
- }
- }
- };
-
- void sort_mat_light() {
-
- SortArray<Element *, SortMatLight> sorter;
- sorter.sort(elements, element_count);
- }
-
- struct LISort {
-
- _FORCE_INLINE_ bool operator()(const LightInstance *A, const LightInstance *B) const {
-
- return (A->hash_aux < B->hash_aux);
- }
- };
-
- _FORCE_INLINE_ void add_element(const Geometry *p_geometry, const Material *p_material, const Transform &p_transform, LightInstance **p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides, const Skeleton *p_skeleton, float p_depth, GeometryOwner *p_owner = NULL) {
-
- ERR_FAIL_COND(element_count >= MAX_ELEMENTS);
- Element *e = elements[element_count++];
-
- e->geometry = p_geometry;
- e->material = p_material;
- e->transform = p_transform;
- e->skeleton = p_skeleton;
- e->light_hash = 0;
- e->light_count = p_light_count;
- e->owner = p_owner;
- e->material_overrides = p_material_overrides;
-
- if (e->light_count > 0) {
-
- SortArray<LightInstance *, LISort> light_sort;
- light_sort.sort(p_light_instances, p_light_count);
- //@TODO OPTIOMIZE
-
- for (int i = 0; i < p_light_count; i++) {
-
- e->lights[i] = p_light_instances[i];
-
- if (i == 0)
- e->light_hash = hash_djb2_one_64(make_uint64_t(e->lights[i]));
- else
- e->light_hash = hash_djb2_one_64(make_uint64_t(e->lights[i]), e->light_hash);
- }
- }
- }
-
- RenderList() {
-
- for (int i = 0; i < MAX_ELEMENTS; i++)
- elements[i] = &_elements[i]; // assign elements
- }
- };
-
- RenderList opaque_render_list;
- RenderList alpha_render_list;
-
- RID default_material;
-
- struct FX {
-
- bool bgcolor_active;
- Color bgcolor;
-
- bool skybox_active;
- RID skybox_cubemap;
-
- bool antialias_active;
- float antialias_tolerance;
-
- bool glow_active;
- int glow_passes;
- float glow_attenuation;
- float glow_bloom;
-
- bool ssao_active;
- float ssao_attenuation;
- float ssao_radius;
- float ssao_max_distance;
- float ssao_range_max;
- float ssao_range_min;
- bool ssao_only;
-
- bool fog_active;
- float fog_distance;
- float fog_attenuation;
- Color fog_color_near;
- Color fog_color_far;
- bool fog_bg;
-
- bool toon_active;
- float toon_treshold;
- float toon_soft;
-
- bool edge_active;
- Color edge_color;
- float edge_size;
-
- FX();
- };
- mutable RID_Owner<FX> fx_owner;
-
- FX *scene_fx;
- CameraMatrix camera_projection;
- Transform camera_transform;
- Transform camera_transform_inverse;
- float camera_z_near;
- float camera_z_far;
- Size2 camera_vp_size;
-
- Plane camera_plane;
-
- void _add_geometry(const Geometry *p_geometry, const Transform &p_world, uint32_t p_vertex_format, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides, const Skeleton *p_skeleton, GeometryOwner *p_owner);
- void _render_list_forward(RenderList *p_render_list);
-
- void _setup_light(LightInstance *p_instance, int p_idx);
- void _setup_lights(LightInstance **p_lights, int p_light_count);
- void _setup_material(const Geometry *p_geometry, const Material *p_material);
-
- void _setup_geometry(const Geometry *p_geometry, const Material *p_material);
- void _render(const Geometry *p_geometry, const Material *p_material, const Skeleton *p_skeleton);
-
- /*********/
- /* FRAME */
- /*********/
-
- Size2 window_size;
- VS::ViewportRect viewport;
- Transform canvas_transform;
- double last_time;
- double time_delta;
- uint64_t frame;
-
-public:
- /* TEXTURE API */
-
- virtual RID texture_create();
- virtual void texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT);
- virtual void texture_blit_rect(RID p_texture, int p_x, int p_y, const Image &p_image, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT);
- virtual Image texture_get_rect(RID p_texture, int p_x, int p_y, int p_width, int p_height, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) const;
- virtual void texture_set_flags(RID p_texture, uint32_t p_flags);
- virtual uint32_t texture_get_flags(RID p_texture) const;
- virtual Image::Format texture_get_format(RID p_texture) const;
- virtual uint32_t texture_get_width(RID p_texture) const;
- virtual uint32_t texture_get_height(RID p_texture) const;
- virtual bool texture_has_alpha(RID p_texture) const;
-
- /* SHADER API */
-
- virtual RID shader_create();
-
- virtual void shader_node_add(RID p_shader, VS::ShaderNodeType p_type, int p_id);
- virtual void shader_node_remove(RID p_shader, int p_id);
- virtual void shader_node_change_type(RID p_shader, int p_id, VS::ShaderNodeType p_type);
- virtual void shader_node_set_param(RID p_shader, int p_id, const Variant &p_value);
-
- virtual void shader_get_node_list(RID p_shader, List<int> *p_node_list) const;
- virtual VS::ShaderNodeType shader_node_get_type(RID p_shader, int p_id) const;
- virtual Variant shader_node_get_param(RID p_shader, int p_id) const;
-
- virtual void shader_connect(RID p_shader, int p_src_id, int p_src_slot, int p_dst_id, int p_dst_slot);
- virtual bool shader_is_connected(RID p_shader, int p_src_id, int p_src_slot, int p_dst_id, int p_dst_slot) const;
- virtual void shader_disconnect(RID p_shader, int p_src_id, int p_src_slot, int p_dst_id, int p_dst_slot);
-
- virtual void shader_get_connections(RID p_shader, List<VS::ShaderConnection> *p_connections) const;
-
- virtual void shader_clear(RID p_shader);
-
- /* COMMON MATERIAL API */
-
- virtual void material_set_param(RID p_material, const StringName &p_param, const Variant &p_value);
- virtual Variant material_get_param(RID p_material, const StringName &p_param) const;
- virtual void material_get_param_list(RID p_material, List<String> *p_param_list) const;
-
- virtual void material_set_flag(RID p_material, VS::MaterialFlag p_flag, bool p_enabled);
- virtual bool material_get_flag(RID p_material, VS::MaterialFlag p_flag) const;
-
- virtual void material_set_blend_mode(RID p_material, VS::MaterialBlendMode p_mode);
- virtual VS::MaterialBlendMode material_get_blend_mode(RID p_material) const;
-
- virtual void material_set_line_width(RID p_material, float p_line_width);
- virtual float material_get_line_width(RID p_material) const;
-
- /* FIXED MATERIAL */
-
- virtual RID material_create();
-
- virtual void fixed_material_set_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter, const Variant &p_value);
- virtual Variant fixed_material_get_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const;
-
- virtual void fixed_material_set_texture(RID p_material, VS::FixedSpatialMaterialParam p_parameter, RID p_texture);
- virtual RID fixed_material_get_texture(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const;
-
- virtual void fixed_material_set_detail_blend_mode(RID p_material, VS::MaterialBlendMode p_mode);
- virtual VS::MaterialBlendMode fixed_material_get_detail_blend_mode(RID p_material) const;
-
- virtual void fixed_material_set_texgen_mode(RID p_material, VS::FixedSpatialMaterialTexGenMode p_mode);
- virtual VS::FixedSpatialMaterialTexGenMode fixed_material_get_texgen_mode(RID p_material) const;
-
- virtual void fixed_material_set_texcoord_mode(RID p_material, VS::FixedSpatialMaterialParam p_parameter, VS::FixedSpatialMaterialTexCoordMode p_mode);
- virtual VS::FixedSpatialMaterialTexCoordMode fixed_material_get_texcoord_mode(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const;
-
- virtual void fixed_material_set_uv_transform(RID p_material, const Transform &p_transform);
- virtual Transform fixed_material_get_uv_transform(RID p_material) const;
-
- /* SHADER MATERIAL */
-
- virtual RID shader_material_create() const;
-
- virtual void shader_material_set_vertex_shader(RID p_material, RID p_shader, bool p_owned = false);
- virtual RID shader_material_get_vertex_shader(RID p_material) const;
-
- virtual void shader_material_set_fragment_shader(RID p_material, RID p_shader, bool p_owned = false);
- virtual RID shader_material_get_fragment_shader(RID p_material) const;
-
- /* MESH API */
-
- virtual RID mesh_create();
-
- virtual void mesh_add_surface(RID p_mesh, VS::PrimitiveType p_primitive, uint32_t p_format, int p_array_len, int p_index_array_len = VS::NO_INDEX_ARRAY);
-
- virtual Error mesh_surface_set_array(RID p_mesh, int p_surface, VS::ArrayType p_type, const Variant &p_array);
- virtual Variant mesh_surface_get_array(RID p_mesh, int p_surface, VS::ArrayType p_type) const;
-
- virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material, bool p_owned = false);
- virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const;
-
- virtual int mesh_surface_get_array_len(RID p_mesh, int p_surface) const;
- virtual int mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const;
- virtual uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const;
- virtual VS::PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const;
-
- virtual void mesh_erase_surface(RID p_mesh, int p_index);
- virtual int mesh_get_surface_count(RID p_mesh) const;
-
- virtual AABB mesh_get_aabb(RID p_mesh) const;
-
- /* MULTIMESH API */
-
- virtual RID multimesh_create();
-
- virtual void multimesh_set_instance_count(RID p_multimesh, int p_count);
- virtual int multimesh_get_instance_count(RID p_multimesh) const;
-
- virtual void multimesh_set_mesh(RID p_multimesh, RID p_mesh);
- virtual void multimesh_set_aabb(RID p_multimesh, const AABB &p_aabb);
- virtual void multimesh_instance_set_transform(RID p_multimesh, int p_index, const Transform &p_transform);
- virtual void multimesh_instance_set_color(RID p_multimesh, int p_index, const Color &p_color);
-
- virtual RID multimesh_get_mesh(RID p_multimesh) const;
- virtual AABB multimesh_get_aabb(RID p_multimesh) const;
-
- virtual Transform multimesh_instance_get_transform(RID p_multimesh, int p_index) const;
- virtual Color multimesh_instance_get_color(RID p_multimesh, int p_index) const;
-
- /* POLY API */
-
- virtual RID poly_create();
- virtual void poly_set_material(RID p_poly, RID p_material, bool p_owned = false);
- virtual void poly_add_primitive(RID p_poly, const Vector<Vector3> &p_points, const Vector<Vector3> &p_normals, const Vector<Color> &p_colors, const Vector<Vector3> &p_uvs);
- virtual void poly_clear(RID p_poly);
-
- virtual AABB poly_get_aabb(RID p_poly) const;
-
- /* PARTICLES API */
-
- virtual RID particles_create();
-
- virtual void particles_set_amount(RID p_particles, int p_amount);
- virtual int particles_get_amount(RID p_particles) const;
-
- virtual void particles_set_emitting(RID p_particles, bool p_emitting);
- virtual bool particles_is_emitting(RID p_particles) const;
-
- virtual void particles_set_visibility_aabb(RID p_particles, const AABB &p_visibility);
- virtual AABB particles_get_visibility_aabb(RID p_particles) const;
-
- virtual void particles_set_emission_half_extents(RID p_particles, const Vector3 &p_half_extents);
- virtual Vector3 particles_get_emission_half_extents(RID p_particles) const;
-
- virtual void particles_set_gravity_normal(RID p_particles, const Vector3 &p_normal);
- virtual Vector3 particles_get_gravity_normal(RID p_particles) const;
-
- virtual void particles_set_variable(RID p_particles, VS::ParticleVariable p_variable, float p_value);
- virtual float particles_get_variable(RID p_particles, VS::ParticleVariable p_variable) const;
-
- virtual void particles_set_randomness(RID p_particles, VS::ParticleVariable p_variable, float p_randomness);
- virtual float particles_get_randomness(RID p_particles, VS::ParticleVariable p_variable) const;
-
- virtual void particles_set_color_phase_pos(RID p_particles, int p_phase, float p_pos);
- virtual float particles_get_color_phase_pos(RID p_particles, int p_phase) const;
-
- virtual void particles_set_color_phases(RID p_particles, int p_phases);
- virtual int particles_get_color_phases(RID p_particles) const;
-
- virtual void particles_set_color_phase_color(RID p_particles, int p_phase, const Color &p_color);
- virtual Color particles_get_color_phase_color(RID p_particles, int p_phase) const;
-
- virtual void particles_set_attractors(RID p_particles, int p_attractors);
- virtual int particles_get_attractors(RID p_particles) const;
-
- virtual void particles_set_attractor_pos(RID p_particles, int p_attractor, const Vector3 &p_pos);
- virtual Vector3 particles_get_attractor_pos(RID p_particles, int p_attractor) const;
-
- virtual void particles_set_attractor_strength(RID p_particles, int p_attractor, float p_force);
- virtual float particles_get_attractor_strength(RID p_particles, int p_attractor) const;
-
- virtual void particles_set_material(RID p_particles, RID p_material, bool p_owned = false);
- virtual RID particles_get_material(RID p_particles) const;
-
- virtual AABB particles_get_aabb(RID p_particles) const;
- /* BEAM API */
-
- virtual RID beam_create();
-
- virtual void beam_set_point_count(RID p_beam, int p_count);
- virtual int beam_get_point_count(RID p_beam) const;
- virtual void beam_clear(RID p_beam);
-
- virtual void beam_set_point(RID p_beam, int p_point, Vector3 &p_pos);
- virtual Vector3 beam_get_point(RID p_beam, int p_point) const;
-
- virtual void beam_set_primitive(RID p_beam, VS::BeamPrimitive p_primitive);
- virtual VS::BeamPrimitive beam_get_primitive(RID p_beam) const;
-
- virtual void beam_set_material(RID p_beam, RID p_material);
- virtual RID beam_get_material(RID p_beam) const;
-
- virtual AABB beam_get_aabb(RID p_particles) const;
- /* SKELETON API */
-
- virtual RID skeleton_create();
- virtual void skeleton_resize(RID p_skeleton, int p_bones);
- virtual int skeleton_get_bone_count(RID p_skeleton) const;
- virtual void skeleton_bone_set_transform(RID p_skeleton, int p_bone, const Transform &p_transform);
- virtual Transform skeleton_bone_get_transform(RID p_skeleton, int p_bone);
-
- /* LIGHT API */
-
- virtual RID light_create(VS::LightType p_type);
- virtual VS::LightType light_get_type(RID p_light) const;
-
- virtual void light_set_color(RID p_light, VS::LightColor p_type, const Color &p_color);
- virtual Color light_get_color(RID p_light, VS::LightColor p_type) const;
-
- virtual void light_set_shadow(RID p_light, bool p_enabled);
- virtual bool light_has_shadow(RID p_light) const;
-
- virtual void light_set_volumetric(RID p_light, bool p_enabled);
- virtual bool light_is_volumetric(RID p_light) const;
-
- virtual void light_set_projector(RID p_light, RID p_texture);
- virtual RID light_get_projector(RID p_light) const;
-
- virtual void light_set_var(RID p_light, VS::LightParam p_var, float p_value);
- virtual float light_get_var(RID p_light, VS::LightParam p_var) const;
-
- virtual AABB light_get_aabb(RID p_poly) const;
-
- virtual RID light_instance_create(RID p_light);
- virtual void light_instance_set_transform(RID p_light_instance, const Transform &p_transform);
-
- virtual void light_instance_set_active_hint(RID p_light_instance);
- virtual bool light_instance_has_shadow(RID p_light_instance) const;
- virtual bool light_instance_assign_shadow(RID p_light_instance);
- virtual ShadowType light_instance_get_shadow_type(RID p_light_instance) const;
- virtual int light_instance_get_shadow_passes(RID p_light_instance) const;
- virtual void light_instance_set_pssm_split_info(RID p_light_instance, int p_split, float p_near, float p_far, const CameraMatrix &p_camera, const Transform &p_transform);
-
- /* PARTICLES INSTANCE */
-
- virtual RID particles_instance_create(RID p_particles);
- virtual void particles_instance_set_transform(RID p_particles_instance, const Transform &p_transform);
-
- /* RENDER API */
- /* all calls (inside begin/end shadow) are always warranted to be in the following order: */
-
- virtual void begin_frame();
-
- virtual void set_viewport(const VS::ViewportRect &p_viewport);
-
- virtual void begin_scene(RID p_fx = RID(), VS::ScenarioDebugMode p_debug = VS::SCENARIO_DEBUG_DISABLED);
- virtual void begin_shadow_map(RID p_light_instance, int p_shadow_pass);
-
- virtual void set_camera(const Transform &p_world, const CameraMatrix &p_projection);
-
- virtual void add_light(RID p_light_instance); ///< all "add_light" calls happen before add_geometry calls
-
- typedef Map<StringName, Variant> ParamOverrideMap;
-
- virtual void add_mesh(RID p_mesh, const Transform *p_world, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides = NULL, RID p_skeleton = RID());
- virtual void add_multimesh(RID p_multimesh, const Transform *p_world, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides = NULL);
- virtual void add_poly(RID p_poly, const Transform *p_world, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides = NULL);
- virtual void add_beam(RID p_beam, const Transform *p_world, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides = NULL);
- virtual void add_particles(RID p_particle_instance, const RID *p_light_instances, int p_light_count, const ParamOverrideMap *p_material_overrides = NULL);
-
- virtual void end_scene();
- virtual void end_shadow_map();
-
- virtual void end_frame();
-
- /* CANVAS API */
-
- virtual void canvas_begin();
- virtual void canvas_set_transparency(float p_transparency);
- virtual void canvas_set_rect(const Rect2 &p_rect, bool p_clip);
- virtual void canvas_draw_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width);
- virtual void canvas_draw_rect(const Rect2 &p_rect, bool p_region, const Rect2 &p_source, bool p_tile, RID p_texture, const Color &p_modulate);
- virtual void canvas_draw_style_box(const Rect2 &p_rect, RID p_texture, const float *p_margins, bool p_draw_center = true);
- virtual void canvas_draw_primitive(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture);
-
- /* FX */
-
- virtual RID fx_create();
- virtual void fx_get_effects(RID p_fx, List<String> *p_effects) const;
- virtual void fx_set_active(RID p_fx, const String &p_effect, bool p_active);
- virtual bool fx_is_active(RID p_fx, const String &p_effect) const;
- virtual void fx_get_effect_params(RID p_fx, const String &p_effect, List<PropertyInfo> *p_params) const;
- virtual Variant fx_get_effect_param(RID p_fx, const String &p_effect, const String &p_param) const;
- virtual void fx_set_effect_param(RID p_fx, const String &p_effect, const String &p_param, const Variant &p_pvalue);
-
- /*MISC*/
-
- virtual bool is_texture(const RID &p_rid) const;
- virtual bool is_material(const RID &p_rid) const;
- virtual bool is_mesh(const RID &p_rid) const;
- virtual bool is_multimesh(const RID &p_rid) const;
- virtual bool is_poly(const RID &p_rid) const;
- virtual bool is_particles(const RID &p_beam) const;
- virtual bool is_beam(const RID &p_beam) const;
-
- virtual bool is_light(const RID &p_rid) const;
- virtual bool is_light_instance(const RID &p_rid) const;
- virtual bool is_particles_instance(const RID &p_rid) const;
- virtual bool is_skeleton(const RID &p_rid) const;
- virtual bool is_fx(const RID &p_rid) const;
- virtual bool is_shader(const RID &p_rid) const;
-
- virtual void free(const RID &p_rid) const;
-
- virtual void init();
- virtual void finish();
-
- virtual int get_render_info(VS::RenderInfo p_info);
-
- RasterizerIPhone();
- virtual ~RasterizerIPhone();
-};
-
-#endif
-#endif
diff --git a/platform/iphone/sem_iphone.cpp b/platform/iphone/sem_iphone.cpp
index e74c696607..4614b201a4 100644
--- a/platform/iphone/sem_iphone.cpp
+++ b/platform/iphone/sem_iphone.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/sem_iphone.h b/platform/iphone/sem_iphone.h
index 8a87ab47ca..90db0fb74d 100644
--- a/platform/iphone/sem_iphone.h
+++ b/platform/iphone/sem_iphone.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/view_controller.h b/platform/iphone/view_controller.h
index ca05818040..57ed576c25 100644
--- a/platform/iphone/view_controller.h
+++ b/platform/iphone/view_controller.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm
index 8b3dc7c984..574598e1d3 100644
--- a/platform/iphone/view_controller.mm
+++ b/platform/iphone/view_controller.mm
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,44 +33,43 @@
extern "C" {
-int add_path(int, char**);
-int add_cmdline(int, char**);
+int add_path(int, char **);
+int add_cmdline(int, char **);
-int add_path(int p_argc, char** p_args) {
+int add_path(int p_argc, char **p_args) {
- NSString* str = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_path"];
+ NSString *str = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_path"];
if (!str)
return p_argc;
p_args[p_argc++] = "-path";
[str retain]; // memory leak lol (maybe make it static here and delete it in ViewController destructor? @todo
- p_args[p_argc++] = (char*)[str cString];
+ p_args[p_argc++] = (char *)[str cString];
p_args[p_argc] = NULL;
return p_argc;
};
-int add_cmdline(int p_argc, char** p_args) {
+int add_cmdline(int p_argc, char **p_args) {
- NSArray* arr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_cmdline"];
+ NSArray *arr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_cmdline"];
if (!arr)
return p_argc;
- for (int i=0; i < [arr count]; i++) {
+ for (int i = 0; i < [arr count]; i++) {
- NSString* str = [arr objectAtIndex:i];
+ NSString *str = [arr objectAtIndex:i];
if (!str)
continue;
[str retain]; // @todo delete these at some point
- p_args[p_argc++] = (char*)[str cString];
+ p_args[p_argc++] = (char *)[str cString];
};
p_args[p_argc] = NULL;
return p_argc;
};
-
-};
+}; // extern "C"
@interface ViewController ()
@@ -84,59 +84,58 @@ int add_cmdline(int p_argc, char** p_args) {
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)p_orientation {
- if (/*OSIPhone::get_singleton() == NULL*/TRUE) {
+ if (/*OSIPhone::get_singleton() == NULL*/ TRUE) {
printf("checking on info.plist\n");
- NSArray* arr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"];
- switch(p_orientation) {
+ NSArray *arr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"];
+ switch (p_orientation) {
- case UIInterfaceOrientationLandscapeLeft:
- return [arr indexOfObject:@"UIInterfaceOrientationLandscapeLeft"] != NSNotFound ? YES : NO;
+ case UIInterfaceOrientationLandscapeLeft:
+ return [arr indexOfObject:@"UIInterfaceOrientationLandscapeLeft"] != NSNotFound ? YES : NO;
- case UIInterfaceOrientationLandscapeRight:
- return [arr indexOfObject:@"UIInterfaceOrientationLandscapeRight"] != NSNotFound ? YES : NO;
+ case UIInterfaceOrientationLandscapeRight:
+ return [arr indexOfObject:@"UIInterfaceOrientationLandscapeRight"] != NSNotFound ? YES : NO;
- case UIInterfaceOrientationPortrait:
- return [arr indexOfObject:@"UIInterfaceOrientationPortrait"] != NSNotFound ? YES : NO;
+ case UIInterfaceOrientationPortrait:
+ return [arr indexOfObject:@"UIInterfaceOrientationPortrait"] != NSNotFound ? YES : NO;
- case UIInterfaceOrientationPortraitUpsideDown:
- return [arr indexOfObject:@"UIInterfaceOrientationPortraitUpsideDown"] != NSNotFound ? YES : NO;
+ case UIInterfaceOrientationPortraitUpsideDown:
+ return [arr indexOfObject:@"UIInterfaceOrientationPortraitUpsideDown"] != NSNotFound ? YES : NO;
- default:
- return NO;
+ default:
+ return NO;
}
};
uint8_t supported = OSIPhone::get_singleton()->get_orientations();
- switch(p_orientation) {
+ switch (p_orientation) {
- case UIInterfaceOrientationLandscapeLeft:
- return supported & (1<<OSIPhone::LandscapeLeft) ? YES : NO;
+ case UIInterfaceOrientationLandscapeLeft:
+ return supported & (1 << OSIPhone::LandscapeLeft) ? YES : NO;
- case UIInterfaceOrientationLandscapeRight:
- return supported & (1<<OSIPhone::LandscapeRight) ? YES : NO;
+ case UIInterfaceOrientationLandscapeRight:
+ return supported & (1 << OSIPhone::LandscapeRight) ? YES : NO;
- case UIInterfaceOrientationPortrait:
- return supported & (1<<OSIPhone::PortraitDown) ? YES : NO;
+ case UIInterfaceOrientationPortrait:
+ return supported & (1 << OSIPhone::PortraitDown) ? YES : NO;
- case UIInterfaceOrientationPortraitUpsideDown:
- return supported & (1<<OSIPhone::PortraitUp) ? YES : NO;
+ case UIInterfaceOrientationPortraitUpsideDown:
+ return supported & (1 << OSIPhone::PortraitUp) ? YES : NO;
- default:
- return NO;
+ default:
+ return NO;
}
};
-- (BOOL)prefersStatusBarHidden
-{
+- (BOOL)prefersStatusBarHidden {
return YES;
}
#ifdef GAME_CENTER_ENABLED
-- (void) gameCenterViewControllerDidFinish:(GKGameCenterViewController*) gameCenterViewController {
- //[gameCenterViewController dismissViewControllerAnimated:YES completion:^{GameCenter::get_singleton()->game_center_closed();}];//version for signaling when overlay is completely gone
- GameCenter::get_singleton()->game_center_closed();
- [gameCenterViewController dismissViewControllerAnimated:YES completion:nil];
+- (void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController {
+ //[gameCenterViewController dismissViewControllerAnimated:YES completion:^{GameCenter::get_singleton()->game_center_closed();}];//version for signaling when overlay is completely gone
+ GameCenter::get_singleton()->game_center_closed();
+ [gameCenterViewController dismissViewControllerAnimated:YES completion:nil];
}
#endif
diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub
index 02ff2090f9..b804863ee1 100644
--- a/platform/javascript/SCsub
+++ b/platform/javascript/SCsub
@@ -19,29 +19,34 @@ javascript_objects = []
for x in javascript_files:
javascript_objects.append(env_javascript.Object(x))
-env.Append(LINKFLAGS=["-s", "EXPORTED_FUNCTIONS=\"['_main','_audio_server_mix_function','_main_after_fs_sync']\""])
+env.Append(LINKFLAGS=["-s", "EXPORTED_FUNCTIONS=\"['_main','_audio_server_mix_function','_main_after_fs_sync','_send_notification']\""])
env.Append(LINKFLAGS=["--shell-file", '"platform/javascript/godot_shell.html"'])
-html_file = env.Program('#bin/godot', javascript_objects, PROGSUFFIX=env["PROGSUFFIX"] + ".html")[0]
+# output file name without file extension
+basename = "godot" + env["PROGSUFFIX"]
+target_dir = env.Dir("#bin")
+js_file = target_dir.File(basename + ".js")
+implicit_targets = [js_file]
+
+zip_dir = target_dir.Dir('.javascript_zip')
+zip_files = env.InstallAs([zip_dir.File("godot.js"), zip_dir.File("godotfs.js")], [js_file, "#misc/dist/html_fs/godotfs.js"])
+
+if env['wasm'] == 'yes':
+ wasm_file = target_dir.File(basename+'.wasm')
+ implicit_targets.append(wasm_file)
+ zip_files.append(InstallAs(zip_dir.File('godot.wasm'), wasm_file))
+else:
+ asmjs_files = [target_dir.File(basename+'.asm.js'), target_dir.File(basename+'.html.mem')]
+ zip_files.append(InstallAs([zip_dir.File('godot.asm.js'), zip_dir.File('godot.mem')], asmjs_files))
+ implicit_targets.extend(asmjs_files)
+
+# HTML file must be the first target in the list
+html_file = env.Program(["#bin/godot"] + implicit_targets, 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)
+zip_files.append(InstallAs(zip_dir.File('godot.html'), fixup_html))
+Zip('#bin/godot', zip_files, ZIPSUFFIX=env['PROGSUFFIX']+env['ZIPSUFFIX'], ZIPROOT=zip_dir, ZIPCOMSTR="Archving $SOURCES as $TARGET")
diff --git a/platform/javascript/audio_driver_javascript.cpp b/platform/javascript/audio_driver_javascript.cpp
index 80bc7047ae..3e37ec293e 100644
--- a/platform/javascript/audio_driver_javascript.cpp
+++ b/platform/javascript/audio_driver_javascript.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/javascript/audio_driver_javascript.h b/platform/javascript/audio_driver_javascript.h
index ca5dba7e5c..7ccaff0f43 100644
--- a/platform/javascript/audio_driver_javascript.h
+++ b/platform/javascript/audio_driver_javascript.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/javascript/audio_server_javascript.cpp b/platform/javascript/audio_server_javascript.cpp
index 7dfd562402..f9b7890e12 100644
--- a/platform/javascript/audio_server_javascript.cpp
+++ b/platform/javascript/audio_server_javascript.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/javascript/audio_server_javascript.h b/platform/javascript/audio_server_javascript.h
index 2f48e7e79e..58c240f793 100644
--- a/platform/javascript/audio_server_javascript.h
+++ b/platform/javascript/audio_server_javascript.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index f82eae9ff2..68c8d1eea5 100644
--- a/platform/javascript/detect.py
+++ b/platform/javascript/detect.py
@@ -1,6 +1,6 @@
import os
-import sys
import string
+import sys
def is_active():
@@ -12,7 +12,8 @@ def get_name():
def can_build():
- return os.environ.has_key("EMSCRIPTEN_ROOT")
+
+ return (os.environ.has_key("EMSCRIPTEN_ROOT"))
def get_opts():
@@ -27,12 +28,12 @@ def get_flags():
return [
('tools', 'no'),
- ('module_etc1_enabled', 'no'),
('module_theora_enabled', 'no'),
]
def create(env):
+
# remove Windows' .exe suffix
return env.Clone(tools=['textfile', 'zip'], PROGSUFFIX='')
@@ -45,10 +46,26 @@ def escape_target_backslashes(target, source, env, for_signature):
def configure(env):
- env['ENV'] = os.environ
- env.Append(CPPPATH=['#platform/javascript'])
+ ## Build type
+ if (env["target"] == "release"):
+ env.Append(CCFLAGS=['-O3'])
+ env.Append(LINKFLAGS=['-O3'])
+
+ elif (env["target"] == "release_debug"):
+ env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED'])
+ env.Append(LINKFLAGS=['-O2', '-s', 'ASSERTIONS=1'])
+ # retain function names at the cost of file size, for backtraces and profiling
+ env.Append(LINKFLAGS=['--profiling-funcs'])
+
+ elif (env["target"] == "debug"):
+ env.Append(CCFLAGS=['-O1', '-D_DEBUG', '-g', '-DDEBUG_ENABLED'])
+ env.Append(LINKFLAGS=['-O1', '-g'])
+
+ ## Compiler configuration
+
+ env['ENV'] = os.environ
env.PrependENVPath('PATH', os.environ['EMSCRIPTEN_ROOT'])
env['CC'] = 'emcc'
env['CXX'] = 'em++'
@@ -57,6 +74,7 @@ def configure(env):
# 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
@@ -68,26 +86,20 @@ def configure(env):
env['OBJSUFFIX'] = '.bc'
env['LIBSUFFIX'] = '.bc'
- if (env["target"] == "release"):
- env.Append(CCFLAGS=['-O3'])
- env.Append(LINKFLAGS=['-O3'])
- elif (env["target"] == "release_debug"):
- env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED'])
- env.Append(LINKFLAGS=['-O2'])
- # retain function names at the cost of file size, for backtraces and profiling
- env.Append(LINKFLAGS=['--profiling-funcs'])
- elif (env["target"] == "debug"):
- env.Append(CCFLAGS=['-O1', '-D_DEBUG', '-Wall', '-g', '-DDEBUG_ENABLED'])
- env.Append(LINKFLAGS=['-O1', '-g'])
+ ## Compile flags
- # TODO: Move that to opus module's config
- if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"):
- env.opus_fixed_point = "yes"
+ env.Append(CPPPATH=['#platform/javascript'])
+ env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DTYPED_METHOD_BIND', '-DNO_THREADS'])
+ env.Append(CPPFLAGS=['-DGLES3_ENABLED'])
# These flags help keep the file size down
env.Append(CPPFLAGS=["-fno-exceptions", '-DNO_SAFE_CAST', '-fno-rtti'])
- env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DTYPED_METHOD_BIND', '-DNO_THREADS'])
- env.Append(CPPFLAGS=['-DGLES3_ENABLED'])
+
+ if env['javascript_eval'] == 'yes':
+ env.Append(CPPFLAGS=['-DJAVASCRIPT_EVAL_ENABLED'])
+
+ ## Link flags
+
env.Append(LINKFLAGS=['-s', 'USE_WEBGL2=1'])
if (env['wasm'] == 'yes'):
@@ -101,8 +113,6 @@ def configure(env):
env.Append(LINKFLAGS=['-s', 'ASM_JS=1'])
env.Append(LINKFLAGS=['--separate-asm'])
- if env['javascript_eval'] == 'yes':
- env.Append(CPPFLAGS=['-DJAVASCRIPT_EVAL_ENABLED'])
-
-
- import methods
+ # TODO: Move that to opus module's config
+ if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"):
+ env.opus_fixed_point = "yes"
diff --git a/platform/javascript/dom_keys.h b/platform/javascript/dom_keys.h
index 53a2705577..4b8b764c45 100644
--- a/platform/javascript/dom_keys.h
+++ b/platform/javascript/dom_keys.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -248,7 +249,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_RETURN:
case DOM_VK_ENTER: // unused according to MDN
- return KEY_RETURN;
+ return KEY_ENTER;
case DOM_VK_SHIFT: return KEY_SHIFT;
case DOM_VK_CONTROL: return KEY_CONTROL;
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index 4fdb6f39c8..b436d52363 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,399 +27,354 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "export.h"
-#include "editor/editor_export.h"
#include "editor/editor_node.h"
-#include "editor/editor_settings.h"
-#include "global_config.h"
-#include "io/marshalls.h"
+#include "editor_export.h"
#include "io/zip_io.h"
-#include "os/file_access.h"
-#include "os/os.h"
-#include "platform/javascript/logo.h"
-#include "string.h"
-#include "version.h"
+#include "platform/javascript/logo.gen.h"
+#include "platform/javascript/run_icon.gen.h"
+
+#define EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE "webassembly_release.zip"
+#define EXPORT_TEMPLATE_WEBASSEMBLY_DEBUG "webassembly_debug.zip"
+#define EXPORT_TEMPLATE_ASMJS_RELEASE "javascript_release.zip"
+#define EXPORT_TEMPLATE_ASMJS_DEBUG "javascript_debug.zip"
-#if 0
class EditorExportPlatformJavaScript : public EditorExportPlatform {
- GDCLASS( EditorExportPlatformJavaScript,EditorExportPlatform );
+ GDCLASS(EditorExportPlatformJavaScript, EditorExportPlatform)
+
+ Ref<ImageTexture> logo;
+ Ref<ImageTexture> run_icon;
+ bool runnable_when_last_polled;
- String custom_release_package;
- String custom_debug_package;
+ void _fix_html(Vector<uint8_t> &p_html, const Ref<EditorExportPreset> &p_preset, const String &p_name, bool p_debug);
+ void _fix_fsloader_js(Vector<uint8_t> &p_js, const String &p_pack_name, uint64_t p_pack_size);
- enum PackMode {
- PACK_SINGLE_FILE,
- PACK_MULTIPLE_FILES
+public:
+ enum Target {
+ TARGET_WEBASSEMBLY,
+ TARGET_ASMJS
};
- void _fix_html(Vector<uint8_t>& p_html, const String& p_name, bool p_debug);
+ virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features);
- PackMode pack_mode;
+ virtual void get_export_options(List<ExportOption> *r_options);
+ virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const;
- bool show_run;
+ virtual String get_name() const;
+ virtual String get_os_name() const;
+ virtual Ref<Texture> get_logo() const;
- int max_memory;
- int version_code;
+ 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);
- String html_title;
- String html_head_include;
- String html_font_family;
- String html_style_include;
- bool html_controls_enabled;
+ virtual bool poll_devices();
+ virtual int get_device_count() const;
+ virtual String get_device_name(int p_device) const { return TTR("Run in Browser"); }
+ virtual String get_device_info(int p_device) const { return TTR("Run exported HTML in the system's default browser."); }
+ virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags);
+ virtual Ref<Texture> get_run_icon() const;
- Ref<ImageTexture> logo;
+ virtual void get_platform_features(List<String> *r_features) {
-protected:
+ r_features->push_back("web");
+ r_features->push_back("JavaScript");
+ }
- 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;
+ EditorExportPlatformJavaScript();
+};
-public:
+void EditorExportPlatformJavaScript::_fix_html(Vector<uint8_t> &p_html, const Ref<EditorExportPreset> &p_preset, const String &p_name, bool p_debug) {
- virtual String get_name() const { return "HTML5"; }
- virtual ImageCompression get_image_compression() const { return IMAGE_COMPRESSION_BC; }
- virtual Ref<Texture> get_logo() const { return logo; }
+ String str_template = String::utf8(reinterpret_cast<const char *>(p_html.ptr()), p_html.size());
+ String str_export;
+ Vector<String> lines = str_template.split("\n");
+ int memory_mb;
+ if (p_preset->get("options/target").operator int() != TARGET_ASMJS)
+ // WebAssembly allows memory growth, so start with a reasonable default
+ memory_mb = 1 << 4;
+ else
+ memory_mb = 1 << (p_preset->get("options/memory_size").operator int() + 5);
- virtual bool poll_devices() { return show_run?true:false;}
- virtual int get_device_count() const { return show_run?1:0; };
- virtual String get_device_name(int p_device) const { return "Run in Browser"; }
- virtual String get_device_info(int p_device) const { return "Run exported HTML in the system's default browser."; }
- virtual Error run(int p_device,int p_flags=0);
+ for (int i = 0; i < lines.size(); i++) {
- virtual bool requires_password(bool p_debug) const { return false; }
- virtual String get_binary_extension() const { return "html"; }
- virtual Error export_project(const String& p_path,bool p_debug,int p_flags=0);
+ String current_line = lines[i];
+ current_line = current_line.replace("$GODOT_TMEM", itos(memory_mb * 1024 * 1024));
+ current_line = current_line.replace("$GODOT_BASE", p_name);
+ current_line = current_line.replace("$GODOT_HEAD_INCLUDE", p_preset->get("html/head_include"));
+ current_line = current_line.replace("$GODOT_DEBUG_ENABLED", p_debug ? "true" : "false");
+ str_export += current_line + "\n";
+ }
- virtual bool can_export(String *r_error=NULL) const;
+ CharString cs = str_export.utf8();
+ p_html.resize(cs.length());
+ for (int i = 0; i < cs.length(); i++) {
+ p_html[i] = cs[i];
+ }
+}
- EditorExportPlatformJavaScript();
- ~EditorExportPlatformJavaScript();
-};
+void EditorExportPlatformJavaScript::_fix_fsloader_js(Vector<uint8_t> &p_js, const String &p_pack_name, uint64_t p_pack_size) {
-bool EditorExportPlatformJavaScript::_set(const StringName& p_name, const Variant& p_value) {
-
- String n=p_name;
-
- if (n=="custom_package/debug")
- custom_debug_package=p_value;
- else if (n=="custom_package/release")
- custom_release_package=p_value;
- else if (n=="browser/enable_run")
- show_run=p_value;
- else if (n=="options/memory_size")
- max_memory=p_value;
- else if (n=="html/title")
- html_title=p_value;
- else if (n=="html/head_include")
- html_head_include=p_value;
- else if (n=="html/font_family")
- html_font_family=p_value;
- else if (n=="html/style_include")
- html_style_include=p_value;
- else if (n=="html/controls_enabled")
- html_controls_enabled=p_value;
- else
- return false;
+ String str_template = String::utf8(reinterpret_cast<const char *>(p_js.ptr()), p_js.size());
+ String str_export;
+ Vector<String> lines = str_template.split("\n");
+ for (int i = 0; i < lines.size(); i++) {
+ if (lines[i].find("$GODOT_PACK_NAME") != -1) {
+ str_export += lines[i].replace("$GODOT_PACK_NAME", p_pack_name);
+ } else if (lines[i].find("$GODOT_PACK_SIZE") != -1) {
+ str_export += lines[i].replace("$GODOT_PACK_SIZE", itos(p_pack_size));
+ } else {
+ str_export += lines[i] + "\n";
+ }
+ }
- return true;
+ CharString cs = str_export.utf8();
+ p_js.resize(cs.length());
+ for (int i = 0; i < cs.length(); i++) {
+ p_js[i] = cs[i];
+ }
}
-bool EditorExportPlatformJavaScript::_get(const StringName& p_name,Variant &r_ret) const{
-
- String n=p_name;
-
- if (n=="custom_package/debug")
- r_ret=custom_debug_package;
- else if (n=="custom_package/release")
- r_ret=custom_release_package;
- else if (n=="browser/enable_run")
- r_ret=show_run;
- else if (n=="options/memory_size")
- r_ret=max_memory;
- else if (n=="html/title")
- r_ret=html_title;
- else if (n=="html/head_include")
- r_ret=html_head_include;
- else if (n=="html/font_family")
- r_ret=html_font_family;
- else if (n=="html/style_include")
- r_ret=html_style_include;
- else if (n=="html/controls_enabled")
- r_ret=html_controls_enabled;
- else
- return false;
+void EditorExportPlatformJavaScript::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) {
- return true;
+ 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 EditorExportPlatformJavaScript::_get_property_list( List<PropertyInfo> *p_list) const{
- p_list->push_back( PropertyInfo( Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE,"zip"));
- p_list->push_back( PropertyInfo( Variant::STRING, "custom_package/release", PROPERTY_HINT_GLOBAL_FILE,"zip"));
- p_list->push_back( PropertyInfo( Variant::INT, "options/memory_size",PROPERTY_HINT_ENUM,"32mb,64mb,128mb,256mb,512mb,1024mb"));
- p_list->push_back( PropertyInfo( Variant::BOOL, "browser/enable_run"));
- p_list->push_back( PropertyInfo( Variant::STRING, "html/title"));
- p_list->push_back( PropertyInfo( Variant::STRING, "html/head_include",PROPERTY_HINT_MULTILINE_TEXT));
- p_list->push_back( PropertyInfo( Variant::STRING, "html/font_family"));
- p_list->push_back( PropertyInfo( Variant::STRING, "html/style_include",PROPERTY_HINT_MULTILINE_TEXT));
- p_list->push_back( PropertyInfo( Variant::BOOL, "html/controls_enabled"));
+void EditorExportPlatformJavaScript::get_export_options(List<ExportOption> *r_options) {
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "options/target", PROPERTY_HINT_ENUM, "WebAssembly,asm.js"), TARGET_WEBASSEMBLY));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "options/memory_size", PROPERTY_HINT_ENUM, "32 MB,64 MB,128 MB,256 MB,512 MB,1 GB"), 3));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc"), true));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "html/head_include", PROPERTY_HINT_MULTILINE_TEXT), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/debug", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
+}
- //p_list->push_back( PropertyInfo( Variant::INT, "resources/pack_mode", PROPERTY_HINT_ENUM,"Copy,Single Exec.,Pack (.pck),Bundles (Optical)"));
+bool EditorExportPlatformJavaScript::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const {
+ if (p_option == "options/memory_size") {
+ return p_options["options/target"].operator int() == TARGET_ASMJS;
+ }
+ return true;
}
+String EditorExportPlatformJavaScript::get_name() const {
-void EditorExportPlatformJavaScript::_fix_html(Vector<uint8_t>& p_html, const String& p_name, bool p_debug) {
+ return "HTML5";
+}
+String EditorExportPlatformJavaScript::get_os_name() const {
- String str;
- String strnew;
- str.parse_utf8((const char*)p_html.ptr(),p_html.size());
- Vector<String> lines=str.split("\n");
- for(int i=0;i<lines.size();i++) {
+ return "JavaScript";
+}
- String current_line = lines[i];
- current_line = current_line.replace("$GODOT_TMEM",itos((1<<(max_memory+5))*1024*1024));
- current_line = current_line.replace("$GODOT_BASE",p_name);
- current_line = current_line.replace("$GODOT_CANVAS_WIDTH",GlobalConfig::get_singleton()->get("display/window/width"));
- current_line = current_line.replace("$GODOT_CANVAS_HEIGHT",GlobalConfig::get_singleton()->get("display/window/height"));
- current_line = current_line.replace("$GODOT_HEAD_TITLE",!html_title.empty()?html_title:(String) GlobalConfig::get_singleton()->get("application/name"));
- current_line = current_line.replace("$GODOT_HEAD_INCLUDE",html_head_include);
- current_line = current_line.replace("$GODOT_STYLE_FONT_FAMILY",html_font_family);
- current_line = current_line.replace("$GODOT_STYLE_INCLUDE",html_style_include);
- current_line = current_line.replace("$GODOT_CONTROLS_ENABLED",html_controls_enabled?"true":"false");
- current_line = current_line.replace("$GODOT_DEBUG_ENABLED",p_debug?"true":"false");
- strnew += current_line+"\n";
- }
+Ref<Texture> EditorExportPlatformJavaScript::get_logo() const {
- CharString cs = strnew.utf8();
- p_html.resize(cs.length());
- for(int i=9;i<cs.length();i++) {
- p_html[i]=cs[i];
- }
+ return logo;
}
-static void _fix_files(Vector<uint8_t>& html,uint64_t p_data_size) {
+bool EditorExportPlatformJavaScript::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
+ r_missing_templates = false;
- String str;
- String strnew;
- str.parse_utf8((const char*)html.ptr(),html.size());
- Vector<String> lines=str.split("\n");
- for(int i=0;i<lines.size();i++) {
- if (lines[i].find("$DPLEN")!=-1) {
- strnew+=lines[i].replace("$DPLEN",itos(p_data_size));
- } else {
- strnew+=lines[i]+"\n";
- }
- }
-
- CharString cs = strnew.utf8();
- html.resize(cs.length());
- for(int i=9;i<cs.length();i++) {
- html[i]=cs[i];
+ if (p_preset->get("options/target").operator int() == TARGET_WEBASSEMBLY) {
+ if (find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE) == String())
+ r_missing_templates = true;
+ else if (find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_DEBUG) == String())
+ r_missing_templates = true;
+ } else {
+ if (find_export_template(EXPORT_TEMPLATE_ASMJS_RELEASE) == String())
+ r_missing_templates = true;
+ else if (find_export_template(EXPORT_TEMPLATE_ASMJS_DEBUG) == String())
+ r_missing_templates = true;
}
+ return !r_missing_templates;
}
-struct JSExportData {
-
- EditorProgress *ep;
- FileAccess *f;
-
-};
-
+String EditorExportPlatformJavaScript::get_binary_extension() const {
+ return "html";
+}
-Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool p_debug, int p_flags) {
+Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
+ String custom_debug = p_preset->get("custom_template/debug");
+ String custom_release = p_preset->get("custom_template/release");
- String src_template;
+ String template_path = p_debug ? custom_debug : custom_release;
- EditorProgress ep("export","Exporting for javascript",104);
+ template_path = template_path.strip_edges();
- if (p_debug)
- src_template=custom_debug_package;
- else
- src_template=custom_release_package;
+ if (template_path == String()) {
- if (src_template=="") {
- String err;
- if (p_debug) {
- src_template=find_export_template("javascript_debug.zip", &err);
+ if (p_preset->get("options/target").operator int() == TARGET_WEBASSEMBLY) {
+ if (p_debug)
+ template_path = find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_DEBUG);
+ else
+ template_path = find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE);
} else {
- src_template=find_export_template("javascript_release.zip", &err);
- }
- if (src_template=="") {
- EditorNode::add_io_error(err);
- return ERR_FILE_NOT_FOUND;
+ if (p_debug)
+ template_path = find_export_template(EXPORT_TEMPLATE_ASMJS_DEBUG);
+ else
+ template_path = find_export_template(EXPORT_TEMPLATE_ASMJS_RELEASE);
}
}
- FileAccess *src_f=NULL;
- zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
-
- ep.step("Exporting to HTML5",0);
+ if (template_path != String() && !FileAccess::exists(template_path)) {
+ EditorNode::get_singleton()->show_warning(TTR("Template file not found:\n") + template_path);
+ return ERR_FILE_NOT_FOUND;
+ }
- ep.step("Finding Files..",1);
+ String pck_path = p_path.get_basename() + ".pck";
+ Error error = save_pack(p_preset, pck_path);
+ if (error != OK) {
+ EditorNode::get_singleton()->show_warning(TTR("Could not write file:\n") + pck_path);
+ return error;
+ }
- FileAccess *f=FileAccess::open(p_path.get_base_dir()+"/data.pck",FileAccess::WRITE);
+ FileAccess *f = FileAccess::open(pck_path, FileAccess::READ);
if (!f) {
- EditorNode::add_io_error("Could not create file for writing:\n"+p_path.get_basename()+"_files.js");
- return ERR_FILE_CANT_WRITE;
+ EditorNode::get_singleton()->show_warning(TTR("Could not read file:\n") + pck_path);
+ return ERR_FILE_CANT_READ;
}
- Error err = save_pack(f);
- size_t len = f->get_len();
+ size_t pack_size = f->get_len();
memdelete(f);
- if (err)
- return err;
+ FileAccess *src_f = NULL;
+ zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
+ unzFile pkg = unzOpen2(template_path.utf8().get_data(), &io);
- unzFile pkg = unzOpen2(src_template.utf8().get_data(), &io);
if (!pkg) {
- EditorNode::add_io_error("Could not find template HTML5 to export:\n"+src_template);
+ EditorNode::get_singleton()->show_warning(TTR("Could not open template for export:\n") + template_path);
return ERR_FILE_NOT_FOUND;
}
- ERR_FAIL_COND_V(!pkg, ERR_CANT_OPEN);
int ret = unzGoToFirstFile(pkg);
-
-
- while(ret==UNZ_OK) {
+ while (ret == UNZ_OK) {
//get filename
unz_file_info info;
char fname[16384];
- ret = unzGetCurrentFileInfo(pkg,&info,fname,16384,NULL,0,NULL,0);
+ ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
- String file=fname;
+ String file = fname;
Vector<uint8_t> data;
data.resize(info.uncompressed_size);
//read
unzOpenCurrentFile(pkg);
- unzReadCurrentFile(pkg,data.ptr(),data.size());
+ unzReadCurrentFile(pkg, data.ptr(), data.size());
unzCloseCurrentFile(pkg);
//write
- if (file=="godot.html") {
+ if (file == "godot.html") {
- _fix_html(data,p_path.get_file().get_basename(), p_debug);
- file=p_path.get_file();
- }
- if (file=="godotfs.js") {
-
- _fix_files(data,len);
- file=p_path.get_file().get_basename()+"fs.js";
- }
- if (file=="godot.js") {
+ _fix_html(data, p_preset, p_path.get_file().get_basename(), p_debug);
+ file = p_path.get_file();
+ } else if (file == "godotfs.js") {
- file=p_path.get_file().get_basename()+".js";
- }
+ _fix_fsloader_js(data, pck_path.get_file(), pack_size);
+ file = p_path.get_file().get_basename() + "fs.js";
+ } else if (file == "godot.js") {
- if (file=="godot.asm.js") {
+ file = p_path.get_file().get_basename() + ".js";
+ } else if (file == "godot.wasm") {
- file=p_path.get_file().get_basename()+".asm.js";
- }
+ file = p_path.get_file().get_basename() + ".wasm";
+ } else if (file == "godot.asm.js") {
- if (file=="godot.mem") {
+ file = p_path.get_file().get_basename() + ".asm.js";
+ } else if (file == "godot.mem") {
- file=p_path.get_file().get_basename()+".mem";
- }
-
- if (file=="godot.wasm") {
-
- file=p_path.get_file().get_basename()+".wasm";
+ file = p_path.get_file().get_basename() + ".mem";
}
String dst = p_path.get_base_dir().plus_file(file);
- FileAccess *f=FileAccess::open(dst,FileAccess::WRITE);
+ FileAccess *f = FileAccess::open(dst, FileAccess::WRITE);
if (!f) {
- EditorNode::add_io_error("Could not create file for writing:\n"+dst);
+ EditorNode::get_singleton()->show_warning(TTR("Could not write file:\n") + dst);
unzClose(pkg);
return ERR_FILE_CANT_WRITE;
}
- f->store_buffer(data.ptr(),data.size());
+ f->store_buffer(data.ptr(), data.size());
memdelete(f);
-
ret = unzGoToNextFile(pkg);
}
-
-
return OK;
-
}
+bool EditorExportPlatformJavaScript::poll_devices() {
-Error EditorExportPlatformJavaScript::run(int p_device, int p_flags) {
+ Ref<EditorExportPreset> preset;
- String path = EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmp_export.html";
- Error err = export_project(path,true,p_flags);
- if (err)
- return err;
+ for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); i++) {
- OS::get_singleton()->shell_open(path);
+ Ref<EditorExportPreset> ep = EditorExport::get_singleton()->get_export_preset(i);
+ if (ep->is_runnable() && ep->get_platform() == this) {
+ preset = ep;
+ break;
+ }
+ }
- return OK;
+ bool prev = runnable_when_last_polled;
+ runnable_when_last_polled = preset.is_valid();
+ return runnable_when_last_polled != prev;
}
+int EditorExportPlatformJavaScript::get_device_count() const {
-EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() {
-
- show_run=false;
- Image img( _javascript_logo );
- logo = Ref<ImageTexture>( memnew( ImageTexture ));
- logo->create_from_image(img);
- max_memory=3;
- html_title="";
- html_font_family="'Droid Sans',arial,sans-serif";
- html_controls_enabled=true;
- pack_mode=PACK_SINGLE_FILE;
+ return runnable_when_last_polled;
}
-bool EditorExportPlatformJavaScript::can_export(String *r_error) const {
-
-
- bool valid=true;
- String err;
+Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) {
- if (!exists_export_template("javascript_debug.zip") || !exists_export_template("javascript_release.zip")) {
- valid=false;
- err+="No export templates found.\nDownload and install export templates.\n";
- }
-
- if (custom_debug_package!="" && !FileAccess::exists(custom_debug_package)) {
- valid=false;
- err+="Custom debug package not found.\n";
- }
-
- if (custom_release_package!="" && !FileAccess::exists(custom_release_package)) {
- valid=false;
- err+="Custom release package not found.\n";
+ String path = EditorSettings::get_singleton()->get_settings_path() + "/tmp/tmp_export.html";
+ Error err = export_project(p_preset, true, path, p_debug_flags);
+ if (err) {
+ return err;
}
+ OS::get_singleton()->shell_open(path);
+ return OK;
+}
- if (r_error)
- *r_error=err;
+Ref<Texture> EditorExportPlatformJavaScript::get_run_icon() const {
- return valid;
+ return run_icon;
}
+EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() {
+
+ Ref<Image> img = memnew(Image(_javascript_logo));
+ logo.instance();
+ logo->create_from_image(img);
-EditorExportPlatformJavaScript::~EditorExportPlatformJavaScript() {
+ img = Ref<Image>(memnew(Image(_javascript_run_icon)));
+ run_icon.instance();
+ run_icon->create_from_image(img);
+ runnable_when_last_polled = false;
}
-#endif
void register_javascript_exporter() {
- //Ref<EditorExportPlatformJavaScript> exporter = Ref<EditorExportPlatformJavaScript>( memnew(EditorExportPlatformJavaScript) );
- //EditorImportExport::get_singleton()->add_export_platform(exporter);
+ Ref<EditorExportPlatformJavaScript> platform;
+ platform.instance();
+ EditorExport::get_singleton()->add_export_platform(platform);
}
diff --git a/platform/javascript/export/export.h b/platform/javascript/export/export.h
index 59c0a67e6d..910c4119f7 100644
--- a/platform/javascript/export/export.h
+++ b/platform/javascript/export/export.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/javascript/godot_shell.html b/platform/javascript/godot_shell.html
index 65f3b4a340..ee7399a129 100644
--- a/platform/javascript/godot_shell.html
+++ b/platform/javascript/godot_shell.html
@@ -2,8 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
- <title>$GODOT_HEAD_TITLE</title>
-$GODOT_HEAD_INCLUDE
+ <title></title>
<style type="text/css">
body {
margin: 0;
@@ -11,7 +10,7 @@ $GODOT_HEAD_INCLUDE
padding: 0;
text-align: center;
background-color: #222226;
- font-family: $GODOT_STYLE_FONT_FAMILY;
+ font-family: 'Droid Sans', Arial, sans-serif;
}
@@ -27,7 +26,7 @@ $GODOT_HEAD_INCLUDE
}
button.godot {
- font-family: $GODOT_STYLE_FONT_FAMILY; /* override user agent style */
+ font-family: 'Droid Sans', Arial, sans-serif; /* override user agent style */
padding: 1px 5px;
background-color: #37353f;
background-image: linear-gradient(to bottom, #413e49, #3a3842);
@@ -84,6 +83,10 @@ $GODOT_HEAD_INCLUDE
color: white;
}
+ #canvas:focus {
+ outline: none;
+ }
+
/* Status display
* ============== */
@@ -109,53 +112,12 @@ $GODOT_HEAD_INCLUDE
}
- /* On-hover controls
- * ================= */
-
- #controls {
- visibility: hidden;
- opacity: 0.0;
- transition: opacity 500ms ease-in-out 200ms;
- position: absolute;
- right: 16px;
- top: 16px;
- padding: 3px 5px;
- font-size: small;
- -moz-user-select: none;
- -webkit-user-select: none;
- -ms-user-select: none;
- }
-
- :hover > #controls {
- opacity: 1.0;
- transition: opacity 60ms ease-in-out;
- }
-
- #controls > button,
- #controls > label {
- vertical-align: middle;
- margin-left: 2px;
- margin-right: 2px;
- }
-
- #controls > label > input {
- vertical-align: middle;
- }
-
- #controls > label > input[type="checkbox"] {
- /* override user agent style */
- margin-left: 0;
- }
-
- #output-toggle { display: none; }
-
-
/* Debug output
* ============ */
#output-panel {
display: none;
- max-width: $GODOT_CANVAS_WIDTHpx;
+ max-width: 700px;
font-size: small;
margin: 6px auto 0;
padding: 0 4px 4px;
@@ -184,32 +146,18 @@ $GODOT_HEAD_INCLUDE
font-size: small;
font-family: "Lucida Console", Monaco, monospace;
}
-
-
-/* Export style include
- * ==================== */
-
-$GODOT_STYLE_INCLUDE
-
</style>
+$GODOT_HEAD_INCLUDE
</head>
<body>
<div id="container">
- <canvas id="canvas" width="$GODOT_CANVAS_WIDTH" height="$GODOT_CANVAS_HEIGHT" onclick="canvas.ownerDocument.defaultView.focus();" oncontextmenu="event.preventDefault();">
+ <canvas id="canvas" width="640" height="480" tabindex="0" oncontextmenu="event.preventDefault();">
HTML5 canvas appears to be unsupported in the current browser.<br />
Please try updating or use a different browser.
</canvas>
<div id="status-container">
<span id="status" class="godot" onclick="this.style.visibility='hidden';">Downloading page...</span>
</div>
- <div id="controls" class="godot">
- <label id="output-toggle"><input type="checkbox" checked="checked" autocomplete="off" onchange="Presentation.setOutputVisible(this.checked);" />Display Output</label>
- <!-- hidden until implemented
- <label><input class="postRun-enable" type="checkbox" disabled="disabled" autocomplete="off" />lock cursor</label>
- <label><input class="postRun-enable" type="checkbox" disabled="disabled" autocomplete="off" onchange="Presentation.setCanvasMaximized(this.checked);" />maximize</label>
- -->
- <button id="fullscreen" class="godot postRun-enable" type="button" disabled="disabled" autocomplete="off" onclick="Presentation.requestFullscreen();">Fullscreen</button>
- </div>
</div>
<div id="output-panel" class="godot">
<div id="output-header">
@@ -226,33 +174,9 @@ $GODOT_STYLE_INCLUDE
var canvasElement = document.getElementById("canvas");
var presentation = {
- postRun: [
- function() {
- var elements = document.getElementsByClassName("postRun-enable");
- Array.prototype.slice.call(elements).forEach(function(element) {
- element.disabled = false;
- });
- }
- ],
- requestFullscreen: function requestFullscreen() {
- if (typeof Module !== "undefined" && Module.requestFullscreen) {
- Module.requestFullscreen(false, false);
- }
- },
- /*
- requestPointerlock: function requestPointerlock() {
- if (typeof Module !== "undefined" && Module.requestPointerlock) {
- Module.requestPointerlock(false, false);
- }
- },
- setCanvasMaximized: function setCanvasMaximized(enabled) {
- if (typeof Module !== "undefined" && Module.setCanvasMaximized) {
- Module.setCanvasMaximized(enabled);
- }
- },
- */
+ postRun: [],
setStatusVisible: function setStatusVisible(visible) {
- statusElement.style.visibility = (visible?"visible":"hidden");
+ statusElement.style.visibility = (visible ? "visible" : "hidden");
},
setStatus: function setStatus(text) {
if (text.length === 0) {
@@ -288,18 +212,13 @@ $GODOT_STYLE_INCLUDE
window.onerror = function(event) { presentation.setStatus("Failure during start-up\nSee JavaScript console") };
- if ($GODOT_CONTROLS_ENABLED) { // controls enabled
- document.getElementById("controls").style.visibility="visible";
- }
-
if ($GODOT_DEBUG_ENABLED) { // debugging enabled
var outputRoot = document.getElementById("output-panel");
var outputElement = document.getElementById("output-scroll");
- var outputToggle = document.getElementById("output-toggle");
const maxOutputMessages = 400;
presentation.setOutputVisible = function setOutputVisible(visible) {
- outputRoot.style.display = (visible?"block":"none");
+ outputRoot.style.display = (visible ? "block" : "none");
};
presentation.clearOutput = function clearOutput() {
while (outputElement.firstChild) {
@@ -308,7 +227,6 @@ $GODOT_STYLE_INCLUDE
};
presentation.setOutputVisible(true);
- outputToggle.style.display = "inline";
presentation.print = function print(text) {
if (arguments.length > 1) {
@@ -347,56 +265,59 @@ $GODOT_STYLE_INCLUDE
})();
// Emscripten interface
- var Module = {
- TOTAL_MEMORY: $GODOT_TMEM,
- postRun: (function() {
- if (typeof Presentation !== "undefined" && Presentation.postRun instanceof Array) {
- return Presentation.postRun;
- }
- })(),
- print: function print(text) {
- if (arguments.length > 1) {
- text = Array.prototype.slice.call(arguments).join(" ");
- }
- console.log(text);
- if (typeof Presentation !== "undefined" && typeof Presentation.print === "function") {
- Presentation.print(text);
- }
- },
- printErr: function printErr(text) {
- if (arguments.length > 1) {
- text = Array.prototype.slice.call(arguments).join(" ");
- }
- console.error(text);
- if (typeof Presentation !== "undefined" && typeof Presentation.print === "function") {
- Presentation.print("**ERROR**:", text)
- }
- },
- canvas: (function() {
- var canvas = document.getElementById("canvas");
- // As a default initial behavior, pop up an alert when WebGL context is lost. To make your
- // application robust, you may want to override this behavior before shipping!
- // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
- canvas.addEventListener("webglcontextlost", function(e) { alert("WebGL context lost. Plase reload the page."); e.preventDefault(); }, false);
- return canvas;
-
- })(),
- setStatus: function setStatus(text) {
- var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
- var now = Date.now();
- if (m) {
- if (now - Date.now() < 30) // if this is a progress update, skip it if too soon
- return;
- text = m[1];
- }
- if (typeof Presentation !== "undefined" && typeof Presentation.setStatus == "function") {
- Presentation.setStatus(text);
+ var Module = (function() {
+ const BASE_NAME = '$GODOT_BASE';
+ var module = {
+ thisProgram: BASE_NAME,
+ wasmBinaryFile: BASE_NAME + '.wasm',
+ TOTAL_MEMORY: $GODOT_TMEM,
+ print: function print(text) {
+ if (arguments.length > 1) {
+ text = Array.prototype.slice.call(arguments).join(" ");
+ }
+ console.log(text);
+ if (typeof Presentation !== "undefined" && typeof Presentation.print === "function") {
+ Presentation.print(text);
+ }
+ },
+ printErr: function printErr(text) {
+ if (arguments.length > 1) {
+ text = Array.prototype.slice.call(arguments).join(" ");
+ }
+ console.error(text);
+ if (typeof Presentation !== "undefined" && typeof Presentation.print === "function") {
+ Presentation.print("**ERROR**:", text)
+ }
+ },
+ canvas: document.getElementById("canvas"),
+ setStatus: function setStatus(text) {
+ var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
+ var now = Date.now();
+ if (m) {
+ if (now - Date.now() < 30) // if this is a progress update, skip it if too soon
+ return;
+ text = m[1];
+ }
+ if (typeof Presentation !== "undefined" && typeof Presentation.setStatus == "function") {
+ Presentation.setStatus(text);
+ }
}
+ };
+
+ // As a default initial behavior, pop up an alert when WebGL context is lost. To make your
+ // application robust, you may want to override this behavior before shipping!
+ // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
+ module.canvas.addEventListener("webglcontextlost", function(e) { alert("WebGL context lost. Plase reload the page."); e.preventDefault(); }, false);
+
+ if (typeof Presentation !== "undefined" && Presentation.postRun instanceof Array) {
+ module.postRun = Presentation.postRun;
}
- };
+
+ return module;
+ })();
if (!Presentation.isWebGL2Available()) {
- Presentation.setStatus("WebGL2 appears to be unsupported in the current browser.\nPlease try updating or use a different browser.");
+ Presentation.setStatus("WebGL 2 appears to be unsupported.\nPlease update browser and drivers.");
Presentation.preventLoading = true;
} else {
Presentation.setStatus("Downloading...");
diff --git a/platform/javascript/javascript_eval.cpp b/platform/javascript/javascript_eval.cpp
index 897c2276bb..c9312e8d30 100644
--- a/platform/javascript/javascript_eval.cpp
+++ b/platform/javascript/javascript_eval.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/javascript/javascript_eval.h b/platform/javascript/javascript_eval.h
index 0050b855d8..4a732cec76 100644
--- a/platform/javascript/javascript_eval.h
+++ b/platform/javascript/javascript_eval.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp
index 00e531baa1..6b1d574496 100644
--- a/platform/javascript/javascript_main.cpp
+++ b/platform/javascript/javascript_main.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,171 +31,50 @@
#include "io/resource_loader.h"
#include "main/main.h"
#include "os_javascript.h"
-#include <GL/glut.h>
-#include <string.h>
OS_JavaScript *os = NULL;
-static void _gfx_init(void *ud, bool gl2, int w, int h, bool fs) {
+static void main_loop() {
- glutInitWindowSize(w, h);
- glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
- glutCreateWindow("godot");
+ os->main_loop_iterate();
}
-static uint32_t _mouse_button_mask = 0;
+extern "C" void main_after_fs_sync() {
-static void _glut_mouse_button(int button, int state, int x, int y) {
-
- InputEvent ev;
- ev.type = InputEvent::MOUSE_BUTTON;
- switch (button) {
- case GLUT_LEFT_BUTTON: ev.mouse_button.button_index = BUTTON_LEFT; break;
- case GLUT_MIDDLE_BUTTON: ev.mouse_button.button_index = BUTTON_MIDDLE; break;
- case GLUT_RIGHT_BUTTON: ev.mouse_button.button_index = BUTTON_RIGHT; break;
- case 3: ev.mouse_button.button_index = BUTTON_WHEEL_UP; break;
- case 4: ev.mouse_button.button_index = BUTTON_WHEEL_DOWN; break;
- }
-
- ev.mouse_button.pressed = state == GLUT_DOWN;
- ev.mouse_button.x = x;
- ev.mouse_button.y = y;
- ev.mouse_button.global_x = x;
- ev.mouse_button.global_y = y;
-
- if (ev.mouse_button.button_index < 4) {
- if (ev.mouse_button.pressed) {
- _mouse_button_mask |= 1 << (ev.mouse_button.button_index - 1);
- } else {
- _mouse_button_mask &= ~(1 << (ev.mouse_button.button_index - 1));
- }
- }
- ev.mouse_button.button_mask = _mouse_button_mask;
-
- uint32_t m = glutGetModifiers();
- ev.mouse_button.mod.alt = (m & GLUT_ACTIVE_ALT) != 0;
- ev.mouse_button.mod.shift = (m & GLUT_ACTIVE_SHIFT) != 0;
- ev.mouse_button.mod.control = (m & GLUT_ACTIVE_CTRL) != 0;
-
- os->push_input(ev);
-
- if (ev.mouse_button.button_index == BUTTON_WHEEL_UP || ev.mouse_button.button_index == BUTTON_WHEEL_DOWN) {
- // GLUT doesn't send release events for mouse wheel, so send manually
- ev.mouse_button.pressed = false;
- os->push_input(ev);
- }
-}
-
-static int _glut_prev_x = 0;
-static int _glut_prev_y = 0;
-
-static void _glut_mouse_motion(int x, int y) {
-
- InputEvent ev;
- ev.type = InputEvent::MOUSE_MOTION;
- ev.mouse_motion.button_mask = _mouse_button_mask;
- ev.mouse_motion.x = x;
- ev.mouse_motion.y = y;
- ev.mouse_motion.global_x = x;
- ev.mouse_motion.global_y = y;
- ev.mouse_motion.relative_x = x - _glut_prev_x;
- ev.mouse_motion.relative_y = y - _glut_prev_y;
- _glut_prev_x = x;
- _glut_prev_y = y;
-
- uint32_t m = glutGetModifiers();
- ev.mouse_motion.mod.alt = (m & GLUT_ACTIVE_ALT) != 0;
- ev.mouse_motion.mod.shift = (m & GLUT_ACTIVE_SHIFT) != 0;
- ev.mouse_motion.mod.control = (m & GLUT_ACTIVE_CTRL) != 0;
-
- os->push_input(ev);
-}
-
-static void _gfx_idle() {
-
- glutPostRedisplay();
-}
-
-int start_step = 0;
-
-static void _godot_draw(void) {
-
- if (start_step == 1) {
- start_step = 2;
- Main::start();
- os->main_loop_begin();
- }
-
- if (start_step == 2) {
- os->main_loop_iterate();
- }
-
- glutSwapBuffers();
-}
-
-extern "C" {
-
-void main_after_fs_sync() {
-
- start_step = 1;
-}
+ // Ease up compatibility
+ ResourceLoader::set_abort_on_missing_resources(false);
+ Main::start();
+ os->main_loop_begin();
+ emscripten_set_main_loop(main_loop, 0, false);
}
int main(int argc, char *argv[]) {
- /* Initialize the window */
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[] = { "-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
-
- glutMouseFunc(_glut_mouse_button);
- glutMotionFunc(_glut_mouse_motion);
- glutPassiveMotionFunc(_glut_mouse_motion);
- /* Set up glut callback functions */
- glutIdleFunc(_gfx_idle);
- // glutReshapeFunc(gears_reshape);
- glutDisplayFunc(_godot_draw);
- //glutSpecialFunc(gears_special);
-
- //mount persistent file system
+ // sync from persistent state into memory and then
+ // run the 'main_after_fs_sync' function
/* clang-format off */
EM_ASM(
+ Module.noExitRuntime = true;
FS.mkdir('/userfs');
FS.mount(IDBFS, {}, '/userfs');
-
- // sync from persistent state into memory and then
- // run the 'main_after_fs_sync' function
FS.syncfs(true, function(err) {
-
if (err) {
Module.setStatus('Failed to load persistent data\nPlease allow (third-party) cookies');
Module.printErr('Failed to populate IDB file system: ' + err.message);
- Module.exit();
+ Module.noExitRuntime = false;
} else {
Module.print('Successfully populated IDB file system');
- ccall('main_after_fs_sync', 'void', []);
+ ccall('main_after_fs_sync', null);
}
});
);
/* clang-format on */
- glutMainLoop();
+ os = new OS_JavaScript(argv[0], NULL);
+ Error err = Main::setup(argv[0], argc - 1, &argv[1]);
return 0;
+ // continued async in main_after_fs_sync() from syncfs() callback
}
-
-/*
- *
- *09] <azakai|2__> reduz: yes, define TOTAL_MEMORY on Module. for example var Module = { TOTAL_MEMORY: 12345.. }; before the main
- *
- */
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index 83072c30aa..d339baf024 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "os_javascript.h"
-#include "core/global_config.h"
#include "core/io/file_access_buffered_fa.h"
+#include "core/project_settings.h"
#include "dom_keys.h"
#include "drivers/gles3/rasterizer_gles3.h"
#include "drivers/unix/dir_access_unix.h"
@@ -40,6 +41,19 @@
#include <emscripten.h>
#include <stdlib.h>
+#define DOM_BUTTON_LEFT 0
+#define DOM_BUTTON_MIDDLE 1
+#define DOM_BUTTON_RIGHT 2
+
+template <typename T>
+static void dom2godot_mod(T emscripten_event_ptr, Ref<InputEventWithModifiers> godot_event) {
+
+ godot_event->set_shift(emscripten_event_ptr->shiftKey);
+ godot_event->set_alt(emscripten_event_ptr->altKey);
+ godot_event->set_control(emscripten_event_ptr->ctrlKey);
+ godot_event->set_metakey(emscripten_event_ptr->metaKey);
+}
+
int OS_JavaScript::get_video_driver_count() const {
return 1;
@@ -82,30 +96,18 @@ static EM_BOOL _browser_resize_callback(int event_type, const EmscriptenUiEvent
ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_RESIZE, false);
OS_JavaScript *os = static_cast<OS_JavaScript *>(user_data);
-
- // the order in which _browser_resize_callback and
- // _fullscreen_change_callback are called is browser-dependent,
- // so try adjusting for fullscreen in both
- if (os->is_window_fullscreen() || os->is_window_maximized()) {
-
- OS::VideoMode vm = os->get_video_mode();
- vm.width = ui_event->windowInnerWidth;
- vm.height = ui_event->windowInnerHeight;
- os->set_video_mode(vm);
- emscripten_set_canvas_size(ui_event->windowInnerWidth, ui_event->windowInnerHeight);
- }
+ // The order of the fullscreen change event and the window size change
+ // event varies, even within just one browser, so defer handling
+ os->request_canvas_size_adjustment();
return false;
}
-static Size2 _windowed_size;
-
static EM_BOOL _fullscreen_change_callback(int event_type, const EmscriptenFullscreenChangeEvent *event, void *user_data) {
ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_FULLSCREENCHANGE, false);
OS_JavaScript *os = static_cast<OS_JavaScript *>(user_data);
String id = String::utf8(event->id);
-
// empty id is canvas
if (id.empty() || id == "canvas") {
@@ -113,32 +115,247 @@ static EM_BOOL _fullscreen_change_callback(int event_type, const EmscriptenFulls
// this event property is the only reliable information on
// browser fullscreen state
vm.fullscreen = event->isFullscreen;
+ os->set_video_mode(vm);
+ os->request_canvas_size_adjustment();
+ }
+ return false;
+}
- if (event->isFullscreen) {
- vm.width = event->screenWidth;
- vm.height = event->screenHeight;
- os->set_video_mode(vm);
- emscripten_set_canvas_size(vm.width, vm.height);
- } else {
- os->set_video_mode(vm);
- if (!os->is_window_maximized()) {
- os->set_window_size(_windowed_size);
- }
+static InputDefault *_input;
+
+static bool is_canvas_focused() {
+
+ /* clang-format off */
+ return EM_ASM_INT_V(
+ return document.activeElement == Module.canvas;
+ );
+ /* clang-format on */
+}
+
+static void focus_canvas() {
+
+ /* clang-format off */
+ EM_ASM(
+ Module.canvas.focus();
+ );
+ /* clang-format on */
+}
+
+static bool _cursor_inside_canvas = true;
+
+static bool is_cursor_inside_canvas() {
+
+ return _cursor_inside_canvas;
+}
+
+static EM_BOOL _mousebutton_callback(int event_type, const EmscriptenMouseEvent *mouse_event, void *user_data) {
+
+ ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_MOUSEDOWN && event_type != EMSCRIPTEN_EVENT_MOUSEUP, false);
+
+ Ref<InputEventMouseButton> ev;
+ ev.instance();
+ ev->set_pressed(event_type == EMSCRIPTEN_EVENT_MOUSEDOWN);
+ ev->set_position(Point2(mouse_event->canvasX, mouse_event->canvasY));
+ ev->set_global_position(ev->get_position());
+ dom2godot_mod(mouse_event, ev);
+
+ switch (mouse_event->button) {
+ case DOM_BUTTON_LEFT: ev->set_button_index(BUTTON_LEFT); break;
+ case DOM_BUTTON_MIDDLE: ev->set_button_index(BUTTON_MIDDLE); break;
+ case DOM_BUTTON_RIGHT: ev->set_button_index(BUTTON_RIGHT); break;
+ default: return false;
+ }
+
+ int mask = _input->get_mouse_button_mask();
+ if (ev->is_pressed()) {
+ // since the event is consumed, focus manually
+ if (!is_canvas_focused()) {
+ focus_canvas();
}
+ mask |= 1 << ev->get_button_index();
+ } else if (mask & (1 << ev->get_button_index())) {
+ mask &= ~(1 << ev->get_button_index());
+ } else {
+ // release event, but press was outside the canvas, so ignore
+ return false;
}
+ ev->set_button_mask(mask >> 1);
+
+ _input->parse_input_event(ev);
+ // prevent selection dragging
+ return true;
+}
+
+static EM_BOOL _mousemove_callback(int event_type, const EmscriptenMouseEvent *mouse_event, void *user_data) {
+
+ ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_MOUSEMOVE, false);
+ OS_JavaScript *os = static_cast<OS_JavaScript *>(user_data);
+ int input_mask = _input->get_mouse_button_mask();
+ Point2 pos = Point2(mouse_event->canvasX, mouse_event->canvasY);
+ // outside the canvas, only read mouse movement if dragging started inside
+ // the canvas; imitating desktop app behaviour
+ if (!is_cursor_inside_canvas() && !input_mask)
+ return false;
+
+ Ref<InputEventMouseMotion> ev;
+ ev.instance();
+ dom2godot_mod(mouse_event, ev);
+ ev->set_button_mask(input_mask >> 1);
+
+ ev->set_position(pos);
+ ev->set_global_position(ev->get_position());
+
+ ev->set_relative(_input->get_mouse_position() - ev->get_position());
+ _input->set_mouse_position(ev->get_position());
+ ev->set_speed(_input->get_last_mouse_speed());
+
+ _input->parse_input_event(ev);
+ // don't suppress mouseover/leave events
return false;
}
-static InputEvent _setup_key_event(const EmscriptenKeyboardEvent *emscripten_event) {
+static EM_BOOL _wheel_callback(int event_type, const EmscriptenWheelEvent *wheel_event, void *user_data) {
+
+ ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_WHEEL, false);
+ if (!is_canvas_focused()) {
+ if (is_cursor_inside_canvas()) {
+ focus_canvas();
+ } else {
+ return false;
+ }
+ }
+
+ Ref<InputEventMouseButton> ev;
+ ev.instance();
+ ev->set_button_mask(_input->get_mouse_button_mask() >> 1);
+ ev->set_position(_input->get_mouse_position());
+ ev->set_global_position(ev->get_position());
+
+ ev->set_shift(_input->is_key_pressed(KEY_SHIFT));
+ ev->set_alt(_input->is_key_pressed(KEY_ALT));
+ ev->set_control(_input->is_key_pressed(KEY_CONTROL));
+ ev->set_metakey(_input->is_key_pressed(KEY_META));
+
+ if (wheel_event->deltaY < 0)
+ ev->set_button_index(BUTTON_WHEEL_UP);
+ else if (wheel_event->deltaY > 0)
+ ev->set_button_index(BUTTON_WHEEL_DOWN);
+ else if (wheel_event->deltaX > 0)
+ ev->set_button_index(BUTTON_WHEEL_LEFT);
+ else if (wheel_event->deltaX < 0)
+ ev->set_button_index(BUTTON_WHEEL_RIGHT);
+ else
+ return false;
+
+ // Different browsers give wildly different delta values, and we can't
+ // interpret deltaMode, so use default value for wheel events' factor
+
+ ev->set_pressed(true);
+ _input->parse_input_event(ev);
+
+ ev->set_pressed(false);
+ _input->parse_input_event(ev);
+
+ return true;
+}
+
+static Point2 _prev_touches[32];
+
+static EM_BOOL _touchpress_callback(int event_type, const EmscriptenTouchEvent *touch_event, void *user_data) {
+
+ ERR_FAIL_COND_V(
+ event_type != EMSCRIPTEN_EVENT_TOUCHSTART &&
+ event_type != EMSCRIPTEN_EVENT_TOUCHEND &&
+ event_type != EMSCRIPTEN_EVENT_TOUCHCANCEL,
+ false);
+
+ Ref<InputEventScreenTouch> ev;
+ ev.instance();
+ int lowest_id_index = -1;
+ for (int i = 0; i < touch_event->numTouches; ++i) {
+
+ const EmscriptenTouchPoint &touch = touch_event->touches[i];
+ if (lowest_id_index == -1 || touch.identifier < touch_event->touches[lowest_id_index].identifier)
+ lowest_id_index = i;
+ if (!touch.isChanged)
+ continue;
+ ev->set_index(touch.identifier);
+ ev->set_position(Point2(touch.canvasX, touch.canvasY));
+ _prev_touches[i] = ev->get_position();
+ ev->set_pressed(event_type == EMSCRIPTEN_EVENT_TOUCHSTART);
+
+ _input->parse_input_event(ev);
+ }
+
+ if (touch_event->touches[lowest_id_index].isChanged) {
+
+ Ref<InputEventMouseButton> ev_mouse;
+ ev_mouse.instance();
+ ev_mouse->set_button_mask(_input->get_mouse_button_mask() >> 1);
+ dom2godot_mod(touch_event, ev_mouse);
+
+ const EmscriptenTouchPoint &first_touch = touch_event->touches[lowest_id_index];
+ ev_mouse->set_position(Point2(first_touch.canvasX, first_touch.canvasY));
+ ev_mouse->set_global_position(ev_mouse->get_position());
+
+ ev_mouse->set_button_index(BUTTON_LEFT);
+ ev_mouse->set_pressed(event_type == EMSCRIPTEN_EVENT_TOUCHSTART);
+
+ _input->parse_input_event(ev_mouse);
+ }
+ return true;
+}
+
+static EM_BOOL _touchmove_callback(int event_type, const EmscriptenTouchEvent *touch_event, void *user_data) {
+
+ ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_TOUCHMOVE, false);
+
+ Ref<InputEventScreenDrag> ev;
+ ev.instance();
+ int lowest_id_index = -1;
+ for (int i = 0; i < touch_event->numTouches; ++i) {
+
+ const EmscriptenTouchPoint &touch = touch_event->touches[i];
+ if (lowest_id_index == -1 || touch.identifier < touch_event->touches[lowest_id_index].identifier)
+ lowest_id_index = i;
+ if (!touch.isChanged)
+ continue;
+ ev->set_index(touch.identifier);
+ ev->set_position(Point2(touch.canvasX, touch.canvasY));
+ Point2 &prev = _prev_touches[i];
+ ev->set_relative(ev->get_position() - prev);
+ prev = ev->get_position();
+
+ _input->parse_input_event(ev);
+ }
+
+ if (touch_event->touches[lowest_id_index].isChanged) {
+
+ Ref<InputEventMouseMotion> ev_mouse;
+ ev_mouse.instance();
+ dom2godot_mod(touch_event, ev_mouse);
+ ev_mouse->set_button_mask(_input->get_mouse_button_mask() >> 1);
+
+ const EmscriptenTouchPoint &first_touch = touch_event->touches[lowest_id_index];
+ ev_mouse->set_position(Point2(first_touch.canvasX, first_touch.canvasY));
+ ev_mouse->set_global_position(ev_mouse->get_position());
+
+ ev_mouse->set_relative(_input->get_mouse_position() - ev_mouse->get_position());
+ _input->set_mouse_position(ev_mouse->get_position());
+ ev_mouse->set_speed(_input->get_last_mouse_speed());
+
+ _input->parse_input_event(ev_mouse);
+ }
+ return true;
+}
+
+static Ref<InputEventKey> _setup_key_event(const EmscriptenKeyboardEvent *emscripten_event) {
- InputEvent ev;
- ev.type = InputEvent::KEY;
- ev.key.echo = emscripten_event->repeat;
- ev.key.mod.alt = emscripten_event->altKey;
- ev.key.mod.shift = emscripten_event->shiftKey;
- ev.key.mod.control = emscripten_event->ctrlKey;
- ev.key.mod.meta = emscripten_event->metaKey;
- ev.key.scancode = dom2godot_scancode(emscripten_event->keyCode);
+ Ref<InputEventKey> ev;
+ ev.instance();
+ ev->set_echo(emscripten_event->repeat);
+ dom2godot_mod(emscripten_event, ev);
+ ev->set_scancode(dom2godot_scancode(emscripten_event->keyCode));
String unicode = String::utf8(emscripten_event->key);
// check if empty or multi-character (e.g. `CapsLock`)
@@ -147,26 +364,26 @@ static InputEvent _setup_key_event(const EmscriptenKeyboardEvent *emscripten_eve
unicode = String::utf8(emscripten_event->charValue);
}
if (unicode.length() == 1) {
- ev.key.unicode = unicode[0];
+ ev->set_unicode(unicode[0]);
}
return ev;
}
-static InputEvent deferred_key_event;
+static Ref<InputEventKey> deferred_key_event;
static EM_BOOL _keydown_callback(int event_type, const EmscriptenKeyboardEvent *key_event, void *user_data) {
ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_KEYDOWN, false);
- InputEvent ev = _setup_key_event(key_event);
- ev.key.pressed = true;
- if (ev.key.unicode == 0 && keycode_has_unicode(ev.key.scancode)) {
+ Ref<InputEventKey> ev = _setup_key_event(key_event);
+ ev->set_pressed(true);
+ if (ev->get_unicode() == 0 && keycode_has_unicode(ev->get_scancode())) {
// defer to keypress event for legacy unicode retrieval
deferred_key_event = ev;
return false; // do not suppress keypress event
}
- static_cast<OS_JavaScript *>(user_data)->push_input(ev);
+ _input->parse_input_event(ev);
return true;
}
@@ -174,8 +391,8 @@ static EM_BOOL _keypress_callback(int event_type, const EmscriptenKeyboardEvent
ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_KEYPRESS, false);
- deferred_key_event.key.unicode = key_event->charCode;
- static_cast<OS_JavaScript *>(user_data)->push_input(deferred_key_event);
+ deferred_key_event->set_unicode(key_event->charCode);
+ _input->parse_input_event(deferred_key_event);
return true;
}
@@ -183,10 +400,10 @@ static EM_BOOL _keyup_callback(int event_type, const EmscriptenKeyboardEvent *ke
ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_KEYUP, false);
- InputEvent ev = _setup_key_event(key_event);
- ev.key.pressed = false;
- static_cast<OS_JavaScript *>(user_data)->push_input(ev);
- return ev.key.scancode != KEY_UNKNOWN && ev.key.scancode != 0;
+ Ref<InputEventKey> ev = _setup_key_event(key_event);
+ ev->set_pressed(false);
+ _input->parse_input_event(ev);
+ return ev->get_scancode() != KEY_UNKNOWN && ev->get_scancode() != 0;
}
static EM_BOOL joy_callback_func(int p_type, const EmscriptenGamepadEvent *p_event, void *p_user) {
@@ -197,18 +414,31 @@ static EM_BOOL joy_callback_func(int p_type, const EmscriptenGamepadEvent *p_eve
return false;
}
+extern "C" {
+void send_notification(int notif) {
+ if (notif == MainLoop::NOTIFICATION_WM_MOUSE_ENTER || notif == MainLoop::NOTIFICATION_WM_MOUSE_EXIT) {
+ _cursor_inside_canvas = notif == MainLoop::NOTIFICATION_WM_MOUSE_ENTER;
+ }
+ OS_JavaScript::get_singleton()->get_main_loop()->notification(notif);
+}
+}
+
void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
print_line("Init OS");
- if (gfx_init_func)
- gfx_init_func(gfx_init_ud, use_gl2, p_desired.width, p_desired.height, p_desired.fullscreen);
+ EmscriptenWebGLContextAttributes attributes;
+ emscripten_webgl_init_context_attributes(&attributes);
+ attributes.alpha = false;
+ attributes.antialias = false;
+ attributes.majorVersion = 2;
+ EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx = emscripten_webgl_create_context(NULL, &attributes);
+ ERR_FAIL_COND(emscripten_webgl_make_context_current(ctx) != EMSCRIPTEN_RESULT_SUCCESS);
- // nothing to do here, can't fulfil fullscreen request due to
- // browser security, window size is already set from HTML
video_mode = p_desired;
+ // can't fulfil fullscreen request due to browser security
video_mode.fullscreen = false;
- _windowed_size = get_window_size();
+ set_window_size(Size2(p_desired.width, p_desired.height));
// find locale, emscripten only sets "C"
char locale_ptr[16];
@@ -246,7 +476,7 @@ void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, i
print_line("Init VS");
visual_server = memnew(VisualServerRaster());
- visual_server->cursor_set_visible(false, 0);
+ // visual_server->cursor_set_visible(false, 0);
print_line("Init Physicsserver");
@@ -256,25 +486,34 @@ void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, i
physics_2d_server->init();
input = memnew(InputDefault);
+ _input = input;
power_manager = memnew(PowerJavascript);
#define EM_CHECK(ev) \
if (result != EMSCRIPTEN_RESULT_SUCCESS) \
ERR_PRINTS("Error while setting " #ev " callback: Code " + itos(result))
-#define SET_EM_CALLBACK(ev, cb) \
- result = emscripten_set_##ev##_callback(NULL, this, true, &cb); \
+#define SET_EM_CALLBACK(target, ev, cb) \
+ result = emscripten_set_##ev##_callback(target, this, true, &cb); \
EM_CHECK(ev)
#define SET_EM_CALLBACK_NODATA(ev, cb) \
result = emscripten_set_##ev##_callback(NULL, true, &cb); \
EM_CHECK(ev)
EMSCRIPTEN_RESULT result;
- SET_EM_CALLBACK(keydown, _keydown_callback)
- SET_EM_CALLBACK(keypress, _keypress_callback)
- SET_EM_CALLBACK(keyup, _keyup_callback)
- SET_EM_CALLBACK(resize, _browser_resize_callback)
- SET_EM_CALLBACK(fullscreenchange, _fullscreen_change_callback)
+ SET_EM_CALLBACK("#window", mousemove, _mousemove_callback)
+ SET_EM_CALLBACK("#canvas", mousedown, _mousebutton_callback)
+ SET_EM_CALLBACK("#window", mouseup, _mousebutton_callback)
+ SET_EM_CALLBACK("#window", wheel, _wheel_callback)
+ SET_EM_CALLBACK("#window", touchstart, _touchpress_callback)
+ SET_EM_CALLBACK("#window", touchmove, _touchmove_callback)
+ SET_EM_CALLBACK("#window", touchend, _touchpress_callback)
+ SET_EM_CALLBACK("#window", touchcancel, _touchpress_callback)
+ SET_EM_CALLBACK("#canvas", keydown, _keydown_callback)
+ SET_EM_CALLBACK("#canvas", keypress, _keypress_callback)
+ SET_EM_CALLBACK("#canvas", keyup, _keyup_callback)
+ SET_EM_CALLBACK(NULL, resize, _browser_resize_callback)
+ SET_EM_CALLBACK(NULL, fullscreenchange, _fullscreen_change_callback)
SET_EM_CALLBACK_NODATA(gamepadconnected, joy_callback_func)
SET_EM_CALLBACK_NODATA(gamepaddisconnected, joy_callback_func)
@@ -282,9 +521,24 @@ void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, i
#undef SET_EM_CALLBACK
#undef EM_CHECK
+ /* clang-format off */
+ EM_ASM_ARGS({
+ const send_notification = Module.cwrap('send_notification', null, ['number']);
+ const notifs = arguments;
+ (['mouseover', 'mouseleave', 'focus', 'blur']).forEach(function(event, i) {
+ Module.canvas.addEventListener(event, send_notification.bind(this, notifs[i]));
+ });
+ },
+ MainLoop::NOTIFICATION_WM_MOUSE_ENTER,
+ MainLoop::NOTIFICATION_WM_MOUSE_EXIT,
+ MainLoop::NOTIFICATION_WM_FOCUS_IN,
+ MainLoop::NOTIFICATION_WM_FOCUS_OUT
+ );
+/* clang-format on */
+
#ifdef JAVASCRIPT_EVAL_ENABLED
javascript_eval = memnew(JavaScript);
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("JavaScript", javascript_eval));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JavaScript", javascript_eval));
#endif
visual_server->init();
@@ -315,30 +569,97 @@ void OS_JavaScript::alert(const String &p_alert, const String &p_title) {
/* clang-format on */
}
-void OS_JavaScript::set_mouse_show(bool p_show) {
+static const char *godot2dom_cursor(OS::CursorShape p_shape) {
+
+ switch (p_shape) {
+ case OS::CURSOR_ARROW:
+ default:
+ return "auto";
+ case OS::CURSOR_IBEAM: return "text";
+ case OS::CURSOR_POINTING_HAND: return "pointer";
+ case OS::CURSOR_CROSS: return "crosshair";
+ case OS::CURSOR_WAIT: return "progress";
+ case OS::CURSOR_BUSY: return "wait";
+ case OS::CURSOR_DRAG: return "grab";
+ case OS::CURSOR_CAN_DROP: return "grabbing";
+ case OS::CURSOR_FORBIDDEN: return "no-drop";
+ case OS::CURSOR_VSIZE: return "ns-resize";
+ case OS::CURSOR_HSIZE: return "ew-resize";
+ case OS::CURSOR_BDIAGSIZE: return "nesw-resize";
+ case OS::CURSOR_FDIAGSIZE: return "nwse-resize";
+ case OS::CURSOR_MOVE: return "move";
+ case OS::CURSOR_VSPLIT: return "row-resize";
+ case OS::CURSOR_HSPLIT: return "col-resize";
+ case OS::CURSOR_HELP: return "help";
+ }
+}
+
+void OS_JavaScript::set_css_cursor(const char *p_cursor) {
- //javascript has no mouse...
+ /* clang-format off */
+ EM_ASM_({
+ Module.canvas.style.cursor = Module.UTF8ToString($0);
+ }, p_cursor);
+ /* clang-format on */
}
-void OS_JavaScript::set_mouse_grab(bool p_grab) {
+const char *OS_JavaScript::get_css_cursor() const {
- //it really has no mouse...!
+ char cursor[16];
+ /* clang-format off */
+ EM_ASM_INT({
+ Module.stringToUTF8(Module.canvas.style.cursor ? Module.canvas.style.cursor : 'auto', $0, 16);
+ }, cursor);
+ /* clang-format on */
+ return cursor;
}
-bool OS_JavaScript::is_mouse_grab_enabled() const {
+void OS_JavaScript::set_mouse_mode(OS::MouseMode p_mode) {
- //*sigh* technology has evolved so much since i was a kid..
- return false;
+ ERR_FAIL_INDEX(p_mode, MOUSE_MODE_CONFINED + 1);
+ ERR_EXPLAIN("MOUSE_MODE_CONFINED is not supported for the HTML5 platform");
+ ERR_FAIL_COND(p_mode == MOUSE_MODE_CONFINED);
+ if (p_mode == get_mouse_mode())
+ return;
+
+ if (p_mode == MOUSE_MODE_VISIBLE) {
+
+ set_css_cursor(godot2dom_cursor(cursor_shape));
+ emscripten_exit_pointerlock();
+
+ } else if (p_mode == MOUSE_MODE_HIDDEN) {
+
+ set_css_cursor("none");
+ emscripten_exit_pointerlock();
+
+ } else if (p_mode == MOUSE_MODE_CAPTURED) {
+
+ EMSCRIPTEN_RESULT result = emscripten_request_pointerlock("canvas", false);
+ ERR_EXPLAIN("MOUSE_MODE_CAPTURED can only be entered from within an appropriate input callback");
+ ERR_FAIL_COND(result == EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED);
+ ERR_FAIL_COND(result != EMSCRIPTEN_RESULT_SUCCESS);
+ set_css_cursor(godot2dom_cursor(cursor_shape));
+ }
+}
+
+OS::MouseMode OS_JavaScript::get_mouse_mode() const {
+
+ if (!strcmp(get_css_cursor(), "none"))
+ return MOUSE_MODE_HIDDEN;
+
+ EmscriptenPointerlockChangeEvent ev;
+ emscripten_get_pointerlock_status(&ev);
+ return ev.isActive && (strcmp(ev.id, "canvas") == 0) ? MOUSE_MODE_CAPTURED : MOUSE_MODE_VISIBLE;
}
-Point2 OS_JavaScript::get_mouse_pos() const {
+Point2 OS_JavaScript::get_mouse_position() const {
- return input->get_mouse_pos();
+ return input->get_mouse_position();
}
int OS_JavaScript::get_mouse_button_state() const {
- return last_button_mask;
+ return input->get_mouse_button_mask();
}
void OS_JavaScript::set_window_title(const String &p_title) {
@@ -376,14 +697,17 @@ Size2 OS_JavaScript::get_screen_size(int p_screen) const {
void OS_JavaScript::set_window_size(const Size2 p_size) {
- window_maximized = false;
+ windowed_size = p_size;
if (is_window_fullscreen()) {
+ window_maximized = false;
set_window_fullscreen(false);
+ } else if (is_window_maximized()) {
+ set_window_maximized(false);
+ } else {
+ video_mode.width = p_size.x;
+ video_mode.height = p_size.y;
+ emscripten_set_canvas_size(p_size.x, p_size.y);
}
- _windowed_size = p_size;
- video_mode.width = p_size.x;
- video_mode.height = p_size.y;
- emscripten_set_canvas_size(p_size.x, p_size.y);
}
Size2 OS_JavaScript::get_window_size() const {
@@ -396,20 +720,30 @@ Size2 OS_JavaScript::get_window_size() const {
void OS_JavaScript::set_window_maximized(bool p_enabled) {
window_maximized = p_enabled;
- if (p_enabled) {
-
- if (is_window_fullscreen()) {
- // _browser_resize callback will set canvas size
- set_window_fullscreen(false);
- } else {
- /* clang-format off */
- video_mode.width = EM_ASM_INT_V(return window.innerWidth);
- video_mode.height = EM_ASM_INT_V(return window.innerHeight);
- /* clang-format on */
- emscripten_set_canvas_size(video_mode.width, video_mode.height);
- }
- } else {
- set_window_size(_windowed_size);
+ if (is_window_fullscreen()) {
+ set_window_fullscreen(false);
+ return;
+ }
+ // Calling emscripten_enter_soft_fullscreen mutltiple times hides all
+ // page elements except the canvas permanently, so track state
+ if (p_enabled && !soft_fs_enabled) {
+
+ EmscriptenFullscreenStrategy strategy;
+ strategy.scaleMode = EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH;
+ strategy.canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF;
+ strategy.filteringMode = EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT;
+ strategy.canvasResizedCallback = NULL;
+ emscripten_enter_soft_fullscreen(NULL, &strategy);
+ soft_fs_enabled = true;
+ video_mode.width = get_window_size().width;
+ video_mode.height = get_window_size().height;
+ } else if (!p_enabled) {
+
+ emscripten_exit_soft_fullscreen();
+ soft_fs_enabled = false;
+ video_mode.width = windowed_size.width;
+ video_mode.height = windowed_size.height;
+ emscripten_set_canvas_size(video_mode.width, video_mode.height);
}
}
@@ -423,9 +757,17 @@ void OS_JavaScript::set_window_fullscreen(bool p_enable) {
// _browser_resize_callback or _fullscreen_change_callback
EMSCRIPTEN_RESULT result;
if (p_enable) {
- /* clang-format off */
- EM_ASM(Module.requestFullscreen(false, false););
- /* clang-format on */
+ if (window_maximized) {
+ // soft fs during real fs can cause issues
+ set_window_maximized(false);
+ window_maximized = true;
+ }
+ EmscriptenFullscreenStrategy strategy;
+ strategy.scaleMode = EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH;
+ strategy.canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF;
+ strategy.filteringMode = EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT;
+ strategy.canvasResizedCallback = NULL;
+ emscripten_request_fullscreen_strategy(NULL, false, &strategy);
} else {
result = emscripten_exit_fullscreen();
if (result != EMSCRIPTEN_RESULT_SUCCESS) {
@@ -439,6 +781,11 @@ bool OS_JavaScript::is_window_fullscreen() const {
return video_mode.fullscreen;
}
+void OS_JavaScript::request_canvas_size_adjustment() {
+
+ canvas_size_adjustment_requested = true;
+}
+
void OS_JavaScript::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) const {
Size2 screen = get_screen_size();
@@ -462,7 +809,11 @@ bool OS_JavaScript::can_draw() const {
void OS_JavaScript::set_cursor_shape(CursorShape p_shape) {
- //javascript really really really has no mouse.. how amazing..
+ ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
+
+ cursor_shape = p_shape;
+ if (get_mouse_mode() != MOUSE_MODE_HIDDEN)
+ set_css_cursor(godot2dom_cursor(cursor_shape));
}
void OS_JavaScript::main_loop_begin() {
@@ -494,6 +845,17 @@ bool OS_JavaScript::main_loop_iterate() {
}
}
process_joypads();
+ if (canvas_size_adjustment_requested) {
+
+ if (video_mode.fullscreen || window_maximized) {
+ video_mode.width = get_window_size().width;
+ video_mode.height = get_window_size().height;
+ }
+ if (!video_mode.fullscreen) {
+ set_window_maximized(window_maximized);
+ }
+ canvas_size_adjustment_requested = false;
+ }
return Main::iteration();
}
@@ -503,222 +865,6 @@ void OS_JavaScript::main_loop_end() {
main_loop->finish();
}
-void OS_JavaScript::main_loop_focusout() {
-
- if (main_loop)
- main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT);
- //audio_driver_javascript.set_pause(true);
-}
-
-void OS_JavaScript::main_loop_focusin() {
-
- if (main_loop)
- main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
- //audio_driver_javascript.set_pause(false);
-}
-
-void OS_JavaScript::push_input(const InputEvent &p_ev) {
-
- InputEvent ev = p_ev;
- ev.ID = last_id++;
- if (ev.type == InputEvent::MOUSE_MOTION) {
- input->set_mouse_pos(Point2(ev.mouse_motion.x, ev.mouse_motion.y));
- } else if (ev.type == InputEvent::MOUSE_BUTTON) {
- last_button_mask = ev.mouse_button.button_mask;
- }
- input->parse_input_event(p_ev);
-}
-
-void OS_JavaScript::process_touch(int p_what, int p_pointer, const Vector<TouchPos> &p_points) {
-
- //print_line("ev: "+itos(p_what)+" pnt: "+itos(p_pointer)+" pointc: "+itos(p_points.size()));
-
- switch (p_what) {
- case 0: { //gesture begin
-
- if (touch.size()) {
- //end all if exist
- InputEvent ev;
- ev.type = InputEvent::MOUSE_BUTTON;
- ev.ID = last_id++;
- ev.mouse_button.button_index = BUTTON_LEFT;
- ev.mouse_button.button_mask = BUTTON_MASK_LEFT;
- ev.mouse_button.pressed = false;
- ev.mouse_button.x = touch[0].pos.x;
- ev.mouse_button.y = touch[0].pos.y;
- ev.mouse_button.global_x = touch[0].pos.x;
- ev.mouse_button.global_y = touch[0].pos.y;
- input->parse_input_event(ev);
-
- for (int i = 0; i < touch.size(); i++) {
-
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.ID = last_id++;
- ev.screen_touch.index = touch[i].id;
- ev.screen_touch.pressed = false;
- ev.screen_touch.x = touch[i].pos.x;
- ev.screen_touch.y = touch[i].pos.y;
- input->parse_input_event(ev);
- }
- }
-
- touch.resize(p_points.size());
- for (int i = 0; i < p_points.size(); i++) {
- touch[i].id = p_points[i].id;
- touch[i].pos = p_points[i].pos;
- }
-
- {
- //send mouse
- InputEvent ev;
- ev.type = InputEvent::MOUSE_BUTTON;
- ev.ID = last_id++;
- ev.mouse_button.button_index = BUTTON_LEFT;
- ev.mouse_button.button_mask = BUTTON_MASK_LEFT;
- ev.mouse_button.pressed = true;
- ev.mouse_button.x = touch[0].pos.x;
- ev.mouse_button.y = touch[0].pos.y;
- ev.mouse_button.global_x = touch[0].pos.x;
- ev.mouse_button.global_y = touch[0].pos.y;
- last_mouse = touch[0].pos;
- input->parse_input_event(ev);
- }
-
- //send touch
- for (int i = 0; i < touch.size(); i++) {
-
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.ID = last_id++;
- ev.screen_touch.index = touch[i].id;
- ev.screen_touch.pressed = true;
- ev.screen_touch.x = touch[i].pos.x;
- ev.screen_touch.y = touch[i].pos.y;
- input->parse_input_event(ev);
- }
-
- } break;
- case 1: { //motion
-
- if (p_points.size()) {
- //send mouse, should look for point 0?
- InputEvent ev;
- ev.type = InputEvent::MOUSE_MOTION;
- ev.ID = last_id++;
- ev.mouse_motion.button_mask = BUTTON_MASK_LEFT;
- ev.mouse_motion.x = p_points[0].pos.x;
- ev.mouse_motion.y = p_points[0].pos.y;
- input->set_mouse_pos(Point2(ev.mouse_motion.x, ev.mouse_motion.y));
- ev.mouse_motion.speed_x = input->get_last_mouse_speed().x;
- ev.mouse_motion.speed_y = input->get_last_mouse_speed().y;
- ev.mouse_motion.relative_x = p_points[0].pos.x - last_mouse.x;
- ev.mouse_motion.relative_y = p_points[0].pos.y - last_mouse.y;
- last_mouse = p_points[0].pos;
- input->parse_input_event(ev);
- }
-
- ERR_FAIL_COND(touch.size() != p_points.size());
-
- for (int i = 0; i < touch.size(); i++) {
-
- int idx = -1;
- for (int j = 0; j < p_points.size(); j++) {
-
- if (touch[i].id == p_points[j].id) {
- idx = j;
- break;
- }
- }
-
- ERR_CONTINUE(idx == -1);
-
- if (touch[i].pos == p_points[idx].pos)
- continue; //no move unncesearily
-
- InputEvent ev;
- ev.type = InputEvent::SCREEN_DRAG;
- ev.ID = last_id++;
- ev.screen_drag.index = touch[i].id;
- ev.screen_drag.x = p_points[idx].pos.x;
- ev.screen_drag.y = p_points[idx].pos.y;
- ev.screen_drag.relative_x = p_points[idx].pos.x - touch[i].pos.x;
- ev.screen_drag.relative_y = p_points[idx].pos.y - touch[i].pos.y;
- input->parse_input_event(ev);
- touch[i].pos = p_points[idx].pos;
- }
-
- } break;
- case 2: { //release
-
- if (touch.size()) {
- //end all if exist
- InputEvent ev;
- ev.type = InputEvent::MOUSE_BUTTON;
- ev.ID = last_id++;
- ev.mouse_button.button_index = BUTTON_LEFT;
- ev.mouse_button.button_mask = BUTTON_MASK_LEFT;
- ev.mouse_button.pressed = false;
- ev.mouse_button.x = touch[0].pos.x;
- ev.mouse_button.y = touch[0].pos.y;
- ev.mouse_button.global_x = touch[0].pos.x;
- ev.mouse_button.global_y = touch[0].pos.y;
- input->parse_input_event(ev);
-
- for (int i = 0; i < touch.size(); i++) {
-
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.ID = last_id++;
- ev.screen_touch.index = touch[i].id;
- ev.screen_touch.pressed = false;
- ev.screen_touch.x = touch[i].pos.x;
- ev.screen_touch.y = touch[i].pos.y;
- input->parse_input_event(ev);
- }
- touch.clear();
- }
-
- } break;
- case 3: { // add tuchi
-
- ERR_FAIL_INDEX(p_pointer, p_points.size());
-
- TouchPos tp = p_points[p_pointer];
- touch.push_back(tp);
-
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.ID = last_id++;
- ev.screen_touch.index = tp.id;
- ev.screen_touch.pressed = true;
- ev.screen_touch.x = tp.pos.x;
- ev.screen_touch.y = tp.pos.y;
- input->parse_input_event(ev);
-
- } break;
- case 4: {
-
- for (int i = 0; i < touch.size(); i++) {
- if (touch[i].id == p_pointer) {
-
- InputEvent ev;
- ev.type = InputEvent::SCREEN_TOUCH;
- ev.ID = last_id++;
- ev.screen_touch.index = touch[i].id;
- ev.screen_touch.pressed = false;
- ev.screen_touch.x = touch[i].pos.x;
- ev.screen_touch.y = touch[i].pos.y;
- input->parse_input_event(ev);
- touch.remove(i);
- i--;
- }
- }
-
- } break;
- }
-}
-
void OS_JavaScript::process_accelerometer(const Vector3 &p_accelerometer) {
input->set_accelerometer(p_accelerometer);
@@ -726,7 +872,11 @@ void OS_JavaScript::process_accelerometer(const Vector3 &p_accelerometer) {
bool OS_JavaScript::has_touchscreen_ui_hint() const {
- return false; //???
+ /* clang-format off */
+ return EM_ASM_INT_V(
+ return 'ontouchstart' in window;
+ );
+ /* clang-format on */
}
void OS_JavaScript::main_loop_request_quit() {
@@ -756,12 +906,12 @@ String OS_JavaScript::get_data_dir() const {
return get_data_dir_func();
*/
return "/userfs";
- //return GlobalConfig::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir");
+ //return ProjectSettings::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir");
};
String OS_JavaScript::get_executable_path() const {
- return String();
+ return OS::get_executable_path();
}
void OS_JavaScript::_close_notification_funcs(const String &p_file, int p_flags) {
@@ -790,9 +940,9 @@ void OS_JavaScript::process_joypads() {
InputDefault::JoyAxis jx;
jx.min = 0;
jx.value = value;
- last_id = input->joy_axis(last_id, i, j, jx);
+ input->joy_axis(i, j, jx);
} else {
- last_id = input->joy_button(last_id, i, j, value);
+ input->joy_button(i, j, value);
}
}
for (int j = 0; j < num_axes; j++) {
@@ -800,7 +950,7 @@ void OS_JavaScript::process_joypads() {
InputDefault::JoyAxis jx;
jx.min = -1;
jx.value = state.axis[j];
- last_id = input->joy_axis(last_id, i, j, jx);
+ input->joy_axis(i, j, jx);
}
}
}
@@ -839,14 +989,18 @@ 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;
+bool OS_JavaScript::_check_internal_feature_support(const String &p_feature) {
+
+ return p_feature == "web" || p_feature == "s3tc"; // TODO check for these features really being available
+}
+
+OS_JavaScript::OS_JavaScript(const char *p_execpath, GetDataDirFunc p_get_data_dir_func) {
+ set_cmdline(p_execpath, get_cmdline_args());
main_loop = NULL;
- last_id = 1;
gl_extensions = NULL;
window_maximized = false;
+ soft_fs_enabled = false;
+ canvas_size_adjustment_requested = false;
get_data_dir_func = p_get_data_dir_func;
FileAccessUnix::close_notification_func = _close_notification_funcs;
diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h
index b16918b2da..13c500b3dc 100644
--- a/platform/javascript/os_javascript.h
+++ b/platform/javascript/os_javascript.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -44,25 +45,9 @@
#include <emscripten/html5.h>
-typedef void (*GFXInitFunc)(void *ud, bool gl2, int w, int h, bool fs);
typedef String (*GetDataDirFunc)();
class OS_JavaScript : public OS_Unix {
-public:
- struct TouchPos {
- int id;
- Point2 pos;
- };
-
-private:
- Vector<TouchPos> touch;
- Point2 last_mouse;
- int last_button_mask;
- unsigned int last_id;
- GFXInitFunc gfx_init_func;
- void *gfx_init_ud;
-
- bool use_gl2;
int64_t time_to_save_sync;
int64_t last_sync_time;
@@ -74,8 +59,12 @@ private:
const char *gl_extensions;
InputDefault *input;
+ Vector2 windowed_size;
bool window_maximized;
+ bool soft_fs_enabled;
+ bool canvas_size_adjustment_requested;
VideoMode video_mode;
+ CursorShape cursor_shape;
MainLoop *main_loop;
GetDataDirFunc get_data_dir_func;
@@ -90,6 +79,9 @@ private:
void process_joypads();
+ void set_css_cursor(const char *);
+ const char *get_css_cursor() const;
+
public:
// functions used by main to initialize/deintialize the OS
virtual int get_video_driver_count() const;
@@ -119,10 +111,9 @@ public:
virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
- virtual void set_mouse_show(bool p_show);
- virtual void set_mouse_grab(bool p_grab);
- virtual bool is_mouse_grab_enabled() const;
- virtual Point2 get_mouse_pos() const;
+ virtual void set_mouse_mode(MouseMode p_mode);
+ virtual MouseMode get_mouse_mode() const;
+ virtual Point2 get_mouse_position() const;
virtual int get_mouse_button_state() const;
virtual void set_window_title(const String &p_title);
@@ -142,6 +133,8 @@ public:
virtual void set_window_fullscreen(bool p_enable);
virtual bool is_window_fullscreen() const;
+ void request_canvas_size_adjustment();
+
virtual String get_name();
virtual MainLoop *get_main_loop() const;
@@ -166,8 +159,7 @@ public:
virtual String get_resource_dir() const;
void process_accelerometer(const Vector3 &p_accelerometer);
- void process_touch(int p_what, int p_pointer, const Vector<TouchPos> &p_points);
- void push_input(const InputEvent &p_ev);
+ void push_input(const Ref<InputEvent> &p_ev);
virtual bool is_joy_known(int p_device);
virtual String get_joy_guid(int p_device) const;
@@ -177,7 +169,9 @@ public:
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);
+ virtual bool _check_internal_feature_support(const String &p_feature);
+
+ OS_JavaScript(const char *p_execpath, GetDataDirFunc p_get_data_dir_func);
~OS_JavaScript();
};
diff --git a/platform/javascript/platform_config.h b/platform/javascript/platform_config.h
index cdef185ff0..48bcadcc29 100644
--- a/platform/javascript/platform_config.h
+++ b/platform/javascript/platform_config.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/javascript/power_javascript.cpp b/platform/javascript/power_javascript.cpp
index 24158a34fe..bd4502fc2a 100644
--- a/platform/javascript/power_javascript.cpp
+++ b/platform/javascript/power_javascript.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/javascript/power_javascript.h b/platform/javascript/power_javascript.h
index 78a896c430..c7b853ce11 100644
--- a/platform/javascript/power_javascript.h
+++ b/platform/javascript/power_javascript.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/javascript/run_icon.png b/platform/javascript/run_icon.png
new file mode 100644
index 0000000000..dedee6f479
--- /dev/null
+++ b/platform/javascript/run_icon.png
Binary files differ
diff --git a/platform/osx/SCsub b/platform/osx/SCsub
index 1427c2e00d..27117c2e8d 100644
--- a/platform/osx/SCsub
+++ b/platform/osx/SCsub
@@ -7,7 +7,6 @@ files = [
'godot_main_osx.mm',
'audio_driver_osx.cpp',
'sem_osx.cpp',
- # 'context_gl_osx.cpp',
'dir_access_osx.mm',
'joypad_osx.cpp',
'power_osx.cpp',
diff --git a/platform/osx/audio_driver_osx.cpp b/platform/osx/audio_driver_osx.cpp
index 7ef0669656..d7a91b1653 100644
--- a/platform/osx/audio_driver_osx.cpp
+++ b/platform/osx/audio_driver_osx.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,11 +31,15 @@
#include "audio_driver_osx.h"
-Error AudioDriverOSX::init() {
+static OSStatus outputDeviceAddressCB(AudioObjectID inObjectID, UInt32 inNumberAddresses, const AudioObjectPropertyAddress *inAddresses, void *__nullable inClientData) {
+ AudioDriverOSX *driver = (AudioDriverOSX *)inClientData;
- active = false;
- channels = 2;
+ driver->reopen();
+ return noErr;
+}
+
+Error AudioDriverOSX::initDevice() {
AudioStreamBasicDescription strdesc;
strdesc.mFormatID = kAudioFormatLinearPCM;
strdesc.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked;
@@ -42,12 +47,10 @@ Error AudioDriverOSX::init() {
strdesc.mSampleRate = 44100;
strdesc.mFramesPerPacket = 1;
strdesc.mBitsPerChannel = 16;
- strdesc.mBytesPerFrame =
- strdesc.mBitsPerChannel * strdesc.mChannelsPerFrame / 8;
- strdesc.mBytesPerPacket =
- strdesc.mBytesPerFrame * strdesc.mFramesPerPacket;
+ strdesc.mBytesPerFrame = strdesc.mBitsPerChannel * strdesc.mChannelsPerFrame / 8;
+ strdesc.mBytesPerPacket = strdesc.mBytesPerFrame * strdesc.mFramesPerPacket;
- OSStatus result = noErr;
+ OSStatus result;
AURenderCallbackStruct callback;
AudioComponentDescription desc;
AudioComponent comp = NULL;
@@ -57,83 +60,130 @@ Error AudioDriverOSX::init() {
zeromem(&desc, sizeof(desc));
desc.componentType = kAudioUnitType_Output;
- desc.componentSubType = 0; /* !!! FIXME: ? */
- comp = AudioComponentFindNext(NULL, &desc);
+ desc.componentSubType = kAudioUnitSubType_HALOutput;
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
+ comp = AudioComponentFindNext(NULL, &desc);
+ ERR_FAIL_COND_V(comp == NULL, FAILED);
+
result = AudioComponentInstanceNew(comp, &audio_unit);
ERR_FAIL_COND_V(result != noErr, FAILED);
- ERR_FAIL_COND_V(comp == NULL, FAILED);
- result = AudioUnitSetProperty(audio_unit,
- kAudioUnitProperty_StreamFormat,
- scope, bus, &strdesc, sizeof(strdesc));
+ result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_StreamFormat, scope, bus, &strdesc, sizeof(strdesc));
ERR_FAIL_COND_V(result != noErr, FAILED);
zeromem(&callback, sizeof(AURenderCallbackStruct));
callback.inputProc = &AudioDriverOSX::output_callback;
callback.inputProcRefCon = this;
- result = AudioUnitSetProperty(audio_unit,
- kAudioUnitProperty_SetRenderCallback,
- scope, bus, &callback, sizeof(callback));
+ result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_SetRenderCallback, scope, bus, &callback, sizeof(callback));
ERR_FAIL_COND_V(result != noErr, FAILED);
result = AudioUnitInitialize(audio_unit);
ERR_FAIL_COND_V(result != noErr, FAILED);
- result = AudioOutputUnitStart(audio_unit);
+ return OK;
+}
+
+Error AudioDriverOSX::finishDevice() {
+ OSStatus result;
+
+ if (active) {
+ result = AudioOutputUnitStop(audio_unit);
+ ERR_FAIL_COND_V(result != noErr, FAILED);
+
+ active = false;
+ }
+
+ result = AudioUnitUninitialize(audio_unit);
+ ERR_FAIL_COND_V(result != noErr, FAILED);
+
+ return OK;
+}
+
+Error AudioDriverOSX::init() {
+ OSStatus result;
+
+ mutex = Mutex::create();
+ active = false;
+ channels = 2;
+
+ outputDeviceAddress.mSelector = kAudioHardwarePropertyDefaultOutputDevice;
+ outputDeviceAddress.mScope = kAudioObjectPropertyScopeGlobal;
+ outputDeviceAddress.mElement = kAudioObjectPropertyElementMaster;
+
+ result = AudioObjectAddPropertyListener(kAudioObjectSystemObject, &outputDeviceAddress, &outputDeviceAddressCB, this);
ERR_FAIL_COND_V(result != noErr, FAILED);
const int samples = 1024;
samples_in = memnew_arr(int32_t, samples); // whatever
buffer_frames = samples / channels;
- return OK;
+ return initDevice();
};
+Error AudioDriverOSX::reopen() {
+ Error err;
+ bool restart = false;
+
+ lock();
+
+ if (active) {
+ restart = true;
+ }
+
+ err = finishDevice();
+ if (err != OK) {
+ ERR_PRINT("finishDevice failed");
+ unlock();
+ return err;
+ }
+
+ err = initDevice();
+ if (err != OK) {
+ ERR_PRINT("initDevice failed");
+ unlock();
+ return err;
+ }
+
+ if (restart) {
+ start();
+ }
+
+ unlock();
+
+ return OK;
+}
+
OSStatus AudioDriverOSX::output_callback(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber, UInt32 inNumberFrames,
AudioBufferList *ioData) {
- AudioBuffer *abuf;
AudioDriverOSX *ad = (AudioDriverOSX *)inRefCon;
- bool mix = true;
-
- if (!ad->active)
- mix = false;
- else if (ad->mutex) {
- mix = ad->mutex->try_lock() == OK;
- };
-
- if (!mix) {
+ if (!ad->active || !ad->try_lock()) {
for (unsigned int i = 0; i < ioData->mNumberBuffers; i++) {
- abuf = &ioData->mBuffers[i];
+ AudioBuffer *abuf = &ioData->mBuffers[i];
zeromem(abuf->mData, abuf->mDataByteSize);
};
return 0;
};
- int frames_left;
-
for (unsigned int i = 0; i < ioData->mNumberBuffers; i++) {
- abuf = &ioData->mBuffers[i];
- frames_left = inNumberFrames;
+ AudioBuffer *abuf = &ioData->mBuffers[i];
+ int frames_left = inNumberFrames;
int16_t *out = (int16_t *)abuf->mData;
while (frames_left) {
int frames = MIN(frames_left, ad->buffer_frames);
- //ad->lock();
ad->audio_server_process(frames, ad->samples_in);
- //ad->unlock();
- for (int i = 0; i < frames * ad->channels; i++) {
+ for (int j = 0; j < frames * ad->channels; j++) {
- out[i] = ad->samples_in[i] >> 16;
+ out[j] = ad->samples_in[j] >> 16;
}
frames_left -= frames;
@@ -141,14 +191,20 @@ OSStatus AudioDriverOSX::output_callback(void *inRefCon,
};
};
- if (ad->mutex)
- ad->mutex->unlock();
+ ad->unlock();
return 0;
};
void AudioDriverOSX::start() {
- active = true;
+ if (!active) {
+ OSStatus result = AudioOutputUnitStart(audio_unit);
+ if (result != noErr) {
+ ERR_PRINT("AudioOutputUnitStart failed");
+ } else {
+ active = true;
+ }
+ }
};
int AudioDriverOSX::get_mix_rate() const {
@@ -160,29 +216,47 @@ AudioDriver::SpeakerMode AudioDriverOSX::get_speaker_mode() const {
};
void AudioDriverOSX::lock() {
- if (active && mutex)
+ if (mutex)
mutex->lock();
};
+
void AudioDriverOSX::unlock() {
- if (active && mutex)
+ if (mutex)
mutex->unlock();
};
+bool AudioDriverOSX::try_lock() {
+ if (mutex)
+ return mutex->try_lock() == OK;
+ return true;
+}
+
void AudioDriverOSX::finish() {
+ OSStatus result;
- if (active)
- AudioOutputUnitStop(audio_unit);
+ finishDevice();
- memdelete_arr(samples_in);
-};
+ result = AudioObjectRemovePropertyListener(kAudioObjectSystemObject, &outputDeviceAddress, &outputDeviceAddressCB, this);
+ if (result != noErr) {
+ ERR_PRINT("AudioObjectRemovePropertyListener failed");
+ }
-AudioDriverOSX::AudioDriverOSX() {
+ if (mutex) {
+ memdelete(mutex);
+ mutex = NULL;
+ }
- mutex = Mutex::create(); //NULL;
+ if (samples_in) {
+ memdelete_arr(samples_in);
+ samples_in = NULL;
+ }
};
-AudioDriverOSX::~AudioDriverOSX(){
-
+AudioDriverOSX::AudioDriverOSX() {
+ mutex = NULL;
+ samples_in = NULL;
};
+AudioDriverOSX::~AudioDriverOSX(){};
+
#endif
diff --git a/platform/osx/audio_driver_osx.h b/platform/osx/audio_driver_osx.h
index b030570a6e..287c9d6cbf 100644
--- a/platform/osx/audio_driver_osx.h
+++ b/platform/osx/audio_driver_osx.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,10 +35,12 @@
#include "servers/audio_server.h"
#include <AudioUnit/AudioUnit.h>
+#include <CoreAudio/AudioHardware.h>
class AudioDriverOSX : public AudioDriver {
AudioComponentInstance audio_unit;
+ AudioObjectPropertyAddress outputDeviceAddress;
bool active;
Mutex *mutex;
@@ -51,6 +54,9 @@ class AudioDriverOSX : public AudioDriver {
UInt32 inBusNumber, UInt32 inNumberFrames,
AudioBufferList *ioData);
+ Error initDevice();
+ Error finishDevice();
+
public:
const char *get_name() const {
return "AudioUnit";
@@ -64,6 +70,9 @@ public:
virtual void unlock();
virtual void finish();
+ bool try_lock();
+ Error reopen();
+
AudioDriverOSX();
~AudioDriverOSX();
};
diff --git a/platform/osx/detect.py b/platform/osx/detect.py
index b59dfe1afb..d9891dda61 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -1,4 +1,3 @@
-
import os
import sys
@@ -22,9 +21,7 @@ def can_build():
def get_opts():
return [
- ('force_64_bits', 'Force 64 bits binary', 'no'),
('osxcross_sdk', 'OSXCross SDK version', 'darwin14'),
-
]
@@ -36,36 +33,37 @@ def get_flags():
def configure(env):
- env.Append(CPPPATH=['#platform/osx'])
-
- if (env["bits"] == "default"):
- env["bits"] = "32"
+ ## Build type
if (env["target"] == "release"):
-
- env.Append(CCFLAGS=['-O2', '-ffast-math', '-fomit-frame-pointer', '-ftree-vectorize', '-msse2'])
+ env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-fomit-frame-pointer', '-ftree-vectorize', '-msse2'])
elif (env["target"] == "release_debug"):
-
- env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED'])
+ env.Prepend(CCFLAGS=['-O2', '-DDEBUG_ENABLED'])
elif (env["target"] == "debug"):
+ env.Prepend(CCFLAGS=['-g3', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
- env.Append(CCFLAGS=['-g3', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+ ## Architecture
- if (not os.environ.has_key("OSXCROSS_ROOT")):
- # regular native build
- if (env["bits"] == "64"):
- env.Append(CCFLAGS=['-arch', 'x86_64'])
- env.Append(LINKFLAGS=['-arch', 'x86_64'])
+ is64 = sys.maxsize > 2**32
+ if (env["bits"] == "default"):
+ env["bits"] = "64" if is64 else "32"
+
+ ## Compiler configuration
+
+ if (not os.environ.has_key("OSXCROSS_ROOT")): # regular native build
+ if (env["bits"] == "fat"):
+ env.Append(CCFLAGS=['-arch', 'i386', '-arch', 'x86_64'])
+ env.Append(LINKFLAGS=['-arch', 'i386', '-arch', 'x86_64'])
elif (env["bits"] == "32"):
env.Append(CCFLAGS=['-arch', 'i386'])
env.Append(LINKFLAGS=['-arch', 'i386'])
- else:
- env.Append(CCFLAGS=['-arch', 'i386', '-arch', 'x86_64'])
- env.Append(LINKFLAGS=['-arch', 'i386', '-arch', 'x86_64'])
- else:
- # osxcross build
+ else: # 64-bit, default
+ env.Append(CCFLAGS=['-arch', 'x86_64'])
+ env.Append(LINKFLAGS=['-arch', 'x86_64'])
+
+ else: # osxcross build
root = os.environ.get("OSXCROSS_ROOT", 0)
if env["bits"] == "64":
basecmd = root + "/target/bin/x86_64-apple-" + env["osxcross_sdk"] + "-"
@@ -78,26 +76,22 @@ def configure(env):
env['RANLIB'] = basecmd + "ranlib"
env['AS'] = basecmd + "as"
- env.Append(CPPFLAGS=["-DAPPLE_STYLE_KEYS"])
- env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DOSX_ENABLED'])
- env.Append(CPPFLAGS=["-mmacosx-version-min=10.9"])
- env.Append(LIBS=['pthread'])
- #env.Append(CPPFLAGS=['-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks', '-isysroot', '/Developer/SDKs/MacOSX10.4u.sdk', '-mmacosx-version-min=10.4'])
- #env.Append(LINKFLAGS=['-mmacosx-version-min=10.4', '-isysroot', '/Developer/SDKs/MacOSX10.4u.sdk', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk'])
- env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'OpenGL', '-framework', 'AGL', '-framework', 'AudioUnit', '-lz', '-framework', 'IOKit', '-framework', 'ForceFeedback'])
- env.Append(LINKFLAGS=["-mmacosx-version-min=10.9"])
-
if (env["CXX"] == "clang++"):
env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
env["CC"] = "clang"
env["LD"] = "clang++"
- import methods
+ ## Dependencies
+
+ if (env['builtin_libtheora'] != 'no'):
+ env["x86_libtheora_opt_gcc"] = True
- env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')})
- #env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } )
+ ## Flags
+
+ env.Append(CPPPATH=['#platform/osx'])
+ env.Append(CPPFLAGS=['-DOSX_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DAPPLE_STYLE_KEYS'])
+ env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'OpenGL', '-framework', 'AGL', '-framework', 'AudioUnit', '-framework', 'CoreAudio', '-lz', '-framework', 'IOKit', '-framework', 'ForceFeedback'])
+ env.Append(LIBS=['pthread'])
- env["x86_libtheora_opt_gcc"] = True
-
+ env.Append(CPPFLAGS=['-mmacosx-version-min=10.9'])
+ env.Append(LINKFLAGS=['-mmacosx-version-min=10.9'])
diff --git a/platform/osx/dir_access_osx.h b/platform/osx/dir_access_osx.h
index 56a8e057dd..6dcff3898c 100644
--- a/platform/osx/dir_access_osx.h
+++ b/platform/osx/dir_access_osx.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/osx/dir_access_osx.mm b/platform/osx/dir_access_osx.mm
index 476da2635e..37ba0e6b19 100644
--- a/platform/osx/dir_access_osx.mm
+++ b/platform/osx/dir_access_osx.mm
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,17 +35,14 @@
#include <Foundation/NSString.h>
-
-String DirAccessOSX::fix_unicode_name(const char* p_name) const {
+String DirAccessOSX::fix_unicode_name(const char *p_name) const {
String fname;
- NSString* nsstr = [[NSString stringWithUTF8String: p_name] precomposedStringWithCanonicalMapping];
+ NSString *nsstr = [[NSString stringWithUTF8String:p_name] precomposedStringWithCanonicalMapping];
fname.parse_utf8([nsstr UTF8String]);
return fname;
}
-
-
#endif //posix_enabled
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index ba4ef0300c..03f424de8d 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,521 +27,671 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "export.h"
#include "editor/editor_export.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
-#include "global_config.h"
#include "io/marshalls.h"
#include "io/resource_saver.h"
#include "io/zip_io.h"
#include "os/file_access.h"
#include "os/os.h"
-#include "platform/osx/logo.h"
+#include "platform/osx/logo.gen.h"
+#include "project_settings.h"
#include "string.h"
#include "version.h"
-#if 0
+#include <sys/stat.h>
class EditorExportPlatformOSX : public EditorExportPlatform {
- GDCLASS( EditorExportPlatformOSX,EditorExportPlatform );
-
- String custom_release_package;
- String custom_debug_package;
-
- enum BitsMode {
- BITS_FAT,
- BITS_64,
- BITS_32
- };
+ GDCLASS(EditorExportPlatformOSX, EditorExportPlatform);
int version_code;
- String app_name;
- String info;
- String icon;
- String identifier;
- String short_version;
- String version;
- String signature;
- String copyright;
- BitsMode bits_mode;
- bool high_resolution;
-
Ref<ImageTexture> logo;
- void _fix_plist(Vector<uint8_t>& plist, const String &p_binary);
- void _make_icon(const Image& p_icon,Vector<uint8_t>& data);
-
+ void _fix_plist(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &plist, const String &p_binary);
+ void _make_icon(const Ref<Image> &p_icon, Vector<uint8_t> &p_data);
+#ifdef OSX_ENABLED
+ Error _code_sign(const Ref<EditorExportPreset> &p_preset, const String &p_path);
+ Error _create_dmg(const String &p_dmg_path, const String &p_pkg_name, const String &p_app_path_name);
+#endif
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;
+ virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features);
+ virtual void get_export_options(List<ExportOption> *r_options);
public:
-
virtual String get_name() const { return "Mac OSX"; }
- virtual ImageCompression get_image_compression() const { return IMAGE_COMPRESSION_BC; }
+ virtual String get_os_name() const { return "OSX"; }
virtual Ref<Texture> get_logo() const { return logo; }
+#ifdef OSX_ENABLED
+ virtual String get_binary_extension() const { return "dmg"; }
+#else
+ virtual String get_binary_extension() const { return "zip"; }
+#endif
+ virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 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 String(); }
- virtual String get_device_info(int p_device) const { return String(); }
- virtual Error run(int p_device,int p_flags=0);
+ virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const;
- virtual bool requires_password(bool p_debug) const { return false; }
- virtual String get_binary_extension() const { return "zip"; }
- virtual Error export_project(const String& p_path,bool p_debug,int p_flags=0);
+ virtual void get_platform_features(List<String> *r_features) {
- virtual bool can_export(String *r_error=NULL) const;
+ r_features->push_back("pc");
+ r_features->push_back("s3tc");
+ r_features->push_back("OSX");
+ }
EditorExportPlatformOSX();
~EditorExportPlatformOSX();
};
-bool EditorExportPlatformOSX::_set(const StringName& p_name, const Variant& p_value) {
-
- String n=p_name;
-
- if (n=="custom_package/debug")
- custom_debug_package=p_value;
- else if (n=="custom_package/release")
- custom_release_package=p_value;
- else if (n=="application/name")
- app_name=p_value;
- else if (n=="application/info")
- info=p_value;
- else if (n=="application/icon")
- icon=p_value;
- else if (n=="application/identifier")
- identifier=p_value;
- else if (n=="application/signature")
- signature=p_value;
- else if (n=="application/short_version")
- short_version=p_value;
- else if (n=="application/version")
- version=p_value;
- else if (n=="application/copyright")
- copyright=p_value;
- else if (n=="application/bits_mode")
- bits_mode=BitsMode(int(p_value));
- else if (n=="display/high_res")
- high_resolution=p_value;
- else
- return false;
-
- return true;
-}
-
-bool EditorExportPlatformOSX::_get(const StringName& p_name,Variant &r_ret) const{
-
- String n=p_name;
-
- if (n=="custom_package/debug")
- r_ret=custom_debug_package;
- else if (n=="custom_package/release")
- r_ret=custom_release_package;
- else if (n=="application/name")
- r_ret=app_name;
- else if (n=="application/info")
- r_ret=info;
- else if (n=="application/icon")
- r_ret=icon;
- else if (n=="application/identifier")
- r_ret=identifier;
- else if (n=="application/signature")
- r_ret=signature;
- else if (n=="application/short_version")
- r_ret=short_version;
- else if (n=="application/version")
- r_ret=version;
- else if (n=="application/copyright")
- r_ret=copyright;
- else if (n=="application/bits_mode")
- r_ret=bits_mode;
- else if (n=="display/high_res")
- r_ret=high_resolution;
- else
- return false;
+void EditorExportPlatformOSX::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) {
- return true;
+ // what does this need to do?
}
-void EditorExportPlatformOSX::_get_property_list( List<PropertyInfo> *p_list) const{
-
- p_list->push_back( PropertyInfo( Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE,"zip"));
- p_list->push_back( PropertyInfo( Variant::STRING, "custom_package/release", PROPERTY_HINT_GLOBAL_FILE,"zip"));
-
- p_list->push_back( PropertyInfo( Variant::STRING, "application/name") );
- p_list->push_back( PropertyInfo( Variant::STRING, "application/info") );
- p_list->push_back( PropertyInfo( Variant::STRING, "application/icon",PROPERTY_HINT_FILE,"png") );
- p_list->push_back( PropertyInfo( Variant::STRING, "application/identifier") );
- p_list->push_back( PropertyInfo( Variant::STRING, "application/signature") );
- p_list->push_back( PropertyInfo( Variant::STRING, "application/short_version") );
- p_list->push_back( PropertyInfo( Variant::STRING, "application/version") );
- p_list->push_back( PropertyInfo( Variant::STRING, "application/copyright") );
- p_list->push_back( PropertyInfo( Variant::INT, "application/bits_mode", PROPERTY_HINT_ENUM, "Fat (32 & 64 bits),64 bits,32 bits") );
- p_list->push_back( PropertyInfo( Variant::BOOL, "display/high_res") );
+void EditorExportPlatformOSX::get_export_options(List<ExportOption> *r_options) {
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/release", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/name"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/info"), "Made with Godot Engine"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "png"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/identifier"), "org.godotengine.macgame"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/signature"), "godotmacgame"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/short_version"), "1.0"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version"), "1.0"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/bits_mode", PROPERTY_HINT_ENUM, "Fat (32 & 64 bits),64 bits,32 bits"), 0));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "display/high_res"), false));
+
+#ifdef OSX_ENABLED
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/identity"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/entitlements"), ""));
+#endif
}
-void EditorExportPlatformOSX::_make_icon(const Image& p_icon,Vector<uint8_t>& icon) {
+void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_t> &p_data) {
-
- Ref<ImageTexture> it = memnew( ImageTexture );
- int size=512;
+ Ref<ImageTexture> it = memnew(ImageTexture);
+ int size = 512;
Vector<uint8_t> data;
data.resize(8);
- data[0]='i';
- data[1]='c';
- data[2]='n';
- data[3]='s';
+ data[0] = 'i';
+ data[1] = 'c';
+ data[2] = 'n';
+ data[3] = 's';
- const char *name[]={"ic09","ic08","ic07","icp6","icp5","icp4"};
- int index=0;
+ const char *name[] = { "ic09", "ic08", "ic07", "icp6", "icp5", "icp4" };
+ int index = 0;
- while(size>=16) {
+ while (size >= 16) {
- Image copy = p_icon;
- copy.convert(Image::FORMAT_RGBA8);
- copy.resize(size,size);
+ Ref<Image> copy = p_icon; // does this make sense? doesn't this just increase the reference count instead of making a copy? Do we even need a copy?
+ copy->convert(Image::FORMAT_RGBA8);
+ copy->resize(size, size);
it->create_from_image(copy);
- String path = EditorSettings::get_singleton()->get_settings_path()+"/tmp/icon.png";
- ResourceSaver::save(path,it);
+ String path = EditorSettings::get_singleton()->get_settings_path() + "/tmp/icon.png";
+ ResourceSaver::save(path, it);
- FileAccess *f = FileAccess::open(path,FileAccess::READ);
+ FileAccess *f = FileAccess::open(path, FileAccess::READ);
ERR_FAIL_COND(!f);
int ofs = data.size();
uint32_t len = f->get_len();
- data.resize(data.size()+len+8);
- f->get_buffer(&data[ofs+8],len);
+ data.resize(data.size() + len + 8);
+ f->get_buffer(&data[ofs + 8], len);
memdelete(f);
- len+=8;
- len=BSWAP32(len);
- copymem(&data[ofs],name[index],4);
- encode_uint32(len,&data[ofs+4]);
+ len += 8;
+ len = BSWAP32(len);
+ copymem(&data[ofs], name[index], 4);
+ encode_uint32(len, &data[ofs + 4]);
index++;
- size/=2;
+ size /= 2;
}
uint32_t total_len = data.size();
total_len = BSWAP32(total_len);
- encode_uint32(total_len,&data[4]);
+ encode_uint32(total_len, &data[4]);
- icon=data;
+ p_data = data;
}
-
-void EditorExportPlatformOSX::_fix_plist(Vector<uint8_t>& plist,const String& p_binary) {
-
+void EditorExportPlatformOSX::_fix_plist(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &plist, const String &p_binary) {
String str;
String strnew;
- str.parse_utf8((const char*)plist.ptr(),plist.size());
- Vector<String> lines=str.split("\n");
- for(int i=0;i<lines.size();i++) {
- if (lines[i].find("$binary")!=-1) {
- strnew+=lines[i].replace("$binary",p_binary)+"\n";
- } else if (lines[i].find("$name")!=-1) {
- strnew+=lines[i].replace("$name",p_binary)+"\n";
- } else if (lines[i].find("$info")!=-1) {
- strnew+=lines[i].replace("$info",info)+"\n";
- } else if (lines[i].find("$identifier")!=-1) {
- strnew+=lines[i].replace("$identifier",identifier)+"\n";
- } else if (lines[i].find("$short_version")!=-1) {
- strnew+=lines[i].replace("$short_version",short_version)+"\n";
- } else if (lines[i].find("$version")!=-1) {
- strnew+=lines[i].replace("$version",version)+"\n";
- } else if (lines[i].find("$signature")!=-1) {
- strnew+=lines[i].replace("$signature",signature)+"\n";
- } else if (lines[i].find("$copyright")!=-1) {
- strnew+=lines[i].replace("$copyright",copyright)+"\n";
- } else if (lines[i].find("$highres")!=-1) {
- strnew+=lines[i].replace("$highres",high_resolution?"<true/>":"<false/>")+"\n";
+ str.parse_utf8((const char *)plist.ptr(), plist.size());
+ Vector<String> lines = str.split("\n");
+ for (int i = 0; i < lines.size(); i++) {
+ if (lines[i].find("$binary") != -1) {
+ strnew += lines[i].replace("$binary", p_binary) + "\n";
+ } else if (lines[i].find("$name") != -1) {
+ strnew += lines[i].replace("$name", p_binary) + "\n";
+ } else if (lines[i].find("$info") != -1) {
+ strnew += lines[i].replace("$info", p_preset->get("application/info")) + "\n";
+ } else if (lines[i].find("$identifier") != -1) {
+ strnew += lines[i].replace("$identifier", p_preset->get("application/identifier")) + "\n";
+ } else if (lines[i].find("$short_version") != -1) {
+ strnew += lines[i].replace("$short_version", p_preset->get("application/short_version")) + "\n";
+ } else if (lines[i].find("$version") != -1) {
+ strnew += lines[i].replace("$version", p_preset->get("application/version")) + "\n";
+ } else if (lines[i].find("$signature") != -1) {
+ strnew += lines[i].replace("$signature", p_preset->get("application/signature")) + "\n";
+ } else if (lines[i].find("$copyright") != -1) {
+ strnew += lines[i].replace("$copyright", p_preset->get("application/copyright")) + "\n";
+ } else if (lines[i].find("$highres") != -1) {
+ strnew += lines[i].replace("$highres", p_preset->get("display/high_res") ? "<true/>" : "<false/>") + "\n";
} else {
- strnew+=lines[i]+"\n";
+ strnew += lines[i] + "\n";
}
}
CharString cs = strnew.utf8();
- plist.resize(cs.size());
- for(int i=9;i<cs.size();i++) {
- plist[i]=cs[i];
+ plist.resize(cs.size() - 1);
+ for (int i = 0; i < cs.size() - 1; i++) {
+ plist[i] = cs[i];
}
}
-Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug, int p_flags) {
+#ifdef OSX_ENABLED
+/**
+ If we're running the OSX version of the Godot editor we'll:
+ - export our application bundle to a temporary folder
+ - attempt to code sign it
+ - and then wrap it up in a DMG
+**/
+
+Error EditorExportPlatformOSX::_code_sign(const Ref<EditorExportPreset> &p_preset, const String &p_path) {
+ List<String> args;
+ if (p_preset->get("codesign/entitlements") != "") {
+ /* this should point to our entitlements.plist file that sandboxes our application, I don't know if this should also be placed in our app bundle */
+ args.push_back("-entitlements");
+ args.push_back(p_preset->get("codesign/entitlements"));
+ }
+ args.push_back("-s");
+ args.push_back(p_preset->get("codesign/identity"));
+ args.push_back("-v"); /* provide some more feedback */
+ args.push_back(p_path);
+ Error err = OS::get_singleton()->execute("/usr/bin/codesign", args, true);
+ ERR_FAIL_COND_V(err, err);
+
+ return OK;
+}
+
+Error EditorExportPlatformOSX::_create_dmg(const String &p_dmg_path, const String &p_pkg_name, const String &p_app_path_name) {
+ List<String> args;
+ args.push_back("create");
+ args.push_back(p_dmg_path);
+ args.push_back("-volname");
+ args.push_back(p_pkg_name);
+ args.push_back("-fs");
+ args.push_back("HFS+");
+ args.push_back("-srcfolder");
+ args.push_back(p_app_path_name);
+ Error err = OS::get_singleton()->execute("/usr/bin/hdiutil", args, true);
+ ERR_FAIL_COND_V(err, err);
- String src_pkg;
+ return OK;
+}
- EditorProgress ep("export","Exporting for OSX",104);
+Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
+ String src_pkg_name;
+
+ EditorProgress ep("export", "Exporting for OSX", 3);
if (p_debug)
- src_pkg=custom_debug_package;
+ src_pkg_name = p_preset->get("custom_package/debug");
else
- src_pkg=custom_release_package;
+ src_pkg_name = p_preset->get("custom_package/release");
- if (src_pkg=="") {
+ if (src_pkg_name == "") {
String err;
- src_pkg=find_export_template("osx.zip", &err);
- if (src_pkg=="") {
+ src_pkg_name = find_export_template("osx.zip", &err);
+ if (src_pkg_name == "") {
EditorNode::add_io_error(err);
return ERR_FILE_NOT_FOUND;
}
}
-
- FileAccess *src_f=NULL;
+ FileAccess *src_f = NULL;
zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
- ep.step("Creating app",0);
+ ep.step("Creating app", 0);
- unzFile pkg = unzOpen2(src_pkg.utf8().get_data(), &io);
- if (!pkg) {
+ unzFile src_pkg_zip = unzOpen2(src_pkg_name.utf8().get_data(), &io);
+ if (!src_pkg_zip) {
- EditorNode::add_io_error("Could not find template app to export:\n"+src_pkg);
+ EditorNode::add_io_error("Could not find template app to export:\n" + src_pkg_name);
return ERR_FILE_NOT_FOUND;
}
- ERR_FAIL_COND_V(!pkg, ERR_CANT_OPEN);
- int ret = unzGoToFirstFile(pkg);
+ ERR_FAIL_COND_V(!src_pkg_zip, ERR_CANT_OPEN);
+ int ret = unzGoToFirstFile(src_pkg_zip);
+
+ String binary_to_use = "godot_osx_" + String(p_debug ? "debug" : "release") + ".";
+ int bits_mode = p_preset->get("application/bits_mode");
+ binary_to_use += String(bits_mode == 0 ? "fat" : bits_mode == 1 ? "64" : "32");
+
+ print_line("binary: " + binary_to_use);
+ String pkg_name;
+ if (p_preset->get("application/name") != "")
+ pkg_name = p_preset->get("application/name"); // app_name
+ else if (String(ProjectSettings::get_singleton()->get("application/config/name")) != "")
+ pkg_name = String(ProjectSettings::get_singleton()->get("application/config/name"));
+ else
+ pkg_name = "Unnamed";
+
+ // We're on OSX so we can export to DMG, but first we create our application bundle
+ String tmp_app_path_name = p_path.get_base_dir() + "/" + pkg_name + ".app";
+ print_line("Exporting to " + tmp_app_path_name);
+ DirAccess *tmp_app_path = DirAccess::create_for_path(tmp_app_path_name);
+ ERR_FAIL_COND_V(!tmp_app_path, ERR_CANT_CREATE)
+
+ ///@TODO We should delete the existing application bundle especially if we attempt to code sign it, but what is a safe way to do this? Maybe call system function so it moves to trash?
+ // tmp_app_path->erase_contents_recursive();
+
+ // Create our folder structure or rely on unzip?
+ print_line("Creating " + tmp_app_path_name + "/Contents/MacOS");
+ Error dir_err = tmp_app_path->make_dir_recursive(tmp_app_path_name + "/Contents/MacOS");
+ ERR_FAIL_COND_V(dir_err, ERR_CANT_CREATE)
+ print_line("Creating " + tmp_app_path_name + "/Contents/Resources");
+ dir_err = tmp_app_path->make_dir_recursive(tmp_app_path_name + "/Contents/Resources");
+ ERR_FAIL_COND_V(dir_err, ERR_CANT_CREATE)
+
+ /* Now process our template */
+ bool found_binary = false;
+ int total_size = 0;
+
+ while (ret == UNZ_OK) {
+ bool is_execute = false;
+
+ //get filename
+ unz_file_info info;
+ char fname[16384];
+ ret = unzGetCurrentFileInfo(src_pkg_zip, &info, fname, 16384, NULL, 0, NULL, 0);
+
+ String file = fname;
+
+ print_line("READ: " + file);
+ Vector<uint8_t> data;
+ data.resize(info.uncompressed_size);
+
+ //read
+ unzOpenCurrentFile(src_pkg_zip);
+ unzReadCurrentFile(src_pkg_zip, data.ptr(), data.size());
+ unzCloseCurrentFile(src_pkg_zip);
+
+ //write
+
+ file = file.replace_first("osx_template.app/", "");
+
+ if (file == "Contents/Info.plist") {
+ print_line("parse plist");
+ _fix_plist(p_preset, data, pkg_name);
+ }
+
+ if (file.begins_with("Contents/MacOS/godot_")) {
+ if (file != "Contents/MacOS/" + binary_to_use) {
+ ret = unzGoToNextFile(src_pkg_zip);
+ continue; //ignore!
+ }
+ found_binary = true;
+ is_execute = true;
+ file = "Contents/MacOS/" + pkg_name;
+ }
+
+ if (file == "Contents/Resources/icon.icns") {
+ //see if there is an icon
+ String iconpath;
+ if (p_preset->get("application/icon") != "")
+ iconpath = p_preset->get("application/icon");
+ else
+ iconpath = ProjectSettings::get_singleton()->get("application/config/icon");
+ print_line("icon? " + iconpath);
+ if (iconpath != "") {
+ Ref<Image> icon;
+ icon.instance();
+ icon->load(iconpath);
+ if (!icon->empty()) {
+ print_line("loaded?");
+ _make_icon(icon, data);
+ }
+ }
+ //bleh?
+ }
+
+ if (data.size() > 0) {
+ print_line("ADDING: " + file + " size: " + itos(data.size()));
+ total_size += data.size();
+
+ /* write it into our application bundle */
+ file = tmp_app_path_name + "/" + file;
+
+ /* write the file, need to add chmod */
+ FileAccess *f = FileAccess::open(file, FileAccess::WRITE);
+ ERR_FAIL_COND_V(!f, ERR_CANT_CREATE)
+ f->store_buffer(data.ptr(), data.size());
+ f->close();
+ memdelete(f);
+
+ if (is_execute) {
+ // we need execute rights on this file
+ chmod(file.utf8().get_data(), 0755);
+ } else {
+ // seems to already be set correctly
+ // chmod(file.utf8().get_data(), 0644);
+ }
+ }
+
+ ret = unzGoToNextFile(src_pkg_zip);
+ }
+
+ /* we're done with our source zip */
+ unzClose(src_pkg_zip);
+
+ if (!found_binary) {
+ ERR_PRINTS("Requested template binary '" + binary_to_use + "' not found. It might be missing from your template archive.");
+ unzClose(src_pkg_zip);
+ return ERR_FILE_NOT_FOUND;
+ }
+
+ ep.step("Making PKG", 1);
+
+ String pack_path = tmp_app_path_name + "/Contents/Resources/" + pkg_name + ".pck";
+ Error err = save_pack(p_preset, pack_path);
+ // chmod(pack_path.utf8().get_data(), 0644);
+
+ if (err) {
+ return err;
+ }
+
+ /* see if we can code sign our new package */
+ if (p_preset->get("codesign/identity") != "") {
+ ep.step("Code signing bundle", 2);
+
+ /* the order in which we code sign is important, this is a bit of a shame or we could do this in our loop that extracts the files from our ZIP */
+
+ // start with our application
+ err = _code_sign(p_preset, tmp_app_path_name + "/Contents/MacOS/" + pkg_name);
+ ERR_FAIL_COND_V(err, err);
+
+ ///@TODO we should check the contents of /Contents/Frameworks for frameworks to sign
+
+ // we should probably loop through all resources and sign them?
+ err = _code_sign(p_preset, tmp_app_path_name + "/Contents/Resources/icon.icns");
+ ERR_FAIL_COND_V(err, err);
+ err = _code_sign(p_preset, pack_path);
+ ERR_FAIL_COND_V(err, err);
+ err = _code_sign(p_preset, tmp_app_path_name + "/Contents/Info.plist");
+ ERR_FAIL_COND_V(err, err);
+ }
+
+ /* and finally create a DMG */
+ ep.step("Making DMG", 3);
+ err = _create_dmg(p_path, pkg_name, tmp_app_path_name);
+ ERR_FAIL_COND_V(err, err);
+
+ return OK;
+}
+
+#else
+
+/**
+ When exporting for OSX from any other platform we don't have access to code signing or creating DMGs so we'll wrap the bundle into a zip file.
+
+ Should probably find a nicer way to have just one export method instead of duplicating the method like this but I would the code got very
+ messy with switches inside of it.
+**/
+Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
+
+ String src_pkg_name;
+
+ EditorProgress ep("export", "Exporting for OSX", 104);
+
+ if (p_debug)
+ src_pkg_name = p_preset->get("custom_package/debug");
+ else
+ src_pkg_name = p_preset->get("custom_package/release");
+
+ if (src_pkg_name == "") {
+ String err;
+ src_pkg_name = find_export_template("osx.zip", &err);
+ if (src_pkg_name == "") {
+ EditorNode::add_io_error(err);
+ return ERR_FILE_NOT_FOUND;
+ }
+ }
+
+ FileAccess *src_f = NULL;
+ zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
+
+ ep.step("Creating app", 0);
- zlib_filefunc_def io2=io;
- FileAccess *dst_f=NULL;
- io2.opaque=&dst_f;
- zipFile dpkg=zipOpen2(p_path.utf8().get_data(),APPEND_STATUS_CREATE,NULL,&io2);
+ unzFile src_pkg_zip = unzOpen2(src_pkg_name.utf8().get_data(), &io);
+ if (!src_pkg_zip) {
+
+ EditorNode::add_io_error("Could not find template app to export:\n" + src_pkg_name);
+ return ERR_FILE_NOT_FOUND;
+ }
+
+ ERR_FAIL_COND_V(!src_pkg_zip, ERR_CANT_OPEN);
+ int ret = unzGoToFirstFile(src_pkg_zip);
String binary_to_use = "godot_osx_" + String(p_debug ? "debug" : "release") + ".";
- binary_to_use += String(bits_mode==BITS_FAT ? "fat" : bits_mode==BITS_64 ? "64" : "32");
+ int bits_mode = p_preset->get("application/bits_mode");
+ binary_to_use += String(bits_mode == 0 ? "fat" : bits_mode == 1 ? "64" : "32");
- print_line("binary: "+binary_to_use);
+ print_line("binary: " + binary_to_use);
String pkg_name;
- if (app_name!="")
- pkg_name=app_name;
- else if (String(GlobalConfig::get_singleton()->get("application/name"))!="")
- pkg_name=String(GlobalConfig::get_singleton()->get("application/name"));
+ if (p_preset->get("application/name") != "")
+ pkg_name = p_preset->get("application/name"); // app_name
+ else if (String(ProjectSettings::get_singleton()->get("application/config/name")) != "")
+ pkg_name = String(ProjectSettings::get_singleton()->get("application/config/name"));
else
- pkg_name="Unnamed";
+ pkg_name = "Unnamed";
+ /* Open our destination zip file */
+ zlib_filefunc_def io2 = io;
+ FileAccess *dst_f = NULL;
+ io2.opaque = &dst_f;
+ zipFile dst_pkg_zip = zipOpen2(p_path.utf8().get_data(), APPEND_STATUS_CREATE, NULL, &io2);
bool found_binary = false;
- while(ret==UNZ_OK) {
+ while (ret == UNZ_OK) {
//get filename
unz_file_info info;
char fname[16384];
- ret = unzGetCurrentFileInfo(pkg,&info,fname,16384,NULL,0,NULL,0);
+ ret = unzGetCurrentFileInfo(src_pkg_zip, &info, fname, 16384, NULL, 0, NULL, 0);
- String file=fname;
+ String file = fname;
- print_line("READ: "+file);
+ print_line("READ: " + file);
Vector<uint8_t> data;
data.resize(info.uncompressed_size);
//read
- unzOpenCurrentFile(pkg);
- unzReadCurrentFile(pkg,data.ptr(),data.size());
- unzCloseCurrentFile(pkg);
+ unzOpenCurrentFile(src_pkg_zip);
+ unzReadCurrentFile(src_pkg_zip, data.ptr(), data.size());
+ unzCloseCurrentFile(src_pkg_zip);
//write
- file = file.replace_first("osx_template.app/","");
-
+ file = file.replace_first("osx_template.app/", "");
- if (file=="Contents/Info.plist") {
+ if (file == "Contents/Info.plist") {
print_line("parse plist");
- _fix_plist(data,pkg_name);
+ _fix_plist(p_preset, data, pkg_name);
}
if (file.begins_with("Contents/MacOS/godot_")) {
- if (file!="Contents/MacOS/"+binary_to_use) {
- ret = unzGoToNextFile(pkg);
+ if (file != "Contents/MacOS/" + binary_to_use) {
+ ret = unzGoToNextFile(src_pkg_zip);
continue; //ignore!
}
found_binary = true;
- file="Contents/MacOS/"+pkg_name;
+ file = "Contents/MacOS/" + pkg_name;
}
- if (file=="Contents/Resources/icon.icns") {
+ if (file == "Contents/Resources/icon.icns") {
//see if there is an icon
- String iconpath = GlobalConfig::get_singleton()->get("application/icon");
- print_line("icon? "+iconpath);
- if (iconpath!="") {
- Image icon;
- icon.load(iconpath);
- if (!icon.empty()) {
+ String iconpath;
+ if (p_preset->get("application/icon") != "")
+ iconpath = p_preset->get("application/icon");
+ else
+ iconpath = ProjectSettings::get_singleton()->get("application/config/icon");
+ print_line("icon? " + iconpath);
+ if (iconpath != "") {
+ Ref<Image> icon;
+ icon.instance();
+ icon->load(iconpath);
+ if (!icon->empty()) {
print_line("loaded?");
- _make_icon(icon,data);
+ _make_icon(icon, data);
}
}
//bleh?
}
- file=pkg_name+".app/"+file;
+ if (data.size() > 0) {
+ print_line("ADDING: " + file + " size: " + itos(data.size()));
- if (data.size()>0) {
- print_line("ADDING: "+file+" size: "+itos(data.size()));
+ /* add it to our zip file */
+ file = pkg_name + ".app/" + file;
zip_fileinfo fi;
- fi.tmz_date.tm_hour=info.tmu_date.tm_hour;
- fi.tmz_date.tm_min=info.tmu_date.tm_min;
- fi.tmz_date.tm_sec=info.tmu_date.tm_sec;
- fi.tmz_date.tm_mon=info.tmu_date.tm_mon;
- fi.tmz_date.tm_mday=info.tmu_date.tm_mday;
- fi.tmz_date.tm_year=info.tmu_date.tm_year;
- fi.dosDate=info.dosDate;
- fi.internal_fa=info.internal_fa;
- fi.external_fa=info.external_fa;
-
- int err = zipOpenNewFileInZip(dpkg,
- file.utf8().get_data(),
- &fi,
- NULL,
- 0,
- NULL,
- 0,
- NULL,
- Z_DEFLATED,
- Z_DEFAULT_COMPRESSION);
-
- print_line("OPEN ERR: "+itos(err));
- err = zipWriteInFileInZip(dpkg,data.ptr(),data.size());
- print_line("WRITE ERR: "+itos(err));
- zipCloseFileInZip(dpkg);
+ fi.tmz_date.tm_hour = info.tmu_date.tm_hour;
+ fi.tmz_date.tm_min = info.tmu_date.tm_min;
+ fi.tmz_date.tm_sec = info.tmu_date.tm_sec;
+ fi.tmz_date.tm_mon = info.tmu_date.tm_mon;
+ fi.tmz_date.tm_mday = info.tmu_date.tm_mday;
+ fi.tmz_date.tm_year = info.tmu_date.tm_year;
+ fi.dosDate = info.dosDate;
+ fi.internal_fa = info.internal_fa;
+ fi.external_fa = info.external_fa;
+
+ int err = zipOpenNewFileInZip(dst_pkg_zip,
+ file.utf8().get_data(),
+ &fi,
+ NULL,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ Z_DEFLATED,
+ Z_DEFAULT_COMPRESSION);
+
+ print_line("OPEN ERR: " + itos(err));
+ err = zipWriteInFileInZip(dst_pkg_zip, data.ptr(), data.size());
+ print_line("WRITE ERR: " + itos(err));
+ zipCloseFileInZip(dst_pkg_zip);
}
- ret = unzGoToNextFile(pkg);
+ ret = unzGoToNextFile(src_pkg_zip);
}
if (!found_binary) {
- ERR_PRINTS("Requested template binary '"+binary_to_use+"' not found. It might be missing from your template archive.");
- zipClose(dpkg,NULL);
- unzClose(pkg);
+ ERR_PRINTS("Requested template binary '" + binary_to_use + "' not found. It might be missing from your template archive.");
+ zipClose(dst_pkg_zip, NULL);
+ unzClose(src_pkg_zip);
return ERR_FILE_NOT_FOUND;
}
+ ep.step("Making PKG", 1);
- ep.step("Making PKG",1);
-
- String pack_path=EditorSettings::get_singleton()->get_settings_path()+"/tmp/data.pck";
- FileAccess *pfs = FileAccess::open(pack_path,FileAccess::WRITE);
- Error err = save_pack(pfs);
- memdelete(pfs);
+ String pack_path = EditorSettings::get_singleton()->get_settings_path() + "/tmp/" + pkg_name + ".pck";
+ Error err = save_pack(p_preset, pack_path);
if (err) {
- zipClose(dpkg,NULL);
- unzClose(pkg);
+ zipClose(dst_pkg_zip, NULL);
+ unzClose(src_pkg_zip);
return err;
-
}
{
//write datapack
- zipOpenNewFileInZip(dpkg,
- (pkg_name+".app/Contents/Resources/data.pck").utf8().get_data(),
- NULL,
- NULL,
- 0,
- NULL,
- 0,
- NULL,
- Z_DEFLATED,
- Z_DEFAULT_COMPRESSION);
-
+ zipOpenNewFileInZip(dst_pkg_zip,
+ (pkg_name + ".app/Contents/Resources/" + pkg_name + ".pck").utf8().get_data(),
+ NULL,
+ NULL,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ Z_DEFLATED,
+ Z_DEFAULT_COMPRESSION);
- FileAccess *pf = FileAccess::open(pack_path,FileAccess::READ);
- ERR_FAIL_COND_V(!pf,ERR_CANT_OPEN);
+ FileAccess *pf = FileAccess::open(pack_path, FileAccess::READ);
+ ERR_FAIL_COND_V(!pf, ERR_CANT_OPEN);
const int BSIZE = 16384;
uint8_t buf[BSIZE];
- while(true) {
+ while (true) {
- int r = pf->get_buffer(buf,BSIZE);
- if (r<=0)
+ int r = pf->get_buffer(buf, BSIZE);
+ if (r <= 0)
break;
- zipWriteInFileInZip(dpkg,buf,r);
-
+ zipWriteInFileInZip(dst_pkg_zip, buf, r);
}
- zipCloseFileInZip(dpkg);
+ zipCloseFileInZip(dst_pkg_zip);
memdelete(pf);
-
}
- zipClose(dpkg,NULL);
- unzClose(pkg);
+ zipClose(dst_pkg_zip, NULL);
+ unzClose(src_pkg_zip);
return OK;
}
+#endif
+bool EditorExportPlatformOSX::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
-Error EditorExportPlatformOSX::run(int p_device, int p_flags) {
-
- return OK;
-}
-
-
-EditorExportPlatformOSX::EditorExportPlatformOSX() {
-
- Image img( _osx_logo );
- logo = Ref<ImageTexture>( memnew( ImageTexture ));
- logo->create_from_image(img);
-
- info="Made with Godot Engine";
- identifier="org.godotengine.macgame";
- signature="godotmacgame";
- short_version="1.0";
- version="1.0";
- bits_mode=BITS_FAT;
- high_resolution=false;
-
-}
-
-bool EditorExportPlatformOSX::can_export(String *r_error) const {
-
-
- bool valid=true;
+ bool valid = true;
String err;
- if (!exists_export_template("osx.zip")) {
- valid=false;
- err+="No export templates found.\nDownload and install export templates.\n";
+ if (!exists_export_template("osx.zip", &err)) {
+ valid = false;
}
- if (custom_debug_package!="" && !FileAccess::exists(custom_debug_package)) {
- valid=false;
- err+="Custom debug package not found.\n";
+ if (p_preset->get("custom_package/debug") != "" && !FileAccess::exists(p_preset->get("custom_package/debug"))) {
+ valid = false;
+ err += "Custom debug package not found.\n";
}
- if (custom_release_package!="" && !FileAccess::exists(custom_release_package)) {
- valid=false;
- err+="Custom release package not found.\n";
+ if (p_preset->get("custom_package/release") != "" && !FileAccess::exists(p_preset->get("custom_package/release"))) {
+ valid = false;
+ err += "Custom release package not found.\n";
}
- if (r_error)
- *r_error=err;
+ if (!err.empty())
+ r_error = err;
return valid;
}
+EditorExportPlatformOSX::EditorExportPlatformOSX() {
-EditorExportPlatformOSX::~EditorExportPlatformOSX() {
+ Ref<Image> img = memnew(Image(_osx_logo));
+ logo.instance();
+ logo->create_from_image(img);
+}
+EditorExportPlatformOSX::~EditorExportPlatformOSX() {
}
-#endif
void register_osx_exporter() {
-#if 0
- Ref<EditorExportPlatformOSX> exporter = Ref<EditorExportPlatformOSX>( memnew(EditorExportPlatformOSX) );
- EditorImportExport::get_singleton()->add_export_platform(exporter);
-#endif
+ Ref<EditorExportPlatformOSX> platform;
+ platform.instance();
+
+ EditorExport::get_singleton()->add_export_platform(platform);
}
diff --git a/platform/osx/export/export.h b/platform/osx/export/export.h
index 98e63ff48e..50604f068f 100644
--- a/platform/osx/export/export.h
+++ b/platform/osx/export/export.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/osx/godot_main_osx.mm b/platform/osx/godot_main_osx.mm
index 8eedd7f6fc..0bf678f9b7 100644
--- a/platform/osx/godot_main_osx.mm
+++ b/platform/osx/godot_main_osx.mm
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,68 +27,62 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "os_osx.h"
#include "main/main.h"
+#include "os_osx.h"
+
#include <string.h>
#include <unistd.h>
-//#define main godot_main
-
-int main(int argc, char** argv) {
+int main(int argc, char **argv) {
int first_arg = 1;
- const char* dbg_arg = "-NSDocumentRevisionsDebugMode";
+ const char *dbg_arg = "-NSDocumentRevisionsDebugMode";
printf("arguments\n");
- for (int i=0; i<argc; i++) {
+ for (int i = 0; i < argc; i++) {
if (strcmp(dbg_arg, argv[i]) == 0)
- first_arg = i+2;
+ first_arg = i + 2;
printf("%i: %s\n", i, argv[i]);
};
-
- if (argc>=1 && argv[0][0]=='/') {
+ if (argc >= 1 && argv[0][0] == '/') {
//potentially launched from finder
int len = strlen(argv[0]);
while (len--) {
if (argv[0][len] == '/') break;
}
- if (len>=0) {
- char *path = (char *)malloc(len+1);
+ if (len >= 0) {
+ char *path = (char *)malloc(len + 1);
memcpy(path, argv[0], len);
- path[len]=0;
+ path[len] = 0;
- char *pathinfo = (char*)malloc(strlen(path)+strlen("/../Info.plist")+1);
- //in real code you would check for errors in malloc here
+ char *pathinfo = (char *)malloc(strlen(path) + strlen("/../Info.plist") + 1);
+ //in real code you would check for errors in malloc here
strcpy(pathinfo, path);
strcat(pathinfo, "/../Info.plist");
- FILE*f=fopen(pathinfo,"rb");
+ FILE *f = fopen(pathinfo, "rb");
if (f) {
//running from app bundle, as Info.plist was found
fclose(f);
chdir(path);
chdir("../Resources"); //data.pck, or just the files are here
-
}
free(path);
free(pathinfo);
}
-
-
-
}
OS_OSX os;
-
- Error err = Main::setup(argv[0],argc-first_arg,&argv[first_arg]);
- if (err!=OK)
+ Error err = Main::setup(argv[0], argc - first_arg, &argv[first_arg]);
+ if (err != OK)
return 255;
if (Main::start())
os.run(); // it is actually the OS that decides how to run
+
Main::cleanup();
return 0;
diff --git a/platform/osx/godot_osx.mm b/platform/osx/godot_osx.mm
deleted file mode 100644
index 2296fb016f..0000000000
--- a/platform/osx/godot_osx.mm
+++ /dev/null
@@ -1,215 +0,0 @@
-/*************************************************************************/
-/* godot_osx.mm */
-/*************************************************************************/
-/* 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 <sys/param.h> /* for MAXPATHLEN */
-#include <unistd.h>
-#include "godot_osx.h"
-
-/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
- but the method still is there and works. To avoid warnings, we declare
- it ourselves here. */
-@interface NSApplication()
-- (void)setAppleMenu:(NSMenu *)menu;
-@end
-
-static int global_argc;
-static char **global_argv;
-static BOOL gCalledAppMainline = FALSE;
-
-static NSString *getApplicationName(void)
-{
- const NSDictionary *dict;
- NSString *appName = 0;
-
- /* Determine the application name */
- dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
- if (dict)
- appName = [dict objectForKey: @"CFBundleName"];
-
- if (![appName length])
- appName = [[NSProcessInfo processInfo] processName];
-
- return appName;
-}
-
-/* The main class of the application, the application's delegate */
-@implementation GodotMain
-
-static void setApplicationMenu(void)
-{
- /* warning: this code is very odd */
- NSMenu *appleMenu;
- NSMenuItem *menuItem;
- NSString *title;
- NSString *appName;
-
- appName = getApplicationName();
- appleMenu = [[NSMenu alloc] initWithTitle:@""];
-
- /* Add menu items */
- title = [@"About " stringByAppendingString:appName];
- [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
-
- [appleMenu addItem:[NSMenuItem separatorItem]];
-
- title = [@"Hide " stringByAppendingString:appName];
- [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
-
- menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
- [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
-
- [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
-
- [appleMenu addItem:[NSMenuItem separatorItem]];
-
- title = [@"Quit " stringByAppendingString:appName];
- [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
-
-
- /* Put menu into the menubar */
- menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
- [menuItem setSubmenu:appleMenu];
- [[NSApp mainMenu] addItem:menuItem];
-
- /* Tell the application object that this is now the application menu */
- [NSApp setAppleMenu:appleMenu];
-
- /* Finally give up our references to the objects */
- [appleMenu release];
- [menuItem release];
-}
-
-/* Create a window menu */
-static void setupWindowMenu(void)
-{
- NSMenu *windowMenu;
- NSMenuItem *windowMenuItem;
- NSMenuItem *menuItem;
-
- windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
-
- /* "Minimize" item */
- menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
- [windowMenu addItem:menuItem];
- [menuItem release];
-
- /* Put menu into the menubar */
- windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
- [windowMenuItem setSubmenu:windowMenu];
- [[NSApp mainMenu] addItem:windowMenuItem];
-
- /* Tell the application object that this is now the window menu */
- [NSApp setWindowsMenu:windowMenu];
-
- /* Finally give up our references to the objects */
- [windowMenu release];
- [windowMenuItem release];
-}
-
-/* Replacement for NSApplicationMain */
-static void CustomApplicationMain (int argc, char **argv)
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- GodotMain *main;
-
- /* Ensure the application object is initialised */
- [NSApplication sharedApplication];
-
- /* Set up the menubar */
- [NSApp setMainMenu:[[NSMenu alloc] init]];
- setApplicationMenu();
- setupWindowMenu();
-
- main = [[main alloc] init];
- [NSApp setDelegate:main];
-
- /* Start the main event loop */
- [NSApp run];
-
- [main release];
- [pool release];
-}
-
-extern int godot_main(int argc, char** argv);
-
-/* Called when the internal event loop has just started running */
-- (void) applicationDidFinishLaunching: (NSNotification *) note
-{
- int status;
-
- /* Hand off to main application code */
- gCalledAppMainline = TRUE;
-
- int ret = godot_main(global_argc, global_argv);
-
- exit(ret);
-}
-@end
-
-#ifdef main
-# undef main
-#endif
-
-
-int main (int argc, char **argv)
-{
- /* Copy the arguments into a global variable */
- /* This is passed if we are launched by double-clicking */
- if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
- global_argv = (char **) malloc(sizeof (char *) * 2);
- global_argv[0] = argv[0];
- global_argv[1] = NULL;
- global_argc = 1;
-
- // chdir to binary's dir when launched from finder
- int len = strlen(global_argv[0]);
-
- while (len--){
- if (global_argv[0][len] == '/') break;
- }
-
- if (len>=0) {
- char *path = (char *)malloc(len+1);
- memcpy(path, global_argv[0], len);
- path[len]=0;
- printf("Path: %s\n", path);
- chdir(path);
- }
-
- } else {
- int i;
- global_argc = argc;
- global_argv = (char **) malloc(sizeof (char *) * (argc+1));
- for (i = 0; i <= argc; i++)
- global_argv[i] = argv[i];
- }
-
- CustomApplicationMain (argc, argv);
- return 0;
-}
-
diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp
index c2b0e1f052..1a4b3a460e 100644
--- a/platform/osx/joypad_osx.cpp
+++ b/platform/osx/joypad_osx.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -458,7 +459,7 @@ static const InputDefault::JoyAxis axis_correct(int p_value, int p_min, int p_ma
return jx;
}
-uint32_t JoypadOSX::process_joypads(uint32_t p_last_id) {
+void JoypadOSX::process_joypads() {
poll_joypads();
for (int i = 0; i < device_list.size(); i++) {
@@ -467,17 +468,17 @@ uint32_t JoypadOSX::process_joypads(uint32_t p_last_id) {
for (int j = 0; j < joy.axis_elements.size(); j++) {
rec_element &elem = joy.axis_elements[j];
int value = joy.get_hid_element_state(&elem);
- p_last_id = input->joy_axis(p_last_id, joy.id, j, axis_correct(value, elem.min, elem.max));
+ input->joy_axis(joy.id, j, axis_correct(value, elem.min, elem.max));
}
for (int j = 0; j < joy.button_elements.size(); j++) {
int value = joy.get_hid_element_state(&joy.button_elements[j]);
- p_last_id = input->joy_button(p_last_id, joy.id, j, (value >= 1));
+ input->joy_button(joy.id, j, (value >= 1));
}
for (int j = 0; j < joy.hat_elements.size(); j++) {
rec_element &elem = joy.hat_elements[j];
int value = joy.get_hid_element_state(&elem);
int hat_value = process_hat_value(elem.min, elem.max, value);
- p_last_id = input->joy_hat(p_last_id, joy.id, hat_value);
+ input->joy_hat(joy.id, hat_value);
}
if (joy.ffservice) {
@@ -494,7 +495,6 @@ uint32_t JoypadOSX::process_joypads(uint32_t p_last_id) {
}
}
}
- return p_last_id;
}
void JoypadOSX::joypad_vibration_start(int p_id, float p_magnitude, float p_duration, uint64_t p_timestamp) {
diff --git a/platform/osx/joypad_osx.h b/platform/osx/joypad_osx.h
index dabd1b8aec..bfbc523cff 100644
--- a/platform/osx/joypad_osx.h
+++ b/platform/osx/joypad_osx.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -110,7 +111,7 @@ private:
void joypad_vibration_stop(int p_id, uint64_t p_timestamp);
public:
- uint32_t process_joypads(uint32_t p_last_id);
+ void process_joypads();
void _device_added(IOReturn p_res, IOHIDDeviceRef p_device);
void _device_removed(int p_id);
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h
index 2c7ad09b89..56e6802eeb 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,21 +30,21 @@
#ifndef OS_OSX_H
#define OS_OSX_H
+#include "drivers/alsa/audio_driver_alsa.h"
+#include "drivers/rtaudio/audio_driver_rtaudio.h"
#include "drivers/unix/os_unix.h"
#include "joypad_osx.h"
#include "main/input_default.h"
#include "os/input.h"
-#include "power_osx.h"
-#include "servers/visual_server.h"
-// #include "servers/visual/visual_server_wrap_mt.h"
-#include "drivers/alsa/audio_driver_alsa.h"
-#include "drivers/rtaudio/audio_driver_rtaudio.h"
#include "platform/osx/audio_driver_osx.h"
+#include "power_osx.h"
#include "servers/audio_server.h"
#include "servers/physics_2d/physics_2d_server_sw.h"
#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
#include "servers/physics_server.h"
#include "servers/visual/rasterizer.h"
+#include "servers/visual/visual_server_wrap_mt.h"
+#include "servers/visual_server.h"
#include <ApplicationServices/ApplicationServices.h>
//bitch
@@ -61,7 +62,6 @@ public:
List<String> args;
MainLoop *main_loop;
- unsigned int event_id;
PhysicsServer *physics_server;
Physics2DServer *physics_2d_server;
@@ -83,7 +83,6 @@ public:
// pthread_key_t current;
bool mouse_grab;
Point2 mouse_pos;
- uint32_t last_id;
id delegate;
id window_delegate;
@@ -97,17 +96,18 @@ public:
CursorShape cursor_shape;
MouseMode mouse_mode;
+ String title;
bool minimized;
bool maximized;
bool zoomed;
- Vector<Rect2> screens;
- Vector<int> screen_dpi;
-
Size2 window_size;
- int current_screen;
Rect2 restore_rect;
+ Point2 im_position;
+ ImeCallback im_callback;
+ void *im_target;
+
power_osx *power_manager;
float _mouse_scale(float p_scale) {
@@ -117,6 +117,8 @@ public:
return 1.0;
}
+ void _update_window();
+
float display_scale;
protected:
@@ -138,6 +140,8 @@ public:
virtual String get_name();
+ virtual void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type = ERR_ERROR);
+
virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
virtual void set_cursor_shape(CursorShape p_shape);
@@ -146,13 +150,13 @@ public:
virtual void set_mouse_grab(bool p_grab);
virtual bool is_mouse_grab_enabled() const;
virtual void warp_mouse_pos(const Point2 &p_to);
- virtual Point2 get_mouse_pos() const;
+ virtual Point2 get_mouse_position() const;
virtual int get_mouse_button_state() const;
virtual void set_window_title(const String &p_title);
virtual Size2 get_window_size() const;
- virtual void set_icon(const Image &p_icon);
+ virtual void set_icon(const Ref<Image> &p_icon);
virtual MainLoop *get_main_loop() const;
@@ -166,7 +170,7 @@ public:
virtual void swap_buffers();
Error shell_open(String p_uri);
- void push_input(const InputEvent &p_event);
+ void push_input(const Ref<InputEvent> &p_event);
String get_locale() const;
@@ -201,10 +205,17 @@ public:
virtual void request_attention();
virtual String get_joy_guid(int p_device) const;
+ virtual void set_borderless_window(int p_borderless);
+ virtual bool get_borderless_window();
+ virtual void set_ime_position(const Point2 &p_pos);
+ virtual void set_ime_intermediate_text_callback(ImeCallback p_callback, void *p_inp);
+
virtual PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
+ virtual bool _check_internal_feature_support(const String &p_feature);
+
void run();
void set_mouse_mode(MouseMode p_mode);
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 0699978caf..6d8a6eca66 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,94 +27,63 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#import <Cocoa/Cocoa.h>
+#include "os_osx.h"
+
+#include "dir_access_osx.h"
+#include "drivers/gles3/rasterizer_gles3.h"
+#include "main/main.h"
+#include "os/keyboard.h"
+#include "print_string.h"
+#include "sem_osx.h"
+#include "servers/physics/physics_server_sw.h"
+#include "servers/visual/visual_server_raster.h"
#include <Carbon/Carbon.h>
-#include <IOKit/IOKitLib.h>
+#import <Cocoa/Cocoa.h>
#include <IOKit/IOCFPlugIn.h>
-#include <IOKit/hid/IOHIDLib.h>
+#include <IOKit/IOKitLib.h>
#include <IOKit/hid/IOHIDKeys.h>
+#include <IOKit/hid/IOHIDLib.h>
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101200
+#include <os/log.h>
+#endif
-#include "sem_osx.h"
-#include "servers/visual/visual_server_raster.h"
-//#include "drivers/opengl/rasterizer_gl.h"
-//#include "drivers/gles2/rasterizer_gles2.h"
-#include "drivers/gles3/rasterizer_gles3.h"
-#include "os_osx.h"
+#include <fcntl.h>
+#include <libproc.h>
#include <stdio.h>
#include <stdlib.h>
-#include "print_string.h"
-#include "servers/physics/physics_server_sw.h"
-// #include "drivers/gles2/rasterizer_instance_gles2.h"
-// #include "servers/visual/visual_server_wrap_mt.h"
-#include "main/main.h"
-#include "os/keyboard.h"
-#include "dir_access_osx.h"
-
-#include <sys/types.h>
#include <sys/stat.h>
-#include <fcntl.h>
+#include <sys/types.h>
#include <unistd.h>
-#include <libproc.h>
-//uses portions of glfw
-//========================================================================
-// GLFW 3.0 - www.glfw.org
-//------------------------------------------------------------------------
-// Copyright (c) 2002-2006 Marcus Geelnard
-// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
-//
-// This software is provided 'as-is', without any express or implied
-// warranty. In no event will the authors be held liable for any damages
-// arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it
-// freely, subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented; you must not
-// claim that you wrote the original software. If you use this software
-// in a product, an acknowledgment in the product documentation would
-// be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such, and must not
-// be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source
-// distribution.
-//
-//========================================================================
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 101200
+#define NSWindowStyleMaskBorderless NSBorderlessWindowMask
+#endif
static NSRect convertRectToBacking(NSRect contentRect) {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
- if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6)
- return [OS_OSX::singleton->window_view convertRectToBacking:contentRect];
- else
+ if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6)
+ return [OS_OSX::singleton->window_view convertRectToBacking:contentRect];
+ else
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
- return contentRect;
-
+ return contentRect;
}
-static InputModifierState translateFlags(NSUInteger flags)
-{
- InputModifierState mod;
-
-
- mod.shift = (flags & NSShiftKeyMask);
- mod.control = (flags & NSControlKeyMask);
- mod.alt = (flags & NSAlternateKeyMask);
- mod.meta = (flags & NSCommandKeyMask);
+static void get_key_modifier_state(unsigned int p_osx_state, Ref<InputEventWithModifiers> state) {
- return mod;
+ state->set_shift((p_osx_state & NSShiftKeyMask));
+ state->set_control((p_osx_state & NSControlKeyMask));
+ state->set_alt((p_osx_state & NSAlternateKeyMask));
+ state->set_metakey((p_osx_state & NSCommandKeyMask));
}
-static int mouse_x=0;
-static int mouse_y=0;
-static int prev_mouse_x=0;
-static int prev_mouse_y=0;
-static int button_mask=0;
-
+static int mouse_x = 0;
+static int mouse_y = 0;
+static int prev_mouse_x = 0;
+static int prev_mouse_y = 0;
+static int button_mask = 0;
+static bool mouse_down_control = false;
@interface GodotApplication : NSApplication
@end
@@ -123,12 +93,11 @@ static int button_mask=0;
// From http://cocoadev.com/index.pl?GameKeyboardHandlingAlmost
// This works around an AppKit bug, where key up events while holding
// down the command key don't get sent to the key window.
-- (void)sendEvent:(NSEvent *)event
-{
- if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask))
- [[self keyWindow] sendEvent:event];
- else
- [super sendEvent:event];
+- (void)sendEvent:(NSEvent *)event {
+ if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask))
+ [[self keyWindow] sendEvent:event];
+ else
+ [super sendEvent:event];
}
@end
@@ -138,45 +107,39 @@ static int button_mask=0;
@implementation GodotApplicationDelegate
-- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
-{
+- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
if (OS_OSX::singleton->get_main_loop())
OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_QUIT_REQUEST);
return NSTerminateCancel;
}
-- (void)applicationDidHide:(NSNotification *)notification
-{
+- (void)applicationDidHide:(NSNotification *)notification {
/*
_Godotwindow* window;
for (window = _Godot.windowListHead; window; window = window->next)
_GodotInputWindowVisibility(window, GL_FALSE);
- */
+*/
}
-- (void)applicationDidUnhide:(NSNotification *)notification
-{
+- (void)applicationDidUnhide:(NSNotification *)notification {
/*
_Godotwindow* window;
- for (window = _Godot.windowListHead; window; window = window->next)
- {
- if ([window_object isVisible])
- _GodotInputWindowVisibility(window, GL_TRUE);
+ for (window = _Godot.windowListHead; window; window = window->next) {
+ if ([window_object isVisible])
+ _GodotInputWindowVisibility(window, GL_TRUE);
}
- */
+*/
}
-- (void)applicationDidChangeScreenParameters:(NSNotification *) notification
-{
+- (void)applicationDidChangeScreenParameters:(NSNotification *)notification {
//_GodotInputMonitorChange();
}
@end
-@interface GodotWindowDelegate : NSObject
-{
+@interface GodotWindowDelegate : NSObject {
//_Godotwindow* window;
}
@@ -184,28 +147,68 @@ static int button_mask=0;
@implementation GodotWindowDelegate
-
-- (BOOL)windowShouldClose:(id)sender
-{
+- (BOOL)windowShouldClose:(id)sender {
//_GodotInputWindowCloseRequest(window);
if (OS_OSX::singleton->get_main_loop())
OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_QUIT_REQUEST);
- return NO;
+
+ return NO;
}
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+- (void)windowDidEnterFullScreen:(NSNotification *)notification {
+ OS_OSX::singleton->zoomed = true;
+}
+- (void)windowDidExitFullScreen:(NSNotification *)notification {
+ OS_OSX::singleton->zoomed = false;
+}
+#endif // MAC_OS_X_VERSION_MAX_ALLOWED
+
+- (void)windowDidChangeBackingProperties:(NSNotification *)notification {
+ if (!OS_OSX::singleton)
+ return;
+
+ NSWindow *window = (NSWindow *)[notification object];
+ CGFloat newBackingScaleFactor = [window backingScaleFactor];
+ CGFloat oldBackingScaleFactor = [[[notification userInfo] objectForKey:@"NSBackingPropertyOldScaleFactorKey"] doubleValue];
+ if (newBackingScaleFactor != oldBackingScaleFactor) {
+ //Set new display scale and window size
+ OS_OSX::singleton->display_scale = newBackingScaleFactor;
+
+ const NSRect contentRect = [OS_OSX::singleton->window_view frame];
+ const NSRect fbRect = contentRect; //convertRectToBacking(contentRect);
+
+ OS_OSX::singleton->window_size.width = fbRect.size.width * OS_OSX::singleton->display_scale;
+ OS_OSX::singleton->window_size.height = fbRect.size.height * OS_OSX::singleton->display_scale;
+
+ //Update context
+ if (OS_OSX::singleton->main_loop) {
+ [OS_OSX::singleton->context update];
+
+ //Force window resize ???
+ NSRect frame = [OS_OSX::singleton->window_object frame];
+ [OS_OSX::singleton->window_object setFrame:NSMakeRect(frame.origin.x, frame.origin.y, 1, 1) display:YES];
+ [OS_OSX::singleton->window_object setFrame:frame display:YES];
+ }
+ }
+}
-- (void)windowDidResize:(NSNotification *)notification
-{
- [OS_OSX::singleton->context update];
+- (void)windowDidResize:(NSNotification *)notification {
+ [OS_OSX::singleton->context update];
- const NSRect contentRect = [OS_OSX::singleton->window_view frame];
- const NSRect fbRect = contentRect;//convertRectToBacking(contentRect);
+ const NSRect contentRect = [OS_OSX::singleton->window_view frame];
+ const NSRect fbRect = contentRect; //convertRectToBacking(contentRect);
- OS_OSX::singleton->window_size.width=fbRect.size.width*OS_OSX::singleton->display_scale;
- OS_OSX::singleton->window_size.height=fbRect.size.height*OS_OSX::singleton->display_scale;
+ OS_OSX::singleton->window_size.width = fbRect.size.width * OS_OSX::singleton->display_scale;
+ OS_OSX::singleton->window_size.height = fbRect.size.height * OS_OSX::singleton->display_scale;
+ if (OS_OSX::singleton->main_loop) {
+ Main::force_redraw();
+ //Event retrieval blocks until resize is over. Call Main::iteration() directly.
+ Main::iteration();
+ }
/*
_GodotInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);
@@ -214,11 +217,10 @@ static int button_mask=0;
if (window->cursorMode == Godot_CURSOR_DISABLED)
centerCursor(window);
- */
+*/
}
-- (void)windowDidMove:(NSNotification *)notification
-{
+- (void)windowDidMove:(NSNotification *)notification {
/*
[window->nsgl.context update];
@@ -228,35 +230,30 @@ static int button_mask=0;
if (window->cursorMode == Godot_CURSOR_DISABLED)
centerCursor(window);
- */
+*/
}
-- (void)windowDidBecomeKey:(NSNotification *)notification
-{
+- (void)windowDidBecomeKey:(NSNotification *)notification {
//_GodotInputWindowFocus(window, GL_TRUE);
//_GodotPlatformSetCursorMode(window, window->cursorMode);
if (OS_OSX::singleton->get_main_loop())
OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
}
-- (void)windowDidResignKey:(NSNotification *)notification
-{
+- (void)windowDidResignKey:(NSNotification *)notification {
//_GodotInputWindowFocus(window, GL_FALSE);
//_GodotPlatformSetCursorMode(window, Godot_CURSOR_NORMAL);
if (OS_OSX::singleton->get_main_loop())
OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT);
}
-- (void)windowDidMiniaturize:(NSNotification*)notification
-{
+- (void)windowDidMiniaturize:(NSNotification *)notification {
OS_OSX::singleton->wm_minimized(true);
if (OS_OSX::singleton->get_main_loop())
OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT);
};
-- (void)windowDidDeminiaturize:(NSNotification*)notification
-{
-
+- (void)windowDidDeminiaturize:(NSNotification *)notification {
OS_OSX::singleton->wm_minimized(false);
if (OS_OSX::singleton->get_main_loop())
OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
@@ -264,659 +261,634 @@ static int button_mask=0;
@end
-@interface GodotContentView : NSView
-{
- NSTrackingArea* trackingArea;
+@interface GodotContentView : NSView <NSTextInputClient> {
+ NSTrackingArea *trackingArea;
+ NSMutableAttributedString *markedText;
+ bool imeMode;
}
-
-
-
+- (void)cancelComposition;
@end
@implementation GodotContentView
-+ (void)initialize
-{
- if (self == [GodotContentView class])
- {
- /*
- if (_glfw.ns.cursor == nil)
- {
- NSImage* data = [[NSImage alloc] initWithSize:NSMakeSize(1, 1)];
- _glfw.ns.cursor = [[NSCursor alloc] initWithImage:data
- hotSpot:NSZeroPoint];
- [data release];
- }
- */
++ (void)initialize {
+ if (self == [GodotContentView class]) {
+ // nothing left to do here at the moment..
}
}
-- (id)init
-{
- self = [super init];
- trackingArea = nil;
- [self updateTrackingAreas];
- [self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
- return self;
+- (id)init {
+ self = [super init];
+ trackingArea = nil;
+ imeMode = false;
+ [self updateTrackingAreas];
+ [self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
+ markedText = [[NSMutableAttributedString alloc] init];
+ return self;
}
+- (void)dealloc {
+ [trackingArea release];
+ [markedText release];
+ [super dealloc];
+}
+
+static const NSRange kEmptyRange = { NSNotFound, 0 };
--(void)dealloc
-{
- [trackingArea release];
- [super dealloc];
+- (BOOL)hasMarkedText {
+ return (markedText.length > 0);
}
-- (NSDragOperation)draggingEntered:(id < NSDraggingInfo >)sender {
- return NSDragOperationCopy;
+- (NSRange)markedRange {
+ return (markedText.length > 0) ? NSMakeRange(0, markedText.length - 1) : kEmptyRange;
}
-- (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)sender {
- return NSDragOperationCopy;
+- (NSRange)selectedRange {
+ return kEmptyRange;
}
-- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender {
+- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange {
+ if ([aString isKindOfClass:[NSAttributedString class]]) {
+ [markedText initWithAttributedString:aString];
+ } else {
+ [markedText initWithString:aString];
+ }
+ if (OS_OSX::singleton->im_callback) {
+ imeMode = true;
+ String ret;
+ ret.parse_utf8([[markedText mutableString] UTF8String]);
+ OS_OSX::singleton->im_callback(OS_OSX::singleton->im_target, ret, Point2(selectedRange.location, selectedRange.length));
+ }
+}
+- (void)doCommandBySelector:(SEL)aSelector {
+ if ([self respondsToSelector:aSelector])
+ [self performSelector:aSelector];
+}
- NSPasteboard *pboard = [sender draggingPasteboard];
- NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType];
+- (void)unmarkText {
+ imeMode = false;
+ [[markedText mutableString] setString:@""];
+ if (OS_OSX::singleton->im_callback)
+ OS_OSX::singleton->im_callback(OS_OSX::singleton->im_target, "", Point2());
+}
- Vector<String> files;
- for(int i=0;i<filenames.count;i++) {
- NSString *ns = [filenames objectAtIndex:i];
- char *utfs = strdup([ns UTF8String]);
- String ret;
- ret.parse_utf8(utfs);
- free(utfs);
- files.push_back(ret);
+- (NSArray *)validAttributesForMarkedText {
+ return [NSArray array];
+}
+- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange {
+ return nil;
+}
- }
+- (NSUInteger)characterIndexForPoint:(NSPoint)aPoint {
+ return 0;
+}
- if (files.size()) {
- OS_OSX::singleton->main_loop->drop_files(files,0);
- OS_OSX::singleton->move_window_to_foreground();
- }
+- (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange {
+ const NSRect contentRect = [OS_OSX::singleton->window_view frame];
+ NSRect pointInWindowRect = NSMakeRect(OS_OSX::singleton->im_position.x / OS_OSX::singleton->display_scale, contentRect.size.height - (OS_OSX::singleton->im_position.y / OS_OSX::singleton->display_scale) - 1, 0, 0);
+ NSPoint pointOnScreen = [[OS_OSX::singleton->window_view window] convertRectToScreen:pointInWindowRect].origin;
- return NO;
+ return NSMakeRect(pointOnScreen.x, pointOnScreen.y, 0, 0);
}
+- (void)cancelComposition {
+ [self unmarkText];
+ NSInputManager *currentInputManager = [NSInputManager currentInputManager];
+ [currentInputManager markedTextAbandoned:self];
+}
-- (BOOL)isOpaque
-{
- return YES;
+- (void)insertText:(id)aString {
+ [self insertText:aString replacementRange:NSMakeRange(0, 0)];
}
-- (BOOL)canBecomeKeyView
-{
- return YES;
+- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange {
+ NSEvent *event = [NSApp currentEvent];
+ Ref<InputEventKey> k;
+ k.instance();
+
+ get_key_modifier_state([event modifierFlags], k);
+ k->set_pressed(true);
+ k->set_echo(false);
+ k->set_scancode(0);
+
+ NSString *characters;
+ if ([aString isKindOfClass:[NSAttributedString class]]) {
+ characters = [aString string];
+ } else {
+ characters = (NSString *)aString;
+ }
+
+ NSUInteger i, length = [characters length];
+
+ NSCharacterSet *ctrlChars = [NSCharacterSet controlCharacterSet];
+ NSCharacterSet *wsnlChars = [NSCharacterSet whitespaceAndNewlineCharacterSet];
+ if ([characters rangeOfCharacterFromSet:ctrlChars].length && [characters rangeOfCharacterFromSet:wsnlChars].length == 0) {
+ NSInputManager *currentInputManager = [NSInputManager currentInputManager];
+ [currentInputManager markedTextAbandoned:self];
+ [self cancelComposition];
+ return;
+ }
+
+ for (i = 0; i < length; i++) {
+ const unichar codepoint = [characters characterAtIndex:i];
+ if ((codepoint & 0xFF00) == 0xF700)
+ continue;
+
+ k->set_unicode(codepoint);
+ OS_OSX::singleton->push_input(k);
+ }
+ [self cancelComposition];
}
-- (BOOL)acceptsFirstResponder
-{
- return YES;
+- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender {
+ return NSDragOperationCopy;
}
-- (void)cursorUpdate:(NSEvent *)event
-{
- // setModeCursor(window, window->cursorMode);
+- (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)sender {
+ return NSDragOperationCopy;
+}
+
+- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender {
+
+ NSPasteboard *pboard = [sender draggingPasteboard];
+ NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType];
+
+ Vector<String> files;
+ for (int i = 0; i < filenames.count; i++) {
+ NSString *ns = [filenames objectAtIndex:i];
+ char *utfs = strdup([ns UTF8String]);
+ String ret;
+ ret.parse_utf8(utfs);
+ free(utfs);
+ files.push_back(ret);
+ }
+
+ if (files.size()) {
+ OS_OSX::singleton->main_loop->drop_files(files, 0);
+ OS_OSX::singleton->move_window_to_foreground();
+ }
+
+ return NO;
}
-- (void)mouseDown:(NSEvent *)event
-{
+- (BOOL)isOpaque {
+ return YES;
+}
- //print_line("mouse down:");
- button_mask|=BUTTON_MASK_LEFT;
- InputEvent ev;
- ev.type=InputEvent::MOUSE_BUTTON;
- ev.mouse_button.button_index=BUTTON_LEFT;
- ev.mouse_button.pressed=true;
- ev.mouse_button.x=mouse_x;
- ev.mouse_button.y=mouse_y;
- ev.mouse_button.global_x=mouse_x;
- ev.mouse_button.global_y=mouse_y;
- ev.mouse_button.button_mask=button_mask;
- ev.mouse_button.doubleclick = [event clickCount]==2;
- ev.mouse_button.mod = translateFlags([event modifierFlags]);
- OS_OSX::singleton->push_input(ev);
+- (BOOL)canBecomeKeyView {
+ return YES;
+}
+- (BOOL)acceptsFirstResponder {
+ return YES;
+}
- /* _glfwInputMouseClick(window,
- GLFW_MOUSE_BUTTON_LEFT,
- GLFW_PRESS,
- translateFlags([event modifierFlags]));*/
+- (void)cursorUpdate:(NSEvent *)event {
+ //setModeCursor(window, window->cursorMode);
}
-- (void)mouseDragged:(NSEvent *)event
-{
- [self mouseMoved:event];
+static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) {
+ if (pressed) {
+ button_mask |= mask;
+ } else {
+ button_mask &= ~mask;
+ }
+
+ Ref<InputEventMouseButton> mb;
+ mb.instance();
+
+ get_key_modifier_state([event modifierFlags], mb);
+ mb->set_button_index(index);
+ mb->set_pressed(pressed);
+ mb->set_position(Vector2(mouse_x, mouse_y));
+ mb->set_global_position(Vector2(mouse_x, mouse_y));
+ mb->set_button_mask(button_mask);
+ if (index == BUTTON_LEFT && pressed) {
+ mb->set_doubleclick([event clickCount] == 2);
+ }
+ OS_OSX::singleton->push_input(mb);
}
-- (void)mouseUp:(NSEvent *)event
-{
+- (void)mouseDown:(NSEvent *)event {
+ if (([event modifierFlags] & NSControlKeyMask)) {
+ mouse_down_control = true;
+ _mouseDownEvent(event, BUTTON_RIGHT, BUTTON_MASK_RIGHT, true);
+ } else {
+ mouse_down_control = false;
+ _mouseDownEvent(event, BUTTON_LEFT, BUTTON_MASK_LEFT, true);
+ }
+}
- button_mask&=~BUTTON_MASK_LEFT;
- InputEvent ev;
- ev.type=InputEvent::MOUSE_BUTTON;
- ev.mouse_button.button_index=BUTTON_LEFT;
- ev.mouse_button.pressed=false;
- ev.mouse_button.x=mouse_x;
- ev.mouse_button.y=mouse_y;
- ev.mouse_button.global_x=mouse_x;
- ev.mouse_button.global_y=mouse_y;
- ev.mouse_button.button_mask=button_mask;
- ev.mouse_button.mod = translateFlags([event modifierFlags]);
- OS_OSX::singleton->push_input(ev);
+- (void)mouseDragged:(NSEvent *)event {
+ [self mouseMoved:event];
+}
- /* _glfwInputMouseClick(window,
- GLFW_MOUSE_BUTTON_LEFT,
- GLFW_RELEASE,
- translateFlags([event modifierFlags]));*/
+- (void)mouseUp:(NSEvent *)event {
+ if (mouse_down_control) {
+ _mouseDownEvent(event, BUTTON_RIGHT, BUTTON_MASK_RIGHT, false);
+ } else {
+ _mouseDownEvent(event, BUTTON_LEFT, BUTTON_MASK_LEFT, false);
+ }
}
-- (void)mouseMoved:(NSEvent *)event
-{
+- (void)mouseMoved:(NSEvent *)event {
+
+ Ref<InputEventMouseMotion> mm;
+ mm.instance();
- InputEvent ev;
- ev.type=InputEvent::MOUSE_MOTION;
- ev.mouse_motion.button_mask=button_mask;
- prev_mouse_x=mouse_x;
- prev_mouse_y=mouse_y;
+ mm->set_button_mask(button_mask);
+ prev_mouse_x = mouse_x;
+ prev_mouse_y = mouse_y;
const NSRect contentRect = [OS_OSX::singleton->window_view frame];
const NSPoint p = [event locationInWindow];
mouse_x = p.x * OS_OSX::singleton->_mouse_scale([[event window] backingScaleFactor]);
mouse_y = (contentRect.size.height - p.y) * OS_OSX::singleton->_mouse_scale([[event window] backingScaleFactor]);
- ev.mouse_motion.x=mouse_x;
- ev.mouse_motion.y=mouse_y;
- ev.mouse_motion.global_x=mouse_x;
- ev.mouse_motion.global_y=mouse_y;
- ev.mouse_motion.relative_x=[event deltaX] * OS_OSX::singleton->_mouse_scale([[event window] backingScaleFactor]);
- ev.mouse_motion.relative_y=[event deltaY] * OS_OSX::singleton->_mouse_scale([[event window] backingScaleFactor]);
- ev.mouse_motion.mod = translateFlags([event modifierFlags]);
-
- OS_OSX::singleton->input->set_mouse_pos(Point2(mouse_x,mouse_y));
- OS_OSX::singleton->push_input(ev);
-
-
- /* if (window->cursorMode == GLFW_CURSOR_DISABLED)
- _glfwInputCursorMotion(window, [event deltaX], [event deltaY]);
- else
- {
- const NSRect contentRect = [window->ns.view frame];
- const NSPoint p = [event locationInWindow];
+ mm->set_position(Vector2(mouse_x, mouse_y));
+ mm->set_global_position(Vector2(mouse_x, mouse_y));
+ Vector2 relativeMotion = Vector2();
+ relativeMotion.x = [event deltaX] * OS_OSX::singleton->_mouse_scale([[event window] backingScaleFactor]);
+ relativeMotion.y = [event deltaY] * OS_OSX::singleton->_mouse_scale([[event window] backingScaleFactor]);
+ mm->set_relative(relativeMotion);
+ get_key_modifier_state([event modifierFlags], mm);
- _glfwInputCursorMotion(window, p.x, contentRect.size.height - p.y);
- }*/
+ OS_OSX::singleton->input->set_mouse_position(Point2(mouse_x, mouse_y));
+ OS_OSX::singleton->push_input(mm);
}
-- (void)rightMouseDown:(NSEvent *)event
-{
-
- button_mask|=BUTTON_MASK_RIGHT;
- InputEvent ev;
- ev.type=InputEvent::MOUSE_BUTTON;
- ev.mouse_button.button_index=BUTTON_RIGHT;
- ev.mouse_button.pressed=true;
- ev.mouse_button.x=mouse_x;
- ev.mouse_button.y=mouse_y;
- ev.mouse_button.global_x=mouse_x;
- ev.mouse_button.global_y=mouse_y;
- ev.mouse_button.button_mask=button_mask;
- ev.mouse_button.mod = translateFlags([event modifierFlags]);
- OS_OSX::singleton->push_input(ev);
-
- /* _glfwInputMouseClick(window,
- GLFW_MOUSE_BUTTON_RIGHT,
- GLFW_PRESS,
- translateFlags([event modifierFlags]));*/
+- (void)rightMouseDown:(NSEvent *)event {
+ _mouseDownEvent(event, BUTTON_RIGHT, BUTTON_MASK_RIGHT, true);
}
-- (void)rightMouseDragged:(NSEvent *)event
-{
- [self mouseMoved:event];
+- (void)rightMouseDragged:(NSEvent *)event {
+ [self mouseMoved:event];
}
-- (void)rightMouseUp:(NSEvent *)event
-{
-
- button_mask&=~BUTTON_MASK_RIGHT;
- InputEvent ev;
- ev.type=InputEvent::MOUSE_BUTTON;
- ev.mouse_button.button_index=BUTTON_RIGHT;
- ev.mouse_button.pressed=false;
- ev.mouse_button.x=mouse_x;
- ev.mouse_button.y=mouse_y;
- ev.mouse_button.global_x=mouse_x;
- ev.mouse_button.global_y=mouse_y;
- ev.mouse_button.button_mask=button_mask;
- ev.mouse_button.mod = translateFlags([event modifierFlags]);
- OS_OSX::singleton->push_input(ev);
-
- /*_glfwInputMouseClick(window,
- GLFW_MOUSE_BUTTON_RIGHT,
- GLFW_RELEASE,
- translateFlags([event modifierFlags]));*/
+- (void)rightMouseUp:(NSEvent *)event {
+ _mouseDownEvent(event, BUTTON_RIGHT, BUTTON_MASK_RIGHT, false);
}
-- (void)otherMouseDown:(NSEvent *)event
-{
+- (void)otherMouseDown:(NSEvent *)event {
- if ((int) [event buttonNumber]!=2)
+ if ((int)[event buttonNumber] != 2)
return;
- button_mask|=BUTTON_MASK_MIDDLE;
- InputEvent ev;
- ev.type=InputEvent::MOUSE_BUTTON;
- ev.mouse_button.button_index=BUTTON_MIDDLE;
- ev.mouse_button.pressed=true;
- ev.mouse_button.x=mouse_x;
- ev.mouse_button.y=mouse_y;
- ev.mouse_button.global_x=mouse_x;
- ev.mouse_button.global_y=mouse_y;
- ev.mouse_button.button_mask=button_mask;
- ev.mouse_button.mod = translateFlags([event modifierFlags]);
- OS_OSX::singleton->push_input(ev);
-
- /*_glfwInputMouseClick(window,
- (int) [event buttonNumber],
- GLFW_PRESS,
- translateFlags([event modifierFlags]));*/
+ _mouseDownEvent(event, BUTTON_MIDDLE, BUTTON_MASK_MIDDLE, true);
}
-- (void)otherMouseDragged:(NSEvent *)event
-{
- [self mouseMoved:event];
+- (void)otherMouseDragged:(NSEvent *)event {
+ [self mouseMoved:event];
}
-- (void)otherMouseUp:(NSEvent *)event
-{
+- (void)otherMouseUp:(NSEvent *)event {
- if ((int) [event buttonNumber]!=2)
+ if ((int)[event buttonNumber] != 2)
return;
- button_mask&=~BUTTON_MASK_MIDDLE;
- InputEvent ev;
- ev.type=InputEvent::MOUSE_BUTTON;
- ev.mouse_button.button_index=BUTTON_MIDDLE;
- ev.mouse_button.pressed=false;
- ev.mouse_button.x=mouse_x;
- ev.mouse_button.y=mouse_y;
- ev.mouse_button.global_x=mouse_x;
- ev.mouse_button.global_y=mouse_y;
- ev.mouse_button.button_mask=button_mask;
- ev.mouse_button.mod = translateFlags([event modifierFlags]);
- OS_OSX::singleton->push_input(ev);
- /* _glfwInputMouseClick(window,
- (int) [event buttonNumber],
- GLFW_RELEASE,
- translateFlags([event modifierFlags]));*/
-}
-
-- (void)mouseExited:(NSEvent *)event
-{
+ _mouseDownEvent(event, BUTTON_MIDDLE, BUTTON_MASK_MIDDLE, false);
+}
+
+- (void)mouseExited:(NSEvent *)event {
if (!OS_OSX::singleton)
return;
- if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode!=OS::MOUSE_MODE_CAPTURED)
+ if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode != OS::MOUSE_MODE_CAPTURED)
OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_EXIT);
if (OS_OSX::singleton->input)
OS_OSX::singleton->input->set_mouse_in_window(false);
- // _glfwInputCursorEnter(window, GL_FALSE);
}
-- (void)mouseEntered:(NSEvent *)event
-{
- // _glfwInputCursorEnter(window, GL_TRUE);
+- (void)mouseEntered:(NSEvent *)event {
if (!OS_OSX::singleton)
return;
- if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode!=OS::MOUSE_MODE_CAPTURED)
+ if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode != OS::MOUSE_MODE_CAPTURED)
OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER);
if (OS_OSX::singleton->input)
OS_OSX::singleton->input->set_mouse_in_window(true);
-
}
-- (void)viewDidChangeBackingProperties
-{
- /* const NSRect contentRect = [window->ns.view frame];
- const NSRect fbRect = convertRectToBacking(window, contentRect);
-
- _glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);*/
+- (void)viewDidChangeBackingProperties {
+ // nothing left to do here
}
-- (void)updateTrackingAreas
-{
- if (trackingArea != nil)
- {
- [self removeTrackingArea:trackingArea];
- [trackingArea release];
- }
+- (void)updateTrackingAreas {
+ if (trackingArea != nil) {
+ [self removeTrackingArea:trackingArea];
+ [trackingArea release];
+ }
- NSTrackingAreaOptions options = NSTrackingMouseEnteredAndExited |
- NSTrackingActiveInKeyWindow |
- NSTrackingCursorUpdate |
- NSTrackingInVisibleRect;
+ NSTrackingAreaOptions options =
+ NSTrackingMouseEnteredAndExited |
+ NSTrackingActiveInKeyWindow |
+ NSTrackingCursorUpdate |
+ NSTrackingInVisibleRect;
- trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds]
- options:options
- owner:self
- userInfo:nil];
+ trackingArea = [[NSTrackingArea alloc]
+ initWithRect:[self bounds]
+ options:options
+ owner:self
+ userInfo:nil];
- [self addTrackingArea:trackingArea];
- [super updateTrackingAreas];
+ [self addTrackingArea:trackingArea];
+ [super updateTrackingAreas];
}
// Translates a OS X keycode to a Godot keycode
//
-static int translateKey(unsigned int key)
-{
- // Keyboard symbol translation table
- static const unsigned int table[128] =
- {
- /* 00 */ KEY_A,
- /* 01 */ KEY_S,
- /* 02 */ KEY_D,
- /* 03 */ KEY_F,
- /* 04 */ KEY_H,
- /* 05 */ KEY_G,
- /* 06 */ KEY_Z,
- /* 07 */ KEY_X,
- /* 08 */ KEY_C,
- /* 09 */ KEY_V,
- /* 0a */ KEY_UNKNOWN,
- /* 0b */ KEY_B,
- /* 0c */ KEY_Q,
- /* 0d */ KEY_W,
- /* 0e */ KEY_E,
- /* 0f */ KEY_R,
- /* 10 */ KEY_Y,
- /* 11 */ KEY_T,
- /* 12 */ KEY_1,
- /* 13 */ KEY_2,
- /* 14 */ KEY_3,
- /* 15 */ KEY_4,
- /* 16 */ KEY_6,
- /* 17 */ KEY_5,
- /* 18 */ KEY_EQUAL,
- /* 19 */ KEY_9,
- /* 1a */ KEY_7,
- /* 1b */ KEY_MINUS,
- /* 1c */ KEY_8,
- /* 1d */ KEY_0,
- /* 1e */ KEY_BRACERIGHT,
- /* 1f */ KEY_O,
- /* 20 */ KEY_U,
- /* 21 */ KEY_BRACELEFT,
- /* 22 */ KEY_I,
- /* 23 */ KEY_P,
- /* 24 */ KEY_RETURN,
- /* 25 */ KEY_L,
- /* 26 */ KEY_J,
- /* 27 */ KEY_APOSTROPHE,
- /* 28 */ KEY_K,
- /* 29 */ KEY_SEMICOLON,
- /* 2a */ KEY_BACKSLASH,
- /* 2b */ KEY_COMMA,
- /* 2c */ KEY_SLASH,
- /* 2d */ KEY_N,
- /* 2e */ KEY_M,
- /* 2f */ KEY_PERIOD,
- /* 30 */ KEY_TAB,
- /* 31 */ KEY_SPACE,
- /* 32 */ KEY_QUOTELEFT,
- /* 33 */ KEY_BACKSPACE,
- /* 34 */ KEY_UNKNOWN,
- /* 35 */ KEY_ESCAPE,
- /* 36 */ KEY_META,
- /* 37 */ KEY_META,
- /* 38 */ KEY_SHIFT,
- /* 39 */ KEY_CAPSLOCK,
- /* 3a */ KEY_ALT,
- /* 3b */ KEY_CONTROL,
- /* 3c */ KEY_SHIFT,
- /* 3d */ KEY_ALT,
- /* 3e */ KEY_CONTROL,
- /* 3f */ KEY_UNKNOWN, /* Function */
- /* 40 */ KEY_UNKNOWN,
- /* 41 */ KEY_KP_PERIOD,
- /* 42 */ KEY_UNKNOWN,
- /* 43 */ KEY_KP_MULTIPLY,
- /* 44 */ KEY_UNKNOWN,
- /* 45 */ KEY_KP_ADD,
- /* 46 */ KEY_UNKNOWN,
- /* 47 */ KEY_NUMLOCK, /* Really KeypadClear... */
- /* 48 */ KEY_UNKNOWN, /* VolumeUp */
- /* 49 */ KEY_UNKNOWN, /* VolumeDown */
- /* 4a */ KEY_UNKNOWN, /* Mute */
- /* 4b */ KEY_KP_DIVIDE,
- /* 4c */ KEY_KP_ENTER,
- /* 4d */ KEY_UNKNOWN,
- /* 4e */ KEY_KP_SUBTRACT,
- /* 4f */ KEY_UNKNOWN,
- /* 50 */ KEY_UNKNOWN,
- /* 51 */ KEY_EQUAL, //wtf equal?
- /* 52 */ KEY_KP_0,
- /* 53 */ KEY_KP_1,
- /* 54 */ KEY_KP_2,
- /* 55 */ KEY_KP_3,
- /* 56 */ KEY_KP_4,
- /* 57 */ KEY_KP_5,
- /* 58 */ KEY_KP_6,
- /* 59 */ KEY_KP_7,
- /* 5a */ KEY_UNKNOWN,
- /* 5b */ KEY_KP_8,
- /* 5c */ KEY_KP_9,
- /* 5d */ KEY_UNKNOWN,
- /* 5e */ KEY_UNKNOWN,
- /* 5f */ KEY_UNKNOWN,
- /* 60 */ KEY_F5,
- /* 61 */ KEY_F6,
- /* 62 */ KEY_F7,
- /* 63 */ KEY_F3,
- /* 64 */ KEY_F8,
- /* 65 */ KEY_F9,
- /* 66 */ KEY_UNKNOWN,
- /* 67 */ KEY_F11,
- /* 68 */ KEY_UNKNOWN,
- /* 69 */ KEY_F13,
- /* 6a */ KEY_F16,
- /* 6b */ KEY_F14,
- /* 6c */ KEY_UNKNOWN,
- /* 6d */ KEY_F10,
- /* 6e */ KEY_UNKNOWN,
- /* 6f */ KEY_F12,
- /* 70 */ KEY_UNKNOWN,
- /* 71 */ KEY_F15,
- /* 72 */ KEY_INSERT, /* Really Help... */
- /* 73 */ KEY_HOME,
- /* 74 */ KEY_PAGEUP,
- /* 75 */ KEY_DELETE,
- /* 76 */ KEY_F4,
- /* 77 */ KEY_END,
- /* 78 */ KEY_F2,
- /* 79 */ KEY_PAGEDOWN,
- /* 7a */ KEY_F1,
- /* 7b */ KEY_LEFT,
- /* 7c */ KEY_RIGHT,
- /* 7d */ KEY_DOWN,
- /* 7e */ KEY_UP,
- /* 7f */ KEY_UNKNOWN,
- };
-
- if (key >= 128)
- return KEY_UNKNOWN;
-
- return table[key];
-}
-- (void)keyDown:(NSEvent *)event
-{
- InputEvent ev;
- ev.type=InputEvent::KEY;
- ev.key.pressed=true;
- ev.key.mod=translateFlags([event modifierFlags]);
- ev.key.scancode = latin_keyboard_keycode_convert(translateKey([event keyCode]));
- ev.key.echo = [event isARepeat];
-
- NSString* characters = [event characters];
- NSUInteger i, length = [characters length];
-
-
- if (length>0 && keycode_has_unicode(ev.key.scancode)) {
-
-
- for (i = 0; i < length; i++) {
- ev.key.unicode=[characters characterAtIndex:i];
- OS_OSX::singleton->push_input(ev);
- ev.key.scancode=0;
- }
+static int translateKey(unsigned int key) {
+ // Keyboard symbol translation table
+ static const unsigned int table[128] = {
+ /* 00 */ KEY_A,
+ /* 01 */ KEY_S,
+ /* 02 */ KEY_D,
+ /* 03 */ KEY_F,
+ /* 04 */ KEY_H,
+ /* 05 */ KEY_G,
+ /* 06 */ KEY_Z,
+ /* 07 */ KEY_X,
+ /* 08 */ KEY_C,
+ /* 09 */ KEY_V,
+ /* 0a */ KEY_UNKNOWN,
+ /* 0b */ KEY_B,
+ /* 0c */ KEY_Q,
+ /* 0d */ KEY_W,
+ /* 0e */ KEY_E,
+ /* 0f */ KEY_R,
+ /* 10 */ KEY_Y,
+ /* 11 */ KEY_T,
+ /* 12 */ KEY_1,
+ /* 13 */ KEY_2,
+ /* 14 */ KEY_3,
+ /* 15 */ KEY_4,
+ /* 16 */ KEY_6,
+ /* 17 */ KEY_5,
+ /* 18 */ KEY_EQUAL,
+ /* 19 */ KEY_9,
+ /* 1a */ KEY_7,
+ /* 1b */ KEY_MINUS,
+ /* 1c */ KEY_8,
+ /* 1d */ KEY_0,
+ /* 1e */ KEY_BRACERIGHT,
+ /* 1f */ KEY_O,
+ /* 20 */ KEY_U,
+ /* 21 */ KEY_BRACELEFT,
+ /* 22 */ KEY_I,
+ /* 23 */ KEY_P,
+ /* 24 */ KEY_ENTER,
+ /* 25 */ KEY_L,
+ /* 26 */ KEY_J,
+ /* 27 */ KEY_APOSTROPHE,
+ /* 28 */ KEY_K,
+ /* 29 */ KEY_SEMICOLON,
+ /* 2a */ KEY_BACKSLASH,
+ /* 2b */ KEY_COMMA,
+ /* 2c */ KEY_SLASH,
+ /* 2d */ KEY_N,
+ /* 2e */ KEY_M,
+ /* 2f */ KEY_PERIOD,
+ /* 30 */ KEY_TAB,
+ /* 31 */ KEY_SPACE,
+ /* 32 */ KEY_QUOTELEFT,
+ /* 33 */ KEY_BACKSPACE,
+ /* 34 */ KEY_UNKNOWN,
+ /* 35 */ KEY_ESCAPE,
+ /* 36 */ KEY_META,
+ /* 37 */ KEY_META,
+ /* 38 */ KEY_SHIFT,
+ /* 39 */ KEY_CAPSLOCK,
+ /* 3a */ KEY_ALT,
+ /* 3b */ KEY_CONTROL,
+ /* 3c */ KEY_SHIFT,
+ /* 3d */ KEY_ALT,
+ /* 3e */ KEY_CONTROL,
+ /* 3f */ KEY_UNKNOWN, /* Function */
+ /* 40 */ KEY_UNKNOWN,
+ /* 41 */ KEY_KP_PERIOD,
+ /* 42 */ KEY_UNKNOWN,
+ /* 43 */ KEY_KP_MULTIPLY,
+ /* 44 */ KEY_UNKNOWN,
+ /* 45 */ KEY_KP_ADD,
+ /* 46 */ KEY_UNKNOWN,
+ /* 47 */ KEY_NUMLOCK, /* Really KeypadClear... */
+ /* 48 */ KEY_UNKNOWN, /* VolumeUp */
+ /* 49 */ KEY_UNKNOWN, /* VolumeDown */
+ /* 4a */ KEY_UNKNOWN, /* Mute */
+ /* 4b */ KEY_KP_DIVIDE,
+ /* 4c */ KEY_KP_ENTER,
+ /* 4d */ KEY_UNKNOWN,
+ /* 4e */ KEY_KP_SUBTRACT,
+ /* 4f */ KEY_UNKNOWN,
+ /* 50 */ KEY_UNKNOWN,
+ /* 51 */ KEY_EQUAL, //wtf equal?
+ /* 52 */ KEY_KP_0,
+ /* 53 */ KEY_KP_1,
+ /* 54 */ KEY_KP_2,
+ /* 55 */ KEY_KP_3,
+ /* 56 */ KEY_KP_4,
+ /* 57 */ KEY_KP_5,
+ /* 58 */ KEY_KP_6,
+ /* 59 */ KEY_KP_7,
+ /* 5a */ KEY_UNKNOWN,
+ /* 5b */ KEY_KP_8,
+ /* 5c */ KEY_KP_9,
+ /* 5d */ KEY_UNKNOWN,
+ /* 5e */ KEY_UNKNOWN,
+ /* 5f */ KEY_UNKNOWN,
+ /* 60 */ KEY_F5,
+ /* 61 */ KEY_F6,
+ /* 62 */ KEY_F7,
+ /* 63 */ KEY_F3,
+ /* 64 */ KEY_F8,
+ /* 65 */ KEY_F9,
+ /* 66 */ KEY_UNKNOWN,
+ /* 67 */ KEY_F11,
+ /* 68 */ KEY_UNKNOWN,
+ /* 69 */ KEY_F13,
+ /* 6a */ KEY_F16,
+ /* 6b */ KEY_F14,
+ /* 6c */ KEY_UNKNOWN,
+ /* 6d */ KEY_F10,
+ /* 6e */ KEY_UNKNOWN,
+ /* 6f */ KEY_F12,
+ /* 70 */ KEY_UNKNOWN,
+ /* 71 */ KEY_F15,
+ /* 72 */ KEY_INSERT, /* Really Help... */
+ /* 73 */ KEY_HOME,
+ /* 74 */ KEY_PAGEUP,
+ /* 75 */ KEY_DELETE,
+ /* 76 */ KEY_F4,
+ /* 77 */ KEY_END,
+ /* 78 */ KEY_F2,
+ /* 79 */ KEY_PAGEDOWN,
+ /* 7a */ KEY_F1,
+ /* 7b */ KEY_LEFT,
+ /* 7c */ KEY_RIGHT,
+ /* 7d */ KEY_DOWN,
+ /* 7e */ KEY_UP,
+ /* 7f */ KEY_UNKNOWN,
+ };
- } else {
- OS_OSX::singleton->push_input(ev);
- }
+ if (key >= 128)
+ return KEY_UNKNOWN;
+
+ return table[key];
+}
+
+- (void)keyDown:(NSEvent *)event {
+
+ Ref<InputEventKey> k;
+ k.instance();
+
+ get_key_modifier_state([event modifierFlags], k);
+ k->set_pressed(true);
+ k->set_scancode(latin_keyboard_keycode_convert(translateKey([event keyCode])));
+ k->set_echo([event isARepeat]);
+
+ NSString *characters = [event characters];
+ NSUInteger i, length = [characters length];
+
+ //disable raw input in IME mode
+ if (!imeMode)
+ OS_OSX::singleton->push_input(k);
+
+ if ((OS_OSX::singleton->im_position.x != 0) && (OS_OSX::singleton->im_position.y != 0))
+ [self interpretKeyEvents:[NSArray arrayWithObject:event]];
}
-- (void)flagsChanged:(NSEvent *)event
-{
- InputEvent ev;
+- (void)flagsChanged:(NSEvent *)event {
+ Ref<InputEventKey> k;
+ k.instance();
+
int key = [event keyCode];
int mod = [event modifierFlags];
- ev.type=InputEvent::KEY;
-
if (key == 0x36 || key == 0x37) {
if (mod & NSCommandKeyMask) {
- mod&= ~NSCommandKeyMask;
- ev.key.pressed = true;
+ mod &= ~NSCommandKeyMask;
+ k->set_pressed(true);
} else {
- ev.key.pressed = false;
+ k->set_pressed(false);
}
} else if (key == 0x38 || key == 0x3c) {
if (mod & NSShiftKeyMask) {
- mod&= ~NSShiftKeyMask;
- ev.key.pressed = true;
+ mod &= ~NSShiftKeyMask;
+ k->set_pressed(true);
} else {
- ev.key.pressed = false;
+ k->set_pressed(false);
}
} else if (key == 0x3a || key == 0x3d) {
if (mod & NSAlternateKeyMask) {
- mod&= ~NSAlternateKeyMask;
- ev.key.pressed = true;
+ mod &= ~NSAlternateKeyMask;
+ k->set_pressed(true);
} else {
- ev.key.pressed = false;
+ k->set_pressed(false);
}
} else if (key == 0x3b || key == 0x3e) {
if (mod & NSControlKeyMask) {
- mod&= ~NSControlKeyMask;
- ev.key.pressed = true;
+ mod &= ~NSControlKeyMask;
+ k->set_pressed(true);
} else {
- ev.key.pressed = false;
+ k->set_pressed(false);
}
} else {
return;
}
- ev.key.mod=translateFlags(mod);
- ev.key.scancode = latin_keyboard_keycode_convert(translateKey(key));
+ get_key_modifier_state(mod, k);
+ k->set_scancode(latin_keyboard_keycode_convert(translateKey(key)));
- OS_OSX::singleton->push_input(ev);
+ OS_OSX::singleton->push_input(k);
}
-- (void)keyUp:(NSEvent *)event
-{
+- (void)keyUp:(NSEvent *)event {
- InputEvent ev;
- ev.type=InputEvent::KEY;
- ev.key.pressed=false;
- ev.key.mod=translateFlags([event modifierFlags]);
- ev.key.scancode = latin_keyboard_keycode_convert(translateKey([event keyCode]));
- OS_OSX::singleton->push_input(ev);
+ Ref<InputEventKey> k;
+ k.instance();
+ get_key_modifier_state([event modifierFlags], k);
+ k->set_pressed(false);
+ k->set_scancode(latin_keyboard_keycode_convert(translateKey([event keyCode])));
- /* const int key = translateKey([event keyCode]);
- const int mods = translateFlags([event modifierFlags]);
- _glfwInputKey(window, key, [event keyCode], GLFW_RELEASE, mods);*/
+ OS_OSX::singleton->push_input(k);
}
-- (void)scrollWheel:(NSEvent *)event
-{
+inline void sendScrollEvent(int button, double factor, int modifierFlags) {
- double deltaX, deltaY;
+ Ref<InputEventMouseButton> sc;
+ sc.instance();
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
- if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6)
- {
- deltaX = [event scrollingDeltaX];
- deltaY = [event scrollingDeltaY];
-
- if ([event hasPreciseScrollingDeltas])
- {
- deltaX *= 0.1;
- deltaY *= 0.1;
- }
- }
- else
-#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
- {
- deltaX = [event deltaX];
- deltaY = [event deltaY];
- }
+ get_key_modifier_state(modifierFlags, sc);
+ sc->set_button_index(button);
+ sc->set_factor(factor);
+ sc->set_pressed(true);
+ Vector2 mouse_pos = Vector2(mouse_x, mouse_y);
+ sc->set_position(mouse_pos);
+ sc->set_global_position(mouse_pos);
+ sc->set_button_mask(button_mask);
+ OS_OSX::singleton->push_input(sc);
+ sc->set_pressed(false);
+ OS_OSX::singleton->push_input(sc);
+}
+- (void)scrollWheel:(NSEvent *)event {
+ double deltaX, deltaY;
- if (fabs(deltaY)) {
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+ if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) {
+ deltaX = [event scrollingDeltaX];
+ deltaY = [event scrollingDeltaY];
- InputEvent ev;
- ev.type=InputEvent::MOUSE_BUTTON;
- ev.mouse_button.button_index=deltaY >0 ? BUTTON_WHEEL_UP : BUTTON_WHEEL_DOWN;
- ev.mouse_button.pressed=true;
- ev.mouse_button.x=mouse_x;
- ev.mouse_button.y=mouse_y;
- ev.mouse_button.global_x=mouse_x;
- ev.mouse_button.global_y=mouse_y;
- ev.mouse_button.button_mask=button_mask;
- OS_OSX::singleton->push_input(ev);
- ev.mouse_button.pressed=false;
- OS_OSX::singleton->push_input(ev);
+ if ([event hasPreciseScrollingDeltas]) {
+ deltaX *= 0.03;
+ deltaY *= 0.03;
+ }
+ } else
+#endif // MAC_OS_X_VERSION_MAX_ALLOWED
+ {
+ deltaX = [event deltaX];
+ deltaY = [event deltaY];
}
-
if (fabs(deltaX)) {
-
- InputEvent ev;
- ev.type=InputEvent::MOUSE_BUTTON;
- ev.mouse_button.button_index=deltaX < 0 ? BUTTON_WHEEL_RIGHT : BUTTON_WHEEL_LEFT;
- ev.mouse_button.pressed=true;
- ev.mouse_button.x=mouse_x;
- ev.mouse_button.y=mouse_y;
- ev.mouse_button.global_x=mouse_x;
- ev.mouse_button.global_y=mouse_y;
- ev.mouse_button.button_mask=button_mask;
- OS_OSX::singleton->push_input(ev);
- ev.mouse_button.pressed=false;
- OS_OSX::singleton->push_input(ev);
+ sendScrollEvent(0 > deltaX ? BUTTON_WHEEL_RIGHT : BUTTON_WHEEL_LEFT, fabs(deltaX * 0.3), [event modifierFlags]);
+ }
+ if (fabs(deltaY)) {
+ sendScrollEvent(0 < deltaY ? BUTTON_WHEEL_UP : BUTTON_WHEEL_DOWN, fabs(deltaY * 0.3), [event modifierFlags]);
}
}
@end
-@interface GodotWindow : NSWindow {}
+@interface GodotWindow : NSWindow {
+}
@end
@implementation GodotWindow
-
-- (BOOL)canBecomeKeyWindow
-{
- // Required for NSBorderlessWindowMask windows
- return YES;
+- (BOOL)canBecomeKeyWindow {
+ // Required for NSBorderlessWindowMask windows
+ return YES;
}
@end
+void OS_OSX::set_ime_intermediate_text_callback(ImeCallback p_callback, void *p_inp) {
+ im_callback = p_callback;
+ im_target = p_inp;
+ if (!im_callback) {
+ [window_view cancelComposition];
+ }
+}
-int OS_OSX::get_video_driver_count() const {
+void OS_OSX::set_ime_position(const Point2 &p_pos) {
+ im_position = p_pos;
+}
+int OS_OSX::get_video_driver_count() const {
return 1;
}
-const char * OS_OSX::get_video_driver_name(int p_driver) const {
+
+const char *OS_OSX::get_video_driver_name(int p_driver) const {
return "GLES2";
}
@@ -924,14 +896,13 @@ const char * OS_OSX::get_video_driver_name(int p_driver) const {
OS::VideoMode OS_OSX::get_default_video_mode() const {
VideoMode vm;
- vm.width=1024;
- vm.height=600;
- vm.fullscreen=false;
- vm.resizable=true;
+ vm.width = 1024;
+ vm.height = 600;
+ vm.fullscreen = false;
+ vm.resizable = true;
return vm;
}
-
void OS_OSX::initialize_core() {
OS_Unix::initialize_core();
@@ -941,7 +912,6 @@ void OS_OSX::initialize_core() {
DirAccess::make_default<DirAccessOSX>(DirAccess::ACCESS_FILESYSTEM);
SemaphoreOSX::make_default();
-
}
static bool keyboard_layout_dirty = true;
@@ -949,7 +919,7 @@ static void keyboardLayoutChanged(CFNotificationCenterRef center, void *observer
keyboard_layout_dirty = true;
}
-void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audio_driver) {
+void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
/*** OSX INITIALIZATION ***/
/*** OSX INITIALIZATION ***/
@@ -959,43 +929,48 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
// Register to be notified on keyboard layout changes
CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(),
- NULL, keyboardLayoutChanged,
- kTISNotifySelectedKeyboardInputSourceChanged, NULL,
- CFNotificationSuspensionBehaviorDeliverImmediately);
+ NULL, keyboardLayoutChanged,
+ kTISNotifySelectedKeyboardInputSourceChanged, NULL,
+ CFNotificationSuspensionBehaviorDeliverImmediately);
if (is_hidpi_allowed() && [[NSScreen mainScreen] respondsToSelector:@selector(backingScaleFactor)]) {
- for (NSScreen *screen in [NSScreen screens]) {
- float s = [screen backingScaleFactor];
- if (s > display_scale) {
- display_scale=s;
- }
- }
+ for (NSScreen *screen in [NSScreen screens]) {
+ float s = [screen backingScaleFactor];
+ if (s > display_scale) {
+ display_scale = s;
+ }
+ }
}
window_delegate = [[GodotWindowDelegate alloc] init];
- // Don't use accumulation buffer support; it's not accelerated
- // Aux buffers probably aren't accelerated either
+ // Don't use accumulation buffer support; it's not accelerated
+ // Aux buffers probably aren't accelerated either
- unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | (p_desired.resizable?NSResizableWindowMask:0);
+ unsigned int styleMask;
+ if (p_desired.borderless_window) {
+ styleMask = NSWindowStyleMaskBorderless;
+ } else {
+ styleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | (p_desired.resizable ? NSResizableWindowMask : 0);
+ }
window_object = [[GodotWindow alloc]
- initWithContentRect:NSMakeRect(0, 0, p_desired.width/display_scale, p_desired.height/display_scale)
- styleMask:styleMask
- backing:NSBackingStoreBuffered
- defer:NO];
+ initWithContentRect:NSMakeRect(0, 0, p_desired.width, p_desired.height)
+ styleMask:styleMask
+ backing:NSBackingStoreBuffered
+ defer:NO];
- ERR_FAIL_COND( window_object==nil );
+ ERR_FAIL_COND(window_object == nil);
window_view = [[GodotContentView alloc] init];
- window_size.width = p_desired.width;
- window_size.height = p_desired.height;
+ window_size.width = p_desired.width * display_scale;
+ window_size.height = p_desired.height * display_scale;
- if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6 && display_scale>1) {
- [window_view setWantsBestResolutionOpenGLSurface:YES];
- //if (current_videomode.resizable)
+ if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6 && display_scale > 1) {
+ [window_view setWantsBestResolutionOpenGLSurface:YES];
+ //if (current_videomode.resizable)
[window_object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}
@@ -1013,11 +988,15 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
// OS X needs non-zero color size, so set resonable values
int colorBits = 32;
- // Fail if a robustness strategy was requested
-
+// Fail if a robustness strategy was requested
-#define ADD_ATTR(x) { attributes[attributeCount++] = x; }
-#define ADD_ATTR2(x, y) { ADD_ATTR(x); ADD_ATTR(y); }
+#define ADD_ATTR(x) \
+ { attributes[attributeCount++] = x; }
+#define ADD_ATTR2(x, y) \
+ { \
+ ADD_ATTR(x); \
+ ADD_ATTR(y); \
+ }
// Arbitrary array size here
NSOpenGLPixelFormatAttribute attributes[40];
@@ -1030,21 +1009,26 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
ADD_ATTR2(NSOpenGLPFAColorSize, colorBits);
- /* if (fbconfig->alphaBits > 0)
- ADD_ATTR2(NSOpenGLPFAAlphaSize, fbconfig->alphaBits);*/
+ /*
+ if (fbconfig->alphaBits > 0)
+ ADD_ATTR2(NSOpenGLPFAAlphaSize, fbconfig->alphaBits);
+*/
ADD_ATTR2(NSOpenGLPFADepthSize, 24);
ADD_ATTR2(NSOpenGLPFAStencilSize, 8);
- /*if (fbconfig->stereo)
- ADD_ATTR(NSOpenGLPFAStereo);*/
+ /*
+ if (fbconfig->stereo)
+ ADD_ATTR(NSOpenGLPFAStereo);
+*/
- /* if (fbconfig->samples > 0)
- {
- ADD_ATTR2(NSOpenGLPFASampleBuffers, 1);
- ADD_ATTR2(NSOpenGLPFASamples, fbconfig->samples);
- }*/
+ /*
+ if (fbconfig->samples > 0) {
+ ADD_ATTR2(NSOpenGLPFASampleBuffers, 1);
+ ADD_ATTR2(NSOpenGLPFASamples, fbconfig->samples);
+ }
+*/
// NOTE: All NSOpenGLPixelFormats on the relevant cards support sRGB
// frambuffer, so there's no need (and no way) to request it
@@ -1055,14 +1039,11 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
#undef ADD_ATTR2
pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
- ERR_FAIL_COND( pixelFormat == nil);
-
+ ERR_FAIL_COND(pixelFormat == nil);
- context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat
- shareContext:nil];
-
- ERR_FAIL_COND(context==nil);
+ context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
+ ERR_FAIL_COND(context == nil);
[context setView:window_view];
@@ -1070,6 +1051,8 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
[NSApp activateIgnoringOtherApps:YES];
+ _update_window();
+
[window_object makeKeyAndOrderFront:nil];
if (p_desired.fullscreen)
@@ -1079,79 +1062,49 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
/*** END OSX INITIALIZATION ***/
/*** END OSX INITIALIZATION ***/
- bool use_gl2=p_video_driver!=1;
-
-
+ bool use_gl2 = p_video_driver != 1;
AudioDriverManager::add_driver(&audio_driver_osx);
- // only opengl support here...
+ // only opengl support here...
RasterizerGLES3::register_config();
RasterizerGLES3::make_current();
//rasterizer = instance_RasterizerGLES2();
//visual_server = memnew( VisualServerRaster(rasterizer) );
- visual_server = memnew( VisualServerRaster );
- // FIXME: Reimplement threaded rendering? Or remove?
- /*
- if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) {
- visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD));
+ visual_server = memnew(VisualServerRaster);
+ if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
+
+ visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
}
- */
visual_server->init();
- visual_server->cursor_set_visible(false, 0);
+ // visual_server->cursor_set_visible(false, 0);
AudioDriverManager::get_driver(p_audio_driver)->set_singleton();
- if (AudioDriverManager::get_driver(p_audio_driver)->init()!=OK) {
+ if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) {
ERR_PRINT("Initializing audio failed.");
}
//
- physics_server = memnew( PhysicsServerSW );
+ physics_server = memnew(PhysicsServerSW);
physics_server->init();
//physics_2d_server = memnew( Physics2DServerSW );
physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>();
physics_2d_server->init();
- input = memnew( InputDefault );
- joypad_osx = memnew( JoypadOSX );
+ input = memnew(InputDefault);
+ joypad_osx = memnew(JoypadOSX);
- power_manager = memnew( power_osx );
+ power_manager = memnew(power_osx);
_ensure_data_dir();
- NSArray *screenArray = [NSScreen screens];
- printf("nscreen count %i\n", (int)[screenArray count]);
- for (int i=0; i<[screenArray count]; i++) {
-
- float displayScale = 1.0;
-
- if (display_scale>1.0 && [[screenArray objectAtIndex: i] respondsToSelector:@selector(backingScaleFactor)]) {
- displayScale = [[screenArray objectAtIndex: i] backingScaleFactor];
- }
-
- NSRect nsrect = [[screenArray objectAtIndex: i] visibleFrame];
- Rect2 rect = Rect2(nsrect.origin.x, nsrect.origin.y, nsrect.size.width, nsrect.size.height);
- rect.pos*=displayScale;
- rect.size*=displayScale;
- screens.push_back(rect);
-
- NSDictionary *description = [[screenArray objectAtIndex: i] deviceDescription];
- NSSize displayPixelSize = [[description objectForKey:NSDeviceSize] sizeValue];
- CGSize displayPhysicalSize = CGDisplayScreenSize(
- [[description objectForKey:@"NSScreenNumber"] unsignedIntValue]);
-
- //printf("width: %i pwidth %i rect width %i\n",int(displayPixelSize.width*displayScale),int(displayPhysicalSize.width*displayScale),int(nsrect.size.width));
- int dpi = (displayPixelSize.width * 25.4f / displayPhysicalSize.width)*displayScale;
-
- screen_dpi.push_back(dpi);
-
- };
restore_rect = Rect2(get_window_position(), get_window_size());
}
+
void OS_OSX::finalize() {
CFNotificationCenterRemoveObserver(CFNotificationCenterGetDistributedCenter(), NULL, kTISNotifySelectedKeyboardInputSourceChanged, NULL);
@@ -1169,17 +1122,12 @@ void OS_OSX::finalize() {
physics_2d_server->finish();
memdelete(physics_2d_server);
-
- screens.clear();
-
-
}
-void OS_OSX::set_main_loop( MainLoop * p_main_loop ) {
+void OS_OSX::set_main_loop(MainLoop *p_main_loop) {
- main_loop=p_main_loop;
+ main_loop = p_main_loop;
input->set_main_loop(p_main_loop);
-
}
void OS_OSX::delete_main_loop() {
@@ -1187,16 +1135,54 @@ void OS_OSX::delete_main_loop() {
if (!main_loop)
return;
memdelete(main_loop);
- main_loop=NULL;
+ main_loop = NULL;
}
-
String OS_OSX::get_name() {
return "OSX";
}
-void OS_OSX::alert(const String& p_alert, const String& p_title) {
+void OS_OSX::print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type) {
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101200
+ if (!_print_error_enabled)
+ return;
+
+ const char *err_details;
+ if (p_rationale && p_rationale[0])
+ err_details = p_rationale;
+ else
+ err_details = p_code;
+
+ switch (p_type) {
+ case ERR_ERROR:
+ os_log_error(OS_LOG_DEFAULT, "ERROR: %{public}s: %{public}s\nAt: %{public}s:%i.", p_function, err_details, p_file, p_line);
+ print("\E[1;31mERROR: %s: \E[0m\E[1m%s\n", p_function, err_details);
+ print("\E[0;31m At: %s:%i.\E[0m\n", p_file, p_line);
+ break;
+ case ERR_WARNING:
+ os_log_info(OS_LOG_DEFAULT, "WARNING: %{public}s: %{public}s\nAt: %{public}s:%i.", p_function, err_details, p_file, p_line);
+ print("\E[1;33mWARNING: %s: \E[0m\E[1m%s\n", p_function, err_details);
+ print("\E[0;33m At: %s:%i.\E[0m\n", p_file, p_line);
+ break;
+ case ERR_SCRIPT:
+ os_log_error(OS_LOG_DEFAULT, "SCRIPT ERROR: %{public}s: %{public}s\nAt: %{public}s:%i.", p_function, err_details, p_file, p_line);
+ print("\E[1;35mSCRIPT ERROR: %s: \E[0m\E[1m%s\n", p_function, err_details);
+ print("\E[0;35m At: %s:%i.\E[0m\n", p_file, p_line);
+ break;
+ case ERR_SHADER:
+ os_log_error(OS_LOG_DEFAULT, "SHADER ERROR: %{public}s: %{public}s\nAt: %{public}s:%i.", p_function, err_details, p_file, p_line);
+ print("\E[1;36mSHADER ERROR: %s: \E[0m\E[1m%s\n", p_function, err_details);
+ print("\E[0;36m At: %s:%i.\E[0m\n", p_file, p_line);
+ break;
+ }
+#else
+ OS_Unix::print_error(p_function, p_file, p_line, p_code, p_rationale, p_type);
+#endif
+}
+
+void OS_OSX::alert(const String &p_alert, const String &p_title) {
// Set OS X-compliant variables
NSAlert *window = [[NSAlert alloc] init];
NSString *ns_title = [NSString stringWithUTF8String:p_title.utf8().get_data()];
@@ -1214,10 +1200,10 @@ void OS_OSX::alert(const String& p_alert, const String& p_title) {
void OS_OSX::set_cursor_shape(CursorShape p_shape) {
- if (cursor_shape==p_shape)
+ if (cursor_shape == p_shape)
return;
- switch(p_shape) {
+ switch (p_shape) {
case CURSOR_ARROW: [[NSCursor arrowCursor] set]; break;
case CURSOR_IBEAM: [[NSCursor IBeamCursor] set]; break;
case CURSOR_POINTING_HAND: [[NSCursor pointingHandCursor] set]; break;
@@ -1238,101 +1224,97 @@ void OS_OSX::set_cursor_shape(CursorShape p_shape) {
default: {};
}
- cursor_shape=p_shape;
+ cursor_shape = p_shape;
}
void OS_OSX::set_mouse_show(bool p_show) {
-
}
-void OS_OSX::set_mouse_grab(bool p_grab) {
+void OS_OSX::set_mouse_grab(bool p_grab) {
}
+
bool OS_OSX::is_mouse_grab_enabled() const {
return mouse_grab;
}
-void OS_OSX::warp_mouse_pos(const Point2& p_to) {
-
- //copied from windows impl with osx native calls
- if (mouse_mode == MOUSE_MODE_CAPTURED){
- mouse_x = p_to.x;
- mouse_y = p_to.y;
- }
- else{ //set OS position
+void OS_OSX::warp_mouse_pos(const Point2 &p_to) {
- /* this code has not been tested, please be a kind soul and fix it if it fails! */
+ //copied from windows impl with osx native calls
+ if (mouse_mode == MOUSE_MODE_CAPTURED) {
+ mouse_x = p_to.x;
+ mouse_y = p_to.y;
+ } else { //set OS position
- //local point in window coords
- NSPoint localPoint = { p_to.x, p_to.y };
+ //local point in window coords
+ const NSRect contentRect = [window_view frame];
+ NSRect pointInWindowRect = NSMakeRect(p_to.x / display_scale, contentRect.size.height - (p_to.y / display_scale) - 1, 0, 0);
+ NSPoint pointOnScreen = [[window_view window] convertRectToScreen:pointInWindowRect].origin;
- NSPoint pointInWindow = [window_view convertPoint:localPoint toView:nil];
- NSRect pointInWindowRect;
- pointInWindowRect.origin = pointInWindow;
- NSPoint pointOnScreen = [[window_view window] convertRectToScreen:pointInWindowRect].origin;
+ //point in scren coords
+ CGPoint lMouseWarpPos = { pointOnScreen.x, CGDisplayBounds(CGMainDisplayID()).size.height - pointOnScreen.y };
- //point in scren coords
- CGPoint lMouseWarpPos = { pointOnScreen.x, pointOnScreen.y};
-
- //do the warping
- CGEventSourceRef lEventRef = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState);
- CGEventSourceSetLocalEventsSuppressionInterval(lEventRef, 0.0);
- CGAssociateMouseAndMouseCursorPosition(false);
- CGWarpMouseCursorPosition(lMouseWarpPos);
- CGAssociateMouseAndMouseCursorPosition(true);
- }
+ //do the warping
+ CGEventSourceRef lEventRef = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState);
+ CGEventSourceSetLocalEventsSuppressionInterval(lEventRef, 0.0);
+ CGAssociateMouseAndMouseCursorPosition(false);
+ CGWarpMouseCursorPosition(lMouseWarpPos);
+ CGAssociateMouseAndMouseCursorPosition(true);
+ }
}
-Point2 OS_OSX::get_mouse_pos() const {
+Point2 OS_OSX::get_mouse_position() const {
- return Vector2(mouse_x,mouse_y);
+ return Vector2(mouse_x, mouse_y);
}
+
int OS_OSX::get_mouse_button_state() const {
return button_mask;
}
-void OS_OSX::set_window_title(const String& p_title) {
- [window_object setTitle:[NSString stringWithUTF8String:p_title.utf8().get_data()]];
+void OS_OSX::set_window_title(const String &p_title) {
+ title = p_title;
+ [window_object setTitle:[NSString stringWithUTF8String:p_title.utf8().get_data()]];
}
-void OS_OSX::set_icon(const Image& p_icon) {
-
- Image img=p_icon;
- img.convert(Image::FORMAT_RGBA8);
- NSBitmapImageRep *imgrep= [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes: NULL
- pixelsWide: p_icon.get_width()
- pixelsHigh: p_icon.get_height()
- bitsPerSample: 8
- samplesPerPixel: 4
- hasAlpha: YES
- isPlanar: NO
- colorSpaceName: NSDeviceRGBColorSpace
- bytesPerRow: p_icon.get_width()*4
- bitsPerPixel: 32] autorelease];
- ERR_FAIL_COND(imgrep==nil);
+void OS_OSX::set_icon(const Ref<Image> &p_icon) {
+
+ Ref<Image> img = p_icon;
+ img = img->duplicate();
+ img->convert(Image::FORMAT_RGBA8);
+ NSBitmapImageRep *imgrep = [[[NSBitmapImageRep alloc]
+ initWithBitmapDataPlanes:NULL
+ pixelsWide:img->get_width()
+ pixelsHigh:img->get_height()
+ bitsPerSample:8
+ samplesPerPixel:4
+ hasAlpha:YES
+ isPlanar:NO
+ colorSpaceName:NSDeviceRGBColorSpace
+ bytesPerRow:img->get_width() * 4
+ bitsPerPixel:32] autorelease];
+ ERR_FAIL_COND(imgrep == nil);
uint8_t *pixels = [imgrep bitmapData];
- int len = img.get_width()*img.get_height();
- PoolVector<uint8_t> data = img.get_data();
+ int len = img->get_width() * img->get_height();
+ PoolVector<uint8_t> data = img->get_data();
PoolVector<uint8_t>::Read r = data.read();
/* Premultiply the alpha channel */
- for (int i = 0; i<len ; i++) {
- uint8_t alpha = r[i*4+3];
- pixels[i*4+0] = (uint8_t)(((uint16_t)r[i*4+0] * alpha) / 255);
- pixels[i*4+1] = (uint8_t)(((uint16_t)r[i*4+1] * alpha) / 255);
- pixels[i*4+2] = (uint8_t)(((uint16_t)r[i*4+2] * alpha) / 255);
- pixels[i*4+3] = alpha;
-
+ for (int i = 0; i < len; i++) {
+ uint8_t alpha = r[i * 4 + 3];
+ pixels[i * 4 + 0] = (uint8_t)(((uint16_t)r[i * 4 + 0] * alpha) / 255);
+ pixels[i * 4 + 1] = (uint8_t)(((uint16_t)r[i * 4 + 1] * alpha) / 255);
+ pixels[i * 4 + 2] = (uint8_t)(((uint16_t)r[i * 4 + 2] * alpha) / 255);
+ pixels[i * 4 + 3] = alpha;
}
- NSImage *nsimg = [[[NSImage alloc] initWithSize: NSMakeSize(img.get_width(),img.get_height())] autorelease];
+ NSImage *nsimg = [[[NSImage alloc] initWithSize:NSMakeSize(img->get_width(), img->get_height())] autorelease];
ERR_FAIL_COND(nsimg == nil);
- [nsimg addRepresentation: imgrep];
+ [nsimg addRepresentation:imgrep];
[NSApp setApplicationIconImage:nsimg];
-
}
MainLoop *OS_OSX::get_main_loop() const {
@@ -1345,27 +1327,26 @@ bool OS_OSX::can_draw() const {
return true;
}
-void OS_OSX::set_clipboard(const String& p_text) {
+void OS_OSX::set_clipboard(const String &p_text) {
- NSArray* types = [NSArray arrayWithObjects:NSStringPboardType, nil];
+ NSArray *types = [NSArray arrayWithObjects:NSStringPboardType, nil];
- NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
+ NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
[pasteboard declareTypes:types owner:nil];
[pasteboard setString:[NSString stringWithUTF8String:p_text.utf8().get_data()]
- forType:NSStringPboardType];
+ forType:NSStringPboardType];
}
+
String OS_OSX::get_clipboard() const {
- NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
+ NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
- if (![[pasteboard types] containsObject:NSStringPboardType])
- {
+ if (![[pasteboard types] containsObject:NSStringPboardType]) {
return "";
}
- NSString* object = [pasteboard stringForType:NSStringPboardType];
- if (!object)
- {
+ NSString *object = [pasteboard stringForType:NSStringPboardType];
+ if (!object) {
return "";
}
@@ -1380,12 +1361,11 @@ String OS_OSX::get_clipboard() const {
void OS_OSX::release_rendering_thread() {
[NSOpenGLContext clearCurrentContext];
-
}
+
void OS_OSX::make_rendering_thread() {
[context makeCurrentContext];
-
}
Error OS_OSX::shell_open(String p_uri) {
@@ -1395,14 +1375,13 @@ Error OS_OSX::shell_open(String p_uri) {
}
String OS_OSX::get_locale() const {
- NSString* preferredLang = [[NSLocale preferredLanguages] objectAtIndex:0];
- return [preferredLang UTF8String];
+ NSString *locale_code = [[NSLocale currentLocale] localeIdentifier];
+ return [locale_code UTF8String];
}
void OS_OSX::swap_buffers() {
[context flushBuffer];
-
}
void OS_OSX::wm_minimized(bool p_minimized) {
@@ -1410,92 +1389,163 @@ void OS_OSX::wm_minimized(bool p_minimized) {
minimized = p_minimized;
};
-void OS_OSX::set_video_mode(const VideoMode& p_video_mode,int p_screen) {
-
+void OS_OSX::set_video_mode(const VideoMode &p_video_mode, int p_screen) {
}
OS::VideoMode OS_OSX::get_video_mode(int p_screen) const {
VideoMode vm;
- vm.width=window_size.width;
- vm.height=window_size.height;
+ vm.width = window_size.width;
+ vm.height = window_size.height;
return vm;
}
-void OS_OSX::get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen) const {
+void OS_OSX::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) const {
}
-
int OS_OSX::get_screen_count() const {
-
- return screens.size();
+ NSArray *screenArray = [NSScreen screens];
+ return [screenArray count];
};
int OS_OSX::get_current_screen() const {
-
- return current_screen;
+ Vector2 wpos = get_window_position();
+
+ int count = get_screen_count();
+ for (int i = 0; i < count; i++) {
+ Point2 pos = get_screen_position(i);
+ Size2 size = get_screen_size(i);
+ if ((wpos.x >= pos.x && wpos.x < pos.x + size.width) && (wpos.y >= pos.y && wpos.y < pos.y + size.height))
+ return i;
+ }
+ return 0;
};
void OS_OSX::set_current_screen(int p_screen) {
-
- current_screen = p_screen;
+ Vector2 wpos = get_window_position() - get_screen_position(get_current_screen());
+ set_window_position(wpos + get_screen_position(p_screen));
};
Point2 OS_OSX::get_screen_position(int p_screen) const {
+ NSArray *screenArray = [NSScreen screens];
+ if (p_screen < [screenArray count]) {
+ float displayScale = 1.0;
- ERR_FAIL_INDEX_V(p_screen, screens.size(), Point2());
- return screens[p_screen].pos;
-};
+ if (display_scale > 1.0 && [[screenArray objectAtIndex:p_screen] respondsToSelector:@selector(backingScaleFactor)]) {
+ displayScale = [[screenArray objectAtIndex:p_screen] backingScaleFactor];
+ }
+
+ NSRect nsrect = [[screenArray objectAtIndex:p_screen] frame];
+ return Point2(nsrect.origin.x, nsrect.origin.y) * displayScale;
+ }
+
+ return Point2();
+}
int OS_OSX::get_screen_dpi(int p_screen) const {
+ NSArray *screenArray = [NSScreen screens];
+ if (p_screen < [screenArray count]) {
+ float displayScale = 1.0;
+
+ if (display_scale > 1.0 && [[screenArray objectAtIndex:p_screen] respondsToSelector:@selector(backingScaleFactor)]) {
+ displayScale = [[screenArray objectAtIndex:p_screen] backingScaleFactor];
+ }
+
+ NSDictionary *description = [[screenArray objectAtIndex:p_screen] deviceDescription];
+ NSSize displayPixelSize = [[description objectForKey:NSDeviceSize] sizeValue];
+ CGSize displayPhysicalSize = CGDisplayScreenSize(
+ [[description objectForKey:@"NSScreenNumber"] unsignedIntValue]);
- ERR_FAIL_INDEX_V(p_screen, screens.size(), 72);
- return screen_dpi[p_screen];
+ return (displayPixelSize.width * 25.4f / displayPhysicalSize.width) * displayScale;
+ }
+
+ return 72;
}
Size2 OS_OSX::get_screen_size(int p_screen) const {
+ NSArray *screenArray = [NSScreen screens];
+ if (p_screen < [screenArray count]) {
+ float displayScale = 1.0;
- ERR_FAIL_INDEX_V(p_screen, screens.size(), Point2());
- return screens[p_screen].size;
-};
+ if (display_scale > 1.0 && [[screenArray objectAtIndex:p_screen] respondsToSelector:@selector(backingScaleFactor)]) {
+ displayScale = [[screenArray objectAtIndex:p_screen] backingScaleFactor];
+ }
+
+ // Note: Use frame to get the whole screen size
+ NSRect nsrect = [[screenArray objectAtIndex:p_screen] frame];
+ return Size2(nsrect.size.width, nsrect.size.height) * displayScale;
+ }
+
+ return Size2();
+}
+
+void OS_OSX::_update_window() {
+ bool borderless_full = false;
+
+ if (get_borderless_window()) {
+ NSRect frameRect = [window_object frame];
+ NSRect screenRect = [[window_object screen] frame];
+
+ // Check if our window covers up the screen
+ if (frameRect.origin.x <= screenRect.origin.x && frameRect.origin.y <= frameRect.origin.y &&
+ frameRect.size.width >= screenRect.size.width && frameRect.size.height >= screenRect.size.height) {
+ borderless_full = true;
+ }
+ }
+
+ if (borderless_full) {
+ // If the window covers up the screen set the level to above the main menu and hide on deactivate
+ [window_object setLevel:NSMainMenuWindowLevel + 1];
+ [window_object setHidesOnDeactivate:YES];
+ } else {
+ // Reset these when our window is not a borderless window that covers up the screen
+ [window_object setLevel:NSNormalWindowLevel];
+ [window_object setHidesOnDeactivate:NO];
+ }
+}
Point2 OS_OSX::get_window_position() const {
Size2 wp([window_object frame].origin.x, [window_object frame].origin.y);
- wp*=display_scale;
+ wp *= display_scale;
return wp;
};
+void OS_OSX::set_window_position(const Point2 &p_position) {
-void OS_OSX::set_window_position(const Point2& p_position) {
-
- Point2 size=p_position;
- size/=display_scale;
+ Point2 size = p_position;
+ size /= display_scale;
[window_object setFrame:NSMakeRect(size.x, size.y, [window_object frame].size.width, [window_object frame].size.height) display:YES];
+
+ _update_window();
};
Size2 OS_OSX::get_window_size() const {
return window_size;
-
};
void OS_OSX::set_window_size(const Size2 p_size) {
- Size2 size=p_size;
+ Size2 size = p_size;
- // NSRect used by setFrame includes the title bar, so add it to our size.y
- CGFloat menuBarHeight = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
- if (menuBarHeight != 0.f) {
- size.y+= menuBarHeight;
+ if (get_borderless_window() == false) {
+ // NSRect used by setFrame includes the title bar, so add it to our size.y
+ CGFloat menuBarHeight = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
+ if (menuBarHeight != 0.f) {
+ size.y += menuBarHeight;
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101104
- } else {
- size.y+= [[NSStatusBar systemStatusBar] thickness];
+ } else {
+ size.y += [[NSStatusBar systemStatusBar] thickness];
#endif
+ }
}
+
NSRect frame = [window_object frame];
[window_object setFrame:NSMakeRect(frame.origin.x, frame.origin.y, size.x, size.y) display:YES];
+
+ _update_window();
};
void OS_OSX::set_window_fullscreen(bool p_enabled) {
@@ -1513,7 +1563,7 @@ void OS_OSX::set_window_fullscreen(bool p_enabled) {
bool OS_OSX::is_window_fullscreen() const {
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
- if ( [window_object respondsToSelector:@selector(isZoomed)] )
+ if ([window_object respondsToSelector:@selector(isZoomed)])
return [window_object isZoomed];
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
@@ -1523,9 +1573,9 @@ bool OS_OSX::is_window_fullscreen() const {
void OS_OSX::set_window_resizable(bool p_enabled) {
if (p_enabled)
- [window_object setStyleMask:[window_object styleMask] | NSResizableWindowMask ];
+ [window_object setStyleMask:[window_object styleMask] | NSResizableWindowMask];
else
- [window_object setStyleMask:[window_object styleMask] & ~NSResizableWindowMask ];
+ [window_object setStyleMask:[window_object styleMask] & ~NSResizableWindowMask];
};
bool OS_OSX::is_window_resizable() const {
@@ -1543,21 +1593,20 @@ void OS_OSX::set_window_minimized(bool p_enabled) {
bool OS_OSX::is_window_minimized() const {
- if ( [window_object respondsToSelector:@selector(isMiniaturized)])
+ if ([window_object respondsToSelector:@selector(isMiniaturized)])
return [window_object isMiniaturized];
return minimized;
};
-
void OS_OSX::set_window_maximized(bool p_enabled) {
if (p_enabled) {
restore_rect = Rect2(get_window_position(), get_window_size());
- [window_object setFrame:[[[NSScreen screens] objectAtIndex:current_screen] visibleFrame] display:YES];
+ [window_object setFrame:[[[NSScreen screens] objectAtIndex:get_current_screen()] visibleFrame] display:YES];
} else {
set_window_size(restore_rect.size);
- set_window_position(restore_rect.pos);
+ set_window_position(restore_rect.position);
};
maximized = p_enabled;
};
@@ -1568,7 +1617,6 @@ bool OS_OSX::is_window_maximized() const {
return maximized;
};
-
void OS_OSX::move_window_to_foreground() {
[window_object orderFrontRegardless];
@@ -1579,6 +1627,35 @@ void OS_OSX::request_attention() {
[NSApp requestUserAttention:NSCriticalRequest];
}
+void OS_OSX::set_borderless_window(int p_borderless) {
+
+ // OrderOut prevents a lose focus bug with the window
+ [window_object orderOut:nil];
+
+ if (p_borderless) {
+ [window_object setStyleMask:NSWindowStyleMaskBorderless];
+ } else {
+ [window_object setStyleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask];
+
+ // Force update of the window styles
+ NSRect frameRect = [window_object frame];
+ [window_object setFrame:NSMakeRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width + 1, frameRect.size.height) display:NO];
+ [window_object setFrame:frameRect display:NO];
+
+ // Restore the window title
+ [window_object setTitle:[NSString stringWithUTF8String:title.utf8().get_data()]];
+ }
+
+ _update_window();
+
+ [window_object makeKeyAndOrderFront:nil];
+}
+
+bool OS_OSX::get_borderless_window() {
+
+ return [window_object styleMask] == NSWindowStyleMaskBorderless;
+}
+
String OS_OSX::get_executable_path() const {
int ret;
@@ -1586,8 +1663,8 @@ String OS_OSX::get_executable_path() const {
char pathbuf[PROC_PIDPATHINFO_MAXSIZE];
pid = getpid();
- ret = proc_pidpath (pid, pathbuf, sizeof(pathbuf));
- if ( ret <= 0 ) {
+ ret = proc_pidpath(pid, pathbuf, sizeof(pathbuf));
+ if (ret <= 0) {
return OS::get_executable_path();
} else {
String path;
@@ -1595,7 +1672,6 @@ String OS_OSX::get_executable_path() const {
return path;
}
-
}
// Returns string representation of keys, if they are printable.
@@ -1615,22 +1691,22 @@ static NSString *createStringForKeys(const CGKeyCode *keyCode, int length) {
OSStatus err;
CFMutableStringRef output = CFStringCreateMutable(NULL, 0);
- for (int i=0; i<length; ++i) {
+ for (int i = 0; i < length; ++i) {
UInt32 keysDown = 0;
UniChar chars[4];
UniCharCount realLength;
err = UCKeyTranslate(keyboardLayout,
- keyCode[i],
- kUCKeyActionDisplay,
- 0,
- LMGetKbdType(),
- kUCKeyTranslateNoDeadKeysBit,
- &keysDown,
- sizeof(chars) / sizeof(chars[0]),
- &realLength,
- chars);
+ keyCode[i],
+ kUCKeyActionDisplay,
+ 0,
+ LMGetKbdType(),
+ kUCKeyTranslateNoDeadKeysBit,
+ &keysDown,
+ sizeof(chars) / sizeof(chars[0]),
+ &realLength,
+ chars);
if (err != noErr) {
CFRelease(output);
@@ -1644,6 +1720,7 @@ static NSString *createStringForKeys(const CGKeyCode *keyCode, int length) {
return (NSString *)output;
}
+
OS::LatinKeyboardVariant OS_OSX::get_latin_keyboard_variant() const {
static LatinKeyboardVariant layout = LATIN_KEYBOARD_QWERTY;
@@ -1652,7 +1729,7 @@ OS::LatinKeyboardVariant OS_OSX::get_latin_keyboard_variant() const {
layout = LATIN_KEYBOARD_QWERTY;
- CGKeyCode keys[] = {kVK_ANSI_Q, kVK_ANSI_W, kVK_ANSI_E, kVK_ANSI_R, kVK_ANSI_T, kVK_ANSI_Y};
+ CGKeyCode keys[] = { kVK_ANSI_Q, kVK_ANSI_W, kVK_ANSI_E, kVK_ANSI_R, kVK_ANSI_T, kVK_ANSI_Y };
NSString *test = createStringForKeys(keys, 6);
if ([test isEqualToString:@"qwertz"]) {
@@ -1679,10 +1756,12 @@ OS::LatinKeyboardVariant OS_OSX::get_latin_keyboard_variant() const {
void OS_OSX::process_events() {
while (true) {
- NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask
- untilDate:[NSDate distantPast]
- inMode:NSDefaultRunLoopMode
- dequeue:YES];
+ NSEvent *event = [NSApp
+ nextEventMatchingMask:NSAnyEventMask
+ untilDate:[NSDate distantPast]
+ inMode:NSDefaultRunLoopMode
+ dequeue:YES];
+
if (event == nil)
break;
@@ -1693,13 +1772,9 @@ void OS_OSX::process_events() {
autoreleasePool = [[NSAutoreleasePool alloc] init];
}
+void OS_OSX::push_input(const Ref<InputEvent> &p_event) {
-
-void OS_OSX::push_input(const InputEvent& p_event) {
-
- InputEvent ev=p_event;
- ev.ID=last_id++;
- //print_line("EV: "+String(ev));
+ Ref<InputEvent> ev = p_event;
input->parse_input_event(ev);
}
@@ -1725,8 +1800,8 @@ void OS_OSX::run() {
while (!force_quit) {
process_events(); // get rid of pending events
- last_id = joypad_osx->process_joypads(last_id);
- if (Main::iteration()==true)
+ joypad_osx->process_joypads();
+ if (Main::iteration() == true)
break;
};
@@ -1735,32 +1810,31 @@ void OS_OSX::run() {
void OS_OSX::set_mouse_mode(MouseMode p_mode) {
- if (p_mode==mouse_mode)
- return;
+ if (p_mode == mouse_mode)
+ return;
- if (p_mode==MOUSE_MODE_CAPTURED) {
- // Apple Docs state that the display parameter is not used.
- // "This parameter is not used. By default, you may pass kCGDirectMainDisplay."
- // https://developer.apple.com/library/mac/documentation/graphicsimaging/reference/Quartz_Services_Ref/Reference/reference.html
- CGDisplayHideCursor(kCGDirectMainDisplay);
- CGAssociateMouseAndMouseCursorPosition(false);
- } else if (p_mode==MOUSE_MODE_HIDDEN) {
- CGDisplayHideCursor(kCGDirectMainDisplay);
- CGAssociateMouseAndMouseCursorPosition(true);
- } else {
- CGDisplayShowCursor(kCGDirectMainDisplay);
- CGAssociateMouseAndMouseCursorPosition(true);
- }
+ if (p_mode == MOUSE_MODE_CAPTURED) {
+ // Apple Docs state that the display parameter is not used.
+ // "This parameter is not used. By default, you may pass kCGDirectMainDisplay."
+ // https://developer.apple.com/library/mac/documentation/graphicsimaging/reference/Quartz_Services_Ref/Reference/reference.html
+ CGDisplayHideCursor(kCGDirectMainDisplay);
+ CGAssociateMouseAndMouseCursorPosition(false);
+ } else if (p_mode == MOUSE_MODE_HIDDEN) {
+ CGDisplayHideCursor(kCGDirectMainDisplay);
+ CGAssociateMouseAndMouseCursorPosition(true);
+ } else {
+ CGDisplayShowCursor(kCGDirectMainDisplay);
+ CGAssociateMouseAndMouseCursorPosition(true);
+ }
- mouse_mode=p_mode;
+ mouse_mode = p_mode;
}
OS::MouseMode OS_OSX::get_mouse_mode() const {
- return mouse_mode;
+ return mouse_mode;
}
-
String OS_OSX::get_joy_guid(int p_device) const {
return input->get_joy_guid_remapped(p_device);
}
@@ -1777,13 +1851,16 @@ int OS_OSX::get_power_percent_left() {
return power_manager->get_power_percent_left();
}
-OS_OSX* OS_OSX::singleton=NULL;
+OS_OSX *OS_OSX::singleton = NULL;
OS_OSX::OS_OSX() {
-
- mouse_mode=OS::MOUSE_MODE_VISIBLE;
- main_loop=NULL;
- singleton=this;
+
+ mouse_mode = OS::MOUSE_MODE_VISIBLE;
+ main_loop = NULL;
+ singleton = this;
+ im_position = Point2();
+ im_callback = NULL;
+ im_target = NULL;
autoreleasePool = [[NSAutoreleasePool alloc] init];
eventSource = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);
@@ -1791,13 +1868,12 @@ OS_OSX::OS_OSX() {
CGEventSourceSetLocalEventsSuppressionInterval(eventSource, 0.0);
-
- /*if (pthread_key_create(&_Godot.nsgl.current, NULL) != 0)
- {
- _GodotInputError(Godot_PLATFORM_ERROR,
- "NSGL: Failed to create context TLS");
- return GL_FALSE;
- }*/
+ /*
+ if (pthread_key_create(&_Godot.nsgl.current, NULL) != 0) {
+ _GodotInputError(Godot_PLATFORM_ERROR, "NSGL: Failed to create context TLS");
+ return GL_FALSE;
+ }
+*/
framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
ERR_FAIL_COND(!framework);
@@ -1808,12 +1884,52 @@ OS_OSX::OS_OSX() {
// In case we are unbundled, make us a proper UI application
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
- #if 0
// Menu bar setup must go between sharedApplication above and
// finishLaunching below, in order to properly emulate the behavior
// of NSApplicationMain
- createMenuBar();
- #endif
+ NSMenuItem *menu_item;
+ NSString *title;
+
+ NSString *nsappname = [[[NSBundle mainBundle] performSelector:@selector(localizedInfoDictionary)] objectForKey:@"CFBundleName"];
+ if (nsappname == nil)
+ nsappname = [[NSProcessInfo processInfo] processName];
+
+ // Setup Apple menu
+ NSMenu *apple_menu = [[NSMenu alloc] initWithTitle:@""];
+ title = [NSString stringWithFormat:NSLocalizedString(@"About %@", nil), nsappname];
+ [apple_menu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+ [apple_menu addItem:[NSMenuItem separatorItem]];
+
+ NSMenu *services = [[NSMenu alloc] initWithTitle:@""];
+ menu_item = [apple_menu addItemWithTitle:NSLocalizedString(@"Services", nil) action:nil keyEquivalent:@""];
+ [apple_menu setSubmenu:services forItem:menu_item];
+ [NSApp setServicesMenu:services];
+ [services release];
+
+ [apple_menu addItem:[NSMenuItem separatorItem]];
+
+ title = [NSString stringWithFormat:NSLocalizedString(@"Hide %@", nil), nsappname];
+ [apple_menu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
+
+ menu_item = [apple_menu addItemWithTitle:NSLocalizedString(@"Hide Others", nil) action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
+ [menu_item setKeyEquivalentModifierMask:(NSAlternateKeyMask | NSCommandKeyMask)];
+
+ [apple_menu addItemWithTitle:NSLocalizedString(@"Show all", nil) action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+ [apple_menu addItem:[NSMenuItem separatorItem]];
+
+ title = [NSString stringWithFormat:NSLocalizedString(@"Quit %@", nil), nsappname];
+ [apple_menu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
+
+ // Setup menu bar
+ NSMenu *main_menu = [[NSMenu alloc] initWithTitle:@""];
+ menu_item = [main_menu addItemWithTitle:@"" action:nil keyEquivalent:@""];
+ [main_menu setSubmenu:apple_menu forItem:menu_item];
+ [NSApp setMainMenu:main_menu];
+
+ [main_menu release];
+ [apple_menu release];
[NSApp finishLaunching];
@@ -1821,15 +1937,15 @@ OS_OSX::OS_OSX() {
ERR_FAIL_COND(!delegate);
[NSApp setDelegate:delegate];
-
- last_id=1;
- cursor_shape=CURSOR_ARROW;
-
- current_screen = 0;
+ cursor_shape = CURSOR_ARROW;
maximized = false;
minimized = false;
- window_size=Vector2(1024,600);
+ window_size = Vector2(1024, 600);
zoomed = false;
- display_scale=1.0;
+ display_scale = 1.0;
+}
+
+bool OS_OSX::_check_internal_feature_support(const String &p_feature) {
+ return p_feature == "pc" || p_feature == "s3tc";
}
diff --git a/platform/osx/platform_config.h b/platform/osx/platform_config.h
index 834d0141a3..487077e651 100644
--- a/platform/osx/platform_config.h
+++ b/platform/osx/platform_config.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/osx/power_osx.cpp b/platform/osx/power_osx.cpp
index de9bcaf6fc..2ef1a65ff1 100644
--- a/platform/osx/power_osx.cpp
+++ b/platform/osx/power_osx.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,6 +27,32 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
+/*
+Adapted from corresponding SDL 2.0 code.
+*/
+
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+
#include "power_osx.h"
#include <CoreFoundation/CoreFoundation.h>
diff --git a/platform/osx/power_osx.h b/platform/osx/power_osx.h
index c638dc675a..6d984ec466 100644
--- a/platform/osx/power_osx.h
+++ b/platform/osx/power_osx.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/osx/sem_osx.cpp b/platform/osx/sem_osx.cpp
index 069e3a5153..b1eeccfec5 100644
--- a/platform/osx/sem_osx.cpp
+++ b/platform/osx/sem_osx.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/osx/sem_osx.h b/platform/osx/sem_osx.h
index a30f3fcc98..3025318c4b 100644
--- a/platform/osx/sem_osx.h
+++ b/platform/osx/sem_osx.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/server/detect.py b/platform/server/detect.py
index 8bc85f342d..2bb4b59e94 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -1,4 +1,3 @@
-
import os
import sys
@@ -13,17 +12,16 @@ def get_name():
def can_build():
- if (os.name != "posix"):
+ if (os.name != "posix" or sys.platform == "darwin"):
return False
- return True # enabled
+ return True
def get_opts():
return [
- ('use_llvm', 'Use llvm compiler', 'no'),
- ('force_32_bits', 'Force 32 bits binary', 'no')
+ ('use_llvm', 'Use the LLVM compiler', 'no'),
]
@@ -35,46 +33,59 @@ def get_flags():
def configure(env):
- env.Append(CPPPATH=['#platform/server'])
- if (env["use_llvm"] == "yes"):
- env["CC"] = "clang"
- env["CXX"] = "clang++"
- env["LD"] = "clang++"
-
- is64 = sys.maxsize > 2**32
-
- if (env["bits"] == "default"):
- if (is64):
- env["bits"] = "64"
- else:
- env["bits"] = "32"
-
- # if (env["tools"]=="no"):
- # #no tools suffix
- # env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX']
- # env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX']
+ ## Build type
if (env["target"] == "release"):
-
env.Append(CCFLAGS=['-O2', '-ffast-math', '-fomit-frame-pointer'])
elif (env["target"] == "release_debug"):
-
env.Append(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
elif (env["target"] == "debug"):
+ env.Append(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+
+ ## Architecture
- env.Append(CCFLAGS=['-g2', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+ is64 = sys.maxsize > 2**32
+ if (env["bits"] == "default"):
+ env["bits"] = "64" if is64 else "32"
+
+ ## Compiler configuration
+
+ if (env["use_llvm"] == "yes"):
+ if ('clang++' not in env['CXX']):
+ env["CC"] = "clang"
+ env["CXX"] = "clang++"
+ env["LD"] = "clang++"
+ env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
+ env.extra_suffix = ".llvm" + env.extra_suffix
+ ## Dependencies
- # Shared libraries, when requested
+ # FIXME: Check for existence of the libs before parsing their flags with pkg-config
if (env['builtin_openssl'] == 'no'):
+ # Currently not compatible with OpenSSL 1.1.0+
+ # https://github.com/godotengine/godot/issues/8624
+ import subprocess
+ openssl_version = subprocess.check_output(['pkg-config', 'openssl', '--modversion']).strip('\n')
+ if (openssl_version >= "1.1.0"):
+ print("Error: Found system-installed OpenSSL %s, currently only supporting version 1.0.x." % openssl_version)
+ print("Aborting.. You can compile with 'builtin_openssl=yes' to use the bundled version.\n")
+ sys.exit(255)
+
env.ParseConfig('pkg-config openssl --cflags --libs')
if (env['builtin_libwebp'] == 'no'):
env.ParseConfig('pkg-config libwebp --cflags --libs')
+ # freetype depends on libpng and zlib, so bundling one of them while keeping others
+ # as shared libraries leads to weird issues
+ if (env['builtin_freetype'] == 'yes' or env['builtin_libpng'] == 'yes' or env['builtin_zlib'] == 'yes'):
+ env['builtin_freetype'] = 'yes'
+ env['builtin_libpng'] = 'yes'
+ env['builtin_zlib'] = 'yes'
+
if (env['builtin_freetype'] == 'no'):
env.ParseConfig('pkg-config freetype2 --cflags --libs')
@@ -109,11 +120,12 @@ def configure(env):
if (env['builtin_libogg'] == 'no'):
env.ParseConfig('pkg-config ogg --cflags --libs')
+ ## Flags
- env.Append(CPPFLAGS=['-DSERVER_ENABLED', '-DUNIX_ENABLED'])
- env.Append(LIBS=['pthread', 'z']) # TODO detect linux/BSD!
+ # Linkflags below this line should typically stay the last ones
+ if (env['builtin_zlib'] == 'no'):
+ env.ParseConfig('pkg-config zlib --cflags --libs')
- if (env["CXX"] == "clang++"):
- env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
- env["CC"] = "clang"
- env["LD"] = "clang++"
+ env.Append(CPPPATH=['#platform/server'])
+ env.Append(CPPFLAGS=['-DSERVER_ENABLED', '-DUNIX_ENABLED'])
+ env.Append(LIBS=['pthread'])
diff --git a/platform/server/godot_server.cpp b/platform/server/godot_server.cpp
index d06ade4a57..ed0100ac93 100644
--- a/platform/server/godot_server.cpp
+++ b/platform/server/godot_server.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp
index f44d976bd6..89af785d29 100644
--- a/platform/server/os_server.cpp
+++ b/platform/server/os_server.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -142,7 +143,7 @@ int OS_Server::get_mouse_button_state() const {
return 0;
}
-Point2 OS_Server::get_mouse_pos() const {
+Point2 OS_Server::get_mouse_position() const {
return Point2();
}
diff --git a/platform/server/os_server.h b/platform/server/os_server.h
index 7484d70e06..7c29b1e232 100644
--- a/platform/server/os_server.h
+++ b/platform/server/os_server.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -87,7 +88,7 @@ public:
virtual void set_mouse_show(bool p_show);
virtual void set_mouse_grab(bool p_grab);
virtual bool is_mouse_grab_enabled() const;
- virtual Point2 get_mouse_pos() const;
+ virtual Point2 get_mouse_position() const;
virtual int get_mouse_button_state() const;
virtual void set_window_title(const String &p_title);
diff --git a/platform/server/platform_config.h b/platform/server/platform_config.h
index cdef185ff0..48bcadcc29 100644
--- a/platform/server/platform_config.h
+++ b/platform/server/platform_config.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/uwp/SCsub b/platform/uwp/SCsub
index 0167ea9e02..7ee5aa2ac3 100644
--- a/platform/uwp/SCsub
+++ b/platform/uwp/SCsub
@@ -9,6 +9,7 @@ files = [
'#platform/windows/stream_peer_winsock.cpp',
'#platform/windows/key_mapping_win.cpp',
'joypad_uwp.cpp',
+ 'power_uwp.cpp',
'gl_context_egl.cpp',
'app.cpp',
'os_uwp.cpp',
diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp
index 35b25b1de5..c773c0b746 100644
--- a/platform/uwp/app.cpp
+++ b/platform/uwp/app.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -258,45 +259,48 @@ void App::pointer_event(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Cor
int but = _get_button(point);
if (_is_touch(point)) {
- InputEvent event;
- event.type = InputEvent::SCREEN_TOUCH;
- event.device = 0;
- event.screen_touch.pressed = p_pressed;
- event.screen_touch.x = pos.X;
- event.screen_touch.y = pos.Y;
- event.screen_touch.index = _get_finger(point->PointerId);
+ Ref<InputEventScreenTouch> screen_touch;
+ screen_touch.instance();
+ screen_touch->set_device(0);
+ screen_touch->set_pressed(p_pressed);
+ screen_touch->set_position(Vector2(pos.X, pos.Y));
+ screen_touch->set_index(_get_finger(point->PointerId));
- last_touch_x[event.screen_touch.index] = pos.X;
- last_touch_y[event.screen_touch.index] = pos.Y;
+ last_touch_x[screen_touch->get_index()] = pos.X;
+ last_touch_y[screen_touch->get_index()] = pos.Y;
- os->input_event(event);
+ os->input_event(screen_touch);
if (number_of_contacts > 1)
return;
}; // fallthrought of sorts
- InputEvent event;
- event.type = InputEvent::MOUSE_BUTTON;
- event.device = 0;
- event.mouse_button.pressed = p_pressed;
- event.mouse_button.button_index = but;
- event.mouse_button.x = pos.X;
- event.mouse_button.y = pos.Y;
- event.mouse_button.global_x = pos.X;
- event.mouse_button.global_y = pos.Y;
+ Ref<InputEventMouseButton> mouse_button;
+ mouse_button.instance();
+ mouse_button->set_device(0);
+ mouse_button->set_pressed(p_pressed);
+ mouse_button->set_button_index(but);
+ mouse_button->set_position(Vector2(pos.X, pos.Y));
+ mouse_button->set_global_position(Vector2(pos.X, pos.Y));
if (p_is_wheel) {
if (point->Properties->MouseWheelDelta > 0) {
- event.mouse_button.button_index = point->Properties->IsHorizontalMouseWheel ? BUTTON_WHEEL_RIGHT : BUTTON_WHEEL_UP;
+ mouse_button->set_button_index(point->Properties->IsHorizontalMouseWheel ? BUTTON_WHEEL_RIGHT : BUTTON_WHEEL_UP);
} else if (point->Properties->MouseWheelDelta < 0) {
- event.mouse_button.button_index = point->Properties->IsHorizontalMouseWheel ? BUTTON_WHEEL_LEFT : BUTTON_WHEEL_DOWN;
+ mouse_button->set_button_index(point->Properties->IsHorizontalMouseWheel ? BUTTON_WHEEL_LEFT : BUTTON_WHEEL_DOWN);
}
}
last_touch_x[31] = pos.X;
last_touch_y[31] = pos.Y;
- os->input_event(event);
+ os->input_event(mouse_button);
+
+ if (p_is_wheel) {
+ // Send release for mouse wheel
+ mouse_button->set_pressed(false);
+ os->input_event(mouse_button);
+ }
};
void App::OnPointerPressed(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args) {
@@ -348,16 +352,14 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co
if (point->IsInContact && _is_touch(point)) {
- InputEvent event;
- event.type = InputEvent::SCREEN_DRAG;
- event.device = 0;
- event.screen_drag.x = pos.X;
- event.screen_drag.y = pos.Y;
- event.screen_drag.index = _get_finger(point->PointerId);
- event.screen_drag.relative_x = event.screen_drag.x - last_touch_x[event.screen_drag.index];
- event.screen_drag.relative_y = event.screen_drag.y - last_touch_y[event.screen_drag.index];
+ Ref<InputEventScreenDrag> screen_drag;
+ screen_drag.instance();
+ screen_drag->set_device(0);
+ screen_drag->set_position(Vector2(pos.X, pos.Y));
+ screen_drag->set_index(_get_finger(point->PointerId));
+ screen_drag->set_relative(Vector2(screen_drag->get_position().x - last_touch_x[screen_drag->get_index()], screen_drag->get_position().y - last_touch_y[screen_drag->get_index()]));
- os->input_event(event);
+ os->input_event(screen_drag);
if (number_of_contacts > 1)
return;
@@ -367,19 +369,16 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co
if (os->get_mouse_mode() == OS::MouseMode::MOUSE_MODE_CAPTURED)
return;
- InputEvent event;
- event.type = InputEvent::MOUSE_MOTION;
- event.device = 0;
- event.mouse_motion.x = pos.X;
- event.mouse_motion.y = pos.Y;
- event.mouse_motion.global_x = pos.X;
- event.mouse_motion.global_y = pos.Y;
- event.mouse_motion.relative_x = pos.X - last_touch_x[31];
- event.mouse_motion.relative_y = pos.Y - last_touch_y[31];
+ Ref<InputEventMouseMotion> mouse_motion;
+ mouse_motion.instance();
+ mouse_motion->set_device(0);
+ mouse_motion->set_position(Vector2(pos.X, pos.Y));
+ mouse_motion->set_global_position(Vector2(pos.X, pos.Y));
+ mouse_motion->set_relative(Vector2(pos.X - last_touch_x[31], pos.Y - last_touch_y[31]));
last_mouse_pos = pos;
- os->input_event(event);
+ os->input_event(mouse_motion);
}
void App::OnMouseMoved(MouseDevice ^ mouse_device, MouseEventArgs ^ args) {
@@ -392,32 +391,25 @@ void App::OnMouseMoved(MouseDevice ^ mouse_device, MouseEventArgs ^ args) {
pos.X = last_mouse_pos.X + args->MouseDelta.X;
pos.Y = last_mouse_pos.Y + args->MouseDelta.Y;
- InputEvent event;
- event.type = InputEvent::MOUSE_MOTION;
- event.device = 0;
- event.mouse_motion.x = pos.X;
- event.mouse_motion.y = pos.Y;
- event.mouse_motion.global_x = pos.X;
- event.mouse_motion.global_y = pos.Y;
- event.mouse_motion.relative_x = args->MouseDelta.X;
- event.mouse_motion.relative_y = args->MouseDelta.Y;
+ Ref<InputEventMouseMotion> mouse_motion;
+ mouse_motion.instance();
+ mouse_motion->set_device(0);
+ mouse_motion->set_position(Vector2(pos.X, pos.Y));
+ mouse_motion->set_global_position(Vector2(pos.X, pos.Y));
+ mouse_motion->set_relative(Vector2(args->MouseDelta.X, args->MouseDelta.Y));
last_mouse_pos = pos;
- os->input_event(event);
+ os->input_event(mouse_motion);
}
void App::key_event(Windows::UI::Core::CoreWindow ^ sender, bool p_pressed, Windows::UI::Core::KeyEventArgs ^ key_args, Windows::UI::Core::CharacterReceivedEventArgs ^ char_args) {
OSUWP::KeyEvent ke;
- InputModifierState mod;
- mod.meta = false;
- mod.command = false;
- mod.control = sender->GetAsyncKeyState(VirtualKey::Control) == CoreVirtualKeyStates::Down;
- mod.alt = sender->GetAsyncKeyState(VirtualKey::Menu) == CoreVirtualKeyStates::Down;
- mod.shift = sender->GetAsyncKeyState(VirtualKey::Shift) == CoreVirtualKeyStates::Down;
- ke.mod_state = mod;
+ ke.control = sender->GetAsyncKeyState(VirtualKey::Control) == CoreVirtualKeyStates::Down;
+ ke.alt = sender->GetAsyncKeyState(VirtualKey::Menu) == CoreVirtualKeyStates::Down;
+ ke.shift = sender->GetAsyncKeyState(VirtualKey::Shift) == CoreVirtualKeyStates::Down;
ke.pressed = p_pressed;
diff --git a/platform/uwp/app.h b/platform/uwp/app.h
index fd6fc950a7..9cbe7669c9 100644
--- a/platform/uwp/app.h
+++ b/platform/uwp/app.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -106,7 +107,7 @@ namespace GodotUWP
int last_touch_y[32];
int number_of_contacts;
Windows::Foundation::Point last_mouse_pos;
- }
+ };
}
/* clang-format on */
diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py
index f1e0716241..64dac93f1f 100644
--- a/platform/uwp/detect.py
+++ b/platform/uwp/detect.py
@@ -1,8 +1,7 @@
+import methods
import os
-
-import sys
import string
-import methods
+import sys
def is_active():
@@ -26,7 +25,9 @@ def can_build():
def get_opts():
- return []
+
+ return [
+ ]
def get_flags():
@@ -39,15 +40,37 @@ def get_flags():
def configure(env):
- if(env["bits"] != "default"):
- print "Error: bits argument is disabled for MSVC"
- print ("Bits argument is not supported for MSVC compilation. Architecture depends on the Native/Cross Compile Tools Prompt/Developer Console (or Visual Studio settings)"
- + " that is being used to run SCons. As a consequence, bits argument is disabled. Run scons again without bits argument (example: scons p=uwp) and SCons will attempt to detect what MSVC compiler"
- + " will be executed and inform you.")
+ if (env["bits"] != "default"):
+ print("Error: bits argument is disabled for MSVC")
+ print("""
+ Bits argument is not supported for MSVC compilation. Architecture depends on the Native/Cross Compile Tools Prompt/Developer Console
+ (or Visual Studio settings) that is being used to run SCons. As a consequence, bits argument is disabled. Run scons again without bits
+ argument (example: scons p=uwp) and SCons will attempt to detect what MSVC compiler will be executed and inform you.
+ """)
sys.exit()
- arch = ""
+ ## Build type
+
+ if (env["target"] == "release"):
+ env.Append(CPPFLAGS=['/O2', '/GL'])
+ env.Append(CPPFLAGS=['/MD'])
+ env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS', '/LTCG'])
+
+ elif (env["target"] == "release_debug"):
+ env.Append(CCFLAGS=['/O2', '/Zi', '/DDEBUG_ENABLED'])
+ env.Append(CPPFLAGS=['/MD'])
+ env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
+
+ elif (env["target"] == "debug"):
+ env.Append(CCFLAGS=['/Zi', '/DDEBUG_ENABLED', '/DDEBUG_MEMORY_ENABLED'])
+ env.Append(CPPFLAGS=['/MDd'])
+ env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
+ env.Append(LINKFLAGS=['/DEBUG'])
+
+ ## Compiler configuration
+
env['ENV'] = os.environ
+ vc_base_path = os.environ['VCTOOLSINSTALLDIR'] if "VCTOOLSINSTALLDIR" in os.environ else os.environ['VCINSTALLDIR']
# ANGLE
angle_root = os.getenv("ANGLE_SRC_PATH")
@@ -58,31 +81,33 @@ def configure(env):
if os.path.isfile(str(os.getenv("ANGLE_SRC_PATH")) + "/winrt/10/src/angle.sln"):
env["build_angle"] = True
+ ## Architecture
+
+ arch = ""
if os.getenv('Platform') == "ARM":
- print "Compiled program architecture will be an ARM executable. (forcing bits=32)."
+ print("Compiled program architecture will be an ARM executable. (forcing bits=32).")
arch = "arm"
env["bits"] = "32"
env.Append(LINKFLAGS=['/MACHINE:ARM'])
- env.Append(LIBPATH=[os.environ['VCINSTALLDIR'] + 'lib/store/arm'])
+ env.Append(LIBPATH=[vc_base_path + 'lib/store/arm'])
angle_build_cmd += "ARM"
env.Append(LIBPATH=[angle_root + '/winrt/10/src/Release_ARM/lib'])
else:
-
compiler_version_str = methods.detect_visual_c_compiler_version(env['ENV'])
if(compiler_version_str == "amd64" or compiler_version_str == "x86_amd64"):
env["bits"] = "64"
- print "Compiled program architecture will be a x64 executable (forcing bits=64)."
+ print("Compiled program architecture will be a x64 executable (forcing bits=64).")
elif (compiler_version_str == "x86" or compiler_version_str == "amd64_x86"):
env["bits"] = "32"
- print "Compiled program architecture will be a x86 executable. (forcing bits=32)."
+ print("Compiled program architecture will be a x86 executable. (forcing bits=32).")
else:
- print "Failed to detect MSVC compiler architecture version... Defaulting to 32bit executable settings (forcing bits=32). Compilation attempt will continue, but SCons can not detect for what architecture this build is compiled for. You should check your settings/compilation setup."
+ print("Failed to detect MSVC compiler architecture version... Defaulting to 32bit executable settings (forcing bits=32). Compilation attempt will continue, but SCons can not detect for what architecture this build is compiled for. You should check your settings/compilation setup.")
env["bits"] = "32"
if (env["bits"] == "32"):
@@ -90,9 +115,8 @@ def configure(env):
angle_build_cmd += "Win32"
- env.Append(CPPFLAGS=['/DPNG_ABORT=abort'])
env.Append(LINKFLAGS=['/MACHINE:X86'])
- env.Append(LIBPATH=[os.environ['VCINSTALLDIR'] + 'lib/store'])
+ env.Append(LIBPATH=[vc_base_path + 'lib/store'])
env.Append(LIBPATH=[angle_root + '/winrt/10/src/Release_Win32/lib'])
else:
@@ -104,49 +128,30 @@ def configure(env):
env.Append(LIBPATH=[os.environ['VCINSTALLDIR'] + 'lib/store/amd64'])
env.Append(LIBPATH=[angle_root + '/winrt/10/src/Release_x64/lib'])
- env.Append(CPPPATH=['#platform/uwp', '#drivers/windows'])
- env.Append(LINKFLAGS=['/MANIFEST:NO', '/NXCOMPAT', '/DYNAMICBASE', '/WINMD', '/APPCONTAINER', '/ERRORREPORT:PROMPT', '/NOLOGO', '/TLBID:1', '/NODEFAULTLIB:"kernel32.lib"', '/NODEFAULTLIB:"ole32.lib"'])
- env.Append(CPPFLAGS=['/D', '__WRL_NO_DEFAULT_LIB__', '/D', 'WIN32'])
- env.Append(CPPFLAGS=['/FU', os.environ['VCINSTALLDIR'] + 'lib/store/references/platform.winmd'])
- env.Append(CPPFLAGS=['/AI', os.environ['VCINSTALLDIR'] + 'lib/store/references'])
-
- env.Append(LIBPATH=[os.environ['VCINSTALLDIR'] + 'lib/store/references'])
-
- if (env["target"] == "release"):
-
- env.Append(CPPFLAGS=['/O2', '/GL'])
- env.Append(CPPFLAGS=['/MD'])
- env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS', '/LTCG'])
+ env["PROGSUFFIX"] = "." + arch + env["PROGSUFFIX"]
+ env["OBJSUFFIX"] = "." + arch + env["OBJSUFFIX"]
+ env["LIBSUFFIX"] = "." + arch + env["LIBSUFFIX"]
- elif (env["target"] == "release_debug"):
+ ## Compile flags
- env.Append(CCFLAGS=['/O2', '/Zi', '/DDEBUG_ENABLED'])
- env.Append(CPPFLAGS=['/MD'])
- env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
+ env.Append(CPPPATH=['#platform/uwp', '#drivers/windows'])
+ env.Append(CCFLAGS=['/DUWP_ENABLED', '/DWINDOWS_ENABLED', '/DTYPED_METHOD_BIND'])
+ env.Append(CCFLAGS=['/DGLES2_ENABLED', '/DGL_GLEXT_PROTOTYPES', '/DEGL_EGLEXT_PROTOTYPES', '/DANGLE_ENABLED'])
+ winver = "0x0602" # Windows 8 is the minimum target for UWP build
+ env.Append(CCFLAGS=['/DWINVER=%s' % winver, '/D_WIN32_WINNT=%s' % winver])
- elif (env["target"] == "debug"):
+ env.Append(CPPFLAGS=['/D', '__WRL_NO_DEFAULT_LIB__', '/D', 'WIN32', '/DPNG_ABORT=abort'])
- env.Append(CCFLAGS=['/Zi', '/DDEBUG_ENABLED', '/DDEBUG_MEMORY_ENABLED'])
- env.Append(CPPFLAGS=['/MDd'])
- env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
- env.Append(LINKFLAGS=['/DEBUG'])
+ env.Append(CPPFLAGS=['/AI', vc_base_path + 'lib/store/references'])
+ env.Append(CPPFLAGS=['/AI', vc_base_path + 'lib/x86/store/references'])
env.Append(CCFLAGS=string.split('/FS /MP /GS /wd"4453" /wd"28204" /wd"4291" /Zc:wchar_t /Gm- /fp:precise /D "_UNICODE" /D "UNICODE" /D "WINAPI_FAMILY=WINAPI_FAMILY_APP" /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo'))
env.Append(CXXFLAGS=string.split('/ZW /FS'))
- env.Append(CCFLAGS=['/AI', os.environ['VCINSTALLDIR'] + '\\vcpackages', '/AI', os.environ['WINDOWSSDKDIR'] + '\\References\\CommonConfiguration\\Neutral'])
-
- env["PROGSUFFIX"] = "." + arch + env["PROGSUFFIX"]
- env["OBJSUFFIX"] = "." + arch + env["OBJSUFFIX"]
- env["LIBSUFFIX"] = "." + arch + env["LIBSUFFIX"]
+ env.Append(CCFLAGS=['/AI', vc_base_path + '\\vcpackages', '/AI', os.environ['WINDOWSSDKDIR'] + '\\References\\CommonConfiguration\\Neutral'])
- env.Append(CCFLAGS=['/DUWP_ENABLED'])
- env.Append(CCFLAGS=['/DWINDOWS_ENABLED'])
- env.Append(CCFLAGS=['/DTYPED_METHOD_BIND'])
-
- env.Append(CCFLAGS=['/DGLES2_ENABLED', '/DGL_GLEXT_PROTOTYPES', '/DEGL_EGLEXT_PROTOTYPES', '/DANGLE_ENABLED'])
+ ## Link flags
- winver = "0x0602" # Windows 8 is the minimum target for UWP build
- env.Append(CCFLAGS=['/DWINVER=%s' % winver, '/D_WIN32_WINNT=%s' % winver])
+ env.Append(LINKFLAGS=['/MANIFEST:NO', '/NXCOMPAT', '/DYNAMICBASE', '/WINMD', '/APPCONTAINER', '/ERRORREPORT:PROMPT', '/NOLOGO', '/TLBID:1', '/NODEFAULTLIB:"kernel32.lib"', '/NODEFAULTLIB:"ole32.lib"'])
LIBS = [
'WindowsApp',
@@ -163,8 +168,3 @@ def configure(env):
env['BUILDERS']['Program'] = methods.precious_program
env.Append(BUILDERS={'ANGLE': env.Builder(action=angle_build_cmd)})
-
- env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'HLSL9': env.Builder(action=methods.build_hlsl_dx9_headers, suffix='hlsl.h', src_suffix='.hlsl')})
- env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')})
diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp
index bef19d80ae..39717196aa 100644
--- a/platform/uwp/export/export.cpp
+++ b/platform/uwp/export/export.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,65 +28,27 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-/*************************************************************************
- * The code for signing the package was ported from fb-util-for-appx
- * available at https://github.com/facebook/fb-util-for-appx
- * and distributed also under the following license:
-
-BSD License
-
-For fb-util-for-appx software
-
-Copyright (c) 2016, Facebook, Inc. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- * Neither the name Facebook nor the names of its contributors may be used to
- endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*************************************************************************/
-
-#if 0
#include "export.h"
#include "bind/core_bind.h"
-#include "editor/editor_import_export.h"
+#include "editor/editor_export.h"
#include "editor/editor_node.h"
-#include "global_config.h"
-#include "io/base64.h"
#include "io/marshalls.h"
-#include "io/sha256.h"
-#include "io/unzip.h"
-#include "io/zip.h"
#include "io/zip_io.h"
#include "object.h"
#include "os/file_access.h"
-#include "platform/uwp/logo.h"
+#include "platform/uwp/logo.gen.h"
+#include "project_settings.h"
#include "version.h"
+#include "thirdparty/minizip/unzip.h"
+#include "thirdparty/minizip/zip.h"
+#include "thirdparty/misc/base64.h"
+#include "thirdparty/misc/sha256.h"
+
#include <zlib.h>
// Capabilities
-static const char* uwp_capabilities[] = {
+static const char *uwp_capabilities[] = {
"allJoyn",
"codeGeneration",
"internetClient",
@@ -93,7 +56,7 @@ static const char* uwp_capabilities[] = {
"privateNetworkClientServer",
NULL
};
-static const char* uwp_uap_capabilities[] = {
+static const char *uwp_uap_capabilities[] = {
"appointments",
"blockedChatMessages",
"chat",
@@ -110,7 +73,7 @@ static const char* uwp_uap_capabilities[] = {
"voipCall",
NULL
};
-static const char* uwp_device_capabilites[] = {
+static const char *uwp_device_capabilites[] = {
"bluetooth",
"location",
"microphone",
@@ -119,166 +82,6 @@ static const char* uwp_device_capabilites[] = {
NULL
};
-#ifdef OPENSSL_ENABLED
-#include <openssl/asn1.h>
-#include <openssl/asn1t.h>
-#include <openssl/bio.h>
-#include <openssl/err.h>
-#include <openssl/ossl_typ.h>
-#include <openssl/pkcs12.h>
-#include <openssl/pkcs7.h>
-#include <openssl/x509.h>
-
-namespace asn1 {
- // https://msdn.microsoft.com/en-us/gg463180.aspx
-
- struct SPCStatementType {
- ASN1_OBJECT *type;
- };
- DECLARE_ASN1_FUNCTIONS(SPCStatementType)
-
- struct SPCSpOpusInfo {
- ASN1_TYPE *programName;
- ASN1_TYPE *moreInfo;
- };
- DECLARE_ASN1_FUNCTIONS(SPCSpOpusInfo)
-
- struct DigestInfo {
- X509_ALGOR *digestAlgorithm;
- ASN1_OCTET_STRING *digest;
- };
- DECLARE_ASN1_FUNCTIONS(DigestInfo)
-
- struct SPCAttributeTypeAndOptionalValue {
- ASN1_OBJECT *type;
- ASN1_TYPE *value; // SPCInfoValue
- };
- DECLARE_ASN1_FUNCTIONS(SPCAttributeTypeAndOptionalValue)
-
- // Undocumented.
- struct SPCInfoValue {
- ASN1_INTEGER *i1;
- ASN1_OCTET_STRING *s1;
- ASN1_INTEGER *i2;
- ASN1_INTEGER *i3;
- ASN1_INTEGER *i4;
- ASN1_INTEGER *i5;
- ASN1_INTEGER *i6;
- };
- DECLARE_ASN1_FUNCTIONS(SPCInfoValue)
-
- struct SPCIndirectDataContent {
- SPCAttributeTypeAndOptionalValue *data;
- DigestInfo *messageDigest;
- };
- DECLARE_ASN1_FUNCTIONS(SPCIndirectDataContent)
-
- IMPLEMENT_ASN1_FUNCTIONS(SPCIndirectDataContent)
- ASN1_SEQUENCE(SPCIndirectDataContent) = {
- ASN1_SIMPLE(SPCIndirectDataContent, data,
- SPCAttributeTypeAndOptionalValue),
- ASN1_SIMPLE(SPCIndirectDataContent, messageDigest, DigestInfo),
- } ASN1_SEQUENCE_END(SPCIndirectDataContent)
-
- IMPLEMENT_ASN1_FUNCTIONS(SPCAttributeTypeAndOptionalValue)
- ASN1_SEQUENCE(SPCAttributeTypeAndOptionalValue) = {
- ASN1_SIMPLE(SPCAttributeTypeAndOptionalValue, type,
- ASN1_OBJECT),
- ASN1_OPT(SPCAttributeTypeAndOptionalValue, value, ASN1_ANY),
- } ASN1_SEQUENCE_END(SPCAttributeTypeAndOptionalValue)
-
- IMPLEMENT_ASN1_FUNCTIONS(SPCInfoValue)
- ASN1_SEQUENCE(SPCInfoValue) = {
- ASN1_SIMPLE(SPCInfoValue, i1, ASN1_INTEGER),
- ASN1_SIMPLE(SPCInfoValue, s1, ASN1_OCTET_STRING),
- ASN1_SIMPLE(SPCInfoValue, i2, ASN1_INTEGER),
- ASN1_SIMPLE(SPCInfoValue, i3, ASN1_INTEGER),
- ASN1_SIMPLE(SPCInfoValue, i4, ASN1_INTEGER),
- ASN1_SIMPLE(SPCInfoValue, i5, ASN1_INTEGER),
- ASN1_SIMPLE(SPCInfoValue, i6, ASN1_INTEGER),
- } ASN1_SEQUENCE_END(SPCInfoValue)
-
- IMPLEMENT_ASN1_FUNCTIONS(DigestInfo)
- ASN1_SEQUENCE(DigestInfo) = {
- ASN1_SIMPLE(DigestInfo, digestAlgorithm, X509_ALGOR),
- ASN1_SIMPLE(DigestInfo, digest, ASN1_OCTET_STRING),
- } ASN1_SEQUENCE_END(DigestInfo)
-
- ASN1_SEQUENCE(SPCSpOpusInfo) = {
- ASN1_OPT(SPCSpOpusInfo, programName, ASN1_ANY),
- ASN1_OPT(SPCSpOpusInfo, moreInfo, ASN1_ANY),
- } ASN1_SEQUENCE_END(SPCSpOpusInfo)
- IMPLEMENT_ASN1_FUNCTIONS(SPCSpOpusInfo)
-
- ASN1_SEQUENCE(SPCStatementType) = {
- ASN1_SIMPLE(SPCStatementType, type, ASN1_OBJECT),
- } ASN1_SEQUENCE_END(SPCStatementType)
- IMPLEMENT_ASN1_FUNCTIONS(SPCStatementType)
-}
-
-class EncodedASN1 {
-
- uint8_t* i_data;
- size_t i_size;
-
- EncodedASN1(uint8_t** p_data, size_t p_size) {
-
- i_data = *p_data;
- i_size = p_size;
- }
-
-public:
-
- template <typename T, int(*TEncode)(T *, uint8_t **)>
- static EncodedASN1 FromItem(T *item) {
- uint8_t *dataRaw = NULL;
- int size = TEncode(item, &dataRaw);
-
- return EncodedASN1(&dataRaw, size);
- }
-
- const uint8_t *data() const {
- return i_data;
- }
-
- size_t size() const {
- return i_size;
- }
-
- // Assumes the encoded ASN.1 represents a SEQUENCE and puts it into
- // an ASN1_STRING.
- //
- // The returned object holds a copy of this object's data.
- ASN1_STRING* ToSequenceString() {
- ASN1_STRING* string = ASN1_STRING_new();
- if (!string) {
- return NULL;
- }
- if (!ASN1_STRING_set(string, i_data, i_size)) {
- return NULL;
- }
- return string;
- }
-
- // Assumes the encoded ASN.1 represents a SEQUENCE and puts it into
- // an ASN1_TYPE.
- //
- // The returned object holds a copy of this object's data.
- ASN1_TYPE* ToSequenceType() {
- ASN1_STRING* string = ToSequenceString();
- ASN1_TYPE* type = ASN1_TYPE_new();
- if (!type) {
- return NULL;
- }
- type->type = V_ASN1_SEQUENCE;
- type->value.sequence = string;
- return type;
- }
-
-};
-
-#endif // OPENSSL_ENABLED
-
class AppxPackager {
enum {
@@ -334,34 +137,33 @@ class AppxPackager {
ZPOS64_T end_of_central_dir_offset;
Vector<uint8_t> central_dir_data;
- String hash_block(uint8_t* p_block_data, size_t p_block_len);
+ String hash_block(uint8_t *p_block_data, size_t p_block_len);
void make_block_map();
void make_content_types();
-
- _FORCE_INLINE_ unsigned int buf_put_int16(uint16_t p_val, uint8_t * p_buf) {
+ _FORCE_INLINE_ unsigned int buf_put_int16(uint16_t p_val, uint8_t *p_buf) {
for (int i = 0; i < 2; i++) {
*p_buf++ = (p_val >> (i * 8)) & 0xFF;
}
return 2;
}
- _FORCE_INLINE_ unsigned int buf_put_int32(uint32_t p_val, uint8_t * p_buf) {
+ _FORCE_INLINE_ unsigned int buf_put_int32(uint32_t p_val, uint8_t *p_buf) {
for (int i = 0; i < 4; i++) {
*p_buf++ = (p_val >> (i * 8)) & 0xFF;
}
return 4;
}
- _FORCE_INLINE_ unsigned int buf_put_int64(uint64_t p_val, uint8_t * p_buf) {
+ _FORCE_INLINE_ unsigned int buf_put_int64(uint64_t p_val, uint8_t *p_buf) {
for (int i = 0; i < 8; i++) {
*p_buf++ = (p_val >> (i * 8)) & 0xFF;
}
return 8;
}
- _FORCE_INLINE_ unsigned int buf_put_string(String p_val, uint8_t * p_buf) {
+ _FORCE_INLINE_ unsigned int buf_put_string(String p_val, uint8_t *p_buf) {
for (int i = 0; i < p_val.length(); i++) {
*p_buf++ = p_val.utf8().get(i);
}
@@ -369,173 +171,24 @@ class AppxPackager {
}
Vector<uint8_t> make_file_header(FileMeta p_file_meta);
- void store_central_dir_header(const FileMeta p_file, bool p_do_hash = true);
+ void store_central_dir_header(const FileMeta &p_file, bool p_do_hash = true);
Vector<uint8_t> make_end_of_central_record();
String content_type(String p_extension);
-#ifdef OPENSSL_ENABLED
-
- // Signing methods and structs:
-
- String certificate_path;
- String certificate_pass;
- bool sign_package;
-
- struct CertFile {
-
- EVP_PKEY* private_key;
- X509* certificate;
- };
-
- SHA256_CTX axpc_context; // SHA256 context for ZIP file entries
- SHA256_CTX axcd_context; // SHA256 context for ZIP directory entries
-
- struct AppxDigests {
-
- uint8_t axpc[SHA256_DIGEST_LENGTH]; // ZIP file entries
- uint8_t axcd[SHA256_DIGEST_LENGTH]; // ZIP directory entry
- uint8_t axct[SHA256_DIGEST_LENGTH]; // Content types XML
- uint8_t axbm[SHA256_DIGEST_LENGTH]; // Block map XML
- uint8_t axci[SHA256_DIGEST_LENGTH]; // Code Integrity file (optional)
- };
-
- CertFile cert_file;
- AppxDigests digests;
-
- void MakeSPCInfoValue(asn1::SPCInfoValue &info);
- Error MakeIndirectDataContent(asn1::SPCIndirectDataContent &idc);
- Error add_attributes(PKCS7_SIGNER_INFO *signerInfo);
- void make_digests();
- void write_digest(Vector<uint8_t> &p_out_buffer);
-
- Error openssl_error(unsigned long p_err);
- Error read_cert_file(const String &p_path, const String &p_password, CertFile* p_out_cf);
- Error sign(const CertFile &p_cert, const AppxDigests &digests, PKCS7* p_out_signature);
-
-#endif // OPENSSL_ENABLED
-
public:
-
- enum SignOption {
-
- SIGN,
- DONT_SIGN,
- };
-
void set_progress_task(String p_task) { progress_task = p_task; }
- void init(FileAccess* p_fa, SignOption p_sign, String &p_certificate_path, String &p_certificate_password);
- void add_file(String p_file_name, const uint8_t* p_buffer, size_t p_len, int p_file_no, int p_total_files, bool p_compress = false);
+ void init(FileAccess *p_fa);
+ void add_file(String p_file_name, const uint8_t *p_buffer, size_t p_len, int p_file_no, int p_total_files, bool p_compress = false);
void finish();
AppxPackager();
~AppxPackager();
};
-class EditorExportPlatformUWP : public EditorExportPlatform {
-
- GDCLASS(EditorExportPlatformUWP, EditorExportPlatform);
-
- Ref<ImageTexture> logo;
-
- enum Platform {
- ARM,
- X86,
- X64
- } arch;
-
- bool is_debug;
-
- String custom_release_package;
- String custom_debug_package;
-
- String cmdline;
-
- String display_name;
- String short_name;
- String unique_name;
- String description;
- String publisher;
- String publisher_display_name;
-
- String product_guid;
- String publisher_guid;
-
- int version_major;
- int version_minor;
- int version_build;
- int version_revision;
-
- bool orientation_landscape;
- bool orientation_portrait;
- bool orientation_landscape_flipped;
- bool orientation_portrait_flipped;
-
- String background_color;
- Ref<ImageTexture> store_logo;
- Ref<ImageTexture> square44;
- Ref<ImageTexture> square71;
- Ref<ImageTexture> square150;
- Ref<ImageTexture> square310;
- Ref<ImageTexture> wide310;
- Ref<ImageTexture> splash;
-
- bool name_on_square150;
- bool name_on_square310;
- bool name_on_wide;
-
- Set<String> capabilities;
- Set<String> uap_capabilities;
- Set<String> device_capabilities;
-
- bool sign_package;
- String certificate_path;
- String certificate_pass;
-
- _FORCE_INLINE_ bool array_has(const char** p_array, const char* p_value) const {
- while (*p_array) {
- if (String(*p_array) == String(p_value)) return true;
- p_array++;
- }
- return false;
- }
-
- bool _valid_resource_name(const String &p_name) const;
- bool _valid_guid(const String &p_guid) const;
- bool _valid_bgcolor(const String &p_color) const;
- bool _valid_image(const Ref<ImageTexture> p_image, int p_width, int p_height) const;
-
- Vector<uint8_t> _fix_manifest(const Vector<uint8_t> &p_template, bool p_give_internet) const;
- Vector<uint8_t> _get_image_data(const String &p_path);
-
- static Error save_appx_file(void *p_userdata, const String& p_path, const Vector<uint8_t>& p_data, int p_file, int p_total);
- static bool _should_compress_asset(const String& p_path, const Vector<uint8_t>& p_data);
-
-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 "Windows Universal"; }
- virtual ImageCompression get_image_compression() const { return IMAGE_COMPRESSION_ETC1; }
- virtual Ref<Texture> get_logo() const { return logo; }
-
- virtual bool can_export(String *r_error = NULL) const;
- virtual String get_binary_extension() const { return "appx"; }
-
- virtual Error export_project(const String& p_path, bool p_debug, int p_flags = 0);
-
- EditorExportPlatformUWP();
- ~EditorExportPlatformUWP();
-};
-
-
///////////////////////////////////////////////////////////////////////////
-String AppxPackager::hash_block(uint8_t * p_block_data, size_t p_block_len) {
+String AppxPackager::hash_block(uint8_t *p_block_data, size_t p_block_len) {
char hash[32];
char base64[45];
@@ -543,7 +196,7 @@ String AppxPackager::hash_block(uint8_t * p_block_data, size_t p_block_len) {
sha256_context ctx;
sha256_init(&ctx);
sha256_hash(&ctx, p_block_data, p_block_len);
- sha256_done(&ctx, (uint8_t*)hash);
+ sha256_done(&ctx, (uint8_t *)hash);
base64_encode(base64, hash, 32);
base64[44] = '\0';
@@ -553,7 +206,7 @@ String AppxPackager::hash_block(uint8_t * p_block_data, size_t p_block_len) {
void AppxPackager::make_block_map() {
- FileAccess* tmp_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::WRITE);
+ FileAccess *tmp_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::WRITE);
tmp_file->store_string("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>");
tmp_file->store_string("<BlockMap xmlns=\"http://schemas.microsoft.com/appx/2010/blockmap\" HashMethod=\"http://www.w3.org/2001/04/xmlenc#sha256\">");
@@ -563,15 +216,11 @@ void AppxPackager::make_block_map() {
FileMeta file = file_metadata[i];
tmp_file->store_string(
- "<File Name=\"" + file.name.replace("/", "\\")
- + "\" Size=\"" + itos(file.uncompressed_size)
- + "\" LfhSize=\"" + itos(file.lfh_size) + "\">");
-
+ "<File Name=\"" + file.name.replace("/", "\\") + "\" Size=\"" + itos(file.uncompressed_size) + "\" LfhSize=\"" + itos(file.lfh_size) + "\">");
for (int j = 0; j < file.hashes.size(); j++) {
- tmp_file->store_string("<Block Hash=\""
- + file.hashes[j].base64_hash + "\" ");
+ tmp_file->store_string("<Block Hash=\"" + file.hashes[j].base64_hash + "\" ");
if (file.compressed)
tmp_file->store_string("Size=\"" + itos(file.hashes[j].compressed_size) + "\" ");
tmp_file->store_string("/>");
@@ -603,12 +252,12 @@ String AppxPackager::content_type(String p_extension) {
void AppxPackager::make_content_types() {
- FileAccess* tmp_file = FileAccess::open(tmp_content_types_file_path, FileAccess::WRITE);
+ FileAccess *tmp_file = FileAccess::open(tmp_content_types_file_path, FileAccess::WRITE);
tmp_file->store_string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
tmp_file->store_string("<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">");
- Map<String, String> types;
+ Map<String, String> types;
for (int i = 0; i < file_metadata.size(); i++) {
@@ -680,13 +329,12 @@ Vector<uint8_t> AppxPackager::make_file_header(FileMeta p_file_meta) {
return buf;
}
-void AppxPackager::store_central_dir_header(const FileMeta p_file, bool p_do_hash) {
+void AppxPackager::store_central_dir_header(const FileMeta &p_file, bool p_do_hash) {
Vector<uint8_t> &buf = central_dir_data;
int offs = buf.size();
buf.resize(buf.size() + BASE_CENTRAL_DIR_SIZE + p_file.name.length());
-
// Write magic
offs += buf_put_int32(CENTRAL_DIR_MAGIC, &buf[offs]);
@@ -730,12 +378,6 @@ void AppxPackager::store_central_dir_header(const FileMeta p_file, bool p_do_has
// File name
offs += buf_put_string(p_file.name, &buf[offs]);
-#ifdef OPENSSL_ENABLED
- // Calculate the hash for signing
- if (p_do_hash)
- SHA256_Update(&axcd_context, buf.ptr(), buf.size());
-#endif // OPENSSL_ENABLED
-
// Done!
}
@@ -809,23 +451,16 @@ Vector<uint8_t> AppxPackager::make_end_of_central_record() {
return buf;
}
-void AppxPackager::init(FileAccess * p_fa, SignOption p_sign, String &p_certificate_path, String &p_certificate_password) {
+void AppxPackager::init(FileAccess *p_fa) {
package = p_fa;
central_dir_offset = 0;
end_of_central_dir_offset = 0;
tmp_blockmap_file_path = EditorSettings::get_singleton()->get_settings_path() + "/tmp/tmpblockmap.xml";
tmp_content_types_file_path = EditorSettings::get_singleton()->get_settings_path() + "/tmp/tmpcontenttypes.xml";
-#ifdef OPENSSL_ENABLED
- certificate_path = p_certificate_path;
- certificate_pass = p_certificate_password;
- sign_package = p_sign == SIGN;
- SHA256_Init(&axpc_context);
- SHA256_Init(&axcd_context);
-#endif // OPENSSL_ENABLED
}
-void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t p_len, int p_file_no, int p_total_files, bool p_compress) {
+void AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t p_len, int p_file_no, int p_total_files, bool p_compress) {
if (p_file_no >= 1 && p_total_files >= 1) {
EditorNode::progress_task_step(progress_task, "File: " + p_file_name, (p_file_no * 100) / p_total_files);
@@ -844,7 +479,7 @@ void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t
// Data for compression
z_stream strm;
- FileAccess* strm_f = NULL;
+ FileAccess *strm_f = NULL;
Vector<uint8_t> strm_in;
strm_in.resize(BLOCK_SIZE);
Vector<uint8_t> strm_out;
@@ -890,11 +525,6 @@ void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t
file_buffer.resize(file_buffer.size() + bh.compressed_size);
for (int i = 0; i < bh.compressed_size; i++)
file_buffer[start + i] = strm_out[i];
-#ifdef OPENSSL_ENABLED
- if (do_hash)
- SHA256_Update(&axpc_context, strm_out.ptr(), strm.total_out - total_out_before);
-#endif // OPENSSL_ENABLED
-
} else {
bh.compressed_size = block_size;
//package->store_buffer(strm_in.ptr(), block_size);
@@ -902,10 +532,6 @@ void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t
file_buffer.resize(file_buffer.size() + block_size);
for (int i = 0; i < bh.compressed_size; i++)
file_buffer[start + i] = strm_in[i];
-#ifdef OPENSSL_ENABLED
- if (do_hash)
- SHA256_Update(&axpc_context, strm_in.ptr(), block_size);
-#endif // OPENSSL_ENABLED
}
meta.hashes.push_back(bh);
@@ -929,10 +555,6 @@ void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t
file_buffer.resize(file_buffer.size() + (strm.total_out - total_out_before));
for (int i = 0; i < (strm.total_out - total_out_before); i++)
file_buffer[start + i] = strm_out[i];
-#ifdef OPENSSL_ENABLED
- if (do_hash)
- SHA256_Update(&axpc_context, strm_out.ptr(), strm.total_out - total_out_before);
-#endif // OPENSSL_ENABLED
deflateEnd(&strm);
meta.compressed_size = strm.total_out;
@@ -951,14 +573,6 @@ void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t
Vector<uint8_t> file_header = make_file_header(meta);
meta.lfh_size = file_header.size();
-#ifdef OPENSSL_ENABLED
- // Hash the data for signing
- if (do_hash) {
- SHA256_Update(&axpc_context, file_header.ptr(), file_header.size());
- SHA256_Update(&axpc_context, file_buffer.ptr(), file_buffer.size());
- }
-#endif // OPENSSL_ENABLED
-
// Store the header and file;
package->store_buffer(file_header.ptr(), file_header.size());
package->store_buffer(file_buffer.ptr(), file_buffer.size());
@@ -972,22 +586,12 @@ void AppxPackager::finish() {
EditorNode::progress_task_step("export", "Creating block map...", 4);
make_block_map();
- FileAccess* blockmap_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::READ);
+ FileAccess *blockmap_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::READ);
Vector<uint8_t> blockmap_buffer;
blockmap_buffer.resize(blockmap_file->get_len());
blockmap_file->get_buffer(blockmap_buffer.ptr(), blockmap_buffer.size());
-#ifdef OPENSSL_ENABLED
- // Hash the file for signing
- if (sign_package) {
- SHA256_CTX axbm_context;
- SHA256_Init(&axbm_context);
- SHA256_Update(&axbm_context, blockmap_buffer.ptr(), blockmap_buffer.size());
- SHA256_Final(digests.axbm, &axbm_context);
- }
-#endif // OPENSSL_ENABLED
-
add_file("AppxBlockMap.xml", blockmap_buffer.ptr(), blockmap_buffer.size(), -1, -1, true);
blockmap_file->close();
@@ -998,22 +602,12 @@ void AppxPackager::finish() {
EditorNode::progress_task_step("export", "Setting content types...", 5);
make_content_types();
- FileAccess* types_file = FileAccess::open(tmp_content_types_file_path, FileAccess::READ);
+ FileAccess *types_file = FileAccess::open(tmp_content_types_file_path, FileAccess::READ);
Vector<uint8_t> types_buffer;
types_buffer.resize(types_file->get_len());
types_file->get_buffer(types_buffer.ptr(), types_buffer.size());
-#ifdef OPENSSL_ENABLED
- if (sign_package) {
- // Hash the file for signing
- SHA256_CTX axct_context;
- SHA256_Init(&axct_context);
- SHA256_Update(&axct_context, types_buffer.ptr(), types_buffer.size());
- SHA256_Final(digests.axct, &axct_context);
- }
-#endif // OPENSSL_ENABLED
-
add_file("[Content_Types].xml", types_buffer.ptr(), types_buffer.size(), -1, -1, true);
types_file->close();
@@ -1025,76 +619,6 @@ void AppxPackager::finish() {
store_central_dir_header(file_metadata[i]);
}
-#ifdef OPENSSL_ENABLED
- // Create the signature file
- if (sign_package) {
-
- Error err = read_cert_file(certificate_path, certificate_pass, &cert_file);
-
- if (err != OK) {
- EditorNode::add_io_error(TTR("Couldn't read the certificate file. Are the path and password both correct?"));
- package->close();
- memdelete(package);
- package = NULL;
- return;
- }
-
-
- // Make a temp end of the zip for hashing
- central_dir_offset = package->get_pos();
- end_of_central_dir_offset = central_dir_offset + central_dir_data.size();
- Vector<uint8_t> zip_end_dir = make_end_of_central_record();
-
- // Hash the end directory
- SHA256_Update(&axcd_context, zip_end_dir.ptr(), zip_end_dir.size());
-
- // Finish the hashes
- make_digests();
-
- PKCS7* signature = PKCS7_new();
- if (!signature) {
- EditorNode::add_io_error(TTR("Error creating the signature object."));
- package->close();
- memdelete(package);
- package = NULL;
- return;
- }
-
- err = sign(cert_file, digests, signature);
-
- if (err != OK) {
- EditorNode::add_io_error(TTR("Error creating the package signature."));
- package->close();
- memdelete(package);
- package = NULL;
- return;
- }
-
- // Read the signature as bytes
- BIO* bio_out = BIO_new(BIO_s_mem());
- i2d_PKCS7_bio(bio_out, signature);
-
- BIO_flush(bio_out);
-
- uint8_t* bio_ptr;
- size_t bio_size = BIO_get_mem_data(bio_out, &bio_ptr);
-
- // Create the signature buffer with magic number
- Vector<uint8_t> signature_file;
- signature_file.resize(4 + bio_size);
- buf_put_int32(P7X_SIGNATURE, signature_file.ptr());
- for (int i = 0; i < bio_size; i++)
- signature_file[i + 4] = bio_ptr[i];
-
- // Add the signature to the package
- add_file("AppxSignature.p7x", signature_file.ptr(), signature_file.size(), -1, -1, true);
-
- // Add central directory entry
- store_central_dir_header(file_metadata[file_metadata.size() - 1], false);
- }
-#endif // OPENSSL_ENABLED
-
-
// Write central directory
EditorNode::progress_task_step("export", "Finishing package...", 6);
central_dir_offset = package->get_pos();
@@ -1110,1284 +634,759 @@ void AppxPackager::finish() {
package = NULL;
}
-#ifdef OPENSSL_ENABLED
-// https://support.microsoft.com/en-us/kb/287547
-const char SPC_INDIRECT_DATA_OBJID[] = "1.3.6.1.4.1.311.2.1.4";
-const char SPC_STATEMENT_TYPE_OBJID[] = "1.3.6.1.4.1.311.2.1.11";
-const char SPC_SP_OPUS_INFO_OBJID[] = "1.3.6.1.4.1.311.2.1.12";
-const char SPC_SIPINFO_OBJID[] = "1.3.6.1.4.1.311.2.1.30";
-#endif // OPENSSL_ENABLED
-
AppxPackager::AppxPackager() {}
AppxPackager::~AppxPackager() {}
-
////////////////////////////////////////////////////////////////////
-#ifdef OPENSSL_ENABLED
-Error AppxPackager::openssl_error(unsigned long p_err) {
-
- ERR_load_crypto_strings();
+class EditorExportUWP : public EditorExportPlatform {
- char buffer[256];
- ERR_error_string_n(p_err, buffer, sizeof(buffer));
+ GDCLASS(EditorExportUWP, EditorExportPlatform);
- String err(buffer);
-
- ERR_EXPLAIN(err);
- ERR_FAIL_V(FAILED);
-}
-
-void AppxPackager::MakeSPCInfoValue(asn1::SPCInfoValue &info) {
+ Ref<ImageTexture> logo;
- // I have no idea what these numbers mean.
- static uint8_t s1Magic[] = {
- 0x4B, 0xDF, 0xC5, 0x0A, 0x07, 0xCE, 0xE2, 0x4D,
- 0xB7, 0x6E, 0x23, 0xC8, 0x39, 0xA0, 0x9F, 0xD1,
+ enum Platform {
+ ARM,
+ X86,
+ X64
};
- ASN1_INTEGER_set(info.i1, 0x01010000);
- ASN1_OCTET_STRING_set(info.s1, s1Magic, sizeof(s1Magic));
- ASN1_INTEGER_set(info.i2, 0x00000000);
- ASN1_INTEGER_set(info.i3, 0x00000000);
- ASN1_INTEGER_set(info.i4, 0x00000000);
- ASN1_INTEGER_set(info.i5, 0x00000000);
- ASN1_INTEGER_set(info.i6, 0x00000000);
-}
-
-Error AppxPackager::MakeIndirectDataContent(asn1::SPCIndirectDataContent &idc) {
- using namespace asn1;
+ bool _valid_resource_name(const String &p_name) const {
- ASN1_TYPE* algorithmParameter = ASN1_TYPE_new();
- if (!algorithmParameter) {
- return openssl_error(ERR_peek_last_error());
- }
- algorithmParameter->type = V_ASN1_NULL;
-
- SPCInfoValue* infoValue = SPCInfoValue_new();
- if (!infoValue) {
- return openssl_error(ERR_peek_last_error());
- }
- MakeSPCInfoValue(*infoValue);
+ if (p_name.empty()) return false;
+ if (p_name.ends_with(".")) return false;
- ASN1_TYPE* value =
- EncodedASN1::FromItem<asn1::SPCInfoValue,
- asn1::i2d_SPCInfoValue>(infoValue)
- .ToSequenceType();
+ static const char *invalid_names[] = {
+ "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7",
+ "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9",
+ NULL
+ };
- {
- Vector<uint8_t> digest;
- write_digest(digest);
- if (!ASN1_OCTET_STRING_set(idc.messageDigest->digest,
- digest.ptr(), digest.size())) {
-
- return openssl_error(ERR_peek_last_error());
+ const char **t = invalid_names;
+ while (*t) {
+ if (p_name == *t) return false;
+ t++;
}
- }
-
- idc.data->type = OBJ_txt2obj(SPC_SIPINFO_OBJID, 1);
- idc.data->value = value;
- idc.messageDigest->digestAlgorithm->algorithm = OBJ_nid2obj(NID_sha256);
- idc.messageDigest->digestAlgorithm->parameter = algorithmParameter;
-
- return OK;
-}
-
-Error AppxPackager::add_attributes(PKCS7_SIGNER_INFO * p_signer_info) {
-
- // Add opus attribute
- asn1::SPCSpOpusInfo* opus = asn1::SPCSpOpusInfo_new();
- if (!opus) return openssl_error(ERR_peek_last_error());
-
- ASN1_STRING* opus_value =
- EncodedASN1::FromItem<asn1::SPCSpOpusInfo,
- asn1::i2d_SPCSpOpusInfo>(opus)
- .ToSequenceString();
-
- if (!PKCS7_add_signed_attribute(
- p_signer_info,
- OBJ_txt2nid(SPC_SP_OPUS_INFO_OBJID),
- V_ASN1_SEQUENCE,
- opus_value
- )) {
-
- asn1::SPCSpOpusInfo_free(opus);
-
- ASN1_STRING_free(opus_value);
- return openssl_error(ERR_peek_last_error());
- }
-
- // Add content type attribute
- if (!PKCS7_add_signed_attribute(
- p_signer_info,
- NID_pkcs9_contentType,
- V_ASN1_OBJECT,
- OBJ_txt2obj(SPC_INDIRECT_DATA_OBJID, 1)
- )) {
-
- asn1::SPCSpOpusInfo_free(opus);
- ASN1_STRING_free(opus_value);
- return openssl_error(ERR_peek_last_error());
- }
-
- // Add statement type attribute
- asn1::SPCStatementType* statement_type = asn1::SPCStatementType_new();
- if (!statement_type) return openssl_error(ERR_peek_last_error());
-
- statement_type->type = OBJ_nid2obj(NID_ms_code_ind);
- ASN1_STRING* statement_type_value =
- EncodedASN1::FromItem<asn1::SPCStatementType,
- asn1::i2d_SPCStatementType>(statement_type)
- .ToSequenceString();
-
- if (!PKCS7_add_signed_attribute(
- p_signer_info,
- OBJ_txt2nid(SPC_STATEMENT_TYPE_OBJID),
- V_ASN1_SEQUENCE,
- statement_type_value
- )) {
-
- ASN1_STRING_free(opus_value);
- asn1::SPCStatementType_free(statement_type);
- ASN1_STRING_free(statement_type_value);
-
- return openssl_error(ERR_peek_last_error());
- }
-
- return OK;
-
-}
-
-void AppxPackager::make_digests() {
-
- // AXPC
- SHA256_Final(digests.axpc, &axpc_context);
-
- // AXCD
- SHA256_Final(digests.axcd, &axcd_context);
-
- // AXCI
- for (int i = 0; i < SHA256_DIGEST_LENGTH; i++)
- digests.axci[i] = 0;
-
-}
-
-void AppxPackager::write_digest(Vector<uint8_t>& p_out_buffer) {
-
- // Size of digests plus 6 32-bit magic numbers
- p_out_buffer.resize((SHA256_DIGEST_LENGTH * 5) + (6 * 4));
-
- int offs = 0;
-
- // APPX
- uint32_t sig = 0x58505041;
- offs += buf_put_int32(sig, &p_out_buffer[offs]);
-
- // AXPC
- uint32_t axpc_sig = 0x43505841;
- offs += buf_put_int32(axpc_sig, &p_out_buffer[offs]);
- for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) {
- p_out_buffer[offs++] = digests.axpc[i];
- }
-
- // AXCD
- uint32_t axcd_sig = 0x44435841;
- offs += buf_put_int32(axcd_sig, &p_out_buffer[offs]);
- for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) {
- p_out_buffer[offs++] = digests.axcd[i];
- }
-
- // AXCT
- uint32_t axct_sig = 0x54435841;
- offs += buf_put_int32(axct_sig, &p_out_buffer[offs]);
- for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) {
- p_out_buffer[offs++] = digests.axct[i];
- }
-
- // AXBM
- uint32_t axbm_sig = 0x4D425841;
- offs += buf_put_int32(axbm_sig, &p_out_buffer[offs]);
- for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) {
- p_out_buffer[offs++] = digests.axbm[i];
- }
-
- // AXCI
- uint32_t axci_sig = 0x49435841;
- offs += buf_put_int32(axci_sig, &p_out_buffer[offs]);
- for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) {
- p_out_buffer[offs++] = digests.axci[i];
- }
-
- // Done!
-}
-
-Error AppxPackager::read_cert_file(const String & p_path, const String &p_password, CertFile* p_out_cf) {
-
- ERR_FAIL_COND_V(!p_out_cf, ERR_INVALID_PARAMETER);
-
- BIO* bio = BIO_new_file(p_path.utf8().get_data(), "rb");
- if (!bio) {
- return openssl_error(ERR_peek_last_error());
- }
-
- PKCS12* data = d2i_PKCS12_bio(bio, NULL);
- if (!data) {
- BIO_free(bio);
- return openssl_error(ERR_peek_last_error());
- }
-
- /* Fails to link with GCC, need to solve when implement signing
- if (!PKCS12_parse(data, p_password.utf8().get_data(), &p_out_cf->private_key, &p_out_cf->certificate, NULL)) {
- PKCS12_free(data);
- BIO_free(bio);
- return openssl_error(ERR_peek_last_error());
- }*/
-
- if (!p_out_cf->private_key) {
- PKCS12_free(data);
- BIO_free(bio);
- return openssl_error(ERR_peek_last_error());
- }
-
- if (!p_out_cf->certificate) {
- PKCS12_free(data);
- BIO_free(bio);
- return openssl_error(ERR_peek_last_error());
- }
-
- PKCS12_free(data);
- BIO_free(bio);
-
- return OK;
-}
-
-Error AppxPackager::sign(const CertFile & p_cert, const AppxDigests & digests, PKCS7 * p_out_signature) {
-
- OpenSSL_add_all_algorithms();
- // Register object IDs
- OBJ_create_and_add_object(SPC_INDIRECT_DATA_OBJID, NULL, NULL);
- OBJ_create_and_add_object(SPC_SIPINFO_OBJID, NULL, NULL);
- OBJ_create_and_add_object(SPC_SP_OPUS_INFO_OBJID, NULL, NULL);
- OBJ_create_and_add_object(SPC_STATEMENT_TYPE_OBJID, NULL, NULL);
-
- if (!PKCS7_set_type(p_out_signature, NID_pkcs7_signed)) {
-
- return openssl_error(ERR_peek_last_error());
- }
-
- PKCS7_SIGNER_INFO *signer_info = PKCS7_add_signature(p_out_signature, p_cert.certificate, p_cert.private_key, EVP_sha256());
- if (!signer_info) return openssl_error(ERR_peek_last_error());
-
- add_attributes(signer_info);
-
- if (!PKCS7_content_new(p_out_signature, NID_pkcs7_data)) {
+ return true;
+ }
+
+ bool _valid_guid(const String &p_guid) const {
+
+ Vector<String> parts = p_guid.split("-");
+
+ if (parts.size() != 5) return false;
+ if (parts[0].length() != 8) return false;
+ for (int i = 1; i < 4; i++)
+ if (parts[i].length() != 4) return false;
+ if (parts[4].length() != 12) return false;
+
+ return true;
+ }
+
+ bool _valid_bgcolor(const String &p_color) const {
+
+ if (p_color.empty()) return true;
+ if (p_color.begins_with("#") && p_color.is_valid_html_color()) return true;
+
+ // Colors from https://msdn.microsoft.com/en-us/library/windows/apps/dn934817.aspx
+ static const char *valid_colors[] = {
+ "aliceBlue", "antiqueWhite", "aqua", "aquamarine", "azure", "beige",
+ "bisque", "black", "blanchedAlmond", "blue", "blueViolet", "brown",
+ "burlyWood", "cadetBlue", "chartreuse", "chocolate", "coral", "cornflowerBlue",
+ "cornsilk", "crimson", "cyan", "darkBlue", "darkCyan", "darkGoldenrod",
+ "darkGray", "darkGreen", "darkKhaki", "darkMagenta", "darkOliveGreen", "darkOrange",
+ "darkOrchid", "darkRed", "darkSalmon", "darkSeaGreen", "darkSlateBlue", "darkSlateGray",
+ "darkTurquoise", "darkViolet", "deepPink", "deepSkyBlue", "dimGray", "dodgerBlue",
+ "firebrick", "floralWhite", "forestGreen", "fuchsia", "gainsboro", "ghostWhite",
+ "gold", "goldenrod", "gray", "green", "greenYellow", "honeydew",
+ "hotPink", "indianRed", "indigo", "ivory", "khaki", "lavender",
+ "lavenderBlush", "lawnGreen", "lemonChiffon", "lightBlue", "lightCoral", "lightCyan",
+ "lightGoldenrodYellow", "lightGreen", "lightGray", "lightPink", "lightSalmon", "lightSeaGreen",
+ "lightSkyBlue", "lightSlateGray", "lightSteelBlue", "lightYellow", "lime", "limeGreen",
+ "linen", "magenta", "maroon", "mediumAquamarine", "mediumBlue", "mediumOrchid",
+ "mediumPurple", "mediumSeaGreen", "mediumSlateBlue", "mediumSpringGreen", "mediumTurquoise", "mediumVioletRed",
+ "midnightBlue", "mintCream", "mistyRose", "moccasin", "navajoWhite", "navy",
+ "oldLace", "olive", "oliveDrab", "orange", "orangeRed", "orchid",
+ "paleGoldenrod", "paleGreen", "paleTurquoise", "paleVioletRed", "papayaWhip", "peachPuff",
+ "peru", "pink", "plum", "powderBlue", "purple", "red",
+ "rosyBrown", "royalBlue", "saddleBrown", "salmon", "sandyBrown", "seaGreen",
+ "seaShell", "sienna", "silver", "skyBlue", "slateBlue", "slateGray",
+ "snow", "springGreen", "steelBlue", "tan", "teal", "thistle",
+ "tomato", "transparent", "turquoise", "violet", "wheat", "white",
+ "whiteSmoke", "yellow", "yellowGreen",
+ NULL
+ };
+
+ const char **color = valid_colors;
+
+ while (*color) {
+ if (p_color == *color) return true;
+ color++;
+ }
- return openssl_error(ERR_peek_last_error());
+ return false;
}
- if (!PKCS7_add_certificate(p_out_signature, p_cert.certificate)) {
+ bool _valid_image(const StreamTexture *p_image, int p_width, int p_height) const {
- return openssl_error(ERR_peek_last_error());
- }
+ if (!p_image) {
+ return false;
+ }
- asn1::SPCIndirectDataContent* idc = asn1::SPCIndirectDataContent_new();
+ // TODO: Add resource creation or image rescaling to enable other scales:
+ // 1.25, 1.5, 2.0
+ real_t scales[] = { 1.0 };
+ bool valid_w = false;
+ bool valid_h = false;
- MakeIndirectDataContent(*idc);
- EncodedASN1 idc_encoded =
- EncodedASN1::FromItem<asn1::SPCIndirectDataContent, asn1::i2d_SPCIndirectDataContent>(idc);
+ for (int i = 0; i < 1; i++) {
- BIO* signed_data = PKCS7_dataInit(p_out_signature, NULL);
+ int w = ceil(p_width * scales[i]);
+ int h = ceil(p_height * scales[i]);
- if (idc_encoded.size() < 2) {
+ if (w == p_image->get_width())
+ valid_w = true;
+ if (h == p_image->get_height())
+ valid_h = true;
+ }
- ERR_EXPLAIN("Invalid encoded size");
- ERR_FAIL_V(FAILED);
+ return valid_w && valid_h;
}
- if ((idc_encoded.data()[1] & 0x80) == 0x00) {
+ Vector<uint8_t> _fix_manifest(const Ref<EditorExportPreset> &p_preset, const Vector<uint8_t> &p_template, bool p_give_internet) const {
- ERR_EXPLAIN("Invalid encoded data");
- ERR_FAIL_V(FAILED);
- }
+ String result = String::utf8((const char *)p_template.ptr(), p_template.size());
- size_t skip = 4;
+ result = result.replace("$godot_version$", VERSION_FULL_NAME);
- if (BIO_write(signed_data, idc_encoded.data() + skip, idc_encoded.size() - skip)
- != idc_encoded.size() - skip) {
+ result = result.replace("$identity_name$", p_preset->get("package/unique_name"));
+ result = result.replace("$publisher$", p_preset->get("package/publisher"));
- return openssl_error(ERR_peek_last_error());
- }
- if (BIO_flush(signed_data) != 1) {
+ result = result.replace("$product_guid$", p_preset->get("identity/product_guid"));
+ result = result.replace("$publisher_guid$", p_preset->get("identity/publisher_guid"));
- return openssl_error(ERR_peek_last_error());
- }
+ String version = itos(p_preset->get("version/major")) + "." + itos(p_preset->get("version/minor")) + "." + itos(p_preset->get("version/build")) + "." + itos(p_preset->get("version/revision"));
+ result = result.replace("$version_string$", version);
- if (!PKCS7_dataFinal(p_out_signature, signed_data)) {
+ Platform arch = (Platform)(int)p_preset->get("architecture/target");
+ String architecture = arch == ARM ? "ARM" : arch == X86 ? "x86" : "x64";
+ result = result.replace("$architecture$", architecture);
- return openssl_error(ERR_peek_last_error());
- }
+ result = result.replace("$display_name$", String(p_preset->get("package/display_name")).empty() ? (String)ProjectSettings::get_singleton()->get("application/config/name") : String(p_preset->get("package/display_name")));
- PKCS7* content = PKCS7_new();
- if (!content) {
+ result = result.replace("$publisher_display_name$", p_preset->get("package/publisher_display_name"));
+ result = result.replace("$app_description$", p_preset->get("package/description"));
+ result = result.replace("$bg_color$", p_preset->get("images/background_color"));
+ result = result.replace("$short_name$", p_preset->get("package/short_name"));
- return openssl_error(ERR_peek_last_error());
- }
+ String name_on_tiles = "";
+ if ((bool)p_preset->get("tiles/show_name_on_square150x150")) {
+ name_on_tiles += " <uap:ShowOn Tile=\"square150x150Logo\" />\n";
+ }
+ if ((bool)p_preset->get("tiles/show_name_on_wide310x150")) {
+ name_on_tiles += " <uap:ShowOn Tile=\"wide310x150Logo\" />\n";
+ }
+ if ((bool)p_preset->get("tiles/show_name_on_square310x310")) {
+ name_on_tiles += " <uap:ShowOn Tile=\"square310x310Logo\" />\n";
+ }
- content->type = OBJ_txt2obj(SPC_INDIRECT_DATA_OBJID, 1);
+ String show_name_on_tiles = "";
+ if (!name_on_tiles.empty()) {
+ show_name_on_tiles = "<uap:ShowNameOnTiles>\n" + name_on_tiles + " </uap:ShowNameOnTiles>";
+ }
- ASN1_TYPE* idc_sequence = idc_encoded.ToSequenceType();
- content->d.other = idc_sequence;
+ result = result.replace("$name_on_tiles$", name_on_tiles);
- if (!PKCS7_set_content(p_out_signature, content)) {
+ String rotations = "";
+ if ((bool)p_preset->get("orientation/landscape")) {
+ rotations += " <uap:Rotation Preference=\"landscape\" />\n";
+ }
+ if ((bool)p_preset->get("orientation/portrait")) {
+ rotations += " <uap:Rotation Preference=\"portrait\" />\n";
+ }
+ if ((bool)p_preset->get("orientation/landscape_flipped")) {
+ rotations += " <uap:Rotation Preference=\"landscapeFlipped\" />\n";
+ }
+ if ((bool)p_preset->get("orientation/portrait_flipped")) {
+ rotations += " <uap:Rotation Preference=\"portraitFlipped\" />\n";
+ }
- return openssl_error(ERR_peek_last_error());
- }
+ String rotation_preference = "";
+ if (!rotations.empty()) {
+ rotation_preference = "<uap:InitialRotationPreference>\n" + rotations + " </uap:InitialRotationPreference>";
+ }
- return OK;
-}
+ result = result.replace("$rotation_preference$", rotation_preference);
-#endif // OPENSSL_ENABLED
+ String capabilities_elements = "";
+ const char **basic = uwp_capabilities;
+ while (*basic) {
+ if ((bool)p_preset->get("capabilities/" + String(*basic))) {
+ capabilities_elements += " <Capability Name=\"" + String(*basic) + "\" />\n";
+ }
+ basic++;
+ }
+ const char **uap = uwp_uap_capabilities;
+ while (*uap) {
+ if ((bool)p_preset->get("capabilities/" + String(*uap))) {
+ capabilities_elements += " <uap:Capability Name=\"" + String(*uap) + "\" />\n";
+ }
+ uap++;
+ }
+ const char **device = uwp_device_capabilites;
+ while (*device) {
+ if ((bool)p_preset->get("capabilities/" + String(*device))) {
+ capabilities_elements += " <DeviceCapability Name=\"" + String(*device) + "\" />\n";
+ }
+ device++;
+ }
-////////////////////////////////////////////////////////////////////
+ if (!((bool)p_preset->get("capabilities/internetClient")) && p_give_internet) {
+ capabilities_elements += " <Capability Name=\"internetClient\" />\n";
+ }
+ String capabilities_string = "<Capabilities />";
+ if (!capabilities_elements.empty()) {
+ capabilities_string = "<Capabilities>\n" + capabilities_elements + " </Capabilities>";
+ }
-bool EditorExportPlatformUWP::_valid_resource_name(const String &p_name) const {
+ result = result.replace("$capabilities_place$", capabilities_string);
- if (p_name.empty()) return false;
- if (p_name.ends_with(".")) return false;
+ Vector<uint8_t> r_ret;
+ r_ret.resize(result.length());
- static const char* invalid_names[] = {
- "CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7",
- "COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9",
- NULL
- };
+ for (int i = 0; i < result.length(); i++)
+ r_ret[i] = result.utf8().get(i);
- const char** t = invalid_names;
- while (*t) {
- if (p_name == *t) return false;
- t++;
+ return r_ret;
}
- return true;
-}
+ Vector<uint8_t> _get_image_data(const Ref<EditorExportPreset> &p_preset, const String &p_path) {
-bool EditorExportPlatformUWP::_valid_guid(const String & p_guid) const {
+ Vector<uint8_t> data;
+ StreamTexture *image;
+
+ if (p_path.find("StoreLogo") != -1) {
+ image = p_preset->get("images/store_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/store_logo"))->cast_to<StreamTexture>();
+ } else if (p_path.find("Square44x44Logo") != -1) {
+ image = p_preset->get("images/square44x44_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/square44x44_logo"))->cast_to<StreamTexture>();
+ } else if (p_path.find("Square71x71Logo") != -1) {
+ image = p_preset->get("images/square71x71_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/square71x71_logo"))->cast_to<StreamTexture>();
+ } else if (p_path.find("Square150x150Logo") != -1) {
+ image = p_preset->get("images/square150x150_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/square150x150_logo"))->cast_to<StreamTexture>();
+ } else if (p_path.find("Square310x310Logo") != -1) {
+ image = p_preset->get("images/square310x310_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/square310x310_logo"))->cast_to<StreamTexture>();
+ } else if (p_path.find("Wide310x150Logo") != -1) {
+ image = p_preset->get("images/wide310x150_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/wide310x150_logo"))->cast_to<StreamTexture>();
+ } else if (p_path.find("SplashScreen") != -1) {
+ image = p_preset->get("images/splash_screen").is_zero() ? NULL : ((Object *)p_preset->get("images/splash_screen"))->cast_to<StreamTexture>();
+ }
- Vector<String> parts = p_guid.split("-");
+ if (!image) return data;
- if (parts.size() != 5) return false;
- if (parts[0].length() != 8) return false;
- for (int i = 1; i < 4; i++)
- if (parts[i].length() != 4) return false;
- if (parts[4].length() != 12) return false;
+ String tmp_path = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/uwp_tmp_logo.png");
- return true;
-}
+ Error err = image->get_data()->save_png(tmp_path);
-bool EditorExportPlatformUWP::_valid_bgcolor(const String & p_color) const {
-
- if (p_color.empty()) return true;
- if (p_color.begins_with("#") && p_color.is_valid_html_color()) return true;
-
- // Colors from https://msdn.microsoft.com/en-us/library/windows/apps/dn934817.aspx
- static const char* valid_colors[] = {
- "aliceBlue","antiqueWhite","aqua","aquamarine","azure","beige",
- "bisque","black","blanchedAlmond","blue","blueViolet","brown",
- "burlyWood","cadetBlue","chartreuse","chocolate","coral","cornflowerBlue",
- "cornsilk","crimson","cyan","darkBlue","darkCyan","darkGoldenrod",
- "darkGray","darkGreen","darkKhaki","darkMagenta","darkOliveGreen","darkOrange",
- "darkOrchid","darkRed","darkSalmon","darkSeaGreen","darkSlateBlue","darkSlateGray",
- "darkTurquoise","darkViolet","deepPink","deepSkyBlue","dimGray","dodgerBlue",
- "firebrick","floralWhite","forestGreen","fuchsia","gainsboro","ghostWhite",
- "gold","goldenrod","gray","green","greenYellow","honeydew",
- "hotPink","indianRed","indigo","ivory","khaki","lavender",
- "lavenderBlush","lawnGreen","lemonChiffon","lightBlue","lightCoral","lightCyan",
- "lightGoldenrodYellow","lightGreen","lightGray","lightPink","lightSalmon","lightSeaGreen",
- "lightSkyBlue","lightSlateGray","lightSteelBlue","lightYellow","lime","limeGreen",
- "linen","magenta","maroon","mediumAquamarine","mediumBlue","mediumOrchid",
- "mediumPurple","mediumSeaGreen","mediumSlateBlue","mediumSpringGreen","mediumTurquoise","mediumVioletRed",
- "midnightBlue","mintCream","mistyRose","moccasin","navajoWhite","navy",
- "oldLace","olive","oliveDrab","orange","orangeRed","orchid",
- "paleGoldenrod","paleGreen","paleTurquoise","paleVioletRed","papayaWhip","peachPuff",
- "peru","pink","plum","powderBlue","purple","red",
- "rosyBrown","royalBlue","saddleBrown","salmon","sandyBrown","seaGreen",
- "seaShell","sienna","silver","skyBlue","slateBlue","slateGray",
- "snow","springGreen","steelBlue","tan","teal","thistle",
- "tomato","transparent","turquoise","violet","wheat","white",
- "whiteSmoke","yellow","yellowGreen",
- NULL
- };
+ if (err != OK) {
- const char** color = valid_colors;
+ String err_string = "Couldn't save temp logo file.";
- while(*color) {
- if (p_color == *color) return true;
- color++;
- }
+ EditorNode::add_io_error(err_string);
+ ERR_EXPLAIN(err_string);
+ ERR_FAIL_V(data);
+ }
- return false;
-}
+ FileAccess *f = FileAccess::open(tmp_path, FileAccess::READ, &err);
-bool EditorExportPlatformUWP::_valid_image(const Ref<ImageTexture> p_image, int p_width, int p_height) const {
+ if (err != OK) {
- if (!p_image.is_valid()) return false;
+ String err_string = "Couldn't open temp logo file.";
- // TODO: Add resource creation or image rescaling to enable other scales:
- // 1.25, 1.5, 2.0
- real_t scales[] = { 1.0 };
- bool valid_w = false;
- bool valid_h = false;
+ EditorNode::add_io_error(err_string);
+ ERR_EXPLAIN(err_string);
+ ERR_FAIL_V(data);
+ }
- for (int i = 0; i < 1; i++) {
+ data.resize(f->get_len());
+ f->get_buffer(data.ptr(), data.size());
- int w = ceil(p_width * scales[i]);
- int h = ceil(p_height * scales[i]);
+ f->close();
+ memdelete(f);
- if (w == p_image->get_width())
- valid_w = true;
- if (h == p_image->get_height())
- valid_h = true;
- }
+ // Delete temp file
+ DirAccess *dir = DirAccess::open(tmp_path.get_base_dir(), &err);
- return valid_w && valid_h;
-}
+ if (err != OK) {
-Vector<uint8_t> EditorExportPlatformUWP::_fix_manifest(const Vector<uint8_t> &p_template, bool p_give_internet) const {
+ String err_string = "Couldn't open temp path to remove temp logo file.";
- String result = String::utf8((const char*)p_template.ptr(), p_template.size());
+ EditorNode::add_io_error(err_string);
+ ERR_EXPLAIN(err_string);
+ ERR_FAIL_V(data);
+ }
- result = result.replace("$godot_version$", VERSION_FULL_NAME);
+ err = dir->remove(tmp_path);
- result = result.replace("$identity_name$", unique_name);
- result = result.replace("$publisher$", publisher);
+ memdelete(dir);
- result = result.replace("$product_guid$", product_guid);
- result = result.replace("$publisher_guid$", publisher_guid);
+ if (err != OK) {
- String version = itos(version_major) + "." + itos(version_minor) + "." + itos(version_build) + "." + itos(version_revision);
- result = result.replace("$version_string$", version);
+ String err_string = "Couldn't remove temp logo file.";
- String architecture = arch == ARM ? "ARM" : arch == X86 ? "x86" : "x64";
- result = result.replace("$architecture$", architecture);
+ EditorNode::add_io_error(err_string);
+ ERR_EXPLAIN(err_string);
+ ERR_FAIL_V(data);
+ }
- result = result.replace("$display_name$", display_name.empty() ? (String)GlobalConfig::get_singleton()->get("application/name") : display_name);
- result = result.replace("$publisher_display_name$", publisher_display_name);
- result = result.replace("$app_description$", description);
- result = result.replace("$bg_color$", background_color);
- result = result.replace("$short_name$", short_name);
+ return data;
+ }
+
+ static bool _should_compress_asset(const String &p_path, const Vector<uint8_t> &p_data) {
+
+ /* TODO: This was copied verbatim from Android export. It should be
+ * refactored to the parent class and also be used for .zip export.
+ */
+
+ /*
+ * By not compressing files with little or not benefit in doing so,
+ * a performance gain is expected at runtime. Moreover, if the APK is
+ * zip-aligned, assets stored as they are can be efficiently read by
+ * Android by memory-mapping them.
+ */
+
+ // -- Unconditional uncompress to mimic AAPT plus some other
+
+ static const char *unconditional_compress_ext[] = {
+ // From https://github.com/android/platform_frameworks_base/blob/master/tools/aapt/Package.cpp
+ // These formats are already compressed, or don't compress well:
+ ".jpg", ".jpeg", ".png", ".gif",
+ ".wav", ".mp2", ".mp3", ".ogg", ".aac",
+ ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet",
+ ".rtttl", ".imy", ".xmf", ".mp4", ".m4a",
+ ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2",
+ ".amr", ".awb", ".wma", ".wmv",
+ // Godot-specific:
+ ".webp", // Same reasoning as .png
+ ".cfb", // Don't let small config files slow-down startup
+ ".scn", // Binary scenes are usually already compressed
+ ".stex", // Streamable textures are usually already compressed
+ // Trailer for easier processing
+ NULL
+ };
+
+ for (const char **ext = unconditional_compress_ext; *ext; ++ext) {
+ if (p_path.to_lower().ends_with(String(*ext))) {
+ return false;
+ }
+ }
- String name_on_tiles = "";
- if (name_on_square150) {
- name_on_tiles += " <uap:ShowOn Tile=\"square150x150Logo\" />\n";
- }
- if (name_on_wide) {
- name_on_tiles += " <uap:ShowOn Tile=\"wide310x150Logo\" />\n";
- }
- if (name_on_square310) {
- name_on_tiles += " <uap:ShowOn Tile=\"square310x310Logo\" />\n";
- }
+ // -- Compressed resource?
- String show_name_on_tiles = "";
- if (!name_on_tiles.empty()) {
- show_name_on_tiles = "<uap:ShowNameOnTiles>\n" + name_on_tiles + " </uap:ShowNameOnTiles>";
- }
+ if (p_data.size() >= 4 && p_data[0] == 'R' && p_data[1] == 'S' && p_data[2] == 'C' && p_data[3] == 'C') {
+ // Already compressed
+ return false;
+ }
- result = result.replace("$name_on_tiles$", name_on_tiles);
+ // --- TODO: Decide on texture resources according to their image compression setting
- String rotations = "";
- if (orientation_landscape) {
- rotations += " <uap:Rotation Preference=\"landscape\" />\n";
- }
- if (orientation_portrait) {
- rotations += " <uap:Rotation Preference=\"portrait\" />\n";
- }
- if (orientation_landscape_flipped) {
- rotations += " <uap:Rotation Preference=\"landscapeFlipped\" />\n";
- }
- if (orientation_portrait_flipped) {
- rotations += " <uap:Rotation Preference=\"portraitFlipped\" />\n";
+ return true;
}
- String rotation_preference = "";
- if (!rotations.empty()) {
- rotation_preference = "<uap:InitialRotationPreference>\n" + rotations + " </uap:InitialRotationPreference>";
- }
+ static Error save_appx_file(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total) {
- result = result.replace("$rotation_preference$", rotation_preference);
+ AppxPackager *packager = (AppxPackager *)p_userdata;
+ String dst_path = p_path.replace_first("res://", "game/");
- String capabilities_elements = "";
- const char **basic = uwp_capabilities;
- while (*basic) {
- if (capabilities.has(*basic)) {
- capabilities_elements += " <Capability Name=\"" + String(*basic) + "\" />\n";
- }
- basic++;
- }
- const char **uap = uwp_uap_capabilities;
- while (*uap) {
- if (uap_capabilities.has(*uap)) {
- capabilities_elements += " <uap:Capability Name=\"" + String(*uap) + "\" />\n";
- }
- uap++;
- }
- const char **device = uwp_device_capabilites;
- while (*device) {
- if (uap_capabilities.has(*device)) {
- capabilities_elements += " <DeviceCapability Name=\"" + String(*device) + "\" />\n";
- }
- device++;
- }
+ packager->add_file(dst_path, p_data.ptr(), p_data.size(), p_file, p_total, _should_compress_asset(p_path, p_data));
- if (!capabilities.has("internetClient") && p_give_internet) {
- capabilities_elements += " <Capability Name=\"internetClient\" />\n";
+ return OK;
}
- String capabilities_string = "<Capabilities />";
- if (!capabilities_elements.empty()) {
- capabilities_string = "<Capabilities>\n" + capabilities_elements + " </Capabilities>";
+public:
+ virtual String get_name() const {
+ return "Windows Universal";
}
-
- result = result.replace("$capabilities_place$", capabilities_string);
-
- Vector<uint8_t> r_ret;
- r_ret.resize(result.length());
-
- for (int i = 0; i < result.length(); i++)
- r_ret[i] = result.utf8().get(i);
-
- return r_ret;
-}
-
-Vector<uint8_t> EditorExportPlatformUWP::_get_image_data(const String & p_path) {
-
- Vector<uint8_t> data;
- Ref<ImageTexture> ref;
-
- if (p_path.find("StoreLogo") != -1) {
- ref = store_logo;
- } else if (p_path.find("Square44x44Logo") != -1) {
- ref = square44;
- } else if (p_path.find("Square71x71Logo") != -1) {
- ref = square71;
- } else if (p_path.find("Square150x150Logo") != -1) {
- ref = square150;
- } else if (p_path.find("Square310x310Logo") != -1) {
- ref = square310;
- } else if (p_path.find("Wide310x150Logo") != -1) {
- ref = wide310;
- } else if (p_path.find("SplashScreen") != -1) {
- ref = splash;
+ virtual String get_os_name() const {
+ return "UWP";
}
- if (!ref.is_valid()) return data;
-
-
- String tmp_path = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/uwp_tmp_logo.png");
-
- Error err = ref->get_data().save_png(tmp_path);
-
- if (err != OK) {
-
- String err_string = "Couldn't save temp logo file.";
-
- EditorNode::add_io_error(err_string);
- ERR_EXPLAIN(err_string);
- ERR_FAIL_V(data);
+ virtual String get_binary_extension() const {
+ return "appx";
}
- FileAccess* f = FileAccess::open(tmp_path, FileAccess::READ, &err);
-
- if (err != OK) {
-
- String err_string = "Couldn't open temp logo file.";
-
- EditorNode::add_io_error(err_string);
- ERR_EXPLAIN(err_string);
- ERR_FAIL_V(data);
+ virtual Ref<Texture> get_logo() const {
+ return logo;
}
- data.resize(f->get_len());
- f->get_buffer(data.ptr(), data.size());
-
- f->close();
- memdelete(f);
-
- // Delete temp file
- DirAccess* dir = DirAccess::open(tmp_path.get_base_dir(), &err);
-
- if (err != OK) {
-
- String err_string = "Couldn't open temp path to remove temp logo file.";
-
- EditorNode::add_io_error(err_string);
- ERR_EXPLAIN(err_string);
- ERR_FAIL_V(data);
+ virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) {
+ r_features->push_back("s3tc");
+ r_features->push_back("etc");
}
- err = dir->remove(tmp_path);
-
- memdelete(dir);
+ virtual void get_export_options(List<ExportOption> *r_options) {
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "architecture/target", PROPERTY_HINT_ENUM, "ARM,x86,x64"), 1));
- if (err != OK) {
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "command_line/extra_args"), ""));
- String err_string = "Couldn't remove temp logo file.";
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/display_name"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/short_name"), "Godot"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/unique_name"), "Godot.Engine"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/description"), "Godot Engine"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/publisher"), "CN=GodotEngine"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/publisher_display_name"), "Godot Engine"));
- EditorNode::add_io_error(err_string);
- ERR_EXPLAIN(err_string);
- ERR_FAIL_V(data);
- }
-
- return data;
-}
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "identity/product_guid"), "00000000-0000-0000-0000-000000000000"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "identity/publisher_guid"), "00000000-0000-0000-0000-000000000000"));
-Error EditorExportPlatformUWP::save_appx_file(void * p_userdata, const String & p_path, const Vector<uint8_t>& p_data, int p_file, int p_total) {
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/major"), 1));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/minor"), 0));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/build"), 0));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/revision"), 0));
- AppxPackager *packager = (AppxPackager*)p_userdata;
- String dst_path = p_path.replace_first("res://", "game/");
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/landscape"), true));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/portrait"), true));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/landscape_flipped"), true));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/portrait_flipped"), true));
- packager->add_file(dst_path, p_data.ptr(), p_data.size(), p_file, p_total, _should_compress_asset(p_path, p_data));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "images/background_color"), "transparent"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/store_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square44x44_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square71x71_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square150x150_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square310x310_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/wide310x150_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/splash_screen", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant()));
- return OK;
-}
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "tiles/show_name_on_square150x150"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "tiles/show_name_on_wide310x150"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "tiles/show_name_on_square310x310"), false));
-bool EditorExportPlatformUWP::_should_compress_asset(const String & p_path, const Vector<uint8_t>& p_data) {
-
- /* TODO: This was copied verbatim from Android export. It should be
- * refactored to the parent class and also be used for .zip export.
- */
-
- /*
- * By not compressing files with little or not benefit in doing so,
- * a performance gain is expected at runtime. Moreover, if the APK is
- * zip-aligned, assets stored as they are can be efficiently read by
- * Android by memory-mapping them.
- */
-
- // -- Unconditional uncompress to mimic AAPT plus some other
-
- static const char* unconditional_compress_ext[] = {
- // From https://github.com/android/platform_frameworks_base/blob/master/tools/aapt/Package.cpp
- // These formats are already compressed, or don't compress well:
- ".jpg", ".jpeg", ".png", ".gif",
- ".wav", ".mp2", ".mp3", ".ogg", ".aac",
- ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet",
- ".rtttl", ".imy", ".xmf", ".mp4", ".m4a",
- ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2",
- ".amr", ".awb", ".wma", ".wmv",
- // Godot-specific:
- ".webp", // Same reasoning as .png
- ".cfb", // Don't let small config files slow-down startup
- // Trailer for easier processing
- NULL
- };
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/debug", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
- for (const char** ext = unconditional_compress_ext; *ext; ++ext) {
- if (p_path.to_lower().ends_with(String(*ext))) {
- return false;
+ // Capabilites
+ const char **basic = uwp_capabilities;
+ while (*basic) {
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*basic).camelcase_to_underscore(false)), false));
+ basic++;
}
- }
- // -- Compressed resource?
+ const char **uap = uwp_uap_capabilities;
+ while (*uap) {
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*uap).camelcase_to_underscore(false)), false));
+ uap++;
+ }
- if (p_data.size() >= 4 && p_data[0] == 'R' && p_data[1] == 'S' && p_data[2] == 'C' && p_data[3] == 'C') {
- // Already compressed
- return false;
+ const char **device = uwp_device_capabilites;
+ while (*device) {
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*device).camelcase_to_underscore(false)), false));
+ device++;
+ }
}
- // --- TODO: Decide on texture resources according to their image compression setting
-
- return true;
-}
-
-bool EditorExportPlatformUWP::_set(const StringName& p_name, const Variant& p_value) {
-
- String n = p_name;
-
- if (n == "architecture/target")
- arch = (Platform)((int)p_value);
- else if (n == "custom_package/debug")
- custom_debug_package = p_value;
- else if (n == "custom_package/release")
- custom_release_package = p_value;
- else if (n == "command_line/extra_args")
- cmdline = p_value;
- else if (n == "package/display_name")
- display_name = p_value;
- else if (n == "package/short_name")
- short_name = p_value;
- else if (n == "package/unique_name")
- unique_name = p_value;
- else if (n == "package/description")
- description = p_value;
- else if (n == "package/publisher")
- publisher = p_value;
- else if (n == "package/publisher_display_name")
- publisher_display_name = p_value;
- else if (n == "identity/product_guid")
- product_guid = p_value;
- else if (n == "identity/publisher_guid")
- publisher_guid = p_value;
- else if (n == "version/major")
- version_major = p_value;
- else if (n == "version/minor")
- version_minor = p_value;
- else if (n == "version/build")
- version_build = p_value;
- else if (n == "version/revision")
- version_revision = p_value;
- else if (n == "orientation/landscape")
- orientation_landscape = p_value;
- else if (n == "orientation/portrait")
- orientation_portrait = p_value;
- else if (n == "orientation/landscape_flipped")
- orientation_landscape_flipped = p_value;
- else if (n == "orientation/portrait_flipped")
- orientation_portrait_flipped = p_value;
- else if (n == "images/background_color")
- background_color = p_value;
- else if (n == "images/store_logo")
- store_logo = p_value;
- else if (n == "images/square44x44_logo")
- square44 = p_value;
- else if (n == "images/square71x71_logo")
- square71 = p_value;
- else if (n == "images/square150x150_logo")
- square150 = p_value;
- else if (n == "images/square310x310_logo")
- square310 = p_value;
- else if (n == "images/wide310x150_logo")
- wide310 = p_value;
- else if (n == "images/splash_screen")
- splash = p_value;
- else if (n == "tiles/show_name_on_square150x150")
- name_on_square150 = p_value;
- else if (n == "tiles/show_name_on_wide310x150")
- name_on_wide = p_value;
- else if (n == "tiles/show_name_on_square310x310")
- name_on_square310 = p_value;
-
-#if 0 // Signing disabled
- else if (n == "signing/sign")
- sign_package = p_value;
- else if (n == "signing/certificate_file")
- certificate_path = p_value;
- else if (n == "signing/certificate_password")
- certificate_pass = p_value;
-#endif
- else if (n.begins_with("capabilities/")) {
-
- String what = n.get_slice("/", 1).replace("_", "");
- bool enable = p_value;
-
- if (array_has(uwp_capabilities, what.utf8().get_data())) {
-
- if (enable)
- capabilities.insert(what);
- else
- capabilities.erase(what);
-
- } else if (array_has(uwp_uap_capabilities, what.utf8().get_data())) {
-
- if (enable)
- uap_capabilities.insert(what);
- else
- uap_capabilities.erase(what);
-
- } else if (array_has(uwp_device_capabilites, what.utf8().get_data())) {
-
- if (enable)
- device_capabilities.insert(what);
- else
- device_capabilities.erase(what);
+ virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
+ String err;
+ bool valid = true;
+ Platform arch = (Platform)(int)(p_preset->get("architecture/target"));
+
+ String custom_debug_binary = p_preset->get("custom_template/debug");
+ String custom_release_binary = p_preset->get("custom_template/release");
+
+ String platform_infix;
+
+ switch (arch) {
+ case EditorExportUWP::ARM: {
+ platform_infix = "arm";
+ } break;
+ case EditorExportUWP::X86: {
+ platform_infix = "x86";
+ } break;
+ case EditorExportUWP::X64: {
+ platform_infix = "x64";
+ } break;
}
- } else return false;
-
- return true;
-}
-bool EditorExportPlatformUWP::_get(const StringName& p_name, Variant &r_ret) const {
-
- String n = p_name;
-
- if (n == "architecture/target")
- r_ret = (int)arch;
- else if (n == "custom_package/debug")
- r_ret = custom_debug_package;
- else if (n == "custom_package/release")
- r_ret = custom_release_package;
- else if (n == "command_line/extra_args")
- r_ret = cmdline;
- else if (n == "package/display_name")
- r_ret = display_name;
- else if (n == "package/short_name")
- r_ret = short_name;
- else if (n == "package/unique_name")
- r_ret = unique_name;
- else if (n == "package/description")
- r_ret = description;
- else if (n == "package/publisher")
- r_ret = publisher;
- else if (n == "package/publisher_display_name")
- r_ret = publisher_display_name;
- else if (n == "identity/product_guid")
- r_ret = product_guid;
- else if (n == "identity/publisher_guid")
- r_ret = publisher_guid;
- else if (n == "version/major")
- r_ret = version_major;
- else if (n == "version/minor")
- r_ret = version_minor;
- else if (n == "version/build")
- r_ret = version_build;
- else if (n == "version/revision")
- r_ret = version_revision;
- else if (n == "orientation/landscape")
- r_ret = orientation_landscape;
- else if (n == "orientation/portrait")
- r_ret = orientation_portrait;
- else if (n == "orientation/landscape_flipped")
- r_ret = orientation_landscape_flipped;
- else if (n == "orientation/portrait_flipped")
- r_ret = orientation_portrait_flipped;
- else if (n == "images/background_color")
- r_ret = background_color;
- else if (n == "images/store_logo")
- r_ret = store_logo;
- else if (n == "images/square44x44_logo")
- r_ret = square44;
- else if (n == "images/square71x71_logo")
- r_ret = square71;
- else if (n == "images/square150x150_logo")
- r_ret = square150;
- else if (n == "images/square310x310_logo")
- r_ret = square310;
- else if (n == "images/wide310x150_logo")
- r_ret = wide310;
- else if (n == "images/splash_screen")
- r_ret = splash;
- else if (n == "tiles/show_name_on_square150x150")
- r_ret = name_on_square150;
- else if (n == "tiles/show_name_on_wide310x150")
- r_ret = name_on_wide;
- else if (n == "tiles/show_name_on_square310x310")
- r_ret = name_on_square310;
-
-#if 0 // Signing disabled
- else if (n == "signing/sign")
- r_ret = sign_package;
- else if (n == "signing/certificate_file")
- r_ret = certificate_path;
- else if (n == "signing/certificate_password")
- r_ret = certificate_pass;
-#endif
- else if (n.begins_with("capabilities/")) {
-
- String what = n.get_slice("/", 1).replace("_", "");
-
- if (array_has(uwp_capabilities, what.utf8().get_data())) {
-
- r_ret = capabilities.has(what);
-
- } else if (array_has(uwp_uap_capabilities, what.utf8().get_data())) {
-
- r_ret = uap_capabilities.has(what);
-
- } else if (array_has(uwp_device_capabilites, what.utf8().get_data())) {
-
- r_ret = device_capabilities.has(what);
+ if (!exists_export_template("uwp_" + platform_infix + "_debug.zip", &err) || !exists_export_template("uwp_" + platform_infix + "_debug.zip", &err)) {
+ valid = false;
+ r_missing_templates = true;
}
- } else return false;
-
- return true;
-}
-
-void EditorExportPlatformUWP::_get_property_list(List<PropertyInfo>* p_list) const {
-
- p_list->push_back(PropertyInfo(Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE, "appx"));
- p_list->push_back(PropertyInfo(Variant::STRING, "custom_package/release", PROPERTY_HINT_GLOBAL_FILE, "appx"));
-
- p_list->push_back(PropertyInfo(Variant::INT, "architecture/target", PROPERTY_HINT_ENUM, "ARM,x86,x64"));
-
- p_list->push_back(PropertyInfo(Variant::STRING, "command_line/extra_args"));
-
- p_list->push_back(PropertyInfo(Variant::STRING, "package/display_name"));
- p_list->push_back(PropertyInfo(Variant::STRING, "package/short_name"));
- p_list->push_back(PropertyInfo(Variant::STRING, "package/unique_name"));
- p_list->push_back(PropertyInfo(Variant::STRING, "package/description"));
- p_list->push_back(PropertyInfo(Variant::STRING, "package/publisher"));
- p_list->push_back(PropertyInfo(Variant::STRING, "package/publisher_display_name"));
-
- p_list->push_back(PropertyInfo(Variant::STRING, "identity/product_guid"));
- p_list->push_back(PropertyInfo(Variant::STRING, "identity/publisher_guid"));
-
- p_list->push_back(PropertyInfo(Variant::INT, "version/major"));
- p_list->push_back(PropertyInfo(Variant::INT, "version/minor"));
- p_list->push_back(PropertyInfo(Variant::INT, "version/build"));
- p_list->push_back(PropertyInfo(Variant::INT, "version/revision"));
-
- p_list->push_back(PropertyInfo(Variant::BOOL, "orientation/landscape"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "orientation/portrait"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "orientation/landscape_flipped"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "orientation/portrait_flipped"));
-
- p_list->push_back(PropertyInfo(Variant::STRING, "images/background_color"));
- p_list->push_back(PropertyInfo(Variant::OBJECT, "images/store_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture"));
- p_list->push_back(PropertyInfo(Variant::OBJECT, "images/square44x44_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture"));
- p_list->push_back(PropertyInfo(Variant::OBJECT, "images/square71x71_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture"));
- p_list->push_back(PropertyInfo(Variant::OBJECT, "images/square150x150_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture"));
- p_list->push_back(PropertyInfo(Variant::OBJECT, "images/square310x310_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture"));
- p_list->push_back(PropertyInfo(Variant::OBJECT, "images/wide310x150_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture"));
- p_list->push_back(PropertyInfo(Variant::OBJECT, "images/splash_screen", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture"));
-
- p_list->push_back(PropertyInfo(Variant::BOOL, "tiles/show_name_on_square150x150"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "tiles/show_name_on_wide310x150"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "tiles/show_name_on_square310x310"));
-
-#if 0 // Signing does not work :( disabling for now
- p_list->push_back(PropertyInfo(Variant::BOOL, "signing/sign"));
- p_list->push_back(PropertyInfo(Variant::STRING, "signing/certificate_file", PROPERTY_HINT_GLOBAL_FILE, "pfx"));
- p_list->push_back(PropertyInfo(Variant::STRING, "signing/certificate_password"));
-#endif
-
- // Capabilites
- const char **basic = uwp_capabilities;
- while (*basic) {
- p_list->push_back(PropertyInfo(Variant::BOOL, "capabilities/" + String(*basic).camelcase_to_underscore(false)));
- basic++;
- }
-
- const char **uap = uwp_uap_capabilities;
- while (*uap) {
- p_list->push_back(PropertyInfo(Variant::BOOL, "capabilities/" + String(*uap).camelcase_to_underscore(false)));
- uap++;
- }
- const char **device = uwp_device_capabilites;
- while (*device) {
- p_list->push_back(PropertyInfo(Variant::BOOL, "capabilities/" + String(*device).camelcase_to_underscore(false)));
- device++;
- }
+ if (!valid && custom_debug_binary == "" && custom_release_binary == "") {
+ if (!err.empty()) {
+ r_error = err;
+ }
+ return valid;
+ }
-}
+ bool dvalid = true;
+ bool rvalid = true;
-bool EditorExportPlatformUWP::can_export(String * r_error) const {
+ if (!FileAccess::exists(custom_debug_binary)) {
+ dvalid = false;
+ err = "\nCustom debug binary not found.";
+ }
- String err;
- bool valid = true;
+ if (!FileAccess::exists(custom_release_binary)) {
+ rvalid = false;
+ err += "\nCustom release binary not found.";
+ }
- if (!exists_export_template("uwp_x86_debug.zip") || !exists_export_template("uwp_x86_release.zip")
- || !exists_export_template("uwp_arm_debug.zip") || !exists_export_template("uwp_arm_release.zip")
- || !exists_export_template("uwp_x64_debug.zip") || !exists_export_template("uwp_x64_release.zip")) {
- valid = false;
- err += TTR("No export templates found.\nDownload and install export templates.") + "\n";
- }
+ if (dvalid || rvalid)
+ valid = true;
- if (custom_debug_package != "" && !FileAccess::exists(custom_debug_package)) {
- valid = false;
- err += TTR("Custom debug package not found.") + "\n";
- }
+ if (!valid) {
+ r_error = err;
+ return valid;
+ }
- if (custom_release_package != "" && !FileAccess::exists(custom_release_package)) {
- valid = false;
- err += TTR("Custom release package not found.") + "\n";
- }
+ if (!_valid_resource_name(p_preset->get("package/unique_name"))) {
+ valid = false;
+ err += "\nInvalid unique name.";
+ }
- if (!_valid_resource_name(unique_name)) {
- valid = false;
- err += TTR("Invalid unique name.") + "\n";
- }
+ if (!_valid_guid(p_preset->get("identity/product_guid"))) {
+ valid = false;
+ err += "\nInvalid product GUID.";
+ }
- if (!_valid_guid(product_guid)) {
- valid = false;
- err += TTR("Invalid product GUID.") + "\n";
- }
+ if (!_valid_guid(p_preset->get("identity/publisher_guid"))) {
+ valid = false;
+ err += "\nInvalid publisher GUID.";
+ }
- if (!_valid_guid(publisher_guid)) {
- valid = false;
- err += TTR("Invalid publisher GUID.") + "\n";
- }
+ if (!_valid_bgcolor(p_preset->get("images/background_color"))) {
+ valid = false;
+ err += "\nInvalid background color.";
+ }
- if (!_valid_bgcolor(background_color)) {
- valid = false;
- err += TTR("Invalid background color.") + "\n";
- }
+ if (!p_preset->get("images/store_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/store_logo"))->cast_to<StreamTexture>(), 50, 50)) {
+ valid = false;
+ err += "\nInvalid Store Logo image dimensions (should be 50x50).";
+ }
- if (store_logo.is_valid() && !_valid_image(store_logo, 50, 50)) {
- valid = false;
- err += TTR("Invalid Store Logo image dimensions (should be 50x50).") + "\n";
- }
+ if (!p_preset->get("images/square44x44_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/square44x44_logo"))->cast_to<StreamTexture>(), 44, 44)) {
+ valid = false;
+ err += "\nInvalid square 44x44 logo image dimensions (should be 44x44).";
+ }
- if (square44.is_valid() && !_valid_image(square44, 44, 44)) {
- valid = false;
- err += TTR("Invalid square 44x44 logo image dimensions (should be 44x44).") + "\n";
- }
+ if (!p_preset->get("images/square71x71_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/square71x71_logo"))->cast_to<StreamTexture>(), 71, 71)) {
+ valid = false;
+ err += "\nInvalid square 71x71 logo image dimensions (should be 71x71).";
+ }
- if (square71.is_valid() && !_valid_image(square71, 71, 71)) {
- valid = false;
- err += TTR("Invalid square 71x71 logo image dimensions (should be 71x71).") + "\n";
- }
+ if (!p_preset->get("images/square150x150_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/square150x150_logo"))->cast_to<StreamTexture>(), 150, 0)) {
+ valid = false;
+ err += "\nInvalid square 150x150 logo image dimensions (should be 150x150).";
+ }
- if (square150.is_valid() && !_valid_image(square150, 150, 150)) {
- valid = false;
- err += TTR("Invalid square 150x150 logo image dimensions (should be 150x150).") + "\n";
- }
+ if (!p_preset->get("images/square310x310_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/square310x310_logo"))->cast_to<StreamTexture>(), 310, 310)) {
+ valid = false;
+ err += "\nInvalid square 310x310 logo image dimensions (should be 310x310).";
+ }
- if (square310.is_valid() && !_valid_image(square310, 310, 310)) {
- valid = false;
- err += TTR("Invalid square 310x310 logo image dimensions (should be 310x310).") + "\n";
- }
+ if (!p_preset->get("images/wide310x150_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/wide310x150_logo"))->cast_to<StreamTexture>(), 310, 150)) {
+ valid = false;
+ err += "\nInvalid wide 310x150 logo image dimensions (should be 310x150).";
+ }
- if (wide310.is_valid() && !_valid_image(wide310, 310, 150)) {
- valid = false;
- err += TTR("Invalid wide 310x150 logo image dimensions (should be 310x150).") + "\n";
- }
+ if (!p_preset->get("images/splash_screen").is_zero() && !_valid_image(((Object *)p_preset->get("images/splash_screen"))->cast_to<StreamTexture>(), 620, 300)) {
+ valid = false;
+ err += "\nInvalid splash screen image dimensions (should be 620x300).";
+ }
- if (splash.is_valid() && !_valid_image(splash, 620, 300)) {
- valid = false;
- err += TTR("Invalid splash screen image dimensions (should be 620x300).") + "\n";
+ r_error = err;
+ return valid;
}
- if (r_error)
- *r_error = err;
+ virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) {
- return valid;
-}
+ String src_appx;
-Error EditorExportPlatformUWP::export_project(const String & p_path, bool p_debug, int p_flags) {
+ EditorProgress ep("export", "Exporting for Windows Universal", 7);
- String src_appx;
+ if (p_debug)
+ src_appx = p_preset->get("custom_template/debug");
+ else
+ src_appx = p_preset->get("custom_template/release");
- EditorProgress ep("export", "Exporting for Windows Universal", 7);
+ src_appx = src_appx.strip_edges();
- if (is_debug)
- src_appx = custom_debug_package;
- else
- src_appx = custom_release_package;
+ Platform arch = (Platform)(int)p_preset->get("architecture/target");
- if (src_appx == "") {
- String err;
- if (p_debug) {
+ if (src_appx == "") {
+ String err, infix;
switch (arch) {
- case X86: {
- src_appx = find_export_template("uwp_x86_debug.zip", &err);
- break;
- }
- case X64: {
- src_appx = find_export_template("uwp_x64_debug.zip", &err);
- break;
- }
case ARM: {
- src_appx = find_export_template("uwp_arm_debug.zip", &err);
- break;
- }
- }
- } else {
- switch (arch) {
+ infix = "_arm_";
+ } break;
case X86: {
- src_appx = find_export_template("uwp_x86_release.zip", &err);
- break;
- }
+ infix = "_x86_";
+ } break;
case X64: {
- src_appx = find_export_template("uwp_x64_release.zip", &err);
- break;
- }
- case ARM: {
- src_appx = find_export_template("uwp_arm_release.zip", &err);
- break;
- }
+ infix = "_x64_";
+ } break;
+ }
+ if (p_debug) {
+ src_appx = find_export_template("uwp" + infix + "debug.zip", &err);
+ } else {
+ src_appx = find_export_template("uwp" + infix + "release.zip", &err);
+ }
+ if (src_appx == "") {
+ EditorNode::add_io_error(err);
+ return ERR_FILE_NOT_FOUND;
}
}
- if (src_appx == "") {
- EditorNode::add_io_error(err);
- return ERR_FILE_NOT_FOUND;
- }
- }
- Error err = OK;
+ Error err = OK;
- FileAccess *fa_pack = FileAccess::open(p_path, FileAccess::WRITE, &err);
- ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE);
+ FileAccess *fa_pack = FileAccess::open(p_path, FileAccess::WRITE, &err);
+ ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE);
- AppxPackager packager;
- packager.init(fa_pack, sign_package ? AppxPackager::SIGN : AppxPackager::DONT_SIGN, certificate_path, certificate_pass);
+ AppxPackager packager;
+ packager.init(fa_pack);
- FileAccess *src_f = NULL;
- zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
+ FileAccess *src_f = NULL;
+ zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
- ep.step("Creating package...", 0);
+ ep.step("Creating package...", 0);
- unzFile pkg = unzOpen2(src_appx.utf8().get_data(), &io);
+ unzFile pkg = unzOpen2(src_appx.utf8().get_data(), &io);
- if (!pkg) {
+ if (!pkg) {
- EditorNode::add_io_error("Could not find template appx to export:\n" + src_appx);
- return ERR_FILE_NOT_FOUND;
- }
-
- int ret = unzGoToFirstFile(pkg);
-
- ep.step("Copying template files...", 1);
-
- EditorNode::progress_add_task("template_files", "Template files", 100);
- packager.set_progress_task("template_files");
-
- int template_files_amount = 9;
- int template_file_no = 1;
-
- while (ret == UNZ_OK) {
-
- // get file name
- unz_file_info info;
- char fname[16834];
- ret = unzGetCurrentFileInfo(pkg, &info, fname, 16834, NULL, 0, NULL, 0);
-
- String path = fname;
-
- if (path.ends_with("/")) {
- // Ignore directories
- ret = unzGoToNextFile(pkg);
- continue;
+ EditorNode::add_io_error("Could not find template appx to export:\n" + src_appx);
+ return ERR_FILE_NOT_FOUND;
}
- Vector<uint8_t> data;
- bool do_read = true;
-
- if (path.begins_with("Assets/")) {
+ int ret = unzGoToFirstFile(pkg);
- path = path.replace(".scale-100", "");
+ ep.step("Copying template files...", 1);
- data = _get_image_data(path);
- if (data.size() > 0) do_read = false;
- }
+ EditorNode::progress_add_task("template_files", "Template files", 100);
+ packager.set_progress_task("template_files");
- //read
- if (do_read) {
- data.resize(info.uncompressed_size);
- unzOpenCurrentFile(pkg);
- unzReadCurrentFile(pkg, data.ptr(), data.size());
- unzCloseCurrentFile(pkg);
- }
+ int template_files_amount = 9;
+ int template_file_no = 1;
- if (path == "AppxManifest.xml") {
+ while (ret == UNZ_OK) {
- data = _fix_manifest(data, p_flags&(EXPORT_DUMB_CLIENT | EXPORT_REMOTE_DEBUG));
- }
+ // get file name
+ unz_file_info info;
+ char fname[16834];
+ ret = unzGetCurrentFileInfo(pkg, &info, fname, 16834, NULL, 0, NULL, 0);
- print_line("ADDING: " + path);
+ String path = fname;
- packager.add_file(path, data.ptr(), data.size(), template_file_no++, template_files_amount, _should_compress_asset(path, data));
+ if (path.ends_with("/")) {
+ // Ignore directories
+ ret = unzGoToNextFile(pkg);
+ continue;
+ }
- ret = unzGoToNextFile(pkg);
- }
+ Vector<uint8_t> data;
+ bool do_read = true;
- EditorNode::progress_end_task("template_files");
+ if (path.begins_with("Assets/")) {
- ep.step("Creating command line...", 2);
+ path = path.replace(".scale-100", "");
- Vector<String> cl = cmdline.strip_edges().split(" ");
- for (int i = 0;i<cl.size();i++) {
- if (cl[i].strip_edges().length() == 0) {
- cl.remove(i);
- i--;
- }
- }
-
- if (!(p_flags & EXPORT_DUMB_CLIENT)) {
- cl.push_back("-path");
- cl.push_back("game");
- }
+ data = _get_image_data(p_preset, path);
+ if (data.size() > 0) do_read = false;
+ }
- gen_export_flags(cl, p_flags);
+ //read
+ if (do_read) {
+ data.resize(info.uncompressed_size);
+ unzOpenCurrentFile(pkg);
+ unzReadCurrentFile(pkg, data.ptr(), data.size());
+ unzCloseCurrentFile(pkg);
+ }
- // Command line file
- Vector<uint8_t> clf;
+ if (path == "AppxManifest.xml") {
- // Argc
- clf.resize(4);
- encode_uint32(cl.size(), clf.ptr());
+ data = _fix_manifest(p_preset, data, p_flags & (DEBUG_FLAG_DUMB_CLIENT | DEBUG_FLAG_REMOTE_DEBUG));
+ }
- for (int i = 0; i < cl.size(); i++) {
+ print_line("ADDING: " + path);
- CharString txt = cl[i].utf8();
- int base = clf.size();
- clf.resize(base + 4 + txt.length());
- encode_uint32(txt.length(), &clf[base]);
- copymem(&clf[base + 4], txt.ptr(), txt.length());
- print_line(itos(i) + " param: " + cl[i]);
- }
+ packager.add_file(path, data.ptr(), data.size(), template_file_no++, template_files_amount, _should_compress_asset(path, data));
- packager.add_file("__cl__.cl", clf.ptr(), clf.size(), -1, -1, false);
+ ret = unzGoToNextFile(pkg);
+ }
- ep.step("Adding project files...", 3);
+ EditorNode::progress_end_task("template_files");
- EditorNode::progress_add_task("project_files", "Project Files", 100);
- packager.set_progress_task("project_files");
+ ep.step("Creating command line...", 2);
- err = export_project_files(save_appx_file, &packager, false);
+ Vector<String> cl = ((String)p_preset->get("command_line/extra_args")).strip_edges().split(" ");
+ for (int i = 0; i < cl.size(); i++) {
+ if (cl[i].strip_edges().length() == 0) {
+ cl.remove(i);
+ i--;
+ }
+ }
- EditorNode::progress_end_task("project_files");
+ if (!(p_flags & DEBUG_FLAG_DUMB_CLIENT)) {
+ cl.push_back("-path");
+ cl.push_back("game");
+ }
- ep.step("Closing package...", 7);
+ gen_export_flags(cl, p_flags);
- unzClose(pkg);
+ // Command line file
+ Vector<uint8_t> clf;
- packager.finish();
+ // Argc
+ clf.resize(4);
+ encode_uint32(cl.size(), clf.ptr());
- return OK;
-}
+ for (int i = 0; i < cl.size(); i++) {
-EditorExportPlatformUWP::EditorExportPlatformUWP() {
+ CharString txt = cl[i].utf8();
+ int base = clf.size();
+ clf.resize(base + 4 + txt.length());
+ encode_uint32(txt.length(), &clf[base]);
+ copymem(&clf[base + 4], txt.ptr(), txt.length());
+ print_line(itos(i) + " param: " + cl[i]);
+ }
- Image img(_uwp_logo);
- logo = Ref<ImageTexture>(memnew(ImageTexture));
- logo->create_from_image(img);
+ packager.add_file("__cl__.cl", clf.ptr(), clf.size(), -1, -1, false);
- is_debug = true;
+ ep.step("Adding project files...", 3);
- custom_release_package = "";
- custom_debug_package = "";
+ EditorNode::progress_add_task("project_files", "Project Files", 100);
+ packager.set_progress_task("project_files");
- arch = X86;
+ err = export_project_files(p_preset, save_appx_file, &packager);
- display_name = "";
- short_name = "Godot";
- unique_name = "Godot.Engine";
- description = "Godot Engine";
- publisher = "CN=GodotEngine";
- publisher_display_name = "Godot Engine";
+ EditorNode::progress_end_task("project_files");
- product_guid = "00000000-0000-0000-0000-000000000000";
- publisher_guid = "00000000-0000-0000-0000-000000000000";
+ ep.step("Closing package...", 7);
- version_major = 1;
- version_minor = 0;
- version_build = 0;
- version_revision = 0;
+ unzClose(pkg);
- orientation_landscape = true;
- orientation_portrait = true;
- orientation_landscape_flipped = true;
- orientation_portrait_flipped = true;
+ packager.finish();
- background_color = "transparent";
+ return OK;
+ }
- name_on_square150 = false;
- name_on_square310 = false;
- name_on_wide = false;
+ virtual void get_platform_features(List<String> *r_features) {
- sign_package = false;
- certificate_path = "";
- certificate_pass = "";
-}
+ r_features->push_back("pc");
+ r_features->push_back("UWP");
+ }
-EditorExportPlatformUWP::~EditorExportPlatformUWP() {}
+ EditorExportUWP() {
+ Ref<Image> img = memnew(Image(_uwp_logo));
+ logo.instance();
+ logo->create_from_image(img);
+ }
+};
-#endif
void register_uwp_exporter() {
-#if 0
- Ref<EditorExportPlatformUWP> exporter = Ref<EditorExportPlatformUWP>(memnew(EditorExportPlatformUWP));
- EditorImportExport::get_singleton()->add_export_platform(exporter);
-#endif
+ Ref<EditorExportUWP> exporter = Ref<EditorExportUWP>(memnew(EditorExportUWP));
+ EditorExport::get_singleton()->add_export_platform(exporter);
}
diff --git a/platform/uwp/export/export.h b/platform/uwp/export/export.h
index 2d6e02bb10..81bd848241 100644
--- a/platform/uwp/export/export.h
+++ b/platform/uwp/export/export.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/uwp/gl_context_egl.cpp b/platform/uwp/gl_context_egl.cpp
index 6c9efc26b4..57c4c5d572 100644
--- a/platform/uwp/gl_context_egl.cpp
+++ b/platform/uwp/gl_context_egl.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -96,7 +97,7 @@ Error ContextEGL::initialize() {
EGLContext context = EGL_NO_CONTEXT;
EGLSurface surface = EGL_NO_SURFACE;
EGLConfig config = nullptr;
- EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE, EGL_NONE };
+ EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE, EGL_NONE };
try {
diff --git a/platform/uwp/gl_context_egl.h b/platform/uwp/gl_context_egl.h
index c397c1206b..908b8dceec 100644
--- a/platform/uwp/gl_context_egl.h
+++ b/platform/uwp/gl_context_egl.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/uwp/joypad_uwp.cpp b/platform/uwp/joypad_uwp.cpp
index dd57ed94ae..f3d4eb99c8 100644
--- a/platform/uwp/joypad_uwp.cpp
+++ b/platform/uwp/joypad_uwp.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,6 +29,7 @@
/*************************************************************************/
#include "joypad_uwp.h"
+#include "core/os/os.h"
using namespace Windows::Gaming::Input;
using namespace Windows::Foundation;
@@ -40,38 +42,53 @@ void JoypadUWP::register_events() {
ref new EventHandler<Gamepad ^>(this, &JoypadUWP::OnGamepadRemoved);
}
-uint32_t JoypadUWP::process_controllers(uint32_t p_last_id) {
+void JoypadUWP::process_controllers() {
for (int i = 0; i < MAX_CONTROLLERS; i++) {
- if (!controllers[i].connected) break;
+ ControllerDevice &joy = controllers[i];
- switch (controllers[i].type) {
+ if (!joy.connected) break;
+
+ switch (joy.type) {
case ControllerType::GAMEPAD_CONTROLLER: {
- GamepadReading reading = ((Gamepad ^)controllers[i].controller_reference)->GetCurrentReading();
+ GamepadReading reading = ((Gamepad ^) joy.controller_reference)->GetCurrentReading();
int button_mask = (int)GamepadButtons::Menu;
for (int j = 0; j < 14; j++) {
- p_last_id = input->joy_button(p_last_id, controllers[i].id, j, (int)reading.Buttons & button_mask);
+ input->joy_button(joy.id, j, (int)reading.Buttons & button_mask);
button_mask *= 2;
}
- p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_0, axis_correct(reading.LeftThumbstickX));
- p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_1, axis_correct(reading.LeftThumbstickY, true));
- p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_2, axis_correct(reading.RightThumbstickX));
- p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_3, axis_correct(reading.RightThumbstickY, true));
- p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_4, axis_correct(reading.LeftTrigger, false, true));
- p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_5, axis_correct(reading.RightTrigger, false, true));
+ input->joy_axis(joy.id, JOY_AXIS_0, axis_correct(reading.LeftThumbstickX));
+ input->joy_axis(joy.id, JOY_AXIS_1, axis_correct(reading.LeftThumbstickY, true));
+ input->joy_axis(joy.id, JOY_AXIS_2, axis_correct(reading.RightThumbstickX));
+ input->joy_axis(joy.id, JOY_AXIS_3, axis_correct(reading.RightThumbstickY, true));
+ input->joy_axis(joy.id, JOY_AXIS_4, axis_correct(reading.LeftTrigger, false, true));
+ input->joy_axis(joy.id, JOY_AXIS_5, axis_correct(reading.RightTrigger, false, true));
+
+ uint64_t timestamp = input->get_joy_vibration_timestamp(joy.id);
+ if (timestamp > joy.ff_timestamp) {
+ Vector2 strength = input->get_joy_vibration_strength(joy.id);
+ float duration = input->get_joy_vibration_duration(joy.id);
+ if (strength.x == 0 && strength.y == 0) {
+ joypad_vibration_stop(i, timestamp);
+ } else {
+ joypad_vibration_start(i, strength.x, strength.y, duration, timestamp);
+ }
+ } else if (joy.vibrating && joy.ff_end_timestamp != 0) {
+ uint64_t current_time = OS::get_singleton()->get_ticks_usec();
+ if (current_time >= joy.ff_end_timestamp)
+ joypad_vibration_stop(i, current_time);
+ }
break;
}
}
}
-
- return p_last_id;
}
JoypadUWP::JoypadUWP() {
@@ -123,15 +140,7 @@ void JoypadUWP::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Inp
ERR_FAIL_COND(idx == -1);
- for (int i = idx + 1; i < MAX_CONTROLLERS - 1; i++) {
-
- if (!controllers[i].connected) {
- break;
- }
-
- controllers[i - 1] = controllers[i];
- }
- controllers[MAX_CONTROLLERS - 1] = ControllerDevice();
+ controllers[idx] = ControllerDevice();
input->joy_connection_changed(idx, false, "Xbox Controller");
}
@@ -145,3 +154,30 @@ InputDefault::JoyAxis JoypadUWP::axis_correct(double p_val, bool p_negate, bool
return jx;
}
+
+void JoypadUWP::joypad_vibration_start(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp) {
+ ControllerDevice &joy = controllers[p_device];
+ if (joy.connected) {
+ GamepadVibration vibration;
+ vibration.LeftMotor = p_strong_magnitude;
+ vibration.RightMotor = p_weak_magnitude;
+ ((Gamepad ^) joy.controller_reference)->Vibration = vibration;
+
+ joy.ff_timestamp = p_timestamp;
+ joy.ff_end_timestamp = p_duration == 0 ? 0 : p_timestamp + (uint64_t)(p_duration * 1000000.0);
+ joy.vibrating = true;
+ }
+}
+
+void JoypadUWP::joypad_vibration_stop(int p_device, uint64_t p_timestamp) {
+ ControllerDevice &joy = controllers[p_device];
+ if (joy.connected) {
+ GamepadVibration vibration;
+ vibration.LeftMotor = 0.0;
+ vibration.RightMotor = 0.0;
+ ((Gamepad ^) joy.controller_reference)->Vibration = vibration;
+
+ joy.ff_timestamp = p_timestamp;
+ joy.vibrating = false;
+ }
+}
diff --git a/platform/uwp/joypad_uwp.h b/platform/uwp/joypad_uwp.h
index e5a961e70e..c55e1e7ab7 100644
--- a/platform/uwp/joypad_uwp.h
+++ b/platform/uwp/joypad_uwp.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,7 +38,7 @@ ref class JoypadUWP sealed {
/* clang-format off */
internal:
void register_events();
- uint32_t process_controllers(uint32_t p_last_id);
+ void process_controllers();
/* clang-format on */
JoypadUWP();
@@ -61,11 +62,17 @@ private:
int id;
bool connected;
ControllerType type;
+ float ff_timestamp;
+ float ff_end_timestamp;
+ bool vibrating;
ControllerDevice() {
id = -1;
connected = false;
type = ControllerType::GAMEPAD_CONTROLLER;
+ ff_timestamp = 0.0f;
+ ff_end_timestamp = 0.0f;
+ vibrating = false;
}
};
@@ -77,6 +84,8 @@ private:
void OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value);
InputDefault::JoyAxis axis_correct(double p_val, bool p_negate = false, bool p_trigger = false) const;
+ void joypad_vibration_start(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp);
+ void joypad_vibration_stop(int p_device, uint64_t p_timestamp);
};
#endif
diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp
index 19ed2b57a3..fabb227bf5 100644
--- a/platform/uwp/os_uwp.cpp
+++ b/platform/uwp/os_uwp.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,24 +28,22 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "os_uwp.h"
-#include "drivers/gles2/rasterizer_gles2.h"
+#include "drivers/gles3/rasterizer_gles3.h"
+#include "drivers/unix/ip_unix.h"
#include "drivers/windows/dir_access_windows.h"
#include "drivers/windows/file_access_windows.h"
#include "drivers/windows/mutex_windows.h"
+#include "drivers/windows/rw_lock_windows.h"
#include "drivers/windows/semaphore_windows.h"
-#include "main/main.h"
-#include "os/memory_pool_dynamic_static.h"
-#include "servers/audio_server.h"
-#include "servers/visual/visual_server_raster.h"
-#include "thread_uwp.h"
-//#include "servers/visual/visual_server_wrap_mt.h"
-#include "drivers/unix/ip_unix.h"
-#include "global_config.h"
#include "io/marshalls.h"
-#include "os/memory_pool_dynamic_prealloc.h"
+#include "main/main.h"
#include "platform/windows/packet_peer_udp_winsock.h"
#include "platform/windows/stream_peer_winsock.h"
#include "platform/windows/tcp_server_winsock.h"
+#include "project_settings.h"
+#include "servers/audio_server.h"
+#include "servers/visual/visual_server_raster.h"
+#include "thread_uwp.h"
#include <ppltasks.h>
#include <wrl.h>
@@ -148,9 +147,6 @@ const char *OSUWP::get_audio_driver_name(int p_driver) const {
return AudioDriverManager::get_driver(p_driver)->get_name();
}
-static MemoryPoolStatic *mempool_static = NULL;
-static MemoryPoolDynamic *mempool_dynamic = NULL;
-
void OSUWP::initialize_core() {
last_button_state = 0;
@@ -160,32 +156,19 @@ void OSUWP::initialize_core() {
ThreadUWP::make_default();
SemaphoreWindows::make_default();
MutexWindows::make_default();
+ RWLockWindows::make_default();
FileAccess::make_default<FileAccessWindows>(FileAccess::ACCESS_RESOURCES);
FileAccess::make_default<FileAccessWindows>(FileAccess::ACCESS_USERDATA);
FileAccess::make_default<FileAccessWindows>(FileAccess::ACCESS_FILESYSTEM);
- //FileAccessBufferedFA<FileAccessWindows>::make_default();
DirAccess::make_default<DirAccessWindows>(DirAccess::ACCESS_RESOURCES);
DirAccess::make_default<DirAccessWindows>(DirAccess::ACCESS_USERDATA);
DirAccess::make_default<DirAccessWindows>(DirAccess::ACCESS_FILESYSTEM);
- //TCPServerWinsock::make_default();
- //StreamPeerWinsock::make_default();
-
TCPServerWinsock::make_default();
StreamPeerWinsock::make_default();
PacketPeerUDPWinsock::make_default();
- mempool_static = new MemoryPoolStaticMalloc;
-#if 1
- mempool_dynamic = memnew(MemoryPoolDynamicStatic);
-#else
-#define DYNPOOL_SIZE 4 * 1024 * 1024
- void *buffer = malloc(DYNPOOL_SIZE);
- mempool_dynamic = memnew(MemoryPoolDynamicPrealloc(buffer, DYNPOOL_SIZE));
-
-#endif
-
// We need to know how often the clock is updated
if (!QueryPerformanceFrequency((LARGE_INTEGER *)&ticks_per_second))
ticks_per_second = 1000;
@@ -258,13 +241,18 @@ void OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_aud
set_video_mode(vm);
gl_context->make_current();
- rasterizer = memnew(RasterizerGLES2);
- visual_server = memnew(VisualServerRaster(rasterizer));
+ RasterizerGLES3::register_config();
+ RasterizerGLES3::make_current();
+
+ visual_server = memnew(VisualServerRaster);
+ // FIXME: Reimplement threaded rendering? Or remove?
+ /*
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
}
+ */
//
physics_server = memnew(PhysicsServerSW);
@@ -287,7 +275,7 @@ void OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_aud
ERR_PRINT("Initializing audio failed.");
}
- power_manager = memnew(PowerWinRT);
+ power_manager = memnew(PowerUWP);
managed_object->update_clipboard();
@@ -322,7 +310,7 @@ void OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_aud
if (is_keep_screen_on())
display_request->RequestActive();
- set_keep_screen_on(GLOBAL_DEF("display/keep_screen_on", true));
+ set_keep_screen_on(GLOBAL_DEF("display/window/keep_screen_on", true));
}
void OSUWP::set_clipboard(const String &p_text) {
@@ -342,19 +330,9 @@ String OSUWP::get_clipboard() const {
return "";
};
-void OSUWP::input_event(InputEvent &p_event) {
-
- p_event.ID = ++last_id;
+void OSUWP::input_event(const Ref<InputEvent> &p_event) {
input->parse_input_event(p_event);
-
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.pressed && p_event.mouse_button.button_index > 3) {
-
- //send release for mouse wheel
- p_event.mouse_button.pressed = false;
- p_event.ID = ++last_id;
- input->parse_input_event(p_event);
- }
};
void OSUWP::delete_main_loop() {
@@ -383,14 +361,6 @@ void OSUWP::finalize() {
if (gl_context)
memdelete(gl_context);
#endif
- if (rasterizer)
- memdelete(rasterizer);
-
- /*
- if (debugger_connection_console) {
- memdelete(debugger_connection_console);
- }
- */
memdelete(input);
@@ -402,11 +372,8 @@ void OSUWP::finalize() {
joypad = nullptr;
}
-void OSUWP::finalize_core() {
- if (mempool_dynamic)
- memdelete(mempool_dynamic);
- delete mempool_static;
+void OSUWP::finalize_core() {
}
void OSUWP::vprint(const char *p_format, va_list p_list, bool p_stderr) {
@@ -534,7 +501,7 @@ OSUWP::MouseMode OSUWP::get_mouse_mode() const {
return mouse_mode;
}
-Point2 OSUWP::get_mouse_pos() const {
+Point2 OSUWP::get_mouse_position() const {
return Point2(old_x, old_y);
}
@@ -680,7 +647,7 @@ uint64_t OSUWP::get_ticks_usec() const {
void OSUWP::process_events() {
- last_id = joypad->process_controllers(last_id);
+ joypad->process_controllers();
process_key_events();
}
@@ -689,16 +656,18 @@ void OSUWP::process_key_events() {
for (int i = 0; i < key_event_pos; i++) {
KeyEvent &kev = key_event_buffer[i];
- InputEvent iev;
-
- iev.type = InputEvent::KEY;
- iev.key.mod = kev.mod_state;
- iev.key.echo = kev.echo;
- iev.key.scancode = kev.scancode;
- iev.key.unicode = kev.unicode;
- iev.key.pressed = kev.pressed;
- input_event(iev);
+ Ref<InputEventKey> key_event;
+ key_event.instance();
+ key_event->set_alt(kev.alt);
+ key_event->set_shift(kev.shift);
+ key_event->set_control(kev.control);
+ key_event->set_echo(kev.echo);
+ key_event->set_scancode(kev.scancode);
+ key_event->set_unicode(kev.unicode);
+ key_event->set_pressed(kev.pressed);
+
+ input_event(key_event);
}
key_event_pos = 0;
}
@@ -772,7 +741,7 @@ String OSUWP::get_executable_path() const {
return "";
}
-void OSUWP::set_icon(const Image &p_icon) {
+void OSUWP::set_icon(const Ref<Image> &p_icon) {
}
bool OSUWP::has_environment(const String &p_var) const {
@@ -882,15 +851,19 @@ String OSUWP::get_data_dir() const {
return String(data_folder->Path->Data()).replace("\\", "/");
}
-PowerState OSWinrt::get_power_state() {
+bool OSUWP::_check_internal_feature_support(const String &p_feature) {
+ return p_feature == "pc" || p_feature == "s3tc";
+}
+
+PowerState OSUWP::get_power_state() {
return power_manager->get_power_state();
}
-int OSWinrt::get_power_seconds_left() {
+int OSUWP::get_power_seconds_left() {
return power_manager->get_power_seconds_left();
}
-int OSWinrt::get_power_percent_left() {
+int OSUWP::get_power_percent_left() {
return power_manager->get_power_percent_left();
}
@@ -907,7 +880,6 @@ OSUWP::OSUWP() {
pressrc = 0;
old_invalid = true;
- last_id = 0;
mouse_mode = MOUSE_MODE_VISIBLE;
#ifdef STDOUT_FILE
stdo = fopen("stdout.txt", "wb");
diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h
index ebbb8af39c..dfa21a0934 100644
--- a/platform/uwp/os_uwp.h
+++ b/platform/uwp/os_uwp.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,7 +38,7 @@
#include "main/input_default.h"
#include "os/input.h"
#include "os/os.h"
-#include "power_winrt.h"
+#include "power_uwp.h"
#include "servers/audio_server.h"
#include "servers/physics/physics_server_sw.h"
#include "servers/physics_2d/physics_2d_server_sw.h"
@@ -62,7 +63,7 @@ public:
CHAR_EVENT_MESSAGE
};
- InputModifierState mod_state;
+ bool alt, shift, control;
MessageType type;
bool pressed;
unsigned int scancode;
@@ -92,9 +93,7 @@ private:
bool outside;
int old_x, old_y;
Point2i center;
- unsigned int last_id;
VisualServer *visual_server;
- Rasterizer *rasterizer;
PhysicsServer *physics_server;
Physics2DServer *physics_2d_server;
int pressrc;
@@ -107,7 +106,7 @@ private:
AudioDriverXAudio2 audio_driver;
- PowerWinRT *power_manager;
+ PowerUWP *power_manager;
MouseMode mouse_mode;
bool alt_mem;
@@ -190,7 +189,7 @@ public:
void set_mouse_mode(MouseMode p_mode);
MouseMode get_mouse_mode() const;
- virtual Point2 get_mouse_pos() const;
+ virtual Point2 get_mouse_position() const;
virtual int get_mouse_button_state() const;
virtual void set_window_title(const String &p_title);
@@ -228,7 +227,7 @@ public:
virtual String get_clipboard() const;
void set_cursor_shape(CursorShape p_shape);
- void set_icon(const Image &p_icon);
+ void set_icon(const Ref<Image> &p_icon);
virtual String get_executable_path() const;
@@ -237,6 +236,8 @@ public:
virtual void move_window_to_foreground();
virtual String get_data_dir() const;
+ virtual bool _check_internal_feature_support(const String &p_feature);
+
void set_gl_context(ContextEGL *p_context);
void screen_size_changed();
@@ -256,7 +257,7 @@ public:
virtual bool get_swap_ok_cancel() { return true; }
- void input_event(InputEvent &p_event);
+ void input_event(const Ref<InputEvent> &p_event);
virtual PowerState get_power_state();
virtual int get_power_seconds_left();
diff --git a/platform/uwp/platform_config.h b/platform/uwp/platform_config.h
index 7939e1c9ee..77d2c9cadb 100644
--- a/platform/uwp/platform_config.h
+++ b/platform/uwp/platform_config.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/bb10/power_bb10.cpp b/platform/uwp/power_uwp.cpp
index 29c1fe370d..ece07f84ad 100644
--- a/platform/bb10/power_bb10.cpp
+++ b/platform/uwp/power_uwp.cpp
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* power_bb10.cpp */
+/* power_uwp.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,16 +28,26 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "power_bb10.h"
+#include "power_uwp.h"
-#include "core/error_macros.h"
+PowerUWP::PowerUWP()
+ : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) {
+}
-bool PowerBB10::UpdatePowerInfo() {
+PowerUWP::~PowerUWP() {
+}
+bool PowerUWP::UpdatePowerInfo() {
+ // TODO, WinRT: Battery info is available on at least one WinRT platform (Windows Phone 8). Implement UpdatePowerInfo as appropriate. */
+ /* Notes from SDL:
+ - the Win32 function, GetSystemPowerStatus, is not available for use on WinRT
+ - Windows Phone 8 has a 'Battery' class, which is documented as available for C++
+ - More info on WP8's Battery class can be found at http://msdn.microsoft.com/library/windowsphone/develop/jj207231
+ */
return false;
}
-PowerState PowerBB10::get_power_state() {
+PowerState PowerUWP::get_power_state() {
if (UpdatePowerInfo()) {
return power_state;
} else {
@@ -45,7 +56,7 @@ PowerState PowerBB10::get_power_state() {
}
}
-int PowerBB10::get_power_seconds_left() {
+int PowerUWP::get_power_seconds_left() {
if (UpdatePowerInfo()) {
return nsecs_left;
} else {
@@ -54,7 +65,7 @@ int PowerBB10::get_power_seconds_left() {
}
}
-int PowerBB10::get_power_percent_left() {
+int PowerUWP::get_power_percent_left() {
if (UpdatePowerInfo()) {
return percent_left;
} else {
@@ -62,10 +73,3 @@ int PowerBB10::get_power_percent_left() {
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/uwp/power_uwp.h
index 6c13f6e997..c23d712980 100644
--- a/platform/bb10/power_bb10.h
+++ b/platform/uwp/power_uwp.h
@@ -1,11 +1,12 @@
/*************************************************************************/
-/* power_bb10.h */
+/* power_uwp.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,10 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef PLATFORM_BB10_POWER_BB10_H_
-#define PLATFORM_BB10_POWER_BB10_H_
+#ifndef PLATFORM_UWP_POWER_UWP_H_
+#define PLATFORM_UWP_POWER_UWP_H_
+
+#include "os/dir_access.h"
+#include "os/file_access.h"
+#include "os/power.h"
+
+class PowerUWP {
-class PowerBB10 {
private:
int nsecs_left;
int percent_left;
@@ -39,12 +45,12 @@ private:
bool UpdatePowerInfo();
public:
- PowerBB10();
- virtual ~PowerBB10();
+ PowerUWP();
+ virtual ~PowerUWP();
PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
};
-#endif /* PLATFORM_BB10_POWER_BB10_H_ */
+#endif /* PLATFORM_UWP_POWER_UWP_H_ */
diff --git a/platform/uwp/thread_uwp.cpp b/platform/uwp/thread_uwp.cpp
index ff079be375..0549a8ed47 100644
--- a/platform/uwp/thread_uwp.cpp
+++ b/platform/uwp/thread_uwp.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -40,7 +41,7 @@ Thread *ThreadUWP::create_func_uwp(ThreadCreateCallback p_callback, void *p_user
return thread;
};
-Thread::ID ThreadUWP::get_thread_ID_func_uwp() {
+Thread::ID ThreadUWP::get_thread_id_func_uwp() {
return std::hash<std::thread::id>()(std::this_thread::get_id());
};
@@ -51,14 +52,14 @@ void ThreadUWP::wait_to_finish_func_uwp(Thread *p_thread) {
tp->thread.join();
};
-Thread::ID ThreadUWP::get_ID() const {
+Thread::ID ThreadUWP::get_id() const {
return std::hash<std::thread::id>()(thread.get_id());
};
void ThreadUWP::make_default() {
create_func = create_func_uwp;
- get_thread_ID_func = get_thread_ID_func_uwp;
+ get_thread_id_func = get_thread_id_func_uwp;
wait_to_finish_func = wait_to_finish_func_uwp;
};
diff --git a/platform/uwp/thread_uwp.h b/platform/uwp/thread_uwp.h
index b4e67c8b5c..b8cccfb7c3 100644
--- a/platform/uwp/thread_uwp.h
+++ b/platform/uwp/thread_uwp.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -40,13 +41,13 @@ class ThreadUWP : public Thread {
std::thread thread;
static Thread *create_func_uwp(ThreadCreateCallback p_callback, void *, const Settings &);
- static ID get_thread_ID_func_uwp();
+ static ID get_thread_id_func_uwp();
static void wait_to_finish_func_uwp(Thread *p_thread);
ThreadUWP();
public:
- virtual ID get_ID() const;
+ virtual ID get_id() const;
static void make_default();
diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp
index 449ac264a6..f8aed0ccab 100644
--- a/platform/windows/context_gl_win.cpp
+++ b/platform/windows/context_gl_win.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/context_gl_win.h b/platform/windows/context_gl_win.h
index 383197ba7f..b3cab7806d 100644
--- a/platform/windows/context_gl_win.h
+++ b/platform/windows/context_gl_win.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/ctxgl_procaddr.cpp b/platform/windows/ctxgl_procaddr.cpp
index 79c6f219f3..e01c3fc252 100644
--- a/platform/windows/ctxgl_procaddr.cpp
+++ b/platform/windows/ctxgl_procaddr.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/ctxgl_procaddr.h b/platform/windows/ctxgl_procaddr.h
index da17fbcbbe..ecef01aadf 100644
--- a/platform/windows/ctxgl_procaddr.h
+++ b/platform/windows/ctxgl_procaddr.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index a3e410ec64..4d93b3f244 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -1,104 +1,7 @@
-#
-# tested on | Windows native | Linux cross-compilation
-# ----------------------------+-------------------+---------------------------
-# Visual C++ Build Tools 2015 | WORKS | n/a
-# MSVS C++ 2010 Express | WORKS | n/a
-# Mingw-w64 | WORKS | WORKS
-# Mingw-w32 | WORKS | WORKS
-# MinGW | WORKS | untested
-#
-#####
-# Note about Visual C++ Build Tools :
-#
-# - Visual C++ Build Tools is the standalone MSVC compiler :
-# http://landinghub.visualstudio.com/visual-cpp-build-tools
-#
-#####
-# Notes about MSVS C++ :
-#
-# - MSVC2010-Express compiles to 32bits only.
-#
-#####
-# Notes about Mingw-w64 and Mingw-w32 under Windows :
-#
-# - both can be installed using the official installer :
-# http://mingw-w64.sourceforge.net/download.php#mingw-builds
-#
-# - if you want to compile both 32bits and 64bits, don't forget to
-# run the installer twice to install them both.
-#
-# - install them into a path that does not contain spaces
-# ( example : "C:/Mingw-w32", "C:/Mingw-w64" )
-#
-# - if you want to compile faster using the "-j" option, don't forget
-# to install the appropriate version of the Pywin32 python extension
-# available from : http://sourceforge.net/projects/pywin32/files/
-#
-# - before running scons, you must add into the environment path
-# the path to the "/bin" directory of the Mingw version you want
-# to use :
-#
-# set PATH=C:/Mingw-w32/bin;%PATH%
-#
-# - then, scons should be able to detect gcc.
-# - Mingw-w32 only compiles 32bits.
-# - Mingw-w64 only compiles 64bits.
-#
-# - it is possible to add them both at the same time into the PATH env,
-# if you also define the MINGW32_PREFIX and MINGW64_PREFIX environment
-# variables.
-# For instance, you could store that set of commands into a .bat script
-# that you would run just before scons :
-#
-# set PATH=C:\mingw-w32\bin;%PATH%
-# set PATH=C:\mingw-w64\bin;%PATH%
-# set MINGW32_PREFIX=C:\mingw-w32\bin\
-# set MINGW64_PREFIX=C:\mingw-w64\bin\
-#
-#####
-# Notes about Mingw, Mingw-w64 and Mingw-w32 under Linux :
-#
-# - default toolchain prefixes are :
-# "i586-mingw32msvc-" for MinGW
-# "i686-w64-mingw32-" for Mingw-w32
-# "x86_64-w64-mingw32-" for Mingw-w64
-#
-# - if both MinGW and Mingw-w32 are installed on your system
-# Mingw-w32 should take the priority over MinGW.
-#
-# - it is possible to manually override prefixes by defining
-# the MINGW32_PREFIX and MINGW64_PREFIX environment variables.
-#
-#####
-# Notes about Mingw under Windows :
-#
-# - this is the MinGW version from http://mingw.org/
-# - install it into a path that does not contain spaces
-# ( example : "C:/MinGW" )
-# - several DirectX headers might be missing. You can copy them into
-# the C:/MinGW/include" directory from this page :
-# https://code.google.com/p/mingw-lib/source/browse/trunk/working/avcodec_to_widget_5/directx_include/
-# - before running scons, add the path to the "/bin" directory :
-# set PATH=C:/MinGW/bin;%PATH%
-# - scons should be able to detect gcc.
-#
-
-#####
-# TODO :
-#
-# - finish to cleanup this script to remove all the remains of previous hacks and workarounds
-# - make it work with the Windows7 SDK that is supposed to enable 64bits compilation for MSVC2010-Express
-# - confirm it works well with other Visual Studio versions.
-# - update the wiki about the pywin32 extension required for the "-j" option under Windows.
-# - update the wiki to document MINGW32_PREFIX and MINGW64_PREFIX
-#
-
+import methods
import os
-
import sys
-import methods
-
def is_active():
return True
@@ -115,7 +18,7 @@ def can_build():
if (os.getenv("VCINSTALLDIR")):
return True
else:
- print("\nMSVC not detected, attempting Mingw.")
+ print("\nMSVC not detected, attempting MinGW.")
mingw32 = ""
mingw64 = ""
if (os.getenv("MINGW32_PREFIX")):
@@ -126,7 +29,7 @@ def can_build():
test = "gcc --version > NUL 2>&1"
if os.system(test) != 0 and os.system(mingw32 + test) != 0 and os.system(mingw64 + test) != 0:
print("- could not detect gcc.")
- print("Please, make sure a path to a Mingw /bin directory is accessible into the environment PATH.\n")
+ print("Please, make sure a path to a MinGW /bin directory is accessible into the environment PATH.\n")
return False
else:
print("- gcc detected.")
@@ -145,7 +48,7 @@ def can_build():
if (os.getenv("MINGW64_PREFIX")):
mingw64 = os.getenv("MINGW64_PREFIX")
- test = "gcc --version &>/dev/null"
+ test = "gcc --version > /dev/null 2>&1"
if (os.system(mingw + test) == 0 or os.system(mingw64 + test) == 0 or os.system(mingw32 + test) == 0):
return True
@@ -162,7 +65,7 @@ def get_opts():
mingw32 = "i686-w64-mingw32-"
mingw64 = "x86_64-w64-mingw32-"
- if os.system(mingw32 + "gcc --version &>/dev/null") != 0:
+ if os.system(mingw32 + "gcc --version > /dev/null 2>&1") != 0:
mingw32 = mingw
if (os.getenv("MINGW32_PREFIX")):
@@ -172,8 +75,8 @@ def get_opts():
mingw64 = os.getenv("MINGW64_PREFIX")
return [
- ('mingw_prefix', 'Mingw Prefix', mingw32),
- ('mingw_prefix_64', 'Mingw Prefix 64 bits', mingw64),
+ ('mingw_prefix', 'MinGW Prefix', mingw32),
+ ('mingw_prefix_64', 'MinGW Prefix 64 bits', mingw64),
]
@@ -211,55 +114,86 @@ def configure(env):
# Targeted Windows version: Vista (and later)
winver = "0x0600" # Windows Vista is the minimum target for windows builds
- env['is_mingw'] = False
- if (os.name == "nt" and os.getenv("VCINSTALLDIR")):
- # build using visual studio
+ if (os.name == "nt" and os.getenv("VCINSTALLDIR")): # MSVC
+
env['ENV']['TMP'] = os.environ['TMP']
- env.Append(CPPPATH=['#platform/windows/include'])
- env.Append(LIBPATH=['#platform/windows/lib'])
- env.Append(CCFLAGS=['/DWINVER=%s' % winver, '/D_WIN32_WINNT=%s' % winver])
- if (env["target"] == "release"):
+ ## Build type
+ if (env["target"] == "release"):
env.Append(CCFLAGS=['/O2'])
env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS'])
env.Append(LINKFLAGS=['/ENTRY:mainCRTStartup'])
elif (env["target"] == "release_debug"):
-
env.Append(CCFLAGS=['/O2', '/DDEBUG_ENABLED'])
env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
- elif (env["target"] == "debug_release"):
+ elif (env["target"] == "debug_release"):
env.Append(CCFLAGS=['/Z7', '/Od'])
env.Append(LINKFLAGS=['/DEBUG'])
env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS'])
env.Append(LINKFLAGS=['/ENTRY:mainCRTStartup'])
elif (env["target"] == "debug"):
-
env.Append(CCFLAGS=['/Z7', '/DDEBUG_ENABLED', '/DDEBUG_MEMORY_ENABLED', '/DD3D_DEBUG_INFO', '/Od'])
env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
env.Append(LINKFLAGS=['/DEBUG'])
+ ## Architecture
+
+ # Note: this detection/override code from here onward should be here instead of in SConstruct because it's platform and compiler specific (MSVC/Windows)
+ if (env["bits"] != "default"):
+ print("Error: bits argument is disabled for MSVC")
+ print("""
+ Bits argument is not supported for MSVC compilation. Architecture depends on the Native/Cross Compile Tools Prompt/Developer Console
+ (or Visual Studio settings) that is being used to run SCons. As a consequence, bits argument is disabled. Run scons again without bits
+ argument (example: scons p=windows) and SCons will attempt to detect what MSVC compiler will be executed and inform you.
+ """)
+ sys.exit()
+
+ # Forcing bits argument because MSVC does not have a flag to set this through SCons... it's different compilers (cl.exe's) called from the proper command prompt
+ # that decide the architecture that is build for. Scons can only detect the os.getenviron (because vsvarsall.bat sets a lot of stuff for cl.exe to work with)
+ env["bits"] = "32"
+ env["x86_libtheora_opt_vc"] = True
+
+ ## Compiler configuration
+
+ env['ENV'] = os.environ
+ # This detection function needs the tools env (that is env['ENV'], not SCons's env), and that is why it's this far bellow in the code
+ compiler_version_str = methods.detect_visual_c_compiler_version(env['ENV'])
+
+ print("Detected MSVC compiler: " + compiler_version_str)
+ # If building for 64bit architecture, disable assembly optimisations for 32 bit builds (theora as of writting)... vc compiler for 64bit can not compile _asm
+ if(compiler_version_str == "amd64" or compiler_version_str == "x86_amd64"):
+ env["bits"] = "64"
+ env["x86_libtheora_opt_vc"] = False
+ print("Compiled program architecture will be a 64 bit executable (forcing bits=64).")
+ elif (compiler_version_str == "x86" or compiler_version_str == "amd64_x86"):
+ print("Compiled program architecture will be a 32 bit executable. (forcing bits=32).")
+ else:
+ print("Failed to detect MSVC compiler architecture version... Defaulting to 32bit executable settings (forcing bits=32). Compilation attempt will continue, but SCons can not detect for what architecture this build is compiled for. You should check your settings/compilation setup.")
+
+ ## Compile flags
+
env.Append(CCFLAGS=['/MT', '/Gd', '/GR', '/nologo'])
env.Append(CXXFLAGS=['/TP'])
env.Append(CPPFLAGS=['/DMSVC', '/GR', ])
env.Append(CCFLAGS=['/I' + os.getenv("WindowsSdkDir") + "/Include"])
+
env.Append(CCFLAGS=['/DWINDOWS_ENABLED'])
+ env.Append(CCFLAGS=['/DOPENGL_ENABLED'])
env.Append(CCFLAGS=['/DRTAUDIO_ENABLED'])
- env.Append(CCFLAGS=['/DWIN32'])
env.Append(CCFLAGS=['/DTYPED_METHOD_BIND'])
+ env.Append(CCFLAGS=['/DWIN32'])
+ env.Append(CCFLAGS=['/DWINVER=%s' % winver, '/D_WIN32_WINNT=%s' % winver])
+ if env["bits"] == "64":
+ env.Append(CCFLAGS=['/D_WIN64'])
- env.Append(CCFLAGS=['/DOPENGL_ENABLED'])
LIBS = ['winmm', 'opengl32', 'dsound', 'kernel32', 'ole32', 'oleaut32', 'user32', 'gdi32', 'IPHLPAPI', 'Shlwapi', 'wsock32', 'Ws2_32', 'shell32', 'advapi32', 'dinput8', 'dxguid']
env.Append(LINKFLAGS=[p + env["LIBSUFFIX"] for p in LIBS])
env.Append(LIBPATH=[os.getenv("WindowsSdkDir") + "/Lib"])
- if (os.getenv("DXSDK_DIR")):
- DIRECTX_PATH = os.getenv("DXSDK_DIR")
- else:
- DIRECTX_PATH = "C:/Program Files/Microsoft DirectX SDK (March 2009)"
if (os.getenv("VCINSTALLDIR")):
VC_PATH = os.getenv("VCINSTALLDIR")
@@ -268,51 +202,37 @@ def configure(env):
env.Append(CCFLAGS=["/I" + p for p in os.getenv("INCLUDE").split(";")])
env.Append(LIBPATH=[p for p in os.getenv("LIB").split(";")])
- env.Append(CCFLAGS=["/I" + DIRECTX_PATH + "/Include"])
- env.Append(LIBPATH=[DIRECTX_PATH + "/Lib/x86"])
- env['ENV'] = os.environ
-
- # This detection function needs the tools env (that is env['ENV'], not SCons's env), and that is why it's this far bellow in the code
- compiler_version_str = methods.detect_visual_c_compiler_version(env['ENV'])
-
- # Note: this detection/override code from here onward should be here instead of in SConstruct because it's platform and compiler specific (MSVC/Windows)
- if(env["bits"] != "default"):
- print "Error: bits argument is disabled for MSVC"
- print ("Bits argument is not supported for MSVC compilation. Architecture depends on the Native/Cross Compile Tools Prompt/Developer Console (or Visual Studio settings)"
- + " that is being used to run SCons. As a consequence, bits argument is disabled. Run scons again without bits argument (example: scons p=windows) and SCons will attempt to detect what MSVC compiler"
- + " will be executed and inform you.")
- sys.exit()
-
- # Forcing bits argument because MSVC does not have a flag to set this through SCons... it's different compilers (cl.exe's) called from the proper command prompt
- # that decide the architecture that is build for. Scons can only detect the os.getenviron (because vsvarsall.bat sets a lot of stuff for cl.exe to work with)
- env["bits"] = "32"
- env["x86_libtheora_opt_vc"] = True
-
- print "Detected MSVC compiler: " + compiler_version_str
- # If building for 64bit architecture, disable assembly optimisations for 32 bit builds (theora as of writting)... vc compiler for 64bit can not compile _asm
- if(compiler_version_str == "amd64" or compiler_version_str == "x86_amd64"):
- env["bits"] = "64"
- env["x86_libtheora_opt_vc"] = False
- print "Compiled program architecture will be a 64 bit executable (forcing bits=64)."
- elif (compiler_version_str == "x86" or compiler_version_str == "amd64_x86"):
- print "Compiled program architecture will be a 32 bit executable. (forcing bits=32)."
- else:
- print "Failed to detect MSVC compiler architecture version... Defaulting to 32bit executable settings (forcing bits=32). Compilation attempt will continue, but SCons can not detect for what architecture this build is compiled for. You should check your settings/compilation setup."
- if env["bits"] == "64":
- env.Append(CCFLAGS=['/D_WIN64'])
# Incremental linking fix
env['BUILDERS']['ProgramOriginal'] = env['BUILDERS']['Program']
env['BUILDERS']['Program'] = methods.precious_program
- else:
+ else: # MinGW
# Workaround for MinGW. See:
# http://www.scons.org/wiki/LongCmdLinesOnWin32
env.use_windows_spawn_fix()
- # build using mingw
- env.Append(CCFLAGS=['-DWINVER=%s' % winver, '-D_WIN32_WINNT=%s' % winver])
+ ## Build type
+
+ if (env["target"] == "release"):
+ env.Append(CCFLAGS=['-msse2'])
+
+ if (env["bits"] == "64"):
+ env.Append(CCFLAGS=['-O3'])
+ else:
+ env.Append(CCFLAGS=['-O2'])
+
+ env.Append(LINKFLAGS=['-Wl,--subsystem,windows'])
+
+ elif (env["target"] == "release_debug"):
+ env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED'])
+
+ elif (env["target"] == "debug"):
+ env.Append(CCFLAGS=['-g', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+
+ ## Compiler configuration
+
if (os.name == "nt"):
env['ENV']['TMP'] = os.environ['TMP'] # way to go scons, you can be so stupid sometimes
else:
@@ -332,37 +252,6 @@ def configure(env):
env.Append(LINKFLAGS=['-static'])
mingw_prefix = env["mingw_prefix_64"]
- nulstr = ""
-
- if (os.name == "posix"):
- nulstr = ">/dev/null"
- else:
- nulstr = ">nul"
-
- # if os.system(mingw_prefix+"gcc --version"+nulstr)!=0:
- # #not really super consistent but..
- # print("Can't find Windows compiler: "+mingw_prefix)
- # sys.exit(255)
-
- if (env["target"] == "release"):
-
- env.Append(CCFLAGS=['-msse2'])
-
- if (env["bits"] == "64"):
- env.Append(CCFLAGS=['-O3'])
- else:
- env.Append(CCFLAGS=['-O2'])
-
- env.Append(LINKFLAGS=['-Wl,--subsystem,windows'])
-
- elif (env["target"] == "release_debug"):
-
- env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED'])
-
- elif (env["target"] == "debug"):
-
- env.Append(CCFLAGS=['-g', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
-
env["CC"] = mingw_prefix + "gcc"
env['AS'] = mingw_prefix + "as"
env['CXX'] = mingw_prefix + "g++"
@@ -371,29 +260,15 @@ def configure(env):
env['LD'] = mingw_prefix + "g++"
env["x86_libtheora_opt_gcc"] = True
- #env['CC'] = "winegcc"
- #env['CXX'] = "wineg++"
+ ## Compile flags
env.Append(CCFLAGS=['-DWINDOWS_ENABLED', '-mwindows'])
- env.Append(CPPFLAGS=['-DRTAUDIO_ENABLED'])
env.Append(CCFLAGS=['-DOPENGL_ENABLED'])
+ env.Append(CCFLAGS=['-DRTAUDIO_ENABLED'])
+ env.Append(CCFLAGS=['-DWINVER=%s' % winver, '-D_WIN32_WINNT=%s' % winver])
env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid'])
- # if (env["bits"]=="32"):
- # env.Append(LIBS=['gcc_s'])
- # #--with-arch=i686
- # env.Append(CPPFLAGS=['-march=i686'])
- # env.Append(LINKFLAGS=['-march=i686'])
-
- #'d3dx9d'
env.Append(CPPFLAGS=['-DMINGW_ENABLED'])
- # env.Append(LINKFLAGS=['-g'])
# resrc
- env['is_mingw'] = True
env.Append(BUILDERS={'RES': env.Builder(action=build_res_file, suffix='.o', src_suffix='.rc')})
-
- env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')})
- env.Append(BUILDERS={'HLSL9': env.Builder(action=methods.build_hlsl_dx9_headers, suffix='hlsl.h', src_suffix='.hlsl')})
- env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')})
diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp
index bb51474a8c..6cb33e2ff0 100644
--- a/platform/windows/export/export.cpp
+++ b/platform/windows/export/export.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,28 +27,26 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "export.h"
#include "editor/editor_export.h"
-#include "platform/windows/logo.h"
+#include "platform/windows/logo.gen.h"
void register_windows_exporter() {
-#if 0
- Image img(_windows_logo);
- Ref<ImageTexture> logo = memnew( ImageTexture );
- logo->create_from_image(img);
+ Ref<EditorExportPlatformPC> platform;
+ platform.instance();
- {
- Ref<EditorExportPlatformPC> exporter = Ref<EditorExportPlatformPC>( memnew(EditorExportPlatformPC) );
- exporter->set_binary_extension("exe");
- exporter->set_release_binary32("windows_32_release.exe");
- exporter->set_debug_binary32("windows_32_debug.exe");
- exporter->set_release_binary64("windows_64_release.exe");
- exporter->set_debug_binary64("windows_64_debug.exe");
- exporter->set_name("Windows Desktop");
- exporter->set_logo(logo);
- EditorImportExport::get_singleton()->add_export_platform(exporter);
- }
+ Ref<Image> img = memnew(Image(_windows_logo));
+ Ref<ImageTexture> logo;
+ logo.instance();
+ logo->create_from_image(img);
+ platform->set_logo(logo);
+ platform->set_name("Windows Desktop");
+ platform->set_extension("exe");
+ platform->set_release_32("windows_32_release.exe");
+ platform->set_debug_32("windows_32_debug.exe");
+ platform->set_release_64("windows_64_release.exe");
+ platform->set_debug_64("windows_64_debug.exe");
+ platform->set_os_name("Windows");
-#endif
+ EditorExport::get_singleton()->add_export_platform(platform);
}
diff --git a/platform/windows/export/export.h b/platform/windows/export/export.h
index b437efc48e..ea9113c674 100644
--- a/platform/windows/export/export.h
+++ b/platform/windows/export/export.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/godot.ico b/platform/windows/godot.ico
index 3e52f2e52f..dd611e07da 100644
--- a/platform/windows/godot.ico
+++ b/platform/windows/godot.ico
Binary files differ
diff --git a/platform/windows/godot_win.cpp b/platform/windows/godot_win.cpp
index f8f5fe8231..df2d96e516 100644
--- a/platform/windows/godot_win.cpp
+++ b/platform/windows/godot_win.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/joypad.cpp b/platform/windows/joypad.cpp
index 2472940ef3..e8a5084daf 100644
--- a/platform/windows/joypad.cpp
+++ b/platform/windows/joypad.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -234,13 +235,13 @@ void JoypadWindows::setup_joypad_object(const DIDEVICEOBJECTINSTANCE *ob, int p_
}
}
-BOOL CALLBACK JoypadWindows::enumCallback(const DIDEVICEINSTANCE *instance, void *pContext) {
+BOOL CALLBACK JoypadWindows::enumCallback(const DIDEVICEINSTANCE *p_instance, void *p_context) {
- JoypadWindows *self = (JoypadWindows *)pContext;
- if (self->is_xinput_device(&instance->guidProduct)) {
+ JoypadWindows *self = (JoypadWindows *)p_context;
+ if (self->is_xinput_device(&p_instance->guidProduct)) {
return DIENUM_CONTINUE;
}
- self->setup_dinput_joypad(instance);
+ self->setup_dinput_joypad(p_instance);
return DIENUM_CONTINUE;
}
@@ -319,7 +320,7 @@ void JoypadWindows::probe_joypads() {
}
}
-unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) {
+void JoypadWindows::process_joypads() {
HRESULT hr;
@@ -337,16 +338,16 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) {
int button_mask = XINPUT_GAMEPAD_DPAD_UP;
for (int i = 0; i <= 16; i++) {
- p_last_id = input->joy_button(p_last_id, joy.id, i, joy.state.Gamepad.wButtons & button_mask);
+ input->joy_button(joy.id, i, joy.state.Gamepad.wButtons & button_mask);
button_mask = button_mask * 2;
}
- p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_0, axis_correct(joy.state.Gamepad.sThumbLX, true));
- p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_1, axis_correct(joy.state.Gamepad.sThumbLY, true, false, true));
- p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_2, axis_correct(joy.state.Gamepad.sThumbRX, true));
- p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_3, axis_correct(joy.state.Gamepad.sThumbRY, true, false, true));
- p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_4, axis_correct(joy.state.Gamepad.bLeftTrigger, true, true));
- p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_5, axis_correct(joy.state.Gamepad.bRightTrigger, true, true));
+ input->joy_axis(joy.id, JOY_AXIS_0, axis_correct(joy.state.Gamepad.sThumbLX, true));
+ input->joy_axis(joy.id, JOY_AXIS_1, axis_correct(joy.state.Gamepad.sThumbLY, true, false, true));
+ input->joy_axis(joy.id, JOY_AXIS_2, axis_correct(joy.state.Gamepad.sThumbRX, true));
+ input->joy_axis(joy.id, JOY_AXIS_3, axis_correct(joy.state.Gamepad.sThumbRY, true, false, true));
+ input->joy_axis(joy.id, JOY_AXIS_4, axis_correct(joy.state.Gamepad.bLeftTrigger, true, true));
+ input->joy_axis(joy.id, JOY_AXIS_5, axis_correct(joy.state.Gamepad.bRightTrigger, true, true));
joy.last_packet = joy.state.dwPacketNumber;
}
uint64_t timestamp = input->get_joy_vibration_timestamp(joy.id);
@@ -384,7 +385,7 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) {
continue;
}
- p_last_id = post_hat(p_last_id, joy->id, js.rgdwPOV[0]);
+ post_hat(joy->id, js.rgdwPOV[0]);
for (int j = 0; j < 128; j++) {
@@ -392,14 +393,14 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) {
if (!joy->last_buttons[j]) {
- p_last_id = input->joy_button(p_last_id, joy->id, j, true);
+ input->joy_button(joy->id, j, true);
joy->last_buttons[j] = true;
}
} else {
if (joy->last_buttons[j]) {
- p_last_id = input->joy_button(p_last_id, joy->id, j, false);
+ input->joy_button(joy->id, j, false);
joy->last_buttons[j] = false;
}
}
@@ -414,16 +415,16 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) {
for (int k = 0; k < count; k++) {
if (joy->joy_axis[j] == axes[k]) {
- p_last_id = input->joy_axis(p_last_id, joy->id, j, axis_correct(values[k]));
+ input->joy_axis(joy->id, j, axis_correct(values[k]));
break;
};
};
};
}
- return p_last_id;
+ return;
}
-unsigned int JoypadWindows::post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad) {
+void JoypadWindows::post_hat(int p_device, DWORD p_dpad) {
int dpad_val = 0;
@@ -462,7 +463,7 @@ unsigned int JoypadWindows::post_hat(unsigned int p_last_id, int p_device, DWORD
dpad_val = (InputDefault::HAT_MASK_LEFT | InputDefault::HAT_MASK_UP);
}
- return input->joy_hat(p_last_id, p_device, dpad_val);
+ input->joy_hat(p_device, dpad_val);
};
InputDefault::JoyAxis JoypadWindows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool p_negate) const {
diff --git a/platform/windows/joypad.h b/platform/windows/joypad.h
index 7e4f6ff328..7cd791e78f 100644
--- a/platform/windows/joypad.h
+++ b/platform/windows/joypad.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -53,7 +54,7 @@ public:
~JoypadWindows();
void probe_joypads();
- unsigned int process_joypads(unsigned int p_last_id);
+ void process_joypads();
private:
enum {
@@ -130,7 +131,7 @@ private:
void load_xinput();
void unload_xinput();
- unsigned int post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad);
+ void post_hat(int p_device, DWORD p_dpad);
bool have_device(const GUID &p_guid);
bool is_xinput_device(const GUID *p_guid);
diff --git a/platform/windows/key_mapping_win.cpp b/platform/windows/key_mapping_win.cpp
index 51cdba65d5..83e2af72b2 100644
--- a/platform/windows/key_mapping_win.cpp
+++ b/platform/windows/key_mapping_win.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,7 +44,7 @@ static _WinTranslatePair _vk_to_keycode[] = {
//VK_CLEAR (0x0C)
- { KEY_RETURN, VK_RETURN }, //(0x0D)
+ { KEY_ENTER, VK_RETURN }, //(0x0D)
{ KEY_SHIFT, VK_SHIFT }, //(0x10)
diff --git a/platform/windows/key_mapping_win.h b/platform/windows/key_mapping_win.h
index fbc79635c2..af91676dff 100644
--- a/platform/windows/key_mapping_win.h
+++ b/platform/windows/key_mapping_win.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/lang_table.h b/platform/windows/lang_table.h
index 7fe509d3e0..7cf2bb391b 100644
--- a/platform/windows/lang_table.h
+++ b/platform/windows/lang_table.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 2046ae9f44..779f909a15 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,15 +37,15 @@
#include "drivers/windows/rw_lock_windows.h"
#include "drivers/windows/semaphore_windows.h"
#include "drivers/windows/thread_windows.h"
-#include "servers/audio_server.h"
-#include "servers/visual/visual_server_raster.h"
-//#include "servers/visual/visual_server_wrap_mt.h"
-#include "global_config.h"
#include "io/marshalls.h"
#include "joypad.h"
#include "lang_table.h"
#include "main/main.h"
#include "packet_peer_udp_winsock.h"
+#include "project_settings.h"
+#include "servers/audio_server.h"
+#include "servers/visual/visual_server_raster.h"
+#include "servers/visual/visual_server_wrap_mt.h"
#include "stream_peer_winsock.h"
#include "tcp_server_winsock.h"
@@ -214,15 +215,11 @@ bool OS_Windows::can_draw() const {
void OS_Windows::_touch_event(bool p_pressed, int p_x, int p_y, int idx) {
- InputEvent event;
- event.type = InputEvent::SCREEN_TOUCH;
- event.ID = ++last_id;
- event.screen_touch.index = idx;
-
- event.screen_touch.pressed = p_pressed;
-
- event.screen_touch.x = p_x;
- event.screen_touch.y = p_y;
+ Ref<InputEventScreenTouch> event;
+ event.instance();
+ event->set_index(idx);
+ event->set_pressed(p_pressed);
+ event->set_position(Vector2(p_x, p_y));
if (main_loop) {
input->parse_input_event(event);
@@ -231,13 +228,10 @@ void OS_Windows::_touch_event(bool p_pressed, int p_x, int p_y, int idx) {
void OS_Windows::_drag_event(int p_x, int p_y, int idx) {
- InputEvent event;
- event.type = InputEvent::SCREEN_DRAG;
- event.ID = ++last_id;
- event.screen_drag.index = idx;
-
- event.screen_drag.x = p_x;
- event.screen_drag.y = p_y;
+ Ref<InputEventScreenDrag> event;
+ event.instance();
+ event->set_index(idx);
+ event->set_position(Vector2(p_x, p_y));
if (main_loop)
input->parse_input_event(event);
@@ -368,23 +362,23 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
};
*/
- InputEvent event;
- event.type = InputEvent::MOUSE_MOTION;
- event.ID = ++last_id;
- InputEventMouseMotion &mm = event.mouse_motion;
+ Ref<InputEventMouseMotion> mm;
+ mm.instance();
- mm.mod.control = (wParam & MK_CONTROL) != 0;
- mm.mod.shift = (wParam & MK_SHIFT) != 0;
- mm.mod.alt = alt_mem;
+ mm->set_control((wParam & MK_CONTROL) != 0);
+ mm->set_shift((wParam & MK_SHIFT) != 0);
+ mm->set_alt(alt_mem);
- mm.button_mask |= (wParam & MK_LBUTTON) ? (1 << 0) : 0;
- mm.button_mask |= (wParam & MK_RBUTTON) ? (1 << 1) : 0;
- mm.button_mask |= (wParam & MK_MBUTTON) ? (1 << 2) : 0;
- last_button_state = mm.button_mask;
- /*mm.button_mask|=(wParam&MK_XBUTTON1)?(1<<5):0;
- mm.button_mask|=(wParam&MK_XBUTTON2)?(1<<6):0;*/
- mm.x = GET_X_LPARAM(lParam);
- mm.y = GET_Y_LPARAM(lParam);
+ int bmask = 0;
+ bmask |= (wParam & MK_LBUTTON) ? (1 << 0) : 0;
+ bmask |= (wParam & MK_RBUTTON) ? (1 << 1) : 0;
+ bmask |= (wParam & MK_MBUTTON) ? (1 << 2) : 0;
+ mm->set_button_mask(bmask);
+
+ last_button_state = mm->get_button_mask();
+ /*mm->get_button_mask()|=(wParam&MK_XBUTTON1)?(1<<5):0;
+ mm->get_button_mask()|=(wParam&MK_XBUTTON2)?(1<<6):0;*/
+ mm->set_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
if (mouse_mode == MOUSE_MODE_CAPTURED) {
@@ -392,35 +386,33 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
old_x = c.x;
old_y = c.y;
- if (Point2i(mm.x, mm.y) == c) {
+ if (mm->get_position() == c) {
center = c;
return 0;
}
- Point2i ncenter(mm.x, mm.y);
+ Point2i ncenter = mm->get_position();
center = ncenter;
POINT pos = { (int)c.x, (int)c.y };
ClientToScreen(hWnd, &pos);
SetCursorPos(pos.x, pos.y);
}
- input->set_mouse_pos(Point2(mm.x, mm.y));
- mm.speed_x = input->get_last_mouse_speed().x;
- mm.speed_y = input->get_last_mouse_speed().y;
+ input->set_mouse_position(mm->get_position());
+ mm->set_speed(input->get_last_mouse_speed());
if (old_invalid) {
- old_x = mm.x;
- old_y = mm.y;
+ old_x = mm->get_position().x;
+ old_y = mm->get_position().y;
old_invalid = false;
}
- mm.relative_x = mm.x - old_x;
- mm.relative_y = mm.y - old_y;
- old_x = mm.x;
- old_y = mm.y;
+ mm->set_relative(Vector2(mm->get_position() - Vector2(old_x, old_y)));
+ old_x = mm->get_position().x;
+ old_y = mm->get_position().y;
if (window_has_focus && main_loop)
- input->parse_input_event(event);
+ input->parse_input_event(mm);
} break;
case WM_LBUTTONDOWN:
@@ -449,112 +441,110 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
};
*/
- InputEvent event;
- event.type = InputEvent::MOUSE_BUTTON;
- event.ID = ++last_id;
- InputEventMouseButton &mb = event.mouse_button;
+ Ref<InputEventMouseButton> mb;
+ mb.instance();
switch (uMsg) {
case WM_LBUTTONDOWN: {
- mb.pressed = true;
- mb.button_index = 1;
+ mb->set_pressed(true);
+ mb->set_button_index(1);
} break;
case WM_LBUTTONUP: {
- mb.pressed = false;
- mb.button_index = 1;
+ mb->set_pressed(false);
+ mb->set_button_index(1);
} break;
case WM_MBUTTONDOWN: {
- mb.pressed = true;
- mb.button_index = 3;
+ mb->set_pressed(true);
+ mb->set_button_index(3);
} break;
case WM_MBUTTONUP: {
- mb.pressed = false;
- mb.button_index = 3;
+ mb->set_pressed(false);
+ mb->set_button_index(3);
} break;
case WM_RBUTTONDOWN: {
- mb.pressed = true;
- mb.button_index = 2;
+ mb->set_pressed(true);
+ mb->set_button_index(2);
} break;
case WM_RBUTTONUP: {
- mb.pressed = false;
- mb.button_index = 2;
+ mb->set_pressed(false);
+ mb->set_button_index(2);
} break;
case WM_LBUTTONDBLCLK: {
- mb.pressed = true;
- mb.button_index = 1;
- mb.doubleclick = true;
+ mb->set_pressed(true);
+ mb->set_button_index(1);
+ mb->set_doubleclick(true);
} break;
case WM_RBUTTONDBLCLK: {
- mb.pressed = true;
- mb.button_index = 2;
- mb.doubleclick = true;
+ mb->set_pressed(true);
+ mb->set_button_index(2);
+ mb->set_doubleclick(true);
} break;
case WM_MOUSEWHEEL: {
- mb.pressed = true;
+ mb->set_pressed(true);
int motion = (short)HIWORD(wParam);
if (!motion)
return 0;
if (motion > 0)
- mb.button_index = BUTTON_WHEEL_UP;
+ mb->set_button_index(BUTTON_WHEEL_UP);
else
- mb.button_index = BUTTON_WHEEL_DOWN;
+ mb->set_button_index(BUTTON_WHEEL_DOWN);
} break;
case WM_MOUSEHWHEEL: {
- mb.pressed = true;
+ mb->set_pressed(true);
int motion = (short)HIWORD(wParam);
if (!motion)
return 0;
- if (motion < 0)
- mb.button_index = BUTTON_WHEEL_LEFT;
- else
- mb.button_index = BUTTON_WHEEL_RIGHT;
+ if (motion < 0) {
+ mb->set_button_index(BUTTON_WHEEL_LEFT);
+ mb->set_factor(fabs((double)motion / (double)WHEEL_DELTA));
+ } else {
+ mb->set_button_index(BUTTON_WHEEL_RIGHT);
+ mb->set_factor(fabs((double)motion / (double)WHEEL_DELTA));
+ }
} break;
/*
case WM_XBUTTONDOWN: {
- mb.pressed=true;
- mb.button_index=(HIWORD(wParam)==XBUTTON1)?6:7;
+ mb->is_pressed()=true;
+ mb->get_button_index()=(HIWORD(wParam)==XBUTTON1)?6:7;
} break;
case WM_XBUTTONUP:
- mb.pressed=true;
- mb.button_index=(HIWORD(wParam)==XBUTTON1)?6:7;
+ mb->is_pressed()=true;
+ mb->get_button_index()=(HIWORD(wParam)==XBUTTON1)?6:7;
} break;*/
default: { return 0; }
}
- mb.mod.control = (wParam & MK_CONTROL) != 0;
- mb.mod.shift = (wParam & MK_SHIFT) != 0;
- mb.mod.alt = alt_mem;
- //mb.mod.alt=(wParam&MK_MENU)!=0;
- mb.button_mask |= (wParam & MK_LBUTTON) ? (1 << 0) : 0;
- mb.button_mask |= (wParam & MK_RBUTTON) ? (1 << 1) : 0;
- mb.button_mask |= (wParam & MK_MBUTTON) ? (1 << 2) : 0;
-
- last_button_state = mb.button_mask;
+ mb->set_control((wParam & MK_CONTROL) != 0);
+ mb->set_shift((wParam & MK_SHIFT) != 0);
+ mb->set_alt(alt_mem);
+ //mb->get_alt()=(wParam&MK_MENU)!=0;
+ int bmask = 0;
+ bmask |= (wParam & MK_LBUTTON) ? (1 << 0) : 0;
+ bmask |= (wParam & MK_RBUTTON) ? (1 << 1) : 0;
+ bmask |= (wParam & MK_MBUTTON) ? (1 << 2) : 0;
+ mb->set_button_mask(bmask);
+
+ last_button_state = mb->get_button_mask();
/*
- mb.button_mask|=(wParam&MK_XBUTTON1)?(1<<5):0;
- mb.button_mask|=(wParam&MK_XBUTTON2)?(1<<6):0;*/
- mb.x = GET_X_LPARAM(lParam);
- mb.y = GET_Y_LPARAM(lParam);
+ mb->get_button_mask()|=(wParam&MK_XBUTTON1)?(1<<5):0;
+ mb->get_button_mask()|=(wParam&MK_XBUTTON2)?(1<<6):0;*/
+ mb->set_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
if (mouse_mode == MOUSE_MODE_CAPTURED) {
- mb.x = old_x;
- mb.y = old_y;
+ mb->set_position(Vector2(old_x, old_y));
}
- mb.global_x = mb.x;
- mb.global_y = mb.y;
-
if (uMsg != WM_MOUSEWHEEL) {
- if (mb.pressed) {
+ if (mb->is_pressed()) {
if (++pressrc > 0)
SetCapture(hWnd);
@@ -568,22 +558,23 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
} else if (mouse_mode != MOUSE_MODE_CAPTURED) {
// for reasons unknown to mankind, wheel comes in screen cordinates
POINT coords;
- coords.x = mb.x;
- coords.y = mb.y;
+ coords.x = mb->get_position().x;
+ coords.y = mb->get_position().y;
ScreenToClient(hWnd, &coords);
- mb.x = coords.x;
- mb.y = coords.y;
+ mb->set_position(Vector2(coords.x, coords.y));
}
+ mb->set_global_position(mb->get_position());
+
if (main_loop) {
- input->parse_input_event(event);
- if (mb.pressed && mb.button_index > 3) {
+ input->parse_input_event(mb);
+ if (mb->is_pressed() && mb->get_button_index() > 3) {
//send release for mouse wheel
- mb.pressed = false;
- event.ID = ++last_id;
- input->parse_input_event(event);
+ Ref<InputEventMouseButton> mbd = mb->duplicate();
+ mbd->set_pressed(false);
+ input->parse_input_event(mbd);
}
}
}
@@ -639,10 +630,10 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
// Make sure we don't include modifiers for the modifier key itself.
KeyEvent ke;
- ke.mod_state.shift = (wParam != VK_SHIFT) ? shift_mem : false;
- ke.mod_state.alt = (!(wParam == VK_MENU && (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN))) ? alt_mem : false;
- ke.mod_state.control = (wParam != VK_CONTROL) ? control_mem : false;
- ke.mod_state.meta = meta_mem;
+ ke.shift = (wParam != VK_SHIFT) ? shift_mem : false;
+ ke.alt = (!(wParam == VK_MENU && (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN))) ? alt_mem : false;
+ ke.control = (wParam != VK_CONTROL) ? control_mem : false;
+ ke.meta = meta_mem;
ke.uMsg = uMsg;
if (ke.uMsg == WM_SYSKEYDOWN)
@@ -778,24 +769,25 @@ void OS_Windows::process_key_events() {
case WM_CHAR: {
if ((i == 0 && ke.uMsg == WM_CHAR) || (i > 0 && key_event_buffer[i - 1].uMsg == WM_CHAR)) {
- InputEvent event;
- event.type = InputEvent::KEY;
- event.ID = ++last_id;
- InputEventKey &k = event.key;
-
- k.mod = ke.mod_state;
- k.pressed = true;
- k.scancode = KeyMappingWindows::get_keysym(ke.wParam);
- k.unicode = ke.wParam;
- if (k.unicode && gr_mem) {
- k.mod.alt = false;
- k.mod.control = false;
+ Ref<InputEventKey> k;
+ k.instance();
+
+ k->set_shift(ke.shift);
+ k->set_alt(ke.alt);
+ k->set_control(ke.control);
+ k->set_metakey(ke.meta);
+ k->set_pressed(true);
+ k->set_scancode(KeyMappingWindows::get_keysym(ke.wParam));
+ k->set_unicode(ke.wParam);
+ if (k->get_unicode() && gr_mem) {
+ k->set_alt(false);
+ k->set_control(false);
}
- if (k.unicode < 32)
- k.unicode = 0;
+ if (k->get_unicode() < 32)
+ k->set_unicode(0);
- input->parse_input_event(event);
+ input->parse_input_event(k);
}
//do nothing
@@ -803,28 +795,37 @@ void OS_Windows::process_key_events() {
case WM_KEYUP:
case WM_KEYDOWN: {
- InputEvent event;
- event.type = InputEvent::KEY;
- event.ID = ++last_id;
- InputEventKey &k = event.key;
+ Ref<InputEventKey> k;
+ k.instance();
+
+ k->set_shift(ke.shift);
+ k->set_alt(ke.alt);
+ k->set_control(ke.control);
+ k->set_metakey(ke.meta);
- k.mod = ke.mod_state;
- k.pressed = (ke.uMsg == WM_KEYDOWN);
+ k->set_pressed(ke.uMsg == WM_KEYDOWN);
- k.scancode = KeyMappingWindows::get_keysym(ke.wParam);
- if (i + 1 < key_event_pos && key_event_buffer[i + 1].uMsg == WM_CHAR)
- k.unicode = key_event_buffer[i + 1].wParam;
- if (k.unicode && gr_mem) {
- k.mod.alt = false;
- k.mod.control = false;
+ if ((ke.lParam & (1 << 24)) && (ke.wParam == VK_RETURN)) {
+ // Special case for Numpad Enter key
+ k->set_scancode(KEY_KP_ENTER);
+ } else {
+ k->set_scancode(KeyMappingWindows::get_keysym(ke.wParam));
+ }
+
+ if (i + 1 < key_event_pos && key_event_buffer[i + 1].uMsg == WM_CHAR) {
+ k->set_unicode(key_event_buffer[i + 1].wParam);
+ }
+ if (k->get_unicode() && gr_mem) {
+ k->set_alt(false);
+ k->set_control(false);
}
- if (k.unicode < 32)
- k.unicode = 0;
+ if (k->get_unicode() < 32)
+ k->set_unicode(0);
- k.echo = (ke.uMsg == WM_KEYDOWN && (ke.lParam & (1 << 30)));
+ k->set_echo((ke.uMsg == WM_KEYDOWN && (ke.lParam & (1 << 30))));
- input->parse_input_event(event);
+ input->parse_input_event(k);
} break;
}
@@ -888,23 +889,6 @@ static int QueryDpiForMonitor(HMONITOR hmon, _MonitorDpiType dpiType = MDT_Defau
return (dpiX + dpiY) / 2;
}
-BOOL CALLBACK OS_Windows::MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) {
- OS_Windows *self = (OS_Windows *)OS::get_singleton();
- MonitorInfo minfo;
- minfo.hMonitor = hMonitor;
- minfo.hdcMonitor = hdcMonitor;
- minfo.rect.pos.x = lprcMonitor->left;
- minfo.rect.pos.y = lprcMonitor->top;
- minfo.rect.size.x = lprcMonitor->right - lprcMonitor->left;
- minfo.rect.size.y = lprcMonitor->bottom - lprcMonitor->top;
-
- minfo.dpi = QueryDpiForMonitor(hMonitor);
-
- self->monitor_info.push_back(minfo);
-
- return TRUE;
-}
-
void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
main_loop = NULL;
@@ -940,9 +924,6 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
return; // Return
}
- EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, 0);
-
- print_line("DETECTED MONITORS: " + itos(monitor_info.size()));
pre_fs_valid = true;
if (video_mode.fullscreen) {
@@ -1033,12 +1014,10 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
#endif
visual_server = memnew(VisualServerRaster);
- // FIXME: Reimplement threaded rendering? Or remove?
- /*
- if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) {
- visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD));
+ if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
+
+ visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
}
- */
physics_server = memnew(PhysicsServerSW);
physics_server->init();
@@ -1193,10 +1172,6 @@ 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);
@@ -1222,8 +1197,6 @@ void OS_Windows::finalize() {
physics_2d_server->finish();
memdelete(physics_2d_server);
-
- monitor_info.clear();
}
void OS_Windows::finalize_core() {
@@ -1324,7 +1297,7 @@ void OS_Windows::warp_mouse_pos(const Point2 &p_to) {
}
}
-Point2 OS_Windows::get_mouse_pos() const {
+Point2 OS_Windows::get_mouse_position() const {
return Point2(old_x, old_y);
}
@@ -1349,51 +1322,131 @@ OS::VideoMode OS_Windows::get_video_mode(int p_screen) const {
void OS_Windows::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) const {
}
+static BOOL CALLBACK _MonitorEnumProcCount(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) {
+
+ int *data = (int *)dwData;
+ (*data)++;
+ return TRUE;
+}
+
int OS_Windows::get_screen_count() const {
- return monitor_info.size();
+ int data = 0;
+ EnumDisplayMonitors(NULL, NULL, _MonitorEnumProcCount, (LPARAM)&data);
+ return data;
}
-int OS_Windows::get_current_screen() const {
- HMONITOR monitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST);
- for (int i = 0; i < monitor_info.size(); i++) {
- if (monitor_info[i].hMonitor == monitor)
- return i;
+typedef struct {
+ int count;
+ int screen;
+ HMONITOR monitor;
+} EnumScreenData;
+
+static BOOL CALLBACK _MonitorEnumProcScreen(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) {
+
+ EnumScreenData *data = (EnumScreenData *)dwData;
+ if (data->monitor == hMonitor) {
+ data->screen = data->count;
}
- return 0;
+ data->count++;
+ return TRUE;
}
-void OS_Windows::set_current_screen(int p_screen) {
- ERR_FAIL_INDEX(p_screen, monitor_info.size());
+int OS_Windows::get_current_screen() const {
+
+ EnumScreenData data = { 0, 0, MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST) };
+ EnumDisplayMonitors(NULL, NULL, _MonitorEnumProcScreen, (LPARAM)&data);
+ return data.screen;
+}
+
+void OS_Windows::set_current_screen(int p_screen) {
Vector2 ofs = get_window_position() - get_screen_position(get_current_screen());
set_window_position(ofs + get_screen_position(p_screen));
}
+typedef struct {
+ int count;
+ int screen;
+ Point2 pos;
+} EnumPosData;
+
+static BOOL CALLBACK _MonitorEnumProcPos(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) {
+
+ EnumPosData *data = (EnumPosData *)dwData;
+ if (data->count == data->screen) {
+ data->pos.x = lprcMonitor->left;
+ data->pos.y = lprcMonitor->top;
+ }
+
+ data->count++;
+ return TRUE;
+}
+
Point2 OS_Windows::get_screen_position(int p_screen) const {
- ERR_FAIL_INDEX_V(p_screen, monitor_info.size(), Point2());
- return Vector2(monitor_info[p_screen].rect.pos);
+ EnumPosData data = { 0, p_screen, Point2() };
+ EnumDisplayMonitors(NULL, NULL, _MonitorEnumProcPos, (LPARAM)&data);
+ return data.pos;
}
+
+typedef struct {
+ int count;
+ int screen;
+ Size2 size;
+} EnumSizeData;
+
+static BOOL CALLBACK _MonitorEnumProcSize(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) {
+
+ EnumSizeData *data = (EnumSizeData *)dwData;
+ if (data->count == data->screen) {
+ data->size.x = lprcMonitor->right - lprcMonitor->left;
+ data->size.y = lprcMonitor->bottom - lprcMonitor->top;
+ }
+
+ data->count++;
+ return TRUE;
+}
+
Size2 OS_Windows::get_screen_size(int p_screen) const {
- ERR_FAIL_INDEX_V(p_screen, monitor_info.size(), Point2());
- return Vector2(monitor_info[p_screen].rect.size);
+ EnumSizeData data = { 0, p_screen, Size2() };
+ EnumDisplayMonitors(NULL, NULL, _MonitorEnumProcSize, (LPARAM)&data);
+ return data.size;
+}
+
+typedef struct {
+ int count;
+ int screen;
+ int dpi;
+} EnumDpiData;
+
+static BOOL CALLBACK _MonitorEnumProcDpi(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) {
+
+ EnumDpiData *data = (EnumDpiData *)dwData;
+ if (data->count == data->screen) {
+ data->dpi = QueryDpiForMonitor(hMonitor);
+ }
+
+ data->count++;
+ return TRUE;
}
int OS_Windows::get_screen_dpi(int p_screen) const {
- ERR_FAIL_INDEX_V(p_screen, monitor_info.size(), 72);
- UINT dpix, dpiy;
- return monitor_info[p_screen].dpi;
+ EnumDpiData data = { 0, p_screen, 72 };
+ EnumDisplayMonitors(NULL, NULL, _MonitorEnumProcDpi, (LPARAM)&data);
+ return data.dpi;
}
+
Point2 OS_Windows::get_window_position() const {
RECT r;
GetWindowRect(hWnd, &r);
return Point2(r.left, r.top);
}
+
void OS_Windows::set_window_position(const Point2 &p_position) {
if (video_mode.fullscreen) return;
@@ -1416,28 +1469,21 @@ void OS_Windows::set_window_size(const Size2 p_size) {
return;
}
- RECT crect;
- GetClientRect(hWnd, &crect);
+ int w = p_size.width;
+ int h = p_size.height;
RECT rect;
GetWindowRect(hWnd, &rect);
- int dx = (rect.right - rect.left) - (crect.right - crect.left);
- int dy = (rect.bottom - rect.top) - (crect.bottom - crect.top);
- rect.right = rect.left + p_size.width + dx;
- rect.bottom = rect.top + p_size.height + dy;
+ if (video_mode.borderless_window == false) {
+ RECT crect;
+ GetClientRect(hWnd, &crect);
- //print_line("PRE: "+itos(rect.left)+","+itos(rect.top)+","+itos(rect.right-rect.left)+","+itos(rect.bottom-rect.top));
-
- /*if (video_mode.resizable) {
- AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE);
- } else {
- AdjustWindowRect(&rect, WS_CAPTION | WS_POPUPWINDOW, FALSE);
- }*/
-
- //print_line("POST: "+itos(rect.left)+","+itos(rect.top)+","+itos(rect.right-rect.left)+","+itos(rect.bottom-rect.top));
+ w += (rect.right - rect.left) - (crect.right - crect.left);
+ h += (rect.bottom - rect.top) - (crect.bottom - crect.top);
+ }
- MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
+ MoveWindow(hWnd, rect.left, rect.top, w, h, TRUE);
}
void OS_Windows::set_window_fullscreen(bool p_enabled) {
@@ -1457,21 +1503,18 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) {
Point2 pos = get_screen_position(cs);
Size2 size = get_screen_size(cs);
- /* r.left = pos.x;
- r.top = pos.y;
- r.bottom = pos.y+size.y;
- r.right = pos.x+size.x;
-*/
- SetWindowLongPtr(hWnd, GWL_STYLE,
- WS_SYSMENU | WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE);
- MoveWindow(hWnd, pos.x, pos.y, size.width, size.height, TRUE);
-
video_mode.fullscreen = true;
+ _update_window_style(false);
+
+ MoveWindow(hWnd, pos.x, pos.y, size.width, size.height, TRUE);
+
} else {
RECT rect;
+ video_mode.fullscreen = false;
+
if (pre_fs_valid) {
rect = pre_fs_rect;
} else {
@@ -1481,35 +1524,12 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) {
rect.bottom = video_mode.height;
}
- if (video_mode.resizable) {
+ _update_window_style(false);
- SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE);
- //AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE);
- MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
- } else {
-
- SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE);
- //AdjustWindowRect(&rect, WS_CAPTION | WS_POPUPWINDOW, FALSE);
- MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
- }
+ MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
- video_mode.fullscreen = false;
pre_fs_valid = true;
- /*
- DWORD dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
- DWORD dwStyle=WS_OVERLAPPEDWINDOW;
- if (!video_mode.resizable) {
- dwStyle &= ~WS_THICKFRAME;
- dwStyle &= ~WS_MAXIMIZEBOX;
- }
- AdjustWindowRectEx(&pre_fs_rect, dwStyle, FALSE, dwExStyle);
- video_mode.fullscreen=false;
- video_mode.width=pre_fs_rect.right-pre_fs_rect.left;
- video_mode.height=pre_fs_rect.bottom-pre_fs_rect.top;
-*/
}
-
- //MoveWindow(hWnd,r.left,r.top,p_size.x,p_size.y,TRUE);
}
bool OS_Windows::is_window_fullscreen() const {
@@ -1519,30 +1539,10 @@ void OS_Windows::set_window_resizable(bool p_enabled) {
if (video_mode.resizable == p_enabled)
return;
- /*
- GetWindowRect(hWnd,&pre_fs_rect);
- DWORD dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
- DWORD dwStyle=WS_OVERLAPPEDWINDOW;
- if (!p_enabled) {
- dwStyle &= ~WS_THICKFRAME;
- dwStyle &= ~WS_MAXIMIZEBOX;
- }
- AdjustWindowRectEx(&pre_fs_rect, dwStyle, FALSE, dwExStyle);
- */
-
- if (!video_mode.fullscreen) {
- if (p_enabled) {
- SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE);
- } else {
- SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_VISIBLE);
- }
-
- RECT rect;
- GetWindowRect(hWnd, &rect);
- MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
- }
video_mode.resizable = p_enabled;
+
+ _update_window_style();
}
bool OS_Windows::is_window_resizable() const {
@@ -1582,13 +1582,66 @@ bool OS_Windows::is_window_maximized() const {
}
void OS_Windows::set_borderless_window(int p_borderless) {
+ if (video_mode.borderless_window == p_borderless)
+ return;
+
video_mode.borderless_window = p_borderless;
+
+ _update_window_style();
}
bool OS_Windows::get_borderless_window() {
return video_mode.borderless_window;
}
+void OS_Windows::_update_window_style(bool repaint) {
+ if (video_mode.fullscreen || video_mode.borderless_window) {
+ SetWindowLongPtr(hWnd, GWL_STYLE, WS_SYSMENU | WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE);
+ } else {
+ if (video_mode.resizable) {
+ SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE);
+ } else {
+ SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_VISIBLE);
+ }
+ }
+
+ if (repaint) {
+ RECT rect;
+ GetWindowRect(hWnd, &rect);
+ MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
+ }
+}
+
+Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_handle) {
+ p_library_handle = (void *)LoadLibrary(p_path.utf8().get_data());
+ if (!p_library_handle) {
+ ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + String::num(GetLastError()));
+ ERR_FAIL_V(ERR_CANT_OPEN);
+ }
+ return OK;
+}
+
+Error OS_Windows::close_dynamic_library(void *p_library_handle) {
+ if (!FreeLibrary((HMODULE)p_library_handle)) {
+ return FAILED;
+ }
+ return OK;
+}
+
+Error OS_Windows::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional) {
+ char *error;
+ p_symbol_handle = (void *)GetProcAddress((HMODULE)p_library_handle, p_name.utf8().get_data());
+ if (!p_symbol_handle) {
+ if (!p_optional) {
+ ERR_EXPLAIN("Can't resolve symbol " + p_name + ". Error: " + String::num(GetLastError()));
+ ERR_FAIL_V(ERR_CANT_RESOLVE);
+ } else {
+ return ERR_CANT_RESOLVE;
+ }
+ }
+ return OK;
+}
+
void OS_Windows::request_attention() {
FLASHWINFO info;
@@ -1819,7 +1872,7 @@ void OS_Windows::process_events() {
MSG msg;
- last_id = joypad->process_joypads(last_id);
+ joypad->process_joypads();
while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) {
@@ -1953,7 +2006,7 @@ Error OS_Windows::kill(const ProcessID &p_pid) {
return ret != 0 ? OK : FAILED;
};
-int OS_Windows::get_process_ID() const {
+int OS_Windows::get_process_id() const {
return _getpid();
}
@@ -1970,17 +2023,17 @@ String OS_Windows::get_executable_path() const {
wchar_t bufname[4096];
GetModuleFileNameW(NULL, bufname, 4096);
String s = bufname;
- print_line("EXEC PATHP??: " + s);
return s;
}
-void OS_Windows::set_icon(const Image &p_icon) {
+void OS_Windows::set_icon(const Ref<Image> &p_icon) {
- Image icon = p_icon;
- if (icon.get_format() != Image::FORMAT_RGBA8)
- icon.convert(Image::FORMAT_RGBA8);
- int w = icon.get_width();
- int h = icon.get_height();
+ ERR_FAIL_COND(!p_icon.is_valid());
+ Ref<Image> icon = p_icon->duplicate();
+ if (icon->get_format() != Image::FORMAT_RGBA8)
+ icon->convert(Image::FORMAT_RGBA8);
+ int w = icon->get_width();
+ int h = icon->get_height();
/* Create temporary bitmap buffer */
int icon_len = 40 + h * w * 4;
@@ -2001,7 +2054,7 @@ void OS_Windows::set_icon(const Image &p_icon) {
encode_uint32(0, &icon_bmp[36]);
uint8_t *wr = &icon_bmp[40];
- PoolVector<uint8_t>::Read r = icon.get_data().read();
+ PoolVector<uint8_t>::Read r = icon->get_data().read();
for (int i = 0; i < h; i++) {
@@ -2239,7 +2292,7 @@ String OS_Windows::get_data_dir() const {
if (has_environment("APPDATA")) {
- bool use_godot = GlobalConfig::get_singleton()->get("application/use_shared_user_dir");
+ bool use_godot = ProjectSettings::get_singleton()->get("application/config/use_shared_user_dir");
if (!use_godot)
return (OS::get_singleton()->get_environment("APPDATA") + "/" + an).replace("\\", "/");
else
@@ -2247,7 +2300,7 @@ String OS_Windows::get_data_dir() const {
}
}
- return GlobalConfig::get_singleton()->get_resource_path();
+ return ProjectSettings::get_singleton()->get_resource_path();
}
bool OS_Windows::is_joy_known(int p_device) {
@@ -2284,9 +2337,9 @@ int OS_Windows::get_power_percent_left() {
return power_manager->get_power_percent_left();
}
-bool OS_Windows::check_feature_support(const String &p_feature) {
+bool OS_Windows::_check_internal_feature_support(const String &p_feature) {
- return VisualServer::get_singleton()->has_os_feature(p_feature);
+ return p_feature == "pc" || p_feature == "s3tc";
}
OS_Windows::OS_Windows(HINSTANCE _hInstance) {
@@ -2303,7 +2356,6 @@ OS_Windows::OS_Windows(HINSTANCE _hInstance) {
hInstance = _hInstance;
pressrc = 0;
old_invalid = true;
- last_id = 0;
mouse_mode = MOUSE_MODE_VISIBLE;
#ifdef STDOUT_FILE
stdo = fopen("stdout.txt", "wb");
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index e7376d6800..e9af14f11c 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -67,7 +68,7 @@ class OS_Windows : public OS {
struct KeyEvent {
- InputModifierState mod_state;
+ bool alt, shift, control, meta;
UINT uMsg;
WPARAM wParam;
LPARAM lParam;
@@ -83,7 +84,6 @@ class OS_Windows : public OS {
bool outside;
int old_x, old_y;
Point2i center;
- unsigned int last_id;
#if defined(OPENGL_ENABLED)
ContextGL_Win *gl_context;
#endif
@@ -133,6 +133,8 @@ class OS_Windows : public OS {
void _drag_event(int p_x, int p_y, int idx);
void _touch_event(bool p_pressed, int p_x, int p_y, int idx);
+ void _update_window_style(bool repaint = true);
+
// functions used by main to initialize/deintialize the OS
protected:
virtual int get_video_driver_count() const;
@@ -162,22 +164,12 @@ protected:
};
Map<ProcessID, ProcessInfo> *process_map;
- struct MonitorInfo {
- HMONITOR hMonitor;
- HDC hdcMonitor;
- Rect2 rect;
- int dpi;
- };
-
bool pre_fs_valid;
RECT pre_fs_rect;
- Vector<MonitorInfo> monitor_info;
bool maximized;
bool minimized;
bool borderless;
- static BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData);
-
public:
LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
@@ -191,7 +183,7 @@ public:
MouseMode get_mouse_mode() const;
virtual void warp_mouse_pos(const Point2 &p_to);
- virtual Point2 get_mouse_pos() const;
+ virtual Point2 get_mouse_position() const;
virtual int get_mouse_button_state() const;
virtual void set_window_title(const String &p_title);
@@ -223,6 +215,10 @@ public:
virtual void set_borderless_window(int p_borderless);
virtual bool get_borderless_window();
+ virtual Error open_dynamic_library(const String p_path, void *&p_library_handle);
+ virtual Error close_dynamic_library(void *p_library_handle);
+ virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false);
+
virtual MainLoop *get_main_loop() const;
virtual String get_name();
@@ -241,7 +237,7 @@ public:
virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL);
virtual Error kill(const ProcessID &p_pid);
- virtual int get_process_ID() const;
+ virtual int get_process_id() const;
virtual bool has_environment(const String &p_var) const;
virtual String get_environment(const String &p_var) const;
@@ -250,7 +246,7 @@ public:
virtual String get_clipboard() const;
void set_cursor_shape(CursorShape p_shape);
- void set_icon(const Image &p_icon);
+ void set_icon(const Ref<Image> &p_icon);
virtual String get_executable_path() const;
@@ -282,7 +278,7 @@ public:
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
- virtual bool check_feature_support(const String &p_feature);
+ virtual bool _check_internal_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 d98b64df7c..3991a90423 100644
--- a/platform/windows/packet_peer_udp_winsock.cpp
+++ b/platform/windows/packet_peer_udp_winsock.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -117,7 +118,7 @@ void PacketPeerUDPWinsock::_set_sock_blocking(bool p_blocking) {
};
}
-Error PacketPeerUDPWinsock::listen(int p_port, IP_Address p_bind_address, int p_recv_buffer_size) {
+Error PacketPeerUDPWinsock::listen(int p_port, const 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);
@@ -202,6 +203,8 @@ Error PacketPeerUDPWinsock::_poll(bool p_wait) {
len = sizeof(struct sockaddr_storage);
++queue_count;
+ if (p_wait)
+ break;
};
if (ret == SOCKET_ERROR) {
diff --git a/platform/windows/packet_peer_udp_winsock.h b/platform/windows/packet_peer_udp_winsock.h
index 6b37aefead..01f2e5113f 100644
--- a/platform/windows/packet_peer_udp_winsock.h
+++ b/platform/windows/packet_peer_udp_winsock.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -66,7 +67,7 @@ public:
virtual int get_max_packet_size() const;
- virtual Error listen(int p_port, IP_Address p_bind_address = IP_Address("*"), int p_recv_buffer_size = 65536);
+ virtual Error listen(int p_port, const 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/platform_config.h b/platform/windows/platform_config.h
index 0e16753156..a0fc65ca89 100644
--- a/platform/windows/platform_config.h
+++ b/platform/windows/platform_config.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/power_windows.cpp b/platform/windows/power_windows.cpp
index d4641cd4ec..428bc5dcc2 100644
--- a/platform/windows/power_windows.cpp
+++ b/platform/windows/power_windows.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,6 +28,31 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+/*
+Adapted from corresponding SDL 2.0 code.
+*/
+
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+
#include "power_windows.h"
// CODE CHUNK IMPORTED FROM SDL 2.0
diff --git a/platform/windows/power_windows.h b/platform/windows/power_windows.h
index 5c26faa3d1..164f1d7d95 100644
--- a/platform/windows/power_windows.h
+++ b/platform/windows/power_windows.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/stream_peer_winsock.cpp b/platform/windows/stream_peer_winsock.cpp
index abf182c72a..18c5a40b80 100644
--- a/platform/windows/stream_peer_winsock.cpp
+++ b/platform/windows/stream_peer_winsock.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/stream_peer_winsock.h b/platform/windows/stream_peer_winsock.h
index c8c2dd4feb..aa60a6500b 100644
--- a/platform/windows/stream_peer_winsock.h
+++ b/platform/windows/stream_peer_winsock.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/tcp_server_winsock.cpp b/platform/windows/tcp_server_winsock.cpp
index 67713f5d1c..cc17c8a631 100644
--- a/platform/windows/tcp_server_winsock.cpp
+++ b/platform/windows/tcp_server_winsock.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -62,7 +63,7 @@ void TCPServerWinsock::cleanup() {
};
};
-Error TCPServerWinsock::listen(uint16_t p_port, const IP_Address p_bind_address) {
+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);
diff --git a/platform/windows/tcp_server_winsock.h b/platform/windows/tcp_server_winsock.h
index d7b1aee054..077acb94d7 100644
--- a/platform/windows/tcp_server_winsock.h
+++ b/platform/windows/tcp_server_winsock.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -39,7 +40,7 @@ class TCPServerWinsock : public TCP_Server {
static TCP_Server *_create();
public:
- virtual Error listen(uint16_t p_port, const IP_Address p_bind_address = IP_Address("*"));
+ 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/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp
index 41d110a1e1..ddf17481b1 100644
--- a/platform/x11/context_gl_x11.cpp
+++ b/platform/x11/context_gl_x11.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -151,8 +152,6 @@ Error ContextGL_X11::initialize() {
XSync(x11_display, False);
XSetErrorHandler(oldHandler);
- print_line("ALL IS GOOD");
-
glXMakeCurrent(x11_display, x11_window, p->glx_context);
/*
diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h
index be0f4c822c..acb3f38894 100644
--- a/platform/x11/context_gl_x11.h
+++ b/platform/x11/context_gl_x11.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 89cf639114..79778136ad 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -1,7 +1,6 @@
-
import os
-import sys
import platform
+import sys
def is_active():
@@ -14,15 +13,12 @@ def get_name():
def can_build():
- if (os.name != "posix"):
+ if (os.name != "posix" or sys.platform == "darwin"):
return False
- if sys.platform == "darwin":
- return False # no x11 on mac for now
-
- errorval = os.system("pkg-config --version > /dev/null")
-
- if (errorval):
+ # Check the minimal dependencies
+ x11_error = os.system("pkg-config --version > /dev/null")
+ if (x11_error):
print("pkg-config not found.. x11 disabled.")
return False
@@ -31,11 +27,6 @@ def can_build():
print("X11 not found.. x11 disabled.")
return False
- ssl_error = os.system("pkg-config openssl --modversion > /dev/null ")
- if (ssl_error):
- print("OpenSSL not found.. x11 disabled.")
- return False
-
x11_error = os.system("pkg-config xcursor --modversion > /dev/null ")
if (x11_error):
print("xcursor not found.. x11 disabled.")
@@ -51,18 +42,18 @@ def can_build():
print("xrandr not found.. x11 disabled.")
return False
- return True # X11 enabled
+ return True
def get_opts():
return [
- ('use_llvm', 'Use llvm compiler', 'no'),
- ('use_static_cpp', 'link stdc++ statically', 'no'),
- ('use_sanitizer', 'Use llvm compiler sanitize address', 'no'),
- ('use_leak_sanitizer', 'Use llvm compiler sanitize memory leaks', 'no'),
+ ('use_llvm', 'Use the LLVM compiler', 'no'),
+ ('use_static_cpp', 'Link stdc++ statically', 'no'),
+ ('use_sanitizer', 'Use LLVM compiler address sanitizer', 'no'),
+ ('use_leak_sanitizer', 'Use LLVM compiler memory leaks sanitizer (implies use_sanitizer)', 'no'),
('use_lto', 'Use link time optimization', 'no'),
- ('pulseaudio', 'Detect & Use pulseaudio', 'yes'),
+ ('pulseaudio', 'Detect & use pulseaudio', 'yes'),
('udev', 'Use udev for gamepad connection callbacks', 'no'),
('debug_release', 'Add debug symbols to release version', 'no'),
]
@@ -80,67 +71,72 @@ def get_flags():
def configure(env):
- is64 = sys.maxsize > 2**32
+ ## Build type
+
+ if (env["target"] == "release"):
+ env.Prepend(CCFLAGS=['-Ofast'])
+ if (env["debug_release"] == "yes"):
+ env.Prepend(CCFLAGS=['-g2'])
+
+ elif (env["target"] == "release_debug"):
+ env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
+ if (env["debug_release"] == "yes"):
+ env.Prepend(CCFLAGS=['-g2'])
+ elif (env["target"] == "debug"):
+ env.Prepend(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+
+ ## Architecture
+
+ is64 = sys.maxsize > 2**32
if (env["bits"] == "default"):
- if (is64):
- env["bits"] = "64"
- else:
- env["bits"] = "32"
+ env["bits"] = "64" if is64 else "32"
+
+ ## Compiler configuration
- env.Append(CPPPATH=['#platform/x11'])
if (env["use_llvm"] == "yes"):
- if 'clang++' not in env['CXX']:
+ if ('clang++' not in env['CXX']):
env["CC"] = "clang"
env["CXX"] = "clang++"
env["LD"] = "clang++"
env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
- env.extra_suffix = ".llvm"
-
- if (env["use_sanitizer"] == "yes"):
- env.Append(CCFLAGS=['-fsanitize=address', '-fno-omit-frame-pointer'])
- env.Append(LINKFLAGS=['-fsanitize=address'])
- env.extra_suffix += "s"
+ env.extra_suffix = ".llvm" + env.extra_suffix
- if (env["use_leak_sanitizer"] == "yes"):
+ # leak sanitizer requires (address) sanitizer
+ if (env["use_sanitizer"] == "yes" or env["use_leak_sanitizer"] == "yes"):
env.Append(CCFLAGS=['-fsanitize=address', '-fno-omit-frame-pointer'])
env.Append(LINKFLAGS=['-fsanitize=address'])
env.extra_suffix += "s"
-
- # if (env["tools"]=="no"):
- # #no tools suffix
- # env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX']
- # env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX']
+ if (env["use_leak_sanitizer"] == "yes"):
+ env.Append(CCFLAGS=['-fsanitize=leak'])
+ env.Append(LINKFLAGS=['-fsanitize=leak'])
if (env["use_lto"] == "yes"):
env.Append(CCFLAGS=['-flto'])
env.Append(LINKFLAGS=['-flto'])
-
env.Append(CCFLAGS=['-pipe'])
env.Append(LINKFLAGS=['-pipe'])
- if (env["target"] == "release"):
- env.Prepend(CCFLAGS=['-Ofast'])
- if (env["debug_release"] == "yes"):
- env.Prepend(CCFLAGS=['-g2'])
-
- elif (env["target"] == "release_debug"):
-
- env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
- if (env["debug_release"] == "yes"):
- env.Prepend(CCFLAGS=['-g2'])
-
- elif (env["target"] == "debug"):
-
- env.Prepend(CCFLAGS=['-g2', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+ ## Dependencies
env.ParseConfig('pkg-config x11 --cflags --libs')
- env.ParseConfig('pkg-config xinerama --cflags --libs')
env.ParseConfig('pkg-config xcursor --cflags --libs')
+ env.ParseConfig('pkg-config xinerama --cflags --libs')
env.ParseConfig('pkg-config xrandr --cflags --libs')
+ # FIXME: Check for existence of the libs before parsing their flags with pkg-config
+
if (env['builtin_openssl'] == 'no'):
+ # Currently not compatible with OpenSSL 1.1.0+
+ # https://github.com/godotengine/godot/issues/8624
+ import subprocess
+ openssl_version = subprocess.check_output(['pkg-config', 'openssl', '--modversion']).strip('\n')
+ if (openssl_version >= "1.1.0"):
+ print("Error: Found system-installed OpenSSL %s, currently only supporting version 1.0.x." % openssl_version)
+ print("Aborting.. You can compile with 'builtin_openssl=yes' to use the bundled version.\n")
+ sys.exit(255)
+
env.ParseConfig('pkg-config openssl --cflags --libs')
if (env['builtin_libwebp'] == 'no'):
@@ -187,47 +183,51 @@ def configure(env):
if (env['builtin_libogg'] == 'no'):
env.ParseConfig('pkg-config ogg --cflags --libs')
- env.Append(CPPFLAGS=['-DOPENGL_ENABLED'])
+ if (env['builtin_libtheora'] != 'no'):
+ list_of_x86 = ['x86_64', 'x86', 'i386', 'i586']
+ if any(platform.machine() in s for s in list_of_x86):
+ env["x86_libtheora_opt_gcc"] = True
- if os.system("pkg-config --exists alsa") == 0:
+ ## Flags
+
+ if (os.system("pkg-config --exists alsa") == 0): # 0 means found
print("Enabling ALSA")
env.Append(CPPFLAGS=["-DALSA_ENABLED"])
env.ParseConfig('pkg-config alsa --cflags --libs')
else:
print("ALSA libraries not found, disabling driver")
- if (platform.system() == "Linux"):
- env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"])
- if (env["udev"] == "yes"):
- # pkg-config returns 0 when the lib exists...
- found_udev = not os.system("pkg-config --exists libudev")
-
- if (found_udev):
- print("Enabling udev support")
- env.Append(CPPFLAGS=["-DUDEV_ENABLED"])
- env.ParseConfig('pkg-config libudev --cflags --libs')
- else:
- print("libudev development libraries not found, disabling udev support")
-
if (env["pulseaudio"] == "yes"):
- if not os.system("pkg-config --exists libpulse-simple"):
+ if (os.system("pkg-config --exists libpulse-simple") == 0): # 0 means found
print("Enabling PulseAudio")
env.Append(CPPFLAGS=["-DPULSEAUDIO_ENABLED"])
env.ParseConfig('pkg-config --cflags --libs libpulse-simple')
else:
print("PulseAudio development libraries not found, disabling driver")
+ if (platform.system() == "Linux"):
+ env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"])
+
+ if (env["udev"] == "yes"):
+ if (os.system("pkg-config --exists libudev") == 0): # 0 means found
+ print("Enabling udev support")
+ env.Append(CPPFLAGS=["-DUDEV_ENABLED"])
+ env.ParseConfig('pkg-config libudev --cflags --libs')
+ else:
+ print("libudev development libraries not found, disabling udev support")
+
+ # Linkflags below this line should typically stay the last ones
if (env['builtin_zlib'] == 'no'):
env.ParseConfig('pkg-config zlib --cflags --libs')
- env.Append(CPPFLAGS=['-DX11_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
+ env.Append(CPPPATH=['#platform/x11'])
+ env.Append(CPPFLAGS=['-DX11_ENABLED', '-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
env.Append(LIBS=['GL', 'pthread'])
if (platform.system() == "Linux"):
env.Append(LIBS=['dl'])
- # env.Append(CPPFLAGS=['-DMPC_FIXED_POINT'])
-# host compiler is default..
+ ## Cross-compilation
if (is64 and env["bits"] == "32"):
env.Append(CPPFLAGS=['-m32'])
@@ -236,17 +236,5 @@ def configure(env):
env.Append(CPPFLAGS=['-m64'])
env.Append(LINKFLAGS=['-m64', '-L/usr/lib/i686-linux-gnu'])
- import methods
-
- # FIXME: Commented out when moving to gles3
- #env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')})
- #env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')})
- #env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')})
- #env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } )
-
if (env["use_static_cpp"] == "yes"):
env.Append(LINKFLAGS=['-static-libstdc++'])
-
- list_of_x86 = ['x86_64', 'x86', 'i386', 'i586']
- if any(platform.machine() in s for s in list_of_x86):
- env["x86_libtheora_opt_gcc"] = True
diff --git a/platform/x11/export/export.cpp b/platform/x11/export/export.cpp
index e58c55b51d..c8d6220aed 100644
--- a/platform/x11/export/export.cpp
+++ b/platform/x11/export/export.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,7 +29,7 @@
/*************************************************************************/
#include "export.h"
#include "editor/editor_export.h"
-#include "platform/x11/logo.h"
+#include "platform/x11/logo.gen.h"
#include "scene/resources/texture.h"
void register_x11_exporter() {
@@ -36,7 +37,7 @@ void register_x11_exporter() {
Ref<EditorExportPlatformPC> platform;
platform.instance();
- Image img(_x11_logo);
+ Ref<Image> img = memnew(Image(_x11_logo));
Ref<ImageTexture> logo;
logo.instance();
logo->create_from_image(img);
@@ -47,6 +48,7 @@ void register_x11_exporter() {
platform->set_debug_32("linux_x11_32_debug");
platform->set_release_64("linux_x11_64_release");
platform->set_debug_64("linux_x11_64_debug");
+ platform->set_os_name("X11");
EditorExport::get_singleton()->add_export_platform(platform);
diff --git a/platform/x11/export/export.h b/platform/x11/export/export.h
index 5beaba2cfb..755b73d2c9 100644
--- a/platform/x11/export/export.h
+++ b/platform/x11/export/export.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp
index 078baf76ee..6f418b213f 100644
--- a/platform/x11/godot_x11.cpp
+++ b/platform/x11/godot_x11.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,6 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include <limits.h>
+#include <locale.h>
#include <stdlib.h>
#include <unistd.h>
@@ -37,6 +39,8 @@ int main(int argc, char *argv[]) {
OS_X11 os;
+ setlocale(LC_CTYPE, "");
+
char *cwd = (char *)malloc(PATH_MAX);
getcwd(cwd, PATH_MAX);
diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp
index 62ece58f58..2502b2d51f 100644
--- a/platform/x11/joypad_linux.cpp
+++ b/platform/x11/joypad_linux.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -454,10 +455,10 @@ InputDefault::JoyAxis JoypadLinux::axis_correct(const input_absinfo *p_abs, int
return jx;
}
-uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) {
+void JoypadLinux::process_joypads() {
if (joy_mutex->try_lock() != OK) {
- return p_event_id;
+ return;
}
for (int i = 0; i < JOYPADS_MAX; i++) {
@@ -477,11 +478,11 @@ uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) {
// ev may be tainted and out of MAX_KEY range, which will cause
// joy->key_map[ev.code] to crash
if (ev.code < 0 || ev.code >= MAX_KEY)
- return p_event_id;
+ return;
switch (ev.type) {
case EV_KEY:
- p_event_id = input->joy_button(p_event_id, i, joy->key_map[ev.code], ev.value);
+ input->joy_button(i, joy->key_map[ev.code], ev.value);
break;
case EV_ABS:
@@ -496,7 +497,7 @@ uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) {
} else
joy->dpad &= ~(InputDefault::HAT_MASK_LEFT | InputDefault::HAT_MASK_RIGHT);
- p_event_id = input->joy_hat(p_event_id, i, joy->dpad);
+ input->joy_hat(i, joy->dpad);
break;
case ABS_HAT0Y:
@@ -508,7 +509,7 @@ uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) {
} else
joy->dpad &= ~(InputDefault::HAT_MASK_UP | InputDefault::HAT_MASK_DOWN);
- p_event_id = input->joy_hat(p_event_id, i, joy->dpad);
+ input->joy_hat(i, joy->dpad);
break;
default:
@@ -525,7 +526,7 @@ uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) {
for (int j = 0; j < MAX_ABS; j++) {
int index = joy->abs_map[j];
if (index != -1) {
- p_event_id = input->joy_axis(p_event_id, i, index, joy->curr_axis[index]);
+ input->joy_axis(i, index, joy->curr_axis[index]);
}
}
if (len == 0 || (len < 0 && errno != EAGAIN)) {
@@ -546,6 +547,5 @@ uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) {
}
}
joy_mutex->unlock();
- return p_event_id;
}
#endif
diff --git a/platform/x11/joypad_linux.h b/platform/x11/joypad_linux.h
index f90ca9319a..55383885a0 100644
--- a/platform/x11/joypad_linux.h
+++ b/platform/x11/joypad_linux.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -42,7 +43,7 @@ class JoypadLinux {
public:
JoypadLinux(InputDefault *in);
~JoypadLinux();
- uint32_t process_joypads(uint32_t p_event_id);
+ void process_joypads();
private:
enum {
@@ -79,22 +80,22 @@ private:
static void joy_thread_func(void *p_user);
- int get_joy_from_path(String path) const;
+ int get_joy_from_path(String p_path) const;
void setup_joypad_properties(int p_id);
void close_joypad(int p_id = -1);
#ifdef UDEV_ENABLED
- void enumerate_joypads(struct udev *_udev);
- void monitor_joypads(struct udev *_udev);
+ void enumerate_joypads(struct udev *p_udev);
+ void monitor_joypads(struct udev *p_udev);
#endif
void monitor_joypads();
void run_joypad_thread();
- void open_joypad(const char *path);
+ void open_joypad(const char *p_path);
void joypad_vibration_start(int p_id, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp);
void joypad_vibration_stop(int p_id, uint64_t p_timestamp);
- InputDefault::JoyAxis axis_correct(const input_absinfo *abs, int value) const;
+ InputDefault::JoyAxis axis_correct(const input_absinfo *p_abs, int p_value) const;
};
#endif
diff --git a/platform/x11/key_mapping_x11.cpp b/platform/x11/key_mapping_x11.cpp
index 4cfcffede0..32a9806b22 100644
--- a/platform/x11/key_mapping_x11.cpp
+++ b/platform/x11/key_mapping_x11.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,7 +44,7 @@ static _XTranslatePair _xkeysym_to_keycode[] = {
{ XK_Tab, KEY_TAB },
{ XK_ISO_Left_Tab, KEY_BACKTAB },
{ XK_BackSpace, KEY_BACKSPACE },
- { XK_Return, KEY_RETURN },
+ { XK_Return, KEY_ENTER },
{ XK_Insert, KEY_INSERT },
{ XK_Delete, KEY_DELETE },
{ XK_Clear, KEY_DELETE },
@@ -77,7 +78,7 @@ static _XTranslatePair _xkeysym_to_keycode[] = {
{ XK_Help, KEY_HELP },
{ XK_KP_Space, KEY_SPACE },
{ XK_KP_Tab, KEY_TAB },
- { XK_KP_Enter, KEY_ENTER },
+ { XK_KP_Enter, KEY_KP_ENTER },
{ XK_Home, KEY_HOME },
{ XK_Left, KEY_LEFT },
{ XK_Up, KEY_UP },
@@ -93,7 +94,6 @@ static _XTranslatePair _xkeysym_to_keycode[] = {
//{ XK_KP_Separator, KEY_COMMA },
{ XK_KP_Decimal, KEY_KP_PERIOD },
{ XK_KP_Delete, KEY_KP_PERIOD },
- { XK_KP_Enter, KEY_KP_ENTER },
{ XK_KP_Multiply, KEY_KP_MULTIPLY },
{ XK_KP_Divide, KEY_KP_DIVIDE },
{ XK_KP_Subtract, KEY_KP_SUBTRACT },
diff --git a/platform/x11/key_mapping_x11.h b/platform/x11/key_mapping_x11.h
index 8210df06e7..41060c9303 100644
--- a/platform/x11/key_mapping_x11.h
+++ b/platform/x11/key_mapping_x11.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index fe162370aa..ade3a0a0c5 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,6 +34,7 @@
#include "print_string.h"
#include "servers/physics/physics_server_sw.h"
#include "servers/visual/visual_server_raster.h"
+#include "servers/visual/visual_server_wrap_mt.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -66,6 +68,8 @@
#undef CursorShape
+#include <X11/XKBlib.h>
+
int OS_X11::get_video_driver_count() const {
return 1;
}
@@ -91,10 +95,10 @@ const char *OS_X11::get_audio_driver_name(int p_driver) const {
void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
+ long im_event_mask = 0;
last_button_state = 0;
xmbstring = NULL;
- event_id = 0;
x11_window = 0;
last_click_ms = 0;
args = OS::get_singleton()->get_cmdline_args();
@@ -112,7 +116,32 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
/** XLIB INITIALIZATION **/
x11_display = XOpenDisplay(NULL);
- char *modifiers = XSetLocaleModifiers("@im=none");
+ Bool xkb_dar = False;
+ if (x11_display) {
+ XAutoRepeatOn(x11_display);
+ xkb_dar = XkbSetDetectableAutoRepeat(x11_display, True, NULL);
+ }
+
+ char *modifiers = NULL;
+
+ // Try to support IME if detectable auto-repeat is supported
+
+ if (xkb_dar == True) {
+
+// Xutf8LookupString will be used later instead of XmbLookupString before
+// the multibyte sequences can be converted to unicode string.
+
+#ifdef X_HAVE_UTF8_STRING
+ modifiers = XSetLocaleModifiers("");
+#endif
+ }
+
+ if (modifiers == NULL) {
+ if (is_stdout_verbose()) {
+ WARN_PRINT("IME is disabled");
+ }
+ modifiers = XSetLocaleModifiers("@im=none");
+ }
if (modifiers == NULL) {
WARN_PRINT("Error setting locale modifiers");
}
@@ -152,6 +181,14 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
WARN_PRINT("XOpenIM failed");
xim_style = 0L;
} else {
+ ::XIMCallback im_destroy_callback;
+ im_destroy_callback.client_data = (::XPointer)(this);
+ im_destroy_callback.callback = (::XIMProc)(xim_destroy_callback);
+ if (XSetIMValues(xim, XNDestroyCallback, &im_destroy_callback,
+ NULL) != NULL) {
+ WARN_PRINT("Error setting XIM destroy callback");
+ }
+
::XIMStyles *xim_styles = NULL;
xim_style = 0L;
char *imvalret = NULL;
@@ -206,12 +243,12 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
#endif
visual_server = memnew(VisualServerRaster);
-#if 0
- if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) {
- visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD));
+ if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
+
+ visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
}
-#endif
+
// borderless fullscreen window mode
if (current_videomode.fullscreen) {
// needed for lxde/openbox, possibly others
@@ -241,6 +278,13 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
xev.xclient.data.l[2] = 0;
XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureNotifyMask, &xev);
+ } else if (current_videomode.borderless_window) {
+ Hints hints;
+ Atom property;
+ hints.flags = 2;
+ hints.decorations = 0;
+ property = XInternAtom(x11_display, "_MOTIF_WM_HINTS", True);
+ XChangeProperty(x11_display, x11_window, property, property, 32, PropModeReplace, (unsigned char *)&hints, 5);
}
// disable resizable window
@@ -302,7 +346,8 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
StructureNotifyMask |
SubstructureNotifyMask | SubstructureRedirectMask |
FocusChangeMask | PropertyChangeMask |
- ColormapChangeMask | OwnerGrabButtonMask;
+ ColormapChangeMask | OwnerGrabButtonMask |
+ im_event_mask;
XChangeWindowAttributes(x11_display, x11_window, CWEventMask, &new_attr);
@@ -326,6 +371,16 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
if (xim && xim_style) {
xic = XCreateIC(xim, XNInputStyle, xim_style, XNClientWindow, x11_window, XNFocusWindow, x11_window, (char *)NULL);
+ if (XGetICValues(xic, XNFilterEvents, &im_event_mask, NULL) != NULL) {
+ WARN_PRINT("XGetICValues couldn't obtain XNFilterEvents value");
+ XDestroyIC(xic);
+ xic = NULL;
+ }
+ if (xic) {
+ XSetICFocus(xic);
+ } else {
+ WARN_PRINT("XCreateIC couldn't create xic");
+ }
} else {
xic = NULL;
@@ -336,7 +391,9 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
cursor_theme = XcursorGetTheme(x11_display);
if (!cursor_theme) {
- WARN_PRINT("Could not find cursor theme");
+ if (is_stdout_verbose()) {
+ print_line("XcursorGetTheme could not get cursor theme");
+ }
cursor_theme = "default";
}
@@ -440,6 +497,30 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
joypad = memnew(JoypadLinux(input));
#endif
_ensure_data_dir();
+
+ power_manager = memnew(PowerX11);
+}
+
+void OS_X11::xim_destroy_callback(::XIM im, ::XPointer client_data,
+ ::XPointer call_data) {
+
+ WARN_PRINT("Input method stopped");
+ OS_X11 *os = reinterpret_cast<OS_X11 *>(client_data);
+ os->xim = NULL;
+ os->xic = NULL;
+}
+
+void OS_X11::set_ime_position(const Point2 &p_pos) {
+
+ if (!xic)
+ return;
+
+ ::XPoint spot;
+ spot.x = short(p_pos.x);
+ spot.y = short(p_pos.y);
+ XVaNestedList preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL);
+ XSetICValues(xic, XNPreeditAttributes, preedit_attr, NULL);
+ XFree(preedit_attr);
}
void OS_X11::finalize() {
@@ -448,10 +529,6 @@ 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) {
memdelete(debugger_connection_console);
@@ -489,8 +566,12 @@ void OS_X11::finalize() {
XcursorImageDestroy(img[i]);
};
- XDestroyIC(xic);
- XCloseIM(xim);
+ if (xic) {
+ XDestroyIC(xic);
+ }
+ if (xim) {
+ XCloseIM(xim);
+ }
XCloseDisplay(x11_display);
if (xmbstring)
@@ -548,7 +629,7 @@ void OS_X11::set_mouse_mode(MouseMode p_mode) {
XWarpPointer(x11_display, None, x11_window,
0, 0, 0, 0, (int)center.x, (int)center.y);
- input->set_mouse_pos(center);
+ input->set_mouse_position(center);
} else {
do_mouse_warp = false;
}
@@ -580,7 +661,7 @@ int OS_X11::get_mouse_button_state() const {
return last_button_state;
}
-Point2 OS_X11::get_mouse_pos() const {
+Point2 OS_X11::get_mouse_position() const {
return last_mouse_pos;
}
@@ -603,6 +684,16 @@ void OS_X11::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) con
}
void OS_X11::set_wm_fullscreen(bool p_enabled) {
+ if (p_enabled && !is_window_resizable()) {
+ // Set the window as resizable to prevent window managers to ignore the fullscreen state flag.
+ XSizeHints *xsh;
+
+ xsh = XAllocSizeHints();
+ xsh->flags = 0L;
+ XSetWMNormalHints(x11_display, x11_window, xsh);
+ XFree(xsh);
+ }
+
// Using EWMH -- Extened Window Manager Hints
XEvent xev;
Atom wm_state = XInternAtom(x11_display, "_NET_WM_STATE", False);
@@ -618,6 +709,23 @@ void OS_X11::set_wm_fullscreen(bool p_enabled) {
xev.xclient.data.l[2] = 0;
XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
+ XFlush(x11_display);
+
+ if (!p_enabled && !is_window_resizable()) {
+ // Reset the non-resizable flags if we un-set these before.
+ Size2 size = get_window_size();
+ XSizeHints *xsh;
+
+ xsh = XAllocSizeHints();
+ xsh->flags = PMinSize | PMaxSize;
+ xsh->min_width = size.x;
+ xsh->max_width = size.x;
+ xsh->min_height = size.y;
+ xsh->max_height = size.y;
+
+ XSetWMNormalHints(x11_display, x11_window, xsh);
+ XFree(xsh);
+ }
}
int OS_X11::get_screen_count() const {
@@ -937,6 +1045,25 @@ bool OS_X11::is_window_maximized() const {
return false;
}
+void OS_X11::set_borderless_window(int p_borderless) {
+
+ if (current_videomode.borderless_window == p_borderless)
+ return;
+
+ current_videomode.borderless_window = p_borderless;
+
+ Hints hints;
+ Atom property;
+ hints.flags = 2;
+ hints.decorations = current_videomode.borderless_window ? 0 : 1;
+ property = XInternAtom(x11_display, "_MOTIF_WM_HINTS", True);
+ XChangeProperty(x11_display, x11_window, property, property, 32, PropModeReplace, (unsigned char *)&hints, 5);
+}
+
+bool OS_X11::get_borderless_window() {
+ return current_videomode.borderless_window;
+}
+
void OS_X11::request_attention() {
// Using EWMH -- Extended Window Manager Hints
//
@@ -958,16 +1085,12 @@ void OS_X11::request_attention() {
XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
}
-InputModifierState OS_X11::get_key_modifier_state(unsigned int p_x11_state) {
-
- InputModifierState state;
+void OS_X11::get_key_modifier_state(unsigned int p_x11_state, Ref<InputEventWithModifiers> state) {
- state.shift = (p_x11_state & ShiftMask);
- state.control = (p_x11_state & ControlMask);
- state.alt = (p_x11_state & Mod1Mask /*|| p_x11_state&Mod5Mask*/); //altgr should not count as alt
- state.meta = (p_x11_state & Mod4Mask);
-
- return state;
+ state->set_shift((p_x11_state & ShiftMask));
+ state->set_control((p_x11_state & ControlMask));
+ state->set_alt((p_x11_state & Mod1Mask /*|| p_x11_state&Mod5Mask*/)); //altgr should not count as alt
+ state->set_metakey((p_x11_state & Mod4Mask));
}
unsigned int OS_X11::get_mouse_button_state(unsigned int p_x11_state) {
@@ -1042,9 +1165,61 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
xmblen = 8;
}
+ keysym_unicode = keysym_keycode;
+
if (xkeyevent->type == KeyPress && xic) {
Status status;
+#ifdef X_HAVE_UTF8_STRING
+ int utf8len = 8;
+ char *utf8string = (char *)memalloc(sizeof(char) * utf8len);
+ int utf8bytes = Xutf8LookupString(xic, xkeyevent, utf8string,
+ utf8len - 1, &keysym_unicode, &status);
+ if (status == XBufferOverflow) {
+ utf8len = utf8bytes + 1;
+ utf8string = (char *)memrealloc(utf8string, utf8len);
+ utf8bytes = Xutf8LookupString(xic, xkeyevent, utf8string,
+ utf8len - 1, &keysym_unicode, &status);
+ }
+ utf8string[utf8bytes] = '\0';
+
+ if (status == XLookupChars) {
+ bool keypress = xkeyevent->type == KeyPress;
+ unsigned int keycode = KeyMappingX11::get_keycode(keysym_keycode);
+ if (keycode >= 'a' && keycode <= 'z')
+ keycode -= 'a' - 'A';
+
+ String tmp;
+ tmp.parse_utf8(utf8string, utf8bytes);
+ for (int i = 0; i < tmp.length(); i++) {
+ Ref<InputEventKey> k;
+ k.instance();
+ if (keycode == 0 && tmp[i] == 0) {
+ continue;
+ }
+
+ get_key_modifier_state(xkeyevent->state, k);
+
+ k->set_unicode(tmp[i]);
+
+ k->set_pressed(keypress);
+
+ k->set_scancode(keycode);
+
+ k->set_echo(false);
+
+ if (k->get_scancode() == KEY_BACKTAB) {
+ //make it consistent across platforms.
+ k->set_scancode(KEY_TAB);
+ k->set_shift(true);
+ }
+
+ input->parse_input_event(k);
+ }
+ return;
+ }
+ memfree(utf8string);
+#else
do {
int mnbytes = XmbLookupString(xic, xkeyevent, xmbstring, xmblen - 1, &keysym_unicode, &status);
@@ -1055,6 +1230,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
xmbstring = (char *)memrealloc(xmbstring, xmblen);
}
} while (status == XBufferOverflow);
+#endif
}
/* Phase 2, obtain a pigui keycode from the keysym */
@@ -1083,11 +1259,6 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
bool keypress = xkeyevent->type == KeyPress;
- if (xkeyevent->type == KeyPress && xic) {
- if (XFilterEvent((XEvent *)xkeyevent, x11_window))
- return;
- }
-
if (keycode == 0 && unicode == 0)
return;
@@ -1099,24 +1270,29 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
//print_line("mod1: "+itos(xkeyevent->state&Mod1Mask)+" mod 5: "+itos(xkeyevent->state&Mod5Mask));
- InputModifierState state = get_key_modifier_state(xkeyevent->state);
+ Ref<InputEventKey> k;
+ k.instance();
+
+ get_key_modifier_state(xkeyevent->state, k);
/* Phase 6, determine echo character */
// Echo characters in X11 are a keyrelease and a keypress
// one after the other with the (almot) same timestamp.
// To detect them, i use XPeekEvent and check that their
- // difference in time is below a treshold.
+ // difference in time is below a threshold.
if (xkeyevent->type != KeyPress) {
+ p_echo = false;
+
// make sure there are events pending,
// so this call won't block.
if (XPending(x11_display) > 0) {
XEvent peek_event;
XPeekEvent(x11_display, &peek_event);
- // I'm using a treshold of 5 msecs,
+ // I'm using a threshold of 5 msecs,
// since sometimes there seems to be a little
// jitter. I'm still not convinced that all this approach
// is correct, but the xorg developers are
@@ -1142,41 +1318,48 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
/* Phase 7, send event to Window */
- InputEvent event;
- event.ID = ++event_id;
- event.type = InputEvent::KEY;
- event.device = 0;
- event.key.mod = state;
- event.key.pressed = keypress;
+ k->set_pressed(keypress);
if (keycode >= 'a' && keycode <= 'z')
keycode -= 'a' - 'A';
- event.key.scancode = keycode;
- event.key.unicode = unicode;
- event.key.echo = p_echo;
+ k->set_scancode(keycode);
+ k->set_unicode(unicode);
+ k->set_echo(p_echo);
- if (event.key.scancode == KEY_BACKTAB) {
+ if (k->get_scancode() == KEY_BACKTAB) {
//make it consistent across platforms.
- event.key.scancode = KEY_TAB;
- event.key.mod.shift = true;
+ k->set_scancode(KEY_TAB);
+ k->set_shift(true);
}
//don't set mod state if modifier keys are released by themselves
//else event.is_action() will not work correctly here
- if (!event.key.pressed) {
- if (event.key.scancode == KEY_SHIFT)
- event.key.mod.shift = false;
- else if (event.key.scancode == KEY_CONTROL)
- event.key.mod.control = false;
- else if (event.key.scancode == KEY_ALT)
- event.key.mod.alt = false;
- else if (event.key.scancode == KEY_META)
- event.key.mod.meta = false;
+ if (!k->is_pressed()) {
+ if (k->get_scancode() == KEY_SHIFT)
+ k->set_shift(false);
+ else if (k->get_scancode() == KEY_CONTROL)
+ k->set_control(false);
+ else if (k->get_scancode() == KEY_ALT)
+ k->set_alt(false);
+ else if (k->get_scancode() == KEY_META)
+ k->set_metakey(false);
}
- //printf("key: %x\n",event.key.scancode);
- input->parse_input_event(event);
+ bool last_is_pressed = Input::get_singleton()->is_key_pressed(k->get_scancode());
+ if (k->is_pressed()) {
+ if (last_is_pressed) {
+ k->set_echo(true);
+ }
+ } else {
+ //ignore
+ if (last_is_pressed == false) {
+ return;
+ }
+ }
+
+ //printf("key: %x\n",k->get_scancode());
+ input->parse_input_event(k);
}
struct Property {
@@ -1256,6 +1439,10 @@ void OS_X11::process_xevents() {
XEvent event;
XNextEvent(x11_display, &event);
+ if (XFilterEvent(&event, None)) {
+ continue;
+ }
+
switch (event.type) {
case Expose:
Main::force_redraw();
@@ -1298,6 +1485,9 @@ void OS_X11::process_xevents() {
ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
GrabModeAsync, GrabModeAsync, x11_window, None, CurrentTime);
}
+ if (xic) {
+ XSetICFocus(xic);
+ }
break;
case FocusOut:
@@ -1311,9 +1501,16 @@ void OS_X11::process_xevents() {
}
XUngrabPointer(x11_display, CurrentTime);
}
+ if (xic) {
+ XUnsetICFocus(xic);
+ }
break;
case ConfigureNotify:
+ if (xic) {
+ // Not portable.
+ set_ime_position(Point2(0, 1));
+ }
/* call resizeGLScene only if our window-size changed */
if ((event.xconfigure.width == current_videomode.width) &&
@@ -1333,23 +1530,20 @@ void OS_X11::process_xevents() {
event.xbutton.y = last_mouse_pos.y;
}
- InputEvent mouse_event;
- mouse_event.ID = ++event_id;
- mouse_event.type = InputEvent::MOUSE_BUTTON;
- mouse_event.device = 0;
- mouse_event.mouse_button.mod = get_key_modifier_state(event.xbutton.state);
- mouse_event.mouse_button.button_mask = get_mouse_button_state(event.xbutton.state);
- mouse_event.mouse_button.x = event.xbutton.x;
- mouse_event.mouse_button.y = event.xbutton.y;
- mouse_event.mouse_button.global_x = event.xbutton.x;
- mouse_event.mouse_button.global_y = event.xbutton.y;
- mouse_event.mouse_button.button_index = event.xbutton.button;
- if (mouse_event.mouse_button.button_index == 2)
- mouse_event.mouse_button.button_index = 3;
- else if (mouse_event.mouse_button.button_index == 3)
- mouse_event.mouse_button.button_index = 2;
-
- mouse_event.mouse_button.pressed = (event.type == ButtonPress);
+ Ref<InputEventMouseButton> mb;
+ mb.instance();
+
+ get_key_modifier_state(event.xbutton.state, mb);
+ mb->set_button_mask(get_mouse_button_state(event.xbutton.state));
+ mb->set_position(Vector2(event.xbutton.x, event.xbutton.y));
+ mb->set_global_position(mb->get_position());
+ mb->set_button_index(event.xbutton.button);
+ if (mb->get_button_index() == 2)
+ mb->set_button_index(3);
+ else if (mb->get_button_index() == 3)
+ mb->set_button_index(2);
+
+ mb->set_pressed((event.type == ButtonPress));
if (event.type == ButtonPress && event.xbutton.button == 1) {
@@ -1359,8 +1553,7 @@ void OS_X11::process_xevents() {
last_click_ms = 0;
last_click_pos = Point2(-100, -100);
- mouse_event.mouse_button.doubleclick = true;
- mouse_event.ID = ++event_id;
+ mb->set_doubleclick(true);
} else {
last_click_ms += diff;
@@ -1368,7 +1561,7 @@ void OS_X11::process_xevents() {
}
}
- input->parse_input_event(mouse_event);
+ input->parse_input_event(mb);
} break;
case MotionNotify: {
@@ -1446,23 +1639,16 @@ void OS_X11::process_xevents() {
Point2i rel = pos - last_mouse_pos;
- InputEvent motion_event;
- motion_event.ID = ++event_id;
- motion_event.type = InputEvent::MOUSE_MOTION;
- motion_event.device = 0;
+ Ref<InputEventMouseMotion> mm;
+ mm.instance();
- motion_event.mouse_motion.mod = get_key_modifier_state(event.xmotion.state);
- motion_event.mouse_motion.button_mask = get_mouse_button_state(event.xmotion.state);
- motion_event.mouse_motion.x = pos.x;
- motion_event.mouse_motion.y = pos.y;
- input->set_mouse_pos(pos);
- motion_event.mouse_motion.global_x = pos.x;
- motion_event.mouse_motion.global_y = pos.y;
- motion_event.mouse_motion.speed_x = input->get_last_mouse_speed().x;
- motion_event.mouse_motion.speed_y = input->get_last_mouse_speed().y;
-
- motion_event.mouse_motion.relative_x = rel.x;
- motion_event.mouse_motion.relative_y = rel.y;
+ get_key_modifier_state(event.xmotion.state, mm);
+ mm->set_button_mask(get_mouse_button_state(event.xmotion.state));
+ mm->set_position(pos);
+ mm->set_global_position(pos);
+ input->set_mouse_position(pos);
+ mm->set_speed(input->get_last_mouse_speed());
+ mm->set_relative(rel);
last_mouse_pos = pos;
@@ -1471,7 +1657,7 @@ void OS_X11::process_xevents() {
// this is so that the relative motion doesn't get messed up
// after we regain focus.
if (window_has_focus || !mouse_mode_grab)
- input->parse_input_event(motion_event);
+ input->parse_input_event(mm);
} break;
case KeyPress:
@@ -1670,7 +1856,7 @@ void OS_X11::set_clipboard(const String &p_text) {
XSetSelectionOwner(x11_display, XInternAtom(x11_display, "CLIPBOARD", 0), x11_window, CurrentTime);
};
-static String _get_clipboard(Atom p_source, Window x11_window, ::Display *x11_display, String p_internal_clipboard) {
+static String _get_clipboard_impl(Atom p_source, Window x11_window, ::Display *x11_display, String p_internal_clipboard, Atom target) {
String ret;
@@ -1687,7 +1873,7 @@ static String _get_clipboard(Atom p_source, Window x11_window, ::Display *x11_di
};
if (Sown != None) {
- XConvertSelection(x11_display, p_source, XA_STRING, selection,
+ XConvertSelection(x11_display, p_source, target, selection,
x11_window, CurrentTime);
XFlush(x11_display);
while (true) {
@@ -1727,6 +1913,18 @@ static String _get_clipboard(Atom p_source, Window x11_window, ::Display *x11_di
return ret;
}
+static String _get_clipboard(Atom p_source, Window x11_window, ::Display *x11_display, String p_internal_clipboard) {
+ String ret;
+ Atom utf8_atom = XInternAtom(x11_display, "UTF8_STRING", True);
+ if (utf8_atom != None) {
+ ret = _get_clipboard_impl(p_source, x11_window, x11_display, p_internal_clipboard, utf8_atom);
+ }
+ if (ret == "") {
+ ret = _get_clipboard_impl(p_source, x11_window, x11_display, p_internal_clipboard, XA_STRING);
+ }
+ return ret;
+}
+
String OS_X11::get_clipboard() const {
String ret;
@@ -1759,6 +1957,11 @@ Error OS_X11::shell_open(String p_uri) {
return ok;
}
+bool OS_X11::_check_internal_feature_support(const String &p_feature) {
+
+ return p_feature == "pc" || p_feature == "s3tc";
+}
+
String OS_X11::get_system_dir(SystemDir p_dir) const {
String xdgparam;
@@ -1861,15 +2064,15 @@ void OS_X11::alert(const String &p_alert, const String &p_title) {
execute("/usr/bin/xmessage", args, true);
}
-void OS_X11::set_icon(const Image &p_icon) {
+void OS_X11::set_icon(const Ref<Image> &p_icon) {
Atom net_wm_icon = XInternAtom(x11_display, "_NET_WM_ICON", False);
- if (!p_icon.empty()) {
- Image img = p_icon;
- img.convert(Image::FORMAT_RGBA8);
+ if (p_icon.is_valid()) {
+ Ref<Image> img = p_icon->duplicate();
+ img->convert(Image::FORMAT_RGBA8);
- int w = img.get_width();
- int h = img.get_height();
+ int w = img->get_width();
+ int h = img->get_height();
// We're using long to have wordsize (32Bit build -> 32 Bits, 64 Bit build -> 64 Bits
Vector<long> pd;
@@ -1879,7 +2082,7 @@ void OS_X11::set_icon(const Image &p_icon) {
pd[0] = w;
pd[1] = h;
- PoolVector<uint8_t>::Read r = img.get_data().read();
+ PoolVector<uint8_t>::Read r = img->get_data().read();
long *wr = &pd[2];
uint8_t const *pr = r.ptr();
@@ -1916,7 +2119,7 @@ void OS_X11::run() {
process_xevents(); // get rid of pending events
#ifdef JOYDEV_ENABLED
- event_id = joypad->process_joypads(event_id);
+ joypad->process_joypads();
#endif
if (Main::iteration() == true)
break;
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index cbda18c0bc..db70f8f84a 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -112,16 +113,18 @@ class OS_X11 : public OS_Unix {
::XIC xic;
::XIM xim;
::XIMStyle xim_style;
+ static void xim_destroy_callback(::XIM im, ::XPointer client_data,
+ ::XPointer call_data);
+
Point2i last_mouse_pos;
bool last_mouse_pos_valid;
Point2i last_click_pos;
uint64_t last_click_ms;
- unsigned int event_id;
uint32_t last_button_state;
PhysicsServer *physics_server;
unsigned int get_mouse_button_state(unsigned int p_x11_state);
- InputModifierState get_key_modifier_state(unsigned int p_x11_state);
+ void get_key_modifier_state(unsigned int p_x11_state, Ref<InputEventWithModifiers> state);
Physics2DServer *physics_2d_server;
MouseMode mouse_mode;
@@ -202,11 +205,11 @@ public:
MouseMode get_mouse_mode() const;
virtual void warp_mouse_pos(const Point2 &p_to);
- virtual Point2 get_mouse_pos() const;
+ virtual Point2 get_mouse_position() const;
virtual int get_mouse_button_state() const;
virtual void set_window_title(const String &p_title);
- virtual void set_icon(const Image &p_icon);
+ virtual void set_icon(const Ref<Image> &p_icon);
virtual MainLoop *get_main_loop() const;
@@ -247,6 +250,10 @@ public:
virtual bool is_window_maximized() const;
virtual void request_attention();
+ virtual void set_borderless_window(int p_borderless);
+ virtual bool get_borderless_window();
+ virtual void set_ime_position(const Point2 &p_pos);
+
virtual void move_window_to_foreground();
virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
@@ -262,6 +269,8 @@ public:
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
+ virtual bool _check_internal_feature_support(const String &p_feature);
+
void run();
OS_X11();
diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h
index 342270b74a..1a1de42b47 100644
--- a/platform/x11/platform_config.h
+++ b/platform/x11/platform_config.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/x11/power_x11.cpp b/platform/x11/power_x11.cpp
index 2f98d2f335..8e69a2223f 100644
--- a/platform/x11/power_x11.cpp
+++ b/platform/x11/power_x11.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,6 +28,31 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+/*
+Adapted from corresponding SDL 2.0 code.
+*/
+
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+
#include "power_x11.h"
#include <stdio.h>
@@ -145,25 +171,18 @@ void PowerX11::check_proc_acpi_battery(const char *node, bool *have_battery, boo
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;
- }
+ 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;
- }
+ maximum = cvt;
}
}
diff --git a/platform/x11/power_x11.h b/platform/x11/power_x11.h
index 7693a5b022..64ed5fe26a 100644
--- a/platform/x11/power_x11.h
+++ b/platform/x11/power_x11.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp
index f10bd2f303..366c3a8bd8 100644
--- a/scene/2d/animated_sprite.cpp
+++ b/scene/2d/animated_sprite.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,8 @@
#include "animated_sprite.h"
#include "os/os.h"
#include "scene/scene_string_names.h"
-#include "scene/scene_string_names.h"
+
+#define NORMAL_SUFFIX "_normal"
////////////////////////////
@@ -81,6 +83,7 @@ void SpriteFrames::add_animation(const StringName &p_anim) {
ERR_FAIL_COND(animations.has(p_anim));
animations[p_anim] = Anim();
+ animations[p_anim].normal_name = String(p_anim) + NORMAL_SUFFIX;
}
bool SpriteFrames::has_animation(const StringName &p_anim) const {
@@ -100,6 +103,7 @@ void SpriteFrames::rename_animation(const StringName &p_prev, const StringName &
Anim anim = animations[p_prev];
animations.erase(p_prev);
animations[p_next] = anim;
+ animations[p_next].normal_name = String(p_next) + NORMAL_SUFFIX;
}
Vector<String> SpriteFrames::_get_animation_list() const {
@@ -342,6 +346,7 @@ void AnimatedSprite::_notification(int p_what) {
update();
_change_notify("frame");
+ emit_signal(SceneStringNames::get_singleton()->frame_changed);
}
float to_process = MIN(timeout, remaining);
@@ -373,6 +378,8 @@ void AnimatedSprite::_notification(int p_what) {
return;
}
+ Ref<Texture> normal = frames->get_normal_frame(animation, frame);
+
//print_line("DECIDED TO DRAW");
RID ci = get_canvas_item();
@@ -399,7 +406,7 @@ void AnimatedSprite::_notification(int p_what) {
dst_rect.size.y = -dst_rect.size.y;
//texture->draw_rect(ci,dst_rect,false,modulate);
- texture->draw_rect_region(ci, dst_rect, Rect2(Vector2(), texture->get_size()));
+ texture->draw_rect_region(ci, dst_rect, Rect2(Vector2(), texture->get_size()), Color(1, 1, 1), false, normal);
//VisualServer::get_singleton()->canvas_item_add_texture_rect_region(ci,dst_rect,texture->get_rid(),src_rect,modulate);
} break;
@@ -610,8 +617,8 @@ String AnimatedSprite::get_configuration_warning() const {
void AnimatedSprite::_bind_methods() {
- 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(D_METHOD("set_sprite_frames", "sprite_frames"), &AnimatedSprite::set_sprite_frames);
+ ClassDB::bind_method(D_METHOD("get_sprite_frames"), &AnimatedSprite::get_sprite_frames);
ClassDB::bind_method(D_METHOD("set_animation", "animation"), &AnimatedSprite::set_animation);
ClassDB::bind_method(D_METHOD("get_animation"), &AnimatedSprite::get_animation);
diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h
index bc0e85b0ca..80defac079 100644
--- a/scene/2d/animated_sprite.h
+++ b/scene/2d/animated_sprite.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -46,6 +47,8 @@ class SpriteFrames : public Resource {
loop = true;
speed = 5;
}
+
+ StringName normal_name;
};
Map<StringName, Anim> animations;
@@ -88,6 +91,20 @@ public:
return E->get().frames[p_idx];
}
+ _FORCE_INLINE_ Ref<Texture> get_normal_frame(const StringName &p_anim, int p_idx) const {
+
+ const Map<StringName, Anim>::Element *E = animations.find(p_anim);
+ ERR_FAIL_COND_V(!E, Ref<Texture>());
+ ERR_FAIL_COND_V(p_idx < 0, Ref<Texture>());
+
+ const Map<StringName, Anim>::Element *EN = animations.find(E->get().normal_name);
+
+ if (!EN || p_idx >= EN->get().frames.size())
+ return Ref<Texture>();
+
+ return EN->get().frames[p_idx];
+ }
+
void set_frame(const StringName &p_anim, int p_idx, const Ref<Texture> &p_frame) {
Map<StringName, Anim>::Element *E = animations.find(p_anim);
ERR_FAIL_COND(!E);
diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp
index 61e8ee16a2..02a0509449 100644
--- a/scene/2d/area_2d.cpp
+++ b/scene/2d/area_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,7 +29,9 @@
/*************************************************************************/
#include "area_2d.h"
#include "scene/scene_string_names.h"
+#include "servers/audio_server.h"
#include "servers/physics_2d_server.h"
+
void Area2D::set_space_override_mode(SpaceOverride p_mode) {
space_override = p_mode;
@@ -328,7 +331,10 @@ void Area2D::_clear_monitoring() {
Object *obj = ObjectDB::get_instance(E->key());
Node *node = obj ? obj->cast_to<Node>() : NULL;
- ERR_CONTINUE(!node);
+
+ if (!node) //node may have been deleted in previous frame or at other legiminate point
+ continue;
+ //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);
@@ -356,7 +362,7 @@ void Area2D::_clear_monitoring() {
Object *obj = ObjectDB::get_instance(E->key());
Node *node = obj ? obj->cast_to<Node>() : NULL;
- if (!node) //node may have been deleted in previous frame, this should not be an error
+ if (!node) //node may have been deleted in previous frame or at other legiminate point
continue;
//ERR_CONTINUE(!node);
@@ -474,7 +480,7 @@ Array Area2D::get_overlapping_areas() const {
bool Area2D::overlaps_area(Node *p_area) const {
ERR_FAIL_NULL_V(p_area, false);
- const Map<ObjectID, AreaState>::Element *E = area_map.find(p_area->get_instance_ID());
+ const Map<ObjectID, AreaState>::Element *E = area_map.find(p_area->get_instance_id());
if (!E)
return false;
return E->get().in_tree;
@@ -483,7 +489,7 @@ bool Area2D::overlaps_area(Node *p_area) const {
bool Area2D::overlaps_body(Node *p_body) const {
ERR_FAIL_NULL_V(p_body, false);
- const Map<ObjectID, BodyState>::Element *E = body_map.find(p_body->get_instance_ID());
+ const Map<ObjectID, BodyState>::Element *E = body_map.find(p_body->get_instance_id());
if (!E)
return false;
return E->get().in_tree;
@@ -500,15 +506,15 @@ uint32_t Area2D::get_collision_mask() const {
return collision_mask;
}
-void Area2D::set_layer_mask(uint32_t p_mask) {
+void Area2D::set_collision_layer(uint32_t p_layer) {
- layer_mask = p_mask;
- Physics2DServer::get_singleton()->area_set_layer_mask(get_rid(), p_mask);
+ collision_layer = p_layer;
+ Physics2DServer::get_singleton()->area_set_collision_layer(get_rid(), p_layer);
}
-uint32_t Area2D::get_layer_mask() const {
+uint32_t Area2D::get_collision_layer() const {
- return layer_mask;
+ return collision_layer;
}
void Area2D::set_collision_mask_bit(int p_bit, bool p_value) {
@@ -526,19 +532,60 @@ bool Area2D::get_collision_mask_bit(int p_bit) const {
return get_collision_mask() & (1 << p_bit);
}
-void Area2D::set_layer_mask_bit(int p_bit, bool p_value) {
+void Area2D::set_collision_layer_bit(int p_bit, bool p_value) {
- uint32_t mask = get_layer_mask();
+ uint32_t layer = get_collision_layer();
if (p_value)
- mask |= 1 << p_bit;
+ layer |= 1 << p_bit;
else
- mask &= ~(1 << p_bit);
- set_layer_mask(mask);
+ layer &= ~(1 << p_bit);
+ set_collision_layer(layer);
+}
+
+bool Area2D::get_collision_layer_bit(int p_bit) const {
+
+ return get_collision_layer() & (1 << p_bit);
+}
+
+void Area2D::set_audio_bus_override(bool p_override) {
+
+ audio_bus_override = p_override;
+}
+
+bool Area2D::is_overriding_audio_bus() const {
+
+ return audio_bus_override;
}
-bool Area2D::get_layer_mask_bit(int p_bit) const {
+void Area2D::set_audio_bus(const StringName &p_audio_bus) {
- return get_layer_mask() & (1 << p_bit);
+ audio_bus = p_audio_bus;
+}
+
+StringName Area2D::get_audio_bus() const {
+
+ for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
+ if (AudioServer::get_singleton()->get_bus_name(i) == audio_bus) {
+ return audio_bus;
+ }
+ }
+ return "Master";
+}
+
+void Area2D::_validate_property(PropertyInfo &property) const {
+
+ if (property.name == "audio_bus_name") {
+
+ String options;
+ for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
+ if (i > 0)
+ options += ",";
+ String name = AudioServer::get_singleton()->get_bus_name(i);
+ options += name;
+ }
+
+ property.hint_string = options;
+ }
}
void Area2D::_bind_methods() {
@@ -576,14 +623,14 @@ void Area2D::_bind_methods() {
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(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(D_METHOD("set_collision_layer", "collision_layer"), &Area2D::set_collision_layer);
+ ClassDB::bind_method(D_METHOD("get_collision_layer"), &Area2D::get_collision_layer);
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(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(D_METHOD("set_collision_layer_bit", "bit", "value"), &Area2D::set_collision_layer_bit);
+ ClassDB::bind_method(D_METHOD("get_collision_layer_bit", "bit"), &Area2D::get_collision_layer_bit);
ClassDB::bind_method(D_METHOD("set_monitoring", "enable"), &Area2D::set_monitoring);
ClassDB::bind_method(D_METHOD("is_monitoring"), &Area2D::is_monitoring);
@@ -597,6 +644,12 @@ void Area2D::_bind_methods() {
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(D_METHOD("set_audio_bus", "name"), &Area2D::set_audio_bus);
+ ClassDB::bind_method(D_METHOD("get_audio_bus"), &Area2D::get_audio_bus);
+
+ ClassDB::bind_method(D_METHOD("set_audio_bus_override", "enable"), &Area2D::set_audio_bus_override);
+ ClassDB::bind_method(D_METHOD("is_overriding_audio_bus"), &Area2D::is_overriding_audio_bus);
+
ClassDB::bind_method(D_METHOD("_body_inout"), &Area2D::_body_inout);
ClassDB::bind_method(D_METHOD("_area_inout"), &Area2D::_area_inout);
@@ -621,8 +674,12 @@ void Area2D::_bind_methods() {
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), "set_layer_mask", "get_layer_mask");
+ ADD_PROPERTYNO(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_layer", "get_collision_layer");
ADD_PROPERTYNO(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_mask", "get_collision_mask");
+
+ ADD_GROUP("Audio Bus", "audio_bus_");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "audio_bus_override"), "set_audio_bus_override", "is_overriding_audio_bus");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "audio_bus_name", PROPERTY_HINT_ENUM, ""), "set_audio_bus", "get_audio_bus");
}
Area2D::Area2D()
@@ -640,7 +697,8 @@ Area2D::Area2D()
monitoring = false;
monitorable = false;
collision_mask = 1;
- layer_mask = 1;
+ collision_layer = 1;
+ audio_bus_override = false;
set_monitoring(true);
set_monitorable(true);
}
diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h
index 2402ff763b..12d71f3911 100644
--- a/scene/2d/area_2d.h
+++ b/scene/2d/area_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -54,7 +55,7 @@ private:
real_t linear_damp;
real_t angular_damp;
uint32_t collision_mask;
- uint32_t layer_mask;
+ uint32_t collision_layer;
int priority;
bool monitoring;
bool monitorable;
@@ -125,9 +126,13 @@ private:
Map<ObjectID, AreaState> area_map;
void _clear_monitoring();
+ bool audio_bus_override;
+ StringName audio_bus;
+
protected:
void _notification(int p_what);
static void _bind_methods();
+ void _validate_property(PropertyInfo &property) const;
public:
void set_space_override_mode(SpaceOverride p_mode);
@@ -163,14 +168,14 @@ public:
void set_collision_mask(uint32_t p_mask);
uint32_t get_collision_mask() const;
- void set_layer_mask(uint32_t p_mask);
- uint32_t get_layer_mask() const;
+ void set_collision_layer(uint32_t p_layer);
+ uint32_t get_collision_layer() const;
void set_collision_mask_bit(int p_bit, bool p_value);
bool get_collision_mask_bit(int p_bit) const;
- void set_layer_mask_bit(int p_bit, bool p_value);
- bool get_layer_mask_bit(int p_bit) const;
+ void set_collision_layer_bit(int p_bit, bool p_value);
+ bool get_collision_layer_bit(int p_bit) const;
Array get_overlapping_bodies() const; //function for script
Array get_overlapping_areas() const; //function for script
@@ -178,6 +183,12 @@ public:
bool overlaps_area(Node *p_area) const;
bool overlaps_body(Node *p_body) const;
+ void set_audio_bus_override(bool p_override);
+ bool is_overriding_audio_bus() const;
+
+ void set_audio_bus(const StringName &p_audio_bus);
+ StringName get_audio_bus() const;
+
Area2D();
~Area2D();
};
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp
new file mode 100644
index 0000000000..1423a804ff
--- /dev/null
+++ b/scene/2d/audio_stream_player_2d.cpp
@@ -0,0 +1,463 @@
+
+#include "audio_stream_player_2d.h"
+#include "scene/2d/area_2d.h"
+#include "scene/main/viewport.h"
+void AudioStreamPlayer2D::_mix_audio() {
+
+ if (!stream_playback.is_valid()) {
+ return;
+ }
+
+ if (!active) {
+ return;
+ }
+
+ if (setseek >= 0.0) {
+ stream_playback->start(setseek);
+ setseek = -1.0; //reset seek
+ }
+
+ //get data
+ AudioFrame *buffer = mix_buffer.ptr();
+ int buffer_size = mix_buffer.size();
+
+ //mix
+ stream_playback->mix(buffer, 1.0, buffer_size);
+
+ //write all outputs
+ for (int i = 0; i < output_count; i++) {
+
+ Output current = outputs[i];
+
+ //see if current output exists, to keep volume ramp
+ bool found = false;
+ for (int j = i; j < prev_output_count; j++) {
+ if (prev_outputs[j].viewport == current.viewport) {
+ if (j != i) {
+ SWAP(prev_outputs[j], prev_outputs[i]);
+ }
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ //create new if was not used before
+ if (prev_output_count < MAX_OUTPUTS) {
+ prev_outputs[prev_output_count] = prev_outputs[i]; //may be owned by another viewport
+ prev_output_count++;
+ }
+ prev_outputs[i] = current;
+ }
+
+ //mix!
+ AudioFrame vol_inc = (current.vol - prev_outputs[i].vol) / float(buffer_size);
+ AudioFrame vol = current.vol;
+
+ switch (AudioServer::get_singleton()->get_speaker_mode()) {
+
+ case AudioServer::SPEAKER_MODE_STEREO: {
+ AudioFrame *target = AudioServer::get_singleton()->thread_get_channel_mix_buffer(current.bus_index, 0);
+
+ for (int j = 0; j < buffer_size; j++) {
+
+ target[j] += buffer[j] * vol;
+ vol += vol_inc;
+ }
+
+ } break;
+ case AudioServer::SPEAKER_SURROUND_51: {
+
+ AudioFrame *targets[2] = {
+ AudioServer::get_singleton()->thread_get_channel_mix_buffer(current.bus_index, 1),
+ AudioServer::get_singleton()->thread_get_channel_mix_buffer(current.bus_index, 2),
+ };
+
+ for (int j = 0; j < buffer_size; j++) {
+
+ AudioFrame frame = buffer[j] * vol;
+ targets[0][j] += frame;
+ targets[1][j] += frame;
+ vol += vol_inc;
+ }
+
+ } break;
+ case AudioServer::SPEAKER_SURROUND_71: {
+
+ AudioFrame *targets[3] = {
+ AudioServer::get_singleton()->thread_get_channel_mix_buffer(current.bus_index, 1),
+ AudioServer::get_singleton()->thread_get_channel_mix_buffer(current.bus_index, 2),
+ AudioServer::get_singleton()->thread_get_channel_mix_buffer(current.bus_index, 3)
+ };
+
+ for (int j = 0; j < buffer_size; j++) {
+
+ AudioFrame frame = buffer[j] * vol;
+ targets[0][j] += frame;
+ targets[1][j] += frame;
+ targets[2][j] += frame;
+ vol += vol_inc;
+ }
+
+ } break;
+ }
+
+ prev_outputs[i] = current;
+ }
+
+ prev_output_count = output_count;
+
+ //stream is no longer active, disable this.
+ if (!stream_playback->is_playing()) {
+ active = false;
+ }
+
+ output_ready = false;
+}
+
+void AudioStreamPlayer2D::_notification(int p_what) {
+
+ if (p_what == NOTIFICATION_ENTER_TREE) {
+
+ AudioServer::get_singleton()->add_callback(_mix_audios, this);
+ if (autoplay && !get_tree()->is_editor_hint()) {
+ play();
+ }
+ }
+
+ if (p_what == NOTIFICATION_EXIT_TREE) {
+
+ AudioServer::get_singleton()->remove_callback(_mix_audios, this);
+ }
+
+ if (p_what == NOTIFICATION_INTERNAL_FIXED_PROCESS) {
+
+ //update anything related to position first, if possible of course
+
+ if (!output_ready) {
+ List<Viewport *> viewports;
+ Ref<World2D> world_2d = get_world_2d();
+ ERR_FAIL_COND(world_2d.is_null());
+
+ int new_output_count = 0;
+
+ Vector2 global_pos = get_global_position();
+
+ int bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus);
+
+ //check if any area is diverting sound into a bus
+
+ Physics2DDirectSpaceState *space_state = Physics2DServer::get_singleton()->space_get_direct_state(world_2d->get_space());
+
+ Physics2DDirectSpaceState::ShapeResult sr[MAX_INTERSECT_AREAS];
+
+ int areas = space_state->intersect_point(global_pos, sr, MAX_INTERSECT_AREAS, Set<RID>(), area_mask, Physics2DDirectSpaceState::TYPE_MASK_AREA);
+
+ for (int i = 0; i < areas; i++) {
+ if (!sr[i].collider)
+ continue;
+
+ Area2D *area2d = sr[i].collider->cast_to<Area2D>();
+ if (!area2d)
+ continue;
+
+ if (!area2d->is_overriding_audio_bus())
+ continue;
+
+ StringName bus_name = area2d->get_audio_bus();
+ bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus_name);
+ break;
+ }
+
+ world_2d->get_viewport_list(&viewports);
+ for (List<Viewport *>::Element *E = viewports.front(); E; E = E->next()) {
+
+ Viewport *vp = E->get();
+ if (vp->is_audio_listener_2d()) {
+
+ //compute matrix to convert to screen
+ Transform2D to_screen = vp->get_global_canvas_transform() * vp->get_canvas_transform();
+ Vector2 screen_size = vp->get_visible_rect().size;
+
+ //screen in global is used for attenuation
+ Vector2 screen_in_global = to_screen.affine_inverse().xform(screen_size * 0.5);
+
+ float dist = global_pos.distance_to(screen_in_global); //distance to screen center
+
+ if (dist > max_distance)
+ continue; //cant hear this sound in this viewport
+
+ float multiplier = Math::pow(1.0f - dist / max_distance, attenuation);
+ multiplier *= Math::db2linear(volume_db); //also apply player volume!
+
+ //point in screen is used for panning
+ Vector2 point_in_screen = to_screen.xform(global_pos);
+
+ float pan = CLAMP(point_in_screen.x / screen_size.width, 0.0, 1.0);
+
+ float l = 1.0 - pan;
+ float r = pan;
+
+ outputs[new_output_count].vol = AudioFrame(l, r) * multiplier;
+ outputs[new_output_count].bus_index = bus_index;
+ outputs[new_output_count].viewport = vp; //keep pointer only for reference
+ new_output_count++;
+ if (new_output_count == MAX_OUTPUTS)
+ break;
+ }
+ }
+
+ output_count = new_output_count;
+ output_ready = true;
+ }
+
+ //start playing if requested
+ if (setplay >= 0.0) {
+ setseek = setplay;
+ active = true;
+ setplay = -1;
+ _change_notify("playing"); //update property in editor
+ }
+
+ //stop playing if no longer active
+ if (!active) {
+ set_fixed_process_internal(false);
+ _change_notify("playing"); //update property in editor
+ }
+ }
+}
+
+void AudioStreamPlayer2D::set_stream(Ref<AudioStream> p_stream) {
+
+ ERR_FAIL_COND(!p_stream.is_valid());
+ AudioServer::get_singleton()->lock();
+
+ mix_buffer.resize(AudioServer::get_singleton()->thread_get_mix_buffer_size());
+
+ if (stream_playback.is_valid()) {
+ stream_playback.unref();
+ stream.unref();
+ active = false;
+ setseek = -1;
+ }
+
+ stream = p_stream;
+ stream_playback = p_stream->instance_playback();
+
+ if (stream_playback.is_null()) {
+ stream.unref();
+ ERR_FAIL_COND(stream_playback.is_null());
+ }
+
+ AudioServer::get_singleton()->unlock();
+}
+
+Ref<AudioStream> AudioStreamPlayer2D::get_stream() const {
+
+ return stream;
+}
+
+void AudioStreamPlayer2D::set_volume_db(float p_volume) {
+
+ volume_db = p_volume;
+}
+float AudioStreamPlayer2D::get_volume_db() const {
+
+ return volume_db;
+}
+
+void AudioStreamPlayer2D::play(float p_from_pos) {
+
+ if (stream_playback.is_valid()) {
+ setplay = p_from_pos;
+ output_ready = false;
+ set_fixed_process_internal(true);
+ }
+}
+
+void AudioStreamPlayer2D::seek(float p_seconds) {
+
+ if (stream_playback.is_valid()) {
+ setseek = p_seconds;
+ }
+}
+
+void AudioStreamPlayer2D::stop() {
+
+ if (stream_playback.is_valid()) {
+ active = false;
+ set_fixed_process_internal(false);
+ setplay = -1;
+ }
+}
+
+bool AudioStreamPlayer2D::is_playing() const {
+
+ if (stream_playback.is_valid()) {
+ return active; // && stream_playback->is_playing();
+ }
+
+ return false;
+}
+
+float AudioStreamPlayer2D::get_pos() {
+
+ if (stream_playback.is_valid()) {
+ return stream_playback->get_pos();
+ }
+
+ return 0;
+}
+
+void AudioStreamPlayer2D::set_bus(const StringName &p_bus) {
+
+ //if audio is active, must lock this
+ AudioServer::get_singleton()->lock();
+ bus = p_bus;
+ AudioServer::get_singleton()->unlock();
+}
+StringName AudioStreamPlayer2D::get_bus() const {
+
+ for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
+ if (AudioServer::get_singleton()->get_bus_name(i) == bus) {
+ return bus;
+ }
+ }
+ return "Master";
+}
+
+void AudioStreamPlayer2D::set_autoplay(bool p_enable) {
+
+ autoplay = p_enable;
+}
+bool AudioStreamPlayer2D::is_autoplay_enabled() {
+
+ return autoplay;
+}
+
+void AudioStreamPlayer2D::_set_playing(bool p_enable) {
+
+ if (p_enable)
+ play();
+ else
+ stop();
+}
+bool AudioStreamPlayer2D::_is_active() const {
+
+ return active;
+}
+
+void AudioStreamPlayer2D::_validate_property(PropertyInfo &property) const {
+
+ if (property.name == "bus") {
+
+ String options;
+ for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
+ if (i > 0)
+ options += ",";
+ String name = AudioServer::get_singleton()->get_bus_name(i);
+ options += name;
+ }
+
+ property.hint_string = options;
+ }
+}
+
+void AudioStreamPlayer2D::_bus_layout_changed() {
+
+ _change_notify();
+}
+
+void AudioStreamPlayer2D::set_max_distance(float p_pixels) {
+
+ ERR_FAIL_COND(p_pixels <= 0.0);
+ max_distance = p_pixels;
+}
+
+float AudioStreamPlayer2D::get_max_distance() const {
+
+ return max_distance;
+}
+
+void AudioStreamPlayer2D::set_attenuation(float p_curve) {
+
+ attenuation = p_curve;
+}
+float AudioStreamPlayer2D::get_attenuation() const {
+
+ return attenuation;
+}
+
+void AudioStreamPlayer2D::set_area_mask(uint32_t p_mask) {
+
+ area_mask = p_mask;
+}
+
+uint32_t AudioStreamPlayer2D::get_area_mask() const {
+
+ return area_mask;
+}
+
+void AudioStreamPlayer2D::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_stream", "stream"), &AudioStreamPlayer2D::set_stream);
+ ClassDB::bind_method(D_METHOD("get_stream"), &AudioStreamPlayer2D::get_stream);
+
+ ClassDB::bind_method(D_METHOD("set_volume_db", "volume_db"), &AudioStreamPlayer2D::set_volume_db);
+ ClassDB::bind_method(D_METHOD("get_volume_db"), &AudioStreamPlayer2D::get_volume_db);
+
+ ClassDB::bind_method(D_METHOD("play", "from_pos"), &AudioStreamPlayer2D::play, DEFVAL(0.0));
+ ClassDB::bind_method(D_METHOD("seek", "to_pos"), &AudioStreamPlayer2D::seek);
+ ClassDB::bind_method(D_METHOD("stop"), &AudioStreamPlayer2D::stop);
+
+ ClassDB::bind_method(D_METHOD("is_playing"), &AudioStreamPlayer2D::is_playing);
+ ClassDB::bind_method(D_METHOD("get_pos"), &AudioStreamPlayer2D::get_pos);
+
+ ClassDB::bind_method(D_METHOD("set_bus", "bus"), &AudioStreamPlayer2D::set_bus);
+ ClassDB::bind_method(D_METHOD("get_bus"), &AudioStreamPlayer2D::get_bus);
+
+ ClassDB::bind_method(D_METHOD("set_autoplay", "enable"), &AudioStreamPlayer2D::set_autoplay);
+ ClassDB::bind_method(D_METHOD("is_autoplay_enabled"), &AudioStreamPlayer2D::is_autoplay_enabled);
+
+ ClassDB::bind_method(D_METHOD("_set_playing", "enable"), &AudioStreamPlayer2D::_set_playing);
+ ClassDB::bind_method(D_METHOD("_is_active"), &AudioStreamPlayer2D::_is_active);
+
+ ClassDB::bind_method(D_METHOD("set_max_distance", "pixels"), &AudioStreamPlayer2D::set_max_distance);
+ ClassDB::bind_method(D_METHOD("get_max_distance"), &AudioStreamPlayer2D::get_max_distance);
+
+ ClassDB::bind_method(D_METHOD("set_attenuation", "curve"), &AudioStreamPlayer2D::set_attenuation);
+ ClassDB::bind_method(D_METHOD("get_attenuation"), &AudioStreamPlayer2D::get_attenuation);
+
+ ClassDB::bind_method(D_METHOD("set_area_mask", "mask"), &AudioStreamPlayer2D::set_area_mask);
+ ClassDB::bind_method(D_METHOD("get_area_mask"), &AudioStreamPlayer2D::get_area_mask);
+
+ ClassDB::bind_method(D_METHOD("_bus_layout_changed"), &AudioStreamPlayer2D::_bus_layout_changed);
+
+ 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::REAL, "max_distance", PROPERTY_HINT_RANGE, "1,65536,1"), "set_max_distance", "get_max_distance");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation", PROPERTY_HINT_EXP_EASING), "set_attenuation", "get_attenuation");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "area_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_area_mask", "get_area_mask");
+}
+
+AudioStreamPlayer2D::AudioStreamPlayer2D() {
+
+ volume_db = 0;
+ autoplay = false;
+ setseek = -1;
+ active = false;
+ output_count = 0;
+ prev_output_count = 0;
+ max_distance = 2000;
+ attenuation = 1;
+ setplay = -1;
+ output_ready = false;
+ area_mask = 1;
+ AudioServer::get_singleton()->connect("bus_layout_changed", this, "_bus_layout_changed");
+}
+
+AudioStreamPlayer2D::~AudioStreamPlayer2D() {
+}
diff --git a/scene/2d/audio_stream_player_2d.h b/scene/2d/audio_stream_player_2d.h
new file mode 100644
index 0000000000..25eff61b76
--- /dev/null
+++ b/scene/2d/audio_stream_player_2d.h
@@ -0,0 +1,96 @@
+#ifndef AUDIO_STREAM_PLAYER_2D_H
+#define AUDIO_STREAM_PLAYER_2D_H
+
+#include "scene/2d/node_2d.h"
+#include "servers/audio/audio_stream.h"
+#include "servers/audio_server.h"
+
+class AudioStreamPlayer2D : public Node2D {
+
+ GDCLASS(AudioStreamPlayer2D, Node2D)
+
+private:
+ enum {
+ MAX_OUTPUTS = 8,
+ MAX_INTERSECT_AREAS = 32
+
+ };
+
+ struct Output {
+
+ AudioFrame vol;
+ int bus_index;
+ Viewport *viewport; //pointer only used for reference to previous mix
+ };
+
+ Output outputs[MAX_OUTPUTS];
+ volatile int output_count;
+ volatile bool output_ready;
+
+ //these are used by audio thread to have a reference of previous volumes (for ramping volume and avoiding clicks)
+ Output prev_outputs[MAX_OUTPUTS];
+ int prev_output_count;
+
+ Ref<AudioStreamPlayback> stream_playback;
+ Ref<AudioStream> stream;
+ Vector<AudioFrame> mix_buffer;
+
+ volatile float setseek;
+ volatile bool active;
+ volatile float setplay;
+
+ float volume_db;
+ bool autoplay;
+ StringName bus;
+
+ void _mix_audio();
+ static void _mix_audios(void *self) { reinterpret_cast<AudioStreamPlayer2D *>(self)->_mix_audio(); }
+
+ void _set_playing(bool p_enable);
+ bool _is_active() const;
+
+ void _bus_layout_changed();
+
+ uint32_t area_mask;
+
+ float max_distance;
+ float attenuation;
+
+protected:
+ void _validate_property(PropertyInfo &property) const;
+ void _notification(int p_what);
+ static void _bind_methods();
+
+public:
+ void set_stream(Ref<AudioStream> p_stream);
+ Ref<AudioStream> get_stream() const;
+
+ void set_volume_db(float p_volume);
+ float get_volume_db() const;
+
+ void play(float p_from_pos = 0.0);
+ void seek(float p_seconds);
+ void stop();
+ bool is_playing() const;
+ float get_pos();
+
+ void set_bus(const StringName &p_bus);
+ StringName get_bus() const;
+
+ void set_autoplay(bool p_enable);
+ bool is_autoplay_enabled();
+
+ void set_max_distance(float p_pixels);
+ float get_max_distance() const;
+
+ void set_attenuation(float p_curve);
+ float get_attenuation() const;
+
+ void set_area_mask(uint32_t p_mask);
+ uint32_t get_area_mask() const;
+
+ AudioStreamPlayer2D();
+ ~AudioStreamPlayer2D();
+};
+
+#endif
diff --git a/scene/2d/back_buffer_copy.cpp b/scene/2d/back_buffer_copy.cpp
index 5a79cee6d0..748a527ca0 100644
--- a/scene/2d/back_buffer_copy.cpp
+++ b/scene/2d/back_buffer_copy.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/back_buffer_copy.h b/scene/2d/back_buffer_copy.h
index b4f83e7db1..4080f50696 100644
--- a/scene/2d/back_buffer_copy.h
+++ b/scene/2d/back_buffer_copy.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index f8388cdcc5..20571abdb9 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -119,20 +120,20 @@ Transform2D Camera2D::get_camera_transform() {
Rect2 screen_rect(-screen_offset + camera_pos, screen_size * zoom);
if (offset != Vector2())
- screen_rect.pos += offset;
+ screen_rect.position += offset;
if (limit_smoothing_enabled) {
- if (screen_rect.pos.x < limit[MARGIN_LEFT])
- camera_pos.x -= screen_rect.pos.x - limit[MARGIN_LEFT];
+ if (screen_rect.position.x < limit[MARGIN_LEFT])
+ camera_pos.x -= screen_rect.position.x - limit[MARGIN_LEFT];
- if (screen_rect.pos.x + screen_rect.size.x > limit[MARGIN_RIGHT])
- camera_pos.x -= screen_rect.pos.x + screen_rect.size.x - limit[MARGIN_RIGHT];
+ if (screen_rect.position.x + screen_rect.size.x > limit[MARGIN_RIGHT])
+ camera_pos.x -= screen_rect.position.x + screen_rect.size.x - limit[MARGIN_RIGHT];
- if (screen_rect.pos.y + screen_rect.size.y > limit[MARGIN_BOTTOM])
- camera_pos.y -= screen_rect.pos.y + screen_rect.size.y - limit[MARGIN_BOTTOM];
+ if (screen_rect.position.y + screen_rect.size.y > limit[MARGIN_BOTTOM])
+ camera_pos.y -= screen_rect.position.y + screen_rect.size.y - limit[MARGIN_BOTTOM];
- if (screen_rect.pos.y < limit[MARGIN_TOP])
- camera_pos.y -= screen_rect.pos.y - limit[MARGIN_TOP];
+ if (screen_rect.position.y < limit[MARGIN_TOP])
+ camera_pos.y -= screen_rect.position.y - limit[MARGIN_TOP];
}
if (smoothing_enabled && !get_tree()->is_editor_hint()) {
@@ -159,49 +160,47 @@ Transform2D Camera2D::get_camera_transform() {
}
Rect2 screen_rect(-screen_offset + ret_camera_pos, screen_size * zoom);
- if (screen_rect.pos.x < limit[MARGIN_LEFT])
- screen_rect.pos.x = limit[MARGIN_LEFT];
+ if (screen_rect.position.x < limit[MARGIN_LEFT])
+ screen_rect.position.x = limit[MARGIN_LEFT];
- if (screen_rect.pos.x + screen_rect.size.x > limit[MARGIN_RIGHT])
- screen_rect.pos.x = limit[MARGIN_RIGHT] - screen_rect.size.x;
+ if (screen_rect.position.x + screen_rect.size.x > limit[MARGIN_RIGHT])
+ screen_rect.position.x = limit[MARGIN_RIGHT] - screen_rect.size.x;
- if (screen_rect.pos.y + screen_rect.size.y > limit[MARGIN_BOTTOM])
- screen_rect.pos.y = limit[MARGIN_BOTTOM] - screen_rect.size.y;
+ if (screen_rect.position.y + screen_rect.size.y > limit[MARGIN_BOTTOM])
+ screen_rect.position.y = limit[MARGIN_BOTTOM] - screen_rect.size.y;
- if (screen_rect.pos.y < limit[MARGIN_TOP])
- screen_rect.pos.y = limit[MARGIN_TOP];
+ if (screen_rect.position.y < limit[MARGIN_TOP])
+ screen_rect.position.y = limit[MARGIN_TOP];
if (offset != Vector2()) {
- screen_rect.pos += offset;
- if (screen_rect.pos.x + screen_rect.size.x > limit[MARGIN_RIGHT])
- screen_rect.pos.x = limit[MARGIN_RIGHT] - screen_rect.size.x;
+ screen_rect.position += offset;
+ if (screen_rect.position.x + screen_rect.size.x > limit[MARGIN_RIGHT])
+ screen_rect.position.x = limit[MARGIN_RIGHT] - screen_rect.size.x;
- if (screen_rect.pos.y + screen_rect.size.y > limit[MARGIN_BOTTOM])
- screen_rect.pos.y = limit[MARGIN_BOTTOM] - screen_rect.size.y;
+ if (screen_rect.position.y + screen_rect.size.y > limit[MARGIN_BOTTOM])
+ screen_rect.position.y = limit[MARGIN_BOTTOM] - screen_rect.size.y;
- if (screen_rect.pos.x < limit[MARGIN_LEFT])
- screen_rect.pos.x = limit[MARGIN_LEFT];
+ if (screen_rect.position.x < limit[MARGIN_LEFT])
+ screen_rect.position.x = limit[MARGIN_LEFT];
- if (screen_rect.pos.y < limit[MARGIN_TOP])
- screen_rect.pos.y = limit[MARGIN_TOP];
+ if (screen_rect.position.y < limit[MARGIN_TOP])
+ screen_rect.position.y = limit[MARGIN_TOP];
}
- camera_screen_center = screen_rect.pos + screen_rect.size * 0.5;
+ camera_screen_center = screen_rect.position + screen_rect.size * 0.5;
Transform2D xform;
if (rotating) {
xform.set_rotation(angle);
}
xform.scale_basis(zoom);
- xform.set_origin(screen_rect.pos /*.floor()*/);
+ xform.set_origin(screen_rect.position /*.floor()*/);
/*
if (0) {
-
xform = get_global_transform() * xform;
} else {
-
xform.elements[2]+=get_global_transform().get_origin();
}
*/
@@ -266,25 +265,76 @@ void Camera2D::_notification(int p_what) {
if (!is_inside_tree() || !get_tree()->is_editor_hint())
break;
- Color area_axis_color(0.5, 0.42, 0.87, 0.63);
- float area_axis_width = 1;
- if (current)
- area_axis_width = 3;
+ if (screen_drawing_enabled) {
+ Color area_axis_color(0.5, 0.42, 0.87, 0.63);
+ float area_axis_width = 1;
+ if (is_current()) {
+ area_axis_width = 3;
+ area_axis_color.a = 0.83;
+ }
- Transform2D inv_camera_transform = get_camera_transform().affine_inverse();
- Size2 screen_size = get_viewport_rect().size;
+ Transform2D inv_camera_transform = get_camera_transform().affine_inverse();
+ Size2 screen_size = get_viewport_rect().size;
- Vector2 screen_endpoints[4] = {
- inv_camera_transform.xform(Vector2(0, 0)),
- inv_camera_transform.xform(Vector2(screen_size.width, 0)),
- inv_camera_transform.xform(Vector2(screen_size.width, screen_size.height)),
- inv_camera_transform.xform(Vector2(0, screen_size.height))
- };
+ Vector2 screen_endpoints[4] = {
+ inv_camera_transform.xform(Vector2(0, 0)),
+ inv_camera_transform.xform(Vector2(screen_size.width, 0)),
+ inv_camera_transform.xform(Vector2(screen_size.width, screen_size.height)),
+ inv_camera_transform.xform(Vector2(0, screen_size.height))
+ };
- Transform2D inv_transform = get_global_transform().affine_inverse(); // undo global space
+ Transform2D inv_transform = get_global_transform().affine_inverse(); // undo global space
- for (int i = 0; i < 4; i++) {
- draw_line(inv_transform.xform(screen_endpoints[i]), inv_transform.xform(screen_endpoints[(i + 1) % 4]), area_axis_color, area_axis_width);
+ for (int i = 0; i < 4; i++) {
+ draw_line(inv_transform.xform(screen_endpoints[i]), inv_transform.xform(screen_endpoints[(i + 1) % 4]), area_axis_color, area_axis_width);
+ }
+ }
+
+ if (limit_drawing_enabled) {
+ Color limit_drawing_color(1, 1, 0, 0.63);
+ float limit_drawing_width = 1;
+ if (is_current()) {
+ limit_drawing_color.a = 0.83;
+ limit_drawing_width = 3;
+ }
+
+ Vector2 camera_origin = get_global_transform().get_origin();
+ Vector2 camera_scale = get_global_transform().get_scale().abs();
+ Vector2 limit_points[4] = {
+ (Vector2(limit[MARGIN_LEFT], limit[MARGIN_TOP]) - camera_origin) / camera_scale,
+ (Vector2(limit[MARGIN_RIGHT], limit[MARGIN_TOP]) - camera_origin) / camera_scale,
+ (Vector2(limit[MARGIN_RIGHT], limit[MARGIN_BOTTOM]) - camera_origin) / camera_scale,
+ (Vector2(limit[MARGIN_LEFT], limit[MARGIN_BOTTOM]) - camera_origin) / camera_scale
+ };
+
+ for (int i = 0; i < 4; i++) {
+ draw_line(limit_points[i], limit_points[(i + 1) % 4], limit_drawing_color, limit_drawing_width);
+ }
+ }
+
+ if (margin_drawing_enabled) {
+ Color margin_drawing_color(0, 1, 1, 0.63);
+ float margin_drawing_width = 1;
+ if (is_current()) {
+ margin_drawing_width = 3;
+ margin_drawing_color.a = 0.83;
+ }
+
+ Transform2D inv_camera_transform = get_camera_transform().affine_inverse();
+ Size2 screen_size = get_viewport_rect().size;
+
+ Vector2 margin_endpoints[4] = {
+ inv_camera_transform.xform(Vector2((screen_size.width / 2) - ((screen_size.width / 2) * drag_margin[MARGIN_LEFT]), (screen_size.height / 2) - ((screen_size.height / 2) * drag_margin[MARGIN_TOP]))),
+ inv_camera_transform.xform(Vector2((screen_size.width / 2) + ((screen_size.width / 2) * drag_margin[MARGIN_RIGHT]), (screen_size.height / 2) - ((screen_size.height / 2) * drag_margin[MARGIN_TOP]))),
+ inv_camera_transform.xform(Vector2((screen_size.width / 2) + ((screen_size.width / 2) * drag_margin[MARGIN_RIGHT]), (screen_size.height / 2) + ((screen_size.height / 2) * drag_margin[MARGIN_BOTTOM]))),
+ inv_camera_transform.xform(Vector2((screen_size.width / 2) - ((screen_size.width / 2) * drag_margin[MARGIN_LEFT]), (screen_size.height / 2) + ((screen_size.height / 2) * drag_margin[MARGIN_BOTTOM])))
+ };
+
+ Transform2D inv_transform = get_global_transform().affine_inverse(); // undo global space
+
+ for (int i = 0; i < 4; i++) {
+ draw_line(inv_transform.xform(margin_endpoints[i]), inv_transform.xform(margin_endpoints[(i + 1) % 4]), margin_drawing_color, margin_drawing_width);
+ }
}
} break;
@@ -329,7 +379,6 @@ void Camera2D::_make_current(Object *p_which) {
if (p_which == this) {
current = true;
- _update_scroll();
} else {
current = false;
}
@@ -341,6 +390,7 @@ void Camera2D::_set_current(bool p_current) {
make_current();
current = p_current;
+ update();
}
bool Camera2D::is_current() const {
@@ -369,6 +419,7 @@ void Camera2D::set_limit(Margin p_margin, int p_limit) {
ERR_FAIL_INDEX(p_margin, 4);
limit[p_margin] = p_limit;
+ update();
}
int Camera2D::get_limit(Margin p_margin) const {
@@ -392,6 +443,7 @@ void Camera2D::set_drag_margin(Margin p_margin, float p_drag_margin) {
ERR_FAIL_INDEX(p_margin, 4);
drag_margin[p_margin] = p_drag_margin;
+ update();
}
float Camera2D::get_drag_margin(Margin p_margin) const {
@@ -500,11 +552,11 @@ float Camera2D::get_h_offset() const {
return h_ofs;
}
-void Camera2D::_set_old_smoothing(float p_val) {
+void Camera2D::_set_old_smoothing(float p_enable) {
//compatibility
- if (p_val > 0) {
+ if (p_enable > 0) {
smoothing_enabled = true;
- set_follow_smoothing(p_val);
+ set_follow_smoothing(p_enable);
}
}
@@ -528,7 +580,7 @@ void Camera2D::set_custom_viewport(Node *p_viewport) {
custom_viewport = p_viewport->cast_to<Viewport>();
if (custom_viewport) {
- custom_viewport_id = custom_viewport->get_instance_ID();
+ custom_viewport_id = custom_viewport->get_instance_id();
} else {
custom_viewport_id = 0;
}
@@ -553,6 +605,33 @@ Node *Camera2D::get_custom_viewport() const {
return custom_viewport;
}
+void Camera2D::set_screen_drawing_enabled(bool enable) {
+ screen_drawing_enabled = enable;
+ update();
+}
+
+bool Camera2D::is_screen_drawing_enabled() const {
+ return screen_drawing_enabled;
+}
+
+void Camera2D::set_limit_drawing_enabled(bool enable) {
+ limit_drawing_enabled = enable;
+ update();
+}
+
+bool Camera2D::is_limit_drawing_enabled() const {
+ return limit_drawing_enabled;
+}
+
+void Camera2D::set_margin_drawing_enabled(bool enable) {
+ margin_drawing_enabled = enable;
+ update();
+}
+
+bool Camera2D::is_margin_drawing_enabled() const {
+ return margin_drawing_enabled;
+}
+
void Camera2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_offset", "offset"), &Camera2D::set_offset);
@@ -600,8 +679,8 @@ void Camera2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_zoom", "zoom"), &Camera2D::set_zoom);
ClassDB::bind_method(D_METHOD("get_zoom"), &Camera2D::get_zoom);
- 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(D_METHOD("set_custom_viewport", "viewport"), &Camera2D::set_custom_viewport);
+ ClassDB::bind_method(D_METHOD("get_custom_viewport"), &Camera2D::get_custom_viewport);
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);
@@ -615,6 +694,15 @@ void Camera2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("_set_old_smoothing", "follow_smoothing"), &Camera2D::_set_old_smoothing);
+ ClassDB::bind_method(D_METHOD("set_screen_drawing_enabled", "screen_drawing_enabled"), &Camera2D::set_screen_drawing_enabled);
+ ClassDB::bind_method(D_METHOD("is_screen_drawing_enabled"), &Camera2D::is_screen_drawing_enabled);
+
+ ClassDB::bind_method(D_METHOD("set_limit_drawing_enabled", "limit_drawing_enabled"), &Camera2D::set_limit_drawing_enabled);
+ ClassDB::bind_method(D_METHOD("is_limit_drawing_enabled"), &Camera2D::is_limit_drawing_enabled);
+
+ ClassDB::bind_method(D_METHOD("set_margin_drawing_enabled", "margin_drawing_enabled"), &Camera2D::set_margin_drawing_enabled);
+ ClassDB::bind_method(D_METHOD("is_margin_drawing_enabled"), &Camera2D::is_margin_drawing_enabled);
+
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");
@@ -642,6 +730,11 @@ void Camera2D::_bind_methods() {
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);
+ ADD_GROUP("Editor", "editor_");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_draw_screen"), "set_screen_drawing_enabled", "is_screen_drawing_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_draw_limits"), "set_limit_drawing_enabled", "is_limit_drawing_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_draw_drag_margin"), "set_margin_drawing_enabled", "is_margin_drawing_enabled");
+
BIND_CONSTANT(ANCHOR_MODE_DRAG_CENTER);
BIND_CONSTANT(ANCHOR_MODE_FIXED_TOP_LEFT);
}
@@ -670,6 +763,10 @@ Camera2D::Camera2D() {
smoothing = 5.0;
zoom = Vector2(1, 1);
+ screen_drawing_enabled = true;
+ limit_drawing_enabled = false;
+ margin_drawing_enabled = false;
+
h_drag_enabled = true;
v_drag_enabled = true;
h_ofs = 0;
diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h
index 44cdb5cd99..8d9e76be85 100644
--- a/scene/2d/camera_2d.h
+++ b/scene/2d/camera_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -78,6 +79,10 @@ protected:
void _set_old_smoothing(float p_enable);
+ bool screen_drawing_enabled;
+ bool limit_drawing_enabled;
+ bool margin_drawing_enabled;
+
protected:
virtual Transform2D get_camera_transform();
void _notification(int p_what);
@@ -137,6 +142,15 @@ public:
void reset_smoothing();
void align();
+ void set_screen_drawing_enabled(bool enable);
+ bool is_screen_drawing_enabled() const;
+
+ void set_limit_drawing_enabled(bool enable);
+ bool is_limit_drawing_enabled() const;
+
+ void set_margin_drawing_enabled(bool enable);
+ bool is_margin_drawing_enabled() const;
+
Camera2D();
};
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp
index b52dd8d660..3d0b5047ae 100644
--- a/scene/2d/canvas_item.cpp
+++ b/scene/2d/canvas_item.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,6 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "canvas_item.h"
+#include "core/method_bind_ext.gen.inc"
#include "message_queue.h"
#include "os/input.h"
#include "scene/main/canvas_layer.h"
@@ -37,122 +39,194 @@
#include "scene/scene_string_names.h"
#include "servers/visual_server.h"
-bool CanvasItemMaterial::_set(const StringName &p_name, const Variant &p_value) {
+Mutex *CanvasItemMaterial::material_mutex = NULL;
+SelfList<CanvasItemMaterial>::List CanvasItemMaterial::dirty_materials;
+Map<CanvasItemMaterial::MaterialKey, CanvasItemMaterial::ShaderData> CanvasItemMaterial::shader_map;
- if (p_name == SceneStringNames::get_singleton()->shader_shader) {
- set_shader(p_value);
- return true;
- } else {
+void CanvasItemMaterial::init_shaders() {
- if (shader.is_valid()) {
+#ifndef NO_THREADS
+ material_mutex = Mutex::create();
+#endif
+}
- StringName pr = shader->remap_param(p_name);
- if (!pr) {
- String n = p_name;
- if (n.find("param/") == 0) { //backwards compatibility
- pr = n.substr(6, n.length());
- }
- }
- if (pr) {
- VisualServer::get_singleton()->material_set_param(_get_material(), pr, p_value);
- return true;
- }
- }
- }
+void CanvasItemMaterial::finish_shaders() {
- return false;
+#ifndef NO_THREADS
+ memdelete(material_mutex);
+#endif
}
-bool CanvasItemMaterial::_get(const StringName &p_name, Variant &r_ret) const {
+void CanvasItemMaterial::_update_shader() {
- if (p_name == SceneStringNames::get_singleton()->shader_shader) {
+ dirty_materials.remove(&element);
- r_ret = get_shader();
- return true;
+ MaterialKey mk = _compute_key();
+ if (mk.key == current_key.key)
+ return; //no update required in the end
- } else {
+ if (shader_map.has(current_key)) {
+ shader_map[current_key].users--;
+ if (shader_map[current_key].users == 0) {
+ //deallocate shader, as it's no longer in use
+ VS::get_singleton()->free(shader_map[current_key].shader);
+ shader_map.erase(current_key);
+ }
+ }
- if (shader.is_valid()) {
+ current_key = mk;
- StringName pr = shader->remap_param(p_name);
- if (pr) {
- r_ret = VisualServer::get_singleton()->material_get_param(_get_material(), pr);
- return true;
- }
- }
+ if (shader_map.has(mk)) {
+
+ VS::get_singleton()->material_set_shader(_get_material(), shader_map[mk].shader);
+ shader_map[mk].users++;
+ return;
}
- return false;
+ //must create a shader!
+
+ String code = "shader_type canvas_item;\nrender_mode ";
+ switch (blend_mode) {
+ case BLEND_MODE_MIX: code += "blend_mix"; break;
+ case BLEND_MODE_ADD: code += "blend_add"; break;
+ case BLEND_MODE_SUB: code += "blend_sub"; break;
+ case BLEND_MODE_MUL: code += "blend_mul"; break;
+ case BLEND_MODE_PREMULT_ALPHA: code += "blend_premul_alpha"; break;
+ }
+
+ switch (light_mode) {
+ case LIGHT_MODE_NORMAL: break;
+ case LIGHT_MODE_UNSHADED: code += ",unshaded"; break;
+ case LIGHT_MODE_LIGHT_ONLY: code += ",light_only"; break;
+ }
+ code += ";\n"; //thats it.
+
+ ShaderData shader_data;
+ shader_data.shader = VS::get_singleton()->shader_create();
+ shader_data.users = 1;
+
+ VS::get_singleton()->shader_set_code(shader_data.shader, code);
+
+ shader_map[mk] = shader_data;
+
+ VS::get_singleton()->material_set_shader(_get_material(), shader_data.shader);
}
-void CanvasItemMaterial::_get_property_list(List<PropertyInfo> *p_list) const {
+void CanvasItemMaterial::flush_changes() {
- p_list->push_back(PropertyInfo(Variant::OBJECT, "shader/shader", PROPERTY_HINT_RESOURCE_TYPE, "CanvasItemShader,CanvasItemShaderGraph"));
+ if (material_mutex)
+ material_mutex->lock();
- if (!shader.is_null()) {
+ while (dirty_materials.first()) {
- shader->get_param_list(p_list);
+ dirty_materials.first()->self()->_update_shader();
}
+
+ if (material_mutex)
+ material_mutex->unlock();
}
-void CanvasItemMaterial::set_shader(const Ref<Shader> &p_shader) {
+void CanvasItemMaterial::_queue_shader_change() {
- ERR_FAIL_COND(p_shader.is_valid() && p_shader->get_mode() != Shader::MODE_CANVAS_ITEM);
+ if (material_mutex)
+ material_mutex->lock();
- shader = p_shader;
+ if (!element.in_list()) {
+ dirty_materials.add(&element);
+ }
- RID rid;
- if (shader.is_valid())
- rid = shader->get_rid();
+ if (material_mutex)
+ material_mutex->unlock();
+}
+
+bool CanvasItemMaterial::_is_shader_dirty() const {
+
+ bool dirty = false;
+
+ if (material_mutex)
+ material_mutex->lock();
+
+ dirty = element.in_list();
- VS::get_singleton()->material_set_shader(_get_material(), rid);
- _change_notify(); //properties for shader exposed
- emit_changed();
+ if (material_mutex)
+ material_mutex->unlock();
+
+ return dirty;
}
+void CanvasItemMaterial::set_blend_mode(BlendMode p_blend_mode) {
-Ref<Shader> CanvasItemMaterial::get_shader() const {
+ blend_mode = p_blend_mode;
+ _queue_shader_change();
+}
- return shader;
+CanvasItemMaterial::BlendMode CanvasItemMaterial::get_blend_mode() const {
+ return blend_mode;
}
-void CanvasItemMaterial::set_shader_param(const StringName &p_param, const Variant &p_value) {
+void CanvasItemMaterial::set_light_mode(LightMode p_light_mode) {
- VS::get_singleton()->material_set_param(_get_material(), p_param, p_value);
+ light_mode = p_light_mode;
+ _queue_shader_change();
}
-Variant CanvasItemMaterial::get_shader_param(const StringName &p_param) const {
+CanvasItemMaterial::LightMode CanvasItemMaterial::get_light_mode() const {
- return VS::get_singleton()->material_get_param(_get_material(), p_param);
+ return light_mode;
+}
+
+void CanvasItemMaterial::_validate_property(PropertyInfo &property) const {
}
void CanvasItemMaterial::_bind_methods() {
- 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);
-}
+ ClassDB::bind_method(D_METHOD("set_blend_mode", "blend_mode"), &CanvasItemMaterial::set_blend_mode);
+ ClassDB::bind_method(D_METHOD("get_blend_mode"), &CanvasItemMaterial::get_blend_mode);
-void CanvasItemMaterial::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
+ ClassDB::bind_method(D_METHOD("set_light_mode", "light_mode"), &CanvasItemMaterial::set_light_mode);
+ ClassDB::bind_method(D_METHOD("get_light_mode"), &CanvasItemMaterial::get_light_mode);
- String f = p_function.operator String();
- if ((f == "get_shader_param" || f == "set_shader_param") && p_idx == 0) {
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "blend_mode", PROPERTY_HINT_ENUM, "Mix,Add,Sub,Mul,Premult Alpha"), "set_blend_mode", "get_blend_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "light_mode", PROPERTY_HINT_ENUM, "Normal,Unshaded,Light Only"), "set_light_mode", "get_light_mode");
- if (shader.is_valid()) {
- List<PropertyInfo> pl;
- shader->get_param_list(&pl);
- for (List<PropertyInfo>::Element *E = pl.front(); E; E = E->next()) {
- r_options->push_back("\"" + E->get().name.replace_first("shader_param/", "") + "\"");
- }
- }
- }
- Resource::get_argument_options(p_function, p_idx, r_options);
+ BIND_CONSTANT(BLEND_MODE_MIX);
+ BIND_CONSTANT(BLEND_MODE_ADD);
+ BIND_CONSTANT(BLEND_MODE_SUB);
+ BIND_CONSTANT(BLEND_MODE_MUL);
+ BIND_CONSTANT(BLEND_MODE_PREMULT_ALPHA);
+ BIND_CONSTANT(LIGHT_MODE_NORMAL);
+ BIND_CONSTANT(LIGHT_MODE_UNSHADED);
+ BIND_CONSTANT(LIGHT_MODE_LIGHT_ONLY);
}
-CanvasItemMaterial::CanvasItemMaterial() {
+CanvasItemMaterial::CanvasItemMaterial()
+ : element(this) {
+
+ blend_mode = BLEND_MODE_MIX;
+ light_mode = LIGHT_MODE_NORMAL;
+
+ current_key.key = 0;
+ current_key.invalid_key = 1;
+ _queue_shader_change();
}
CanvasItemMaterial::~CanvasItemMaterial() {
+
+ if (material_mutex)
+ material_mutex->lock();
+
+ if (shader_map.has(current_key)) {
+ shader_map[current_key].users--;
+ if (shader_map[current_key].users == 0) {
+ //deallocate shader, as it's no longer in use
+ VS::get_singleton()->free(shader_map[current_key].shader);
+ shader_map.erase(current_key);
+ }
+
+ VS::get_singleton()->material_set_shader(_get_material(), RID());
+ }
+
+ if (material_mutex)
+ material_mutex->unlock();
}
///////////////////////////////////////////////////////////////////
@@ -206,7 +280,7 @@ void CanvasItem::show() {
return;
_propagate_visibility_changed(true);
- _change_notify("visibility/visible");
+ _change_notify("visible");
}
void CanvasItem::hide() {
@@ -221,7 +295,7 @@ void CanvasItem::hide() {
return;
_propagate_visibility_changed(false);
- _change_notify("visibility/visible");
+ _change_notify("visible");
}
Variant CanvasItem::edit_get_state() const {
@@ -293,7 +367,9 @@ Transform2D CanvasItem::get_global_transform_with_canvas() const {
}
Transform2D CanvasItem::get_global_transform() const {
-
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_COND_V(!is_inside_tree(), get_transform());
+#endif
if (global_invalid) {
const CanvasItem *pi = get_parent_item();
@@ -533,14 +609,43 @@ void CanvasItem::draw_line(const Point2 &p_from, const Point2 &p_to, const Color
VisualServer::get_singleton()->canvas_item_add_line(canvas_item, p_from, p_to, p_color, p_width, p_antialiased);
}
-void CanvasItem::draw_rect(const Rect2 &p_rect, const Color &p_color) {
+void CanvasItem::draw_polyline(const Vector<Point2> &p_points, const Color &p_color, float p_width, bool p_antialiased) {
+
+ if (!drawing) {
+ ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
+ ERR_FAIL();
+ }
+
+ Vector<Color> colors;
+ colors.push_back(p_color);
+ VisualServer::get_singleton()->canvas_item_add_polyline(canvas_item, p_points, colors, p_width, p_antialiased);
+}
+
+void CanvasItem::draw_polyline_colors(const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width, bool p_antialiased) {
if (!drawing) {
ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
ERR_FAIL();
}
- VisualServer::get_singleton()->canvas_item_add_rect(canvas_item, p_rect, p_color);
+ VisualServer::get_singleton()->canvas_item_add_polyline(canvas_item, p_points, p_colors, p_width, p_antialiased);
+}
+void CanvasItem::draw_rect(const Rect2 &p_rect, const Color &p_color, bool p_filled) {
+
+ if (!drawing) {
+ ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
+ ERR_FAIL();
+ }
+
+ if (p_filled) {
+
+ VisualServer::get_singleton()->canvas_item_add_rect(canvas_item, p_rect, p_color);
+ } else {
+ VisualServer::get_singleton()->canvas_item_add_line(canvas_item, p_rect.position, p_rect.position + Size2(p_rect.size.width, 0), p_color);
+ VisualServer::get_singleton()->canvas_item_add_line(canvas_item, p_rect.position, p_rect.position + Size2(0, p_rect.size.height), p_color);
+ VisualServer::get_singleton()->canvas_item_add_line(canvas_item, p_rect.position + Point2(0, p_rect.size.height), p_rect.position + p_rect.size, p_color);
+ VisualServer::get_singleton()->canvas_item_add_line(canvas_item, p_rect.position + Point2(p_rect.size.width, 0), p_rect.position + p_rect.size, p_color);
+ }
}
void CanvasItem::draw_circle(const Point2 &p_pos, float p_radius, const Color &p_color) {
@@ -553,7 +658,7 @@ void CanvasItem::draw_circle(const Point2 &p_pos, float p_radius, const Color &p
VisualServer::get_singleton()->canvas_item_add_circle(canvas_item, p_pos, p_radius, p_color);
}
-void CanvasItem::draw_texture(const Ref<Texture> &p_texture, const Point2 &p_pos, const Color &p_modulate) {
+void CanvasItem::draw_texture(const Ref<Texture> &p_texture, const Point2 &p_pos, const Color &p_modulate, const Ref<Texture> &p_normal_map) {
if (!drawing) {
ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
@@ -565,7 +670,7 @@ void CanvasItem::draw_texture(const Ref<Texture> &p_texture, const Point2 &p_pos
p_texture->draw(canvas_item, p_pos, p_modulate);
}
-void CanvasItem::draw_texture_rect(const Ref<Texture> &p_texture, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose) {
+void CanvasItem::draw_texture_rect(const Ref<Texture> &p_texture, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) {
if (!drawing) {
ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
@@ -573,16 +678,16 @@ void CanvasItem::draw_texture_rect(const Ref<Texture> &p_texture, const Rect2 &p
}
ERR_FAIL_COND(p_texture.is_null());
- p_texture->draw_rect(canvas_item, p_rect, p_tile, p_modulate, p_transpose);
+ p_texture->draw_rect(canvas_item, p_rect, p_tile, p_modulate, p_transpose, p_normal_map);
}
-void CanvasItem::draw_texture_rect_region(const Ref<Texture> &p_texture, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose) {
+void CanvasItem::draw_texture_rect_region(const Ref<Texture> &p_texture, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map, bool p_clip_uv) {
if (!drawing) {
ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
ERR_FAIL();
}
ERR_FAIL_COND(p_texture.is_null());
- p_texture->draw_rect_region(canvas_item, p_rect, p_src_rect, p_modulate, p_transpose);
+ p_texture->draw_rect_region(canvas_item, p_rect, p_src_rect, p_modulate, p_transpose, p_normal_map, p_clip_uv);
}
void CanvasItem::draw_style_box(const Ref<StyleBox> &p_style_box, const Rect2 &p_rect) {
@@ -595,7 +700,7 @@ void CanvasItem::draw_style_box(const Ref<StyleBox> &p_style_box, const Rect2 &p
p_style_box->draw(canvas_item, p_rect);
}
-void CanvasItem::draw_primitive(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture> p_texture, float p_width) {
+void CanvasItem::draw_primitive(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture> p_texture, float p_width, const Ref<Texture> &p_normal_map) {
if (!drawing) {
ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
@@ -603,8 +708,9 @@ void CanvasItem::draw_primitive(const Vector<Point2> &p_points, const Vector<Col
}
RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
+ RID rid_normal = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_primitive(canvas_item, p_points, p_colors, p_uvs, rid, p_width);
+ VisualServer::get_singleton()->canvas_item_add_primitive(canvas_item, p_points, p_colors, p_uvs, rid, p_width, rid_normal);
}
void CanvasItem::draw_set_transform(const Point2 &p_offset, float p_rot, const Size2 &p_scale) {
@@ -628,7 +734,7 @@ void CanvasItem::draw_set_transform_matrix(const Transform2D &p_matrix) {
VisualServer::get_singleton()->canvas_item_add_set_transform(canvas_item, p_matrix);
}
-void CanvasItem::draw_polygon(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture> p_texture) {
+void CanvasItem::draw_polygon(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture> p_texture, const Ref<Texture> &p_normal_map) {
if (!drawing) {
ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
@@ -636,11 +742,12 @@ void CanvasItem::draw_polygon(const Vector<Point2> &p_points, const Vector<Color
}
RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
+ RID rid_normal = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_polygon(canvas_item, p_points, p_colors, p_uvs, rid);
+ VisualServer::get_singleton()->canvas_item_add_polygon(canvas_item, p_points, p_colors, p_uvs, rid, rid_normal);
}
-void CanvasItem::draw_colored_polygon(const Vector<Point2> &p_points, const Color &p_color, const Vector<Point2> &p_uvs, Ref<Texture> p_texture) {
+void CanvasItem::draw_colored_polygon(const Vector<Point2> &p_points, const Color &p_color, const Vector<Point2> &p_uvs, Ref<Texture> p_texture, const Ref<Texture> &p_normal_map) {
if (!drawing) {
ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
@@ -650,8 +757,9 @@ void CanvasItem::draw_colored_polygon(const Vector<Point2> &p_points, const Colo
Vector<Color> colors;
colors.push_back(p_color);
RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
+ RID rid_normal = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_polygon(canvas_item, p_points, colors, p_uvs, rid);
+ VisualServer::get_singleton()->canvas_item_add_polygon(canvas_item, p_points, colors, p_uvs, rid, rid_normal);
}
void CanvasItem::draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, const Color &p_modulate, int p_clip_w) {
@@ -680,8 +788,9 @@ float CanvasItem::draw_char(const Ref<Font> &p_font, const Point2 &p_pos, const
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;
@@ -770,7 +879,7 @@ bool CanvasItem::is_draw_behind_parent_enabled() const {
return behind;
}
-void CanvasItem::set_material(const Ref<CanvasItemMaterial> &p_material) {
+void CanvasItem::set_material(const Ref<Material> &p_material) {
material = p_material;
RID rid;
@@ -791,7 +900,7 @@ bool CanvasItem::get_use_parent_material() const {
return use_parent_material;
}
-Ref<CanvasItemMaterial> CanvasItem::get_material() const {
+Ref<Material> CanvasItem::get_material() const {
return material;
}
@@ -800,30 +909,28 @@ Vector2 CanvasItem::make_canvas_pos_local(const Vector2 &screen_point) const {
ERR_FAIL_COND_V(!is_inside_tree(), screen_point);
- Transform2D local_matrix = (get_canvas_transform() *
- get_global_transform())
- .affine_inverse();
+ Transform2D local_matrix = (get_canvas_transform() * get_global_transform()).affine_inverse();
return local_matrix.xform(screen_point);
}
-InputEvent CanvasItem::make_input_local(const InputEvent &p_event) const {
+Ref<InputEvent> CanvasItem::make_input_local(const Ref<InputEvent> &p_event) const {
ERR_FAIL_COND_V(!is_inside_tree(), p_event);
- return p_event.xform_by((get_canvas_transform() * get_global_transform()).affine_inverse());
+ return p_event->xformed_by((get_canvas_transform() * get_global_transform()).affine_inverse());
}
-Vector2 CanvasItem::get_global_mouse_pos() const {
+Vector2 CanvasItem::get_global_mouse_position() const {
ERR_FAIL_COND_V(!get_viewport(), Vector2());
- return get_canvas_transform().affine_inverse().xform(get_viewport()->get_mouse_pos());
+ return get_canvas_transform().affine_inverse().xform(get_viewport()->get_mouse_position());
}
Vector2 CanvasItem::get_local_mouse_pos() const {
ERR_FAIL_COND_V(!get_viewport(), Vector2());
- return get_global_transform().affine_inverse().xform(get_global_mouse_pos());
+ return get_global_transform().affine_inverse().xform(get_global_mouse_position());
}
void CanvasItem::_bind_methods() {
@@ -832,7 +939,7 @@ void CanvasItem::_bind_methods() {
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_get_state"), &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);
@@ -842,7 +949,7 @@ void CanvasItem::_bind_methods() {
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("set_visible", "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);
@@ -869,17 +976,19 @@ void CanvasItem::_bind_methods() {
//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_polyline", "points", "color", "width", "antialiased"), &CanvasItem::draw_polyline, DEFVAL(1.0), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("draw_polyline_colors", "points", "colors", "width", "antialiased"), &CanvasItem::draw_polyline_colors, DEFVAL(1.0), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("draw_rect", "rect", "color", "filled"), &CanvasItem::draw_rect, DEFVAL(true));
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_texture", "texture", "pos", "modulate", "normal_map"), &CanvasItem::draw_texture, DEFVAL(Color(1, 1, 1, 1)), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("draw_texture_rect", "texture", "rect", "tile", "modulate", "transpose", "normal_map"), &CanvasItem::draw_texture_rect, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("draw_texture_rect_region", "texture", "rect", "src_rect", "modulate", "transpose", "normal_map", "clip_uv"), &CanvasItem::draw_texture_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("draw_style_box", "style_box", "rect"), &CanvasItem::draw_style_box);
+ ClassDB::bind_method(D_METHOD("draw_primitive", "points", "colors", "uvs", "texture", "width", "normal_map"), &CanvasItem::draw_primitive, DEFVAL(Variant()), DEFVAL(1.0), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("draw_polygon", "points", "colors", "uvs", "texture", "normal_map"), &CanvasItem::draw_polygon, DEFVAL(PoolVector2Array()), DEFVAL(Variant()), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("draw_colored_polygon", "points", "color", "uvs", "texture", "normal_map"), &CanvasItem::draw_colored_polygon, DEFVAL(PoolVector2Array()), DEFVAL(Variant()), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("draw_string", "font", "pos", "text", "modulate", "clip_w"), &CanvasItem::draw_string, DEFVAL(Color(1, 1, 1)), DEFVAL(-1));
+ ClassDB::bind_method(D_METHOD("draw_char", "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);
@@ -890,13 +999,13 @@ void CanvasItem::_bind_methods() {
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_global_mouse_position"), &CanvasItem::get_global_mouse_position);
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_material", "material"), &CanvasItem::set_material);
+ ClassDB::bind_method(D_METHOD("get_material"), &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);
@@ -922,7 +1031,7 @@ void CanvasItem::_bind_methods() {
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"), "set_material", "get_material");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,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"), "set_as_toplevel","is_set_as_toplevel") ;
@@ -984,7 +1093,15 @@ bool CanvasItem::is_local_transform_notification_enabled() const {
}
void CanvasItem::set_notify_transform(bool p_enable) {
+ if (notify_transform == p_enable)
+ return;
+
notify_transform = p_enable;
+
+ if (notify_transform && is_inside_tree()) {
+ //this ensures that invalid globals get resolved, so notifications can be received
+ get_global_transform();
+ }
}
bool CanvasItem::is_transform_notification_enabled() const {
diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h
index a188ce495a..660ddcf930 100644
--- a/scene/2d/canvas_item.h
+++ b/scene/2d/canvas_item.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,7 +31,7 @@
#define CANVAS_ITEM_H
#include "scene/main/node.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
#include "scene/resources/material.h"
#include "scene/resources/shader.h"
#include "scene/resources/texture.h"
@@ -43,36 +44,90 @@ class StyleBox;
class CanvasItemMaterial : public Material {
- GDCLASS(CanvasItemMaterial, Material);
- Ref<Shader> shader;
+ GDCLASS(CanvasItemMaterial, Material)
public:
- /*enum ShadingMode {
- SHADING_NORMAL,
- SHADING_UNSHADED,
- SHADING_ONLY_LIGHT,
- };*/
+ enum BlendMode {
+ BLEND_MODE_MIX,
+ BLEND_MODE_ADD,
+ BLEND_MODE_SUB,
+ BLEND_MODE_MUL,
+ BLEND_MODE_PREMULT_ALPHA
+ };
-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;
+ enum LightMode {
+ LIGHT_MODE_NORMAL,
+ LIGHT_MODE_UNSHADED,
+ LIGHT_MODE_LIGHT_ONLY
+ };
- static void _bind_methods();
+private:
+ union MaterialKey {
+
+ struct {
+ uint32_t blend_mode : 4;
+ uint32_t light_mode : 4;
+ uint32_t invalid_key : 1;
+ };
+
+ uint32_t key;
+
+ bool operator<(const MaterialKey &p_key) const {
+ return key < p_key.key;
+ }
+ };
- void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const;
+ struct ShaderData {
+ RID shader;
+ int users;
+ };
+
+ static Map<MaterialKey, ShaderData> shader_map;
+
+ MaterialKey current_key;
+
+ _FORCE_INLINE_ MaterialKey _compute_key() const {
+
+ MaterialKey mk;
+ mk.key = 0;
+ mk.blend_mode = blend_mode;
+ mk.light_mode = light_mode;
+ return mk;
+ }
+
+ static Mutex *material_mutex;
+ static SelfList<CanvasItemMaterial>::List dirty_materials;
+ SelfList<CanvasItemMaterial> element;
+
+ void _update_shader();
+ _FORCE_INLINE_ void _queue_shader_change();
+ _FORCE_INLINE_ bool _is_shader_dirty() const;
+
+ BlendMode blend_mode;
+ LightMode light_mode;
+
+protected:
+ static void _bind_methods();
+ void _validate_property(PropertyInfo &property) const;
public:
- void set_shader(const Ref<Shader> &p_shader);
- Ref<Shader> get_shader() const;
+ void set_blend_mode(BlendMode p_blend_mode);
+ BlendMode get_blend_mode() const;
+
+ void set_light_mode(LightMode p_light_mode);
+ LightMode get_light_mode() const;
- void set_shader_param(const StringName &p_param, const Variant &p_value);
- Variant get_shader_param(const StringName &p_param) const;
+ static void init_shaders();
+ static void finish_shaders();
+ static void flush_changes();
CanvasItemMaterial();
- ~CanvasItemMaterial();
+ virtual ~CanvasItemMaterial();
};
+VARIANT_ENUM_CAST(CanvasItemMaterial::BlendMode)
+VARIANT_ENUM_CAST(CanvasItemMaterial::LightMode)
+
class CanvasItem : public Node {
GDCLASS(CanvasItem, Node);
@@ -114,7 +169,7 @@ private:
bool notify_local_transform;
bool notify_transform;
- Ref<CanvasItemMaterial> material;
+ Ref<Material> material;
mutable Transform2D global_transform;
mutable bool global_invalid;
@@ -187,15 +242,17 @@ public:
/* DRAWING API */
void draw_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width = 1.0, bool p_antialiased = false);
- void draw_rect(const Rect2 &p_rect, const Color &p_color);
+ void draw_polyline(const Vector<Point2> &p_points, const Color &p_color, float p_width = 1.0, bool p_antialiased = false);
+ void draw_polyline_colors(const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width = 1.0, bool p_antialiased = false);
+ void draw_rect(const Rect2 &p_rect, const Color &p_color, bool p_filled = true);
void draw_circle(const Point2 &p_pos, float p_radius, const Color &p_color);
- void draw_texture(const Ref<Texture> &p_texture, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1, 1));
- void draw_texture_rect(const Ref<Texture> &p_texture, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false);
- void draw_texture_rect_region(const Ref<Texture> &p_texture, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false);
+ void draw_texture(const Ref<Texture> &p_texture, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1, 1), const Ref<Texture> &p_normal_map = Ref<Texture>());
+ void draw_texture_rect(const Ref<Texture> &p_texture, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>());
+ void draw_texture_rect_region(const Ref<Texture> &p_texture, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>(), bool p_clip_uv = true);
void draw_style_box(const Ref<StyleBox> &p_style_box, const Rect2 &p_rect);
- void draw_primitive(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture> p_texture = Ref<Texture>(), float p_width = 1);
- void draw_polygon(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), Ref<Texture> p_texture = Ref<Texture>());
- void draw_colored_polygon(const Vector<Point2> &p_points, const Color &p_color, const Vector<Point2> &p_uvs = Vector<Point2>(), Ref<Texture> p_texture = Ref<Texture>());
+ void draw_primitive(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture> p_texture = Ref<Texture>(), float p_width = 1, const Ref<Texture> &p_normal_map = Ref<Texture>());
+ void draw_polygon(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), Ref<Texture> p_texture = Ref<Texture>(), const Ref<Texture> &p_normal_map = Ref<Texture>());
+ void draw_colored_polygon(const Vector<Point2> &p_points, const Color &p_color, const Vector<Point2> &p_uvs = Vector<Point2>(), Ref<Texture> p_texture = Ref<Texture>(), const Ref<Texture> &p_normal_map = Ref<Texture>());
void draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, const Color &p_modulate = Color(1, 1, 1), int p_clip_w = -1);
float draw_char(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_char, const String &p_next = "", const Color &p_modulate = Color(1, 1, 1));
@@ -234,16 +291,16 @@ public:
RID get_canvas() const;
Ref<World2D> get_world_2d() const;
- void set_material(const Ref<CanvasItemMaterial> &p_material);
- Ref<CanvasItemMaterial> get_material() const;
+ void set_material(const Ref<Material> &p_material);
+ Ref<Material> get_material() const;
void set_use_parent_material(bool p_use_parent_material);
bool get_use_parent_material() const;
- InputEvent make_input_local(const InputEvent &pevent) const;
+ Ref<InputEvent> make_input_local(const Ref<InputEvent> &p_event) const;
Vector2 make_canvas_pos_local(const Vector2 &screen_point) const;
- Vector2 get_global_mouse_pos() const;
+ Vector2 get_global_mouse_position() const;
Vector2 get_local_mouse_pos() const;
void set_notify_local_transform(bool p_enable);
diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp
index a0e3061c85..a132c5e18c 100644
--- a/scene/2d/canvas_modulate.cpp
+++ b/scene/2d/canvas_modulate.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/canvas_modulate.h b/scene/2d/canvas_modulate.h
index 8e62b5ccb9..37d9d47ba5 100644
--- a/scene/2d/canvas_modulate.h
+++ b/scene/2d/canvas_modulate.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp
index 1242599d46..d3bb5a8d4e 100644
--- a/scene/2d/collision_object_2d.cpp
+++ b/scene/2d/collision_object_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,18 +31,6 @@
#include "scene/scene_string_names.h"
#include "servers/physics_2d_server.h"
-void CollisionObject2D::_update_shapes_from_children() {
-
- shapes.clear();
- for (int i = 0; i < get_child_count(); i++) {
-
- Node *n = get_child(i);
- n->call("_add_to_collision_object", this);
- }
-
- _update_shapes();
-}
-
void CollisionObject2D::_notification(int p_what) {
switch (p_what) {
@@ -87,82 +76,207 @@ void CollisionObject2D::_notification(int p_what) {
}
}
-void CollisionObject2D::_update_shapes() {
+uint32_t CollisionObject2D::create_shape_owner(Object *p_owner) {
- if (!rid.is_valid())
- return;
+ ShapeData sd;
+ uint32_t id;
+
+ if (shapes.size() == 0) {
+ id = 1;
+ } else {
+ id = shapes.back()->key() + 1;
+ }
+
+ sd.owner = p_owner;
+
+ shapes[id] = sd;
+
+ return id;
+}
+
+void CollisionObject2D::remove_shape_owner(uint32_t owner) {
+
+ ERR_FAIL_COND(!shapes.has(owner));
+
+ shape_owner_clear_shapes(owner);
+
+ shapes.erase(owner);
+}
+
+void CollisionObject2D::shape_owner_set_disabled(uint32_t p_owner, bool p_disabled) {
+ ERR_FAIL_COND(!shapes.has(p_owner));
+
+ ShapeData &sd = shapes[p_owner];
+ sd.disabled = p_disabled;
+ for (int i = 0; i < sd.shapes.size(); i++) {
+ if (area) {
+ Physics2DServer::get_singleton()->area_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
+ } else {
+ Physics2DServer::get_singleton()->body_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
+ }
+ }
+}
+
+bool CollisionObject2D::is_shape_owner_disabled(uint32_t p_owner) const {
+
+ ERR_FAIL_COND_V(!shapes.has(p_owner), false);
+
+ return shapes[p_owner].disabled;
+}
+
+void CollisionObject2D::shape_owner_set_one_way_collision(uint32_t p_owner, bool p_enable) {
if (area)
- Physics2DServer::get_singleton()->area_clear_shapes(rid);
- else
- Physics2DServer::get_singleton()->body_clear_shapes(rid);
-
- for (int i = 0; i < shapes.size(); i++) {
-
- if (shapes[i].shape.is_null())
- continue;
- if (area)
- Physics2DServer::get_singleton()->area_add_shape(rid, shapes[i].shape->get_rid(), shapes[i].xform);
- else {
- Physics2DServer::get_singleton()->body_add_shape(rid, shapes[i].shape->get_rid(), shapes[i].xform);
- if (shapes[i].trigger)
- Physics2DServer::get_singleton()->body_set_shape_as_trigger(rid, i, shapes[i].trigger);
+ return; //not for areas
+
+ ERR_FAIL_COND(!shapes.has(p_owner));
+
+ ShapeData &sd = shapes[p_owner];
+ sd.one_way_collision = p_enable;
+ for (int i = 0; i < sd.shapes.size(); i++) {
+ Physics2DServer::get_singleton()->body_set_shape_as_one_way_collision(rid, sd.shapes[i].index, p_enable);
+ }
+}
+
+bool CollisionObject2D::is_shape_owner_one_way_collision_enabled(uint32_t p_owner) const {
+
+ ERR_FAIL_COND_V(!shapes.has(p_owner), false);
+
+ return shapes[p_owner].one_way_collision;
+}
+
+void CollisionObject2D::get_shape_owners(List<uint32_t> *r_owners) {
+
+ for (Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) {
+ r_owners->push_back(E->key());
+ }
+}
+
+Array CollisionObject2D::_get_shape_owners() {
+
+ Array ret;
+ for (Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) {
+ ret.push_back(E->key());
+ }
+
+ return ret;
+}
+
+void CollisionObject2D::shape_owner_set_transform(uint32_t p_owner, const Transform2D &p_transform) {
+
+ ERR_FAIL_COND(!shapes.has(p_owner));
+
+ ShapeData &sd = shapes[p_owner];
+ sd.xform = p_transform;
+ for (int i = 0; i < sd.shapes.size(); i++) {
+ if (area) {
+ Physics2DServer::get_singleton()->area_set_shape_transform(rid, sd.shapes[i].index, p_transform);
+ } else {
+ Physics2DServer::get_singleton()->body_set_shape_transform(rid, sd.shapes[i].index, p_transform);
}
}
}
+Transform2D CollisionObject2D::shape_owner_get_transform(uint32_t p_owner) const {
-bool CollisionObject2D::_set(const StringName &p_name, const Variant &p_value) {
- String name = p_name;
+ ERR_FAIL_COND_V(!shapes.has(p_owner), Transform2D());
- if (name.begins_with("shapes/")) {
+ return shapes[p_owner].xform;
+}
- int idx = name.get_slicec('/', 1).to_int();
- String what = name.get_slicec('/', 2);
- if (what == "shape") {
- if (idx >= shapes.size())
- add_shape(RefPtr(p_value));
- else
- set_shape(idx, RefPtr(p_value));
- } else if (what == "transform")
- set_shape_transform(idx, p_value);
- else if (what == "trigger")
- set_shape_as_trigger(idx, p_value);
- } else
- return false;
-
- return true;
+Object *CollisionObject2D::shape_owner_get_owner(uint32_t p_owner) const {
+
+ ERR_FAIL_COND_V(!shapes.has(p_owner), NULL);
+
+ return shapes[p_owner].owner;
+}
+
+void CollisionObject2D::shape_owner_add_shape(uint32_t p_owner, const Ref<Shape2D> &p_shape) {
+
+ ERR_FAIL_COND(!shapes.has(p_owner));
+ ERR_FAIL_COND(p_shape.is_null());
+
+ ShapeData &sd = shapes[p_owner];
+ ShapeData::Shape s;
+ s.index = total_subshapes;
+ s.shape = p_shape;
+ if (area) {
+ Physics2DServer::get_singleton()->area_add_shape(rid, p_shape->get_rid(), sd.xform);
+ } else {
+ Physics2DServer::get_singleton()->body_add_shape(rid, p_shape->get_rid(), sd.xform);
+ }
+ sd.shapes.push_back(s);
+
+ total_subshapes++;
}
+int CollisionObject2D::shape_owner_get_shape_count(uint32_t p_owner) const {
-bool CollisionObject2D::_get(const StringName &p_name, Variant &r_ret) const {
+ ERR_FAIL_COND_V(!shapes.has(p_owner), 0);
- String name = p_name;
+ return shapes[p_owner].shapes.size();
+}
+Ref<Shape2D> CollisionObject2D::shape_owner_get_shape(uint32_t p_owner, int p_shape) const {
+
+ ERR_FAIL_COND_V(!shapes.has(p_owner), Ref<Shape2D>());
+ ERR_FAIL_INDEX_V(p_shape, shapes[p_owner].shapes.size(), Ref<Shape2D>());
- if (name.begins_with("shapes/")) {
+ return shapes[p_owner].shapes[p_shape].shape;
+}
+int CollisionObject2D::shape_owner_get_shape_index(uint32_t p_owner, int p_shape) const {
- int idx = name.get_slicec('/', 1).to_int();
- String what = name.get_slicec('/', 2);
- if (what == "shape")
- r_ret = get_shape(idx);
- else if (what == "transform")
- r_ret = get_shape_transform(idx);
- else if (what == "trigger")
- r_ret = is_shape_set_as_trigger(idx);
- } else
- return false;
+ ERR_FAIL_COND_V(!shapes.has(p_owner), -1);
+ ERR_FAIL_INDEX_V(p_shape, shapes[p_owner].shapes.size(), -1);
- return true;
+ return shapes[p_owner].shapes[p_shape].index;
}
-void CollisionObject2D::_get_property_list(List<PropertyInfo> *p_list) const {
+void CollisionObject2D::shape_owner_remove_shape(uint32_t p_owner, int p_shape) {
- //p_list->push_back( PropertyInfo(Variant::INT,"shape_count",PROPERTY_HINT_RANGE,"0,256,1",PROPERTY_USAGE_NOEDITOR|PROPERTY_USAGE_NO_INSTANCE_STATE) );
+ ERR_FAIL_COND(!shapes.has(p_owner));
+ ERR_FAIL_INDEX(p_shape, shapes[p_owner].shapes.size());
- for (int i = 0; i < shapes.size(); i++) {
- String path = "shapes/" + itos(i) + "/";
- p_list->push_back(PropertyInfo(Variant::OBJECT, path + "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape2D", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE));
- p_list->push_back(PropertyInfo(Variant::TRANSFORM, path + "transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE));
- p_list->push_back(PropertyInfo(Variant::BOOL, path + "trigger", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE));
+ int index_to_remove = shapes[p_owner].shapes[p_shape].index;
+ if (area) {
+ Physics2DServer::get_singleton()->area_remove_shape(rid, index_to_remove);
+ } else {
+ Physics2DServer::get_singleton()->body_remove_shape(rid, index_to_remove);
}
+
+ shapes[p_owner].shapes.remove(p_shape);
+
+ for (Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) {
+ for (int i = 0; i < E->get().shapes.size(); i++) {
+ if (E->get().shapes[i].index > index_to_remove) {
+ E->get().shapes[i].index -= 1;
+ }
+ }
+ }
+
+ total_subshapes--;
+}
+
+void CollisionObject2D::shape_owner_clear_shapes(uint32_t p_owner) {
+
+ ERR_FAIL_COND(!shapes.has(p_owner));
+
+ while (shape_owner_get_shape_count(p_owner) > 0) {
+ shape_owner_remove_shape(p_owner, 0);
+ }
+}
+
+uint32_t CollisionObject2D::shape_find_owner(int p_shape_index) const {
+
+ ERR_FAIL_INDEX_V(p_shape_index, total_subshapes, 0);
+
+ for (const Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) {
+ for (int i = 0; i < E->get().shapes.size(); i++) {
+ if (E->get().shapes[i].index == p_shape_index) {
+ return E->key();
+ }
+ }
+ }
+
+ //in theory it should be unreachable
+ return 0;
}
void CollisionObject2D::set_pickable(bool p_enabled) {
@@ -179,7 +293,7 @@ bool CollisionObject2D::is_pickable() const {
return pickable;
}
-void CollisionObject2D::_input_event(Node *p_viewport, const InputEvent &p_input_event, int p_shape) {
+void CollisionObject2D::_input_event(Node *p_viewport, const Ref<InputEvent> &p_input_event, int p_shape) {
if (get_script_instance()) {
get_script_instance()->call(SceneStringNames::get_singleton()->_input_event, p_viewport, p_input_event, p_shape);
@@ -215,24 +329,31 @@ void CollisionObject2D::_update_pickable() {
void CollisionObject2D::_bind_methods() {
- 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")));
-
- ADD_SIGNAL(MethodInfo("input_event", PropertyInfo(Variant::OBJECT, "viewport"), PropertyInfo(Variant::INPUT_EVENT, "event"), PropertyInfo(Variant::INT, "shape_idx")));
+ ClassDB::bind_method(D_METHOD("create_shape_owner", "owner"), &CollisionObject2D::create_shape_owner);
+ ClassDB::bind_method(D_METHOD("remove_shape_owner", "owner_id"), &CollisionObject2D::remove_shape_owner);
+ ClassDB::bind_method(D_METHOD("get_shape_owners"), &CollisionObject2D::_get_shape_owners);
+ ClassDB::bind_method(D_METHOD("shape_owner_set_transform", "owner_id", "transform"), &CollisionObject2D::shape_owner_set_transform);
+ ClassDB::bind_method(D_METHOD("shape_owner_get_transform", "owner_id"), &CollisionObject2D::shape_owner_get_transform);
+ ClassDB::bind_method(D_METHOD("shape_owner_get_owner", "owner_id"), &CollisionObject2D::shape_owner_get_owner);
+ ClassDB::bind_method(D_METHOD("shape_owner_set_disabled", "owner_id", "disabled"), &CollisionObject2D::shape_owner_set_disabled);
+ ClassDB::bind_method(D_METHOD("is_shape_owner_disabled", "owner_id"), &CollisionObject2D::is_shape_owner_disabled);
+ ClassDB::bind_method(D_METHOD("shape_owner_set_one_way_collision", "owner_id", "enable"), &CollisionObject2D::shape_owner_set_one_way_collision);
+ ClassDB::bind_method(D_METHOD("is_shape_owner_one_way_collision_enabled", "owner_id"), &CollisionObject2D::is_shape_owner_one_way_collision_enabled);
+ ClassDB::bind_method(D_METHOD("shape_owner_add_shape", "owner_id", "shape"), &CollisionObject2D::shape_owner_add_shape);
+ ClassDB::bind_method(D_METHOD("shape_owner_get_shape_count", "owner_id"), &CollisionObject2D::shape_owner_get_shape_count);
+ ClassDB::bind_method(D_METHOD("shape_owner_get_shape", "owner_id", "shape_id"), &CollisionObject2D::shape_owner_get_shape);
+ ClassDB::bind_method(D_METHOD("shape_owner_get_shape_index", "owner_id", "shape_id"), &CollisionObject2D::shape_owner_get_shape_index);
+ ClassDB::bind_method(D_METHOD("shape_owner_remove_shape", "owner_id", "shape_id"), &CollisionObject2D::shape_owner_remove_shape);
+ ClassDB::bind_method(D_METHOD("shape_owner_clear_shapes", "owner_id"), &CollisionObject2D::shape_owner_clear_shapes);
+ ClassDB::bind_method(D_METHOD("shape_find_owner", "shape_index"), &CollisionObject2D::shape_find_owner);
+
+ BIND_VMETHOD(MethodInfo("_input_event", PropertyInfo(Variant::OBJECT, "viewport"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"), PropertyInfo(Variant::INT, "shape_idx")));
+
+ ADD_SIGNAL(MethodInfo("input_event", PropertyInfo(Variant::OBJECT, "viewport"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"), PropertyInfo(Variant::INT, "shape_idx")));
ADD_SIGNAL(MethodInfo("mouse_entered"));
ADD_SIGNAL(MethodInfo("mouse_exited"));
@@ -241,112 +362,26 @@ void CollisionObject2D::_bind_methods() {
ADD_GROUP("", "");
}
-void CollisionObject2D::add_shape(const Ref<Shape2D> &p_shape, const Transform2D &p_transform) {
-
- ERR_FAIL_COND(p_shape.is_null());
-
- ShapeData sdata;
- sdata.shape = p_shape;
- sdata.xform = p_transform;
- sdata.trigger = false;
-
- if (area)
- Physics2DServer::get_singleton()->area_add_shape(get_rid(), p_shape->get_rid(), p_transform);
- else
- Physics2DServer::get_singleton()->body_add_shape(get_rid(), p_shape->get_rid(), p_transform);
-
- shapes.push_back(sdata);
-}
-int CollisionObject2D::get_shape_count() const {
-
- return shapes.size();
-}
-void CollisionObject2D::set_shape(int p_shape_idx, const Ref<Shape2D> &p_shape) {
-
- ERR_FAIL_INDEX(p_shape_idx, shapes.size());
- ERR_FAIL_COND(p_shape.is_null());
-
- shapes[p_shape_idx].shape = p_shape;
- if (area)
- Physics2DServer::get_singleton()->area_set_shape(get_rid(), p_shape_idx, p_shape->get_rid());
- else
- Physics2DServer::get_singleton()->body_set_shape(get_rid(), p_shape_idx, p_shape->get_rid());
-
- //_update_shapes();
-}
-
-void CollisionObject2D::set_shape_transform(int p_shape_idx, const Transform2D &p_transform) {
-
- ERR_FAIL_INDEX(p_shape_idx, shapes.size());
- shapes[p_shape_idx].xform = p_transform;
-
- if (area)
- Physics2DServer::get_singleton()->area_set_shape_transform(get_rid(), p_shape_idx, p_transform);
- else
- Physics2DServer::get_singleton()->body_set_shape_transform(get_rid(), p_shape_idx, p_transform);
-
- //_update_shapes();
-}
-
-Ref<Shape2D> CollisionObject2D::get_shape(int p_shape_idx) const {
-
- ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), Ref<Shape2D>());
- return shapes[p_shape_idx].shape;
-}
-Transform2D CollisionObject2D::get_shape_transform(int p_shape_idx) const {
-
- ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), Transform2D());
- return shapes[p_shape_idx].xform;
-}
-void CollisionObject2D::remove_shape(int p_shape_idx) {
-
- ERR_FAIL_INDEX(p_shape_idx, shapes.size());
- shapes.remove(p_shape_idx);
-
- _update_shapes();
-}
-
-void CollisionObject2D::set_shape_as_trigger(int p_shape_idx, bool p_trigger) {
-
- ERR_FAIL_INDEX(p_shape_idx, shapes.size());
- shapes[p_shape_idx].trigger = p_trigger;
- if (!area && rid.is_valid()) {
-
- Physics2DServer::get_singleton()->body_set_shape_as_trigger(rid, p_shape_idx, p_trigger);
- }
-}
-
-bool CollisionObject2D::is_shape_set_as_trigger(int p_shape_idx) const {
-
- ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), false);
- return shapes[p_shape_idx].trigger;
-}
-
-void CollisionObject2D::clear_shapes() {
-
- shapes.clear();
-
- _update_shapes();
-}
-
CollisionObject2D::CollisionObject2D(RID p_rid, bool p_area) {
rid = p_rid;
area = p_area;
pickable = true;
set_notify_transform(true);
+ total_subshapes = 0;
if (p_area) {
- Physics2DServer::get_singleton()->area_attach_object_instance_ID(rid, get_instance_ID());
+ Physics2DServer::get_singleton()->area_attach_object_instance_id(rid, get_instance_id());
} else {
- Physics2DServer::get_singleton()->body_attach_object_instance_ID(rid, get_instance_ID());
+ Physics2DServer::get_singleton()->body_attach_object_instance_id(rid, get_instance_id());
}
}
CollisionObject2D::CollisionObject2D() {
//owner=
+
set_notify_transform(true);
}
diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h
index e6ea0f42d3..36bf39ff4e 100644
--- a/scene/2d/collision_object_2d.h
+++ b/scene/2d/collision_object_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,56 +35,73 @@
class CollisionObject2D : public Node2D {
- GDCLASS(CollisionObject2D, Node2D);
+ GDCLASS(CollisionObject2D, Node2D)
bool area;
RID rid;
bool pickable;
struct ShapeData {
+
+ Object *owner;
Transform2D xform;
- Ref<Shape2D> shape;
- bool trigger;
+ struct Shape {
+ Ref<Shape2D> shape;
+ int index;
+ };
+
+ Vector<Shape> shapes;
+ bool disabled;
+ bool one_way_collision;
ShapeData() {
- trigger = false;
+ disabled = false;
+ one_way_collision = false;
+ owner = NULL;
}
};
- Vector<ShapeData> shapes;
-
- void _update_shapes();
+ int total_subshapes;
- friend class CollisionShape2D;
- friend class CollisionPolygon2D;
- void _update_shapes_from_children();
+ Map<uint32_t, ShapeData> shapes;
protected:
CollisionObject2D(RID p_rid, bool p_area);
void _notification(int p_what);
- 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;
static void _bind_methods();
void _update_pickable();
friend class Viewport;
- void _input_event(Node *p_viewport, const InputEvent &p_input_event, int p_shape);
+ void _input_event(Node *p_viewport, const Ref<InputEvent> &p_input_event, int p_shape);
void _mouse_enter();
void _mouse_exit();
public:
- void add_shape(const Ref<Shape2D> &p_shape, const Transform2D &p_transform = Transform2D());
- int get_shape_count() const;
- void set_shape(int p_shape_idx, const Ref<Shape2D> &p_shape);
- void set_shape_transform(int p_shape_idx, const Transform2D &p_transform);
- Ref<Shape2D> get_shape(int p_shape_idx) const;
- Transform2D get_shape_transform(int p_shape_idx) const;
- void set_shape_as_trigger(int p_shape_idx, bool p_trigger);
- bool is_shape_set_as_trigger(int p_shape_idx) const;
- void remove_shape(int p_shape_idx);
- void clear_shapes();
+ uint32_t create_shape_owner(Object *p_owner);
+ void remove_shape_owner(uint32_t owner);
+ void get_shape_owners(List<uint32_t> *r_owners);
+ Array _get_shape_owners();
+
+ void shape_owner_set_transform(uint32_t p_owner, const Transform2D &p_transform);
+ Transform2D shape_owner_get_transform(uint32_t p_owner) const;
+ Object *shape_owner_get_owner(uint32_t p_owner) const;
+
+ void shape_owner_set_disabled(uint32_t p_owner, bool p_disabled);
+ bool is_shape_owner_disabled(uint32_t p_owner) const;
+
+ void shape_owner_set_one_way_collision(uint32_t p_owner, bool p_enable);
+ bool is_shape_owner_one_way_collision_enabled(uint32_t p_owner) const;
+
+ void shape_owner_add_shape(uint32_t p_owner, const Ref<Shape2D> &p_shape);
+ int shape_owner_get_shape_count(uint32_t p_owner) const;
+ Ref<Shape2D> shape_owner_get_shape(uint32_t p_owner, int p_shape) const;
+ int shape_owner_get_shape_index(uint32_t p_owner, int p_shape) const;
+
+ void shape_owner_remove_shape(uint32_t p_owner, int p_shape);
+ void shape_owner_clear_shapes(uint32_t p_owner);
+
+ uint32_t shape_find_owner(int p_shape_index) const;
void set_pickable(bool p_enabled);
bool is_pickable() const;
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp
index abc044f10f..bd669eb4c8 100644
--- a/scene/2d/collision_polygon_2d.cpp
+++ b/scene/2d/collision_polygon_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,17 +28,16 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "collision_polygon_2d.h"
+
#include "collision_object_2d.h"
#include "scene/resources/concave_polygon_shape_2d.h"
#include "scene/resources/convex_polygon_shape_2d.h"
-#include "triangulator.h"
-void CollisionPolygon2D::_add_to_collision_object(Object *p_obj) {
- if (unparenting || !can_update_body)
- return;
+#include "thirdparty/misc/triangulator.h"
- CollisionObject2D *co = p_obj->cast_to<CollisionObject2D>();
- ERR_FAIL_COND(!co);
+void CollisionPolygon2D::_build_polygon() {
+
+ parent->shape_owner_clear_shapes(owner_id);
if (polygon.size() == 0)
return;
@@ -49,18 +49,10 @@ void CollisionPolygon2D::_add_to_collision_object(Object *p_obj) {
//here comes the sun, lalalala
//decompose concave into multiple convex polygons and add them
Vector<Vector<Vector2> > decomp = _decompose_in_convex();
- shape_from = co->get_shape_count();
for (int i = 0; i < decomp.size(); i++) {
Ref<ConvexPolygonShape2D> convex = memnew(ConvexPolygonShape2D);
convex->set_points(decomp[i]);
- co->add_shape(convex, get_transform());
- if (trigger)
- co->set_shape_as_trigger(co->get_shape_count() - 1, true);
- }
- shape_to = co->get_shape_count() - 1;
- if (shape_to < shape_from) {
- shape_from = -1;
- shape_to = -1;
+ parent->shape_owner_add_shape(owner_id, convex);
}
} else {
@@ -79,28 +71,8 @@ void CollisionPolygon2D::_add_to_collision_object(Object *p_obj) {
w = PoolVector<Vector2>::Write();
concave->set_segments(segments);
- co->add_shape(concave, get_transform());
- if (trigger)
- co->set_shape_as_trigger(co->get_shape_count() - 1, true);
-
- shape_from = co->get_shape_count() - 1;
- shape_to = co->get_shape_count() - 1;
+ parent->shape_owner_add_shape(owner_id, concave);
}
-
- //co->add_shape(shape,get_transform());
-}
-
-void CollisionPolygon2D::_update_parent() {
-
- if (!can_update_body)
- return;
- Node *parent = get_parent();
- if (!parent)
- return;
- CollisionObject2D *co = parent->cast_to<CollisionObject2D>();
- if (!co)
- return;
- co->_update_shapes_from_children();
}
Vector<Vector<Vector2> > CollisionPolygon2D::_decompose_in_convex() {
@@ -151,33 +123,38 @@ Vector<Vector<Vector2> > CollisionPolygon2D::_decompose_in_convex() {
void CollisionPolygon2D::_notification(int p_what) {
switch (p_what) {
- case NOTIFICATION_ENTER_TREE: {
- unparenting = false;
- can_update_body = get_tree()->is_editor_hint();
- if (!get_tree()->is_editor_hint()) {
+ case NOTIFICATION_PARENTED: {
+
+ parent = get_parent()->cast_to<CollisionObject2D>();
+ if (parent) {
+ owner_id = parent->create_shape_owner(this);
+ _build_polygon();
+ parent->shape_owner_set_transform(owner_id, get_transform());
+ parent->shape_owner_set_disabled(owner_id, disabled);
+ parent->shape_owner_set_one_way_collision(owner_id, one_way_collision);
+ }
+
+ /*if (get_tree()->is_editor_hint()) {
//display above all else
set_z_as_relative(false);
set_z(VS::CANVAS_ITEM_Z_MAX - 1);
- }
+ }*/
} break;
- case NOTIFICATION_EXIT_TREE: {
- can_update_body = false;
- } break;
case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
- if (!is_inside_tree())
- break;
- if (can_update_body) {
- _update_parent();
- } else if (shape_from >= 0 && shape_to >= 0) {
- CollisionObject2D *co = get_parent()->cast_to<CollisionObject2D>();
- for (int i = shape_from; i <= shape_to; i++) {
- co->set_shape_transform(i, get_transform());
- }
+ if (parent) {
+ parent->shape_owner_set_transform(owner_id, get_transform());
}
} break;
+ case NOTIFICATION_UNPARENTED: {
+ if (parent) {
+ parent->remove_shape_owner(owner_id);
+ }
+ owner_id = 0;
+ parent = NULL;
+ } break;
case NOTIFICATION_DRAW: {
@@ -206,10 +183,22 @@ void CollisionPolygon2D::_notification(int p_what) {
draw_colored_polygon(polygon, get_tree()->get_debug_collisions_color());
#endif
- } break;
- case NOTIFICATION_UNPARENTED: {
- unparenting = true;
- _update_parent();
+ if (one_way_collision) {
+ Color dcol = get_tree()->get_debug_collisions_color(); //0.9,0.2,0.2,0.4);
+ dcol.a = 1.0;
+ Vector2 line_to(0, 20);
+ draw_line(Vector2(), line_to, dcol, 3);
+ Vector<Vector2> pts;
+ float tsize = 8;
+ pts.push_back(line_to + (Vector2(0, tsize)));
+ pts.push_back(line_to + (Vector2(0.707 * tsize, 0)));
+ pts.push_back(line_to + (Vector2(-0.707 * tsize, 0)));
+ Vector<Color> cols;
+ for (int i = 0; i < 3; i++)
+ cols.push_back(dcol);
+
+ draw_primitive(pts, cols, Vector<Vector2>()); //small arrow
+ }
} break;
}
}
@@ -218,7 +207,7 @@ void CollisionPolygon2D::set_polygon(const Vector<Point2> &p_polygon) {
polygon = p_polygon;
- if (can_update_body) {
+ {
for (int i = 0; i < polygon.size(); i++) {
if (i == 0)
aabb = Rect2(polygon[i], Size2());
@@ -229,10 +218,13 @@ void CollisionPolygon2D::set_polygon(const Vector<Point2> &p_polygon) {
aabb = Rect2(-10, -10, 20, 20);
} else {
- aabb.pos -= aabb.size * 0.3;
+ aabb.position -= aabb.size * 0.3;
aabb.size += aabb.size * 0.6;
}
- _update_parent();
+ }
+
+ if (parent) {
+ _build_polygon();
}
update();
update_configuration_warning();
@@ -247,7 +239,9 @@ void CollisionPolygon2D::set_build_mode(BuildMode p_mode) {
ERR_FAIL_INDEX(p_mode, 2);
build_mode = p_mode;
- _update_parent();
+ if (parent) {
+ _build_polygon();
+ }
}
CollisionPolygon2D::BuildMode CollisionPolygon2D::get_build_mode() const {
@@ -260,79 +254,69 @@ Rect2 CollisionPolygon2D::get_item_rect() const {
return aabb;
}
-void CollisionPolygon2D::set_trigger(bool p_trigger) {
+String CollisionPolygon2D::get_configuration_warning() const {
- trigger = p_trigger;
- _update_parent();
- if (!can_update_body && is_inside_tree() && shape_from >= 0 && shape_to >= 0) {
- CollisionObject2D *co = get_parent()->cast_to<CollisionObject2D>();
- for (int i = shape_from; i <= shape_to; i++) {
- co->set_shape_as_trigger(i, p_trigger);
- }
+ if (!get_parent()->cast_to<CollisionObject2D>()) {
+ return TTR("CollisionPolygon2D only serves to provide a collision shape to a CollisionObject2D derived node. Please only use it as a child of Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape.");
}
-}
-bool CollisionPolygon2D::is_trigger() const {
+ if (polygon.empty()) {
+ return TTR("An empty CollisionPolygon2D has no effect on collision.");
+ }
- return trigger;
+ return String();
}
-void CollisionPolygon2D::_set_shape_range(const Vector2 &p_range) {
-
- shape_from = p_range.x;
- shape_to = p_range.y;
+void CollisionPolygon2D::set_disabled(bool p_disabled) {
+ disabled = p_disabled;
+ update();
+ if (parent) {
+ parent->shape_owner_set_disabled(owner_id, p_disabled);
+ }
}
-Vector2 CollisionPolygon2D::_get_shape_range() const {
-
- return Vector2(shape_from, shape_to);
+bool CollisionPolygon2D::is_disabled() const {
+ return disabled;
}
-String CollisionPolygon2D::get_configuration_warning() const {
-
- if (!get_parent()->cast_to<CollisionObject2D>()) {
- return TTR("CollisionPolygon2D only serves to provide a collision shape to a CollisionObject2D derived node. Please only use it as a child of Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape.");
+void CollisionPolygon2D::set_one_way_collision(bool p_enable) {
+ one_way_collision = p_enable;
+ update();
+ if (parent) {
+ parent->shape_owner_set_one_way_collision(owner_id, p_enable);
}
+}
- if (polygon.empty()) {
- return TTR("An empty CollisionPolygon2D has no effect on collision.");
- }
+bool CollisionPolygon2D::is_one_way_collision_enabled() const {
- return String();
+ return one_way_collision;
}
void CollisionPolygon2D::_bind_methods() {
- 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(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(D_METHOD("set_trigger", "trigger"), &CollisionPolygon2D::set_trigger);
- ClassDB::bind_method(D_METHOD("is_trigger"), &CollisionPolygon2D::is_trigger);
-
- 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(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);
+ ClassDB::bind_method(D_METHOD("set_disabled", "disabled"), &CollisionPolygon2D::set_disabled);
+ ClassDB::bind_method(D_METHOD("is_disabled"), &CollisionPolygon2D::is_disabled);
+ ClassDB::bind_method(D_METHOD("set_one_way_collision", "enabled"), &CollisionPolygon2D::set_one_way_collision);
+ ClassDB::bind_method(D_METHOD("is_one_way_collision_enabled"), &CollisionPolygon2D::is_one_way_collision_enabled);
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");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "one_way_collision"), "set_one_way_collision", "is_one_way_collision_enabled");
}
CollisionPolygon2D::CollisionPolygon2D() {
aabb = Rect2(-10, -10, 20, 20);
build_mode = BUILD_SOLIDS;
- trigger = false;
- unparenting = false;
- shape_from = -1;
- shape_to = -1;
- can_update_body = false;
set_notify_local_transform(true);
+ parent = NULL;
+ owner_id = 0;
+ disabled = false;
+ one_way_collision = false;
}
diff --git a/scene/2d/collision_polygon_2d.h b/scene/2d/collision_polygon_2d.h
index f1f31a2854..f0666ba9de 100644
--- a/scene/2d/collision_polygon_2d.h
+++ b/scene/2d/collision_polygon_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,6 +33,8 @@
#include "scene/2d/node_2d.h"
#include "scene/resources/shape_2d.h"
+class CollisionObject2D;
+
class CollisionPolygon2D : public Node2D {
GDCLASS(CollisionPolygon2D, Node2D);
@@ -46,29 +49,20 @@ protected:
Rect2 aabb;
BuildMode build_mode;
Vector<Point2> polygon;
- bool trigger;
- bool unparenting;
-
- void _add_to_collision_object(Object *p_obj);
- void _update_parent();
-
- bool can_update_body;
- int shape_from;
- int shape_to;
-
- void _set_shape_range(const Vector2 &p_range);
- Vector2 _get_shape_range() const;
+ uint32_t owner_id;
+ CollisionObject2D *parent;
+ bool disabled;
+ bool one_way_collision;
Vector<Vector<Vector2> > _decompose_in_convex();
+ void _build_polygon();
+
protected:
void _notification(int p_what);
static void _bind_methods();
public:
- void set_trigger(bool p_trigger);
- bool is_trigger() const;
-
void set_build_mode(BuildMode p_mode);
BuildMode get_build_mode() const;
@@ -77,11 +71,14 @@ public:
virtual Rect2 get_item_rect() const;
- int get_collision_object_first_shape() const { return shape_from; }
- int get_collision_object_last_shape() const { return shape_to; }
-
virtual String get_configuration_warning() const;
+ void set_disabled(bool p_disabled);
+ bool is_disabled() const;
+
+ void set_one_way_collision(bool p_enable);
+ bool is_one_way_collision_enabled() const;
+
CollisionPolygon2D();
};
diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp
index 39e0017e92..ff4aa245ec 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/scene/2d/collision_shape_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,68 +37,48 @@
#include "scene/resources/segment_shape_2d.h"
#include "scene/resources/shape_line_2d.h"
-void CollisionShape2D::_add_to_collision_object(Object *p_obj) {
-
- if (unparenting)
- return;
-
- CollisionObject2D *co = p_obj->cast_to<CollisionObject2D>();
- ERR_FAIL_COND(!co);
- update_shape_index = co->get_shape_count();
- co->add_shape(shape, get_transform());
- if (trigger)
- co->set_shape_as_trigger(co->get_shape_count() - 1, true);
-}
-
void CollisionShape2D::_shape_changed() {
update();
- _update_parent();
-}
-
-void CollisionShape2D::_update_parent() {
-
- Node *parent = get_parent();
- if (!parent)
- return;
- CollisionObject2D *co = parent->cast_to<CollisionObject2D>();
- if (!co)
- return;
- co->_update_shapes_from_children();
}
void CollisionShape2D::_notification(int p_what) {
switch (p_what) {
- case NOTIFICATION_ENTER_TREE: {
- unparenting = false;
- can_update_body = get_tree()->is_editor_hint();
- if (!get_tree()->is_editor_hint()) {
+ case NOTIFICATION_PARENTED: {
+
+ parent = get_parent()->cast_to<CollisionObject2D>();
+ if (parent) {
+ owner_id = parent->create_shape_owner(this);
+ if (shape.is_valid()) {
+ parent->shape_owner_add_shape(owner_id, shape);
+ }
+ parent->shape_owner_set_transform(owner_id, get_transform());
+ parent->shape_owner_set_disabled(owner_id, disabled);
+ parent->shape_owner_set_one_way_collision(owner_id, one_way_collision);
+ }
+
+ /*if (get_tree()->is_editor_hint()) {
//display above all else
set_z_as_relative(false);
set_z(VS::CANVAS_ITEM_Z_MAX - 1);
- }
+ }*/
} break;
case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
- if (!is_inside_tree())
- break;
- if (can_update_body) {
- _update_parent();
- } else if (update_shape_index >= 0) {
-
- CollisionObject2D *co = get_parent()->cast_to<CollisionObject2D>();
- if (co) {
- co->set_shape_transform(update_shape_index, get_transform());
- }
+ if (parent) {
+ parent->shape_owner_set_transform(owner_id, get_transform());
}
} break;
- case NOTIFICATION_EXIT_TREE: {
- can_update_body = false;
-
+ case NOTIFICATION_UNPARENTED: {
+ if (parent) {
+ parent->remove_shape_owner(owner_id);
+ }
+ owner_id = 0;
+ parent = NULL;
} break;
/*
case NOTIFICATION_TRANSFORM_CHANGED: {
@@ -120,15 +101,33 @@ void CollisionShape2D::_notification(int p_what) {
rect = Rect2();
Color draw_col = get_tree()->get_debug_collisions_color();
+ if (disabled) {
+ float g = draw_col.gray();
+ draw_col.r = g;
+ draw_col.g = g;
+ draw_col.b = g;
+ }
shape->draw(get_canvas_item(), draw_col);
rect = shape->get_rect();
rect = rect.grow(3);
- } break;
- case NOTIFICATION_UNPARENTED: {
- unparenting = true;
- _update_parent();
+ if (one_way_collision) {
+ Color dcol = get_tree()->get_debug_collisions_color(); //0.9,0.2,0.2,0.4);
+ dcol.a = 1.0;
+ Vector2 line_to(0, 20);
+ draw_line(Vector2(), line_to, dcol, 3);
+ Vector<Vector2> pts;
+ float tsize = 8;
+ pts.push_back(line_to + (Vector2(0, tsize)));
+ pts.push_back(line_to + (Vector2(0.707 * tsize, 0)));
+ pts.push_back(line_to + (Vector2(-0.707 * tsize, 0)));
+ Vector<Color> cols;
+ for (int i = 0; i < 3; i++)
+ cols.push_back(dcol);
+
+ draw_primitive(pts, cols, Vector<Vector2>()); //small arrow
+ }
} break;
}
}
@@ -139,14 +138,13 @@ void CollisionShape2D::set_shape(const Ref<Shape2D> &p_shape) {
shape->disconnect("changed", this, "_shape_changed");
shape = p_shape;
update();
- if (is_inside_tree() && can_update_body)
- _update_parent();
- if (is_inside_tree() && !can_update_body && update_shape_index >= 0) {
- CollisionObject2D *co = get_parent()->cast_to<CollisionObject2D>();
- if (co) {
- co->set_shape(update_shape_index, p_shape);
+ if (parent) {
+ parent->shape_owner_clear_shapes(owner_id);
+ if (shape.is_valid()) {
+ parent->shape_owner_add_shape(owner_id, shape);
}
}
+
if (shape.is_valid())
shape->connect("changed", this, "_shape_changed");
@@ -163,72 +161,65 @@ Rect2 CollisionShape2D::get_item_rect() const {
return rect;
}
-void CollisionShape2D::set_trigger(bool p_trigger) {
+String CollisionShape2D::get_configuration_warning() const {
- trigger = p_trigger;
- if (can_update_body) {
- _update_parent();
- } else if (is_inside_tree() && update_shape_index >= 0) {
- CollisionObject2D *co = get_parent()->cast_to<CollisionObject2D>();
- if (co) {
- co->set_shape_as_trigger(update_shape_index, p_trigger);
- }
+ if (!get_parent()->cast_to<CollisionObject2D>()) {
+ return TTR("CollisionShape2D only serves to provide a collision shape to a CollisionObject2D derived node. Please only use it as a child of Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape.");
}
-}
-bool CollisionShape2D::is_trigger() const {
+ if (!shape.is_valid()) {
+ return TTR("A shape must be provided for CollisionShape2D to function. Please create a shape resource for it!");
+ }
- return trigger;
+ return String();
}
-void CollisionShape2D::_set_update_shape_index(int p_index) {
-
- update_shape_index = p_index;
+void CollisionShape2D::set_disabled(bool p_disabled) {
+ disabled = p_disabled;
+ update();
+ if (parent) {
+ parent->shape_owner_set_disabled(owner_id, p_disabled);
+ }
}
-int CollisionShape2D::_get_update_shape_index() const {
-
- return update_shape_index;
+bool CollisionShape2D::is_disabled() const {
+ return disabled;
}
-String CollisionShape2D::get_configuration_warning() const {
-
- if (!get_parent()->cast_to<CollisionObject2D>()) {
- return TTR("CollisionShape2D only serves to provide a collision shape to a CollisionObject2D derived node. Please only use it as a child of Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape.");
+void CollisionShape2D::set_one_way_collision(bool p_enable) {
+ one_way_collision = p_enable;
+ update();
+ if (parent) {
+ parent->shape_owner_set_one_way_collision(owner_id, p_enable);
}
+}
- if (!shape.is_valid()) {
- return TTR("A shape must be provided for CollisionShape2D to function. Please create a shape resource for it!");
- }
+bool CollisionShape2D::is_one_way_collision_enabled() const {
- return String();
+ return one_way_collision;
}
void CollisionShape2D::_bind_methods() {
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("set_disabled", "disabled"), &CollisionShape2D::set_disabled);
+ ClassDB::bind_method(D_METHOD("is_disabled"), &CollisionShape2D::is_disabled);
+ ClassDB::bind_method(D_METHOD("set_one_way_collision", "enabled"), &CollisionShape2D::set_one_way_collision);
+ ClassDB::bind_method(D_METHOD("is_one_way_collision_enabled"), &CollisionShape2D::is_one_way_collision_enabled);
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(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(D_METHOD("get_collision_object_shape_index"), &CollisionShape2D::get_collision_object_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");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "one_way_collision"), "set_one_way_collision", "is_one_way_collision_enabled");
}
CollisionShape2D::CollisionShape2D() {
rect = Rect2(-Point2(10, 10), Point2(20, 20));
set_notify_local_transform(true);
- trigger = false;
- unparenting = false;
- can_update_body = false;
- update_shape_index = -1;
+ owner_id = 0;
+ parent = NULL;
+ disabled = false;
+ one_way_collision = false;
}
diff --git a/scene/2d/collision_shape_2d.h b/scene/2d/collision_shape_2d.h
index a3395cdc1e..1f2b96b91f 100644
--- a/scene/2d/collision_shape_2d.h
+++ b/scene/2d/collision_shape_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,35 +33,33 @@
#include "scene/2d/node_2d.h"
#include "scene/resources/shape_2d.h"
+class CollisionObject2D;
+
class CollisionShape2D : public Node2D {
- GDCLASS(CollisionShape2D, Node2D);
+ GDCLASS(CollisionShape2D, Node2D)
Ref<Shape2D> shape;
Rect2 rect;
- bool trigger;
- bool unparenting;
- bool can_update_body;
+ uint32_t owner_id;
+ CollisionObject2D *parent;
void _shape_changed();
- int update_shape_index;
-
- void _set_update_shape_index(int p_index);
- int _get_update_shape_index() const;
+ bool disabled;
+ bool one_way_collision;
protected:
- void _update_parent();
void _notification(int p_what);
static void _bind_methods();
- void _add_to_collision_object(Object *p_obj);
-
public:
void set_shape(const Ref<Shape2D> &p_shape);
Ref<Shape2D> get_shape() const;
virtual Rect2 get_item_rect() const;
- void set_trigger(bool p_trigger);
- bool is_trigger() const;
- int get_collision_object_shape_index() const { return _get_update_shape_index(); }
+ void set_disabled(bool p_disabled);
+ bool is_disabled() const;
+
+ void set_one_way_collision(bool p_enable);
+ bool is_one_way_collision_enabled() const;
virtual String get_configuration_warning() const;
diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp
index 96ef714f1b..1bb40a28b5 100644
--- a/scene/2d/joints_2d.cpp
+++ b/scene/2d/joints_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/joints_2d.h b/scene/2d/joints_2d.h
index c172620461..f854ce51ee 100644
--- a/scene/2d/joints_2d.h
+++ b/scene/2d/joints_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -80,7 +81,7 @@ protected:
static void _bind_methods();
public:
- void set_softness(real_t p_stiffness);
+ void set_softness(real_t p_softness);
real_t get_softness() const;
PinJoint2D();
diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp
index 7cf98c8c09..ffe69fa93f 100644
--- a/scene/2d/light_2d.cpp
+++ b/scene/2d/light_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -335,6 +336,17 @@ String Light2D::get_configuration_warning() const {
return String();
}
+void Light2D::set_shadow_smooth(float p_amount) {
+
+ shadow_smooth = p_amount;
+ VS::get_singleton()->canvas_light_set_shadow_smooth(canvas_light, shadow_smooth);
+}
+
+float Light2D::get_shadow_smooth() const {
+
+ return shadow_smooth;
+}
+
void Light2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &Light2D::set_enabled);
@@ -388,6 +400,9 @@ void Light2D::_bind_methods() {
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(D_METHOD("set_shadow_smooth", "smooth"), &Light2D::set_shadow_smooth);
+ ClassDB::bind_method(D_METHOD("get_shadow_smooth"), &Light2D::get_shadow_smooth);
+
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);
@@ -401,7 +416,7 @@ void Light2D::_bind_methods() {
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::REAL, "texture_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");
@@ -419,6 +434,7 @@ void Light2D::_bind_methods() {
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::REAL, "shadow_filter_smooth", PROPERTY_HINT_RANGE, "0,64,0.1"), "set_shadow_smooth", "get_shadow_smooth");
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);
@@ -448,6 +464,7 @@ Light2D::Light2D() {
energy = 1.0;
shadow_color = Color(0, 0, 0, 0);
shadow_filter = SHADOW_FILTER_NONE;
+ shadow_smooth = 0;
set_notify_transform(true);
}
diff --git a/scene/2d/light_2d.h b/scene/2d/light_2d.h
index e9f0e069d4..90e55aeda4 100644
--- a/scene/2d/light_2d.h
+++ b/scene/2d/light_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -68,6 +69,7 @@ private:
int item_mask;
int item_shadow_mask;
int shadow_buffer_size;
+ float shadow_smooth;
float shadow_gradient_length;
Mode mode;
Ref<Texture> texture;
@@ -145,6 +147,9 @@ public:
void set_shadow_color(const Color &p_shadow_color);
Color get_shadow_color() const;
+ void set_shadow_smooth(float p_amount);
+ float get_shadow_smooth() const;
+
virtual Rect2 get_item_rect() const;
String get_configuration_warning() const;
diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp
index 401bbcedb2..a1a8e7d9c4 100644
--- a/scene/2d/light_occluder_2d.cpp
+++ b/scene/2d/light_occluder_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -211,8 +212,8 @@ String LightOccluder2D::get_configuration_warning() const {
void LightOccluder2D::_bind_methods() {
- 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(D_METHOD("set_occluder_polygon", "polygon"), &LightOccluder2D::set_occluder_polygon);
+ ClassDB::bind_method(D_METHOD("get_occluder_polygon"), &LightOccluder2D::get_occluder_polygon);
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);
diff --git a/scene/2d/light_occluder_2d.h b/scene/2d/light_occluder_2d.h
index 26135334fc..30c30b1a47 100644
--- a/scene/2d/light_occluder_2d.h
+++ b/scene/2d/light_occluder_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp
index cd9b8e8cb9..5438557d0b 100644
--- a/scene/2d/line_2d.cpp
+++ b/scene/2d/line_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -98,7 +99,7 @@ Color Line2D::get_default_color() const {
return _default_color;
}
-void Line2D::set_gradient(const Ref<ColorRamp> &gradient) {
+void Line2D::set_gradient(const Ref<Gradient> &gradient) {
// Cleanup previous connection if any
if (_gradient.is_valid()) {
@@ -115,7 +116,7 @@ void Line2D::set_gradient(const Ref<ColorRamp> &gradient) {
update();
}
-Ref<ColorRamp> Line2D::get_gradient() const {
+Ref<Gradient> Line2D::get_gradient() const {
return _gradient;
}
@@ -309,12 +310,15 @@ void Line2D::_bind_methods() {
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_GROUP("Fill", "");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "gradient", PROPERTY_HINT_RESOURCE_TYPE, "Gradient"), "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_GROUP("Capping", "");
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_GROUP("Border", "");
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");
diff --git a/scene/2d/line_2d.h b/scene/2d/line_2d.h
index 2cd71e9727..e8ca5e6e7c 100644
--- a/scene/2d/line_2d.h
+++ b/scene/2d/line_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -56,8 +57,8 @@ public:
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_gradient(const Ref<Gradient> &gradient);
+ Ref<Gradient> get_gradient() const;
void set_texture(const Ref<Texture> &texture);
Ref<Texture> get_texture() const;
@@ -96,7 +97,7 @@ private:
LineCapMode _end_cap_mode;
float _width;
Color _default_color;
- Ref<ColorRamp> _gradient;
+ Ref<Gradient> _gradient;
Ref<Texture> _texture;
LineTextureMode _texture_mode;
float _sharp_limit;
diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp
index 024c0b89ee..3c1410edbb 100644
--- a/scene/2d/line_builder.cpp
+++ b/scene/2d/line_builder.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -82,8 +83,8 @@ static inline Vector2 rotate90(const Vector2 &v) {
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));
+ Math::lerp(r.position.x, r.position.x + r.get_size().x, v.x),
+ Math::lerp(r.position.y, r.position.y + r.get_size().y, v.y));
}
//----------------------------------------------------------------------------
@@ -336,7 +337,7 @@ void LineBuilder::build() {
} 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);
+ strip_add_arc(pos1, vbegin.angle_to(vend), orientation);
}
if (intersection_result != SEGMENT_INTERSECT)
@@ -497,7 +498,7 @@ void LineBuilder::strip_add_arc(Vector2 center, float angle_delta, Orientation o
if (angle_delta < 0.f)
angle_step = -angle_step;
- float t = vbegin.angle_to(Vector2(1, 0));
+ float t = Vector2(1, 0).angle_to(vbegin);
float end_angle = t + angle_delta;
Vector2 rpos(0, 0);
@@ -524,7 +525,7 @@ void LineBuilder::new_arc(Vector2 center, Vector2 vbegin, float angle_delta, Col
if (angle_delta < 0.f)
angle_step = -angle_step;
- float t = vbegin.angle_to(Vector2(1, 0));
+ float t = Vector2(1, 0).angle_to(vbegin);
float end_angle = t + angle_delta;
Vector2 rpos(0, 0);
float tt_begin = -Math_PI / 2.f;
diff --git a/scene/2d/line_builder.h b/scene/2d/line_builder.h
index 43fd281d99..0e1a2aaf50 100644
--- a/scene/2d/line_builder.h
+++ b/scene/2d/line_builder.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -61,7 +62,7 @@ public:
LineCapMode end_cap_mode;
float width;
Color default_color;
- ColorRamp *gradient;
+ Gradient *gradient;
LineTextureMode texture_mode;
float sharp_limit;
int round_precision;
diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp
index f0280a2f81..383236b4ca 100644
--- a/scene/2d/navigation2d.cpp
+++ b/scene/2d/navigation2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -645,7 +646,8 @@ debug path
break;
}
- path.push_back(begin_point);
+ if (path[path.size() - 1].distance_to(begin_point) > CMP_EPSILON)
+ path.push_back(begin_point);
path.invert();
}
@@ -762,7 +764,7 @@ Object *Navigation2D::get_closest_point_owner(const Vector2 &p_point) {
void Navigation2D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("navpoly_create", "mesh:NavigationPolygon", "xform", "owner"), &Navigation2D::navpoly_create, DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("navpoly_create", "mesh", "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);
diff --git a/scene/2d/navigation2d.h b/scene/2d/navigation2d.h
index afa565518d..54e89de9e2 100644
--- a/scene/2d/navigation2d.h
+++ b/scene/2d/navigation2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -56,9 +57,9 @@ class Navigation2D : public Node2D {
return (a.key == p_key.a.key) ? (b.key < p_key.b.key) : (a.key < p_key.a.key);
};
- EdgeKey(const Point &p_a = Point(), const Point &p_b = Point()) {
- a = p_a;
- b = p_b;
+ EdgeKey(const Point &p_a = Point(), const Point &p_b = Point())
+ : a(p_a),
+ b(p_b) {
if (a.key > b.key) {
SWAP(a, b);
}
diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp
index 570bd00a5b..779751c1c5 100644
--- a/scene/2d/navigation_polygon.cpp
+++ b/scene/2d/navigation_polygon.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,9 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "navigation_polygon.h"
+
#include "core_string_names.h"
#include "navigation2d.h"
-#include "triangulator.h"
+
+#include "thirdparty/misc/triangulator.h"
void NavigationPolygon::set_vertices(const PoolVector<Vector2> &p_vertices) {
@@ -456,8 +459,8 @@ String NavigationPolygonInstance::get_configuration_warning() const {
void NavigationPolygonInstance::_bind_methods() {
- 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(D_METHOD("set_navigation_polygon", "navpoly"), &NavigationPolygonInstance::set_navigation_polygon);
+ ClassDB::bind_method(D_METHOD("get_navigation_polygon"), &NavigationPolygonInstance::get_navigation_polygon);
ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &NavigationPolygonInstance::set_enabled);
ClassDB::bind_method(D_METHOD("is_enabled"), &NavigationPolygonInstance::is_enabled);
diff --git a/scene/2d/navigation_polygon.h b/scene/2d/navigation_polygon.h
index 6bc3b903c7..f6e6ed210a 100644
--- a/scene/2d/navigation_polygon.h
+++ b/scene/2d/navigation_polygon.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp
index 1ba6ec46cf..98d6a467b1 100644
--- a/scene/2d/node_2d.cpp
+++ b/scene/2d/node_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -63,9 +64,10 @@ void Node2D::edit_set_state(const Variant &p_state) {
angle = state[1];
_scale = state[2];
_update_transform();
- _change_notify("transform/rot");
- _change_notify("transform/scale");
- _change_notify("transform/pos");
+ _change_notify("rotation");
+ _change_notify("rotation_deg");
+ _change_notify("scale");
+ _change_notify("position");
}
void Node2D::edit_set_rect(const Rect2 &p_edit_rect) {
@@ -74,9 +76,9 @@ void Node2D::edit_set_rect(const Rect2 &p_edit_rect) {
Vector2 zero_offset;
if (r.size.x != 0)
- zero_offset.x = -r.pos.x / r.size.x;
+ zero_offset.x = -r.position.x / r.size.x;
if (r.size.y != 0)
- zero_offset.y = -r.pos.y / r.size.y;
+ zero_offset.y = -r.position.y / r.size.y;
Size2 new_scale(1, 1);
@@ -85,7 +87,7 @@ void Node2D::edit_set_rect(const Rect2 &p_edit_rect) {
if (r.size.y != 0)
new_scale.y = p_edit_rect.size.y / r.size.y;
- Point2 new_pos = p_edit_rect.pos + p_edit_rect.size * zero_offset; //p_edit_rect.pos - r.pos;
+ Point2 new_pos = p_edit_rect.position + p_edit_rect.size * zero_offset; //p_edit_rect.pos - r.pos;
Transform2D postxf;
postxf.set_rotation_and_scale(angle, _scale);
@@ -95,15 +97,16 @@ void Node2D::edit_set_rect(const Rect2 &p_edit_rect) {
_scale *= new_scale;
_update_transform();
- _change_notify("transform/scale");
- _change_notify("transform/pos");
+ _change_notify("scale");
+ _change_notify("position");
}
void Node2D::edit_rotate(float p_rot) {
angle += p_rot;
_update_transform();
- _change_notify("transform/rot");
+ _change_notify("rotation");
+ _change_notify("rotation_deg");
}
void Node2D::_update_xform_values() {
@@ -134,7 +137,7 @@ void Node2D::set_position(const Point2 &p_pos) {
((Node2D *)this)->_update_xform_values();
pos = p_pos;
_update_transform();
- _change_notify("transform/pos");
+ _change_notify("position");
}
void Node2D::set_rotation(float p_radians) {
@@ -143,7 +146,8 @@ void Node2D::set_rotation(float p_radians) {
((Node2D *)this)->_update_xform_values();
angle = p_radians;
_update_transform();
- _change_notify("transform/rot");
+ _change_notify("rotation");
+ _change_notify("rotation_deg");
}
void Node2D::set_rotation_in_degrees(float p_degrees) {
@@ -169,7 +173,7 @@ void Node2D::set_scale(const Size2 &p_scale) {
if (_scale.y == 0)
_scale.y = CMP_EPSILON;
_update_transform();
- _change_notify("transform/scale");
+ _change_notify("scale");
}
Point2 Node2D::get_position() const {
@@ -239,7 +243,7 @@ void Node2D::global_translate(const Vector2 &p_amount) {
set_global_position(get_global_position() + p_amount);
}
-void Node2D::scale(const Size2 &p_amount) {
+void Node2D::apply_scale(const Size2 &p_amount) {
set_scale(get_scale() * p_amount);
}
@@ -315,7 +319,7 @@ void Node2D::set_global_scale(const Size2 &p_scale) {
CanvasItem *pi = get_parent_item();
if (pi) {
const Size2 parent_global_scale = pi->get_global_transform().get_scale();
- set_scale(p_scale - parent_global_scale);
+ set_scale(p_scale / parent_global_scale);
} else {
set_scale(p_scale);
}
@@ -349,6 +353,7 @@ void Node2D::set_z(int p_z) {
ERR_FAIL_COND(p_z > VS::CANVAS_ITEM_Z_MAX);
z = p_z;
VS::get_singleton()->canvas_item_set_z(get_canvas_item(), z);
+ _change_notify("z");
}
void Node2D::set_z_as_relative(bool p_enabled) {
@@ -393,6 +398,16 @@ float Node2D::get_angle_to(const Vector2 &p_pos) const {
return (get_global_transform().affine_inverse().xform(p_pos)).angle();
}
+Point2 Node2D::to_local(Point2 p_global) const {
+
+ return get_global_transform().affine_inverse().xform(p_global);
+}
+
+Point2 Node2D::to_global(Point2 p_local) const {
+
+ return get_global_transform().xform(p_local);
+}
+
void Node2D::_bind_methods() {
// TODO: Obsolete those two methods (old name) properly (GH-4397)
@@ -414,7 +429,7 @@ void Node2D::_bind_methods() {
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(D_METHOD("apply_scale", "ratio"), &Node2D::apply_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);
@@ -431,6 +446,9 @@ void Node2D::_bind_methods() {
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(D_METHOD("to_local", "global_point"), &Node2D::to_local);
+ ClassDB::bind_method(D_METHOD("to_global", "local_point"), &Node2D::to_global);
+
ClassDB::bind_method(D_METHOD("set_z", "z"), &Node2D::set_z);
ClassDB::bind_method(D_METHOD("get_z"), &Node2D::get_z);
diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h
index b9c6894333..a6009851c7 100644
--- a/scene/2d/node_2d.h
+++ b/scene/2d/node_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -48,7 +49,7 @@ class Node2D : public CanvasItem {
void _update_transform();
// Deprecated, should be removed in a future version.
- void _set_rotd(float p_angle);
+ void _set_rotd(float p_degrees);
float _get_rotd() const;
void _update_xform_values();
@@ -77,7 +78,7 @@ public:
void move_y(float p_delta, bool p_scaled = false);
void translate(const Vector2 &p_amount);
void global_translate(const Vector2 &p_amount);
- void scale(const Size2 &p_amount);
+ void apply_scale(const Size2 &p_amount);
Point2 get_position() const;
float get_rotation() const;
@@ -103,6 +104,9 @@ public:
void look_at(const Vector2 &p_pos);
float get_angle_to(const Vector2 &p_pos) const;
+ Point2 to_local(Point2 p_global) const;
+ Point2 to_global(Point2 p_local) const;
+
void set_z_as_relative(bool p_enabled);
bool is_z_relative() const;
diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp
index 17bc26aa7f..433ab5ff8d 100644
--- a/scene/2d/parallax_background.cpp
+++ b/scene/2d/parallax_background.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/parallax_background.h b/scene/2d/parallax_background.h
index 5914c21c95..fce1bbd928 100644
--- a/scene/2d/parallax_background.h
+++ b/scene/2d/parallax_background.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -59,7 +60,7 @@ public:
void set_scroll_offset(const Point2 &p_ofs);
Point2 get_scroll_offset() const;
- void set_scroll_scale(float p_ofs);
+ void set_scroll_scale(float p_scale);
float get_scroll_scale() const;
void set_scroll_base_offset(const Point2 &p_ofs);
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp
index 2387234607..0e83b9aaae 100644
--- a/scene/2d/parallax_layer.cpp
+++ b/scene/2d/parallax_layer.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/parallax_layer.h b/scene/2d/parallax_layer.h
index 01293e85ac..f2d0053342 100644
--- a/scene/2d/parallax_layer.h
+++ b/scene/2d/parallax_layer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -47,7 +48,7 @@ protected:
static void _bind_methods();
public:
- void set_motion_offset(const Size2 &p_scale);
+ void set_motion_offset(const Size2 &p_offset);
Size2 get_motion_offset() const;
void set_motion_scale(const Size2 &p_scale);
@@ -56,7 +57,7 @@ public:
void set_mirroring(const Size2 &p_mirroring);
Size2 get_mirroring() const;
- void set_base_offset_and_scale(const Point2 &p_offsetf, float p_scale);
+ void set_base_offset_and_scale(const Point2 &p_offset, float p_scale);
virtual String get_configuration_warning() const;
ParallaxLayer();
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp
index c9d5bebe56..a2ec33f403 100644
--- a/scene/2d/particles_2d.cpp
+++ b/scene/2d/particles_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,903 +28,248 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "particles_2d.h"
-#include "scene/scene_string_names.h"
-
-void ParticleAttractor2D::_notification(int p_what) {
-
- switch (p_what) {
-
- case NOTIFICATION_ENTER_TREE: {
-
- _update_owner();
- } break;
- case NOTIFICATION_DRAW: {
-
- if (!get_tree()->is_editor_hint())
- return;
-
- Vector2 pv;
- float dr = MIN(disable_radius, radius);
- for (int i = 0; i <= 32; i++) {
- Vector2 v(Math::sin(i / 32.0 * Math_PI * 2), Math::cos(i / 32.0 * Math_PI * 2));
- if (i > 0) {
- draw_line(pv * radius, v * radius, Color(0, 0, 0.5, 0.9));
- if (dr > 0) {
- draw_line(pv * dr, v * dr, Color(0.5, 0, 0.0, 0.9));
- }
- }
- pv = v;
- }
-
- } break;
- case NOTIFICATION_EXIT_TREE: {
- if (owner) {
- _set_owner(NULL);
- }
-
- } break;
- }
-}
+#include "scene/3d/particles.h"
+#include "scene/scene_string_names.h"
-void ParticleAttractor2D::_owner_exited() {
+void Particles2D::set_emitting(bool p_emitting) {
- ERR_FAIL_COND(!owner);
- owner->attractors.erase(this);
- owner = NULL;
+ emitting = p_emitting;
+ VS::get_singleton()->particles_set_emitting(particles, emitting);
}
-void ParticleAttractor2D::_update_owner() {
-
- if (!is_inside_tree() || !has_node(path)) {
- _set_owner(NULL);
- return;
- }
-
- Node *n = get_node(path);
- ERR_FAIL_COND(!n);
- Particles2D *pn = n->cast_to<Particles2D>();
- if (!pn) {
- _set_owner(NULL);
- return;
- }
+void Particles2D::set_amount(int p_amount) {
- _set_owner(pn);
+ ERR_FAIL_COND(p_amount < 1);
+ amount = p_amount;
+ VS::get_singleton()->particles_set_amount(particles, amount);
}
+void Particles2D::set_lifetime(float p_lifetime) {
-void ParticleAttractor2D::_set_owner(Particles2D *p_owner) {
-
- if (owner == p_owner)
- return;
-
- if (owner) {
- owner->disconnect("tree_exited", this, "_owner_exited");
- owner->attractors.erase(this);
- owner = NULL;
- }
- owner = p_owner;
-
- if (owner) {
-
- owner->connect("tree_exited", this, "_owner_exited", varray(), CONNECT_ONESHOT);
- owner->attractors.insert(this);
- }
+ ERR_FAIL_COND(p_lifetime <= 0);
+ lifetime = p_lifetime;
+ VS::get_singleton()->particles_set_lifetime(particles, lifetime);
}
-void ParticleAttractor2D::_bind_methods() {
-
- ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &ParticleAttractor2D::set_enabled);
- ClassDB::bind_method(D_METHOD("is_enabled"), &ParticleAttractor2D::is_enabled);
-
- ClassDB::bind_method(D_METHOD("set_radius", "radius"), &ParticleAttractor2D::set_radius);
- ClassDB::bind_method(D_METHOD("get_radius"), &ParticleAttractor2D::get_radius);
+void Particles2D::set_one_shot(bool p_enable) {
- 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(D_METHOD("set_gravity", "gravity"), &ParticleAttractor2D::set_gravity);
- ClassDB::bind_method(D_METHOD("get_gravity"), &ParticleAttractor2D::get_gravity);
-
- ClassDB::bind_method(D_METHOD("set_absorption", "absorption"), &ParticleAttractor2D::set_absorption);
- ClassDB::bind_method(D_METHOD("get_absorption"), &ParticleAttractor2D::get_absorption);
-
- 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"), "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");
+ one_shot = p_enable;
+ VS::get_singleton()->particles_set_one_shot(particles, one_shot);
+ if (!one_shot && emitting)
+ VisualServer::get_singleton()->particles_restart(particles);
}
+void Particles2D::set_pre_process_time(float p_time) {
-void ParticleAttractor2D::set_enabled(bool p_enabled) {
-
- enabled = p_enabled;
+ pre_process_time = p_time;
+ VS::get_singleton()->particles_set_pre_process_time(particles, pre_process_time);
}
+void Particles2D::set_explosiveness_ratio(float p_ratio) {
-bool ParticleAttractor2D::is_enabled() const {
-
- return enabled;
+ explosiveness_ratio = p_ratio;
+ VS::get_singleton()->particles_set_explosiveness_ratio(particles, explosiveness_ratio);
}
+void Particles2D::set_randomness_ratio(float p_ratio) {
-void ParticleAttractor2D::set_radius(float p_radius) {
-
- radius = p_radius;
- update();
+ randomness_ratio = p_ratio;
+ VS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio);
}
+void Particles2D::set_visibility_rect(const Rect2 &p_aabb) {
-float ParticleAttractor2D::get_radius() const {
+ visibility_rect = p_aabb;
+ Rect3 aabb;
+ aabb.position.x = p_aabb.position.x;
+ aabb.position.y = p_aabb.position.y;
+ aabb.size.x = p_aabb.size.x;
+ aabb.size.y = p_aabb.size.y;
- return radius;
-}
+ VS::get_singleton()->particles_set_custom_aabb(particles, aabb);
-void ParticleAttractor2D::set_disable_radius(float p_disable_radius) {
-
- disable_radius = p_disable_radius;
+ _change_notify("visibility_rect");
update();
}
-float ParticleAttractor2D::get_disable_radius() const {
-
- return disable_radius;
-}
-
-void ParticleAttractor2D::set_gravity(float p_gravity) {
-
- gravity = p_gravity;
-}
-float ParticleAttractor2D::get_gravity() const {
-
- return gravity;
-}
-
-void ParticleAttractor2D::set_absorption(float p_absorption) {
-
- absorption = p_absorption;
-}
-float ParticleAttractor2D::get_absorption() const {
-
- return absorption;
-}
-
-void ParticleAttractor2D::set_particles_path(NodePath p_path) {
-
- path = p_path;
- _update_owner();
- update_configuration_warning();
-}
-NodePath ParticleAttractor2D::get_particles_path() const {
-
- return path;
-}
+void Particles2D::set_use_local_coordinates(bool p_enable) {
-String ParticleAttractor2D::get_configuration_warning() const {
-
- if (!has_node(path) || !get_node(path) || !get_node(path)->cast_to<Particles2D>()) {
- return TTR("Path property must point to a valid Particles2D node to work.");
+ local_coords = p_enable;
+ VS::get_singleton()->particles_set_use_local_coordinates(particles, local_coords);
+ set_notify_transform(!p_enable);
+ if (!p_enable && is_inside_tree()) {
+ _update_particle_emission_transform();
}
-
- return String();
-}
-
-ParticleAttractor2D::ParticleAttractor2D() {
-
- owner = NULL;
- radius = 50;
- disable_radius = 0;
- gravity = 100;
- absorption = 0;
- path = String("..");
- enabled = true;
}
-/****************************************/
+void Particles2D::_update_particle_emission_transform() {
-_FORCE_INLINE_ static float _rand_from_seed(uint64_t *seed) {
+ Transform2D xf2d = get_global_transform();
+ Transform xf;
+ xf.basis.set_axis(0, Vector3(xf2d.get_axis(0).x, xf2d.get_axis(0).y, 0));
+ xf.basis.set_axis(1, Vector3(xf2d.get_axis(1).x, xf2d.get_axis(1).y, 0));
+ xf.set_origin(Vector3(xf2d.get_origin().x, xf2d.get_origin().y, 0));
- uint32_t r = Math::rand_from_seed(seed);
- return 2.0f * (float)r / (float)Math::RANDOM_MAX - 1.0f;
+ VS::get_singleton()->particles_set_emission_transform(particles, xf);
}
-void Particles2D::_process_particles(float p_delta) {
-
- if (particles.size() == 0 || lifetime == 0)
- return;
-
- p_delta *= time_scale;
-
- float frame_time = p_delta;
-
- if (emit_timeout > 0) {
- time_to_live -= frame_time;
- if (time_to_live < 0) {
+void Particles2D::set_process_material(const Ref<Material> &p_material) {
- emitting = false;
- _change_notify("config/emitting");
- };
- };
-
- float next_time = time + frame_time;
-
- if (next_time > lifetime)
- next_time = Math::fmod(next_time, lifetime);
-
- Particle *pdata = &particles[0];
- int particle_count = particles.size();
- Transform2D xform;
- if (!local_space)
- xform = get_global_transform();
-
- active_count = 0;
-
- PoolVector<Point2>::Read r;
- int emission_point_count = 0;
- if (emission_points.size()) {
-
- emission_point_count = emission_points.size();
- r = emission_points.read();
+ process_material = p_material;
+ Ref<ParticlesMaterial> pm = p_material;
+ if (pm.is_valid() && !pm->get_flag(ParticlesMaterial::FLAG_DISABLE_Z) && pm->get_gravity() == Vector3(0, -9.8, 0)) {
+ //likely a new material, modify it!
+ pm->set_flag(ParticlesMaterial::FLAG_DISABLE_Z, true);
+ pm->set_gravity(Vector3(0, 98, 0));
}
+ RID material_rid;
+ if (process_material.is_valid())
+ material_rid = process_material->get_rid();
+ VS::get_singleton()->particles_set_process_material(particles, material_rid);
- int attractor_count = 0;
- AttractorCache *attractor_ptr = NULL;
-
- if (attractors.size()) {
- if (attractors.size() != attractor_cache.size()) {
- attractor_cache.resize(attractors.size());
- }
-
- int idx = 0;
- Transform2D m;
- if (local_space) {
- m = get_global_transform().affine_inverse();
- }
- for (Set<ParticleAttractor2D *>::Element *E = attractors.front(); E; E = E->next()) {
-
- attractor_cache[idx].pos = m.xform(E->get()->get_global_position());
- attractor_cache[idx].attractor = E->get();
- idx++;
- }
-
- attractor_ptr = attractor_cache.ptr();
- attractor_count = attractor_cache.size();
- }
-
- for (int i = 0; i < particle_count; i++) {
-
- Particle &p = pdata[i];
-
- float restart_time = (i * lifetime / particle_count) * explosiveness;
-
- bool restart = false;
-
- if (next_time < time) {
-
- if (restart_time > time || restart_time < next_time)
- restart = true;
-
- } else if (restart_time > time && restart_time < next_time) {
- restart = true;
- }
-
- if (restart) {
-
- if (emitting) {
-
- p.pos = emissor_offset;
- if (emission_point_count) {
-
- Vector2 ep = r[Math::rand() % emission_point_count];
- if (!local_space) {
- p.pos = xform.xform(p.pos + ep * extents);
- } else {
- p.pos += ep * extents;
- }
- } else {
- if (!local_space) {
- p.pos = xform.xform(p.pos + Vector2(Math::random(-extents.x, extents.x), Math::random(-extents.y, extents.y)));
- } else {
- p.pos += Vector2(Math::random(-extents.x, extents.x), Math::random(-extents.y, extents.y));
- }
- }
- p.seed = Math::rand() % 12345678;
- uint64_t rand_seed = p.seed * (i + 1);
-
- float angle = Math::deg2rad(param[PARAM_DIRECTION] + _rand_from_seed(&rand_seed) * param[PARAM_SPREAD]);
-
- p.velocity = Vector2(Math::sin(angle), Math::cos(angle));
- if (!local_space) {
-
- p.velocity = xform.basis_xform(p.velocity).normalized();
- }
-
- p.velocity *= param[PARAM_LINEAR_VELOCITY] + param[PARAM_LINEAR_VELOCITY] * _rand_from_seed(&rand_seed) * randomness[PARAM_LINEAR_VELOCITY];
- p.velocity += initial_velocity;
- p.active = true;
- p.rot = Math::deg2rad(param[PARAM_INITIAL_ANGLE] + param[PARAM_INITIAL_ANGLE] * randomness[PARAM_INITIAL_ANGLE] * _rand_from_seed(&rand_seed));
- active_count++;
-
- p.frame = Math::fmod(param[PARAM_ANIM_INITIAL_POS] + randomness[PARAM_ANIM_INITIAL_POS] * _rand_from_seed(&rand_seed), 1.0f);
-
- } else {
-
- p.active = false;
- }
-
- } else {
-
- if (!p.active)
- continue;
-
- uint64_t rand_seed = p.seed * (i + 1);
-
- Vector2 force;
-
- //apply gravity
- float gravity_dir = Math::deg2rad(param[PARAM_GRAVITY_DIRECTION] + 180 * randomness[PARAM_GRAVITY_DIRECTION] * _rand_from_seed(&rand_seed));
- force += Vector2(Math::sin(gravity_dir), Math::cos(gravity_dir)) * (param[PARAM_GRAVITY_STRENGTH] + param[PARAM_GRAVITY_STRENGTH] * randomness[PARAM_GRAVITY_STRENGTH] * _rand_from_seed(&rand_seed));
- //apply radial
- Vector2 rvec = (p.pos - emissor_offset).normalized();
- force += rvec * (param[PARAM_RADIAL_ACCEL] + param[PARAM_RADIAL_ACCEL] * randomness[PARAM_RADIAL_ACCEL] * _rand_from_seed(&rand_seed));
- //apply orbit
- float orbitvel = (param[PARAM_ORBIT_VELOCITY] + param[PARAM_ORBIT_VELOCITY] * randomness[PARAM_ORBIT_VELOCITY] * _rand_from_seed(&rand_seed));
- if (orbitvel != 0) {
- Vector2 rel = p.pos - xform.elements[2];
- Transform2D rot(orbitvel * frame_time, Vector2());
- p.pos = rot.xform(rel) + xform.elements[2];
- }
-
- Vector2 tvec = rvec.tangent();
- force += tvec * (param[PARAM_TANGENTIAL_ACCEL] + param[PARAM_TANGENTIAL_ACCEL] * randomness[PARAM_TANGENTIAL_ACCEL] * _rand_from_seed(&rand_seed));
-
- for (int j = 0; j < attractor_count; j++) {
-
- Vector2 vec = (attractor_ptr[j].pos - p.pos);
- float vl = vec.length();
-
- if (!attractor_ptr[j].attractor->enabled || vl == 0 || vl > attractor_ptr[j].attractor->radius)
- continue;
-
- force += vec * attractor_ptr[j].attractor->gravity;
- float fvl = p.velocity.length();
- if (fvl && attractor_ptr[j].attractor->absorption) {
- Vector2 target = vec.normalized();
- p.velocity = p.velocity.normalized().linear_interpolate(target, MIN(frame_time * attractor_ptr[j].attractor->absorption, 1)) * fvl;
- }
-
- if (attractor_ptr[j].attractor->disable_radius && vl < attractor_ptr[j].attractor->disable_radius) {
- p.active = false;
- }
- }
-
- p.velocity += force * frame_time;
-
- if (param[PARAM_DAMPING]) {
- float dmp = param[PARAM_DAMPING] + param[PARAM_DAMPING] * randomness[PARAM_DAMPING] * _rand_from_seed(&rand_seed);
- float v = p.velocity.length();
- v -= dmp * frame_time;
- if (v <= 0) {
- p.velocity = Vector2();
- } else {
- p.velocity = p.velocity.normalized() * v;
- }
- }
-
- p.pos += p.velocity * frame_time;
- p.rot += Math::lerp(param[PARAM_SPIN_VELOCITY], param[PARAM_SPIN_VELOCITY] * randomness[PARAM_SPIN_VELOCITY] * _rand_from_seed(&rand_seed), randomness[PARAM_SPIN_VELOCITY]) * frame_time;
- float anim_spd = param[PARAM_ANIM_SPEED_SCALE] + param[PARAM_ANIM_SPEED_SCALE] * randomness[PARAM_ANIM_SPEED_SCALE] * _rand_from_seed(&rand_seed);
- p.frame = Math::fposmod(p.frame + (frame_time / lifetime) * anim_spd, 1.0f);
-
- active_count++;
- }
- }
-
- 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();
-}
-
-void Particles2D::_notification(int p_what) {
-
- switch (p_what) {
-
- case NOTIFICATION_PROCESS: {
-
- _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;
- while (ppt > 0) {
- _process_particles(0.1);
- ppt -= 0.1;
- }
- } break;
- case NOTIFICATION_DRAW: {
-
- if (particles.size() == 0 || lifetime == 0)
- return;
-
- RID ci = get_canvas_item();
- Size2 size(1, 1);
- Point2 center;
- int total_frames = 1;
-
- if (!texture.is_null()) {
- size = texture->get_size();
- size.x /= h_frames;
- size.y /= v_frames;
- total_frames = h_frames * v_frames;
- }
-
- float time_pos = (time / lifetime);
-
- Particle *pdata = &particles[0];
- int particle_count = particles.size();
-
- RID texrid;
-
- if (texture.is_valid())
- texrid = texture->get_rid();
-
- Transform2D invxform;
- if (!local_space)
- invxform = get_global_transform().affine_inverse();
-
- int start_particle = (int)(time * (float)particle_count / lifetime);
-
- for (int id = 0; id < particle_count; ++id) {
- int i = start_particle + id;
- if (i >= particle_count) {
- i -= particle_count;
- }
-
- Particle &p = pdata[i];
- if (!p.active)
- continue;
-
- float ptime = ((float)i / particle_count) * explosiveness;
-
- if (ptime < time_pos)
- ptime = time_pos - ptime;
- else
- ptime = (1.0 - ptime) + time_pos;
-
- uint64_t rand_seed = p.seed * (i + 1);
-
- Color color;
-
- if (color_ramp.is_valid()) {
- color = color_ramp->get_color_at_offset(ptime);
- } else {
- color = default_color;
- }
-
- {
- float huerand = _rand_from_seed(&rand_seed);
- float huerot = param[PARAM_HUE_VARIATION] + randomness[PARAM_HUE_VARIATION] * huerand;
-
- if (Math::abs(huerot) > CMP_EPSILON) {
-
- float h = color.get_h();
- float s = color.get_s();
- float v = color.get_v();
- float a = color.a;
- //float preh=h;
- h += huerot;
- h = Math::abs(Math::fposmod(h, 1.0f));
- //print_line("rand: "+rtos(randomness[PARAM_HUE_VARIATION])+" rand: "+rtos(huerand));
- //print_line(itos(i)+":hue: "+rtos(preh)+" + "+rtos(huerot)+" = "+rtos(h));
- color.set_hsv(h, s, v);
- color.a = a;
- }
- }
-
- float initial_size = param[PARAM_INITIAL_SIZE] + param[PARAM_INITIAL_SIZE] * _rand_from_seed(&rand_seed) * randomness[PARAM_INITIAL_SIZE];
- float final_size = param[PARAM_FINAL_SIZE] + param[PARAM_FINAL_SIZE] * _rand_from_seed(&rand_seed) * randomness[PARAM_FINAL_SIZE];
-
- float size_mult = initial_size * (1.0 - ptime) + final_size * ptime;
-
- //Size2 rectsize=size * size_mult;
- //rectsize=rectsize.floor();
-
- //Rect2 r = Rect2(Vecto,rectsize);
-
- Transform2D xform;
-
- if (p.rot) {
-
- xform.set_rotation(p.rot);
- xform.translate(-size * size_mult / 2.0);
- xform.elements[2] += p.pos;
- } else {
- xform.elements[2] = -size * size_mult / 2.0;
- xform.elements[2] += p.pos;
- }
-
- if (!local_space) {
- xform = invxform * xform;
- }
-
- xform.scale_basis(Size2(size_mult, size_mult));
-
- VisualServer::get_singleton()->canvas_item_add_set_transform(ci, xform);
-
- if (texrid.is_valid()) {
-
- Rect2 src_rect;
- src_rect.size = size;
-
- if (total_frames > 1) {
- int frame = Math::fast_ftoi(Math::floor(p.frame * total_frames)) % total_frames;
- src_rect.pos.x = size.x * (frame % h_frames);
- 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);
- } else {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(), size), color);
- }
- }
-
- } break;
- }
+ update_configuration_warning();
}
-static const char *_particlesframe_property_names[Particles2D::PARAM_MAX] = {
- "params/direction",
- "params/spread",
- "params/linear_velocity",
- "params/spin_velocity",
- "params/orbit_velocity",
- "params/gravity_direction",
- "params/gravity_strength",
- "params/radial_accel",
- "params/tangential_accel",
- "params/damping",
- "params/initial_angle",
- "params/initial_size",
- "params/final_size",
- "params/hue_variation",
- "params/anim_speed_scale",
- "params/anim_initial_pos",
-};
-
-static const char *_particlesframe_property_rnames[Particles2D::PARAM_MAX] = {
- "randomness/direction",
- "randomness/spread",
- "randomness/linear_velocity",
- "randomness/spin_velocity",
- "randomness/orbit_velocity",
- "randomness/gravity_direction",
- "randomness/gravity_strength",
- "randomness/radial_accel",
- "randomness/tangential_accel",
- "randomness/damping",
- "randomness/initial_angle",
- "randomness/initial_size",
- "randomness/final_size",
- "randomness/hue_variation",
- "randomness/anim_speed_scale",
- "randomness/anim_initial_pos",
-};
-
-static const char *_particlesframe_property_ranges[Particles2D::PARAM_MAX] = {
- "0,360,0.01",
- "0,180,0.01",
- "-1024,1024,0.01",
- "-1024,1024,0.01",
- "-1024,1024,0.01",
- "0,360,0.01",
- "0,1024,0.01",
- "-128,128,0.01",
- "-128,128,0.01",
- "0,1024,0.001",
- "0,360,0.01",
- "0,1024,0.01",
- "0,1024,0.01",
- "0,1,0.01",
- "0,128,0.01",
- "0,1,0.01",
-};
-
-void Particles2D::set_emitting(bool p_emitting) {
-
- if (emitting == p_emitting)
- return;
-
- if (p_emitting) {
+void Particles2D::set_speed_scale(float p_scale) {
- if (active_count == 0)
- time = 0;
- set_process(process_mode == PROCESS_IDLE);
- set_fixed_process(process_mode == PROCESS_FIXED);
- time_to_live = emit_timeout;
- };
- emitting = p_emitting;
- _change_notify("config/emitting");
+ speed_scale = p_scale;
+ VS::get_singleton()->particles_set_speed_scale(particles, p_scale);
}
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);
-
- particles.resize(p_amount);
-}
int Particles2D::get_amount() const {
- return particles.size();
-}
-
-void Particles2D::set_emit_timeout(float p_timeout) {
-
- emit_timeout = p_timeout;
- time_to_live = p_timeout;
-};
-
-float Particles2D::get_emit_timeout() const {
-
- return emit_timeout;
-};
-
-void Particles2D::set_lifetime(float p_lifetime) {
-
- ERR_FAIL_INDEX(p_lifetime, 3600 + 1);
-
- lifetime = p_lifetime;
+ return amount;
}
float Particles2D::get_lifetime() const {
return lifetime;
}
-void Particles2D::set_time_scale(float p_time_scale) {
-
- time_scale = p_time_scale;
-}
-float Particles2D::get_time_scale() const {
+bool Particles2D::get_one_shot() const {
- return time_scale;
+ return one_shot;
}
-
-void Particles2D::set_pre_process_time(float p_pre_process_time) {
-
- preprocess = p_pre_process_time;
-}
-
float Particles2D::get_pre_process_time() const {
- return preprocess;
+ return pre_process_time;
}
+float Particles2D::get_explosiveness_ratio() const {
-void Particles2D::set_param(Parameter p_param, float p_value) {
-
- ERR_FAIL_INDEX(p_param, PARAM_MAX);
- param[p_param] = p_value;
+ return explosiveness_ratio;
}
-float Particles2D::get_param(Parameter p_param) const {
+float Particles2D::get_randomness_ratio() const {
- ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0);
- return param[p_param];
+ return randomness_ratio;
}
+Rect2 Particles2D::get_visibility_rect() const {
-void Particles2D::set_randomness(Parameter p_param, float p_value) {
-
- ERR_FAIL_INDEX(p_param, PARAM_MAX);
- randomness[p_param] = p_value;
+ return visibility_rect;
}
-float Particles2D::get_randomness(Parameter p_param) const {
+bool Particles2D::get_use_local_coordinates() const {
- ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0);
- return randomness[p_param];
+ return local_coords;
}
+Ref<Material> Particles2D::get_process_material() const {
-void Particles2D::set_texture(const Ref<Texture> &p_texture) {
-
- texture = p_texture;
+ return process_material;
}
-Ref<Texture> Particles2D::get_texture() const {
+float Particles2D::get_speed_scale() const {
- return texture;
+ return speed_scale;
}
-void Particles2D::set_color(const Color &p_color) {
+void Particles2D::set_draw_order(DrawOrder p_order) {
- default_color = p_color;
+ draw_order = p_order;
+ VS::get_singleton()->particles_set_draw_order(particles, VS::ParticlesDrawOrder(p_order));
}
-Color Particles2D::get_color() const {
+Particles2D::DrawOrder Particles2D::get_draw_order() const {
- return default_color;
+ return draw_order;
}
-void Particles2D::set_color_ramp(const Ref<ColorRamp> &p_color_ramp) {
-
- color_ramp = p_color_ramp;
+void Particles2D::set_fixed_fps(int p_count) {
+ fixed_fps = p_count;
+ VS::get_singleton()->particles_set_fixed_fps(particles, p_count);
}
-Ref<ColorRamp> Particles2D::get_color_ramp() const {
-
- return color_ramp;
+int Particles2D::get_fixed_fps() const {
+ return fixed_fps;
}
-void Particles2D::set_emissor_offset(const Point2 &p_offset) {
-
- emissor_offset = p_offset;
+void Particles2D::set_fractional_delta(bool p_enable) {
+ fractional_delta = p_enable;
+ VS::get_singleton()->particles_set_fractional_delta(particles, p_enable);
}
-Point2 Particles2D::get_emissor_offset() const {
-
- return emissor_offset;
+bool Particles2D::get_fractional_delta() const {
+ return fractional_delta;
}
-void Particles2D::set_use_local_space(bool p_use) {
-
- local_space = p_use;
-}
+String Particles2D::get_configuration_warning() const {
-bool Particles2D::is_using_local_space() const {
-
- return local_space;
-}
+ String warnings;
-//Deprecated. Converts color phases to color ramp
-void Particles2D::set_color_phases(int p_phases) {
-
- //Create color ramp if we have 2 or more phases.
- //Otherwise first phase phase will be assigned to default color.
- if (p_phases > 1 && color_ramp.is_null()) {
- color_ramp = Ref<ColorRamp>(memnew(ColorRamp()));
- }
- if (color_ramp.is_valid()) {
- color_ramp->get_points().resize(p_phases);
+ if (process_material.is_null()) {
+ if (warnings != String())
+ warnings += "\n";
+ warnings += "- " + TTR("A material to process the particles is not assigned, so no behavior is imprinted.");
}
-}
-
-//Deprecated.
-int Particles2D::get_color_phases() const {
- if (color_ramp.is_valid()) {
- return color_ramp->get_points_count();
- }
- return 0;
-}
-
-//Deprecated. Converts color phases to color ramp
-void Particles2D::set_color_phase_color(int p_phase, const Color &p_color) {
-
- ERR_FAIL_INDEX(p_phase, MAX_COLOR_PHASES);
- if (color_ramp.is_valid()) {
- if (color_ramp->get_points_count() > p_phase)
- color_ramp->set_color(p_phase, p_color);
- } else {
- if (p_phase == 0)
- default_color = p_color;
- }
-}
-
-//Deprecated.
-Color Particles2D::get_color_phase_color(int p_phase) const {
-
- ERR_FAIL_INDEX_V(p_phase, MAX_COLOR_PHASES, Color());
- if (color_ramp.is_valid()) {
- return color_ramp->get_color(p_phase);
- }
- return Color(0, 0, 0, 1);
+ return warnings;
}
-//Deprecated. Converts color phases to color ramp
-void Particles2D::set_color_phase_pos(int p_phase, float p_pos) {
- ERR_FAIL_INDEX(p_phase, MAX_COLOR_PHASES);
- ERR_FAIL_COND(p_pos < 0.0 || p_pos > 1.0);
- if (color_ramp.is_valid() && color_ramp->get_points_count() > p_phase) {
- return color_ramp->set_offset(p_phase, p_pos);
- }
-}
-
-//Deprecated.
-float Particles2D::get_color_phase_pos(int p_phase) const {
+Rect2 Particles2D::capture_rect() const {
- ERR_FAIL_INDEX_V(p_phase, MAX_COLOR_PHASES, 0);
- if (color_ramp.is_valid()) {
- return color_ramp->get_offset(p_phase);
- }
- return 0;
+ Rect3 aabb = VS::get_singleton()->particles_get_current_aabb(particles);
+ Rect2 r;
+ r.position.x = aabb.position.x;
+ r.position.y = aabb.position.y;
+ r.size.x = aabb.size.x;
+ r.size.y = aabb.size.y;
+ return r;
}
-void Particles2D::set_emission_half_extents(const Vector2 &p_extents) {
-
- extents = p_extents;
-}
-
-Vector2 Particles2D::get_emission_half_extents() const {
-
- return extents;
-}
-
-void Particles2D::set_initial_velocity(const Vector2 &p_velocity) {
-
- initial_velocity = p_velocity;
-}
-Vector2 Particles2D::get_initial_velocity() const {
-
- return initial_velocity;
+void Particles2D::set_texture(const Ref<Texture> &p_texture) {
+ texture = p_texture;
+ update();
}
-void Particles2D::pre_process(float p_delta) {
-
- _process_particles(p_delta);
+Ref<Texture> Particles2D::get_texture() const {
+ return texture;
}
-void Particles2D::set_explosiveness(float p_value) {
+void Particles2D::set_normal_map(const Ref<Texture> &p_normal_map) {
- explosiveness = p_value;
+ normal_map = p_normal_map;
+ update();
}
-float Particles2D::get_explosiveness() const {
-
- return explosiveness;
+Ref<Texture> Particles2D::get_normal_map() const {
+ return normal_map;
}
-void Particles2D::set_flip_h(bool p_flip) {
-
- flip_h = p_flip;
+void Particles2D::_validate_property(PropertyInfo &property) const {
}
-bool Particles2D::is_flipped_h() const {
+void Particles2D::set_v_frames(int p_count) {
- return flip_h;
+ ERR_FAIL_COND(p_count < 1);
+ v_frames = p_count;
+ update();
}
-void Particles2D::set_flip_v(bool p_flip) {
-
- flip_v = p_flip;
-}
-bool Particles2D::is_flipped_v() const {
+int Particles2D::get_v_frames() const {
- return flip_v;
+ return v_frames;
}
-void Particles2D::set_h_frames(int p_frames) {
+void Particles2D::set_h_frames(int p_count) {
- ERR_FAIL_COND(p_frames < 1);
- h_frames = p_frames;
+ ERR_FAIL_COND(p_count < 1);
+ h_frames = p_count;
+ update();
}
int Particles2D::get_h_frames() const {
@@ -931,215 +277,143 @@ int Particles2D::get_h_frames() const {
return h_frames;
}
-void Particles2D::set_v_frames(int p_frames) {
-
- ERR_FAIL_COND(p_frames < 1);
- v_frames = p_frames;
+void Particles2D::restart() {
+ VS::get_singleton()->particles_restart(particles);
}
-int Particles2D::get_v_frames() const {
- return v_frames;
-}
+void Particles2D::_notification(int p_what) {
-void Particles2D::set_emission_points(const PoolVector<Vector2> &p_points) {
+ if (p_what == NOTIFICATION_DRAW) {
- emission_points = p_points;
-}
+ RID texture_rid;
+ if (texture.is_valid())
+ texture_rid = texture->get_rid();
+ RID normal_rid;
+ if (normal_map.is_valid())
+ normal_rid = texture->get_rid();
-PoolVector<Vector2> Particles2D::get_emission_points() const {
+ VS::get_singleton()->canvas_item_add_particles(get_canvas_item(), particles, texture_rid, normal_rid, h_frames, v_frames);
- return emission_points;
-}
+#ifdef TOOLS_ENABLED
+ if (get_tree()->is_editor_hint() && (this == get_tree()->get_edited_scene_root() || get_tree()->get_edited_scene_root()->is_a_parent_of(this))) {
+
+ draw_rect(visibility_rect, Color(0, 0.7, 0.9, 0.4), false);
+ }
+#endif
+ }
+
+ if (p_what == NOTIFICATION_PAUSED || p_what == NOTIFICATION_UNPAUSED) {
+ if (can_process()) {
+ VS::get_singleton()->particles_set_speed_scale(particles, speed_scale);
+ } else {
-void Particles2D::reset() {
+ VS::get_singleton()->particles_set_speed_scale(particles, 0);
+ }
+ }
- for (int i = 0; i < particles.size(); i++) {
- particles[i].active = false;
+ if (p_what == NOTIFICATION_TRANSFORM_CHANGED) {
+ _update_particle_emission_transform();
}
- time = 0;
- active_count = 0;
}
void Particles2D::_bind_methods() {
- 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_emitting", "emitting"), &Particles2D::set_emitting);
ClassDB::bind_method(D_METHOD("set_amount", "amount"), &Particles2D::set_amount);
- ClassDB::bind_method(D_METHOD("get_amount"), &Particles2D::get_amount);
+ ClassDB::bind_method(D_METHOD("set_lifetime", "secs"), &Particles2D::set_lifetime);
+ ClassDB::bind_method(D_METHOD("set_one_shot", "secs"), &Particles2D::set_one_shot);
+ ClassDB::bind_method(D_METHOD("set_pre_process_time", "secs"), &Particles2D::set_pre_process_time);
+ ClassDB::bind_method(D_METHOD("set_explosiveness_ratio", "ratio"), &Particles2D::set_explosiveness_ratio);
+ ClassDB::bind_method(D_METHOD("set_randomness_ratio", "ratio"), &Particles2D::set_randomness_ratio);
+ ClassDB::bind_method(D_METHOD("set_visibility_rect", "aabb"), &Particles2D::set_visibility_rect);
+ ClassDB::bind_method(D_METHOD("set_use_local_coordinates", "enable"), &Particles2D::set_use_local_coordinates);
+ ClassDB::bind_method(D_METHOD("set_fixed_fps", "fps"), &Particles2D::set_fixed_fps);
+ ClassDB::bind_method(D_METHOD("set_fractional_delta", "enable"), &Particles2D::set_fractional_delta);
+ ClassDB::bind_method(D_METHOD("set_process_material", "material"), &Particles2D::set_process_material);
+ ClassDB::bind_method(D_METHOD("set_speed_scale", "scale"), &Particles2D::set_speed_scale);
- ClassDB::bind_method(D_METHOD("set_lifetime", "lifetime"), &Particles2D::set_lifetime);
+ ClassDB::bind_method(D_METHOD("is_emitting"), &Particles2D::is_emitting);
+ ClassDB::bind_method(D_METHOD("get_amount"), &Particles2D::get_amount);
ClassDB::bind_method(D_METHOD("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(D_METHOD("set_pre_process_time", "time"), &Particles2D::set_pre_process_time);
+ ClassDB::bind_method(D_METHOD("get_one_shot"), &Particles2D::get_one_shot);
ClassDB::bind_method(D_METHOD("get_pre_process_time"), &Particles2D::get_pre_process_time);
+ ClassDB::bind_method(D_METHOD("get_explosiveness_ratio"), &Particles2D::get_explosiveness_ratio);
+ ClassDB::bind_method(D_METHOD("get_randomness_ratio"), &Particles2D::get_randomness_ratio);
+ ClassDB::bind_method(D_METHOD("get_visibility_rect"), &Particles2D::get_visibility_rect);
+ ClassDB::bind_method(D_METHOD("get_use_local_coordinates"), &Particles2D::get_use_local_coordinates);
+ ClassDB::bind_method(D_METHOD("get_fixed_fps"), &Particles2D::get_fixed_fps);
+ ClassDB::bind_method(D_METHOD("get_fractional_delta"), &Particles2D::get_fractional_delta);
+ ClassDB::bind_method(D_METHOD("get_process_material"), &Particles2D::get_process_material);
+ ClassDB::bind_method(D_METHOD("get_speed_scale"), &Particles2D::get_speed_scale);
- 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(D_METHOD("set_param", "param", "value"), &Particles2D::set_param);
- ClassDB::bind_method(D_METHOD("get_param", "param"), &Particles2D::get_param);
+ ClassDB::bind_method(D_METHOD("set_draw_order", "order"), &Particles2D::set_draw_order);
+ ClassDB::bind_method(D_METHOD("get_draw_order"), &Particles2D::get_draw_order);
- 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(D_METHOD("set_texture", "texture"), &Particles2D::set_texture);
+ ClassDB::bind_method(D_METHOD("get_texture"), &Particles2D::get_texture);
- 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(D_METHOD("set_normal_map", "texture"), &Particles2D::set_normal_map);
+ ClassDB::bind_method(D_METHOD("get_normal_map"), &Particles2D::get_normal_map);
- ClassDB::bind_method(D_METHOD("set_color", "color"), &Particles2D::set_color);
- ClassDB::bind_method(D_METHOD("get_color"), &Particles2D::get_color);
+ ClassDB::bind_method(D_METHOD("capture_rect"), &Particles2D::capture_rect);
- 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(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(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(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(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(D_METHOD("set_v_frames", "enable"), &Particles2D::set_v_frames);
+ ClassDB::bind_method(D_METHOD("set_v_frames", "frames"), &Particles2D::set_v_frames);
ClassDB::bind_method(D_METHOD("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(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(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(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(D_METHOD("pre_process", "time"), &Particles2D::pre_process);
- ClassDB::bind_method(D_METHOD("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(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(D_METHOD("set_explosiveness", "amount"), &Particles2D::set_explosiveness);
- ClassDB::bind_method(D_METHOD("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);
-
- ADD_SIGNAL(MethodInfo("emission_finished"));
-
- 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]), "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"), "set_randomness", "get_randomness", i);
- }
-
- 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), "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);
- }
+ ClassDB::bind_method(D_METHOD("set_h_frames", "frames"), &Particles2D::set_h_frames);
+ ClassDB::bind_method(D_METHOD("get_h_frames"), &Particles2D::get_h_frames);
- 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), "set_emission_points", "get_emission_points");
-
- BIND_CONSTANT(PARAM_DIRECTION);
- BIND_CONSTANT(PARAM_SPREAD);
- BIND_CONSTANT(PARAM_LINEAR_VELOCITY);
- BIND_CONSTANT(PARAM_SPIN_VELOCITY);
- BIND_CONSTANT(PARAM_ORBIT_VELOCITY);
- BIND_CONSTANT(PARAM_GRAVITY_DIRECTION);
- BIND_CONSTANT(PARAM_GRAVITY_STRENGTH);
- BIND_CONSTANT(PARAM_RADIAL_ACCEL);
- BIND_CONSTANT(PARAM_TANGENTIAL_ACCEL);
- BIND_CONSTANT(PARAM_DAMPING);
- BIND_CONSTANT(PARAM_INITIAL_ANGLE);
- BIND_CONSTANT(PARAM_INITIAL_SIZE);
- BIND_CONSTANT(PARAM_FINAL_SIZE);
- BIND_CONSTANT(PARAM_HUE_VARIATION);
- BIND_CONSTANT(PARAM_ANIM_SPEED_SCALE);
- BIND_CONSTANT(PARAM_ANIM_INITIAL_POS);
- BIND_CONSTANT(PARAM_MAX);
-
- BIND_CONSTANT(MAX_COLOR_PHASES);
+ ClassDB::bind_method(D_METHOD("restart"), &Particles2D::restart);
+
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_RANGE, "1,100000,1"), "set_amount", "get_amount");
+ ADD_GROUP("Time", "");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01"), "set_lifetime", "get_lifetime");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "get_one_shot");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "preprocess", PROPERTY_HINT_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_speed_scale", "get_speed_scale");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta");
+ ADD_GROUP("Drawing", "");
+ ADD_PROPERTY(PropertyInfo(Variant::RECT3, "visibility_rect"), "set_visibility_rect", "get_visibility_rect");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "local_coords"), "set_use_local_coordinates", "get_use_local_coordinates");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "draw_order", PROPERTY_HINT_ENUM, "Index,Lifetime"), "set_draw_order", "get_draw_order");
+ ADD_GROUP("Process Material", "process_");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "process_material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,ParticlesMaterial"), "set_process_material", "get_process_material");
+ ADD_GROUP("Textures", "");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_normal_map", "get_normal_map");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "h_frames", PROPERTY_HINT_RANGE, "1,1024,1"), "set_h_frames", "get_h_frames");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "v_frames", PROPERTY_HINT_RANGE, "1,1024,1"), "set_v_frames", "get_v_frames");
+
+ BIND_CONSTANT(DRAW_ORDER_INDEX);
+ BIND_CONSTANT(DRAW_ORDER_LIFETIME);
}
Particles2D::Particles2D() {
- for (int i = 0; i < PARAM_MAX; i++) {
-
- param[i] = 0;
- randomness[i] = 0;
- }
+ particles = VS::get_singleton()->particles_create();
- set_param(PARAM_SPREAD, 10);
- set_param(PARAM_LINEAR_VELOCITY, 20);
- set_param(PARAM_GRAVITY_STRENGTH, 9.8);
- set_param(PARAM_RADIAL_ACCEL, 0);
- set_param(PARAM_TANGENTIAL_ACCEL, 0);
- set_param(PARAM_INITIAL_ANGLE, 0.0);
- set_param(PARAM_INITIAL_SIZE, 1.0);
- set_param(PARAM_FINAL_SIZE, 1.0);
- set_param(PARAM_ANIM_SPEED_SCALE, 1.0);
-
- set_color(Color(1, 1, 1, 1));
-
- time = 0;
- lifetime = 2;
- emitting = false;
- particles.resize(32);
- active_count = -1;
set_emitting(true);
- process_mode = PROCESS_IDLE;
- local_space = true;
- preprocess = 0;
- time_scale = 1.0;
-
- flip_h = false;
- flip_v = false;
-
- v_frames = 1;
+ set_one_shot(false);
+ set_amount(8);
+ set_lifetime(1);
+ set_fixed_fps(0);
+ set_fractional_delta(true);
+ set_pre_process_time(0);
+ set_explosiveness_ratio(0);
+ set_randomness_ratio(0);
+ set_visibility_rect(Rect2(Vector2(-100, -100), Vector2(200, 200)));
+ set_use_local_coordinates(true);
+ set_draw_order(DRAW_ORDER_INDEX);
+ set_speed_scale(1);
h_frames = 1;
+ v_frames = 1;
+}
+
+Particles2D::~Particles2D() {
- emit_timeout = 0;
- time_to_live = 0;
- explosiveness = 1.0;
+ VS::get_singleton()->free(particles);
}
diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h
index 0cf4063cef..a6ac0c37d3 100644
--- a/scene/2d/particles_2d.h
+++ b/scene/2d/particles_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,235 +34,102 @@
#include "scene/resources/color_ramp.h"
#include "scene/resources/texture.h"
-class Particles2D;
-class ParticleAttractor2D : public Node2D {
-
- GDCLASS(ParticleAttractor2D, Node2D);
-
- friend class Particles2D;
- bool enabled;
- float radius;
- float disable_radius;
- float gravity;
- float absorption;
- NodePath path;
-
- Particles2D *owner;
-
- void _update_owner();
- void _owner_exited();
- void _set_owner(Particles2D *p_owner);
-
- void _notification(int p_what);
- static void _bind_methods();
-
-public:
- void set_enabled(bool p_enabled);
- bool is_enabled() const;
-
- void set_radius(float p_radius);
- float get_radius() const;
-
- void set_disable_radius(float p_disable_radius);
- float get_disable_radius() const;
-
- void set_gravity(float p_gravity);
- float get_gravity() const;
-
- void set_absorption(float p_absorption);
- float get_absorption() const;
-
- void set_particles_path(NodePath p_path);
- NodePath get_particles_path() const;
-
- virtual String get_configuration_warning() const;
-
- ParticleAttractor2D();
-};
-
class Particles2D : public Node2D {
-
- GDCLASS(Particles2D, Node2D);
+private:
+ GDCLASS(Particles2D, Node2D)
public:
- enum Parameter {
- PARAM_DIRECTION,
- PARAM_SPREAD,
- PARAM_LINEAR_VELOCITY,
- PARAM_SPIN_VELOCITY,
- PARAM_ORBIT_VELOCITY,
- PARAM_GRAVITY_DIRECTION,
- PARAM_GRAVITY_STRENGTH,
- PARAM_RADIAL_ACCEL,
- PARAM_TANGENTIAL_ACCEL,
- PARAM_DAMPING,
- PARAM_INITIAL_ANGLE,
- PARAM_INITIAL_SIZE,
- PARAM_FINAL_SIZE,
- PARAM_HUE_VARIATION,
- PARAM_ANIM_SPEED_SCALE,
- PARAM_ANIM_INITIAL_POS,
- PARAM_MAX
- };
-
- enum {
- MAX_COLOR_PHASES = 4
- };
-
- enum ProcessMode {
- PROCESS_FIXED,
- PROCESS_IDLE,
+ enum DrawOrder {
+ DRAW_ORDER_INDEX,
+ DRAW_ORDER_LIFETIME,
};
private:
- float param[PARAM_MAX];
- float randomness[PARAM_MAX];
+ RID particles;
- struct Particle {
- bool active;
- Point2 pos;
- Vector2 velocity;
- float rot;
- float frame;
- uint64_t seed;
- Particle() {
- active = false;
- seed = 123465789;
- rot = 0;
- frame = 0;
- }
- };
-
- Vector<Particle> particles;
-
- struct AttractorCache {
-
- Vector2 pos;
- ParticleAttractor2D *attractor;
- };
-
- Vector<AttractorCache> attractor_cache;
-
- float explosiveness;
- float preprocess;
- float lifetime;
bool emitting;
- bool local_space;
- float emit_timeout;
- float time_to_live;
- float time_scale;
- bool flip_h;
- bool flip_v;
- int h_frames;
+ bool one_shot;
+ int amount;
+ float lifetime;
+ float pre_process_time;
+ float explosiveness_ratio;
+ float randomness_ratio;
+ float speed_scale;
+ Rect2 visibility_rect;
+ bool local_coords;
+ int fixed_fps;
+ bool fractional_delta;
int v_frames;
- Point2 emissor_offset;
- Vector2 initial_velocity;
- Vector2 extents;
- PoolVector<Vector2> emission_points;
+ int h_frames;
- ProcessMode process_mode;
+ Ref<Material> process_material;
- float time;
- int active_count;
+ DrawOrder draw_order;
Ref<Texture> texture;
+ Ref<Texture> normal_map;
- //If no color ramp is set then default color is used. Created as simple alternative to color_ramp.
- Color default_color;
- Ref<ColorRamp> color_ramp;
-
- void _process_particles(float p_delta);
- friend class ParticleAttractor2D;
-
- Set<ParticleAttractor2D *> attractors;
+ void _update_particle_emission_transform();
protected:
- void _notification(int p_what);
static void _bind_methods();
+ virtual void _validate_property(PropertyInfo &property) const;
+ void _notification(int p_what);
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;
-
void set_lifetime(float p_lifetime);
- float get_lifetime() const;
-
- void set_time_scale(float p_time_scale);
- float get_time_scale() const;
+ void set_one_shot(bool p_enable);
+ void set_pre_process_time(float p_time);
+ void set_explosiveness_ratio(float p_ratio);
+ void set_randomness_ratio(float p_ratio);
+ void set_visibility_rect(const Rect2 &p_aabb);
+ void set_use_local_coordinates(bool p_enable);
+ void set_process_material(const Ref<Material> &p_material);
+ void set_speed_scale(float p_scale);
- void set_pre_process_time(float p_pre_process_time);
+ bool is_emitting() const;
+ int get_amount() const;
+ float get_lifetime() const;
+ bool get_one_shot() const;
float get_pre_process_time() const;
+ float get_explosiveness_ratio() const;
+ float get_randomness_ratio() const;
+ Rect2 get_visibility_rect() const;
+ bool get_use_local_coordinates() const;
+ Ref<Material> get_process_material() const;
+ float get_speed_scale() const;
- void set_emit_timeout(float p_timeout);
- float get_emit_timeout() const;
-
- void set_emission_half_extents(const Vector2 &p_extents);
- Vector2 get_emission_half_extents() const;
+ void set_fixed_fps(int p_count);
+ int get_fixed_fps() const;
- void set_param(Parameter p_param, float p_value);
- float get_param(Parameter p_param) const;
+ void set_fractional_delta(bool p_enable);
+ bool get_fractional_delta() const;
- void set_randomness(Parameter p_randomness, float p_value);
- float get_randomness(Parameter p_randomness) const;
-
- void set_explosiveness(float p_value);
- float get_explosiveness() const;
-
- void set_flip_h(bool p_flip);
- bool is_flipped_h() const;
-
- void set_flip_v(bool p_flip);
- bool is_flipped_v() const;
-
- void set_h_frames(int p_frames);
- int get_h_frames() const;
-
- void set_v_frames(int p_frames);
- int get_v_frames() const;
-
- void set_color_phases(int p_phases);
- int get_color_phases() const;
-
- void set_color_phase_color(int p_phase, const Color &p_color);
- Color get_color_phase_color(int p_phase) const;
-
- void set_color_phase_pos(int p_phase, float p_pos);
- float get_color_phase_pos(int p_phase) const;
+ void set_draw_order(DrawOrder p_order);
+ DrawOrder get_draw_order() const;
void set_texture(const Ref<Texture> &p_texture);
Ref<Texture> get_texture() const;
- void set_color(const Color &p_color);
- Color get_color() const;
-
- void set_color_ramp(const Ref<ColorRamp> &p_texture);
- Ref<ColorRamp> get_color_ramp() const;
-
- void set_emissor_offset(const Point2 &p_offset);
- Point2 get_emissor_offset() const;
+ void set_normal_map(const Ref<Texture> &p_normal_map);
+ Ref<Texture> get_normal_map() const;
- void set_use_local_space(bool p_use);
- bool is_using_local_space() const;
-
- void set_initial_velocity(const Vector2 &p_velocity);
- Vector2 get_initial_velocity() const;
+ virtual String get_configuration_warning() const;
- void set_emission_points(const PoolVector<Vector2> &p_points);
- PoolVector<Vector2> get_emission_points() const;
+ void set_v_frames(int p_count);
+ int get_v_frames() const;
- void pre_process(float p_delta);
- void reset();
+ void set_h_frames(int p_count);
+ int get_h_frames() const;
+ void restart();
+ Rect2 capture_rect() const;
Particles2D();
+ ~Particles2D();
};
-VARIANT_ENUM_CAST(Particles2D::ProcessMode);
-VARIANT_ENUM_CAST(Particles2D::Parameter);
+VARIANT_ENUM_CAST(Particles2D::DrawOrder)
#endif // PARTICLES_FRAME_H
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index 9e8be7fa1a..6b30e97de8 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -81,8 +82,8 @@ Ref<Curve2D> Path2D::get_curve() const {
void Path2D::_bind_methods() {
- 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("set_curve", "curve"), &Path2D::set_curve);
+ ClassDB::bind_method(D_METHOD("get_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"), "set_curve", "get_curve");
diff --git a/scene/2d/path_2d.h b/scene/2d/path_2d.h
index 7357b6810e..e80817cd3c 100644
--- a/scene/2d/path_2d.h
+++ b/scene/2d/path_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -95,7 +96,7 @@ public:
void set_loop(bool p_loop);
bool has_loop() const;
- void set_rotate(bool p_enabled);
+ void set_rotate(bool p_rotate);
bool is_rotating() const;
void set_cubic_interpolation(bool p_enable);
diff --git a/scene/2d/path_texture.cpp b/scene/2d/path_texture.cpp
index 60efccec3d..e06c79dabd 100644
--- a/scene/2d/path_texture.cpp
+++ b/scene/2d/path_texture.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/path_texture.h b/scene/2d/path_texture.h
index 8d5adc49c8..163e914e4a 100644
--- a/scene/2d/path_texture.h
+++ b/scene/2d/path_texture.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 88845a7290..6ec1642138 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,28 +44,6 @@ void PhysicsBody2D::_notification(int p_what) {
*/
}
-void PhysicsBody2D::set_one_way_collision_direction(const Vector2 &p_dir) {
-
- one_way_collision_direction = p_dir;
- Physics2DServer::get_singleton()->body_set_one_way_collision_direction(get_rid(), p_dir);
-}
-
-Vector2 PhysicsBody2D::get_one_way_collision_direction() const {
-
- return one_way_collision_direction;
-}
-
-void PhysicsBody2D::set_one_way_collision_max_depth(float p_depth) {
-
- one_way_collision_max_depth = p_depth;
- Physics2DServer::get_singleton()->body_set_one_way_collision_max_depth(get_rid(), p_depth);
-}
-
-float PhysicsBody2D::get_one_way_collision_max_depth() const {
-
- return one_way_collision_max_depth;
-}
-
void PhysicsBody2D::_set_layers(uint32_t p_mask) {
set_collision_layer(p_mask);
@@ -78,7 +57,7 @@ uint32_t PhysicsBody2D::_get_layers() const {
void PhysicsBody2D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_collision_layer", "mask"), &PhysicsBody2D::set_collision_layer);
+ ClassDB::bind_method(D_METHOD("set_collision_layer", "layer"), &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);
@@ -91,31 +70,24 @@ void PhysicsBody2D::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("add_collision_exception_with", "body"), &PhysicsBody2D::add_collision_exception_with);
+ ClassDB::bind_method(D_METHOD("remove_collision_exception_with", "body"), &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), "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"), "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) {
+void PhysicsBody2D::set_collision_layer(uint32_t p_layer) {
- mask = p_mask;
- Physics2DServer::get_singleton()->body_set_layer_mask(get_rid(), p_mask);
+ collision_layer = p_layer;
+ Physics2DServer::get_singleton()->body_set_collision_layer(get_rid(), p_layer);
}
uint32_t PhysicsBody2D::get_collision_layer() const {
- return mask;
+ return collision_layer;
}
void PhysicsBody2D::set_collision_mask(uint32_t p_mask) {
@@ -145,12 +117,12 @@ bool PhysicsBody2D::get_collision_mask_bit(int p_bit) const {
void PhysicsBody2D::set_collision_layer_bit(int p_bit, bool p_value) {
- uint32_t mask = get_collision_layer();
+ uint32_t collision_layer = get_collision_layer();
if (p_value)
- mask |= 1 << p_bit;
+ collision_layer |= 1 << p_bit;
else
- mask &= ~(1 << p_bit);
- set_collision_layer(mask);
+ collision_layer &= ~(1 << p_bit);
+ set_collision_layer(collision_layer);
}
bool PhysicsBody2D::get_collision_layer_bit(int p_bit) const {
@@ -161,9 +133,8 @@ bool PhysicsBody2D::get_collision_layer_bit(int p_bit) const {
PhysicsBody2D::PhysicsBody2D(Physics2DServer::BodyMode p_mode)
: CollisionObject2D(Physics2DServer::get_singleton()->body_create(p_mode), false) {
- mask = 1;
+ collision_layer = 1;
collision_mask = 1;
- set_one_way_collision_max_depth(0);
set_pickable(false);
}
@@ -583,11 +554,12 @@ real_t RigidBody2D::get_inertia() const {
void RigidBody2D::set_weight(real_t p_weight) {
- set_mass(p_weight / 9.8);
+ set_mass(p_weight / real_t(GLOBAL_DEF("physics/2d/default_gravity", 98)) / 10);
}
+
real_t RigidBody2D::get_weight() const {
- return mass * 9.8;
+ return mass * real_t(GLOBAL_DEF("physics/2d/default_gravity", 98)) / 10;
}
void RigidBody2D::set_friction(real_t p_friction) {
@@ -826,6 +798,40 @@ bool RigidBody2D::is_contact_monitor_enabled() const {
return contact_monitor != NULL;
}
+void RigidBody2D::_notification(int p_what) {
+
+#ifdef TOOLS_ENABLED
+ if (p_what == NOTIFICATION_ENTER_TREE) {
+ if (get_tree()->is_editor_hint()) {
+ set_notify_local_transform(true); //used for warnings and only in editor
+ }
+ }
+
+ if (p_what == NOTIFICATION_LOCAL_TRANSFORM_CHANGED) {
+ if (get_tree()->is_editor_hint()) {
+ update_configuration_warning();
+ }
+ }
+
+#endif
+}
+
+String RigidBody2D::get_configuration_warning() const {
+
+ Transform2D t = get_transform();
+
+ String warning = CollisionObject2D::get_configuration_warning();
+
+ if ((get_mode() == MODE_RIGID || get_mode() == MODE_CHARACTER) && (ABS(t.elements[0].length() - 1.0) > 0.05 || ABS(t.elements[1].length() - 1.0) > 0.05)) {
+ if (warning != String()) {
+ warning += "\n";
+ }
+ warning += TTR("Size changes to RigidBody2D (in character or rigid modes) will be overriden by the physics engine when running.\nChange the size in children collision shapes instead.");
+ }
+
+ return warning;
+}
+
void RigidBody2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_mode", "mode"), &RigidBody2D::set_mode);
@@ -890,7 +896,7 @@ void RigidBody2D::_bind_methods() {
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(D_METHOD("test_motion", "motion", "margin", "result:Physics2DTestMotionResult"), &RigidBody2D::_test_motion, DEFVAL(0.08), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("test_motion", "motion", "margin", "result"), &RigidBody2D::_test_motion, DEFVAL(0.08), DEFVAL(Variant()));
ClassDB::bind_method(D_METHOD("_direct_state_changed"), &RigidBody2D::_direct_state_changed);
ClassDB::bind_method(D_METHOD("_body_enter_tree"), &RigidBody2D::_body_enter_tree);
@@ -970,247 +976,106 @@ RigidBody2D::~RigidBody2D() {
//////////////////////////
-Variant KinematicBody2D::_get_collider() const {
-
- ObjectID oid = get_collider();
- if (oid == 0)
- return Variant();
- Object *obj = ObjectDB::get_instance(oid);
- if (!obj)
- return Variant();
-
- Reference *ref = obj->cast_to<Reference>();
- if (ref) {
- return Ref<Reference>(ref);
- }
-
- return obj;
-}
-
-void KinematicBody2D::revert_motion() {
+Dictionary KinematicBody2D::_move(const Vector2 &p_motion) {
+
+ Collision col;
+ if (move(p_motion, col)) {
+ Dictionary d;
+ d["position"] = col.collision;
+ d["normal"] = col.normal;
+ d["local_shape"] = col.local_shape;
+ d["travel"] = col.travel;
+ d["remainder"] = col.remainder;
+ d["collider_id"] = col.collider;
+ d["collider_velocity"] = col.collider_vel;
+ if (col.collider) {
+ d["collider"] = ObjectDB::get_instance(col.collider);
+ } else {
+ d["collider"] = Variant();
+ }
- Transform2D gt = get_global_transform();
- gt.elements[2] -= travel;
- travel = Vector2();
- set_global_transform(gt);
-}
+ d["collider_shape_index"] = col.collider_shape;
+ d["collider_metadata"] = col.collider_metadata;
-Vector2 KinematicBody2D::get_travel() const {
+ return d;
- return travel;
+ } else {
+ return Dictionary();
+ }
}
-Vector2 KinematicBody2D::move(const Vector2 &p_motion) {
-
-#if 1
+bool KinematicBody2D::move(const Vector2 &p_motion, Collision &r_collision) {
Transform2D gt = get_global_transform();
Physics2DServer::MotionResult result;
- colliding = Physics2DServer::get_singleton()->body_test_motion(get_rid(), gt, p_motion, margin, &result);
-
- collider_metadata = result.collider_metadata;
- collider_shape = result.collider_shape;
- collider_vel = result.collider_velocity;
- collision = result.collision_point;
- normal = result.collision_normal;
- collider = result.collider_id;
-
- gt.elements[2] += result.motion;
- set_global_transform(gt);
- travel = result.motion;
-
- return result.remainder;
-
-#else
- //give me back regular physics engine logic
- //this is madness
- //and most people using this function will think
- //what it does is simpler than using physics
- //this took about a week to get right..
- //but is it right? who knows at this point..
-
- colliding = false;
- ERR_FAIL_COND_V(!is_inside_tree(), Vector2());
- Physics2DDirectSpaceState *dss = Physics2DServer::get_singleton()->space_get_direct_state(get_world_2d()->get_space());
- ERR_FAIL_COND_V(!dss, Vector2());
- const int max_shapes = 32;
- Vector2 sr[max_shapes * 2];
- int res_shapes;
-
- Set<RID> exclude;
- exclude.insert(get_rid());
-
- //recover first
- int recover_attempts = 4;
-
- bool collided = false;
- uint32_t mask = 0;
- if (true)
- mask |= Physics2DDirectSpaceState::TYPE_MASK_STATIC_BODY;
- if (true)
- mask |= Physics2DDirectSpaceState::TYPE_MASK_KINEMATIC_BODY;
- if (true)
- mask |= Physics2DDirectSpaceState::TYPE_MASK_RIGID_BODY;
- if (true)
- mask |= Physics2DDirectSpaceState::TYPE_MASK_CHARACTER_BODY;
-
- //print_line("margin: "+rtos(margin));
- do {
-
- //motion recover
- for (int i = 0; i < get_shape_count(); i++) {
-
- if (is_shape_set_as_trigger(i))
- continue;
- if (dss->collide_shape(get_shape(i)->get_rid(), get_global_transform() * get_shape_transform(i), Vector2(), margin, sr, max_shapes, res_shapes, exclude, get_layer_mask(), mask))
- collided = true;
- }
-
- if (!collided)
- break;
-
- Vector2 recover_motion;
-
- for (int i = 0; i < res_shapes; i++) {
-
- Vector2 a = sr[i * 2 + 0];
- Vector2 b = sr[i * 2 + 1];
-
- float d = a.distance_to(b);
-
- /*
- if (d<margin)
- continue;
- */
- recover_motion += (b - a) * 0.4;
- }
-
- if (recover_motion == Vector2()) {
- collided = false;
- break;
- }
-
- Transform2D gt = get_global_transform();
- gt.elements[2] += recover_motion;
- set_global_transform(gt);
-
- recover_attempts--;
-
- } while (recover_attempts);
-
- //move second
- float safe = 1.0;
- float unsafe = 1.0;
- int best_shape = -1;
-
- for (int i = 0; i < get_shape_count(); i++) {
-
- if (is_shape_set_as_trigger(i))
- continue;
-
- float 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) {
-
- safe = 0;
- unsafe = 0;
- best_shape = i; //sadly it's the best
- break;
- }
- if (lsafe == 1.0) {
- continue;
- }
- if (lsafe < safe) {
-
- safe = lsafe;
- unsafe = lunsafe;
- best_shape = i;
- }
- }
-
- //print_line("best shape: "+itos(best_shape)+" motion "+p_motion);
-
- if (safe >= 1) {
- //not collided
- colliding = false;
-
- } else {
-
- //it collided, let's get the rest info in unsafe advance
- Transform2D ugt = get_global_transform();
- ugt.elements[2] += p_motion * unsafe;
- Physics2DDirectSpaceState::ShapeRestInfo rest_info;
- bool c2 = dss->rest_info(get_shape(best_shape)->get_rid(), ugt * get_shape_transform(best_shape), Vector2(), margin, &rest_info, exclude, get_layer_mask(), mask);
- if (!c2) {
- //should not happen, but floating point precision is so weird..
-
- colliding = false;
- } else {
-
- //print_line("Travel: "+rtos(travel));
- colliding = true;
- collision = rest_info.point;
- normal = rest_info.normal;
- collider = rest_info.collider_id;
- collider_vel = rest_info.linear_velocity;
- collider_shape = rest_info.shape;
- collider_metadata = rest_info.metadata;
- }
+ bool colliding = Physics2DServer::get_singleton()->body_test_motion(get_rid(), gt, p_motion, margin, &result);
+
+ if (colliding) {
+ r_collision.collider_metadata = result.collider_metadata;
+ r_collision.collider_shape = result.collider_shape;
+ r_collision.collider_vel = result.collider_velocity;
+ r_collision.collision = result.collision_point;
+ r_collision.normal = result.collision_normal;
+ r_collision.collider = result.collider_id;
+ r_collision.travel = result.motion;
+ r_collision.remainder = result.remainder;
+ r_collision.local_shape = result.collision_local_shape;
}
- Vector2 motion = p_motion * safe;
- Transform2D gt = get_global_transform();
- gt.elements[2] += motion;
+ gt.elements[2] += result.motion;
set_global_transform(gt);
- return p_motion - motion;
-#endif
+ return colliding;
}
-Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const Vector2 &p_floor_direction, float p_slope_stop_min_velocity, int p_max_bounces) {
+Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const Vector2 &p_floor_direction, float p_slope_stop_min_velocity, int p_max_bounces, float p_floor_max_angle) {
- Vector2 motion = (move_and_slide_floor_velocity + p_linear_velocity) * get_fixed_process_delta_time();
+ Vector2 motion = (floor_velocity + p_linear_velocity) * get_fixed_process_delta_time();
Vector2 lv = p_linear_velocity;
- move_and_slide_on_floor = false;
- move_and_slide_on_ceiling = false;
- move_and_slide_on_wall = false;
- move_and_slide_colliders.clear();
- move_and_slide_floor_velocity = Vector2();
+ on_floor = false;
+ on_ceiling = false;
+ on_wall = false;
+ colliders.clear();
+ floor_velocity = Vector2();
while (p_max_bounces) {
- motion = move(motion);
+ Collision collision;
- if (is_colliding()) {
+ bool collided = move(motion, collision);
+
+ if (collided) {
+
+ motion = collision.remainder;
if (p_floor_direction == Vector2()) {
//all is a wall
- move_and_slide_on_wall = true;
+ on_wall = true;
} else {
- if (get_collision_normal().dot(p_floor_direction) > Math::cos(Math::deg2rad((float)45))) { //floor
+ if (collision.normal.dot(p_floor_direction) >= Math::cos(p_floor_max_angle)) { //floor
- move_and_slide_on_floor = true;
- move_and_slide_floor_velocity = get_collider_velocity();
+ on_floor = true;
+ floor_velocity = collision.collider_vel;
- if (get_travel().length() < 1 && ABS((lv.x - move_and_slide_floor_velocity.x)) < p_slope_stop_min_velocity) {
- revert_motion();
+ if (collision.travel.length() < 1 && ABS((lv.x - floor_velocity.x)) < p_slope_stop_min_velocity) {
+ Transform2D gt = get_global_transform();
+ gt.elements[2] -= collision.travel;
+ set_global_transform(gt);
return Vector2();
}
- } else if (get_collision_normal().dot(p_floor_direction) < Math::cos(Math::deg2rad((float)45))) { //ceiling
- move_and_slide_on_ceiling = true;
+ } else if (collision.normal.dot(-p_floor_direction) >= Math::cos(p_floor_max_angle)) { //ceiling
+ on_ceiling = true;
} else {
- move_and_slide_on_wall = true;
+ on_wall = true;
}
}
- motion = get_collision_normal().slide(motion);
- lv = get_collision_normal().slide(lv);
- Variant collider = _get_collider();
- if (collider.get_type() != Variant::NIL) {
- move_and_slide_colliders.push_back(collider);
- }
+ Vector2 n = collision.normal;
+ motion = motion.slide(n);
+ lv = lv.slide(n);
+
+ colliders.push_back(collision);
} else {
break;
@@ -1224,26 +1089,22 @@ Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const
return lv;
}
-bool KinematicBody2D::is_move_and_slide_on_floor() const {
+bool KinematicBody2D::is_on_floor() const {
- return move_and_slide_on_floor;
+ return on_floor;
}
-bool KinematicBody2D::is_move_and_slide_on_wall() const {
+bool KinematicBody2D::is_on_wall() const {
- return move_and_slide_on_wall;
+ return on_wall;
}
-bool KinematicBody2D::is_move_and_slide_on_ceiling() const {
+bool KinematicBody2D::is_on_ceiling() const {
- return move_and_slide_on_ceiling;
+ return on_ceiling;
}
-Array KinematicBody2D::get_move_and_slide_colliders() const {
- return move_and_slide_colliders;
-}
-
-Vector2 KinematicBody2D::move_to(const Vector2 &p_position) {
+Vector2 KinematicBody2D::get_floor_velocity() const {
- return move(p_position - get_global_position());
+ return floor_velocity;
}
bool KinematicBody2D::test_move(const Transform2D &p_from, const Vector2 &p_motion) {
@@ -1253,98 +1114,123 @@ bool KinematicBody2D::test_move(const Transform2D &p_from, const Vector2 &p_moti
return Physics2DServer::get_singleton()->body_test_motion(get_rid(), p_from, p_motion, margin);
}
-Vector2 KinematicBody2D::get_collision_pos() const {
+void KinematicBody2D::set_safe_margin(float p_margin) {
- ERR_FAIL_COND_V(!colliding, Vector2());
- return collision;
+ margin = p_margin;
}
-Vector2 KinematicBody2D::get_collision_normal() const {
+float KinematicBody2D::get_safe_margin() const {
- ERR_FAIL_COND_V(!colliding, Vector2());
- return normal;
+ return margin;
}
-Vector2 KinematicBody2D::get_collider_velocity() const {
+int KinematicBody2D::get_collision_count() const {
- return collider_vel;
+ return colliders.size();
}
+Vector2 KinematicBody2D::get_collision_position(int p_collision) const {
-ObjectID KinematicBody2D::get_collider() const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector2());
- ERR_FAIL_COND_V(!colliding, 0);
- return collider;
+ return colliders[p_collision].collision;
}
-
-int KinematicBody2D::get_collider_shape() const {
-
- ERR_FAIL_COND_V(!colliding, 0);
- return collider_shape;
+Vector2 KinematicBody2D::get_collision_normal(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector2());
+ return colliders[p_collision].normal;
}
-Variant KinematicBody2D::get_collider_metadata() const {
-
- ERR_FAIL_COND_V(!colliding, 0);
- return collider_metadata;
+Vector2 KinematicBody2D::get_collision_travel(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector2());
+ return colliders[p_collision].travel;
}
-
-bool KinematicBody2D::is_colliding() const {
-
- return colliding;
+Vector2 KinematicBody2D::get_collision_remainder(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector2());
+ return colliders[p_collision].remainder;
+}
+Object *KinematicBody2D::get_collision_local_shape(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL);
+ uint32_t owner = shape_find_owner(colliders[p_collision].local_shape);
+ return shape_owner_get_owner(owner);
}
+Object *KinematicBody2D::get_collision_collider(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL);
-void KinematicBody2D::set_collision_margin(float p_margin) {
+ if (colliders[p_collision].collider) {
+ return ObjectDB::get_instance(colliders[p_collision].collider);
+ }
- margin = p_margin;
+ return NULL;
}
+ObjectID KinematicBody2D::get_collision_collider_id(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), 0);
-float KinematicBody2D::get_collision_margin() const {
+ return colliders[p_collision].collider;
+}
+Object *KinematicBody2D::get_collision_collider_shape(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL);
+ Object *collider = get_collision_collider(p_collision);
+ if (collider) {
+ CollisionObject2D *obj2d = collider->cast_to<CollisionObject2D>();
+ if (obj2d) {
+ uint32_t owner = shape_find_owner(colliders[p_collision].collider_shape);
+ return obj2d->shape_owner_get_owner(owner);
+ }
+ }
- return margin;
+ return NULL;
+}
+int KinematicBody2D::get_collision_collider_shape_index(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), -1);
+ return colliders[p_collision].collider_shape;
+}
+Vector2 KinematicBody2D::get_collision_collider_velocity(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector2());
+ return colliders[p_collision].collider_vel;
+}
+Variant KinematicBody2D::get_collision_collider_metadata(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Variant());
+ return colliders[p_collision].collider_metadata;
}
void KinematicBody2D::_bind_methods() {
- 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(D_METHOD("move", "rel_vec"), &KinematicBody2D::_move);
+ ClassDB::bind_method(D_METHOD("move_and_slide", "linear_velocity", "floor_normal", "slope_stop_min_velocity", "max_bounces", "floor_max_angle"), &KinematicBody2D::move_and_slide, DEFVAL(Vector2(0, 0)), DEFVAL(5), DEFVAL(4), DEFVAL(Math::deg2rad((float)45)));
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(D_METHOD("is_colliding"), &KinematicBody2D::is_colliding);
+ ClassDB::bind_method(D_METHOD("is_on_floor"), &KinematicBody2D::is_on_floor);
+ ClassDB::bind_method(D_METHOD("is_on_ceiling"), &KinematicBody2D::is_on_ceiling);
+ ClassDB::bind_method(D_METHOD("is_on_wall"), &KinematicBody2D::is_on_wall);
+ ClassDB::bind_method(D_METHOD("get_floor_velocity"), &KinematicBody2D::get_floor_velocity);
- 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(D_METHOD("set_safe_margin", "pixels"), &KinematicBody2D::set_safe_margin);
+ ClassDB::bind_method(D_METHOD("get_safe_margin"), &KinematicBody2D::get_safe_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);
+ ClassDB::bind_method(D_METHOD("get_collision_count"), &KinematicBody2D::get_collision_count);
+ ClassDB::bind_method(D_METHOD("get_collision_position", "collision"), &KinematicBody2D::get_collision_position);
+ ClassDB::bind_method(D_METHOD("get_collision_normal", "collision"), &KinematicBody2D::get_collision_normal);
+ ClassDB::bind_method(D_METHOD("get_collision_travel", "collision"), &KinematicBody2D::get_collision_travel);
+ ClassDB::bind_method(D_METHOD("get_collision_remainder", "collision"), &KinematicBody2D::get_collision_remainder);
+ ClassDB::bind_method(D_METHOD("get_collision_local_shape", "collision"), &KinematicBody2D::get_collision_local_shape);
+ ClassDB::bind_method(D_METHOD("get_collision_collider", "collision"), &KinematicBody2D::get_collision_collider);
+ ClassDB::bind_method(D_METHOD("get_collision_collider_id", "collision"), &KinematicBody2D::get_collision_collider_id);
+ ClassDB::bind_method(D_METHOD("get_collision_collider_shape", "collision"), &KinematicBody2D::get_collision_collider_shape);
+ ClassDB::bind_method(D_METHOD("get_collision_collider_shape_index", "collision"), &KinematicBody2D::get_collision_collider_shape_index);
+ ClassDB::bind_method(D_METHOD("get_collision_collider_velocity", "collision"), &KinematicBody2D::get_collision_collider_velocity);
+ ClassDB::bind_method(D_METHOD("get_collision_collider_metadata", "collision"), &KinematicBody2D::get_collision_collider_metadata);
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_collision_margin", "get_collision_margin");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin");
}
KinematicBody2D::KinematicBody2D()
: PhysicsBody2D(Physics2DServer::BODY_MODE_KINEMATIC) {
- colliding = false;
- collider = 0;
-
- collider_shape = 0;
-
margin = 0.08;
- move_and_slide_on_floor = false;
- move_and_slide_on_ceiling = false;
- move_and_slide_on_wall = false;
+ on_floor = false;
+ on_ceiling = false;
+ on_wall = false;
}
KinematicBody2D::~KinematicBody2D() {
}
diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h
index e51b512302..54bd263b15 100644
--- a/scene/2d/physics_body_2d.h
+++ b/scene/2d/physics_body_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,10 +38,8 @@ class PhysicsBody2D : public CollisionObject2D {
GDCLASS(PhysicsBody2D, CollisionObject2D);
- uint32_t mask;
+ uint32_t collision_layer;
uint32_t collision_mask;
- Vector2 one_way_collision_direction;
- float one_way_collision_max_depth;
void _set_layers(uint32_t p_mask);
uint32_t _get_layers() const;
@@ -52,7 +51,7 @@ protected:
static void _bind_methods();
public:
- void set_collision_layer(uint32_t p_mask);
+ void set_collision_layer(uint32_t p_layer);
uint32_t get_collision_layer() const;
void set_collision_mask(uint32_t p_mask);
@@ -67,12 +66,6 @@ public:
void add_collision_exception_with(Node *p_node); //must be physicsbody
void remove_collision_exception_with(Node *p_node);
- void set_one_way_collision_direction(const Vector2 &p_dir);
- Vector2 get_one_way_collision_direction() const;
-
- void set_one_way_collision_max_depth(float p_dir);
- float get_one_way_collision_max_depth() const;
-
PhysicsBody2D();
};
@@ -192,6 +185,7 @@ private:
bool _test_motion(const Vector2 &p_motion, float p_margin = 0.08, const Ref<Physics2DTestMotionResult> &p_result = Ref<Physics2DTestMotionResult>());
protected:
+ void _notification(int p_what);
static void _bind_methods();
public:
@@ -260,6 +254,8 @@ public:
Array get_colliding_bodies() const; //function for script
+ virtual String get_configuration_warning() const;
+
RigidBody2D();
~RigidBody2D();
};
@@ -271,54 +267,60 @@ class KinematicBody2D : public PhysicsBody2D {
GDCLASS(KinematicBody2D, PhysicsBody2D);
+public:
+ struct Collision {
+ Vector2 collision;
+ Vector2 normal;
+ Vector2 collider_vel;
+ ObjectID collider;
+ int collider_shape;
+ Variant collider_metadata;
+ Vector2 remainder;
+ Vector2 travel;
+ int local_shape;
+ };
+
+private:
float margin;
- bool colliding;
- Vector2 collision;
- Vector2 normal;
- Vector2 collider_vel;
- ObjectID collider;
- int collider_shape;
- Variant collider_metadata;
- Vector2 travel;
-
- Vector2 move_and_slide_floor_velocity;
- bool move_and_slide_on_floor;
- bool move_and_slide_on_ceiling;
- bool move_and_slide_on_wall;
- Array move_and_slide_colliders;
-
- Variant _get_collider() const;
+
+ Vector2 floor_velocity;
+ bool on_floor;
+ bool on_ceiling;
+ bool on_wall;
+ Vector<Collision> colliders;
_FORCE_INLINE_ bool _ignores_mode(Physics2DServer::BodyMode) const;
+ Dictionary _move(const Vector2 &p_motion);
+
protected:
static void _bind_methods();
public:
- Vector2 move(const Vector2 &p_motion);
- Vector2 move_to(const Vector2 &p_position);
-
+ bool move(const Vector2 &p_motion, Collision &r_collision);
bool test_move(const Transform2D &p_from, const Vector2 &p_motion);
- bool is_colliding() const;
-
- Vector2 get_travel() const;
- void revert_motion();
-
- Vector2 get_collision_pos() const;
- Vector2 get_collision_normal() const;
- Vector2 get_collider_velocity() const;
- ObjectID get_collider() const;
- int get_collider_shape() const;
- Variant get_collider_metadata() const;
-
- void set_collision_margin(float p_margin);
- float get_collision_margin() const;
-
- Vector2 move_and_slide(const Vector2 &p_linear_velocity, const Vector2 &p_floor_direction = Vector2(0, 0), float p_slope_stop_min_velocity = 5, int p_max_bounces = 4);
- bool is_move_and_slide_on_floor() const;
- bool is_move_and_slide_on_wall() const;
- bool is_move_and_slide_on_ceiling() const;
- Array get_move_and_slide_colliders() const;
+
+ void set_safe_margin(float p_margin);
+ float get_safe_margin() const;
+
+ Vector2 move_and_slide(const Vector2 &p_linear_velocity, const Vector2 &p_floor_direction = Vector2(0, 0), float p_slope_stop_min_velocity = 5, int p_max_bounces = 4, float p_floor_max_angle = Math::deg2rad((float)45));
+ bool is_on_floor() const;
+ bool is_on_wall() const;
+ bool is_on_ceiling() const;
+ Vector2 get_floor_velocity() const;
+
+ int get_collision_count() const;
+ Vector2 get_collision_position(int p_collision) const;
+ Vector2 get_collision_normal(int p_collision) const;
+ Vector2 get_collision_travel(int p_collision) const;
+ Vector2 get_collision_remainder(int p_collision) const;
+ Object *get_collision_local_shape(int p_collision) const;
+ Object *get_collision_collider(int p_collision) const;
+ ObjectID get_collision_collider_id(int p_collision) const;
+ Object *get_collision_collider_shape(int p_collision) const;
+ int get_collision_collider_shape_index(int p_collision) const;
+ Vector2 get_collision_collider_velocity(int p_collision) const;
+ Variant get_collision_collider_metadata(int p_collision) const;
KinematicBody2D();
~KinematicBody2D();
diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp
index 1d54fd1538..5c1c953a37 100644
--- a/scene/2d/polygon_2d.cpp
+++ b/scene/2d/polygon_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,7 +38,7 @@ Rect2 Polygon2D::get_item_rect() const {
for (int i = 0; i < l; i++) {
Vector2 pos = r[i] + offset;
if (i == 0)
- item_rect.pos = pos;
+ item_rect.position = pos;
else
item_rect.expand_to(pos);
}
@@ -94,7 +95,7 @@ void Polygon2D::_notification(int p_what) {
for (int i = 0; i < len; i++) {
if (i == 0)
- bounds.pos = points[i];
+ bounds.position = points[i];
else
bounds.expand_to(points[i]);
if (points[i].y > highest_y) {
@@ -109,10 +110,10 @@ void Polygon2D::_notification(int p_what) {
Vector2 ep[7] = {
Vector2(points[highest_idx].x, points[highest_idx].y + invert_border),
- Vector2(bounds.pos + bounds.size),
- Vector2(bounds.pos + Vector2(bounds.size.x, 0)),
- Vector2(bounds.pos),
- Vector2(bounds.pos + Vector2(0, bounds.size.y)),
+ Vector2(bounds.position + bounds.size),
+ Vector2(bounds.position + Vector2(bounds.size.x, 0)),
+ Vector2(bounds.position),
+ Vector2(bounds.position + Vector2(0, bounds.size.y)),
Vector2(points[highest_idx].x - CMP_EPSILON, points[highest_idx].y + invert_border),
Vector2(points[highest_idx].x - CMP_EPSILON, points[highest_idx].y),
};
diff --git a/scene/2d/polygon_2d.h b/scene/2d/polygon_2d.h
index 50968f3de4..3cc9db28b6 100644
--- a/scene/2d/polygon_2d.h
+++ b/scene/2d/polygon_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -83,10 +84,10 @@ public:
void set_texture_scale(const Size2 &p_scale);
Size2 get_texture_scale() const;
- void set_invert(bool p_rot);
+ void set_invert(bool p_invert);
bool get_invert() const;
- void set_invert_border(float p_border);
+ void set_invert_border(float p_invert_border);
float get_invert_border() const;
void set_offset(const Vector2 &p_offset);
diff --git a/scene/2d/position_2d.cpp b/scene/2d/position_2d.cpp
index 39fc6352e9..74ad9c17e2 100644
--- a/scene/2d/position_2d.cpp
+++ b/scene/2d/position_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/position_2d.h b/scene/2d/position_2d.h
index a9ead3d87f..67ff2c610d 100644
--- a/scene/2d/position_2d.h
+++ b/scene/2d/position_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp
index 83a0717acf..cfb4059714 100644
--- a/scene/2d/ray_cast_2d.cpp
+++ b/scene/2d/ray_cast_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,14 +44,14 @@ Vector2 RayCast2D::get_cast_to() const {
return cast_to;
}
-void RayCast2D::set_layer_mask(uint32_t p_mask) {
+void RayCast2D::set_collision_layer(uint32_t p_layer) {
- layer_mask = p_mask;
+ collision_layer = p_layer;
}
-uint32_t RayCast2D::get_layer_mask() const {
+uint32_t RayCast2D::get_collision_layer() const {
- return layer_mask;
+ return collision_layer;
}
void RayCast2D::set_type_mask(uint32_t p_mask) {
@@ -156,16 +157,16 @@ void RayCast2D::_notification(int p_what) {
break;
Transform2D xf;
xf.rotate(cast_to.angle());
- xf.translate(Vector2(0, cast_to.length()));
+ xf.translate(Vector2(cast_to.length(), 0));
//Vector2 tip = Vector2(0,s->get_length());
Color dcol = get_tree()->get_debug_collisions_color(); //0.9,0.2,0.2,0.4);
draw_line(Vector2(), cast_to, dcol, 3);
Vector<Vector2> pts;
float tsize = 4;
- pts.push_back(xf.xform(Vector2(0, tsize)));
- pts.push_back(xf.xform(Vector2(0.707 * tsize, 0)));
- pts.push_back(xf.xform(Vector2(-0.707 * tsize, 0)));
+ pts.push_back(xf.xform(Vector2(tsize, 0)));
+ pts.push_back(xf.xform(Vector2(0, 0.707 * tsize)));
+ pts.push_back(xf.xform(Vector2(0, -0.707 * tsize)));
Vector<Color> cols;
for (int i = 0; i < 3; i++)
cols.push_back(dcol);
@@ -200,7 +201,7 @@ void RayCast2D::_update_raycast_state() {
Physics2DDirectSpaceState::RayResult rr;
- if (dss->intersect_ray(gt.get_origin(), gt.xform(to), rr, exclude, layer_mask, type_mask)) {
+ if (dss->intersect_ray(gt.get_origin(), gt.xform(to), rr, exclude, collision_layer, type_mask)) {
collided = true;
against = rr.collider_id;
@@ -273,8 +274,8 @@ void RayCast2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("clear_exceptions"), &RayCast2D::clear_exceptions);
- 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(D_METHOD("set_collision_layer", "layer"), &RayCast2D::set_collision_layer);
+ ClassDB::bind_method(D_METHOD("get_collision_layer"), &RayCast2D::get_collision_layer);
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);
@@ -285,7 +286,7 @@ void RayCast2D::_bind_methods() {
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, "collision_layer", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_layer", "get_collision_layer");
ADD_PROPERTY(PropertyInfo(Variant::INT, "type_mask", PROPERTY_HINT_FLAGS, "Static,Kinematic,Rigid,Character,Area"), "set_type_mask", "get_type_mask");
}
@@ -295,7 +296,7 @@ RayCast2D::RayCast2D() {
against = 0;
collided = false;
against_shape = 0;
- layer_mask = 1;
+ collision_layer = 1;
type_mask = Physics2DDirectSpaceState::TYPE_MASK_COLLISION;
cast_to = Vector2(0, 50);
exclude_parent_body = true;
diff --git a/scene/2d/ray_cast_2d.h b/scene/2d/ray_cast_2d.h
index 6a59ef963b..244f4302ad 100644
--- a/scene/2d/ray_cast_2d.h
+++ b/scene/2d/ray_cast_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -42,7 +43,7 @@ class RayCast2D : public Node2D {
Vector2 collision_point;
Vector2 collision_normal;
Set<RID> exclude;
- uint32_t layer_mask;
+ uint32_t collision_layer;
uint32_t type_mask;
bool exclude_parent_body;
@@ -60,8 +61,8 @@ public:
void set_cast_to(const Vector2 &p_point);
Vector2 get_cast_to() const;
- void set_layer_mask(uint32_t p_mask);
- uint32_t get_layer_mask() const;
+ void set_collision_layer(uint32_t p_layer);
+ uint32_t get_collision_layer() const;
void set_type_mask(uint32_t p_mask);
uint32_t get_type_mask() const;
diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp
index 210f64ae23..cbd7ac06f5 100644
--- a/scene/2d/remote_transform_2d.cpp
+++ b/scene/2d/remote_transform_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,7 +39,7 @@ void RemoteTransform2D::_update_cache() {
return;
}
- cache = node->get_instance_ID();
+ cache = node->get_instance_id();
}
}
@@ -62,7 +63,50 @@ void RemoteTransform2D::_update_remote() {
return;
//todo make faster
- n->set_global_transform(get_global_transform());
+ if (use_global_coordinates) {
+
+ if (update_remote_position && update_remote_rotation && update_remote_scale) {
+ n->set_global_transform(get_global_transform());
+ } else {
+ Transform2D n_trans = n->get_global_transform();
+ Transform2D our_trans = get_global_transform();
+ Vector2 n_scale = n->get_global_scale();
+
+ if (!update_remote_position)
+ our_trans.set_origin(n_trans.get_origin());
+ if (!update_remote_rotation)
+ our_trans.set_rotation(n_trans.get_rotation());
+
+ n->set_global_transform(our_trans);
+
+ if (update_remote_scale)
+ n->set_scale(get_global_scale());
+ else
+ n->set_scale(n_scale);
+ }
+
+ } else {
+
+ if (update_remote_position && update_remote_rotation && update_remote_scale) {
+ n->set_transform(get_transform());
+ } else {
+ Transform2D n_trans = n->get_transform();
+ Transform2D our_trans = get_transform();
+ Vector2 n_scale = n->get_scale();
+
+ if (!update_remote_position)
+ our_trans.set_origin(n_trans.get_origin());
+ if (!update_remote_rotation)
+ our_trans.set_rotation(n_trans.get_rotation());
+
+ n->set_transform(our_trans);
+
+ if (update_remote_scale)
+ n->set_scale(get_scale());
+ else
+ n->set_scale(n_scale);
+ }
+ }
}
void RemoteTransform2D::_notification(int p_what) {
@@ -101,6 +145,41 @@ NodePath RemoteTransform2D::get_remote_node() const {
return remote_node;
}
+void RemoteTransform2D::set_use_global_coordinates(const bool p_enable) {
+ use_global_coordinates = p_enable;
+}
+
+bool RemoteTransform2D::get_use_global_coordinates() const {
+ return use_global_coordinates;
+}
+
+void RemoteTransform2D::set_update_position(const bool p_update) {
+ update_remote_position = p_update;
+ _update_remote();
+}
+
+bool RemoteTransform2D::get_update_position() const {
+ return update_remote_position;
+}
+
+void RemoteTransform2D::set_update_rotation(const bool p_update) {
+ update_remote_rotation = p_update;
+ _update_remote();
+}
+
+bool RemoteTransform2D::get_update_rotation() const {
+ return update_remote_rotation;
+}
+
+void RemoteTransform2D::set_update_scale(const bool p_update) {
+ update_remote_scale = p_update;
+ _update_remote();
+}
+
+bool RemoteTransform2D::get_update_scale() const {
+ return update_remote_scale;
+}
+
String RemoteTransform2D::get_configuration_warning() const {
if (!has_node(remote_node) || !get_node(remote_node) || !get_node(remote_node)->cast_to<Node2D>()) {
@@ -115,11 +194,32 @@ void RemoteTransform2D::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("set_use_global_coordinates", "use_global_coordinates"), &RemoteTransform2D::set_use_global_coordinates);
+ ClassDB::bind_method(D_METHOD("get_use_global_coordinates"), &RemoteTransform2D::get_use_global_coordinates);
+
+ ClassDB::bind_method(D_METHOD("set_update_position", "update_remote_position"), &RemoteTransform2D::set_update_position);
+ ClassDB::bind_method(D_METHOD("get_update_position"), &RemoteTransform2D::get_update_position);
+ ClassDB::bind_method(D_METHOD("set_update_rotation", "update_remote_rotation"), &RemoteTransform2D::set_update_rotation);
+ ClassDB::bind_method(D_METHOD("get_update_rotation"), &RemoteTransform2D::get_update_rotation);
+ ClassDB::bind_method(D_METHOD("set_update_scale", "update_remote_scale"), &RemoteTransform2D::set_update_scale);
+ ClassDB::bind_method(D_METHOD("get_update_scale"), &RemoteTransform2D::get_update_scale);
+
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "remote_path"), "set_remote_node", "get_remote_node");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_global_coordinates"), "set_use_global_coordinates", "get_use_global_coordinates");
+
+ ADD_GROUP("Update", "update_");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_position"), "set_update_position", "get_update_position");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_rotation"), "set_update_rotation", "get_update_rotation");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_scale"), "set_update_scale", "get_update_scale");
}
RemoteTransform2D::RemoteTransform2D() {
+ use_global_coordinates = true;
+ update_remote_position = true;
+ update_remote_rotation = true;
+ update_remote_scale = true;
+
cache = 0;
set_notify_transform(true);
}
diff --git a/scene/2d/remote_transform_2d.h b/scene/2d/remote_transform_2d.h
index aa1b214314..d58ec14a95 100644
--- a/scene/2d/remote_transform_2d.h
+++ b/scene/2d/remote_transform_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,6 +37,11 @@ class RemoteTransform2D : public Node2D {
ObjectID cache;
+ bool use_global_coordinates;
+ bool update_remote_position;
+ bool update_remote_rotation;
+ bool update_remote_scale;
+
void _update_remote();
void _update_cache();
//void _node_exited_scene();
@@ -47,6 +53,18 @@ public:
void set_remote_node(const NodePath &p_remote_node);
NodePath get_remote_node() const;
+ void set_use_global_coordinates(const bool p_enable);
+ bool get_use_global_coordinates() const;
+
+ void set_update_position(const bool p_update);
+ bool get_update_position() const;
+
+ void set_update_rotation(const bool p_update);
+ bool get_update_rotation() const;
+
+ void set_update_scale(const bool p_update);
+ bool get_update_scale() const;
+
virtual String get_configuration_warning() const;
RemoteTransform2D();
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp
index db822ed306..37139b2b93 100644
--- a/scene/2d/screen_button.cpp
+++ b/scene/2d/screen_button.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -65,12 +66,14 @@ Ref<BitMap> TouchScreenButton::get_bitmask() const {
void TouchScreenButton::set_shape(const Ref<Shape2D> &p_shape) {
+ if (shape.is_valid())
+ shape->disconnect("changed", this, "update");
+
shape = p_shape;
- if (!is_inside_tree())
- return;
- if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint())
- return;
+ if (shape.is_valid())
+ shape->connect("changed", this, "update");
+
update();
}
@@ -82,11 +85,17 @@ Ref<Shape2D> TouchScreenButton::get_shape() const {
void TouchScreenButton::set_shape_centered(bool p_shape_centered) {
shape_centered = p_shape_centered;
+ update();
+}
- if (!is_inside_tree())
- return;
- if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint())
- return;
+bool TouchScreenButton::is_shape_visible() const {
+
+ return shape_visible;
+}
+
+void TouchScreenButton::set_shape_visible(bool p_shape_visible) {
+
+ shape_visible = p_shape_visible;
update();
}
@@ -118,6 +127,8 @@ void TouchScreenButton::_notification(int p_what) {
draw_texture(texture, Point2());
}
+ if (!shape_visible)
+ return;
if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint())
return;
if (shape.is_valid()) {
@@ -137,11 +148,6 @@ void TouchScreenButton::_notification(int p_what) {
if (!get_tree()->is_editor_hint())
set_process_input(is_visible_in_tree());
- if (action.operator String() != "" && InputMap::get_singleton()->has_action(action)) {
- action_id = InputMap::get_singleton()->get_action_id(action);
- } else {
- action_id = -1;
- }
} break;
case NOTIFICATION_EXIT_TREE: {
if (is_pressed())
@@ -173,11 +179,6 @@ bool TouchScreenButton::is_pressed() const {
void TouchScreenButton::set_action(const String &p_action) {
action = p_action;
- if (action.operator String() != "" && InputMap::get_singleton()->has_action(action)) {
- action_id = InputMap::get_singleton()->get_action_id(action);
- } else {
- action_id = -1;
- }
}
String TouchScreenButton::get_action() const {
@@ -185,44 +186,37 @@ String TouchScreenButton::get_action() const {
return action;
}
-void TouchScreenButton::_input(const InputEvent &p_event) {
+void TouchScreenButton::_input(const Ref<InputEvent> &p_event) {
if (!get_tree())
return;
- if (p_event.device != 0)
+ if (p_event->get_device() != 0)
return;
- if (passby_press) {
+ ERR_FAIL_COND(!is_visible_in_tree());
- if (p_event.type == InputEvent::SCREEN_TOUCH && !p_event.screen_touch.pressed && finger_pressed == p_event.screen_touch.index) {
+ const InputEventScreenTouch *st = p_event->cast_to<InputEventScreenTouch>();
- _release();
- }
-
- if ((p_event.type == InputEvent::SCREEN_TOUCH && p_event.screen_touch.pressed) || p_event.type == InputEvent::SCREEN_DRAG) {
+ if (passby_press) {
- if (finger_pressed == -1 || p_event.screen_touch.index == finger_pressed) {
+ const InputEventScreenDrag *sd = p_event->cast_to<InputEventScreenDrag>();
- Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x, p_event.screen_touch.y));
+ if (st && !st->is_pressed() && finger_pressed == st->get_index()) {
- bool touched = false;
- if (bitmask.is_valid()) {
+ _release();
+ }
- if (Rect2(Point2(), bitmask->get_size()).has_point(coord)) {
+ if ((st && st->is_pressed()) || sd) {
- if (bitmask->get_bit(coord))
- touched = true;
- }
- } else {
+ int index = st ? st->get_index() : sd->get_index();
+ Point2 coord = st ? st->get_position() : sd->get_position();
- if (texture.is_valid())
- touched = Rect2(Point2(), texture->get_size()).has_point(coord);
- }
+ if (finger_pressed == -1 || index == finger_pressed) {
- if (touched) {
+ if (_is_point_inside(coord)) {
if (finger_pressed == -1) {
- _press(p_event.screen_touch.index);
+ _press(index);
}
} else {
if (finger_pressed != -1) {
@@ -234,69 +228,71 @@ void TouchScreenButton::_input(const InputEvent &p_event) {
} else {
- if (p_event.type == InputEvent::SCREEN_TOUCH) {
-
- if (p_event.screen_touch.pressed) {
+ if (st) {
- if (!is_visible_in_tree())
- return;
+ if (st->is_pressed()) {
const bool can_press = finger_pressed == -1;
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();
+ if (_is_point_inside(st->get_position())) {
+ _press(st->get_index());
+ }
+ } else {
+ if (st->get_index() == finger_pressed) {
+ _release();
+ }
+ }
+ }
+ }
+}
- bool touched = false;
- bool check_rect = true;
- if (shape.is_valid()) {
+bool TouchScreenButton::_is_point_inside(const Point2 &p_point) {
- 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)));
- }
+ Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(p_point);
+ Rect2 item_rect = get_item_rect();
- if (bitmask.is_valid()) {
+ bool touched = false;
+ bool check_rect = true;
- check_rect = false;
- if (!touched && Rect2(Point2(), bitmask->get_size()).has_point(coord)) {
+ if (shape.is_valid()) {
- if (bitmask->get_bit(coord))
- touched = true;
- }
- }
+ check_rect = false;
+ Transform2D xform = shape_centered ? Transform2D().translated(item_rect.size * 0.5f) : Transform2D();
+ touched = shape->collide(xform, unit_rect, Transform2D(0, coord + Vector2(0.5, 0.5)));
+ }
- if (!touched && check_rect) {
- if (!texture.is_null())
- touched = item_rect.has_point(coord);
- }
+ if (bitmask.is_valid()) {
- if (touched) {
- _press(p_event.screen_touch.index);
- }
- } else {
- if (p_event.screen_touch.index == finger_pressed) {
- _release();
- }
- }
+ check_rect = false;
+ if (!touched && Rect2(Point2(), bitmask->get_size()).has_point(coord)) {
+
+ if (bitmask->get_bit(coord))
+ touched = true;
}
}
+
+ if (!touched && check_rect) {
+ if (texture.is_valid())
+ touched = item_rect.has_point(coord);
+ }
+
+ return touched;
}
void TouchScreenButton::_press(int p_finger_pressed) {
finger_pressed = p_finger_pressed;
- if (action_id != -1) {
+ if (action != StringName()) {
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);
+ Ref<InputEventAction> iea;
+ iea.instance();
+ iea->set_action(action);
+ iea->set_pressed(true);
+ get_tree()->input_event(iea);
}
emit_signal("pressed");
@@ -307,16 +303,16 @@ void TouchScreenButton::_release(bool p_exiting_tree) {
finger_pressed = -1;
- if (action_id != -1) {
+ if (action != StringName()) {
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);
+
+ Ref<InputEventAction> iea;
+ iea.instance();
+ iea->set_action(action);
+ iea->set_pressed(false);
+ get_tree()->input_event(iea);
}
}
@@ -375,6 +371,9 @@ void TouchScreenButton::_bind_methods() {
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(D_METHOD("set_shape_visible", "bool"), &TouchScreenButton::set_shape_visible);
+ ClassDB::bind_method(D_METHOD("is_shape_visible"), &TouchScreenButton::is_shape_visible);
+
ClassDB::bind_method(D_METHOD("set_action", "action"), &TouchScreenButton::set_action);
ClassDB::bind_method(D_METHOD("get_action"), &TouchScreenButton::get_action);
@@ -393,6 +392,7 @@ void TouchScreenButton::_bind_methods() {
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, "shape_visible"), "set_shape_visible", "is_shape_visible");
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");
@@ -404,10 +404,10 @@ void TouchScreenButton::_bind_methods() {
TouchScreenButton::TouchScreenButton() {
finger_pressed = -1;
- action_id = -1;
passby_press = false;
visibility = VISIBILITY_ALWAYS;
shape_centered = true;
+ shape_visible = 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 201d908bf6..2a5935aaf1 100644
--- a/scene/2d/screen_button.h
+++ b/scene/2d/screen_button.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -50,17 +51,19 @@ private:
Ref<BitMap> bitmask;
Ref<Shape2D> shape;
bool shape_centered;
+ bool shape_visible;
Ref<RectangleShape2D> unit_rect;
StringName action;
bool passby_press;
int finger_pressed;
- int action_id;
VisibilityMode visibility;
- void _input(const InputEvent &p_Event);
+ void _input(const Ref<InputEvent> &p_event);
+
+ bool _is_point_inside(const Point2 &p_point);
void _press(int p_finger_pressed);
void _release(bool p_exiting_tree = false);
@@ -85,6 +88,9 @@ public:
void set_shape_centered(bool p_shape_centered);
bool is_shape_centered() const;
+ void set_shape_visible(bool p_shape_visible);
+ bool is_shape_visible() 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 41ea6a39e5..2ec529a166 100644
--- a/scene/2d/sprite.cpp
+++ b/scene/2d/sprite.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -64,18 +65,20 @@ void Sprite::_notification(int p_what) {
Size2 s;
Rect2 src_rect;
+ bool filter_clip = false;
if (region) {
s = region_rect.size;
src_rect = region_rect;
+ filter_clip = region_filter_clip;
} else {
s = Size2(texture->get_size());
s = s / Size2(hframes, vframes);
src_rect.size = s;
- src_rect.pos.x += float(frame % hframes) * s.x;
- src_rect.pos.y += float(frame / hframes) * s.y;
+ src_rect.position.x += float(frame % hframes) * s.x;
+ src_rect.position.y += float(frame / hframes) * s.y;
}
Point2 ofs = offset;
@@ -92,7 +95,7 @@ void Sprite::_notification(int p_what) {
if (vflip)
dst_rect.size.y = -dst_rect.size.y;
- texture->draw_rect_region(ci, dst_rect, src_rect);
+ texture->draw_rect_region(ci, dst_rect, src_rect, Color(1, 1, 1), false, normal_map, filter_clip);
} break;
}
@@ -102,21 +105,22 @@ void Sprite::set_texture(const Ref<Texture> &p_texture) {
if (p_texture == texture)
return;
-#ifdef DEBUG_ENABLED
- if (texture.is_valid()) {
- texture->disconnect(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->update);
- }
-#endif
texture = p_texture;
-#ifdef DEBUG_ENABLED
- if (texture.is_valid()) {
- texture->set_flags(texture->get_flags()); //remove repeat from texture, it looks bad in sprites
- texture->connect(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->update);
- }
-#endif
update();
emit_signal("texture_changed");
item_rect_changed();
+ _change_notify("texture");
+}
+
+void Sprite::set_normal_map(const Ref<Texture> &p_texture) {
+
+ normal_map = p_texture;
+ update();
+}
+
+Ref<Texture> Sprite::get_normal_map() const {
+
+ return normal_map;
}
Ref<Texture> Sprite::get_texture() const {
@@ -200,6 +204,15 @@ Rect2 Sprite::get_region_rect() const {
return region_rect;
}
+void Sprite::set_region_filter_clip(bool p_enable) {
+ region_filter_clip = p_enable;
+ update();
+}
+
+bool Sprite::is_region_filter_clip_enabled() const {
+ return region_filter_clip;
+}
+
void Sprite::set_frame(int p_frame) {
ERR_FAIL_INDEX(p_frame, vframes * hframes);
@@ -224,7 +237,7 @@ void Sprite::set_vframes(int p_amount) {
vframes = p_amount;
update();
item_rect_changed();
- _change_notify("frame");
+ _change_notify();
}
int Sprite::get_vframes() const {
@@ -237,7 +250,7 @@ void Sprite::set_hframes(int p_amount) {
hframes = p_amount;
update();
item_rect_changed();
- _change_notify("frame");
+ _change_notify();
}
int Sprite::get_hframes() const {
@@ -285,8 +298,11 @@ void Sprite::_validate_property(PropertyInfo &property) const {
void Sprite::_bind_methods() {
- 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(D_METHOD("set_texture", "texture"), &Sprite::set_texture);
+ ClassDB::bind_method(D_METHOD("get_texture"), &Sprite::get_texture);
+
+ ClassDB::bind_method(D_METHOD("set_normal_map", "normal_map"), &Sprite::set_normal_map);
+ ClassDB::bind_method(D_METHOD("get_normal_map"), &Sprite::get_normal_map);
ClassDB::bind_method(D_METHOD("set_centered", "centered"), &Sprite::set_centered);
ClassDB::bind_method(D_METHOD("is_centered"), &Sprite::is_centered);
@@ -306,6 +322,9 @@ void Sprite::_bind_methods() {
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(D_METHOD("set_region_filter_clip", "enabled"), &Sprite::set_region_filter_clip);
+ ClassDB::bind_method(D_METHOD("is_region_filter_clip_enabled"), &Sprite::is_region_filter_clip_enabled);
+
ClassDB::bind_method(D_METHOD("set_frame", "frame"), &Sprite::set_frame);
ClassDB::bind_method(D_METHOD("get_frame"), &Sprite::get_frame);
@@ -319,15 +338,21 @@ void Sprite::_bind_methods() {
ADD_SIGNAL(MethodInfo("texture_changed"));
ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_normal_map", "get_normal_map");
+ ADD_GROUP("Offset", "");
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_GROUP("Animation", "");
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_GROUP("Region", "region_");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "region_enabled"), "set_region", "is_region");
ADD_PROPERTYNZ(PropertyInfo(Variant::RECT2, "region_rect"), "set_region_rect", "get_region_rect");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "region_filter_clip"), "set_region_filter_clip", "is_region_filter_clip_enabled");
}
Sprite::Sprite() {
@@ -336,6 +361,7 @@ Sprite::Sprite() {
hflip = false;
vflip = false;
region = false;
+ region_filter_clip = false;
frame = 0;
diff --git a/scene/2d/sprite.h b/scene/2d/sprite.h
index c4bc800647..d3f9a5f032 100644
--- a/scene/2d/sprite.h
+++ b/scene/2d/sprite.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,6 +38,7 @@ class Sprite : public Node2D {
GDCLASS(Sprite, Node2D);
Ref<Texture> texture;
+ Ref<Texture> normal_map;
bool centered;
Point2 offset;
@@ -45,6 +47,7 @@ class Sprite : public Node2D {
bool vflip;
bool region;
Rect2 region_rect;
+ bool region_filter_clip;
int frame;
@@ -66,6 +69,9 @@ public:
void set_texture(const Ref<Texture> &p_texture);
Ref<Texture> get_texture() const;
+ void set_normal_map(const Ref<Texture> &p_texture);
+ Ref<Texture> get_normal_map() const;
+
void set_centered(bool p_center);
bool is_centered() const;
@@ -81,6 +87,9 @@ public:
void set_region(bool p_region);
bool is_region() const;
+ void set_region_filter_clip(bool p_enable);
+ bool is_region_filter_clip_enabled() const;
+
void set_region_rect(const Rect2 &p_region_rect);
Rect2 get_region_rect() const;
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 02b41fbd0c..68b026b1b3 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,7 +29,7 @@
/*************************************************************************/
#include "tile_map.h"
#include "io/marshalls.h"
-#include "method_bind_ext.inc"
+#include "method_bind_ext.gen.inc"
#include "os/os.h"
#include "servers/physics_2d_server.h"
@@ -304,7 +305,7 @@ void TileMap::_update_dirty_quadrants() {
VS::get_singleton()->free(E->get().id);
}
q.occluder_instances.clear();
- Ref<CanvasItemMaterial> prev_material;
+ Ref<ShaderMaterial> prev_material;
RID prev_canvas_item;
RID prev_debug_canvas_item;
@@ -324,7 +325,7 @@ void TileMap::_update_dirty_quadrants() {
if (!tex.is_valid())
continue;
- Ref<CanvasItemMaterial> mat = tile_set->tile_get_material(c.id);
+ Ref<ShaderMaterial> mat = tile_set->tile_get_material(c.id);
RID canvas_item;
RID debug_canvas_item;
@@ -369,14 +370,14 @@ void TileMap::_update_dirty_quadrants() {
s = tex->get_size();
else {
s = r.size;
- r.pos.x += fp_adjust;
- r.pos.y += fp_adjust;
+ r.position.x += fp_adjust;
+ r.position.y += fp_adjust;
r.size.x -= fp_adjust * 2.0;
r.size.y -= fp_adjust * 2.0;
}
Rect2 rect;
- rect.pos = offset.floor();
+ rect.position = offset.floor();
rect.size = s;
if (rect.size.y > rect.size.x) {
@@ -405,70 +406,73 @@ void TileMap::_update_dirty_quadrants() {
Vector2 center_ofs;
if (tile_origin == TILE_ORIGIN_TOP_LEFT) {
- rect.pos += tile_ofs;
+ rect.position += tile_ofs;
} else if (tile_origin == TILE_ORIGIN_BOTTOM_LEFT) {
- rect.pos += tile_ofs;
+ rect.position += tile_ofs;
if (c.transpose) {
if (c.flip_h)
- rect.pos.x -= cell_size.x;
+ rect.position.x -= cell_size.x;
else
- rect.pos.x += cell_size.x;
+ rect.position.x += cell_size.x;
} else {
if (c.flip_v)
- rect.pos.y -= cell_size.y;
+ rect.position.y -= cell_size.y;
else
- rect.pos.y += cell_size.y;
+ rect.position.y += cell_size.y;
}
} else if (tile_origin == TILE_ORIGIN_CENTER) {
- rect.pos += tcenter;
+ rect.position += tcenter;
Vector2 center = (s / 2) - tile_ofs;
center_ofs = tcenter - (s / 2);
if (c.flip_h)
- rect.pos.x -= s.x - center.x;
+ rect.position.x -= s.x - center.x;
else
- rect.pos.x -= center.x;
+ rect.position.x -= center.x;
if (c.flip_v)
- rect.pos.y -= s.y - center.y;
+ rect.position.y -= s.y - center.y;
else
- rect.pos.y -= center.y;
+ rect.position.y -= center.y;
}
+ Ref<Texture> normal_map = tile_set->tile_get_normal_map(c.id);
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);
+ tex->draw_rect(canvas_item, rect, false, modulate, c.transpose, normal_map);
} else {
- tex->draw_rect_region(canvas_item, rect, r, modulate, c.transpose);
+ tex->draw_rect_region(canvas_item, rect, r, modulate, c.transpose, normal_map);
}
- Vector<Ref<Shape2D> > shapes = tile_set->tile_get_shapes(c.id);
+ Vector<TileSet::ShapeData> shapes = tile_set->tile_get_shapes(c.id);
for (int i = 0; i < shapes.size(); i++) {
- Ref<Shape2D> shape = shapes[i];
+ Ref<Shape2D> shape = shapes[i].shape;
if (shape.is_valid()) {
-
- Vector2 shape_ofs = tile_set->tile_get_shape_offset(c.id);
Transform2D xform;
xform.set_origin(offset.floor());
- _fix_cell_transform(xform, c, shape_ofs + center_ofs, s);
+ _fix_cell_transform(xform, c, center_ofs, s);
+
+ xform *= shapes[i].shape_transform;
if (debug_canvas_item.is_valid()) {
vs->canvas_item_add_set_transform(debug_canvas_item, xform);
shape->draw(debug_canvas_item, debug_collision_color);
}
ps->body_add_shape(q.body, shape->get_rid(), xform);
- ps->body_set_shape_metadata(q.body, shape_idx++, Vector2(E->key().x, E->key().y));
+ ps->body_set_shape_metadata(q.body, shape_idx, Vector2(E->key().x, E->key().y));
+ ps->body_set_shape_as_one_way_collision(q.body, shape_idx, shapes[i].one_way_collision);
+ shape_idx++;
}
}
@@ -548,7 +552,7 @@ void TileMap::_recompute_rect_cache() {
for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) {
Rect2 r;
- r.pos = _map_to_world(E->key().x * _get_quadrant_size(), E->key().y * _get_quadrant_size());
+ r.position = _map_to_world(E->key().x * _get_quadrant_size(), E->key().y * _get_quadrant_size());
r.expand_to(_map_to_world(E->key().x * _get_quadrant_size() + _get_quadrant_size(), E->key().y * _get_quadrant_size()));
r.expand_to(_map_to_world(E->key().x * _get_quadrant_size() + _get_quadrant_size(), E->key().y * _get_quadrant_size() + _get_quadrant_size()));
r.expand_to(_map_to_world(E->key().x * _get_quadrant_size(), E->key().y * _get_quadrant_size() + _get_quadrant_size()));
@@ -585,8 +589,8 @@ Map<TileMap::PosKey, TileMap::Quadrant>::Element *TileMap::_create_quadrant(cons
xform.set_origin(q.pos);
//q.canvas_item = VisualServer::get_singleton()->canvas_item_create();
q.body = Physics2DServer::get_singleton()->body_create(use_kinematic ? Physics2DServer::BODY_MODE_KINEMATIC : Physics2DServer::BODY_MODE_STATIC);
- Physics2DServer::get_singleton()->body_attach_object_instance_ID(q.body, get_instance_ID());
- Physics2DServer::get_singleton()->body_set_layer_mask(q.body, collision_layer);
+ Physics2DServer::get_singleton()->body_attach_object_instance_id(q.body, get_instance_id());
+ Physics2DServer::get_singleton()->body_set_collision_layer(q.body, collision_layer);
Physics2DServer::get_singleton()->body_set_collision_mask(q.body, collision_mask);
Physics2DServer::get_singleton()->body_set_param(q.body, Physics2DServer::BODY_PARAM_FRICTION, friction);
Physics2DServer::get_singleton()->body_set_param(q.body, Physics2DServer::BODY_PARAM_BOUNCE, bounce);
@@ -862,7 +866,7 @@ void TileMap::set_collision_layer(uint32_t p_layer) {
for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) {
Quadrant &q = E->get();
- Physics2DServer::get_singleton()->body_set_layer_mask(q.body, collision_layer);
+ Physics2DServer::get_singleton()->body_set_collision_layer(q.body, collision_layer);
}
}
@@ -876,6 +880,26 @@ void TileMap::set_collision_mask(uint32_t p_mask) {
}
}
+void TileMap::set_collision_layer_bit(int p_bit, bool p_value) {
+
+ uint32_t layer = get_collision_layer();
+ if (p_value)
+ layer |= 1 << p_bit;
+ else
+ layer &= ~(1 << p_bit);
+ set_collision_layer(layer);
+}
+
+void TileMap::set_collision_mask_bit(int p_bit, bool p_value) {
+
+ uint32_t mask = get_collision_mask();
+ if (p_value)
+ mask |= 1 << p_bit;
+ else
+ mask &= ~(1 << p_bit);
+ set_collision_mask(mask);
+}
+
bool TileMap::get_collision_use_kinematic() const {
return use_kinematic;
@@ -927,6 +951,16 @@ uint32_t TileMap::get_collision_mask() const {
return collision_mask;
}
+bool TileMap::get_collision_layer_bit(int p_bit) const {
+
+ return get_collision_layer() & (1 << p_bit);
+}
+
+bool TileMap::get_collision_mask_bit(int p_bit) const {
+
+ return get_collision_mask() & (1 << p_bit);
+}
+
void TileMap::set_mode(Mode p_mode) {
_clear_quadrants();
@@ -1034,20 +1068,20 @@ Transform2D TileMap::get_custom_transform() const {
return custom_transform;
}
-Vector2 TileMap::_map_to_world(int x, int y, bool p_ignore_ofs) const {
+Vector2 TileMap::_map_to_world(int p_x, int p_y, bool p_ignore_ofs) const {
- Vector2 ret = get_cell_transform().xform(Vector2(x, y));
+ Vector2 ret = get_cell_transform().xform(Vector2(p_x, p_y));
if (!p_ignore_ofs) {
switch (half_offset) {
case HALF_OFFSET_X: {
- if (ABS(y) & 1) {
+ if (ABS(p_y) & 1) {
ret += get_cell_transform()[0] * 0.5;
}
} break;
case HALF_OFFSET_Y: {
- if (ABS(x) & 1) {
+ if (ABS(p_x) & 1) {
ret += get_cell_transform()[1] * 0.5;
}
} break;
@@ -1110,6 +1144,20 @@ Array TileMap::get_used_cells() const {
return a;
}
+Array TileMap::get_used_cells_by_id(int p_id) const {
+
+ Array a;
+ for (Map<PosKey, Cell>::Element *E = tile_map.front(); E; E = E->next()) {
+
+ if (E->value().id == p_id) {
+ Vector2 p(E->key().x, E->key().y);
+ a.push_back(p);
+ }
+ }
+
+ return a;
+}
+
Rect2 TileMap::get_used_rect() { // Not const because of cache
if (used_size_cache_dirty) {
@@ -1160,8 +1208,8 @@ void TileMap::set_light_mask(int p_light_mask) {
void TileMap::_bind_methods() {
- 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(D_METHOD("set_tileset", "tileset"), &TileMap::set_tileset);
+ ClassDB::bind_method(D_METHOD("get_tileset"), &TileMap::get_tileset);
ClassDB::bind_method(D_METHOD("set_mode", "mode"), &TileMap::set_mode);
ClassDB::bind_method(D_METHOD("get_mode"), &TileMap::get_mode);
@@ -1196,12 +1244,18 @@ void TileMap::_bind_methods() {
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(D_METHOD("set_collision_layer", "mask"), &TileMap::set_collision_layer);
+ ClassDB::bind_method(D_METHOD("set_collision_layer", "layer"), &TileMap::set_collision_layer);
ClassDB::bind_method(D_METHOD("get_collision_layer"), &TileMap::get_collision_layer);
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(D_METHOD("set_collision_layer_bit", "bit", "value"), &TileMap::set_collision_layer_bit);
+ ClassDB::bind_method(D_METHOD("get_collision_layer_bit", "bit"), &TileMap::get_collision_layer_bit);
+
+ ClassDB::bind_method(D_METHOD("set_collision_mask_bit", "bit", "value"), &TileMap::set_collision_mask_bit);
+ ClassDB::bind_method(D_METHOD("get_collision_mask_bit", "bit"), &TileMap::get_collision_mask_bit);
+
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);
@@ -1222,6 +1276,7 @@ void TileMap::_bind_methods() {
ClassDB::bind_method(D_METHOD("clear"), &TileMap::clear);
ClassDB::bind_method(D_METHOD("get_used_cells"), &TileMap::get_used_cells);
+ ClassDB::bind_method(D_METHOD("get_used_cells_by_id", "id"), &TileMap::get_used_cells_by_id);
ClassDB::bind_method(D_METHOD("get_used_rect"), &TileMap::get_used_rect);
ClassDB::bind_method(D_METHOD("map_to_world", "mappos", "ignore_half_ofs"), &TileMap::map_to_world, DEFVAL(false));
@@ -1249,7 +1304,7 @@ void TileMap::_bind_methods() {
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_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("Occluder", "occluder_");
diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h
index f52adcd510..082e9d1018 100644
--- a/scene/2d/tile_map.h
+++ b/scene/2d/tile_map.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -232,6 +233,12 @@ public:
void set_collision_mask(uint32_t p_mask);
uint32_t get_collision_mask() const;
+ void set_collision_layer_bit(int p_bit, bool p_value);
+ bool get_collision_layer_bit(int p_bit) const;
+
+ void set_collision_mask_bit(int p_bit, bool p_value);
+ bool get_collision_mask_bit(int p_bit) const;
+
void set_collision_use_kinematic(bool p_use_kinematic);
bool get_collision_use_kinematic() const;
@@ -263,6 +270,7 @@ public:
bool is_y_sort_mode_enabled() const;
Array get_used_cells() const;
+ Array get_used_cells_by_id(int p_id) const;
Rect2 get_used_rect(); // Not const because of cache
void set_occluder_light_mask(int p_mask);
diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp
index f20a995d5f..fb71b61d45 100644
--- a/scene/2d/visibility_notifier_2d.cpp
+++ b/scene/2d/visibility_notifier_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,6 +33,7 @@
#include "scene/2d/animated_sprite.h"
#include "scene/2d/physics_body_2d.h"
#include "scene/animation/animation_player.h"
+#include "scene/main/viewport.h"
#include "scene/scene_string_names.h"
#include "scene/scene_string_names.h"
diff --git a/scene/2d/visibility_notifier_2d.h b/scene/2d/visibility_notifier_2d.h
index aa49497404..38da69faef 100644
--- a/scene/2d/visibility_notifier_2d.h
+++ b/scene/2d/visibility_notifier_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/y_sort.cpp b/scene/2d/y_sort.cpp
index 760139287c..f258b7e2e0 100644
--- a/scene/2d/y_sort.cpp
+++ b/scene/2d/y_sort.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/2d/y_sort.h b/scene/2d/y_sort.h
index c919788498..3564cfc151 100644
--- a/scene/2d/y_sort.h
+++ b/scene/2d/y_sort.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp
index c42ca2f3f0..c64b807e43 100644
--- a/scene/3d/area.cpp
+++ b/scene/3d/area.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,7 +29,9 @@
/*************************************************************************/
#include "area.h"
#include "scene/scene_string_names.h"
+#include "servers/audio_server.h"
#include "servers/physics_server.h"
+
void Area::set_space_override_mode(SpaceOverride p_mode) {
space_override = p_mode;
@@ -226,7 +229,11 @@ void Area::_clear_monitoring() {
Object *obj = ObjectDB::get_instance(E->key());
Node *node = obj ? obj->cast_to<Node>() : NULL;
- ERR_CONTINUE(!node);
+
+ if (!node) //node may have been deleted in previous frame or at other legiminate point
+ continue;
+ //ERR_CONTINUE(!node);
+
if (!E->get().in_tree)
continue;
@@ -252,7 +259,11 @@ void Area::_clear_monitoring() {
Object *obj = ObjectDB::get_instance(E->key());
Node *node = obj ? obj->cast_to<Node>() : NULL;
- ERR_CONTINUE(!node);
+
+ if (!node) //node may have been deleted in previous frame or at other legiminate point
+ continue;
+ //ERR_CONTINUE(!node);
+
if (!E->get().in_tree)
continue;
@@ -464,7 +475,7 @@ Array Area::get_overlapping_areas() const {
bool Area::overlaps_area(Node *p_area) const {
ERR_FAIL_NULL_V(p_area, false);
- const Map<ObjectID, AreaState>::Element *E = area_map.find(p_area->get_instance_ID());
+ const Map<ObjectID, AreaState>::Element *E = area_map.find(p_area->get_instance_id());
if (!E)
return false;
return E->get().in_tree;
@@ -473,7 +484,7 @@ bool Area::overlaps_area(Node *p_area) const {
bool Area::overlaps_body(Node *p_body) const {
ERR_FAIL_NULL_V(p_body, false);
- const Map<ObjectID, BodyState>::Element *E = body_map.find(p_body->get_instance_ID());
+ const Map<ObjectID, BodyState>::Element *E = body_map.find(p_body->get_instance_id());
if (!E)
return false;
return E->get().in_tree;
@@ -488,15 +499,15 @@ uint32_t Area::get_collision_mask() const {
return collision_mask;
}
-void Area::set_layer_mask(uint32_t p_mask) {
+void Area::set_collision_layer(uint32_t p_layer) {
- layer_mask = p_mask;
- PhysicsServer::get_singleton()->area_set_layer_mask(get_rid(), p_mask);
+ collision_layer = p_layer;
+ PhysicsServer::get_singleton()->area_set_collision_layer(get_rid(), p_layer);
}
-uint32_t Area::get_layer_mask() const {
+uint32_t Area::get_collision_layer() const {
- return layer_mask;
+ return collision_layer;
}
void Area::set_collision_mask_bit(int p_bit, bool p_value) {
@@ -514,19 +525,100 @@ bool Area::get_collision_mask_bit(int p_bit) const {
return get_collision_mask() & (1 << p_bit);
}
-void Area::set_layer_mask_bit(int p_bit, bool p_value) {
+void Area::set_collision_layer_bit(int p_bit, bool p_value) {
- uint32_t mask = get_layer_mask();
+ uint32_t layer = get_collision_layer();
if (p_value)
- mask |= 1 << p_bit;
+ layer |= 1 << p_bit;
else
- mask &= ~(1 << p_bit);
- set_layer_mask(mask);
+ layer &= ~(1 << p_bit);
+ set_collision_layer(layer);
+}
+
+bool Area::get_collision_layer_bit(int p_bit) const {
+
+ return get_collision_layer() & (1 << p_bit);
+}
+
+void Area::set_audio_bus_override(bool p_override) {
+
+ audio_bus_override = p_override;
+}
+
+bool Area::is_overriding_audio_bus() const {
+
+ return audio_bus_override;
+}
+
+void Area::set_audio_bus(const StringName &p_audio_bus) {
+
+ audio_bus = p_audio_bus;
+}
+StringName Area::get_audio_bus() const {
+
+ for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
+ if (AudioServer::get_singleton()->get_bus_name(i) == audio_bus) {
+ return audio_bus;
+ }
+ }
+ return "Master";
+}
+
+void Area::set_use_reverb_bus(bool p_enable) {
+
+ use_reverb_bus = p_enable;
+}
+bool Area::is_using_reverb_bus() const {
+
+ return use_reverb_bus;
}
-bool Area::get_layer_mask_bit(int p_bit) const {
+void Area::set_reverb_bus(const StringName &p_audio_bus) {
- return get_layer_mask() & (1 << p_bit);
+ reverb_bus = p_audio_bus;
+}
+StringName Area::get_reverb_bus() const {
+
+ for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
+ if (AudioServer::get_singleton()->get_bus_name(i) == reverb_bus) {
+ return reverb_bus;
+ }
+ }
+ return "Master";
+}
+
+void Area::set_reverb_amount(float p_amount) {
+
+ reverb_amount = p_amount;
+}
+float Area::get_reverb_amount() const {
+
+ return reverb_amount;
+}
+
+void Area::set_reverb_uniformity(float p_uniformity) {
+
+ reverb_uniformity = p_uniformity;
+}
+float Area::get_reverb_uniformity() const {
+
+ return reverb_uniformity;
+}
+
+void Area::_validate_property(PropertyInfo &property) const {
+
+ if (property.name == "audio_bus_name" || property.name == "reverb_bus_name") {
+
+ String options;
+ for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
+ if (i > 0)
+ options += ",";
+ String name = AudioServer::get_singleton()->get_bus_name(i);
+ options += name;
+ }
+
+ property.hint_string = options;
+ }
}
void Area::_bind_methods() {
@@ -564,14 +656,14 @@ void Area::_bind_methods() {
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(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(D_METHOD("set_collision_layer", "collision_layer"), &Area::set_collision_layer);
+ ClassDB::bind_method(D_METHOD("get_collision_layer"), &Area::get_collision_layer);
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(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(D_METHOD("set_collision_layer_bit", "bit", "value"), &Area::set_collision_layer_bit);
+ ClassDB::bind_method(D_METHOD("get_collision_layer_bit", "bit"), &Area::get_collision_layer_bit);
ClassDB::bind_method(D_METHOD("set_monitorable", "enable"), &Area::set_monitorable);
ClassDB::bind_method(D_METHOD("is_monitorable"), &Area::is_monitorable);
@@ -588,6 +680,24 @@ void Area::_bind_methods() {
ClassDB::bind_method(D_METHOD("_body_inout"), &Area::_body_inout);
ClassDB::bind_method(D_METHOD("_area_inout"), &Area::_area_inout);
+ ClassDB::bind_method(D_METHOD("set_audio_bus_override", "enable"), &Area::set_audio_bus_override);
+ ClassDB::bind_method(D_METHOD("is_overriding_audio_bus"), &Area::is_overriding_audio_bus);
+
+ ClassDB::bind_method(D_METHOD("set_audio_bus", "name"), &Area::set_audio_bus);
+ ClassDB::bind_method(D_METHOD("get_audio_bus"), &Area::get_audio_bus);
+
+ ClassDB::bind_method(D_METHOD("set_use_reverb_bus", "enable"), &Area::set_use_reverb_bus);
+ ClassDB::bind_method(D_METHOD("is_using_reverb_bus"), &Area::is_using_reverb_bus);
+
+ ClassDB::bind_method(D_METHOD("set_reverb_bus", "name"), &Area::set_reverb_bus);
+ ClassDB::bind_method(D_METHOD("get_reverb_bus"), &Area::get_reverb_bus);
+
+ ClassDB::bind_method(D_METHOD("set_reverb_amount", "amount"), &Area::set_reverb_amount);
+ ClassDB::bind_method(D_METHOD("get_reverb_amount"), &Area::get_reverb_amount);
+
+ ClassDB::bind_method(D_METHOD("set_reverb_uniformity", "amount"), &Area::set_reverb_uniformity);
+ ClassDB::bind_method(D_METHOD("get_reverb_uniformity"), &Area::get_reverb_uniformity);
+
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")));
ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "area_shape")));
ADD_SIGNAL(MethodInfo("body_entered", PropertyInfo(Variant::OBJECT, "body")));
@@ -609,8 +719,16 @@ void Area::_bind_methods() {
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), "set_layer_mask", "get_layer_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");
+ ADD_GROUP("Audio Bus", "audio_bus_");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "audio_bus_override"), "set_audio_bus_override", "is_overriding_audio_bus");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "audio_bus_name", PROPERTY_HINT_ENUM, ""), "set_audio_bus", "get_audio_bus");
+ ADD_GROUP("Reverb Bus", "reverb_bus_");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "reverb_bus_enable"), "set_use_reverb_bus", "is_using_reverb_bus");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "reverb_bus_name", PROPERTY_HINT_ENUM, ""), "set_reverb_bus", "get_reverb_bus");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "reverb_bus_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_amount", "get_reverb_amount");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "reverb_bus_uniformity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_uniformity", "get_reverb_uniformity");
}
Area::Area()
@@ -627,10 +745,18 @@ Area::Area()
priority = 0;
monitoring = false;
collision_mask = 1;
- layer_mask = 1;
+ collision_layer = 1;
set_ray_pickable(false);
set_monitoring(true);
set_monitorable(true);
+
+ audio_bus_override = false;
+ audio_bus = "Master";
+
+ use_reverb_bus = false;
+ reverb_bus = "Master";
+ reverb_amount = 0.0;
+ reverb_uniformity = 0.0;
}
Area::~Area() {
diff --git a/scene/3d/area.h b/scene/3d/area.h
index a50f101ec1..5df308fc47 100644
--- a/scene/3d/area.h
+++ b/scene/3d/area.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -54,7 +55,7 @@ private:
real_t angular_damp;
real_t linear_damp;
uint32_t collision_mask;
- uint32_t layer_mask;
+ uint32_t collision_layer;
int priority;
bool monitoring;
bool monitorable;
@@ -125,6 +126,16 @@ private:
Map<ObjectID, AreaState> area_map;
void _clear_monitoring();
+ bool audio_bus_override;
+ StringName audio_bus;
+
+ bool use_reverb_bus;
+ StringName reverb_bus;
+ float reverb_amount;
+ float reverb_uniformity;
+
+ void _validate_property(PropertyInfo &property) const;
+
protected:
void _notification(int p_what);
static void _bind_methods();
@@ -163,14 +174,14 @@ public:
void set_collision_mask(uint32_t p_mask);
uint32_t get_collision_mask() const;
- void set_layer_mask(uint32_t p_mask);
- uint32_t get_layer_mask() const;
+ void set_collision_layer(uint32_t p_layer);
+ uint32_t get_collision_layer() const;
void set_collision_mask_bit(int p_bit, bool p_value);
bool get_collision_mask_bit(int p_bit) const;
- void set_layer_mask_bit(int p_bit, bool p_value);
- bool get_layer_mask_bit(int p_bit) const;
+ void set_collision_layer_bit(int p_bit, bool p_value);
+ bool get_collision_layer_bit(int p_bit) const;
Array get_overlapping_bodies() const;
Array get_overlapping_areas() const; //function for script
@@ -178,6 +189,24 @@ public:
bool overlaps_area(Node *p_area) const;
bool overlaps_body(Node *p_body) const;
+ void set_audio_bus_override(bool p_override);
+ bool is_overriding_audio_bus() const;
+
+ void set_audio_bus(const StringName &p_audio_bus);
+ StringName get_audio_bus() const;
+
+ void set_use_reverb_bus(bool p_enable);
+ bool is_using_reverb_bus() const;
+
+ void set_reverb_bus(const StringName &p_audio_bus);
+ StringName get_reverb_bus() const;
+
+ void set_reverb_amount(float p_amount);
+ float get_reverb_amount() const;
+
+ void set_reverb_uniformity(float p_uniformity);
+ float get_reverb_uniformity() const;
+
Area();
~Area();
};
diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp
new file mode 100644
index 0000000000..3c99f7fb3a
--- /dev/null
+++ b/scene/3d/arvr_nodes.cpp
@@ -0,0 +1,426 @@
+/*************************************************************************/
+/* arvr_nodes.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "arvr_nodes.h"
+#include "core/os/input.h"
+#include "servers/arvr/arvr_interface.h"
+#include "servers/arvr/arvr_positional_tracker.h"
+#include "servers/arvr_server.h"
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void ARVRCamera::_notification(int p_what) {
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE: {
+ // need to find our ARVROrigin parent and let it know we're it's camera!
+ ARVROrigin *origin = get_parent()->cast_to<ARVROrigin>();
+ if (origin != NULL) {
+ origin->set_tracked_camera(this);
+ }
+ }; break;
+ case NOTIFICATION_EXIT_TREE: {
+ // need to find our ARVROrigin parent and let it know we're no longer it's camera!
+ ARVROrigin *origin = get_parent()->cast_to<ARVROrigin>();
+ if (origin != NULL) {
+ origin->clear_tracked_camera_if(this);
+ }
+ }; break;
+ };
+};
+
+String ARVRCamera::get_configuration_warning() const {
+ if (!is_visible() || !is_inside_tree())
+ return String();
+
+ // must be child node of ARVROrigin!
+ ARVROrigin *origin = get_parent()->cast_to<ARVROrigin>();
+ if (origin == NULL) {
+ return TTR("ARVRCamera must have an ARVROrigin node as its parent");
+ };
+
+ return String();
+};
+
+ARVRCamera::ARVRCamera(){
+ // nothing to do here yet for now..
+};
+
+ARVRCamera::~ARVRCamera(){
+ // nothing to do here yet for now..
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void ARVRController::_notification(int p_what) {
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE: {
+ set_process_internal(true);
+ }; break;
+ case NOTIFICATION_EXIT_TREE: {
+ set_process_internal(false);
+ }; break;
+ case NOTIFICATION_INTERNAL_PROCESS: {
+ // get our ARVRServer
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL(arvr_server);
+
+ // find the tracker for our controller
+ ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id);
+ if (tracker == NULL) {
+ // this controller is currently turned off
+ is_active = false;
+ button_states = 0;
+ } else {
+ is_active = true;
+ set_transform(tracker->get_transform(true));
+
+ int joy_id = tracker->get_joy_id();
+ if (joy_id >= 0) {
+ int mask = 1;
+ // check button states
+ for (int i = 0; i < 16; i++) {
+ bool was_pressed = (button_states && mask) == mask;
+ bool is_pressed = Input::get_singleton()->is_joy_button_pressed(joy_id, i);
+
+ if (!was_pressed && is_pressed) {
+ emit_signal("button_pressed", i);
+ button_states += mask;
+ } else if (was_pressed && !is_pressed) {
+ emit_signal("button_release", i);
+ button_states -= mask;
+ };
+
+ mask = mask << 1;
+ };
+
+ } else {
+ button_states = 0;
+ };
+ };
+ }; break;
+ default:
+ break;
+ };
+};
+
+void ARVRController::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_controller_id", "controller_id"), &ARVRController::set_controller_id);
+ ClassDB::bind_method(D_METHOD("get_controller_id"), &ARVRController::get_controller_id);
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "controller_id"), "set_controller_id", "get_controller_id");
+ ClassDB::bind_method(D_METHOD("get_controller_name"), &ARVRController::get_controller_name);
+
+ // passthroughs to information about our related joystick
+ ClassDB::bind_method(D_METHOD("get_joystick_id"), &ARVRController::get_joystick_id);
+ ClassDB::bind_method(D_METHOD("is_button_pressed", "button"), &ARVRController::is_button_pressed);
+ ClassDB::bind_method(D_METHOD("get_joystick_axis", "axis"), &ARVRController::get_joystick_axis);
+
+ ClassDB::bind_method(D_METHOD("get_is_active"), &ARVRController::get_is_active);
+
+ ADD_SIGNAL(MethodInfo("button_pressed", PropertyInfo(Variant::INT, "button")));
+ ADD_SIGNAL(MethodInfo("button_release", PropertyInfo(Variant::INT, "button")));
+};
+
+void ARVRController::set_controller_id(int p_controller_id) {
+ // we don't check any bounds here, this controller may not yet be active and just be a place holder until it is.
+ controller_id = p_controller_id;
+};
+
+int ARVRController::get_controller_id(void) const {
+ return controller_id;
+};
+
+String ARVRController::get_controller_name(void) const {
+ // get our ARVRServer
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL_V(arvr_server, String());
+
+ ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id);
+ if (tracker == NULL) {
+ return String("Not connected");
+ };
+
+ return tracker->get_name();
+};
+
+int ARVRController::get_joystick_id() const {
+ // get our ARVRServer
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL_V(arvr_server, 0);
+
+ ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id);
+ if (tracker == NULL) {
+ return 0;
+ };
+
+ return tracker->get_joy_id();
+};
+
+int ARVRController::is_button_pressed(int p_button) const {
+ int joy_id = get_joystick_id();
+ if (joy_id == 0) {
+ return false;
+ };
+
+ return Input::get_singleton()->is_joy_button_pressed(joy_id, p_button);
+};
+
+float ARVRController::get_joystick_axis(int p_axis) const {
+ int joy_id = get_joystick_id();
+ if (joy_id == 0) {
+ return 0.0;
+ };
+
+ return Input::get_singleton()->get_joy_axis(joy_id, p_axis);
+};
+
+bool ARVRController::get_is_active() const {
+ return is_active;
+};
+
+String ARVRController::get_configuration_warning() const {
+ if (!is_visible() || !is_inside_tree())
+ return String();
+
+ // must be child node of ARVROrigin!
+ ARVROrigin *origin = get_parent()->cast_to<ARVROrigin>();
+ if (origin == NULL) {
+ return TTR("ARVRController must have an ARVROrigin node as its parent");
+ };
+
+ if (controller_id == 0) {
+ return TTR("The controller id must not be 0 or this controller will not be bound to an actual controller");
+ };
+
+ return String();
+};
+
+ARVRController::ARVRController() {
+ controller_id = 0;
+ is_active = true;
+};
+
+ARVRController::~ARVRController(){
+ // nothing to do here yet for now..
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void ARVRAnchor::_notification(int p_what) {
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE: {
+ set_process_internal(true);
+ }; break;
+ case NOTIFICATION_EXIT_TREE: {
+ set_process_internal(false);
+ }; break;
+ case NOTIFICATION_INTERNAL_PROCESS: {
+ // get our ARVRServer
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL(arvr_server);
+
+ // find the tracker for our anchor
+ ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_ANCHOR, anchor_id);
+ if (tracker == NULL) {
+ // this anchor is currently not available
+ is_active = false;
+ } else {
+ is_active = true;
+ Transform transform;
+
+ // we'll need our world_scale
+ real_t world_scale = arvr_server->get_world_scale();
+
+ // get our info from our tracker
+ transform.basis = tracker->get_orientation();
+ transform.origin = tracker->get_position(); // <-- already adjusted to world scale
+
+ // our basis is scaled to the size of the plane the anchor is tracking
+ // extract the size from our basis and reset the scale
+ size = transform.basis.get_scale() * world_scale;
+ transform.basis.set_scale(Vector3(1.0, 1.0, 1.0));
+
+ // apply our reference frame and set our transform
+ set_transform(arvr_server->get_reference_frame() * transform);
+ };
+ }; break;
+ default:
+ break;
+ };
+};
+
+void ARVRAnchor::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_anchor_id", "anchor_id"), &ARVRAnchor::set_anchor_id);
+ ClassDB::bind_method(D_METHOD("get_anchor_id"), &ARVRAnchor::get_anchor_id);
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "anchor_id"), "set_anchor_id", "get_anchor_id");
+ ClassDB::bind_method(D_METHOD("get_anchor_name"), &ARVRAnchor::get_anchor_name);
+
+ ClassDB::bind_method(D_METHOD("get_is_active"), &ARVRAnchor::get_is_active);
+ ClassDB::bind_method(D_METHOD("get_size"), &ARVRAnchor::get_size);
+};
+
+void ARVRAnchor::set_anchor_id(int p_anchor_id) {
+ // we don't check any bounds here, this anchor may not yet be active and just be a place holder until it is.
+ anchor_id = p_anchor_id;
+};
+
+int ARVRAnchor::get_anchor_id(void) const {
+ return anchor_id;
+};
+
+Vector3 ARVRAnchor::get_size() const {
+ return size;
+};
+
+String ARVRAnchor::get_anchor_name(void) const {
+ // get our ARVRServer
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL_V(arvr_server, String());
+
+ ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_ANCHOR, anchor_id);
+ if (tracker == NULL) {
+ return String("Not connected");
+ };
+
+ return tracker->get_name();
+};
+
+bool ARVRAnchor::get_is_active() const {
+ return is_active;
+};
+
+String ARVRAnchor::get_configuration_warning() const {
+ if (!is_visible() || !is_inside_tree())
+ return String();
+
+ // must be child node of ARVROrigin!
+ ARVROrigin *origin = get_parent()->cast_to<ARVROrigin>();
+ if (origin == NULL) {
+ return TTR("ARVRAnchor must have an ARVROrigin node as its parent");
+ };
+
+ if (anchor_id == 0) {
+ return TTR("The anchor id must not be 0 or this anchor will not be bound to an actual anchor");
+ };
+
+ return String();
+};
+
+ARVRAnchor::ARVRAnchor() {
+ anchor_id = 0;
+ is_active = true;
+};
+
+ARVRAnchor::~ARVRAnchor(){
+ // nothing to do here yet for now..
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+String ARVROrigin::get_configuration_warning() const {
+ if (!is_visible() || !is_inside_tree())
+ return String();
+
+ if (tracked_camera == NULL)
+ return TTR("ARVROrigin requires an ARVRCamera child node");
+
+ return String();
+};
+
+void ARVROrigin::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_world_scale", "world_scale"), &ARVROrigin::set_world_scale);
+ ClassDB::bind_method(D_METHOD("get_world_scale"), &ARVROrigin::get_world_scale);
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "world_scale"), "set_world_scale", "get_world_scale");
+};
+
+void ARVROrigin::set_tracked_camera(ARVRCamera *p_tracked_camera) {
+ tracked_camera = p_tracked_camera;
+};
+
+void ARVROrigin::clear_tracked_camera_if(ARVRCamera *p_tracked_camera) {
+ if (tracked_camera == p_tracked_camera) {
+ tracked_camera = NULL;
+ };
+};
+
+float ARVROrigin::get_world_scale() const {
+ // get our ARVRServer
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL_V(arvr_server, 1.0);
+
+ return arvr_server->get_world_scale();
+};
+
+void ARVROrigin::set_world_scale(float p_world_scale) {
+ // get our ARVRServer
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL(arvr_server);
+
+ arvr_server->set_world_scale(p_world_scale);
+};
+
+void ARVROrigin::_notification(int p_what) {
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE: {
+ set_process_internal(true);
+ }; break;
+ case NOTIFICATION_EXIT_TREE: {
+ set_process_internal(false);
+ }; break;
+ case NOTIFICATION_INTERNAL_PROCESS: {
+ // get our ARVRServer
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL(arvr_server);
+
+ // set our world origin to our node transform
+ arvr_server->set_world_origin(get_global_transform());
+
+ // check if we have a primary interface
+ Ref<ARVRInterface> arvr_interface = arvr_server->get_primary_interface();
+ if (arvr_interface.is_valid() && tracked_camera != NULL) {
+ // get our positioning transform for our headset
+ Transform t = arvr_interface->get_transform_for_eye(ARVRInterface::EYE_MONO, Transform());
+
+ // now apply this to our camera
+ tracked_camera->set_transform(t);
+ };
+ }; break;
+ default:
+ break;
+ };
+};
+
+ARVROrigin::ARVROrigin() {
+ tracked_camera = NULL;
+};
+
+ARVROrigin::~ARVROrigin(){
+ // nothing to do here yet for now..
+};
diff --git a/scene/3d/arvr_nodes.h b/scene/3d/arvr_nodes.h
new file mode 100644
index 0000000000..936519126b
--- /dev/null
+++ b/scene/3d/arvr_nodes.h
@@ -0,0 +1,157 @@
+/*************************************************************************/
+/* arvr_nodes.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 ARVR_NODES_H
+#define ARVR_NODES_H
+
+#include "scene/3d/camera.h"
+#include "scene/3d/spatial.h"
+
+/**
+ @author Bastiaan Olij <mux213@gmail.com>
+**/
+
+/*
+ ARVRCamera is a subclass of camera which will register itself with its parent ARVROrigin and as a result is automatically positioned
+*/
+class ARVRCamera : public Camera {
+
+ GDCLASS(ARVRCamera, Camera);
+
+protected:
+ void _notification(int p_what);
+
+public:
+ String get_configuration_warning() const;
+
+ ARVRCamera();
+ ~ARVRCamera();
+};
+
+/*
+ ARVRController is a helper node that automatically updates it's position based on tracker data.
+
+ It must be a child node of our ARVROrigin node
+*/
+
+class ARVRController : public Spatial {
+
+ GDCLASS(ARVRController, Spatial);
+
+private:
+ int controller_id;
+ bool is_active;
+ int button_states;
+
+protected:
+ void _notification(int p_what);
+ static void _bind_methods();
+
+public:
+ void set_controller_id(int p_controller_id);
+ int get_controller_id(void) const;
+ String get_controller_name(void) const;
+
+ int get_joystick_id() const;
+ int is_button_pressed(int p_button) const;
+ float get_joystick_axis(int p_axis) const;
+
+ bool get_is_active() const;
+
+ String get_configuration_warning() const;
+
+ ARVRController();
+ ~ARVRController();
+};
+
+/*
+ ARVRAnchor is a helper node that automatically updates it's position based on anchor data, it represents a real world location.
+ It must be a child node of our ARVROrigin node
+*/
+
+class ARVRAnchor : public Spatial {
+ GDCLASS(ARVRAnchor, Spatial);
+
+private:
+ int anchor_id;
+ bool is_active;
+ Vector3 size;
+
+protected:
+ void _notification(int p_what);
+ static void _bind_methods();
+
+public:
+ void set_anchor_id(int p_anchor_id);
+ int get_anchor_id(void) const;
+ String get_anchor_name(void) const;
+
+ bool get_is_active() const;
+ Vector3 get_size() const;
+
+ String get_configuration_warning() const;
+
+ ARVRAnchor();
+ ~ARVRAnchor();
+};
+
+/*
+ ARVROrigin is special spatial node that acts as our origin point mapping our real world center of our tracking volume into our virtual world.
+
+ It is this point that you will move around the world as the player 'moves while standing still', i.e. the player moves through teleporting or controller inputs as opposed to physically moving.
+
+ Our camera and controllers will always be child nodes and thus place relative to this origin point.
+ This node will automatically locate any camera child nodes and update its position while our ARVRController node will handle tracked controllers.
+*/
+class ARVROrigin : public Spatial {
+
+ GDCLASS(ARVROrigin, Spatial);
+
+private:
+ ARVRCamera *tracked_camera;
+
+protected:
+ void _notification(int p_what);
+ static void _bind_methods();
+
+public:
+ String get_configuration_warning() const;
+
+ void set_tracked_camera(ARVRCamera *p_tracked_camera);
+ void clear_tracked_camera_if(ARVRCamera *p_tracked_camera);
+
+ float get_world_scale() const;
+ void set_world_scale(float p_world_scale);
+
+ ARVROrigin();
+ ~ARVROrigin();
+};
+
+#endif /* ARVR_NODES_H */
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
new file mode 100644
index 0000000000..6abc2caac8
--- /dev/null
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -0,0 +1,930 @@
+#include "audio_stream_player_3d.h"
+#include "engine.h"
+#include "scene/3d/area.h"
+#include "scene/3d/camera.h"
+#include "scene/main/viewport.h"
+void AudioStreamPlayer3D::_mix_audio() {
+
+ if (!stream_playback.is_valid()) {
+ return;
+ }
+
+ if (!active) {
+ return;
+ }
+
+ bool started = false;
+ if (setseek >= 0.0) {
+ stream_playback->start(setseek);
+ setseek = -1.0; //reset seek
+ started = true;
+ }
+
+ //get data
+ AudioFrame *buffer = mix_buffer.ptr();
+ int buffer_size = mix_buffer.size();
+
+ //mix
+ if (output_count > 0 || out_of_range_mode == OUT_OF_RANGE_MIX) {
+
+ float pitch_scale = 0.0;
+ if (output_count) {
+ //used for doppler, not realistic but good enough
+ for (int i = 0; i < output_count; i++) {
+ pitch_scale += outputs[i].pitch_scale;
+ }
+ pitch_scale /= float(output_count);
+ } else {
+ pitch_scale = 1.0;
+ }
+
+ stream_playback->mix(buffer, pitch_scale, buffer_size);
+ }
+
+ //write all outputs
+ for (int i = 0; i < output_count; i++) {
+
+ Output current = outputs[i];
+
+ //see if current output exists, to keep volume ramp
+ bool found = false;
+ for (int j = i; j < prev_output_count; j++) {
+ if (prev_outputs[j].viewport == current.viewport) {
+ if (j != i) {
+ SWAP(prev_outputs[j], prev_outputs[i]);
+ }
+ found = true;
+ break;
+ }
+ }
+
+ bool interpolate_filter = !started;
+ ;
+ if (!found) {
+ //create new if was not used before
+ if (prev_output_count < MAX_OUTPUTS) {
+ prev_outputs[prev_output_count] = prev_outputs[i]; //may be owned by another viewport
+ prev_output_count++;
+ }
+ prev_outputs[i] = current;
+ interpolate_filter = false;
+ }
+
+ //mix!
+
+ int buffers = 0;
+ int first = 0;
+
+ switch (AudioServer::get_singleton()->get_speaker_mode()) {
+
+ case AudioServer::SPEAKER_MODE_STEREO: {
+ buffers = 1;
+ first = 0;
+
+ } break;
+ case AudioServer::SPEAKER_SURROUND_51: {
+ buffers = 2;
+ first = 1;
+
+ } break;
+ case AudioServer::SPEAKER_SURROUND_71: {
+
+ buffers = 3;
+ first = 1;
+
+ } break;
+ }
+
+ for (int k = 0; k < buffers; k++) {
+ AudioFrame vol_inc = (current.vol[k] - prev_outputs[i].vol[k]) / float(buffer_size);
+ AudioFrame vol = current.vol[k];
+
+ AudioFrame *target = AudioServer::get_singleton()->thread_get_channel_mix_buffer(current.bus_index, first + k);
+
+ current.filter.set_mode(AudioFilterSW::HIGHSHELF);
+ current.filter.set_sampling_rate(AudioServer::get_singleton()->get_mix_rate());
+ current.filter.set_cutoff(attenuation_filter_cutoff_hz);
+ current.filter.set_resonance(1);
+ current.filter.set_stages(1);
+ current.filter.set_gain(current.filter_gain);
+
+ if (interpolate_filter) {
+
+ current.filter_process[k * 2 + 0] = prev_outputs[i].filter_process[k * 2 + 0];
+ current.filter_process[k * 2 + 1] = prev_outputs[i].filter_process[k * 2 + 1];
+
+ current.filter_process[k * 2 + 0].set_filter(&current.filter, false);
+ current.filter_process[k * 2 + 1].set_filter(&current.filter, false);
+
+ current.filter_process[k * 2 + 0].update_coeffs(buffer_size);
+ current.filter_process[k * 2 + 1].update_coeffs(buffer_size);
+ for (int j = 0; j < buffer_size; j++) {
+
+ AudioFrame f = buffer[j] * vol;
+ current.filter_process[k * 2 + 0].process_one_interp(f.l);
+ current.filter_process[k * 2 + 1].process_one_interp(f.r);
+
+ target[j] += f;
+ vol += vol_inc;
+ }
+ } else {
+ current.filter_process[k * 2 + 0].set_filter(&current.filter);
+ current.filter_process[k * 2 + 1].set_filter(&current.filter);
+
+ current.filter_process[k * 2 + 0].update_coeffs();
+ current.filter_process[k * 2 + 1].update_coeffs();
+ for (int j = 0; j < buffer_size; j++) {
+
+ AudioFrame f = buffer[j] * vol;
+ current.filter_process[k * 2 + 0].process_one(f.l);
+ current.filter_process[k * 2 + 1].process_one(f.r);
+
+ target[j] += f;
+ vol += vol_inc;
+ }
+ }
+
+ if (current.reverb_bus_index >= 0) {
+
+ AudioFrame *rtarget = AudioServer::get_singleton()->thread_get_channel_mix_buffer(current.reverb_bus_index, first + k);
+
+ if (current.reverb_bus_index == prev_outputs[i].reverb_bus_index) {
+ AudioFrame rvol_inc = (current.reverb_vol[k] - prev_outputs[i].reverb_vol[k]) / float(buffer_size);
+ AudioFrame rvol = prev_outputs[i].reverb_vol[k];
+
+ for (int j = 0; j < buffer_size; j++) {
+
+ rtarget[j] += buffer[j] * rvol;
+ rvol += rvol_inc;
+ }
+ } else {
+
+ AudioFrame rvol = current.reverb_vol[k];
+ for (int j = 0; j < buffer_size; j++) {
+
+ rtarget[j] += buffer[j] * rvol;
+ }
+ }
+ }
+ }
+
+ prev_outputs[i] = current;
+ }
+
+ prev_output_count = output_count;
+
+ //stream is no longer active, disable this.
+ if (!stream_playback->is_playing()) {
+ active = false;
+ }
+
+ output_ready = false;
+}
+
+float AudioStreamPlayer3D::_get_attenuation_db(float p_distance) const {
+
+ float att;
+ switch (attenuation_model) {
+ case ATTENUATION_INVERSE_DISTANCE: {
+ att = Math::linear2db(1.0 / ((p_distance / unit_size) + 000001));
+ } break;
+ case ATTENUATION_INVERSE_SQUARE_DISTANCE: {
+ float d = (p_distance / unit_size);
+ d *= d;
+ att = Math::linear2db(1.0 / (d + 0.00001));
+ } break;
+ case ATTENUATION_LOGARITHMIC: {
+ att = -20 * Math::log(p_distance / unit_size + 000001);
+ } break;
+ }
+
+ att += unit_db;
+ if (att > max_db) {
+ att = max_db;
+ }
+
+ return att;
+}
+
+void _update_sound() {
+}
+
+void AudioStreamPlayer3D::_notification(int p_what) {
+
+ if (p_what == NOTIFICATION_ENTER_TREE) {
+
+ velocity_tracker->reset(get_global_transform().origin);
+ AudioServer::get_singleton()->add_callback(_mix_audios, this);
+ if (autoplay && !get_tree()->is_editor_hint()) {
+ play();
+ }
+ }
+
+ if (p_what == NOTIFICATION_EXIT_TREE) {
+
+ AudioServer::get_singleton()->remove_callback(_mix_audios, this);
+ }
+ if (p_what == NOTIFICATION_TRANSFORM_CHANGED) {
+
+ if (doppler_tracking != DOPPLER_TRACKING_DISABLED) {
+ velocity_tracker->update_position(get_global_transform().origin);
+ }
+ }
+
+ if (p_what == NOTIFICATION_INTERNAL_FIXED_PROCESS) {
+
+ //update anything related to position first, if possible of course
+
+ if (!output_ready) {
+
+ Vector3 linear_velocity;
+
+ //compute linear velocity for doppler
+ if (doppler_tracking != DOPPLER_TRACKING_DISABLED) {
+ linear_velocity = velocity_tracker->get_tracked_linear_velocity();
+ }
+
+ Ref<World> world = get_world();
+ ERR_FAIL_COND(world.is_null());
+
+ int new_output_count = 0;
+
+ Vector3 global_pos = get_global_transform().origin;
+
+ int bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus);
+
+ //check if any area is diverting sound into a bus
+
+ PhysicsDirectSpaceState *space_state = PhysicsServer::get_singleton()->space_get_direct_state(world->get_space());
+
+ PhysicsDirectSpaceState::ShapeResult sr[MAX_INTERSECT_AREAS];
+
+ int areas = space_state->intersect_point(global_pos, sr, MAX_INTERSECT_AREAS, Set<RID>(), area_mask, PhysicsDirectSpaceState::TYPE_MASK_AREA);
+ Area *area = NULL;
+
+ for (int i = 0; i < areas; i++) {
+ if (!sr[i].collider)
+ continue;
+
+ Area *tarea = sr[i].collider->cast_to<Area>();
+ if (!tarea)
+ continue;
+
+ if (!tarea->is_overriding_audio_bus() && !tarea->is_using_reverb_bus())
+ continue;
+
+ area = tarea;
+ break;
+ }
+
+ List<Camera *> cameras;
+ world->get_camera_list(&cameras);
+
+ for (List<Camera *>::Element *E = cameras.front(); E; E = E->next()) {
+
+ Camera *camera = E->get();
+ Viewport *vp = camera->get_viewport();
+ if (!vp->is_audio_listener())
+ continue;
+
+ Vector3 local_pos = camera->get_global_transform().orthonormalized().affine_inverse().xform(global_pos);
+
+ float dist = local_pos.length();
+
+ Vector3 area_sound_pos;
+ Vector3 cam_area_pos;
+
+ if (area && area->is_using_reverb_bus() && area->get_reverb_uniformity() > 0) {
+ area_sound_pos = space_state->get_closest_point_to_object_volume(area->get_rid(), camera->get_global_transform().origin);
+ cam_area_pos = camera->get_global_transform().affine_inverse().xform(area_sound_pos);
+ }
+
+ if (max_distance > 0) {
+
+ float total_max = max_distance;
+
+ if (area && area->is_using_reverb_bus() && area->get_reverb_uniformity() > 0) {
+ total_max = MAX(total_max, cam_area_pos.length());
+ }
+ if (total_max > max_distance) {
+ continue; //cant hear this sound in this camera
+ }
+ }
+
+ float multiplier = Math::db2linear(_get_attenuation_db(dist));
+ if (max_distance > 0) {
+ multiplier *= MAX(0, 1.0 - (dist / max_distance));
+ }
+
+ Output output;
+ output.bus_index = bus_index;
+ output.reverb_bus_index = -1; //no reverb by default
+ output.viewport = vp;
+
+ float db_att = (1.0 - MIN(1.0, multiplier)) * attenuation_filter_db;
+
+ if (emission_angle_enabled) {
+ Vector3 camtopos = global_pos - camera->get_global_transform().origin;
+ float c = camtopos.normalized().dot(get_global_transform().basis.get_axis(2).normalized()); //it's z negative
+ float angle = Math::rad2deg(Math::acos(c));
+ if (angle > emission_angle)
+ db_att -= -emission_angle_filter_attenuation_db;
+ }
+
+ output.filter_gain = Math::db2linear(db_att);
+
+ Vector3 flat_pos = local_pos;
+ flat_pos.y = 0;
+ flat_pos.normalize();
+
+ switch (AudioServer::get_singleton()->get_speaker_mode()) {
+
+ case AudioServer::SPEAKER_MODE_STEREO: {
+
+ float c = flat_pos.x * 0.5 + 0.5;
+ output.vol[0].l = 1.0 - c;
+ output.vol[0].r = c;
+
+ output.vol[0] *= multiplier;
+
+ } break;
+ case AudioServer::SPEAKER_SURROUND_51: {
+
+ float xl = Vector3(-1, 0, -1).normalized().dot(flat_pos) * 0.5 + 0.5;
+ float xr = Vector3(1, 0, -1).normalized().dot(flat_pos) * 0.5 + 0.5;
+
+ output.vol[0].l = xl;
+ output.vol[1].r = 1.0 - xl;
+ output.vol[0].r = xr;
+ output.vol[1].l = 1.0 - xr;
+
+ output.vol[0] *= multiplier;
+ output.vol[1] *= multiplier;
+ } break;
+ case AudioServer::SPEAKER_SURROUND_71: {
+
+ float xl = Vector3(-1, 0, -1).normalized().dot(flat_pos) * 0.5 + 0.5;
+ float xr = Vector3(1, 0, -1).normalized().dot(flat_pos) * 0.5 + 0.5;
+
+ output.vol[0].l = xl;
+ output.vol[1].r = 1.0 - xl;
+ output.vol[0].r = xr;
+ output.vol[1].l = 1.0 - xr;
+
+ float c = flat_pos.x * 0.5 + 0.5;
+ output.vol[2].l = 1.0 - c;
+ output.vol[2].r = c;
+
+ output.vol[0] *= multiplier;
+ output.vol[1] *= multiplier;
+ output.vol[2] *= multiplier;
+
+ } break;
+ }
+
+ bool filled_reverb = false;
+ int vol_index_max = AudioServer::get_singleton()->get_speaker_mode() + 1;
+
+ if (area) {
+
+ if (area->is_overriding_audio_bus()) {
+ //override audio bus
+ StringName bus_name = area->get_audio_bus();
+ output.bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus_name);
+ }
+
+ if (area->is_using_reverb_bus()) {
+
+ filled_reverb = true;
+ StringName bus_name = area->get_reverb_bus();
+ output.reverb_bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus_name);
+
+ float uniformity = area->get_reverb_uniformity();
+ float area_send = area->get_reverb_amount();
+
+ if (uniformity > 0.0) {
+
+ float distance = cam_area_pos.length();
+ float attenuation = Math::db2linear(_get_attenuation_db(distance));
+
+ //float dist_att_db = -20 * Math::log(dist + 0.00001); //logarithmic attenuation, like in real life
+
+ float center_val[3] = { 0.5, 0.25, 0.16666 };
+ AudioFrame center_frame(center_val[vol_index_max - 1], center_val[vol_index_max - 1]);
+
+ if (attenuation < 1.0) {
+ //pan the uniform sound
+ Vector3 rev_pos = cam_area_pos;
+ rev_pos.y = 0;
+ rev_pos.normalize();
+
+ switch (AudioServer::get_singleton()->get_speaker_mode()) {
+
+ case AudioServer::SPEAKER_MODE_STEREO: {
+
+ float c = rev_pos.x * 0.5 + 0.5;
+ output.reverb_vol[0].l = 1.0 - c;
+ output.reverb_vol[0].r = c;
+
+ } break;
+ case AudioServer::SPEAKER_SURROUND_51: {
+
+ float xl = Vector3(-1, 0, -1).normalized().dot(rev_pos) * 0.5 + 0.5;
+ float xr = Vector3(1, 0, -1).normalized().dot(rev_pos) * 0.5 + 0.5;
+
+ output.reverb_vol[0].l = xl;
+ output.reverb_vol[1].r = 1.0 - xl;
+ output.reverb_vol[0].r = xr;
+ output.reverb_vol[1].l = 1.0 - xr;
+
+ } break;
+ case AudioServer::SPEAKER_SURROUND_71: {
+
+ float xl = Vector3(-1, 0, -1).normalized().dot(rev_pos) * 0.5 + 0.5;
+ float xr = Vector3(1, 0, -1).normalized().dot(rev_pos) * 0.5 + 0.5;
+
+ output.reverb_vol[0].l = xl;
+ output.reverb_vol[1].r = 1.0 - xl;
+ output.reverb_vol[0].r = xr;
+ output.reverb_vol[1].l = 1.0 - xr;
+
+ float c = rev_pos.x * 0.5 + 0.5;
+ output.reverb_vol[2].l = 1.0 - c;
+ output.reverb_vol[2].r = c;
+
+ } break;
+ }
+
+ for (int i = 0; i < vol_index_max; i++) {
+
+ output.reverb_vol[i] = output.reverb_vol[i].linear_interpolate(center_frame, attenuation);
+ }
+ } else {
+ for (int i = 0; i < vol_index_max; i++) {
+
+ output.reverb_vol[i] = center_frame;
+ }
+ }
+
+ for (int i = 0; i < vol_index_max; i++) {
+
+ output.reverb_vol[i] = output.vol[i].linear_interpolate(output.reverb_vol[i] * attenuation, uniformity);
+ output.reverb_vol[i] *= area_send;
+ }
+
+ } else {
+
+ for (int i = 0; i < vol_index_max; i++) {
+
+ output.reverb_vol[i] = output.vol[i] * area_send;
+ }
+ }
+ }
+ }
+
+ if (doppler_tracking != DOPPLER_TRACKING_DISABLED) {
+
+ Vector3 camera_velocity = camera->get_doppler_tracked_velocity();
+
+ Vector3 local_velocity = camera->get_global_transform().orthonormalized().basis.xform_inv(linear_velocity - camera_velocity);
+
+ if (local_velocity == Vector3()) {
+ output.pitch_scale = 1.0;
+ } else {
+ float approaching = local_pos.normalized().dot(local_velocity.normalized());
+ float velocity = local_velocity.length();
+ float speed_of_sound = 343.0;
+
+ output.pitch_scale = speed_of_sound / (speed_of_sound + velocity * approaching);
+ output.pitch_scale = CLAMP(output.pitch_scale, (1 / 8.0), 8.0); //avoid crazy stuff
+ }
+
+ } else {
+ output.pitch_scale = 1.0;
+ }
+
+ if (!filled_reverb) {
+
+ for (int i = 0; i < vol_index_max; i++) {
+
+ output.reverb_vol[i] = AudioFrame(0, 0);
+ }
+ }
+
+ outputs[new_output_count] = output;
+ new_output_count++;
+ if (new_output_count == MAX_OUTPUTS)
+ break;
+ }
+
+ output_count = new_output_count;
+ output_ready = true;
+ }
+
+ //start playing if requested
+ if (setplay >= 0.0) {
+ setseek = setplay;
+ active = true;
+ setplay = -1;
+ _change_notify("playing"); //update property in editor
+ }
+
+ //stop playing if no longer active
+ if (!active) {
+ set_fixed_process_internal(false);
+ _change_notify("playing"); //update property in editor
+ }
+ }
+}
+
+void AudioStreamPlayer3D::set_stream(Ref<AudioStream> p_stream) {
+
+ ERR_FAIL_COND(!p_stream.is_valid());
+ AudioServer::get_singleton()->lock();
+
+ mix_buffer.resize(AudioServer::get_singleton()->thread_get_mix_buffer_size());
+
+ if (stream_playback.is_valid()) {
+ stream_playback.unref();
+ stream.unref();
+ active = false;
+ setseek = -1;
+ }
+
+ stream = p_stream;
+ stream_playback = p_stream->instance_playback();
+
+ if (stream_playback.is_null()) {
+ stream.unref();
+ ERR_FAIL_COND(stream_playback.is_null());
+ }
+
+ AudioServer::get_singleton()->unlock();
+}
+
+Ref<AudioStream> AudioStreamPlayer3D::get_stream() const {
+
+ return stream;
+}
+
+void AudioStreamPlayer3D::set_unit_db(float p_volume) {
+
+ unit_db = p_volume;
+}
+float AudioStreamPlayer3D::get_unit_db() const {
+
+ return unit_db;
+}
+
+void AudioStreamPlayer3D::set_unit_size(float p_volume) {
+
+ unit_size = p_volume;
+}
+float AudioStreamPlayer3D::get_unit_size() const {
+
+ return unit_size;
+}
+
+void AudioStreamPlayer3D::set_max_db(float p_boost) {
+
+ max_db = p_boost;
+}
+float AudioStreamPlayer3D::get_max_db() const {
+
+ return max_db;
+}
+
+void AudioStreamPlayer3D::play(float p_from_pos) {
+
+ if (stream_playback.is_valid()) {
+ setplay = p_from_pos;
+ output_ready = false;
+ set_fixed_process_internal(true);
+ }
+}
+
+void AudioStreamPlayer3D::seek(float p_seconds) {
+
+ if (stream_playback.is_valid()) {
+ setseek = p_seconds;
+ }
+}
+
+void AudioStreamPlayer3D::stop() {
+
+ if (stream_playback.is_valid()) {
+ active = false;
+ set_fixed_process_internal(false);
+ setplay = -1;
+ }
+}
+
+bool AudioStreamPlayer3D::is_playing() const {
+
+ if (stream_playback.is_valid()) {
+ return active; // && stream_playback->is_playing();
+ }
+
+ return false;
+}
+
+float AudioStreamPlayer3D::get_pos() {
+
+ if (stream_playback.is_valid()) {
+ return stream_playback->get_pos();
+ }
+
+ return 0;
+}
+
+void AudioStreamPlayer3D::set_bus(const StringName &p_bus) {
+
+ //if audio is active, must lock this
+ AudioServer::get_singleton()->lock();
+ bus = p_bus;
+ AudioServer::get_singleton()->unlock();
+}
+StringName AudioStreamPlayer3D::get_bus() const {
+
+ for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
+ if (AudioServer::get_singleton()->get_bus_name(i) == bus) {
+ return bus;
+ }
+ }
+ return "Master";
+}
+
+void AudioStreamPlayer3D::set_autoplay(bool p_enable) {
+
+ autoplay = p_enable;
+}
+bool AudioStreamPlayer3D::is_autoplay_enabled() {
+
+ return autoplay;
+}
+
+void AudioStreamPlayer3D::_set_playing(bool p_enable) {
+
+ if (p_enable)
+ play();
+ else
+ stop();
+}
+bool AudioStreamPlayer3D::_is_active() const {
+
+ return active;
+}
+
+void AudioStreamPlayer3D::_validate_property(PropertyInfo &property) const {
+
+ if (property.name == "bus") {
+
+ String options;
+ for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
+ if (i > 0)
+ options += ",";
+ String name = AudioServer::get_singleton()->get_bus_name(i);
+ options += name;
+ }
+
+ property.hint_string = options;
+ }
+}
+
+void AudioStreamPlayer3D::_bus_layout_changed() {
+
+ _change_notify();
+}
+
+void AudioStreamPlayer3D::set_max_distance(float p_metres) {
+
+ ERR_FAIL_COND(p_metres < 0.0);
+ max_distance = p_metres;
+}
+
+float AudioStreamPlayer3D::get_max_distance() const {
+
+ return max_distance;
+}
+
+void AudioStreamPlayer3D::set_area_mask(uint32_t p_mask) {
+
+ area_mask = p_mask;
+}
+
+uint32_t AudioStreamPlayer3D::get_area_mask() const {
+
+ return area_mask;
+}
+
+void AudioStreamPlayer3D::set_emission_angle_enabled(bool p_enable) {
+ emission_angle_enabled = p_enable;
+ update_gizmo();
+}
+
+bool AudioStreamPlayer3D::is_emission_angle_enabled() const {
+ return emission_angle_enabled;
+}
+
+void AudioStreamPlayer3D::set_emission_angle(float p_angle) {
+ ERR_FAIL_COND(p_angle < 0 || p_angle > 90);
+ emission_angle = p_angle;
+ update_gizmo();
+}
+
+float AudioStreamPlayer3D::get_emission_angle() const {
+ return emission_angle;
+}
+
+void AudioStreamPlayer3D::set_emission_angle_filter_attenuation_db(float p_angle_attenuation_db) {
+
+ emission_angle_filter_attenuation_db = p_angle_attenuation_db;
+}
+
+float AudioStreamPlayer3D::get_emission_angle_filter_attenuation_db() const {
+
+ return emission_angle_filter_attenuation_db;
+}
+
+void AudioStreamPlayer3D::set_attenuation_filter_cutoff_hz(float p_hz) {
+
+ attenuation_filter_cutoff_hz = p_hz;
+}
+float AudioStreamPlayer3D::get_attenuation_filter_cutoff_hz() const {
+
+ return attenuation_filter_cutoff_hz;
+}
+
+void AudioStreamPlayer3D::set_attenuation_filter_db(float p_db) {
+
+ attenuation_filter_db = p_db;
+}
+float AudioStreamPlayer3D::get_attenuation_filter_db() const {
+
+ return attenuation_filter_db;
+}
+
+void AudioStreamPlayer3D::set_attenuation_model(AttenuationModel p_model) {
+ ERR_FAIL_INDEX(p_model, 3);
+ attenuation_model = p_model;
+}
+
+AudioStreamPlayer3D::AttenuationModel AudioStreamPlayer3D::get_attenuation_model() const {
+ return attenuation_model;
+}
+
+void AudioStreamPlayer3D::set_out_of_range_mode(OutOfRangeMode p_mode) {
+
+ ERR_FAIL_INDEX(p_mode, 2);
+ out_of_range_mode = p_mode;
+}
+
+AudioStreamPlayer3D::OutOfRangeMode AudioStreamPlayer3D::get_out_of_range_mode() const {
+
+ return out_of_range_mode;
+}
+
+void AudioStreamPlayer3D::set_doppler_tracking(DopplerTracking p_tracking) {
+
+ if (doppler_tracking == p_tracking)
+ return;
+
+ doppler_tracking = p_tracking;
+
+ if (doppler_tracking != DOPPLER_TRACKING_DISABLED) {
+ set_notify_transform(true);
+ velocity_tracker->set_track_fixed_step(doppler_tracking == DOPPLER_TRACKING_FIXED_STEP);
+ velocity_tracker->reset(get_global_transform().origin);
+ } else {
+ set_notify_transform(false);
+ }
+}
+
+AudioStreamPlayer3D::DopplerTracking AudioStreamPlayer3D::get_doppler_tracking() const {
+
+ return doppler_tracking;
+}
+
+void AudioStreamPlayer3D::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_stream", "stream"), &AudioStreamPlayer3D::set_stream);
+ ClassDB::bind_method(D_METHOD("get_stream"), &AudioStreamPlayer3D::get_stream);
+
+ ClassDB::bind_method(D_METHOD("set_unit_db", "unit_db"), &AudioStreamPlayer3D::set_unit_db);
+ ClassDB::bind_method(D_METHOD("get_unit_db"), &AudioStreamPlayer3D::get_unit_db);
+
+ ClassDB::bind_method(D_METHOD("set_unit_size", "unit_size"), &AudioStreamPlayer3D::set_unit_size);
+ ClassDB::bind_method(D_METHOD("get_unit_size"), &AudioStreamPlayer3D::get_unit_size);
+
+ ClassDB::bind_method(D_METHOD("set_max_db", "max_db"), &AudioStreamPlayer3D::set_max_db);
+ ClassDB::bind_method(D_METHOD("get_max_db"), &AudioStreamPlayer3D::get_max_db);
+
+ ClassDB::bind_method(D_METHOD("play", "from_pos"), &AudioStreamPlayer3D::play, DEFVAL(0.0));
+ ClassDB::bind_method(D_METHOD("seek", "to_pos"), &AudioStreamPlayer3D::seek);
+ ClassDB::bind_method(D_METHOD("stop"), &AudioStreamPlayer3D::stop);
+
+ ClassDB::bind_method(D_METHOD("is_playing"), &AudioStreamPlayer3D::is_playing);
+ ClassDB::bind_method(D_METHOD("get_pos"), &AudioStreamPlayer3D::get_pos);
+
+ ClassDB::bind_method(D_METHOD("set_bus", "bus"), &AudioStreamPlayer3D::set_bus);
+ ClassDB::bind_method(D_METHOD("get_bus"), &AudioStreamPlayer3D::get_bus);
+
+ ClassDB::bind_method(D_METHOD("set_autoplay", "enable"), &AudioStreamPlayer3D::set_autoplay);
+ ClassDB::bind_method(D_METHOD("is_autoplay_enabled"), &AudioStreamPlayer3D::is_autoplay_enabled);
+
+ ClassDB::bind_method(D_METHOD("_set_playing", "enable"), &AudioStreamPlayer3D::_set_playing);
+ ClassDB::bind_method(D_METHOD("_is_active"), &AudioStreamPlayer3D::_is_active);
+
+ ClassDB::bind_method(D_METHOD("set_max_distance", "metres"), &AudioStreamPlayer3D::set_max_distance);
+ ClassDB::bind_method(D_METHOD("get_max_distance"), &AudioStreamPlayer3D::get_max_distance);
+
+ ClassDB::bind_method(D_METHOD("set_area_mask", "mask"), &AudioStreamPlayer3D::set_area_mask);
+ ClassDB::bind_method(D_METHOD("get_area_mask"), &AudioStreamPlayer3D::get_area_mask);
+
+ ClassDB::bind_method(D_METHOD("set_emission_angle", "degrees"), &AudioStreamPlayer3D::set_emission_angle);
+ ClassDB::bind_method(D_METHOD("get_emission_angle"), &AudioStreamPlayer3D::get_emission_angle);
+
+ ClassDB::bind_method(D_METHOD("set_emission_angle_enabled", "enabled"), &AudioStreamPlayer3D::set_emission_angle_enabled);
+ ClassDB::bind_method(D_METHOD("is_emission_angle_enabled"), &AudioStreamPlayer3D::is_emission_angle_enabled);
+
+ ClassDB::bind_method(D_METHOD("set_emission_angle_filter_attenuation_db", "db"), &AudioStreamPlayer3D::set_emission_angle_filter_attenuation_db);
+ ClassDB::bind_method(D_METHOD("get_emission_angle_filter_attenuation_db"), &AudioStreamPlayer3D::get_emission_angle_filter_attenuation_db);
+
+ ClassDB::bind_method(D_METHOD("set_attenuation_filter_cutoff_hz", "degrees"), &AudioStreamPlayer3D::set_attenuation_filter_cutoff_hz);
+ ClassDB::bind_method(D_METHOD("get_attenuation_filter_cutoff_hz"), &AudioStreamPlayer3D::get_attenuation_filter_cutoff_hz);
+
+ ClassDB::bind_method(D_METHOD("set_attenuation_filter_db", "db"), &AudioStreamPlayer3D::set_attenuation_filter_db);
+ ClassDB::bind_method(D_METHOD("get_attenuation_filter_db"), &AudioStreamPlayer3D::get_attenuation_filter_db);
+
+ ClassDB::bind_method(D_METHOD("set_attenuation_model", "model"), &AudioStreamPlayer3D::set_attenuation_model);
+ ClassDB::bind_method(D_METHOD("get_attenuation_model"), &AudioStreamPlayer3D::get_attenuation_model);
+
+ ClassDB::bind_method(D_METHOD("set_out_of_range_mode", "mode"), &AudioStreamPlayer3D::set_out_of_range_mode);
+ ClassDB::bind_method(D_METHOD("get_out_of_range_mode"), &AudioStreamPlayer3D::get_out_of_range_mode);
+
+ ClassDB::bind_method(D_METHOD("set_doppler_tracking", "mode"), &AudioStreamPlayer3D::set_doppler_tracking);
+ ClassDB::bind_method(D_METHOD("get_doppler_tracking"), &AudioStreamPlayer3D::get_doppler_tracking);
+
+ ClassDB::bind_method(D_METHOD("_bus_layout_changed"), &AudioStreamPlayer3D::_bus_layout_changed);
+
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_stream", "get_stream");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "attenuation_model", PROPERTY_HINT_ENUM, "Inverse,InverseSquare,Log"), "set_attenuation_model", "get_attenuation_model");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_db", PROPERTY_HINT_RANGE, "-80,80"), "set_unit_db", "get_unit_db");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_size", PROPERTY_HINT_RANGE, "0.1,100,0.1"), "set_unit_size", "get_unit_size");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_db", PROPERTY_HINT_RANGE, "-24,6"), "set_max_db", "get_max_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::REAL, "max_distance", PROPERTY_HINT_RANGE, "0,65536,1"), "set_max_distance", "get_max_distance");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "out_of_range_mode", PROPERTY_HINT_ENUM, "Mix,Pause"), "set_out_of_range_mode", "get_out_of_range_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "area_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_area_mask", "get_area_mask");
+ ADD_GROUP("Emission Angle", "emission_angle");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emission_angle_enabled"), "set_emission_angle_enabled", "is_emission_angle_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_degrees", PROPERTY_HINT_RANGE, "0.1,90,0.1"), "set_emission_angle", "get_emission_angle");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_filter_attenuation_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_emission_angle_filter_attenuation_db", "get_emission_angle_filter_attenuation_db");
+ ADD_GROUP("Attenuation Filter", "attenuation_filter_");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_cutoff_hz", PROPERTY_HINT_RANGE, "50,50000,1"), "set_attenuation_filter_cutoff_hz", "get_attenuation_filter_cutoff_hz");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_attenuation_filter_db", "get_attenuation_filter_db");
+ ADD_GROUP("Doppler", "doppler_");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "doppler_tracking", PROPERTY_HINT_ENUM, "Disabled,Idle,Fixed"), "set_doppler_tracking", "get_doppler_tracking");
+
+ BIND_CONSTANT(ATTENUATION_INVERSE_DISTANCE);
+ BIND_CONSTANT(ATTENUATION_INVERSE_SQUARE_DISTANCE);
+ BIND_CONSTANT(ATTENUATION_LOGARITHMIC);
+
+ BIND_CONSTANT(OUT_OF_RANGE_MIX);
+ BIND_CONSTANT(OUT_OF_RANGE_PAUSE);
+
+ BIND_CONSTANT(DOPPLER_TRACKING_DISABLED);
+ BIND_CONSTANT(DOPPLER_TRACKING_IDLE_STEP);
+ BIND_CONSTANT(DOPPLER_TRACKING_FIXED_STEP);
+}
+
+AudioStreamPlayer3D::AudioStreamPlayer3D() {
+
+ unit_db = 0;
+ unit_size = 1;
+ attenuation_model = ATTENUATION_INVERSE_DISTANCE;
+ max_db = 3;
+ autoplay = false;
+ setseek = -1;
+ active = false;
+ output_count = 0;
+ prev_output_count = 0;
+ max_distance = 0;
+ setplay = -1;
+ output_ready = false;
+ area_mask = 1;
+ emission_angle = 45;
+ emission_angle_enabled = false;
+ emission_angle_filter_attenuation_db = -12;
+ attenuation_filter_cutoff_hz = 5000;
+ attenuation_filter_db = -24;
+ out_of_range_mode = OUT_OF_RANGE_MIX;
+ doppler_tracking = DOPPLER_TRACKING_DISABLED;
+
+ velocity_tracker.instance();
+ AudioServer::get_singleton()->connect("bus_layout_changed", this, "_bus_layout_changed");
+}
+AudioStreamPlayer3D::~AudioStreamPlayer3D() {
+}
diff --git a/scene/3d/audio_stream_player_3d.h b/scene/3d/audio_stream_player_3d.h
new file mode 100644
index 0000000000..8603cab5a4
--- /dev/null
+++ b/scene/3d/audio_stream_player_3d.h
@@ -0,0 +1,175 @@
+#ifndef AUDIO_STREAM_PLAYER_3D_H
+#define AUDIO_STREAM_PLAYER_3D_H
+
+#include "scene/3d/spatial.h"
+#include "scene/3d/spatial_velocity_tracker.h"
+#include "servers/audio/audio_filter_sw.h"
+#include "servers/audio/audio_stream.h"
+#include "servers/audio_server.h"
+
+class Camera;
+class AudioStreamPlayer3D : public Spatial {
+
+ GDCLASS(AudioStreamPlayer3D, Spatial)
+public:
+ enum AttenuationModel {
+ ATTENUATION_INVERSE_DISTANCE,
+ ATTENUATION_INVERSE_SQUARE_DISTANCE,
+ ATTENUATION_LOGARITHMIC,
+ };
+
+ enum OutOfRangeMode {
+ OUT_OF_RANGE_MIX,
+ OUT_OF_RANGE_PAUSE,
+ };
+
+ enum DopplerTracking {
+ DOPPLER_TRACKING_DISABLED,
+ DOPPLER_TRACKING_IDLE_STEP,
+ DOPPLER_TRACKING_FIXED_STEP
+ };
+
+private:
+ enum {
+ MAX_OUTPUTS = 8,
+ MAX_INTERSECT_AREAS = 32
+
+ };
+
+ struct Output {
+
+ AudioFilterSW filter;
+ AudioFilterSW::Processor filter_process[6];
+ AudioFrame vol[3];
+ float filter_gain;
+ float pitch_scale;
+ int bus_index;
+ int reverb_bus_index;
+ AudioFrame reverb_vol[3];
+ Viewport *viewport; //pointer only used for reference to previous mix
+
+ Output() {
+ filter_gain = 0;
+ viewport = NULL;
+ reverb_bus_index = -1;
+ bus_index = -1;
+ }
+ };
+
+ Output outputs[MAX_OUTPUTS];
+ volatile int output_count;
+ volatile bool output_ready;
+
+ //these are used by audio thread to have a reference of previous volumes (for ramping volume and avoiding clicks)
+ Output prev_outputs[MAX_OUTPUTS];
+ int prev_output_count;
+
+ Ref<AudioStreamPlayback> stream_playback;
+ Ref<AudioStream> stream;
+ Vector<AudioFrame> mix_buffer;
+
+ volatile float setseek;
+ volatile bool active;
+ volatile float setplay;
+
+ AttenuationModel attenuation_model;
+ float unit_db;
+ float unit_size;
+ float max_db;
+ bool autoplay;
+ StringName bus;
+
+ void _mix_audio();
+ static void _mix_audios(void *self) { reinterpret_cast<AudioStreamPlayer3D *>(self)->_mix_audio(); }
+
+ void _set_playing(bool p_enable);
+ bool _is_active() const;
+
+ void _bus_layout_changed();
+
+ uint32_t area_mask;
+
+ bool emission_angle_enabled;
+ float emission_angle;
+ float emission_angle_filter_attenuation_db;
+ float attenuation_filter_cutoff_hz;
+ float attenuation_filter_db;
+
+ float max_distance;
+
+ Ref<SpatialVelocityTracker> velocity_tracker;
+
+ DopplerTracking doppler_tracking;
+
+ OutOfRangeMode out_of_range_mode;
+
+ float _get_attenuation_db(float p_distance) const;
+
+protected:
+ void _validate_property(PropertyInfo &property) const;
+ void _notification(int p_what);
+ static void _bind_methods();
+
+public:
+ void set_stream(Ref<AudioStream> p_stream);
+ Ref<AudioStream> get_stream() const;
+
+ void set_unit_db(float p_volume);
+ float get_unit_db() const;
+
+ void set_unit_size(float p_volume);
+ float get_unit_size() const;
+
+ void set_max_db(float p_boost);
+ float get_max_db() const;
+
+ void play(float p_from_pos = 0.0);
+ void seek(float p_seconds);
+ void stop();
+ bool is_playing() const;
+ float get_pos();
+
+ void set_bus(const StringName &p_bus);
+ StringName get_bus() const;
+
+ void set_autoplay(bool p_enable);
+ bool is_autoplay_enabled();
+
+ void set_max_distance(float p_metres);
+ float get_max_distance() const;
+
+ void set_area_mask(uint32_t p_mask);
+ uint32_t get_area_mask() const;
+
+ void set_emission_angle_enabled(bool p_enable);
+ bool is_emission_angle_enabled() const;
+
+ void set_emission_angle(float p_angle);
+ float get_emission_angle() const;
+
+ void set_emission_angle_filter_attenuation_db(float p_angle_attenuation_db);
+ float get_emission_angle_filter_attenuation_db() const;
+
+ void set_attenuation_filter_cutoff_hz(float p_hz);
+ float get_attenuation_filter_cutoff_hz() const;
+
+ void set_attenuation_filter_db(float p_db);
+ float get_attenuation_filter_db() const;
+
+ void set_attenuation_model(AttenuationModel p_model);
+ AttenuationModel get_attenuation_model() const;
+
+ void set_out_of_range_mode(OutOfRangeMode p_mode);
+ OutOfRangeMode get_out_of_range_mode() const;
+
+ void set_doppler_tracking(DopplerTracking p_tracking);
+ DopplerTracking get_doppler_tracking() const;
+
+ AudioStreamPlayer3D();
+ ~AudioStreamPlayer3D();
+};
+
+VARIANT_ENUM_CAST(AudioStreamPlayer3D::AttenuationModel)
+VARIANT_ENUM_CAST(AudioStreamPlayer3D::OutOfRangeMode)
+VARIANT_ENUM_CAST(AudioStreamPlayer3D::DopplerTracking)
+#endif // AUDIO_STREAM_PLAYER_3D_H
diff --git a/scene/3d/baked_light_instance.cpp b/scene/3d/baked_light_instance.cpp
deleted file mode 100644
index ac424475ea..0000000000
--- a/scene/3d/baked_light_instance.cpp
+++ /dev/null
@@ -1,1753 +0,0 @@
-/*************************************************************************/
-/* baked_light_instance.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 "baked_light_instance.h"
-#include "light.h"
-#include "math.h"
-#include "mesh_instance.h"
-#include "scene/scene_string_names.h"
-
-#define FINDMINMAX(x0, x1, x2, min, max) \
- min = max = x0; \
- if (x1 < min) min = x1; \
- if (x1 > max) max = x1; \
- if (x2 < min) min = x2; \
- if (x2 > max) max = x2;
-
-static bool planeBoxOverlap(Vector3 normal, float d, Vector3 maxbox) {
- int q;
- Vector3 vmin, vmax;
- for (q = 0; q <= 2; q++) {
- if (normal[q] > 0.0f) {
- vmin[q] = -maxbox[q];
- vmax[q] = maxbox[q];
- } else {
- vmin[q] = maxbox[q];
- vmax[q] = -maxbox[q];
- }
- }
- if (normal.dot(vmin) + d > 0.0f) return false;
- if (normal.dot(vmax) + d >= 0.0f) return true;
-
- return false;
-}
-
-/*======================== X-tests ========================*/
-#define AXISTEST_X01(a, b, fa, fb) \
- p0 = a * v0.y - b * v0.z; \
- p2 = a * v2.y - b * v2.z; \
- if (p0 < p2) { \
- min = p0; \
- max = p2; \
- } else { \
- min = p2; \
- max = p0; \
- } \
- rad = fa * boxhalfsize.y + fb * boxhalfsize.z; \
- if (min > rad || max < -rad) return false;
-
-#define AXISTEST_X2(a, b, fa, fb) \
- p0 = a * v0.y - b * v0.z; \
- p1 = a * v1.y - b * v1.z; \
- if (p0 < p1) { \
- min = p0; \
- max = p1; \
- } else { \
- min = p1; \
- max = p0; \
- } \
- rad = fa * boxhalfsize.y + fb * boxhalfsize.z; \
- if (min > rad || max < -rad) return false;
-
-/*======================== Y-tests ========================*/
-#define AXISTEST_Y02(a, b, fa, fb) \
- p0 = -a * v0.x + b * v0.z; \
- p2 = -a * v2.x + b * v2.z; \
- if (p0 < p2) { \
- min = p0; \
- max = p2; \
- } else { \
- min = p2; \
- max = p0; \
- } \
- rad = fa * boxhalfsize.x + fb * boxhalfsize.z; \
- if (min > rad || max < -rad) return false;
-
-#define AXISTEST_Y1(a, b, fa, fb) \
- p0 = -a * v0.x + b * v0.z; \
- p1 = -a * v1.x + b * v1.z; \
- if (p0 < p1) { \
- min = p0; \
- max = p1; \
- } else { \
- min = p1; \
- max = p0; \
- } \
- rad = fa * boxhalfsize.x + fb * boxhalfsize.z; \
- if (min > rad || max < -rad) return false;
-
-/*======================== Z-tests ========================*/
-
-#define AXISTEST_Z12(a, b, fa, fb) \
- p1 = a * v1.x - b * v1.y; \
- p2 = a * v2.x - b * v2.y; \
- if (p2 < p1) { \
- min = p2; \
- max = p1; \
- } else { \
- min = p1; \
- max = p2; \
- } \
- rad = fa * boxhalfsize.x + fb * boxhalfsize.y; \
- if (min > rad || max < -rad) return false;
-
-#define AXISTEST_Z0(a, b, fa, fb) \
- p0 = a * v0.x - b * v0.y; \
- p1 = a * v1.x - b * v1.y; \
- if (p0 < p1) { \
- min = p0; \
- max = p1; \
- } else { \
- min = p1; \
- max = p0; \
- } \
- rad = fa * boxhalfsize.x + fb * boxhalfsize.y; \
- if (min > rad || max < -rad) return false;
-
-static bool fast_tri_box_overlap(const Vector3 &boxcenter, const Vector3 boxhalfsize, const Vector3 *triverts) {
-
- /* use separating axis theorem to test overlap between triangle and box */
- /* need to test for overlap in these directions: */
- /* 1) the {x,y,z}-directions (actually, since we use the AABB of the triangle */
- /* we do not even need to test these) */
- /* 2) normal of the triangle */
- /* 3) crossproduct(edge from tri, {x,y,z}-directin) */
- /* this gives 3x3=9 more tests */
- Vector3 v0, v1, v2;
- float min, max, d, p0, p1, p2, rad, fex, fey, fez;
- Vector3 normal, e0, e1, e2;
-
- /* This is the fastest branch on Sun */
- /* move everything so that the boxcenter is in (0,0,0) */
-
- v0 = triverts[0] - boxcenter;
- v1 = triverts[1] - boxcenter;
- v2 = triverts[2] - boxcenter;
-
- /* compute triangle edges */
- e0 = v1 - v0; /* tri edge 0 */
- e1 = v2 - v1; /* tri edge 1 */
- e2 = v0 - v2; /* tri edge 2 */
-
- /* Bullet 3: */
- /* test the 9 tests first (this was faster) */
- fex = Math::abs(e0.x);
- fey = Math::abs(e0.y);
- fez = Math::abs(e0.z);
- AXISTEST_X01(e0.z, e0.y, fez, fey);
- AXISTEST_Y02(e0.z, e0.x, fez, fex);
- AXISTEST_Z12(e0.y, e0.x, fey, fex);
-
- fex = Math::abs(e1.x);
- fey = Math::abs(e1.y);
- fez = Math::abs(e1.z);
- AXISTEST_X01(e1.z, e1.y, fez, fey);
- AXISTEST_Y02(e1.z, e1.x, fez, fex);
- AXISTEST_Z0(e1.y, e1.x, fey, fex);
-
- fex = Math::abs(e2.x);
- fey = Math::abs(e2.y);
- fez = Math::abs(e2.z);
- AXISTEST_X2(e2.z, e2.y, fez, fey);
- AXISTEST_Y1(e2.z, e2.x, fez, fex);
- AXISTEST_Z12(e2.y, e2.x, fey, fex);
-
- /* Bullet 1: */
- /* first test overlap in the {x,y,z}-directions */
- /* find min, max of the triangle each direction, and test for overlap in */
- /* that direction -- this is equivalent to testing a minimal AABB around */
- /* the triangle against the AABB */
-
- /* test in X-direction */
- FINDMINMAX(v0.x, v1.x, v2.x, min, max);
- if (min > boxhalfsize.x || max < -boxhalfsize.x) return false;
-
- /* test in Y-direction */
- FINDMINMAX(v0.y, v1.y, v2.y, min, max);
- if (min > boxhalfsize.y || max < -boxhalfsize.y) return false;
-
- /* test in Z-direction */
- FINDMINMAX(v0.z, v1.z, v2.z, min, max);
- if (min > boxhalfsize.z || max < -boxhalfsize.z) return false;
-
- /* Bullet 2: */
- /* test if the box intersects the plane of the triangle */
- /* compute plane equation of triangle: normal*x+d=0 */
- normal = e0.cross(e1);
- d = -normal.dot(v0); /* plane eq: normal.x+d=0 */
- if (!planeBoxOverlap(normal, d, boxhalfsize)) return false;
-
- return true; /* box and triangle overlaps */
-}
-
-Vector<Color> BakedLight::_get_bake_texture(Image &p_image, const Color &p_color) {
-
- Vector<Color> ret;
-
- if (p_image.empty()) {
-
- ret.resize(bake_texture_size * bake_texture_size);
- for (int i = 0; i < bake_texture_size * bake_texture_size; i++) {
- ret[i] = p_color;
- }
-
- return ret;
- }
-
- p_image.convert(Image::FORMAT_RGBA8);
- p_image.resize(bake_texture_size, bake_texture_size, Image::INTERPOLATE_CUBIC);
-
- PoolVector<uint8_t>::Read r = p_image.get_data().read();
- ret.resize(bake_texture_size * bake_texture_size);
-
- for (int i = 0; i < bake_texture_size * bake_texture_size; i++) {
- Color c;
- c.r = r[i * 4 + 0] / 255.0;
- c.g = r[i * 4 + 1] / 255.0;
- c.b = r[i * 4 + 2] / 255.0;
- c.a = r[i * 4 + 3] / 255.0;
- ret[i] = c;
- }
-
- return ret;
-}
-
-BakedLight::MaterialCache BakedLight::_get_material_cache(Ref<Material> p_material) {
-
- //this way of obtaining materials is inaccurate and also does not support some compressed formats very well
- Ref<FixedSpatialMaterial> mat = p_material;
-
- Ref<Material> material = mat; //hack for now
-
- if (material_cache.has(material)) {
- return material_cache[material];
- }
-
- MaterialCache mc;
-
- if (mat.is_valid()) {
-
- Ref<ImageTexture> albedo_tex = mat->get_texture(FixedSpatialMaterial::TEXTURE_ALBEDO);
-
- Image img_albedo;
- if (albedo_tex.is_valid()) {
-
- img_albedo = albedo_tex->get_data();
- }
-
- mc.albedo = _get_bake_texture(img_albedo, mat->get_albedo());
-
- Ref<ImageTexture> emission_tex = mat->get_texture(FixedSpatialMaterial::TEXTURE_EMISSION);
-
- Color emission_col = mat->get_emission();
- emission_col.r *= mat->get_emission_energy();
- emission_col.g *= mat->get_emission_energy();
- emission_col.b *= mat->get_emission_energy();
-
- Image img_emission;
-
- if (emission_tex.is_valid()) {
-
- img_emission = emission_tex->get_data();
- }
-
- mc.emission = _get_bake_texture(img_emission, emission_col);
-
- } else {
- Image empty;
-
- mc.albedo = _get_bake_texture(empty, Color(0.7, 0.7, 0.7));
- mc.emission = _get_bake_texture(empty, Color(0, 0, 0));
- }
-
- material_cache[p_material] = mc;
- return mc;
-}
-
-static _FORCE_INLINE_ Vector2 get_uv(const Vector3 &p_pos, const Vector3 *p_vtx, const Vector2 *p_uv) {
-
- if (p_pos.distance_squared_to(p_vtx[0]) < CMP_EPSILON2)
- return p_uv[0];
- if (p_pos.distance_squared_to(p_vtx[1]) < CMP_EPSILON2)
- return p_uv[1];
- if (p_pos.distance_squared_to(p_vtx[2]) < CMP_EPSILON2)
- return p_uv[2];
-
- Vector3 v0 = p_vtx[1] - p_vtx[0];
- Vector3 v1 = p_vtx[2] - p_vtx[0];
- Vector3 v2 = p_pos - p_vtx[0];
-
- float d00 = v0.dot(v0);
- float d01 = v0.dot(v1);
- float d11 = v1.dot(v1);
- float d20 = v2.dot(v0);
- float d21 = v2.dot(v1);
- float denom = (d00 * d11 - d01 * d01);
- if (denom == 0)
- return p_uv[0];
- float v = (d11 * d20 - d01 * d21) / denom;
- float w = (d00 * d21 - d01 * d20) / denom;
- float u = 1.0f - v - w;
-
- return p_uv[0] * u + p_uv[1] * v + p_uv[2] * w;
-}
-
-void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const Vector2 *p_uv, const MaterialCache &p_material, const Rect3 &p_aabb) {
-
- if (p_level == cell_subdiv - 1) {
- //plot the face by guessing it's albedo and emission value
-
- //find best axis to map to, for scanning values
- int closest_axis;
- float closest_dot;
-
- Vector3 normal = Plane(p_vtx[0], p_vtx[1], p_vtx[2]).normal;
-
- for (int i = 0; i < 3; i++) {
-
- Vector3 axis;
- axis[i] = 1.0;
- float dot = ABS(normal.dot(axis));
- if (i == 0 || dot > closest_dot) {
- closest_axis = i;
- closest_dot = dot;
- }
- }
-
- Vector3 axis;
- axis[closest_axis] = 1.0;
- Vector3 t1;
- t1[(closest_axis + 1) % 3] = 1.0;
- Vector3 t2;
- t2[(closest_axis + 2) % 3] = 1.0;
-
- t1 *= p_aabb.size[(closest_axis + 1) % 3] / float(color_scan_cell_width);
- t2 *= p_aabb.size[(closest_axis + 2) % 3] / float(color_scan_cell_width);
-
- Color albedo_accum;
- Color emission_accum;
- float alpha = 0.0;
-
- //map to a grid average in the best axis for this face
- for (int i = 0; i < color_scan_cell_width; i++) {
-
- Vector3 ofs_i = float(i) * t1;
-
- for (int j = 0; j < color_scan_cell_width; j++) {
-
- Vector3 ofs_j = float(j) * t2;
-
- Vector3 from = p_aabb.pos + ofs_i + ofs_j;
- Vector3 to = from + t1 + t2 + axis * p_aabb.size[closest_axis];
- Vector3 half = (to - from) * 0.5;
-
- //is in this cell?
- if (!fast_tri_box_overlap(from + half, half, p_vtx)) {
- continue; //face does not span this cell
- }
-
- //go from -size to +size*2 to avoid skipping collisions
- 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;
-
- 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;
- }
- }
- }
-
- Vector2 uv = get_uv(intersection, p_vtx, p_uv);
-
- int uv_x = CLAMP(Math::fposmod(uv.x, 1.0f) * bake_texture_size, 0, bake_texture_size - 1);
- int uv_y = CLAMP(Math::fposmod(uv.y, 1.0f) * bake_texture_size, 0, bake_texture_size - 1);
-
- int ofs = uv_y * bake_texture_size + uv_x;
- albedo_accum.r += p_material.albedo[ofs].r;
- albedo_accum.g += p_material.albedo[ofs].g;
- albedo_accum.b += p_material.albedo[ofs].b;
- albedo_accum.a += p_material.albedo[ofs].a;
-
- emission_accum.r += p_material.emission[ofs].r;
- emission_accum.g += p_material.emission[ofs].g;
- emission_accum.b += p_material.emission[ofs].b;
- alpha += 1.0;
- }
- }
-
- if (alpha == 0) {
- //could not in any way get texture information.. so use closest point to center
-
- Face3 f(p_vtx[0], p_vtx[1], p_vtx[2]);
- Vector3 inters = f.get_closest_point_to(p_aabb.pos + p_aabb.size * 0.5);
-
- Vector2 uv = get_uv(inters, p_vtx, p_uv);
-
- int uv_x = CLAMP(Math::fposmod(uv.x, 1.0f) * bake_texture_size, 0, bake_texture_size - 1);
- int uv_y = CLAMP(Math::fposmod(uv.y, 1.0f) * bake_texture_size, 0, bake_texture_size - 1);
-
- int ofs = uv_y * bake_texture_size + uv_x;
-
- alpha = 1.0 / (color_scan_cell_width * color_scan_cell_width);
-
- albedo_accum.r = p_material.albedo[ofs].r * alpha;
- albedo_accum.g = p_material.albedo[ofs].g * alpha;
- albedo_accum.b = p_material.albedo[ofs].b * alpha;
- albedo_accum.a = p_material.albedo[ofs].a * alpha;
-
- emission_accum.r = p_material.emission[ofs].r * alpha;
- emission_accum.g = p_material.emission[ofs].g * alpha;
- emission_accum.b = p_material.emission[ofs].b * alpha;
-
- zero_alphas++;
- } else {
-
- float accdiv = 1.0 / (color_scan_cell_width * color_scan_cell_width);
- alpha *= accdiv;
-
- albedo_accum.r *= accdiv;
- albedo_accum.g *= accdiv;
- albedo_accum.b *= accdiv;
- albedo_accum.a *= accdiv;
-
- emission_accum.r *= accdiv;
- emission_accum.g *= accdiv;
- emission_accum.b *= accdiv;
- }
-
- //put this temporarily here, corrected in a later step
- bake_cells_write[p_idx].albedo[0] += albedo_accum.r;
- bake_cells_write[p_idx].albedo[1] += albedo_accum.g;
- bake_cells_write[p_idx].albedo[2] += albedo_accum.b;
- bake_cells_write[p_idx].light[0] += emission_accum.r;
- bake_cells_write[p_idx].light[1] += emission_accum.g;
- bake_cells_write[p_idx].light[2] += emission_accum.b;
- bake_cells_write[p_idx].alpha += alpha;
-
- static const Vector3 side_normals[6] = {
- Vector3(-1, 0, 0),
- Vector3(1, 0, 0),
- Vector3(0, -1, 0),
- Vector3(0, 1, 0),
- Vector3(0, 0, -1),
- Vector3(0, 0, 1),
- };
-
- for (int i = 0; i < 6; i++) {
- if (normal.dot(side_normals[i]) > CMP_EPSILON) {
- bake_cells_write[p_idx].used_sides |= (1 << i);
- }
- }
-
- } else {
- //go down
- for (int i = 0; i < 8; i++) {
-
- Rect3 aabb = p_aabb;
- aabb.size *= 0.5;
-
- if (i & 1)
- aabb.pos.x += aabb.size.x;
- if (i & 2)
- aabb.pos.y += aabb.size.y;
- if (i & 4)
- aabb.pos.z += aabb.size.z;
-
- {
- Rect3 test_aabb = aabb;
- //test_aabb.grow_by(test_aabb.get_longest_axis_size()*0.05); //grow a bit to avoid numerical error in real-time
- Vector3 qsize = test_aabb.size * 0.5; //quarter size, for fast aabb test
-
- if (!fast_tri_box_overlap(test_aabb.pos + qsize, qsize, p_vtx)) {
- //if (!Face3(p_vtx[0],p_vtx[1],p_vtx[2]).intersects_aabb2(aabb)) {
- //does not fit in child, go on
- continue;
- }
- }
-
- if (bake_cells_write[p_idx].childs[i] == CHILD_EMPTY) {
- //sub cell must be created
-
- if (bake_cells_used == (1 << bake_cells_alloc)) {
- //exhausted cells, creating more space
- bake_cells_alloc++;
- bake_cells_write = PoolVector<BakeCell>::Write();
- bake_cells.resize(1 << bake_cells_alloc);
- bake_cells_write = bake_cells.write();
- }
-
- bake_cells_write[p_idx].childs[i] = bake_cells_used;
- bake_cells_level_used[p_level + 1]++;
- bake_cells_used++;
- }
-
- _plot_face(bake_cells_write[p_idx].childs[i], p_level + 1, p_vtx, p_uv, p_material, aabb);
- }
- }
-}
-
-void BakedLight::_fixup_plot(int p_idx, int p_level, int p_x, int p_y, int p_z) {
-
- if (p_level == cell_subdiv - 1) {
-
- float alpha = bake_cells_write[p_idx].alpha;
-
- bake_cells_write[p_idx].albedo[0] /= alpha;
- bake_cells_write[p_idx].albedo[1] /= alpha;
- bake_cells_write[p_idx].albedo[2] /= alpha;
-
- //transfer emission to light
- bake_cells_write[p_idx].light[0] /= alpha;
- bake_cells_write[p_idx].light[1] /= alpha;
- bake_cells_write[p_idx].light[2] /= alpha;
-
- bake_cells_write[p_idx].alpha = 1.0;
-
- //remove neighbours from used sides
-
- for (int n = 0; n < 6; n++) {
-
- int ofs[3] = { 0, 0, 0 };
-
- ofs[n / 2] = (n & 1) ? 1 : -1;
-
- //convert to x,y,z on this level
- int x = p_x;
- int y = p_y;
- int z = p_z;
-
- x += ofs[0];
- y += ofs[1];
- z += ofs[2];
-
- int ofs_x = 0;
- int ofs_y = 0;
- int ofs_z = 0;
- int size = 1 << p_level;
- int half = size / 2;
-
- if (x < 0 || x >= size || y < 0 || y >= size || z < 0 || z >= size) {
- //neighbour is out, can't use it
- bake_cells_write[p_idx].used_sides &= ~(1 << uint32_t(n));
- continue;
- }
-
- uint32_t neighbour = 0;
-
- for (int i = 0; i < cell_subdiv - 1; i++) {
-
- BakeCell *bc = &bake_cells_write[neighbour];
-
- int child = 0;
- if (x >= ofs_x + half) {
- child |= 1;
- ofs_x += half;
- }
- if (y >= ofs_y + half) {
- child |= 2;
- ofs_y += half;
- }
- if (z >= ofs_z + half) {
- child |= 4;
- ofs_z += half;
- }
-
- neighbour = bc->childs[child];
- if (neighbour == CHILD_EMPTY) {
- break;
- }
-
- half >>= 1;
- }
-
- if (neighbour != CHILD_EMPTY) {
- bake_cells_write[p_idx].used_sides &= ~(1 << uint32_t(n));
- }
- }
- } else {
-
- //go down
-
- float alpha_average = 0;
- int half = cells_per_axis >> (p_level + 1);
- for (int i = 0; i < 8; i++) {
-
- uint32_t child = bake_cells_write[p_idx].childs[i];
-
- if (child == CHILD_EMPTY)
- continue;
-
- int nx = p_x;
- int ny = p_y;
- int nz = p_z;
-
- if (i & 1)
- nx += half;
- if (i & 2)
- ny += half;
- if (i & 4)
- nz += half;
-
- _fixup_plot(child, p_level + 1, nx, ny, nz);
- alpha_average += bake_cells_write[child].alpha;
- }
-
- bake_cells_write[p_idx].alpha = alpha_average / 8.0;
- bake_cells_write[p_idx].light[0] = 0;
- bake_cells_write[p_idx].light[1] = 0;
- bake_cells_write[p_idx].light[2] = 0;
- bake_cells_write[p_idx].albedo[0] = 0;
- bake_cells_write[p_idx].albedo[1] = 0;
- bake_cells_write[p_idx].albedo[2] = 0;
- }
-
- //clean up light
- bake_cells_write[p_idx].light_pass = 0;
- //find neighbours
-}
-
-void BakedLight::_bake_add_mesh(const Transform &p_xform, Ref<Mesh> &p_mesh) {
-
- for (int i = 0; i < p_mesh->get_surface_count(); i++) {
-
- if (p_mesh->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES)
- continue; //only triangles
-
- MaterialCache material = _get_material_cache(p_mesh->surface_get_material(i));
-
- Array a = p_mesh->surface_get_arrays(i);
-
- PoolVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX];
- PoolVector<Vector3>::Read vr = vertices.read();
- PoolVector<Vector2> uv = a[Mesh::ARRAY_TEX_UV];
- PoolVector<Vector2>::Read uvr;
- PoolVector<int> index = a[Mesh::ARRAY_INDEX];
-
- bool read_uv = false;
-
- if (uv.size()) {
-
- uvr = uv.read();
- read_uv = true;
- }
-
- if (index.size()) {
-
- int facecount = index.size() / 3;
- PoolVector<int>::Read ir = index.read();
-
- for (int j = 0; j < facecount; j++) {
-
- Vector3 vtxs[3];
- Vector2 uvs[3];
-
- for (int k = 0; k < 3; k++) {
- vtxs[k] = p_xform.xform(vr[ir[j * 3 + k]]);
- }
-
- if (read_uv) {
- for (int k = 0; k < 3; k++) {
- uvs[k] = uvr[ir[j * 3 + k]];
- }
- }
-
- //plot face
- _plot_face(0, 0, vtxs, uvs, material, bounds);
- }
-
- } else {
-
- int facecount = vertices.size() / 3;
-
- for (int j = 0; j < facecount; j++) {
-
- Vector3 vtxs[3];
- Vector2 uvs[3];
-
- for (int k = 0; k < 3; k++) {
- vtxs[k] = p_xform.xform(vr[j * 3 + k]);
- }
-
- if (read_uv) {
- for (int k = 0; k < 3; k++) {
- uvs[k] = uvr[j * 3 + k];
- }
- }
-
- //plot face
- _plot_face(0, 0, vtxs, uvs, material, bounds);
- }
- }
- }
-}
-
-void BakedLight::_bake_add_to_aabb(const Transform &p_xform, Ref<Mesh> &p_mesh, bool &first) {
-
- for (int i = 0; i < p_mesh->get_surface_count(); i++) {
-
- if (p_mesh->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES)
- continue; //only triangles
-
- Array a = p_mesh->surface_get_arrays(i);
- PoolVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX];
- int vc = vertices.size();
- PoolVector<Vector3>::Read vr = vertices.read();
-
- if (first) {
- bounds.pos = p_xform.xform(vr[0]);
- first = false;
- }
-
- for (int j = 0; j < vc; j++) {
- bounds.expand_to(p_xform.xform(vr[j]));
- }
- }
-}
-
-void BakedLight::bake() {
-
- bake_cells_alloc = 16;
- bake_cells.resize(1 << bake_cells_alloc);
- bake_cells_used = 1;
- cells_per_axis = (1 << (cell_subdiv - 1));
- zero_alphas = 0;
-
- bool aabb_first = true;
- print_line("Generating AABB");
-
- bake_cells_level_used.resize(cell_subdiv);
- for (int i = 0; i < cell_subdiv; i++) {
- bake_cells_level_used[i] = 0;
- }
-
- int count = 0;
- for (Set<GeometryInstance *>::Element *E = geometries.front(); E; E = E->next()) {
-
- print_line("aabb geom " + itos(count) + "/" + itos(geometries.size()));
-
- GeometryInstance *geom = E->get();
-
- if (geom->cast_to<MeshInstance>()) {
-
- MeshInstance *mesh_instance = geom->cast_to<MeshInstance>();
- Ref<Mesh> mesh = mesh_instance->get_mesh();
- if (mesh.is_valid()) {
-
- _bake_add_to_aabb(geom->get_relative_transform(this), mesh, aabb_first);
- }
- }
- count++;
- }
-
- print_line("AABB: " + bounds);
- ERR_FAIL_COND(aabb_first);
-
- bake_cells_write = bake_cells.write();
- count = 0;
-
- for (Set<GeometryInstance *>::Element *E = geometries.front(); E; E = E->next()) {
-
- GeometryInstance *geom = E->get();
- print_line("plot geom " + itos(count) + "/" + itos(geometries.size()));
-
- if (geom->cast_to<MeshInstance>()) {
-
- MeshInstance *mesh_instance = geom->cast_to<MeshInstance>();
- Ref<Mesh> mesh = mesh_instance->get_mesh();
- if (mesh.is_valid()) {
-
- _bake_add_mesh(geom->get_relative_transform(this), mesh);
- }
- }
-
- count++;
- }
-
- _fixup_plot(0, 0, 0, 0, 0);
-
- bake_cells_write = PoolVector<BakeCell>::Write();
-
- bake_cells.resize(bake_cells_used);
-
- print_line("total bake cells used: " + itos(bake_cells_used));
- for (int i = 0; i < cell_subdiv; i++) {
- print_line("level " + itos(i) + ": " + itos(bake_cells_level_used[i]));
- }
- print_line("zero alphas: " + itos(zero_alphas));
-}
-
-void BakedLight::_bake_directional(int p_idx, int p_level, int p_x, int p_y, int p_z, const Vector3 &p_dir, const Color &p_color, int p_sign) {
-
- if (p_level == cell_subdiv - 1) {
-
- Vector3 end;
- end.x = float(p_x + 0.5) / cells_per_axis;
- end.y = float(p_y + 0.5) / cells_per_axis;
- end.z = float(p_z + 0.5) / cells_per_axis;
-
- end = bounds.pos + bounds.size * end;
-
- float max_ray_len = (bounds.size).length() * 1.2;
-
- Vector3 begin = end + max_ray_len * -p_dir;
-
- //clip begin
-
- for (int i = 0; i < 3; i++) {
-
- if (ABS(p_dir[i]) < CMP_EPSILON) {
- continue; // parallel to axis, don't clip
- }
-
- Plane p;
- p.normal[i] = 1.0;
- p.d = bounds.pos[i];
- if (p_dir[i] < 0) {
- p.d += bounds.size[i];
- }
-
- Vector3 inters;
- if (p.intersects_segment(end, begin, &inters)) {
- begin = inters;
- }
- }
-
- int idx = _plot_ray(begin, end);
-
- if (idx >= 0 && light_pass != bake_cells_write[idx].light_pass) {
- //hit something, add or remove light to it
-
- Color albedo = Color(bake_cells_write[idx].albedo[0], bake_cells_write[idx].albedo[1], bake_cells_write[idx].albedo[2]);
- bake_cells_write[idx].light[0] += albedo.r * p_color.r * p_sign;
- bake_cells_write[idx].light[1] += albedo.g * p_color.g * p_sign;
- bake_cells_write[idx].light[2] += albedo.b * p_color.b * p_sign;
- bake_cells_write[idx].light_pass = light_pass;
- }
-
- } else {
-
- int half = cells_per_axis >> (p_level + 1);
-
- //go down
- for (int i = 0; i < 8; i++) {
-
- uint32_t child = bake_cells_write[p_idx].childs[i];
-
- if (child == CHILD_EMPTY)
- continue;
-
- int nx = p_x;
- int ny = p_y;
- int nz = p_z;
-
- if (i & 1)
- nx += half;
- if (i & 2)
- ny += half;
- if (i & 4)
- nz += half;
-
- _bake_directional(child, p_level + 1, nx, ny, nz, p_dir, p_color, p_sign);
- }
- }
-}
-
-void BakedLight::_bake_light(Light *p_light) {
-
- if (p_light->cast_to<DirectionalLight>()) {
-
- DirectionalLight *dl = p_light->cast_to<DirectionalLight>();
-
- Transform rel_xf = dl->get_relative_transform(this);
-
- Vector3 light_dir = -rel_xf.basis.get_axis(2);
-
- Color color = dl->get_color();
- float nrg = dl->get_param(Light::PARAM_ENERGY);
- color.r *= nrg;
- color.g *= nrg;
- color.b *= nrg;
-
- light_pass++;
- _bake_directional(0, 0, 0, 0, 0, light_dir, color, 1);
- }
-}
-
-void BakedLight::_upscale_light(int p_idx, int p_level) {
-
- //go down
-
- float light_accum[3] = { 0, 0, 0 };
- float alpha_accum = 0;
-
- bool check_children = p_level < (cell_subdiv - 2);
-
- for (int i = 0; i < 8; i++) {
-
- uint32_t child = bake_cells_write[p_idx].childs[i];
-
- if (child == CHILD_EMPTY)
- continue;
-
- if (check_children) {
- _upscale_light(child, p_level + 1);
- }
-
- light_accum[0] += bake_cells_write[child].light[0];
- light_accum[1] += bake_cells_write[child].light[1];
- light_accum[2] += bake_cells_write[child].light[2];
- alpha_accum += bake_cells_write[child].alpha;
- }
-
- bake_cells_write[p_idx].light[0] = light_accum[0] / 8.0;
- bake_cells_write[p_idx].light[1] = light_accum[1] / 8.0;
- bake_cells_write[p_idx].light[2] = light_accum[2] / 8.0;
- bake_cells_write[p_idx].alpha = alpha_accum / 8.0;
-}
-
-void BakedLight::bake_lights() {
-
- ERR_FAIL_COND(bake_cells.size() == 0);
-
- bake_cells_write = bake_cells.write();
-
- for (Set<Light *>::Element *E = lights.front(); E; E = E->next()) {
-
- _bake_light(E->get());
- }
-
- _upscale_light(0, 0);
-
- bake_cells_write = PoolVector<BakeCell>::Write();
-}
-
-Color BakedLight::_cone_trace(const Vector3 &p_from, const Vector3 &p_dir, float p_half_angle) {
-
- Color color(0, 0, 0, 0);
- float tha = Math::tan(p_half_angle); //tan half angle
- Vector3 from = (p_from - bounds.pos) / bounds.size; //convert to 0..1
- from /= cells_per_axis; //convert to voxels of size 1
- Vector3 dir = (p_dir / bounds.size).normalized();
-
- float max_dist = Vector3(cells_per_axis, cells_per_axis, cells_per_axis).length();
-
- float dist = 1.0;
- // self occlusion in flat surfaces
-
- float alpha = 0;
-
- while (dist < max_dist && alpha < 0.95) {
-
-#if 0
- // smallest sample diameter possible is the voxel size
- float diameter = MAX(1.0, 2.0 * tha * dist);
- float lod = log2(diameter);
-
- Vector3 sample_pos = from + dist * dir;
-
-
- Color samples_base[2][8]={{Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0)},
- {Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0)}};
-
- float levelf = Math::fposmod(lod,1.0);
- float fx = Math::fposmod(sample_pos.x,1.0);
- float fy = Math::fposmod(sample_pos.y,1.0);
- float fz = Math::fposmod(sample_pos.z,1.0);
-
- for(int l=0;l<2;l++){
-
- int bx = Math::floor(sample_pos.x);
- int by = Math::floor(sample_pos.y);
- int bz = Math::floor(sample_pos.z);
-
- int lodn=int(Math::floor(lod))-l;
-
- bx>>=lodn;
- by>>=lodn;
- bz>>=lodn;
-
- int limit = MAX(0,cell_subdiv-lodn-1);
-
- for(int c=0;c<8;c++) {
-
- int x = bx;
- int y = by;
- int z = bz;
-
- if (c&1) {
- x+=1;
- }
- if (c&2) {
- y+=1;
- }
- if (c&4) {
- z+=1;
- }
-
- int ofs_x=0;
- int ofs_y=0;
- int ofs_z=0;
- int size = cells_per_axis>>lodn;
- int half=size/2;
-
- bool outside=x<0 || x>=size || y<0 || y>=size || z<0 || z>=size;
-
- if (outside)
- continue;
-
-
- uint32_t cell=0;
-
- for(int i=0;i<limit;i++) {
-
- BakeCell *bc = &bake_cells_write[cell];
-
- int child = 0;
- if (x >= ofs_x + half) {
- child|=1;
- ofs_x+=half;
- }
- if (y >= ofs_y + half) {
- child|=2;
- ofs_y+=half;
- }
- if (z >= ofs_z + half) {
- child|=4;
- ofs_z+=half;
- }
-
- cell = bc->childs[child];
- if (cell==CHILD_EMPTY)
- break;
-
- half>>=1;
- }
-
- if (cell!=CHILD_EMPTY) {
-
- samples_base[l][c].r=bake_cells_write[cell].light[0];
- samples_base[l][c].g=bake_cells_write[cell].light[1];
- samples_base[l][c].b=bake_cells_write[cell].light[2];
- samples_base[l][c].a=bake_cells_write[cell].alpha;
- }
-
- }
-
-
- }
-
- Color m0x0 = samples_base[0][0].linear_interpolate(samples_base[0][1],fx);
- Color m0x1 = samples_base[0][2].linear_interpolate(samples_base[0][3],fx);
- Color m0y0 = m0x0.linear_interpolate(m0x1,fy);
- m0x0 = samples_base[0][4].linear_interpolate(samples_base[0][5],fx);
- m0x1 = samples_base[0][6].linear_interpolate(samples_base[0][7],fx);
- Color m0y1 = m0x0.linear_interpolate(m0x1,fy);
- Color m0z = m0y0.linear_interpolate(m0y1,fz);
-
- Color m1x0 = samples_base[1][0].linear_interpolate(samples_base[1][1],fx);
- Color m1x1 = samples_base[1][2].linear_interpolate(samples_base[1][3],fx);
- Color m1y0 = m1x0.linear_interpolate(m1x1,fy);
- m1x0 = samples_base[1][4].linear_interpolate(samples_base[1][5],fx);
- m1x1 = samples_base[1][6].linear_interpolate(samples_base[1][7],fx);
- Color m1y1 = m1x0.linear_interpolate(m1x1,fy);
- Color m1z = m1y0.linear_interpolate(m1y1,fz);
-
- Color m = m0z.linear_interpolate(m1z,levelf);
-#else
- float diameter = 1.0;
- Vector3 sample_pos = from + dist * dir;
-
- Color m(0, 0, 0, 0);
- {
- int x = Math::floor(sample_pos.x);
- int y = Math::floor(sample_pos.y);
- int z = Math::floor(sample_pos.z);
-
- int ofs_x = 0;
- int ofs_y = 0;
- int ofs_z = 0;
- int size = cells_per_axis;
- int half = size / 2;
-
- bool outside = x < 0 || x >= size || y < 0 || y >= size || z < 0 || z >= size;
-
- if (!outside) {
-
- uint32_t cell = 0;
-
- for (int i = 0; i < cell_subdiv - 1; i++) {
-
- BakeCell *bc = &bake_cells_write[cell];
-
- int child = 0;
- if (x >= ofs_x + half) {
- child |= 1;
- ofs_x += half;
- }
- if (y >= ofs_y + half) {
- child |= 2;
- ofs_y += half;
- }
- if (z >= ofs_z + half) {
- child |= 4;
- ofs_z += half;
- }
-
- cell = bc->childs[child];
- if (cell == CHILD_EMPTY)
- break;
-
- half >>= 1;
- }
-
- if (cell != CHILD_EMPTY) {
-
- m.r = bake_cells_write[cell].light[0];
- m.g = bake_cells_write[cell].light[1];
- m.b = bake_cells_write[cell].light[2];
- m.a = bake_cells_write[cell].alpha;
- }
- }
- }
-
-#endif
- // front-to-back compositing
- float a = (1.0 - alpha);
- color.r += a * m.r;
- color.g += a * m.g;
- color.b += a * m.b;
- alpha += a * m.a;
- //occlusion += a * voxelColor.a;
- //occlusion += (a * voxelColor.a) / (1.0 + 0.03 * diameter);
- dist += diameter * 0.5; // smoother
- //dist += diameter; // faster but misses more voxels
- }
-
- return color;
-}
-
-void BakedLight::_bake_radiance(int p_idx, int p_level, int p_x, int p_y, int p_z) {
-
- if (p_level == cell_subdiv - 1) {
-
- const int NUM_CONES = 6;
- Vector3 cone_directions[6] = {
- Vector3(1, 0, 0),
- Vector3(0.5, 0.866025, 0),
- Vector3(0.5, 0.267617, 0.823639),
- Vector3(0.5, -0.700629, 0.509037),
- Vector3(0.5, -0.700629, -0.509037),
- Vector3(0.5, 0.267617, -0.823639)
- };
- float coneWeights[6] = { 0.25, 0.15, 0.15, 0.15, 0.15, 0.15 };
-
- Vector3 pos = (Vector3(p_x, p_y, p_z) / float(cells_per_axis)) * bounds.size + bounds.pos;
- Vector3 voxel_size = bounds.size / float(cells_per_axis);
- pos += voxel_size * 0.5;
-
- Color accum;
-
- bake_cells_write[p_idx].light[0] = 0;
- bake_cells_write[p_idx].light[1] = 0;
- bake_cells_write[p_idx].light[2] = 0;
-
- int freepix = 0;
- for (int i = 0; i < 6; i++) {
-
- if (!(bake_cells_write[p_idx].used_sides & (1 << i)))
- continue;
-
- if ((i & 1) == 0)
- bake_cells_write[p_idx].light[i / 2] = 1.0;
- freepix++;
- continue;
-
- int ofs = i / 2;
-
- Vector3 dir;
- if ((i & 1) == 0)
- dir[ofs] = 1.0;
- else
- dir[ofs] = -1.0;
-
- for (int j = 0; j < 1; j++) {
-
- Vector3 cone_dir;
- cone_dir.x = cone_directions[j][(ofs + 0) % 3];
- cone_dir.y = cone_directions[j][(ofs + 1) % 3];
- cone_dir.z = cone_directions[j][(ofs + 2) % 3];
-
- cone_dir[ofs] *= dir[ofs];
-
- Color res = _cone_trace(pos + dir * voxel_size, cone_dir, Math::deg2rad(29.9849));
- accum.r += res.r; //*coneWeights[j];
- accum.g += res.g; //*coneWeights[j];
- accum.b += res.b; //*coneWeights[j];
- }
- }
-#if 0
- if (freepix==0) {
- bake_cells_write[p_idx].light[0]=0;
- bake_cells_write[p_idx].light[1]=0;
- bake_cells_write[p_idx].light[2]=0;
- }
-
- if (freepix==1) {
- bake_cells_write[p_idx].light[0]=1;
- bake_cells_write[p_idx].light[1]=0;
- bake_cells_write[p_idx].light[2]=0;
- }
-
- if (freepix==2) {
- bake_cells_write[p_idx].light[0]=0;
- bake_cells_write[p_idx].light[1]=1;
- bake_cells_write[p_idx].light[2]=0;
- }
-
- if (freepix==3) {
- bake_cells_write[p_idx].light[0]=1;
- bake_cells_write[p_idx].light[1]=1;
- bake_cells_write[p_idx].light[2]=0;
- }
-
- if (freepix==4) {
- bake_cells_write[p_idx].light[0]=0;
- bake_cells_write[p_idx].light[1]=0;
- bake_cells_write[p_idx].light[2]=1;
- }
-
- if (freepix==5) {
- bake_cells_write[p_idx].light[0]=1;
- bake_cells_write[p_idx].light[1]=0;
- bake_cells_write[p_idx].light[2]=1;
- }
-
- if (freepix==6) {
- bake_cells_write[p_idx].light[0]=0;
- bake_cells_write[p_idx].light[0]=1;
- bake_cells_write[p_idx].light[0]=1;
- }
-#endif
- //bake_cells_write[p_idx].radiance[0]=accum.r;
- //bake_cells_write[p_idx].radiance[1]=accum.g;
- //bake_cells_write[p_idx].radiance[2]=accum.b;
-
- } else {
-
- int half = cells_per_axis >> (p_level + 1);
-
- //go down
- for (int i = 0; i < 8; i++) {
-
- uint32_t child = bake_cells_write[p_idx].childs[i];
-
- if (child == CHILD_EMPTY)
- continue;
-
- int nx = p_x;
- int ny = p_y;
- int nz = p_z;
-
- if (i & 1)
- nx += half;
- if (i & 2)
- ny += half;
- if (i & 4)
- nz += half;
-
- _bake_radiance(child, p_level + 1, nx, ny, nz);
- }
- }
-}
-
-void BakedLight::bake_radiance() {
-
- ERR_FAIL_COND(bake_cells.size() == 0);
-
- bake_cells_write = bake_cells.write();
-
- _bake_radiance(0, 0, 0, 0, 0);
-
- bake_cells_write = PoolVector<BakeCell>::Write();
-}
-int BakedLight::_find_cell(int x, int y, int z) {
-
- uint32_t cell = 0;
-
- int ofs_x = 0;
- int ofs_y = 0;
- int ofs_z = 0;
- int size = cells_per_axis;
- int half = size / 2;
-
- if (x < 0 || x >= size)
- return -1;
- if (y < 0 || y >= size)
- return -1;
- if (z < 0 || z >= size)
- return -1;
-
- for (int i = 0; i < cell_subdiv - 1; i++) {
-
- BakeCell *bc = &bake_cells_write[cell];
-
- int child = 0;
- if (x >= ofs_x + half) {
- child |= 1;
- ofs_x += half;
- }
- if (y >= ofs_y + half) {
- child |= 2;
- ofs_y += half;
- }
- if (z >= ofs_z + half) {
- child |= 4;
- ofs_z += half;
- }
-
- cell = bc->childs[child];
- if (cell == CHILD_EMPTY)
- return -1;
-
- half >>= 1;
- }
-
- return cell;
-}
-
-int BakedLight::_plot_ray(const Vector3 &p_from, const Vector3 &p_to) {
-
- Vector3 from = (p_from - bounds.pos) / bounds.size;
- Vector3 to = (p_to - bounds.pos) / bounds.size;
-
- int x1 = Math::floor(from.x * cells_per_axis);
- int y1 = Math::floor(from.y * cells_per_axis);
- int z1 = Math::floor(from.z * cells_per_axis);
-
- int x2 = Math::floor(to.x * cells_per_axis);
- int y2 = Math::floor(to.y * cells_per_axis);
- int z2 = Math::floor(to.z * cells_per_axis);
-
- int i, dx, dy, dz, l, m, n, x_inc, y_inc, z_inc, err_1, err_2, dx2, dy2, dz2;
- int point[3];
-
- point[0] = x1;
- point[1] = y1;
- point[2] = z1;
- dx = x2 - x1;
- dy = y2 - y1;
- dz = z2 - z1;
- x_inc = (dx < 0) ? -1 : 1;
- l = ABS(dx);
- y_inc = (dy < 0) ? -1 : 1;
- m = ABS(dy);
- z_inc = (dz < 0) ? -1 : 1;
- n = ABS(dz);
- dx2 = l << 1;
- dy2 = m << 1;
- dz2 = n << 1;
-
- if ((l >= m) && (l >= n)) {
- err_1 = dy2 - l;
- err_2 = dz2 - l;
- for (i = 0; i < l; i++) {
- int cell = _find_cell(point[0], point[1], point[2]);
- if (cell >= 0)
- return cell;
-
- if (err_1 > 0) {
- point[1] += y_inc;
- err_1 -= dx2;
- }
- if (err_2 > 0) {
- point[2] += z_inc;
- err_2 -= dx2;
- }
- err_1 += dy2;
- err_2 += dz2;
- point[0] += x_inc;
- }
- } else if ((m >= l) && (m >= n)) {
- err_1 = dx2 - m;
- err_2 = dz2 - m;
- for (i = 0; i < m; i++) {
- int cell = _find_cell(point[0], point[1], point[2]);
- if (cell >= 0)
- return cell;
- if (err_1 > 0) {
- point[0] += x_inc;
- err_1 -= dy2;
- }
- if (err_2 > 0) {
- point[2] += z_inc;
- err_2 -= dy2;
- }
- err_1 += dx2;
- err_2 += dz2;
- point[1] += y_inc;
- }
- } else {
- err_1 = dy2 - n;
- err_2 = dx2 - n;
- for (i = 0; i < n; i++) {
- int cell = _find_cell(point[0], point[1], point[2]);
- if (cell >= 0)
- return cell;
-
- if (err_1 > 0) {
- point[1] += y_inc;
- err_1 -= dz2;
- }
- if (err_2 > 0) {
- point[0] += x_inc;
- err_2 -= dz2;
- }
- err_1 += dy2;
- err_2 += dx2;
- point[2] += z_inc;
- }
- }
- return _find_cell(point[0], point[1], point[2]);
-}
-
-void BakedLight::set_cell_subdiv(int p_subdiv) {
-
- cell_subdiv = p_subdiv;
-
- //VS::get_singleton()->baked_light_set_subdivision(baked_light,p_subdiv);
-}
-
-int BakedLight::get_cell_subdiv() const {
-
- return cell_subdiv;
-}
-
-Rect3 BakedLight::get_aabb() const {
-
- return Rect3(Vector3(0, 0, 0), Vector3(1, 1, 1));
-}
-PoolVector<Face3> BakedLight::get_faces(uint32_t p_usage_flags) const {
-
- return PoolVector<Face3>();
-}
-
-String BakedLight::get_configuration_warning() const {
- return String();
-}
-
-void BakedLight::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb, DebugMode p_mode, Ref<MultiMesh> &p_multimesh, int &idx) {
-
- if (p_level == cell_subdiv - 1) {
-
- Vector3 center = p_aabb.pos + p_aabb.size * 0.5;
- Transform xform;
- xform.origin = center;
- xform.basis.scale(p_aabb.size * 0.5);
- p_multimesh->set_instance_transform(idx, xform);
- Color col;
- switch (p_mode) {
- case DEBUG_ALBEDO: {
- col = Color(bake_cells_write[p_idx].albedo[0], bake_cells_write[p_idx].albedo[1], bake_cells_write[p_idx].albedo[2]);
- } break;
- case DEBUG_LIGHT: {
- col = Color(bake_cells_write[p_idx].light[0], bake_cells_write[p_idx].light[1], bake_cells_write[p_idx].light[2]);
- Color colr = Color(bake_cells_write[p_idx].radiance[0], bake_cells_write[p_idx].radiance[1], bake_cells_write[p_idx].radiance[2]);
- col.r += colr.r;
- col.g += colr.g;
- col.b += colr.b;
- } break;
- }
- p_multimesh->set_instance_color(idx, col);
-
- idx++;
-
- } else {
-
- for (int i = 0; i < 8; i++) {
-
- if (bake_cells_write[p_idx].childs[i] == CHILD_EMPTY)
- continue;
-
- Rect3 aabb = p_aabb;
- aabb.size *= 0.5;
-
- if (i & 1)
- aabb.pos.x += aabb.size.x;
- if (i & 2)
- aabb.pos.y += aabb.size.y;
- if (i & 4)
- aabb.pos.z += aabb.size.z;
-
- _debug_mesh(bake_cells_write[p_idx].childs[i], p_level + 1, aabb, p_mode, p_multimesh, idx);
- }
- }
-}
-
-void BakedLight::create_debug_mesh(DebugMode p_mode) {
-
- Ref<MultiMesh> mm;
- mm.instance();
-
- mm->set_transform_format(MultiMesh::TRANSFORM_3D);
- mm->set_color_format(MultiMesh::COLOR_8BIT);
- mm->set_instance_count(bake_cells_level_used[cell_subdiv - 1]);
-
- Ref<Mesh> mesh;
- mesh.instance();
-
- {
- Array arr;
- arr.resize(Mesh::ARRAY_MAX);
-
- PoolVector<Vector3> vertices;
- PoolVector<Color> colors;
-
- int vtx_idx = 0;
-#define ADD_VTX(m_idx) \
- ; \
- vertices.push_back(face_points[m_idx]); \
- colors.push_back(Color(1, 1, 1, 1)); \
- vtx_idx++;
-
- for (int i = 0; i < 6; i++) {
-
- Vector3 face_points[4];
-
- for (int j = 0; j < 4; j++) {
-
- float v[3];
- v[0] = 1.0;
- v[1] = 1 - 2 * ((j >> 1) & 1);
- v[2] = v[1] * (1 - 2 * (j & 1));
-
- for (int k = 0; k < 3; k++) {
-
- if (i < 3)
- face_points[j][(i + k) % 3] = v[k] * (i >= 3 ? -1 : 1);
- else
- face_points[3 - j][(i + k) % 3] = v[k] * (i >= 3 ? -1 : 1);
- }
- }
-
- //tri 1
- ADD_VTX(0);
- ADD_VTX(1);
- ADD_VTX(2);
- //tri 2
- ADD_VTX(2);
- ADD_VTX(3);
- ADD_VTX(0);
- }
-
- arr[Mesh::ARRAY_VERTEX] = vertices;
- arr[Mesh::ARRAY_COLOR] = colors;
- mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES, arr);
- }
-
- {
- Ref<FixedSpatialMaterial> fsm;
- fsm.instance();
- fsm->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
- fsm->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- fsm->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
- fsm->set_albedo(Color(1, 1, 1, 1));
-
- mesh->surface_set_material(0, fsm);
- }
-
- mm->set_mesh(mesh);
-
- bake_cells_write = bake_cells.write();
-
- int idx = 0;
- _debug_mesh(0, 0, bounds, p_mode, mm, idx);
-
- print_line("written: " + itos(idx) + " total: " + itos(bake_cells_level_used[cell_subdiv - 1]));
-
- MultiMeshInstance *mmi = memnew(MultiMeshInstance);
- mmi->set_multimesh(mm);
- add_child(mmi);
-#ifdef TOOLS_ENABLED
- if (get_tree()->get_edited_scene_root() == this) {
- mmi->set_owner(this);
- } else {
- mmi->set_owner(get_owner());
- }
-#else
- mmi->set_owner(get_owner());
-#endif
-}
-
-void BakedLight::_debug_mesh_albedo() {
- create_debug_mesh(DEBUG_ALBEDO);
-}
-
-void BakedLight::_debug_mesh_light() {
- create_debug_mesh(DEBUG_LIGHT);
-}
-
-void BakedLight::_bind_methods() {
-
- 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(D_METHOD("bake"), &BakedLight::bake);
- ClassDB::set_method_flags(get_class_static(), _scs_create("bake"), 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(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(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(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"), "set_cell_subdiv", "get_cell_subdiv");
- ADD_SIGNAL(MethodInfo("baked_light_changed"));
-}
-
-BakedLight::BakedLight() {
-
- //baked_light=VisualServer::get_singleton()->baked_light_create();
- VS::get_singleton()->instance_set_base(get_instance(), baked_light);
-
- cell_subdiv = 8;
- bake_texture_size = 128;
- color_scan_cell_width = 8;
- light_pass = 0;
-}
-
-BakedLight::~BakedLight() {
-
- VS::get_singleton()->free(baked_light);
-}
-
-/////////////////////////
-
-#if 0
-void BakedLightSampler::set_param(Param p_param,float p_value) {
- ERR_FAIL_INDEX(p_param,PARAM_MAX);
- params[p_param]=p_value;
- VS::get_singleton()->baked_light_sampler_set_param(base,VS::BakedLightSamplerParam(p_param),p_value);
-}
-
-float BakedLightSampler::get_param(Param p_param) const{
-
- ERR_FAIL_INDEX_V(p_param,PARAM_MAX,0);
- return params[p_param];
-
-}
-
-void BakedLightSampler::set_resolution(int p_resolution){
-
- ERR_FAIL_COND(p_resolution<4 || p_resolution>32);
- resolution=p_resolution;
- VS::get_singleton()->baked_light_sampler_set_resolution(base,resolution);
-}
-int BakedLightSampler::get_resolution() const {
-
- return resolution;
-}
-
-AABB BakedLightSampler::get_aabb() const {
-
- float r = get_param(PARAM_RADIUS);
- return AABB( Vector3(-r,-r,-r),Vector3(r*2,r*2,r*2));
-}
-DVector<Face3> BakedLightSampler::get_faces(uint32_t p_usage_flags) const {
- return DVector<Face3>();
-}
-
-void BakedLightSampler::_bind_methods() {
-
- 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(D_METHOD("set_resolution","resolution"),&BakedLightSampler::set_resolution);
- ClassDB::bind_method(D_METHOD("get_resolution"),&BakedLightSampler::get_resolution);
-
-
- BIND_CONSTANT( PARAM_RADIUS );
- BIND_CONSTANT( PARAM_STRENGTH );
- BIND_CONSTANT( PARAM_ATTENUATION );
- BIND_CONSTANT( PARAM_DETAIL_RATIO );
- BIND_CONSTANT( PARAM_MAX );
-
- 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");
-
-}
-
-BakedLightSampler::BakedLightSampler() {
-
- base = VS::get_singleton()->baked_light_sampler_create();
- set_base(base);
-
- params[PARAM_RADIUS]=1.0;
- params[PARAM_STRENGTH]=1.0;
- params[PARAM_ATTENUATION]=1.0;
- params[PARAM_DETAIL_RATIO]=0.1;
- resolution=16;
-
-
-}
-
-BakedLightSampler::~BakedLightSampler(){
-
- VS::get_singleton()->free(base);
-}
-#endif
diff --git a/scene/3d/baked_light_instance.h b/scene/3d/baked_light_instance.h
deleted file mode 100644
index 2180f8b175..0000000000
--- a/scene/3d/baked_light_instance.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/*************************************************************************/
-/* baked_light_instance.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 BAKED_LIGHT_INSTANCE_H
-#define BAKED_LIGHT_INSTANCE_H
-
-#include "scene/3d/multimesh_instance.h"
-#include "scene/3d/visual_instance.h"
-#include "scene/resources/baked_light.h"
-
-class BakedLightBaker;
-class Light;
-
-class BakedLight : public VisualInstance {
- GDCLASS(BakedLight, VisualInstance);
-
-public:
- enum DebugMode {
- DEBUG_ALBEDO,
- DEBUG_LIGHT
- };
-
-private:
- RID baked_light;
- int cell_subdiv;
- Rect3 bounds;
- int cells_per_axis;
-
- enum {
- CHILD_EMPTY = 0xFFFFFFFF,
- };
-
- /* BAKE DATA */
-
- struct BakeCell {
-
- uint32_t childs[8];
- float albedo[3]; //albedo in RGB24
- float light[3]; //accumulated light in 16:16 fixed point (needs to be integer for moving lights fast)
- float radiance[3]; //accumulated light in 16:16 fixed point (needs to be integer for moving lights fast)
- uint32_t used_sides;
- float alpha; //used for upsampling
- uint32_t light_pass; //used for baking light
-
- BakeCell() {
- for (int i = 0; i < 8; i++) {
- childs[i] = 0xFFFFFFFF;
- }
-
- for (int i = 0; i < 3; i++) {
- light[i] = 0;
- albedo[i] = 0;
- radiance[i] = 0;
- }
- alpha = 0;
- light_pass = 0;
- used_sides = 0;
- }
- };
-
- int bake_texture_size;
- int color_scan_cell_width;
-
- struct MaterialCache {
- //128x128 textures
- Vector<Color> albedo;
- Vector<Color> emission;
- };
-
- Vector<Color> _get_bake_texture(Image &p_image, const Color &p_color);
-
- Map<Ref<Material>, MaterialCache> material_cache;
- MaterialCache _get_material_cache(Ref<Material> p_material);
-
- int bake_cells_alloc;
- int bake_cells_used;
- int zero_alphas;
- Vector<int> bake_cells_level_used;
- PoolVector<BakeCell> bake_cells;
- PoolVector<BakeCell>::Write bake_cells_write;
-
- void _plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const Vector2 *p_uv, const MaterialCache &p_material, const Rect3 &p_aabb);
- void _fixup_plot(int p_idx, int p_level, int p_x, int p_y, int p_z);
- void _bake_add_mesh(const Transform &p_xform, Ref<Mesh> &p_mesh);
- void _bake_add_to_aabb(const Transform &p_xform, Ref<Mesh> &p_mesh, bool &first);
-
- void _debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb, DebugMode p_mode, Ref<MultiMesh> &p_multimesh, int &idx);
- void _debug_mesh_albedo();
- void _debug_mesh_light();
-
- _FORCE_INLINE_ int _find_cell(int x, int y, int z);
- int _plot_ray(const Vector3 &p_from, const Vector3 &p_to);
-
- uint32_t light_pass;
-
- void _bake_directional(int p_idx, int p_level, int p_x, int p_y, int p_z, const Vector3 &p_dir, const Color &p_color, int p_sign);
- void _upscale_light(int p_idx, int p_level);
- void _bake_light(Light *p_light);
-
- Color _cone_trace(const Vector3 &p_from, const Vector3 &p_dir, float p_half_angle);
- void _bake_radiance(int p_idx, int p_level, int p_x, int p_y, int p_z);
-
- friend class GeometryInstance;
-
- Set<GeometryInstance *> geometries;
- friend class Light;
-
- Set<Light *> lights;
-
-protected:
- static void _bind_methods();
-
-public:
- void set_cell_subdiv(int p_subdiv);
- int get_cell_subdiv() const;
-
- void bake();
- void bake_lights();
- void bake_radiance();
-
- void create_debug_mesh(DebugMode p_mode);
-
- virtual Rect3 get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
-
- String get_configuration_warning() const;
-
- BakedLight();
- ~BakedLight();
-};
-
-#if 0
-class BakedLightSampler : public VisualInstance {
- GDCLASS(BakedLightSampler,VisualInstance);
-
-
-public:
-
- enum Param {
- PARAM_RADIUS=VS::BAKED_LIGHT_SAMPLER_RADIUS,
- PARAM_STRENGTH=VS::BAKED_LIGHT_SAMPLER_STRENGTH,
- PARAM_ATTENUATION=VS::BAKED_LIGHT_SAMPLER_ATTENUATION,
- PARAM_DETAIL_RATIO=VS::BAKED_LIGHT_SAMPLER_DETAIL_RATIO,
- PARAM_MAX=VS::BAKED_LIGHT_SAMPLER_MAX
- };
-
-
-
-protected:
-
- RID base;
- float params[PARAM_MAX];
- int resolution;
- static void _bind_methods();
-public:
-
- virtual AABB get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
-
- void set_param(Param p_param,float p_value);
- float get_param(Param p_param) const;
-
- void set_resolution(int p_resolution);
- int get_resolution() const;
-
- BakedLightSampler();
- ~BakedLightSampler();
-};
-
-VARIANT_ENUM_CAST( BakedLightSampler::Param );
-
-#endif
-#endif // BAKED_LIGHT_H
diff --git a/scene/3d/body_shape.cpp b/scene/3d/body_shape.cpp
deleted file mode 100644
index 8403806570..0000000000
--- a/scene/3d/body_shape.cpp
+++ /dev/null
@@ -1,919 +0,0 @@
-/*************************************************************************/
-/* body_shape.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 "body_shape.h"
-#include "scene/resources/box_shape.h"
-#include "scene/resources/capsule_shape.h"
-#include "scene/resources/concave_polygon_shape.h"
-#include "scene/resources/convex_polygon_shape.h"
-#include "scene/resources/plane_shape.h"
-#include "scene/resources/ray_shape.h"
-#include "scene/resources/sphere_shape.h"
-#include "servers/visual_server.h"
-//TODO: Implement CylinderShape and HeightMapShape?
-#include "mesh_instance.h"
-#include "physics_body.h"
-#include "quick_hull.h"
-
-void CollisionShape::_update_body() {
-
- if (!is_inside_tree() || !can_update_body)
- return;
- if (!get_tree()->is_editor_hint())
- return;
- if (get_parent() && get_parent()->cast_to<CollisionObject>())
- get_parent()->cast_to<CollisionObject>()->_update_shapes_from_children();
-}
-
-void CollisionShape::make_convex_from_brothers() {
-
- Node *p = get_parent();
- if (!p)
- return;
-
- for (int i = 0; i < p->get_child_count(); i++) {
-
- Node *n = p->get_child(i);
- if (n->cast_to<MeshInstance>()) {
-
- MeshInstance *mi = n->cast_to<MeshInstance>();
- Ref<Mesh> m = mi->get_mesh();
- if (m.is_valid()) {
-
- Ref<Shape> s = m->create_convex_shape();
- set_shape(s);
- }
- }
- }
-}
-/*
-
-void CollisionShape::_update_indicator() {
-
- while (VisualServer::get_singleton()->mesh_get_surface_count(indicator))
- VisualServer::get_singleton()->mesh_remove_surface(indicator,0);
-
- if (shape.is_null())
- return;
-
- PoolVector<Vector3> points;
- PoolVector<Vector3> normals;
-
- VS::PrimitiveType pt = VS::PRIMITIVE_TRIANGLES;
-
- if (shape->cast_to<RayShape>()) {
-
- RayShape *rs = shape->cast_to<RayShape>();
- points.push_back(Vector3());
- points.push_back(Vector3(0,0,rs->get_length()));
- pt = VS::PRIMITIVE_LINES;
- } else if (shape->cast_to<SphereShape>()) {
-
- //VisualServer *vs=VisualServer::get_singleton();
- SphereShape *shapeptr=shape->cast_to<SphereShape>();
-
-
- Color col(0.4,1.0,1.0,0.5);
-
- int lats=6;
- int lons=12;
- float size=shapeptr->get_radius();
-
-
- for(int i = 1; i <= lats; i++) {
- double lat0 = Math_PI * (-0.5 + (double) (i - 1) / lats);
- double z0 = Math::sin(lat0);
- double zr0 = Math::cos(lat0);
-
- double lat1 = Math_PI * (-0.5 + (double) i / lats);
- double z1 = Math::sin(lat1);
- double zr1 = Math::cos(lat1);
-
- for(int j = lons; j >= 1; j--) {
-
- double lng0 = 2 * Math_PI * (double) (j - 1) / lons;
- double x0 = Math::cos(lng0);
- double y0 = Math::sin(lng0);
-
- double lng1 = 2 * Math_PI * (double) (j) / lons;
- double x1 = Math::cos(lng1);
- double y1 = Math::sin(lng1);
-
- Vector3 v4=Vector3(x0 * zr0, z0, y0 *zr0)*size;
- Vector3 v3=Vector3(x0 * zr1, z1, y0 *zr1)*size;
- Vector3 v2=Vector3(x1 * zr1, z1, y1 *zr1)*size;
- Vector3 v1=Vector3(x1 * zr0, z0, y1 *zr0)*size;
-
- Vector<Vector3> line;
- line.push_back(v1);
- line.push_back(v2);
- line.push_back(v3);
- line.push_back(v4);
-
-
- points.push_back(v1);
- points.push_back(v2);
- points.push_back(v3);
-
- points.push_back(v1);
- points.push_back(v3);
- points.push_back(v4);
-
- normals.push_back(v1.normalized());
- normals.push_back(v2.normalized());
- normals.push_back(v3.normalized());
-
- normals.push_back(v1.normalized());
- normals.push_back(v3.normalized());
- normals.push_back(v4.normalized());
-
- }
- }
- } else if (shape->cast_to<BoxShape>()) {
-
- BoxShape *shapeptr=shape->cast_to<BoxShape>();
-
- for (int i=0;i<6;i++) {
-
-
- Vector3 face_points[4];
-
-
- for (int j=0;j<4;j++) {
-
- float v[3];
- v[0]=1.0;
- v[1]=1-2*((j>>1)&1);
- v[2]=v[1]*(1-2*(j&1));
-
- for (int k=0;k<3;k++) {
-
- if (i<3)
- face_points[j][(i+k)%3]=v[k]*(i>=3?-1:1);
- else
- face_points[3-j][(i+k)%3]=v[k]*(i>=3?-1:1);
- }
- }
- Vector3 normal;
- normal[i%3]=(i>=3?-1:1);
-
- for(int j=0;j<4;j++)
- face_points[j]*=shapeptr->get_extents();
-
- points.push_back(face_points[0]);
- points.push_back(face_points[1]);
- points.push_back(face_points[2]);
-
- points.push_back(face_points[0]);
- points.push_back(face_points[2]);
- points.push_back(face_points[3]);
-
- for(int n=0;n<6;n++)
- normals.push_back(normal);
-
- }
-
- } else if (shape->cast_to<ConvexPolygonShape>()) {
-
- ConvexPolygonShape *shapeptr=shape->cast_to<ConvexPolygonShape>();
-
- Geometry::MeshData md;
- QuickHull::build(Variant(shapeptr->get_points()),md);
-
- for(int i=0;i<md.faces.size();i++) {
-
- for(int j=2;j<md.faces[i].indices.size();j++) {
- points.push_back(md.vertices[md.faces[i].indices[0]]);
- points.push_back(md.vertices[md.faces[i].indices[j-1]]);
- points.push_back(md.vertices[md.faces[i].indices[j]]);
- normals.push_back(md.faces[i].plane.normal);
- normals.push_back(md.faces[i].plane.normal);
- normals.push_back(md.faces[i].plane.normal);
- }
- }
- } else if (shape->cast_to<ConcavePolygonShape>()) {
-
- ConcavePolygonShape *shapeptr=shape->cast_to<ConcavePolygonShape>();
-
- points = shapeptr->get_faces();
- for(int i=0;i<points.size()/3;i++) {
-
- Vector3 n = Plane( points[i*3+0],points[i*3+1],points[i*3+2] ).normal;
- normals.push_back(n);
- normals.push_back(n);
- normals.push_back(n);
- }
-
- } else if (shape->cast_to<CapsuleShape>()) {
-
- CapsuleShape *shapeptr=shape->cast_to<CapsuleShape>();
-
- PoolVector<Plane> planes = Geometry::build_capsule_planes(shapeptr->get_radius(), shapeptr->get_height()/2.0, 12, Vector3::AXIS_Z);
- Geometry::MeshData md = Geometry::build_convex_mesh(planes);
-
- for(int i=0;i<md.faces.size();i++) {
-
- for(int j=2;j<md.faces[i].indices.size();j++) {
- points.push_back(md.vertices[md.faces[i].indices[0]]);
- points.push_back(md.vertices[md.faces[i].indices[j-1]]);
- points.push_back(md.vertices[md.faces[i].indices[j]]);
- normals.push_back(md.faces[i].plane.normal);
- normals.push_back(md.faces[i].plane.normal);
- normals.push_back(md.faces[i].plane.normal);
-
- }
- }
-
- } else if (shape->cast_to<PlaneShape>()) {
-
- PlaneShape *shapeptr=shape->cast_to<PlaneShape>();
-
- Plane p = shapeptr->get_plane();
- Vector3 n1 = p.get_any_perpendicular_normal();
- Vector3 n2 = p.normal.cross(n1).normalized();
-
- Vector3 pface[4]={
- p.normal*p.d+n1*100.0+n2*100.0,
- p.normal*p.d+n1*100.0+n2*-100.0,
- p.normal*p.d+n1*-100.0+n2*-100.0,
- p.normal*p.d+n1*-100.0+n2*100.0,
- };
-
- points.push_back(pface[0]);
- points.push_back(pface[1]);
- points.push_back(pface[2]);
-
- points.push_back(pface[0]);
- points.push_back(pface[2]);
- points.push_back(pface[3]);
-
- normals.push_back(p.normal);
- normals.push_back(p.normal);
- normals.push_back(p.normal);
- normals.push_back(p.normal);
- normals.push_back(p.normal);
- normals.push_back(p.normal);
-
- }
-
- if (!points.size())
- return;
- RID material = VisualServer::get_singleton()->fixed_material_create();
- VisualServer::get_singleton()->fixed_material_set_param(material,VS::FIXED_MATERIAL_PARAM_DIFFUSE,Color(0,0.6,0.7,0.3));
- VisualServer::get_singleton()->fixed_material_set_param(material,VS::FIXED_MATERIAL_PARAM_EMISSION,0.7);
- if (normals.size()==0)
- VisualServer::get_singleton()->material_set_flag(material,VS::MATERIAL_FLAG_UNSHADED,true);
- VisualServer::get_singleton()->material_set_flag(material,VS::MATERIAL_FLAG_DOUBLE_SIDED,true);
- Array d;
- d.resize(VS::ARRAY_MAX);
- d[VS::ARRAY_VERTEX]=points;
- if (normals.size())
- d[VS::ARRAY_NORMAL]=normals;
- VisualServer::get_singleton()->mesh_add_surface(indicator,pt,d);
- VisualServer::get_singleton()->mesh_surface_set_material(indicator,0,material,true);
-
-}
-
-*/
-void CollisionShape::_add_to_collision_object(Object *p_cshape) {
-
- if (unparenting)
- return;
-
- CollisionObject *co = p_cshape->cast_to<CollisionObject>();
- ERR_FAIL_COND(!co);
-
- if (shape.is_valid()) {
-
- update_shape_index = co->get_shape_count();
- co->add_shape(shape, get_transform());
- if (trigger)
- co->set_shape_as_trigger(co->get_shape_count() - 1, true);
- } else {
- update_shape_index = -1;
- }
-}
-
-void CollisionShape::_notification(int p_what) {
-
- switch (p_what) {
-
- case NOTIFICATION_ENTER_TREE: {
- unparenting = false;
- can_update_body = get_tree()->is_editor_hint();
- set_notify_local_transform(!can_update_body);
-
- if (get_tree()->is_debugging_collisions_hint()) {
- _create_debug_shape();
- }
-
- //indicator_instance = VisualServer::get_singleton()->instance_create2(indicator,get_world()->get_scenario());
- } break;
- case NOTIFICATION_TRANSFORM_CHANGED: {
- //VisualServer::get_singleton()->instance_set_transform(indicator_instance,get_global_transform());
- if (can_update_body && updating_body) {
- _update_body();
- }
- } break;
- case NOTIFICATION_EXIT_TREE: {
- /* if (indicator_instance.is_valid()) {
- VisualServer::get_singleton()->free(indicator_instance);
- indicator_instance=RID();
- }*/
- can_update_body = false;
- set_notify_local_transform(false);
- if (debug_shape) {
- debug_shape->queue_delete();
- debug_shape = NULL;
- }
- } break;
- case NOTIFICATION_UNPARENTED: {
- unparenting = true;
- if (can_update_body && updating_body)
- _update_body();
- } break;
- case NOTIFICATION_PARENTED: {
- if (can_update_body && updating_body)
- _update_body();
- } break;
- case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
-
- if (!can_update_body && update_shape_index >= 0) {
-
- CollisionObject *co = get_parent()->cast_to<CollisionObject>();
- if (co) {
- co->set_shape_transform(update_shape_index, get_transform());
- }
- }
-
- } break;
- }
-}
-
-void CollisionShape::resource_changed(RES res) {
-
- update_gizmo();
-}
-
-void CollisionShape::_set_update_shape_index(int p_index) {
-
- update_shape_index = p_index;
-}
-
-int CollisionShape::_get_update_shape_index() const {
-
- return update_shape_index;
-}
-
-String CollisionShape::get_configuration_warning() const {
-
- if (!get_parent()->cast_to<CollisionObject>()) {
- return TTR("CollisionShape only serves to provide a collision shape to a CollisionObject derived node. Please only use it as a child of Area, StaticBody, RigidBody, KinematicBody, etc. to give them a shape.");
- }
-
- if (!shape.is_valid()) {
- return TTR("A shape must be provided for CollisionShape to function. Please create a shape resource for it!");
- }
-
- return String();
-}
-
-void CollisionShape::_bind_methods() {
-
- //not sure if this should do anything
- 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(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(D_METHOD("get_collision_object_shape_index"), &CollisionShape::get_collision_object_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");
-}
-
-void CollisionShape::set_shape(const Ref<Shape> &p_shape) {
-
- if (!shape.is_null())
- shape->unregister_owner(this);
- shape = p_shape;
- if (!shape.is_null())
- shape->register_owner(this);
- update_gizmo();
- if (updating_body) {
- _update_body();
- } else if (can_update_body && update_shape_index >= 0 && is_inside_tree()) {
- CollisionObject *co = get_parent()->cast_to<CollisionObject>();
- if (co) {
- co->set_shape(update_shape_index, p_shape);
- }
- }
-}
-
-Ref<Shape> CollisionShape::get_shape() const {
-
- return shape;
-}
-
-void CollisionShape::set_updating_body(bool p_update) {
- updating_body = p_update;
-}
-
-bool CollisionShape::is_updating_body() const {
-
- return updating_body;
-}
-
-void CollisionShape::set_trigger(bool p_trigger) {
-
- trigger = p_trigger;
- if (updating_body) {
- _update_body();
- } else if (can_update_body && update_shape_index >= 0 && is_inside_tree()) {
- CollisionObject *co = get_parent()->cast_to<CollisionObject>();
- if (co) {
- co->set_shape_as_trigger(update_shape_index, p_trigger);
- }
- }
-}
-
-bool CollisionShape::is_trigger() const {
-
- return trigger;
-}
-
-CollisionShape::CollisionShape() {
-
- //indicator = VisualServer::get_singleton()->mesh_create();
- updating_body = true;
- unparenting = false;
- update_shape_index = -1;
- trigger = false;
- can_update_body = false;
- debug_shape = NULL;
-}
-
-CollisionShape::~CollisionShape() {
- if (!shape.is_null())
- shape->unregister_owner(this);
- //VisualServer::get_singleton()->free(indicator);
-}
-
-void CollisionShape::_create_debug_shape() {
-
- if (debug_shape) {
- debug_shape->queue_delete();
- debug_shape = NULL;
- }
-
- Ref<Shape> s = get_shape();
-
- if (s.is_null())
- return;
-
- Ref<Mesh> mesh = s->get_debug_mesh();
-
- MeshInstance *mi = memnew(MeshInstance);
- mi->set_mesh(mesh);
-
- add_child(mi);
- debug_shape = mi;
-}
-
-#if 0
-#include "body_volume.h"
-
-#include "geometry.h"
-#include "scene/3d/physics_body.h"
-
-#define ADD_TRIANGLE(m_a, m_b, m_c, m_color) \
- { \
- Vector<Vector3> points; \
- points.resize(3); \
- points[0] = m_a; \
- points[1] = m_b; \
- points[2] = m_c; \
- Vector<Color> colors; \
- colors.resize(3); \
- colors[0] = m_color; \
- colors[1] = m_color; \
- colors[2] = m_color; \
- vs->poly_add_primitive(p_indicator, points, Vector<Vector3>(), colors, Vector<Vector3>()); \
- }
-
-
-void CollisionShape::_notification(int p_what) {
-
- switch (p_what) {
- case NOTIFICATION_ENTER_SCENE: {
-
-
- if (get_root_node()->get_editor() && !indicator.is_valid()) {
-
- indicator=VisualServer::get_singleton()->poly_create();
- RID mat=VisualServer::get_singleton()->fixed_material_create();
- VisualServer::get_singleton()->material_set_flag( mat, VisualServer::MATERIAL_FLAG_UNSHADED, true );
- VisualServer::get_singleton()->material_set_flag( mat, VisualServer::MATERIAL_FLAG_WIREFRAME, true );
- VisualServer::get_singleton()->material_set_flag( mat, VisualServer::MATERIAL_FLAG_DOUBLE_SIDED, true );
- VisualServer::get_singleton()->material_set_line_width( mat, 3 );
-
- VisualServer::get_singleton()->poly_set_material(indicator,mat,true);
-
- update_indicator(indicator);
- }
-
- if (indicator.is_valid()) {
-
- indicator_instance=VisualServer::get_singleton()->instance_create2(indicator,get_world()->get_scenario());
- VisualServer::get_singleton()->instance_attach_object_instance_ID(indicator_instance,get_instance_ID());
- }
- volume_changed();
- } break;
- case NOTIFICATION_EXIT_SCENE: {
-
- if (indicator_instance.is_valid()) {
-
- VisualServer::get_singleton()->free(indicator_instance);
- }
- volume_changed();
- } break;
- case NOTIFICATION_TRANSFORM_CHANGED: {
-
- if (indicator_instance.is_valid()) {
-
- VisualServer::get_singleton()->instance_set_transform(indicator_instance,get_global_transform());
- }
- volume_changed();
- } break;
- default: {}
- }
-}
-
-void CollisionShape::volume_changed() {
-
- if (indicator.is_valid())
- update_indicator(indicator);
-
- Object *parent=get_parent();
- if (!parent)
- return;
- PhysicsBody *physics_body=parent->cast_to<PhysicsBody>();
-
- ERR_EXPLAIN("CollisionShape parent is not of type PhysicsBody");
- ERR_FAIL_COND(!physics_body);
-
- physics_body->recompute_child_volumes();
-
-}
-
-RID CollisionShape::_get_visual_instance_rid() const {
-
- return indicator_instance;
-
-}
-
-void CollisionShape::_bind_methods() {
-
- ClassDB::bind_method("_get_visual_instance_rid",&CollisionShape::_get_visual_instance_rid);
-}
-
-CollisionShape::CollisionShape() {
-
-}
-
-CollisionShape::~CollisionShape() {
-
- if (indicator.is_valid()) {
-
- VisualServer::get_singleton()->free(indicator);
- }
-
-}
-
-void CollisionShapeSphere::_set(const String& p_name, const Variant& p_value) {
-
- if (p_name=="radius") {
- radius=p_value;
- volume_changed();
- }
-
-}
-
-Variant CollisionShapeSphere::_get(const String& p_name) const {
-
- if (p_name=="radius") {
- return radius;
- }
-
- return Variant();
-}
-
-void CollisionShapeSphere::_get_property_list( List<PropertyInfo> *p_list) const {
-
- p_list->push_back( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,16384,0.01") );
-}
-
-void CollisionShapeSphere::update_indicator(RID p_indicator) {
-
- VisualServer *vs=VisualServer::get_singleton();
-
- vs->poly_clear(p_indicator);
- Color col(0.4,1.0,1.0,0.5);
-
- int lats=6;
- int lons=12;
- float size=radius;
-
- for(int i = 1; i <= lats; i++) {
- double lat0 = Math_PI * (-0.5 + (double) (i - 1) / lats);
- double z0 = Math::sin(lat0);
- double zr0 = Math::cos(lat0);
-
- double lat1 = Math_PI * (-0.5 + (double) i / lats);
- double z1 = Math::sin(lat1);
- double zr1 = Math::cos(lat1);
-
- for(int j = lons; j >= 1; j--) {
-
- double lng0 = 2 * Math_PI * (double) (j - 1) / lons;
- double x0 = Math::cos(lng0);
- double y0 = Math::sin(lng0);
-
- double lng1 = 2 * Math_PI * (double) (j) / lons;
- double x1 = Math::cos(lng1);
- double y1 = Math::sin(lng1);
-
- Vector3 v4=Vector3(x0 * zr0, z0, y0 *zr0)*size;
- Vector3 v3=Vector3(x0 * zr1, z1, y0 *zr1)*size;
- Vector3 v2=Vector3(x1 * zr1, z1, y1 *zr1)*size;
- Vector3 v1=Vector3(x1 * zr0, z0, y1 *zr0)*size;
-
- Vector<Vector3> line;
- line.push_back(v1);
- line.push_back(v2);
- line.push_back(v3);
- line.push_back(v4);
-
- Vector<Color> cols;
- cols.push_back(col);
- cols.push_back(col);
- cols.push_back(col);
- cols.push_back(col);
-
-
- VisualServer::get_singleton()->poly_add_primitive(p_indicator,line,Vector<Vector3>(),cols,Vector<Vector3>());
- }
- }
-}
-
-void CollisionShapeSphere::append_to_volume(Ref<Shape> p_volume) {
-
- p_volume->add_sphere_shape(radius,get_transform());
-}
-
-
-CollisionShapeSphere::CollisionShapeSphere() {
-
- radius=1.0;
-}
-
-/* BOX */
-
-
-void CollisionShapeBox::_set(const String& p_name, const Variant& p_value) {
-
- if (p_name=="half_extents") {
- half_extents=p_value;
- volume_changed();
- }
-
-}
-
-Variant CollisionShapeBox::_get(const String& p_name) const {
-
- if (p_name=="half_extents") {
- return half_extents;
- }
-
- return Variant();
-}
-
-void CollisionShapeBox::_get_property_list( List<PropertyInfo> *p_list) const {
-
- p_list->push_back( PropertyInfo(Variant::VECTOR3,"half_extents" ) );
-}
-
-
-void CollisionShapeBox::update_indicator(RID p_indicator) {
-
- VisualServer *vs=VisualServer::get_singleton();
-
- vs->poly_clear(p_indicator);
- Color col(0.4,1.0,1.0,0.5);
-
-
- for (int i=0;i<6;i++) {
-
-
- Vector3 face_points[4];
-
- for (int j=0;j<4;j++) {
-
- float v[3];
- v[0]=1.0;
- v[1]=1-2*((j>>1)&1);
- v[2]=v[1]*(1-2*(j&1));
-
- for (int k=0;k<3;k++) {
-
- if (i<3)
- face_points[j][(i+k)%3]=v[k]*(i>=3?-1:1);
- else
- face_points[3-j][(i+k)%3]=v[k]*(i>=3?-1:1);
- }
- }
-
- for(int j=0;j<4;j++)
- face_points[i]*=half_extents;
-
- ADD_TRIANGLE(face_points[0],face_points[1],face_points[2],col);
- ADD_TRIANGLE(face_points[2],face_points[3],face_points[0],col);
-
- }
-}
-
-void CollisionShapeBox::append_to_volume(Ref<Shape> p_volume) {
-
- p_volume->add_box_shape(half_extents,get_transform());
-}
-
-
-CollisionShapeBox::CollisionShapeBox() {
-
- half_extents=Vector3(1,1,1);
-}
-
-/* CYLINDER */
-
-
-void CollisionShapeCylinder::_set(const String& p_name, const Variant& p_value) {
-
- if (p_name=="radius") {
- radius=p_value;
- volume_changed();
- }
- if (p_name=="height") {
- height=p_value;
- volume_changed();
- }
-
-}
-
-Variant CollisionShapeCylinder::_get(const String& p_name) const {
-
- if (p_name=="radius") {
- return radius;
- }
- if (p_name=="height") {
- return height;
- }
- return Variant();
-}
-
-void CollisionShapeCylinder::_get_property_list( List<PropertyInfo> *p_list) const {
-
- p_list->push_back( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,16384,0.01") );
- p_list->push_back( PropertyInfo(Variant::REAL,"height",PROPERTY_HINT_RANGE,"0.01,16384,0.01") );
-}
-
-
-void CollisionShapeCylinder::update_indicator(RID p_indicator) {
-
- VisualServer *vs=VisualServer::get_singleton();
-
- vs->poly_clear(p_indicator);
- Color col(0.4,1.0,1.0,0.5);
-
- PoolVector<Plane> planes = Geometry::build_cylinder_planes(radius, height, 12, Vector3::AXIS_Z);
- Geometry::MeshData md = Geometry::build_convex_mesh(planes);
-
- for(int i=0;i<md.faces.size();i++) {
-
- for(int j=2;j<md.faces[i].indices.size();j++) {
- ADD_TRIANGLE(md.vertices[md.faces[i].indices[0]],md.vertices[md.faces[i].indices[j-1]],md.vertices[md.faces[i].indices[j]],col);
- }
- }
-
-}
-
-void CollisionShapeCylinder::append_to_volume(Ref<Shape> p_volume) {
-
- p_volume->add_cylinder_shape(radius,height*2.0,get_transform());
-}
-
-
-CollisionShapeCylinder::CollisionShapeCylinder() {
-
- height=1;
- radius=1;
-}
-
-/* CAPSULE */
-
-
-void CollisionShapeCapsule::_set(const String& p_name, const Variant& p_value) {
-
- if (p_name=="radius") {
- radius=p_value;
- volume_changed();
- }
-
- if (p_name=="height") {
- height=p_value;
- volume_changed();
- }
-
-}
-
-Variant CollisionShapeCapsule::_get(const String& p_name) const {
-
- if (p_name=="radius") {
- return radius;
- }
- if (p_name=="height") {
- return height;
- }
- return Variant();
-}
-
-void CollisionShapeCapsule::_get_property_list( List<PropertyInfo> *p_list) const {
-
- p_list->push_back( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,16384,0.01") );
- p_list->push_back( PropertyInfo(Variant::REAL,"height",PROPERTY_HINT_RANGE,"0.01,16384,0.01") );
-}
-
-
-void CollisionShapeCapsule::update_indicator(RID p_indicator) {
-
- VisualServer *vs=VisualServer::get_singleton();
-
- vs->poly_clear(p_indicator);
- Color col(0.4,1.0,1.0,0.5);
-
- PoolVector<Plane> planes = Geometry::build_capsule_planes(radius, height, 12, 3, Vector3::AXIS_Z);
- Geometry::MeshData md = Geometry::build_convex_mesh(planes);
-
- for(int i=0;i<md.faces.size();i++) {
-
- for(int j=2;j<md.faces[i].indices.size();j++) {
- ADD_TRIANGLE(md.vertices[md.faces[i].indices[0]],md.vertices[md.faces[i].indices[j-1]],md.vertices[md.faces[i].indices[j]],col);
- }
- }
-
-}
-
-void CollisionShapeCapsule::append_to_volume(Ref<Shape> p_volume) {
-
-
- p_volume->add_capsule_shape(radius,height,get_transform());
-}
-
-
-CollisionShapeCapsule::CollisionShapeCapsule() {
-
- height=1;
- radius=1;
-}
-#endif
diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp
index d8cb2dfdac..b55b788b54 100644
--- a/scene/3d/bone_attachment.cpp
+++ b/scene/3d/bone_attachment.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/bone_attachment.h b/scene/3d/bone_attachment.h
index 194d6b4f94..65908d98a8 100644
--- a/scene/3d/bone_attachment.h
+++ b/scene/3d/bone_attachment.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp
index 540edd8a2a..3c5eb21d38 100644
--- a/scene/3d/camera.cpp
+++ b/scene/3d/camera.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -93,6 +94,8 @@ bool Camera::_set(const StringName &p_name, const Variant &p_value) {
set_cull_mask(p_value);
} else if (p_name == "environment") {
set_environment(p_value);
+ } else if (p_name == "doppler/tracking") {
+ set_doppler_tracking(DopplerTracking(int(p_value)));
} else
return false;
@@ -130,6 +133,8 @@ bool Camera::_get(const StringName &p_name, Variant &r_ret) const {
r_ret = get_v_offset();
} else if (p_name == "environment") {
r_ret = get_environment();
+ } else if (p_name == "doppler/tracking") {
+ r_ret = get_doppler_tracking();
} else
return false;
@@ -170,6 +175,7 @@ void Camera::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"));
p_list->push_back(PropertyInfo(Variant::REAL, "h_offset"));
p_list->push_back(PropertyInfo(Variant::REAL, "v_offset"));
+ p_list->push_back(PropertyInfo(Variant::INT, "doppler/tracking", PROPERTY_HINT_ENUM, "Disabled,Idle,Fixed"));
}
void Camera::_update_camera() {
@@ -208,6 +214,9 @@ void Camera::_notification(int p_what) {
case NOTIFICATION_TRANSFORM_CHANGED: {
_request_camera_update();
+ if (doppler_tracking != DOPPLER_TRACKING_DISABLED) {
+ velocity_tracker->update_position(get_global_transform().origin);
+ }
} break;
case NOTIFICATION_EXIT_WORLD: {
@@ -506,6 +515,22 @@ Camera::KeepAspect Camera::get_keep_aspect_mode() const {
return keep_aspect;
}
+void Camera::set_doppler_tracking(DopplerTracking p_tracking) {
+
+ if (doppler_tracking == p_tracking)
+ return;
+
+ doppler_tracking = p_tracking;
+ if (p_tracking != DOPPLER_TRACKING_DISABLED) {
+ velocity_tracker->set_track_fixed_step(doppler_tracking == DOPPLER_TRACKING_FIXED_STEP);
+ velocity_tracker->reset(get_global_transform().origin);
+ }
+}
+
+Camera::DopplerTracking Camera::get_doppler_tracking() const {
+ return doppler_tracking;
+}
+
void Camera::_bind_methods() {
ClassDB::bind_method(D_METHOD("project_ray_normal", "screen_point"), &Camera::project_ray_normal);
@@ -531,10 +556,12 @@ void Camera::_bind_methods() {
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_environment", "env"), &Camera::set_environment);
+ ClassDB::bind_method(D_METHOD("get_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("set_doppler_tracking", "mode"), &Camera::set_doppler_tracking);
+ ClassDB::bind_method(D_METHOD("get_doppler_tracking"), &Camera::get_doppler_tracking);
//ClassDB::bind_method(D_METHOD("_camera_make_current"),&Camera::_camera_make_current );
BIND_CONSTANT(PROJECTION_PERSPECTIVE);
@@ -542,6 +569,10 @@ void Camera::_bind_methods() {
BIND_CONSTANT(KEEP_WIDTH);
BIND_CONSTANT(KEEP_HEIGHT);
+
+ BIND_CONSTANT(DOPPLER_TRACKING_DISABLED)
+ BIND_CONSTANT(DOPPLER_TRACKING_IDLE_STEP)
+ BIND_CONSTANT(DOPPLER_TRACKING_FIXED_STEP)
}
float Camera::get_fov() const {
@@ -615,6 +646,14 @@ float Camera::get_h_offset() const {
return h_offset;
}
+Vector3 Camera::get_doppler_tracked_velocity() const {
+
+ if (doppler_tracking != DOPPLER_TRACKING_DISABLED) {
+ return velocity_tracker->get_tracked_linear_velocity();
+ } else {
+ return Vector3();
+ }
+}
Camera::Camera() {
camera = VisualServer::get_singleton()->camera_create();
@@ -625,13 +664,15 @@ Camera::Camera() {
current = false;
force_change = false;
mode = PROJECTION_PERSPECTIVE;
- set_perspective(60.0, 0.1, 100.0);
+ set_perspective(65.0, 0.1, 100.0);
keep_aspect = KEEP_HEIGHT;
layers = 0xfffff;
v_offset = 0;
h_offset = 0;
VisualServer::get_singleton()->camera_set_cull_mask(camera, layers);
//active=false;
+ velocity_tracker.instance();
+ doppler_tracking = DOPPLER_TRACKING_DISABLED;
set_notify_transform(true);
}
diff --git a/scene/3d/camera.h b/scene/3d/camera.h
index 3c31b6beeb..70849791e5 100644
--- a/scene/3d/camera.h
+++ b/scene/3d/camera.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,6 +31,7 @@
#define CAMERA_H
#include "scene/3d/spatial.h"
+#include "scene/3d/spatial_velocity_tracker.h"
#include "scene/main/viewport.h"
#include "scene/resources/environment.h"
/**
@@ -51,6 +53,12 @@ public:
KEEP_HEIGHT
};
+ enum DopplerTracking {
+ DOPPLER_TRACKING_DISABLED,
+ DOPPLER_TRACKING_IDLE_STEP,
+ DOPPLER_TRACKING_FIXED_STEP
+ };
+
private:
bool force_change;
bool current;
@@ -79,6 +87,9 @@ private:
friend class Viewport;
void _update_audio_listener_state();
+ DopplerTracking doppler_tracking;
+ Ref<SpatialVelocityTracker> velocity_tracker;
+
protected:
void _update_camera();
virtual void _request_camera_update();
@@ -115,9 +126,9 @@ public:
virtual Transform get_camera_transform() const;
- Vector3 project_ray_normal(const Point2 &p_point) const;
- Vector3 project_ray_origin(const Point2 &p_point) const;
- Vector3 project_local_ray_normal(const Point2 &p_point) const;
+ Vector3 project_ray_normal(const Point2 &p_pos) const;
+ Vector3 project_ray_origin(const Point2 &p_pos) const;
+ Vector3 project_local_ray_normal(const Point2 &p_pos) const;
Point2 unproject_position(const Vector3 &p_pos) const;
bool is_position_behind(const Vector3 &p_pos) const;
Vector3 project_position(const Point2 &p_point) const;
@@ -139,11 +150,17 @@ public:
void set_h_offset(float p_offset);
float get_h_offset() const;
+ void set_doppler_tracking(DopplerTracking p_tracking);
+ DopplerTracking get_doppler_tracking() const;
+
+ Vector3 get_doppler_tracked_velocity() const;
+
Camera();
~Camera();
};
VARIANT_ENUM_CAST(Camera::Projection);
VARIANT_ENUM_CAST(Camera::KeepAspect);
+VARIANT_ENUM_CAST(Camera::DopplerTracking);
#endif
diff --git a/scene/3d/character_camera.cpp b/scene/3d/character_camera.cpp
index edd97eaa6d..065e21fccd 100644
--- a/scene/3d/character_camera.cpp
+++ b/scene/3d/character_camera.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/character_camera.h b/scene/3d/character_camera.h
index 464fa5c235..c3a1c70d5e 100644
--- a/scene/3d/character_camera.h
+++ b/scene/3d/character_camera.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp
index c3e19c4b81..1aba26673c 100644
--- a/scene/3d/collision_object.cpp
+++ b/scene/3d/collision_object.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,17 +30,6 @@
#include "collision_object.h"
#include "scene/scene_string_names.h"
#include "servers/physics_server.h"
-void CollisionObject::_update_shapes_from_children() {
-
- shapes.clear();
- for (int i = 0; i < get_child_count(); i++) {
-
- Node *n = get_child(i);
- n->call("_add_to_collision_object", this);
- }
-
- _update_shapes();
-}
void CollisionObject::_notification(int p_what) {
@@ -86,92 +76,7 @@ void CollisionObject::_notification(int p_what) {
}
}
-void CollisionObject::_update_shapes() {
-
- if (!rid.is_valid())
- return;
-
- if (area)
- PhysicsServer::get_singleton()->area_clear_shapes(rid);
- else
- PhysicsServer::get_singleton()->body_clear_shapes(rid);
-
- for (int i = 0; i < shapes.size(); i++) {
-
- if (shapes[i].shape.is_null())
- continue;
- if (area)
- PhysicsServer::get_singleton()->area_add_shape(rid, shapes[i].shape->get_rid(), shapes[i].xform);
- else {
- PhysicsServer::get_singleton()->body_add_shape(rid, shapes[i].shape->get_rid(), shapes[i].xform);
- if (shapes[i].trigger)
- PhysicsServer::get_singleton()->body_set_shape_as_trigger(rid, i, shapes[i].trigger);
- }
- }
-}
-
-bool CollisionObject::_set(const StringName &p_name, const Variant &p_value) {
- String name = p_name;
-
- if (name == "shape_count") {
-
- shapes.resize(p_value);
- _update_shapes();
- _change_notify();
-
- } else if (name.begins_with("shapes/")) {
-
- int idx = name.get_slicec('/', 1).to_int();
- String what = name.get_slicec('/', 2);
- if (what == "shape")
- set_shape(idx, RefPtr(p_value));
- else if (what == "transform")
- set_shape_transform(idx, p_value);
- else if (what == "trigger")
- set_shape_as_trigger(idx, p_value);
-
- } else
- return false;
-
- return true;
-}
-
-bool CollisionObject::_get(const StringName &p_name, Variant &r_ret) const {
-
- String name = p_name;
-
- if (name == "shape_count") {
- r_ret = shapes.size();
- } else if (name.begins_with("shapes/")) {
-
- int idx = name.get_slicec('/', 1).to_int();
- String what = name.get_slicec('/', 2);
- if (what == "shape")
- r_ret = get_shape(idx);
- else if (what == "transform")
- r_ret = get_shape_transform(idx);
- else if (what == "trigger")
- r_ret = is_shape_set_as_trigger(idx);
-
- } else
- return false;
-
- return true;
-}
-
-void CollisionObject::_get_property_list(List<PropertyInfo> *p_list) const {
-
- p_list->push_back(PropertyInfo(Variant::INT, "shape_count", PROPERTY_HINT_RANGE, "0,256,1", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE));
-
- for (int i = 0; i < shapes.size(); i++) {
- String path = "shapes/" + itos(i) + "/";
- p_list->push_back(PropertyInfo(Variant::OBJECT, path + "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE));
- p_list->push_back(PropertyInfo(Variant::TRANSFORM, path + "transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE));
- p_list->push_back(PropertyInfo(Variant::BOOL, path + "trigger", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE));
- }
-}
-
-void CollisionObject::_input_event(Node *p_camera, const InputEvent &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape) {
+void CollisionObject::_input_event(Node *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape) {
if (get_script_instance()) {
get_script_instance()->call(SceneStringNames::get_singleton()->_input_event, p_camera, p_input_event, p_pos, p_normal, p_shape);
@@ -218,25 +123,30 @@ bool CollisionObject::is_ray_pickable() const {
void CollisionObject::_bind_methods() {
- 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")));
+ ClassDB::bind_method(D_METHOD("create_shape_owner", "owner"), &CollisionObject::create_shape_owner);
+ ClassDB::bind_method(D_METHOD("remove_shape_owner", "owner_id"), &CollisionObject::remove_shape_owner);
+ ClassDB::bind_method(D_METHOD("get_shape_owners"), &CollisionObject::_get_shape_owners);
+ ClassDB::bind_method(D_METHOD("shape_owner_set_transform", "owner_id", "transform"), &CollisionObject::shape_owner_set_transform);
+ ClassDB::bind_method(D_METHOD("shape_owner_get_transform", "owner_id"), &CollisionObject::shape_owner_get_transform);
+ ClassDB::bind_method(D_METHOD("shape_owner_get_owner", "owner_id"), &CollisionObject::shape_owner_get_owner);
+ ClassDB::bind_method(D_METHOD("shape_owner_set_disabled", "owner_id", "disabled"), &CollisionObject::shape_owner_set_disabled);
+ ClassDB::bind_method(D_METHOD("is_shape_owner_disabled", "owner_id"), &CollisionObject::is_shape_owner_disabled);
+ ClassDB::bind_method(D_METHOD("shape_owner_add_shape", "owner_id", "shape"), &CollisionObject::shape_owner_add_shape);
+ ClassDB::bind_method(D_METHOD("shape_owner_get_shape_count", "owner_id"), &CollisionObject::shape_owner_get_shape_count);
+ ClassDB::bind_method(D_METHOD("shape_owner_get_shape", "owner_id", "shape_id"), &CollisionObject::shape_owner_get_shape);
+ ClassDB::bind_method(D_METHOD("shape_owner_get_shape_index", "owner_id", "shape_id"), &CollisionObject::shape_owner_get_shape_index);
+ ClassDB::bind_method(D_METHOD("shape_owner_remove_shape", "owner_id", "shape_id"), &CollisionObject::shape_owner_remove_shape);
+ ClassDB::bind_method(D_METHOD("shape_owner_clear_shapes", "owner_id"), &CollisionObject::shape_owner_clear_shapes);
+ ClassDB::bind_method(D_METHOD("shape_find_owner", "shape_index"), &CollisionObject::shape_find_owner);
+
+ BIND_VMETHOD(MethodInfo("_input_event", PropertyInfo(Variant::OBJECT, "camera"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"), 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::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"), 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"));
@@ -244,72 +154,186 @@ void CollisionObject::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "input_capture_on_drag"), "set_capture_input_on_drag", "get_capture_input_on_drag");
}
-void CollisionObject::add_shape(const Ref<Shape> &p_shape, const Transform &p_transform) {
+uint32_t CollisionObject::create_shape_owner(Object *p_owner) {
+
+ ShapeData sd;
+ uint32_t id;
+
+ if (shapes.size() == 0) {
+ id = 1;
+ } else {
+ id = shapes.back()->key() + 1;
+ }
+
+ sd.owner = p_owner;
- ShapeData sdata;
- sdata.shape = p_shape;
- sdata.xform = p_transform;
- shapes.push_back(sdata);
- _update_shapes();
+ shapes[id] = sd;
+
+ return id;
}
-int CollisionObject::get_shape_count() const {
- return shapes.size();
+void CollisionObject::remove_shape_owner(uint32_t owner) {
+
+ ERR_FAIL_COND(!shapes.has(owner));
+
+ shape_owner_clear_shapes(owner);
+
+ shapes.erase(owner);
}
-void CollisionObject::set_shape(int p_shape_idx, const Ref<Shape> &p_shape) {
- ERR_FAIL_INDEX(p_shape_idx, shapes.size());
- shapes[p_shape_idx].shape = p_shape;
- _update_shapes();
+void CollisionObject::shape_owner_set_disabled(uint32_t p_owner, bool p_disabled) {
+ ERR_FAIL_COND(!shapes.has(p_owner));
+
+ ShapeData &sd = shapes[p_owner];
+ sd.disabled = p_disabled;
+ for (int i = 0; i < sd.shapes.size(); i++) {
+ if (area) {
+ PhysicsServer::get_singleton()->area_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
+ } else {
+ PhysicsServer::get_singleton()->body_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
+ }
+ }
+}
+
+bool CollisionObject::is_shape_owner_disabled(uint32_t p_owner) const {
+
+ ERR_FAIL_COND_V(!shapes.has(p_owner), false);
+
+ return shapes[p_owner].disabled;
+}
+
+void CollisionObject::get_shape_owners(List<uint32_t> *r_owners) {
+
+ for (Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) {
+ r_owners->push_back(E->key());
+ }
+}
+
+Array CollisionObject::_get_shape_owners() {
+
+ Array ret;
+ for (Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) {
+ ret.push_back(E->key());
+ }
+
+ return ret;
+}
+
+void CollisionObject::shape_owner_set_transform(uint32_t p_owner, const Transform &p_transform) {
+
+ ERR_FAIL_COND(!shapes.has(p_owner));
+
+ ShapeData &sd = shapes[p_owner];
+ sd.xform = p_transform;
+ for (int i = 0; i < sd.shapes.size(); i++) {
+ if (area) {
+ PhysicsServer::get_singleton()->area_set_shape_transform(rid, sd.shapes[i].index, p_transform);
+ } else {
+ PhysicsServer::get_singleton()->body_set_shape_transform(rid, sd.shapes[i].index, p_transform);
+ }
+ }
+}
+Transform CollisionObject::shape_owner_get_transform(uint32_t p_owner) const {
+
+ ERR_FAIL_COND_V(!shapes.has(p_owner), Transform());
+
+ return shapes[p_owner].xform;
}
-void CollisionObject::set_shape_transform(int p_shape_idx, const Transform &p_transform) {
+Object *CollisionObject::shape_owner_get_owner(uint32_t p_owner) const {
- ERR_FAIL_INDEX(p_shape_idx, shapes.size());
- shapes[p_shape_idx].xform = p_transform;
+ ERR_FAIL_COND_V(!shapes.has(p_owner), NULL);
- _update_shapes();
+ return shapes[p_owner].owner;
}
-Ref<Shape> CollisionObject::get_shape(int p_shape_idx) const {
+void CollisionObject::shape_owner_add_shape(uint32_t p_owner, const Ref<Shape> &p_shape) {
+
+ ERR_FAIL_COND(!shapes.has(p_owner));
+ ERR_FAIL_COND(p_shape.is_null());
+
+ ShapeData &sd = shapes[p_owner];
+ ShapeData::ShapeBase s;
+ s.index = total_subshapes;
+ s.shape = p_shape;
+ if (area) {
+ PhysicsServer::get_singleton()->area_add_shape(rid, p_shape->get_rid(), sd.xform);
+ } else {
+ PhysicsServer::get_singleton()->body_add_shape(rid, p_shape->get_rid(), sd.xform);
+ }
+ sd.shapes.push_back(s);
- ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), Ref<Shape>());
- return shapes[p_shape_idx].shape;
+ total_subshapes++;
}
-Transform CollisionObject::get_shape_transform(int p_shape_idx) const {
+int CollisionObject::shape_owner_get_shape_count(uint32_t p_owner) const {
- ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), Transform());
- return shapes[p_shape_idx].xform;
+ ERR_FAIL_COND_V(!shapes.has(p_owner), 0);
+
+ return shapes[p_owner].shapes.size();
}
-void CollisionObject::remove_shape(int p_shape_idx) {
+Ref<Shape> CollisionObject::shape_owner_get_shape(uint32_t p_owner, int p_shape) const {
- ERR_FAIL_INDEX(p_shape_idx, shapes.size());
- shapes.remove(p_shape_idx);
+ ERR_FAIL_COND_V(!shapes.has(p_owner), Ref<Shape>());
+ ERR_FAIL_INDEX_V(p_shape, shapes[p_owner].shapes.size(), Ref<Shape>());
- _update_shapes();
+ return shapes[p_owner].shapes[p_shape].shape;
}
+int CollisionObject::shape_owner_get_shape_index(uint32_t p_owner, int p_shape) const {
+
+ ERR_FAIL_COND_V(!shapes.has(p_owner), -1);
+ ERR_FAIL_INDEX_V(p_shape, shapes[p_owner].shapes.size(), -1);
+
+ return shapes[p_owner].shapes[p_shape].index;
+}
+
+void CollisionObject::shape_owner_remove_shape(uint32_t p_owner, int p_shape) {
-void CollisionObject::clear_shapes() {
+ ERR_FAIL_COND(!shapes.has(p_owner));
+ ERR_FAIL_INDEX(p_shape, shapes[p_owner].shapes.size());
- shapes.clear();
+ int index_to_remove = shapes[p_owner].shapes[p_shape].index;
+ if (area) {
+ PhysicsServer::get_singleton()->area_remove_shape(rid, index_to_remove);
+ } else {
+ PhysicsServer::get_singleton()->body_remove_shape(rid, index_to_remove);
+ }
+
+ shapes[p_owner].shapes.remove(p_shape);
+
+ for (Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) {
+ for (int i = 0; i < E->get().shapes.size(); i++) {
+ if (E->get().shapes[i].index > index_to_remove) {
+ E->get().shapes[i].index -= 1;
+ }
+ }
+ }
- _update_shapes();
+ total_subshapes--;
}
-void CollisionObject::set_shape_as_trigger(int p_shape_idx, bool p_trigger) {
+void CollisionObject::shape_owner_clear_shapes(uint32_t p_owner) {
- ERR_FAIL_INDEX(p_shape_idx, shapes.size());
- shapes[p_shape_idx].trigger = p_trigger;
- if (!area && rid.is_valid()) {
+ ERR_FAIL_COND(!shapes.has(p_owner));
- PhysicsServer::get_singleton()->body_set_shape_as_trigger(rid, p_shape_idx, p_trigger);
+ while (shape_owner_get_shape_count(p_owner) > 0) {
+ shape_owner_remove_shape(p_owner, 0);
}
}
-bool CollisionObject::is_shape_set_as_trigger(int p_shape_idx) const {
+uint32_t CollisionObject::shape_find_owner(int p_shape_index) const {
- ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), false);
- return shapes[p_shape_idx].trigger;
+ ERR_FAIL_INDEX_V(p_shape_index, total_subshapes, 0);
+
+ for (const Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) {
+ for (int i = 0; i < E->get().shapes.size(); i++) {
+ if (E->get().shapes[i].index == p_shape_index) {
+ return E->key();
+ }
+ }
+ }
+
+ //in theory it should be unreachable
+ return 0;
}
CollisionObject::CollisionObject(RID p_rid, bool p_area) {
@@ -319,10 +343,12 @@ CollisionObject::CollisionObject(RID p_rid, bool p_area) {
capture_input_on_drag = false;
ray_pickable = true;
set_notify_transform(true);
+ total_subshapes = 0;
+
if (p_area) {
- PhysicsServer::get_singleton()->area_attach_object_instance_ID(rid, get_instance_ID());
+ PhysicsServer::get_singleton()->area_attach_object_instance_id(rid, get_instance_id());
} else {
- PhysicsServer::get_singleton()->body_attach_object_instance_ID(rid, get_instance_ID());
+ PhysicsServer::get_singleton()->body_attach_object_instance_id(rid, get_instance_id());
}
//set_transform_notify(true);
}
diff --git a/scene/3d/collision_object.h b/scene/3d/collision_object.h
index 9b124cf277..6c13e5d505 100644
--- a/scene/3d/collision_object.h
+++ b/scene/3d/collision_object.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -40,50 +41,64 @@ class CollisionObject : public Spatial {
RID rid;
struct ShapeData {
+
+ Object *owner;
Transform xform;
- Ref<Shape> shape;
- bool trigger;
+ struct ShapeBase {
+ Ref<Shape> shape;
+ int index;
+ };
+
+ Vector<ShapeBase> shapes;
+ bool disabled;
ShapeData() {
- trigger = false;
+ disabled = false;
+ owner = NULL;
}
};
+ int total_subshapes;
+
+ Map<uint32_t, ShapeData> shapes;
+
bool capture_input_on_drag;
bool ray_pickable;
- Vector<ShapeData> shapes;
void _update_pickable();
- void _update_shapes();
-
- friend class CollisionShape;
- friend class CollisionPolygon;
- void _update_shapes_from_children();
protected:
CollisionObject(RID p_rid, bool p_area);
void _notification(int p_what);
- 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;
static void _bind_methods();
friend class Viewport;
- virtual void _input_event(Node *p_camera, const InputEvent &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape);
+ virtual void _input_event(Node *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape);
virtual void _mouse_enter();
virtual void _mouse_exit();
public:
- void add_shape(const Ref<Shape> &p_shape, const Transform &p_transform = Transform());
- int get_shape_count() const;
- void set_shape(int p_shape_idx, const Ref<Shape> &p_shape);
- void set_shape_transform(int p_shape_idx, const Transform &p_transform);
- Ref<Shape> get_shape(int p_shape_idx) const;
- Transform get_shape_transform(int p_shape_idx) const;
- void remove_shape(int p_shape_idx);
- void clear_shapes();
- void set_shape_as_trigger(int p_shape_idx, bool p_trigger);
- bool is_shape_set_as_trigger(int p_shape_idx) const;
+ uint32_t create_shape_owner(Object *p_owner);
+ void remove_shape_owner(uint32_t owner);
+ void get_shape_owners(List<uint32_t> *r_owners);
+ Array _get_shape_owners();
+
+ void shape_owner_set_transform(uint32_t p_owner, const Transform &p_transform);
+ Transform shape_owner_get_transform(uint32_t p_owner) const;
+ Object *shape_owner_get_owner(uint32_t p_owner) const;
+
+ void shape_owner_set_disabled(uint32_t p_owner, bool p_disabled);
+ bool is_shape_owner_disabled(uint32_t p_owner) const;
+
+ void shape_owner_add_shape(uint32_t p_owner, const Ref<Shape> &p_shape);
+ int shape_owner_get_shape_count(uint32_t p_owner) const;
+ Ref<Shape> shape_owner_get_shape(uint32_t p_owner, int p_shape) const;
+ int shape_owner_get_shape_index(uint32_t p_owner, int p_shape) const;
+
+ void shape_owner_remove_shape(uint32_t p_owner, int p_shape);
+ void shape_owner_clear_shapes(uint32_t p_owner);
+
+ uint32_t shape_find_owner(int p_shape_index) const;
void set_ray_pickable(bool p_ray_pickable);
bool is_ray_pickable() const;
diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp
index 12dab067d0..0c61c96d07 100644
--- a/scene/3d/collision_polygon.cpp
+++ b/scene/3d/collision_polygon.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,186 +33,82 @@
#include "scene/resources/concave_polygon_shape.h"
#include "scene/resources/convex_polygon_shape.h"
-void CollisionPolygon::_add_to_collision_object(Object *p_obj) {
+void CollisionPolygon::_build_polygon() {
- if (!can_update_body)
+ if (!parent)
return;
- CollisionObject *co = p_obj->cast_to<CollisionObject>();
- ERR_FAIL_COND(!co);
+ parent->shape_owner_clear_shapes(owner_id);
if (polygon.size() == 0)
return;
- bool solids = build_mode == BUILD_SOLIDS;
-
Vector<Vector<Vector2> > decomp = Geometry::decompose_polygon(polygon);
if (decomp.size() == 0)
return;
- if (true || solids) {
-
- //here comes the sun, lalalala
- //decompose concave into multiple convex polygons and add them
- shape_from = co->get_shape_count();
- for (int i = 0; i < decomp.size(); i++) {
- Ref<ConvexPolygonShape> convex = memnew(ConvexPolygonShape);
- PoolVector<Vector3> cp;
- int cs = decomp[i].size();
- cp.resize(cs * 2);
- {
- PoolVector<Vector3>::Write w = cp.write();
- int idx = 0;
- for (int j = 0; j < cs; j++) {
-
- Vector2 d = decomp[i][j];
- w[idx++] = Vector3(d.x, d.y, depth * 0.5);
- w[idx++] = Vector3(d.x, d.y, -depth * 0.5);
- }
+ //here comes the sun, lalalala
+ //decompose concave into multiple convex polygons and add them
+
+ for (int i = 0; i < decomp.size(); i++) {
+ Ref<ConvexPolygonShape> convex = memnew(ConvexPolygonShape);
+ PoolVector<Vector3> cp;
+ int cs = decomp[i].size();
+ cp.resize(cs * 2);
+ {
+ PoolVector<Vector3>::Write w = cp.write();
+ int idx = 0;
+ for (int j = 0; j < cs; j++) {
+
+ Vector2 d = decomp[i][j];
+ w[idx++] = Vector3(d.x, d.y, depth * 0.5);
+ w[idx++] = Vector3(d.x, d.y, -depth * 0.5);
}
-
- convex->set_points(cp);
- co->add_shape(convex, get_transform());
- }
- shape_to = co->get_shape_count() - 1;
- if (shape_to < shape_from) {
- shape_from = -1;
- shape_to = -1;
- }
-
- } else {
-#if 0
- Ref<ConcavePolygonShape> concave = memnew( ConcavePolygonShape );
-
- PoolVector<Vector2> segments;
- segments.resize(polygon.size()*2);
- PoolVector<Vector2>::Write w=segments.write();
-
- for(int i=0;i<polygon.size();i++) {
- w[(i<<1)+0]=polygon[i];
- w[(i<<1)+1]=polygon[(i+1)%polygon.size()];
}
- w=PoolVector<Vector2>::Write();
- concave->set_segments(segments);
-
- co->add_shape(concave,get_transform());
-#endif
+ convex->set_points(cp);
+ parent->shape_owner_add_shape(owner_id, convex);
+ parent->shape_owner_set_disabled(owner_id, disabled);
}
-
- //co->add_shape(shape,get_transform());
-}
-
-void CollisionPolygon::_update_parent() {
-
- if (!can_update_body)
- return;
-
- Node *parent = get_parent();
- if (!parent)
- return;
- CollisionObject *co = parent->cast_to<CollisionObject>();
- if (!co)
- return;
- co->_update_shapes_from_children();
-}
-
-void CollisionPolygon::_set_shape_range(const Vector2 &p_range) {
-
- shape_from = p_range.x;
- shape_to = p_range.y;
-}
-
-Vector2 CollisionPolygon::_get_shape_range() const {
-
- return Vector2(shape_from, shape_to);
}
void CollisionPolygon::_notification(int p_what) {
switch (p_what) {
- case NOTIFICATION_ENTER_TREE: {
- can_update_body = get_tree()->is_editor_hint();
- set_notify_local_transform(!can_update_body);
- //indicator_instance = VisualServer::get_singleton()->instance_create2(indicator,get_world()->get_scenario());
- } break;
- case NOTIFICATION_EXIT_TREE: {
- can_update_body = false;
- set_notify_local_transform(false);
- } break;
- case NOTIFICATION_TRANSFORM_CHANGED: {
-
- if (!is_inside_tree())
- break;
- if (can_update_body) {
- _update_parent();
+ case NOTIFICATION_PARENTED: {
+ parent = get_parent()->cast_to<CollisionObject>();
+ if (parent) {
+ owner_id = parent->create_shape_owner(this);
+ _build_polygon();
+ parent->shape_owner_set_transform(owner_id, get_transform());
+ parent->shape_owner_set_disabled(owner_id, disabled);
}
-
} break;
case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
- if (!can_update_body && shape_from >= 0 && shape_to >= 0) {
-
- CollisionObject *co = get_parent()->cast_to<CollisionObject>();
- if (co) {
- for (int i = shape_from; i <= shape_to; i++) {
- co->set_shape_transform(i, get_transform());
- }
- }
- }
- } break;
-#if 0
- case NOTIFICATION_DRAW: {
- for(int i=0;i<polygon.size();i++) {
-
- Vector2 p = polygon[i];
- Vector2 n = polygon[(i+1)%polygon.size()];
- draw_line(p,n,Color(0,0.6,0.7,0.5),3);
+ if (parent) {
+ parent->shape_owner_set_transform(owner_id, get_transform());
}
- Vector< Vector<Vector2> > decomp = Geometry::decompose_polygon(polygon);
-#define DEBUG_DECOMPOSE
-#ifdef DEBUG_DECOMPOSE
- Color c(0.4,0.9,0.1);
- for(int i=0;i<decomp.size();i++) {
-
- c.set_hsv( Math::fmod(c.get_h() + 0.738,1),c.get_s(),c.get_v(),0.5);
- draw_colored_polygon(decomp[i],c);
+ } break;
+ case NOTIFICATION_UNPARENTED: {
+ if (parent) {
+ parent->remove_shape_owner(owner_id);
}
-#endif
-
+ owner_id = 0;
+ parent = NULL;
} break;
-#endif
}
}
void CollisionPolygon::set_polygon(const Vector<Point2> &p_polygon) {
polygon = p_polygon;
- if (can_update_body) {
-
- for (int i = 0; i < polygon.size(); i++) {
-
- Vector3 p1(polygon[i].x, polygon[i].y, depth * 0.5);
-
- if (i == 0)
- aabb = Rect3(p1, Vector3());
- else
- aabb.expand_to(p1);
-
- Vector3 p2(polygon[i].x, polygon[i].y, -depth * 0.5);
- aabb.expand_to(p2);
- }
- if (aabb == Rect3()) {
-
- aabb = Rect3(Vector3(-1, -1, -1), Vector3(2, 2, 2));
- } else {
- aabb.pos -= aabb.size * 0.3;
- aabb.size += aabb.size * 0.6;
- }
- _update_parent();
+ if (parent) {
+ _build_polygon();
}
+ update_configuration_warning();
update_gizmo();
}
@@ -220,20 +117,6 @@ Vector<Point2> CollisionPolygon::get_polygon() const {
return polygon;
}
-void CollisionPolygon::set_build_mode(BuildMode p_mode) {
-
- ERR_FAIL_INDEX(p_mode, 2);
- build_mode = p_mode;
- if (!can_update_body)
- return;
- _update_parent();
-}
-
-CollisionPolygon::BuildMode CollisionPolygon::get_build_mode() const {
-
- return build_mode;
-}
-
Rect3 CollisionPolygon::get_item_rect() const {
return aabb;
@@ -242,9 +125,7 @@ Rect3 CollisionPolygon::get_item_rect() const {
void CollisionPolygon::set_depth(float p_depth) {
depth = p_depth;
- if (!can_update_body)
- return;
- _update_parent();
+ _build_polygon();
update_gizmo();
}
@@ -253,6 +134,17 @@ float CollisionPolygon::get_depth() const {
return depth;
}
+void CollisionPolygon::set_disabled(bool p_disabled) {
+ disabled = p_disabled;
+ if (parent) {
+ parent->shape_owner_set_disabled(owner_id, p_disabled);
+ }
+}
+
+bool CollisionPolygon::is_disabled() const {
+ return disabled;
+}
+
String CollisionPolygon::get_configuration_warning() const {
if (!get_parent()->cast_to<CollisionObject>()) {
@@ -268,36 +160,26 @@ String CollisionPolygon::get_configuration_warning() const {
void CollisionPolygon::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_add_to_collision_object"), &CollisionPolygon::_add_to_collision_object);
-
- 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(D_METHOD("set_depth", "depth"), &CollisionPolygon::set_depth);
ClassDB::bind_method(D_METHOD("get_depth"), &CollisionPolygon::get_depth);
ClassDB::bind_method(D_METHOD("set_polygon", "polygon"), &CollisionPolygon::set_polygon);
ClassDB::bind_method(D_METHOD("get_polygon"), &CollisionPolygon::get_polygon);
- 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(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);
+ ClassDB::bind_method(D_METHOD("set_disabled", "disabled"), &CollisionPolygon::set_disabled);
+ ClassDB::bind_method(D_METHOD("is_disabled"), &CollisionPolygon::is_disabled);
- 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::BOOL, "disabled"), "set_disabled", "is_disabled");
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() {
- shape_from = -1;
- shape_to = -1;
- can_update_body = false;
-
aabb = Rect3(Vector3(-1, -1, -1), Vector3(2, 2, 2));
- build_mode = BUILD_SOLIDS;
depth = 1.0;
+ set_notify_local_transform(true);
+ parent = NULL;
+ owner_id = 0;
+ disabled = false;
}
diff --git a/scene/3d/collision_polygon.h b/scene/3d/collision_polygon.h
index fee146a87e..beefae182c 100644
--- a/scene/3d/collision_polygon.h
+++ b/scene/3d/collision_polygon.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,55 +33,42 @@
#include "scene/3d/spatial.h"
#include "scene/resources/shape.h"
+class CollisionObject;
class CollisionPolygon : public Spatial {
GDCLASS(CollisionPolygon, Spatial);
-public:
- enum BuildMode {
- BUILD_SOLIDS,
- BUILD_TRIANGLES,
- };
-
protected:
float depth;
Rect3 aabb;
- BuildMode build_mode;
Vector<Point2> polygon;
- void _add_to_collision_object(Object *p_obj);
- void _update_parent();
+ uint32_t owner_id;
+ CollisionObject *parent;
- bool can_update_body;
- int shape_from;
- int shape_to;
+ bool disabled;
- void _set_shape_range(const Vector2 &p_range);
- Vector2 _get_shape_range() const;
+ void _build_polygon();
protected:
void _notification(int p_what);
static void _bind_methods();
public:
- void set_build_mode(BuildMode p_mode);
- BuildMode get_build_mode() const;
-
void set_depth(float p_depth);
float get_depth() const;
void set_polygon(const Vector<Point2> &p_polygon);
Vector<Point2> get_polygon() const;
- virtual Rect3 get_item_rect() const;
+ void set_disabled(bool p_disabled);
+ bool is_disabled() const;
- int get_collision_object_first_shape() const { return shape_from; }
- int get_collision_object_last_shape() const { return shape_to; }
+ virtual Rect3 get_item_rect() const;
String get_configuration_warning() const;
CollisionPolygon();
};
-VARIANT_ENUM_CAST(CollisionPolygon::BuildMode);
#endif // COLLISION_POLYGON_H
diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp
new file mode 100644
index 0000000000..2aa6a95718
--- /dev/null
+++ b/scene/3d/collision_shape.cpp
@@ -0,0 +1,207 @@
+/*************************************************************************/
+/* body_shape.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "collision_shape.h"
+#include "scene/resources/box_shape.h"
+#include "scene/resources/capsule_shape.h"
+#include "scene/resources/concave_polygon_shape.h"
+#include "scene/resources/convex_polygon_shape.h"
+#include "scene/resources/plane_shape.h"
+#include "scene/resources/ray_shape.h"
+#include "scene/resources/sphere_shape.h"
+#include "servers/visual_server.h"
+//TODO: Implement CylinderShape and HeightMapShape?
+#include "mesh_instance.h"
+#include "physics_body.h"
+#include "quick_hull.h"
+
+void CollisionShape::make_convex_from_brothers() {
+
+ Node *p = get_parent();
+ if (!p)
+ return;
+
+ for (int i = 0; i < p->get_child_count(); i++) {
+
+ Node *n = p->get_child(i);
+ if (n->cast_to<MeshInstance>()) {
+
+ MeshInstance *mi = n->cast_to<MeshInstance>();
+ Ref<Mesh> m = mi->get_mesh();
+ if (m.is_valid()) {
+
+ Ref<Shape> s = m->create_convex_shape();
+ set_shape(s);
+ }
+ }
+ }
+}
+
+void CollisionShape::_notification(int p_what) {
+
+ switch (p_what) {
+
+ case NOTIFICATION_PARENTED: {
+ parent = get_parent()->cast_to<CollisionObject>();
+ if (parent) {
+ owner_id = parent->create_shape_owner(this);
+ if (shape.is_valid()) {
+ parent->shape_owner_add_shape(owner_id, shape);
+ }
+ parent->shape_owner_set_transform(owner_id, get_transform());
+ parent->shape_owner_set_disabled(owner_id, disabled);
+ }
+ } break;
+ case NOTIFICATION_ENTER_TREE: {
+ if (get_tree()->is_debugging_collisions_hint()) {
+ _create_debug_shape();
+ }
+
+ } break;
+ case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
+ if (parent) {
+ parent->shape_owner_set_transform(owner_id, get_transform());
+ }
+ } break;
+ case NOTIFICATION_UNPARENTED: {
+ if (parent) {
+ parent->remove_shape_owner(owner_id);
+ }
+ owner_id = 0;
+ parent = NULL;
+ } break;
+ }
+}
+
+void CollisionShape::resource_changed(RES res) {
+
+ update_gizmo();
+}
+
+String CollisionShape::get_configuration_warning() const {
+
+ if (!get_parent()->cast_to<CollisionObject>()) {
+ return TTR("CollisionShape only serves to provide a collision shape to a CollisionObject derived node. Please only use it as a child of Area, StaticBody, RigidBody, KinematicBody, etc. to give them a shape.");
+ }
+
+ if (!shape.is_valid()) {
+ return TTR("A shape must be provided for CollisionShape to function. Please create a shape resource for it!");
+ }
+
+ return String();
+}
+
+void CollisionShape::_bind_methods() {
+
+ //not sure if this should do anything
+ 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("set_disabled", "enable"), &CollisionShape::set_disabled);
+ ClassDB::bind_method(D_METHOD("is_disabled"), &CollisionShape::is_disabled);
+ 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);
+
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape"), "set_shape", "get_shape");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled");
+}
+
+void CollisionShape::set_shape(const Ref<Shape> &p_shape) {
+
+ if (!shape.is_null())
+ shape->unregister_owner(this);
+ shape = p_shape;
+ if (!shape.is_null())
+ shape->register_owner(this);
+ update_gizmo();
+ if (parent) {
+ parent->shape_owner_clear_shapes(owner_id);
+ if (shape.is_valid()) {
+ parent->shape_owner_add_shape(owner_id, shape);
+ }
+ }
+
+ update_configuration_warning();
+}
+
+Ref<Shape> CollisionShape::get_shape() const {
+
+ return shape;
+}
+
+void CollisionShape::set_disabled(bool p_disabled) {
+
+ disabled = p_disabled;
+ update_gizmo();
+ if (parent) {
+ parent->shape_owner_set_disabled(owner_id, p_disabled);
+ }
+}
+
+bool CollisionShape::is_disabled() const {
+
+ return disabled;
+}
+
+CollisionShape::CollisionShape() {
+
+ //indicator = VisualServer::get_singleton()->mesh_create();
+ disabled = false;
+ debug_shape = NULL;
+ parent = NULL;
+ owner_id = 0;
+ set_notify_local_transform(true);
+}
+
+CollisionShape::~CollisionShape() {
+ if (!shape.is_null())
+ shape->unregister_owner(this);
+ //VisualServer::get_singleton()->free(indicator);
+}
+
+void CollisionShape::_create_debug_shape() {
+
+ if (debug_shape) {
+ debug_shape->queue_delete();
+ debug_shape = NULL;
+ }
+
+ Ref<Shape> s = get_shape();
+
+ if (s.is_null())
+ return;
+
+ Ref<Mesh> mesh = s->get_debug_mesh();
+
+ MeshInstance *mi = memnew(MeshInstance);
+ mi->set_mesh(mesh);
+
+ add_child(mi);
+ debug_shape = mi;
+}
diff --git a/scene/3d/body_shape.h b/scene/3d/collision_shape.h
index 137a6cd9fc..277e0dfa77 100644
--- a/scene/3d/body_shape.h
+++ b/scene/3d/collision_shape.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,7 +32,7 @@
#include "scene/3d/spatial.h"
#include "scene/resources/shape.h"
-
+class CollisionObject;
class CollisionShape : public Spatial {
GDCLASS(CollisionShape, Spatial);
@@ -39,34 +40,13 @@ class CollisionShape : public Spatial {
Ref<Shape> shape;
- /*
- RID _get_visual_instance_rid() const;
-
-
- void _update_indicator();
-
- RID material;
- RID indicator;
- RID indicator_instance;
- */
+ uint32_t owner_id;
+ CollisionObject *parent;
Node *debug_shape;
void resource_changed(RES res);
-
- bool updating_body;
- bool unparenting;
- bool trigger;
-
- bool can_update_body;
-
- int update_shape_index;
-
- void _update_body();
- void _add_to_collision_object(Object *p_cshape);
-
- void _set_update_shape_index(int p_index);
- int _get_update_shape_index() const;
+ bool disabled;
void _create_debug_shape();
@@ -80,13 +60,8 @@ public:
void set_shape(const Ref<Shape> &p_shape);
Ref<Shape> get_shape() const;
- void set_updating_body(bool p_update);
- bool is_updating_body() const;
-
- void set_trigger(bool p_trigger);
- bool is_trigger() const;
-
- int get_collision_object_shape_index() const { return _get_update_shape_index(); }
+ void set_disabled(bool p_disabled);
+ bool is_disabled() const;
String get_configuration_warning() const;
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index cb1292a9d1..2174f924ac 100644
--- a/scene/3d/gi_probe.cpp
+++ b/scene/3d/gi_probe.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -94,6 +95,16 @@ float GIProbeData::get_bias() const {
return VS::get_singleton()->gi_probe_get_bias(probe);
}
+void GIProbeData::set_normal_bias(float p_range) {
+
+ VS::get_singleton()->gi_probe_set_normal_bias(probe, p_range);
+}
+
+float GIProbeData::get_normal_bias() const {
+
+ return VS::get_singleton()->gi_probe_get_normal_bias(probe);
+}
+
void GIProbeData::set_propagation(float p_range) {
VS::get_singleton()->gi_probe_set_propagation(probe, p_range);
@@ -157,6 +168,9 @@ void GIProbeData::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_bias", "bias"), &GIProbeData::set_bias);
ClassDB::bind_method(D_METHOD("get_bias"), &GIProbeData::get_bias);
+ ClassDB::bind_method(D_METHOD("set_normal_bias", "bias"), &GIProbeData::set_normal_bias);
+ ClassDB::bind_method(D_METHOD("get_normal_bias"), &GIProbeData::get_normal_bias);
+
ClassDB::bind_method(D_METHOD("set_propagation", "propagation"), &GIProbeData::set_propagation);
ClassDB::bind_method(D_METHOD("get_propagation"), &GIProbeData::get_propagation);
@@ -174,6 +188,7 @@ void GIProbeData::_bind_methods() {
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, "normal_bias", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_normal_bias", "get_normal_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");
@@ -264,6 +279,18 @@ float GIProbe::get_bias() const {
return bias;
}
+void GIProbe::set_normal_bias(float p_normal_bias) {
+
+ normal_bias = p_normal_bias;
+ if (probe_data.is_valid()) {
+ probe_data->set_normal_bias(normal_bias);
+ }
+}
+float GIProbe::get_normal_bias() const {
+
+ return normal_bias;
+}
+
void GIProbe::set_propagation(float p_propagation) {
propagation = p_propagation;
@@ -563,7 +590,7 @@ void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, cons
Vector3 ofs_j = float(j) * t2;
- Vector3 from = p_aabb.pos + ofs_i + ofs_j;
+ Vector3 from = p_aabb.position + ofs_i + ofs_j;
Vector3 to = from + t1 + t2 + axis * p_aabb.size[closest_axis];
Vector3 half = (to - from) * 0.5;
@@ -618,7 +645,7 @@ void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, cons
//could not in any way get texture information.. so use closest point to center
Face3 f(p_vtx[0], p_vtx[1], p_vtx[2]);
- Vector3 inters = f.get_closest_point_to(p_aabb.pos + p_aabb.size * 0.5);
+ Vector3 inters = f.get_closest_point_to(p_aabb.position + p_aabb.size * 0.5);
Vector2 uv = get_uv(inters, p_vtx, p_uv);
@@ -699,15 +726,15 @@ void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, cons
int nz = p_z;
if (i & 1) {
- aabb.pos.x += aabb.size.x;
+ aabb.position.x += aabb.size.x;
nx += half;
}
if (i & 2) {
- aabb.pos.y += aabb.size.y;
+ aabb.position.y += aabb.size.y;
ny += half;
}
if (i & 4) {
- aabb.pos.z += aabb.size.z;
+ aabb.position.z += aabb.size.z;
nz += half;
}
//make sure to not plot beyond limits
@@ -719,7 +746,7 @@ void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, cons
//test_aabb.grow_by(test_aabb.get_longest_axis_size()*0.05); //grow a bit to avoid numerical error in real-time
Vector3 qsize = test_aabb.size * 0.5; //quarter size, for fast aabb test
- if (!fast_tri_box_overlap(test_aabb.pos + qsize, qsize, p_vtx)) {
+ if (!fast_tri_box_overlap(test_aabb.position + qsize, qsize, p_vtx)) {
//if (!Face3(p_vtx[0],p_vtx[1],p_vtx[2]).intersects_aabb2(aabb)) {
//does not fit in child, go on
continue;
@@ -880,11 +907,11 @@ void GIProbe::_fixup_plot(int p_idx, int p_level, int p_x, int p_y, int p_z, Bak
}
}
-Vector<Color> GIProbe::_get_bake_texture(Image &p_image, const Color &p_color) {
+Vector<Color> GIProbe::_get_bake_texture(Ref<Image> p_image, const Color &p_color) {
Vector<Color> ret;
- if (p_image.empty()) {
+ if (p_image.is_null() || p_image->empty()) {
ret.resize(bake_texture_size * bake_texture_size);
for (int i = 0; i < bake_texture_size * bake_texture_size; i++) {
@@ -893,23 +920,26 @@ Vector<Color> GIProbe::_get_bake_texture(Image &p_image, const Color &p_color) {
return ret;
}
+ p_image = p_image->duplicate();
- if (p_image.is_compressed()) {
+ if (p_image->is_compressed()) {
print_line("DECOMPRESSING!!!!");
- p_image.decompress();
+
+ p_image->decompress();
}
- p_image.convert(Image::FORMAT_RGBA8);
- p_image.resize(bake_texture_size, bake_texture_size, Image::INTERPOLATE_CUBIC);
+ p_image->convert(Image::FORMAT_RGBA8);
+ p_image->resize(bake_texture_size, bake_texture_size, Image::INTERPOLATE_CUBIC);
- PoolVector<uint8_t>::Read r = p_image.get_data().read();
+ PoolVector<uint8_t>::Read r = p_image->get_data().read();
ret.resize(bake_texture_size * bake_texture_size);
for (int i = 0; i < bake_texture_size * bake_texture_size; i++) {
Color c;
- c.r = r[i * 4 + 0] / 255.0;
- c.g = r[i * 4 + 1] / 255.0;
- c.b = r[i * 4 + 2] / 255.0;
+ c.r = (r[i * 4 + 0] / 255.0) * p_color.r;
+ c.g = (r[i * 4 + 1] / 255.0) * p_color.g;
+ c.b = (r[i * 4 + 2] / 255.0) * p_color.b;
c.a = r[i * 4 + 3] / 255.0;
+
ret[i] = c;
}
@@ -919,7 +949,7 @@ Vector<Color> GIProbe::_get_bake_texture(Image &p_image, const Color &p_color) {
GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_material, Baker *p_baker) {
//this way of obtaining materials is inaccurate and also does not support some compressed formats very well
- Ref<FixedSpatialMaterial> mat = p_material;
+ Ref<SpatialMaterial> mat = p_material;
Ref<Material> material = mat; //hack for now
@@ -931,9 +961,9 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater
if (mat.is_valid()) {
- Ref<Texture> albedo_tex = mat->get_texture(FixedSpatialMaterial::TEXTURE_ALBEDO);
+ Ref<Texture> albedo_tex = mat->get_texture(SpatialMaterial::TEXTURE_ALBEDO);
- Image img_albedo;
+ Ref<Image> img_albedo;
if (albedo_tex.is_valid()) {
img_albedo = albedo_tex->get_data();
@@ -942,14 +972,14 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater
mc.albedo = _get_bake_texture(img_albedo, mat->get_albedo());
- Ref<ImageTexture> emission_tex = mat->get_texture(FixedSpatialMaterial::TEXTURE_EMISSION);
+ Ref<ImageTexture> emission_tex = mat->get_texture(SpatialMaterial::TEXTURE_EMISSION);
Color emission_col = mat->get_emission();
emission_col.r *= mat->get_emission_energy();
emission_col.g *= mat->get_emission_energy();
emission_col.b *= mat->get_emission_energy();
- Image img_emission;
+ Ref<Image> img_emission;
if (emission_tex.is_valid()) {
@@ -959,7 +989,7 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater
mc.emission = _get_bake_texture(img_emission, emission_col);
} else {
- Image empty;
+ Ref<Image> empty;
mc.albedo = _get_bake_texture(empty, Color(0.7, 0.7, 0.7));
mc.emission = _get_bake_texture(empty, Color(0, 0, 0));
@@ -1151,7 +1181,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) {
Transform to_bounds;
to_bounds.basis.scale(Vector3(baker.po2_bounds.size[longest_axis], baker.po2_bounds.size[longest_axis], baker.po2_bounds.size[longest_axis]));
- to_bounds.origin = baker.po2_bounds.pos;
+ to_bounds.origin = baker.po2_bounds.position;
Transform to_grid;
to_grid.basis.scale(Vector3(baker.axis_cell_size[longest_axis], baker.axis_cell_size[longest_axis], baker.axis_cell_size[longest_axis]));
@@ -1257,6 +1287,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) {
probe_data->set_dynamic_range(dynamic_range);
probe_data->set_energy(energy);
probe_data->set_bias(bias);
+ probe_data->set_normal_bias(normal_bias);
probe_data->set_propagation(propagation);
probe_data->set_interior(interior);
probe_data->set_compress(compress);
@@ -1270,12 +1301,13 @@ void GIProbe::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb, Ref<Multi
if (p_level == p_baker->cell_subdiv - 1) {
- Vector3 center = p_aabb.pos + p_aabb.size * 0.5;
+ Vector3 center = p_aabb.position + p_aabb.size * 0.5;
Transform xform;
xform.origin = center;
xform.basis.scale(p_aabb.size * 0.5);
p_multimesh->set_instance_transform(idx, xform);
Color col = Color(p_baker->bake_cells[p_idx].albedo[0], p_baker->bake_cells[p_idx].albedo[1], p_baker->bake_cells[p_idx].albedo[2]);
+ //Color col = Color(p_baker->bake_cells[p_idx].emission[0], p_baker->bake_cells[p_idx].emission[1], p_baker->bake_cells[p_idx].emission[2]);
p_multimesh->set_instance_color(idx, col);
idx++;
@@ -1291,11 +1323,11 @@ void GIProbe::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb, Ref<Multi
aabb.size *= 0.5;
if (i & 1)
- aabb.pos.x += aabb.size.x;
+ aabb.position.x += aabb.size.x;
if (i & 2)
- aabb.pos.y += aabb.size.y;
+ aabb.position.y += aabb.size.y;
if (i & 4)
- aabb.pos.z += aabb.size.z;
+ aabb.position.z += aabb.size.z;
_debug_mesh(p_baker->bake_cells[p_idx].childs[i], p_level + 1, aabb, p_multimesh, idx, p_baker);
}
@@ -1312,7 +1344,7 @@ void GIProbe::_create_debug_mesh(Baker *p_baker) {
print_line("leaf voxels: " + itos(p_baker->leaf_voxel_count));
mm->set_instance_count(p_baker->leaf_voxel_count);
- Ref<Mesh> mesh;
+ Ref<ArrayMesh> mesh;
mesh.instance();
{
@@ -1365,11 +1397,11 @@ void GIProbe::_create_debug_mesh(Baker *p_baker) {
}
{
- Ref<FixedSpatialMaterial> fsm;
+ Ref<SpatialMaterial> fsm;
fsm.instance();
- fsm->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
- fsm->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- fsm->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ fsm->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ fsm->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ fsm->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
fsm->set_albedo(Color(1, 1, 1, 1));
mesh->surface_set_material(0, fsm);
@@ -1429,6 +1461,9 @@ void GIProbe::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_bias", "max"), &GIProbe::set_bias);
ClassDB::bind_method(D_METHOD("get_bias"), &GIProbe::get_bias);
+ ClassDB::bind_method(D_METHOD("set_normal_bias", "max"), &GIProbe::set_normal_bias);
+ ClassDB::bind_method(D_METHOD("get_normal_bias"), &GIProbe::get_normal_bias);
+
ClassDB::bind_method(D_METHOD("set_propagation", "max"), &GIProbe::set_propagation);
ClassDB::bind_method(D_METHOD("get_propagation"), &GIProbe::get_propagation);
@@ -1448,6 +1483,7 @@ void GIProbe::_bind_methods() {
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::REAL, "normal_bias", PROPERTY_HINT_RANGE, "0,4,0.001"), "set_normal_bias", "get_normal_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");
@@ -1463,7 +1499,8 @@ GIProbe::GIProbe() {
subdiv = SUBDIV_128;
dynamic_range = 4;
energy = 1.0;
- bias = 0.4;
+ bias = 0.0;
+ normal_bias = 0.8;
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 675b41cef9..8346437ebd 100644
--- a/scene/3d/gi_probe.h
+++ b/scene/3d/gi_probe.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -66,6 +67,9 @@ public:
void set_bias(float p_range);
float get_bias() const;
+ void set_normal_bias(float p_range);
+ float get_normal_bias() const;
+
void set_interior(bool p_enable);
bool is_interior() const;
@@ -133,7 +137,7 @@ private:
Vector<Color> emission;
};
- Vector<Color> _get_bake_texture(Image &p_image, const Color &p_color);
+ Vector<Color> _get_bake_texture(Ref<Image> p_image, const Color &p_color);
Map<Ref<Material>, MaterialCache> material_cache;
MaterialCache _get_material_cache(Ref<Material> p_material);
int leaf_voxel_count;
@@ -162,6 +166,7 @@ private:
int dynamic_range;
float energy;
float bias;
+ float normal_bias;
float propagation;
bool interior;
bool compress;
@@ -169,7 +174,7 @@ private:
int color_scan_cell_width;
int bake_texture_size;
- Vector<Color> _get_bake_texture(Image &p_image, const Color &p_color);
+ Vector<Color> _get_bake_texture(Ref<Image> p_image, const Color &p_color);
Baker::MaterialCache _get_material_cache(Ref<Material> p_material, Baker *p_baker);
void _plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, const Vector3 *p_vtx, const Vector2 *p_uv, const Baker::MaterialCache &p_material, const Rect3 &p_aabb, Baker *p_baker);
void _plot_mesh(const Transform &p_xform, Ref<Mesh> &p_mesh, Baker *p_baker, const Vector<Ref<Material> > &p_materials, const Ref<Material> &p_override_material);
@@ -203,6 +208,9 @@ public:
void set_bias(float p_bias);
float get_bias() const;
+ void set_normal_bias(float p_normal_bias);
+ float get_normal_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 adcc167223..060e088750 100644
--- a/scene/3d/immediate_geometry.cpp
+++ b/scene/3d/immediate_geometry.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -64,7 +65,7 @@ void ImmediateGeometry::add_vertex(const Vector3 &p_vertex) {
VS::get_singleton()->immediate_vertex(im, p_vertex);
if (empty) {
- aabb.pos = p_vertex;
+ aabb.position = p_vertex;
aabb.size = Vector3();
empty = false;
} else {
@@ -142,7 +143,7 @@ void ImmediateGeometry::add_sphere(int p_lats, int p_lons, float p_radius, bool
void ImmediateGeometry::_bind_methods() {
- ClassDB::bind_method(D_METHOD("begin", "primitive", "texture:Texture"), &ImmediateGeometry::begin, DEFVAL(Ref<Texture>()));
+ ClassDB::bind_method(D_METHOD("begin", "primitive", "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);
diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h
index 6e0123992c..bc8452c7e0 100644
--- a/scene/3d/immediate_geometry.h
+++ b/scene/3d/immediate_geometry.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -51,8 +52,8 @@ public:
void set_normal(const Vector3 &p_normal);
void set_tangent(const Plane &p_tangent);
void set_color(const Color &p_color);
- void set_uv(const Vector2 &tex_uv);
- void set_uv2(const Vector2 &tex_uv);
+ void set_uv(const Vector2 &p_uv);
+ void set_uv2(const Vector2 &p_uv2);
void add_vertex(const Vector3 &p_vertex);
diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp
index 9723a686c5..36a6660bf9 100644
--- a/scene/3d/interpolated_camera.cpp
+++ b/scene/3d/interpolated_camera.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -131,7 +132,7 @@ void InterpolatedCamera::_bind_methods() {
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(D_METHOD("set_target", "target"), &InterpolatedCamera::_set_target);
ClassDB::bind_method(D_METHOD("set_speed", "speed"), &InterpolatedCamera::set_speed);
ClassDB::bind_method(D_METHOD("get_speed"), &InterpolatedCamera::get_speed);
diff --git a/scene/3d/interpolated_camera.h b/scene/3d/interpolated_camera.h
index ebadf39946..c302c32fc9 100644
--- a/scene/3d/interpolated_camera.h
+++ b/scene/3d/interpolated_camera.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp
index 7d01230517..977f1f81a7 100644
--- a/scene/3d/light.cpp
+++ b/scene/3d/light.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,7 @@
/*************************************************************************/
#include "light.h"
-#include "baked_light_instance.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "scene/resources/surface_tool.h"
bool Light::_can_gizmo_scale() const {
@@ -165,26 +165,9 @@ void Light::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
_update_visibility();
-
- Node *node = this;
-
- while (node) {
-
- baked_light = node->cast_to<BakedLight>();
- if (baked_light) {
- baked_light->lights.insert(this);
- break;
- }
-
- node = node->get_parent();
- }
}
if (p_what == NOTIFICATION_EXIT_TREE) {
-
- if (baked_light) {
- baked_light->lights.erase(this);
- }
}
}
@@ -251,7 +234,7 @@ void Light::_bind_methods() {
BIND_CONSTANT(PARAM_SHADOW_SPLIT_3_OFFSET);
BIND_CONSTANT(PARAM_SHADOW_NORMAL_BIAS);
BIND_CONSTANT(PARAM_SHADOW_BIAS);
- BIND_CONSTANT(PARAM_SHADOW_BIAS_SPLIT_SCALE);
+
BIND_CONSTANT(PARAM_MAX);
}
@@ -261,8 +244,6 @@ Light::Light(VisualServer::LightType p_type) {
light = VisualServer::get_singleton()->light_create(p_type);
VS::get_singleton()->instance_set_base(get_instance(), light);
- baked_light = NULL;
-
editor_only = false;
set_color(Color(1, 1, 1, 1));
set_shadow(false);
@@ -280,9 +261,8 @@ Light::Light(VisualServer::LightType p_type) {
set_param(PARAM_SHADOW_SPLIT_1_OFFSET, 0.1);
set_param(PARAM_SHADOW_SPLIT_2_OFFSET, 0.2);
set_param(PARAM_SHADOW_SPLIT_3_OFFSET, 0.5);
- set_param(PARAM_SHADOW_NORMAL_BIAS, 0.1);
- set_param(PARAM_SHADOW_BIAS, 0.1);
- set_param(PARAM_SHADOW_BIAS_SPLIT_SCALE, 0.1);
+ set_param(PARAM_SHADOW_NORMAL_BIAS, 0.0);
+ set_param(PARAM_SHADOW_BIAS, 0.15);
}
Light::Light() {
@@ -337,7 +317,6 @@ void DirectionalLight::_bind_methods() {
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);
@@ -347,7 +326,11 @@ void DirectionalLight::_bind_methods() {
DirectionalLight::DirectionalLight()
: Light(VisualServer::LIGHT_DIRECTIONAL) {
+ set_param(PARAM_SHADOW_NORMAL_BIAS, 0.2);
+ set_param(PARAM_SHADOW_BIAS, 1.0);
+ set_param(PARAM_SHADOW_MAX_DISTANCE, 200);
set_shadow_mode(SHADOW_PARALLEL_4_SPLITS);
+
blend_splits = false;
}
@@ -390,7 +373,7 @@ void OmniLight::_bind_methods() {
OmniLight::OmniLight()
: Light(VisualServer::LIGHT_OMNI) {
- set_shadow_mode(SHADOW_DUAL_PARABOLOID);
+ set_shadow_mode(SHADOW_CUBE);
set_shadow_detail(SHADOW_DETAIL_HORIZONTAL);
}
diff --git a/scene/3d/light.h b/scene/3d/light.h
index fd50f0fcc4..22ff5c0763 100644
--- a/scene/3d/light.h
+++ b/scene/3d/light.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -59,7 +60,6 @@ public:
PARAM_SHADOW_SPLIT_3_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET,
PARAM_SHADOW_NORMAL_BIAS = VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS,
PARAM_SHADOW_BIAS = VS::LIGHT_PARAM_SHADOW_BIAS,
- PARAM_SHADOW_BIAS_SPLIT_SCALE = VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE,
PARAM_MAX = VS::LIGHT_PARAM_MAX
};
@@ -74,7 +74,6 @@ private:
bool editor_only;
void _update_visibility();
- BakedLight *baked_light;
// bind helpers
protected:
diff --git a/scene/3d/listener.cpp b/scene/3d/listener.cpp
index fc9326b571..c7d3bac2f8 100644
--- a/scene/3d/listener.cpp
+++ b/scene/3d/listener.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -151,7 +152,7 @@ bool Listener::_can_gizmo_scale() const {
}
RES Listener::_get_gizmo_geometry() const {
- Ref<Mesh> mesh = memnew(Mesh);
+ Ref<ArrayMesh> mesh = memnew(ArrayMesh);
return mesh;
}
diff --git a/scene/3d/listener.h b/scene/3d/listener.h
index 4fb2aea072..b66fc7fc38 100644
--- a/scene/3d/listener.h
+++ b/scene/3d/listener.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp
index b61232dbfd..da25afbf57 100644
--- a/scene/3d/mesh_instance.cpp
+++ b/scene/3d/mesh_instance.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,9 +29,10 @@
/*************************************************************************/
#include "mesh_instance.h"
-#include "body_shape.h"
+#include "collision_shape.h"
#include "core_string_names.h"
#include "physics_body.h"
+#include "scene/resources/material.h"
#include "scene/scene_string_names.h"
#include "skeleton.h"
bool MeshInstance::_set(const StringName &p_name, const Variant &p_value) {
@@ -97,7 +99,7 @@ void MeshInstance::_get_property_list(List<PropertyInfo> *p_list) const {
if (mesh.is_valid()) {
for (int i = 0; i < mesh->get_surface_count(); i++) {
- p_list->push_back(PropertyInfo(Variant::OBJECT, "material/" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "Material"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "material/" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,SpatialMaterial"));
}
}
}
@@ -192,7 +194,9 @@ Node *MeshInstance::create_trimesh_collision_node() {
return NULL;
StaticBody *static_body = memnew(StaticBody);
- static_body->add_shape(shape);
+ CollisionShape *cshape = memnew(CollisionShape);
+ cshape->set_shape(shape);
+ static_body->add_child(cshape);
return static_body;
}
@@ -203,13 +207,11 @@ void MeshInstance::create_trimesh_collision() {
static_body->set_name(String(get_name()) + "_col");
add_child(static_body);
- if (get_owner())
+ if (get_owner()) {
+ CollisionShape *cshape = static_body->get_child(0)->cast_to<CollisionShape>();
static_body->set_owner(get_owner());
- CollisionShape *cshape = memnew(CollisionShape);
- cshape->set_shape(static_body->get_shape(0));
- static_body->add_child(cshape);
- if (get_owner())
cshape->set_owner(get_owner());
+ }
}
Node *MeshInstance::create_convex_collision_node() {
@@ -222,7 +224,9 @@ Node *MeshInstance::create_convex_collision_node() {
return NULL;
StaticBody *static_body = memnew(StaticBody);
- static_body->add_shape(shape);
+ CollisionShape *cshape = memnew(CollisionShape);
+ cshape->set_shape(shape);
+ static_body->add_child(cshape);
return static_body;
}
@@ -233,13 +237,11 @@ void MeshInstance::create_convex_collision() {
static_body->set_name(String(get_name()) + "_col");
add_child(static_body);
- if (get_owner())
+ if (get_owner()) {
+ CollisionShape *cshape = static_body->get_child(0)->cast_to<CollisionShape>();
static_body->set_owner(get_owner());
- CollisionShape *cshape = memnew(CollisionShape);
- cshape->set_shape(static_body->get_shape(0));
- static_body->add_child(cshape);
- if (get_owner())
cshape->set_owner(get_owner());
+ }
}
void MeshInstance::_notification(int p_what) {
@@ -273,12 +275,90 @@ void MeshInstance::_mesh_changed() {
materials.resize(mesh->get_surface_count());
}
+void MeshInstance::create_debug_tangents() {
+
+ Vector<Vector3> lines;
+ Vector<Color> colors;
+
+ Ref<Mesh> mesh = get_mesh();
+ if (!mesh.is_valid())
+ return;
+
+ for (int i = 0; i < mesh->get_surface_count(); i++) {
+ Array arrays = mesh->surface_get_arrays(i);
+ Vector<Vector3> verts = arrays[Mesh::ARRAY_VERTEX];
+ Vector<Vector3> norms = arrays[Mesh::ARRAY_NORMAL];
+ if (norms.size() == 0)
+ continue;
+ Vector<float> tangents = arrays[Mesh::ARRAY_TANGENT];
+ if (tangents.size() == 0)
+ continue;
+
+ for (int j = 0; j < verts.size(); j++) {
+ Vector3 v = verts[j];
+ Vector3 n = norms[j];
+ Vector3 t = Vector3(tangents[j * 4 + 0], tangents[j * 4 + 1], tangents[j * 4 + 2]);
+ Vector3 b = (n.cross(t)).normalized() * tangents[j * 4 + 3];
+
+ lines.push_back(v); //normal
+ colors.push_back(Color(0, 0, 1)); //color
+ lines.push_back(v + n * 0.04); //normal
+ colors.push_back(Color(0, 0, 1)); //color
+
+ lines.push_back(v); //tangent
+ colors.push_back(Color(1, 0, 0)); //color
+ lines.push_back(v + t * 0.04); //tangent
+ colors.push_back(Color(1, 0, 0)); //color
+
+ lines.push_back(v); //binormal
+ colors.push_back(Color(0, 1, 0)); //color
+ lines.push_back(v + b * 0.04); //binormal
+ colors.push_back(Color(0, 1, 0)); //color
+ }
+ }
+
+ if (lines.size()) {
+
+ Ref<SpatialMaterial> sm;
+ sm.instance();
+
+ sm->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ sm->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ sm->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+
+ Ref<ArrayMesh> am;
+ am.instance();
+ Array a;
+ a.resize(Mesh::ARRAY_MAX);
+ a[Mesh::ARRAY_VERTEX] = lines;
+ a[Mesh::ARRAY_COLOR] = colors;
+
+ am->add_surface_from_arrays(Mesh::PRIMITIVE_LINES, a);
+ am->surface_set_material(0, sm);
+
+ MeshInstance *mi = memnew(MeshInstance);
+ mi->set_mesh(am);
+ mi->set_name("DebugTangents");
+ add_child(mi);
+#ifdef TOOLS_ENABLED
+
+ if (this == get_tree()->get_edited_scene_root())
+ mi->set_owner(this);
+ else
+ mi->set_owner(get_owner());
+#endif
+ }
+}
+
void MeshInstance::_bind_methods() {
- 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(D_METHOD("set_mesh", "mesh"), &MeshInstance::set_mesh);
+ ClassDB::bind_method(D_METHOD("get_mesh"), &MeshInstance::get_mesh);
+ ClassDB::bind_method(D_METHOD("set_skeleton_path", "skeleton_path"), &MeshInstance::set_skeleton_path);
+ ClassDB::bind_method(D_METHOD("get_skeleton_path"), &MeshInstance::get_skeleton_path);
+
+ ClassDB::bind_method(D_METHOD("set_surface_material", "surface", "material"), &MeshInstance::set_surface_material);
+ ClassDB::bind_method(D_METHOD("get_surface_material", "surface"), &MeshInstance::get_surface_material);
ClassDB::bind_method(D_METHOD("create_trimesh_collision"), &MeshInstance::create_trimesh_collision);
ClassDB::set_method_flags("MeshInstance", "create_trimesh_collision", METHOD_FLAGS_DEFAULT);
@@ -286,6 +366,9 @@ void MeshInstance::_bind_methods() {
ClassDB::set_method_flags("MeshInstance", "create_convex_collision", METHOD_FLAGS_DEFAULT);
ClassDB::bind_method(D_METHOD("_mesh_changed"), &MeshInstance::_mesh_changed);
+ ClassDB::bind_method(D_METHOD("create_debug_tangents"), &MeshInstance::create_debug_tangents);
+ ClassDB::set_method_flags("MeshInstance", "create_debug_tangents", METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR);
+
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");
}
diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h
index 543f407ca1..1bb2c97d10 100644
--- a/scene/3d/mesh_instance.h
+++ b/scene/3d/mesh_instance.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -82,6 +83,8 @@ public:
Node *create_convex_collision_node();
void create_convex_collision();
+ void create_debug_tangents();
+
virtual Rect3 get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp
index 18a747a5b9..b51953f27c 100644
--- a/scene/3d/multimesh_instance.cpp
+++ b/scene/3d/multimesh_instance.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h
index 4a0edb563c..7e14d567ac 100644
--- a/scene/3d/multimesh_instance.h
+++ b/scene/3d/multimesh_instance.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp
index 093d217cb0..a1183326d7 100644
--- a/scene/3d/navigation.cpp
+++ b/scene/3d/navigation.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -689,7 +690,7 @@ Vector3 Navigation::get_up_vector() const {
void Navigation::_bind_methods() {
- ClassDB::bind_method(D_METHOD("navmesh_create", "mesh:NavigationMesh", "xform", "owner"), &Navigation::navmesh_create, DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("navmesh_create", "mesh", "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);
diff --git a/scene/3d/navigation.h b/scene/3d/navigation.h
index 6222d2bad3..80699fce72 100644
--- a/scene/3d/navigation.h
+++ b/scene/3d/navigation.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -57,9 +58,9 @@ class Navigation : public Spatial {
return (a.key == p_key.a.key) ? (b.key < p_key.b.key) : (a.key < p_key.a.key);
};
- EdgeKey(const Point &p_a = Point(), const Point &p_b = Point()) {
- a = p_a;
- b = p_b;
+ EdgeKey(const Point &p_a = Point(), const Point &p_b = Point())
+ : a(p_a),
+ b(p_b) {
if (a.key > b.key) {
SWAP(a, b);
}
diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp
index 1059a9b979..5d4568f5d3 100644
--- a/scene/3d/navigation_mesh.cpp
+++ b/scene/3d/navigation_mesh.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -148,8 +149,8 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() {
tw[tidx++] = f.vertex[j];
_EdgeKey ek;
- ek.from = f.vertex[j].snapped(CMP_EPSILON);
- ek.to = f.vertex[(j + 1) % 3].snapped(CMP_EPSILON);
+ ek.from = f.vertex[j].snapped(Vector3(CMP_EPSILON, CMP_EPSILON, CMP_EPSILON));
+ ek.to = f.vertex[(j + 1) % 3].snapped(Vector3(CMP_EPSILON, CMP_EPSILON, CMP_EPSILON));
if (ek.from < ek.to)
SWAP(ek.from, ek.to);
@@ -186,7 +187,7 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() {
}
}
- debug_mesh = Ref<Mesh>(memnew(Mesh));
+ debug_mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
Array arr;
arr.resize(Mesh::ARRAY_MAX);
@@ -207,6 +208,8 @@ void NavigationMesh::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_polygon", "idx"), &NavigationMesh::get_polygon);
ClassDB::bind_method(D_METHOD("clear_polygons"), &NavigationMesh::clear_polygons);
+ ClassDB::bind_method(D_METHOD("create_from_mesh", "mesh"), &NavigationMesh::create_from_mesh);
+
ClassDB::bind_method(D_METHOD("_set_polygons", "polygons"), &NavigationMesh::_set_polygons);
ClassDB::bind_method(D_METHOD("_get_polygons"), &NavigationMesh::_get_polygons);
diff --git a/scene/3d/navigation_mesh.h b/scene/3d/navigation_mesh.h
index fda8923788..e5a3dc7b43 100644
--- a/scene/3d/navigation_mesh.h
+++ b/scene/3d/navigation_mesh.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,7 +44,7 @@ class NavigationMesh : public Resource {
Vector<int> indices;
};
Vector<Polygon> polygons;
- Ref<Mesh> debug_mesh;
+ Ref<ArrayMesh> debug_mesh;
struct _EdgeKey {
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp
index ea61253ac7..e88a52c76a 100644
--- a/scene/3d/particles.cpp
+++ b/scene/3d/particles.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,532 +31,1525 @@
#include "scene/resources/surface_tool.h"
#include "servers/visual_server.h"
-#if 0
-/*
-static const char* _var_names[Particles::VAR_MAX]={
- "vars/lifetime",
- "vars/spread",
- "vars/gravity",
- "vars/linear_vel",
- "vars/angular_vel",
- "vars/linear_accel",
- "vars/radial_accel",
- "vars/tan_accel",
- "vars/initial_size",
- "vars/final_size",
- "vars/initial_angle",
- "vars/height",
- "vars/height_speed_scale",
-};
-*/
-static const char* _rand_names[Particles::VAR_MAX]={
- "rand/lifetime",
- "rand/spread",
- "rand/gravity",
- "rand/linear_vel",
- "rand/angular_vel",
- "rand/linear_accel",
- "rand/radial_accel",
- "rand/tan_accel",
- "rand/damping",
- "rand/initial_size",
- "rand/final_size",
- "rand/initial_angle",
- "rand/height",
- "rand/height_speed_scale",
-};
-
-static const Particles::Variable _var_indices[Particles::VAR_MAX]={
- Particles::VAR_LIFETIME,
- Particles::VAR_SPREAD,
- Particles::VAR_GRAVITY,
- Particles::VAR_LINEAR_VELOCITY,
- Particles::VAR_ANGULAR_VELOCITY,
- Particles::VAR_LINEAR_ACCELERATION,
- Particles::VAR_DRAG,
- Particles::VAR_TANGENTIAL_ACCELERATION,
- Particles::VAR_DAMPING,
- Particles::VAR_INITIAL_SIZE,
- Particles::VAR_FINAL_SIZE,
- Particles::VAR_INITIAL_ANGLE,
- Particles::VAR_HEIGHT,
- Particles::VAR_HEIGHT_SPEED_SCALE,
-};
-
-
-
-AABB Particles::get_aabb() const {
-
- return AABB( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) );
+Rect3 Particles::get_aabb() const {
+
+ return Rect3();
}
PoolVector<Face3> Particles::get_faces(uint32_t p_usage_flags) const {
return PoolVector<Face3>();
}
+void Particles::set_emitting(bool p_emitting) {
+
+ emitting = p_emitting;
+ VS::get_singleton()->particles_set_emitting(particles, emitting);
+}
void Particles::set_amount(int p_amount) {
- ERR_FAIL_INDEX(p_amount,1024);
- amount=p_amount;
- VisualServer::get_singleton()->particles_set_amount(particles,p_amount);
+ ERR_FAIL_COND(p_amount < 1);
+ amount = p_amount;
+ VS::get_singleton()->particles_set_amount(particles, amount);
}
-int Particles::get_amount() const {
+void Particles::set_lifetime(float p_lifetime) {
- return amount;
+ ERR_FAIL_COND(p_lifetime <= 0);
+ lifetime = p_lifetime;
+ VS::get_singleton()->particles_set_lifetime(particles, lifetime);
}
-void Particles::set_emitting(bool p_emitting) {
+void Particles::set_one_shot(bool p_one_shot) {
- emitting=p_emitting;
- VisualServer::get_singleton()->particles_set_emitting(particles,p_emitting);
+ one_shot = p_one_shot;
+ VS::get_singleton()->particles_set_one_shot(particles, one_shot);
+ if (!one_shot && emitting)
+ VisualServer::get_singleton()->particles_restart(particles);
+}
- setup_timer();
+void Particles::set_pre_process_time(float p_time) {
+
+ pre_process_time = p_time;
+ VS::get_singleton()->particles_set_pre_process_time(particles, pre_process_time);
+}
+void Particles::set_explosiveness_ratio(float p_ratio) {
+
+ explosiveness_ratio = p_ratio;
+ VS::get_singleton()->particles_set_explosiveness_ratio(particles, explosiveness_ratio);
}
+void Particles::set_randomness_ratio(float p_ratio) {
+
+ randomness_ratio = p_ratio;
+ VS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio);
+}
+void Particles::set_visibility_aabb(const Rect3 &p_aabb) {
+
+ visibility_aabb = p_aabb;
+ VS::get_singleton()->particles_set_custom_aabb(particles, visibility_aabb);
+ update_gizmo();
+ _change_notify("visibility_aabb");
+}
+void Particles::set_use_local_coordinates(bool p_enable) {
+
+ local_coords = p_enable;
+ VS::get_singleton()->particles_set_use_local_coordinates(particles, local_coords);
+}
+void Particles::set_process_material(const Ref<Material> &p_material) {
+
+ process_material = p_material;
+ RID material_rid;
+ if (process_material.is_valid())
+ material_rid = process_material->get_rid();
+ VS::get_singleton()->particles_set_process_material(particles, material_rid);
+
+ update_configuration_warning();
+}
+
+void Particles::set_speed_scale(float p_scale) {
+
+ speed_scale = p_scale;
+ VS::get_singleton()->particles_set_speed_scale(particles, p_scale);
+}
+
bool Particles::is_emitting() const {
return emitting;
}
+int Particles::get_amount() const {
-void Particles::set_visibility_aabb(const AABB& p_aabb) {
+ return amount;
+}
+float Particles::get_lifetime() const {
- visibility_aabb=p_aabb;
- VisualServer::get_singleton()->particles_set_visibility_aabb(particles,p_aabb);
- update_gizmo();
+ return lifetime;
+}
+bool Particles::get_one_shot() const {
+
+ return one_shot;
+}
+
+float Particles::get_pre_process_time() const {
+
+ return pre_process_time;
+}
+float Particles::get_explosiveness_ratio() const {
+
+ return explosiveness_ratio;
+}
+float Particles::get_randomness_ratio() const {
+ return randomness_ratio;
}
-AABB Particles::get_visibility_aabb() const {
+Rect3 Particles::get_visibility_aabb() const {
return visibility_aabb;
}
+bool Particles::get_use_local_coordinates() const {
+ return local_coords;
+}
+Ref<Material> Particles::get_process_material() const {
+
+ return process_material;
+}
-void Particles::set_emission_points(const PoolVector<Vector3>& p_points) {
+float Particles::get_speed_scale() const {
- using_points = p_points.size();
- VisualServer::get_singleton()->particles_set_emission_points(particles,p_points);
+ return speed_scale;
}
-PoolVector<Vector3> Particles::get_emission_points() const {
+void Particles::set_draw_order(DrawOrder p_order) {
- if (!using_points)
- return PoolVector<Vector3>();
+ draw_order = p_order;
+ VS::get_singleton()->particles_set_draw_order(particles, VS::ParticlesDrawOrder(p_order));
+}
- return VisualServer::get_singleton()->particles_get_emission_points(particles);
+Particles::DrawOrder Particles::get_draw_order() const {
+ return draw_order;
}
-void Particles::set_emission_half_extents(const Vector3& p_half_extents) {
+void Particles::set_draw_passes(int p_count) {
- emission_half_extents=p_half_extents;
- VisualServer::get_singleton()->particles_set_emission_half_extents(particles,p_half_extents);
+ ERR_FAIL_COND(p_count < 1);
+ draw_passes.resize(p_count);
+ VS::get_singleton()->particles_set_draw_passes(particles, p_count);
+ _change_notify();
+}
+int Particles::get_draw_passes() const {
+ return draw_passes.size();
}
-Vector3 Particles::get_emission_half_extents() const {
+void Particles::set_draw_pass_mesh(int p_pass, const Ref<Mesh> &p_mesh) {
+
+ ERR_FAIL_INDEX(p_pass, draw_passes.size());
+
+ draw_passes[p_pass] = p_mesh;
- return emission_half_extents;
+ RID mesh_rid;
+ if (p_mesh.is_valid())
+ mesh_rid = p_mesh->get_rid();
+
+ VS::get_singleton()->particles_set_draw_pass_mesh(particles, p_pass, mesh_rid);
+
+ update_configuration_warning();
}
-void Particles::set_emission_base_velocity(const Vector3& p_base_velocity) {
+Ref<Mesh> Particles::get_draw_pass_mesh(int p_pass) const {
- emission_base_velocity=p_base_velocity;
- VisualServer::get_singleton()->particles_set_emission_base_velocity(particles,p_base_velocity);
+ ERR_FAIL_INDEX_V(p_pass, draw_passes.size(), Ref<Mesh>());
+ return draw_passes[p_pass];
}
-Vector3 Particles::get_emission_base_velocity() const {
+void Particles::set_fixed_fps(int p_count) {
+ fixed_fps = p_count;
+ VS::get_singleton()->particles_set_fixed_fps(particles, p_count);
+}
- return emission_base_velocity;
+int Particles::get_fixed_fps() const {
+ return fixed_fps;
}
-void Particles::set_gravity_normal(const Vector3& p_normal) {
+void Particles::set_fractional_delta(bool p_enable) {
+ fractional_delta = p_enable;
+ VS::get_singleton()->particles_set_fractional_delta(particles, p_enable);
+}
- gravity_normal=p_normal;
- VisualServer::get_singleton()->particles_set_gravity_normal(particles,p_normal);
+bool Particles::get_fractional_delta() const {
+ return fractional_delta;
}
-Vector3 Particles::get_gravity_normal() const {
+String Particles::get_configuration_warning() const {
+
+ String warnings;
+
+ bool meshes_found = false;
+
+ for (int i = 0; i < draw_passes.size(); i++) {
+ if (draw_passes[i].is_valid()) {
+ meshes_found = true;
+ break;
+ }
+ }
- return gravity_normal;
+ if (!meshes_found) {
+ warnings += "- " + TTR("Nothing is visible because meshes have not been assigned to draw passes.");
+ }
+ if (process_material.is_null()) {
+ if (warnings != String())
+ warnings += "\n";
+ warnings += "- " + TTR("A material to process the particles is not assigned, so no behavior is imprinted.");
+ }
+
+ return warnings;
}
-void Particles::set_variable(Variable p_variable,float p_value) {
+void Particles::restart() {
- ERR_FAIL_INDEX(p_variable,VAR_MAX);
- var[p_variable]=p_value;
- VisualServer::get_singleton()->particles_set_variable(particles,(VS::ParticleVariable)p_variable,p_value);
- if (p_variable==VAR_SPREAD)
- update_gizmo();
+ VisualServer::get_singleton()->particles_restart(particles);
}
-float Particles::get_variable(Variable p_variable) const {
+Rect3 Particles::capture_aabb() const {
+
+ return VS::get_singleton()->particles_get_current_aabb(particles);
+}
- ERR_FAIL_INDEX_V(p_variable,VAR_MAX,-1);
- return var[p_variable];
+void Particles::_validate_property(PropertyInfo &property) const {
+ if (property.name.begins_with("draw_pass_")) {
+ int index = property.name.get_slicec('_', 2).to_int() - 1;
+ if (index >= draw_passes.size()) {
+ property.usage = 0;
+ return;
+ }
+ }
}
-void Particles::set_randomness(Variable p_variable,float p_randomness) {
+void Particles::_notification(int p_what) {
- ERR_FAIL_INDEX(p_variable,VAR_MAX);
- var_random[p_variable]=p_randomness;
- VisualServer::get_singleton()->particles_set_randomness(particles,(VS::ParticleVariable)p_variable,p_randomness);
+ if (p_what == NOTIFICATION_PAUSED || p_what == NOTIFICATION_UNPAUSED) {
+ if (can_process()) {
+ VS::get_singleton()->particles_set_speed_scale(particles, speed_scale);
+ } else {
+ VS::get_singleton()->particles_set_speed_scale(particles, 0);
+ }
+ }
}
-float Particles::get_randomness(Variable p_variable) const {
- ERR_FAIL_INDEX_V(p_variable,VAR_MAX,-1);
- return var_random[p_variable];
+void Particles::_bind_methods() {
-}
+ ClassDB::bind_method(D_METHOD("set_emitting", "emitting"), &Particles::set_emitting);
+ ClassDB::bind_method(D_METHOD("set_amount", "amount"), &Particles::set_amount);
+ ClassDB::bind_method(D_METHOD("set_lifetime", "secs"), &Particles::set_lifetime);
+ ClassDB::bind_method(D_METHOD("set_one_shot", "enable"), &Particles::set_one_shot);
+ ClassDB::bind_method(D_METHOD("set_pre_process_time", "secs"), &Particles::set_pre_process_time);
+ ClassDB::bind_method(D_METHOD("set_explosiveness_ratio", "ratio"), &Particles::set_explosiveness_ratio);
+ ClassDB::bind_method(D_METHOD("set_randomness_ratio", "ratio"), &Particles::set_randomness_ratio);
+ ClassDB::bind_method(D_METHOD("set_visibility_aabb", "aabb"), &Particles::set_visibility_aabb);
+ ClassDB::bind_method(D_METHOD("set_use_local_coordinates", "enable"), &Particles::set_use_local_coordinates);
+ ClassDB::bind_method(D_METHOD("set_fixed_fps", "fps"), &Particles::set_fixed_fps);
+ ClassDB::bind_method(D_METHOD("set_fractional_delta", "enable"), &Particles::set_fractional_delta);
+ ClassDB::bind_method(D_METHOD("set_process_material", "material"), &Particles::set_process_material);
+ ClassDB::bind_method(D_METHOD("set_speed_scale", "scale"), &Particles::set_speed_scale);
+
+ ClassDB::bind_method(D_METHOD("is_emitting"), &Particles::is_emitting);
+ ClassDB::bind_method(D_METHOD("get_amount"), &Particles::get_amount);
+ ClassDB::bind_method(D_METHOD("get_lifetime"), &Particles::get_lifetime);
+ ClassDB::bind_method(D_METHOD("get_one_shot"), &Particles::get_one_shot);
+ ClassDB::bind_method(D_METHOD("get_pre_process_time"), &Particles::get_pre_process_time);
+ ClassDB::bind_method(D_METHOD("get_explosiveness_ratio"), &Particles::get_explosiveness_ratio);
+ ClassDB::bind_method(D_METHOD("get_randomness_ratio"), &Particles::get_randomness_ratio);
+ ClassDB::bind_method(D_METHOD("get_visibility_aabb"), &Particles::get_visibility_aabb);
+ ClassDB::bind_method(D_METHOD("get_use_local_coordinates"), &Particles::get_use_local_coordinates);
+ ClassDB::bind_method(D_METHOD("get_fixed_fps"), &Particles::get_fixed_fps);
+ ClassDB::bind_method(D_METHOD("get_fractional_delta"), &Particles::get_fractional_delta);
+ ClassDB::bind_method(D_METHOD("get_process_material"), &Particles::get_process_material);
+ ClassDB::bind_method(D_METHOD("get_speed_scale"), &Particles::get_speed_scale);
+
+ ClassDB::bind_method(D_METHOD("set_draw_order", "order"), &Particles::set_draw_order);
+
+ ClassDB::bind_method(D_METHOD("get_draw_order"), &Particles::get_draw_order);
+
+ ClassDB::bind_method(D_METHOD("set_draw_passes", "passes"), &Particles::set_draw_passes);
+ ClassDB::bind_method(D_METHOD("set_draw_pass_mesh", "pass", "mesh"), &Particles::set_draw_pass_mesh);
+
+ ClassDB::bind_method(D_METHOD("get_draw_passes"), &Particles::get_draw_passes);
+ ClassDB::bind_method(D_METHOD("get_draw_pass_mesh", "pass"), &Particles::get_draw_pass_mesh);
+
+ ClassDB::bind_method(D_METHOD("restart"), &Particles::restart);
+ ClassDB::bind_method(D_METHOD("capture_aabb"), &Particles::capture_aabb);
+
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_RANGE, "1,100000,1"), "set_amount", "get_amount");
+ ADD_GROUP("Time", "");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01"), "set_lifetime", "get_lifetime");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "get_one_shot");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "preprocess", PROPERTY_HINT_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_speed_scale", "get_speed_scale");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta");
+ ADD_GROUP("Drawing", "");
+ ADD_PROPERTY(PropertyInfo(Variant::RECT3, "visibility_aabb"), "set_visibility_aabb", "get_visibility_aabb");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "local_coords"), "set_use_local_coordinates", "get_use_local_coordinates");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "draw_order", PROPERTY_HINT_ENUM, "Index,Lifetime,View Depth"), "set_draw_order", "get_draw_order");
+ ADD_GROUP("Process Material", "");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "process_material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,ParticlesMaterial"), "set_process_material", "get_process_material");
+ ADD_GROUP("Draw Passes", "draw_");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "draw_passes", PROPERTY_HINT_RANGE, "0," + itos(MAX_DRAW_PASSES) + ",1"), "set_draw_passes", "get_draw_passes");
+ for (int i = 0; i < MAX_DRAW_PASSES; i++) {
+
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "draw_pass_" + itos(i + 1), PROPERTY_HINT_RESOURCE_TYPE, "Mesh"), "set_draw_pass_mesh", "get_draw_pass_mesh", i);
+ }
-void Particles::set_color_phase_pos(int p_phase, float p_pos) {
+ BIND_CONSTANT(DRAW_ORDER_INDEX);
+ BIND_CONSTANT(DRAW_ORDER_LIFETIME);
+ BIND_CONSTANT(DRAW_ORDER_VIEW_DEPTH);
+ BIND_CONSTANT(MAX_DRAW_PASSES);
+}
- ERR_FAIL_INDEX(p_phase,VS::MAX_PARTICLE_COLOR_PHASES);
- color_phase[p_phase].pos=p_pos;
- VisualServer::get_singleton()->particles_set_color_phase_pos(particles,p_phase,p_pos);
+Particles::Particles() {
+ particles = VS::get_singleton()->particles_create();
+ set_base(particles);
+ set_emitting(true);
+ set_one_shot(false);
+ set_amount(8);
+ set_lifetime(1);
+ set_fixed_fps(0);
+ set_fractional_delta(true);
+ set_pre_process_time(0);
+ set_explosiveness_ratio(0);
+ set_randomness_ratio(0);
+ set_visibility_aabb(Rect3(Vector3(-4, -4, -4), Vector3(8, 8, 8)));
+ set_use_local_coordinates(true);
+ set_draw_passes(1);
+ set_draw_order(DRAW_ORDER_INDEX);
+ set_speed_scale(1);
}
-float Particles::get_color_phase_pos(int p_phase) const {
- ERR_FAIL_INDEX_V(p_phase,VS::MAX_PARTICLE_COLOR_PHASES,-1);
- return color_phase[p_phase].pos;
+Particles::~Particles() {
+
+ VS::get_singleton()->free(particles);
}
-void Particles::set_color_phase_color(int p_phase, const Color& p_color) {
+//////////////////////////////////////
+
+Mutex *ParticlesMaterial::material_mutex = NULL;
+SelfList<ParticlesMaterial>::List ParticlesMaterial::dirty_materials;
+Map<ParticlesMaterial::MaterialKey, ParticlesMaterial::ShaderData> ParticlesMaterial::shader_map;
+ParticlesMaterial::ShaderNames *ParticlesMaterial::shader_names = NULL;
- ERR_FAIL_INDEX(p_phase,VS::MAX_PARTICLE_COLOR_PHASES);
- color_phase[p_phase].color=p_color;
- VisualServer::get_singleton()->particles_set_color_phase_color(particles,p_phase,p_color);
+void ParticlesMaterial::init_shaders() {
+#ifndef NO_THREADS
+ material_mutex = Mutex::create();
+#endif
+
+ shader_names = memnew(ShaderNames);
+
+ shader_names->spread = "spread";
+ shader_names->flatness = "flatness";
+ shader_names->initial_linear_velocity = "initial_linear_velocity";
+ shader_names->initial_angle = "initial_angle";
+ shader_names->angular_velocity = "angular_velocity";
+ shader_names->orbit_velocity = "orbit_velocity";
+ shader_names->linear_accel = "linear_accel";
+ shader_names->radial_accel = "radial_accel";
+ shader_names->tangent_accel = "tangent_accel";
+ shader_names->damping = "damping";
+ shader_names->scale = "scale";
+ shader_names->hue_variation = "hue_variation";
+ shader_names->anim_speed = "anim_speed";
+ shader_names->anim_offset = "anim_offset";
+
+ shader_names->initial_linear_velocity_random = "initial_linear_velocity_random";
+ shader_names->initial_angle_random = "initial_angle_random";
+ shader_names->angular_velocity_random = "angular_velocity_random";
+ shader_names->orbit_velocity_random = "orbit_velocity_random";
+ shader_names->linear_accel_random = "linear_accel_random";
+ shader_names->radial_accel_random = "radial_accel_random";
+ shader_names->tangent_accel_random = "tangent_accel_random";
+ shader_names->damping_random = "damping_random";
+ shader_names->scale_random = "scale_random";
+ shader_names->hue_variation_random = "hue_variation_random";
+ shader_names->anim_speed_random = "anim_speed_random";
+ shader_names->anim_offset_random = "anim_offset_random";
+
+ shader_names->angle_texture = "angle_texture";
+ shader_names->angular_velocity_texture = "angular_velocity_texture";
+ shader_names->orbit_velocity_texture = "orbit_velocity_texture";
+ shader_names->linear_accel_texture = "linear_accel_texture";
+ shader_names->radial_accel_texture = "radial_accel_texture";
+ shader_names->tangent_accel_texture = "tangent_accel_texture";
+ shader_names->damping_texture = "damping_texture";
+ shader_names->scale_texture = "scale_texture";
+ shader_names->hue_variation_texture = "hue_variation_texture";
+ shader_names->anim_speed_texture = "anim_speed_texture";
+ shader_names->anim_offset_texture = "anim_offset_texture";
+
+ shader_names->color = "color_value";
+ shader_names->color_ramp = "color_ramp";
+
+ shader_names->emission_sphere_radius = "emission_sphere_radius";
+ shader_names->emission_box_extents = "emission_box_extents";
+ shader_names->emission_texture_point_count = "emission_texture_point_count";
+ shader_names->emission_texture_points = "emission_texture_points";
+ shader_names->emission_texture_normal = "emission_texture_normal";
+ shader_names->emission_texture_color = "emission_texture_color";
+
+ shader_names->trail_divisor = "trail_divisor";
+ shader_names->trail_size_modifier = "trail_size_modifier";
+ shader_names->trail_color_modifier = "trail_color_modifier";
+
+ shader_names->gravity = "gravity";
}
-Color Particles::get_color_phase_color(int p_phase) const {
- ERR_FAIL_INDEX_V(p_phase,VS::MAX_PARTICLE_COLOR_PHASES,Color());
- return color_phase[p_phase].color;
+void ParticlesMaterial::finish_shaders() {
+
+#ifndef NO_THREADS
+ memdelete(material_mutex);
+#endif
+ memdelete(shader_names);
}
-void Particles::set_material(const Ref<Material>& p_material) {
+void ParticlesMaterial::_update_shader() {
+
+ print_line("updating shader");
+
+ dirty_materials.remove(&element);
+
+ MaterialKey mk = _compute_key();
+ if (mk.key == current_key.key)
+ return; //no update required in the end
+
+ if (shader_map.has(current_key)) {
+ shader_map[current_key].users--;
+ if (shader_map[current_key].users == 0) {
+ //deallocate shader, as it's no longer in use
+ VS::get_singleton()->free(shader_map[current_key].shader);
+ shader_map.erase(current_key);
+ }
+ }
+
+ current_key = mk;
+
+ if (shader_map.has(mk)) {
+
+ VS::get_singleton()->material_set_shader(_get_material(), shader_map[mk].shader);
+ shader_map[mk].users++;
+ return;
+ }
+
+ //must create a shader!
+
+ String code = "shader_type particles;\n";
+
+ code += "uniform float spread;\n";
+ code += "uniform float flatness;\n";
+ code += "uniform float initial_linear_velocity;\n";
+ code += "uniform float initial_angle;\n";
+ code += "uniform float angular_velocity;\n";
+ code += "uniform float orbit_velocity;\n";
+ code += "uniform float linear_accel;\n";
+ code += "uniform float radial_accel;\n";
+ code += "uniform float tangent_accel;\n";
+ code += "uniform float damping;\n";
+ code += "uniform float scale;\n";
+ code += "uniform float hue_variation;\n";
+ code += "uniform float anim_speed;\n";
+ code += "uniform float anim_offset;\n";
+
+ code += "uniform float initial_linear_velocity_random;\n";
+ code += "uniform float initial_angle_random;\n";
+ code += "uniform float angular_velocity_random;\n";
+ code += "uniform float orbit_velocity_random;\n";
+ code += "uniform float linear_accel_random;\n";
+ code += "uniform float radial_accel_random;\n";
+ code += "uniform float tangent_accel_random;\n";
+ code += "uniform float damping_random;\n";
+ code += "uniform float scale_random;\n";
+ code += "uniform float hue_variation_random;\n";
+ code += "uniform float anim_speed_random;\n";
+ code += "uniform float anim_offset_random;\n";
+
+ switch (emission_shape) {
+ case EMISSION_SHAPE_POINT: {
+ //do none
+ } break;
+ case EMISSION_SHAPE_SPHERE: {
+ code += "uniform float emission_sphere_radius;\n";
+ } break;
+ case EMISSION_SHAPE_BOX: {
+ code += "uniform vec3 emission_box_extents;\n";
+ } break;
+ case EMISSION_SHAPE_DIRECTED_POINTS: {
+ code += "uniform sampler2D emission_texture_normal : hint_black;\n";
+ } //fallthrough
+ case EMISSION_SHAPE_POINTS: {
+ code += "uniform sampler2D emission_texture_points : hint_black;\n";
+ code += "uniform int emission_texture_point_count;\n";
+ if (emission_color_texture.is_valid()) {
+ code += "uniform sampler2D emission_texture_color : hint_white;\n";
+ }
+ } break;
+ }
+
+ code += "uniform vec4 color_value : hint_color;\n";
+
+ code += "uniform int trail_divisor;\n";
+
+ code += "uniform vec3 gravity;\n";
+
+ if (color_ramp.is_valid())
+ code += "uniform sampler2D color_ramp;\n";
+
+ if (tex_parameters[PARAM_INITIAL_LINEAR_VELOCITY].is_valid())
+ code += "uniform sampler2D linear_velocity_texture;\n";
+ if (tex_parameters[PARAM_ORBIT_VELOCITY].is_valid())
+ code += "uniform sampler2D orbit_velocity_texture;\n";
+ if (tex_parameters[PARAM_ANGULAR_VELOCITY].is_valid())
+ code += "uniform sampler2D angular_velocity_texture;\n";
+ if (tex_parameters[PARAM_LINEAR_ACCEL].is_valid())
+ code += "uniform sampler2D linear_accel_texture;\n";
+ if (tex_parameters[PARAM_RADIAL_ACCEL].is_valid())
+ code += "uniform sampler2D radial_accel_texture;\n";
+ if (tex_parameters[PARAM_TANGENTIAL_ACCEL].is_valid())
+ code += "uniform sampler2D tangent_accel_texture;\n";
+ if (tex_parameters[PARAM_DAMPING].is_valid())
+ code += "uniform sampler2D damping_texture;\n";
+ if (tex_parameters[PARAM_ANGLE].is_valid())
+ code += "uniform sampler2D angle_texture;\n";
+ if (tex_parameters[PARAM_SCALE].is_valid())
+ code += "uniform sampler2D scale_texture;\n";
+ if (tex_parameters[PARAM_HUE_VARIATION].is_valid())
+ code += "uniform sampler2D hue_variation_texture;\n";
+ if (tex_parameters[PARAM_ANIM_SPEED].is_valid())
+ code += "uniform sampler2D anim_speed_texture;\n";
+ if (tex_parameters[PARAM_ANIM_OFFSET].is_valid())
+ code += "uniform sampler2D anim_offset_texture;\n";
+
+ if (trail_size_modifier.is_valid()) {
+ code += "uniform sampler2D trail_size_modifier;\n";
+ }
+
+ if (trail_color_modifier.is_valid()) {
+ code += "uniform sampler2D trail_color_modifier;\n";
+ }
+
+ //need a random function
+ code += "\n\n";
+ code += "float rand_from_seed(inout uint seed) {\n";
+ code += " int k;\n";
+ code += " int s = int(seed);\n";
+ code += " if (s == 0)\n";
+ code += " s = 305420679;\n";
+ code += " k = s / 127773;\n";
+ code += " s = 16807 * (s - k * 127773) - 2836 * k;\n";
+ code += " if (s < 0)\n";
+ code += " s += 2147483647;\n";
+ code += " seed = uint(s);\n";
+ code += " return float(seed % uint(65536))/65535.0;\n";
+ code += "}\n";
+ //improve seed quality
+ code += "uint hash(uint x) {\n";
+ code += " x = ((x >> uint(16)) ^ x) * uint(73244475);\n";
+ code += " x = ((x >> uint(16)) ^ x) * uint(73244475);\n";
+ code += " x = (x >> uint(16)) ^ x;\n";
+ code += " return x;\n";
+ code += "}\n";
+ code += "void vertex() {\n\n";
+ code += "\n";
+
+ code += " uint base_number=NUMBER/uint(trail_divisor);\n";
+ code += " uint alt_seed=hash(base_number+uint(1)+RANDOM_SEED);\n";
+ code += " float angle_rand=rand_from_seed(alt_seed);\n";
+ code += " float scale_rand=rand_from_seed(alt_seed);\n";
+ code += " float hue_rot_rand=rand_from_seed(alt_seed);\n";
+ code += " float anim_offset_rand=rand_from_seed(alt_seed);\n";
+ code += "\n";
+ code += "\n";
+ code += "\n";
+ code += "\n";
+ if (emission_shape >= EMISSION_SHAPE_POINTS) {
+ code += " int point = min(emission_texture_point_count-1,int(rand_from_seed(alt_seed) * float(emission_texture_point_count)));\n";
+ code += " ivec2 emission_tex_size = textureSize( emission_texture_points, 0 );\n";
+ code += " ivec2 emission_tex_ofs = ivec2( point % emission_tex_size.x, point / emission_tex_size.x );\n";
+ }
+ code += " if (RESTART) {\n";
+
+ if (tex_parameters[PARAM_INITIAL_LINEAR_VELOCITY].is_valid())
+ code += " float tex_linear_velocity = textureLod(linear_velocity_texture,vec2(0.0,0.0),0.0).r;\n";
+ else
+ code += " float tex_linear_velocity = 0.0;\n";
+
+ if (tex_parameters[PARAM_ANGLE].is_valid())
+ code += " float tex_angle = textureLod(angle_texture,vec2(0.0,0.0),0.0).r;\n";
+ else
+ code += " float tex_angle = 0.0;\n";
+
+ if (tex_parameters[PARAM_ANIM_OFFSET].is_valid())
+ code += " float tex_anim_offset = textureLod(anim_offset_texture,vec2(0.0,0.0),0.0).r;\n";
+ else
+ code += " float tex_anim_offset = 0.0;\n";
+
+ if (flags[FLAG_DISABLE_Z]) {
+
+ code += " float angle1 = (rand_from_seed(alt_seed)*2.0-1.0)*spread/180.0*3.1416;\n";
+ code += " vec3 rot=vec3( cos(angle1), sin(angle1),0.0 );\n";
+ code += " VELOCITY=(rot*initial_linear_velocity+rot*initial_linear_velocity_random*rand_from_seed(alt_seed));\n";
+
+ } else {
+ //initiate velocity spread in 3D
+ code += " float angle1 = rand_from_seed(alt_seed)*spread*3.1416;\n";
+ code += " float angle2 = rand_from_seed(alt_seed)*20.0*3.1416; // make it more random like\n";
+ code += " vec3 rot_xz=vec3( sin(angle1), 0.0, cos(angle1) );\n";
+ code += " vec3 rot = vec3( cos(angle2)*rot_xz.x,sin(angle2)*rot_xz.x, rot_xz.z);\n";
+ code += " VELOCITY=(rot*initial_linear_velocity+rot*initial_linear_velocity_random*rand_from_seed(alt_seed));\n";
+ }
+
+ code += " float base_angle=(initial_angle+tex_angle)*mix(1.0,angle_rand,initial_angle_random);\n";
+ code += " CUSTOM.x=base_angle*3.1416/180.0;\n"; //angle
+ code += " CUSTOM.y=0.0;\n"; //phase
+ code += " CUSTOM.z=(anim_offset+tex_anim_offset)*mix(1.0,anim_offset_rand,anim_offset_random);\n"; //animation offset (0-1)
+ switch (emission_shape) {
+ case EMISSION_SHAPE_POINT: {
+ //do none
+ } break;
+ case EMISSION_SHAPE_SPHERE: {
+ code += " TRANSFORM[3].xyz = normalize(vec3(rand_from_seed(alt_seed) * 2.0 - 1.0, rand_from_seed(alt_seed) * 2.0-1.0, rand_from_seed(alt_seed) * 2.0-1.0 ))*emission_sphere_radius;\n";
+ } break;
+ case EMISSION_SHAPE_BOX: {
+ code += " TRANSFORM[3].xyz = vec3(rand_from_seed(alt_seed) * 2.0 - 1.0, rand_from_seed(alt_seed) * 2.0-1.0, rand_from_seed(alt_seed) * 2.0-1.0)*emission_box_extents;\n";
+ } break;
+ case EMISSION_SHAPE_POINTS:
+ case EMISSION_SHAPE_DIRECTED_POINTS: {
+ code += " TRANSFORM[3].xyz = texelFetch(emission_texture_points, emission_tex_ofs,0).xyz;\n";
+
+ if (emission_shape == EMISSION_SHAPE_DIRECTED_POINTS) {
+ if (flags[FLAG_DISABLE_Z]) {
+
+ code += " mat2 rotm;";
+ code += " rotm[0]=texelFetch(emission_texture_normal, emission_tex_ofs,0).xy;\n";
+ code += " rotm[1]=rotm[0].yx * vec2(1.0,-1.0);\n";
+ code += " VELOCITY.xy = rotm * VELOCITY.xy;\n";
+ } else {
+ code += " vec3 normal = texelFetch(emission_texture_normal, emission_tex_ofs,0).xyz;\n";
+ code += " vec3 v0 = abs(normal.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(0, 1.0, 0.0);\n";
+ code += " vec3 tangent = normalize(cross(v0, normal));\n";
+ code += " vec3 bitangent = normalize(cross(tangent, normal));\n";
+ code += " VELOCITY = mat3(tangent,bitangent,normal) * VELOCITY;\n";
+ }
+ }
+ } break;
+ }
+ code += " VELOCITY = (EMISSION_TRANSFORM * vec4(VELOCITY,0.0)).xyz;\n";
+ code += " TRANSFORM = EMISSION_TRANSFORM * TRANSFORM;\n";
+ if (flags[FLAG_DISABLE_Z]) {
+ code += " VELOCITY.z=0.0;\n";
+ code += " TRANSFORM[3].z=0.0;\n";
+ }
+
+ code += " } else {\n";
+
+ code += " CUSTOM.y+=DELTA/LIFETIME;\n";
+ if (tex_parameters[PARAM_INITIAL_LINEAR_VELOCITY].is_valid())
+ code += " float tex_linear_velocity = textureLod(linear_velocity_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_linear_velocity = 0.0;\n";
+
+ if (tex_parameters[PARAM_ORBIT_VELOCITY].is_valid())
+ code += " float tex_orbit_velocity = textureLod(orbit_velocity_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_orbit_velocity = 0.0;\n";
+
+ if (tex_parameters[PARAM_ANGULAR_VELOCITY].is_valid())
+ code += " float tex_angular_velocity = textureLod(angular_velocity_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_angular_velocity = 0.0;\n";
+
+ if (tex_parameters[PARAM_LINEAR_ACCEL].is_valid())
+ code += " float tex_linear_accel = textureLod(linear_accel_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_linear_accel = 0.0;\n";
+
+ if (tex_parameters[PARAM_RADIAL_ACCEL].is_valid())
+ code += " float tex_radial_accel = textureLod(radial_accel_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_radial_accel = 0.0;\n";
+
+ if (tex_parameters[PARAM_TANGENTIAL_ACCEL].is_valid())
+ code += " float tex_tangent_accel = textureLod(tangent_accel_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_tangent_accel = 0.0;\n";
+
+ if (tex_parameters[PARAM_DAMPING].is_valid())
+ code += " float tex_damping = textureLod(damping_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_damping = 0.0;\n";
+
+ if (tex_parameters[PARAM_ANGLE].is_valid())
+ code += " float tex_angle = textureLod(angle_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_angle = 0.0;\n";
+
+ if (tex_parameters[PARAM_ANIM_SPEED].is_valid())
+ code += " float tex_anim_speed = textureLod(anim_speed_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_anim_speed = 0.0;\n";
+
+ if (tex_parameters[PARAM_ANIM_OFFSET].is_valid())
+ code += " float tex_anim_offset = textureLod(anim_offset_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_anim_offset = 0.0;\n";
+
+ code += " vec3 force = gravity; \n";
+ code += " vec3 pos = TRANSFORM[3].xyz; \n";
+ if (flags[FLAG_DISABLE_Z]) {
+ code += " pos.z=0.0; \n";
+ }
+ code += " //apply linear acceleration\n";
+ code += " force+= length(VELOCITY) > 0.0 ? normalize(VELOCITY) * (linear_accel+tex_linear_accel)*mix(1.0,rand_from_seed(alt_seed),linear_accel_random) : vec3(0.0);\n";
+ code += " //apply radial acceleration\n";
+ code += " vec3 org = vec3(0.0);\n";
+ code += " // if (!p_system->local_coordinates)\n";
+ code += " //org=p_transform.origin;\n";
+ code += " vec3 diff = pos-org;\n";
+ code += " force+=length(diff) > 0.0 ? normalize(diff) * (radial_accel+tex_radial_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random) : vec3(0.0);\n";
+ code += " //apply tangential acceleration;\n";
+ if (flags[FLAG_DISABLE_Z]) {
+ code += " force+=length(diff.yx) > 0.0 ? vec3(normalize(diff.yx * vec2(-1.0,1.0)),0.0) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random)) : vec3(0.0);\n";
- material=p_material;
- if(material.is_null()) {
- VisualServer::get_singleton()->particles_set_material(particles,RID());
} else {
- VisualServer::get_singleton()->particles_set_material(particles,material->get_rid());
+ code += " vec3 crossDiff = cross(normalize(diff),normalize(gravity));\n";
+ code += " force+=length(crossDiff) > 0.0 ? normalize(crossDiff) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random)) : vec3(0.0);\n";
+ }
+ code += " //apply attractor forces\n";
+ code += " VELOCITY+=force * DELTA;\n";
+ if (tex_parameters[PARAM_INITIAL_LINEAR_VELOCITY].is_valid()) {
+ code += " VELOCITY=normalize(VELOCITY)*tex_linear_velocity;\n";
}
+ code += " if (damping+tex_damping>0.0) {\n";
+ code += " \n";
+ code += " float v = length(VELOCITY);\n";
+ code += " float damp = (damping+tex_damping)*mix(1.0,rand_from_seed(alt_seed),damping_random);\n";
+ code += " v -= damp * DELTA;\n";
+ code += " if (v<0.0) {\n";
+ code += " VELOCITY=vec3(0.0);\n";
+ code += " } else {\n";
+ code += " VELOCITY=normalize(VELOCITY) * v;\n";
+ code += " }\n";
+ code += " }\n";
+ code += " float base_angle=(initial_angle+tex_angle)*mix(1.0,angle_rand,initial_angle_random);\n";
+ code += " base_angle+=CUSTOM.y*LIFETIME*(angular_velocity+tex_angular_velocity)*mix(1.0,rand_from_seed(alt_seed)*2.0-1.0,angular_velocity_random);\n";
+ code += " CUSTOM.x=base_angle*3.1416/180.0;\n"; //angle
+ code += " CUSTOM.z=(anim_offset+tex_anim_offset)*mix(1.0,anim_offset_rand,anim_offset_random)+CUSTOM.y*(anim_speed+tex_anim_speed)*mix(1.0,rand_from_seed(alt_seed),anim_speed_random);\n"; //angle
+ if (flags[FLAG_ANIM_LOOP]) {
+ code += " CUSTOM.z=mod(CUSTOM.z,1.0);\n"; //loop
+ } else {
+ code += " CUSTOM.z=clamp(CUSTOM.z,0.0,1.0);\n"; //0 to 1 only
+ }
+ code += " }\n";
+ //apply color
+ //apply hue rotation
+ if (tex_parameters[PARAM_SCALE].is_valid())
+ code += " float tex_scale = textureLod(scale_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_scale = 1.0;\n";
+
+ if (tex_parameters[PARAM_HUE_VARIATION].is_valid())
+ code += " float tex_hue_variation = textureLod(hue_variation_texture,vec2(CUSTOM.y,0.0),0.0).r;\n";
+ else
+ code += " float tex_hue_variation = 0.0;\n";
+
+ code += " float hue_rot_angle = (hue_variation+tex_hue_variation)*3.1416*2.0*mix(1.0,hue_rot_rand*2.0-1.0,hue_variation_random);\n";
+ code += " float hue_rot_c = cos(hue_rot_angle);\n";
+ code += " float hue_rot_s = sin(hue_rot_angle);\n";
+ code += " mat4 hue_rot_mat = mat4( vec4(0.299, 0.587, 0.114, 0.0),\n";
+ code += " vec4(0.299, 0.587, 0.114, 0.0),\n";
+ code += " vec4(0.299, 0.587, 0.114, 0.0),\n";
+ code += " vec4(0.000, 0.000, 0.000, 1.0)) +\n";
+ code += " \n";
+ code += " mat4( vec4(0.701, -0.587, -0.114, 0.0),\n";
+ code += " vec4(-0.299, 0.413, -0.114, 0.0),\n";
+ code += " vec4(-0.300, -0.588, 0.886, 0.0),\n";
+ code += " vec4(0.000, 0.000, 0.000, 0.0)) * hue_rot_c +\n";
+ code += "\n";
+ code += " mat4( vec4(0.168, 0.330, -0.497, 0.0),\n";
+ code += " vec4(-0.328, 0.035, 0.292, 0.0),\n";
+ code += " vec4(1.250, -1.050, -0.203, 0.0),\n";
+ code += " vec4(0.000, 0.000, 0.000, 0.0)) * hue_rot_s;\n";
+ if (color_ramp.is_valid()) {
+ code += " COLOR = textureLod(color_ramp,vec2(CUSTOM.y,0.0),0.0) * hue_rot_mat;\n";
+ } else {
+ code += " COLOR = color_value * hue_rot_mat;\n";
+ }
+ if (emission_color_texture.is_valid() && emission_shape >= EMISSION_SHAPE_POINTS) {
+ code += " COLOR*= texelFetch(emission_texture_color,emission_tex_ofs,0);\n";
+ }
+ if (trail_color_modifier.is_valid()) {
+ code += "if (trail_divisor>1) { COLOR*=textureLod(trail_color_modifier,vec2(float(int(NUMBER)%trail_divisor)/float(trail_divisor-1),0.0),0.0); }\n";
+ }
+ code += "\n";
+
+ if (flags[FLAG_DISABLE_Z]) {
+
+ code += " TRANSFORM[0]=vec4(cos(CUSTOM.x),-sin(CUSTOM.x),0.0,0.0);\n";
+ code += " TRANSFORM[1]=vec4(sin(CUSTOM.x),cos(CUSTOM.x),0.0,0.0);\n";
+ code += " TRANSFORM[2]=vec4(0.0,0.0,1.0,0.0);\n";
+
+ } else {
+ //orient particle Y towards velocity
+ if (flags[FLAG_ALIGN_Y_TO_VELOCITY]) {
+ code += " if (length(VELOCITY)>0.0) {TRANSFORM[1].xyz=normalize(VELOCITY);} else {TRANSFORM[1].xyz=normalize(TRANSFORM[1].xyz);}\n";
+ code += " if (TRANSFORM[1].xyz==normalize(TRANSFORM[0].xyz)) {\n";
+ code += "\tTRANSFORM[0].xyz=normalize(cross(normalize(TRANSFORM[1].xyz),normalize(TRANSFORM[2].xyz)));\n";
+ code += "\tTRANSFORM[2].xyz=normalize(cross(normalize(TRANSFORM[0].xyz),normalize(TRANSFORM[1].xyz)));\n";
+ code += " } else {\n";
+ code += "\tTRANSFORM[2].xyz=normalize(cross(normalize(TRANSFORM[0].xyz),normalize(TRANSFORM[1].xyz)));\n";
+ code += "\tTRANSFORM[0].xyz=normalize(cross(normalize(TRANSFORM[1].xyz),normalize(TRANSFORM[2].xyz)));\n";
+ code += " }\n";
+ } else {
+ code += "\tTRANSFORM[0].xyz=normalize(TRANSFORM[0].xyz);\n";
+ code += "\tTRANSFORM[1].xyz=normalize(TRANSFORM[1].xyz);\n";
+ code += "\tTRANSFORM[2].xyz=normalize(TRANSFORM[2].xyz);\n";
+ }
+ //turn particle by rotation in Y
+ if (flags[FLAG_ROTATE_Y]) {
+ code += "\tTRANSFORM = TRANSFORM * mat4( vec4(cos(CUSTOM.x),0.0,-sin(CUSTOM.x),0.0), vec4(0.0,1.0,0.0,0.0),vec4(sin(CUSTOM.x),0.0,cos(CUSTOM.x),0.0),vec4(0.0,0.0,0.0,1.0));\n";
+ }
+ }
+ //scale by scale
+ code += " float base_scale=mix(scale*tex_scale,1.0,scale_random*scale_rand);\n";
+ if (trail_size_modifier.is_valid()) {
+ code += "if (trail_divisor>1) { base_scale*=textureLod(trail_size_modifier,vec2(float(int(NUMBER)%trail_divisor)/float(trail_divisor-1),0.0),0.0).r; } \n";
+ }
+
+ code += " TRANSFORM[0].xyz*=base_scale;\n";
+ code += " TRANSFORM[1].xyz*=base_scale;\n";
+ code += " TRANSFORM[2].xyz*=base_scale;\n";
+ if (flags[FLAG_DISABLE_Z]) {
+ code += " VELOCITY.z=0.0;\n";
+ code += " TRANSFORM[3].z=0.0;\n";
+ }
+ code += "}\n";
+ code += "\n";
+
+ ShaderData shader_data;
+ shader_data.shader = VS::get_singleton()->shader_create();
+ shader_data.users = 1;
+
+ VS::get_singleton()->shader_set_code(shader_data.shader, code);
+
+ shader_map[mk] = shader_data;
+
+ VS::get_singleton()->material_set_shader(_get_material(), shader_data.shader);
}
-void Particles::setup_timer() {
+void ParticlesMaterial::flush_changes() {
- if (emitting && emit_timeout > 0) {
+ if (material_mutex)
+ material_mutex->lock();
- timer->set_wait_time(emit_timeout);
- timer->start();
- timer->set_one_shot(true);
- };
-};
+ while (dirty_materials.first()) {
-void Particles::set_emit_timeout(float p_timeout) {
+ dirty_materials.first()->self()->_update_shader();
+ }
+
+ if (material_mutex)
+ material_mutex->unlock();
+}
+
+void ParticlesMaterial::_queue_shader_change() {
+
+ if (material_mutex)
+ material_mutex->lock();
+
+ print_line("queuing change");
+ if (!element.in_list()) {
+ print_line("not in list, adding");
+ dirty_materials.add(&element);
+ }
- emit_timeout = p_timeout;
- setup_timer();
-};
+ if (material_mutex)
+ material_mutex->unlock();
+}
+
+bool ParticlesMaterial::_is_shader_dirty() const {
-float Particles::get_emit_timeout() const {
+ bool dirty = false;
- return emit_timeout;
-};
+ if (material_mutex)
+ material_mutex->lock();
+ dirty = element.in_list();
-Ref<Material> Particles::get_material() const {
+ if (material_mutex)
+ material_mutex->unlock();
- return material;
+ return dirty;
}
-void Particles::set_height_from_velocity(bool p_enable) {
+void ParticlesMaterial::set_spread(float p_spread) {
- height_from_velocity=p_enable;
- VisualServer::get_singleton()->particles_set_height_from_velocity(particles,height_from_velocity);
+ spread = p_spread;
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->spread, p_spread);
}
-bool Particles::has_height_from_velocity() const {
+float ParticlesMaterial::get_spread() const {
- return height_from_velocity;
+ return spread;
}
-void Particles::set_color_phases(int p_phases) {
+void ParticlesMaterial::set_flatness(float p_flatness) {
- color_phase_count=p_phases;
- VisualServer::get_singleton()->particles_set_color_phases(particles,p_phases);
+ flatness = p_flatness;
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->flatness, p_flatness);
}
+float ParticlesMaterial::get_flatness() const {
-int Particles::get_color_phases() const{
+ return flatness;
+}
- return color_phase_count;
+void ParticlesMaterial::set_param(Parameter p_param, float p_value) {
+
+ ERR_FAIL_INDEX(p_param, PARAM_MAX);
+
+ parameters[p_param] = p_value;
+
+ switch (p_param) {
+ case PARAM_INITIAL_LINEAR_VELOCITY: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_linear_velocity, p_value);
+ } break;
+ case PARAM_ANGULAR_VELOCITY: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->angular_velocity, p_value);
+ } break;
+ case PARAM_ORBIT_VELOCITY: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->orbit_velocity, p_value);
+ } break;
+ case PARAM_LINEAR_ACCEL: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->linear_accel, p_value);
+ } break;
+ case PARAM_RADIAL_ACCEL: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->radial_accel, p_value);
+ } break;
+ case PARAM_TANGENTIAL_ACCEL: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->tangent_accel, p_value);
+ } break;
+ case PARAM_DAMPING: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->damping, p_value);
+ } break;
+ case PARAM_ANGLE: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_angle, p_value);
+ } break;
+ case PARAM_SCALE: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->scale, p_value);
+ } break;
+ case PARAM_HUE_VARIATION: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->hue_variation, p_value);
+ } break;
+ case PARAM_ANIM_SPEED: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_speed, p_value);
+ } break;
+ case PARAM_ANIM_OFFSET: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_offset, p_value);
+ } break;
+ case PARAM_MAX: {
+ };
+ }
}
+float ParticlesMaterial::get_param(Parameter p_param) const {
-bool Particles::_can_gizmo_scale() const {
+ ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0);
- return false;
+ return parameters[p_param];
+}
+
+void ParticlesMaterial::set_param_randomness(Parameter p_param, float p_value) {
+
+ ERR_FAIL_INDEX(p_param, PARAM_MAX);
+
+ randomness[p_param] = p_value;
+
+ switch (p_param) {
+ case PARAM_INITIAL_LINEAR_VELOCITY: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_linear_velocity_random, p_value);
+ } break;
+ case PARAM_ANGULAR_VELOCITY: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->angular_velocity_random, p_value);
+ } break;
+ case PARAM_ORBIT_VELOCITY: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->orbit_velocity_random, p_value);
+ } break;
+ case PARAM_LINEAR_ACCEL: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->linear_accel_random, p_value);
+ } break;
+ case PARAM_RADIAL_ACCEL: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->radial_accel_random, p_value);
+ } break;
+ case PARAM_TANGENTIAL_ACCEL: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->tangent_accel_random, p_value);
+ } break;
+ case PARAM_DAMPING: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->damping_random, p_value);
+ } break;
+ case PARAM_ANGLE: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_angle_random, p_value);
+ } break;
+ case PARAM_SCALE: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->scale_random, p_value);
+ } break;
+ case PARAM_HUE_VARIATION: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->hue_variation_random, p_value);
+ } break;
+ case PARAM_ANIM_SPEED: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_speed_random, p_value);
+ } break;
+ case PARAM_ANIM_OFFSET: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_offset_random, p_value);
+ } break;
+ case PARAM_MAX: {
+ };
+ }
}
+float ParticlesMaterial::get_param_randomness(Parameter p_param) const {
-void Particles::set_use_local_coordinates(bool p_use) {
+ ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0);
- local_coordinates=p_use;
- VisualServer::get_singleton()->particles_set_use_local_coordinates(particles,local_coordinates);
+ return randomness[p_param];
}
-bool Particles::is_using_local_coordinates() const{
+static void _adjust_curve_range(const Ref<Texture> &p_texture, float p_min, float p_max) {
- return local_coordinates;
+ Ref<CurveTexture> curve_tex = p_texture;
+ if (!curve_tex.is_valid())
+ return;
+
+ curve_tex->ensure_default_setup(p_min, p_max);
}
+void ParticlesMaterial::set_param_texture(Parameter p_param, const Ref<Texture> &p_texture) {
+
+ ERR_FAIL_INDEX(p_param, PARAM_MAX);
+
+ tex_parameters[p_param] = p_texture;
+
+ switch (p_param) {
+ case PARAM_INITIAL_LINEAR_VELOCITY: {
+ //do none for this one
+ } break;
+ case PARAM_ANGULAR_VELOCITY: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->angular_velocity_texture, p_texture);
+ _adjust_curve_range(p_texture, -360, 360);
+ } break;
+ case PARAM_ORBIT_VELOCITY: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->orbit_velocity_texture, p_texture);
+ _adjust_curve_range(p_texture, -500, 500);
+ } break;
+ case PARAM_LINEAR_ACCEL: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->linear_accel_texture, p_texture);
+ _adjust_curve_range(p_texture, -200, 200);
+ } break;
+ case PARAM_RADIAL_ACCEL: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->radial_accel_texture, p_texture);
+ _adjust_curve_range(p_texture, -200, 200);
+ } break;
+ case PARAM_TANGENTIAL_ACCEL: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->tangent_accel_texture, p_texture);
+ _adjust_curve_range(p_texture, -200, 200);
+ } break;
+ case PARAM_DAMPING: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->damping_texture, p_texture);
+ _adjust_curve_range(p_texture, 0, 100);
+ } break;
+ case PARAM_ANGLE: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->angle_texture, p_texture);
+ _adjust_curve_range(p_texture, -360, 360);
+ } break;
+ case PARAM_SCALE: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->scale_texture, p_texture);
+
+ Ref<CurveTexture> curve_tex = p_texture;
+ if (curve_tex.is_valid()) {
+ curve_tex->ensure_default_setup();
+ }
-RES Particles::_get_gizmo_geometry() const {
+ } break;
+ case PARAM_HUE_VARIATION: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->hue_variation_texture, p_texture);
+ _adjust_curve_range(p_texture, -1, 1);
+ } break;
+ case PARAM_ANIM_SPEED: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_speed_texture, p_texture);
+ _adjust_curve_range(p_texture, 0, 200);
+ } break;
+ case PARAM_ANIM_OFFSET: {
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_offset_texture, p_texture);
+ } break;
+ case PARAM_MAX: {
+ };
+ }
- Ref<SurfaceTool> surface_tool( memnew( SurfaceTool ));
+ _queue_shader_change();
+}
+Ref<Texture> ParticlesMaterial::get_param_texture(Parameter p_param) const {
- Ref<FixedSpatialMaterial> mat( memnew( FixedSpatialMaterial ));
+ ERR_FAIL_INDEX_V(p_param, PARAM_MAX, Ref<Texture>());
- mat->set_parameter( FixedSpatialMaterial::PARAM_DIFFUSE,Color(0.0,0.6,0.7,0.2) );
- mat->set_parameter( FixedSpatialMaterial::PARAM_EMISSION,Color(0.5,0.7,0.8) );
- mat->set_blend_mode( Material::BLEND_MODE_ADD );
- mat->set_flag(Material::FLAG_DOUBLE_SIDED,true);
- //mat->set_hint(Material::HINT_NO_DEPTH_DRAW,true);
+ return tex_parameters[p_param];
+}
+void ParticlesMaterial::set_color(const Color &p_color) {
- surface_tool->begin(Mesh::PRIMITIVE_TRIANGLES);
- surface_tool->set_material(mat);
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->color, p_color);
+ color = p_color;
+}
- int sides=16;
- int sections=24;
+Color ParticlesMaterial::get_color() const {
- //float len=1;
- float deg=Math::deg2rad(var[VAR_SPREAD]*180);
- if (deg==180)
- deg=179.5;
+ return color;
+}
- Vector3 to=Vector3(0,0,-1);
+void ParticlesMaterial::set_color_ramp(const Ref<Texture> &p_texture) {
- for(int j=0;j<sections;j++) {
+ color_ramp = p_texture;
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->color_ramp, p_texture);
+ _queue_shader_change();
+ _change_notify();
+}
- Vector3 p1=Matrix3(Vector3(1,0,0),deg*j/sections).xform(to);
- Vector3 p2=Matrix3(Vector3(1,0,0),deg*(j+1)/sections).xform(to);
+Ref<Texture> ParticlesMaterial::get_color_ramp() const {
- for(int i=0;i<sides;i++) {
+ return color_ramp;
+}
- Vector3 p1r = Matrix3(Vector3(0,0,1),Math_PI*2*float(i)/sides).xform(p1);
- Vector3 p1s = Matrix3(Vector3(0,0,1),Math_PI*2*float(i+1)/sides).xform(p1);
- Vector3 p2s = Matrix3(Vector3(0,0,1),Math_PI*2*float(i+1)/sides).xform(p2);
- Vector3 p2r = Matrix3(Vector3(0,0,1),Math_PI*2*float(i)/sides).xform(p2);
+void ParticlesMaterial::set_flag(Flags p_flag, bool p_enable) {
+ ERR_FAIL_INDEX(p_flag, FLAG_MAX);
+ flags[p_flag] = p_enable;
+ _queue_shader_change();
+}
- surface_tool->add_normal(p1r.normalized());
- surface_tool->add_vertex(p1r);
- surface_tool->add_normal(p1s.normalized());
- surface_tool->add_vertex(p1s);
- surface_tool->add_normal(p2s.normalized());
- surface_tool->add_vertex(p2s);
+bool ParticlesMaterial::get_flag(Flags p_flag) const {
+ ERR_FAIL_INDEX_V(p_flag, FLAG_MAX, false);
+ return flags[p_flag];
+}
- surface_tool->add_normal(p1r.normalized());
- surface_tool->add_vertex(p1r);
- surface_tool->add_normal(p2s.normalized());
- surface_tool->add_vertex(p2s);
- surface_tool->add_normal(p2r.normalized());
- surface_tool->add_vertex(p2r);
+void ParticlesMaterial::set_emission_shape(EmissionShape p_shape) {
- if (j==sections-1) {
+ emission_shape = p_shape;
+ _change_notify();
+ _queue_shader_change();
+}
- surface_tool->add_normal(p2r.normalized());
- surface_tool->add_vertex(p2r);
- surface_tool->add_normal(p2s.normalized());
- surface_tool->add_vertex(p2s);
- surface_tool->add_normal(Vector3(0,0,1));
- surface_tool->add_vertex(Vector3());
- }
- }
- }
+void ParticlesMaterial::set_emission_sphere_radius(float p_radius) {
+
+ emission_sphere_radius = p_radius;
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_sphere_radius, p_radius);
+}
+
+void ParticlesMaterial::set_emission_box_extents(Vector3 p_extents) {
+
+ emission_box_extents = p_extents;
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_box_extents, p_extents);
+}
+
+void ParticlesMaterial::set_emission_point_texture(const Ref<Texture> &p_points) {
+
+ emission_point_texture = p_points;
+ RID texture;
+ if (p_points.is_valid())
+ texture = p_points->get_rid();
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_points, texture);
+}
+
+void ParticlesMaterial::set_emission_normal_texture(const Ref<Texture> &p_normals) {
+
+ emission_normal_texture = p_normals;
+ RID texture;
+ if (p_normals.is_valid())
+ texture = p_normals->get_rid();
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_normal, texture);
+}
+
+void ParticlesMaterial::set_emission_color_texture(const Ref<Texture> &p_colors) {
+
+ emission_color_texture = p_colors;
+ RID texture;
+ if (p_colors.is_valid())
+ texture = p_colors->get_rid();
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_color, texture);
+ _queue_shader_change();
+}
+
+void ParticlesMaterial::set_emission_point_count(int p_count) {
+
+ emission_point_count = p_count;
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_point_count, p_count);
+}
+ParticlesMaterial::EmissionShape ParticlesMaterial::get_emission_shape() const {
- Ref<Mesh> mesh = surface_tool->commit();
+ return emission_shape;
+}
- Ref<FixedSpatialMaterial> mat_aabb( memnew( FixedSpatialMaterial ));
+float ParticlesMaterial::get_emission_sphere_radius() const {
- mat_aabb->set_parameter( FixedSpatialMaterial::PARAM_DIFFUSE,Color(0.8,0.8,0.9,0.7) );
- mat_aabb->set_line_width(3);
- mat_aabb->set_flag( Material::FLAG_UNSHADED, true );
+ return emission_sphere_radius;
+}
+Vector3 ParticlesMaterial::get_emission_box_extents() const {
- surface_tool->begin(Mesh::PRIMITIVE_LINES);
- surface_tool->set_material(mat_aabb);
+ return emission_box_extents;
+}
+Ref<Texture> ParticlesMaterial::get_emission_point_texture() const {
- for(int i=0;i<12;i++) {
+ return emission_point_texture;
+}
+Ref<Texture> ParticlesMaterial::get_emission_normal_texture() const {
- Vector3 f,t;
- visibility_aabb.get_edge(i,f,t);
- surface_tool->add_vertex(f);
- surface_tool->add_vertex(t);
+ return emission_normal_texture;
+}
+
+Ref<Texture> ParticlesMaterial::get_emission_color_texture() const {
+
+ return emission_color_texture;
+}
+
+int ParticlesMaterial::get_emission_point_count() const {
+
+ return emission_point_count;
+}
+
+void ParticlesMaterial::set_trail_divisor(int p_divisor) {
+
+ trail_divisor = p_divisor;
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_divisor, p_divisor);
+}
+
+int ParticlesMaterial::get_trail_divisor() const {
+
+ return trail_divisor;
+}
+
+void ParticlesMaterial::set_trail_size_modifier(const Ref<CurveTexture> &p_trail_size_modifier) {
+
+ trail_size_modifier = p_trail_size_modifier;
+
+ Ref<CurveTexture> curve = trail_size_modifier;
+ if (curve.is_valid()) {
+ curve->ensure_default_setup();
}
- return surface_tool->commit(mesh);
+ RID texture;
+ if (p_trail_size_modifier.is_valid())
+ texture = p_trail_size_modifier->get_rid();
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_size_modifier, texture);
+ _queue_shader_change();
+}
+
+Ref<CurveTexture> ParticlesMaterial::get_trail_size_modifier() const {
+ return trail_size_modifier;
}
+void ParticlesMaterial::set_trail_color_modifier(const Ref<GradientTexture> &p_trail_color_modifier) {
-void Particles::_bind_methods() {
+ trail_color_modifier = p_trail_color_modifier;
+ RID texture;
+ if (p_trail_color_modifier.is_valid())
+ texture = p_trail_color_modifier->get_rid();
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_color_modifier, texture);
+ _queue_shader_change();
+}
- 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"),"set_randomness", "get_randomness",_var_indices[i] );
-
-
- 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"),"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 );
- BIND_CONSTANT( VAR_SPREAD );
- BIND_CONSTANT( VAR_GRAVITY );
- BIND_CONSTANT( VAR_LINEAR_VELOCITY );
- BIND_CONSTANT( VAR_ANGULAR_VELOCITY );
- BIND_CONSTANT( VAR_LINEAR_ACCELERATION );
- BIND_CONSTANT( VAR_DRAG );
- BIND_CONSTANT( VAR_TANGENTIAL_ACCELERATION );
- BIND_CONSTANT( VAR_INITIAL_SIZE );
- BIND_CONSTANT( VAR_FINAL_SIZE );
- BIND_CONSTANT( VAR_INITIAL_ANGLE );
- BIND_CONSTANT( VAR_HEIGHT );
- BIND_CONSTANT( VAR_HEIGHT_SPEED_SCALE );
- BIND_CONSTANT( VAR_MAX );
+Ref<GradientTexture> ParticlesMaterial::get_trail_color_modifier() const {
+ return trail_color_modifier;
}
-Particles::Particles() {
+void ParticlesMaterial::set_gravity(const Vector3 &p_gravity) {
- particles = VisualServer::get_singleton()->particles_create();
- timer = memnew(Timer);
- add_child(timer);
- emit_timeout = 0;
+ gravity = p_gravity;
+ Vector3 gset = gravity;
+ if (gset == Vector3()) {
+ gset = Vector3(0, -0.000001, 0); //as gravity is used as upvector in some calculations
+ }
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->gravity, gset);
+}
- set_amount(64);
- set_emitting(true);
- set_visibility_aabb(AABB( Vector3(-4,-4,-4), Vector3(8,8,8) ) );
-
- for (int i=0;i<VAR_MAX;i++) {
- set_randomness((Variable)i,0.0);
- }
-
- set_variable( VAR_LIFETIME, 5.0);
- set_variable( VAR_SPREAD, 0.2);
- set_variable( VAR_GRAVITY, 9.8);
- set_variable( VAR_LINEAR_VELOCITY, 0.2);
- set_variable( VAR_ANGULAR_VELOCITY, 0.0);
- set_variable( VAR_LINEAR_ACCELERATION, 0.0);
- set_variable( VAR_DRAG, 0.0);
- set_variable( VAR_TANGENTIAL_ACCELERATION, 0.0);
- set_variable( VAR_DAMPING, 0.0);
- set_variable( VAR_INITIAL_SIZE, 1.0);
- set_variable( VAR_FINAL_SIZE, 1.0);
- set_variable( VAR_INITIAL_ANGLE, 0.0);
- set_variable( VAR_HEIGHT, 1.0);
- set_variable( VAR_HEIGHT_SPEED_SCALE, 0.0);
-
- color_phase_count=0;
-
- set_color_phase_pos(0,0.0);
- set_color_phase_pos(1,1.0);
- set_color_phase_pos(2,1.0);
- set_color_phase_pos(3,1.0);
-
- set_color_phase_color(0,Color(1,1,1));
- set_color_phase_color(1,Color(0,0,0));
- set_color_phase_color(2,Color(0,0,0));
- set_color_phase_color(3,Color(0,0,0));
-
- set_gravity_normal(Vector3(0,-1.0,0));
- set_emission_half_extents(Vector3(0.1,0.1,0.1));
-
- height_from_velocity=false;
-
- Vector<Variant> pars;
- pars.push_back(false);
- timer->connect("timeout", this, "set_emitting", pars);
- set_base(particles);
- local_coordinates=false;
+Vector3 ParticlesMaterial::get_gravity() const {
+
+ return gravity;
}
+void ParticlesMaterial::_validate_property(PropertyInfo &property) const {
-Particles::~Particles() {
+ if (property.name == "color" && color_ramp.is_valid()) {
+ property.usage = 0;
+ }
+
+ if (property.name == "emission_sphere_radius" && emission_shape != EMISSION_SHAPE_SPHERE) {
+ property.usage = 0;
+ }
+
+ if (property.name == "emission_box_extents" && emission_shape != EMISSION_SHAPE_BOX) {
+ property.usage = 0;
+ }
+
+ if ((property.name == "emission_point_texture" || property.name == "emission_color_texture") && (emission_shape < EMISSION_SHAPE_POINTS)) {
+ property.usage = 0;
+ }
+
+ if (property.name == "emission_normal_texture" && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
+ property.usage = 0;
+ }
- VisualServer::get_singleton()->free(particles);
+ if (property.name == "emission_point_count" && (emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS)) {
+ property.usage = 0;
+ }
}
-#endif
+void ParticlesMaterial::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_spread", "degrees"), &ParticlesMaterial::set_spread);
+ ClassDB::bind_method(D_METHOD("get_spread"), &ParticlesMaterial::get_spread);
+
+ ClassDB::bind_method(D_METHOD("set_flatness", "amount"), &ParticlesMaterial::set_flatness);
+ ClassDB::bind_method(D_METHOD("get_flatness"), &ParticlesMaterial::get_flatness);
+
+ ClassDB::bind_method(D_METHOD("set_param", "param", "value"), &ParticlesMaterial::set_param);
+ ClassDB::bind_method(D_METHOD("get_param", "param"), &ParticlesMaterial::get_param);
+
+ ClassDB::bind_method(D_METHOD("set_param_randomness", "param", "randomness"), &ParticlesMaterial::set_param_randomness);
+ ClassDB::bind_method(D_METHOD("get_param_randomness", "param"), &ParticlesMaterial::get_param_randomness);
+
+ ClassDB::bind_method(D_METHOD("set_param_texture", "param", "texture"), &ParticlesMaterial::set_param_texture);
+ ClassDB::bind_method(D_METHOD("get_param_texture", "param"), &ParticlesMaterial::get_param_texture);
+
+ ClassDB::bind_method(D_METHOD("set_color", "color"), &ParticlesMaterial::set_color);
+ ClassDB::bind_method(D_METHOD("get_color"), &ParticlesMaterial::get_color);
+
+ ClassDB::bind_method(D_METHOD("set_color_ramp", "ramp"), &ParticlesMaterial::set_color_ramp);
+ ClassDB::bind_method(D_METHOD("get_color_ramp"), &ParticlesMaterial::get_color_ramp);
+
+ ClassDB::bind_method(D_METHOD("set_flag", "flag", "enable"), &ParticlesMaterial::set_flag);
+ ClassDB::bind_method(D_METHOD("get_flag", "flag"), &ParticlesMaterial::get_flag);
+
+ ClassDB::bind_method(D_METHOD("set_emission_shape", "shape"), &ParticlesMaterial::set_emission_shape);
+ ClassDB::bind_method(D_METHOD("get_emission_shape"), &ParticlesMaterial::get_emission_shape);
+
+ ClassDB::bind_method(D_METHOD("set_emission_sphere_radius", "radius"), &ParticlesMaterial::set_emission_sphere_radius);
+ ClassDB::bind_method(D_METHOD("get_emission_sphere_radius"), &ParticlesMaterial::get_emission_sphere_radius);
+
+ ClassDB::bind_method(D_METHOD("set_emission_box_extents", "extents"), &ParticlesMaterial::set_emission_box_extents);
+ ClassDB::bind_method(D_METHOD("get_emission_box_extents"), &ParticlesMaterial::get_emission_box_extents);
+
+ ClassDB::bind_method(D_METHOD("set_emission_point_texture", "texture"), &ParticlesMaterial::set_emission_point_texture);
+ ClassDB::bind_method(D_METHOD("get_emission_point_texture"), &ParticlesMaterial::get_emission_point_texture);
+
+ ClassDB::bind_method(D_METHOD("set_emission_normal_texture", "texture"), &ParticlesMaterial::set_emission_normal_texture);
+ ClassDB::bind_method(D_METHOD("get_emission_normal_texture"), &ParticlesMaterial::get_emission_normal_texture);
+
+ ClassDB::bind_method(D_METHOD("set_emission_color_texture", "texture"), &ParticlesMaterial::set_emission_color_texture);
+ ClassDB::bind_method(D_METHOD("get_emission_color_texture"), &ParticlesMaterial::get_emission_color_texture);
+
+ ClassDB::bind_method(D_METHOD("set_emission_point_count", "point_count"), &ParticlesMaterial::set_emission_point_count);
+ ClassDB::bind_method(D_METHOD("get_emission_point_count"), &ParticlesMaterial::get_emission_point_count);
+
+ ClassDB::bind_method(D_METHOD("set_trail_divisor", "divisor"), &ParticlesMaterial::set_trail_divisor);
+ ClassDB::bind_method(D_METHOD("get_trail_divisor"), &ParticlesMaterial::get_trail_divisor);
+
+ ClassDB::bind_method(D_METHOD("set_trail_size_modifier", "texture"), &ParticlesMaterial::set_trail_size_modifier);
+ ClassDB::bind_method(D_METHOD("get_trail_size_modifier"), &ParticlesMaterial::get_trail_size_modifier);
+
+ ClassDB::bind_method(D_METHOD("set_trail_color_modifier", "texture"), &ParticlesMaterial::set_trail_color_modifier);
+ ClassDB::bind_method(D_METHOD("get_trail_color_modifier"), &ParticlesMaterial::get_trail_color_modifier);
+
+ ClassDB::bind_method(D_METHOD("get_gravity"), &ParticlesMaterial::get_gravity);
+ ClassDB::bind_method(D_METHOD("set_gravity", "accel_vec"), &ParticlesMaterial::set_gravity);
+
+ ADD_GROUP("Trail", "trail_");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "trail_divisor", PROPERTY_HINT_RANGE, "1,1000000,1"), "set_trail_divisor", "get_trail_divisor");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "trail_size_modifier", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_trail_size_modifier", "get_trail_size_modifier");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "trail_color_modifier", PROPERTY_HINT_RESOURCE_TYPE, "GradientTexture"), "set_trail_color_modifier", "get_trail_color_modifier");
+ ADD_GROUP("Emission Shape", "emission_");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_shape", PROPERTY_HINT_ENUM, "Point,Sphere,Box,Points,Directed Points"), "set_emission_shape", "get_emission_shape");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01"), "set_emission_sphere_radius", "get_emission_sphere_radius");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "emission_box_extents"), "set_emission_box_extents", "get_emission_box_extents");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "emission_point_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_emission_point_texture", "get_emission_point_texture");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "emission_normal_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_emission_normal_texture", "get_emission_normal_texture");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "emission_color_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_emission_color_texture", "get_emission_color_texture");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_point_count", PROPERTY_HINT_RANGE, "0,1000000,1"), "set_emission_point_count", "get_emission_point_count");
+ ADD_GROUP("Flags", "flag_");
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flag_align_y"), "set_flag", "get_flag", FLAG_ALIGN_Y_TO_VELOCITY);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flag_rotate_y"), "set_flag", "get_flag", FLAG_ROTATE_Y);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flag_disable_z"), "set_flag", "get_flag", FLAG_DISABLE_Z);
+ ADD_GROUP("Spread", "");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "flatness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_flatness", "get_flatness");
+ ADD_GROUP("Gravity", "");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "gravity"), "set_gravity", "get_gravity");
+ ADD_GROUP("Initial Velocity", "initial_");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity", PROPERTY_HINT_RANGE, "0,1000,0.01"), "set_param", "get_param", PARAM_INITIAL_LINEAR_VELOCITY);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_INITIAL_LINEAR_VELOCITY);
+ ADD_GROUP("Angular Velocity", "angular_");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity", PROPERTY_HINT_RANGE, "-360,360,0.01"), "set_param", "get_param", PARAM_ANGULAR_VELOCITY);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGULAR_VELOCITY);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angular_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ANGULAR_VELOCITY);
+ ADD_GROUP("Orbit Velocity", "orbit_");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity", PROPERTY_HINT_RANGE, "-1000,1000,0.01"), "set_param", "get_param", PARAM_ORBIT_VELOCITY);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ORBIT_VELOCITY);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "orbit_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ORBIT_VELOCITY);
+ ADD_GROUP("Linear Accel", "linear_");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel", PROPERTY_HINT_RANGE, "-100,100,0.01"), "set_param", "get_param", PARAM_LINEAR_ACCEL);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_LINEAR_ACCEL);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "linear_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_LINEAR_ACCEL);
+ ADD_GROUP("Radial Accel", "radial_");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel", PROPERTY_HINT_RANGE, "-100,100,0.01"), "set_param", "get_param", PARAM_RADIAL_ACCEL);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_RADIAL_ACCEL);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "radial_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_RADIAL_ACCEL);
+ ADD_GROUP("Tangential Accel", "tangential_");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel", PROPERTY_HINT_RANGE, "-100,100,0.01"), "set_param", "get_param", PARAM_TANGENTIAL_ACCEL);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_TANGENTIAL_ACCEL);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "tangential_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_TANGENTIAL_ACCEL);
+ ADD_GROUP("Damping", "");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param", "get_param", PARAM_DAMPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_DAMPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "damping_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_DAMPING);
+ ADD_GROUP("Angle", "");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle", PROPERTY_HINT_RANGE, "-720,720,0.1"), "set_param", "get_param", PARAM_ANGLE);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGLE);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angle_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ANGLE);
+ ADD_GROUP("Scale", "");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale", PROPERTY_HINT_RANGE, "0,1000,0.01"), "set_param", "get_param", PARAM_SCALE);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_SCALE);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "scale_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_SCALE);
+ ADD_GROUP("Color", "");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "color_ramp", PROPERTY_HINT_RESOURCE_TYPE, "GradientTexture"), "set_color_ramp", "get_color_ramp");
+
+ ADD_GROUP("Hue Variation", "hue_");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation", PROPERTY_HINT_RANGE, "-1,1,0.1"), "set_param", "get_param", PARAM_HUE_VARIATION);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_HUE_VARIATION);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "hue_variation_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_HUE_VARIATION);
+ ADD_GROUP("Animation", "anim_");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed", PROPERTY_HINT_RANGE, "0,128,0.01"), "set_param", "get_param", PARAM_ANIM_SPEED);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_SPEED);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_speed_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ANIM_SPEED);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_offset_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ANIM_OFFSET);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "anim_loop"), "set_flag", "get_flag", FLAG_ANIM_LOOP);
+
+ BIND_CONSTANT(PARAM_INITIAL_LINEAR_VELOCITY);
+ BIND_CONSTANT(PARAM_ANGULAR_VELOCITY);
+ BIND_CONSTANT(PARAM_ORBIT_VELOCITY);
+ BIND_CONSTANT(PARAM_LINEAR_ACCEL);
+ BIND_CONSTANT(PARAM_RADIAL_ACCEL);
+ BIND_CONSTANT(PARAM_TANGENTIAL_ACCEL);
+ BIND_CONSTANT(PARAM_DAMPING);
+ BIND_CONSTANT(PARAM_ANGLE);
+ BIND_CONSTANT(PARAM_SCALE);
+ BIND_CONSTANT(PARAM_HUE_VARIATION);
+ BIND_CONSTANT(PARAM_ANIM_SPEED);
+ BIND_CONSTANT(PARAM_ANIM_OFFSET);
+ BIND_CONSTANT(PARAM_MAX);
+
+ BIND_CONSTANT(FLAG_ALIGN_Y_TO_VELOCITY);
+ BIND_CONSTANT(FLAG_ROTATE_Y);
+ BIND_CONSTANT(FLAG_MAX);
+
+ BIND_CONSTANT(EMISSION_SHAPE_POINT);
+ BIND_CONSTANT(EMISSION_SHAPE_SPHERE);
+ BIND_CONSTANT(EMISSION_SHAPE_BOX);
+ BIND_CONSTANT(EMISSION_SHAPE_POINTS);
+ BIND_CONSTANT(EMISSION_SHAPE_DIRECTED_POINTS);
+}
+
+ParticlesMaterial::ParticlesMaterial()
+ : element(this) {
+
+ set_spread(45);
+ set_flatness(0);
+ set_param(PARAM_INITIAL_LINEAR_VELOCITY, 1);
+ set_param(PARAM_ORBIT_VELOCITY, 0);
+ set_param(PARAM_LINEAR_ACCEL, 0);
+ set_param(PARAM_RADIAL_ACCEL, 0);
+ set_param(PARAM_TANGENTIAL_ACCEL, 0);
+ set_param(PARAM_DAMPING, 0);
+ set_param(PARAM_ANGLE, 0);
+ set_param(PARAM_SCALE, 1);
+ set_param(PARAM_HUE_VARIATION, 0);
+ set_param(PARAM_ANIM_SPEED, 0);
+ set_param(PARAM_ANIM_OFFSET, 0);
+ set_emission_shape(EMISSION_SHAPE_POINT);
+ set_emission_sphere_radius(1);
+ set_emission_box_extents(Vector3(1, 1, 1));
+ set_trail_divisor(1);
+ set_gravity(Vector3(0, -9.8, 0));
+ emission_point_count = 1;
+
+ for (int i = 0; i < PARAM_MAX; i++) {
+ set_param_randomness(Parameter(i), 0);
+ }
+
+ for (int i = 0; i < FLAG_MAX; i++) {
+ flags[i] = false;
+ }
+
+ set_color(Color(1, 1, 1, 1));
+
+ current_key.key = 0;
+ current_key.invalid_key = 1;
+
+ _queue_shader_change();
+}
+
+ParticlesMaterial::~ParticlesMaterial() {
+}
diff --git a/scene/3d/particles.h b/scene/3d/particles.h
index 6cb1caad3a..9c1436a47b 100644
--- a/scene/3d/particles.h
+++ b/scene/3d/particles.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,130 +38,362 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
-#if 0
+
class Particles : public GeometryInstance {
+private:
+ GDCLASS(Particles, GeometryInstance);
+
public:
+ enum DrawOrder {
+ DRAW_ORDER_INDEX,
+ DRAW_ORDER_LIFETIME,
+ DRAW_ORDER_VIEW_DEPTH,
+ };
- enum Variable {
- VAR_LIFETIME=VS::PARTICLE_LIFETIME,
- VAR_SPREAD=VS::PARTICLE_SPREAD,
- VAR_GRAVITY=VS::PARTICLE_GRAVITY,
- VAR_LINEAR_VELOCITY=VS::PARTICLE_LINEAR_VELOCITY,
- VAR_ANGULAR_VELOCITY=VS::PARTICLE_ANGULAR_VELOCITY,
- VAR_LINEAR_ACCELERATION=VS::PARTICLE_LINEAR_ACCELERATION,
- VAR_DRAG=VS::PARTICLE_RADIAL_ACCELERATION,
- VAR_TANGENTIAL_ACCELERATION=VS::PARTICLE_TANGENTIAL_ACCELERATION,
- VAR_DAMPING=VS::PARTICLE_DAMPING,
- VAR_INITIAL_SIZE=VS::PARTICLE_INITIAL_SIZE,
- VAR_FINAL_SIZE=VS::PARTICLE_FINAL_SIZE,
- VAR_INITIAL_ANGLE=VS::PARTICLE_INITIAL_ANGLE,
- VAR_HEIGHT=VS::PARTICLE_HEIGHT,
- VAR_HEIGHT_SPEED_SCALE=VS::PARTICLE_HEIGHT_SPEED_SCALE,
- VAR_MAX=VS::PARTICLE_VAR_MAX
+ enum {
+ MAX_DRAW_PASSES = 4
};
private:
- GDCLASS( Particles, GeometryInstance );
-
RID particles;
- int amount;
bool emitting;
- float emit_timeout;
- AABB visibility_aabb;
- Vector3 gravity_normal;
- Vector3 emission_half_extents;
- bool using_points;
- float var[VAR_MAX];
- float var_random[VAR_MAX];
- bool height_from_velocity;
- Vector3 emission_base_velocity;
- bool local_coordinates;
-
- struct ColorPhase {
-
- Color color;
- float pos;
- };
-
- virtual bool _can_gizmo_scale() const;
- virtual RES _get_gizmo_geometry() const;
-
- int color_phase_count;
+ bool one_shot;
+ int amount;
+ float lifetime;
+ float pre_process_time;
+ float explosiveness_ratio;
+ float randomness_ratio;
+ float speed_scale;
+ Rect3 visibility_aabb;
+ bool local_coords;
+ int fixed_fps;
+ bool fractional_delta;
- ColorPhase color_phase[4];
+ Ref<Material> process_material;
- Ref<Material> material;
+ DrawOrder draw_order;
- Timer* timer;
- void setup_timer();
+ Vector<Ref<Mesh> > draw_passes;
protected:
-
static void _bind_methods();
+ void _notification(int p_what);
+ virtual void _validate_property(PropertyInfo &property) const;
public:
-
-
- AABB get_aabb() const;
+ Rect3 get_aabb() const;
PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ void set_emitting(bool p_emitting);
void set_amount(int p_amount);
- int get_amount() const;
+ void set_lifetime(float p_lifetime);
+ void set_one_shot(bool p_one_shot);
+ void set_pre_process_time(float p_time);
+ void set_explosiveness_ratio(float p_ratio);
+ void set_randomness_ratio(float p_ratio);
+ void set_visibility_aabb(const Rect3 &p_aabb);
+ void set_use_local_coordinates(bool p_enable);
+ void set_process_material(const Ref<Material> &p_material);
+ void set_speed_scale(float p_scale);
- void set_emitting(bool p_emitting);
bool is_emitting() const;
+ int get_amount() const;
+ float get_lifetime() const;
+ bool get_one_shot() const;
+ float get_pre_process_time() const;
+ float get_explosiveness_ratio() const;
+ float get_randomness_ratio() const;
+ Rect3 get_visibility_aabb() const;
+ bool get_use_local_coordinates() const;
+ Ref<Material> get_process_material() const;
+ float get_speed_scale() const;
+
+ void set_fixed_fps(int p_count);
+ int get_fixed_fps() const;
- void set_visibility_aabb(const AABB& p_aabb);
- AABB get_visibility_aabb() const;
+ void set_fractional_delta(bool p_enable);
+ bool get_fractional_delta() const;
- void set_emission_half_extents(const Vector3& p_half_extents);
- Vector3 get_emission_half_extents() const;
+ void set_draw_order(DrawOrder p_order);
+ DrawOrder get_draw_order() const;
- void set_emission_base_velocity(const Vector3& p_base_velocity);
- Vector3 get_emission_base_velocity() const;
+ void set_draw_passes(int p_count);
+ int get_draw_passes() const;
- void set_emission_points(const PoolVector<Vector3>& p_points);
- PoolVector<Vector3> get_emission_points() const;
+ void set_draw_pass_mesh(int p_pass, const Ref<Mesh> &p_mesh);
+ Ref<Mesh> get_draw_pass_mesh(int p_pass) const;
- void set_gravity_normal(const Vector3& p_normal);
- Vector3 get_gravity_normal() const;
+ virtual String get_configuration_warning() const;
- void set_variable(Variable p_variable,float p_value);
- float get_variable(Variable p_variable) const;
+ void restart();
+
+ Rect3 capture_aabb() const;
+ Particles();
+ ~Particles();
+};
- void set_randomness(Variable p_variable,float p_randomness);
- float get_randomness(Variable p_variable) const;
+VARIANT_ENUM_CAST(Particles::DrawOrder)
- void set_color_phases(int p_phases);
- int get_color_phases() const;
+class ParticlesMaterial : public Material {
- void set_color_phase_pos(int p_phase, float p_pos);
- float get_color_phase_pos(int p_phase) const;
+ GDCLASS(ParticlesMaterial, Material)
- void set_color_phase_color(int p_phase, const Color& p_color);
- Color get_color_phase_color(int p_phase) const;
+public:
+ enum Parameter {
+
+ PARAM_INITIAL_LINEAR_VELOCITY,
+ PARAM_ANGULAR_VELOCITY,
+ PARAM_ORBIT_VELOCITY,
+ PARAM_LINEAR_ACCEL,
+ PARAM_RADIAL_ACCEL,
+ PARAM_TANGENTIAL_ACCEL,
+ PARAM_DAMPING,
+ PARAM_ANGLE,
+ PARAM_SCALE,
+ PARAM_HUE_VARIATION,
+ PARAM_ANIM_SPEED,
+ PARAM_ANIM_OFFSET,
+ PARAM_MAX
+ };
- void set_height_from_velocity(bool p_enable);
- bool has_height_from_velocity() const;
+ enum Flags {
+ FLAG_ALIGN_Y_TO_VELOCITY,
+ FLAG_ROTATE_Y,
+ FLAG_DISABLE_Z,
+ FLAG_ANIM_LOOP,
+ FLAG_MAX
+ };
- void set_material(const Ref<Material>& p_material);
- Ref<Material> get_material() const;
+ enum EmissionShape {
+ EMISSION_SHAPE_POINT,
+ EMISSION_SHAPE_SPHERE,
+ EMISSION_SHAPE_BOX,
+ EMISSION_SHAPE_POINTS,
+ EMISSION_SHAPE_DIRECTED_POINTS,
+ };
- void set_emit_timeout(float p_timeout);
- float get_emit_timeout() const;
+private:
+ union MaterialKey {
+
+ struct {
+ uint32_t texture_mask : 16;
+ uint32_t texture_color : 1;
+ uint32_t flags : 4;
+ uint32_t emission_shape : 2;
+ uint32_t trail_size_texture : 1;
+ uint32_t trail_color_texture : 1;
+ uint32_t invalid_key : 1;
+ uint32_t has_emission_color : 1;
+ };
+
+ uint32_t key;
+
+ bool operator<(const MaterialKey &p_key) const {
+ return key < p_key.key;
+ }
+ };
- void set_use_local_coordinates(bool p_use);
- bool is_using_local_coordinates() const;
+ struct ShaderData {
+ RID shader;
+ int users;
+ };
- void start_emitting(float p_time);
+ static Map<MaterialKey, ShaderData> shader_map;
+
+ MaterialKey current_key;
+
+ _FORCE_INLINE_ MaterialKey _compute_key() const {
+
+ MaterialKey mk;
+ mk.key = 0;
+ for (int i = 0; i < PARAM_MAX; i++) {
+ if (tex_parameters[i].is_valid()) {
+ mk.texture_mask |= (1 << i);
+ }
+ }
+ for (int i = 0; i < FLAG_MAX; i++) {
+ if (flags[i]) {
+ mk.flags |= (1 << i);
+ }
+ }
+
+ mk.texture_color = color_ramp.is_valid() ? 1 : 0;
+ mk.emission_shape = emission_shape;
+ mk.trail_color_texture = trail_color_modifier.is_valid() ? 1 : 0;
+ mk.trail_size_texture = trail_size_modifier.is_valid() ? 1 : 0;
+ mk.has_emission_color = emission_shape >= EMISSION_SHAPE_POINTS && emission_color_texture.is_valid();
+
+ return mk;
+ }
+
+ static Mutex *material_mutex;
+ static SelfList<ParticlesMaterial>::List dirty_materials;
+
+ struct ShaderNames {
+ StringName spread;
+ StringName flatness;
+ StringName initial_linear_velocity;
+ StringName initial_angle;
+ StringName angular_velocity;
+ StringName orbit_velocity;
+ StringName linear_accel;
+ StringName radial_accel;
+ StringName tangent_accel;
+ StringName damping;
+ StringName scale;
+ StringName hue_variation;
+ StringName anim_speed;
+ StringName anim_offset;
+
+ StringName initial_linear_velocity_random;
+ StringName initial_angle_random;
+ StringName angular_velocity_random;
+ StringName orbit_velocity_random;
+ StringName linear_accel_random;
+ StringName radial_accel_random;
+ StringName tangent_accel_random;
+ StringName damping_random;
+ StringName scale_random;
+ StringName hue_variation_random;
+ StringName anim_speed_random;
+ StringName anim_offset_random;
+
+ StringName angle_texture;
+ StringName angular_velocity_texture;
+ StringName orbit_velocity_texture;
+ StringName linear_accel_texture;
+ StringName radial_accel_texture;
+ StringName tangent_accel_texture;
+ StringName damping_texture;
+ StringName scale_texture;
+ StringName hue_variation_texture;
+ StringName anim_speed_texture;
+ StringName anim_offset_texture;
+
+ StringName color;
+ StringName color_ramp;
+
+ StringName emission_sphere_radius;
+ StringName emission_box_extents;
+ StringName emission_texture_point_count;
+ StringName emission_texture_points;
+ StringName emission_texture_normal;
+ StringName emission_texture_color;
+
+ StringName trail_divisor;
+ StringName trail_size_modifier;
+ StringName trail_color_modifier;
+
+ StringName gravity;
+ };
+ static ShaderNames *shader_names;
- Particles();
- ~Particles();
+ SelfList<ParticlesMaterial> element;
+ void _update_shader();
+ _FORCE_INLINE_ void _queue_shader_change();
+ _FORCE_INLINE_ bool _is_shader_dirty() const;
+
+ float spread;
+ float flatness;
+
+ float parameters[PARAM_MAX];
+ float randomness[PARAM_MAX];
+
+ Ref<Texture> tex_parameters[PARAM_MAX];
+ Color color;
+ Ref<Texture> color_ramp;
+
+ bool flags[FLAG_MAX];
+
+ EmissionShape emission_shape;
+ float emission_sphere_radius;
+ Vector3 emission_box_extents;
+ Ref<Texture> emission_point_texture;
+ Ref<Texture> emission_normal_texture;
+ Ref<Texture> emission_color_texture;
+ int emission_point_count;
+
+ bool anim_loop;
+
+ int trail_divisor;
+
+ Ref<CurveTexture> trail_size_modifier;
+ Ref<GradientTexture> trail_color_modifier;
+
+ Vector3 gravity;
+
+ //do not save emission points here
+
+protected:
+ static void _bind_methods();
+ virtual void _validate_property(PropertyInfo &property) const;
+
+public:
+ void set_spread(float p_spread);
+ float get_spread() const;
+
+ void set_flatness(float p_flatness);
+ float get_flatness() const;
+
+ void set_param(Parameter p_param, float p_value);
+ float get_param(Parameter p_param) const;
+
+ void set_param_randomness(Parameter p_param, float p_value);
+ float get_param_randomness(Parameter p_param) const;
+
+ void set_param_texture(Parameter p_param, const Ref<Texture> &p_texture);
+ Ref<Texture> get_param_texture(Parameter p_param) const;
+
+ void set_color(const Color &p_color);
+ Color get_color() const;
+
+ void set_color_ramp(const Ref<Texture> &p_texture);
+ Ref<Texture> get_color_ramp() const;
+
+ void set_flag(Flags p_flag, bool p_enable);
+ bool get_flag(Flags p_flag) const;
+
+ void set_emission_shape(EmissionShape p_shape);
+ void set_emission_sphere_radius(float p_radius);
+ void set_emission_box_extents(Vector3 p_extents);
+ void set_emission_point_texture(const Ref<Texture> &p_points);
+ void set_emission_normal_texture(const Ref<Texture> &p_normals);
+ void set_emission_color_texture(const Ref<Texture> &p_colors);
+ void set_emission_point_count(int p_count);
+
+ EmissionShape get_emission_shape() const;
+ float get_emission_sphere_radius() const;
+ Vector3 get_emission_box_extents() const;
+ Ref<Texture> get_emission_point_texture() const;
+ Ref<Texture> get_emission_normal_texture() const;
+ Ref<Texture> get_emission_color_texture() const;
+ int get_emission_point_count() const;
+
+ void set_trail_divisor(int p_divisor);
+ int get_trail_divisor() const;
+
+ void set_trail_size_modifier(const Ref<CurveTexture> &p_trail_size_modifier);
+ Ref<CurveTexture> get_trail_size_modifier() const;
+
+ void set_trail_color_modifier(const Ref<GradientTexture> &p_trail_color_modifier);
+ Ref<GradientTexture> get_trail_color_modifier() const;
+
+ void set_gravity(const Vector3 &p_gravity);
+ Vector3 get_gravity() const;
+
+ static void init_shaders();
+ static void finish_shaders();
+ static void flush_changes();
+
+ ParticlesMaterial();
+ ~ParticlesMaterial();
};
-VARIANT_ENUM_CAST( Particles::Variable );
-#endif
+VARIANT_ENUM_CAST(ParticlesMaterial::Parameter)
+VARIANT_ENUM_CAST(ParticlesMaterial::Flags)
+VARIANT_ENUM_CAST(ParticlesMaterial::EmissionShape)
+
#endif
diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp
index 457e9e5552..f8df21004e 100644
--- a/scene/3d/path.cpp
+++ b/scene/3d/path.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -77,8 +78,8 @@ Ref<Curve3D> Path::get_curve() const {
void Path::_bind_methods() {
- 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("set_curve", "curve"), &Path::set_curve);
+ ClassDB::bind_method(D_METHOD("get_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"), "set_curve", "get_curve");
@@ -107,40 +108,58 @@ void PathFollow::_update_transform() {
Vector3 pos = c->interpolate_baked(o, cubic);
Transform t = get_transform();
- if (rotation_mode != ROTATION_NONE) {
-
- Vector3 n = (c->interpolate_baked(o + lookahead, cubic) - pos).normalized();
-
- if (rotation_mode == ROTATION_Y) {
+ t.origin = pos;
+ Vector3 pos_offset = Vector3(h_offset, v_offset, 0);
- n.y = 0;
- n.normalize();
- }
+ if (rotation_mode != ROTATION_NONE) {
+ // perform parallel transport
+ //
+ // see C. Dougan, The Parallel Transport Frame, Game Programming Gems 2 for example
+ // for a discussion about why not Frenet frame.
+
+ Vector3 t_prev = pos - c->interpolate_baked(o - lookahead, cubic);
+ Vector3 t_cur = c->interpolate_baked(o + lookahead, cubic) - pos;
+
+ Vector3 axis = t_prev.cross(t_cur);
+ float dot = t_prev.normalized().dot(t_cur.normalized());
+ float angle = Math::acos(CLAMP(dot, -1, 1));
+
+ if (axis.length() > CMP_EPSILON && angle > CMP_EPSILON) {
+ if (rotation_mode == ROTATION_Y) {
+ // assuming we're referring to global Y-axis. is this correct?
+ axis.x = 0;
+ axis.z = 0;
+ } else if (rotation_mode == ROTATION_XY) {
+ axis.z = 0;
+ } else if (rotation_mode == ROTATION_XYZ) {
+ // all components are OK
+ }
- if (n.length() < CMP_EPSILON) { //nothing, use previous
- n = -t.get_basis().get_axis(2).normalized();
+ t.rotate_basis(axis.normalized(), angle);
}
- Vector3 up = Vector3(0, 1, 0);
-
- if (rotation_mode == ROTATION_XYZ) {
-
- float tilt = c->interpolate_baked_tilt(o);
- if (tilt != 0) {
-
- Basis rot(-n, tilt); //remember.. lookat will be znegative.. znegative!! we abide by opengl clan.
- up = rot.xform(up);
+ // do the additional tilting
+ float tilt_angle = c->interpolate_baked_tilt(o);
+ Vector3 tilt_axis = t_cur; // is this correct??
+
+ if (tilt_axis.length() > CMP_EPSILON && tilt_angle > CMP_EPSILON) {
+ if (rotation_mode == ROTATION_Y) {
+ tilt_axis.x = 0;
+ tilt_axis.z = 0;
+ } else if (rotation_mode == ROTATION_XY) {
+ tilt_axis.z = 0;
+ } else if (rotation_mode == ROTATION_XYZ) {
+ // all components are OK
}
- }
- t.set_look_at(pos, pos + n, up);
+ t.rotate_basis(tilt_axis.normalized(), tilt_angle);
+ }
+ t.translate(pos_offset);
} else {
-
- t.origin = pos;
+ t.origin += pos_offset;
}
- t.origin += t.basis.get_axis(0) * h_offset + t.basis.get_axis(1) * v_offset;
set_transform(t);
}
diff --git a/scene/3d/path.h b/scene/3d/path.h
index 94227799ed..eeae0668a7 100644
--- a/scene/3d/path.h
+++ b/scene/3d/path.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index 78a00e4a7f..dc8f72d77e 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,6 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "physics_body.h"
+#include "method_bind_ext.gen.inc"
#include "scene/scene_string_names.h"
void PhysicsBody::_notification(int p_what) {
@@ -57,15 +59,15 @@ float PhysicsBody::get_inverse_mass() const {
return 0;
}
-void PhysicsBody::set_collision_layer(uint32_t p_mask) {
+void PhysicsBody::set_collision_layer(uint32_t p_layer) {
- layer_mask = p_mask;
- PhysicsServer::get_singleton()->body_set_layer_mask(get_rid(), p_mask);
+ collision_layer = p_layer;
+ PhysicsServer::get_singleton()->body_set_collision_layer(get_rid(), p_layer);
}
uint32_t PhysicsBody::get_collision_layer() const {
- return layer_mask;
+ return collision_layer;
}
void PhysicsBody::set_collision_mask(uint32_t p_mask) {
@@ -165,7 +167,7 @@ void PhysicsBody::_bind_methods() {
PhysicsBody::PhysicsBody(PhysicsServer::BodyMode p_mode)
: CollisionObject(PhysicsServer::get_singleton()->body_create(p_mode), false) {
- layer_mask = 1;
+ collision_layer = 1;
collision_mask = 1;
}
@@ -227,8 +229,8 @@ void StaticBody::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_bounce", "bounce"), &StaticBody::set_bounce);
ClassDB::bind_method(D_METHOD("get_bounce"), &StaticBody::get_bounce);
- 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);
+ ClassDB::bind_method(D_METHOD("add_collision_exception_with", "body"), &PhysicsBody::add_collision_exception_with);
+ ClassDB::bind_method(D_METHOD("remove_collision_exception_with", "body"), &PhysicsBody::remove_collision_exception_with);
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");
@@ -471,6 +473,21 @@ void RigidBody::_direct_state_changed(Object *p_state) {
}
void RigidBody::_notification(int p_what) {
+
+#ifdef TOOLS_ENABLED
+ if (p_what == NOTIFICATION_ENTER_TREE) {
+ if (get_tree()->is_editor_hint()) {
+ set_notify_local_transform(true); //used for warnings and only in editor
+ }
+ }
+
+ if (p_what == NOTIFICATION_LOCAL_TRANSFORM_CHANGED) {
+ if (get_tree()->is_editor_hint()) {
+ update_configuration_warning();
+ }
+ }
+
+#endif
}
void RigidBody::set_mode(Mode p_mode) {
@@ -518,11 +535,11 @@ real_t RigidBody::get_mass() const {
void RigidBody::set_weight(real_t p_weight) {
- set_mass(p_weight / 9.8);
+ set_mass(p_weight / real_t(GLOBAL_DEF("physics/3d/default_gravity", 9.8)));
}
real_t RigidBody::get_weight() const {
- return mass * 9.8;
+ return mass * real_t(GLOBAL_DEF("physics/3d/default_gravity", 9.8));
}
void RigidBody::set_friction(real_t p_friction) {
@@ -745,6 +762,22 @@ Array RigidBody::get_colliding_bodies() const {
return ret;
}
+String RigidBody::get_configuration_warning() const {
+
+ Transform t = get_transform();
+
+ String warning = CollisionObject::get_configuration_warning();
+
+ if ((get_mode() == MODE_RIGID || get_mode() == MODE_CHARACTER) && (ABS(t.basis.get_axis(0).length() - 1.0) > 0.05 || ABS(t.basis.get_axis(1).length() - 1.0) > 0.05 || ABS(t.basis.get_axis(0).length() - 1.0) > 0.05)) {
+ if (warning != String()) {
+ warning += "\n";
+ }
+ warning += TTR("Size changes to RigidBody (in character or rigid modes) will be overriden by the physics engine when running.\nChange the size in children collision shapes instead.");
+ }
+
+ return warning;
+}
+
void RigidBody::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_mode", "mode"), &RigidBody::set_mode);
@@ -877,396 +910,260 @@ RigidBody::~RigidBody() {
//////////////////////////////////////////////////////
//////////////////////////
-Variant KinematicBody::_get_collider() const {
-
- ObjectID oid = get_collider();
- if (oid == 0)
- return Variant();
- Object *obj = ObjectDB::get_instance(oid);
- if (!obj)
- return Variant();
+Dictionary KinematicBody::_move(const Vector3 &p_motion) {
+
+ Collision col;
+ if (move(p_motion, col)) {
+ Dictionary d;
+ d["position"] = col.collision;
+ d["normal"] = col.collision;
+ d["local_shape"] = col.local_shape;
+ d["travel"] = col.travel;
+ d["remainder"] = col.remainder;
+ d["collider_id"] = col.collider;
+ if (col.collider) {
+ d["collider"] = ObjectDB::get_instance(col.collider);
+ } else {
+ d["collider"] = Variant();
+ }
- Reference *ref = obj->cast_to<Reference>();
- if (ref) {
- return Ref<Reference>(ref);
- }
+ d["collider_shape_index"] = col.collider_shape;
+ d["collider_metadata"] = col.collider_metadata;
- return obj;
-}
+ return d;
-bool KinematicBody::_ignores_mode(PhysicsServer::BodyMode p_mode) const {
-
- switch (p_mode) {
- case PhysicsServer::BODY_MODE_STATIC: return !collide_static;
- case PhysicsServer::BODY_MODE_KINEMATIC: return !collide_kinematic;
- case PhysicsServer::BODY_MODE_RIGID: return !collide_rigid;
- case PhysicsServer::BODY_MODE_CHARACTER: return !collide_character;
+ } else {
+ return Dictionary();
}
-
- return true;
}
-Vector3 KinematicBody::move(const Vector3 &p_motion) {
+bool KinematicBody::move(const Vector3 &p_motion, Collision &r_collision) {
- //give me back regular physics engine logic
- //this is madness
- //and most people using this function will think
- //what it does is simpler than using physics
- //this took about a week to get right..
- //but is it right? who knows at this point..
+ Transform gt = get_global_transform();
+ PhysicsServer::MotionResult result;
+ bool colliding = PhysicsServer::get_singleton()->body_test_motion(get_rid(), gt, p_motion, margin, &result);
+
+ if (colliding) {
+ r_collision.collider_metadata = result.collider_metadata;
+ r_collision.collider_shape = result.collider_shape;
+ r_collision.collider_vel = result.collider_velocity;
+ r_collision.collision = result.collision_point;
+ r_collision.normal = result.collision_normal;
+ r_collision.collider = result.collider_id;
+ r_collision.travel = result.motion;
+ r_collision.remainder = result.remainder;
+ r_collision.local_shape = result.collision_local_shape;
+ }
- colliding = false;
- ERR_FAIL_COND_V(!is_inside_tree(), Vector3());
- PhysicsDirectSpaceState *dss = PhysicsServer::get_singleton()->space_get_direct_state(get_world()->get_space());
- ERR_FAIL_COND_V(!dss, Vector3());
- const int max_shapes = 32;
- Vector3 sr[max_shapes * 2];
- int res_shapes;
+ gt.origin += result.motion;
+ set_global_transform(gt);
- Set<RID> exclude;
- exclude.insert(get_rid());
+ return colliding;
+}
- //recover first
- int recover_attempts = 4;
+Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction, float p_slope_stop_min_velocity, int p_max_bounces, float p_floor_max_angle) {
- bool collided = false;
- uint32_t mask = 0;
- if (collide_static)
- mask |= PhysicsDirectSpaceState::TYPE_MASK_STATIC_BODY;
- if (collide_kinematic)
- mask |= PhysicsDirectSpaceState::TYPE_MASK_KINEMATIC_BODY;
- if (collide_rigid)
- mask |= PhysicsDirectSpaceState::TYPE_MASK_RIGID_BODY;
- if (collide_character)
- mask |= PhysicsDirectSpaceState::TYPE_MASK_CHARACTER_BODY;
+ Vector3 motion = (floor_velocity + p_linear_velocity) * get_fixed_process_delta_time();
+ Vector3 lv = p_linear_velocity;
- //print_line("motion: "+p_motion+" margin: "+rtos(margin));
+ on_floor = false;
+ on_ceiling = false;
+ on_wall = false;
+ colliders.clear();
+ floor_velocity = Vector3();
- //print_line("margin: "+rtos(margin));
+ while (p_max_bounces) {
- float m = margin;
- //m=0.001;
+ Collision collision;
- do {
+ bool collided = move(motion, collision);
- //motion recover
- for (int i = 0; i < get_shape_count(); i++) {
+ if (collided) {
- if (is_shape_set_as_trigger(i))
- continue;
+ motion = collision.remainder;
- if (dss->collide_shape(get_shape(i)->get_rid(), get_global_transform() * get_shape_transform(i), m, sr, max_shapes, res_shapes, exclude, get_collision_layer(), mask)) {
- collided = true;
- }
- }
+ if (p_floor_direction == Vector3()) {
+ //all is a wall
+ on_wall = true;
+ } else {
+ if (collision.normal.dot(p_floor_direction) >= Math::cos(p_floor_max_angle)) { //floor
- if (!collided)
- break;
+ on_floor = true;
+ floor_velocity = collision.collider_vel;
- //print_line("have to recover");
- Vector3 recover_motion;
- bool all_outside = true;
- for (int j = 0; j < 8; j++) {
- for (int i = 0; i < res_shapes; i++) {
-
- Vector3 a = sr[i * 2 + 0];
- Vector3 b = sr[i * 2 + 1];
-//print_line(String()+a+" -> "+b);
-#if 0
- float d = a.distance_to(b);
-
- /*
- if (d<margin)
- continue;
- */
- recover_motion+=(b-a)*0.2;
-#else
- float dist = a.distance_to(b);
- if (dist > CMP_EPSILON) {
- Vector3 norm = (b - a).normalized();
- if (dist > margin * 0.5)
- all_outside = false;
- float adv = norm.dot(recover_motion);
- //print_line(itos(i)+" dist: "+rtos(dist)+" adv: "+rtos(adv));
- recover_motion += norm * MAX(dist - adv, 0) * 0.4;
+ /*if (collision.travel.length() < 0.01 && ABS((lv.x - floor_velocity.x)) < p_slope_stop_min_velocity) {
+ Transform gt = get_global_transform();
+ gt.elements[2] -= collision.travel;
+ set_global_transform(gt);
+ return Vector3();
+ }*/
+ } else if (collision.normal.dot(-p_floor_direction) >= Math::cos(p_floor_max_angle)) { //ceiling
+ on_ceiling = true;
+ } else {
+ on_wall = true;
}
-#endif
}
- }
-
- if (recover_motion == Vector3()) {
- collided = false;
- break;
- }
- //print_line("**** RECOVER: "+recover_motion);
+ Vector3 n = collision.normal;
+ motion = motion.slide(n);
+ lv = lv.slide(n);
- Transform gt = get_global_transform();
- gt.origin += recover_motion;
- set_global_transform(gt);
-
- recover_attempts--;
-
- if (all_outside)
- break;
-
- } while (recover_attempts);
-
- //move second
- float safe = 1.0;
- float unsafe = 1.0;
- int best_shape = -1;
-
- PhysicsDirectSpaceState::ShapeRestInfo rest;
-
- //print_line("pos: "+get_global_transform().origin);
- //print_line("motion: "+p_motion);
-
- for (int i = 0; i < get_shape_count(); i++) {
-
- if (is_shape_set_as_trigger(i))
- continue;
-
- float lsafe, lunsafe;
- PhysicsDirectSpaceState::ShapeRestInfo lrest;
- bool valid = dss->cast_motion(get_shape(i)->get_rid(), get_global_transform() * get_shape_transform(i), p_motion, 0, lsafe, lunsafe, exclude, get_collision_layer(), mask, &lrest);
- //print_line("shape: "+itos(i)+" travel:"+rtos(ltravel));
- if (!valid) {
- safe = 0;
- unsafe = 0;
- best_shape = i; //sadly it's the best
- //print_line("initial stuck");
+ colliders.push_back(collision);
+ } else {
break;
}
- if (lsafe == 1.0) {
- //print_line("initial free");
- continue;
- }
- if (lsafe < safe) {
-
- //print_line("initial at "+rtos(lsafe));
- safe = lsafe;
- safe = MAX(0, lsafe - 0.01);
- unsafe = lunsafe;
- best_shape = i;
- rest = lrest;
- }
- }
-
- //print_line("best shape: "+itos(best_shape)+" motion "+p_motion);
-
- if (safe >= 1) {
- //not collided
- colliding = false;
- } else {
-
- colliding = true;
-
- if (true || (safe == 0 && unsafe == 0)) { //use it always because it's more precise than GJK
- //no advance, use rest info from collision
- Transform ugt = get_global_transform();
- ugt.origin += p_motion * unsafe;
-
- PhysicsDirectSpaceState::ShapeRestInfo rest_info;
- bool c2 = dss->rest_info(get_shape(best_shape)->get_rid(), ugt * get_shape_transform(best_shape), m, &rest, exclude, get_collision_layer(), mask);
- if (!c2) {
- //should not happen, but floating point precision is so weird..
- colliding = false;
- }
-
- //print_line("Rest Travel: "+rest.normal);
- }
-
- if (colliding) {
- collision = rest.point;
- normal = rest.normal;
- collider = rest.collider_id;
- collider_vel = rest.linear_velocity;
- collider_shape = rest.shape;
- }
+ p_max_bounces--;
+ if (motion == Vector3())
+ break;
}
- Vector3 motion = p_motion * safe;
- /*
- if (colliding)
- motion+=normal*0.001;
- */
- Transform gt = get_global_transform();
- gt.origin += motion;
- set_global_transform(gt);
-
- return p_motion - motion;
+ return lv;
}
-Vector3 KinematicBody::move_to(const Vector3 &p_position) {
+bool KinematicBody::is_on_floor() const {
- return move(p_position - get_global_transform().origin);
+ return on_floor;
}
+bool KinematicBody::is_on_wall() const {
-bool KinematicBody::can_teleport_to(const Vector3 &p_position) {
-
- ERR_FAIL_COND_V(!is_inside_tree(), false);
- PhysicsDirectSpaceState *dss = PhysicsServer::get_singleton()->space_get_direct_state(get_world()->get_space());
- ERR_FAIL_COND_V(!dss, false);
-
- uint32_t mask = 0;
- if (collide_static)
- mask |= PhysicsDirectSpaceState::TYPE_MASK_STATIC_BODY;
- if (collide_kinematic)
- mask |= PhysicsDirectSpaceState::TYPE_MASK_KINEMATIC_BODY;
- if (collide_rigid)
- mask |= PhysicsDirectSpaceState::TYPE_MASK_RIGID_BODY;
- if (collide_character)
- mask |= PhysicsDirectSpaceState::TYPE_MASK_CHARACTER_BODY;
-
- Transform xform = get_global_transform();
- xform.origin = p_position;
-
- Set<RID> exclude;
- exclude.insert(get_rid());
-
- for (int i = 0; i < get_shape_count(); i++) {
+ return on_wall;
+}
+bool KinematicBody::is_on_ceiling() const {
- if (is_shape_set_as_trigger(i))
- continue;
+ return on_ceiling;
+}
- bool col = dss->intersect_shape(get_shape(i)->get_rid(), xform * get_shape_transform(i), 0, NULL, 1, exclude, get_collision_layer(), mask);
- if (col)
- return false;
- }
+Vector3 KinematicBody::get_floor_velocity() const {
- return true;
+ return floor_velocity;
}
-bool KinematicBody::is_colliding() const {
+bool KinematicBody::test_move(const Transform &p_from, const Vector3 &p_motion) {
ERR_FAIL_COND_V(!is_inside_tree(), false);
- return colliding;
+ return PhysicsServer::get_singleton()->body_test_motion(get_rid(), p_from, p_motion, margin);
}
-Vector3 KinematicBody::get_collision_pos() const {
- ERR_FAIL_COND_V(!colliding, Vector3());
- return collision;
-}
-Vector3 KinematicBody::get_collision_normal() const {
+void KinematicBody::set_safe_margin(float p_margin) {
- ERR_FAIL_COND_V(!colliding, Vector3());
- return normal;
+ margin = p_margin;
}
-Vector3 KinematicBody::get_collider_velocity() const {
+float KinematicBody::get_safe_margin() const {
- return collider_vel;
+ return margin;
}
-ObjectID KinematicBody::get_collider() const {
+int KinematicBody::get_collision_count() const {
- ERR_FAIL_COND_V(!colliding, 0);
- return collider;
+ return colliders.size();
}
-int KinematicBody::get_collider_shape() const {
+Vector3 KinematicBody::get_collision_position(int p_collision) const {
- ERR_FAIL_COND_V(!colliding, -1);
- return collider_shape;
-}
-void KinematicBody::set_collide_with_static_bodies(bool p_enable) {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3());
- collide_static = p_enable;
+ return colliders[p_collision].collision;
}
-bool KinematicBody::can_collide_with_static_bodies() const {
-
- return collide_static;
+Vector3 KinematicBody::get_collision_normal(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3());
+ return colliders[p_collision].normal;
}
-void KinematicBody::set_collide_with_rigid_bodies(bool p_enable) {
-
- collide_rigid = p_enable;
+Vector3 KinematicBody::get_collision_travel(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3());
+ return colliders[p_collision].travel;
}
-bool KinematicBody::can_collide_with_rigid_bodies() const {
-
- return collide_rigid;
+Vector3 KinematicBody::get_collision_remainder(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3());
+ return colliders[p_collision].remainder;
+}
+Object *KinematicBody::get_collision_local_shape(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL);
+ uint32_t owner = shape_find_owner(colliders[p_collision].local_shape);
+ return shape_owner_get_owner(owner);
}
+Object *KinematicBody::get_collision_collider(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL);
-void KinematicBody::set_collide_with_kinematic_bodies(bool p_enable) {
+ if (colliders[p_collision].collider) {
+ return ObjectDB::get_instance(colliders[p_collision].collider);
+ }
- collide_kinematic = p_enable;
+ return NULL;
}
-bool KinematicBody::can_collide_with_kinematic_bodies() const {
+ObjectID KinematicBody::get_collision_collider_id(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), 0);
- return collide_kinematic;
+ return colliders[p_collision].collider;
}
+Object *KinematicBody::get_collision_collider_shape(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL);
+ Object *collider = get_collision_collider(p_collision);
+ if (collider) {
+ CollisionObject *obj2d = collider->cast_to<CollisionObject>();
+ if (obj2d) {
+ uint32_t owner = shape_find_owner(colliders[p_collision].collider_shape);
+ return obj2d->shape_owner_get_owner(owner);
+ }
+ }
-void KinematicBody::set_collide_with_character_bodies(bool p_enable) {
-
- collide_character = p_enable;
+ return NULL;
}
-bool KinematicBody::can_collide_with_character_bodies() const {
-
- return collide_character;
+int KinematicBody::get_collision_collider_shape_index(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), -1);
+ return colliders[p_collision].collider_shape;
}
-
-void KinematicBody::set_collision_margin(float p_margin) {
-
- margin = p_margin;
+Vector3 KinematicBody::get_collision_collider_velocity(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3());
+ return colliders[p_collision].collider_vel;
}
-
-float KinematicBody::get_collision_margin() const {
-
- return margin;
+Variant KinematicBody::get_collision_collider_metadata(int p_collision) const {
+ ERR_FAIL_INDEX_V(p_collision, colliders.size(), Variant());
+ return colliders[p_collision].collider_metadata;
}
void KinematicBody::_bind_methods() {
- ClassDB::bind_method(D_METHOD("move", "rel_vec"), &KinematicBody::move);
- ClassDB::bind_method(D_METHOD("move_to", "position"), &KinematicBody::move_to);
+ ClassDB::bind_method(D_METHOD("move", "rel_vec"), &KinematicBody::_move);
+ ClassDB::bind_method(D_METHOD("move_and_slide", "linear_velocity", "floor_normal", "slope_stop_min_velocity", "max_bounces", "floor_max_angle"), &KinematicBody::move_and_slide, DEFVAL(Vector3(0, 0, 0)), DEFVAL(0.05), DEFVAL(4), DEFVAL(Math::deg2rad((float)45)));
- ClassDB::bind_method(D_METHOD("can_teleport_to", "position"), &KinematicBody::can_teleport_to);
+ ClassDB::bind_method(D_METHOD("test_move", "from", "rel_vec"), &KinematicBody::test_move);
- ClassDB::bind_method(D_METHOD("is_colliding"), &KinematicBody::is_colliding);
+ ClassDB::bind_method(D_METHOD("is_on_floor"), &KinematicBody::is_on_floor);
+ ClassDB::bind_method(D_METHOD("is_on_ceiling"), &KinematicBody::is_on_ceiling);
+ ClassDB::bind_method(D_METHOD("is_on_wall"), &KinematicBody::is_on_wall);
+ ClassDB::bind_method(D_METHOD("get_floor_velocity"), &KinematicBody::get_floor_velocity);
- 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(D_METHOD("set_safe_margin", "pixels"), &KinematicBody::set_safe_margin);
+ ClassDB::bind_method(D_METHOD("get_safe_margin"), &KinematicBody::get_safe_margin);
- 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(D_METHOD("get_collision_count"), &KinematicBody::get_collision_count);
+ ClassDB::bind_method(D_METHOD("get_collision_position", "collision"), &KinematicBody::get_collision_position);
+ ClassDB::bind_method(D_METHOD("get_collision_normal", "collision"), &KinematicBody::get_collision_normal);
+ ClassDB::bind_method(D_METHOD("get_collision_travel", "collision"), &KinematicBody::get_collision_travel);
+ ClassDB::bind_method(D_METHOD("get_collision_remainder", "collision"), &KinematicBody::get_collision_remainder);
+ ClassDB::bind_method(D_METHOD("get_collision_local_shape", "collision"), &KinematicBody::get_collision_local_shape);
+ ClassDB::bind_method(D_METHOD("get_collision_collider", "collision"), &KinematicBody::get_collision_collider);
+ ClassDB::bind_method(D_METHOD("get_collision_collider_id", "collision"), &KinematicBody::get_collision_collider_id);
+ ClassDB::bind_method(D_METHOD("get_collision_collider_shape", "collision"), &KinematicBody::get_collision_collider_shape);
+ ClassDB::bind_method(D_METHOD("get_collision_collider_shape_index", "collision"), &KinematicBody::get_collision_collider_shape_index);
+ ClassDB::bind_method(D_METHOD("get_collision_collider_velocity", "collision"), &KinematicBody::get_collision_collider_velocity);
+ ClassDB::bind_method(D_METHOD("get_collision_collider_metadata", "collision"), &KinematicBody::get_collision_collider_metadata);
- 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(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(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(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"), "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");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin");
}
KinematicBody::KinematicBody()
: PhysicsBody(PhysicsServer::BODY_MODE_KINEMATIC) {
- collide_static = true;
- collide_rigid = true;
- collide_kinematic = true;
- collide_character = true;
-
- colliding = false;
- collider = 0;
margin = 0.001;
- collider_shape = 0;
+
+ on_floor = false;
+ on_ceiling = false;
+ on_wall = false;
}
KinematicBody::~KinematicBody() {
}
diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h
index 1cef946836..83811a1d93 100644
--- a/scene/3d/physics_body.h
+++ b/scene/3d/physics_body.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,7 +38,7 @@ class PhysicsBody : public CollisionObject {
GDCLASS(PhysicsBody, CollisionObject);
- uint32_t layer_mask;
+ uint32_t collision_layer;
uint32_t collision_mask;
void _set_layers(uint32_t p_mask);
@@ -53,7 +54,7 @@ public:
virtual Vector3 get_angular_velocity() const;
virtual float get_inverse_mass() const;
- void set_collision_layer(uint32_t p_mask);
+ void set_collision_layer(uint32_t p_layer);
uint32_t get_collision_layer() const;
void set_collision_mask(uint32_t p_mask);
@@ -251,6 +252,8 @@ public:
void apply_impulse(const Vector3 &p_pos, const Vector3 &p_impulse);
+ virtual String get_configuration_warning() const;
+
RigidBody();
~RigidBody();
};
@@ -262,58 +265,60 @@ class KinematicBody : public PhysicsBody {
GDCLASS(KinematicBody, PhysicsBody);
- float margin;
- bool collide_static;
- bool collide_rigid;
- bool collide_kinematic;
- bool collide_character;
+public:
+ struct Collision {
+ Vector3 collision;
+ Vector3 normal;
+ Vector3 collider_vel;
+ ObjectID collider;
+ int collider_shape;
+ Variant collider_metadata;
+ Vector3 remainder;
+ Vector3 travel;
+ int local_shape;
+ };
- bool colliding;
- Vector3 collision;
- Vector3 normal;
- Vector3 collider_vel;
- ObjectID collider;
- int collider_shape;
+private:
+ float margin;
- Variant _get_collider() const;
+ Vector3 floor_velocity;
+ bool on_floor;
+ bool on_ceiling;
+ bool on_wall;
+ Vector<Collision> colliders;
_FORCE_INLINE_ bool _ignores_mode(PhysicsServer::BodyMode) const;
+ Dictionary _move(const Vector3 &p_motion);
+
protected:
static void _bind_methods();
public:
- enum {
- SLIDE_FLAG_FLOOR,
- SLIDE_FLAG_WALL,
- SLIDE_FLAG_ROOF
- };
-
- Vector3 move(const Vector3 &p_motion);
- Vector3 move_to(const Vector3 &p_position);
-
- bool can_teleport_to(const Vector3 &p_position);
- bool is_colliding() const;
- Vector3 get_collision_pos() const;
- Vector3 get_collision_normal() const;
- Vector3 get_collider_velocity() const;
- ObjectID get_collider() const;
- int get_collider_shape() const;
-
- void set_collide_with_static_bodies(bool p_enable);
- bool can_collide_with_static_bodies() const;
-
- void set_collide_with_rigid_bodies(bool p_enable);
- bool can_collide_with_rigid_bodies() const;
-
- void set_collide_with_kinematic_bodies(bool p_enable);
- bool can_collide_with_kinematic_bodies() const;
-
- void set_collide_with_character_bodies(bool p_enable);
- bool can_collide_with_character_bodies() const;
-
- void set_collision_margin(float p_margin);
- float get_collision_margin() const;
+ bool move(const Vector3 &p_motion, Collision &r_collision);
+ bool test_move(const Transform &p_from, const Vector3 &p_motion);
+
+ void set_safe_margin(float p_margin);
+ float get_safe_margin() const;
+
+ Vector3 move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction = Vector3(0, 0, 0), float p_slope_stop_min_velocity = 0.05, int p_max_bounces = 4, float p_floor_max_angle = Math::deg2rad((float)45));
+ bool is_on_floor() const;
+ bool is_on_wall() const;
+ bool is_on_ceiling() const;
+ Vector3 get_floor_velocity() const;
+
+ int get_collision_count() const;
+ Vector3 get_collision_position(int p_collision) const;
+ Vector3 get_collision_normal(int p_collision) const;
+ Vector3 get_collision_travel(int p_collision) const;
+ Vector3 get_collision_remainder(int p_collision) const;
+ Object *get_collision_local_shape(int p_collision) const;
+ Object *get_collision_collider(int p_collision) const;
+ ObjectID get_collision_collider_id(int p_collision) const;
+ Object *get_collision_collider_shape(int p_collision) const;
+ int get_collision_collider_shape_index(int p_collision) const;
+ Vector3 get_collision_collider_velocity(int p_collision) const;
+ Variant get_collision_collider_metadata(int p_collision) const;
KinematicBody();
~KinematicBody();
diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp
index 8c20b003f8..61d496935b 100644
--- a/scene/3d/physics_joint.cpp
+++ b/scene/3d/physics_joint.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -978,9 +979,9 @@ Generic6DOFJoint::Generic6DOFJoint() {
void PhysicsJoint::_set(const String& p_name, const Variant& p_value) {
if (p_name=="body_A")
- set_body_A(p_value);
+ set_body_a(p_value);
else if (p_name=="body_B")
- set_body_B(p_value);
+ set_body_b(p_value);
else if (p_name=="active")
set_active(p_value);
else if (p_name=="no_collision")
@@ -989,9 +990,9 @@ void PhysicsJoint::_set(const String& p_name, const Variant& p_value) {
Variant PhysicsJoint::_get(const String& p_name) const {
if (p_name=="body_A")
- return get_body_A();
+ return get_body_a();
else if (p_name=="body_B")
- return get_body_B();
+ return get_body_b();
else if (p_name=="active")
return is_active();
else if (p_name=="no_collision")
@@ -1033,7 +1034,7 @@ void PhysicsJoint::_notification(int p_what) {
if (indicator.is_valid()) {
indicator_instance=VisualServer::get_singleton()->instance_create(indicator,get_world()->get_scenario());
- VisualServer::get_singleton()->instance_attach_object_instance_ID( indicator_instance,get_instance_ID() );
+ VisualServer::get_singleton()->instance_attach_object_instance_id( indicator_instance,get_instance_id() );
}
} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
@@ -1066,10 +1067,10 @@ RID PhysicsJoint::_get_visual_instance_rid() const {
void PhysicsJoint::_bind_methods() {
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(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(D_METHOD("set_active","active"),&PhysicsJoint::set_active);
ClassDB::bind_method(D_METHOD("is_active"),&PhysicsJoint::is_active);
@@ -1084,14 +1085,14 @@ void PhysicsJoint::_bind_methods() {
}
-void PhysicsJoint::set_body_A(const NodePath& p_path) {
+void PhysicsJoint::set_body_a(const NodePath& p_path) {
_disconnect();
body_A=p_path;
_connect();
_change_notify("body_A");
}
-void PhysicsJoint::set_body_B(const NodePath& p_path) {
+void PhysicsJoint::set_body_b(const NodePath& p_path) {
_disconnect();
body_B=p_path;
@@ -1099,11 +1100,11 @@ void PhysicsJoint::set_body_B(const NodePath& p_path) {
_change_notify("body_B");
}
-NodePath PhysicsJoint::get_body_A() const {
+NodePath PhysicsJoint::get_body_a() const {
return body_A;
}
-NodePath PhysicsJoint::get_body_B() const {
+NodePath PhysicsJoint::get_body_b() const {
return body_B;
}
diff --git a/scene/3d/physics_joint.h b/scene/3d/physics_joint.h
index 90d86d652d..b834aaf6d2 100644
--- a/scene/3d/physics_joint.h
+++ b/scene/3d/physics_joint.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -353,10 +354,10 @@ protected:
void _connect();
public:
- void set_body_A(const NodePath& p_path);
- void set_body_B(const NodePath& p_path);
- NodePath get_body_A() const;
- NodePath get_body_B() const;
+ void set_body_a(const NodePath& p_path);
+ void set_body_b(const NodePath& p_path);
+ NodePath get_body_a() const;
+ NodePath get_body_b() const;
void set_active(bool p_active);
bool is_active() const;
diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp
index 391a74ec45..d77dde1dd8 100644
--- a/scene/3d/portal.cpp
+++ b/scene/3d/portal.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "portal.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "scene/resources/surface_tool.h"
#include "servers/visual_server.h"
diff --git a/scene/3d/portal.h b/scene/3d/portal.h
index 018708308f..7c25e4904b 100644
--- a/scene/3d/portal.h
+++ b/scene/3d/portal.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/position_3d.cpp b/scene/3d/position_3d.cpp
index ee09ed93a7..4e66ef13c0 100644
--- a/scene/3d/position_3d.cpp
+++ b/scene/3d/position_3d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/position_3d.h b/scene/3d/position_3d.h
index dae94dfbaf..0adde19342 100644
--- a/scene/3d/position_3d.h
+++ b/scene/3d/position_3d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp
index f1225b6901..d0410f2c55 100644
--- a/scene/3d/proximity_group.cpp
+++ b/scene/3d/proximity_group.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -115,9 +116,9 @@ void ProximityGroup::set_group_name(String p_group_name) {
group_name = p_group_name;
};
-void ProximityGroup::_notification(int what) {
+void ProximityGroup::_notification(int p_what) {
- switch (what) {
+ switch (p_what) {
case NOTIFICATION_EXIT_TREE:
++group_version;
diff --git a/scene/3d/proximity_group.h b/scene/3d/proximity_group.h
index f40ffe2ffe..fec3add41f 100644
--- a/scene/3d/proximity_group.h
+++ b/scene/3d/proximity_group.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/quad.cpp b/scene/3d/quad.cpp
deleted file mode 100644
index e32320681c..0000000000
--- a/scene/3d/quad.cpp
+++ /dev/null
@@ -1,225 +0,0 @@
-/*************************************************************************/
-/* quad.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 "quad.h"
-#include "servers/visual_server.h"
-
-void Quad::_update() {
-
- if (!is_inside_tree())
- return;
-
- Vector3 normal;
- normal[axis] = 1.0;
-
- const int axis_order_1[3] = { 1, 2, 0 };
- const int axis_order_2[3] = { 2, 0, 1 };
- const int a1 = axis_order_1[axis];
- const int a2 = axis_order_2[axis];
-
- PoolVector<Vector3> points;
- points.resize(4);
- PoolVector<Vector3>::Write pointsw = points.write();
-
- Vector2 s2 = size * 0.5;
- Vector2 o = offset;
- if (!centered)
- o += s2;
-
- pointsw[0][a1] = -s2.x + offset.x;
- pointsw[0][a2] = s2.y + offset.y;
-
- pointsw[1][a1] = s2.x + offset.x;
- pointsw[1][a2] = s2.y + offset.y;
-
- pointsw[2][a1] = s2.x + offset.x;
- pointsw[2][a2] = -s2.y + offset.y;
-
- pointsw[3][a1] = -s2.x + offset.x;
- pointsw[3][a2] = -s2.y + offset.y;
-
- aabb = Rect3(pointsw[0], Vector3());
- for (int i = 1; i < 4; i++)
- aabb.expand_to(pointsw[i]);
-
- pointsw = PoolVector<Vector3>::Write();
-
- PoolVector<Vector3> normals;
- normals.resize(4);
- PoolVector<Vector3>::Write normalsw = normals.write();
-
- for (int i = 0; i < 4; i++)
- normalsw[i] = normal;
-
- normalsw = PoolVector<Vector3>::Write();
-
- PoolVector<Vector2> uvs;
- uvs.resize(4);
- PoolVector<Vector2>::Write uvsw = uvs.write();
-
- uvsw[0] = Vector2(0, 0);
- uvsw[1] = Vector2(1, 0);
- uvsw[2] = Vector2(1, 1);
- uvsw[3] = Vector2(0, 1);
-
- uvsw = PoolVector<Vector2>::Write();
-
- PoolVector<int> indices;
- indices.resize(6);
-
- PoolVector<int>::Write indicesw = indices.write();
- indicesw[0] = 0;
- indicesw[1] = 1;
- indicesw[2] = 2;
- indicesw[3] = 2;
- indicesw[4] = 3;
- indicesw[5] = 0;
-
- indicesw = PoolVector<int>::Write();
-
- Array arr;
- arr.resize(VS::ARRAY_MAX);
- arr[VS::ARRAY_VERTEX] = points;
- arr[VS::ARRAY_NORMAL] = normals;
- arr[VS::ARRAY_TEX_UV] = uvs;
- arr[VS::ARRAY_INDEX] = indices;
-
- if (configured) {
- VS::get_singleton()->mesh_remove_surface(mesh, 0);
- } else {
- configured = true;
- }
- VS::get_singleton()->mesh_add_surface_from_arrays(mesh, VS::PRIMITIVE_TRIANGLES, arr);
-
- pending_update = false;
-}
-
-void Quad::set_axis(Vector3::Axis p_axis) {
-
- axis = p_axis;
- _update();
-}
-
-Vector3::Axis Quad::get_axis() const {
-
- return axis;
-}
-
-void Quad::set_size(const Vector2 &p_size) {
-
- size = p_size;
- _update();
-}
-Vector2 Quad::get_size() const {
-
- return size;
-}
-
-void Quad::set_offset(const Vector2 &p_offset) {
-
- offset = p_offset;
- _update();
-}
-Vector2 Quad::get_offset() const {
-
- return offset;
-}
-
-void Quad::set_centered(bool p_enabled) {
-
- centered = p_enabled;
- _update();
-}
-bool Quad::is_centered() const {
-
- return centered;
-}
-
-void Quad::_notification(int p_what) {
-
- switch (p_what) {
-
- case NOTIFICATION_ENTER_TREE: {
-
- if (pending_update)
- _update();
-
- } break;
- case NOTIFICATION_EXIT_TREE: {
-
- pending_update = true;
-
- } break;
- }
-}
-
-PoolVector<Face3> Quad::get_faces(uint32_t p_usage_flags) const {
-
- return PoolVector<Face3>();
-}
-
-Rect3 Quad::get_aabb() const {
-
- return aabb;
-}
-
-void Quad::_bind_methods() {
-
- ClassDB::bind_method(D_METHOD("set_axis", "axis"), &Quad::set_axis);
- ClassDB::bind_method(D_METHOD("get_axis"), &Quad::get_axis);
-
- ClassDB::bind_method(D_METHOD("set_size", "size"), &Quad::set_size);
- ClassDB::bind_method(D_METHOD("get_size"), &Quad::get_size);
-
- ClassDB::bind_method(D_METHOD("set_centered", "centered"), &Quad::set_centered);
- ClassDB::bind_method(D_METHOD("is_centered"), &Quad::is_centered);
-
- 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"), "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");
-}
-
-Quad::Quad() {
-
- pending_update = true;
- centered = true;
- //offset=0;
- size = Vector2(1, 1);
- axis = Vector3::AXIS_Z;
- mesh = VisualServer::get_singleton()->mesh_create();
- set_base(mesh);
- configured = false;
-}
-
-Quad::~Quad() {
- VisualServer::get_singleton()->free(mesh);
-}
diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp
index a73114a7c7..67e7fb0e12 100644
--- a/scene/3d/ray_cast.cpp
+++ b/scene/3d/ray_cast.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,12 +30,15 @@
#include "ray_cast.h"
#include "collision_object.h"
+#include "mesh_instance.h"
#include "servers/physics_server.h"
void RayCast::set_cast_to(const Vector3 &p_point) {
cast_to = p_point;
if (is_inside_tree() && (get_tree()->is_editor_hint() || get_tree()->is_debugging_collisions_hint()))
update_gizmo();
+ if (is_inside_tree() && get_tree()->is_debugging_collisions_hint())
+ _update_debug_shape();
}
Vector3 RayCast::get_cast_to() const {
@@ -42,14 +46,14 @@ Vector3 RayCast::get_cast_to() const {
return cast_to;
}
-void RayCast::set_layer_mask(uint32_t p_mask) {
+void RayCast::set_collision_layer(uint32_t p_layer) {
- layer_mask = p_mask;
+ collision_layer = p_layer;
}
-uint32_t RayCast::get_layer_mask() const {
+uint32_t RayCast::get_collision_layer() const {
- return layer_mask;
+ return collision_layer;
}
void RayCast::set_type_mask(uint32_t p_mask) {
@@ -94,6 +98,13 @@ void RayCast::set_enabled(bool p_enabled) {
set_fixed_process(p_enabled);
if (!p_enabled)
collided = false;
+
+ if (is_inside_tree() && get_tree()->is_debugging_collisions_hint()) {
+ if (p_enabled)
+ _update_debug_shape();
+ else
+ _clear_debug_shape();
+ }
}
bool RayCast::is_enabled() const {
@@ -109,6 +120,9 @@ void RayCast::_notification(int p_what) {
if (enabled && !get_tree()->is_editor_hint()) {
set_fixed_process(true);
+
+ if (get_tree()->is_debugging_collisions_hint())
+ _update_debug_shape();
} else
set_fixed_process(false);
@@ -119,13 +133,23 @@ void RayCast::_notification(int p_what) {
set_fixed_process(false);
}
+ if (debug_shape)
+ _clear_debug_shape();
+
} break;
case NOTIFICATION_FIXED_PROCESS: {
if (!enabled)
break;
+ bool prev_collision_state = collided;
_update_raycast_state();
+ if (prev_collision_state != collided && get_tree()->is_debugging_collisions_hint()) {
+ if (debug_material.is_valid()) {
+ Ref<SpatialMaterial> line_material = static_cast<Ref<SpatialMaterial> >(debug_material);
+ line_material->set_albedo(collided ? Color(1.0, 0, 0) : Color(1.0, 0.8, 0.6));
+ }
+ }
} break;
}
@@ -146,7 +170,7 @@ void RayCast::_update_raycast_state() {
PhysicsDirectSpaceState::RayResult rr;
- if (dss->intersect_ray(gt.get_origin(), gt.xform(to), rr, exclude, layer_mask, type_mask)) {
+ if (dss->intersect_ray(gt.get_origin(), gt.xform(to), rr, exclude, collision_layer, type_mask)) {
collided = true;
against = rr.collider_id;
@@ -219,25 +243,88 @@ void RayCast::_bind_methods() {
ClassDB::bind_method(D_METHOD("clear_exceptions"), &RayCast::clear_exceptions);
- 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(D_METHOD("set_collision_layer", "layer"), &RayCast::set_collision_layer);
+ ClassDB::bind_method(D_METHOD("get_collision_layer"), &RayCast::get_collision_layer);
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"), "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, "collision_layer", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_layer", "get_collision_layer");
ADD_PROPERTY(PropertyInfo(Variant::INT, "type_mask", PROPERTY_HINT_FLAGS, "Static,Kinematic,Rigid,Character,Area"), "set_type_mask", "get_type_mask");
}
+void RayCast::_create_debug_shape() {
+
+ if (!debug_material.is_valid()) {
+ debug_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+
+ Ref<SpatialMaterial> line_material = static_cast<Ref<SpatialMaterial> >(debug_material);
+ line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ line_material->set_line_width(3.0);
+ line_material->set_albedo(Color(1.0, 0.8, 0.6));
+ }
+
+ Ref<ArrayMesh> mesh = memnew(ArrayMesh);
+
+ MeshInstance *mi = memnew(MeshInstance);
+ mi->set_mesh(mesh);
+
+ add_child(mi);
+ debug_shape = mi;
+}
+
+void RayCast::_update_debug_shape() {
+
+ if (!enabled)
+ return;
+
+ if (!debug_shape)
+ _create_debug_shape();
+
+ MeshInstance *mi = static_cast<MeshInstance *>(debug_shape);
+ if (!mi->get_mesh().is_valid())
+ return;
+
+ Ref<ArrayMesh> mesh = mi->get_mesh();
+ if (mesh->get_surface_count() > 0)
+ mesh->surface_remove(0);
+
+ Array a;
+ a.resize(Mesh::ARRAY_MAX);
+
+ Vector<Vector3> verts;
+ verts.push_back(Vector3());
+ verts.push_back(cast_to);
+ a[Mesh::ARRAY_VERTEX] = verts;
+
+ mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES, a);
+ mesh->surface_set_material(0, debug_material);
+}
+
+void RayCast::_clear_debug_shape() {
+
+ if (!debug_shape)
+ return;
+
+ MeshInstance *mi = static_cast<MeshInstance *>(debug_shape);
+ if (mi->is_inside_tree())
+ mi->queue_delete();
+ else
+ memdelete(mi);
+
+ debug_shape = NULL;
+}
+
RayCast::RayCast() {
enabled = false;
against = 0;
collided = false;
against_shape = 0;
- layer_mask = 1;
+ collision_layer = 1;
type_mask = PhysicsDirectSpaceState::TYPE_MASK_COLLISION;
cast_to = Vector3(0, -1, 0);
+ debug_shape = NULL;
}
diff --git a/scene/3d/ray_cast.h b/scene/3d/ray_cast.h
index 00a10446a5..e9b34c4f75 100644
--- a/scene/3d/ray_cast.h
+++ b/scene/3d/ray_cast.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -46,9 +47,16 @@ class RayCast : public Spatial {
Set<RID> exclude;
- uint32_t layer_mask;
+ uint32_t collision_layer;
uint32_t type_mask;
+ Node *debug_shape;
+ Ref<Material> debug_material;
+
+ void _create_debug_shape();
+ void _update_debug_shape();
+ void _clear_debug_shape();
+
protected:
void _notification(int p_what);
void _update_raycast_state();
@@ -61,8 +69,8 @@ public:
void set_cast_to(const Vector3 &p_point);
Vector3 get_cast_to() const;
- void set_layer_mask(uint32_t p_mask);
- uint32_t get_layer_mask() const;
+ void set_collision_layer(uint32_t p_layer);
+ uint32_t get_collision_layer() const;
void set_type_mask(uint32_t p_mask);
uint32_t get_type_mask() const;
diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp
index 90dbd51272..0dc5b58e45 100644
--- a/scene/3d/reflection_probe.cpp
+++ b/scene/3d/reflection_probe.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -161,7 +162,7 @@ bool ReflectionProbe::are_shadows_enabled() const {
void ReflectionProbe::set_cull_mask(uint32_t p_layers) {
cull_mask = p_layers;
- VS::get_singleton()->reflection_probe_set_enable_shadows(probe, p_layers);
+ VS::get_singleton()->reflection_probe_set_cull_mask(probe, p_layers);
}
uint32_t ReflectionProbe::get_cull_mask() const {
@@ -180,7 +181,7 @@ ReflectionProbe::UpdateMode ReflectionProbe::get_update_mode() const {
Rect3 ReflectionProbe::get_aabb() const {
Rect3 aabb;
- aabb.pos = -origin_offset;
+ aabb.position = -origin_offset;
aabb.size = origin_offset + extents;
return aabb;
}
diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h
index a2e4a18d68..d2a5facb5f 100644
--- a/scene/3d/reflection_probe.h
+++ b/scene/3d/reflection_probe.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/remote_transform.cpp b/scene/3d/remote_transform.cpp
index 202206dd02..492930ea9b 100644
--- a/scene/3d/remote_transform.cpp
+++ b/scene/3d/remote_transform.cpp
@@ -7,6 +7,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,7 +39,7 @@ void RemoteTransform::_update_cache() {
return;
}
- cache = node->get_instance_ID();
+ cache = node->get_instance_id();
}
}
@@ -62,7 +63,45 @@ void RemoteTransform::_update_remote() {
return;
//todo make faster
- n->set_global_transform(get_global_transform());
+ if (use_global_coordinates) {
+
+ if (update_remote_position && update_remote_rotation && update_remote_scale) {
+ n->set_global_transform(get_global_transform());
+ } else {
+ Transform n_trans = n->get_global_transform();
+ Transform our_trans = get_global_transform();
+
+ if (!update_remote_position)
+ our_trans.set_origin(n_trans.get_origin());
+
+ n->set_global_transform(our_trans);
+
+ if (!update_remote_rotation)
+ n->set_rotation(n_trans.basis.get_rotation());
+
+ if (!update_remote_scale)
+ n->set_scale(n_trans.basis.get_scale());
+ }
+
+ } else {
+ if (update_remote_position && update_remote_rotation && update_remote_scale) {
+ n->set_global_transform(get_global_transform());
+ } else {
+ Transform n_trans = n->get_transform();
+ Transform our_trans = get_transform();
+
+ if (!update_remote_position)
+ our_trans.set_origin(n_trans.get_origin());
+
+ n->set_transform(our_trans);
+
+ if (!update_remote_rotation)
+ n->set_rotation(n_trans.basis.get_rotation());
+
+ if (!update_remote_scale)
+ n->set_scale(n_trans.basis.get_scale());
+ }
+ }
}
void RemoteTransform::_notification(int p_what) {
@@ -101,6 +140,41 @@ NodePath RemoteTransform::get_remote_node() const {
return remote_node;
}
+void RemoteTransform::set_use_global_coordinates(const bool p_enable) {
+ use_global_coordinates = p_enable;
+}
+
+bool RemoteTransform::get_use_global_coordinates() const {
+ return use_global_coordinates;
+}
+
+void RemoteTransform::set_update_position(const bool p_update) {
+ update_remote_position = p_update;
+ _update_remote();
+}
+
+bool RemoteTransform::get_update_position() const {
+ return update_remote_position;
+}
+
+void RemoteTransform::set_update_rotation(const bool p_update) {
+ update_remote_rotation = p_update;
+ _update_remote();
+}
+
+bool RemoteTransform::get_update_rotation() const {
+ return update_remote_rotation;
+}
+
+void RemoteTransform::set_update_scale(const bool p_update) {
+ update_remote_scale = p_update;
+ _update_remote();
+}
+
+bool RemoteTransform::get_update_scale() const {
+ return update_remote_scale;
+}
+
String RemoteTransform::get_configuration_warning() const {
if (!has_node(remote_node) || !get_node(remote_node) || !get_node(remote_node)->cast_to<Spatial>()) {
@@ -115,11 +189,32 @@ void RemoteTransform::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("set_use_global_coordinates", "use_global_coordinates"), &RemoteTransform::set_use_global_coordinates);
+ ClassDB::bind_method(D_METHOD("get_use_global_coordinates"), &RemoteTransform::get_use_global_coordinates);
+
+ ClassDB::bind_method(D_METHOD("set_update_position", "update_remote_position"), &RemoteTransform::set_update_position);
+ ClassDB::bind_method(D_METHOD("get_update_position"), &RemoteTransform::get_update_position);
+ ClassDB::bind_method(D_METHOD("set_update_rotation", "update_remote_rotation"), &RemoteTransform::set_update_rotation);
+ ClassDB::bind_method(D_METHOD("get_update_rotation"), &RemoteTransform::get_update_rotation);
+ ClassDB::bind_method(D_METHOD("set_update_scale", "update_remote_scale"), &RemoteTransform::set_update_scale);
+ ClassDB::bind_method(D_METHOD("get_update_scale"), &RemoteTransform::get_update_scale);
+
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "remote_path"), "set_remote_node", "get_remote_node");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_global_coordinates"), "set_use_global_coordinates", "get_use_global_coordinates");
+
+ ADD_GROUP("Update", "update_");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_position"), "set_update_position", "get_update_position");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_rotation"), "set_update_rotation", "get_update_rotation");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_scale"), "set_update_scale", "get_update_scale");
}
RemoteTransform::RemoteTransform() {
+ use_global_coordinates = true;
+ update_remote_position = true;
+ update_remote_rotation = true;
+ update_remote_scale = true;
+
cache = 0;
set_notify_transform(true);
}
diff --git a/scene/3d/remote_transform.h b/scene/3d/remote_transform.h
index fdfd959a96..c25b57966e 100644
--- a/scene/3d/remote_transform.h
+++ b/scene/3d/remote_transform.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,6 +39,11 @@ class RemoteTransform : public Spatial {
ObjectID cache;
+ bool use_global_coordinates;
+ bool update_remote_position;
+ bool update_remote_rotation;
+ bool update_remote_scale;
+
void _update_remote();
void _update_cache();
@@ -49,6 +55,18 @@ public:
void set_remote_node(const NodePath &p_remote_node);
NodePath get_remote_node() const;
+ void set_use_global_coordinates(const bool p_enable);
+ bool get_use_global_coordinates() const;
+
+ void set_update_position(const bool p_update);
+ bool get_update_position() const;
+
+ void set_update_rotation(const bool p_update);
+ bool get_update_rotation() const;
+
+ void set_update_scale(const bool p_update);
+ bool get_update_scale() const;
+
virtual String get_configuration_warning() const;
RemoteTransform();
diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp
index 3b6ae32d16..c5ea6c54da 100644
--- a/scene/3d/room_instance.cpp
+++ b/scene/3d/room_instance.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,7 +32,7 @@
#include "servers/visual_server.h"
#include "geometry.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "scene/resources/surface_tool.h"
void Room::_notification(int p_what) {
@@ -142,8 +143,8 @@ void Room::_bounds_changed() {
void Room::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_room", "room:Room"), &Room::set_room);
- ClassDB::bind_method(D_METHOD("get_room:Room"), &Room::get_room);
+ ClassDB::bind_method(D_METHOD("set_room", "room"), &Room::set_room);
+ ClassDB::bind_method(D_METHOD("get_room"), &Room::get_room);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "room/room", PROPERTY_HINT_RESOURCE_TYPE, "Area"), "set_room", "get_room");
}
diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h
index 68be5eecf2..4176da92e8 100644
--- a/scene/3d/room_instance.h
+++ b/scene/3d/room_instance.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/scenario_fx.cpp b/scene/3d/scenario_fx.cpp
index 92ee608f73..0780ce22ff 100644
--- a/scene/3d/scenario_fx.cpp
+++ b/scene/3d/scenario_fx.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,43 +28,44 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "scenario_fx.h"
+#include "scene/main/viewport.h"
void WorldEnvironment::_notification(int p_what) {
- if (p_what == NOTIFICATION_ENTER_WORLD) {
+ if (p_what == Spatial::NOTIFICATION_ENTER_WORLD || p_what == Spatial::NOTIFICATION_ENTER_TREE) {
if (environment.is_valid()) {
- if (get_world()->get_environment().is_valid()) {
+ if (get_viewport()->find_world()->get_environment().is_valid()) {
WARN_PRINT("World already has an environment (Another WorldEnvironment?), overriding.");
}
- get_world()->set_environment(environment);
- add_to_group("_world_environment_" + itos(get_world()->get_scenario().get_id()));
+ get_viewport()->find_world()->set_environment(environment);
+ add_to_group("_world_environment_" + itos(get_viewport()->find_world()->get_scenario().get_id()));
}
- } else if (p_what == NOTIFICATION_EXIT_WORLD) {
+ } else if (p_what == Spatial::NOTIFICATION_EXIT_WORLD || p_what == Spatial::NOTIFICATION_EXIT_TREE) {
- if (environment.is_valid() && get_world()->get_environment() == environment) {
- get_world()->set_environment(Ref<Environment>());
- remove_from_group("_world_environment_" + itos(get_world()->get_scenario().get_id()));
+ if (environment.is_valid() && get_viewport()->find_world()->get_environment() == environment) {
+ get_viewport()->find_world()->set_environment(Ref<Environment>());
+ remove_from_group("_world_environment_" + itos(get_viewport()->find_world()->get_scenario().get_id()));
}
}
}
void WorldEnvironment::set_environment(const Ref<Environment> &p_environment) {
- if (is_inside_world() && environment.is_valid() && get_world()->get_environment() == environment) {
- get_world()->set_environment(Ref<Environment>());
- remove_from_group("_world_environment_" + itos(get_world()->get_scenario().get_id()));
+ if (is_inside_tree() && environment.is_valid() && get_viewport()->find_world()->get_environment() == environment) {
+ get_viewport()->find_world()->set_environment(Ref<Environment>());
+ remove_from_group("_world_environment_" + itos(get_viewport()->find_world()->get_scenario().get_id()));
//clean up
}
environment = p_environment;
- if (is_inside_world() && environment.is_valid()) {
- if (get_world()->get_environment().is_valid()) {
+ if (is_inside_tree() && environment.is_valid()) {
+ if (get_viewport()->find_world()->get_environment().is_valid()) {
WARN_PRINT("World already has an environment (Another WorldEnvironment?), overriding.");
}
- get_world()->set_environment(environment);
- add_to_group("_world_environment_" + itos(get_world()->get_scenario().get_id()));
+ get_viewport()->find_world()->set_environment(environment);
+ add_to_group("_world_environment_" + itos(get_viewport()->find_world()->get_scenario().get_id()));
}
update_configuration_warning();
@@ -76,11 +78,11 @@ Ref<Environment> WorldEnvironment::get_environment() const {
String WorldEnvironment::get_configuration_warning() const {
- if (!is_visible_in_tree() || !is_inside_tree() || !environment.is_valid())
+ if (/*!is_visible_in_tree() ||*/ !is_inside_tree() || !environment.is_valid())
return String();
List<Node *> nodes;
- get_tree()->get_nodes_in_group("_world_environment_" + itos(get_world()->get_scenario().get_id()), &nodes);
+ get_tree()->get_nodes_in_group("_world_environment_" + itos(get_viewport()->find_world()->get_scenario().get_id()), &nodes);
if (nodes.size() > 1) {
return TTR("Only one WorldEnvironment is allowed per scene (or set of instanced scenes).");
@@ -91,8 +93,8 @@ String WorldEnvironment::get_configuration_warning() const {
void WorldEnvironment::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_environment", "env:Environment"), &WorldEnvironment::set_environment);
- ClassDB::bind_method(D_METHOD("get_environment:Environment"), &WorldEnvironment::get_environment);
+ ClassDB::bind_method(D_METHOD("set_environment", "env"), &WorldEnvironment::set_environment);
+ ClassDB::bind_method(D_METHOD("get_environment"), &WorldEnvironment::get_environment);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment");
}
diff --git a/scene/3d/scenario_fx.h b/scene/3d/scenario_fx.h
index bbdffdc131..d1e0a63130 100644
--- a/scene/3d/scenario_fx.h
+++ b/scene/3d/scenario_fx.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,9 +36,9 @@
@author Juan Linietsky <reduzio@gmail.com>
*/
-class WorldEnvironment : public Spatial {
+class WorldEnvironment : public Node {
- GDCLASS(WorldEnvironment, Spatial);
+ GDCLASS(WorldEnvironment, Node);
Ref<Environment> environment;
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index 3a5453c8ef..cee97af244 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,7 +31,7 @@
#include "message_queue.h"
-#include "core/global_config.h"
+#include "core/project_settings.h"
#include "scene/resources/surface_tool.h"
bool Skeleton::_set(const StringName &p_path, const Variant &p_value) {
@@ -81,9 +82,9 @@ bool Skeleton::_set(const StringName &p_path, const Variant &p_value) {
return true;
}
-bool Skeleton::_get(const StringName &p_name, Variant &r_ret) const {
+bool Skeleton::_get(const StringName &p_path, Variant &r_ret) const {
- String path = p_name;
+ String path = p_path;
if (!path.begins_with("bones/"))
return false;
@@ -406,7 +407,7 @@ void Skeleton::bind_child_node_to_bone(int p_bone, Node *p_node) {
ERR_FAIL_NULL(p_node);
ERR_FAIL_INDEX(p_bone, bones.size());
- uint32_t id = p_node->get_instance_ID();
+ uint32_t id = p_node->get_instance_id();
for (List<uint32_t>::Element *E = bones[p_bone].nodes_bound.front(); E; E = E->next()) {
@@ -421,7 +422,7 @@ void Skeleton::unbind_child_node_from_bone(int p_bone, Node *p_node) {
ERR_FAIL_NULL(p_node);
ERR_FAIL_INDEX(p_bone, bones.size());
- uint32_t id = p_node->get_instance_ID();
+ uint32_t id = p_node->get_instance_id();
bones[p_bone].nodes_bound.erase(id);
}
void Skeleton::get_bound_child_nodes_to_bone(int p_bone, List<Node *> *p_bound) const {
@@ -517,8 +518,8 @@ void Skeleton::_bind_methods() {
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(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("bind_child_node_to_bone", "bone_idx", "node"), &Skeleton::bind_child_node_to_bone);
+ ClassDB::bind_method(D_METHOD("unbind_child_node_from_bone", "bone_idx", "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(D_METHOD("clear_bones"), &Skeleton::clear_bones);
diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h
index 7074289724..a6546af64e 100644
--- a/scene/3d/skeleton.h
+++ b/scene/3d/skeleton.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -90,8 +91,8 @@ class Skeleton : public Spatial {
}
protected:
- bool _get(const StringName &p_name, Variant &r_ret) const;
- bool _set(const StringName &p_name, const Variant &p_value);
+ bool _get(const StringName &p_path, Variant &r_ret) const;
+ bool _set(const StringName &p_path, const Variant &p_value);
void _get_property_list(List<PropertyInfo> *p_list) const;
void _notification(int p_what);
static void _bind_methods();
@@ -112,7 +113,7 @@ public:
void set_bone_parent(int p_bone, int p_parent);
int get_bone_parent(int p_bone) const;
- void unparent_bone_and_rest(int p_idx);
+ void unparent_bone_and_rest(int p_bone);
void set_bone_disable_rest(int p_bone, bool p_disable);
bool is_bone_rest_disabled(int p_bone) const;
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp
index 1125a7a4d2..848b08eb8f 100644
--- a/scene/3d/spatial.cpp
+++ b/scene/3d/spatial.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -71,8 +72,12 @@ SpatialGizmo::SpatialGizmo() {
void Spatial::_notify_dirty() {
+#ifdef TOOLS_ENABLED
+ if ((data.gizmo.is_valid() || data.notify_transform) && !data.ignore_notification && !xform_change.in_list()) {
+#else
if (data.notify_transform && !data.ignore_notification && !xform_change.in_list()) {
+#endif
get_tree()->xform_change_list.add(&xform_change);
}
}
@@ -103,9 +108,11 @@ void Spatial::_propagate_transform_changed(Spatial *p_origin) {
continue; //don't propagate to a toplevel
E->get()->_propagate_transform_changed(p_origin);
}
-
+#ifdef TOOLS_ENABLED
+ if ((data.gizmo.is_valid() || data.notify_transform) && !data.ignore_notification && !xform_change.in_list()) {
+#else
if (data.notify_transform && !data.ignore_notification && !xform_change.in_list()) {
-
+#endif
get_tree()->xform_change_list.add(&xform_change);
}
data.dirty |= DIRTY_GLOBAL;
@@ -220,9 +227,10 @@ void Spatial::set_transform(const Transform &p_transform) {
data.local_transform = p_transform;
data.dirty |= DIRTY_VECTORS;
- _change_notify("transform/translation");
- _change_notify("transform/rotation");
- _change_notify("transform/scale");
+ _change_notify("translation");
+ _change_notify("rotation");
+ _change_notify("rotation_deg");
+ _change_notify("scale");
_propagate_transform_changed(this);
if (data.notify_local_transform) {
notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
@@ -510,22 +518,11 @@ Ref<World> Spatial::get_world() const {
return data.viewport->find_world();
}
-#ifdef TOOLS_ENABLED
-void Spatial::set_import_transform(const Transform &p_transform) {
- data.import_transform = p_transform;
-}
-
-Transform Spatial::get_import_transform() const {
-
- return data.import_transform;
-}
-#endif
-
void Spatial::_propagate_visibility_changed() {
notification(NOTIFICATION_VISIBILITY_CHANGED);
emit_signal(SceneStringNames::get_singleton()->visibility_changed);
- _change_notify("visibility/visible");
+ _change_notify("visible");
#ifdef TOOLS_ENABLED
if (data.gizmo.is_valid())
_update_gizmo();
@@ -550,10 +547,7 @@ void Spatial::show() {
if (!is_inside_tree())
return;
- if (!data.parent || is_visible_in_tree()) {
-
- _propagate_visibility_changed();
- }
+ _propagate_visibility_changed();
}
void Spatial::hide() {
@@ -561,14 +555,14 @@ void Spatial::hide() {
if (!data.visible)
return;
- bool was_visible = is_visible_in_tree();
data.visible = false;
- if (!data.parent || was_visible) {
+ if (!is_inside_tree())
+ return;
- _propagate_visibility_changed();
- }
+ _propagate_visibility_changed();
}
+
bool Spatial::is_visible_in_tree() const {
const Spatial *s = this;
@@ -686,6 +680,16 @@ void Spatial::look_at_from_pos(const Vector3 &p_pos, const Vector3 &p_target, co
set_global_transform(lookat);
}
+Vector3 Spatial::to_local(Vector3 p_global) const {
+
+ return get_global_transform().affine_inverse().xform(p_global);
+}
+
+Vector3 Spatial::to_global(Vector3 p_local) const {
+
+ return get_global_transform().xform(p_local);
+}
+
void Spatial::set_notify_transform(bool p_enable) {
data.notify_transform = p_enable;
}
@@ -720,7 +724,7 @@ void Spatial::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("get_world"), &Spatial::get_world);
// TODO: Obsolete those two methods (old name) properly (GH-4397)
ClassDB::bind_method(D_METHOD("_set_rotation_deg", "rotation_deg"), &Spatial::_set_rotation_deg);
@@ -728,16 +732,13 @@ void Spatial::_bind_methods() {
#ifdef TOOLS_ENABLED
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(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(D_METHOD("set_gizmo", "gizmo"), &Spatial::set_gizmo);
+ ClassDB::bind_method(D_METHOD("get_gizmo"), &Spatial::get_gizmo);
- ClassDB::bind_method(D_METHOD("set_visible"), &Spatial::set_visible);
+ ClassDB::bind_method(D_METHOD("set_visible", "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);
@@ -771,6 +772,9 @@ void Spatial::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("to_local", "global_point"), &Spatial::to_local);
+ ClassDB::bind_method(D_METHOD("to_global", "local_point"), &Spatial::to_global);
+
BIND_CONSTANT(NOTIFICATION_TRANSFORM_CHANGED);
BIND_CONSTANT(NOTIFICATION_ENTER_WORLD);
BIND_CONSTANT(NOTIFICATION_EXIT_WORLD);
diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h
index e5817883dd..f22b19d3cc 100644
--- a/scene/3d/spatial.h
+++ b/scene/3d/spatial.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,7 +31,7 @@
#define SPATIAL_H
#include "scene/main/node.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
@@ -94,7 +95,6 @@ class Spatial : public Node {
Ref<SpatialGizmo> gizmo;
bool gizmo_disabled;
bool gizmo_dirty;
- Transform import_transform;
#endif
} data;
@@ -173,6 +173,9 @@ public:
void look_at(const Vector3 &p_target, const Vector3 &p_up_normal);
void look_at_from_pos(const Vector3 &p_pos, const Vector3 &p_target, const Vector3 &p_up_normal);
+ Vector3 to_local(Vector3 p_global) const;
+ Vector3 to_global(Vector3 p_local) const;
+
void set_notify_transform(bool p_enable);
bool is_transform_notification_enabled() const;
@@ -188,11 +191,6 @@ public:
void hide();
bool is_visible_in_tree() const;
-#ifdef TOOLS_ENABLED
- void set_import_transform(const Transform &p_transform);
- Transform get_import_transform() const;
-#endif
-
Spatial();
~Spatial();
};
diff --git a/scene/3d/spatial_indexer.cpp b/scene/3d/spatial_indexer.cpp
index cddbf9a4e8..7090c974a3 100644
--- a/scene/3d/spatial_indexer.cpp
+++ b/scene/3d/spatial_indexer.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/spatial_indexer.h b/scene/3d/spatial_indexer.h
index 94c579ba23..c8bdf8950d 100644
--- a/scene/3d/spatial_indexer.h
+++ b/scene/3d/spatial_indexer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/spatial_velocity_tracker.cpp b/scene/3d/spatial_velocity_tracker.cpp
new file mode 100644
index 0000000000..dc822d0446
--- /dev/null
+++ b/scene/3d/spatial_velocity_tracker.cpp
@@ -0,0 +1,104 @@
+#include "spatial_velocity_tracker.h"
+#include "engine.h"
+
+void SpatialVelocityTracker::set_track_fixed_step(bool p_track_fixed_step) {
+
+ fixed_step = p_track_fixed_step;
+}
+
+bool SpatialVelocityTracker::is_tracking_fixed_step() const {
+
+ return fixed_step;
+}
+void SpatialVelocityTracker::update_position(const Vector3 &p_position) {
+
+ PositionHistory ph;
+ ph.position = p_position;
+ if (fixed_step) {
+ ph.frame = Engine::get_singleton()->get_fixed_frames();
+ } else {
+ ph.frame = Engine::get_singleton()->get_idle_frame_ticks();
+ }
+
+ if (position_history_len == 0 || position_history[0].frame != ph.frame) { //in same frame, use latest
+ position_history_len = MIN(position_history.size(), position_history_len + 1);
+ for (int i = position_history_len - 1; i > 0; i--) {
+ position_history[i] = position_history[i - 1];
+ }
+ }
+
+ position_history[0] = ph;
+}
+Vector3 SpatialVelocityTracker::get_tracked_linear_velocity() const {
+
+ Vector3 linear_velocity;
+
+ float max_time = 1 / 5.0; //maximum time to interpolate a velocity
+
+ Vector3 distance_accum;
+ float time_accum = 0.0;
+ float base_time = 0.0;
+
+ if (position_history_len) {
+ if (fixed_step) {
+ uint64_t base = Engine::get_singleton()->get_fixed_frames();
+ base_time = float(base - position_history[0].frame) / Engine::get_singleton()->get_iterations_per_second();
+ } else {
+ uint64_t base = Engine::get_singleton()->get_idle_frame_ticks();
+ base_time = double(base - position_history[0].frame) / 1000000.0;
+ }
+ }
+
+ for (int i = 0; i < position_history_len - 1; i++) {
+ float delta = 0.0;
+ uint64_t diff = position_history[i].frame - position_history[i + 1].frame;
+ Vector3 distance = position_history[i].position - position_history[i + 1].position;
+
+ if (fixed_step) {
+ delta = float(diff) / Engine::get_singleton()->get_iterations_per_second();
+ } else {
+ delta = double(diff) / 1000000.0;
+ }
+
+ if (base_time + time_accum + delta > max_time)
+ break;
+
+ distance_accum += distance;
+ time_accum += delta;
+ }
+
+ if (time_accum) {
+ linear_velocity = distance_accum / time_accum;
+ }
+
+ return linear_velocity;
+}
+
+void SpatialVelocityTracker::reset(const Vector3 &p_new_pos) {
+
+ PositionHistory ph;
+ ph.position = p_new_pos;
+ if (fixed_step) {
+ ph.frame = Engine::get_singleton()->get_fixed_frames();
+ } else {
+ ph.frame = Engine::get_singleton()->get_idle_frame_ticks();
+ }
+
+ position_history[0] = ph;
+ position_history_len = 1;
+}
+
+void SpatialVelocityTracker::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_track_fixed_step", "enable"), &SpatialVelocityTracker::set_track_fixed_step);
+ ClassDB::bind_method(D_METHOD("is_tracking_fixed_step"), &SpatialVelocityTracker::is_tracking_fixed_step);
+ ClassDB::bind_method(D_METHOD("update_position", "position"), &SpatialVelocityTracker::update_position);
+ ClassDB::bind_method(D_METHOD("get_tracked_linear_velocity"), &SpatialVelocityTracker::get_tracked_linear_velocity);
+ ClassDB::bind_method(D_METHOD("reset", "position"), &SpatialVelocityTracker::reset);
+}
+
+SpatialVelocityTracker::SpatialVelocityTracker() {
+ position_history.resize(4); // should be configurable
+ position_history_len = 0;
+ fixed_step = false;
+}
diff --git a/scene/3d/spatial_velocity_tracker.h b/scene/3d/spatial_velocity_tracker.h
new file mode 100644
index 0000000000..b8237613a7
--- /dev/null
+++ b/scene/3d/spatial_velocity_tracker.h
@@ -0,0 +1,31 @@
+#ifndef SPATIAL_VELOCITY_TRACKER_H
+#define SPATIAL_VELOCITY_TRACKER_H
+
+#include "scene/3d/spatial.h"
+
+class SpatialVelocityTracker : public Reference {
+ GDCLASS(SpatialVelocityTracker, Reference)
+
+ struct PositionHistory {
+ uint64_t frame;
+ Vector3 position;
+ };
+
+ bool fixed_step;
+ Vector<PositionHistory> position_history;
+ int position_history_len;
+
+protected:
+ static void _bind_methods();
+
+public:
+ void reset(const Vector3 &p_new_pos);
+ void set_track_fixed_step(bool p_track_fixed_step);
+ bool is_tracking_fixed_step() const;
+ void update_position(const Vector3 &p_position);
+ Vector3 get_tracked_linear_velocity() const;
+
+ SpatialVelocityTracker();
+};
+
+#endif // SPATIAL_VELOCITY_TRACKER_H
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index 062e3943b9..978662f7dc 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -272,10 +273,12 @@ void SpriteBase3D::_bind_methods() {
ADD_GROUP("Flags", "");
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_PROPERTYI(PropertyInfo(Variant::BOOL, "double_sided"), "set_draw_flag", "get_draw_flag", FLAG_DOUBLE_SIDED);
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);
BIND_CONSTANT(FLAG_SHADED);
+ BIND_CONSTANT(FLAG_DOUBLE_SIDED);
BIND_CONSTANT(FLAG_MAX);
BIND_CONSTANT(ALPHA_CUT_DISABLED);
@@ -293,7 +296,7 @@ SpriteBase3D::SpriteBase3D() {
pI = NULL;
for (int i = 0; i < FLAG_MAX; i++)
- flags[i] = i == FLAG_TRANSPARENT;
+ flags[i] = i == FLAG_TRANSPARENT || i == FLAG_DOUBLE_SIDED;
axis = Vector3::AXIS_Z;
pixel_size = 0.01;
@@ -334,8 +337,8 @@ void Sprite3D::_draw() {
s = s / Size2i(hframes, vframes);
src_rect.size = s;
- src_rect.pos.x += (frame % hframes) * s.x;
- src_rect.pos.y += (frame / hframes) * s.y;
+ src_rect.position.x += (frame % hframes) * s.x;
+ src_rect.position.y += (frame / hframes) * s.y;
}
Point2i ofs = get_offset();
@@ -359,17 +362,17 @@ void Sprite3D::_draw() {
Vector2 vertices[4] = {
- (final_rect.pos + Vector2(0, final_rect.size.y)) * pixel_size,
- (final_rect.pos + final_rect.size) * pixel_size,
- (final_rect.pos + Vector2(final_rect.size.x, 0)) * pixel_size,
- final_rect.pos * pixel_size,
+ (final_rect.position + Vector2(0, final_rect.size.y)) * pixel_size,
+ (final_rect.position + final_rect.size) * pixel_size,
+ (final_rect.position + Vector2(final_rect.size.x, 0)) * pixel_size,
+ final_rect.position * pixel_size,
};
Vector2 uvs[4] = {
- final_src_rect.pos / tsize,
- (final_src_rect.pos + Vector2(final_src_rect.size.x, 0)) / tsize,
- (final_src_rect.pos + final_src_rect.size) / tsize,
- (final_src_rect.pos + Vector2(0, final_src_rect.size.y)) / tsize,
+ final_src_rect.position / tsize,
+ (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize,
+ (final_src_rect.position + final_src_rect.size) / tsize,
+ (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / tsize,
};
if (is_flipped_h()) {
@@ -386,7 +389,7 @@ void Sprite3D::_draw() {
int axis = get_axis();
normal[axis] = 1.0;
- RID mat = VS::get_singleton()->material_2d_get(get_draw_flag(FLAG_SHADED), get_draw_flag(FLAG_TRANSPARENT), get_alpha_cut_mode() == ALPHA_CUT_DISCARD, get_alpha_cut_mode() == ALPHA_CUT_OPAQUE_PREPASS);
+ RID mat = SpatialMaterial::get_material_rid_for_2d(get_draw_flag(FLAG_SHADED), get_draw_flag(FLAG_TRANSPARENT), get_draw_flag(FLAG_DOUBLE_SIDED), get_alpha_cut_mode() == ALPHA_CUT_DISCARD, get_alpha_cut_mode() == ALPHA_CUT_OPAQUE_PREPASS);
VS::get_singleton()->immediate_set_material(immediate, mat);
VS::get_singleton()->immediate_begin(immediate, VS::PRIMITIVE_TRIANGLE_FAN, texture->get_rid());
@@ -420,7 +423,7 @@ void Sprite3D::_draw() {
vtx[y_axis] = vertices[i][1];
VS::get_singleton()->immediate_vertex(immediate, vtx);
if (i == 0) {
- aabb.pos = vtx;
+ aabb.position = vtx;
aabb.size = Vector3();
} else {
aabb.expand_to(vtx);
@@ -499,7 +502,7 @@ void Sprite3D::set_vframes(int p_amount) {
ERR_FAIL_COND(p_amount < 1);
vframes = p_amount;
_queue_update();
- _change_notify("frame");
+ _change_notify();
}
int Sprite3D::get_vframes() const {
@@ -511,7 +514,7 @@ void Sprite3D::set_hframes(int p_amount) {
ERR_FAIL_COND(p_amount < 1);
hframes = p_amount;
_queue_update();
- _change_notify("frame");
+ _change_notify();
}
int Sprite3D::get_hframes() const {
@@ -559,8 +562,8 @@ void Sprite3D::_validate_property(PropertyInfo &property) const {
void Sprite3D::_bind_methods() {
- 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(D_METHOD("set_texture", "texture"), &Sprite3D::set_texture);
+ ClassDB::bind_method(D_METHOD("get_texture"), &Sprite3D::get_texture);
ClassDB::bind_method(D_METHOD("set_region", "enabled"), &Sprite3D::set_region);
ClassDB::bind_method(D_METHOD("is_region"), &Sprite3D::is_region);
@@ -578,10 +581,12 @@ void Sprite3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_hframes"), &Sprite3D::get_hframes);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture");
+ ADD_GROUP("Animation", "");
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_GROUP("Region", "region_");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "region_enabled"), "set_region", "is_region");
ADD_PROPERTY(PropertyInfo(Variant::RECT2, "region_rect"), "set_region_rect", "get_region_rect");
ADD_SIGNAL(MethodInfo("frame_changed"));
@@ -719,8 +724,8 @@ void AnimatedSprite3D::_draw() {
void AnimatedSprite3D::_bind_methods(){
- 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_sprite_frames","sprite_frames"),&AnimatedSprite3D::set_sprite_frames);
+ ClassDB::bind_method(D_METHOD("get_sprite_frames"),&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);
@@ -860,17 +865,17 @@ void AnimatedSprite3D::_draw() {
Vector2 vertices[4] = {
- (final_rect.pos + Vector2(0, final_rect.size.y)) * pixel_size,
- (final_rect.pos + final_rect.size) * pixel_size,
- (final_rect.pos + Vector2(final_rect.size.x, 0)) * pixel_size,
- final_rect.pos * pixel_size,
+ (final_rect.position + Vector2(0, final_rect.size.y)) * pixel_size,
+ (final_rect.position + final_rect.size) * pixel_size,
+ (final_rect.position + Vector2(final_rect.size.x, 0)) * pixel_size,
+ final_rect.position * pixel_size,
};
Vector2 uvs[4] = {
- final_src_rect.pos / tsize,
- (final_src_rect.pos + Vector2(final_src_rect.size.x, 0)) / tsize,
- (final_src_rect.pos + final_src_rect.size) / tsize,
- (final_src_rect.pos + Vector2(0, final_src_rect.size.y)) / tsize,
+ final_src_rect.position / tsize,
+ (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize,
+ (final_src_rect.position + final_src_rect.size) / tsize,
+ (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / tsize,
};
if (is_flipped_h()) {
@@ -887,7 +892,8 @@ void AnimatedSprite3D::_draw() {
int axis = get_axis();
normal[axis] = 1.0;
- RID mat = VS::get_singleton()->material_2d_get(get_draw_flag(FLAG_SHADED), get_draw_flag(FLAG_TRANSPARENT), get_alpha_cut_mode() == ALPHA_CUT_DISCARD, get_alpha_cut_mode() == ALPHA_CUT_OPAQUE_PREPASS);
+ RID mat = SpatialMaterial::get_material_rid_for_2d(get_draw_flag(FLAG_SHADED), get_draw_flag(FLAG_TRANSPARENT), get_draw_flag(FLAG_DOUBLE_SIDED), get_alpha_cut_mode() == ALPHA_CUT_DISCARD, get_alpha_cut_mode() == ALPHA_CUT_OPAQUE_PREPASS);
+
VS::get_singleton()->immediate_set_material(immediate, mat);
VS::get_singleton()->immediate_begin(immediate, VS::PRIMITIVE_TRIANGLE_FAN, texture->get_rid());
@@ -921,7 +927,7 @@ void AnimatedSprite3D::_draw() {
vtx[y_axis] = vertices[i][1];
VS::get_singleton()->immediate_vertex(immediate, vtx);
if (i == 0) {
- aabb.pos = vtx;
+ aabb.position = vtx;
aabb.size = Vector3();
} else {
aabb.expand_to(vtx);
@@ -1240,8 +1246,8 @@ String AnimatedSprite3D::get_configuration_warning() const {
void AnimatedSprite3D::_bind_methods() {
- 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(D_METHOD("set_sprite_frames", "sprite_frames"), &AnimatedSprite3D::set_sprite_frames);
+ ClassDB::bind_method(D_METHOD("get_sprite_frames"), &AnimatedSprite3D::get_sprite_frames);
ClassDB::bind_method(D_METHOD("set_animation", "animation"), &AnimatedSprite3D::set_animation);
ClassDB::bind_method(D_METHOD("get_animation"), &AnimatedSprite3D::get_animation);
diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h
index d1de4e1b88..7dc4cd4ffb 100644
--- a/scene/3d/sprite_3d.h
+++ b/scene/3d/sprite_3d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -40,6 +41,7 @@ public:
enum DrawFlags {
FLAG_TRANSPARENT,
FLAG_SHADED,
+ FLAG_DOUBLE_SIDED,
FLAG_MAX
};
@@ -117,7 +119,7 @@ public:
void set_pixel_size(float p_amount);
float get_pixel_size() const;
- void set_axis(Vector3::Axis p_amount);
+ void set_axis(Vector3::Axis p_axis);
Vector3::Axis get_axis() const;
void set_draw_flag(DrawFlags p_flag, bool p_enable);
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index 4a647fe682..adf235c525 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -213,6 +214,18 @@ float VehicleWheel::get_friction_slip() const {
return m_frictionSlip;
}
+void VehicleWheel::set_roll_influence(float p_value) {
+ m_rollInfluence = p_value;
+}
+
+float VehicleWheel::get_roll_influence() const {
+ return m_rollInfluence;
+}
+
+bool VehicleWheel::is_in_contact() const {
+ return m_raycastInfo.m_isInContact;
+}
+
void VehicleWheel::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_radius", "length"), &VehicleWheel::set_radius);
@@ -245,9 +258,15 @@ void VehicleWheel::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("is_in_contact"), &VehicleWheel::is_in_contact);
+
+ ClassDB::bind_method(D_METHOD("set_roll_influence", "roll_influence"), &VehicleWheel::set_roll_influence);
+ ClassDB::bind_method(D_METHOD("get_roll_influence"), &VehicleWheel::get_roll_influence);
+
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_roll_influence"), "set_roll_influence", "get_roll_influence");
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");
@@ -874,9 +893,9 @@ real_t VehicleBody::get_friction() const {
return friction;
}
-void VehicleBody::set_engine_force(float p_force) {
+void VehicleBody::set_engine_force(float p_engine_force) {
- engine_force = p_force;
+ engine_force = p_engine_force;
}
float VehicleBody::get_engine_force() const {
diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h
index 55b521cfa6..d778800814 100644
--- a/scene/3d/vehicle_body.h
+++ b/scene/3d/vehicle_body.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -125,6 +126,11 @@ public:
void set_use_as_steering(bool p_enabled);
bool is_used_as_steering() const;
+ bool is_in_contact() const;
+
+ void set_roll_influence(float p_value);
+ float get_roll_influence() const;
+
VehicleWheel();
};
@@ -190,7 +196,7 @@ public:
void set_engine_force(float p_engine_force);
float get_engine_force() const;
- void set_brake(float p_force);
+ void set_brake(float p_brake);
float get_brake() const;
void set_steering(float p_steering);
diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp
index 909ac002b0..cc81a4cb56 100644
--- a/scene/3d/visibility_notifier.cpp
+++ b/scene/3d/visibility_notifier.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,6 +29,7 @@
/*************************************************************************/
#include "visibility_notifier.h"
+#include "scene/3d/camera.h"
#include "scene/3d/physics_body.h"
#include "scene/animation/animation_player.h"
#include "scene/scene_string_names.h"
@@ -41,6 +43,7 @@ void VisibilityNotifier::_enter_camera(Camera *p_camera) {
emit_signal(SceneStringNames::get_singleton()->screen_entered);
_screen_enter();
}
+
emit_signal(SceneStringNames::get_singleton()->camera_entered, p_camera);
}
diff --git a/scene/3d/visibility_notifier.h b/scene/3d/visibility_notifier.h
index 09c1175bf1..316b2c3575 100644
--- a/scene/3d/visibility_notifier.h
+++ b/scene/3d/visibility_notifier.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp
index 852881abd4..1a294d016a 100644
--- a/scene/3d/visual_instance.cpp
+++ b/scene/3d/visual_instance.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -148,7 +149,7 @@ void VisualInstance::set_base(const RID &p_base) {
VisualInstance::VisualInstance() {
instance = VisualServer::get_singleton()->instance_create();
- VisualServer::get_singleton()->instance_attach_object_instance_ID(instance, get_instance_ID());
+ VisualServer::get_singleton()->instance_attach_object_instance_id(instance, get_instance_id());
layers = 1;
set_notify_transform(true);
}
@@ -315,12 +316,9 @@ void GeometryInstance::_bind_methods() {
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"), "set_material_override", "get_material_override");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material_override", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,SpatialMaterial"), "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);
@@ -333,9 +331,6 @@ void GeometryInstance::_bind_methods() {
//ADD_SIGNAL( MethodInfo("visibility_changed"));
BIND_CONSTANT(FLAG_CAST_SHADOW);
- BIND_CONSTANT(FLAG_BILLBOARD);
- BIND_CONSTANT(FLAG_BILLBOARD_FIX_Y);
- BIND_CONSTANT(FLAG_DEPH_SCALE);
BIND_CONSTANT(FLAG_VISIBLE_IN_ALL_ROOMS);
BIND_CONSTANT(FLAG_MAX);
diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h
index 9f1cba923f..9318198e54 100644
--- a/scene/3d/visual_instance.h
+++ b/scene/3d/visual_instance.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -84,9 +85,6 @@ class GeometryInstance : public VisualInstance {
public:
enum Flags {
FLAG_CAST_SHADOW = VS::INSTANCE_FLAG_CAST_SHADOW,
- FLAG_BILLBOARD = VS::INSTANCE_FLAG_BILLBOARD,
- FLAG_BILLBOARD_FIX_Y = VS::INSTANCE_FLAG_BILLBOARD_FIX_Y,
- FLAG_DEPH_SCALE = VS::INSTANCE_FLAG_DEPH_SCALE,
FLAG_VISIBLE_IN_ALL_ROOMS = VS::INSTANCE_FLAG_VISIBLE_IN_ALL_ROOMS,
FLAG_USE_BAKED_LIGHT = VS::INSTANCE_FLAG_USE_BAKED_LIGHT,
FLAG_MAX = VS::INSTANCE_FLAG_MAX,
diff --git a/scene/SCsub b/scene/SCsub
index bd2da1eab9..df52e9c6cb 100644
--- a/scene/SCsub
+++ b/scene/SCsub
@@ -3,10 +3,23 @@
Import('env')
env.scene_sources = []
+
+
+# Thirdparty code
+thirdparty_dir = "#thirdparty/misc/"
+thirdparty_sources = [
+ # C sources
+ "mikktspace.c",
+]
+thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+env.add_source_files(env.scene_sources, thirdparty_sources)
+
+
+# Godot's own sources
env.add_source_files(env.scene_sources, "*.cpp")
-Export('env')
+# Chain load SCsubs
SConscript('main/SCsub')
SConscript('gui/SCsub')
SConscript('3d/SCsub')
@@ -17,6 +30,8 @@ SConscript('resources/SCsub')
SConscript('io/SCsub')
+# Build it all as a library
lib = env.Library("scene", env.scene_sources)
-
env.Prepend(LIBS=[lib])
+
+Export('env')
diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp
index 93fbde519e..31fee0e347 100644
--- a/scene/animation/animation_cache.cpp
+++ b/scene/animation/animation_cache.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/animation/animation_cache.h b/scene/animation/animation_cache.h
index 1668c62519..6687098d00 100644
--- a/scene/animation/animation_cache.h
+++ b/scene/animation/animation_cache.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index dc9aa1758a..e2a0636466 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -201,6 +202,7 @@ void AnimationPlayer::_notification(int p_what) {
if (!get_tree()->is_editor_hint() && animation_set.has(autoplay)) {
play(autoplay);
set_autoplay(""); //this line is the fix for autoplay issues with animatio
+ _animation_process(0);
}
} break;
case NOTIFICATION_INTERNAL_PROCESS: {
@@ -245,7 +247,7 @@ void AnimationPlayer::_generate_node_caches(AnimationData *p_anim) {
ERR_EXPLAIN("On Animation: '" + p_anim->name + "', couldn't resolve track: '" + String(a->track_get_path(i)) + "'");
}
ERR_CONTINUE(!child); // couldn't find the child node
- uint32_t id = resource.is_valid() ? resource->get_instance_ID() : child->get_instance_ID();
+ uint32_t id = resource.is_valid() ? resource->get_instance_id() : child->get_instance_id();
int bone_idx = -1;
if (a->track_get_path(i).get_property() && child->cast_to<Skeleton>()) {
@@ -610,7 +612,7 @@ void AnimationPlayer::_animation_update_transforms() {
case SP_NONE: pa->object->set(pa->prop,pa->value_accum); break; //you are not speshul
- case SP_NODE2D_POS: static_cast<Node2D*>(pa->object)->set_pos(pa->value_accum); break;
+ case SP_NODE2D_POS: static_cast<Node2D*>(pa->object)->set_position(pa->value_accum); break;
case SP_NODE2D_ROT: static_cast<Node2D*>(pa->object)->set_rot(Math::deg2rad(pa->value_accum)); break;
case SP_NODE2D_SCALE: static_cast<Node2D*>(pa->object)->set_scale(pa->value_accum); break;
}*/
@@ -1213,11 +1215,11 @@ void AnimationPlayer::_bind_methods() {
ClassDB::bind_method(D_METHOD("_node_removed"), &AnimationPlayer::_node_removed);
ClassDB::bind_method(D_METHOD("_animation_changed"), &AnimationPlayer::_animation_changed);
- ClassDB::bind_method(D_METHOD("add_animation", "name", "animation:Animation"), &AnimationPlayer::add_animation);
+ ClassDB::bind_method(D_METHOD("add_animation", "name", "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", "name"), &AnimationPlayer::get_animation);
ClassDB::bind_method(D_METHOD("get_animation_list"), &AnimationPlayer::_get_animation_list);
ClassDB::bind_method(D_METHOD("animation_set_next", "anim_from", "anim_to"), &AnimationPlayer::animation_set_next);
@@ -1254,7 +1256,7 @@ void AnimationPlayer::_bind_methods() {
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(D_METHOD("find_animation", "animation:Animation"), &AnimationPlayer::find_animation);
+ ClassDB::bind_method(D_METHOD("find_animation", "animation"), &AnimationPlayer::find_animation);
ClassDB::bind_method(D_METHOD("clear_caches"), &AnimationPlayer::clear_caches);
@@ -1266,7 +1268,7 @@ void AnimationPlayer::_bind_methods() {
ClassDB::bind_method(D_METHOD("advance", "delta"), &AnimationPlayer::advance);
- ADD_GROUP("Playback", "playback_");
+ ADD_GROUP("Playback Options", "playback_");
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");
diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h
index b5679d62f1..01b709205a 100644
--- a/scene/animation/animation_player.h
+++ b/scene/animation/animation_player.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -270,7 +271,7 @@ public:
void set_speed_scale(float p_speed);
float get_speed_scale() const;
- void set_autoplay(const String &pname);
+ void set_autoplay(const String &p_name);
String get_autoplay() const;
void set_animation_process_mode(AnimationProcessMode p_mode);
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp
index 6f4279526a..c12e97c4a5 100644
--- a/scene/animation/animation_tree_player.cpp
+++ b/scene/animation/animation_tree_player.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -1480,7 +1481,7 @@ AnimationTreePlayer::Track *AnimationTreePlayer::_find_track(const NodePath &p_p
return NULL;
}
- ObjectID id = child->get_instance_ID();
+ ObjectID id = child->get_instance_id();
StringName property;
int bone_idx = -1;
@@ -1708,8 +1709,8 @@ void AnimationTreePlayer::_bind_methods() {
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(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(D_METHOD("animation_node_set_animation", "id", "animation"), &AnimationTreePlayer::animation_node_set_animation);
+ ClassDB::bind_method(D_METHOD("animation_node_get_animation", "id"), &AnimationTreePlayer::animation_node_get_animation);
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);
diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h
index 35fce9b15d..47f18795bd 100644
--- a/scene/animation/animation_tree_player.h
+++ b/scene/animation/animation_tree_player.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -311,7 +312,7 @@ private:
Map<StringName, NodeBase *> node_map;
// return time left to finish animation
- float _process_node(const StringName &p_node, AnimationNode **r_prev_anim, float p_step, bool p_seek = false, float p_fallback_weight = 1.0, HashMap<NodePath, float> *p_weights = NULL);
+ float _process_node(const StringName &p_node, AnimationNode **r_prev_anim, float p_time, bool p_seek = false, float p_fallback_weight = 1.0, HashMap<NodePath, float> *p_weights = NULL);
void _process_animation(float p_delta);
bool reset_request;
@@ -366,7 +367,7 @@ public:
float oneshot_node_get_autorestart_delay(const StringName &p_node) const;
float oneshot_node_get_autorestart_random_delay(const StringName &p_node) const;
- void oneshot_node_set_mix_mode(const StringName &p_node, bool p_enabled);
+ void oneshot_node_set_mix_mode(const StringName &p_node, bool p_mix);
bool oneshot_node_get_mix_mode(const StringName &p_node) const;
void oneshot_node_start(const StringName &p_node);
@@ -427,8 +428,8 @@ public:
void remove_node(const StringName &p_node);
Error connect_nodes(const StringName &p_src_node, const StringName &p_dst_node, int p_dst_input);
- bool are_nodes_connected(const StringName &p_src_node, const StringName &p_dst_node, int p_input) const;
- void disconnect_nodes(const StringName &p_src_node, int p_input);
+ bool are_nodes_connected(const StringName &p_src_node, const StringName &p_dst_node, int p_dst_input) const;
+ void disconnect_nodes(const StringName &p_node, int p_input);
void set_base_path(const NodePath &p_path);
NodePath get_base_path() const;
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp
index c455d20b14..78d3357bb4 100644
--- a/scene/animation/tween.cpp
+++ b/scene/animation/tween.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "tween.h"
-#include "method_bind_ext.inc"
+#include "method_bind_ext.gen.inc"
void Tween::_add_pending_command(StringName p_key, const Variant &p_arg1, const Variant &p_arg2, const Variant &p_arg3, const Variant &p_arg4, const Variant &p_arg5, const Variant &p_arg6, const Variant &p_arg7, const Variant &p_arg8, const Variant &p_arg9, const Variant &p_arg10) {
@@ -420,9 +421,9 @@ Variant Tween::_run_equation(InterpolateData &p_data) {
Rect3 d = delta_val;
Rect3 r;
- APPLY_EQUATION(pos.x);
- APPLY_EQUATION(pos.y);
- APPLY_EQUATION(pos.z);
+ APPLY_EQUATION(position.x);
+ APPLY_EQUATION(position.y);
+ APPLY_EQUATION(position.z);
APPLY_EQUATION(size.x);
APPLY_EQUATION(size.y);
APPLY_EQUATION(size.z);
@@ -610,6 +611,7 @@ void Tween::_tween_process(float p_delta) {
_apply_tween_value(data, result);
if (data.finish) {
+ _apply_tween_value(data, data.final_val);
emit_signal("tween_completed", object, data.key);
// not repeat mode, remove completed action
if (!repeat)
@@ -961,7 +963,7 @@ bool Tween::_calc_delta_val(const Variant &p_initial_val, const Variant &p_final
case Variant::RECT3: {
Rect3 i = initial_val;
Rect3 f = final_val;
- delta_val = Rect3(f.pos - i.pos, f.size - i.size);
+ delta_val = Rect3(f.position - i.position, f.size - i.size);
} break;
case Variant::TRANSFORM: {
Transform i = initial_val;
@@ -1022,7 +1024,7 @@ bool Tween::interpolate_property(Object *p_object, String p_property, Variant p_
data.finish = false;
data.elapsed = 0;
- data.id = p_object->get_instance_ID();
+ data.id = p_object->get_instance_id();
data.key = p_property;
data.initial_val = p_initial_val;
data.final_val = p_final_val;
@@ -1064,7 +1066,7 @@ bool Tween::interpolate_method(Object *p_object, String p_method, Variant p_init
data.finish = false;
data.elapsed = 0;
- data.id = p_object->get_instance_ID();
+ data.id = p_object->get_instance_id();
data.key = p_method;
data.initial_val = p_initial_val;
data.final_val = p_final_val;
@@ -1101,7 +1103,7 @@ bool Tween::interpolate_callback(Object *p_object, real_t p_duration, String p_c
data.call_deferred = false;
data.elapsed = 0;
- data.id = p_object->get_instance_ID();
+ data.id = p_object->get_instance_id();
data.key = p_callback;
data.duration = p_duration;
data.delay = 0;
@@ -1153,7 +1155,7 @@ bool Tween::interpolate_deferred_callback(Object *p_object, real_t p_duration, S
data.call_deferred = true;
data.elapsed = 0;
- data.id = p_object->get_instance_ID();
+ data.id = p_object->get_instance_id();
data.key = p_callback;
data.duration = p_duration;
data.delay = 0;
@@ -1220,10 +1222,10 @@ bool Tween::follow_property(Object *p_object, String p_property, Variant p_initi
data.finish = false;
data.elapsed = 0;
- data.id = p_object->get_instance_ID();
+ data.id = p_object->get_instance_id();
data.key = p_property;
data.initial_val = p_initial_val;
- data.target_id = p_target->get_instance_ID();
+ data.target_id = p_target->get_instance_id();
data.target_key = p_target_property;
data.duration = p_duration;
data.trans_type = p_trans_type;
@@ -1270,10 +1272,10 @@ bool Tween::follow_method(Object *p_object, String p_method, Variant p_initial_v
data.finish = false;
data.elapsed = 0;
- data.id = p_object->get_instance_ID();
+ data.id = p_object->get_instance_id();
data.key = p_method;
data.initial_val = p_initial_val;
- data.target_id = p_target->get_instance_ID();
+ data.target_id = p_target->get_instance_id();
data.target_key = p_target_method;
data.duration = p_duration;
data.trans_type = p_trans_type;
@@ -1319,9 +1321,9 @@ bool Tween::targeting_property(Object *p_object, String p_property, Object *p_in
data.finish = false;
data.elapsed = 0;
- data.id = p_object->get_instance_ID();
+ data.id = p_object->get_instance_id();
data.key = p_property;
- data.target_id = p_initial->get_instance_ID();
+ data.target_id = p_initial->get_instance_id();
data.target_key = p_initial_property;
data.initial_val = initial_val;
data.final_val = p_final_val;
@@ -1373,9 +1375,9 @@ bool Tween::targeting_method(Object *p_object, String p_method, Object *p_initia
data.finish = false;
data.elapsed = 0;
- data.id = p_object->get_instance_ID();
+ data.id = p_object->get_instance_id();
data.key = p_method;
- data.target_id = p_initial->get_instance_ID();
+ data.target_id = p_initial->get_instance_id();
data.target_key = p_initial_method;
data.initial_val = initial_val;
data.final_val = p_final_val;
diff --git a/scene/animation/tween.h b/scene/animation/tween.h
index 84f866f43e..43234fab86 100644
--- a/scene/animation/tween.h
+++ b/scene/animation/tween.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -131,7 +132,7 @@ private:
void _tween_process(float p_delta);
void _set_process(bool p_process, bool p_force = false);
- void _remove(Object *p_node, String p_key, bool first_only);
+ void _remove(Object *p_object, String p_key, bool first_only);
protected:
bool _set(const StringName &p_name, const Variant &p_value);
@@ -155,34 +156,34 @@ public:
float get_speed_scale() const;
bool start();
- bool reset(Object *p_node, String p_key);
+ bool reset(Object *p_object, String p_key);
bool reset_all();
- bool stop(Object *p_node, String p_key);
+ bool stop(Object *p_object, String p_key);
bool stop_all();
- bool resume(Object *p_node, String p_key);
+ bool resume(Object *p_object, String p_key);
bool resume_all();
- bool remove(Object *p_node, String p_key);
+ bool remove(Object *p_object, String p_key);
bool remove_all();
bool seek(real_t p_time);
real_t tell() const;
real_t get_runtime() const;
- bool interpolate_property(Object *p_node, String p_property, Variant p_initial_val, Variant p_final_val, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
+ bool interpolate_property(Object *p_object, String p_property, Variant p_initial_val, Variant p_final_val, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
- bool interpolate_method(Object *p_node, String p_method, Variant p_initial_val, Variant p_final_val, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
+ bool interpolate_method(Object *p_object, String p_method, Variant p_initial_val, Variant p_final_val, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
bool interpolate_callback(Object *p_object, real_t p_duration, String p_callback, VARIANT_ARG_DECLARE);
bool interpolate_deferred_callback(Object *p_object, real_t p_duration, String p_callback, VARIANT_ARG_DECLARE);
- bool follow_property(Object *p_node, String p_property, Variant p_initial_val, Object *p_target, String p_target_property, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
+ bool follow_property(Object *p_object, String p_property, Variant p_initial_val, Object *p_target, String p_target_property, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
- bool follow_method(Object *p_node, String p_method, Variant p_initial_val, Object *p_target, String p_target_method, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
+ bool follow_method(Object *p_object, String p_method, Variant p_initial_val, Object *p_target, String p_target_method, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
- bool targeting_property(Object *p_node, String p_property, Object *p_initial, String p_initial_property, Variant p_final_val, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
+ bool targeting_property(Object *p_object, String p_property, Object *p_initial, String p_initial_property, Variant p_final_val, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
- bool targeting_method(Object *p_node, String p_method, Object *p_initial, String p_initial_method, Variant p_final_val, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
+ bool targeting_method(Object *p_object, String p_method, Object *p_initial, String p_initial_method, Variant p_final_val, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay = 0);
Tween();
~Tween();
diff --git a/scene/animation/tween_interpolaters.cpp b/scene/animation/tween_interpolaters.cpp
index ef55b63edd..434f4df3e1 100644
--- a/scene/animation/tween_interpolaters.cpp
+++ b/scene/animation/tween_interpolaters.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp
index 1ee31a94d8..a8ddcbbb45 100644
--- a/scene/audio/audio_player.cpp
+++ b/scene/audio/audio_player.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,7 +29,7 @@
/*************************************************************************/
#include "audio_player.h"
-void AudioPlayer::_mix_audio() {
+void AudioStreamPlayer::_mix_audio() {
if (!stream_playback.is_valid()) {
return;
@@ -94,7 +95,7 @@ void AudioPlayer::_mix_audio() {
}
}
-void AudioPlayer::_notification(int p_what) {
+void AudioStreamPlayer::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
@@ -110,8 +111,9 @@ void AudioPlayer::_notification(int p_what) {
}
}
-void AudioPlayer::set_stream(Ref<AudioStream> p_stream) {
+void AudioStreamPlayer::set_stream(Ref<AudioStream> p_stream) {
+ ERR_FAIL_COND(!p_stream.is_valid());
AudioServer::get_singleton()->lock();
mix_buffer.resize(AudioServer::get_singleton()->thread_get_mix_buffer_size());
@@ -134,21 +136,21 @@ void AudioPlayer::set_stream(Ref<AudioStream> p_stream) {
AudioServer::get_singleton()->unlock();
}
-Ref<AudioStream> AudioPlayer::get_stream() const {
+Ref<AudioStream> AudioStreamPlayer::get_stream() const {
return stream;
}
-void AudioPlayer::set_volume_db(float p_volume) {
+void AudioStreamPlayer::set_volume_db(float p_volume) {
volume_db = p_volume;
}
-float AudioPlayer::get_volume_db() const {
+float AudioStreamPlayer::get_volume_db() const {
return volume_db;
}
-void AudioPlayer::play(float p_from_pos) {
+void AudioStreamPlayer::play(float p_from_pos) {
if (stream_playback.is_valid()) {
mix_volume_db = volume_db; //reset volume ramp
@@ -157,21 +159,21 @@ void AudioPlayer::play(float p_from_pos) {
}
}
-void AudioPlayer::seek(float p_seconds) {
+void AudioStreamPlayer::seek(float p_seconds) {
if (stream_playback.is_valid()) {
setseek = p_seconds;
}
}
-void AudioPlayer::stop() {
+void AudioStreamPlayer::stop() {
if (stream_playback.is_valid()) {
active = false;
}
}
-bool AudioPlayer::is_playing() const {
+bool AudioStreamPlayer::is_playing() const {
if (stream_playback.is_valid()) {
return active && stream_playback->is_playing();
@@ -180,7 +182,7 @@ bool AudioPlayer::is_playing() const {
return false;
}
-float AudioPlayer::get_pos() {
+float AudioStreamPlayer::get_pos() {
if (stream_playback.is_valid()) {
return stream_playback->get_pos();
@@ -189,14 +191,14 @@ float AudioPlayer::get_pos() {
return 0;
}
-void AudioPlayer::set_bus(const StringName &p_bus) {
+void AudioStreamPlayer::set_bus(const StringName &p_bus) {
//if audio is active, must lock this
AudioServer::get_singleton()->lock();
bus = p_bus;
AudioServer::get_singleton()->unlock();
}
-StringName AudioPlayer::get_bus() const {
+StringName AudioStreamPlayer::get_bus() const {
for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
if (AudioServer::get_singleton()->get_bus_name(i) == bus) {
@@ -206,38 +208,38 @@ StringName AudioPlayer::get_bus() const {
return "Master";
}
-void AudioPlayer::set_autoplay(bool p_enable) {
+void AudioStreamPlayer::set_autoplay(bool p_enable) {
autoplay = p_enable;
}
-bool AudioPlayer::is_autoplay_enabled() {
+bool AudioStreamPlayer::is_autoplay_enabled() {
return autoplay;
}
-void AudioPlayer::set_mix_target(MixTarget p_target) {
+void AudioStreamPlayer::set_mix_target(MixTarget p_target) {
mix_target = p_target;
}
-AudioPlayer::MixTarget AudioPlayer::get_mix_target() const {
+AudioStreamPlayer::MixTarget AudioStreamPlayer::get_mix_target() const {
return mix_target;
}
-void AudioPlayer::_set_playing(bool p_enable) {
+void AudioStreamPlayer::_set_playing(bool p_enable) {
if (p_enable)
play();
else
stop();
}
-bool AudioPlayer::_is_active() const {
+bool AudioStreamPlayer::_is_active() const {
return active;
}
-void AudioPlayer::_validate_property(PropertyInfo &property) const {
+void AudioStreamPlayer::_validate_property(PropertyInfo &property) const {
if (property.name == "bus") {
@@ -253,39 +255,39 @@ void AudioPlayer::_validate_property(PropertyInfo &property) const {
}
}
-void AudioPlayer::_bus_layout_changed() {
+void AudioStreamPlayer::_bus_layout_changed() {
_change_notify();
}
-void AudioPlayer::_bind_methods() {
+void AudioStreamPlayer::_bind_methods() {
- 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(D_METHOD("set_stream", "stream"), &AudioStreamPlayer::set_stream);
+ ClassDB::bind_method(D_METHOD("get_stream"), &AudioStreamPlayer::get_stream);
- 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(D_METHOD("set_volume_db", "volume_db"), &AudioStreamPlayer::set_volume_db);
+ ClassDB::bind_method(D_METHOD("get_volume_db"), &AudioStreamPlayer::get_volume_db);
- 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(D_METHOD("play", "from_pos"), &AudioStreamPlayer::play, DEFVAL(0.0));
+ ClassDB::bind_method(D_METHOD("seek", "to_pos"), &AudioStreamPlayer::seek);
+ ClassDB::bind_method(D_METHOD("stop"), &AudioStreamPlayer::stop);
- ClassDB::bind_method(D_METHOD("is_playing"), &AudioPlayer::is_playing);
- ClassDB::bind_method(D_METHOD("get_pos"), &AudioPlayer::get_pos);
+ ClassDB::bind_method(D_METHOD("is_playing"), &AudioStreamPlayer::is_playing);
+ ClassDB::bind_method(D_METHOD("get_pos"), &AudioStreamPlayer::get_pos);
- ClassDB::bind_method(D_METHOD("set_bus", "bus"), &AudioPlayer::set_bus);
- ClassDB::bind_method(D_METHOD("get_bus"), &AudioPlayer::get_bus);
+ ClassDB::bind_method(D_METHOD("set_bus", "bus"), &AudioStreamPlayer::set_bus);
+ ClassDB::bind_method(D_METHOD("get_bus"), &AudioStreamPlayer::get_bus);
- 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(D_METHOD("set_autoplay", "enable"), &AudioStreamPlayer::set_autoplay);
+ ClassDB::bind_method(D_METHOD("is_autoplay_enabled"), &AudioStreamPlayer::is_autoplay_enabled);
- 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(D_METHOD("set_mix_target", "mix_target"), &AudioStreamPlayer::set_mix_target);
+ ClassDB::bind_method(D_METHOD("get_mix_target"), &AudioStreamPlayer::get_mix_target);
- ClassDB::bind_method(D_METHOD("_set_playing", "enable"), &AudioPlayer::_set_playing);
- ClassDB::bind_method(D_METHOD("_is_active"), &AudioPlayer::_is_active);
+ ClassDB::bind_method(D_METHOD("_set_playing", "enable"), &AudioStreamPlayer::_set_playing);
+ ClassDB::bind_method(D_METHOD("_is_active"), &AudioStreamPlayer::_is_active);
- ClassDB::bind_method(D_METHOD("_bus_layout_changed"), &AudioPlayer::_bus_layout_changed);
+ ClassDB::bind_method(D_METHOD("_bus_layout_changed"), &AudioStreamPlayer::_bus_layout_changed);
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");
@@ -295,7 +297,7 @@ void AudioPlayer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::STRING, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus");
}
-AudioPlayer::AudioPlayer() {
+AudioStreamPlayer::AudioStreamPlayer() {
mix_volume_db = 0;
volume_db = 0;
@@ -307,5 +309,5 @@ AudioPlayer::AudioPlayer() {
AudioServer::get_singleton()->connect("bus_layout_changed", this, "_bus_layout_changed");
}
-AudioPlayer::~AudioPlayer() {
+AudioStreamPlayer::~AudioStreamPlayer() {
}
diff --git a/scene/audio/audio_player.h b/scene/audio/audio_player.h
index 0d78626189..8bd6844dec 100644
--- a/scene/audio/audio_player.h
+++ b/scene/audio/audio_player.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,9 +33,9 @@
#include "scene/main/node.h"
#include "servers/audio/audio_stream.h"
-class AudioPlayer : public Node {
+class AudioStreamPlayer : public Node {
- GDCLASS(AudioPlayer, Node)
+ GDCLASS(AudioStreamPlayer, Node)
public:
enum MixTarget {
@@ -59,7 +60,7 @@ private:
MixTarget mix_target;
void _mix_audio();
- static void _mix_audios(void *self) { reinterpret_cast<AudioPlayer *>(self)->_mix_audio(); }
+ static void _mix_audios(void *self) { reinterpret_cast<AudioStreamPlayer *>(self)->_mix_audio(); }
void _set_playing(bool p_enable);
bool _is_active() const;
@@ -93,9 +94,9 @@ public:
void set_mix_target(MixTarget p_target);
MixTarget get_mix_target() const;
- AudioPlayer();
- ~AudioPlayer();
+ AudioStreamPlayer();
+ ~AudioStreamPlayer();
};
-VARIANT_ENUM_CAST(AudioPlayer::MixTarget)
+VARIANT_ENUM_CAST(AudioStreamPlayer::MixTarget)
#endif // AUDIOPLAYER_H
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index eceee8e317..9c20decef0 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,6 +38,8 @@ void BaseButton::_unpress_group() {
if (!button_group.is_valid())
return;
+ status.pressed = true;
+
for (Set<BaseButton *>::Element *E = button_group->buttons.front(); E; E = E->next()) {
if (E->get() == this)
continue;
@@ -45,188 +48,185 @@ void BaseButton::_unpress_group() {
}
}
-void BaseButton::_gui_input(InputEvent p_event) {
+void BaseButton::_gui_input(Ref<InputEvent> p_event) {
if (status.disabled) // no interaction with disabled button
return;
- switch (p_event.type) {
-
- case InputEvent::MOUSE_BUTTON: {
-
- const InputEventMouseButton &b = p_event.mouse_button;
+ Ref<InputEventMouseButton> b = p_event;
- if (status.disabled || b.button_index != 1)
- return;
+ if (b.is_valid()) {
+ if (status.disabled || b->get_button_index() != 1)
+ return;
- if (status.pressing_button)
- break;
+ if (status.pressing_button)
+ return;
- if (action_mode == ACTION_MODE_BUTTON_PRESS) {
+ if (action_mode == ACTION_MODE_BUTTON_PRESS) {
- if (b.pressed) {
+ if (b->is_pressed()) {
- emit_signal("button_down");
-
- if (!toggle_mode) { //mouse press attempt
+ emit_signal("button_down");
- status.press_attempt = true;
- status.pressing_inside = true;
+ if (!toggle_mode) { //mouse press attempt
- pressed();
- if (get_script_instance()) {
- Variant::CallError ce;
- get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
- }
+ status.press_attempt = true;
+ status.pressing_inside = true;
- emit_signal("pressed");
- _unpress_group();
+ pressed();
+ if (get_script_instance()) {
+ Variant::CallError ce;
+ get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
+ }
- } else {
+ emit_signal("pressed");
+ _unpress_group();
- status.pressed = !status.pressed;
- pressed();
- if (get_script_instance()) {
- Variant::CallError ce;
- get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
- }
- emit_signal("pressed");
- _unpress_group();
+ } else {
- toggled(status.pressed);
- emit_signal("toggled", status.pressed);
+ status.pressed = !status.pressed;
+ pressed();
+ if (get_script_instance()) {
+ Variant::CallError ce;
+ get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
}
+ emit_signal("pressed");
+ _unpress_group();
- } else {
+ toggled(status.pressed);
+ emit_signal("toggled", status.pressed);
+ }
- emit_signal("button_up");
+ } else {
- /* this is pointless if (status.press_attempt && status.pressing_inside) {
- //released();
- emit_signal("released");
- }
-*/
- status.press_attempt = false;
+ emit_signal("button_up");
+
+ /* this is pointless if (status.press_attempt && status.pressing_inside) {
+ //released();
+ emit_signal("released");
}
- update();
- break;
+*/
+ status.press_attempt = false;
}
+ update();
+ return;
+ }
- if (b.pressed) {
+ if (b->is_pressed()) {
- status.press_attempt = true;
- status.pressing_inside = true;
- emit_signal("button_down");
+ status.press_attempt = true;
+ status.pressing_inside = true;
+ emit_signal("button_down");
- } else {
+ } else {
- emit_signal("button_up");
+ emit_signal("button_up");
- if (status.press_attempt && status.pressing_inside) {
+ if (status.press_attempt && status.pressing_inside) {
- if (!toggle_mode) { //mouse press attempt
+ if (!toggle_mode) { //mouse press attempt
- pressed();
- if (get_script_instance()) {
- Variant::CallError ce;
- get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
- }
+ pressed();
+ if (get_script_instance()) {
+ Variant::CallError ce;
+ get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
+ }
- emit_signal("pressed");
+ emit_signal("pressed");
- } else {
+ } else {
- status.pressed = !status.pressed;
+ status.pressed = !status.pressed;
- pressed();
- emit_signal("pressed");
+ pressed();
+ emit_signal("pressed");
- toggled(status.pressed);
- emit_signal("toggled", status.pressed);
- if (get_script_instance()) {
- get_script_instance()->call(SceneStringNames::get_singleton()->_toggled, status.pressed);
- }
+ toggled(status.pressed);
+ emit_signal("toggled", status.pressed);
+ if (get_script_instance()) {
+ get_script_instance()->call(SceneStringNames::get_singleton()->_toggled, status.pressed);
}
-
- _unpress_group();
}
- status.press_attempt = false;
+ _unpress_group();
}
- update();
- } break;
- case InputEvent::MOUSE_MOTION: {
-
- if (status.press_attempt && status.pressing_button == 0) {
- bool last_press_inside = status.pressing_inside;
- status.pressing_inside = has_point(Point2(p_event.mouse_motion.x, p_event.mouse_motion.y));
- if (last_press_inside != status.pressing_inside)
- update();
- }
- } break;
- case InputEvent::ACTION:
- case InputEvent::JOYPAD_BUTTON:
- case InputEvent::KEY: {
+ status.press_attempt = false;
+ }
- if (p_event.is_echo()) {
- break;
- }
+ update();
+ }
- if (status.disabled) {
- break;
- }
+ Ref<InputEventMouseMotion> mm = p_event;
- if (status.press_attempt && status.pressing_button == 0) {
- break;
- }
+ if (mm.is_valid()) {
+ if (status.press_attempt && status.pressing_button == 0) {
+ bool last_press_inside = status.pressing_inside;
+ status.pressing_inside = has_point(mm->get_position());
+ if (last_press_inside != status.pressing_inside)
+ update();
+ }
+ }
- if (p_event.is_action("ui_accept")) {
+ if (!mm.is_valid() && !b.is_valid()) {
- if (p_event.is_pressed()) {
+ if (p_event->is_echo()) {
+ return;
+ }
- status.pressing_button++;
- status.press_attempt = true;
- status.pressing_inside = true;
- emit_signal("button_down");
+ if (status.disabled) {
+ return;
+ }
- } else if (status.press_attempt) {
+ if (status.press_attempt && status.pressing_button == 0) {
+ return;
+ }
- if (status.pressing_button)
- status.pressing_button--;
+ if (p_event->is_action("ui_accept")) {
- if (status.pressing_button)
- break;
+ if (p_event->is_pressed()) {
- status.press_attempt = false;
- status.pressing_inside = false;
+ status.pressing_button++;
+ status.press_attempt = true;
+ status.pressing_inside = true;
+ emit_signal("button_down");
- emit_signal("button_up");
+ } else if (status.press_attempt) {
- if (!toggle_mode) { //mouse press attempt
+ if (status.pressing_button)
+ status.pressing_button--;
- pressed();
- emit_signal("pressed");
- } else {
+ if (status.pressing_button)
+ return;
- status.pressed = !status.pressed;
+ status.press_attempt = false;
+ status.pressing_inside = false;
- pressed();
- emit_signal("pressed");
+ emit_signal("button_up");
- toggled(status.pressed);
- if (get_script_instance()) {
- get_script_instance()->call(SceneStringNames::get_singleton()->_toggled, status.pressed);
- }
- emit_signal("toggled", status.pressed);
- }
+ if (!toggle_mode) { //mouse press attempt
- _unpress_group();
+ pressed();
+ emit_signal("pressed");
+ } else {
+
+ status.pressed = !status.pressed;
+
+ pressed();
+ emit_signal("pressed");
+
+ toggled(status.pressed);
+ if (get_script_instance()) {
+ get_script_instance()->call(SceneStringNames::get_singleton()->_toggled, status.pressed);
+ }
+ emit_signal("toggled", status.pressed);
}
- accept_event();
- update();
+ _unpress_group();
}
+
+ accept_event();
+ update();
}
}
}
@@ -427,9 +427,9 @@ Ref<ShortCut> BaseButton::get_shortcut() const {
return shortcut;
}
-void BaseButton::_unhandled_input(InputEvent p_event) {
+void BaseButton::_unhandled_input(Ref<InputEvent> p_event) {
- if (!is_disabled() && is_visible_in_tree() && p_event.is_pressed() && !p_event.is_echo() && shortcut.is_valid() && shortcut->is_shortcut(p_event)) {
+ if (!is_disabled() && is_visible_in_tree() && p_event->is_pressed() && !p_event->is_echo() && shortcut.is_valid() && shortcut->is_shortcut(p_event)) {
if (get_viewport()->get_modal_stack_top() && !get_viewport()->get_modal_stack_top()->is_a_parent_of(this))
return; //ignore because of modal window
@@ -508,7 +508,7 @@ void BaseButton::_bind_methods() {
ADD_SIGNAL(MethodInfo("toggled", PropertyInfo(Variant::BOOL, "pressed")));
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_PROPERTYNZ(PropertyInfo(Variant::BOOL, "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");
@@ -563,7 +563,7 @@ BaseButton *ButtonGroup::get_pressed_button() {
void ButtonGroup::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_pressed_button:BaseButton"), &ButtonGroup::get_pressed_button);
+ ClassDB::bind_method(D_METHOD("get_pressed_button"), &ButtonGroup::get_pressed_button);
}
ButtonGroup::ButtonGroup() {
diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h
index e382df61c9..dfcf3b0f8a 100644
--- a/scene/gui/base_button.h
+++ b/scene/gui/base_button.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -72,8 +73,8 @@ protected:
virtual void pressed();
virtual void toggled(bool p_pressed);
static void _bind_methods();
- virtual void _gui_input(InputEvent p_event);
- virtual void _unhandled_input(InputEvent p_event);
+ virtual void _gui_input(Ref<InputEvent> p_event);
+ virtual void _unhandled_input(Ref<InputEvent> p_event);
void _notification(int p_what);
public:
diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp
index 1096c43c10..16b2cfa083 100644
--- a/scene/gui/box_container.cpp
+++ b/scene/gui/box_container.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -307,6 +308,7 @@ MarginContainer *VBoxContainer::add_margin_child(const String &p_label, Control
l->set_text(p_label);
add_child(l);
MarginContainer *mc = memnew(MarginContainer);
+ mc->add_constant_override("margin_left", 0);
mc->add_child(p_control);
add_child(mc);
if (p_expand)
diff --git a/scene/gui/box_container.h b/scene/gui/box_container.h
index 04b074896b..d544ff79d1 100644
--- a/scene/gui/box_container.h
+++ b/scene/gui/box_container.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index 23915c51a8..9a0b3b3c89 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -68,6 +69,7 @@ void Button::_notification(int p_what) {
RID ci = get_canvas_item();
Size2 size = get_size();
Color color;
+ Color color_icon(1, 1, 1, 1);
//print_line(get_text()+": "+itos(is_flat())+" hover "+itos(get_draw_mode()));
@@ -81,29 +83,40 @@ void Button::_notification(int p_what) {
if (!flat)
style->draw(ci, Rect2(Point2(0, 0), size));
color = get_color("font_color");
+ if (has_color("icon_color_normal"))
+ color_icon = get_color("icon_color_normal");
} break;
case DRAW_PRESSED: {
style = get_stylebox("pressed");
- style->draw(ci, Rect2(Point2(0, 0), size));
+ if (!flat)
+ style->draw(ci, Rect2(Point2(0, 0), size));
if (has_color("font_color_pressed"))
color = get_color("font_color_pressed");
else
color = get_color("font_color");
+ if (has_color("icon_color_pressed"))
+ color_icon = get_color("icon_color_pressed");
} break;
case DRAW_HOVER: {
style = get_stylebox("hover");
- style->draw(ci, Rect2(Point2(0, 0), size));
+ if (!flat)
+ style->draw(ci, Rect2(Point2(0, 0), size));
color = get_color("font_color_hover");
+ if (has_color("icon_color_hover"))
+ color_icon = get_color("icon_color_hover");
} break;
case DRAW_DISABLED: {
style = get_stylebox("disabled");
- style->draw(ci, Rect2(Point2(0, 0), size));
+ if (!flat)
+ style->draw(ci, Rect2(Point2(0, 0), size));
color = get_color("font_color_disabled");
+ if (has_color("icon_color_disabled"))
+ color_icon = get_color("icon_color_disabled");
} break;
}
@@ -147,8 +160,9 @@ void Button::_notification(int p_what) {
if (!_icon.is_null()) {
int valign = size.height - style->get_minimum_size().y;
-
- _icon->draw(ci, style->get_offset() + Point2(0, Math::floor((valign - _icon->get_height()) / 2.0)), is_disabled() ? Color(1, 1, 1, 0.4) : Color(1, 1, 1));
+ if (is_disabled())
+ color_icon.a = 0.4;
+ _icon->draw(ci, style->get_offset() + Point2(0, Math::floor((valign - _icon->get_height()) / 2.0)), color_icon);
}
}
}
@@ -222,8 +236,8 @@ void Button::_bind_methods() {
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_button_icon", "texture"), &Button::set_icon);
+ ClassDB::bind_method(D_METHOD("get_button_icon"), &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);
diff --git a/scene/gui/button.h b/scene/gui/button.h
index 38605bd3ef..499e44c0e1 100644
--- a/scene/gui/button.h
+++ b/scene/gui/button.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/button_array.cpp b/scene/gui/button_array.cpp
deleted file mode 100644
index c1cb9ad855..0000000000
--- a/scene/gui/button_array.cpp
+++ /dev/null
@@ -1,541 +0,0 @@
-/*************************************************************************/
-/* button_array.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 "button_array.h"
-
-bool ButtonArray::_set(const StringName &p_name, const Variant &p_value) {
-
- String n = String(p_name);
- if (n.begins_with("button/")) {
-
- String what = n.get_slicec('/', 1);
- if (what == "count") {
- int new_size = p_value;
- if (new_size > 0 && buttons.size() == 0) {
- selected = 0;
- }
-
- if (new_size < buttons.size()) {
- if (selected >= new_size)
- selected = new_size - 1;
- }
- buttons.resize(new_size);
- _change_notify();
- minimum_size_changed();
- } else if (what == "align") {
- set_align(Align(p_value.operator int()));
- } else if (what == "selected") {
- set_selected(p_value);
- } else if (what == "min_button_size") {
- min_button_size = p_value;
- } else {
- int idx = what.to_int();
- ERR_FAIL_INDEX_V(idx, buttons.size(), false);
- String f = n.get_slicec('/', 2);
- if (f == "text") {
- buttons[idx].text = p_value;
- 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;
- else
- return false;
- }
-
- update();
- return true;
- }
-
- return false;
-}
-
-bool ButtonArray::_get(const StringName &p_name, Variant &r_ret) const {
-
- String n = String(p_name);
- if (n.begins_with("button/")) {
-
- String what = n.get_slicec('/', 1);
- if (what == "count") {
- r_ret = buttons.size();
- } else if (what == "align") {
- r_ret = get_align();
- } else if (what == "selected") {
- r_ret = get_selected();
- } else if (what == "min_button_size") {
- r_ret = min_button_size;
- } else {
- int idx = what.to_int();
- ERR_FAIL_INDEX_V(idx, buttons.size(), false);
- String f = n.get_slicec('/', 2);
- if (f == "text")
- r_ret = buttons[idx].text;
- else if (f == "tooltip")
- r_ret = buttons[idx].tooltip;
- else if (f == "icon")
- r_ret = buttons[idx].icon;
- else
- return false;
- }
-
- return true;
- }
-
- return false;
-}
-void ButtonArray::_get_property_list(List<PropertyInfo> *p_list) const {
-
- p_list->push_back(PropertyInfo(Variant::INT, "button/count", PROPERTY_HINT_RANGE, "0,512,1"));
- p_list->push_back(PropertyInfo(Variant::INT, "button/min_button_size", PROPERTY_HINT_RANGE, "0,1024,1"));
- p_list->push_back(PropertyInfo(Variant::INT, "button/align", PROPERTY_HINT_ENUM, "Begin,Center,End,Fill,Expand"));
- for (int i = 0; i < buttons.size(); i++) {
- String base = "button/" + itos(i) + "/";
- p_list->push_back(PropertyInfo(Variant::STRING, base + "text"));
- p_list->push_back(PropertyInfo(Variant::STRING, base + "tooltip"));
- p_list->push_back(PropertyInfo(Variant::OBJECT, base + "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture"));
- }
- if (buttons.size() > 0) {
- p_list->push_back(PropertyInfo(Variant::INT, "button/selected", PROPERTY_HINT_RANGE, "0," + itos(buttons.size() - 1) + ",1"));
- }
-}
-
-Size2 ButtonArray::get_minimum_size() const {
-
- Ref<StyleBox> style_normal = get_stylebox("normal");
- Ref<StyleBox> style_selected = get_stylebox("selected");
- Ref<Font> font_normal = get_font("font");
- Ref<Font> font_selected = get_font("font_selected");
- int icon_sep = get_constant("icon_separator");
- int button_sep = get_constant("button_separator");
-
- Size2 minsize;
-
- for (int i = 0; i < buttons.size(); i++) {
-
- Ref<StyleBox> sb = i == selected ? style_selected : style_normal;
- Ref<Font> f = i == selected ? font_selected : font_normal;
-
- Size2 ms;
- ms = f->get_string_size(buttons[i].xl_text);
- if (buttons[i].icon.is_valid()) {
-
- Size2 bs = buttons[i].icon->get_size();
- ms.height = MAX(ms.height, bs.height);
- ms.width += bs.width + icon_sep;
- }
-
- ms += sb->get_minimum_size();
-
- buttons[i]._ms_cache = ms[orientation];
-
- minsize[orientation] += ms[orientation];
- if (i > 0)
- minsize[orientation] += button_sep;
- minsize[!orientation] = MAX(minsize[!orientation], ms[!orientation]);
- }
-
- return minsize;
-}
-
-void ButtonArray::_notification(int p_what) {
-
- switch (p_what) {
- case NOTIFICATION_MOUSE_EXIT: {
- hover = -1;
- update();
- } break;
- case NOTIFICATION_READY: {
- MethodInfo mi;
- mi.name = "mouse_sub_enter";
-
- add_user_signal(mi);
-
- } break;
- case NOTIFICATION_DRAW: {
-
- Size2 size = get_size();
- Size2 minsize = get_combined_minimum_size();
- Ref<StyleBox> style_normal = get_stylebox("normal");
- Ref<StyleBox> style_selected = get_stylebox("selected");
- Ref<StyleBox> style_focus = get_stylebox("focus");
- Ref<StyleBox> style_hover = get_stylebox("hover");
- Ref<Font> font_normal = get_font("font");
- Ref<Font> font_selected = get_font("font_selected");
- int icon_sep = get_constant("icon_separator");
- int button_sep = get_constant("button_separator");
- Color color_normal = get_color("font_color");
- Color color_selected = get_color("font_color_selected");
-
- int sep = button_sep;
- int ofs = 0;
- int expand = 0;
-
- switch (align) {
- case ALIGN_BEGIN: {
-
- ofs = 0;
- } break;
- case ALIGN_CENTER: {
-
- ofs = Math::floor((size[orientation] - minsize[orientation]) / 2);
- } break;
- case ALIGN_END: {
-
- ofs = Math::floor((size[orientation] - minsize[orientation]));
- } break;
- case ALIGN_FILL: {
-
- if (buttons.size() > 1)
- sep += Math::floor((size[orientation] - minsize[orientation]) / (buttons.size() - 1.0));
- ofs = 0;
- } break;
- case ALIGN_EXPAND_FILL: {
-
- ofs = 0;
- expand = size[orientation] - minsize[orientation];
- } break;
- }
-
- int op_size = orientation == VERTICAL ? size.width : size.height;
-
- for (int i = 0; i < buttons.size(); i++) {
-
- int ms = buttons[i]._ms_cache;
- int s = ms;
- if (expand > 0) {
- s += expand / buttons.size();
- }
- if (min_button_size != -1 && s < min_button_size) {
- s = min_button_size;
- }
-
- Rect2 r;
- r.pos[orientation] = ofs;
- r.pos[!orientation] = 0;
- r.size[orientation] = s;
- r.size[!orientation] = op_size;
-
- Ref<Font> f;
- Color c;
- Point2 sbsize;
- Point2 sbofs;
- if (i == selected) {
- draw_style_box(style_selected, r);
- sbsize = style_selected->get_minimum_size();
- sbofs = style_selected->get_offset();
- f = font_selected;
- c = color_selected;
- if (has_focus())
- draw_style_box(style_focus, r);
- } else {
- if (hover == i)
- draw_style_box(style_hover, r);
- else if (!flat)
- draw_style_box(style_normal, r);
- sbsize = style_normal->get_minimum_size();
- sbofs = style_normal->get_offset();
- f = font_normal;
- c = color_normal;
- }
-
- Size2 ssize = f->get_string_size(buttons[i].xl_text);
- if (buttons[i].icon.is_valid()) {
-
- ssize.x += buttons[i].icon->get_width();
- }
- Point2 text_ofs = ((r.size - ssize - sbsize) / 2.0 + Point2(0, f->get_ascent())).floor() + sbofs;
- if (buttons[i].icon.is_valid()) {
-
- draw_texture(buttons[i].icon, r.pos + Point2(text_ofs.x, Math::floor((r.size.height - buttons[i].icon->get_height()) / 2.0)));
- text_ofs.x += buttons[i].icon->get_width() + icon_sep;
- }
- draw_string(f, text_ofs + r.pos, buttons[i].xl_text, c);
- buttons[i]._pos_cache = ofs;
- buttons[i]._size_cache = s;
-
- ofs += s;
- ofs += sep;
- }
-
- } break;
- }
-}
-
-void ButtonArray::_gui_input(const InputEvent &p_event) {
-
- if (
- ((orientation == HORIZONTAL && p_event.is_action("ui_left")) ||
- (orientation == VERTICAL && p_event.is_action("ui_up"))) &&
- p_event.is_pressed() && selected > 0) {
- set_selected(selected - 1);
- accept_event();
- emit_signal("button_selected", selected);
- return;
- }
-
- if (
- ((orientation == HORIZONTAL && p_event.is_action("ui_right")) ||
- (orientation == VERTICAL && p_event.is_action("ui_down"))) &&
- p_event.is_pressed() && selected < (buttons.size() - 1)) {
- set_selected(selected + 1);
- accept_event();
- emit_signal("button_selected", selected);
- return;
- }
-
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.pressed && p_event.mouse_button.button_index == BUTTON_LEFT) {
-
- int ofs = orientation == HORIZONTAL ? p_event.mouse_button.x : p_event.mouse_button.y;
-
- for (int i = 0; i < buttons.size(); i++) {
-
- if (ofs >= buttons[i]._pos_cache && ofs < buttons[i]._pos_cache + buttons[i]._size_cache) {
-
- set_selected(i);
- emit_signal("button_selected", i);
- return;
- }
- }
- }
-
- if (p_event.type == InputEvent::MOUSE_MOTION) {
-
- int ofs = orientation == HORIZONTAL ? p_event.mouse_motion.x : p_event.mouse_motion.y;
- int new_hover = -1;
- for (int i = 0; i < buttons.size(); i++) {
-
- if (ofs >= buttons[i]._pos_cache && ofs < buttons[i]._pos_cache + buttons[i]._size_cache) {
-
- new_hover = i;
- break;
- }
- }
-
- if (new_hover != hover) {
- hover = new_hover;
- emit_signal("mouse_sub_enter");
- update();
- }
- }
-}
-
-String ButtonArray::get_tooltip(const Point2 &p_pos) const {
-
- int ofs = orientation == HORIZONTAL ? p_pos.x : p_pos.y;
- for (int i = 0; i < buttons.size(); i++) {
-
- if (ofs >= buttons[i]._pos_cache && ofs < buttons[i]._pos_cache + buttons[i]._size_cache)
- return buttons[i].tooltip;
- }
- return Control::get_tooltip(p_pos);
-}
-
-void ButtonArray::set_align(Align p_align) {
-
- align = p_align;
- update();
-}
-
-ButtonArray::Align ButtonArray::get_align() const {
-
- return align;
-}
-
-void ButtonArray::set_flat(bool p_flat) {
-
- flat = p_flat;
- update();
-}
-
-bool ButtonArray::is_flat() const {
-
- return flat;
-}
-
-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();
-
- if (selected == -1)
- selected = 0;
-
- minimum_size_changed();
-}
-
-void ButtonArray::add_icon_button(const Ref<Texture> &p_icon, const String &p_text, const String &p_tooltip) {
-
- 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);
- if (selected == -1)
- selected = 0;
-
- update();
-}
-
-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();
-}
-
-void ButtonArray::set_button_tooltip(int p_button, const String &p_text) {
-
- ERR_FAIL_INDEX(p_button, buttons.size());
- buttons[p_button].tooltip = p_text;
-}
-
-void ButtonArray::set_button_icon(int p_button, const Ref<Texture> &p_icon) {
-
- ERR_FAIL_INDEX(p_button, buttons.size());
- buttons[p_button].icon = p_icon;
- update();
- minimum_size_changed();
-}
-
-String ButtonArray::get_button_text(int p_button) const {
-
- ERR_FAIL_INDEX_V(p_button, buttons.size(), "");
- return buttons[p_button].text;
-}
-
-String ButtonArray::get_button_tooltip(int p_button) const {
-
- ERR_FAIL_INDEX_V(p_button, buttons.size(), "");
- return buttons[p_button].tooltip;
-}
-
-Ref<Texture> ButtonArray::get_button_icon(int p_button) const {
-
- ERR_FAIL_INDEX_V(p_button, buttons.size(), Ref<Texture>());
- return buttons[p_button].icon;
-}
-
-int ButtonArray::get_selected() const {
-
- return selected;
-}
-
-int ButtonArray::get_hovered() const {
-
- return hover;
-}
-
-void ButtonArray::set_selected(int p_selected) {
-
- ERR_FAIL_INDEX(p_selected, buttons.size());
- selected = p_selected;
- update();
-}
-
-void ButtonArray::erase_button(int p_button) {
-
- ERR_FAIL_INDEX(p_button, buttons.size());
- buttons.remove(p_button);
- if (p_button >= selected)
- selected--;
- if (selected < 0)
- selected = 0;
- if (selected >= buttons.size())
- selected = buttons.size() - 1;
-
- update();
-}
-
-void ButtonArray::clear() {
-
- buttons.clear();
- selected = -1;
- update();
-}
-
-int ButtonArray::get_button_count() const {
-
- return buttons.size();
-}
-
-void ButtonArray::get_translatable_strings(List<String> *p_strings) const {
-
- for (int i = 0; i < buttons.size(); i++) {
- p_strings->push_back(buttons[i].text);
- p_strings->push_back(buttons[i].tooltip);
- }
-}
-
-void ButtonArray::_bind_methods() {
-
- 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);
- BIND_CONSTANT(ALIGN_END);
- BIND_CONSTANT(ALIGN_FILL);
- BIND_CONSTANT(ALIGN_EXPAND_FILL);
-
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flat"), "set_flat", "is_flat");
-
- ADD_SIGNAL(MethodInfo("button_selected", PropertyInfo(Variant::INT, "button_idx")));
-}
-
-ButtonArray::ButtonArray(Orientation p_orientation) {
-
- orientation = p_orientation;
- selected = -1;
- set_focus_mode(FOCUS_ALL);
- hover = -1;
- flat = false;
- min_button_size = -1;
-}
diff --git a/scene/gui/button_array.h b/scene/gui/button_array.h
deleted file mode 100644
index dac130e79a..0000000000
--- a/scene/gui/button_array.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************/
-/* button_array.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 BUTTON_ARRAY_H
-#define BUTTON_ARRAY_H
-
-#include "scene/gui/control.h"
-
-class ButtonArray : public Control {
-
- GDCLASS(ButtonArray, Control);
-
-public:
- enum Align {
- ALIGN_BEGIN,
- ALIGN_CENTER,
- ALIGN_END,
- ALIGN_FILL,
- ALIGN_EXPAND_FILL
- };
-
-private:
- Orientation orientation;
- Align align;
-
- struct Button {
-
- String text;
- String xl_text;
- String tooltip;
- Ref<Texture> icon;
- mutable int _ms_cache;
- mutable int _pos_cache;
- mutable int _size_cache;
- };
-
- int selected;
- int hover;
- bool flat;
- double min_button_size;
-
- Vector<Button> buttons;
-
-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;
-
- void _notification(int p_what);
- static void _bind_methods();
-
-public:
- void _gui_input(const InputEvent &p_event);
-
- void set_align(Align p_align);
- Align get_align() const;
-
- void set_flat(bool p_flat);
- bool is_flat() const;
-
- void add_button(const String &p_button, const String &p_tooltip = "");
- void add_icon_button(const Ref<Texture> &p_icon, const String &p_button = "", const String &p_tooltip = "");
-
- void set_button_text(int p_button, const String &p_text);
- void set_button_tooltip(int p_button, const String &p_text);
- void set_button_icon(int p_button, const Ref<Texture> &p_icon);
-
- String get_button_text(int p_button) const;
- String get_button_tooltip(int p_button) const;
- Ref<Texture> get_button_icon(int p_button) const;
-
- int get_selected() const;
- int get_hovered() const;
- void set_selected(int p_selected);
-
- int get_button_count() const;
-
- void erase_button(int p_button);
- void clear();
-
- virtual Size2 get_minimum_size() const;
-
- virtual void get_translatable_strings(List<String> *p_strings) const;
- virtual String get_tooltip(const Point2 &p_pos) const;
-
- ButtonArray(Orientation p_orientation = HORIZONTAL);
-};
-
-class HButtonArray : public ButtonArray {
- GDCLASS(HButtonArray, ButtonArray);
-
-public:
- HButtonArray()
- : ButtonArray(HORIZONTAL){};
-};
-
-class VButtonArray : public ButtonArray {
- GDCLASS(VButtonArray, ButtonArray);
-
-public:
- VButtonArray()
- : ButtonArray(VERTICAL){};
-};
-
-#endif // BUTTON_ARRAY_H
diff --git a/scene/gui/button_group.cpp b/scene/gui/button_group.cpp
index 21c1559b8f..e54e810d7d 100644
--- a/scene/gui/button_group.cpp
+++ b/scene/gui/button_group.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -151,12 +152,12 @@ int ButtonGroup::get_pressed_button_index() const {
void ButtonGroup::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_pressed_button:BaseButton"),&ButtonGroup::get_pressed_button);
+ ClassDB::bind_method(D_METHOD("get_pressed_button"),&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_focused_button"),&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);
+ ClassDB::bind_method(D_METHOD("set_pressed_button","button"),&ButtonGroup::_pressed);
ADD_SIGNAL( MethodInfo("button_selected",PropertyInfo(Variant::OBJECT,"button",PROPERTY_HINT_RESOURCE_TYPE,"BaseButton")));
}
diff --git a/scene/gui/button_group.h b/scene/gui/button_group.h
index 38acd06984..93c3aaaeb3 100644
--- a/scene/gui/button_group.h
+++ b/scene/gui/button_group.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/center_container.cpp b/scene/gui/center_container.cpp
index 9cee8c0cc1..bdc811870d 100644
--- a/scene/gui/center_container.cpp
+++ b/scene/gui/center_container.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/center_container.h b/scene/gui/center_container.h
index c2deb823f1..30b526e893 100644
--- a/scene/gui/center_container.h
+++ b/scene/gui/center_container.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp
index c7e2f4e7f9..b61d516599 100644
--- a/scene/gui/check_box.cpp
+++ b/scene/gui/check_box.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/check_box.h b/scene/gui/check_box.h
index 9b682de177..ec8e097bae 100644
--- a/scene/gui/check_box.h
+++ b/scene/gui/check_box.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/check_button.cpp b/scene/gui/check_button.cpp
index 6b24e0889a..1c3d4df308 100644
--- a/scene/gui/check_button.cpp
+++ b/scene/gui/check_button.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/check_button.h b/scene/gui/check_button.h
index adf210a1e1..8634858cfe 100644
--- a/scene/gui/check_button.h
+++ b/scene/gui/check_button.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 0f982167bf..5e110362c8 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -47,7 +48,28 @@ void ColorPicker::_notification(int p_what) {
btn_pick->set_icon(get_icon("screen_picker", "ColorPicker"));
_update_color();
- }
+ } break;
+
+ case NOTIFICATION_PARENTED: {
+ for (int i = 0; i < 4; i++)
+ set_margin((Margin)i, get_constant("margin"));
+ } break;
+
+ case NOTIFICATION_VISIBILITY_CHANGED: {
+ if (get_parent()) {
+ Popup *p = get_parent()->cast_to<Popup>();
+ if (p)
+ p->set_size(Size2(get_combined_minimum_size().width + get_constant("margin") * 2, get_combined_minimum_size().height + get_constant("margin") * 2));
+ }
+ } break;
+
+ case MainLoop::NOTIFICATION_WM_QUIT_REQUEST: {
+ if (screen != NULL) {
+ if (screen->is_visible()) {
+ screen->hide();
+ }
+ }
+ } break;
}
}
@@ -83,9 +105,6 @@ void ColorPicker::set_pick_color(const Color &p_color) {
if (!is_inside_tree())
return;
- return; //it crashes, so returning
- uv_edit->get_child(0)->cast_to<Control>()->update();
- w_edit->get_child(0)->cast_to<Control>()->update();
_update_color();
}
@@ -116,9 +135,6 @@ void ColorPicker::_value_changed(double) {
}
set_pick_color(color);
-
- _update_text_value();
-
emit_signal("color_changed", color);
}
@@ -155,6 +171,8 @@ void ColorPicker::_update_color() {
_update_text_value();
sample->update();
+ uv_edit->update();
+ w_edit->update();
updating = false;
}
@@ -177,7 +195,7 @@ void ColorPicker::_update_presets() {
}
}
- Image i(size.x * presets.size(), size.y, false, Image::FORMAT_RGB8, img);
+ Ref<Image> i = memnew(Image(size.x * presets.size(), size.y, false, Image::FORMAT_RGB8, img));
Ref<ImageTexture> t;
t.instance();
@@ -249,36 +267,36 @@ void ColorPicker::_update_text_value() {
}
void ColorPicker::_sample_draw() {
- sample->draw_rect(Rect2(Point2(), Size2(256, 20)), color);
+ sample->draw_rect(Rect2(Point2(), Size2(uv_edit->get_size().width, sample->get_size().height * 0.95)), color);
}
-void ColorPicker::_hsv_draw(int p_wich, Control *c) {
+void ColorPicker::_hsv_draw(int p_which, Control *c) {
if (!c)
return;
- if (p_wich == 0) {
+ if (p_which == 0) {
Vector<Point2> points;
points.push_back(Vector2());
points.push_back(Vector2(c->get_size().x, 0));
points.push_back(c->get_size());
points.push_back(Vector2(0, c->get_size().y));
Vector<Color> colors;
- colors.push_back(Color(1, 1, 1));
- colors.push_back(Color(1, 1, 1));
- colors.push_back(Color());
- colors.push_back(Color());
+ colors.push_back(Color(1, 1, 1, 1));
+ colors.push_back(Color(1, 1, 1, 1));
+ colors.push_back(Color(0, 0, 0, 1));
+ colors.push_back(Color(0, 0, 0, 1));
c->draw_polygon(points, colors);
Vector<Color> colors2;
Color col = color;
- col.set_hsv(color.get_h(), 1, 1);
+ col.set_hsv(h, 1, 1);
col.a = 0;
colors2.push_back(col);
col.a = 1;
colors2.push_back(col);
- col.set_hsv(color.get_h(), 1, 0);
+ col.set_hsv(h, 1, 0);
colors2.push_back(col);
col.a = 0;
colors2.push_back(col);
- c->draw_polygon(points, colors);
+ c->draw_polygon(points, colors2);
int x = CLAMP(c->get_size().x * s, 0, c->get_size().x);
int y = CLAMP(c->get_size().y - c->get_size().y * v, 0, c->get_size().y);
col = color;
@@ -286,25 +304,27 @@ void ColorPicker::_hsv_draw(int p_wich, Control *c) {
c->draw_line(Point2(x, 0), Point2(x, c->get_size().y), col.inverted());
c->draw_line(Point2(0, y), Point2(c->get_size().x, y), col.inverted());
c->draw_line(Point2(x, y), Point2(x, y), Color(1, 1, 1), 2);
- } else if (p_wich == 1) {
+ } else if (p_which == 1) {
Ref<Texture> hue = get_icon("color_hue", "ColorPicker");
c->draw_texture_rect(hue, Rect2(Point2(), c->get_size()));
- int y = c->get_size().y - c->get_size().y * h;
+ int y = c->get_size().y - c->get_size().y * (1.0 - h);
Color col = Color();
col.set_hsv(h, 1, 1);
c->draw_line(Point2(0, y), Point2(c->get_size().x, y), col.inverted());
}
}
-void ColorPicker::_uv_input(const InputEvent &ev) {
- if (ev.type == InputEvent::MOUSE_BUTTON) {
- const InputEventMouseButton &bev = ev.mouse_button;
- if (bev.pressed && bev.button_index == BUTTON_LEFT) {
+void ColorPicker::_uv_input(const Ref<InputEvent> &p_event) {
+
+ Ref<InputEventMouseButton> bev = p_event;
+
+ if (bev.is_valid()) {
+ if (bev->is_pressed() && bev->get_button_index() == BUTTON_LEFT) {
changing_color = true;
- float x = CLAMP((float)bev.x, 0, 256);
- float y = CLAMP((float)bev.y, 0, 256);
- s = x / 256;
- v = 1.0 - y / 256.0;
+ float x = CLAMP((float)bev->get_position().x, 0, uv_edit->get_size().width);
+ float y = CLAMP((float)bev->get_position().y, 0, uv_edit->get_size().height);
+ s = x / uv_edit->get_size().width;
+ v = 1.0 - y / uv_edit->get_size().height;
color.set_hsv(h, s, v, color.a);
last_hsv = color;
set_pick_color(color);
@@ -313,14 +333,17 @@ void ColorPicker::_uv_input(const InputEvent &ev) {
} else {
changing_color = false;
}
- } else if (ev.type == InputEvent::MOUSE_MOTION) {
- const InputEventMouse &bev = ev.mouse_motion;
+ }
+
+ Ref<InputEventMouseMotion> mev = p_event;
+
+ if (mev.is_valid()) {
if (!changing_color)
return;
- float x = CLAMP((float)bev.x, 0, 256);
- float y = CLAMP((float)bev.y, 0, 256);
- s = x / 256;
- v = 1.0 - y / 256.0;
+ float x = CLAMP((float)mev->get_position().x, 0, uv_edit->get_size().width);
+ float y = CLAMP((float)mev->get_position().y, 0, uv_edit->get_size().height);
+ s = x / uv_edit->get_size().width;
+ v = 1.0 - y / uv_edit->get_size().height;
color.set_hsv(h, s, v, color.a);
last_hsv = color;
set_pick_color(color);
@@ -329,13 +352,16 @@ void ColorPicker::_uv_input(const InputEvent &ev) {
}
}
-void ColorPicker::_w_input(const InputEvent &ev) {
- if (ev.type == InputEvent::MOUSE_BUTTON) {
- const InputEventMouseButton &bev = ev.mouse_button;
- if (bev.pressed && bev.button_index == BUTTON_LEFT) {
- changing_color = true;
- h = 1 - ((float)bev.y) / 256.0;
+void ColorPicker::_w_input(const Ref<InputEvent> &p_event) {
+ Ref<InputEventMouseButton> bev = p_event;
+
+ if (bev.is_valid()) {
+
+ if (bev->is_pressed() && bev->get_button_index() == BUTTON_LEFT) {
+ changing_color = true;
+ float y = CLAMP((float)bev->get_position().y, 0, w_edit->get_size().height);
+ h = y / w_edit->get_size().height;
} else {
changing_color = false;
}
@@ -344,12 +370,16 @@ void ColorPicker::_w_input(const InputEvent &ev) {
set_pick_color(color);
_update_color();
emit_signal("color_changed", color);
- } else if (ev.type == InputEvent::MOUSE_MOTION) {
- const InputEventMouse &bev = ev.mouse_motion;
+ }
+
+ Ref<InputEventMouseMotion> mev = p_event;
+
+ if (mev.is_valid()) {
+
if (!changing_color)
return;
- float y = CLAMP((float)bev.y, 0, 256);
- h = 1.0 - y / 256.0;
+ float y = CLAMP((float)mev->get_position().y, 0, w_edit->get_size().height);
+ h = y / w_edit->get_size().height;
color.set_hsv(h, s, v, color.a);
last_hsv = color;
set_pick_color(color);
@@ -358,23 +388,30 @@ void ColorPicker::_w_input(const InputEvent &ev) {
}
}
-void ColorPicker::_preset_input(const InputEvent &ev) {
- if (ev.type == InputEvent::MOUSE_BUTTON) {
- const InputEventMouseButton &bev = ev.mouse_button;
- if (bev.pressed && bev.button_index == BUTTON_LEFT) {
- int index = bev.x / (preset->get_size().x / presets.size());
+void ColorPicker::_preset_input(const Ref<InputEvent> &p_event) {
+
+ Ref<InputEventMouseButton> bev = p_event;
+
+ if (bev.is_valid()) {
+
+ if (bev->is_pressed() && bev->get_button_index() == BUTTON_LEFT) {
+ int index = bev->get_position().x / (preset->get_size().x / presets.size());
set_pick_color(presets[index]);
- } else if (bev.pressed && bev.button_index == BUTTON_RIGHT) {
- int index = bev.x / (preset->get_size().x / presets.size());
+ } else if (bev->is_pressed() && bev->get_button_index() == BUTTON_RIGHT) {
+ int index = bev->get_position().x / (preset->get_size().x / presets.size());
presets.erase(presets[index]);
_update_presets();
bt_add_preset->show();
}
_update_color();
emit_signal("color_changed", color);
- } else if (ev.type == InputEvent::MOUSE_MOTION) {
- const InputEventMouse &mev = ev.mouse_motion;
- int index = mev.x * presets.size();
+ }
+
+ Ref<InputEventMouseMotion> mev = p_event;
+
+ if (mev.is_valid()) {
+
+ int index = mev->get_position().x * presets.size();
if (preset->get_size().x != 0) {
index /= preset->get_size().x;
}
@@ -386,31 +423,30 @@ void ColorPicker::_preset_input(const InputEvent &ev) {
}
}
-void ColorPicker::_screen_input(const InputEvent &ev) {
- if (ev.type == InputEvent::MOUSE_BUTTON) {
- const InputEventMouseButton &bev = ev.mouse_button;
- if (bev.button_index == BUTTON_LEFT && !bev.pressed) {
+void ColorPicker::_screen_input(const Ref<InputEvent> &p_event) {
+
+ Ref<InputEventMouseButton> bev = p_event;
+
+ if (bev.is_valid()) {
+
+ if (bev->get_button_index() == BUTTON_LEFT && !bev->is_pressed()) {
emit_signal("color_changed", color);
screen->hide();
}
- } else if (ev.type == InputEvent::MOUSE_MOTION) {
- const InputEventMouse &mev = ev.mouse_motion;
- Viewport *r = get_tree()->get_root();
- if (!r->get_visible_rect().has_point(Point2(mev.global_x, mev.global_y)))
- return;
- Image img = r->get_screen_capture();
- if (!img.empty()) {
- last_capture = img;
- r->queue_screen_capture();
- }
- if (!last_capture.empty()) {
- int pw = last_capture.get_format() == Image::FORMAT_RGBA8 ? 4 : 3;
- int ofs = (mev.global_y * last_capture.get_width() + mev.global_x) * pw;
-
- PoolVector<uint8_t>::Read r = last_capture.get_data().read();
+ }
- Color c(r[ofs + 0] / 255.0, r[ofs + 1] / 255.0, r[ofs + 2] / 255.0);
+ Ref<InputEventMouseMotion> mev = p_event;
+ if (mev.is_valid()) {
+ Viewport *r = get_tree()->get_root();
+ if (!r->get_visible_rect().has_point(Point2(mev->get_global_position().x, mev->get_global_position().y)))
+ return;
+ Ref<Image> img = r->get_texture()->get_data();
+ if (img.is_valid() && !img->empty()) {
+ img->lock();
+ Vector2 ofs = mev->get_global_position() - r->get_visible_rect().get_position();
+ Color c = img->get_pixel(ofs.x, r->get_visible_rect().size.height - ofs.y);
+ img->unlock();
set_pick_color(c);
}
}
@@ -427,11 +463,11 @@ void ColorPicker::_screen_pick_pressed() {
r->add_child(screen);
screen->set_as_toplevel(true);
screen->set_area_as_parent_rect();
+ screen->set_default_cursor_shape(CURSOR_POINTING_HAND);
screen->connect("gui_input", this, "_screen_input");
}
screen->raise();
screen->show_modal();
- r->queue_screen_capture();
}
void ColorPicker::_bind_methods() {
@@ -442,7 +478,7 @@ void ColorPicker::_bind_methods() {
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("add_preset", "color"), &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);
@@ -481,27 +517,26 @@ ColorPicker::ColorPicker()
add_child(hb_smpl);
HBoxContainer *hb_edit = memnew(HBoxContainer);
+ hb_edit->set_v_size_flags(SIZE_EXPAND_FILL);
uv_edit = memnew(Control);
uv_edit->connect("gui_input", this, "_uv_input");
uv_edit->set_mouse_filter(MOUSE_FILTER_PASS);
- uv_edit->set_custom_minimum_size(Size2(256, 256));
- Vector<Variant> args = Vector<Variant>();
- args.push_back(0);
- args.push_back(uv_edit);
- uv_edit->connect("draw", this, "_hsv_draw", args);
+ uv_edit->set_h_size_flags(SIZE_EXPAND_FILL);
+ uv_edit->set_v_size_flags(SIZE_EXPAND_FILL);
+ uv_edit->set_custom_minimum_size(Size2(get_constant("sv_width"), get_constant("sv_height")));
+ uv_edit->connect("draw", this, "_hsv_draw", make_binds(0, uv_edit));
add_child(hb_edit);
w_edit = memnew(Control);
//w_edit->set_ignore_mouse(false);
- w_edit->set_custom_minimum_size(Size2(30, 256));
+ w_edit->set_custom_minimum_size(Size2(get_constant("h_width"), 0));
+ w_edit->set_h_size_flags(SIZE_FILL);
+ w_edit->set_v_size_flags(SIZE_EXPAND_FILL);
w_edit->connect("gui_input", this, "_w_input");
- args.clear();
- args.push_back(1);
- args.push_back(w_edit);
- w_edit->connect("draw", this, "_hsv_draw", args);
+ w_edit->connect("draw", this, "_hsv_draw", make_binds(1, w_edit));
hb_edit->add_child(uv_edit);
hb_edit->add_child(memnew(VSeparator));
@@ -522,9 +557,12 @@ ColorPicker::ColorPicker()
HBoxContainer *hbc = memnew(HBoxContainer);
labels[i] = memnew(Label(lt[i]));
+ labels[i]->set_custom_minimum_size(Size2(get_constant("label_width"), 0));
+ labels[i]->set_v_size_flags(SIZE_SHRINK_CENTER);
hbc->add_child(labels[i]);
scroll[i] = memnew(HSlider);
+ scroll[i]->set_v_size_flags(SIZE_SHRINK_CENTER);
hbc->add_child(scroll[i]);
values[i] = memnew(SpinBox);
@@ -543,7 +581,7 @@ ColorPicker::ColorPicker()
HBoxContainer *hhb = memnew(HBoxContainer);
btn_mode = memnew(CheckButton);
- btn_mode->set_text("RAW Mode");
+ btn_mode->set_text(TTR("Raw Mode"));
btn_mode->connect("toggled", this, "set_raw_mode");
hhb->add_child(btn_mode);
vbr->add_child(hhb);
@@ -574,7 +612,7 @@ ColorPicker::ColorPicker()
bt_add_preset = memnew(Button);
bt_add_preset->set_icon(get_icon("add_preset"));
- bt_add_preset->set_tooltip("Add current color as a preset");
+ bt_add_preset->set_tooltip(TTR("Add current color as a preset"));
bt_add_preset->connect("pressed", this, "_add_preset_pressed");
bbc->add_child(bt_add_preset);
}
@@ -589,9 +627,7 @@ void ColorPickerButton::_color_changed(const Color &p_color) {
void ColorPickerButton::pressed() {
- Size2 ms = Size2(300, picker->get_combined_minimum_size().height + 10);
- popup->set_pos(get_global_pos() - Size2(0, ms.height));
- popup->set_size(ms);
+ popup->set_position(get_global_position() - picker->get_combined_minimum_size());
popup->popup();
picker->set_focus_on_line_edit();
}
@@ -603,6 +639,10 @@ void ColorPickerButton::_notification(int p_what) {
Ref<StyleBox> normal = get_stylebox("normal");
draw_rect(Rect2(normal->get_offset(), get_size() - normal->get_minimum_size()), picker->get_pick_color());
}
+
+ if (p_what == MainLoop::NOTIFICATION_WM_QUIT_REQUEST) {
+ popup->hide();
+ }
}
void ColorPickerButton::set_pick_color(const Color &p_color) {
@@ -634,7 +674,7 @@ void ColorPickerButton::_bind_methods() {
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("get_picker"), &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);
diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h
index bd1abeecbe..d35182e062 100644
--- a/scene/gui/color_picker.h
+++ b/scene/gui/color_picker.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -46,7 +47,6 @@ class ColorPicker : public BoxContainer {
private:
Control *screen;
- Image last_capture;
Control *uv_edit;
Control *w_edit;
TextureRect *sample;
@@ -79,12 +79,12 @@ private:
void _update_text_value();
void _text_type_toggled();
void _sample_draw();
- void _hsv_draw(int p_wich, Control *c);
+ void _hsv_draw(int p_which, Control *c);
- void _uv_input(const InputEvent &p_input);
- void _w_input(const InputEvent &p_input);
- void _preset_input(const InputEvent &p_input);
- void _screen_input(const InputEvent &p_input);
+ void _uv_input(const Ref<InputEvent> &p_event);
+ void _w_input(const Ref<InputEvent> &p_event);
+ void _preset_input(const Ref<InputEvent> &p_event);
+ void _screen_input(const Ref<InputEvent> &p_event);
void _add_preset_pressed();
void _screen_pick_pressed();
diff --git a/scene/gui/color_rect.cpp b/scene/gui/color_rect.cpp
index 7febecc0b9..0641302b1c 100644
--- a/scene/gui/color_rect.cpp
+++ b/scene/gui/color_rect.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/color_rect.h b/scene/gui/color_rect.h
index c6d0164ac9..65da3d9a7c 100644
--- a/scene/gui/color_rect.h
+++ b/scene/gui/color_rect.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp
index 811b41863c..4bbe15ed7e 100644
--- a/scene/gui/container.cpp
+++ b/scene/gui/container.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -94,19 +95,31 @@ void Container::fit_child_in_rect(Control *p_child, const Rect2 &p_rect) {
Rect2 r = p_rect;
if (!(p_child->get_h_size_flags() & SIZE_FILL)) {
- r.size.x = minsize.x;
- r.pos.x += Math::floor((p_rect.size.x - minsize.x) / 2);
+ r.size.x = minsize.width;
+ if (p_child->get_h_size_flags() & SIZE_SHRINK_END) {
+ r.position.x += p_rect.size.width - minsize.width;
+ } else if (p_child->get_h_size_flags() & SIZE_SHRINK_CENTER) {
+ r.position.x += Math::floor((p_rect.size.x - minsize.width) / 2);
+ } else {
+ r.position.x += 0;
+ }
}
if (!(p_child->get_v_size_flags() & SIZE_FILL)) {
r.size.y = minsize.y;
- r.pos.y += Math::floor((p_rect.size.y - minsize.y) / 2);
+ if (p_child->get_v_size_flags() & SIZE_SHRINK_END) {
+ r.position.y += p_rect.size.height - minsize.height;
+ } else if (p_child->get_v_size_flags() & SIZE_SHRINK_CENTER) {
+ r.position.y += Math::floor((p_rect.size.y - minsize.height) / 2);
+ } else {
+ r.position.y += 0;
+ }
}
for (int i = 0; i < 4; i++)
p_child->set_anchor(Margin(i), ANCHOR_BEGIN);
- p_child->set_pos(r.pos);
+ p_child->set_position(r.position);
p_child->set_size(r.size);
p_child->set_rotation(0);
p_child->set_scale(Vector2(1, 1));
@@ -155,7 +168,7 @@ void Container::_bind_methods() {
ClassDB::bind_method(D_METHOD("_child_minsize_changed"), &Container::_child_minsize_changed);
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);
+ ClassDB::bind_method(D_METHOD("fit_child_in_rect", "child", "rect"), &Container::fit_child_in_rect);
BIND_CONSTANT(NOTIFICATION_SORT_CHILDREN);
ADD_SIGNAL(MethodInfo("sort_children"));
diff --git a/scene/gui/container.h b/scene/gui/container.h
index 78f647f59d..bff24c6d55 100644
--- a/scene/gui/container.h
+++ b/scene/gui/container.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index d2f3eea721..c97426ad42 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "control.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "scene/main/canvas_layer.h"
#include "scene/main/viewport.h"
#include "servers/visual_server.h"
@@ -50,6 +51,12 @@ Variant Control::edit_get_state() const {
s["rect"] = get_rect();
s["rot"] = get_rotation();
s["scale"] = get_scale();
+ Array anchors;
+ anchors.push_back(get_anchor(MARGIN_LEFT));
+ anchors.push_back(get_anchor(MARGIN_TOP));
+ anchors.push_back(get_anchor(MARGIN_RIGHT));
+ anchors.push_back(get_anchor(MARGIN_BOTTOM));
+ s["anchors"] = anchors;
return s;
}
void Control::edit_set_state(const Variant &p_state) {
@@ -57,10 +64,15 @@ void Control::edit_set_state(const Variant &p_state) {
Dictionary s = p_state;
Rect2 state = s["rect"];
- set_pos(state.pos);
+ set_position(state.position);
set_size(state.size);
set_rotation(s["rot"]);
set_scale(s["scale"]);
+ Array anchors = s["anchors"];
+ set_anchor(MARGIN_LEFT, anchors[0]);
+ set_anchor(MARGIN_TOP, anchors[1]);
+ set_anchor(MARGIN_RIGHT, anchors[2]);
+ set_anchor(MARGIN_BOTTOM, anchors[3]);
}
void Control::set_custom_minimum_size(const Size2 &p_custom) {
@@ -89,19 +101,30 @@ Size2 Control::edit_get_minimum_size() const {
return get_combined_minimum_size();
}
+Transform2D Control::_get_internal_transform() const {
+
+ Transform2D rot_scale;
+ rot_scale.set_rotation_and_scale(data.rotation, data.scale);
+ Transform2D offset;
+ offset.set_origin(-data.pivot_offset);
+
+ return offset.affine_inverse() * (rot_scale * offset);
+}
void Control::edit_set_rect(const Rect2 &p_edit_rect) {
- Transform2D postxf;
- postxf.set_rotation_and_scale(data.rotation, data.scale);
- Vector2 new_pos = postxf.xform(p_edit_rect.pos);
+ Transform2D xform = _get_internal_transform();
+
+ // xform[2] += get_position();
- Vector2 pos = get_pos() + new_pos;
+ Vector2 new_pos = xform.basis_xform(p_edit_rect.position);
+
+ Vector2 pos = get_position() + new_pos;
Rect2 new_rect = get_rect();
- new_rect.pos = pos.snapped(Vector2(1, 1));
+ new_rect.position = pos.snapped(Vector2(1, 1));
new_rect.size = p_edit_rect.size.snapped(Vector2(1, 1));
- set_pos(new_rect.pos);
+ set_position(new_rect.position);
set_size(new_rect.size);
}
@@ -352,8 +375,9 @@ void Control::remove_child_notify(Node *p_child) {
void Control::_update_canvas_item_transform() {
- Transform2D xform = Transform2D(data.rotation, get_pos());
- xform.scale_basis(data.scale);
+ Transform2D xform = _get_internal_transform();
+ xform[2] += get_position();
+
VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), xform);
}
@@ -590,7 +614,7 @@ bool Control::has_point(const Point2 &p_point) const {
void Control::set_drag_forwarding(Control *p_target) {
if (p_target)
- data.drag_owner = p_target->get_instance_ID();
+ data.drag_owner = p_target->get_instance_id();
else
data.drag_owner = 0;
}
@@ -1183,6 +1207,7 @@ Size2 Control::get_parent_area_size() const {
parent_size = get_viewport()->get_visible_rect().size;
}
+
return parent_size;
}
@@ -1198,29 +1223,31 @@ void Control::_size_changed() {
for (int i = 0; i < 4; i++) {
float area = parent_size[i & 1];
- switch (data.anchor[i]) {
-
- case ANCHOR_BEGIN: {
+ margin_pos[i] = data.margin[i] + (data.anchor[i] * area);
+ }
- margin_pos[i] = data.margin[i];
- } break;
- case ANCHOR_END: {
+ Point2 new_pos_cache = Point2(margin_pos[0], margin_pos[1]);
+ Size2 new_size_cache = Point2(margin_pos[2], margin_pos[3]) - new_pos_cache;
- margin_pos[i] = area - data.margin[i];
- } break;
- case ANCHOR_CENTER: {
+ Size2 minimum_size = get_combined_minimum_size();
- margin_pos[i] = (area / 2) - data.margin[i];
- } break;
+ if (data.h_grow == GROW_DIRECTION_BEGIN) {
+ if (minimum_size.width > new_size_cache.width) {
+ new_pos_cache.x = new_pos_cache.x + new_size_cache.width - minimum_size.width;
+ new_size_cache.width = minimum_size.width;
}
+ } else {
+ new_size_cache.width = MAX(minimum_size.width, new_size_cache.width);
}
- Point2 new_pos_cache = Point2(margin_pos[0], margin_pos[1]).floor();
- Size2 new_size_cache = Point2(margin_pos[2], margin_pos[3]).floor() - new_pos_cache;
- Size2 minimum_size = get_combined_minimum_size();
-
- new_size_cache.x = MAX(minimum_size.x, new_size_cache.x);
- new_size_cache.y = MAX(minimum_size.y, new_size_cache.y);
+ if (data.v_grow == GROW_DIRECTION_BEGIN) {
+ if (minimum_size.height > new_size_cache.height) {
+ new_pos_cache.y = new_pos_cache.y + new_size_cache.height - minimum_size.height;
+ new_size_cache.height = minimum_size.height;
+ }
+ } else {
+ new_size_cache.height = MAX(minimum_size.height, new_size_cache.height);
+ }
bool pos_changed = new_pos_cache != data.pos_cache;
bool size_changed = new_size_cache != data.size_cache;
@@ -1269,59 +1296,38 @@ float Control::_get_range(int p_idx) const {
return to - from;
}
-float Control::_s2a(float p_val, AnchorType p_anchor, float p_range) const {
-
- switch (p_anchor) {
-
- case ANCHOR_BEGIN: {
- return p_val;
- } break;
- case ANCHOR_END: {
- return p_range - p_val;
- } break;
- case ANCHOR_CENTER: {
- return (p_range / 2) - p_val;
- } break;
- }
-
- return 0;
+float Control::_s2a(float p_val, float p_anchor, float p_range) const {
+ return p_val - (p_anchor * p_range);
}
-float Control::_a2s(float p_val, AnchorType p_anchor, float p_range) const {
-
- switch (p_anchor) {
-
- case ANCHOR_BEGIN: {
- return Math::floor(p_val);
- } break;
- case ANCHOR_END: {
- return Math::floor(p_range - p_val);
- } break;
- case ANCHOR_CENTER: {
- return Math::floor((p_range / 2) - p_val);
- } break;
- }
- return 0;
+float Control::_a2s(float p_val, float p_anchor, float p_range) const {
+ return Math::floor(p_val + (p_anchor * p_range));
}
-void Control::set_anchor(Margin p_margin, AnchorType p_anchor, bool p_keep_margin) {
+void Control::set_anchor(Margin p_margin, float p_anchor, bool p_keep_margin, bool p_push_opposite_anchor) {
+ bool pushed = false;
+ data.anchor[p_margin] = CLAMP(p_anchor, 0.0, 1.0);
- if (!is_inside_tree()) {
+ if (((p_margin == MARGIN_LEFT || p_margin == MARGIN_TOP) && data.anchor[p_margin] > data.anchor[(p_margin + 2) % 4]) ||
+ ((p_margin == MARGIN_RIGHT || p_margin == MARGIN_BOTTOM) && data.anchor[p_margin] < data.anchor[(p_margin + 2) % 4])) {
+ if (p_push_opposite_anchor) {
+ data.anchor[(p_margin + 2) % 4] = data.anchor[p_margin];
+ pushed = true;
+ } else {
+ data.anchor[p_margin] = data.anchor[(p_margin + 2) % 4];
+ }
+ }
- data.anchor[p_margin] = p_anchor;
- } else if (!p_keep_margin) {
- float pr = _get_parent_range(p_margin);
- float s = _a2s(data.margin[p_margin], data.anchor[p_margin], pr);
- data.anchor[p_margin] = p_anchor;
- data.margin[p_margin] = _s2a(s, p_anchor, pr);
- } else {
- data.anchor[p_margin] = p_anchor;
- _size_changed();
+ if (is_inside_tree()) {
+ if (p_keep_margin) {
+ _size_changed();
+ }
}
+ update();
_change_notify();
}
-void Control::_set_anchor(Margin p_margin, AnchorType p_anchor) {
+void Control::_set_anchor(Margin p_margin, float p_anchor) {
#ifdef TOOLS_ENABLED
if (is_inside_tree() && get_tree()->is_editor_hint()) {
set_anchor(p_margin, p_anchor, EDITOR_DEF("editors/2d/keep_margins_when_changing_anchors", false));
@@ -1333,13 +1339,127 @@ void Control::_set_anchor(Margin p_margin, AnchorType p_anchor) {
#endif
}
-void Control::set_anchor_and_margin(Margin p_margin, AnchorType p_anchor, float p_pos) {
+void Control::set_anchor_and_margin(Margin p_margin, float p_anchor, float p_pos, bool p_push_opposite_anchor) {
- set_anchor(p_margin, p_anchor);
+ set_anchor(p_margin, p_anchor, false, p_push_opposite_anchor);
set_margin(p_margin, p_pos);
}
-Control::AnchorType Control::get_anchor(Margin p_margin) const {
+void Control::set_anchors_preset(LayoutPreset p_preset, bool p_keep_margin) {
+ //Left
+ switch (p_preset) {
+ case PRESET_TOP_LEFT:
+ case PRESET_BOTTOM_LEFT:
+ case PRESET_CENTER_LEFT:
+ case PRESET_TOP_WIDE:
+ case PRESET_BOTTOM_WIDE:
+ case PRESET_LEFT_WIDE:
+ case PRESET_HCENTER_WIDE:
+ case PRESET_WIDE:
+ set_anchor(MARGIN_LEFT, ANCHOR_BEGIN, p_keep_margin);
+ break;
+
+ case PRESET_CENTER_TOP:
+ case PRESET_CENTER_BOTTOM:
+ case PRESET_CENTER:
+ case PRESET_VCENTER_WIDE:
+ set_anchor(MARGIN_LEFT, 0.5, p_keep_margin);
+ break;
+
+ case PRESET_TOP_RIGHT:
+ case PRESET_BOTTOM_RIGHT:
+ case PRESET_CENTER_RIGHT:
+ case PRESET_RIGHT_WIDE:
+ set_anchor(MARGIN_LEFT, ANCHOR_END, p_keep_margin);
+ break;
+ }
+
+ // Top
+ switch (p_preset) {
+ case PRESET_TOP_LEFT:
+ case PRESET_TOP_RIGHT:
+ case PRESET_CENTER_TOP:
+ case PRESET_LEFT_WIDE:
+ case PRESET_RIGHT_WIDE:
+ case PRESET_TOP_WIDE:
+ case PRESET_VCENTER_WIDE:
+ case PRESET_WIDE:
+ set_anchor(MARGIN_TOP, ANCHOR_BEGIN, p_keep_margin);
+ break;
+
+ case PRESET_CENTER_LEFT:
+ case PRESET_CENTER_RIGHT:
+ case PRESET_CENTER:
+ case PRESET_HCENTER_WIDE:
+ set_anchor(MARGIN_TOP, 0.5, p_keep_margin);
+ break;
+
+ case PRESET_BOTTOM_LEFT:
+ case PRESET_BOTTOM_RIGHT:
+ case PRESET_CENTER_BOTTOM:
+ case PRESET_BOTTOM_WIDE:
+ set_anchor(MARGIN_TOP, ANCHOR_END, p_keep_margin);
+ break;
+ }
+
+ // Right
+ switch (p_preset) {
+ case PRESET_TOP_LEFT:
+ case PRESET_BOTTOM_LEFT:
+ case PRESET_CENTER_LEFT:
+ case PRESET_LEFT_WIDE:
+ set_anchor(MARGIN_RIGHT, ANCHOR_BEGIN, p_keep_margin);
+ break;
+
+ case PRESET_CENTER_TOP:
+ case PRESET_CENTER_BOTTOM:
+ case PRESET_CENTER:
+ case PRESET_VCENTER_WIDE:
+ set_anchor(MARGIN_RIGHT, 0.5, p_keep_margin);
+ break;
+
+ case PRESET_TOP_RIGHT:
+ case PRESET_BOTTOM_RIGHT:
+ case PRESET_CENTER_RIGHT:
+ case PRESET_TOP_WIDE:
+ case PRESET_RIGHT_WIDE:
+ case PRESET_BOTTOM_WIDE:
+ case PRESET_HCENTER_WIDE:
+ case PRESET_WIDE:
+ set_anchor(MARGIN_RIGHT, ANCHOR_END, p_keep_margin);
+ break;
+ }
+
+ // Bottom
+ switch (p_preset) {
+ case PRESET_TOP_LEFT:
+ case PRESET_TOP_RIGHT:
+ case PRESET_CENTER_TOP:
+ case PRESET_TOP_WIDE:
+ set_anchor(MARGIN_BOTTOM, ANCHOR_BEGIN, p_keep_margin);
+ break;
+
+ case PRESET_CENTER_LEFT:
+ case PRESET_CENTER_RIGHT:
+ case PRESET_CENTER:
+ case PRESET_HCENTER_WIDE:
+ set_anchor(MARGIN_BOTTOM, 0.5, p_keep_margin);
+ break;
+
+ case PRESET_BOTTOM_LEFT:
+ case PRESET_BOTTOM_RIGHT:
+ case PRESET_CENTER_BOTTOM:
+ case PRESET_LEFT_WIDE:
+ case PRESET_RIGHT_WIDE:
+ case PRESET_BOTTOM_WIDE:
+ case PRESET_VCENTER_WIDE:
+ case PRESET_WIDE:
+ set_anchor(MARGIN_BOTTOM, ANCHOR_END, p_keep_margin);
+ break;
+ }
+}
+
+float Control::get_anchor(Margin p_margin) const {
return data.anchor[p_margin];
}
@@ -1347,12 +1467,12 @@ Control::AnchorType Control::get_anchor(Margin p_margin) const {
void Control::_change_notify_margins() {
// this avoids sending the whole object data again on a change
- _change_notify("margin/left");
- _change_notify("margin/top");
- _change_notify("margin/right");
- _change_notify("margin/bottom");
- _change_notify("rect/pos");
- _change_notify("rect/size");
+ _change_notify("margin_left");
+ _change_notify("margin_top");
+ _change_notify("margin_right");
+ _change_notify("margin_bottom");
+ _change_notify("rect_position");
+ _change_notify("rect_size");
}
void Control::set_margin(Margin p_margin, float p_value) {
@@ -1389,12 +1509,12 @@ Size2 Control::get_end() const {
return Size2(data.margin[2], data.margin[3]);
}
-Point2 Control::get_global_pos() const {
+Point2 Control::get_global_position() const {
return get_global_transform().get_origin();
}
-void Control::set_global_pos(const Point2 &p_point) {
+void Control::set_global_position(const Point2 &p_point) {
Transform2D inv;
@@ -1403,10 +1523,10 @@ void Control::set_global_pos(const Point2 &p_point) {
inv = data.parent_canvas_item->get_global_transform().affine_inverse();
}
- set_pos(inv.xform(p_point));
+ set_position(inv.xform(p_point));
}
-void Control::set_pos(const Size2 &p_point) {
+void Control::set_position(const Size2 &p_point) {
float pw = _get_parent_range(0);
float ph = _get_parent_range(1);
@@ -1458,7 +1578,7 @@ void Control::set_size(const Size2 &p_size) {
_size_changed();
}
-Size2 Control::get_pos() const {
+Size2 Control::get_position() const {
return data.pos_cache;
}
@@ -1470,19 +1590,19 @@ Size2 Control::get_size() const {
Rect2 Control::get_global_rect() const {
- return Rect2(get_global_pos(), get_size());
+ return Rect2(get_global_position(), get_size());
}
Rect2 Control::get_window_rect() const {
ERR_FAIL_COND_V(!is_inside_tree(), Rect2());
Rect2 gr = get_global_rect();
- gr.pos += get_viewport()->get_visible_rect().pos;
+ gr.position += get_viewport()->get_visible_rect().position;
return gr;
}
Rect2 Control::get_rect() const {
- return Rect2(get_pos(), get_size());
+ return Rect2(get_position(), get_size());
}
Rect2 Control::get_item_rect() const {
@@ -1493,11 +1613,13 @@ Rect2 Control::get_item_rect() const {
void Control::set_area_as_parent_rect(int p_margin) {
data.anchor[MARGIN_LEFT] = ANCHOR_BEGIN;
+ data.margin[MARGIN_LEFT] = p_margin;
data.anchor[MARGIN_TOP] = ANCHOR_BEGIN;
+ data.margin[MARGIN_TOP] = p_margin;
data.anchor[MARGIN_RIGHT] = ANCHOR_END;
+ data.margin[MARGIN_RIGHT] = -p_margin;
data.anchor[MARGIN_BOTTOM] = ANCHOR_END;
- for (int i = 0; i < 4; i++)
- data.margin[i] = p_margin;
+ data.margin[MARGIN_BOTTOM] = -p_margin;
_size_changed();
}
@@ -1885,8 +2007,8 @@ Control::CursorShape Control::get_cursor_shape(const Point2 &p_pos) const {
Transform2D Control::get_transform() const {
- Transform2D xform = Transform2D(data.rotation, get_pos());
- xform.scale_basis(data.scale);
+ Transform2D xform = _get_internal_transform();
+ xform[2] += get_position();
return xform;
}
@@ -1948,10 +2070,10 @@ Control *Control::_get_focus_neighbour(Margin p_margin, int p_count) {
Transform2D xform = get_global_transform();
Rect2 rect = get_item_rect();
- points[0] = xform.xform(rect.pos);
- points[1] = xform.xform(rect.pos + Point2(rect.size.x, 0));
- points[2] = xform.xform(rect.pos + rect.size);
- points[3] = xform.xform(rect.pos + Point2(0, rect.size.y));
+ points[0] = xform.xform(rect.position);
+ points[1] = xform.xform(rect.position + Point2(rect.size.x, 0));
+ points[2] = xform.xform(rect.position + rect.size);
+ points[3] = xform.xform(rect.position + Point2(0, rect.size.y));
const Vector2 dir[4] = {
Vector2(-1, 0),
@@ -2007,10 +2129,10 @@ void Control::_window_find_focus_neighbour(const Vector2 &p_dir, Node *p_at, con
Transform2D xform = c->get_global_transform();
Rect2 rect = c->get_item_rect();
- points[0] = xform.xform(rect.pos);
- points[1] = xform.xform(rect.pos + Point2(rect.size.x, 0));
- points[2] = xform.xform(rect.pos + rect.size);
- points[3] = xform.xform(rect.pos + Point2(0, rect.size.y));
+ points[0] = xform.xform(rect.position);
+ points[1] = xform.xform(rect.position + Point2(rect.size.x, 0));
+ points[2] = xform.xform(rect.position + rect.size);
+ points[3] = xform.xform(rect.position + Point2(0, rect.size.y));
float min = 1e7;
@@ -2158,7 +2280,7 @@ void Control::set_rotation(float p_radians) {
data.rotation = p_radians;
update();
_notify_transform();
- _change_notify("rect/rotation");
+ _change_notify("rect_rotation");
}
float Control::get_rotation() const {
@@ -2212,6 +2334,19 @@ void Control::_font_changed() {
minimum_size_changed(); //fonts affect minimum size pretty much almost always
}
+void Control::set_pivot_offset(const Vector2 &p_pivot) {
+
+ data.pivot_offset = p_pivot;
+ update();
+ _notify_transform();
+ _change_notify("rect_pivot_offset");
+}
+
+Vector2 Control::get_pivot_offset() const {
+
+ return data.pivot_offset;
+}
+
void Control::set_scale(const Vector2 &p_scale) {
data.scale = p_scale;
@@ -2298,6 +2433,27 @@ bool Control::is_clipping_contents() {
return data.clip_contents;
}
+void Control::set_h_grow_direction(GrowDirection p_direction) {
+
+ data.h_grow = p_direction;
+ _size_changed();
+}
+
+Control::GrowDirection Control::get_h_grow_direction() const {
+
+ return data.h_grow;
+}
+
+void Control::set_v_grow_direction(GrowDirection p_direction) {
+
+ data.v_grow = p_direction;
+ _size_changed();
+}
+Control::GrowDirection Control::get_v_grow_direction() const {
+
+ return data.v_grow;
+}
+
void Control::_bind_methods() {
//ClassDB::bind_method(D_METHOD("_window_resize_event"),&Control::_window_resize_event);
@@ -2307,35 +2463,38 @@ void Control::_bind_methods() {
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("set_anchor", "margin", "anchor", "keep_margin", "push_opposite_anchor"), &Control::set_anchor, DEFVAL(false), DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("_set_anchor", "margin", "anchor"), &Control::_set_anchor);
+ ClassDB::bind_method(D_METHOD("set_anchors_preset", "preset", "keep_margin"), &Control::set_anchors_preset, DEFVAL(false));
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_anchor_and_margin", "margin", "anchor", "offset", "push_opposite_anchor"), &Control::set_anchor_and_margin, DEFVAL(false));
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_position", "pos"), &Control::set_position);
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_global_position", "pos"), &Control::set_global_position);
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(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("set_pivot_offset", "pivot_offset"), &Control::set_pivot_offset);
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_position"), &Control::get_position);
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(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_pivot_offset"), &Control::get_pivot_offset);
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_global_position"), &Control::get_global_position);
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));
@@ -2345,7 +2504,7 @@ void Control::_bind_methods() {
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(D_METHOD("get_focus_owner"), &Control::get_focus_owner);
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);
@@ -2356,19 +2515,19 @@ void Control::_bind_methods() {
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(D_METHOD("set_theme", "theme:Theme"), &Control::set_theme);
- ClassDB::bind_method(D_METHOD("get_theme:Theme"), &Control::get_theme);
+ ClassDB::bind_method(D_METHOD("set_theme", "theme"), &Control::set_theme);
+ ClassDB::bind_method(D_METHOD("get_theme"), &Control::get_theme);
- 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_icon_override", "name", "texture"), &Control::add_icon_override);
+ ClassDB::bind_method(D_METHOD("add_shader_override", "name", "shader"), &Control::add_shader_override);
+ ClassDB::bind_method(D_METHOD("add_style_override", "name", "stylebox"), &Control::add_style_override);
+ ClassDB::bind_method(D_METHOD("add_font_override", "name", "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(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_icon", "name", "type"), &Control::get_icon, DEFVAL(""));
+ ClassDB::bind_method(D_METHOD("get_stylebox", "name", "type"), &Control::get_stylebox, DEFVAL(""));
+ ClassDB::bind_method(D_METHOD("get_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(""));
@@ -2384,7 +2543,13 @@ void Control::_bind_methods() {
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(D_METHOD("get_parent_control:Control"), &Control::get_parent_control);
+ ClassDB::bind_method(D_METHOD("get_parent_control"), &Control::get_parent_control);
+
+ ClassDB::bind_method(D_METHOD("set_h_grow_direction", "direction"), &Control::set_h_grow_direction);
+ ClassDB::bind_method(D_METHOD("get_h_grow_direction"), &Control::get_h_grow_direction);
+
+ ClassDB::bind_method(D_METHOD("set_v_grow_direction", "direction"), &Control::set_v_grow_direction);
+ ClassDB::bind_method(D_METHOD("get_v_grow_direction"), &Control::get_v_grow_direction);
ClassDB::bind_method(D_METHOD("set_tooltip", "tooltip"), &Control::set_tooltip);
ClassDB::bind_method(D_METHOD("get_tooltip", "atpos"), &Control::get_tooltip, DEFVAL(Point2()));
@@ -2407,8 +2572,8 @@ void Control::_bind_methods() {
ClassDB::bind_method(D_METHOD("grab_click_focus"), &Control::grab_click_focus);
- 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(D_METHOD("set_drag_forwarding", "target"), &Control::set_drag_forwarding);
+ ClassDB::bind_method(D_METHOD("set_drag_preview", "control"), &Control::set_drag_preview);
ClassDB::bind_method(D_METHOD("warp_mouse", "to_pos"), &Control::warp_mouse);
@@ -2418,17 +2583,17 @@ void Control::_bind_methods() {
ClassDB::bind_method(D_METHOD("_font_changed"), &Control::_font_changed);
- BIND_VMETHOD(MethodInfo("_gui_input", PropertyInfo(Variant::INPUT_EVENT, "event")));
+ BIND_VMETHOD(MethodInfo("_gui_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
BIND_VMETHOD(MethodInfo(Variant::VECTOR2, "_get_minimum_size"));
BIND_VMETHOD(MethodInfo(Variant::OBJECT, "get_drag_data", PropertyInfo(Variant::VECTOR2, "pos")));
BIND_VMETHOD(MethodInfo(Variant::BOOL, "can_drop_data", PropertyInfo(Variant::VECTOR2, "pos"), PropertyInfo(Variant::NIL, "data")));
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"), "_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_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_left", PROPERTY_HINT_RANGE, "0,1,0.01"), "_set_anchor", "get_anchor", MARGIN_LEFT);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_top", PROPERTY_HINT_RANGE, "0,1,0.01"), "_set_anchor", "get_anchor", MARGIN_TOP);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_right", PROPERTY_HINT_RANGE, "0,1,0.01"), "_set_anchor", "get_anchor", MARGIN_RIGHT);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_bottom", PROPERTY_HINT_RANGE, "0,1,0.01"), "_set_anchor", "get_anchor", MARGIN_BOTTOM);
ADD_GROUP("Margin", "margin_");
ADD_PROPERTYINZ(PropertyInfo(Variant::INT, "margin_left", PROPERTY_HINT_RANGE, "-4096,4096"), "set_margin", "get_margin", MARGIN_LEFT);
@@ -2436,12 +2601,17 @@ void Control::_bind_methods() {
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("Grow Direction", "grow_");
+ ADD_PROPERTYNO(PropertyInfo(Variant::INT, "grow_horizontal", PROPERTY_HINT_ENUM, "Begin,End"), "set_h_grow_direction", "get_h_grow_direction");
+ ADD_PROPERTYNO(PropertyInfo(Variant::INT, "grow_vertical", PROPERTY_HINT_ENUM, "Begin,End"), "set_v_grow_direction", "get_v_grow_direction");
+
ADD_GROUP("Rect", "rect_");
- ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2, "rect_pos", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_pos", "get_pos");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2, "rect_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_position", "get_position");
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::VECTOR2, "rect_pivot_offset"), "set_pivot_offset", "get_pivot_offset");
ADD_PROPERTYNO(PropertyInfo(Variant::BOOL, "rect_clip_content"), "set_clip_contents", "is_clipping_contents");
ADD_GROUP("Hint", "hint_");
@@ -2457,16 +2627,13 @@ void Control::_bind_methods() {
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"), "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_PROPERTY(PropertyInfo(Variant::INT, "size_flags_horizontal", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_h_size_flags", "get_h_size_flags");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "size_flags_vertical", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_v_size_flags", "get_v_size_flags");
+ ADD_PROPERTYNO(PropertyInfo(Variant::REAL, "size_flags_stretch_ratio", PROPERTY_HINT_RANGE, "0,128,0.01"), "set_stretch_ratio", "get_stretch_ratio");
ADD_GROUP("Theme", "");
ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), "set_theme", "get_theme");
ADD_GROUP("", "");
- BIND_CONSTANT(ANCHOR_BEGIN);
- BIND_CONSTANT(ANCHOR_END);
- BIND_CONSTANT(ANCHOR_CENTER);
BIND_CONSTANT(FOCUS_NONE);
BIND_CONSTANT(FOCUS_CLICK);
BIND_CONSTANT(FOCUS_ALL);
@@ -2497,16 +2664,41 @@ void Control::_bind_methods() {
BIND_CONSTANT(CURSOR_HSPLIT);
BIND_CONSTANT(CURSOR_HELP);
+ BIND_CONSTANT(PRESET_TOP_LEFT);
+ BIND_CONSTANT(PRESET_TOP_RIGHT);
+ BIND_CONSTANT(PRESET_BOTTOM_LEFT);
+ BIND_CONSTANT(PRESET_BOTTOM_RIGHT);
+ BIND_CONSTANT(PRESET_CENTER_LEFT);
+ BIND_CONSTANT(PRESET_CENTER_TOP);
+ BIND_CONSTANT(PRESET_CENTER_RIGHT);
+ BIND_CONSTANT(PRESET_CENTER_BOTTOM);
+ BIND_CONSTANT(PRESET_CENTER);
+ BIND_CONSTANT(PRESET_LEFT_WIDE);
+ BIND_CONSTANT(PRESET_TOP_WIDE);
+ BIND_CONSTANT(PRESET_RIGHT_WIDE);
+ BIND_CONSTANT(PRESET_BOTTOM_WIDE);
+ BIND_CONSTANT(PRESET_VCENTER_WIDE);
+ BIND_CONSTANT(PRESET_HCENTER_WIDE);
+ BIND_CONSTANT(PRESET_WIDE);
+
BIND_CONSTANT(SIZE_EXPAND);
BIND_CONSTANT(SIZE_FILL);
BIND_CONSTANT(SIZE_EXPAND_FILL);
+ BIND_CONSTANT(SIZE_SHRINK_CENTER);
+ BIND_CONSTANT(SIZE_SHRINK_END);
BIND_CONSTANT(MOUSE_FILTER_STOP);
BIND_CONSTANT(MOUSE_FILTER_PASS);
BIND_CONSTANT(MOUSE_FILTER_IGNORE);
+ BIND_CONSTANT(GROW_DIRECTION_BEGIN);
+ BIND_CONSTANT(GROW_DIRECTION_END);
+
+ BIND_CONSTANT(ANCHOR_BEGIN);
+ BIND_CONSTANT(ANCHOR_END);
+
ADD_SIGNAL(MethodInfo("resized"));
- ADD_SIGNAL(MethodInfo("gui_input", PropertyInfo(Variant::INPUT_EVENT, "ev")));
+ ADD_SIGNAL(MethodInfo("gui_input", PropertyInfo(Variant::OBJECT, "ev", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
ADD_SIGNAL(MethodInfo("mouse_entered"));
ADD_SIGNAL(MethodInfo("mouse_exited"));
ADD_SIGNAL(MethodInfo("focus_entered"));
@@ -2515,7 +2707,7 @@ void Control::_bind_methods() {
ADD_SIGNAL(MethodInfo("minimum_size_changed"));
ADD_SIGNAL(MethodInfo("modal_closed"));
- BIND_VMETHOD(MethodInfo("has_point", PropertyInfo(Variant::VECTOR2, "point")));
+ BIND_VMETHOD(MethodInfo("has_point:bool", PropertyInfo(Variant::VECTOR2, "point")));
}
Control::Control() {
@@ -2541,6 +2733,8 @@ Control::Control() {
data.modal_frame = 0;
data.block_minimum_size_adjust = false;
data.disable_visibility_clip = false;
+ data.h_grow = GROW_DIRECTION_END;
+ data.v_grow = GROW_DIRECTION_END;
data.clip_contents = false;
for (int i = 0; i < 4; i++) {
diff --git a/scene/gui/control.h b/scene/gui/control.h
index a18567123b..d73ca3f7c9 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -50,10 +51,15 @@ class Control : public CanvasItem {
OBJ_CATEGORY("GUI Nodes");
public:
- enum AnchorType {
- ANCHOR_BEGIN,
- ANCHOR_END,
- ANCHOR_CENTER,
+ enum Anchor {
+
+ ANCHOR_BEGIN = 0,
+ ANCHOR_END = 1
+ };
+
+ enum GrowDirection {
+ GROW_DIRECTION_BEGIN,
+ GROW_DIRECTION_END
};
enum FocusMode {
@@ -66,7 +72,9 @@ public:
SIZE_FILL = 1,
SIZE_EXPAND = 2,
- SIZE_EXPAND_FILL = SIZE_EXPAND | SIZE_FILL
+ SIZE_EXPAND_FILL = SIZE_EXPAND | SIZE_FILL,
+ SIZE_SHRINK_CENTER = 4, //ignored by expand or fill
+ SIZE_SHRINK_END = 8, //ignored by expand or fil
};
@@ -97,6 +105,25 @@ public:
CURSOR_MAX
};
+ enum LayoutPreset {
+ PRESET_TOP_LEFT,
+ PRESET_TOP_RIGHT,
+ PRESET_BOTTOM_LEFT,
+ PRESET_BOTTOM_RIGHT,
+ PRESET_CENTER_LEFT,
+ PRESET_CENTER_TOP,
+ PRESET_CENTER_RIGHT,
+ PRESET_CENTER_BOTTOM,
+ PRESET_CENTER,
+ PRESET_LEFT_WIDE,
+ PRESET_TOP_WIDE,
+ PRESET_RIGHT_WIDE,
+ PRESET_BOTTOM_WIDE,
+ PRESET_VCENTER_WIDE,
+ PRESET_HCENTER_WIDE,
+ PRESET_WIDE
+ };
+
private:
struct CComparator {
@@ -114,11 +141,14 @@ private:
Size2 size_cache;
float margin[4];
- AnchorType anchor[4];
+ float anchor[4];
FocusMode focus_mode;
+ GrowDirection h_grow;
+ GrowDirection v_grow;
float rotation;
Vector2 scale;
+ Vector2 pivot_offset;
bool pending_resize;
@@ -171,12 +201,12 @@ private:
void _window_find_focus_neighbour(const Vector2 &p_dir, Node *p_at, const Point2 *p_points, float p_min, float &r_closest_dist, Control **r_closest);
Control *_get_focus_neighbour(Margin p_margin, int p_count = 0);
- void _set_anchor(Margin p_margin, AnchorType p_anchor);
+ void _set_anchor(Margin p_margin, float p_anchor);
float _get_parent_range(int p_idx) const;
float _get_range(int p_idx) const;
- float _s2a(float p_val, AnchorType p_anchor, float p_range) const;
- float _a2s(float p_val, AnchorType p_anchor, float p_range) const;
+ float _s2a(float p_val, float p_anchor, float p_range) const;
+ float _a2s(float p_val, float p_anchor, float p_range) const;
void _propagate_theme_changed(CanvasItem *p_at, Control *p_owner, bool p_assign = true);
void _theme_changed();
@@ -199,6 +229,8 @@ private:
void _update_canvas_item_transform();
+ Transform2D _get_internal_transform() const;
+
friend class Viewport;
void _modal_stack_remove();
void _modal_set_prev_focus_owner(ObjectID p_prev);
@@ -262,26 +294,33 @@ public:
/* POSITIONING */
- void set_anchor(Margin p_margin, AnchorType p_anchor, bool p_keep_margin = false);
- void set_anchor_and_margin(Margin p_margin, AnchorType p_anchor, float p_pos);
+ void set_anchor(Margin p_margin, float p_anchor, bool p_keep_margin = false, bool p_push_opposite_anchor = true);
+ void set_anchor_and_margin(Margin p_margin, float p_anchor, float p_pos, bool p_push_opposite_anchor = true);
+ void set_anchors_preset(LayoutPreset p_preset, bool p_keep_margin = false);
- AnchorType get_anchor(Margin p_margin) const;
+ float get_anchor(Margin p_margin) const;
void set_margin(Margin p_margin, float p_value);
void set_begin(const Point2 &p_point); // helper
void set_end(const Point2 &p_point); // helper
+ void set_h_grow_direction(GrowDirection p_direction);
+ GrowDirection get_h_grow_direction() const;
+
+ void set_v_grow_direction(GrowDirection p_direction);
+ GrowDirection get_v_grow_direction() const;
+
float get_margin(Margin p_margin) const;
Point2 get_begin() const;
Point2 get_end() const;
- void set_pos(const Point2 &p_point);
+ void set_position(const Point2 &p_point);
void set_size(const Size2 &p_size);
- void set_global_pos(const Point2 &p_point);
+ void set_global_position(const Point2 &p_point);
- Point2 get_pos() const;
- Point2 get_global_pos() const;
+ Point2 get_position() const;
+ Point2 get_global_position() const;
Size2 get_size() const;
Rect2 get_rect() const;
Rect2 get_global_rect() const;
@@ -292,6 +331,9 @@ public:
float get_rotation() const;
float get_rotation_deg() const;
+ void set_pivot_offset(const Vector2 &p_pivot);
+ Vector2 get_pivot_offset() const;
+
void set_scale(const Vector2 &p_scale);
Vector2 get_scale() const;
@@ -403,10 +445,12 @@ public:
~Control();
};
-VARIANT_ENUM_CAST(Control::AnchorType);
VARIANT_ENUM_CAST(Control::FocusMode);
VARIANT_ENUM_CAST(Control::SizeFlags);
VARIANT_ENUM_CAST(Control::CursorShape);
+VARIANT_ENUM_CAST(Control::LayoutPreset);
VARIANT_ENUM_CAST(Control::MouseFilter);
+VARIANT_ENUM_CAST(Control::GrowDirection);
+VARIANT_ENUM_CAST(Control::Anchor);
#endif
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 35d54d9843..8232a7a466 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,6 +36,8 @@
#include "editor/editor_node.h"
#endif
+// WindowDialog
+
void WindowDialog::_post_popup() {
drag_type = DRAG_NONE; // just in case
@@ -45,22 +48,35 @@ void WindowDialog::_fix_size() {
// Perhaps this should be called when the viewport resizes as well or windows go out of bounds...
// Ensure the whole window is visible.
- Point2i pos = get_global_pos();
+ Point2i pos = get_global_position();
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);
+ float top = 0;
+ float left = 0;
+ float bottom = 0;
+ float right = 0;
+ // Check validity, because the theme could contain a different type of StyleBox
+ if (panel->get_class() == "StyleBoxTexture") {
+ Ref<StyleBoxTexture> panel_texture = panel->cast_to<StyleBoxTexture>();
+ top = panel_texture->get_expand_margin_size(MARGIN_TOP);
+ left = panel_texture->get_expand_margin_size(MARGIN_LEFT);
+ bottom = panel_texture->get_expand_margin_size(MARGIN_BOTTOM);
+ right = panel_texture->get_expand_margin_size(MARGIN_RIGHT);
+ } else if (panel->get_class() == "StyleBoxFlat") {
+ Ref<StyleBoxFlat> panel_flat = panel->cast_to<StyleBoxFlat>();
+ top = panel_flat->get_expand_margin_size(MARGIN_TOP);
+ left = panel_flat->get_expand_margin_size(MARGIN_LEFT);
+ bottom = panel_flat->get_expand_margin_size(MARGIN_BOTTOM);
+ right = panel_flat->get_expand_margin_size(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);
+ set_global_position(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);
@@ -73,45 +89,49 @@ bool WindowDialog::has_point(const Point2 &p_point) const {
Rect2 r(Point2(), get_size());
// Enlarge upwards for title bar.
- int titlebar_height = get_constant("titlebar_height", "WindowDialog");
- r.pos.y -= titlebar_height;
- r.size.y += titlebar_height;
+ int title_height = get_constant("title_height", "WindowDialog");
+ r.position.y -= title_height;
+ r.size.y += title_height;
// Inflate by the resizable border thickness.
if (resizable) {
int scaleborder_size = get_constant("scaleborder_size", "WindowDialog");
- r.pos.x -= scaleborder_size;
+ r.position.x -= scaleborder_size;
r.size.width += scaleborder_size * 2;
- r.pos.y -= scaleborder_size;
+ r.position.y -= scaleborder_size;
r.size.height += scaleborder_size * 2;
}
return r.has_point(p_point);
}
-void WindowDialog::_gui_input(const InputEvent &p_event) {
+void WindowDialog::_gui_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == BUTTON_LEFT) {
+ Ref<InputEventMouseButton> mb = p_event;
- if (p_event.mouse_button.pressed) {
+ if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT) {
+
+ if (mb->is_pressed()) {
// Begin a possible dragging operation.
- drag_type = _drag_hit_test(Point2(p_event.mouse_button.x, p_event.mouse_button.y));
+ drag_type = _drag_hit_test(Point2(mb->get_position().x, mb->get_position().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) {
+ drag_offset = get_global_mouse_position() - get_position();
+ drag_offset_far = get_position() + get_size() - get_global_mouse_position();
+ } else if (drag_type != DRAG_NONE && !mb->is_pressed()) {
// End a dragging operation.
drag_type = DRAG_NONE;
}
}
- if (p_event.type == InputEvent::MOUSE_MOTION) {
+ Ref<InputEventMouseMotion> mm = p_event;
+
+ if (mm.is_valid()) {
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));
+ int preview_drag_type = _drag_hit_test(Point2(mm->get_position().x, mm->get_position().y));
switch (preview_drag_type) {
case DRAG_RESIZE_TOP:
case DRAG_RESIZE_BOTTOM:
@@ -135,35 +155,35 @@ void WindowDialog::_gui_input(const InputEvent &p_event) {
set_default_cursor_shape(cursor);
} else {
// Update while in a dragging operation.
- Point2 global_pos = get_global_mouse_pos();
+ Point2 global_pos = get_global_mouse_position();
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;
+ rect.position = global_pos - drag_offset;
} else {
if (drag_type & DRAG_RESIZE_TOP) {
- int bottom = rect.pos.y + rect.size.height;
+ int bottom = rect.position.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;
+ rect.position.y = MIN(global_pos.y - drag_offset.y, max_y);
+ rect.size.height = bottom - rect.position.y;
} else if (drag_type & DRAG_RESIZE_BOTTOM) {
- rect.size.height = global_pos.y - rect.pos.y + drag_offset_far.y;
+ rect.size.height = global_pos.y - rect.position.y + drag_offset_far.y;
}
if (drag_type & DRAG_RESIZE_LEFT) {
- int right = rect.pos.x + rect.size.width;
+ int right = rect.position.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;
+ rect.position.x = MIN(global_pos.x - drag_offset.x, max_x);
+ rect.size.width = right - rect.position.x;
} else if (drag_type & DRAG_RESIZE_RIGHT) {
- rect.size.width = global_pos.x - rect.pos.x + drag_offset_far.x;
+ rect.size.width = global_pos.x - rect.position.x + drag_offset_far.x;
}
}
set_size(rect.size);
- set_pos(rect.pos);
+ set_position(rect.position);
}
}
}
@@ -172,28 +192,30 @@ void WindowDialog::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_DRAW: {
-
RID canvas = get_canvas_item();
- Size2 size = get_size();
+ // Draw the background.
Ref<StyleBox> panel = get_stylebox("panel", "WindowDialog");
- panel->draw(canvas, Rect2(Point2(), size));
+ Size2 size = get_size();
+ panel->draw(canvas, Rect2(0, 0, size.x, size.y));
- int title_height = get_constant("title_height", "WindowDialog");
+ // Draw the title bar text.
+ Ref<Font> title_font = get_font("title_font", "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);
-
+ int title_height = get_constant("title_height", "WindowDialog");
+ int font_height = title_font->get_height() - title_font->get_descent() * 2;
+ int x = (size.x - title_font->get_string_size(title).x) / 2;
+ int y = (-title_height + font_height) / 2;
+ title_font->draw(canvas, Point2(x, y), title, title_color, size.x - panel->get_minimum_size().x);
} 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_hover_texture(get_icon("close_highlight", "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")));
+ close_button->set_begin(Point2(-get_constant("close_h_ofs", "WindowDialog"), -get_constant("close_v_ofs", "WindowDialog")));
} break;
case NOTIFICATION_MOUSE_EXIT: {
@@ -226,12 +248,12 @@ 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 title_height = get_constant("title_height", "WindowDialog");
int scaleborder_size = get_constant("scaleborder_size", "WindowDialog");
Rect2 rect = get_rect();
- if (pos.y < (-titlebar_height + scaleborder_size))
+ if (pos.y < (-title_height + scaleborder_size))
drag_type = DRAG_RESIZE_TOP;
else if (pos.y >= (rect.size.height - scaleborder_size))
drag_type = DRAG_RESIZE_BOTTOM;
@@ -286,7 +308,7 @@ void WindowDialog::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("get_close_button"), &WindowDialog::get_close_button);
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");
@@ -305,6 +327,8 @@ WindowDialog::WindowDialog() {
WindowDialog::~WindowDialog() {
}
+// PopupDialog
+
void PopupDialog::_notification(int p_what) {
if (p_what == NOTIFICATION_DRAW) {
@@ -333,6 +357,9 @@ void AcceptDialog::_notification(int p_what) {
if (p_what == NOTIFICATION_MODAL_CLOSE) {
cancel_pressed();
+ } else if (p_what == NOTIFICATION_READY) {
+
+ _update_child_rects();
} else if (p_what == NOTIFICATION_RESIZED) {
_update_child_rects();
@@ -404,14 +431,14 @@ void AcceptDialog::_update_child_rects() {
if (c == hbc || c == label || c == get_close_button() || c->is_set_as_toplevel())
continue;
- c->set_pos(cpos);
+ c->set_position(cpos);
c->set_size(csize);
}
cpos.y += csize.y + margin;
csize.y = hminsize.y;
- hbc->set_pos(cpos);
+ hbc->set_position(cpos);
hbc->set_size(csize);
}
@@ -488,10 +515,10 @@ void AcceptDialog::_bind_methods() {
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("add_button", "text", "right", "action"), &AcceptDialog::add_button, DEFVAL(false), DEFVAL(""));
+ ClassDB::bind_method(D_METHOD("add_cancel", "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("register_text_enter", "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);
@@ -519,7 +546,7 @@ AcceptDialog::AcceptDialog() {
label->set_anchor(MARGIN_RIGHT, ANCHOR_END);
label->set_anchor(MARGIN_BOTTOM, ANCHOR_END);
label->set_begin(Point2(margin, margin));
- label->set_end(Point2(margin, button_margin + 10));
+ label->set_end(Point2(-margin, -button_margin - 10));
//label->set_autowrap(true);
add_child(label);
@@ -542,9 +569,11 @@ AcceptDialog::AcceptDialog() {
AcceptDialog::~AcceptDialog() {
}
+// ConfirmationDialog
+
void ConfirmationDialog::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_cancel:Button"), &ConfirmationDialog::get_cancel);
+ ClassDB::bind_method(D_METHOD("get_cancel"), &ConfirmationDialog::get_cancel);
}
Button *ConfirmationDialog::get_cancel() {
@@ -555,5 +584,8 @@ Button *ConfirmationDialog::get_cancel() {
ConfirmationDialog::ConfirmationDialog() {
set_title(RTR("Please Confirm..."));
+#ifdef TOOLS_ENABLED
+ set_custom_minimum_size(Size2(200, 70) * EDSCALE);
+#endif
cancel = add_cancel();
}
diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h
index a729a8f907..9d8f113caa 100644
--- a/scene/gui/dialogs.h
+++ b/scene/gui/dialogs.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -59,7 +60,7 @@ class WindowDialog : public Popup {
Point2 drag_offset_far;
bool resizable;
- void _gui_input(const InputEvent &p_event);
+ void _gui_input(const Ref<InputEvent> &p_event);
void _closed();
int _drag_hit_test(const Point2 &pos) const;
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index d4643b399d..74255b38bf 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -60,21 +61,20 @@ void FileDialog::_notification(int p_what) {
}
}
-void FileDialog::_unhandled_input(const InputEvent &p_event) {
+void FileDialog::_unhandled_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::KEY && is_window_modal_on_top()) {
+ Ref<InputEventKey> k = p_event;
+ if (k.is_valid() && is_window_modal_on_top()) {
- const InputEventKey &k = p_event.key;
-
- if (k.pressed) {
+ if (k->is_pressed()) {
bool handled = true;
- switch (k.scancode) {
+ switch (k->get_scancode()) {
case KEY_H: {
- if (k.mod.command) {
+ if (k->get_command()) {
set_show_hidden_files(!show_hidden_files);
} else {
handled = false;
@@ -335,8 +335,8 @@ void FileDialog::update_file_list() {
dirs.push_back("..");
}
- dirs.sort_custom<NoCaseComparator>();
- files.sort_custom<NoCaseComparator>();
+ dirs.sort_custom<NaturalNoCaseComparator>();
+ files.sort_custom<NaturalNoCaseComparator>();
while (!dirs.empty()) {
String &dir_name = dirs.front()->get();
@@ -701,7 +701,7 @@ void FileDialog::_bind_methods() {
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("get_vbox"), &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);
@@ -850,9 +850,9 @@ void LineEditFileChooser::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("get_button"), &LineEditFileChooser::get_button);
+ ClassDB::bind_method(D_METHOD("get_line_edit"), &LineEditFileChooser::get_line_edit);
+ ClassDB::bind_method(D_METHOD("get_file_dialog"), &LineEditFileChooser::get_file_dialog);
}
void LineEditFileChooser::_chosen(const String &p_text) {
diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h
index 397b0feba2..9873a677b2 100644
--- a/scene/gui/file_dialog.h
+++ b/scene/gui/file_dialog.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -114,7 +115,7 @@ private:
void _update_drives();
- void _unhandled_input(const InputEvent &p_event);
+ void _unhandled_input(const Ref<InputEvent> &p_event);
virtual void _post_popup();
diff --git a/scene/gui/color_ramp_edit.cpp b/scene/gui/gradient_edit.cpp
index 131638bb70..22de28ea7f 100644
--- a/scene/gui/color_ramp_edit.cpp
+++ b/scene/gui/gradient_edit.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,10 +27,10 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "color_ramp_edit.h"
+#include "gradient_edit.h"
#include "os/keyboard.h"
-ColorRampEdit::ColorRampEdit() {
+GradientEdit::GradientEdit() {
grabbed = -1;
grabbing = false;
set_focus_mode(FOCUS_ALL);
@@ -41,10 +42,11 @@ ColorRampEdit::ColorRampEdit() {
add_child(popup);
checker = Ref<ImageTexture>(memnew(ImageTexture));
- checker->create_from_image(Image(checker_bg_png), ImageTexture::FLAG_REPEAT);
+ Ref<Image> img = memnew(Image(checker_bg_png));
+ checker->create_from_image(img, ImageTexture::FLAG_REPEAT);
}
-int ColorRampEdit::_get_point_from_pos(int x) {
+int GradientEdit::_get_point_from_pos(int x) {
int result = -1;
int total_w = get_size().width - get_size().height - 3;
for (int i = 0; i < points.size(); i++) {
@@ -56,22 +58,22 @@ int ColorRampEdit::_get_point_from_pos(int x) {
return result;
}
-void ColorRampEdit::_show_color_picker() {
+void GradientEdit::_show_color_picker() {
if (grabbed == -1)
return;
- Size2 ms = Size2(350, picker->get_combined_minimum_size().height + 10);
picker->set_pick_color(points[grabbed].color);
- popup->set_pos(get_global_pos() - Vector2(ms.width - get_size().width, ms.height));
- popup->set_size(ms);
+ popup->set_position(get_global_position() - popup->get_combined_minimum_size());
popup->popup();
}
-ColorRampEdit::~ColorRampEdit() {
+GradientEdit::~GradientEdit() {
}
-void ColorRampEdit::_gui_input(const InputEvent &p_event) {
+void GradientEdit::_gui_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::KEY && p_event.key.pressed && p_event.key.scancode == KEY_DELETE && grabbed != -1) {
+ Ref<InputEventKey> k = p_event;
+
+ if (k.is_valid() && k->is_pressed() && k->get_scancode() == KEY_DELETE && grabbed != -1) {
points.remove(grabbed);
grabbed = -1;
@@ -81,16 +83,17 @@ void ColorRampEdit::_gui_input(const InputEvent &p_event) {
accept_event();
}
+ Ref<InputEventMouseButton> mb = p_event;
//Show color picker on double click.
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == 1 && p_event.mouse_button.doubleclick && p_event.mouse_button.pressed) {
- grabbed = _get_point_from_pos(p_event.mouse_button.x);
+ if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_doubleclick() && mb->is_pressed()) {
+ grabbed = _get_point_from_pos(mb->get_position().x);
_show_color_picker();
accept_event();
}
//Delete point on right click
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == 2 && p_event.mouse_button.pressed) {
- grabbed = _get_point_from_pos(p_event.mouse_button.x);
+ if (mb.is_valid() && mb->get_button_index() == 2 && mb->is_pressed()) {
+ grabbed = _get_point_from_pos(mb->get_position().x);
if (grabbed != -1) {
points.remove(grabbed);
grabbed = -1;
@@ -102,14 +105,14 @@ void ColorRampEdit::_gui_input(const InputEvent &p_event) {
}
//Hold alt key to duplicate selected color
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == 1 && p_event.mouse_button.pressed && p_event.key.mod.alt) {
+ if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed() && mb->get_alt()) {
- int x = p_event.mouse_button.x;
+ int x = mb->get_position().x;
grabbed = _get_point_from_pos(x);
if (grabbed != -1) {
int total_w = get_size().width - get_size().height - 3;
- ColorRamp::Point newPoint = points[grabbed];
+ Gradient::Point newPoint = points[grabbed];
newPoint.offset = CLAMP(x / float(total_w), 0, 1);
points.push_back(newPoint);
@@ -126,10 +129,10 @@ void ColorRampEdit::_gui_input(const InputEvent &p_event) {
}
}
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == 1 && p_event.mouse_button.pressed) {
+ if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) {
update();
- int x = p_event.mouse_button.x;
+ int x = mb->get_position().x;
int total_w = get_size().width - get_size().height - 3;
//Check if color selector was clicked.
@@ -147,11 +150,11 @@ void ColorRampEdit::_gui_input(const InputEvent &p_event) {
}
//insert
- ColorRamp::Point newPoint;
+ Gradient::Point newPoint;
newPoint.offset = CLAMP(x / float(total_w), 0, 1);
- ColorRamp::Point prev;
- ColorRamp::Point next;
+ Gradient::Point prev;
+ Gradient::Point next;
int pos = -1;
for (int i = 0; i < points.size(); i++) {
@@ -194,7 +197,7 @@ void ColorRampEdit::_gui_input(const InputEvent &p_event) {
emit_signal("ramp_changed");
}
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == 1 && !p_event.mouse_button.pressed) {
+ if (mb.is_valid() && mb->get_button_index() == 1 && !mb->is_pressed()) {
if (grabbing) {
grabbing = false;
@@ -203,15 +206,18 @@ void ColorRampEdit::_gui_input(const InputEvent &p_event) {
update();
}
- if (p_event.type == InputEvent::MOUSE_MOTION && grabbing) {
+ Ref<InputEventMouseMotion> mm = p_event;
+
+ if (mm.is_valid() && grabbing) {
int total_w = get_size().width - get_size().height - 3;
- int x = p_event.mouse_motion.x;
+ int x = mm->get_position().x;
+
float newofs = CLAMP(x / float(total_w), 0, 1);
//Snap to nearest point if holding shift
- if (p_event.key.mod.shift) {
+ if (mm->get_shift()) {
float snap_treshhold = 0.03;
float smallest_ofs = snap_treshhold;
bool founded = false;
@@ -264,7 +270,7 @@ void ColorRampEdit::_gui_input(const InputEvent &p_event) {
}
}
-void ColorRampEdit::_notification(int p_what) {
+void GradientEdit::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
if (!picker->is_connected("color_changed", this, "_color_changed")) {
@@ -285,7 +291,7 @@ void ColorRampEdit::_notification(int p_what) {
_draw_checker(0, 0, total_w, h);
//Draw color ramp
- ColorRamp::Point prev;
+ Gradient::Point prev;
prev.offset = 0;
if (points.size() == 0)
prev.color = Color(0, 0, 0); //Draw black rectangle if we have no points
@@ -294,7 +300,7 @@ void ColorRampEdit::_notification(int p_what) {
for (int i = -1; i < points.size(); i++) {
- ColorRamp::Point next;
+ Gradient::Point next;
//If there is no next point
if (i + 1 == points.size()) {
if (points.size() == 0)
@@ -362,7 +368,7 @@ void ColorRampEdit::_notification(int p_what) {
}
}
-void ColorRampEdit::_draw_checker(int x, int y, int w, int h) {
+void GradientEdit::_draw_checker(int x, int y, int w, int h) {
//Draw it with polygon to insert UVs for scale
Vector<Vector2> backPoints;
backPoints.push_back(Vector2(x, y));
@@ -383,12 +389,12 @@ void ColorRampEdit::_draw_checker(int x, int y, int w, int h) {
draw_polygon(backPoints, colorPoints, uvPoints, checker);
}
-Size2 ColorRampEdit::get_minimum_size() const {
+Size2 GradientEdit::get_minimum_size() const {
return Vector2(0, 16);
}
-void ColorRampEdit::_color_changed(const Color &p_color) {
+void GradientEdit::_color_changed(const Color &p_color) {
if (grabbed == -1)
return;
@@ -397,12 +403,12 @@ void ColorRampEdit::_color_changed(const Color &p_color) {
emit_signal("ramp_changed");
}
-void ColorRampEdit::set_ramp(const Vector<float> &p_offsets, const Vector<Color> &p_colors) {
+void GradientEdit::set_ramp(const Vector<float> &p_offsets, const Vector<Color> &p_colors) {
ERR_FAIL_COND(p_offsets.size() != p_colors.size());
points.clear();
for (int i = 0; i < p_offsets.size(); i++) {
- ColorRamp::Point p;
+ Gradient::Point p;
p.offset = p_offsets[i];
p.color = p_colors[i];
points.push_back(p);
@@ -412,33 +418,33 @@ void ColorRampEdit::set_ramp(const Vector<float> &p_offsets, const Vector<Color>
update();
}
-Vector<float> ColorRampEdit::get_offsets() const {
+Vector<float> GradientEdit::get_offsets() const {
Vector<float> ret;
for (int i = 0; i < points.size(); i++)
ret.push_back(points[i].offset);
return ret;
}
-Vector<Color> ColorRampEdit::get_colors() const {
+Vector<Color> GradientEdit::get_colors() const {
Vector<Color> ret;
for (int i = 0; i < points.size(); i++)
ret.push_back(points[i].color);
return ret;
}
-void ColorRampEdit::set_points(Vector<ColorRamp::Point> &p_points) {
+void GradientEdit::set_points(Vector<Gradient::Point> &p_points) {
if (points.size() != p_points.size())
grabbed = -1;
points.clear();
points = p_points;
}
-Vector<ColorRamp::Point> &ColorRampEdit::get_points() {
+Vector<Gradient::Point> &GradientEdit::get_points() {
return points;
}
-void ColorRampEdit::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_gui_input"), &ColorRampEdit::_gui_input);
- ClassDB::bind_method(D_METHOD("_color_changed"), &ColorRampEdit::_color_changed);
+void GradientEdit::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("_gui_input"), &GradientEdit::_gui_input);
+ ClassDB::bind_method(D_METHOD("_color_changed"), &GradientEdit::_color_changed);
ADD_SIGNAL(MethodInfo("ramp_changed"));
}
diff --git a/scene/gui/color_ramp_edit.h b/scene/gui/gradient_edit.h
index bb12064ddf..6c4ae6fd15 100644
--- a/scene/gui/color_ramp_edit.h
+++ b/scene/gui/gradient_edit.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,9 +37,9 @@
#define POINT_WIDTH 8
-class ColorRampEdit : public Control {
+class GradientEdit : public Control {
- GDCLASS(ColorRampEdit, Control);
+ GDCLASS(GradientEdit, Control);
PopupPanel *popup;
ColorPicker *picker;
@@ -47,7 +48,7 @@ class ColorRampEdit : public Control {
bool grabbing;
int grabbed;
- Vector<ColorRamp::Point> points;
+ Vector<Gradient::Point> points;
void _draw_checker(int x, int y, int w, int h);
void _color_changed(const Color &p_color);
@@ -55,7 +56,7 @@ class ColorRampEdit : public Control {
void _show_color_picker();
protected:
- void _gui_input(const InputEvent &p_event);
+ void _gui_input(const Ref<InputEvent> &p_event);
void _notification(int p_what);
static void _bind_methods();
@@ -63,12 +64,12 @@ public:
void set_ramp(const Vector<float> &p_offsets, const Vector<Color> &p_colors);
Vector<float> get_offsets() const;
Vector<Color> get_colors() const;
- void set_points(Vector<ColorRamp::Point> &p_points);
- Vector<ColorRamp::Point> &get_points();
+ void set_points(Vector<Gradient::Point> &p_points);
+ Vector<Gradient::Point> &get_points();
virtual Size2 get_minimum_size() const;
- ColorRampEdit();
- virtual ~ColorRampEdit();
+ GradientEdit();
+ virtual ~GradientEdit();
};
/*class ColorRampEditPanel : public Panel
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index 6a3b5e713c..ec1932ed5a 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -139,13 +140,13 @@ void GraphEdit::_update_scroll_offset() {
Point2 pos = gn->get_offset() * zoom;
pos -= Point2(h_scroll->get_value(), v_scroll->get_value());
- gn->set_pos(pos);
+ gn->set_position(pos);
if (gn->get_scale() != Vector2(zoom, zoom)) {
gn->set_scale(Vector2(zoom, zoom));
}
}
- connections_layer->set_pos(-Point2(h_scroll->get_value(), v_scroll->get_value()));
+ connections_layer->set_position(-Point2(h_scroll->get_value(), v_scroll->get_value()));
set_block_minimum_size_adjust(false);
awaiting_scroll_offset_update = false;
}
@@ -167,24 +168,24 @@ void GraphEdit::_update_scroll() {
continue;
Rect2 r;
- r.pos = gn->get_offset() * zoom;
+ r.position = gn->get_offset() * zoom;
r.size = gn->get_size() * zoom;
screen = screen.merge(r);
}
- screen.pos -= get_size();
+ screen.position -= get_size();
screen.size += get_size() * 2.0;
- h_scroll->set_min(screen.pos.x);
- h_scroll->set_max(screen.pos.x + screen.size.x);
+ h_scroll->set_min(screen.position.x);
+ h_scroll->set_max(screen.position.x + screen.size.x);
h_scroll->set_page(get_size().x);
if (h_scroll->get_max() - h_scroll->get_min() <= h_scroll->get_page())
h_scroll->hide();
else
h_scroll->show();
- v_scroll->set_min(screen.pos.y);
- v_scroll->set_max(screen.pos.y + screen.size.y);
+ v_scroll->set_min(screen.position.y);
+ v_scroll->set_max(screen.position.y + screen.size.y);
v_scroll->set_page(get_size().y);
if (v_scroll->get_max() - v_scroll->get_min() <= v_scroll->get_page())
@@ -206,9 +207,10 @@ void GraphEdit::_graph_node_raised(Node *p_gn) {
GraphNode *gn = p_gn->cast_to<GraphNode>();
ERR_FAIL_COND(!gn);
- gn->raise();
if (gn->is_comment()) {
move_child(gn, 0);
+ } else {
+ gn->raise();
}
int first_not_comment = 0;
for (int i = 0; i < get_child_count(); i++) {
@@ -267,14 +269,14 @@ void GraphEdit::_notification(int p_what) {
Size2 hmin = h_scroll->get_combined_minimum_size();
Size2 vmin = v_scroll->get_combined_minimum_size();
- v_scroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, vmin.width);
+ v_scroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -vmin.width);
v_scroll->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0);
v_scroll->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 0);
v_scroll->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0);
h_scroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 0);
h_scroll->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0);
- h_scroll->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, hmin.height);
+ h_scroll->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, -hmin.height);
h_scroll->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0);
zoom_minus->set_icon(get_icon("minus"));
@@ -349,14 +351,14 @@ bool GraphEdit::_filter_input(const Point2 &p_point) {
for (int j = 0; j < gn->get_connection_output_count(); j++) {
- Vector2 pos = gn->get_connection_output_pos(j) + gn->get_pos();
+ Vector2 pos = gn->get_connection_output_pos(j) + gn->get_position();
if (pos.distance_to(p_point) < grab_r)
return true;
}
for (int j = 0; j < gn->get_connection_input_count(); j++) {
- Vector2 pos = gn->get_connection_input_pos(j) + gn->get_pos();
+ Vector2 pos = gn->get_connection_input_pos(j) + gn->get_position();
if (pos.distance_to(p_point) < grab_r) {
return true;
}
@@ -366,13 +368,14 @@ bool GraphEdit::_filter_input(const Point2 &p_point) {
return false;
}
-void GraphEdit::_top_layer_input(const InputEvent &p_ev) {
+void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) {
float grab_r_extend = 2.0;
- if (p_ev.type == InputEvent::MOUSE_BUTTON && p_ev.mouse_button.button_index == BUTTON_LEFT && p_ev.mouse_button.pressed) {
+ Ref<InputEventMouseButton> mb = p_ev;
+ if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
Ref<Texture> port = get_icon("port", "GraphNode");
- Vector2 mpos(p_ev.mouse_button.x, p_ev.mouse_button.y);
+ Vector2 mpos(mb->get_position().x, mb->get_position().y);
float grab_r = port->get_width() * 0.5 * grab_r_extend;
for (int i = get_child_count() - 1; i >= 0; i--) {
@@ -382,7 +385,7 @@ void GraphEdit::_top_layer_input(const InputEvent &p_ev) {
for (int j = 0; j < gn->get_connection_output_count(); j++) {
- Vector2 pos = gn->get_connection_output_pos(j) + gn->get_pos();
+ Vector2 pos = gn->get_connection_output_pos(j) + gn->get_position();
if (pos.distance_to(mpos) < grab_r) {
if (valid_left_disconnect_types.has(gn->get_connection_output_type(j))) {
@@ -429,7 +432,7 @@ void GraphEdit::_top_layer_input(const InputEvent &p_ev) {
for (int j = 0; j < gn->get_connection_input_count(); j++) {
- Vector2 pos = gn->get_connection_input_pos(j) + gn->get_pos();
+ Vector2 pos = gn->get_connection_input_pos(j) + gn->get_position();
if (pos.distance_to(mpos) < grab_r) {
@@ -478,14 +481,15 @@ void GraphEdit::_top_layer_input(const InputEvent &p_ev) {
}
}
- if (p_ev.type == InputEvent::MOUSE_MOTION && connecting) {
+ Ref<InputEventMouseMotion> mm = p_ev;
+ if (mm.is_valid() && connecting) {
- connecting_to = Vector2(p_ev.mouse_motion.x, p_ev.mouse_motion.y);
+ connecting_to = mm->get_position();
connecting_target = false;
top_layer->update();
Ref<Texture> port = get_icon("port", "GraphNode");
- Vector2 mpos(p_ev.mouse_button.x, p_ev.mouse_button.y);
+ Vector2 mpos = mm->get_position();
float grab_r = port->get_width() * 0.5 * grab_r_extend;
for (int i = get_child_count() - 1; i >= 0; i--) {
@@ -496,7 +500,7 @@ void GraphEdit::_top_layer_input(const InputEvent &p_ev) {
if (!connecting_out) {
for (int j = 0; j < gn->get_connection_output_count(); j++) {
- Vector2 pos = gn->get_connection_output_pos(j) + gn->get_pos();
+ Vector2 pos = gn->get_connection_output_pos(j) + gn->get_position();
int type = gn->get_connection_output_type(j);
if ((type == connecting_type || valid_connection_types.has(ConnType(type, connecting_type))) && pos.distance_to(mpos) < grab_r) {
@@ -511,7 +515,7 @@ void GraphEdit::_top_layer_input(const InputEvent &p_ev) {
for (int j = 0; j < gn->get_connection_input_count(); j++) {
- Vector2 pos = gn->get_connection_input_pos(j) + gn->get_pos();
+ Vector2 pos = gn->get_connection_input_pos(j) + gn->get_position();
int type = gn->get_connection_input_type(j);
if ((type == connecting_type || valid_connection_types.has(ConnType(type, connecting_type))) && pos.distance_to(mpos) < grab_r) {
connecting_target = true;
@@ -525,7 +529,7 @@ void GraphEdit::_top_layer_input(const InputEvent &p_ev) {
}
}
- if (p_ev.type == InputEvent::MOUSE_BUTTON && p_ev.mouse_button.button_index == BUTTON_LEFT && !p_ev.mouse_button.pressed) {
+ if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && !mb->is_pressed()) {
if (connecting && connecting_target) {
@@ -543,7 +547,7 @@ void GraphEdit::_top_layer_input(const InputEvent &p_ev) {
} else if (!just_disconected) {
String from = connecting_from;
int from_slot = connecting_index;
- Vector2 ofs = Vector2(p_ev.mouse_button.x, p_ev.mouse_button.y);
+ Vector2 ofs = Vector2(mb->get_position().x, mb->get_position().y);
emit_signal("connection_to_empty", from, from_slot, ofs);
}
connecting = false;
@@ -565,7 +569,7 @@ static _FORCE_INLINE_ Vector2 _bezier_interp(real_t t, Vector2 start, Vector2 co
return start * omt3 + control_1 * omt2 * t * 3.0 + control_2 * omt * t2 * 3.0 + end * t3;
}
-void GraphEdit::_bake_segment2d(CanvasItem *p_where, float p_begin, float p_end, const Vector2 &p_a, const Vector2 &p_out, const Vector2 &p_b, const Vector2 &p_in, int p_depth, int p_min_depth, int p_max_depth, float p_tol, const Color &p_color, const Color &p_to_color, int &lines) const {
+void GraphEdit::_bake_segment2d(Vector<Vector2> &points, Vector<Color> &colors, float p_begin, float p_end, const Vector2 &p_a, const Vector2 &p_out, const Vector2 &p_b, const Vector2 &p_in, int p_depth, int p_min_depth, int p_max_depth, float p_tol, const Color &p_color, const Color &p_to_color, int &lines) const {
float mp = p_begin + (p_end - p_begin) * 0.5;
Vector2 beg = _bezier_interp(p_begin, p_a, p_a + p_out, p_b + p_in, p_b);
@@ -578,11 +582,12 @@ void GraphEdit::_bake_segment2d(CanvasItem *p_where, float p_begin, float p_end,
if (p_depth >= p_min_depth && (dp < p_tol || p_depth >= p_max_depth)) {
- p_where->draw_line(beg, end, p_color.linear_interpolate(p_to_color, mp), 2, true);
+ points.push_back((beg + end) * 0.5);
+ colors.push_back(p_color.linear_interpolate(p_to_color, mp));
lines++;
} else {
- _bake_segment2d(p_where, p_begin, mp, p_a, p_out, p_b, p_in, p_depth + 1, p_min_depth, p_max_depth, p_tol, p_color, p_to_color, lines);
- _bake_segment2d(p_where, mp, p_end, p_a, p_out, p_b, p_in, p_depth + 1, p_min_depth, p_max_depth, p_tol, p_color, p_to_color, lines);
+ _bake_segment2d(points, colors, p_begin, mp, p_a, p_out, p_b, p_in, p_depth + 1, p_min_depth, p_max_depth, p_tol, p_color, p_to_color, lines);
+ _bake_segment2d(points, colors, mp, p_end, p_a, p_out, p_b, p_in, p_depth + 1, p_min_depth, p_max_depth, p_tol, p_color, p_to_color, lines);
}
}
@@ -597,7 +602,7 @@ void GraphEdit::_draw_cos_line(CanvasItem *p_where, const Vector2 &p_from, const
int cp_neg_len = get_constant("bezier_len_neg");
if (diff > 0) {
- cp_offset = MAX(cp_len, diff * 0.5);
+ cp_offset = MIN(cp_len, diff * 0.5);
} else {
cp_offset = MAX(MIN(cp_len - diff, cp_neg_len), -diff * 0.5);
}
@@ -606,7 +611,16 @@ void GraphEdit::_draw_cos_line(CanvasItem *p_where, const Vector2 &p_from, const
Vector2 c2 = Vector2(-cp_offset * zoom, 0);
int lines = 0;
- _bake_segment2d(p_where, 0, 1, p_from, c1, p_to, c2, 0, 3, 9, 8, p_color, p_to_color, lines);
+
+ Vector<Point2> points;
+ Vector<Color> colors;
+ points.push_back(p_from);
+ colors.push_back(p_color);
+ _bake_segment2d(points, colors, 0, 1, p_from, c1, p_to, c2, 0, 3, 9, 8, p_color, p_to_color, lines);
+ points.push_back(p_to);
+ colors.push_back(p_to_color);
+
+ p_where->draw_polyline_colors(points, colors, 2, true);
#else
@@ -703,7 +717,7 @@ void GraphEdit::_top_layer_draw() {
pos = from->get_connection_output_pos(connecting_index);
else
pos = from->get_connection_input_pos(connecting_index);
- pos += from->get_pos();
+ pos += from->get_position();
Vector2 topos;
topos = connecting_to;
@@ -738,18 +752,19 @@ void GraphEdit::set_selected(Node *p_child) {
}
}
-void GraphEdit::_gui_input(const InputEvent &p_ev) {
+void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
- if (p_ev.type == InputEvent::MOUSE_MOTION && (p_ev.mouse_motion.button_mask & BUTTON_MASK_MIDDLE || (p_ev.mouse_motion.button_mask & BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE)))) {
- h_scroll->set_value(h_scroll->get_value() - p_ev.mouse_motion.relative_x);
- v_scroll->set_value(v_scroll->get_value() - p_ev.mouse_motion.relative_y);
+ Ref<InputEventMouseMotion> mm = p_ev;
+ if (mm.is_valid() && (mm->get_button_mask() & BUTTON_MASK_MIDDLE || (mm->get_button_mask() & BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE)))) {
+ h_scroll->set_value(h_scroll->get_value() - mm->get_relative().x);
+ v_scroll->set_value(v_scroll->get_value() - mm->get_relative().y);
}
- if (p_ev.type == InputEvent::MOUSE_MOTION && dragging) {
+ if (mm.is_valid() && dragging) {
just_selected = true;
// TODO: Remove local mouse pos hack if/when InputEventMouseMotion is fixed to support floats
- //drag_accum+=Vector2(p_ev.mouse_motion.relative_x,p_ev.mouse_motion.relative_y);
+ //drag_accum+=Vector2(mm->get_relative().x,mm->get_relative().y);
drag_accum = get_local_mouse_pos() - drag_origin;
for (int i = get_child_count() - 1; i >= 0; i--) {
GraphNode *gn = get_child(i)->cast_to<GraphNode>();
@@ -766,7 +781,7 @@ void GraphEdit::_gui_input(const InputEvent &p_ev) {
}
}
- if (p_ev.type == InputEvent::MOUSE_MOTION && box_selecting) {
+ if (mm.is_valid() && box_selecting) {
box_selecting_to = get_local_mouse_pos();
box_selecting_rect = Rect2(MIN(box_selecting_from.x, box_selecting_to.x),
@@ -793,11 +808,10 @@ void GraphEdit::_gui_input(const InputEvent &p_ev) {
top_layer->update();
}
- if (p_ev.type == InputEvent::MOUSE_BUTTON) {
+ Ref<InputEventMouseButton> b = p_ev;
+ if (b.is_valid()) {
- const InputEventMouseButton &b = p_ev.mouse_button;
-
- if (b.button_index == BUTTON_RIGHT && b.pressed) {
+ if (b->get_button_index() == BUTTON_RIGHT && b->is_pressed()) {
if (box_selecting) {
box_selecting = false;
for (int i = get_child_count() - 1; i >= 0; i--) {
@@ -814,12 +828,12 @@ void GraphEdit::_gui_input(const InputEvent &p_ev) {
connecting = false;
top_layer->update();
} else {
- emit_signal("popup_request", Vector2(b.global_x, b.global_y));
+ emit_signal("popup_request", b->get_global_position());
}
}
}
- if (b.button_index == BUTTON_LEFT && !b.pressed && dragging) {
+ if (b->get_button_index() == BUTTON_LEFT && !b->is_pressed() && dragging) {
if (!just_selected && drag_accum == Vector2() && Input::get_singleton()->is_key_pressed(KEY_CONTROL)) {
//deselect current node
for (int i = get_child_count() - 1; i >= 0; i--) {
@@ -854,30 +868,28 @@ void GraphEdit::_gui_input(const InputEvent &p_ev) {
connections_layer->update();
}
- if (b.button_index == BUTTON_LEFT && b.pressed) {
+ if (b->get_button_index() == BUTTON_LEFT && b->is_pressed()) {
GraphNode *gn = NULL;
- GraphNode *gn_selected = NULL;
+
for (int i = get_child_count() - 1; i >= 0; i--) {
- gn_selected = get_child(i)->cast_to<GraphNode>();
+ GraphNode *gn_selected = get_child(i)->cast_to<GraphNode>();
if (gn_selected) {
-
if (gn_selected->is_resizing())
continue;
- Rect2 r = gn_selected->get_rect();
- r.size *= zoom;
- if (r.has_point(get_local_mouse_pos()))
+ if (gn_selected->has_point(gn_selected->get_local_mouse_pos())) {
gn = gn_selected;
- break;
+ break;
+ }
}
}
if (gn) {
- if (_filter_input(Vector2(b.x, b.y)))
+ if (_filter_input(b->get_position()))
return;
dragging = true;
@@ -902,14 +914,14 @@ void GraphEdit::_gui_input(const InputEvent &p_ev) {
}
} else {
- if (_filter_input(Vector2(b.x, b.y)))
+ if (_filter_input(b->get_position()))
return;
if (Input::get_singleton()->is_key_pressed(KEY_SPACE))
return;
box_selecting = true;
box_selecting_from = get_local_mouse_pos();
- if (b.mod.control) {
+ if (b->get_control()) {
box_selection_mode_aditive = true;
previus_selected.clear();
for (int i = get_child_count() - 1; i >= 0; i--) {
@@ -920,7 +932,7 @@ void GraphEdit::_gui_input(const InputEvent &p_ev) {
previus_selected.push_back(gn);
}
- } else if (b.mod.shift) {
+ } else if (b->get_shift()) {
box_selection_mode_aditive = false;
previus_selected.clear();
for (int i = get_child_count() - 1; i >= 0; i--) {
@@ -946,29 +958,42 @@ void GraphEdit::_gui_input(const InputEvent &p_ev) {
}
}
- if (b.button_index == BUTTON_LEFT && !b.pressed && box_selecting) {
+ if (b->get_button_index() == BUTTON_LEFT && !b->is_pressed() && box_selecting) {
box_selecting = false;
previus_selected.clear();
top_layer->update();
}
- if (b.button_index == BUTTON_WHEEL_UP && b.pressed) {
+ if (b->get_button_index() == BUTTON_WHEEL_UP && b->is_pressed()) {
//too difficult to get right
//set_zoom(zoom*ZOOM_SCALE);
}
- if (b.button_index == BUTTON_WHEEL_DOWN && b.pressed) {
+ if (b->get_button_index() == BUTTON_WHEEL_DOWN && b->is_pressed()) {
//too difficult to get right
//set_zoom(zoom/ZOOM_SCALE);
}
+ if (b->get_button_index() == BUTTON_WHEEL_UP) {
+ h_scroll->set_value(h_scroll->get_value() - h_scroll->get_page() * b->get_factor() / 8);
+ }
+ if (b->get_button_index() == BUTTON_WHEEL_DOWN) {
+ h_scroll->set_value(h_scroll->get_value() + h_scroll->get_page() * b->get_factor() / 8);
+ }
+ if (b->get_button_index() == BUTTON_WHEEL_RIGHT) {
+ v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * b->get_factor() / 8);
+ }
+ if (b->get_button_index() == BUTTON_WHEEL_LEFT) {
+ v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() * b->get_factor() / 8);
+ }
}
- if (p_ev.type == InputEvent::KEY && p_ev.key.scancode == KEY_D && p_ev.key.pressed && p_ev.key.mod.command) {
+ Ref<InputEventKey> k = p_ev;
+ if (k.is_valid() && k->get_scancode() == KEY_D && k->is_pressed() && k->get_command()) {
emit_signal("duplicate_nodes_request");
accept_event();
}
- if (p_ev.type == InputEvent::KEY && p_ev.key.scancode == KEY_DELETE && p_ev.key.pressed) {
+ if (k.is_valid() && k->get_scancode() == KEY_DELETE && k->is_pressed()) {
emit_signal("delete_nodes_request");
accept_event();
}
@@ -1132,7 +1157,7 @@ void GraphEdit::_snap_value_changed(double) {
void GraphEdit::_bind_methods() {
- ClassDB::bind_method(D_METHOD("connect_node:Error", "from", "from_port", "to", "to_port"), &GraphEdit::connect_node);
+ ClassDB::bind_method(D_METHOD("connect_node", "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);
@@ -1199,6 +1224,7 @@ GraphEdit::GraphEdit() {
connections_layer->connect("draw", this, "_connections_layer_draw");
connections_layer->set_name("CLAYER");
connections_layer->set_disable_visibility_clip(true); // so it can draw freely and be offseted
+ connections_layer->set_mouse_filter(MOUSE_FILTER_IGNORE);
h_scroll = memnew(HScrollBar);
h_scroll->set_name("_h_scroll");
@@ -1228,7 +1254,7 @@ GraphEdit::GraphEdit() {
HBoxContainer *zoom_hb = memnew(HBoxContainer);
top_layer->add_child(zoom_hb);
- zoom_hb->set_pos(Vector2(10, 10));
+ zoom_hb->set_position(Vector2(10, 10));
zoom_minus = memnew(ToolButton);
zoom_hb->add_child(zoom_minus);
diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h
index 5166f82310..e908829d5f 100644
--- a/scene/gui/graph_edit.h
+++ b/scene/gui/graph_edit.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -109,7 +110,7 @@ private:
bool awaiting_scroll_offset_update;
List<Connection> connections;
- void _bake_segment2d(CanvasItem *p_where, float p_begin, float p_end, const Vector2 &p_a, const Vector2 &p_out, const Vector2 &p_b, const Vector2 &p_in, int p_depth, int p_min_depth, int p_max_depth, float p_tol, const Color &p_color, const Color &p_to_color, int &lines) const;
+ void _bake_segment2d(Vector<Vector2> &points, Vector<Color> &colors, float p_begin, float p_end, const Vector2 &p_a, const Vector2 &p_out, const Vector2 &p_b, const Vector2 &p_in, int p_depth, int p_min_depth, int p_max_depth, float p_tol, const Color &p_color, const Color &p_to_color, int &lines) const;
void _draw_cos_line(CanvasItem *p_where, const Vector2 &p_from, const Vector2 &p_to, const Color &p_color, const Color &p_to_color);
@@ -118,11 +119,11 @@ private:
void _update_scroll();
void _scroll_moved(double);
- void _gui_input(const InputEvent &p_ev);
+ void _gui_input(const Ref<InputEvent> &p_ev);
Control *connections_layer;
GraphEditFilter *top_layer;
- void _top_layer_input(const InputEvent &p_ev);
+ void _top_layer_input(const Ref<InputEvent> &p_ev);
void _top_layer_draw();
void _connections_layer_draw();
void _update_scroll_offset();
diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp
index afbb0bbad7..b9062295b5 100644
--- a/scene/gui/graph_node.cpp
+++ b/scene/gui/graph_node.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "graph_node.h"
-#include "method_bind_ext.inc"
+#include "method_bind_ext.gen.inc"
bool GraphNode::_set(const StringName &p_name, const Variant &p_value) {
@@ -175,6 +176,7 @@ bool GraphNode::has_point(const Point2 &p_point) const {
if (Rect2(get_size() - resizer->get_size(), resizer->get_size()).has_point(p_point)) {
return true;
}
+
if (Rect2(0, 0, get_size().width, comment->get_margin(MARGIN_TOP)).has_point(p_point)) {
return true;
}
@@ -238,7 +240,7 @@ void GraphNode::_notification(int p_what) {
if (show_close) {
Vector2 cpos = Point2(w + sb->get_margin(MARGIN_LEFT), -close->get_height() + close_offset);
draw_texture(close, cpos);
- close_rect.pos = cpos;
+ close_rect.position = cpos;
close_rect.size = close->get_size();
} else {
close_rect = Rect2();
@@ -573,18 +575,17 @@ Color GraphNode::get_connection_output_color(int p_idx) {
return conn_output_cache[p_idx].color;
}
-void GraphNode::_gui_input(const InputEvent &p_ev) {
+void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) {
- if (p_ev.type == InputEvent::MOUSE_BUTTON) {
+ Ref<InputEventMouseButton> mb = p_ev;
+ if (mb.is_valid()) {
ERR_EXPLAIN("GraphNode must be the child of a GraphEdit node.");
ERR_FAIL_COND(get_parent_control() == NULL);
- print_line("INPUT EVENT BUTTON");
-
- if (p_ev.mouse_button.pressed && p_ev.mouse_button.button_index == BUTTON_LEFT) {
+ if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
- Vector2 mpos = Vector2(p_ev.mouse_button.x, p_ev.mouse_button.y);
+ Vector2 mpos = Vector2(mb->get_position().x, mb->get_position().y);
if (close_rect.size != Size2() && close_rect.has_point(mpos)) {
emit_signal("close_request");
accept_event();
@@ -607,13 +608,14 @@ void GraphNode::_gui_input(const InputEvent &p_ev) {
get_parent_control()->grab_focus();
}
- if (!p_ev.mouse_button.pressed && p_ev.mouse_button.button_index == BUTTON_LEFT) {
+ if (!mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
resizing = false;
}
}
- if (resizing && p_ev.type == InputEvent::MOUSE_MOTION) {
- Vector2 mpos = Vector2(p_ev.mouse_motion.x, p_ev.mouse_motion.y);
+ Ref<InputEventMouseMotion> mm = p_ev;
+ if (resizing && mm.is_valid()) {
+ Vector2 mpos = mm->get_position();
Vector2 diff = mpos - resizing_from;
@@ -662,7 +664,7 @@ void GraphNode::_bind_methods() {
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("clear_all_slots"), &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);
@@ -718,7 +720,7 @@ GraphNode::GraphNode() {
overlay = OVERLAY_DISABLED;
show_close = false;
connpos_dirty = true;
- set_mouse_filter(MOUSE_FILTER_PASS);
+ set_mouse_filter(MOUSE_FILTER_STOP);
comment = false;
resizeable = false;
resizing = false;
diff --git a/scene/gui/graph_node.h b/scene/gui/graph_node.h
index bab78dedb9..a7d9e8ddb0 100644
--- a/scene/gui/graph_node.h
+++ b/scene/gui/graph_node.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -98,10 +99,8 @@ private:
Overlay overlay;
- bool has_point(const Point2 &p_point) const;
-
protected:
- void _gui_input(const InputEvent &p_ev);
+ void _gui_input(const Ref<InputEvent> &p_ev);
void _notification(int p_what);
static void _bind_methods();
@@ -110,6 +109,8 @@ protected:
void _get_property_list(List<PropertyInfo> *p_list) const;
public:
+ bool has_point(const Point2 &p_point) const;
+
void set_slot(int p_idx, bool p_enable_left, int p_type_left, const Color &p_color_left, bool p_enable_right, int p_type_right, const Color &p_color_right, const Ref<Texture> &p_custom_left = Ref<Texture>(), const Ref<Texture> &p_custom_right = Ref<Texture>());
void clear_slot(int p_idx);
void clear_all_slots();
diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp
index aae11255ed..06a58d69b2 100644
--- a/scene/gui/grid_container.cpp
+++ b/scene/gui/grid_container.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/grid_container.h b/scene/gui/grid_container.h
index 61dda4e223..aaa6a295ff 100644
--- a/scene/gui/grid_container.h
+++ b/scene/gui/grid_container.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/input_action.cpp b/scene/gui/input_action.cpp
index 9576bb07e4..c08059a049 100644
--- a/scene/gui/input_action.cpp
+++ b/scene/gui/input_action.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,95 +30,73 @@
#include "input_action.h"
#include "os/keyboard.h"
-void ShortCut::set_shortcut(const InputEvent &p_shortcut) {
+void ShortCut::set_shortcut(const Ref<InputEvent> &p_shortcut) {
shortcut = p_shortcut;
emit_changed();
}
-InputEvent ShortCut::get_shortcut() const {
+Ref<InputEvent> ShortCut::get_shortcut() const {
return shortcut;
}
-bool ShortCut::is_shortcut(const InputEvent &p_event) const {
+bool ShortCut::is_shortcut(const Ref<InputEvent> &p_event) const {
- bool same = false;
-
- switch (p_event.type) {
-
- case InputEvent::KEY: {
-
- same = (shortcut.key.scancode == p_event.key.scancode && shortcut.key.mod == p_event.key.mod);
-
- } break;
- case InputEvent::JOYPAD_BUTTON: {
-
- same = (shortcut.joy_button.button_index == p_event.joy_button.button_index);
-
- } break;
- case InputEvent::MOUSE_BUTTON: {
-
- same = (shortcut.mouse_button.button_index == p_event.mouse_button.button_index);
-
- } break;
- case InputEvent::JOYPAD_MOTION: {
-
- same = (shortcut.joy_motion.axis == p_event.joy_motion.axis && (shortcut.joy_motion.axis_value < 0) == (p_event.joy_motion.axis_value < 0));
-
- } break;
- default: {};
- }
-
- return same;
+ return shortcut.is_valid() && shortcut->shortcut_match(p_event);
}
String ShortCut::get_as_text() const {
+ if (shortcut.is_valid())
+ return shortcut->as_text();
+ else
+ return "None";
+#if 0
switch (shortcut.type) {
- case InputEvent::NONE: {
+ case Ref<InputEvent>::NONE: {
return "None";
} break;
- case InputEvent::KEY: {
+ case Ref<InputEvent>::KEY: {
String str;
- if (shortcut.key.mod.shift)
+ if (shortcut->get_shift())
str += RTR("Shift+");
- if (shortcut.key.mod.alt)
+ if (shortcut->get_alt())
str += RTR("Alt+");
- if (shortcut.key.mod.control)
+ if (shortcut->get_control())
str += RTR("Ctrl+");
- if (shortcut.key.mod.meta)
+ if (shortcut->get_metakey())
str += RTR("Meta+");
- str += keycode_get_string(shortcut.key.scancode).capitalize();
+ str += keycode_get_string(shortcut->get_scancode()).capitalize();
return str;
} break;
- case InputEvent::JOYPAD_BUTTON: {
+ case Ref<InputEvent>::JOYPAD_BUTTON: {
- String str = RTR("Device") + " " + itos(shortcut.device) + ", " + RTR("Button") + " " + itos(shortcut.joy_button.button_index);
+ String str = RTR("Device") + " " + itos(shortcut.device) + ", " + RTR("Button") + " " + itos(shortcut.joy_button->get_button_index());
str += ".";
return str;
} break;
- case InputEvent::MOUSE_BUTTON: {
+ case Ref<InputEvent>::MOUSE_BUTTON: {
String str = RTR("Device") + " " + itos(shortcut.device) + ", ";
- switch (shortcut.mouse_button.button_index) {
+ switch (shortcut->get_button_index()) {
case BUTTON_LEFT: str += RTR("Left Button."); break;
case BUTTON_RIGHT: str += RTR("Right Button."); break;
case BUTTON_MIDDLE: str += RTR("Middle Button."); break;
case BUTTON_WHEEL_UP: str += RTR("Wheel Up."); break;
case BUTTON_WHEEL_DOWN: str += RTR("Wheel Down."); break;
- default: str += RTR("Button") + " " + itos(shortcut.mouse_button.button_index) + ".";
+ default: str += RTR("Button") + " " + itos(shortcut->get_button_index()) + ".";
}
return str;
} break;
- case InputEvent::JOYPAD_MOTION: {
+ case Ref<InputEvent>::JOYPAD_MOTION: {
int ax = shortcut.joy_motion.axis;
String str = RTR("Device") + " " + itos(shortcut.device) + ", " + RTR("Axis") + " " + itos(ax) + ".";
@@ -127,11 +106,12 @@ String ShortCut::get_as_text() const {
}
return "";
+#endif
}
bool ShortCut::is_valid() const {
- return shortcut.type != InputEvent::NONE;
+ return shortcut.is_valid();
}
void ShortCut::_bind_methods() {
@@ -144,7 +124,7 @@ void ShortCut::_bind_methods() {
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"), "set_shortcut", "get_shortcut");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shortcut", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"), "set_shortcut", "get_shortcut");
}
ShortCut::ShortCut() {
diff --git a/scene/gui/input_action.h b/scene/gui/input_action.h
index a0f5cf2c11..5c91d2be28 100644
--- a/scene/gui/input_action.h
+++ b/scene/gui/input_action.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,21 +30,22 @@
#ifndef INPUTACTION_H
#define INPUTACTION_H
+#include "os/input_event.h"
#include "resource.h"
class ShortCut : public Resource {
GDCLASS(ShortCut, Resource);
- InputEvent shortcut;
+ Ref<InputEvent> shortcut;
protected:
static void _bind_methods();
public:
- void set_shortcut(const InputEvent &p_shortcut);
- InputEvent get_shortcut() const;
- bool is_shortcut(const InputEvent &p_Event) const;
+ void set_shortcut(const Ref<InputEvent> &p_shortcut);
+ Ref<InputEvent> get_shortcut() const;
+ bool is_shortcut(const Ref<InputEvent> &p_event) const;
bool is_valid() const;
String get_as_text() const;
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 1db748a6b1..b30a6000ff 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "item_list.h"
-#include "global_config.h"
#include "os/os.h"
+#include "project_settings.h"
void ItemList::add_item(const String &p_item, const Ref<Texture> &p_texture, bool p_selectable) {
@@ -338,7 +339,7 @@ void ItemList::set_same_column_width(bool p_enable) {
update();
shape_changed = true;
}
-int ItemList::is_same_column_width() const {
+bool ItemList::is_same_column_width() const {
return same_column_width;
}
@@ -408,14 +409,17 @@ Size2 ItemList::Item::get_icon_size() const {
return icon_region.size;
}
-void ItemList::_gui_input(const InputEvent &p_event) {
+void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
- if (defer_select_single >= 0 && p_event.type == InputEvent::MOUSE_MOTION) {
+ Ref<InputEventMouseMotion> mm = p_event;
+ if (defer_select_single >= 0 && mm.is_valid()) {
defer_select_single = -1;
return;
}
- if (defer_select_single >= 0 && p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == BUTTON_LEFT && !p_event.mouse_button.pressed) {
+ Ref<InputEventMouseButton> mb = p_event;
+
+ if (defer_select_single >= 0 && mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && !mb->is_pressed()) {
select(defer_select_single, true);
@@ -424,12 +428,10 @@ void ItemList::_gui_input(const InputEvent &p_event) {
return;
}
- if (p_event.type == InputEvent::MOUSE_BUTTON && (p_event.mouse_button.button_index == BUTTON_LEFT || (allow_rmb_select && p_event.mouse_button.button_index == BUTTON_RIGHT)) && p_event.mouse_button.pressed) {
-
- const InputEventMouseButton &mb = p_event.mouse_button;
+ if (mb.is_valid() && (mb->get_button_index() == BUTTON_LEFT || (allow_rmb_select && mb->get_button_index() == BUTTON_RIGHT)) && mb->is_pressed()) {
search_string = ""; //any mousepress cancels
- Vector2 pos(mb.x, mb.y);
+ Vector2 pos = mb->get_position();
Ref<StyleBox> bg = get_stylebox("bg");
pos -= bg->get_offset();
pos.y += scroll_bar->get_value();
@@ -453,11 +455,11 @@ void ItemList::_gui_input(const InputEvent &p_event) {
int i = closest;
- if (select_mode == SELECT_MULTI && items[i].selected && mb.mod.command) {
+ if (select_mode == SELECT_MULTI && items[i].selected && mb->get_command()) {
unselect(i);
emit_signal("multi_selected", i, false);
- } else if (select_mode == SELECT_MULTI && mb.mod.shift && current >= 0 && current < items.size() && current != i) {
+ } else if (select_mode == SELECT_MULTI && mb->get_shift() && current >= 0 && current < items.size() && current != i) {
int from = current;
int to = i;
@@ -471,24 +473,24 @@ void ItemList::_gui_input(const InputEvent &p_event) {
emit_signal("multi_selected", i, true);
}
- if (p_event.mouse_button.button_index == BUTTON_RIGHT) {
+ if (mb->get_button_index() == BUTTON_RIGHT) {
- emit_signal("item_rmb_selected", i, Vector2(mb.x, mb.y));
+ emit_signal("item_rmb_selected", i, pos);
}
} else {
- if (!mb.doubleclick && !mb.mod.command && select_mode == SELECT_MULTI && items[i].selectable && !items[i].disabled && items[i].selected && p_event.mouse_button.button_index == BUTTON_LEFT) {
+ if (!mb->is_doubleclick() && !mb->get_command() && select_mode == SELECT_MULTI && items[i].selectable && !items[i].disabled && items[i].selected && mb->get_button_index() == BUTTON_LEFT) {
defer_select_single = i;
return;
}
- if (items[i].selected && p_event.mouse_button.button_index == BUTTON_RIGHT) {
+ if (items[i].selected && mb->get_button_index() == BUTTON_RIGHT) {
- emit_signal("item_rmb_selected", i, Vector2(mb.x, mb.y));
+ emit_signal("item_rmb_selected", i, pos);
} else {
bool selected = !items[i].selected;
- select(i, select_mode == SELECT_SINGLE || !mb.mod.command);
+ select(i, select_mode == SELECT_SINGLE || !mb->get_command());
if (selected) {
if (select_mode == SELECT_SINGLE) {
@@ -497,10 +499,10 @@ void ItemList::_gui_input(const InputEvent &p_event) {
emit_signal("multi_selected", i, true);
}
- if (p_event.mouse_button.button_index == BUTTON_RIGHT) {
+ if (mb->get_button_index() == BUTTON_RIGHT) {
- emit_signal("item_rmb_selected", i, Vector2(mb.x, mb.y));
- } else if (/*select_mode==SELECT_SINGLE &&*/ mb.doubleclick) {
+ emit_signal("item_rmb_selected", i, pos);
+ } else if (/*select_mode==SELECT_SINGLE &&*/ mb->is_doubleclick()) {
emit_signal("item_activated", i);
}
@@ -515,24 +517,24 @@ void ItemList::_gui_input(const InputEvent &p_event) {
}
}
}
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == BUTTON_WHEEL_UP && p_event.mouse_button.pressed) {
+ if (mb.is_valid() && mb->get_button_index() == BUTTON_WHEEL_UP && mb->is_pressed()) {
- scroll_bar->set_value(scroll_bar->get_value() - scroll_bar->get_page() / 8);
+ scroll_bar->set_value(scroll_bar->get_value() - scroll_bar->get_page() * mb->get_factor() / 8);
}
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == BUTTON_WHEEL_DOWN && p_event.mouse_button.pressed) {
+ if (mb.is_valid() && mb->get_button_index() == BUTTON_WHEEL_DOWN && mb->is_pressed()) {
- scroll_bar->set_value(scroll_bar->get_value() + scroll_bar->get_page() / 8);
+ scroll_bar->set_value(scroll_bar->get_value() + scroll_bar->get_page() * mb->get_factor() / 8);
}
- if (p_event.is_pressed() && items.size() > 0) {
- if (p_event.is_action("ui_up")) {
+ if (p_event->is_pressed() && items.size() > 0) {
+ if (p_event->is_action("ui_up")) {
if (search_string != "") {
uint64_t now = OS::get_singleton()->get_ticks_msec();
uint64_t diff = now - search_time_msec;
- if (diff < int(GlobalConfig::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
+ if (diff < int(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
for (int i = current - 1; i >= 0; i--) {
@@ -560,14 +562,14 @@ void ItemList::_gui_input(const InputEvent &p_event) {
}
accept_event();
}
- } else if (p_event.is_action("ui_down")) {
+ } else if (p_event->is_action("ui_down")) {
if (search_string != "") {
uint64_t now = OS::get_singleton()->get_ticks_msec();
uint64_t diff = now - search_time_msec;
- if (diff < int(GlobalConfig::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
+ if (diff < int(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
for (int i = current + 1; i < items.size(); i++) {
@@ -594,7 +596,7 @@ void ItemList::_gui_input(const InputEvent &p_event) {
}
accept_event();
}
- } else if (p_event.is_action("ui_page_up")) {
+ } else if (p_event->is_action("ui_page_up")) {
search_string = ""; //any mousepress cancels
@@ -609,7 +611,7 @@ void ItemList::_gui_input(const InputEvent &p_event) {
break;
}
}
- } else if (p_event.is_action("ui_page_down")) {
+ } else if (p_event->is_action("ui_page_down")) {
search_string = ""; //any mousepress cancels
@@ -625,7 +627,7 @@ void ItemList::_gui_input(const InputEvent &p_event) {
break;
}
}
- } else if (p_event.is_action("ui_left")) {
+ } else if (p_event->is_action("ui_left")) {
search_string = ""; //any mousepress cancels
@@ -637,7 +639,7 @@ void ItemList::_gui_input(const InputEvent &p_event) {
}
accept_event();
}
- } else if (p_event.is_action("ui_right")) {
+ } else if (p_event->is_action("ui_right")) {
search_string = ""; //any mousepress cancels
@@ -649,9 +651,9 @@ void ItemList::_gui_input(const InputEvent &p_event) {
}
accept_event();
}
- } else if (p_event.is_action("ui_cancel")) {
+ } else if (p_event->is_action("ui_cancel")) {
search_string = "";
- } else if (p_event.is_action("ui_select")) {
+ } else if (p_event->is_action("ui_select")) {
if (select_mode == SELECT_MULTI && current >= 0 && current < items.size()) {
if (items[current].selectable && !items[current].disabled && !items[current].selected) {
@@ -662,15 +664,17 @@ void ItemList::_gui_input(const InputEvent &p_event) {
emit_signal("multi_selected", current, false);
}
}
- } else if (p_event.is_action("ui_accept")) {
+ } else if (p_event->is_action("ui_accept")) {
search_string = ""; //any mousepress cance
if (current >= 0 && current < items.size()) {
emit_signal("item_activated", current);
}
- } else if (p_event.type == InputEvent::KEY) {
+ } else {
- if (p_event.key.unicode) {
+ Ref<InputEventKey> k = p_event;
+
+ if (k.is_valid() && k->get_unicode()) {
uint64_t now = OS::get_singleton()->get_ticks_msec();
uint64_t diff = now - search_time_msec;
@@ -681,7 +685,7 @@ void ItemList::_gui_input(const InputEvent &p_event) {
search_string = "";
}
- search_string += String::chr(p_event.key.unicode);
+ search_string += String::chr(k->get_unicode());
for (int i = 0; i < items.size(); i++) {
if (items[i].text.begins_with(search_string)) {
set_current(i);
@@ -732,19 +736,17 @@ void ItemList::_notification(int p_what) {
Ref<StyleBox> bg = get_stylebox("bg");
int mw = scroll_bar->get_minimum_size().x;
- scroll_bar->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, mw + bg->get_margin(MARGIN_RIGHT));
- scroll_bar->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, bg->get_margin(MARGIN_RIGHT));
+ scroll_bar->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -mw + bg->get_margin(MARGIN_RIGHT));
+ scroll_bar->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -bg->get_margin(MARGIN_RIGHT));
scroll_bar->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, bg->get_margin(MARGIN_TOP));
- scroll_bar->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, bg->get_margin(MARGIN_BOTTOM));
+ scroll_bar->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -bg->get_margin(MARGIN_BOTTOM));
Size2 size = get_size();
- float page = size.height - bg->get_minimum_size().height;
int width = size.width - bg->get_minimum_size().width;
if (scroll_bar->is_visible()) {
width -= mw + bg->get_margin(MARGIN_RIGHT);
}
- scroll_bar->set_page(page);
draw_style_box(bg, Rect2(Point2(), size));
@@ -853,7 +855,7 @@ void ItemList::_notification(int p_what) {
items[i].rect_cache = items[i].min_rect_cache;
if (same_column_width)
items[i].rect_cache.size.x = max_column_width;
- items[i].rect_cache.pos = ofs;
+ items[i].rect_cache.position = ofs;
max_h = MAX(max_h, items[i].rect_cache.size.y);
ofs.x += items[i].rect_cache.size.x + hseparation;
//print_line("item "+itos(i)+" ofs "+rtos(items[i].rect_cache.size.x));
@@ -879,8 +881,12 @@ void ItemList::_notification(int p_what) {
}
if (all_fit) {
+ float page = size.height - bg->get_minimum_size().height;
float max = MAX(page, ofs.y + max_h);
+ if (auto_height)
+ auto_height_value = ofs.y + max_h + bg->get_minimum_size().height;
scroll_bar->set_max(max);
+ scroll_bar->set_page(page);
//print_line("max: "+rtos(max)+" page "+rtos(page));
if (max <= page) {
scroll_bar->set_value(0);
@@ -902,10 +908,10 @@ void ItemList::_notification(int p_what) {
int from = scroll_bar->get_value();
int to = from + scroll_bar->get_page();
- if (r.pos.y < from) {
- scroll_bar->set_value(r.pos.y);
- } else if (r.pos.y + r.size.y > to) {
- scroll_bar->set_value(r.pos.y + r.size.y - (to - from));
+ if (r.position.y < from) {
+ scroll_bar->set_value(r.position.y);
+ } else if (r.position.y + r.size.y > to) {
+ scroll_bar->set_value(r.position.y + r.size.y - (to - from));
}
}
@@ -924,26 +930,29 @@ void ItemList::_notification(int p_what) {
continue;
if (current_columns == 1) {
- rcache.size.width = width - rcache.pos.x;
+ rcache.size.width = width - rcache.position.x;
}
- Rect2 r = rcache;
- r.pos += base_ofs;
-
- // Use stylebox to dimension potential bg color, even if not selected
- r.pos.x -= sbsel->get_margin(MARGIN_LEFT);
- r.size.x += sbsel->get_margin(MARGIN_LEFT) + sbsel->get_margin(MARGIN_RIGHT);
- r.pos.y -= sbsel->get_margin(MARGIN_TOP);
- r.size.y += sbsel->get_margin(MARGIN_TOP) + sbsel->get_margin(MARGIN_BOTTOM);
-
if (items[i].selected) {
+ Rect2 r = rcache;
+ r.position += base_ofs;
+
+ // Use stylebox to dimension potential bg color
+ r.position.x -= sbsel->get_margin(MARGIN_LEFT);
+ r.size.x += sbsel->get_margin(MARGIN_LEFT) + sbsel->get_margin(MARGIN_RIGHT);
+ r.position.y -= sbsel->get_margin(MARGIN_TOP);
+ r.size.y += sbsel->get_margin(MARGIN_TOP) + sbsel->get_margin(MARGIN_BOTTOM);
draw_style_box(sbsel, r);
}
+
if (items[i].custom_bg.a > 0.001) {
- r.pos.x += 2;
- r.size.x -= 4;
- r.pos.y += 2;
- r.size.y -= 4;
+
+ Rect2 r = rcache;
+ r.position += base_ofs;
+
+ // Size rect to make the align the temperature colors
+ r.position.y -= vseparation / 2;
+ r.size.y += vseparation;
draw_rect(r, items[i].custom_bg);
}
@@ -961,7 +970,7 @@ void ItemList::_notification(int p_what) {
Vector2 icon_ofs;
- Point2 pos = items[i].rect_cache.pos + icon_ofs + base_ofs;
+ Point2 pos = items[i].rect_cache.position + icon_ofs + base_ofs;
if (icon_mode == ICON_MODE_TOP) {
@@ -981,7 +990,7 @@ void ItemList::_notification(int p_what) {
if (fixed_icon_size.x > 0 && fixed_icon_size.y > 0) {
Rect2 adj = _adjust_to_max_size(items[i].get_icon_size() * icon_scale, icon_size);
- draw_rect.pos += adj.pos;
+ draw_rect.position += adj.position;
draw_rect.size = adj.size;
}
@@ -997,7 +1006,7 @@ void ItemList::_notification(int p_what) {
if (items[i].tag_icon.is_valid()) {
- draw_texture(items[i].tag_icon, items[i].rect_cache.pos + base_ofs);
+ draw_texture(items[i].tag_icon, items[i].rect_cache.position + base_ofs);
}
if (items[i].text != "") {
@@ -1042,7 +1051,7 @@ void ItemList::_notification(int p_what) {
text_ofs.y += font->get_ascent();
text_ofs = text_ofs.floor();
text_ofs += base_ofs;
- text_ofs += items[i].rect_cache.pos;
+ text_ofs += items[i].rect_cache.position;
for (int j = 0; j < ss; j++) {
@@ -1070,7 +1079,7 @@ void ItemList::_notification(int p_what) {
text_ofs.y += font->get_ascent();
text_ofs = text_ofs.floor();
text_ofs += base_ofs;
- text_ofs += items[i].rect_cache.pos;
+ text_ofs += items[i].rect_cache.position;
draw_string(font, text_ofs, items[i].text, modulate, max_len + 1);
}
@@ -1079,7 +1088,7 @@ void ItemList::_notification(int p_what) {
if (select_mode == SELECT_MULTI && i == current) {
Rect2 r = rcache;
- r.pos += base_ofs;
+ r.position += base_ofs;
draw_style_box(cursor, r);
}
}
@@ -1137,7 +1146,7 @@ bool ItemList::is_pos_at_end_of_items(const Point2 &p_pos) const {
pos.y += scroll_bar->get_value();
Rect2 endrect = items[items.size() - 1].rect_cache;
- return (pos.y > endrect.pos.y + endrect.size.y);
+ return (pos.y > endrect.position.y + endrect.size.y);
}
String ItemList::get_tooltip(const Point2 &p_pos) const {
@@ -1216,16 +1225,66 @@ Vector<int> ItemList::get_selected_items() {
return selected;
}
+void ItemList::_set_items(const Array &p_items) {
+
+ ERR_FAIL_COND(p_items.size() % 3);
+ clear();
+
+ for (int i = 0; i < p_items.size(); i += 3) {
+
+ String text = p_items[i + 0];
+ Ref<Texture> icon = p_items[i + 1];
+ bool disabled = p_items[i + 2];
+
+ int idx = get_item_count();
+ add_item(text, icon);
+ set_item_disabled(idx, disabled);
+ }
+}
+
+Array ItemList::_get_items() const {
+
+ Array items;
+ for (int i = 0; i < get_item_count(); i++) {
+
+ items.push_back(get_item_text(i));
+ items.push_back(get_item_icon(i));
+ items.push_back(is_item_disabled(i));
+ }
+
+ return items;
+}
+
+Size2 ItemList::get_minimum_size() const {
+
+ if (auto_height) {
+ return Size2(0, auto_height_value);
+ }
+ return Size2();
+}
+
+void ItemList::set_auto_height(bool p_enable) {
+
+ auto_height = p_enable;
+ shape_changed = true;
+ update();
+}
+
+bool ItemList::has_auto_height() const {
+
+ return auto_height;
+}
+
void ItemList::_bind_methods() {
- 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(D_METHOD("add_item", "text", "icon", "selectable"), &ItemList::add_item, DEFVAL(Variant()), DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("add_icon_item", "icon", "selectable"), &ItemList::add_icon_item, DEFVAL(true));
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(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(D_METHOD("set_item_icon", "idx", "icon"), &ItemList::set_item_icon);
+ ClassDB::bind_method(D_METHOD("get_item_icon", "idx"), &ItemList::get_item_icon);
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);
@@ -1286,6 +1345,9 @@ void ItemList::_bind_methods() {
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(D_METHOD("set_auto_height", "enable"), &ItemList::set_auto_height);
+ ClassDB::bind_method(D_METHOD("has_auto_height"), &ItemList::has_auto_height);
+
ClassDB::bind_method(D_METHOD("get_item_at_pos", "pos", "exact"), &ItemList::get_item_at_pos, DEFVAL(false));
ClassDB::bind_method(D_METHOD("ensure_current_is_visible"), &ItemList::ensure_current_is_visible);
@@ -1295,6 +1357,23 @@ void ItemList::_bind_methods() {
ClassDB::bind_method(D_METHOD("_scroll_changed"), &ItemList::_scroll_changed);
ClassDB::bind_method(D_METHOD("_gui_input"), &ItemList::_gui_input);
+ ClassDB::bind_method(D_METHOD("_set_items"), &ItemList::_set_items);
+ ClassDB::bind_method(D_METHOD("_get_items"), &ItemList::_get_items);
+
+ ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "items", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_items", "_get_items");
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "select_mode", PROPERTY_HINT_ENUM, "Single,Multi"), "set_select_mode", "get_select_mode");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "allow_rmb_select"), "set_allow_rmb_select", "get_allow_rmb_select");
+ ADD_PROPERTYNO(PropertyInfo(Variant::INT, "max_text_lines"), "set_max_text_lines", "get_max_text_lines");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "auto_height"), "set_auto_height", "has_auto_height");
+ ADD_GROUP("Columns", "");
+ ADD_PROPERTYNO(PropertyInfo(Variant::INT, "max_columns"), "set_max_columns", "get_max_columns");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "same_column_width"), "set_same_column_width", "is_same_column_width");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "fixed_column_width"), "set_fixed_column_width", "get_fixed_column_width");
+ ADD_GROUP("Icon", "");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "icon_mode", PROPERTY_HINT_ENUM, "Top,Left"), "set_icon_mode", "get_icon_mode");
+ ADD_PROPERTYNO(PropertyInfo(Variant::REAL, "icon_scale"), "set_icon_scale", "get_icon_scale");
+
BIND_CONSTANT(ICON_MODE_TOP);
BIND_CONSTANT(ICON_MODE_LEFT);
BIND_CONSTANT(SELECT_SINGLE);
@@ -1319,6 +1398,8 @@ ItemList::ItemList() {
same_column_width = false;
max_text_lines = 1;
max_columns = 1;
+ auto_height = false;
+ auto_height_value = 0.0f;
scroll_bar = memnew(VScrollBar);
add_child(scroll_bar);
diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h
index 5de58cfde8..a80727f568 100644
--- a/scene/gui/item_list.h
+++ b/scene/gui/item_list.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -77,6 +78,9 @@ private:
bool ensure_selected_visible;
bool same_column_width;
+ bool auto_height;
+ float auto_height_value;
+
Vector<Item> items;
Vector<int> separators;
@@ -102,8 +106,11 @@ private:
real_t icon_scale;
+ Array _get_items() const;
+ void _set_items(const Array &p_items);
+
void _scroll_changed(double);
- void _gui_input(const InputEvent &p_event);
+ void _gui_input(const Ref<InputEvent> &p_event);
protected:
void _notification(int p_what);
@@ -162,9 +169,9 @@ public:
int get_fixed_column_width() const;
void set_same_column_width(bool p_enable);
- int is_same_column_width() const;
+ bool is_same_column_width() const;
- void set_max_text_lines(int p_amount);
+ void set_max_text_lines(int p_lines);
int get_max_text_lines() const;
void set_max_columns(int p_amount);
@@ -194,6 +201,11 @@ public:
void set_icon_scale(real_t p_scale);
real_t get_icon_scale() const;
+ void set_auto_height(bool p_enable);
+ bool has_auto_height() const;
+
+ Size2 get_minimum_size() const;
+
VScrollBar *get_v_scroll() { return scroll_bar; }
ItemList();
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index 0dec69d9b3..874156821e 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,15 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "label.h"
-#include "global_config.h"
#include "print_string.h"
+#include "project_settings.h"
#include "translation.h"
void Label::set_autowrap(bool p_autowrap) {
autowrap = p_autowrap;
word_cache_dirty = true;
- minimum_size_changed();
update();
}
bool Label::has_autowrap() const {
@@ -47,7 +47,6 @@ void Label::set_uppercase(bool p_uppercase) {
uppercase = p_uppercase;
word_cache_dirty = true;
- minimum_size_changed();
update();
}
bool Label::is_uppercase() const {
@@ -64,8 +63,12 @@ void Label::_notification(int p_what) {
if (p_what == NOTIFICATION_TRANSLATION_CHANGED) {
- xl_text = XL_MESSAGE(text);
- minimum_size_changed();
+ String new_text = XL_MESSAGE(text);
+ if (new_text == xl_text)
+ return; //nothing new
+ xl_text = new_text;
+
+ regenerate_word_cache();
update();
}
@@ -286,7 +289,7 @@ void Label::_notification(int p_what) {
Size2 Label::get_minimum_size() const {
if (autowrap)
- return Size2(1, 1);
+ return Size2(1, clip ? 1 : minsize.height);
else {
// don't want to mutable everything
@@ -481,15 +484,16 @@ void Label::regenerate_word_cache() {
}
}
- if (!autowrap) {
+ if (!autowrap)
minsize.width = width;
- if (max_lines_visible > 0 && line_count > max_lines_visible) {
- minsize.height = (font->get_height() * max_lines_visible) + (line_spacing * (max_lines_visible - 1));
- } else {
- minsize.height = (font->get_height() * line_count) + (line_spacing * (line_count - 1));
- }
+
+ if (max_lines_visible > 0 && line_count > max_lines_visible) {
+ minsize.height = (font->get_height() * max_lines_visible) + (line_spacing * (max_lines_visible - 1));
+ } else {
+ minsize.height = (font->get_height() * line_count) + (line_spacing * (line_count - 1));
}
+ minimum_size_changed();
word_cache_dirty = false;
}
@@ -527,9 +531,6 @@ void Label::set_text(const String &p_string) {
if (percent_visible < 1)
visible_chars = get_total_character_count() * percent_visible;
update();
- if (!autowrap) {
- minimum_size_changed();
- }
}
void Label::set_clip_text(bool p_clip) {
@@ -680,6 +681,7 @@ Label::Label(const String &p_text) {
max_lines_visible = -1;
set_text(p_text);
uppercase = false;
+ set_v_size_flags(SIZE_SHRINK_CENTER);
}
Label::~Label() {
diff --git a/scene/gui/label.h b/scene/gui/label.h
index 769e4b2256..dce68f4422 100644
--- a/scene/gui/label.h
+++ b/scene/gui/label.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 20725194cf..c1784fb7ba 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,445 +42,442 @@ static bool _is_text_char(CharType c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_';
}
-void LineEdit::_gui_input(InputEvent p_event) {
+void LineEdit::_gui_input(Ref<InputEvent> p_event) {
- switch (p_event.type) {
+ Ref<InputEventMouseButton> b = p_event;
- case InputEvent::MOUSE_BUTTON: {
+ if (b.is_valid()) {
- const InputEventMouseButton &b = p_event.mouse_button;
-
- if (b.pressed && b.button_index == BUTTON_RIGHT) {
- menu->set_pos(get_global_transform().xform(get_local_mouse_pos()));
- menu->set_size(Vector2(1, 1));
- menu->popup();
- grab_focus();
- return;
- }
+ if (b->is_pressed() && b->get_button_index() == BUTTON_RIGHT) {
+ menu->set_position(get_global_transform().xform(get_local_mouse_pos()));
+ menu->set_size(Vector2(1, 1));
+ menu->popup();
+ grab_focus();
+ return;
+ }
- if (b.button_index != BUTTON_LEFT)
- break;
+ if (b->get_button_index() != BUTTON_LEFT)
+ return;
- _reset_caret_blink_timer();
- if (b.pressed) {
+ _reset_caret_blink_timer();
+ if (b->is_pressed()) {
- shift_selection_check_pre(b.mod.shift);
+ shift_selection_check_pre(b->get_shift());
- set_cursor_at_pixel_pos(b.x);
+ set_cursor_at_pixel_pos(b->get_position().x);
- if (b.mod.shift) {
+ if (b->get_shift()) {
- selection_fill_at_cursor();
- selection.creating = true;
+ selection_fill_at_cursor();
+ selection.creating = true;
- } else {
+ } else {
- if (b.doubleclick) {
+ if (b->is_doubleclick()) {
- selection.enabled = true;
- selection.begin = 0;
- selection.end = text.length();
- selection.doubleclick = true;
- }
+ selection.enabled = true;
+ selection.begin = 0;
+ selection.end = text.length();
+ selection.doubleclick = true;
+ }
- selection.drag_attempt = false;
+ selection.drag_attempt = false;
- if ((cursor_pos < selection.begin) || (cursor_pos > selection.end) || !selection.enabled) {
+ if ((cursor_pos < selection.begin) || (cursor_pos > selection.end) || !selection.enabled) {
- selection_clear();
- selection.cursor_start = cursor_pos;
- selection.creating = true;
- } else if (selection.enabled) {
+ selection_clear();
+ selection.cursor_start = cursor_pos;
+ selection.creating = true;
+ } else if (selection.enabled) {
- selection.drag_attempt = true;
- }
+ selection.drag_attempt = true;
}
+ }
- update();
-
- } else {
+ update();
- if ((!selection.creating) && (!selection.doubleclick)) {
- selection_clear();
- }
- selection.creating = false;
- selection.doubleclick = false;
+ } else {
- if (OS::get_singleton()->has_virtual_keyboard())
- OS::get_singleton()->show_virtual_keyboard(text, get_global_rect());
+ if ((!selection.creating) && (!selection.doubleclick)) {
+ selection_clear();
}
+ selection.creating = false;
+ selection.doubleclick = false;
- update();
- } break;
- case InputEvent::MOUSE_MOTION: {
+ if (OS::get_singleton()->has_virtual_keyboard())
+ OS::get_singleton()->show_virtual_keyboard(text, get_global_rect());
+ }
- const InputEventMouseMotion &m = p_event.mouse_motion;
+ update();
+ }
- if (m.button_mask & BUTTON_LEFT) {
+ Ref<InputEventMouseMotion> m = p_event;
- if (selection.creating) {
- set_cursor_at_pixel_pos(m.x);
- selection_fill_at_cursor();
- }
- }
+ if (m.is_valid()) {
- } break;
- case InputEvent::KEY: {
+ if (m->get_button_mask() & BUTTON_LEFT) {
- const InputEventKey &k = p_event.key;
+ if (selection.creating) {
+ set_cursor_at_pixel_pos(m->get_position().x);
+ selection_fill_at_cursor();
+ }
+ }
+ }
- if (!k.pressed)
- return;
- unsigned int code = k.scancode;
+ Ref<InputEventKey> k = p_event;
- if (k.mod.command) {
+ if (k.is_valid()) {
- bool handled = true;
+ if (!k->is_pressed())
+ return;
+ unsigned int code = k->get_scancode();
- switch (code) {
+ if (k->get_command()) {
- case (KEY_X): { // CUT
+ bool handled = true;
- if (editable) {
- cut_text();
- }
+ switch (code) {
- } break;
+ case (KEY_X): { // CUT
- case (KEY_C): { // COPY
+ if (editable) {
+ cut_text();
+ }
- copy_text();
+ } break;
- } break;
+ case (KEY_C): { // COPY
- case (KEY_V): { // PASTE
+ copy_text();
- if (editable) {
+ } break;
- paste_text();
- }
+ case (KEY_V): { // PASTE
- } break;
+ if (editable) {
- case (KEY_Z): { // Simple One level undo
+ paste_text();
+ }
- if (editable) {
+ } break;
- undo();
- }
+ case (KEY_Z): { // Simple One level undo
- } break;
+ if (editable) {
- case (KEY_U): { // Delete from start to cursor
+ undo();
+ }
- if (editable) {
+ } break;
- selection_clear();
- undo_text = text;
- text = text.substr(cursor_pos, text.length() - cursor_pos);
+ case (KEY_U): { // Delete from start to cursor
- Ref<Font> font = get_font("font");
+ if (editable) {
- cached_width = 0;
- if (font != NULL) {
- for (int i = 0; i < text.length(); i++)
- cached_width += font->get_char_size(text[i]).width;
- }
+ selection_clear();
+ undo_text = text;
+ text = text.substr(cursor_pos, text.length() - cursor_pos);
+
+ Ref<Font> font = get_font("font");
- set_cursor_pos(0);
- _text_changed();
+ cached_width = 0;
+ if (font != NULL) {
+ for (int i = 0; i < text.length(); i++)
+ cached_width += font->get_char_size(text[i]).width;
}
- } break;
+ set_cursor_pos(0);
+ _text_changed();
+ }
- case (KEY_Y): { // PASTE (Yank for unix users)
+ } break;
- if (editable) {
+ case (KEY_Y): { // PASTE (Yank for unix users)
- paste_text();
- }
+ if (editable) {
- } break;
- case (KEY_K): { // Delete from cursor_pos to end
+ paste_text();
+ }
- if (editable) {
+ } break;
+ case (KEY_K): { // Delete from cursor_pos to end
- selection_clear();
- undo_text = text;
- text = text.substr(0, cursor_pos);
- _text_changed();
- }
+ if (editable) {
- } break;
- case (KEY_A): { //Select All
- select();
- } break;
- default: { handled = false; }
- }
+ selection_clear();
+ undo_text = text;
+ text = text.substr(0, cursor_pos);
+ _text_changed();
+ }
- if (handled) {
- accept_event();
- return;
- }
+ } break;
+ case (KEY_A): { //Select All
+ select();
+ } break;
+ default: { handled = false; }
}
- _reset_caret_blink_timer();
- if (!k.mod.meta) {
+ if (handled) {
+ accept_event();
+ return;
+ }
+ }
- bool handled = true;
- switch (code) {
+ _reset_caret_blink_timer();
+ if (!k->get_metakey()) {
- case KEY_ENTER:
- case KEY_RETURN: {
+ bool handled = true;
+ switch (code) {
- emit_signal("text_entered", text);
- if (OS::get_singleton()->has_virtual_keyboard())
- OS::get_singleton()->hide_virtual_keyboard();
+ case KEY_KP_ENTER:
+ case KEY_ENTER: {
- return;
- } break;
+ emit_signal("text_entered", text);
+ if (OS::get_singleton()->has_virtual_keyboard())
+ OS::get_singleton()->hide_virtual_keyboard();
- case KEY_BACKSPACE: {
+ return;
+ } break;
- if (!editable)
- break;
+ case KEY_BACKSPACE: {
- if (selection.enabled) {
- undo_text = text;
- selection_delete();
- break;
- }
+ if (!editable)
+ break;
+
+ if (selection.enabled) {
+ undo_text = text;
+ selection_delete();
+ break;
+ }
#ifdef APPLE_STYLE_KEYS
- if (k.mod.alt) {
+ if (k->get_alt()) {
#else
- if (k.mod.alt) {
- handled = false;
- break;
- } else if (k.mod.command) {
+ if (k->get_alt()) {
+ handled = false;
+ break;
+ } else if (k->get_command()) {
#endif
- int cc = cursor_pos;
- bool prev_char = false;
+ int cc = cursor_pos;
+ bool prev_char = false;
- while (cc > 0) {
- bool ischar = _is_text_char(text[cc - 1]);
+ while (cc > 0) {
+ bool ischar = _is_text_char(text[cc - 1]);
- if (prev_char && !ischar)
- break;
+ if (prev_char && !ischar)
+ break;
- prev_char = ischar;
- cc--;
- }
+ prev_char = ischar;
+ cc--;
+ }
- delete_text(cc, cursor_pos);
+ delete_text(cc, cursor_pos);
- set_cursor_pos(cc);
+ set_cursor_pos(cc);
- } else {
- undo_text = text;
- delete_char();
- }
+ } else {
+ undo_text = text;
+ delete_char();
+ }
- } break;
- case KEY_KP_4: {
- if (k.unicode != 0) {
- handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_left
+ } break;
+ case KEY_KP_4: {
+ if (k->get_unicode() != 0) {
+ handled = false;
+ break;
}
- case KEY_LEFT: {
+ // numlock disabled. fallthrough to key_left
+ }
+ case KEY_LEFT: {
#ifndef APPLE_STYLE_KEYS
- if (!k.mod.alt)
+ if (!k->get_alt())
#endif
- shift_selection_check_pre(k.mod.shift);
+ shift_selection_check_pre(k->get_shift());
#ifdef APPLE_STYLE_KEYS
- if (k.mod.command) {
- set_cursor_pos(0);
- } else if (k.mod.alt) {
+ if (k->get_command()) {
+ set_cursor_pos(0);
+ } else if (k->get_alt()) {
#else
- if (k.mod.alt) {
- handled = false;
- break;
- } else if (k.mod.command) {
+ if (k->get_alt()) {
+ handled = false;
+ break;
+ } else if (k->get_command()) {
#endif
- bool prev_char = false;
- int cc = cursor_pos;
+ bool prev_char = false;
+ int cc = cursor_pos;
- while (cc > 0) {
- bool ischar = _is_text_char(text[cc - 1]);
+ while (cc > 0) {
+ bool ischar = _is_text_char(text[cc - 1]);
- if (prev_char && !ischar)
- break;
+ if (prev_char && !ischar)
+ break;
- prev_char = ischar;
- cc--;
- }
+ prev_char = ischar;
+ cc--;
+ }
- set_cursor_pos(cc);
+ set_cursor_pos(cc);
- } else {
- set_cursor_pos(get_cursor_pos() - 1);
- }
+ } else {
+ set_cursor_pos(get_cursor_pos() - 1);
+ }
- shift_selection_check_post(k.mod.shift);
+ shift_selection_check_post(k->get_shift());
- } break;
- case KEY_KP_6: {
- if (k.unicode != 0) {
- handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_right
+ } break;
+ case KEY_KP_6: {
+ if (k->get_unicode() != 0) {
+ handled = false;
+ break;
}
- case KEY_RIGHT: {
+ // numlock disabled. fallthrough to key_right
+ }
+ case KEY_RIGHT: {
- shift_selection_check_pre(k.mod.shift);
+ shift_selection_check_pre(k->get_shift());
#ifdef APPLE_STYLE_KEYS
- if (k.mod.command) {
- set_cursor_pos(text.length());
- } else if (k.mod.alt) {
+ if (k->get_command()) {
+ set_cursor_pos(text.length());
+ } else if (k->get_alt()) {
#else
- if (k.mod.alt) {
- handled = false;
- break;
- } else if (k.mod.command) {
+ if (k->get_alt()) {
+ handled = false;
+ break;
+ } else if (k->get_command()) {
#endif
- bool prev_char = false;
- int cc = cursor_pos;
+ bool prev_char = false;
+ int cc = cursor_pos;
- while (cc < text.length()) {
- bool ischar = _is_text_char(text[cc]);
+ while (cc < text.length()) {
+ bool ischar = _is_text_char(text[cc]);
- if (prev_char && !ischar)
- break;
+ if (prev_char && !ischar)
+ break;
- prev_char = ischar;
- cc++;
- }
+ prev_char = ischar;
+ cc++;
+ }
- set_cursor_pos(cc);
+ set_cursor_pos(cc);
- } else {
- set_cursor_pos(get_cursor_pos() + 1);
- }
+ } else {
+ set_cursor_pos(get_cursor_pos() + 1);
+ }
- shift_selection_check_post(k.mod.shift);
+ shift_selection_check_post(k->get_shift());
- } break;
- case KEY_DELETE: {
+ } break;
+ case KEY_DELETE: {
- if (!editable)
- break;
+ if (!editable)
+ break;
- if (k.mod.shift && !k.mod.command && !k.mod.alt) {
- cut_text();
- break;
- }
+ if (k->get_shift() && !k->get_command() && !k->get_alt()) {
+ cut_text();
+ break;
+ }
- if (selection.enabled) {
- undo_text = text;
- selection_delete();
- break;
- }
+ if (selection.enabled) {
+ undo_text = text;
+ selection_delete();
+ break;
+ }
- int text_len = text.length();
+ int text_len = text.length();
- if (cursor_pos == text_len)
- break; // nothing to do
+ if (cursor_pos == text_len)
+ break; // nothing to do
#ifdef APPLE_STYLE_KEYS
- if (k.mod.alt) {
+ if (k->get_alt()) {
#else
- if (k.mod.alt) {
- handled = false;
- break;
- } else if (k.mod.command) {
+ if (k->get_alt()) {
+ handled = false;
+ break;
+ } else if (k->get_command()) {
#endif
- int cc = cursor_pos;
+ int cc = cursor_pos;
- bool prev_char = false;
+ bool prev_char = false;
- while (cc < text.length()) {
+ while (cc < text.length()) {
- bool ischar = _is_text_char(text[cc]);
+ bool ischar = _is_text_char(text[cc]);
- if (prev_char && !ischar)
- break;
- prev_char = ischar;
- cc++;
- }
-
- delete_text(cursor_pos, cc);
-
- } else {
- undo_text = text;
- set_cursor_pos(cursor_pos + 1);
- delete_char();
+ if (prev_char && !ischar)
+ break;
+ prev_char = ischar;
+ cc++;
}
- } break;
- case KEY_KP_7: {
- if (k.unicode != 0) {
- handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_home
- }
- case KEY_HOME: {
+ delete_text(cursor_pos, cc);
- shift_selection_check_pre(k.mod.shift);
- set_cursor_pos(0);
- shift_selection_check_post(k.mod.shift);
- } break;
- case KEY_KP_1: {
- if (k.unicode != 0) {
- handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_end
+ } else {
+ undo_text = text;
+ set_cursor_pos(cursor_pos + 1);
+ delete_char();
}
- case KEY_END: {
-
- shift_selection_check_pre(k.mod.shift);
- set_cursor_pos(text.length());
- shift_selection_check_post(k.mod.shift);
- } break;
- default: {
+ } break;
+ case KEY_KP_7: {
+ if (k->get_unicode() != 0) {
+ handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_home
+ }
+ case KEY_HOME: {
+ shift_selection_check_pre(k->get_shift());
+ set_cursor_pos(0);
+ shift_selection_check_post(k->get_shift());
+ } break;
+ case KEY_KP_1: {
+ if (k->get_unicode() != 0) {
handled = false;
- } break;
+ break;
+ }
+ // numlock disabled. fallthrough to key_end
}
+ case KEY_END: {
- if (handled) {
- accept_event();
- } else if (!k.mod.alt && !k.mod.command) {
- if (k.unicode >= 32 && k.scancode != KEY_DELETE) {
-
- if (editable) {
- selection_delete();
- CharType ucodestr[2] = { (CharType)k.unicode, 0 };
- append_at_cursor(ucodestr);
- _text_changed();
- accept_event();
- }
+ shift_selection_check_pre(k->get_shift());
+ set_cursor_pos(text.length());
+ shift_selection_check_post(k->get_shift());
+ } break;
- } else {
- return;
+ default: {
+
+ handled = false;
+ } break;
+ }
+
+ if (handled) {
+ accept_event();
+ } else if (!k->get_alt() && !k->get_command()) {
+ if (k->get_unicode() >= 32 && k->get_scancode() != KEY_DELETE) {
+
+ if (editable) {
+ selection_delete();
+ CharType ucodestr[2] = { (CharType)k->get_unicode(), 0 };
+ append_at_cursor(ucodestr);
+ _text_changed();
+ accept_event();
}
- }
- update();
+ } else {
+ return;
+ }
}
- return;
+ update();
+ }
- } break;
+ return;
}
}
@@ -576,8 +574,12 @@ void LineEdit::_notification(int p_what) {
RID ci = get_canvas_item();
Ref<StyleBox> style = get_stylebox("normal");
- if (!is_editable())
+ float disabled_alpha = 1.0; // used to set the disabled input text color
+ if (!is_editable()) {
style = get_stylebox("read_only");
+ disabled_alpha = .5;
+ draw_caret = false;
+ }
Ref<Font> font = get_font("font");
@@ -624,6 +626,13 @@ void LineEdit::_notification(int p_what) {
// draw placeholder color
if (text.empty())
font_color.a *= placeholder_alpha;
+ font_color.a *= disabled_alpha;
+
+ if (has_icon("right_icon")) {
+ Ref<Texture> r_icon = Control::get_icon("right_icon");
+ ofs_max -= r_icon->get_width();
+ r_icon->draw(ci, Point2(width - r_icon->get_width() - x_ofs, y_ofs), Color(1, 1, 1, disabled_alpha * .9));
+ }
int caret_height = font->get_height() > y_area ? y_area : font->get_height();
while (true) {
@@ -632,8 +641,37 @@ void LineEdit::_notification(int p_what) {
if (char_ofs >= t.length())
break;
- CharType cchar = pass ? '*' : t[char_ofs];
- CharType next = pass ? '*' : t[char_ofs + 1];
+ if (char_ofs == cursor_pos) {
+ if (ime_text.length() > 0) {
+ int ofs = 0;
+ while (true) {
+ if (ofs >= ime_text.length())
+ break;
+
+ CharType cchar = (pass && !text.empty()) ? '*' : ime_text[ofs];
+ CharType next = (pass && !text.empty()) ? '*' : ime_text[ofs + 1];
+ int im_char_width = font->get_char_size(cchar, next).width;
+
+ if ((x_ofs + im_char_width) > ofs_max)
+ break;
+
+ bool selected = ofs >= ime_selection.x && ofs < ime_selection.x + ime_selection.y;
+ if (selected) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 3)), font_color);
+ } else {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 1)), font_color);
+ }
+
+ font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color);
+
+ x_ofs += im_char_width;
+ ofs++;
+ }
+ }
+ }
+
+ CharType cchar = (pass && !text.empty()) ? '*' : t[char_ofs];
+ CharType next = (pass && !text.empty()) ? '*' : t[char_ofs + 1];
int char_width = font->get_char_size(cchar, next).width;
// end of widget, break!
@@ -648,19 +686,54 @@ void LineEdit::_notification(int p_what) {
font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, selected ? font_color_selected : font_color);
if (char_ofs == cursor_pos && draw_caret) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(
- Point2(x_ofs, y_ofs), Size2(1, caret_height)),
- cursor_color);
+ if (ime_text.length() == 0) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(1, caret_height)), cursor_color);
+ }
}
x_ofs += char_width;
char_ofs++;
}
+ if (char_ofs == cursor_pos) {
+ if (ime_text.length() > 0) {
+ int ofs = 0;
+ while (true) {
+ if (ofs >= ime_text.length())
+ break;
+
+ CharType cchar = (pass && !text.empty()) ? '*' : ime_text[ofs];
+ CharType next = (pass && !text.empty()) ? '*' : ime_text[ofs + 1];
+ int im_char_width = font->get_char_size(cchar, next).width;
+
+ if ((x_ofs + im_char_width) > ofs_max)
+ break;
+
+ bool selected = ofs >= ime_selection.x && ofs < ime_selection.x + ime_selection.y;
+ if (selected) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 3)), font_color);
+ } else {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 1)), font_color);
+ }
+
+ font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color);
+
+ x_ofs += im_char_width;
+ ofs++;
+ }
+ }
+ }
+
if (char_ofs == cursor_pos && draw_caret) { //may be at the end
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(
- Point2(x_ofs, y_ofs), Size2(1, caret_height)),
- cursor_color);
+ if (ime_text.length() == 0) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(1, caret_height)), cursor_color);
+ }
+ }
+
+ if (has_focus()) {
+
+ OS::get_singleton()->set_ime_position(get_global_position() + Point2(x_ofs, y_ofs + caret_height));
+ OS::get_singleton()->set_ime_intermediate_text_callback(_ime_text_callback, this);
}
} break;
case NOTIFICATION_FOCUS_ENTER: {
@@ -669,12 +742,21 @@ void LineEdit::_notification(int p_what) {
draw_caret = true;
}
+ Point2 cursor_pos = Point2(get_cursor_pos(), 1) * get_minimum_size().height;
+ OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos);
+ OS::get_singleton()->set_ime_intermediate_text_callback(_ime_text_callback, this);
+
if (OS::get_singleton()->has_virtual_keyboard())
OS::get_singleton()->show_virtual_keyboard(text, get_global_rect());
} break;
case NOTIFICATION_FOCUS_EXIT: {
+ OS::get_singleton()->set_ime_position(Point2());
+ OS::get_singleton()->set_ime_intermediate_text_callback(NULL, NULL);
+ ime_text = "";
+ ime_selection = Point2();
+
if (OS::get_singleton()->has_virtual_keyboard())
OS::get_singleton()->hide_virtual_keyboard();
@@ -1183,7 +1265,9 @@ void LineEdit::menu_option(int p_option) {
select_all();
} break;
case MENU_UNDO: {
- undo();
+ if (editable) {
+ undo();
+ }
} break;
}
}
@@ -1210,6 +1294,13 @@ bool LineEdit::get_expand_to_text_length() const {
return expand_to_text_length;
}
+void LineEdit::_ime_text_callback(void *p_self, String p_text, Point2 p_selection) {
+ LineEdit *self = (LineEdit *)p_self;
+ self->ime_text = p_text;
+ self->ime_selection = p_selection;
+ self->update();
+}
+
void LineEdit::_text_changed() {
if (expand_to_text_length)
@@ -1256,7 +1347,7 @@ void LineEdit::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("get_menu"), &LineEdit::get_menu);
ADD_SIGNAL(MethodInfo("text_changed", PropertyInfo(Variant::STRING, "text")));
ADD_SIGNAL(MethodInfo("text_entered", PropertyInfo(Variant::STRING, "text")));
diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h
index 0746547115..fb0eaa9446 100644
--- a/scene/gui/line_edit.h
+++ b/scene/gui/line_edit.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -69,6 +70,8 @@ private:
String text;
String placeholder;
float placeholder_alpha;
+ String ime_text;
+ Point2 ime_selection;
PopupMenu *menu;
@@ -91,6 +94,7 @@ private:
Timer *caret_blink_timer;
+ static void _ime_text_callback(void *p_self, String p_text, Point2 p_selection);
void _text_changed();
bool expand_to_text_length;
@@ -118,7 +122,7 @@ private:
void _editor_settings_changed();
#endif
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
void _notification(int p_what);
protected:
@@ -173,7 +177,7 @@ public:
virtual Size2 get_minimum_size() const;
- void set_expand_to_text_length(bool p_len);
+ void set_expand_to_text_length(bool p_enabled);
bool get_expand_to_text_length() const;
virtual bool is_text_field() const;
diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp
index 17e549c902..9cb67b75e2 100644
--- a/scene/gui/link_button.cpp
+++ b/scene/gui/link_button.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/link_button.h b/scene/gui/link_button.h
index 97c2bfc3c8..98a3dc66f6 100644
--- a/scene/gui/link_button.h
+++ b/scene/gui/link_button.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/margin_container.cpp b/scene/gui/margin_container.cpp
index b7824e9037..2bc9db529b 100644
--- a/scene/gui/margin_container.cpp
+++ b/scene/gui/margin_container.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/margin_container.h b/scene/gui/margin_container.h
index 9f0829a34d..1cdb3a36cc 100644
--- a/scene/gui/margin_container.h
+++ b/scene/gui/margin_container.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp
index f2e2c9b255..93284f2b6c 100644
--- a/scene/gui/menu_button.cpp
+++ b/scene/gui/menu_button.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,9 +31,9 @@
#include "os/keyboard.h"
#include "scene/main/viewport.h"
-void MenuButton::_unhandled_key_input(InputEvent p_event) {
+void MenuButton::_unhandled_key_input(Ref<InputEvent> p_event) {
- if (p_event.is_pressed() && !p_event.is_echo() && (p_event.type == InputEvent::KEY || p_event.type == InputEvent::ACTION || p_event.type == InputEvent::JOYPAD_BUTTON)) {
+ if (p_event->is_pressed() && !p_event->is_echo() && (p_event->cast_to<InputEventKey>() || p_event->cast_to<InputEventJoypadButton>() || p_event->cast_to<InputEventAction>())) {
if (!get_parent() || !is_visible_in_tree() || is_disabled())
return;
@@ -49,19 +50,18 @@ void MenuButton::pressed() {
emit_signal("about_to_show");
Size2 size = get_size();
- Point2 gp = get_global_pos();
- popup->set_global_pos(gp + Size2(0, size.height));
+ Point2 gp = get_global_position();
+ popup->set_global_position(gp + Size2(0, size.height));
popup->set_size(Size2(size.width, 0));
- popup->set_parent_rect(Rect2(Point2(gp - popup->get_global_pos()), get_size()));
+ popup->set_parent_rect(Rect2(Point2(gp - popup->get_global_position()), get_size()));
popup->popup();
- popup->call_deferred("grab_click_focus");
popup->set_invalidate_click_until_motion();
}
-void MenuButton::_gui_input(InputEvent p_event) {
+void MenuButton::_gui_input(Ref<InputEvent> p_event) {
- /*if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==BUTTON_LEFT) {
- clicked=p_event.mouse_button.pressed;
+ /*if (p_event.type==InputEvent::MOUSE_BUTTON && p_event->get_button_index()==BUTTON_LEFT) {
+ clicked=p_event->is_pressed();
}
if (clicked && p_event.type==InputEvent::MOUSE_MOTION && popup->is_visible_in_tree()) {
@@ -94,7 +94,7 @@ void MenuButton::_set_items(const Array &p_items) {
void MenuButton::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_popup:PopupMenu"), &MenuButton::get_popup);
+ ClassDB::bind_method(D_METHOD("get_popup"), &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);
@@ -111,6 +111,7 @@ MenuButton::MenuButton() {
popup->hide();
add_child(popup);
popup->set_as_toplevel(true);
+ connect("button_up", popup, "call_deferred", make_binds("grab_click_focus"));
set_process_unhandled_key_input(true);
set_action_mode(ACTION_MODE_BUTTON_PRESS);
}
diff --git a/scene/gui/menu_button.h b/scene/gui/menu_button.h
index 4acb62cf37..6bb23452dd 100644
--- a/scene/gui/menu_button.h
+++ b/scene/gui/menu_button.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -42,11 +43,11 @@ class MenuButton : public Button {
PopupMenu *popup;
virtual void pressed();
- void _unhandled_key_input(InputEvent p_event);
+ void _unhandled_key_input(Ref<InputEvent> p_event);
Array _get_items() const;
void _set_items(const Array &p_items);
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
protected:
static void _bind_methods();
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp
index 43f68d92ab..00df266a09 100644
--- a/scene/gui/option_button.cpp
+++ b/scene/gui/option_button.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -51,11 +52,26 @@ void OptionButton::_notification(int p_what) {
RID ci = get_canvas_item();
Ref<Texture> arrow = Control::get_icon("arrow");
Ref<StyleBox> normal = get_stylebox("normal");
+ Color clr = Color(1, 1, 1);
+ if (get_constant("modulate_arrow"))
+ switch (get_draw_mode()) {
+ case DRAW_PRESSED:
+ clr = get_color("font_color_pressed");
+ break;
+ case DRAW_HOVER:
+ clr = get_color("font_color_hover");
+ break;
+ case DRAW_DISABLED:
+ clr = get_color("font_color_disabled");
+ break;
+ default:
+ clr = get_color("font_color");
+ }
Size2 size = get_size();
Point2 ofs(size.width - arrow->get_width() - get_constant("arrow_margin"), int(Math::abs((size.height - arrow->get_height()) / 2)));
- arrow->draw(ci, ofs);
+ arrow->draw(ci, ofs, clr);
} break;
}
@@ -66,7 +82,7 @@ void OptionButton::_selected(int p_which) {
int selid = -1;
for (int i = 0; i < popup->get_item_count(); i++) {
- bool is_clicked = popup->get_item_ID(i) == p_which;
+ bool is_clicked = popup->get_item_id(i) == p_which;
if (is_clicked) {
selid = i;
break;
@@ -86,7 +102,7 @@ void OptionButton::_selected(int p_which) {
void OptionButton::pressed() {
Size2 size = get_size();
- popup->set_global_pos(get_global_pos() + Size2(0, size.height));
+ popup->set_global_position(get_global_position() + Size2(0, size.height));
popup->set_size(Size2(size.width, 0));
popup->popup();
@@ -113,9 +129,9 @@ void OptionButton::set_item_icon(int p_idx, const Ref<Texture> &p_icon) {
popup->set_item_icon(p_idx, p_icon);
}
-void OptionButton::set_item_ID(int p_idx, int p_ID) {
+void OptionButton::set_item_id(int p_idx, int p_ID) {
- popup->set_item_ID(p_idx, p_ID);
+ popup->set_item_id(p_idx, p_ID);
}
void OptionButton::set_item_metadata(int p_idx, const Variant &p_metadata) {
@@ -138,9 +154,9 @@ Ref<Texture> OptionButton::get_item_icon(int p_idx) const {
return popup->get_item_icon(p_idx);
}
-int OptionButton::get_item_ID(int p_idx) const {
+int OptionButton::get_item_id(int p_idx) const {
- return popup->get_item_ID(p_idx);
+ return popup->get_item_id(p_idx);
}
Variant OptionButton::get_item_metadata(int p_idx) const {
@@ -169,21 +185,21 @@ void OptionButton::clear() {
current = -1;
}
-void OptionButton::_select(int p_idx, bool p_emit) {
+void OptionButton::_select(int p_which, bool p_emit) {
- if (p_idx < 0)
+ if (p_which < 0)
return;
- if (p_idx == current)
+ if (p_which == current)
return;
- ERR_FAIL_INDEX(p_idx, popup->get_item_count());
+ ERR_FAIL_INDEX(p_which, popup->get_item_count());
for (int i = 0; i < popup->get_item_count(); i++) {
- popup->set_item_checked(i, i == p_idx);
+ popup->set_item_checked(i, i == p_which);
}
- current = p_idx;
+ current = p_which;
set_text(popup->get_item_text(current));
set_icon(popup->get_item_icon(current));
@@ -208,12 +224,12 @@ int OptionButton::get_selected() const {
return current;
}
-int OptionButton::get_selected_ID() const {
+int OptionButton::get_selected_id() const {
int idx = get_selected();
if (idx < 0)
return 0;
- return get_item_ID(current);
+ return get_item_id(current);
}
Variant OptionButton::get_selected_metadata() const {
@@ -236,7 +252,7 @@ Array OptionButton::_get_items() const {
items.push_back(get_item_text(i));
items.push_back(get_item_icon(i));
items.push_back(is_item_disabled(i));
- items.push_back(get_item_ID(i));
+ items.push_back(get_item_id(i));
items.push_back(get_item_metadata(i));
}
@@ -273,15 +289,15 @@ void OptionButton::_bind_methods() {
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("add_icon_item", "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_icon", "idx", "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_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_icon", "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);
@@ -289,7 +305,7 @@ void OptionButton::_bind_methods() {
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_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);
diff --git a/scene/gui/option_button.h b/scene/gui/option_button.h
index 55a98cb50c..db921b8b97 100644
--- a/scene/gui/option_button.h
+++ b/scene/gui/option_button.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -61,13 +62,13 @@ public:
void set_item_text(int p_idx, const String &p_text);
void set_item_icon(int p_idx, const Ref<Texture> &p_icon);
- void set_item_ID(int p_idx, int p_ID);
+ void set_item_id(int p_idx, int p_ID);
void set_item_metadata(int p_idx, const Variant &p_metadata);
void set_item_disabled(int p_idx, bool p_disabled);
String get_item_text(int p_idx) const;
Ref<Texture> get_item_icon(int p_idx) const;
- int get_item_ID(int p_idx) const;
+ int get_item_id(int p_idx) const;
Variant get_item_metadata(int p_idx) const;
bool is_item_disabled(int p_idx) const;
@@ -79,7 +80,7 @@ public:
void select(int p_idx);
int get_selected() const;
- int get_selected_ID() const;
+ int get_selected_id() const;
Variant get_selected_metadata() const;
void remove_item(int p_idx);
diff --git a/scene/gui/panel.cpp b/scene/gui/panel.cpp
index 536f0baf73..f3c6142f9e 100644
--- a/scene/gui/panel.cpp
+++ b/scene/gui/panel.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/panel.h b/scene/gui/panel.h
index 3d2c0a3e98..eac8f2d4e8 100644
--- a/scene/gui/panel.h
+++ b/scene/gui/panel.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/panel_container.cpp b/scene/gui/panel_container.cpp
index 9dc7a6b32e..86874f7cfd 100644
--- a/scene/gui/panel_container.cpp
+++ b/scene/gui/panel_container.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/panel_container.h b/scene/gui/panel_container.h
index 13ed1c935c..f8f1fb6494 100644
--- a/scene/gui/panel_container.h
+++ b/scene/gui/panel_container.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/patch_9_rect.cpp b/scene/gui/patch_9_rect.cpp
index d0bd45e435..249090830d 100644
--- a/scene/gui/patch_9_rect.cpp
+++ b/scene/gui/patch_9_rect.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,27 +38,13 @@ void NinePatchRect::_notification(int p_what) {
if (texture.is_null())
return;
- Size2 s = get_size();
+ Rect2 rect = Rect2(Point2(), get_size());
+ Rect2 src_rect = region_rect;
+
+ texture->get_rect_region(rect, src_rect, rect, src_rect);
+
RID ci = get_canvas_item();
- VS::get_singleton()->canvas_item_add_nine_patch(ci, Rect2(Point2(), s), region_rect, texture->get_rid(), Vector2(margin[MARGIN_LEFT], margin[MARGIN_TOP]), Vector2(margin[MARGIN_RIGHT], margin[MARGIN_BOTTOM]), VS::NINE_PATCH_STRETCH, VS::NINE_PATCH_STRETCH, draw_center);
- //draw_texture_rect(texture,Rect2(Point2(),s),false,modulate);
-
- /*
- Vector<Point2> points;
- points.resize(4);
- points[0]=Point2(0,0);
- points[1]=Point2(s.x,0);
- points[2]=Point2(s.x,s.y);
- points[3]=Point2(0,s.y);
- Vector<Point2> uvs;
- uvs.resize(4);
- uvs[0]=Point2(0,0);
- uvs[1]=Point2(1,0);
- uvs[2]=Point2(1,1);
- uvs[3]=Point2(0,1);
-
- VisualServer::get_singleton()->canvas_item_add_primitive(ci,points,Vector<Color>(),uvs,texture->get_rid());
-*/
+ VS::get_singleton()->canvas_item_add_nine_patch(ci, rect, src_rect, texture->get_rid(), Vector2(margin[MARGIN_LEFT], margin[MARGIN_TOP]), Vector2(margin[MARGIN_RIGHT], margin[MARGIN_BOTTOM]), VS::NinePatchAxisMode(axis_h), VS::NinePatchAxisMode(axis_v), draw_center);
}
}
@@ -75,6 +62,10 @@ void NinePatchRect::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("set_h_axis_stretch_mode", "mode"), &NinePatchRect::set_h_axis_stretch_mode);
+ ClassDB::bind_method(D_METHOD("get_h_axis_stretch_mode"), &NinePatchRect::get_h_axis_stretch_mode);
+ ClassDB::bind_method(D_METHOD("set_v_axis_stretch_mode", "mode"), &NinePatchRect::set_v_axis_stretch_mode);
+ ClassDB::bind_method(D_METHOD("get_v_axis_stretch_mode"), &NinePatchRect::get_v_axis_stretch_mode);
ADD_SIGNAL(MethodInfo("texture_changed"));
@@ -87,6 +78,13 @@ void NinePatchRect::_bind_methods() {
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);
+ ADD_GROUP("Axis Stretch", "axis_stretch_");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "axis_stretch_horizontal", PROPERTY_HINT_ENUM, "Stretch,Tile,Tile Fit"), "set_h_axis_stretch_mode", "get_h_axis_stretch_mode");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "axis_stretch_vertical", PROPERTY_HINT_ENUM, "Stretch,Tile,Tile Fit"), "set_v_axis_stretch_mode", "get_v_axis_stretch_mode");
+
+ BIND_CONSTANT(AXIS_STRETCH_MODE_STRETCH);
+ BIND_CONSTANT(AXIS_STRETCH_MODE_TILE);
+ BIND_CONSTANT(AXIS_STRETCH_MODE_TILE_FIT);
}
void NinePatchRect::set_texture(const Ref<Texture> &p_tex) {
@@ -101,6 +99,7 @@ void NinePatchRect::set_texture(const Ref<Texture> &p_tex) {
*/
minimum_size_changed();
emit_signal("texture_changed");
+ _change_notify("texture");
}
Ref<Texture> NinePatchRect::get_texture() const {
@@ -116,16 +115,16 @@ void NinePatchRect::set_patch_margin(Margin p_margin, int p_size) {
minimum_size_changed();
switch (p_margin) {
case MARGIN_LEFT:
- _change_notify("patch_margin/left");
+ _change_notify("patch_margin_left");
break;
case MARGIN_TOP:
- _change_notify("patch_margin/top");
+ _change_notify("patch_margin_top");
break;
case MARGIN_RIGHT:
- _change_notify("patch_margin/right");
+ _change_notify("patch_margin_right");
break;
case MARGIN_BOTTOM:
- _change_notify("patch_margin/bottom");
+ _change_notify("patch_margin_bottom");
break;
}
}
@@ -163,6 +162,26 @@ bool NinePatchRect::get_draw_center() const {
return draw_center;
}
+void NinePatchRect::set_h_axis_stretch_mode(AxisStretchMode p_mode) {
+ axis_h = p_mode;
+ update();
+}
+
+NinePatchRect::AxisStretchMode NinePatchRect::get_h_axis_stretch_mode() const {
+ return axis_h;
+}
+
+void NinePatchRect::set_v_axis_stretch_mode(AxisStretchMode p_mode) {
+
+ axis_v = p_mode;
+ update();
+}
+
+NinePatchRect::AxisStretchMode NinePatchRect::get_v_axis_stretch_mode() const {
+
+ return axis_v;
+}
+
NinePatchRect::NinePatchRect() {
margin[MARGIN_LEFT] = 0;
@@ -172,6 +191,9 @@ NinePatchRect::NinePatchRect() {
set_mouse_filter(MOUSE_FILTER_IGNORE);
draw_center = true;
+
+ axis_h = AXIS_STRETCH_MODE_STRETCH;
+ axis_v = AXIS_STRETCH_MODE_STRETCH;
}
NinePatchRect::~NinePatchRect() {
diff --git a/scene/gui/patch_9_rect.h b/scene/gui/patch_9_rect.h
index 09663e62f6..636b9127e7 100644
--- a/scene/gui/patch_9_rect.h
+++ b/scene/gui/patch_9_rect.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,11 +38,20 @@ class NinePatchRect : public Control {
GDCLASS(NinePatchRect, Control);
+public:
+ enum AxisStretchMode {
+ AXIS_STRETCH_MODE_STRETCH,
+ AXIS_STRETCH_MODE_TILE,
+ AXIS_STRETCH_MODE_TILE_FIT,
+ };
+
bool draw_center;
int margin[4];
Rect2 region_rect;
Ref<Texture> texture;
+ AxisStretchMode axis_h, axis_v;
+
protected:
void _notification(int p_what);
virtual Size2 get_minimum_size() const;
@@ -57,10 +67,18 @@ public:
void set_region_rect(const Rect2 &p_region_rect);
Rect2 get_region_rect() const;
- void set_draw_center(bool p_enable);
+ void set_draw_center(bool p_draw);
bool get_draw_center() const;
+ void set_h_axis_stretch_mode(AxisStretchMode p_mode);
+ AxisStretchMode get_h_axis_stretch_mode() const;
+
+ void set_v_axis_stretch_mode(AxisStretchMode p_mode);
+ AxisStretchMode get_v_axis_stretch_mode() const;
+
NinePatchRect();
~NinePatchRect();
};
+
+VARIANT_ENUM_CAST(NinePatchRect::AxisStretchMode)
#endif // PATCH_9_FRAME_H
diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp
index 52ad37e9ab..f2ba6bfbc4 100644
--- a/scene/gui/popup.cpp
+++ b/scene/gui/popup.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,7 @@
#include "popup.h"
#include "os/keyboard.h"
-void Popup::_gui_input(InputEvent p_event) {
+void Popup::_gui_input(Ref<InputEvent> p_event) {
}
void Popup::_notification(int p_what) {
@@ -57,12 +58,12 @@ void Popup::_notification(int p_what) {
void Popup::_fix_size() {
#if 0
- Point2 pos = get_pos();
+ Point2 pos = get_position();
Size2 size = get_size();
Point2 window_size = window==this ? get_parent_area_size() :window->get_size();
#else
- Point2 pos = get_global_pos();
+ Point2 pos = get_global_position();
Size2 size = get_size();
Point2 window_size = get_viewport_rect().size;
@@ -78,10 +79,10 @@ void Popup::_fix_size() {
pos.y = 0;
#if 0
if (pos!=get_pos())
- set_pos(pos);
+ set_position(pos);
#else
- if (pos != get_pos())
- set_global_pos(pos);
+ if (pos != get_position())
+ set_global_position(pos);
#endif
}
@@ -107,13 +108,10 @@ void Popup::set_as_minsize() {
float margin_begin = c->get_margin(m_beg);
float margin_end = c->get_margin(m_end);
- AnchorType anchor_begin = c->get_anchor(m_beg);
- AnchorType anchor_end = c->get_anchor(m_end);
+ float anchor_begin = c->get_anchor(m_beg);
+ float anchor_end = c->get_anchor(m_end);
- if (anchor_begin == ANCHOR_BEGIN)
- minsize[j] += margin_begin;
- if (anchor_end == ANCHOR_END)
- minsize[j] += margin_end;
+ minsize[j] += margin_begin * (ANCHOR_END - anchor_begin) + margin_end * anchor_end;
}
total_minsize.width = MAX(total_minsize.width, minsize.width);
@@ -144,13 +142,10 @@ void Popup::popup_centered_minsize(const Size2 &p_minsize) {
float margin_begin = c->get_margin(m_beg);
float margin_end = c->get_margin(m_end);
- AnchorType anchor_begin = c->get_anchor(m_beg);
- AnchorType anchor_end = c->get_anchor(m_end);
+ float anchor_begin = c->get_anchor(m_beg);
+ float anchor_end = c->get_anchor(m_end);
- if (anchor_begin == ANCHOR_BEGIN)
- minsize[j] += margin_begin;
- if (anchor_end == ANCHOR_END)
- minsize[j] += margin_end;
+ minsize[j] += margin_begin * (ANCHOR_END - anchor_begin) + margin_end * anchor_end;
}
total_minsize.width = MAX(total_minsize.width, minsize.width);
@@ -169,8 +164,8 @@ void Popup::popup_centered(const Size2 &p_size) {
Rect2 rect;
rect.size = p_size == Size2() ? get_size() : p_size;
- rect.pos = ((window_size - rect.size) / 2.0).floor();
- set_pos(rect.pos);
+ rect.position = ((window_size - rect.size) / 2.0).floor();
+ set_position(rect.position);
set_size(rect.size);
show_modal(exclusive);
@@ -192,8 +187,8 @@ void Popup::popup_centered_ratio(float p_screen_ratio) {
Rect2 rect;
Point2 window_size = get_viewport_rect().size;
rect.size = (window_size * p_screen_ratio).floor();
- rect.pos = ((window_size - rect.size) / 2.0).floor();
- set_pos(rect.pos);
+ rect.position = ((window_size - rect.size) / 2.0).floor();
+ set_position(rect.position);
set_size(rect.size);
show_modal(exclusive);
@@ -208,15 +203,15 @@ void Popup::popup_centered_ratio(float p_screen_ratio) {
popped_up = true;
}
-void Popup::popup(const Rect2 &bounds) {
+void Popup::popup(const Rect2 &p_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);
+ if (!p_bounds.has_no_area()) {
+ set_position(p_bounds.position);
+ set_size(p_bounds.size);
}
_fix_size();
diff --git a/scene/gui/popup.h b/scene/gui/popup.h
index d80daaad10..0543ae1937 100644
--- a/scene/gui/popup.h
+++ b/scene/gui/popup.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -44,7 +45,7 @@ class Popup : public Control {
protected:
virtual void _post_popup() {}
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
void _notification(int p_what);
virtual void _fix_size();
static void _bind_methods();
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index a2a670fa1f..46aa0e5054 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -107,6 +108,11 @@ Size2 PopupMenu::get_minimum_size() const {
accel_max_w = MAX(accel_w, accel_max_w);
}
+ if (items[i].submenu != "") {
+
+ size.width += get_icon("submenu")->get_width();
+ }
+
minsize.height += size.height;
max_w = MAX(max_w, size.width);
}
@@ -168,7 +174,7 @@ void PopupMenu::_activate_submenu(int over) {
if (pm->is_visible_in_tree())
return; //already visible!
- Point2 p = get_global_pos();
+ Point2 p = get_global_position();
Rect2 pr(p, get_size());
Ref<StyleBox> style = get_stylebox("panel");
@@ -178,18 +184,18 @@ void PopupMenu::_activate_submenu(int over) {
if (pos.x + size.width > get_viewport_rect().size.width)
pos.x = p.x - size.width;
- pm->set_pos(pos);
+ pm->set_position(pos);
pm->popup();
PopupMenu *pum = pm->cast_to<PopupMenu>();
if (pum) {
- pr.pos -= pum->get_global_pos();
+ pr.position -= pum->get_global_position();
pum->clear_autohide_areas();
- pum->add_autohide_area(Rect2(pr.pos.x, pr.pos.y, pr.size.x, items[over]._ofs_cache));
+ pum->add_autohide_area(Rect2(pr.position.x, pr.position.y, pr.size.x, items[over]._ofs_cache));
if (over < items.size() - 1) {
int from = items[over + 1]._ofs_cache;
- pum->add_autohide_area(Rect2(pr.pos.x, pr.pos.y + from, pr.size.x, pr.size.y - from));
+ pum->add_autohide_area(Rect2(pr.position.x, pr.position.y + from, pr.size.x, pr.size.y - from));
}
}
}
@@ -202,171 +208,170 @@ void PopupMenu::_submenu_timeout() {
}
}
-void PopupMenu::_gui_input(const InputEvent &p_event) {
+void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) {
- switch (p_event.type) {
+ Ref<InputEventKey> k = p_event;
- case InputEvent::KEY: {
+ if (k.is_valid()) {
- if (!p_event.key.pressed)
- break;
+ if (!k->is_pressed())
+ return;
- switch (p_event.key.scancode) {
+ switch (k->get_scancode()) {
- case KEY_DOWN: {
+ case KEY_DOWN: {
- for (int i = mouse_over + 1; i < items.size(); i++) {
+ for (int i = mouse_over + 1; i < items.size(); i++) {
- if (i < 0 || i >= items.size())
- continue;
+ if (i < 0 || i >= items.size())
+ continue;
- if (!items[i].separator && !items[i].disabled) {
+ if (!items[i].separator && !items[i].disabled) {
- mouse_over = i;
- update();
- break;
- }
+ mouse_over = i;
+ update();
+ break;
}
- } break;
- case KEY_UP: {
+ }
+ } break;
+ case KEY_UP: {
- for (int i = mouse_over - 1; i >= 0; i--) {
+ for (int i = mouse_over - 1; i >= 0; i--) {
- if (i < 0 || i >= items.size())
- continue;
+ if (i < 0 || i >= items.size())
+ continue;
- if (!items[i].separator && !items[i].disabled) {
+ if (!items[i].separator && !items[i].disabled) {
- mouse_over = i;
- update();
- break;
- }
+ mouse_over = i;
+ update();
+ break;
}
- } break;
- case KEY_RETURN:
- case KEY_ENTER: {
+ }
+ } break;
+ case KEY_ENTER:
+ case KEY_KP_ENTER: {
- if (mouse_over >= 0 && mouse_over < items.size() && !items[mouse_over].separator) {
+ if (mouse_over >= 0 && mouse_over < items.size() && !items[mouse_over].separator) {
- activate_item(mouse_over);
- }
- } break;
- }
+ activate_item(mouse_over);
+ }
+ } break;
+ }
+ }
- } break;
+ Ref<InputEventMouseButton> b = p_event;
- case InputEvent::MOUSE_BUTTON: {
+ if (b.is_valid()) {
- const InputEventMouseButton &b = p_event.mouse_button;
- if (b.pressed)
- break;
+ if (b->is_pressed())
+ return;
- switch (b.button_index) {
+ switch (b->get_button_index()) {
- case BUTTON_WHEEL_DOWN: {
+ case BUTTON_WHEEL_DOWN: {
- if (get_global_pos().y + get_size().y > get_viewport_rect().size.y) {
+ if (get_global_position().y + get_size().y > get_viewport_rect().size.y) {
- int vseparation = get_constant("vseparation");
- Ref<Font> font = get_font("font");
+ int vseparation = get_constant("vseparation");
+ Ref<Font> font = get_font("font");
- Point2 pos = get_pos();
- int s = (vseparation + font->get_height()) * 3;
- pos.y -= s;
- set_pos(pos);
+ Point2 pos = get_position();
+ int s = (vseparation + font->get_height()) * 3;
+ pos.y -= (s * b->get_factor());
+ set_position(pos);
- //update hover
- InputEvent ie;
- ie.type = InputEvent::MOUSE_MOTION;
- ie.mouse_motion.x = b.x;
- ie.mouse_motion.y = b.y + s;
- _gui_input(ie);
- }
- } break;
- case BUTTON_WHEEL_UP: {
+ //update hover
+ Ref<InputEventMouseMotion> ie;
+ ie.instance();
+ ie->set_position(b->get_position() + Vector2(0, s));
+ _gui_input(ie);
+ }
+ } break;
+ case BUTTON_WHEEL_UP: {
- if (get_global_pos().y < 0) {
+ if (get_global_position().y < 0) {
- int vseparation = get_constant("vseparation");
- Ref<Font> font = get_font("font");
+ int vseparation = get_constant("vseparation");
+ Ref<Font> font = get_font("font");
- Point2 pos = get_pos();
- int s = (vseparation + font->get_height()) * 3;
- pos.y += s;
- set_pos(pos);
+ Point2 pos = get_position();
+ int s = (vseparation + font->get_height()) * 3;
+ pos.y += (s * b->get_factor());
+ set_position(pos);
- //update hover
- InputEvent ie;
- ie.type = InputEvent::MOUSE_MOTION;
- ie.mouse_motion.x = b.x;
- ie.mouse_motion.y = b.y - s;
- _gui_input(ie);
- }
- } break;
- case BUTTON_LEFT: {
+ //update hover
+ Ref<InputEventMouseMotion> ie;
+ ie.instance();
+ ie->set_position(b->get_position() - Vector2(0, s));
+ _gui_input(ie);
+ }
+ } break;
+ case BUTTON_LEFT: {
- int over = _get_mouse_over(Point2(b.x, b.y));
+ int over = _get_mouse_over(b->get_position());
- if (invalidated_click) {
- invalidated_click = false;
- break;
- }
- if (over < 0) {
- hide();
- break; //non-activable
- }
+ if (invalidated_click) {
+ invalidated_click = false;
+ break;
+ }
+ if (over < 0) {
+ hide();
+ break; //non-activable
+ }
- if (items[over].separator || items[over].disabled)
- break;
+ if (items[over].separator || items[over].disabled)
+ break;
- if (items[over].submenu != "") {
+ if (items[over].submenu != "") {
- _activate_submenu(over);
- return;
- }
- activate_item(over);
+ _activate_submenu(over);
+ return;
+ }
+ activate_item(over);
- } break;
- }
+ } break;
+ }
- //update();
- } break;
- case InputEvent::MOUSE_MOTION: {
+ //update();
+ }
- if (invalidated_click) {
- moved += Vector2(p_event.mouse_motion.relative_x, p_event.mouse_motion.relative_y);
- if (moved.length() > 4)
- invalidated_click = false;
- }
+ Ref<InputEventMouseMotion> m = p_event;
- const InputEventMouseMotion &m = p_event.mouse_motion;
- for (List<Rect2>::Element *E = autohide_areas.front(); E; E = E->next()) {
+ if (m.is_valid()) {
- if (!Rect2(Point2(), get_size()).has_point(Point2(m.x, m.y)) && E->get().has_point(Point2(m.x, m.y))) {
- call_deferred("hide");
- return;
- }
- }
+ if (invalidated_click) {
+ moved += m->get_relative();
+ if (moved.length() > 4)
+ invalidated_click = false;
+ }
- int over = _get_mouse_over(Point2(m.x, m.y));
- int id = (over < 0 || items[over].separator || items[over].disabled) ? -1 : (items[over].ID >= 0 ? items[over].ID : over);
+ for (List<Rect2>::Element *E = autohide_areas.front(); E; E = E->next()) {
- if (id < 0) {
- mouse_over = -1;
- update();
- break;
+ if (!Rect2(Point2(), get_size()).has_point(m->get_position()) && E->get().has_point(m->get_position())) {
+ call_deferred("hide");
+ return;
}
+ }
- if (items[over].submenu != "" && submenu_over != over) {
- submenu_over = over;
- submenu_timer->start();
- }
+ int over = _get_mouse_over(m->get_position());
+ int id = (over < 0 || items[over].separator || items[over].disabled) ? -1 : (items[over].ID >= 0 ? items[over].ID : over);
- if (over != mouse_over) {
- mouse_over = over;
- update();
- }
- } break;
+ if (id < 0) {
+ mouse_over = -1;
+ update();
+ return;
+ }
+
+ if (items[over].submenu != "" && submenu_over != over) {
+ submenu_over = over;
+ submenu_timer->start();
+ }
+
+ if (over != mouse_over) {
+ mouse_over = over;
+ update();
+ }
}
}
@@ -642,7 +647,7 @@ void PopupMenu::set_item_checked(int p_idx, bool p_checked) {
update();
}
-void PopupMenu::set_item_ID(int p_idx, int p_ID) {
+void PopupMenu::set_item_id(int p_idx, int p_ID) {
ERR_FAIL_INDEX(p_idx, items.size());
items[p_idx].ID = p_ID;
@@ -691,6 +696,17 @@ String PopupMenu::get_item_text(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, items.size(), "");
return items[p_idx].text;
}
+
+int PopupMenu::get_item_idx_from_text(const String &text) const {
+
+ for (int idx = 0; idx < items.size(); idx++) {
+ if (items[idx].text == text)
+ return idx;
+ }
+
+ return -1;
+}
+
Ref<Texture> PopupMenu::get_item_icon(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, items.size(), Ref<Texture>());
@@ -721,7 +737,7 @@ bool PopupMenu::is_item_checked(int p_idx) const {
return items[p_idx].checked;
}
-int PopupMenu::get_item_ID(int p_idx) const {
+int PopupMenu::get_item_id(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, items.size(), 0);
return items[p_idx].ID;
@@ -814,20 +830,22 @@ int PopupMenu::get_item_count() const {
return items.size();
}
-bool PopupMenu::activate_item_by_event(const InputEvent &p_event, bool p_for_global_only) {
+bool PopupMenu::activate_item_by_event(const Ref<InputEvent> &p_event, bool p_for_global_only) {
uint32_t code = 0;
- if (p_event.type == InputEvent::KEY) {
- code = p_event.key.scancode;
+ Ref<InputEventKey> k = p_event;
+
+ if (k.is_valid()) {
+ code = k->get_scancode();
if (code == 0)
- code = p_event.key.unicode;
- if (p_event.key.mod.control)
+ code = k->get_unicode();
+ if (k->get_control())
code |= KEY_MASK_CTRL;
- if (p_event.key.mod.alt)
+ if (k->get_alt())
code |= KEY_MASK_ALT;
- if (p_event.key.mod.meta)
+ if (k->get_metakey())
code |= KEY_MASK_META;
- if (p_event.key.mod.shift)
+ if (k->get_shift())
code |= KEY_MASK_SHIFT;
}
@@ -877,7 +895,7 @@ void PopupMenu::activate_item(int p_item) {
while (pop) {
// We close all parents that are chained together,
// with hide_on_item_selection enabled
- if (hide_on_item_selection && pop->is_hide_on_item_selection()) {
+ if ((items[p_item].checkable && hide_on_checkable_item_selection && pop->is_hide_on_checkable_item_selection()) || (!items[p_item].checkable && hide_on_item_selection && pop->is_hide_on_item_selection())) {
pop->hide();
next = next->get_parent();
pop = next->cast_to<PopupMenu>();
@@ -888,8 +906,8 @@ void PopupMenu::activate_item(int p_item) {
}
}
// Hides popup by default; unless otherwise specified
- // by using set_hide_on_item_selection
- if (hide_on_item_selection) {
+ // by using set_hide_on_item_selection and set_hide_on_checkable_item_selection
+ if ((items[p_item].checkable && hide_on_checkable_item_selection) || (!items[p_item].checkable && hide_on_item_selection)) {
hide();
}
}
@@ -938,7 +956,7 @@ Array PopupMenu::_get_items() const {
items.push_back(is_item_checked(i));
items.push_back(is_item_disabled(i));
- items.push_back(get_item_ID(i));
+ items.push_back(get_item_id(i));
items.push_back(get_item_accelerator(i));
items.push_back(get_item_metadata(i));
items.push_back(get_item_submenu(i));
@@ -993,7 +1011,7 @@ void PopupMenu::_set_items(const Array &p_items) {
set_item_as_checkable(idx, checkable);
set_item_checked(idx, checked);
set_item_disabled(idx, disabled);
- set_item_ID(idx, id);
+ set_item_id(idx, id);
set_item_metadata(idx, meta);
set_item_as_separator(idx, sep);
set_item_accelerator(idx, accel);
@@ -1012,6 +1030,16 @@ bool PopupMenu::is_hide_on_item_selection() {
return hide_on_item_selection;
}
+void PopupMenu::set_hide_on_checkable_item_selection(bool p_enabled) {
+
+ hide_on_checkable_item_selection = p_enabled;
+}
+
+bool PopupMenu::is_hide_on_checkable_item_selection() {
+
+ return hide_on_checkable_item_selection;
+}
+
String PopupMenu::get_tooltip(const Point2 &p_pos) const {
int over = _get_mouse_over(p_pos);
@@ -1053,15 +1081,15 @@ void PopupMenu::_bind_methods() {
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("add_icon_shortcut", "texture", "shortcut", "id", "global"), &PopupMenu::add_icon_shortcut, DEFVAL(-1), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("add_shortcut", "shortcut", "id", "global"), &PopupMenu::add_shortcut, DEFVAL(-1), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("add_icon_check_shortcut", "texture", "shortcut", "id", "global"), &PopupMenu::add_icon_check_shortcut, DEFVAL(-1), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("add_check_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_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);
@@ -1069,14 +1097,14 @@ void PopupMenu::_bind_methods() {
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("set_item_shortcut", "idx", "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_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);
@@ -1085,7 +1113,7 @@ void PopupMenu::_bind_methods() {
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_shortcut", "idx"), &PopupMenu::get_item_shortcut);
ClassDB::bind_method(D_METHOD("get_item_count"), &PopupMenu::get_item_count);
@@ -1100,10 +1128,14 @@ void PopupMenu::_bind_methods() {
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("set_hide_on_checkable_item_selection", "enable"), &PopupMenu::set_hide_on_checkable_item_selection);
+ ClassDB::bind_method(D_METHOD("is_hide_on_checkable_item_selection"), &PopupMenu::is_hide_on_checkable_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_PROPERTYNO(PropertyInfo(Variant::BOOL, "hide_on_checkable_item_selection"), "set_hide_on_checkable_item_selection", "is_hide_on_checkable_item_selection");
ADD_SIGNAL(MethodInfo("id_pressed", PropertyInfo(Variant::INT, "ID")));
ADD_SIGNAL(MethodInfo("index_pressed", PropertyInfo(Variant::INT, "index")));
@@ -1121,6 +1153,7 @@ PopupMenu::PopupMenu() {
set_focus_mode(FOCUS_ALL);
set_as_toplevel(true);
set_hide_on_item_selection(true);
+ set_hide_on_checkable_item_selection(true);
submenu_timer = memnew(Timer);
submenu_timer->set_wait_time(0.3);
diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h
index 186d40f6d3..37714ee989 100644
--- a/scene/gui/popup_menu.h
+++ b/scene/gui/popup_menu.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -78,12 +79,13 @@ class PopupMenu : public Popup {
String _get_accel_text(int p_item) const;
int _get_mouse_over(const Point2 &p_over) const;
virtual Size2 get_minimum_size() const;
- void _gui_input(const InputEvent &p_event);
+ void _gui_input(const Ref<InputEvent> &p_event);
void _activate_submenu(int over);
void _submenu_timeout();
bool invalidated_click;
bool hide_on_item_selection;
+ bool hide_on_checkable_item_selection;
Vector2 moved;
Array _get_items() const;
@@ -116,7 +118,7 @@ public:
void set_item_text(int p_idx, const String &p_text);
void set_item_icon(int p_idx, const Ref<Texture> &p_icon);
void set_item_checked(int p_idx, bool p_checked);
- void set_item_ID(int p_idx, int p_ID);
+ void set_item_id(int p_idx, int p_ID);
void set_item_accelerator(int p_idx, uint32_t p_accel);
void set_item_metadata(int p_idx, const Variant &p_meta);
void set_item_disabled(int p_idx, bool p_disabled);
@@ -130,14 +132,15 @@ public:
void toggle_item_checked(int p_idx);
String get_item_text(int p_idx) const;
+ int get_item_idx_from_text(const String &text) const;
Ref<Texture> get_item_icon(int p_idx) const;
bool is_item_checked(int p_idx) const;
- int get_item_ID(int p_idx) const;
+ int get_item_id(int p_idx) const;
int get_item_index(int p_ID) const;
uint32_t get_item_accelerator(int p_idx) const;
Variant get_item_metadata(int p_idx) const;
bool is_item_disabled(int p_idx) const;
- String get_item_submenu(int p_ID) const;
+ String get_item_submenu(int p_idx) const;
bool is_item_separator(int p_idx) const;
bool is_item_checkable(int p_idx) const;
String get_item_tooltip(int p_idx) const;
@@ -145,7 +148,7 @@ public:
int get_item_count() const;
- bool activate_item_by_event(const InputEvent &p_event, bool p_for_global_only = false);
+ bool activate_item_by_event(const Ref<InputEvent> &p_event, bool p_for_global_only = false);
void activate_item(int p_item);
void remove_item(int p_idx);
@@ -167,6 +170,9 @@ public:
void set_hide_on_item_selection(bool p_enabled);
bool is_hide_on_item_selection();
+ void set_hide_on_checkable_item_selection(bool p_enabled);
+ bool is_hide_on_checkable_item_selection();
+
PopupMenu();
~PopupMenu();
};
diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp
index 86dea6cd96..13d368d253 100644
--- a/scene/gui/progress_bar.cpp
+++ b/scene/gui/progress_bar.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/progress_bar.h b/scene/gui/progress_bar.h
index b5820d1682..1121a78aab 100644
--- a/scene/gui/progress_bar.h
+++ b/scene/gui/progress_bar.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp
index f15f3a6078..68afe8150a 100644
--- a/scene/gui/range.cpp
+++ b/scene/gui/range.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,7 +34,7 @@ void Range::_value_changed_notify() {
_value_changed(shared->val);
emit_signal("value_changed", shared->val);
update();
- _change_notify("range/value");
+ _change_notify("value");
}
void Range::Shared::emit_value_changed() {
@@ -87,26 +88,26 @@ void Range::set_min(double p_min) {
shared->min = p_min;
set_value(shared->val);
- shared->emit_changed("range/min");
+ shared->emit_changed("min");
}
void Range::set_max(double p_max) {
shared->max = p_max;
set_value(shared->val);
- shared->emit_changed("range/max");
+ shared->emit_changed("max");
}
void Range::set_step(double p_step) {
shared->step = p_step;
- shared->emit_changed("range/step");
+ shared->emit_changed("step");
}
void Range::set_page(double p_page) {
shared->page = p_page;
set_value(shared->val);
- shared->emit_changed("range/page");
+ shared->emit_changed("page");
}
double Range::get_value() const {
@@ -272,8 +273,8 @@ Range::Range() {
shared = memnew(Shared);
shared->min = 0;
shared->max = 100;
- shared->val =
- shared->step = 1;
+ shared->val = 0;
+ shared->step = 1;
shared->page = 0;
shared->owners.insert(this);
shared->exp_ratio = false;
diff --git a/scene/gui/range.h b/scene/gui/range.h
index 105bd08a4f..fdcbbb09ee 100644
--- a/scene/gui/range.h
+++ b/scene/gui/range.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/reference_rect.cpp b/scene/gui/reference_rect.cpp
index cc38b896d9..400ff299a9 100644
--- a/scene/gui/reference_rect.cpp
+++ b/scene/gui/reference_rect.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/reference_rect.h b/scene/gui/reference_rect.h
index b64f479829..b118425eb6 100644
--- a/scene/gui/reference_rect.h
+++ b/scene/gui/reference_rect.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index eaa2a66a56..42084ade25 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -593,7 +594,7 @@ void RichTextLabel::_update_scroll() {
main->first_invalid_line = 0;
scroll_w = vscroll->get_combined_minimum_size().width;
vscroll->show();
- vscroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, scroll_w);
+ vscroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -scroll_w);
_validate_line_caches(main);
} else {
@@ -733,158 +734,155 @@ Control::CursorShape RichTextLabel::get_cursor_shape(const Point2 &p_pos) const
return CURSOR_ARROW;
}
-void RichTextLabel::_gui_input(InputEvent p_event) {
+void RichTextLabel::_gui_input(Ref<InputEvent> p_event) {
- switch (p_event.type) {
+ Ref<InputEventMouseButton> b = p_event;
- case InputEvent::MOUSE_BUTTON: {
-
- if (main->first_invalid_line < main->lines.size())
- return;
-
- const InputEventMouseButton &b = p_event.mouse_button;
+ if (b.is_valid()) {
+ if (main->first_invalid_line < main->lines.size())
+ return;
- if (b.button_index == BUTTON_LEFT) {
+ if (b->get_button_index() == BUTTON_LEFT) {
- if (true) {
+ if (true) {
- if (b.pressed && !b.doubleclick) {
- int line = 0;
- Item *item = NULL;
+ if (b->is_pressed() && !b->is_doubleclick()) {
+ int line = 0;
+ Item *item = NULL;
- bool outside;
- _find_click(main, Point2i(b.x, b.y), &item, &line, &outside);
+ bool outside;
+ _find_click(main, b->get_position(), &item, &line, &outside);
- if (item) {
+ if (item) {
- Variant meta;
- if (!outside && _find_meta(item, &meta)) {
- //meta clicked
+ Variant meta;
+ if (!outside && _find_meta(item, &meta)) {
+ //meta clicked
- emit_signal("meta_clicked", meta);
- } else if (selection.enabled) {
+ emit_signal("meta_clicked", meta);
+ } else if (selection.enabled) {
- selection.click = item;
- selection.click_char = line;
- }
+ selection.click = item;
+ selection.click_char = line;
}
+ }
- } else if (!b.pressed) {
+ } else if (!b->is_pressed()) {
- selection.click = NULL;
- }
+ selection.click = NULL;
}
}
+ }
- if (b.button_index == BUTTON_WHEEL_UP) {
+ if (b->get_button_index() == BUTTON_WHEEL_UP) {
- if (scroll_active)
- vscroll->set_value(vscroll->get_value() - vscroll->get_page() / 8);
- }
- if (b.button_index == BUTTON_WHEEL_DOWN) {
+ if (scroll_active)
- if (scroll_active)
- vscroll->set_value(vscroll->get_value() + vscroll->get_page() / 8);
- }
- } break;
- case InputEvent::KEY: {
-
- const InputEventKey &k = p_event.key;
- if (k.pressed && !k.mod.alt && !k.mod.shift && !k.mod.meta) {
- bool handled = true;
- switch (k.scancode) {
- case KEY_PAGEUP: {
-
- if (vscroll->is_visible_in_tree())
- vscroll->set_value(vscroll->get_value() - vscroll->get_page());
- } break;
- case KEY_PAGEDOWN: {
-
- if (vscroll->is_visible_in_tree())
- vscroll->set_value(vscroll->get_value() + vscroll->get_page());
- } break;
- case KEY_UP: {
-
- if (vscroll->is_visible_in_tree())
- vscroll->set_value(vscroll->get_value() - get_font("normal_font")->get_height());
- } break;
- case KEY_DOWN: {
-
- if (vscroll->is_visible_in_tree())
- vscroll->set_value(vscroll->get_value() + get_font("normal_font")->get_height());
- } break;
- case KEY_HOME: {
-
- if (vscroll->is_visible_in_tree())
- vscroll->set_value(0);
- } break;
- case KEY_END: {
-
- if (vscroll->is_visible_in_tree())
- vscroll->set_value(vscroll->get_max());
- } break;
- case KEY_INSERT:
- case KEY_C: {
-
- if (k.mod.command) {
- selection_copy();
- } else {
- handled = false;
- }
+ vscroll->set_value(vscroll->get_value() - vscroll->get_page() * b->get_factor() * 0.5 / 8);
+ }
+ if (b->get_button_index() == BUTTON_WHEEL_DOWN) {
- } break;
- default: handled = false;
- }
+ if (scroll_active)
+
+ vscroll->set_value(vscroll->get_value() + vscroll->get_page() * b->get_factor() * 0.5 / 8);
+ }
+ }
- if (handled)
- accept_event();
+ Ref<InputEventKey> k = p_event;
+
+ if (k.is_valid()) {
+ if (k->is_pressed() && !k->get_alt() && !k->get_shift() && !k->get_metakey()) {
+ bool handled = true;
+ switch (k->get_scancode()) {
+ case KEY_PAGEUP: {
+
+ if (vscroll->is_visible_in_tree())
+ vscroll->set_value(vscroll->get_value() - vscroll->get_page());
+ } break;
+ case KEY_PAGEDOWN: {
+
+ if (vscroll->is_visible_in_tree())
+ vscroll->set_value(vscroll->get_value() + vscroll->get_page());
+ } break;
+ case KEY_UP: {
+
+ if (vscroll->is_visible_in_tree())
+ vscroll->set_value(vscroll->get_value() - get_font("normal_font")->get_height());
+ } break;
+ case KEY_DOWN: {
+
+ if (vscroll->is_visible_in_tree())
+ vscroll->set_value(vscroll->get_value() + get_font("normal_font")->get_height());
+ } break;
+ case KEY_HOME: {
+
+ if (vscroll->is_visible_in_tree())
+ vscroll->set_value(0);
+ } break;
+ case KEY_END: {
+
+ if (vscroll->is_visible_in_tree())
+ vscroll->set_value(vscroll->get_max());
+ } break;
+ case KEY_INSERT:
+ case KEY_C: {
+
+ if (k->get_command()) {
+ selection_copy();
+ } else {
+ handled = false;
+ }
+
+ } break;
+ default: handled = false;
}
- } break;
- case InputEvent::MOUSE_MOTION: {
+ if (handled)
+ accept_event();
+ }
+ }
- if (main->first_invalid_line < main->lines.size())
- return;
+ Ref<InputEventMouseMotion> m = p_event;
- const InputEventMouseMotion &m = p_event.mouse_motion;
+ if (m.is_valid()) {
+ if (main->first_invalid_line < main->lines.size())
+ return;
- if (selection.click) {
+ if (selection.click) {
- int line = 0;
- Item *item = NULL;
- _find_click(main, Point2i(m.x, m.y), &item, &line);
- if (!item)
- return; // do not update
+ int line = 0;
+ Item *item = NULL;
+ _find_click(main, m->get_position(), &item, &line);
+ if (!item)
+ return; // do not update
- selection.from = selection.click;
- selection.from_char = selection.click_char;
+ selection.from = selection.click;
+ selection.from_char = selection.click_char;
- selection.to = item;
- selection.to_char = line;
+ selection.to = item;
+ selection.to_char = line;
- bool swap = false;
- if (selection.from->index > selection.to->index)
+ bool swap = false;
+ if (selection.from->index > selection.to->index)
+ swap = true;
+ else if (selection.from->index == selection.to->index) {
+ if (selection.from_char > selection.to_char)
swap = true;
- else if (selection.from->index == selection.to->index) {
- if (selection.from_char > selection.to_char)
- swap = true;
- else if (selection.from_char == selection.to_char) {
+ else if (selection.from_char == selection.to_char) {
- selection.active = false;
- return;
- }
- }
-
- if (swap) {
- SWAP(selection.from, selection.to);
- SWAP(selection.from_char, selection.to_char);
+ selection.active = false;
+ return;
}
+ }
- selection.active = true;
- update();
+ if (swap) {
+ SWAP(selection.from, selection.to);
+ SWAP(selection.from_char, selection.to_char);
}
- } break;
+ selection.active = true;
+ update();
+ }
}
}
@@ -1824,15 +1822,40 @@ String RichTextLabel::get_text() {
return text;
}
+void RichTextLabel::set_text(const String &p_string) {
+ clear();
+ add_text(p_string);
+}
+
+void RichTextLabel::set_percent_visible(float p_percent) {
+
+ if (p_percent < 0 || p_percent >= 1) {
+
+ visible_characters = -1;
+ percent_visible = 1;
+
+ } else {
+
+ visible_characters = get_total_character_count() * p_percent;
+ percent_visible = p_percent;
+ }
+ update();
+}
+
+float RichTextLabel::get_percent_visible() const {
+ return percent_visible;
+}
+
void RichTextLabel::_bind_methods() {
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("set_text", "text"), &RichTextLabel::set_text);
+ ClassDB::bind_method(D_METHOD("add_image", "image"), &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("remove_line", "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);
@@ -1875,6 +1898,9 @@ void RichTextLabel::_bind_methods() {
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(D_METHOD("set_percent_visible", "percent_visible"), &RichTextLabel::set_percent_visible);
+ ClassDB::bind_method(D_METHOD("get_percent_visible"), &RichTextLabel::get_percent_visible);
+
ClassDB::bind_method(D_METHOD("get_total_character_count"), &RichTextLabel::get_total_character_count);
ClassDB::bind_method(D_METHOD("set_use_bbcode", "enable"), &RichTextLabel::set_use_bbcode);
@@ -1883,7 +1909,9 @@ void RichTextLabel::_bind_methods() {
ADD_GROUP("BBCode", "bbcode_");
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_PROPERTY(PropertyInfo(Variant::REAL, "percent_visible", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_percent_visible", "get_percent_visible");
ADD_SIGNAL(MethodInfo("meta_clicked", PropertyInfo(Variant::NIL, "meta")));
@@ -1916,7 +1944,6 @@ void RichTextLabel::set_visible_characters(int p_visible) {
}
int RichTextLabel::get_visible_characters() const {
-
return visible_characters;
}
int RichTextLabel::get_total_character_count() const {
@@ -1966,11 +1993,11 @@ RichTextLabel::RichTextLabel() {
selection.enabled = false;
visible_characters = -1;
+ percent_visible = 1;
set_clip_contents(true);
}
RichTextLabel::~RichTextLabel() {
-
memdelete(main);
}
diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h
index a5f23d0ba9..71fa766958 100644
--- a/scene/gui/rich_text_label.h
+++ b/scene/gui/rich_text_label.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -257,6 +258,7 @@ private:
Selection selection;
int visible_characters;
+ float percent_visible;
void _process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &y, int p_width, int p_line, ProcessMode p_mode, const Ref<Font> &p_base_font, const Color &p_base_color, const Point2i &p_click_pos = Point2i(), Item **r_click_item = NULL, int *r_click_char = NULL, bool *r_outside = NULL, int p_char_count = 0);
void _find_click(ItemFrame *p_frame, const Point2i &p_click, Item **r_click_item = NULL, int *r_click_char = NULL, bool *r_outside = NULL);
@@ -271,7 +273,7 @@ private:
void _update_scroll();
void _scroll_changed(double);
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
Item *_get_next_item(Item *p_item, bool p_free = false);
bool use_bbcode;
@@ -294,7 +296,7 @@ public:
void push_align(Align p_align);
void push_indent(int p_level);
void push_list(ListType p_list);
- void push_meta(const Variant &p_data);
+ void push_meta(const Variant &p_meta);
void push_table(int p_columns);
void set_table_column_expand(int p_column, bool p_expand, int p_ratio = 1);
int get_current_table_column() const;
@@ -339,10 +341,15 @@ public:
void set_bbcode(const String &p_bbcode);
String get_bbcode() const;
+ void set_text(const String &p_string);
+
void set_visible_characters(int p_visible);
int get_visible_characters() const;
int get_total_character_count() const;
+ void set_percent_visible(float p_percent);
+ float get_percent_visible() const;
+
RichTextLabel();
~RichTextLabel();
};
diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp
index b27104f788..2ccdbb05a9 100644
--- a/scene/gui/scroll_bar.cpp
+++ b/scene/gui/scroll_bar.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,191 +38,188 @@ void ScrollBar::set_can_focus_by_default(bool p_can_focus) {
focus_by_default = p_can_focus;
}
-void ScrollBar::_gui_input(InputEvent p_event) {
+void ScrollBar::_gui_input(Ref<InputEvent> p_event) {
- switch (p_event.type) {
+ Ref<InputEventMouseButton> b = p_event;
- case InputEvent::MOUSE_BUTTON: {
+ if (b.is_valid()) {
+ accept_event();
- const InputEventMouseButton &b = p_event.mouse_button;
- accept_event();
-
- if (b.button_index == 5 && b.pressed) {
-
- /*
- if (orientation==VERTICAL)
- set_val( get_val() + get_page() / 4.0 );
- else
- */
- set_value(get_value() + get_page() / 4.0);
- accept_event();
- }
-
- if (b.button_index == 4 && b.pressed) {
+ if (b->get_button_index() == 5 && b->is_pressed()) {
- /*
- if (orientation==HORIZONTAL)
- set_val( get_val() - get_page() / 4.0 );
- else
- */
- set_value(get_value() - get_page() / 4.0);
- accept_event();
- }
+ /*
+ if (orientation==VERTICAL)
+ set_val( get_val() + get_page() / 4.0 );
+ else
+ */
+ set_value(get_value() + get_page() / 4.0);
+ accept_event();
+ }
- if (b.button_index != 1)
- return;
+ if (b->get_button_index() == 4 && b->is_pressed()) {
- if (b.pressed) {
+ /*
+ if (orientation==HORIZONTAL)
+ set_val( get_val() - get_page() / 4.0 );
+ else
+ */
+ set_value(get_value() - get_page() / 4.0);
+ accept_event();
+ }
- double ofs = orientation == VERTICAL ? b.y : b.x;
- Ref<Texture> decr = get_icon("decrement");
- Ref<Texture> incr = get_icon("increment");
+ if (b->get_button_index() != 1)
+ return;
- double decr_size = orientation == VERTICAL ? decr->get_height() : decr->get_width();
- double incr_size = orientation == VERTICAL ? incr->get_height() : incr->get_width();
- double grabber_ofs = get_grabber_offset();
- double grabber_size = get_grabber_size();
- double total = orientation == VERTICAL ? get_size().height : get_size().width;
+ if (b->is_pressed()) {
- if (ofs < decr_size) {
+ double ofs = orientation == VERTICAL ? b->get_position().y : b->get_position().x;
+ Ref<Texture> decr = get_icon("decrement");
+ Ref<Texture> incr = get_icon("increment");
- set_value(get_value() - (custom_step >= 0 ? custom_step : get_step()));
- break;
- }
+ double decr_size = orientation == VERTICAL ? decr->get_height() : decr->get_width();
+ double incr_size = orientation == VERTICAL ? incr->get_height() : incr->get_width();
+ double grabber_ofs = get_grabber_offset();
+ double grabber_size = get_grabber_size();
+ double total = orientation == VERTICAL ? get_size().height : get_size().width;
- if (ofs > total - incr_size) {
+ if (ofs < decr_size) {
- set_value(get_value() + (custom_step >= 0 ? custom_step : get_step()));
- break;
- }
+ set_value(get_value() - (custom_step >= 0 ? custom_step : get_step()));
+ return;
+ }
- ofs -= decr_size;
+ if (ofs > total - incr_size) {
- if (ofs < grabber_ofs) {
+ set_value(get_value() + (custom_step >= 0 ? custom_step : get_step()));
+ return;
+ }
- set_value(get_value() - get_page());
- break;
- }
+ ofs -= decr_size;
- ofs -= grabber_ofs;
+ if (ofs < grabber_ofs) {
- if (ofs < grabber_size) {
+ set_value(get_value() - get_page());
+ return;
+ }
- drag.active = true;
- drag.pos_at_click = grabber_ofs + ofs;
- drag.value_at_click = get_as_ratio();
- update();
- } else {
+ ofs -= grabber_ofs;
- set_value(get_value() + get_page());
- }
+ if (ofs < grabber_size) {
+ drag.active = true;
+ drag.pos_at_click = grabber_ofs + ofs;
+ drag.value_at_click = get_as_ratio();
+ update();
} else {
- drag.active = false;
- update();
+ set_value(get_value() + get_page());
}
- } break;
- case InputEvent::MOUSE_MOTION: {
+ } else {
- const InputEventMouseMotion &m = p_event.mouse_motion;
+ drag.active = false;
+ update();
+ }
+ }
- accept_event();
+ Ref<InputEventMouseMotion> m = p_event;
- if (drag.active) {
+ if (m.is_valid()) {
- double ofs = orientation == VERTICAL ? m.y : m.x;
- Ref<Texture> decr = get_icon("decrement");
+ accept_event();
- double decr_size = orientation == VERTICAL ? decr->get_height() : decr->get_width();
- ofs -= decr_size;
+ if (drag.active) {
- double diff = (ofs - drag.pos_at_click) / get_area_size();
+ double ofs = orientation == VERTICAL ? m->get_position().y : m->get_position().x;
+ Ref<Texture> decr = get_icon("decrement");
- set_as_ratio(drag.value_at_click + diff);
- } else {
+ double decr_size = orientation == VERTICAL ? decr->get_height() : decr->get_width();
+ ofs -= decr_size;
- double ofs = orientation == VERTICAL ? m.y : m.x;
- Ref<Texture> decr = get_icon("decrement");
- Ref<Texture> incr = get_icon("increment");
+ double diff = (ofs - drag.pos_at_click) / get_area_size();
- double decr_size = orientation == VERTICAL ? decr->get_height() : decr->get_width();
- double incr_size = orientation == VERTICAL ? incr->get_height() : incr->get_width();
- double total = orientation == VERTICAL ? get_size().height : get_size().width;
+ set_as_ratio(drag.value_at_click + diff);
+ } else {
- HiliteStatus new_hilite;
+ double ofs = orientation == VERTICAL ? m->get_position().y : m->get_position().x;
+ Ref<Texture> decr = get_icon("decrement");
+ Ref<Texture> incr = get_icon("increment");
- if (ofs < decr_size) {
+ double decr_size = orientation == VERTICAL ? decr->get_height() : decr->get_width();
+ double incr_size = orientation == VERTICAL ? incr->get_height() : incr->get_width();
+ double total = orientation == VERTICAL ? get_size().height : get_size().width;
- new_hilite = HILITE_DECR;
+ HighlightStatus new_hilite;
- } else if (ofs > total - incr_size) {
+ if (ofs < decr_size) {
- new_hilite = HILITE_INCR;
+ new_hilite = HIGHLIGHT_DECR;
- } else {
+ } else if (ofs > total - incr_size) {
- new_hilite = HILITE_RANGE;
- }
+ new_hilite = HIGHLIGHT_INCR;
- if (new_hilite != hilite) {
+ } else {
- hilite = new_hilite;
- update();
- }
+ new_hilite = HIGHLIGHT_RANGE;
}
- } break;
- case InputEvent::KEY: {
- const InputEventKey &k = p_event.key;
+ if (new_hilite != highlight) {
- if (!k.pressed)
- return;
+ highlight = new_hilite;
+ update();
+ }
+ }
+ }
- switch (k.scancode) {
+ Ref<InputEventKey> k = p_event;
- case KEY_LEFT: {
+ if (k.is_valid()) {
- if (orientation != HORIZONTAL)
- return;
- set_value(get_value() - (custom_step >= 0 ? custom_step : get_step()));
+ if (!k->is_pressed())
+ return;
- } break;
- case KEY_RIGHT: {
+ switch (k->get_scancode()) {
- if (orientation != HORIZONTAL)
- return;
- set_value(get_value() + (custom_step >= 0 ? custom_step : get_step()));
+ case KEY_LEFT: {
- } break;
- case KEY_UP: {
+ if (orientation != HORIZONTAL)
+ return;
+ set_value(get_value() - (custom_step >= 0 ? custom_step : get_step()));
- if (orientation != VERTICAL)
- return;
+ } break;
+ case KEY_RIGHT: {
- set_value(get_value() - (custom_step >= 0 ? custom_step : get_step()));
+ if (orientation != HORIZONTAL)
+ return;
+ set_value(get_value() + (custom_step >= 0 ? custom_step : get_step()));
- } break;
- case KEY_DOWN: {
+ } break;
+ case KEY_UP: {
- if (orientation != VERTICAL)
- return;
- set_value(get_value() + (custom_step >= 0 ? custom_step : get_step()));
+ if (orientation != VERTICAL)
+ return;
- } break;
- case KEY_HOME: {
+ set_value(get_value() - (custom_step >= 0 ? custom_step : get_step()));
- set_value(get_min());
+ } break;
+ case KEY_DOWN: {
- } break;
- case KEY_END: {
+ if (orientation != VERTICAL)
+ return;
+ set_value(get_value() + (custom_step >= 0 ? custom_step : get_step()));
- set_value(get_max());
+ } break;
+ case KEY_HOME: {
- } break;
- }
- break;
+ set_value(get_min());
+
+ } break;
+ case KEY_END: {
+
+ set_value(get_max());
+
+ } break;
}
}
}
@@ -232,10 +230,17 @@ void ScrollBar::_notification(int p_what) {
RID ci = get_canvas_item();
- Ref<Texture> decr = hilite == HILITE_DECR ? get_icon("decrement_hilite") : get_icon("decrement");
- Ref<Texture> incr = hilite == HILITE_INCR ? get_icon("increment_hilite") : get_icon("increment");
+ Ref<Texture> decr = highlight == HIGHLIGHT_DECR ? get_icon("decrement_highlight") : get_icon("decrement");
+ Ref<Texture> incr = highlight == HIGHLIGHT_INCR ? get_icon("increment_highlight") : get_icon("increment");
Ref<StyleBox> bg = has_focus() ? get_stylebox("scroll_focus") : get_stylebox("scroll");
- Ref<StyleBox> grabber = (drag.active || hilite == HILITE_RANGE) ? get_stylebox("grabber_hilite") : get_stylebox("grabber");
+
+ Ref<StyleBox> grabber;
+ if (drag.active)
+ grabber = get_stylebox("grabber_pressed");
+ else if (highlight == HIGHLIGHT_RANGE)
+ grabber = get_stylebox("grabber_highlight");
+ else
+ grabber = get_stylebox("grabber");
Point2 ofs;
@@ -269,14 +274,14 @@ void ScrollBar::_notification(int p_what) {
grabber_rect.size.width = get_grabber_size();
grabber_rect.size.height = get_size().height;
- grabber_rect.pos.y = 0;
- grabber_rect.pos.x = get_grabber_offset() + decr->get_width() + bg->get_margin(MARGIN_LEFT);
+ grabber_rect.position.y = 0;
+ grabber_rect.position.x = get_grabber_offset() + decr->get_width() + bg->get_margin(MARGIN_LEFT);
} else {
grabber_rect.size.width = get_size().width;
grabber_rect.size.height = get_grabber_size();
- grabber_rect.pos.y = get_grabber_offset() + decr->get_height() + bg->get_margin(MARGIN_TOP);
- grabber_rect.pos.x = 0;
+ grabber_rect.position.y = get_grabber_offset() + decr->get_height() + bg->get_margin(MARGIN_TOP);
+ grabber_rect.position.x = 0;
}
grabber->draw(ci, grabber_rect);
@@ -385,7 +390,7 @@ void ScrollBar::_notification(int p_what) {
if (p_what == NOTIFICATION_MOUSE_EXIT) {
- hilite = HILITE_NONE;
+ highlight = HIGHLIGHT_NONE;
update();
}
}
@@ -521,87 +526,84 @@ void ScrollBar::_drag_slave_exit() {
drag_slave = NULL;
}
-void ScrollBar::_drag_slave_input(const InputEvent &p_input) {
+void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) {
+
+ Ref<InputEventMouseButton> mb = p_input;
- switch (p_input.type) {
+ if (mb.is_valid()) {
- case InputEvent::MOUSE_BUTTON: {
+ if (mb->get_button_index() != 1)
+ return;
- const InputEventMouseButton &mb = p_input.mouse_button;
+ if (mb->is_pressed()) {
- if (mb.button_index != 1)
- break;
+ if (drag_slave_touching) {
+ set_fixed_process(false);
+ drag_slave_touching_deaccel = false;
+ drag_slave_touching = false;
+ drag_slave_speed = Vector2();
+ drag_slave_accum = Vector2();
+ last_drag_slave_accum = Vector2();
+ drag_slave_from = Vector2();
+ }
- if (mb.pressed) {
+ if (true) {
+ drag_slave_speed = Vector2();
+ drag_slave_accum = Vector2();
+ last_drag_slave_accum = Vector2();
+ //drag_slave_from=Vector2(h_scroll->get_val(),v_scroll->get_val());
+ drag_slave_from = Vector2(orientation == HORIZONTAL ? get_value() : 0, orientation == VERTICAL ? get_value() : 0);
+ drag_slave_touching = OS::get_singleton()->has_touchscreen_ui_hint();
+ drag_slave_touching_deaccel = false;
+ time_since_motion = 0;
if (drag_slave_touching) {
- set_fixed_process(false);
- drag_slave_touching_deaccel = false;
- drag_slave_touching = false;
- drag_slave_speed = Vector2();
- drag_slave_accum = Vector2();
- last_drag_slave_accum = Vector2();
- drag_slave_from = Vector2();
+ set_fixed_process(true);
+ time_since_motion = 0;
}
+ }
+
+ } else {
- if (true) {
- drag_slave_speed = Vector2();
- drag_slave_accum = Vector2();
- last_drag_slave_accum = Vector2();
- //drag_slave_from=Vector2(h_scroll->get_val(),v_scroll->get_val());
- drag_slave_from = Vector2(orientation == HORIZONTAL ? get_value() : 0, orientation == VERTICAL ? get_value() : 0);
+ if (drag_slave_touching) {
- drag_slave_touching = OS::get_singleton()->has_touchscreen_ui_hint();
+ if (drag_slave_speed == Vector2()) {
drag_slave_touching_deaccel = false;
- time_since_motion = 0;
- if (drag_slave_touching) {
- set_fixed_process(true);
- time_since_motion = 0;
- }
+ drag_slave_touching = false;
+ set_fixed_process(false);
+ } else {
+
+ drag_slave_touching_deaccel = true;
}
+ }
+ }
+ }
- } else {
+ Ref<InputEventMouseMotion> mm = p_input;
- if (drag_slave_touching) {
+ if (mm.is_valid()) {
- if (drag_slave_speed == Vector2()) {
- drag_slave_touching_deaccel = false;
- drag_slave_touching = false;
- set_fixed_process(false);
- } else {
+ if (drag_slave_touching && !drag_slave_touching_deaccel) {
- drag_slave_touching_deaccel = true;
- }
- }
- }
- } break;
- case InputEvent::MOUSE_MOTION: {
-
- const InputEventMouseMotion &mm = p_input.mouse_motion;
-
- if (drag_slave_touching && !drag_slave_touching_deaccel) {
-
- Vector2 motion = Vector2(mm.relative_x, mm.relative_y);
-
- drag_slave_accum -= motion;
- Vector2 diff = drag_slave_from + drag_slave_accum;
-
- if (orientation == HORIZONTAL)
- set_value(diff.x);
- /*
- else
- drag_slave_accum.x=0;
- */
- if (orientation == VERTICAL)
- set_value(diff.y);
- /*
- else
- drag_slave_accum.y=0;
- */
- time_since_motion = 0;
- }
+ Vector2 motion = Vector2(mm->get_relative().x, mm->get_relative().y);
- } break;
+ drag_slave_accum -= motion;
+ Vector2 diff = drag_slave_from + drag_slave_accum;
+
+ if (orientation == HORIZONTAL)
+ set_value(diff.x);
+ /*
+ else
+ drag_slave_accum.x=0;
+ */
+ if (orientation == VERTICAL)
+ set_value(diff.y);
+ /*
+ else
+ drag_slave_accum.y=0;
+ */
+ time_since_motion = 0;
+ }
}
}
@@ -639,11 +641,11 @@ NodePath ScrollBar::get_drag_slave() const {
#if 0
-void ScrollBar::mouse_button(const Point2& p_pos, int b.button_index,bool b.pressed,int p_modifier_mask) {
+void ScrollBar::mouse_button(const Point2& p_pos, int b->get_button_index(),bool b->is_pressed(),int p_modifier_mask) {
// wheel!
- if (b.button_index==BUTTON_WHEEL_UP && b.pressed) {
+ if (b->get_button_index()==BUTTON_WHEEL_UP && b->is_pressed()) {
if (orientation==VERTICAL)
set_val( get_val() - get_page() / 4.0 );
@@ -651,7 +653,7 @@ void ScrollBar::mouse_button(const Point2& p_pos, int b.button_index,bool b.pres
set_val( get_val() + get_page() / 4.0 );
}
- if (b.button_index==BUTTON_WHEEL_DOWN && b.pressed) {
+ if (b->get_button_index()==BUTTON_WHEEL_DOWN && b->is_pressed()) {
if (orientation==HORIZONTAL)
set_val( get_val() - get_page() / 4.0 );
@@ -659,10 +661,10 @@ void ScrollBar::mouse_button(const Point2& p_pos, int b.button_index,bool b.pres
set_val( get_val() + get_page() / 4.0 );
}
- if (b.button_index!=BUTTON_LEFT)
+ if (b->get_button_index()!=BUTTON_LEFT)
return;
- if (b.pressed) {
+ if (b->is_pressed()) {
int ofs = orientation==VERTICAL ? p_pos.y : p_pos.x ;
int grabber_ofs = get_grabber_offset();
@@ -691,7 +693,7 @@ void ScrollBar::mouse_button(const Point2& p_pos, int b.button_index,bool b.pres
}
}
-void ScrollBar::mouse_motion(const Point2& p_pos, const Point2& p_rel, int b.button_index_mask) {
+void ScrollBar::mouse_motion(const Point2& p_pos, const Point2& p_rel, int b->get_button_index()_mask) {
if (!drag.active)
return;
@@ -711,9 +713,9 @@ void ScrollBar::mouse_motion(const Point2& p_pos, const Point2& p_rel, int b.but
}
-bool ScrollBar::key(unsigned long p_unicode, unsigned long p_scan_code,bool b.pressed,bool p_repeat,int p_modifier_mask) {
+bool ScrollBar::key(unsigned long p_unicode, unsigned long p_scan_code,bool b->is_pressed(),bool p_repeat,int p_modifier_mask) {
- if (!b.pressed)
+ if (!b->is_pressed())
return false;
switch (p_scan_code) {
@@ -783,7 +785,7 @@ void ScrollBar::_bind_methods() {
ScrollBar::ScrollBar(Orientation p_orientation) {
orientation = p_orientation;
- hilite = HILITE_NONE;
+ highlight = HIGHLIGHT_NONE;
custom_step = -1;
drag_slave = NULL;
diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h
index 5227fa45ac..8310e12590 100644
--- a/scene/gui/scroll_bar.h
+++ b/scene/gui/scroll_bar.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,11 +39,11 @@ class ScrollBar : public Range {
GDCLASS(ScrollBar, Range);
- enum HiliteStatus {
- HILITE_NONE,
- HILITE_DECR,
- HILITE_RANGE,
- HILITE_INCR,
+ enum HighlightStatus {
+ HIGHLIGHT_NONE,
+ HIGHLIGHT_DECR,
+ HIGHLIGHT_RANGE,
+ HIGHLIGHT_INCR,
};
static bool focus_by_default;
@@ -51,7 +52,7 @@ class ScrollBar : public Range {
Size2 size;
float custom_step;
- HiliteStatus hilite;
+ HighlightStatus highlight;
struct Drag {
@@ -83,9 +84,9 @@ class ScrollBar : public Range {
bool click_handled;
void _drag_slave_exit();
- void _drag_slave_input(const InputEvent &p_input);
+ void _drag_slave_input(const Ref<InputEvent> &p_input);
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
protected:
void _notification(int p_what);
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp
index c543b783b9..939bdd8d0c 100644
--- a/scene/gui/scroll_container.cpp
+++ b/scene/gui/scroll_container.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -75,101 +76,109 @@ void ScrollContainer::_cancel_drag() {
drag_from = Vector2();
}
-void ScrollContainer::_gui_input(const InputEvent &p_gui_input) {
+void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) {
- switch (p_gui_input.type) {
+ Ref<InputEventMouseButton> mb = p_gui_input;
- case InputEvent::MOUSE_BUTTON: {
+ if (mb.is_valid()) {
- const InputEventMouseButton &mb = p_gui_input.mouse_button;
+ if (mb->get_button_index() == BUTTON_WHEEL_UP && mb->is_pressed()) {
+ // only horizontal is enabled, scroll horizontally
+ if (h_scroll->is_visible() && !v_scroll->is_visible()) {
+ h_scroll->set_value(h_scroll->get_value() - h_scroll->get_page() / 8 * mb->get_factor());
+ } else if (v_scroll->is_visible_in_tree()) {
+ v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() / 8 * mb->get_factor());
+ }
+ }
- if (mb.button_index == BUTTON_WHEEL_UP && mb.pressed) {
- if (h_scroll->is_visible_in_tree() && !v_scroll->is_visible_in_tree()) {
- // only horizontal is enabled, scroll horizontally
- h_scroll->set_value(h_scroll->get_value() - h_scroll->get_page() / 8);
- } else if (v_scroll->is_visible_in_tree()) {
- v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() / 8);
- }
+ if (mb->get_button_index() == BUTTON_WHEEL_DOWN && mb->is_pressed()) {
+ // only horizontal is enabled, scroll horizontally
+ if (h_scroll->is_visible() && !v_scroll->is_visible()) {
+ h_scroll->set_value(h_scroll->get_value() + h_scroll->get_page() / 8 * mb->get_factor());
+ } else if (v_scroll->is_visible()) {
+ v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() / 8 * mb->get_factor());
}
+ }
- if (mb.button_index == BUTTON_WHEEL_DOWN && mb.pressed) {
- if (h_scroll->is_visible_in_tree() && !v_scroll->is_visible_in_tree()) {
- // only horizontal is enabled, scroll horizontally
- h_scroll->set_value(h_scroll->get_value() + h_scroll->get_page() / 8);
- } else if (v_scroll->is_visible_in_tree()) {
- v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() / 8);
- }
+ if (mb->get_button_index() == BUTTON_WHEEL_LEFT && mb->is_pressed()) {
+ if (h_scroll->is_visible_in_tree()) {
+ h_scroll->set_value(h_scroll->get_value() - h_scroll->get_page() * mb->get_factor() / 8);
}
+ }
- if (!OS::get_singleton()->has_touchscreen_ui_hint())
- return;
+ if (mb->get_button_index() == BUTTON_WHEEL_RIGHT && mb->is_pressed()) {
+ if (h_scroll->is_visible_in_tree()) {
+ h_scroll->set_value(h_scroll->get_value() + h_scroll->get_page() * mb->get_factor() / 8);
+ }
+ }
- if (mb.button_index != BUTTON_LEFT)
- break;
+ if (!OS::get_singleton()->has_touchscreen_ui_hint())
+ return;
- if (mb.pressed) {
+ if (mb->get_button_index() != BUTTON_LEFT)
+ return;
- if (drag_touching) {
- set_fixed_process(false);
- drag_touching_deaccel = false;
- drag_touching = false;
- drag_speed = Vector2();
- drag_accum = Vector2();
- last_drag_accum = Vector2();
- drag_from = Vector2();
- }
+ if (mb->is_pressed()) {
- if (true) {
- drag_speed = Vector2();
- drag_accum = Vector2();
- last_drag_accum = Vector2();
- drag_from = Vector2(h_scroll->get_value(), v_scroll->get_value());
- drag_touching = OS::get_singleton()->has_touchscreen_ui_hint();
- drag_touching_deaccel = false;
+ if (drag_touching) {
+ set_fixed_process(false);
+ drag_touching_deaccel = false;
+ drag_touching = false;
+ drag_speed = Vector2();
+ drag_accum = Vector2();
+ last_drag_accum = Vector2();
+ drag_from = Vector2();
+ }
+
+ if (true) {
+ drag_speed = Vector2();
+ drag_accum = Vector2();
+ last_drag_accum = Vector2();
+ drag_from = Vector2(h_scroll->get_value(), v_scroll->get_value());
+ drag_touching = OS::get_singleton()->has_touchscreen_ui_hint();
+ drag_touching_deaccel = false;
+ time_since_motion = 0;
+ if (drag_touching) {
+ set_fixed_process(true);
time_since_motion = 0;
- if (drag_touching) {
- set_fixed_process(true);
- time_since_motion = 0;
- }
}
+ }
- } else {
- if (drag_touching) {
+ } else {
+ if (drag_touching) {
- if (drag_speed == Vector2()) {
- drag_touching_deaccel = false;
- drag_touching = false;
- set_fixed_process(false);
- } else {
+ if (drag_speed == Vector2()) {
+ drag_touching_deaccel = false;
+ drag_touching = false;
+ set_fixed_process(false);
+ } else {
- drag_touching_deaccel = true;
- }
+ drag_touching_deaccel = true;
}
}
+ }
+ }
- } break;
- case InputEvent::MOUSE_MOTION: {
-
- const InputEventMouseMotion &mm = p_gui_input.mouse_motion;
+ Ref<InputEventMouseMotion> mm = p_gui_input;
- if (drag_touching && !drag_touching_deaccel) {
+ if (mm.is_valid()) {
- Vector2 motion = Vector2(mm.relative_x, mm.relative_y);
- drag_accum -= motion;
- Vector2 diff = drag_from + drag_accum;
+ if (drag_touching && !drag_touching_deaccel) {
- if (scroll_h)
- h_scroll->set_value(diff.x);
- else
- drag_accum.x = 0;
- if (scroll_v)
- v_scroll->set_value(diff.y);
- else
- drag_accum.y = 0;
- time_since_motion = 0;
- }
+ Vector2 motion = Vector2(mm->get_relative().x, mm->get_relative().y);
+ drag_accum -= motion;
+ Vector2 diff = drag_from + drag_accum;
- } break;
+ if (scroll_h)
+ h_scroll->set_value(diff.x);
+ else
+ drag_accum.x = 0;
+ if (scroll_v)
+ v_scroll->set_value(diff.y);
+ else
+ drag_accum.y = 0;
+ time_since_motion = 0;
+ }
}
}
@@ -178,14 +187,14 @@ void ScrollContainer::_update_scrollbar_pos() {
Size2 hmin = h_scroll->get_combined_minimum_size();
Size2 vmin = v_scroll->get_combined_minimum_size();
- v_scroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, vmin.width);
+ v_scroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -vmin.width);
v_scroll->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0);
v_scroll->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 0);
v_scroll->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0);
h_scroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 0);
h_scroll->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0);
- h_scroll->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, hmin.height);
+ h_scroll->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, -hmin.height);
h_scroll->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0);
h_scroll->raise();
@@ -224,14 +233,14 @@ void ScrollContainer::_notification(int p_what) {
Rect2 r = Rect2(-scroll, minsize);
if (!scroll_h || (!h_scroll->is_visible_in_tree() && c->get_h_size_flags() & SIZE_EXPAND)) {
- r.pos.x = 0;
+ r.position.x = 0;
if (c->get_h_size_flags() & SIZE_EXPAND)
r.size.width = MAX(size.width, minsize.width);
else
r.size.width = minsize.width;
}
if (!scroll_v || (!v_scroll->is_visible_in_tree() && c->get_v_size_flags() & SIZE_EXPAND)) {
- r.pos.y = 0;
+ r.position.y = 0;
r.size.height = size.height;
if (c->get_v_size_flags() & SIZE_EXPAND)
r.size.height = MAX(size.height, minsize.height);
diff --git a/scene/gui/scroll_container.h b/scene/gui/scroll_container.h
index 07b127843a..e5df3e5e1c 100644
--- a/scene/gui/scroll_container.h
+++ b/scene/gui/scroll_container.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -63,7 +64,7 @@ class ScrollContainer : public Container {
protected:
Size2 get_minimum_size() const;
- void _gui_input(const InputEvent &p_gui_input);
+ void _gui_input(const Ref<InputEvent> &p_gui_input);
void _notification(int p_what);
void _scroll_moved(float);
diff --git a/scene/gui/separator.cpp b/scene/gui/separator.cpp
index e256b8f928..3b00ab4605 100644
--- a/scene/gui/separator.cpp
+++ b/scene/gui/separator.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/separator.h b/scene/gui/separator.h
index 7913531748..9a5fe2ac66 100644
--- a/scene/gui/separator.h
+++ b/scene/gui/separator.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp
index 365d450ed6..9ba17ce34f 100644
--- a/scene/gui/slider.cpp
+++ b/scene/gui/slider.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,16 +37,21 @@ Size2 Slider::get_minimum_size() const {
return ms;
}
-void Slider::_gui_input(InputEvent p_event) {
+void Slider::_gui_input(Ref<InputEvent> p_event) {
- if (p_event.type == InputEvent::MOUSE_BUTTON) {
+ if (!editable) {
+ return;
+ }
+
+ Ref<InputEventMouseButton> mb = p_event;
- InputEventMouseButton &mb = p_event.mouse_button;
- if (mb.button_index == BUTTON_LEFT) {
+ if (mb.is_valid()) {
+ if (mb->get_button_index() == BUTTON_LEFT) {
+
+ if (mb->is_pressed()) {
+ Ref<Texture> grabber = get_icon(mouse_inside || has_focus() ? "grabber_highlight" : "grabber");
+ grab.pos = orientation == VERTICAL ? mb->get_position().y : mb->get_position().x;
- if (mb.pressed) {
- Ref<Texture> grabber = get_icon(mouse_inside || has_focus() ? "grabber_hilite" : "grabber");
- grab.pos = orientation == VERTICAL ? mb.y : mb.x;
double grab_width = (double)grabber->get_size().width;
double grab_height = (double)grabber->get_size().height;
double max = orientation == VERTICAL ? get_size().height - grab_height : get_size().width - grab_width;
@@ -58,20 +64,22 @@ void Slider::_gui_input(InputEvent p_event) {
} else {
grab.active = false;
}
- } else if (mb.pressed && mb.button_index == BUTTON_WHEEL_UP) {
+ } else if (mb->is_pressed() && mb->get_button_index() == BUTTON_WHEEL_UP) {
set_value(get_value() + get_step());
- } else if (mb.pressed && mb.button_index == BUTTON_WHEEL_DOWN) {
+ } else if (mb->is_pressed() && mb->get_button_index() == BUTTON_WHEEL_DOWN) {
set_value(get_value() - get_step());
}
+ }
- } else if (p_event.type == InputEvent::MOUSE_MOTION) {
+ Ref<InputEventMouseMotion> mm = p_event;
+ if (mm.is_valid()) {
if (grab.active) {
Size2i size = get_size();
Ref<Texture> grabber = get_icon("grabber");
- float motion = (orientation == VERTICAL ? p_event.mouse_motion.y : p_event.mouse_motion.x) - grab.pos;
+ float motion = (orientation == VERTICAL ? mm->get_position().y : mm->get_position().x) - grab.pos;
if (orientation == VERTICAL)
motion = -motion;
float areasize = orientation == VERTICAL ? size.height - grabber->get_size().height : size.width - grabber->get_size().width;
@@ -80,42 +88,44 @@ void Slider::_gui_input(InputEvent p_event) {
float umotion = motion / float(areasize);
set_as_ratio(grab.uvalue + umotion);
}
- } else {
+ }
+
+ if (!mm.is_valid() && !mb.is_valid()) {
- if (p_event.is_action("ui_left") && p_event.is_pressed()) {
+ if (p_event->is_action("ui_left") && p_event->is_pressed()) {
if (orientation != HORIZONTAL)
return;
set_value(get_value() - (custom_step >= 0 ? custom_step : get_step()));
accept_event();
- } else if (p_event.is_action("ui_right") && p_event.is_pressed()) {
+ } else if (p_event->is_action("ui_right") && p_event->is_pressed()) {
if (orientation != HORIZONTAL)
return;
set_value(get_value() + (custom_step >= 0 ? custom_step : get_step()));
accept_event();
- } else if (p_event.is_action("ui_up") && p_event.is_pressed()) {
+ } else if (p_event->is_action("ui_up") && p_event->is_pressed()) {
if (orientation != VERTICAL)
return;
set_value(get_value() + (custom_step >= 0 ? custom_step : get_step()));
accept_event();
- } else if (p_event.is_action("ui_down") && p_event.is_pressed()) {
+ } else if (p_event->is_action("ui_down") && p_event->is_pressed()) {
if (orientation != VERTICAL)
return;
set_value(get_value() - (custom_step >= 0 ? custom_step : get_step()));
accept_event();
- } else if (p_event.type == InputEvent::KEY) {
+ } else {
- const InputEventKey &k = p_event.key;
+ Ref<InputEventKey> k = p_event;
- if (!k.pressed)
+ if (!k.is_valid() || !k->is_pressed())
return;
- switch (k.scancode) {
+ switch (k->get_scancode()) {
case KEY_HOME: {
@@ -128,7 +138,7 @@ void Slider::_gui_input(InputEvent p_event) {
accept_event();
} break;
- };
+ }
}
}
}
@@ -152,12 +162,13 @@ void Slider::_notification(int p_what) {
Size2i size = get_size();
Ref<StyleBox> style = get_stylebox("slider");
Ref<StyleBox> focus = get_stylebox("focus");
- Ref<Texture> grabber = get_icon(mouse_inside || has_focus() ? "grabber_hilite" : "grabber");
+ Ref<Texture> grabber = get_icon(editable ? ((mouse_inside || has_focus()) ? "grabber_highlight" : "grabber") : "grabber_disabled");
Ref<Texture> tick = get_icon("tick");
if (orientation == VERTICAL) {
- style->draw(ci, Rect2i(Point2i(), Size2i(style->get_minimum_size().width + style->get_center_size().width, size.height)));
+ int widget_width = style->get_minimum_size().width + style->get_center_size().width;
+ style->draw(ci, Rect2i(Point2i(size.width / 2 - widget_width / 2, 0), Size2i(widget_width, size.height)));
/*
if (mouse_inside||has_focus())
focus->draw(ci,Rect2i(Point2i(),Size2i(style->get_minimum_size().width+style->get_center_size().width,size.height)));
@@ -173,7 +184,9 @@ void Slider::_notification(int p_what) {
}
grabber->draw(ci, Point2i(size.width / 2 - grabber->get_size().width / 2, size.height - get_as_ratio() * areasize - grabber->get_size().height));
} else {
- style->draw(ci, Rect2i(Point2i(), Size2i(size.width, style->get_minimum_size().height + style->get_center_size().height)));
+
+ int widget_height = style->get_minimum_size().height + style->get_center_size().height;
+ style->draw(ci, Rect2i(Point2i(0, size.height / 2 - widget_height / 2), Size2i(size.width, widget_height)));
/*
if (mouse_inside||has_focus())
focus->draw(ci,Rect2i(Point2i(),Size2i(size.width,style->get_minimum_size().height+style->get_center_size().height)));
@@ -225,6 +238,17 @@ void Slider::set_ticks_on_borders(bool _tob) {
update();
}
+void Slider::set_editable(bool p_editable) {
+
+ editable = p_editable;
+ update();
+}
+
+bool Slider::is_editable() const {
+
+ return editable;
+}
+
void Slider::_bind_methods() {
ClassDB::bind_method(D_METHOD("_gui_input"), &Slider::_gui_input);
@@ -234,6 +258,10 @@ void Slider::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("set_editable", "editable"), &Slider::set_editable);
+ ClassDB::bind_method(D_METHOD("is_editable"), &Slider::is_editable);
+
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editable"), "set_editable", "is_editable");
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");
@@ -245,5 +273,6 @@ Slider::Slider(Orientation p_orientation) {
grab.active = false;
ticks = 0;
custom_step = -1;
+ editable = true;
set_focus_mode(FOCUS_ALL);
}
diff --git a/scene/gui/slider.h b/scene/gui/slider.h
index f649a4d150..f3cf3c6f48 100644
--- a/scene/gui/slider.h
+++ b/scene/gui/slider.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -45,9 +46,10 @@ class Slider : public Range {
bool mouse_inside;
Orientation orientation;
float custom_step;
+ bool editable;
protected:
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
void _notification(int p_what);
static void _bind_methods();
bool ticks_on_borders;
@@ -64,6 +66,9 @@ public:
void set_ticks_on_borders(bool);
bool get_ticks_on_borders() const;
+ void set_editable(bool p_editable);
+ bool is_editable() const;
+
Slider(Orientation p_orientation = VERTICAL);
};
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index 3f21093fb7..c5b9df15b9 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -64,7 +65,7 @@ LineEdit *SpinBox::get_line_edit() {
return line_edit;
}
-void SpinBox::_line_edit_input(const InputEvent &p_event) {
+void SpinBox::_line_edit_input(const Ref<InputEvent> &p_event) {
}
void SpinBox::_range_click_timeout() {
@@ -85,17 +86,19 @@ void SpinBox::_range_click_timeout() {
}
}
-void SpinBox::_gui_input(const InputEvent &p_event) {
+void SpinBox::_gui_input(const Ref<InputEvent> &p_event) {
if (!is_editable()) {
return;
}
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.pressed) {
- const InputEventMouseButton &mb = p_event.mouse_button;
- bool up = mb.y < (get_size().height / 2);
+ Ref<InputEventMouseButton> mb = p_event;
- switch (mb.button_index) {
+ if (mb.is_valid() && mb->is_pressed()) {
+
+ bool up = mb->get_position().y < (get_size().height / 2);
+
+ switch (mb->get_button_index()) {
case BUTTON_LEFT: {
@@ -114,27 +117,29 @@ void SpinBox::_gui_input(const InputEvent &p_event) {
} break;
case BUTTON_WHEEL_UP: {
if (line_edit->has_focus()) {
- set_value(get_value() + get_step());
+
+ set_value(get_value() + get_step() * mb->get_factor());
accept_event();
}
} break;
case BUTTON_WHEEL_DOWN: {
if (line_edit->has_focus()) {
- set_value(get_value() - get_step());
+
+ set_value(get_value() - get_step() * mb->get_factor());
accept_event();
}
} break;
}
}
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.pressed && p_event.mouse_button.button_index == 1) {
+ if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == 1) {
//set_default_cursor_shape(CURSOR_VSIZE);
- Vector2 cpos = Vector2(p_event.mouse_button.x, p_event.mouse_button.y);
+ Vector2 cpos = Vector2(mb->get_position().x, mb->get_position().y);
drag.mouse_pos = cpos;
}
- if (p_event.type == InputEvent::MOUSE_BUTTON && !p_event.mouse_button.pressed && p_event.mouse_button.button_index == 1) {
+ if (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == 1) {
//set_default_cursor_shape(CURSOR_ARROW);
range_click_timer->stop();
@@ -146,9 +151,12 @@ void SpinBox::_gui_input(const InputEvent &p_event) {
}
}
- if (p_event.type == InputEvent::MOUSE_MOTION && p_event.mouse_button.button_mask & 1) {
+ Ref<InputEventMouseMotion> mm = p_event;
+
+ if (mm.is_valid() && mm->get_button_mask() & 1) {
+
+ Vector2 cpos = mm->get_position();
- Vector2 cpos = Vector2(p_event.mouse_motion.x, p_event.mouse_motion.y);
if (drag.enabled) {
float diff_y = drag.mouse_pos.y - cpos.y;
diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h
index eba58402fa..683ed0c344 100644
--- a/scene/gui/spin_box.h
+++ b/scene/gui/spin_box.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -48,7 +49,7 @@ class SpinBox : public Range {
String prefix;
String suffix;
- void _line_edit_input(const InputEvent &p_event);
+ void _line_edit_input(const Ref<InputEvent> &p_event);
struct Drag {
float base_val;
@@ -61,7 +62,7 @@ class SpinBox : public Range {
void _line_edit_focus_exit();
protected:
- void _gui_input(const InputEvent &p_event);
+ void _gui_input(const Ref<InputEvent> &p_event);
void _notification(int p_what);
diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp
index 5b6f17e0f7..e3dad08809 100644
--- a/scene/gui/split_container.cpp
+++ b/scene/gui/split_container.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -130,7 +131,12 @@ void SplitContainer::_resort() {
if (ratiomode) {
- middle_sep = ms_first[axis] + available / 2;
+ int first_ratio = first->get_stretch_ratio();
+ int second_ratio = second->get_stretch_ratio();
+
+ float ratio = float(first_ratio) / (first_ratio + second_ratio);
+
+ middle_sep = ms_first[axis] + available * ratio;
} else if (expand_first_mode) {
@@ -143,12 +149,17 @@ void SplitContainer::_resort() {
} else if (ratiomode) {
- if (expand_ofs < -(available / 2))
- expand_ofs = -(available / 2);
- else if (expand_ofs > (available / 2))
- expand_ofs = (available / 2);
+ int first_ratio = first->get_stretch_ratio();
+ int second_ratio = second->get_stretch_ratio();
+
+ float ratio = float(first_ratio) / (first_ratio + second_ratio);
+
+ if (expand_ofs < -(available * ratio))
+ expand_ofs = -(available * ratio);
+ else if (expand_ofs > (available * (1.0 - ratio)))
+ expand_ofs = (available * (1.0 - ratio));
- middle_sep = ms_first[axis] + available / 2 + expand_ofs;
+ middle_sep = ms_first[axis] + available * ratio + expand_ofs;
} else if (expand_first_mode) {
@@ -185,7 +196,7 @@ void SplitContainer::_resort() {
}
update();
- _change_notify("split/offset");
+ _change_notify("split_offset");
}
Size2 SplitContainer::get_minimum_size() const {
@@ -269,32 +280,32 @@ void SplitContainer::_notification(int p_what) {
}
}
-void SplitContainer::_gui_input(const InputEvent &p_event) {
+void SplitContainer::_gui_input(const Ref<InputEvent> &p_event) {
if (collapsed || !_getch(0) || !_getch(1) || dragger_visibility != DRAGGER_VISIBLE)
return;
- if (p_event.type == InputEvent::MOUSE_BUTTON) {
+ Ref<InputEventMouseButton> mb = p_event;
- const InputEventMouseButton &mb = p_event.mouse_button;
+ if (mb.is_valid()) {
- if (mb.button_index == BUTTON_LEFT) {
+ if (mb->get_button_index() == BUTTON_LEFT) {
- if (mb.pressed) {
+ if (mb->is_pressed()) {
int sep = get_constant("separation");
if (vertical) {
- if (mb.y > middle_sep && mb.y < middle_sep + sep) {
+ if (mb->get_position().y > middle_sep && mb->get_position().y < middle_sep + sep) {
dragging = true;
- drag_from = mb.y;
+ drag_from = mb->get_position().y;
drag_ofs = expand_ofs;
}
} else {
- if (mb.x > middle_sep && mb.x < middle_sep + sep) {
+ if (mb->get_position().x > middle_sep && mb->get_position().x < middle_sep + sep) {
dragging = true;
- drag_from = mb.x;
+ drag_from = mb->get_position().x;
drag_ofs = expand_ofs;
}
}
@@ -305,13 +316,13 @@ void SplitContainer::_gui_input(const InputEvent &p_event) {
}
}
- if (p_event.type == InputEvent::MOUSE_MOTION) {
+ Ref<InputEventMouseMotion> mm = p_event;
- const InputEventMouseMotion &mm = p_event.mouse_motion;
+ if (mm.is_valid()) {
if (dragging) {
- expand_ofs = drag_ofs + ((vertical ? mm.y : mm.x) - drag_from);
+ expand_ofs = drag_ofs + ((vertical ? mm->get_position().y : mm->get_position().x) - drag_from);
queue_sort();
emit_signal("dragged", get_split_offset());
}
diff --git a/scene/gui/split_container.h b/scene/gui/split_container.h
index 8db6bfa658..87a210f24c 100644
--- a/scene/gui/split_container.h
+++ b/scene/gui/split_container.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,7 +34,7 @@
class SplitContainer : public Container {
- GDCLASS(SplitContainer, Container);
+ GDCLASS(SplitContainer, Container)
public:
enum DraggerVisibility {
@@ -58,7 +59,7 @@ private:
void _resort();
protected:
- void _gui_input(const InputEvent &p_event);
+ void _gui_input(const Ref<InputEvent> &p_event);
void _notification(int p_what);
static void _bind_methods();
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp
index 89769937d4..1352569f33 100644
--- a/scene/gui/tab_container.cpp
+++ b/scene/gui/tab_container.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -62,11 +63,13 @@ int TabContainer::_get_top_margin() const {
return tab_height + content_height;
}
-void TabContainer::_gui_input(const InputEvent &p_event) {
+void TabContainer::_gui_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.pressed && p_event.mouse_button.button_index == BUTTON_LEFT) {
+ Ref<InputEventMouseButton> mb = p_event;
- Point2 pos(p_event.mouse_button.x, p_event.mouse_button.y);
+ if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
+
+ Point2 pos(mb->get_position().x, mb->get_position().y);
Size2 size = get_size();
// Click must be on tabs in the tab header area.
@@ -78,11 +81,11 @@ void TabContainer::_gui_input(const InputEvent &p_event) {
if (popup && pos.x > size.width - menu->get_width()) {
emit_signal("pre_popup_pressed");
- Vector2 popup_pos = get_global_pos();
+ Vector2 popup_pos = get_global_position();
popup_pos.x += size.width - popup->get_size().width;
popup_pos.y += menu->get_height();
- popup->set_global_pos(popup_pos);
+ popup->set_global_position(popup_pos);
popup->popup();
return;
}
@@ -230,7 +233,7 @@ void TabContainer::_notification(int p_what) {
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 x_content = tab_rect.position.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;
@@ -368,8 +371,10 @@ void TabContainer::add_child_notify(Node *p_child) {
if (tabs_visible)
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)));
+ c->set_margin(Margin(MARGIN_TOP), c->get_margin(Margin(MARGIN_TOP)) + sb->get_margin(Margin(MARGIN_TOP)));
+ c->set_margin(Margin(MARGIN_LEFT), c->get_margin(Margin(MARGIN_LEFT)) + sb->get_margin(Margin(MARGIN_LEFT)));
+ c->set_margin(Margin(MARGIN_RIGHT), c->get_margin(Margin(MARGIN_RIGHT)) - sb->get_margin(Margin(MARGIN_RIGHT)));
+ c->set_margin(Margin(MARGIN_BOTTOM), c->get_margin(Margin(MARGIN_BOTTOM)) - sb->get_margin(Margin(MARGIN_BOTTOM)));
update();
p_child->connect("renamed", this, "_child_renamed_callback");
@@ -399,8 +404,10 @@ void TabContainer::set_current_tab(int p_current) {
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(MARGIN_TOP), c->get_margin(Margin(MARGIN_TOP)) + sb->get_margin(Margin(MARGIN_TOP)));
+ c->set_margin(Margin(MARGIN_LEFT), c->get_margin(Margin(MARGIN_LEFT)) + sb->get_margin(Margin(MARGIN_LEFT)));
+ c->set_margin(Margin(MARGIN_RIGHT), c->get_margin(Margin(MARGIN_RIGHT)) - sb->get_margin(Margin(MARGIN_RIGHT)));
+ c->set_margin(Margin(MARGIN_BOTTOM), c->get_margin(Margin(MARGIN_BOTTOM)) - sb->get_margin(Margin(MARGIN_BOTTOM)));
} else
c->hide();
@@ -541,11 +548,11 @@ Ref<Texture> TabContainer::get_tab_icon(int p_tab) const {
return Ref<Texture>();
}
-void TabContainer::set_tab_disabled(int p_tab, bool p_enabled) {
+void TabContainer::set_tab_disabled(int p_tab, bool p_disabled) {
Control *child = _get_tab(p_tab);
ERR_FAIL_COND(!child);
- child->set_meta("_tab_disabled", p_enabled);
+ child->set_meta("_tab_disabled", p_disabled);
update();
}
@@ -624,20 +631,20 @@ void TabContainer::_bind_methods() {
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("get_current_tab_control"), &TabContainer::get_current_tab_control);
+ ClassDB::bind_method(D_METHOD("get_tab_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_icon", "tab_idx", "icon"), &TabContainer::set_tab_icon);
+ ClassDB::bind_method(D_METHOD("get_tab_icon", "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("set_popup", "popup"), &TabContainer::set_popup);
+ ClassDB::bind_method(D_METHOD("get_popup"), &TabContainer::get_popup);
ClassDB::bind_method(D_METHOD("_child_renamed_callback"), &TabContainer::_child_renamed_callback);
@@ -661,4 +668,4 @@ TabContainer::TabContainer() {
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 2594611844..3e1a2c1598 100644
--- a/scene/gui/tab_container.h
+++ b/scene/gui/tab_container.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -53,7 +54,7 @@ private:
bool tabs_visible;
bool buttons_visible_cache;
TabAlign align;
- Control *_get_tab(int idx) const;
+ Control *_get_tab(int p_idx) const;
int _get_top_margin() const;
Popup *popup;
@@ -62,7 +63,7 @@ private:
protected:
void _child_renamed_callback();
- void _gui_input(const InputEvent &p_event);
+ void _gui_input(const Ref<InputEvent> &p_event);
void _notification(int p_what);
virtual void add_child_notify(Node *p_child);
virtual void remove_child_notify(Node *p_child);
diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp
index 3197553876..acffbbc499 100644
--- a/scene/gui/tabs.cpp
+++ b/scene/gui/tabs.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -78,13 +79,15 @@ Size2 Tabs::get_minimum_size() const {
return ms;
}
-void Tabs::_gui_input(const InputEvent &p_event) {
+void Tabs::_gui_input(const Ref<InputEvent> &p_event) {
- if (p_event.type == InputEvent::MOUSE_MOTION) {
+ Ref<InputEventMouseMotion> mm = p_event;
- Point2 pos(p_event.mouse_motion.x, p_event.mouse_motion.y);
+ if (mm.is_valid()) {
- hilite_arrow = -1;
+ Point2 pos = mm->get_position();
+
+ highlight_arrow = -1;
if (buttons_visible) {
Ref<Texture> incr = get_icon("increment");
@@ -93,20 +96,24 @@ void Tabs::_gui_input(const InputEvent &p_event) {
int limit = get_size().width - incr->get_width() - decr->get_width();
if (pos.x > limit + decr->get_width()) {
- hilite_arrow = 1;
+ highlight_arrow = 1;
} else if (pos.x > limit) {
- hilite_arrow = 0;
+ highlight_arrow = 0;
}
}
// test hovering to display right or close button
+ int hover_now = -1;
int hover_buttons = -1;
- hover = -1;
for (int i = 0; i < tabs.size(); i++) {
if (i < offset)
continue;
+ Rect2 rect = get_tab_rect(i);
+ if (rect.has_point(pos)) {
+ hover_now = i;
+ }
if (tabs[i].rb_rect.has_point(pos)) {
rb_hover = i;
cb_hover = -1;
@@ -119,6 +126,10 @@ void Tabs::_gui_input(const InputEvent &p_event) {
break;
}
}
+ if (hover != hover_now) {
+ hover = hover_now;
+ emit_signal("tab_hover", hover);
+ }
if (hover_buttons == -1) { // no hover
rb_hover = hover_buttons;
@@ -129,9 +140,11 @@ void Tabs::_gui_input(const InputEvent &p_event) {
return;
}
- if (rb_pressing && p_event.type == InputEvent::MOUSE_BUTTON &&
- !p_event.mouse_button.pressed &&
- p_event.mouse_button.button_index == BUTTON_LEFT) {
+ Ref<InputEventMouseButton> mb = p_event;
+
+ if (rb_pressing && mb.is_valid() &&
+ !mb->is_pressed() &&
+ mb->get_button_index() == BUTTON_LEFT) {
if (rb_hover != -1) {
//pressed
@@ -142,9 +155,9 @@ void Tabs::_gui_input(const InputEvent &p_event) {
update();
}
- if (cb_pressing && p_event.type == InputEvent::MOUSE_BUTTON &&
- !p_event.mouse_button.pressed &&
- p_event.mouse_button.button_index == BUTTON_LEFT) {
+ if (cb_pressing && mb.is_valid() &&
+ !mb->is_pressed() &&
+ mb->get_button_index() == BUTTON_LEFT) {
if (cb_hover != -1) {
//pressed
@@ -155,12 +168,12 @@ void Tabs::_gui_input(const InputEvent &p_event) {
update();
}
- if (p_event.type == InputEvent::MOUSE_BUTTON &&
- p_event.mouse_button.pressed &&
- p_event.mouse_button.button_index == BUTTON_LEFT) {
+ if (mb.is_valid() &&
+ mb->is_pressed() &&
+ mb->get_button_index() == BUTTON_LEFT) {
// clicks
- Point2 pos(p_event.mouse_button.x, p_event.mouse_button.y);
+ Point2 pos(mb->get_position().x, mb->get_position().y);
if (buttons_visible) {
@@ -213,7 +226,7 @@ void Tabs::_gui_input(const InputEvent &p_event) {
if (found != -1) {
set_current_tab(found);
- emit_signal("tab_changed", found);
+ emit_signal("tab_clicked", found);
}
}
}
@@ -229,11 +242,13 @@ void Tabs::_notification(int p_what) {
update();
} break;
case NOTIFICATION_RESIZED: {
-
+ _update_cache();
_ensure_no_over_offset();
+ ensure_tab_visible(current);
+
} break;
case NOTIFICATION_DRAW: {
-
+ _update_cache();
RID ci = get_canvas_item();
Ref<StyleBox> tab_bg = get_stylebox("tab_bg");
@@ -267,8 +282,8 @@ void Tabs::_notification(int p_what) {
Ref<Texture> incr = get_icon("increment");
Ref<Texture> decr = get_icon("decrement");
- Ref<Texture> incr_hl = get_icon("increment_hilite");
- Ref<Texture> decr_hl = get_icon("decrement_hilite");
+ Ref<Texture> incr_hl = get_icon("increment_highlight");
+ Ref<Texture> decr_hl = get_icon("decrement_highlight");
int limit = get_size().width - incr->get_size().width - decr->get_size().width;
@@ -281,18 +296,7 @@ void Tabs::_notification(int p_what) {
tabs[i].ofs_cache = w;
- int lsize = get_tab_width(i);
-
- String text = tabs[i].text;
- int slen = font->get_string_size(text).width;
-
- if (w + lsize > limit) {
- max_drawn_tab = i - 1;
- missing_right = true;
- break;
- } else {
- max_drawn_tab = i;
- }
+ int lsize = tabs[i].size_cache;
Ref<StyleBox> sb;
Color col;
@@ -308,7 +312,15 @@ void Tabs::_notification(int p_what) {
col = color_bg;
}
- Rect2 sb_rect = Rect2(w, 0, lsize, h);
+ if (w + lsize > limit) {
+ max_drawn_tab = i - 1;
+ missing_right = true;
+ break;
+ } else {
+ max_drawn_tab = i;
+ }
+
+ Rect2 sb_rect = Rect2(w, 0, tabs[i].size_cache, h);
sb->draw(ci, sb_rect);
w += sb->get_margin(MARGIN_LEFT);
@@ -318,13 +330,13 @@ void Tabs::_notification(int p_what) {
if (icon.is_valid()) {
icon->draw(ci, Point2i(w, sb->get_margin(MARGIN_TOP) + ((sb_rect.size.y - sb_ms.y) - icon->get_height()) / 2));
- if (text != "")
+ if (tabs[i].text != "")
w += icon->get_width() + get_constant("hseparation");
}
- font->draw(ci, Point2i(w, sb->get_margin(MARGIN_TOP) + ((sb_rect.size.y - sb_ms.y) - font->get_height()) / 2 + font->get_ascent()), text, col);
+ font->draw(ci, Point2i(w, sb->get_margin(MARGIN_TOP) + ((sb_rect.size.y - sb_ms.y) - font->get_height()) / 2 + font->get_ascent()), tabs[i].text, col, tabs[i].size_text);
- w += slen;
+ w += tabs[i].size_text;
if (tabs[i].right_button.is_valid()) {
@@ -335,8 +347,8 @@ void Tabs::_notification(int p_what) {
Rect2 rb_rect;
rb_rect.size = style->get_minimum_size() + rb->get_size();
- rb_rect.pos.x = w;
- rb_rect.pos.y = sb->get_margin(MARGIN_TOP) + ((sb_rect.size.y - sb_ms.y) - (rb_rect.size.y)) / 2;
+ rb_rect.position.x = w;
+ rb_rect.position.y = sb->get_margin(MARGIN_TOP) + ((sb_rect.size.y - sb_ms.y) - (rb_rect.size.y)) / 2;
if (rb_hover == i) {
if (rb_pressing)
@@ -345,7 +357,7 @@ void Tabs::_notification(int p_what) {
style->draw(ci, rb_rect);
}
- rb->draw(ci, Point2i(w + style->get_margin(MARGIN_LEFT), rb_rect.pos.y + style->get_margin(MARGIN_TOP)));
+ rb->draw(ci, Point2i(w + style->get_margin(MARGIN_LEFT), rb_rect.position.y + style->get_margin(MARGIN_TOP)));
w += rb->get_width();
tabs[i].rb_rect = rb_rect;
}
@@ -359,8 +371,8 @@ void Tabs::_notification(int p_what) {
Rect2 cb_rect;
cb_rect.size = style->get_minimum_size() + cb->get_size();
- cb_rect.pos.x = w;
- cb_rect.pos.y = sb->get_margin(MARGIN_TOP) + ((sb_rect.size.y - sb_ms.y) - (cb_rect.size.y)) / 2;
+ cb_rect.position.x = w;
+ cb_rect.position.y = sb->get_margin(MARGIN_TOP) + ((sb_rect.size.y - sb_ms.y) - (cb_rect.size.y)) / 2;
if (!tabs[i].disabled && cb_hover == i) {
if (cb_pressing)
@@ -369,14 +381,12 @@ void Tabs::_notification(int p_what) {
style->draw(ci, cb_rect);
}
- cb->draw(ci, Point2i(w + style->get_margin(MARGIN_LEFT), cb_rect.pos.y + style->get_margin(MARGIN_TOP)));
+ cb->draw(ci, Point2i(w + style->get_margin(MARGIN_LEFT), cb_rect.position.y + style->get_margin(MARGIN_TOP)));
w += cb->get_width();
tabs[i].cb_rect = cb_rect;
}
w += sb->get_margin(MARGIN_RIGHT);
-
- tabs[i].size_cache = w - tabs[i].ofs_cache;
}
if (offset > 0 || missing_right) {
@@ -384,12 +394,12 @@ void Tabs::_notification(int p_what) {
int vofs = (get_size().height - incr->get_size().height) / 2;
if (offset > 0)
- draw_texture(hilite_arrow == 0 ? decr_hl : decr, Point2(limit, vofs));
+ draw_texture(highlight_arrow == 0 ? decr_hl : decr, Point2(limit, vofs));
else
draw_texture(decr, Point2(limit, vofs), Color(1, 1, 1, 0.5));
if (missing_right)
- draw_texture(hilite_arrow == 1 ? incr_hl : incr, Point2(limit + decr->get_size().width, vofs));
+ draw_texture(highlight_arrow == 1 ? incr_hl : incr, Point2(limit + decr->get_size().width, vofs));
else
draw_texture(incr, Point2(limit + decr->get_size().width, vofs), Color(1, 1, 1, 0.5));
@@ -409,12 +419,16 @@ int Tabs::get_tab_count() const {
void Tabs::set_current_tab(int p_current) {
+ if (current == p_current) return;
ERR_FAIL_INDEX(p_current, get_tab_count());
current = p_current;
_change_notify("current_tab");
+ _update_cache();
update();
+
+ emit_signal("tab_changed", p_current);
}
int Tabs::get_current_tab() const {
@@ -422,6 +436,10 @@ int Tabs::get_current_tab() const {
return current;
}
+int Tabs::get_hovered_tab() const {
+ return hover;
+}
+
void Tabs::set_tab_title(int p_tab, const String &p_title) {
ERR_FAIL_INDEX(p_tab, tabs.size());
@@ -475,15 +493,81 @@ Ref<Texture> Tabs::get_tab_right_button(int p_tab) const {
return tabs[p_tab].right_button;
}
+void Tabs::_update_cache() {
+ Ref<StyleBox> tab_disabled = get_stylebox("tab_disabled");
+ 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");
+ int limit = get_size().width - incr->get_width() - decr->get_width();
+
+ int w = 0;
+ int mw = 0;
+ int size_fixed = 0;
+ int count_resize = 0;
+ for (int i = 0; i < tabs.size(); i++) {
+ tabs[i].ofs_cache = mw;
+ tabs[i].size_cache = get_tab_width(i);
+ tabs[i].size_text = font->get_string_size(tabs[i].text).width;
+ mw += tabs[i].size_cache;
+ if (tabs[i].size_cache <= min_width || i == current) {
+ size_fixed += tabs[i].size_cache;
+ } else {
+ count_resize++;
+ }
+ }
+ int m_width = min_width;
+ if (count_resize > 0) {
+ m_width = MAX((limit - size_fixed) / count_resize, min_width);
+ }
+ for (int i = 0; i < tabs.size(); i++) {
+ if (i < offset)
+ continue;
+ Ref<StyleBox> sb;
+ if (tabs[i].disabled) {
+ sb = tab_disabled;
+ } else if (i == current) {
+ sb = tab_fg;
+ } else {
+ sb = tab_bg;
+ }
+ int lsize = tabs[i].size_cache;
+ int slen = tabs[i].size_text;
+ if (min_width > 0 && mw > limit && i != current) {
+ if (lsize > m_width) {
+ slen = m_width - (sb->get_margin(MARGIN_LEFT) + sb->get_margin(MARGIN_RIGHT));
+ if (tabs[i].icon.is_valid()) {
+ slen -= tabs[i].icon->get_width();
+ slen -= get_constant("hseparation");
+ }
+ if (cb_displaypolicy == CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy == CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i == current)) {
+ Ref<Texture> cb = get_icon("close");
+ slen -= cb->get_width();
+ slen -= get_constant("hseparation");
+ }
+ slen = MAX(slen, 1);
+ lsize = m_width;
+ }
+ }
+ tabs[i].ofs_cache = w;
+ tabs[i].size_cache = lsize;
+ tabs[i].size_text = slen;
+ w += lsize;
+ }
+}
+
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;
+ t.ofs_cache = 0;
+ t.size_cache = 0;
tabs.push_back(t);
-
+ _update_cache();
update();
minimum_size_changed();
}
@@ -500,6 +584,7 @@ void Tabs::remove_tab(int p_idx) {
tabs.remove(p_idx);
if (current >= p_idx)
current--;
+ _update_cache();
update();
minimum_size_changed();
@@ -511,8 +596,44 @@ void Tabs::remove_tab(int p_idx) {
_ensure_no_over_offset();
}
+Variant Tabs::get_drag_data(const Point2 &p_point) {
+
+ return get_tab_idx_at_point(p_point);
+}
+
+bool Tabs::can_drop_data(const Point2 &p_point, const Variant &p_data) const {
+
+ return get_tab_idx_at_point(p_point) > -1;
+}
+
+void Tabs::drop_data(const Point2 &p_point, const Variant &p_data) {
+
+ int hover_now = get_tab_idx_at_point(p_point);
+
+ ERR_FAIL_INDEX(hover_now, tabs.size());
+ emit_signal("reposition_active_tab_request", hover_now);
+}
+
+int Tabs::get_tab_idx_at_point(const Point2 &p_point) const {
+
+ int hover_now = -1;
+ for (int i = 0; i < tabs.size(); i++) {
+
+ if (i < offset)
+ continue;
+
+ Rect2 rect = get_tab_rect(i);
+ if (rect.has_point(p_point)) {
+ hover_now = i;
+ }
+ }
+
+ return hover_now;
+}
+
void Tabs::set_tab_align(TabAlign p_align) {
+ ERR_FAIL_INDEX(p_align, ALIGN_MAX);
tab_align = p_align;
update();
}
@@ -522,6 +643,22 @@ Tabs::TabAlign Tabs::get_tab_align() const {
return tab_align;
}
+void Tabs::move_tab(int from, int to) {
+
+ if (from == to)
+ return;
+
+ ERR_FAIL_INDEX(from, tabs.size());
+ ERR_FAIL_INDEX(to, tabs.size());
+
+ Tab tab_from = tabs[from];
+ tabs.remove(from);
+ tabs.insert(to, tab_from);
+
+ _update_cache();
+ update();
+}
+
int Tabs::get_tab_width(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, tabs.size(), 0);
@@ -582,7 +719,7 @@ void Tabs::_ensure_no_over_offset() {
if (i < offset - 1)
continue;
- total_w += get_tab_width(i);
+ total_w += tabs[i].size_cache;
}
if (total_w < limit) {
@@ -599,44 +736,53 @@ void Tabs::ensure_tab_visible(int p_idx) {
if (!is_inside_tree())
return;
+ if (tabs.size() == 0) return;
ERR_FAIL_INDEX(p_idx, tabs.size());
- _ensure_no_over_offset();
-
- if (p_idx <= offset) {
+ if (p_idx == offset) {
+ return;
+ }
+ if (p_idx < offset) {
offset = p_idx;
update();
return;
}
+ int prev_offset = offset;
Ref<Texture> incr = get_icon("increment");
Ref<Texture> decr = get_icon("decrement");
int limit = get_size().width - incr->get_width() - decr->get_width();
-
- int x = 0;
- for (int i = 0; i < tabs.size(); i++) {
-
- if (i < offset)
- continue;
-
- int sz = get_tab_width(i);
- tabs[i].x_cache = x;
- tabs[i].x_size_cache = sz;
- x += sz;
+ for (int i = offset; i <= p_idx; i++) {
+ if (tabs[i].ofs_cache + tabs[i].size_cache > limit) {
+ offset++;
+ }
}
- while (offset < tabs.size() && ((tabs[p_idx].x_cache + tabs[p_idx].x_size_cache) - tabs[offset].x_cache) > limit) {
- offset++;
+ if (prev_offset != offset) {
+ update();
}
+}
- update();
+Rect2 Tabs::get_tab_rect(int p_tab) const {
+ return Rect2(tabs[p_tab].ofs_cache, 0, tabs[p_tab].size_cache, get_size().height);
}
void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy) {
+
+ ERR_FAIL_INDEX(p_policy, CLOSE_BUTTON_MAX);
cb_displaypolicy = p_policy;
update();
}
+Tabs::CloseButtonDisplayPolicy Tabs::get_tab_close_display_policy() const {
+
+ return cb_displaypolicy;
+}
+
+void Tabs::set_min_width(int p_width) {
+ min_width = p_width;
+}
+
void Tabs::_bind_methods() {
ClassDB::bind_method(D_METHOD("_gui_input"), &Tabs::_gui_input);
@@ -645,29 +791,39 @@ void Tabs::_bind_methods() {
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_icon", "tab_idx", "icon"), &Tabs::set_tab_icon);
+ ClassDB::bind_method(D_METHOD("get_tab_icon", "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("add_tab", "title", "icon"), &Tabs::add_tab, DEFVAL(""), DEFVAL(Ref<Texture>()));
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);
+ ClassDB::bind_method(D_METHOD("get_tab_rect", "tab_idx"), &Tabs::get_tab_rect);
+ ClassDB::bind_method(D_METHOD("move_tab", "from", "to"), &Tabs::move_tab);
+ ClassDB::bind_method(D_METHOD("set_tab_close_display_policy", "policy"), &Tabs::set_tab_close_display_policy);
+ ClassDB::bind_method(D_METHOD("get_tab_close_display_policy"), &Tabs::get_tab_close_display_policy);
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_SIGNAL(MethodInfo("tab_hover", PropertyInfo(Variant::INT, "tab")));
+ ADD_SIGNAL(MethodInfo("reposition_active_tab_request", PropertyInfo(Variant::INT, "idx_to")));
+ ADD_SIGNAL(MethodInfo("tab_clicked", PropertyInfo(Variant::INT, "tab")));
ADD_PROPERTY(PropertyInfo(Variant::INT, "current_tab", PROPERTY_HINT_RANGE, "-1,4096,1", PROPERTY_USAGE_EDITOR), "set_current_tab", "get_current_tab");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "tab_close_display_policy", PROPERTY_HINT_ENUM, "Show Never,Show Active Only,Show Always"), "set_tab_close_display_policy", "get_tab_close_display_policy");
BIND_CONSTANT(ALIGN_LEFT);
BIND_CONSTANT(ALIGN_CENTER);
BIND_CONSTANT(ALIGN_RIGHT);
+ BIND_CONSTANT(ALIGN_MAX);
BIND_CONSTANT(CLOSE_BUTTON_SHOW_ACTIVE_ONLY);
BIND_CONSTANT(CLOSE_BUTTON_SHOW_ALWAYS);
BIND_CONSTANT(CLOSE_BUTTON_SHOW_NEVER);
+ BIND_CONSTANT(CLOSE_BUTTON_MAX);
}
Tabs::Tabs() {
@@ -676,11 +832,13 @@ Tabs::Tabs() {
tab_align = ALIGN_CENTER;
rb_hover = -1;
rb_pressing = false;
- hilite_arrow = -1;
+ highlight_arrow = -1;
cb_hover = -1;
cb_pressing = false;
cb_displaypolicy = CLOSE_BUTTON_SHOW_NEVER;
offset = 0;
max_drawn_tab = 0;
+
+ min_width = 0;
}
diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h
index 39811f13c2..86ad128dcd 100644
--- a/scene/gui/tabs.h
+++ b/scene/gui/tabs.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -40,7 +41,8 @@ public:
ALIGN_LEFT,
ALIGN_CENTER,
- ALIGN_RIGHT
+ ALIGN_RIGHT,
+ ALIGN_MAX
};
enum CloseButtonDisplayPolicy {
@@ -48,6 +50,7 @@ public:
CLOSE_BUTTON_SHOW_NEVER,
CLOSE_BUTTON_SHOW_ACTIVE_ONLY,
CLOSE_BUTTON_SHOW_ALWAYS,
+ CLOSE_BUTTON_MAX
};
private:
@@ -58,6 +61,7 @@ private:
int ofs_cache;
bool disabled;
int size_cache;
+ int size_text;
int x_cache;
int x_size_cache;
@@ -68,12 +72,11 @@ private:
int offset;
int max_drawn_tab;
- int hilite_arrow;
+ int highlight_arrow;
bool buttons_visible;
bool missing_right;
Vector<Tab> tabs;
int current;
- Control *_get_tab(int idx) const;
int _get_top_margin() const;
TabAlign tab_align;
int rb_hover;
@@ -84,15 +87,22 @@ private:
CloseButtonDisplayPolicy cb_displaypolicy;
int hover; // hovered tab
+ int min_width;
int get_tab_width(int p_idx) const;
void _ensure_no_over_offset();
+ void _update_cache();
protected:
- void _gui_input(const InputEvent &p_event);
+ void _gui_input(const Ref<InputEvent> &p_event);
void _notification(int p_what);
static void _bind_methods();
+ Variant get_drag_data(const Point2 &p_point);
+ bool can_drop_data(const Point2 &p_point, const Variant &p_data) const;
+ void drop_data(const Point2 &p_point, const Variant &p_data);
+ int get_tab_idx_at_point(const Point2 &p_point) const;
+
public:
void add_tab(const String &p_str = "", const Ref<Texture> &p_icon = Ref<Texture>());
@@ -111,23 +121,30 @@ public:
void set_tab_align(TabAlign p_align);
TabAlign get_tab_align() const;
+ void move_tab(int from, int to);
+
void set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy);
+ CloseButtonDisplayPolicy get_tab_close_display_policy() const;
int get_tab_count() const;
void set_current_tab(int p_current);
int get_current_tab() const;
+ int get_hovered_tab() const;
void remove_tab(int p_idx);
void clear_tabs();
void ensure_tab_visible(int p_idx);
+ void set_min_width(int p_width);
+ Rect2 get_tab_rect(int p_tab) const;
Size2 get_minimum_size() const;
Tabs();
};
VARIANT_ENUM_CAST(Tabs::TabAlign);
+VARIANT_ENUM_CAST(Tabs::CloseButtonDisplayPolicy);
#endif // TABS_H
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 3b7ad910d6..2b47539c42 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,8 +33,8 @@
#include "os/keyboard.h"
#include "os/os.h"
-#include "global_config.h"
#include "message_queue.h"
+#include "project_settings.h"
#include "scene/main/viewport.h"
#define TAB_PIXELS
@@ -48,6 +49,10 @@ static bool _is_symbol(CharType c) {
return c != '_' && ((c >= '!' && c <= '/') || (c >= ':' && c <= '@') || (c >= '[' && c <= '`') || (c >= '{' && c <= '~') || c == '\t' || c == ' ');
}
+static bool _is_whitespace(CharType c) {
+ return c == '\t' || c == ' ';
+}
+
static bool _is_char(CharType c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_';
@@ -100,15 +105,15 @@ void TextEdit::Text::set_font(const Ref<Font> &p_font) {
font = p_font;
}
-void TextEdit::Text::set_tab_size(int p_tab_size) {
+void TextEdit::Text::set_indent_size(int p_indent_size) {
- tab_size = p_tab_size;
+ indent_size = p_indent_size;
}
void TextEdit::Text::_update_line_cache(int p_line) const {
int w = 0;
- int tab_w = font->get_char_size(' ').width * tab_size;
+ int tab_w = font->get_char_size(' ').width * indent_size;
int len = text[p_line].data.length();
const CharType *str = text[p_line].data.c_str();
@@ -333,7 +338,10 @@ void TextEdit::_update_scrollbars() {
v_scroll->show();
v_scroll->set_max(total_rows);
v_scroll->set_page(visible_rows);
- v_scroll->set_value(cursor.line_ofs);
+
+ if (fabs(v_scroll->get_value() - (double)cursor.line_ofs) >= 1) {
+ v_scroll->set_value(cursor.line_ofs);
+ }
} else {
cursor.line_ofs = 0;
@@ -345,7 +353,9 @@ void TextEdit::_update_scrollbars() {
h_scroll->show();
h_scroll->set_max(total_width);
h_scroll->set_page(visible_width);
- h_scroll->set_value(cursor.x_ofs);
+ if (fabs(h_scroll->get_value() - (double)cursor.x_ofs) >= 1) {
+ h_scroll->set_value(cursor.x_ofs);
+ }
} else {
@@ -359,7 +369,7 @@ void TextEdit::_click_selection_held() {
if (Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT) && selection.selecting_mode != Selection::MODE_NONE) {
- Point2 mp = Input::get_singleton()->get_mouse_pos() - get_global_pos();
+ Point2 mp = Input::get_singleton()->get_mouse_position() - get_global_position();
int row, col;
_get_mouse_pos(Point2i(mp.x, mp.y), row, col);
@@ -455,7 +465,7 @@ void TextEdit::_notification(int p_what) {
int visible_rows = get_visible_rows();
- int tab_w = cache.font->get_char_size(' ').width * tab_size;
+ int tab_w = cache.font->get_char_size(' ').width * indent_size;
Color color = cache.font_color;
int in_region = -1;
@@ -812,8 +822,8 @@ void TextEdit::_notification(int p_what) {
keyword_color = *col;
}
- if (select_identifiers_enabled && hilighted_word != String()) {
- if (hilighted_word == range) {
+ if (select_identifiers_enabled && highlighted_word != String()) {
+ if (highlighted_word == range) {
underlined = true;
}
}
@@ -977,13 +987,41 @@ void TextEdit::_notification(int p_what) {
}
int caret_w = (str[j] == '\t') ? cache.font->get_char_size(' ').width : char_w;
- if (draw_caret) {
- if (insert_mode) {
- int caret_h = (block_caret) ? 4 : 1;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, caret_h)), cache.caret_color);
- } else {
- caret_w = (block_caret) ? caret_w : 1;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, get_row_height())), cache.caret_color);
+ if (ime_text.length() > 0) {
+ int ofs = 0;
+ while (true) {
+ if (ofs >= ime_text.length())
+ break;
+
+ CharType cchar = ime_text[ofs];
+ CharType next = ime_text[ofs + 1];
+ int im_char_width = cache.font->get_char_size(cchar, next).width;
+
+ if ((char_ofs + char_margin + im_char_width) >= xmargin_end)
+ break;
+
+ bool selected = ofs >= ime_selection.x && ofs < ime_selection.x + ime_selection.y;
+ if (selected) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 3)), color);
+ } else {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 1)), color);
+ }
+
+ cache.font->draw_char(ci, Point2(char_ofs + char_margin, ofs_y + ascent), cchar, next, color);
+
+ char_ofs += im_char_width;
+ ofs++;
+ }
+ }
+ if (ime_text.length() == 0) {
+ if (draw_caret) {
+ if (insert_mode) {
+ int caret_h = (block_caret) ? 4 : 1;
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, caret_h)), cache.caret_color);
+ } else {
+ caret_w = (block_caret) ? caret_w : 1;
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, get_row_height())), cache.caret_color);
+ }
}
}
}
@@ -1014,16 +1052,43 @@ void TextEdit::_notification(int p_what) {
if (insert_mode) {
cursor_pos.y += (get_row_height() - 3);
}
+ if (ime_text.length() > 0) {
+ int ofs = 0;
+ while (true) {
+ if (ofs >= ime_text.length())
+ break;
- if (draw_caret) {
- if (insert_mode) {
- int char_w = cache.font->get_char_size(' ').width;
- int caret_h = (block_caret) ? 4 : 1;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(char_w, caret_h)), cache.caret_color);
- } else {
- int char_w = cache.font->get_char_size(' ').width;
- int caret_w = (block_caret) ? char_w : 1;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, get_row_height())), cache.caret_color);
+ CharType cchar = ime_text[ofs];
+ CharType next = ime_text[ofs + 1];
+ int im_char_width = cache.font->get_char_size(cchar, next).width;
+
+ if ((char_ofs + char_margin + im_char_width) >= xmargin_end)
+ break;
+
+ bool selected = ofs >= ime_selection.x && ofs < ime_selection.x + ime_selection.y;
+ if (selected) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 3)), color);
+ } else {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 1)), color);
+ }
+
+ cache.font->draw_char(ci, Point2(char_ofs + char_margin, ofs_y + ascent), cchar, next, color);
+
+ char_ofs += im_char_width;
+ ofs++;
+ }
+ }
+ if (ime_text.length() == 0) {
+ if (draw_caret) {
+ if (insert_mode) {
+ int char_w = cache.font->get_char_size(' ').width;
+ int caret_h = (block_caret) ? 4 : 1;
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(char_w, caret_h)), cache.caret_color);
+ } else {
+ int char_w = cache.font->get_char_size(' ').width;
+ int caret_w = (block_caret) ? char_w : 1;
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, get_row_height())), cache.caret_color);
+ }
}
}
}
@@ -1063,16 +1128,16 @@ void TextEdit::_notification(int p_what) {
int th = h + csb->get_minimum_size().y;
if (cursor_pos.y + get_row_height() + th > get_size().height) {
- completion_rect.pos.y = cursor_pos.y - th;
+ completion_rect.position.y = cursor_pos.y - th;
} else {
- completion_rect.pos.y = cursor_pos.y + get_row_height() + csb->get_offset().y;
+ completion_rect.position.y = cursor_pos.y + get_row_height() + csb->get_offset().y;
completion_below = true;
}
if (cursor_pos.x - nofs + w + scrollw > get_size().width) {
- completion_rect.pos.x = get_size().width - w - scrollw;
+ completion_rect.position.x = get_size().width - w - scrollw;
} else {
- completion_rect.pos.x = cursor_pos.x - nofs;
+ completion_rect.position.x = cursor_pos.x - nofs;
}
completion_rect.size.width = w + 2;
@@ -1080,14 +1145,14 @@ void TextEdit::_notification(int p_what) {
if (completion_options.size() <= maxlines)
scrollw = 0;
- draw_style_box(csb, Rect2(completion_rect.pos - csb->get_offset(), completion_rect.size + csb->get_minimum_size() + Size2(scrollw, 0)));
+ draw_style_box(csb, Rect2(completion_rect.position - csb->get_offset(), completion_rect.size + csb->get_minimum_size() + Size2(scrollw, 0)));
if (cache.completion_background_color.a > 0.01) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(completion_rect.pos, completion_rect.size + Size2(scrollw, 0)), cache.completion_background_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(completion_rect.position, completion_rect.size + Size2(scrollw, 0)), cache.completion_background_color);
}
int line_from = CLAMP(completion_index - lines / 2, 0, completion_options.size() - lines);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(completion_rect.pos.x, completion_rect.pos.y + (completion_index - line_from) * get_row_height()), Size2(completion_rect.size.width, get_row_height())), cache.completion_selected_color);
- draw_rect(Rect2(completion_rect.pos, Size2(nofs, completion_rect.size.height)), cache.completion_existing_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(completion_rect.position.x, completion_rect.position.y + (completion_index - line_from) * get_row_height()), Size2(completion_rect.size.width, get_row_height())), cache.completion_selected_color);
+ draw_rect(Rect2(completion_rect.position, Size2(nofs, completion_rect.size.height)), cache.completion_existing_color);
for (int i = 0; i < lines; i++) {
@@ -1099,14 +1164,14 @@ void TextEdit::_notification(int p_what) {
text_color = color_regions[j].color;
}
}
- draw_string(cache.font, Point2(completion_rect.pos.x, completion_rect.pos.y + i * get_row_height() + cache.font->get_ascent()), completion_options[l], text_color, completion_rect.size.width);
+ draw_string(cache.font, Point2(completion_rect.position.x, completion_rect.position.y + i * get_row_height() + cache.font->get_ascent()), completion_options[l], text_color, completion_rect.size.width);
}
if (scrollw) {
//draw a small scroll rectangle to show a position in the options
float r = maxlines / (float)completion_options.size();
float o = line_from / (float)completion_options.size();
- draw_rect(Rect2(completion_rect.pos.x + completion_rect.size.width, completion_rect.pos.y + o * completion_rect.size.y, scrollw, completion_rect.size.y * r), scrollc);
+ draw_rect(Rect2(completion_rect.position.x + completion_rect.size.width, completion_rect.position.y + o * completion_rect.size.y, scrollw, completion_rect.size.y * r), scrollc);
}
completion_line_ofs = line_from;
@@ -1185,12 +1250,21 @@ void TextEdit::_notification(int p_what) {
}
}
+ if (has_focus()) {
+ OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos + Point2(0, get_row_height()));
+ OS::get_singleton()->set_ime_intermediate_text_callback(_ime_text_callback, this);
+ }
} break;
case NOTIFICATION_FOCUS_ENTER: {
if (!caret_blink_enabled) {
draw_caret = true;
}
+
+ Point2 cursor_pos = Point2(cursor_get_column(), cursor_get_line()) * get_row_height();
+ OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos);
+ OS::get_singleton()->set_ime_intermediate_text_callback(_ime_text_callback, this);
+
if (OS::get_singleton()->has_virtual_keyboard())
OS::get_singleton()->show_virtual_keyboard(get_text(), get_global_rect());
if (raised_from_completion) {
@@ -1200,6 +1274,11 @@ void TextEdit::_notification(int p_what) {
} break;
case NOTIFICATION_FOCUS_EXIT: {
+ OS::get_singleton()->set_ime_position(Point2());
+ OS::get_singleton()->set_ime_intermediate_text_callback(NULL, NULL);
+ ime_text = "";
+ ime_selection = Point2();
+
if (OS::get_singleton()->has_virtual_keyboard())
OS::get_singleton()->hide_virtual_keyboard();
if (raised_from_completion) {
@@ -1209,6 +1288,13 @@ void TextEdit::_notification(int p_what) {
}
}
+void TextEdit::_ime_text_callback(void *p_self, String p_text, Point2 p_selection) {
+ TextEdit *self = (TextEdit *)p_self;
+ self->ime_text = p_text;
+ self->ime_selection = p_selection;
+ self->update();
+}
+
void TextEdit::_consume_pair_symbol(CharType ch) {
int cursor_position_to_move = cursor_get_column() + 1;
@@ -1304,7 +1390,38 @@ void TextEdit::backspace_at_cursor() {
_is_pair_left_symbol(text[cursor.line][cursor.column - 1])) {
_consume_backspace_for_pair_symbol(prev_line, prev_column);
} else {
- _remove_text(prev_line, prev_column, cursor.line, cursor.column);
+ // handle space indentation
+ if (cursor.column - indent_size >= 0 && indent_using_spaces) {
+
+ // if there is enough spaces to count as a tab
+ bool unindent = true;
+ for (int i = 1; i <= indent_size; i++) {
+ if (text[cursor.line][cursor.column - i] != ' ') {
+ unindent = false;
+ break;
+ }
+ }
+
+ // and it is before the first character
+ int i = 0;
+ while (i < cursor.column && i < text[cursor.line].length()) {
+ if (text[cursor.line][i] != ' ' && text[cursor.line][i] != '\t') {
+ unindent = false;
+ break;
+ }
+ i++;
+ }
+
+ // then we can remove it as a single character.
+ if (unindent) {
+ _remove_text(cursor.line, cursor.column - indent_size, cursor.line, cursor.column);
+ prev_column = cursor.column - indent_size;
+ } else {
+ _remove_text(prev_line, prev_column, cursor.line, cursor.column);
+ }
+ } else {
+ _remove_text(prev_line, prev_column, cursor.line, cursor.column);
+ }
}
cursor_set_line(prev_line);
@@ -1327,7 +1444,11 @@ void TextEdit::indent_selection_right() {
for (int i = start_line; i <= end_line; i++) {
String line_text = get_line(i);
- line_text = '\t' + line_text;
+ if (indent_using_spaces) {
+ line_text = space_indent + line_text;
+ } else {
+ line_text = '\t' + line_text;
+ }
set_line(i, line_text);
}
@@ -1358,8 +1479,8 @@ void TextEdit::indent_selection_left() {
if (line_text.begins_with("\t")) {
line_text = line_text.substr(1, line_text.length());
set_line(i, line_text);
- } else if (line_text.begins_with(" ")) {
- line_text = line_text.substr(4, line_text.length());
+ } else if (line_text.begins_with(space_indent)) {
+ line_text = line_text.substr(indent_size, line_text.length());
set_line(i, line_text);
}
}
@@ -1399,1227 +1520,1262 @@ void TextEdit::_get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) co
r_col = col;
}
-void TextEdit::_gui_input(const InputEvent &p_gui_input) {
-
- switch (p_gui_input.type) {
+void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
- case InputEvent::MOUSE_BUTTON: {
+ Ref<InputEventMouseButton> mb = p_gui_input;
- const InputEventMouseButton &mb = p_gui_input.mouse_button;
+ if (mb.is_valid()) {
+ if (completion_active && completion_rect.has_point(mb->get_position())) {
- if (completion_active && completion_rect.has_point(Point2(mb.x, mb.y))) {
-
- if (!mb.pressed)
- return;
+ if (!mb->is_pressed())
+ return;
- if (mb.button_index == BUTTON_WHEEL_UP) {
- if (completion_index > 0) {
- completion_index--;
- completion_current = completion_options[completion_index];
- update();
- }
+ if (mb->get_button_index() == BUTTON_WHEEL_UP) {
+ if (completion_index > 0) {
+ completion_index--;
+ completion_current = completion_options[completion_index];
+ update();
}
- if (mb.button_index == BUTTON_WHEEL_DOWN) {
+ }
+ if (mb->get_button_index() == BUTTON_WHEEL_DOWN) {
- if (completion_index < completion_options.size() - 1) {
- completion_index++;
- completion_current = completion_options[completion_index];
- update();
- }
+ if (completion_index < completion_options.size() - 1) {
+ completion_index++;
+ completion_current = completion_options[completion_index];
+ update();
}
+ }
- if (mb.button_index == BUTTON_LEFT) {
+ if (mb->get_button_index() == BUTTON_LEFT) {
- completion_index = CLAMP(completion_line_ofs + (mb.y - completion_rect.pos.y) / get_row_height(), 0, completion_options.size() - 1);
+ completion_index = CLAMP(completion_line_ofs + (mb->get_position().y - completion_rect.position.y) / get_row_height(), 0, completion_options.size() - 1);
- completion_current = completion_options[completion_index];
- update();
- if (mb.doubleclick)
- _confirm_completion();
- }
- return;
- } else {
- _cancel_completion();
- _cancel_code_hint();
+ completion_current = completion_options[completion_index];
+ update();
+ if (mb->is_doubleclick())
+ _confirm_completion();
}
+ return;
+ } else {
+ _cancel_completion();
+ _cancel_code_hint();
+ }
- if (mb.pressed) {
- if (mb.button_index == BUTTON_WHEEL_UP && !mb.mod.command) {
- v_scroll->set_value(v_scroll->get_value() - 3);
- }
- if (mb.button_index == BUTTON_WHEEL_DOWN && !mb.mod.command) {
- v_scroll->set_value(v_scroll->get_value() + 3);
- }
- if (mb.button_index == BUTTON_WHEEL_LEFT) {
- h_scroll->set_value(h_scroll->get_value() - 3);
- }
- if (mb.button_index == BUTTON_WHEEL_RIGHT) {
- h_scroll->set_value(h_scroll->get_value() + 3);
- }
- if (mb.button_index == BUTTON_LEFT) {
+ if (mb->is_pressed()) {
- _reset_caret_blink_timer();
+ if (mb->get_button_index() == BUTTON_WHEEL_UP && !mb->get_command()) {
+ v_scroll->set_value(v_scroll->get_value() - (3 * mb->get_factor()));
+ }
+ if (mb->get_button_index() == BUTTON_WHEEL_DOWN && !mb->get_command()) {
+ v_scroll->set_value(v_scroll->get_value() + (3 * mb->get_factor()));
+ }
+ if (mb->get_button_index() == BUTTON_WHEEL_LEFT) {
+ h_scroll->set_value(h_scroll->get_value() - (100 * mb->get_factor()));
+ }
+ if (mb->get_button_index() == BUTTON_WHEEL_RIGHT) {
+ h_scroll->set_value(h_scroll->get_value() + (100 * mb->get_factor()));
+ }
+ if (mb->get_button_index() == BUTTON_LEFT) {
+
+ _reset_caret_blink_timer();
- int row, col;
- _get_mouse_pos(Point2i(mb.x, mb.y), row, col);
+ int row, col;
+ _get_mouse_pos(Point2i(mb->get_position().x, mb->get_position().y), row, col);
- if (mb.mod.command && hilighted_word != String()) {
+ if (mb->get_command() && highlighted_word != String()) {
- emit_signal("symbol_lookup", hilighted_word, row, col);
+ emit_signal("symbol_lookup", highlighted_word, row, col);
+ return;
+ }
+
+ // toggle breakpoint on gutter click
+ if (draw_breakpoint_gutter) {
+ int gutter = cache.style_normal->get_margin(MARGIN_LEFT);
+ if (mb->get_position().x > gutter && mb->get_position().x <= gutter + cache.breakpoint_gutter_width + 3) {
+ set_line_as_breakpoint(row, !is_line_set_as_breakpoint(row));
+ emit_signal("breakpoint_toggled", row);
return;
}
+ }
- // toggle breakpoint on gutter click
- if (draw_breakpoint_gutter) {
- int gutter = cache.style_normal->get_margin(MARGIN_LEFT);
- if (mb.x > gutter && mb.x <= gutter + cache.breakpoint_gutter_width + 3) {
- set_line_as_breakpoint(row, !is_line_set_as_breakpoint(row));
- emit_signal("breakpoint_toggled", row);
- return;
- }
- }
+ int prev_col = cursor.column;
+ int prev_line = cursor.line;
- int prev_col = cursor.column;
- int prev_line = cursor.line;
+ cursor_set_line(row);
+ cursor_set_column(col);
- cursor_set_line(row);
- cursor_set_column(col);
+ if (mb->get_shift() && (cursor.column != prev_col || cursor.line != prev_line)) {
- if (mb.mod.shift && (cursor.column != prev_col || cursor.line != prev_line)) {
+ if (!selection.active) {
+ selection.active = true;
+ selection.selecting_mode = Selection::MODE_POINTER;
+ selection.from_column = prev_col;
+ selection.from_line = prev_line;
+ selection.to_column = cursor.column;
+ selection.to_line = cursor.line;
+
+ if (selection.from_line > selection.to_line || (selection.from_line == selection.to_line && selection.from_column > selection.to_column)) {
+ SWAP(selection.from_column, selection.to_column);
+ SWAP(selection.from_line, selection.to_line);
+ selection.shiftclick_left = false;
+ } else {
+ selection.shiftclick_left = true;
+ }
+ selection.selecting_line = prev_line;
+ selection.selecting_column = prev_col;
+ update();
+ } else {
- if (!selection.active) {
- selection.active = true;
- selection.selecting_mode = Selection::MODE_POINTER;
- selection.from_column = prev_col;
- selection.from_line = prev_line;
- selection.to_column = cursor.column;
- selection.to_line = cursor.line;
+ if (cursor.line < selection.selecting_line || (cursor.line == selection.selecting_line && cursor.column < selection.selecting_column)) {
- if (selection.from_line > selection.to_line || (selection.from_line == selection.to_line && selection.from_column > selection.to_column)) {
+ if (selection.shiftclick_left) {
SWAP(selection.from_column, selection.to_column);
SWAP(selection.from_line, selection.to_line);
- selection.shiftclick_left = false;
- } else {
- selection.shiftclick_left = true;
+ selection.shiftclick_left = !selection.shiftclick_left;
}
- selection.selecting_line = prev_line;
- selection.selecting_column = prev_col;
- update();
- } else {
+ selection.from_column = cursor.column;
+ selection.from_line = cursor.line;
- if (cursor.line < selection.selecting_line || (cursor.line == selection.selecting_line && cursor.column < selection.selecting_column)) {
-
- if (selection.shiftclick_left) {
- SWAP(selection.from_column, selection.to_column);
- SWAP(selection.from_line, selection.to_line);
- selection.shiftclick_left = !selection.shiftclick_left;
- }
- selection.from_column = cursor.column;
- selection.from_line = cursor.line;
-
- } else if (cursor.line > selection.selecting_line || (cursor.line == selection.selecting_line && cursor.column > selection.selecting_column)) {
-
- if (!selection.shiftclick_left) {
- SWAP(selection.from_column, selection.to_column);
- SWAP(selection.from_line, selection.to_line);
- selection.shiftclick_left = !selection.shiftclick_left;
- }
- selection.to_column = cursor.column;
- selection.to_line = cursor.line;
+ } else if (cursor.line > selection.selecting_line || (cursor.line == selection.selecting_line && cursor.column > selection.selecting_column)) {
- } else {
- selection.active = false;
+ if (!selection.shiftclick_left) {
+ SWAP(selection.from_column, selection.to_column);
+ SWAP(selection.from_line, selection.to_line);
+ selection.shiftclick_left = !selection.shiftclick_left;
}
+ selection.to_column = cursor.column;
+ selection.to_line = cursor.line;
- update();
+ } else {
+ selection.active = false;
}
- } else {
-
- //if sel active and dblick last time < something
-
- //else
- selection.active = false;
- selection.selecting_mode = Selection::MODE_POINTER;
- selection.selecting_line = row;
- selection.selecting_column = col;
+ update();
}
- if (!mb.doubleclick && (OS::get_singleton()->get_ticks_msec() - last_dblclk) < 600 && cursor.line == prev_line) {
- //tripleclick select line
- select(cursor.line, 0, cursor.line, text[cursor.line].length());
- selection.selecting_column = 0;
- last_dblclk = 0;
+ } else {
- } else if (mb.doubleclick && text[cursor.line].length()) {
+ //if sel active and dblick last time < something
- //doubleclick select world
- String s = text[cursor.line];
- int beg = CLAMP(cursor.column, 0, s.length());
- int end = beg;
+ //else
+ selection.active = false;
+ selection.selecting_mode = Selection::MODE_POINTER;
+ selection.selecting_line = row;
+ selection.selecting_column = col;
+ }
- if (s[beg] > 32 || beg == s.length()) {
+ if (!mb->is_doubleclick() && (OS::get_singleton()->get_ticks_msec() - last_dblclk) < 600 && cursor.line == prev_line) {
+ //tripleclick select line
+ select(cursor.line, 0, cursor.line, text[cursor.line].length());
+ selection.selecting_column = 0;
+ last_dblclk = 0;
- bool symbol = beg < s.length() && _is_symbol(s[beg]); //not sure if right but most editors behave like this
+ } else if (mb->is_doubleclick() && text[cursor.line].length()) {
- while (beg > 0 && s[beg - 1] > 32 && (symbol == _is_symbol(s[beg - 1]))) {
- beg--;
- }
- while (end < s.length() && s[end + 1] > 32 && (symbol == _is_symbol(s[end + 1]))) {
- end++;
- }
+ //doubleclick select world
+ String s = text[cursor.line];
+ int beg = CLAMP(cursor.column, 0, s.length());
+ int end = beg;
- if (end < s.length())
- end += 1;
+ if (s[beg] > 32 || beg == s.length()) {
- select(cursor.line, beg, cursor.line, end);
+ bool symbol = beg < s.length() && _is_symbol(s[beg]); //not sure if right but most editors behave like this
- selection.selecting_column = beg;
+ while (beg > 0 && s[beg - 1] > 32 && (symbol == _is_symbol(s[beg - 1]))) {
+ beg--;
+ }
+ while (end < s.length() && s[end + 1] > 32 && (symbol == _is_symbol(s[end + 1]))) {
+ end++;
}
- last_dblclk = OS::get_singleton()->get_ticks_msec();
- }
+ if (end < s.length())
+ end += 1;
- update();
- }
+ select(cursor.line, beg, cursor.line, end);
- if (mb.button_index == BUTTON_RIGHT && context_menu_enabled) {
+ selection.selecting_column = beg;
+ }
- menu->set_pos(get_global_transform().xform(get_local_mouse_pos()));
- menu->set_size(Vector2(1, 1));
- menu->popup();
- grab_focus();
+ last_dblclk = OS::get_singleton()->get_ticks_msec();
}
- } else {
- if (mb.button_index == BUTTON_LEFT)
- click_select_held->stop();
+ update();
+ }
+
+ if (mb->get_button_index() == BUTTON_RIGHT && context_menu_enabled) {
- // notify to show soft keyboard
- notification(NOTIFICATION_FOCUS_ENTER);
+ menu->set_position(get_global_transform().xform(get_local_mouse_pos()));
+ menu->set_size(Vector2(1, 1));
+ menu->popup();
+ grab_focus();
}
+ } else {
- } break;
- case InputEvent::MOUSE_MOTION: {
+ if (mb->get_button_index() == BUTTON_LEFT)
+ click_select_held->stop();
- const InputEventMouseMotion &mm = p_gui_input.mouse_motion;
+ // notify to show soft keyboard
+ notification(NOTIFICATION_FOCUS_ENTER);
+ }
+ }
- if (select_identifiers_enabled) {
- if (mm.mod.command && mm.button_mask == 0) {
+ Ref<InputEventMouseMotion> mm = p_gui_input;
- String new_word = get_word_at_pos(Vector2(mm.x, mm.y));
- if (new_word != hilighted_word) {
- hilighted_word = new_word;
- update();
- }
- } else {
- if (hilighted_word != String()) {
- hilighted_word = String();
- update();
- }
+ if (mm.is_valid()) {
+
+ if (select_identifiers_enabled) {
+ if (mm->get_command() && mm->get_button_mask() == 0) {
+
+ String new_word = get_word_at_pos(mm->get_position());
+ if (new_word != highlighted_word) {
+ highlighted_word = new_word;
+ update();
+ }
+ } else {
+ if (highlighted_word != String()) {
+ highlighted_word = String();
+ update();
}
}
+ }
- if (mm.button_mask & BUTTON_MASK_LEFT && get_viewport()->gui_get_drag_data() == Variant()) { //ignore if dragging
+ if (mm->get_button_mask() & BUTTON_MASK_LEFT && get_viewport()->gui_get_drag_data() == Variant()) { //ignore if dragging
- if (selection.selecting_mode != Selection::MODE_NONE) {
+ if (selection.selecting_mode != Selection::MODE_NONE) {
- _reset_caret_blink_timer();
+ _reset_caret_blink_timer();
- int row, col;
- _get_mouse_pos(Point2i(mm.x, mm.y), row, col);
+ int row, col;
+ _get_mouse_pos(mm->get_position(), row, col);
- select(selection.selecting_line, selection.selecting_column, row, col);
+ select(selection.selecting_line, selection.selecting_column, row, col);
- cursor_set_line(row);
- cursor_set_column(col);
- update();
+ cursor_set_line(row);
+ cursor_set_column(col);
+ update();
- click_select_held->start();
- }
+ click_select_held->start();
}
+ }
+ }
- } break;
+ Ref<InputEventKey> k = p_gui_input;
- case InputEvent::KEY: {
+ if (k.is_valid()) {
- InputEventKey k = p_gui_input.key;
+ k = k->duplicate(); //it will be modified later on
#ifdef OSX_ENABLED
- if (k.scancode == KEY_META) {
+ if (k->get_scancode() == KEY_META) {
#else
- if (k.scancode == KEY_CONTROL) {
+ if (k->get_scancode() == KEY_CONTROL) {
#endif
- if (select_identifiers_enabled) {
+ if (select_identifiers_enabled) {
- if (k.pressed) {
+ if (k->is_pressed()) {
- hilighted_word = get_word_at_pos(get_local_mouse_pos());
- update();
+ highlighted_word = get_word_at_pos(get_local_mouse_pos());
+ update();
- } else {
- hilighted_word = String();
- update();
- }
+ } else {
+ highlighted_word = String();
+ update();
}
}
+ }
- if (!k.pressed)
- return;
-
- if (completion_active) {
- if (readonly)
- break;
-
- bool valid = true;
- if (k.mod.command || k.mod.meta)
- valid = false;
-
- if (valid) {
-
- if (!k.mod.alt) {
- if (k.scancode == KEY_UP) {
+ if (!k->is_pressed())
+ return;
- if (completion_index > 0) {
- completion_index--;
- completion_current = completion_options[completion_index];
- update();
- }
- accept_event();
- return;
- }
+ if (completion_active) {
+ if (readonly)
+ return;
- if (k.scancode == KEY_DOWN) {
+ bool valid = true;
+ if (k->get_command() || k->get_metakey())
+ valid = false;
- if (completion_index < completion_options.size() - 1) {
- completion_index++;
- completion_current = completion_options[completion_index];
- update();
- }
- accept_event();
- return;
- }
+ if (valid) {
- if (k.scancode == KEY_PAGEUP) {
+ if (!k->get_alt()) {
+ if (k->get_scancode() == KEY_UP) {
- completion_index -= get_constant("completion_lines");
- if (completion_index < 0)
- completion_index = 0;
+ if (completion_index > 0) {
+ completion_index--;
completion_current = completion_options[completion_index];
update();
- accept_event();
- return;
}
+ accept_event();
+ return;
+ }
- if (k.scancode == KEY_PAGEDOWN) {
+ if (k->get_scancode() == KEY_DOWN) {
- completion_index += get_constant("completion_lines");
- if (completion_index >= completion_options.size())
- completion_index = completion_options.size() - 1;
+ if (completion_index < completion_options.size() - 1) {
+ completion_index++;
completion_current = completion_options[completion_index];
update();
- accept_event();
- return;
}
+ accept_event();
+ return;
+ }
- if (k.scancode == KEY_HOME && completion_index > 0) {
+ if (k->get_scancode() == KEY_PAGEUP) {
+ completion_index -= get_constant("completion_lines");
+ if (completion_index < 0)
completion_index = 0;
- completion_current = completion_options[completion_index];
- update();
- accept_event();
- return;
- }
+ completion_current = completion_options[completion_index];
+ update();
+ accept_event();
+ return;
+ }
- if (k.scancode == KEY_END && completion_index < completion_options.size() - 1) {
+ if (k->get_scancode() == KEY_PAGEDOWN) {
+ completion_index += get_constant("completion_lines");
+ if (completion_index >= completion_options.size())
completion_index = completion_options.size() - 1;
- completion_current = completion_options[completion_index];
- update();
- accept_event();
- return;
- }
-
- if (k.scancode == KEY_DOWN) {
+ completion_current = completion_options[completion_index];
+ update();
+ accept_event();
+ return;
+ }
- if (completion_index < completion_options.size() - 1) {
- completion_index++;
- completion_current = completion_options[completion_index];
- update();
- }
- accept_event();
- return;
- }
+ if (k->get_scancode() == KEY_HOME && completion_index > 0) {
- if (k.scancode == KEY_ENTER || k.scancode == KEY_RETURN || k.scancode == KEY_TAB) {
+ completion_index = 0;
+ completion_current = completion_options[completion_index];
+ update();
+ accept_event();
+ return;
+ }
- _confirm_completion();
- accept_event();
- return;
- }
+ if (k->get_scancode() == KEY_END && completion_index < completion_options.size() - 1) {
- if (k.scancode == KEY_BACKSPACE) {
+ completion_index = completion_options.size() - 1;
+ completion_current = completion_options[completion_index];
+ update();
+ accept_event();
+ return;
+ }
- _reset_caret_blink_timer();
+ if (k->get_scancode() == KEY_DOWN) {
- backspace_at_cursor();
- _update_completion_candidates();
- accept_event();
- return;
+ if (completion_index < completion_options.size() - 1) {
+ completion_index++;
+ completion_current = completion_options[completion_index];
+ update();
}
+ accept_event();
+ return;
+ }
- if (k.scancode == KEY_SHIFT) {
- accept_event();
- return;
- }
+ if (k->get_scancode() == KEY_KP_ENTER || k->get_scancode() == KEY_ENTER || k->get_scancode() == KEY_TAB) {
+
+ _confirm_completion();
+ accept_event();
+ return;
}
- if (k.unicode > 32) {
+ if (k->get_scancode() == KEY_BACKSPACE) {
_reset_caret_blink_timer();
- const CharType chr[2] = { (CharType)k.unicode, 0 };
- if (auto_brace_completion_enabled && _is_pair_symbol(chr[0])) {
- _consume_pair_symbol(chr[0]);
- } else {
+ backspace_at_cursor();
+ _update_completion_candidates();
+ accept_event();
+ return;
+ }
- // remove the old character if in insert mode
- if (insert_mode) {
- begin_complex_operation();
+ if (k->get_scancode() == KEY_SHIFT) {
+ accept_event();
+ return;
+ }
+ }
- // make sure we don't try and remove empty space
- if (cursor.column < get_line(cursor.line).length()) {
- _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1);
- }
- }
+ if (k->get_unicode() > 32) {
- _insert_text_at_cursor(chr);
+ _reset_caret_blink_timer();
- if (insert_mode) {
- end_complex_operation();
+ const CharType chr[2] = { (CharType)k->get_unicode(), 0 };
+ if (auto_brace_completion_enabled && _is_pair_symbol(chr[0])) {
+ _consume_pair_symbol(chr[0]);
+ } else {
+
+ // remove the old character if in insert mode
+ if (insert_mode) {
+ begin_complex_operation();
+
+ // make sure we don't try and remove empty space
+ if (cursor.column < get_line(cursor.line).length()) {
+ _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1);
}
}
- _update_completion_candidates();
- accept_event();
- return;
+ _insert_text_at_cursor(chr);
+
+ if (insert_mode) {
+ end_complex_operation();
+ }
}
- }
+ _update_completion_candidates();
+ accept_event();
- _cancel_completion();
+ return;
+ }
}
- /* TEST CONTROL FIRST!! */
+ _cancel_completion();
+ }
+
+ /* TEST CONTROL FIRST!! */
- // some remaps for duplicate functions..
- if (k.mod.command && !k.mod.shift && !k.mod.alt && !k.mod.meta && k.scancode == KEY_INSERT) {
+ // some remaps for duplicate functions..
+ if (k->get_command() && !k->get_shift() && !k->get_alt() && !k->get_metakey() && k->get_scancode() == KEY_INSERT) {
- k.scancode = KEY_C;
- }
- if (!k.mod.command && k.mod.shift && !k.mod.alt && !k.mod.meta && k.scancode == KEY_INSERT) {
+ k->set_scancode(KEY_C);
+ }
+ if (!k->get_command() && k->get_shift() && !k->get_alt() && !k->get_metakey() && k->get_scancode() == KEY_INSERT) {
- k.scancode = KEY_V;
- k.mod.command = true;
- k.mod.shift = false;
- }
+ k->set_scancode(KEY_V);
+ k->set_command(true);
+ k->set_shift(false);
+ }
- if (!k.mod.command) {
- _reset_caret_blink_timer();
- }
+ if (!k->get_command()) {
+ _reset_caret_blink_timer();
+ }
- // save here for insert mode, just in case it is cleared in the following section
- bool had_selection = selection.active;
+ // save here for insert mode, just in case it is cleared in the following section
+ bool had_selection = selection.active;
- // stuff to do when selection is active..
- if (selection.active) {
+ // stuff to do when selection is active..
+ if (selection.active) {
- if (readonly)
- break;
+ if (readonly)
+ return;
- bool clear = false;
- bool unselect = false;
- bool dobreak = false;
+ bool clear = false;
+ bool unselect = false;
+ bool dobreak = false;
- switch (k.scancode) {
+ switch (k->get_scancode()) {
- case KEY_TAB: {
- if (k.mod.shift) {
- indent_selection_left();
- } else {
- indent_selection_right();
- }
- dobreak = true;
- accept_event();
- } break;
- case KEY_X:
- case KEY_C:
- //special keys often used with control, wait...
- clear = (!k.mod.command || k.mod.shift || k.mod.alt);
- break;
- case KEY_DELETE:
- if (!k.mod.shift) {
- accept_event();
- clear = true;
- dobreak = true;
- } else if (k.mod.command || k.mod.alt) {
- dobreak = true;
- }
- break;
- case KEY_BACKSPACE:
+ case KEY_TAB: {
+ if (k->get_shift()) {
+ indent_selection_left();
+ } else {
+ indent_selection_right();
+ }
+ dobreak = true;
+ accept_event();
+ } break;
+ case KEY_X:
+ case KEY_C:
+ //special keys often used with control, wait...
+ clear = (!k->get_command() || k->get_shift() || k->get_alt());
+ break;
+ case KEY_DELETE:
+ if (!k->get_shift()) {
accept_event();
clear = true;
dobreak = true;
+ } else if (k->get_command() || k->get_alt()) {
+ dobreak = true;
+ }
+ break;
+ case KEY_BACKSPACE:
+ accept_event();
+ clear = true;
+ dobreak = true;
+ break;
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ case KEY_UP:
+ case KEY_DOWN:
+ case KEY_PAGEUP:
+ case KEY_PAGEDOWN:
+ case KEY_HOME:
+ case KEY_END:
+ // ignore arrows if any modifiers are held (shift = selecting, others may be used for editor hotkeys)
+ if (k->get_command() || k->get_shift() || k->get_alt())
break;
- case KEY_LEFT:
- case KEY_RIGHT:
- case KEY_UP:
- case KEY_DOWN:
- case KEY_PAGEUP:
- case KEY_PAGEDOWN:
- case KEY_HOME:
- case KEY_END:
- // ignore arrows if any modifiers are held (shift = selecting, others may be used for editor hotkeys)
- if (k.mod.command || k.mod.shift || k.mod.alt)
- break;
- unselect = true;
- break;
+ unselect = true;
+ break;
- default:
- if (k.unicode >= 32 && !k.mod.command && !k.mod.alt && !k.mod.meta)
- clear = true;
- if (auto_brace_completion_enabled && _is_pair_left_symbol(k.unicode))
- clear = false;
- }
+ default:
+ if (k->get_unicode() >= 32 && !k->get_command() && !k->get_alt() && !k->get_metakey())
+ clear = true;
+ if (auto_brace_completion_enabled && _is_pair_left_symbol(k->get_unicode()))
+ clear = false;
+ }
- if (unselect) {
- selection.active = false;
- selection.selecting_mode = Selection::MODE_NONE;
- update();
- }
- if (clear) {
+ if (unselect) {
+ selection.active = false;
+ selection.selecting_mode = Selection::MODE_NONE;
+ update();
+ }
+ if (clear) {
- if (!dobreak) {
- begin_complex_operation();
- }
- selection.active = false;
- update();
- _remove_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column);
- cursor_set_line(selection.from_line);
- cursor_set_column(selection.from_column);
- update();
+ if (!dobreak) {
+ begin_complex_operation();
}
- if (dobreak)
- break;
+ selection.active = false;
+ update();
+ _remove_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column);
+ cursor_set_line(selection.from_line);
+ cursor_set_column(selection.from_column);
+ update();
}
+ if (dobreak)
+ return;
+ }
- selection.selecting_text = false;
+ selection.selecting_text = false;
- bool scancode_handled = true;
+ bool scancode_handled = true;
- // special scancode test...
+ // special scancode test...
- switch (k.scancode) {
+ switch (k->get_scancode()) {
- case KEY_ENTER:
- case KEY_RETURN: {
+ case KEY_KP_ENTER:
+ case KEY_ENTER: {
- if (readonly)
- break;
+ if (readonly)
+ break;
- String ins = "\n";
+ String ins = "\n";
- //keep indentation
- for (int i = 0; i < text[cursor.line].length(); i++) {
- if (text[cursor.line][i] == '\t')
- ins += "\t";
- else
- break;
- }
- if (auto_indent) {
- // indent once again if previous line will end with ':'
- // (i.e. colon precedes current cursor position)
- if (cursor.column > 0 && text[cursor.line][cursor.column - 1] == ':') {
+ //keep indentation
+ int space_count = 0;
+ for (int i = 0; i < text[cursor.line].length(); i++) {
+ if (text[cursor.line][i] == '\t') {
+ if (indent_using_spaces) {
+ ins += space_indent;
+ } else {
ins += "\t";
}
- }
+ space_count = 0;
+ } else if (text[cursor.line][i] == ' ') {
+ space_count++;
- bool first_line = false;
- if (k.mod.command) {
- if (k.mod.shift) {
- if (cursor.line > 0) {
- cursor_set_line(cursor.line - 1);
- cursor_set_column(text[cursor.line].length());
+ if (space_count == indent_size) {
+ if (indent_using_spaces) {
+ ins += space_indent;
} else {
- cursor_set_column(0);
- first_line = true;
+ ins += "\t";
}
- } else {
- cursor_set_column(text[cursor.line].length());
+ space_count = 0;
}
+ } else {
+ break;
}
-
- _insert_text_at_cursor(ins);
- _push_current_op();
-
- if (first_line) {
- cursor_set_line(0);
+ }
+ if (auto_indent) {
+ // indent once again if previous line will end with ':'
+ // (i.e. colon precedes current cursor position)
+ if (cursor.column > 0 && text[cursor.line][cursor.column - 1] == ':') {
+ if (indent_using_spaces) {
+ ins += space_indent;
+ } else {
+ ins += "\t";
+ }
}
+ }
- } break;
- case KEY_ESCAPE: {
- if (completion_hint != "") {
- completion_hint = "";
- update();
+ bool first_line = false;
+ if (k->get_command()) {
+ if (k->get_shift()) {
+ if (cursor.line > 0) {
+ cursor_set_line(cursor.line - 1);
+ cursor_set_column(text[cursor.line].length());
+ } else {
+ cursor_set_column(0);
+ first_line = true;
+ }
} else {
- scancode_handled = false;
+ cursor_set_column(text[cursor.line].length());
}
- } break;
- case KEY_TAB: {
- if (k.mod.command) break; // avoid tab when command
+ }
- if (readonly)
- break;
+ _insert_text_at_cursor(ins);
+ _push_current_op();
- if (selection.active) {
+ if (first_line) {
+ cursor_set_line(0);
+ }
- } else {
- if (k.mod.shift) {
+ } break;
+ case KEY_ESCAPE: {
+ if (completion_hint != "") {
+ completion_hint = "";
+ update();
+ } else {
+ scancode_handled = false;
+ }
+ } break;
+ case KEY_TAB: {
+ if (k->get_command()) break; // avoid tab when command
+
+ if (readonly)
+ break;
- int cc = cursor.column;
- if (cc > 0 && cc <= text[cursor.line].length() && text[cursor.line][cursor.column - 1] == '\t') {
- //simple unindent
+ if (selection.active) {
+ } else {
+ if (k->get_shift()) {
+
+ //simple unindent
+ int cc = cursor.column;
+ if (cc > 0 && cc <= text[cursor.line].length()) {
+ if (text[cursor.line][cursor.column - 1] == '\t') {
backspace_at_cursor();
+ } else {
+ if (cursor.column - indent_size >= 0) {
+
+ bool unindent = true;
+ for (int i = 1; i <= indent_size; i++) {
+ if (text[cursor.line][cursor.column - i] != ' ') {
+ unindent = false;
+ break;
+ }
+ }
+
+ if (unindent) {
+ _remove_text(cursor.line, cursor.column - indent_size, cursor.line, cursor.column);
+ cursor_set_column(cursor.column - indent_size);
+ }
+ }
}
+ }
+ } else {
+ //simple indent
+ if (indent_using_spaces) {
+ _insert_text_at_cursor(space_indent);
} else {
- //simple indent
_insert_text_at_cursor("\t");
}
}
+ }
- } break;
- case KEY_BACKSPACE: {
- if (readonly)
- break;
+ } break;
+ case KEY_BACKSPACE: {
+ if (readonly)
+ break;
#ifdef APPLE_STYLE_KEYS
- if (k.mod.alt) {
+ if (k->get_alt() && cursor.column > 1) {
#else
- if (k.mod.alt) {
- scancode_handled = false;
- break;
- } else if (k.mod.command) {
+ if (k->get_alt()) {
+ scancode_handled = false;
+ break;
+ } else if (k->get_command() && cursor.column > 1) {
#endif
- int line = cursor.line;
- int column = cursor.column;
-
- bool prev_char = false;
- bool only_whitespace = true;
-
- while (only_whitespace && line > 0) {
-
- while (column > 0) {
- CharType c = text[line][column - 1];
-
- if (c != '\t' && c != ' ') {
- only_whitespace = false;
- break;
- }
-
- column--;
- }
+ int line = cursor.line;
+ int column = cursor.column;
+
+ // check if we are removing a single whitespace, if so remove it and the next char type
+ // else we just remove the whitespace
+ bool only_whitespace = false;
+ if (_is_whitespace(text[line][column - 1]) && _is_whitespace(text[line][column - 2])) {
+ only_whitespace = true;
+ } else if (_is_whitespace(text[line][column - 1])) {
+ // remove the single whitespace
+ column--;
+ }
- if (only_whitespace) {
- line--;
- column = text[line].length();
- }
- }
+ // check if its a text char
+ bool only_char = (_is_text_char(text[line][column - 1]) && !only_whitespace);
- while (column > 0) {
- bool ischar = _is_text_char(text[line][column - 1]);
+ // if its not whitespace or char then symbol.
+ bool only_symbols = !(only_whitespace || only_char);
- if (prev_char && !ischar)
- break;
+ while (column > 0) {
+ bool is_whitespace = _is_whitespace(text[line][column - 1]);
+ bool is_text_char = _is_text_char(text[line][column - 1]);
- prev_char = ischar;
- column--;
+ if (only_whitespace && !is_whitespace) {
+ break;
+ } else if (only_char && !is_text_char) {
+ break;
+ } else if (only_symbols && (is_whitespace || is_text_char)) {
+ break;
}
+ column--;
+ }
- _remove_text(line, column, cursor.line, cursor.column);
+ _remove_text(line, column, cursor.line, cursor.column);
- cursor_set_line(line);
- cursor_set_column(column);
+ cursor_set_line(line);
+ cursor_set_column(column);
- } else {
- backspace_at_cursor();
- }
+ } else {
+ backspace_at_cursor();
+ }
- } break;
- case KEY_KP_4: {
- if (k.unicode != 0) {
- scancode_handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_left
+ } break;
+ case KEY_KP_4: {
+ if (k->get_unicode() != 0) {
+ scancode_handled = false;
+ break;
}
- case KEY_LEFT: {
+ // numlock disabled. fallthrough to key_left
+ }
+ case KEY_LEFT: {
- if (k.mod.shift)
- _pre_shift_selection();
+ if (k->get_shift())
+ _pre_shift_selection();
#ifdef APPLE_STYLE_KEYS
- else
+ else
#else
- else if (!k.mod.alt)
+ else if (!k->get_alt())
#endif
- deselect();
+ deselect();
#ifdef APPLE_STYLE_KEYS
- if (k.mod.command) {
- cursor_set_column(0);
- } else if (k.mod.alt) {
+ if (k->get_command()) {
+ cursor_set_column(0);
+ } else if (k->get_alt()) {
#else
- if (k.mod.alt) {
- scancode_handled = false;
- break;
- } else if (k.mod.command) {
+ if (k->get_alt()) {
+ scancode_handled = false;
+ break;
+ } else if (k->get_command()) {
#endif
- bool prev_char = false;
- int cc = cursor.column;
- while (cc > 0) {
+ bool prev_char = false;
+ int cc = cursor.column;
+ while (cc > 0) {
- bool ischar = _is_text_char(text[cursor.line][cc - 1]);
+ bool ischar = _is_text_char(text[cursor.line][cc - 1]);
- if (prev_char && !ischar)
- break;
+ if (prev_char && !ischar)
+ break;
- prev_char = ischar;
- cc--;
- }
+ prev_char = ischar;
+ cc--;
+ }
- cursor_set_column(cc);
+ cursor_set_column(cc);
- } else if (cursor.column == 0) {
+ } else if (cursor.column == 0) {
- if (cursor.line > 0) {
- cursor_set_line(cursor.line - 1);
- cursor_set_column(text[cursor.line].length());
- }
- } else {
- cursor_set_column(cursor_get_column() - 1);
+ if (cursor.line > 0) {
+ cursor_set_line(cursor.line - 1);
+ cursor_set_column(text[cursor.line].length());
}
+ } else {
+ cursor_set_column(cursor_get_column() - 1);
+ }
- if (k.mod.shift)
- _post_shift_selection();
+ if (k->get_shift())
+ _post_shift_selection();
- } break;
- case KEY_KP_6: {
- if (k.unicode != 0) {
- scancode_handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_right
+ } break;
+ case KEY_KP_6: {
+ if (k->get_unicode() != 0) {
+ scancode_handled = false;
+ break;
}
- case KEY_RIGHT: {
+ // numlock disabled. fallthrough to key_right
+ }
+ case KEY_RIGHT: {
- if (k.mod.shift)
- _pre_shift_selection();
+ if (k->get_shift())
+ _pre_shift_selection();
#ifdef APPLE_STYLE_KEYS
- else
+ else
#else
- else if (!k.mod.alt)
+ else if (!k->get_alt())
#endif
- deselect();
+ deselect();
#ifdef APPLE_STYLE_KEYS
- if (k.mod.command) {
- cursor_set_column(text[cursor.line].length());
- } else if (k.mod.alt) {
+ if (k->get_command()) {
+ cursor_set_column(text[cursor.line].length());
+ } else if (k->get_alt()) {
#else
- if (k.mod.alt) {
- scancode_handled = false;
- break;
- } else if (k.mod.command) {
+ if (k->get_alt()) {
+ scancode_handled = false;
+ break;
+ } else if (k->get_command()) {
#endif
- bool prev_char = false;
- int cc = cursor.column;
- while (cc < text[cursor.line].length()) {
+ bool prev_char = false;
+ int cc = cursor.column;
+ while (cc < text[cursor.line].length()) {
- bool ischar = _is_text_char(text[cursor.line][cc]);
+ bool ischar = _is_text_char(text[cursor.line][cc]);
- if (prev_char && !ischar)
- break;
- prev_char = ischar;
- cc++;
- }
+ if (prev_char && !ischar)
+ break;
+ prev_char = ischar;
+ cc++;
+ }
- cursor_set_column(cc);
+ cursor_set_column(cc);
- } else if (cursor.column == text[cursor.line].length()) {
+ } else if (cursor.column == text[cursor.line].length()) {
- if (cursor.line < text.size() - 1) {
- cursor_set_line(cursor.line + 1);
- cursor_set_column(0);
- }
- } else {
- cursor_set_column(cursor_get_column() + 1);
+ if (cursor.line < text.size() - 1) {
+ cursor_set_line(cursor.line + 1);
+ cursor_set_column(0);
}
+ } else {
+ cursor_set_column(cursor_get_column() + 1);
+ }
- if (k.mod.shift)
- _post_shift_selection();
+ if (k->get_shift())
+ _post_shift_selection();
- } break;
- case KEY_KP_8: {
- if (k.unicode != 0) {
- scancode_handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_up
+ } break;
+ case KEY_KP_8: {
+ if (k->get_unicode() != 0) {
+ scancode_handled = false;
+ break;
}
- case KEY_UP: {
+ // numlock disabled. fallthrough to key_up
+ }
+ case KEY_UP: {
- if (k.mod.shift)
- _pre_shift_selection();
- if (k.mod.alt) {
- scancode_handled = false;
- break;
- }
+ if (k->get_shift())
+ _pre_shift_selection();
+ if (k->get_alt()) {
+ scancode_handled = false;
+ break;
+ }
#ifndef APPLE_STYLE_KEYS
- if (k.mod.command) {
- _scroll_lines_up();
- break;
- }
+ if (k->get_command()) {
+ _scroll_lines_up();
+ break;
+ }
#else
- if (k.mod.command && k.mod.alt) {
- _scroll_lines_up();
- break;
- }
+ if (k->get_command() && k->get_alt()) {
+ _scroll_lines_up();
+ break;
+ }
- if (k.mod.command)
- cursor_set_line(0);
- else
+ if (k->get_command())
+ cursor_set_line(0);
+ else
#endif
- cursor_set_line(cursor_get_line() - 1);
+ cursor_set_line(cursor_get_line() - 1);
- if (k.mod.shift)
- _post_shift_selection();
- _cancel_code_hint();
+ if (k->get_shift())
+ _post_shift_selection();
+ _cancel_code_hint();
- } break;
- case KEY_KP_2: {
- if (k.unicode != 0) {
- scancode_handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_down
+ } break;
+ case KEY_KP_2: {
+ if (k->get_unicode() != 0) {
+ scancode_handled = false;
+ break;
}
- case KEY_DOWN: {
+ // numlock disabled. fallthrough to key_down
+ }
+ case KEY_DOWN: {
- if (k.mod.shift)
- _pre_shift_selection();
- if (k.mod.alt) {
- scancode_handled = false;
- break;
- }
+ if (k->get_shift())
+ _pre_shift_selection();
+ if (k->get_alt()) {
+ scancode_handled = false;
+ break;
+ }
#ifndef APPLE_STYLE_KEYS
- if (k.mod.command) {
- _scroll_lines_down();
- break;
- }
+ if (k->get_command()) {
+ _scroll_lines_down();
+ break;
+ }
#else
- if (k.mod.command && k.mod.alt) {
- _scroll_lines_down();
- break;
- }
+ if (k->get_command() && k->get_alt()) {
+ _scroll_lines_down();
+ break;
+ }
- if (k.mod.command)
- cursor_set_line(text.size() - 1);
- else
+ if (k->get_command())
+ cursor_set_line(text.size() - 1);
+ else
#endif
- cursor_set_line(cursor_get_line() + 1);
+ cursor_set_line(cursor_get_line() + 1);
- if (k.mod.shift)
- _post_shift_selection();
- _cancel_code_hint();
+ if (k->get_shift())
+ _post_shift_selection();
+ _cancel_code_hint();
- } break;
+ } break;
- case KEY_DELETE: {
+ case KEY_DELETE: {
- if (readonly)
- break;
+ if (readonly)
+ break;
- if (k.mod.shift && !k.mod.command && !k.mod.alt) {
- cut();
- break;
- }
+ if (k->get_shift() && !k->get_command() && !k->get_alt()) {
+ cut();
+ break;
+ }
- int curline_len = text[cursor.line].length();
+ int curline_len = text[cursor.line].length();
- if (cursor.line == text.size() - 1 && cursor.column == curline_len)
- break; //nothing to do
+ if (cursor.line == text.size() - 1 && cursor.column == curline_len)
+ break; //nothing to do
- int next_line = cursor.column < curline_len ? cursor.line : cursor.line + 1;
- int next_column;
+ int next_line = cursor.column < curline_len ? cursor.line : cursor.line + 1;
+ int next_column;
#ifdef APPLE_STYLE_KEYS
- if (k.mod.alt) {
+ if (k->get_alt() && cursor.column < curline_len - 1) {
#else
- if (k.mod.alt) {
- scancode_handled = false;
- break;
- } else if (k.mod.command) {
+ if (k->get_alt()) {
+ scancode_handled = false;
+ break;
+ } else if (k->get_command() && cursor.column < curline_len - 1) {
#endif
- int last_line = text.size() - 1;
-
- int line = cursor.line;
- int column = cursor.column;
- bool prev_char = false;
- bool only_whitespace = true;
+ int line = cursor.line;
+ int column = cursor.column;
+
+ // check if we are removing a single whitespace, if so remove it and the next char type
+ // else we just remove the whitespace
+ bool only_whitespace = false;
+ if (_is_whitespace(text[line][column]) && _is_whitespace(text[line][column + 1])) {
+ only_whitespace = true;
+ } else if (_is_whitespace(text[line][column])) {
+ // remove the single whitespace
+ column++;
+ }
- while (only_whitespace && line < last_line) {
+ // check if its a text char
+ bool only_char = (_is_text_char(text[line][column]) && !only_whitespace);
- while (column < text[line].length()) {
- CharType c = text[line][column];
+ // if its not whitespace or char then symbol.
+ bool only_symbols = !(only_whitespace || only_char);
- if (c != '\t' && c != ' ') {
- only_whitespace = false;
- break;
- }
-
- column++;
- }
+ while (column < curline_len) {
+ bool is_whitespace = _is_whitespace(text[line][column]);
+ bool is_text_char = _is_text_char(text[line][column]);
- if (only_whitespace) {
- line++;
- column = 0;
- }
+ if (only_whitespace && !is_whitespace) {
+ break;
+ } else if (only_char && !is_text_char) {
+ break;
+ } else if (only_symbols && (is_whitespace || is_text_char)) {
+ break;
}
+ column++;
+ }
- while (column < text[line].length()) {
-
- bool ischar = _is_text_char(text[line][column]);
+ next_line = line;
+ next_column = column;
- if (prev_char && !ischar)
- break;
- prev_char = ischar;
- column++;
- }
-
- next_line = line;
- next_column = column;
- } else {
- next_column = cursor.column < curline_len ? (cursor.column + 1) : 0;
- }
+ } else {
+ next_column = cursor.column < curline_len ? (cursor.column + 1) : 0;
+ }
- _remove_text(cursor.line, cursor.column, next_line, next_column);
- update();
+ _remove_text(cursor.line, cursor.column, next_line, next_column);
+ update();
- } break;
- case KEY_KP_7: {
- if (k.unicode != 0) {
- scancode_handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_home
+ } break;
+ case KEY_KP_7: {
+ if (k->get_unicode() != 0) {
+ scancode_handled = false;
+ break;
}
+ // numlock disabled. fallthrough to key_home
+ }
#ifdef APPLE_STYLE_KEYS
- case KEY_HOME: {
+ case KEY_HOME: {
- if (k.mod.shift)
- _pre_shift_selection();
+ if (k->get_shift())
+ _pre_shift_selection();
- cursor_set_line(0);
+ cursor_set_line(0);
- if (k.mod.shift)
- _post_shift_selection();
- else if (k.mod.command || k.mod.control)
- deselect();
+ if (k->get_shift())
+ _post_shift_selection();
+ else if (k->get_command() || k->get_control())
+ deselect();
- } break;
+ } break;
#else
- case KEY_HOME: {
-
- if (k.mod.shift)
- _pre_shift_selection();
+ case KEY_HOME: {
- if (k.mod.command) {
- cursor_set_line(0);
- cursor_set_column(0);
- } 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->get_shift())
+ _pre_shift_selection();
- if (cursor_get_column() == current_line_whitespace_len)
- cursor_set_column(0);
- else
- cursor_set_column(current_line_whitespace_len);
+ if (k->get_command()) {
+ cursor_set_line(0);
+ cursor_set_column(0);
+ } 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.shift)
- _post_shift_selection();
- else if (k.mod.command || k.mod.control)
- deselect();
- _cancel_completion();
- completion_hint = "";
+ if (cursor_get_column() == current_line_whitespace_len)
+ cursor_set_column(0);
+ else
+ cursor_set_column(current_line_whitespace_len);
+ }
- } break;
+ if (k->get_shift())
+ _post_shift_selection();
+ else if (k->get_command() || k->get_control())
+ deselect();
+ _cancel_completion();
+ completion_hint = "";
+
+ } break;
#endif
- case KEY_KP_1: {
- if (k.unicode != 0) {
- scancode_handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_end
+ case KEY_KP_1: {
+ if (k->get_unicode() != 0) {
+ scancode_handled = false;
+ break;
}
+ // numlock disabled. fallthrough to key_end
+ }
#ifdef APPLE_STYLE_KEYS
- case KEY_END: {
+ case KEY_END: {
- if (k.mod.shift)
- _pre_shift_selection();
+ if (k->get_shift())
+ _pre_shift_selection();
- cursor_set_line(text.size() - 1);
+ cursor_set_line(text.size() - 1);
- if (k.mod.shift)
- _post_shift_selection();
- else if (k.mod.command || k.mod.control)
- deselect();
+ if (k->get_shift())
+ _post_shift_selection();
+ else if (k->get_command() || k->get_control())
+ deselect();
- } break;
+ } break;
#else
- case KEY_END: {
+ case KEY_END: {
- if (k.mod.shift)
- _pre_shift_selection();
+ if (k->get_shift())
+ _pre_shift_selection();
- if (k.mod.command)
- cursor_set_line(text.size() - 1);
- cursor_set_column(text[cursor.line].length());
+ if (k->get_command())
+ cursor_set_line(text.size() - 1);
+ cursor_set_column(text[cursor.line].length());
- if (k.mod.shift)
- _post_shift_selection();
- else if (k.mod.command || k.mod.control)
- deselect();
+ if (k->get_shift())
+ _post_shift_selection();
+ else if (k->get_command() || k->get_control())
+ deselect();
- _cancel_completion();
- completion_hint = "";
+ _cancel_completion();
+ completion_hint = "";
- } break;
+ } break;
#endif
- case KEY_KP_9: {
- if (k.unicode != 0) {
- scancode_handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_pageup
+ case KEY_KP_9: {
+ if (k->get_unicode() != 0) {
+ scancode_handled = false;
+ break;
}
- case KEY_PAGEUP: {
+ // numlock disabled. fallthrough to key_pageup
+ }
+ case KEY_PAGEUP: {
- if (k.mod.shift)
- _pre_shift_selection();
+ if (k->get_shift())
+ _pre_shift_selection();
- cursor_set_line(cursor_get_line() - get_visible_rows());
+ cursor_set_line(cursor_get_line() - get_visible_rows());
- if (k.mod.shift)
- _post_shift_selection();
+ if (k->get_shift())
+ _post_shift_selection();
- _cancel_completion();
- completion_hint = "";
+ _cancel_completion();
+ completion_hint = "";
- } break;
- case KEY_KP_3: {
- if (k.unicode != 0) {
- scancode_handled = false;
- break;
- }
- // numlock disabled. fallthrough to key_pageup
+ } break;
+ case KEY_KP_3: {
+ if (k->get_unicode() != 0) {
+ scancode_handled = false;
+ break;
}
- case KEY_PAGEDOWN: {
+ // numlock disabled. fallthrough to key_pageup
+ }
+ case KEY_PAGEDOWN: {
- if (k.mod.shift)
- _pre_shift_selection();
+ if (k->get_shift())
+ _pre_shift_selection();
- cursor_set_line(cursor_get_line() + get_visible_rows());
+ cursor_set_line(cursor_get_line() + get_visible_rows());
- if (k.mod.shift)
- _post_shift_selection();
+ if (k->get_shift())
+ _post_shift_selection();
- _cancel_completion();
- completion_hint = "";
+ _cancel_completion();
+ completion_hint = "";
- } break;
- case KEY_A: {
+ } break;
+ case KEY_A: {
- if (!k.mod.command || k.mod.shift || k.mod.alt) {
- scancode_handled = false;
- break;
- }
+ if (!k->get_command() || k->get_shift() || k->get_alt()) {
+ scancode_handled = false;
+ break;
+ }
- select_all();
+ select_all();
- } break;
- case KEY_X: {
- if (readonly) {
- break;
- }
- if (!k.mod.command || k.mod.shift || k.mod.alt) {
- scancode_handled = false;
- break;
- }
+ } break;
+ case KEY_X: {
+ if (readonly) {
+ break;
+ }
+ if (!k->get_command() || k->get_shift() || k->get_alt()) {
+ scancode_handled = false;
+ break;
+ }
- cut();
+ cut();
- } break;
- case KEY_C: {
+ } break;
+ case KEY_C: {
- if (!k.mod.command || k.mod.shift || k.mod.alt) {
- scancode_handled = false;
- break;
- }
+ if (!k->get_command() || k->get_shift() || k->get_alt()) {
+ scancode_handled = false;
+ break;
+ }
- copy();
+ copy();
- } break;
- case KEY_Z: {
+ } break;
+ case KEY_Z: {
- if (!k.mod.command) {
- scancode_handled = false;
- break;
- }
+ if (!k->get_command()) {
+ scancode_handled = false;
+ break;
+ }
- if (k.mod.shift)
- redo();
- else
- undo();
- } break;
- case KEY_V: {
- if (readonly) {
- break;
- }
- if (!k.mod.command || k.mod.shift || k.mod.alt) {
- scancode_handled = false;
- break;
- }
+ if (k->get_shift())
+ redo();
+ else
+ undo();
+ } break;
+ case KEY_V: {
+ if (readonly) {
+ break;
+ }
+ if (!k->get_command() || k->get_shift() || k->get_alt()) {
+ scancode_handled = false;
+ break;
+ }
- paste();
+ paste();
- } break;
- case KEY_SPACE: {
+ } break;
+ case KEY_SPACE: {
#ifdef OSX_ENABLED
- if (completion_enabled && k.mod.meta) { //cmd-space is spotlight shortcut in OSX
+ if (completion_enabled && k->get_metakey()) { //cmd-space is spotlight shortcut in OSX
#else
- if (completion_enabled && k.mod.command) {
+ if (completion_enabled && k->get_command()) {
#endif
- query_code_comple();
- scancode_handled = true;
- } else {
- scancode_handled = false;
- }
+ query_code_comple();
+ scancode_handled = true;
+ } else {
+ scancode_handled = false;
+ }
- } break;
+ } break;
- case KEY_U: {
- if (!k.mod.command || k.mod.shift) {
- scancode_handled = false;
- break;
- } else {
- if (selection.active) {
- int ini = selection.from_line;
- int end = selection.to_line;
- for (int i = ini; i <= end; i++) {
- if (text[i][0] == '#')
- _remove_text(i, 0, i, 1);
- }
- } else {
- if (text[cursor.line][0] == '#')
- _remove_text(cursor.line, 0, cursor.line, 1);
+ case KEY_U: {
+ if (!k->get_command() || k->get_shift()) {
+ scancode_handled = false;
+ break;
+ } else {
+ if (selection.active) {
+ int ini = selection.from_line;
+ int end = selection.to_line;
+ for (int i = ini; i <= end; i++) {
+ if (text[i][0] == '#')
+ _remove_text(i, 0, i, 1);
}
- update();
+ } else {
+ if (text[cursor.line][0] == '#')
+ _remove_text(cursor.line, 0, cursor.line, 1);
}
- } break;
+ update();
+ }
+ } break;
- default: {
+ default: {
- scancode_handled = false;
- } break;
- }
+ scancode_handled = false;
+ } break;
+ }
- if (scancode_handled)
- accept_event();
- /*
- if (!scancode_handled && !k.mod.command && !k.mod.alt) {
+ if (scancode_handled)
+ accept_event();
+ /*
+ if (!scancode_handled && !k->get_command() && !k->get_alt()) {
- if (k.unicode>=32) {
+ if (k->get_unicode()>=32) {
- if (readonly)
- break;
+ if (readonly)
+ break;
- accept_event();
- } else {
+ accept_event();
+ } else {
- break;
- }
- }
+ break;
+ }
+ }
*/
- if (k.scancode == KEY_INSERT) {
- set_insert_mode(!insert_mode);
- accept_event();
- return;
- }
-
- if (!scancode_handled && !k.mod.command) { //for german kbds
-
- if (k.unicode >= 32) {
+ if (k->get_scancode() == KEY_INSERT) {
+ set_insert_mode(!insert_mode);
+ accept_event();
+ return;
+ }
- if (readonly)
- break;
+ if (!scancode_handled && !k->get_command()) { //for german kbds
- // remove the old character if in insert mode and no selection
- if (insert_mode && !had_selection) {
- begin_complex_operation();
+ if (k->get_unicode() >= 32) {
- // make sure we don't try and remove empty space
- if (cursor.column < get_line(cursor.line).length()) {
- _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1);
- }
- }
+ if (readonly)
+ return;
- const CharType chr[2] = { (CharType)k.unicode, 0 };
+ // remove the old character if in insert mode and no selection
+ if (insert_mode && !had_selection) {
+ begin_complex_operation();
- if (completion_hint != "" && k.unicode == ')') {
- completion_hint = "";
- }
- if (auto_brace_completion_enabled && _is_pair_symbol(chr[0])) {
- _consume_pair_symbol(chr[0]);
- } else {
- _insert_text_at_cursor(chr);
+ // make sure we don't try and remove empty space
+ if (cursor.column < get_line(cursor.line).length()) {
+ _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1);
}
+ }
- if (insert_mode && !had_selection) {
- end_complex_operation();
- }
+ const CharType chr[2] = { (CharType)k->get_unicode(), 0 };
- if (selection.active != had_selection) {
- end_complex_operation();
- }
- accept_event();
+ if (completion_hint != "" && k->get_unicode() == ')') {
+ completion_hint = "";
+ }
+ if (auto_brace_completion_enabled && _is_pair_symbol(chr[0])) {
+ _consume_pair_symbol(chr[0]);
} else {
+ _insert_text_at_cursor(chr);
+ }
- break;
+ if (insert_mode && !had_selection) {
+ end_complex_operation();
}
+
+ if (selection.active != had_selection) {
+ end_complex_operation();
+ }
+ accept_event();
+ } else {
}
+ }
- return;
- } break;
+ return;
}
}
@@ -2777,7 +2933,7 @@ void TextEdit::_base_remove_text(int p_from_line, int p_from_column, int p_to_li
}
}
-void TextEdit::_insert_text(int p_line, int p_char, const String &p_text, int *r_end_line, int *r_end_column) {
+void TextEdit::_insert_text(int p_line, int p_char, const String &p_text, int *r_end_line, int *r_end_char) {
if (!setting_text)
idle_detect->start();
@@ -2790,8 +2946,8 @@ void TextEdit::_insert_text(int p_line, int p_char, const String &p_text, int *r
_base_insert_text(p_line, p_char, p_text, retline, retchar);
if (r_end_line)
*r_end_line = retline;
- if (r_end_column)
- *r_end_column = retchar;
+ if (r_end_char)
+ *r_end_char = retchar;
if (!undo_enabled)
return;
@@ -3102,7 +3258,7 @@ int TextEdit::get_char_pos_for(int p_px, String p_str) const {
int px = 0;
int c = 0;
- int tab_w = cache.font->get_char_size(' ').width * tab_size;
+ int tab_w = cache.font->get_char_size(' ').width * indent_size;
while (c < p_str.length()) {
@@ -3134,7 +3290,7 @@ int TextEdit::get_column_x_offset(int p_char, String p_str) {
int px = 0;
- int tab_w = cache.font->get_char_size(' ').width * tab_size;
+ int tab_w = cache.font->get_char_size(' ').width * indent_size;
for (int i = 0; i < p_char; i++) {
@@ -3174,7 +3330,7 @@ void TextEdit::insert_text_at_cursor(const String &p_text) {
}
Control::CursorShape TextEdit::get_cursor_shape(const Point2 &p_pos) const {
- if (hilighted_word != String())
+ if (highlighted_word != String())
return CURSOR_POINTING_HAND;
int gutter = cache.style_normal->get_margin(MARGIN_LEFT) + cache.line_number_w + cache.breakpoint_gutter_width;
@@ -3951,10 +4107,24 @@ void TextEdit::_push_current_op() {
current_op.chain_forward = false;
}
-void TextEdit::set_tab_size(const int p_size) {
+void TextEdit::set_indent_using_spaces(const bool p_use_spaces) {
+ indent_using_spaces = p_use_spaces;
+}
+
+bool TextEdit::is_indent_using_spaces() const {
+ return indent_using_spaces;
+}
+
+void TextEdit::set_indent_size(const int p_size) {
ERR_FAIL_COND(p_size <= 0);
- tab_size = p_size;
- text.set_tab_size(p_size);
+ indent_size = p_size;
+ text.set_indent_size(p_size);
+
+ space_indent = "";
+ for (int i = 0; i < p_size; i++) {
+ space_indent += " ";
+ }
+
update();
}
@@ -4250,6 +4420,23 @@ String TextEdit::get_word_at_pos(const Vector2 &p_pos) const {
bool symbol = beg < s.length() && _is_symbol(s[beg]); //not sure if right but most editors behave like this
+ bool inside_quotes = false;
+ int qbegin, qend;
+ for (int i = 0; i < s.length(); i++) {
+ if (s[i] == '"') {
+ if (inside_quotes) {
+ qend = i;
+ inside_quotes = false;
+ if (col >= qbegin && col <= qend) {
+ return s.substr(qbegin, qend - qbegin);
+ }
+ } else {
+ qbegin = i + 1;
+ inside_quotes = true;
+ }
+ }
+ }
+
while (beg > 0 && s[beg - 1] > 32 && (symbol == _is_symbol(s[beg - 1]))) {
beg--;
}
@@ -4447,8 +4634,8 @@ void TextEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_text"), &TextEdit::get_text);
ClassDB::bind_method(D_METHOD("get_line", "line"), &TextEdit::get_line);
- 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(D_METHOD("cursor_set_column", "column", "adjust_viewport"), &TextEdit::cursor_set_column, DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("cursor_set_line", "line", "adjust_viewport"), &TextEdit::cursor_set_line, DEFVAL(true));
ClassDB::bind_method(D_METHOD("cursor_get_column"), &TextEdit::cursor_get_column);
ClassDB::bind_method(D_METHOD("cursor_get_line"), &TextEdit::cursor_get_line);
@@ -4476,7 +4663,7 @@ void TextEdit::_bind_methods() {
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(D_METHOD("search", "key", "flags", "from_line", "from_column"), &TextEdit::_search_bind);
ClassDB::bind_method(D_METHOD("undo"), &TextEdit::undo);
ClassDB::bind_method(D_METHOD("redo"), &TextEdit::redo);
@@ -4494,8 +4681,8 @@ void TextEdit::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("menu_option", "option"), &TextEdit::menu_option);
+ ClassDB::bind_method(D_METHOD("get_menu"), &TextEdit::get_menu);
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");
@@ -4541,8 +4728,8 @@ TextEdit::TextEdit() {
cache.breakpoint_gutter_width = 0;
breakpoint_gutter_width = 0;
- tab_size = 4;
- text.set_tab_size(tab_size);
+ indent_size = 4;
+ text.set_indent_size(indent_size);
text.clear();
//text.insert(1,"Mongolia..");
//text.insert(2,"PAIS GENEROSO!!");
@@ -4630,6 +4817,8 @@ TextEdit::TextEdit() {
auto_brace_completion_enabled = false;
brace_matching_enabled = false;
highlight_all_occurrences = false;
+ indent_using_spaces = false;
+ space_indent = " ";
auto_indent = false;
insert_mode = false;
window_has_focus = true;
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index e38d484b0d..4c17347a5d 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -140,18 +141,18 @@ class TextEdit : public Control {
const Vector<ColorRegion> *color_regions;
mutable Vector<Line> text;
Ref<Font> font;
- int tab_size;
+ int indent_size;
void _update_line_cache(int p_line) const;
public:
- void set_tab_size(int p_tab_size);
+ void set_indent_size(int p_indent_size);
void set_font(const Ref<Font> &p_font);
void set_color_regions(const Vector<ColorRegion> *p_regions) { color_regions = p_regions; }
int get_line_width(int p_line) const;
int get_max_width() const;
const Map<int, ColorRegionInfo> &get_color_region_info(int p_line);
- void set(int p_line, const String &p_string);
+ void set(int p_line, const String &p_text);
void set_marked(int p_line, bool p_marked) { text[p_line].marked = p_marked; }
bool is_marked(int p_line) const { return text[p_line].marked; }
void set_breakpoint(int p_line, bool p_breakpoint) { text[p_line].breakpoint = p_breakpoint; }
@@ -162,7 +163,7 @@ class TextEdit : public Control {
void clear();
void clear_caches();
_FORCE_INLINE_ const String &operator[](int p_line) const { return text[p_line].data; }
- Text() { tab_size = 4; }
+ Text() { indent_size = 4; }
};
struct TextOperation {
@@ -183,6 +184,9 @@ class TextEdit : public Control {
bool chain_backward;
};
+ String ime_text;
+ Point2 ime_selection;
+
TextOperation current_op;
List<TextOperation> undo_stack;
@@ -220,7 +224,9 @@ class TextEdit : public Control {
int max_chars;
bool readonly;
bool syntax_coloring;
- int tab_size;
+ bool indent_using_spaces;
+ int indent_size;
+ String space_indent;
Timer *caret_blink_timer;
bool caret_blink_enabled;
@@ -252,7 +258,7 @@ class TextEdit : public Control {
bool raised_from_completion;
- String hilighted_word;
+ String highlighted_word;
uint64_t last_dblclk;
@@ -282,8 +288,8 @@ class TextEdit : public Control {
int get_char_count();
- int get_char_pos_for(int p_px, String p_pos) const;
- int get_column_x_offset(int p_column, String p_pos);
+ int get_char_pos_for(int p_px, String p_str) const;
+ int get_column_x_offset(int p_char, String p_str);
void adjust_viewport_to_cursor();
void _scroll_moved(double);
@@ -296,6 +302,8 @@ class TextEdit : public Control {
void _scroll_lines_up();
void _scroll_lines_down();
+ static void _ime_text_callback(void *p_self, String p_text, Point2 p_selection);
+
//void mouse_motion(const Point& p_pos, const Point& p_rel, int p_button_mask);
Size2 get_minimum_size() const;
@@ -312,7 +320,7 @@ class TextEdit : public Control {
/* super internal api, undo/redo builds on it */
- void _base_insert_text(int p_line, int p_column, const String &p_text, int &r_end_line, int &r_end_column);
+ void _base_insert_text(int p_line, int p_char, const String &p_text, int &r_end_line, int &r_end_column);
String _base_get_text(int p_from_line, int p_from_column, int p_to_line, int p_to_column) const;
void _base_remove_text(int p_from_line, int p_from_column, int p_to_line, int p_to_column);
@@ -331,10 +339,10 @@ class TextEdit : public Control {
protected:
virtual String get_tooltip(const Point2 &p_pos) const;
- void _insert_text(int p_line, int p_column, const String &p_text, int *r_end_line = NULL, int *r_end_char = NULL);
+ void _insert_text(int p_line, int p_char, const String &p_text, int *r_end_line = NULL, int *r_end_char = NULL);
void _remove_text(int p_from_line, int p_from_column, int p_to_line, int p_to_column);
void _insert_text_at_cursor(const String &p_text);
- void _gui_input(const InputEvent &p_input);
+ void _gui_input(const Ref<InputEvent> &p_gui_input);
void _notification(int p_what);
void _consume_pair_symbol(CharType ch);
@@ -460,7 +468,9 @@ public:
void redo();
void clear_undo_history();
- void set_tab_size(const int p_size);
+ void set_indent_using_spaces(const bool p_use_spaces);
+ bool is_indent_using_spaces() const;
+ void set_indent_size(const int p_size);
void set_draw_tabs(bool p_draw);
bool is_drawing_tabs() const;
diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp
index 54f09cbf68..7abf8380ce 100644
--- a/scene/gui/texture_button.cpp
+++ b/scene/gui/texture_button.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -179,21 +180,21 @@ void TextureButton::_notification(int p_what) {
void TextureButton::_bind_methods() {
- 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_normal_texture", "texture"), &TextureButton::set_normal_texture);
+ ClassDB::bind_method(D_METHOD("set_pressed_texture", "texture"), &TextureButton::set_pressed_texture);
+ ClassDB::bind_method(D_METHOD("set_hover_texture", "texture"), &TextureButton::set_hover_texture);
+ ClassDB::bind_method(D_METHOD("set_disabled_texture", "texture"), &TextureButton::set_disabled_texture);
+ ClassDB::bind_method(D_METHOD("set_focused_texture", "texture"), &TextureButton::set_focused_texture);
+ ClassDB::bind_method(D_METHOD("set_click_mask", "mask"), &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_normal_texture"), &TextureButton::get_normal_texture);
+ ClassDB::bind_method(D_METHOD("get_pressed_texture"), &TextureButton::get_pressed_texture);
+ ClassDB::bind_method(D_METHOD("get_hover_texture"), &TextureButton::get_hover_texture);
+ ClassDB::bind_method(D_METHOD("get_disabled_texture"), &TextureButton::get_disabled_texture);
+ ClassDB::bind_method(D_METHOD("get_focused_texture"), &TextureButton::get_focused_texture);
+ ClassDB::bind_method(D_METHOD("get_click_mask"), &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);
@@ -205,7 +206,7 @@ void TextureButton::_bind_methods() {
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");
+ ADD_PROPERTYNZ(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);
@@ -285,8 +286,8 @@ void TextureButton::set_expand(bool p_expand) {
update();
}
-void TextureButton::set_stretch_mode(StretchMode p_mode) {
- stretch_mode = p_mode;
+void TextureButton::set_stretch_mode(StretchMode p_stretch_mode) {
+ stretch_mode = p_stretch_mode;
update();
}
diff --git a/scene/gui/texture_button.h b/scene/gui/texture_button.h
index fc5079dbf9..8df30cd35a 100644
--- a/scene/gui/texture_button.h
+++ b/scene/gui/texture_button.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -68,7 +69,7 @@ public:
void set_hover_texture(const Ref<Texture> &p_hover);
void set_disabled_texture(const Ref<Texture> &p_disabled);
void set_focused_texture(const Ref<Texture> &p_focused);
- void set_click_mask(const Ref<BitMap> &p_image);
+ void set_click_mask(const Ref<BitMap> &p_click_mask);
Ref<Texture> get_normal_texture() const;
Ref<Texture> get_pressed_texture() const;
@@ -80,7 +81,7 @@ public:
bool get_expand() const;
void set_expand(bool p_expand);
- void set_stretch_mode(StretchMode stretch_mode);
+ void set_stretch_mode(StretchMode p_stretch_mode);
StretchMode get_stretch_mode() const;
TextureButton();
diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp
index 914d17d2dc..081c7ddb73 100644
--- a/scene/gui/texture_progress.cpp
+++ b/scene/gui/texture_progress.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/texture_progress.h b/scene/gui/texture_progress.h
index 0d9b5e6b1a..c0c2779cf9 100644
--- a/scene/gui/texture_progress.h
+++ b/scene/gui/texture_progress.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp
index ea35ee8b52..92a3db6a74 100644
--- a/scene/gui/texture_rect.cpp
+++ b/scene/gui/texture_rect.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/texture_rect.h b/scene/gui/texture_rect.h
index 2cc6b97b13..dcc6c3f9bd 100644
--- a/scene/gui/texture_rect.h
+++ b/scene/gui/texture_rect.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/tool_button.cpp b/scene/gui/tool_button.cpp
index 817b506f10..5fc4b6ecf8 100644
--- a/scene/gui/tool_button.cpp
+++ b/scene/gui/tool_button.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/tool_button.h b/scene/gui/tool_button.h
index 02d2bfaef1..d243b5559f 100644
--- a/scene/gui/tool_button.h
+++ b/scene/gui/tool_button.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 9a999c9323..fa499ff277 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "tree.h"
-#include "global_config.h"
#include "os/input.h"
#include "os/keyboard.h"
#include "os/os.h"
#include "print_string.h"
+#include "project_settings.h"
#include "scene/main/viewport.h"
void TreeItem::move_to_top() {
@@ -69,7 +70,7 @@ Size2 TreeItem::Cell::get_icon_size() const {
return icon_region.size;
}
-void TreeItem::Cell::draw_icon(const RID &p_where, const Point2 &p_pos, const Size2 &p_size) const {
+void TreeItem::Cell::draw_icon(const RID &p_where, const Point2 &p_pos, const Size2 &p_size, const Color &p_color) const {
if (icon.is_null())
return;
@@ -78,10 +79,10 @@ void TreeItem::Cell::draw_icon(const RID &p_where, const Point2 &p_pos, const Si
if (icon_region == Rect2i()) {
- icon->draw_rect_region(p_where, Rect2(p_pos, dsize), Rect2(Point2(), icon->get_size()));
+ icon->draw_rect_region(p_where, Rect2(p_pos, dsize), Rect2(Point2(), icon->get_size()), p_color);
} else {
- icon->draw_rect_region(p_where, Rect2(p_pos, dsize), icon_region);
+ icon->draw_rect_region(p_where, Rect2(p_pos, dsize), icon_region, p_color);
}
}
@@ -202,6 +203,19 @@ Rect2 TreeItem::get_icon_region(int p_column) const {
return cells[p_column].icon_region;
}
+void TreeItem::set_icon_color(int p_column, const Color &p_icon_color) {
+
+ ERR_FAIL_INDEX(p_column, cells.size());
+ cells[p_column].icon_color = p_icon_color;
+ _changed_notify(p_column);
+}
+
+Color TreeItem::get_icon_color(int p_column) const {
+
+ ERR_FAIL_INDEX_V(p_column, cells.size(), Color());
+ return cells[p_column].icon_color;
+}
+
void TreeItem::set_icon_max_width(int p_column, int p_max) {
ERR_FAIL_INDEX(p_column, cells.size());
@@ -277,7 +291,7 @@ void TreeItem::set_custom_draw(int p_column, Object *p_object, const StringName
ERR_FAIL_INDEX(p_column, cells.size());
ERR_FAIL_NULL(p_object);
- cells[p_column].custom_draw_obj = p_object->get_instance_ID();
+ cells[p_column].custom_draw_obj = p_object->get_instance_id();
cells[p_column].custom_draw_callback = p_callback;
}
@@ -463,7 +477,7 @@ void TreeItem::deselect(int p_column) {
_cell_deselected(p_column);
}
-void TreeItem::add_button(int p_column, const Ref<Texture> &p_button, int p_id, bool p_disabled) {
+void TreeItem::add_button(int p_column, const Ref<Texture> &p_button, int p_id, bool p_disabled, const String &p_tooltip) {
ERR_FAIL_INDEX(p_column, cells.size());
ERR_FAIL_COND(!p_button.is_valid());
@@ -473,6 +487,7 @@ void TreeItem::add_button(int p_column, const Ref<Texture> &p_button, int p_id,
p_id = cells[p_column].buttons.size();
button.id = p_id;
button.disabled = p_disabled;
+ button.tooltip = p_tooltip;
cells[p_column].buttons.push_back(button);
_changed_notify(p_column);
}
@@ -608,6 +623,52 @@ Color TreeItem::get_custom_bg_color(int p_column) const {
return cells[p_column].bg_color;
}
+void TreeItem::set_custom_as_button(int p_column, bool p_button) {
+
+ ERR_FAIL_INDEX(p_column, cells.size());
+ cells[p_column].custom_button = p_button;
+}
+
+bool TreeItem::is_custom_set_as_button(int p_column) const {
+
+ ERR_FAIL_INDEX_V(p_column, cells.size(), false);
+ return cells[p_column].custom_button;
+}
+
+void TreeItem::set_text_align(int p_column, TextAlign p_align) {
+ ERR_FAIL_INDEX(p_column, cells.size());
+ cells[p_column].text_align = p_align;
+ _changed_notify(p_column);
+}
+
+TreeItem::TextAlign TreeItem::get_text_align(int p_column) const {
+ ERR_FAIL_INDEX_V(p_column, cells.size(), ALIGN_LEFT);
+ return cells[p_column].text_align;
+}
+
+void TreeItem::set_expand_right(int p_column, bool p_enable) {
+
+ ERR_FAIL_INDEX(p_column, cells.size());
+ cells[p_column].expand_right = p_enable;
+ _changed_notify(p_column);
+}
+
+bool TreeItem::get_expand_right(int p_column) const {
+
+ ERR_FAIL_INDEX_V(p_column, cells.size(), false);
+ return cells[p_column].expand_right;
+}
+
+void TreeItem::set_disable_folding(bool p_disable) {
+
+ disable_folding = p_disable;
+ _changed_notify(0);
+}
+
+bool TreeItem::is_folding_disabled() const {
+ return disable_folding;
+}
+
void TreeItem::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_cell_mode", "column", "mode"), &TreeItem::set_cell_mode);
@@ -619,8 +680,8 @@ void TreeItem::_bind_methods() {
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(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(D_METHOD("set_icon", "column", "texture"), &TreeItem::set_icon);
+ ClassDB::bind_method(D_METHOD("get_icon", "column"), &TreeItem::get_icon);
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);
@@ -641,15 +702,15 @@ void TreeItem::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_collapsed", "enable"), &TreeItem::set_collapsed);
ClassDB::bind_method(D_METHOD("is_collapsed"), &TreeItem::is_collapsed);
- 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(D_METHOD("get_next"), &TreeItem::get_next);
+ ClassDB::bind_method(D_METHOD("get_prev"), &TreeItem::get_prev);
+ ClassDB::bind_method(D_METHOD("get_parent"), &TreeItem::get_parent);
+ ClassDB::bind_method(D_METHOD("get_children"), &TreeItem::get_children);
- 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(D_METHOD("get_next_visible"), &TreeItem::get_next_visible);
+ ClassDB::bind_method(D_METHOD("get_prev_visible"), &TreeItem::get_prev_visible);
- ClassDB::bind_method(D_METHOD("remove_child:TreeItem", "child"), &TreeItem::_remove_child);
+ ClassDB::bind_method(D_METHOD("remove_child", "child"), &TreeItem::_remove_child);
ClassDB::bind_method(D_METHOD("set_selectable", "column", "selectable"), &TreeItem::set_selectable);
ClassDB::bind_method(D_METHOD("is_selectable", "column"), &TreeItem::is_selectable);
@@ -668,19 +729,29 @@ void TreeItem::_bind_methods() {
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(D_METHOD("add_button", "column", "button:Texture", "button_idx", "disabled"), &TreeItem::add_button, DEFVAL(-1), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("set_custom_as_button", "column", "enable"), &TreeItem::set_custom_as_button);
+ ClassDB::bind_method(D_METHOD("is_custom_set_as_button", "column"), &TreeItem::is_custom_set_as_button);
+
+ ClassDB::bind_method(D_METHOD("add_button", "column", "button", "button_idx", "disabled", "tooltip"), &TreeItem::add_button, DEFVAL(-1), DEFVAL(false), DEFVAL(""));
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("get_button", "column", "button_idx"), &TreeItem::get_button);
+ ClassDB::bind_method(D_METHOD("set_button", "column", "button_idx", "button"), &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(D_METHOD("set_expand_right", "column", "enable"), &TreeItem::set_expand_right);
+ ClassDB::bind_method(D_METHOD("get_expand_right", "column"), &TreeItem::get_expand_right);
+
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(D_METHOD("set_text_align", "column", "text_align"), &TreeItem::set_text_align);
+ ClassDB::bind_method(D_METHOD("get_text_align", "column"), &TreeItem::get_text_align);
ClassDB::bind_method(D_METHOD("move_to_top"), &TreeItem::move_to_top);
ClassDB::bind_method(D_METHOD("move_to_bottom"), &TreeItem::move_to_bottom);
+ ClassDB::bind_method(D_METHOD("set_disable_folding", "disable"), &TreeItem::set_disable_folding);
+ ClassDB::bind_method(D_METHOD("is_folding_disabled"), &TreeItem::is_folding_disabled);
+
BIND_CONSTANT(CELL_MODE_STRING);
BIND_CONSTANT(CELL_MODE_CHECK);
BIND_CONSTANT(CELL_MODE_RANGE);
@@ -707,6 +778,7 @@ TreeItem::TreeItem(Tree *p_tree) {
tree = p_tree;
collapsed = false;
+ disable_folding = false;
parent = 0; // parent item
next = 0; // next in list
@@ -730,6 +802,10 @@ TreeItem::~TreeItem() {
tree->pressing_for_editor = false;
}
+ if (tree && tree->cache.hover_item == this) {
+ tree->cache.hover_item = NULL;
+ }
+
if (tree && tree->selected_item == this)
tree->selected_item = NULL;
@@ -770,6 +846,11 @@ void Tree::update_cache() {
cache.select_arrow = get_icon("select_arrow");
cache.updown = get_icon("updown");
+ cache.custom_button = get_stylebox("custom_button");
+ cache.custom_button_hover = get_stylebox("custom_button_hover");
+ cache.custom_button_pressed = get_stylebox("custom_button_pressed");
+ cache.custom_button_font_highlight = get_color("custom_button_font_highlight");
+
cache.font_color = get_color("font_color");
cache.font_color_selected = get_color("font_color_selected");
cache.guide_color = get_color("guide_color");
@@ -831,6 +912,9 @@ int Tree::compute_item_height(TreeItem *p_item) const {
if (s.height > height)
height = s.height;
}
+ if (p_item->cells[i].mode == TreeItem::CELL_MODE_CUSTOM && p_item->cells[i].custom_button) {
+ height += cache.custom_button->get_minimum_size().height;
+ }
} break;
default: {}
@@ -862,9 +946,35 @@ int Tree::get_item_height(TreeItem *p_item) const {
return height;
}
-void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color) {
+void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color, const Color &p_icon_color) {
Rect2i rect = p_rect;
+ Ref<Font> font = cache.font;
+ String text = p_cell.text;
+ if (p_cell.suffix != String())
+ text += " " + p_cell.suffix;
+
+ int w = 0;
+ if (!p_cell.icon.is_null()) {
+ Size2i bmsize = p_cell.get_icon_size();
+
+ if (p_cell.icon_max_w > 0 && bmsize.width > p_cell.icon_max_w) {
+ bmsize.width = p_cell.icon_max_w;
+ }
+ w += bmsize.width + cache.hseparation;
+ }
+ w += font->get_string_size(text).width;
+
+ switch (p_cell.text_align) {
+ case TreeItem::ALIGN_LEFT:
+ break; //do none
+ case TreeItem::ALIGN_CENTER:
+ rect.position.x = MAX(0, (rect.size.width - w) / 2);
+ break; //do none
+ case TreeItem::ALIGN_RIGHT:
+ rect.position.x = MAX(0, (rect.size.width - w));
+ break; //do none
+ }
RID ci = get_canvas_item();
if (!p_cell.icon.is_null()) {
@@ -875,8 +985,8 @@ void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, co
bmsize.width = p_cell.icon_max_w;
}
- p_cell.draw_icon(ci, rect.pos + Size2i(0, Math::floor((real_t)(rect.size.y - bmsize.y) / 2)), bmsize);
- rect.pos.x += bmsize.x + cache.hseparation;
+ p_cell.draw_icon(ci, rect.position + Size2i(0, Math::floor((real_t)(rect.size.y - bmsize.y) / 2)), bmsize, p_icon_color);
+ rect.position.x += bmsize.x + cache.hseparation;
rect.size.x -= bmsize.x + cache.hseparation;
}
@@ -885,14 +995,8 @@ void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, co
rect.size.x-=Math::floor(rect.size.y/2);
*/
- Ref<Font> font = cache.font;
-
- String text = p_cell.text;
- if (p_cell.suffix != String())
- text += " " + p_cell.suffix;
-
- rect.pos.y += Math::floor((rect.size.y - font->get_height()) / 2.0) + font->get_ascent();
- font->draw(ci, rect.pos, text, p_color, rect.size.x);
+ rect.position.y += Math::floor((rect.size.y - font->get_height()) / 2.0) + font->get_ascent();
+ font->draw(ci, rect.position, text, p_color, rect.size.x);
}
#if 0
@@ -941,20 +1045,6 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
if (!skip && (p_pos.y + label_h - cache.offset.y) > 0) {
- if (!hide_folding && p_item->childs) { //has childs, draw the guide box
-
- Ref<Texture> arrow;
-
- if (p_item->collapsed) {
-
- arrow = cache.arrow_collapsed;
- } else {
- arrow = cache.arrow;
- }
-
- arrow->draw(ci, p_pos + p_draw_ofs + Point2i(0, (label_h - arrow->get_height()) / 2) - cache.offset);
- }
-
//draw separation.
//if (p_item->get_parent()!=root || !hide_root)
@@ -962,9 +1052,15 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
int font_ascent = font->get_ascent();
- int ofs = p_pos.x + (hide_folding ? cache.hseparation : cache.item_margin);
+ int ofs = p_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin);
+ int skip = 0;
for (int i = 0; i < columns.size(); i++) {
+ if (skip) {
+ skip--;
+ continue;
+ }
+
int w = get_column_width(i);
if (i == 0) {
@@ -982,6 +1078,16 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
w -= cache.hseparation;
}
+ if (p_item->cells[i].expand_right) {
+
+ int plus = 1;
+ while (i + plus < columns.size() && !p_item->cells[i + plus].editable && p_item->cells[i + plus].mode == TreeItem::CELL_MODE_STRING && p_item->cells[i + plus].text == "" && p_item->cells[i + plus].icon.is_null()) {
+ w += get_column_width(i + plus);
+ plus++;
+ skip++;
+ }
+ }
+
int bw = 0;
for (int j = p_item->cells[i].buttons.size() - 1; j >= 0; j--) {
Ref<Texture> b = p_item->cells[i].buttons[j].texture;
@@ -1005,16 +1111,16 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
Rect2i item_rect = Rect2i(Point2i(ofs, p_pos.y) - cache.offset + p_draw_ofs, Size2i(w, label_h));
Rect2i cell_rect = item_rect;
if (i != 0) {
- cell_rect.pos.x -= cache.hseparation;
+ cell_rect.position.x -= cache.hseparation;
cell_rect.size.x += cache.hseparation;
}
- VisualServer::get_singleton()->canvas_item_add_line(ci, Point2i(cell_rect.pos.x, cell_rect.pos.y + cell_rect.size.height), cell_rect.pos + cell_rect.size, cache.guide_color, 1);
+ VisualServer::get_singleton()->canvas_item_add_line(ci, Point2i(cell_rect.position.x, cell_rect.position.y + cell_rect.size.height), cell_rect.position + cell_rect.size, cache.guide_color, 1);
if (i == 0) {
if (p_item->cells[0].selected && select_mode == SELECT_ROW) {
- Rect2i row_rect = Rect2i(Point2i(cache.bg->get_margin(MARGIN_LEFT), item_rect.pos.y), Size2i(get_size().width - cache.bg->get_minimum_size().width, item_rect.size.y));
+ Rect2i row_rect = Rect2i(Point2i(cache.bg->get_margin(MARGIN_LEFT), item_rect.position.y), Size2i(get_size().width - cache.bg->get_minimum_size().width, item_rect.size.y));
//Rect2 r = Rect2i(row_rect.pos,row_rect.size);
//r.grow(cache.selected->get_margin(MARGIN_LEFT));
if (has_focus())
@@ -1026,34 +1132,39 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
if (p_item->cells[i].selected && select_mode != SELECT_ROW) {
- Rect2i r(item_rect.pos, item_rect.size);
+ Rect2i r(item_rect.position, item_rect.size);
if (p_item->cells[i].text.size() > 0) {
float icon_width = p_item->cells[i].get_icon_size().width;
- r.pos.x += icon_width;
+ r.position.x += icon_width;
r.size.x -= icon_width;
}
//r.grow(cache.selected->get_margin(MARGIN_LEFT));
if (has_focus()) {
cache.selected_focus->draw(ci, r);
- p_item->set_meta("__focus_rect", Rect2(r.pos, r.size));
+ p_item->set_meta("__focus_rect", Rect2(r.position, r.size));
} else {
cache.selected->draw(ci, r);
}
if (text_editor->is_visible_in_tree()) {
- text_editor->set_pos(get_global_pos() + r.pos);
+ text_editor->set_position(get_global_position() + r.position);
}
}
if (p_item->cells[i].custom_bg_color) {
Rect2 r = cell_rect;
- r.pos.x -= cache.hseparation;
- r.size.x += cache.hseparation;
+ if (i == 0) {
+ r.position.x = p_draw_ofs.x;
+ r.size.x = w + ofs;
+ } else {
+ r.position.x -= cache.hseparation;
+ r.size.x += cache.hseparation;
+ }
if (p_item->cells[i].custom_bg_outline) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.pos.x, r.pos.y, r.size.x, 1), p_item->cells[i].bg_color);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.pos.x, r.pos.y + r.size.y - 1, r.size.x, 1), p_item->cells[i].bg_color);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.pos.x, r.pos.y, 1, r.size.y), p_item->cells[i].bg_color);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.pos.x + r.size.x - 1, r.pos.y, 1, r.size.y), p_item->cells[i].bg_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, r.size.x, 1), p_item->cells[i].bg_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y + r.size.y - 1, r.size.x, 1), p_item->cells[i].bg_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, 1, r.size.y), p_item->cells[i].bg_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x + r.size.x - 1, r.position.y, 1, r.size.y), p_item->cells[i].bg_color);
} else {
VisualServer::get_singleton()->canvas_item_add_rect(ci, r, p_item->cells[i].bg_color);
}
@@ -1064,42 +1175,43 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
Rect2 r = cell_rect;
if (drop_mode_section == -1 || drop_mode_section == 0) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.pos.x, r.pos.y, r.size.x, 1), cache.drop_position_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, r.size.x, 1), cache.drop_position_color);
}
if (drop_mode_section == 0) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.pos.x, r.pos.y, 1, r.size.y), cache.drop_position_color);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.pos.x + r.size.x - 1, r.pos.y, 1, r.size.y), cache.drop_position_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, 1, r.size.y), cache.drop_position_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x + r.size.x - 1, r.position.y, 1, r.size.y), cache.drop_position_color);
}
if (drop_mode_section == 1 || drop_mode_section == 0) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.pos.x, r.pos.y + r.size.y, r.size.x, 1), cache.drop_position_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y + r.size.y, r.size.x, 1), cache.drop_position_color);
}
}
Color col = p_item->cells[i].custom_color ? p_item->cells[i].color : get_color(p_item->cells[i].selected ? "font_color_selected" : "font_color");
+ Color icon_col = p_item->cells[i].icon_color;
- Point2i text_pos = item_rect.pos;
+ Point2i text_pos = item_rect.position;
text_pos.y += Math::floor((item_rect.size.y - font->get_height()) / 2) + font_ascent;
switch (p_item->cells[i].mode) {
case TreeItem::CELL_MODE_STRING: {
- draw_item_rect(p_item->cells[i], item_rect, col);
+ draw_item_rect(p_item->cells[i], item_rect, col, icon_col);
} break;
case TreeItem::CELL_MODE_CHECK: {
Ref<Texture> checked = cache.checked;
Ref<Texture> unchecked = cache.unchecked;
- Point2i check_ofs = item_rect.pos;
+ Point2i check_ofs = item_rect.position;
check_ofs.y += Math::floor((real_t)(item_rect.size.y - checked->get_height()) / 2);
if (p_item->cells[i].checked) {
- checked->draw(ci, check_ofs);
+ checked->draw(ci, check_ofs, icon_col);
} else {
- unchecked->draw(ci, check_ofs);
+ unchecked->draw(ci, check_ofs, icon_col);
}
int check_w = checked->get_width() + cache.hseparation;
@@ -1107,9 +1219,9 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
text_pos.x += check_w;
item_rect.size.x -= check_w;
- item_rect.pos.x += check_w;
+ item_rect.position.x += check_w;
- draw_item_rect(p_item->cells[i], item_rect, col);
+ draw_item_rect(p_item->cells[i], item_rect, col, icon_col);
//font->draw( ci, text_pos, p_item->cells[i].text, col,item_rect.size.x-check_w );
@@ -1135,11 +1247,11 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
font->draw(ci, text_pos, s, col, item_rect.size.x - downarrow->get_width());
//?
- Point2i arrow_pos = item_rect.pos;
+ Point2i arrow_pos = item_rect.position;
arrow_pos.x += item_rect.size.x - downarrow->get_width();
arrow_pos.y += Math::floor(((item_rect.size.y - downarrow->get_height())) / 2.0);
- downarrow->draw(ci, arrow_pos);
+ downarrow->draw(ci, arrow_pos, icon_col);
} else {
Ref<Texture> updown = cache.updown;
@@ -1155,11 +1267,11 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
if (!p_item->cells[i].editable)
break;
- Point2i updown_pos = item_rect.pos;
+ Point2i updown_pos = item_rect.position;
updown_pos.x += item_rect.size.x - updown->get_width();
updown_pos.y += Math::floor(((item_rect.size.y - updown->get_height())) / 2.0);
- updown->draw(ci, updown_pos);
+ updown->draw(ci, updown_pos, icon_col);
}
} break;
@@ -1174,9 +1286,9 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
}
Point2i icon_ofs = (item_rect.size - icon_size) / 2;
- icon_ofs += item_rect.pos;
+ icon_ofs += item_rect.position;
- draw_texture_rect(p_item->cells[i].icon, Rect2(icon_ofs, icon_size));
+ draw_texture_rect(p_item->cells[i].icon, Rect2(icon_ofs, icon_size), false, icon_col);
//p_item->cells[i].icon->draw(ci, icon_ofs);
} break;
@@ -1193,19 +1305,35 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
if (!p_item->cells[i].editable) {
- draw_item_rect(p_item->cells[i], item_rect, col);
+ draw_item_rect(p_item->cells[i], item_rect, col, icon_col);
break;
}
Ref<Texture> downarrow = cache.select_arrow;
Rect2i ir = item_rect;
- ir.size.width -= downarrow->get_width();
- draw_item_rect(p_item->cells[i], ir, col);
- Point2i arrow_pos = item_rect.pos;
+ Point2i arrow_pos = item_rect.position;
arrow_pos.x += item_rect.size.x - downarrow->get_width();
arrow_pos.y += Math::floor(((item_rect.size.y - downarrow->get_height())) / 2.0);
+ ir.size.width -= downarrow->get_width();
+
+ if (p_item->cells[i].custom_button) {
+ if (cache.hover_item == p_item && cache.hover_cell == i) {
+ if (Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT)) {
+ draw_style_box(cache.custom_button_pressed, ir);
+ } else {
+ draw_style_box(cache.custom_button_hover, ir);
+ col = cache.custom_button_font_highlight;
+ }
+ } else {
+ draw_style_box(cache.custom_button, ir);
+ }
+ ir.size -= cache.custom_button->get_minimum_size();
+ ir.position += cache.custom_button->get_offset();
+ }
+
+ draw_item_rect(p_item->cells[i], ir, col, icon_col);
downarrow->draw(ci, arrow_pos);
@@ -1229,6 +1357,19 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
}
}
+ if (!p_item->disable_folding && !hide_folding && p_item->childs) { //has childs, draw the guide box
+
+ Ref<Texture> arrow;
+
+ if (p_item->collapsed) {
+
+ arrow = cache.arrow_collapsed;
+ } else {
+ arrow = cache.arrow;
+ }
+
+ arrow->draw(ci, p_pos + p_draw_ofs + Point2i(0, (label_h - arrow->get_height()) / 2) - cache.offset);
+ }
//separator
//get_painter()->draw_fill_rect( Point2i(0,pos.y),Size2i(get_size().width,1),color( COLOR_TREE_GRID) );
@@ -1250,8 +1391,8 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
while (c) {
if (cache.draw_relationship_lines == 1) {
- int root_ofs = children_pos.x + (hide_folding ? cache.hseparation : cache.item_margin);
- int parent_ofs = p_pos.x + (hide_folding ? cache.hseparation : cache.item_margin);
+ int root_ofs = children_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin);
+ int parent_ofs = p_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin);
Point2i root_pos = Point2i(root_ofs, children_pos.y + label_h / 2) - cache.offset + p_draw_ofs;
if (c->get_children() != NULL)
root_pos -= Point2i(cache.arrow->get_width(), 0);
@@ -1337,7 +1478,7 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c
if (!r_in_range && &selected_cell == &c) {
- if (!selected_cell.selected) {
+ if (!selected_cell.selected || force_select_on_already_selected) {
selected_cell.selected = true;
@@ -1408,10 +1549,12 @@ void Tree::_range_click_timeout() {
}
click_handled = false;
- InputModifierState mod = InputModifierState(); // should be irrelevant..
+ Ref<InputEventMouseButton> mb;
+ mb.instance();
+ ;
blocked++;
- propagate_mouse_event(pos + cache.offset, 0, 0, false, root, BUTTON_LEFT, mod);
+ propagate_mouse_event(pos + cache.offset, 0, 0, false, root, BUTTON_LEFT, mb);
blocked--;
if (range_click_timer->is_one_shot()) {
@@ -1428,7 +1571,7 @@ void Tree::_range_click_timeout() {
}
}
-int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool p_doubleclick, TreeItem *p_item, int p_button, const InputModifierState &p_mod) {
+int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool p_doubleclick, TreeItem *p_item, int p_button, const Ref<InputEventWithModifiers> &p_mod) {
int item_h = compute_item_height(p_item) + cache.vseparation;
@@ -1441,7 +1584,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
return -1;
}
- if (!hide_folding && (p_pos.x >= x_ofs && p_pos.x < (x_ofs + cache.item_margin))) {
+ if (!p_item->disable_folding && !hide_folding && (p_pos.x >= x_ofs && p_pos.x < (x_ofs + cache.item_margin))) {
if (p_item->childs)
p_item->set_collapsed(!p_item->is_collapsed());
@@ -1457,6 +1600,17 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
for (int i = 0; i < columns.size(); i++) {
col_width = get_column_width(i);
+
+ if (p_item->cells[i].expand_right) {
+
+ int plus = 1;
+ while (i + plus < columns.size() && !p_item->cells[i + plus].editable && p_item->cells[i + plus].mode == TreeItem::CELL_MODE_STRING && p_item->cells[i + plus].text == "" && p_item->cells[i + plus].icon.is_null()) {
+ col_width += cache.hseparation;
+ col_width += get_column_width(i + plus);
+ plus++;
+ }
+ }
+
if (x > col_width) {
col_ofs += col_width;
x -= col_width;
@@ -1481,6 +1635,11 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
x -= cache.hseparation;
}
+ if (!p_item->disable_folding && !hide_folding && !p_item->cells[col].editable && !p_item->cells[col].selectable && p_item->get_children()) {
+ p_item->set_collapsed(!p_item->is_collapsed());
+ return -1; //collapse/uncollapse because nothing can be done with item
+ }
+
TreeItem::Cell &c = p_item->cells[col];
bool already_selected = c.selected;
@@ -1502,7 +1661,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
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();
+ cache.click_pos = get_global_mouse_position() - get_global_position();
update();
//emit_signal("button_pressed");
return -1;
@@ -1516,10 +1675,11 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
if (p_doubleclick && (!c.editable || c.mode == TreeItem::CELL_MODE_CUSTOM || c.mode == TreeItem::CELL_MODE_ICON /*|| c.mode==TreeItem::CELL_MODE_CHECK*/)) { //it' s confusing for check
emit_signal("item_activated");
+ incr_search.clear();
return -1;
}
- if (select_mode == SELECT_MULTI && p_mod.command && c.selectable) {
+ if (select_mode == SELECT_MULTI && p_mod->get_command() && c.selectable) {
if (!c.selected || p_button == BUTTON_RIGHT) {
@@ -1541,7 +1701,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
if (c.selectable) {
- if (select_mode == SELECT_MULTI && p_mod.shift && selected_item && selected_item != p_item) {
+ if (select_mode == SELECT_MULTI && p_mod->get_shift() && selected_item && selected_item != p_item) {
bool inrange = false;
@@ -1626,7 +1786,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
}
popup_menu->set_size(Size2(col_width, 0));
- popup_menu->set_pos(get_global_pos() + Point2i(col_ofs, _get_title_button_height() + y_ofs + item_h) - cache.offset);
+ popup_menu->set_position(get_global_position() + Point2i(col_ofs, _get_title_button_height() + y_ofs + item_h) - cache.offset);
popup_menu->popup();
popup_edited_item = p_item;
popup_edited_item_col = col;
@@ -1692,11 +1852,19 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
case TreeItem::CELL_MODE_CUSTOM: {
edited_item = p_item;
edited_col = col;
- custom_popup_rect = Rect2i(get_global_pos() + Point2i(col_ofs, _get_title_button_height() + y_ofs + item_h - cache.offset.y), Size2(get_column_width(col), item_h));
- emit_signal("custom_popup_edited", ((bool)(x >= (col_width - item_h / 2))));
+ bool on_arrow = x > col_width - cache.select_arrow->get_width();
bring_up_editor = false;
- item_edited(col, p_item);
+
+ custom_popup_rect = Rect2i(get_global_position() + Point2i(col_ofs, _get_title_button_height() + y_ofs + item_h - cache.offset.y), Size2(get_column_width(col), item_h));
+
+ if (on_arrow || !p_item->cells[col].custom_button) {
+ emit_signal("custom_popup_edited", ((bool)(x >= (col_width - item_h / 2))));
+ }
+
+ if (!p_item->cells[col].custom_button || !on_arrow) {
+ item_edited(col, p_item, p_button == BUTTON_LEFT);
+ }
click_handled = true;
return -1;
} break;
@@ -1709,7 +1877,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
popup_edited_item = p_item;
popup_edited_item_col = col;
- pressing_item_rect = Rect2(get_global_pos() + Point2i(col_ofs, _get_title_button_height() + y_ofs) - cache.offset, Size2(col_width, item_h));
+ pressing_item_rect = Rect2(get_global_position() + Point2i(col_ofs, _get_title_button_height() + y_ofs) - cache.offset, Size2(col_width, item_h));
pressing_for_editor_text = editor_text;
pressing_for_editor = true;
@@ -1750,8 +1918,8 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
void Tree::_text_editor_modal_close() {
if (Input::get_singleton()->is_key_pressed(KEY_ESCAPE) ||
- Input::get_singleton()->is_key_pressed(KEY_ENTER) ||
- Input::get_singleton()->is_key_pressed(KEY_RETURN)) {
+ Input::get_singleton()->is_key_pressed(KEY_KP_ENTER) ||
+ Input::get_singleton()->is_key_pressed(KEY_ENTER)) {
return;
}
@@ -1799,6 +1967,14 @@ void Tree::text_editor_enter(String p_text) {
c.val = evaluator->eval(p_text);
else
c.val = p_text.to_double();
+
+ if (c.step > 0)
+ c.val = Math::stepify(c.val, c.step);
+ if (c.val < c.min)
+ c.val = c.min;
+ else if (c.val > c.max)
+ c.val = c.max;
+
} break;
default: { ERR_FAIL(); }
}
@@ -1836,516 +2012,540 @@ void Tree::popup_select(int p_option) {
item_edited(popup_edited_item_col, popup_edited_item);
}
-void Tree::_gui_input(InputEvent p_event) {
+void Tree::_gui_input(Ref<InputEvent> p_event) {
- switch (p_event.type) {
+ Ref<InputEventKey> k = p_event;
- case InputEvent::KEY: {
+ if (k.is_valid()) {
- if (!p_event.key.pressed)
- break;
- if (p_event.key.mod.alt || p_event.key.mod.command || (p_event.key.mod.shift && p_event.key.unicode == 0) || p_event.key.mod.meta)
- break;
- if (!root)
- return;
+ if (!k->is_pressed())
+ return;
+ if (k->get_alt() || k->get_command() || (k->get_shift() && k->get_unicode() == 0) || k->get_metakey())
+ return;
+ if (!root)
+ return;
- if (hide_root && !root->get_next_visible())
- return;
+ if (hide_root && !root->get_next_visible())
+ return;
- switch (p_event.key.scancode) {
+ switch (k->get_scancode()) {
#define EXIT_BREAK \
{ \
if (!cursor_can_exit_tree) accept_event(); \
break; \
}
- case KEY_RIGHT: {
-
- //TreeItem *next = NULL;
- if (!selected_item)
- break;
- if (select_mode == SELECT_ROW)
- EXIT_BREAK;
- if (selected_col >= (columns.size() - 1))
- EXIT_BREAK;
- if (select_mode == SELECT_MULTI) {
- selected_col++;
- emit_signal("cell_selected");
- } else {
-
- selected_item->select(selected_col + 1);
- }
+ case KEY_RIGHT: {
+
+ //TreeItem *next = NULL;
+ if (!selected_item)
+ break;
+ if (select_mode == SELECT_ROW)
+ EXIT_BREAK;
+ if (selected_col >= (columns.size() - 1))
+ EXIT_BREAK;
+ if (select_mode == SELECT_MULTI) {
+ selected_col++;
+ emit_signal("cell_selected");
+ } else {
- update();
- ensure_cursor_is_visible();
- accept_event();
+ selected_item->select(selected_col + 1);
+ }
- } break;
- case KEY_LEFT: {
+ update();
+ ensure_cursor_is_visible();
+ accept_event();
- //TreeItem *next = NULL;
- if (!selected_item)
- break;
- if (select_mode == SELECT_ROW)
- EXIT_BREAK;
- if (selected_col <= 0)
- EXIT_BREAK;
- if (select_mode == SELECT_MULTI) {
- selected_col--;
- emit_signal("cell_selected");
- } else {
+ } break;
+ case KEY_LEFT: {
+
+ //TreeItem *next = NULL;
+ if (!selected_item)
+ break;
+ if (select_mode == SELECT_ROW)
+ EXIT_BREAK;
+ if (selected_col <= 0)
+ EXIT_BREAK;
+ if (select_mode == SELECT_MULTI) {
+ selected_col--;
+ emit_signal("cell_selected");
+ } else {
- selected_item->select(selected_col - 1);
- }
+ selected_item->select(selected_col - 1);
+ }
- update();
- accept_event();
+ update();
+ accept_event();
- } break;
- case KEY_DOWN: {
+ } break;
+ case KEY_DOWN: {
- TreeItem *next = NULL;
- if (!selected_item) {
+ TreeItem *next = NULL;
+ if (!selected_item) {
- next = hide_root ? root->get_next_visible() : root;
- selected_item = 0;
- } else {
+ next = hide_root ? root->get_next_visible() : root;
+ selected_item = 0;
+ } else {
- next = selected_item->get_next_visible();
+ next = selected_item->get_next_visible();
- //if (diff < uint64_t(GLOBAL_DEF("gui/incr_search_max_interval_msec",2000))) {
- if (last_keypress != 0) {
- //incr search next
- int col;
- next = _search_item_text(next, incr_search, &col, true);
- if (!next) {
- accept_event();
- return;
- }
+ //if (diff < uint64_t(GLOBAL_DEF("gui/incr_search_max_interval_msec",2000))) {
+ if (last_keypress != 0) {
+ //incr search next
+ int col;
+ next = _search_item_text(next, incr_search, &col, true);
+ if (!next) {
+ accept_event();
+ return;
}
}
+ }
- if (select_mode == SELECT_MULTI) {
+ if (select_mode == SELECT_MULTI) {
- if (!next)
- EXIT_BREAK;
+ if (!next)
+ EXIT_BREAK;
- selected_item = next;
- emit_signal("cell_selected");
- update();
- } else {
+ selected_item = next;
+ emit_signal("cell_selected");
+ update();
+ } else {
- int col = selected_col < 0 ? 0 : selected_col;
+ int col = selected_col < 0 ? 0 : selected_col;
- while (next && !next->cells[col].selectable)
- next = next->get_next_visible();
- if (!next)
- EXIT_BREAK; // do nothing..
- next->select(col);
- }
+ while (next && !next->cells[col].selectable)
+ next = next->get_next_visible();
+ if (!next)
+ EXIT_BREAK; // do nothing..
+ next->select(col);
+ }
- ensure_cursor_is_visible();
- accept_event();
+ ensure_cursor_is_visible();
+ accept_event();
- } break;
- case KEY_UP: {
+ } break;
+ case KEY_UP: {
- TreeItem *prev = NULL;
- if (!selected_item) {
- prev = get_last_item();
- selected_col = 0;
- } else {
+ TreeItem *prev = NULL;
+ if (!selected_item) {
+ prev = get_last_item();
+ selected_col = 0;
+ } else {
- prev = selected_item->get_prev_visible();
- if (last_keypress != 0) {
- //incr search next
- int col;
- prev = _search_item_text(prev, incr_search, &col, true, true);
- if (!prev) {
- accept_event();
- return;
- }
+ prev = selected_item->get_prev_visible();
+ if (last_keypress != 0) {
+ //incr search next
+ int col;
+ prev = _search_item_text(prev, incr_search, &col, true, true);
+ if (!prev) {
+ accept_event();
+ return;
}
}
+ }
- if (select_mode == SELECT_MULTI) {
+ if (select_mode == SELECT_MULTI) {
- if (!prev)
- break;
- selected_item = prev;
- emit_signal("cell_selected");
- update();
- } else {
+ if (!prev)
+ break;
+ selected_item = prev;
+ emit_signal("cell_selected");
+ update();
+ } else {
- int col = selected_col < 0 ? 0 : selected_col;
- while (prev && !prev->cells[col].selectable)
- prev = prev->get_prev_visible();
- if (!prev)
- break; // do nothing..
- prev->select(col);
- }
+ int col = selected_col < 0 ? 0 : selected_col;
+ while (prev && !prev->cells[col].selectable)
+ prev = prev->get_prev_visible();
+ if (!prev)
+ break; // do nothing..
+ prev->select(col);
+ }
- ensure_cursor_is_visible();
- accept_event();
+ ensure_cursor_is_visible();
+ accept_event();
- } break;
- case KEY_PAGEDOWN: {
+ } break;
+ case KEY_PAGEDOWN: {
- TreeItem *next = NULL;
- if (!selected_item)
- break;
- next = selected_item;
+ TreeItem *next = NULL;
+ if (!selected_item)
+ break;
+ next = selected_item;
- for (int i = 0; i < 10; i++) {
+ for (int i = 0; i < 10; i++) {
- TreeItem *_n = next->get_next_visible();
- if (_n) {
- next = _n;
- } else {
+ TreeItem *_n = next->get_next_visible();
+ if (_n) {
+ next = _n;
+ } else {
- break;
- }
- }
- if (next == selected_item)
break;
+ }
+ }
+ if (next == selected_item)
+ break;
- if (select_mode == SELECT_MULTI) {
+ if (select_mode == SELECT_MULTI) {
- selected_item = next;
- emit_signal("cell_selected");
- update();
- } else {
+ selected_item = next;
+ emit_signal("cell_selected");
+ update();
+ } else {
- while (next && !next->cells[selected_col].selectable)
- next = next->get_next_visible();
- if (!next)
- EXIT_BREAK; // do nothing..
- next->select(selected_col);
- }
+ while (next && !next->cells[selected_col].selectable)
+ next = next->get_next_visible();
+ if (!next)
+ EXIT_BREAK; // do nothing..
+ next->select(selected_col);
+ }
- ensure_cursor_is_visible();
- } break;
- case KEY_PAGEUP: {
+ ensure_cursor_is_visible();
+ } break;
+ case KEY_PAGEUP: {
- TreeItem *prev = NULL;
- if (!selected_item)
- break;
- prev = selected_item;
+ TreeItem *prev = NULL;
+ if (!selected_item)
+ break;
+ prev = selected_item;
- for (int i = 0; i < 10; i++) {
+ for (int i = 0; i < 10; i++) {
- TreeItem *_n = prev->get_prev_visible();
- if (_n) {
- prev = _n;
- } else {
+ TreeItem *_n = prev->get_prev_visible();
+ if (_n) {
+ prev = _n;
+ } else {
- break;
- }
- }
- if (prev == selected_item)
break;
+ }
+ }
+ if (prev == selected_item)
+ break;
- if (select_mode == SELECT_MULTI) {
+ if (select_mode == SELECT_MULTI) {
- selected_item = prev;
- emit_signal("cell_selected");
- update();
- } else {
+ selected_item = prev;
+ emit_signal("cell_selected");
+ update();
+ } else {
- while (prev && !prev->cells[selected_col].selectable)
- prev = prev->get_prev_visible();
- if (!prev)
- EXIT_BREAK; // do nothing..
- prev->select(selected_col);
- }
+ while (prev && !prev->cells[selected_col].selectable)
+ prev = prev->get_prev_visible();
+ if (!prev)
+ EXIT_BREAK; // do nothing..
+ prev->select(selected_col);
+ }
- ensure_cursor_is_visible();
+ ensure_cursor_is_visible();
- } break;
- case KEY_F2:
- case KEY_RETURN:
- case KEY_ENTER: {
-
- if (selected_item) {
- //bring up editor if possible
- if (!edit_selected()) {
- emit_signal("item_activated");
- }
+ } break;
+ case KEY_F2:
+ case KEY_ENTER:
+ case KEY_KP_ENTER: {
+
+ if (selected_item) {
+ //bring up editor if possible
+ if (!edit_selected()) {
+ emit_signal("item_activated");
+ incr_search.clear();
}
- accept_event();
+ }
+ accept_event();
- } break;
- case KEY_SPACE: {
- if (select_mode == SELECT_MULTI) {
- if (!selected_item)
- break;
- if (selected_item->is_selected(selected_col)) {
- selected_item->deselect(selected_col);
- emit_signal("multi_selected", selected_item, selected_col, false);
- } else if (selected_item->is_selectable(selected_col)) {
- selected_item->select(selected_col);
- emit_signal("multi_selected", selected_item, selected_col, true);
- }
+ } break;
+ case KEY_SPACE: {
+ if (select_mode == SELECT_MULTI) {
+ if (!selected_item)
+ break;
+ if (selected_item->is_selected(selected_col)) {
+ selected_item->deselect(selected_col);
+ emit_signal("multi_selected", selected_item, selected_col, false);
+ } else if (selected_item->is_selectable(selected_col)) {
+ selected_item->select(selected_col);
+ emit_signal("multi_selected", selected_item, selected_col, true);
}
- accept_event();
+ }
+ accept_event();
- } break;
- default: {
+ } break;
+ default: {
- if (p_event.key.unicode > 0) {
+ if (k->get_unicode() > 0) {
- _do_incr_search(String::chr(p_event.key.unicode));
- accept_event();
+ _do_incr_search(String::chr(k->get_unicode()));
+ accept_event();
- return;
- } else {
- if (p_event.key.scancode != KEY_SHIFT)
- last_keypress = 0;
- }
- } break;
+ return;
+ } else {
+ if (k->get_scancode() != KEY_SHIFT)
+ last_keypress = 0;
+ }
+ } break;
- last_keypress = 0;
- }
+ last_keypress = 0;
+ }
+ }
- } break;
+ Ref<InputEventMouseMotion> mm = p_event;
- case InputEvent::MOUSE_MOTION: {
+ if (mm.is_valid()) {
- if (cache.font.is_null()) // avoid a strange case that may fuckup stuff
- update_cache();
- const InputEventMouseMotion &b = p_event.mouse_motion;
+ if (cache.font.is_null()) // avoid a strange case that may fuckup stuff
+ update_cache();
- Ref<StyleBox> bg = cache.bg;
+ Ref<StyleBox> bg = cache.bg;
- Point2 pos = Point2(b.x, b.y) - bg->get_offset();
+ Point2 pos = mm->get_position() - bg->get_offset();
- Cache::ClickType old_hover = cache.hover_type;
- int old_index = cache.hover_index;
+ Cache::ClickType old_hover = cache.hover_type;
+ int old_index = cache.hover_index;
- cache.hover_type = Cache::CLICK_NONE;
- cache.hover_index = 0;
- if (show_column_titles) {
- pos.y -= _get_title_button_height();
- if (pos.y < 0) {
- pos.x += cache.offset.x;
- int len = 0;
- for (int i = 0; i < columns.size(); i++) {
-
- len += get_column_width(i);
- if (pos.x < len) {
-
- cache.hover_type = Cache::CLICK_TITLE;
- cache.hover_index = i;
- update();
- break;
- }
+ cache.hover_type = Cache::CLICK_NONE;
+ cache.hover_index = 0;
+ if (show_column_titles) {
+ pos.y -= _get_title_button_height();
+ if (pos.y < 0) {
+ pos.x += cache.offset.x;
+ int len = 0;
+ for (int i = 0; i < columns.size(); i++) {
+
+ len += get_column_width(i);
+ if (pos.x < len) {
+
+ cache.hover_type = Cache::CLICK_TITLE;
+ cache.hover_index = i;
+ update();
+ break;
}
}
}
+ }
- if (drop_mode_flags && root) {
+ if (root) {
- Point2 mpos = Point2(b.x, b.y);
- mpos -= cache.bg->get_offset();
- mpos.y -= _get_title_button_height();
- if (mpos.y >= 0) {
+ Point2 mpos = mm->get_position();
+ mpos -= cache.bg->get_offset();
+ mpos.y -= _get_title_button_height();
+ if (mpos.y >= 0) {
- if (h_scroll->is_visible_in_tree())
- mpos.x += h_scroll->get_value();
- if (v_scroll->is_visible_in_tree())
- mpos.y += v_scroll->get_value();
+ if (h_scroll->is_visible_in_tree())
+ mpos.x += h_scroll->get_value();
+ if (v_scroll->is_visible_in_tree())
+ mpos.y += v_scroll->get_value();
- int col, h, section;
- TreeItem *it = _find_item_at_pos(root, mpos, col, h, section);
+ int col, h, section;
+ TreeItem *it = _find_item_at_pos(root, mpos, col, h, section);
- if (it != drop_mode_over || section != drop_mode_section) {
- drop_mode_over = it;
- drop_mode_section = section;
- update();
- }
+ if (drop_mode_flags && it != drop_mode_over || section != drop_mode_section) {
+ drop_mode_over = it;
+ drop_mode_section = section;
+ update();
}
- }
- if (cache.hover_type != old_hover || cache.hover_index != old_index) {
- update();
+ if (it != cache.hover_item || col != cache.hover_cell) {
+ cache.hover_item = it;
+ cache.hover_cell = col;
+ update();
+ }
}
+ }
- if (pressing_for_editor && popup_edited_item && (popup_edited_item->get_cell_mode(popup_edited_item_col) == TreeItem::CELL_MODE_RANGE || popup_edited_item->get_cell_mode(popup_edited_item_col) == TreeItem::CELL_MODE_RANGE_EXPRESSION)) {
- //range drag
+ if (cache.hover_type != old_hover || cache.hover_index != old_index) {
+ update();
+ }
- if (!range_drag_enabled) {
+ if (pressing_for_editor && popup_edited_item && (popup_edited_item->get_cell_mode(popup_edited_item_col) == TreeItem::CELL_MODE_RANGE || popup_edited_item->get_cell_mode(popup_edited_item_col) == TreeItem::CELL_MODE_RANGE_EXPRESSION)) {
+ //range drag
- Vector2 cpos = Vector2(b.x, b.y);
- if (cpos.distance_to(pressing_pos) > 2) {
- range_drag_enabled = true;
- range_drag_capture_pos = cpos;
- range_drag_base = popup_edited_item->get_range(popup_edited_item_col);
- Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_CAPTURED);
- }
- } else {
+ if (!range_drag_enabled) {
- TreeItem::Cell &c = popup_edited_item->cells[popup_edited_item_col];
- float diff_y = -b.relative_y;
- diff_y = Math::pow(ABS(diff_y), 1.8f) * SGN(diff_y);
- diff_y *= 0.1;
- range_drag_base = CLAMP(range_drag_base + c.step * diff_y, c.min, c.max);
- popup_edited_item->set_range(popup_edited_item_col, range_drag_base);
- item_edited(popup_edited_item_col, popup_edited_item);
+ Vector2 cpos = mm->get_position();
+ if (cpos.distance_to(pressing_pos) > 2) {
+ range_drag_enabled = true;
+ range_drag_capture_pos = cpos;
+ range_drag_base = popup_edited_item->get_range(popup_edited_item_col);
+ Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_CAPTURED);
}
+ } else {
+
+ TreeItem::Cell &c = popup_edited_item->cells[popup_edited_item_col];
+ float diff_y = -mm->get_relative().y;
+ diff_y = Math::pow(ABS(diff_y), 1.8f) * SGN(diff_y);
+ diff_y *= 0.1;
+ range_drag_base = CLAMP(range_drag_base + c.step * diff_y, c.min, c.max);
+ popup_edited_item->set_range(popup_edited_item_col, range_drag_base);
+ item_edited(popup_edited_item_col, popup_edited_item);
}
+ }
- if (drag_touching && !drag_touching_deaccel) {
+ if (drag_touching && !drag_touching_deaccel) {
- drag_accum -= b.relative_y;
- v_scroll->set_value(drag_from + drag_accum);
- drag_speed = -b.speed_y;
- }
- } break;
- case InputEvent::MOUSE_BUTTON: {
+ drag_accum -= mm->get_relative().y;
+ v_scroll->set_value(drag_from + drag_accum);
+ drag_speed = -mm->get_speed().y;
+ }
+ }
+
+ Ref<InputEventMouseButton> b = p_event;
+
+ if (b.is_valid()) {
+ if (cache.font.is_null()) // avoid a strange case that may fuckup stuff
+ update_cache();
- if (cache.font.is_null()) // avoid a strange case that may fuckup stuff
- update_cache();
- const InputEventMouseButton &b = p_event.mouse_button;
+ if (!b->is_pressed()) {
- if (!b.pressed) {
+ if (b->get_button_index() == BUTTON_LEFT) {
- if (b.button_index == BUTTON_LEFT) {
+ Point2 pos = b->get_position() - cache.bg->get_offset();
+ if (show_column_titles) {
+ pos.y -= _get_title_button_height();
- if (single_select_defer) {
- select_single_item(single_select_defer, root, single_select_defer_column);
- single_select_defer = NULL;
+ if (pos.y < 0) {
+ pos.x += cache.offset.x;
+ int len = 0;
+ for (int i = 0; i < columns.size(); i++) {
+
+ len += get_column_width(i);
+ if (pos.x < len) {
+ emit_signal("column_title_pressed", i);
+ break;
+ }
+ }
}
+ }
+
+ if (single_select_defer) {
+ select_single_item(single_select_defer, root, single_select_defer_column);
+ single_select_defer = NULL;
+ }
- range_click_timer->stop();
+ range_click_timer->stop();
- if (pressing_for_editor) {
+ if (pressing_for_editor) {
- if (range_drag_enabled) {
+ if (range_drag_enabled) {
- range_drag_enabled = false;
- Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE);
- warp_mouse(range_drag_capture_pos);
+ range_drag_enabled = false;
+ Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE);
+ warp_mouse(range_drag_capture_pos);
+ } else {
+ Rect2 rect = get_selected()->get_meta("__focus_rect");
+ if (rect.has_point(Point2(b->get_position().x, b->get_position().y))) {
+ edit_selected();
} else {
- Rect2 rect = get_selected()->get_meta("__focus_rect");
- if (rect.has_point(Point2(p_event.mouse_button.x, p_event.mouse_button.y))) {
- edit_selected();
- } else {
- emit_signal("item_double_clicked");
- }
+ emit_signal("item_double_clicked");
}
- pressing_for_editor = false;
}
+ pressing_for_editor = false;
+ }
- 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);
- }
- cache.click_type = Cache::CLICK_NONE;
- cache.click_index = -1;
- cache.click_id = -1;
- cache.click_item = NULL;
- cache.click_column = 0;
+ 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);
+ }
+ cache.click_type = Cache::CLICK_NONE;
+ cache.click_index = -1;
+ cache.click_id = -1;
+ cache.click_item = NULL;
+ cache.click_column = 0;
- if (drag_touching) {
+ if (drag_touching) {
- if (drag_speed == 0) {
- drag_touching_deaccel = false;
- drag_touching = false;
- set_fixed_process(false);
- } else {
+ if (drag_speed == 0) {
+ drag_touching_deaccel = false;
+ drag_touching = false;
+ set_fixed_process(false);
+ } else {
- drag_touching_deaccel = true;
- }
+ drag_touching_deaccel = true;
}
- update();
}
- break;
+ update();
}
+ return;
+ }
- if (range_drag_enabled)
- break;
-
- switch (b.button_index) {
- case BUTTON_RIGHT:
- case BUTTON_LEFT: {
- Ref<StyleBox> bg = cache.bg;
+ if (range_drag_enabled)
+ return;
- Point2 pos = Point2(b.x, b.y) - bg->get_offset();
- cache.click_type = Cache::CLICK_NONE;
- if (show_column_titles && b.button_index == BUTTON_LEFT) {
- pos.y -= _get_title_button_height();
-
- if (pos.y < 0) {
- pos.x += cache.offset.x;
- int len = 0;
- for (int i = 0; i < columns.size(); i++) {
-
- len += get_column_width(i);
- if (pos.x < len) {
-
- cache.click_type = Cache::CLICK_TITLE;
- cache.click_index = i;
- //cache.click_id=;
- update();
- break;
- }
+ switch (b->get_button_index()) {
+ case BUTTON_RIGHT:
+ case BUTTON_LEFT: {
+ Ref<StyleBox> bg = cache.bg;
+
+ Point2 pos = b->get_position() - bg->get_offset();
+ cache.click_type = Cache::CLICK_NONE;
+ if (show_column_titles && b->get_button_index() == BUTTON_LEFT) {
+ pos.y -= _get_title_button_height();
+
+ if (pos.y < 0) {
+ pos.x += cache.offset.x;
+ int len = 0;
+ for (int i = 0; i < columns.size(); i++) {
+
+ len += get_column_width(i);
+ if (pos.x < len) {
+
+ cache.click_type = Cache::CLICK_TITLE;
+ cache.click_index = i;
+ //cache.click_id=;
+ update();
+ break;
}
- break;
- }
- }
- if (!root || (!root->get_children() && hide_root)) {
- if (b.button_index == BUTTON_RIGHT && allow_rmb_select) {
- emit_signal("empty_tree_rmb_selected", get_local_mouse_pos());
}
break;
}
+ }
+ if (!root || (!root->get_children() && hide_root)) {
+ if (b->get_button_index() == BUTTON_RIGHT && allow_rmb_select) {
+ emit_signal("empty_tree_rmb_selected", get_local_mouse_pos());
+ }
+ break;
+ }
- click_handled = false;
- pressing_for_editor = false;
+ click_handled = false;
+ pressing_for_editor = false;
- blocked++;
- bool handled = propagate_mouse_event(pos + cache.offset, 0, 0, b.doubleclick, root, b.button_index, b.mod);
- blocked--;
+ blocked++;
+ bool handled = propagate_mouse_event(pos + cache.offset, 0, 0, b->is_doubleclick(), root, b->get_button_index(), b);
+ blocked--;
- if (pressing_for_editor) {
- pressing_pos = Point2(b.x, b.y);
- }
+ if (pressing_for_editor) {
+ pressing_pos = b->get_position();
+ }
- if (b.button_index == BUTTON_RIGHT)
- break;
+ if (b->get_button_index() == BUTTON_RIGHT)
+ break;
- if (drag_touching) {
- set_fixed_process(false);
- drag_touching_deaccel = false;
- drag_touching = false;
- drag_speed = 0;
- drag_from = 0;
- }
+ if (drag_touching) {
+ set_fixed_process(false);
+ drag_touching_deaccel = false;
+ drag_touching = false;
+ drag_speed = 0;
+ drag_from = 0;
+ }
- if (!click_handled) {
- drag_speed = 0;
- drag_accum = 0;
- //last_drag_accum=0;
- drag_from = v_scroll->get_value();
- drag_touching = OS::get_singleton()->has_touchscreen_ui_hint();
- drag_touching_deaccel = false;
- if (drag_touching) {
- set_fixed_process(true);
- }
+ if (!click_handled) {
+ drag_speed = 0;
+ drag_accum = 0;
+ //last_drag_accum=0;
+ drag_from = v_scroll->get_value();
+ drag_touching = OS::get_singleton()->has_touchscreen_ui_hint();
+ drag_touching_deaccel = false;
+ if (drag_touching) {
+ set_fixed_process(true);
}
+ }
- } break;
- case BUTTON_WHEEL_UP: {
-
- v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() / 8);
- } break;
- case BUTTON_WHEEL_DOWN: {
+ } break;
+ case BUTTON_WHEEL_UP: {
- v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() / 8);
- } break;
- }
+ v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() * b->get_factor() / 8);
+ } break;
+ case BUTTON_WHEEL_DOWN: {
- } break;
+ v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * b->get_factor() / 8);
+ } break;
+ }
}
}
@@ -2378,7 +2578,7 @@ bool Tree::edit_selected() {
edited_item = s;
edited_col = col;
- custom_popup_rect = Rect2i(get_global_pos() + rect.pos, rect.size);
+ custom_popup_rect = Rect2i(get_global_position() + rect.position, rect.size);
emit_signal("custom_popup_edited", false);
item_edited(col, s);
@@ -2393,7 +2593,7 @@ bool Tree::edit_selected() {
}
popup_menu->set_size(Size2(rect.size.width, 0));
- popup_menu->set_pos(get_global_pos() + rect.pos + Point2i(0, rect.size.height));
+ popup_menu->set_position(get_global_position() + rect.position + Point2i(0, rect.size.height));
popup_menu->popup();
popup_edited_item = s;
popup_edited_item_col = col;
@@ -2401,8 +2601,8 @@ bool Tree::edit_selected() {
} else if (c.mode == TreeItem::CELL_MODE_STRING || c.mode == TreeItem::CELL_MODE_RANGE || c.mode == TreeItem::CELL_MODE_RANGE_EXPRESSION) {
- Point2i textedpos = get_global_pos() + rect.pos;
- text_editor->set_pos(textedpos);
+ Point2i textedpos = get_global_position() + rect.position;
+ text_editor->set_position(textedpos);
text_editor->set_size(rect.size);
text_editor->clear();
text_editor->set_text(c.mode == TreeItem::CELL_MODE_STRING ? c.text : String::num(c.val, Math::step_decimals(c.step)));
@@ -2410,7 +2610,7 @@ bool Tree::edit_selected() {
if (c.mode == TreeItem::CELL_MODE_RANGE || c.mode == TreeItem::CELL_MODE_RANGE_EXPRESSION) {
- value_editor->set_pos(textedpos + Point2i(0, text_editor->get_size().height));
+ value_editor->set_position(textedpos + Point2i(0, text_editor->get_size().height));
value_editor->set_size(Size2(rect.size.width, 1));
value_editor->show_modal();
updating_value_editor = true;
@@ -2528,7 +2728,7 @@ void Tree::_notification(int p_what) {
if (p_what == NOTIFICATION_DRAG_BEGIN) {
single_select_defer = NULL;
- if (cache.scroll_speed > 0 && get_rect().has_point(get_viewport()->get_mouse_pos() - get_global_pos())) {
+ if (cache.scroll_speed > 0 && get_rect().has_point(get_viewport()->get_mouse_position() - get_global_position())) {
scrolling = true;
set_fixed_process(true);
}
@@ -2576,7 +2776,7 @@ void Tree::_notification(int p_what) {
}
if (scrolling) {
- Point2 point = get_viewport()->get_mouse_pos() - get_global_pos();
+ Point2 point = get_viewport()->get_mouse_position() - get_global_position();
if (point.x < cache.scroll_border) {
point.x -= cache.scroll_border;
} else if (point.x > get_size().width - cache.scroll_border) {
@@ -2648,7 +2848,7 @@ void Tree::_notification(int p_what) {
ofs += tbrect.size.width;
//text
int clip_w = tbrect.size.width - sb->get_minimum_size().width;
- f->draw_halign(ci, tbrect.pos + Point2i(sb->get_offset().x, (tbrect.size.height - f->get_height()) / 2 + f->get_ascent()), HALIGN_CENTER, clip_w, columns[i].title, cache.title_button_color);
+ f->draw_halign(ci, tbrect.position + Point2i(sb->get_offset().x, (tbrect.size.height - f->get_height()) / 2 + f->get_ascent()), HALIGN_CENTER, clip_w, columns[i].title, cache.title_button_color);
}
}
}
@@ -2726,11 +2926,14 @@ TreeItem *Tree::get_last_item() {
return last;
}
-void Tree::item_edited(int p_column, TreeItem *p_item) {
+void Tree::item_edited(int p_column, TreeItem *p_item, bool p_lmb) {
edited_item = p_item;
edited_col = p_column;
- emit_signal("item_edited");
+ if (p_lmb)
+ emit_signal("item_edited");
+ else
+ emit_signal("item_rmb_edited");
}
void Tree::item_changed(int p_column, TreeItem *p_item) {
@@ -3009,7 +3212,7 @@ void Tree::ensure_cursor_is_visible() {
int screenh = get_size().height - h_scroll->get_combined_minimum_size().height;
if (ofs + h > v_scroll->get_value() + screenh)
- v_scroll->call_deferred("set_val", ofs - screenh + h);
+ v_scroll->call_deferred("set_value", ofs - screenh + h);
else if (ofs < v_scroll->get_value())
v_scroll->set_value(ofs);
}
@@ -3030,11 +3233,11 @@ Rect2 Tree::get_item_rect(TreeItem *p_item, int p_column) const {
int ofs = get_item_offset(p_item);
int height = compute_item_height(p_item);
Rect2 r;
- r.pos.y = ofs;
+ r.position.y = ofs;
r.size.height = height;
if (p_column == -1) {
- r.pos.x = 0;
+ r.position.x = 0;
r.size.x = get_size().width;
} else {
@@ -3042,7 +3245,7 @@ Rect2 Tree::get_item_rect(TreeItem *p_item, int p_column) const {
for (int i = 0; i < p_column; i++) {
accum += get_column_width(i);
}
- r.pos.x = accum;
+ r.position.x = accum;
r.size.x = get_column_width(p_column);
}
@@ -3289,6 +3492,19 @@ String Tree::get_tooltip(const Point2 &p_pos) const {
if (it) {
+ TreeItem::Cell &c = it->cells[col];
+ int col_width = get_column_width(col);
+ for (int j = c.buttons.size() - 1; j >= 0; j--) {
+ Ref<Texture> b = c.buttons[j].texture;
+ Size2 size = b->get_size() + cache.button_pressed->get_minimum_size();
+ if (pos.x > col_width - size.width) {
+ String tooltip = c.buttons[j].tooltip;
+ if (tooltip != "") {
+ return tooltip;
+ }
+ }
+ col_width -= size.width;
+ }
String ret;
if (it->get_tooltip(col) == "")
ret = it->get_text(col);
@@ -3382,16 +3598,16 @@ void Tree::_bind_methods() {
ClassDB::bind_method(D_METHOD("_scroll_moved"), &Tree::_scroll_moved);
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(D_METHOD("create_item", "parent"), &Tree::_create_item, DEFVAL(Variant()));
- ClassDB::bind_method(D_METHOD("get_root:TreeItem"), &Tree::get_root);
+ ClassDB::bind_method(D_METHOD("get_root"), &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(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_next_selected", "from"), &Tree::_get_next_selected);
+ ClassDB::bind_method(D_METHOD("get_selected"), &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);
@@ -3399,11 +3615,11 @@ void Tree::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_columns", "amount"), &Tree::set_columns);
ClassDB::bind_method(D_METHOD("get_columns"), &Tree::get_columns);
- ClassDB::bind_method(D_METHOD("get_edited:TreeItem"), &Tree::get_edited);
+ ClassDB::bind_method(D_METHOD("get_edited"), &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_item_area_rect", "item", "column"), &Tree::_get_item_rect, DEFVAL(-1));
+ ClassDB::bind_method(D_METHOD("get_item_at_pos", "pos"), &Tree::get_item_at_pos);
ClassDB::bind_method(D_METHOD("get_column_at_pos", "pos"), &Tree::get_column_at_pos);
ClassDB::bind_method(D_METHOD("ensure_cursor_is_visible"), &Tree::ensure_cursor_is_visible);
@@ -3433,12 +3649,15 @@ void Tree::_bind_methods() {
ADD_SIGNAL(MethodInfo("item_rmb_selected", PropertyInfo(Variant::VECTOR2, "pos")));
ADD_SIGNAL(MethodInfo("empty_tree_rmb_selected", PropertyInfo(Variant::VECTOR2, "pos")));
ADD_SIGNAL(MethodInfo("item_edited"));
+ ADD_SIGNAL(MethodInfo("item_rmb_edited"));
+ ADD_SIGNAL(MethodInfo("item_custom_button_pressed"));
ADD_SIGNAL(MethodInfo("item_double_clicked"));
ADD_SIGNAL(MethodInfo("item_collapsed", PropertyInfo(Variant::OBJECT, "item")));
//ADD_SIGNAL( MethodInfo("item_doubleclicked" ) );
ADD_SIGNAL(MethodInfo("button_pressed", PropertyInfo(Variant::OBJECT, "item"), PropertyInfo(Variant::INT, "column"), PropertyInfo(Variant::INT, "id")));
ADD_SIGNAL(MethodInfo("custom_popup_edited", PropertyInfo(Variant::BOOL, "arrow_clicked")));
ADD_SIGNAL(MethodInfo("item_activated"));
+ ADD_SIGNAL(MethodInfo("column_title_pressed", PropertyInfo(Variant::INT, "column")));
BIND_CONSTANT(SELECT_SINGLE);
BIND_CONSTANT(SELECT_ROW);
@@ -3538,6 +3757,9 @@ Tree::Tree() {
force_edit_checkbox_only_on_checkbox = false;
set_clip_contents(true);
+
+ cache.hover_item = NULL;
+ cache.hover_cell = -1;
}
Tree::~Tree() {
diff --git a/scene/gui/tree.h b/scene/gui/tree.h
index 68d4453156..81880122a9 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -57,6 +58,12 @@ public:
CELL_MODE_CUSTOM, ///< Contains a custom value, show a string, and an edit button
};
+ enum TextAlign {
+ ALIGN_LEFT,
+ ALIGN_CENTER,
+ ALIGN_RIGHT
+ };
+
private:
friend class Tree;
@@ -80,6 +87,11 @@ private:
bool custom_bg_color;
bool custom_bg_outline;
Color bg_color;
+ bool custom_button;
+ bool expand_right;
+ Color icon_color;
+
+ TextAlign text_align;
Variant meta;
String tooltip;
@@ -92,10 +104,12 @@ private:
bool disabled;
Ref<Texture> texture;
Color color;
+ String tooltip;
Button() {
id = 0;
disabled = false;
color = Color(1, 1, 1, 1);
+ tooltip = "";
}
};
@@ -104,6 +118,7 @@ private:
Cell() {
custom_draw_obj = 0;
+ custom_button = false;
mode = TreeItem::CELL_MODE_STRING;
min = 0;
max = 100;
@@ -117,15 +132,19 @@ private:
custom_bg_color = false;
expr = false;
icon_max_w = 0;
+ text_align = ALIGN_LEFT;
+ expand_right = false;
+ icon_color = Color(1, 1, 1);
}
Size2 get_icon_size() const;
- void draw_icon(const RID &p_where, const Point2 &p_pos, const Size2 &p_size = Size2()) const;
+ void draw_icon(const RID &p_where, const Point2 &p_pos, const Size2 &p_size = Size2(), const Color &p_color = Color()) const;
};
Vector<Cell> cells;
bool collapsed; // wont show childs
+ bool disable_folding;
TreeItem *parent; // parent item
TreeItem *next; // next in list
@@ -176,10 +195,13 @@ public:
void set_icon_region(int p_column, const Rect2 &p_icon_region);
Rect2 get_icon_region(int p_column) const;
+ void set_icon_color(int p_column, const Color &p_icon_color);
+ Color get_icon_color(int p_column) const;
+
void set_icon_max_width(int p_column, int p_max);
int get_icon_max_width(int p_column) const;
- void add_button(int p_column, const Ref<Texture> &p_button, int p_id = -1, bool p_disabled = false);
+ void add_button(int p_column, const Ref<Texture> &p_button, int p_id = -1, bool p_disabled = false, const String &p_tooltip = "");
int get_button_count(int p_column) const;
Ref<Texture> get_button(int p_column, int p_idx) const;
int get_button_id(int p_column, int p_idx) const;
@@ -235,18 +257,31 @@ public:
void clear_custom_bg_color(int p_column);
Color get_custom_bg_color(int p_column) const;
+ void set_custom_as_button(int p_column, bool p_button);
+ bool is_custom_set_as_button(int p_column) const;
+
void set_tooltip(int p_column, const String &p_tooltip);
String get_tooltip(int p_column) const;
void clear_children();
+ void set_text_align(int p_column, TextAlign p_align);
+ TextAlign get_text_align(int p_column) const;
+
+ void set_expand_right(int p_column, bool p_enable);
+ bool get_expand_right(int p_column) const;
+
void move_to_top();
void move_to_bottom();
+ void set_disable_folding(bool p_disable);
+ bool is_folding_disabled() const;
+
~TreeItem();
};
VARIANT_ENUM_CAST(TreeItem::TreeCellMode);
+VARIANT_ENUM_CAST(TreeItem::TextAlign);
class Tree : public Control {
@@ -331,22 +366,22 @@ private:
int compute_item_height(TreeItem *p_item) const;
int get_item_height(TreeItem *p_item) const;
//void draw_item_text(String p_text,const Ref<Texture>& p_icon,int p_icon_max_w,bool p_tool,Rect2i p_rect,const Color& p_color);
- void draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color);
+ void draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color, const Color &p_icon_color);
int draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 &p_draw_size, TreeItem *p_item);
void select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_col, TreeItem *p_prev = NULL, bool *r_in_range = NULL, bool p_force_deselect = false);
- int propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool p_doubleclick, TreeItem *p_item, int p_button, const InputModifierState &p_mod);
+ int propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool p_doubleclick, TreeItem *p_item, int p_button, const Ref<InputEventWithModifiers> &p_mod);
void text_editor_enter(String p_text);
void _text_editor_modal_close();
void value_editor_changed(double p_value);
void popup_select(int p_option);
- void _gui_input(InputEvent p_event);
+ void _gui_input(Ref<InputEvent> p_event);
void _notification(int p_what);
Size2 get_minimum_size() const;
- void item_edited(int p_column, TreeItem *p_item);
+ void item_edited(int p_column, TreeItem *p_item, bool p_lmb = true);
void item_changed(int p_column, TreeItem *p_item);
void item_selected(int p_column, TreeItem *p_item);
void item_deselected(int p_column, TreeItem *p_item);
@@ -366,6 +401,10 @@ private:
Ref<StyleBox> title_button;
Ref<StyleBox> title_button_hover;
Ref<StyleBox> title_button_pressed;
+ Ref<StyleBox> custom_button;
+ Ref<StyleBox> custom_button_hover;
+ Ref<StyleBox> custom_button_pressed;
+
Color title_button_color;
Ref<Texture> checked;
@@ -380,6 +419,7 @@ private:
Color guide_color;
Color drop_position_color;
Color relationship_line_color;
+ Color custom_button_font_highlight;
int hseparation;
int vseparation;
@@ -407,6 +447,9 @@ private:
int hover_index;
Point2 click_pos;
+ TreeItem *hover_item;
+ int hover_cell;
+
} cache;
int _get_title_button_height() const;
@@ -428,7 +471,7 @@ private:
TreeItem *_search_item_text(TreeItem *p_at, const String &p_find, int *r_col, bool p_selectable, bool p_backwards = false);
- TreeItem *_find_item_at_pos(TreeItem *p_current, const Point2 &p_pos, int &r_column, int &h, int &section) const;
+ TreeItem *_find_item_at_pos(TreeItem *p_item, const Point2 &p_pos, int &r_column, int &h, int &section) const;
/* float drag_speed;
float drag_accum;
@@ -481,7 +524,7 @@ public:
void set_column_expand(int p_column, bool p_expand);
int get_column_width(int p_column) const;
- void set_hide_root(bool p_eanbled);
+ void set_hide_root(bool p_enabled);
TreeItem *get_next_selected(TreeItem *p_item);
TreeItem *get_selected() const;
int get_selected_column() const;
diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp
index 433cc546a6..9c018a4e7c 100644
--- a/scene/gui/video_player.cpp
+++ b/scene/gui/video_player.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -347,8 +348,8 @@ bool VideoPlayer::has_autoplay() const {
void VideoPlayer::_bind_methods() {
- 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(D_METHOD("set_stream", "stream"), &VideoPlayer::set_stream);
+ ClassDB::bind_method(D_METHOD("get_stream"), &VideoPlayer::get_stream);
ClassDB::bind_method(D_METHOD("play"), &VideoPlayer::play);
ClassDB::bind_method(D_METHOD("stop"), &VideoPlayer::stop);
@@ -380,7 +381,7 @@ void VideoPlayer::_bind_methods() {
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(D_METHOD("get_video_texture:Texture"), &VideoPlayer::get_video_texture);
+ ClassDB::bind_method(D_METHOD("get_video_texture"), &VideoPlayer::get_video_texture);
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");
diff --git a/scene/gui/video_player.h b/scene/gui/video_player.h
index 4f2894cdc2..87c452509b 100644
--- a/scene/gui/video_player.h
+++ b/scene/gui/video_player.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -58,7 +59,7 @@ class VideoPlayer : public Control {
RID stream_rid;
Ref<ImageTexture> texture;
- Image last_frame;
+ Ref<Image> last_frame;
AudioRBResampler resampler;
@@ -104,7 +105,7 @@ public:
String get_stream_name() const;
float get_stream_pos() const;
- void set_autoplay(bool p_vol);
+ void set_autoplay(bool p_enable);
bool has_autoplay() const;
void set_audio_track(int p_track);
diff --git a/scene/gui/viewport_container.cpp b/scene/gui/viewport_container.cpp
index 93789d945d..dbc2699867 100644
--- a/scene/gui/viewport_container.cpp
+++ b/scene/gui/viewport_container.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/gui/viewport_container.h b/scene/gui/viewport_container.h
index 96b352b1cc..27eb6ec81b 100644
--- a/scene/gui/viewport_container.h
+++ b/scene/gui/viewport_container.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/io/resource_format_image.cpp b/scene/io/resource_format_image.cpp
index 6a550a847d..04b6177c3c 100644
--- a/scene/io/resource_format_image.cpp
+++ b/scene/io/resource_format_image.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,9 +30,9 @@
#include "resource_format_image.h"
#if 0
-#include "global_config.h"
#include "io/image_loader.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/resources/texture.h"
RES ResourceFormatLoaderImage::load(const String &p_path, const String& p_original_path, Error *r_error) {
@@ -127,7 +128,7 @@ RES ResourceFormatLoaderImage::load(const String &p_path, const String& p_origin
if (max_texture_size && (image.get_width() > max_texture_size || image.get_height() > max_texture_size)) {
- if (bool(GlobalConfig::get_singleton()->get("debug/image_loader/max_texture_size_alert"))) {
+ if (bool(ProjectSettings::get_singleton()->get("debug/image_loader/max_texture_size_alert"))) {
OS::get_singleton()->alert("Texture is too large: '"+p_path+"', at "+itos(image.get_width())+"x"+itos(image.get_height())+". Max allowed size is: "+itos(max_texture_size)+"x"+itos(max_texture_size)+".","BAD ARTIST, NO COOKIE!");
}
diff --git a/scene/io/resource_format_image.h b/scene/io/resource_format_image.h
index 0638e97787..2cf6315f17 100644
--- a/scene/io/resource_format_image.h
+++ b/scene/io/resource_format_image.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/io/resource_format_wav.cpp b/scene/io/resource_format_wav.cpp
index 0d64743d1e..dabbb79de3 100644
--- a/scene/io/resource_format_wav.cpp
+++ b/scene/io/resource_format_wav.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -97,7 +98,7 @@ RES ResourceFormatLoaderWAV::load(const String &p_path, const String& p_original
/* chunk size */
uint32_t chunksize=file->get_32();
- uint32_t file_pos=file->get_pos(); //save file pos, so we can skip to next chunk safely
+ uint32_t file_pos=file->get_position(); //save file pos, so we can skip to next chunk safely
if (file->eof_reached()) {
diff --git a/scene/io/resource_format_wav.h b/scene/io/resource_format_wav.h
index fd274625f9..9105689670 100644
--- a/scene/io/resource_format_wav.h
+++ b/scene/io/resource_format_wav.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp
index 1fecb6fd9a..77407fdde7 100644
--- a/scene/main/canvas_layer.cpp
+++ b/scene/main/canvas_layer.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -203,7 +204,7 @@ void CanvasLayer::set_custom_viewport(Node *p_viewport) {
custom_viewport = p_viewport->cast_to<Viewport>();
if (custom_viewport) {
- custom_viewport_id = custom_viewport->get_instance_ID();
+ custom_viewport_id = custom_viewport->get_instance_id();
} else {
custom_viewport_id = 0;
}
@@ -261,10 +262,10 @@ void CanvasLayer::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_scale", "scale"), &CanvasLayer::set_scale);
ClassDB::bind_method(D_METHOD("get_scale"), &CanvasLayer::get_scale);
- 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(D_METHOD("set_custom_viewport", "viewport"), &CanvasLayer::set_custom_viewport);
+ ClassDB::bind_method(D_METHOD("get_custom_viewport"), &CanvasLayer::get_custom_viewport);
- ClassDB::bind_method(D_METHOD("get_world_2d:World2D"), &CanvasLayer::get_world_2d);
+ ClassDB::bind_method(D_METHOD("get_world_2d"), &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"), "set_layer", "get_layer");
diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h
index 26d21e3a0f..b14a915fe8 100644
--- a/scene/main/canvas_layer.h
+++ b/scene/main/canvas_layer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -54,7 +55,7 @@ class CanvasLayer : public Node {
int sort_index;
// Deprecated, should be removed in a future version.
- void _set_rotationd(real_t p_rotation);
+ void _set_rotationd(real_t p_degrees);
real_t _get_rotationd() const;
void _update_xform();
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp
index 38ee03ab47..a9b2dba186 100644
--- a/scene/main/http_request.cpp
+++ b/scene/main/http_request.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,6 +29,8 @@
/*************************************************************************/
#include "http_request.h"
+#include "version.h"
+
void HTTPRequest::_redirect_request(const String &p_new_url) {
}
diff --git a/scene/main/http_request.h b/scene/main/http_request.h
index 2b2d7f9a38..6099d4e9bf 100644
--- a/scene/main/http_request.h
+++ b/scene/main/http_request.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp
index 469a5e9441..5580ef486e 100644
--- a/scene/main/instance_placeholder.cpp
+++ b/scene/main/instance_placeholder.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -122,7 +123,7 @@ Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) {
void InstancePlaceholder::_bind_methods() {
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("replace_by_instance", "custom_scene"), &InstancePlaceholder::replace_by_instance, DEFVAL(Variant()));
ClassDB::bind_method(D_METHOD("get_instance_path"), &InstancePlaceholder::get_instance_path);
}
diff --git a/scene/main/instance_placeholder.h b/scene/main/instance_placeholder.h
index 7900e35b00..ec4520e1c8 100644
--- a/scene/main/instance_placeholder.h
+++ b/scene/main/instance_placeholder.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index c13ed232a7..0474c6fd26 100755
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,7 +37,6 @@
#include "viewport.h"
VARIANT_ENUM_CAST(Node::PauseMode);
-VARIANT_ENUM_CAST(Node::NetworkMode);
VARIANT_ENUM_CAST(Node::RPCMode);
void Node::_notification(int p_notification) {
@@ -76,22 +76,12 @@ void Node::_notification(int p_notification) {
data.pause_owner = this;
}
- if (data.network_mode == NETWORK_MODE_INHERIT) {
-
- if (data.parent)
- data.network_owner = data.parent->data.network_owner;
- else
- data.network_owner = NULL;
- } else {
- data.network_owner = this;
- }
-
if (data.input)
- add_to_group("_vp_input" + itos(get_viewport()->get_instance_ID()));
+ add_to_group("_vp_input" + itos(get_viewport()->get_instance_id()));
if (data.unhandled_input)
- add_to_group("_vp_unhandled_input" + itos(get_viewport()->get_instance_ID()));
+ add_to_group("_vp_unhandled_input" + itos(get_viewport()->get_instance_id()));
if (data.unhandled_key_input)
- add_to_group("_vp_unhandled_key_input" + itos(get_viewport()->get_instance_ID()));
+ add_to_group("_vp_unhandled_key_input" + itos(get_viewport()->get_instance_id()));
get_tree()->node_count++;
@@ -100,14 +90,13 @@ void Node::_notification(int p_notification) {
get_tree()->node_count--;
if (data.input)
- remove_from_group("_vp_input" + itos(get_viewport()->get_instance_ID()));
+ remove_from_group("_vp_input" + itos(get_viewport()->get_instance_id()));
if (data.unhandled_input)
- remove_from_group("_vp_unhandled_input" + itos(get_viewport()->get_instance_ID()));
+ remove_from_group("_vp_unhandled_input" + itos(get_viewport()->get_instance_id()));
if (data.unhandled_key_input)
- remove_from_group("_vp_unhandled_key_input" + itos(get_viewport()->get_instance_ID()));
+ remove_from_group("_vp_unhandled_key_input" + itos(get_viewport()->get_instance_id()));
data.pause_owner = NULL;
- data.network_owner = NULL;
if (data.path_cache) {
memdelete(data.path_cache);
data.path_cache = NULL;
@@ -322,6 +311,11 @@ void Node::move_child(Node *p_child, int p_pos) {
ERR_FAIL_COND(data.blocked > 0);
}
+ // Specifying one place beyond the end
+ // means the same as moving to the last position
+ if (p_pos == data.children.size())
+ p_pos--;
+
if (p_child->data.pos == p_pos)
return; //do nothing
@@ -462,7 +456,7 @@ Node::PauseMode Node::get_pause_mode() const {
void Node::_propagate_pause_owner(Node *p_owner) {
- if (data.pause_mode != PAUSE_MODE_INHERIT)
+ if (this != p_owner && data.pause_mode != PAUSE_MODE_INHERIT)
return;
data.pause_owner = p_owner;
for (int i = 0; i < data.children.size(); i++) {
@@ -471,69 +465,28 @@ void Node::_propagate_pause_owner(Node *p_owner) {
}
}
-void Node::set_network_mode(NetworkMode p_mode) {
+void Node::set_network_master(int p_peer_id, bool p_recursive) {
- if (data.network_mode == p_mode)
- return;
+ data.network_master = p_peer_id;
- bool prev_inherits = data.network_mode == NETWORK_MODE_INHERIT;
- data.network_mode = p_mode;
- if (!is_inside_tree())
- return; //pointless
- if ((data.network_mode == NETWORK_MODE_INHERIT) == prev_inherits)
- return; ///nothing changed
-
- Node *owner = NULL;
-
- if (data.network_mode == NETWORK_MODE_INHERIT) {
+ if (p_recursive) {
+ for (int i = 0; i < data.children.size(); i++) {
- if (data.parent)
- owner = data.parent->data.network_owner;
- } else {
- owner = this;
+ data.children[i]->set_network_master(p_peer_id, true);
+ }
}
-
- _propagate_network_owner(owner);
}
-Node::NetworkMode Node::get_network_mode() const {
+int Node::get_network_master() const {
- return data.network_mode;
+ return data.network_master;
}
bool Node::is_network_master() const {
ERR_FAIL_COND_V(!is_inside_tree(), false);
- switch (data.network_mode) {
- case NETWORK_MODE_INHERIT: {
-
- if (data.network_owner)
- return data.network_owner->is_network_master();
- else
- return get_tree()->is_network_server();
- } break;
- case NETWORK_MODE_MASTER: {
-
- return true;
- } break;
- case NETWORK_MODE_SLAVE: {
- return false;
- } break;
- }
-
- return false;
-}
-
-void Node::_propagate_network_owner(Node *p_owner) {
-
- if (data.network_mode != NETWORK_MODE_INHERIT)
- return;
- data.network_owner = p_owner;
- for (int i = 0; i < data.children.size(); i++) {
-
- data.children[i]->_propagate_network_owner(p_owner);
- }
+ return get_tree()->get_network_unique_id() == data.network_master;
}
/***** RPC CONFIG ********/
@@ -752,12 +705,12 @@ void Node::rpcp(int p_peer_id, bool p_unreliable, const StringName &p_method, co
ERR_FAIL_COND(!is_inside_tree());
bool skip_rpc = false;
+ bool call_local_native = false;
+ bool call_local_script = false;
if (p_peer_id == 0 || p_peer_id == get_tree()->get_network_unique_id() || (p_peer_id < 0 && p_peer_id != -get_tree()->get_network_unique_id())) {
//check that send mode can use local call
- bool call_local = false;
-
Map<StringName, RPCMode>::Element *E = data.rpc_methods.find(p_method);
if (E) {
@@ -771,29 +724,22 @@ void Node::rpcp(int p_peer_id, bool p_unreliable, const StringName &p_method, co
} break;
case RPC_MODE_SYNC: {
//call it, sync always results in call
- call_local = true;
+ call_local_native = true;
} break;
case RPC_MODE_MASTER: {
- call_local = is_network_master();
- if (call_local) {
+ call_local_native = is_network_master();
+ if (call_local_native) {
skip_rpc = true; //no other master so..
}
} break;
case RPC_MODE_SLAVE: {
- call_local = !is_network_master();
+ call_local_native = !is_network_master();
} break;
}
}
- if (call_local) {
- Variant::CallError ce;
- call(p_method, p_arg, p_argcount, ce);
- if (ce.error != Variant::CallError::CALL_OK) {
- String error = Variant::get_call_error_text(this, p_method, p_arg, p_argcount, ce);
- error = "rpc() aborted in local call: - " + error;
- ERR_PRINTS(error);
- return;
- }
+ if (call_local_native) {
+ // done below
} else if (get_script_instance()) {
//attempt with script
ScriptInstance::RPCMode rpc_mode = get_script_instance()->get_rpc_mode(p_method);
@@ -808,37 +754,47 @@ void Node::rpcp(int p_peer_id, bool p_unreliable, const StringName &p_method, co
} break;
case ScriptInstance::RPC_MODE_SYNC: {
//call it, sync always results in call
- call_local = true;
+ call_local_script = true;
} break;
case ScriptInstance::RPC_MODE_MASTER: {
- call_local = is_network_master();
- if (call_local) {
+ call_local_script = is_network_master();
+ if (call_local_script) {
skip_rpc = true; //no other master so..
}
} break;
case ScriptInstance::RPC_MODE_SLAVE: {
- call_local = !is_network_master();
+ call_local_script = !is_network_master();
} break;
}
-
- if (call_local) {
- Variant::CallError ce;
- ce.error = Variant::CallError::CALL_OK;
- get_script_instance()->call(p_method, p_arg, p_argcount, ce);
- if (ce.error != Variant::CallError::CALL_OK) {
- String error = Variant::get_call_error_text(this, p_method, p_arg, p_argcount, ce);
- error = "rpc() aborted in script local call: - " + error;
- ERR_PRINTS(error);
- return;
- }
- }
}
}
- if (skip_rpc)
- return;
+ if (!skip_rpc) {
+ get_tree()->_rpc(this, p_peer_id, p_unreliable, false, p_method, p_arg, p_argcount);
+ }
+
+ if (call_local_native) {
+ Variant::CallError ce;
+ call(p_method, p_arg, p_argcount, ce);
+ if (ce.error != Variant::CallError::CALL_OK) {
+ String error = Variant::get_call_error_text(this, p_method, p_arg, p_argcount, ce);
+ error = "rpc() aborted in local call: - " + error;
+ ERR_PRINTS(error);
+ return;
+ }
+ }
- get_tree()->_rpc(this, p_peer_id, p_unreliable, false, p_method, p_arg, p_argcount);
+ if (call_local_script) {
+ Variant::CallError ce;
+ ce.error = Variant::CallError::CALL_OK;
+ get_script_instance()->call(p_method, p_arg, p_argcount, ce);
+ if (ce.error != Variant::CallError::CALL_OK) {
+ String error = Variant::get_call_error_text(this, p_method, p_arg, p_argcount, ce);
+ error = "rpc() aborted in script local call: - " + error;
+ ERR_PRINTS(error);
+ return;
+ }
+ }
}
/******** RSET *********/
@@ -961,7 +917,7 @@ void Node::rset_unreliable_id(int p_peer_id, const StringName &p_property, const
//////////// end of rpc
-bool Node::can_call_rpc(const StringName &p_method) const {
+bool Node::can_call_rpc(const StringName &p_method, int p_from) const {
const Map<StringName, RPCMode>::Element *E = data.rpc_methods.find(p_method);
if (E) {
@@ -981,7 +937,7 @@ bool Node::can_call_rpc(const StringName &p_method) const {
return is_network_master();
} break;
case RPC_MODE_SLAVE: {
- return !is_network_master();
+ return !is_network_master() && p_from == get_network_master();
} break;
}
}
@@ -1005,16 +961,16 @@ bool Node::can_call_rpc(const StringName &p_method) const {
return is_network_master();
} break;
case ScriptInstance::RPC_MODE_SLAVE: {
- return !is_network_master();
+ return !is_network_master() && p_from == get_network_master();
} break;
}
}
- ERR_PRINTS("RPC on unauthorized method attempted: " + String(p_method) + " on base: " + String(Variant(this)));
+ ERR_PRINTS("RPC from " + itos(p_from) + " on unauthorized method attempted: " + String(p_method) + " on base: " + String(Variant(this)));
return false;
}
-bool Node::can_call_rset(const StringName &p_property) const {
+bool Node::can_call_rset(const StringName &p_property, int p_from) const {
const Map<StringName, RPCMode>::Element *E = data.rpc_properties.find(p_property);
if (E) {
@@ -1034,7 +990,7 @@ bool Node::can_call_rset(const StringName &p_property) const {
return is_network_master();
} break;
case RPC_MODE_SLAVE: {
- return !is_network_master();
+ return !is_network_master() && p_from == get_network_master();
} break;
}
}
@@ -1058,12 +1014,12 @@ bool Node::can_call_rset(const StringName &p_property) const {
return is_network_master();
} break;
case ScriptInstance::RPC_MODE_SLAVE: {
- return !is_network_master();
+ return !is_network_master() && p_from == get_network_master();
} break;
}
}
- ERR_PRINTS("RSET on unauthorized property attempted: " + String(p_property) + " on base: " + String(Variant(this)));
+ ERR_PRINTS("RSET from " + itos(p_from) + " on unauthorized property attempted: " + String(p_property) + " on base: " + String(Variant(this)));
return false;
}
@@ -1162,9 +1118,9 @@ void Node::set_process_input(bool p_enable) {
return;
if (p_enable)
- add_to_group("_vp_input" + itos(get_viewport()->get_instance_ID()));
+ add_to_group("_vp_input" + itos(get_viewport()->get_instance_id()));
else
- remove_from_group("_vp_input" + itos(get_viewport()->get_instance_ID()));
+ remove_from_group("_vp_input" + itos(get_viewport()->get_instance_id()));
}
bool Node::is_processing_input() const {
@@ -1180,9 +1136,9 @@ void Node::set_process_unhandled_input(bool p_enable) {
return;
if (p_enable)
- add_to_group("_vp_unhandled_input" + itos(get_viewport()->get_instance_ID()));
+ add_to_group("_vp_unhandled_input" + itos(get_viewport()->get_instance_id()));
else
- remove_from_group("_vp_unhandled_input" + itos(get_viewport()->get_instance_ID()));
+ remove_from_group("_vp_unhandled_input" + itos(get_viewport()->get_instance_id()));
}
bool Node::is_processing_unhandled_input() const {
@@ -1198,9 +1154,9 @@ void Node::set_process_unhandled_key_input(bool p_enable) {
return;
if (p_enable)
- add_to_group("_vp_unhandled_key_input" + itos(get_viewport()->get_instance_ID()));
+ add_to_group("_vp_unhandled_key_input" + itos(get_viewport()->get_instance_id()));
else
- remove_from_group("_vp_unhandled_key_input" + itos(get_viewport()->get_instance_ID()));
+ remove_from_group("_vp_unhandled_key_input" + itos(get_viewport()->get_instance_id()));
}
bool Node::is_processing_unhandled_key_input() const {
@@ -1310,7 +1266,7 @@ String Node::_generate_serial_child_name(Node *p_child) {
name = p_child->get_class();
// Adjust casing according to project setting. The current type name is expected to be in PascalCase.
- switch (GlobalConfig::get_singleton()->get("node/name_casing").operator int()) {
+ switch (ProjectSettings::get_singleton()->get("node/name_casing").operator int()) {
case NAME_CASING_PASCAL_CASE:
break;
case NAME_CASING_CAMEL_CASE:
@@ -1345,8 +1301,9 @@ String Node::_generate_serial_child_name(Node *p_child) {
}
}
+ int num_places = nums.length();
for (;;) {
- String attempt = (name + (num > 0 || explicit_zero ? nnsep + itos(num) : "")).strip_edges();
+ String attempt = (name + (num > 0 || explicit_zero ? nnsep + itos(num).pad_zeros(num_places) : "")).strip_edges();
bool found = false;
for (int i = 0; i < data.children.size(); i++) {
if (data.children[i] == p_child)
@@ -2063,10 +2020,14 @@ void Node::set_editable_instance(Node *p_node, bool p_editable) {
ERR_FAIL_NULL(p_node);
ERR_FAIL_COND(!is_a_parent_of(p_node));
NodePath p = get_path_to(p_node);
- if (!p_editable)
+ if (!p_editable) {
data.editable_instances.erase(p);
- else
+ // Avoid this flag being needlessly saved;
+ // also give more visual feedback if editable children is reenabled
+ set_display_folded(false);
+ } else {
data.editable_instances[p] = true;
+ }
}
bool Node::is_editable_instance(Node *p_node) const {
@@ -2649,7 +2610,7 @@ static void _Node_debug_sn(Object *p_obj) {
path = n->get_name();
else
path = String(p->get_name()) + "/" + p->get_path_to(n);
- print_line(itos(p_obj->get_instance_ID()) + "- Stray Node: " + path + " (Type: " + n->get_class() + ")");
+ print_line(itos(p_obj->get_instance_id()) + "- Stray Node: " + path + " (Type: " + n->get_class() + ")");
}
void Node::_print_stray_nodes() {
@@ -2760,40 +2721,40 @@ void Node::request_ready() {
void Node::_bind_methods() {
GLOBAL_DEF("node/name_num_separator", 0);
- GlobalConfig::get_singleton()->set_custom_property_info("node/name_num_separator", PropertyInfo(Variant::INT, "node/name_num_separator", PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash"));
+ ProjectSettings::get_singleton()->set_custom_property_info("node/name_num_separator", PropertyInfo(Variant::INT, "node/name_num_separator", PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash"));
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"));
+ ProjectSettings::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(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("_add_child_below_node", "node", "child_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("add_child", "node", "legible_unique_name"), &Node::add_child, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("remove_child", "node"), &Node::remove_child);
+ //ClassDB::bind_method(D_METHOD("remove_and_delete_child","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("get_child", "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("get_node", "path"), &Node::get_node);
+ ClassDB::bind_method(D_METHOD("get_parent"), &Node::get_parent);
+ ClassDB::bind_method(D_METHOD("find_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("is_a_parent_of", "node"), &Node::is_a_parent_of);
+ ClassDB::bind_method(D_METHOD("is_greater_than", "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("get_path_to", "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("move_child", "child_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("set_owner", "owner"), &Node::set_owner);
+ ClassDB::bind_method(D_METHOD("get_owner"), &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);
@@ -2826,10 +2787,10 @@ void Node::_bind_methods() {
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("get_tree"), &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("duplicate", "flags"), &Node::duplicate, DEFVAL(DUPLICATE_USE_INSTANCING | DUPLICATE_SIGNALS | DUPLICATE_GROUPS | DUPLICATE_SCRIPTS));
+ ClassDB::bind_method(D_METHOD("replace_by", "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);
@@ -2840,8 +2801,8 @@ void Node::_bind_methods() {
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("set_network_master", "id", "recursive"), &Node::set_network_master, DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("get_network_master"), &Node::get_network_master);
ClassDB::bind_method(D_METHOD("is_network_master"), &Node::is_network_master);
@@ -2873,10 +2834,10 @@ void Node::_bind_methods() {
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "rpc_unreliable_id", &Node::_rpc_unreliable_id_bind, mi);
}
- 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);
+ ClassDB::bind_method(D_METHOD("rset", "property", "value"), &Node::rset);
+ ClassDB::bind_method(D_METHOD("rset_id", "peer_id", "property", "value"), &Node::rset_id);
+ ClassDB::bind_method(D_METHOD("rset_unreliable", "property", "value"), &Node::rset_unreliable);
+ ClassDB::bind_method(D_METHOD("rset_unreliable_id", "peer_id", "property", "value"), &Node::rset_unreliable_id);
BIND_CONSTANT(NOTIFICATION_ENTER_TREE);
BIND_CONSTANT(NOTIFICATION_EXIT_TREE);
@@ -2897,10 +2858,6 @@ void Node::_bind_methods() {
BIND_CONSTANT(NOTIFICATION_INTERNAL_PROCESS);
BIND_CONSTANT(NOTIFICATION_INTERNAL_FIXED_PROCESS);
- BIND_CONSTANT(NETWORK_MODE_INHERIT);
- BIND_CONSTANT(NETWORK_MODE_MASTER);
- BIND_CONSTANT(NETWORK_MODE_SLAVE);
-
BIND_CONSTANT(RPC_MODE_DISABLED);
BIND_CONSTANT(RPC_MODE_REMOTE);
BIND_CONSTANT(RPC_MODE_SYNC);
@@ -2914,6 +2871,7 @@ void Node::_bind_methods() {
BIND_CONSTANT(DUPLICATE_SIGNALS);
BIND_CONSTANT(DUPLICATE_GROUPS);
BIND_CONSTANT(DUPLICATE_SCRIPTS);
+ BIND_CONSTANT(DUPLICATE_USE_INSTANCING);
ADD_SIGNAL(MethodInfo("renamed"));
ADD_SIGNAL(MethodInfo("tree_entered"));
@@ -2932,16 +2890,16 @@ void Node::_bind_methods() {
BIND_VMETHOD(MethodInfo("_enter_tree"));
BIND_VMETHOD(MethodInfo("_exit_tree"));
BIND_VMETHOD(MethodInfo("_ready"));
- BIND_VMETHOD(MethodInfo("_input", PropertyInfo(Variant::INPUT_EVENT, "event")));
- BIND_VMETHOD(MethodInfo("_unhandled_input", PropertyInfo(Variant::INPUT_EVENT, "event")));
- BIND_VMETHOD(MethodInfo("_unhandled_key_input", PropertyInfo(Variant::INPUT_EVENT, "key_event")));
+ BIND_VMETHOD(MethodInfo("_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
+ BIND_VMETHOD(MethodInfo("_unhandled_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
+ BIND_VMETHOD(MethodInfo("_unhandled_key_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEventKey")));
//ClassDB::bind_method(D_METHOD("get_child",&Node::get_child,PH("index")));
//ClassDB::bind_method(D_METHOD("get_node",&Node::get_node,PH("path")));
}
String Node::_get_name_num_separator() {
- switch (GlobalConfig::get_singleton()->get("node/name_num_separator").operator int()) {
+ switch (ProjectSettings::get_singleton()->get("node/name_num_separator").operator int()) {
case 0: return "";
case 1: return " ";
case 2: return "_";
@@ -2971,8 +2929,7 @@ Node::Node() {
data.unhandled_key_input = false;
data.pause_mode = PAUSE_MODE_INHERIT;
data.pause_owner = NULL;
- data.network_mode = NETWORK_MODE_INHERIT;
- data.network_owner = NULL;
+ data.network_master = 1; //server by default
data.path_cache = NULL;
data.parent_owned = false;
data.in_constructor = true;
diff --git a/scene/main/node.h b/scene/main/node.h
index 714a58bd82..bb8d80a0c8 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,11 +31,11 @@
#define NODE_H
#include "class_db.h"
-#include "global_config.h"
#include "map.h"
+#include "node_path.h"
#include "object.h"
-#include "path_db.h"
-#include "scene/main/scene_main_loop.h"
+#include "project_settings.h"
+#include "scene/main/scene_tree.h"
#include "script_language.h"
class Viewport;
@@ -60,13 +61,6 @@ public:
DUPLICATE_USE_INSTANCING = 8
};
- enum NetworkMode {
-
- NETWORK_MODE_INHERIT,
- NETWORK_MODE_MASTER,
- NETWORK_MODE_SLAVE
- };
-
enum RPCMode {
RPC_MODE_DISABLED, //no rpc for this method, calls to this will be blocked (default)
@@ -121,8 +115,7 @@ private:
PauseMode pause_mode;
Node *pause_owner;
- NetworkMode network_mode;
- Node *network_owner;
+ int network_master;
Map<StringName, RPCMode> rpc_methods;
Map<StringName, RPCMode> rpc_properties;
@@ -172,7 +165,6 @@ private:
void _propagate_validate_owner();
void _print_stray_nodes();
void _propagate_pause_owner(Node *p_owner);
- void _propagate_network_owner(Node *p_owner);
Array _get_node_and_resource(const NodePath &p_path);
void _duplicate_signals(const Node *p_original, Node *p_copy) const;
@@ -311,14 +303,14 @@ public:
float get_fixed_process_delta_time() const;
bool is_fixed_processing() const;
- void set_process(bool p_process);
+ void set_process(bool p_idle_process);
float get_process_delta_time() const;
bool is_processing() const;
- void set_fixed_process_internal(bool p_process);
+ void set_fixed_process_internal(bool p_process_internal);
bool is_fixed_processing_internal() const;
- void set_process_internal(bool p_process);
+ void set_process_internal(bool p_idle_process_internal);
bool is_processing_internal() const;
void set_process_input(bool p_enable);
@@ -392,8 +384,8 @@ public:
bool is_displayed_folded() const;
/* NETWORK */
- void set_network_mode(NetworkMode p_mode);
- NetworkMode get_network_mode() const;
+ void set_network_master(int p_peer_id, bool p_recursive = true);
+ int get_network_master() const;
bool is_network_master() const;
void rpc_config(const StringName &p_method, RPCMode p_mode); // config a local method for RPC
@@ -413,8 +405,8 @@ public:
void rsetp(int p_peer_id, bool p_unreliable, const StringName &p_property, const Variant &p_value);
- bool can_call_rpc(const StringName &p_method) const;
- bool can_call_rset(const StringName &p_property) const;
+ bool can_call_rpc(const StringName &p_method, int p_from) const;
+ bool can_call_rset(const StringName &p_property, int p_from) const;
Node();
~Node();
diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp
index c08a6bcd5b..ae323ba021 100644
--- a/scene/main/resource_preloader.cpp
+++ b/scene/main/resource_preloader.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/main/resource_preloader.h b/scene/main/resource_preloader.h
index 5fba70c1c0..a54781dc81 100644
--- a/scene/main/resource_preloader.h
+++ b/scene/main/resource_preloader.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_tree.cpp
index 79ee4a6f75..66eafa1070 100644
--- a/scene/main/scene_main_loop.cpp
+++ b/scene/main/scene_tree.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,16 +27,17 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "scene_main_loop.h"
+#include "scene_tree.h"
-#include "global_config.h"
#include "message_queue.h"
#include "node.h"
#include "os/keyboard.h"
#include "os/os.h"
#include "print_string.h"
+#include "project_settings.h"
#include <stdio.h>
//#include "servers/spatial_sound_2d_server.h"
+
#include "io/marshalls.h"
#include "io/resource_loader.h"
#include "scene/resources/material.h"
@@ -374,9 +376,13 @@ void SceneTree::input_text(const String &p_text) {
root_lock--;
}
-void SceneTree::input_event(const InputEvent &p_event) {
+bool SceneTree::is_input_handled() {
+ return input_handled;
+}
+
+void SceneTree::input_event(const Ref<InputEvent> &p_event) {
- if (is_editor_hint() && (p_event.type == InputEvent::JOYPAD_MOTION || p_event.type == InputEvent::JOYPAD_BUTTON))
+ if (is_editor_hint() && (p_event->cast_to<InputEventJoypadButton>() || p_event->cast_to<InputEventJoypadMotion>()))
return; //avoid joy input on editor
root_lock++;
@@ -384,8 +390,8 @@ void SceneTree::input_event(const InputEvent &p_event) {
input_handled = false;
- InputEvent ev = p_event;
- ev.ID = ++last_id; //this should work better
+ Ref<InputEvent> ev = p_event;
+ ev->set_id(++last_id); //this should work better
#if 0
switch(ev.type) {
@@ -393,9 +399,9 @@ void SceneTree::input_event(const InputEvent &p_event) {
Matrix32 ai = root->get_final_transform().affine_inverse();
Vector2 g = ai.xform(Vector2(ev.mouse_button.global_x,ev.mouse_button.global_y));
- Vector2 l = ai.xform(Vector2(ev.mouse_button.x,ev.mouse_button.y));
- ev.mouse_button.x=l.x;
- ev.mouse_button.y=l.y;
+ Vector2 l = ai.xform(Vector2(ev->get_pos().x,ev->get_pos().y));
+ ev->get_pos().x=l.x;
+ ev->get_pos().y=l.y;
ev.mouse_button.global_x=g.x;
ev.mouse_button.global_y=g.y;
@@ -405,13 +411,13 @@ void SceneTree::input_event(const InputEvent &p_event) {
Matrix32 ai = root->get_final_transform().affine_inverse();
Vector2 g = ai.xform(Vector2(ev.mouse_motion.global_x,ev.mouse_motion.global_y));
Vector2 l = ai.xform(Vector2(ev.mouse_motion.x,ev.mouse_motion.y));
- Vector2 r = ai.xform(Vector2(ev.mouse_motion.relative_x,ev.mouse_motion.relative_y));
+ Vector2 r = ai.xform(Vector2(ev->get_relative().x,ev->get_relative().y));
ev.mouse_motion.x=l.x;
ev.mouse_motion.y=l.y;
ev.mouse_motion.global_x=g.x;
ev.mouse_motion.global_y=g.y;
- ev.mouse_motion.relative_x=r.x;
- ev.mouse_motion.relative_y=r.y;
+ ev->get_relative().x=r.x;
+ ev->get_relative().y=r.y;
} break;
case InputEvent::SCREEN_TOUCH: {
@@ -448,12 +454,12 @@ void SceneTree::input_event(const InputEvent &p_event) {
//call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"input","_input",ev);
/*
- if (ev.type==InputEvent::KEY && ev.key.pressed && !ev.key.echo && ev.key.scancode==KEY_F12) {
+ if (ev.type==InputEvent::KEY && ev->is_pressed() && !ev->is_echo() && ev->get_scancode()==KEY_F12) {
print_line("RAM: "+itos(Memory::get_static_mem_usage()));
print_line("DRAM: "+itos(Memory::get_dynamic_mem_usage()));
}
- if (ev.type==InputEvent::KEY && ev.key.pressed && !ev.key.echo && ev.key.scancode==KEY_F11) {
+ if (ev.type==InputEvent::KEY && ev->is_pressed() && !ev->is_echo() && ev->get_scancode()==KEY_F11) {
Memory::dump_static_mem_to_file("memdump.txt");
}
@@ -465,9 +471,13 @@ void SceneTree::input_event(const InputEvent &p_event) {
call_group_flags(GROUP_CALL_REALTIME, "_viewports", "_vp_input", ev); //special one for GUI, as controls use their own process check
#endif
- if (ScriptDebugger::get_singleton() && ScriptDebugger::get_singleton()->is_remote() && ev.type == InputEvent::KEY && ev.key.pressed && !ev.key.echo && ev.key.scancode == KEY_F8) {
- ScriptDebugger::get_singleton()->request_quit();
+ if (ScriptDebugger::get_singleton() && ScriptDebugger::get_singleton()->is_remote()) {
+ //quit from game window using F8
+ Ref<InputEventKey> k = ev;
+ if (k.is_valid() && k->is_pressed() && !k->is_echo() && k->get_scancode() == KEY_F8) {
+ ScriptDebugger::get_singleton()->request_quit();
+ }
}
_flush_ugc();
@@ -505,8 +515,6 @@ void SceneTree::input_event(const InputEvent &p_event) {
void SceneTree::init() {
//_quit=false;
- accept_quit = true;
- quit_on_go_back = true;
initialized = true;
input_handled = false;
@@ -532,6 +540,7 @@ bool SceneTree::iteration(float p_time) {
_notify_group_pause("fixed_process_internal", Node::NOTIFICATION_INTERNAL_FIXED_PROCESS);
_notify_group_pause("fixed_process", Node::NOTIFICATION_FIXED_PROCESS);
_flush_ugc();
+ MessageQueue::get_singleton()->flush(); //small little hack
_flush_transform_notifications();
call_group_flags(GROUP_CALL_REALTIME, "_viewports", "update_worlds");
root_lock--;
@@ -558,6 +567,8 @@ bool SceneTree::idle(float p_time) {
emit_signal("idle_frame");
+ MessageQueue::get_singleton()->flush(); //small little hack
+
_flush_transform_notifications();
_notify_group_pause("idle_process_internal", Node::NOTIFICATION_INTERNAL_PROCESS);
@@ -573,6 +584,7 @@ bool SceneTree::idle(float p_time) {
}
_flush_ugc();
+ MessageQueue::get_singleton()->flush(); //small little hack
_flush_transform_notifications(); //transforms after world update, to avoid unnecessary enter/exit notifications
call_group_flags(GROUP_CALL_REALTIME, "_viewports", "update_worlds");
@@ -602,6 +614,30 @@ bool SceneTree::idle(float p_time) {
_call_idle_callbacks();
+#ifdef TOOLS_ENABLED
+
+ if (is_editor_hint()) {
+ //simple hack to reload fallback environment if it changed from editor
+ String env_path = ProjectSettings::get_singleton()->get("rendering/environment/default_environment");
+ env_path = env_path.strip_edges(); //user may have added a space or two
+ String cpath;
+ Ref<Environment> fallback = get_root()->get_world()->get_fallback_environment();
+ if (fallback.is_valid()) {
+ cpath = fallback->get_path();
+ }
+ if (cpath != env_path) {
+
+ if (env_path != String()) {
+ fallback = ResourceLoader::load(env_path);
+ } else {
+ fallback.unref();
+ }
+ get_root()->get_world()->set_fallback_environment(fallback);
+ }
+ }
+
+#endif
+
return _quit;
}
@@ -655,7 +691,9 @@ void SceneTree::_notification(int p_notification) {
get_root()->propagate_notification(p_notification);
} break;
case NOTIFICATION_TRANSLATION_CHANGED: {
- get_root()->propagate_notification(Node::NOTIFICATION_TRANSLATION_CHANGED);
+ if (!is_editor_hint()) {
+ get_root()->propagate_notification(Node::NOTIFICATION_TRANSLATION_CHANGED);
+ }
} break;
case NOTIFICATION_WM_UNFOCUS_REQUEST: {
@@ -678,24 +716,24 @@ void SceneTree::set_quit_on_go_back(bool p_enable) {
quit_on_go_back = p_enable;
}
+#ifdef TOOLS_ENABLED
void SceneTree::set_editor_hint(bool p_enabled) {
editor_hint = p_enabled;
}
bool SceneTree::is_node_being_edited(const Node *p_node) const {
-#ifdef TOOLS_ENABLED
+
return editor_hint && edited_scene_root && edited_scene_root->is_a_parent_of(p_node);
-#else
- return false;
-#endif
}
bool SceneTree::is_editor_hint() const {
return editor_hint;
}
+#endif
+#ifdef DEBUG_ENABLED
void SceneTree::set_debug_collisions_hint(bool p_enabled) {
debug_collisions_hint = p_enabled;
@@ -715,6 +753,7 @@ bool SceneTree::is_debugging_navigation_hint() const {
return debug_navigation_hint;
}
+#endif
void SceneTree::set_debug_collisions_color(const Color &p_color) {
@@ -761,12 +800,12 @@ Ref<Material> SceneTree::get_debug_navigation_material() {
if (navigation_material.is_valid())
return navigation_material;
- Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- /* line_material->set_flag(Material::FLAG_UNSHADED, true);
- line_material->set_line_width(3.0);
- line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true);
- line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, true);
- line_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,get_debug_navigation_color());*/
+ Ref<SpatialMaterial> line_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ line_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ line_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ line_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ line_material->set_albedo(get_debug_navigation_color());
navigation_material = line_material;
@@ -778,12 +817,12 @@ Ref<Material> SceneTree::get_debug_navigation_disabled_material() {
if (navigation_disabled_material.is_valid())
return navigation_disabled_material;
- Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- /* line_material->set_flag(Material::FLAG_UNSHADED, true);
- line_material->set_line_width(3.0);
- line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true);
- line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, true);
- line_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,get_debug_navigation_disabled_color());*/
+ Ref<SpatialMaterial> line_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ line_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ line_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ line_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ line_material->set_albedo(get_debug_navigation_disabled_color());
navigation_disabled_material = line_material;
@@ -794,30 +833,31 @@ Ref<Material> SceneTree::get_debug_collision_material() {
if (collision_material.is_valid())
return collision_material;
- Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
- /*line_material->set_flag(Material::FLAG_UNSHADED, true);
- line_material->set_line_width(3.0);
- line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true);
- line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, true);
- line_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,get_debug_collisions_color());*/
+ Ref<SpatialMaterial> line_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ line_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ line_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ line_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ line_material->set_albedo(get_debug_collisions_color());
collision_material = line_material;
return collision_material;
}
-Ref<Mesh> SceneTree::get_debug_contact_mesh() {
+Ref<ArrayMesh> SceneTree::get_debug_contact_mesh() {
if (debug_contact_mesh.is_valid())
return debug_contact_mesh;
- debug_contact_mesh = Ref<Mesh>(memnew(Mesh));
+ debug_contact_mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
- Ref<FixedSpatialMaterial> mat = memnew(FixedSpatialMaterial);
- /*mat->set_flag(Material::FLAG_UNSHADED,true);
- mat->set_flag(Material::FLAG_DOUBLE_SIDED,true);
- mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
- mat->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,get_debug_collision_contact_color());*/
+ Ref<SpatialMaterial> mat = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
+ mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ mat->set_albedo(get_debug_collision_contact_color());
Vector3 diamond[6] = {
Vector3(-1, 0, 0),
@@ -874,7 +914,7 @@ bool SceneTree::is_paused() const {
return pause;
}
-void SceneTree::_call_input_pause(const StringName &p_group, const StringName &p_method, const InputEvent &p_input) {
+void SceneTree::_call_input_pause(const StringName &p_group, const StringName &p_method, const Ref<InputEvent> &p_input) {
Map<StringName, Group>::Element *E = group_map.find(p_group);
if (!E)
@@ -1071,7 +1111,7 @@ static void _fill_array(Node *p_node, Array &array, int p_level) {
array.push_back(p_level);
array.push_back(p_node->get_name());
array.push_back(p_node->get_class());
- array.push_back(p_node->get_instance_ID());
+ array.push_back(p_node->get_instance_id());
for (int i = 0; i < p_node->get_child_count(); i++) {
_fill_array(p_node->get_child(i), array, p_level + 1);
@@ -1106,7 +1146,7 @@ void SceneTree::queue_delete(Object *p_object) {
_THREAD_SAFE_METHOD_
ERR_FAIL_NULL(p_object);
p_object->_is_queued_for_deletion = true;
- delete_queue.push_back(p_object->get_instance_ID());
+ delete_queue.push_back(p_object->get_instance_id());
}
int SceneTree::get_node_count() const {
@@ -1118,7 +1158,7 @@ void SceneTree::_update_root_rect() {
if (stretch_mode == STRETCH_MODE_DISABLED) {
- root->set_size(last_screen_size);
+ root->set_size((last_screen_size / stretch_shrink).floor());
root->set_attach_to_screen_rect(Rect2(Point2(), last_screen_size));
root->set_size_override_stretch(false);
root->set_size_override(false, Size2());
@@ -1142,7 +1182,7 @@ void SceneTree::_update_root_rect() {
} else if (viewport_aspect < video_mode_aspect) {
// screen ratio is smaller vertically
- if (stretch_aspect == STRETCH_ASPECT_KEEP_HEIGHT) {
+ if (stretch_aspect == STRETCH_ASPECT_KEEP_HEIGHT || stretch_aspect == STRETCH_ASPECT_EXPAND) {
//will stretch horizontally
viewport_size.x = desired_res.y * video_mode_aspect;
@@ -1157,7 +1197,7 @@ void SceneTree::_update_root_rect() {
}
} else {
//screen ratio is smaller horizontally
- if (stretch_aspect == STRETCH_ASPECT_KEEP_WIDTH) {
+ if (stretch_aspect == STRETCH_ASPECT_KEEP_WIDTH || stretch_aspect == STRETCH_ASPECT_EXPAND) {
//will stretch horizontally
viewport_size.x = desired_res.x;
@@ -1178,12 +1218,11 @@ void SceneTree::_update_root_rect() {
Size2 margin;
Size2 offset;
//black bars and margin
- if (screen_size.x < video_mode.x) {
+ if (stretch_aspect != STRETCH_ASPECT_EXPAND && screen_size.x < video_mode.x) {
margin.x = Math::round((video_mode.x - screen_size.x) / 2.0);
VisualServer::get_singleton()->black_bars_set_margins(margin.x, 0, margin.x, 0);
offset.x = Math::round(margin.x * viewport_size.y / screen_size.y);
- } else if (screen_size.y < video_mode.y) {
-
+ } else if (stretch_aspect != STRETCH_ASPECT_EXPAND && screen_size.y < video_mode.y) {
margin.y = Math::round((video_mode.y - screen_size.y) / 2.0);
VisualServer::get_singleton()->black_bars_set_margins(0, margin.y, 0, margin.y);
offset.y = Math::round(margin.y * viewport_size.x / screen_size.x);
@@ -1196,15 +1235,15 @@ void SceneTree::_update_root_rect() {
switch (stretch_mode) {
case STRETCH_MODE_2D: {
- root->set_size(screen_size);
+ root->set_size((screen_size / stretch_shrink).floor());
root->set_attach_to_screen_rect(Rect2(margin, screen_size));
root->set_size_override_stretch(true);
- root->set_size_override(true, viewport_size);
+ root->set_size_override(true, (viewport_size / stretch_shrink).floor());
} break;
case STRETCH_MODE_VIEWPORT: {
- root->set_size(viewport_size);
+ root->set_size((viewport_size / stretch_shrink).floor());
root->set_attach_to_screen_rect(Rect2(margin, screen_size));
root->set_size_override_stretch(false);
root->set_size_override(false, Size2());
@@ -1213,11 +1252,12 @@ void SceneTree::_update_root_rect() {
}
}
-void SceneTree::set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize) {
+void SceneTree::set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize, int p_shrink) {
stretch_mode = p_mode;
stretch_aspect = p_aspect;
stretch_min = p_minsize;
+ stretch_shrink = p_shrink;
_update_root_rect();
}
@@ -1728,6 +1768,16 @@ int SceneTree::get_network_unique_id() const {
return network_peer->get_unique_id();
}
+Vector<int> SceneTree::get_network_connected_peers() const {
+ ERR_FAIL_COND_V(!network_peer.is_valid(), Vector<int>());
+
+ Vector<int> ret;
+ for (Set<int>::Element *E = connected_peers.front(); E; E = E->next()) {
+ ret.push_back(E->get());
+ }
+
+ return ret;
+}
void SceneTree::set_refuse_new_network_connections(bool p_refuse) {
ERR_FAIL_COND(!network_peer.is_valid());
network_peer->set_refuse_new_connections(p_refuse);
@@ -1938,6 +1988,7 @@ void SceneTree::_network_process_packet(int p_from, const uint8_t *p_packet, int
Node *node = NULL;
if (target & 0x80000000) {
+ //use full path (not cached yet)
int ofs = target & 0x7FFFFFFF;
ERR_FAIL_COND(ofs >= p_packet_len);
@@ -1953,7 +2004,7 @@ void SceneTree::_network_process_packet(int p_from, const uint8_t *p_packet, int
ERR_FAIL_COND(node == NULL);
}
} else {
-
+ //use cached path
int id = target;
Map<int, PathGetCache>::Element *E = path_get_cache.find(p_from);
@@ -1988,7 +2039,7 @@ void SceneTree::_network_process_packet(int p_from, const uint8_t *p_packet, int
if (packet_type == NETWORK_COMMAND_REMOTE_CALL) {
- if (!node->can_call_rpc(name))
+ if (!node->can_call_rpc(name, p_from))
return;
int ofs = len_end + 1;
@@ -2025,7 +2076,7 @@ void SceneTree::_network_process_packet(int p_from, const uint8_t *p_packet, int
} else {
- if (!node->can_call_rset(name))
+ if (!node->can_call_rset(name, p_from))
return;
int ofs = len_end + 1;
@@ -2133,7 +2184,7 @@ void SceneTree::_bind_methods() {
//ClassDB::bind_method(D_METHOD("call_group","call_flags","group","method","arg1","arg2"),&SceneMainLoop::_call_group,DEFVAL(Variant()),DEFVAL(Variant()));
- ClassDB::bind_method(D_METHOD("get_root:Viewport"), &SceneTree::get_root);
+ ClassDB::bind_method(D_METHOD("get_root"), &SceneTree::get_root);
ClassDB::bind_method(D_METHOD("has_group", "name"), &SceneTree::has_group);
ClassDB::bind_method(D_METHOD("set_auto_accept_quit", "enabled"), &SceneTree::set_auto_accept_quit);
@@ -2153,14 +2204,15 @@ void SceneTree::_bind_methods() {
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(D_METHOD("is_input_handled"), &SceneTree::is_input_handled);
- ClassDB::bind_method(D_METHOD("create_timer:SceneTreeTimer", "time_sec", "pause_mode_process"), &SceneTree::create_timer, DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("create_timer", "time_sec", "pause_mode_process"), &SceneTree::create_timer, DEFVAL(true));
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(D_METHOD("set_screen_stretch", "mode", "aspect", "minsize"), &SceneTree::set_screen_stretch);
+ ClassDB::bind_method(D_METHOD("set_screen_stretch", "mode", "aspect", "minsize", "shrink"), &SceneTree::set_screen_stretch, DEFVAL(1));
ClassDB::bind_method(D_METHOD("queue_delete", "obj"), &SceneTree::queue_delete);
@@ -2182,24 +2234,25 @@ void SceneTree::_bind_methods() {
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_group", &SceneTree::_call_group, mi2);
- 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(D_METHOD("notify_group", "group", "notification"), &SceneTree::notify_group);
+ ClassDB::bind_method(D_METHOD("set_group", "group", "property", "value"), &SceneTree::set_group);
ClassDB::bind_method(D_METHOD("get_nodes_in_group", "group"), &SceneTree::_get_nodes_in_group);
- 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(D_METHOD("set_current_scene", "child_node"), &SceneTree::set_current_scene);
+ ClassDB::bind_method(D_METHOD("get_current_scene"), &SceneTree::get_current_scene);
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(D_METHOD("change_scene_to", "packed_scene"), &SceneTree::change_scene_to);
ClassDB::bind_method(D_METHOD("reload_current_scene"), &SceneTree::reload_current_scene);
ClassDB::bind_method(D_METHOD("_change_scene"), &SceneTree::_change_scene);
- ClassDB::bind_method(D_METHOD("set_network_peer", "peer:NetworkedMultiplayerPeer"), &SceneTree::set_network_peer);
+ ClassDB::bind_method(D_METHOD("set_network_peer", "peer"), &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_connected_peers"), &SceneTree::get_network_connected_peers);
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);
@@ -2259,15 +2312,21 @@ SceneTree::SceneTree() {
singleton = this;
_quit = false;
+ accept_quit = true;
+ quit_on_go_back = true;
initialized = false;
+#ifdef TOOLS_ENABLED
editor_hint = false;
+#endif
+#ifdef DEBUG_ENABLED
debug_collisions_hint = false;
debug_navigation_hint = false;
- debug_collisions_color = GLOBAL_DEF("debug/collision/shape_color", Color(0.0, 0.6, 0.7, 0.5));
- debug_collision_contact_color = GLOBAL_DEF("debug/collision/contact_color", Color(1.0, 0.2, 0.1, 0.8));
- debug_navigation_color = GLOBAL_DEF("debug/navigation/geometry_color", Color(0.1, 1.0, 0.7, 0.4));
- debug_navigation_disabled_color = GLOBAL_DEF("debug/navigation/disabled_geometry_color", Color(1.0, 0.7, 0.1, 0.4));
- collision_debug_contacts = GLOBAL_DEF("debug/collision/max_contacts_displayed", 10000);
+#endif
+ debug_collisions_color = GLOBAL_DEF("debug/shapes/collision/shape_color", Color(0.0, 0.6, 0.7, 0.5));
+ debug_collision_contact_color = GLOBAL_DEF("debug/shapes/collision/contact_color", Color(1.0, 0.2, 0.1, 0.8));
+ debug_navigation_color = GLOBAL_DEF("debug/shapes/navigation/geometry_color", Color(0.1, 1.0, 0.7, 0.4));
+ debug_navigation_disabled_color = GLOBAL_DEF("debug/shapes/navigation/disabled_geometry_color", Color(1.0, 0.7, 0.1, 0.4));
+ collision_debug_contacts = GLOBAL_DEF("debug/shapes/collision/max_contacts_displayed", 10000);
tree_version = 1;
fixed_process_time = 1;
@@ -2286,27 +2345,65 @@ SceneTree::SceneTree() {
root = memnew(Viewport);
root->set_name("root");
- root->set_world(Ref<World>(memnew(World)));
+ if (!root->get_world().is_valid())
+ root->set_world(Ref<World>(memnew(World)));
+
//root->set_world_2d( Ref<World2D>( memnew( World2D )));
root->set_as_audio_listener(true);
root->set_as_audio_listener_2d(true);
current_scene = NULL;
- int ref_atlas_size = GLOBAL_DEF("rendering/reflections/atlas_size", 2048);
- int ref_atlas_subdiv = GLOBAL_DEF("rendering/reflections/atlas_subdiv", 8);
- int msaa_mode = GLOBAL_DEF("rendering/quality/msaa", 0);
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/quality/msaa", PropertyInfo(Variant::INT, "rendering/quality/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x"));
+ int ref_atlas_size = GLOBAL_DEF("rendering/quality/reflections/atlas_size", 2048);
+ int ref_atlas_subdiv = GLOBAL_DEF("rendering/quality/reflections/atlas_subdiv", 8);
+ int msaa_mode = GLOBAL_DEF("rendering/quality/filters/msaa", 0);
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/msaa", PropertyInfo(Variant::INT, "rendering/quality/filters/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x"));
root->set_msaa(Viewport::MSAA(msaa_mode));
- bool hdr = GLOBAL_DEF("rendering/quality/hdr", true);
+
+ GLOBAL_DEF("rendering/quality/depth/hdr", true);
+ GLOBAL_DEF("rendering/quality/depth/hdr.mobile", false);
+
+ bool hdr = GLOBAL_GET("rendering/quality/depth/hdr");
root->set_hdr(hdr);
VS::get_singleton()->scenario_set_reflection_atlas_size(root->get_world()->get_scenario(), ref_atlas_size, ref_atlas_subdiv);
+ { //load default fallback environment
+ //get possible extensions
+ List<String> exts;
+ ResourceLoader::get_recognized_extensions_for_type("Environment", &exts);
+ String ext_hint;
+ for (List<String>::Element *E = exts.front(); E; E = E->next()) {
+ if (ext_hint != String())
+ ext_hint += ",";
+ ext_hint += "*." + E->get();
+ }
+ //get path
+ String env_path = GLOBAL_DEF("rendering/environment/default_environment", "");
+ //setup property
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/environment/default_environment", PropertyInfo(Variant::STRING, "rendering/viewport/default_environment", PROPERTY_HINT_FILE, ext_hint));
+ env_path = env_path.strip_edges();
+ if (env_path != String()) {
+ Ref<Environment> env = ResourceLoader::load(env_path);
+ if (env.is_valid()) {
+ root->get_world()->set_fallback_environment(env);
+ } else {
+ if (is_editor_hint()) {
+ //file was erased, clear the field.
+ ProjectSettings::get_singleton()->set("rendering/environment/default_environment", "");
+ } else {
+ //file was erased, notify user.
+ ERR_PRINTS(RTR("Default Environment as specified in Project Setings (Rendering -> Viewport -> Default Environment) could not be loaded."));
+ }
+ }
+ }
+ }
+
stretch_mode = STRETCH_MODE_DISABLED;
stretch_aspect = STRETCH_ASPECT_IGNORE;
+ stretch_shrink = 1;
last_screen_size = Size2(OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height);
- root->set_size(last_screen_size);
+ _update_root_rect();
if (ScriptDebugger::get_singleton()) {
ScriptDebugger::get_singleton()->set_request_scene_tree_message_func(_debugger_request_tree, this);
diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_tree.h
index fadf77e30f..3543ebee90 100644
--- a/scene/main/scene_main_loop.h
+++ b/scene/main/scene_tree.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,6 +33,7 @@
#include "io/networked_multiplayer_peer.h"
#include "os/main_loop.h"
#include "os/thread_safe.h"
+#include "scene/resources/mesh.h"
#include "scene/resources/world.h"
#include "scene/resources/world_2d.h"
#include "self_list.h"
@@ -88,6 +90,7 @@ public:
STRETCH_ASPECT_KEEP,
STRETCH_ASPECT_KEEP_WIDTH,
STRETCH_ASPECT_KEEP_HEIGHT,
+ STRETCH_ASPECT_EXPAND,
};
private:
@@ -108,9 +111,13 @@ private:
bool quit_on_go_back;
uint32_t last_id;
+#ifdef TOOLS_ENABLED
bool editor_hint;
+#endif
+#ifdef DEBUG_ENABLED
bool debug_collisions_hint;
bool debug_navigation_hint;
+#endif
bool pause;
int root_lock;
@@ -143,6 +150,7 @@ private:
StretchMode stretch_mode;
StretchAspect stretch_aspect;
Size2i stretch_min;
+ int stretch_shrink;
void _update_root_rect();
@@ -164,7 +172,7 @@ private:
Color debug_collision_contact_color;
Color debug_navigation_color;
Color debug_navigation_disabled_color;
- Ref<Mesh> debug_contact_mesh;
+ Ref<ArrayMesh> debug_contact_mesh;
Ref<Material> navigation_material;
Ref<Material> navigation_disabled_material;
Ref<Material> collision_material;
@@ -232,7 +240,7 @@ private:
void remove_from_group(const StringName &p_group, Node *p_node);
void _notify_group_pause(const StringName &p_group, int p_notification);
- void _call_input_pause(const StringName &p_group, const StringName &p_method, const InputEvent &p_input);
+ void _call_input_pause(const StringName &p_group, const StringName &p_method, const Ref<InputEvent> &p_input);
Variant _call_group_flags(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
Variant _call_group(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
@@ -336,7 +344,7 @@ public:
void set_group(const StringName &p_group, const String &p_name, const Variant &p_value);
virtual void input_text(const String &p_text);
- virtual void input_event(const InputEvent &p_event);
+ virtual void input_event(const Ref<InputEvent> &p_event);
virtual void init();
virtual bool iteration(float p_time);
@@ -350,13 +358,21 @@ public:
void quit();
void set_input_as_handled();
+ bool is_input_handled();
_FORCE_INLINE_ float get_fixed_process_time() const { return fixed_process_time; }
_FORCE_INLINE_ float get_idle_process_time() const { return idle_process_time; }
+#ifdef TOOLS_ENABLED
void set_editor_hint(bool p_enabled);
- bool is_editor_hint() const;
+ bool is_editor_hint() const;
bool is_node_being_edited(const Node *p_node) const;
+#else
+ void set_editor_hint(bool p_enabled) {}
+
+ bool is_editor_hint() const { return false; }
+ bool is_node_being_edited(const Node *p_node) const { return false; }
+#endif
void set_pause(bool p_enabled);
bool is_paused() const;
@@ -364,11 +380,19 @@ public:
void set_camera(const RID &p_camera);
RID get_camera() const;
+#ifdef DEBUG_ENABLED
void set_debug_collisions_hint(bool p_enabled);
bool is_debugging_collisions_hint() const;
void set_debug_navigation_hint(bool p_enabled);
bool is_debugging_navigation_hint() const;
+#else
+ void set_debug_collisions_hint(bool p_enabled) {}
+ bool is_debugging_collisions_hint() const { return false; }
+
+ void set_debug_navigation_hint(bool p_enabled) {}
+ bool is_debugging_navigation_hint() const { return false; }
+#endif
void set_debug_collisions_color(const Color &p_color);
Color get_debug_collisions_color() const;
@@ -385,7 +409,7 @@ public:
Ref<Material> get_debug_navigation_material();
Ref<Material> get_debug_navigation_disabled_material();
Ref<Material> get_debug_collision_material();
- Ref<Mesh> get_debug_contact_mesh();
+ Ref<ArrayMesh> get_debug_contact_mesh();
int get_collision_debug_contact_count() { return collision_debug_contacts; }
@@ -398,7 +422,7 @@ public:
void get_nodes_in_group(const StringName &p_group, List<Node *> *p_list);
bool has_group(const StringName &p_identifier) const;
- void set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize);
+ void set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize, int p_shrink = 1);
//void change_scene(const String& p_path);
//Node *get_loaded_scene();
@@ -429,6 +453,7 @@ public:
bool is_network_server() const;
bool has_network_peer() const;
int get_network_unique_id() const;
+ Vector<int> get_network_connected_peers() const;
void set_refuse_new_network_connections(bool p_refuse);
bool is_refusing_new_network_connections() const;
diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp
index 2263e82312..a61d1100e6 100755
--- a/scene/main/timer.cpp
+++ b/scene/main/timer.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -50,8 +51,7 @@ void Timer::_notification(int p_what) {
if (time_left < 0) {
if (!one_shot)
- //time_left=wait_time+time_left;
- time_left = wait_time;
+ time_left += wait_time;
else
stop();
@@ -66,8 +66,7 @@ void Timer::_notification(int p_what) {
if (time_left < 0) {
if (!one_shot)
- //time_left = wait_time + time_left;
- time_left = wait_time;
+ time_left += wait_time;
else
stop();
emit_signal("timeout");
diff --git a/scene/main/timer.h b/scene/main/timer.h
index 53a2ddb2bd..dd4711ec37 100755
--- a/scene/main/timer.h
+++ b/scene/main/timer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 23f8189167..a22d897669 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -47,7 +48,8 @@
#include "scene/main/timer.h"
#include "scene/scene_string_names.h"
-#include "global_config.h"
+#include "project_settings.h"
+#include "scene/3d/scenario_fx.h"
void ViewportTexture::setup_local_to_scene() {
@@ -116,7 +118,11 @@ bool ViewportTexture::has_alpha() const {
return false;
}
+Ref<Image> ViewportTexture::get_data() const {
+ ERR_FAIL_COND_V(!vp, Ref<Image>());
+ return VS::get_singleton()->texture_get_data(vp->texture_rid);
+}
void ViewportTexture::set_flags(uint32_t p_flags) {
if (!vp)
@@ -318,7 +324,8 @@ void Viewport::update_worlds() {
if (!is_inside_tree())
return;
- Rect2 xformed_rect = (global_canvas_transform * canvas_transform).affine_inverse().xform(get_visible_rect());
+ Rect2 abstracted_rect = Rect2(Vector2(), get_visible_rect().size);
+ Rect2 xformed_rect = (global_canvas_transform * canvas_transform).affine_inverse().xform(abstracted_rect);
find_world_2d()->_update_viewport(this, xformed_rect);
find_world_2d()->_update();
@@ -502,30 +509,36 @@ void Viewport::_notification(int p_what) {
while (physics_picking_events.size()) {
- InputEvent ev = physics_picking_events.front()->get();
+ Ref<InputEvent> ev = physics_picking_events.front()->get();
physics_picking_events.pop_front();
Vector2 pos;
- switch (ev.type) {
- case InputEvent::MOUSE_MOTION: {
- pos.x = ev.mouse_motion.x;
- pos.y = ev.mouse_motion.y;
- motion_tested = true;
- physics_last_mousepos = pos;
- } break;
- case InputEvent::MOUSE_BUTTON: {
- pos.x = ev.mouse_button.x;
- pos.y = ev.mouse_button.y;
-
- } break;
- case InputEvent::SCREEN_DRAG: {
- pos.x = ev.screen_drag.x;
- pos.y = ev.screen_drag.y;
- } break;
- case InputEvent::SCREEN_TOUCH: {
- pos.x = ev.screen_touch.x;
- pos.y = ev.screen_touch.y;
- } break;
+
+ Ref<InputEventMouseMotion> mm = ev;
+
+ if (mm.is_valid()) {
+
+ pos = mm->get_position();
+ motion_tested = true;
+ physics_last_mousepos = pos;
+ }
+
+ Ref<InputEventMouseButton> mb = ev;
+
+ if (mb.is_valid()) {
+ pos = mb->get_position();
+ }
+
+ Ref<InputEventScreenDrag> sd = ev;
+
+ if (sd.is_valid()) {
+ pos = sd->get_position();
+ }
+
+ Ref<InputEventScreenTouch> st = ev;
+
+ if (st.is_valid()) {
+ pos = st->get_position();
}
if (ss2d) {
@@ -588,7 +601,7 @@ void Viewport::_notification(int p_what) {
if (co) {
co->_input_event(camera, ev, Vector3(), Vector3(), 0);
captured = true;
- if (ev.type == InputEvent::MOUSE_BUTTON && ev.mouse_button.button_index == 1 && !ev.mouse_button.pressed) {
+ if (mb.is_valid() && mb->get_button_index() == 1 && !mb->is_pressed()) {
physics_object_capture = 0;
}
@@ -608,7 +621,7 @@ void Viewport::_notification(int p_what) {
if (ObjectDB::get_instance(last_id)) {
//good, exists
last_object->_input_event(camera, ev, result.position, result.normal, result.shape);
- if (last_object->get_capture_input_on_drag() && ev.type == InputEvent::MOUSE_BUTTON && ev.mouse_button.button_index == 1 && ev.mouse_button.pressed) {
+ if (last_object->get_capture_input_on_drag() && mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) {
physics_object_capture = last_id;
}
}
@@ -636,14 +649,14 @@ void Viewport::_notification(int p_what) {
last_object = co;
last_id = result.collider_id;
new_collider = last_id;
- if (co->get_capture_input_on_drag() && ev.type == InputEvent::MOUSE_BUTTON && ev.mouse_button.button_index == 1 && ev.mouse_button.pressed) {
+ if (co->get_capture_input_on_drag() && mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) {
physics_object_capture = last_id;
}
}
}
}
- if (ev.type == InputEvent::MOUSE_MOTION) {
+ if (mm.is_valid()) {
_test_new_mouseover(new_collider);
}
}
@@ -688,6 +701,16 @@ RID Viewport::get_viewport_rid() const {
return viewport;
}
+void Viewport::set_use_arvr(bool p_use_arvr) {
+ arvr = p_use_arvr;
+
+ VS::get_singleton()->viewport_set_use_arvr(viewport, arvr);
+}
+
+bool Viewport::use_arvr() {
+ return arvr;
+}
+
void Viewport::set_size(const Size2 &p_size) {
if (size == p_size.floor())
@@ -1006,10 +1029,9 @@ void Viewport::_propagate_enter_world(Node *p_node) {
if (!p_node->is_inside_tree()) //may not have entered scene yet
return;
- Spatial *s = p_node->cast_to<Spatial>();
- if (s) {
+ if (p_node->cast_to<Spatial>() || p_node->cast_to<WorldEnvironment>()) {
- s->notification(Spatial::NOTIFICATION_ENTER_WORLD);
+ p_node->notification(Spatial::NOTIFICATION_ENTER_WORLD);
} else {
Viewport *v = p_node->cast_to<Viewport>();
if (v) {
@@ -1044,10 +1066,9 @@ void Viewport::_propagate_exit_world(Node *p_node) {
if (!p_node->is_inside_tree()) //may have exited scene already
return;
- Spatial *s = p_node->cast_to<Spatial>();
- if (s) {
+ if (p_node->cast_to<Spatial>() || p_node->cast_to<WorldEnvironment>()) {
- s->notification(Spatial::NOTIFICATION_EXIT_WORLD, true);
+ p_node->notification(Spatial::NOTIFICATION_EXIT_WORLD);
} else {
Viewport *v = p_node->cast_to<Viewport>();
if (v) {
@@ -1145,6 +1166,7 @@ void Viewport::set_size_override(bool p_enable, const Size2 &p_size, const Vecto
size_override_margin = p_margin;
_update_rect();
_update_stretch_transform();
+ emit_signal("size_changed");
}
Size2 Viewport::get_size_override() const {
@@ -1221,16 +1243,6 @@ Viewport::UpdateMode Viewport::get_update_mode() const {
}
//RID get_texture() const;
-void Viewport::queue_screen_capture() {
-
- //VS::get_singleton()->viewport_queue_screen_capture(viewport);
-}
-Image Viewport::get_screen_capture() const {
-
- //return VS::get_singleton()->viewport_get_screen_capture(viewport);
- return Image();
-}
-
Ref<ViewportTexture> Viewport::get_texture() const {
return default_texture;
@@ -1303,7 +1315,7 @@ Transform2D Viewport::_get_input_pre_xform() const {
if (to_screen_rect != Rect2()) {
- pre_xf.elements[2] = -to_screen_rect.pos;
+ pre_xf.elements[2] = -to_screen_rect.position;
pre_xf.scale(size / to_screen_rect.size);
}
@@ -1321,71 +1333,12 @@ Vector2 Viewport::_get_window_offset() const {
return Vector2();
}
-void Viewport::_make_input_local(InputEvent &ev) {
-
- switch (ev.type) {
-
- case InputEvent::MOUSE_BUTTON: {
-
- Vector2 vp_ofs = _get_window_offset();
-
- Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
- Vector2 g = ai.xform(Vector2(ev.mouse_button.global_x, ev.mouse_button.global_y));
- Vector2 l = ai.xform(Vector2(ev.mouse_button.x, ev.mouse_button.y) - vp_ofs);
-
- ev.mouse_button.x = l.x;
- ev.mouse_button.y = l.y;
- ev.mouse_button.global_x = g.x;
- ev.mouse_button.global_y = g.y;
-
- } break;
- case InputEvent::MOUSE_MOTION: {
-
- Vector2 vp_ofs = _get_window_offset();
+Ref<InputEvent> Viewport::_make_input_local(const Ref<InputEvent> &ev) {
- Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
- Vector2 g = ai.xform(Vector2(ev.mouse_motion.global_x, ev.mouse_motion.global_y));
- Vector2 l = ai.xform(Vector2(ev.mouse_motion.x, ev.mouse_motion.y) - vp_ofs);
- Vector2 r = ai.basis_xform(Vector2(ev.mouse_motion.relative_x, ev.mouse_motion.relative_y));
- Vector2 s = ai.basis_xform(Vector2(ev.mouse_motion.speed_x, ev.mouse_motion.speed_y));
+ Vector2 vp_ofs = _get_window_offset();
+ Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
- ev.mouse_motion.x = l.x;
- ev.mouse_motion.y = l.y;
- ev.mouse_motion.global_x = g.x;
- ev.mouse_motion.global_y = g.y;
- ev.mouse_motion.relative_x = r.x;
- ev.mouse_motion.relative_y = r.y;
- ev.mouse_motion.speed_x = s.x;
- ev.mouse_motion.speed_y = s.y;
-
- } break;
- case InputEvent::SCREEN_TOUCH: {
-
- Vector2 vp_ofs = _get_window_offset();
-
- Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
- Vector2 t = ai.xform(Vector2(ev.screen_touch.x, ev.screen_touch.y) - vp_ofs);
-
- ev.screen_touch.x = t.x;
- ev.screen_touch.y = t.y;
-
- } break;
- case InputEvent::SCREEN_DRAG: {
-
- Vector2 vp_ofs = _get_window_offset();
-
- Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
- Vector2 t = ai.xform(Vector2(ev.screen_drag.x, ev.screen_drag.y) - vp_ofs);
- Vector2 r = ai.basis_xform(Vector2(ev.screen_drag.relative_x, ev.screen_drag.relative_y));
- Vector2 s = ai.basis_xform(Vector2(ev.screen_drag.speed_x, ev.screen_drag.speed_y));
- ev.screen_drag.x = t.x;
- ev.screen_drag.y = t.y;
- ev.screen_drag.relative_x = r.x;
- ev.screen_drag.relative_y = r.y;
- ev.screen_drag.speed_x = s.x;
- ev.screen_drag.speed_y = s.y;
- } break;
- }
+ return ev->xformed_by(ai, -vp_ofs);
}
void Viewport::_vp_input_text(const String &p_text) {
@@ -1395,13 +1348,13 @@ void Viewport::_vp_input_text(const String &p_text) {
}
}
-void Viewport::_vp_input(const InputEvent &p_ev) {
+void Viewport::_vp_input(const Ref<InputEvent> &p_ev) {
if (disable_input)
return;
#ifdef TOOLS_ENABLED
- if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) {
+ if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) {
return;
}
#endif
@@ -1412,17 +1365,16 @@ void Viewport::_vp_input(const InputEvent &p_ev) {
//this one handles system input, p_ev are in system coordinates
//they are converted to viewport coordinates
- InputEvent ev = p_ev;
- _make_input_local(ev);
+ Ref<InputEvent> ev = _make_input_local(p_ev);
input(ev);
}
-void Viewport::_vp_unhandled_input(const InputEvent &p_ev) {
+void Viewport::_vp_unhandled_input(const Ref<InputEvent> &p_ev) {
if (disable_input)
return;
#ifdef TOOLS_ENABLED
- if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) {
+ if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) {
return;
}
#endif
@@ -1438,14 +1390,13 @@ void Viewport::_vp_unhandled_input(const InputEvent &p_ev) {
//this one handles system input, p_ev are in system coordinates
//they are converted to viewport coordinates
- InputEvent ev = p_ev;
- _make_input_local(ev);
+ Ref<InputEvent> ev = _make_input_local(p_ev);
unhandled_input(ev);
}
-Vector2 Viewport::get_mouse_pos() const {
+Vector2 Viewport::get_mouse_position() const {
- return (get_final_transform().affine_inverse() * _get_input_pre_xform()).xform(Input::get_singleton()->get_mouse_pos() - _get_window_offset());
+ return (get_final_transform().affine_inverse() * _get_input_pre_xform()).xform(Input::get_singleton()->get_mouse_position() - _get_window_offset());
}
void Viewport::warp_mouse(const Vector2 &p_pos) {
@@ -1522,40 +1473,44 @@ void Viewport::_gui_show_tooltip() {
gui.tooltip_label->set_anchor_and_margin(MARGIN_LEFT, Control::ANCHOR_BEGIN, ttp->get_margin(MARGIN_LEFT));
gui.tooltip_label->set_anchor_and_margin(MARGIN_TOP, Control::ANCHOR_BEGIN, ttp->get_margin(MARGIN_TOP));
- gui.tooltip_label->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, ttp->get_margin(MARGIN_RIGHT));
- gui.tooltip_label->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_END, ttp->get_margin(MARGIN_BOTTOM));
+ gui.tooltip_label->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -ttp->get_margin(MARGIN_RIGHT));
+ gui.tooltip_label->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_END, -ttp->get_margin(MARGIN_BOTTOM));
gui.tooltip_label->set_text(tooltip);
Rect2 r(gui.tooltip_pos + Point2(10, 10), gui.tooltip_label->get_combined_minimum_size() + ttp->get_minimum_size());
Rect2 vr = gui.tooltip_label->get_viewport_rect();
- if (r.size.x + r.pos.x > vr.size.x)
- r.pos.x = vr.size.x - r.size.x;
- else if (r.pos.x < 0)
- r.pos.x = 0;
+ if (r.size.x + r.position.x > vr.size.x)
+ r.position.x = vr.size.x - r.size.x;
+ else if (r.position.x < 0)
+ r.position.x = 0;
- if (r.size.y + r.pos.y > vr.size.y)
- r.pos.y = vr.size.y - r.size.y;
- else if (r.pos.y < 0)
- r.pos.y = 0;
+ if (r.size.y + r.position.y > vr.size.y)
+ r.position.y = vr.size.y - r.size.y;
+ else if (r.position.y < 0)
+ r.position.y = 0;
- gui.tooltip_popup->set_global_pos(r.pos);
+ gui.tooltip_popup->set_global_position(r.position);
gui.tooltip_popup->set_size(r.size);
gui.tooltip_popup->raise();
gui.tooltip_popup->show();
}
-void Viewport::_gui_call_input(Control *p_control, const InputEvent &p_input) {
+void Viewport::_gui_call_input(Control *p_control, const Ref<InputEvent> &p_input) {
//_block();
- InputEvent ev = p_input;
+ Ref<InputEvent> ev = p_input;
//mouse wheel events can't be stopped
- bool cant_stop_me_now = (ev.type == InputEvent::MOUSE_BUTTON &&
- (ev.mouse_button.button_index == BUTTON_WHEEL_DOWN ||
- ev.mouse_button.button_index == BUTTON_WHEEL_UP ||
- ev.mouse_button.button_index == BUTTON_WHEEL_LEFT ||
- ev.mouse_button.button_index == BUTTON_WHEEL_RIGHT));
+ Ref<InputEventMouseButton> mb = p_input;
+
+ bool cant_stop_me_now = (mb.is_valid() &&
+ (mb->get_button_index() == BUTTON_WHEEL_DOWN ||
+ mb->get_button_index() == BUTTON_WHEEL_UP ||
+ mb->get_button_index() == BUTTON_WHEEL_LEFT ||
+ mb->get_button_index() == BUTTON_WHEEL_RIGHT));
+
+ bool ismouse = ev.is_valid() || p_input->cast_to<InputEventMouseMotion>() != NULL;
CanvasItem *ci = p_control;
while (ci) {
@@ -1572,14 +1527,14 @@ void Viewport::_gui_call_input(Control *p_control, const InputEvent &p_input) {
break;
if (gui.key_event_accepted)
break;
- if (!cant_stop_me_now && control->data.mouse_filter == Control::MOUSE_FILTER_STOP && (ev.type == InputEvent::MOUSE_BUTTON || ev.type == InputEvent::MOUSE_MOTION))
+ if (!cant_stop_me_now && control->data.mouse_filter == Control::MOUSE_FILTER_STOP && ismouse)
break;
}
if (ci->is_set_as_toplevel())
break;
- ev = ev.xform_by(ci->get_transform()); //transform event upwards
+ ev = ev->xformed_by(ci->get_transform()); //transform event upwards
ci = ci->get_parent_item();
}
@@ -1639,7 +1594,7 @@ Control *Viewport::_gui_find_control_at_pos(CanvasItem *p_node, const Point2 &p_
Control *c = p_node->cast_to<Control>();
if (c) {
- //print_line("at "+String(c->get_path())+" POS "+c->get_pos()+" bt "+p_xform);
+ //print_line("at "+String(c->get_path())+" POS "+c->get_position()+" bt "+p_xform);
}
//subwindows first!!
@@ -1717,9 +1672,9 @@ bool Viewport::_gui_drop(Control *p_at_control, Point2 p_at_pos, bool p_just_che
return false;
}
-void Viewport::_gui_input_event(InputEvent p_event) {
+void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
- if (p_event.ID == gui.cancelled_input_ID) {
+ if (p_event->get_id() == gui.cancelled_input_ID) {
return;
}
//?
@@ -1729,430 +1684,513 @@ void Viewport::_gui_input_event(InputEvent p_event) {
}
*/
- switch (p_event.type) {
-
- case InputEvent::MOUSE_BUTTON: {
+ Ref<InputEventMouseButton> mb = p_event;
- gui.key_event_accepted = false;
+ if (mb.is_valid()) {
- Point2 mpos = Point2(p_event.mouse_button.x, p_event.mouse_button.y);
- if (p_event.mouse_button.pressed) {
+ gui.key_event_accepted = false;
- Size2 pos = mpos;
- if (gui.mouse_focus && p_event.mouse_button.button_index != gui.mouse_focus_button) {
+ Point2 mpos = mb->get_position();
+ if (mb->is_pressed()) {
- //do not steal mouse focus and stuff
+ Size2 pos = mpos;
+ if (gui.mouse_focus && mb->get_button_index() != gui.mouse_focus_button) {
- } else {
+ //do not steal mouse focus and stuff
- _gui_sort_modal_stack();
- while (!gui.modal_stack.empty()) {
+ } else {
- Control *top = gui.modal_stack.back()->get();
- Vector2 pos = top->get_global_transform_with_canvas().affine_inverse().xform(mpos);
- if (!top->has_point(pos)) {
+ _gui_sort_modal_stack();
+ while (!gui.modal_stack.empty()) {
- if (top->data.modal_exclusive || top->data.modal_frame == Engine::get_singleton()->get_frames_drawn()) {
- //cancel event, sorry, modal exclusive EATS UP ALL
- //alternative, you can't pop out a window the same frame it was made modal (fixes many issues)
- get_tree()->set_input_as_handled();
- return; // no one gets the event if exclusive NO ONE
- }
+ Control *top = gui.modal_stack.back()->get();
+ Vector2 pos = top->get_global_transform_with_canvas().affine_inverse().xform(mpos);
+ if (!top->has_point(pos)) {
- top->notification(Control::NOTIFICATION_MODAL_CLOSE);
- top->_modal_stack_remove();
- top->hide();
- } else {
- break;
+ if (top->data.modal_exclusive || top->data.modal_frame == Engine::get_singleton()->get_frames_drawn()) {
+ //cancel event, sorry, modal exclusive EATS UP ALL
+ //alternative, you can't pop out a window the same frame it was made modal (fixes many issues)
+ get_tree()->set_input_as_handled();
+ return; // no one gets the event if exclusive NO ONE
}
+
+ top->notification(Control::NOTIFICATION_MODAL_CLOSE);
+ top->_modal_stack_remove();
+ top->hide();
+ } else {
+ break;
}
+ }
- //Matrix32 parent_xform;
+ //Matrix32 parent_xform;
- /*
- if (data.parent_canvas_item)
- parent_xform=data.parent_canvas_item->get_global_transform();
- */
+ /*
+ if (data.parent_canvas_item)
+ parent_xform=data.parent_canvas_item->get_global_transform();
+ */
- gui.mouse_focus = _gui_find_control(pos);
- //print_line("has mf "+itos(gui.mouse_focus!=NULL));
- gui.mouse_focus_button = p_event.mouse_button.button_index;
+ gui.mouse_focus = _gui_find_control(pos);
+ //print_line("has mf "+itos(gui.mouse_focus!=NULL));
+ gui.mouse_focus_button = mb->get_button_index();
- if (!gui.mouse_focus) {
- break;
- }
+ if (!gui.mouse_focus) {
+ return;
+ }
- if (p_event.mouse_button.button_index == BUTTON_LEFT) {
- gui.drag_accum = Vector2();
- gui.drag_attempted = false;
- }
+ if (mb->get_button_index() == BUTTON_LEFT) {
+ gui.drag_accum = Vector2();
+ gui.drag_attempted = false;
}
+ }
+
+ mb = mb->xformed_by(Transform2D()); // make a copy of the event
- p_event.mouse_button.global_x = pos.x;
- p_event.mouse_button.global_y = pos.y;
+ mb->set_global_position(pos);
- pos = gui.focus_inv_xform.xform(pos);
- p_event.mouse_button.x = pos.x;
- p_event.mouse_button.y = pos.y;
+ pos = gui.focus_inv_xform.xform(pos);
+
+ mb->set_position(pos);
#ifdef DEBUG_ENABLED
- if (ScriptDebugger::get_singleton()) {
+ if (ScriptDebugger::get_singleton()) {
- Array arr;
- arr.push_back(gui.mouse_focus->get_path());
- arr.push_back(gui.mouse_focus->get_class());
- ScriptDebugger::get_singleton()->send_message("click_ctrl", arr);
- }
+ Array arr;
+ arr.push_back(gui.mouse_focus->get_path());
+ arr.push_back(gui.mouse_focus->get_class());
+ ScriptDebugger::get_singleton()->send_message("click_ctrl", arr);
+ }
/*if (bool(GLOBAL_DEF("debug/print_clicked_control",false))) {
- print_line(String(gui.mouse_focus->get_path())+" - "+pos);
- }*/
+ print_line(String(gui.mouse_focus->get_path())+" - "+pos);
+ }*/
#endif
- if (p_event.mouse_button.button_index == BUTTON_LEFT) { //assign focus
- CanvasItem *ci = gui.mouse_focus;
- while (ci) {
+ if (mb->get_button_index() == BUTTON_LEFT) { //assign focus
+ CanvasItem *ci = gui.mouse_focus;
+ while (ci) {
- Control *control = ci->cast_to<Control>();
- if (control) {
- if (control->get_focus_mode() != Control::FOCUS_NONE) {
- if (control != gui.key_focus) {
- control->grab_focus();
- }
- break;
+ Control *control = ci->cast_to<Control>();
+ if (control) {
+ if (control->get_focus_mode() != Control::FOCUS_NONE) {
+ if (control != gui.key_focus) {
+ control->grab_focus();
}
-
- if (control->data.mouse_filter == Control::MOUSE_FILTER_STOP)
- break;
+ break;
}
- if (ci->is_set_as_toplevel())
+ if (control->data.mouse_filter == Control::MOUSE_FILTER_STOP)
break;
-
- ci = ci->get_parent_item();
}
- }
- if (gui.mouse_focus->can_process()) {
- _gui_call_input(gui.mouse_focus, p_event);
- }
+ if (ci->is_set_as_toplevel())
+ break;
- get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME, "windows", "_cancel_input_ID", p_event.ID);
- get_tree()->set_input_as_handled();
+ ci = ci->get_parent_item();
+ }
+ }
- if (gui.drag_data.get_type() != Variant::NIL && p_event.mouse_button.button_index == BUTTON_LEFT) {
+ if (gui.mouse_focus->can_process()) {
+ _gui_call_input(gui.mouse_focus, mb);
+ }
- //alternate drop use (when using force_drag(), as proposed by #5342
- if (gui.mouse_focus) {
- _gui_drop(gui.mouse_focus, pos, false);
- }
+ get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME, "windows", "_cancel_input_ID", mb->get_id());
+ get_tree()->set_input_as_handled();
- gui.drag_data = Variant();
+ if (gui.drag_data.get_type() != Variant::NIL && mb->get_button_index() == BUTTON_LEFT) {
- if (gui.drag_preview) {
- memdelete(gui.drag_preview);
- gui.drag_preview = NULL;
- }
- _propagate_viewport_notification(this, NOTIFICATION_DRAG_END);
- //change mouse accordingly
+ //alternate drop use (when using force_drag(), as proposed by #5342
+ if (gui.mouse_focus) {
+ _gui_drop(gui.mouse_focus, pos, false);
}
- _gui_cancel_tooltip();
- //gui.tooltip_popup->hide();
+ gui.drag_data = Variant();
- } else {
+ if (gui.drag_preview) {
+ memdelete(gui.drag_preview);
+ gui.drag_preview = NULL;
+ }
+ _propagate_viewport_notification(this, NOTIFICATION_DRAG_END);
+ //change mouse accordingly
+ }
- if (gui.drag_data.get_type() != Variant::NIL && p_event.mouse_button.button_index == BUTTON_LEFT) {
+ _gui_cancel_tooltip();
+ //gui.tooltip_popup->hide();
- if (gui.mouse_over) {
- Size2 pos = mpos;
- pos = gui.focus_inv_xform.xform(pos);
+ } else {
- _gui_drop(gui.mouse_over, pos, false);
- }
+ if (gui.drag_data.get_type() != Variant::NIL && mb->get_button_index() == BUTTON_LEFT) {
- if (gui.drag_preview && p_event.mouse_button.button_index == BUTTON_LEFT) {
- memdelete(gui.drag_preview);
- gui.drag_preview = NULL;
- }
+ if (gui.mouse_over) {
+ Size2 pos = mpos;
+ pos = gui.focus_inv_xform.xform(pos);
- gui.drag_data = Variant();
- _propagate_viewport_notification(this, NOTIFICATION_DRAG_END);
- //change mouse accordingly
+ _gui_drop(gui.mouse_over, pos, false);
}
- if (!gui.mouse_focus) {
- //release event is only sent if a mouse focus (previously pressed button) exists
- break;
+ if (gui.drag_preview && mb->get_button_index() == BUTTON_LEFT) {
+ memdelete(gui.drag_preview);
+ gui.drag_preview = NULL;
}
- Size2 pos = mpos;
- p_event.mouse_button.global_x = pos.x;
- p_event.mouse_button.global_y = pos.y;
- pos = gui.focus_inv_xform.xform(pos);
- p_event.mouse_button.x = pos.x;
- p_event.mouse_button.y = pos.y;
+ gui.drag_data = Variant();
+ _propagate_viewport_notification(this, NOTIFICATION_DRAG_END);
+ //change mouse accordingly
+ }
- if (gui.mouse_focus->can_process()) {
- _gui_call_input(gui.mouse_focus, p_event);
- }
+ if (!gui.mouse_focus) {
+ //release event is only sent if a mouse focus (previously pressed button) exists
+ return;
+ }
- if (p_event.mouse_button.button_index == gui.mouse_focus_button) {
- gui.mouse_focus = NULL;
- gui.mouse_focus_button = -1;
- }
+ Size2 pos = mpos;
- /*if (gui.drag_data.get_type()!=Variant::NIL && p_event.mouse_button.button_index==BUTTON_LEFT) {
- _propagate_viewport_notification(this,NOTIFICATION_DRAG_END);
- gui.drag_data=Variant(); //always clear
- }*/
+ mb = mb->xformed_by(Transform2D()); //make a copy
+ mb->set_global_position(pos);
+ pos = gui.focus_inv_xform.xform(pos);
+ mb->set_position(pos);
- get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME, "windows", "_cancel_input_ID", p_event.ID);
- get_tree()->set_input_as_handled();
+ if (gui.mouse_focus->can_process()) {
+ _gui_call_input(gui.mouse_focus, mb);
}
- } break;
- case InputEvent::MOUSE_MOTION: {
- gui.key_event_accepted = false;
- Point2 mpos = Point2(p_event.mouse_motion.x, p_event.mouse_motion.y);
+ if (mb->get_button_index() == gui.mouse_focus_button) {
+ gui.mouse_focus = NULL;
+ gui.mouse_focus_button = -1;
+ }
- gui.last_mouse_pos = mpos;
+ /*if (gui.drag_data.get_type()!=Variant::NIL && mb->get_button_index()==BUTTON_LEFT) {
+ _propagate_viewport_notification(this,NOTIFICATION_DRAG_END);
+ gui.drag_data=Variant(); //always clear
+ }*/
- Control *over = NULL;
+ get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME, "windows", "_cancel_input_ID", mb->get_id());
+ get_tree()->set_input_as_handled();
+ }
+ }
- // D&D
- if (!gui.drag_attempted && gui.mouse_focus && p_event.mouse_motion.button_mask & BUTTON_MASK_LEFT) {
+ Ref<InputEventMouseMotion> mm = p_event;
- gui.drag_accum += Point2(p_event.mouse_motion.relative_x, p_event.mouse_motion.relative_y);
- float len = gui.drag_accum.length();
- if (len > 10) {
+ if (mm.is_valid()) {
- { //attempt grab, try parent controls too
- CanvasItem *ci = gui.mouse_focus;
- while (ci) {
+ gui.key_event_accepted = false;
+ Point2 mpos = mm->get_position();
- Control *control = ci->cast_to<Control>();
- if (control) {
+ gui.last_mouse_pos = mpos;
- gui.drag_data = control->get_drag_data(control->get_global_transform_with_canvas().affine_inverse().xform(mpos) - gui.drag_accum);
- if (gui.drag_data.get_type() != Variant::NIL) {
+ Control *over = NULL;
- gui.mouse_focus = NULL;
- }
+ // D&D
+ if (!gui.drag_attempted && gui.mouse_focus && mm->get_button_mask() & BUTTON_MASK_LEFT) {
+
+ gui.drag_accum += mm->get_relative();
+ float len = gui.drag_accum.length();
+ if (len > 10) {
+
+ { //attempt grab, try parent controls too
+ CanvasItem *ci = gui.mouse_focus;
+ while (ci) {
+
+ Control *control = ci->cast_to<Control>();
+ if (control) {
- if (control->data.mouse_filter == Control::MOUSE_FILTER_STOP)
- break;
+ gui.drag_data = control->get_drag_data(control->get_global_transform_with_canvas().affine_inverse().xform(mpos) - gui.drag_accum);
+ if (gui.drag_data.get_type() != Variant::NIL) {
+
+ gui.mouse_focus = NULL;
}
- if (ci->is_set_as_toplevel())
+ if (control->data.mouse_filter == Control::MOUSE_FILTER_STOP)
break;
-
- ci = ci->get_parent_item();
}
- }
- gui.drag_attempted = true;
- if (gui.drag_data.get_type() != Variant::NIL) {
+ if (ci->is_set_as_toplevel())
+ break;
- _propagate_viewport_notification(this, NOTIFICATION_DRAG_BEGIN);
+ ci = ci->get_parent_item();
}
}
+
+ gui.drag_attempted = true;
+ if (gui.drag_data.get_type() != Variant::NIL) {
+
+ _propagate_viewport_notification(this, NOTIFICATION_DRAG_BEGIN);
+ }
}
+ }
- if (gui.mouse_focus) {
- over = gui.mouse_focus;
- //recompute focus_inv_xform again here
+ if (gui.mouse_focus) {
+ over = gui.mouse_focus;
+ //recompute focus_inv_xform again here
- } else {
+ } else {
+
+ over = _gui_find_control(mpos);
+ }
- over = _gui_find_control(mpos);
+ if (gui.drag_data.get_type() == Variant::NIL && over && !gui.modal_stack.empty()) {
+
+ Control *top = gui.modal_stack.back()->get();
+ if (over != top && !top->is_a_parent_of(over)) {
+ over = NULL; //nothing can be found outside the modal stack
}
+ }
- if (gui.drag_data.get_type() == Variant::NIL && over && !gui.modal_stack.empty()) {
+ if (over != gui.mouse_over) {
- Control *top = gui.modal_stack.back()->get();
- if (over != top && !top->is_a_parent_of(over)) {
+ if (gui.mouse_over)
+ gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_EXIT);
- break; // don't send motion event to anything below modal stack top
- }
- }
+ _gui_cancel_tooltip();
+
+ if (over)
+ over->notification(Control::NOTIFICATION_MOUSE_ENTER);
+ }
+
+ gui.mouse_over = over;
+
+ if (gui.drag_preview) {
+ gui.drag_preview->set_position(mpos);
+ }
- if (over != gui.mouse_over) {
+ if (!over) {
+ OS::get_singleton()->set_cursor_shape(OS::CURSOR_ARROW);
+ return;
+ }
- if (gui.mouse_over)
- gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_EXIT);
+ Transform2D localizer = over->get_global_transform_with_canvas().affine_inverse();
+ Size2 pos = localizer.xform(mpos);
+ Vector2 speed = localizer.basis_xform(mm->get_speed());
+ Vector2 rel = localizer.basis_xform(mm->get_relative());
- _gui_cancel_tooltip();
+ mm = mm->xformed_by(Transform2D()); //make a copy
- if (over)
- over->notification(Control::NOTIFICATION_MOUSE_ENTER);
- }
+ mm->set_global_position(mpos);
+ mm->set_speed(speed);
+ mm->set_relative(rel);
+
+ if (mm->get_button_mask() == 0) {
+ //nothing pressed
- gui.mouse_over = over;
+ bool can_tooltip = true;
- if (gui.drag_preview) {
- gui.drag_preview->set_pos(mpos);
+ if (!gui.modal_stack.empty()) {
+ if (gui.modal_stack.back()->get() != over && !gui.modal_stack.back()->get()->is_a_parent_of(over))
+ can_tooltip = false;
}
- if (!over) {
- OS::get_singleton()->set_cursor_shape(OS::CURSOR_ARROW);
- break;
+ bool is_tooltip_shown = false;
+
+ if (gui.tooltip_popup) {
+ if (can_tooltip) {
+ String tooltip = over->get_tooltip(gui.tooltip->get_global_transform().xform_inv(mpos));
+
+ if (tooltip.length() == 0)
+ _gui_cancel_tooltip();
+ else if (tooltip == gui.tooltip_label->get_text())
+ is_tooltip_shown = true;
+ } else
+ _gui_cancel_tooltip();
}
- Transform2D localizer = over->get_global_transform_with_canvas().affine_inverse();
- Size2 pos = localizer.xform(mpos);
- Vector2 speed = localizer.basis_xform(Point2(p_event.mouse_motion.speed_x, p_event.mouse_motion.speed_y));
- Vector2 rel = localizer.basis_xform(Point2(p_event.mouse_motion.relative_x, p_event.mouse_motion.relative_y));
+ if (can_tooltip && !is_tooltip_shown) {
- p_event.mouse_motion.global_x = mpos.x;
- p_event.mouse_motion.global_y = mpos.y;
- p_event.mouse_motion.speed_x = speed.x;
- p_event.mouse_motion.speed_y = speed.y;
- p_event.mouse_motion.relative_x = rel.x;
- p_event.mouse_motion.relative_y = rel.y;
+ gui.tooltip = over;
+ gui.tooltip_pos = mpos; //(parent_xform * get_transform()).affine_inverse().xform(pos);
+ gui.tooltip_timer = gui.tooltip_delay;
+ }
+ }
- if (p_event.mouse_motion.button_mask == 0) {
- //nothing pressed
+ //pos = gui.focus_inv_xform.xform(pos);
- bool can_tooltip = true;
+ mm->set_position(pos);
- if (!gui.modal_stack.empty()) {
- if (gui.modal_stack.back()->get() != over && !gui.modal_stack.back()->get()->is_a_parent_of(over))
- can_tooltip = false;
- }
+ Control::CursorShape cursor_shape = over->get_cursor_shape(pos);
+ OS::get_singleton()->set_cursor_shape((OS::CursorShape)cursor_shape);
- bool is_tooltip_shown = false;
+ if (over->can_process()) {
+ _gui_call_input(over, mm);
+ }
- if (gui.tooltip_popup) {
- if (can_tooltip) {
- String tooltip = over->get_tooltip(gui.tooltip->get_global_transform().xform_inv(mpos));
+ get_tree()->set_input_as_handled();
- if (tooltip.length() == 0)
- _gui_cancel_tooltip();
- else if (tooltip == gui.tooltip_label->get_text())
- is_tooltip_shown = true;
- } else
- _gui_cancel_tooltip();
- }
+ if (gui.drag_data.get_type() != Variant::NIL && mm->get_button_mask() & BUTTON_MASK_LEFT) {
- if (can_tooltip && !is_tooltip_shown) {
+ bool can_drop = _gui_drop(over, pos, true);
- gui.tooltip = over;
- gui.tooltip_pos = mpos; //(parent_xform * get_transform()).affine_inverse().xform(pos);
- gui.tooltip_timer = gui.tooltip_delay;
- }
+ if (!can_drop) {
+ OS::get_singleton()->set_cursor_shape(OS::CURSOR_FORBIDDEN);
+ } else {
+ OS::get_singleton()->set_cursor_shape(OS::CURSOR_CAN_DROP);
}
+ //change mouse accordingly i guess
+ }
+ }
- //pos = gui.focus_inv_xform.xform(pos);
+ Ref<InputEventScreenTouch> touch_event = p_event;
+ if (touch_event.is_valid()) {
- p_event.mouse_motion.x = pos.x;
- p_event.mouse_motion.y = pos.y;
+ Size2 pos = touch_event->get_position();
+ if (touch_event->is_pressed()) {
- Control::CursorShape cursor_shape = over->get_cursor_shape(pos);
- OS::get_singleton()->set_cursor_shape((OS::CursorShape)cursor_shape);
+ Control *over = _gui_find_control(pos);
+ if (over) {
- if (over->can_process()) {
- _gui_call_input(over, p_event);
+ if (!gui.modal_stack.empty()) {
+
+ Control *top = gui.modal_stack.back()->get();
+ if (over != top && !top->is_a_parent_of(over)) {
+
+ return;
+ }
+ }
+ if (over->can_process()) {
+
+ touch_event = touch_event->xformed_by(Transform2D()); //make a copy
+ if (over == gui.mouse_focus) {
+ pos = gui.focus_inv_xform.xform(pos);
+ } else {
+ pos = over->get_global_transform_with_canvas().affine_inverse().xform(pos);
+ }
+ touch_event->set_position(pos);
+ _gui_call_input(over, touch_event);
+ }
+ get_tree()->set_input_as_handled();
+ return;
}
+ } else if (gui.mouse_focus) {
+
+ if (gui.mouse_focus->can_process()) {
+ touch_event = touch_event->xformed_by(Transform2D()); //make a copy
+ touch_event->set_position(gui.focus_inv_xform.xform(pos));
+
+ _gui_call_input(gui.mouse_focus, touch_event);
+ }
get_tree()->set_input_as_handled();
+ return;
+ }
+ }
+
+ Ref<InputEventScreenDrag> drag_event = p_event;
+ if (drag_event.is_valid()) {
- if (gui.drag_data.get_type() != Variant::NIL && p_event.mouse_motion.button_mask & BUTTON_MASK_LEFT) {
+ Control *over = gui.mouse_focus;
+ if (!over) {
+ over = _gui_find_control(drag_event->get_position());
+ }
+ if (over) {
+
+ if (!gui.modal_stack.empty()) {
- bool can_drop = _gui_drop(over, pos, true);
+ Control *top = gui.modal_stack.back()->get();
+ if (over != top && !top->is_a_parent_of(over)) {
- if (!can_drop) {
- OS::get_singleton()->set_cursor_shape(OS::CURSOR_FORBIDDEN);
- } else {
- OS::get_singleton()->set_cursor_shape(OS::CURSOR_CAN_DROP);
+ return;
}
- //change mouse accordingly i guess
}
+ if (over->can_process()) {
- } break;
- case InputEvent::ACTION:
- case InputEvent::JOYPAD_BUTTON:
- case InputEvent::JOYPAD_MOTION:
- case InputEvent::KEY: {
+ Transform2D localizer = over->get_global_transform_with_canvas().affine_inverse();
+ Size2 pos = localizer.xform(drag_event->get_position());
+ Vector2 speed = localizer.basis_xform(drag_event->get_speed());
+ Vector2 rel = localizer.basis_xform(drag_event->get_relative());
+
+ drag_event = drag_event->xformed_by(Transform2D()); //make a copy
- if (gui.key_focus && !gui.key_focus->is_visible_in_tree()) {
- gui.key_focus->release_focus();
+ drag_event->set_speed(speed);
+ drag_event->set_relative(rel);
+ drag_event->set_position(pos);
+
+ _gui_call_input(over, drag_event);
}
- if (gui.key_focus) {
+ get_tree()->set_input_as_handled();
+ return;
+ }
+ }
+
+ if (mm.is_null() && mb.is_null() && p_event->is_action_type()) {
- gui.key_event_accepted = false;
- if (gui.key_focus->can_process()) {
- gui.key_focus->call_multilevel(SceneStringNames::get_singleton()->_gui_input, p_event);
- if (gui.key_focus) //maybe lost it
- gui.key_focus->emit_signal(SceneStringNames::get_singleton()->gui_input, p_event);
- }
+ if (gui.key_focus && !gui.key_focus->is_visible_in_tree()) {
+ gui.key_focus->release_focus();
+ }
- if (gui.key_event_accepted) {
+ if (gui.key_focus) {
- get_tree()->set_input_as_handled();
- break;
- }
+ gui.key_event_accepted = false;
+ if (gui.key_focus->can_process()) {
+ gui.key_focus->call_multilevel(SceneStringNames::get_singleton()->_gui_input, p_event);
+ if (gui.key_focus) //maybe lost it
+ gui.key_focus->emit_signal(SceneStringNames::get_singleton()->gui_input, p_event);
}
- if (p_event.is_pressed() && p_event.is_action("ui_cancel") && !gui.modal_stack.empty()) {
+ if (gui.key_event_accepted) {
- _gui_sort_modal_stack();
- Control *top = gui.modal_stack.back()->get();
- if (!top->data.modal_exclusive) {
+ get_tree()->set_input_as_handled();
+ return;
+ }
+ }
- top->notification(Control::NOTIFICATION_MODAL_CLOSE);
- top->_modal_stack_remove();
- top->hide();
- }
+ if (p_event->is_pressed() && p_event->is_action("ui_cancel") && !gui.modal_stack.empty()) {
+
+ _gui_sort_modal_stack();
+ Control *top = gui.modal_stack.back()->get();
+ if (!top->data.modal_exclusive) {
+
+ top->notification(Control::NOTIFICATION_MODAL_CLOSE);
+ top->_modal_stack_remove();
+ top->hide();
}
+ }
- Control *from = gui.key_focus ? gui.key_focus : NULL; //hmm
+ Control *from = gui.key_focus ? gui.key_focus : NULL; //hmm
- //keyboard focus
- //if (from && p_event.key.pressed && !p_event.key.mod.alt && !p_event.key.mod.meta && !p_event.key.mod.command) {
+ //keyboard focus
+ //if (from && p_event->is_pressed() && !p_event->get_alt() && !p_event->get_metakey() && !p_event->key->get_command()) {
- if (from && p_event.is_pressed()) {
- Control *next = NULL;
+ Ref<InputEventKey> k = p_event;
+ //need to check for mods, otherwise any combination of alt/ctrl/shift+<up/down/left/righ/etc> is handled here when it shouldn't be.
+ bool mods = k.is_valid() && (k->get_control() || k->get_alt() || k->get_shift() || k->get_metakey());
- if (p_event.is_action("ui_focus_next")) {
+ if (from && p_event->is_pressed()) {
+ Control *next = NULL;
- next = from->find_next_valid_focus();
- }
+ if (p_event->is_action("ui_focus_next")) {
- if (p_event.is_action("ui_focus_prev")) {
+ next = from->find_next_valid_focus();
+ }
- next = from->find_prev_valid_focus();
- }
+ if (p_event->is_action("ui_focus_prev")) {
- if (p_event.is_action("ui_up")) {
+ next = from->find_prev_valid_focus();
+ }
- next = from->_get_focus_neighbour(MARGIN_TOP);
- }
+ if (!mods && p_event->is_action("ui_up")) {
- if (p_event.is_action("ui_left")) {
+ next = from->_get_focus_neighbour(MARGIN_TOP);
+ }
- next = from->_get_focus_neighbour(MARGIN_LEFT);
- }
+ if (!mods && p_event->is_action("ui_left")) {
- if (p_event.is_action("ui_right")) {
+ next = from->_get_focus_neighbour(MARGIN_LEFT);
+ }
- next = from->_get_focus_neighbour(MARGIN_RIGHT);
- }
+ if (!mods && p_event->is_action("ui_right")) {
- if (p_event.is_action("ui_down")) {
+ next = from->_get_focus_neighbour(MARGIN_RIGHT);
+ }
- next = from->_get_focus_neighbour(MARGIN_BOTTOM);
- }
+ if (!mods && p_event->is_action("ui_down")) {
- if (next) {
- next->grab_focus();
- get_tree()->set_input_as_handled();
- }
+ next = from->_get_focus_neighbour(MARGIN_BOTTOM);
}
- } break;
+ if (next) {
+ next->grab_focus();
+ get_tree()->set_input_as_handled();
+ }
+ }
}
}
@@ -2236,7 +2274,7 @@ void Viewport::_gui_set_drag_preview(Control *p_base, Control *p_control) {
memdelete(gui.drag_preview);
}
p_control->set_as_toplevel(true);
- p_control->set_pos(gui.last_mouse_pos);
+ p_control->set_position(gui.last_mouse_pos);
p_base->get_root_parent_control()->add_child(p_control); //add as child of viewport
p_control->raise();
if (gui.drag_preview) {
@@ -2347,7 +2385,7 @@ List<Control *>::Element *Viewport::_gui_show_modal(Control *p_control) {
gui.modal_stack.push_back(p_control);
if (gui.key_focus)
- p_control->_modal_set_prev_focus_owner(gui.key_focus->get_instance_ID());
+ p_control->_modal_set_prev_focus_owner(gui.key_focus->get_instance_id());
else
p_control->_modal_set_prev_focus_owner(0);
@@ -2365,33 +2403,30 @@ void Viewport::_gui_grab_click_focus(Control *p_control) {
if (gui.mouse_focus == p_control)
return;
- InputEvent ie;
- ie.type = InputEvent::MOUSE_BUTTON;
- InputEventMouseButton &mb = ie.mouse_button;
+ Ref<InputEventMouseButton> mb;
+ mb.instance();
//send unclic
Point2 click = gui.mouse_focus->get_global_transform_with_canvas().affine_inverse().xform(gui.last_mouse_pos);
- mb.x = click.x;
- mb.y = click.y;
- mb.button_index = gui.mouse_focus_button;
- mb.pressed = false;
- gui.mouse_focus->call_deferred(SceneStringNames::get_singleton()->_gui_input, ie);
+ mb->set_position(click);
+ mb->set_button_index(gui.mouse_focus_button);
+ mb->set_pressed(false);
+ gui.mouse_focus->call_deferred(SceneStringNames::get_singleton()->_gui_input, mb);
gui.mouse_focus = p_control;
gui.focus_inv_xform = gui.mouse_focus->get_global_transform_with_canvas().affine_inverse();
click = gui.mouse_focus->get_global_transform_with_canvas().affine_inverse().xform(gui.last_mouse_pos);
- mb.x = click.x;
- mb.y = click.y;
- mb.button_index = gui.mouse_focus_button;
- mb.pressed = true;
- gui.mouse_focus->call_deferred(SceneStringNames::get_singleton()->_gui_input, ie);
+ mb->set_position(click);
+ mb->set_button_index(gui.mouse_focus_button);
+ mb->set_pressed(true);
+ gui.mouse_focus->call_deferred(SceneStringNames::get_singleton()->_gui_input, mb);
}
}
///////////////////////////////
-void Viewport::input(const InputEvent &p_event) {
+void Viewport::input(const Ref<InputEvent> &p_event) {
ERR_FAIL_COND(!is_inside_tree());
@@ -2400,20 +2435,20 @@ void Viewport::input(const InputEvent &p_event) {
//get_tree()->call_group(SceneTree::GROUP_CALL_REVERSE|SceneTree::GROUP_CALL_REALTIME|SceneTree::GROUP_CALL_MULIILEVEL,gui_input_group,"_gui_input",p_event); //special one for GUI, as controls use their own process check
}
-void Viewport::unhandled_input(const InputEvent &p_event) {
+void Viewport::unhandled_input(const Ref<InputEvent> &p_event) {
ERR_FAIL_COND(!is_inside_tree());
get_tree()->_call_input_pause(unhandled_input_group, "_unhandled_input", p_event);
//call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"unhandled_input","_unhandled_input",ev);
- if (!get_tree()->input_handled && p_event.type == InputEvent::KEY) {
+ if (!get_tree()->input_handled && p_event->cast_to<InputEventKey>() != NULL) {
get_tree()->_call_input_pause(unhandled_key_input_group, "_unhandled_key_input", p_event);
//call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"unhandled_key_input","_unhandled_key_input",ev);
}
if (physics_object_picking && !get_tree()->input_handled) {
- if (p_event.type == InputEvent::MOUSE_BUTTON || p_event.type == InputEvent::MOUSE_MOTION || p_event.type == InputEvent::SCREEN_DRAG || p_event.type == InputEvent::SCREEN_TOUCH) {
+ if (Input::get_singleton()->get_mouse_mode() != Input::MOUSE_MODE_CAPTURED && (p_event->cast_to<InputEventMouseButton>() || p_event->cast_to<InputEventMouseMotion>() || p_event->cast_to<InputEventScreenDrag>() || p_event->cast_to<InputEventScreenTouch>())) {
physics_picking_events.push_back(p_event);
}
}
@@ -2572,16 +2607,45 @@ bool Viewport::get_hdr() const {
return hdr;
}
+void Viewport::set_usage(Usage p_usage) {
+
+ usage = p_usage;
+ VS::get_singleton()->viewport_set_usage(viewport, VS::ViewportUsage(p_usage));
+}
+
+Viewport::Usage Viewport::get_usage() const {
+ return usage;
+}
+
+void Viewport::set_debug_draw(DebugDraw p_debug_draw) {
+
+ debug_draw = p_debug_draw;
+ VS::get_singleton()->viewport_set_debug_draw(viewport, VS::ViewportDebugDraw(p_debug_draw));
+}
+
+Viewport::DebugDraw Viewport::get_debug_draw() const {
+
+ return debug_draw;
+}
+
+int Viewport::get_render_info(RenderInfo p_info) {
+
+ return VS::get_singleton()->viewport_get_render_info(viewport, VS::ViewportRenderInfo(p_info));
+}
+
void Viewport::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_use_arvr", "use"), &Viewport::set_use_arvr);
+ ClassDB::bind_method(D_METHOD("use_arvr"), &Viewport::use_arvr);
+
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(D_METHOD("set_world_2d", "world_2d"), &Viewport::set_world_2d);
+ ClassDB::bind_method(D_METHOD("get_world_2d"), &Viewport::get_world_2d);
+ ClassDB::bind_method(D_METHOD("find_world_2d"), &Viewport::find_world_2d);
+ ClassDB::bind_method(D_METHOD("set_world", "world"), &Viewport::set_world);
+ ClassDB::bind_method(D_METHOD("get_world"), &Viewport::get_world);
+ ClassDB::bind_method(D_METHOD("find_world"), &Viewport::find_world);
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);
@@ -2606,8 +2670,6 @@ void Viewport::_bind_methods() {
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(D_METHOD("set_vflip", "enable"), &Viewport::set_vflip);
ClassDB::bind_method(D_METHOD("get_vflip"), &Viewport::get_vflip);
@@ -2625,7 +2687,15 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_hdr", "enable"), &Viewport::set_hdr);
ClassDB::bind_method(D_METHOD("get_hdr"), &Viewport::get_hdr);
- ClassDB::bind_method(D_METHOD("get_texture:ViewportTexture"), &Viewport::get_texture);
+ ClassDB::bind_method(D_METHOD("set_usage", "usage"), &Viewport::set_usage);
+ ClassDB::bind_method(D_METHOD("get_usage"), &Viewport::get_usage);
+
+ ClassDB::bind_method(D_METHOD("set_debug_draw", "debug_draw"), &Viewport::set_debug_draw);
+ ClassDB::bind_method(D_METHOD("get_debug_draw"), &Viewport::get_debug_draw);
+
+ ClassDB::bind_method(D_METHOD("get_render_info", "info"), &Viewport::get_render_info);
+
+ ClassDB::bind_method(D_METHOD("get_texture"), &Viewport::get_texture);
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);
@@ -2639,20 +2709,20 @@ void Viewport::_bind_methods() {
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(D_METHOD("get_camera:Camera"), &Viewport::get_camera);
+ ClassDB::bind_method(D_METHOD("get_camera"), &Viewport::get_camera);
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(D_METHOD("is_audio_listener"), &Viewport::is_audio_listener);
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("is_audio_listener_2d"), &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(D_METHOD("get_mouse_pos"), &Viewport::get_mouse_pos);
+ ClassDB::bind_method(D_METHOD("get_mouse_position"), &Viewport::get_mouse_position);
ClassDB::bind_method(D_METHOD("warp_mouse", "to_pos"), &Viewport::warp_mouse);
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(D_METHOD("gui_get_drag_data"), &Viewport::gui_get_drag_data);
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);
@@ -2669,6 +2739,8 @@ void Viewport::_bind_methods() {
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::BOOL, "arvr"), "set_use_arvr", "use_arvr");
+
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");
@@ -2678,6 +2750,8 @@ void Viewport::_bind_methods() {
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_PROPERTY(PropertyInfo(Variant::INT, "usage", PROPERTY_HINT_ENUM, "2D,2D No-Sampling,3D,3D No-Effects"), "set_usage", "get_usage");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "debug_draw", PROPERTY_HINT_ENUM, "Disabled,Unshaded,Overdraw,Wireframe"), "set_debug_draw", "get_debug_draw");
ADD_GROUP("Render Target", "render_target_");
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");
@@ -2712,6 +2786,19 @@ void Viewport::_bind_methods() {
BIND_CONSTANT(SHADOW_ATLAS_QUADRANT_SUBDIV_1024);
BIND_CONSTANT(SHADOW_ATLAS_QUADRANT_SUBDIV_MAX);
+ BIND_CONSTANT(RENDER_INFO_OBJECTS_IN_FRAME);
+ BIND_CONSTANT(RENDER_INFO_VERTICES_IN_FRAME);
+ BIND_CONSTANT(RENDER_INFO_MATERIAL_CHANGES_IN_FRAME);
+ BIND_CONSTANT(RENDER_INFO_SHADER_CHANGES_IN_FRAME);
+ BIND_CONSTANT(RENDER_INFO_SURFACE_CHANGES_IN_FRAME);
+ BIND_CONSTANT(RENDER_INFO_DRAW_CALLS_IN_FRAME);
+ BIND_CONSTANT(RENDER_INFO_MAX);
+
+ BIND_CONSTANT(DEBUG_DRAW_DISABLED);
+ BIND_CONSTANT(DEBUG_DRAW_UNSHADED);
+ BIND_CONSTANT(DEBUG_DRAW_OVERDRAW);
+ BIND_CONSTANT(DEBUG_DRAW_WIREFRAME);
+
BIND_CONSTANT(MSAA_DISABLED);
BIND_CONSTANT(MSAA_2X);
BIND_CONSTANT(MSAA_4X);
@@ -2739,6 +2826,7 @@ Viewport::Viewport() {
parent = NULL;
listener = NULL;
camera = NULL;
+ arvr = false;
size_override = false;
size_override_stretch = false;
size_override_size = Size2(1, 1);
@@ -2763,7 +2851,7 @@ Viewport::Viewport() {
set_shadow_atlas_quadrant_subdiv(2, SHADOW_ATLAS_QUADRANT_SUBDIV_16);
set_shadow_atlas_quadrant_subdiv(3, SHADOW_ATLAS_QUADRANT_SUBDIV_64);
- String id = itos(get_instance_ID());
+ String id = itos(get_instance_id());
input_group = "_vp_input" + id;
gui_input_group = "_vp_gui_input" + id;
unhandled_input_group = "_vp_unhandled_input" + id;
@@ -2786,6 +2874,9 @@ Viewport::Viewport() {
msaa = MSAA_DISABLED;
hdr = false;
+
+ usage = USAGE_3D;
+ debug_draw = DEBUG_DRAW_DISABLED;
}
Viewport::~Viewport() {
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index 3fc781c62c..83c989db54 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -76,6 +77,8 @@ public:
virtual void set_flags(uint32_t p_flags);
virtual uint32_t get_flags() const;
+ virtual Ref<Image> get_data() const;
+
ViewportTexture();
~ViewportTexture();
};
@@ -112,6 +115,31 @@ public:
MSAA_16X,
};
+ enum Usage {
+ USAGE_2D,
+ USAGE_2D_NO_SAMPLING,
+ USAGE_3D,
+ USAGE_3D_NO_EFFECTS,
+ };
+
+ enum RenderInfo {
+
+ RENDER_INFO_OBJECTS_IN_FRAME,
+ RENDER_INFO_VERTICES_IN_FRAME,
+ RENDER_INFO_MATERIAL_CHANGES_IN_FRAME,
+ RENDER_INFO_SHADER_CHANGES_IN_FRAME,
+ RENDER_INFO_SURFACE_CHANGES_IN_FRAME,
+ RENDER_INFO_DRAW_CALLS_IN_FRAME,
+ RENDER_INFO_MAX
+ };
+
+ enum DebugDraw {
+ DEBUG_DRAW_DISABLED,
+ DEBUG_DRAW_UNSHADED,
+ DEBUG_DRAW_OVERDRAW,
+ DEBUG_DRAW_WIREFRAME,
+ };
+
private:
friend class ViewportTexture;
@@ -120,6 +148,8 @@ private:
Listener *listener;
Set<Listener *> listeners;
+ bool arvr;
+
Camera *camera;
Set<Camera *> cameras;
@@ -157,7 +187,7 @@ private:
bool gen_mipmaps;
bool physics_object_picking;
- List<InputEvent> physics_picking_events;
+ List<Ref<InputEvent> > physics_picking_events;
ObjectID physics_object_capture;
ObjectID physics_object_over;
Vector2 physics_last_mousepos;
@@ -194,6 +224,10 @@ private:
RID texture_rid;
uint32_t texture_flags;
+ DebugDraw debug_draw;
+
+ Usage usage;
+
int shadow_atlas_size;
ShadowAtlasQuadrantSubdiv shadow_atlas_quadrant_subdiv[4];
@@ -236,14 +270,14 @@ private:
bool disable_input;
- void _gui_call_input(Control *p_control, const InputEvent &p_input);
+ void _gui_call_input(Control *p_control, const Ref<InputEvent> &p_input);
void _gui_sort_subwindows();
void _gui_sort_roots();
void _gui_sort_modal_stack();
Control *_gui_find_control(const Point2 &p_global);
Control *_gui_find_control_at_pos(CanvasItem *p_node, const Point2 &p_global, const Transform2D &p_xform, Transform2D &r_inv_xform);
- void _gui_input_event(InputEvent p_event);
+ void _gui_input_event(Ref<InputEvent> p_event);
void update_worlds();
@@ -252,10 +286,10 @@ private:
void _vp_enter_tree();
void _vp_exit_tree();
- void _vp_input(const InputEvent &p_ev);
+ void _vp_input(const Ref<InputEvent> &p_ev);
void _vp_input_text(const String &p_text);
- void _vp_unhandled_input(const InputEvent &p_ev);
- void _make_input_local(InputEvent &ev);
+ void _vp_unhandled_input(const Ref<InputEvent> &p_ev);
+ Ref<InputEvent> _make_input_local(const Ref<InputEvent> &ev);
friend class Control;
@@ -317,6 +351,9 @@ public:
Listener *get_listener() const;
Camera *get_camera() const;
+ void set_use_arvr(bool p_use_arvr);
+ bool use_arvr();
+
void set_as_audio_listener(bool p_enable);
bool is_audio_listener() const;
@@ -381,14 +418,11 @@ public:
Vector2 get_camera_coords(const Vector2 &p_viewport_coords) const;
Vector2 get_camera_rect_size() const;
- void queue_screen_capture();
- Image get_screen_capture() const;
-
void set_use_own_world(bool p_world);
bool is_using_own_world() const;
- void input(const InputEvent &p_event);
- void unhandled_input(const InputEvent &p_event);
+ void input(const Ref<InputEvent> &p_event);
+ void unhandled_input(const Ref<InputEvent> &p_event);
void set_disable_input(bool p_disable);
bool is_input_disabled() const;
@@ -399,7 +433,7 @@ public:
void set_attach_to_screen_rect(const Rect2 &p_rect);
Rect2 get_attach_to_screen_rect() const;
- Vector2 get_mouse_pos() const;
+ Vector2 get_mouse_position() const;
void warp_mouse(const Vector2 &p_pos);
void set_physics_object_picking(bool p_enable);
@@ -415,6 +449,14 @@ public:
virtual String get_configuration_warning() const;
+ void set_usage(Usage p_usage);
+ Usage get_usage() const;
+
+ void set_debug_draw(DebugDraw p_debug_draw);
+ DebugDraw get_debug_draw() const;
+
+ int get_render_info(RenderInfo p_info);
+
Viewport();
~Viewport();
};
@@ -422,5 +464,8 @@ public:
VARIANT_ENUM_CAST(Viewport::UpdateMode);
VARIANT_ENUM_CAST(Viewport::ShadowAtlasQuadrantSubdiv);
VARIANT_ENUM_CAST(Viewport::MSAA);
+VARIANT_ENUM_CAST(Viewport::Usage);
+VARIANT_ENUM_CAST(Viewport::DebugDraw);
+VARIANT_ENUM_CAST(Viewport::RenderInfo);
#endif
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 06dae328f4..3e6d80d314 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "register_scene_types.h"
-#include "global_config.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/io/resource_format_image.h"
#include "scene/io/resource_format_wav.h"
@@ -41,7 +42,7 @@
#include "scene/2d/path_2d.h"
#include "scene/gui/box_container.h"
#include "scene/gui/button.h"
-#include "scene/gui/button_array.h"
+
#include "scene/gui/button_group.h"
#include "scene/gui/center_container.h"
#include "scene/gui/check_box.h"
@@ -73,7 +74,6 @@
#include "scene/gui/separator.h"
#include "scene/gui/slider.h"
#include "scene/gui/spin_box.h"
-#include "scene/gui/spin_box.h"
#include "scene/gui/split_container.h"
#include "scene/gui/tab_container.h"
#include "scene/gui/tabs.h"
@@ -111,6 +111,7 @@
#include "scene/2d/ray_cast_2d.h"
//#include "scene/2d/sound_player_2d.h"
//#include "scene/2d/sample_player_2d.h"
+#include "scene/2d/audio_stream_player_2d.h"
#include "scene/2d/canvas_modulate.h"
#include "scene/2d/navigation2d.h"
#include "scene/2d/remote_transform_2d.h"
@@ -128,8 +129,7 @@
#include "scene/animation/animation_tree_player.h"
#include "scene/animation/tween.h"
#include "scene/main/resource_preloader.h"
-#include "scene/main/scene_main_loop.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
#include "scene/resources/packed_scene.h"
#include "scene/resources/mesh_data_tool.h"
@@ -164,13 +164,15 @@
#include "scene/resources/polygon_path_finder.h"
//#include "scene/resources/sample.h"
-//#include "scene/audio/sample_player.h"
+#include "scene/3d/audio_stream_player_3d.h"
#include "scene/resources/material.h"
#include "scene/resources/mesh.h"
#include "scene/resources/room.h"
#include "scene/resources/sky_box.h"
#include "scene/resources/texture.h"
+#include "scene/resources/primitive_meshes.h"
+
#include "scene/resources/shader_graph.h"
#include "scene/resources/world.h"
@@ -197,6 +199,8 @@
#include "scene/3d/camera.h"
#include "scene/3d/listener.h"
+#include "scene/3d/arvr_nodes.h"
+
#include "scene/3d/gi_probe.h"
#include "scene/3d/interpolated_camera.h"
#include "scene/3d/light.h"
@@ -205,14 +209,12 @@
#include "scene/3d/physics_body.h"
#include "scene/3d/portal.h"
#include "scene/3d/position_3d.h"
-#include "scene/3d/quad.h"
#include "scene/3d/reflection_probe.h"
-#include "scene/3d/test_cube.h"
#include "scene/resources/environment.h"
#include "scene/3d/area.h"
-#include "scene/3d/baked_light_instance.h"
-#include "scene/3d/body_shape.h"
+
+#include "scene/3d/collision_shape.h"
#include "scene/3d/immediate_geometry.h"
#include "scene/3d/multimesh_instance.h"
#include "scene/3d/physics_joint.h"
@@ -271,11 +273,11 @@ void register_scene_types() {
ResourceLoader::add_resource_format_loader(resource_loader_theme);
bool default_theme_hidpi = GLOBAL_DEF("gui/theme/use_hidpi", false);
- GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/use_hidpi", PropertyInfo(Variant::BOOL, "gui/theme/use_hidpi", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
+ ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/use_hidpi", PropertyInfo(Variant::BOOL, "gui/theme/use_hidpi", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
String theme_path = GLOBAL_DEF("gui/theme/custom", "");
- GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/custom", PropertyInfo(Variant::STRING, "gui/theme/custom", PROPERTY_HINT_FILE, "*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
+ ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom", PropertyInfo(Variant::STRING, "gui/theme/custom", PROPERTY_HINT_FILE, "*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
String font_path = GLOBAL_DEF("gui/theme/custom_font", "");
- GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/custom_font", PropertyInfo(Variant::STRING, "gui/theme/custom_font", PROPERTY_HINT_FILE, "*.tres,*.res,*.fnt", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
+ ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom_font", PropertyInfo(Variant::STRING, "gui/theme/custom_font", PROPERTY_HINT_FILE, "*.tres,*.res,*.font", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
if (theme_path != String()) {
Ref<Theme> theme = ResourceLoader::load(theme_path);
@@ -359,9 +361,6 @@ void register_scene_types() {
OS::get_singleton()->yield(); //may take time to init
- ClassDB::register_virtual_class<ButtonArray>();
- ClassDB::register_class<HButtonArray>();
- ClassDB::register_class<VButtonArray>();
ClassDB::register_class<TextureProgress>();
ClassDB::register_class<ItemList>();
@@ -408,8 +407,11 @@ void register_scene_types() {
ClassDB::register_virtual_class<VisualInstance>();
ClassDB::register_class<Camera>();
ClassDB::register_class<Listener>();
+ ClassDB::register_class<ARVRCamera>();
+ ClassDB::register_class<ARVRController>();
+ ClassDB::register_class<ARVRAnchor>();
+ ClassDB::register_class<ARVROrigin>();
ClassDB::register_class<InterpolatedCamera>();
- ClassDB::register_class<TestCube>();
ClassDB::register_class<MeshInstance>();
ClassDB::register_class<ImmediateGeometry>();
ClassDB::register_class<Sprite3D>();
@@ -423,9 +425,8 @@ void register_scene_types() {
ClassDB::register_class<GIProbeData>();
ClassDB::register_class<AnimationTreePlayer>();
ClassDB::register_class<Portal>();
- //ClassDB::register_type<Particles>();
+ ClassDB::register_class<Particles>();
ClassDB::register_class<Position3D>();
- ClassDB::register_class<Quad>();
ClassDB::register_class<NavigationMeshInstance>();
ClassDB::register_class<NavigationMesh>();
ClassDB::register_class<Navigation>();
@@ -451,7 +452,7 @@ void register_scene_types() {
ClassDB::register_class<PathFollow>();
ClassDB::register_class<VisibilityNotifier>();
ClassDB::register_class<VisibilityEnabler>();
- ClassDB::register_class<BakedLight>();
+ // ClassDB::register_class<BakedLight>();
//ClassDB::register_type<BakedLightSampler>();
ClassDB::register_class<WorldEnvironment>();
ClassDB::register_class<RemoteTransform>();
@@ -471,11 +472,15 @@ void register_scene_types() {
ClassDB::register_class<MeshLibrary>();
AcceptDialog::set_swap_ok_cancel(GLOBAL_DEF("gui/common/swap_ok_cancel", bool(OS::get_singleton()->get_swap_ok_cancel())));
- ClassDB::register_class<CanvasItemMaterial>();
+ ClassDB::register_class<Shader>();
+ ClassDB::register_class<ShaderMaterial>();
ClassDB::register_virtual_class<CanvasItem>();
+ ClassDB::register_class<CanvasItemMaterial>();
+ SceneTree::add_idle_callback(CanvasItemMaterial::flush_changes);
+ CanvasItemMaterial::init_shaders();
ClassDB::register_class<Node2D>();
ClassDB::register_class<Particles2D>();
- ClassDB::register_class<ParticleAttractor2D>();
+ //ClassDB::register_class<ParticleAttractor2D>();
ClassDB::register_class<Sprite>();
//ClassDB::register_type<ViewportSprite>();
ClassDB::register_class<SpriteFrames>();
@@ -519,21 +524,29 @@ void register_scene_types() {
/* REGISTER RESOURCES */
ClassDB::register_virtual_class<Shader>();
- //ClassDB::register_virtual_type<ShaderGraph>();
- ClassDB::register_class<CanvasItemShader>();
-//ClassDB::register_type<CanvasItemShaderGraph>();
#ifndef _3D_DISABLED
- ClassDB::register_class<Mesh>();
+ ClassDB::register_virtual_class<Mesh>();
+ ClassDB::register_class<ArrayMesh>();
+ ClassDB::register_virtual_class<PrimitiveMesh>();
+ ClassDB::register_class<CapsuleMesh>();
+ ClassDB::register_class<CubeMesh>();
+ ClassDB::register_class<CylinderMesh>();
+ ClassDB::register_class<PlaneMesh>();
+ ClassDB::register_class<PrismMesh>();
+ ClassDB::register_class<QuadMesh>();
+ ClassDB::register_class<SphereMesh>();
ClassDB::register_virtual_class<Material>();
- ClassDB::register_class<FixedSpatialMaterial>();
- SceneTree::add_idle_callback(FixedSpatialMaterial::flush_changes);
- FixedSpatialMaterial::init_shaders();
+ ClassDB::register_class<SpatialMaterial>();
+ SceneTree::add_idle_callback(SpatialMaterial::flush_changes);
+ SpatialMaterial::init_shaders();
+
+ ClassDB::register_class<ParticlesMaterial>();
+ SceneTree::add_idle_callback(ParticlesMaterial::flush_changes);
+ ParticlesMaterial::init_shaders();
+
//ClassDB::register_type<ShaderMaterial>();
ClassDB::register_class<RoomBounds>();
- //ClassDB::register_type<MaterialShaderGraph>();
- ClassDB::register_class<SpatialShader>();
- ClassDB::register_class<ParticlesShader>();
ClassDB::register_class<MultiMesh>();
ClassDB::register_class<MeshLibrary>();
@@ -553,21 +566,26 @@ void register_scene_types() {
OS::get_singleton()->yield(); //may take time to init
+ ClassDB::register_class<SpatialVelocityTracker>();
#endif
ClassDB::register_class<World>();
ClassDB::register_class<Environment>();
ClassDB::register_class<World2D>();
ClassDB::register_virtual_class<Texture>();
- ClassDB::register_virtual_class<SkyBox>();
- ClassDB::register_class<ImageSkyBox>();
+ ClassDB::register_virtual_class<Sky>();
+ ClassDB::register_class<PanoramaSky>();
+ ClassDB::register_class<ProceduralSky>();
ClassDB::register_class<StreamTexture>();
ClassDB::register_class<ImageTexture>();
ClassDB::register_class<AtlasTexture>();
ClassDB::register_class<LargeTexture>();
+ ClassDB::register_class<CurveTexture>();
+ ClassDB::register_class<GradientTexture>();
ClassDB::register_class<CubeMap>();
ClassDB::register_class<Animation>();
ClassDB::register_virtual_class<Font>();
ClassDB::register_class<BitmapFont>();
+ ClassDB::register_class<Curve>();
ClassDB::register_class<DynamicFontData>();
ClassDB::register_class<DynamicFont>();
@@ -579,11 +597,13 @@ void register_scene_types() {
ClassDB::register_class<PolygonPathFinder>();
ClassDB::register_class<BitMap>();
- ClassDB::register_class<ColorRamp>();
+ ClassDB::register_class<Gradient>();
OS::get_singleton()->yield(); //may take time to init
- ClassDB::register_class<AudioPlayer>();
+ ClassDB::register_class<AudioStreamPlayer>();
+ ClassDB::register_class<AudioStreamPlayer2D>();
+ ClassDB::register_class<AudioStreamPlayer3D>();
ClassDB::register_virtual_class<VideoStream>();
ClassDB::register_class<AudioStreamSample>();
@@ -614,6 +634,13 @@ void register_scene_types() {
ClassDB::register_class<SceneTree>();
ClassDB::register_virtual_class<SceneTreeTimer>(); //sorry, you can't create it
+#ifndef DISABLE_DEPRECATED
+ ClassDB::add_compatibility_class("ImageSkyBox", "PanoramaSky");
+ ClassDB::add_compatibility_class("FixedSpatialMaterial", "SpatialMaterial");
+ ClassDB::add_compatibility_class("Mesh", "ArrayMesh");
+
+#endif
+
OS::get_singleton()->yield(); //may take time to init
resource_saver_text = memnew(ResourceFormatSaverText);
@@ -651,6 +678,8 @@ void unregister_scene_types() {
memdelete(resource_loader_text);
}
- FixedSpatialMaterial::finish_shaders();
+ SpatialMaterial::finish_shaders();
+ ParticlesMaterial::finish_shaders();
+ CanvasItemMaterial::finish_shaders();
SceneStringNames::free();
}
diff --git a/scene/register_scene_types.h b/scene/register_scene_types.h
index 090254c5f7..dee0af9063 100644
--- a/scene/register_scene_types.h
+++ b/scene/register_scene_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/SCsub b/scene/resources/SCsub
index 60b16cd0d4..2ad90247a7 100644
--- a/scene/resources/SCsub
+++ b/scene/resources/SCsub
@@ -3,7 +3,6 @@
Import('env')
env.add_source_files(env.scene_sources, "*.cpp")
-env.add_source_files(env.scene_sources, "*.c")
Export('env')
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index 4fddd55e20..a2ff45c623 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -732,7 +733,7 @@ int Animation::track_find_key(int p_track, float p_time, bool p_exact) const {
return -1;
}
-void Animation::track_insert_key(int p_track, float p_time, const Variant &p_value, float p_transition) {
+void Animation::track_insert_key(int p_track, float p_time, const Variant &p_key, float p_transition) {
ERR_FAIL_INDEX(p_track, tracks.size());
Track *t = tracks[p_track];
@@ -741,7 +742,7 @@ void Animation::track_insert_key(int p_track, float p_time, const Variant &p_val
case TYPE_TRANSFORM: {
- Dictionary d = p_value;
+ Dictionary d = p_key;
Vector3 loc;
if (d.has("loc"))
loc = d["loc"];
@@ -765,7 +766,7 @@ void Animation::track_insert_key(int p_track, float p_time, const Variant &p_val
TKey<Variant> k;
k.time = p_time;
k.transition = p_transition;
- k.value = p_value;
+ k.value = p_key;
_insert(p_time, vt->values, k);
} break;
@@ -773,9 +774,9 @@ void Animation::track_insert_key(int p_track, float p_time, const Variant &p_val
MethodTrack *mt = static_cast<MethodTrack *>(t);
- ERR_FAIL_COND(p_value.get_type() != Variant::DICTIONARY);
+ ERR_FAIL_COND(p_key.get_type() != Variant::DICTIONARY);
- Dictionary d = p_value;
+ Dictionary d = p_key;
ERR_FAIL_COND(!d.has("method") || d["method"].get_type() != Variant::STRING);
ERR_FAIL_COND(!d.has("args") || !d["args"].is_array());
@@ -1132,7 +1133,7 @@ Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a
Rect2 pb = p_post_b;
return Rect2(
- a.pos.cubic_interpolate(b.pos, pa.pos, pb.pos, p_c),
+ a.position.cubic_interpolate(b.position, pa.position, pb.position, p_c),
a.size.cubic_interpolate(b.size, pa.size, pb.size, p_c));
} break;
@@ -1164,7 +1165,7 @@ Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a
Rect3 pb = p_post_b;
return Rect3(
- a.pos.cubic_interpolate(b.pos, pa.pos, pb.pos, p_c),
+ a.position.cubic_interpolate(b.position, pa.position, pb.position, p_c),
a.size.cubic_interpolate(b.size, pa.size, pb.size, p_c));
} break;
default: {
@@ -1760,8 +1761,8 @@ bool Animation::_transform_track_optimize_key(const TKey<TransformKey> &t0, cons
Vector3 v02, v01;
real_t a02, a01;
- r02.get_axis_and_angle(v02, a02);
- r01.get_axis_and_angle(v01, a01);
+ r02.get_axis_angle(v02, a02);
+ r01.get_axis_angle(v01, a01);
if (Math::abs(a02) > p_max_optimizable_angle)
return false;
@@ -1870,7 +1871,7 @@ bool Animation::_transform_track_optimize_key(const TKey<TransformKey> &t0, cons
return erase;
}
-void Animation::_transform_track_optimize(int p_idx, float p_alowed_linear_err, float p_alowed_angular_err, float p_max_optimizable_angle) {
+void Animation::_transform_track_optimize(int p_idx, float p_allowed_linear_err, float p_allowed_angular_err, float p_max_optimizable_angle) {
ERR_FAIL_INDEX(p_idx, tracks.size());
ERR_FAIL_COND(tracks[p_idx]->type != TYPE_TRANSFORM);
@@ -1886,12 +1887,12 @@ void Animation::_transform_track_optimize(int p_idx, float p_alowed_linear_err,
TKey<TransformKey> &t1 = tt->transforms[i];
TKey<TransformKey> &t2 = tt->transforms[i + 1];
- bool erase = _transform_track_optimize_key(t0, t1, t2, p_alowed_linear_err, p_alowed_angular_err, p_max_optimizable_angle, norm);
+ bool erase = _transform_track_optimize_key(t0, t1, t2, p_allowed_linear_err, p_allowed_angular_err, p_max_optimizable_angle, norm);
if (erase && !prev_erased) {
norm = (t2.value.loc - t1.value.loc).normalized();
}
- if (prev_erased && !_transform_track_optimize_key(t0, first_erased, t2, p_alowed_linear_err, p_alowed_angular_err, p_max_optimizable_angle, norm)) {
+ if (prev_erased && !_transform_track_optimize_key(t0, first_erased, t2, p_allowed_linear_err, p_allowed_angular_err, p_max_optimizable_angle, norm)) {
//avoid error to go beyond first erased key
erase = false;
}
@@ -1913,12 +1914,12 @@ void Animation::_transform_track_optimize(int p_idx, float p_alowed_linear_err,
}
}
-void Animation::optimize(float p_allowed_linear_err, float p_allowed_angular_err, float p_angle_max) {
+void Animation::optimize(float p_allowed_linear_err, float p_allowed_angular_err, float p_max_optimizable_angle) {
for (int i = 0; i < tracks.size(); i++) {
if (tracks[i]->type == TYPE_TRANSFORM)
- _transform_track_optimize(i, p_allowed_linear_err, p_allowed_angular_err, p_angle_max);
+ _transform_track_optimize(i, p_allowed_linear_err, p_allowed_angular_err, p_max_optimizable_angle);
}
}
diff --git a/scene/resources/animation.h b/scene/resources/animation.h
index 57ab8b282f..27c58aba8c 100644
--- a/scene/resources/animation.h
+++ b/scene/resources/animation.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,7 +37,7 @@
class Animation : public Resource {
GDCLASS(Animation, Resource);
- RES_BASE_EXTENSION("anm");
+ RES_BASE_EXTENSION("anim");
public:
enum TrackType {
@@ -211,7 +212,7 @@ private:
}
bool _transform_track_optimize_key(const TKey<TransformKey> &t0, const TKey<TransformKey> &t1, const TKey<TransformKey> &t2, float p_alowed_linear_err, float p_alowed_angular_err, float p_max_optimizable_angle, const Vector3 &p_norm);
- void _transform_track_optimize(int p_idx, float p_allowed_err = 0.05, float p_alowed_angular_err = 0.01, float p_max_optimizable_angle = Math_PI * 0.125);
+ void _transform_track_optimize(int p_idx, float p_allowed_linear_err = 0.05, float p_allowed_angular_err = 0.01, float p_max_optimizable_angle = Math_PI * 0.125);
protected:
bool _set(const StringName &p_name, const Variant &p_value);
diff --git a/scene/resources/audio_stream_resampled.cpp b/scene/resources/audio_stream_resampled.cpp
index 1c0c725ef9..1b1d6f8587 100644
--- a/scene/resources/audio_stream_resampled.cpp
+++ b/scene/resources/audio_stream_resampled.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "audio_stream_resampled.h"
-#include "global_config.h"
+#include "project_settings.h"
#if 0
int AudioStreamResampled::get_channel_count() const {
diff --git a/scene/resources/audio_stream_resampled.h b/scene/resources/audio_stream_resampled.h
index 7ceb6cef84..53fa3bd0b9 100644
--- a/scene/resources/audio_stream_resampled.h
+++ b/scene/resources/audio_stream_resampled.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp
index 8e40911887..c8f6007e60 100644
--- a/scene/resources/audio_stream_sample.cpp
+++ b/scene/resources/audio_stream_sample.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,8 +39,6 @@ void AudioStreamPlaybackSample::start(float p_from_pos) {
ima_adpcm[i].last_nibble = -1;
ima_adpcm[i].loop_pos = 0x7FFFFFFF;
ima_adpcm[i].window_ofs = 0;
- ima_adpcm[i].ptr = (const uint8_t *)base->data;
- ima_adpcm[i].ptr += AudioStreamSample::DATA_PAD;
}
seek_pos(p_from_pos);
@@ -121,7 +120,8 @@ void AudioStreamPlaybackSample::do_resample(const Depth *p_src, AudioFrame *p_ds
int16_t nibble, diff, step;
ima_adpcm[i].last_nibble++;
- const uint8_t *src_ptr = ima_adpcm[i].ptr;
+ const uint8_t *src_ptr = (const uint8_t *)base->data;
+ src_ptr += AudioStreamSample::DATA_PAD;
uint8_t nbb = src_ptr[(ima_adpcm[i].last_nibble >> 1) * (is_stereo ? 2 : 1) + i];
nibble = (ima_adpcm[i].last_nibble & 1) ? (nbb >> 4) : (nbb & 0xF);
@@ -231,7 +231,7 @@ void AudioStreamPlaybackSample::mix(AudioFrame *p_buffer, float p_rate_scale, in
/* some 64-bit fixed point precaches */
- int64_t loop_begin_fp = ((int64_t)len << MIX_FRAC_BITS);
+ int64_t loop_begin_fp = ((int64_t)base->loop_begin << MIX_FRAC_BITS);
int64_t loop_end_fp = ((int64_t)base->loop_end << MIX_FRAC_BITS);
int64_t length_fp = ((int64_t)len << MIX_FRAC_BITS);
int64_t begin_limit = (base->loop_mode != AudioStreamSample::LOOP_DISABLED) ? loop_begin_fp : 0;
diff --git a/scene/resources/audio_stream_sample.h b/scene/resources/audio_stream_sample.h
index d5d1ae79c0..680f037f15 100644
--- a/scene/resources/audio_stream_sample.h
+++ b/scene/resources/audio_stream_sample.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -52,7 +53,6 @@ class AudioStreamPlaybackSample : public AudioStreamPlayback {
int32_t last_nibble;
int32_t loop_pos;
int32_t window_ofs;
- const uint8_t *ptr;
} ima_adpcm[2];
int64_t offset;
@@ -83,7 +83,7 @@ public:
class AudioStreamSample : public AudioStream {
GDCLASS(AudioStreamSample, AudioStream)
- RES_BASE_EXTENSION("smp")
+ RES_BASE_EXTENSION("sample")
public:
enum Format {
diff --git a/scene/resources/baked_light.cpp b/scene/resources/baked_light.cpp
deleted file mode 100644
index 7fa930fd58..0000000000
--- a/scene/resources/baked_light.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/*************************************************************************/
-/* baked_light.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 "baked_light.h"
-#include "servers/visual_server.h"
diff --git a/scene/resources/baked_light.h b/scene/resources/baked_light.h
deleted file mode 100644
index 7dee40b34e..0000000000
--- a/scene/resources/baked_light.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*************************************************************************/
-/* baked_light.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 BAKED_LIGHT_H
-#define BAKED_LIGHT_H
-
-#include "resource.h"
-#include "scene/resources/texture.h"
-
-#endif // BAKED_LIGHT_H
diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp
index 277acad905..a473067937 100644
--- a/scene/resources/bit_mask.cpp
+++ b/scene/resources/bit_mask.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -40,16 +41,16 @@ void BitMap::create(const Size2 &p_size) {
zeromem(bitmask.ptr(), bitmask.size());
}
-void BitMap::create_from_image_alpha(const Image &p_image) {
+void BitMap::create_from_image_alpha(const Ref<Image> &p_image) {
- ERR_FAIL_COND(p_image.empty());
- Image img = p_image;
- img.convert(Image::FORMAT_LA8);
- ERR_FAIL_COND(img.get_format() != Image::FORMAT_LA8);
+ ERR_FAIL_COND(p_image.is_null() || p_image->empty());
+ Ref<Image> img = p_image->duplicate();
+ img->convert(Image::FORMAT_LA8);
+ ERR_FAIL_COND(img->get_format() != Image::FORMAT_LA8);
- create(Size2(img.get_width(), img.get_height()));
+ create(Size2(img->get_width(), img->get_height()));
- PoolVector<uint8_t>::Read r = img.get_data().read();
+ PoolVector<uint8_t>::Read r = img->get_data().read();
uint8_t *w = bitmask.ptr();
for (int i = 0; i < width * height; i++) {
@@ -66,9 +67,9 @@ void BitMap::set_bit_rect(const Rect2 &p_rect, bool p_value) {
Rect2i current = Rect2i(0, 0, width, height).clip(p_rect);
uint8_t *data = bitmask.ptr();
- for (int i = current.pos.x; i < current.pos.x + current.size.x; i++) {
+ for (int i = current.position.x; i < current.position.x + current.size.x; i++) {
- for (int j = current.pos.y; j < current.pos.y + current.size.y; j++) {
+ for (int j = current.position.y; j < current.position.y + current.size.y; j++) {
int ofs = width * j + i;
int bbyte = ofs / 8;
diff --git a/scene/resources/bit_mask.h b/scene/resources/bit_mask.h
index 3cee2279b8..5ab7a3134d 100644
--- a/scene/resources/bit_mask.h
+++ b/scene/resources/bit_mask.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,7 @@
#ifndef BIT_MASK_H
#define BIT_MASK_H
+#include "image.h"
#include "io/resource_loader.h"
#include "resource.h"
@@ -50,7 +52,7 @@ protected:
public:
void create(const Size2 &p_size);
- void create_from_image_alpha(const Image &p_image);
+ void create_from_image_alpha(const Ref<Image> &p_image);
void set_bit(const Point2 &p_pos, bool p_value);
bool get_bit(const Point2 &p_pos) const;
diff --git a/scene/resources/bounds.cpp b/scene/resources/bounds.cpp
index 974ff76cd0..b088426013 100644
--- a/scene/resources/bounds.cpp
+++ b/scene/resources/bounds.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/bounds.h b/scene/resources/bounds.h
index 62e1b8e0ef..8c0d1dcf6e 100644
--- a/scene/resources/bounds.h
+++ b/scene/resources/bounds.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/box_shape.cpp b/scene/resources/box_shape.cpp
index 1e9991d7dc..d5c25b718e 100644
--- a/scene/resources/box_shape.cpp
+++ b/scene/resources/box_shape.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,8 +34,8 @@ Vector<Vector3> BoxShape::_gen_debug_mesh_lines() {
Vector<Vector3> lines;
Rect3 aabb;
- aabb.pos = -get_extents();
- aabb.size = aabb.pos * -2;
+ aabb.position = -get_extents();
+ aabb.size = aabb.position * -2;
for (int i = 0; i < 12; i++) {
Vector3 a, b;
diff --git a/scene/resources/box_shape.h b/scene/resources/box_shape.h
index 2bab6d9b8a..fdf1e98020 100644
--- a/scene/resources/box_shape.h
+++ b/scene/resources/box_shape.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/canvas.cpp b/scene/resources/canvas.cpp
index dd0375b765..b6a909f3fa 100644
--- a/scene/resources/canvas.cpp
+++ b/scene/resources/canvas.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/canvas.h b/scene/resources/canvas.h
index 1d3775c30c..331a997914 100644
--- a/scene/resources/canvas.h
+++ b/scene/resources/canvas.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/capsule_shape.cpp b/scene/resources/capsule_shape.cpp
index 1aa3fee0ca..1fcc9da5b6 100644
--- a/scene/resources/capsule_shape.cpp
+++ b/scene/resources/capsule_shape.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/capsule_shape.h b/scene/resources/capsule_shape.h
index ecffdd8ce7..2864e7e23f 100644
--- a/scene/resources/capsule_shape.h
+++ b/scene/resources/capsule_shape.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp
index d24640e43d..20177692a1 100644
--- a/scene/resources/capsule_shape_2d.cpp
+++ b/scene/resources/capsule_shape_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -79,7 +80,7 @@ Rect2 CapsuleShape2D::get_rect() const {
Vector2 he = Point2(get_radius(), get_radius() + get_height() * 0.5);
Rect2 rect;
- rect.pos = -he;
+ rect.position = -he;
rect.size = he * 2.0;
return rect;
}
diff --git a/scene/resources/capsule_shape_2d.h b/scene/resources/capsule_shape_2d.h
index 05d819c1d5..93e7d846a4 100644
--- a/scene/resources/capsule_shape_2d.h
+++ b/scene/resources/capsule_shape_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp
index 2271a3ad93..1b7e09ddfb 100644
--- a/scene/resources/circle_shape_2d.cpp
+++ b/scene/resources/circle_shape_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -57,7 +58,7 @@ void CircleShape2D::_bind_methods() {
Rect2 CircleShape2D::get_rect() const {
Rect2 rect;
- rect.pos = -Point2(get_radius(), get_radius());
+ rect.position = -Point2(get_radius(), get_radius());
rect.size = Point2(get_radius(), get_radius()) * 2.0;
return rect;
}
diff --git a/scene/resources/circle_shape_2d.h b/scene/resources/circle_shape_2d.h
index 11fdc51f09..a4a4601e66 100644
--- a/scene/resources/circle_shape_2d.h
+++ b/scene/resources/circle_shape_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/color_ramp.cpp b/scene/resources/color_ramp.cpp
index 2c20ad527b..1825225abd 100644
--- a/scene/resources/color_ramp.cpp
+++ b/scene/resources/color_ramp.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,7 +36,7 @@
#define COLOR_RAMP_SET_OFFSETS "set_offsets"
#define COLOR_RAMP_SET_COLORS "set_colors"
-ColorRamp::ColorRamp() {
+Gradient::Gradient() {
//Set initial color ramp transition from black to white
points.resize(2);
points[0].color = Color(0, 0, 0, 1);
@@ -45,35 +46,35 @@ ColorRamp::ColorRamp() {
is_sorted = true;
}
-ColorRamp::~ColorRamp() {
+Gradient::~Gradient() {
}
-void ColorRamp::_bind_methods() {
+void Gradient::_bind_methods() {
- 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(D_METHOD("add_point", "offset", "color"), &Gradient::add_point);
+ ClassDB::bind_method(D_METHOD("remove_point", "offset"), &Gradient::remove_point);
- 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(D_METHOD("set_offset", "point", "offset"), &Gradient::set_offset);
+ ClassDB::bind_method(D_METHOD("get_offset", "point"), &Gradient::get_offset);
- 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(D_METHOD("set_color", "point", "color"), &Gradient::set_color);
+ ClassDB::bind_method(D_METHOD("get_color", "point"), &Gradient::get_color);
- ClassDB::bind_method(D_METHOD("interpolate", "offset"), &ColorRamp::get_color_at_offset);
+ ClassDB::bind_method(D_METHOD("interpolate", "offset"), &Gradient::get_color_at_offset);
- ClassDB::bind_method(D_METHOD("get_point_count"), &ColorRamp::get_points_count);
+ ClassDB::bind_method(D_METHOD("get_point_count"), &Gradient::get_points_count);
- 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(D_METHOD(COLOR_RAMP_SET_OFFSETS, "offsets"), &Gradient::set_offsets);
+ ClassDB::bind_method(D_METHOD(COLOR_RAMP_GET_OFFSETS), &Gradient::get_offsets);
- 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);
+ ClassDB::bind_method(D_METHOD(COLOR_RAMP_SET_COLORS, "colors"), &Gradient::set_colors);
+ ClassDB::bind_method(D_METHOD(COLOR_RAMP_GET_COLORS), &Gradient::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 {
+Vector<float> Gradient::get_offsets() const {
Vector<float> offsets;
offsets.resize(points.size());
for (int i = 0; i < points.size(); i++) {
@@ -82,7 +83,7 @@ Vector<float> ColorRamp::get_offsets() const {
return offsets;
}
-Vector<Color> ColorRamp::get_colors() const {
+Vector<Color> Gradient::get_colors() const {
Vector<Color> colors;
colors.resize(points.size());
for (int i = 0; i < points.size(); i++) {
@@ -91,7 +92,7 @@ Vector<Color> ColorRamp::get_colors() const {
return colors;
}
-void ColorRamp::set_offsets(const Vector<float> &p_offsets) {
+void Gradient::set_offsets(const Vector<float> &p_offsets) {
points.resize(p_offsets.size());
for (int i = 0; i < points.size(); i++) {
points[i].offset = p_offsets[i];
@@ -100,7 +101,7 @@ void ColorRamp::set_offsets(const Vector<float> &p_offsets) {
emit_signal(CoreStringNames::get_singleton()->changed);
}
-void ColorRamp::set_colors(const Vector<Color> &p_colors) {
+void Gradient::set_colors(const Vector<Color> &p_colors) {
if (points.size() < p_colors.size())
is_sorted = false;
points.resize(p_colors.size());
@@ -110,11 +111,11 @@ void ColorRamp::set_colors(const Vector<Color> &p_colors) {
emit_signal(CoreStringNames::get_singleton()->changed);
}
-Vector<ColorRamp::Point> &ColorRamp::get_points() {
+Vector<Gradient::Point> &Gradient::get_points() {
return points;
}
-void ColorRamp::add_point(float p_offset, const Color &p_color) {
+void Gradient::add_point(float p_offset, const Color &p_color) {
Point p;
p.offset = p_offset;
@@ -125,7 +126,7 @@ void ColorRamp::add_point(float p_offset, const Color &p_color) {
emit_signal(CoreStringNames::get_singleton()->changed);
}
-void ColorRamp::remove_point(int p_index) {
+void Gradient::remove_point(int p_index) {
ERR_FAIL_INDEX(p_index, points.size());
ERR_FAIL_COND(points.size() <= 2);
@@ -133,13 +134,13 @@ void ColorRamp::remove_point(int p_index) {
emit_signal(CoreStringNames::get_singleton()->changed);
}
-void ColorRamp::set_points(Vector<ColorRamp::Point> &p_points) {
+void Gradient::set_points(Vector<Gradient::Point> &p_points) {
points = p_points;
is_sorted = false;
emit_signal(CoreStringNames::get_singleton()->changed);
}
-void ColorRamp::set_offset(int pos, const float offset) {
+void Gradient::set_offset(int pos, const float offset) {
if (points.size() <= pos)
points.resize(pos + 1);
points[pos].offset = offset;
@@ -147,13 +148,13 @@ void ColorRamp::set_offset(int pos, const float offset) {
emit_signal(CoreStringNames::get_singleton()->changed);
}
-float ColorRamp::get_offset(int pos) const {
+float Gradient::get_offset(int pos) const {
if (points.size() > pos)
return points[pos].offset;
return 0; //TODO: Maybe throw some error instead?
}
-void ColorRamp::set_color(int pos, const Color &color) {
+void Gradient::set_color(int pos, const Color &color) {
if (points.size() <= pos) {
points.resize(pos + 1);
is_sorted = false;
@@ -162,12 +163,12 @@ void ColorRamp::set_color(int pos, const Color &color) {
emit_signal(CoreStringNames::get_singleton()->changed);
}
-Color ColorRamp::get_color(int pos) const {
+Color Gradient::get_color(int pos) const {
if (points.size() > pos)
return points[pos].color;
return Color(0, 0, 0, 1); //TODO: Maybe throw some error instead?
}
-int ColorRamp::get_points_count() const {
+int Gradient::get_points_count() const {
return points.size();
}
diff --git a/scene/resources/color_ramp.h b/scene/resources/color_ramp.h
index 78c88c3270..d9f14205bb 100644
--- a/scene/resources/color_ramp.h
+++ b/scene/resources/color_ramp.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,9 +32,9 @@
#include "resource.h"
-class ColorRamp : public Resource {
- GDCLASS(ColorRamp, Resource);
- OBJ_SAVE_TYPE(ColorRamp);
+class Gradient : public Resource {
+ GDCLASS(Gradient, Resource);
+ OBJ_SAVE_TYPE(Gradient);
public:
struct Point {
@@ -53,13 +54,13 @@ protected:
static void _bind_methods();
public:
- ColorRamp();
- virtual ~ColorRamp();
+ Gradient();
+ virtual ~Gradient();
void add_point(float p_offset, const Color &p_color);
void remove_point(int p_index);
- void set_points(Vector<Point> &points);
+ void set_points(Vector<Point> &p_points);
Vector<Point> &get_points();
void set_offset(int pos, const float offset);
@@ -68,10 +69,10 @@ public:
void set_color(int pos, const Color &color);
Color get_color(int pos) const;
- void set_offsets(const Vector<float> &offsets);
+ void set_offsets(const Vector<float> &p_offsets);
Vector<float> get_offsets() const;
- void set_colors(const Vector<Color> &colors);
+ void set_colors(const Vector<Color> &p_colors);
Vector<Color> get_colors() const;
_FORCE_INLINE_ Color get_color_at_offset(float p_offset) {
diff --git a/scene/resources/concave_polygon_shape.cpp b/scene/resources/concave_polygon_shape.cpp
index 0031580153..47cc49c631 100644
--- a/scene/resources/concave_polygon_shape.cpp
+++ b/scene/resources/concave_polygon_shape.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/concave_polygon_shape.h b/scene/resources/concave_polygon_shape.h
index f048a4d151..a8f9d50674 100644
--- a/scene/resources/concave_polygon_shape.h
+++ b/scene/resources/concave_polygon_shape.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp
index 04a69d9c8e..b8c931421e 100644
--- a/scene/resources/concave_polygon_shape_2d.cpp
+++ b/scene/resources/concave_polygon_shape_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -67,7 +68,7 @@ Rect2 ConcavePolygonShape2D::get_rect() const {
PoolVector<Vector2>::Read r = s.read();
for (int i = 0; i < len; i++) {
if (i == 0)
- rect.pos = r[i];
+ rect.position = r[i];
else
rect.expand_to(r[i]);
}
diff --git a/scene/resources/concave_polygon_shape_2d.h b/scene/resources/concave_polygon_shape_2d.h
index 23c602980c..d4c102e0d6 100644
--- a/scene/resources/concave_polygon_shape_2d.h
+++ b/scene/resources/concave_polygon_shape_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/convex_polygon_shape.cpp b/scene/resources/convex_polygon_shape.cpp
index 350c4c2d86..10e92b43ae 100644
--- a/scene/resources/convex_polygon_shape.cpp
+++ b/scene/resources/convex_polygon_shape.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/convex_polygon_shape.h b/scene/resources/convex_polygon_shape.h
index 6701c41f0f..4340b0ef7c 100644
--- a/scene/resources/convex_polygon_shape.h
+++ b/scene/resources/convex_polygon_shape.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp
index 311614b7c1..e13f7faf70 100644
--- a/scene/resources/convex_polygon_shape_2d.cpp
+++ b/scene/resources/convex_polygon_shape_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -77,7 +78,7 @@ Rect2 ConvexPolygonShape2D::get_rect() const {
Rect2 rect;
for (int i = 0; i < points.size(); i++) {
if (i == 0)
- rect.pos = points[i];
+ rect.position = points[i];
else
rect.expand_to(points[i]);
}
diff --git a/scene/resources/convex_polygon_shape_2d.h b/scene/resources/convex_polygon_shape_2d.h
index edb302ba5e..ba4a5ae8aa 100644
--- a/scene/resources/convex_polygon_shape_2d.h
+++ b/scene/resources/convex_polygon_shape_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp
index f85220ac23..fe0759fcba 100644
--- a/scene/resources/curve.cpp
+++ b/scene/resources/curve.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -379,6 +380,487 @@ Curve2D::Curve2D()
#endif
+const char *Curve::SIGNAL_RANGE_CHANGED = "range_changed";
+
+Curve::Curve() {
+ _bake_resolution = 100;
+ _baked_cache_dirty = false;
+ _min_value = 0;
+ _max_value = 1;
+}
+
+int Curve::add_point(Vector2 p_pos, real_t left_tangent, real_t right_tangent, TangentMode left_mode, TangentMode right_mode) {
+ // Add a point and preserve order
+
+ // Curve bounds is in 0..1
+ if (p_pos.x > MAX_X)
+ p_pos.x = MAX_X;
+ else if (p_pos.x < MIN_X)
+ p_pos.x = MIN_X;
+
+ int ret = -1;
+
+ if (_points.size() == 0) {
+ _points.push_back(Point(p_pos, left_tangent, right_tangent, left_mode, right_mode));
+ ret = 0;
+
+ } else if (_points.size() == 1) {
+ // TODO Is the `else` able to handle this block already?
+
+ real_t diff = p_pos.x - _points[0].pos.x;
+
+ if (diff > 0) {
+ _points.push_back(Point(p_pos, left_tangent, right_tangent, left_mode, right_mode));
+ ret = 1;
+ } else {
+ _points.insert(0, Point(p_pos, left_tangent, right_tangent, left_mode, right_mode));
+ ret = 0;
+ }
+
+ } else {
+
+ int i = get_index(p_pos.x);
+
+ int nearest_index = i;
+ if (i + 1 < _points.size()) {
+ real_t diff0 = p_pos.x - _points[i].pos.x;
+ real_t diff1 = _points[i + 1].pos.x - p_pos.x;
+
+ if (diff1 < diff0)
+ nearest_index = i + 1;
+ }
+
+ if (i == 0 && p_pos.x < _points[0].pos.x) {
+ // Insert before anything else
+ _points.insert(0, Point(p_pos, left_tangent, right_tangent, left_mode, right_mode));
+ ret = 0;
+ } else {
+ // Insert between i and i+1
+ ++i;
+ _points.insert(i, Point(p_pos, left_tangent, right_tangent, left_mode, right_mode));
+ ret = i;
+ }
+ }
+
+ update_auto_tangents(ret);
+
+ mark_dirty();
+
+ return ret;
+}
+
+int Curve::get_index(real_t offset) const {
+
+ // Lower-bound float binary search
+
+ int imin = 0;
+ int imax = _points.size() - 1;
+
+ while (imax - imin > 1) {
+ int m = (imin + imax) / 2;
+
+ real_t a = _points[m].pos.x;
+ real_t b = _points[m + 1].pos.x;
+
+ if (a < offset && b < offset) {
+ imin = m;
+
+ } else if (a > offset) {
+ imax = m;
+
+ } else {
+ return m;
+ }
+ }
+
+ // Will happen if the offset is out of bounds
+ if (offset > _points[imax].pos.x)
+ return imax;
+ return imin;
+}
+
+void Curve::clean_dupes() {
+
+ bool dirty = false;
+
+ for (int i = 1; i < _points.size(); ++i) {
+ real_t diff = _points[i - 1].pos.x - _points[i].pos.x;
+ if (diff <= CMP_EPSILON) {
+ _points.remove(i);
+ --i;
+ dirty = true;
+ }
+ }
+
+ if (dirty)
+ mark_dirty();
+}
+
+void Curve::set_point_left_tangent(int i, real_t tangent) {
+ ERR_FAIL_INDEX(i, _points.size());
+ _points[i].left_tangent = tangent;
+ _points[i].left_mode = TANGENT_FREE;
+ mark_dirty();
+}
+
+void Curve::set_point_right_tangent(int i, real_t tangent) {
+ ERR_FAIL_INDEX(i, _points.size());
+ _points[i].right_tangent = tangent;
+ _points[i].right_mode = TANGENT_FREE;
+ mark_dirty();
+}
+
+void Curve::set_point_left_mode(int i, TangentMode p_mode) {
+ ERR_FAIL_INDEX(i, _points.size());
+ _points[i].left_mode = p_mode;
+ if (i > 0) {
+ if (p_mode == TANGENT_LINEAR) {
+ Vector2 v = (_points[i - 1].pos - _points[i].pos).normalized();
+ _points[i].left_tangent = v.y / v.x;
+ }
+ }
+ mark_dirty();
+}
+
+void Curve::set_point_right_mode(int i, TangentMode p_mode) {
+ ERR_FAIL_INDEX(i, _points.size());
+ _points[i].right_mode = p_mode;
+ if (i + 1 < _points.size()) {
+ if (p_mode == TANGENT_LINEAR) {
+ Vector2 v = (_points[i + 1].pos - _points[i].pos).normalized();
+ _points[i].right_tangent = v.y / v.x;
+ }
+ }
+ mark_dirty();
+}
+
+real_t Curve::get_point_left_tangent(int i) const {
+ ERR_FAIL_INDEX_V(i, _points.size(), 0);
+ return _points[i].left_tangent;
+}
+
+real_t Curve::get_point_right_tangent(int i) const {
+ ERR_FAIL_INDEX_V(i, _points.size(), 0);
+ return _points[i].right_tangent;
+}
+
+Curve::TangentMode Curve::get_point_left_mode(int i) const {
+ ERR_FAIL_INDEX_V(i, _points.size(), TANGENT_FREE);
+ return _points[i].left_mode;
+}
+
+Curve::TangentMode Curve::get_point_right_mode(int i) const {
+ ERR_FAIL_INDEX_V(i, _points.size(), TANGENT_FREE);
+ return _points[i].right_mode;
+}
+
+void Curve::remove_point(int p_index) {
+ ERR_FAIL_INDEX(p_index, _points.size());
+ _points.remove(p_index);
+ mark_dirty();
+}
+
+void Curve::clear_points() {
+ _points.clear();
+ mark_dirty();
+}
+
+void Curve::set_point_value(int p_index, real_t pos) {
+ ERR_FAIL_INDEX(p_index, _points.size());
+ _points[p_index].pos.y = pos;
+ update_auto_tangents(p_index);
+ mark_dirty();
+}
+
+int Curve::set_point_offset(int p_index, float offset) {
+ ERR_FAIL_INDEX_V(p_index, _points.size(), -1);
+ Point p = _points[p_index];
+ remove_point(p_index);
+ int i = add_point(Vector2(offset, p.pos.y));
+ _points[i].left_tangent = p.left_tangent;
+ _points[i].right_tangent = p.right_tangent;
+ _points[i].left_mode = p.left_mode;
+ _points[i].right_mode = p.right_mode;
+ if (p_index != i)
+ update_auto_tangents(p_index);
+ update_auto_tangents(i);
+ return i;
+}
+
+Vector2 Curve::get_point_pos(int p_index) const {
+ ERR_FAIL_INDEX_V(p_index, _points.size(), Vector2(0, 0));
+ return _points[p_index].pos;
+}
+
+Curve::Point Curve::get_point(int p_index) const {
+ ERR_FAIL_INDEX_V(p_index, _points.size(), Point());
+ return _points[p_index];
+}
+
+void Curve::update_auto_tangents(int i) {
+
+ Point &p = _points[i];
+
+ if (i > 0) {
+ if (p.left_mode == TANGENT_LINEAR) {
+ Vector2 v = (_points[i - 1].pos - p.pos).normalized();
+ p.left_tangent = v.y / v.x;
+ }
+ if (_points[i - 1].right_mode == TANGENT_LINEAR) {
+ Vector2 v = (_points[i - 1].pos - p.pos).normalized();
+ _points[i - 1].right_tangent = v.y / v.x;
+ }
+ }
+
+ if (i + 1 < _points.size()) {
+ if (p.right_mode == TANGENT_LINEAR && i + 1 < _points.size()) {
+ Vector2 v = (_points[i + 1].pos - p.pos).normalized();
+ p.right_tangent = v.y / v.x;
+ }
+ if (_points[i + 1].left_mode == TANGENT_LINEAR) {
+ Vector2 v = (_points[i + 1].pos - p.pos).normalized();
+ _points[i + 1].left_tangent = v.y / v.x;
+ }
+ }
+}
+
+#define MIN_Y_RANGE 0.01
+
+void Curve::set_min_value(float p_min) {
+ if (p_min > _max_value - MIN_Y_RANGE)
+ _min_value = _max_value - MIN_Y_RANGE;
+ else
+ _min_value = p_min;
+ // Note: min and max are indicative values,
+ // it's still possible that existing points are out of range at this point.
+ emit_signal(SIGNAL_RANGE_CHANGED);
+}
+
+void Curve::set_max_value(float p_max) {
+ if (p_max < _min_value + MIN_Y_RANGE)
+ _max_value = _min_value + MIN_Y_RANGE;
+ else
+ _max_value = p_max;
+ emit_signal(SIGNAL_RANGE_CHANGED);
+}
+
+real_t Curve::interpolate(real_t offset) const {
+ if (_points.size() == 0)
+ return 0;
+ if (_points.size() == 1)
+ return _points[0].pos.y;
+
+ int i = get_index(offset);
+
+ if (i == _points.size() - 1)
+ return _points[i].pos.y;
+
+ real_t local = offset - _points[i].pos.x;
+
+ if (i == 0 && local <= 0)
+ return _points[0].pos.y;
+
+ return interpolate_local_nocheck(i, local);
+}
+
+real_t Curve::interpolate_local_nocheck(int index, real_t local_offset) const {
+
+ const Point a = _points[index];
+ const Point b = _points[index + 1];
+
+ // Cubic bezier
+
+ // ac-----bc
+ // / \
+ // / \ Here with a.right_tangent > 0
+ // / \ and b.left_tangent < 0
+ // / \
+ // a b
+ //
+ // |-d1--|-d2--|-d3--|
+ //
+ // d1 == d2 == d3 == d / 3
+
+ // Control points are chosen at equal distances
+ real_t d = b.pos.x - a.pos.x;
+ if (Math::abs(d) <= CMP_EPSILON)
+ return b.pos.y;
+ local_offset /= d;
+ d /= 3.0;
+ real_t yac = a.pos.y + d * a.right_tangent;
+ real_t ybc = b.pos.y - d * b.left_tangent;
+
+ real_t y = _bezier_interp(local_offset, a.pos.y, yac, ybc, b.pos.y);
+
+ return y;
+}
+
+void Curve::mark_dirty() {
+ _baked_cache_dirty = true;
+ emit_signal(CoreStringNames::get_singleton()->changed);
+}
+
+Array Curve::get_data() const {
+
+ Array output;
+ const unsigned int ELEMS = 5;
+ output.resize(_points.size() * ELEMS);
+
+ for (int j = 0; j < _points.size(); ++j) {
+
+ const Point p = _points[j];
+ int i = j * ELEMS;
+
+ output[i] = p.pos;
+ output[i + 1] = p.left_tangent;
+ output[i + 2] = p.right_tangent;
+ output[i + 3] = p.left_mode;
+ output[i + 4] = p.right_mode;
+ }
+
+ return output;
+}
+
+void Curve::set_data(Array input) {
+ const unsigned int ELEMS = 5;
+ ERR_FAIL_COND(input.size() % ELEMS != 0);
+
+ _points.clear();
+
+ // Validate input
+ for (int i = 0; i < input.size(); i += ELEMS) {
+ ERR_FAIL_COND(input[i].get_type() != Variant::VECTOR2);
+ ERR_FAIL_COND(!input[i + 1].is_num());
+ ERR_FAIL_COND(input[i + 2].get_type() != Variant::REAL);
+
+ ERR_FAIL_COND(input[i + 3].get_type() != Variant::INT);
+ int left_mode = input[i + 3];
+ ERR_FAIL_COND(left_mode < 0 || left_mode >= TANGENT_MODE_COUNT);
+
+ ERR_FAIL_COND(input[i + 4].get_type() != Variant::INT);
+ int right_mode = input[i + 4];
+ ERR_FAIL_COND(right_mode < 0 || right_mode >= TANGENT_MODE_COUNT);
+ }
+
+ _points.resize(input.size() / ELEMS);
+
+ for (int j = 0; j < _points.size(); ++j) {
+
+ Point &p = _points[j];
+ int i = j * ELEMS;
+
+ p.pos = input[i];
+ p.left_tangent = input[i + 1];
+ p.right_tangent = input[i + 2];
+ // TODO For some reason the compiler won't convert from Variant to enum
+ int left_mode = input[i + 3];
+ int right_mode = input[i + 4];
+ p.left_mode = (TangentMode)left_mode;
+ p.right_mode = (TangentMode)right_mode;
+ }
+
+ mark_dirty();
+}
+
+void Curve::bake() {
+ _baked_cache.clear();
+
+ _baked_cache.resize(_bake_resolution);
+
+ for (int i = 1; i < _bake_resolution - 1; ++i) {
+ real_t x = i / static_cast<real_t>(_bake_resolution);
+ real_t y = interpolate(x);
+ _baked_cache[i] = y;
+ }
+
+ if (_points.size() != 0) {
+ _baked_cache[0] = _points[0].pos.y;
+ _baked_cache[_baked_cache.size() - 1] = _points[_points.size() - 1].pos.y;
+ }
+
+ _baked_cache_dirty = false;
+}
+
+void Curve::set_bake_resolution(int p_resolution) {
+ ERR_FAIL_COND(p_resolution < 1);
+ ERR_FAIL_COND(p_resolution > 1000);
+ _bake_resolution = p_resolution;
+ _baked_cache_dirty = true;
+}
+
+real_t Curve::interpolate_baked(real_t offset) {
+ if (_baked_cache_dirty) {
+ // Last-second bake if not done already
+ bake();
+ }
+
+ // Special cases if the cache is too small
+ if (_baked_cache.size() == 0) {
+ if (_points.size() == 0)
+ return 0;
+ return _points[0].pos.y;
+ } else if (_baked_cache.size() == 1) {
+ return _baked_cache[0];
+ }
+
+ // Get interpolation index
+ real_t fi = offset * _baked_cache.size();
+ int i = Math::floor(fi);
+ if (i < 0) {
+ i = 0;
+ fi = 0;
+ } else if (i >= _baked_cache.size()) {
+ i = _baked_cache.size() - 1;
+ fi = 0;
+ }
+
+ // Interpolate
+ if (i + 1 < _baked_cache.size()) {
+ real_t t = fi - i;
+ return Math::lerp(_baked_cache[i], _baked_cache[i + 1], t);
+ } else {
+ return _baked_cache[_baked_cache.size() - 1];
+ }
+}
+
+void Curve::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("add_point", "pos", "left_tangent", "right_tangent", "left_mode", "right_mode"),
+ &Curve::add_point, DEFVAL(0), DEFVAL(0), DEFVAL(TANGENT_FREE), DEFVAL(TANGENT_FREE));
+ ClassDB::bind_method(D_METHOD("remove_point", "index"), &Curve::remove_point);
+ ClassDB::bind_method(D_METHOD("clear_points"), &Curve::clear_points);
+ ClassDB::bind_method(D_METHOD("get_point_pos", "index"), &Curve::get_point_pos);
+ ClassDB::bind_method(D_METHOD("set_point_value", "index", "y"), &Curve::set_point_value);
+ ClassDB::bind_method(D_METHOD("set_point_offset", "index", "offset"), &Curve::set_point_value);
+ ClassDB::bind_method(D_METHOD("interpolate", "offset"), &Curve::interpolate);
+ ClassDB::bind_method(D_METHOD("interpolate_baked", "offset"), &Curve::interpolate_baked);
+ ClassDB::bind_method(D_METHOD("get_point_left_tangent", "index"), &Curve::get_point_left_tangent);
+ ClassDB::bind_method(D_METHOD("get_point_right_tangent", "index"), &Curve::get_point_left_tangent);
+ ClassDB::bind_method(D_METHOD("get_point_left_mode", "index"), &Curve::get_point_left_mode);
+ ClassDB::bind_method(D_METHOD("get_point_right_mode", "index"), &Curve::get_point_left_mode);
+ ClassDB::bind_method(D_METHOD("set_point_left_tangent", "index", "tangent"), &Curve::set_point_left_tangent);
+ ClassDB::bind_method(D_METHOD("set_point_right_tangent", "index", "tangent"), &Curve::set_point_left_tangent);
+ ClassDB::bind_method(D_METHOD("set_point_left_mode", "index", "mode"), &Curve::set_point_left_mode);
+ ClassDB::bind_method(D_METHOD("set_point_right_mode", "index", "mode"), &Curve::set_point_left_mode);
+ ClassDB::bind_method(D_METHOD("get_min_value"), &Curve::get_min_value);
+ ClassDB::bind_method(D_METHOD("set_min_value", "min"), &Curve::set_min_value);
+ ClassDB::bind_method(D_METHOD("get_max_value"), &Curve::get_max_value);
+ ClassDB::bind_method(D_METHOD("set_max_value", "max"), &Curve::set_max_value);
+ ClassDB::bind_method(D_METHOD("clean_dupes"), &Curve::clean_dupes);
+ ClassDB::bind_method(D_METHOD("bake"), &Curve::bake);
+ ClassDB::bind_method(D_METHOD("get_bake_resolution"), &Curve::get_bake_resolution);
+ ClassDB::bind_method(D_METHOD("set_bake_resolution", "resolution"), &Curve::set_bake_resolution);
+ ClassDB::bind_method(D_METHOD("_get_data"), &Curve::get_data);
+ ClassDB::bind_method(D_METHOD("_set_data", "data"), &Curve::set_data);
+
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "min_value", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_min_value", "get_min_value");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_value", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_max_value", "get_max_value");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_resolution", PROPERTY_HINT_RANGE, "1,1000,1"), "set_bake_resolution", "get_bake_resolution");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_data", "_get_data");
+
+ ADD_SIGNAL(MethodInfo(SIGNAL_RANGE_CHANGED));
+}
+
int Curve2D::get_point_count() const {
return points.size();
@@ -706,7 +1188,7 @@ void Curve2D::_set_data(const Dictionary &p_data) {
baked_cache_dirty = true;
}
-PoolVector2Array Curve2D::tesselate(int p_max_stages, float p_tolerance) const {
+PoolVector2Array Curve2D::tessellate(int p_max_stages, float p_tolerance) const {
PoolVector2Array tess;
@@ -768,7 +1250,7 @@ void Curve2D::_bind_methods() {
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("tessellate", "max_stages", "tolerance_degrees"), &Curve2D::tessellate, DEFVAL(5), DEFVAL(4));
ClassDB::bind_method(D_METHOD("_get_data"), &Curve2D::_get_data);
ClassDB::bind_method(D_METHOD("_set_data"), &Curve2D::_set_data);
@@ -1201,7 +1683,7 @@ void Curve3D::_set_data(const Dictionary &p_data) {
baked_cache_dirty = true;
}
-PoolVector3Array Curve3D::tesselate(int p_max_stages, float p_tolerance) const {
+PoolVector3Array Curve3D::tessellate(int p_max_stages, float p_tolerance) const {
PoolVector3Array tess;
@@ -1266,7 +1748,7 @@ void Curve3D::_bind_methods() {
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("tessellate", "max_stages", "tolerance_degrees"), &Curve3D::tessellate, DEFVAL(5), DEFVAL(4));
ClassDB::bind_method(D_METHOD("_get_data"), &Curve3D::_get_data);
ClassDB::bind_method(D_METHOD("_set_data"), &Curve3D::_set_data);
diff --git a/scene/resources/curve.h b/scene/resources/curve.h
index eae52d7bd4..e302f1e0af 100644
--- a/scene/resources/curve.h
+++ b/scene/resources/curve.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -81,6 +82,117 @@ public:
#endif
+// y(x) curve
+class Curve : public Resource {
+ GDCLASS(Curve, Resource)
+public:
+ static const int MIN_X = 0.f;
+ static const int MAX_X = 1.f;
+
+ static const char *SIGNAL_RANGE_CHANGED;
+
+ enum TangentMode {
+ TANGENT_FREE = 0,
+ TANGENT_LINEAR,
+ TANGENT_MODE_COUNT
+ };
+
+ struct Point {
+ Vector2 pos;
+ real_t left_tangent;
+ real_t right_tangent;
+ TangentMode left_mode;
+ TangentMode right_mode;
+
+ Point() {
+ left_tangent = 0;
+ right_tangent = 0;
+ left_mode = TANGENT_FREE;
+ right_mode = TANGENT_FREE;
+ }
+
+ Point(Vector2 p_pos,
+ real_t p_left = 0,
+ real_t p_right = 0,
+ TangentMode p_left_mode = TANGENT_FREE,
+ TangentMode p_right_mode = TANGENT_FREE) {
+
+ pos = p_pos;
+ left_tangent = p_left;
+ right_tangent = p_right;
+ left_mode = p_left_mode;
+ right_mode = p_right_mode;
+ }
+ };
+
+ Curve();
+
+ int get_point_count() const { return _points.size(); }
+
+ int add_point(Vector2 p_pos,
+ real_t left_tangent = 0,
+ real_t right_tangent = 0,
+ TangentMode left_mode = TANGENT_FREE,
+ TangentMode right_mode = TANGENT_FREE);
+
+ void remove_point(int p_index);
+ void clear_points();
+
+ int get_index(real_t offset) const;
+
+ void set_point_value(int p_index, real_t pos);
+ int set_point_offset(int p_index, float offset);
+ Vector2 get_point_pos(int p_index) const;
+
+ Point get_point(int p_index) const;
+
+ float get_min_value() const { return _min_value; }
+ void set_min_value(float p_min);
+
+ float get_max_value() const { return _max_value; }
+ void set_max_value(float p_max);
+
+ real_t interpolate(real_t offset) const;
+ real_t interpolate_local_nocheck(int index, real_t local_offset) const;
+
+ void clean_dupes();
+
+ void set_point_left_tangent(int i, real_t tangent);
+ void set_point_right_tangent(int i, real_t tangent);
+ void set_point_left_mode(int i, TangentMode p_mode);
+ void set_point_right_mode(int i, TangentMode p_mode);
+
+ real_t get_point_left_tangent(int i) const;
+ real_t get_point_right_tangent(int i) const;
+ TangentMode get_point_left_mode(int i) const;
+ TangentMode get_point_right_mode(int i) const;
+
+ void update_auto_tangents(int i);
+
+ Array get_data() const;
+ void set_data(Array input);
+
+ void bake();
+ int get_bake_resolution() const { return _bake_resolution; }
+ void set_bake_resolution(int p_resolution);
+ real_t interpolate_baked(real_t offset);
+
+protected:
+ static void _bind_methods();
+
+private:
+ void mark_dirty();
+
+ Vector<Point> _points;
+ bool _baked_cache_dirty;
+ Vector<real_t> _baked_cache;
+ int _bake_resolution;
+ float _min_value;
+ float _max_value;
+};
+
+VARIANT_ENUM_CAST(Curve::TangentMode)
+
class Curve2D : public Resource {
GDCLASS(Curve2D, Resource);
@@ -130,14 +242,14 @@ public:
Vector2 interpolate(int p_index, float p_offset) const;
Vector2 interpolatef(real_t p_findex) const;
- void set_bake_interval(float p_distance);
+ void set_bake_interval(float p_tolerance);
float get_bake_interval() const;
float get_baked_length() const;
Vector2 interpolate_baked(float p_offset, bool p_cubic = false) const;
PoolVector2Array get_baked_points() const; //useful for going through
- PoolVector2Array tesselate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display
+ PoolVector2Array tessellate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display
Curve2D();
};
@@ -197,7 +309,7 @@ public:
Vector3 interpolate(int p_index, float p_offset) const;
Vector3 interpolatef(real_t p_findex) const;
- void set_bake_interval(float p_distance);
+ void set_bake_interval(float p_tolerance);
float get_bake_interval() const;
float get_baked_length() const;
@@ -206,7 +318,7 @@ public:
PoolVector3Array get_baked_points() const; //useful for going through
PoolRealArray get_baked_tilts() const; //useful for going through
- PoolVector3Array tesselate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display
+ PoolVector3Array tessellate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display
Curve3D();
};
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 60490d70ca..03288e45bf 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -52,20 +53,20 @@ static Ref<StyleBoxTexture> make_stylebox(T p_src, float p_left, float p_top, fl
} else {
texture = Ref<ImageTexture>(memnew(ImageTexture));
- Image img(p_src);
+ Ref<Image> img = memnew(Image(p_src));
if (scale > 1) {
- Size2 orig_size = Size2(img.get_width(), img.get_height());
+ Size2 orig_size = Size2(img->get_width(), img->get_height());
- img.convert(Image::FORMAT_RGBA8);
- img.expand_x2_hq2x();
+ img->convert(Image::FORMAT_RGBA8);
+ img->expand_x2_hq2x();
if (scale != 2.0) {
- img.resize(orig_size.x * scale, orig_size.y * scale);
+ img->resize(orig_size.x * scale, orig_size.y * scale);
}
} else if (scale < 1) {
- Size2 orig_size = Size2(img.get_width(), img.get_height());
- img.convert(Image::FORMAT_RGBA8);
- img.resize(orig_size.x * scale, orig_size.y * scale);
+ Size2 orig_size = Size2(img->get_width(), img->get_height());
+ img->convert(Image::FORMAT_RGBA8);
+ img->resize(orig_size.x * scale, orig_size.y * scale);
}
texture->create_from_image(img, ImageTexture::FLAG_FILTER);
@@ -100,19 +101,19 @@ template <class T>
static Ref<Texture> make_icon(T p_src) {
Ref<ImageTexture> texture(memnew(ImageTexture));
- Image img = Image(p_src);
+ Ref<Image> img = memnew(Image(p_src));
if (scale > 1) {
- Size2 orig_size = Size2(img.get_width(), img.get_height());
+ Size2 orig_size = Size2(img->get_width(), img->get_height());
- img.convert(Image::FORMAT_RGBA8);
- img.expand_x2_hq2x();
+ img->convert(Image::FORMAT_RGBA8);
+ img->expand_x2_hq2x();
if (scale != 2.0) {
- img.resize(orig_size.x * scale, orig_size.y * scale);
+ img->resize(orig_size.x * scale, orig_size.y * scale);
}
} else if (scale < 1) {
- Size2 orig_size = Size2(img.get_width(), img.get_height());
- img.convert(Image::FORMAT_RGBA8);
- img.resize(orig_size.x * scale, orig_size.y * scale);
+ Size2 orig_size = Size2(img->get_width(), img->get_height());
+ img->convert(Image::FORMAT_RGBA8);
+ img->resize(orig_size.x * scale, orig_size.y * scale);
}
texture->create_from_image(img, ImageTexture::FLAG_FILTER);
@@ -120,7 +121,7 @@ static Ref<Texture> make_icon(T p_src) {
}
static Ref<Shader> make_shader(const char *vertex_code, const char *fragment_code, const char *lighting_code) {
- Ref<Shader> shader = (memnew(Shader(Shader::MODE_CANVAS_ITEM)));
+ Ref<Shader> shader = (memnew(Shader()));
//shader->set_code(vertex_code, fragment_code, lighting_code);
return shader;
@@ -137,8 +138,8 @@ static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_valign, int p
int chr = c[0];
Rect2 frect;
- frect.pos.x = c[1];
- frect.pos.y = c[2];
+ frect.position.x = c[1];
+ frect.position.y = c[2];
frect.size.x = c[3];
frect.size.y = c[4];
Point2 align(c[5], c[6] + p_valign);
@@ -157,7 +158,7 @@ static Ref<BitmapFont> make_font2(int p_height, int p_ascent, int p_charcount, c
Ref<BitmapFont> font(memnew(BitmapFont));
- Image image(p_img);
+ Ref<Image> image = memnew(Image(p_img));
Ref<ImageTexture> tex = memnew(ImageTexture);
tex->create_from_image(image);
@@ -169,8 +170,8 @@ static Ref<BitmapFont> make_font2(int p_height, int p_ascent, int p_charcount, c
int chr = c[0];
Rect2 frect;
- frect.pos.x = c[1];
- frect.pos.y = c[2];
+ frect.position.x = c[1];
+ frect.position.y = c[2];
frect.size.x = c[3];
frect.size.y = c[4];
Point2 align(c[6], c[5]);
@@ -202,7 +203,7 @@ static Ref<StyleBox> make_empty_stylebox(float p_margin_left = -1, float p_margi
return style;
}
-void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<Font> &large_font, Ref<Texture> &default_icon, Ref<StyleBox> &default_style, float p_scale) {
+void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const Ref<Font> &large_font, Ref<Texture> &default_icon, Ref<StyleBox> &default_style, float p_scale) {
scale = p_scale;
@@ -222,7 +223,7 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
// Panel
- t->set_stylebox("panel", "Panel", make_stylebox(panel_bg_png, 0, 0, 0, 0));
+ theme->set_stylebox("panel", "Panel", make_stylebox(panel_bg_png, 0, 0, 0, 0));
// Focus
@@ -239,69 +240,63 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
Ref<StyleBox> sb_button_disabled = sb_expand(make_stylebox(button_disabled_png, 4, 4, 4, 4, 6, 2, 6, 2), 2, 2, 2, 2);
Ref<StyleBox> sb_button_focus = sb_expand(make_stylebox(button_focus_png, 4, 4, 4, 4, 6, 2, 6, 2), 2, 2, 2, 2);
- t->set_stylebox("normal", "Button", sb_button_normal);
- t->set_stylebox("pressed", "Button", sb_button_pressed);
- t->set_stylebox("hover", "Button", sb_button_hover);
- t->set_stylebox("disabled", "Button", sb_button_disabled);
- t->set_stylebox("focus", "Button", sb_button_focus);
+ theme->set_stylebox("normal", "Button", sb_button_normal);
+ theme->set_stylebox("pressed", "Button", sb_button_pressed);
+ theme->set_stylebox("hover", "Button", sb_button_hover);
+ theme->set_stylebox("disabled", "Button", sb_button_disabled);
+ theme->set_stylebox("focus", "Button", sb_button_focus);
- t->set_font("font", "Button", default_font);
+ theme->set_font("font", "Button", default_font);
- t->set_color("font_color", "Button", control_font_color);
- t->set_color("font_color_pressed", "Button", control_font_color_pressed);
- t->set_color("font_color_hover", "Button", control_font_color_hover);
- t->set_color("font_color_disabled", "Button", control_font_color_disabled);
+ theme->set_color("font_color", "Button", control_font_color);
+ theme->set_color("font_color_pressed", "Button", control_font_color_pressed);
+ theme->set_color("font_color_hover", "Button", control_font_color_hover);
+ theme->set_color("font_color_disabled", "Button", control_font_color_disabled);
- t->set_constant("hseparation", "Button", 2 * scale);
+ theme->set_constant("hseparation", "Button", 2 * scale);
// LinkButton
- t->set_font("font", "LinkButton", default_font);
+ theme->set_font("font", "LinkButton", default_font);
- t->set_color("font_color", "LinkButton", control_font_color);
- t->set_color("font_color_pressed", "LinkButton", control_font_color_pressed);
- t->set_color("font_color_hover", "LinkButton", control_font_color_hover);
+ theme->set_color("font_color", "LinkButton", control_font_color);
+ theme->set_color("font_color_pressed", "LinkButton", control_font_color_pressed);
+ theme->set_color("font_color_hover", "LinkButton", control_font_color_hover);
- t->set_constant("underline_spacing", "LinkButton", 2 * scale);
+ theme->set_constant("underline_spacing", "LinkButton", 2 * scale);
// ColorPickerButton
- t->set_stylebox("normal", "ColorPickerButton", sb_button_normal);
- t->set_stylebox("pressed", "ColorPickerButton", sb_button_pressed);
- t->set_stylebox("hover", "ColorPickerButton", sb_button_hover);
- t->set_stylebox("disabled", "ColorPickerButton", sb_button_disabled);
- t->set_stylebox("focus", "ColorPickerButton", sb_button_focus);
+ theme->set_stylebox("normal", "ColorPickerButton", sb_button_normal);
+ theme->set_stylebox("pressed", "ColorPickerButton", sb_button_pressed);
+ theme->set_stylebox("hover", "ColorPickerButton", sb_button_hover);
+ theme->set_stylebox("disabled", "ColorPickerButton", sb_button_disabled);
+ theme->set_stylebox("focus", "ColorPickerButton", sb_button_focus);
- t->set_font("font", "ColorPickerButton", default_font);
+ theme->set_font("font", "ColorPickerButton", default_font);
- t->set_color("font_color", "ColorPickerButton", Color(1, 1, 1, 1));
- t->set_color("font_color_pressed", "ColorPickerButton", Color(0.8, 0.8, 0.8, 1));
- t->set_color("font_color_hover", "ColorPickerButton", Color(1, 1, 1, 1));
- t->set_color("font_color_disabled", "ColorPickerButton", Color(0.9, 0.9, 0.9, 0.3));
+ theme->set_color("font_color", "ColorPickerButton", Color(1, 1, 1, 1));
+ theme->set_color("font_color_pressed", "ColorPickerButton", Color(0.8, 0.8, 0.8, 1));
+ theme->set_color("font_color_hover", "ColorPickerButton", Color(1, 1, 1, 1));
+ theme->set_color("font_color_disabled", "ColorPickerButton", Color(0.9, 0.9, 0.9, 0.3));
- t->set_constant("hseparation", "ColorPickerButton", 2 * scale);
+ theme->set_constant("hseparation", "ColorPickerButton", 2 * scale);
// ToolButton
- Ref<StyleBox> tb_empty = memnew(StyleBoxEmpty);
- tb_empty->set_default_margin(MARGIN_LEFT, 6 * scale);
- tb_empty->set_default_margin(MARGIN_RIGHT, 6 * scale);
- tb_empty->set_default_margin(MARGIN_TOP, 4 * scale);
- tb_empty->set_default_margin(MARGIN_BOTTOM, 4 * scale);
+ theme->set_stylebox("normal", "ToolButton", make_empty_stylebox(6, 4, 6, 4));
+ theme->set_stylebox("pressed", "ToolButton", make_stylebox(button_pressed_png, 4, 4, 4, 4, 6, 4, 6, 4));
+ theme->set_stylebox("hover", "ToolButton", make_stylebox(button_normal_png, 4, 4, 4, 4, 6, 4, 6, 4));
+ theme->set_stylebox("disabled", "ToolButton", make_empty_stylebox(6, 4, 6, 4));
+ theme->set_stylebox("focus", "ToolButton", focus);
+ theme->set_font("font", "ToolButton", default_font);
- t->set_stylebox("normal", "ToolButton", tb_empty);
- t->set_stylebox("pressed", "ToolButton", make_stylebox(button_pressed_png, 4, 4, 4, 4));
- t->set_stylebox("hover", "ToolButton", make_stylebox(button_normal_png, 4, 4, 4, 4));
- t->set_stylebox("disabled", "ToolButton", make_empty_stylebox(4, 4, 4, 4));
- t->set_stylebox("focus", "ToolButton", focus);
- t->set_font("font", "ToolButton", default_font);
+ theme->set_color("font_color", "ToolButton", control_font_color);
+ theme->set_color("font_color_pressed", "ToolButton", control_font_color_pressed);
+ theme->set_color("font_color_hover", "ToolButton", control_font_color_hover);
+ theme->set_color("font_color_disabled", "ToolButton", Color(0.9, 0.95, 1, 0.3));
- t->set_color("font_color", "ToolButton", control_font_color);
- t->set_color("font_color_pressed", "ToolButton", control_font_color_pressed);
- t->set_color("font_color_hover", "ToolButton", control_font_color_hover);
- t->set_color("font_color_disabled", "ToolButton", Color(0.9, 0.95, 1, 0.3));
-
- t->set_constant("hseparation", "ToolButton", 3);
+ theme->set_constant("hseparation", "ToolButton", 3);
// OptionButton
@@ -311,44 +306,44 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
Ref<StyleBox> sb_optbutton_disabled = sb_expand(make_stylebox(option_button_disabled_png, 4, 4, 21, 4, 6, 2, 21, 2), 2, 2, 2, 2);
Ref<StyleBox> sb_optbutton_focus = sb_expand(make_stylebox(button_focus_png, 4, 4, 4, 4, 6, 2, 6, 2), 2, 2, 2, 2);
- t->set_stylebox("normal", "OptionButton", sb_optbutton_normal);
- t->set_stylebox("pressed", "OptionButton", sb_optbutton_pressed);
- t->set_stylebox("hover", "OptionButton", sb_optbutton_hover);
- t->set_stylebox("disabled", "OptionButton", sb_optbutton_disabled);
- t->set_stylebox("focus", "OptionButton", sb_button_focus);
+ theme->set_stylebox("normal", "OptionButton", sb_optbutton_normal);
+ theme->set_stylebox("pressed", "OptionButton", sb_optbutton_pressed);
+ theme->set_stylebox("hover", "OptionButton", sb_optbutton_hover);
+ theme->set_stylebox("disabled", "OptionButton", sb_optbutton_disabled);
+ theme->set_stylebox("focus", "OptionButton", sb_button_focus);
- t->set_icon("arrow", "OptionButton", make_icon(option_arrow_png));
+ theme->set_icon("arrow", "OptionButton", make_icon(option_arrow_png));
- t->set_font("font", "OptionButton", default_font);
+ theme->set_font("font", "OptionButton", default_font);
- t->set_color("font_color", "OptionButton", control_font_color);
- t->set_color("font_color_pressed", "OptionButton", control_font_color_pressed);
- t->set_color("font_color_hover", "OptionButton", control_font_color_hover);
- t->set_color("font_color_disabled", "OptionButton", control_font_color_disabled);
+ theme->set_color("font_color", "OptionButton", control_font_color);
+ theme->set_color("font_color_pressed", "OptionButton", control_font_color_pressed);
+ theme->set_color("font_color_hover", "OptionButton", control_font_color_hover);
+ theme->set_color("font_color_disabled", "OptionButton", control_font_color_disabled);
- t->set_constant("hseparation", "OptionButton", 2 * scale);
- t->set_constant("arrow_margin", "OptionButton", 2 * scale);
+ theme->set_constant("hseparation", "OptionButton", 2 * scale);
+ theme->set_constant("arrow_margin", "OptionButton", 2 * scale);
// MenuButton
- t->set_stylebox("normal", "MenuButton", sb_button_normal);
- t->set_stylebox("pressed", "MenuButton", sb_button_pressed);
- t->set_stylebox("hover", "MenuButton", sb_button_pressed);
- t->set_stylebox("disabled", "MenuButton", make_empty_stylebox(0, 0, 0, 0));
- t->set_stylebox("focus", "MenuButton", sb_button_focus);
+ theme->set_stylebox("normal", "MenuButton", sb_button_normal);
+ theme->set_stylebox("pressed", "MenuButton", sb_button_pressed);
+ theme->set_stylebox("hover", "MenuButton", sb_button_pressed);
+ theme->set_stylebox("disabled", "MenuButton", make_empty_stylebox(0, 0, 0, 0));
+ theme->set_stylebox("focus", "MenuButton", sb_button_focus);
- t->set_font("font", "MenuButton", default_font);
+ theme->set_font("font", "MenuButton", default_font);
- t->set_color("font_color", "MenuButton", control_font_color);
- t->set_color("font_color_pressed", "MenuButton", control_font_color_pressed);
- t->set_color("font_color_hover", "MenuButton", control_font_color_hover);
- t->set_color("font_color_disabled", "MenuButton", Color(1, 1, 1, 0.3));
+ theme->set_color("font_color", "MenuButton", control_font_color);
+ theme->set_color("font_color_pressed", "MenuButton", control_font_color_pressed);
+ theme->set_color("font_color_hover", "MenuButton", control_font_color_hover);
+ theme->set_color("font_color_disabled", "MenuButton", Color(1, 1, 1, 0.3));
- t->set_constant("hseparation", "MenuButton", 3 * scale);
+ theme->set_constant("hseparation", "MenuButton", 3 * scale);
// ButtonGroup
- t->set_stylebox("panel", "ButtonGroup", memnew(StyleBoxEmpty));
+ theme->set_stylebox("panel", "ButtonGroup", memnew(StyleBoxEmpty));
// CheckBox
@@ -363,26 +358,26 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
cbx_focus->set_default_margin(MARGIN_TOP, 4 * scale);
cbx_focus->set_default_margin(MARGIN_BOTTOM, 5 * scale);
- t->set_stylebox("normal", "CheckBox", cbx_empty);
- t->set_stylebox("pressed", "CheckBox", cbx_empty);
- t->set_stylebox("disabled", "CheckBox", cbx_empty);
- t->set_stylebox("hover", "CheckBox", cbx_empty);
- t->set_stylebox("focus", "CheckBox", cbx_focus);
+ theme->set_stylebox("normal", "CheckBox", cbx_empty);
+ theme->set_stylebox("pressed", "CheckBox", cbx_empty);
+ theme->set_stylebox("disabled", "CheckBox", cbx_empty);
+ theme->set_stylebox("hover", "CheckBox", cbx_empty);
+ theme->set_stylebox("focus", "CheckBox", cbx_focus);
- t->set_icon("checked", "CheckBox", make_icon(checked_png));
- t->set_icon("unchecked", "CheckBox", make_icon(unchecked_png));
- t->set_icon("radio_checked", "CheckBox", make_icon(radio_checked_png));
- t->set_icon("radio_unchecked", "CheckBox", make_icon(radio_unchecked_png));
+ theme->set_icon("checked", "CheckBox", make_icon(checked_png));
+ theme->set_icon("unchecked", "CheckBox", make_icon(unchecked_png));
+ theme->set_icon("radio_checked", "CheckBox", make_icon(radio_checked_png));
+ theme->set_icon("radio_unchecked", "CheckBox", make_icon(radio_unchecked_png));
- t->set_font("font", "CheckBox", default_font);
+ theme->set_font("font", "CheckBox", default_font);
- t->set_color("font_color", "CheckBox", control_font_color);
- t->set_color("font_color_pressed", "CheckBox", control_font_color_pressed);
- t->set_color("font_color_hover", "CheckBox", control_font_color_hover);
- t->set_color("font_color_disabled", "CheckBox", control_font_color_disabled);
+ theme->set_color("font_color", "CheckBox", control_font_color);
+ theme->set_color("font_color_pressed", "CheckBox", control_font_color_pressed);
+ theme->set_color("font_color_hover", "CheckBox", control_font_color_hover);
+ theme->set_color("font_color_disabled", "CheckBox", control_font_color_disabled);
- t->set_constant("hseparation", "CheckBox", 4 * scale);
- t->set_constant("check_vadjust", "CheckBox", 0 * scale);
+ theme->set_constant("hseparation", "CheckBox", 4 * scale);
+ theme->set_constant("check_vadjust", "CheckBox", 0 * scale);
// CheckButton
@@ -392,168 +387,172 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
cb_empty->set_default_margin(MARGIN_TOP, 4 * scale);
cb_empty->set_default_margin(MARGIN_BOTTOM, 4 * scale);
- t->set_stylebox("normal", "CheckButton", cb_empty);
- t->set_stylebox("pressed", "CheckButton", cb_empty);
- t->set_stylebox("disabled", "CheckButton", cb_empty);
- t->set_stylebox("hover", "CheckButton", cb_empty);
- t->set_stylebox("focus", "CheckButton", focus);
+ theme->set_stylebox("normal", "CheckButton", cb_empty);
+ theme->set_stylebox("pressed", "CheckButton", cb_empty);
+ theme->set_stylebox("disabled", "CheckButton", cb_empty);
+ theme->set_stylebox("hover", "CheckButton", cb_empty);
+ theme->set_stylebox("focus", "CheckButton", focus);
- t->set_icon("on", "CheckButton", make_icon(toggle_on_png));
- t->set_icon("off", "CheckButton", make_icon(toggle_off_png));
+ theme->set_icon("on", "CheckButton", make_icon(toggle_on_png));
+ theme->set_icon("off", "CheckButton", make_icon(toggle_off_png));
- t->set_font("font", "CheckButton", default_font);
+ theme->set_font("font", "CheckButton", default_font);
- t->set_color("font_color", "CheckButton", control_font_color);
- t->set_color("font_color_pressed", "CheckButton", control_font_color_pressed);
- t->set_color("font_color_hover", "CheckButton", control_font_color_hover);
- t->set_color("font_color_disabled", "CheckButton", control_font_color_disabled);
+ theme->set_color("font_color", "CheckButton", control_font_color);
+ theme->set_color("font_color_pressed", "CheckButton", control_font_color_pressed);
+ theme->set_color("font_color_hover", "CheckButton", control_font_color_hover);
+ theme->set_color("font_color_disabled", "CheckButton", control_font_color_disabled);
- t->set_constant("hseparation", "CheckButton", 4 * scale);
- t->set_constant("check_vadjust", "CheckButton", 0 * scale);
+ theme->set_constant("hseparation", "CheckButton", 4 * scale);
+ theme->set_constant("check_vadjust", "CheckButton", 0 * scale);
// Label
- t->set_font("font", "Label", default_font);
+ theme->set_font("font", "Label", default_font);
- t->set_color("font_color", "Label", Color(1, 1, 1));
- t->set_color("font_color_shadow", "Label", Color(0, 0, 0, 0));
+ theme->set_color("font_color", "Label", Color(1, 1, 1));
+ theme->set_color("font_color_shadow", "Label", Color(0, 0, 0, 0));
- t->set_constant("shadow_offset_x", "Label", 1 * scale);
- t->set_constant("shadow_offset_y", "Label", 1 * scale);
- t->set_constant("shadow_as_outline", "Label", 0 * scale);
- t->set_constant("line_spacing", "Label", 3 * scale);
+ theme->set_constant("shadow_offset_x", "Label", 1 * scale);
+ theme->set_constant("shadow_offset_y", "Label", 1 * scale);
+ theme->set_constant("shadow_as_outline", "Label", 0 * scale);
+ theme->set_constant("line_spacing", "Label", 3 * scale);
// LineEdit
- t->set_stylebox("normal", "LineEdit", make_stylebox(line_edit_png, 5, 5, 5, 5));
- t->set_stylebox("focus", "LineEdit", focus);
- t->set_stylebox("read_only", "LineEdit", make_stylebox(line_edit_disabled_png, 6, 6, 6, 6));
+ theme->set_stylebox("normal", "LineEdit", make_stylebox(line_edit_png, 5, 5, 5, 5));
+ theme->set_stylebox("focus", "LineEdit", focus);
+ theme->set_stylebox("read_only", "LineEdit", make_stylebox(line_edit_disabled_png, 6, 6, 6, 6));
- t->set_font("font", "LineEdit", default_font);
+ theme->set_font("font", "LineEdit", default_font);
- t->set_color("font_color", "LineEdit", control_font_color);
- t->set_color("font_color_selected", "LineEdit", Color(0, 0, 0));
- t->set_color("cursor_color", "LineEdit", control_font_color_hover);
- t->set_color("selection_color", "LineEdit", font_color_selection);
+ theme->set_color("font_color", "LineEdit", control_font_color);
+ theme->set_color("font_color_selected", "LineEdit", Color(0, 0, 0));
+ theme->set_color("cursor_color", "LineEdit", control_font_color_hover);
+ theme->set_color("selection_color", "LineEdit", font_color_selection);
- t->set_constant("minimum_spaces", "LineEdit", 12 * scale);
+ theme->set_constant("minimum_spaces", "LineEdit", 12 * scale);
// ProgressBar
- t->set_stylebox("bg", "ProgressBar", make_stylebox(progress_bar_png, 4, 4, 4, 4, 0, 0, 0, 0));
- t->set_stylebox("fg", "ProgressBar", make_stylebox(progress_fill_png, 6, 6, 6, 6, 2, 1, 2, 1));
+ theme->set_stylebox("bg", "ProgressBar", make_stylebox(progress_bar_png, 4, 4, 4, 4, 0, 0, 0, 0));
+ theme->set_stylebox("fg", "ProgressBar", make_stylebox(progress_fill_png, 6, 6, 6, 6, 2, 1, 2, 1));
- t->set_font("font", "ProgressBar", default_font);
+ theme->set_font("font", "ProgressBar", default_font);
- t->set_color("font_color", "ProgressBar", control_font_color_hover);
- t->set_color("font_color_shadow", "ProgressBar", Color(0, 0, 0));
+ theme->set_color("font_color", "ProgressBar", control_font_color_hover);
+ theme->set_color("font_color_shadow", "ProgressBar", Color(0, 0, 0));
// TextEdit
- t->set_stylebox("normal", "TextEdit", make_stylebox(tree_bg_png, 3, 3, 3, 3));
- t->set_stylebox("focus", "TextEdit", focus);
- t->set_stylebox("completion", "TextEdit", make_stylebox(tree_bg_png, 3, 3, 3, 3));
-
- t->set_icon("tab", "TextEdit", make_icon(tab_png));
-
- t->set_font("font", "TextEdit", default_font);
-
- t->set_color("background_color", "TextEdit", Color(0, 0, 0, 0));
- t->set_color("completion_background_color", "TextEdit", Color::html("2C2A32"));
- t->set_color("completion_selected_color", "TextEdit", Color::html("434244"));
- t->set_color("completion_existing_color", "TextEdit", Color::html("21dfdfdf"));
- t->set_color("completion_scroll_color", "TextEdit", control_font_color_pressed);
- t->set_color("completion_font_color", "TextEdit", Color::html("aaaaaa"));
- t->set_color("font_color", "TextEdit", control_font_color);
- t->set_color("font_color_selected", "TextEdit", Color(0, 0, 0));
- t->set_color("selection_color", "TextEdit", font_color_selection);
- t->set_color("mark_color", "TextEdit", Color(1.0, 0.4, 0.4, 0.4));
- t->set_color("breakpoint_color", "TextEdit", Color(0.8, 0.8, 0.4, 0.2));
- t->set_color("current_line_color", "TextEdit", Color(0.25, 0.25, 0.26, 0.8));
- t->set_color("caret_color", "TextEdit", control_font_color);
- t->set_color("caret_background_color", "TextEdit", Color::html("000000"));
- t->set_color("symbol_color", "TextEdit", control_font_color_hover);
- t->set_color("brace_mismatch_color", "TextEdit", Color(1, 0.2, 0.2));
- t->set_color("line_number_color", "TextEdit", Color::html("66aaaaaa"));
- t->set_color("function_color", "TextEdit", Color::html("66a2ce"));
- t->set_color("member_variable_color", "TextEdit", Color::html("e64e59"));
- t->set_color("number_color", "TextEdit", Color::html("EB9532"));
- t->set_color("word_highlighted_color", "TextEdit", Color(0.8, 0.9, 0.9, 0.15));
-
- t->set_constant("completion_lines", "TextEdit", 7);
- t->set_constant("completion_max_width", "TextEdit", 50);
- t->set_constant("completion_scroll_width", "TextEdit", 3);
- t->set_constant("line_spacing", "TextEdit", 4 * scale);
+ theme->set_stylebox("normal", "TextEdit", make_stylebox(tree_bg_png, 3, 3, 3, 3));
+ theme->set_stylebox("focus", "TextEdit", focus);
+ theme->set_stylebox("completion", "TextEdit", make_stylebox(tree_bg_png, 3, 3, 3, 3));
+
+ theme->set_icon("tab", "TextEdit", make_icon(tab_png));
+
+ theme->set_font("font", "TextEdit", default_font);
+
+ theme->set_color("background_color", "TextEdit", Color(0, 0, 0, 0));
+ theme->set_color("completion_background_color", "TextEdit", Color::html("2C2A32"));
+ theme->set_color("completion_selected_color", "TextEdit", Color::html("434244"));
+ theme->set_color("completion_existing_color", "TextEdit", Color::html("21dfdfdf"));
+ theme->set_color("completion_scroll_color", "TextEdit", control_font_color_pressed);
+ theme->set_color("completion_font_color", "TextEdit", Color::html("aaaaaa"));
+ theme->set_color("font_color", "TextEdit", control_font_color);
+ theme->set_color("font_color_selected", "TextEdit", Color(0, 0, 0));
+ theme->set_color("selection_color", "TextEdit", font_color_selection);
+ theme->set_color("mark_color", "TextEdit", Color(1.0, 0.4, 0.4, 0.4));
+ theme->set_color("breakpoint_color", "TextEdit", Color(0.8, 0.8, 0.4, 0.2));
+ theme->set_color("current_line_color", "TextEdit", Color(0.25, 0.25, 0.26, 0.8));
+ theme->set_color("caret_color", "TextEdit", control_font_color);
+ theme->set_color("caret_background_color", "TextEdit", Color::html("000000"));
+ theme->set_color("symbol_color", "TextEdit", control_font_color_hover);
+ theme->set_color("brace_mismatch_color", "TextEdit", Color(1, 0.2, 0.2));
+ theme->set_color("line_number_color", "TextEdit", Color::html("66aaaaaa"));
+ theme->set_color("function_color", "TextEdit", Color::html("66a2ce"));
+ theme->set_color("member_variable_color", "TextEdit", Color::html("e64e59"));
+ theme->set_color("number_color", "TextEdit", Color::html("EB9532"));
+ theme->set_color("word_highlighted_color", "TextEdit", Color(0.8, 0.9, 0.9, 0.15));
+
+ theme->set_constant("completion_lines", "TextEdit", 7);
+ theme->set_constant("completion_max_width", "TextEdit", 50);
+ theme->set_constant("completion_scroll_width", "TextEdit", 3);
+ theme->set_constant("line_spacing", "TextEdit", 4 * scale);
Ref<Texture> empty_icon = memnew(ImageTexture);
// HScrollBar
- t->set_stylebox("scroll", "HScrollBar", make_stylebox(scroll_bg_png, 5, 5, 5, 5, 0, 0, 0, 0));
- t->set_stylebox("scroll_focus", "HScrollBar", make_stylebox(scroll_bg_png, 5, 5, 5, 5, 0, 0, 0, 0));
- t->set_stylebox("grabber", "HScrollBar", make_stylebox(scroll_grabber_png, 5, 5, 5, 5, 2, 2, 2, 2));
- t->set_stylebox("grabber_hilite", "HScrollBar", make_stylebox(scroll_grabber_hl_png, 5, 5, 5, 5, 2, 2, 2, 2));
+ theme->set_stylebox("scroll", "HScrollBar", make_stylebox(scroll_bg_png, 5, 5, 5, 5, 0, 0, 0, 0));
+ theme->set_stylebox("scroll_focus", "HScrollBar", make_stylebox(scroll_bg_png, 5, 5, 5, 5, 0, 0, 0, 0));
+ theme->set_stylebox("grabber", "HScrollBar", make_stylebox(scroll_grabber_png, 5, 5, 5, 5, 2, 2, 2, 2));
+ theme->set_stylebox("grabber_highlight", "HScrollBar", make_stylebox(scroll_grabber_hl_png, 5, 5, 5, 5, 2, 2, 2, 2));
+ theme->set_stylebox("grabber_pressed", "HScrollBar", make_stylebox(scroll_grabber_pressed_png, 5, 5, 5, 5, 2, 2, 2, 2));
- t->set_icon("increment", "HScrollBar", empty_icon);
- t->set_icon("increment_hilite", "HScrollBar", empty_icon);
- t->set_icon("decrement", "HScrollBar", empty_icon);
- t->set_icon("decrement_hilite", "HScrollBar", empty_icon);
+ theme->set_icon("increment", "HScrollBar", empty_icon);
+ theme->set_icon("increment_highlight", "HScrollBar", empty_icon);
+ theme->set_icon("decrement", "HScrollBar", empty_icon);
+ theme->set_icon("decrement_highlight", "HScrollBar", empty_icon);
// VScrollBar
- t->set_stylebox("scroll", "VScrollBar", make_stylebox(scroll_bg_png, 5, 5, 5, 5, 0, 0, 0, 0));
- t->set_stylebox("scroll_focus", "VScrollBar", make_stylebox(scroll_bg_png, 5, 5, 5, 5, 0, 0, 0, 0));
- t->set_stylebox("grabber", "VScrollBar", make_stylebox(scroll_grabber_png, 5, 5, 5, 5, 2, 2, 2, 2));
- t->set_stylebox("grabber_hilite", "VScrollBar", make_stylebox(scroll_grabber_hl_png, 5, 5, 5, 5, 2, 2, 2, 2));
+ theme->set_stylebox("scroll", "VScrollBar", make_stylebox(scroll_bg_png, 5, 5, 5, 5, 0, 0, 0, 0));
+ theme->set_stylebox("scroll_focus", "VScrollBar", make_stylebox(scroll_bg_png, 5, 5, 5, 5, 0, 0, 0, 0));
+ theme->set_stylebox("grabber", "VScrollBar", make_stylebox(scroll_grabber_png, 5, 5, 5, 5, 2, 2, 2, 2));
+ theme->set_stylebox("grabber_highlight", "VScrollBar", make_stylebox(scroll_grabber_hl_png, 5, 5, 5, 5, 2, 2, 2, 2));
+ theme->set_stylebox("grabber_pressed", "VScrollBar", make_stylebox(scroll_grabber_pressed_png, 5, 5, 5, 5, 2, 2, 2, 2));
- t->set_icon("increment", "VScrollBar", empty_icon);
- t->set_icon("increment_hilite", "VScrollBar", empty_icon);
- t->set_icon("decrement", "VScrollBar", empty_icon);
- t->set_icon("decrement_hilite", "VScrollBar", empty_icon);
+ theme->set_icon("increment", "VScrollBar", empty_icon);
+ theme->set_icon("increment_highlight", "VScrollBar", empty_icon);
+ theme->set_icon("decrement", "VScrollBar", empty_icon);
+ theme->set_icon("decrement_highlight", "VScrollBar", empty_icon);
// HSlider
- t->set_stylebox("slider", "HSlider", make_stylebox(hslider_bg_png, 4, 4, 4, 4));
- t->set_stylebox("grabber_hilite", "HSlider", make_stylebox(hslider_grabber_hl_png, 6, 6, 6, 6));
- t->set_stylebox("focus", "HSlider", focus);
+ theme->set_stylebox("slider", "HSlider", make_stylebox(hslider_bg_png, 4, 4, 4, 4));
+ theme->set_stylebox("grabber_highlight", "HSlider", make_stylebox(hslider_grabber_hl_png, 6, 6, 6, 6));
+ theme->set_stylebox("grabber_disabled", "HSlider", make_stylebox(hslider_grabber_disabled_png, 6, 6, 6, 6));
+ theme->set_stylebox("focus", "HSlider", focus);
- t->set_icon("grabber", "HSlider", make_icon(hslider_grabber_png));
- t->set_icon("grabber_hilite", "HSlider", make_icon(hslider_grabber_hl_png));
- t->set_icon("tick", "HSlider", make_icon(hslider_tick_png));
+ theme->set_icon("grabber", "HSlider", make_icon(hslider_grabber_png));
+ theme->set_icon("grabber_highlight", "HSlider", make_icon(hslider_grabber_hl_png));
+ theme->set_icon("grabber_disabled", "HSlider", make_icon(hslider_grabber_disabled_png));
+ theme->set_icon("tick", "HSlider", make_icon(hslider_tick_png));
// VSlider
- t->set_stylebox("slider", "VSlider", make_stylebox(vslider_bg_png, 4, 4, 4, 4));
- t->set_stylebox("grabber_hilite", "VSlider", make_stylebox(vslider_grabber_hl_png, 6, 6, 6, 6));
- t->set_stylebox("focus", "HSlider", focus);
+ theme->set_stylebox("slider", "VSlider", make_stylebox(vslider_bg_png, 4, 4, 4, 4));
+ theme->set_stylebox("grabber_highlight", "VSlider", make_stylebox(vslider_grabber_hl_png, 6, 6, 6, 6));
+ theme->set_stylebox("grabber_disabled", "VSlider", make_stylebox(vslider_grabber_disabled_png, 6, 6, 6, 6));
+ theme->set_stylebox("focus", "HSlider", focus);
- t->set_icon("grabber", "VSlider", make_icon(vslider_grabber_png));
- t->set_icon("grabber_hilite", "VSlider", make_icon(vslider_grabber_hl_png));
- t->set_icon("tick", "VSlider", make_icon(vslider_tick_png));
+ theme->set_icon("grabber", "VSlider", make_icon(vslider_grabber_png));
+ theme->set_icon("grabber_highlight", "VSlider", make_icon(vslider_grabber_hl_png));
+ theme->set_icon("grabber_disabled", "VSlider", make_icon(vslider_grabber_disabled_png));
+ theme->set_icon("tick", "VSlider", make_icon(vslider_tick_png));
// SpinBox
- t->set_icon("updown", "SpinBox", make_icon(spinbox_updown_png));
+ theme->set_icon("updown", "SpinBox", make_icon(spinbox_updown_png));
// WindowDialog
- 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);
+ theme->set_stylebox("panel", "WindowDialog", sb_expand(make_stylebox(popup_window_png, 10, 26, 10, 8), 8, 24, 8, 6));
+ theme->set_constant("scaleborder_size", "WindowDialog", 4 * scale);
- 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);
+ theme->set_font("title_font", "WindowDialog", large_font);
+ theme->set_color("title_color", "WindowDialog", Color(0, 0, 0));
+ theme->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);
+ theme->set_icon("close", "WindowDialog", make_icon(close_png));
+ theme->set_icon("close_highlight", "WindowDialog", make_icon(close_hl_png));
+ theme->set_constant("close_h_ofs", "WindowDialog", 18 * scale);
+ theme->set_constant("close_v_ofs", "WindowDialog", 18 * scale);
// File Dialog
- t->set_icon("reload", "FileDialog", make_icon(icon_reload_png));
+ theme->set_icon("reload", "FileDialog", make_icon(icon_reload_png));
// Popup
@@ -564,28 +563,28 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
selected->set_expand_margin_size(Margin(i), 2 * scale);
}
- t->set_stylebox("panel", "PopupPanel", style_pp);
+ theme->set_stylebox("panel", "PopupPanel", style_pp);
// PopupMenu
- t->set_stylebox("panel", "PopupMenu", make_stylebox(popup_bg_png, 4, 4, 4, 4, 10, 10, 10, 10));
- t->set_stylebox("panel_disabled", "PopupMenu", make_stylebox(popup_bg_disabled_png, 4, 4, 4, 4));
- t->set_stylebox("hover", "PopupMenu", selected);
- t->set_stylebox("separator", "PopupMenu", make_stylebox(vseparator_png, 3, 3, 3, 3));
+ theme->set_stylebox("panel", "PopupMenu", make_stylebox(popup_bg_png, 4, 4, 4, 4, 10, 10, 10, 10));
+ theme->set_stylebox("panel_disabled", "PopupMenu", make_stylebox(popup_bg_disabled_png, 4, 4, 4, 4));
+ theme->set_stylebox("hover", "PopupMenu", selected);
+ theme->set_stylebox("separator", "PopupMenu", make_stylebox(vseparator_png, 3, 3, 3, 3));
- t->set_icon("checked", "PopupMenu", make_icon(checked_png));
- t->set_icon("unchecked", "PopupMenu", make_icon(unchecked_png));
- t->set_icon("submenu", "PopupMenu", make_icon(submenu_png));
+ theme->set_icon("checked", "PopupMenu", make_icon(checked_png));
+ theme->set_icon("unchecked", "PopupMenu", make_icon(unchecked_png));
+ theme->set_icon("submenu", "PopupMenu", make_icon(submenu_png));
- t->set_font("font", "PopupMenu", default_font);
+ theme->set_font("font", "PopupMenu", default_font);
- t->set_color("font_color", "PopupMenu", control_font_color);
- t->set_color("font_color_accel", "PopupMenu", Color(0.7, 0.7, 0.7, 0.8));
- t->set_color("font_color_disabled", "PopupMenu", Color(0.4, 0.4, 0.4, 0.8));
- t->set_color("font_color_hover", "PopupMenu", control_font_color);
+ theme->set_color("font_color", "PopupMenu", control_font_color);
+ theme->set_color("font_color_accel", "PopupMenu", Color(0.7, 0.7, 0.7, 0.8));
+ theme->set_color("font_color_disabled", "PopupMenu", Color(0.4, 0.4, 0.4, 0.8));
+ theme->set_color("font_color_hover", "PopupMenu", control_font_color);
- t->set_constant("hseparation", "PopupMenu", 4 * scale);
- t->set_constant("vseparation", "PopupMenu", 4 * scale);
+ theme->set_constant("hseparation", "PopupMenu", 4 * scale);
+ theme->set_constant("vseparation", "PopupMenu", 4 * scale);
// GraphNode
@@ -600,86 +599,90 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
//graphsb->set_expand_margin_size(MARGIN_LEFT,10);
//graphsb->set_expand_margin_size(MARGIN_RIGHT,10);
- t->set_stylebox("frame", "GraphNode", graphsb);
- t->set_stylebox("selectedframe", "GraphNode", graphsbselected);
- t->set_stylebox("defaultframe", "GraphNode", graphsbdefault);
- t->set_stylebox("defaultfocus", "GraphNode", graphsbdeffocus);
- t->set_stylebox("comment", "GraphNode", graphsbcomment);
- t->set_stylebox("commentfocus", "GraphNode", graphsbcommentselected);
- t->set_stylebox("breakpoint", "GraphNode", graph_bpoint);
- t->set_stylebox("position", "GraphNode", graph_position);
- t->set_constant("separation", "GraphNode", 1 * scale);
- t->set_icon("port", "GraphNode", make_icon(graph_port_png));
- t->set_icon("close", "GraphNode", make_icon(graph_node_close_png));
- t->set_icon("resizer", "GraphNode", make_icon(window_resizer_png));
- t->set_font("title_font", "GraphNode", default_font);
- t->set_color("title_color", "GraphNode", Color(0, 0, 0, 1));
- t->set_constant("title_offset", "GraphNode", 20 * scale);
- t->set_constant("close_offset", "GraphNode", 18 * scale);
- t->set_constant("port_offset", "GraphNode", 3 * scale);
+ theme->set_stylebox("frame", "GraphNode", graphsb);
+ theme->set_stylebox("selectedframe", "GraphNode", graphsbselected);
+ theme->set_stylebox("defaultframe", "GraphNode", graphsbdefault);
+ theme->set_stylebox("defaultfocus", "GraphNode", graphsbdeffocus);
+ theme->set_stylebox("comment", "GraphNode", graphsbcomment);
+ theme->set_stylebox("commentfocus", "GraphNode", graphsbcommentselected);
+ theme->set_stylebox("breakpoint", "GraphNode", graph_bpoint);
+ theme->set_stylebox("position", "GraphNode", graph_position);
+ theme->set_constant("separation", "GraphNode", 1 * scale);
+ theme->set_icon("port", "GraphNode", make_icon(graph_port_png));
+ theme->set_icon("close", "GraphNode", make_icon(graph_node_close_png));
+ theme->set_icon("resizer", "GraphNode", make_icon(window_resizer_png));
+ theme->set_font("title_font", "GraphNode", default_font);
+ theme->set_color("title_color", "GraphNode", Color(0, 0, 0, 1));
+ theme->set_constant("title_offset", "GraphNode", 20 * scale);
+ theme->set_constant("close_offset", "GraphNode", 18 * scale);
+ theme->set_constant("port_offset", "GraphNode", 3 * scale);
// Tree
Ref<StyleBoxTexture> tree_selected = make_stylebox(selection_png, 4, 4, 4, 4, 8, 0, 8, 0);
Ref<StyleBoxTexture> tree_selected_oof = make_stylebox(selection_oof_png, 4, 4, 4, 4, 8, 0, 8, 0);
- t->set_stylebox("bg", "Tree", make_stylebox(tree_bg_png, 4, 4, 4, 5));
- t->set_stylebox("bg_focus", "Tree", focus);
- t->set_stylebox("selected", "Tree", tree_selected_oof);
- t->set_stylebox("selected_focus", "Tree", tree_selected);
- t->set_stylebox("cursor", "Tree", focus);
- t->set_stylebox("cursor_unfocused", "Tree", focus);
- t->set_stylebox("button_pressed", "Tree", make_stylebox(button_pressed_png, 4, 4, 4, 4));
- t->set_stylebox("title_button_normal", "Tree", make_stylebox(tree_title_png, 4, 4, 4, 4));
- t->set_stylebox("title_button_pressed", "Tree", make_stylebox(tree_title_pressed_png, 4, 4, 4, 4));
- t->set_stylebox("title_button_hover", "Tree", make_stylebox(tree_title_png, 4, 4, 4, 4));
-
- t->set_icon("checked", "Tree", make_icon(checked_png));
- t->set_icon("unchecked", "Tree", make_icon(unchecked_png));
- t->set_icon("updown", "Tree", make_icon(updown_png));
- t->set_icon("select_arrow", "Tree", make_icon(dropdown_png));
- t->set_icon("arrow", "Tree", make_icon(arrow_down_png));
- t->set_icon("arrow_collapsed", "Tree", make_icon(arrow_right_png));
-
- t->set_font("title_button_font", "Tree", default_font);
- t->set_font("font", "Tree", default_font);
-
- t->set_color("title_button_color", "Tree", control_font_color);
- t->set_color("font_color", "Tree", control_font_color_low);
- t->set_color("font_color_selected", "Tree", control_font_color_pressed);
- t->set_color("selection_color", "Tree", Color(0.1, 0.1, 1, 0.8));
- t->set_color("cursor_color", "Tree", Color(0, 0, 0));
- t->set_color("guide_color", "Tree", Color(0, 0, 0, 0.1));
- t->set_color("drop_position_color", "Tree", Color(1, 0.3, 0.2));
- t->set_color("relationship_line_color", "Tree", Color::html("464646"));
-
- t->set_constant("hseparation", "Tree", 4 * scale);
- t->set_constant("vseparation", "Tree", 4 * scale);
- t->set_constant("guide_width", "Tree", 2 * scale);
- t->set_constant("item_margin", "Tree", 12 * scale);
- t->set_constant("button_margin", "Tree", 4 * scale);
- t->set_constant("draw_relationship_lines", "Tree", 0);
- t->set_constant("scroll_border", "Tree", 4);
- t->set_constant("scroll_speed", "Tree", 12);
+ theme->set_stylebox("bg", "Tree", make_stylebox(tree_bg_png, 4, 4, 4, 5));
+ theme->set_stylebox("bg_focus", "Tree", focus);
+ theme->set_stylebox("selected", "Tree", tree_selected_oof);
+ theme->set_stylebox("selected_focus", "Tree", tree_selected);
+ theme->set_stylebox("cursor", "Tree", focus);
+ theme->set_stylebox("cursor_unfocused", "Tree", focus);
+ theme->set_stylebox("button_pressed", "Tree", make_stylebox(button_pressed_png, 4, 4, 4, 4));
+ theme->set_stylebox("title_button_normal", "Tree", make_stylebox(tree_title_png, 4, 4, 4, 4));
+ theme->set_stylebox("title_button_pressed", "Tree", make_stylebox(tree_title_pressed_png, 4, 4, 4, 4));
+ theme->set_stylebox("title_button_hover", "Tree", make_stylebox(tree_title_png, 4, 4, 4, 4));
+ theme->set_stylebox("custom_button", "Tree", sb_button_normal);
+ theme->set_stylebox("custom_button_pressed", "Tree", sb_button_pressed);
+ theme->set_stylebox("custom_button_hover", "Tree", sb_button_hover);
+
+ theme->set_icon("checked", "Tree", make_icon(checked_png));
+ theme->set_icon("unchecked", "Tree", make_icon(unchecked_png));
+ theme->set_icon("updown", "Tree", make_icon(updown_png));
+ theme->set_icon("select_arrow", "Tree", make_icon(dropdown_png));
+ theme->set_icon("arrow", "Tree", make_icon(arrow_down_png));
+ theme->set_icon("arrow_collapsed", "Tree", make_icon(arrow_right_png));
+
+ theme->set_font("title_button_font", "Tree", default_font);
+ theme->set_font("font", "Tree", default_font);
+
+ theme->set_color("title_button_color", "Tree", control_font_color);
+ theme->set_color("font_color", "Tree", control_font_color_low);
+ theme->set_color("font_color_selected", "Tree", control_font_color_pressed);
+ theme->set_color("selection_color", "Tree", Color(0.1, 0.1, 1, 0.8));
+ theme->set_color("cursor_color", "Tree", Color(0, 0, 0));
+ theme->set_color("guide_color", "Tree", Color(0, 0, 0, 0.1));
+ theme->set_color("drop_position_color", "Tree", Color(1, 0.3, 0.2));
+ theme->set_color("relationship_line_color", "Tree", Color::html("464646"));
+ theme->set_color("custom_button_font_highlight", "Tree", control_font_color_hover);
+
+ theme->set_constant("hseparation", "Tree", 4 * scale);
+ theme->set_constant("vseparation", "Tree", 4 * scale);
+ theme->set_constant("guide_width", "Tree", 2 * scale);
+ theme->set_constant("item_margin", "Tree", 12 * scale);
+ theme->set_constant("button_margin", "Tree", 4 * scale);
+ theme->set_constant("draw_relationship_lines", "Tree", 0);
+ theme->set_constant("scroll_border", "Tree", 4);
+ theme->set_constant("scroll_speed", "Tree", 12);
// ItemList
Ref<StyleBoxTexture> item_selected = make_stylebox(selection_png, 4, 4, 4, 4, 8, 2, 8, 2);
Ref<StyleBoxTexture> item_selected_oof = make_stylebox(selection_oof_png, 4, 4, 4, 4, 8, 2, 8, 2);
- t->set_stylebox("bg", "ItemList", make_stylebox(tree_bg_png, 4, 4, 4, 5));
- t->set_stylebox("bg_focus", "ItemList", focus);
- t->set_constant("hseparation", "ItemList", 4);
- t->set_constant("vseparation", "ItemList", 2);
- t->set_constant("icon_margin", "ItemList", 4);
- t->set_constant("line_separation", "ItemList", 2 * scale);
- t->set_font("font", "ItemList", default_font);
- t->set_color("font_color", "ItemList", control_font_color_lower);
- t->set_color("font_color_selected", "ItemList", control_font_color_pressed);
- t->set_color("guide_color", "ItemList", Color(0, 0, 0, 0.1));
- t->set_stylebox("selected", "ItemList", item_selected_oof);
- t->set_stylebox("selected_focus", "ItemList", item_selected);
- t->set_stylebox("cursor", "ItemList", focus);
- t->set_stylebox("cursor_unfocused", "ItemList", focus);
+ theme->set_stylebox("bg", "ItemList", make_stylebox(tree_bg_png, 4, 4, 4, 5));
+ theme->set_stylebox("bg_focus", "ItemList", focus);
+ theme->set_constant("hseparation", "ItemList", 4);
+ theme->set_constant("vseparation", "ItemList", 2);
+ theme->set_constant("icon_margin", "ItemList", 4);
+ theme->set_constant("line_separation", "ItemList", 2 * scale);
+ theme->set_font("font", "ItemList", default_font);
+ theme->set_color("font_color", "ItemList", control_font_color_lower);
+ theme->set_color("font_color_selected", "ItemList", control_font_color_pressed);
+ theme->set_color("guide_color", "ItemList", Color(0, 0, 0, 0.1));
+ theme->set_stylebox("selected", "ItemList", item_selected_oof);
+ theme->set_stylebox("selected_focus", "ItemList", item_selected);
+ theme->set_stylebox("cursor", "ItemList", focus);
+ theme->set_stylebox("cursor_unfocused", "ItemList", focus);
// TabContainer
@@ -688,90 +691,88 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
tc_sb->set_expand_margin_size(MARGIN_TOP, 2 * scale);
tc_sb->set_default_margin(MARGIN_TOP, 8 * scale);
- 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);
+ theme->set_stylebox("tab_fg", "TabContainer", sb_expand(make_stylebox(tab_current_png, 4, 4, 4, 1, 16, 4, 16, 4), 2, 2, 2, 2));
+ theme->set_stylebox("tab_bg", "TabContainer", sb_expand(make_stylebox(tab_behind_png, 5, 5, 5, 1, 16, 6, 16, 4), 3, 0, 3, 3));
+ theme->set_stylebox("panel", "TabContainer", tc_sb);
- t->set_icon("increment", "TabContainer", make_icon(scroll_button_right_png));
- t->set_icon("increment_hilite", "TabContainer", make_icon(scroll_button_right_hl_png));
- t->set_icon("decrement", "TabContainer", make_icon(scroll_button_left_png));
- t->set_icon("decrement_hilite", "TabContainer", make_icon(scroll_button_left_hl_png));
- t->set_icon("menu", "TabContainer", make_icon(tab_menu_png));
- t->set_icon("menu_hilite", "TabContainer", make_icon(tab_menu_hl_png));
+ theme->set_icon("increment", "TabContainer", make_icon(scroll_button_right_png));
+ theme->set_icon("increment_highlight", "TabContainer", make_icon(scroll_button_right_hl_png));
+ theme->set_icon("decrement", "TabContainer", make_icon(scroll_button_left_png));
+ theme->set_icon("decrement_highlight", "TabContainer", make_icon(scroll_button_left_hl_png));
+ theme->set_icon("menu", "TabContainer", make_icon(tab_menu_png));
+ theme->set_icon("menu_highlight", "TabContainer", make_icon(tab_menu_hl_png));
- t->set_font("font", "TabContainer", default_font);
+ theme->set_font("font", "TabContainer", default_font);
- 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);
+ theme->set_color("font_color_fg", "TabContainer", control_font_color_hover);
+ theme->set_color("font_color_bg", "TabContainer", control_font_color_low);
+ theme->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);
- t->set_constant("label_valign_fg", "TabContainer", 0 * scale);
- t->set_constant("label_valign_bg", "TabContainer", 2 * scale);
- t->set_constant("hseparation", "TabContainer", 4 * scale);
+ theme->set_constant("side_margin", "TabContainer", 8 * scale);
+ theme->set_constant("top_margin", "TabContainer", 24 * scale);
+ theme->set_constant("label_valign_fg", "TabContainer", 0 * scale);
+ theme->set_constant("label_valign_bg", "TabContainer", 2 * scale);
+ theme->set_constant("hseparation", "TabContainer", 4 * scale);
// Tabs
- 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));
+ theme->set_stylebox("tab_fg", "Tabs", sb_expand(make_stylebox(tab_current_png, 4, 3, 4, 1, 16, 3, 16, 2), 2, 2, 2, 2));
+ theme->set_stylebox("tab_bg", "Tabs", sb_expand(make_stylebox(tab_behind_png, 5, 4, 5, 1, 16, 5, 16, 2), 3, 3, 3, 3));
+ theme->set_stylebox("panel", "Tabs", tc_sb);
+ theme->set_stylebox("button_pressed", "Tabs", make_stylebox(button_pressed_png, 4, 4, 4, 4));
+ theme->set_stylebox("button", "Tabs", make_stylebox(button_normal_png, 4, 4, 4, 4));
- t->set_icon("increment", "Tabs", make_icon(scroll_button_right_png));
- t->set_icon("increment_hilite", "Tabs", make_icon(scroll_button_right_hl_png));
- t->set_icon("decrement", "Tabs", make_icon(scroll_button_left_png));
- t->set_icon("decrement_hilite", "Tabs", make_icon(scroll_button_left_hl_png));
- t->set_icon("close", "Tabs", make_icon(tab_close_png));
+ theme->set_icon("increment", "Tabs", make_icon(scroll_button_right_png));
+ theme->set_icon("increment_highlight", "Tabs", make_icon(scroll_button_right_hl_png));
+ theme->set_icon("decrement", "Tabs", make_icon(scroll_button_left_png));
+ theme->set_icon("decrement_highlight", "Tabs", make_icon(scroll_button_left_hl_png));
+ theme->set_icon("close", "Tabs", make_icon(tab_close_png));
- t->set_font("font", "Tabs", default_font);
+ theme->set_font("font", "Tabs", default_font);
- 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);
+ theme->set_color("font_color_fg", "Tabs", control_font_color_hover);
+ theme->set_color("font_color_bg", "Tabs", control_font_color_low);
+ theme->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);
- t->set_constant("label_valign_bg", "Tabs", 2 * scale);
- t->set_constant("hseparation", "Tabs", 4 * scale);
+ theme->set_constant("top_margin", "Tabs", 24 * scale);
+ theme->set_constant("label_valign_fg", "Tabs", 0 * scale);
+ theme->set_constant("label_valign_bg", "Tabs", 2 * scale);
+ theme->set_constant("hseparation", "Tabs", 4 * scale);
// Separators
- t->set_stylebox("separator", "HSeparator", make_stylebox(vseparator_png, 3, 3, 3, 3));
- t->set_stylebox("separator", "VSeparator", make_stylebox(hseparator_png, 3, 3, 3, 3));
+ theme->set_stylebox("separator", "HSeparator", make_stylebox(vseparator_png, 3, 3, 3, 3));
+ theme->set_stylebox("separator", "VSeparator", make_stylebox(hseparator_png, 3, 3, 3, 3));
- t->set_icon("close", "Icons", make_icon(icon_close_png));
- t->set_font("normal", "Fonts", default_font);
- t->set_font("large", "Fonts", large_font);
+ theme->set_icon("close", "Icons", make_icon(icon_close_png));
+ theme->set_font("normal", "Fonts", default_font);
+ theme->set_font("large", "Fonts", large_font);
- t->set_constant("separation", "HSeparator", 4 * scale);
- t->set_constant("separation", "VSeparator", 4 * scale);
+ theme->set_constant("separation", "HSeparator", 4 * scale);
+ theme->set_constant("separation", "VSeparator", 4 * scale);
// Dialogs
- t->set_constant("margin", "Dialogs", 8 * scale);
- t->set_constant("button_margin", "Dialogs", 32 * scale);
+ theme->set_constant("margin", "Dialogs", 8 * scale);
+ theme->set_constant("button_margin", "Dialogs", 32 * scale);
// FileDialog
- t->set_icon("folder", "FileDialog", make_icon(icon_folder_png));
- t->set_color("files_disabled", "FileDialog", Color(0, 0, 0, 0.7));
+ theme->set_icon("folder", "FileDialog", make_icon(icon_folder_png));
+ theme->set_color("files_disabled", "FileDialog", Color(0, 0, 0, 0.7));
// colorPicker
- t->set_constant("value_height", "ColorPicker", 23 * scale);
- t->set_constant("value_width", "ColorPicker", 50 * scale);
- t->set_constant("color_width", "ColorPicker", 100 * scale);
- t->set_constant("label_width", "ColorPicker", 20 * scale);
- t->set_constant("hseparator", "ColorPicker", 4 * scale);
+ theme->set_constant("margin", "ColorPicker", 4 * scale);
+ theme->set_constant("sv_width", "ColorPicker", 256 * scale);
+ theme->set_constant("sv_height", "ColorPicker", 256 * scale);
+ theme->set_constant("h_width", "ColorPicker", 30 * scale);
+ theme->set_constant("label_width", "ColorPicker", 10 * scale);
- t->set_icon("screen_picker", "ColorPicker", make_icon(icon_color_pick_png));
- t->set_icon("add_preset", "ColorPicker", make_icon(icon_add_png));
- t->set_icon("color_hue", "ColorPicker", make_icon(color_picker_hue_png));
- t->set_icon("color_sample", "ColorPicker", make_icon(color_picker_sample_png));
+ theme->set_icon("screen_picker", "ColorPicker", make_icon(icon_color_pick_png));
+ theme->set_icon("add_preset", "ColorPicker", make_icon(icon_add_png));
+ theme->set_icon("color_hue", "ColorPicker", make_icon(color_picker_hue_png));
+ theme->set_icon("color_sample", "ColorPicker", make_icon(color_picker_sample_png));
// TooltipPanel
@@ -779,111 +780,111 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
for (int i = 0; i < 4; i++)
style_tt->set_expand_margin_size((Margin)i, 4 * scale);
- t->set_stylebox("panel", "TooltipPanel", style_tt);
+ theme->set_stylebox("panel", "TooltipPanel", style_tt);
- t->set_font("font", "TooltipLabel", default_font);
+ theme->set_font("font", "TooltipLabel", default_font);
- t->set_color("font_color", "TooltipLabel", Color(0, 0, 0));
- t->set_color("font_color_shadow", "TooltipLabel", Color(0, 0, 0, 0.1));
+ theme->set_color("font_color", "TooltipLabel", Color(0, 0, 0));
+ theme->set_color("font_color_shadow", "TooltipLabel", Color(0, 0, 0, 0.1));
- t->set_constant("shadow_offset_x", "TooltipLabel", 1);
- t->set_constant("shadow_offset_y", "TooltipLabel", 1);
+ theme->set_constant("shadow_offset_x", "TooltipLabel", 1);
+ theme->set_constant("shadow_offset_y", "TooltipLabel", 1);
// RichTextLabel
- t->set_stylebox("focus", "RichTextLabel", focus);
+ theme->set_stylebox("focus", "RichTextLabel", focus);
- t->set_font("normal_font", "RichTextLabel", default_font);
- t->set_font("bold_font", "RichTextLabel", default_font);
- t->set_font("italics_font", "RichTextLabel", default_font);
- t->set_font("bold_italics_font", "RichTextLabel", default_font);
- t->set_font("mono_font", "RichTextLabel", default_font);
+ theme->set_font("normal_font", "RichTextLabel", default_font);
+ theme->set_font("bold_font", "RichTextLabel", default_font);
+ theme->set_font("italics_font", "RichTextLabel", default_font);
+ theme->set_font("bold_italics_font", "RichTextLabel", default_font);
+ theme->set_font("mono_font", "RichTextLabel", default_font);
- t->set_color("default_color", "RichTextLabel", control_font_color);
- t->set_color("font_color_selected", "RichTextLabel", font_color_selection);
- t->set_color("selection_color", "RichTextLabel", Color(0.1, 0.1, 1, 0.8));
+ theme->set_color("default_color", "RichTextLabel", control_font_color);
+ theme->set_color("font_color_selected", "RichTextLabel", font_color_selection);
+ theme->set_color("selection_color", "RichTextLabel", Color(0.1, 0.1, 1, 0.8));
- t->set_constant("line_separation", "RichTextLabel", 1 * scale);
- t->set_constant("table_hseparation", "RichTextLabel", 3 * scale);
- t->set_constant("table_vseparation", "RichTextLabel", 3 * scale);
+ theme->set_constant("line_separation", "RichTextLabel", 1 * scale);
+ theme->set_constant("table_hseparation", "RichTextLabel", 3 * scale);
+ theme->set_constant("table_vseparation", "RichTextLabel", 3 * scale);
// Containers
- t->set_stylebox("bg", "VSplitContainer", make_stylebox(vsplit_bg_png, 1, 1, 1, 1));
- t->set_stylebox("bg", "HSplitContainer", make_stylebox(hsplit_bg_png, 1, 1, 1, 1));
-
- t->set_icon("grabber", "VSplitContainer", make_icon(vsplitter_png));
- t->set_icon("grabber", "HSplitContainer", make_icon(hsplitter_png));
-
- t->set_constant("separation", "HBoxContainer", 4 * scale);
- t->set_constant("separation", "VBoxContainer", 4 * scale);
- t->set_constant("margin_left", "MarginContainer", 8 * scale);
- t->set_constant("margin_top", "MarginContainer", 0 * scale);
- t->set_constant("margin_right", "MarginContainer", 0 * scale);
- t->set_constant("margin_bottom", "MarginContainer", 0 * scale);
- t->set_constant("hseparation", "GridContainer", 4 * scale);
- t->set_constant("vseparation", "GridContainer", 4 * scale);
- t->set_constant("separation", "HSplitContainer", 12 * scale);
- t->set_constant("separation", "VSplitContainer", 12 * scale);
- t->set_constant("autohide", "HSplitContainer", 1 * scale);
- t->set_constant("autohide", "VSplitContainer", 1 * scale);
+ theme->set_stylebox("bg", "VSplitContainer", make_stylebox(vsplit_bg_png, 1, 1, 1, 1));
+ theme->set_stylebox("bg", "HSplitContainer", make_stylebox(hsplit_bg_png, 1, 1, 1, 1));
+
+ theme->set_icon("grabber", "VSplitContainer", make_icon(vsplitter_png));
+ theme->set_icon("grabber", "HSplitContainer", make_icon(hsplitter_png));
+
+ theme->set_constant("separation", "HBoxContainer", 4 * scale);
+ theme->set_constant("separation", "VBoxContainer", 4 * scale);
+ theme->set_constant("margin_left", "MarginContainer", 8 * scale);
+ theme->set_constant("margin_top", "MarginContainer", 0 * scale);
+ theme->set_constant("margin_right", "MarginContainer", 0 * scale);
+ theme->set_constant("margin_bottom", "MarginContainer", 0 * scale);
+ theme->set_constant("hseparation", "GridContainer", 4 * scale);
+ theme->set_constant("vseparation", "GridContainer", 4 * scale);
+ theme->set_constant("separation", "HSplitContainer", 12 * scale);
+ theme->set_constant("separation", "VSplitContainer", 12 * scale);
+ theme->set_constant("autohide", "HSplitContainer", 1 * scale);
+ theme->set_constant("autohide", "VSplitContainer", 1 * scale);
// HButtonArray
- t->set_stylebox("normal", "HButtonArray", sb_button_normal);
- t->set_stylebox("selected", "HButtonArray", sb_button_pressed);
- t->set_stylebox("hover", "HButtonArray", sb_button_hover);
+ theme->set_stylebox("normal", "HButtonArray", sb_button_normal);
+ theme->set_stylebox("selected", "HButtonArray", sb_button_pressed);
+ theme->set_stylebox("hover", "HButtonArray", sb_button_hover);
- t->set_font("font", "HButtonArray", default_font);
- t->set_font("font_selected", "HButtonArray", default_font);
+ theme->set_font("font", "HButtonArray", default_font);
+ theme->set_font("font_selected", "HButtonArray", default_font);
- t->set_color("font_color", "HButtonArray", control_font_color_low);
- t->set_color("font_color_selected", "HButtonArray", control_font_color_hover);
+ theme->set_color("font_color", "HButtonArray", control_font_color_low);
+ theme->set_color("font_color_selected", "HButtonArray", control_font_color_hover);
- t->set_constant("icon_separator", "HButtonArray", 2 * scale);
- t->set_constant("button_separator", "HButtonArray", 4 * scale);
+ theme->set_constant("icon_separator", "HButtonArray", 2 * scale);
+ theme->set_constant("button_separator", "HButtonArray", 4 * scale);
- t->set_stylebox("focus", "HButtonArray", focus);
+ theme->set_stylebox("focus", "HButtonArray", focus);
// VButtonArray
- t->set_stylebox("normal", "VButtonArray", sb_button_normal);
- t->set_stylebox("selected", "VButtonArray", sb_button_pressed);
- t->set_stylebox("hover", "VButtonArray", sb_button_hover);
+ theme->set_stylebox("normal", "VButtonArray", sb_button_normal);
+ theme->set_stylebox("selected", "VButtonArray", sb_button_pressed);
+ theme->set_stylebox("hover", "VButtonArray", sb_button_hover);
- t->set_font("font", "VButtonArray", default_font);
- t->set_font("font_selected", "VButtonArray", default_font);
+ theme->set_font("font", "VButtonArray", default_font);
+ theme->set_font("font_selected", "VButtonArray", default_font);
- t->set_color("font_color", "VButtonArray", control_font_color_low);
- t->set_color("font_color_selected", "VButtonArray", control_font_color_hover);
+ theme->set_color("font_color", "VButtonArray", control_font_color_low);
+ theme->set_color("font_color_selected", "VButtonArray", control_font_color_hover);
- t->set_constant("icon_separator", "VButtonArray", 2 * scale);
- t->set_constant("button_separator", "VButtonArray", 4 * scale);
+ theme->set_constant("icon_separator", "VButtonArray", 2 * scale);
+ theme->set_constant("button_separator", "VButtonArray", 4 * scale);
- t->set_stylebox("focus", "VButtonArray", focus);
+ theme->set_stylebox("focus", "VButtonArray", focus);
// ReferenceRect
Ref<StyleBoxTexture> ttnc = make_stylebox(full_panel_bg_png, 8, 8, 8, 8);
ttnc->set_draw_center(false);
- t->set_stylebox("border", "ReferenceRect", make_stylebox(reference_border_png, 4, 4, 4, 4));
- t->set_stylebox("panelnc", "Panel", ttnc);
- t->set_stylebox("panelf", "Panel", tc_sb);
+ theme->set_stylebox("border", "ReferenceRect", make_stylebox(reference_border_png, 4, 4, 4, 4));
+ theme->set_stylebox("panelnc", "Panel", ttnc);
+ theme->set_stylebox("panelf", "Panel", tc_sb);
Ref<StyleBoxTexture> sb_pc = make_stylebox(tab_container_bg_png, 4, 4, 4, 4, 7, 7, 7, 7);
- t->set_stylebox("panel", "PanelContainer", sb_pc);
-
- t->set_icon("minus", "GraphEdit", make_icon(icon_zoom_less_png));
- t->set_icon("reset", "GraphEdit", make_icon(icon_zoom_reset_png));
- t->set_icon("more", "GraphEdit", make_icon(icon_zoom_more_png));
- t->set_icon("snap", "GraphEdit", make_icon(icon_snap_png));
- t->set_stylebox("bg", "GraphEdit", make_stylebox(tree_bg_png, 4, 4, 4, 5));
- t->set_color("grid_minor", "GraphEdit", Color(1, 1, 1, 0.05));
- t->set_color("grid_major", "GraphEdit", Color(1, 1, 1, 0.2));
- t->set_constant("bezier_len_pos", "GraphEdit", 80 * scale);
- t->set_constant("bezier_len_neg", "GraphEdit", 160 * scale);
-
- t->set_icon("logo", "Icons", make_icon(logo_png));
+ theme->set_stylebox("panel", "PanelContainer", sb_pc);
+
+ theme->set_icon("minus", "GraphEdit", make_icon(icon_zoom_less_png));
+ theme->set_icon("reset", "GraphEdit", make_icon(icon_zoom_reset_png));
+ theme->set_icon("more", "GraphEdit", make_icon(icon_zoom_more_png));
+ theme->set_icon("snap", "GraphEdit", make_icon(icon_snap_png));
+ theme->set_stylebox("bg", "GraphEdit", make_stylebox(tree_bg_png, 4, 4, 4, 5));
+ theme->set_color("grid_minor", "GraphEdit", Color(1, 1, 1, 0.05));
+ theme->set_color("grid_major", "GraphEdit", Color(1, 1, 1, 0.2));
+ theme->set_constant("bezier_len_pos", "GraphEdit", 80 * scale);
+ theme->set_constant("bezier_len_neg", "GraphEdit", 160 * scale);
+
+ theme->set_icon("logo", "Icons", make_icon(logo_png));
// Theme
diff --git a/scene/resources/default_theme/default_theme.h b/scene/resources/default_theme/default_theme.h
index fc557e4270..6fd57b6f22 100644
--- a/scene/resources/default_theme/default_theme.h
+++ b/scene/resources/default_theme/default_theme.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/default_theme/hslider_grabber_disabled.png b/scene/resources/default_theme/hslider_grabber_disabled.png
new file mode 100644
index 0000000000..0d75182b8f
--- /dev/null
+++ b/scene/resources/default_theme/hslider_grabber_disabled.png
Binary files differ
diff --git a/scene/resources/default_theme/make_header.py b/scene/resources/default_theme/make_header.py
index 03c2c9be4a..db449f9417 100755
--- a/scene/resources/default_theme/make_header.py
+++ b/scene/resources/default_theme/make_header.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import os
import glob
@@ -10,21 +11,17 @@ f = open("theme_data.h", "wb")
f.write("// THIS FILE HAS BEEN AUTOGENERATED, DON'T EDIT!!\n")
-f.write("\n\n")
-
# Generate png image block
+f.write("\n// png image block\n");
pixmaps = glob.glob("*.png")
-
pixmaps.sort()
-f.write("\n\n\n")
-
for x in pixmaps:
var_str = x[:-4] + "_png"
- f.write("static const unsigned char " + var_str + "[]={\n")
+ f.write("\nstatic const unsigned char " + var_str + "[] = {\n\t")
pngf = open(x, "rb")
@@ -33,24 +30,22 @@ for x in pixmaps:
f.write(hex(ord(b)))
b = pngf.read(1)
if (len(b) == 1):
- f.write(",")
+ f.write(", ")
- f.write("\n};\n\n\n")
+ f.write("\n};\n")
pngf.close()
# Generate shaders block
+f.write("\n// shaders block\n");
shaders = glob.glob("*.gsl")
-
shaders.sort()
-f.write("\n\n\n")
-
for x in shaders:
var_str = x[:-4] + "_shader_code"
- f.write("static const char *" + var_str + "=\n")
+ f.write("\nstatic const char *" + var_str + " = \n")
sf = open(x, "rb")
@@ -65,7 +60,7 @@ for x in shaders:
if (b != ""):
f.write("\"\n")
- f.write("\";\n\n\n")
+ f.write("\";\n")
sf.close()
f.close()
diff --git a/scene/resources/default_theme/scroll_grabber_pressed.png b/scene/resources/default_theme/scroll_grabber_pressed.png
new file mode 100644
index 0000000000..a46d242ddd
--- /dev/null
+++ b/scene/resources/default_theme/scroll_grabber_pressed.png
Binary files differ
diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h
index 394cfaf424..bed4bdb760 100644
--- a/scene/resources/default_theme/theme_data.h
+++ b/scene/resources/default_theme/theme_data.h
@@ -1,578 +1,469 @@
-// THIS FILE HAS BEEN AUTOGENERATED, DONT EDIT!!
+// THIS FILE HAS BEEN AUTOGENERATED, DON'T EDIT!!
+// png image block
-
-
-
-static const unsigned char arrow_down_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xc,0x0,0x0,0x0,0xc,0x8,0x6,0x0,0x0,0x0,0x56,0x75,0x5c,0xe7,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x6d,0x49,0x44,0x41,0x54,0x28,0x91,0x63,0x60,0x18,0x74,0x80,0x11,0xc6,0x78,0xf0,0xe0,0xc1,0x7f,0x7c,0xa,0x15,0x14,0x14,0x18,0x19,0x18,0x18,0x18,0x98,0x48,0xb5,0x81,0x7c,0xd,0x8c,0x8c,0x8c,0xf1,0xc,0xc,0xc,0x5f,0xb1,0xa8,0xf9,0xce,0xc8,0xc8,0x98,0xe,0x57,0x87,0x2c,0x73,0xff,0xfe,0x7d,0xd,0x6,0x6,0x86,0x55,0x8c,0x8c,0x8c,0xba,0x50,0xa1,0x1b,0xcc,0xcc,0xcc,0x61,0xb2,0xb2,0xb2,0x97,0xb1,0x6a,0x60,0x60,0x60,0x60,0x78,0xf1,0xe2,0x5,0xf7,0xcf,0x9f,0x3f,0xa7,0x30,0x30,0x30,0x30,0xb0,0xb3,0xb3,0xe7,0x48,0x48,0x48,0x60,0xb3,0x75,0x30,0x1,0x0,0x28,0x20,0x14,0xc2,0x1b,0xd0,0x7c,0xca,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char arrow_down_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0xc, 0x8, 0x6, 0x0, 0x0, 0x0, 0x56, 0x75, 0x5c, 0xe7, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0x6d, 0x49, 0x44, 0x41, 0x54, 0x28, 0x91, 0x63, 0x60, 0x18, 0x74, 0x80, 0x11, 0xc6, 0x78, 0xf0, 0xe0, 0xc1, 0x7f, 0x7c, 0xa, 0x15, 0x14, 0x14, 0x18, 0x19, 0x18, 0x18, 0x18, 0x98, 0x48, 0xb5, 0x81, 0x7c, 0xd, 0x8c, 0x8c, 0x8c, 0xf1, 0xc, 0xc, 0xc, 0x5f, 0xb1, 0xa8, 0xf9, 0xce, 0xc8, 0xc8, 0x98, 0xe, 0x57, 0x87, 0x2c, 0x73, 0xff, 0xfe, 0x7d, 0xd, 0x6, 0x6, 0x86, 0x55, 0x8c, 0x8c, 0x8c, 0xba, 0x50, 0xa1, 0x1b, 0xcc, 0xcc, 0xcc, 0x61, 0xb2, 0xb2, 0xb2, 0x97, 0xb1, 0x6a, 0x60, 0x60, 0x60, 0x60, 0x78, 0xf1, 0xe2, 0x5, 0xf7, 0xcf, 0x9f, 0x3f, 0xa7, 0x30, 0x30, 0x30, 0x30, 0xb0, 0xb3, 0xb3, 0xe7, 0x48, 0x48, 0x48, 0x60, 0xb3, 0x75, 0x30, 0x1, 0x0, 0x28, 0x20, 0x14, 0xc2, 0x1b, 0xd0, 0x7c, 0xca, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char arrow_right_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xc,0x0,0x0,0x0,0xc,0x8,0x6,0x0,0x0,0x0,0x56,0x75,0x5c,0xe7,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x6c,0x49,0x44,0x41,0x54,0x28,0x91,0x63,0x60,0xa0,0x35,0x60,0x44,0xe6,0x3c,0x78,0xf0,0xe0,0x3f,0x8c,0xfd,0xff,0xff,0xff,0x44,0x45,0x45,0xc5,0x5,0xe8,0x1a,0x98,0x70,0x9a,0xc4,0xc8,0x38,0xe5,0xe1,0xc3,0x87,0xda,0x44,0x6b,0x60,0x60,0x60,0xe0,0xfe,0xff,0xff,0xff,0xaa,0x17,0x2f,0x5e,0x70,0x13,0xab,0x81,0x81,0x81,0x81,0x41,0xeb,0xe7,0xcf,0x9f,0x53,0x48,0xd1,0x80,0x1,0x8,0x69,0xb8,0xc6,0xce,0xce,0x9e,0x43,0xac,0x86,0xaf,0x8c,0x8c,0x8c,0x61,0x12,0x12,0x12,0x5f,0x89,0xd2,0xf0,0xff,0xff,0xff,0x1c,0x79,0x79,0xf9,0xab,0x84,0x1d,0x49,0x6d,0x0,0x0,0x8f,0x30,0x1e,0x10,0x6e,0x79,0xda,0xf9,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char arrow_right_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0xc, 0x8, 0x6, 0x0, 0x0, 0x0, 0x56, 0x75, 0x5c, 0xe7, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0x6c, 0x49, 0x44, 0x41, 0x54, 0x28, 0x91, 0x63, 0x60, 0xa0, 0x35, 0x60, 0x44, 0xe6, 0x3c, 0x78, 0xf0, 0xe0, 0x3f, 0x8c, 0xfd, 0xff, 0xff, 0xff, 0x44, 0x45, 0x45, 0xc5, 0x5, 0xe8, 0x1a, 0x98, 0x70, 0x9a, 0xc4, 0xc8, 0x38, 0xe5, 0xe1, 0xc3, 0x87, 0xda, 0x44, 0x6b, 0x60, 0x60, 0x60, 0xe0, 0xfe, 0xff, 0xff, 0xff, 0xaa, 0x17, 0x2f, 0x5e, 0x70, 0x13, 0xab, 0x81, 0x81, 0x81, 0x81, 0x41, 0xeb, 0xe7, 0xcf, 0x9f, 0x53, 0x48, 0xd1, 0x80, 0x1, 0x8, 0x69, 0xb8, 0xc6, 0xce, 0xce, 0x9e, 0x43, 0xac, 0x86, 0xaf, 0x8c, 0x8c, 0x8c, 0x61, 0x12, 0x12, 0x12, 0x5f, 0x89, 0xd2, 0xf0, 0xff, 0xff, 0xff, 0x1c, 0x79, 0x79, 0xf9, 0xab, 0x84, 0x1d, 0x49, 0x6d, 0x0, 0x0, 0x8f, 0x30, 0x1e, 0x10, 0x6e, 0x79, 0xda, 0xf9, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char background_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x3,0x0,0x0,0x0,0x44,0xa4,0x8a,0xc6,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,0x1,0x11,0x50,0x4c,0x54,0x45,0x91,0xc9,0xab,0x90,0xc9,0xab,0x90,0xc9,0xaa,0x90,0xc8,0xab,0x91,0xc9,0xaa,0x91,0xc8,0xab,0x90,0xc8,0xaa,0x8f,0xc8,0xab,0x8f,0xc9,0xab,0x8f,0xc8,0xaa,0x90,0xc7,0xaa,0x90,0xc7,0xab,0x8f,0xc7,0xaa,0x8f,0xc7,0xab,0x8e,0xc7,0xab,0x8e,0xc6,0xab,0x8f,0xc6,0xab,0x8e,0xc6,0xaa,0x8f,0xc6,0xaa,0x8e,0xc7,0xaa,0x8e,0xc5,0xaa,0x8e,0xc5,0xab,0x8d,0xc5,0xaa,0x8d,0xc5,0xab,0x8d,0xc6,0xaa,0x8d,0xc6,0xab,0x8d,0xc4,0xaa,0x8e,0xc4,0xab,0x8d,0xc4,0xab,0x8e,0xc4,0xaa,0x8c,0xc4,0xaa,0x8c,0xc5,0xaa,0x8d,0xc3,0xab,0x8d,0xc3,0xaa,0x8c,0xc3,0xaa,0x8c,0xc4,0xab,0x8c,0xc3,0xab,0x8c,0xc2,0xab,0x8b,0xc2,0xaa,0x8b,0xc3,0xaa,0x8b,0xc3,0xab,0x8c,0xc2,0xaa,0x8b,0xc2,0xab,0x8b,0xc1,0xaa,0x8b,0xc1,0xab,0x8a,0xc2,0xaa,0x8a,0xc1,0xaa,0x8a,0xc0,0xaa,0x8b,0xc0,0xaa,0x8a,0xc1,0xa9,0x8a,0xc0,0xa9,0x89,0xc0,0xaa,0x8a,0xbf,0xaa,0x89,0xbf,0xaa,0x89,0xbf,0xa9,0x8a,0xbf,0xa9,0x88,0xbf,0xaa,0x89,0xbe,0xaa,0x89,0xbe,0xa9,0x88,0xbf,0xa9,0x88,0xbe,0xa9,0x88,0xbe,0xaa,0x88,0xbd,0xaa,0x88,0xbd,0xa9,0x89,0xbd,0xaa,0x89,0xbd,0xa9,0x87,0xbe,0xa9,0x87,0xbd,0xaa,0x87,0xbe,0xaa,0x87,0xbd,0xa9,0x87,0xbc,0xaa,0x88,0xbc,0xa9,0x88,0xbc,0xaa,0x87,0xbc,0xa9,0x86,0xbc,0xa9,0x87,0xbb,0xaa,0x87,0xbb,0xa9,0x86,0xbb,0xa9,0x86,0xbc,0xaa,0x86,0xbb,0xaa,0x86,0xba,0xaa,0x86,0xba,0xa9,0x85,0xba,0xa9,0x85,0xbb,0xaa,0x85,0xbb,0xa9,0x85,0xba,0xaa,0x85,0xb9,0xa9,0x86,0xb9,0xa9,0x86,0xb9,0xaa,0x85,0xb9,0xaa,0xff,0xff,0xff,0x25,0xe,0xc5,0xe1,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x5a,0x3,0xbb,0xa5,0xa2,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,0x2,0xaa,0x49,0x44,0x41,0x54,0x38,0xcb,0x45,0x4b,0xd,0x63,0x9a,0x56,0x14,0xbd,0x86,0x2d,0x24,0x2b,0xf8,0x8a,0x1,0xcc,0x18,0x23,0xcd,0x8b,0xc5,0x2a,0xa9,0x6e,0x51,0x98,0x58,0x3e,0xda,0x52,0x69,0x9e,0x4a,0x10,0xba,0xb8,0xec,0xff,0xff,0x91,0x9d,0x47,0xd2,0xf5,0xbc,0xcb,0x3d,0x1f,0xf7,0x40,0xd4,0x23,0x4c,0x4f,0x2,0x9b,0xa8,0x93,0x27,0x9d,0xa3,0xe7,0x50,0xe9,0xc9,0x79,0x69,0x74,0xf7,0x9f,0x7a,0x8a,0xd2,0xfb,0xf9,0xf4,0x25,0x53,0xd5,0x33,0xf4,0xcf,0xce,0x90,0x9d,0xa8,0xa,0x80,0x75,0xaa,0xc8,0xca,0xa9,0xa2,0x9c,0xf4,0x54,0x52,0x91,0x9c,0xab,0x2a,0x46,0x42,0xf9,0xe5,0xb4,0x2b,0xa9,0xe7,0xca,0xab,0x57,0xc8,0x15,0x8d,0x74,0x4d,0xd5,0x25,0x40,0x8a,0xae,0xea,0xda,0xb9,0xd6,0x59,0x55,0x12,0xfe,0xd0,0x49,0xef,0xb3,0xbe,0xfe,0x5a,0x37,0x34,0x66,0x30,0x5d,0xd3,0xfb,0xfa,0x80,0x69,0x3,0x7d,0x70,0xd1,0xd5,0xfa,0x9a,0x4e,0x3,0xe3,0x62,0xd0,0xd7,0xd,0xd6,0x37,0x98,0xd1,0xef,0xf,0xc0,0x9a,0xc1,0x2e,0xc,0xc6,0x2e,0xd8,0xeb,0x1,0x86,0x98,0x61,0x32,0x13,0x7f,0x33,0x66,0x49,0x36,0xba,0x41,0x68,0x18,0xdd,0x66,0x64,0x5b,0x96,0x69,0x59,0x90,0xd6,0xf0,0x72,0x68,0x9a,0x43,0xd3,0xfa,0xd5,0x32,0x2f,0x6d,0xe3,0xd2,0xb2,0x98,0x65,0x30,0x93,0x1c,0x7b,0x88,0x67,0xdb,0xa6,0xd,0x72,0x7e,0x1b,0xba,0xa8,0xc0,0xda,0xbf,0xf,0x91,0xba,0xb6,0x4b,0x8e,0xe7,0x78,0xee,0xd0,0x75,0x87,0x1e,0xac,0xe3,0x60,0x5f,0x39,0x57,0xe,0x84,0xe7,0xd8,0xb6,0x63,0x5f,0xd1,0x1b,0xe7,0x9a,0xcb,0x92,0xe7,0xba,0xae,0xe7,0xf0,0x1b,0xc7,0xb9,0x76,0x3c,0x8e,0xb3,0x87,0x16,0xbf,0xf1,0x88,0x73,0xee,0x8c,0x46,0xd8,0xd7,0x7c,0xe4,0xf1,0xef,0x18,0x79,0x37,0x9c,0x7b,0x6f,0xbc,0x11,0x27,0xfe,0xd6,0xf7,0xf9,0x98,0xf3,0x77,0x13,0xfe,0x96,0x8f,0xb8,0x3f,0x96,0x65,0x9f,0x4f,0x38,0x1f,0x4f,0xf8,0x68,0xc2,0xc9,0x7f,0xc6,0x74,0xea,0x73,0x49,0x13,0xcc,0x78,0xe2,0xfb,0x13,0x59,0xf2,0xdf,0xf9,0x63,0xa,0xa6,0xfe,0x34,0xf0,0xf1,0xba,0xe9,0x20,0x39,0xf0,0x6f,0x83,0xdb,0x69,0x10,0x4c,0x29,0x78,0x3f,0xb,0x50,0x91,0xe7,0xc0,0x9f,0x61,0xdd,0x6,0xb3,0xd9,0xcc,0xf7,0xdf,0x83,0xe0,0x2,0x9a,0xcd,0x67,0xcf,0x98,0x77,0xea,0xf,0x29,0xe4,0xfc,0x9,0x13,0x40,0xd0,0x1c,0x87,0x1f,0xb8,0x93,0xab,0xb,0xee,0x5e,0x62,0x5a,0x2c,0xe7,0x21,0x78,0xb9,0x58,0x2e,0xb1,0xd1,0xb8,0x5b,0x84,0x4b,0xd8,0xf9,0x7c,0x81,0xef,0x2e,0xa4,0xc5,0x22,0xc,0x97,0x61,0x18,0x85,0x12,0x51,0x4,0x5e,0x46,0x61,0xf4,0x97,0x74,0xb,0xb9,0xa8,0x3b,0xad,0xe2,0x38,0xa,0xd7,0xab,0x28,0x4,0x85,0x1f,0xe2,0x10,0x1c,0xc5,0xe1,0x2a,0x5c,0x25,0x2b,0x4a,0xe3,0x38,0x49,0x93,0x24,0x4d,0xe3,0x34,0x4e,0xe2,0x68,0xd,0x1f,0xad,0x93,0x24,0x59,0x23,0xfa,0xb0,0x4e,0x53,0xca,0xf2,0x2c,0xfb,0xf8,0xf1,0x13,0x6c,0x92,0x42,0xa7,0x49,0x9e,0xe6,0x69,0x92,0x49,0xd3,0x65,0x94,0x7d,0xce,0xb2,0x2c,0xc9,0xd2,0xa2,0xf8,0x92,0xe7,0x59,0x51,0xc0,0x7d,0xce,0xb,0xc8,0x1c,0xc8,0x36,0x5,0x95,0x5f,0xb3,0x72,0x53,0x66,0xf7,0x5f,0x37,0x70,0xf7,0x79,0x51,0x88,0xfb,0x12,0x3d,0x91,0xdd,0x8b,0x4d,0x99,0x8b,0x92,0x44,0x59,0xa,0x51,0x8a,0x72,0xb,0x2e,0x37,0x2,0x1a,0xa2,0x0,0x8b,0xd,0x62,0x21,0x48,0xec,0x76,0x7b,0x21,0xaa,0x52,0xec,0xb6,0xa2,0xaa,0xb6,0xf,0xfb,0x7d,0x2d,0xc4,0xf6,0xa1,0x7a,0x10,0xdb,0x9d,0x28,0x77,0x15,0x55,0xbb,0xba,0x92,0xd8,0x57,0xbb,0xaa,0xaa,0xeb,0x7d,0x2d,0xed,0xff,0xdf,0xbe,0xa6,0x43,0xd5,0x34,0x75,0xd3,0x54,0xcd,0xa1,0xaa,0xf,0x75,0x83,0xbc,0xae,0x5a,0xb4,0x64,0xf6,0xd,0x1d,0x6a,0x25,0x9a,0xa6,0x6d,0xab,0x43,0x3,0xfc,0x2d,0x57,0x8b,0xf7,0xf8,0xd8,0xb4,0x87,0xb6,0x6e,0xe9,0xb1,0x6d,0x8e,0x6d,0x7b,0x6c,0xff,0x39,0x3e,0x1d,0x9f,0x20,0x8f,0xd2,0x1d,0xff,0x45,0xa,0xdd,0xb6,0x4f,0xff,0x1,0xbe,0xd3,0xa6,0xf7,0x55,0x9e,0xe1,0xf0,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 background_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x20, 0x8, 0x3, 0x0, 0x0, 0x0, 0x44, 0xa4, 0x8a, 0xc6, 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, 0x1, 0x11, 0x50, 0x4c, 0x54, 0x45, 0x91, 0xc9, 0xab, 0x90, 0xc9, 0xab, 0x90, 0xc9, 0xaa, 0x90, 0xc8, 0xab, 0x91, 0xc9, 0xaa, 0x91, 0xc8, 0xab, 0x90, 0xc8, 0xaa, 0x8f, 0xc8, 0xab, 0x8f, 0xc9, 0xab, 0x8f, 0xc8, 0xaa, 0x90, 0xc7, 0xaa, 0x90, 0xc7, 0xab, 0x8f, 0xc7, 0xaa, 0x8f, 0xc7, 0xab, 0x8e, 0xc7, 0xab, 0x8e, 0xc6, 0xab, 0x8f, 0xc6, 0xab, 0x8e, 0xc6, 0xaa, 0x8f, 0xc6, 0xaa, 0x8e, 0xc7, 0xaa, 0x8e, 0xc5, 0xaa, 0x8e, 0xc5, 0xab, 0x8d, 0xc5, 0xaa, 0x8d, 0xc5, 0xab, 0x8d, 0xc6, 0xaa, 0x8d, 0xc6, 0xab, 0x8d, 0xc4, 0xaa, 0x8e, 0xc4, 0xab, 0x8d, 0xc4, 0xab, 0x8e, 0xc4, 0xaa, 0x8c, 0xc4, 0xaa, 0x8c, 0xc5, 0xaa, 0x8d, 0xc3, 0xab, 0x8d, 0xc3, 0xaa, 0x8c, 0xc3, 0xaa, 0x8c, 0xc4, 0xab, 0x8c, 0xc3, 0xab, 0x8c, 0xc2, 0xab, 0x8b, 0xc2, 0xaa, 0x8b, 0xc3, 0xaa, 0x8b, 0xc3, 0xab, 0x8c, 0xc2, 0xaa, 0x8b, 0xc2, 0xab, 0x8b, 0xc1, 0xaa, 0x8b, 0xc1, 0xab, 0x8a, 0xc2, 0xaa, 0x8a, 0xc1, 0xaa, 0x8a, 0xc0, 0xaa, 0x8b, 0xc0, 0xaa, 0x8a, 0xc1, 0xa9, 0x8a, 0xc0, 0xa9, 0x89, 0xc0, 0xaa, 0x8a, 0xbf, 0xaa, 0x89, 0xbf, 0xaa, 0x89, 0xbf, 0xa9, 0x8a, 0xbf, 0xa9, 0x88, 0xbf, 0xaa, 0x89, 0xbe, 0xaa, 0x89, 0xbe, 0xa9, 0x88, 0xbf, 0xa9, 0x88, 0xbe, 0xa9, 0x88, 0xbe, 0xaa, 0x88, 0xbd, 0xaa, 0x88, 0xbd, 0xa9, 0x89, 0xbd, 0xaa, 0x89, 0xbd, 0xa9, 0x87, 0xbe, 0xa9, 0x87, 0xbd, 0xaa, 0x87, 0xbe, 0xaa, 0x87, 0xbd, 0xa9, 0x87, 0xbc, 0xaa, 0x88, 0xbc, 0xa9, 0x88, 0xbc, 0xaa, 0x87, 0xbc, 0xa9, 0x86, 0xbc, 0xa9, 0x87, 0xbb, 0xaa, 0x87, 0xbb, 0xa9, 0x86, 0xbb, 0xa9, 0x86, 0xbc, 0xaa, 0x86, 0xbb, 0xaa, 0x86, 0xba, 0xaa, 0x86, 0xba, 0xa9, 0x85, 0xba, 0xa9, 0x85, 0xbb, 0xaa, 0x85, 0xbb, 0xa9, 0x85, 0xba, 0xaa, 0x85, 0xb9, 0xa9, 0x86, 0xb9, 0xa9, 0x86, 0xb9, 0xaa, 0x85, 0xb9, 0xaa, 0xff, 0xff, 0xff, 0x25, 0xe, 0xc5, 0xe1, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x5a, 0x3, 0xbb, 0xa5, 0xa2, 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, 0x2, 0xaa, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x45, 0x4b, 0xd, 0x63, 0x9a, 0x56, 0x14, 0xbd, 0x86, 0x2d, 0x24, 0x2b, 0xf8, 0x8a, 0x1, 0xcc, 0x18, 0x23, 0xcd, 0x8b, 0xc5, 0x2a, 0xa9, 0x6e, 0x51, 0x98, 0x58, 0x3e, 0xda, 0x52, 0x69, 0x9e, 0x4a, 0x10, 0xba, 0xb8, 0xec, 0xff, 0xff, 0x91, 0x9d, 0x47, 0xd2, 0xf5, 0xbc, 0xcb, 0x3d, 0x1f, 0xf7, 0x40, 0xd4, 0x23, 0x4c, 0x4f, 0x2, 0x9b, 0xa8, 0x93, 0x27, 0x9d, 0xa3, 0xe7, 0x50, 0xe9, 0xc9, 0x79, 0x69, 0x74, 0xf7, 0x9f, 0x7a, 0x8a, 0xd2, 0xfb, 0xf9, 0xf4, 0x25, 0x53, 0xd5, 0x33, 0xf4, 0xcf, 0xce, 0x90, 0x9d, 0xa8, 0xa, 0x80, 0x75, 0xaa, 0xc8, 0xca, 0xa9, 0xa2, 0x9c, 0xf4, 0x54, 0x52, 0x91, 0x9c, 0xab, 0x2a, 0x46, 0x42, 0xf9, 0xe5, 0xb4, 0x2b, 0xa9, 0xe7, 0xca, 0xab, 0x57, 0xc8, 0x15, 0x8d, 0x74, 0x4d, 0xd5, 0x25, 0x40, 0x8a, 0xae, 0xea, 0xda, 0xb9, 0xd6, 0x59, 0x55, 0x12, 0xfe, 0xd0, 0x49, 0xef, 0xb3, 0xbe, 0xfe, 0x5a, 0x37, 0x34, 0x66, 0x30, 0x5d, 0xd3, 0xfb, 0xfa, 0x80, 0x69, 0x3, 0x7d, 0x70, 0xd1, 0xd5, 0xfa, 0x9a, 0x4e, 0x3, 0xe3, 0x62, 0xd0, 0xd7, 0xd, 0xd6, 0x37, 0x98, 0xd1, 0xef, 0xf, 0xc0, 0x9a, 0xc1, 0x2e, 0xc, 0xc6, 0x2e, 0xd8, 0xeb, 0x1, 0x86, 0x98, 0x61, 0x32, 0x13, 0x7f, 0x33, 0x66, 0x49, 0x36, 0xba, 0x41, 0x68, 0x18, 0xdd, 0x66, 0x64, 0x5b, 0x96, 0x69, 0x59, 0x90, 0xd6, 0xf0, 0x72, 0x68, 0x9a, 0x43, 0xd3, 0xfa, 0xd5, 0x32, 0x2f, 0x6d, 0xe3, 0xd2, 0xb2, 0x98, 0x65, 0x30, 0x93, 0x1c, 0x7b, 0x88, 0x67, 0xdb, 0xa6, 0xd, 0x72, 0x7e, 0x1b, 0xba, 0xa8, 0xc0, 0xda, 0xbf, 0xf, 0x91, 0xba, 0xb6, 0x4b, 0x8e, 0xe7, 0x78, 0xee, 0xd0, 0x75, 0x87, 0x1e, 0xac, 0xe3, 0x60, 0x5f, 0x39, 0x57, 0xe, 0x84, 0xe7, 0xd8, 0xb6, 0x63, 0x5f, 0xd1, 0x1b, 0xe7, 0x9a, 0xcb, 0x92, 0xe7, 0xba, 0xae, 0xe7, 0xf0, 0x1b, 0xc7, 0xb9, 0x76, 0x3c, 0x8e, 0xb3, 0x87, 0x16, 0xbf, 0xf1, 0x88, 0x73, 0xee, 0x8c, 0x46, 0xd8, 0xd7, 0x7c, 0xe4, 0xf1, 0xef, 0x18, 0x79, 0x37, 0x9c, 0x7b, 0x6f, 0xbc, 0x11, 0x27, 0xfe, 0xd6, 0xf7, 0xf9, 0x98, 0xf3, 0x77, 0x13, 0xfe, 0x96, 0x8f, 0xb8, 0x3f, 0x96, 0x65, 0x9f, 0x4f, 0x38, 0x1f, 0x4f, 0xf8, 0x68, 0xc2, 0xc9, 0x7f, 0xc6, 0x74, 0xea, 0x73, 0x49, 0x13, 0xcc, 0x78, 0xe2, 0xfb, 0x13, 0x59, 0xf2, 0xdf, 0xf9, 0x63, 0xa, 0xa6, 0xfe, 0x34, 0xf0, 0xf1, 0xba, 0xe9, 0x20, 0x39, 0xf0, 0x6f, 0x83, 0xdb, 0x69, 0x10, 0x4c, 0x29, 0x78, 0x3f, 0xb, 0x50, 0x91, 0xe7, 0xc0, 0x9f, 0x61, 0xdd, 0x6, 0xb3, 0xd9, 0xcc, 0xf7, 0xdf, 0x83, 0xe0, 0x2, 0x9a, 0xcd, 0x67, 0xcf, 0x98, 0x77, 0xea, 0xf, 0x29, 0xe4, 0xfc, 0x9, 0x13, 0x40, 0xd0, 0x1c, 0x87, 0x1f, 0xb8, 0x93, 0xab, 0xb, 0xee, 0x5e, 0x62, 0x5a, 0x2c, 0xe7, 0x21, 0x78, 0xb9, 0x58, 0x2e, 0xb1, 0xd1, 0xb8, 0x5b, 0x84, 0x4b, 0xd8, 0xf9, 0x7c, 0x81, 0xef, 0x2e, 0xa4, 0xc5, 0x22, 0xc, 0x97, 0x61, 0x18, 0x85, 0x12, 0x51, 0x4, 0x5e, 0x46, 0x61, 0xf4, 0x97, 0x74, 0xb, 0xb9, 0xa8, 0x3b, 0xad, 0xe2, 0x38, 0xa, 0xd7, 0xab, 0x28, 0x4, 0x85, 0x1f, 0xe2, 0x10, 0x1c, 0xc5, 0xe1, 0x2a, 0x5c, 0x25, 0x2b, 0x4a, 0xe3, 0x38, 0x49, 0x93, 0x24, 0x4d, 0xe3, 0x34, 0x4e, 0xe2, 0x68, 0xd, 0x1f, 0xad, 0x93, 0x24, 0x59, 0x23, 0xfa, 0xb0, 0x4e, 0x53, 0xca, 0xf2, 0x2c, 0xfb, 0xf8, 0xf1, 0x13, 0x6c, 0x92, 0x42, 0xa7, 0x49, 0x9e, 0xe6, 0x69, 0x92, 0x49, 0xd3, 0x65, 0x94, 0x7d, 0xce, 0xb2, 0x2c, 0xc9, 0xd2, 0xa2, 0xf8, 0x92, 0xe7, 0x59, 0x51, 0xc0, 0x7d, 0xce, 0xb, 0xc8, 0x1c, 0xc8, 0x36, 0x5, 0x95, 0x5f, 0xb3, 0x72, 0x53, 0x66, 0xf7, 0x5f, 0x37, 0x70, 0xf7, 0x79, 0x51, 0x88, 0xfb, 0x12, 0x3d, 0x91, 0xdd, 0x8b, 0x4d, 0x99, 0x8b, 0x92, 0x44, 0x59, 0xa, 0x51, 0x8a, 0x72, 0xb, 0x2e, 0x37, 0x2, 0x1a, 0xa2, 0x0, 0x8b, 0xd, 0x62, 0x21, 0x48, 0xec, 0x76, 0x7b, 0x21, 0xaa, 0x52, 0xec, 0xb6, 0xa2, 0xaa, 0xb6, 0xf, 0xfb, 0x7d, 0x2d, 0xc4, 0xf6, 0xa1, 0x7a, 0x10, 0xdb, 0x9d, 0x28, 0x77, 0x15, 0x55, 0xbb, 0xba, 0x92, 0xd8, 0x57, 0xbb, 0xaa, 0xaa, 0xeb, 0x7d, 0x2d, 0xed, 0xff, 0xdf, 0xbe, 0xa6, 0x43, 0xd5, 0x34, 0x75, 0xd3, 0x54, 0xcd, 0xa1, 0xaa, 0xf, 0x75, 0x83, 0xbc, 0xae, 0x5a, 0xb4, 0x64, 0xf6, 0xd, 0x1d, 0x6a, 0x25, 0x9a, 0xa6, 0x6d, 0xab, 0x43, 0x3, 0xfc, 0x2d, 0x57, 0x8b, 0xf7, 0xf8, 0xd8, 0xb4, 0x87, 0xb6, 0x6e, 0xe9, 0xb1, 0x6d, 0x8e, 0x6d, 0x7b, 0x6c, 0xff, 0x39, 0x3e, 0x1d, 0x9f, 0x20, 0x8f, 0xd2, 0x1d, 0xff, 0x45, 0xa, 0xdd, 0xb6, 0x4f, 0xff, 0x1, 0xbe, 0xd3, 0xa6, 0xf7, 0x55, 0x9e, 0xe1, 0xf0, 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 base_green_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x1,0x3,0x0,0x0,0x0,0x49,0xb4,0xe8,0xb7,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,0x6,0x50,0x4c,0x54,0x45,0x90,0xc9,0xab,0xff,0xff,0xff,0xc6,0xd0,0x9d,0x30,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x1,0xff,0x2,0x2d,0xde,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,0xc,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x18,0xdc,0x0,0x0,0x0,0xa0,0x0,0x1,0x61,0x25,0x7d,0x47,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 base_green_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x20, 0x1, 0x3, 0x0, 0x0, 0x0, 0x49, 0xb4, 0xe8, 0xb7, 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, 0x6, 0x50, 0x4c, 0x54, 0x45, 0x90, 0xc9, 0xab, 0xff, 0xff, 0xff, 0xc6, 0xd0, 0x9d, 0x30, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x1, 0xff, 0x2, 0x2d, 0xde, 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, 0xc, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x18, 0xdc, 0x0, 0x0, 0x0, 0xa0, 0x0, 0x1, 0x61, 0x25, 0x7d, 0x47, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 button_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,0x4,0x0,0x0,0x0,0xb5,0xfa,0x37,0xea,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,0x2,0x62,0x4b,0x47,0x44,0x0,0xff,0x87,0x8f,0xcc,0xbf,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,0xd9,0x49,0x44,0x41,0x54,0x28,0xcf,0x7d,0x91,0x41,0x4e,0xc3,0x30,0x14,0x44,0x9f,0xed,0x8f,0x6d,0x35,0x8b,0x9a,0x6d,0xb9,0x6,0xfb,0xde,0x81,0xd3,0xe4,0x8,0xf4,0x32,0xbd,0x1,0xb,0x6e,0xc0,0x25,0x60,0x83,0xa8,0x2,0x6a,0xa4,0xc6,0x49,0xfc,0xbb,0x88,0x54,0x11,0x94,0x30,0xb3,0xf9,0xd2,0x9f,0x19,0x8d,0x34,0x6,0xc1,0x13,0x88,0x78,0x1c,0x96,0x9,0x85,0x91,0xcc,0x85,0x8e,0x2c,0x78,0x2a,0x12,0x5b,0x2a,0x2,0x6,0x3,0x28,0x4a,0x47,0xcb,0x37,0xd,0x8,0x81,0xb4,0x7f,0x7a,0xa8,0x87,0xc4,0xc,0xd2,0xbc,0x3f,0xbf,0x1e,0x19,0x84,0xc8,0x76,0x57,0x9f,0xd2,0x80,0xfe,0x7a,0x1b,0x24,0xed,0x6a,0x5e,0x38,0xb,0x9e,0xaa,0x4f,0xfd,0xdc,0x8e,0xd2,0xd3,0x27,0x2a,0xbc,0xe0,0x8,0x65,0xe6,0xe6,0xd6,0x94,0x80,0x13,0x2c,0x46,0x29,0xb,0x2,0x5,0x83,0x15,0xc0,0xac,0x26,0x18,0x90,0xe9,0x5c,0x11,0x30,0x9,0x54,0x17,0x5,0xa,0xa,0x42,0x41,0xcb,0x62,0x87,0x2,0x4a,0x11,0x46,0xba,0xd5,0x84,0x8e,0xd1,0x92,0x69,0x6d,0xe3,0xd0,0x3f,0x74,0xd8,0x86,0x96,0xec,0xb8,0xc3,0xa5,0xaf,0xfb,0x47,0x1f,0x3d,0xe1,0xc6,0x48,0x3c,0x7d,0x1e,0x3e,0xde,0xf8,0x31,0x6c,0xfe,0x1d,0xab,0x15,0x32,0x30,0x70,0x5e,0x9b,0xfb,0xa,0xbb,0x7c,0x61,0xa2,0x50,0x44,0x45,0xca,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 button_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, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 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, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 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, 0xd9, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x7d, 0x91, 0x41, 0x4e, 0xc3, 0x30, 0x14, 0x44, 0x9f, 0xed, 0x8f, 0x6d, 0x35, 0x8b, 0x9a, 0x6d, 0xb9, 0x6, 0xfb, 0xde, 0x81, 0xd3, 0xe4, 0x8, 0xf4, 0x32, 0xbd, 0x1, 0xb, 0x6e, 0xc0, 0x25, 0x60, 0x83, 0xa8, 0x2, 0x6a, 0xa4, 0xc6, 0x49, 0xfc, 0xbb, 0x88, 0x54, 0x11, 0x94, 0x30, 0xb3, 0xf9, 0xd2, 0x9f, 0x19, 0x8d, 0x34, 0x6, 0xc1, 0x13, 0x88, 0x78, 0x1c, 0x96, 0x9, 0x85, 0x91, 0xcc, 0x85, 0x8e, 0x2c, 0x78, 0x2a, 0x12, 0x5b, 0x2a, 0x2, 0x6, 0x3, 0x28, 0x4a, 0x47, 0xcb, 0x37, 0xd, 0x8, 0x81, 0xb4, 0x7f, 0x7a, 0xa8, 0x87, 0xc4, 0xc, 0xd2, 0xbc, 0x3f, 0xbf, 0x1e, 0x19, 0x84, 0xc8, 0x76, 0x57, 0x9f, 0xd2, 0x80, 0xfe, 0x7a, 0x1b, 0x24, 0xed, 0x6a, 0x5e, 0x38, 0xb, 0x9e, 0xaa, 0x4f, 0xfd, 0xdc, 0x8e, 0xd2, 0xd3, 0x27, 0x2a, 0xbc, 0xe0, 0x8, 0x65, 0xe6, 0xe6, 0xd6, 0x94, 0x80, 0x13, 0x2c, 0x46, 0x29, 0xb, 0x2, 0x5, 0x83, 0x15, 0xc0, 0xac, 0x26, 0x18, 0x90, 0xe9, 0x5c, 0x11, 0x30, 0x9, 0x54, 0x17, 0x5, 0xa, 0xa, 0x42, 0x41, 0xcb, 0x62, 0x87, 0x2, 0x4a, 0x11, 0x46, 0xba, 0xd5, 0x84, 0x8e, 0xd1, 0x92, 0x69, 0x6d, 0xe3, 0xd0, 0x3f, 0x74, 0xd8, 0x86, 0x96, 0xec, 0xb8, 0xc3, 0xa5, 0xaf, 0xfb, 0x47, 0x1f, 0x3d, 0xe1, 0xc6, 0x48, 0x3c, 0x7d, 0x1e, 0x3e, 0xde, 0xf8, 0x31, 0x6c, 0xfe, 0x1d, 0xab, 0x15, 0x32, 0x30, 0x70, 0x5e, 0x9b, 0xfb, 0xa, 0xbb, 0x7c, 0x61, 0xa2, 0x50, 0x44, 0x45, 0xca, 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 button_focus_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0x30,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0xff,0xff,0xff,0xb9,0xa2,0x9b,0xc9,0x0,0x0,0x0,0xf,0x74,0x52,0x4e,0x53,0x0,0xe,0x39,0x68,0x7a,0x7b,0x3a,0x74,0x10,0x8,0x69,0xf,0x6,0x75,0x11,0xb8,0x16,0x0,0x1,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xf,0x18,0xba,0x0,0xd9,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,0x3f,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0xc0,0x4,0x42,0x26,0xa1,0xa1,0xce,0x8a,0x40,0x46,0x7a,0xe7,0xcc,0x99,0x33,0xca,0x80,0x8c,0xd5,0x20,0xe1,0x5d,0x40,0x1c,0x3,0x62,0x1c,0x5,0xe2,0x48,0x10,0x63,0x2a,0x7e,0x6,0x5c,0x31,0x58,0xbb,0x14,0x10,0xe7,0xee,0x9c,0x39,0x73,0x1e,0xc8,0x40,0x31,0x98,0x15,0xe8,0x0,0x0,0xec,0xe0,0x11,0x6d,0x2c,0x6f,0x45,0x2b,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 button_focus_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0x30, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0xff, 0xff, 0xff, 0xb9, 0xa2, 0x9b, 0xc9, 0x0, 0x0, 0x0, 0xf, 0x74, 0x52, 0x4e, 0x53, 0x0, 0xe, 0x39, 0x68, 0x7a, 0x7b, 0x3a, 0x74, 0x10, 0x8, 0x69, 0xf, 0x6, 0x75, 0x11, 0xb8, 0x16, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xf, 0x18, 0xba, 0x0, 0xd9, 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, 0x3f, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0xc0, 0x4, 0x42, 0x26, 0xa1, 0xa1, 0xce, 0x8a, 0x40, 0x46, 0x7a, 0xe7, 0xcc, 0x99, 0x33, 0xca, 0x80, 0x8c, 0xd5, 0x20, 0xe1, 0x5d, 0x40, 0x1c, 0x3, 0x62, 0x1c, 0x5, 0xe2, 0x48, 0x10, 0x63, 0x2a, 0x7e, 0x6, 0x5c, 0x31, 0x58, 0xbb, 0x14, 0x10, 0xe7, 0xee, 0x9c, 0x39, 0x73, 0x1e, 0xc8, 0x40, 0x31, 0x98, 0x15, 0xe8, 0x0, 0x0, 0xec, 0xe0, 0x11, 0x6d, 0x2c, 0x6f, 0x45, 0x2b, 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 button_hover_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,0x8d,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,0x42,0x40,0x4b,0x5f,0x5a,0x6c,0x5f,0x5a,0x6b,0x56,0x53,0x64,0x57,0x53,0x64,0x3e,0x3b,0x46,0x57,0x53,0x63,0x57,0x53,0x63,0x5b,0x57,0x68,0x5a,0x56,0x67,0x4d,0x4a,0x57,0x49,0x46,0x52,0x48,0x45,0x51,0x5b,0x57,0x66,0x59,0x55,0x64,0x47,0x44,0x50,0x58,0x54,0x64,0x46,0x43,0x50,0x56,0x53,0x63,0x45,0x42,0x4f,0x56,0x53,0x62,0x45,0x42,0x4e,0x55,0x51,0x62,0x44,0x41,0x4e,0x55,0x51,0x60,0x44,0x41,0x4d,0x43,0x40,0x4c,0x47,0x43,0x51,0x43,0x3f,0x4d,0x42,0x3f,0x4c,0x53,0x50,0x5f,0x53,0x4f,0x5e,0xff,0xff,0xff,0x99,0x8b,0x2e,0x55,0x0,0x0,0x0,0x16,0x74,0x52,0x4e,0x53,0x4,0xa,0x11,0x19,0x1f,0x22,0x24,0x15,0x25,0x34,0x3f,0x46,0x47,0x48,0x77,0xef,0xef,0xef,0xef,0x77,0xef,0xed,0x6b,0x28,0x52,0x7a,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x2e,0x54,0xd3,0x10,0x87,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,0x97,0x49,0x44,0x41,0x54,0x18,0xd3,0x65,0xcf,0x49,0x12,0x82,0x30,0x10,0x5,0xd0,0xce,0x48,0x46,0x40,0x51,0x4,0x41,0x45,0xc4,0x20,0x88,0xf7,0xbf,0x9e,0x21,0x45,0x65,0xa1,0x6f,0xd7,0xbf,0xaa,0x27,0x0,0x84,0x9,0x65,0xdc,0x63,0x94,0x60,0x4,0x80,0x12,0x21,0x95,0x36,0xd6,0x1a,0xad,0xa4,0x48,0x10,0x60,0x91,0x66,0xe5,0x29,0x28,0xb3,0x54,0x60,0x20,0x32,0xaf,0xea,0x73,0x50,0x57,0xb9,0x24,0x40,0x55,0xb3,0xd5,0x3e,0x69,0x14,0x5,0xa6,0xdb,0x4b,0xd4,0x6a,0x6,0xdc,0x5c,0x6f,0xd1,0xd5,0x70,0xe0,0xb6,0xbb,0x47,0x9d,0x5d,0x83,0xfe,0x11,0xf5,0x6b,0x60,0x86,0x67,0x34,0xf8,0x16,0xa6,0xdd,0x18,0x39,0x3f,0x94,0x2a,0x37,0xbe,0x36,0xa3,0xf3,0x6b,0x89,0xdc,0x4d,0xf3,0x3b,0x98,0xa7,0xbd,0x3f,0xc,0x8b,0xe2,0xb0,0x7c,0x82,0xe5,0x58,0xf8,0xd3,0xff,0x9e,0xfb,0x7d,0xff,0xb,0x74,0xeb,0x15,0x11,0xe1,0xa7,0x60,0xfc,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 button_hover_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, 0x8d, 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, 0x42, 0x40, 0x4b, 0x5f, 0x5a, 0x6c, 0x5f, 0x5a, 0x6b, 0x56, 0x53, 0x64, 0x57, 0x53, 0x64, 0x3e, 0x3b, 0x46, 0x57, 0x53, 0x63, 0x57, 0x53, 0x63, 0x5b, 0x57, 0x68, 0x5a, 0x56, 0x67, 0x4d, 0x4a, 0x57, 0x49, 0x46, 0x52, 0x48, 0x45, 0x51, 0x5b, 0x57, 0x66, 0x59, 0x55, 0x64, 0x47, 0x44, 0x50, 0x58, 0x54, 0x64, 0x46, 0x43, 0x50, 0x56, 0x53, 0x63, 0x45, 0x42, 0x4f, 0x56, 0x53, 0x62, 0x45, 0x42, 0x4e, 0x55, 0x51, 0x62, 0x44, 0x41, 0x4e, 0x55, 0x51, 0x60, 0x44, 0x41, 0x4d, 0x43, 0x40, 0x4c, 0x47, 0x43, 0x51, 0x43, 0x3f, 0x4d, 0x42, 0x3f, 0x4c, 0x53, 0x50, 0x5f, 0x53, 0x4f, 0x5e, 0xff, 0xff, 0xff, 0x99, 0x8b, 0x2e, 0x55, 0x0, 0x0, 0x0, 0x16, 0x74, 0x52, 0x4e, 0x53, 0x4, 0xa, 0x11, 0x19, 0x1f, 0x22, 0x24, 0x15, 0x25, 0x34, 0x3f, 0x46, 0x47, 0x48, 0x77, 0xef, 0xef, 0xef, 0xef, 0x77, 0xef, 0xed, 0x6b, 0x28, 0x52, 0x7a, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x2e, 0x54, 0xd3, 0x10, 0x87, 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, 0x97, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x65, 0xcf, 0x49, 0x12, 0x82, 0x30, 0x10, 0x5, 0xd0, 0xce, 0x48, 0x46, 0x40, 0x51, 0x4, 0x41, 0x45, 0xc4, 0x20, 0x88, 0xf7, 0xbf, 0x9e, 0x21, 0x45, 0x65, 0xa1, 0x6f, 0xd7, 0xbf, 0xaa, 0x27, 0x0, 0x84, 0x9, 0x65, 0xdc, 0x63, 0x94, 0x60, 0x4, 0x80, 0x12, 0x21, 0x95, 0x36, 0xd6, 0x1a, 0xad, 0xa4, 0x48, 0x10, 0x60, 0x91, 0x66, 0xe5, 0x29, 0x28, 0xb3, 0x54, 0x60, 0x20, 0x32, 0xaf, 0xea, 0x73, 0x50, 0x57, 0xb9, 0x24, 0x40, 0x55, 0xb3, 0xd5, 0x3e, 0x69, 0x14, 0x5, 0xa6, 0xdb, 0x4b, 0xd4, 0x6a, 0x6, 0xdc, 0x5c, 0x6f, 0xd1, 0xd5, 0x70, 0xe0, 0xb6, 0xbb, 0x47, 0x9d, 0x5d, 0x83, 0xfe, 0x11, 0xf5, 0x6b, 0x60, 0x86, 0x67, 0x34, 0xf8, 0x16, 0xa6, 0xdd, 0x18, 0x39, 0x3f, 0x94, 0x2a, 0x37, 0xbe, 0x36, 0xa3, 0xf3, 0x6b, 0x89, 0xdc, 0x4d, 0xf3, 0x3b, 0x98, 0xa7, 0xbd, 0x3f, 0xc, 0x8b, 0xe2, 0xb0, 0x7c, 0x82, 0xe5, 0x58, 0xf8, 0xd3, 0xff, 0x9e, 0xfb, 0x7d, 0xff, 0xb, 0x74, 0xeb, 0x15, 0x11, 0xe1, 0xa7, 0x60, 0xfc, 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 button_normal_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,0x8a,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,0x3c,0x3a,0x44,0x56,0x53,0x61,0x56,0x52,0x60,0x47,0x44,0x52,0x33,0x31,0x39,0x47,0x44,0x50,0x47,0x44,0x51,0x52,0x50,0x5d,0x51,0x4f,0x5d,0x46,0x42,0x4e,0x42,0x3e,0x4a,0x41,0x3e,0x49,0x51,0x4e,0x5b,0x40,0x3e,0x48,0x4f,0x4c,0x59,0x3f,0x3d,0x47,0x4e,0x4a,0x58,0x3e,0x3b,0x46,0x4b,0x49,0x55,0x3c,0x3a,0x44,0x4a,0x47,0x54,0x3b,0x39,0x43,0x49,0x46,0x53,0x3a,0x38,0x42,0x47,0x45,0x50,0x39,0x37,0x40,0x47,0x43,0x50,0x38,0x35,0x3f,0x36,0x34,0x3e,0x44,0x42,0x4d,0x44,0x41,0x4c,0xff,0xff,0xff,0xe5,0x37,0x10,0x78,0x0,0x0,0x0,0x15,0x74,0x52,0x4e,0x53,0x4,0xa,0x11,0x19,0x1f,0x22,0x24,0x15,0x25,0x34,0x3f,0x46,0x47,0x48,0x77,0xef,0xef,0xef,0x77,0xef,0xed,0xe8,0xff,0x76,0xed,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x2d,0xcd,0xda,0x41,0x3d,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,0x93,0x49,0x44,0x41,0x54,0x18,0xd3,0x65,0xcf,0x47,0x12,0x82,0x40,0x10,0x5,0xd0,0x9e,0xc8,0x44,0x92,0x22,0x41,0x54,0x44,0x40,0x14,0xef,0x7f,0x3e,0x7,0x8a,0xea,0x85,0xbe,0xe5,0xaf,0xea,0xf0,0x1,0x8,0x65,0x5c,0xc8,0x40,0x70,0x46,0x9,0x0,0x89,0x94,0x36,0xd6,0x79,0xef,0xac,0xd1,0x2a,0x22,0x40,0x55,0x9c,0x14,0xa7,0x4d,0x91,0xc4,0x8a,0x2,0xd3,0x69,0x59,0xd5,0x9b,0xaa,0x4c,0x35,0x3,0x6e,0x9a,0xfa,0xbc,0xab,0x1b,0xc3,0x41,0xd8,0xf6,0x82,0x5a,0x2b,0x40,0xba,0xeb,0xd,0x5d,0x9d,0x4,0xe9,0xbb,0x3b,0xea,0xfc,0x1a,0xf4,0xf,0xd4,0xaf,0x81,0x1b,0x46,0x34,0x84,0x11,0x61,0xa7,0x27,0x9a,0xc2,0x52,0x6e,0xe6,0x17,0x9a,0xc3,0x59,0xa6,0xb3,0xf1,0xbd,0x1b,0xb3,0xf0,0x18,0x55,0xf9,0x61,0xf9,0x6c,0x96,0x63,0x1e,0x5e,0xff,0x2b,0xf7,0x5b,0xff,0xb,0x69,0x5a,0x14,0xfa,0x84,0xf6,0xc2,0x8,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 button_normal_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, 0x8a, 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, 0x3c, 0x3a, 0x44, 0x56, 0x53, 0x61, 0x56, 0x52, 0x60, 0x47, 0x44, 0x52, 0x33, 0x31, 0x39, 0x47, 0x44, 0x50, 0x47, 0x44, 0x51, 0x52, 0x50, 0x5d, 0x51, 0x4f, 0x5d, 0x46, 0x42, 0x4e, 0x42, 0x3e, 0x4a, 0x41, 0x3e, 0x49, 0x51, 0x4e, 0x5b, 0x40, 0x3e, 0x48, 0x4f, 0x4c, 0x59, 0x3f, 0x3d, 0x47, 0x4e, 0x4a, 0x58, 0x3e, 0x3b, 0x46, 0x4b, 0x49, 0x55, 0x3c, 0x3a, 0x44, 0x4a, 0x47, 0x54, 0x3b, 0x39, 0x43, 0x49, 0x46, 0x53, 0x3a, 0x38, 0x42, 0x47, 0x45, 0x50, 0x39, 0x37, 0x40, 0x47, 0x43, 0x50, 0x38, 0x35, 0x3f, 0x36, 0x34, 0x3e, 0x44, 0x42, 0x4d, 0x44, 0x41, 0x4c, 0xff, 0xff, 0xff, 0xe5, 0x37, 0x10, 0x78, 0x0, 0x0, 0x0, 0x15, 0x74, 0x52, 0x4e, 0x53, 0x4, 0xa, 0x11, 0x19, 0x1f, 0x22, 0x24, 0x15, 0x25, 0x34, 0x3f, 0x46, 0x47, 0x48, 0x77, 0xef, 0xef, 0xef, 0x77, 0xef, 0xed, 0xe8, 0xff, 0x76, 0xed, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x2d, 0xcd, 0xda, 0x41, 0x3d, 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, 0x93, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x65, 0xcf, 0x47, 0x12, 0x82, 0x40, 0x10, 0x5, 0xd0, 0x9e, 0xc8, 0x44, 0x92, 0x22, 0x41, 0x54, 0x44, 0x40, 0x14, 0xef, 0x7f, 0x3e, 0x7, 0x8a, 0xea, 0x85, 0xbe, 0xe5, 0xaf, 0xea, 0xf0, 0x1, 0x8, 0x65, 0x5c, 0xc8, 0x40, 0x70, 0x46, 0x9, 0x0, 0x89, 0x94, 0x36, 0xd6, 0x79, 0xef, 0xac, 0xd1, 0x2a, 0x22, 0x40, 0x55, 0x9c, 0x14, 0xa7, 0x4d, 0x91, 0xc4, 0x8a, 0x2, 0xd3, 0x69, 0x59, 0xd5, 0x9b, 0xaa, 0x4c, 0x35, 0x3, 0x6e, 0x9a, 0xfa, 0xbc, 0xab, 0x1b, 0xc3, 0x41, 0xd8, 0xf6, 0x82, 0x5a, 0x2b, 0x40, 0xba, 0xeb, 0xd, 0x5d, 0x9d, 0x4, 0xe9, 0xbb, 0x3b, 0xea, 0xfc, 0x1a, 0xf4, 0xf, 0xd4, 0xaf, 0x81, 0x1b, 0x46, 0x34, 0x84, 0x11, 0x61, 0xa7, 0x27, 0x9a, 0xc2, 0x52, 0x6e, 0xe6, 0x17, 0x9a, 0xc3, 0x59, 0xa6, 0xb3, 0xf1, 0xbd, 0x1b, 0xb3, 0xf0, 0x18, 0x55, 0xf9, 0x61, 0xf9, 0x6c, 0x96, 0x63, 0x1e, 0x5e, 0xff, 0x2b, 0xf7, 0x5b, 0xff, 0xb, 0x69, 0x5a, 0x14, 0xfa, 0x84, 0xf6, 0xc2, 0x8, 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 button_pressed_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,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xe0,0x7,0x1c,0xc,0x14,0x2b,0xf9,0x77,0x52,0x64,0x0,0x0,0x1,0x92,0x49,0x44,0x41,0x54,0x38,0xcb,0x8d,0x93,0x4d,0x4e,0x1b,0x41,0x10,0x85,0xbf,0xea,0xaa,0x1e,0x20,0x83,0xf9,0x9,0x36,0xb2,0x85,0x72,0x84,0x8,0x65,0x11,0xe5,0xc,0x9c,0x80,0x73,0x10,0xee,0xc1,0x41,0x38,0x1,0xab,0xec,0xa3,0x2c,0x2,0x8a,0xe0,0x2,0x51,0xc2,0x48,0x46,0x42,0x64,0xc6,0x91,0x21,0xf4,0x74,0x16,0x2e,0xb0,0x71,0x2,0xf2,0x93,0x9e,0xba,0x16,0xdd,0xaf,0x5e,0xa9,0x5f,0x9,0x60,0x40,0x1,0x2c,0x1,0xcb,0x5e,0x2b,0x10,0x78,0x8a,0x16,0x48,0xc0,0x1d,0x30,0x6,0x6e,0x81,0x3b,0xf3,0x87,0x25,0xb0,0x9,0xac,0x7b,0xbd,0xc,0x88,0x13,0x20,0x3b,0xc7,0xc0,0x8,0xb8,0x1,0xae,0x81,0x91,0xf9,0xe5,0xad,0x77,0xbb,0x1f,0xf6,0x7b,0xdd,0xfe,0x41,0x4a,0x69,0x2d,0x93,0xf9,0x1f,0x4,0x41,0x55,0x7f,0xd,0xaf,0xaa,0xa3,0xaf,0x67,0x9f,0x8f,0x81,0x64,0xde,0xb1,0xbb,0xdd,0x1b,0x7c,0xac,0x9b,0x9b,0xce,0xd9,0xb7,0x2f,0xfc,0xf3,0x5e,0xa6,0xe5,0xee,0xdb,0xf7,0x6b,0xdb,0xbd,0xc1,0x21,0xf0,0x9,0x18,0x5,0x60,0x5,0xd8,0x48,0x6d,0xdb,0x39,0xbf,0x38,0xc5,0x34,0x62,0x36,0x47,0x9d,0xf2,0xfc,0xe2,0x94,0xd4,0xb6,0x1d,0x60,0x3,0x58,0x31,0x20,0x2,0x65,0x40,0x88,0x31,0x92,0xbd,0xbb,0x8,0xe4,0x3c,0x39,0x67,0x91,0x33,0x84,0x89,0xa5,0x12,0x88,0xf,0x3f,0x10,0x45,0x5,0xb3,0xc8,0x73,0x10,0x11,0xb2,0xab,0x8b,0xa,0xde,0xb8,0x30,0x9f,0xb0,0x8,0xa2,0xc4,0x58,0xb0,0x8,0x82,0x28,0xde,0x58,0xcc,0xff,0x5c,0x45,0x64,0x61,0x1,0x99,0xcc,0xa5,0x80,0x4e,0x5,0xc2,0xcb,0x2,0xe2,0x41,0x10,0x40,0xc2,0x53,0x81,0xc,0xa8,0x8a,0x52,0x2c,0xe8,0x40,0x27,0x23,0x28,0x90,0xcd,0xe3,0x79,0x1b,0x34,0x50,0x14,0x4b,0xf0,0x4c,0x88,0x66,0xbd,0x4,0xd,0x78,0x94,0x93,0x79,0x3c,0x9b,0x18,0x63,0x7a,0xbd,0xb9,0xa5,0xcd,0xa8,0x7e,0xb4,0x3a,0x2f,0x15,0x10,0xca,0x72,0x95,0x18,0x8b,0x4,0x34,0xc0,0xd8,0x80,0x1a,0x18,0x56,0xd5,0xcf,0x93,0x41,0x7f,0x67,0xaf,0xb3,0xba,0x1e,0x5e,0x8a,0xb2,0x99,0xb5,0x97,0xd5,0x8f,0x13,0x60,0x8,0xd4,0x2,0x74,0x9d,0x6f,0x80,0xbe,0x2f,0x55,0xe9,0x26,0xc2,0xcc,0x26,0x66,0x5f,0xa4,0x6b,0xa0,0x2,0xbe,0x3,0x57,0xe6,0x56,0x1e,0x66,0x1a,0x2,0xaf,0x3c,0x24,0x36,0x67,0xe0,0x1e,0xf8,0x3,0xfc,0xf6,0x6d,0xac,0x81,0xe6,0x2f,0x7c,0x22,0x6d,0x74,0x25,0xb,0xb3,0xa2,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char button_pressed_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, 0x13, 0x0, 0x0, 0xb, 0x13, 0x1, 0x0, 0x9a, 0x9c, 0x18, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xe0, 0x7, 0x1c, 0xc, 0x14, 0x2b, 0xf9, 0x77, 0x52, 0x64, 0x0, 0x0, 0x1, 0x92, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x8d, 0x93, 0x4d, 0x4e, 0x1b, 0x41, 0x10, 0x85, 0xbf, 0xea, 0xaa, 0x1e, 0x20, 0x83, 0xf9, 0x9, 0x36, 0xb2, 0x85, 0x72, 0x84, 0x8, 0x65, 0x11, 0xe5, 0xc, 0x9c, 0x80, 0x73, 0x10, 0xee, 0xc1, 0x41, 0x38, 0x1, 0xab, 0xec, 0xa3, 0x2c, 0x2, 0x8a, 0xe0, 0x2, 0x51, 0xc2, 0x48, 0x46, 0x42, 0x64, 0xc6, 0x91, 0x21, 0xf4, 0x74, 0x16, 0x2e, 0xb0, 0x71, 0x2, 0xf2, 0x93, 0x9e, 0xba, 0x16, 0xdd, 0xaf, 0x5e, 0xa9, 0x5f, 0x9, 0x60, 0x40, 0x1, 0x2c, 0x1, 0xcb, 0x5e, 0x2b, 0x10, 0x78, 0x8a, 0x16, 0x48, 0xc0, 0x1d, 0x30, 0x6, 0x6e, 0x81, 0x3b, 0xf3, 0x87, 0x25, 0xb0, 0x9, 0xac, 0x7b, 0xbd, 0xc, 0x88, 0x13, 0x20, 0x3b, 0xc7, 0xc0, 0x8, 0xb8, 0x1, 0xae, 0x81, 0x91, 0xf9, 0xe5, 0xad, 0x77, 0xbb, 0x1f, 0xf6, 0x7b, 0xdd, 0xfe, 0x41, 0x4a, 0x69, 0x2d, 0x93, 0xf9, 0x1f, 0x4, 0x41, 0x55, 0x7f, 0xd, 0xaf, 0xaa, 0xa3, 0xaf, 0x67, 0x9f, 0x8f, 0x81, 0x64, 0xde, 0xb1, 0xbb, 0xdd, 0x1b, 0x7c, 0xac, 0x9b, 0x9b, 0xce, 0xd9, 0xb7, 0x2f, 0xfc, 0xf3, 0x5e, 0xa6, 0xe5, 0xee, 0xdb, 0xf7, 0x6b, 0xdb, 0xbd, 0xc1, 0x21, 0xf0, 0x9, 0x18, 0x5, 0x60, 0x5, 0xd8, 0x48, 0x6d, 0xdb, 0x39, 0xbf, 0x38, 0xc5, 0x34, 0x62, 0x36, 0x47, 0x9d, 0xf2, 0xfc, 0xe2, 0x94, 0xd4, 0xb6, 0x1d, 0x60, 0x3, 0x58, 0x31, 0x20, 0x2, 0x65, 0x40, 0x88, 0x31, 0x92, 0xbd, 0xbb, 0x8, 0xe4, 0x3c, 0x39, 0x67, 0x91, 0x33, 0x84, 0x89, 0xa5, 0x12, 0x88, 0xf, 0x3f, 0x10, 0x45, 0x5, 0xb3, 0xc8, 0x73, 0x10, 0x11, 0xb2, 0xab, 0x8b, 0xa, 0xde, 0xb8, 0x30, 0x9f, 0xb0, 0x8, 0xa2, 0xc4, 0x58, 0xb0, 0x8, 0x82, 0x28, 0xde, 0x58, 0xcc, 0xff, 0x5c, 0x45, 0x64, 0x61, 0x1, 0x99, 0xcc, 0xa5, 0x80, 0x4e, 0x5, 0xc2, 0xcb, 0x2, 0xe2, 0x41, 0x10, 0x40, 0xc2, 0x53, 0x81, 0xc, 0xa8, 0x8a, 0x52, 0x2c, 0xe8, 0x40, 0x27, 0x23, 0x28, 0x90, 0xcd, 0xe3, 0x79, 0x1b, 0x34, 0x50, 0x14, 0x4b, 0xf0, 0x4c, 0x88, 0x66, 0xbd, 0x4, 0xd, 0x78, 0x94, 0x93, 0x79, 0x3c, 0x9b, 0x18, 0x63, 0x7a, 0xbd, 0xb9, 0xa5, 0xcd, 0xa8, 0x7e, 0xb4, 0x3a, 0x2f, 0x15, 0x10, 0xca, 0x72, 0x95, 0x18, 0x8b, 0x4, 0x34, 0xc0, 0xd8, 0x80, 0x1a, 0x18, 0x56, 0xd5, 0xcf, 0x93, 0x41, 0x7f, 0x67, 0xaf, 0xb3, 0xba, 0x1e, 0x5e, 0x8a, 0xb2, 0x99, 0xb5, 0x97, 0xd5, 0x8f, 0x13, 0x60, 0x8, 0xd4, 0x2, 0x74, 0x9d, 0x6f, 0x80, 0xbe, 0x2f, 0x55, 0xe9, 0x26, 0xc2, 0xcc, 0x26, 0x66, 0x5f, 0xa4, 0x6b, 0xa0, 0x2, 0xbe, 0x3, 0x57, 0xe6, 0x56, 0x1e, 0x66, 0x1a, 0x2, 0xaf, 0x3c, 0x24, 0x36, 0x67, 0xe0, 0x1e, 0xf8, 0x3, 0xfc, 0xf6, 0x6d, 0xac, 0x81, 0xe6, 0x2f, 0x7c, 0x22, 0x6d, 0x74, 0x25, 0xb, 0xb3, 0xa2, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char checked_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,0x8d,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x58,0x56,0x63,0xb0,0xaf,0xb5,0x38,0x37,0x40,0x20,0x20,0x24,0xb6,0xb6,0xb9,0x57,0x57,0x5a,0x20,0x20,0x24,0x38,0x36,0x40,0x20,0x20,0x25,0x1e,0x1e,0x22,0x1f,0x1f,0x23,0x8b,0x8b,0x8d,0xff,0xff,0xff,0x20,0x20,0x24,0x22,0x22,0x27,0x23,0x23,0x28,0x42,0x42,0x47,0xf8,0xf8,0xf8,0xfe,0xfe,0xfe,0x25,0x25,0x2a,0x4e,0x4e,0x52,0x26,0x26,0x2b,0xc5,0xc5,0xc7,0xaa,0xaa,0xab,0xb8,0xb8,0xba,0x5f,0x5f,0x63,0x74,0x74,0x77,0xed,0xed,0xed,0x33,0x33,0x38,0x8d,0x8d,0x8f,0xb8,0xb8,0xb9,0x35,0x35,0x39,0x3a,0x3a,0x3e,0xfb,0xfb,0xfb,0xfa,0xfa,0xfa,0xb2,0xb2,0xb4,0x45,0x45,0x49,0x61,0x61,0x65,0x8f,0x8f,0x92,0x63,0x63,0x66,0x2a,0x2a,0x2f,0x40,0x82,0xb,0xf6,0x0,0x0,0x0,0xf,0x74,0x52,0x4e,0x53,0x0,0x7,0x27,0x50,0x66,0x68,0x6a,0x81,0xb4,0xfa,0xdd,0xfb,0xfb,0xb4,0xfa,0xb8,0xf0,0x7f,0x59,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x12,0x7b,0xbc,0x6c,0x0,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x8e,0x49,0x44,0x41,0x54,0x18,0xd3,0x65,0xcf,0x5b,0x12,0x82,0x30,0xc,0x40,0x51,0x48,0x5b,0x15,0x5,0x5b,0x42,0x2b,0x4,0x50,0x40,0xc5,0xb7,0xee,0x7f,0x79,0x96,0x8a,0x88,0x7a,0x3f,0xcf,0x4c,0x26,0x89,0xe7,0xfd,0xe5,0x3,0xe3,0xc2,0x35,0x99,0x82,0x6f,0x1,0x66,0x81,0x54,0xae,0x18,0xe7,0x60,0x81,0x5,0x89,0x36,0x5d,0xab,0x34,0x5b,0x30,0xb,0x5c,0x6a,0xa2,0xbc,0x20,0x2a,0x71,0x2d,0xb9,0x5,0xa1,0xc,0x6d,0xb0,0xa2,0x1a,0x9b,0xad,0x12,0x3d,0xec,0x70,0xdf,0x36,0x58,0x9b,0x1,0xe,0xc7,0xd3,0x19,0x4b,0xfa,0x80,0x9d,0xc9,0xd2,0xcb,0x18,0xae,0x88,0x37,0x1a,0x43,0x91,0xdf,0x1f,0x6f,0x70,0x6b,0x5f,0x69,0xb7,0x76,0x38,0xcc,0xe8,0x24,0xec,0xe,0x83,0x28,0xec,0x4f,0x97,0xcb,0x8,0xbe,0x9e,0xe3,0xcc,0x3d,0xf7,0xd3,0x13,0x10,0x58,0xd,0x44,0xd4,0xa5,0x38,0x3e,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 checked_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, 0x8d, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x58, 0x56, 0x63, 0xb0, 0xaf, 0xb5, 0x38, 0x37, 0x40, 0x20, 0x20, 0x24, 0xb6, 0xb6, 0xb9, 0x57, 0x57, 0x5a, 0x20, 0x20, 0x24, 0x38, 0x36, 0x40, 0x20, 0x20, 0x25, 0x1e, 0x1e, 0x22, 0x1f, 0x1f, 0x23, 0x8b, 0x8b, 0x8d, 0xff, 0xff, 0xff, 0x20, 0x20, 0x24, 0x22, 0x22, 0x27, 0x23, 0x23, 0x28, 0x42, 0x42, 0x47, 0xf8, 0xf8, 0xf8, 0xfe, 0xfe, 0xfe, 0x25, 0x25, 0x2a, 0x4e, 0x4e, 0x52, 0x26, 0x26, 0x2b, 0xc5, 0xc5, 0xc7, 0xaa, 0xaa, 0xab, 0xb8, 0xb8, 0xba, 0x5f, 0x5f, 0x63, 0x74, 0x74, 0x77, 0xed, 0xed, 0xed, 0x33, 0x33, 0x38, 0x8d, 0x8d, 0x8f, 0xb8, 0xb8, 0xb9, 0x35, 0x35, 0x39, 0x3a, 0x3a, 0x3e, 0xfb, 0xfb, 0xfb, 0xfa, 0xfa, 0xfa, 0xb2, 0xb2, 0xb4, 0x45, 0x45, 0x49, 0x61, 0x61, 0x65, 0x8f, 0x8f, 0x92, 0x63, 0x63, 0x66, 0x2a, 0x2a, 0x2f, 0x40, 0x82, 0xb, 0xf6, 0x0, 0x0, 0x0, 0xf, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x7, 0x27, 0x50, 0x66, 0x68, 0x6a, 0x81, 0xb4, 0xfa, 0xdd, 0xfb, 0xfb, 0xb4, 0xfa, 0xb8, 0xf0, 0x7f, 0x59, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x12, 0x7b, 0xbc, 0x6c, 0x0, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x8e, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x65, 0xcf, 0x5b, 0x12, 0x82, 0x30, 0xc, 0x40, 0x51, 0x48, 0x5b, 0x15, 0x5, 0x5b, 0x42, 0x2b, 0x4, 0x50, 0x40, 0xc5, 0xb7, 0xee, 0x7f, 0x79, 0x96, 0x8a, 0x88, 0x7a, 0x3f, 0xcf, 0x4c, 0x26, 0x89, 0xe7, 0xfd, 0xe5, 0x3, 0xe3, 0xc2, 0x35, 0x99, 0x82, 0x6f, 0x1, 0x66, 0x81, 0x54, 0xae, 0x18, 0xe7, 0x60, 0x81, 0x5, 0x89, 0x36, 0x5d, 0xab, 0x34, 0x5b, 0x30, 0xb, 0x5c, 0x6a, 0xa2, 0xbc, 0x20, 0x2a, 0x71, 0x2d, 0xb9, 0x5, 0xa1, 0xc, 0x6d, 0xb0, 0xa2, 0x1a, 0x9b, 0xad, 0x12, 0x3d, 0xec, 0x70, 0xdf, 0x36, 0x58, 0x9b, 0x1, 0xe, 0xc7, 0xd3, 0x19, 0x4b, 0xfa, 0x80, 0x9d, 0xc9, 0xd2, 0xcb, 0x18, 0xae, 0x88, 0x37, 0x1a, 0x43, 0x91, 0xdf, 0x1f, 0x6f, 0x70, 0x6b, 0x5f, 0x69, 0xb7, 0x76, 0x38, 0xcc, 0xe8, 0x24, 0xec, 0xe, 0x83, 0x28, 0xec, 0x4f, 0x97, 0xcb, 0x8, 0xbe, 0x9e, 0xe3, 0xcc, 0x3d, 0xf7, 0xd3, 0x13, 0x10, 0x58, 0xd, 0x44, 0xd4, 0xa5, 0x38, 0x3e, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 checker_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x8,0x0,0x0,0x0,0x0,0xe1,0x64,0xe1,0x57,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,0x2,0x62,0x4b,0x47,0x44,0x0,0xff,0x87,0x8f,0xcc,0xbf,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc4,0x0,0x0,0xe,0xc4,0x1,0x95,0x2b,0xe,0x1b,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xe0,0x6,0x16,0x12,0x2b,0x5,0x39,0x1a,0x32,0x39,0x0,0x0,0x0,0x1a,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0xfc,0xcf,0xc0,0xc0,0xd0,0xc0,0xc0,0xc0,0xc0,0xc4,0x0,0x5,0x98,0xc,0xc6,0x7a,0xc2,0x6a,0x0,0x8b,0x7a,0x2,0x8d,0x68,0x67,0xe3,0xa,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 checker_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x8, 0x0, 0x0, 0x0, 0x0, 0xe1, 0x64, 0xe1, 0x57, 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, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xe, 0xc4, 0x0, 0x0, 0xe, 0xc4, 0x1, 0x95, 0x2b, 0xe, 0x1b, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xe0, 0x6, 0x16, 0x12, 0x2b, 0x5, 0x39, 0x1a, 0x32, 0x39, 0x0, 0x0, 0x0, 0x1a, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0xfc, 0xcf, 0xc0, 0xc0, 0xd0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc4, 0x0, 0x5, 0x98, 0xc, 0xc6, 0x7a, 0xc2, 0x6a, 0x0, 0x8b, 0x7a, 0x2, 0x8d, 0x68, 0x67, 0xe3, 0xa, 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 close_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9b,0x49,0x44,0x41,0x54,0x38,0x8d,0xcd,0x92,0x31,0xe,0xc2,0x30,0x10,0x4,0x17,0xaa,0x3d,0x67,0xdb,0x58,0xd0,0xd3,0xf0,0xa3,0x7c,0x36,0x3c,0x82,0x48,0x44,0x22,0x6f,0xb1,0x4d,0x85,0x14,0x81,0xf,0x2c,0x28,0xe0,0xda,0xd5,0x8c,0x4e,0x77,0xb,0xfc,0xd5,0x98,0xd9,0x20,0x29,0x7a,0xb9,0xa4,0x68,0x66,0x83,0xb,0x93,0xcc,0x24,0xa7,0x9a,0x44,0x52,0x24,0x39,0x91,0xcc,0x55,0x89,0xa4,0xde,0xcc,0xce,0x24,0xb,0xc9,0x39,0x84,0xb0,0xf7,0xb2,0xae,0xeb,0x76,0xde,0x8a,0x4f,0x92,0x66,0xd8,0x91,0x5c,0x49,0x5e,0x9a,0xe1,0xb5,0x64,0x5,0x16,0x92,0x8b,0x7,0x6f,0x9b,0x8c,0x0,0x4a,0x29,0x9b,0x26,0x81,0xa4,0x3e,0xa5,0x34,0x2,0x38,0x2,0x58,0x0,0xcc,0x0,0xe,0x39,0xe7,0xd3,0xfa,0xb0,0xee,0xea,0x8f,0x7,0x7b,0xf5,0x9d,0xb7,0xb0,0x97,0x55,0x25,0x5f,0x17,0xe9,0x2e,0xf9,0xb8,0xca,0x3f,0x9b,0x1b,0x1a,0xe3,0x40,0x47,0xa0,0xda,0xda,0x61,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char close_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x6, 0x0, 0x0, 0x0, 0x1f, 0xf3, 0xff, 0x61, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0x9b, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xcd, 0x92, 0x31, 0xe, 0xc2, 0x30, 0x10, 0x4, 0x17, 0xaa, 0x3d, 0x67, 0xdb, 0x58, 0xd0, 0xd3, 0xf0, 0xa3, 0x7c, 0x36, 0x3c, 0x82, 0x48, 0x44, 0x22, 0x6f, 0xb1, 0x4d, 0x85, 0x14, 0x81, 0xf, 0x2c, 0x28, 0xe0, 0xda, 0xd5, 0x8c, 0x4e, 0x77, 0xb, 0xfc, 0xd5, 0x98, 0xd9, 0x20, 0x29, 0x7a, 0xb9, 0xa4, 0x68, 0x66, 0x83, 0xb, 0x93, 0xcc, 0x24, 0xa7, 0x9a, 0x44, 0x52, 0x24, 0x39, 0x91, 0xcc, 0x55, 0x89, 0xa4, 0xde, 0xcc, 0xce, 0x24, 0xb, 0xc9, 0x39, 0x84, 0xb0, 0xf7, 0xb2, 0xae, 0xeb, 0x76, 0xde, 0x8a, 0x4f, 0x92, 0x66, 0xd8, 0x91, 0x5c, 0x49, 0x5e, 0x9a, 0xe1, 0xb5, 0x64, 0x5, 0x16, 0x92, 0x8b, 0x7, 0x6f, 0x9b, 0x8c, 0x0, 0x4a, 0x29, 0x9b, 0x26, 0x81, 0xa4, 0x3e, 0xa5, 0x34, 0x2, 0x38, 0x2, 0x58, 0x0, 0xcc, 0x0, 0xe, 0x39, 0xe7, 0xd3, 0xfa, 0xb0, 0xee, 0xea, 0x8f, 0x7, 0x7b, 0xf5, 0x9d, 0xb7, 0xb0, 0x97, 0x55, 0x25, 0x5f, 0x17, 0xe9, 0x2e, 0xf9, 0xb8, 0xca, 0x3f, 0x9b, 0x1b, 0x1a, 0xe3, 0x40, 0x47, 0xa0, 0xda, 0xda, 0x61, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char close_hl_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,0x9b,0x49,0x44,0x41,0x54,0x38,0x8d,0xcd,0x92,0x31,0xe,0xc2,0x30,0x10,0x4,0x17,0xaa,0x3d,0x67,0xdb,0x58,0xd0,0xd3,0xf0,0xa3,0x7c,0x36,0x3c,0x82,0x48,0x44,0x22,0x6f,0xb1,0x4d,0x85,0x14,0x81,0xf,0x2c,0x28,0xe0,0xda,0xd5,0x8c,0x4e,0x77,0xb,0xfc,0xd5,0x98,0xd9,0x20,0x29,0x7a,0xb9,0xa4,0x68,0x66,0x83,0xb,0x93,0xcc,0x24,0xa7,0x9a,0x44,0x52,0x24,0x39,0x91,0xcc,0x55,0x89,0xa4,0xde,0xcc,0xce,0x24,0xb,0xc9,0x39,0x84,0xb0,0xf7,0xb2,0xae,0xeb,0x76,0xde,0x8a,0x4f,0x92,0x66,0xd8,0x91,0x5c,0x49,0x5e,0x9a,0xe1,0xb5,0x64,0x5,0x16,0x92,0x8b,0x7,0x6f,0x9b,0x8c,0x0,0x4a,0x29,0x9b,0x26,0x81,0xa4,0x3e,0xa5,0x34,0x2,0x38,0x2,0x58,0x0,0xcc,0x0,0xe,0x39,0xe7,0xd3,0xfa,0xb0,0xee,0xea,0x8f,0x7,0x7b,0xf5,0x9d,0xb7,0xb0,0x97,0x55,0x25,0x5f,0x17,0xe9,0x2e,0xf9,0xb8,0xca,0x3f,0x9b,0x1b,0x1a,0xe3,0x40,0x47,0xa0,0xda,0xda,0x61,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char close_hl_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, 0x9b, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xcd, 0x92, 0x31, 0xe, 0xc2, 0x30, 0x10, 0x4, 0x17, 0xaa, 0x3d, 0x67, 0xdb, 0x58, 0xd0, 0xd3, 0xf0, 0xa3, 0x7c, 0x36, 0x3c, 0x82, 0x48, 0x44, 0x22, 0x6f, 0xb1, 0x4d, 0x85, 0x14, 0x81, 0xf, 0x2c, 0x28, 0xe0, 0xda, 0xd5, 0x8c, 0x4e, 0x77, 0xb, 0xfc, 0xd5, 0x98, 0xd9, 0x20, 0x29, 0x7a, 0xb9, 0xa4, 0x68, 0x66, 0x83, 0xb, 0x93, 0xcc, 0x24, 0xa7, 0x9a, 0x44, 0x52, 0x24, 0x39, 0x91, 0xcc, 0x55, 0x89, 0xa4, 0xde, 0xcc, 0xce, 0x24, 0xb, 0xc9, 0x39, 0x84, 0xb0, 0xf7, 0xb2, 0xae, 0xeb, 0x76, 0xde, 0x8a, 0x4f, 0x92, 0x66, 0xd8, 0x91, 0x5c, 0x49, 0x5e, 0x9a, 0xe1, 0xb5, 0x64, 0x5, 0x16, 0x92, 0x8b, 0x7, 0x6f, 0x9b, 0x8c, 0x0, 0x4a, 0x29, 0x9b, 0x26, 0x81, 0xa4, 0x3e, 0xa5, 0x34, 0x2, 0x38, 0x2, 0x58, 0x0, 0xcc, 0x0, 0xe, 0x39, 0xe7, 0xd3, 0xfa, 0xb0, 0xee, 0xea, 0x8f, 0x7, 0x7b, 0xf5, 0x9d, 0xb7, 0xb0, 0x97, 0x55, 0x25, 0x5f, 0x17, 0xe9, 0x2e, 0xf9, 0xb8, 0xca, 0x3f, 0x9b, 0x1b, 0x1a, 0xe3, 0x40, 0x47, 0xa0, 0xda, 0xda, 0x61, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char color_picker_hue_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x8,0x2,0x0,0x0,0x0,0xfd,0x5c,0x8b,0xcf,0x0,0x0,0x0,0x59,0x49,0x44,0x41,0x54,0x28,0x91,0xcd,0xd0,0x31,0xa,0x3,0x31,0x10,0x43,0xd1,0x87,0xc0,0xf6,0xfd,0x8f,0x1b,0xdb,0x30,0x69,0x76,0x21,0x65,0xd8,0x14,0x71,0xf1,0xf9,0x8c,0x84,0x9a,0x51,0x44,0x13,0xfd,0x21,0xe3,0x87,0xed,0xf7,0xa8,0xcd,0x2a,0x99,0x8e,0x46,0x2b,0x94,0xd0,0x43,0xb,0xe3,0x64,0xb3,0x2a,0xa6,0x93,0xb9,0x9f,0x9a,0x4e,0x3a,0x69,0x97,0xc7,0xe5,0x3b,0x1b,0xff,0xef,0x6d,0xa5,0xec,0x30,0xc3,0xeb,0xf2,0xc,0xeb,0xe3,0x5e,0x27,0xf4,0x8a,0x37,0x75,0x7b,0x8a,0xe5,0x90,0x9a,0xab,0x81,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char color_picker_hue_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x1, 0x0, 0x8, 0x2, 0x0, 0x0, 0x0, 0xfd, 0x5c, 0x8b, 0xcf, 0x0, 0x0, 0x0, 0x59, 0x49, 0x44, 0x41, 0x54, 0x28, 0x91, 0xcd, 0xd0, 0x31, 0xa, 0x3, 0x31, 0x10, 0x43, 0xd1, 0x87, 0xc0, 0xf6, 0xfd, 0x8f, 0x1b, 0xdb, 0x30, 0x69, 0x76, 0x21, 0x65, 0xd8, 0x14, 0x71, 0xf1, 0xf9, 0x8c, 0x84, 0x9a, 0x51, 0x44, 0x13, 0xfd, 0x21, 0xe3, 0x87, 0xed, 0xf7, 0xa8, 0xcd, 0x2a, 0x99, 0x8e, 0x46, 0x2b, 0x94, 0xd0, 0x43, 0xb, 0xe3, 0x64, 0xb3, 0x2a, 0xa6, 0x93, 0xb9, 0x9f, 0x9a, 0x4e, 0x3a, 0x69, 0x97, 0xc7, 0xe5, 0x3b, 0x1b, 0xff, 0xef, 0x6d, 0xa5, 0xec, 0x30, 0xc3, 0xeb, 0xf2, 0xc, 0xeb, 0xe3, 0x5e, 0x27, 0xf4, 0x8a, 0x37, 0x75, 0x7b, 0x8a, 0xe5, 0x90, 0x9a, 0xab, 0x81, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char color_picker_sample_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x14,0x8,0x2,0x0,0x0,0x0,0xed,0x20,0x74,0x8,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,0x9,0x18,0xc,0x27,0x37,0x29,0x4f,0x42,0x2d,0x0,0x0,0x0,0x61,0x49,0x44,0x41,0x54,0x68,0xde,0xed,0xd9,0xb1,0xd,0x0,0x21,0xc,0x3,0x40,0x40,0xbf,0x5f,0x66,0xcd,0x84,0xf9,0x96,0x19,0xf0,0x5d,0x87,0x5c,0x5b,0x9,0xca,0x9e,0x99,0x75,0xe9,0xee,0xfb,0x59,0x55,0x52,0xe9,0xc3,0xe9,0x59,0x10,0x4c,0x1,0x50,0x0,0x50,0x0,0x8,0xf4,0xf9,0x15,0x49,0x93,0x53,0x13,0x0,0x2b,0x10,0x28,0x0,0x28,0x0,0x64,0xd9,0x2e,0xc1,0xd2,0xe4,0xd4,0x4,0xc0,0xa,0x4,0xa,0x0,0xa,0x0,0x59,0x5c,0x82,0xa5,0xd1,0xa9,0x9,0x80,0x15,0x8,0x14,0x0,0x14,0x0,0xb2,0xfc,0x5b,0xb2,0x3c,0x5a,0x4,0xa1,0xf3,0x57,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char color_picker_sample_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x14, 0x8, 0x2, 0x0, 0x0, 0x0, 0xed, 0x20, 0x74, 0x8, 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, 0x9, 0x18, 0xc, 0x27, 0x37, 0x29, 0x4f, 0x42, 0x2d, 0x0, 0x0, 0x0, 0x61, 0x49, 0x44, 0x41, 0x54, 0x68, 0xde, 0xed, 0xd9, 0xb1, 0xd, 0x0, 0x21, 0xc, 0x3, 0x40, 0x40, 0xbf, 0x5f, 0x66, 0xcd, 0x84, 0xf9, 0x96, 0x19, 0xf0, 0x5d, 0x87, 0x5c, 0x5b, 0x9, 0xca, 0x9e, 0x99, 0x75, 0xe9, 0xee, 0xfb, 0x59, 0x55, 0x52, 0xe9, 0xc3, 0xe9, 0x59, 0x10, 0x4c, 0x1, 0x50, 0x0, 0x50, 0x0, 0x8, 0xf4, 0xf9, 0x15, 0x49, 0x93, 0x53, 0x13, 0x0, 0x2b, 0x10, 0x28, 0x0, 0x28, 0x0, 0x64, 0xd9, 0x2e, 0xc1, 0xd2, 0xe4, 0xd4, 0x4, 0xc0, 0xa, 0x4, 0xa, 0x0, 0xa, 0x0, 0x59, 0x5c, 0x82, 0xa5, 0xd1, 0xa9, 0x9, 0x80, 0x15, 0x8, 0x14, 0x0, 0x14, 0x0, 0xb2, 0xfc, 0x5b, 0xb2, 0x3c, 0x5a, 0x4, 0xa1, 0xf3, 0x57, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char dosfont_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x80,0x0,0x0,0x0,0x80,0x1,0x0,0x0,0x0,0x0,0xeb,0x45,0x5c,0x66,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,0x2,0x74,0x52,0x4e,0x53,0x0,0x0,0x76,0x93,0xcd,0x38,0x0,0x0,0x0,0x2,0x62,0x4b,0x47,0x44,0x0,0x1,0xdd,0x8a,0x13,0xa4,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x89,0x0,0x0,0xb,0x89,0x1,0x37,0xc9,0xcb,0xad,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xe0,0x6,0x16,0x12,0x2b,0x5,0x39,0x1a,0x32,0x39,0x0,0x0,0x2,0x83,0x49,0x44,0x41,0x54,0x48,0xc7,0xed,0xd4,0xb1,0x6e,0xdb,0x30,0x10,0x0,0x50,0x22,0x3,0x27,0x22,0xc8,0x78,0x83,0x91,0xa9,0x1f,0xc0,0xa9,0x10,0xa,0x7e,0xc,0x11,0x14,0x87,0xc,0x1c,0x32,0x9,0x1a,0xe,0x46,0xa6,0xfc,0x43,0xff,0x86,0xb5,0x80,0x9b,0x88,0x8e,0x5d,0x64,0x18,0x9e,0xdc,0xd5,0x53,0x91,0xc1,0xa0,0x7a,0xa4,0xe4,0xd4,0x31,0xd2,0x25,0x70,0x97,0xa2,0x37,0x48,0xe6,0x33,0x45,0xdd,0x51,0x24,0x95,0x7a,0x23,0xe0,0x75,0x13,0xb,0xd8,0x93,0xbf,0x51,0x51,0xa3,0xac,0x99,0xc9,0x29,0x87,0x81,0x83,0xb2,0x0,0xc7,0xfe,0xee,0x43,0x58,0x85,0x95,0xb7,0xa6,0xb6,0xaf,0x7a,0xe9,0x93,0x63,0xc3,0xf2,0xc,0x96,0x3e,0xba,0x97,0x11,0x3,0xb5,0x46,0xc0,0x15,0x30,0x43,0x1,0xbd,0x6,0x81,0x71,0xa9,0xb2,0x82,0x9,0x92,0x3d,0xf6,0xb0,0xbd,0x5c,0xf2,0x53,0xf2,0x75,0xc,0x11,0x5f,0xc7,0xe0,0xc4,0xaa,0xb4,0x40,0x41,0xc4,0x69,0xd0,0x27,0x55,0x12,0x13,0x78,0x74,0xa7,0xb5,0xd8,0x3f,0x14,0x77,0x81,0x0,0x22,0x93,0x9b,0x4c,0x54,0x5b,0x72,0x6d,0x98,0x17,0xd1,0x33,0xb3,0x94,0xaa,0x3c,0x93,0xea,0xb4,0x76,0x31,0x6a,0x66,0x0,0xa9,0x59,0x1c,0x8c,0xe,0x33,0xc0,0x12,0x4c,0x29,0xc2,0xa5,0xc3,0xc1,0xd0,0xb2,0x64,0x6a,0x60,0xa3,0xc0,0xea,0xac,0x19,0x58,0x4b,0xa9,0x4a,0x17,0xf0,0xda,0x68,0xb6,0x5,0xec,0xb2,0xf6,0x88,0x33,0xc8,0x18,0x52,0xd5,0x5a,0x1,0xb3,0x61,0x1,0x53,0xdf,0x2,0x51,0x2d,0x33,0xdd,0x12,0x59,0xea,0x94,0x95,0x3c,0x80,0x2e,0x5e,0xf9,0xdb,0x71,0x73,0x70,0xcf,0x39,0x3b,0x76,0xb7,0xbb,0x7d,0xcf,0x74,0x50,0xd,0x62,0x40,0x44,0x6,0x83,0xfe,0xc7,0x8e,0x51,0x5,0x5c,0xe1,0xdd,0xdd,0xaa,0xc2,0xf8,0x53,0x80,0x31,0xe2,0xfd,0x7d,0x14,0x8,0x7e,0xcc,0x5,0x28,0x62,0xd7,0xc5,0xc,0xa6,0xf3,0xc3,0x46,0xa6,0x30,0xd7,0x1e,0x1b,0x2e,0xd0,0x7f,0x63,0x5f,0x1f,0xf1,0x32,0xc9,0x90,0x82,0xef,0xb9,0x82,0xc,0x5a,0x1,0xef,0x66,0x90,0xd7,0x7a,0x2c,0x80,0x13,0x94,0xc4,0xf6,0x9f,0xd8,0x75,0xbb,0x2c,0x89,0xed,0xff,0x42,0xe9,0xa7,0xfb,0xa4,0x84,0xec,0x13,0x45,0x7,0x1a,0xb9,0x97,0x18,0x65,0xab,0x4,0xf9,0x54,0x8c,0x3c,0x54,0xe8,0xed,0xa3,0x7c,0x7b,0x55,0xe0,0x8b,0x0,0xf6,0x4f,0x36,0xd6,0x3d,0xc3,0xe8,0x41,0xc0,0xa1,0xb1,0xdb,0x9,0xa8,0x29,0x0,0xe,0xec,0xc3,0x4,0xc1,0x8,0xc,0x0,0xd6,0x36,0xf3,0x23,0xba,0x80,0x3,0x6f,0x17,0x15,0xbe,0x4b,0xe5,0x8c,0x23,0xc2,0x57,0x7b,0x5d,0x61,0x53,0xc0,0x61,0xf,0xbd,0xd5,0x15,0x68,0x47,0x8e,0x0,0x7b,0x37,0xba,0xab,0xba,0x59,0xcc,0x79,0x3d,0xd7,0xaf,0x5a,0xe3,0x85,0x66,0x69,0xab,0x16,0x32,0x31,0x5b,0xd0,0xdb,0x66,0x2,0x2f,0x6f,0xe,0xb2,0x42,0xb5,0x87,0xdf,0xf0,0x59,0xae,0x6a,0x86,0xae,0x93,0x4c,0x7d,0x1b,0x9a,0x6b,0x84,0xdd,0x9a,0xd6,0xca,0xc8,0x89,0xc3,0xfb,0xd4,0x82,0xe,0x30,0xa2,0x2c,0x18,0xc2,0x98,0xb2,0x4f,0x8,0xba,0x83,0xa1,0x40,0x12,0x88,0x6f,0x43,0x38,0x82,0x1c,0x1f,0x15,0x70,0x82,0x96,0xa8,0xa5,0x3d,0xed,0x9c,0xde,0xb9,0x1,0xe9,0xb8,0x5f,0x4c,0x39,0xd2,0xa6,0xac,0xa6,0x48,0xe7,0xd0,0x95,0x53,0xb0,0xc4,0x7b,0x97,0xd4,0xcd,0x3c,0xdd,0xf0,0xd0,0x4e,0xbf,0xe6,0x65,0x24,0x5b,0x7b,0x7d,0xe,0xe5,0xd6,0xae,0xe9,0x90,0x64,0xfd,0x70,0x9e,0x21,0xb5,0x6c,0x5,0xa4,0xa2,0x87,0xe9,0xa3,0x25,0xf4,0x5,0x5c,0x39,0x61,0xa6,0x1e,0xbe,0x11,0x18,0x80,0xed,0xb,0x18,0x9b,0x70,0x70,0xec,0x5f,0x80,0x3f,0x26,0x27,0xb3,0xc9,0x33,0xc8,0x5c,0x2c,0x5a,0x59,0x1f,0xcb,0x2c,0x89,0x9d,0xae,0xf,0x7d,0xcc,0xdb,0x9c,0xdd,0xd5,0xed,0x7c,0x7f,0xbe,0xd0,0x52,0xf9,0x1f,0xff,0x76,0xfc,0x2,0x24,0x3a,0x65,0x42,0xf6,0x41,0x91,0x95,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 dosfont_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x80, 0x1, 0x0, 0x0, 0x0, 0x0, 0xeb, 0x45, 0x5c, 0x66, 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, 0x2, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x0, 0x76, 0x93, 0xcd, 0x38, 0x0, 0x0, 0x0, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0x1, 0xdd, 0x8a, 0x13, 0xa4, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x89, 0x0, 0x0, 0xb, 0x89, 0x1, 0x37, 0xc9, 0xcb, 0xad, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xe0, 0x6, 0x16, 0x12, 0x2b, 0x5, 0x39, 0x1a, 0x32, 0x39, 0x0, 0x0, 0x2, 0x83, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0xd4, 0xb1, 0x6e, 0xdb, 0x30, 0x10, 0x0, 0x50, 0x22, 0x3, 0x27, 0x22, 0xc8, 0x78, 0x83, 0x91, 0xa9, 0x1f, 0xc0, 0xa9, 0x10, 0xa, 0x7e, 0xc, 0x11, 0x14, 0x87, 0xc, 0x1c, 0x32, 0x9, 0x1a, 0xe, 0x46, 0xa6, 0xfc, 0x43, 0xff, 0x86, 0xb5, 0x80, 0x9b, 0x88, 0x8e, 0x5d, 0x64, 0x18, 0x9e, 0xdc, 0xd5, 0x53, 0x91, 0xc1, 0xa0, 0x7a, 0xa4, 0xe4, 0xd4, 0x31, 0xd2, 0x25, 0x70, 0x97, 0xa2, 0x37, 0x48, 0xe6, 0x33, 0x45, 0xdd, 0x51, 0x24, 0x95, 0x7a, 0x23, 0xe0, 0x75, 0x13, 0xb, 0xd8, 0x93, 0xbf, 0x51, 0x51, 0xa3, 0xac, 0x99, 0xc9, 0x29, 0x87, 0x81, 0x83, 0xb2, 0x0, 0xc7, 0xfe, 0xee, 0x43, 0x58, 0x85, 0x95, 0xb7, 0xa6, 0xb6, 0xaf, 0x7a, 0xe9, 0x93, 0x63, 0xc3, 0xf2, 0xc, 0x96, 0x3e, 0xba, 0x97, 0x11, 0x3, 0xb5, 0x46, 0xc0, 0x15, 0x30, 0x43, 0x1, 0xbd, 0x6, 0x81, 0x71, 0xa9, 0xb2, 0x82, 0x9, 0x92, 0x3d, 0xf6, 0xb0, 0xbd, 0x5c, 0xf2, 0x53, 0xf2, 0x75, 0xc, 0x11, 0x5f, 0xc7, 0xe0, 0xc4, 0xaa, 0xb4, 0x40, 0x41, 0xc4, 0x69, 0xd0, 0x27, 0x55, 0x12, 0x13, 0x78, 0x74, 0xa7, 0xb5, 0xd8, 0x3f, 0x14, 0x77, 0x81, 0x0, 0x22, 0x93, 0x9b, 0x4c, 0x54, 0x5b, 0x72, 0x6d, 0x98, 0x17, 0xd1, 0x33, 0xb3, 0x94, 0xaa, 0x3c, 0x93, 0xea, 0xb4, 0x76, 0x31, 0x6a, 0x66, 0x0, 0xa9, 0x59, 0x1c, 0x8c, 0xe, 0x33, 0xc0, 0x12, 0x4c, 0x29, 0xc2, 0xa5, 0xc3, 0xc1, 0xd0, 0xb2, 0x64, 0x6a, 0x60, 0xa3, 0xc0, 0xea, 0xac, 0x19, 0x58, 0x4b, 0xa9, 0x4a, 0x17, 0xf0, 0xda, 0x68, 0xb6, 0x5, 0xec, 0xb2, 0xf6, 0x88, 0x33, 0xc8, 0x18, 0x52, 0xd5, 0x5a, 0x1, 0xb3, 0x61, 0x1, 0x53, 0xdf, 0x2, 0x51, 0x2d, 0x33, 0xdd, 0x12, 0x59, 0xea, 0x94, 0x95, 0x3c, 0x80, 0x2e, 0x5e, 0xf9, 0xdb, 0x71, 0x73, 0x70, 0xcf, 0x39, 0x3b, 0x76, 0xb7, 0xbb, 0x7d, 0xcf, 0x74, 0x50, 0xd, 0x62, 0x40, 0x44, 0x6, 0x83, 0xfe, 0xc7, 0x8e, 0x51, 0x5, 0x5c, 0xe1, 0xdd, 0xdd, 0xaa, 0xc2, 0xf8, 0x53, 0x80, 0x31, 0xe2, 0xfd, 0x7d, 0x14, 0x8, 0x7e, 0xcc, 0x5, 0x28, 0x62, 0xd7, 0xc5, 0xc, 0xa6, 0xf3, 0xc3, 0x46, 0xa6, 0x30, 0xd7, 0x1e, 0x1b, 0x2e, 0xd0, 0x7f, 0x63, 0x5f, 0x1f, 0xf1, 0x32, 0xc9, 0x90, 0x82, 0xef, 0xb9, 0x82, 0xc, 0x5a, 0x1, 0xef, 0x66, 0x90, 0xd7, 0x7a, 0x2c, 0x80, 0x13, 0x94, 0xc4, 0xf6, 0x9f, 0xd8, 0x75, 0xbb, 0x2c, 0x89, 0xed, 0xff, 0x42, 0xe9, 0xa7, 0xfb, 0xa4, 0x84, 0xec, 0x13, 0x45, 0x7, 0x1a, 0xb9, 0x97, 0x18, 0x65, 0xab, 0x4, 0xf9, 0x54, 0x8c, 0x3c, 0x54, 0xe8, 0xed, 0xa3, 0x7c, 0x7b, 0x55, 0xe0, 0x8b, 0x0, 0xf6, 0x4f, 0x36, 0xd6, 0x3d, 0xc3, 0xe8, 0x41, 0xc0, 0xa1, 0xb1, 0xdb, 0x9, 0xa8, 0x29, 0x0, 0xe, 0xec, 0xc3, 0x4, 0xc1, 0x8, 0xc, 0x0, 0xd6, 0x36, 0xf3, 0x23, 0xba, 0x80, 0x3, 0x6f, 0x17, 0x15, 0xbe, 0x4b, 0xe5, 0x8c, 0x23, 0xc2, 0x57, 0x7b, 0x5d, 0x61, 0x53, 0xc0, 0x61, 0xf, 0xbd, 0xd5, 0x15, 0x68, 0x47, 0x8e, 0x0, 0x7b, 0x37, 0xba, 0xab, 0xba, 0x59, 0xcc, 0x79, 0x3d, 0xd7, 0xaf, 0x5a, 0xe3, 0x85, 0x66, 0x69, 0xab, 0x16, 0x32, 0x31, 0x5b, 0xd0, 0xdb, 0x66, 0x2, 0x2f, 0x6f, 0xe, 0xb2, 0x42, 0xb5, 0x87, 0xdf, 0xf0, 0x59, 0xae, 0x6a, 0x86, 0xae, 0x93, 0x4c, 0x7d, 0x1b, 0x9a, 0x6b, 0x84, 0xdd, 0x9a, 0xd6, 0xca, 0xc8, 0x89, 0xc3, 0xfb, 0xd4, 0x82, 0xe, 0x30, 0xa2, 0x2c, 0x18, 0xc2, 0x98, 0xb2, 0x4f, 0x8, 0xba, 0x83, 0xa1, 0x40, 0x12, 0x88, 0x6f, 0x43, 0x38, 0x82, 0x1c, 0x1f, 0x15, 0x70, 0x82, 0x96, 0xa8, 0xa5, 0x3d, 0xed, 0x9c, 0xde, 0xb9, 0x1, 0xe9, 0xb8, 0x5f, 0x4c, 0x39, 0xd2, 0xa6, 0xac, 0xa6, 0x48, 0xe7, 0xd0, 0x95, 0x53, 0xb0, 0xc4, 0x7b, 0x97, 0xd4, 0xcd, 0x3c, 0xdd, 0xf0, 0xd0, 0x4e, 0xbf, 0xe6, 0x65, 0x24, 0x5b, 0x7b, 0x7d, 0xe, 0xe5, 0xd6, 0xae, 0xe9, 0x90, 0x64, 0xfd, 0x70, 0x9e, 0x21, 0xb5, 0x6c, 0x5, 0xa4, 0xa2, 0x87, 0xe9, 0xa3, 0x25, 0xf4, 0x5, 0x5c, 0x39, 0x61, 0xa6, 0x1e, 0xbe, 0x11, 0x18, 0x80, 0xed, 0xb, 0x18, 0x9b, 0x70, 0x70, 0xec, 0x5f, 0x80, 0x3f, 0x26, 0x27, 0xb3, 0xc9, 0x33, 0xc8, 0x5c, 0x2c, 0x5a, 0x59, 0x1f, 0xcb, 0x2c, 0x89, 0x9d, 0xae, 0xf, 0x7d, 0xcc, 0xdb, 0x9c, 0xdd, 0xd5, 0xed, 0x7c, 0x7f, 0xbe, 0xd0, 0x52, 0xf9, 0x1f, 0xff, 0x76, 0xfc, 0x2, 0x24, 0x3a, 0x65, 0x42, 0xf6, 0x41, 0x91, 0x95, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 dropdown_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x8,0x4,0x0,0x0,0x0,0x6e,0x6,0x76,0x0,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,0x2,0x62,0x4b,0x47,0x44,0x0,0xff,0x87,0x8f,0xcc,0xbf,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,0x64,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x60,0xf8,0xc0,0xcc,0x0,0x5,0x1f,0x98,0x19,0x18,0x18,0x3f,0x30,0xff,0xd3,0x83,0x70,0xff,0x33,0x33,0x30,0x8,0x9f,0x61,0xf9,0x6b,0xff,0x65,0x2f,0x3,0x1c,0xbc,0xea,0x66,0x62,0xbc,0xcf,0xc0,0xc0,0xf0,0x7,0x26,0xc0,0x74,0x89,0x89,0xe9,0x29,0x9f,0x14,0x3,0xb,0xc3,0x5f,0x6,0x6,0x6,0x6,0xee,0x38,0x91,0x25,0xc,0xc,0xc,0x1f,0xd8,0xde,0x4b,0x3e,0xfc,0xff,0xf0,0xff,0x9b,0x58,0xb8,0xce,0xf,0x6c,0xef,0xe4,0xde,0xa4,0x32,0x20,0x83,0xf,0x4c,0x30,0x16,0x0,0x75,0xad,0x1b,0x7f,0x65,0xec,0x78,0x4c,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 dropdown_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x8, 0x4, 0x0, 0x0, 0x0, 0x6e, 0x6, 0x76, 0x0, 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, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 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, 0x64, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x60, 0xf8, 0xc0, 0xcc, 0x0, 0x5, 0x1f, 0x98, 0x19, 0x18, 0x18, 0x3f, 0x30, 0xff, 0xd3, 0x83, 0x70, 0xff, 0x33, 0x33, 0x30, 0x8, 0x9f, 0x61, 0xf9, 0x6b, 0xff, 0x65, 0x2f, 0x3, 0x1c, 0xbc, 0xea, 0x66, 0x62, 0xbc, 0xcf, 0xc0, 0xc0, 0xf0, 0x7, 0x26, 0xc0, 0x74, 0x89, 0x89, 0xe9, 0x29, 0x9f, 0x14, 0x3, 0xb, 0xc3, 0x5f, 0x6, 0x6, 0x6, 0x6, 0xee, 0x38, 0x91, 0x25, 0xc, 0xc, 0xc, 0x1f, 0xd8, 0xde, 0x4b, 0x3e, 0xfc, 0xff, 0xf0, 0xff, 0x9b, 0x58, 0xb8, 0xce, 0xf, 0x6c, 0xef, 0xe4, 0xde, 0xa4, 0x32, 0x20, 0x83, 0xf, 0x4c, 0x30, 0x16, 0x0, 0x75, 0xad, 0x1b, 0x7f, 0x65, 0xec, 0x78, 0x4c, 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 error_icon_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x4,0x0,0x0,0x0,0xd9,0x73,0xb2,0x7f,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,0x2,0x62,0x4b,0x47,0x44,0x0,0xff,0x87,0x8f,0xcc,0xbf,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,0x5d,0x49,0x44,0x41,0x54,0x48,0xc7,0xed,0x94,0xc1,0xe,0x80,0x20,0xc,0x43,0x5b,0xe3,0xff,0xff,0x72,0x3d,0xcc,0x85,0xa1,0xbb,0x18,0xf4,0x62,0xca,0xa9,0x74,0xe3,0x65,0xd,0x1,0xa,0x6b,0x6b,0x5b,0x3c,0x6f,0x80,0x1,0x7f,0x1,0xec,0x29,0x78,0xbe,0x2a,0x31,0x94,0x98,0x9e,0x98,0xf5,0xab,0x37,0x1,0xaa,0x19,0x8d,0xe2,0x50,0xb1,0x9b,0xbd,0xb7,0x23,0x8c,0x21,0x7b,0xd5,0xf5,0x3d,0x88,0x50,0x1,0xdf,0x46,0xb8,0xf,0x5c,0xef,0xa6,0xab,0xd1,0x7f,0xa2,0x1,0x6,0x0,0x0,0xe,0x62,0x6,0x31,0x47,0xb6,0x7f,0xdd,0x14,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 error_icon_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x20, 0x8, 0x4, 0x0, 0x0, 0x0, 0xd9, 0x73, 0xb2, 0x7f, 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, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 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, 0x5d, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0x94, 0xc1, 0xe, 0x80, 0x20, 0xc, 0x43, 0x5b, 0xe3, 0xff, 0xff, 0x72, 0x3d, 0xcc, 0x85, 0xa1, 0xbb, 0x18, 0xf4, 0x62, 0xca, 0xa9, 0x74, 0xe3, 0x65, 0xd, 0x1, 0xa, 0x6b, 0x6b, 0x5b, 0x3c, 0x6f, 0x80, 0x1, 0x7f, 0x1, 0xec, 0x29, 0x78, 0xbe, 0x2a, 0x31, 0x94, 0x98, 0x9e, 0x98, 0xf5, 0xab, 0x37, 0x1, 0xaa, 0x19, 0x8d, 0xe2, 0x50, 0xb1, 0x9b, 0xbd, 0xb7, 0x23, 0x8c, 0x21, 0x7b, 0xd5, 0xf5, 0x3d, 0x88, 0x50, 0x1, 0xdf, 0x46, 0xb8, 0xf, 0x5c, 0xef, 0xa6, 0xab, 0xd1, 0x7f, 0xa2, 0x1, 0x6, 0x0, 0x0, 0xe, 0x62, 0x6, 0x31, 0x47, 0xb6, 0x7f, 0xdd, 0x14, 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 focus_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xc,0x0,0x0,0x0,0xc,0x4,0x3,0x0,0x0,0x0,0xa4,0x5b,0x41,0xd4,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,0x30,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0xff,0xff,0xff,0xb9,0xa2,0x9b,0xc9,0x0,0x0,0x0,0xf,0x74,0x52,0x4e,0x53,0x0,0xe,0x39,0x68,0x7a,0x7b,0x3a,0x74,0x10,0x8,0x69,0xf,0x6,0x75,0x11,0xb8,0x16,0x0,0x1,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xf,0x18,0xba,0x0,0xd9,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,0x38,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x10,0x32,0x9,0xd,0x75,0x56,0x64,0x48,0xef,0x9c,0x39,0x73,0x46,0x19,0xc3,0x6a,0x6,0x20,0xd8,0xc5,0x10,0x3,0xa2,0x8e,0x32,0x44,0x82,0xa8,0xa9,0xd8,0x29,0xa8,0x12,0xb0,0x6,0x29,0x86,0xdc,0x9d,0x33,0x67,0xce,0x2b,0x63,0x10,0x3,0x1b,0x6,0x0,0xdf,0xc6,0x11,0x6d,0xb8,0xf4,0x9c,0xac,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 focus_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0xc, 0x4, 0x3, 0x0, 0x0, 0x0, 0xa4, 0x5b, 0x41, 0xd4, 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, 0x30, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0xff, 0xff, 0xff, 0xb9, 0xa2, 0x9b, 0xc9, 0x0, 0x0, 0x0, 0xf, 0x74, 0x52, 0x4e, 0x53, 0x0, 0xe, 0x39, 0x68, 0x7a, 0x7b, 0x3a, 0x74, 0x10, 0x8, 0x69, 0xf, 0x6, 0x75, 0x11, 0xb8, 0x16, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xf, 0x18, 0xba, 0x0, 0xd9, 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, 0x38, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x10, 0x32, 0x9, 0xd, 0x75, 0x56, 0x64, 0x48, 0xef, 0x9c, 0x39, 0x73, 0x46, 0x19, 0xc3, 0x6a, 0x6, 0x20, 0xd8, 0xc5, 0x10, 0x3, 0xa2, 0x8e, 0x32, 0x44, 0x82, 0xa8, 0xa9, 0xd8, 0x29, 0xa8, 0x12, 0xb0, 0x6, 0x29, 0x86, 0xdc, 0x9d, 0x33, 0x67, 0xce, 0x2b, 0x63, 0x10, 0x3, 0x1b, 0x6, 0x0, 0xdf, 0xc6, 0x11, 0x6d, 0xb8, 0xf4, 0x9c, 0xac, 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 frame_focus_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xc,0x0,0x0,0x0,0xc,0x4,0x3,0x0,0x0,0x0,0xa4,0x5b,0x41,0xd4,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,0x30,0x50,0x4c,0x54,0x45,0xff,0xff,0xff,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0x47,0x8c,0xbf,0xff,0xff,0xff,0xcc,0x40,0x27,0xb9,0x0,0x0,0x0,0xf,0x74,0x52,0x4e,0x53,0x0,0xe,0x39,0x68,0x7a,0x7b,0x3a,0x74,0x10,0x8,0x69,0xf,0x6,0x75,0x11,0xb8,0x16,0x0,0x1,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x0,0x88,0x5,0x1d,0x48,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x38,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x10,0x32,0x9,0xd,0x75,0x56,0x64,0x48,0xef,0x9c,0x39,0x73,0x46,0x19,0xc3,0x6a,0x6,0x20,0xd8,0xc5,0x10,0x3,0xa2,0x8e,0x32,0x44,0x82,0xa8,0xa9,0xd8,0x29,0xa8,0x12,0xb0,0x6,0x29,0x86,0xdc,0x9d,0x33,0x67,0xce,0x2b,0x63,0x10,0x3,0x1b,0x6,0x0,0xdf,0xc6,0x11,0x6d,0xb8,0xf4,0x9c,0xac,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 frame_focus_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0xc, 0x4, 0x3, 0x0, 0x0, 0x0, 0xa4, 0x5b, 0x41, 0xd4, 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, 0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0xff, 0xff, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0x47, 0x8c, 0xbf, 0xff, 0xff, 0xff, 0xcc, 0x40, 0x27, 0xb9, 0x0, 0x0, 0x0, 0xf, 0x74, 0x52, 0x4e, 0x53, 0x0, 0xe, 0x39, 0x68, 0x7a, 0x7b, 0x3a, 0x74, 0x10, 0x8, 0x69, 0xf, 0x6, 0x75, 0x11, 0xb8, 0x16, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x0, 0x88, 0x5, 0x1d, 0x48, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x38, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x10, 0x32, 0x9, 0xd, 0x75, 0x56, 0x64, 0x48, 0xef, 0x9c, 0x39, 0x73, 0x46, 0x19, 0xc3, 0x6a, 0x6, 0x20, 0xd8, 0xc5, 0x10, 0x3, 0xa2, 0x8e, 0x32, 0x44, 0x82, 0xa8, 0xa9, 0xd8, 0x29, 0xa8, 0x12, 0xb0, 0x6, 0x29, 0x86, 0xdc, 0x9d, 0x33, 0x67, 0xce, 0x2b, 0x63, 0x10, 0x3, 0x1b, 0x6, 0x0, 0xdf, 0xc6, 0x11, 0x6d, 0xb8, 0xf4, 0x9c, 0xac, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 full_panel_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x3,0x0,0x0,0x0,0x44,0xa4,0x8a,0xc6,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,0x33,0x50,0x4c,0x54,0x45,0x27,0x27,0x29,0x26,0x26,0x28,0x25,0x25,0x27,0x24,0x24,0x26,0x23,0x23,0x25,0x22,0x22,0x24,0x21,0x21,0x23,0x1e,0x1e,0x20,0x1d,0x1d,0x1f,0x1c,0x1c,0x1e,0x31,0x30,0x32,0x50,0x4e,0x54,0x4e,0x4c,0x50,0x4c,0x4a,0x4e,0x3d,0x3b,0x3f,0x38,0x36,0x3a,0xff,0xff,0xff,0x4,0xb3,0x69,0x9b,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x10,0x95,0xb2,0xd,0x2c,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,0x63,0x49,0x44,0x41,0x54,0x38,0xcb,0xed,0x93,0x29,0x12,0xc0,0x30,0xc,0xc4,0x7c,0x3b,0x67,0xf3,0xff,0xdf,0xb6,0xe1,0xce,0x98,0x15,0x45,0x58,0xb3,0x68,0x5,0x0,0x80,0x48,0x21,0x88,0xb0,0x41,0x62,0x51,0xb,0x50,0x61,0xda,0xa,0xb1,0x79,0xa9,0x1,0xc5,0x8d,0xe9,0x1b,0x60,0x6b,0x7d,0xcc,0x80,0xd1,0x9b,0x31,0x2,0x8a,0xf7,0x67,0x85,0x3c,0xdd,0x5,0x81,0xb4,0x8c,0x75,0x60,0x14,0x25,0x20,0xab,0xf3,0x24,0xcc,0x6a,0x57,0xb8,0xc2,0xff,0x42,0x76,0xda,0xf4,0xf6,0x69,0x38,0x69,0x7a,0x79,0xbc,0x49,0xfe,0x2f,0x65,0xd3,0x2d,0x45,0xb,0x5e,0xbc,0x3b,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 full_panel_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x20, 0x8, 0x3, 0x0, 0x0, 0x0, 0x44, 0xa4, 0x8a, 0xc6, 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, 0x33, 0x50, 0x4c, 0x54, 0x45, 0x27, 0x27, 0x29, 0x26, 0x26, 0x28, 0x25, 0x25, 0x27, 0x24, 0x24, 0x26, 0x23, 0x23, 0x25, 0x22, 0x22, 0x24, 0x21, 0x21, 0x23, 0x1e, 0x1e, 0x20, 0x1d, 0x1d, 0x1f, 0x1c, 0x1c, 0x1e, 0x31, 0x30, 0x32, 0x50, 0x4e, 0x54, 0x4e, 0x4c, 0x50, 0x4c, 0x4a, 0x4e, 0x3d, 0x3b, 0x3f, 0x38, 0x36, 0x3a, 0xff, 0xff, 0xff, 0x4, 0xb3, 0x69, 0x9b, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x10, 0x95, 0xb2, 0xd, 0x2c, 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, 0x63, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0xed, 0x93, 0x29, 0x12, 0xc0, 0x30, 0xc, 0xc4, 0x7c, 0x3b, 0x67, 0xf3, 0xff, 0xdf, 0xb6, 0xe1, 0xce, 0x98, 0x15, 0x45, 0x58, 0xb3, 0x68, 0x5, 0x0, 0x80, 0x48, 0x21, 0x88, 0xb0, 0x41, 0x62, 0x51, 0xb, 0x50, 0x61, 0xda, 0xa, 0xb1, 0x79, 0xa9, 0x1, 0xc5, 0x8d, 0xe9, 0x1b, 0x60, 0x6b, 0x7d, 0xcc, 0x80, 0xd1, 0x9b, 0x31, 0x2, 0x8a, 0xf7, 0x67, 0x85, 0x3c, 0xdd, 0x5, 0x81, 0xb4, 0x8c, 0x75, 0x60, 0x14, 0x25, 0x20, 0xab, 0xf3, 0x24, 0xcc, 0x6a, 0x57, 0xb8, 0xc2, 0xff, 0x42, 0x76, 0xda, 0xf4, 0xf6, 0x69, 0x38, 0x69, 0x7a, 0x79, 0xbc, 0x49, 0xfe, 0x2f, 0x65, 0xd3, 0x2d, 0x45, 0xb, 0x5e, 0xbc, 0x3b, 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 graph_node_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x40,0x8,0x6,0x0,0x0,0x0,0x13,0x7d,0xf7,0x96,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,0x8,0x17,0xd,0x5,0x12,0xa1,0x38,0x83,0x9b,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x2,0x74,0x49,0x44,0x41,0x54,0x58,0xc3,0xed,0x97,0x3d,0x6f,0xd3,0x60,0x10,0xc7,0x7f,0x17,0x9b,0x26,0x25,0x22,0xad,0xa,0x8,0xf1,0x52,0x75,0x0,0x16,0x24,0x90,0x2a,0x96,0x7c,0x1,0x6,0xc4,0xce,0xc4,0x17,0x0,0x31,0xb0,0x30,0x0,0x23,0x82,0x85,0x5,0x9,0x4,0x5f,0x80,0x89,0x1d,0x31,0xf0,0x5,0x58,0x50,0x25,0x50,0x59,0x80,0xa1,0xe2,0xad,0x28,0x34,0x4a,0x3,0x25,0x76,0xea,0xe7,0x39,0x6,0x3f,0x76,0x6d,0xc7,0x49,0x5f,0xd8,0x90,0x6f,0xb1,0xf5,0xe4,0xb9,0xdf,0xdd,0xfd,0xef,0x22,0xf9,0x84,0x2d,0x13,0xa0,0x6,0x78,0xee,0x29,0xe4,0x4d,0x1,0xb,0x18,0xf7,0x54,0x32,0x97,0x6a,0xc0,0x7e,0x60,0xe,0x38,0xc,0xb4,0x80,0x7d,0x5,0xc0,0x26,0xd0,0x7,0x3a,0x40,0x17,0xf8,0x3,0xd8,0x24,0x6a,0x13,0x38,0x35,0x73,0x60,0xf6,0x6a,0xa3,0xde,0xb8,0x38,0x35,0x55,0x3f,0x41,0x89,0xd,0x87,0xe1,0x97,0x20,0xc,0x5e,0xae,0xff,0xea,0x3d,0x5,0x3e,0x2,0x1b,0xe2,0x22,0x2d,0xcc,0xcd,0x1e,0x7c,0x78,0x72,0xe1,0xf4,0xa5,0x7b,0xb7,0x1f,0x7c,0x9e,0x6e,0x35,0xca,0xfc,0x19,0xf4,0x3,0xee,0xdc,0xbf,0x39,0xff,0x69,0xe5,0xc3,0x8b,0x6e,0x6f,0xed,0x6,0xb0,0x22,0x40,0x3,0x58,0x3c,0x7a,0xe4,0xf8,0xab,0x67,0x4f,0x9e,0x77,0xa3,0xc8,0x12,0xd,0xa3,0x52,0x80,0x3f,0xe5,0xe3,0xfb,0x35,0xae,0x5c,0xbb,0x3c,0xf7,0xfd,0xc7,0xd7,0xb,0xc0,0x92,0xef,0x74,0x68,0xfa,0x9e,0xdf,0x1c,0xfc,0xe,0xbb,0x88,0xc6,0x47,0xa,0x2a,0x59,0x85,0x95,0x61,0xb8,0xc9,0x30,0x4,0xdf,0xf3,0x9b,0xae,0x6c,0x49,0x0,0x1e,0x80,0x51,0x1b,0xfb,0xc7,0x2,0xc7,0x5a,0x3b,0x88,0x66,0xcf,0x63,0xf3,0x12,0x80,0x26,0xbf,0xa8,0xb5,0xa8,0xa,0x88,0x22,0x8,0x8a,0x22,0x2a,0x19,0x37,0x1d,0xe9,0xad,0x9f,0x6b,0xb4,0x55,0x14,0x5,0x55,0x44,0xe2,0x32,0x6c,0xe2,0x24,0x71,0x18,0x9d,0x4,0xb0,0x6a,0xd3,0x1b,0x2a,0xe9,0x4b,0xfc,0xae,0xe4,0x45,0x19,0x9f,0x81,0x2b,0xdb,0x15,0xa6,0xa2,0x19,0x2d,0xec,0x8,0x24,0x7,0x30,0xd6,0x16,0xf8,0x82,0xa8,0xc6,0x45,0x68,0x52,0xbf,0x4e,0xce,0x60,0xeb,0x42,0x5c,0xb4,0x66,0x9c,0x6c,0xc9,0x1f,0xa4,0x0,0xb0,0x39,0xc5,0xc9,0xa1,0x28,0x89,0x5f,0x14,0xd1,0x5a,0x37,0x32,0x89,0xf2,0x82,0xc6,0x3,0xe0,0xda,0xa,0x22,0x3a,0xa9,0xb,0x9a,0x26,0xaa,0xf1,0x41,0x9a,0x42,0x2,0xb2,0xb2,0x6d,0x6,0x5b,0xa3,0xab,0x23,0xd5,0x48,0x32,0x92,0xe3,0x33,0x10,0x37,0xb7,0x2a,0xea,0xee,0x4a,0x2a,0x42,0xe,0x5a,0x2a,0xa2,0x51,0x37,0x40,0x85,0x48,0x96,0xb4,0x23,0xdb,0x88,0x68,0x5c,0xc4,0xcc,0x3c,0x14,0xa7,0x6f,0xa2,0x6,0xaa,0xb1,0x7c,0xd9,0x30,0xaa,0x79,0xc7,0x49,0x93,0x78,0xf7,0xd1,0xad,0x79,0x76,0x69,0x29,0x20,0xda,0x34,0x2c,0x9e,0x3d,0xff,0x7a,0x27,0x4e,0x4b,0xef,0xde,0xb4,0x4b,0x33,0x58,0xef,0xf7,0x76,0x9b,0x0,0x35,0xfe,0xd1,0x2a,0x40,0x5,0xa8,0x0,0x15,0xa0,0x2,0x54,0x80,0xa,0xf0,0x5f,0x2,0xa4,0xe4,0x13,0x78,0xd7,0x19,0xd8,0x3d,0xf8,0xda,0x4,0x60,0x81,0xc0,0x18,0x13,0xda,0x68,0x7,0x5e,0x11,0x18,0x63,0x42,0x20,0x0,0x6c,0xcd,0xad,0xb2,0x6b,0x41,0x38,0x58,0xee,0x74,0x57,0xdb,0x93,0x20,0x36,0x82,0x4e,0x77,0xb5,0x1d,0x84,0x83,0x65,0x60,0xd,0x30,0xc9,0xe6,0x3a,0x3,0x9c,0x6b,0x35,0x67,0x1f,0x37,0xea,0xd3,0x67,0x3c,0xcf,0x2b,0x15,0xd7,0x18,0x63,0x83,0x70,0xf0,0xbe,0xbf,0xd1,0xbb,0xe,0xbc,0x5,0xd6,0x25,0xb3,0xc2,0xb5,0x80,0x63,0xc0,0x21,0xa0,0x3e,0x66,0xf9,0xe,0x81,0x9f,0xc0,0x37,0xb7,0x47,0x1b,0x29,0x8,0xea,0x27,0xfb,0xe0,0x98,0x2a,0xd4,0x95,0x1c,0xed,0x51,0xf8,0x51,0xfb,0xb,0x1,0xbe,0x20,0x9f,0x90,0x81,0x17,0xaa,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char graph_node_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x40, 0x8, 0x6, 0x0, 0x0, 0x0, 0x13, 0x7d, 0xf7, 0x96, 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, 0x8, 0x17, 0xd, 0x5, 0x12, 0xa1, 0x38, 0x83, 0x9b, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x2, 0x74, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0xed, 0x97, 0x3d, 0x6f, 0xd3, 0x60, 0x10, 0xc7, 0x7f, 0x17, 0x9b, 0x26, 0x25, 0x22, 0xad, 0xa, 0x8, 0xf1, 0x52, 0x75, 0x0, 0x16, 0x24, 0x90, 0x2a, 0x96, 0x7c, 0x1, 0x6, 0xc4, 0xce, 0xc4, 0x17, 0x0, 0x31, 0xb0, 0x30, 0x0, 0x23, 0x82, 0x85, 0x5, 0x9, 0x4, 0x5f, 0x80, 0x89, 0x1d, 0x31, 0xf0, 0x5, 0x58, 0x50, 0x25, 0x50, 0x59, 0x80, 0xa1, 0xe2, 0xad, 0x28, 0x34, 0x4a, 0x3, 0x25, 0x76, 0xea, 0xe7, 0x39, 0x6, 0x3f, 0x76, 0x6d, 0xc7, 0x49, 0x5f, 0xd8, 0x90, 0x6f, 0xb1, 0xf5, 0xe4, 0xb9, 0xdf, 0xdd, 0xfd, 0xef, 0x22, 0xf9, 0x84, 0x2d, 0x13, 0xa0, 0x6, 0x78, 0xee, 0x29, 0xe4, 0x4d, 0x1, 0xb, 0x18, 0xf7, 0x54, 0x32, 0x97, 0x6a, 0xc0, 0x7e, 0x60, 0xe, 0x38, 0xc, 0xb4, 0x80, 0x7d, 0x5, 0xc0, 0x26, 0xd0, 0x7, 0x3a, 0x40, 0x17, 0xf8, 0x3, 0xd8, 0x24, 0x6a, 0x13, 0x38, 0x35, 0x73, 0x60, 0xf6, 0x6a, 0xa3, 0xde, 0xb8, 0x38, 0x35, 0x55, 0x3f, 0x41, 0x89, 0xd, 0x87, 0xe1, 0x97, 0x20, 0xc, 0x5e, 0xae, 0xff, 0xea, 0x3d, 0x5, 0x3e, 0x2, 0x1b, 0xe2, 0x22, 0x2d, 0xcc, 0xcd, 0x1e, 0x7c, 0x78, 0x72, 0xe1, 0xf4, 0xa5, 0x7b, 0xb7, 0x1f, 0x7c, 0x9e, 0x6e, 0x35, 0xca, 0xfc, 0x19, 0xf4, 0x3, 0xee, 0xdc, 0xbf, 0x39, 0xff, 0x69, 0xe5, 0xc3, 0x8b, 0x6e, 0x6f, 0xed, 0x6, 0xb0, 0x22, 0x40, 0x3, 0x58, 0x3c, 0x7a, 0xe4, 0xf8, 0xab, 0x67, 0x4f, 0x9e, 0x77, 0xa3, 0xc8, 0x12, 0xd, 0xa3, 0x52, 0x80, 0x3f, 0xe5, 0xe3, 0xfb, 0x35, 0xae, 0x5c, 0xbb, 0x3c, 0xf7, 0xfd, 0xc7, 0xd7, 0xb, 0xc0, 0x92, 0xef, 0x74, 0x68, 0xfa, 0x9e, 0xdf, 0x1c, 0xfc, 0xe, 0xbb, 0x88, 0xc6, 0x47, 0xa, 0x2a, 0x59, 0x85, 0x95, 0x61, 0xb8, 0xc9, 0x30, 0x4, 0xdf, 0xf3, 0x9b, 0xae, 0x6c, 0x49, 0x0, 0x1e, 0x80, 0x51, 0x1b, 0xfb, 0xc7, 0x2, 0xc7, 0x5a, 0x3b, 0x88, 0x66, 0xcf, 0x63, 0xf3, 0x12, 0x80, 0x26, 0xbf, 0xa8, 0xb5, 0xa8, 0xa, 0x88, 0x22, 0x8, 0x8a, 0x22, 0x2a, 0x19, 0x37, 0x1d, 0xe9, 0xad, 0x9f, 0x6b, 0xb4, 0x55, 0x14, 0x5, 0x55, 0x44, 0xe2, 0x32, 0x6c, 0xe2, 0x24, 0x71, 0x18, 0x9d, 0x4, 0xb0, 0x6a, 0xd3, 0x1b, 0x2a, 0xe9, 0x4b, 0xfc, 0xae, 0xe4, 0x45, 0x19, 0x9f, 0x81, 0x2b, 0xdb, 0x15, 0xa6, 0xa2, 0x19, 0x2d, 0xec, 0x8, 0x24, 0x7, 0x30, 0xd6, 0x16, 0xf8, 0x82, 0xa8, 0xc6, 0x45, 0x68, 0x52, 0xbf, 0x4e, 0xce, 0x60, 0xeb, 0x42, 0x5c, 0xb4, 0x66, 0x9c, 0x6c, 0xc9, 0x1f, 0xa4, 0x0, 0xb0, 0x39, 0xc5, 0xc9, 0xa1, 0x28, 0x89, 0x5f, 0x14, 0xd1, 0x5a, 0x37, 0x32, 0x89, 0xf2, 0x82, 0xc6, 0x3, 0xe0, 0xda, 0xa, 0x22, 0x3a, 0xa9, 0xb, 0x9a, 0x26, 0xaa, 0xf1, 0x41, 0x9a, 0x42, 0x2, 0xb2, 0xb2, 0x6d, 0x6, 0x5b, 0xa3, 0xab, 0x23, 0xd5, 0x48, 0x32, 0x92, 0xe3, 0x33, 0x10, 0x37, 0xb7, 0x2a, 0xea, 0xee, 0x4a, 0x2a, 0x42, 0xe, 0x5a, 0x2a, 0xa2, 0x51, 0x37, 0x40, 0x85, 0x48, 0x96, 0xb4, 0x23, 0xdb, 0x88, 0x68, 0x5c, 0xc4, 0xcc, 0x3c, 0x14, 0xa7, 0x6f, 0xa2, 0x6, 0xaa, 0xb1, 0x7c, 0xd9, 0x30, 0xaa, 0x79, 0xc7, 0x49, 0x93, 0x78, 0xf7, 0xd1, 0xad, 0x79, 0x76, 0x69, 0x29, 0x20, 0xda, 0x34, 0x2c, 0x9e, 0x3d, 0xff, 0x7a, 0x27, 0x4e, 0x4b, 0xef, 0xde, 0xb4, 0x4b, 0x33, 0x58, 0xef, 0xf7, 0x76, 0x9b, 0x0, 0x35, 0xfe, 0xd1, 0x2a, 0x40, 0x5, 0xa8, 0x0, 0x15, 0xa0, 0x2, 0x54, 0x80, 0xa, 0xf0, 0x5f, 0x2, 0xa4, 0xe4, 0x13, 0x78, 0xd7, 0x19, 0xd8, 0x3d, 0xf8, 0xda, 0x4, 0x60, 0x81, 0xc0, 0x18, 0x13, 0xda, 0x68, 0x7, 0x5e, 0x11, 0x18, 0x63, 0x42, 0x20, 0x0, 0x6c, 0xcd, 0xad, 0xb2, 0x6b, 0x41, 0x38, 0x58, 0xee, 0x74, 0x57, 0xdb, 0x93, 0x20, 0x36, 0x82, 0x4e, 0x77, 0xb5, 0x1d, 0x84, 0x83, 0x65, 0x60, 0xd, 0x30, 0xc9, 0xe6, 0x3a, 0x3, 0x9c, 0x6b, 0x35, 0x67, 0x1f, 0x37, 0xea, 0xd3, 0x67, 0x3c, 0xcf, 0x2b, 0x15, 0xd7, 0x18, 0x63, 0x83, 0x70, 0xf0, 0xbe, 0xbf, 0xd1, 0xbb, 0xe, 0xbc, 0x5, 0xd6, 0x25, 0xb3, 0xc2, 0xb5, 0x80, 0x63, 0xc0, 0x21, 0xa0, 0x3e, 0x66, 0xf9, 0xe, 0x81, 0x9f, 0xc0, 0x37, 0xb7, 0x47, 0x1b, 0x29, 0x8, 0xea, 0x27, 0xfb, 0xe0, 0x98, 0x2a, 0xd4, 0x95, 0x1c, 0xed, 0x51, 0xf8, 0x51, 0xfb, 0xb, 0x1, 0xbe, 0x20, 0x9f, 0x90, 0x81, 0x17, 0xaa, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char graph_node_breakpoint_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x40,0x8,0x6,0x0,0x0,0x0,0x13,0x7d,0xf7,0x96,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,0x8,0x6,0xf,0x3b,0x1c,0xec,0x64,0x51,0x75,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x0,0x8f,0x49,0x44,0x41,0x54,0x58,0xc3,0xed,0xd7,0xbd,0x9,0xc0,0x20,0x10,0x5,0xe0,0x53,0x2c,0x5d,0x40,0x74,0x4,0xf7,0x9f,0xc4,0x11,0x22,0x2e,0x60,0x6f,0x9a,0x13,0x4e,0x21,0x41,0x50,0x48,0x91,0x77,0x95,0xf8,0xf3,0x79,0x62,0xf5,0x88,0x36,0x4b,0xf5,0x41,0x2d,0xf1,0x22,0x22,0xbf,0x78,0x2e,0x5b,0x97,0x2,0xc9,0xc3,0xc,0x2c,0x95,0xdc,0x6f,0x78,0xce,0x5b,0x97,0xd4,0x42,0x27,0xd9,0xba,0x14,0xac,0x4b,0xa1,0x96,0xd8,0x24,0x20,0x9f,0x41,0x1d,0x7b,0xba,0x59,0xb6,0xaf,0xa7,0x3d,0x7e,0x78,0xdb,0x54,0xbc,0x36,0x74,0xa7,0x77,0x7f,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x4,0xe4,0xb7,0xfc,0xc8,0x6b,0x59,0xce,0x99,0x39,0x95,0x71,0xb4,0x6b,0x4b,0x89,0xf5,0x44,0x72,0x3d,0x93,0x9d,0x3f,0xad,0x1b,0x54,0xed,0x49,0xd3,0x36,0x45,0x4f,0x1f,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char graph_node_breakpoint_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x40, 0x8, 0x6, 0x0, 0x0, 0x0, 0x13, 0x7d, 0xf7, 0x96, 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, 0x8, 0x6, 0xf, 0x3b, 0x1c, 0xec, 0x64, 0x51, 0x75, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x0, 0x8f, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0xed, 0xd7, 0xbd, 0x9, 0xc0, 0x20, 0x10, 0x5, 0xe0, 0x53, 0x2c, 0x5d, 0x40, 0x74, 0x4, 0xf7, 0x9f, 0xc4, 0x11, 0x22, 0x2e, 0x60, 0x6f, 0x9a, 0x13, 0x4e, 0x21, 0x41, 0x50, 0x48, 0x91, 0x77, 0x95, 0xf8, 0xf3, 0x79, 0x62, 0xf5, 0x88, 0x36, 0x4b, 0xf5, 0x41, 0x2d, 0xf1, 0x22, 0x22, 0xbf, 0x78, 0x2e, 0x5b, 0x97, 0x2, 0xc9, 0xc3, 0xc, 0x2c, 0x95, 0xdc, 0x6f, 0x78, 0xce, 0x5b, 0x97, 0xd4, 0x42, 0x27, 0xd9, 0xba, 0x14, 0xac, 0x4b, 0xa1, 0x96, 0xd8, 0x24, 0x20, 0x9f, 0x41, 0x1d, 0x7b, 0xba, 0x59, 0xb6, 0xaf, 0xa7, 0x3d, 0x7e, 0x78, 0xdb, 0x54, 0xbc, 0x36, 0x74, 0xa7, 0x77, 0x7f, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7e, 0x4, 0xe4, 0xb7, 0xfc, 0xc8, 0x6b, 0x59, 0xce, 0x99, 0x39, 0x95, 0x71, 0xb4, 0x6b, 0x4b, 0x89, 0xf5, 0x44, 0x72, 0x3d, 0x93, 0x9d, 0x3f, 0xad, 0x1b, 0x54, 0xed, 0x49, 0xd3, 0x36, 0x45, 0x4f, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char graph_node_close_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xc,0x0,0x0,0x0,0xc,0x8,0x6,0x0,0x0,0x0,0x56,0x75,0x5c,0xe7,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x93,0x49,0x44,0x41,0x54,0x28,0x91,0x95,0x92,0x31,0xe,0xc2,0x30,0x10,0x4,0x17,0xaa,0x3d,0x7b,0xdb,0x58,0xa4,0xa7,0xe1,0x47,0xfe,0x2c,0x3c,0x82,0x48,0x44,0x22,0x6f,0xb1,0x4d,0x15,0xc9,0x20,0x1f,0x52,0xae,0xdd,0xd9,0x2b,0xe6,0xe,0x0,0x60,0x66,0x59,0x52,0x82,0x33,0x92,0x92,0x99,0x65,0xec,0x30,0xc9,0x4a,0x72,0x19,0x95,0x24,0x25,0x92,0xb,0xc9,0x6a,0x66,0x19,0x92,0x26,0x33,0x7b,0x92,0x6c,0x24,0xd7,0x10,0xc2,0xdc,0xc1,0x5f,0x59,0x8c,0xf1,0x32,0xc,0x42,0x8,0xb3,0xb,0x3b,0xdb,0xde,0x24,0x5f,0x2e,0xdc,0x97,0x3a,0xb0,0x91,0xdc,0x7e,0xe1,0xb3,0x67,0x66,0x9f,0xd6,0xda,0x69,0x58,0x90,0x34,0x95,0x52,0xee,0x0,0x6e,0x0,0x36,0x0,0x2b,0x80,0x6b,0xad,0xf5,0xd1,0x8b,0x70,0x6d,0xb8,0xf6,0xfe,0xd9,0x18,0x96,0xe,0x1f,0xe,0x38,0xf6,0x1a,0x1f,0x9f,0xec,0x40,0x47,0x56,0x51,0x84,0x77,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char graph_node_close_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0xc, 0x8, 0x6, 0x0, 0x0, 0x0, 0x56, 0x75, 0x5c, 0xe7, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0x93, 0x49, 0x44, 0x41, 0x54, 0x28, 0x91, 0x95, 0x92, 0x31, 0xe, 0xc2, 0x30, 0x10, 0x4, 0x17, 0xaa, 0x3d, 0x7b, 0xdb, 0x58, 0xa4, 0xa7, 0xe1, 0x47, 0xfe, 0x2c, 0x3c, 0x82, 0x48, 0x44, 0x22, 0x6f, 0xb1, 0x4d, 0x15, 0xc9, 0x20, 0x1f, 0x52, 0xae, 0xdd, 0xd9, 0x2b, 0xe6, 0xe, 0x0, 0x60, 0x66, 0x59, 0x52, 0x82, 0x33, 0x92, 0x92, 0x99, 0x65, 0xec, 0x30, 0xc9, 0x4a, 0x72, 0x19, 0x95, 0x24, 0x25, 0x92, 0xb, 0xc9, 0x6a, 0x66, 0x19, 0x92, 0x26, 0x33, 0x7b, 0x92, 0x6c, 0x24, 0xd7, 0x10, 0xc2, 0xdc, 0xc1, 0x5f, 0x59, 0x8c, 0xf1, 0x32, 0xc, 0x42, 0x8, 0xb3, 0xb, 0x3b, 0xdb, 0xde, 0x24, 0x5f, 0x2e, 0xdc, 0x97, 0x3a, 0xb0, 0x91, 0xdc, 0x7e, 0xe1, 0xb3, 0x67, 0x66, 0x9f, 0xd6, 0xda, 0x69, 0x58, 0x90, 0x34, 0x95, 0x52, 0xee, 0x0, 0x6e, 0x0, 0x36, 0x0, 0x2b, 0x80, 0x6b, 0xad, 0xf5, 0xd1, 0x8b, 0x70, 0x6d, 0xb8, 0xf6, 0xfe, 0xd9, 0x18, 0x96, 0xe, 0x1f, 0xe, 0x38, 0xf6, 0x1a, 0x1f, 0x9f, 0xec, 0x40, 0x47, 0x56, 0x51, 0x84, 0x77, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char graph_node_comment_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x40,0x8,0x6,0x0,0x0,0x0,0x13,0x7d,0xf7,0x96,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,0x8,0x19,0x11,0x2a,0x1d,0xd6,0x78,0x8b,0x40,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x74,0x49,0x44,0x41,0x54,0x58,0xc3,0xed,0x97,0xbf,0x4e,0xc2,0x50,0x14,0xc6,0x7f,0x6d,0x91,0x56,0x1b,0x90,0x80,0x2c,0x44,0xc2,0xa0,0x2e,0xe,0x3e,0x3,0x89,0x93,0xf1,0x1d,0x4c,0x18,0x4d,0x1c,0x7c,0xb,0x57,0x7,0x13,0x47,0x13,0x77,0x46,0xe3,0xc4,0x4b,0x98,0x60,0x4c,0xd4,0x81,0x60,0x58,0x94,0xff,0x22,0x2d,0xd0,0xd6,0xe5,0xde,0x88,0x8,0x2,0x35,0x6e,0xf7,0x5b,0x6e,0x9a,0x9c,0xef,0x77,0xee,0x39,0x37,0x1d,0x3e,0x8d,0x2f,0x69,0x80,0xe,0x18,0xe2,0xd4,0xf8,0xae,0x0,0xf0,0x1,0x4f,0x9c,0x1,0x63,0x45,0x3a,0xb0,0x6,0x24,0x81,0x34,0x10,0x7,0x56,0x26,0x0,0x43,0xa0,0x3,0xbc,0x2,0xd,0xe0,0x3,0xf0,0x65,0x57,0x1b,0xd8,0x5e,0x8f,0x25,0x8e,0x2d,0xd3,0x3a,0x88,0x46,0xcd,0x4d,0xa6,0x68,0x30,0x70,0x5f,0x1c,0xd7,0xb9,0x6d,0x77,0x5b,0x97,0xc0,0x13,0xd0,0xd3,0x44,0xa7,0x5c,0x32,0x91,0x3a,0xdf,0xca,0xed,0x1c,0x16,0x52,0xdd,0x2a,0xbf,0xe8,0xaa,0x1e,0xcb,0x3e,0x57,0x1e,0x6f,0x1a,0xad,0xfa,0x29,0x50,0x91,0x33,0xa7,0x4d,0xd3,0xca,0xcf,0x33,0x3,0x14,0x52,0xdd,0xaa,0x69,0x5a,0x79,0x31,0xaa,0x21,0x97,0x65,0x47,0x8c,0x88,0xcd,0x82,0x12,0xb5,0x36,0xa0,0x49,0x80,0xc1,0xf2,0x32,0x24,0x20,0x90,0x4f,0x12,0x46,0x3a,0x7f,0x94,0x2,0x28,0x80,0x2,0x88,0x5f,0x7b,0xfc,0xe3,0xec,0xe1,0x3d,0x1b,0x1a,0x30,0x1a,0x7a,0x1c,0x65,0xd8,0x5f,0xc4,0x74,0x5d,0xa3,0xa4,0x5e,0x41,0x1,0x14,0x40,0x1,0x14,0x40,0x1,0x14,0x40,0x1,0xfe,0x15,0xa0,0x4d,0xc9,0x88,0x4b,0xdf,0xc0,0xf,0xe1,0xf5,0x25,0xc0,0x7,0x1c,0xcf,0xf3,0xdc,0x45,0x9d,0xa2,0xd6,0x1,0x7c,0x5d,0x44,0xd9,0xba,0xe3,0xf6,0xcb,0xc5,0xa6,0x5d,0x9a,0x67,0x2e,0x36,0xed,0x92,0xe3,0xf6,0xcb,0x40,0x1d,0xf0,0x64,0x72,0x5d,0x7,0xf6,0xe2,0x76,0xe2,0xc2,0x32,0x57,0x77,0xd,0xc3,0xd0,0x67,0x74,0xf6,0x1d,0xb7,0x7f,0xdf,0xe9,0xb5,0x4e,0x80,0x3b,0xa0,0xad,0x8d,0x45,0xb8,0x38,0x90,0x1,0x36,0x0,0x73,0x46,0xf8,0x76,0x81,0x37,0xa0,0x26,0x72,0xb4,0xa7,0x4d,0x2c,0x34,0x22,0xf3,0xe0,0x8c,0x9,0x2,0x31,0xf2,0x28,0xe4,0xe2,0x7f,0xea,0x13,0x64,0x47,0x6c,0x83,0x36,0x6d,0xd2,0x40,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char graph_node_comment_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x40, 0x8, 0x6, 0x0, 0x0, 0x0, 0x13, 0x7d, 0xf7, 0x96, 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, 0x8, 0x19, 0x11, 0x2a, 0x1d, 0xd6, 0x78, 0x8b, 0x40, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x1, 0x74, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0xed, 0x97, 0xbf, 0x4e, 0xc2, 0x50, 0x14, 0xc6, 0x7f, 0x6d, 0x91, 0x56, 0x1b, 0x90, 0x80, 0x2c, 0x44, 0xc2, 0xa0, 0x2e, 0xe, 0x3e, 0x3, 0x89, 0x93, 0xf1, 0x1d, 0x4c, 0x18, 0x4d, 0x1c, 0x7c, 0xb, 0x57, 0x7, 0x13, 0x47, 0x13, 0x77, 0x46, 0xe3, 0xc4, 0x4b, 0x98, 0x60, 0x4c, 0xd4, 0x81, 0x60, 0x58, 0x94, 0xff, 0x22, 0x2d, 0xd0, 0xd6, 0xe5, 0xde, 0x88, 0x8, 0x2, 0x35, 0x6e, 0xf7, 0x5b, 0x6e, 0x9a, 0x9c, 0xef, 0x77, 0xee, 0x39, 0x37, 0x1d, 0x3e, 0x8d, 0x2f, 0x69, 0x80, 0xe, 0x18, 0xe2, 0xd4, 0xf8, 0xae, 0x0, 0xf0, 0x1, 0x4f, 0x9c, 0x1, 0x63, 0x45, 0x3a, 0xb0, 0x6, 0x24, 0x81, 0x34, 0x10, 0x7, 0x56, 0x26, 0x0, 0x43, 0xa0, 0x3, 0xbc, 0x2, 0xd, 0xe0, 0x3, 0xf0, 0x65, 0x57, 0x1b, 0xd8, 0x5e, 0x8f, 0x25, 0x8e, 0x2d, 0xd3, 0x3a, 0x88, 0x46, 0xcd, 0x4d, 0xa6, 0x68, 0x30, 0x70, 0x5f, 0x1c, 0xd7, 0xb9, 0x6d, 0x77, 0x5b, 0x97, 0xc0, 0x13, 0xd0, 0xd3, 0x44, 0xa7, 0x5c, 0x32, 0x91, 0x3a, 0xdf, 0xca, 0xed, 0x1c, 0x16, 0x52, 0xdd, 0x2a, 0xbf, 0xe8, 0xaa, 0x1e, 0xcb, 0x3e, 0x57, 0x1e, 0x6f, 0x1a, 0xad, 0xfa, 0x29, 0x50, 0x91, 0x33, 0xa7, 0x4d, 0xd3, 0xca, 0xcf, 0x33, 0x3, 0x14, 0x52, 0xdd, 0xaa, 0x69, 0x5a, 0x79, 0x31, 0xaa, 0x21, 0x97, 0x65, 0x47, 0x8c, 0x88, 0xcd, 0x82, 0x12, 0xb5, 0x36, 0xa0, 0x49, 0x80, 0xc1, 0xf2, 0x32, 0x24, 0x20, 0x90, 0x4f, 0x12, 0x46, 0x3a, 0x7f, 0x94, 0x2, 0x28, 0x80, 0x2, 0x88, 0x5f, 0x7b, 0xfc, 0xe3, 0xec, 0xe1, 0x3d, 0x1b, 0x1a, 0x30, 0x1a, 0x7a, 0x1c, 0x65, 0xd8, 0x5f, 0xc4, 0x74, 0x5d, 0xa3, 0xa4, 0x5e, 0x41, 0x1, 0x14, 0x40, 0x1, 0x14, 0x40, 0x1, 0x14, 0x40, 0x1, 0xfe, 0x15, 0xa0, 0x4d, 0xc9, 0x88, 0x4b, 0xdf, 0xc0, 0xf, 0xe1, 0xf5, 0x25, 0xc0, 0x7, 0x1c, 0xcf, 0xf3, 0xdc, 0x45, 0x9d, 0xa2, 0xd6, 0x1, 0x7c, 0x5d, 0x44, 0xd9, 0xba, 0xe3, 0xf6, 0xcb, 0xc5, 0xa6, 0x5d, 0x9a, 0x67, 0x2e, 0x36, 0xed, 0x92, 0xe3, 0xf6, 0xcb, 0x40, 0x1d, 0xf0, 0x64, 0x72, 0x5d, 0x7, 0xf6, 0xe2, 0x76, 0xe2, 0xc2, 0x32, 0x57, 0x77, 0xd, 0xc3, 0xd0, 0x67, 0x74, 0xf6, 0x1d, 0xb7, 0x7f, 0xdf, 0xe9, 0xb5, 0x4e, 0x80, 0x3b, 0xa0, 0xad, 0x8d, 0x45, 0xb8, 0x38, 0x90, 0x1, 0x36, 0x0, 0x73, 0x46, 0xf8, 0x76, 0x81, 0x37, 0xa0, 0x26, 0x72, 0xb4, 0xa7, 0x4d, 0x2c, 0x34, 0x22, 0xf3, 0xe0, 0x8c, 0x9, 0x2, 0x31, 0xf2, 0x28, 0xe4, 0xe2, 0x7f, 0xea, 0x13, 0x64, 0x47, 0x6c, 0x83, 0x36, 0x6d, 0xd2, 0x40, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char graph_node_comment_focus_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x40,0x8,0x6,0x0,0x0,0x0,0x13,0x7d,0xf7,0x96,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0x0,0x0,0x0,0x0,0x0,0xf9,0x43,0xbb,0x7f,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,0x9,0x2,0xe,0x16,0x22,0xbe,0xef,0xc2,0xe1,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x4a,0x49,0x44,0x41,0x54,0x58,0xc3,0xed,0xd7,0xbf,0x4b,0xdb,0x41,0x1c,0xc6,0xf1,0xd7,0x37,0x51,0x4,0x3,0xa,0xa2,0x20,0xd2,0xe2,0xe2,0x64,0x41,0xdc,0xdc,0xac,0xe0,0x54,0xdc,0xb2,0xe6,0x2f,0x10,0x1a,0xf0,0x4f,0x11,0x22,0xf8,0x17,0x64,0xcd,0x26,0x9d,0x1c,0x74,0x73,0x13,0x21,0x4e,0x2e,0xa5,0xa5,0x14,0xac,0x82,0x82,0x62,0xd0,0x7c,0xd3,0xa1,0x77,0x18,0x35,0xfe,0x48,0xa4,0xdb,0x3d,0x70,0xdc,0xf2,0x79,0xde,0x77,0xf7,0x39,0x38,0xee,0xc9,0xdc,0x2b,0x43,0x1,0xc5,0x30,0x67,0x1e,0xaa,0x83,0x1c,0xed,0x30,0x77,0x74,0x15,0x15,0x30,0x8a,0x9,0x4c,0x61,0xc,0xc3,0x8f,0x0,0xb7,0xb8,0xc4,0x29,0xce,0x71,0x8d,0x3c,0xae,0x5a,0xc2,0x5c,0xa3,0x5a,0x59,0xc7,0x17,0x7c,0xd0,0x5b,0x3f,0xf1,0xad,0x5c,0xab,0x6f,0xe3,0x4,0x57,0x59,0x58,0x69,0xb6,0x51,0xad,0x6c,0x62,0xed,0x77,0xf3,0xf0,0x87,0x17,0x34,0xfd,0x69,0xf1,0x23,0x76,0xca,0xb5,0xfa,0x6,0xbe,0xc7,0x33,0x4f,0x61,0xe5,0x35,0x33,0x84,0x9a,0x95,0xe0,0x29,0xc6,0x66,0x95,0xc2,0x78,0xab,0x62,0x7d,0x16,0x1,0x45,0xfd,0xab,0x18,0x1,0x9d,0x78,0x25,0x83,0xa8,0xe0,0x9d,0x4a,0x80,0x4,0x48,0x80,0x7f,0x1a,0xea,0xf1,0xda,0xc,0xe,0x38,0xd8,0xdf,0x5b,0x7d,0x8b,0x69,0x69,0xf9,0xf3,0x6e,0xba,0x85,0x4,0x48,0x80,0x4,0x48,0x80,0x4,0x48,0x80,0x4,0xf8,0xaf,0x80,0xac,0x47,0x46,0xec,0x7b,0x7,0xf9,0x0,0xde,0x3c,0x2,0x72,0xdc,0xa0,0xd5,0x87,0xb9,0x15,0x3c,0x79,0x21,0x44,0xd9,0x33,0x34,0xbb,0x3f,0x4f,0xaf,0x7c,0xb0,0x9a,0xc1,0xd3,0x8e,0xc9,0x75,0x1c,0xb,0x8d,0x6a,0x65,0xb,0xf3,0x2f,0x34,0x37,0xc7,0x71,0xb9,0x56,0xff,0x8a,0x23,0x5c,0x64,0x5d,0x11,0x6e,0xc,0x33,0x98,0xc4,0xc8,0x33,0xe1,0xbb,0x85,0x3f,0xf8,0x15,0x72,0x74,0x3b,0x7b,0xd4,0xd0,0xa1,0x98,0x7,0x9f,0xd9,0x41,0x27,0x1c,0xf9,0x6e,0xc0,0xc6,0x3f,0xd5,0x5f,0x9d,0x54,0x4e,0x15,0xfd,0xeb,0xb4,0x4f,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char graph_node_comment_focus_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x40, 0x8, 0x6, 0x0, 0x0, 0x0, 0x13, 0x7d, 0xf7, 0x96, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf9, 0x43, 0xbb, 0x7f, 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, 0x9, 0x2, 0xe, 0x16, 0x22, 0xbe, 0xef, 0xc2, 0xe1, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x1, 0x4a, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0xed, 0xd7, 0xbf, 0x4b, 0xdb, 0x41, 0x1c, 0xc6, 0xf1, 0xd7, 0x37, 0x51, 0x4, 0x3, 0xa, 0xa2, 0x20, 0xd2, 0xe2, 0xe2, 0x64, 0x41, 0xdc, 0xdc, 0xac, 0xe0, 0x54, 0xdc, 0xb2, 0xe6, 0x2f, 0x10, 0x1a, 0xf0, 0x4f, 0x11, 0x22, 0xf8, 0x17, 0x64, 0xcd, 0x26, 0x9d, 0x1c, 0x74, 0x73, 0x13, 0x21, 0x4e, 0x2e, 0xa5, 0xa5, 0x14, 0xac, 0x82, 0x82, 0x62, 0xd0, 0x7c, 0xd3, 0xa1, 0x77, 0x18, 0x35, 0xfe, 0x48, 0xa4, 0xdb, 0x3d, 0x70, 0xdc, 0xf2, 0x79, 0xde, 0x77, 0xf7, 0x39, 0x38, 0xee, 0xc9, 0xdc, 0x2b, 0x43, 0x1, 0xc5, 0x30, 0x67, 0x1e, 0xaa, 0x83, 0x1c, 0xed, 0x30, 0x77, 0x74, 0x15, 0x15, 0x30, 0x8a, 0x9, 0x4c, 0x61, 0xc, 0xc3, 0x8f, 0x0, 0xb7, 0xb8, 0xc4, 0x29, 0xce, 0x71, 0x8d, 0x3c, 0xae, 0x5a, 0xc2, 0x5c, 0xa3, 0x5a, 0x59, 0xc7, 0x17, 0x7c, 0xd0, 0x5b, 0x3f, 0xf1, 0xad, 0x5c, 0xab, 0x6f, 0xe3, 0x4, 0x57, 0x59, 0x58, 0x69, 0xb6, 0x51, 0xad, 0x6c, 0x62, 0xed, 0x77, 0xf3, 0xf0, 0x87, 0x17, 0x34, 0xfd, 0x69, 0xf1, 0x23, 0x76, 0xca, 0xb5, 0xfa, 0x6, 0xbe, 0xc7, 0x33, 0x4f, 0x61, 0xe5, 0x35, 0x33, 0x84, 0x9a, 0x95, 0xe0, 0x29, 0xc6, 0x66, 0x95, 0xc2, 0x78, 0xab, 0x62, 0x7d, 0x16, 0x1, 0x45, 0xfd, 0xab, 0x18, 0x1, 0x9d, 0x78, 0x25, 0x83, 0xa8, 0xe0, 0x9d, 0x4a, 0x80, 0x4, 0x48, 0x80, 0x7f, 0x1a, 0xea, 0xf1, 0xda, 0xc, 0xe, 0x38, 0xd8, 0xdf, 0x5b, 0x7d, 0x8b, 0x69, 0x69, 0xf9, 0xf3, 0x6e, 0xba, 0x85, 0x4, 0x48, 0x80, 0x4, 0x48, 0x80, 0x4, 0x48, 0x80, 0x4, 0xf8, 0xaf, 0x80, 0xac, 0x47, 0x46, 0xec, 0x7b, 0x7, 0xf9, 0x0, 0xde, 0x3c, 0x2, 0x72, 0xdc, 0xa0, 0xd5, 0x87, 0xb9, 0x15, 0x3c, 0x79, 0x21, 0x44, 0xd9, 0x33, 0x34, 0xbb, 0x3f, 0x4f, 0xaf, 0x7c, 0xb0, 0x9a, 0xc1, 0xd3, 0x8e, 0xc9, 0x75, 0x1c, 0xb, 0x8d, 0x6a, 0x65, 0xb, 0xf3, 0x2f, 0x34, 0x37, 0xc7, 0x71, 0xb9, 0x56, 0xff, 0x8a, 0x23, 0x5c, 0x64, 0x5d, 0x11, 0x6e, 0xc, 0x33, 0x98, 0xc4, 0xc8, 0x33, 0xe1, 0xbb, 0x85, 0x3f, 0xf8, 0x15, 0x72, 0x74, 0x3b, 0x7b, 0xd4, 0xd0, 0xa1, 0x98, 0x7, 0x9f, 0xd9, 0x41, 0x27, 0x1c, 0xf9, 0x6e, 0xc0, 0xc6, 0x3f, 0xd5, 0x5f, 0x9d, 0x54, 0x4e, 0x15, 0xfd, 0xeb, 0xb4, 0x4f, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char graph_node_default_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,0x39,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,0x16,0x12,0x19,0xe,0xb,0x10,0xe,0xb,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x16,0x12,0x19,0x0,0x0,0x0,0x19,0x15,0x1c,0x24,0x1e,0x27,0x16,0x12,0x19,0xff,0xff,0xff,0x2b,0x4d,0xfd,0x66,0x0,0x0,0x0,0xf,0x74,0x52,0x4e,0x53,0x0,0x46,0x47,0x3f,0x2b,0x11,0x3,0xfd,0xd3,0xcd,0x2a,0x73,0x45,0xf8,0x3d,0x3f,0x57,0xda,0x84,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x12,0x7b,0xbc,0x6c,0x0,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x38,0x49,0x44,0x41,0x54,0x18,0xd3,0x63,0x60,0x64,0x2,0x2,0x46,0x8,0xc9,0xcc,0xc2,0xca,0xc6,0xc0,0x8f,0x4,0xd8,0x39,0x98,0x59,0x19,0x50,0x80,0x0,0x27,0x17,0xaa,0x0,0x83,0x20,0x37,0x9a,0x0,0x3f,0xd3,0xc0,0x8,0xf0,0xa0,0x9,0xf0,0xf2,0x61,0x3a,0x1d,0xc3,0x73,0xe8,0xde,0x7,0x0,0x89,0x4d,0x2,0xf2,0x16,0xd3,0x74,0x45,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 graph_node_default_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, 0x39, 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, 0x16, 0x12, 0x19, 0xe, 0xb, 0x10, 0xe, 0xb, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x16, 0x12, 0x19, 0x0, 0x0, 0x0, 0x19, 0x15, 0x1c, 0x24, 0x1e, 0x27, 0x16, 0x12, 0x19, 0xff, 0xff, 0xff, 0x2b, 0x4d, 0xfd, 0x66, 0x0, 0x0, 0x0, 0xf, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x46, 0x47, 0x3f, 0x2b, 0x11, 0x3, 0xfd, 0xd3, 0xcd, 0x2a, 0x73, 0x45, 0xf8, 0x3d, 0x3f, 0x57, 0xda, 0x84, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x12, 0x7b, 0xbc, 0x6c, 0x0, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x38, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x63, 0x60, 0x64, 0x2, 0x2, 0x46, 0x8, 0xc9, 0xcc, 0xc2, 0xca, 0xc6, 0xc0, 0x8f, 0x4, 0xd8, 0x39, 0x98, 0x59, 0x19, 0x50, 0x80, 0x0, 0x27, 0x17, 0xaa, 0x0, 0x83, 0x20, 0x37, 0x9a, 0x0, 0x3f, 0xd3, 0xc0, 0x8, 0xf0, 0xa0, 0x9, 0xf0, 0xf2, 0x61, 0x3a, 0x1d, 0xc3, 0x73, 0xe8, 0xde, 0x7, 0x0, 0x89, 0x4d, 0x2, 0xf2, 0x16, 0xd3, 0x74, 0x45, 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 graph_node_default_focus_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,0x4,0x0,0x0,0x0,0xb5,0xfa,0x37,0xea,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,0x2,0x62,0x4b,0x47,0x44,0x0,0xff,0x87,0x8f,0xcc,0xbf,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,0xb7,0x49,0x44,0x41,0x54,0x28,0xcf,0x9d,0x91,0x3d,0x6a,0x42,0x61,0x10,0x45,0xcf,0x8c,0x4f,0x22,0x7c,0x58,0x84,0x14,0x2e,0xc0,0xf5,0x64,0x17,0xba,0x3,0x2d,0x4,0x41,0x17,0x96,0x2a,0x65,0x5c,0x43,0x7a,0xb,0x53,0xfa,0xc3,0x63,0x9c,0x6b,0xf1,0x4,0xf9,0x24,0x31,0x21,0xb7,0x1b,0xe6,0x14,0x33,0xe7,0x1a,0x80,0xc,0xc7,0x1,0xa7,0x4b,0x2,0x49,0x9a,0xc0,0x34,0xc2,0xbb,0x11,0xae,0x58,0x92,0x4,0x2d,0x2d,0x61,0xb2,0x99,0xf8,0x26,0xfd,0xaf,0xe1,0xdb,0x62,0xca,0x89,0x40,0x88,0x35,0x13,0xb6,0x15,0xb0,0x7d,0x99,0x68,0xfd,0xae,0xa2,0x1e,0x42,0xcc,0x9,0x4a,0x5,0x94,0x71,0xd8,0xfc,0xa8,0x67,0xf5,0x1d,0x40,0x34,0xec,0x2b,0x60,0xff,0xd9,0x48,0x3,0x1a,0xdc,0x79,0x14,0xbf,0x3d,0xf6,0x4f,0x80,0xdf,0x80,0xfc,0x2b,0x60,0x77,0x16,0x3a,0x13,0x76,0x24,0x48,0x7,0x28,0x2c,0x89,0x6a,0x1d,0xc3,0xe5,0xae,0x7c,0xd0,0x92,0x3f,0xa8,0xb6,0x53,0xd9,0xac,0x5e,0x39,0x10,0x8f,0xcb,0x4a,0x3b,0x5b,0x67,0x12,0x80,0xa7,0xea,0xbc,0x6b,0xdd,0x17,0xbe,0x3f,0x4f,0x23,0x27,0x82,0x63,0x73,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 graph_node_default_focus_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, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 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, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 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, 0xb7, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x9d, 0x91, 0x3d, 0x6a, 0x42, 0x61, 0x10, 0x45, 0xcf, 0x8c, 0x4f, 0x22, 0x7c, 0x58, 0x84, 0x14, 0x2e, 0xc0, 0xf5, 0x64, 0x17, 0xba, 0x3, 0x2d, 0x4, 0x41, 0x17, 0x96, 0x2a, 0x65, 0x5c, 0x43, 0x7a, 0xb, 0x53, 0xfa, 0xc3, 0x63, 0x9c, 0x6b, 0xf1, 0x4, 0xf9, 0x24, 0x31, 0x21, 0xb7, 0x1b, 0xe6, 0x14, 0x33, 0xe7, 0x1a, 0x80, 0xc, 0xc7, 0x1, 0xa7, 0x4b, 0x2, 0x49, 0x9a, 0xc0, 0x34, 0xc2, 0xbb, 0x11, 0xae, 0x58, 0x92, 0x4, 0x2d, 0x2d, 0x61, 0xb2, 0x99, 0xf8, 0x26, 0xfd, 0xaf, 0xe1, 0xdb, 0x62, 0xca, 0x89, 0x40, 0x88, 0x35, 0x13, 0xb6, 0x15, 0xb0, 0x7d, 0x99, 0x68, 0xfd, 0xae, 0xa2, 0x1e, 0x42, 0xcc, 0x9, 0x4a, 0x5, 0x94, 0x71, 0xd8, 0xfc, 0xa8, 0x67, 0xf5, 0x1d, 0x40, 0x34, 0xec, 0x2b, 0x60, 0xff, 0xd9, 0x48, 0x3, 0x1a, 0xdc, 0x79, 0x14, 0xbf, 0x3d, 0xf6, 0x4f, 0x80, 0xdf, 0x80, 0xfc, 0x2b, 0x60, 0x77, 0x16, 0x3a, 0x13, 0x76, 0x24, 0x48, 0x7, 0x28, 0x2c, 0x89, 0x6a, 0x1d, 0xc3, 0xe5, 0xae, 0x7c, 0xd0, 0x92, 0x3f, 0xa8, 0xb6, 0x53, 0xd9, 0xac, 0x5e, 0x39, 0x10, 0x8f, 0xcb, 0x4a, 0x3b, 0x5b, 0x67, 0x12, 0x80, 0xa7, 0xea, 0xbc, 0x6b, 0xdd, 0x17, 0xbe, 0x3f, 0x4f, 0x23, 0x27, 0x82, 0x63, 0x73, 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 graph_node_position_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x40,0x8,0x6,0x0,0x0,0x0,0x13,0x7d,0xf7,0x96,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,0x8,0x6,0xf,0x3b,0x3b,0x49,0x6e,0xe4,0x1e,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x0,0x90,0x49,0x44,0x41,0x54,0x58,0xc3,0xed,0xd7,0xbd,0x9,0xc0,0x20,0x10,0x5,0xe0,0x53,0x2c,0xdd,0x40,0x47,0x70,0x7,0x67,0x77,0x7,0x47,0x88,0x1b,0xd8,0x9b,0xe6,0x84,0x53,0x48,0x10,0x14,0x52,0xe4,0x5d,0x25,0xfe,0x7c,0x9e,0x58,0x3d,0xa2,0xcd,0x52,0x7d,0x50,0x63,0xb8,0x88,0xc8,0x2d,0x9e,0x2b,0x36,0x65,0x4f,0xf2,0x30,0x3,0x4b,0x25,0xf7,0x1b,0x9e,0x73,0x36,0x65,0xb5,0xd0,0x49,0xb1,0x29,0x7b,0x9b,0xb2,0xaf,0x31,0x34,0x9,0xc8,0x67,0x50,0xc7,0x9e,0x6e,0x96,0xed,0xeb,0x69,0x8f,0x1b,0xde,0x36,0x15,0xaf,0xd,0xdd,0xe9,0xdd,0x5f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x1f,0x1,0xe5,0x2d,0x3f,0xf2,0x5a,0x91,0x73,0x66,0x4e,0x65,0x1c,0xed,0xda,0x52,0x62,0x3d,0x91,0x5c,0xcf,0x64,0xe7,0x4f,0xeb,0x6,0x80,0xff,0x44,0x93,0xd4,0xd9,0xea,0x7e,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char graph_node_position_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x40, 0x8, 0x6, 0x0, 0x0, 0x0, 0x13, 0x7d, 0xf7, 0x96, 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, 0x8, 0x6, 0xf, 0x3b, 0x3b, 0x49, 0x6e, 0xe4, 0x1e, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x0, 0x90, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0xed, 0xd7, 0xbd, 0x9, 0xc0, 0x20, 0x10, 0x5, 0xe0, 0x53, 0x2c, 0xdd, 0x40, 0x47, 0x70, 0x7, 0x67, 0x77, 0x7, 0x47, 0x88, 0x1b, 0xd8, 0x9b, 0xe6, 0x84, 0x53, 0x48, 0x10, 0x14, 0x52, 0xe4, 0x5d, 0x25, 0xfe, 0x7c, 0x9e, 0x58, 0x3d, 0xa2, 0xcd, 0x52, 0x7d, 0x50, 0x63, 0xb8, 0x88, 0xc8, 0x2d, 0x9e, 0x2b, 0x36, 0x65, 0x4f, 0xf2, 0x30, 0x3, 0x4b, 0x25, 0xf7, 0x1b, 0x9e, 0x73, 0x36, 0x65, 0xb5, 0xd0, 0x49, 0xb1, 0x29, 0x7b, 0x9b, 0xb2, 0xaf, 0x31, 0x34, 0x9, 0xc8, 0x67, 0x50, 0xc7, 0x9e, 0x6e, 0x96, 0xed, 0xeb, 0x69, 0x8f, 0x1b, 0xde, 0x36, 0x15, 0xaf, 0xd, 0xdd, 0xe9, 0xdd, 0x5f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x1f, 0x1, 0xe5, 0x2d, 0x3f, 0xf2, 0x5a, 0x91, 0x73, 0x66, 0x4e, 0x65, 0x1c, 0xed, 0xda, 0x52, 0x62, 0x3d, 0x91, 0x5c, 0xcf, 0x64, 0xe7, 0x4f, 0xeb, 0x6, 0x80, 0xff, 0x44, 0x93, 0xd4, 0xd9, 0xea, 0x7e, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char graph_node_selected_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x40,0x8,0x6,0x0,0x0,0x0,0x13,0x7d,0xf7,0x96,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,0x8,0x17,0xd,0x4,0x3b,0xfa,0x91,0x2a,0xb6,0x0,0x0,0x3,0x44,0x49,0x44,0x41,0x54,0x58,0xc3,0xed,0x97,0x3f,0x68,0xdc,0x76,0x14,0xc7,0xbf,0xef,0xa7,0x9f,0x7e,0x3a,0xdd,0x39,0xf6,0xdd,0x95,0xb3,0x3,0xc1,0x75,0x1b,0x70,0xa,0xe9,0x98,0x25,0x93,0x87,0x52,0x3a,0x4,0x2,0xce,0xe0,0xd2,0x34,0x35,0x94,0x8e,0x1d,0xbc,0xd5,0x4b,0xc7,0x2e,0x25,0x63,0x2,0x5d,0xa,0xa5,0xb1,0x1b,0x2,0xf5,0xd0,0x40,0xa0,0x90,0x10,0x3a,0x64,0xca,0x92,0x31,0x81,0x24,0xd0,0xd2,0x9a,0x40,0x2f,0x17,0xdf,0x1f,0xfb,0x74,0xf2,0xe9,0x27,0xfd,0x5e,0x7,0x49,0xb6,0x4e,0xe7,0xea,0x86,0x6e,0xe5,0x1e,0xdc,0x49,0x42,0xef,0x7d,0xde,0xf7,0x7d,0xf5,0x13,0xe8,0x47,0xcc,0x4c,0x0,0xc4,0xbd,0x7b,0x4f,0x9c,0xb0,0xdd,0x71,0xdb,0xfb,0x2d,0xc7,0xb0,0x11,0x5a,0x7,0x84,0x4c,0xd8,0xb6,0x62,0x41,0xc2,0xd4,0x67,0x1b,0x43,0x59,0xaf,0xf9,0x97,0x2f,0x5f,0x18,0x2,0x30,0xc4,0xcc,0xd6,0xdd,0x1f,0xef,0x9e,0xea,0x79,0x83,0x33,0xed,0x6e,0xf7,0x6c,0xaf,0xd7,0x59,0xe8,0x7b,0xfd,0x72,0x10,0x4,0x32,0xb,0x50,0x4a,0x85,0x33,0x95,0x99,0xc1,0xdc,0x5c,0xad,0x59,0xaf,0x56,0x7f,0x9f,0xab,0x94,0x5f,0xad,0x7e,0xbe,0x7a,0x40,0x5b,0x5b,0xf7,0x2b,0x41,0xbb,0xf9,0x6e,0xa7,0xd7,0x5e,0xb9,0x72,0x75,0xe5,0x86,0x72,0xa4,0x85,0x82,0x8,0x86,0x61,0xf4,0xcb,0x9d,0x47,0x1b,0xb5,0xb9,0xfa,0x23,0x55,0x5f,0xf8,0x43,0xea,0x4e,0xb7,0xdc,0x7c,0xf3,0xfa,0xdc,0xc7,0xeb,0x1f,0xdc,0x64,0x66,0x71,0xb8,0x37,0xbb,0x2b,0x1d,0xb,0x44,0x23,0x13,0x80,0x99,0x11,0xe,0x23,0x50,0x65,0x6f,0x71,0xf5,0x93,0x95,0x9b,0x3f,0x6f,0xff,0xb6,0x76,0x9a,0x9c,0xa6,0x8,0x42,0x5f,0x79,0xfd,0x83,0x79,0xa7,0x24,0x5,0xfc,0xfa,0x2e,0x9,0x42,0xa8,0xd,0xc2,0x20,0x1a,0xfd,0x69,0x3,0x12,0x4,0xf8,0xf5,0x5d,0xa7,0x24,0x85,0xd7,0x3f,0x98,0xf,0x42,0x5f,0x9,0xc3,0x46,0xc,0xfc,0x81,0xb,0x0,0x91,0x66,0x30,0x1b,0x10,0x0,0x98,0x6c,0x7b,0x80,0xc0,0x60,0x66,0x44,0x21,0x3,0x0,0x6,0xfe,0xc0,0x35,0x6c,0x84,0xd0,0x5a,0x53,0x84,0x88,0x0,0x80,0x13,0xd9,0xcc,0xc,0x88,0xb8,0x10,0x0,0x40,0x0,0x1b,0x0,0xcc,0x0,0xc7,0x39,0x11,0x22,0xd2,0x5a,0x93,0xb4,0x6d,0x9b,0x11,0x25,0x89,0x86,0xc1,0x20,0x80,0x18,0xa0,0xe3,0xee,0x47,0xd0,0xcc,0x31,0xad,0x91,0x79,0xa3,0x40,0x4,0x80,0x91,0xe6,0xe5,0x83,0x73,0x37,0x64,0xee,0x2e,0xd8,0x24,0x9,0xc4,0xc7,0xa,0xb2,0x6a,0x8a,0x0,0x1c,0xf7,0xce,0x5e,0xc4,0xc5,0xe6,0x18,0x92,0x57,0x36,0x2,0x30,0x26,0x33,0x7b,0xe2,0x1e,0x71,0xe2,0xb,0x33,0x68,0xf2,0x8,0xd9,0x16,0x94,0xd1,0x13,0xff,0x9b,0x49,0xa,0xc0,0x6,0x6c,0x72,0xf6,0x8f,0xbb,0x58,0xe0,0x41,0x32,0x77,0x22,0x1a,0xc9,0xf2,0x49,0x87,0x89,0xcf,0x8a,0x14,0xc4,0x0,0x93,0x14,0x66,0xba,0xd1,0xf1,0xec,0xa6,0x18,0x60,0xe2,0xfa,0x91,0xde,0xd9,0xae,0x34,0xf9,0x31,0x52,0xba,0x1e,0x28,0x5d,0x4c,0x94,0xfa,0x99,0xbc,0xf,0x45,0xa,0x4c,0x5c,0x38,0xd6,0xc9,0xe0,0xe8,0x89,0xe4,0xad,0x1d,0x5f,0xca,0x9c,0x7f,0x15,0x8b,0x63,0xdc,0xc4,0x7c,0x8f,0x8c,0x91,0xb9,0x93,0x71,0xc0,0xd7,0xdf,0x7c,0xf5,0xea,0xd9,0x8b,0xa7,0x85,0x1d,0xcf,0x9f,0x7b,0x1f,0xdf,0xdf,0xfa,0x76,0xf1,0x44,0xc0,0xd9,0xa5,0x65,0x58,0xc2,0x2e,0x4,0x2c,0x2d,0xbe,0xf3,0xef,0xa,0x3c,0xaf,0x8f,0xde,0x7e,0xb7,0x10,0xe0,0x79,0xfd,0x91,0x6b,0x81,0xff,0x18,0x53,0xc0,0x14,0x30,0x5,0x4c,0x1,0x53,0xc0,0x14,0x30,0x5,0xfc,0xff,0x0,0x5a,0x6b,0x82,0x75,0xe2,0xe7,0xcf,0xc9,0x91,0xe6,0x58,0x19,0x5,0x16,0x2c,0x6,0x0,0x5b,0xca,0x89,0xf5,0x69,0x4e,0x5a,0x23,0x1c,0xe5,0x44,0x8e,0x52,0x1,0x0,0x94,0xdd,0x99,0x89,0x80,0x34,0xc7,0x51,0x2a,0x70,0x94,0x13,0x49,0x25,0xdd,0xa0,0xe4,0x96,0x5b,0xc3,0x43,0xcd,0x1b,0x9b,0x9f,0x5e,0xbc,0x71,0x9d,0x1e,0xf,0xfc,0x3,0xe8,0x30,0x1c,0xd9,0x74,0xd9,0x52,0xa2,0xec,0x9e,0xc2,0xc6,0xe6,0xd5,0x8b,0xc3,0x43,0xcd,0x25,0xb7,0xdc,0x52,0xd2,0xd,0x68,0x6b,0xeb,0x7e,0x65,0xef,0xaf,0x97,0xcb,0xdd,0xfd,0xce,0x87,0x9f,0x7d,0x71,0xe9,0xba,0xe3,0xda,0x85,0x4e,0xc,0x7d,0xcd,0x3f,0xfd,0xf0,0xeb,0x66,0x75,0xb6,0xf6,0xf0,0xad,0xb7,0x97,0x5f,0x12,0x33,0x5b,0xb7,0xbf,0xbb,0x3d,0xdb,0xea,0x74,0x97,0x3a,0xdd,0xee,0x7b,0x3,0xdf,0x9b,0xd7,0x5a,0xdb,0xc6,0x8c,0x7e,0xad,0xa,0x21,0x60,0xdb,0xb6,0x2e,0xbb,0x95,0xd7,0xb5,0x6a,0xf5,0x79,0xa3,0x56,0xfd,0xf3,0xda,0x97,0xd7,0xf6,0x29,0xdd,0xbd,0x6f,0x6f,0x3f,0x28,0xf5,0xff,0x6e,0x56,0xb4,0x19,0x2a,0x66,0x73,0xe2,0xe3,0x25,0x12,0xc6,0x16,0x4e,0x30,0x73,0x7a,0xc1,0x5b,0x5f,0xff,0xe8,0x10,0xc0,0xd1,0xf6,0x4,0xcc,0x4c,0x3b,0x3b,0x3b,0xa2,0xd1,0x68,0x14,0x8e,0xd0,0x6a,0xb5,0x78,0x6d,0x6d,0xcd,0x10,0xc5,0xdb,0xba,0x7f,0x0,0xb2,0x1f,0xaf,0x82,0x62,0x7a,0x69,0xbb,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char graph_node_selected_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x40, 0x8, 0x6, 0x0, 0x0, 0x0, 0x13, 0x7d, 0xf7, 0x96, 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, 0x8, 0x17, 0xd, 0x4, 0x3b, 0xfa, 0x91, 0x2a, 0xb6, 0x0, 0x0, 0x3, 0x44, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0xed, 0x97, 0x3f, 0x68, 0xdc, 0x76, 0x14, 0xc7, 0xbf, 0xef, 0xa7, 0x9f, 0x7e, 0x3a, 0xdd, 0x39, 0xf6, 0xdd, 0x95, 0xb3, 0x3, 0xc1, 0x75, 0x1b, 0x70, 0xa, 0xe9, 0x98, 0x25, 0x93, 0x87, 0x52, 0x3a, 0x4, 0x2, 0xce, 0xe0, 0xd2, 0x34, 0x35, 0x94, 0x8e, 0x1d, 0xbc, 0xd5, 0x4b, 0xc7, 0x2e, 0x25, 0x63, 0x2, 0x5d, 0xa, 0xa5, 0xb1, 0x1b, 0x2, 0xf5, 0xd0, 0x40, 0xa0, 0x90, 0x10, 0x3a, 0x64, 0xca, 0x92, 0x31, 0x81, 0x24, 0xd0, 0xd2, 0x9a, 0x40, 0x2f, 0x17, 0xdf, 0x1f, 0xfb, 0x74, 0xf2, 0xe9, 0x27, 0xfd, 0x5e, 0x7, 0x49, 0xb6, 0x4e, 0xe7, 0xea, 0x86, 0x6e, 0xe5, 0x1e, 0xdc, 0x49, 0x42, 0xef, 0x7d, 0xde, 0xf7, 0x7d, 0xf5, 0x13, 0xe8, 0x47, 0xcc, 0x4c, 0x0, 0xc4, 0xbd, 0x7b, 0x4f, 0x9c, 0xb0, 0xdd, 0x71, 0xdb, 0xfb, 0x2d, 0xc7, 0xb0, 0x11, 0x5a, 0x7, 0x84, 0x4c, 0xd8, 0xb6, 0x62, 0x41, 0xc2, 0xd4, 0x67, 0x1b, 0x43, 0x59, 0xaf, 0xf9, 0x97, 0x2f, 0x5f, 0x18, 0x2, 0x30, 0xc4, 0xcc, 0xd6, 0xdd, 0x1f, 0xef, 0x9e, 0xea, 0x79, 0x83, 0x33, 0xed, 0x6e, 0xf7, 0x6c, 0xaf, 0xd7, 0x59, 0xe8, 0x7b, 0xfd, 0x72, 0x10, 0x4, 0x32, 0xb, 0x50, 0x4a, 0x85, 0x33, 0x95, 0x99, 0xc1, 0xdc, 0x5c, 0xad, 0x59, 0xaf, 0x56, 0x7f, 0x9f, 0xab, 0x94, 0x5f, 0xad, 0x7e, 0xbe, 0x7a, 0x40, 0x5b, 0x5b, 0xf7, 0x2b, 0x41, 0xbb, 0xf9, 0x6e, 0xa7, 0xd7, 0x5e, 0xb9, 0x72, 0x75, 0xe5, 0x86, 0x72, 0xa4, 0x85, 0x82, 0x8, 0x86, 0x61, 0xf4, 0xcb, 0x9d, 0x47, 0x1b, 0xb5, 0xb9, 0xfa, 0x23, 0x55, 0x5f, 0xf8, 0x43, 0xea, 0x4e, 0xb7, 0xdc, 0x7c, 0xf3, 0xfa, 0xdc, 0xc7, 0xeb, 0x1f, 0xdc, 0x64, 0x66, 0x71, 0xb8, 0x37, 0xbb, 0x2b, 0x1d, 0xb, 0x44, 0x23, 0x13, 0x80, 0x99, 0x11, 0xe, 0x23, 0x50, 0x65, 0x6f, 0x71, 0xf5, 0x93, 0x95, 0x9b, 0x3f, 0x6f, 0xff, 0xb6, 0x76, 0x9a, 0x9c, 0xa6, 0x8, 0x42, 0x5f, 0x79, 0xfd, 0x83, 0x79, 0xa7, 0x24, 0x5, 0xfc, 0xfa, 0x2e, 0x9, 0x42, 0xa8, 0xd, 0xc2, 0x20, 0x1a, 0xfd, 0x69, 0x3, 0x12, 0x4, 0xf8, 0xf5, 0x5d, 0xa7, 0x24, 0x85, 0xd7, 0x3f, 0x98, 0xf, 0x42, 0x5f, 0x9, 0xc3, 0x46, 0xc, 0xfc, 0x81, 0xb, 0x0, 0x91, 0x66, 0x30, 0x1b, 0x10, 0x0, 0x98, 0x6c, 0x7b, 0x80, 0xc0, 0x60, 0x66, 0x44, 0x21, 0x3, 0x0, 0x6, 0xfe, 0xc0, 0x35, 0x6c, 0x84, 0xd0, 0x5a, 0x53, 0x84, 0x88, 0x0, 0x80, 0x13, 0xd9, 0xcc, 0xc, 0x88, 0xb8, 0x10, 0x0, 0x40, 0x0, 0x1b, 0x0, 0xcc, 0x0, 0xc7, 0x39, 0x11, 0x22, 0xd2, 0x5a, 0x93, 0xb4, 0x6d, 0x9b, 0x11, 0x25, 0x89, 0x86, 0xc1, 0x20, 0x80, 0x18, 0xa0, 0xe3, 0xee, 0x47, 0xd0, 0xcc, 0x31, 0xad, 0x91, 0x79, 0xa3, 0x40, 0x4, 0x80, 0x91, 0xe6, 0xe5, 0x83, 0x73, 0x37, 0x64, 0xee, 0x2e, 0xd8, 0x24, 0x9, 0xc4, 0xc7, 0xa, 0xb2, 0x6a, 0x8a, 0x0, 0x1c, 0xf7, 0xce, 0x5e, 0xc4, 0xc5, 0xe6, 0x18, 0x92, 0x57, 0x36, 0x2, 0x30, 0x26, 0x33, 0x7b, 0xe2, 0x1e, 0x71, 0xe2, 0xb, 0x33, 0x68, 0xf2, 0x8, 0xd9, 0x16, 0x94, 0xd1, 0x13, 0xff, 0x9b, 0x49, 0xa, 0xc0, 0x6, 0x6c, 0x72, 0xf6, 0x8f, 0xbb, 0x58, 0xe0, 0x41, 0x32, 0x77, 0x22, 0x1a, 0xc9, 0xf2, 0x49, 0x87, 0x89, 0xcf, 0x8a, 0x14, 0xc4, 0x0, 0x93, 0x14, 0x66, 0xba, 0xd1, 0xf1, 0xec, 0xa6, 0x18, 0x60, 0xe2, 0xfa, 0x91, 0xde, 0xd9, 0xae, 0x34, 0xf9, 0x31, 0x52, 0xba, 0x1e, 0x28, 0x5d, 0x4c, 0x94, 0xfa, 0x99, 0xbc, 0xf, 0x45, 0xa, 0x4c, 0x5c, 0x38, 0xd6, 0xc9, 0xe0, 0xe8, 0x89, 0xe4, 0xad, 0x1d, 0x5f, 0xca, 0x9c, 0x7f, 0x15, 0x8b, 0x63, 0xdc, 0xc4, 0x7c, 0x8f, 0x8c, 0x91, 0xb9, 0x93, 0x71, 0xc0, 0xd7, 0xdf, 0x7c, 0xf5, 0xea, 0xd9, 0x8b, 0xa7, 0x85, 0x1d, 0xcf, 0x9f, 0x7b, 0x1f, 0xdf, 0xdf, 0xfa, 0x76, 0xf1, 0x44, 0xc0, 0xd9, 0xa5, 0x65, 0x58, 0xc2, 0x2e, 0x4, 0x2c, 0x2d, 0xbe, 0xf3, 0xef, 0xa, 0x3c, 0xaf, 0x8f, 0xde, 0x7e, 0xb7, 0x10, 0xe0, 0x79, 0xfd, 0x91, 0x6b, 0x81, 0xff, 0x18, 0x53, 0xc0, 0x14, 0x30, 0x5, 0x4c, 0x1, 0x53, 0xc0, 0x14, 0x30, 0x5, 0xfc, 0xff, 0x0, 0x5a, 0x6b, 0x82, 0x75, 0xe2, 0xe7, 0xcf, 0xc9, 0x91, 0xe6, 0x58, 0x19, 0x5, 0x16, 0x2c, 0x6, 0x0, 0x5b, 0xca, 0x89, 0xf5, 0x69, 0x4e, 0x5a, 0x23, 0x1c, 0xe5, 0x44, 0x8e, 0x52, 0x1, 0x0, 0x94, 0xdd, 0x99, 0x89, 0x80, 0x34, 0xc7, 0x51, 0x2a, 0x70, 0x94, 0x13, 0x49, 0x25, 0xdd, 0xa0, 0xe4, 0x96, 0x5b, 0xc3, 0x43, 0xcd, 0x1b, 0x9b, 0x9f, 0x5e, 0xbc, 0x71, 0x9d, 0x1e, 0xf, 0xfc, 0x3, 0xe8, 0x30, 0x1c, 0xd9, 0x74, 0xd9, 0x52, 0xa2, 0xec, 0x9e, 0xc2, 0xc6, 0xe6, 0xd5, 0x8b, 0xc3, 0x43, 0xcd, 0x25, 0xb7, 0xdc, 0x52, 0xd2, 0xd, 0x68, 0x6b, 0xeb, 0x7e, 0x65, 0xef, 0xaf, 0x97, 0xcb, 0xdd, 0xfd, 0xce, 0x87, 0x9f, 0x7d, 0x71, 0xe9, 0xba, 0xe3, 0xda, 0x85, 0x4e, 0xc, 0x7d, 0xcd, 0x3f, 0xfd, 0xf0, 0xeb, 0x66, 0x75, 0xb6, 0xf6, 0xf0, 0xad, 0xb7, 0x97, 0x5f, 0x12, 0x33, 0x5b, 0xb7, 0xbf, 0xbb, 0x3d, 0xdb, 0xea, 0x74, 0x97, 0x3a, 0xdd, 0xee, 0x7b, 0x3, 0xdf, 0x9b, 0xd7, 0x5a, 0xdb, 0xc6, 0x8c, 0x7e, 0xad, 0xa, 0x21, 0x60, 0xdb, 0xb6, 0x2e, 0xbb, 0x95, 0xd7, 0xb5, 0x6a, 0xf5, 0x79, 0xa3, 0x56, 0xfd, 0xf3, 0xda, 0x97, 0xd7, 0xf6, 0x29, 0xdd, 0xbd, 0x6f, 0x6f, 0x3f, 0x28, 0xf5, 0xff, 0x6e, 0x56, 0xb4, 0x19, 0x2a, 0x66, 0x73, 0xe2, 0xe3, 0x25, 0x12, 0xc6, 0x16, 0x4e, 0x30, 0x73, 0x7a, 0xc1, 0x5b, 0x5f, 0xff, 0xe8, 0x10, 0xc0, 0xd1, 0xf6, 0x4, 0xcc, 0x4c, 0x3b, 0x3b, 0x3b, 0xa2, 0xd1, 0x68, 0x14, 0x8e, 0xd0, 0x6a, 0xb5, 0x78, 0x6d, 0x6d, 0xcd, 0x10, 0xc5, 0xdb, 0xba, 0x7f, 0x0, 0xb2, 0x1f, 0xaf, 0x82, 0x62, 0x7a, 0x69, 0xbb, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char graph_port_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xa,0x0,0x0,0x0,0xa,0x8,0x6,0x0,0x0,0x0,0x8d,0x32,0xcf,0xbd,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0xc6,0x49,0x44,0x41,0x54,0x18,0x95,0x6d,0x90,0x3d,0x4e,0xc4,0x30,0x14,0x84,0xbf,0xb1,0xa8,0x92,0x48,0x39,0x46,0xe2,0x9a,0x9f,0x12,0xc1,0xbd,0x16,0x25,0x4b,0x41,0xb,0x67,0xa1,0xa7,0xa2,0x63,0xa1,0x76,0x94,0x5b,0x58,0x72,0x52,0x3e,0xd3,0xc4,0x11,0xda,0xe5,0xab,0x46,0xa3,0xd1,0x68,0xde,0x13,0x1b,0x21,0x84,0x7,0x49,0x3,0x70,0xbb,0x59,0x5f,0xc0,0x5b,0xdf,0xf7,0xef,0x0,0x2,0x98,0xa6,0xe9,0x0,0x1c,0x1,0xc7,0x19,0x39,0xe7,0x67,0xef,0xfd,0xa0,0xad,0xe9,0x3,0x70,0x6d,0xdb,0x52,0xd7,0x35,0x0,0xcb,0xb2,0x10,0x63,0x4,0x30,0xe7,0xdc,0xe3,0x95,0xa4,0xb1,0x84,0x9a,0xa6,0xd9,0x9b,0x8a,0x8e,0x31,0x3a,0x33,0x1b,0x1d,0x70,0xd,0xec,0x4d,0x7f,0xa9,0xaa,0xaa,0xc8,0x1b,0x7,0xe4,0x8b,0xc4,0x25,0xd9,0x1,0x3f,0x65,0xd3,0x39,0xeb,0xba,0x16,0xf9,0xed,0x80,0xd7,0x6d,0xb,0x29,0x25,0xcc,0xc,0x33,0x23,0xa5,0xb4,0x1f,0x23,0x69,0x14,0x40,0x8,0xe1,0x28,0xe9,0xf0,0xcf,0x7b,0x2c,0xe7,0xfc,0xe4,0xbd,0x7f,0x51,0x71,0xe6,0x79,0xbe,0x37,0xb3,0x1,0xb8,0xdb,0x76,0x9f,0x24,0x8d,0x5d,0xd7,0x7d,0x2,0xfc,0x2,0xfb,0x83,0x50,0x87,0x89,0x31,0xee,0x78,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char graph_port_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0xa, 0x8, 0x6, 0x0, 0x0, 0x0, 0x8d, 0x32, 0xcf, 0xbd, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0xc6, 0x49, 0x44, 0x41, 0x54, 0x18, 0x95, 0x6d, 0x90, 0x3d, 0x4e, 0xc4, 0x30, 0x14, 0x84, 0xbf, 0xb1, 0xa8, 0x92, 0x48, 0x39, 0x46, 0xe2, 0x9a, 0x9f, 0x12, 0xc1, 0xbd, 0x16, 0x25, 0x4b, 0x41, 0xb, 0x67, 0xa1, 0xa7, 0xa2, 0x63, 0xa1, 0x76, 0x94, 0x5b, 0x58, 0x72, 0x52, 0x3e, 0xd3, 0xc4, 0x11, 0xda, 0xe5, 0xab, 0x46, 0xa3, 0xd1, 0x68, 0xde, 0x13, 0x1b, 0x21, 0x84, 0x7, 0x49, 0x3, 0x70, 0xbb, 0x59, 0x5f, 0xc0, 0x5b, 0xdf, 0xf7, 0xef, 0x0, 0x2, 0x98, 0xa6, 0xe9, 0x0, 0x1c, 0x1, 0xc7, 0x19, 0x39, 0xe7, 0x67, 0xef, 0xfd, 0xa0, 0xad, 0xe9, 0x3, 0x70, 0x6d, 0xdb, 0x52, 0xd7, 0x35, 0x0, 0xcb, 0xb2, 0x10, 0x63, 0x4, 0x30, 0xe7, 0xdc, 0xe3, 0x95, 0xa4, 0xb1, 0x84, 0x9a, 0xa6, 0xd9, 0x9b, 0x8a, 0x8e, 0x31, 0x3a, 0x33, 0x1b, 0x1d, 0x70, 0xd, 0xec, 0x4d, 0x7f, 0xa9, 0xaa, 0xaa, 0xc8, 0x1b, 0x7, 0xe4, 0x8b, 0xc4, 0x25, 0xd9, 0x1, 0x3f, 0x65, 0xd3, 0x39, 0xeb, 0xba, 0x16, 0xf9, 0xed, 0x80, 0xd7, 0x6d, 0xb, 0x29, 0x25, 0xcc, 0xc, 0x33, 0x23, 0xa5, 0xb4, 0x1f, 0x23, 0x69, 0x14, 0x40, 0x8, 0xe1, 0x28, 0xe9, 0xf0, 0xcf, 0x7b, 0x2c, 0xe7, 0xfc, 0xe4, 0xbd, 0x7f, 0x51, 0x71, 0xe6, 0x79, 0xbe, 0x37, 0xb3, 0x1, 0xb8, 0xdb, 0x76, 0x9f, 0x24, 0x8d, 0x5d, 0xd7, 0x7d, 0x2, 0xfc, 0x2, 0xfb, 0x83, 0x50, 0x87, 0x89, 0x31, 0xee, 0x78, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char hseparator_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x2,0x3,0x0,0x0,0x0,0xb9,0x61,0x56,0x18,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,0xc,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x73,0x9b,0xaa,0xce,0xdc,0xe1,0xff,0xff,0xff,0x64,0x6c,0x1,0xd2,0x0,0x0,0x0,0x3,0x74,0x52,0x4e,0x53,0x0,0xb3,0xb3,0x67,0xf6,0xdb,0x93,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x3,0x11,0xc,0x4c,0xf2,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,0x10,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x64,0x60,0x60,0xc2,0x40,0x8c,0xc,0x0,0x0,0xc7,0x0,0xf,0xf5,0x92,0x2f,0xa7,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 hseparator_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x2, 0x3, 0x0, 0x0, 0x0, 0xb9, 0x61, 0x56, 0x18, 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, 0xc, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x73, 0x9b, 0xaa, 0xce, 0xdc, 0xe1, 0xff, 0xff, 0xff, 0x64, 0x6c, 0x1, 0xd2, 0x0, 0x0, 0x0, 0x3, 0x74, 0x52, 0x4e, 0x53, 0x0, 0xb3, 0xb3, 0x67, 0xf6, 0xdb, 0x93, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x3, 0x11, 0xc, 0x4c, 0xf2, 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, 0x10, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x64, 0x60, 0x60, 0xc2, 0x40, 0x8c, 0xc, 0x0, 0x0, 0xc7, 0x0, 0xf, 0xf5, 0x92, 0x2f, 0xa7, 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 hslider_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,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,0x4e,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x40,0x3e,0x4a,0x2a,0x29,0x2f,0x20,0x20,0x24,0x3f,0x3e,0x49,0x1f,0x1f,0x24,0x20,0x20,0x24,0x4d,0x4b,0x59,0x3f,0x3e,0x49,0x3f,0x3e,0x49,0x1e,0x1e,0x23,0x1f,0x1f,0x23,0x20,0x20,0x25,0x22,0x22,0x27,0x23,0x23,0x27,0x23,0x23,0x28,0x25,0x25,0x2a,0xff,0xff,0xff,0x5f,0xd6,0x94,0x4d,0x0,0x0,0x0,0x12,0x74,0x52,0x4e,0x53,0x0,0x0,0x4,0x19,0x40,0x5d,0x66,0x68,0x28,0x93,0xf0,0xfc,0x94,0xfc,0xfd,0x1a,0x96,0x95,0x6b,0xe2,0xd5,0x49,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x19,0xec,0x6e,0xb5,0x88,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,0x65,0x49,0x44,0x41,0x54,0x18,0xd3,0x85,0xce,0xdd,0xe,0x80,0x20,0x8,0x5,0x60,0x54,0xb4,0x22,0xb5,0x34,0x7f,0x7a,0xff,0x27,0x8d,0xad,0xd6,0x6a,0x5c,0xf8,0xdd,0xc1,0x6,0xe7,0x0,0x8c,0xa9,0x1f,0x9e,0xb5,0x41,0xeb,0x26,0xe6,0x2c,0x1a,0xad,0x40,0xcf,0xb,0xad,0xf9,0x60,0x79,0xa5,0x65,0xd6,0x60,0x7c,0x28,0xb5,0x75,0xd6,0x6a,0x9,0xde,0x0,0x52,0xe9,0xe7,0xa3,0x17,0x42,0xb0,0xb1,0x9e,0xaf,0x1a,0xad,0x5c,0x88,0x93,0x6d,0xff,0x3e,0xdd,0x37,0x8e,0x4d,0x14,0xef,0xd8,0x48,0x89,0x63,0x45,0x31,0x51,0x7d,0xe8,0x2,0xf5,0xf,0x9,0x67,0xd9,0x88,0x8f,0x5b,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 hslider_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 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, 0x4e, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x40, 0x3e, 0x4a, 0x2a, 0x29, 0x2f, 0x20, 0x20, 0x24, 0x3f, 0x3e, 0x49, 0x1f, 0x1f, 0x24, 0x20, 0x20, 0x24, 0x4d, 0x4b, 0x59, 0x3f, 0x3e, 0x49, 0x3f, 0x3e, 0x49, 0x1e, 0x1e, 0x23, 0x1f, 0x1f, 0x23, 0x20, 0x20, 0x25, 0x22, 0x22, 0x27, 0x23, 0x23, 0x27, 0x23, 0x23, 0x28, 0x25, 0x25, 0x2a, 0xff, 0xff, 0xff, 0x5f, 0xd6, 0x94, 0x4d, 0x0, 0x0, 0x0, 0x12, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x0, 0x4, 0x19, 0x40, 0x5d, 0x66, 0x68, 0x28, 0x93, 0xf0, 0xfc, 0x94, 0xfc, 0xfd, 0x1a, 0x96, 0x95, 0x6b, 0xe2, 0xd5, 0x49, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x19, 0xec, 0x6e, 0xb5, 0x88, 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, 0x65, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x85, 0xce, 0xdd, 0xe, 0x80, 0x20, 0x8, 0x5, 0x60, 0x54, 0xb4, 0x22, 0xb5, 0x34, 0x7f, 0x7a, 0xff, 0x27, 0x8d, 0xad, 0xd6, 0x6a, 0x5c, 0xf8, 0xdd, 0xc1, 0x6, 0xe7, 0x0, 0x8c, 0xa9, 0x1f, 0x9e, 0xb5, 0x41, 0xeb, 0x26, 0xe6, 0x2c, 0x1a, 0xad, 0x40, 0xcf, 0xb, 0xad, 0xf9, 0x60, 0x79, 0xa5, 0x65, 0xd6, 0x60, 0x7c, 0x28, 0xb5, 0x75, 0xd6, 0x6a, 0x9, 0xde, 0x0, 0x52, 0xe9, 0xe7, 0xa3, 0x17, 0x42, 0xb0, 0xb1, 0x9e, 0xaf, 0x1a, 0xad, 0x5c, 0x88, 0x93, 0x6d, 0xff, 0x3e, 0xdd, 0x37, 0x8e, 0x4d, 0x14, 0xef, 0xd8, 0x48, 0x89, 0x63, 0x45, 0x31, 0x51, 0x7d, 0xe8, 0x2, 0xf5, 0xf, 0x9, 0x67, 0xd9, 0x88, 0x8f, 0x5b, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 hslider_grabber_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,0x4,0x0,0x0,0x0,0xb5,0xfa,0x37,0xea,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,0x2,0x62,0x4b,0x47,0x44,0x0,0xff,0x87,0x8f,0xcc,0xbf,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,0x1,0x1d,0x49,0x44,0x41,0x54,0x28,0xcf,0x85,0xd1,0x3f,0x4b,0xc3,0x40,0x18,0xc7,0xf1,0xef,0x25,0xad,0x89,0xa9,0x70,0x83,0x43,0x5d,0xc4,0x21,0x6e,0x4a,0x7,0x47,0xdf,0x83,0x53,0x16,0x17,0xd7,0x4e,0xbe,0x2,0x5f,0x85,0x83,0xa0,0xb8,0x38,0xb8,0x88,0xd0,0x51,0x5d,0x1c,0x1c,0x1c,0x1c,0x2a,0xa2,0xe8,0x22,0x2d,0x82,0x2d,0x88,0x54,0xed,0x3f,0x1b,0x9a,0x78,0x49,0x1c,0x9a,0x54,0x4f,0x5,0x6f,0x3a,0xee,0xf9,0xf0,0x3c,0x3f,0x9e,0x83,0x7f,0x8e,0x18,0xdf,0x4c,0x1c,0x24,0x5,0x60,0x40,0x17,0x9f,0x48,0x7,0x26,0xd3,0xe5,0x55,0xd7,0x93,0x25,0xe8,0xde,0xd4,0x2b,0xbb,0x7,0xbc,0x8e,0x88,0x99,0x82,0xa9,0xf2,0xda,0xe2,0x86,0x58,0x78,0xb7,0x87,0xf6,0xc4,0xdc,0xcc,0xd2,0x6c,0xfb,0xf2,0x8e,0x10,0xc0,0x48,0x81,0x74,0x3d,0x55,0xf4,0x51,0x28,0x7c,0x54,0xd1,0xf5,0x90,0xa3,0x42,0x6,0xa,0xb2,0x14,0x90,0x0,0x90,0x10,0x20,0x4b,0x14,0x74,0x20,0x62,0xf1,0x3d,0x7b,0x24,0xb2,0x74,0x19,0x8,0x83,0x96,0x39,0x2e,0xb,0x82,0x37,0x94,0xe,0x6,0xbd,0xdb,0xfc,0x18,0xe4,0x49,0x9e,0xf0,0x75,0xd0,0xbf,0x3e,0xb6,0x22,0x23,0x7d,0x9a,0x4c,0xce,0xf6,0xe8,0xe9,0x20,0xb8,0xaa,0x6,0xcd,0x1c,0x0,0x39,0x3e,0x1e,0x4f,0xce,0x7f,0x76,0x88,0x1f,0x1a,0xcf,0xa7,0xe,0x6,0x6,0xe,0x8d,0x23,0xd5,0x22,0xd6,0x41,0x42,0x77,0x6b,0x33,0xaa,0x59,0x58,0xc4,0xf5,0x9d,0xed,0x6c,0xc0,0xd7,0x26,0x21,0xe,0x7,0x9d,0xda,0xf2,0x8a,0x1d,0x1f,0xae,0xdf,0x57,0x19,0xfe,0x6,0xa0,0x9a,0x2f,0xf3,0xed,0xfe,0xc5,0x7e,0x85,0xce,0x5f,0xbf,0x39,0xca,0x67,0x21,0x18,0x66,0x3b,0x0,0xf8,0x4,0x7e,0x5c,0x62,0x33,0x51,0xf0,0xbb,0xff,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 hslider_grabber_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, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 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, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 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, 0x1, 0x1d, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x85, 0xd1, 0x3f, 0x4b, 0xc3, 0x40, 0x18, 0xc7, 0xf1, 0xef, 0x25, 0xad, 0x89, 0xa9, 0x70, 0x83, 0x43, 0x5d, 0xc4, 0x21, 0x6e, 0x4a, 0x7, 0x47, 0xdf, 0x83, 0x53, 0x16, 0x17, 0xd7, 0x4e, 0xbe, 0x2, 0x5f, 0x85, 0x83, 0xa0, 0xb8, 0x38, 0xb8, 0x88, 0xd0, 0x51, 0x5d, 0x1c, 0x1c, 0x1c, 0x1c, 0x2a, 0xa2, 0xe8, 0x22, 0x2d, 0x82, 0x2d, 0x88, 0x54, 0xed, 0x3f, 0x1b, 0x9a, 0x78, 0x49, 0x1c, 0x9a, 0x54, 0x4f, 0x5, 0x6f, 0x3a, 0xee, 0xf9, 0xf0, 0x3c, 0x3f, 0x9e, 0x83, 0x7f, 0x8e, 0x18, 0xdf, 0x4c, 0x1c, 0x24, 0x5, 0x60, 0x40, 0x17, 0x9f, 0x48, 0x7, 0x26, 0xd3, 0xe5, 0x55, 0xd7, 0x93, 0x25, 0xe8, 0xde, 0xd4, 0x2b, 0xbb, 0x7, 0xbc, 0x8e, 0x88, 0x99, 0x82, 0xa9, 0xf2, 0xda, 0xe2, 0x86, 0x58, 0x78, 0xb7, 0x87, 0xf6, 0xc4, 0xdc, 0xcc, 0xd2, 0x6c, 0xfb, 0xf2, 0x8e, 0x10, 0xc0, 0x48, 0x81, 0x74, 0x3d, 0x55, 0xf4, 0x51, 0x28, 0x7c, 0x54, 0xd1, 0xf5, 0x90, 0xa3, 0x42, 0x6, 0xa, 0xb2, 0x14, 0x90, 0x0, 0x90, 0x10, 0x20, 0x4b, 0x14, 0x74, 0x20, 0x62, 0xf1, 0x3d, 0x7b, 0x24, 0xb2, 0x74, 0x19, 0x8, 0x83, 0x96, 0x39, 0x2e, 0xb, 0x82, 0x37, 0x94, 0xe, 0x6, 0xbd, 0xdb, 0xfc, 0x18, 0xe4, 0x49, 0x9e, 0xf0, 0x75, 0xd0, 0xbf, 0x3e, 0xb6, 0x22, 0x23, 0x7d, 0x9a, 0x4c, 0xce, 0xf6, 0xe8, 0xe9, 0x20, 0xb8, 0xaa, 0x6, 0xcd, 0x1c, 0x0, 0x39, 0x3e, 0x1e, 0x4f, 0xce, 0x7f, 0x76, 0x88, 0x1f, 0x1a, 0xcf, 0xa7, 0xe, 0x6, 0x6, 0xe, 0x8d, 0x23, 0xd5, 0x22, 0xd6, 0x41, 0x42, 0x77, 0x6b, 0x33, 0xaa, 0x59, 0x58, 0xc4, 0xf5, 0x9d, 0xed, 0x6c, 0xc0, 0xd7, 0x26, 0x21, 0xe, 0x7, 0x9d, 0xda, 0xf2, 0x8a, 0x1d, 0x1f, 0xae, 0xdf, 0x57, 0x19, 0xfe, 0x6, 0xa0, 0x9a, 0x2f, 0xf3, 0xed, 0xfe, 0xc5, 0x7e, 0x85, 0xce, 0x5f, 0xbf, 0x39, 0xca, 0x67, 0x21, 0x18, 0x66, 0x3b, 0x0, 0xf8, 0x4, 0x7e, 0x5c, 0x62, 0x33, 0x51, 0xf0, 0xbb, 0xff, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 hslider_grabber_hl_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,0xc6,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x48,0x83,0x83,0x60,0xaf,0xb1,0x65,0xbb,0xca,0x61,0xb3,0xc2,0x0,0x0,0x0,0x63,0xb7,0xc8,0x63,0xb7,0xc7,0x0,0x0,0x0,0x61,0xb3,0xbc,0x60,0xb1,0xbc,0x0,0x0,0x0,0x0,0x0,0x0,0x5b,0xa6,0xa5,0x63,0xb4,0xb6,0x0,0x0,0x0,0x0,0x0,0x0,0x3a,0x69,0x69,0x5e,0xb1,0xcd,0x5e,0xb0,0xcd,0x36,0x63,0x63,0x0,0x0,0x0,0x17,0x2a,0x29,0x60,0xb2,0xbd,0x62,0xb3,0xbf,0x3,0x5,0x5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x55,0x9b,0x9a,0x52,0x96,0x95,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0xf,0xf,0x62,0xb4,0xbd,0x63,0xb7,0xbf,0x0,0x0,0x0,0x27,0x48,0x47,0x68,0xc0,0xcf,0x68,0xc1,0xcf,0x2d,0x52,0x52,0x51,0x93,0x92,0x56,0x9d,0x9c,0x0,0x0,0x0,0x54,0xa2,0xc8,0x4c,0x94,0xc2,0x48,0x8e,0xc0,0x47,0x8c,0xbf,0x4b,0x93,0xc2,0x4b,0x92,0xc2,0x4f,0x98,0xc4,0x4d,0x96,0xc3,0x55,0xa3,0xc8,0x53,0x9f,0xc7,0x49,0x8f,0xc0,0x4e,0x97,0xc4,0x5a,0xab,0xcb,0x5a,0xac,0xcc,0x52,0x9e,0xc6,0x51,0x9d,0xc6,0xff,0xff,0xff,0x6b,0x1e,0xb5,0x61,0x0,0x0,0x0,0x31,0x74,0x52,0x4e,0x53,0x0,0x3,0xd,0x1c,0x27,0x16,0x6e,0xc1,0xef,0xe8,0x28,0xf0,0xf0,0x22,0xdb,0xde,0x24,0x17,0xaf,0xc5,0x1a,0xa,0x65,0xfc,0xfe,0x64,0xc,0x31,0xe0,0xe0,0x28,0x2,0x1,0x14,0x9c,0x95,0x13,0x5,0x2c,0xdb,0xdc,0xb,0x4f,0xf4,0xf7,0x55,0x73,0x7d,0x4,0x28,0xf1,0xfd,0xa1,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x41,0x89,0xde,0x6c,0x4e,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x9e,0x49,0x44,0x41,0x54,0x18,0xd3,0x6d,0xcf,0xd7,0x12,0x82,0x30,0x10,0x5,0x50,0x48,0x42,0x12,0xb0,0x77,0x8d,0xd,0xb,0x28,0x56,0x12,0x62,0xd,0x96,0xff,0xff,0x2a,0x61,0xc,0xe0,0x83,0xfb,0xb4,0xf7,0xcc,0xec,0xcc,0x5d,0xc3,0xf8,0x37,0x26,0x80,0x8,0x41,0x60,0xe6,0xd9,0xc2,0x84,0x52,0x82,0xad,0x4c,0x0,0xb6,0xb9,0x10,0xdc,0xc6,0x40,0x3,0x24,0x3c,0x92,0x32,0xe2,0x4,0x6a,0x40,0x54,0xc8,0x64,0x4,0x45,0x1a,0x9c,0xd2,0x29,0x85,0x73,0xd9,0xd1,0x50,0xa9,0x5e,0x52,0xb8,0xd6,0xea,0x1a,0x1a,0xcd,0x5b,0xa,0xf7,0x56,0x5b,0x43,0xa7,0xdb,0x53,0x52,0xaa,0xfe,0x80,0x65,0x3d,0x86,0xa3,0x58,0xca,0x78,0x3c,0x99,0x6a,0x70,0x67,0xf3,0x87,0x52,0xcf,0xc5,0x32,0xaf,0xee,0xf9,0xab,0xd7,0x7b,0xed,0x7b,0xc5,0x33,0xc1,0x66,0xbb,0xdb,0xb3,0x22,0x27,0x47,0x87,0xa3,0xe5,0xfe,0xfe,0x1b,0x6,0x2c,0xfc,0x6e,0x1f,0x93,0x2a,0x10,0x62,0x3,0x21,0x32,0x75,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 hslider_grabber_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, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 0x0, 0x0, 0x0, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 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, 0xe1, 0x7, 0xa, 0x13, 0x2f, 0x7, 0x5e, 0x49, 0xee, 0x14, 0x0, 0x0, 0x0, 0x1d, 0x69, 0x54, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x0, 0x0, 0x0, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x64, 0x2e, 0x65, 0x7, 0x0, 0x0, 0x0, 0xea, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x63, 0x60, 0x20, 0x1a, 0x30, 0x33, 0xf0, 0x32, 0xc8, 0x30, 0xa8, 0x3, 0xa1, 0xc, 0x90, 0xc5, 0x8c, 0x29, 0x2d, 0x66, 0x9c, 0xe7, 0x7a, 0xd0, 0xe7, 0xbd, 0xcf, 0x7b, 0xd7, 0x83, 0xc6, 0x79, 0xc, 0x62, 0xe8, 0x4a, 0x78, 0x8d, 0xf3, 0x3c, 0x5f, 0xb8, 0xff, 0x77, 0x1, 0x42, 0xf7, 0xff, 0x9e, 0x2f, 0x80, 0x4a, 0x78, 0x51, 0x15, 0xc8, 0xb8, 0x1e, 0x74, 0xff, 0xef, 0x4, 0x85, 0xee, 0xff, 0x5d, 0xf, 0x2, 0x2d, 0x42, 0x1, 0xea, 0x3e, 0xef, 0x5d, 0xe0, 0xa, 0x5c, 0xfe, 0xfb, 0xbc, 0x7, 0xba, 0x5, 0x5, 0x68, 0x78, 0x7f, 0x40, 0x56, 0xe0, 0xfd, 0x81, 0x41, 0x3, 0x55, 0x81, 0x92, 0xc7, 0x6d, 0x57, 0x24, 0x5, 0xee, 0xf7, 0x18, 0x54, 0x50, 0x15, 0x88, 0x3b, 0xae, 0xf7, 0x40, 0x72, 0x83, 0xfb, 0x51, 0x6, 0x29, 0x54, 0x5, 0x5c, 0x9a, 0xa9, 0xde, 0x7f, 0x9c, 0xc1, 0xd2, 0xce, 0xff, 0xbd, 0xff, 0xa9, 0xa7, 0x30, 0xf0, 0xa0, 0x85, 0x83, 0xa0, 0xa1, 0xc7, 0x3, 0x88, 0x25, 0xae, 0xff, 0x3d, 0x1f, 0x30, 0x69, 0x30, 0x30, 0xa1, 0x2a, 0x60, 0x64, 0x10, 0xb1, 0x99, 0xe3, 0x5, 0xd4, 0xed, 0xfc, 0xdf, 0xeb, 0xbf, 0xd5, 0x54, 0x6, 0x61, 0xcc, 0xa0, 0x66, 0x65, 0xd3, 0xf1, 0xb8, 0xed, 0xf6, 0xdf, 0xed, 0xbf, 0xe7, 0x1d, 0x36, 0x1d, 0x6, 0x56, 0x6c, 0xb1, 0xc1, 0x2d, 0xe3, 0xef, 0xf7, 0xc5, 0xef, 0xbb, 0x42, 0x28, 0xba, 0xfd, 0x48, 0xd6, 0x58, 0x16, 0xdb, 0xd6, 0x2, 0xe3, 0x81, 0x11, 0x57, 0x8c, 0xb2, 0x30, 0x70, 0x3, 0x75, 0xb3, 0x20, 0xb, 0x1, 0x0, 0x4, 0x5c, 0x63, 0x9b, 0x17, 0x86, 0x76, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char hslider_tick_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x10,0x4,0x3,0x0,0x0,0x0,0xc3,0x98,0xc3,0xc0,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,0x1e,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x38,0x55,0x5f,0x8c,0xac,0xb8,0x81,0xa2,0xad,0x98,0x98,0x98,0x4e,0x4e,0x4e,0x8d,0x8d,0x8d,0x82,0x82,0x82,0x4e,0x4e,0x4e,0xff,0xff,0xff,0xc1,0xc9,0xb1,0x80,0x0,0x0,0x0,0x9,0x74,0x52,0x4e,0x53,0x0,0x0,0x0,0x0,0x79,0x31,0x79,0x79,0x1c,0x7e,0xed,0x4b,0xf4,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x9,0xf1,0xd9,0xa5,0xec,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,0x21,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x9,0x60,0x60,0xb,0x60,0x60,0xf,0x60,0x60,0x6d,0x60,0x60,0x14,0x60,0xc0,0x4,0x4c,0x2,0xc,0xcc,0x2,0xc,0x30,0x65,0x0,0x46,0x9d,0x2,0xbe,0x9f,0x3a,0x6c,0xab,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 hslider_grabber_hl_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, 0xc6, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x48, 0x83, 0x83, 0x60, 0xaf, 0xb1, 0x65, 0xbb, 0xca, 0x61, 0xb3, 0xc2, 0x0, 0x0, 0x0, 0x63, 0xb7, 0xc8, 0x63, 0xb7, 0xc7, 0x0, 0x0, 0x0, 0x61, 0xb3, 0xbc, 0x60, 0xb1, 0xbc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5b, 0xa6, 0xa5, 0x63, 0xb4, 0xb6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3a, 0x69, 0x69, 0x5e, 0xb1, 0xcd, 0x5e, 0xb0, 0xcd, 0x36, 0x63, 0x63, 0x0, 0x0, 0x0, 0x17, 0x2a, 0x29, 0x60, 0xb2, 0xbd, 0x62, 0xb3, 0xbf, 0x3, 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x55, 0x9b, 0x9a, 0x52, 0x96, 0x95, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xf, 0xf, 0x62, 0xb4, 0xbd, 0x63, 0xb7, 0xbf, 0x0, 0x0, 0x0, 0x27, 0x48, 0x47, 0x68, 0xc0, 0xcf, 0x68, 0xc1, 0xcf, 0x2d, 0x52, 0x52, 0x51, 0x93, 0x92, 0x56, 0x9d, 0x9c, 0x0, 0x0, 0x0, 0x54, 0xa2, 0xc8, 0x4c, 0x94, 0xc2, 0x48, 0x8e, 0xc0, 0x47, 0x8c, 0xbf, 0x4b, 0x93, 0xc2, 0x4b, 0x92, 0xc2, 0x4f, 0x98, 0xc4, 0x4d, 0x96, 0xc3, 0x55, 0xa3, 0xc8, 0x53, 0x9f, 0xc7, 0x49, 0x8f, 0xc0, 0x4e, 0x97, 0xc4, 0x5a, 0xab, 0xcb, 0x5a, 0xac, 0xcc, 0x52, 0x9e, 0xc6, 0x51, 0x9d, 0xc6, 0xff, 0xff, 0xff, 0x6b, 0x1e, 0xb5, 0x61, 0x0, 0x0, 0x0, 0x31, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x3, 0xd, 0x1c, 0x27, 0x16, 0x6e, 0xc1, 0xef, 0xe8, 0x28, 0xf0, 0xf0, 0x22, 0xdb, 0xde, 0x24, 0x17, 0xaf, 0xc5, 0x1a, 0xa, 0x65, 0xfc, 0xfe, 0x64, 0xc, 0x31, 0xe0, 0xe0, 0x28, 0x2, 0x1, 0x14, 0x9c, 0x95, 0x13, 0x5, 0x2c, 0xdb, 0xdc, 0xb, 0x4f, 0xf4, 0xf7, 0x55, 0x73, 0x7d, 0x4, 0x28, 0xf1, 0xfd, 0xa1, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x41, 0x89, 0xde, 0x6c, 0x4e, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x9e, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x6d, 0xcf, 0xd7, 0x12, 0x82, 0x30, 0x10, 0x5, 0x50, 0x48, 0x42, 0x12, 0xb0, 0x77, 0x8d, 0xd, 0xb, 0x28, 0x56, 0x12, 0x62, 0xd, 0x96, 0xff, 0xff, 0x2a, 0x61, 0xc, 0xe0, 0x83, 0xfb, 0xb4, 0xf7, 0xcc, 0xec, 0xcc, 0x5d, 0xc3, 0xf8, 0x37, 0x26, 0x80, 0x8, 0x41, 0x60, 0xe6, 0xd9, 0xc2, 0x84, 0x52, 0x82, 0xad, 0x4c, 0x0, 0xb6, 0xb9, 0x10, 0xdc, 0xc6, 0x40, 0x3, 0x24, 0x3c, 0x92, 0x32, 0xe2, 0x4, 0x6a, 0x40, 0x54, 0xc8, 0x64, 0x4, 0x45, 0x1a, 0x9c, 0xd2, 0x29, 0x85, 0x73, 0xd9, 0xd1, 0x50, 0xa9, 0x5e, 0x52, 0xb8, 0xd6, 0xea, 0x1a, 0x1a, 0xcd, 0x5b, 0xa, 0xf7, 0x56, 0x5b, 0x43, 0xa7, 0xdb, 0x53, 0x52, 0xaa, 0xfe, 0x80, 0x65, 0x3d, 0x86, 0xa3, 0x58, 0xca, 0x78, 0x3c, 0x99, 0x6a, 0x70, 0x67, 0xf3, 0x87, 0x52, 0xcf, 0xc5, 0x32, 0xaf, 0xee, 0xf9, 0xab, 0xd7, 0x7b, 0xed, 0x7b, 0xc5, 0x33, 0xc1, 0x66, 0xbb, 0xdb, 0xb3, 0x22, 0x27, 0x47, 0x87, 0xa3, 0xe5, 0xfe, 0xfe, 0x1b, 0x6, 0x2c, 0xfc, 0x6e, 0x1f, 0x93, 0x2a, 0x10, 0x62, 0x3, 0x21, 0x32, 0x75, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 hsplit_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x1,0x3,0x0,0x0,0x0,0xfe,0xc1,0x2c,0xc8,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,0x6,0x50,0x4c,0x54,0x45,0x27,0x27,0x29,0xff,0xff,0xff,0x11,0xab,0xb9,0xf3,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x1,0xff,0x2,0x2d,0xde,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,0xb,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x40,0x5,0x0,0x0,0x10,0x0,0x1,0xa1,0xc5,0x21,0xc1,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 hslider_tick_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x10, 0x4, 0x3, 0x0, 0x0, 0x0, 0xc3, 0x98, 0xc3, 0xc0, 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, 0x1e, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x38, 0x55, 0x5f, 0x8c, 0xac, 0xb8, 0x81, 0xa2, 0xad, 0x98, 0x98, 0x98, 0x4e, 0x4e, 0x4e, 0x8d, 0x8d, 0x8d, 0x82, 0x82, 0x82, 0x4e, 0x4e, 0x4e, 0xff, 0xff, 0xff, 0xc1, 0xc9, 0xb1, 0x80, 0x0, 0x0, 0x0, 0x9, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x0, 0x0, 0x0, 0x79, 0x31, 0x79, 0x79, 0x1c, 0x7e, 0xed, 0x4b, 0xf4, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x9, 0xf1, 0xd9, 0xa5, 0xec, 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, 0x21, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x9, 0x60, 0x60, 0xb, 0x60, 0x60, 0xf, 0x60, 0x60, 0x6d, 0x60, 0x60, 0x14, 0x60, 0xc0, 0x4, 0x4c, 0x2, 0xc, 0xcc, 0x2, 0xc, 0x30, 0x65, 0x0, 0x46, 0x9d, 0x2, 0xbe, 0x9f, 0x3a, 0x6c, 0xab, 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 hsplitter_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x40,0x8,0x0,0x0,0x0,0x0,0x2,0x6f,0x69,0x56,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,0x2,0x74,0x52,0x4e,0x53,0x0,0x0,0x76,0x93,0xcd,0x38,0x0,0x0,0x0,0x2,0x62,0x4b,0x47,0x44,0x0,0xff,0x87,0x8f,0xcc,0xbf,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x27,0x49,0x44,0x41,0x54,0x28,0xcf,0x63,0x60,0x80,0x2,0x66,0x86,0x5,0xa2,0xe7,0x18,0x16,0x88,0x9e,0x63,0x66,0x10,0xbd,0xf6,0x98,0x41,0xf4,0xda,0x63,0x6,0xc,0x30,0xaa,0x66,0x54,0xd,0x9a,0x1a,0x0,0x5c,0x29,0x6a,0x81,0x90,0x8f,0x52,0x12,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 hsplit_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x1, 0x3, 0x0, 0x0, 0x0, 0xfe, 0xc1, 0x2c, 0xc8, 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, 0x6, 0x50, 0x4c, 0x54, 0x45, 0x27, 0x27, 0x29, 0xff, 0xff, 0xff, 0x11, 0xab, 0xb9, 0xf3, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x1, 0xff, 0x2, 0x2d, 0xde, 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, 0xb, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x40, 0x5, 0x0, 0x0, 0x10, 0x0, 0x1, 0xa1, 0xc5, 0x21, 0xc1, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 icon_add_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,0x36,0x49,0x44,0x41,0x54,0x38,0x8d,0x63,0x60,0xa0,0x25,0x78,0xf0,0xe0,0xc1,0xff,0x7,0xf,0x1e,0xfc,0xc7,0xa7,0x86,0x89,0x52,0x4b,0x46,0xd,0x60,0x60,0x60,0x64,0x60,0x80,0x84,0x36,0x39,0x9a,0x15,0x14,0x14,0x18,0x29,0x76,0x1,0x5e,0x30,0x9a,0xe,0xe8,0x64,0x0,0xc5,0x0,0x0,0xc7,0x6e,0x12,0x94,0xf9,0x26,0x2e,0xdb,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char hsplitter_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x40, 0x8, 0x0, 0x0, 0x0, 0x0, 0x2, 0x6f, 0x69, 0x56, 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, 0x2, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x0, 0x76, 0x93, 0xcd, 0x38, 0x0, 0x0, 0x0, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x27, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x63, 0x60, 0x80, 0x2, 0x66, 0x86, 0x5, 0xa2, 0xe7, 0x18, 0x16, 0x88, 0x9e, 0x63, 0x66, 0x10, 0xbd, 0xf6, 0x98, 0x41, 0xf4, 0xda, 0x63, 0x6, 0xc, 0x30, 0xaa, 0x66, 0x54, 0xd, 0x9a, 0x1a, 0x0, 0x5c, 0x29, 0x6a, 0x81, 0x90, 0x8f, 0x52, 0x12, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 icon_close_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9b,0x49,0x44,0x41,0x54,0x38,0x8d,0xcd,0x92,0x31,0xe,0xc2,0x30,0x10,0x4,0x17,0xaa,0x3d,0x67,0xdb,0x58,0xd0,0xd3,0xf0,0xa3,0x7c,0x36,0x3c,0x82,0x48,0x44,0x22,0x6f,0xb1,0x4d,0x85,0x14,0x81,0xf,0x2c,0x28,0xe0,0xda,0xd5,0x8c,0x4e,0x77,0xb,0xfc,0xd5,0x98,0xd9,0x20,0x29,0x7a,0xb9,0xa4,0x68,0x66,0x83,0xb,0x93,0xcc,0x24,0xa7,0x9a,0x44,0x52,0x24,0x39,0x91,0xcc,0x55,0x89,0xa4,0xde,0xcc,0xce,0x24,0xb,0xc9,0x39,0x84,0xb0,0xf7,0xb2,0xae,0xeb,0x76,0xde,0x8a,0x4f,0x92,0x66,0xd8,0x91,0x5c,0x49,0x5e,0x9a,0xe1,0xb5,0x64,0x5,0x16,0x92,0x8b,0x7,0x6f,0x9b,0x8c,0x0,0x4a,0x29,0x9b,0x26,0x81,0xa4,0x3e,0xa5,0x34,0x2,0x38,0x2,0x58,0x0,0xcc,0x0,0xe,0x39,0xe7,0xd3,0xfa,0xb0,0xee,0xea,0x8f,0x7,0x7b,0xf5,0x9d,0xb7,0xb0,0x97,0x55,0x25,0x5f,0x17,0xe9,0x2e,0xf9,0xb8,0xca,0x3f,0x9b,0x1b,0x1a,0xe3,0x40,0x47,0xa0,0xda,0xda,0x61,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char icon_add_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, 0x36, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x63, 0x60, 0xa0, 0x25, 0x78, 0xf0, 0xe0, 0xc1, 0xff, 0x7, 0xf, 0x1e, 0xfc, 0xc7, 0xa7, 0x86, 0x89, 0x52, 0x4b, 0x46, 0xd, 0x60, 0x60, 0x60, 0x64, 0x60, 0x80, 0x84, 0x36, 0x39, 0x9a, 0x15, 0x14, 0x14, 0x18, 0x29, 0x76, 0x1, 0x5e, 0x30, 0x9a, 0xe, 0xe8, 0x64, 0x0, 0xc5, 0x0, 0x0, 0xc7, 0x6e, 0x12, 0x94, 0xf9, 0x26, 0x2e, 0xdb, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char icon_color_pick_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,0x1,0x55,0x49,0x44,0x41,0x54,0x38,0x8d,0xb5,0x92,0xb1,0x4a,0x3,0x41,0x14,0x45,0xef,0xdb,0x6c,0xac,0xf2,0x1,0xda,0xcd,0x40,0x4,0x25,0x11,0x4,0x8b,0x80,0x8d,0x20,0x88,0x5d,0x20,0x88,0x90,0x22,0x9d,0x9d,0xa0,0x85,0x58,0xeb,0x7,0x88,0xe0,0x7,0x58,0x8b,0x36,0x5a,0x88,0xa0,0xa5,0x85,0xa5,0x60,0x61,0xb0,0x70,0xb2,0xef,0x8d,0x44,0x41,0x21,0x1f,0x20,0x6c,0xf2,0x2c,0xcc,0xc2,0x12,0x92,0x8d,0x45,0xbc,0xe5,0xdc,0xb9,0x67,0xee,0xbc,0x19,0xe0,0xbf,0xe5,0xbd,0x2f,0x35,0x9b,0xcd,0x29,0x0,0x10,0x91,0x9a,0x88,0x7c,0x88,0xc8,0xa7,0x88,0xd4,0x0,0x80,0xb2,0xc2,0xcc,0x5c,0x21,0xa2,0x5b,0x22,0xba,0xef,0x76,0xbb,0x97,0x44,0x74,0x4a,0x44,0x61,0xdf,0xfe,0x32,0xc6,0x4c,0x87,0x59,0x0,0x0,0xdf,0x0,0x62,0x55,0xad,0x6,0x41,0x50,0x1d,0xf0,0x62,0x0,0x8,0xb2,0xd2,0xd6,0xda,0x27,0x0,0x27,0x83,0xeb,0xaa,0x1a,0x3,0xd8,0x19,0xb,0x60,0xe6,0x3a,0x80,0x6d,0x0,0xd,0x0,0x9d,0x14,0x60,0xcb,0x18,0x73,0x95,0x9,0x60,0xe6,0x3a,0x11,0x1d,0xc7,0x71,0xbc,0x6e,0x8c,0x39,0x53,0xd5,0xdd,0xc4,0xcb,0xe5,0x72,0x1b,0xc9,0x60,0x87,0x2,0xd2,0xe1,0x62,0xb1,0xf8,0xec,0xbd,0x2f,0x11,0xd1,0x51,0xaf,0xd7,0x3b,0x0,0xd0,0x51,0xd5,0x95,0x42,0xa1,0x30,0x3b,0xf2,0x64,0x11,0x79,0x77,0xce,0x95,0x81,0xdf,0x67,0x14,0x91,0x76,0xff,0x3a,0x60,0xe6,0x45,0x66,0xae,0xc,0xd,0x47,0x51,0xb4,0x29,0x22,0xed,0x56,0xab,0xb5,0xd0,0xdf,0x3c,0xe7,0xbd,0x7f,0x8b,0xa2,0xa8,0x31,0x7a,0x52,0x93,0x8,0x8b,0xc8,0x72,0xba,0xb6,0x73,0xae,0x9c,0xae,0x9d,0xa5,0x0,0x0,0x88,0x68,0xd,0xc0,0x8b,0xaa,0xbe,0x3a,0xe7,0xca,0x61,0x18,0xde,0xa9,0xea,0xbe,0xb5,0xf6,0x7c,0x1c,0x20,0xf9,0x89,0x4b,0x0,0x56,0xf3,0xf9,0xfc,0xd,0x80,0x79,0x55,0xdd,0xb3,0xd6,0x5e,0x8c,0xad,0x9e,0x0,0x54,0x75,0x86,0x88,0xae,0x1,0x3c,0x2,0x38,0x34,0xc6,0x3c,0xfc,0x25,0x3c,0x11,0xfd,0x0,0x28,0x54,0xbb,0xfe,0xad,0x99,0xe5,0xb8,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char icon_close_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x6, 0x0, 0x0, 0x0, 0x1f, 0xf3, 0xff, 0x61, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0x9b, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xcd, 0x92, 0x31, 0xe, 0xc2, 0x30, 0x10, 0x4, 0x17, 0xaa, 0x3d, 0x67, 0xdb, 0x58, 0xd0, 0xd3, 0xf0, 0xa3, 0x7c, 0x36, 0x3c, 0x82, 0x48, 0x44, 0x22, 0x6f, 0xb1, 0x4d, 0x85, 0x14, 0x81, 0xf, 0x2c, 0x28, 0xe0, 0xda, 0xd5, 0x8c, 0x4e, 0x77, 0xb, 0xfc, 0xd5, 0x98, 0xd9, 0x20, 0x29, 0x7a, 0xb9, 0xa4, 0x68, 0x66, 0x83, 0xb, 0x93, 0xcc, 0x24, 0xa7, 0x9a, 0x44, 0x52, 0x24, 0x39, 0x91, 0xcc, 0x55, 0x89, 0xa4, 0xde, 0xcc, 0xce, 0x24, 0xb, 0xc9, 0x39, 0x84, 0xb0, 0xf7, 0xb2, 0xae, 0xeb, 0x76, 0xde, 0x8a, 0x4f, 0x92, 0x66, 0xd8, 0x91, 0x5c, 0x49, 0x5e, 0x9a, 0xe1, 0xb5, 0x64, 0x5, 0x16, 0x92, 0x8b, 0x7, 0x6f, 0x9b, 0x8c, 0x0, 0x4a, 0x29, 0x9b, 0x26, 0x81, 0xa4, 0x3e, 0xa5, 0x34, 0x2, 0x38, 0x2, 0x58, 0x0, 0xcc, 0x0, 0xe, 0x39, 0xe7, 0xd3, 0xfa, 0xb0, 0xee, 0xea, 0x8f, 0x7, 0x7b, 0xf5, 0x9d, 0xb7, 0xb0, 0x97, 0x55, 0x25, 0x5f, 0x17, 0xe9, 0x2e, 0xf9, 0xb8, 0xca, 0x3f, 0x9b, 0x1b, 0x1a, 0xe3, 0x40, 0x47, 0xa0, 0xda, 0xda, 0x61, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char icon_folder_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,0x5f,0x49,0x44,0x41,0x54,0x38,0x8d,0xed,0x8f,0xc1,0xd,0x80,0x30,0x8,0x45,0x9f,0x9d,0x84,0x39,0x4c,0x3b,0xbd,0x75,0x8f,0x32,0x9,0x5e,0xec,0xa5,0x9,0xa4,0xc6,0x26,0x5e,0x7c,0x17,0xe,0xc0,0xe3,0x3,0x5f,0xb3,0x1,0xb4,0xd6,0x4e,0x60,0x77,0x66,0xaa,0x88,0x14,0x4f,0x90,0xee,0xea,0x2d,0x3,0xe4,0x28,0x41,0x8a,0x9a,0x1d,0x55,0x75,0x25,0xfd,0x5,0x9b,0x11,0xd,0x54,0x11,0x29,0x53,0x9,0x1c,0x32,0x4c,0xbe,0x10,0xf1,0xb,0x16,0xa,0xea,0xd3,0x45,0x33,0x3b,0xde,0x1e,0x5f,0xc3,0x5,0x1f,0xc5,0x12,0x2c,0xc5,0x88,0xe1,0xb4,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char icon_color_pick_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, 0x1, 0x55, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xb5, 0x92, 0xb1, 0x4a, 0x3, 0x41, 0x14, 0x45, 0xef, 0xdb, 0x6c, 0xac, 0xf2, 0x1, 0xda, 0xcd, 0x40, 0x4, 0x25, 0x11, 0x4, 0x8b, 0x80, 0x8d, 0x20, 0x88, 0x5d, 0x20, 0x88, 0x90, 0x22, 0x9d, 0x9d, 0xa0, 0x85, 0x58, 0xeb, 0x7, 0x88, 0xe0, 0x7, 0x58, 0x8b, 0x36, 0x5a, 0x88, 0xa0, 0xa5, 0x85, 0xa5, 0x60, 0x61, 0xb0, 0x70, 0xb2, 0xef, 0x8d, 0x44, 0x41, 0x21, 0x1f, 0x20, 0x6c, 0xf2, 0x2c, 0xcc, 0xc2, 0x12, 0x92, 0x8d, 0x45, 0xbc, 0xe5, 0xdc, 0xb9, 0x67, 0xee, 0xbc, 0x19, 0xe0, 0xbf, 0xe5, 0xbd, 0x2f, 0x35, 0x9b, 0xcd, 0x29, 0x0, 0x10, 0x91, 0x9a, 0x88, 0x7c, 0x88, 0xc8, 0xa7, 0x88, 0xd4, 0x0, 0x80, 0xb2, 0xc2, 0xcc, 0x5c, 0x21, 0xa2, 0x5b, 0x22, 0xba, 0xef, 0x76, 0xbb, 0x97, 0x44, 0x74, 0x4a, 0x44, 0x61, 0xdf, 0xfe, 0x32, 0xc6, 0x4c, 0x87, 0x59, 0x0, 0x0, 0xdf, 0x0, 0x62, 0x55, 0xad, 0x6, 0x41, 0x50, 0x1d, 0xf0, 0x62, 0x0, 0x8, 0xb2, 0xd2, 0xd6, 0xda, 0x27, 0x0, 0x27, 0x83, 0xeb, 0xaa, 0x1a, 0x3, 0xd8, 0x19, 0xb, 0x60, 0xe6, 0x3a, 0x80, 0x6d, 0x0, 0xd, 0x0, 0x9d, 0x14, 0x60, 0xcb, 0x18, 0x73, 0x95, 0x9, 0x60, 0xe6, 0x3a, 0x11, 0x1d, 0xc7, 0x71, 0xbc, 0x6e, 0x8c, 0x39, 0x53, 0xd5, 0xdd, 0xc4, 0xcb, 0xe5, 0x72, 0x1b, 0xc9, 0x60, 0x87, 0x2, 0xd2, 0xe1, 0x62, 0xb1, 0xf8, 0xec, 0xbd, 0x2f, 0x11, 0xd1, 0x51, 0xaf, 0xd7, 0x3b, 0x0, 0xd0, 0x51, 0xd5, 0x95, 0x42, 0xa1, 0x30, 0x3b, 0xf2, 0x64, 0x11, 0x79, 0x77, 0xce, 0x95, 0x81, 0xdf, 0x67, 0x14, 0x91, 0x76, 0xff, 0x3a, 0x60, 0xe6, 0x45, 0x66, 0xae, 0xc, 0xd, 0x47, 0x51, 0xb4, 0x29, 0x22, 0xed, 0x56, 0xab, 0xb5, 0xd0, 0xdf, 0x3c, 0xe7, 0xbd, 0x7f, 0x8b, 0xa2, 0xa8, 0x31, 0x7a, 0x52, 0x93, 0x8, 0x8b, 0xc8, 0x72, 0xba, 0xb6, 0x73, 0xae, 0x9c, 0xae, 0x9d, 0xa5, 0x0, 0x0, 0x88, 0x68, 0xd, 0xc0, 0x8b, 0xaa, 0xbe, 0x3a, 0xe7, 0xca, 0x61, 0x18, 0xde, 0xa9, 0xea, 0xbe, 0xb5, 0xf6, 0x7c, 0x1c, 0x20, 0xf9, 0x89, 0x4b, 0x0, 0x56, 0xf3, 0xf9, 0xfc, 0xd, 0x80, 0x79, 0x55, 0xdd, 0xb3, 0xd6, 0x5e, 0x8c, 0xad, 0x9e, 0x0, 0x54, 0x75, 0x86, 0x88, 0xae, 0x1, 0x3c, 0x2, 0x38, 0x34, 0xc6, 0x3c, 0xfc, 0x25, 0x3c, 0x11, 0xfd, 0x0, 0x28, 0x54, 0xbb, 0xfe, 0xad, 0x99, 0xe5, 0xb8, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char icon_play_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,0xa2,0x49,0x44,0x41,0x54,0x38,0x8d,0x63,0x60,0x18,0xf2,0x80,0x11,0x99,0xf3,0xe0,0xc1,0x83,0xc3,0xc,0xc,0xc,0xc2,0xc,0xc,0xc,0xa5,0xa,0xa,0xa,0x5b,0xc9,0x31,0xe0,0x3f,0x5c,0x82,0x91,0x71,0x27,0x3,0x3,0x43,0x91,0xbc,0xbc,0xfc,0x35,0x7c,0x6,0x30,0xe1,0x92,0xf8,0xff,0xff,0xbf,0xfb,0xff,0xff,0xff,0x2f,0x3e,0x78,0xf0,0x60,0xca,0x93,0x27,0x4f,0x84,0x49,0x76,0x1,0x1a,0xf8,0xc0,0xc8,0xc8,0xd8,0xf1,0xeb,0xd7,0xaf,0x9,0xaa,0xaa,0xaa,0x3f,0x89,0x72,0x1,0x1a,0x10,0xf8,0xff,0xff,0x7f,0x7,0x2b,0x2b,0xeb,0x1e,0x74,0x9,0x62,0xd,0xc0,0x9,0x88,0x35,0xe0,0x3d,0x23,0x23,0x63,0xc5,0xef,0xdf,0xbf,0x5d,0xd0,0x25,0x58,0x8,0x68,0xfc,0xc3,0xc0,0xc0,0x30,0x93,0x85,0x85,0xa5,0x5e,0x46,0x46,0xe6,0x2d,0x36,0x5,0x38,0xd,0x20,0x36,0x1a,0xd1,0xd,0x38,0xc2,0x0,0x4d,0x48,0xf2,0xf2,0xf2,0x44,0x25,0xa4,0x61,0x0,0x0,0x1e,0x57,0x33,0x3c,0xcc,0xe7,0x34,0x69,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char icon_folder_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, 0x5f, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xed, 0x8f, 0xc1, 0xd, 0x80, 0x30, 0x8, 0x45, 0x9f, 0x9d, 0x84, 0x39, 0x4c, 0x3b, 0xbd, 0x75, 0x8f, 0x32, 0x9, 0x5e, 0xec, 0xa5, 0x9, 0xa4, 0xc6, 0x26, 0x5e, 0x7c, 0x17, 0xe, 0xc0, 0xe3, 0x3, 0x5f, 0xb3, 0x1, 0xb4, 0xd6, 0x4e, 0x60, 0x77, 0x66, 0xaa, 0x88, 0x14, 0x4f, 0x90, 0xee, 0xea, 0x2d, 0x3, 0xe4, 0x28, 0x41, 0x8a, 0x9a, 0x1d, 0x55, 0x75, 0x25, 0xfd, 0x5, 0x9b, 0x11, 0xd, 0x54, 0x11, 0x29, 0x53, 0x9, 0x1c, 0x32, 0x4c, 0xbe, 0x10, 0xf1, 0xb, 0x16, 0xa, 0xea, 0xd3, 0x45, 0x33, 0x3b, 0xde, 0x1e, 0x5f, 0xc3, 0x5, 0x1f, 0xc5, 0x12, 0x2c, 0xc5, 0x88, 0xe1, 0xb4, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char icon_reload_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x1,0x59,0x49,0x44,0x41,0x54,0x38,0x8d,0xcd,0x92,0x31,0x4b,0x3,0x31,0x18,0x86,0x9f,0x5c,0xe,0xec,0x20,0x76,0x70,0x39,0xd0,0xe3,0xba,0x74,0x51,0x41,0xdd,0xfc,0x7,0xba,0xb8,0x8,0x52,0xec,0x2e,0x4e,0x3a,0x88,0x3f,0xa3,0xa3,0x53,0x7,0x47,0x67,0x41,0x17,0xdd,0x9c,0x5c,0x3b,0xd8,0x82,0x64,0x68,0xca,0xd5,0x55,0x11,0x3c,0x1a,0x87,0x24,0x2e,0xd7,0x72,0x9e,0x9e,0xab,0xbe,0xd3,0xc7,0x1b,0x9e,0x37,0xf9,0xbe,0x7c,0xf0,0xd7,0x12,0x3f,0x99,0x4a,0xa9,0xb9,0x30,0xc,0x8f,0x84,0x10,0x7,0xc0,0x5a,0x6e,0x3f,0x3a,0xe7,0x2e,0xad,0xb5,0xdd,0x66,0xb3,0xf9,0x51,0x19,0x90,0xa6,0xe9,0x92,0xb5,0xf6,0x6,0x58,0xaf,0xb8,0xb4,0x27,0xa5,0xdc,0x8d,0xe3,0xf8,0x19,0x20,0x28,0xdf,0x5c,0x80,0x53,0x60,0xdf,0x18,0x53,0x37,0xc6,0xd4,0xbd,0xf7,0x7b,0xc0,0x13,0xb0,0x61,0xad,0xbd,0x56,0x4a,0xcd,0x1,0x84,0xc5,0x80,0x30,0xc,0x8f,0xa6,0xb0,0x94,0x72,0x33,0x8e,0xe3,0x97,0xc2,0xf1,0xd5,0x68,0x34,0xba,0xf7,0xde,0xf7,0x80,0xd,0x29,0xe5,0x21,0x70,0xfe,0xe5,0x5,0x42,0x88,0x76,0x5e,0x9e,0x96,0x60,0x0,0x92,0x24,0x79,0x75,0xce,0x9d,0x1,0x4,0x41,0xd0,0xfe,0xd6,0x2,0xb0,0x2,0x60,0x8c,0xb9,0xab,0xe8,0x1f,0x6b,0xed,0x6d,0x5e,0xae,0xce,0x2,0xb4,0xd6,0x17,0x5a,0x6b,0x7,0xcc,0x3,0xd4,0x6a,0xb5,0x37,0xad,0xf5,0xc5,0x4f,0x1,0x41,0x10,0x7c,0x19,0x7c,0x90,0x3,0xc7,0xc0,0xa0,0xe0,0xf,0x72,0xef,0x9b,0x84,0x10,0xdb,0x79,0xd9,0x9f,0x5,0x44,0x51,0x94,0x9,0x21,0x5a,0x40,0x6,0x64,0x42,0x88,0x56,0x14,0x45,0x59,0x19,0x1e,0x8f,0xc7,0x8b,0x52,0xca,0xe,0x80,0x73,0xee,0x12,0xa,0xbf,0x90,0x24,0x49,0x7f,0x38,0x1c,0x1e,0x3,0x34,0x1a,0x8d,0x7e,0x11,0x54,0x4a,0x2d,0x48,0x29,0x77,0xac,0xb5,0x1d,0xef,0xfd,0x32,0xd0,0x9b,0x4c,0x26,0x5d,0xa8,0xd8,0xc4,0xb2,0xf2,0xf9,0x4c,0x55,0xbd,0x48,0xbf,0xe8,0x1d,0x78,0x70,0xce,0x9d,0x64,0x59,0xb6,0x35,0x85,0xff,0x87,0x3e,0x1,0x53,0x7,0x87,0x11,0xd3,0x3a,0x9b,0x9e,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char icon_play_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, 0xa2, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x63, 0x60, 0x18, 0xf2, 0x80, 0x11, 0x99, 0xf3, 0xe0, 0xc1, 0x83, 0xc3, 0xc, 0xc, 0xc, 0xc2, 0xc, 0xc, 0xc, 0xa5, 0xa, 0xa, 0xa, 0x5b, 0xc9, 0x31, 0xe0, 0x3f, 0x5c, 0x82, 0x91, 0x71, 0x27, 0x3, 0x3, 0x43, 0x91, 0xbc, 0xbc, 0xfc, 0x35, 0x7c, 0x6, 0x30, 0xe1, 0x92, 0xf8, 0xff, 0xff, 0xbf, 0xfb, 0xff, 0xff, 0xff, 0x2f, 0x3e, 0x78, 0xf0, 0x60, 0xca, 0x93, 0x27, 0x4f, 0x84, 0x49, 0x76, 0x1, 0x1a, 0xf8, 0xc0, 0xc8, 0xc8, 0xd8, 0xf1, 0xeb, 0xd7, 0xaf, 0x9, 0xaa, 0xaa, 0xaa, 0x3f, 0x89, 0x72, 0x1, 0x1a, 0x10, 0xf8, 0xff, 0xff, 0x7f, 0x7, 0x2b, 0x2b, 0xeb, 0x1e, 0x74, 0x9, 0x62, 0xd, 0xc0, 0x9, 0x88, 0x35, 0xe0, 0x3d, 0x23, 0x23, 0x63, 0xc5, 0xef, 0xdf, 0xbf, 0x5d, 0xd0, 0x25, 0x58, 0x8, 0x68, 0xfc, 0xc3, 0xc0, 0xc0, 0x30, 0x93, 0x85, 0x85, 0xa5, 0x5e, 0x46, 0x46, 0xe6, 0x2d, 0x36, 0x5, 0x38, 0xd, 0x20, 0x36, 0x1a, 0xd1, 0xd, 0x38, 0xc2, 0x0, 0x4d, 0x48, 0xf2, 0xf2, 0xf2, 0x44, 0x25, 0xa4, 0x61, 0x0, 0x0, 0x1e, 0x57, 0x33, 0x3c, 0xcc, 0xe7, 0x34, 0x69, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char icon_snap_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,0xc2,0x49,0x44,0x41,0x54,0x38,0x8d,0xad,0x90,0xbd,0xa,0xc2,0x30,0x14,0x85,0xbf,0x5b,0x5c,0x23,0xe8,0x6c,0x9f,0xc1,0xb7,0xd0,0x47,0xd1,0x47,0x70,0x48,0xa1,0x43,0x57,0xe9,0xd3,0x88,0x93,0xef,0xe0,0xea,0x5c,0x9d,0x1d,0xb2,0x96,0xc6,0xa1,0x9,0xd4,0xd8,0xd8,0x4a,0xfd,0x20,0x10,0xee,0xcf,0xe1,0xdc,0x3,0x1d,0x8c,0x31,0xd6,0x18,0x63,0x9,0x88,0xd5,0x1,0x92,0xbe,0xe2,0x2f,0x4c,0x16,0x90,0x98,0xb5,0x21,0x94,0x52,0xf2,0x17,0x7,0x6f,0x7c,0xb,0x2b,0xc6,0x64,0x7,0xb3,0xa1,0x1,0x5b,0x14,0x29,0x50,0x2,0x1b,0x0,0x44,0x2e,0x34,0xcd,0x41,0xb2,0xec,0x6,0x20,0xdd,0x61,0x6f,0xdf,0x7,0xe4,0x96,0xaf,0xc0,0x32,0xd0,0x7d,0x2,0x6b,0xd1,0xba,0x4a,0xfc,0xdd,0x91,0xdb,0x4b,0xb7,0x7c,0x2,0x56,0xd4,0x75,0xa,0x9c,0x81,0x5,0x70,0x84,0xe1,0xc,0x5a,0xdb,0x75,0xbd,0x17,0xad,0x1f,0x92,0xe7,0x77,0x60,0xe7,0x7a,0x5b,0x80,0x44,0x29,0x25,0xfe,0xf5,0x8,0x28,0x0,0xb7,0xd8,0x46,0xa0,0x75,0xe5,0xbe,0xf3,0x31,0xe,0x7e,0x23,0xcc,0xc2,0x3a,0xc2,0xb9,0x58,0xfd,0x83,0xc9,0x2,0x63,0x78,0x1,0x4a,0x50,0x70,0x86,0xcc,0x86,0x2,0x4,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char icon_reload_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x6, 0x0, 0x0, 0x0, 0x1f, 0xf3, 0xff, 0x61, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x1, 0x59, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xcd, 0x92, 0x31, 0x4b, 0x3, 0x31, 0x18, 0x86, 0x9f, 0x5c, 0xe, 0xec, 0x20, 0x76, 0x70, 0x39, 0xd0, 0xe3, 0xba, 0x74, 0x51, 0x41, 0xdd, 0xfc, 0x7, 0xba, 0xb8, 0x8, 0x52, 0xec, 0x2e, 0x4e, 0x3a, 0x88, 0x3f, 0xa3, 0xa3, 0x53, 0x7, 0x47, 0x67, 0x41, 0x17, 0xdd, 0x9c, 0x5c, 0x3b, 0xd8, 0x82, 0x64, 0x68, 0xca, 0xd5, 0x55, 0x11, 0x3c, 0x1a, 0x87, 0x24, 0x2e, 0xd7, 0x72, 0x9e, 0x9e, 0xab, 0xbe, 0xd3, 0xc7, 0x1b, 0x9e, 0x37, 0xf9, 0xbe, 0x7c, 0xf0, 0xd7, 0x12, 0x3f, 0x99, 0x4a, 0xa9, 0xb9, 0x30, 0xc, 0x8f, 0x84, 0x10, 0x7, 0xc0, 0x5a, 0x6e, 0x3f, 0x3a, 0xe7, 0x2e, 0xad, 0xb5, 0xdd, 0x66, 0xb3, 0xf9, 0x51, 0x19, 0x90, 0xa6, 0xe9, 0x92, 0xb5, 0xf6, 0x6, 0x58, 0xaf, 0xb8, 0xb4, 0x27, 0xa5, 0xdc, 0x8d, 0xe3, 0xf8, 0x19, 0x20, 0x28, 0xdf, 0x5c, 0x80, 0x53, 0x60, 0xdf, 0x18, 0x53, 0x37, 0xc6, 0xd4, 0xbd, 0xf7, 0x7b, 0xc0, 0x13, 0xb0, 0x61, 0xad, 0xbd, 0x56, 0x4a, 0xcd, 0x1, 0x84, 0xc5, 0x80, 0x30, 0xc, 0x8f, 0xa6, 0xb0, 0x94, 0x72, 0x33, 0x8e, 0xe3, 0x97, 0xc2, 0xf1, 0xd5, 0x68, 0x34, 0xba, 0xf7, 0xde, 0xf7, 0x80, 0xd, 0x29, 0xe5, 0x21, 0x70, 0xfe, 0xe5, 0x5, 0x42, 0x88, 0x76, 0x5e, 0x9e, 0x96, 0x60, 0x0, 0x92, 0x24, 0x79, 0x75, 0xce, 0x9d, 0x1, 0x4, 0x41, 0xd0, 0xfe, 0xd6, 0x2, 0xb0, 0x2, 0x60, 0x8c, 0xb9, 0xab, 0xe8, 0x1f, 0x6b, 0xed, 0x6d, 0x5e, 0xae, 0xce, 0x2, 0xb4, 0xd6, 0x17, 0x5a, 0x6b, 0x7, 0xcc, 0x3, 0xd4, 0x6a, 0xb5, 0x37, 0xad, 0xf5, 0xc5, 0x4f, 0x1, 0x41, 0x10, 0x7c, 0x19, 0x7c, 0x90, 0x3, 0xc7, 0xc0, 0xa0, 0xe0, 0xf, 0x72, 0xef, 0x9b, 0x84, 0x10, 0xdb, 0x79, 0xd9, 0x9f, 0x5, 0x44, 0x51, 0x94, 0x9, 0x21, 0x5a, 0x40, 0x6, 0x64, 0x42, 0x88, 0x56, 0x14, 0x45, 0x59, 0x19, 0x1e, 0x8f, 0xc7, 0x8b, 0x52, 0xca, 0xe, 0x80, 0x73, 0xee, 0x12, 0xa, 0xbf, 0x90, 0x24, 0x49, 0x7f, 0x38, 0x1c, 0x1e, 0x3, 0x34, 0x1a, 0x8d, 0x7e, 0x11, 0x54, 0x4a, 0x2d, 0x48, 0x29, 0x77, 0xac, 0xb5, 0x1d, 0xef, 0xfd, 0x32, 0xd0, 0x9b, 0x4c, 0x26, 0x5d, 0xa8, 0xd8, 0xc4, 0xb2, 0xf2, 0xf9, 0x4c, 0x55, 0xbd, 0x48, 0xbf, 0xe8, 0x1d, 0x78, 0x70, 0xce, 0x9d, 0x64, 0x59, 0xb6, 0x35, 0x85, 0xff, 0x87, 0x3e, 0x1, 0x53, 0x7, 0x87, 0x11, 0xd3, 0x3a, 0x9b, 0x9e, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char icon_stop_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x4,0x0,0x0,0x0,0xb5,0xfa,0x37,0xea,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,0x2,0x62,0x4b,0x47,0x44,0x0,0xff,0x87,0x8f,0xcc,0xbf,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x2b,0x49,0x44,0x41,0x54,0x28,0xcf,0x63,0x60,0x20,0xc,0x3e,0x30,0xe3,0x93,0x61,0x64,0x60,0x60,0x60,0x78,0xf8,0x1f,0xbb,0x2,0x79,0x46,0x6,0x6,0x26,0x42,0xe6,0x8f,0x2a,0xa0,0x96,0x2,0x6,0x42,0x91,0x45,0x10,0x0,0x0,0x95,0x31,0x5,0xe4,0xe,0x1,0x8e,0x3,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 icon_snap_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, 0xc2, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xad, 0x90, 0xbd, 0xa, 0xc2, 0x30, 0x14, 0x85, 0xbf, 0x5b, 0x5c, 0x23, 0xe8, 0x6c, 0x9f, 0xc1, 0xb7, 0xd0, 0x47, 0xd1, 0x47, 0x70, 0x48, 0xa1, 0x43, 0x57, 0xe9, 0xd3, 0x88, 0x93, 0xef, 0xe0, 0xea, 0x5c, 0x9d, 0x1d, 0xb2, 0x96, 0xc6, 0xa1, 0x9, 0xd4, 0xd8, 0xd8, 0x4a, 0xfd, 0x20, 0x10, 0xee, 0xcf, 0xe1, 0xdc, 0x3, 0x1d, 0x8c, 0x31, 0xd6, 0x18, 0x63, 0x9, 0x88, 0xd5, 0x1, 0x92, 0xbe, 0xe2, 0x2f, 0x4c, 0x16, 0x90, 0x98, 0xb5, 0x21, 0x94, 0x52, 0xf2, 0x17, 0x7, 0x6f, 0x7c, 0xb, 0x2b, 0xc6, 0x64, 0x7, 0xb3, 0xa1, 0x1, 0x5b, 0x14, 0x29, 0x50, 0x2, 0x1b, 0x0, 0x44, 0x2e, 0x34, 0xcd, 0x41, 0xb2, 0xec, 0x6, 0x20, 0xdd, 0x61, 0x6f, 0xdf, 0x7, 0xe4, 0x96, 0xaf, 0xc0, 0x32, 0xd0, 0x7d, 0x2, 0x6b, 0xd1, 0xba, 0x4a, 0xfc, 0xdd, 0x91, 0xdb, 0x4b, 0xb7, 0x7c, 0x2, 0x56, 0xd4, 0x75, 0xa, 0x9c, 0x81, 0x5, 0x70, 0x84, 0xe1, 0xc, 0x5a, 0xdb, 0x75, 0xbd, 0x17, 0xad, 0x1f, 0x92, 0xe7, 0x77, 0x60, 0xe7, 0x7a, 0x5b, 0x80, 0x44, 0x29, 0x25, 0xfe, 0xf5, 0x8, 0x28, 0x0, 0xb7, 0xd8, 0x46, 0xa0, 0x75, 0xe5, 0xbe, 0xf3, 0x31, 0xe, 0x7e, 0x23, 0xcc, 0xc2, 0x3a, 0xc2, 0xb9, 0x58, 0xfd, 0x83, 0xc9, 0x2, 0x63, 0x78, 0x1, 0x4a, 0x50, 0x70, 0x86, 0xcc, 0x86, 0x2, 0x4, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char icon_zoom_less_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,0x25,0x49,0x44,0x41,0x54,0x38,0x8d,0x63,0x60,0x18,0x5,0xc3,0x0,0x30,0x32,0x30,0x30,0x30,0x3c,0x78,0xf0,0xe0,0x3f,0x39,0x9a,0x15,0x14,0x14,0x18,0x99,0xa8,0xeb,0x9e,0x51,0x30,0x44,0x1,0x0,0xff,0xa9,0x4,0x4,0x4a,0xae,0x20,0xfa,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char icon_stop_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 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, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x2b, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x63, 0x60, 0x20, 0xc, 0x3e, 0x30, 0xe3, 0x93, 0x61, 0x64, 0x60, 0x60, 0x60, 0x78, 0xf8, 0x1f, 0xbb, 0x2, 0x79, 0x46, 0x6, 0x6, 0x26, 0x42, 0xe6, 0x8f, 0x2a, 0xa0, 0x96, 0x2, 0x6, 0x42, 0x91, 0x45, 0x10, 0x0, 0x0, 0x95, 0x31, 0x5, 0xe4, 0xe, 0x1, 0x8e, 0x3, 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 icon_zoom_more_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,0x36,0x49,0x44,0x41,0x54,0x38,0x8d,0x63,0x60,0xa0,0x25,0x78,0xf0,0xe0,0xc1,0xff,0x7,0xf,0x1e,0xfc,0xc7,0xa7,0x86,0x89,0x52,0x4b,0x46,0xd,0x60,0x60,0x60,0x64,0x60,0x80,0x84,0x36,0x39,0x9a,0x15,0x14,0x14,0x18,0x29,0x76,0x1,0x5e,0x30,0x9a,0xe,0xe8,0x64,0x0,0xc5,0x0,0x0,0xc7,0x6e,0x12,0x94,0xf9,0x26,0x2e,0xdb,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char icon_zoom_less_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, 0x25, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x63, 0x60, 0x18, 0x5, 0xc3, 0x0, 0x30, 0x32, 0x30, 0x30, 0x30, 0x3c, 0x78, 0xf0, 0xe0, 0x3f, 0x39, 0x9a, 0x15, 0x14, 0x14, 0x18, 0x99, 0xa8, 0xeb, 0x9e, 0x51, 0x30, 0x44, 0x1, 0x0, 0xff, 0xa9, 0x4, 0x4, 0x4a, 0xae, 0x20, 0xfa, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char icon_zoom_reset_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,0xdd,0x91,0xbb,0xd,0x80,0x30,0x10,0x43,0x1f,0x11,0x23,0x20,0xea,0x4c,0xc5,0x62,0x48,0xec,0xc0,0x56,0x97,0x26,0x43,0xa4,0x31,0x15,0x12,0x45,0x72,0x8a,0x14,0xa,0x84,0xab,0xfb,0x58,0x3e,0xeb,0xc,0x83,0x98,0xee,0x22,0xa5,0xb4,0x49,0x3a,0x1,0x62,0x8c,0x53,0x8d,0x5c,0xe3,0x4,0x80,0x9c,0xf3,0x22,0x69,0xf7,0x2e,0xb5,0x38,0x1,0xa0,0x94,0x72,0x0,0xab,0x27,0xd0,0xc3,0xc1,0xcc,0x64,0x66,0x6a,0xf5,0xb5,0x59,0x70,0x15,0x3b,0x30,0x7b,0xcb,0xd6,0x33,0x9f,0x18,0x76,0xf0,0x71,0x81,0x5a,0xa,0xaf,0x3b,0xf8,0x41,0xa,0xc3,0xb8,0x0,0x6c,0x9c,0x3f,0xb8,0x84,0xfc,0x5b,0x85,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char icon_zoom_more_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, 0x36, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x63, 0x60, 0xa0, 0x25, 0x78, 0xf0, 0xe0, 0xc1, 0xff, 0x7, 0xf, 0x1e, 0xfc, 0xc7, 0xa7, 0x86, 0x89, 0x52, 0x4b, 0x46, 0xd, 0x60, 0x60, 0x60, 0x64, 0x60, 0x80, 0x84, 0x36, 0x39, 0x9a, 0x15, 0x14, 0x14, 0x18, 0x29, 0x76, 0x1, 0x5e, 0x30, 0x9a, 0xe, 0xe8, 0x64, 0x0, 0xc5, 0x0, 0x0, 0xc7, 0x6e, 0x12, 0x94, 0xf9, 0x26, 0x2e, 0xdb, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char line_edit_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xa,0x0,0x0,0x0,0xa,0x4,0x3,0x0,0x0,0x0,0x7f,0x1c,0xd2,0x8e,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,0x2a,0x50,0x4c,0x54,0x45,0x17,0x16,0x1a,0x1d,0x1c,0x21,0x20,0x1e,0x24,0x21,0x1f,0x25,0x1d,0x1c,0x21,0x20,0x1e,0x24,0x1d,0x1c,0x21,0x1d,0x1c,0x21,0x24,0x22,0x29,0x28,0x26,0x2d,0x28,0x26,0x2e,0x2b,0x2a,0x31,0x2c,0x2a,0x32,0xff,0xff,0xff,0xb9,0x11,0x56,0x3e,0x0,0x0,0x0,0x8,0x74,0x52,0x4e,0x53,0x6f,0xef,0xf7,0xf7,0xf0,0xf9,0xf1,0xee,0xcf,0x21,0xd2,0xdf,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xd,0xf6,0xb4,0x61,0xf5,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x2d,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x54,0x36,0x36,0x12,0x60,0xf0,0x98,0xb5,0x6a,0x65,0xb,0x43,0xe4,0x9e,0x33,0xa7,0xa7,0x32,0x58,0x9d,0x39,0x73,0x66,0x31,0x16,0x12,0x22,0xb,0x52,0xd9,0xc6,0xc0,0x2,0xd4,0x55,0x0,0x0,0xc,0x14,0x1a,0x90,0x55,0x1a,0xec,0xdb,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 icon_zoom_reset_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, 0xdd, 0x91, 0xbb, 0xd, 0x80, 0x30, 0x10, 0x43, 0x1f, 0x11, 0x23, 0x20, 0xea, 0x4c, 0xc5, 0x62, 0x48, 0xec, 0xc0, 0x56, 0x97, 0x26, 0x43, 0xa4, 0x31, 0x15, 0x12, 0x45, 0x72, 0x8a, 0x14, 0xa, 0x84, 0xab, 0xfb, 0x58, 0x3e, 0xeb, 0xc, 0x83, 0x98, 0xee, 0x22, 0xa5, 0xb4, 0x49, 0x3a, 0x1, 0x62, 0x8c, 0x53, 0x8d, 0x5c, 0xe3, 0x4, 0x80, 0x9c, 0xf3, 0x22, 0x69, 0xf7, 0x2e, 0xb5, 0x38, 0x1, 0xa0, 0x94, 0x72, 0x0, 0xab, 0x27, 0xd0, 0xc3, 0xc1, 0xcc, 0x64, 0x66, 0x6a, 0xf5, 0xb5, 0x59, 0x70, 0x15, 0x3b, 0x30, 0x7b, 0xcb, 0xd6, 0x33, 0x9f, 0x18, 0x76, 0xf0, 0x71, 0x81, 0x5a, 0xa, 0xaf, 0x3b, 0xf8, 0x41, 0xa, 0xc3, 0xb8, 0x0, 0x6c, 0x9c, 0x3f, 0xb8, 0x84, 0xfc, 0x5b, 0x85, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char line_edit_disabled_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xa,0x0,0x0,0x0,0xa,0x8,0x4,0x0,0x0,0x0,0x27,0x3b,0x7,0x36,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,0x2,0x62,0x4b,0x47,0x44,0x0,0xff,0x87,0x8f,0xcc,0xbf,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,0x64,0x49,0x44,0x41,0x54,0x8,0xd7,0x95,0xce,0x31,0x12,0x2,0x21,0x10,0x44,0xd1,0x3f,0x40,0xa1,0x44,0xa6,0x46,0xde,0x63,0x4f,0xe5,0x15,0x38,0xb2,0xd6,0x6,0xb0,0xc8,0x30,0x6,0x96,0xac,0x56,0x99,0xf8,0xb3,0x7e,0x51,0xcb,0xf9,0x1a,0xb3,0x3f,0xa,0xaf,0xc,0xad,0x2d,0xcb,0xe5,0x76,0x38,0x5,0x76,0xec,0x6c,0xf7,0xe0,0x53,0xe0,0x13,0xa1,0x27,0x27,0x43,0x26,0x81,0x20,0xc8,0x70,0xfc,0xe8,0xf,0x34,0x67,0xd8,0x9c,0x86,0x61,0x2e,0x68,0xe9,0x91,0xaf,0x4b,0x5a,0x7d,0x2a,0x2c,0x3,0xed,0xef,0x1e,0x6b,0xcb,0x4f,0xa6,0x66,0x2b,0x25,0x6,0x1,0x37,0x40,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 line_edit_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0xa, 0x4, 0x3, 0x0, 0x0, 0x0, 0x7f, 0x1c, 0xd2, 0x8e, 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, 0x2a, 0x50, 0x4c, 0x54, 0x45, 0x17, 0x16, 0x1a, 0x1d, 0x1c, 0x21, 0x20, 0x1e, 0x24, 0x21, 0x1f, 0x25, 0x1d, 0x1c, 0x21, 0x20, 0x1e, 0x24, 0x1d, 0x1c, 0x21, 0x1d, 0x1c, 0x21, 0x24, 0x22, 0x29, 0x28, 0x26, 0x2d, 0x28, 0x26, 0x2e, 0x2b, 0x2a, 0x31, 0x2c, 0x2a, 0x32, 0xff, 0xff, 0xff, 0xb9, 0x11, 0x56, 0x3e, 0x0, 0x0, 0x0, 0x8, 0x74, 0x52, 0x4e, 0x53, 0x6f, 0xef, 0xf7, 0xf7, 0xf0, 0xf9, 0xf1, 0xee, 0xcf, 0x21, 0xd2, 0xdf, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xd, 0xf6, 0xb4, 0x61, 0xf5, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x2d, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x54, 0x36, 0x36, 0x12, 0x60, 0xf0, 0x98, 0xb5, 0x6a, 0x65, 0xb, 0x43, 0xe4, 0x9e, 0x33, 0xa7, 0xa7, 0x32, 0x58, 0x9d, 0x39, 0x73, 0x66, 0x31, 0x16, 0x12, 0x22, 0xb, 0x52, 0xd9, 0xc6, 0xc0, 0x2, 0xd4, 0x55, 0x0, 0x0, 0xc, 0x14, 0x1a, 0x90, 0x55, 0x1a, 0xec, 0xdb, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 line_edit_focus_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,0xab,0x50,0x4c,0x54,0x45,0x1b,0x17,0x18,0x1b,0x17,0x18,0x1b,0x17,0x18,0xc8,0x68,0x12,0xef,0xed,0xe7,0xef,0xed,0xe8,0xf0,0xed,0xe8,0xf0,0xee,0xe8,0xf0,0xed,0xe7,0xed,0xeb,0xe5,0xee,0xeb,0xe5,0xee,0xeb,0xe6,0xec,0xe9,0xe3,0xeb,0xe9,0xe3,0xeb,0xe9,0xe2,0xec,0xe9,0xe2,0xe9,0xe6,0xe0,0xea,0xe7,0xe0,0xea,0xe7,0xe1,0xe8,0xe4,0xdd,0xe8,0xe5,0xde,0xe8,0xe5,0xdd,0xe8,0xe4,0xde,0xe6,0xe2,0xdb,0xe6,0xe3,0xdb,0xe6,0xe3,0xdc,0xe7,0xe2,0xdb,0xe7,0xe3,0xdb,0xe4,0xe0,0xd8,0xe5,0xe0,0xd8,0xe5,0xe1,0xd9,0xe5,0xe0,0xd9,0xe4,0xe1,0xd9,0xe5,0xe1,0xd8,0xe4,0xe0,0xd9,0xe2,0xdf,0xd6,0xe3,0xdf,0xd6,0xe3,0xde,0xd6,0xe2,0xde,0xd6,0xe1,0xdc,0xd4,0xe1,0xdc,0xd3,0xe0,0xdc,0xd3,0xe1,0xdd,0xd3,0xe1,0xdd,0xd4,0xdf,0xda,0xd0,0xdf,0xda,0xd1,0xdf,0xdb,0xd1,0xe0,0xda,0xd1,0xdd,0xd8,0xcf,0xdd,0xd8,0xce,0xde,0xd9,0xce,0xde,0xd8,0xce,0xdd,0xd9,0xce,0xdc,0xd6,0xcc,0xdb,0xd6,0xcc,0xdc,0xd6,0xcb,0xff,0xff,0xff,0x73,0x72,0x65,0x6f,0x0,0x0,0x0,0x2,0x74,0x52,0x4e,0x53,0x36,0x61,0xc5,0x3a,0xd,0x83,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x38,0xa0,0x7,0xa5,0xd6,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,0x9e,0x49,0x44,0x41,0x54,0x18,0xd3,0x5d,0xcf,0xdb,0x16,0x82,0x20,0x10,0x85,0x61,0xb4,0xb4,0x13,0x1d,0x28,0x14,0xcb,0x4a,0x33,0xf,0x59,0x52,0x98,0x62,0xef,0xff,0x66,0xd1,0xf6,0xca,0xfe,0x19,0xd6,0x62,0x7d,0x77,0x43,0x88,0x3d,0x88,0x10,0x7b,0x34,0xc8,0x36,0x30,0x76,0x1c,0x77,0xe2,0x3a,0xee,0xd4,0x7c,0x0,0xb3,0x79,0x3f,0xa6,0x5,0x80,0xa2,0x25,0xa5,0xab,0x35,0x5,0x6c,0x18,0x63,0x5b,0xd6,0x7,0xd8,0x71,0xcf,0xe3,0x9c,0xfb,0x9c,0x7b,0x3e,0x40,0x4,0xfb,0xe0,0x10,0x84,0xa1,0x8,0x85,0x0,0x1c,0x4f,0xe7,0x28,0xbe,0x44,0x71,0x9c,0x24,0x67,0xc0,0x35,0x4d,0xb3,0x2c,0xcb,0xcd,0x4b,0x73,0x40,0x71,0x33,0x15,0xe5,0xfd,0x51,0x16,0x25,0xa0,0x92,0xf2,0xf9,0x92,0xbf,0x2a,0x9,0x50,0xaa,0x56,0xef,0x46,0xb5,0x4d,0x5b,0x37,0x0,0xdd,0x7d,0xb4,0x36,0xdb,0x69,0xad,0x1,0x7f,0xc7,0x59,0xc3,0xf3,0xad,0x2f,0x30,0x4f,0x11,0x50,0x3e,0x12,0x48,0xdb,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 line_edit_disabled_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0xa, 0x8, 0x4, 0x0, 0x0, 0x0, 0x27, 0x3b, 0x7, 0x36, 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, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 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, 0x64, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x95, 0xce, 0x31, 0x12, 0x2, 0x21, 0x10, 0x44, 0xd1, 0x3f, 0x40, 0xa1, 0x44, 0xa6, 0x46, 0xde, 0x63, 0x4f, 0xe5, 0x15, 0x38, 0xb2, 0xd6, 0x6, 0xb0, 0xc8, 0x30, 0x6, 0x96, 0xac, 0x56, 0x99, 0xf8, 0xb3, 0x7e, 0x51, 0xcb, 0xf9, 0x1a, 0xb3, 0x3f, 0xa, 0xaf, 0xc, 0xad, 0x2d, 0xcb, 0xe5, 0x76, 0x38, 0x5, 0x76, 0xec, 0x6c, 0xf7, 0xe0, 0x53, 0xe0, 0x13, 0xa1, 0x27, 0x27, 0x43, 0x26, 0x81, 0x20, 0xc8, 0x70, 0xfc, 0xe8, 0xf, 0x34, 0x67, 0xd8, 0x9c, 0x86, 0x61, 0x2e, 0x68, 0xe9, 0x91, 0xaf, 0x4b, 0x5a, 0x7d, 0x2a, 0x2c, 0x3, 0xed, 0xef, 0x1e, 0x6b, 0xcb, 0x4f, 0xa6, 0x66, 0x2b, 0x25, 0x6, 0x1, 0x37, 0x40, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 logo_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x80,0x0,0x0,0x0,0x80,0x8,0x6,0x0,0x0,0x0,0xc3,0x3e,0x61,0xcb,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,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x2e,0x23,0x0,0x0,0x2e,0x23,0x1,0x78,0xa5,0x3f,0x76,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xdc,0x9,0x7,0x13,0x2,0x0,0x15,0xb9,0x53,0x97,0x0,0x0,0x21,0x58,0x49,0x44,0x41,0x54,0x78,0xda,0xed,0x7d,0x79,0x9c,0x1c,0x55,0xb5,0xff,0xf7,0x7b,0xab,0x7b,0x66,0x48,0x8,0x61,0xd1,0x90,0xb0,0x88,0x91,0x27,0x24,0x24,0x21,0x3b,0x8,0x4,0x42,0x58,0x54,0xe0,0x91,0x80,0x24,0x1,0x2,0x9,0x42,0x80,0x4,0x11,0x90,0x9f,0xf2,0xd3,0xa7,0xcf,0xe7,0xf3,0x3d,0x1f,0x1f,0x7f,0xea,0xd3,0x48,0x4c,0x8,0x61,0xd,0x49,0x64,0x89,0x82,0x40,0x58,0x4,0x64,0xb,0x44,0x25,0x9b,0xd9,0x51,0x14,0x41,0x3,0xc8,0x16,0x20,0xfb,0x4c,0x77,0xdd,0xef,0xef,0x8f,0xaa,0xea,0xae,0xee,0xa9,0xea,0x9e,0xee,0xae,0x99,0xe9,0xe0,0x9c,0xf9,0xd4,0x74,0xd5,0xad,0x5b,0x77,0x39,0xe7,0xdc,0x7b,0xcf,0x39,0xf7,0xdc,0x7b,0x81,0x2e,0xe8,0x82,0x2e,0xe8,0x82,0x2e,0xe8,0x82,0x2e,0xe8,0x82,0x2e,0xe8,0x82,0x2e,0xf8,0xe7,0x2,0x76,0x76,0x1,0xea,0x1,0xe,0xff,0xc2,0xcc,0xbd,0x60,0x5b,0x6e,0xb6,0xd6,0xf6,0x2,0xb8,0x8d,0xc6,0x6c,0x36,0x34,0x6f,0x81,0x7c,0x43,0x30,0x7f,0x27,0xcd,0xdf,0x8c,0xe3,0x6c,0xda,0x70,0xef,0xf4,0x37,0x3b,0xbb,0xac,0x49,0x43,0xaa,0xb3,0xb,0x50,0xf,0x20,0x9b,0xfd,0x96,0xcd,0xb6,0x4c,0x40,0xd0,0x20,0x2c,0xac,0x4b,0xb3,0x3,0xc0,0x36,0x80,0x5b,0x41,0x6c,0x75,0x5b,0xb8,0xed,0xb0,0x71,0xff,0xbb,0x83,0xc6,0x6c,0x26,0x9d,0x65,0x74,0xd2,0x4f,0x6e,0x5c,0x74,0xc5,0xba,0xce,0x2e,0x7b,0xad,0xf0,0x4f,0xdf,0x3,0xf4,0x9f,0x38,0xb7,0x5b,0x76,0xd7,0x7,0x2f,0xcb,0xda,0x3,0xc8,0x42,0x94,0x48,0x6a,0x15,0x9f,0x24,0x0,0xbe,0x43,0xe3,0xfc,0xc1,0x49,0x37,0x4d,0xdd,0xf8,0x8b,0x2b,0xff,0xde,0xd9,0x75,0xa8,0x5,0x76,0x2b,0x6,0xe8,0x37,0x7e,0xf6,0x18,0xeb,0xb6,0x9c,0x6,0x69,0xf,0x1a,0xf3,0xc1,0x1f,0xef,0xbb,0xe6,0xdb,0xb5,0xa4,0x37,0xf2,0x9a,0xa5,0xdc,0xb2,0x69,0xe5,0x69,0xca,0xec,0xf8,0xa5,0xa4,0x26,0x48,0xf2,0x29,0x8c,0x82,0x7b,0x40,0x3e,0xae,0xfc,0x5f,0x41,0x82,0x4d,0x37,0xf5,0x18,0xb7,0xd7,0xc1,0xc3,0x1f,0xfe,0xfd,0x4f,0x3e,0xa3,0x2a,0x8b,0xd0,0xe9,0x50,0xf7,0xc,0x70,0xf8,0x39,0xb3,0x3e,0x9,0xb9,0xa7,0x48,0xf6,0x70,0xb9,0xd9,0xd1,0x90,0x3b,0xd2,0x2b,0x39,0x9b,0x4d,0xaa,0x69,0xfa,0x1f,0xef,0xbb,0xfa,0x8e,0x5a,0xd2,0x3f,0x6c,0xdc,0x8f,0x9f,0x91,0xcd,0x8c,0x2,0xe9,0xe4,0x43,0x3,0x7a,0xc7,0x80,0x4,0x80,0xbb,0x9c,0x74,0xd3,0x77,0xdd,0xcc,0xce,0x1f,0xbc,0xfc,0xd0,0xd7,0x6d,0x67,0xe3,0xa9,0x5a,0xa8,0x5b,0x19,0xa0,0xdf,0xf8,0xd9,0x47,0x42,0xee,0x51,0x72,0x5b,0x3e,0x6b,0xdd,0xcc,0x69,0x0,0xf6,0xf4,0x8,0xe3,0x75,0xc3,0x92,0x1a,0x6d,0x66,0xd7,0x8f,0xfa,0x8d,0x9f,0xf5,0xe7,0x97,0x7e,0x71,0xe5,0xf3,0x55,0xe5,0x31,0xe1,0xc6,0x83,0xdc,0x5d,0x5b,0x46,0x3,0x7e,0xb3,0xce,0x51,0xbd,0x74,0xbb,0xf0,0x9b,0xbb,0x23,0xd9,0x23,0x59,0xf7,0x4d,0xa8,0x34,0xd4,0x1d,0x3,0xf4,0x3b,0x67,0xf6,0x20,0xc0,0x1d,0x65,0xb3,0xcd,0x67,0xc9,0xcd,0x9c,0xa,0x9f,0x1a,0xfe,0xd8,0x5b,0xd0,0x15,0xb,0xda,0xcf,0x66,0x9a,0x7f,0xd8,0x7f,0xc2,0x9c,0xb1,0x1b,0x17,0x4d,0x7f,0xa7,0x92,0x7c,0xe,0xff,0xc2,0xd,0x69,0x58,0x77,0x1c,0x40,0x17,0x84,0x3,0x54,0x48,0x4a,0xd2,0x91,0x75,0x7,0x38,0x4d,0x7b,0xef,0xd6,0x2c,0x50,0x37,0xc,0xd0,0x7f,0xc2,0x8d,0x7,0x3,0x1a,0x65,0x33,0xcd,0x97,0x58,0x9b,0x3d,0x5,0x0,0x40,0xe6,0x5a,0xa6,0x82,0x47,0xbf,0x13,0x0,0x21,0x82,0x90,0xdc,0xcf,0xc8,0x66,0xbe,0xd6,0x6f,0xfc,0xac,0xef,0xbc,0xf4,0x8b,0x2b,0x77,0xb5,0x35,0x3f,0x93,0x6a,0xb4,0x36,0xb3,0xe3,0x7c,0x1a,0xe3,0x8f,0xe9,0xe1,0x21,0x3f,0x4,0xe1,0xd1,0x40,0x80,0x24,0xd1,0x90,0x10,0x8c,0x64,0xf,0x31,0xa9,0xa6,0x2e,0x6,0x48,0x2,0x64,0xb3,0xdf,0xb0,0xd9,0xe6,0x2f,0x1,0x41,0x6b,0xf7,0x9,0x2f,0x91,0x1e,0x23,0x78,0x40,0x9f,0x8,0x34,0x41,0x90,0x75,0x33,0xbb,0xfe,0xaf,0xd3,0xd0,0x7d,0xd9,0x61,0xe3,0x7e,0x78,0xdf,0x9f,0x1e,0xb8,0x2e,0x72,0x3c,0x1e,0x30,0xe9,0xce,0x94,0xdb,0xb2,0x7d,0x1f,0xd2,0xf4,0x0,0x6c,0x1a,0xb2,0xbd,0x65,0xdd,0xcf,0x0,0x30,0x0,0x41,0x42,0x91,0xbd,0x0,0xb,0xef,0x49,0x52,0x9e,0x7a,0x40,0x48,0x7b,0xee,0x6,0x62,0x54,0x49,0xa8,0x1b,0x6,0xb0,0xd9,0xcc,0x39,0x7e,0x6b,0xb,0xda,0x5c,0xa8,0xeb,0x2f,0x4,0x7a,0x81,0x41,0x3c,0x3,0x10,0x36,0xbb,0xeb,0xc7,0x4e,0x43,0x8f,0xd7,0xfa,0x4f,0xb8,0x71,0x3,0x68,0xf6,0x7,0xb0,0x37,0x81,0x34,0x8,0xca,0xda,0x46,0xb7,0x65,0xeb,0x27,0x20,0x3b,0xd8,0x75,0xdd,0xbe,0x4,0xf6,0x83,0x74,0x30,0x80,0x40,0xf0,0x53,0x25,0x43,0x0,0xfd,0xff,0x22,0xad,0xcd,0xee,0xac,0x59,0x3,0xe8,0x7f,0xee,0x2d,0xdd,0x36,0xde,0x73,0xe9,0x8e,0xce,0xc0,0x7b,0xdd,0x30,0x0,0x8d,0xf3,0xb2,0xac,0x3e,0xe,0xc0,0x20,0x4e,0xc,0xf,0xc8,0x1e,0x3c,0xf9,0x8a,0x3a,0x49,0x40,0xf6,0x60,0xeb,0xb6,0xfc,0x1f,0xd2,0xac,0xb3,0xb6,0xf9,0x24,0x78,0xad,0xbb,0x9b,0x17,0xb5,0x90,0x46,0xca,0x25,0x46,0x85,0x52,0x8e,0xcb,0xa7,0x30,0xdc,0x4a,0xa0,0x21,0xe8,0x7d,0xed,0x36,0x6f,0xad,0x89,0x1,0x8e,0x38,0x77,0x6e,0x5f,0xeb,0xb6,0x9c,0xde,0x7f,0xc2,0x9c,0xe7,0x36,0x2e,0x9a,0xbe,0xb6,0xc3,0xf1,0xde,0xd1,0x19,0xc6,0x41,0xff,0x9,0xb3,0xbf,0x67,0x33,0xcd,0x5f,0x96,0x6c,0xcf,0x70,0xab,0x8f,0xa3,0x43,0x41,0xb8,0x4,0x90,0x16,0x80,0x41,0xd8,0x78,0x43,0x6,0xef,0x8a,0xf4,0x7a,0x9,0xf2,0xfa,0x7d,0xff,0xb1,0x40,0x0,0x60,0x51,0xde,0xc5,0xf9,0x11,0x39,0x23,0x51,0xd6,0x69,0xdc,0xf3,0x18,0xc9,0xbe,0x61,0x9c,0x86,0xad,0x1b,0xee,0x9e,0xba,0xb5,0xad,0xf5,0x3d,0xe2,0xbc,0x5b,0xbb,0xc1,0xba,0x9f,0xc8,0x66,0xb6,0x2f,0x86,0x74,0x28,0x80,0xb7,0x4d,0xba,0xdb,0xb9,0xc6,0x38,0x4b,0x37,0xdc,0x73,0x59,0x4b,0x47,0xe1,0xbd,0x6e,0x18,0xa0,0xdf,0x84,0x39,0xa7,0x2b,0xb3,0x73,0x2e,0xa0,0x3,0x81,0x60,0x9c,0x6f,0x73,0xb7,0x1c,0xc8,0xb,0x20,0xf3,0xad,0x3a,0xf4,0x9c,0x78,0x3d,0x95,0x37,0x13,0x92,0xc6,0xf9,0xb,0x9d,0xf4,0x22,0x63,0x52,0xb7,0x3,0x78,0x3d,0xdb,0xbc,0x6d,0xe7,0x9f,0x1e,0xf8,0x6a,0xac,0x6d,0xa0,0xff,0x84,0x39,0xfb,0x4b,0xee,0x14,0x9b,0x69,0xfe,0x41,0x90,0x9a,0x2f,0x5b,0xc0,0xa4,0x9b,0xfe,0xcd,0x18,0xe7,0x96,0xd,0xf7,0x4e,0x7f,0xb7,0x23,0xf0,0x5e,0x37,0xc,0xd0,0xff,0xdc,0x9b,0x3f,0x65,0x5b,0xb6,0x3f,0x21,0xd9,0x4f,0x41,0x8,0x24,0xed,0xb6,0x95,0x56,0x65,0xde,0x25,0x55,0x53,0x3f,0xad,0x9c,0x26,0xe0,0x3f,0x14,0xf4,0x1e,0x26,0x75,0x3f,0x9d,0x86,0x9f,0xd2,0x49,0xaf,0xec,0xd1,0xfb,0x88,0x6d,0xc5,0x56,0xc2,0xfe,0x13,0x6f,0x3a,0xcc,0x66,0x9b,0xe7,0x40,0xee,0x18,0x0,0x5e,0xaf,0x15,0x24,0x3,0x8,0x24,0x8d,0xd3,0x70,0x13,0x4c,0xea,0xfb,0x1b,0xef,0x9d,0xf6,0x6a,0x7b,0xe3,0xdd,0xb4,0x77,0x6,0x6d,0x85,0x8d,0xf7,0x5c,0xf6,0xa,0x69,0x9a,0x3d,0x51,0x3b,0xc0,0x26,0xfd,0xb,0xa5,0x9,0x58,0xaa,0xa3,0x28,0xf7,0x6d,0x25,0xe0,0xa7,0x95,0x27,0x3e,0x94,0xcf,0xc0,0xd3,0x26,0xad,0x9b,0x3d,0xdb,0x6d,0xd9,0xf1,0x8c,0x6d,0xd9,0xfe,0xdc,0x96,0xd7,0x57,0x9f,0x11,0xfe,0xfc,0x88,0x73,0xe7,0x9e,0xec,0xb6,0xec,0xd8,0x28,0xeb,0x8e,0xf1,0xbe,0xf5,0xf1,0x2f,0x88,0xa0,0xcf,0x48,0xb4,0xd6,0x6d,0x99,0x66,0xb3,0x2d,0xf3,0xfb,0x4f,0x9c,0x7b,0x5c,0x7b,0xe3,0xbd,0x6e,0x7a,0x0,0x0,0xe8,0x77,0xce,0xcf,0x9e,0xb3,0x6e,0xe6,0x78,0x20,0x5a,0xfa,0xaf,0x3f,0x8,0x86,0x81,0x7c,0x61,0xfd,0x91,0x41,0x64,0xa0,0x5a,0x38,0x2b,0x4c,0xba,0xf1,0x3b,0x4,0x7a,0x66,0x5b,0x76,0x2c,0xf4,0xf8,0xbb,0xd5,0xb0,0x54,0xd0,0x4f,0x5,0x6a,0x26,0x8d,0x79,0x8d,0x4e,0xd3,0xbf,0xbd,0xb4,0x68,0xda,0x5d,0xed,0x55,0x3,0xa7,0xf6,0x24,0x92,0x83,0x8f,0xf,0x1c,0x9b,0x2,0x34,0x9c,0x40,0x8f,0x78,0xcb,0x4c,0x3d,0x41,0xd0,0x45,0xf9,0xe0,0xcb,0x2d,0xbe,0xd5,0x92,0x14,0x24,0xa2,0xb7,0x6c,0x76,0x82,0xac,0x7b,0x16,0x29,0x27,0x50,0x21,0x1,0x85,0xba,0xba,0x5c,0x37,0xe2,0xdb,0xbb,0x72,0x36,0xb0,0xbd,0x61,0xdd,0x13,0xf7,0x3f,0xf2,0xec,0x96,0x77,0xd6,0x2f,0xfe,0x5d,0x7b,0xd4,0xa0,0x6e,0x86,0x0,0xaf,0x34,0xce,0x12,0x0,0xef,0x7b,0xf7,0x86,0xf9,0x21,0x60,0x37,0xb9,0x8c,0xf1,0x94,0xc3,0x80,0x71,0x69,0x40,0xd2,0x90,0x6c,0x0,0xd4,0x0,0x18,0x79,0x17,0x8,0x18,0x45,0xa4,0xe1,0x31,0x81,0x31,0xfe,0x7b,0x3,0x40,0xfb,0x65,0x33,0xbb,0xbe,0xde,0x6f,0xc2,0x9c,0xaf,0xb4,0x7,0xca,0xeb,0xa6,0x7,0xe8,0x3f,0x71,0xee,0x4,0x4f,0x38,0x52,0x3f,0xf8,0xb6,0x9e,0xd0,0xe8,0xba,0xfb,0x5c,0x44,0xae,0xfd,0xe7,0xee,0x1,0xbf,0x67,0x80,0x7f,0x11,0xa1,0x77,0x45,0xdf,0x93,0xa1,0x74,0x82,0x1e,0x61,0x4f,0xca,0xe,0xea,0x35,0xe8,0x2c,0xe7,0x9d,0xf5,0x8b,0x97,0x26,0x89,0xf7,0xba,0x30,0x4,0xf5,0x9f,0x78,0xd3,0x2c,0x9b,0xdd,0x75,0x36,0xa0,0x3e,0xde,0x18,0x69,0x24,0x28,0x6c,0x0,0xde,0x1d,0x81,0x31,0xf7,0x6d,0x6,0x6f,0x14,0xf4,0x70,0x21,0xb0,0x1b,0xc8,0xee,0x49,0x17,0xb2,0xd3,0x19,0xe0,0xf0,0x73,0x66,0x3d,0xad,0x6c,0xcb,0x48,0x0,0xdd,0xbd,0x39,0x1e,0xdf,0x74,0x53,0xef,0xc3,0x7f,0x87,0x40,0xce,0xe4,0xd,0x1a,0x67,0xb5,0x71,0xd2,0xd7,0x27,0x9d,0x43,0x62,0xc,0x70,0xc4,0xb9,0x73,0x7f,0x24,0x61,0x1b,0x8d,0xf3,0xd3,0xd,0x77,0x4f,0x7d,0xbf,0x5c,0xfc,0x81,0x93,0xee,0xd8,0x23,0xdb,0xb2,0xe3,0x31,0xd9,0xec,0x9,0x5e,0x3f,0x97,0x13,0x80,0xbb,0x88,0xef,0x83,0x6f,0xc0,0x24,0xe9,0xbc,0x63,0x9c,0xf4,0xe2,0x75,0x3f,0xbf,0x38,0x71,0xb,0x61,0x22,0x98,0x3e,0xe2,0xbc,0x5b,0x47,0xd8,0xcc,0xce,0x7,0x25,0x75,0xa3,0x71,0xd6,0x80,0xe6,0x75,0xd2,0xfc,0x99,0xc6,0x99,0xb7,0xe1,0xee,0xa9,0x7f,0x2e,0x8e,0xdf,0xff,0xdc,0x5b,0xe,0x95,0xdb,0x72,0x87,0x6c,0x76,0x14,0xe9,0xab,0xc2,0x5e,0x4d,0xe1,0x49,0xc7,0x51,0xc5,0x8c,0x33,0xb9,0x87,0xe7,0x85,0x54,0xe2,0x9b,0x62,0x3,0x6f,0xb9,0xb4,0x63,0xb5,0xb4,0x88,0xf0,0xa8,0xef,0x2a,0x29,0x6f,0xeb,0x6f,0x72,0xbe,0x67,0x0,0x41,0xe7,0x91,0x74,0xd3,0x9e,0xe3,0xd7,0x2e,0x98,0xb2,0xb3,0x1a,0xfa,0x94,0x82,0x9a,0x19,0xe0,0x88,0xf3,0xe7,0xf5,0x50,0x76,0xc7,0xc3,0xb2,0xee,0x71,0x80,0x42,0x5a,0x85,0xd9,0x42,0x63,0xd6,0x80,0xce,0x4a,0x1a,0xe7,0x77,0x26,0x95,0x7e,0x74,0xdd,0x82,0x29,0x1f,0x1c,0x71,0xfe,0x6d,0x43,0x6c,0x66,0xd7,0x4d,0x90,0x7b,0x54,0xa8,0x18,0xc2,0x6e,0x3e,0xe0,0x27,0xa,0xca,0xd9,0x1c,0x9,0x3a,0xaf,0x9a,0x54,0xc3,0xbf,0x6f,0xb8,0xfb,0xd2,0x85,0xed,0x91,0x55,0xcd,0x43,0x80,0xdc,0xe6,0x1f,0xcb,0xba,0xbe,0xf1,0xc6,0x84,0xed,0xf0,0x7b,0xc9,0xba,0xa3,0x0,0x77,0x94,0xac,0x73,0x86,0xac,0x3b,0xae,0xff,0xc4,0xb9,0x7f,0x57,0xb6,0x79,0x38,0x64,0x8f,0xf2,0x6c,0xf4,0xb9,0x7e,0xdf,0x17,0xf8,0xca,0xb5,0xe0,0xb6,0x98,0xf5,0x2b,0x69,0x95,0xc5,0x3e,0x9f,0xe1,0xfb,0x72,0x71,0xdb,0x52,0xd6,0xf0,0x77,0x71,0xe5,0x2c,0xec,0x11,0x3c,0xe9,0x97,0xb9,0xf9,0x26,0x1a,0xe7,0xa9,0xc6,0x6e,0x3d,0xef,0xa9,0x95,0x4e,0x71,0x50,0x53,0xab,0x1b,0x70,0xfe,0x6d,0x5f,0xb0,0x99,0x9d,0xbf,0x90,0x37,0x8b,0x9f,0xa3,0x62,0x48,0x82,0x97,0x82,0x3c,0xa,0x3c,0xee,0x68,0x25,0x85,0xad,0xfd,0x5d,0xad,0x3f,0x4,0x9e,0x25,0x90,0x34,0x4e,0xea,0x45,0x3a,0xd,0xd7,0xad,0xbf,0xeb,0xe2,0xe7,0xda,0x2b,0xaf,0xaa,0x7b,0x80,0x81,0x93,0xee,0x38,0xd8,0xcd,0xec,0xfc,0xbe,0x2,0xa3,0x95,0xef,0x58,0xc5,0x90,0xff,0x4e,0xce,0x98,0x27,0x8,0x26,0x4f,0x64,0x8f,0xf8,0x7e,0xb7,0x5f,0xcd,0x5c,0x5d,0x12,0xf3,0x7b,0xd5,0xb0,0x5e,0xa9,0x6f,0x8a,0x1c,0xc7,0x2b,0xae,0x47,0xe1,0x77,0xde,0x9d,0x71,0xee,0x69,0x4f,0xe2,0x3,0x55,0x5a,0x2,0x7,0x4c,0x9a,0xd7,0x60,0x6d,0xf6,0x5a,0x59,0xfb,0x69,0x7f,0xf2,0xc6,0x9b,0x5d,0x2f,0x12,0xdf,0x73,0xcf,0x45,0xe3,0xbb,0x37,0xe7,0x91,0x73,0xac,0xa9,0x1c,0x2a,0xfc,0x46,0x2a,0xe8,0x9f,0x15,0xfc,0x13,0x50,0xe0,0x3e,0x20,0x95,0x49,0xa8,0xd4,0xc4,0x12,0x8b,0x7e,0x2b,0xad,0x7,0x8b,0x5f,0x30,0x5e,0x8e,0x4c,0x10,0x2a,0x66,0x80,0x81,0x17,0xce,0x77,0x20,0x3b,0xda,0x66,0x5b,0xae,0xcd,0x9b,0xc1,0xc3,0x53,0x76,0x9d,0x7b,0x29,0x34,0x43,0xe7,0xdf,0xfb,0x73,0xed,0x1e,0x81,0x25,0xd0,0x37,0x34,0xe4,0xae,0xe0,0x1d,0xa3,0x6d,0x73,0xf2,0xd3,0xca,0xdd,0xb7,0xff,0xe5,0x33,0xa9,0xdc,0x2f,0xc,0x98,0x74,0xc7,0xf1,0xed,0xc9,0x0,0x15,0xb7,0xbf,0x41,0x17,0xce,0xef,0x93,0x6d,0xd9,0xf9,0x0,0xac,0x3b,0xd2,0xeb,0xc0,0xe3,0x54,0xb7,0x4a,0x8a,0x50,0x4a,0x65,0x2,0x4a,0xb,0x5c,0x39,0xc8,0x77,0xa2,0xa,0xd4,0xa7,0x82,0xb4,0x3e,0x0,0xf9,0x3e,0x80,0x6d,0x0,0x76,0x92,0xdc,0x5,0xd2,0x42,0x8,0xe4,0x91,0x14,0x80,0x26,0x9,0xdd,0x20,0xbb,0xf,0xa0,0x5e,0x90,0x6f,0x2a,0x67,0x4c,0x1e,0x35,0x6b,0x2e,0x11,0xf5,0x93,0xe7,0x13,0x0,0xc2,0x42,0x32,0x34,0xce,0x93,0x26,0xd5,0x78,0xd9,0xba,0x85,0x17,0xbd,0x5a,0x5b,0x5e,0xa5,0x4b,0xd0,0x26,0x18,0x7c,0xc5,0x33,0xcc,0x7e,0xf8,0xea,0x19,0x36,0xb3,0xf3,0x21,0x0,0x16,0x81,0x12,0x1f,0xae,0x8a,0xe2,0x13,0x2d,0x18,0xf2,0x22,0x4,0xe7,0x3c,0xef,0x7,0xe6,0xaf,0xfc,0x87,0xad,0xc8,0xee,0x8b,0x1d,0xa,0xd6,0x8a,0x84,0xe6,0x66,0xfd,0x98,0x2d,0x34,0xce,0x3f,0x24,0xbc,0x4d,0x9a,0x4d,0x30,0x66,0x1d,0xc0,0x97,0x48,0xfe,0x15,0xe0,0x3b,0x20,0xdf,0x23,0xd4,0xec,0x5a,0x65,0xd2,0xe9,0x86,0x46,0xeb,0x66,0xba,0x1,0xd8,0xd7,0x5a,0xdb,0x7,0xd2,0x0,0xc9,0x8e,0x24,0x74,0xb0,0xa4,0x8f,0x1,0x3a,0x0,0xb2,0xfb,0x86,0xab,0xc2,0x90,0xcf,0x7a,0x1,0x33,0xa8,0x75,0x7d,0xa,0xe4,0xfd,0x8,0x33,0x40,0x41,0x13,0xa,0x3b,0xc6,0x7a,0x35,0xb2,0x74,0x1a,0xe6,0x34,0xef,0xdc,0x7e,0xd5,0x5f,0x1e,0xb8,0x3a,0xf1,0x15,0x48,0x15,0x9,0x81,0xee,0x96,0xbf,0xd,0x92,0xdb,0xf2,0x7d,0x80,0xa0,0x6f,0xb0,0xf7,0xb0,0x9f,0x9b,0xb7,0x40,0xde,0x23,0xab,0x88,0x82,0xb9,0xa7,0xd0,0xff,0x1c,0xc5,0x43,0x2c,0xc3,0xa8,0xc6,0xdb,0x2a,0x2c,0xb0,0x93,0x4,0x62,0x86,0xfc,0x29,0x78,0x80,0x7c,0xf,0x30,0x9b,0x4,0xb3,0x96,0x4e,0x6a,0x71,0x3a,0xd5,0xf0,0xe0,0xea,0x3b,0x27,0x95,0x33,0xa0,0xb4,0x0,0xd8,0xa,0xe0,0x2d,0x0,0x1b,0x1,0x3c,0x15,0xbc,0x18,0x30,0xe9,0xce,0x7e,0xb2,0x99,0x89,0x80,0x8e,0x83,0xec,0xa1,0x92,0x3d,0x8,0x42,0x63,0xa0,0xc1,0x7a,0x79,0x2a,0x50,0x79,0x42,0x66,0xcc,0xbc,0xab,0x40,0x58,0xd,0xca,0xd7,0x3b,0xa8,0x17,0xfc,0x70,0xbf,0x4a,0xfe,0xa,0x88,0xc0,0x30,0x26,0xc1,0x48,0xee,0x99,0x4d,0xdd,0xf7,0x5a,0xe,0xe0,0xf6,0xa4,0x19,0xa0,0xa2,0x1e,0x60,0xe0,0x5,0x77,0x9e,0xea,0x66,0x76,0x3e,0x26,0xc9,0x84,0xb1,0xdf,0x91,0x10,0xb2,0x15,0xcb,0xd7,0x32,0x7c,0xe,0xe0,0xfb,0x24,0xdf,0xa2,0x49,0xdd,0x6c,0x1c,0x67,0xf6,0xda,0x5,0x53,0xda,0xbc,0x48,0xa4,0xad,0x30,0x60,0xd2,0xbc,0x43,0x21,0xf7,0xbb,0x92,0x1d,0x29,0xeb,0x7e,0x2,0x52,0x93,0xbf,0x4c,0x2d,0xd4,0x10,0x12,0xad,0x6b,0xde,0xa7,0x91,0xce,0x12,0xa6,0xf6,0x38,0x75,0xfd,0xc2,0xb,0x9a,0x93,0xcc,0xa3,0x32,0x6,0x98,0x7c,0x57,0xa3,0xcd,0x36,0x9f,0x23,0xb7,0xe5,0x4e,0x40,0x4e,0xe0,0x80,0xd9,0x51,0xf6,0xfb,0x80,0xf8,0x61,0x84,0x4b,0xd8,0x49,0x60,0x87,0x49,0x37,0x7e,0x7b,0xdd,0xc2,0x8b,0x6e,0x6c,0xf7,0x42,0x0,0x18,0x30,0xf9,0xee,0x94,0x32,0xdb,0xe7,0xca,0xba,0xa7,0x1,0xda,0x3f,0xb7,0x78,0x25,0xef,0x26,0x98,0x38,0x42,0x24,0xb9,0x34,0xa9,0x7b,0x36,0xdc,0x3d,0xf5,0x82,0x24,0xd3,0xad,0x5c,0x8,0x9c,0xbc,0x70,0xf,0xeb,0x66,0x2f,0xb3,0xd9,0xe6,0x19,0xf0,0xc7,0x5b,0x4f,0x14,0xc8,0x69,0x57,0x25,0xd2,0x2c,0x67,0x15,0xb,0xc7,0x29,0xf2,0xe5,0xf7,0xa7,0x46,0xe1,0x59,0x19,0xe1,0x79,0xd2,0x3a,0x5b,0x61,0x9c,0xdb,0x68,0x52,0x5f,0x5f,0xbf,0x70,0x72,0x87,0xb9,0x52,0x7,0x30,0x70,0xf2,0xcf,0xbb,0xb9,0x2d,0xdb,0x97,0x41,0xb6,0x2f,0xc0,0x3d,0x2,0xe7,0x64,0x32,0xf0,0x48,0xe,0x44,0xa4,0x52,0xe,0xe6,0xc5,0x78,0x88,0x14,0x72,0x25,0x89,0xa0,0x59,0xed,0xa4,0x1a,0x3f,0xb7,0x6e,0xe1,0x94,0xb7,0xc2,0x2f,0x47,0x5e,0xb3,0x94,0x3b,0xdf,0x7b,0xc5,0xd0,0x69,0xa0,0xcd,0x6c,0x27,0x4d,0x9a,0x0,0xdd,0x75,0xb,0x2e,0x70,0xcb,0xd5,0xa1,0x2a,0x2e,0x1d,0x34,0xf9,0xe7,0x7b,0x58,0xb7,0xe5,0xdb,0x36,0xdb,0xf2,0x75,0x2,0x26,0x34,0xf0,0x33,0x69,0x57,0xae,0x70,0x97,0xf,0x8f,0xf8,0x2,0x0,0x63,0xcc,0x66,0xa6,0x1a,0xc7,0xae,0x5b,0x30,0x39,0x51,0x7,0x89,0x6a,0x60,0xc0,0xa4,0x79,0xd7,0xd9,0x6c,0xf3,0x37,0x0,0xed,0xcb,0xb0,0x47,0x50,0x72,0x26,0xab,0x80,0xe9,0x41,0x93,0x7a,0x7e,0xc3,0xdd,0x53,0x8f,0x1f,0x34,0xe5,0xee,0x46,0x9b,0x6d,0xa6,0x71,0x1a,0x9a,0x24,0xb7,0x2f,0xa4,0x8f,0x9,0xea,0x49,0xa0,0x87,0xa4,0x3,0x69,0x9c,0x17,0x20,0xf7,0xf9,0x75,0xb,0x2f,0xca,0x94,0x4a,0xbc,0xea,0xc2,0xd,0xbc,0x70,0x61,0x83,0x6c,0xf6,0xdf,0xe5,0xb6,0x7c,0x13,0x64,0xb0,0x20,0x23,0xbf,0xd8,0x22,0x49,0x8,0x98,0x4a,0x82,0xa4,0xac,0x71,0x52,0xcf,0x3b,0xd,0xdd,0xce,0x5e,0x33,0xef,0xbc,0xf,0x92,0xcf,0xac,0x5a,0x7c,0x2c,0x18,0x63,0xb3,0xbb,0xe6,0xc9,0xda,0x83,0x3d,0x43,0x17,0x3,0x49,0xbe,0xf6,0x6,0x91,0x5f,0xdc,0x2,0x1,0xbb,0x48,0xf3,0x1a,0xa4,0xde,0x80,0x7a,0x2,0x28,0xd2,0x81,0x82,0x7b,0xae,0x34,0xa9,0xc6,0xeb,0xd6,0x2d,0x9c,0xfc,0x54,0xa9,0xa4,0xab,0xf6,0x9,0x5c,0xb7,0xe0,0x82,0x16,0xa7,0xb1,0xfb,0x7f,0x99,0x54,0xe3,0x75,0x4,0xb2,0x8,0x69,0x33,0x89,0x9b,0x45,0x7c,0x24,0x90,0xcc,0x1a,0x27,0xfd,0xf0,0xfa,0xbb,0x2e,0x19,0x53,0x4f,0xc4,0xf7,0xf0,0x71,0xe1,0xd3,0x26,0xd5,0x78,0xa,0xe9,0x6c,0x40,0x41,0xd9,0x6b,0x77,0x6d,0x43,0xe1,0x6f,0x23,0x64,0xf,0x3,0xb4,0x17,0x8a,0xde,0x15,0xde,0x6b,0x88,0xa0,0x7f,0x29,0x57,0xee,0x9a,0x9c,0x42,0xd7,0xdc,0x3e,0x3e,0xeb,0x34,0x74,0x9f,0x69,0x52,0x4d,0x53,0x4,0xbe,0xdf,0x76,0x8b,0x60,0x18,0x4a,0x85,0x31,0xc7,0xd6,0x5e,0xbf,0x9f,0x7a,0x72,0xfd,0x5d,0x17,0x9f,0x95,0x18,0xd5,0x12,0x86,0x75,0xb,0x26,0xff,0xc9,0x34,0x34,0x9d,0x49,0xe3,0x2c,0xf7,0x2d,0x8e,0xfe,0xf0,0x15,0x26,0x63,0x31,0x59,0x4b,0x85,0x79,0xcf,0x7e,0x7,0x2b,0xd2,0xc8,0xf3,0x31,0xd,0x2e,0x8a,0x34,0xc1,0xd4,0x51,0x51,0x47,0x6c,0xc,0x81,0x4f,0x7e,0xea,0xc2,0x87,0x4a,0xf6,0x3e,0x35,0x7b,0x5,0xaf,0xbe,0xfd,0x9c,0x2c,0x53,0xd,0xf7,0x93,0xdc,0x51,0x64,0xa,0x29,0x1,0x51,0xcc,0x50,0x18,0x26,0xbf,0x1f,0x83,0xe7,0x2b,0x0,0xe3,0xa4,0x9f,0x6c,0x49,0xf7,0x3a,0xbd,0xdd,0xa8,0x97,0x10,0xac,0x9b,0x7f,0xc1,0x2b,0x26,0xd5,0x38,0x85,0xc6,0x59,0x82,0xfc,0xec,0x28,0xa2,0x99,0x1c,0x65,0xc2,0xf2,0xcf,0xcc,0xdb,0xa9,0xc3,0xef,0x99,0x7f,0x95,0x8b,0x27,0x4f,0x39,0x12,0xac,0xcd,0x9e,0xd7,0x9d,0x1f,0x4e,0x2c,0x55,0xde,0x44,0xdc,0xc2,0x6d,0x36,0xd3,0xf,0x40,0xda,0xa3,0x17,0x13,0x71,0xe7,0x26,0xd,0x5,0x58,0x6f,0x4a,0x3c,0xfd,0xa8,0x93,0x6e,0x1a,0xff,0xf2,0xbc,0xd3,0x77,0x8b,0xcd,0x98,0xd6,0xce,0xbf,0x60,0x23,0x4c,0x6a,0x16,0xe9,0xbc,0xec,0x4d,0x31,0x18,0xc9,0x53,0x97,0x6a,0xc6,0x4b,0x1b,0x2e,0x6,0xb3,0x6d,0x90,0xfa,0xca,0xaa,0x7f,0xfb,0x33,0x80,0x9b,0x99,0x1,0x70,0xdf,0x9a,0x13,0x2a,0x4,0x1,0x34,0x34,0xce,0x5a,0x9a,0xf4,0xd,0x6b,0xe6,0x9d,0xf7,0x61,0x7b,0x11,0xac,0x3d,0x60,0xfd,0xc2,0xc9,0xf7,0xc0,0xa4,0x6e,0x7,0xb9,0xcd,0xb7,0x57,0x75,0x98,0xd1,0x2c,0xbc,0x48,0x56,0x50,0x8f,0x52,0x71,0x6b,0x66,0x80,0x23,0xa7,0xdc,0xb5,0x17,0x60,0x87,0x92,0x48,0xe5,0xf5,0xde,0x44,0xc4,0x1e,0x92,0xdc,0x42,0x93,0x5a,0xb0,0x76,0xfe,0xa4,0xc7,0x3a,0xa,0x79,0x49,0x82,0x31,0xce,0x2c,0x9a,0xd4,0xbd,0xbe,0x8d,0x3a,0x98,0x25,0x69,0xf7,0x19,0xc5,0x80,0xf8,0xbe,0xf6,0x7c,0xe4,0xc0,0xc9,0xb,0x87,0xc4,0x96,0xb1,0x96,0xa,0x1e,0x7d,0xed,0xef,0x8,0x72,0x38,0x80,0xb4,0x97,0xa1,0xd7,0xcd,0xd5,0xd2,0x83,0xf9,0x5,0xf7,0x2a,0xe0,0xa4,0x1e,0x0,0x4d,0xe2,0xf6,0xef,0x8e,0x82,0xb5,0xf3,0x27,0x6d,0x31,0x4e,0xfa,0x36,0x18,0x67,0x29,0xfc,0x3e,0xd9,0x9f,0xe9,0xab,0xc,0x27,0x11,0xf7,0x88,0x9,0xf7,0x47,0x1,0xff,0x3f,0x1,0x6b,0x4f,0x80,0x74,0x76,0x5c,0x19,0x6b,0x62,0x80,0x6d,0xff,0xd8,0x48,0xeb,0x66,0xcf,0x25,0x4d,0xca,0x2f,0x51,0xcd,0xeb,0x79,0x7c,0x75,0x9f,0xa0,0x79,0x15,0x30,0xf7,0xaf,0x9b,0x3f,0xa9,0xa2,0xdd,0xbf,0xea,0xd,0xd6,0xde,0x79,0xfe,0xb,0x34,0xa9,0xc5,0x0,0x0,0x1a,0x11,0xac,0x58,0x31,0x64,0xc4,0x3d,0x63,0xc2,0x8b,0xf0,0x28,0x92,0xd,0x24,0xfa,0xc6,0x95,0xaf,0x26,0x6,0x58,0x7f,0xd7,0xc5,0x56,0x6e,0x76,0x2c,0xa0,0x34,0x69,0xc2,0x5b,0xaf,0x54,0x7e,0x91,0x81,0xe4,0xef,0xf5,0x22,0xc6,0x59,0x44,0x63,0x1e,0xef,0x6c,0x2,0x26,0x1,0xa4,0x59,0x4c,0x93,0x7a,0x12,0xfe,0x7e,0x46,0x28,0x35,0xc,0xb0,0xb6,0x6,0x54,0x98,0x16,0x82,0x6e,0xb5,0xf1,0xd3,0xe3,0xe7,0x46,0xd2,0xba,0x26,0x6,0x18,0x74,0xd1,0x3d,0x7d,0x41,0xf4,0xf6,0xc4,0x76,0x28,0xa7,0xf2,0x56,0x39,0xec,0xfb,0x92,0x3f,0x49,0xf3,0x16,0x8d,0xf3,0xd4,0xda,0x3b,0xcf,0xdf,0xde,0xd9,0xc4,0x4b,0x2,0xd6,0xde,0x79,0xfe,0x5a,0x3a,0xa9,0xf9,0x5e,0x25,0x73,0xe,0x1f,0x25,0xc4,0x9f,0xda,0x2f,0xcf,0xaf,0xc4,0x50,0x9e,0xf5,0xb4,0x67,0x63,0xb7,0x1e,0x7,0x46,0x95,0xad,0x6a,0x6,0x18,0x7c,0xc9,0xfd,0x29,0x59,0x3b,0xa,0xa0,0x4d,0xa2,0xe4,0x81,0x1,0x3,0x20,0x68,0x9c,0xf9,0x34,0xce,0x8a,0xce,0x26,0x5c,0xa2,0x40,0xf3,0x57,0xd2,0xbc,0x8b,0x76,0x76,0x9f,0xb,0x5c,0xe2,0xfc,0x1d,0x67,0xe0,0x73,0xc3,0xc1,0x10,0x3e,0x1d,0x55,0xac,0xaa,0x19,0x60,0xf5,0x6d,0x67,0x67,0x9,0x7d,0x26,0x34,0xd3,0x55,0x93,0x9a,0xc3,0xdc,0x46,0x4e,0x0,0x4d,0x6a,0xd9,0x9a,0x3b,0x26,0xee,0xd6,0x63,0x7f,0x31,0x18,0x63,0xd6,0x9b,0x54,0xc3,0x6c,0xff,0x51,0x91,0x5b,0x91,0xd7,0x0,0x85,0x3e,0x9,0x9e,0x22,0xe8,0xd,0xa5,0xe6,0x15,0x3a,0xa9,0xfb,0x49,0xf3,0x46,0xd4,0x77,0x6d,0xf6,0x8,0x1a,0x74,0xd1,0xdd,0x4d,0xa4,0xb3,0xbf,0xac,0xed,0x2b,0xe8,0x40,0x2,0x7b,0x43,0xee,0x98,0xdc,0x86,0x8d,0xc9,0xa8,0xb9,0x24,0xb9,0x9,0xe0,0xa6,0x24,0x91,0x53,0xf,0xb0,0xfa,0xf6,0x9,0x9b,0x7,0x7f,0x71,0xd1,0x43,0x0,0xfe,0x3,0x0,0x61,0x12,0x30,0xc1,0x84,0x26,0x80,0x48,0x12,0xb2,0xca,0xeb,0x1,0x7c,0x97,0xc6,0x79,0x96,0x74,0x16,0x64,0x65,0x16,0x6f,0xb8,0x73,0x42,0x36,0x2a,0x89,0x58,0x6,0x18,0x74,0xd1,0xbd,0x3d,0x21,0x1d,0xe,0xe8,0x40,0x90,0x7b,0x41,0xea,0x25,0x65,0x8f,0x90,0x75,0x8f,0x83,0xf4,0xe9,0x60,0xe1,0x7a,0x68,0x51,0x67,0xad,0x1e,0x31,0x9e,0x3b,0x21,0x53,0x33,0x4,0xac,0x69,0x2f,0x42,0x74,0x26,0x8,0xb0,0xa0,0x79,0x1f,0xd2,0x3e,0x9,0x35,0x97,0xc0,0x21,0xc7,0x73,0x8e,0x1,0x29,0x70,0x33,0xc9,0x55,0x34,0xa9,0x87,0x8c,0x93,0x9a,0xbf,0xfa,0xf6,0xf1,0x9b,0x4b,0x25,0x11,0xc9,0x0,0x83,0xbf,0xb8,0x68,0x7f,0x2b,0xf7,0x7c,0x59,0x77,0x3a,0x64,0xf,0x2f,0xcc,0x33,0xa7,0xb0,0x7b,0x4e,0xa,0xf0,0xf9,0xad,0xb6,0x1e,0x20,0x67,0x2c,0x37,0x8e,0xf3,0xfc,0x9a,0x3b,0x26,0x6e,0x4b,0x8,0xe7,0x75,0x5,0x92,0xb6,0x3,0xf8,0x33,0x80,0x91,0x40,0xa2,0xdb,0xd7,0x51,0xe0,0x3f,0xe8,0x38,0xaf,0x11,0xe6,0x41,0x90,0x3f,0x5d,0x3b,0xef,0xdc,0x36,0x9,0xd0,0x31,0x3d,0x80,0xc6,0xcb,0x75,0xbf,0x5,0xe8,0x63,0x60,0xd8,0xf1,0xb3,0xc0,0x41,0x23,0x34,0x3f,0xd1,0x26,0xb7,0xed,0x92,0x15,0xc8,0xff,0x7c,0x74,0xd7,0x86,0x93,0x7c,0x1b,0x26,0xf5,0x88,0x6c,0x76,0x24,0x22,0x5d,0xca,0x83,0xa0,0x72,0x4b,0x90,0x82,0x77,0xca,0xe1,0x8d,0x4e,0xfa,0x47,0xae,0xab,0x19,0x1b,0x16,0x9c,0x57,0xd6,0xb,0x28,0xc,0x91,0x3,0x91,0x80,0x5e,0x0,0x1a,0xbc,0x42,0x7b,0x53,0x8f,0x79,0xe9,0xd2,0x14,0x49,0xb1,0x40,0xe9,0xe7,0x8a,0x6c,0x1,0xbb,0x4,0x54,0x54,0x81,0xdd,0x9,0xd6,0xdc,0x31,0xe1,0x7d,0x1a,0xe7,0x49,0x1f,0x47,0x11,0xb6,0x80,0x0,0x8a,0x9f,0x11,0xf3,0x2e,0xf7,0xed,0x7,0x80,0xb9,0xad,0x52,0xe2,0x3,0x31,0x3d,0x80,0x64,0xf,0x0,0xb0,0x97,0x37,0xbf,0xac,0xfc,0xc6,0x36,0xde,0x5b,0x54,0xd6,0x73,0xb5,0x69,0x95,0x6c,0xb0,0x2e,0xe7,0x1d,0x82,0x1d,0xee,0xdb,0xd7,0x91,0x40,0xf2,0x3d,0x1f,0xaf,0x3e,0x46,0x8b,0x5b,0x7d,0x2e,0x66,0x4c,0xa,0xa1,0xb5,0x29,0xc1,0xa2,0x8,0xc3,0xb4,0xe3,0x38,0x4d,0xd5,0x94,0x27,0x7a,0x8,0x10,0x7a,0xe6,0xed,0xcb,0xc5,0x63,0x55,0xa5,0x3d,0x74,0xb9,0xf8,0x61,0x2c,0xf0,0x75,0x10,0x89,0xbb,0x73,0xd7,0x15,0xd0,0x8,0x84,0x65,0x68,0x51,0x4d,0x8,0xf,0x6d,0x49,0x20,0x7f,0x97,0x1f,0x2d,0x53,0x81,0x3c,0x56,0x29,0x44,0x32,0x0,0x8d,0x69,0x90,0x6b,0xbd,0x1d,0x2c,0x3b,0x60,0x1a,0x33,0xe7,0xf2,0x47,0xf3,0x6,0xc0,0x8f,0x34,0x3,0x10,0x70,0x9,0xbe,0x2f,0x69,0xbf,0x4,0x51,0x9b,0xaa,0x56,0x9c,0x4c,0x68,0x9f,0xc0,0x72,0xe3,0x15,0x4b,0xbe,0xf3,0x1a,0x3,0x41,0xf2,0x4d,0x48,0x1f,0x69,0x6,0x10,0xe0,0xa,0xfc,0xb0,0xd0,0xc1,0x27,0x6a,0xfc,0x8f,0xc3,0x1d,0xc3,0x69,0xe5,0xce,0x2f,0xaa,0xd6,0x1b,0x37,0x46,0xb,0xc8,0xa9,0x7a,0x68,0xd5,0xfb,0xc7,0xa,0xf8,0x8c,0x7e,0x9f,0xb,0x63,0xc9,0xef,0xe5,0x2f,0xa2,0xfb,0xe8,0xea,0x0,0x7e,0x3d,0x73,0xf5,0x67,0xcc,0x6f,0x14,0xc4,0x31,0x41,0x58,0xbe,0xaa,0xe,0x71,0xd1,0x43,0x0,0x0,0x5,0xd4,0x8a,0xcc,0x3b,0x1c,0xa8,0x88,0xf7,0x25,0xca,0xcf,0xf0,0x4d,0x78,0x55,0x2c,0x1,0xe0,0x0,0xd0,0x54,0x25,0xcc,0xec,0x2e,0x40,0xd2,0x11,0xb0,0x77,0x69,0x7a,0x85,0x9,0x1c,0x77,0xf,0xd0,0x3f,0x5b,0x43,0x82,0x6b,0xad,0xad,0xca,0xb4,0x1c,0xad,0x5,0x0,0x2d,0x79,0xcb,0x5e,0x39,0x83,0x45,0x2d,0x4d,0xb6,0x90,0x91,0x8,0xf4,0x21,0xf9,0x91,0x67,0x0,0x92,0xfb,0xb4,0x6d,0xb9,0x0,0xdb,0x78,0xaf,0x6c,0xb5,0x64,0x88,0x1e,0x2,0xc8,0xf,0x19,0xd8,0xaa,0xb,0x8e,0xef,0x8,0xfa,0xe8,0xfc,0x26,0x56,0x5e,0x9c,0x10,0x8f,0x94,0xdd,0x46,0xa5,0x88,0x9f,0x7c,0x63,0xa6,0x9f,0xcf,0x81,0x0,0x1a,0x13,0xc1,0x74,0xdd,0x82,0xf2,0x7b,0xa9,0x28,0x68,0x5f,0xc5,0x50,0xac,0x71,0x17,0xf5,0x94,0x2c,0x5a,0x73,0xe,0x66,0x43,0x1b,0x74,0x55,0x4,0x91,0x42,0x20,0x61,0xde,0x20,0xb8,0x85,0xe1,0x15,0x27,0x40,0x91,0x5c,0x10,0xb2,0x7,0x15,0xcb,0x9,0xa5,0x64,0xc2,0xe2,0x97,0x21,0x9b,0xa2,0xa4,0x8f,0xeb,0x23,0xcf,0x0,0xec,0x5,0x20,0xd8,0x53,0x0,0x28,0x25,0xf4,0x15,0xc,0x97,0x21,0x9c,0x7,0x32,0x9a,0x2f,0x48,0x12,0xcc,0x0,0xa8,0xea,0xd0,0xa9,0x18,0x4b,0xa0,0xde,0x2,0xd9,0x82,0x60,0xc1,0x81,0xc7,0xb6,0x8,0x76,0x44,0x60,0x3b,0xfc,0xf9,0x5a,0x40,0x13,0xeb,0x68,0x3,0xeb,0xa4,0x61,0xf0,0xd4,0x5f,0xed,0x6b,0xad,0x7b,0x8a,0x8f,0x57,0x26,0x85,0x3b,0x49,0x7b,0x3,0xfa,0xe6,0xe0,0x8b,0x7f,0x51,0xb1,0x56,0x17,0xed,0x26,0xe4,0xa4,0x1e,0x4,0x9d,0x6f,0xd3,0x38,0xcf,0x6,0x3e,0x5a,0xde,0xaf,0xaf,0xaf,0x3,0x40,0xfe,0x8,0xc7,0x3c,0x37,0x16,0x34,0xee,0x98,0x6e,0x20,0x1c,0x3f,0xb0,0x68,0x41,0xa2,0x31,0x5,0x61,0x1f,0x45,0x20,0x4d,0x2f,0x40,0xa7,0xe5,0x10,0x17,0x65,0xd5,0xcd,0xbd,0x63,0x99,0x9e,0x34,0x7f,0x43,0x43,0xc8,0xba,0x97,0x3,0x7c,0x7a,0xf0,0x25,0xf7,0xfd,0xf7,0xe0,0xa9,0xf,0xec,0xdd,0xe6,0x32,0xc5,0xbd,0x18,0x3c,0xf5,0x57,0xdd,0x1,0xf6,0x85,0xec,0x41,0x20,0x7a,0x43,0x38,0x4,0xd0,0x27,0x25,0x7b,0x24,0x81,0x81,0xf0,0xe7,0xa,0x80,0xf0,0x36,0xaf,0x35,0x51,0xcf,0x3f,0xf,0x32,0xf5,0x75,0xe3,0xa4,0x6f,0x5c,0x75,0xf3,0xbf,0xb6,0xf9,0x4,0xae,0xdd,0x5,0x86,0x5c,0xfa,0xc0,0x30,0x9b,0x6d,0xf9,0xd,0x80,0xbd,0x93,0x30,0x2,0x85,0xf6,0xc7,0x9,0x6f,0xba,0xb9,0x85,0x34,0x2b,0x5,0x3e,0x44,0x63,0xee,0x5c,0x7d,0xeb,0x59,0x25,0xf,0x9f,0x6a,0x73,0x29,0x86,0x5d,0xfe,0x70,0xf,0x6b,0xdd,0x7d,0x65,0xed,0x1,0x34,0x66,0x7f,0x59,0xdb,0xb,0x72,0xaf,0x96,0x6c,0xff,0xd6,0x66,0xcd,0x1a,0x2a,0x44,0xbe,0xe9,0x38,0xd,0x13,0x56,0xdd,0x32,0xf6,0x85,0x24,0xd2,0xac,0x27,0x18,0x3c,0xf5,0x57,0x23,0xe5,0x66,0x5e,0xf4,0x77,0x15,0x49,0x62,0x15,0x7d,0xab,0xa3,0x66,0x82,0xd3,0xc7,0x4,0x6c,0x26,0xcd,0xb,0x34,0xce,0x42,0xc7,0x98,0xfb,0x56,0xde,0x3c,0x36,0x72,0x99,0x78,0x9b,0x3d,0x82,0x56,0xce,0x3d,0x63,0x2b,0xbc,0x7d,0x74,0x5e,0xb,0x55,0x68,0x20,0x2d,0xfa,0x79,0x25,0x49,0x64,0xd3,0x2c,0x1,0xe8,0x63,0xa5,0x83,0x6a,0xc5,0x4c,0xbd,0xc1,0xd0,0xcb,0x16,0xef,0x67,0x6d,0x76,0x9c,0x3f,0xcc,0x55,0x61,0x62,0x8f,0xd4,0xc6,0xb,0xf4,0xe8,0xd0,0xbe,0x8c,0x22,0xb0,0x2f,0xa0,0x33,0x61,0xdd,0xc1,0x2e,0x30,0x74,0xf0,0xd4,0x7,0x17,0xac,0xbe,0x75,0xec,0xba,0xe2,0x4,0xaa,0x6e,0xb9,0xc3,0xa6,0x3f,0x96,0x32,0x34,0xbf,0xf7,0x48,0xef,0x2f,0x45,0xaa,0x68,0xf6,0x37,0x34,0xce,0xf9,0xaa,0x65,0xde,0xb1,0x44,0x9f,0x19,0x7a,0xd9,0x83,0xfb,0x77,0x14,0x71,0x3a,0x6,0x34,0x0,0xd6,0x9d,0xee,0xf,0x94,0x2c,0xa8,0x7b,0x9b,0xfc,0x44,0x59,0x6,0x87,0x41,0xfb,0xcb,0x9d,0x5b,0x24,0x6f,0x22,0x4f,0x9f,0x80,0xec,0x38,0x52,0x7d,0xa2,0x4a,0x55,0x35,0x3,0xac,0x9c,0xf3,0xf9,0xac,0x80,0x17,0xe0,0x9f,0xa3,0x5a,0x9d,0xdc,0x9f,0x2f,0xb7,0xa7,0x6d,0x4,0x9a,0x86,0xbd,0x40,0xc2,0x88,0xce,0x26,0x59,0x92,0x20,0xd9,0x43,0x1,0xec,0x7,0x50,0x85,0xcb,0x3b,0xc2,0x78,0xa8,0x1c,0x87,0x28,0xfe,0xb6,0x50,0xbb,0xa0,0xdf,0xad,0xbe,0x4a,0xe3,0x6c,0x8c,0x2a,0x57,0x4d,0x63,0xf7,0x1f,0x6e,0x19,0xfb,0x2a,0x8d,0x79,0x33,0x98,0x32,0x8e,0x76,0x74,0x8d,0x9a,0xf4,0x88,0xb3,0x6d,0x53,0x0,0x5,0xe9,0xe3,0xb2,0xf6,0xe4,0x21,0x97,0x2d,0xee,0xd9,0xb9,0x64,0x4b,0x6,0x6,0x5f,0xfa,0xe0,0x60,0x59,0x4d,0xf6,0x55,0xdd,0xdc,0x36,0x37,0x49,0x40,0xac,0xd7,0x40,0xce,0x96,0xf,0x10,0xdc,0xd2,0xd0,0xfd,0x63,0xaf,0x47,0xc5,0xab,0x89,0x1,0x6,0x5f,0x72,0x9f,0x1,0xcc,0x3,0x2,0x32,0x2,0x90,0x53,0xe5,0xa,0x2e,0x14,0x75,0x61,0xc5,0x5d,0x5f,0x41,0x78,0x9e,0x71,0xa1,0xf1,0xb2,0xf6,0xd4,0xc4,0xa9,0xd1,0x9,0x40,0xe0,0xc,0xc0,0x8e,0xf1,0x1c,0xab,0x0,0x76,0xc0,0x89,0x68,0x34,0x39,0x5f,0x3e,0x90,0x66,0x57,0xf1,0x9,0xa6,0x1,0xd4,0xc4,0x0,0xd,0x3d,0x7a,0xb,0x34,0xf7,0x4a,0xc8,0xfa,0x54,0x8c,0x98,0x19,0x2a,0x35,0x25,0x5c,0x1c,0xb7,0x60,0x37,0xb0,0x83,0x49,0x9d,0x3d,0xe4,0xd2,0x87,0x7a,0x77,0x36,0x1,0x6b,0x81,0x21,0x97,0x3e,0x74,0x2,0x64,0xc7,0xe6,0x25,0xff,0xf0,0xa,0xea,0xb6,0xe0,0xaa,0x54,0x58,0xdc,0xb7,0x61,0x13,0x2d,0x77,0xd1,0x98,0x57,0xe2,0xca,0x57,0x13,0x3,0x2c,0xfb,0xe9,0xb1,0xa2,0x71,0x56,0x80,0x39,0x37,0x2e,0x86,0x57,0xf8,0xb4,0x86,0x52,0x52,0x8e,0xf7,0x3e,0xef,0x2e,0x45,0x48,0x1a,0x7,0xe0,0x92,0x76,0xa0,0x4b,0x87,0xc0,0xb0,0x69,0x8f,0xf4,0x4,0xf4,0x45,0x49,0x47,0x7b,0x92,0xbf,0x9,0x26,0x4f,0x22,0xf0,0x11,0x87,0xab,0x52,0x61,0xb1,0xd,0xcb,0x77,0x15,0x20,0x40,0x2e,0x91,0x70,0x7f,0x5c,0x19,0x6b,0xd6,0xdf,0x57,0xcd,0x3d,0x7d,0xab,0x31,0xce,0x8b,0x20,0x4b,0xc,0x3,0x95,0x76,0x5f,0x26,0x30,0x3e,0x76,0x87,0xec,0x85,0x43,0x2e,0x7d,0x68,0x6c,0x47,0x10,0x2c,0x69,0x90,0xb5,0x57,0x49,0xf6,0xdc,0xd0,0xce,0x1d,0x55,0xe2,0x4,0x95,0xc6,0xb,0xe5,0x65,0x56,0xff,0xe1,0x96,0x33,0x63,0xd7,0x59,0x24,0x62,0xc0,0x31,0x4e,0xea,0x1a,0x0,0x9b,0xdb,0xd2,0xc9,0xc7,0x89,0x7f,0x45,0xcf,0x7e,0x55,0x68,0x25,0xdb,0x1f,0xd0,0x15,0xc3,0xa7,0x3f,0xba,0x17,0x76,0x23,0x18,0x7a,0xf9,0xc3,0x17,0xc9,0xba,0x97,0x90,0xec,0xe6,0x1f,0x22,0xdb,0xca,0x15,0x24,0xa,0x3f,0xa5,0xde,0xb0,0x8d,0xf1,0x82,0x85,0x96,0xfe,0x53,0xc9,0x35,0x16,0xc9,0x30,0x80,0x49,0xfd,0x15,0x60,0x16,0x2c,0xa7,0xb4,0xb4,0x56,0x78,0xe2,0x9e,0x7d,0x7f,0x44,0x43,0x1a,0x40,0xfa,0xbc,0xeb,0x66,0xef,0x4e,0x88,0x36,0xed,0xe,0xc3,0xa6,0x3d,0x72,0x34,0x64,0xaf,0x4,0xd1,0x97,0x9e,0xda,0xc7,0xb0,0x7a,0x86,0x12,0xf8,0x29,0x3b,0x61,0x56,0x3e,0x9e,0x48,0xe3,0xef,0x4b,0x65,0x5e,0x26,0xcd,0xba,0x52,0x65,0xad,0x99,0x1,0x86,0x5f,0xf1,0x44,0xca,0x75,0x33,0x17,0x93,0xdc,0xb3,0x60,0x82,0xa3,0xc6,0x8b,0x86,0x14,0x4,0x1a,0x7a,0x9b,0x2b,0xc9,0x9e,0x36,0xf4,0xf2,0xc5,0x8b,0x3b,0x9b,0xb8,0xe5,0x60,0xd8,0xb4,0x47,0x87,0x59,0xd7,0x9d,0x2b,0xd9,0x91,0xb9,0x63,0x71,0x88,0xa,0x8d,0x64,0x85,0x97,0x2,0xa5,0x2e,0x3e,0x9d,0x70,0x78,0x4e,0x93,0x22,0x9d,0x7b,0xff,0x70,0xf3,0xbf,0xfe,0xb2,0x54,0x79,0x6b,0x62,0x80,0x61,0x57,0x3c,0x9e,0x92,0xcd,0x5c,0x27,0xeb,0xde,0x0,0xa0,0x67,0xc1,0x92,0xe4,0x4,0x2e,0x7f,0xdf,0x3b,0xfa,0x27,0x8c,0xc1,0xba,0xf6,0xb3,0x43,0x2e,0x5b,0x7c,0x7f,0x65,0xa5,0xec,0x38,0x18,0x7a,0xf9,0xa3,0x43,0x25,0xf7,0x2e,0x40,0x47,0xfa,0x36,0xd,0x86,0x7e,0x6b,0xc1,0x3,0xbd,0x65,0xfe,0x8,0x7e,0xc3,0x57,0xee,0x14,0x94,0xf0,0x5,0xc0,0xa5,0xe1,0xdf,0xca,0x95,0xb9,0x6a,0x6,0x18,0x7a,0xf9,0xa3,0xd,0x72,0x33,0xdf,0xb3,0xae,0xfb,0xdf,0x0,0xd3,0x5e,0x68,0xb4,0x64,0x5f,0x9d,0x2a,0xd3,0x3a,0xdc,0x18,0xa6,0x21,0x9d,0x39,0xe4,0xd2,0x87,0x7e,0x3b,0xf4,0xf2,0x47,0x92,0xde,0x95,0xac,0x26,0x18,0x36,0xed,0xb1,0x93,0xad,0xcd,0x3c,0x28,0xab,0xc3,0xa,0xd7,0x52,0x94,0xd2,0x7a,0xe2,0x70,0x81,0xd6,0x71,0xf3,0x9a,0xdd,0x2e,0x92,0x1b,0x40,0xf3,0xa6,0x84,0x5d,0xa,0xb6,0x53,0x4,0x43,0x62,0x86,0x27,0xfc,0x9,0x6c,0x75,0x68,0x67,0x31,0x54,0xc5,0x0,0xc3,0xaf,0x78,0xbc,0x1b,0xa0,0x1f,0x59,0x6b,0xaf,0x3,0xe1,0xd0,0x10,0xc1,0x21,0xc7,0x85,0x2b,0xc7,0xa2,0x18,0x9f,0x45,0xe1,0xcc,0x8b,0x2b,0x5,0x78,0x8,0xb8,0x9f,0xa1,0x74,0x9,0x10,0x46,0xd0,0xd1,0xd6,0xba,0x2f,0xf,0xb9,0xfc,0x91,0xe3,0x3a,0x8c,0xc2,0x25,0x60,0xc8,0x65,0xf,0xff,0xa7,0xb5,0xd9,0x45,0x24,0xf,0xa,0xd4,0x6f,0x1a,0xe3,0xf9,0x39,0x17,0x8a,0x3f,0x85,0xf5,0x46,0xc,0x2e,0xa,0xf1,0x26,0x3f,0x2e,0x7d,0x7c,0xac,0x5c,0x75,0xf3,0x99,0x3,0x8d,0x93,0xfe,0x94,0x49,0x35,0xee,0x63,0x52,0x4d,0x4d,0x26,0x95,0xee,0x63,0x9c,0xf4,0x20,0x3a,0xe9,0xd1,0x74,0xd2,0x67,0xd1,0x38,0x5f,0xa6,0x71,0xbe,0x44,0xf0,0xd9,0x72,0x65,0x2f,0x27,0xb8,0x47,0x10,0xff,0xd7,0x7b,0xca,0xda,0xaf,0x4a,0xf6,0x3b,0x8,0x56,0xa3,0xb0,0xd2,0x95,0xae,0x55,0x2d,0x8c,0xf5,0xd8,0x5b,0x62,0xc8,0xb9,0x70,0x2b,0x68,0x1e,0x4b,0x77,0xdb,0xe7,0xbc,0x17,0x67,0x1c,0xd3,0xe1,0x9b,0x48,0xe,0xbf,0xe2,0x89,0x46,0xeb,0x66,0xd6,0xca,0xba,0x7,0x91,0xdc,0x23,0x98,0x92,0x87,0xc4,0x44,0x71,0x12,0x78,0xe8,0x92,0xab,0x40,0xe7,0xe4,0x95,0x73,0x3e,0xf7,0x7e,0x71,0x94,0xa3,0xbe,0xf2,0x5b,0xb6,0x6c,0x7b,0x97,0x4e,0xba,0x81,0xb2,0xd6,0x48,0xd6,0x5d,0x35,0xf7,0x8c,0xb2,0x47,0xcc,0x54,0x44,0x85,0xa1,0xd3,0x1e,0xed,0xe,0x60,0x32,0xac,0x9d,0x5,0xf8,0x67,0xff,0xa1,0xe3,0xf,0x8c,0x40,0xe1,0x3c,0x78,0xb,0xc8,0xb7,0x4,0xde,0xea,0x66,0xb3,0xd7,0xaf,0xb9,0xf5,0xcc,0x4c,0xd,0x59,0xb4,0x9,0x86,0x5c,0xfe,0x48,0x9a,0xc0,0x22,0x12,0x47,0xc9,0xda,0xdc,0x2c,0x1b,0x2b,0x26,0x7a,0x25,0x55,0x46,0x56,0xe0,0x5d,0xab,0xe6,0x9e,0x3e,0x25,0xc9,0xba,0x54,0x54,0xd8,0x61,0xd3,0x1e,0x3b,0x49,0x72,0x7f,0xe3,0x89,0xb5,0x1e,0x9b,0xb7,0x4a,0x2d,0xee,0xec,0x87,0x70,0xcc,0xb8,0xc5,0x23,0x2c,0x8a,0xab,0xc8,0x38,0x91,0xa7,0x83,0x49,0xda,0x4a,0x9a,0xd7,0x40,0x2e,0x2,0xcc,0x4f,0x56,0xce,0xf9,0x6c,0xe2,0x1e,0x45,0xc3,0xaf,0x78,0x7c,0xa8,0xb5,0xee,0xb5,0xde,0xde,0x48,0x3a,0x88,0xa4,0xbf,0x3f,0x62,0x20,0xaa,0x7b,0xc7,0x27,0xb6,0xaa,0x53,0xb8,0x2e,0x51,0x38,0x2a,0xf6,0xa4,0x2e,0xc4,0x97,0xbf,0xf,0x3,0x9f,0x4d,0x35,0x34,0x7d,0x6e,0xd9,0xcf,0x4e,0x4a,0xf4,0xc8,0x98,0x8a,0xe,0x8d,0x12,0xf0,0x16,0xc0,0x55,0x20,0x86,0x12,0x85,0x47,0xb7,0x14,0x54,0xa8,0x18,0xca,0x59,0x7f,0xc2,0x61,0x2c,0xfb,0x5d,0x1e,0xb5,0xb9,0x19,0x70,0x89,0x64,0xf,0xc9,0xe,0x84,0x78,0x10,0xa9,0xb,0x87,0x4e,0x7b,0x74,0x29,0xc0,0xc5,0x0,0x9f,0x58,0x75,0xd3,0xe7,0x3e,0xac,0x16,0x41,0x43,0xa7,0x3d,0x76,0x24,0x81,0x33,0x41,0x9c,0x62,0xdd,0xec,0x27,0x1,0xf4,0x26,0xd1,0xe4,0x17,0x26,0xe7,0xa,0x17,0xb9,0x8c,0x92,0x6d,0xb8,0x8f,0x7f,0xe,0xed,0xba,0xc2,0xd7,0x68,0xcc,0x6d,0x49,0x13,0x3f,0x8e,0x14,0x25,0x61,0xd8,0xf4,0x5f,0x9f,0x2e,0xeb,0x3e,0xc,0x44,0xad,0x70,0xed,0x70,0x28,0x68,0x57,0xa1,0x1d,0x4b,0x20,0xa9,0x19,0xe4,0x3f,0x0,0xbc,0xb,0xe0,0x6d,0x80,0x7f,0x34,0xc6,0xbc,0x28,0x61,0x83,0x64,0x37,0x1b,0x63,0xb6,0x9,0xcc,0x2,0x70,0x8d,0x31,0x8e,0x9b,0xcd,0x34,0x2,0xec,0x66,0xc,0xf,0x4,0x74,0x8c,0xb5,0x3a,0xe,0xd0,0x1,0x0,0x7a,0xc8,0xda,0xde,0x24,0xf7,0xcb,0x21,0x2d,0x7c,0x42,0xa,0xa,0xfb,0xe9,0x44,0x2a,0x15,0x4a,0x4f,0x92,0x5,0xcd,0x8d,0x3d,0xf7,0xeb,0x73,0xd5,0x33,0xd7,0xf,0x4e,0x5c,0xce,0xa9,0xf8,0xec,0x60,0x9,0x2b,0x40,0xf3,0x2,0xa0,0xe3,0x2,0x4f,0x9e,0xf0,0x69,0xd1,0xed,0xf,0x5,0x63,0x49,0xee,0xc1,0x3b,0x69,0x3b,0x68,0x3a,0x10,0xd,0x1b,0x25,0x1c,0x2,0xe0,0x10,0x3f,0xc6,0x9,0x92,0x1d,0x27,0xe1,0x7d,0x48,0xcd,0x90,0xcd,0x10,0xb4,0x0,0xe4,0x66,0xb2,0x24,0xe9,0x0,0x4a,0x59,0xab,0xee,0x80,0xf6,0x7,0x90,0xf3,0x48,0xa,0x16,0xc9,0xf8,0xe,0xd1,0x2c,0x76,0xe7,0xab,0x9c,0xf8,0xc5,0xe3,0x40,0x1,0x7e,0x45,0x43,0x4a,0xb0,0x0,0xc,0x69,0x9e,0x14,0xf9,0x83,0xf6,0x20,0x3e,0x50,0x5,0x3,0x90,0x7c,0x17,0xe4,0x77,0x64,0xdd,0x27,0xdb,0xeb,0xb8,0xb4,0xa,0x4a,0x13,0x2a,0x57,0x48,0x81,0x24,0xc2,0x4e,0x97,0xc1,0x88,0xda,0x1d,0x40,0x5f,0x40,0x7d,0xc1,0x9c,0x4a,0x91,0x4b,0x26,0x70,0x79,0xf,0x8c,0x6e,0xc8,0x7f,0x9b,0xcb,0x28,0xbf,0x59,0x46,0xb2,0x65,0x2f,0xc4,0x6f,0xee,0x5c,0x24,0x43,0x72,0x9,0x8d,0xf3,0x5f,0x2b,0x67,0x9f,0x5a,0xd6,0xa0,0x53,0x2d,0x54,0xdc,0x85,0xaf,0x9c,0xf3,0x59,0x57,0x56,0xcf,0x1,0xe6,0x7,0xcc,0x4f,0x3b,0x29,0xce,0xae,0xf,0xc4,0xdb,0xb2,0x11,0x11,0x16,0xf5,0x1e,0x31,0xdf,0x44,0x7d,0xe7,0x3f,0x33,0x58,0x72,0xe,0x7f,0x5b,0x4e,0x7f,0x7e,0x1,0x86,0x6,0x86,0x26,0xbf,0xb6,0xda,0xf,0xf3,0xe6,0x1c,0x20,0xd2,0x0,0xfe,0x7d,0xb1,0x52,0x5e,0x6c,0xcf,0x47,0x4c,0x19,0x4b,0xc5,0x61,0x89,0xfa,0x86,0x5d,0xb9,0xe8,0x19,0x73,0x1e,0x58,0x31,0xfb,0xd4,0x76,0xf5,0x8e,0xae,0x6a,0xc,0x5f,0x75,0xd3,0xe7,0x32,0xc6,0x71,0x66,0xd0,0x98,0x3f,0x7a,0x1e,0x81,0xf0,0x14,0x83,0xbc,0xcd,0x1a,0xa0,0x77,0x94,0x27,0x3,0x79,0x3d,0xf8,0xf1,0xc3,0xe4,0x1b,0x11,0x7c,0xbb,0x49,0x7e,0x4d,0x8,0xb,0xc3,0xa,0xec,0x61,0x21,0x3b,0x49,0x2e,0x6e,0x48,0x78,0x6c,0x65,0x53,0x2a,0x8e,0x1b,0x32,0x52,0x79,0xc6,0x2b,0x22,0xbc,0xcd,0xa1,0x77,0xa,0x8b,0x1f,0x25,0x7c,0x5f,0x9c,0x6f,0x51,0x18,0x23,0xca,0x15,0x67,0xe3,0x29,0x28,0x77,0x44,0x1d,0xa,0x3b,0x6,0x56,0xdc,0x43,0x77,0x8,0x3,0x0,0xc0,0x8a,0xd9,0xa7,0xbc,0x9,0x98,0x6f,0x48,0xb0,0xc1,0x4a,0x97,0x90,0xcd,0x3a,0xa8,0x72,0x40,0x71,0xff,0x40,0x54,0x13,0xd8,0xaa,0x3d,0xd3,0x5e,0xb0,0xb5,0x1d,0x22,0x30,0x57,0x80,0xc5,0x8,0xec,0xc6,0xc5,0x47,0x1b,0xe2,0x17,0x7f,0xc7,0x32,0xf9,0x97,0xcb,0xaf,0x5c,0x1e,0x95,0x94,0xc5,0xbb,0xf7,0x27,0xc0,0x34,0x61,0xd8,0x15,0x4f,0x8c,0xa9,0x4b,0x6,0x0,0x80,0x15,0x37,0x9e,0xf2,0x2b,0x81,0x73,0xfd,0x59,0x89,0xe0,0xbc,0xdb,0x9c,0xdf,0xa3,0x1f,0x6,0x1,0xaf,0xd0,0x38,0xf3,0x40,0xf3,0x3d,0x90,0x8f,0xa3,0x50,0x4b,0x66,0x72,0x3e,0x92,0x9d,0x24,0x8a,0x24,0x8,0x61,0x1c,0x2,0x1a,0xe,0x60,0xca,0x51,0x57,0x3d,0x9d,0x6e,0xaf,0xfc,0x6a,0x56,0xe3,0x68,0x9c,0xaf,0xd2,0x38,0xbf,0x1,0xe8,0x2,0xc,0x66,0xa5,0x8,0xf0,0x3,0x81,0x4f,0x1,0x9c,0x4d,0x9a,0xff,0x30,0xc6,0x4c,0x5f,0x31,0xfb,0x94,0x6f,0x3,0xe6,0x6b,0xa0,0xf9,0x6d,0x28,0xae,0xef,0x27,0x17,0xb5,0x6d,0x5a,0xa5,0x17,0x6a,0xfc,0xbe,0xf3,0x2f,0x7f,0xd2,0x43,0x79,0xbc,0x68,0x8c,0x9b,0x75,0xcf,0x6b,0x2f,0x6,0x48,0xa4,0xc9,0x8c,0xb8,0xf2,0xa9,0x23,0x24,0xfb,0x6b,0x49,0x69,0x49,0x1b,0xc,0xb9,0x95,0xc6,0xac,0x0,0x78,0xf3,0xf2,0x59,0x27,0xbd,0x19,0x11,0xff,0x13,0xd6,0xba,0xf3,0x25,0x9d,0x60,0x72,0xaa,0x5b,0xe8,0xa0,0xe4,0x92,0xc5,0x6d,0x4b,0x6f,0xd1,0xd6,0x78,0x51,0x71,0xc3,0xcf,0x95,0xa4,0x53,0xd,0x4,0x55,0x8d,0xcd,0x43,0x5e,0x2f,0xca,0x47,0x68,0xcc,0xf8,0x95,0xb3,0x4f,0x2e,0x77,0xa,0x7a,0xd5,0x25,0xa8,0x19,0x46,0x5c,0xf9,0xd4,0xf5,0x92,0x5e,0x7,0x39,0x6f,0xc5,0xac,0x93,0xca,0x6e,0xf5,0x3a,0xfc,0x4b,0x4f,0x35,0x42,0xf6,0x69,0x41,0xc7,0x78,0x2,0x1e,0x73,0x15,0x66,0x58,0xa7,0x8b,0x41,0x51,0x78,0xc,0x29,0x45,0x22,0x96,0xf9,0xbe,0x38,0x4e,0x71,0xfc,0x28,0x4,0x29,0x26,0x8d,0xf6,0x60,0x15,0x7f,0x78,0x7c,0x97,0x34,0x3f,0x58,0x31,0xfb,0xe4,0x1f,0x26,0x9d,0x7e,0xa7,0xe,0x9a,0x23,0xaf,0x59,0x4a,0xb7,0x65,0xfb,0xe3,0x24,0x8e,0x6,0xd0,0xc3,0xdb,0x3c,0x23,0xd8,0x87,0x24,0x8a,0x5,0x18,0xf1,0x5c,0xe9,0xe4,0x43,0x5c,0xba,0xa5,0x58,0x24,0xa,0x65,0xc5,0xdf,0x95,0xcb,0x2f,0xae,0x4c,0x8c,0xf9,0x46,0xc1,0x7a,0x4b,0xff,0xe0,0x68,0x3e,0x63,0x85,0xcf,0xaf,0xba,0xf1,0x94,0x44,0xcd,0xc1,0x9d,0x6a,0xca,0x5d,0xf6,0xd3,0x63,0xb5,0xf2,0xc6,0x53,0x4f,0x25,0x53,0xb7,0x4a,0x7c,0xc3,0x57,0xd5,0x19,0xbd,0xce,0x90,0x31,0xcf,0x61,0x4d,0xa1,0x54,0xdc,0x8,0xbd,0x32,0x36,0x9d,0xb8,0x30,0x96,0xf8,0xae,0x5c,0x7e,0x71,0x71,0xe2,0xbe,0xf1,0xe4,0xe3,0x90,0x6e,0x3b,0x84,0xe4,0xb7,0x92,0xa6,0x41,0x67,0xdb,0xf2,0x1,0x0,0xcb,0x67,0x8d,0xb9,0x16,0x34,0xd7,0x4a,0x58,0xf,0xef,0x4,0x92,0x28,0x4a,0xed,0x56,0x57,0xb0,0xb7,0x72,0xb9,0xb0,0x52,0xdf,0x6,0x2e,0x71,0x7e,0xf8,0x36,0x0,0x1f,0x24,0x8d,0xfb,0xba,0xd2,0x9b,0x86,0x7f,0xe9,0xe9,0xde,0xa0,0x1e,0x25,0x30,0x24,0x5f,0xbc,0xb8,0x3d,0x74,0x6b,0x19,0x71,0x4b,0xa5,0xd1,0x16,0xa9,0x22,0x4e,0x7a,0xc8,0x7d,0x17,0xac,0x95,0xf4,0x67,0x2d,0x73,0x5d,0x9b,0xef,0xc9,0x62,0x5b,0x4f,0xa5,0x7,0xdd,0xbe,0xb7,0x4b,0x46,0xfe,0x5b,0x0,0x92,0x5e,0x27,0xf9,0xff,0x56,0xcc,0x3e,0x69,0x66,0xd2,0x38,0x6f,0x77,0x4b,0x53,0x25,0x60,0xc,0xcf,0x12,0xb0,0x7f,0xa1,0x46,0x10,0xc7,0xa3,0x49,0xf0,0x6e,0xb5,0x69,0xb3,0xd5,0x73,0x89,0x19,0x41,0x17,0x40,0xd6,0x6f,0xdc,0x8d,0x3e,0x81,0x63,0x36,0x88,0x28,0xdc,0x37,0xc0,0x8f,0xf3,0xf,0xc7,0x38,0xd7,0x2f,0xfb,0xd9,0x89,0xb3,0xd1,0xe,0x50,0x17,0x43,0x40,0x0,0x56,0x9a,0x2,0xb0,0x4f,0xcc,0xa0,0x19,0x46,0x54,0x95,0x57,0xf8,0xfb,0xa8,0xb4,0xa2,0xde,0x17,0x43,0x41,0x9a,0xf2,0xaf,0x90,0x15,0x34,0x6c,0x14,0x33,0x24,0xcd,0x12,0x63,0x9c,0x13,0x49,0x73,0xa9,0xf2,0x7b,0x39,0xd2,0x5b,0xff,0x58,0xd0,0xe5,0xe7,0xbc,0x87,0x83,0xd6,0xef,0xf9,0xf4,0xf3,0xb2,0xf6,0x22,0x3e,0x50,0x6f,0x3d,0x0,0xb9,0xb7,0x7f,0xab,0xe8,0xa6,0x5f,0x6b,0xab,0x2f,0x47,0xe4,0x36,0x30,0x41,0x99,0x11,0x42,0xc1,0xc6,0xf7,0xc4,0x12,0x49,0xff,0x43,0xf2,0xe9,0x65,0x33,0x47,0x67,0x0,0xfc,0x6e,0xe4,0x55,0xcf,0xbe,0x2d,0x6b,0x7f,0x9,0x61,0xcf,0x12,0xbe,0x23,0x16,0xa0,0x1,0xf9,0x24,0xc9,0x6f,0x2e,0x9b,0x39,0x7a,0x59,0x72,0x18,0x6e,0xd,0x75,0xd3,0x3,0xc,0xbf,0xf2,0x99,0x43,0xad,0xd4,0xd8,0x7a,0x7d,0x21,0x4a,0x48,0xe2,0x40,0xbc,0x74,0x8f,0x98,0x6f,0xa3,0x24,0x7d,0xc4,0xe4,0x17,0x91,0x6,0x10,0x78,0xfb,0x22,0x98,0xb4,0xb,0xc9,0x76,0xa4,0x31,0xf,0xd2,0x38,0xa3,0x40,0xf3,0x79,0x3a,0xd,0x4f,0x2c,0xff,0xd9,0x89,0x39,0x1f,0xc5,0x65,0x33,0x47,0x3f,0xe,0x9a,0xa1,0x2,0x7e,0xed,0x37,0x79,0x81,0x94,0x37,0xc9,0xc8,0x60,0x1,0x89,0x1,0x79,0x9b,0x80,0x69,0xed,0x4d,0x7c,0xa0,0x9e,0x7a,0x0,0xa2,0x1f,0xc1,0xc6,0xdc,0x53,0x4e,0xb2,0x2a,0xd7,0x52,0x5b,0x79,0xd0,0xf8,0xdd,0x27,0x83,0x77,0x88,0x77,0x57,0x60,0x44,0x7a,0xe5,0x7b,0x89,0xfc,0x9c,0x7d,0xe0,0xe,0x61,0xfe,0xa,0x70,0x11,0xa8,0x5b,0x1,0xbc,0xe,0x68,0xe7,0xf2,0x99,0xa3,0x23,0x3d,0x72,0x97,0xff,0x6c,0xf4,0x9f,0x47,0x5c,0xf5,0xec,0x64,0x8,0x93,0x24,0x3b,0x23,0xa8,0x82,0xef,0xdc,0x42,0x80,0x5f,0x3,0x79,0xc7,0x8a,0x99,0x27,0xbc,0xd7,0x11,0x68,0xaf,0x1f,0x6,0x0,0x8e,0x5,0xd8,0xc3,0xf7,0xc9,0xa8,0xc8,0xc9,0xc4,0x9f,0x7d,0xa,0x3c,0x68,0x2,0x46,0x0,0x80,0xd0,0x92,0x6c,0x0,0x21,0x71,0xbd,0x48,0x66,0xab,0xc6,0x9b,0x97,0x0,0xb2,0x20,0x7,0x81,0xdc,0x22,0x69,0xeb,0xf2,0x99,0xa3,0xdb,0xe4,0x88,0xba,0x7c,0xe6,0xe8,0x77,0x46,0x5e,0xbd,0x64,0x2e,0xc4,0xc5,0x90,0x9e,0x5,0x70,0xa0,0xa4,0x77,0x40,0x4e,0x4,0xf4,0xc2,0xa,0x6f,0xc8,0xe8,0x10,0xa8,0x1b,0x35,0x70,0xf8,0x97,0x9f,0x7d,0x9e,0xc4,0x31,0xbe,0x27,0x47,0x5b,0x9,0x92,0xd7,0xbb,0x3c,0xcf,0xd9,0xdb,0x1,0x2c,0x5,0x70,0x32,0xa0,0xb3,0x51,0x62,0xdb,0xd9,0x90,0xb7,0x50,0x45,0x6e,0xed,0x45,0xbd,0x4d,0x66,0xf9,0xcc,0xd1,0xd,0x6d,0xfa,0x30,0x6,0x46,0x5e,0xbd,0xe4,0x50,0x49,0xc3,0x0,0xac,0x5f,0x3e,0xf3,0x84,0xd,0xed,0x89,0xe3,0x48,0x3c,0x74,0x74,0x86,0x71,0x30,0xe2,0xaa,0xe7,0xde,0x2,0xd0,0x2b,0xbc,0xdf,0x50,0x29,0xa2,0x14,0xbf,0x97,0xf4,0x17,0x80,0x13,0x1,0xac,0xa1,0x77,0x9e,0x71,0x2f,0x0,0x7b,0x4a,0x6a,0x80,0x77,0xbc,0x7d,0xf,0x0,0x9f,0x2,0xd4,0x17,0xc0,0xbe,0x0,0x3e,0x9,0x78,0x1b,0x51,0x55,0xea,0xcf,0x1f,0xc,0x33,0x92,0x32,0xa4,0xe9,0xb6,0x7c,0xe6,0xf1,0xd9,0xb6,0x7e,0x1b,0x5,0x47,0x7f,0x65,0x69,0xea,0xf7,0x33,0x8e,0xad,0x29,0x8d,0x6a,0xa1,0x6e,0x86,0x0,0x82,0x3f,0x17,0xf4,0x15,0xf9,0xb,0xa1,0x3c,0xbf,0x48,0x8f,0x28,0x11,0x94,0xf1,0x37,0x44,0xf4,0x5,0x32,0x6f,0x14,0xb8,0xce,0xcd,0xba,0x7f,0x58,0x39,0xfb,0x44,0xb,0x60,0x93,0x7f,0xe5,0x60,0xc4,0xd5,0x2f,0x90,0xb0,0x3d,0x0,0xee,0x9,0x8f,0x21,0xfa,0xc8,0x6a,0x89,0x31,0x74,0x0,0x6f,0x71,0x65,0x5,0x83,0x8e,0x7f,0xca,0x6d,0x32,0xde,0x81,0x9d,0x45,0x7c,0xa0,0x8e,0x18,0x40,0xc0,0x8f,0x48,0xb3,0x44,0xb2,0x97,0x82,0x3c,0x2d,0x24,0x4,0x14,0xf4,0xba,0x7e,0x80,0xbf,0xf,0x1e,0x20,0x6b,0x9,0xe0,0xfb,0x12,0x1f,0xf5,0x89,0x1f,0x9,0xcb,0x6f,0x38,0x4e,0x0,0xb6,0xf8,0x17,0x46,0x5c,0xb5,0xe4,0x75,0x92,0xbf,0x15,0x70,0x1c,0x80,0x22,0x51,0xa1,0x75,0xe1,0x42,0x5c,0xa8,0xd0,0x9e,0x8c,0xdb,0xea,0xa8,0x13,0xad,0xa,0xea,0x46,0xd,0x5c,0x3e,0xf3,0xf8,0xd7,0x97,0xdd,0x30,0xea,0x3e,0x80,0xd7,0x1,0xbc,0x58,0xc2,0xaf,0x3,0xe7,0x92,0x22,0x87,0x11,0x92,0x46,0xa1,0x77,0xbf,0x7,0xf8,0xbf,0xcb,0x67,0x1e,0x5f,0xd1,0x59,0x43,0xc6,0x18,0xd2,0x98,0xbb,0x42,0xf6,0xf9,0x78,0x3b,0x7d,0xa1,0x4b,0x97,0x6f,0xac,0x81,0x5,0xf8,0x1a,0xda,0xd7,0x61,0xa0,0xdd,0xa1,0x6e,0xd9,0x77,0xc4,0x55,0x4b,0x8e,0x4,0x30,0x82,0xe4,0x89,0x0,0xc6,0x1,0x8,0x6f,0x11,0x13,0x8c,0xc1,0x9b,0x1,0x9c,0xb5,0x7c,0xe6,0xf1,0x4b,0xaa,0xc9,0x63,0xe4,0xd5,0x2f,0x1c,0x28,0xd9,0x4d,0xfe,0xb9,0x88,0xa5,0x5c,0x0,0xa,0xc0,0xd7,0x30,0x32,0x92,0x16,0x1,0x98,0xbc,0x7c,0xe6,0xf1,0x65,0x17,0x61,0xd6,0x2b,0xd4,0x2d,0x3,0x4,0x30,0xe2,0xea,0xe7,0xfb,0x0,0x38,0x3,0xc0,0xbf,0x10,0x3c,0xa,0xc0,0x18,0xdf,0x4a,0xb0,0x43,0xd0,0x95,0xcb,0x6f,0x18,0x75,0x47,0x8d,0xe9,0x3f,0x65,0x68,0x8e,0x87,0x77,0xf6,0x9e,0xe7,0x25,0x1c,0xc3,0xa,0xb2,0x5,0xea,0xc2,0x2e,0x2b,0xfb,0x9f,0x0,0x7e,0xb8,0xfc,0x86,0x51,0x5d,0xc,0xd0,0x11,0x70,0xd4,0x57,0x96,0xe,0x7,0x30,0x9,0x5e,0x6f,0xb0,0xe9,0xc5,0x19,0xc7,0x7e,0xb7,0x96,0xf4,0x46,0x5e,0xb3,0x94,0x92,0x3d,0x95,0xe4,0xaf,0x0,0xec,0x11,0xee,0x5,0x22,0xb4,0x90,0x9c,0xfc,0xe1,0x3f,0x5b,0x0,0x63,0x49,0xf3,0x48,0x67,0x2c,0x4d,0x4f,0xa,0x76,0x2b,0x6,0x68,0xf,0x18,0x79,0xcd,0xd2,0x3d,0x24,0xbd,0x4c,0xf2,0xc0,0x62,0xb5,0x33,0xce,0x5b,0x59,0xd2,0x26,0x92,0x2f,0x91,0xbc,0xf8,0xc5,0x19,0xc7,0x6c,0x6a,0x4b,0x3e,0xf5,0xa,0xff,0xf4,0xc,0x0,0x0,0x23,0xaf,0x7e,0xe1,0x7a,0x1a,0x5e,0x7,0x20,0xe5,0xfb,0x61,0x65,0x0,0xec,0x82,0xb0,0xb,0xc4,0xe,0x0,0x5b,0x24,0x6d,0x26,0xb9,0xd,0xc2,0x66,0x41,0x4b,0x8c,0x31,0xbf,0xfb,0xfd,0x4f,0x8e,0x59,0x57,0x63,0xd6,0x9d,0xe,0x75,0xa3,0x6,0x76,0x26,0xd0,0x98,0xff,0x91,0x74,0x8,0x80,0x1e,0x24,0xb7,0xc0,0xdb,0x5b,0x6f,0x33,0xd,0xdf,0x3,0xf0,0xb6,0xa4,0x57,0x1,0xbc,0xf4,0xe2,0x8c,0x63,0xdf,0xe9,0xec,0xb2,0x76,0x41,0x17,0x74,0x41,0x17,0x74,0x41,0x17,0x74,0x41,0x17,0x74,0x41,0x17,0x74,0x41,0x17,0xd4,0x6,0xff,0x1f,0x32,0x68,0x5,0x7e,0x99,0xd5,0x97,0x49,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 line_edit_focus_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, 0xab, 0x50, 0x4c, 0x54, 0x45, 0x1b, 0x17, 0x18, 0x1b, 0x17, 0x18, 0x1b, 0x17, 0x18, 0xc8, 0x68, 0x12, 0xef, 0xed, 0xe7, 0xef, 0xed, 0xe8, 0xf0, 0xed, 0xe8, 0xf0, 0xee, 0xe8, 0xf0, 0xed, 0xe7, 0xed, 0xeb, 0xe5, 0xee, 0xeb, 0xe5, 0xee, 0xeb, 0xe6, 0xec, 0xe9, 0xe3, 0xeb, 0xe9, 0xe3, 0xeb, 0xe9, 0xe2, 0xec, 0xe9, 0xe2, 0xe9, 0xe6, 0xe0, 0xea, 0xe7, 0xe0, 0xea, 0xe7, 0xe1, 0xe8, 0xe4, 0xdd, 0xe8, 0xe5, 0xde, 0xe8, 0xe5, 0xdd, 0xe8, 0xe4, 0xde, 0xe6, 0xe2, 0xdb, 0xe6, 0xe3, 0xdb, 0xe6, 0xe3, 0xdc, 0xe7, 0xe2, 0xdb, 0xe7, 0xe3, 0xdb, 0xe4, 0xe0, 0xd8, 0xe5, 0xe0, 0xd8, 0xe5, 0xe1, 0xd9, 0xe5, 0xe0, 0xd9, 0xe4, 0xe1, 0xd9, 0xe5, 0xe1, 0xd8, 0xe4, 0xe0, 0xd9, 0xe2, 0xdf, 0xd6, 0xe3, 0xdf, 0xd6, 0xe3, 0xde, 0xd6, 0xe2, 0xde, 0xd6, 0xe1, 0xdc, 0xd4, 0xe1, 0xdc, 0xd3, 0xe0, 0xdc, 0xd3, 0xe1, 0xdd, 0xd3, 0xe1, 0xdd, 0xd4, 0xdf, 0xda, 0xd0, 0xdf, 0xda, 0xd1, 0xdf, 0xdb, 0xd1, 0xe0, 0xda, 0xd1, 0xdd, 0xd8, 0xcf, 0xdd, 0xd8, 0xce, 0xde, 0xd9, 0xce, 0xde, 0xd8, 0xce, 0xdd, 0xd9, 0xce, 0xdc, 0xd6, 0xcc, 0xdb, 0xd6, 0xcc, 0xdc, 0xd6, 0xcb, 0xff, 0xff, 0xff, 0x73, 0x72, 0x65, 0x6f, 0x0, 0x0, 0x0, 0x2, 0x74, 0x52, 0x4e, 0x53, 0x36, 0x61, 0xc5, 0x3a, 0xd, 0x83, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x38, 0xa0, 0x7, 0xa5, 0xd6, 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, 0x9e, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x5d, 0xcf, 0xdb, 0x16, 0x82, 0x20, 0x10, 0x85, 0x61, 0xb4, 0xb4, 0x13, 0x1d, 0x28, 0x14, 0xcb, 0x4a, 0x33, 0xf, 0x59, 0x52, 0x98, 0x62, 0xef, 0xff, 0x66, 0xd1, 0xf6, 0xca, 0xfe, 0x19, 0xd6, 0x62, 0x7d, 0x77, 0x43, 0x88, 0x3d, 0x88, 0x10, 0x7b, 0x34, 0xc8, 0x36, 0x30, 0x76, 0x1c, 0x77, 0xe2, 0x3a, 0xee, 0xd4, 0x7c, 0x0, 0xb3, 0x79, 0x3f, 0xa6, 0x5, 0x80, 0xa2, 0x25, 0xa5, 0xab, 0x35, 0x5, 0x6c, 0x18, 0x63, 0x5b, 0xd6, 0x7, 0xd8, 0x71, 0xcf, 0xe3, 0x9c, 0xfb, 0x9c, 0x7b, 0x3e, 0x40, 0x4, 0xfb, 0xe0, 0x10, 0x84, 0xa1, 0x8, 0x85, 0x0, 0x1c, 0x4f, 0xe7, 0x28, 0xbe, 0x44, 0x71, 0x9c, 0x24, 0x67, 0xc0, 0x35, 0x4d, 0xb3, 0x2c, 0xcb, 0xcd, 0x4b, 0x73, 0x40, 0x71, 0x33, 0x15, 0xe5, 0xfd, 0x51, 0x16, 0x25, 0xa0, 0x92, 0xf2, 0xf9, 0x92, 0xbf, 0x2a, 0x9, 0x50, 0xaa, 0x56, 0xef, 0x46, 0xb5, 0x4d, 0x5b, 0x37, 0x0, 0xdd, 0x7d, 0xb4, 0x36, 0xdb, 0x69, 0xad, 0x1, 0x7f, 0xc7, 0x59, 0xc3, 0xf3, 0xad, 0x2f, 0x30, 0x4f, 0x11, 0x50, 0x3e, 0x12, 0x48, 0xdb, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 option_arrow_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xc,0x0,0x0,0x0,0xc,0x8,0x6,0x0,0x0,0x0,0x56,0x75,0x5c,0xe7,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x98,0x49,0x44,0x41,0x54,0x28,0x91,0xbd,0x91,0xb1,0xd,0xc2,0x30,0x10,0x45,0xdf,0xd1,0xb8,0xf0,0x2,0xee,0xdc,0x87,0x1,0xd8,0x24,0xb5,0xe9,0x19,0x87,0x1e,0xea,0x6c,0xc2,0x0,0xa4,0xb5,0xdc,0x79,0x1,0x17,0xae,0x8e,0x26,0x48,0x76,0x14,0x40,0x48,0x88,0xdf,0xfd,0xf7,0xef,0x4b,0x77,0x3a,0xf8,0x85,0x62,0x8c,0x21,0xc6,0x18,0xb6,0x32,0x59,0x83,0x94,0xd2,0x5e,0x55,0x6f,0x0,0x22,0x72,0xf0,0xde,0xdf,0xdb,0x7c,0xd7,0x9a,0x9c,0xb3,0x55,0xd5,0x9,0xb0,0x80,0x55,0xd5,0x29,0xe7,0x6c,0x5f,0x16,0x6a,0xad,0x67,0x60,0x68,0xd0,0xb0,0xb0,0x3f,0xaa,0x3b,0x3a,0xa5,0x74,0x51,0xd5,0xd0,0xd,0x88,0x5c,0xbd,0xf7,0xc7,0xa7,0xef,0x6e,0x30,0xc6,0x9c,0x80,0xb9,0x41,0xf3,0xc2,0xd8,0x2c,0x38,0xe7,0x8a,0x88,0x8c,0x40,0x1,0x8a,0x88,0x8c,0xce,0xb9,0xf2,0x71,0xcf,0x77,0x8f,0xfb,0x5a,0xf,0x28,0x4a,0x37,0xff,0x58,0x46,0x7b,0x50,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char logo_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x80, 0x8, 0x6, 0x0, 0x0, 0x0, 0xc3, 0x3e, 0x61, 0xcb, 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, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0x2e, 0x23, 0x0, 0x0, 0x2e, 0x23, 0x1, 0x78, 0xa5, 0x3f, 0x76, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xdc, 0x9, 0x7, 0x13, 0x2, 0x0, 0x15, 0xb9, 0x53, 0x97, 0x0, 0x0, 0x21, 0x58, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0x7d, 0x79, 0x9c, 0x1c, 0x55, 0xb5, 0xff, 0xf7, 0x7b, 0xab, 0x7b, 0x66, 0x48, 0x8, 0x61, 0xd1, 0x90, 0xb0, 0x88, 0x91, 0x27, 0x24, 0x24, 0x21, 0x3b, 0x8, 0x4, 0x42, 0x58, 0x54, 0xe0, 0x91, 0x80, 0x24, 0x1, 0x2, 0x9, 0x42, 0x80, 0x4, 0x11, 0x90, 0x9f, 0xf2, 0xd3, 0xa7, 0xcf, 0xe7, 0xf3, 0x3d, 0x1f, 0x1f, 0x7f, 0xea, 0xd3, 0x48, 0x4c, 0x8, 0x61, 0xd, 0x49, 0x64, 0x89, 0x82, 0x40, 0x58, 0x4, 0x64, 0xb, 0x44, 0x25, 0x9b, 0xd9, 0x51, 0x14, 0x41, 0x3, 0xc8, 0x16, 0x20, 0xfb, 0x4c, 0x77, 0xdd, 0xef, 0xef, 0x8f, 0xaa, 0xea, 0xae, 0xee, 0xa9, 0xea, 0x9e, 0xee, 0xae, 0x99, 0xe9, 0xe0, 0x9c, 0xf9, 0xd4, 0x74, 0xd5, 0xad, 0x5b, 0x77, 0x39, 0xe7, 0xdc, 0x7b, 0xcf, 0x39, 0xf7, 0xdc, 0x7b, 0x81, 0x2e, 0xe8, 0x82, 0x2e, 0xe8, 0x82, 0x2e, 0xe8, 0x82, 0x2e, 0xe8, 0x82, 0x2e, 0xe8, 0x82, 0x2e, 0xf8, 0xe7, 0x2, 0x76, 0x76, 0x1, 0xea, 0x1, 0xe, 0xff, 0xc2, 0xcc, 0xbd, 0x60, 0x5b, 0x6e, 0xb6, 0xd6, 0xf6, 0x2, 0xb8, 0x8d, 0xc6, 0x6c, 0x36, 0x34, 0x6f, 0x81, 0x7c, 0x43, 0x30, 0x7f, 0x27, 0xcd, 0xdf, 0x8c, 0xe3, 0x6c, 0xda, 0x70, 0xef, 0xf4, 0x37, 0x3b, 0xbb, 0xac, 0x49, 0x43, 0xaa, 0xb3, 0xb, 0x50, 0xf, 0x20, 0x9b, 0xfd, 0x96, 0xcd, 0xb6, 0x4c, 0x40, 0xd0, 0x20, 0x2c, 0xac, 0x4b, 0xb3, 0x3, 0xc0, 0x36, 0x80, 0x5b, 0x41, 0x6c, 0x75, 0x5b, 0xb8, 0xed, 0xb0, 0x71, 0xff, 0xbb, 0x83, 0xc6, 0x6c, 0x26, 0x9d, 0x65, 0x74, 0xd2, 0x4f, 0x6e, 0x5c, 0x74, 0xc5, 0xba, 0xce, 0x2e, 0x7b, 0xad, 0xf0, 0x4f, 0xdf, 0x3, 0xf4, 0x9f, 0x38, 0xb7, 0x5b, 0x76, 0xd7, 0x7, 0x2f, 0xcb, 0xda, 0x3, 0xc8, 0x42, 0x94, 0x48, 0x6a, 0x15, 0x9f, 0x24, 0x0, 0xbe, 0x43, 0xe3, 0xfc, 0xc1, 0x49, 0x37, 0x4d, 0xdd, 0xf8, 0x8b, 0x2b, 0xff, 0xde, 0xd9, 0x75, 0xa8, 0x5, 0x76, 0x2b, 0x6, 0xe8, 0x37, 0x7e, 0xf6, 0x18, 0xeb, 0xb6, 0x9c, 0x6, 0x69, 0xf, 0x1a, 0xf3, 0xc1, 0x1f, 0xef, 0xbb, 0xe6, 0xdb, 0xb5, 0xa4, 0x37, 0xf2, 0x9a, 0xa5, 0xdc, 0xb2, 0x69, 0xe5, 0x69, 0xca, 0xec, 0xf8, 0xa5, 0xa4, 0x26, 0x48, 0xf2, 0x29, 0x8c, 0x82, 0x7b, 0x40, 0x3e, 0xae, 0xfc, 0x5f, 0x41, 0x82, 0x4d, 0x37, 0xf5, 0x18, 0xb7, 0xd7, 0xc1, 0xc3, 0x1f, 0xfe, 0xfd, 0x4f, 0x3e, 0xa3, 0x2a, 0x8b, 0xd0, 0xe9, 0x50, 0xf7, 0xc, 0x70, 0xf8, 0x39, 0xb3, 0x3e, 0x9, 0xb9, 0xa7, 0x48, 0xf6, 0x70, 0xb9, 0xd9, 0xd1, 0x90, 0x3b, 0xd2, 0x2b, 0x39, 0x9b, 0x4d, 0xaa, 0x69, 0xfa, 0x1f, 0xef, 0xbb, 0xfa, 0x8e, 0x5a, 0xd2, 0x3f, 0x6c, 0xdc, 0x8f, 0x9f, 0x91, 0xcd, 0x8c, 0x2, 0xe9, 0xe4, 0x43, 0x3, 0x7a, 0xc7, 0x80, 0x4, 0x80, 0xbb, 0x9c, 0x74, 0xd3, 0x77, 0xdd, 0xcc, 0xce, 0x1f, 0xbc, 0xfc, 0xd0, 0xd7, 0x6d, 0x67, 0xe3, 0xa9, 0x5a, 0xa8, 0x5b, 0x19, 0xa0, 0xdf, 0xf8, 0xd9, 0x47, 0x42, 0xee, 0x51, 0x72, 0x5b, 0x3e, 0x6b, 0xdd, 0xcc, 0x69, 0x0, 0xf6, 0xf4, 0x8, 0xe3, 0x75, 0xc3, 0x92, 0x1a, 0x6d, 0x66, 0xd7, 0x8f, 0xfa, 0x8d, 0x9f, 0xf5, 0xe7, 0x97, 0x7e, 0x71, 0xe5, 0xf3, 0x55, 0xe5, 0x31, 0xe1, 0xc6, 0x83, 0xdc, 0x5d, 0x5b, 0x46, 0x3, 0x7e, 0xb3, 0xce, 0x51, 0xbd, 0x74, 0xbb, 0xf0, 0x9b, 0xbb, 0x23, 0xd9, 0x23, 0x59, 0xf7, 0x4d, 0xa8, 0x34, 0xd4, 0x1d, 0x3, 0xf4, 0x3b, 0x67, 0xf6, 0x20, 0xc0, 0x1d, 0x65, 0xb3, 0xcd, 0x67, 0xc9, 0xcd, 0x9c, 0xa, 0x9f, 0x1a, 0xfe, 0xd8, 0x5b, 0xd0, 0x15, 0xb, 0xda, 0xcf, 0x66, 0x9a, 0x7f, 0xd8, 0x7f, 0xc2, 0x9c, 0xb1, 0x1b, 0x17, 0x4d, 0x7f, 0xa7, 0x92, 0x7c, 0xe, 0xff, 0xc2, 0xd, 0x69, 0x58, 0x77, 0x1c, 0x40, 0x17, 0x84, 0x3, 0x54, 0x48, 0x4a, 0xd2, 0x91, 0x75, 0x7, 0x38, 0x4d, 0x7b, 0xef, 0xd6, 0x2c, 0x50, 0x37, 0xc, 0xd0, 0x7f, 0xc2, 0x8d, 0x7, 0x3, 0x1a, 0x65, 0x33, 0xcd, 0x97, 0x58, 0x9b, 0x3d, 0x5, 0x0, 0x40, 0xe6, 0x5a, 0xa6, 0x82, 0x47, 0xbf, 0x13, 0x0, 0x21, 0x82, 0x90, 0xdc, 0xcf, 0xc8, 0x66, 0xbe, 0xd6, 0x6f, 0xfc, 0xac, 0xef, 0xbc, 0xf4, 0x8b, 0x2b, 0x77, 0xb5, 0x35, 0x3f, 0x93, 0x6a, 0xb4, 0x36, 0xb3, 0xe3, 0x7c, 0x1a, 0xe3, 0x8f, 0xe9, 0xe1, 0x21, 0x3f, 0x4, 0xe1, 0xd1, 0x40, 0x80, 0x24, 0xd1, 0x90, 0x10, 0x8c, 0x64, 0xf, 0x31, 0xa9, 0xa6, 0x2e, 0x6, 0x48, 0x2, 0x64, 0xb3, 0xdf, 0xb0, 0xd9, 0xe6, 0x2f, 0x1, 0x41, 0x6b, 0xf7, 0x9, 0x2f, 0x91, 0x1e, 0x23, 0x78, 0x40, 0x9f, 0x8, 0x34, 0x41, 0x90, 0x75, 0x33, 0xbb, 0xfe, 0xaf, 0xd3, 0xd0, 0x7d, 0xd9, 0x61, 0xe3, 0x7e, 0x78, 0xdf, 0x9f, 0x1e, 0xb8, 0x2e, 0x72, 0x3c, 0x1e, 0x30, 0xe9, 0xce, 0x94, 0xdb, 0xb2, 0x7d, 0x1f, 0xd2, 0xf4, 0x0, 0x6c, 0x1a, 0xb2, 0xbd, 0x65, 0xdd, 0xcf, 0x0, 0x30, 0x0, 0x41, 0x42, 0x91, 0xbd, 0x0, 0xb, 0xef, 0x49, 0x52, 0x9e, 0x7a, 0x40, 0x48, 0x7b, 0xee, 0x6, 0x62, 0x54, 0x49, 0xa8, 0x1b, 0x6, 0xb0, 0xd9, 0xcc, 0x39, 0x7e, 0x6b, 0xb, 0xda, 0x5c, 0xa8, 0xeb, 0x2f, 0x4, 0x7a, 0x81, 0x41, 0x3c, 0x3, 0x10, 0x36, 0xbb, 0xeb, 0xc7, 0x4e, 0x43, 0x8f, 0xd7, 0xfa, 0x4f, 0xb8, 0x71, 0x3, 0x68, 0xf6, 0x7, 0xb0, 0x37, 0x81, 0x34, 0x8, 0xca, 0xda, 0x46, 0xb7, 0x65, 0xeb, 0x27, 0x20, 0x3b, 0xd8, 0x75, 0xdd, 0xbe, 0x4, 0xf6, 0x83, 0x74, 0x30, 0x80, 0x40, 0xf0, 0x53, 0x25, 0x43, 0x0, 0xfd, 0xff, 0x22, 0xad, 0xcd, 0xee, 0xac, 0x59, 0x3, 0xe8, 0x7f, 0xee, 0x2d, 0xdd, 0x36, 0xde, 0x73, 0xe9, 0x8e, 0xce, 0xc0, 0x7b, 0xdd, 0x30, 0x0, 0x8d, 0xf3, 0xb2, 0xac, 0x3e, 0xe, 0xc0, 0x20, 0x4e, 0xc, 0xf, 0xc8, 0x1e, 0x3c, 0xf9, 0x8a, 0x3a, 0x49, 0x40, 0xf6, 0x60, 0xeb, 0xb6, 0xfc, 0x1f, 0xd2, 0xac, 0xb3, 0xb6, 0xf9, 0x24, 0x78, 0xad, 0xbb, 0x9b, 0x17, 0xb5, 0x90, 0x46, 0xca, 0x25, 0x46, 0x85, 0x52, 0x8e, 0xcb, 0xa7, 0x30, 0xdc, 0x4a, 0xa0, 0x21, 0xe8, 0x7d, 0xed, 0x36, 0x6f, 0xad, 0x89, 0x1, 0x8e, 0x38, 0x77, 0x6e, 0x5f, 0xeb, 0xb6, 0x9c, 0xde, 0x7f, 0xc2, 0x9c, 0xe7, 0x36, 0x2e, 0x9a, 0xbe, 0xb6, 0xc3, 0xf1, 0xde, 0xd1, 0x19, 0xc6, 0x41, 0xff, 0x9, 0xb3, 0xbf, 0x67, 0x33, 0xcd, 0x5f, 0x96, 0x6c, 0xcf, 0x70, 0xab, 0x8f, 0xa3, 0x43, 0x41, 0xb8, 0x4, 0x90, 0x16, 0x80, 0x41, 0xd8, 0x78, 0x43, 0x6, 0xef, 0x8a, 0xf4, 0x7a, 0x9, 0xf2, 0xfa, 0x7d, 0xff, 0xb1, 0x40, 0x0, 0x60, 0x51, 0xde, 0xc5, 0xf9, 0x11, 0x39, 0x23, 0x51, 0xd6, 0x69, 0xdc, 0xf3, 0x18, 0xc9, 0xbe, 0x61, 0x9c, 0x86, 0xad, 0x1b, 0xee, 0x9e, 0xba, 0xb5, 0xad, 0xf5, 0x3d, 0xe2, 0xbc, 0x5b, 0xbb, 0xc1, 0xba, 0x9f, 0xc8, 0x66, 0xb6, 0x2f, 0x86, 0x74, 0x28, 0x80, 0xb7, 0x4d, 0xba, 0xdb, 0xb9, 0xc6, 0x38, 0x4b, 0x37, 0xdc, 0x73, 0x59, 0x4b, 0x47, 0xe1, 0xbd, 0x6e, 0x18, 0xa0, 0xdf, 0x84, 0x39, 0xa7, 0x2b, 0xb3, 0x73, 0x2e, 0xa0, 0x3, 0x81, 0x60, 0x9c, 0x6f, 0x73, 0xb7, 0x1c, 0xc8, 0xb, 0x20, 0xf3, 0xad, 0x3a, 0xf4, 0x9c, 0x78, 0x3d, 0x95, 0x37, 0x13, 0x92, 0xc6, 0xf9, 0xb, 0x9d, 0xf4, 0x22, 0x63, 0x52, 0xb7, 0x3, 0x78, 0x3d, 0xdb, 0xbc, 0x6d, 0xe7, 0x9f, 0x1e, 0xf8, 0x6a, 0xac, 0x6d, 0xa0, 0xff, 0x84, 0x39, 0xfb, 0x4b, 0xee, 0x14, 0x9b, 0x69, 0xfe, 0x41, 0x90, 0x9a, 0x2f, 0x5b, 0xc0, 0xa4, 0x9b, 0xfe, 0xcd, 0x18, 0xe7, 0x96, 0xd, 0xf7, 0x4e, 0x7f, 0xb7, 0x23, 0xf0, 0x5e, 0x37, 0xc, 0xd0, 0xff, 0xdc, 0x9b, 0x3f, 0x65, 0x5b, 0xb6, 0x3f, 0x21, 0xd9, 0x4f, 0x41, 0x8, 0x24, 0xed, 0xb6, 0x95, 0x56, 0x65, 0xde, 0x25, 0x55, 0x53, 0x3f, 0xad, 0x9c, 0x26, 0xe0, 0x3f, 0x14, 0xf4, 0x1e, 0x26, 0x75, 0x3f, 0x9d, 0x86, 0x9f, 0xd2, 0x49, 0xaf, 0xec, 0xd1, 0xfb, 0x88, 0x6d, 0xc5, 0x56, 0xc2, 0xfe, 0x13, 0x6f, 0x3a, 0xcc, 0x66, 0x9b, 0xe7, 0x40, 0xee, 0x18, 0x0, 0x5e, 0xaf, 0x15, 0x24, 0x3, 0x8, 0x24, 0x8d, 0xd3, 0x70, 0x13, 0x4c, 0xea, 0xfb, 0x1b, 0xef, 0x9d, 0xf6, 0x6a, 0x7b, 0xe3, 0xdd, 0xb4, 0x77, 0x6, 0x6d, 0x85, 0x8d, 0xf7, 0x5c, 0xf6, 0xa, 0x69, 0x9a, 0x3d, 0x51, 0x3b, 0xc0, 0x26, 0xfd, 0xb, 0xa5, 0x9, 0x58, 0xaa, 0xa3, 0x28, 0xf7, 0x6d, 0x25, 0xe0, 0xa7, 0x95, 0x27, 0x3e, 0x94, 0xcf, 0xc0, 0xd3, 0x26, 0xad, 0x9b, 0x3d, 0xdb, 0x6d, 0xd9, 0xf1, 0x8c, 0x6d, 0xd9, 0xfe, 0xdc, 0x96, 0xd7, 0x57, 0x9f, 0x11, 0xfe, 0xfc, 0x88, 0x73, 0xe7, 0x9e, 0xec, 0xb6, 0xec, 0xd8, 0x28, 0xeb, 0x8e, 0xf1, 0xbe, 0xf5, 0xf1, 0x2f, 0x88, 0xa0, 0xcf, 0x48, 0xb4, 0xd6, 0x6d, 0x99, 0x66, 0xb3, 0x2d, 0xf3, 0xfb, 0x4f, 0x9c, 0x7b, 0x5c, 0x7b, 0xe3, 0xbd, 0x6e, 0x7a, 0x0, 0x0, 0xe8, 0x77, 0xce, 0xcf, 0x9e, 0xb3, 0x6e, 0xe6, 0x78, 0x20, 0x5a, 0xfa, 0xaf, 0x3f, 0x8, 0x86, 0x81, 0x7c, 0x61, 0xfd, 0x91, 0x41, 0x64, 0xa0, 0x5a, 0x38, 0x2b, 0x4c, 0xba, 0xf1, 0x3b, 0x4, 0x7a, 0x66, 0x5b, 0x76, 0x2c, 0xf4, 0xf8, 0xbb, 0xd5, 0xb0, 0x54, 0xd0, 0x4f, 0x5, 0x6a, 0x26, 0x8d, 0x79, 0x8d, 0x4e, 0xd3, 0xbf, 0xbd, 0xb4, 0x68, 0xda, 0x5d, 0xed, 0x55, 0x3, 0xa7, 0xf6, 0x24, 0x92, 0x83, 0x8f, 0xf, 0x1c, 0x9b, 0x2, 0x34, 0x9c, 0x40, 0x8f, 0x78, 0xcb, 0x4c, 0x3d, 0x41, 0xd0, 0x45, 0xf9, 0xe0, 0xcb, 0x2d, 0xbe, 0xd5, 0x92, 0x14, 0x24, 0xa2, 0xb7, 0x6c, 0x76, 0x82, 0xac, 0x7b, 0x16, 0x29, 0x27, 0x50, 0x21, 0x1, 0x85, 0xba, 0xba, 0x5c, 0x37, 0xe2, 0xdb, 0xbb, 0x72, 0x36, 0xb0, 0xbd, 0x61, 0xdd, 0x13, 0xf7, 0x3f, 0xf2, 0xec, 0x96, 0x77, 0xd6, 0x2f, 0xfe, 0x5d, 0x7b, 0xd4, 0xa0, 0x6e, 0x86, 0x0, 0xaf, 0x34, 0xce, 0x12, 0x0, 0xef, 0x7b, 0xf7, 0x86, 0xf9, 0x21, 0x60, 0x37, 0xb9, 0x8c, 0xf1, 0x94, 0xc3, 0x80, 0x71, 0x69, 0x40, 0xd2, 0x90, 0x6c, 0x0, 0xd4, 0x0, 0x18, 0x79, 0x17, 0x8, 0x18, 0x45, 0xa4, 0xe1, 0x31, 0x81, 0x31, 0xfe, 0x7b, 0x3, 0x40, 0xfb, 0x65, 0x33, 0xbb, 0xbe, 0xde, 0x6f, 0xc2, 0x9c, 0xaf, 0xb4, 0x7, 0xca, 0xeb, 0xa6, 0x7, 0xe8, 0x3f, 0x71, 0xee, 0x4, 0x4f, 0x38, 0x52, 0x3f, 0xf8, 0xb6, 0x9e, 0xd0, 0xe8, 0xba, 0xfb, 0x5c, 0x44, 0xae, 0xfd, 0xe7, 0xee, 0x1, 0xbf, 0x67, 0x80, 0x7f, 0x11, 0xa1, 0x77, 0x45, 0xdf, 0x93, 0xa1, 0x74, 0x82, 0x1e, 0x61, 0x4f, 0xca, 0xe, 0xea, 0x35, 0xe8, 0x2c, 0xe7, 0x9d, 0xf5, 0x8b, 0x97, 0x26, 0x89, 0xf7, 0xba, 0x30, 0x4, 0xf5, 0x9f, 0x78, 0xd3, 0x2c, 0x9b, 0xdd, 0x75, 0x36, 0xa0, 0x3e, 0xde, 0x18, 0x69, 0x24, 0x28, 0x6c, 0x0, 0xde, 0x1d, 0x81, 0x31, 0xf7, 0x6d, 0x6, 0x6f, 0x14, 0xf4, 0x70, 0x21, 0xb0, 0x1b, 0xc8, 0xee, 0x49, 0x17, 0xb2, 0xd3, 0x19, 0xe0, 0xf0, 0x73, 0x66, 0x3d, 0xad, 0x6c, 0xcb, 0x48, 0x0, 0xdd, 0xbd, 0x39, 0x1e, 0xdf, 0x74, 0x53, 0xef, 0xc3, 0x7f, 0x87, 0x40, 0xce, 0xe4, 0xd, 0x1a, 0x67, 0xb5, 0x71, 0xd2, 0xd7, 0x27, 0x9d, 0x43, 0x62, 0xc, 0x70, 0xc4, 0xb9, 0x73, 0x7f, 0x24, 0x61, 0x1b, 0x8d, 0xf3, 0xd3, 0xd, 0x77, 0x4f, 0x7d, 0xbf, 0x5c, 0xfc, 0x81, 0x93, 0xee, 0xd8, 0x23, 0xdb, 0xb2, 0xe3, 0x31, 0xd9, 0xec, 0x9, 0x5e, 0x3f, 0x97, 0x13, 0x80, 0xbb, 0x88, 0xef, 0x83, 0x6f, 0xc0, 0x24, 0xe9, 0xbc, 0x63, 0x9c, 0xf4, 0xe2, 0x75, 0x3f, 0xbf, 0x38, 0x71, 0xb, 0x61, 0x22, 0x98, 0x3e, 0xe2, 0xbc, 0x5b, 0x47, 0xd8, 0xcc, 0xce, 0x7, 0x25, 0x75, 0xa3, 0x71, 0xd6, 0x80, 0xe6, 0x75, 0xd2, 0xfc, 0x99, 0xc6, 0x99, 0xb7, 0xe1, 0xee, 0xa9, 0x7f, 0x2e, 0x8e, 0xdf, 0xff, 0xdc, 0x5b, 0xe, 0x95, 0xdb, 0x72, 0x87, 0x6c, 0x76, 0x14, 0xe9, 0xab, 0xc2, 0x5e, 0x4d, 0xe1, 0x49, 0xc7, 0x51, 0xc5, 0x8c, 0x33, 0xb9, 0x87, 0xe7, 0x85, 0x54, 0xe2, 0x9b, 0x62, 0x3, 0x6f, 0xb9, 0xb4, 0x63, 0xb5, 0xb4, 0x88, 0xf0, 0xa8, 0xef, 0x2a, 0x29, 0x6f, 0xeb, 0x6f, 0x72, 0xbe, 0x67, 0x0, 0x41, 0xe7, 0x91, 0x74, 0xd3, 0x9e, 0xe3, 0xd7, 0x2e, 0x98, 0xb2, 0xb3, 0x1a, 0xfa, 0x94, 0x82, 0x9a, 0x19, 0xe0, 0x88, 0xf3, 0xe7, 0xf5, 0x50, 0x76, 0xc7, 0xc3, 0xb2, 0xee, 0x71, 0x80, 0x42, 0x5a, 0x85, 0xd9, 0x42, 0x63, 0xd6, 0x80, 0xce, 0x4a, 0x1a, 0xe7, 0x77, 0x26, 0x95, 0x7e, 0x74, 0xdd, 0x82, 0x29, 0x1f, 0x1c, 0x71, 0xfe, 0x6d, 0x43, 0x6c, 0x66, 0xd7, 0x4d, 0x90, 0x7b, 0x54, 0xa8, 0x18, 0xc2, 0x6e, 0x3e, 0xe0, 0x27, 0xa, 0xca, 0xd9, 0x1c, 0x9, 0x3a, 0xaf, 0x9a, 0x54, 0xc3, 0xbf, 0x6f, 0xb8, 0xfb, 0xd2, 0x85, 0xed, 0x91, 0x55, 0xcd, 0x43, 0x80, 0xdc, 0xe6, 0x1f, 0xcb, 0xba, 0xbe, 0xf1, 0xc6, 0x84, 0xed, 0xf0, 0x7b, 0xc9, 0xba, 0xa3, 0x0, 0x77, 0x94, 0xac, 0x73, 0x86, 0xac, 0x3b, 0xae, 0xff, 0xc4, 0xb9, 0x7f, 0x57, 0xb6, 0x79, 0x38, 0x64, 0x8f, 0xf2, 0x6c, 0xf4, 0xb9, 0x7e, 0xdf, 0x17, 0xf8, 0xca, 0xb5, 0xe0, 0xb6, 0x98, 0xf5, 0x2b, 0x69, 0x95, 0xc5, 0x3e, 0x9f, 0xe1, 0xfb, 0x72, 0x71, 0xdb, 0x52, 0xd6, 0xf0, 0x77, 0x71, 0xe5, 0x2c, 0xec, 0x11, 0x3c, 0xe9, 0x97, 0xb9, 0xf9, 0x26, 0x1a, 0xe7, 0xa9, 0xc6, 0x6e, 0x3d, 0xef, 0xa9, 0x95, 0x4e, 0x71, 0x50, 0x53, 0xab, 0x1b, 0x70, 0xfe, 0x6d, 0x5f, 0xb0, 0x99, 0x9d, 0xbf, 0x90, 0x37, 0x8b, 0x9f, 0xa3, 0x62, 0x48, 0x82, 0x97, 0x82, 0x3c, 0xa, 0x3c, 0xee, 0x68, 0x25, 0x85, 0xad, 0xfd, 0x5d, 0xad, 0x3f, 0x4, 0x9e, 0x25, 0x90, 0x34, 0x4e, 0xea, 0x45, 0x3a, 0xd, 0xd7, 0xad, 0xbf, 0xeb, 0xe2, 0xe7, 0xda, 0x2b, 0xaf, 0xaa, 0x7b, 0x80, 0x81, 0x93, 0xee, 0x38, 0xd8, 0xcd, 0xec, 0xfc, 0xbe, 0x2, 0xa3, 0x95, 0xef, 0x58, 0xc5, 0x90, 0xff, 0x4e, 0xce, 0x98, 0x27, 0x8, 0x26, 0x4f, 0x64, 0x8f, 0xf8, 0x7e, 0xb7, 0x5f, 0xcd, 0x5c, 0x5d, 0x12, 0xf3, 0x7b, 0xd5, 0xb0, 0x5e, 0xa9, 0x6f, 0x8a, 0x1c, 0xc7, 0x2b, 0xae, 0x47, 0xe1, 0x77, 0xde, 0x9d, 0x71, 0xee, 0x69, 0x4f, 0xe2, 0x3, 0x55, 0x5a, 0x2, 0x7, 0x4c, 0x9a, 0xd7, 0x60, 0x6d, 0xf6, 0x5a, 0x59, 0xfb, 0x69, 0x7f, 0xf2, 0xc6, 0x9b, 0x5d, 0x2f, 0x12, 0xdf, 0x73, 0xcf, 0x45, 0xe3, 0xbb, 0x37, 0xe7, 0x91, 0x73, 0xac, 0xa9, 0x1c, 0x2a, 0xfc, 0x46, 0x2a, 0xe8, 0x9f, 0x15, 0xfc, 0x13, 0x50, 0xe0, 0x3e, 0x20, 0x95, 0x49, 0xa8, 0xd4, 0xc4, 0x12, 0x8b, 0x7e, 0x2b, 0xad, 0x7, 0x8b, 0x5f, 0x30, 0x5e, 0x8e, 0x4c, 0x10, 0x2a, 0x66, 0x80, 0x81, 0x17, 0xce, 0x77, 0x20, 0x3b, 0xda, 0x66, 0x5b, 0xae, 0xcd, 0x9b, 0xc1, 0xc3, 0x53, 0x76, 0x9d, 0x7b, 0x29, 0x34, 0x43, 0xe7, 0xdf, 0xfb, 0x73, 0xed, 0x1e, 0x81, 0x25, 0xd0, 0x37, 0x34, 0xe4, 0xae, 0xe0, 0x1d, 0xa3, 0x6d, 0x73, 0xf2, 0xd3, 0xca, 0xdd, 0xb7, 0xff, 0xe5, 0x33, 0xa9, 0xdc, 0x2f, 0xc, 0x98, 0x74, 0xc7, 0xf1, 0xed, 0xc9, 0x0, 0x15, 0xb7, 0xbf, 0x41, 0x17, 0xce, 0xef, 0x93, 0x6d, 0xd9, 0xf9, 0x0, 0xac, 0x3b, 0xd2, 0xeb, 0xc0, 0xe3, 0x54, 0xb7, 0x4a, 0x8a, 0x50, 0x4a, 0x65, 0x2, 0x4a, 0xb, 0x5c, 0x39, 0xc8, 0x77, 0xa2, 0xa, 0xd4, 0xa7, 0x82, 0xb4, 0x3e, 0x0, 0xf9, 0x3e, 0x80, 0x6d, 0x0, 0x76, 0x92, 0xdc, 0x5, 0xd2, 0x42, 0x8, 0xe4, 0x91, 0x14, 0x80, 0x26, 0x9, 0xdd, 0x20, 0xbb, 0xf, 0xa0, 0x5e, 0x90, 0x6f, 0x2a, 0x67, 0x4c, 0x1e, 0x35, 0x6b, 0x2e, 0x11, 0xf5, 0x93, 0xe7, 0x13, 0x0, 0xc2, 0x42, 0x32, 0x34, 0xce, 0x93, 0x26, 0xd5, 0x78, 0xd9, 0xba, 0x85, 0x17, 0xbd, 0x5a, 0x5b, 0x5e, 0xa5, 0x4b, 0xd0, 0x26, 0x18, 0x7c, 0xc5, 0x33, 0xcc, 0x7e, 0xf8, 0xea, 0x19, 0x36, 0xb3, 0xf3, 0x21, 0x0, 0x16, 0x81, 0x12, 0x1f, 0xae, 0x8a, 0xe2, 0x13, 0x2d, 0x18, 0xf2, 0x22, 0x4, 0xe7, 0x3c, 0xef, 0x7, 0xe6, 0xaf, 0xfc, 0x87, 0xad, 0xc8, 0xee, 0x8b, 0x1d, 0xa, 0xd6, 0x8a, 0x84, 0xe6, 0x66, 0xfd, 0x98, 0x2d, 0x34, 0xce, 0x3f, 0x24, 0xbc, 0x4d, 0x9a, 0x4d, 0x30, 0x66, 0x1d, 0xc0, 0x97, 0x48, 0xfe, 0x15, 0xe0, 0x3b, 0x20, 0xdf, 0x23, 0xd4, 0xec, 0x5a, 0x65, 0xd2, 0xe9, 0x86, 0x46, 0xeb, 0x66, 0xba, 0x1, 0xd8, 0xd7, 0x5a, 0xdb, 0x7, 0xd2, 0x0, 0xc9, 0x8e, 0x24, 0x74, 0xb0, 0xa4, 0x8f, 0x1, 0x3a, 0x0, 0xb2, 0xfb, 0x86, 0xab, 0xc2, 0x90, 0xcf, 0x7a, 0x1, 0x33, 0xa8, 0x75, 0x7d, 0xa, 0xe4, 0xfd, 0x8, 0x33, 0x40, 0x41, 0x13, 0xa, 0x3b, 0xc6, 0x7a, 0x35, 0xb2, 0x74, 0x1a, 0xe6, 0x34, 0xef, 0xdc, 0x7e, 0xd5, 0x5f, 0x1e, 0xb8, 0x3a, 0xf1, 0x15, 0x48, 0x15, 0x9, 0x81, 0xee, 0x96, 0xbf, 0xd, 0x92, 0xdb, 0xf2, 0x7d, 0x80, 0xa0, 0x6f, 0xb0, 0xf7, 0xb0, 0x9f, 0x9b, 0xb7, 0x40, 0xde, 0x23, 0xab, 0x88, 0x82, 0xb9, 0xa7, 0xd0, 0xff, 0x1c, 0xc5, 0x43, 0x2c, 0xc3, 0xa8, 0xc6, 0xdb, 0x2a, 0x2c, 0xb0, 0x93, 0x4, 0x62, 0x86, 0xfc, 0x29, 0x78, 0x80, 0x7c, 0xf, 0x30, 0x9b, 0x4, 0xb3, 0x96, 0x4e, 0x6a, 0x71, 0x3a, 0xd5, 0xf0, 0xe0, 0xea, 0x3b, 0x27, 0x95, 0x33, 0xa0, 0xb4, 0x0, 0xd8, 0xa, 0xe0, 0x2d, 0x0, 0x1b, 0x1, 0x3c, 0x15, 0xbc, 0x18, 0x30, 0xe9, 0xce, 0x7e, 0xb2, 0x99, 0x89, 0x80, 0x8e, 0x83, 0xec, 0xa1, 0x92, 0x3d, 0x8, 0x42, 0x63, 0xa0, 0xc1, 0x7a, 0x79, 0x2a, 0x50, 0x79, 0x42, 0x66, 0xcc, 0xbc, 0xab, 0x40, 0x58, 0xd, 0xca, 0xd7, 0x3b, 0xa8, 0x17, 0xfc, 0x70, 0xbf, 0x4a, 0xfe, 0xa, 0x88, 0xc0, 0x30, 0x26, 0xc1, 0x48, 0xee, 0x99, 0x4d, 0xdd, 0xf7, 0x5a, 0xe, 0xe0, 0xf6, 0xa4, 0x19, 0xa0, 0xa2, 0x1e, 0x60, 0xe0, 0x5, 0x77, 0x9e, 0xea, 0x66, 0x76, 0x3e, 0x26, 0xc9, 0x84, 0xb1, 0xdf, 0x91, 0x10, 0xb2, 0x15, 0xcb, 0xd7, 0x32, 0x7c, 0xe, 0xe0, 0xfb, 0x24, 0xdf, 0xa2, 0x49, 0xdd, 0x6c, 0x1c, 0x67, 0xf6, 0xda, 0x5, 0x53, 0xda, 0xbc, 0x48, 0xa4, 0xad, 0x30, 0x60, 0xd2, 0xbc, 0x43, 0x21, 0xf7, 0xbb, 0x92, 0x1d, 0x29, 0xeb, 0x7e, 0x2, 0x52, 0x93, 0xbf, 0x4c, 0x2d, 0xd4, 0x10, 0x12, 0xad, 0x6b, 0xde, 0xa7, 0x91, 0xce, 0x12, 0xa6, 0xf6, 0x38, 0x75, 0xfd, 0xc2, 0xb, 0x9a, 0x93, 0xcc, 0xa3, 0x32, 0x6, 0x98, 0x7c, 0x57, 0xa3, 0xcd, 0x36, 0x9f, 0x23, 0xb7, 0xe5, 0x4e, 0x40, 0x4e, 0xe0, 0x80, 0xd9, 0x51, 0xf6, 0xfb, 0x80, 0xf8, 0x61, 0x84, 0x4b, 0xd8, 0x49, 0x60, 0x87, 0x49, 0x37, 0x7e, 0x7b, 0xdd, 0xc2, 0x8b, 0x6e, 0x6c, 0xf7, 0x42, 0x0, 0x18, 0x30, 0xf9, 0xee, 0x94, 0x32, 0xdb, 0xe7, 0xca, 0xba, 0xa7, 0x1, 0xda, 0x3f, 0xb7, 0x78, 0x25, 0xef, 0x26, 0x98, 0x38, 0x42, 0x24, 0xb9, 0x34, 0xa9, 0x7b, 0x36, 0xdc, 0x3d, 0xf5, 0x82, 0x24, 0xd3, 0xad, 0x5c, 0x8, 0x9c, 0xbc, 0x70, 0xf, 0xeb, 0x66, 0x2f, 0xb3, 0xd9, 0xe6, 0x19, 0xf0, 0xc7, 0x5b, 0x4f, 0x14, 0xc8, 0x69, 0x57, 0x25, 0xd2, 0x2c, 0x67, 0x15, 0xb, 0xc7, 0x29, 0xf2, 0xe5, 0xf7, 0xa7, 0x46, 0xe1, 0x59, 0x19, 0xe1, 0x79, 0xd2, 0x3a, 0x5b, 0x61, 0x9c, 0xdb, 0x68, 0x52, 0x5f, 0x5f, 0xbf, 0x70, 0x72, 0x87, 0xb9, 0x52, 0x7, 0x30, 0x70, 0xf2, 0xcf, 0xbb, 0xb9, 0x2d, 0xdb, 0x97, 0x41, 0xb6, 0x2f, 0xc0, 0x3d, 0x2, 0xe7, 0x64, 0x32, 0xf0, 0x48, 0xe, 0x44, 0xa4, 0x52, 0xe, 0xe6, 0xc5, 0x78, 0x88, 0x14, 0x72, 0x25, 0x89, 0xa0, 0x59, 0xed, 0xa4, 0x1a, 0x3f, 0xb7, 0x6e, 0xe1, 0x94, 0xb7, 0xc2, 0x2f, 0x47, 0x5e, 0xb3, 0x94, 0x3b, 0xdf, 0x7b, 0xc5, 0xd0, 0x69, 0xa0, 0xcd, 0x6c, 0x27, 0x4d, 0x9a, 0x0, 0xdd, 0x75, 0xb, 0x2e, 0x70, 0xcb, 0xd5, 0xa1, 0x2a, 0x2e, 0x1d, 0x34, 0xf9, 0xe7, 0x7b, 0x58, 0xb7, 0xe5, 0xdb, 0x36, 0xdb, 0xf2, 0x75, 0x2, 0x26, 0x34, 0xf0, 0x33, 0x69, 0x57, 0xae, 0x70, 0x97, 0xf, 0x8f, 0xf8, 0x2, 0x0, 0x63, 0xcc, 0x66, 0xa6, 0x1a, 0xc7, 0xae, 0x5b, 0x30, 0x39, 0x51, 0x7, 0x89, 0x6a, 0x60, 0xc0, 0xa4, 0x79, 0xd7, 0xd9, 0x6c, 0xf3, 0x37, 0x0, 0xed, 0xcb, 0xb0, 0x47, 0x50, 0x72, 0x26, 0xab, 0x80, 0xe9, 0x41, 0x93, 0x7a, 0x7e, 0xc3, 0xdd, 0x53, 0x8f, 0x1f, 0x34, 0xe5, 0xee, 0x46, 0x9b, 0x6d, 0xa6, 0x71, 0x1a, 0x9a, 0x24, 0xb7, 0x2f, 0xa4, 0x8f, 0x9, 0xea, 0x49, 0xa0, 0x87, 0xa4, 0x3, 0x69, 0x9c, 0x17, 0x20, 0xf7, 0xf9, 0x75, 0xb, 0x2f, 0xca, 0x94, 0x4a, 0xbc, 0xea, 0xc2, 0xd, 0xbc, 0x70, 0x61, 0x83, 0x6c, 0xf6, 0xdf, 0xe5, 0xb6, 0x7c, 0x13, 0x64, 0xb0, 0x20, 0x23, 0xbf, 0xd8, 0x22, 0x49, 0x8, 0x98, 0x4a, 0x82, 0xa4, 0xac, 0x71, 0x52, 0xcf, 0x3b, 0xd, 0xdd, 0xce, 0x5e, 0x33, 0xef, 0xbc, 0xf, 0x92, 0xcf, 0xac, 0x5a, 0x7c, 0x2c, 0x18, 0x63, 0xb3, 0xbb, 0xe6, 0xc9, 0xda, 0x83, 0x3d, 0x43, 0x17, 0x3, 0x49, 0xbe, 0xf6, 0x6, 0x91, 0x5f, 0xdc, 0x2, 0x1, 0xbb, 0x48, 0xf3, 0x1a, 0xa4, 0xde, 0x80, 0x7a, 0x2, 0x28, 0xd2, 0x81, 0x82, 0x7b, 0xae, 0x34, 0xa9, 0xc6, 0xeb, 0xd6, 0x2d, 0x9c, 0xfc, 0x54, 0xa9, 0xa4, 0xab, 0xf6, 0x9, 0x5c, 0xb7, 0xe0, 0x82, 0x16, 0xa7, 0xb1, 0xfb, 0x7f, 0x99, 0x54, 0xe3, 0x75, 0x4, 0xb2, 0x8, 0x69, 0x33, 0x89, 0x9b, 0x45, 0x7c, 0x24, 0x90, 0xcc, 0x1a, 0x27, 0xfd, 0xf0, 0xfa, 0xbb, 0x2e, 0x19, 0x53, 0x4f, 0xc4, 0xf7, 0xf0, 0x71, 0xe1, 0xd3, 0x26, 0xd5, 0x78, 0xa, 0xe9, 0x6c, 0x40, 0x41, 0xd9, 0x6b, 0x77, 0x6d, 0x43, 0xe1, 0x6f, 0x23, 0x64, 0xf, 0x3, 0xb4, 0x17, 0x8a, 0xde, 0x15, 0xde, 0x6b, 0x88, 0xa0, 0x7f, 0x29, 0x57, 0xee, 0x9a, 0x9c, 0x42, 0xd7, 0xdc, 0x3e, 0x3e, 0xeb, 0x34, 0x74, 0x9f, 0x69, 0x52, 0x4d, 0x53, 0x4, 0xbe, 0xdf, 0x76, 0x8b, 0x60, 0x18, 0x4a, 0x85, 0x31, 0xc7, 0xd6, 0x5e, 0xbf, 0x9f, 0x7a, 0x72, 0xfd, 0x5d, 0x17, 0x9f, 0x95, 0x18, 0xd5, 0x12, 0x86, 0x75, 0xb, 0x26, 0xff, 0xc9, 0x34, 0x34, 0x9d, 0x49, 0xe3, 0x2c, 0xf7, 0x2d, 0x8e, 0xfe, 0xf0, 0x15, 0x26, 0x63, 0x31, 0x59, 0x4b, 0x85, 0x79, 0xcf, 0x7e, 0x7, 0x2b, 0xd2, 0xc8, 0xf3, 0x31, 0xd, 0x2e, 0x8a, 0x34, 0xc1, 0xd4, 0x51, 0x51, 0x47, 0x6c, 0xc, 0x81, 0x4f, 0x7e, 0xea, 0xc2, 0x87, 0x4a, 0xf6, 0x3e, 0x35, 0x7b, 0x5, 0xaf, 0xbe, 0xfd, 0x9c, 0x2c, 0x53, 0xd, 0xf7, 0x93, 0xdc, 0x51, 0x64, 0xa, 0x29, 0x1, 0x51, 0xcc, 0x50, 0x18, 0x26, 0xbf, 0x1f, 0x83, 0xe7, 0x2b, 0x0, 0xe3, 0xa4, 0x9f, 0x6c, 0x49, 0xf7, 0x3a, 0xbd, 0xdd, 0xa8, 0x97, 0x10, 0xac, 0x9b, 0x7f, 0xc1, 0x2b, 0x26, 0xd5, 0x38, 0x85, 0xc6, 0x59, 0x82, 0xfc, 0xec, 0x28, 0xa2, 0x99, 0x1c, 0x65, 0xc2, 0xf2, 0xcf, 0xcc, 0xdb, 0xa9, 0xc3, 0xef, 0x99, 0x7f, 0x95, 0x8b, 0x27, 0x4f, 0x39, 0x12, 0xac, 0xcd, 0x9e, 0xd7, 0x9d, 0x1f, 0x4e, 0x2c, 0x55, 0xde, 0x44, 0xdc, 0xc2, 0x6d, 0x36, 0xd3, 0xf, 0x40, 0xda, 0xa3, 0x17, 0x13, 0x71, 0xe7, 0x26, 0xd, 0x5, 0x58, 0x6f, 0x4a, 0x3c, 0xfd, 0xa8, 0x93, 0x6e, 0x1a, 0xff, 0xf2, 0xbc, 0xd3, 0x77, 0x8b, 0xcd, 0x98, 0xd6, 0xce, 0xbf, 0x60, 0x23, 0x4c, 0x6a, 0x16, 0xe9, 0xbc, 0xec, 0x4d, 0x31, 0x18, 0xc9, 0x53, 0x97, 0x6a, 0xc6, 0x4b, 0x1b, 0x2e, 0x6, 0xb3, 0x6d, 0x90, 0xfa, 0xca, 0xaa, 0x7f, 0xfb, 0x33, 0x80, 0x9b, 0x99, 0x1, 0x70, 0xdf, 0x9a, 0x13, 0x2a, 0x4, 0x1, 0x34, 0x34, 0xce, 0x5a, 0x9a, 0xf4, 0xd, 0x6b, 0xe6, 0x9d, 0xf7, 0x61, 0x7b, 0x11, 0xac, 0x3d, 0x60, 0xfd, 0xc2, 0xc9, 0xf7, 0xc0, 0xa4, 0x6e, 0x7, 0xb9, 0xcd, 0xb7, 0x57, 0x75, 0x98, 0xd1, 0x2c, 0xbc, 0x48, 0x56, 0x50, 0x8f, 0x52, 0x71, 0x6b, 0x66, 0x80, 0x23, 0xa7, 0xdc, 0xb5, 0x17, 0x60, 0x87, 0x92, 0x48, 0xe5, 0xf5, 0xde, 0x44, 0xc4, 0x1e, 0x92, 0xdc, 0x42, 0x93, 0x5a, 0xb0, 0x76, 0xfe, 0xa4, 0xc7, 0x3a, 0xa, 0x79, 0x49, 0x82, 0x31, 0xce, 0x2c, 0x9a, 0xd4, 0xbd, 0xbe, 0x8d, 0x3a, 0x98, 0x25, 0x69, 0xf7, 0x19, 0xc5, 0x80, 0xf8, 0xbe, 0xf6, 0x7c, 0xe4, 0xc0, 0xc9, 0xb, 0x87, 0xc4, 0x96, 0xb1, 0x96, 0xa, 0x1e, 0x7d, 0xed, 0xef, 0x8, 0x72, 0x38, 0x80, 0xb4, 0x97, 0xa1, 0xd7, 0xcd, 0xd5, 0xd2, 0x83, 0xf9, 0x5, 0xf7, 0x2a, 0xe0, 0xa4, 0x1e, 0x0, 0x4d, 0xe2, 0xf6, 0xef, 0x8e, 0x82, 0xb5, 0xf3, 0x27, 0x6d, 0x31, 0x4e, 0xfa, 0x36, 0x18, 0x67, 0x29, 0xfc, 0x3e, 0xd9, 0x9f, 0xe9, 0xab, 0xc, 0x27, 0x11, 0xf7, 0x88, 0x9, 0xf7, 0x47, 0x1, 0xff, 0x3f, 0x1, 0x6b, 0x4f, 0x80, 0x74, 0x76, 0x5c, 0x19, 0x6b, 0x62, 0x80, 0x6d, 0xff, 0xd8, 0x48, 0xeb, 0x66, 0xcf, 0x25, 0x4d, 0xca, 0x2f, 0x51, 0xcd, 0xeb, 0x79, 0x7c, 0x75, 0x9f, 0xa0, 0x79, 0x15, 0x30, 0xf7, 0xaf, 0x9b, 0x3f, 0xa9, 0xa2, 0xdd, 0xbf, 0xea, 0xd, 0xd6, 0xde, 0x79, 0xfe, 0xb, 0x34, 0xa9, 0xc5, 0x0, 0x0, 0x1a, 0x11, 0xac, 0x58, 0x31, 0x64, 0xc4, 0x3d, 0x63, 0xc2, 0x8b, 0xf0, 0x28, 0x92, 0xd, 0x24, 0xfa, 0xc6, 0x95, 0xaf, 0x26, 0x6, 0x58, 0x7f, 0xd7, 0xc5, 0x56, 0x6e, 0x76, 0x2c, 0xa0, 0x34, 0x69, 0xc2, 0x5b, 0xaf, 0x54, 0x7e, 0x91, 0x81, 0xe4, 0xef, 0xf5, 0x22, 0xc6, 0x59, 0x44, 0x63, 0x1e, 0xef, 0x6c, 0x2, 0x26, 0x1, 0xa4, 0x59, 0x4c, 0x93, 0x7a, 0x12, 0xfe, 0x7e, 0x46, 0x28, 0x35, 0xc, 0xb0, 0xb6, 0x6, 0x54, 0x98, 0x16, 0x82, 0x6e, 0xb5, 0xf1, 0xd3, 0xe3, 0xe7, 0x46, 0xd2, 0xba, 0x26, 0x6, 0x18, 0x74, 0xd1, 0x3d, 0x7d, 0x41, 0xf4, 0xf6, 0xc4, 0x76, 0x28, 0xa7, 0xf2, 0x56, 0x39, 0xec, 0xfb, 0x92, 0x3f, 0x49, 0xf3, 0x16, 0x8d, 0xf3, 0xd4, 0xda, 0x3b, 0xcf, 0xdf, 0xde, 0xd9, 0xc4, 0x4b, 0x2, 0xd6, 0xde, 0x79, 0xfe, 0x5a, 0x3a, 0xa9, 0xf9, 0x5e, 0x25, 0x73, 0xe, 0x1f, 0x25, 0xc4, 0x9f, 0xda, 0x2f, 0xcf, 0xaf, 0xc4, 0x50, 0x9e, 0xf5, 0xb4, 0x67, 0x63, 0xb7, 0x1e, 0x7, 0x46, 0x95, 0xad, 0x6a, 0x6, 0x18, 0x7c, 0xc9, 0xfd, 0x29, 0x59, 0x3b, 0xa, 0xa0, 0x4d, 0xa2, 0xe4, 0x81, 0x1, 0x3, 0x20, 0x68, 0x9c, 0xf9, 0x34, 0xce, 0x8a, 0xce, 0x26, 0x5c, 0xa2, 0x40, 0xf3, 0x57, 0xd2, 0xbc, 0x8b, 0x76, 0x76, 0x9f, 0xb, 0x5c, 0xe2, 0xfc, 0x1d, 0x67, 0xe0, 0x73, 0xc3, 0xc1, 0x10, 0x3e, 0x1d, 0x55, 0xac, 0xaa, 0x19, 0x60, 0xf5, 0x6d, 0x67, 0x67, 0x9, 0x7d, 0x26, 0x34, 0xd3, 0x55, 0x93, 0x9a, 0xc3, 0xdc, 0x46, 0x4e, 0x0, 0x4d, 0x6a, 0xd9, 0x9a, 0x3b, 0x26, 0xee, 0xd6, 0x63, 0x7f, 0x31, 0x18, 0x63, 0xd6, 0x9b, 0x54, 0xc3, 0x6c, 0xff, 0x51, 0x91, 0x5b, 0x91, 0xd7, 0x0, 0x85, 0x3e, 0x9, 0x9e, 0x22, 0xe8, 0xd, 0xa5, 0xe6, 0x15, 0x3a, 0xa9, 0xfb, 0x49, 0xf3, 0x46, 0xd4, 0x77, 0x6d, 0xf6, 0x8, 0x1a, 0x74, 0xd1, 0xdd, 0x4d, 0xa4, 0xb3, 0xbf, 0xac, 0xed, 0x2b, 0xe8, 0x40, 0x2, 0x7b, 0x43, 0xee, 0x98, 0xdc, 0x86, 0x8d, 0xc9, 0xa8, 0xb9, 0x24, 0xb9, 0x9, 0xe0, 0xa6, 0x24, 0x91, 0x53, 0xf, 0xb0, 0xfa, 0xf6, 0x9, 0x9b, 0x7, 0x7f, 0x71, 0xd1, 0x43, 0x0, 0xfe, 0x3, 0x0, 0x61, 0x12, 0x30, 0xc1, 0x84, 0x26, 0x80, 0x48, 0x12, 0xb2, 0xca, 0xeb, 0x1, 0x7c, 0x97, 0xc6, 0x79, 0x96, 0x74, 0x16, 0x64, 0x65, 0x16, 0x6f, 0xb8, 0x73, 0x42, 0x36, 0x2a, 0x89, 0x58, 0x6, 0x18, 0x74, 0xd1, 0xbd, 0x3d, 0x21, 0x1d, 0xe, 0xe8, 0x40, 0x90, 0x7b, 0x41, 0xea, 0x25, 0x65, 0x8f, 0x90, 0x75, 0x8f, 0x83, 0xf4, 0xe9, 0x60, 0xe1, 0x7a, 0x68, 0x51, 0x67, 0xad, 0x1e, 0x31, 0x9e, 0x3b, 0x21, 0x53, 0x33, 0x4, 0xac, 0x69, 0x2f, 0x42, 0x74, 0x26, 0x8, 0xb0, 0xa0, 0x79, 0x1f, 0xd2, 0x3e, 0x9, 0x35, 0x97, 0xc0, 0x21, 0xc7, 0x73, 0x8e, 0x1, 0x29, 0x70, 0x33, 0xc9, 0x55, 0x34, 0xa9, 0x87, 0x8c, 0x93, 0x9a, 0xbf, 0xfa, 0xf6, 0xf1, 0x9b, 0x4b, 0x25, 0x11, 0xc9, 0x0, 0x83, 0xbf, 0xb8, 0x68, 0x7f, 0x2b, 0xf7, 0x7c, 0x59, 0x77, 0x3a, 0x64, 0xf, 0x2f, 0xcc, 0x33, 0xa7, 0xb0, 0x7b, 0x4e, 0xa, 0xf0, 0xf9, 0xad, 0xb6, 0x1e, 0x20, 0x67, 0x2c, 0x37, 0x8e, 0xf3, 0xfc, 0x9a, 0x3b, 0x26, 0x6e, 0x4b, 0x8, 0xe7, 0x75, 0x5, 0x92, 0xb6, 0x3, 0xf8, 0x33, 0x80, 0x91, 0x40, 0xa2, 0xdb, 0xd7, 0x51, 0xe0, 0x3f, 0xe8, 0x38, 0xaf, 0x11, 0xe6, 0x41, 0x90, 0x3f, 0x5d, 0x3b, 0xef, 0xdc, 0x36, 0x9, 0xd0, 0x31, 0x3d, 0x80, 0xc6, 0xcb, 0x75, 0xbf, 0x5, 0xe8, 0x63, 0x60, 0xd8, 0xf1, 0xb3, 0xc0, 0x41, 0x23, 0x34, 0x3f, 0xd1, 0x26, 0xb7, 0xed, 0x92, 0x15, 0xc8, 0xff, 0x7c, 0x74, 0xd7, 0x86, 0x93, 0x7c, 0x1b, 0x26, 0xf5, 0x88, 0x6c, 0x76, 0x24, 0x22, 0x5d, 0xca, 0x83, 0xa0, 0x72, 0x4b, 0x90, 0x82, 0x77, 0xca, 0xe1, 0x8d, 0x4e, 0xfa, 0x47, 0xae, 0xab, 0x19, 0x1b, 0x16, 0x9c, 0x57, 0xd6, 0xb, 0x28, 0xc, 0x91, 0x3, 0x91, 0x80, 0x5e, 0x0, 0x1a, 0xbc, 0x42, 0x7b, 0x53, 0x8f, 0x79, 0xe9, 0xd2, 0x14, 0x49, 0xb1, 0x40, 0xe9, 0xe7, 0x8a, 0x6c, 0x1, 0xbb, 0x4, 0x54, 0x54, 0x81, 0xdd, 0x9, 0xd6, 0xdc, 0x31, 0xe1, 0x7d, 0x1a, 0xe7, 0x49, 0x1f, 0x47, 0x11, 0xb6, 0x80, 0x0, 0x8a, 0x9f, 0x11, 0xf3, 0x2e, 0xf7, 0xed, 0x7, 0x80, 0xb9, 0xad, 0x52, 0xe2, 0x3, 0x31, 0x3d, 0x80, 0x64, 0xf, 0x0, 0xb0, 0x97, 0x37, 0xbf, 0xac, 0xfc, 0xc6, 0x36, 0xde, 0x5b, 0x54, 0xd6, 0x73, 0xb5, 0x69, 0x95, 0x6c, 0xb0, 0x2e, 0xe7, 0x1d, 0x82, 0x1d, 0xee, 0xdb, 0xd7, 0x91, 0x40, 0xf2, 0x3d, 0x1f, 0xaf, 0x3e, 0x46, 0x8b, 0x5b, 0x7d, 0x2e, 0x66, 0x4c, 0xa, 0xa1, 0xb5, 0x29, 0xc1, 0xa2, 0x8, 0xc3, 0xb4, 0xe3, 0x38, 0x4d, 0xd5, 0x94, 0x27, 0x7a, 0x8, 0x10, 0x7a, 0xe6, 0xed, 0xcb, 0xc5, 0x63, 0x55, 0xa5, 0x3d, 0x74, 0xb9, 0xf8, 0x61, 0x2c, 0xf0, 0x75, 0x10, 0x89, 0xbb, 0x73, 0xd7, 0x15, 0xd0, 0x8, 0x84, 0x65, 0x68, 0x51, 0x4d, 0x8, 0xf, 0x6d, 0x49, 0x20, 0x7f, 0x97, 0x1f, 0x2d, 0x53, 0x81, 0x3c, 0x56, 0x29, 0x44, 0x32, 0x0, 0x8d, 0x69, 0x90, 0x6b, 0xbd, 0x1d, 0x2c, 0x3b, 0x60, 0x1a, 0x33, 0xe7, 0xf2, 0x47, 0xf3, 0x6, 0xc0, 0x8f, 0x34, 0x3, 0x10, 0x70, 0x9, 0xbe, 0x2f, 0x69, 0xbf, 0x4, 0x51, 0x9b, 0xaa, 0x56, 0x9c, 0x4c, 0x68, 0x9f, 0xc0, 0x72, 0xe3, 0x15, 0x4b, 0xbe, 0xf3, 0x1a, 0x3, 0x41, 0xf2, 0x4d, 0x48, 0x1f, 0x69, 0x6, 0x10, 0xe0, 0xa, 0xfc, 0xb0, 0xd0, 0xc1, 0x27, 0x6a, 0xfc, 0x8f, 0xc3, 0x1d, 0xc3, 0x69, 0xe5, 0xce, 0x2f, 0xaa, 0xd6, 0x1b, 0x37, 0x46, 0xb, 0xc8, 0xa9, 0x7a, 0x68, 0xd5, 0xfb, 0xc7, 0xa, 0xf8, 0x8c, 0x7e, 0x9f, 0xb, 0x63, 0xc9, 0xef, 0xe5, 0x2f, 0xa2, 0xfb, 0xe8, 0xea, 0x0, 0x7e, 0x3d, 0x73, 0xf5, 0x67, 0xcc, 0x6f, 0x14, 0xc4, 0x31, 0x41, 0x58, 0xbe, 0xaa, 0xe, 0x71, 0xd1, 0x43, 0x0, 0x0, 0x5, 0xd4, 0x8a, 0xcc, 0x3b, 0x1c, 0xa8, 0x88, 0xf7, 0x25, 0xca, 0xcf, 0xf0, 0x4d, 0x78, 0x55, 0x2c, 0x1, 0xe0, 0x0, 0xd0, 0x54, 0x25, 0xcc, 0xec, 0x2e, 0x40, 0xd2, 0x11, 0xb0, 0x77, 0x69, 0x7a, 0x85, 0x9, 0x1c, 0x77, 0xf, 0xd0, 0x3f, 0x5b, 0x43, 0x82, 0x6b, 0xad, 0xad, 0xca, 0xb4, 0x1c, 0xad, 0x5, 0x0, 0x2d, 0x79, 0xcb, 0x5e, 0x39, 0x83, 0x45, 0x2d, 0x4d, 0xb6, 0x90, 0x91, 0x8, 0xf4, 0x21, 0xf9, 0x91, 0x67, 0x0, 0x92, 0xfb, 0xb4, 0x6d, 0xb9, 0x0, 0xdb, 0x78, 0xaf, 0x6c, 0xb5, 0x64, 0x88, 0x1e, 0x2, 0xc8, 0xf, 0x19, 0xd8, 0xaa, 0xb, 0x8e, 0xef, 0x8, 0xfa, 0xe8, 0xfc, 0x26, 0x56, 0x5e, 0x9c, 0x10, 0x8f, 0x94, 0xdd, 0x46, 0xa5, 0x88, 0x9f, 0x7c, 0x63, 0xa6, 0x9f, 0xcf, 0x81, 0x0, 0x1a, 0x13, 0xc1, 0x74, 0xdd, 0x82, 0xf2, 0x7b, 0xa9, 0x28, 0x68, 0x5f, 0xc5, 0x50, 0xac, 0x71, 0x17, 0xf5, 0x94, 0x2c, 0x5a, 0x73, 0xe, 0x66, 0x43, 0x1b, 0x74, 0x55, 0x4, 0x91, 0x42, 0x20, 0x61, 0xde, 0x20, 0xb8, 0x85, 0xe1, 0x15, 0x27, 0x40, 0x91, 0x5c, 0x10, 0xb2, 0x7, 0x15, 0xcb, 0x9, 0xa5, 0x64, 0xc2, 0xe2, 0x97, 0x21, 0x9b, 0xa2, 0xa4, 0x8f, 0xeb, 0x23, 0xcf, 0x0, 0xec, 0x5, 0x20, 0xd8, 0x53, 0x0, 0x28, 0x25, 0xf4, 0x15, 0xc, 0x97, 0x21, 0x9c, 0x7, 0x32, 0x9a, 0x2f, 0x48, 0x12, 0xcc, 0x0, 0xa8, 0xea, 0xd0, 0xa9, 0x18, 0x4b, 0xa0, 0xde, 0x2, 0xd9, 0x82, 0x60, 0xc1, 0x81, 0xc7, 0xb6, 0x8, 0x76, 0x44, 0x60, 0x3b, 0xfc, 0xf9, 0x5a, 0x40, 0x13, 0xeb, 0x68, 0x3, 0xeb, 0xa4, 0x61, 0xf0, 0xd4, 0x5f, 0xed, 0x6b, 0xad, 0x7b, 0x8a, 0x8f, 0x57, 0x26, 0x85, 0x3b, 0x49, 0x7b, 0x3, 0xfa, 0xe6, 0xe0, 0x8b, 0x7f, 0x51, 0xb1, 0x56, 0x17, 0xed, 0x26, 0xe4, 0xa4, 0x1e, 0x4, 0x9d, 0x6f, 0xd3, 0x38, 0xcf, 0x6, 0x3e, 0x5a, 0xde, 0xaf, 0xaf, 0xaf, 0x3, 0x40, 0xfe, 0x8, 0xc7, 0x3c, 0x37, 0x16, 0x34, 0xee, 0x98, 0x6e, 0x20, 0x1c, 0x3f, 0xb0, 0x68, 0x41, 0xa2, 0x31, 0x5, 0x61, 0x1f, 0x45, 0x20, 0x4d, 0x2f, 0x40, 0xa7, 0xe5, 0x10, 0x17, 0x65, 0xd5, 0xcd, 0xbd, 0x63, 0x99, 0x9e, 0x34, 0x7f, 0x43, 0x43, 0xc8, 0xba, 0x97, 0x3, 0x7c, 0x7a, 0xf0, 0x25, 0xf7, 0xfd, 0xf7, 0xe0, 0xa9, 0xf, 0xec, 0xdd, 0xe6, 0x32, 0xc5, 0xbd, 0x18, 0x3c, 0xf5, 0x57, 0xdd, 0x1, 0xf6, 0x85, 0xec, 0x41, 0x20, 0x7a, 0x43, 0x38, 0x4, 0xd0, 0x27, 0x25, 0x7b, 0x24, 0x81, 0x81, 0xf0, 0xe7, 0xa, 0x80, 0xf0, 0x36, 0xaf, 0x35, 0x51, 0xcf, 0x3f, 0xf, 0x32, 0xf5, 0x75, 0xe3, 0xa4, 0x6f, 0x5c, 0x75, 0xf3, 0xbf, 0xb6, 0xf9, 0x4, 0xae, 0xdd, 0x5, 0x86, 0x5c, 0xfa, 0xc0, 0x30, 0x9b, 0x6d, 0xf9, 0xd, 0x80, 0xbd, 0x93, 0x30, 0x2, 0x85, 0xf6, 0xc7, 0x9, 0x6f, 0xba, 0xb9, 0x85, 0x34, 0x2b, 0x5, 0x3e, 0x44, 0x63, 0xee, 0x5c, 0x7d, 0xeb, 0x59, 0x25, 0xf, 0x9f, 0x6a, 0x73, 0x29, 0x86, 0x5d, 0xfe, 0x70, 0xf, 0x6b, 0xdd, 0x7d, 0x65, 0xed, 0x1, 0x34, 0x66, 0x7f, 0x59, 0xdb, 0xb, 0x72, 0xaf, 0x96, 0x6c, 0xff, 0xd6, 0x66, 0xcd, 0x1a, 0x2a, 0x44, 0xbe, 0xe9, 0x38, 0xd, 0x13, 0x56, 0xdd, 0x32, 0xf6, 0x85, 0x24, 0xd2, 0xac, 0x27, 0x18, 0x3c, 0xf5, 0x57, 0x23, 0xe5, 0x66, 0x5e, 0xf4, 0x77, 0x15, 0x49, 0x62, 0x15, 0x7d, 0xab, 0xa3, 0x66, 0x82, 0xd3, 0xc7, 0x4, 0x6c, 0x26, 0xcd, 0xb, 0x34, 0xce, 0x42, 0xc7, 0x98, 0xfb, 0x56, 0xde, 0x3c, 0x36, 0x72, 0x99, 0x78, 0x9b, 0x3d, 0x82, 0x56, 0xce, 0x3d, 0x63, 0x2b, 0xbc, 0x7d, 0x74, 0x5e, 0xb, 0x55, 0x68, 0x20, 0x2d, 0xfa, 0x79, 0x25, 0x49, 0x64, 0xd3, 0x2c, 0x1, 0xe8, 0x63, 0xa5, 0x83, 0x6a, 0xc5, 0x4c, 0xbd, 0xc1, 0xd0, 0xcb, 0x16, 0xef, 0x67, 0x6d, 0x76, 0x9c, 0x3f, 0xcc, 0x55, 0x61, 0x62, 0x8f, 0xd4, 0xc6, 0xb, 0xf4, 0xe8, 0xd0, 0xbe, 0x8c, 0x22, 0xb0, 0x2f, 0xa0, 0x33, 0x61, 0xdd, 0xc1, 0x2e, 0x30, 0x74, 0xf0, 0xd4, 0x7, 0x17, 0xac, 0xbe, 0x75, 0xec, 0xba, 0xe2, 0x4, 0xaa, 0x6e, 0xb9, 0xc3, 0xa6, 0x3f, 0x96, 0x32, 0x34, 0xbf, 0xf7, 0x48, 0xef, 0x2f, 0x45, 0xaa, 0x68, 0xf6, 0x37, 0x34, 0xce, 0xf9, 0xaa, 0x65, 0xde, 0xb1, 0x44, 0x9f, 0x19, 0x7a, 0xd9, 0x83, 0xfb, 0x77, 0x14, 0x71, 0x3a, 0x6, 0x34, 0x0, 0xd6, 0x9d, 0xee, 0xf, 0x94, 0x2c, 0xa8, 0x7b, 0x9b, 0xfc, 0x44, 0x59, 0x6, 0x87, 0x41, 0xfb, 0xcb, 0x9d, 0x5b, 0x24, 0x6f, 0x22, 0x4f, 0x9f, 0x80, 0xec, 0x38, 0x52, 0x7d, 0xa2, 0x4a, 0x55, 0x35, 0x3, 0xac, 0x9c, 0xf3, 0xf9, 0xac, 0x80, 0x17, 0xe0, 0x9f, 0xa3, 0x5a, 0x9d, 0xdc, 0x9f, 0x2f, 0xb7, 0xa7, 0x6d, 0x4, 0x9a, 0x86, 0xbd, 0x40, 0xc2, 0x88, 0xce, 0x26, 0x59, 0x92, 0x20, 0xd9, 0x43, 0x1, 0xec, 0x7, 0x50, 0x85, 0xcb, 0x3b, 0xc2, 0x78, 0xa8, 0x1c, 0x87, 0x28, 0xfe, 0xb6, 0x50, 0xbb, 0xa0, 0xdf, 0xad, 0xbe, 0x4a, 0xe3, 0x6c, 0x8c, 0x2a, 0x57, 0x4d, 0x63, 0xf7, 0x1f, 0x6e, 0x19, 0xfb, 0x2a, 0x8d, 0x79, 0x33, 0x98, 0x32, 0x8e, 0x76, 0x74, 0x8d, 0x9a, 0xf4, 0x88, 0xb3, 0x6d, 0x53, 0x0, 0x5, 0xe9, 0xe3, 0xb2, 0xf6, 0xe4, 0x21, 0x97, 0x2d, 0xee, 0xd9, 0xb9, 0x64, 0x4b, 0x6, 0x6, 0x5f, 0xfa, 0xe0, 0x60, 0x59, 0x4d, 0xf6, 0x55, 0xdd, 0xdc, 0x36, 0x37, 0x49, 0x40, 0xac, 0xd7, 0x40, 0xce, 0x96, 0xf, 0x10, 0xdc, 0xd2, 0xd0, 0xfd, 0x63, 0xaf, 0x47, 0xc5, 0xab, 0x89, 0x1, 0x6, 0x5f, 0x72, 0x9f, 0x1, 0xcc, 0x3, 0x2, 0x32, 0x2, 0x90, 0x53, 0xe5, 0xa, 0x2e, 0x14, 0x75, 0x61, 0xc5, 0x5d, 0x5f, 0x41, 0x78, 0x9e, 0x71, 0xa1, 0xf1, 0xb2, 0xf6, 0xd4, 0xc4, 0xa9, 0xd1, 0x9, 0x40, 0xe0, 0xc, 0xc0, 0x8e, 0xf1, 0x1c, 0xab, 0x0, 0x76, 0xc0, 0x89, 0x68, 0x34, 0x39, 0x5f, 0x3e, 0x90, 0x66, 0x57, 0xf1, 0x9, 0xa6, 0x1, 0xd4, 0xc4, 0x0, 0xd, 0x3d, 0x7a, 0xb, 0x34, 0xf7, 0x4a, 0xc8, 0xfa, 0x54, 0x8c, 0x98, 0x19, 0x2a, 0x35, 0x25, 0x5c, 0x1c, 0xb7, 0x60, 0x37, 0xb0, 0x83, 0x49, 0x9d, 0x3d, 0xe4, 0xd2, 0x87, 0x7a, 0x77, 0x36, 0x1, 0x6b, 0x81, 0x21, 0x97, 0x3e, 0x74, 0x2, 0x64, 0xc7, 0xe6, 0x25, 0xff, 0xf0, 0xa, 0xea, 0xb6, 0xe0, 0xaa, 0x54, 0x58, 0xdc, 0xb7, 0x61, 0x13, 0x2d, 0x77, 0xd1, 0x98, 0x57, 0xe2, 0xca, 0x57, 0x13, 0x3, 0x2c, 0xfb, 0xe9, 0xb1, 0xa2, 0x71, 0x56, 0x80, 0x39, 0x37, 0x2e, 0x86, 0x57, 0xf8, 0xb4, 0x86, 0x52, 0x52, 0x8e, 0xf7, 0x3e, 0xef, 0x2e, 0x45, 0x48, 0x1a, 0x7, 0xe0, 0x92, 0x76, 0xa0, 0x4b, 0x87, 0xc0, 0xb0, 0x69, 0x8f, 0xf4, 0x4, 0xf4, 0x45, 0x49, 0x47, 0x7b, 0x92, 0xbf, 0x9, 0x26, 0x4f, 0x22, 0xf0, 0x11, 0x87, 0xab, 0x52, 0x61, 0xb1, 0xd, 0xcb, 0x77, 0x15, 0x20, 0x40, 0x2e, 0x91, 0x70, 0x7f, 0x5c, 0x19, 0x6b, 0xd6, 0xdf, 0x57, 0xcd, 0x3d, 0x7d, 0xab, 0x31, 0xce, 0x8b, 0x20, 0x4b, 0xc, 0x3, 0x95, 0x76, 0x5f, 0x26, 0x30, 0x3e, 0x76, 0x87, 0xec, 0x85, 0x43, 0x2e, 0x7d, 0x68, 0x6c, 0x47, 0x10, 0x2c, 0x69, 0x90, 0xb5, 0x57, 0x49, 0xf6, 0xdc, 0xd0, 0xce, 0x1d, 0x55, 0xe2, 0x4, 0x95, 0xc6, 0xb, 0xe5, 0x65, 0x56, 0xff, 0xe1, 0x96, 0x33, 0x63, 0xd7, 0x59, 0x24, 0x62, 0xc0, 0x31, 0x4e, 0xea, 0x1a, 0x0, 0x9b, 0xdb, 0xd2, 0xc9, 0xc7, 0x89, 0x7f, 0x45, 0xcf, 0x7e, 0x55, 0x68, 0x25, 0xdb, 0x1f, 0xd0, 0x15, 0xc3, 0xa7, 0x3f, 0xba, 0x17, 0x76, 0x23, 0x18, 0x7a, 0xf9, 0xc3, 0x17, 0xc9, 0xba, 0x97, 0x90, 0xec, 0xe6, 0x1f, 0x22, 0xdb, 0xca, 0x15, 0x24, 0xa, 0x3f, 0xa5, 0xde, 0xb0, 0x8d, 0xf1, 0x82, 0x85, 0x96, 0xfe, 0x53, 0xc9, 0x35, 0x16, 0xc9, 0x30, 0x80, 0x49, 0xfd, 0x15, 0x60, 0x16, 0x2c, 0xa7, 0xb4, 0xb4, 0x56, 0x78, 0xe2, 0x9e, 0x7d, 0x7f, 0x44, 0x43, 0x1a, 0x40, 0xfa, 0xbc, 0xeb, 0x66, 0xef, 0x4e, 0x88, 0x36, 0xed, 0xe, 0xc3, 0xa6, 0x3d, 0x72, 0x34, 0x64, 0xaf, 0x4, 0xd1, 0x97, 0x9e, 0xda, 0xc7, 0xb0, 0x7a, 0x86, 0x12, 0xf8, 0x29, 0x3b, 0x61, 0x56, 0x3e, 0x9e, 0x48, 0xe3, 0xef, 0x4b, 0x65, 0x5e, 0x26, 0xcd, 0xba, 0x52, 0x65, 0xad, 0x99, 0x1, 0x86, 0x5f, 0xf1, 0x44, 0xca, 0x75, 0x33, 0x17, 0x93, 0xdc, 0xb3, 0x60, 0x82, 0xa3, 0xc6, 0x8b, 0x86, 0x14, 0x4, 0x1a, 0x7a, 0x9b, 0x2b, 0xc9, 0x9e, 0x36, 0xf4, 0xf2, 0xc5, 0x8b, 0x3b, 0x9b, 0xb8, 0xe5, 0x60, 0xd8, 0xb4, 0x47, 0x87, 0x59, 0xd7, 0x9d, 0x2b, 0xd9, 0x91, 0xb9, 0x63, 0x71, 0x88, 0xa, 0x8d, 0x64, 0x85, 0x97, 0x2, 0xa5, 0x2e, 0x3e, 0x9d, 0x70, 0x78, 0x4e, 0x93, 0x22, 0x9d, 0x7b, 0xff, 0x70, 0xf3, 0xbf, 0xfe, 0xb2, 0x54, 0x79, 0x6b, 0x62, 0x80, 0x61, 0x57, 0x3c, 0x9e, 0x92, 0xcd, 0x5c, 0x27, 0xeb, 0xde, 0x0, 0xa0, 0x67, 0xc1, 0x92, 0xe4, 0x4, 0x2e, 0x7f, 0xdf, 0x3b, 0xfa, 0x27, 0x8c, 0xc1, 0xba, 0xf6, 0xb3, 0x43, 0x2e, 0x5b, 0x7c, 0x7f, 0x65, 0xa5, 0xec, 0x38, 0x18, 0x7a, 0xf9, 0xa3, 0x43, 0x25, 0xf7, 0x2e, 0x40, 0x47, 0xfa, 0x36, 0xd, 0x86, 0x7e, 0x6b, 0xc1, 0x3, 0xbd, 0x65, 0xfe, 0x8, 0x7e, 0xc3, 0x57, 0xee, 0x14, 0x94, 0xf0, 0x5, 0xc0, 0xa5, 0xe1, 0xdf, 0xca, 0x95, 0xb9, 0x6a, 0x6, 0x18, 0x7a, 0xf9, 0xa3, 0xd, 0x72, 0x33, 0xdf, 0xb3, 0xae, 0xfb, 0xdf, 0x0, 0xd3, 0x5e, 0x68, 0xb4, 0x64, 0x5f, 0x9d, 0x2a, 0xd3, 0x3a, 0xdc, 0x18, 0xa6, 0x21, 0x9d, 0x39, 0xe4, 0xd2, 0x87, 0x7e, 0x3b, 0xf4, 0xf2, 0x47, 0x92, 0xde, 0x95, 0xac, 0x26, 0x18, 0x36, 0xed, 0xb1, 0x93, 0xad, 0xcd, 0x3c, 0x28, 0xab, 0xc3, 0xa, 0xd7, 0x52, 0x94, 0xd2, 0x7a, 0xe2, 0x70, 0x81, 0xd6, 0x71, 0xf3, 0x9a, 0xdd, 0x2e, 0x92, 0x1b, 0x40, 0xf3, 0xa6, 0x84, 0x5d, 0xa, 0xb6, 0x53, 0x4, 0x43, 0x62, 0x86, 0x27, 0xfc, 0x9, 0x6c, 0x75, 0x68, 0x67, 0x31, 0x54, 0xc5, 0x0, 0xc3, 0xaf, 0x78, 0xbc, 0x1b, 0xa0, 0x1f, 0x59, 0x6b, 0xaf, 0x3, 0xe1, 0xd0, 0x10, 0xc1, 0x21, 0xc7, 0x85, 0x2b, 0xc7, 0xa2, 0x18, 0x9f, 0x45, 0xe1, 0xcc, 0x8b, 0x2b, 0x5, 0x78, 0x8, 0xb8, 0x9f, 0xa1, 0x74, 0x9, 0x10, 0x46, 0xd0, 0xd1, 0xd6, 0xba, 0x2f, 0xf, 0xb9, 0xfc, 0x91, 0xe3, 0x3a, 0x8c, 0xc2, 0x25, 0x60, 0xc8, 0x65, 0xf, 0xff, 0xa7, 0xb5, 0xd9, 0x45, 0x24, 0xf, 0xa, 0xd4, 0x6f, 0x1a, 0xe3, 0xf9, 0x39, 0x17, 0x8a, 0x3f, 0x85, 0xf5, 0x46, 0xc, 0x2e, 0xa, 0xf1, 0x26, 0x3f, 0x2e, 0x7d, 0x7c, 0xac, 0x5c, 0x75, 0xf3, 0x99, 0x3, 0x8d, 0x93, 0xfe, 0x94, 0x49, 0x35, 0xee, 0x63, 0x52, 0x4d, 0x4d, 0x26, 0x95, 0xee, 0x63, 0x9c, 0xf4, 0x20, 0x3a, 0xe9, 0xd1, 0x74, 0xd2, 0x67, 0xd1, 0x38, 0x5f, 0xa6, 0x71, 0xbe, 0x44, 0xf0, 0xd9, 0x72, 0x65, 0x2f, 0x27, 0xb8, 0x47, 0x10, 0xff, 0xd7, 0x7b, 0xca, 0xda, 0xaf, 0x4a, 0xf6, 0x3b, 0x8, 0x56, 0xa3, 0xb0, 0xd2, 0x95, 0xae, 0x55, 0x2d, 0x8c, 0xf5, 0xd8, 0x5b, 0x62, 0xc8, 0xb9, 0x70, 0x2b, 0x68, 0x1e, 0x4b, 0x77, 0xdb, 0xe7, 0xbc, 0x17, 0x67, 0x1c, 0xd3, 0xe1, 0x9b, 0x48, 0xe, 0xbf, 0xe2, 0x89, 0x46, 0xeb, 0x66, 0xd6, 0xca, 0xba, 0x7, 0x91, 0xdc, 0x23, 0x98, 0x92, 0x87, 0xc4, 0x44, 0x71, 0x12, 0x78, 0xe8, 0x92, 0xab, 0x40, 0xe7, 0xe4, 0x95, 0x73, 0x3e, 0xf7, 0x7e, 0x71, 0x94, 0xa3, 0xbe, 0xf2, 0x5b, 0xb6, 0x6c, 0x7b, 0x97, 0x4e, 0xba, 0x81, 0xb2, 0xd6, 0x48, 0xd6, 0x5d, 0x35, 0xf7, 0x8c, 0xb2, 0x47, 0xcc, 0x54, 0x44, 0x85, 0xa1, 0xd3, 0x1e, 0xed, 0xe, 0x60, 0x32, 0xac, 0x9d, 0x5, 0xf8, 0x67, 0xff, 0xa1, 0xe3, 0xf, 0x8c, 0x40, 0xe1, 0x3c, 0x78, 0xb, 0xc8, 0xb7, 0x4, 0xde, 0xea, 0x66, 0xb3, 0xd7, 0xaf, 0xb9, 0xf5, 0xcc, 0x4c, 0xd, 0x59, 0xb4, 0x9, 0x86, 0x5c, 0xfe, 0x48, 0x9a, 0xc0, 0x22, 0x12, 0x47, 0xc9, 0xda, 0xdc, 0x2c, 0x1b, 0x2b, 0x26, 0x7a, 0x25, 0x55, 0x46, 0x56, 0xe0, 0x5d, 0xab, 0xe6, 0x9e, 0x3e, 0x25, 0xc9, 0xba, 0x54, 0x54, 0xd8, 0x61, 0xd3, 0x1e, 0x3b, 0x49, 0x72, 0x7f, 0xe3, 0x89, 0xb5, 0x1e, 0x9b, 0xb7, 0x4a, 0x2d, 0xee, 0xec, 0x87, 0x70, 0xcc, 0xb8, 0xc5, 0x23, 0x2c, 0x8a, 0xab, 0xc8, 0x38, 0x91, 0xa7, 0x83, 0x49, 0xda, 0x4a, 0x9a, 0xd7, 0x40, 0x2e, 0x2, 0xcc, 0x4f, 0x56, 0xce, 0xf9, 0x6c, 0xe2, 0x1e, 0x45, 0xc3, 0xaf, 0x78, 0x7c, 0xa8, 0xb5, 0xee, 0xb5, 0xde, 0xde, 0x48, 0x3a, 0x88, 0xa4, 0xbf, 0x3f, 0x62, 0x20, 0xaa, 0x7b, 0xc7, 0x27, 0xb6, 0xaa, 0x53, 0xb8, 0x2e, 0x51, 0x38, 0x2a, 0xf6, 0xa4, 0x2e, 0xc4, 0x97, 0xbf, 0xf, 0x3, 0x9f, 0x4d, 0x35, 0x34, 0x7d, 0x6e, 0xd9, 0xcf, 0x4e, 0x4a, 0xf4, 0xc8, 0x98, 0x8a, 0xe, 0x8d, 0x12, 0xf0, 0x16, 0xc0, 0x55, 0x20, 0x86, 0x12, 0x85, 0x47, 0xb7, 0x14, 0x54, 0xa8, 0x18, 0xca, 0x59, 0x7f, 0xc2, 0x61, 0x2c, 0xfb, 0x5d, 0x1e, 0xb5, 0xb9, 0x19, 0x70, 0x89, 0x64, 0xf, 0xc9, 0xe, 0x84, 0x78, 0x10, 0xa9, 0xb, 0x87, 0x4e, 0x7b, 0x74, 0x29, 0xc0, 0xc5, 0x0, 0x9f, 0x58, 0x75, 0xd3, 0xe7, 0x3e, 0xac, 0x16, 0x41, 0x43, 0xa7, 0x3d, 0x76, 0x24, 0x81, 0x33, 0x41, 0x9c, 0x62, 0xdd, 0xec, 0x27, 0x1, 0xf4, 0x26, 0xd1, 0xe4, 0x17, 0x26, 0xe7, 0xa, 0x17, 0xb9, 0x8c, 0x92, 0x6d, 0xb8, 0x8f, 0x7f, 0xe, 0xed, 0xba, 0xc2, 0xd7, 0x68, 0xcc, 0x6d, 0x49, 0x13, 0x3f, 0x8e, 0x14, 0x25, 0x61, 0xd8, 0xf4, 0x5f, 0x9f, 0x2e, 0xeb, 0x3e, 0xc, 0x44, 0xad, 0x70, 0xed, 0x70, 0x28, 0x68, 0x57, 0xa1, 0x1d, 0x4b, 0x20, 0xa9, 0x19, 0xe4, 0x3f, 0x0, 0xbc, 0xb, 0xe0, 0x6d, 0x80, 0x7f, 0x34, 0xc6, 0xbc, 0x28, 0x61, 0x83, 0x64, 0x37, 0x1b, 0x63, 0xb6, 0x9, 0xcc, 0x2, 0x70, 0x8d, 0x31, 0x8e, 0x9b, 0xcd, 0x34, 0x2, 0xec, 0x66, 0xc, 0xf, 0x4, 0x74, 0x8c, 0xb5, 0x3a, 0xe, 0xd0, 0x1, 0x0, 0x7a, 0xc8, 0xda, 0xde, 0x24, 0xf7, 0xcb, 0x21, 0x2d, 0x7c, 0x42, 0xa, 0xa, 0xfb, 0xe9, 0x44, 0x2a, 0x15, 0x4a, 0x4f, 0x92, 0x5, 0xcd, 0x8d, 0x3d, 0xf7, 0xeb, 0x73, 0xd5, 0x33, 0xd7, 0xf, 0x4e, 0x5c, 0xce, 0xa9, 0xf8, 0xec, 0x60, 0x9, 0x2b, 0x40, 0xf3, 0x2, 0xa0, 0xe3, 0x2, 0x4f, 0x9e, 0xf0, 0x69, 0xd1, 0xed, 0xf, 0x5, 0x63, 0x49, 0xee, 0xc1, 0x3b, 0x69, 0x3b, 0x68, 0x3a, 0x10, 0xd, 0x1b, 0x25, 0x1c, 0x2, 0xe0, 0x10, 0x3f, 0xc6, 0x9, 0x92, 0x1d, 0x27, 0xe1, 0x7d, 0x48, 0xcd, 0x90, 0xcd, 0x10, 0xb4, 0x0, 0xe4, 0x66, 0xb2, 0x24, 0xe9, 0x0, 0x4a, 0x59, 0xab, 0xee, 0x80, 0xf6, 0x7, 0x90, 0xf3, 0x48, 0xa, 0x16, 0xc9, 0xf8, 0xe, 0xd1, 0x2c, 0x76, 0xe7, 0xab, 0x9c, 0xf8, 0xc5, 0xe3, 0x40, 0x1, 0x7e, 0x45, 0x43, 0x4a, 0xb0, 0x0, 0xc, 0x69, 0x9e, 0x14, 0xf9, 0x83, 0xf6, 0x20, 0x3e, 0x50, 0x5, 0x3, 0x90, 0x7c, 0x17, 0xe4, 0x77, 0x64, 0xdd, 0x27, 0xdb, 0xeb, 0xb8, 0xb4, 0xa, 0x4a, 0x13, 0x2a, 0x57, 0x48, 0x81, 0x24, 0xc2, 0x4e, 0x97, 0xc1, 0x88, 0xda, 0x1d, 0x40, 0x5f, 0x40, 0x7d, 0xc1, 0x9c, 0x4a, 0x91, 0x4b, 0x26, 0x70, 0x79, 0xf, 0x8c, 0x6e, 0xc8, 0x7f, 0x9b, 0xcb, 0x28, 0xbf, 0x59, 0x46, 0xb2, 0x65, 0x2f, 0xc4, 0x6f, 0xee, 0x5c, 0x24, 0x43, 0x72, 0x9, 0x8d, 0xf3, 0x5f, 0x2b, 0x67, 0x9f, 0x5a, 0xd6, 0xa0, 0x53, 0x2d, 0x54, 0xdc, 0x85, 0xaf, 0x9c, 0xf3, 0x59, 0x57, 0x56, 0xcf, 0x1, 0xe6, 0x7, 0xcc, 0x4f, 0x3b, 0x29, 0xce, 0xae, 0xf, 0xc4, 0xdb, 0xb2, 0x11, 0x11, 0x16, 0xf5, 0x1e, 0x31, 0xdf, 0x44, 0x7d, 0xe7, 0x3f, 0x33, 0x58, 0x72, 0xe, 0x7f, 0x5b, 0x4e, 0x7f, 0x7e, 0x1, 0x86, 0x6, 0x86, 0x26, 0xbf, 0xb6, 0xda, 0xf, 0xf3, 0xe6, 0x1c, 0x20, 0xd2, 0x0, 0xfe, 0x7d, 0xb1, 0x52, 0x5e, 0x6c, 0xcf, 0x47, 0x4c, 0x19, 0x4b, 0xc5, 0x61, 0x89, 0xfa, 0x86, 0x5d, 0xb9, 0xe8, 0x19, 0x73, 0x1e, 0x58, 0x31, 0xfb, 0xd4, 0x76, 0xf5, 0x8e, 0xae, 0x6a, 0xc, 0x5f, 0x75, 0xd3, 0xe7, 0x32, 0xc6, 0x71, 0x66, 0xd0, 0x98, 0x3f, 0x7a, 0x1e, 0x81, 0xf0, 0x14, 0x83, 0xbc, 0xcd, 0x1a, 0xa0, 0x77, 0x94, 0x27, 0x3, 0x79, 0x3d, 0xf8, 0xf1, 0xc3, 0xe4, 0x1b, 0x11, 0x7c, 0xbb, 0x49, 0x7e, 0x4d, 0x8, 0xb, 0xc3, 0xa, 0xec, 0x61, 0x21, 0x3b, 0x49, 0x2e, 0x6e, 0x48, 0x78, 0x6c, 0x65, 0x53, 0x2a, 0x8e, 0x1b, 0x32, 0x52, 0x79, 0xc6, 0x2b, 0x22, 0xbc, 0xcd, 0xa1, 0x77, 0xa, 0x8b, 0x1f, 0x25, 0x7c, 0x5f, 0x9c, 0x6f, 0x51, 0x18, 0x23, 0xca, 0x15, 0x67, 0xe3, 0x29, 0x28, 0x77, 0x44, 0x1d, 0xa, 0x3b, 0x6, 0x56, 0xdc, 0x43, 0x77, 0x8, 0x3, 0x0, 0xc0, 0x8a, 0xd9, 0xa7, 0xbc, 0x9, 0x98, 0x6f, 0x48, 0xb0, 0xc1, 0x4a, 0x97, 0x90, 0xcd, 0x3a, 0xa8, 0x72, 0x40, 0x71, 0xff, 0x40, 0x54, 0x13, 0xd8, 0xaa, 0x3d, 0xd3, 0x5e, 0xb0, 0xb5, 0x1d, 0x22, 0x30, 0x57, 0x80, 0xc5, 0x8, 0xec, 0xc6, 0xc5, 0x47, 0x1b, 0xe2, 0x17, 0x7f, 0xc7, 0x32, 0xf9, 0x97, 0xcb, 0xaf, 0x5c, 0x1e, 0x95, 0x94, 0xc5, 0xbb, 0xf7, 0x27, 0xc0, 0x34, 0x61, 0xd8, 0x15, 0x4f, 0x8c, 0xa9, 0x4b, 0x6, 0x0, 0x80, 0x15, 0x37, 0x9e, 0xf2, 0x2b, 0x81, 0x73, 0xfd, 0x59, 0x89, 0xe0, 0xbc, 0xdb, 0x9c, 0xdf, 0xa3, 0x1f, 0x6, 0x1, 0xaf, 0xd0, 0x38, 0xf3, 0x40, 0xf3, 0x3d, 0x90, 0x8f, 0xa3, 0x50, 0x4b, 0x66, 0x72, 0x3e, 0x92, 0x9d, 0x24, 0x8a, 0x24, 0x8, 0x61, 0x1c, 0x2, 0x1a, 0xe, 0x60, 0xca, 0x51, 0x57, 0x3d, 0x9d, 0x6e, 0xaf, 0xfc, 0x6a, 0x56, 0xe3, 0x68, 0x9c, 0xaf, 0xd2, 0x38, 0xbf, 0x1, 0xe8, 0x2, 0xc, 0x66, 0xa5, 0x8, 0xf0, 0x3, 0x81, 0x4f, 0x1, 0x9c, 0x4d, 0x9a, 0xff, 0x30, 0xc6, 0x4c, 0x5f, 0x31, 0xfb, 0x94, 0x6f, 0x3, 0xe6, 0x6b, 0xa0, 0xf9, 0x6d, 0x28, 0xae, 0xef, 0x27, 0x17, 0xb5, 0x6d, 0x5a, 0xa5, 0x17, 0x6a, 0xfc, 0xbe, 0xf3, 0x2f, 0x7f, 0xd2, 0x43, 0x79, 0xbc, 0x68, 0x8c, 0x9b, 0x75, 0xcf, 0x6b, 0x2f, 0x6, 0x48, 0xa4, 0xc9, 0x8c, 0xb8, 0xf2, 0xa9, 0x23, 0x24, 0xfb, 0x6b, 0x49, 0x69, 0x49, 0x1b, 0xc, 0xb9, 0x95, 0xc6, 0xac, 0x0, 0x78, 0xf3, 0xf2, 0x59, 0x27, 0xbd, 0x19, 0x11, 0xff, 0x13, 0xd6, 0xba, 0xf3, 0x25, 0x9d, 0x60, 0x72, 0xaa, 0x5b, 0xe8, 0xa0, 0xe4, 0x92, 0xc5, 0x6d, 0x4b, 0x6f, 0xd1, 0xd6, 0x78, 0x51, 0x71, 0xc3, 0xcf, 0x95, 0xa4, 0x53, 0xd, 0x4, 0x55, 0x8d, 0xcd, 0x43, 0x5e, 0x2f, 0xca, 0x47, 0x68, 0xcc, 0xf8, 0x95, 0xb3, 0x4f, 0x2e, 0x77, 0xa, 0x7a, 0xd5, 0x25, 0xa8, 0x19, 0x46, 0x5c, 0xf9, 0xd4, 0xf5, 0x92, 0x5e, 0x7, 0x39, 0x6f, 0xc5, 0xac, 0x93, 0xca, 0x6e, 0xf5, 0x3a, 0xfc, 0x4b, 0x4f, 0x35, 0x42, 0xf6, 0x69, 0x41, 0xc7, 0x78, 0x2, 0x1e, 0x73, 0x15, 0x66, 0x58, 0xa7, 0x8b, 0x41, 0x51, 0x78, 0xc, 0x29, 0x45, 0x22, 0x96, 0xf9, 0xbe, 0x38, 0x4e, 0x71, 0xfc, 0x28, 0x4, 0x29, 0x26, 0x8d, 0xf6, 0x60, 0x15, 0x7f, 0x78, 0x7c, 0x97, 0x34, 0x3f, 0x58, 0x31, 0xfb, 0xe4, 0x1f, 0x26, 0x9d, 0x7e, 0xa7, 0xe, 0x9a, 0x23, 0xaf, 0x59, 0x4a, 0xb7, 0x65, 0xfb, 0xe3, 0x24, 0x8e, 0x6, 0xd0, 0xc3, 0xdb, 0x3c, 0x23, 0xd8, 0x87, 0x24, 0x8a, 0x5, 0x18, 0xf1, 0x5c, 0xe9, 0xe4, 0x43, 0x5c, 0xba, 0xa5, 0x58, 0x24, 0xa, 0x65, 0xc5, 0xdf, 0x95, 0xcb, 0x2f, 0xae, 0x4c, 0x8c, 0xf9, 0x46, 0xc1, 0x7a, 0x4b, 0xff, 0xe0, 0x68, 0x3e, 0x63, 0x85, 0xcf, 0xaf, 0xba, 0xf1, 0x94, 0x44, 0xcd, 0xc1, 0x9d, 0x6a, 0xca, 0x5d, 0xf6, 0xd3, 0x63, 0xb5, 0xf2, 0xc6, 0x53, 0x4f, 0x25, 0x53, 0xb7, 0x4a, 0x7c, 0xc3, 0x57, 0xd5, 0x19, 0xbd, 0xce, 0x90, 0x31, 0xcf, 0x61, 0x4d, 0xa1, 0x54, 0xdc, 0x8, 0xbd, 0x32, 0x36, 0x9d, 0xb8, 0x30, 0x96, 0xf8, 0xae, 0x5c, 0x7e, 0x71, 0x71, 0xe2, 0xbe, 0xf1, 0xe4, 0xe3, 0x90, 0x6e, 0x3b, 0x84, 0xe4, 0xb7, 0x92, 0xa6, 0x41, 0x67, 0xdb, 0xf2, 0x1, 0x0, 0xcb, 0x67, 0x8d, 0xb9, 0x16, 0x34, 0xd7, 0x4a, 0x58, 0xf, 0xef, 0x4, 0x92, 0x28, 0x4a, 0xed, 0x56, 0x57, 0xb0, 0xb7, 0x72, 0xb9, 0xb0, 0x52, 0xdf, 0x6, 0x2e, 0x71, 0x7e, 0xf8, 0x36, 0x0, 0x1f, 0x24, 0x8d, 0xfb, 0xba, 0xd2, 0x9b, 0x86, 0x7f, 0xe9, 0xe9, 0xde, 0xa0, 0x1e, 0x25, 0x30, 0x24, 0x5f, 0xbc, 0xb8, 0x3d, 0x74, 0x6b, 0x19, 0x71, 0x4b, 0xa5, 0xd1, 0x16, 0xa9, 0x22, 0x4e, 0x7a, 0xc8, 0x7d, 0x17, 0xac, 0x95, 0xf4, 0x67, 0x2d, 0x73, 0x5d, 0x9b, 0xef, 0xc9, 0x62, 0x5b, 0x4f, 0xa5, 0x7, 0xdd, 0xbe, 0xb7, 0x4b, 0x46, 0xfe, 0x5b, 0x0, 0x92, 0x5e, 0x27, 0xf9, 0xff, 0x56, 0xcc, 0x3e, 0x69, 0x66, 0xd2, 0x38, 0x6f, 0x77, 0x4b, 0x53, 0x25, 0x60, 0xc, 0xcf, 0x12, 0xb0, 0x7f, 0xa1, 0x46, 0x10, 0xc7, 0xa3, 0x49, 0xf0, 0x6e, 0xb5, 0x69, 0xb3, 0xd5, 0x73, 0x89, 0x19, 0x41, 0x17, 0x40, 0xd6, 0x6f, 0xdc, 0x8d, 0x3e, 0x81, 0x63, 0x36, 0x88, 0x28, 0xdc, 0x37, 0xc0, 0x8f, 0xf3, 0xf, 0xc7, 0x38, 0xd7, 0x2f, 0xfb, 0xd9, 0x89, 0xb3, 0xd1, 0xe, 0x50, 0x17, 0x43, 0x40, 0x0, 0x56, 0x9a, 0x2, 0xb0, 0x4f, 0xcc, 0xa0, 0x19, 0x46, 0x54, 0x95, 0x57, 0xf8, 0xfb, 0xa8, 0xb4, 0xa2, 0xde, 0x17, 0x43, 0x41, 0x9a, 0xf2, 0xaf, 0x90, 0x15, 0x34, 0x6c, 0x14, 0x33, 0x24, 0xcd, 0x12, 0x63, 0x9c, 0x13, 0x49, 0x73, 0xa9, 0xf2, 0x7b, 0x39, 0xd2, 0x5b, 0xff, 0x58, 0xd0, 0xe5, 0xe7, 0xbc, 0x87, 0x83, 0xd6, 0xef, 0xf9, 0xf4, 0xf3, 0xb2, 0xf6, 0x22, 0x3e, 0x50, 0x6f, 0x3d, 0x0, 0xb9, 0xb7, 0x7f, 0xab, 0xe8, 0xa6, 0x5f, 0x6b, 0xab, 0x2f, 0x47, 0xe4, 0x36, 0x30, 0x41, 0x99, 0x11, 0x42, 0xc1, 0xc6, 0xf7, 0xc4, 0x12, 0x49, 0xff, 0x43, 0xf2, 0xe9, 0x65, 0x33, 0x47, 0x67, 0x0, 0xfc, 0x6e, 0xe4, 0x55, 0xcf, 0xbe, 0x2d, 0x6b, 0x7f, 0x9, 0x61, 0xcf, 0x12, 0xbe, 0x23, 0x16, 0xa0, 0x1, 0xf9, 0x24, 0xc9, 0x6f, 0x2e, 0x9b, 0x39, 0x7a, 0x59, 0x72, 0x18, 0x6e, 0xd, 0x75, 0xd3, 0x3, 0xc, 0xbf, 0xf2, 0x99, 0x43, 0xad, 0xd4, 0xd8, 0x7a, 0x7d, 0x21, 0x4a, 0x48, 0xe2, 0x40, 0xbc, 0x74, 0x8f, 0x98, 0x6f, 0xa3, 0x24, 0x7d, 0xc4, 0xe4, 0x17, 0x91, 0x6, 0x10, 0x78, 0xfb, 0x22, 0x98, 0xb4, 0xb, 0xc9, 0x76, 0xa4, 0x31, 0xf, 0xd2, 0x38, 0xa3, 0x40, 0xf3, 0x79, 0x3a, 0xd, 0x4f, 0x2c, 0xff, 0xd9, 0x89, 0x39, 0x1f, 0xc5, 0x65, 0x33, 0x47, 0x3f, 0xe, 0x9a, 0xa1, 0x2, 0x7e, 0xed, 0x37, 0x79, 0x81, 0x94, 0x37, 0xc9, 0xc8, 0x60, 0x1, 0x89, 0x1, 0x79, 0x9b, 0x80, 0x69, 0xed, 0x4d, 0x7c, 0xa0, 0x9e, 0x7a, 0x0, 0xa2, 0x1f, 0xc1, 0xc6, 0xdc, 0x53, 0x4e, 0xb2, 0x2a, 0xd7, 0x52, 0x5b, 0x79, 0xd0, 0xf8, 0xdd, 0x27, 0x83, 0x77, 0x88, 0x77, 0x57, 0x60, 0x44, 0x7a, 0xe5, 0x7b, 0x89, 0xfc, 0x9c, 0x7d, 0xe0, 0xe, 0x61, 0xfe, 0xa, 0x70, 0x11, 0xa8, 0x5b, 0x1, 0xbc, 0xe, 0x68, 0xe7, 0xf2, 0x99, 0xa3, 0x23, 0x3d, 0x72, 0x97, 0xff, 0x6c, 0xf4, 0x9f, 0x47, 0x5c, 0xf5, 0xec, 0x64, 0x8, 0x93, 0x24, 0x3b, 0x23, 0xa8, 0x82, 0xef, 0xdc, 0x42, 0x80, 0x5f, 0x3, 0x79, 0xc7, 0x8a, 0x99, 0x27, 0xbc, 0xd7, 0x11, 0x68, 0xaf, 0x1f, 0x6, 0x0, 0x8e, 0x5, 0xd8, 0xc3, 0xf7, 0xc9, 0xa8, 0xc8, 0xc9, 0xc4, 0x9f, 0x7d, 0xa, 0x3c, 0x68, 0x2, 0x46, 0x0, 0x80, 0xd0, 0x92, 0x6c, 0x0, 0x21, 0x71, 0xbd, 0x48, 0x66, 0xab, 0xc6, 0x9b, 0x97, 0x0, 0xb2, 0x20, 0x7, 0x81, 0xdc, 0x22, 0x69, 0xeb, 0xf2, 0x99, 0xa3, 0xdb, 0xe4, 0x88, 0xba, 0x7c, 0xe6, 0xe8, 0x77, 0x46, 0x5e, 0xbd, 0x64, 0x2e, 0xc4, 0xc5, 0x90, 0x9e, 0x5, 0x70, 0xa0, 0xa4, 0x77, 0x40, 0x4e, 0x4, 0xf4, 0xc2, 0xa, 0x6f, 0xc8, 0xe8, 0x10, 0xa8, 0x1b, 0x35, 0x70, 0xf8, 0x97, 0x9f, 0x7d, 0x9e, 0xc4, 0x31, 0xbe, 0x27, 0x47, 0x5b, 0x9, 0x92, 0xd7, 0xbb, 0x3c, 0xcf, 0xd9, 0xdb, 0x1, 0x2c, 0x5, 0x70, 0x32, 0xa0, 0xb3, 0x51, 0x62, 0xdb, 0xd9, 0x90, 0xb7, 0x50, 0x45, 0x6e, 0xed, 0x45, 0xbd, 0x4d, 0x66, 0xf9, 0xcc, 0xd1, 0xd, 0x6d, 0xfa, 0x30, 0x6, 0x46, 0x5e, 0xbd, 0xe4, 0x50, 0x49, 0xc3, 0x0, 0xac, 0x5f, 0x3e, 0xf3, 0x84, 0xd, 0xed, 0x89, 0xe3, 0x48, 0x3c, 0x74, 0x74, 0x86, 0x71, 0x30, 0xe2, 0xaa, 0xe7, 0xde, 0x2, 0xd0, 0x2b, 0xbc, 0xdf, 0x50, 0x29, 0xa2, 0x14, 0xbf, 0x97, 0xf4, 0x17, 0x80, 0x13, 0x1, 0xac, 0xa1, 0x77, 0x9e, 0x71, 0x2f, 0x0, 0x7b, 0x4a, 0x6a, 0x80, 0x77, 0xbc, 0x7d, 0xf, 0x0, 0x9f, 0x2, 0xd4, 0x17, 0xc0, 0xbe, 0x0, 0x3e, 0x9, 0x78, 0x1b, 0x51, 0x55, 0xea, 0xcf, 0x1f, 0xc, 0x33, 0x92, 0x32, 0xa4, 0xe9, 0xb6, 0x7c, 0xe6, 0xf1, 0xd9, 0xb6, 0x7e, 0x1b, 0x5, 0x47, 0x7f, 0x65, 0x69, 0xea, 0xf7, 0x33, 0x8e, 0xad, 0x29, 0x8d, 0x6a, 0xa1, 0x6e, 0x86, 0x0, 0x82, 0x3f, 0x17, 0xf4, 0x15, 0xf9, 0xb, 0xa1, 0x3c, 0xbf, 0x48, 0x8f, 0x28, 0x11, 0x94, 0xf1, 0x37, 0x44, 0xf4, 0x5, 0x32, 0x6f, 0x14, 0xb8, 0xce, 0xcd, 0xba, 0x7f, 0x58, 0x39, 0xfb, 0x44, 0xb, 0x60, 0x93, 0x7f, 0xe5, 0x60, 0xc4, 0xd5, 0x2f, 0x90, 0xb0, 0x3d, 0x0, 0xee, 0x9, 0x8f, 0x21, 0xfa, 0xc8, 0x6a, 0x89, 0x31, 0x74, 0x0, 0x6f, 0x71, 0x65, 0x5, 0x83, 0x8e, 0x7f, 0xca, 0x6d, 0x32, 0xde, 0x81, 0x9d, 0x45, 0x7c, 0xa0, 0x8e, 0x18, 0x40, 0xc0, 0x8f, 0x48, 0xb3, 0x44, 0xb2, 0x97, 0x82, 0x3c, 0x2d, 0x24, 0x4, 0x14, 0xf4, 0xba, 0x7e, 0x80, 0xbf, 0xf, 0x1e, 0x20, 0x6b, 0x9, 0xe0, 0xfb, 0x12, 0x1f, 0xf5, 0x89, 0x1f, 0x9, 0xcb, 0x6f, 0x38, 0x4e, 0x0, 0xb6, 0xf8, 0x17, 0x46, 0x5c, 0xb5, 0xe4, 0x75, 0x92, 0xbf, 0x15, 0x70, 0x1c, 0x80, 0x22, 0x51, 0xa1, 0x75, 0xe1, 0x42, 0x5c, 0xa8, 0xd0, 0x9e, 0x8c, 0xdb, 0xea, 0xa8, 0x13, 0xad, 0xa, 0xea, 0x46, 0xd, 0x5c, 0x3e, 0xf3, 0xf8, 0xd7, 0x97, 0xdd, 0x30, 0xea, 0x3e, 0x80, 0xd7, 0x1, 0xbc, 0x58, 0xc2, 0xaf, 0x3, 0xe7, 0x92, 0x22, 0x87, 0x11, 0x92, 0x46, 0xa1, 0x77, 0xbf, 0x7, 0xf8, 0xbf, 0xcb, 0x67, 0x1e, 0x5f, 0xd1, 0x59, 0x43, 0xc6, 0x18, 0xd2, 0x98, 0xbb, 0x42, 0xf6, 0xf9, 0x78, 0x3b, 0x7d, 0xa1, 0x4b, 0x97, 0x6f, 0xac, 0x81, 0x5, 0xf8, 0x1a, 0xda, 0xd7, 0x61, 0xa0, 0xdd, 0xa1, 0x6e, 0xd9, 0x77, 0xc4, 0x55, 0x4b, 0x8e, 0x4, 0x30, 0x82, 0xe4, 0x89, 0x0, 0xc6, 0x1, 0x8, 0x6f, 0x11, 0x13, 0x8c, 0xc1, 0x9b, 0x1, 0x9c, 0xb5, 0x7c, 0xe6, 0xf1, 0x4b, 0xaa, 0xc9, 0x63, 0xe4, 0xd5, 0x2f, 0x1c, 0x28, 0xd9, 0x4d, 0xfe, 0xb9, 0x88, 0xa5, 0x5c, 0x0, 0xa, 0xc0, 0xd7, 0x30, 0x32, 0x92, 0x16, 0x1, 0x98, 0xbc, 0x7c, 0xe6, 0xf1, 0x65, 0x17, 0x61, 0xd6, 0x2b, 0xd4, 0x2d, 0x3, 0x4, 0x30, 0xe2, 0xea, 0xe7, 0xfb, 0x0, 0x38, 0x3, 0xc0, 0xbf, 0x10, 0x3c, 0xa, 0xc0, 0x18, 0xdf, 0x4a, 0xb0, 0x43, 0xd0, 0x95, 0xcb, 0x6f, 0x18, 0x75, 0x47, 0x8d, 0xe9, 0x3f, 0x65, 0x68, 0x8e, 0x87, 0x77, 0xf6, 0x9e, 0xe7, 0x25, 0x1c, 0xc3, 0xa, 0xb2, 0x5, 0xea, 0xc2, 0x2e, 0x2b, 0xfb, 0x9f, 0x0, 0x7e, 0xb8, 0xfc, 0x86, 0x51, 0x5d, 0xc, 0xd0, 0x11, 0x70, 0xd4, 0x57, 0x96, 0xe, 0x7, 0x30, 0x9, 0x5e, 0x6f, 0xb0, 0xe9, 0xc5, 0x19, 0xc7, 0x7e, 0xb7, 0x96, 0xf4, 0x46, 0x5e, 0xb3, 0x94, 0x92, 0x3d, 0x95, 0xe4, 0xaf, 0x0, 0xec, 0x11, 0xee, 0x5, 0x22, 0xb4, 0x90, 0x9c, 0xfc, 0xe1, 0x3f, 0x5b, 0x0, 0x63, 0x49, 0xf3, 0x48, 0x67, 0x2c, 0x4d, 0x4f, 0xa, 0x76, 0x2b, 0x6, 0x68, 0xf, 0x18, 0x79, 0xcd, 0xd2, 0x3d, 0x24, 0xbd, 0x4c, 0xf2, 0xc0, 0x62, 0xb5, 0x33, 0xce, 0x5b, 0x59, 0xd2, 0x26, 0x92, 0x2f, 0x91, 0xbc, 0xf8, 0xc5, 0x19, 0xc7, 0x6c, 0x6a, 0x4b, 0x3e, 0xf5, 0xa, 0xff, 0xf4, 0xc, 0x0, 0x0, 0x23, 0xaf, 0x7e, 0xe1, 0x7a, 0x1a, 0x5e, 0x7, 0x20, 0xe5, 0xfb, 0x61, 0x65, 0x0, 0xec, 0x82, 0xb0, 0xb, 0xc4, 0xe, 0x0, 0x5b, 0x24, 0x6d, 0x26, 0xb9, 0xd, 0xc2, 0x66, 0x41, 0x4b, 0x8c, 0x31, 0xbf, 0xfb, 0xfd, 0x4f, 0x8e, 0x59, 0x57, 0x63, 0xd6, 0x9d, 0xe, 0x75, 0xa3, 0x6, 0x76, 0x26, 0xd0, 0x98, 0xff, 0x91, 0x74, 0x8, 0x80, 0x1e, 0x24, 0xb7, 0xc0, 0xdb, 0x5b, 0x6f, 0x33, 0xd, 0xdf, 0x3, 0xf0, 0xb6, 0xa4, 0x57, 0x1, 0xbc, 0xf4, 0xe2, 0x8c, 0x63, 0xdf, 0xe9, 0xec, 0xb2, 0x76, 0x41, 0x17, 0x74, 0x41, 0x17, 0x74, 0x41, 0x17, 0x74, 0x41, 0x17, 0x74, 0x41, 0x17, 0x74, 0x41, 0x17, 0xd4, 0x6, 0xff, 0x1f, 0x32, 0x68, 0x5, 0x7e, 0x99, 0xd5, 0x97, 0x49, 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 option_button_disabled_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x10,0x8,0x3,0x0,0x0,0x0,0x40,0xde,0x8d,0x6b,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,0x1,0x32,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,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,0x3f,0x3f,0x5a,0x5a,0x5a,0x2b,0x2b,0x31,0x2e,0x2e,0x34,0x59,0x59,0x59,0x2a,0x2a,0x30,0x4b,0x4b,0x4b,0x22,0x22,0x27,0x35,0x35,0x35,0x4a,0x4a,0x4a,0x24,0x24,0x28,0x24,0x24,0x29,0x56,0x56,0x56,0x62,0x62,0x62,0x2a,0x2a,0x31,0x2a,0x2a,0x30,0x2d,0x2d,0x34,0x2f,0x2f,0x36,0x2e,0x2e,0x35,0x2c,0x2c,0x32,0x48,0x48,0x48,0x44,0x44,0x44,0x43,0x43,0x43,0x54,0x54,0x54,0x26,0x26,0x2b,0x24,0x24,0x28,0x27,0x27,0x2d,0x29,0x29,0x2f,0x28,0x28,0x2e,0x25,0x25,0x2b,0x23,0x23,0x28,0x26,0x26,0x2c,0x25,0x25,0x2a,0x2a,0x2a,0x2f,0x2b,0x2b,0x31,0x22,0x22,0x26,0x52,0x52,0x52,0x42,0x42,0x42,0x2d,0x2d,0x33,0x22,0x22,0x27,0x51,0x51,0x51,0x40,0x40,0x40,0x27,0x27,0x2b,0x2e,0x2e,0x34,0x2c,0x2c,0x31,0x29,0x29,0x2e,0x4f,0x4f,0x4f,0x3f,0x3f,0x3f,0x4d,0x4d,0x4d,0x3e,0x3e,0x3e,0x24,0x24,0x2a,0x24,0x24,0x29,0x20,0x20,0x25,0x4c,0x4c,0x4c,0x3d,0x3d,0x3d,0x28,0x28,0x2d,0x2b,0x2b,0x30,0x29,0x29,0x2d,0x20,0x20,0x23,0x4a,0x4a,0x4a,0x3b,0x3b,0x3b,0x22,0x22,0x28,0x27,0x27,0x2c,0x1e,0x1e,0x22,0x49,0x49,0x49,0x3a,0x3a,0x3a,0x21,0x21,0x26,0x21,0x21,0x25,0x23,0x23,0x27,0x20,0x20,0x24,0x1d,0x1d,0x21,0x39,0x39,0x39,0x47,0x47,0x47,0x1f,0x1f,0x24,0x1f,0x1f,0x23,0x1e,0x1e,0x21,0x46,0x46,0x46,0xff,0xff,0xff,0xbd,0x3f,0x83,0xbb,0x0,0x0,0x0,0x24,0x74,0x52,0x4e,0x53,0x0,0x4,0xa,0x11,0x19,0x1f,0x22,0x24,0x1d,0x16,0xd,0x7,0x2,0x15,0x25,0x34,0x3f,0x46,0x47,0x48,0x43,0x3a,0x2d,0x1b,0x77,0xef,0xe6,0x49,0xef,0xe6,0xef,0xe7,0x77,0xef,0xe4,0x4a,0xba,0xea,0xc1,0xeb,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x65,0xb5,0xdd,0x88,0x9f,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,0x1,0xb,0x49,0x44,0x41,0x54,0x28,0xcf,0x8d,0xd1,0xd9,0x56,0xc2,0x30,0x10,0x80,0x61,0xd6,0xa2,0xa8,0x6c,0x75,0xdf,0x10,0x54,0xa8,0x82,0x74,0xd2,0x4a,0x49,0x5b,0xa4,0xb5,0x5a,0x44,0x10,0x5c,0xd0,0xaa,0x80,0x8a,0xcb,0xfb,0x3f,0x83,0x21,0x24,0x1c,0x8e,0x5e,0xe8,0x77,0xfd,0x9f,0x93,0x99,0x89,0xcf,0x1f,0x8,0x86,0xc2,0x42,0x84,0x10,0x66,0x66,0xa3,0x73,0xf3,0xbe,0x9f,0x2,0xb,0xb1,0x78,0x22,0x99,0x12,0x45,0x71,0x71,0x69,0x79,0x25,0xea,0xff,0x15,0x4,0x63,0xab,0x6b,0x7b,0xcc,0x7e,0x2e,0x2f,0x1d,0x30,0x87,0x52,0x21,0xbf,0xbe,0x41,0x82,0x50,0x7c,0xb3,0x78,0x54,0x1a,0x93,0x1,0x29,0x2a,0x73,0xac,0x94,0x35,0x6d,0x8b,0x4,0xe1,0x84,0x5c,0xe2,0xe4,0xa,0xd6,0xb,0x8c,0xa1,0x2b,0xd8,0x54,0x48,0x20,0x24,0xab,0x27,0x5c,0xb5,0x2,0x39,0x89,0xa9,0x19,0x2a,0x58,0xa3,0x20,0x92,0xb2,0x4f,0x39,0xdb,0x1,0xe3,0x8c,0xa9,0x9d,0xbb,0x60,0x3a,0xa3,0x40,0xac,0x5f,0x70,0xf5,0xe9,0xc0,0x20,0x1,0xd0,0xa0,0x71,0xc9,0x35,0xca,0x4d,0x75,0x6a,0x86,0xd6,0x15,0xa6,0x4f,0xb4,0x3b,0x5c,0x1b,0xa1,0xeb,0x1b,0x46,0xbf,0x5,0xed,0xe,0xd1,0x21,0xbb,0xf7,0x5c,0xf7,0xc1,0xf2,0x26,0x6b,0x7a,0x4d,0xeb,0xd1,0xa2,0x6b,0x3e,0x3d,0x73,0xc5,0x5e,0x1f,0x7b,0xc,0xe0,0xc1,0xcb,0xab,0x49,0xf,0xb5,0xdd,0x79,0x63,0x86,0xbd,0x77,0xd,0x33,0xad,0x41,0xff,0xe3,0x33,0x4d,0x4f,0xbd,0x93,0x19,0x7e,0x8d,0xd9,0x0,0xee,0x64,0x6,0xd7,0x41,0xd9,0xdd,0xff,0x7c,0xd6,0x5f,0xdf,0xfd,0xd,0xbf,0xaa,0x55,0xdf,0x7c,0xb2,0x44,0x90,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 option_arrow_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0xc, 0x8, 0x6, 0x0, 0x0, 0x0, 0x56, 0x75, 0x5c, 0xe7, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0x98, 0x49, 0x44, 0x41, 0x54, 0x28, 0x91, 0xbd, 0x91, 0xb1, 0xd, 0xc2, 0x30, 0x10, 0x45, 0xdf, 0xd1, 0xb8, 0xf0, 0x2, 0xee, 0xdc, 0x87, 0x1, 0xd8, 0x24, 0xb5, 0xe9, 0x19, 0x87, 0x1e, 0xea, 0x6c, 0xc2, 0x0, 0xa4, 0xb5, 0xdc, 0x79, 0x1, 0x17, 0xae, 0x8e, 0x26, 0x48, 0x76, 0x14, 0x40, 0x48, 0x88, 0xdf, 0xfd, 0xf7, 0xef, 0x4b, 0x77, 0x3a, 0xf8, 0x85, 0x62, 0x8c, 0x21, 0xc6, 0x18, 0xb6, 0x32, 0x59, 0x83, 0x94, 0xd2, 0x5e, 0x55, 0x6f, 0x0, 0x22, 0x72, 0xf0, 0xde, 0xdf, 0xdb, 0x7c, 0xd7, 0x9a, 0x9c, 0xb3, 0x55, 0xd5, 0x9, 0xb0, 0x80, 0x55, 0xd5, 0x29, 0xe7, 0x6c, 0x5f, 0x16, 0x6a, 0xad, 0x67, 0x60, 0x68, 0xd0, 0xb0, 0xb0, 0x3f, 0xaa, 0x3b, 0x3a, 0xa5, 0x74, 0x51, 0xd5, 0xd0, 0xd, 0x88, 0x5c, 0xbd, 0xf7, 0xc7, 0xa7, 0xef, 0x6e, 0x30, 0xc6, 0x9c, 0x80, 0xb9, 0x41, 0xf3, 0xc2, 0xd8, 0x2c, 0x38, 0xe7, 0x8a, 0x88, 0x8c, 0x40, 0x1, 0x8a, 0x88, 0x8c, 0xce, 0xb9, 0xf2, 0x71, 0xcf, 0x77, 0x8f, 0xfb, 0x5a, 0xf, 0x28, 0x4a, 0x37, 0xff, 0x58, 0x46, 0x7b, 0x50, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char option_button_focus_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,0xb4,0x50,0x4c,0x54,0x45,0x95,0xa9,0xb0,0x92,0xa7,0xae,0x8e,0xa2,0xa9,0x8a,0x9d,0xa4,0x85,0x98,0x9f,0x80,0x93,0x9b,0x7b,0x8f,0x96,0x77,0x8a,0x92,0x72,0x86,0x8c,0x6e,0x80,0x88,0x69,0x7c,0x84,0x64,0x77,0x7f,0x60,0x72,0x7a,0x5b,0x6e,0x75,0x56,0x69,0x71,0xc8,0xe3,0xe7,0xc8,0xe2,0xe7,0xca,0xe3,0xe7,0xce,0xe6,0xe9,0xce,0xe6,0xea,0xd0,0xe6,0xe9,0xce,0xe5,0xea,0xd0,0xe6,0xea,0xce,0xe5,0xe9,0xd0,0xe5,0xe9,0xd3,0xe7,0xeb,0xd4,0xe7,0xeb,0xd9,0xea,0xed,0xd7,0xe9,0xed,0xd7,0xea,0xed,0xdc,0xec,0xef,0xdc,0xeb,0xef,0xe0,0xed,0xf1,0xdf,0xee,0xf1,0xdf,0xed,0xf1,0xe0,0xee,0xf1,0xe3,0xf0,0xf2,0xe2,0xef,0xf2,0xe3,0xef,0xf2,0xe6,0xf1,0xf3,0xe8,0xf2,0xf5,0xe8,0xf3,0xf4,0xe8,0xf2,0xf4,0xe8,0xf3,0xf5,0xd6,0x5a,0x5b,0xd4,0x57,0x58,0xe5,0x89,0x89,0xd5,0x57,0x59,0xd5,0x58,0x59,0xd5,0x59,0x5a,0xd6,0x59,0x5a,0xd6,0x5a,0x5c,0xd7,0x5b,0x5c,0xd7,0x5b,0x5d,0xd8,0x5c,0x5d,0xd8,0x5c,0x5e,0xd8,0x5d,0x5f,0xd9,0x5d,0x5f,0xe8,0x6c,0x6e,0xff,0xff,0xff,0xa1,0xe,0x37,0x8c,0x0,0x0,0x0,0x2c,0x74,0x52,0x4e,0x53,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0xac,0x80,0x68,0x47,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x3b,0x39,0xe,0xf4,0x6c,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,0xa3,0x49,0x44,0x41,0x54,0x18,0xd3,0x5d,0xce,0xdb,0x16,0x42,0x60,0x18,0x84,0xe1,0x4f,0x8,0x65,0x57,0x2a,0x45,0xd9,0x15,0xf9,0xa3,0x89,0x28,0xea,0xfe,0x2f,0x2c,0x4e,0x2c,0x79,0xd6,0xbc,0xe7,0x43,0x34,0xc5,0xe5,0x7f,0x38,0x9a,0xdd,0x31,0x72,0x9f,0x11,0xff,0x80,0x61,0x18,0xa6,0x69,0xac,0xba,0x50,0xf0,0x24,0x14,0x58,0x5b,0x9b,0xed,0xce,0xb6,0x6d,0x6b,0x8f,0x42,0x20,0xb1,0xc4,0xc1,0x71,0xe,0x7d,0x8e,0x83,0x52,0xa4,0xf9,0x13,0xae,0x7b,0x74,0x7b,0xa7,0x13,0x9e,0x73,0x92,0x72,0x78,0xbe,0xef,0x75,0x7c,0xcf,0x47,0x2e,0x91,0x5c,0x21,0x8,0xc2,0x20,0x8c,0x82,0x73,0x18,0xa1,0x92,0x49,0xa9,0x71,0x89,0xe3,0x38,0x49,0xba,0x25,0xa8,0x15,0x5a,0xbc,0x70,0x1d,0xe0,0xb5,0xa0,0xe5,0x1b,0x69,0xca,0xd8,0x8d,0x31,0x96,0x65,0x68,0x96,0xa4,0x36,0x60,0x3,0x34,0x2a,0x69,0xed,0xf8,0x7a,0xab,0x91,0xfe,0xf9,0x8e,0x7c,0x74,0xd2,0x27,0x7e,0x7e,0x46,0x20,0x17,0xe,0x2d,0x4e,0x9,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 option_button_disabled_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x10, 0x8, 0x3, 0x0, 0x0, 0x0, 0x40, 0xde, 0x8d, 0x6b, 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, 0x1, 0x32, 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, 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, 0x3f, 0x3f, 0x5a, 0x5a, 0x5a, 0x2b, 0x2b, 0x31, 0x2e, 0x2e, 0x34, 0x59, 0x59, 0x59, 0x2a, 0x2a, 0x30, 0x4b, 0x4b, 0x4b, 0x22, 0x22, 0x27, 0x35, 0x35, 0x35, 0x4a, 0x4a, 0x4a, 0x24, 0x24, 0x28, 0x24, 0x24, 0x29, 0x56, 0x56, 0x56, 0x62, 0x62, 0x62, 0x2a, 0x2a, 0x31, 0x2a, 0x2a, 0x30, 0x2d, 0x2d, 0x34, 0x2f, 0x2f, 0x36, 0x2e, 0x2e, 0x35, 0x2c, 0x2c, 0x32, 0x48, 0x48, 0x48, 0x44, 0x44, 0x44, 0x43, 0x43, 0x43, 0x54, 0x54, 0x54, 0x26, 0x26, 0x2b, 0x24, 0x24, 0x28, 0x27, 0x27, 0x2d, 0x29, 0x29, 0x2f, 0x28, 0x28, 0x2e, 0x25, 0x25, 0x2b, 0x23, 0x23, 0x28, 0x26, 0x26, 0x2c, 0x25, 0x25, 0x2a, 0x2a, 0x2a, 0x2f, 0x2b, 0x2b, 0x31, 0x22, 0x22, 0x26, 0x52, 0x52, 0x52, 0x42, 0x42, 0x42, 0x2d, 0x2d, 0x33, 0x22, 0x22, 0x27, 0x51, 0x51, 0x51, 0x40, 0x40, 0x40, 0x27, 0x27, 0x2b, 0x2e, 0x2e, 0x34, 0x2c, 0x2c, 0x31, 0x29, 0x29, 0x2e, 0x4f, 0x4f, 0x4f, 0x3f, 0x3f, 0x3f, 0x4d, 0x4d, 0x4d, 0x3e, 0x3e, 0x3e, 0x24, 0x24, 0x2a, 0x24, 0x24, 0x29, 0x20, 0x20, 0x25, 0x4c, 0x4c, 0x4c, 0x3d, 0x3d, 0x3d, 0x28, 0x28, 0x2d, 0x2b, 0x2b, 0x30, 0x29, 0x29, 0x2d, 0x20, 0x20, 0x23, 0x4a, 0x4a, 0x4a, 0x3b, 0x3b, 0x3b, 0x22, 0x22, 0x28, 0x27, 0x27, 0x2c, 0x1e, 0x1e, 0x22, 0x49, 0x49, 0x49, 0x3a, 0x3a, 0x3a, 0x21, 0x21, 0x26, 0x21, 0x21, 0x25, 0x23, 0x23, 0x27, 0x20, 0x20, 0x24, 0x1d, 0x1d, 0x21, 0x39, 0x39, 0x39, 0x47, 0x47, 0x47, 0x1f, 0x1f, 0x24, 0x1f, 0x1f, 0x23, 0x1e, 0x1e, 0x21, 0x46, 0x46, 0x46, 0xff, 0xff, 0xff, 0xbd, 0x3f, 0x83, 0xbb, 0x0, 0x0, 0x0, 0x24, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x4, 0xa, 0x11, 0x19, 0x1f, 0x22, 0x24, 0x1d, 0x16, 0xd, 0x7, 0x2, 0x15, 0x25, 0x34, 0x3f, 0x46, 0x47, 0x48, 0x43, 0x3a, 0x2d, 0x1b, 0x77, 0xef, 0xe6, 0x49, 0xef, 0xe6, 0xef, 0xe7, 0x77, 0xef, 0xe4, 0x4a, 0xba, 0xea, 0xc1, 0xeb, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x65, 0xb5, 0xdd, 0x88, 0x9f, 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, 0x1, 0xb, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x8d, 0xd1, 0xd9, 0x56, 0xc2, 0x30, 0x10, 0x80, 0x61, 0xd6, 0xa2, 0xa8, 0x6c, 0x75, 0xdf, 0x10, 0x54, 0xa8, 0x82, 0x74, 0xd2, 0x4a, 0x49, 0x5b, 0xa4, 0xb5, 0x5a, 0x44, 0x10, 0x5c, 0xd0, 0xaa, 0x80, 0x8a, 0xcb, 0xfb, 0x3f, 0x83, 0x21, 0x24, 0x1c, 0x8e, 0x5e, 0xe8, 0x77, 0xfd, 0x9f, 0x93, 0x99, 0x89, 0xcf, 0x1f, 0x8, 0x86, 0xc2, 0x42, 0x84, 0x10, 0x66, 0x66, 0xa3, 0x73, 0xf3, 0xbe, 0x9f, 0x2, 0xb, 0xb1, 0x78, 0x22, 0x99, 0x12, 0x45, 0x71, 0x71, 0x69, 0x79, 0x25, 0xea, 0xff, 0x15, 0x4, 0x63, 0xab, 0x6b, 0x7b, 0xcc, 0x7e, 0x2e, 0x2f, 0x1d, 0x30, 0x87, 0x52, 0x21, 0xbf, 0xbe, 0x41, 0x82, 0x50, 0x7c, 0xb3, 0x78, 0x54, 0x1a, 0x93, 0x1, 0x29, 0x2a, 0x73, 0xac, 0x94, 0x35, 0x6d, 0x8b, 0x4, 0xe1, 0x84, 0x5c, 0xe2, 0xe4, 0xa, 0xd6, 0xb, 0x8c, 0xa1, 0x2b, 0xd8, 0x54, 0x48, 0x20, 0x24, 0xab, 0x27, 0x5c, 0xb5, 0x2, 0x39, 0x89, 0xa9, 0x19, 0x2a, 0x58, 0xa3, 0x20, 0x92, 0xb2, 0x4f, 0x39, 0xdb, 0x1, 0xe3, 0x8c, 0xa9, 0x9d, 0xbb, 0x60, 0x3a, 0xa3, 0x40, 0xac, 0x5f, 0x70, 0xf5, 0xe9, 0xc0, 0x20, 0x1, 0xd0, 0xa0, 0x71, 0xc9, 0x35, 0xca, 0x4d, 0x75, 0x6a, 0x86, 0xd6, 0x15, 0xa6, 0x4f, 0xb4, 0x3b, 0x5c, 0x1b, 0xa1, 0xeb, 0x1b, 0x46, 0xbf, 0x5, 0xed, 0xe, 0xd1, 0x21, 0xbb, 0xf7, 0x5c, 0xf7, 0xc1, 0xf2, 0x26, 0x6b, 0x7a, 0x4d, 0xeb, 0xd1, 0xa2, 0x6b, 0x3e, 0x3d, 0x73, 0xc5, 0x5e, 0x1f, 0x7b, 0xc, 0xe0, 0xc1, 0xcb, 0xab, 0x49, 0xf, 0xb5, 0xdd, 0x79, 0x63, 0x86, 0xbd, 0x77, 0xd, 0x33, 0xad, 0x41, 0xff, 0xe3, 0x33, 0x4d, 0x4f, 0xbd, 0x93, 0x19, 0x7e, 0x8d, 0xd9, 0x0, 0xee, 0x64, 0x6, 0xd7, 0x41, 0xd9, 0xdd, 0xff, 0x7c, 0xd6, 0x5f, 0xdf, 0xfd, 0xd, 0xbf, 0xaa, 0x55, 0xdf, 0x7c, 0xb2, 0x44, 0x90, 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 option_button_hover_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x10,0x8,0x3,0x0,0x0,0x0,0x40,0xde,0x8d,0x6b,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,0x1,0x44,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,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,0x42,0x40,0x4b,0x5f,0x5a,0x6c,0x2b,0x2b,0x31,0x2e,0x2e,0x34,0x5f,0x5a,0x6b,0x2a,0x2a,0x30,0x56,0x53,0x64,0x22,0x22,0x27,0x3e,0x3b,0x46,0x57,0x53,0x63,0x24,0x24,0x28,0x24,0x24,0x29,0x5b,0x57,0x68,0x5a,0x56,0x67,0x67,0x63,0x76,0x2a,0x2a,0x31,0x2a,0x2a,0x30,0x2d,0x2d,0x34,0x2f,0x2f,0x36,0x2e,0x2e,0x35,0x2c,0x2c,0x32,0x4d,0x4a,0x57,0x49,0x46,0x52,0x48,0x45,0x51,0x5a,0x56,0x65,0x26,0x26,0x2b,0x24,0x24,0x28,0x27,0x27,0x2d,0x29,0x29,0x2f,0x28,0x28,0x2e,0x25,0x25,0x2b,0x23,0x23,0x28,0x5b,0x57,0x66,0x26,0x26,0x2c,0x25,0x25,0x2a,0x2a,0x2a,0x2f,0x2b,0x2b,0x31,0x22,0x22,0x26,0x59,0x55,0x64,0x47,0x44,0x50,0x2d,0x2d,0x33,0x22,0x22,0x27,0x58,0x54,0x64,0x46,0x43,0x50,0x27,0x27,0x2b,0x2e,0x2e,0x34,0x2c,0x2c,0x31,0x29,0x29,0x2e,0x56,0x53,0x63,0x45,0x42,0x4f,0x56,0x53,0x62,0x45,0x42,0x4e,0x24,0x24,0x2a,0x24,0x24,0x29,0x20,0x20,0x25,0x55,0x51,0x62,0x44,0x41,0x4e,0x28,0x28,0x2d,0x2b,0x2b,0x30,0x29,0x29,0x2d,0x20,0x20,0x23,0x55,0x51,0x60,0x44,0x41,0x4d,0x22,0x22,0x28,0x27,0x27,0x2c,0x1e,0x1e,0x22,0x43,0x40,0x4c,0x54,0x50,0x5f,0x21,0x21,0x26,0x21,0x21,0x25,0x23,0x23,0x27,0x20,0x20,0x24,0x1d,0x1d,0x21,0x47,0x43,0x51,0x43,0x3f,0x4d,0x42,0x3f,0x4c,0x53,0x4f,0x5f,0x1f,0x1f,0x24,0x1f,0x1f,0x23,0x1e,0x1e,0x21,0x53,0x50,0x5f,0x53,0x4f,0x5e,0x5f,0x5a,0x6c,0xff,0xff,0xff,0xd1,0x85,0xc5,0x5,0x0,0x0,0x0,0x24,0x74,0x52,0x4e,0x53,0x0,0x4,0xa,0x11,0x19,0x1f,0x22,0x24,0x1d,0x16,0xd,0x7,0x2,0x15,0x25,0x34,0x3f,0x46,0x47,0x48,0x43,0x3a,0x2d,0x1b,0x77,0xef,0xe6,0x49,0xef,0xe6,0xef,0xe7,0x77,0xef,0xe4,0x4a,0xba,0xea,0xc1,0xeb,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x6b,0x52,0x65,0xa5,0x98,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,0x1,0x10,0x49,0x44,0x41,0x54,0x28,0xcf,0x8d,0xd1,0xd9,0x52,0xc2,0x30,0x14,0x80,0x61,0xd6,0xa2,0xa8,0x6c,0x75,0xdf,0x77,0xa8,0xa2,0x70,0xd2,0x4a,0x25,0x6d,0x81,0x62,0xa1,0x88,0x20,0x6e,0xc5,0xaa,0x80,0xfb,0xfa,0xfe,0xf,0x60,0x49,0x13,0x86,0xd1,0xb,0xfd,0x6e,0xf3,0xcf,0xe4,0x24,0xc7,0xe3,0xf5,0xf9,0x3,0x41,0x2e,0xe4,0xe0,0x46,0x46,0xc3,0x63,0xe3,0x9e,0x9f,0x7c,0x13,0x91,0x68,0x2c,0x9e,0xe0,0x79,0x7e,0x72,0x6a,0x7a,0x26,0xec,0xfd,0x15,0xf8,0x23,0xb3,0x73,0x9b,0x5b,0xae,0xed,0x64,0x4a,0xd8,0xa1,0x76,0x85,0x74,0x6a,0x7e,0xc1,0x9,0x2,0xd1,0xc5,0xbd,0xfd,0x8c,0x2b,0xb,0x48,0x94,0xa8,0x3,0x31,0x27,0xcb,0x4b,0x4e,0x10,0x8c,0x1d,0xb2,0xf3,0x4c,0x36,0x8f,0x95,0x34,0xa5,0x2a,0x22,0xd6,0x44,0x27,0xe0,0xe2,0x85,0x22,0x53,0xc8,0x43,0x52,0xa0,0x4a,0xaa,0x4,0x7a,0x3f,0x8,0x25,0xca,0x47,0x4c,0xd9,0x0,0xb5,0x42,0x95,0xaa,0x26,0x68,0x46,0x3f,0xe0,0x6b,0xc7,0x4c,0x6d,0x38,0x50,0x9d,0x0,0x48,0x50,0x3f,0x61,0xea,0xb9,0x86,0x34,0x34,0x43,0xf3,0x14,0x93,0x2b,0x5a,0x67,0x4c,0xb,0xa1,0xf3,0xb,0x4a,0xb9,0x4,0xf9,0xa,0x91,0x21,0xad,0x36,0x63,0x5d,0xeb,0xf6,0xe0,0x99,0x76,0x43,0xbf,0xd1,0xc9,0x33,0xad,0xf6,0x2d,0x75,0xd7,0xe9,0x62,0x9b,0x2,0xdc,0xbb,0x7f,0xd0,0xc8,0x47,0x2d,0x3f,0x3e,0x3d,0xbb,0x5e,0x3a,0xaf,0x32,0xa6,0x9a,0xbd,0xee,0xdb,0xfb,0xa,0xf9,0xea,0xd5,0xb5,0x8f,0x4f,0xd7,0x17,0x80,0x39,0x98,0xc1,0x34,0xd0,0xfa,0xc6,0x7f,0x96,0xf5,0xd7,0xba,0xbf,0x1,0xfe,0x22,0x58,0x7c,0xf4,0xd2,0xd1,0x68,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 option_button_focus_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, 0xb4, 0x50, 0x4c, 0x54, 0x45, 0x95, 0xa9, 0xb0, 0x92, 0xa7, 0xae, 0x8e, 0xa2, 0xa9, 0x8a, 0x9d, 0xa4, 0x85, 0x98, 0x9f, 0x80, 0x93, 0x9b, 0x7b, 0x8f, 0x96, 0x77, 0x8a, 0x92, 0x72, 0x86, 0x8c, 0x6e, 0x80, 0x88, 0x69, 0x7c, 0x84, 0x64, 0x77, 0x7f, 0x60, 0x72, 0x7a, 0x5b, 0x6e, 0x75, 0x56, 0x69, 0x71, 0xc8, 0xe3, 0xe7, 0xc8, 0xe2, 0xe7, 0xca, 0xe3, 0xe7, 0xce, 0xe6, 0xe9, 0xce, 0xe6, 0xea, 0xd0, 0xe6, 0xe9, 0xce, 0xe5, 0xea, 0xd0, 0xe6, 0xea, 0xce, 0xe5, 0xe9, 0xd0, 0xe5, 0xe9, 0xd3, 0xe7, 0xeb, 0xd4, 0xe7, 0xeb, 0xd9, 0xea, 0xed, 0xd7, 0xe9, 0xed, 0xd7, 0xea, 0xed, 0xdc, 0xec, 0xef, 0xdc, 0xeb, 0xef, 0xe0, 0xed, 0xf1, 0xdf, 0xee, 0xf1, 0xdf, 0xed, 0xf1, 0xe0, 0xee, 0xf1, 0xe3, 0xf0, 0xf2, 0xe2, 0xef, 0xf2, 0xe3, 0xef, 0xf2, 0xe6, 0xf1, 0xf3, 0xe8, 0xf2, 0xf5, 0xe8, 0xf3, 0xf4, 0xe8, 0xf2, 0xf4, 0xe8, 0xf3, 0xf5, 0xd6, 0x5a, 0x5b, 0xd4, 0x57, 0x58, 0xe5, 0x89, 0x89, 0xd5, 0x57, 0x59, 0xd5, 0x58, 0x59, 0xd5, 0x59, 0x5a, 0xd6, 0x59, 0x5a, 0xd6, 0x5a, 0x5c, 0xd7, 0x5b, 0x5c, 0xd7, 0x5b, 0x5d, 0xd8, 0x5c, 0x5d, 0xd8, 0x5c, 0x5e, 0xd8, 0x5d, 0x5f, 0xd9, 0x5d, 0x5f, 0xe8, 0x6c, 0x6e, 0xff, 0xff, 0xff, 0xa1, 0xe, 0x37, 0x8c, 0x0, 0x0, 0x0, 0x2c, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0xac, 0x80, 0x68, 0x47, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x3b, 0x39, 0xe, 0xf4, 0x6c, 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, 0xa3, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x5d, 0xce, 0xdb, 0x16, 0x42, 0x60, 0x18, 0x84, 0xe1, 0x4f, 0x8, 0x65, 0x57, 0x2a, 0x45, 0xd9, 0x15, 0xf9, 0xa3, 0x89, 0x28, 0xea, 0xfe, 0x2f, 0x2c, 0x4e, 0x2c, 0x79, 0xd6, 0xbc, 0xe7, 0x43, 0x34, 0xc5, 0xe5, 0x7f, 0x38, 0x9a, 0xdd, 0x31, 0x72, 0x9f, 0x11, 0xff, 0x80, 0x61, 0x18, 0xa6, 0x69, 0xac, 0xba, 0x50, 0xf0, 0x24, 0x14, 0x58, 0x5b, 0x9b, 0xed, 0xce, 0xb6, 0x6d, 0x6b, 0x8f, 0x42, 0x20, 0xb1, 0xc4, 0xc1, 0x71, 0xe, 0x7d, 0x8e, 0x83, 0x52, 0xa4, 0xf9, 0x13, 0xae, 0x7b, 0x74, 0x7b, 0xa7, 0x13, 0x9e, 0x73, 0x92, 0x72, 0x78, 0xbe, 0xef, 0x75, 0x7c, 0xcf, 0x47, 0x2e, 0x91, 0x5c, 0x21, 0x8, 0xc2, 0x20, 0x8c, 0x82, 0x73, 0x18, 0xa1, 0x92, 0x49, 0xa9, 0x71, 0x89, 0xe3, 0x38, 0x49, 0xba, 0x25, 0xa8, 0x15, 0x5a, 0xbc, 0x70, 0x1d, 0xe0, 0xb5, 0xa0, 0xe5, 0x1b, 0x69, 0xca, 0xd8, 0x8d, 0x31, 0x96, 0x65, 0x68, 0x96, 0xa4, 0x36, 0x60, 0x3, 0x34, 0x2a, 0x69, 0xed, 0xf8, 0x7a, 0xab, 0x91, 0xfe, 0xf9, 0x8e, 0x7c, 0x74, 0xd2, 0x27, 0x7e, 0x7e, 0x46, 0x20, 0x17, 0xe, 0x2d, 0x4e, 0x9, 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 option_button_normal_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x10,0x8,0x3,0x0,0x0,0x0,0x40,0xde,0x8d,0x6b,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,0x1,0x44,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,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,0x3c,0x3a,0x44,0x56,0x53,0x61,0x2b,0x2b,0x31,0x2e,0x2e,0x34,0x56,0x52,0x60,0x2a,0x2a,0x30,0x47,0x44,0x52,0x22,0x22,0x27,0x33,0x31,0x39,0x47,0x44,0x50,0x24,0x24,0x28,0x24,0x24,0x29,0x52,0x50,0x5d,0x51,0x4f,0x5d,0x5d,0x5a,0x6a,0x2a,0x2a,0x31,0x2a,0x2a,0x30,0x2d,0x2d,0x34,0x2f,0x2f,0x36,0x2e,0x2e,0x35,0x2c,0x2c,0x32,0x46,0x42,0x4e,0x42,0x3e,0x4a,0x41,0x3e,0x49,0x51,0x4e,0x5b,0x26,0x26,0x2b,0x24,0x24,0x28,0x27,0x27,0x2d,0x29,0x29,0x2f,0x28,0x28,0x2e,0x25,0x25,0x2b,0x23,0x23,0x28,0x40,0x3e,0x48,0x50,0x4e,0x5a,0x26,0x26,0x2c,0x25,0x25,0x2a,0x2a,0x2a,0x2f,0x2b,0x2b,0x31,0x22,0x22,0x26,0x4f,0x4c,0x59,0x3f,0x3d,0x47,0x2d,0x2d,0x33,0x22,0x22,0x27,0x4e,0x4a,0x58,0x3e,0x3b,0x46,0x27,0x27,0x2b,0x2e,0x2e,0x34,0x2c,0x2c,0x31,0x29,0x29,0x2e,0x4b,0x49,0x55,0x3c,0x3a,0x44,0x4a,0x47,0x54,0x3b,0x39,0x43,0x24,0x24,0x2a,0x24,0x24,0x29,0x20,0x20,0x25,0x49,0x46,0x53,0x3a,0x38,0x42,0x28,0x28,0x2d,0x2b,0x2b,0x30,0x29,0x29,0x2d,0x20,0x20,0x23,0x47,0x45,0x50,0x39,0x37,0x40,0x22,0x22,0x28,0x27,0x27,0x2c,0x1e,0x1e,0x22,0x47,0x43,0x50,0x38,0x35,0x3f,0x46,0x42,0x4f,0x21,0x21,0x26,0x21,0x21,0x25,0x23,0x23,0x27,0x20,0x20,0x24,0x1d,0x1d,0x21,0x36,0x34,0x3e,0x44,0x41,0x4e,0x1f,0x1f,0x24,0x1f,0x1f,0x23,0x1e,0x1e,0x21,0x44,0x42,0x4d,0x44,0x41,0x4c,0x4e,0x4b,0x58,0xff,0xff,0xff,0xd7,0xc8,0xfe,0x88,0x0,0x0,0x0,0x24,0x74,0x52,0x4e,0x53,0x0,0x4,0xa,0x11,0x19,0x1f,0x22,0x24,0x1d,0x16,0xd,0x7,0x2,0x15,0x25,0x34,0x3f,0x46,0x47,0x48,0x43,0x3a,0x2d,0x1b,0x77,0xef,0xe6,0x49,0xef,0xe6,0xef,0xe7,0x77,0xef,0xe4,0x4a,0xba,0xea,0xc1,0xeb,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x6b,0x52,0x65,0xa5,0x98,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x1,0xe,0x49,0x44,0x41,0x54,0x28,0xcf,0x8d,0xd1,0xd7,0x56,0xc2,0x40,0x10,0x80,0x61,0x6a,0x50,0x54,0x5a,0xec,0xbd,0x43,0x14,0x85,0xdd,0x44,0xa2,0x6c,0x12,0x20,0x18,0xd,0x22,0x8,0x16,0x34,0x16,0xc0,0x5e,0xde,0xff,0x1,0x5c,0x36,0xb3,0x1c,0x8e,0x5e,0xe8,0x77,0xfd,0x9f,0xb3,0x33,0xb3,0x1e,0xaf,0xcf,0x1f,0x8,0xa,0x21,0x4a,0x18,0x1a,0xe,0x8f,0x8c,0x7a,0x7e,0xf2,0x8d,0x45,0xa2,0xb1,0x78,0x42,0x14,0xc5,0xf1,0x89,0xc9,0xa9,0xb0,0xf7,0x57,0xe0,0x8f,0x4c,0xcf,0xac,0x6f,0xb8,0x36,0x93,0x29,0x69,0xb,0x6c,0x4b,0xe9,0xd4,0xec,0x1c,0xd,0x2,0xd1,0xf9,0x9d,0xdd,0x8c,0x2b,0x8b,0xb0,0xac,0x80,0x3d,0x39,0xa7,0xaa,0xb,0x34,0x8,0xc6,0xb2,0x99,0x7d,0x70,0x90,0x27,0x5a,0x1a,0xe8,0x9a,0x4c,0xc,0x99,0x6,0x42,0xbc,0x50,0xe4,0xa,0x79,0x94,0x94,0x40,0x49,0x57,0x90,0xd9,0xb,0x42,0x89,0xf2,0x21,0x57,0xb6,0x90,0x7e,0x4,0x4a,0xc7,0x36,0x32,0xac,0x5e,0x20,0x56,0x4e,0xb8,0xca,0x60,0xa0,0xd3,0x0,0xb1,0xa0,0x7a,0xca,0x55,0x73,0x35,0x65,0x60,0x86,0xfa,0x19,0x61,0x4f,0x34,0x9a,0x5c,0x3,0xe3,0xf3,0xb,0xa0,0x5d,0x22,0xf5,0xa,0xb3,0x21,0x5b,0xd7,0x5c,0xeb,0xc6,0x74,0xfa,0x6b,0x3a,0x35,0xf3,0xd6,0x64,0x6b,0xde,0xdd,0x73,0xf,0xed,0xe,0x71,0x0,0x22,0xdd,0xc7,0x27,0x83,0x1d,0x6a,0xb1,0xf9,0xc,0x5e,0xda,0xaf,0x2a,0x1,0xf5,0x6e,0xe7,0xed,0x7d,0x89,0x9d,0x7a,0x79,0xe5,0xe3,0xd3,0xf5,0x85,0x90,0xdd,0x9f,0xc1,0xb6,0xf0,0xea,0xda,0x7f,0x3e,0xeb,0xaf,0xef,0xfe,0x6,0x1a,0x96,0x59,0x89,0x91,0xf7,0xf1,0x7b,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 option_button_hover_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x10, 0x8, 0x3, 0x0, 0x0, 0x0, 0x40, 0xde, 0x8d, 0x6b, 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, 0x1, 0x44, 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, 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, 0x42, 0x40, 0x4b, 0x5f, 0x5a, 0x6c, 0x2b, 0x2b, 0x31, 0x2e, 0x2e, 0x34, 0x5f, 0x5a, 0x6b, 0x2a, 0x2a, 0x30, 0x56, 0x53, 0x64, 0x22, 0x22, 0x27, 0x3e, 0x3b, 0x46, 0x57, 0x53, 0x63, 0x24, 0x24, 0x28, 0x24, 0x24, 0x29, 0x5b, 0x57, 0x68, 0x5a, 0x56, 0x67, 0x67, 0x63, 0x76, 0x2a, 0x2a, 0x31, 0x2a, 0x2a, 0x30, 0x2d, 0x2d, 0x34, 0x2f, 0x2f, 0x36, 0x2e, 0x2e, 0x35, 0x2c, 0x2c, 0x32, 0x4d, 0x4a, 0x57, 0x49, 0x46, 0x52, 0x48, 0x45, 0x51, 0x5a, 0x56, 0x65, 0x26, 0x26, 0x2b, 0x24, 0x24, 0x28, 0x27, 0x27, 0x2d, 0x29, 0x29, 0x2f, 0x28, 0x28, 0x2e, 0x25, 0x25, 0x2b, 0x23, 0x23, 0x28, 0x5b, 0x57, 0x66, 0x26, 0x26, 0x2c, 0x25, 0x25, 0x2a, 0x2a, 0x2a, 0x2f, 0x2b, 0x2b, 0x31, 0x22, 0x22, 0x26, 0x59, 0x55, 0x64, 0x47, 0x44, 0x50, 0x2d, 0x2d, 0x33, 0x22, 0x22, 0x27, 0x58, 0x54, 0x64, 0x46, 0x43, 0x50, 0x27, 0x27, 0x2b, 0x2e, 0x2e, 0x34, 0x2c, 0x2c, 0x31, 0x29, 0x29, 0x2e, 0x56, 0x53, 0x63, 0x45, 0x42, 0x4f, 0x56, 0x53, 0x62, 0x45, 0x42, 0x4e, 0x24, 0x24, 0x2a, 0x24, 0x24, 0x29, 0x20, 0x20, 0x25, 0x55, 0x51, 0x62, 0x44, 0x41, 0x4e, 0x28, 0x28, 0x2d, 0x2b, 0x2b, 0x30, 0x29, 0x29, 0x2d, 0x20, 0x20, 0x23, 0x55, 0x51, 0x60, 0x44, 0x41, 0x4d, 0x22, 0x22, 0x28, 0x27, 0x27, 0x2c, 0x1e, 0x1e, 0x22, 0x43, 0x40, 0x4c, 0x54, 0x50, 0x5f, 0x21, 0x21, 0x26, 0x21, 0x21, 0x25, 0x23, 0x23, 0x27, 0x20, 0x20, 0x24, 0x1d, 0x1d, 0x21, 0x47, 0x43, 0x51, 0x43, 0x3f, 0x4d, 0x42, 0x3f, 0x4c, 0x53, 0x4f, 0x5f, 0x1f, 0x1f, 0x24, 0x1f, 0x1f, 0x23, 0x1e, 0x1e, 0x21, 0x53, 0x50, 0x5f, 0x53, 0x4f, 0x5e, 0x5f, 0x5a, 0x6c, 0xff, 0xff, 0xff, 0xd1, 0x85, 0xc5, 0x5, 0x0, 0x0, 0x0, 0x24, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x4, 0xa, 0x11, 0x19, 0x1f, 0x22, 0x24, 0x1d, 0x16, 0xd, 0x7, 0x2, 0x15, 0x25, 0x34, 0x3f, 0x46, 0x47, 0x48, 0x43, 0x3a, 0x2d, 0x1b, 0x77, 0xef, 0xe6, 0x49, 0xef, 0xe6, 0xef, 0xe7, 0x77, 0xef, 0xe4, 0x4a, 0xba, 0xea, 0xc1, 0xeb, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x6b, 0x52, 0x65, 0xa5, 0x98, 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, 0x1, 0x10, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x8d, 0xd1, 0xd9, 0x52, 0xc2, 0x30, 0x14, 0x80, 0x61, 0xd6, 0xa2, 0xa8, 0x6c, 0x75, 0xdf, 0x77, 0xa8, 0xa2, 0x70, 0xd2, 0x4a, 0x25, 0x6d, 0x81, 0x62, 0xa1, 0x88, 0x20, 0x6e, 0xc5, 0xaa, 0x80, 0xfb, 0xfa, 0xfe, 0xf, 0x60, 0x49, 0x13, 0x86, 0xd1, 0xb, 0xfd, 0x6e, 0xf3, 0xcf, 0xe4, 0x24, 0xc7, 0xe3, 0xf5, 0xf9, 0x3, 0x41, 0x2e, 0xe4, 0xe0, 0x46, 0x46, 0xc3, 0x63, 0xe3, 0x9e, 0x9f, 0x7c, 0x13, 0x91, 0x68, 0x2c, 0x9e, 0xe0, 0x79, 0x7e, 0x72, 0x6a, 0x7a, 0x26, 0xec, 0xfd, 0x15, 0xf8, 0x23, 0xb3, 0x73, 0x9b, 0x5b, 0xae, 0xed, 0x64, 0x4a, 0xd8, 0xa1, 0x76, 0x85, 0x74, 0x6a, 0x7e, 0xc1, 0x9, 0x2, 0xd1, 0xc5, 0xbd, 0xfd, 0x8c, 0x2b, 0xb, 0x48, 0x94, 0xa8, 0x3, 0x31, 0x27, 0xcb, 0x4b, 0x4e, 0x10, 0x8c, 0x1d, 0xb2, 0xf3, 0x4c, 0x36, 0x8f, 0x95, 0x34, 0xa5, 0x2a, 0x22, 0xd6, 0x44, 0x27, 0xe0, 0xe2, 0x85, 0x22, 0x53, 0xc8, 0x43, 0x52, 0xa0, 0x4a, 0xaa, 0x4, 0x7a, 0x3f, 0x8, 0x25, 0xca, 0x47, 0x4c, 0xd9, 0x0, 0xb5, 0x42, 0x95, 0xaa, 0x26, 0x68, 0x46, 0x3f, 0xe0, 0x6b, 0xc7, 0x4c, 0x6d, 0x38, 0x50, 0x9d, 0x0, 0x48, 0x50, 0x3f, 0x61, 0xea, 0xb9, 0x86, 0x34, 0x34, 0x43, 0xf3, 0x14, 0x93, 0x2b, 0x5a, 0x67, 0x4c, 0xb, 0xa1, 0xf3, 0xb, 0x4a, 0xb9, 0x4, 0xf9, 0xa, 0x91, 0x21, 0xad, 0x36, 0x63, 0x5d, 0xeb, 0xf6, 0xe0, 0x99, 0x76, 0x43, 0xbf, 0xd1, 0xc9, 0x33, 0xad, 0xf6, 0x2d, 0x75, 0xd7, 0xe9, 0x62, 0x9b, 0x2, 0xdc, 0xbb, 0x7f, 0xd0, 0xc8, 0x47, 0x2d, 0x3f, 0x3e, 0x3d, 0xbb, 0x5e, 0x3a, 0xaf, 0x32, 0xa6, 0x9a, 0xbd, 0xee, 0xdb, 0xfb, 0xa, 0xf9, 0xea, 0xd5, 0xb5, 0x8f, 0x4f, 0xd7, 0x17, 0x80, 0x39, 0x98, 0xc1, 0x34, 0xd0, 0xfa, 0xc6, 0x7f, 0x96, 0xf5, 0xd7, 0xba, 0xbf, 0x1, 0xfe, 0x22, 0x58, 0x7c, 0xf4, 0xd2, 0xd1, 0x68, 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 option_button_pressed_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x10,0x8,0x3,0x0,0x0,0x0,0x40,0xde,0x8d,0x6b,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,0x1,0x4d,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,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,0x31,0x2f,0x37,0x46,0x43,0x4f,0x2b,0x2b,0x31,0x2e,0x2e,0x34,0x47,0x44,0x50,0x2a,0x2a,0x30,0x55,0x52,0x5f,0x22,0x22,0x27,0x3d,0x3a,0x45,0x56,0x52,0x60,0x24,0x24,0x28,0x24,0x24,0x29,0x43,0x40,0x4c,0x42,0x40,0x4b,0x4c,0x49,0x56,0x2a,0x2a,0x31,0x2a,0x2a,0x30,0x2d,0x2d,0x34,0x2f,0x2f,0x36,0x2e,0x2e,0x35,0x2c,0x2c,0x32,0x3a,0x38,0x41,0x36,0x34,0x3d,0x44,0x41,0x4c,0x26,0x26,0x2b,0x24,0x24,0x28,0x27,0x27,0x2d,0x29,0x29,0x2f,0x28,0x28,0x2e,0x25,0x25,0x2b,0x23,0x23,0x28,0x44,0x42,0x4e,0x36,0x34,0x3e,0x44,0x41,0x4e,0x26,0x26,0x2c,0x25,0x25,0x2a,0x2a,0x2a,0x2f,0x2b,0x2b,0x31,0x22,0x22,0x26,0x46,0x42,0x4f,0x38,0x35,0x3f,0x2d,0x2d,0x33,0x22,0x22,0x27,0x47,0x45,0x50,0x39,0x37,0x40,0x27,0x27,0x2b,0x2e,0x2e,0x34,0x2c,0x2c,0x31,0x29,0x29,0x2e,0x49,0x46,0x53,0x3a,0x38,0x42,0x4a,0x47,0x54,0x3b,0x39,0x43,0x24,0x24,0x2a,0x24,0x24,0x29,0x20,0x20,0x25,0x4b,0x49,0x55,0x3c,0x3a,0x44,0x28,0x28,0x2d,0x2b,0x2b,0x30,0x29,0x29,0x2d,0x20,0x20,0x23,0x4e,0x4a,0x58,0x3e,0x3b,0x46,0x22,0x22,0x28,0x27,0x27,0x2c,0x1e,0x1e,0x22,0x50,0x4d,0x5a,0x3f,0x3d,0x48,0x3f,0x3d,0x47,0x4f,0x4c,0x59,0x21,0x21,0x26,0x21,0x21,0x25,0x23,0x23,0x27,0x20,0x20,0x24,0x1d,0x1d,0x21,0x45,0x42,0x4d,0x41,0x3e,0x49,0x40,0x3e,0x48,0x50,0x4e,0x5a,0x1f,0x1f,0x24,0x1f,0x1f,0x23,0x1e,0x1e,0x21,0x52,0x4e,0x5c,0x51,0x4e,0x5b,0x5d,0x59,0x69,0xff,0xff,0xff,0x2,0x4e,0xff,0xf1,0x0,0x0,0x0,0x24,0x74,0x52,0x4e,0x53,0x0,0x4,0xa,0x11,0x19,0x1f,0x22,0x24,0x1d,0x16,0xd,0x7,0x2,0x15,0x25,0x34,0x3f,0x46,0x47,0x48,0x43,0x3a,0x2d,0x1b,0x77,0xef,0xe6,0x49,0xef,0xe6,0xef,0xe7,0x77,0xef,0xe4,0x4a,0xba,0xea,0xc1,0xeb,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x6e,0x22,0xf,0x51,0x17,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,0x1,0xe,0x49,0x44,0x41,0x54,0x28,0xcf,0x8d,0xd1,0x57,0x53,0xc2,0x40,0x10,0xc0,0x71,0x6a,0x50,0x54,0x5a,0xec,0xbd,0x43,0x14,0xf5,0x2e,0x91,0xa8,0x5c,0x12,0x20,0x18,0xd,0x22,0x88,0xd,0x8d,0xd,0xb0,0xd7,0xef,0xff,0xea,0x71,0xd9,0x63,0x18,0x7d,0xd0,0xdf,0xf3,0x7f,0xe6,0x76,0xf7,0x3c,0x5e,0x9f,0x3f,0x10,0x14,0x42,0x94,0xd0,0xd3,0x1b,0xee,0xeb,0xf7,0xfc,0xe4,0x1b,0x88,0x44,0x63,0xf1,0x84,0x28,0x8a,0x83,0x43,0xc3,0x23,0x61,0xef,0xaf,0xc0,0x1f,0x19,0x1d,0x5b,0x5c,0x72,0x2d,0x27,0x53,0xd2,0xa,0x58,0x95,0xd2,0xa9,0xf1,0x9,0x1a,0x4,0xa2,0x93,0x6b,0xeb,0x60,0x3,0x61,0x59,0x1,0x9b,0x72,0x46,0x55,0xa7,0x68,0x10,0x8c,0x6d,0x6d,0x73,0x3b,0x59,0xa2,0xa5,0x81,0xae,0xc9,0xc4,0x90,0x69,0x20,0xc4,0x73,0x79,0x2e,0x97,0x45,0x49,0x9,0x14,0x74,0x5,0x99,0xed,0x20,0x94,0x28,0xee,0x72,0x45,0xb,0xe9,0x7b,0xa0,0xb0,0x6f,0x23,0xc3,0x6a,0x7,0x62,0xe9,0x80,0x2b,0x75,0x7,0x3a,0xd,0x10,0xb,0xca,0x87,0x5c,0x39,0x53,0x51,0xba,0x66,0xa8,0x1e,0x11,0xf6,0x44,0xed,0x98,0xab,0x61,0x7c,0x72,0xa,0xb4,0x33,0xa4,0x9e,0x63,0x36,0x64,0xfd,0x82,0xab,0x5f,0x9a,0x4e,0x67,0x4d,0xa7,0x62,0x5e,0x99,0x6c,0xcd,0xeb,0x9b,0x5b,0x70,0xd7,0x68,0x12,0x7,0x20,0xd2,0xba,0x7f,0x30,0xd8,0xa1,0xa6,0x1f,0x9f,0x9e,0x5d,0x2f,0x8d,0x57,0x95,0x80,0x6a,0xab,0xf9,0xf6,0x3e,0xc3,0x4e,0x3d,0x3b,0xf7,0xf1,0xe9,0xfa,0x42,0xc8,0xee,0xcc,0x60,0x5b,0x78,0x7e,0xe1,0x3f,0x9f,0xf5,0xd7,0x77,0x7f,0x3,0x1c,0x7f,0x59,0xc2,0x5e,0xdd,0xbf,0x43,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 option_button_normal_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x10, 0x8, 0x3, 0x0, 0x0, 0x0, 0x40, 0xde, 0x8d, 0x6b, 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, 0x1, 0x44, 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, 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, 0x3c, 0x3a, 0x44, 0x56, 0x53, 0x61, 0x2b, 0x2b, 0x31, 0x2e, 0x2e, 0x34, 0x56, 0x52, 0x60, 0x2a, 0x2a, 0x30, 0x47, 0x44, 0x52, 0x22, 0x22, 0x27, 0x33, 0x31, 0x39, 0x47, 0x44, 0x50, 0x24, 0x24, 0x28, 0x24, 0x24, 0x29, 0x52, 0x50, 0x5d, 0x51, 0x4f, 0x5d, 0x5d, 0x5a, 0x6a, 0x2a, 0x2a, 0x31, 0x2a, 0x2a, 0x30, 0x2d, 0x2d, 0x34, 0x2f, 0x2f, 0x36, 0x2e, 0x2e, 0x35, 0x2c, 0x2c, 0x32, 0x46, 0x42, 0x4e, 0x42, 0x3e, 0x4a, 0x41, 0x3e, 0x49, 0x51, 0x4e, 0x5b, 0x26, 0x26, 0x2b, 0x24, 0x24, 0x28, 0x27, 0x27, 0x2d, 0x29, 0x29, 0x2f, 0x28, 0x28, 0x2e, 0x25, 0x25, 0x2b, 0x23, 0x23, 0x28, 0x40, 0x3e, 0x48, 0x50, 0x4e, 0x5a, 0x26, 0x26, 0x2c, 0x25, 0x25, 0x2a, 0x2a, 0x2a, 0x2f, 0x2b, 0x2b, 0x31, 0x22, 0x22, 0x26, 0x4f, 0x4c, 0x59, 0x3f, 0x3d, 0x47, 0x2d, 0x2d, 0x33, 0x22, 0x22, 0x27, 0x4e, 0x4a, 0x58, 0x3e, 0x3b, 0x46, 0x27, 0x27, 0x2b, 0x2e, 0x2e, 0x34, 0x2c, 0x2c, 0x31, 0x29, 0x29, 0x2e, 0x4b, 0x49, 0x55, 0x3c, 0x3a, 0x44, 0x4a, 0x47, 0x54, 0x3b, 0x39, 0x43, 0x24, 0x24, 0x2a, 0x24, 0x24, 0x29, 0x20, 0x20, 0x25, 0x49, 0x46, 0x53, 0x3a, 0x38, 0x42, 0x28, 0x28, 0x2d, 0x2b, 0x2b, 0x30, 0x29, 0x29, 0x2d, 0x20, 0x20, 0x23, 0x47, 0x45, 0x50, 0x39, 0x37, 0x40, 0x22, 0x22, 0x28, 0x27, 0x27, 0x2c, 0x1e, 0x1e, 0x22, 0x47, 0x43, 0x50, 0x38, 0x35, 0x3f, 0x46, 0x42, 0x4f, 0x21, 0x21, 0x26, 0x21, 0x21, 0x25, 0x23, 0x23, 0x27, 0x20, 0x20, 0x24, 0x1d, 0x1d, 0x21, 0x36, 0x34, 0x3e, 0x44, 0x41, 0x4e, 0x1f, 0x1f, 0x24, 0x1f, 0x1f, 0x23, 0x1e, 0x1e, 0x21, 0x44, 0x42, 0x4d, 0x44, 0x41, 0x4c, 0x4e, 0x4b, 0x58, 0xff, 0xff, 0xff, 0xd7, 0xc8, 0xfe, 0x88, 0x0, 0x0, 0x0, 0x24, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x4, 0xa, 0x11, 0x19, 0x1f, 0x22, 0x24, 0x1d, 0x16, 0xd, 0x7, 0x2, 0x15, 0x25, 0x34, 0x3f, 0x46, 0x47, 0x48, 0x43, 0x3a, 0x2d, 0x1b, 0x77, 0xef, 0xe6, 0x49, 0xef, 0xe6, 0xef, 0xe7, 0x77, 0xef, 0xe4, 0x4a, 0xba, 0xea, 0xc1, 0xeb, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x6b, 0x52, 0x65, 0xa5, 0x98, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x1, 0xe, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x8d, 0xd1, 0xd7, 0x56, 0xc2, 0x40, 0x10, 0x80, 0x61, 0x6a, 0x50, 0x54, 0x5a, 0xec, 0xbd, 0x43, 0x14, 0x85, 0xdd, 0x44, 0xa2, 0x6c, 0x12, 0x20, 0x18, 0xd, 0x22, 0x8, 0x16, 0x34, 0x16, 0xc0, 0x5e, 0xde, 0xff, 0x1, 0x5c, 0x36, 0xb3, 0x1c, 0x8e, 0x5e, 0xe8, 0x77, 0xfd, 0x9f, 0xb3, 0x33, 0xb3, 0x1e, 0xaf, 0xcf, 0x1f, 0x8, 0xa, 0x21, 0x4a, 0x18, 0x1a, 0xe, 0x8f, 0x8c, 0x7a, 0x7e, 0xf2, 0x8d, 0x45, 0xa2, 0xb1, 0x78, 0x42, 0x14, 0xc5, 0xf1, 0x89, 0xc9, 0xa9, 0xb0, 0xf7, 0x57, 0xe0, 0x8f, 0x4c, 0xcf, 0xac, 0x6f, 0xb8, 0x36, 0x93, 0x29, 0x69, 0xb, 0x6c, 0x4b, 0xe9, 0xd4, 0xec, 0x1c, 0xd, 0x2, 0xd1, 0xf9, 0x9d, 0xdd, 0x8c, 0x2b, 0x8b, 0xb0, 0xac, 0x80, 0x3d, 0x39, 0xa7, 0xaa, 0xb, 0x34, 0x8, 0xc6, 0xb2, 0x99, 0x7d, 0x70, 0x90, 0x27, 0x5a, 0x1a, 0xe8, 0x9a, 0x4c, 0xc, 0x99, 0x6, 0x42, 0xbc, 0x50, 0xe4, 0xa, 0x79, 0x94, 0x94, 0x40, 0x49, 0x57, 0x90, 0xd9, 0xb, 0x42, 0x89, 0xf2, 0x21, 0x57, 0xb6, 0x90, 0x7e, 0x4, 0x4a, 0xc7, 0x36, 0x32, 0xac, 0x5e, 0x20, 0x56, 0x4e, 0xb8, 0xca, 0x60, 0xa0, 0xd3, 0x0, 0xb1, 0xa0, 0x7a, 0xca, 0x55, 0x73, 0x35, 0x65, 0x60, 0x86, 0xfa, 0x19, 0x61, 0x4f, 0x34, 0x9a, 0x5c, 0x3, 0xe3, 0xf3, 0xb, 0xa0, 0x5d, 0x22, 0xf5, 0xa, 0xb3, 0x21, 0x5b, 0xd7, 0x5c, 0xeb, 0xc6, 0x74, 0xfa, 0x6b, 0x3a, 0x35, 0xf3, 0xd6, 0x64, 0x6b, 0xde, 0xdd, 0x73, 0xf, 0xed, 0xe, 0x71, 0x0, 0x22, 0xdd, 0xc7, 0x27, 0x83, 0x1d, 0x6a, 0xb1, 0xf9, 0xc, 0x5e, 0xda, 0xaf, 0x2a, 0x1, 0xf5, 0x6e, 0xe7, 0xed, 0x7d, 0x89, 0x9d, 0x7a, 0x79, 0xe5, 0xe3, 0xd3, 0xf5, 0x85, 0x90, 0xdd, 0x9f, 0xc1, 0xb6, 0xf0, 0xea, 0xda, 0x7f, 0x3e, 0xeb, 0xaf, 0xef, 0xfe, 0x6, 0x1a, 0x96, 0x59, 0x89, 0x91, 0xf7, 0xf1, 0x7b, 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 panel_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x1,0x3,0x0,0x0,0x0,0xfe,0xc1,0x2c,0xc8,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,0x6,0x50,0x4c,0x54,0x45,0x25,0x25,0x2a,0x35,0x32,0x3b,0x4a,0x73,0x58,0x4a,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x1,0xff,0x2,0x2d,0xde,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,0xb,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x40,0x5,0x0,0x0,0x10,0x0,0x1,0xa1,0xc5,0x21,0xc1,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 option_button_pressed_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x10, 0x8, 0x3, 0x0, 0x0, 0x0, 0x40, 0xde, 0x8d, 0x6b, 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, 0x1, 0x4d, 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, 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, 0x31, 0x2f, 0x37, 0x46, 0x43, 0x4f, 0x2b, 0x2b, 0x31, 0x2e, 0x2e, 0x34, 0x47, 0x44, 0x50, 0x2a, 0x2a, 0x30, 0x55, 0x52, 0x5f, 0x22, 0x22, 0x27, 0x3d, 0x3a, 0x45, 0x56, 0x52, 0x60, 0x24, 0x24, 0x28, 0x24, 0x24, 0x29, 0x43, 0x40, 0x4c, 0x42, 0x40, 0x4b, 0x4c, 0x49, 0x56, 0x2a, 0x2a, 0x31, 0x2a, 0x2a, 0x30, 0x2d, 0x2d, 0x34, 0x2f, 0x2f, 0x36, 0x2e, 0x2e, 0x35, 0x2c, 0x2c, 0x32, 0x3a, 0x38, 0x41, 0x36, 0x34, 0x3d, 0x44, 0x41, 0x4c, 0x26, 0x26, 0x2b, 0x24, 0x24, 0x28, 0x27, 0x27, 0x2d, 0x29, 0x29, 0x2f, 0x28, 0x28, 0x2e, 0x25, 0x25, 0x2b, 0x23, 0x23, 0x28, 0x44, 0x42, 0x4e, 0x36, 0x34, 0x3e, 0x44, 0x41, 0x4e, 0x26, 0x26, 0x2c, 0x25, 0x25, 0x2a, 0x2a, 0x2a, 0x2f, 0x2b, 0x2b, 0x31, 0x22, 0x22, 0x26, 0x46, 0x42, 0x4f, 0x38, 0x35, 0x3f, 0x2d, 0x2d, 0x33, 0x22, 0x22, 0x27, 0x47, 0x45, 0x50, 0x39, 0x37, 0x40, 0x27, 0x27, 0x2b, 0x2e, 0x2e, 0x34, 0x2c, 0x2c, 0x31, 0x29, 0x29, 0x2e, 0x49, 0x46, 0x53, 0x3a, 0x38, 0x42, 0x4a, 0x47, 0x54, 0x3b, 0x39, 0x43, 0x24, 0x24, 0x2a, 0x24, 0x24, 0x29, 0x20, 0x20, 0x25, 0x4b, 0x49, 0x55, 0x3c, 0x3a, 0x44, 0x28, 0x28, 0x2d, 0x2b, 0x2b, 0x30, 0x29, 0x29, 0x2d, 0x20, 0x20, 0x23, 0x4e, 0x4a, 0x58, 0x3e, 0x3b, 0x46, 0x22, 0x22, 0x28, 0x27, 0x27, 0x2c, 0x1e, 0x1e, 0x22, 0x50, 0x4d, 0x5a, 0x3f, 0x3d, 0x48, 0x3f, 0x3d, 0x47, 0x4f, 0x4c, 0x59, 0x21, 0x21, 0x26, 0x21, 0x21, 0x25, 0x23, 0x23, 0x27, 0x20, 0x20, 0x24, 0x1d, 0x1d, 0x21, 0x45, 0x42, 0x4d, 0x41, 0x3e, 0x49, 0x40, 0x3e, 0x48, 0x50, 0x4e, 0x5a, 0x1f, 0x1f, 0x24, 0x1f, 0x1f, 0x23, 0x1e, 0x1e, 0x21, 0x52, 0x4e, 0x5c, 0x51, 0x4e, 0x5b, 0x5d, 0x59, 0x69, 0xff, 0xff, 0xff, 0x2, 0x4e, 0xff, 0xf1, 0x0, 0x0, 0x0, 0x24, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x4, 0xa, 0x11, 0x19, 0x1f, 0x22, 0x24, 0x1d, 0x16, 0xd, 0x7, 0x2, 0x15, 0x25, 0x34, 0x3f, 0x46, 0x47, 0x48, 0x43, 0x3a, 0x2d, 0x1b, 0x77, 0xef, 0xe6, 0x49, 0xef, 0xe6, 0xef, 0xe7, 0x77, 0xef, 0xe4, 0x4a, 0xba, 0xea, 0xc1, 0xeb, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x6e, 0x22, 0xf, 0x51, 0x17, 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, 0x1, 0xe, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x8d, 0xd1, 0x57, 0x53, 0xc2, 0x40, 0x10, 0xc0, 0x71, 0x6a, 0x50, 0x54, 0x5a, 0xec, 0xbd, 0x43, 0x14, 0xf5, 0x2e, 0x91, 0xa8, 0x5c, 0x12, 0x20, 0x18, 0xd, 0x22, 0x88, 0xd, 0x8d, 0xd, 0xb0, 0xd7, 0xef, 0xff, 0xea, 0x71, 0xd9, 0x63, 0x18, 0x7d, 0xd0, 0xdf, 0xf3, 0x7f, 0xe6, 0x76, 0xf7, 0x3c, 0x5e, 0x9f, 0x3f, 0x10, 0x14, 0x42, 0x94, 0xd0, 0xd3, 0x1b, 0xee, 0xeb, 0xf7, 0xfc, 0xe4, 0x1b, 0x88, 0x44, 0x63, 0xf1, 0x84, 0x28, 0x8a, 0x83, 0x43, 0xc3, 0x23, 0x61, 0xef, 0xaf, 0xc0, 0x1f, 0x19, 0x1d, 0x5b, 0x5c, 0x72, 0x2d, 0x27, 0x53, 0xd2, 0xa, 0x58, 0x95, 0xd2, 0xa9, 0xf1, 0x9, 0x1a, 0x4, 0xa2, 0x93, 0x6b, 0xeb, 0x60, 0x3, 0x61, 0x59, 0x1, 0x9b, 0x72, 0x46, 0x55, 0xa7, 0x68, 0x10, 0x8c, 0x6d, 0x6d, 0x73, 0x3b, 0x59, 0xa2, 0xa5, 0x81, 0xae, 0xc9, 0xc4, 0x90, 0x69, 0x20, 0xc4, 0x73, 0x79, 0x2e, 0x97, 0x45, 0x49, 0x9, 0x14, 0x74, 0x5, 0x99, 0xed, 0x20, 0x94, 0x28, 0xee, 0x72, 0x45, 0xb, 0xe9, 0x7b, 0xa0, 0xb0, 0x6f, 0x23, 0xc3, 0x6a, 0x7, 0x62, 0xe9, 0x80, 0x2b, 0x75, 0x7, 0x3a, 0xd, 0x10, 0xb, 0xca, 0x87, 0x5c, 0x39, 0x53, 0x51, 0xba, 0x66, 0xa8, 0x1e, 0x11, 0xf6, 0x44, 0xed, 0x98, 0xab, 0x61, 0x7c, 0x72, 0xa, 0xb4, 0x33, 0xa4, 0x9e, 0x63, 0x36, 0x64, 0xfd, 0x82, 0xab, 0x5f, 0x9a, 0x4e, 0x67, 0x4d, 0xa7, 0x62, 0x5e, 0x99, 0x6c, 0xcd, 0xeb, 0x9b, 0x5b, 0x70, 0xd7, 0x68, 0x12, 0x7, 0x20, 0xd2, 0xba, 0x7f, 0x30, 0xd8, 0xa1, 0xa6, 0x1f, 0x9f, 0x9e, 0x5d, 0x2f, 0x8d, 0x57, 0x95, 0x80, 0x6a, 0xab, 0xf9, 0xf6, 0x3e, 0xc3, 0x4e, 0x3d, 0x3b, 0xf7, 0xf1, 0xe9, 0xfa, 0x42, 0xc8, 0xee, 0xcc, 0x60, 0x5b, 0x78, 0x7e, 0xe1, 0x3f, 0x9f, 0xf5, 0xd7, 0x77, 0x7f, 0x3, 0x1c, 0x7f, 0x59, 0xc2, 0x5e, 0xdd, 0xbf, 0x43, 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 popup_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,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,0xa5,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,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3b,0x3b,0x43,0x42,0x42,0x4b,0x3e,0x3e,0x47,0x3e,0x3e,0x46,0x41,0x41,0x4a,0x0,0x0,0x0,0x3d,0x3d,0x45,0x3b,0x3b,0x43,0x3a,0x3a,0x42,0x38,0x38,0x41,0x37,0x37,0x3e,0x36,0x36,0x3d,0x35,0x35,0x3c,0x0,0x0,0x0,0x38,0x38,0x40,0x38,0x38,0x40,0x31,0x31,0x38,0x34,0x34,0x3b,0x34,0x34,0x3b,0x39,0x39,0x3f,0x31,0x31,0x38,0x2f,0x2f,0x36,0x2d,0x2d,0x33,0x2c,0x2c,0x32,0x2b,0x2b,0x31,0x2a,0x2a,0x31,0x2a,0x2a,0x30,0x29,0x29,0x30,0x29,0x29,0x2f,0x28,0x28,0x2e,0x28,0x28,0x2d,0x27,0x27,0x2d,0x27,0x27,0x2c,0x29,0x29,0x2e,0x26,0x26,0x2c,0x35,0x32,0x3b,0xf,0xeb,0x7f,0x60,0x0,0x0,0x0,0x28,0x74,0x52,0x4e,0x53,0x0,0x1,0x3,0x5,0x8,0xa,0xb,0x4,0x13,0x19,0x1f,0x22,0x23,0x16,0x27,0x35,0x3f,0x45,0x46,0x94,0xf5,0xfa,0xfb,0xf5,0x40,0xfc,0xfb,0xfb,0xfb,0xfb,0xfc,0xfc,0x1a,0xf5,0xf6,0x95,0xfa,0xfb,0xf4,0x94,0x71,0xda,0xac,0x92,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x36,0x47,0xbf,0x88,0xd1,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,0xaf,0x49,0x44,0x41,0x54,0x18,0xd3,0x65,0xcf,0xc9,0x12,0x82,0x30,0x10,0x4,0xd0,0x1,0x12,0xb6,0x0,0x21,0x2c,0xb2,0xaa,0xa0,0xa8,0x80,0x88,0x8,0xf8,0xff,0xbf,0x66,0x98,0x93,0xa5,0xef,0xd8,0x55,0xd3,0xd5,0x3,0xa0,0xa8,0x1a,0xa1,0xba,0x44,0x89,0xa6,0x2a,0x0,0x8a,0x41,0x4d,0xcb,0x66,0x8e,0xc3,0x6c,0xcb,0xa4,0x86,0x2,0x2a,0x75,0x3d,0xee,0x8b,0x20,0x10,0x3e,0xf7,0x5c,0xaa,0x82,0x66,0x7a,0x61,0x14,0xef,0xa4,0x38,0xa,0x3d,0x53,0x3,0x62,0xf1,0xa4,0xed,0x50,0x9b,0x70,0x8b,0x0,0xb5,0xd3,0xac,0xeb,0x51,0x97,0xa5,0x36,0x5,0x9d,0x89,0xbc,0xbf,0xa3,0x3e,0x17,0x4c,0x7,0xdd,0x9,0x8a,0xe1,0x81,0x86,0x22,0x70,0x30,0x28,0xc7,0x27,0x1a,0x4b,0xc,0x98,0xd8,0x4f,0x2f,0x34,0xed,0xb7,0x13,0x59,0x7a,0x98,0x17,0x34,0x1f,0xb7,0x52,0x52,0xf1,0x7a,0x5d,0xde,0xd2,0xb2,0x9e,0x78,0x45,0xb6,0x61,0xe7,0xba,0xb9,0x48,0xcd,0xf5,0xb6,0xd,0xc3,0xe9,0xe9,0xd7,0xf4,0xbf,0xe7,0x7e,0xdf,0xff,0x0,0xda,0x19,0x15,0x34,0xd5,0xa4,0x90,0x50,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 panel_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x1, 0x3, 0x0, 0x0, 0x0, 0xfe, 0xc1, 0x2c, 0xc8, 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, 0x6, 0x50, 0x4c, 0x54, 0x45, 0x25, 0x25, 0x2a, 0x35, 0x32, 0x3b, 0x4a, 0x73, 0x58, 0x4a, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x1, 0xff, 0x2, 0x2d, 0xde, 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, 0xb, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x40, 0x5, 0x0, 0x0, 0x10, 0x0, 0x1, 0xa1, 0xc5, 0x21, 0xc1, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 popup_bg_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,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,0x7b,0x50,0x4c,0x54,0x45,0xff,0x0,0xff,0x67,0x7a,0x85,0x66,0x7a,0x86,0x68,0x7b,0x86,0x57,0x51,0x51,0x4c,0x42,0x40,0x4d,0x43,0x41,0x56,0x4c,0x4b,0x4d,0x44,0x41,0x4e,0x44,0x42,0x4f,0x45,0x43,0x67,0x7b,0x87,0x4f,0x44,0x43,0x50,0x45,0x44,0x52,0x46,0x44,0x51,0x46,0x45,0x4b,0x40,0x3f,0x51,0x47,0x45,0x52,0x48,0x46,0x53,0x48,0x47,0x4b,0x41,0x3f,0x54,0x49,0x46,0x55,0x4a,0x47,0x55,0x49,0x47,0x68,0x7c,0x88,0x4a,0x40,0x3e,0x55,0x4b,0x49,0x56,0x4d,0x4b,0x53,0x49,0x47,0x50,0x46,0x44,0x4a,0x41,0x3e,0x48,0x3e,0x3c,0x4b,0x42,0x3f,0x49,0x3f,0x3d,0x46,0x3d,0x3c,0x47,0x3d,0x3b,0x47,0x3e,0x3b,0x49,0x40,0x3d,0x45,0x3c,0x3b,0x46,0x3c,0x3a,0xff,0xff,0xff,0x2e,0x48,0xbd,0x3e,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x28,0xbd,0xb0,0xb5,0xb2,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,0xb3,0x49,0x44,0x41,0x54,0x18,0xd3,0x2d,0x8f,0xdb,0x16,0x82,0x20,0x10,0x45,0x11,0x19,0x12,0x91,0x54,0x44,0x93,0xb2,0x48,0xa1,0xfc,0xff,0x3f,0xec,0xa0,0xed,0xb7,0xd9,0x73,0xd6,0x5c,0x18,0x3,0x5,0x2f,0x1,0x2f,0xd8,0x49,0xc1,0x5,0x49,0x40,0xe2,0x54,0xc5,0x85,0x2a,0xa9,0x80,0xac,0x48,0x64,0xc3,0x89,0x64,0x7d,0x20,0x89,0x34,0x2,0x82,0x48,0x35,0xe6,0x7a,0x6d,0x1b,0x45,0x39,0xc2,0x3b,0x92,0x4d,0x6f,0x87,0xc1,0xf6,0x30,0x4e,0x33,0xed,0xb2,0x18,0xa7,0xdb,0x64,0x8d,0x24,0x37,0x33,0xed,0x9d,0xac,0xfb,0xf1,0xfe,0x18,0x97,0xa7,0x3a,0xc4,0xcb,0x51,0x16,0xf7,0xc9,0x42,0x78,0x88,0xf0,0x76,0xca,0xb4,0xcb,0x62,0xd,0x2,0x2b,0xc4,0x16,0x7c,0x5e,0x63,0x9e,0x35,0x75,0x6b,0xd4,0x58,0x9b,0x3e,0x98,0x8b,0xbb,0xd0,0x8f,0xa2,0x64,0x88,0xc4,0xb0,0x7a,0xe7,0x3a,0x1f,0x12,0x2,0xf9,0xb2,0x6f,0x8c,0x31,0x84,0x18,0xd3,0x26,0xf8,0xf1,0x8c,0x16,0xfb,0x9e,0xd2,0xbe,0xb,0x5d,0xfe,0xff,0xe5,0x7a,0x6,0x67,0xf9,0x3,0x92,0x36,0xd,0x2d,0xc1,0xf2,0x6d,0x3c,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 popup_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 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, 0xa5, 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, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3b, 0x3b, 0x43, 0x42, 0x42, 0x4b, 0x3e, 0x3e, 0x47, 0x3e, 0x3e, 0x46, 0x41, 0x41, 0x4a, 0x0, 0x0, 0x0, 0x3d, 0x3d, 0x45, 0x3b, 0x3b, 0x43, 0x3a, 0x3a, 0x42, 0x38, 0x38, 0x41, 0x37, 0x37, 0x3e, 0x36, 0x36, 0x3d, 0x35, 0x35, 0x3c, 0x0, 0x0, 0x0, 0x38, 0x38, 0x40, 0x38, 0x38, 0x40, 0x31, 0x31, 0x38, 0x34, 0x34, 0x3b, 0x34, 0x34, 0x3b, 0x39, 0x39, 0x3f, 0x31, 0x31, 0x38, 0x2f, 0x2f, 0x36, 0x2d, 0x2d, 0x33, 0x2c, 0x2c, 0x32, 0x2b, 0x2b, 0x31, 0x2a, 0x2a, 0x31, 0x2a, 0x2a, 0x30, 0x29, 0x29, 0x30, 0x29, 0x29, 0x2f, 0x28, 0x28, 0x2e, 0x28, 0x28, 0x2d, 0x27, 0x27, 0x2d, 0x27, 0x27, 0x2c, 0x29, 0x29, 0x2e, 0x26, 0x26, 0x2c, 0x35, 0x32, 0x3b, 0xf, 0xeb, 0x7f, 0x60, 0x0, 0x0, 0x0, 0x28, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x1, 0x3, 0x5, 0x8, 0xa, 0xb, 0x4, 0x13, 0x19, 0x1f, 0x22, 0x23, 0x16, 0x27, 0x35, 0x3f, 0x45, 0x46, 0x94, 0xf5, 0xfa, 0xfb, 0xf5, 0x40, 0xfc, 0xfb, 0xfb, 0xfb, 0xfb, 0xfc, 0xfc, 0x1a, 0xf5, 0xf6, 0x95, 0xfa, 0xfb, 0xf4, 0x94, 0x71, 0xda, 0xac, 0x92, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x36, 0x47, 0xbf, 0x88, 0xd1, 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, 0xaf, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x65, 0xcf, 0xc9, 0x12, 0x82, 0x30, 0x10, 0x4, 0xd0, 0x1, 0x12, 0xb6, 0x0, 0x21, 0x2c, 0xb2, 0xaa, 0xa0, 0xa8, 0x80, 0x88, 0x8, 0xf8, 0xff, 0xbf, 0x66, 0x98, 0x93, 0xa5, 0xef, 0xd8, 0x55, 0xd3, 0xd5, 0x3, 0xa0, 0xa8, 0x1a, 0xa1, 0xba, 0x44, 0x89, 0xa6, 0x2a, 0x0, 0x8a, 0x41, 0x4d, 0xcb, 0x66, 0x8e, 0xc3, 0x6c, 0xcb, 0xa4, 0x86, 0x2, 0x2a, 0x75, 0x3d, 0xee, 0x8b, 0x20, 0x10, 0x3e, 0xf7, 0x5c, 0xaa, 0x82, 0x66, 0x7a, 0x61, 0x14, 0xef, 0xa4, 0x38, 0xa, 0x3d, 0x53, 0x3, 0x62, 0xf1, 0xa4, 0xed, 0x50, 0x9b, 0x70, 0x8b, 0x0, 0xb5, 0xd3, 0xac, 0xeb, 0x51, 0x97, 0xa5, 0x36, 0x5, 0x9d, 0x89, 0xbc, 0xbf, 0xa3, 0x3e, 0x17, 0x4c, 0x7, 0xdd, 0x9, 0x8a, 0xe1, 0x81, 0x86, 0x22, 0x70, 0x30, 0x28, 0xc7, 0x27, 0x1a, 0x4b, 0xc, 0x98, 0xd8, 0x4f, 0x2f, 0x34, 0xed, 0xb7, 0x13, 0x59, 0x7a, 0x98, 0x17, 0x34, 0x1f, 0xb7, 0x52, 0x52, 0xf1, 0x7a, 0x5d, 0xde, 0xd2, 0xb2, 0x9e, 0x78, 0x45, 0xb6, 0x61, 0xe7, 0xba, 0xb9, 0x48, 0xcd, 0xf5, 0xb6, 0xd, 0xc3, 0xe9, 0xe9, 0xd7, 0xf4, 0xbf, 0xe7, 0x7e, 0xdf, 0xff, 0x0, 0xda, 0x19, 0x15, 0x34, 0xd5, 0xa4, 0x90, 0x50, 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 popup_checked_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x8,0x6,0x0,0x0,0x0,0xc4,0xf,0xbe,0x8b,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0xa3,0x49,0x44,0x41,0x54,0x18,0x95,0x85,0xcd,0xa1,0xa,0xc2,0x50,0x0,0x85,0xe1,0xff,0xdc,0x5d,0xd8,0x14,0x4,0xab,0x69,0x37,0xac,0x98,0xd5,0x27,0xb0,0x89,0x16,0x8b,0xd5,0xf7,0xd0,0xec,0x73,0xf8,0x4,0x16,0x61,0x4d,0x10,0xc,0x16,0xa3,0x61,0x71,0xab,0x16,0xeb,0x84,0x3b,0xae,0x45,0x8b,0xa,0x9e,0x78,0xce,0x7,0x7,0xfe,0x44,0xbf,0xca,0xa2,0x28,0x3a,0x71,0x1c,0x1f,0x24,0x3d,0xcc,0xe7,0x18,0x42,0x50,0x92,0x24,0x5b,0x49,0x23,0xa0,0xfd,0x5,0xaa,0xaa,0x5a,0x1,0x73,0xe0,0x1e,0x45,0xd1,0x42,0x65,0x59,0x9e,0x80,0x96,0xf7,0x7e,0x62,0xad,0x1d,0x2,0xfb,0x97,0x9d,0x39,0xe7,0x72,0x1b,0x42,0x88,0x25,0xd,0xac,0xb5,0x47,0xa0,0x7,0x18,0x60,0xed,0x9c,0xcb,0x1,0x4c,0xd3,0x34,0x53,0xe0,0xa,0xf4,0x81,0x2e,0xb0,0x4b,0xd3,0x74,0xf3,0xbe,0x34,0x59,0x96,0xdd,0xbc,0xf7,0x63,0xe0,0x2,0x9c,0xeb,0xba,0x5e,0x4a,0xa,0x6f,0xf0,0x4,0x57,0x3d,0x2c,0x27,0x2b,0xe9,0x62,0x6b,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char popup_bg_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, 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, 0x7b, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x0, 0xff, 0x67, 0x7a, 0x85, 0x66, 0x7a, 0x86, 0x68, 0x7b, 0x86, 0x57, 0x51, 0x51, 0x4c, 0x42, 0x40, 0x4d, 0x43, 0x41, 0x56, 0x4c, 0x4b, 0x4d, 0x44, 0x41, 0x4e, 0x44, 0x42, 0x4f, 0x45, 0x43, 0x67, 0x7b, 0x87, 0x4f, 0x44, 0x43, 0x50, 0x45, 0x44, 0x52, 0x46, 0x44, 0x51, 0x46, 0x45, 0x4b, 0x40, 0x3f, 0x51, 0x47, 0x45, 0x52, 0x48, 0x46, 0x53, 0x48, 0x47, 0x4b, 0x41, 0x3f, 0x54, 0x49, 0x46, 0x55, 0x4a, 0x47, 0x55, 0x49, 0x47, 0x68, 0x7c, 0x88, 0x4a, 0x40, 0x3e, 0x55, 0x4b, 0x49, 0x56, 0x4d, 0x4b, 0x53, 0x49, 0x47, 0x50, 0x46, 0x44, 0x4a, 0x41, 0x3e, 0x48, 0x3e, 0x3c, 0x4b, 0x42, 0x3f, 0x49, 0x3f, 0x3d, 0x46, 0x3d, 0x3c, 0x47, 0x3d, 0x3b, 0x47, 0x3e, 0x3b, 0x49, 0x40, 0x3d, 0x45, 0x3c, 0x3b, 0x46, 0x3c, 0x3a, 0xff, 0xff, 0xff, 0x2e, 0x48, 0xbd, 0x3e, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x28, 0xbd, 0xb0, 0xb5, 0xb2, 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, 0xb3, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x2d, 0x8f, 0xdb, 0x16, 0x82, 0x20, 0x10, 0x45, 0x11, 0x19, 0x12, 0x91, 0x54, 0x44, 0x93, 0xb2, 0x48, 0xa1, 0xfc, 0xff, 0x3f, 0xec, 0xa0, 0xed, 0xb7, 0xd9, 0x73, 0xd6, 0x5c, 0x18, 0x3, 0x5, 0x2f, 0x1, 0x2f, 0xd8, 0x49, 0xc1, 0x5, 0x49, 0x40, 0xe2, 0x54, 0xc5, 0x85, 0x2a, 0xa9, 0x80, 0xac, 0x48, 0x64, 0xc3, 0x89, 0x64, 0x7d, 0x20, 0x89, 0x34, 0x2, 0x82, 0x48, 0x35, 0xe6, 0x7a, 0x6d, 0x1b, 0x45, 0x39, 0xc2, 0x3b, 0x92, 0x4d, 0x6f, 0x87, 0xc1, 0xf6, 0x30, 0x4e, 0x33, 0xed, 0xb2, 0x18, 0xa7, 0xdb, 0x64, 0x8d, 0x24, 0x37, 0x33, 0xed, 0x9d, 0xac, 0xfb, 0xf1, 0xfe, 0x18, 0x97, 0xa7, 0x3a, 0xc4, 0xcb, 0x51, 0x16, 0xf7, 0xc9, 0x42, 0x78, 0x88, 0xf0, 0x76, 0xca, 0xb4, 0xcb, 0x62, 0xd, 0x2, 0x2b, 0xc4, 0x16, 0x7c, 0x5e, 0x63, 0x9e, 0x35, 0x75, 0x6b, 0xd4, 0x58, 0x9b, 0x3e, 0x98, 0x8b, 0xbb, 0xd0, 0x8f, 0xa2, 0x64, 0x88, 0xc4, 0xb0, 0x7a, 0xe7, 0x3a, 0x1f, 0x12, 0x2, 0xf9, 0xb2, 0x6f, 0x8c, 0x31, 0x84, 0x18, 0xd3, 0x26, 0xf8, 0xf1, 0x8c, 0x16, 0xfb, 0x9e, 0xd2, 0xbe, 0xb, 0x5d, 0xfe, 0xff, 0xe5, 0x7a, 0x6, 0x67, 0xf9, 0x3, 0x92, 0x36, 0xd, 0x2d, 0xc1, 0xf2, 0x6d, 0x3c, 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 popup_hover_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0x30,0x50,0x4c,0x54,0x45,0xff,0x0,0xff,0x20,0x2e,0x31,0x83,0xae,0xb7,0xb3,0xd8,0xe1,0xaf,0xd5,0xde,0xac,0xd2,0xdb,0xa9,0xcf,0xd8,0xa5,0xcc,0xd5,0xa2,0xc9,0xd2,0x9e,0xc6,0xcf,0x9b,0xc3,0xcc,0x97,0xc0,0xc9,0x94,0xbd,0xc6,0x91,0xba,0xc3,0x8d,0xb7,0xc0,0xff,0xff,0xff,0x73,0xd4,0x4e,0xcb,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xf,0x18,0xba,0x0,0xd9,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,0x4c,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x14,0x4,0x3,0x1,0x6,0x21,0x25,0x30,0x50,0x64,0x10,0x32,0x6,0x3,0x20,0xc3,0x5,0xc,0x80,0x8c,0x50,0x30,0x0,0x32,0xd2,0xc0,0x0,0xc8,0x28,0x7,0x3,0x20,0xa3,0x3,0xc,0x80,0x8c,0x99,0x60,0x0,0x64,0xac,0x2,0x3,0x20,0x63,0x37,0x18,0x0,0x19,0x67,0xc0,0x0,0xc8,0xb8,0xb,0x6,0x40,0xc6,0x3b,0x30,0x50,0x44,0x58,0xa,0x73,0x6,0x0,0xe9,0xb4,0x2d,0xf5,0x51,0xd4,0xb8,0xa1,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 popup_checked_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x8, 0x6, 0x0, 0x0, 0x0, 0xc4, 0xf, 0xbe, 0x8b, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0xa3, 0x49, 0x44, 0x41, 0x54, 0x18, 0x95, 0x85, 0xcd, 0xa1, 0xa, 0xc2, 0x50, 0x0, 0x85, 0xe1, 0xff, 0xdc, 0x5d, 0xd8, 0x14, 0x4, 0xab, 0x69, 0x37, 0xac, 0x98, 0xd5, 0x27, 0xb0, 0x89, 0x16, 0x8b, 0xd5, 0xf7, 0xd0, 0xec, 0x73, 0xf8, 0x4, 0x16, 0x61, 0x4d, 0x10, 0xc, 0x16, 0xa3, 0x61, 0x71, 0xab, 0x16, 0xeb, 0x84, 0x3b, 0xae, 0x45, 0x8b, 0xa, 0x9e, 0x78, 0xce, 0x7, 0x7, 0xfe, 0x44, 0xbf, 0xca, 0xa2, 0x28, 0x3a, 0x71, 0x1c, 0x1f, 0x24, 0x3d, 0xcc, 0xe7, 0x18, 0x42, 0x50, 0x92, 0x24, 0x5b, 0x49, 0x23, 0xa0, 0xfd, 0x5, 0xaa, 0xaa, 0x5a, 0x1, 0x73, 0xe0, 0x1e, 0x45, 0xd1, 0x42, 0x65, 0x59, 0x9e, 0x80, 0x96, 0xf7, 0x7e, 0x62, 0xad, 0x1d, 0x2, 0xfb, 0x97, 0x9d, 0x39, 0xe7, 0x72, 0x1b, 0x42, 0x88, 0x25, 0xd, 0xac, 0xb5, 0x47, 0xa0, 0x7, 0x18, 0x60, 0xed, 0x9c, 0xcb, 0x1, 0x4c, 0xd3, 0x34, 0x53, 0xe0, 0xa, 0xf4, 0x81, 0x2e, 0xb0, 0x4b, 0xd3, 0x74, 0xf3, 0xbe, 0x34, 0x59, 0x96, 0xdd, 0xbc, 0xf7, 0x63, 0xe0, 0x2, 0x9c, 0xeb, 0xba, 0x5e, 0x4a, 0xa, 0x6f, 0xf0, 0x4, 0x57, 0x3d, 0x2c, 0x27, 0x2b, 0xe9, 0x62, 0x6b, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char popup_unchecked_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x1,0x3,0x0,0x0,0x0,0xfe,0xc1,0x2c,0xc8,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,0x6,0x50,0x4c,0x54,0x45,0xff,0x0,0xff,0xff,0xff,0xff,0x9f,0x18,0x32,0xe0,0x0,0x0,0x0,0x1,0x74,0x52,0x4e,0x53,0x0,0x40,0xe6,0xd8,0x66,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x1,0xff,0x2,0x2d,0xde,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0xb,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x40,0x5,0x0,0x0,0x10,0x0,0x1,0xa1,0xc5,0x21,0xc1,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 popup_hover_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x0, 0xff, 0x20, 0x2e, 0x31, 0x83, 0xae, 0xb7, 0xb3, 0xd8, 0xe1, 0xaf, 0xd5, 0xde, 0xac, 0xd2, 0xdb, 0xa9, 0xcf, 0xd8, 0xa5, 0xcc, 0xd5, 0xa2, 0xc9, 0xd2, 0x9e, 0xc6, 0xcf, 0x9b, 0xc3, 0xcc, 0x97, 0xc0, 0xc9, 0x94, 0xbd, 0xc6, 0x91, 0xba, 0xc3, 0x8d, 0xb7, 0xc0, 0xff, 0xff, 0xff, 0x73, 0xd4, 0x4e, 0xcb, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xf, 0x18, 0xba, 0x0, 0xd9, 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, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x14, 0x4, 0x3, 0x1, 0x6, 0x21, 0x25, 0x30, 0x50, 0x64, 0x10, 0x32, 0x6, 0x3, 0x20, 0xc3, 0x5, 0xc, 0x80, 0x8c, 0x50, 0x30, 0x0, 0x32, 0xd2, 0xc0, 0x0, 0xc8, 0x28, 0x7, 0x3, 0x20, 0xa3, 0x3, 0xc, 0x80, 0x8c, 0x99, 0x60, 0x0, 0x64, 0xac, 0x2, 0x3, 0x20, 0x63, 0x37, 0x18, 0x0, 0x19, 0x67, 0xc0, 0x0, 0xc8, 0xb8, 0xb, 0x6, 0x40, 0xc6, 0x3b, 0x30, 0x50, 0x44, 0x58, 0xa, 0x73, 0x6, 0x0, 0xe9, 0xb4, 0x2d, 0xf5, 0x51, 0xd4, 0xb8, 0xa1, 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 popup_window_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x2a,0x0,0x0,0x0,0x46,0x8,0x3,0x0,0x0,0x0,0x8d,0x2b,0xf6,0x48,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,0x1,0x6e,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0xe8,0xe5,0xf1,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x1d,0x22,0x0,0x0,0x0,0x1a,0x19,0x1c,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x1e,0x23,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x1d,0x21,0x17,0x16,0x19,0x0,0x0,0x0,0x0,0x0,0x0,0x21,0x1f,0x24,0x1b,0x1a,0x1d,0x0,0x0,0x0,0x0,0x0,0x0,0x21,0x1f,0x24,0x1e,0x1c,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x22,0x20,0x25,0x20,0x1e,0x23,0x0,0x0,0x0,0x0,0x0,0x0,0x21,0x1f,0x24,0x0,0x0,0x0,0x21,0x1f,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x22,0x20,0x25,0x0,0x0,0x0,0x20,0x20,0x25,0x20,0x1d,0x25,0x20,0x1d,0x22,0x1d,0x1d,0x22,0x1d,0x1d,0x20,0x1d,0x1a,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x32,0x30,0x38,0xe8,0xe5,0xf1,0xe5,0xe2,0xeb,0xe3,0xe1,0xe8,0xe1,0xdf,0xe7,0xe0,0xde,0xe6,0xdf,0xdd,0xe5,0xde,0xdc,0xe4,0xdd,0xdb,0xe3,0xdc,0xda,0xe2,0xda,0xd8,0xe0,0xd9,0xd7,0xdf,0xd7,0xd6,0xdf,0xd6,0xd4,0xdd,0xd5,0xd3,0xdc,0xd4,0xd1,0xdb,0xd3,0xd0,0xda,0xd1,0xce,0xd8,0xd0,0xcd,0xd7,0xcf,0xcd,0xd7,0xe2,0xdf,0xeb,0x48,0x46,0x51,0x42,0x40,0x4b,0x40,0x3e,0x48,0x40,0x3d,0x48,0x48,0x45,0x50,0x42,0x3f,0x4a,0x3f,0x3d,0x48,0x47,0x44,0x50,0x41,0x3f,0x4a,0x3f,0x3d,0x47,0x41,0x3e,0x49,0x3f,0x3c,0x47,0x46,0x43,0x4f,0x3e,0x3c,0x46,0x40,0x3e,0x49,0x3d,0x3b,0x46,0x45,0x43,0x4e,0x3d,0x3b,0x45,0x44,0x42,0x4d,0x3d,0x3a,0x45,0x3e,0x3c,0x47,0x3c,0x3a,0x44,0x43,0x42,0x4c,0x43,0x40,0x4c,0x3e,0x3b,0x46,0x3b,0x39,0x43,0x43,0x3f,0x4c,0x43,0x3f,0x4b,0x3a,0x38,0x42,0x42,0x3e,0x4b,0x42,0x3e,0x49,0x3a,0x37,0x41,0x39,0x37,0x41,0x3f,0x3e,0x48,0x39,0x37,0x40,0x38,0x36,0x40,0x3e,0x3d,0x48,0x38,0x36,0x3f,0x3e,0x3d,0x47,0x3a,0x38,0x41,0x38,0x35,0x3f,0x37,0x35,0x3e,0x39,0x36,0x40,0x37,0x34,0x3e,0x3d,0x3a,0x46,0x36,0x34,0x3d,0x3d,0x3a,0x44,0x37,0x35,0x3f,0x35,0x33,0x3c,0x46,0x44,0x4f,0xff,0xff,0xff,0x7e,0xde,0x1d,0x81,0x0,0x0,0x0,0x33,0x74,0x52,0x4e,0x53,0x0,0xa2,0x3,0x9,0x17,0xc,0x20,0xf,0x2a,0x5e,0x12,0x30,0x68,0x46,0x20,0x4e,0xa2,0x7d,0x3a,0x4f,0xa4,0x7d,0x3f,0x25,0x60,0xc0,0xb8,0x57,0x1d,0xba,0x59,0xbd,0x5b,0x22,0xbf,0x5e,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xa1,0x9f,0x9e,0x52,0x92,0x15,0x44,0x7e,0xd8,0x5,0xc7,0xf4,0xac,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x79,0xa1,0xdc,0xd4,0xd0,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,0x1,0xe8,0x49,0x44,0x41,0x54,0x48,0xc7,0xd5,0xd6,0xd9,0x53,0xd3,0x60,0x14,0xc6,0xe1,0x92,0x5a,0xa3,0x44,0xa3,0xd6,0x85,0xa0,0xb1,0x5a,0xcb,0xda,0xbd,0x7c,0xb8,0xef,0x2b,0x69,0x21,0xd0,0xda,0x22,0x25,0xd,0x69,0x20,0x60,0x69,0x11,0x2a,0x22,0xcb,0x9f,0xef,0x78,0x97,0x7e,0xe7,0x3d,0x33,0x1d,0xbd,0x70,0xfc,0x5d,0x3f,0x77,0xe7,0xe2,0x3d,0x91,0xc8,0x7f,0xd8,0x88,0x60,0x1a,0x21,0x54,0xcc,0x3f,0x84,0xcd,0xb,0x4a,0x1f,0x31,0xfd,0x1d,0x7d,0xcc,0x4,0xe8,0x13,0x26,0x40,0x9f,0x32,0x1,0xfa,0x8c,0x9,0xd0,0xe7,0x4c,0x80,0xbe,0x60,0x2,0xf4,0x25,0x13,0xa0,0xaf,0x98,0x0,0x7d,0xcd,0x44,0xa8,0x22,0xde,0x30,0x49,0x54,0x89,0x9e,0x13,0x6f,0x99,0x64,0x1a,0x3b,0x2f,0xde,0x31,0x49,0x54,0xbd,0x70,0x51,0xbc,0x67,0x92,0xe8,0xa8,0x76,0x49,0x7c,0x60,0x12,0x97,0xf5,0x68,0x88,0xea,0x57,0xae,0x8a,0x8f,0x4c,0xe2,0x5a,0x7c,0x34,0x4c,0xaf,0xdf,0x10,0x9f,0x98,0xc4,0xcd,0x5b,0x21,0xaa,0x8c,0x19,0xe3,0xb,0x56,0x19,0x66,0x2d,0xdc,0xbe,0x63,0x2a,0x43,0xd2,0xbb,0x9,0x7d,0x58,0x7a,0xef,0x7e,0x72,0x58,0xfa,0x20,0x35,0x36,0x2c,0x1d,0x37,0x8,0xad,0xc0,0x0,0x5d,0x5c,0xb2,0x61,0x4b,0x8b,0x32,0x9d,0x58,0x5e,0xa9,0xc2,0x56,0x96,0x27,0x8,0xad,0x7d,0x86,0xd5,0x28,0xad,0xd7,0x1a,0xb0,0x5a,0x9d,0xd2,0x55,0x4c,0x57,0x1,0xad,0x7c,0x81,0x55,0x8,0x9d,0x5c,0xb3,0x9b,0x30,0x7b,0x6d,0x52,0xa2,0x53,0xeb,0x55,0x7,0x56,0x5d,0x9f,0x22,0xb4,0xe5,0xc2,0x5a,0x94,0x6e,0x34,0x30,0x6d,0x6c,0x10,0xea,0xb5,0x7d,0x58,0xdb,0x93,0xe9,0xf4,0x66,0x13,0xd3,0xe6,0xe6,0xb4,0x4c,0xb7,0x9c,0x0,0xe6,0x6c,0x11,0xba,0xed,0x62,0xea,0x6e,0x13,0xba,0xe3,0x7e,0x85,0xb9,0x3b,0x84,0x96,0xfd,0xe,0xcc,0x2f,0x13,0xba,0xeb,0x77,0x61,0xfe,0x2e,0xa1,0x76,0xd0,0x83,0x5,0x36,0xa1,0x7b,0xc1,0x37,0x58,0xb0,0x27,0xd3,0x99,0xfd,0x83,0x3e,0xec,0x60,0x7f,0x46,0xa2,0xb3,0xad,0xce,0x77,0x58,0xa7,0x35,0x2b,0xd3,0xf6,0x21,0xa6,0x87,0x6d,0x40,0x7f,0xc0,0x0,0x3d,0xea,0xfd,0x84,0xf5,0x8e,0x8,0x75,0xfa,0x98,0xf6,0x1d,0x42,0x8f,0x39,0x7a,0x4c,0xe9,0xc9,0x29,0xec,0x64,0x90,0x46,0x92,0xa9,0xb4,0x75,0xca,0x64,0xa5,0x53,0xc9,0xc8,0x1f,0xd2,0xc,0x4f,0x33,0x3,0x54,0x4f,0x64,0x79,0x9a,0x4d,0xe8,0x21,0x6a,0xe6,0xf2,0x1e,0x47,0xbd,0x7c,0xce,0xc,0xd1,0x42,0xb1,0x54,0xef,0x62,0xd9,0x3d,0x2b,0x15,0xb,0x21,0xaa,0x6a,0xc6,0xdc,0x99,0x67,0x81,0xbc,0xfa,0x9c,0xa1,0xa9,0x21,0x1a,0x35,0xe3,0x46,0x29,0x9f,0xcd,0xa4,0xa5,0x32,0xd9,0x7c,0xc9,0x88,0x9b,0xe1,0xe1,0x54,0x62,0xa6,0x56,0xcc,0x25,0x52,0xa4,0x44,0xae,0xa8,0x99,0xb1,0xd0,0x5,0x7e,0x3f,0x4,0x6a,0xc1,0xd4,0x93,0x24,0xdd,0x2c,0xa8,0xd1,0x1,0xf9,0xf,0xfb,0x5,0x66,0x6f,0x2a,0x9a,0xa8,0x51,0x81,0xce,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 popup_unchecked_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x1, 0x3, 0x0, 0x0, 0x0, 0xfe, 0xc1, 0x2c, 0xc8, 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, 0x6, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x0, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x18, 0x32, 0xe0, 0x0, 0x0, 0x0, 0x1, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x40, 0xe6, 0xd8, 0x66, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x1, 0xff, 0x2, 0x2d, 0xde, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0xb, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x40, 0x5, 0x0, 0x0, 0x10, 0x0, 0x1, 0xa1, 0xc5, 0x21, 0xc1, 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 progress_bar_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,0x33,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,0x2d,0x2c,0x2f,0x48,0x46,0x4a,0x4c,0x4a,0x4e,0x48,0x46,0x4a,0x40,0x3e,0x42,0x38,0x36,0x3a,0x27,0x27,0x27,0xe1,0x1d,0x66,0x4d,0x0,0x0,0x0,0xc,0x74,0x52,0x4e,0x53,0xa,0x1a,0x26,0x29,0x2a,0x48,0x65,0x6d,0x6e,0x66,0xf5,0xfe,0xb7,0x4a,0xbe,0x33,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x10,0x95,0xb2,0xd,0x2c,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,0x44,0x49,0x44,0x41,0x54,0x18,0xd3,0xc5,0xcf,0x31,0x16,0x0,0x10,0xc,0x44,0xc1,0x4d,0x84,0x4,0xc1,0xfd,0x6f,0xab,0xc9,0x53,0x70,0x0,0x53,0x6e,0xb5,0x1f,0x20,0x4e,0x12,0x12,0x13,0x40,0xb9,0xa8,0x5,0x2d,0x99,0xc0,0xb5,0x75,0xf,0xbd,0x55,0x86,0xe8,0x98,0x2b,0xcc,0xa1,0x2,0x31,0x5f,0x87,0xdb,0xbf,0xe1,0x3e,0xf6,0x5c,0x7f,0xe2,0xee,0xfc,0xd,0x60,0x3b,0xa,0x1d,0x9e,0x6a,0x29,0x33,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 popup_window_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x2a, 0x0, 0x0, 0x0, 0x46, 0x8, 0x3, 0x0, 0x0, 0x0, 0x8d, 0x2b, 0xf6, 0x48, 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, 0x1, 0x6e, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0xe8, 0xe5, 0xf1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f, 0x1d, 0x22, 0x0, 0x0, 0x0, 0x1a, 0x19, 0x1c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x1e, 0x23, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f, 0x1d, 0x21, 0x17, 0x16, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x21, 0x1f, 0x24, 0x1b, 0x1a, 0x1d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x21, 0x1f, 0x24, 0x1e, 0x1c, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22, 0x20, 0x25, 0x20, 0x1e, 0x23, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x21, 0x1f, 0x24, 0x0, 0x0, 0x0, 0x21, 0x1f, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22, 0x20, 0x25, 0x0, 0x0, 0x0, 0x20, 0x20, 0x25, 0x20, 0x1d, 0x25, 0x20, 0x1d, 0x22, 0x1d, 0x1d, 0x22, 0x1d, 0x1d, 0x20, 0x1d, 0x1a, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x32, 0x30, 0x38, 0xe8, 0xe5, 0xf1, 0xe5, 0xe2, 0xeb, 0xe3, 0xe1, 0xe8, 0xe1, 0xdf, 0xe7, 0xe0, 0xde, 0xe6, 0xdf, 0xdd, 0xe5, 0xde, 0xdc, 0xe4, 0xdd, 0xdb, 0xe3, 0xdc, 0xda, 0xe2, 0xda, 0xd8, 0xe0, 0xd9, 0xd7, 0xdf, 0xd7, 0xd6, 0xdf, 0xd6, 0xd4, 0xdd, 0xd5, 0xd3, 0xdc, 0xd4, 0xd1, 0xdb, 0xd3, 0xd0, 0xda, 0xd1, 0xce, 0xd8, 0xd0, 0xcd, 0xd7, 0xcf, 0xcd, 0xd7, 0xe2, 0xdf, 0xeb, 0x48, 0x46, 0x51, 0x42, 0x40, 0x4b, 0x40, 0x3e, 0x48, 0x40, 0x3d, 0x48, 0x48, 0x45, 0x50, 0x42, 0x3f, 0x4a, 0x3f, 0x3d, 0x48, 0x47, 0x44, 0x50, 0x41, 0x3f, 0x4a, 0x3f, 0x3d, 0x47, 0x41, 0x3e, 0x49, 0x3f, 0x3c, 0x47, 0x46, 0x43, 0x4f, 0x3e, 0x3c, 0x46, 0x40, 0x3e, 0x49, 0x3d, 0x3b, 0x46, 0x45, 0x43, 0x4e, 0x3d, 0x3b, 0x45, 0x44, 0x42, 0x4d, 0x3d, 0x3a, 0x45, 0x3e, 0x3c, 0x47, 0x3c, 0x3a, 0x44, 0x43, 0x42, 0x4c, 0x43, 0x40, 0x4c, 0x3e, 0x3b, 0x46, 0x3b, 0x39, 0x43, 0x43, 0x3f, 0x4c, 0x43, 0x3f, 0x4b, 0x3a, 0x38, 0x42, 0x42, 0x3e, 0x4b, 0x42, 0x3e, 0x49, 0x3a, 0x37, 0x41, 0x39, 0x37, 0x41, 0x3f, 0x3e, 0x48, 0x39, 0x37, 0x40, 0x38, 0x36, 0x40, 0x3e, 0x3d, 0x48, 0x38, 0x36, 0x3f, 0x3e, 0x3d, 0x47, 0x3a, 0x38, 0x41, 0x38, 0x35, 0x3f, 0x37, 0x35, 0x3e, 0x39, 0x36, 0x40, 0x37, 0x34, 0x3e, 0x3d, 0x3a, 0x46, 0x36, 0x34, 0x3d, 0x3d, 0x3a, 0x44, 0x37, 0x35, 0x3f, 0x35, 0x33, 0x3c, 0x46, 0x44, 0x4f, 0xff, 0xff, 0xff, 0x7e, 0xde, 0x1d, 0x81, 0x0, 0x0, 0x0, 0x33, 0x74, 0x52, 0x4e, 0x53, 0x0, 0xa2, 0x3, 0x9, 0x17, 0xc, 0x20, 0xf, 0x2a, 0x5e, 0x12, 0x30, 0x68, 0x46, 0x20, 0x4e, 0xa2, 0x7d, 0x3a, 0x4f, 0xa4, 0x7d, 0x3f, 0x25, 0x60, 0xc0, 0xb8, 0x57, 0x1d, 0xba, 0x59, 0xbd, 0x5b, 0x22, 0xbf, 0x5e, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xa1, 0x9f, 0x9e, 0x52, 0x92, 0x15, 0x44, 0x7e, 0xd8, 0x5, 0xc7, 0xf4, 0xac, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x79, 0xa1, 0xdc, 0xd4, 0xd0, 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, 0x1, 0xe8, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xd5, 0xd6, 0xd9, 0x53, 0xd3, 0x60, 0x14, 0xc6, 0xe1, 0x92, 0x5a, 0xa3, 0x44, 0xa3, 0xd6, 0x85, 0xa0, 0xb1, 0x5a, 0xcb, 0xda, 0xbd, 0x7c, 0xb8, 0xef, 0x2b, 0x69, 0x21, 0xd0, 0xda, 0x22, 0x25, 0xd, 0x69, 0x20, 0x60, 0x69, 0x11, 0x2a, 0x22, 0xcb, 0x9f, 0xef, 0x78, 0x97, 0x7e, 0xe7, 0x3d, 0x33, 0x1d, 0xbd, 0x70, 0xfc, 0x5d, 0x3f, 0x77, 0xe7, 0xe2, 0x3d, 0x91, 0xc8, 0x7f, 0xd8, 0x88, 0x60, 0x1a, 0x21, 0x54, 0xcc, 0x3f, 0x84, 0xcd, 0xb, 0x4a, 0x1f, 0x31, 0xfd, 0x1d, 0x7d, 0xcc, 0x4, 0xe8, 0x13, 0x26, 0x40, 0x9f, 0x32, 0x1, 0xfa, 0x8c, 0x9, 0xd0, 0xe7, 0x4c, 0x80, 0xbe, 0x60, 0x2, 0xf4, 0x25, 0x13, 0xa0, 0xaf, 0x98, 0x0, 0x7d, 0xcd, 0x44, 0xa8, 0x22, 0xde, 0x30, 0x49, 0x54, 0x89, 0x9e, 0x13, 0x6f, 0x99, 0x64, 0x1a, 0x3b, 0x2f, 0xde, 0x31, 0x49, 0x54, 0xbd, 0x70, 0x51, 0xbc, 0x67, 0x92, 0xe8, 0xa8, 0x76, 0x49, 0x7c, 0x60, 0x12, 0x97, 0xf5, 0x68, 0x88, 0xea, 0x57, 0xae, 0x8a, 0x8f, 0x4c, 0xe2, 0x5a, 0x7c, 0x34, 0x4c, 0xaf, 0xdf, 0x10, 0x9f, 0x98, 0xc4, 0xcd, 0x5b, 0x21, 0xaa, 0x8c, 0x19, 0xe3, 0xb, 0x56, 0x19, 0x66, 0x2d, 0xdc, 0xbe, 0x63, 0x2a, 0x43, 0xd2, 0xbb, 0x9, 0x7d, 0x58, 0x7a, 0xef, 0x7e, 0x72, 0x58, 0xfa, 0x20, 0x35, 0x36, 0x2c, 0x1d, 0x37, 0x8, 0xad, 0xc0, 0x0, 0x5d, 0x5c, 0xb2, 0x61, 0x4b, 0x8b, 0x32, 0x9d, 0x58, 0x5e, 0xa9, 0xc2, 0x56, 0x96, 0x27, 0x8, 0xad, 0x7d, 0x86, 0xd5, 0x28, 0xad, 0xd7, 0x1a, 0xb0, 0x5a, 0x9d, 0xd2, 0x55, 0x4c, 0x57, 0x1, 0xad, 0x7c, 0x81, 0x55, 0x8, 0x9d, 0x5c, 0xb3, 0x9b, 0x30, 0x7b, 0x6d, 0x52, 0xa2, 0x53, 0xeb, 0x55, 0x7, 0x56, 0x5d, 0x9f, 0x22, 0xb4, 0xe5, 0xc2, 0x5a, 0x94, 0x6e, 0x34, 0x30, 0x6d, 0x6c, 0x10, 0xea, 0xb5, 0x7d, 0x58, 0xdb, 0x93, 0xe9, 0xf4, 0x66, 0x13, 0xd3, 0xe6, 0xe6, 0xb4, 0x4c, 0xb7, 0x9c, 0x0, 0xe6, 0x6c, 0x11, 0xba, 0xed, 0x62, 0xea, 0x6e, 0x13, 0xba, 0xe3, 0x7e, 0x85, 0xb9, 0x3b, 0x84, 0x96, 0xfd, 0xe, 0xcc, 0x2f, 0x13, 0xba, 0xeb, 0x77, 0x61, 0xfe, 0x2e, 0xa1, 0x76, 0xd0, 0x83, 0x5, 0x36, 0xa1, 0x7b, 0xc1, 0x37, 0x58, 0xb0, 0x27, 0xd3, 0x99, 0xfd, 0x83, 0x3e, 0xec, 0x60, 0x7f, 0x46, 0xa2, 0xb3, 0xad, 0xce, 0x77, 0x58, 0xa7, 0x35, 0x2b, 0xd3, 0xf6, 0x21, 0xa6, 0x87, 0x6d, 0x40, 0x7f, 0xc0, 0x0, 0x3d, 0xea, 0xfd, 0x84, 0xf5, 0x8e, 0x8, 0x75, 0xfa, 0x98, 0xf6, 0x1d, 0x42, 0x8f, 0x39, 0x7a, 0x4c, 0xe9, 0xc9, 0x29, 0xec, 0x64, 0x90, 0x46, 0x92, 0xa9, 0xb4, 0x75, 0xca, 0x64, 0xa5, 0x53, 0xc9, 0xc8, 0x1f, 0xd2, 0xc, 0x4f, 0x33, 0x3, 0x54, 0x4f, 0x64, 0x79, 0x9a, 0x4d, 0xe8, 0x21, 0x6a, 0xe6, 0xf2, 0x1e, 0x47, 0xbd, 0x7c, 0xce, 0xc, 0xd1, 0x42, 0xb1, 0x54, 0xef, 0x62, 0xd9, 0x3d, 0x2b, 0x15, 0xb, 0x21, 0xaa, 0x6a, 0xc6, 0xdc, 0x99, 0x67, 0x81, 0xbc, 0xfa, 0x9c, 0xa1, 0xa9, 0x21, 0x1a, 0x35, 0xe3, 0x46, 0x29, 0x9f, 0xcd, 0xa4, 0xa5, 0x32, 0xd9, 0x7c, 0xc9, 0x88, 0x9b, 0xe1, 0xe1, 0x54, 0x62, 0xa6, 0x56, 0xcc, 0x25, 0x52, 0xa4, 0x44, 0xae, 0xa8, 0x99, 0xb1, 0xd0, 0x5, 0x7e, 0x3f, 0x4, 0x6a, 0xc1, 0xd4, 0x93, 0x24, 0xdd, 0x2c, 0xa8, 0xd1, 0x1, 0xf9, 0xf, 0xfb, 0x5, 0x66, 0x6f, 0x2a, 0x9a, 0xa8, 0x51, 0x81, 0xce, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 progress_fill_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,0x4,0x0,0x0,0x0,0xb5,0xfa,0x37,0xea,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,0x2,0x62,0x4b,0x47,0x44,0x0,0x26,0x78,0x80,0xa6,0xcf,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x60,0x49,0x44,0x41,0x54,0x28,0xcf,0x63,0x60,0x18,0x78,0xc0,0x8,0x63,0x38,0x58,0x7c,0xde,0xf8,0x45,0xc,0xc2,0xe6,0x79,0xc5,0xeb,0x7f,0xe0,0x4,0x9a,0x2,0xe3,0x97,0x1f,0xb9,0xff,0x70,0x43,0xd8,0x2c,0x5f,0xf9,0xbf,0x9e,0x15,0x87,0xb2,0x61,0xa,0xbe,0x88,0xfd,0x81,0x1b,0xfb,0x87,0xfb,0xb,0x37,0x8c,0xcd,0x44,0xc8,0xd,0x54,0x54,0xc0,0xf3,0x8a,0xe5,0x2b,0x8c,0xcd,0xf2,0x95,0xe7,0x15,0x86,0x2,0x5e,0x7f,0xfe,0xaf,0xec,0xc,0x10,0xc8,0xff,0x95,0xd7,0x9f,0xe6,0x1,0x4c,0x2,0x0,0x0,0x68,0x3f,0x16,0xd7,0xea,0x7c,0xdd,0x1a,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 progress_bar_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, 0x33, 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, 0x2d, 0x2c, 0x2f, 0x48, 0x46, 0x4a, 0x4c, 0x4a, 0x4e, 0x48, 0x46, 0x4a, 0x40, 0x3e, 0x42, 0x38, 0x36, 0x3a, 0x27, 0x27, 0x27, 0xe1, 0x1d, 0x66, 0x4d, 0x0, 0x0, 0x0, 0xc, 0x74, 0x52, 0x4e, 0x53, 0xa, 0x1a, 0x26, 0x29, 0x2a, 0x48, 0x65, 0x6d, 0x6e, 0x66, 0xf5, 0xfe, 0xb7, 0x4a, 0xbe, 0x33, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x10, 0x95, 0xb2, 0xd, 0x2c, 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, 0x44, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0xc5, 0xcf, 0x31, 0x16, 0x0, 0x10, 0xc, 0x44, 0xc1, 0x4d, 0x84, 0x4, 0xc1, 0xfd, 0x6f, 0xab, 0xc9, 0x53, 0x70, 0x0, 0x53, 0x6e, 0xb5, 0x1f, 0x20, 0x4e, 0x12, 0x12, 0x13, 0x40, 0xb9, 0xa8, 0x5, 0x2d, 0x99, 0xc0, 0xb5, 0x75, 0xf, 0xbd, 0x55, 0x86, 0xe8, 0x98, 0x2b, 0xcc, 0xa1, 0x2, 0x31, 0x5f, 0x87, 0xdb, 0xbf, 0xe1, 0x3e, 0xf6, 0x5c, 0x7f, 0xe2, 0xee, 0xfc, 0xd, 0x60, 0x3b, 0xa, 0x1d, 0x9e, 0x6a, 0x29, 0x33, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 radio_checked_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,0x45,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x4,0x3,0x4,0x9,0x9,0x9,0x6,0x6,0x6,0xa,0xa,0xb,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x7f,0x7f,0x82,0xd8,0xd8,0xd8,0xd9,0xd9,0xd9,0x47,0x47,0x48,0xd3,0xd3,0xd3,0xa2,0xa2,0xa2,0x79,0x79,0x79,0x73,0x73,0x73,0x1c,0x1c,0x1c,0x3,0x3,0x3,0x0,0x0,0x0,0xff,0xff,0xff,0xa,0x69,0x4,0xd4,0x0,0x0,0x0,0xb,0x74,0x52,0x4e,0x53,0x0,0x0,0x0,0x0,0x0,0x1b,0x88,0xd1,0xf7,0x64,0xf6,0x2,0xb3,0xed,0xd7,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x16,0x7c,0xd1,0xa8,0x19,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,0x69,0x49,0x44,0x41,0x54,0x18,0xd3,0x6d,0x8f,0xdb,0xe,0xc0,0x20,0x8,0x43,0xdd,0xc5,0x3b,0x9d,0xa8,0xec,0xff,0x7f,0x75,0x6a,0x96,0x2c,0x8b,0xf6,0xad,0x27,0x14,0x8a,0x52,0x2b,0x69,0x63,0x9d,0xb3,0x46,0xbf,0x76,0xf3,0x21,0x12,0x40,0x31,0xf8,0x7d,0x0,0x7f,0x35,0xdb,0x45,0x97,0x1f,0xf3,0x81,0x90,0x38,0x67,0x4e,0xa0,0xd0,0x53,0x26,0x22,0x95,0x2a,0x52,0x4b,0x42,0x34,0xd,0x58,0x2,0xd7,0xbb,0xa9,0x32,0xc8,0x36,0xe0,0x80,0x2c,0x1d,0x48,0x6,0xdc,0xa,0x4c,0x91,0x69,0xe9,0x74,0x76,0x2a,0xa6,0x8e,0xaf,0xfa,0xb9,0x7e,0xee,0xaf,0x7,0xb9,0xfb,0x8,0xe7,0x90,0x1c,0x65,0x49,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 progress_fill_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, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 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, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0x26, 0x78, 0x80, 0xa6, 0xcf, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x60, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x63, 0x60, 0x18, 0x78, 0xc0, 0x8, 0x63, 0x38, 0x58, 0x7c, 0xde, 0xf8, 0x45, 0xc, 0xc2, 0xe6, 0x79, 0xc5, 0xeb, 0x7f, 0xe0, 0x4, 0x9a, 0x2, 0xe3, 0x97, 0x1f, 0xb9, 0xff, 0x70, 0x43, 0xd8, 0x2c, 0x5f, 0xf9, 0xbf, 0x9e, 0x15, 0x87, 0xb2, 0x61, 0xa, 0xbe, 0x88, 0xfd, 0x81, 0x1b, 0xfb, 0x87, 0xfb, 0xb, 0x37, 0x8c, 0xcd, 0x44, 0xc8, 0xd, 0x54, 0x54, 0xc0, 0xf3, 0x8a, 0xe5, 0x2b, 0x8c, 0xcd, 0xf2, 0x95, 0xe7, 0x15, 0x86, 0x2, 0x5e, 0x7f, 0xfe, 0xaf, 0xec, 0xc, 0x10, 0xc8, 0xff, 0x95, 0xd7, 0x9f, 0xe6, 0x1, 0x4c, 0x2, 0x0, 0x0, 0x68, 0x3f, 0x16, 0xd7, 0xea, 0x7c, 0xdd, 0x1a, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 radio_unchecked_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0x2d,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x4,0x3,0x4,0x9,0x9,0x9,0x6,0x6,0x6,0xa,0xa,0xb,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x7f,0x7f,0x82,0xd9,0xd9,0xd9,0x47,0x47,0x48,0xff,0xff,0xff,0xbd,0x7d,0x89,0x66,0x0,0x0,0x0,0xb,0x74,0x52,0x4e,0x53,0x0,0x0,0x0,0x0,0x0,0x1b,0x88,0xd1,0xf7,0x64,0xf6,0x2,0xb3,0xed,0xd7,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xe,0x6f,0xbd,0x30,0x4f,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,0x4a,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x40,0x80,0xb0,0x8a,0xf6,0x54,0x10,0x2d,0xb9,0xfa,0xcc,0x99,0x5d,0x93,0x80,0x8c,0xb9,0x67,0x80,0xe0,0x26,0x3,0x3,0xeb,0x1a,0x10,0xe3,0x54,0x0,0x3,0xdb,0x1e,0x10,0xe3,0x74,0x2,0x3,0xfb,0x19,0x30,0x28,0x60,0xe0,0x80,0x30,0x1a,0x10,0xc,0xb8,0x14,0x5c,0x31,0x5c,0x3b,0xdc,0x40,0x6,0x4b,0x90,0x15,0x53,0x90,0x2d,0x85,0x2,0x0,0x37,0xca,0x3d,0x81,0xc4,0xfc,0x38,0x7b,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 radio_checked_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, 0x45, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x4, 0x3, 0x4, 0x9, 0x9, 0x9, 0x6, 0x6, 0x6, 0xa, 0xa, 0xb, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x7f, 0x7f, 0x82, 0xd8, 0xd8, 0xd8, 0xd9, 0xd9, 0xd9, 0x47, 0x47, 0x48, 0xd3, 0xd3, 0xd3, 0xa2, 0xa2, 0xa2, 0x79, 0x79, 0x79, 0x73, 0x73, 0x73, 0x1c, 0x1c, 0x1c, 0x3, 0x3, 0x3, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xa, 0x69, 0x4, 0xd4, 0x0, 0x0, 0x0, 0xb, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x88, 0xd1, 0xf7, 0x64, 0xf6, 0x2, 0xb3, 0xed, 0xd7, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x16, 0x7c, 0xd1, 0xa8, 0x19, 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, 0x69, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x6d, 0x8f, 0xdb, 0xe, 0xc0, 0x20, 0x8, 0x43, 0xdd, 0xc5, 0x3b, 0x9d, 0xa8, 0xec, 0xff, 0x7f, 0x75, 0x6a, 0x96, 0x2c, 0x8b, 0xf6, 0xad, 0x27, 0x14, 0x8a, 0x52, 0x2b, 0x69, 0x63, 0x9d, 0xb3, 0x46, 0xbf, 0x76, 0xf3, 0x21, 0x12, 0x40, 0x31, 0xf8, 0x7d, 0x0, 0x7f, 0x35, 0xdb, 0x45, 0x97, 0x1f, 0xf3, 0x81, 0x90, 0x38, 0x67, 0x4e, 0xa0, 0xd0, 0x53, 0x26, 0x22, 0x95, 0x2a, 0x52, 0x4b, 0x42, 0x34, 0xd, 0x58, 0x2, 0xd7, 0xbb, 0xa9, 0x32, 0xc8, 0x36, 0xe0, 0x80, 0x2c, 0x1d, 0x48, 0x6, 0xdc, 0xa, 0x4c, 0x91, 0x69, 0xe9, 0x74, 0x76, 0x2a, 0xa6, 0x8e, 0xaf, 0xfa, 0xb9, 0x7e, 0xee, 0xaf, 0x7, 0xb9, 0xfb, 0x8, 0xe7, 0x90, 0x1c, 0x65, 0x49, 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 reference_border_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0xf,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0xff,0xd1,0xd1,0xff,0xb7,0xb7,0xff,0x41,0x41,0xff,0xff,0xff,0xd5,0xfa,0x24,0x40,0x0,0x0,0x0,0x2,0x74,0x52,0x4e,0x53,0x0,0x0,0x76,0x93,0xcd,0x38,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x4,0x8f,0x68,0xd9,0x51,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,0x27,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x50,0x32,0x6,0x3,0x25,0x6,0x5,0x6,0x30,0x60,0x62,0x30,0x10,0x4,0x3,0x66,0x6,0x3,0x1,0x90,0x0,0x23,0x2d,0x18,0x30,0x2b,0xe0,0x96,0xc2,0x9c,0x1,0x0,0x5,0x29,0x7,0xb,0xf6,0x43,0xc2,0xd4,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 radio_unchecked_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0x2d, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x4, 0x3, 0x4, 0x9, 0x9, 0x9, 0x6, 0x6, 0x6, 0xa, 0xa, 0xb, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x7f, 0x7f, 0x82, 0xd9, 0xd9, 0xd9, 0x47, 0x47, 0x48, 0xff, 0xff, 0xff, 0xbd, 0x7d, 0x89, 0x66, 0x0, 0x0, 0x0, 0xb, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x88, 0xd1, 0xf7, 0x64, 0xf6, 0x2, 0xb3, 0xed, 0xd7, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xe, 0x6f, 0xbd, 0x30, 0x4f, 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, 0x4a, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x40, 0x80, 0xb0, 0x8a, 0xf6, 0x54, 0x10, 0x2d, 0xb9, 0xfa, 0xcc, 0x99, 0x5d, 0x93, 0x80, 0x8c, 0xb9, 0x67, 0x80, 0xe0, 0x26, 0x3, 0x3, 0xeb, 0x1a, 0x10, 0xe3, 0x54, 0x0, 0x3, 0xdb, 0x1e, 0x10, 0xe3, 0x74, 0x2, 0x3, 0xfb, 0x19, 0x30, 0x28, 0x60, 0xe0, 0x80, 0x30, 0x1a, 0x10, 0xc, 0xb8, 0x14, 0x5c, 0x31, 0x5c, 0x3b, 0xdc, 0x40, 0x6, 0x4b, 0x90, 0x15, 0x53, 0x90, 0x2d, 0x85, 0x2, 0x0, 0x37, 0xca, 0x3d, 0x81, 0xc4, 0xfc, 0x38, 0x7b, 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 scroll_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xc,0x0,0x0,0x0,0xc,0x8,0x3,0x0,0x0,0x0,0x61,0xab,0xac,0xd5,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,0x48,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x40,0x3e,0x4a,0x2a,0x29,0x2f,0x20,0x20,0x24,0x3f,0x3e,0x49,0x1f,0x1f,0x24,0x20,0x20,0x24,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x3f,0x3e,0x49,0x3f,0x3e,0x49,0x1e,0x1e,0x23,0x20,0x20,0x25,0x22,0x22,0x27,0x23,0x23,0x27,0x23,0x23,0x28,0x25,0x25,0x2a,0xff,0xff,0xff,0x34,0x3f,0xa6,0x65,0x0,0x0,0x0,0x11,0x74,0x52,0x4e,0x53,0x0,0x4,0x19,0x40,0x5d,0x66,0x28,0x93,0xf0,0xfc,0x94,0xfc,0xfd,0x67,0x1a,0x96,0x95,0x1c,0xf0,0x43,0x52,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x17,0xb,0xd6,0x98,0x8f,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,0x5c,0x49,0x44,0x41,0x54,0x8,0xd7,0x55,0x8e,0x49,0xe,0xc0,0x20,0xc,0x3,0x3,0x61,0x9,0x3b,0x61,0xfb,0xff,0x53,0x4b,0x5b,0x55,0x15,0x73,0x1b,0xc9,0xb2,0xd,0x20,0x24,0x2a,0xad,0x15,0x4a,0x1,0x20,0x8c,0x25,0xc7,0xec,0xc8,0x1a,0x1,0xd2,0x87,0xd6,0xc7,0xe8,0x2d,0x78,0x9,0x48,0x6d,0xae,0xcd,0x6c,0x84,0xa0,0x62,0x5f,0xf,0x3d,0x2a,0x48,0x3c,0x5e,0x19,0x9c,0x4e,0x39,0x62,0x47,0x41,0x2e,0x5f,0x75,0xc9,0x7b,0xb4,0x52,0x64,0x8e,0x54,0xcd,0x7d,0xe1,0xbf,0x73,0x1,0x30,0x2f,0x7,0x53,0x16,0x34,0xbd,0xfa,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 reference_border_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0xf, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0xff, 0xd1, 0xd1, 0xff, 0xb7, 0xb7, 0xff, 0x41, 0x41, 0xff, 0xff, 0xff, 0xd5, 0xfa, 0x24, 0x40, 0x0, 0x0, 0x0, 0x2, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x0, 0x76, 0x93, 0xcd, 0x38, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x4, 0x8f, 0x68, 0xd9, 0x51, 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, 0x27, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x50, 0x32, 0x6, 0x3, 0x25, 0x6, 0x5, 0x6, 0x30, 0x60, 0x62, 0x30, 0x10, 0x4, 0x3, 0x66, 0x6, 0x3, 0x1, 0x90, 0x0, 0x23, 0x2d, 0x18, 0x30, 0x2b, 0xe0, 0x96, 0xc2, 0x9c, 0x1, 0x0, 0x5, 0x29, 0x7, 0xb, 0xf6, 0x43, 0xc2, 0xd4, 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 scroll_button_down_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0x21,0x50,0x4c,0x54,0x45,0x2d,0x2c,0x2f,0x48,0x46,0x4a,0x2d,0x2c,0x2f,0x2d,0x2c,0x2f,0x2d,0x2c,0x2f,0x4c,0x4a,0x4e,0x48,0x46,0x4a,0x40,0x3e,0x42,0x38,0x36,0x3a,0xc3,0xc3,0xc3,0x59,0x59,0x59,0xb3,0x52,0xf2,0x5,0x0,0x0,0x0,0x5,0x74,0x52,0x4e,0x53,0x8,0xfe,0x9,0xd,0x19,0x4a,0xb6,0xc1,0xe6,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xa,0x68,0xd0,0xf4,0x56,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x33,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0xc,0x5,0x3,0x21,0x86,0xf4,0xe,0x30,0x28,0x63,0x88,0x80,0x30,0x5a,0xf1,0x33,0x66,0x2,0x1,0x2a,0xa3,0x73,0xe6,0xcc,0x19,0x10,0x35,0x40,0x1,0x8,0xa3,0x73,0x6,0x1,0x73,0xe0,0x96,0x1a,0x42,0x9c,0x21,0x2,0x0,0x5a,0xfa,0x3d,0xf9,0xfa,0xe2,0x64,0xe2,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 scroll_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0xc, 0x8, 0x3, 0x0, 0x0, 0x0, 0x61, 0xab, 0xac, 0xd5, 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, 0x48, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x40, 0x3e, 0x4a, 0x2a, 0x29, 0x2f, 0x20, 0x20, 0x24, 0x3f, 0x3e, 0x49, 0x1f, 0x1f, 0x24, 0x20, 0x20, 0x24, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x3f, 0x3e, 0x49, 0x3f, 0x3e, 0x49, 0x1e, 0x1e, 0x23, 0x20, 0x20, 0x25, 0x22, 0x22, 0x27, 0x23, 0x23, 0x27, 0x23, 0x23, 0x28, 0x25, 0x25, 0x2a, 0xff, 0xff, 0xff, 0x34, 0x3f, 0xa6, 0x65, 0x0, 0x0, 0x0, 0x11, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x4, 0x19, 0x40, 0x5d, 0x66, 0x28, 0x93, 0xf0, 0xfc, 0x94, 0xfc, 0xfd, 0x67, 0x1a, 0x96, 0x95, 0x1c, 0xf0, 0x43, 0x52, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x17, 0xb, 0xd6, 0x98, 0x8f, 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, 0x5c, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x55, 0x8e, 0x49, 0xe, 0xc0, 0x20, 0xc, 0x3, 0x3, 0x61, 0x9, 0x3b, 0x61, 0xfb, 0xff, 0x53, 0x4b, 0x5b, 0x55, 0x15, 0x73, 0x1b, 0xc9, 0xb2, 0xd, 0x20, 0x24, 0x2a, 0xad, 0x15, 0x4a, 0x1, 0x20, 0x8c, 0x25, 0xc7, 0xec, 0xc8, 0x1a, 0x1, 0xd2, 0x87, 0xd6, 0xc7, 0xe8, 0x2d, 0x78, 0x9, 0x48, 0x6d, 0xae, 0xcd, 0x6c, 0x84, 0xa0, 0x62, 0x5f, 0xf, 0x3d, 0x2a, 0x48, 0x3c, 0x5e, 0x19, 0x9c, 0x4e, 0x39, 0x62, 0x47, 0x41, 0x2e, 0x5f, 0x75, 0xc9, 0x7b, 0xb4, 0x52, 0x64, 0x8e, 0x54, 0xcd, 0x7d, 0xe1, 0xbf, 0x73, 0x1, 0x30, 0x2f, 0x7, 0x53, 0x16, 0x34, 0xbd, 0xfa, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 scroll_button_down_hl_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0x21,0x50,0x4c,0x54,0x45,0x3d,0x3b,0x3f,0x60,0x5d,0x62,0x3d,0x3b,0x3f,0x3d,0x3b,0x3f,0x3d,0x3b,0x3f,0x65,0x62,0x67,0x60,0x5d,0x62,0x56,0x53,0x58,0x4b,0x49,0x4e,0xce,0xce,0xce,0x59,0x59,0x59,0xb8,0xf5,0x6d,0x48,0x0,0x0,0x0,0x5,0x74,0x52,0x4e,0x53,0x7,0xfe,0xc,0x9,0x1c,0xda,0x2b,0xa5,0x57,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xa,0x68,0xd0,0xf4,0x56,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,0x33,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0xc,0x5,0x3,0x21,0x86,0xf4,0xe,0x30,0x28,0x63,0x88,0x80,0x30,0x5a,0xf1,0x33,0x66,0x2,0x1,0x2a,0xa3,0x73,0xe6,0xcc,0x19,0x10,0x35,0x40,0x1,0x8,0xa3,0x73,0x6,0x1,0x73,0xe0,0x96,0x1a,0x42,0x9c,0x21,0x2,0x0,0x5a,0xfa,0x3d,0xf9,0xfa,0xe2,0x64,0xe2,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 scroll_button_down_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0x21, 0x50, 0x4c, 0x54, 0x45, 0x2d, 0x2c, 0x2f, 0x48, 0x46, 0x4a, 0x2d, 0x2c, 0x2f, 0x2d, 0x2c, 0x2f, 0x2d, 0x2c, 0x2f, 0x4c, 0x4a, 0x4e, 0x48, 0x46, 0x4a, 0x40, 0x3e, 0x42, 0x38, 0x36, 0x3a, 0xc3, 0xc3, 0xc3, 0x59, 0x59, 0x59, 0xb3, 0x52, 0xf2, 0x5, 0x0, 0x0, 0x0, 0x5, 0x74, 0x52, 0x4e, 0x53, 0x8, 0xfe, 0x9, 0xd, 0x19, 0x4a, 0xb6, 0xc1, 0xe6, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xa, 0x68, 0xd0, 0xf4, 0x56, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x33, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0xc, 0x5, 0x3, 0x21, 0x86, 0xf4, 0xe, 0x30, 0x28, 0x63, 0x88, 0x80, 0x30, 0x5a, 0xf1, 0x33, 0x66, 0x2, 0x1, 0x2a, 0xa3, 0x73, 0xe6, 0xcc, 0x19, 0x10, 0x35, 0x40, 0x1, 0x8, 0xa3, 0x73, 0x6, 0x1, 0x73, 0xe0, 0x96, 0x1a, 0x42, 0x9c, 0x21, 0x2, 0x0, 0x5a, 0xfa, 0x3d, 0xf9, 0xfa, 0xe2, 0x64, 0xe2, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 scroll_button_left_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0x30,0x50,0x4c,0x54,0x45,0x2d,0x2c,0x2f,0x48,0x46,0x4a,0x2d,0x2c,0x2f,0x2d,0x2c,0x2f,0x2d,0x2c,0x2f,0x4c,0x4a,0x4e,0x48,0x46,0x4a,0x40,0x3e,0x42,0x38,0x36,0x3a,0xc3,0xc3,0xc3,0xc2,0xc2,0xc2,0xc1,0xc1,0xc1,0xc0,0xc0,0xc0,0xbf,0xbf,0xbf,0xbe,0xbe,0xbe,0x59,0x59,0x59,0x8e,0x47,0x76,0xf1,0x0,0x0,0x0,0x5,0x74,0x52,0x4e,0x53,0x8,0xfe,0x9,0xd,0x19,0x4a,0xb6,0xc1,0xe6,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xf,0x18,0xba,0x0,0xd9,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,0x3e,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0xc,0x5,0x3,0x21,0x86,0xf4,0xe,0x30,0x28,0x63,0x88,0x80,0x30,0x5a,0x51,0x19,0x33,0xa1,0x8c,0xae,0x55,0x50,0xc6,0x2e,0x28,0xa3,0x7b,0xf7,0x6e,0x8,0xa3,0xe7,0xcc,0x19,0xa8,0x14,0x9c,0xd1,0x7b,0x17,0xa6,0xfd,0x1d,0x86,0x81,0x60,0x6,0xdc,0x52,0x43,0x88,0x33,0x44,0x0,0xcc,0x4e,0x3f,0xd1,0x4,0x90,0xbf,0x60,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 scroll_button_down_hl_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0x21, 0x50, 0x4c, 0x54, 0x45, 0x3d, 0x3b, 0x3f, 0x60, 0x5d, 0x62, 0x3d, 0x3b, 0x3f, 0x3d, 0x3b, 0x3f, 0x3d, 0x3b, 0x3f, 0x65, 0x62, 0x67, 0x60, 0x5d, 0x62, 0x56, 0x53, 0x58, 0x4b, 0x49, 0x4e, 0xce, 0xce, 0xce, 0x59, 0x59, 0x59, 0xb8, 0xf5, 0x6d, 0x48, 0x0, 0x0, 0x0, 0x5, 0x74, 0x52, 0x4e, 0x53, 0x7, 0xfe, 0xc, 0x9, 0x1c, 0xda, 0x2b, 0xa5, 0x57, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xa, 0x68, 0xd0, 0xf4, 0x56, 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, 0x33, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0xc, 0x5, 0x3, 0x21, 0x86, 0xf4, 0xe, 0x30, 0x28, 0x63, 0x88, 0x80, 0x30, 0x5a, 0xf1, 0x33, 0x66, 0x2, 0x1, 0x2a, 0xa3, 0x73, 0xe6, 0xcc, 0x19, 0x10, 0x35, 0x40, 0x1, 0x8, 0xa3, 0x73, 0x6, 0x1, 0x73, 0xe0, 0x96, 0x1a, 0x42, 0x9c, 0x21, 0x2, 0x0, 0x5a, 0xfa, 0x3d, 0xf9, 0xfa, 0xe2, 0x64, 0xe2, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 scroll_button_left_hl_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,0x33,0x50,0x4c,0x54,0x45,0x3d,0x3b,0x3f,0x60,0x5d,0x62,0x3d,0x3b,0x3f,0x3d,0x3b,0x3f,0x3d,0x3b,0x3f,0x65,0x62,0x67,0x60,0x5d,0x62,0x56,0x53,0x58,0x4b,0x49,0x4e,0xc9,0xc9,0xc9,0xc8,0xc8,0xc8,0xc6,0xc6,0xc6,0xc7,0xc7,0xc7,0xc5,0xc5,0xc5,0xc4,0xc4,0xc4,0xc3,0xc3,0xc3,0x59,0x59,0x59,0x2a,0x13,0xff,0x12,0x0,0x0,0x0,0x5,0x74,0x52,0x4e,0x53,0x7,0xfe,0xc,0x9,0x1c,0xda,0x2b,0xa5,0x57,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x10,0x95,0xb2,0xd,0x2c,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,0x4c,0x49,0x44,0x41,0x54,0x18,0xd3,0x85,0xcf,0xcb,0xe,0x80,0x20,0xc,0x44,0xd1,0xa2,0x96,0x47,0x7,0xe4,0xff,0xff,0x16,0xdc,0x90,0xe,0xc6,0x78,0x97,0x27,0x69,0xd3,0x8a,0x4,0x75,0x85,0x43,0x62,0xca,0xae,0x14,0x45,0x33,0xa5,0xdf,0x50,0xa,0x83,0x99,0x11,0xa0,0xa2,0x7a,0x0,0xd0,0xe0,0xa1,0x3d,0xd1,0xc8,0x3d,0xe3,0xa5,0xbd,0x6f,0x30,0xe5,0xef,0xb0,0x5,0xaf,0xe7,0x4e,0x7e,0xff,0x1a,0xb,0x26,0x7,0xac,0xd9,0xa3,0x51,0xe3,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 scroll_button_left_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0x30, 0x50, 0x4c, 0x54, 0x45, 0x2d, 0x2c, 0x2f, 0x48, 0x46, 0x4a, 0x2d, 0x2c, 0x2f, 0x2d, 0x2c, 0x2f, 0x2d, 0x2c, 0x2f, 0x4c, 0x4a, 0x4e, 0x48, 0x46, 0x4a, 0x40, 0x3e, 0x42, 0x38, 0x36, 0x3a, 0xc3, 0xc3, 0xc3, 0xc2, 0xc2, 0xc2, 0xc1, 0xc1, 0xc1, 0xc0, 0xc0, 0xc0, 0xbf, 0xbf, 0xbf, 0xbe, 0xbe, 0xbe, 0x59, 0x59, 0x59, 0x8e, 0x47, 0x76, 0xf1, 0x0, 0x0, 0x0, 0x5, 0x74, 0x52, 0x4e, 0x53, 0x8, 0xfe, 0x9, 0xd, 0x19, 0x4a, 0xb6, 0xc1, 0xe6, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xf, 0x18, 0xba, 0x0, 0xd9, 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, 0x3e, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0xc, 0x5, 0x3, 0x21, 0x86, 0xf4, 0xe, 0x30, 0x28, 0x63, 0x88, 0x80, 0x30, 0x5a, 0x51, 0x19, 0x33, 0xa1, 0x8c, 0xae, 0x55, 0x50, 0xc6, 0x2e, 0x28, 0xa3, 0x7b, 0xf7, 0x6e, 0x8, 0xa3, 0xe7, 0xcc, 0x19, 0xa8, 0x14, 0x9c, 0xd1, 0x7b, 0x17, 0xa6, 0xfd, 0x1d, 0x86, 0x81, 0x60, 0x6, 0xdc, 0x52, 0x43, 0x88, 0x33, 0x44, 0x0, 0xcc, 0x4e, 0x3f, 0xd1, 0x4, 0x90, 0xbf, 0x60, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 scroll_button_right_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0x30,0x50,0x4c,0x54,0x45,0x2d,0x2c,0x2f,0x48,0x46,0x4a,0x2d,0x2c,0x2f,0x2d,0x2c,0x2f,0x2d,0x2c,0x2f,0x4c,0x4a,0x4e,0x48,0x46,0x4a,0x40,0x3e,0x42,0x38,0x36,0x3a,0xc3,0xc3,0xc3,0xc2,0xc2,0xc2,0xc1,0xc1,0xc1,0xc0,0xc0,0xc0,0xbf,0xbf,0xbf,0xbe,0xbe,0xbe,0x59,0x59,0x59,0x8e,0x47,0x76,0xf1,0x0,0x0,0x0,0x5,0x74,0x52,0x4e,0x53,0x8,0xfe,0x9,0xd,0x19,0x4a,0xb6,0xc1,0xe6,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xf,0x18,0xba,0x0,0xd9,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,0x40,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0xc,0x5,0x3,0x21,0x86,0xf4,0xe,0x30,0x28,0x63,0x88,0x80,0x30,0x5a,0x51,0x18,0x33,0x61,0x8c,0x59,0x2b,0xa0,0x8c,0x5d,0xab,0xa0,0x8c,0xdd,0xbb,0x77,0x40,0x18,0x67,0xce,0x9c,0x80,0x31,0xa0,0x52,0x77,0x6f,0x40,0x19,0xef,0x30,0xc,0x84,0x30,0xe0,0x96,0x1a,0x42,0x9c,0x21,0x2,0x0,0xfd,0x36,0x40,0x93,0xf1,0x83,0x5f,0xf2,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 scroll_button_left_hl_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, 0x33, 0x50, 0x4c, 0x54, 0x45, 0x3d, 0x3b, 0x3f, 0x60, 0x5d, 0x62, 0x3d, 0x3b, 0x3f, 0x3d, 0x3b, 0x3f, 0x3d, 0x3b, 0x3f, 0x65, 0x62, 0x67, 0x60, 0x5d, 0x62, 0x56, 0x53, 0x58, 0x4b, 0x49, 0x4e, 0xc9, 0xc9, 0xc9, 0xc8, 0xc8, 0xc8, 0xc6, 0xc6, 0xc6, 0xc7, 0xc7, 0xc7, 0xc5, 0xc5, 0xc5, 0xc4, 0xc4, 0xc4, 0xc3, 0xc3, 0xc3, 0x59, 0x59, 0x59, 0x2a, 0x13, 0xff, 0x12, 0x0, 0x0, 0x0, 0x5, 0x74, 0x52, 0x4e, 0x53, 0x7, 0xfe, 0xc, 0x9, 0x1c, 0xda, 0x2b, 0xa5, 0x57, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x10, 0x95, 0xb2, 0xd, 0x2c, 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, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x85, 0xcf, 0xcb, 0xe, 0x80, 0x20, 0xc, 0x44, 0xd1, 0xa2, 0x96, 0x47, 0x7, 0xe4, 0xff, 0xff, 0x16, 0xdc, 0x90, 0xe, 0xc6, 0x78, 0x97, 0x27, 0x69, 0xd3, 0x8a, 0x4, 0x75, 0x85, 0x43, 0x62, 0xca, 0xae, 0x14, 0x45, 0x33, 0xa5, 0xdf, 0x50, 0xa, 0x83, 0x99, 0x11, 0xa0, 0xa2, 0x7a, 0x0, 0xd0, 0xe0, 0xa1, 0x3d, 0xd1, 0xc8, 0x3d, 0xe3, 0xa5, 0xbd, 0x6f, 0x30, 0xe5, 0xef, 0xb0, 0x5, 0xaf, 0xe7, 0x4e, 0x7e, 0xff, 0x1a, 0xb, 0x26, 0x7, 0xac, 0xd9, 0xa3, 0x51, 0xe3, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 scroll_button_right_hl_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,0x36,0x50,0x4c,0x54,0x45,0x3d,0x3b,0x3f,0x60,0x5d,0x62,0x3d,0x3b,0x3f,0x3d,0x3b,0x3f,0x3d,0x3b,0x3f,0x65,0x62,0x67,0x60,0x5d,0x62,0x56,0x53,0x58,0x4b,0x49,0x4e,0xc9,0xc9,0xc9,0xc8,0xc8,0xc8,0xc6,0xc6,0xc6,0xc7,0xc7,0xc7,0xc5,0xc5,0xc5,0xc4,0xc4,0xc4,0xc3,0xc3,0xc3,0xc2,0xc2,0xc2,0x59,0x59,0x59,0x56,0xec,0x9e,0xdc,0x0,0x0,0x0,0x5,0x74,0x52,0x4e,0x53,0x7,0xfe,0xc,0x9,0x1c,0xda,0x2b,0xa5,0x57,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x11,0xe2,0xb5,0x3d,0xba,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x4c,0x49,0x44,0x41,0x54,0x18,0xd3,0x85,0xcf,0xcb,0xe,0x80,0x30,0x8,0x44,0x51,0xaa,0xd2,0x7,0xb4,0xd2,0xff,0xff,0xda,0xea,0x6e,0x46,0x63,0xbc,0xcb,0x93,0x40,0x40,0x24,0x29,0x94,0x36,0xc9,0xa5,0x42,0x25,0x8b,0x56,0x4a,0xbf,0xa0,0xb5,0x7,0x98,0x19,0x83,0x77,0xef,0xc,0x3e,0xdc,0x11,0xc6,0x1d,0xc2,0x79,0x45,0x23,0x11,0xc1,0x4b,0xe7,0xfc,0x3b,0xc,0xe0,0xf5,0xdc,0xce,0xef,0x1f,0xb,0xc,0x30,0x7,0xaf,0x1f,0x5b,0x76,0x12,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 scroll_button_right_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0x30, 0x50, 0x4c, 0x54, 0x45, 0x2d, 0x2c, 0x2f, 0x48, 0x46, 0x4a, 0x2d, 0x2c, 0x2f, 0x2d, 0x2c, 0x2f, 0x2d, 0x2c, 0x2f, 0x4c, 0x4a, 0x4e, 0x48, 0x46, 0x4a, 0x40, 0x3e, 0x42, 0x38, 0x36, 0x3a, 0xc3, 0xc3, 0xc3, 0xc2, 0xc2, 0xc2, 0xc1, 0xc1, 0xc1, 0xc0, 0xc0, 0xc0, 0xbf, 0xbf, 0xbf, 0xbe, 0xbe, 0xbe, 0x59, 0x59, 0x59, 0x8e, 0x47, 0x76, 0xf1, 0x0, 0x0, 0x0, 0x5, 0x74, 0x52, 0x4e, 0x53, 0x8, 0xfe, 0x9, 0xd, 0x19, 0x4a, 0xb6, 0xc1, 0xe6, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xf, 0x18, 0xba, 0x0, 0xd9, 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, 0x40, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0xc, 0x5, 0x3, 0x21, 0x86, 0xf4, 0xe, 0x30, 0x28, 0x63, 0x88, 0x80, 0x30, 0x5a, 0x51, 0x18, 0x33, 0x61, 0x8c, 0x59, 0x2b, 0xa0, 0x8c, 0x5d, 0xab, 0xa0, 0x8c, 0xdd, 0xbb, 0x77, 0x40, 0x18, 0x67, 0xce, 0x9c, 0x80, 0x31, 0xa0, 0x52, 0x77, 0x6f, 0x40, 0x19, 0xef, 0x30, 0xc, 0x84, 0x30, 0xe0, 0x96, 0x1a, 0x42, 0x9c, 0x21, 0x2, 0x0, 0xfd, 0x36, 0x40, 0x93, 0xf1, 0x83, 0x5f, 0xf2, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 scroll_button_up_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0x21,0x50,0x4c,0x54,0x45,0x2d,0x2c,0x2f,0x48,0x46,0x4a,0x2d,0x2c,0x2f,0x2d,0x2c,0x2f,0x2d,0x2c,0x2f,0x4c,0x4a,0x4e,0x48,0x46,0x4a,0x40,0x3e,0x42,0x38,0x36,0x3a,0xc3,0xc3,0xc3,0x59,0x59,0x59,0xb3,0x52,0xf2,0x5,0x0,0x0,0x0,0x5,0x74,0x52,0x4e,0x53,0x8,0xfe,0x9,0xd,0x19,0x4a,0xb6,0xc1,0xe6,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xa,0x68,0xd0,0xf4,0x56,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,0x36,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0xc,0x5,0x3,0x21,0x86,0xf4,0xe,0x30,0x28,0x63,0x88,0x80,0x30,0x5a,0xb1,0x33,0x3a,0x67,0x40,0x19,0x33,0x67,0x42,0x18,0x9d,0x33,0x67,0xce,0x0,0x33,0x66,0x2,0x1,0x2a,0x3,0x9f,0x39,0x10,0x6,0xdc,0x52,0x43,0x88,0x33,0x44,0x0,0x59,0xc8,0x3d,0xf9,0xf,0x68,0xc5,0xa9,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 scroll_button_right_hl_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, 0x36, 0x50, 0x4c, 0x54, 0x45, 0x3d, 0x3b, 0x3f, 0x60, 0x5d, 0x62, 0x3d, 0x3b, 0x3f, 0x3d, 0x3b, 0x3f, 0x3d, 0x3b, 0x3f, 0x65, 0x62, 0x67, 0x60, 0x5d, 0x62, 0x56, 0x53, 0x58, 0x4b, 0x49, 0x4e, 0xc9, 0xc9, 0xc9, 0xc8, 0xc8, 0xc8, 0xc6, 0xc6, 0xc6, 0xc7, 0xc7, 0xc7, 0xc5, 0xc5, 0xc5, 0xc4, 0xc4, 0xc4, 0xc3, 0xc3, 0xc3, 0xc2, 0xc2, 0xc2, 0x59, 0x59, 0x59, 0x56, 0xec, 0x9e, 0xdc, 0x0, 0x0, 0x0, 0x5, 0x74, 0x52, 0x4e, 0x53, 0x7, 0xfe, 0xc, 0x9, 0x1c, 0xda, 0x2b, 0xa5, 0x57, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x11, 0xe2, 0xb5, 0x3d, 0xba, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x85, 0xcf, 0xcb, 0xe, 0x80, 0x30, 0x8, 0x44, 0x51, 0xaa, 0xd2, 0x7, 0xb4, 0xd2, 0xff, 0xff, 0xda, 0xea, 0x6e, 0x46, 0x63, 0xbc, 0xcb, 0x93, 0x40, 0x40, 0x24, 0x29, 0x94, 0x36, 0xc9, 0xa5, 0x42, 0x25, 0x8b, 0x56, 0x4a, 0xbf, 0xa0, 0xb5, 0x7, 0x98, 0x19, 0x83, 0x77, 0xef, 0xc, 0x3e, 0xdc, 0x11, 0xc6, 0x1d, 0xc2, 0x79, 0x45, 0x23, 0x11, 0xc1, 0x4b, 0xe7, 0xfc, 0x3b, 0xc, 0xe0, 0xf5, 0xdc, 0xce, 0xef, 0x1f, 0xb, 0xc, 0x30, 0x7, 0xaf, 0x1f, 0x5b, 0x76, 0x12, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 scroll_button_up_hl_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0x21,0x50,0x4c,0x54,0x45,0x3d,0x3b,0x3f,0x60,0x5d,0x62,0x3d,0x3b,0x3f,0x3d,0x3b,0x3f,0x3d,0x3b,0x3f,0x65,0x62,0x67,0x60,0x5d,0x62,0x56,0x53,0x58,0x4b,0x49,0x4e,0xce,0xce,0xce,0x59,0x59,0x59,0xb8,0xf5,0x6d,0x48,0x0,0x0,0x0,0x5,0x74,0x52,0x4e,0x53,0x7,0xfe,0xc,0x9,0x1c,0xda,0x2b,0xa5,0x57,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xa,0x68,0xd0,0xf4,0x56,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,0x36,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0xc,0x5,0x3,0x21,0x86,0xf4,0xe,0x30,0x28,0x63,0x88,0x80,0x30,0x5a,0xb1,0x33,0x3a,0x67,0x40,0x19,0x33,0x67,0x42,0x18,0x9d,0x33,0x67,0xce,0x0,0x33,0x66,0x2,0x1,0x2a,0x3,0x9f,0x39,0x10,0x6,0xdc,0x52,0x43,0x88,0x33,0x44,0x0,0x59,0xc8,0x3d,0xf9,0xf,0x68,0xc5,0xa9,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 scroll_button_up_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0x21, 0x50, 0x4c, 0x54, 0x45, 0x2d, 0x2c, 0x2f, 0x48, 0x46, 0x4a, 0x2d, 0x2c, 0x2f, 0x2d, 0x2c, 0x2f, 0x2d, 0x2c, 0x2f, 0x4c, 0x4a, 0x4e, 0x48, 0x46, 0x4a, 0x40, 0x3e, 0x42, 0x38, 0x36, 0x3a, 0xc3, 0xc3, 0xc3, 0x59, 0x59, 0x59, 0xb3, 0x52, 0xf2, 0x5, 0x0, 0x0, 0x0, 0x5, 0x74, 0x52, 0x4e, 0x53, 0x8, 0xfe, 0x9, 0xd, 0x19, 0x4a, 0xb6, 0xc1, 0xe6, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xa, 0x68, 0xd0, 0xf4, 0x56, 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, 0x36, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0xc, 0x5, 0x3, 0x21, 0x86, 0xf4, 0xe, 0x30, 0x28, 0x63, 0x88, 0x80, 0x30, 0x5a, 0xb1, 0x33, 0x3a, 0x67, 0x40, 0x19, 0x33, 0x67, 0x42, 0x18, 0x9d, 0x33, 0x67, 0xce, 0x0, 0x33, 0x66, 0x2, 0x1, 0x2a, 0x3, 0x9f, 0x39, 0x10, 0x6, 0xdc, 0x52, 0x43, 0x88, 0x33, 0x44, 0x0, 0x59, 0xc8, 0x3d, 0xf9, 0xf, 0x68, 0xc5, 0xa9, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 scroll_grabber_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xc,0x0,0x0,0x0,0xc,0x8,0x3,0x0,0x0,0x0,0x61,0xab,0xac,0xd5,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,0x60,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x5b,0x59,0x61,0x5b,0x59,0x61,0x5a,0x58,0x60,0x59,0x57,0x5f,0x5a,0x58,0x60,0x5a,0x58,0x60,0x57,0x56,0x5e,0x58,0x56,0x5e,0x56,0x55,0x5d,0x57,0x55,0x5d,0x57,0x55,0x5d,0x55,0x53,0x5b,0x55,0x53,0x5b,0x54,0x53,0x5b,0x55,0x54,0x5c,0x54,0x52,0x5a,0x55,0x53,0x5b,0x5a,0x58,0x60,0x56,0x54,0x5c,0x54,0x53,0x5a,0x55,0x53,0x5b,0x53,0x51,0x59,0x52,0x51,0x59,0x52,0x50,0x58,0x51,0x50,0x58,0x51,0x4f,0x57,0x50,0x4e,0x56,0x4f,0x4d,0x55,0x50,0x4f,0x57,0x54,0x52,0x5a,0xff,0xff,0xff,0xc7,0x51,0xc2,0xf2,0x0,0x0,0x0,0x12,0x74,0x52,0x4e,0x53,0x0,0x2c,0xb8,0xf4,0x2e,0xf2,0xb8,0xf4,0xf5,0xf4,0xf5,0xb8,0x2f,0xf2,0x2e,0xb8,0xf4,0xb8,0x66,0xf6,0xf7,0x12,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x1f,0x5,0xd,0x10,0xbd,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,0x50,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0xc0,0x7,0x18,0x99,0x98,0x85,0x98,0x18,0x21,0x6c,0x16,0x56,0x61,0x11,0x11,0x61,0x56,0x16,0x30,0x87,0x4d,0x54,0xc,0x8,0x44,0xd9,0xc0,0x1c,0x76,0x71,0x9,0x20,0x10,0xe7,0x0,0x73,0x38,0x25,0xa5,0x80,0x40,0x92,0xb,0xcc,0xe1,0x96,0x90,0x6,0x2,0x9,0x6e,0x30,0x87,0x87,0x57,0x4a,0x46,0x46,0x96,0x97,0x7,0x62,0x1c,0x1f,0xbf,0x80,0x9c,0x20,0x1f,0x5e,0xdb,0x1,0x23,0xfd,0x4,0x11,0x2d,0x48,0xcb,0xd2,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 scroll_button_up_hl_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0x21, 0x50, 0x4c, 0x54, 0x45, 0x3d, 0x3b, 0x3f, 0x60, 0x5d, 0x62, 0x3d, 0x3b, 0x3f, 0x3d, 0x3b, 0x3f, 0x3d, 0x3b, 0x3f, 0x65, 0x62, 0x67, 0x60, 0x5d, 0x62, 0x56, 0x53, 0x58, 0x4b, 0x49, 0x4e, 0xce, 0xce, 0xce, 0x59, 0x59, 0x59, 0xb8, 0xf5, 0x6d, 0x48, 0x0, 0x0, 0x0, 0x5, 0x74, 0x52, 0x4e, 0x53, 0x7, 0xfe, 0xc, 0x9, 0x1c, 0xda, 0x2b, 0xa5, 0x57, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xa, 0x68, 0xd0, 0xf4, 0x56, 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, 0x36, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0xc, 0x5, 0x3, 0x21, 0x86, 0xf4, 0xe, 0x30, 0x28, 0x63, 0x88, 0x80, 0x30, 0x5a, 0xb1, 0x33, 0x3a, 0x67, 0x40, 0x19, 0x33, 0x67, 0x42, 0x18, 0x9d, 0x33, 0x67, 0xce, 0x0, 0x33, 0x66, 0x2, 0x1, 0x2a, 0x3, 0x9f, 0x39, 0x10, 0x6, 0xdc, 0x52, 0x43, 0x88, 0x33, 0x44, 0x0, 0x59, 0xc8, 0x3d, 0xf9, 0xf, 0x68, 0xc5, 0xa9, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 scroll_grabber_hl_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xc,0x0,0x0,0x0,0xc,0x8,0x3,0x0,0x0,0x0,0x61,0xab,0xac,0xd5,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,0x6c,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x97,0xd0,0xdf,0x92,0xcb,0xdc,0x84,0xbb,0xd4,0x92,0xca,0xdc,0x95,0xd0,0xdd,0x83,0xbb,0xd3,0x8b,0xc8,0xd7,0x79,0xb5,0xcb,0x78,0xb4,0xca,0x73,0xb0,0xc7,0x73,0xb0,0xc7,0x7b,0xc0,0xcf,0x79,0xc5,0xd1,0x6b,0xae,0xc1,0x75,0xc6,0xcf,0x70,0xbc,0xca,0x64,0xa6,0xbc,0x71,0xbc,0xc9,0x82,0xba,0xd4,0x6a,0xa2,0xc6,0x62,0x9a,0xc2,0x61,0x9a,0xc1,0x68,0x9f,0xc2,0x5d,0x92,0xbb,0x5c,0x92,0xb8,0x58,0x8d,0xb6,0x59,0x8e,0xb3,0x56,0x89,0xb0,0x5c,0x91,0xb2,0x53,0x84,0xa9,0x58,0x8f,0xae,0x54,0x83,0xa4,0x57,0x8e,0xad,0x64,0xa5,0xba,0xff,0xff,0xff,0xbb,0x65,0x65,0x27,0x0,0x0,0x0,0x13,0x74,0x52,0x4e,0x53,0x0,0x25,0xad,0xf1,0xad,0x27,0xef,0xad,0xf1,0xf3,0xf1,0xf3,0xad,0x28,0xef,0x27,0xad,0xf2,0xad,0xcd,0x8a,0x27,0xfe,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x23,0x2a,0x62,0x6c,0x3a,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,0x50,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0xc0,0x7,0x18,0x99,0x98,0x85,0x59,0x18,0x21,0x6c,0x56,0x36,0x11,0x51,0x31,0x11,0x36,0x56,0x30,0x87,0x5d,0x5c,0x2,0x8,0xc4,0xd9,0xc1,0x1c,0xe,0x49,0x29,0x20,0x90,0xe4,0x4,0x73,0xb8,0xa4,0x65,0x80,0x40,0x9a,0x1b,0xcc,0xe1,0x91,0x95,0x3,0x2,0x59,0x1e,0x30,0x87,0x97,0x4f,0x5e,0x41,0x41,0x91,0x8f,0x17,0x62,0x1c,0xbf,0x80,0xa0,0x92,0x10,0x3f,0x5e,0xdb,0x1,0x41,0x87,0x4,0x7d,0x15,0xc4,0xfd,0x6a,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 scroll_grabber_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0xc, 0x8, 0x3, 0x0, 0x0, 0x0, 0x61, 0xab, 0xac, 0xd5, 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, 0x60, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x5b, 0x59, 0x61, 0x5b, 0x59, 0x61, 0x5a, 0x58, 0x60, 0x59, 0x57, 0x5f, 0x5a, 0x58, 0x60, 0x5a, 0x58, 0x60, 0x57, 0x56, 0x5e, 0x58, 0x56, 0x5e, 0x56, 0x55, 0x5d, 0x57, 0x55, 0x5d, 0x57, 0x55, 0x5d, 0x55, 0x53, 0x5b, 0x55, 0x53, 0x5b, 0x54, 0x53, 0x5b, 0x55, 0x54, 0x5c, 0x54, 0x52, 0x5a, 0x55, 0x53, 0x5b, 0x5a, 0x58, 0x60, 0x56, 0x54, 0x5c, 0x54, 0x53, 0x5a, 0x55, 0x53, 0x5b, 0x53, 0x51, 0x59, 0x52, 0x51, 0x59, 0x52, 0x50, 0x58, 0x51, 0x50, 0x58, 0x51, 0x4f, 0x57, 0x50, 0x4e, 0x56, 0x4f, 0x4d, 0x55, 0x50, 0x4f, 0x57, 0x54, 0x52, 0x5a, 0xff, 0xff, 0xff, 0xc7, 0x51, 0xc2, 0xf2, 0x0, 0x0, 0x0, 0x12, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x2c, 0xb8, 0xf4, 0x2e, 0xf2, 0xb8, 0xf4, 0xf5, 0xf4, 0xf5, 0xb8, 0x2f, 0xf2, 0x2e, 0xb8, 0xf4, 0xb8, 0x66, 0xf6, 0xf7, 0x12, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x1f, 0x5, 0xd, 0x10, 0xbd, 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, 0x50, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0xc0, 0x7, 0x18, 0x99, 0x98, 0x85, 0x98, 0x18, 0x21, 0x6c, 0x16, 0x56, 0x61, 0x11, 0x11, 0x61, 0x56, 0x16, 0x30, 0x87, 0x4d, 0x54, 0xc, 0x8, 0x44, 0xd9, 0xc0, 0x1c, 0x76, 0x71, 0x9, 0x20, 0x10, 0xe7, 0x0, 0x73, 0x38, 0x25, 0xa5, 0x80, 0x40, 0x92, 0xb, 0xcc, 0xe1, 0x96, 0x90, 0x6, 0x2, 0x9, 0x6e, 0x30, 0x87, 0x87, 0x57, 0x4a, 0x46, 0x46, 0x96, 0x97, 0x7, 0x62, 0x1c, 0x1f, 0xbf, 0x80, 0x9c, 0x20, 0x1f, 0x5e, 0xdb, 0x1, 0x23, 0xfd, 0x4, 0x11, 0x2d, 0x48, 0xcb, 0xd2, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 selection_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0x2d,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,0xfd,0xfb,0xff,0xfd,0xf7,0xff,0xfd,0xf7,0xff,0xfd,0xf7,0xff,0xfd,0xf6,0xff,0xf6,0xf4,0xff,0x15,0x15,0x17,0xff,0x70,0xc0,0x21,0x0,0x0,0x0,0xe,0x74,0x52,0x4e,0x53,0x6,0xf,0x16,0x18,0x2a,0x3b,0x40,0x3c,0x6,0x3d,0x44,0x3e,0x31,0x25,0x8,0x3d,0x16,0xb4,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xe,0x6f,0xbd,0x30,0x4f,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,0x37,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x54,0x36,0x6,0x2,0x23,0x1,0x6,0x91,0xb0,0x34,0x20,0x48,0x75,0x64,0x50,0xef,0x5c,0x5,0x4,0x33,0x8a,0x18,0xcc,0xf6,0xdc,0x5,0x82,0xd3,0xc9,0xc,0x66,0x6b,0x41,0x8c,0x5b,0x94,0x33,0x60,0x6,0xc2,0xad,0x80,0x5b,0xa,0x73,0x6,0x0,0x45,0x34,0x48,0x41,0xa3,0xc5,0x91,0x23,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 scroll_grabber_hl_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0xc, 0x8, 0x3, 0x0, 0x0, 0x0, 0x61, 0xab, 0xac, 0xd5, 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, 0x6c, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x97, 0xd0, 0xdf, 0x92, 0xcb, 0xdc, 0x84, 0xbb, 0xd4, 0x92, 0xca, 0xdc, 0x95, 0xd0, 0xdd, 0x83, 0xbb, 0xd3, 0x8b, 0xc8, 0xd7, 0x79, 0xb5, 0xcb, 0x78, 0xb4, 0xca, 0x73, 0xb0, 0xc7, 0x73, 0xb0, 0xc7, 0x7b, 0xc0, 0xcf, 0x79, 0xc5, 0xd1, 0x6b, 0xae, 0xc1, 0x75, 0xc6, 0xcf, 0x70, 0xbc, 0xca, 0x64, 0xa6, 0xbc, 0x71, 0xbc, 0xc9, 0x82, 0xba, 0xd4, 0x6a, 0xa2, 0xc6, 0x62, 0x9a, 0xc2, 0x61, 0x9a, 0xc1, 0x68, 0x9f, 0xc2, 0x5d, 0x92, 0xbb, 0x5c, 0x92, 0xb8, 0x58, 0x8d, 0xb6, 0x59, 0x8e, 0xb3, 0x56, 0x89, 0xb0, 0x5c, 0x91, 0xb2, 0x53, 0x84, 0xa9, 0x58, 0x8f, 0xae, 0x54, 0x83, 0xa4, 0x57, 0x8e, 0xad, 0x64, 0xa5, 0xba, 0xff, 0xff, 0xff, 0xbb, 0x65, 0x65, 0x27, 0x0, 0x0, 0x0, 0x13, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x25, 0xad, 0xf1, 0xad, 0x27, 0xef, 0xad, 0xf1, 0xf3, 0xf1, 0xf3, 0xad, 0x28, 0xef, 0x27, 0xad, 0xf2, 0xad, 0xcd, 0x8a, 0x27, 0xfe, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x23, 0x2a, 0x62, 0x6c, 0x3a, 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, 0x50, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0xc0, 0x7, 0x18, 0x99, 0x98, 0x85, 0x59, 0x18, 0x21, 0x6c, 0x56, 0x36, 0x11, 0x51, 0x31, 0x11, 0x36, 0x56, 0x30, 0x87, 0x5d, 0x5c, 0x2, 0x8, 0xc4, 0xd9, 0xc1, 0x1c, 0xe, 0x49, 0x29, 0x20, 0x90, 0xe4, 0x4, 0x73, 0xb8, 0xa4, 0x65, 0x80, 0x40, 0x9a, 0x1b, 0xcc, 0xe1, 0x91, 0x95, 0x3, 0x2, 0x59, 0x1e, 0x30, 0x87, 0x97, 0x4f, 0x5e, 0x41, 0x41, 0x91, 0x8f, 0x17, 0x62, 0x1c, 0xbf, 0x80, 0xa0, 0x92, 0x10, 0x3f, 0x5e, 0xdb, 0x1, 0x41, 0x87, 0x4, 0x7d, 0x15, 0xc4, 0xfd, 0x6a, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 selection_oof_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,0x4,0x3,0x0,0x0,0x0,0xed,0xdd,0xe2,0x52,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,0x30,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,0x2c,0x2,0xfd,0xfb,0xff,0xfd,0xfb,0xff,0xfd,0xfb,0xff,0xfd,0xfb,0xff,0x15,0x15,0x17,0xe9,0x54,0x1,0x21,0x0,0x0,0x0,0xf,0x74,0x52,0x4e,0x53,0xa,0x1a,0x26,0x29,0x2a,0x48,0x65,0x6d,0x6e,0x66,0x3,0x20,0x25,0x16,0xc,0x1f,0x74,0xbf,0x74,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xf,0x18,0xba,0x0,0xd9,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,0x38,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x54,0x76,0x1,0x2,0x23,0x1,0x6,0xd1,0xf4,0xe,0x20,0x28,0xb,0x64,0xd0,0x5c,0x7d,0x6,0x8,0x76,0x4d,0x62,0x70,0xdf,0xfb,0xe,0x8,0x6e,0x97,0x30,0x78,0x9c,0x3,0x31,0xde,0xb4,0x50,0xca,0x80,0x1b,0x8,0xb7,0x2,0x6e,0x29,0xcc,0x19,0x0,0x1a,0x23,0x52,0x59,0xa4,0x2f,0x3d,0xa7,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 scroll_grabber_pressed_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0xc, 0x8, 0x6, 0x0, 0x0, 0x0, 0x56, 0x75, 0x5c, 0xe7, 0x0, 0x0, 0x0, 0x4, 0x73, 0x42, 0x49, 0x54, 0x8, 0x8, 0x8, 0x8, 0x7c, 0x8, 0x64, 0x88, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xd, 0xd7, 0x0, 0x0, 0xd, 0xd7, 0x1, 0x42, 0x28, 0x9b, 0x78, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x0, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63, 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x0, 0x0, 0x0, 0x66, 0x49, 0x44, 0x41, 0x54, 0x28, 0x91, 0xcd, 0x91, 0xb1, 0xa, 0xc0, 0x20, 0x10, 0x43, 0x63, 0x71, 0xbf, 0x5f, 0x12, 0x9c, 0xfd, 0x1a, 0x3f, 0xcd, 0xa9, 0x83, 0xe0, 0x2f, 0x65, 0x2f, 0x9c, 0x8b, 0x83, 0x47, 0xed, 0x60, 0xbb, 0x34, 0xdb, 0x3d, 0x12, 0x48, 0x38, 0xa7, 0xaa, 0xd8, 0xd1, 0xb1, 0xe5, 0x7e, 0x13, 0xf0, 0xf3, 0xd1, 0x5a, 0xf3, 0x24, 0x23, 0x80, 0x34, 0x50, 0x11, 0x91, 0x1a, 0x42, 0xb8, 0x96, 0x1, 0x92, 0x51, 0x55, 0xf3, 0x84, 0x32, 0x49, 0x0, 0x38, 0x9f, 0x2a, 0x25, 0xdc, 0x65, 0xd8, 0xe7, 0xd1, 0x65, 0xe1, 0x31, 0xcc, 0x6c, 0x10, 0x91, 0x3a, 0x3a, 0x9b, 0xd1, 0xb3, 0xc7, 0xfd, 0xef, 0x71, 0x1d, 0x42, 0xe6, 0x21, 0x43, 0xf5, 0x2b, 0xd8, 0x6c, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char spinbox_updown_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,0xcd,0x49,0x44,0x41,0x54,0x38,0x8d,0xe5,0x53,0x31,0xe,0x82,0x40,0x10,0x9c,0x5d,0x22,0x3e,0x80,0x86,0xc4,0x0,0xe1,0xf,0x16,0x5a,0x58,0xf9,0x5,0xe3,0x13,0xd0,0xc2,0xc4,0xcf,0xd8,0xf0,0x5,0xe3,0x1f,0x2c,0x2c,0x6c,0xf8,0x1,0xc5,0x72,0x85,0x9,0xd,0xf,0x10,0x43,0xce,0x86,0x82,0xe0,0xe9,0x19,0x8d,0x95,0x53,0xce,0xce,0x6e,0x26,0x99,0x59,0xe0,0x97,0x10,0x91,0x95,0x52,0x2a,0x79,0xa5,0xa1,0x67,0x83,0xa2,0x28,0xa6,0x0,0x8e,0x0,0x98,0x99,0xe7,0x61,0x18,0x9e,0xde,0x3e,0x20,0x22,0x3e,0x11,0x65,0x0,0x46,0x2d,0x55,0x3a,0x8e,0x33,0xe,0x82,0xe0,0xd2,0xd7,0x72,0x9f,0xc8,0xb2,0x6c,0x0,0x60,0xdf,0x59,0x6,0x0,0xbf,0x69,0x9a,0x43,0x9e,0xe7,0x43,0xeb,0x1,0xcf,0xf3,0x76,0x44,0x34,0x33,0x18,0x9b,0xb8,0xae,0x9b,0x9a,0x1c,0xff,0x3b,0x1e,0x62,0x14,0x91,0x94,0x88,0x8c,0xe5,0x21,0xa2,0x34,0x8a,0xa2,0x75,0x97,0x7b,0x48,0xa1,0xaa,0xaa,0x8d,0xd6,0xda,0x54,0x9a,0x73,0x5d,0xd7,0x5b,0xab,0x83,0xd6,0xc5,0xe7,0x45,0x2,0x80,0x38,0x8e,0x4b,0xad,0xf5,0x2,0xc0,0x15,0xc0,0x8d,0x99,0x97,0xa6,0x65,0x2b,0x94,0x52,0x89,0xed,0x99,0xbe,0xc6,0x1d,0x31,0x1f,0x40,0xdc,0x74,0x8a,0x5b,0xc1,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char selection_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0x2d, 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, 0xfd, 0xfb, 0xff, 0xfd, 0xf7, 0xff, 0xfd, 0xf7, 0xff, 0xfd, 0xf7, 0xff, 0xfd, 0xf6, 0xff, 0xf6, 0xf4, 0xff, 0x15, 0x15, 0x17, 0xff, 0x70, 0xc0, 0x21, 0x0, 0x0, 0x0, 0xe, 0x74, 0x52, 0x4e, 0x53, 0x6, 0xf, 0x16, 0x18, 0x2a, 0x3b, 0x40, 0x3c, 0x6, 0x3d, 0x44, 0x3e, 0x31, 0x25, 0x8, 0x3d, 0x16, 0xb4, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xe, 0x6f, 0xbd, 0x30, 0x4f, 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, 0x37, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x54, 0x36, 0x6, 0x2, 0x23, 0x1, 0x6, 0x91, 0xb0, 0x34, 0x20, 0x48, 0x75, 0x64, 0x50, 0xef, 0x5c, 0x5, 0x4, 0x33, 0x8a, 0x18, 0xcc, 0xf6, 0xdc, 0x5, 0x82, 0xd3, 0xc9, 0xc, 0x66, 0x6b, 0x41, 0x8c, 0x5b, 0x94, 0x33, 0x60, 0x6, 0xc2, 0xad, 0x80, 0x5b, 0xa, 0x73, 0x6, 0x0, 0x45, 0x34, 0x48, 0x41, 0xa3, 0xc5, 0x91, 0x23, 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 submenu_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x8,0x6,0x0,0x0,0x0,0xc4,0xf,0xbe,0x8b,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x64,0x49,0x44,0x41,0x54,0x18,0x95,0x7d,0xca,0x21,0x12,0x80,0x20,0x14,0x45,0xd1,0xf7,0x2d,0x4,0x36,0x40,0x63,0xa8,0xba,0x1f,0xbb,0x9d,0xe5,0xb8,0x0,0xb3,0xfb,0xd1,0xc,0x8d,0xd,0x10,0x48,0xcf,0x22,0x6,0xc7,0xef,0x6d,0x77,0xe6,0x8,0x0,0xa4,0x94,0x88,0x3b,0x92,0x4b,0x8,0x61,0xeb,0x3f,0xe0,0x95,0x88,0xac,0x39,0xe7,0x49,0x5,0x0,0x2c,0xc9,0xbd,0x94,0x62,0x35,0x0,0x0,0x63,0x6b,0x6d,0xfd,0x3,0x4f,0x1a,0x38,0x8d,0x31,0x51,0x3,0x55,0x44,0x66,0xe7,0x5c,0xfd,0x4,0x24,0xa3,0xf7,0xfe,0xe8,0x7f,0x1,0xe,0xc2,0x1e,0x10,0xa,0xf0,0x33,0x4c,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char selection_oof_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, 0x4, 0x3, 0x0, 0x0, 0x0, 0xed, 0xdd, 0xe2, 0x52, 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, 0x30, 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, 0x2c, 0x2, 0xfd, 0xfb, 0xff, 0xfd, 0xfb, 0xff, 0xfd, 0xfb, 0xff, 0xfd, 0xfb, 0xff, 0x15, 0x15, 0x17, 0xe9, 0x54, 0x1, 0x21, 0x0, 0x0, 0x0, 0xf, 0x74, 0x52, 0x4e, 0x53, 0xa, 0x1a, 0x26, 0x29, 0x2a, 0x48, 0x65, 0x6d, 0x6e, 0x66, 0x3, 0x20, 0x25, 0x16, 0xc, 0x1f, 0x74, 0xbf, 0x74, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xf, 0x18, 0xba, 0x0, 0xd9, 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, 0x38, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x54, 0x76, 0x1, 0x2, 0x23, 0x1, 0x6, 0xd1, 0xf4, 0xe, 0x20, 0x28, 0xb, 0x64, 0xd0, 0x5c, 0x7d, 0x6, 0x8, 0x76, 0x4d, 0x62, 0x70, 0xdf, 0xfb, 0xe, 0x8, 0x6e, 0x97, 0x30, 0x78, 0x9c, 0x3, 0x31, 0xde, 0xb4, 0x50, 0xca, 0x80, 0x1b, 0x8, 0xb7, 0x2, 0x6e, 0x29, 0xcc, 0x19, 0x0, 0x1a, 0x23, 0x52, 0x59, 0xa4, 0x2f, 0x3d, 0xa7, 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_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x8,0x4,0x0,0x0,0x0,0x6e,0x6,0x76,0x0,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,0x2,0x62,0x4b,0x47,0x44,0x0,0x0,0xaa,0x8d,0x23,0x32,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,0x1f,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0xc0,0x4,0xff,0x23,0xff,0x8b,0xfc,0x17,0xf9,0x1f,0x49,0xac,0x10,0x13,0x3,0x3,0x61,0x53,0xb0,0x98,0x80,0xc,0x0,0xa8,0x3e,0x18,0x31,0xbe,0x78,0xfc,0x7a,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 spinbox_updown_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, 0xcd, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xe5, 0x53, 0x31, 0xe, 0x82, 0x40, 0x10, 0x9c, 0x5d, 0x22, 0x3e, 0x80, 0x86, 0xc4, 0x0, 0xe1, 0xf, 0x16, 0x5a, 0x58, 0xf9, 0x5, 0xe3, 0x13, 0xd0, 0xc2, 0xc4, 0xcf, 0xd8, 0xf0, 0x5, 0xe3, 0x1f, 0x2c, 0x2c, 0x6c, 0xf8, 0x1, 0xc5, 0x72, 0x85, 0x9, 0xd, 0xf, 0x10, 0x43, 0xce, 0x86, 0x82, 0xe0, 0xe9, 0x19, 0x8d, 0x95, 0x53, 0xce, 0xce, 0x6e, 0x26, 0x99, 0x59, 0xe0, 0x97, 0x10, 0x91, 0x95, 0x52, 0x2a, 0x79, 0xa5, 0xa1, 0x67, 0x83, 0xa2, 0x28, 0xa6, 0x0, 0x8e, 0x0, 0x98, 0x99, 0xe7, 0x61, 0x18, 0x9e, 0xde, 0x3e, 0x20, 0x22, 0x3e, 0x11, 0x65, 0x0, 0x46, 0x2d, 0x55, 0x3a, 0x8e, 0x33, 0xe, 0x82, 0xe0, 0xd2, 0xd7, 0x72, 0x9f, 0xc8, 0xb2, 0x6c, 0x0, 0x60, 0xdf, 0x59, 0x6, 0x0, 0xbf, 0x69, 0x9a, 0x43, 0x9e, 0xe7, 0x43, 0xeb, 0x1, 0xcf, 0xf3, 0x76, 0x44, 0x34, 0x33, 0x18, 0x9b, 0xb8, 0xae, 0x9b, 0x9a, 0x1c, 0xff, 0x3b, 0x1e, 0x62, 0x14, 0x91, 0x94, 0x88, 0x8c, 0xe5, 0x21, 0xa2, 0x34, 0x8a, 0xa2, 0x75, 0x97, 0x7b, 0x48, 0xa1, 0xaa, 0xaa, 0x8d, 0xd6, 0xda, 0x54, 0x9a, 0x73, 0x5d, 0xd7, 0x5b, 0xab, 0x83, 0xd6, 0xc5, 0xe7, 0x45, 0x2, 0x80, 0x38, 0x8e, 0x4b, 0xad, 0xf5, 0x2, 0xc0, 0x15, 0xc0, 0x8d, 0x99, 0x97, 0xa6, 0x65, 0x2b, 0x94, 0x52, 0x89, 0xed, 0x99, 0xbe, 0xc6, 0x1d, 0x31, 0x1f, 0x40, 0xdc, 0x74, 0x8a, 0x5b, 0xc1, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char tab_behind_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,0x5a,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,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x30,0x2e,0x36,0x43,0x40,0x4d,0x0,0x0,0x0,0x43,0x40,0x4c,0x3e,0x3c,0x47,0x3e,0x3b,0x46,0x31,0x2f,0x38,0x2d,0x2b,0x33,0x3f,0x3c,0x47,0x35,0x32,0x3b,0x5b,0xb0,0x1,0xb7,0x0,0x0,0x0,0x18,0x74,0x52,0x4e,0x53,0x0,0x1,0x3,0x5,0x8,0xa,0xb,0xc,0x4,0x11,0x19,0x1f,0x22,0x24,0x15,0x25,0x34,0x3f,0x46,0x47,0x77,0xf3,0x7,0xef,0xd3,0x51,0x5e,0xca,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x1d,0xeb,0x3,0x71,0x91,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,0x6e,0x49,0x44,0x41,0x54,0x18,0xd3,0xb5,0xcc,0x49,0xe,0x80,0x20,0x10,0x44,0xd1,0x2,0x6c,0x90,0x49,0x26,0x27,0xd4,0xfb,0x9f,0x53,0x63,0x34,0x2e,0x58,0xfb,0x97,0x2f,0xa9,0x2,0x18,0x17,0x1d,0x49,0xa5,0x24,0x75,0x82,0x33,0x80,0xf5,0xa4,0x8d,0x75,0xde,0x3b,0x6b,0x34,0xf5,0xc,0x9c,0x86,0x10,0x53,0x2e,0x25,0xa7,0x18,0x6,0xe2,0x10,0x3a,0x8c,0xd3,0x5a,0xaf,0xd6,0x69,0xc,0x5a,0x60,0x36,0x71,0xd9,0xf6,0xbb,0x6d,0x89,0x66,0x6,0xd9,0x74,0xec,0x4f,0x47,0xb2,0x4,0xe9,0x72,0x7d,0xa1,0x66,0x27,0xa1,0x7c,0xf9,0xa0,0x78,0xd5,0x42,0x33,0x69,0x4e,0xff,0x80,0x13,0xce,0x8,0x12,0xa9,0x90,0xd8,0x47,0x93,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 submenu_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x8, 0x6, 0x0, 0x0, 0x0, 0xc4, 0xf, 0xbe, 0x8b, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0x64, 0x49, 0x44, 0x41, 0x54, 0x18, 0x95, 0x7d, 0xca, 0x21, 0x12, 0x80, 0x20, 0x14, 0x45, 0xd1, 0xf7, 0x2d, 0x4, 0x36, 0x40, 0x63, 0xa8, 0xba, 0x1f, 0xbb, 0x9d, 0xe5, 0xb8, 0x0, 0xb3, 0xfb, 0xd1, 0xc, 0x8d, 0xd, 0x10, 0x48, 0xcf, 0x22, 0x6, 0xc7, 0xef, 0x6d, 0x77, 0xe6, 0x8, 0x0, 0xa4, 0x94, 0x88, 0x3b, 0x92, 0x4b, 0x8, 0x61, 0xeb, 0x3f, 0xe0, 0x95, 0x88, 0xac, 0x39, 0xe7, 0x49, 0x5, 0x0, 0x2c, 0xc9, 0xbd, 0x94, 0x62, 0x35, 0x0, 0x0, 0x63, 0x6b, 0x6d, 0xfd, 0x3, 0x4f, 0x1a, 0x38, 0x8d, 0x31, 0x51, 0x3, 0x55, 0x44, 0x66, 0xe7, 0x5c, 0xfd, 0x4, 0x24, 0xa3, 0xf7, 0xfe, 0xe8, 0x7f, 0x1, 0xe, 0xc2, 0x1e, 0x10, 0xa, 0xf0, 0x33, 0x4c, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char tab_close_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0xfa,0x49,0x44,0x41,0x54,0x38,0x8d,0xcd,0x92,0x5f,0x4a,0xc4,0x30,0x10,0x87,0xbf,0xb1,0xb9,0xc2,0x16,0x7c,0x6b,0xc1,0xa2,0x85,0x7a,0x4,0x2d,0xfe,0x39,0xc4,0x9e,0x70,0x4f,0x61,0xc5,0x3d,0x83,0x5,0x95,0x4,0xd2,0x37,0x5,0x8f,0x90,0x94,0xf1,0xc5,0x4a,0x76,0xcd,0x22,0xf8,0xa2,0xf3,0x38,0xc3,0xef,0x9b,0xe4,0x4b,0xe0,0x5f,0x95,0xf7,0x7e,0xed,0x9c,0x2b,0xf,0xcd,0x9d,0x73,0xa5,0xf7,0x7e,0x9d,0xf6,0x8e,0xd2,0xb0,0x88,0x6c,0x8c,0x31,0x43,0xe,0xe2,0x9c,0x2b,0x8d,0x31,0x83,0x88,0x6c,0x52,0xc8,0x17,0x20,0xc6,0x38,0xa8,0xea,0x8,0x74,0xc6,0x98,0xed,0x34,0x4d,0xc7,0xcb,0xcc,0x5a,0xbb,0x2a,0x8a,0xe2,0xe,0xe8,0x80,0x17,0xe0,0x61,0x99,0x49,0xba,0xc5,0x5a,0xbb,0xfa,0xdc,0x72,0xe,0x3c,0x3,0xd7,0x21,0x84,0x98,0xf6,0x54,0xf5,0xaa,0xae,0xeb,0xb7,0x2c,0x60,0x1f,0x22,0x22,0x56,0x55,0x23,0xd0,0xe6,0xc2,0x59,0x40,0x2,0xd9,0x8a,0x48,0xbb,0x28,0x50,0xd5,0x8b,0xfd,0xf0,0x8e,0x83,0x9f,0x4a,0x44,0xb2,0xcb,0xbe,0x1,0x92,0x2b,0xb4,0xaa,0x6a,0x81,0x27,0xe0,0x4,0xb8,0x4f,0xc5,0x66,0x1,0x19,0x89,0x97,0x21,0x84,0x5e,0x55,0x1f,0x81,0xb3,0x1c,0x44,0xe,0x85,0x53,0x61,0xb9,0xd7,0xa9,0xaa,0xea,0x75,0xe7,0x4,0xc6,0x98,0x1b,0x11,0xe9,0x80,0x31,0xc6,0xd8,0xa7,0xc2,0x9a,0xa6,0x79,0x9f,0xe7,0xf9,0x16,0x18,0x81,0x53,0x55,0xed,0xb3,0xa2,0x7e,0xf3,0x95,0xff,0xbe,0x3e,0x0,0xbd,0x2c,0x93,0xec,0xb,0xe5,0x4f,0xb1,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char tab_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x8, 0x4, 0x0, 0x0, 0x0, 0x6e, 0x6, 0x76, 0x0, 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, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0x0, 0xaa, 0x8d, 0x23, 0x32, 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, 0x1f, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0xc0, 0x4, 0xff, 0x23, 0xff, 0x8b, 0xfc, 0x17, 0xf9, 0x1f, 0x49, 0xac, 0x10, 0x13, 0x3, 0x3, 0x61, 0x53, 0xb0, 0x98, 0x80, 0xc, 0x0, 0xa8, 0x3e, 0x18, 0x31, 0xbe, 0x78, 0xfc, 0x7a, 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_container_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,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,0x8a,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,0x3c,0x3a,0x44,0x56,0x53,0x61,0x56,0x52,0x60,0x47,0x44,0x52,0x33,0x31,0x39,0x47,0x44,0x50,0x47,0x44,0x51,0x52,0x50,0x5d,0x51,0x4f,0x5d,0x46,0x42,0x4e,0x42,0x3e,0x4a,0x41,0x3e,0x49,0x51,0x4e,0x5b,0x40,0x3e,0x48,0x4f,0x4c,0x59,0x3f,0x3d,0x47,0x4e,0x4a,0x58,0x3e,0x3b,0x46,0x4b,0x49,0x55,0x3c,0x3a,0x44,0x4a,0x47,0x54,0x3b,0x39,0x43,0x49,0x46,0x53,0x3a,0x38,0x42,0x47,0x45,0x50,0x39,0x37,0x40,0x47,0x43,0x50,0x38,0x35,0x3f,0x36,0x34,0x3e,0x44,0x42,0x4d,0x44,0x41,0x4c,0xff,0xff,0xff,0xe5,0x37,0x10,0x78,0x0,0x0,0x0,0x15,0x74,0x52,0x4e,0x53,0x4,0xa,0x11,0x19,0x1f,0x22,0x24,0x15,0x25,0x34,0x3f,0x46,0x47,0x48,0x77,0xef,0xef,0xef,0x77,0xef,0xed,0xe8,0xff,0x76,0xed,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x2d,0xcd,0xda,0x41,0x3d,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,0x93,0x49,0x44,0x41,0x54,0x18,0xd3,0x65,0xcf,0x47,0x12,0x82,0x40,0x10,0x5,0xd0,0x9e,0xc8,0x44,0x92,0x22,0x41,0x54,0x44,0x40,0x14,0xef,0x7f,0x3e,0x7,0x8a,0xea,0x85,0xbe,0xe5,0xaf,0xea,0xf0,0x1,0x8,0x65,0x5c,0xc8,0x40,0x70,0x46,0x9,0x0,0x89,0x94,0x36,0xd6,0x79,0xef,0xac,0xd1,0x2a,0x22,0x40,0x55,0x9c,0x14,0xa7,0x4d,0x91,0xc4,0x8a,0x2,0xd3,0x69,0x59,0xd5,0x9b,0xaa,0x4c,0x35,0x3,0x6e,0x9a,0xfa,0xbc,0xab,0x1b,0xc3,0x41,0xd8,0xf6,0x82,0x5a,0x2b,0x40,0xba,0xeb,0xd,0x5d,0x9d,0x4,0xe9,0xbb,0x3b,0xea,0xfc,0x1a,0xf4,0xf,0xd4,0xaf,0x81,0x1b,0x46,0x34,0x84,0x11,0x61,0xa7,0x27,0x9a,0xc2,0x52,0x6e,0xe6,0x17,0x9a,0xc3,0x59,0xa6,0xb3,0xf1,0xbd,0x1b,0xb3,0xf0,0x18,0x55,0xf9,0x61,0xf9,0x6c,0x96,0x63,0x1e,0x5e,0xff,0x2b,0xf7,0x5b,0xff,0xb,0x69,0x5a,0x14,0xfa,0x84,0xf6,0xc2,0x8,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_behind_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, 0x5a, 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, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30, 0x2e, 0x36, 0x43, 0x40, 0x4d, 0x0, 0x0, 0x0, 0x43, 0x40, 0x4c, 0x3e, 0x3c, 0x47, 0x3e, 0x3b, 0x46, 0x31, 0x2f, 0x38, 0x2d, 0x2b, 0x33, 0x3f, 0x3c, 0x47, 0x35, 0x32, 0x3b, 0x5b, 0xb0, 0x1, 0xb7, 0x0, 0x0, 0x0, 0x18, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x1, 0x3, 0x5, 0x8, 0xa, 0xb, 0xc, 0x4, 0x11, 0x19, 0x1f, 0x22, 0x24, 0x15, 0x25, 0x34, 0x3f, 0x46, 0x47, 0x77, 0xf3, 0x7, 0xef, 0xd3, 0x51, 0x5e, 0xca, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x1d, 0xeb, 0x3, 0x71, 0x91, 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, 0x6e, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0xb5, 0xcc, 0x49, 0xe, 0x80, 0x20, 0x10, 0x44, 0xd1, 0x2, 0x6c, 0x90, 0x49, 0x26, 0x27, 0xd4, 0xfb, 0x9f, 0x53, 0x63, 0x34, 0x2e, 0x58, 0xfb, 0x97, 0x2f, 0xa9, 0x2, 0x18, 0x17, 0x1d, 0x49, 0xa5, 0x24, 0x75, 0x82, 0x33, 0x80, 0xf5, 0xa4, 0x8d, 0x75, 0xde, 0x3b, 0x6b, 0x34, 0xf5, 0xc, 0x9c, 0x86, 0x10, 0x53, 0x2e, 0x25, 0xa7, 0x18, 0x6, 0xe2, 0x10, 0x3a, 0x8c, 0xd3, 0x5a, 0xaf, 0xd6, 0x69, 0xc, 0x5a, 0x60, 0x36, 0x71, 0xd9, 0xf6, 0xbb, 0x6d, 0x89, 0x66, 0x6, 0xd9, 0x74, 0xec, 0x4f, 0x47, 0xb2, 0x4, 0xe9, 0x72, 0x7d, 0xa1, 0x66, 0x27, 0xa1, 0x7c, 0xf9, 0xa0, 0x78, 0xd5, 0x42, 0x33, 0x69, 0x4e, 0xff, 0x80, 0x13, 0xce, 0x8, 0x12, 0xa9, 0x90, 0xd8, 0x47, 0x93, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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_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_close_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x6, 0x0, 0x0, 0x0, 0x1f, 0xf3, 0xff, 0x61, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0xfa, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xcd, 0x92, 0x5f, 0x4a, 0xc4, 0x30, 0x10, 0x87, 0xbf, 0xb1, 0xb9, 0xc2, 0x16, 0x7c, 0x6b, 0xc1, 0xa2, 0x85, 0x7a, 0x4, 0x2d, 0xfe, 0x39, 0xc4, 0x9e, 0x70, 0x4f, 0x61, 0xc5, 0x3d, 0x83, 0x5, 0x95, 0x4, 0xd2, 0x37, 0x5, 0x8f, 0x90, 0x94, 0xf1, 0xc5, 0x4a, 0x76, 0xcd, 0x22, 0xf8, 0xa2, 0xf3, 0x38, 0xc3, 0xef, 0x9b, 0xe4, 0x4b, 0xe0, 0x5f, 0x95, 0xf7, 0x7e, 0xed, 0x9c, 0x2b, 0xf, 0xcd, 0x9d, 0x73, 0xa5, 0xf7, 0x7e, 0x9d, 0xf6, 0x8e, 0xd2, 0xb0, 0x88, 0x6c, 0x8c, 0x31, 0x43, 0xe, 0xe2, 0x9c, 0x2b, 0x8d, 0x31, 0x83, 0x88, 0x6c, 0x52, 0xc8, 0x17, 0x20, 0xc6, 0x38, 0xa8, 0xea, 0x8, 0x74, 0xc6, 0x98, 0xed, 0x34, 0x4d, 0xc7, 0xcb, 0xcc, 0x5a, 0xbb, 0x2a, 0x8a, 0xe2, 0xe, 0xe8, 0x80, 0x17, 0xe0, 0x61, 0x99, 0x49, 0xba, 0xc5, 0x5a, 0xbb, 0xfa, 0xdc, 0x72, 0xe, 0x3c, 0x3, 0xd7, 0x21, 0x84, 0x98, 0xf6, 0x54, 0xf5, 0xaa, 0xae, 0xeb, 0xb7, 0x2c, 0x60, 0x1f, 0x22, 0x22, 0x56, 0x55, 0x23, 0xd0, 0xe6, 0xc2, 0x59, 0x40, 0x2, 0xd9, 0x8a, 0x48, 0xbb, 0x28, 0x50, 0xd5, 0x8b, 0xfd, 0xf0, 0x8e, 0x83, 0x9f, 0x4a, 0x44, 0xb2, 0xcb, 0xbe, 0x1, 0x92, 0x2b, 0xb4, 0xaa, 0x6a, 0x81, 0x27, 0xe0, 0x4, 0xb8, 0x4f, 0xc5, 0x66, 0x1, 0x19, 0x89, 0x97, 0x21, 0x84, 0x5e, 0x55, 0x1f, 0x81, 0xb3, 0x1c, 0x44, 0xe, 0x85, 0x53, 0x61, 0xb9, 0xd7, 0xa9, 0xaa, 0xea, 0x75, 0xe7, 0x4, 0xc6, 0x98, 0x1b, 0x11, 0xe9, 0x80, 0x31, 0xc6, 0xd8, 0xa7, 0xc2, 0x9a, 0xa6, 0x79, 0x9f, 0xe7, 0xf9, 0x16, 0x18, 0x81, 0x53, 0x55, 0xed, 0xb3, 0xa2, 0x7e, 0xf3, 0x95, 0xff, 0xbe, 0x3e, 0x0, 0xbd, 0x2c, 0x93, 0xec, 0xb, 0xe5, 0x4f, 0xb1, 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_container_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 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, 0x8a, 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, 0x3c, 0x3a, 0x44, 0x56, 0x53, 0x61, 0x56, 0x52, 0x60, 0x47, 0x44, 0x52, 0x33, 0x31, 0x39, 0x47, 0x44, 0x50, 0x47, 0x44, 0x51, 0x52, 0x50, 0x5d, 0x51, 0x4f, 0x5d, 0x46, 0x42, 0x4e, 0x42, 0x3e, 0x4a, 0x41, 0x3e, 0x49, 0x51, 0x4e, 0x5b, 0x40, 0x3e, 0x48, 0x4f, 0x4c, 0x59, 0x3f, 0x3d, 0x47, 0x4e, 0x4a, 0x58, 0x3e, 0x3b, 0x46, 0x4b, 0x49, 0x55, 0x3c, 0x3a, 0x44, 0x4a, 0x47, 0x54, 0x3b, 0x39, 0x43, 0x49, 0x46, 0x53, 0x3a, 0x38, 0x42, 0x47, 0x45, 0x50, 0x39, 0x37, 0x40, 0x47, 0x43, 0x50, 0x38, 0x35, 0x3f, 0x36, 0x34, 0x3e, 0x44, 0x42, 0x4d, 0x44, 0x41, 0x4c, 0xff, 0xff, 0xff, 0xe5, 0x37, 0x10, 0x78, 0x0, 0x0, 0x0, 0x15, 0x74, 0x52, 0x4e, 0x53, 0x4, 0xa, 0x11, 0x19, 0x1f, 0x22, 0x24, 0x15, 0x25, 0x34, 0x3f, 0x46, 0x47, 0x48, 0x77, 0xef, 0xef, 0xef, 0x77, 0xef, 0xed, 0xe8, 0xff, 0x76, 0xed, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x2d, 0xcd, 0xda, 0x41, 0x3d, 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, 0x93, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x65, 0xcf, 0x47, 0x12, 0x82, 0x40, 0x10, 0x5, 0xd0, 0x9e, 0xc8, 0x44, 0x92, 0x22, 0x41, 0x54, 0x44, 0x40, 0x14, 0xef, 0x7f, 0x3e, 0x7, 0x8a, 0xea, 0x85, 0xbe, 0xe5, 0xaf, 0xea, 0xf0, 0x1, 0x8, 0x65, 0x5c, 0xc8, 0x40, 0x70, 0x46, 0x9, 0x0, 0x89, 0x94, 0x36, 0xd6, 0x79, 0xef, 0xac, 0xd1, 0x2a, 0x22, 0x40, 0x55, 0x9c, 0x14, 0xa7, 0x4d, 0x91, 0xc4, 0x8a, 0x2, 0xd3, 0x69, 0x59, 0xd5, 0x9b, 0xaa, 0x4c, 0x35, 0x3, 0x6e, 0x9a, 0xfa, 0xbc, 0xab, 0x1b, 0xc3, 0x41, 0xd8, 0xf6, 0x82, 0x5a, 0x2b, 0x40, 0xba, 0xeb, 0xd, 0x5d, 0x9d, 0x4, 0xe9, 0xbb, 0x3b, 0xea, 0xfc, 0x1a, 0xf4, 0xf, 0xd4, 0xaf, 0x81, 0x1b, 0x46, 0x34, 0x84, 0x11, 0x61, 0xa7, 0x27, 0x9a, 0xc2, 0x52, 0x6e, 0xe6, 0x17, 0x9a, 0xc3, 0x59, 0xa6, 0xb3, 0xf1, 0xbd, 0x1b, 0xb3, 0xf0, 0x18, 0x55, 0xf9, 0x61, 0xf9, 0x6c, 0x96, 0x63, 0x1e, 0x5e, 0xff, 0x2b, 0xf7, 0x5b, 0xff, 0xb, 0x69, 0x5a, 0x14, 0xfa, 0x84, 0xf6, 0xc2, 0x8, 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_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
+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_menu_hl_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
+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
};
-
-static const unsigned char toggle_off_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x20,0x8,0x3,0x0,0x0,0x0,0x95,0x43,0x8e,0xb6,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,0x1,0x7a,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,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,0x14,0x14,0x17,0x20,0x20,0x25,0x24,0x24,0x28,0x24,0x24,0x29,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x10,0x13,0x22,0x22,0x27,0x0,0x0,0x0,0x0,0x0,0x0,0x19,0x19,0x1c,0x1a,0x1a,0x1d,0x0,0x0,0x0,0x0,0x0,0x0,0x11,0x11,0x14,0x12,0x12,0x14,0x23,0x23,0x27,0x0,0x0,0x0,0x0,0x0,0x0,0x15,0x15,0x18,0x20,0x20,0x25,0x20,0x20,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x24,0x24,0x28,0x0,0x0,0x0,0x24,0x24,0x28,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x24,0x24,0x27,0x15,0x15,0x18,0x23,0x23,0x28,0x12,0x12,0x14,0x0,0x0,0x0,0x1a,0x1a,0x1e,0x0,0x0,0x0,0x11,0x11,0x13,0x22,0x22,0x26,0x0,0x0,0x0,0x0,0x0,0x0,0x24,0x24,0x29,0x25,0x25,0x2a,0x24,0x24,0x28,0x25,0x25,0x28,0x25,0x25,0x29,0x25,0x25,0x27,0x2d,0x26,0x2c,0x4d,0x2b,0x37,0x63,0x2f,0x3f,0x6e,0x31,0x43,0x71,0x32,0x44,0x6c,0x31,0x42,0x51,0x2c,0x39,0x47,0x2a,0x35,0x66,0x30,0x40,0x4d,0x2b,0x38,0x32,0x26,0x2e,0x26,0x25,0x2a,0x2e,0x25,0x2c,0x3c,0x28,0x31,0x52,0x2c,0x39,0x68,0x30,0x40,0x27,0x25,0x2a,0x50,0x2c,0x38,0x5f,0x2e,0x3d,0x35,0x27,0x2f,0x38,0x27,0x30,0x5e,0x2e,0x3d,0x43,0x2a,0x34,0x5f,0x2f,0x3e,0x2f,0x25,0x2c,0x44,0x2a,0x34,0x2b,0x26,0x2c,0x64,0x2f,0x3f,0x36,0x27,0x30,0x37,0x27,0x30,0x66,0x2f,0x40,0x2c,0x26,0x2c,0x46,0x2a,0x35,0x53,0x2c,0x39,0x40,0x40,0x44,0xad,0xad,0xaf,0xff,0xff,0xff,0xf2,0xf2,0xf2,0x77,0x77,0x7a,0x5b,0x5b,0x5f,0x32,0x32,0x37,0x5d,0x2e,0x3d,0x3e,0x29,0x32,0xc9,0xc9,0xca,0xbb,0xbb,0xbd,0x69,0x69,0x6c,0x69,0x30,0x41,0x2f,0x26,0x2d,0x84,0x84,0x87,0xd6,0xd6,0xd7,0x92,0x92,0x94,0xa0,0xa0,0xa2,0x4e,0x4e,0x52,0x48,0x2b,0x36,0x2c,0x26,0x2b,0x97,0xb0,0x86,0xb4,0x0,0x0,0x0,0x41,0x74,0x52,0x4e,0x53,0x0,0x1,0x2,0x3,0x4,0x9,0xe,0x13,0x16,0x18,0x19,0xa,0x26,0x36,0x44,0x4d,0x52,0x54,0x55,0x6,0x12,0x27,0x43,0x98,0xe5,0xfa,0xfe,0x8,0x17,0x35,0x86,0xf3,0x7,0x3a,0xb4,0xb9,0xb,0x28,0x8a,0x8b,0xf6,0x45,0x5,0x9b,0xe6,0xe6,0x37,0xf,0xfb,0x4c,0xfe,0x4e,0x4f,0x50,0xfb,0x9c,0xf6,0x8c,0x3b,0xbb,0x3c,0x87,0xf3,0x53,0x14,0xe5,0x7c,0xf3,0x66,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x6b,0x52,0x65,0xa5,0x98,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,0x2,0x47,0x49,0x44,0x41,0x54,0x48,0xc7,0xd5,0x55,0xfb,0x5b,0x93,0x50,0x18,0x96,0x3,0xc,0x48,0x60,0xde,0x70,0x9b,0x43,0x37,0x75,0xa6,0x9b,0xb5,0xad,0x56,0x59,0x99,0xe9,0xc6,0x39,0xb3,0x56,0x59,0xcd,0x4c,0xbb,0xd9,0x3d,0xdb,0xd,0x74,0xa6,0xa3,0xdb,0xff,0x1e,0x70,0x68,0x6e,0xc0,0xe0,0xe9,0xe9,0x97,0x7a,0x79,0x9e,0x3,0xf,0x7c,0xdf,0xcb,0x7b,0xbe,0xf3,0x5d,0x86,0x86,0xfe,0x21,0x10,0x80,0x24,0xa9,0x40,0x90,0x24,0x20,0x3c,0xdd,0x1,0x45,0x87,0x18,0x96,0x3b,0x17,0x0,0x8e,0x65,0x42,0x34,0x5,0xdc,0x7f,0xa7,0x86,0x59,0x5e,0x10,0xc3,0x23,0xa3,0x63,0xbe,0x18,0x1d,0x9,0x8b,0x2,0xcf,0xe,0x53,0xe,0x15,0x60,0x7c,0x42,0x9a,0x8c,0x44,0x63,0x53,0xc5,0x52,0x0,0x8a,0x53,0xb1,0x68,0x64,0x52,0x9a,0x18,0xef,0x13,0x1,0xe2,0xf2,0xf4,0x4c,0x42,0x81,0x10,0x21,0x84,0xed,0x90,0x9,0x88,0xca,0xc8,0x93,0x24,0x31,0x33,0x2d,0xc7,0x7b,0x18,0x88,0x24,0x37,0x3b,0xa7,0xc0,0xcd,0x3b,0x77,0x2b,0xf7,0x30,0xee,0x3f,0xd8,0xb4,0x58,0xca,0x70,0x80,0x8e,0xb9,0x59,0x2e,0x49,0x9c,0xed,0x9f,0x11,0xe6,0x15,0xb4,0xf5,0xf0,0xd1,0xe3,0xaa,0xf5,0xb9,0xba,0xfd,0x64,0xe7,0xe9,0xd6,0xae,0xa5,0x64,0xd0,0x4e,0xe6,0x5,0xa6,0x1b,0x7,0x90,0x5a,0x38,0xaf,0xa0,0xbd,0x67,0xcf,0x7b,0x2d,0x5e,0xbc,0xdc,0xdb,0xf5,0x8d,0xc5,0xe2,0x42,0xea,0xf7,0x26,0x28,0x59,0x5c,0x82,0xaf,0xf6,0xb7,0xfb,0x2d,0x5e,0xef,0xbf,0xa9,0xfa,0x31,0x2c,0xa5,0xe5,0xc,0x96,0x40,0xd0,0xfc,0x32,0x7c,0xfb,0xee,0xbd,0xd3,0xe2,0xc3,0xc7,0x4f,0xbe,0xe7,0xb1,0xcc,0xd3,0x98,0x0,0x84,0x84,0xb,0xf0,0x60,0xc7,0x6d,0xf1,0xf9,0xc0,0x7e,0xa8,0xd5,0x1b,0xcd,0x56,0x49,0x6d,0x18,0xb0,0x16,0xcd,0x7a,0x7b,0x31,0x9b,0xc3,0x7b,0x20,0x19,0x31,0x86,0xe,0x8f,0xdc,0x4,0x47,0x87,0xf6,0x43,0xfb,0xb8,0xf6,0xa5,0x51,0x53,0x4d,0x47,0xd5,0xf6,0x36,0x90,0x4f,0x33,0x24,0x26,0x60,0x2f,0x5d,0x46,0x27,0xa7,0x6e,0x82,0xd3,0x13,0x5b,0x80,0xe9,0x74,0xdc,0x51,0x75,0x93,0x40,0xef,0x12,0x14,0xb,0x2c,0x85,0x9,0xe4,0x2b,0xa,0xaa,0x78,0x4,0xac,0x5a,0xc1,0x77,0x55,0x37,0x96,0xaf,0x75,0xb5,0xdd,0x6e,0x6b,0xd6,0x62,0x7f,0xbf,0x2a,0xdb,0x4,0x6c,0x58,0xf1,0x55,0xa0,0x99,0xa,0xea,0xdf,0x54,0xd3,0x53,0x6d,0x7b,0x28,0x60,0xc4,0x6b,0xd0,0x37,0x6,0x7a,0xa7,0xa4,0x35,0x5b,0x4e,0x82,0x6e,0xc,0x40,0x28,0x1b,0x70,0xa,0x6a,0x53,0x6f,0xd6,0x4b,0x4e,0x82,0xee,0x29,0x18,0x79,0xb0,0x12,0x90,0x7,0x5a,0xe7,0xbb,0x11,0xcb,0x96,0x66,0x2f,0x18,0x2b,0x92,0x9d,0x7,0x66,0x26,0x5e,0x47,0x7f,0x91,0x89,0x66,0x2d,0x2c,0xfe,0x79,0x2d,0xdc,0x38,0xab,0x5,0xef,0x6a,0xfc,0xe1,0xef,0xdf,0x5b,0x8d,0x66,0x3f,0xb8,0xb9,0xaa,0xc0,0x9f,0xce,0x7e,0xe0,0xe3,0xbf,0x7a,0xab,0xa7,0x1f,0x98,0x1d,0x89,0x13,0xd6,0x6e,0xc3,0x32,0xc4,0xd,0x9,0xd9,0x80,0xc6,0xe5,0xe9,0x9f,0x58,0x13,0xb8,0x78,0x7f,0x4f,0x4b,0x32,0x92,0x18,0x89,0xe6,0x3,0x5b,0xa2,0xf1,0xf3,0x7c,0x34,0x22,0x4a,0x4c,0xd2,0xd1,0x98,0x9,0x2a,0xc5,0xf2,0xd9,0x74,0x61,0x7d,0x2c,0x0,0xeb,0x85,0x74,0x96,0x67,0x53,0x94,0x6b,0x36,0x10,0x20,0x43,0xe7,0x36,0xe4,0xe0,0xb9,0x20,0x6f,0xe4,0xe8,0x8c,0xf7,0x6c,0x31,0x26,0x53,0xf0,0x60,0x32,0x46,0xd3,0x80,0xc9,0xf4,0xff,0xe2,0x17,0x82,0xde,0x40,0xde,0x2d,0xc3,0x2a,0xca,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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_menu_hl_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
};
-
-static const unsigned char toggle_on_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x20,0x8,0x3,0x0,0x0,0x0,0x95,0x43,0x8e,0xb6,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,0x1,0x74,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,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,0xd,0xd,0xf,0x1a,0x1a,0x1e,0x20,0x20,0x24,0x22,0x22,0x27,0x24,0x24,0x29,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xa,0xa,0xc,0x1d,0x1d,0x21,0x0,0x0,0x0,0x0,0x0,0x0,0x11,0x11,0x14,0x23,0x23,0x28,0x12,0x12,0x15,0x0,0x0,0x0,0x0,0x0,0x0,0xb,0xb,0xd,0x23,0x23,0x28,0xb,0xb,0xd,0x1e,0x1e,0x22,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0xe,0x10,0x1a,0x1a,0x1e,0x1a,0x1a,0x1d,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x20,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0xe,0x10,0xb,0xb,0xd,0x0,0x0,0x0,0x13,0x13,0x15,0x0,0x0,0x0,0xb,0xb,0xc,0x1d,0x1d,0x21,0x0,0x0,0x0,0x0,0x0,0x0,0x25,0x25,0x2a,0x24,0x24,0x29,0x25,0x2c,0x36,0x27,0x49,0x65,0x29,0x5d,0x85,0x2a,0x66,0x95,0x2a,0x68,0x99,0x29,0x64,0x92,0x28,0x4c,0x6b,0x25,0x27,0x2d,0x27,0x43,0x5c,0x29,0x5f,0x89,0x27,0x49,0x66,0x25,0x30,0x3e,0x25,0x26,0x2d,0x25,0x25,0x2b,0x25,0x26,0x2c,0x25,0x2d,0x38,0x25,0x3a,0x4c,0x27,0x4d,0x6b,0x29,0x60,0x8c,0x27,0x44,0x5c,0x27,0x4b,0x69,0x28,0x59,0x7f,0x25,0x34,0x43,0x25,0x35,0x45,0x28,0x58,0x7f,0x25,0x26,0x2b,0x27,0x40,0x57,0x27,0x41,0x57,0x25,0x2a,0x33,0x29,0x5d,0x87,0x25,0x34,0x44,0x25,0x2b,0x34,0x40,0x40,0x44,0xad,0xad,0xaf,0xff,0xff,0xff,0xf2,0xf2,0xf2,0x77,0x77,0x7a,0x5b,0x5b,0x5f,0x4e,0x4e,0x52,0xc9,0xc9,0xca,0x27,0x43,0x5b,0x27,0x4d,0x6c,0x27,0x4e,0x6d,0xbb,0xbb,0xbd,0x69,0x69,0x6c,0x28,0x56,0x7b,0x26,0x3b,0x4e,0x26,0x3a,0x4e,0x32,0x32,0x37,0x84,0x84,0x87,0xd6,0xd6,0xd7,0x29,0x61,0x8d,0x25,0x2e,0x39,0x92,0x92,0x94,0xa0,0xa0,0xa2,0xe4,0xe4,0xe5,0x27,0x44,0x5d,0xdd,0xc9,0xf2,0x7e,0x0,0x0,0x0,0x41,0x74,0x52,0x4e,0x53,0x0,0x1,0x2,0x3,0x4,0x9,0xe,0x13,0x16,0x18,0x19,0xa,0x26,0x36,0x44,0x4d,0x52,0x54,0x55,0x6,0x12,0x27,0x43,0x80,0xc5,0xe7,0xf5,0xfe,0x8,0x17,0x35,0x73,0xd9,0x7,0x3a,0x96,0xf9,0x9a,0xb,0x28,0x76,0xfb,0x77,0xde,0x45,0x5,0x82,0xc6,0xc6,0x37,0xf,0xe9,0x4c,0x4e,0x4f,0x50,0x83,0x78,0x3b,0x9c,0x3c,0x74,0xda,0x53,0x14,0x37,0x21,0x5a,0x6c,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x65,0xb5,0xdd,0x88,0x9f,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x2,0x28,0x49,0x44,0x41,0x54,0x48,0xc7,0xd5,0x55,0x69,0x57,0xd3,0x40,0x14,0x25,0x93,0xa4,0x49,0x24,0x49,0xd9,0x42,0xd7,0x0,0x85,0x50,0x2c,0xb4,0x68,0x5b,0xab,0x28,0xb2,0xc,0x4b,0x95,0x82,0x56,0xab,0x42,0x45,0x5c,0x9b,0xad,0x45,0x11,0x6d,0x3,0xa8,0x7f,0xde,0xc4,0x94,0x26,0x69,0x30,0x89,0xc7,0x2f,0x7a,0x3f,0xe4,0x9c,0xcc,0x3b,0xef,0xce,0x7d,0x6f,0xde,0x32,0x30,0xf0,0xf,0x1,0x1,0x28,0x8a,0xf9,0x2,0x45,0x1,0x72,0xa5,0x3b,0xc0,0xf0,0x10,0x41,0x52,0xd7,0x7c,0x40,0x91,0x44,0x8,0xc7,0x80,0xfb,0x76,0x6c,0x90,0xa4,0x19,0x36,0x3c,0x34,0x3c,0xe2,0x89,0xe1,0xa1,0x30,0xcb,0xd0,0xe4,0x20,0xd6,0xa7,0x2,0x8c,0x8e,0x71,0xe3,0x91,0x68,0x2c,0x9e,0x80,0x3e,0x48,0xc4,0x63,0xd1,0xc8,0x38,0x37,0x36,0xea,0x10,0x1,0x92,0xfc,0xc4,0xe4,0xd4,0x86,0x9f,0xf3,0x25,0x36,0xa6,0x26,0x27,0xf8,0xa4,0x8d,0x1,0x49,0x51,0xd3,0x33,0x82,0xa7,0xcf,0xe6,0xd6,0x76,0xf9,0x81,0x89,0x87,0x3b,0x9b,0x50,0x98,0x99,0xa6,0x52,0x88,0x15,0x3f,0xc1,0xcc,0x7a,0x6a,0xaf,0xec,0xee,0x3d,0x7a,0x5c,0x7d,0x62,0xe0,0x69,0xed,0xd9,0xf3,0x17,0xfb,0x95,0xc4,0x2c,0x43,0xf4,0xf2,0x0,0xd2,0x73,0xd7,0x33,0x9e,0xfe,0x7,0xf5,0x97,0xf6,0xff,0xc3,0x57,0x7,0x95,0xcc,0xfc,0x5c,0xfa,0x32,0x8,0x8c,0x67,0x17,0xbc,0xfc,0x8f,0x5e,0xd7,0x6b,0xce,0x93,0x5a,0xfd,0xcd,0xd1,0x42,0x96,0xcf,0x99,0x12,0x10,0x9c,0x5e,0xf4,0x8c,0xff,0xed,0xbb,0xf7,0xfd,0x47,0x87,0x7b,0x1f,0xe0,0x22,0x8d,0x9b,0x4,0x20,0xc4,0xdc,0xb0,0x4c,0xd,0x51,0x92,0x15,0xa8,0x4a,0x4d,0xa8,0xb6,0xba,0x47,0xc7,0x1f,0xdd,0xa4,0x9f,0x8e,0xe1,0xcd,0x7c,0xc1,0x8c,0x1,0x25,0xd8,0x98,0x65,0x69,0x9d,0x34,0x3e,0x4b,0xd,0x55,0x6a,0x59,0x4,0xa7,0x5f,0xdc,0x4,0x5f,0x4f,0x61,0x31,0x4b,0xa0,0x26,0x1,0x79,0x2b,0x6e,0x9,0x90,0xda,0x10,0x9e,0x74,0x54,0x4d,0x56,0x7b,0x4,0x67,0xe7,0x6e,0x82,0xf3,0x33,0x28,0x94,0x48,0xcc,0x24,0xe0,0x6f,0x5b,0x6f,0xa8,0x6a,0xfa,0xe7,0x42,0x54,0x5b,0x17,0x5a,0x8f,0xa0,0x5c,0x75,0x13,0x54,0xcb,0x10,0xde,0xe1,0xbb,0x4,0x64,0xd8,0x2a,0xa2,0xb6,0xa1,0x40,0xfc,0xa6,0x3b,0x7f,0x17,0x3,0x2b,0x20,0xd8,0xa2,0x65,0xd1,0x3a,0xb0,0x2d,0x2b,0x3a,0x81,0x22,0x5,0xcd,0x1,0x8,0xe5,0x6d,0xaf,0xa0,0xca,0x9a,0x2c,0xfe,0x4a,0xa0,0x16,0xf4,0x15,0xf4,0x3a,0x58,0xb2,0x99,0xda,0x9d,0xa6,0x9e,0x4b,0x5,0xc2,0xa6,0xe2,0x5d,0x7,0x4b,0x5c,0xb7,0xe,0xfe,0xba,0x12,0x8d,0x5e,0x98,0xff,0xf3,0x5e,0xb8,0x6b,0xf5,0x42,0x80,0x6e,0xdc,0x77,0x76,0xe3,0xf,0x67,0x37,0x1a,0xf3,0xe0,0xde,0xb2,0xa7,0x86,0xfe,0x79,0x90,0x59,0xbe,0x6f,0x9b,0x7,0xc6,0x44,0xa2,0x98,0x95,0x55,0x18,0x18,0xab,0x2b,0xc,0x95,0x74,0xce,0xb4,0x14,0xc1,0xb1,0x91,0x68,0x51,0xf0,0x77,0x16,0x8a,0xd1,0x8,0xcb,0x11,0xa9,0xbe,0xc1,0x8c,0x60,0x69,0x92,0xce,0x67,0x4b,0x6b,0x23,0x3e,0x58,0x2b,0x65,0xf3,0x34,0x99,0xc6,0x5c,0xbb,0x1,0x1,0x39,0xbc,0xb0,0xce,0xfb,0xef,0x5,0x7e,0xbd,0x80,0xe7,0xae,0xde,0x2d,0xfa,0x66,0xf2,0x5f,0x4c,0xfa,0x6a,0xfa,0xcd,0x66,0xfa,0x7f,0xf1,0x13,0xb7,0x71,0x36,0xc6,0x87,0x41,0xd4,0x5,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 toggle_off_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x20, 0x8, 0x3, 0x0, 0x0, 0x0, 0x95, 0x43, 0x8e, 0xb6, 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, 0x1, 0x7a, 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, 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, 0x14, 0x14, 0x17, 0x20, 0x20, 0x25, 0x24, 0x24, 0x28, 0x24, 0x24, 0x29, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x10, 0x13, 0x22, 0x22, 0x27, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x19, 0x19, 0x1c, 0x1a, 0x1a, 0x1d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11, 0x11, 0x14, 0x12, 0x12, 0x14, 0x23, 0x23, 0x27, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x15, 0x15, 0x18, 0x20, 0x20, 0x25, 0x20, 0x20, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, 0x24, 0x28, 0x0, 0x0, 0x0, 0x24, 0x24, 0x28, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, 0x24, 0x27, 0x15, 0x15, 0x18, 0x23, 0x23, 0x28, 0x12, 0x12, 0x14, 0x0, 0x0, 0x0, 0x1a, 0x1a, 0x1e, 0x0, 0x0, 0x0, 0x11, 0x11, 0x13, 0x22, 0x22, 0x26, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, 0x24, 0x29, 0x25, 0x25, 0x2a, 0x24, 0x24, 0x28, 0x25, 0x25, 0x28, 0x25, 0x25, 0x29, 0x25, 0x25, 0x27, 0x2d, 0x26, 0x2c, 0x4d, 0x2b, 0x37, 0x63, 0x2f, 0x3f, 0x6e, 0x31, 0x43, 0x71, 0x32, 0x44, 0x6c, 0x31, 0x42, 0x51, 0x2c, 0x39, 0x47, 0x2a, 0x35, 0x66, 0x30, 0x40, 0x4d, 0x2b, 0x38, 0x32, 0x26, 0x2e, 0x26, 0x25, 0x2a, 0x2e, 0x25, 0x2c, 0x3c, 0x28, 0x31, 0x52, 0x2c, 0x39, 0x68, 0x30, 0x40, 0x27, 0x25, 0x2a, 0x50, 0x2c, 0x38, 0x5f, 0x2e, 0x3d, 0x35, 0x27, 0x2f, 0x38, 0x27, 0x30, 0x5e, 0x2e, 0x3d, 0x43, 0x2a, 0x34, 0x5f, 0x2f, 0x3e, 0x2f, 0x25, 0x2c, 0x44, 0x2a, 0x34, 0x2b, 0x26, 0x2c, 0x64, 0x2f, 0x3f, 0x36, 0x27, 0x30, 0x37, 0x27, 0x30, 0x66, 0x2f, 0x40, 0x2c, 0x26, 0x2c, 0x46, 0x2a, 0x35, 0x53, 0x2c, 0x39, 0x40, 0x40, 0x44, 0xad, 0xad, 0xaf, 0xff, 0xff, 0xff, 0xf2, 0xf2, 0xf2, 0x77, 0x77, 0x7a, 0x5b, 0x5b, 0x5f, 0x32, 0x32, 0x37, 0x5d, 0x2e, 0x3d, 0x3e, 0x29, 0x32, 0xc9, 0xc9, 0xca, 0xbb, 0xbb, 0xbd, 0x69, 0x69, 0x6c, 0x69, 0x30, 0x41, 0x2f, 0x26, 0x2d, 0x84, 0x84, 0x87, 0xd6, 0xd6, 0xd7, 0x92, 0x92, 0x94, 0xa0, 0xa0, 0xa2, 0x4e, 0x4e, 0x52, 0x48, 0x2b, 0x36, 0x2c, 0x26, 0x2b, 0x97, 0xb0, 0x86, 0xb4, 0x0, 0x0, 0x0, 0x41, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x1, 0x2, 0x3, 0x4, 0x9, 0xe, 0x13, 0x16, 0x18, 0x19, 0xa, 0x26, 0x36, 0x44, 0x4d, 0x52, 0x54, 0x55, 0x6, 0x12, 0x27, 0x43, 0x98, 0xe5, 0xfa, 0xfe, 0x8, 0x17, 0x35, 0x86, 0xf3, 0x7, 0x3a, 0xb4, 0xb9, 0xb, 0x28, 0x8a, 0x8b, 0xf6, 0x45, 0x5, 0x9b, 0xe6, 0xe6, 0x37, 0xf, 0xfb, 0x4c, 0xfe, 0x4e, 0x4f, 0x50, 0xfb, 0x9c, 0xf6, 0x8c, 0x3b, 0xbb, 0x3c, 0x87, 0xf3, 0x53, 0x14, 0xe5, 0x7c, 0xf3, 0x66, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x6b, 0x52, 0x65, 0xa5, 0x98, 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, 0x2, 0x47, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xd5, 0x55, 0xfb, 0x5b, 0x93, 0x50, 0x18, 0x96, 0x3, 0xc, 0x48, 0x60, 0xde, 0x70, 0x9b, 0x43, 0x37, 0x75, 0xa6, 0x9b, 0xb5, 0xad, 0x56, 0x59, 0x99, 0xe9, 0xc6, 0x39, 0xb3, 0x56, 0x59, 0xcd, 0x4c, 0xbb, 0xd9, 0x3d, 0xdb, 0xd, 0x74, 0xa6, 0xa3, 0xdb, 0xff, 0x1e, 0x70, 0x68, 0x6e, 0xc0, 0xe0, 0xe9, 0xe9, 0x97, 0x7a, 0x79, 0x9e, 0x3, 0xf, 0x7c, 0xdf, 0xcb, 0x7b, 0xbe, 0xf3, 0x5d, 0x86, 0x86, 0xfe, 0x21, 0x10, 0x80, 0x24, 0xa9, 0x40, 0x90, 0x24, 0x20, 0x3c, 0xdd, 0x1, 0x45, 0x87, 0x18, 0x96, 0x3b, 0x17, 0x0, 0x8e, 0x65, 0x42, 0x34, 0x5, 0xdc, 0x7f, 0xa7, 0x86, 0x59, 0x5e, 0x10, 0xc3, 0x23, 0xa3, 0x63, 0xbe, 0x18, 0x1d, 0x9, 0x8b, 0x2, 0xcf, 0xe, 0x53, 0xe, 0x15, 0x60, 0x7c, 0x42, 0x9a, 0x8c, 0x44, 0x63, 0x53, 0xc5, 0x52, 0x0, 0x8a, 0x53, 0xb1, 0x68, 0x64, 0x52, 0x9a, 0x18, 0xef, 0x13, 0x1, 0xe2, 0xf2, 0xf4, 0x4c, 0x42, 0x81, 0x10, 0x21, 0x84, 0xed, 0x90, 0x9, 0x88, 0xca, 0xc8, 0x93, 0x24, 0x31, 0x33, 0x2d, 0xc7, 0x7b, 0x18, 0x88, 0x24, 0x37, 0x3b, 0xa7, 0xc0, 0xcd, 0x3b, 0x77, 0x2b, 0xf7, 0x30, 0xee, 0x3f, 0xd8, 0xb4, 0x58, 0xca, 0x70, 0x80, 0x8e, 0xb9, 0x59, 0x2e, 0x49, 0x9c, 0xed, 0x9f, 0x11, 0xe6, 0x15, 0xb4, 0xf5, 0xf0, 0xd1, 0xe3, 0xaa, 0xf5, 0xb9, 0xba, 0xfd, 0x64, 0xe7, 0xe9, 0xd6, 0xae, 0xa5, 0x64, 0xd0, 0x4e, 0xe6, 0x5, 0xa6, 0x1b, 0x7, 0x90, 0x5a, 0x38, 0xaf, 0xa0, 0xbd, 0x67, 0xcf, 0x7b, 0x2d, 0x5e, 0xbc, 0xdc, 0xdb, 0xf5, 0x8d, 0xc5, 0xe2, 0x42, 0xea, 0xf7, 0x26, 0x28, 0x59, 0x5c, 0x82, 0xaf, 0xf6, 0xb7, 0xfb, 0x2d, 0x5e, 0xef, 0xbf, 0xa9, 0xfa, 0x31, 0x2c, 0xa5, 0xe5, 0xc, 0x96, 0x40, 0xd0, 0xfc, 0x32, 0x7c, 0xfb, 0xee, 0xbd, 0xd3, 0xe2, 0xc3, 0xc7, 0x4f, 0xbe, 0xe7, 0xb1, 0xcc, 0xd3, 0x98, 0x0, 0x84, 0x84, 0xb, 0xf0, 0x60, 0xc7, 0x6d, 0xf1, 0xf9, 0xc0, 0x7e, 0xa8, 0xd5, 0x1b, 0xcd, 0x56, 0x49, 0x6d, 0x18, 0xb0, 0x16, 0xcd, 0x7a, 0x7b, 0x31, 0x9b, 0xc3, 0x7b, 0x20, 0x19, 0x31, 0x86, 0xe, 0x8f, 0xdc, 0x4, 0x47, 0x87, 0xf6, 0x43, 0xfb, 0xb8, 0xf6, 0xa5, 0x51, 0x53, 0x4d, 0x47, 0xd5, 0xf6, 0x36, 0x90, 0x4f, 0x33, 0x24, 0x26, 0x60, 0x2f, 0x5d, 0x46, 0x27, 0xa7, 0x6e, 0x82, 0xd3, 0x13, 0x5b, 0x80, 0xe9, 0x74, 0xdc, 0x51, 0x75, 0x93, 0x40, 0xef, 0x12, 0x14, 0xb, 0x2c, 0x85, 0x9, 0xe4, 0x2b, 0xa, 0xaa, 0x78, 0x4, 0xac, 0x5a, 0xc1, 0x77, 0x55, 0x37, 0x96, 0xaf, 0x75, 0xb5, 0xdd, 0x6e, 0x6b, 0xd6, 0x62, 0x7f, 0xbf, 0x2a, 0xdb, 0x4, 0x6c, 0x58, 0xf1, 0x55, 0xa0, 0x99, 0xa, 0xea, 0xdf, 0x54, 0xd3, 0x53, 0x6d, 0x7b, 0x28, 0x60, 0xc4, 0x6b, 0xd0, 0x37, 0x6, 0x7a, 0xa7, 0xa4, 0x35, 0x5b, 0x4e, 0x82, 0x6e, 0xc, 0x40, 0x28, 0x1b, 0x70, 0xa, 0x6a, 0x53, 0x6f, 0xd6, 0x4b, 0x4e, 0x82, 0xee, 0x29, 0x18, 0x79, 0xb0, 0x12, 0x90, 0x7, 0x5a, 0xe7, 0xbb, 0x11, 0xcb, 0x96, 0x66, 0x2f, 0x18, 0x2b, 0x92, 0x9d, 0x7, 0x66, 0x26, 0x5e, 0x47, 0x7f, 0x91, 0x89, 0x66, 0x2d, 0x2c, 0xfe, 0x79, 0x2d, 0xdc, 0x38, 0xab, 0x5, 0xef, 0x6a, 0xfc, 0xe1, 0xef, 0xdf, 0x5b, 0x8d, 0x66, 0x3f, 0xb8, 0xb9, 0xaa, 0xc0, 0x9f, 0xce, 0x7e, 0xe0, 0xe3, 0xbf, 0x7a, 0xab, 0xa7, 0x1f, 0x98, 0x1d, 0x89, 0x13, 0xd6, 0x6e, 0xc3, 0x32, 0xc4, 0xd, 0x9, 0xd9, 0x80, 0xc6, 0xe5, 0xe9, 0x9f, 0x58, 0x13, 0xb8, 0x78, 0x7f, 0x4f, 0x4b, 0x32, 0x92, 0x18, 0x89, 0xe6, 0x3, 0x5b, 0xa2, 0xf1, 0xf3, 0x7c, 0x34, 0x22, 0x4a, 0x4c, 0xd2, 0xd1, 0x98, 0x9, 0x2a, 0xc5, 0xf2, 0xd9, 0x74, 0x61, 0x7d, 0x2c, 0x0, 0xeb, 0x85, 0x74, 0x96, 0x67, 0x53, 0x94, 0x6b, 0x36, 0x10, 0x20, 0x43, 0xe7, 0x36, 0xe4, 0xe0, 0xb9, 0x20, 0x6f, 0xe4, 0xe8, 0x8c, 0xf7, 0x6c, 0x31, 0x26, 0x53, 0xf0, 0x60, 0x32, 0x46, 0xd3, 0x80, 0xc9, 0xf4, 0xff, 0xe2, 0x17, 0x82, 0xde, 0x40, 0xde, 0x2d, 0xc3, 0x2a, 0xca, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 tool_button_pressed_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,0x2,0x1,0x50,0x4c,0x54,0x45,0x29,0x3a,0x40,0x2d,0x3e,0x44,0x26,0x34,0x3b,0x24,0x34,0x39,0x23,0x31,0x38,0x22,0x31,0x37,0x22,0x31,0x37,0x22,0x30,0x36,0x22,0x31,0x36,0x26,0x34,0x3c,0x32,0x44,0x4c,0x26,0x34,0x39,0x23,0x31,0x36,0x21,0x2e,0x34,0x1f,0x2c,0x30,0x1f,0x2b,0x2f,0x1f,0x2a,0x2e,0x1e,0x2b,0x2f,0x1f,0x2b,0x2e,0x36,0x4b,0x52,0x25,0x33,0x38,0x20,0x2f,0x32,0x1c,0x29,0x2e,0x1b,0x26,0x2a,0x1a,0x23,0x26,0x18,0x22,0x26,0x19,0x22,0x26,0x19,0x23,0x26,0x19,0x26,0x29,0x20,0x2d,0x32,0x25,0x31,0x38,0x3c,0x51,0x59,0x23,0x31,0x37,0x1f,0x2b,0x31,0x1a,0x25,0x2b,0x17,0x20,0x24,0x15,0x1c,0x21,0x14,0x1b,0x21,0x14,0x1c,0x21,0x13,0x1b,0x21,0x15,0x1d,0x21,0x1a,0x25,0x2a,0x40,0x57,0x60,0x23,0x31,0x36,0x1f,0x2b,0x31,0x1b,0x25,0x29,0x16,0x1e,0x23,0x14,0x1b,0x1d,0x12,0x19,0x1d,0x12,0x1b,0x1d,0x14,0x1a,0x1d,0x45,0x5e,0x67,0x22,0x32,0x37,0x20,0x2d,0x31,0x1a,0x26,0x2a,0x15,0x1f,0x25,0x14,0x1c,0x1f,0x12,0x1b,0x1f,0x12,0x1b,0x20,0x14,0x1b,0x1f,0x15,0x1e,0x24,0x1a,0x25,0x29,0x4b,0x64,0x6d,0x23,0x32,0x38,0x20,0x2e,0x32,0x1b,0x27,0x2b,0x17,0x22,0x27,0x16,0x1e,0x23,0x14,0x1e,0x23,0x16,0x20,0x24,0x14,0x1e,0x22,0x15,0x1e,0x22,0x17,0x21,0x27,0x1c,0x27,0x2c,0x4f,0x6a,0x75,0x21,0x2f,0x33,0x1d,0x29,0x2d,0x19,0x23,0x2a,0x18,0x22,0x27,0x16,0x21,0x27,0x18,0x23,0x29,0x17,0x21,0x26,0x19,0x23,0x29,0x1c,0x28,0x2d,0x21,0x2e,0x33,0x54,0x70,0x7c,0x23,0x33,0x38,0x22,0x30,0x34,0x1e,0x2a,0x2f,0x1a,0x26,0x2d,0x1a,0x25,0x2b,0x19,0x25,0x2b,0x1a,0x26,0x2d,0x1a,0x26,0x2c,0x18,0x25,0x2a,0x1a,0x24,0x2a,0x1a,0x25,0x2c,0x1d,0x2a,0x2f,0x22,0x2f,0x34,0x59,0x77,0x82,0x23,0x33,0x39,0x22,0x30,0x35,0x1f,0x2c,0x31,0x1c,0x28,0x30,0x1c,0x28,0x2e,0x1b,0x29,0x2f,0x1c,0x2a,0x31,0x1b,0x28,0x2f,0x1c,0x28,0x2d,0x1b,0x27,0x2f,0x1f,0x2b,0x31,0x5e,0x7d,0x8a,0x24,0x34,0x39,0x21,0x2f,0x37,0x20,0x2d,0x34,0x1d,0x2b,0x33,0x1d,0x2b,0x32,0x1d,0x2d,0x35,0x1e,0x2e,0x36,0x1f,0x2e,0x36,0x1d,0x2b,0x34,0x1d,0x2b,0x31,0x1d,0x2b,0x32,0x20,0x2d,0x32,0x21,0x2f,0x36,0x63,0x83,0x90,0x25,0x34,0x39,0x21,0x31,0x36,0x1f,0x2e,0x34,0x1f,0x2e,0x34,0x1f,0x2e,0x36,0x20,0x31,0x39,0x21,0x33,0x3b,0x21,0x32,0x3b,0x1f,0x30,0x37,0x1f,0x2e,0x35,0x1e,0x2d,0x33,0x1f,0x2d,0x33,0x21,0x30,0x36,0x67,0x8a,0x97,0x24,0x33,0x39,0x20,0x30,0x36,0x1f,0x2f,0x35,0x21,0x30,0x37,0x22,0x32,0x39,0x21,0x35,0x3e,0x24,0x37,0x41,0x24,0x36,0x41,0x21,0x33,0x3c,0x21,0x31,0x38,0x1e,0x2f,0x35,0x1e,0x2e,0x35,0x20,0x2e,0x35,0x24,0x31,0x39,0x6c,0x90,0x9e,0x22,0x30,0x36,0x1f,0x2e,0x36,0x20,0x30,0x36,0x20,0x31,0x39,0x23,0x34,0x3d,0x23,0x37,0x41,0x26,0x3c,0x47,0x26,0x3b,0x46,0x22,0x35,0x3f,0x22,0x32,0x3b,0x1f,0x30,0x37,0x1f,0x2e,0x35,0x1f,0x2d,0x35,0x21,0x30,0x36,0x72,0x96,0xa5,0x72,0x96,0xa5,0xe8,0x14,0xaa,0x3f,0x0,0x0,0x0,0xaa,0x74,0x52,0x4e,0x53,0xc3,0xc3,0xe6,0xd7,0xcb,0xc3,0xbf,0xbe,0xbd,0xe5,0xc3,0xd7,0xc0,0xac,0xa0,0x9a,0x98,0x98,0x98,0xc3,0xcb,0xac,0x92,0x82,0x7b,0x78,0x78,0x7b,0x82,0xac,0xcb,0xc3,0xc3,0xa0,0x82,0x6f,0x67,0x64,0x63,0x64,0x67,0x82,0xc3,0xbf,0x9a,0x7a,0x67,0x5e,0x5b,0x5a,0x5e,0xc3,0xbd,0x98,0x78,0x64,0x5b,0x57,0x57,0x5b,0x64,0x78,0xc3,0xbd,0x98,0x78,0x63,0x5a,0x57,0x56,0x57,0x5a,0x63,0x77,0xc3,0x98,0x78,0x63,0x5a,0x57,0x56,0x5a,0x63,0x77,0x98,0xc3,0xbd,0x98,0x78,0x63,0x5a,0x57,0x56,0x56,0x57,0x5a,0x63,0x77,0x98,0xc3,0xbd,0x98,0x77,0x63,0x5a,0x57,0x56,0x57,0x5a,0x63,0x77,0xc3,0xbb,0x96,0x76,0x63,0x5a,0x57,0x56,0x56,0x57,0x5a,0x63,0x76,0x96,0xc3,0xb5,0x92,0x75,0x62,0x5a,0x57,0x56,0x56,0x57,0x59,0x62,0x74,0x92,0xc3,0xa9,0x8b,0x71,0x61,0x59,0x57,0x56,0x56,0x57,0x59,0x61,0x71,0x8b,0xa9,0xc3,0x95,0x7e,0x6b,0x5e,0x59,0x57,0x56,0x56,0x57,0x59,0x5e,0x6b,0x7e,0x95,0xc3,0x4f,0x78,0x99,0x30,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xa9,0x27,0xf,0x6,0x4,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,0xff,0x49,0x44,0x41,0x54,0x18,0xd3,0x63,0x60,0x40,0x7,0x8c,0x4c,0xcc,0x2c,0xac,0x6c,0xec,0x1c,0x1c,0x1c,0x6c,0xac,0x2c,0xcc,0x9c,0x8c,0xc,0x5c,0xdc,0x3c,0xbc,0x7c,0xfc,0x2,0x82,0x82,0x42,0xfc,0x7c,0xbc,0x3c,0xdc,0x5c,0xc,0xc2,0x22,0xa2,0x62,0xe2,0x12,0x92,0x52,0x52,0x92,0xd2,0x32,0x62,0xb2,0x72,0xc2,0xc,0xf2,0xa,0x8a,0x4a,0xca,0x2a,0xaa,0x6a,0x6a,0xea,0x1a,0xca,0x9a,0x8a,0xa,0xf2,0xc,0x5a,0xda,0x3a,0xba,0x7a,0xfa,0x6,0x86,0x86,0x6,0x46,0x7a,0xba,0x3a,0xda,0x5a,0xc,0xc6,0x26,0xa6,0x66,0xe6,0x16,0x96,0x56,0x56,0x96,0xd6,0x36,0xb6,0xa6,0x26,0xc6,0xc,0x76,0xf6,0xe,0x8e,0x4e,0xce,0x2e,0xae,0xae,0x6e,0xee,0x1e,0x9e,0xe,0x26,0x76,0xc,0x5e,0xf6,0xde,0x3e,0xbe,0x7e,0xfe,0x1,0x1,0xfe,0x81,0x41,0xc1,0x21,0xf6,0x5e,0xc,0xa1,0x61,0xe1,0x11,0x91,0x51,0xd1,0x31,0xb1,0x71,0xf1,0x9,0x89,0x49,0x61,0xa1,0xc,0xc9,0x29,0xa9,0x69,0xe9,0x19,0x99,0x59,0x59,0xd9,0x39,0xb9,0x79,0xa9,0x29,0xc9,0xc,0xf9,0x5,0x85,0x45,0xc5,0x25,0xa5,0x65,0xe5,0x15,0x95,0x55,0xd5,0x35,0x5,0xf9,0xc,0xb5,0x75,0xf5,0xd,0x8d,0x4d,0xcd,0x2d,0xad,0x6d,0xed,0x1d,0x9d,0x5d,0x75,0xb5,0xc,0xdd,0x3d,0xbd,0x7d,0xfd,0x13,0x26,0x4e,0x9a,0x3c,0x65,0xea,0xb4,0xe9,0x33,0x66,0x76,0x33,0xcc,0x9a,0x3d,0x67,0xee,0xbc,0xf9,0xb,0x16,0x2e,0x5a,0xbc,0x64,0xe9,0xb2,0xe5,0x2b,0x66,0x31,0xac,0x44,0x3,0x0,0xa4,0xd7,0x4d,0x73,0x12,0x21,0x19,0xde,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 toggle_on_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x20, 0x8, 0x3, 0x0, 0x0, 0x0, 0x95, 0x43, 0x8e, 0xb6, 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, 0x1, 0x74, 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, 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, 0xd, 0xd, 0xf, 0x1a, 0x1a, 0x1e, 0x20, 0x20, 0x24, 0x22, 0x22, 0x27, 0x24, 0x24, 0x29, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0xa, 0xc, 0x1d, 0x1d, 0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11, 0x11, 0x14, 0x23, 0x23, 0x28, 0x12, 0x12, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xb, 0xb, 0xd, 0x23, 0x23, 0x28, 0xb, 0xb, 0xd, 0x1e, 0x1e, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe, 0xe, 0x10, 0x1a, 0x1a, 0x1e, 0x1a, 0x1a, 0x1d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x20, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe, 0xe, 0x10, 0xb, 0xb, 0xd, 0x0, 0x0, 0x0, 0x13, 0x13, 0x15, 0x0, 0x0, 0x0, 0xb, 0xb, 0xc, 0x1d, 0x1d, 0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x25, 0x25, 0x2a, 0x24, 0x24, 0x29, 0x25, 0x2c, 0x36, 0x27, 0x49, 0x65, 0x29, 0x5d, 0x85, 0x2a, 0x66, 0x95, 0x2a, 0x68, 0x99, 0x29, 0x64, 0x92, 0x28, 0x4c, 0x6b, 0x25, 0x27, 0x2d, 0x27, 0x43, 0x5c, 0x29, 0x5f, 0x89, 0x27, 0x49, 0x66, 0x25, 0x30, 0x3e, 0x25, 0x26, 0x2d, 0x25, 0x25, 0x2b, 0x25, 0x26, 0x2c, 0x25, 0x2d, 0x38, 0x25, 0x3a, 0x4c, 0x27, 0x4d, 0x6b, 0x29, 0x60, 0x8c, 0x27, 0x44, 0x5c, 0x27, 0x4b, 0x69, 0x28, 0x59, 0x7f, 0x25, 0x34, 0x43, 0x25, 0x35, 0x45, 0x28, 0x58, 0x7f, 0x25, 0x26, 0x2b, 0x27, 0x40, 0x57, 0x27, 0x41, 0x57, 0x25, 0x2a, 0x33, 0x29, 0x5d, 0x87, 0x25, 0x34, 0x44, 0x25, 0x2b, 0x34, 0x40, 0x40, 0x44, 0xad, 0xad, 0xaf, 0xff, 0xff, 0xff, 0xf2, 0xf2, 0xf2, 0x77, 0x77, 0x7a, 0x5b, 0x5b, 0x5f, 0x4e, 0x4e, 0x52, 0xc9, 0xc9, 0xca, 0x27, 0x43, 0x5b, 0x27, 0x4d, 0x6c, 0x27, 0x4e, 0x6d, 0xbb, 0xbb, 0xbd, 0x69, 0x69, 0x6c, 0x28, 0x56, 0x7b, 0x26, 0x3b, 0x4e, 0x26, 0x3a, 0x4e, 0x32, 0x32, 0x37, 0x84, 0x84, 0x87, 0xd6, 0xd6, 0xd7, 0x29, 0x61, 0x8d, 0x25, 0x2e, 0x39, 0x92, 0x92, 0x94, 0xa0, 0xa0, 0xa2, 0xe4, 0xe4, 0xe5, 0x27, 0x44, 0x5d, 0xdd, 0xc9, 0xf2, 0x7e, 0x0, 0x0, 0x0, 0x41, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x1, 0x2, 0x3, 0x4, 0x9, 0xe, 0x13, 0x16, 0x18, 0x19, 0xa, 0x26, 0x36, 0x44, 0x4d, 0x52, 0x54, 0x55, 0x6, 0x12, 0x27, 0x43, 0x80, 0xc5, 0xe7, 0xf5, 0xfe, 0x8, 0x17, 0x35, 0x73, 0xd9, 0x7, 0x3a, 0x96, 0xf9, 0x9a, 0xb, 0x28, 0x76, 0xfb, 0x77, 0xde, 0x45, 0x5, 0x82, 0xc6, 0xc6, 0x37, 0xf, 0xe9, 0x4c, 0x4e, 0x4f, 0x50, 0x83, 0x78, 0x3b, 0x9c, 0x3c, 0x74, 0xda, 0x53, 0x14, 0x37, 0x21, 0x5a, 0x6c, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x65, 0xb5, 0xdd, 0x88, 0x9f, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x2, 0x28, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xd5, 0x55, 0x69, 0x57, 0xd3, 0x40, 0x14, 0x25, 0x93, 0xa4, 0x49, 0x24, 0x49, 0xd9, 0x42, 0xd7, 0x0, 0x85, 0x50, 0x2c, 0xb4, 0x68, 0x5b, 0xab, 0x28, 0xb2, 0xc, 0x4b, 0x95, 0x82, 0x56, 0xab, 0x42, 0x45, 0x5c, 0x9b, 0xad, 0x45, 0x11, 0x6d, 0x3, 0xa8, 0x7f, 0xde, 0xc4, 0x94, 0x26, 0x69, 0x30, 0x89, 0xc7, 0x2f, 0x7a, 0x3f, 0xe4, 0x9c, 0xcc, 0x3b, 0xef, 0xce, 0x7d, 0x6f, 0xde, 0x32, 0x30, 0xf0, 0xf, 0x1, 0x1, 0x28, 0x8a, 0xf9, 0x2, 0x45, 0x1, 0x72, 0xa5, 0x3b, 0xc0, 0xf0, 0x10, 0x41, 0x52, 0xd7, 0x7c, 0x40, 0x91, 0x44, 0x8, 0xc7, 0x80, 0xfb, 0x76, 0x6c, 0x90, 0xa4, 0x19, 0x36, 0x3c, 0x34, 0x3c, 0xe2, 0x89, 0xe1, 0xa1, 0x30, 0xcb, 0xd0, 0xe4, 0x20, 0xd6, 0xa7, 0x2, 0x8c, 0x8e, 0x71, 0xe3, 0x91, 0x68, 0x2c, 0x9e, 0x80, 0x3e, 0x48, 0xc4, 0x63, 0xd1, 0xc8, 0x38, 0x37, 0x36, 0xea, 0x10, 0x1, 0x92, 0xfc, 0xc4, 0xe4, 0xd4, 0x86, 0x9f, 0xf3, 0x25, 0x36, 0xa6, 0x26, 0x27, 0xf8, 0xa4, 0x8d, 0x1, 0x49, 0x51, 0xd3, 0x33, 0x82, 0xa7, 0xcf, 0xe6, 0xd6, 0x76, 0xf9, 0x81, 0x89, 0x87, 0x3b, 0x9b, 0x50, 0x98, 0x99, 0xa6, 0x52, 0x88, 0x15, 0x3f, 0xc1, 0xcc, 0x7a, 0x6a, 0xaf, 0xec, 0xee, 0x3d, 0x7a, 0x5c, 0x7d, 0x62, 0xe0, 0x69, 0xed, 0xd9, 0xf3, 0x17, 0xfb, 0x95, 0xc4, 0x2c, 0x43, 0xf4, 0xf2, 0x0, 0xd2, 0x73, 0xd7, 0x33, 0x9e, 0xfe, 0x7, 0xf5, 0x97, 0xf6, 0xff, 0xc3, 0x57, 0x7, 0x95, 0xcc, 0xfc, 0x5c, 0xfa, 0x32, 0x8, 0x8c, 0x67, 0x17, 0xbc, 0xfc, 0x8f, 0x5e, 0xd7, 0x6b, 0xce, 0x93, 0x5a, 0xfd, 0xcd, 0xd1, 0x42, 0x96, 0xcf, 0x99, 0x12, 0x10, 0x9c, 0x5e, 0xf4, 0x8c, 0xff, 0xed, 0xbb, 0xf7, 0xfd, 0x47, 0x87, 0x7b, 0x1f, 0xe0, 0x22, 0x8d, 0x9b, 0x4, 0x20, 0xc4, 0xdc, 0xb0, 0x4c, 0xd, 0x51, 0x92, 0x15, 0xa8, 0x4a, 0x4d, 0xa8, 0xb6, 0xba, 0x47, 0xc7, 0x1f, 0xdd, 0xa4, 0x9f, 0x8e, 0xe1, 0xcd, 0x7c, 0xc1, 0x8c, 0x1, 0x25, 0xd8, 0x98, 0x65, 0x69, 0x9d, 0x34, 0x3e, 0x4b, 0xd, 0x55, 0x6a, 0x59, 0x4, 0xa7, 0x5f, 0xdc, 0x4, 0x5f, 0x4f, 0x61, 0x31, 0x4b, 0xa0, 0x26, 0x1, 0x79, 0x2b, 0x6e, 0x9, 0x90, 0xda, 0x10, 0x9e, 0x74, 0x54, 0x4d, 0x56, 0x7b, 0x4, 0x67, 0xe7, 0x6e, 0x82, 0xf3, 0x33, 0x28, 0x94, 0x48, 0xcc, 0x24, 0xe0, 0x6f, 0x5b, 0x6f, 0xa8, 0x6a, 0xfa, 0xe7, 0x42, 0x54, 0x5b, 0x17, 0x5a, 0x8f, 0xa0, 0x5c, 0x75, 0x13, 0x54, 0xcb, 0x10, 0xde, 0xe1, 0xbb, 0x4, 0x64, 0xd8, 0x2a, 0xa2, 0xb6, 0xa1, 0x40, 0xfc, 0xa6, 0x3b, 0x7f, 0x17, 0x3, 0x2b, 0x20, 0xd8, 0xa2, 0x65, 0xd1, 0x3a, 0xb0, 0x2d, 0x2b, 0x3a, 0x81, 0x22, 0x5, 0xcd, 0x1, 0x8, 0xe5, 0x6d, 0xaf, 0xa0, 0xca, 0x9a, 0x2c, 0xfe, 0x4a, 0xa0, 0x16, 0xf4, 0x15, 0xf4, 0x3a, 0x58, 0xb2, 0x99, 0xda, 0x9d, 0xa6, 0x9e, 0x4b, 0x5, 0xc2, 0xa6, 0xe2, 0x5d, 0x7, 0x4b, 0x5c, 0xb7, 0xe, 0xfe, 0xba, 0x12, 0x8d, 0x5e, 0x98, 0xff, 0xf3, 0x5e, 0xb8, 0x6b, 0xf5, 0x42, 0x80, 0x6e, 0xdc, 0x77, 0x76, 0xe3, 0xf, 0x67, 0x37, 0x1a, 0xf3, 0xe0, 0xde, 0xb2, 0xa7, 0x86, 0xfe, 0x79, 0x90, 0x59, 0xbe, 0x6f, 0x9b, 0x7, 0xc6, 0x44, 0xa2, 0x98, 0x95, 0x55, 0x18, 0x18, 0xab, 0x2b, 0xc, 0x95, 0x74, 0xce, 0xb4, 0x14, 0xc1, 0xb1, 0x91, 0x68, 0x51, 0xf0, 0x77, 0x16, 0x8a, 0xd1, 0x8, 0xcb, 0x11, 0xa9, 0xbe, 0xc1, 0x8c, 0x60, 0x69, 0x92, 0xce, 0x67, 0x4b, 0x6b, 0x23, 0x3e, 0x58, 0x2b, 0x65, 0xf3, 0x34, 0x99, 0xc6, 0x5c, 0xbb, 0x1, 0x1, 0x39, 0xbc, 0xb0, 0xce, 0xfb, 0xef, 0x5, 0x7e, 0xbd, 0x80, 0xe7, 0xae, 0xde, 0x2d, 0xfa, 0x66, 0xf2, 0x5f, 0x4c, 0xfa, 0x6a, 0xfa, 0xcd, 0x66, 0xfa, 0x7f, 0xf1, 0x13, 0xb7, 0x71, 0x36, 0xc6, 0x87, 0x41, 0xd4, 0x5, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 tooltip_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,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,0x33,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,0x2d,0x2c,0x2f,0x48,0x46,0x4a,0xdd,0xdd,0xdd,0x4c,0x4a,0x4e,0x48,0x46,0x4a,0x40,0x3e,0x42,0xdd,0xdd,0xdd,0xfe,0x3f,0x83,0xa9,0x0,0x0,0x0,0xd,0x74,0x52,0x4e,0x53,0xa,0x1a,0x26,0x29,0x2a,0x48,0x65,0x6d,0x6e,0x66,0xf5,0xfe,0xcc,0xff,0xb7,0x4a,0xbe,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xc,0x81,0xb3,0x51,0x63,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,0x44,0x49,0x44,0x41,0x54,0x18,0xd3,0xc5,0xcf,0xbb,0x15,0x0,0x20,0x8,0x43,0xd1,0x80,0x28,0xf8,0x41,0xf7,0xdf,0xd6,0x86,0x63,0xa1,0x3,0x78,0xcb,0x54,0x79,0x0,0x71,0x92,0x90,0x98,0x0,0xca,0x45,0x2d,0x68,0xc9,0x4,0xae,0xad,0x7b,0xe8,0xad,0x32,0x44,0xe7,0x1a,0x61,0x4d,0x15,0x88,0xf9,0x38,0xdc,0xfe,0xd,0xf7,0xb1,0xe7,0xfa,0x13,0x77,0xe7,0x6f,0xdc,0x6c,0x9,0x25,0x82,0x67,0x68,0x78,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 tool_button_pressed_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, 0x2, 0x1, 0x50, 0x4c, 0x54, 0x45, 0x29, 0x3a, 0x40, 0x2d, 0x3e, 0x44, 0x26, 0x34, 0x3b, 0x24, 0x34, 0x39, 0x23, 0x31, 0x38, 0x22, 0x31, 0x37, 0x22, 0x31, 0x37, 0x22, 0x30, 0x36, 0x22, 0x31, 0x36, 0x26, 0x34, 0x3c, 0x32, 0x44, 0x4c, 0x26, 0x34, 0x39, 0x23, 0x31, 0x36, 0x21, 0x2e, 0x34, 0x1f, 0x2c, 0x30, 0x1f, 0x2b, 0x2f, 0x1f, 0x2a, 0x2e, 0x1e, 0x2b, 0x2f, 0x1f, 0x2b, 0x2e, 0x36, 0x4b, 0x52, 0x25, 0x33, 0x38, 0x20, 0x2f, 0x32, 0x1c, 0x29, 0x2e, 0x1b, 0x26, 0x2a, 0x1a, 0x23, 0x26, 0x18, 0x22, 0x26, 0x19, 0x22, 0x26, 0x19, 0x23, 0x26, 0x19, 0x26, 0x29, 0x20, 0x2d, 0x32, 0x25, 0x31, 0x38, 0x3c, 0x51, 0x59, 0x23, 0x31, 0x37, 0x1f, 0x2b, 0x31, 0x1a, 0x25, 0x2b, 0x17, 0x20, 0x24, 0x15, 0x1c, 0x21, 0x14, 0x1b, 0x21, 0x14, 0x1c, 0x21, 0x13, 0x1b, 0x21, 0x15, 0x1d, 0x21, 0x1a, 0x25, 0x2a, 0x40, 0x57, 0x60, 0x23, 0x31, 0x36, 0x1f, 0x2b, 0x31, 0x1b, 0x25, 0x29, 0x16, 0x1e, 0x23, 0x14, 0x1b, 0x1d, 0x12, 0x19, 0x1d, 0x12, 0x1b, 0x1d, 0x14, 0x1a, 0x1d, 0x45, 0x5e, 0x67, 0x22, 0x32, 0x37, 0x20, 0x2d, 0x31, 0x1a, 0x26, 0x2a, 0x15, 0x1f, 0x25, 0x14, 0x1c, 0x1f, 0x12, 0x1b, 0x1f, 0x12, 0x1b, 0x20, 0x14, 0x1b, 0x1f, 0x15, 0x1e, 0x24, 0x1a, 0x25, 0x29, 0x4b, 0x64, 0x6d, 0x23, 0x32, 0x38, 0x20, 0x2e, 0x32, 0x1b, 0x27, 0x2b, 0x17, 0x22, 0x27, 0x16, 0x1e, 0x23, 0x14, 0x1e, 0x23, 0x16, 0x20, 0x24, 0x14, 0x1e, 0x22, 0x15, 0x1e, 0x22, 0x17, 0x21, 0x27, 0x1c, 0x27, 0x2c, 0x4f, 0x6a, 0x75, 0x21, 0x2f, 0x33, 0x1d, 0x29, 0x2d, 0x19, 0x23, 0x2a, 0x18, 0x22, 0x27, 0x16, 0x21, 0x27, 0x18, 0x23, 0x29, 0x17, 0x21, 0x26, 0x19, 0x23, 0x29, 0x1c, 0x28, 0x2d, 0x21, 0x2e, 0x33, 0x54, 0x70, 0x7c, 0x23, 0x33, 0x38, 0x22, 0x30, 0x34, 0x1e, 0x2a, 0x2f, 0x1a, 0x26, 0x2d, 0x1a, 0x25, 0x2b, 0x19, 0x25, 0x2b, 0x1a, 0x26, 0x2d, 0x1a, 0x26, 0x2c, 0x18, 0x25, 0x2a, 0x1a, 0x24, 0x2a, 0x1a, 0x25, 0x2c, 0x1d, 0x2a, 0x2f, 0x22, 0x2f, 0x34, 0x59, 0x77, 0x82, 0x23, 0x33, 0x39, 0x22, 0x30, 0x35, 0x1f, 0x2c, 0x31, 0x1c, 0x28, 0x30, 0x1c, 0x28, 0x2e, 0x1b, 0x29, 0x2f, 0x1c, 0x2a, 0x31, 0x1b, 0x28, 0x2f, 0x1c, 0x28, 0x2d, 0x1b, 0x27, 0x2f, 0x1f, 0x2b, 0x31, 0x5e, 0x7d, 0x8a, 0x24, 0x34, 0x39, 0x21, 0x2f, 0x37, 0x20, 0x2d, 0x34, 0x1d, 0x2b, 0x33, 0x1d, 0x2b, 0x32, 0x1d, 0x2d, 0x35, 0x1e, 0x2e, 0x36, 0x1f, 0x2e, 0x36, 0x1d, 0x2b, 0x34, 0x1d, 0x2b, 0x31, 0x1d, 0x2b, 0x32, 0x20, 0x2d, 0x32, 0x21, 0x2f, 0x36, 0x63, 0x83, 0x90, 0x25, 0x34, 0x39, 0x21, 0x31, 0x36, 0x1f, 0x2e, 0x34, 0x1f, 0x2e, 0x34, 0x1f, 0x2e, 0x36, 0x20, 0x31, 0x39, 0x21, 0x33, 0x3b, 0x21, 0x32, 0x3b, 0x1f, 0x30, 0x37, 0x1f, 0x2e, 0x35, 0x1e, 0x2d, 0x33, 0x1f, 0x2d, 0x33, 0x21, 0x30, 0x36, 0x67, 0x8a, 0x97, 0x24, 0x33, 0x39, 0x20, 0x30, 0x36, 0x1f, 0x2f, 0x35, 0x21, 0x30, 0x37, 0x22, 0x32, 0x39, 0x21, 0x35, 0x3e, 0x24, 0x37, 0x41, 0x24, 0x36, 0x41, 0x21, 0x33, 0x3c, 0x21, 0x31, 0x38, 0x1e, 0x2f, 0x35, 0x1e, 0x2e, 0x35, 0x20, 0x2e, 0x35, 0x24, 0x31, 0x39, 0x6c, 0x90, 0x9e, 0x22, 0x30, 0x36, 0x1f, 0x2e, 0x36, 0x20, 0x30, 0x36, 0x20, 0x31, 0x39, 0x23, 0x34, 0x3d, 0x23, 0x37, 0x41, 0x26, 0x3c, 0x47, 0x26, 0x3b, 0x46, 0x22, 0x35, 0x3f, 0x22, 0x32, 0x3b, 0x1f, 0x30, 0x37, 0x1f, 0x2e, 0x35, 0x1f, 0x2d, 0x35, 0x21, 0x30, 0x36, 0x72, 0x96, 0xa5, 0x72, 0x96, 0xa5, 0xe8, 0x14, 0xaa, 0x3f, 0x0, 0x0, 0x0, 0xaa, 0x74, 0x52, 0x4e, 0x53, 0xc3, 0xc3, 0xe6, 0xd7, 0xcb, 0xc3, 0xbf, 0xbe, 0xbd, 0xe5, 0xc3, 0xd7, 0xc0, 0xac, 0xa0, 0x9a, 0x98, 0x98, 0x98, 0xc3, 0xcb, 0xac, 0x92, 0x82, 0x7b, 0x78, 0x78, 0x7b, 0x82, 0xac, 0xcb, 0xc3, 0xc3, 0xa0, 0x82, 0x6f, 0x67, 0x64, 0x63, 0x64, 0x67, 0x82, 0xc3, 0xbf, 0x9a, 0x7a, 0x67, 0x5e, 0x5b, 0x5a, 0x5e, 0xc3, 0xbd, 0x98, 0x78, 0x64, 0x5b, 0x57, 0x57, 0x5b, 0x64, 0x78, 0xc3, 0xbd, 0x98, 0x78, 0x63, 0x5a, 0x57, 0x56, 0x57, 0x5a, 0x63, 0x77, 0xc3, 0x98, 0x78, 0x63, 0x5a, 0x57, 0x56, 0x5a, 0x63, 0x77, 0x98, 0xc3, 0xbd, 0x98, 0x78, 0x63, 0x5a, 0x57, 0x56, 0x56, 0x57, 0x5a, 0x63, 0x77, 0x98, 0xc3, 0xbd, 0x98, 0x77, 0x63, 0x5a, 0x57, 0x56, 0x57, 0x5a, 0x63, 0x77, 0xc3, 0xbb, 0x96, 0x76, 0x63, 0x5a, 0x57, 0x56, 0x56, 0x57, 0x5a, 0x63, 0x76, 0x96, 0xc3, 0xb5, 0x92, 0x75, 0x62, 0x5a, 0x57, 0x56, 0x56, 0x57, 0x59, 0x62, 0x74, 0x92, 0xc3, 0xa9, 0x8b, 0x71, 0x61, 0x59, 0x57, 0x56, 0x56, 0x57, 0x59, 0x61, 0x71, 0x8b, 0xa9, 0xc3, 0x95, 0x7e, 0x6b, 0x5e, 0x59, 0x57, 0x56, 0x56, 0x57, 0x59, 0x5e, 0x6b, 0x7e, 0x95, 0xc3, 0x4f, 0x78, 0x99, 0x30, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xa9, 0x27, 0xf, 0x6, 0x4, 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, 0xff, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x63, 0x60, 0x40, 0x7, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x1c, 0x1c, 0x6c, 0xac, 0x2c, 0xcc, 0x9c, 0x8c, 0xc, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x2, 0x82, 0x82, 0x42, 0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0xc, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0x52, 0x92, 0xd2, 0x32, 0x62, 0xb2, 0x72, 0xc2, 0xc, 0xf2, 0xa, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0x6a, 0xea, 0x1a, 0xca, 0x9a, 0x8a, 0xa, 0xf2, 0xc, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x6, 0x86, 0x86, 0x6, 0x46, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0xc, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0x56, 0x96, 0xd6, 0x36, 0xb6, 0xa6, 0x26, 0xc6, 0xc, 0x76, 0xf6, 0xe, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0xe, 0x26, 0x76, 0xc, 0x5e, 0xf6, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x1, 0x1, 0xfe, 0x81, 0x41, 0xc1, 0x21, 0xf6, 0x5e, 0xc, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x9, 0x89, 0x49, 0x61, 0xa1, 0xc, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xa9, 0x29, 0xc9, 0xc, 0xf9, 0x5, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0x5, 0xf9, 0xc, 0xb5, 0x75, 0xf5, 0xd, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0x75, 0xb5, 0xc, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x13, 0x26, 0x4e, 0x9a, 0x3c, 0x65, 0xea, 0xb4, 0xe9, 0x33, 0x66, 0x76, 0x33, 0xcc, 0x9a, 0x3d, 0x67, 0xee, 0xbc, 0xf9, 0xb, 0x16, 0x2e, 0x5a, 0xbc, 0x64, 0xe9, 0xb2, 0xe5, 0x2b, 0x66, 0x31, 0xac, 0x44, 0x3, 0x0, 0xa4, 0xd7, 0x4d, 0x73, 0x12, 0x21, 0x19, 0xde, 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 tree_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xa,0x0,0x0,0x0,0xa,0x4,0x3,0x0,0x0,0x0,0x7f,0x1c,0xd2,0x8e,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,0x2a,0x50,0x4c,0x54,0x45,0x17,0x16,0x1a,0x1d,0x1c,0x21,0x20,0x1e,0x24,0x21,0x1f,0x25,0x1d,0x1c,0x21,0x20,0x1e,0x24,0x1d,0x1c,0x21,0x1d,0x1c,0x21,0x24,0x22,0x29,0x28,0x26,0x2d,0x28,0x26,0x2e,0x2b,0x2a,0x31,0x2c,0x2a,0x32,0xff,0xff,0xff,0xb9,0x11,0x56,0x3e,0x0,0x0,0x0,0x8,0x74,0x52,0x4e,0x53,0x6f,0xef,0xf7,0xf7,0xf0,0xf9,0xf1,0xee,0xcf,0x21,0xd2,0xdf,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0xd,0xf6,0xb4,0x61,0xf5,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,0x2d,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x54,0x36,0x36,0x12,0x60,0xf0,0x98,0xb5,0x6a,0x65,0xb,0x43,0xe4,0x9e,0x33,0xa7,0xa7,0x32,0x58,0x9d,0x39,0x73,0x66,0x31,0x16,0x12,0x22,0xb,0x52,0xd9,0xc6,0xc0,0x2,0xd4,0x55,0x0,0x0,0xc,0x14,0x1a,0x90,0x55,0x1a,0xec,0xdb,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 tooltip_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 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, 0x33, 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, 0x2d, 0x2c, 0x2f, 0x48, 0x46, 0x4a, 0xdd, 0xdd, 0xdd, 0x4c, 0x4a, 0x4e, 0x48, 0x46, 0x4a, 0x40, 0x3e, 0x42, 0xdd, 0xdd, 0xdd, 0xfe, 0x3f, 0x83, 0xa9, 0x0, 0x0, 0x0, 0xd, 0x74, 0x52, 0x4e, 0x53, 0xa, 0x1a, 0x26, 0x29, 0x2a, 0x48, 0x65, 0x6d, 0x6e, 0x66, 0xf5, 0xfe, 0xcc, 0xff, 0xb7, 0x4a, 0xbe, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xc, 0x81, 0xb3, 0x51, 0x63, 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, 0x44, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0xc5, 0xcf, 0xbb, 0x15, 0x0, 0x20, 0x8, 0x43, 0xd1, 0x80, 0x28, 0xf8, 0x41, 0xf7, 0xdf, 0xd6, 0x86, 0x63, 0xa1, 0x3, 0x78, 0xcb, 0x54, 0x79, 0x0, 0x71, 0x92, 0x90, 0x98, 0x0, 0xca, 0x45, 0x2d, 0x68, 0xc9, 0x4, 0xae, 0xad, 0x7b, 0xe8, 0xad, 0x32, 0x44, 0xe7, 0x1a, 0x61, 0x4d, 0x15, 0x88, 0xf9, 0x38, 0xdc, 0xfe, 0xd, 0xf7, 0xb1, 0xe7, 0xfa, 0x13, 0x77, 0xe7, 0x6f, 0xdc, 0x6c, 0x9, 0x25, 0x82, 0x67, 0x68, 0x78, 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 tree_bg_focus_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4,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,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xdb,0xb,0x4,0x12,0x2d,0x3a,0xb5,0x1b,0x14,0x49,0x0,0x0,0x2,0xd9,0x49,0x44,0x41,0x54,0x58,0xc3,0xc5,0x57,0x31,0x8e,0x14,0x31,0x10,0xac,0xea,0x3d,0x11,0x91,0xdf,0x49,0xf7,0xf,0x78,0x1,0xf,0x40,0x84,0x44,0x10,0xf2,0x20,0x42,0x62,0x12,0xc4,0x3,0x78,0x1,0xff,0x21,0x42,0xb8,0x8a,0xc0,0x1e,0x4f,0xdb,0xe3,0xb9,0xbb,0x45,0x20,0x7c,0x1a,0xdd,0x8c,0xec,0xed,0xae,0xae,0xea,0xee,0xe9,0xe1,0xfd,0xed,0xdd,0xb,0x0,0xdf,0xf1,0x7f,0xd6,0x4b,0xde,0xdf,0xde,0xf9,0xcb,0xeb,0x9f,0xff,0xc5,0xfb,0x9b,0xaf,0xcf,0x70,0xb3,0x3d,0x3c,0xff,0xf0,0xd,0x24,0x11,0x71,0x1,0x49,0x90,0x4,0x0,0x4,0xd3,0x2f,0xb6,0x7b,0xf,0xff,0x86,0x2d,0x8c,0x47,0x60,0x1b,0x0,0x61,0x1b,0xb6,0x21,0x15,0xd8,0xc6,0x8f,0x8f,0xaf,0x0,0x60,0x7,0x0,0xa2,0x2,0x20,0x11,0x41,0x30,0xa2,0x2,0xc1,0xb5,0x0,0x8c,0x79,0xd9,0x80,0x24,0x48,0x0,0x48,0x28,0x9d,0xb9,0xd9,0xd,0xb0,0x31,0x40,0x5c,0x2e,0x1,0x46,0x0,0xd,0xd0,0xb6,0xef,0x35,0x8e,0x13,0x6,0xbc,0x33,0x60,0xa3,0x9a,0x11,0x6c,0x82,0xe6,0xa,0x0,0x86,0xe8,0x2f,0x71,0xa9,0xf7,0x9c,0x4d,0x1f,0x69,0x5e,0x1,0xd8,0xa3,0x37,0xa4,0xa,0x27,0x1a,0x13,0x79,0x25,0x9,0xaa,0xe3,0xd8,0x9c,0x5f,0xea,0x7d,0x67,0x80,0xd7,0x31,0x20,0xab,0x3,0x20,0x5,0x20,0x2a,0x13,0x41,0x40,0x2b,0x0,0x76,0x22,0xb9,0xb1,0xd1,0x92,0x91,0x5d,0x86,0xf3,0x35,0xef,0x5,0xa3,0x25,0x60,0xd,0x6e,0x66,0xe5,0x0,0xc0,0xa8,0x54,0x1,0x6,0xe9,0x16,0x9f,0x4f,0xdc,0x1c,0x13,0xed,0xb1,0x55,0x31,0x78,0x70,0x8e,0xca,0xcb,0x8e,0x6a,0xbe,0x56,0x88,0x67,0x38,0xdb,0x75,0x58,0x76,0xdf,0x1b,0x6c,0x7a,0xc,0x6c,0x90,0x0,0xfd,0xe0,0xe8,0x98,0xe4,0x4,0xe2,0x69,0xc,0xe4,0x40,0xaa,0xf9,0x63,0x70,0xbb,0x4,0x16,0x9c,0x12,0xa7,0x3e,0xe7,0x38,0xb3,0x4,0x2b,0x6f,0xc7,0x23,0xbb,0xc3,0x66,0xdb,0x38,0x7,0x0,0xcf,0x32,0x34,0xb6,0x52,0xb4,0x3c,0xf7,0x35,0x10,0xd9,0xf7,0x6,0x56,0x93,0x4,0x4b,0x0,0x43,0x28,0xf9,0x4a,0x3d,0x6e,0xb0,0x3e,0x9,0x31,0xa9,0x62,0xd6,0xc4,0x36,0x9c,0xf2,0xd9,0xbd,0x41,0x2d,0x24,0x68,0xc7,0x1f,0x62,0x60,0x6a,0xc1,0x7f,0x95,0x81,0xaa,0x13,0x61,0x9,0xa6,0xf6,0x1c,0x30,0x17,0x11,0x6f,0x48,0x12,0x3b,0xf3,0x7b,0xc2,0xeb,0xca,0x92,0xb7,0x72,0x5f,0x31,0x90,0x11,0x4e,0x48,0xb3,0x13,0xa6,0xcc,0x3e,0x51,0x60,0x91,0x53,0x55,0x87,0xf3,0x2a,0x98,0xff,0x7c,0x6c,0x1a,0xf9,0xec,0xda,0xeb,0x94,0x13,0x43,0xdd,0x3f,0x2a,0x41,0xd2,0xb,0x27,0x65,0xe8,0x13,0x20,0x29,0x3f,0xc6,0x7c,0x48,0x65,0x8,0x41,0xda,0xa4,0xd5,0x11,0xc0,0x2a,0x61,0xce,0x18,0x58,0xd2,0xbe,0x98,0x48,0x96,0xdd,0xf5,0xbc,0x11,0x65,0xb6,0x12,0x55,0xcb,0xde,0xb3,0x78,0x27,0x78,0xdc,0xcb,0x72,0xe6,0xd7,0x8a,0x27,0xe6,0x52,0x1f,0x10,0xe0,0xb8,0x92,0x81,0xb4,0x3f,0x1,0x1d,0xed,0x6c,0xd4,0xef,0x12,0x2f,0x73,0xa0,0xe,0xf,0x42,0x24,0x20,0xf,0x91,0xbf,0x6e,0x44,0xfb,0xde,0xa1,0x4,0xa5,0x7,0xaa,0xa0,0x23,0xad,0xd4,0x4b,0xaa,0x73,0x0,0xb7,0xa1,0x82,0x87,0x46,0x74,0x9a,0xf,0x48,0x5d,0xb3,0xd,0xa2,0xb0,0x96,0xe5,0x7d,0xc8,0x81,0x19,0xf1,0x36,0x2b,0xba,0xbd,0x5e,0xb3,0xb7,0x55,0x12,0x76,0x90,0xc4,0x3a,0x1,0xa7,0x66,0xbc,0x3,0x90,0xe0,0x8,0xc8,0x42,0x29,0xa5,0x7b,0xa2,0x63,0x9f,0x88,0x26,0xa,0x9c,0x85,0x6f,0x7b,0x2b,0x0,0x92,0x51,0x4a,0x81,0x5c,0x2a,0xcb,0x2a,0x47,0x0,0xb0,0x2b,0x8,0x11,0x62,0x20,0x58,0x20,0x47,0x77,0x5a,0xe5,0x98,0x43,0x3f,0x2,0xd8,0xc1,0xa5,0x39,0x40,0x82,0xb5,0xd9,0xd7,0x5a,0x2,0x59,0x80,0x9,0x8a,0x0,0x7f,0x1,0x8,0x44,0x8,0x64,0xe0,0xe8,0x6e,0x4b,0xb4,0x87,0xa6,0xc4,0x3d,0x17,0x24,0xa3,0xa8,0xc0,0x32,0x8a,0xea,0x33,0x67,0x0,0x6e,0xc,0x94,0x5e,0xe2,0x46,0x11,0x3a,0x0,0x82,0x57,0x1,0x98,0xbf,0xb,0xa4,0xf6,0x55,0xd4,0x2a,0xe1,0x0,0x40,0xf5,0xf3,0xa5,0xd3,0x16,0x6a,0xb4,0xa7,0x19,0xfa,0x4f,0x18,0xe8,0x2c,0x34,0xfb,0x92,0x20,0xbb,0xf,0xa3,0x1d,0xc0,0xcd,0xe7,0xb7,0x83,0xf9,0xf2,0x24,0xd3,0xd7,0xaf,0x40,0x9a,0x84,0x1,0xf0,0xfe,0xf6,0xee,0x1d,0x80,0x4f,0xff,0xc8,0xdf,0x63,0xeb,0xfd,0x6f,0x3,0x74,0x35,0xa7,0x2a,0xf0,0x17,0xed,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 tree_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0xa, 0x4, 0x3, 0x0, 0x0, 0x0, 0x7f, 0x1c, 0xd2, 0x8e, 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, 0x2a, 0x50, 0x4c, 0x54, 0x45, 0x17, 0x16, 0x1a, 0x1d, 0x1c, 0x21, 0x20, 0x1e, 0x24, 0x21, 0x1f, 0x25, 0x1d, 0x1c, 0x21, 0x20, 0x1e, 0x24, 0x1d, 0x1c, 0x21, 0x1d, 0x1c, 0x21, 0x24, 0x22, 0x29, 0x28, 0x26, 0x2d, 0x28, 0x26, 0x2e, 0x2b, 0x2a, 0x31, 0x2c, 0x2a, 0x32, 0xff, 0xff, 0xff, 0xb9, 0x11, 0x56, 0x3e, 0x0, 0x0, 0x0, 0x8, 0x74, 0x52, 0x4e, 0x53, 0x6f, 0xef, 0xf7, 0xf7, 0xf0, 0xf9, 0xf1, 0xee, 0xcf, 0x21, 0xd2, 0xdf, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0xd, 0xf6, 0xb4, 0x61, 0xf5, 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, 0x2d, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x54, 0x36, 0x36, 0x12, 0x60, 0xf0, 0x98, 0xb5, 0x6a, 0x65, 0xb, 0x43, 0xe4, 0x9e, 0x33, 0xa7, 0xa7, 0x32, 0x58, 0x9d, 0x39, 0x73, 0x66, 0x31, 0x16, 0x12, 0x22, 0xb, 0x52, 0xd9, 0xc6, 0xc0, 0x2, 0xd4, 0x55, 0x0, 0x0, 0xc, 0x14, 0x1a, 0x90, 0x55, 0x1a, 0xec, 0xdb, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 tree_cursor_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0xe,0x8,0x3,0x0,0x0,0x0,0x28,0x96,0xdd,0xe3,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,0xc6,0x50,0x4c,0x54,0x45,0xd4,0xab,0x9e,0xd3,0xaa,0x9d,0xd4,0xab,0x9e,0xd3,0xaa,0x9d,0xd4,0xab,0x9c,0xd4,0xac,0x9e,0xd5,0xaf,0xa3,0xd5,0xb0,0xa3,0xd5,0xaf,0xa3,0xd5,0xad,0xa1,0xd5,0xaf,0xa3,0xd5,0xad,0xa1,0xd5,0xb0,0xa3,0xd6,0xad,0xa0,0xd6,0xad,0xa0,0xd5,0xb0,0xa3,0xd7,0xb1,0xa5,0xd7,0xb1,0xa7,0xd7,0xb1,0xa7,0xd7,0xb1,0xa7,0xd7,0xb1,0xa7,0xd7,0xb1,0xa5,0xd7,0xb1,0xa5,0xd8,0xb3,0xa8,0xd8,0xb5,0xaa,0xda,0xb3,0xa8,0xda,0xb3,0xa8,0xd8,0xb3,0xa8,0xd8,0xb5,0xaa,0xda,0xb3,0xa8,0xd8,0xb3,0xa8,0xdb,0xb7,0xad,0xda,0xb8,0xae,0xdb,0xb9,0xad,0xdb,0xb9,0xad,0xdb,0xb7,0xad,0xdd,0xba,0xb1,0xdd,0xbb,0xb1,0xdd,0xbd,0xb1,0xdd,0xbf,0xb3,0xdd,0xbd,0xb3,0xdf,0xc1,0xb7,0xdf,0xc0,0xb5,0xdf,0xbf,0xb5,0xe1,0xc3,0xb9,0xe1,0xc3,0xbb,0xe1,0xc5,0xbb,0xe2,0xc7,0xbe,0xe1,0xc5,0xbd,0xe4,0xcb,0xc2,0xe3,0xca,0xc1,0xe3,0xcb,0xc3,0xe6,0xce,0xc6,0xe6,0xd0,0xc6,0xe8,0xd1,0xca,0xe8,0xd1,0xca,0xe8,0xd0,0xca,0xe8,0xcf,0xca,0xb7,0x7d,0x69,0xb1,0x77,0x63,0xac,0x73,0x5c,0xa6,0x69,0x56,0x9c,0x67,0x54,0x93,0x62,0x51,0x88,0x60,0x50,0x0,0x0,0x0,0x39,0x76,0x1d,0xc2,0x0,0x0,0x0,0x3a,0x74,0x52,0x4e,0x53,0x32,0x2f,0x30,0x33,0x38,0x40,0x32,0x2f,0x2f,0x2f,0x31,0x33,0x33,0x33,0x36,0x38,0x31,0x2f,0x30,0x31,0x33,0x33,0x35,0x2f,0x2f,0x2f,0x30,0x32,0x33,0x33,0x33,0x2f,0x2f,0x2f,0x30,0x30,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x32,0x2f,0x2f,0x2f,0xb8,0xf,0x95,0x41,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x41,0x89,0xde,0x6c,0x4e,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x9e,0x49,0x44,0x41,0x54,0x8,0xd7,0x55,0xcf,0x5b,0x17,0x81,0x40,0x14,0x5,0xe0,0xe3,0x9a,0x4b,0x2e,0x31,0x14,0x62,0x22,0x53,0x4d,0x83,0x44,0xc,0xa6,0xa9,0xf9,0xff,0xbf,0xca,0xd4,0x5a,0x1e,0x7c,0xfb,0xec,0xb5,0x9f,0xf,0x7c,0xfe,0x80,0x80,0x86,0xd6,0x6c,0x69,0xed,0x8e,0x80,0xbc,0x6b,0x18,0xbd,0xfe,0x60,0x68,0x9a,0xa3,0xf1,0x24,0x7,0x39,0xb5,0x2c,0x6b,0x36,0x47,0x68,0x81,0xd0,0x52,0x42,0x61,0x3b,0xb6,0xb3,0x72,0xd6,0x1b,0x77,0xeb,0xee,0xa,0x28,0x31,0xc6,0x9e,0x87,0x3d,0xbc,0x3f,0xf8,0x7e,0x9,0xea,0x48,0x8,0x9,0xc2,0x28,0x22,0x21,0x9,0x14,0x28,0x1a,0x33,0x16,0xd3,0x98,0xb2,0x98,0x51,0x5,0xe5,0x49,0x3b,0xeb,0x5e,0x74,0x4a,0x28,0x92,0xca,0xb5,0xbe,0xa4,0x0,0x99,0xde,0xd2,0xca,0xbd,0x5a,0x9,0x79,0x96,0x3d,0xb2,0x9f,0x1c,0xc4,0x93,0xf3,0x17,0xaf,0xfb,0xe6,0x2,0xfe,0x5f,0xf8,0x2,0x30,0xbc,0x1f,0xb4,0x2b,0xfc,0x80,0xca,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 tree_bg_focus_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x20, 0x8, 0x6, 0x0, 0x0, 0x0, 0x73, 0x7a, 0x7a, 0xf4, 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, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x13, 0x0, 0x0, 0xb, 0x13, 0x1, 0x0, 0x9a, 0x9c, 0x18, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xdb, 0xb, 0x4, 0x12, 0x2d, 0x3a, 0xb5, 0x1b, 0x14, 0x49, 0x0, 0x0, 0x2, 0xd9, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0xc5, 0x57, 0x31, 0x8e, 0x14, 0x31, 0x10, 0xac, 0xea, 0x3d, 0x11, 0x91, 0xdf, 0x49, 0xf7, 0xf, 0x78, 0x1, 0xf, 0x40, 0x84, 0x44, 0x10, 0xf2, 0x20, 0x42, 0x62, 0x12, 0xc4, 0x3, 0x78, 0x1, 0xff, 0x21, 0x42, 0xb8, 0x8a, 0xc0, 0x1e, 0x4f, 0xdb, 0xe3, 0xb9, 0xbb, 0x45, 0x20, 0x7c, 0x1a, 0xdd, 0x8c, 0xec, 0xed, 0xae, 0xae, 0xea, 0xee, 0xe9, 0xe1, 0xfd, 0xed, 0xdd, 0xb, 0x0, 0xdf, 0xf1, 0x7f, 0xd6, 0x4b, 0xde, 0xdf, 0xde, 0xf9, 0xcb, 0xeb, 0x9f, 0xff, 0xc5, 0xfb, 0x9b, 0xaf, 0xcf, 0x70, 0xb3, 0x3d, 0x3c, 0xff, 0xf0, 0xd, 0x24, 0x11, 0x71, 0x1, 0x49, 0x90, 0x4, 0x0, 0x4, 0xd3, 0x2f, 0xb6, 0x7b, 0xf, 0xff, 0x86, 0x2d, 0x8c, 0x47, 0x60, 0x1b, 0x0, 0x61, 0x1b, 0xb6, 0x21, 0x15, 0xd8, 0xc6, 0x8f, 0x8f, 0xaf, 0x0, 0x60, 0x7, 0x0, 0xa2, 0x2, 0x20, 0x11, 0x41, 0x30, 0xa2, 0x2, 0xc1, 0xb5, 0x0, 0x8c, 0x79, 0xd9, 0x80, 0x24, 0x48, 0x0, 0x48, 0x28, 0x9d, 0xb9, 0xd9, 0xd, 0xb0, 0x31, 0x40, 0x5c, 0x2e, 0x1, 0x46, 0x0, 0xd, 0xd0, 0xb6, 0xef, 0x35, 0x8e, 0x13, 0x6, 0xbc, 0x33, 0x60, 0xa3, 0x9a, 0x11, 0x6c, 0x82, 0xe6, 0xa, 0x0, 0x86, 0xe8, 0x2f, 0x71, 0xa9, 0xf7, 0x9c, 0x4d, 0x1f, 0x69, 0x5e, 0x1, 0xd8, 0xa3, 0x37, 0xa4, 0xa, 0x27, 0x1a, 0x13, 0x79, 0x25, 0x9, 0xaa, 0xe3, 0xd8, 0x9c, 0x5f, 0xea, 0x7d, 0x67, 0x80, 0xd7, 0x31, 0x20, 0xab, 0x3, 0x20, 0x5, 0x20, 0x2a, 0x13, 0x41, 0x40, 0x2b, 0x0, 0x76, 0x22, 0xb9, 0xb1, 0xd1, 0x92, 0x91, 0x5d, 0x86, 0xf3, 0x35, 0xef, 0x5, 0xa3, 0x25, 0x60, 0xd, 0x6e, 0x66, 0xe5, 0x0, 0xc0, 0xa8, 0x54, 0x1, 0x6, 0xe9, 0x16, 0x9f, 0x4f, 0xdc, 0x1c, 0x13, 0xed, 0xb1, 0x55, 0x31, 0x78, 0x70, 0x8e, 0xca, 0xcb, 0x8e, 0x6a, 0xbe, 0x56, 0x88, 0x67, 0x38, 0xdb, 0x75, 0x58, 0x76, 0xdf, 0x1b, 0x6c, 0x7a, 0xc, 0x6c, 0x90, 0x0, 0xfd, 0xe0, 0xe8, 0x98, 0xe4, 0x4, 0xe2, 0x69, 0xc, 0xe4, 0x40, 0xaa, 0xf9, 0x63, 0x70, 0xbb, 0x4, 0x16, 0x9c, 0x12, 0xa7, 0x3e, 0xe7, 0x38, 0xb3, 0x4, 0x2b, 0x6f, 0xc7, 0x23, 0xbb, 0xc3, 0x66, 0xdb, 0x38, 0x7, 0x0, 0xcf, 0x32, 0x34, 0xb6, 0x52, 0xb4, 0x3c, 0xf7, 0x35, 0x10, 0xd9, 0xf7, 0x6, 0x56, 0x93, 0x4, 0x4b, 0x0, 0x43, 0x28, 0xf9, 0x4a, 0x3d, 0x6e, 0xb0, 0x3e, 0x9, 0x31, 0xa9, 0x62, 0xd6, 0xc4, 0x36, 0x9c, 0xf2, 0xd9, 0xbd, 0x41, 0x2d, 0x24, 0x68, 0xc7, 0x1f, 0x62, 0x60, 0x6a, 0xc1, 0x7f, 0x95, 0x81, 0xaa, 0x13, 0x61, 0x9, 0xa6, 0xf6, 0x1c, 0x30, 0x17, 0x11, 0x6f, 0x48, 0x12, 0x3b, 0xf3, 0x7b, 0xc2, 0xeb, 0xca, 0x92, 0xb7, 0x72, 0x5f, 0x31, 0x90, 0x11, 0x4e, 0x48, 0xb3, 0x13, 0xa6, 0xcc, 0x3e, 0x51, 0x60, 0x91, 0x53, 0x55, 0x87, 0xf3, 0x2a, 0x98, 0xff, 0x7c, 0x6c, 0x1a, 0xf9, 0xec, 0xda, 0xeb, 0x94, 0x13, 0x43, 0xdd, 0x3f, 0x2a, 0x41, 0xd2, 0xb, 0x27, 0x65, 0xe8, 0x13, 0x20, 0x29, 0x3f, 0xc6, 0x7c, 0x48, 0x65, 0x8, 0x41, 0xda, 0xa4, 0xd5, 0x11, 0xc0, 0x2a, 0x61, 0xce, 0x18, 0x58, 0xd2, 0xbe, 0x98, 0x48, 0x96, 0xdd, 0xf5, 0xbc, 0x11, 0x65, 0xb6, 0x12, 0x55, 0xcb, 0xde, 0xb3, 0x78, 0x27, 0x78, 0xdc, 0xcb, 0x72, 0xe6, 0xd7, 0x8a, 0x27, 0xe6, 0x52, 0x1f, 0x10, 0xe0, 0xb8, 0x92, 0x81, 0xb4, 0x3f, 0x1, 0x1d, 0xed, 0x6c, 0xd4, 0xef, 0x12, 0x2f, 0x73, 0xa0, 0xe, 0xf, 0x42, 0x24, 0x20, 0xf, 0x91, 0xbf, 0x6e, 0x44, 0xfb, 0xde, 0xa1, 0x4, 0xa5, 0x7, 0xaa, 0xa0, 0x23, 0xad, 0xd4, 0x4b, 0xaa, 0x73, 0x0, 0xb7, 0xa1, 0x82, 0x87, 0x46, 0x74, 0x9a, 0xf, 0x48, 0x5d, 0xb3, 0xd, 0xa2, 0xb0, 0x96, 0xe5, 0x7d, 0xc8, 0x81, 0x19, 0xf1, 0x36, 0x2b, 0xba, 0xbd, 0x5e, 0xb3, 0xb7, 0x55, 0x12, 0x76, 0x90, 0xc4, 0x3a, 0x1, 0xa7, 0x66, 0xbc, 0x3, 0x90, 0xe0, 0x8, 0xc8, 0x42, 0x29, 0xa5, 0x7b, 0xa2, 0x63, 0x9f, 0x88, 0x26, 0xa, 0x9c, 0x85, 0x6f, 0x7b, 0x2b, 0x0, 0x92, 0x51, 0x4a, 0x81, 0x5c, 0x2a, 0xcb, 0x2a, 0x47, 0x0, 0xb0, 0x2b, 0x8, 0x11, 0x62, 0x20, 0x58, 0x20, 0x47, 0x77, 0x5a, 0xe5, 0x98, 0x43, 0x3f, 0x2, 0xd8, 0xc1, 0xa5, 0x39, 0x40, 0x82, 0xb5, 0xd9, 0xd7, 0x5a, 0x2, 0x59, 0x80, 0x9, 0x8a, 0x0, 0x7f, 0x1, 0x8, 0x44, 0x8, 0x64, 0xe0, 0xe8, 0x6e, 0x4b, 0xb4, 0x87, 0xa6, 0xc4, 0x3d, 0x17, 0x24, 0xa3, 0xa8, 0xc0, 0x32, 0x8a, 0xea, 0x33, 0x67, 0x0, 0x6e, 0xc, 0x94, 0x5e, 0xe2, 0x46, 0x11, 0x3a, 0x0, 0x82, 0x57, 0x1, 0x98, 0xbf, 0xb, 0xa4, 0xf6, 0x55, 0xd4, 0x2a, 0xe1, 0x0, 0x40, 0xf5, 0xf3, 0xa5, 0xd3, 0x16, 0x6a, 0xb4, 0xa7, 0x19, 0xfa, 0x4f, 0x18, 0xe8, 0x2c, 0x34, 0xfb, 0x92, 0x20, 0xbb, 0xf, 0xa3, 0x1d, 0xc0, 0xcd, 0xe7, 0xb7, 0x83, 0xf9, 0xf2, 0x24, 0xd3, 0xd7, 0xaf, 0x40, 0x9a, 0x84, 0x1, 0xf0, 0xfe, 0xf6, 0xee, 0x1d, 0x80, 0x4f, 0xff, 0xc8, 0xdf, 0x63, 0xeb, 0xfd, 0x6f, 0x3, 0x74, 0x35, 0xa7, 0x2a, 0xf0, 0x17, 0xed, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 tree_cursor_unfocus_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0xe,0x8,0x3,0x0,0x0,0x0,0x28,0x96,0xdd,0xe3,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,0x99,0x50,0x4c,0x54,0x45,0xc0,0xb5,0xb2,0xbf,0xb4,0xb1,0xc0,0xb5,0xb2,0xbf,0xb4,0xb1,0xbf,0xb5,0xb1,0xc0,0xb5,0xb2,0xc3,0xb8,0xb5,0xc3,0xb8,0xb5,0xc2,0xb7,0xb4,0xc3,0xb8,0xb5,0xc2,0xb7,0xb4,0xc3,0xb8,0xb5,0xc2,0xb7,0xb4,0xc3,0xb8,0xb5,0xc5,0xba,0xb7,0xc5,0xbc,0xb9,0xc5,0xbc,0xb9,0xc5,0xbc,0xb9,0xc5,0xbc,0xb9,0xc5,0xba,0xb7,0xc5,0xba,0xb7,0xc6,0xbd,0xba,0xc7,0xbe,0xbb,0xc7,0xbe,0xbb,0xc6,0xbd,0xba,0xc7,0xbe,0xbb,0xc6,0xbd,0xba,0xca,0xc1,0xbe,0xca,0xc1,0xbe,0xcd,0xc4,0xc1,0xcd,0xc6,0xc3,0xd0,0xc9,0xc6,0xcf,0xc8,0xc5,0xd2,0xcb,0xc8,0xd3,0xcb,0xc9,0xd3,0xcc,0xc9,0xd5,0xcd,0xcb,0xd4,0xcc,0xca,0xd7,0xd1,0xcf,0xd6,0xd0,0xce,0xda,0xd4,0xd2,0xdd,0xd7,0xd5,0xdd,0xd7,0xd5,0x9a,0x8b,0x86,0x94,0x85,0x80,0x8e,0x80,0x7a,0x88,0x79,0x74,0x81,0x75,0x6f,0x7a,0x6f,0x6a,0x73,0x69,0x65,0x0,0x0,0x0,0xfb,0x87,0x71,0x8e,0x0,0x0,0x0,0x2b,0x74,0x52,0x4e,0x53,0x32,0x2f,0x30,0x33,0x38,0x40,0x32,0x2f,0x2f,0x31,0x33,0x33,0x36,0x38,0x31,0x2f,0x30,0x31,0x33,0x33,0x35,0x2f,0x2f,0x30,0x32,0x33,0x33,0x2f,0x30,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x2f,0x32,0x2f,0x82,0xd8,0x8a,0x2f,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x32,0x40,0xd2,0x4c,0xc8,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,0x4,0x4e,0x1d,0x2,0xaf,0x0,0x0,0x0,0x82,0x49,0x44,0x41,0x54,0x8,0xd7,0x55,0xcf,0xe9,0x16,0xc1,0x30,0x14,0x4,0xe0,0xb1,0x96,0x16,0x25,0x34,0x84,0x26,0x2d,0xaa,0xb6,0xac,0xef,0xff,0x72,0x6e,0x38,0xe,0xfd,0xe6,0xce,0x99,0xdf,0x17,0xcf,0xe,0x68,0xf4,0x48,0x7f,0x40,0x86,0x23,0xd,0x33,0x4e,0x92,0x64,0x32,0x4d,0xb3,0x2c,0x9d,0xcd,0xd,0xec,0x22,0xcf,0xf3,0xe5,0x8a,0xb1,0x35,0x63,0x1b,0xb,0x57,0xf0,0x82,0x73,0xbe,0xdd,0x9,0x21,0xf6,0xe,0xfe,0xf0,0x55,0x96,0xa5,0x47,0x90,0x91,0x52,0x4a,0x2a,0x29,0x3,0x42,0x55,0x93,0xaa,0x8e,0x53,0x5,0xf8,0x23,0x39,0x51,0xcf,0x14,0xf,0xd7,0x44,0x97,0xf7,0x35,0xe,0xb6,0xbd,0xb6,0x1f,0xb4,0x16,0xe6,0xf6,0xc7,0x40,0xdf,0x1f,0x3f,0x1a,0xdd,0x17,0x5e,0xc0,0x36,0x18,0x83,0x7f,0x54,0x76,0x87,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 tree_cursor_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xe, 0x0, 0x0, 0x0, 0xe, 0x8, 0x3, 0x0, 0x0, 0x0, 0x28, 0x96, 0xdd, 0xe3, 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, 0xc6, 0x50, 0x4c, 0x54, 0x45, 0xd4, 0xab, 0x9e, 0xd3, 0xaa, 0x9d, 0xd4, 0xab, 0x9e, 0xd3, 0xaa, 0x9d, 0xd4, 0xab, 0x9c, 0xd4, 0xac, 0x9e, 0xd5, 0xaf, 0xa3, 0xd5, 0xb0, 0xa3, 0xd5, 0xaf, 0xa3, 0xd5, 0xad, 0xa1, 0xd5, 0xaf, 0xa3, 0xd5, 0xad, 0xa1, 0xd5, 0xb0, 0xa3, 0xd6, 0xad, 0xa0, 0xd6, 0xad, 0xa0, 0xd5, 0xb0, 0xa3, 0xd7, 0xb1, 0xa5, 0xd7, 0xb1, 0xa7, 0xd7, 0xb1, 0xa7, 0xd7, 0xb1, 0xa7, 0xd7, 0xb1, 0xa7, 0xd7, 0xb1, 0xa5, 0xd7, 0xb1, 0xa5, 0xd8, 0xb3, 0xa8, 0xd8, 0xb5, 0xaa, 0xda, 0xb3, 0xa8, 0xda, 0xb3, 0xa8, 0xd8, 0xb3, 0xa8, 0xd8, 0xb5, 0xaa, 0xda, 0xb3, 0xa8, 0xd8, 0xb3, 0xa8, 0xdb, 0xb7, 0xad, 0xda, 0xb8, 0xae, 0xdb, 0xb9, 0xad, 0xdb, 0xb9, 0xad, 0xdb, 0xb7, 0xad, 0xdd, 0xba, 0xb1, 0xdd, 0xbb, 0xb1, 0xdd, 0xbd, 0xb1, 0xdd, 0xbf, 0xb3, 0xdd, 0xbd, 0xb3, 0xdf, 0xc1, 0xb7, 0xdf, 0xc0, 0xb5, 0xdf, 0xbf, 0xb5, 0xe1, 0xc3, 0xb9, 0xe1, 0xc3, 0xbb, 0xe1, 0xc5, 0xbb, 0xe2, 0xc7, 0xbe, 0xe1, 0xc5, 0xbd, 0xe4, 0xcb, 0xc2, 0xe3, 0xca, 0xc1, 0xe3, 0xcb, 0xc3, 0xe6, 0xce, 0xc6, 0xe6, 0xd0, 0xc6, 0xe8, 0xd1, 0xca, 0xe8, 0xd1, 0xca, 0xe8, 0xd0, 0xca, 0xe8, 0xcf, 0xca, 0xb7, 0x7d, 0x69, 0xb1, 0x77, 0x63, 0xac, 0x73, 0x5c, 0xa6, 0x69, 0x56, 0x9c, 0x67, 0x54, 0x93, 0x62, 0x51, 0x88, 0x60, 0x50, 0x0, 0x0, 0x0, 0x39, 0x76, 0x1d, 0xc2, 0x0, 0x0, 0x0, 0x3a, 0x74, 0x52, 0x4e, 0x53, 0x32, 0x2f, 0x30, 0x33, 0x38, 0x40, 0x32, 0x2f, 0x2f, 0x2f, 0x31, 0x33, 0x33, 0x33, 0x36, 0x38, 0x31, 0x2f, 0x30, 0x31, 0x33, 0x33, 0x35, 0x2f, 0x2f, 0x2f, 0x30, 0x32, 0x33, 0x33, 0x33, 0x2f, 0x2f, 0x2f, 0x30, 0x30, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x32, 0x2f, 0x2f, 0x2f, 0xb8, 0xf, 0x95, 0x41, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x41, 0x89, 0xde, 0x6c, 0x4e, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x9e, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x55, 0xcf, 0x5b, 0x17, 0x81, 0x40, 0x14, 0x5, 0xe0, 0xe3, 0x9a, 0x4b, 0x2e, 0x31, 0x14, 0x62, 0x22, 0x53, 0x4d, 0x83, 0x44, 0xc, 0xa6, 0xa9, 0xf9, 0xff, 0xbf, 0xca, 0xd4, 0x5a, 0x1e, 0x7c, 0xfb, 0xec, 0xb5, 0x9f, 0xf, 0x7c, 0xfe, 0x80, 0x80, 0x86, 0xd6, 0x6c, 0x69, 0xed, 0x8e, 0x80, 0xbc, 0x6b, 0x18, 0xbd, 0xfe, 0x60, 0x68, 0x9a, 0xa3, 0xf1, 0x24, 0x7, 0x39, 0xb5, 0x2c, 0x6b, 0x36, 0x47, 0x68, 0x81, 0xd0, 0x52, 0x42, 0x61, 0x3b, 0xb6, 0xb3, 0x72, 0xd6, 0x1b, 0x77, 0xeb, 0xee, 0xa, 0x28, 0x31, 0xc6, 0x9e, 0x87, 0x3d, 0xbc, 0x3f, 0xf8, 0x7e, 0x9, 0xea, 0x48, 0x8, 0x9, 0xc2, 0x28, 0x22, 0x21, 0x9, 0x14, 0x28, 0x1a, 0x33, 0x16, 0xd3, 0x98, 0xb2, 0x98, 0x51, 0x5, 0xe5, 0x49, 0x3b, 0xeb, 0x5e, 0x74, 0x4a, 0x28, 0x92, 0xca, 0xb5, 0xbe, 0xa4, 0x0, 0x99, 0xde, 0xd2, 0xca, 0xbd, 0x5a, 0x9, 0x79, 0x96, 0x3d, 0xb2, 0x9f, 0x1c, 0xc4, 0x93, 0xf3, 0x17, 0xaf, 0xfb, 0xe6, 0x2, 0xfe, 0x5f, 0xf8, 0x2, 0x30, 0xbc, 0x1f, 0xb4, 0x2b, 0xfc, 0x80, 0xca, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 tree_title_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,0x1,0x3,0x0,0x0,0x0,0x25,0x3d,0x6d,0x22,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,0x6,0x50,0x4c,0x54,0x45,0x25,0x23,0x25,0x4c,0x4a,0x4e,0x1,0xf9,0x98,0x2e,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x1,0xff,0x2,0x2d,0xde,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,0xc,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x20,0xd,0x0,0x0,0x0,0x30,0x0,0x1,0xc7,0xaa,0x85,0x8e,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 tree_cursor_unfocus_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xe, 0x0, 0x0, 0x0, 0xe, 0x8, 0x3, 0x0, 0x0, 0x0, 0x28, 0x96, 0xdd, 0xe3, 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, 0x99, 0x50, 0x4c, 0x54, 0x45, 0xc0, 0xb5, 0xb2, 0xbf, 0xb4, 0xb1, 0xc0, 0xb5, 0xb2, 0xbf, 0xb4, 0xb1, 0xbf, 0xb5, 0xb1, 0xc0, 0xb5, 0xb2, 0xc3, 0xb8, 0xb5, 0xc3, 0xb8, 0xb5, 0xc2, 0xb7, 0xb4, 0xc3, 0xb8, 0xb5, 0xc2, 0xb7, 0xb4, 0xc3, 0xb8, 0xb5, 0xc2, 0xb7, 0xb4, 0xc3, 0xb8, 0xb5, 0xc5, 0xba, 0xb7, 0xc5, 0xbc, 0xb9, 0xc5, 0xbc, 0xb9, 0xc5, 0xbc, 0xb9, 0xc5, 0xbc, 0xb9, 0xc5, 0xba, 0xb7, 0xc5, 0xba, 0xb7, 0xc6, 0xbd, 0xba, 0xc7, 0xbe, 0xbb, 0xc7, 0xbe, 0xbb, 0xc6, 0xbd, 0xba, 0xc7, 0xbe, 0xbb, 0xc6, 0xbd, 0xba, 0xca, 0xc1, 0xbe, 0xca, 0xc1, 0xbe, 0xcd, 0xc4, 0xc1, 0xcd, 0xc6, 0xc3, 0xd0, 0xc9, 0xc6, 0xcf, 0xc8, 0xc5, 0xd2, 0xcb, 0xc8, 0xd3, 0xcb, 0xc9, 0xd3, 0xcc, 0xc9, 0xd5, 0xcd, 0xcb, 0xd4, 0xcc, 0xca, 0xd7, 0xd1, 0xcf, 0xd6, 0xd0, 0xce, 0xda, 0xd4, 0xd2, 0xdd, 0xd7, 0xd5, 0xdd, 0xd7, 0xd5, 0x9a, 0x8b, 0x86, 0x94, 0x85, 0x80, 0x8e, 0x80, 0x7a, 0x88, 0x79, 0x74, 0x81, 0x75, 0x6f, 0x7a, 0x6f, 0x6a, 0x73, 0x69, 0x65, 0x0, 0x0, 0x0, 0xfb, 0x87, 0x71, 0x8e, 0x0, 0x0, 0x0, 0x2b, 0x74, 0x52, 0x4e, 0x53, 0x32, 0x2f, 0x30, 0x33, 0x38, 0x40, 0x32, 0x2f, 0x2f, 0x31, 0x33, 0x33, 0x36, 0x38, 0x31, 0x2f, 0x30, 0x31, 0x33, 0x33, 0x35, 0x2f, 0x2f, 0x30, 0x32, 0x33, 0x33, 0x2f, 0x30, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x32, 0x2f, 0x82, 0xd8, 0x8a, 0x2f, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x32, 0x40, 0xd2, 0x4c, 0xc8, 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, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x82, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x55, 0xcf, 0xe9, 0x16, 0xc1, 0x30, 0x14, 0x4, 0xe0, 0xb1, 0x96, 0x16, 0x25, 0x34, 0x84, 0x26, 0x2d, 0xaa, 0xb6, 0xac, 0xef, 0xff, 0x72, 0x6e, 0x38, 0xe, 0xfd, 0xe6, 0xce, 0x99, 0xdf, 0x17, 0xcf, 0xe, 0x68, 0xf4, 0x48, 0x7f, 0x40, 0x86, 0x23, 0xd, 0x33, 0x4e, 0x92, 0x64, 0x32, 0x4d, 0xb3, 0x2c, 0x9d, 0xcd, 0xd, 0xec, 0x22, 0xcf, 0xf3, 0xe5, 0x8a, 0xb1, 0x35, 0x63, 0x1b, 0xb, 0x57, 0xf0, 0x82, 0x73, 0xbe, 0xdd, 0x9, 0x21, 0xf6, 0xe, 0xfe, 0xf0, 0x55, 0x96, 0xa5, 0x47, 0x90, 0x91, 0x52, 0x4a, 0x2a, 0x29, 0x3, 0x42, 0x55, 0x93, 0xaa, 0x8e, 0x53, 0x5, 0xf8, 0x23, 0x39, 0x51, 0xcf, 0x14, 0xf, 0xd7, 0x44, 0x97, 0xf7, 0x35, 0xe, 0xb6, 0xbd, 0xb6, 0x1f, 0xb4, 0x16, 0xe6, 0xf6, 0xc7, 0x40, 0xdf, 0x1f, 0x3f, 0x1a, 0xdd, 0x17, 0x5e, 0xc0, 0x36, 0x18, 0x83, 0x7f, 0x54, 0x76, 0x87, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 tree_title_pressed_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,0x1,0x3,0x0,0x0,0x0,0x25,0x3d,0x6d,0x22,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,0x6,0x50,0x4c,0x54,0x45,0x36,0x34,0x36,0x4c,0x4a,0x4e,0x14,0xd7,0x5b,0xf8,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x1,0xff,0x2,0x2d,0xde,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,0xc,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x20,0xd,0x0,0x0,0x0,0x30,0x0,0x1,0xc7,0xaa,0x85,0x8e,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 tree_title_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, 0x1, 0x3, 0x0, 0x0, 0x0, 0x25, 0x3d, 0x6d, 0x22, 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, 0x6, 0x50, 0x4c, 0x54, 0x45, 0x25, 0x23, 0x25, 0x4c, 0x4a, 0x4e, 0x1, 0xf9, 0x98, 0x2e, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x1, 0xff, 0x2, 0x2d, 0xde, 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, 0xc, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x20, 0xd, 0x0, 0x0, 0x0, 0x30, 0x0, 0x1, 0xc7, 0xaa, 0x85, 0x8e, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 unchecked_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,0x36,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x38,0x37,0x40,0x20,0x20,0x24,0x20,0x20,0x24,0x38,0x36,0x40,0x20,0x20,0x25,0x1e,0x1e,0x22,0x1f,0x1f,0x23,0x20,0x20,0x24,0x22,0x22,0x27,0x23,0x23,0x28,0x25,0x25,0x2a,0xff,0xff,0xff,0xf7,0x93,0x46,0x7a,0x0,0x0,0x0,0xb,0x74,0x52,0x4e,0x53,0x0,0x7,0x27,0x50,0x66,0x68,0xb4,0xfa,0xfb,0xb4,0xfa,0xa4,0x7f,0xe1,0x5a,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x11,0xe2,0xb5,0x3d,0xba,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,0x53,0x49,0x44,0x41,0x54,0x18,0xd3,0xb5,0xcf,0xc1,0x12,0x80,0x20,0x8,0x45,0x51,0x5,0x14,0xd,0x5,0xff,0xff,0x6b,0x23,0x27,0x67,0x9a,0x6c,0xdb,0x5d,0x9e,0xd,0x8f,0x10,0xb6,0x22,0x20,0xa5,0x19,0x21,0x44,0x7,0xc8,0x2c,0x6d,0x26,0x9c,0xc1,0x1,0xb9,0xab,0xcd,0xb4,0x33,0x3a,0x90,0xe8,0xb8,0x53,0x21,0x87,0xd4,0x6c,0x81,0xb5,0xf4,0x17,0x6c,0x67,0x9f,0xc3,0xca,0x35,0xc,0x6a,0x59,0xd3,0x8f,0xa,0x5f,0xcf,0xbd,0x3a,0x1,0x93,0xe2,0x8,0xa4,0xb1,0xeb,0xd3,0x56,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 tree_title_pressed_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, 0x1, 0x3, 0x0, 0x0, 0x0, 0x25, 0x3d, 0x6d, 0x22, 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, 0x6, 0x50, 0x4c, 0x54, 0x45, 0x36, 0x34, 0x36, 0x4c, 0x4a, 0x4e, 0x14, 0xd7, 0x5b, 0xf8, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x1, 0xff, 0x2, 0x2d, 0xde, 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, 0xc, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x20, 0xd, 0x0, 0x0, 0x0, 0x30, 0x0, 0x1, 0xc7, 0xaa, 0x85, 0x8e, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 updown_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x2b,0x8a,0x3e,0x7d,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0xa6,0x49,0x44,0x41,0x54,0x28,0x91,0xa5,0x90,0x21,0xe,0xc2,0x50,0x10,0x44,0xdf,0x27,0x9b,0x10,0x2e,0xc0,0x9,0xd6,0x81,0xe3,0x6,0xe0,0xa0,0xd7,0x2d,0xae,0x18,0x24,0x95,0xc5,0x7d,0x51,0xdd,0xb,0x60,0xf6,0x67,0x31,0xfb,0x49,0xc1,0x20,0x3a,0x6a,0x93,0x99,0x9d,0xcc,0xc,0x2c,0x45,0xaa,0x47,0xce,0x79,0x2b,0x22,0x2d,0x80,0x99,0x5d,0x54,0x75,0xfa,0x8,0x82,0xec,0x80,0x7d,0xe8,0x7,0x33,0x3b,0xa9,0xea,0x94,0x82,0xbc,0x1,0x3b,0x60,0x8,0xc1,0x1e,0x78,0x9a,0xd9,0x51,0xc2,0x76,0x57,0xbf,0x0,0xaa,0x9b,0x88,0xb4,0x2b,0x77,0x7f,0x1,0x7d,0xb5,0x54,0xd5,0x29,0x84,0x7d,0x70,0x4b,0x6b,0x8e,0xe3,0x78,0x7,0x36,0x66,0x76,0xae,0xd5,0x22,0xf8,0x15,0x78,0x89,0xbb,0xaf,0x53,0x4a,0x7,0x11,0xe9,0x72,0xce,0x5f,0x21,0xdd,0xfd,0x21,0xa5,0x94,0x66,0x96,0xba,0x9b,0xd5,0x1c,0x4a,0x29,0xcd,0xff,0xa1,0x7e,0xa6,0xbe,0xc6,0xd4,0x9f,0x3c,0xcb,0xf1,0x6,0x8e,0x4e,0x65,0x44,0x6f,0x74,0x5c,0xa1,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char unchecked_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, 0x36, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x38, 0x37, 0x40, 0x20, 0x20, 0x24, 0x20, 0x20, 0x24, 0x38, 0x36, 0x40, 0x20, 0x20, 0x25, 0x1e, 0x1e, 0x22, 0x1f, 0x1f, 0x23, 0x20, 0x20, 0x24, 0x22, 0x22, 0x27, 0x23, 0x23, 0x28, 0x25, 0x25, 0x2a, 0xff, 0xff, 0xff, 0xf7, 0x93, 0x46, 0x7a, 0x0, 0x0, 0x0, 0xb, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x7, 0x27, 0x50, 0x66, 0x68, 0xb4, 0xfa, 0xfb, 0xb4, 0xfa, 0xa4, 0x7f, 0xe1, 0x5a, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x11, 0xe2, 0xb5, 0x3d, 0xba, 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, 0x53, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0xb5, 0xcf, 0xc1, 0x12, 0x80, 0x20, 0x8, 0x45, 0x51, 0x5, 0x14, 0xd, 0x5, 0xff, 0xff, 0x6b, 0x23, 0x27, 0x67, 0x9a, 0x6c, 0xdb, 0x5d, 0x9e, 0xd, 0x8f, 0x10, 0xb6, 0x22, 0x20, 0xa5, 0x19, 0x21, 0x44, 0x7, 0xc8, 0x2c, 0x6d, 0x26, 0x9c, 0xc1, 0x1, 0xb9, 0xab, 0xcd, 0xb4, 0x33, 0x3a, 0x90, 0xe8, 0xb8, 0x53, 0x21, 0x87, 0xd4, 0x6c, 0x81, 0xb5, 0xf4, 0x17, 0x6c, 0x67, 0x9f, 0xc3, 0xca, 0x35, 0xc, 0x6a, 0x59, 0xd3, 0x8f, 0xa, 0x5f, 0xcf, 0xbd, 0x3a, 0x1, 0x93, 0xe2, 0x8, 0xa4, 0xb1, 0xeb, 0xd3, 0x56, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 vseparator_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x2,0x3,0x0,0x0,0x0,0xb9,0x61,0x56,0x18,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,0xc,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x73,0x9b,0xaa,0xce,0xdc,0xe1,0xff,0xff,0xff,0x64,0x6c,0x1,0xd2,0x0,0x0,0x0,0x3,0x74,0x52,0x4e,0x53,0x0,0xb3,0xb3,0x67,0xf6,0xdb,0x93,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x3,0x11,0xc,0x4c,0xf2,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,0x10,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x80,0x81,0xac,0x95,0xc,0x48,0x0,0x0,0xe,0x79,0x1,0x14,0xa1,0xc9,0x59,0x2,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 updown_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x10, 0x8, 0x6, 0x0, 0x0, 0x0, 0x2b, 0x8a, 0x3e, 0x7d, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0xa6, 0x49, 0x44, 0x41, 0x54, 0x28, 0x91, 0xa5, 0x90, 0x21, 0xe, 0xc2, 0x50, 0x10, 0x44, 0xdf, 0x27, 0x9b, 0x10, 0x2e, 0xc0, 0x9, 0xd6, 0x81, 0xe3, 0x6, 0xe0, 0xa0, 0xd7, 0x2d, 0xae, 0x18, 0x24, 0x95, 0xc5, 0x7d, 0x51, 0xdd, 0xb, 0x60, 0xf6, 0x67, 0x31, 0xfb, 0x49, 0xc1, 0x20, 0x3a, 0x6a, 0x93, 0x99, 0x9d, 0xcc, 0xc, 0x2c, 0x45, 0xaa, 0x47, 0xce, 0x79, 0x2b, 0x22, 0x2d, 0x80, 0x99, 0x5d, 0x54, 0x75, 0xfa, 0x8, 0x82, 0xec, 0x80, 0x7d, 0xe8, 0x7, 0x33, 0x3b, 0xa9, 0xea, 0x94, 0x82, 0xbc, 0x1, 0x3b, 0x60, 0x8, 0xc1, 0x1e, 0x78, 0x9a, 0xd9, 0x51, 0xc2, 0x76, 0x57, 0xbf, 0x0, 0xaa, 0x9b, 0x88, 0xb4, 0x2b, 0x77, 0x7f, 0x1, 0x7d, 0xb5, 0x54, 0xd5, 0x29, 0x84, 0x7d, 0x70, 0x4b, 0x6b, 0x8e, 0xe3, 0x78, 0x7, 0x36, 0x66, 0x76, 0xae, 0xd5, 0x22, 0xf8, 0x15, 0x78, 0x89, 0xbb, 0xaf, 0x53, 0x4a, 0x7, 0x11, 0xe9, 0x72, 0xce, 0x5f, 0x21, 0xdd, 0xfd, 0x21, 0xa5, 0x94, 0x66, 0x96, 0xba, 0x9b, 0xd5, 0x1c, 0x4a, 0x29, 0xcd, 0xff, 0xa1, 0x7e, 0xa6, 0xbe, 0xc6, 0xd4, 0x9f, 0x3c, 0xcb, 0xf1, 0x6, 0x8e, 0x4e, 0x65, 0x44, 0x6f, 0x74, 0x5c, 0xa1, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char vslider_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,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,0x54,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x4d,0x4b,0x59,0x34,0x33,0x3a,0x2d,0x2c,0x32,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x4d,0x4b,0x59,0x3f,0x3e,0x49,0x2a,0x29,0x2f,0x20,0x20,0x24,0x3f,0x3e,0x49,0x3f,0x3e,0x49,0x1f,0x1f,0x24,0x40,0x3e,0x4a,0x20,0x20,0x24,0x34,0x33,0x3a,0x20,0x20,0x25,0x22,0x22,0x27,0x23,0x23,0x28,0x25,0x25,0x2a,0x1e,0x1e,0x23,0x23,0x23,0x27,0x2d,0x2c,0x32,0x1f,0x1f,0x23,0xff,0xff,0xff,0x3,0x35,0xf1,0x5f,0x0,0x0,0x0,0x13,0x74,0x52,0x4e,0x53,0x0,0x0,0x0,0x0,0x4,0x1a,0x40,0x5d,0x19,0x28,0x96,0xf0,0xfd,0x94,0x95,0xfc,0x93,0xfc,0xc0,0x0,0xb4,0xa,0x5f,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x1b,0x2,0x60,0xd4,0xa4,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,0x64,0x49,0x44,0x41,0x54,0x18,0xd3,0x9d,0xcf,0x39,0x2,0x80,0x20,0x10,0x3,0xc0,0xe5,0x90,0x43,0x50,0x94,0x1b,0xfe,0xff,0x50,0x5,0x69,0x94,0xce,0x94,0x53,0xec,0x26,0x0,0x0,0x88,0x2e,0x8c,0x73,0x26,0x28,0x82,0x1e,0x44,0xe5,0xaa,0xb4,0x56,0x9b,0x1c,0x82,0xc4,0x6e,0x9c,0xf7,0xce,0x1c,0x62,0x0,0x53,0x2e,0xc4,0x18,0x9c,0x62,0x3,0xb8,0xf6,0xf1,0x8e,0x3f,0xf9,0x3,0xd8,0xa6,0xdc,0x20,0x27,0x8b,0x3b,0x90,0x52,0x43,0x83,0x50,0xb,0xf9,0xb,0xd3,0xd1,0xe9,0xed,0x5c,0x6c,0xaa,0xfe,0x1d,0xf7,0x9e,0x7f,0x1,0x89,0x5c,0xa,0x6b,0x1f,0xe5,0xca,0x60,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 vseparator_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x2, 0x3, 0x0, 0x0, 0x0, 0xb9, 0x61, 0x56, 0x18, 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, 0xc, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x73, 0x9b, 0xaa, 0xce, 0xdc, 0xe1, 0xff, 0xff, 0xff, 0x64, 0x6c, 0x1, 0xd2, 0x0, 0x0, 0x0, 0x3, 0x74, 0x52, 0x4e, 0x53, 0x0, 0xb3, 0xb3, 0x67, 0xf6, 0xdb, 0x93, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x3, 0x11, 0xc, 0x4c, 0xf2, 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, 0x10, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x80, 0x81, 0xac, 0x95, 0xc, 0x48, 0x0, 0x0, 0xe, 0x79, 0x1, 0x14, 0xa1, 0xc9, 0x59, 0x2, 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 vslider_grabber_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,0x4,0x0,0x0,0x0,0xb5,0xfa,0x37,0xea,0x0,0x0,0x0,0x2,0x62,0x4b,0x47,0x44,0x0,0xb7,0xff,0x88,0x5,0x1d,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,0xe1,0x1,0x12,0x1,0x36,0x8,0x50,0xb9,0xa7,0x53,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x0,0xf6,0x49,0x44,0x41,0x54,0x28,0xcf,0xbd,0x90,0xb1,0x4a,0x42,0x51,0x0,0x86,0xbf,0x73,0x8e,0x71,0xe5,0x9a,0x5c,0x41,0xd0,0x66,0x6b,0x33,0x1c,0x7c,0x80,0xa0,0xa5,0x17,0x8,0xa2,0x2d,0x84,0xf0,0x1,0xa2,0x25,0xf1,0x9,0x9a,0x1c,0xda,0x5b,0xb2,0x47,0xa8,0xa5,0xc1,0xa0,0x51,0x88,0xa2,0x29,0xa,0xc1,0x84,0x8,0x43,0xf4,0x96,0x17,0xcf,0xed,0xde,0x73,0x9c,0xcc,0x5c,0xda,0xea,0x9f,0x3f,0xfe,0x9f,0xef,0x87,0x3f,0x8f,0x0,0x40,0xe1,0xe2,0x91,0x42,0x10,0x32,0xe6,0x3,0x8d,0xc1,0xce,0x1,0x45,0xb6,0xba,0xbb,0xba,0xed,0x95,0x8c,0xd0,0x7d,0xff,0xe1,0xee,0xe2,0xb6,0xdd,0x79,0x61,0xc4,0xd7,0xc,0x48,0x57,0x2b,0xeb,0xb5,0x28,0xaf,0x1,0xc5,0x12,0x4e,0xac,0x7b,0x6f,0x57,0x27,0x8d,0xcf,0xe,0x1,0x56,0x1,0xb9,0x9d,0xba,0x28,0x6,0x18,0xc,0x31,0x21,0x5a,0xda,0x4c,0xb6,0xbc,0xb9,0x35,0x7c,0xea,0xbd,0x13,0x4a,0x20,0xe5,0x95,0xf4,0x6c,0x12,0x30,0x84,0xf8,0x44,0x6b,0xfb,0xcd,0x83,0x3d,0x1c,0xf9,0x8b,0x80,0x4a,0xba,0x88,0x4,0x30,0x1e,0xdd,0x3b,0x1b,0xf1,0x77,0x87,0x24,0x81,0x8b,0x79,0x3e,0x3b,0x6a,0x5d,0x33,0x51,0x80,0x2d,0x38,0x2b,0x65,0xb5,0x6c,0x91,0x28,0x92,0xa4,0xad,0xec,0x76,0xcf,0x8f,0xf,0x1f,0xdb,0xc,0x31,0xb,0x9a,0xb1,0xd0,0x3,0xfb,0xda,0x3a,0xbd,0xbc,0x89,0xfa,0xf8,0x73,0xcd,0x9f,0x47,0x45,0x4,0xf8,0x4,0x18,0xfe,0x2f,0x53,0x8,0x62,0x5c,0xcf,0x1f,0x5f,0xcb,0x2c,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char vslider_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 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, 0x54, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x4d, 0x4b, 0x59, 0x34, 0x33, 0x3a, 0x2d, 0x2c, 0x32, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x4d, 0x4b, 0x59, 0x3f, 0x3e, 0x49, 0x2a, 0x29, 0x2f, 0x20, 0x20, 0x24, 0x3f, 0x3e, 0x49, 0x3f, 0x3e, 0x49, 0x1f, 0x1f, 0x24, 0x40, 0x3e, 0x4a, 0x20, 0x20, 0x24, 0x34, 0x33, 0x3a, 0x20, 0x20, 0x25, 0x22, 0x22, 0x27, 0x23, 0x23, 0x28, 0x25, 0x25, 0x2a, 0x1e, 0x1e, 0x23, 0x23, 0x23, 0x27, 0x2d, 0x2c, 0x32, 0x1f, 0x1f, 0x23, 0xff, 0xff, 0xff, 0x3, 0x35, 0xf1, 0x5f, 0x0, 0x0, 0x0, 0x13, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x0, 0x0, 0x0, 0x4, 0x1a, 0x40, 0x5d, 0x19, 0x28, 0x96, 0xf0, 0xfd, 0x94, 0x95, 0xfc, 0x93, 0xfc, 0xc0, 0x0, 0xb4, 0xa, 0x5f, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x1b, 0x2, 0x60, 0xd4, 0xa4, 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, 0x64, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x9d, 0xcf, 0x39, 0x2, 0x80, 0x20, 0x10, 0x3, 0xc0, 0xe5, 0x90, 0x43, 0x50, 0x94, 0x1b, 0xfe, 0xff, 0x50, 0x5, 0x69, 0x94, 0xce, 0x94, 0x53, 0xec, 0x26, 0x0, 0x0, 0x88, 0x2e, 0x8c, 0x73, 0x26, 0x28, 0x82, 0x1e, 0x44, 0xe5, 0xaa, 0xb4, 0x56, 0x9b, 0x1c, 0x82, 0xc4, 0x6e, 0x9c, 0xf7, 0xce, 0x1c, 0x62, 0x0, 0x53, 0x2e, 0xc4, 0x18, 0x9c, 0x62, 0x3, 0xb8, 0xf6, 0xf1, 0x8e, 0x3f, 0xf9, 0x3, 0xd8, 0xa6, 0xdc, 0x20, 0x27, 0x8b, 0x3b, 0x90, 0x52, 0x43, 0x83, 0x50, 0xb, 0xf9, 0xb, 0xd3, 0xd1, 0xe9, 0xed, 0x5c, 0x6c, 0xaa, 0xfe, 0x1d, 0xf7, 0x9e, 0x7f, 0x1, 0x89, 0x5c, 0xa, 0x6b, 0x1f, 0xe5, 0xca, 0x60, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 vslider_grabber_hl_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,0xc3,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,0x17,0x2a,0x29,0x3a,0x69,0x69,0x5b,0xa6,0xa5,0x61,0xb3,0xbc,0x63,0xb7,0xc8,0x65,0xbb,0xca,0x60,0xaf,0xb1,0x48,0x83,0x83,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0xf,0xf,0x55,0x9b,0x9a,0x60,0xb2,0xbd,0x5e,0xb1,0xcd,0x61,0xb3,0xc2,0x0,0x0,0x0,0x27,0x48,0x47,0x62,0xb4,0xbd,0x51,0x93,0x92,0x68,0xc0,0xcf,0x0,0x0,0x0,0x56,0x9d,0x9c,0x68,0xc1,0xcf,0x2d,0x52,0x52,0x63,0xb7,0xbf,0x52,0x96,0x95,0x62,0xb3,0xbf,0x5e,0xb0,0xcd,0x0,0x0,0x0,0x3,0x5,0x5,0x36,0x63,0x63,0x63,0xb4,0xb6,0x60,0xb1,0xbc,0x63,0xb7,0xc7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x55,0xa3,0xc8,0x4f,0x98,0xc4,0x4b,0x93,0xc2,0x4c,0x94,0xc2,0x54,0xa2,0xc8,0x5a,0xab,0xcb,0x4e,0x97,0xc4,0x49,0x8f,0xc0,0x47,0x8c,0xbf,0x48,0x8e,0xc0,0x52,0x9e,0xc6,0x51,0x9d,0xc6,0x5a,0xac,0xcc,0x53,0x9f,0xc7,0x4d,0x96,0xc3,0x4b,0x92,0xc2,0xff,0xff,0xff,0x76,0xbd,0x27,0x7a,0x0,0x0,0x0,0x1,0x74,0x52,0x4e,0x53,0x0,0x40,0xe6,0xd8,0x66,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x0,0x88,0x5,0x1d,0x48,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,0xe1,0x1,0x12,0x1,0x36,0x11,0x34,0xd2,0xf,0x93,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x0,0x48,0x49,0x44,0x41,0x54,0x18,0xd3,0x63,0x60,0xa0,0x12,0x10,0x14,0xe0,0xe7,0xe3,0x45,0xe2,0x4b,0x9a,0x18,0x1b,0x19,0x1a,0x48,0x88,0x8b,0xc1,0xe4,0x4d,0x2c,0x2d,0x80,0xc0,0xdc,0xcc,0x54,0x6,0x22,0x20,0x60,0x6c,0x1,0x1,0xe6,0x56,0x72,0x68,0x2,0xd6,0x8a,0xa8,0x5a,0x6c,0x94,0x11,0x86,0xda,0xdb,0xd9,0xaa,0xa9,0xaa,0x20,0x59,0xab,0xa3,0xad,0xc5,0x40,0x3d,0x0,0x0,0xbf,0x8e,0xc,0xed,0xed,0xc7,0x67,0x72,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char vslider_grabber_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, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 0x0, 0x0, 0x0, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xb7, 0xff, 0x88, 0x5, 0x1d, 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, 0xe1, 0x1, 0x12, 0x1, 0x36, 0x8, 0x50, 0xb9, 0xa7, 0x53, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x0, 0xf6, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0xbd, 0x90, 0xb1, 0x4a, 0x42, 0x51, 0x0, 0x86, 0xbf, 0x73, 0x8e, 0x71, 0xe5, 0x9a, 0x5c, 0x41, 0xd0, 0x66, 0x6b, 0x33, 0x1c, 0x7c, 0x80, 0xa0, 0xa5, 0x17, 0x8, 0xa2, 0x2d, 0x84, 0xf0, 0x1, 0xa2, 0x25, 0xf1, 0x9, 0x9a, 0x1c, 0xda, 0x5b, 0xb2, 0x47, 0xa8, 0xa5, 0xc1, 0xa0, 0x51, 0x88, 0xa2, 0x29, 0xa, 0xc1, 0x84, 0x8, 0x43, 0xf4, 0x96, 0x17, 0xcf, 0xed, 0xde, 0x73, 0x9c, 0xcc, 0x5c, 0xda, 0xea, 0x9f, 0x3f, 0xfe, 0x9f, 0xef, 0x87, 0x3f, 0x8f, 0x0, 0x40, 0xe1, 0xe2, 0x91, 0x42, 0x10, 0x32, 0xe6, 0x3, 0x8d, 0xc1, 0xce, 0x1, 0x45, 0xb6, 0xba, 0xbb, 0xba, 0xed, 0x95, 0x8c, 0xd0, 0x7d, 0xff, 0xe1, 0xee, 0xe2, 0xb6, 0xdd, 0x79, 0x61, 0xc4, 0xd7, 0xc, 0x48, 0x57, 0x2b, 0xeb, 0xb5, 0x28, 0xaf, 0x1, 0xc5, 0x12, 0x4e, 0xac, 0x7b, 0x6f, 0x57, 0x27, 0x8d, 0xcf, 0xe, 0x1, 0x56, 0x1, 0xb9, 0x9d, 0xba, 0x28, 0x6, 0x18, 0xc, 0x31, 0x21, 0x5a, 0xda, 0x4c, 0xb6, 0xbc, 0xb9, 0x35, 0x7c, 0xea, 0xbd, 0x13, 0x4a, 0x20, 0xe5, 0x95, 0xf4, 0x6c, 0x12, 0x30, 0x84, 0xf8, 0x44, 0x6b, 0xfb, 0xcd, 0x83, 0x3d, 0x1c, 0xf9, 0x8b, 0x80, 0x4a, 0xba, 0x88, 0x4, 0x30, 0x1e, 0xdd, 0x3b, 0x1b, 0xf1, 0x77, 0x87, 0x24, 0x81, 0x8b, 0x79, 0x3e, 0x3b, 0x6a, 0x5d, 0x33, 0x51, 0x80, 0x2d, 0x38, 0x2b, 0x65, 0xb5, 0x6c, 0x91, 0x28, 0x92, 0xa4, 0xad, 0xec, 0x76, 0xcf, 0x8f, 0xf, 0x1f, 0xdb, 0xc, 0x31, 0xb, 0x9a, 0xb1, 0xd0, 0x3, 0xfb, 0xda, 0x3a, 0xbd, 0xbc, 0x89, 0xfa, 0xf8, 0x73, 0xcd, 0x9f, 0x47, 0x45, 0x4, 0xf8, 0x4, 0x18, 0xfe, 0x2f, 0x53, 0x8, 0x62, 0x5c, 0xcf, 0x1f, 0x5f, 0xcb, 0x2c, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char vslider_tick_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x4,0x4,0x3,0x0,0x0,0x0,0x75,0x9a,0xa2,0xdf,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,0x1e,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x81,0xa2,0xad,0x8c,0xac,0xb8,0x38,0x55,0x5f,0x82,0x82,0x82,0x8d,0x8d,0x8d,0x98,0x98,0x98,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0xff,0xff,0xff,0xe1,0x56,0x59,0xc8,0x0,0x0,0x0,0x9,0x74,0x52,0x4e,0x53,0x0,0x0,0x0,0x0,0x79,0x79,0x79,0x31,0x1c,0x18,0xed,0xfe,0x2b,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x9,0xf1,0xd9,0xa5,0xec,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,0x1d,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x80,0x1,0xd7,0x44,0x5,0x6,0x6,0xe6,0x92,0x30,0x86,0xf2,0x62,0x3,0x20,0xa3,0xbd,0x1c,0x2e,0x3,0x0,0x3f,0xce,0x3,0xaf,0xf9,0x94,0x50,0x96,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 vslider_grabber_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, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 0x0, 0x0, 0x0, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 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, 0xe1, 0x7, 0xa, 0x13, 0x2e, 0x39, 0x86, 0x33, 0xc2, 0xfe, 0x0, 0x0, 0x0, 0x1d, 0x69, 0x54, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x0, 0x0, 0x0, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x64, 0x2e, 0x65, 0x7, 0x0, 0x0, 0x0, 0xb7, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x63, 0x60, 0xa0, 0x13, 0x60, 0x66, 0xe0, 0x65, 0x90, 0x61, 0x50, 0x67, 0xd0, 0x60, 0x50, 0x62, 0x10, 0x67, 0xe0, 0x2, 0xf2, 0x19, 0x51, 0xa5, 0xc5, 0x8c, 0xf3, 0x5c, 0xf, 0xfa, 0xbc, 0xf7, 0xfe, 0xe0, 0x71, 0xdb, 0x71, 0xbd, 0x66, 0xaa, 0xa0, 0x21, 0x83, 0x8, 0x3, 0x2b, 0x42, 0x1, 0xaf, 0x71, 0x9e, 0xe7, 0xb, 0xf7, 0xff, 0x2e, 0x40, 0xe8, 0xfa, 0xdf, 0xe3, 0xbf, 0xf7, 0x1f, 0x8f, 0x7, 0x36, 0x73, 0xd8, 0x74, 0x18, 0xb8, 0x61, 0xe6, 0xc8, 0xb8, 0x1e, 0x74, 0xff, 0xef, 0x4, 0x87, 0xce, 0x40, 0x65, 0x5e, 0xff, 0x3d, 0x6e, 0xcb, 0xf8, 0x3, 0xcd, 0x61, 0x1, 0x29, 0x50, 0xf7, 0x79, 0xef, 0x82, 0xa4, 0x0, 0xa2, 0xc8, 0xed, 0xbf, 0xdf, 0x17, 0xcb, 0x62, 0xa0, 0x29, 0x78, 0x14, 0x7c, 0xb7, 0xad, 0x65, 0xe0, 0xc1, 0x69, 0x85, 0xe7, 0x1d, 0x85, 0x50, 0x6, 0x31, 0x88, 0x15, 0x48, 0x8e, 0x74, 0xf9, 0xef, 0xfe, 0xdf, 0xfb, 0x9f, 0xe7, 0x3, 0xab, 0xa9, 0x40, 0x47, 0xf2, 0xc0, 0x1c, 0x89, 0xe4, 0x4d, 0xf7, 0x7b, 0xee, 0x47, 0xd5, 0x53, 0x98, 0x34, 0x18, 0x84, 0x91, 0xbd, 0x89, 0x1c, 0x50, 0x2a, 0xc, 0x52, 0x40, 0x9d, 0x4c, 0xc, 0xf4, 0x4, 0x0, 0xf1, 0x9, 0x63, 0x9b, 0x3e, 0x2a, 0x19, 0x52, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char vsplit_bg_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x1,0x3,0x0,0x0,0x0,0xfe,0xc1,0x2c,0xc8,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,0x6,0x50,0x4c,0x54,0x45,0x27,0x27,0x29,0xff,0xff,0xff,0x11,0xab,0xb9,0xf3,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x1,0xff,0x2,0x2d,0xde,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,0xb,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x40,0x5,0x0,0x0,0x10,0x0,0x1,0xa1,0xc5,0x21,0xc1,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 vslider_grabber_hl_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, 0xc3, 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, 0x17, 0x2a, 0x29, 0x3a, 0x69, 0x69, 0x5b, 0xa6, 0xa5, 0x61, 0xb3, 0xbc, 0x63, 0xb7, 0xc8, 0x65, 0xbb, 0xca, 0x60, 0xaf, 0xb1, 0x48, 0x83, 0x83, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xf, 0xf, 0x55, 0x9b, 0x9a, 0x60, 0xb2, 0xbd, 0x5e, 0xb1, 0xcd, 0x61, 0xb3, 0xc2, 0x0, 0x0, 0x0, 0x27, 0x48, 0x47, 0x62, 0xb4, 0xbd, 0x51, 0x93, 0x92, 0x68, 0xc0, 0xcf, 0x0, 0x0, 0x0, 0x56, 0x9d, 0x9c, 0x68, 0xc1, 0xcf, 0x2d, 0x52, 0x52, 0x63, 0xb7, 0xbf, 0x52, 0x96, 0x95, 0x62, 0xb3, 0xbf, 0x5e, 0xb0, 0xcd, 0x0, 0x0, 0x0, 0x3, 0x5, 0x5, 0x36, 0x63, 0x63, 0x63, 0xb4, 0xb6, 0x60, 0xb1, 0xbc, 0x63, 0xb7, 0xc7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x55, 0xa3, 0xc8, 0x4f, 0x98, 0xc4, 0x4b, 0x93, 0xc2, 0x4c, 0x94, 0xc2, 0x54, 0xa2, 0xc8, 0x5a, 0xab, 0xcb, 0x4e, 0x97, 0xc4, 0x49, 0x8f, 0xc0, 0x47, 0x8c, 0xbf, 0x48, 0x8e, 0xc0, 0x52, 0x9e, 0xc6, 0x51, 0x9d, 0xc6, 0x5a, 0xac, 0xcc, 0x53, 0x9f, 0xc7, 0x4d, 0x96, 0xc3, 0x4b, 0x92, 0xc2, 0xff, 0xff, 0xff, 0x76, 0xbd, 0x27, 0x7a, 0x0, 0x0, 0x0, 0x1, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x40, 0xe6, 0xd8, 0x66, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x0, 0x88, 0x5, 0x1d, 0x48, 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, 0xe1, 0x1, 0x12, 0x1, 0x36, 0x11, 0x34, 0xd2, 0xf, 0x93, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x0, 0x48, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x63, 0x60, 0xa0, 0x12, 0x10, 0x14, 0xe0, 0xe7, 0xe3, 0x45, 0xe2, 0x4b, 0x9a, 0x18, 0x1b, 0x19, 0x1a, 0x48, 0x88, 0x8b, 0xc1, 0xe4, 0x4d, 0x2c, 0x2d, 0x80, 0xc0, 0xdc, 0xcc, 0x54, 0x6, 0x22, 0x20, 0x60, 0x6c, 0x1, 0x1, 0xe6, 0x56, 0x72, 0x68, 0x2, 0xd6, 0x8a, 0xa8, 0x5a, 0x6c, 0x94, 0x11, 0x86, 0xda, 0xdb, 0xd9, 0xaa, 0xa9, 0xaa, 0x20, 0x59, 0xab, 0xa3, 0xad, 0xc5, 0x40, 0x3d, 0x0, 0x0, 0xbf, 0x8e, 0xc, 0xed, 0xed, 0xc7, 0x67, 0x72, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
-
-static const unsigned char vsplitter_png[]={
-0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x8,0x8,0x0,0x0,0x0,0x0,0x6c,0x9,0xa6,0x3,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,0x2,0x74,0x52,0x4e,0x53,0x0,0x0,0x76,0x93,0xcd,0x38,0x0,0x0,0x0,0x2,0x62,0x4b,0x47,0x44,0x0,0xff,0x87,0x8f,0xcc,0xbf,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,0x1f,0x49,0x44,0x41,0x54,0x28,0xcf,0x63,0x60,0xa0,0x10,0x30,0x33,0x2c,0x10,0x3d,0x47,0x9,0x66,0x66,0x10,0xbd,0xf6,0x98,0x22,0x3c,0xe0,0x60,0x18,0x84,0x1,0x0,0x59,0x34,0x6a,0x2d,0x64,0xeb,0x72,0x24,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,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 vslider_tick_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x4, 0x4, 0x3, 0x0, 0x0, 0x0, 0x75, 0x9a, 0xa2, 0xdf, 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, 0x1e, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x81, 0xa2, 0xad, 0x8c, 0xac, 0xb8, 0x38, 0x55, 0x5f, 0x82, 0x82, 0x82, 0x8d, 0x8d, 0x8d, 0x98, 0x98, 0x98, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0xff, 0xff, 0xff, 0xe1, 0x56, 0x59, 0xc8, 0x0, 0x0, 0x0, 0x9, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x0, 0x0, 0x0, 0x79, 0x79, 0x79, 0x31, 0x1c, 0x18, 0xed, 0xfe, 0x2b, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x9, 0xf1, 0xd9, 0xa5, 0xec, 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, 0x1d, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x80, 0x1, 0xd7, 0x44, 0x5, 0x6, 0x6, 0xe6, 0x92, 0x30, 0x86, 0xf2, 0x62, 0x3, 0x20, 0xa3, 0xbd, 0x1c, 0x2e, 0x3, 0x0, 0x3f, 0xce, 0x3, 0xaf, 0xf9, 0x94, 0x50, 0x96, 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 window_resizer_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,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xe0,0x8,0x19,0x11,0x33,0x13,0xaa,0xc0,0xf,0x5f,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x0,0x2f,0x49,0x44,0x41,0x54,0x38,0xcb,0x63,0x60,0x18,0x5,0x24,0x81,0x17,0x2f,0x5e,0xf4,0xa3,0x8b,0x31,0x91,0xa2,0xb9,0xb9,0xb9,0x99,0x7c,0x9b,0xb3,0xb3,0xb3,0xfb,0x87,0x81,0x66,0x6c,0x81,0x48,0x92,0x66,0xa2,0x5c,0x43,0x91,0xe6,0x11,0xa,0x0,0x73,0x5b,0x34,0x19,0x10,0xa0,0xb6,0x7d,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+static const unsigned char vsplit_bg_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0x1, 0x3, 0x0, 0x0, 0x0, 0xfe, 0xc1, 0x2c, 0xc8, 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, 0x6, 0x50, 0x4c, 0x54, 0x45, 0x27, 0x27, 0x29, 0xff, 0xff, 0xff, 0x11, 0xab, 0xb9, 0xf3, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x1, 0xff, 0x2, 0x2d, 0xde, 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, 0xb, 0x49, 0x44, 0x41, 0x54, 0x8, 0xd7, 0x63, 0x60, 0x40, 0x5, 0x0, 0x0, 0x10, 0x0, 0x1, 0xa1, 0xc5, 0x21, 0xc1, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 vsplitter_png[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x8, 0x8, 0x0, 0x0, 0x0, 0x0, 0x6c, 0x9, 0xa6, 0x3, 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, 0x2, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x0, 0x76, 0x93, 0xcd, 0x38, 0x0, 0x0, 0x0, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 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, 0x1f, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x63, 0x60, 0xa0, 0x10, 0x30, 0x33, 0x2c, 0x10, 0x3d, 0x47, 0x9, 0x66, 0x66, 0x10, 0xbd, 0xf6, 0x98, 0x22, 0x3c, 0xe0, 0x60, 0x18, 0x84, 0x1, 0x0, 0x59, 0x34, 0x6a, 0x2d, 0x64, 0xeb, 0x72, 0x24, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 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 window_resizer_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, 0x13, 0x0, 0x0, 0xb, 0x13, 0x1, 0x0, 0x9a, 0x9c, 0x18, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xe0, 0x8, 0x19, 0x11, 0x33, 0x13, 0xaa, 0xc0, 0xf, 0x5f, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x0, 0x2f, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x63, 0x60, 0x18, 0x5, 0x24, 0x81, 0x17, 0x2f, 0x5e, 0xf4, 0xa3, 0x8b, 0x31, 0x91, 0xa2, 0xb9, 0xb9, 0xb9, 0x99, 0x7c, 0x9b, 0xb3, 0xb3, 0xb3, 0xfb, 0x87, 0x81, 0x66, 0x6c, 0x81, 0x48, 0x92, 0x66, 0xa2, 0x5c, 0x43, 0x91, 0xe6, 0x11, 0xa, 0x0, 0x73, 0x5b, 0x34, 0x19, 0x10, 0xa0, 0xb6, 0x7d, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
+};
-
-
+// shaders block
diff --git a/scene/resources/default_theme/vslider_grabber_disabled.png b/scene/resources/default_theme/vslider_grabber_disabled.png
new file mode 100644
index 0000000000..c830359f45
--- /dev/null
+++ b/scene/resources/default_theme/vslider_grabber_disabled.png
Binary files differ
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index 3fbfbc705a..fc0d80a9b7 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -42,10 +43,10 @@ bool DynamicFontData::CacheID::operator<(CacheID right) const {
return false;
}
-Ref<DynamicFontAtSize> DynamicFontData::_get_dynamic_font_at_size(CacheID p_id) {
+Ref<DynamicFontAtSize> DynamicFontData::_get_dynamic_font_at_size(CacheID p_cache_id) {
- if (size_cache.has(p_id)) {
- return Ref<DynamicFontAtSize>(size_cache[p_id]);
+ if (size_cache.has(p_cache_id)) {
+ return Ref<DynamicFontAtSize>(size_cache[p_cache_id]);
}
Ref<DynamicFontAtSize> dfas;
@@ -54,8 +55,8 @@ Ref<DynamicFontAtSize> DynamicFontData::_get_dynamic_font_at_size(CacheID p_id)
dfas->font = Ref<DynamicFontData>(this);
- size_cache[p_id] = dfas.ptr();
- dfas->id = p_id;
+ size_cache[p_cache_id] = dfas.ptr();
+ dfas->id = p_cache_id;
dfas->_load();
return dfas;
@@ -337,7 +338,7 @@ float DynamicFontAtSize::draw_char(RID p_canvas_item, const Point2 &p_pos, CharT
cpos.y += ch->v_align;
ERR_FAIL_COND_V(ch->texture_idx < -1 || ch->texture_idx >= fb->textures.size(), 0);
if (ch->texture_idx != -1)
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, ch->rect.size), fb->textures[ch->texture_idx].texture->get_rid(), ch->rect, p_modulate);
+ VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, ch->rect.size), fb->textures[ch->texture_idx].texture->get_rid(), ch->rect, p_modulate, false, RID(), false);
advance = ch->advance;
used_fallback = true;
break;
@@ -359,7 +360,7 @@ float DynamicFontAtSize::draw_char(RID p_canvas_item, const Point2 &p_pos, CharT
cpos.y += c->v_align;
ERR_FAIL_COND_V(c->texture_idx < -1 || c->texture_idx >= textures.size(), 0);
if (c->texture_idx != -1)
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, c->rect.size), textures[c->texture_idx].texture->get_rid(), c->rect, p_modulate);
+ VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, c->rect.size), textures[c->texture_idx].texture->get_rid(), c->rect, p_modulate, false, RID(), false);
advance = c->advance;
//textures[c->texture_idx].texture->draw(p_canvas_item,Vector2());
}
@@ -568,7 +569,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) {
//blit to image and texture
{
- Image img(tex.texture_size, tex.texture_size, 0, Image::FORMAT_LA8, tex.imgdata);
+ Ref<Image> img = memnew(Image(tex.texture_size, tex.texture_size, 0, Image::FORMAT_LA8, tex.imgdata));
if (tex.texture.is_null()) {
tex.texture.instance();
@@ -860,8 +861,8 @@ void DynamicFont::_get_property_list(List<PropertyInfo> *p_list) const {
void DynamicFont::_bind_methods() {
- 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(D_METHOD("set_font_data", "data"), &DynamicFont::set_font_data);
+ ClassDB::bind_method(D_METHOD("get_font_data"), &DynamicFont::get_font_data);
ClassDB::bind_method(D_METHOD("set_size", "data"), &DynamicFont::set_size);
ClassDB::bind_method(D_METHOD("get_size"), &DynamicFont::get_size);
@@ -873,9 +874,9 @@ void DynamicFont::_bind_methods() {
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(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("add_fallback", "data"), &DynamicFont::add_fallback);
+ ClassDB::bind_method(D_METHOD("set_fallback", "idx", "data"), &DynamicFont::set_fallback);
+ ClassDB::bind_method(D_METHOD("get_fallback", "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);
diff --git a/scene/resources/dynamic_font.h b/scene/resources/dynamic_font.h
index 4243ab2c03..9024761b96 100644
--- a/scene/resources/dynamic_font.h
+++ b/scene/resources/dynamic_font.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -71,7 +72,7 @@ private:
friend class DynamicFont;
- Ref<DynamicFontAtSize> _get_dynamic_font_at_size(CacheID p_cache);
+ Ref<DynamicFontAtSize> _get_dynamic_font_at_size(CacheID p_cache_id);
protected:
static void _bind_methods();
diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp
index 7b62ccc369..8efad94b9a 100644
--- a/scene/resources/dynamic_font_stb.cpp
+++ b/scene/resources/dynamic_font_stb.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,7 +33,6 @@
#define STB_TRUETYPE_IMPLEMENTATION
#include "os/file_access.h"
-#include "stb_truetype.h"
void DynamicFontData::lock() {
@@ -386,8 +386,8 @@ DynamicFontAtSize::~DynamicFontAtSize() {
void DynamicFont::_bind_methods() {
- 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(D_METHOD("set_font_data", "data"), &DynamicFont::set_font_data);
+ ClassDB::bind_method(D_METHOD("get_font_data"), &DynamicFont::get_font_data);
ClassDB::bind_method(D_METHOD("set_size", "data"), &DynamicFont::set_size);
ClassDB::bind_method(D_METHOD("get_size"), &DynamicFont::get_size);
diff --git a/scene/resources/dynamic_font_stb.h b/scene/resources/dynamic_font_stb.h
index 0c17e3a8b3..a2c081a925 100644
--- a/scene/resources/dynamic_font_stb.h
+++ b/scene/resources/dynamic_font_stb.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,7 +34,8 @@
#include "font.h"
#include "io/resource_loader.h"
-#include "stb_truetype.h"
+
+#include "thirdparty/misc/stb_truetype.h"
class DynamicFontAtSize;
class DynamicFont;
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index b134d8052b..0bf6a50d93 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "environment.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "servers/visual_server.h"
#include "texture.h"
@@ -43,21 +44,21 @@ void Environment::set_background(BGMode p_bg) {
_change_notify();
}
-void Environment::set_skybox(const Ref<SkyBox> &p_skybox) {
+void Environment::set_sky(const Ref<Sky> &p_sky) {
- bg_skybox = p_skybox;
+ bg_sky = p_sky;
RID sb_rid;
- if (bg_skybox.is_valid())
- sb_rid = bg_skybox->get_rid();
+ if (bg_sky.is_valid())
+ sb_rid = bg_sky->get_rid();
- VS::get_singleton()->environment_set_skybox(environment, sb_rid);
+ VS::get_singleton()->environment_set_sky(environment, sb_rid);
}
-void Environment::set_skybox_scale(float p_scale) {
+void Environment::set_sky_scale(float p_scale) {
- bg_skybox_scale = p_scale;
- VS::get_singleton()->environment_set_skybox_scale(environment, p_scale);
+ bg_sky_scale = p_scale;
+ VS::get_singleton()->environment_set_sky_scale(environment, p_scale);
}
void Environment::set_bg_color(const Color &p_color) {
@@ -78,31 +79,31 @@ void Environment::set_canvas_max_layer(int p_max_layer) {
void Environment::set_ambient_light_color(const Color &p_color) {
ambient_color = p_color;
- VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, ambient_energy, ambient_skybox_contribution);
+ VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, ambient_energy, ambient_sky_contribution);
}
void Environment::set_ambient_light_energy(float p_energy) {
ambient_energy = p_energy;
- VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, ambient_energy, ambient_skybox_contribution);
+ VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, ambient_energy, ambient_sky_contribution);
}
-void Environment::set_ambient_light_skybox_contribution(float p_energy) {
+void Environment::set_ambient_light_sky_contribution(float p_energy) {
- ambient_skybox_contribution = p_energy;
- VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, ambient_energy, ambient_skybox_contribution);
+ ambient_sky_contribution = p_energy;
+ VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, ambient_energy, ambient_sky_contribution);
}
Environment::BGMode Environment::get_background() const {
return bg_mode;
}
-Ref<SkyBox> Environment::get_skybox() const {
+Ref<Sky> Environment::get_sky() const {
- return bg_skybox;
+ return bg_sky;
}
-float Environment::get_skybox_scale() const {
+float Environment::get_sky_scale() const {
- return bg_skybox_scale;
+ return bg_sky_scale;
}
Color Environment::get_bg_color() const {
@@ -125,9 +126,9 @@ float Environment::get_ambient_light_energy() const {
return ambient_energy;
}
-float Environment::get_ambient_light_skybox_contribution() const {
+float Environment::get_ambient_light_sky_contribution() const {
- return ambient_skybox_contribution;
+ return ambient_sky_contribution;
}
void Environment::set_tonemapper(ToneMapper p_tone_mapper) {
@@ -166,6 +167,7 @@ void Environment::set_tonemap_auto_exposure(bool p_enabled) {
tonemap_auto_exposure = p_enabled;
VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
+ _change_notify();
}
bool Environment::get_tonemap_auto_exposure() const {
@@ -216,6 +218,7 @@ void Environment::set_adjustment_enable(bool p_enable) {
adjustment_enabled = p_enable;
VS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID());
+ _change_notify();
}
bool Environment::is_adjustment_enabled() const {
@@ -265,29 +268,56 @@ Ref<Texture> Environment::get_adjustment_color_correction() const {
void Environment::_validate_property(PropertyInfo &property) const {
- if (property.name == "background/skybox" || property.name == "background/skybox_scale" || property.name == "ambient_light/skybox_contribution") {
- if (bg_mode != BG_SKYBOX) {
+ if (property.name == "background_sky" || property.name == "background_sky_scale" || property.name == "ambient_light/sky_contribution") {
+ if (bg_mode != BG_SKY) {
property.usage = PROPERTY_USAGE_NOEDITOR;
}
}
- if (property.name == "background/color") {
+ if (property.name == "background_color") {
if (bg_mode != BG_COLOR) {
property.usage = PROPERTY_USAGE_NOEDITOR;
}
}
- if (property.name == "background/canvas_max_layer") {
+ if (property.name == "background_canvas_max_layer") {
if (bg_mode != BG_CANVAS) {
property.usage = PROPERTY_USAGE_NOEDITOR;
}
}
+
+ static const char *hide_prefixes[] = {
+ "fog_",
+ "auto_exposure_",
+ "ss_reflections_",
+ "ssao_",
+ "dof_blur_far_",
+ "dof_blur_near_",
+ "glow_",
+ "adjustment_",
+ NULL
+
+ };
+
+ const char **prefixes = hide_prefixes;
+ while (*prefixes) {
+ String prefix = String(*prefixes);
+
+ String enabled = prefix + "enabled";
+ if (property.name.begins_with(prefix) && property.name != enabled && !bool(get(enabled))) {
+ property.usage = PROPERTY_USAGE_NOEDITOR;
+ return;
+ }
+
+ prefixes++;
+ }
}
void Environment::set_ssr_enabled(bool p_enable) {
ssr_enabled = p_enable;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_accel, ssr_fade, ssr_depth_tolerance, ssr_smooth, ssr_roughness);
+ VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ _change_notify();
}
bool Environment::is_ssr_enabled() const {
@@ -298,57 +328,47 @@ bool Environment::is_ssr_enabled() const {
void Environment::set_ssr_max_steps(int p_steps) {
ssr_max_steps = p_steps;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_accel, ssr_fade, ssr_depth_tolerance, ssr_smooth, ssr_roughness);
+ VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
}
int Environment::get_ssr_max_steps() const {
return ssr_max_steps;
}
-void Environment::set_ssr_accel(float p_accel) {
+void Environment::set_ssr_fade_in(float p_fade_in) {
- ssr_accel = p_accel;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_accel, ssr_fade, ssr_depth_tolerance, ssr_smooth, ssr_roughness);
+ ssr_fade_in = p_fade_in;
+ VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
}
-float Environment::get_ssr_accel() const {
+float Environment::get_ssr_fade_in() const {
- return ssr_accel;
+ return ssr_fade_in;
}
-void Environment::set_ssr_fade(float p_fade) {
+void Environment::set_ssr_fade_out(float p_fade_out) {
- ssr_fade = p_fade;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_accel, ssr_fade, ssr_depth_tolerance, ssr_smooth, ssr_roughness);
+ ssr_fade_out = p_fade_out;
+ VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
}
-float Environment::get_ssr_fade() const {
+float Environment::get_ssr_fade_out() const {
- return ssr_fade;
+ return ssr_fade_out;
}
void Environment::set_ssr_depth_tolerance(float p_depth_tolerance) {
ssr_depth_tolerance = p_depth_tolerance;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_accel, ssr_fade, ssr_depth_tolerance, ssr_smooth, ssr_roughness);
+ VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
}
float Environment::get_ssr_depth_tolerance() const {
return ssr_depth_tolerance;
}
-void Environment::set_ssr_smooth(bool p_enable) {
-
- ssr_smooth = p_enable;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_accel, ssr_fade, ssr_depth_tolerance, ssr_smooth, ssr_roughness);
-}
-bool Environment::is_ssr_smooth() const {
-
- return ssr_smooth;
-}
-
void Environment::set_ssr_rough(bool p_enable) {
ssr_roughness = p_enable;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_accel, ssr_fade, ssr_depth_tolerance, ssr_smooth, ssr_roughness);
+ VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
}
bool Environment::is_ssr_rough() const {
@@ -359,6 +379,7 @@ void Environment::set_ssao_enabled(bool p_enable) {
ssao_enabled = p_enable;
VS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_radius2, ssao_intensity2, ssao_bias, ssao_direct_light_affect, ssao_color, ssao_blur);
+ _change_notify();
}
bool Environment::is_ssao_enabled() const {
@@ -451,7 +472,8 @@ bool Environment::is_ssao_blur_enabled() const {
void Environment::set_glow_enabled(bool p_enabled) {
glow_enabled = p_enabled;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_treshold, glow_hdr_bleed_treshold, glow_bicubic_upscale);
+ VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_bicubic_upscale);
+ _change_notify();
}
bool Environment::is_glow_enabled() const {
@@ -468,7 +490,7 @@ void Environment::set_glow_level(int p_level, bool p_enabled) {
else
glow_levels &= ~(1 << p_level);
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_treshold, glow_hdr_bleed_treshold, glow_bicubic_upscale);
+ VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_bicubic_upscale);
}
bool Environment::is_glow_level_enabled(int p_level) const {
@@ -481,7 +503,7 @@ void Environment::set_glow_intensity(float p_intensity) {
glow_intensity = p_intensity;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_treshold, glow_hdr_bleed_treshold, glow_bicubic_upscale);
+ VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_bicubic_upscale);
}
float Environment::get_glow_intensity() const {
@@ -491,18 +513,18 @@ float Environment::get_glow_intensity() const {
void Environment::set_glow_strength(float p_strength) {
glow_strength = p_strength;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_treshold, glow_hdr_bleed_treshold, glow_bicubic_upscale);
+ VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_bicubic_upscale);
}
float Environment::get_glow_strength() const {
return glow_strength;
}
-void Environment::set_glow_bloom(float p_treshold) {
+void Environment::set_glow_bloom(float p_threshold) {
- glow_bloom = p_treshold;
+ glow_bloom = p_threshold;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_treshold, glow_hdr_bleed_treshold, glow_bicubic_upscale);
+ VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_bicubic_upscale);
}
float Environment::get_glow_bloom() const {
@@ -513,29 +535,29 @@ void Environment::set_glow_blend_mode(GlowBlendMode p_mode) {
glow_blend_mode = p_mode;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_treshold, glow_hdr_bleed_treshold, glow_bicubic_upscale);
+ VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_bicubic_upscale);
}
Environment::GlowBlendMode Environment::get_glow_blend_mode() const {
return glow_blend_mode;
}
-void Environment::set_glow_hdr_bleed_treshold(float p_treshold) {
+void Environment::set_glow_hdr_bleed_threshold(float p_threshold) {
- glow_hdr_bleed_treshold = p_treshold;
+ glow_hdr_bleed_threshold = p_threshold;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_treshold, glow_hdr_bleed_treshold, glow_bicubic_upscale);
+ VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_bicubic_upscale);
}
-float Environment::get_glow_hdr_bleed_treshold() const {
+float Environment::get_glow_hdr_bleed_threshold() const {
- return glow_hdr_bleed_treshold;
+ return glow_hdr_bleed_threshold;
}
void Environment::set_glow_hdr_bleed_scale(float p_scale) {
glow_hdr_bleed_scale = p_scale;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_treshold, glow_hdr_bleed_treshold, glow_bicubic_upscale);
+ VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_bicubic_upscale);
}
float Environment::get_glow_hdr_bleed_scale() const {
@@ -545,7 +567,7 @@ float Environment::get_glow_hdr_bleed_scale() const {
void Environment::set_glow_bicubic_upscale(bool p_enable) {
glow_bicubic_upscale = p_enable;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_treshold, glow_hdr_bleed_treshold, glow_bicubic_upscale);
+ VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_bicubic_upscale);
}
bool Environment::is_glow_bicubic_upscale_enabled() const {
@@ -557,6 +579,7 @@ void Environment::set_dof_blur_far_enabled(bool p_enable) {
dof_blur_far_enabled = p_enable;
VS::get_singleton()->environment_set_dof_blur_far(environment, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_far_amount, VS::EnvironmentDOFBlurQuality(dof_blur_far_quality));
+ _change_notify();
}
bool Environment::is_dof_blur_far_enabled() const {
@@ -609,6 +632,7 @@ void Environment::set_dof_blur_near_enabled(bool p_enable) {
dof_blur_near_enabled = p_enable;
VS::get_singleton()->environment_set_dof_blur_near(environment, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_near_amount, VS::EnvironmentDOFBlurQuality(dof_blur_near_quality));
+ _change_notify();
}
bool Environment::is_dof_blur_near_enabled() const {
@@ -660,39 +684,260 @@ Environment::DOFBlurQuality Environment::get_dof_blur_near_quality() const {
return dof_blur_near_quality;
}
+void Environment::set_fog_enabled(bool p_enabled) {
+
+ fog_enabled = p_enabled;
+ VS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
+ _change_notify();
+}
+
+bool Environment::is_fog_enabled() const {
+
+ return fog_enabled;
+}
+
+void Environment::set_fog_color(const Color &p_color) {
+
+ fog_color = p_color;
+ VS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
+}
+Color Environment::get_fog_color() const {
+
+ return fog_color;
+}
+
+void Environment::set_fog_sun_color(const Color &p_color) {
+
+ fog_sun_color = p_color;
+ VS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
+}
+Color Environment::get_fog_sun_color() const {
+
+ return fog_sun_color;
+}
+
+void Environment::set_fog_sun_amount(float p_amount) {
+
+ fog_sun_amount = p_amount;
+ VS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
+}
+float Environment::get_fog_sun_amount() const {
+
+ return fog_sun_amount;
+}
+
+void Environment::set_fog_depth_enabled(bool p_enabled) {
+
+ fog_depth_enabled = p_enabled;
+ VS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
+}
+bool Environment::is_fog_depth_enabled() const {
+
+ return fog_depth_enabled;
+}
+
+void Environment::set_fog_depth_begin(float p_distance) {
+
+ fog_depth_begin = p_distance;
+ VS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
+}
+float Environment::get_fog_depth_begin() const {
+
+ return fog_depth_begin;
+}
+
+void Environment::set_fog_depth_curve(float p_curve) {
+
+ fog_depth_curve = p_curve;
+ VS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
+}
+float Environment::get_fog_depth_curve() const {
+
+ return fog_depth_curve;
+}
+
+void Environment::set_fog_transmit_enabled(bool p_enabled) {
+
+ fog_transmit_enabled = p_enabled;
+ VS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
+}
+bool Environment::is_fog_transmit_enabled() const {
+
+ return fog_transmit_enabled;
+}
+
+void Environment::set_fog_transmit_curve(float p_curve) {
+
+ fog_transmit_curve = p_curve;
+ VS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
+}
+float Environment::get_fog_transmit_curve() const {
+
+ return fog_transmit_curve;
+}
+
+void Environment::set_fog_height_enabled(bool p_enabled) {
+
+ fog_height_enabled = p_enabled;
+ VS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
+}
+bool Environment::is_fog_height_enabled() const {
+
+ return fog_height_enabled;
+}
+
+void Environment::set_fog_height_min(float p_distance) {
+
+ fog_height_min = p_distance;
+ VS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
+}
+float Environment::get_fog_height_min() const {
+
+ return fog_height_min;
+}
+
+void Environment::set_fog_height_max(float p_distance) {
+
+ fog_height_max = p_distance;
+ VS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
+}
+float Environment::get_fog_height_max() const {
+
+ return fog_height_max;
+}
+
+void Environment::set_fog_height_curve(float p_distance) {
+
+ fog_height_curve = p_distance;
+ VS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
+}
+float Environment::get_fog_height_curve() const {
+
+ return fog_height_curve;
+}
+
void Environment::_bind_methods() {
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_sky", "sky"), &Environment::set_sky);
+ ClassDB::bind_method(D_METHOD("set_sky_scale", "scale"), &Environment::set_sky_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(D_METHOD("set_ambient_light_sky_contribution", "energy"), &Environment::set_ambient_light_sky_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_sky"), &Environment::get_sky);
+ ClassDB::bind_method(D_METHOD("get_sky_scale"), &Environment::get_sky_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);
+ ClassDB::bind_method(D_METHOD("get_ambient_light_sky_contribution"), &Environment::get_ambient_light_sky_contribution);
ADD_GROUP("Background", "background_");
- 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::INT, "background_mode", PROPERTY_HINT_ENUM, "Clear Color,Custom Color,Sky,Canvas,Keep"), "set_background", "get_background");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "background_sky", PROPERTY_HINT_RESOURCE_TYPE, "Sky"), "set_sky", "get_sky");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "background_sky_scale", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_sky_scale", "get_sky_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"), "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");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "ambient_light_sky_contribution", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ambient_light_sky_contribution", "get_ambient_light_sky_contribution");
+
+ ClassDB::bind_method(D_METHOD("set_fog_enabled", "enabled"), &Environment::set_fog_enabled);
+ ClassDB::bind_method(D_METHOD("is_fog_enabled"), &Environment::is_fog_enabled);
+
+ ClassDB::bind_method(D_METHOD("set_fog_color", "color"), &Environment::set_fog_color);
+ ClassDB::bind_method(D_METHOD("get_fog_color"), &Environment::get_fog_color);
+
+ ClassDB::bind_method(D_METHOD("set_fog_sun_color", "color"), &Environment::set_fog_sun_color);
+ ClassDB::bind_method(D_METHOD("get_fog_sun_color"), &Environment::get_fog_sun_color);
+
+ ClassDB::bind_method(D_METHOD("set_fog_sun_amount", "amount"), &Environment::set_fog_sun_amount);
+ ClassDB::bind_method(D_METHOD("get_fog_sun_amount"), &Environment::get_fog_sun_amount);
+
+ ClassDB::bind_method(D_METHOD("set_fog_depth_enabled", "enabled"), &Environment::set_fog_depth_enabled);
+ ClassDB::bind_method(D_METHOD("is_fog_depth_enabled"), &Environment::is_fog_depth_enabled);
+
+ ClassDB::bind_method(D_METHOD("set_fog_depth_begin", "distance"), &Environment::set_fog_depth_begin);
+ ClassDB::bind_method(D_METHOD("get_fog_depth_begin"), &Environment::get_fog_depth_begin);
+
+ ClassDB::bind_method(D_METHOD("set_fog_depth_curve", "curve"), &Environment::set_fog_depth_curve);
+ ClassDB::bind_method(D_METHOD("get_fog_depth_curve"), &Environment::get_fog_depth_curve);
+
+ ClassDB::bind_method(D_METHOD("set_fog_transmit_enabled", "enabled"), &Environment::set_fog_transmit_enabled);
+ ClassDB::bind_method(D_METHOD("is_fog_transmit_enabled"), &Environment::is_fog_transmit_enabled);
+
+ ClassDB::bind_method(D_METHOD("set_fog_transmit_curve", "curve"), &Environment::set_fog_transmit_curve);
+ ClassDB::bind_method(D_METHOD("get_fog_transmit_curve"), &Environment::get_fog_transmit_curve);
+
+ ClassDB::bind_method(D_METHOD("set_fog_height_enabled", "enabled"), &Environment::set_fog_height_enabled);
+ ClassDB::bind_method(D_METHOD("is_fog_height_enabled"), &Environment::is_fog_height_enabled);
+
+ ClassDB::bind_method(D_METHOD("set_fog_height_min", "height"), &Environment::set_fog_height_min);
+ ClassDB::bind_method(D_METHOD("get_fog_height_min"), &Environment::get_fog_height_min);
+
+ ClassDB::bind_method(D_METHOD("set_fog_height_max", "height"), &Environment::set_fog_height_max);
+ ClassDB::bind_method(D_METHOD("get_fog_height_max"), &Environment::get_fog_height_max);
+
+ ClassDB::bind_method(D_METHOD("set_fog_height_curve", "curve"), &Environment::set_fog_height_curve);
+ ClassDB::bind_method(D_METHOD("get_fog_height_curve"), &Environment::get_fog_height_curve);
+
+ ADD_GROUP("Fog", "fog_");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_enabled"), "set_fog_enabled", "is_fog_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "fog_color"), "set_fog_color", "get_fog_color");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "fog_sun_color"), "set_fog_sun_color", "get_fog_sun_color");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_sun_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_fog_sun_amount", "get_fog_sun_amount");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_depth_enabled"), "set_fog_depth_enabled", "is_fog_depth_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_depth_begin", PROPERTY_HINT_RANGE, "0,4000,0.1"), "set_fog_depth_begin", "get_fog_depth_begin");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_depth_curve", PROPERTY_HINT_EXP_EASING), "set_fog_depth_curve", "get_fog_depth_curve");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_transmit_enabled"), "set_fog_transmit_enabled", "is_fog_transmit_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_transmit_curve", PROPERTY_HINT_EXP_EASING), "set_fog_transmit_curve", "get_fog_transmit_curve");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_height_enabled"), "set_fog_height_enabled", "is_fog_height_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_height_min", PROPERTY_HINT_RANGE, "-4000,4000,0.1"), "set_fog_height_min", "get_fog_height_min");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_height_max", PROPERTY_HINT_RANGE, "-4000,4000,0.1"), "set_fog_height_max", "get_fog_height_max");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_height_curve", PROPERTY_HINT_EXP_EASING), "set_fog_height_curve", "get_fog_height_curve");
+
+ ClassDB::bind_method(D_METHOD("set_tonemapper", "mode"), &Environment::set_tonemapper);
+ ClassDB::bind_method(D_METHOD("get_tonemapper"), &Environment::get_tonemapper);
+
+ 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(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(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(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(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(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(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"), "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_exposure_enabled"), "set_tonemap_auto_exposure", "get_tonemap_auto_exposure");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "auto_exposure_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_exposure_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_exposure_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_exposure_speed", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_tonemap_auto_exposure_speed", "get_tonemap_auto_exposure_speed");
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);
@@ -700,28 +945,24 @@ void Environment::_bind_methods() {
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(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(D_METHOD("set_ssr_fade_in", "fade_in"), &Environment::set_ssr_fade_in);
+ ClassDB::bind_method(D_METHOD("get_ssr_fade_in"), &Environment::get_ssr_fade_in);
- 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(D_METHOD("set_ssr_fade_out", "fade_out"), &Environment::set_ssr_fade_out);
+ ClassDB::bind_method(D_METHOD("get_ssr_fade_out"), &Environment::get_ssr_fade_out);
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(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(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"), "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_fade_in", PROPERTY_HINT_EXP_EASING), "set_ssr_fade_in", "get_ssr_fade_in");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "ss_reflections_fade_out", PROPERTY_HINT_EXP_EASING), "set_ssr_fade_out", "get_ssr_fade_out");
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(D_METHOD("set_ssao_enabled", "enabled"), &Environment::set_ssao_enabled);
@@ -799,7 +1040,7 @@ void Environment::_bind_methods() {
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_GROUP("DOF Near Blur", "dof_blur_near_");
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");
@@ -824,8 +1065,8 @@ void Environment::_bind_methods() {
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(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(D_METHOD("set_glow_hdr_bleed_threshold", "threshold"), &Environment::set_glow_hdr_bleed_threshold);
+ ClassDB::bind_method(D_METHOD("get_glow_hdr_bleed_threshold"), &Environment::get_glow_hdr_bleed_threshold);
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);
@@ -847,45 +1088,10 @@ void Environment::_bind_methods() {
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_threshold", PROPERTY_HINT_RANGE, "0.0,4.0,0.01"), "set_glow_hdr_bleed_threshold", "get_glow_hdr_bleed_threshold");
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(D_METHOD("set_tonemapper", "mode"), &Environment::set_tonemapper);
- ClassDB::bind_method(D_METHOD("get_tonemapper"), &Environment::get_tonemapper);
-
- 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(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(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(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(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(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(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"), "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"), "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(D_METHOD("set_adjustment_enable", "enabled"), &Environment::set_adjustment_enable);
ClassDB::bind_method(D_METHOD("is_adjustment_enabled"), &Environment::is_adjustment_enabled);
@@ -908,12 +1114,10 @@ void Environment::_bind_methods() {
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);
-
BIND_CONSTANT(BG_KEEP);
BIND_CONSTANT(BG_CLEAR_COLOR);
BIND_CONSTANT(BG_COLOR);
- BIND_CONSTANT(BG_SKYBOX);
+ BIND_CONSTANT(BG_SKY);
BIND_CONSTANT(BG_CANVAS);
BIND_CONSTANT(BG_MAX);
BIND_CONSTANT(GLOW_BLEND_MODE_ADDITIVE);
@@ -931,12 +1135,14 @@ void Environment::_bind_methods() {
Environment::Environment() {
+ environment = VS::get_singleton()->environment_create();
+
bg_mode = BG_CLEAR_COLOR;
- bg_skybox_scale = 1.0;
+ bg_sky_scale = 1.0;
bg_energy = 1.0;
bg_canvas_max_layer = 0;
ambient_energy = 1.0;
- ambient_skybox_contribution = 0;
+ ambient_sky_contribution = 1.0;
tone_mapper = TONE_MAPPER_LINEAR;
tonemap_exposure = 1.0;
@@ -956,14 +1162,11 @@ Environment::Environment() {
set_adjustment_enable(adjustment_enabled); //update
- environment = VS::get_singleton()->environment_create();
-
ssr_enabled = false;
ssr_max_steps = 64;
- ssr_accel = 0.04;
- ssr_fade = 2.0;
+ ssr_fade_in = 0.15;
+ ssr_fade_out = 2.0;
ssr_depth_tolerance = 0.2;
- ssr_smooth = true;
ssr_roughness = true;
ssao_enabled = false;
@@ -981,7 +1184,7 @@ Environment::Environment() {
glow_strength = 1.0;
glow_bloom = 0.0;
glow_blend_mode = GLOW_BLEND_MODE_SOFTLIGHT;
- glow_hdr_bleed_treshold = 1.0;
+ glow_hdr_bleed_threshold = 1.0;
glow_hdr_bleed_scale = 2.0;
glow_bicubic_upscale = false;
@@ -996,6 +1199,27 @@ Environment::Environment() {
dof_blur_near_transition = 1;
dof_blur_near_amount = 0.1;
dof_blur_near_quality = DOF_BLUR_QUALITY_MEDIUM;
+
+ fog_enabled = false;
+ fog_color = Color(0.5, 0.5, 0.5);
+ fog_sun_color = Color(0.8, 0.8, 0.0);
+ fog_sun_amount = 0;
+
+ fog_depth_enabled = true;
+
+ fog_depth_begin = 10;
+ fog_depth_curve = 1;
+
+ fog_transmit_enabled = false;
+ fog_transmit_curve = 1;
+
+ fog_height_enabled = false;
+ fog_height_min = 0;
+ fog_height_max = 100;
+ fog_height_curve = 1;
+
+ set_fog_color(Color(0.5, 0.6, 0.7));
+ set_fog_sun_color(Color(1.0, 0.9, 0.7));
}
Environment::~Environment() {
diff --git a/scene/resources/environment.h b/scene/resources/environment.h
index 3ac311f4a3..3a6906aa27 100644
--- a/scene/resources/environment.h
+++ b/scene/resources/environment.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,7 +44,7 @@ public:
BG_CLEAR_COLOR,
BG_COLOR,
- BG_SKYBOX,
+ BG_SKY,
BG_CANVAS,
BG_KEEP,
BG_MAX
@@ -73,14 +74,14 @@ private:
RID environment;
BGMode bg_mode;
- Ref<SkyBox> bg_skybox;
- float bg_skybox_scale;
+ Ref<Sky> bg_sky;
+ float bg_sky_scale;
Color bg_color;
float bg_energy;
int bg_canvas_max_layer;
Color ambient_color;
float ambient_energy;
- float ambient_skybox_contribution;
+ float ambient_sky_contribution;
ToneMapper tone_mapper;
float tonemap_exposure;
@@ -99,10 +100,9 @@ private:
bool ssr_enabled;
int ssr_max_steps;
- float ssr_accel;
- float ssr_fade;
+ float ssr_fade_in;
+ float ssr_fade_out;
float ssr_depth_tolerance;
- bool ssr_smooth;
bool ssr_roughness;
bool ssao_enabled;
@@ -121,7 +121,7 @@ private:
float glow_strength;
float glow_bloom;
GlowBlendMode glow_blend_mode;
- float glow_hdr_bleed_treshold;
+ float glow_hdr_bleed_threshold;
float glow_hdr_bleed_scale;
bool glow_bicubic_upscale;
@@ -137,30 +137,47 @@ private:
float dof_blur_near_amount;
DOFBlurQuality dof_blur_near_quality;
+ bool fog_enabled;
+ Color fog_color;
+ Color fog_sun_color;
+ float fog_sun_amount;
+
+ bool fog_depth_enabled;
+ float fog_depth_begin;
+ float fog_depth_curve;
+
+ bool fog_transmit_enabled;
+ float fog_transmit_curve;
+
+ bool fog_height_enabled;
+ float fog_height_min;
+ float fog_height_max;
+ float fog_height_curve;
+
protected:
static void _bind_methods();
virtual void _validate_property(PropertyInfo &property) const;
public:
void set_background(BGMode p_bg);
- void set_skybox(const Ref<SkyBox> &p_skybox);
- void set_skybox_scale(float p_scale);
+ void set_sky(const Ref<Sky> &p_sky);
+ void set_sky_scale(float p_scale);
void set_bg_color(const Color &p_color);
void set_bg_energy(float p_energy);
void set_canvas_max_layer(int p_max_layer);
void set_ambient_light_color(const Color &p_color);
void set_ambient_light_energy(float p_energy);
- void set_ambient_light_skybox_contribution(float p_energy);
+ void set_ambient_light_sky_contribution(float p_energy);
BGMode get_background() const;
- Ref<SkyBox> get_skybox() const;
- float get_skybox_scale() const;
+ Ref<Sky> get_sky() const;
+ float get_sky_scale() const;
Color get_bg_color() const;
float get_bg_energy() const;
int get_canvas_max_layer() const;
Color get_ambient_light_color() const;
float get_ambient_light_energy() const;
- float get_ambient_light_skybox_contribution() const;
+ float get_ambient_light_sky_contribution() const;
void set_tonemapper(ToneMapper p_tone_mapper);
ToneMapper get_tonemapper() const;
@@ -207,18 +224,15 @@ public:
void set_ssr_max_steps(int p_steps);
int get_ssr_max_steps() const;
- void set_ssr_accel(float p_accel);
- float get_ssr_accel() const;
+ void set_ssr_fade_in(float p_fade_in);
+ float get_ssr_fade_in() const;
- void set_ssr_fade(float p_transition);
- float get_ssr_fade() const;
+ void set_ssr_fade_out(float p_fade_out);
+ float get_ssr_fade_out() const;
void set_ssr_depth_tolerance(float p_depth_tolerance);
float get_ssr_depth_tolerance() const;
- void set_ssr_smooth(bool p_enable);
- bool is_ssr_smooth() const;
-
void set_ssr_rough(bool p_enable);
bool is_ssr_rough() const;
@@ -261,14 +275,14 @@ public:
void set_glow_strength(float p_strength);
float get_glow_strength() const;
- void set_glow_bloom(float p_treshold);
+ void set_glow_bloom(float p_threshold);
float get_glow_bloom() const;
void set_glow_blend_mode(GlowBlendMode p_mode);
GlowBlendMode get_glow_blend_mode() const;
- void set_glow_hdr_bleed_treshold(float p_treshold);
- float get_glow_hdr_bleed_treshold() const;
+ void set_glow_hdr_bleed_threshold(float p_threshold);
+ float get_glow_hdr_bleed_threshold() const;
void set_glow_hdr_bleed_scale(float p_scale);
float get_glow_hdr_bleed_scale() const;
@@ -306,6 +320,45 @@ public:
void set_dof_blur_near_quality(DOFBlurQuality p_quality);
DOFBlurQuality get_dof_blur_near_quality() const;
+ void set_fog_enabled(bool p_enabled);
+ bool is_fog_enabled() const;
+
+ void set_fog_color(const Color &p_color);
+ Color get_fog_color() const;
+
+ void set_fog_sun_color(const Color &p_color);
+ Color get_fog_sun_color() const;
+
+ void set_fog_sun_amount(float p_amount);
+ float get_fog_sun_amount() const;
+
+ void set_fog_depth_enabled(bool p_enabled);
+ bool is_fog_depth_enabled() const;
+
+ void set_fog_depth_begin(float p_distance);
+ float get_fog_depth_begin() const;
+
+ void set_fog_depth_curve(float p_curve);
+ float get_fog_depth_curve() const;
+
+ void set_fog_transmit_enabled(bool p_enabled);
+ bool is_fog_transmit_enabled() const;
+
+ void set_fog_transmit_curve(float p_curve);
+ float get_fog_transmit_curve() const;
+
+ void set_fog_height_enabled(bool p_enabled);
+ bool is_fog_height_enabled() const;
+
+ void set_fog_height_min(float p_distance);
+ float get_fog_height_min() const;
+
+ void set_fog_height_max(float p_distance);
+ float get_fog_height_max() const;
+
+ void set_fog_height_curve(float p_distance);
+ float get_fog_height_curve() const;
+
virtual RID get_rid() const;
Environment();
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp
index 9f30474a26..035e514eac 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -119,8 +120,8 @@ PoolVector<int> BitmapFont::_get_chars() const {
const Character *c = char_map.getptr(*key);
chars.push_back(*key);
chars.push_back(c->texture_idx);
- chars.push_back(c->rect.pos.x);
- chars.push_back(c->rect.pos.y);
+ chars.push_back(c->rect.position.x);
+ chars.push_back(c->rect.position.y);
chars.push_back(c->rect.size.x);
chars.push_back(c->rect.size.y);
@@ -178,14 +179,14 @@ Vector<Variant> BitmapFont::_get_textures() const {
return rtextures;
}
-Error BitmapFont::create_from_fnt(const String &p_string) {
+Error BitmapFont::create_from_fnt(const String &p_file) {
//fnt format used by angelcode bmfont
//http://www.angelcode.com/products/bmfont/
- FileAccess *f = FileAccess::open(p_string, FileAccess::READ);
+ FileAccess *f = FileAccess::open(p_file, FileAccess::READ);
if (!f) {
- ERR_EXPLAIN("Can't open font: " + p_string);
+ ERR_EXPLAIN("Can't open font: " + p_file);
ERR_FAIL_V(ERR_FILE_NOT_FOUND);
}
@@ -254,7 +255,7 @@ Error BitmapFont::create_from_fnt(const String &p_string) {
if (keys.has("file")) {
String file = keys["file"];
- file = p_string.get_base_dir() + "/" + file;
+ file = p_file.get_base_dir() + "/" + file;
Ref<Texture> tex = ResourceLoader::load(file);
if (tex.is_null()) {
ERR_PRINT("Can't load font texture!");
@@ -271,9 +272,9 @@ Error BitmapFont::create_from_fnt(const String &p_string) {
Rect2 rect;
if (keys.has("x"))
- rect.pos.x = keys["x"].to_int();
+ rect.position.x = keys["x"].to_int();
if (keys.has("y"))
- rect.pos.y = keys["y"].to_int();
+ rect.position.y = keys["y"].to_int();
if (keys.has("width"))
rect.size.width = keys["width"].to_int();
if (keys.has("height"))
@@ -505,7 +506,7 @@ float BitmapFont::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_c
cpos.y += c->v_align;
ERR_FAIL_COND_V(c->texture_idx < -1 || c->texture_idx >= textures.size(), 0);
if (c->texture_idx != -1)
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, c->rect.size), textures[c->texture_idx]->get_rid(), c->rect, p_modulate);
+ VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, c->rect.size), textures[c->texture_idx]->get_rid(), c->rect, p_modulate, false, RID(), false);
return get_char_size(p_char, p_next).width;
}
@@ -548,11 +549,11 @@ void BitmapFont::_bind_methods() {
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(D_METHOD("add_texture", "texture:Texture"), &BitmapFont::add_texture);
+ ClassDB::bind_method(D_METHOD("add_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(D_METHOD("get_texture_count"), &BitmapFont::get_texture_count);
- ClassDB::bind_method(D_METHOD("get_texture:Texture", "idx"), &BitmapFont::get_texture);
+ ClassDB::bind_method(D_METHOD("get_texture", "idx"), &BitmapFont::get_texture);
ClassDB::bind_method(D_METHOD("get_char_size", "char", "next"), &BitmapFont::get_char_size, DEFVAL(0));
diff --git a/scene/resources/font.h b/scene/resources/font.h
index 332017684d..a04ffbdd4b 100644
--- a/scene/resources/font.h
+++ b/scene/resources/font.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -65,7 +66,7 @@ public:
class BitmapFont : public Font {
GDCLASS(BitmapFont, Font);
- RES_BASE_EXTENSION("fnt");
+ RES_BASE_EXTENSION("font");
Vector<Ref<Texture> > textures;
diff --git a/scene/resources/gibberish_stream.cpp b/scene/resources/gibberish_stream.cpp
index fdc5bf01e8..e2994f1419 100644
--- a/scene/resources/gibberish_stream.cpp
+++ b/scene/resources/gibberish_stream.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/gibberish_stream.h b/scene/resources/gibberish_stream.h
index 257a1faebf..ebe61382eb 100644
--- a/scene/resources/gibberish_stream.h
+++ b/scene/resources/gibberish_stream.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 410f4962fa..bc23a41ede 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,11 +30,36 @@
#include "material.h"
#include "scene/scene_string_names.h"
+void Material::set_next_pass(const Ref<Material> &p_pass) {
+
+ if (next_pass == p_pass)
+ return;
+
+ next_pass = p_pass;
+ RID next_pass_rid;
+ if (next_pass.is_valid())
+ next_pass_rid = next_pass->get_rid();
+ VS::get_singleton()->material_set_next_pass(material, next_pass_rid);
+}
+
+Ref<Material> Material::get_next_pass() const {
+
+ return next_pass;
+}
+
RID Material::get_rid() const {
return material;
}
+void Material::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_next_pass", "next_pass"), &Material::set_next_pass);
+ ClassDB::bind_method(D_METHOD("get_next_pass"), &Material::get_next_pass);
+
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "next_pass", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_next_pass", "get_next_pass");
+}
+
Material::Material() {
material = VisualServer::get_singleton()->material_create();
@@ -44,14 +70,132 @@ Material::~Material() {
VisualServer::get_singleton()->free(material);
}
+///////////////////////////////////
+
+bool ShaderMaterial::_set(const StringName &p_name, const Variant &p_value) {
+
+ if (p_name == SceneStringNames::get_singleton()->shader) {
+ set_shader(p_value);
+ return true;
+ } else {
+
+ if (shader.is_valid()) {
+
+ StringName pr = shader->remap_param(p_name);
+ if (!pr) {
+ String n = p_name;
+ if (n.find("param/") == 0) { //backwards compatibility
+ pr = n.substr(6, n.length());
+ }
+ }
+ if (pr) {
+ VisualServer::get_singleton()->material_set_param(_get_material(), pr, p_value);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool ShaderMaterial::_get(const StringName &p_name, Variant &r_ret) const {
+
+ if (p_name == SceneStringNames::get_singleton()->shader) {
+
+ r_ret = get_shader();
+ return true;
+
+ } else {
+
+ if (shader.is_valid()) {
+
+ StringName pr = shader->remap_param(p_name);
+ if (pr) {
+ r_ret = VisualServer::get_singleton()->material_get_param(_get_material(), pr);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+void ShaderMaterial::_get_property_list(List<PropertyInfo> *p_list) const {
+
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "shader", PROPERTY_HINT_RESOURCE_TYPE, "Shader,ShaderGraph"));
+
+ if (!shader.is_null()) {
+
+ shader->get_param_list(p_list);
+ }
+}
+
+void ShaderMaterial::set_shader(const Ref<Shader> &p_shader) {
+
+ shader = p_shader;
+
+ RID rid;
+ if (shader.is_valid())
+ rid = shader->get_rid();
+
+ VS::get_singleton()->material_set_shader(_get_material(), rid);
+ _change_notify(); //properties for shader exposed
+ emit_changed();
+}
+
+Ref<Shader> ShaderMaterial::get_shader() const {
+
+ return shader;
+}
+
+void ShaderMaterial::set_shader_param(const StringName &p_param, const Variant &p_value) {
+
+ VS::get_singleton()->material_set_param(_get_material(), p_param, p_value);
+}
+
+Variant ShaderMaterial::get_shader_param(const StringName &p_param) const {
+
+ return VS::get_singleton()->material_get_param(_get_material(), p_param);
+}
+
+void ShaderMaterial::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_shader", "shader"), &ShaderMaterial::set_shader);
+ ClassDB::bind_method(D_METHOD("get_shader"), &ShaderMaterial::get_shader);
+ ClassDB::bind_method(D_METHOD("set_shader_param", "param", "value"), &ShaderMaterial::set_shader_param);
+ ClassDB::bind_method(D_METHOD("get_shader_param", "param"), &ShaderMaterial::get_shader_param);
+}
+
+void ShaderMaterial::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
+
+ String f = p_function.operator String();
+ if ((f == "get_shader_param" || f == "set_shader_param") && p_idx == 0) {
+
+ if (shader.is_valid()) {
+ List<PropertyInfo> pl;
+ shader->get_param_list(&pl);
+ for (List<PropertyInfo>::Element *E = pl.front(); E; E = E->next()) {
+ r_options->push_back("\"" + E->get().name.replace_first("shader_param/", "") + "\"");
+ }
+ }
+ }
+ Resource::get_argument_options(p_function, p_idx, r_options);
+}
+
+ShaderMaterial::ShaderMaterial() {
+}
+
+ShaderMaterial::~ShaderMaterial() {
+}
+
/////////////////////////////////
-Mutex *FixedSpatialMaterial::material_mutex = NULL;
-SelfList<FixedSpatialMaterial>::List FixedSpatialMaterial::dirty_materials;
-Map<FixedSpatialMaterial::MaterialKey, FixedSpatialMaterial::ShaderData> FixedSpatialMaterial::shader_map;
-FixedSpatialMaterial::ShaderNames *FixedSpatialMaterial::shader_names = NULL;
+Mutex *SpatialMaterial::material_mutex = NULL;
+SelfList<SpatialMaterial>::List SpatialMaterial::dirty_materials;
+Map<SpatialMaterial::MaterialKey, SpatialMaterial::ShaderData> SpatialMaterial::shader_map;
+SpatialMaterial::ShaderNames *SpatialMaterial::shader_names = NULL;
-void FixedSpatialMaterial::init_shaders() {
+void SpatialMaterial::init_shaders() {
#ifndef NO_THREADS
material_mutex = Mutex::create();
@@ -62,7 +206,7 @@ void FixedSpatialMaterial::init_shaders() {
shader_names->albedo = "albedo";
shader_names->specular = "specular";
shader_names->roughness = "roughness";
- shader_names->metalness = "metalness";
+ shader_names->metallic = "metallic";
shader_names->emission = "emission";
shader_names->emission_energy = "emission_energy";
shader_names->normal_scale = "normal_scale";
@@ -71,34 +215,58 @@ void FixedSpatialMaterial::init_shaders() {
shader_names->clearcoat = "clearcoat";
shader_names->clearcoat_gloss = "clearcoat_gloss";
shader_names->anisotropy = "anisotropy_ratio";
- shader_names->height_scale = "height_scale";
+ shader_names->depth_scale = "depth_scale";
shader_names->subsurface_scattering_strength = "subsurface_scattering_strength";
shader_names->refraction = "refraction";
- shader_names->refraction_roughness = "refraction_roughness";
shader_names->point_size = "point_size";
shader_names->uv1_scale = "uv1_scale";
shader_names->uv1_offset = "uv1_offset";
shader_names->uv2_scale = "uv2_scale";
shader_names->uv2_offset = "uv2_offset";
+ shader_names->uv1_blend_sharpness = "uv1_blend_sharpness";
+ shader_names->uv2_blend_sharpness = "uv2_blend_sharpness";
+
+ shader_names->particle_h_frames = "particle_h_frames";
+ shader_names->particle_v_frames = "particle_v_frames";
+ shader_names->particles_anim_loop = "particles_anim_loop";
+ shader_names->depth_min_layers = "depth_min_layers";
+ shader_names->depth_max_layers = "depth_max_layers";
+
+ shader_names->grow = "grow";
+
+ shader_names->metallic_texture_channel = "metallic_texture_channel";
+ shader_names->roughness_texture_channel = "roughness_texture_channel";
+ shader_names->ao_texture_channel = "ao_texture_channel";
+ shader_names->clearcoat_texture_channel = "clearcoat_texture_channel";
+ shader_names->rim_texture_channel = "rim_texture_channel";
+ shader_names->depth_texture_channel = "depth_texture_channel";
+ shader_names->refraction_texture_channel = "refraction_texture_channel";
+ shader_names->alpha_scissor_threshold = "alpha_scissor_threshold";
shader_names->texture_names[TEXTURE_ALBEDO] = "texture_albedo";
- shader_names->texture_names[TEXTURE_SPECULAR] = "texture_specular";
+ shader_names->texture_names[TEXTURE_METALLIC] = "texture_metallic";
+ shader_names->texture_names[TEXTURE_ROUGHNESS] = "texture_roughness";
shader_names->texture_names[TEXTURE_EMISSION] = "texture_emission";
shader_names->texture_names[TEXTURE_NORMAL] = "texture_normal";
shader_names->texture_names[TEXTURE_RIM] = "texture_rim";
shader_names->texture_names[TEXTURE_CLEARCOAT] = "texture_clearcoat";
shader_names->texture_names[TEXTURE_FLOWMAP] = "texture_flowmap";
shader_names->texture_names[TEXTURE_AMBIENT_OCCLUSION] = "texture_ambient_occlusion";
- shader_names->texture_names[TEXTURE_HEIGHT] = "texture_height";
+ shader_names->texture_names[TEXTURE_DEPTH] = "texture_depth";
shader_names->texture_names[TEXTURE_SUBSURFACE_SCATTERING] = "texture_subsurface_scattering";
shader_names->texture_names[TEXTURE_REFRACTION] = "texture_refraction";
- shader_names->texture_names[TEXTURE_REFRACTION_ROUGHNESS] = "texture_refraction_roughness";
shader_names->texture_names[TEXTURE_DETAIL_MASK] = "texture_detail_mask";
shader_names->texture_names[TEXTURE_DETAIL_ALBEDO] = "texture_detail_albedo";
shader_names->texture_names[TEXTURE_DETAIL_NORMAL] = "texture_detail_normal";
}
-void FixedSpatialMaterial::finish_shaders() {
+Ref<SpatialMaterial> SpatialMaterial::materials_for_2d[SpatialMaterial::MAX_MATERIALS_FOR_2D];
+
+void SpatialMaterial::finish_shaders() {
+
+ for (int i = 0; i < MAX_MATERIALS_FOR_2D; i++) {
+ materials_for_2d[i].unref();
+ }
#ifndef NO_THREADS
memdelete(material_mutex);
@@ -107,7 +275,7 @@ void FixedSpatialMaterial::finish_shaders() {
memdelete(shader_names);
}
-void FixedSpatialMaterial::_update_shader() {
+void SpatialMaterial::_update_shader() {
dirty_materials.remove(&element);
@@ -135,7 +303,7 @@ void FixedSpatialMaterial::_update_shader() {
//must create a shader!
- String code = "render_mode ";
+ String code = "shader_type spatial;\nrender_mode ";
switch (blend_mode) {
case BLEND_MODE_MIX: code += "blend_mix"; break;
case BLEND_MODE_ADD: code += "blend_add"; break;
@@ -143,7 +311,12 @@ void FixedSpatialMaterial::_update_shader() {
case BLEND_MODE_MUL: code += "blend_mul"; break;
}
- switch (depth_draw_mode) {
+ DepthDrawMode ddm = depth_draw_mode;
+ if (features[FEATURE_REFRACTION]) {
+ ddm = DEPTH_DRAW_ALWAYS;
+ }
+
+ switch (ddm) {
case DEPTH_DRAW_OPAQUE_ONLY: code += ",depth_draw_opaque"; break;
case DEPTH_DRAW_ALWAYS: code += ",depth_draw_always"; break;
case DEPTH_DRAW_DISABLED: code += ",depth_draw_never"; break;
@@ -155,6 +328,20 @@ void FixedSpatialMaterial::_update_shader() {
case CULL_FRONT: code += ",cull_front"; break;
case CULL_DISABLED: code += ",cull_disabled"; break;
}
+ switch (diffuse_mode) {
+ case DIFFUSE_LAMBERT: code += ",diffuse_lambert"; break;
+ case DIFFUSE_HALF_LAMBERT: code += ",diffuse_half_lambert"; break;
+ case DIFFUSE_OREN_NAYAR: code += ",diffuse_oren_nayar"; break;
+ case DIFFUSE_BURLEY: code += ",diffuse_burley"; break;
+ case DIFFUSE_TOON: code += ",diffuse_toon"; break;
+ }
+ switch (specular_mode) {
+ case SPECULAR_SCHLICK_GGX: code += ",specular_schlick_ggx"; break;
+ case SPECULAR_BLINN: code += ",specular_blinn"; break;
+ case SPECULAR_PHONG: code += ",specular_phong"; break;
+ case SPECULAR_TOON: code += ",specular_toon"; break;
+ case SPECULAR_DISABLED: code += ",specular_disabled"; break;
+ }
if (flags[FLAG_UNSHADED]) {
code += ",unshaded";
@@ -162,24 +349,37 @@ void FixedSpatialMaterial::_update_shader() {
if (flags[FLAG_ONTOP]) {
code += ",ontop";
}
+ if (flags[FLAG_USE_VERTEX_LIGHTING]) {
+ code += ",vertex_lighting";
+ }
+ if (flags[FLAG_UV1_USE_TRIPLANAR] || flags[FLAG_UV2_USE_TRIPLANAR]) {
+ code += ",world_vertex_coords";
+ }
code += ";\n";
code += "uniform vec4 albedo : hint_color;\n";
code += "uniform sampler2D texture_albedo : hint_albedo;\n";
- if (specular_mode == SPECULAR_MODE_SPECULAR) {
- code += "uniform vec4 specular : hint_color;\n";
- } else {
- code += "uniform float metalness;\n";
+ code += "uniform float specular;\n";
+ code += "uniform float metallic;\n";
+ if (grow_enabled) {
+ code += "uniform float grow;\n";
}
+ if (flags[FLAG_USE_ALPHA_SCISSOR]) {
+ code += "uniform float alpha_scissor_threshold;\n";
+ }
code += "uniform float roughness : hint_range(0,1);\n";
code += "uniform float point_size : hint_range(0,128);\n";
- code += "uniform sampler2D texture_specular : hint_white;\n";
- code += "uniform vec2 uv1_scale;\n";
- code += "uniform vec2 uv1_offset;\n";
- code += "uniform vec2 uv2_scale;\n";
- code += "uniform vec2 uv2_offset;\n";
+ code += "uniform sampler2D texture_metallic : hint_white;\n";
+ code += "uniform vec4 metallic_texture_channel;\n";
+ code += "uniform sampler2D texture_roughness : hint_white;\n";
+ code += "uniform vec4 roughness_texture_channel;\n";
+ if (billboard_mode == BILLBOARD_PARTICLES) {
+ code += "uniform int particles_anim_h_frames;\n";
+ code += "uniform int particles_anim_v_frames;\n";
+ code += "uniform bool particles_anim_loop;\n";
+ }
if (features[FEATURE_EMISSION]) {
@@ -188,6 +388,12 @@ void FixedSpatialMaterial::_update_shader() {
code += "uniform float emission_energy;\n";
}
+ if (features[FEATURE_REFRACTION]) {
+ code += "uniform sampler2D texture_refraction;\n";
+ code += "uniform float refraction : hint_range(-16,16);\n";
+ code += "uniform vec4 refraction_texture_channel;\n";
+ }
+
if (features[FEATURE_NORMAL_MAPPING]) {
code += "uniform sampler2D texture_normal : hint_normal;\n";
code += "uniform float normal_scale : hint_range(-16,16);\n";
@@ -208,6 +414,7 @@ void FixedSpatialMaterial::_update_shader() {
}
if (features[FEATURE_AMBIENT_OCCLUSION]) {
code += "uniform sampler2D texture_ambient_occlusion : hint_white;\n";
+ code += "uniform vec4 ao_texture_channel;\n";
}
if (features[FEATURE_DETAIL]) {
@@ -222,6 +429,33 @@ void FixedSpatialMaterial::_update_shader() {
code += "uniform sampler2D texture_subsurface_scattering : hint_white;\n";
}
+ if (features[FEATURE_DEPTH_MAPPING]) {
+ code += "uniform sampler2D texture_depth : hint_black;\n";
+ code += "uniform float depth_scale;\n";
+ code += "uniform int depth_min_layers;\n";
+ code += "uniform int depth_max_layers;\n";
+ }
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "varying vec3 uv1_world_pos;\n";
+ }
+ if (flags[FLAG_UV2_USE_TRIPLANAR]) {
+ code += "varying vec3 uv2_world_pos;\n";
+ }
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "uniform float uv1_blend_sharpness;\n";
+ code += "varying vec3 uv1_power_normal;\n";
+ }
+
+ if (flags[FLAG_UV2_USE_TRIPLANAR]) {
+ code += "uniform float uv2_blend_sharpness;\n";
+ code += "varying vec3 uv2_power_normal;\n";
+ }
+
+ code += "uniform vec3 uv1_scale;\n";
+ code += "uniform vec3 uv1_offset;\n";
+ code += "uniform vec3 uv2_scale;\n";
+ code += "uniform vec3 uv2_offset;\n";
+
code += "\n\n";
code += "void vertex() {\n";
@@ -234,19 +468,169 @@ void FixedSpatialMaterial::_update_shader() {
code += "\tPOINT_SIZE=point_size;\n";
}
- code += "\tUV=UV*uv1_scale+uv1_offset;\n";
- if (detail_uv == DETAIL_UV_2) {
+
+ if (flags[FLAG_USE_VERTEX_LIGHTING]) {
+
+ code += "\tROUGHNESS=roughness;\n";
+ }
+
+ if (!flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tUV=UV*uv1_scale.xy+uv1_offset.xy;\n";
+ }
+
+ switch (billboard_mode) {
+ case BILLBOARD_DISABLED: {
+
+ } break;
+ case BILLBOARD_ENABLED: {
+
+ code += "\tMODELVIEW_MATRIX = INV_CAMERA_MATRIX * mat4(CAMERA_MATRIX[0],CAMERA_MATRIX[1],CAMERA_MATRIX[2],WORLD_MATRIX[3]);\n";
+ } break;
+ case BILLBOARD_FIXED_Y: {
+ code += "\tMODELVIEW_MATRIX = INV_CAMERA_MATRIX * mat4(CAMERA_MATRIX[0],WORLD_MATRIX[1],vec4(normalize(cross(CAMERA_MATRIX[0].xyz,WORLD_MATRIX[1].xyz)),0.0),WORLD_MATRIX[3]);\n";
+ } break;
+ case BILLBOARD_PARTICLES: {
+
+ //make billboard
+ code += "\tmat4 mat_world = mat4(normalize(CAMERA_MATRIX[0])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[1])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[2])*length(WORLD_MATRIX[2]),WORLD_MATRIX[3]);\n";
+ //rotate by rotation
+ code += "\tmat_world = mat_world * mat4( vec4(cos(INSTANCE_CUSTOM.x),-sin(INSTANCE_CUSTOM.x),0.0,0.0), vec4(sin(INSTANCE_CUSTOM.x),cos(INSTANCE_CUSTOM.x),0.0,0.0),vec4(0.0,0.0,1.0,0.0),vec4(0.0,0.0,0.0,1.0));\n";
+ //set modelview
+ code += "\tMODELVIEW_MATRIX = INV_CAMERA_MATRIX * mat_world;\n";
+
+ //handle animation
+ code += "\tint particle_total_frames = particles_anim_h_frames * particles_anim_v_frames;\n";
+ code += "\tint particle_frame = int(INSTANCE_CUSTOM.y * float(particle_total_frames));\n";
+ code += "\tif (particles_anim_loop) particle_frame=clamp(particle_frame,0,particle_total_frames-1); else particle_frame=abs(particle_frame)%particle_total_frames;\n";
+ //code += "\tUV /= vec2(float(particles_anim_h_frames),float(particles_anim_v_frames));\n";
+ //code += "\tUV+= UV * vec2(float(particle_frame % particles_anim_h_frames),float(particle_frame / particles_anim_v_frames));\n";
+ //handle rotation
+ // code += "\tmat4 rotation = mat4("
+ } break;
+ }
+
+ if (flags[FLAG_FIXED_SIZE]) {
+
+ code += "\tif (PROJECTION_MATRIX[3][3] != 0.0) {\n";
+ //orthogonal matrix, try to do about the same
+ //with viewport size
+ code += "\t\tfloat h = abs(1.0 / (2.0 * PROJECTION_MATRIX[1][1]));\n";
+ code += "\t\tfloat sc = (h * 2.0); //consistent with Y-fov\n";
+ code += "\t\tMODELVIEW_MATRIX[0]*=sc;\n";
+ code += "\t\tMODELVIEW_MATRIX[1]*=sc;\n";
+ code += "\t\tMODELVIEW_MATRIX[2]*=sc;\n";
+ code += "\t} else {\n";
+ //just scale by depth
+ code += "\t\tfloat sc = -(MODELVIEW_MATRIX)[3].z;\n";
+ code += "\t\tMODELVIEW_MATRIX[0]*=sc;\n";
+ code += "\t\tMODELVIEW_MATRIX[1]*=sc;\n";
+ code += "\t\tMODELVIEW_MATRIX[2]*=sc;\n";
+ code += "\t}\n";
+ }
+
+ if (detail_uv == DETAIL_UV_2 && !flags[FLAG_UV2_USE_TRIPLANAR]) {
code += "\tUV2=UV2*uv2_scale+uv2_offset;\n";
}
+ if (flags[FLAG_UV1_USE_TRIPLANAR] || flags[FLAG_UV2_USE_TRIPLANAR]) {
+ //generate tangent and binormal in world space
+ code += "\tTANGENT = vec3(0.0,0.0,-1.0) * abs(NORMAL.x);\n";
+ code += "\tTANGENT+= vec3(1.0,0.0,0.0) * abs(NORMAL.y);\n";
+ code += "\tTANGENT+= vec3(1.0,0.0,0.0) * abs(NORMAL.z);\n";
+ code += "\tTANGENT = normalize(TANGENT);\n";
+
+ code += "\tBINORMAL = vec3(0.0,1.0,0.0) * abs(NORMAL.x);\n";
+ code += "\tBINORMAL+= vec3(0.0,0.0,-1.0) * abs(NORMAL.y);\n";
+ code += "\tBINORMAL+= vec3(0.0,1.0,0.0) * abs(NORMAL.z);\n";
+ code += "\tBINORMAL = normalize(BINORMAL);\n";
+ }
+
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+
+ code += "\tuv1_power_normal=pow(abs(NORMAL),vec3(uv1_blend_sharpness));\n";
+ code += "\tuv1_power_normal/=dot(uv1_power_normal,vec3(1.0));\n";
+ code += "\tuv1_world_pos = VERTEX * uv1_scale + uv1_offset;\n";
+ code += "\tuv1_world_pos *= vec3(1.0,-1.0, 1.0);\n";
+ }
+
+ if (flags[FLAG_UV2_USE_TRIPLANAR]) {
+
+ code += "\tuv2_power_normal=pow(abs(NORMAL), vec3(uv2_blend_sharpness));\n";
+ code += "\tuv2_power_normal/=dot(uv2_power_normal,vec3(1.0));\n";
+ code += "\tuv2_world_pos = VERTEX * uv2_scale + uv2_offset;\n";
+ code += "\tuv2_world_pos *= vec3(1.0,-1.0, 1.0);\n";
+ }
+
+ if (grow_enabled) {
+ code += "\tVERTEX+=NORMAL*grow;\n";
+ }
code += "}\n";
code += "\n\n";
+ if (flags[FLAG_UV1_USE_TRIPLANAR] || flags[FLAG_UV2_USE_TRIPLANAR]) {
+ code += "vec4 triplanar_texture(sampler2D p_sampler,vec3 p_weights,vec3 p_world_pos) {\n";
+ code += "\tvec4 samp=vec4(0.0);\n";
+ code += "\tsamp+= texture(p_sampler,p_world_pos.xy) * p_weights.z;\n";
+ code += "\tsamp+= texture(p_sampler,p_world_pos.xz) * p_weights.y;\n";
+ code += "\tsamp+= texture(p_sampler,p_world_pos.zy * vec2(-1.0,1.0)) * p_weights.x;\n";
+ code += "\treturn samp;\n";
+ code += "}\n";
+ }
+ code += "\n\n";
code += "void fragment() {\n";
+ if (!flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tvec2 base_uv = UV;\n";
+ }
+
+ if ((features[FEATURE_DETAIL] && detail_uv == DETAIL_UV_2) || (features[FEATURE_AMBIENT_OCCLUSION] && flags[FLAG_AO_ON_UV2])) {
+ code += "\tvec2 base_uv2 = UV2;\n";
+ }
+
+ if (features[FEATURE_DEPTH_MAPPING] && !flags[FLAG_UV1_USE_TRIPLANAR]) { //depthmap not supported with triplanar
+ code += "\t{\n";
+ code += "\t\tvec3 view_dir = normalize(normalize(-VERTEX)*mat3(TANGENT,-BINORMAL,NORMAL));\n"; //binormal is negative due to mikktpsace
+
+ if (deep_parallax) {
+ code += "\t\tfloat num_layers = mix(float(depth_max_layers),float(depth_min_layers), abs(dot(vec3(0.0, 0.0, 1.0), view_dir)));\n";
+ code += "\t\tfloat layer_depth = 1.0 / num_layers;\n";
+ code += "\t\tfloat current_layer_depth = 0.0;\n";
+ code += "\t\tvec2 P = view_dir.xy * depth_scale;\n";
+ code += "\t\tvec2 delta = P / num_layers;\n";
+ code += "\t\tvec2 ofs = base_uv;\n";
+ code += "\t\tfloat depth = texture(texture_depth, ofs).r;\n";
+ code += "\t\tfloat current_depth = 0.0;\n";
+ code += "\t\twhile(current_depth < depth) {\n";
+ code += "\t\t\tofs -= delta;\n";
+ code += "\t\t\tdepth = texture(texture_depth, ofs).r;\n";
+ code += "\t\t\tcurrent_depth += layer_depth;\n";
+ code += "\t\t}\n";
+ code += "\t\tvec2 prev_ofs = ofs + delta;\n";
+ code += "\t\tfloat after_depth = depth - current_depth;\n";
+ code += "\t\tfloat before_depth = texture(texture_depth, prev_ofs).r - current_depth + layer_depth;\n";
+ code += "\t\tfloat weight = after_depth / (after_depth - before_depth);\n";
+ code += "\t\tofs = mix(ofs,prev_ofs,weight);\n";
+
+ } else {
+ code += "\t\tfloat depth = texture(texture_depth, base_uv).r;\n";
+ code += "\t\tvec2 ofs = base_uv - view_dir.xy / view_dir.z * (depth * depth_scale);\n";
+ }
+
+ code += "\t\tbase_uv=ofs;\n";
+ if (features[FEATURE_DETAIL] && detail_uv == DETAIL_UV_2) {
+ code += "\t\tbase_uv2-=ofs;\n";
+ }
+
+ code += "\t}\n";
+ }
+
if (flags[FLAG_USE_POINT_SIZE]) {
code += "\tvec4 albedo_tex = texture(texture_albedo,POINT_COORD);\n";
} else {
- code += "\tvec4 albedo_tex = texture(texture_albedo,UV);\n";
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tvec4 albedo_tex = triplanar_texture(texture_albedo,uv1_power_normal,uv1_world_pos);\n";
+ } else {
+ code += "\tvec4 albedo_tex = texture(texture_albedo,base_uv);\n";
+ }
}
if (flags[FLAG_ALBEDO_FROM_VERTEX_COLOR]) {
@@ -254,52 +638,133 @@ void FixedSpatialMaterial::_update_shader() {
}
code += "\tALBEDO = albedo.rgb * albedo_tex.rgb;\n";
- if (features[FEATURE_TRANSPARENT]) {
- code += "\tALPHA = albedo.a * albedo_tex.a;\n";
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tfloat metallic_tex = dot(triplanar_texture(texture_metallic,uv1_power_normal,uv1_world_pos),metallic_texture_channel);\n";
+ } else {
+ code += "\tfloat metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);\n";
}
-
- if (features[FEATURE_EMISSION]) {
- code += "\tEMISSION = (emission.rgb+texture(texture_emission,UV).rgb)*emission_energy;\n";
+ code += "\tMETALLIC = metallic_tex * metallic;\n";
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tfloat roughness_tex = dot(triplanar_texture(texture_roughness,uv1_power_normal,uv1_world_pos),roughness_texture_channel);\n";
+ } else {
+ code += "\tfloat roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);\n";
}
+ code += "\tROUGHNESS = roughness_tex * roughness;\n";
+ code += "\tSPECULAR = specular;\n";
if (features[FEATURE_NORMAL_MAPPING]) {
- code += "\tNORMALMAP = texture(texture_normal,UV).rgb;\n";
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tNORMALMAP = triplanar_texture(texture_normal,uv1_power_normal,uv1_world_pos).rgb;\n";
+ } else {
+ code += "\tNORMALMAP = texture(texture_normal,base_uv).rgb;\n";
+ }
code += "\tNORMALMAP_DEPTH = normal_scale;\n";
}
+ if (features[FEATURE_EMISSION]) {
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tvec3 emission_tex = triplanar_texture(texture_emission,uv1_power_normal,uv1_world_pos).rgb;\n";
+ } else {
+ code += "\tvec3 emission_tex = texture(texture_emission,base_uv).rgb;\n";
+ }
+ code += "\tEMISSION = (emission.rgb+emission_tex)*emission_energy;\n";
+ }
+
+ if (features[FEATURE_REFRACTION] && !flags[FLAG_UV1_USE_TRIPLANAR]) { //refraction not supported with triplanar
+
+ if (features[FEATURE_NORMAL_MAPPING]) {
+ code += "\tvec3 ref_normal = normalize( mix(NORMAL,TANGENT * NORMALMAP.x + BINORMAL * NORMALMAP.y + NORMAL * NORMALMAP.z,NORMALMAP_DEPTH) ) * SIDE;\n";
+ } else {
+ code += "\tvec3 ref_normal = NORMAL;\n";
+ }
+
+ code += "\tvec2 ref_ofs = SCREEN_UV - ref_normal.xy * dot(texture(texture_refraction,base_uv),refraction_texture_channel) * refraction;\n";
+ code += "\tfloat ref_amount = 1.0 - albedo.a * albedo_tex.a;\n";
+ code += "\tEMISSION += textureLod(SCREEN_TEXTURE,ref_ofs,ROUGHNESS * 8.0).rgb * ref_amount;\n";
+ code += "\tALBEDO *= 1.0 - ref_amount;\n";
+ code += "\tALPHA = 1.0;\n";
+
+ } else if (features[FEATURE_TRANSPARENT] || features[FLAG_USE_ALPHA_SCISSOR]) {
+ code += "\tALPHA = albedo.a * albedo_tex.a;\n";
+ }
+
if (features[FEATURE_RIM]) {
- code += "\tvec2 rim_tex = texture(texture_rim,UV).xw;\n";
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tvec2 rim_tex = triplanar_texture(texture_rim,uv1_power_normal,uv1_world_pos).xy;\n";
+ } else {
+ code += "\tvec2 rim_tex = texture(texture_rim,base_uv).xy;\n";
+ }
code += "\tRIM = rim*rim_tex.x;";
code += "\tRIM_TINT = rim_tint*rim_tex.y;\n";
}
if (features[FEATURE_CLEARCOAT]) {
- code += "\tvec2 clearcoat_tex = texture(texture_clearcoat,UV).xw;\n";
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tvec2 clearcoat_tex = triplanar_texture(texture_clearcoat,uv1_power_normal,uv1_world_pos).xy;\n";
+ } else {
+ code += "\tvec2 clearcoat_tex = texture(texture_clearcoat,base_uv).xy;\n";
+ }
code += "\tCLEARCOAT = clearcoat*clearcoat_tex.x;";
code += "\tCLEARCOAT_GLOSS = clearcoat_gloss*clearcoat_tex.y;\n";
}
if (features[FEATURE_ANISOTROPY]) {
- code += "\tvec4 anisotropy_tex = texture(texture_flowmap,UV);\n";
- code += "\tANISOTROPY = anisotropy_ratio*anisotropy_tex.a;\n";
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tvec3 anisotropy_tex = triplanar_texture(texture_flowmap,uv1_power_normal,uv1_world_pos).rga;\n";
+ } else {
+ code += "\tvec3 anisotropy_tex = texture(texture_flowmap,base_uv).rga;\n";
+ }
+ code += "\tANISOTROPY = anisotropy_ratio*anisotropy_tex.b;\n";
code += "\tANISOTROPY_FLOW = anisotropy_tex.rg*2.0-1.0;\n";
}
if (features[FEATURE_AMBIENT_OCCLUSION]) {
- code += "\tAO = texture(texture_ambient_occlusion,UV).r;\n";
+ if (flags[FLAG_AO_ON_UV2]) {
+ if (flags[FLAG_UV2_USE_TRIPLANAR]) {
+ code += "\tAO = dot(triplanar_texture(texture_ambient_occlusion,uv2_power_normal,uv2_world_pos),ao_texture_channel);\n";
+ } else {
+ code += "\tAO = dot(texture(texture_ambient_occlusion,base_uv2),ao_texture_channel);\n";
+ }
+ } else {
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tAO = dot(triplanar_texture(texture_ambient_occlusion,uv1_power_normal,uv1_world_pos),ao_texture_channel);\n";
+ } else {
+ code += "\tAO = dot(texture(texture_ambient_occlusion,base_uv),ao_texture_channel);\n";
+ }
+ }
}
if (features[FEATURE_SUBSURACE_SCATTERING]) {
- code += "\tfloat sss_tex = texture(texture_subsurface_scattering,UV).r;\n";
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tfloat sss_tex = triplanar_texture(texture_subsurface_scattering,uv1_power_normal,uv1_world_pos).r;\n";
+ } else {
+ code += "\tfloat sss_tex = texture(texture_subsurface_scattering,base_uv).r;\n";
+ }
code += "\tSSS_STRENGTH=subsurface_scattering_strength*sss_tex;\n";
}
if (features[FEATURE_DETAIL]) {
- String det_uv = detail_uv == DETAIL_UV_1 ? "UV" : "UV2";
- code += "\tvec4 detail_tex = texture(texture_detail_albedo," + det_uv + ");\n";
- code += "\tvec4 detail_norm_tex = texture(texture_detail_normal," + det_uv + ");\n";
- code += "\tvec4 detail_mask_tex = texture(texture_detail_mask,UV);\n";
+
+ bool triplanar = (flags[FLAG_UV1_USE_TRIPLANAR] && detail_uv == DETAIL_UV_1) || (flags[FLAG_UV2_USE_TRIPLANAR] && detail_uv == DETAIL_UV_2);
+
+ if (triplanar) {
+ String tp_uv = detail_uv == DETAIL_UV_1 ? "uv1" : "uv2";
+ code += "\tvec4 detail_tex = triplanar_texture(texture_detail_albedo," + tp_uv + "_power_normal," + tp_uv + "_world_pos);\n";
+ code += "\tvec4 detail_norm_tex = triplanar_texture(texture_detail_normal," + tp_uv + "_power_normal," + tp_uv + "_world_pos);\n";
+
+ } else {
+ String det_uv = detail_uv == DETAIL_UV_1 ? "base_uv" : "base_uv2";
+ code += "\tvec4 detail_tex = texture(texture_detail_albedo," + det_uv + ");\n";
+ code += "\tvec4 detail_norm_tex = texture(texture_detail_normal," + det_uv + ");\n";
+ }
+
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+
+ code += "\tvec4 detail_mask_tex = triplanar_texture(texture_detail_mask,uv1_power_normal);\n";
+ } else {
+ code += "\tvec4 detail_mask_tex = texture(texture_detail_mask,base_uv);\n";
+ }
switch (detail_blend_mode) {
case BLEND_MODE_MIX: {
@@ -317,26 +782,18 @@ void FixedSpatialMaterial::_update_shader() {
}
code += "\tvec3 detail_norm = mix(NORMALMAP,detail_norm_tex.rgb,detail_tex.a);\n";
-
code += "\tNORMALMAP = mix(NORMALMAP,detail_norm,detail_mask_tex.r);\n";
code += "\tALBEDO.rgb = mix(ALBEDO.rgb,detail,detail_mask_tex.r);\n";
- }
- if (specular_mode == SPECULAR_MODE_SPECULAR) {
-
- code += "\tvec4 specular_tex = texture(texture_specular,UV);\n";
- code += "\tSPECULAR = specular.rgb * specular_tex.rgb;\n";
- code += "\tROUGHNESS = specular_tex.a * roughness;\n";
- } else {
- code += "\tvec4 specular_tex = texture(texture_specular,UV);\n";
- code += "\tSPECULAR = vec3(ALBEDO.rgb * metalness * specular_tex.r);\n";
- code += "\tROUGHNESS = specular_tex.a * roughness;\n";
+ if (flags[FLAG_USE_ALPHA_SCISSOR]) {
+ code += "\tALPHA_SCISSOR=alpha_scissor_threshold;\n";
+ }
}
code += "}\n";
ShaderData shader_data;
- shader_data.shader = VS::get_singleton()->shader_create(VS::SHADER_SPATIAL);
+ shader_data.shader = VS::get_singleton()->shader_create();
shader_data.users = 1;
VS::get_singleton()->shader_set_code(shader_data.shader, code);
@@ -346,7 +803,7 @@ void FixedSpatialMaterial::_update_shader() {
VS::get_singleton()->material_set_shader(_get_material(), shader_data.shader);
}
-void FixedSpatialMaterial::flush_changes() {
+void SpatialMaterial::flush_changes() {
if (material_mutex)
material_mutex->lock();
@@ -360,7 +817,7 @@ void FixedSpatialMaterial::flush_changes() {
material_mutex->unlock();
}
-void FixedSpatialMaterial::_queue_shader_change() {
+void SpatialMaterial::_queue_shader_change() {
if (material_mutex)
material_mutex->lock();
@@ -373,7 +830,7 @@ void FixedSpatialMaterial::_queue_shader_change() {
material_mutex->unlock();
}
-bool FixedSpatialMaterial::_is_shader_dirty() const {
+bool SpatialMaterial::_is_shader_dirty() const {
bool dirty = false;
@@ -387,187 +844,167 @@ bool FixedSpatialMaterial::_is_shader_dirty() const {
return dirty;
}
-void FixedSpatialMaterial::set_albedo(const Color &p_albedo) {
+void SpatialMaterial::set_albedo(const Color &p_albedo) {
albedo = p_albedo;
VS::get_singleton()->material_set_param(_get_material(), shader_names->albedo, p_albedo);
}
-Color FixedSpatialMaterial::get_albedo() const {
+Color SpatialMaterial::get_albedo() const {
return albedo;
}
-void FixedSpatialMaterial::set_specular_mode(SpecularMode p_mode) {
- specular_mode = p_mode;
- _change_notify();
- _queue_shader_change();
-}
-
-FixedSpatialMaterial::SpecularMode FixedSpatialMaterial::get_specular_mode() const {
-
- return specular_mode;
-}
-
-void FixedSpatialMaterial::set_specular(const Color &p_specular) {
+void SpatialMaterial::set_specular(float p_specular) {
specular = p_specular;
VS::get_singleton()->material_set_param(_get_material(), shader_names->specular, p_specular);
}
-Color FixedSpatialMaterial::get_specular() const {
+
+float SpatialMaterial::get_specular() const {
return specular;
}
-void FixedSpatialMaterial::set_roughness(float p_roughness) {
+void SpatialMaterial::set_roughness(float p_roughness) {
roughness = p_roughness;
VS::get_singleton()->material_set_param(_get_material(), shader_names->roughness, p_roughness);
}
-float FixedSpatialMaterial::get_roughness() const {
+float SpatialMaterial::get_roughness() const {
return roughness;
}
-void FixedSpatialMaterial::set_metalness(float p_metalness) {
+void SpatialMaterial::set_metallic(float p_metallic) {
- metalness = p_metalness;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->metalness, p_metalness);
+ metallic = p_metallic;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->metallic, p_metallic);
}
-float FixedSpatialMaterial::get_metalness() const {
+float SpatialMaterial::get_metallic() const {
- return metalness;
+ return metallic;
}
-void FixedSpatialMaterial::set_emission(const Color &p_emission) {
+void SpatialMaterial::set_emission(const Color &p_emission) {
emission = p_emission;
VS::get_singleton()->material_set_param(_get_material(), shader_names->emission, p_emission);
}
-Color FixedSpatialMaterial::get_emission() const {
+Color SpatialMaterial::get_emission() const {
return emission;
}
-void FixedSpatialMaterial::set_emission_energy(float p_emission_energy) {
+void SpatialMaterial::set_emission_energy(float p_emission_energy) {
emission_energy = p_emission_energy;
VS::get_singleton()->material_set_param(_get_material(), shader_names->emission_energy, p_emission_energy);
}
-float FixedSpatialMaterial::get_emission_energy() const {
+float SpatialMaterial::get_emission_energy() const {
return emission_energy;
}
-void FixedSpatialMaterial::set_normal_scale(float p_normal_scale) {
+void SpatialMaterial::set_normal_scale(float p_normal_scale) {
normal_scale = p_normal_scale;
VS::get_singleton()->material_set_param(_get_material(), shader_names->normal_scale, p_normal_scale);
}
-float FixedSpatialMaterial::get_normal_scale() const {
+float SpatialMaterial::get_normal_scale() const {
return normal_scale;
}
-void FixedSpatialMaterial::set_rim(float p_rim) {
+void SpatialMaterial::set_rim(float p_rim) {
rim = p_rim;
VS::get_singleton()->material_set_param(_get_material(), shader_names->rim, p_rim);
}
-float FixedSpatialMaterial::get_rim() const {
+float SpatialMaterial::get_rim() const {
return rim;
}
-void FixedSpatialMaterial::set_rim_tint(float p_rim_tint) {
+void SpatialMaterial::set_rim_tint(float p_rim_tint) {
rim_tint = p_rim_tint;
VS::get_singleton()->material_set_param(_get_material(), shader_names->rim_tint, p_rim_tint);
}
-float FixedSpatialMaterial::get_rim_tint() const {
+float SpatialMaterial::get_rim_tint() const {
return rim_tint;
}
-void FixedSpatialMaterial::set_clearcoat(float p_clearcoat) {
+void SpatialMaterial::set_clearcoat(float p_clearcoat) {
clearcoat = p_clearcoat;
VS::get_singleton()->material_set_param(_get_material(), shader_names->clearcoat, p_clearcoat);
}
-float FixedSpatialMaterial::get_clearcoat() const {
+float SpatialMaterial::get_clearcoat() const {
return clearcoat;
}
-void FixedSpatialMaterial::set_clearcoat_gloss(float p_clearcoat_gloss) {
+void SpatialMaterial::set_clearcoat_gloss(float p_clearcoat_gloss) {
clearcoat_gloss = p_clearcoat_gloss;
VS::get_singleton()->material_set_param(_get_material(), shader_names->clearcoat_gloss, p_clearcoat_gloss);
}
-float FixedSpatialMaterial::get_clearcoat_gloss() const {
+float SpatialMaterial::get_clearcoat_gloss() const {
return clearcoat_gloss;
}
-void FixedSpatialMaterial::set_anisotropy(float p_anisotropy) {
+void SpatialMaterial::set_anisotropy(float p_anisotropy) {
anisotropy = p_anisotropy;
VS::get_singleton()->material_set_param(_get_material(), shader_names->anisotropy, p_anisotropy);
}
-float FixedSpatialMaterial::get_anisotropy() const {
+float SpatialMaterial::get_anisotropy() const {
return anisotropy;
}
-void FixedSpatialMaterial::set_height_scale(float p_height_scale) {
+void SpatialMaterial::set_depth_scale(float p_depth_scale) {
- height_scale = p_height_scale;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->height_scale, p_height_scale);
+ depth_scale = p_depth_scale;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->depth_scale, p_depth_scale);
}
-float FixedSpatialMaterial::get_height_scale() const {
+float SpatialMaterial::get_depth_scale() const {
- return height_scale;
+ return depth_scale;
}
-void FixedSpatialMaterial::set_subsurface_scattering_strength(float p_subsurface_scattering_strength) {
+void SpatialMaterial::set_subsurface_scattering_strength(float p_subsurface_scattering_strength) {
subsurface_scattering_strength = p_subsurface_scattering_strength;
VS::get_singleton()->material_set_param(_get_material(), shader_names->subsurface_scattering_strength, subsurface_scattering_strength);
}
-float FixedSpatialMaterial::get_subsurface_scattering_strength() const {
+float SpatialMaterial::get_subsurface_scattering_strength() const {
return subsurface_scattering_strength;
}
-void FixedSpatialMaterial::set_refraction(float p_refraction) {
+void SpatialMaterial::set_refraction(float p_refraction) {
refraction = p_refraction;
VS::get_singleton()->material_set_param(_get_material(), shader_names->refraction, refraction);
}
-float FixedSpatialMaterial::get_refraction() const {
+float SpatialMaterial::get_refraction() const {
return refraction;
}
-void FixedSpatialMaterial::set_refraction_roughness(float p_refraction_roughness) {
-
- refraction_roughness = p_refraction_roughness;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->refraction_roughness, refraction_roughness);
-}
-float FixedSpatialMaterial::get_refraction_roughness() const {
-
- return refraction_roughness;
-}
-
-void FixedSpatialMaterial::set_detail_uv(DetailUV p_detail_uv) {
+void SpatialMaterial::set_detail_uv(DetailUV p_detail_uv) {
if (detail_uv == p_detail_uv)
return;
@@ -575,12 +1012,12 @@ void FixedSpatialMaterial::set_detail_uv(DetailUV p_detail_uv) {
detail_uv = p_detail_uv;
_queue_shader_change();
}
-FixedSpatialMaterial::DetailUV FixedSpatialMaterial::get_detail_uv() const {
+SpatialMaterial::DetailUV SpatialMaterial::get_detail_uv() const {
return detail_uv;
}
-void FixedSpatialMaterial::set_blend_mode(BlendMode p_mode) {
+void SpatialMaterial::set_blend_mode(BlendMode p_mode) {
if (blend_mode == p_mode)
return;
@@ -588,22 +1025,22 @@ void FixedSpatialMaterial::set_blend_mode(BlendMode p_mode) {
blend_mode = p_mode;
_queue_shader_change();
}
-FixedSpatialMaterial::BlendMode FixedSpatialMaterial::get_blend_mode() const {
+SpatialMaterial::BlendMode SpatialMaterial::get_blend_mode() const {
return blend_mode;
}
-void FixedSpatialMaterial::set_detail_blend_mode(BlendMode p_mode) {
+void SpatialMaterial::set_detail_blend_mode(BlendMode p_mode) {
detail_blend_mode = p_mode;
_queue_shader_change();
}
-FixedSpatialMaterial::BlendMode FixedSpatialMaterial::get_detail_blend_mode() const {
+SpatialMaterial::BlendMode SpatialMaterial::get_detail_blend_mode() const {
return detail_blend_mode;
}
-void FixedSpatialMaterial::set_depth_draw_mode(DepthDrawMode p_mode) {
+void SpatialMaterial::set_depth_draw_mode(DepthDrawMode p_mode) {
if (depth_draw_mode == p_mode)
return;
@@ -611,12 +1048,12 @@ void FixedSpatialMaterial::set_depth_draw_mode(DepthDrawMode p_mode) {
depth_draw_mode = p_mode;
_queue_shader_change();
}
-FixedSpatialMaterial::DepthDrawMode FixedSpatialMaterial::get_depth_draw_mode() const {
+SpatialMaterial::DepthDrawMode SpatialMaterial::get_depth_draw_mode() const {
return depth_draw_mode;
}
-void FixedSpatialMaterial::set_cull_mode(CullMode p_mode) {
+void SpatialMaterial::set_cull_mode(CullMode p_mode) {
if (cull_mode == p_mode)
return;
@@ -624,12 +1061,12 @@ void FixedSpatialMaterial::set_cull_mode(CullMode p_mode) {
cull_mode = p_mode;
_queue_shader_change();
}
-FixedSpatialMaterial::CullMode FixedSpatialMaterial::get_cull_mode() const {
+SpatialMaterial::CullMode SpatialMaterial::get_cull_mode() const {
return cull_mode;
}
-void FixedSpatialMaterial::set_diffuse_mode(DiffuseMode p_mode) {
+void SpatialMaterial::set_diffuse_mode(DiffuseMode p_mode) {
if (diffuse_mode == p_mode)
return;
@@ -637,12 +1074,25 @@ void FixedSpatialMaterial::set_diffuse_mode(DiffuseMode p_mode) {
diffuse_mode = p_mode;
_queue_shader_change();
}
-FixedSpatialMaterial::DiffuseMode FixedSpatialMaterial::get_diffuse_mode() const {
+SpatialMaterial::DiffuseMode SpatialMaterial::get_diffuse_mode() const {
return diffuse_mode;
}
-void FixedSpatialMaterial::set_flag(Flags p_flag, bool p_enabled) {
+void SpatialMaterial::set_specular_mode(SpecularMode p_mode) {
+
+ if (specular_mode == p_mode)
+ return;
+
+ specular_mode = p_mode;
+ _queue_shader_change();
+}
+SpatialMaterial::SpecularMode SpatialMaterial::get_specular_mode() const {
+
+ return specular_mode;
+}
+
+void SpatialMaterial::set_flag(Flags p_flag, bool p_enabled) {
ERR_FAIL_INDEX(p_flag, FLAG_MAX);
@@ -650,16 +1100,19 @@ void FixedSpatialMaterial::set_flag(Flags p_flag, bool p_enabled) {
return;
flags[p_flag] = p_enabled;
+ if (p_flag == FLAG_USE_ALPHA_SCISSOR) {
+ _change_notify();
+ }
_queue_shader_change();
}
-bool FixedSpatialMaterial::get_flag(Flags p_flag) const {
+bool SpatialMaterial::get_flag(Flags p_flag) const {
ERR_FAIL_INDEX_V(p_flag, FLAG_MAX, false);
return flags[p_flag];
}
-void FixedSpatialMaterial::set_feature(Feature p_feature, bool p_enabled) {
+void SpatialMaterial::set_feature(Feature p_feature, bool p_enabled) {
ERR_FAIL_INDEX(p_feature, FEATURE_MAX);
if (features[p_feature] == p_enabled)
@@ -670,13 +1123,13 @@ void FixedSpatialMaterial::set_feature(Feature p_feature, bool p_enabled) {
_queue_shader_change();
}
-bool FixedSpatialMaterial::get_feature(Feature p_feature) const {
+bool SpatialMaterial::get_feature(Feature p_feature) const {
ERR_FAIL_INDEX_V(p_feature, FEATURE_MAX, false);
return features[p_feature];
}
-void FixedSpatialMaterial::set_texture(TextureParam p_param, const Ref<Texture> &p_texture) {
+void SpatialMaterial::set_texture(TextureParam p_param, const Ref<Texture> &p_texture) {
ERR_FAIL_INDEX(p_param, TEXTURE_MAX);
textures[p_param] = p_texture;
@@ -684,265 +1137,554 @@ void FixedSpatialMaterial::set_texture(TextureParam p_param, const Ref<Texture>
VS::get_singleton()->material_set_param(_get_material(), shader_names->texture_names[p_param], rid);
}
-Ref<Texture> FixedSpatialMaterial::get_texture(TextureParam p_param) const {
+Ref<Texture> SpatialMaterial::get_texture(TextureParam p_param) const {
ERR_FAIL_INDEX_V(p_param, TEXTURE_MAX, Ref<Texture>());
return textures[p_param];
}
-void FixedSpatialMaterial::_validate_feature(const String &text, Feature feature, PropertyInfo &property) const {
+void SpatialMaterial::_validate_feature(const String &text, Feature feature, PropertyInfo &property) const {
if (property.name.begins_with(text) && property.name != text + "_enabled" && !features[feature]) {
property.usage = 0;
}
}
-void FixedSpatialMaterial::_validate_property(PropertyInfo &property) const {
+void SpatialMaterial::_validate_property(PropertyInfo &property) const {
_validate_feature("normal", FEATURE_NORMAL_MAPPING, property);
_validate_feature("emission", FEATURE_EMISSION, property);
_validate_feature("rim", FEATURE_RIM, property);
_validate_feature("clearcoat", FEATURE_CLEARCOAT, property);
_validate_feature("anisotropy", FEATURE_ANISOTROPY, property);
_validate_feature("ao", FEATURE_AMBIENT_OCCLUSION, property);
- _validate_feature("height", FEATURE_HEIGHT_MAPPING, property);
+ _validate_feature("depth", FEATURE_DEPTH_MAPPING, property);
_validate_feature("subsurf_scatter", FEATURE_SUBSURACE_SCATTERING, property);
_validate_feature("refraction", FEATURE_REFRACTION, property);
_validate_feature("detail", FEATURE_DETAIL, property);
- if (property.name == "specular/color" && specular_mode == SPECULAR_MODE_METALLIC) {
+ if (property.name.begins_with("particles_anim_") && billboard_mode != BILLBOARD_PARTICLES) {
property.usage = 0;
}
- if (property.name == "specular/metalness" && specular_mode == SPECULAR_MODE_SPECULAR) {
+
+ if (property.name == "params_grow_amount" && !grow_enabled) {
+ property.usage = 0;
+ }
+
+ if (property.name == "params_alpha_scissor_threshold" && !flags[FLAG_USE_ALPHA_SCISSOR]) {
+ property.usage = 0;
+ }
+
+ if ((property.name == "depth_min_layers" || property.name == "depth_max_layers") && !deep_parallax) {
property.usage = 0;
}
}
-void FixedSpatialMaterial::set_line_width(float p_line_width) {
+void SpatialMaterial::set_line_width(float p_line_width) {
line_width = p_line_width;
VS::get_singleton()->material_set_line_width(_get_material(), line_width);
}
-float FixedSpatialMaterial::get_line_width() const {
+float SpatialMaterial::get_line_width() const {
return line_width;
}
-void FixedSpatialMaterial::set_point_size(float p_point_size) {
+void SpatialMaterial::set_point_size(float p_point_size) {
point_size = p_point_size;
VS::get_singleton()->material_set_param(_get_material(), shader_names->point_size, p_point_size);
}
-float FixedSpatialMaterial::get_point_size() const {
+float SpatialMaterial::get_point_size() const {
return point_size;
}
-void FixedSpatialMaterial::set_uv1_scale(const Vector2 &p_scale) {
+void SpatialMaterial::set_uv1_scale(const Vector3 &p_scale) {
uv1_scale = p_scale;
VS::get_singleton()->material_set_param(_get_material(), shader_names->uv1_scale, p_scale);
}
-Vector2 FixedSpatialMaterial::get_uv1_scale() const {
+Vector3 SpatialMaterial::get_uv1_scale() const {
return uv1_scale;
}
-void FixedSpatialMaterial::set_uv1_offset(const Vector2 &p_offset) {
+void SpatialMaterial::set_uv1_offset(const Vector3 &p_offset) {
uv1_offset = p_offset;
VS::get_singleton()->material_set_param(_get_material(), shader_names->uv1_offset, p_offset);
}
-Vector2 FixedSpatialMaterial::get_uv1_offset() const {
+Vector3 SpatialMaterial::get_uv1_offset() const {
return uv1_offset;
}
-void FixedSpatialMaterial::set_uv2_scale(const Vector2 &p_scale) {
+void SpatialMaterial::set_uv1_triplanar_blend_sharpness(float p_sharpness) {
+
+ uv1_triplanar_sharpness = p_sharpness;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->uv1_blend_sharpness, p_sharpness);
+}
+
+float SpatialMaterial::get_uv1_triplanar_blend_sharpness() const {
+
+ return uv1_triplanar_sharpness;
+}
+
+void SpatialMaterial::set_uv2_scale(const Vector3 &p_scale) {
uv2_scale = p_scale;
VS::get_singleton()->material_set_param(_get_material(), shader_names->uv2_scale, p_scale);
}
-Vector2 FixedSpatialMaterial::get_uv2_scale() const {
+Vector3 SpatialMaterial::get_uv2_scale() const {
return uv2_scale;
}
-void FixedSpatialMaterial::set_uv2_offset(const Vector2 &p_offset) {
+void SpatialMaterial::set_uv2_offset(const Vector3 &p_offset) {
uv2_offset = p_offset;
VS::get_singleton()->material_set_param(_get_material(), shader_names->uv2_offset, p_offset);
}
-Vector2 FixedSpatialMaterial::get_uv2_offset() const {
+Vector3 SpatialMaterial::get_uv2_offset() const {
return uv2_offset;
}
-void FixedSpatialMaterial::_bind_methods() {
+void SpatialMaterial::set_uv2_triplanar_blend_sharpness(float p_sharpness) {
- ClassDB::bind_method(D_METHOD("set_albedo", "albedo"), &FixedSpatialMaterial::set_albedo);
- ClassDB::bind_method(D_METHOD("get_albedo"), &FixedSpatialMaterial::get_albedo);
+ uv2_triplanar_sharpness = p_sharpness;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->uv2_blend_sharpness, p_sharpness);
+}
- 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);
+float SpatialMaterial::get_uv2_triplanar_blend_sharpness() const {
- ClassDB::bind_method(D_METHOD("set_specular", "specular"), &FixedSpatialMaterial::set_specular);
- ClassDB::bind_method(D_METHOD("get_specular"), &FixedSpatialMaterial::get_specular);
+ return uv2_triplanar_sharpness;
+}
+
+void SpatialMaterial::set_billboard_mode(BillboardMode p_mode) {
+
+ billboard_mode = p_mode;
+ _queue_shader_change();
+ _change_notify();
+}
- ClassDB::bind_method(D_METHOD("set_metalness", "metalness"), &FixedSpatialMaterial::set_metalness);
- ClassDB::bind_method(D_METHOD("get_metalness"), &FixedSpatialMaterial::get_metalness);
+SpatialMaterial::BillboardMode SpatialMaterial::get_billboard_mode() const {
- ClassDB::bind_method(D_METHOD("set_roughness", "roughness"), &FixedSpatialMaterial::set_roughness);
- ClassDB::bind_method(D_METHOD("get_roughness"), &FixedSpatialMaterial::get_roughness);
+ return billboard_mode;
+}
- ClassDB::bind_method(D_METHOD("set_emission", "emission"), &FixedSpatialMaterial::set_emission);
- ClassDB::bind_method(D_METHOD("get_emission"), &FixedSpatialMaterial::get_emission);
+void SpatialMaterial::set_particles_anim_h_frames(int p_frames) {
- 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);
+ particles_anim_h_frames = p_frames;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->particle_h_frames, p_frames);
+}
- 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);
+int SpatialMaterial::get_particles_anim_h_frames() const {
- ClassDB::bind_method(D_METHOD("set_rim", "rim"), &FixedSpatialMaterial::set_rim);
- ClassDB::bind_method(D_METHOD("get_rim"), &FixedSpatialMaterial::get_rim);
+ return particles_anim_h_frames;
+}
+void SpatialMaterial::set_particles_anim_v_frames(int p_frames) {
- 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);
+ particles_anim_v_frames = p_frames;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->particle_v_frames, p_frames);
+}
+
+int SpatialMaterial::get_particles_anim_v_frames() const {
+
+ return particles_anim_v_frames;
+}
+
+void SpatialMaterial::set_particles_anim_loop(int p_frames) {
+
+ particles_anim_loop = p_frames;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_loop, p_frames);
+}
+
+int SpatialMaterial::get_particles_anim_loop() const {
+
+ return particles_anim_loop;
+}
- ClassDB::bind_method(D_METHOD("set_clearcoat", "clearcoat"), &FixedSpatialMaterial::set_clearcoat);
- ClassDB::bind_method(D_METHOD("get_clearcoat"), &FixedSpatialMaterial::get_clearcoat);
+void SpatialMaterial::set_depth_deep_parallax(bool p_enable) {
- 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);
+ deep_parallax = p_enable;
+ _queue_shader_change();
+ _change_notify();
+}
- ClassDB::bind_method(D_METHOD("set_anisotropy", "anisotropy"), &FixedSpatialMaterial::set_anisotropy);
- ClassDB::bind_method(D_METHOD("get_anisotropy"), &FixedSpatialMaterial::get_anisotropy);
+bool SpatialMaterial::is_depth_deep_parallax_enabled() const {
- 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);
+ return deep_parallax;
+}
- 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);
+void SpatialMaterial::set_depth_deep_parallax_min_layers(int p_layer) {
- ClassDB::bind_method(D_METHOD("set_refraction", "refraction"), &FixedSpatialMaterial::set_refraction);
- ClassDB::bind_method(D_METHOD("get_refraction"), &FixedSpatialMaterial::get_refraction);
+ deep_parallax_min_layers = p_layer;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->depth_min_layers, p_layer);
+}
+int SpatialMaterial::get_depth_deep_parallax_min_layers() const {
- 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);
+ return deep_parallax_min_layers;
+}
- 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);
+void SpatialMaterial::set_depth_deep_parallax_max_layers(int p_layer) {
- 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);
+ deep_parallax_max_layers = p_layer;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->depth_max_layers, p_layer);
+}
+int SpatialMaterial::get_depth_deep_parallax_max_layers() const {
- 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);
+ return deep_parallax_max_layers;
+}
- 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);
+void SpatialMaterial::set_grow_enabled(bool p_enable) {
+ grow_enabled = p_enable;
+ _queue_shader_change();
+ _change_notify();
+}
- 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);
+bool SpatialMaterial::is_grow_enabled() const {
+ return grow_enabled;
+}
- 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);
+void SpatialMaterial::set_alpha_scissor_threshold(float p_treshold) {
+ alpha_scissor_threshold = p_treshold;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->alpha_scissor_threshold, p_treshold);
+}
- 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);
+float SpatialMaterial::get_alpha_scissor_threshold() const {
- ClassDB::bind_method(D_METHOD("set_flag", "flag", "enable"), &FixedSpatialMaterial::set_flag);
- ClassDB::bind_method(D_METHOD("get_flag"), &FixedSpatialMaterial::get_flag);
+ return alpha_scissor_threshold;
+}
- ClassDB::bind_method(D_METHOD("set_feature", "feature", "enable"), &FixedSpatialMaterial::set_feature);
- ClassDB::bind_method(D_METHOD("get_feature", "feature"), &FixedSpatialMaterial::get_feature);
+void SpatialMaterial::set_grow(float p_grow) {
+ grow = p_grow;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->grow, p_grow);
+}
- 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);
+float SpatialMaterial::get_grow() const {
- 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);
+ return grow;
+}
- 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);
+static Plane _get_texture_mask(SpatialMaterial::TextureChannel p_channel) {
+ static const Plane masks[5] = {
+ Plane(1, 0, 0, 0),
+ Plane(0, 1, 0, 0),
+ Plane(0, 0, 1, 0),
+ Plane(0, 0, 0, 1),
+ Plane(0.3333333, 0.3333333, 0.3333333, 0),
+ };
- 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);
+ return masks[p_channel];
+}
- 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);
+void SpatialMaterial::set_metallic_texture_channel(TextureChannel p_channel) {
- 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);
+ metallic_texture_channel = p_channel;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->metallic_texture_channel, _get_texture_mask(p_channel));
+}
+
+SpatialMaterial::TextureChannel SpatialMaterial::get_metallic_texture_channel() const {
+ return metallic_texture_channel;
+}
+
+void SpatialMaterial::set_roughness_texture_channel(TextureChannel p_channel) {
+
+ roughness_texture_channel = p_channel;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->roughness_texture_channel, _get_texture_mask(p_channel));
+}
+
+SpatialMaterial::TextureChannel SpatialMaterial::get_roughness_texture_channel() const {
+ return roughness_texture_channel;
+}
+
+void SpatialMaterial::set_ao_texture_channel(TextureChannel p_channel) {
+
+ ao_texture_channel = p_channel;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->ao_texture_channel, _get_texture_mask(p_channel));
+}
+
+SpatialMaterial::TextureChannel SpatialMaterial::get_ao_texture_channel() const {
+ return ao_texture_channel;
+}
+
+void SpatialMaterial::set_refraction_texture_channel(TextureChannel p_channel) {
+
+ refraction_texture_channel = p_channel;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->refraction_texture_channel, _get_texture_mask(p_channel));
+}
+
+SpatialMaterial::TextureChannel SpatialMaterial::get_refraction_texture_channel() const {
+ return refraction_texture_channel;
+}
+
+RID SpatialMaterial::get_material_rid_for_2d(bool p_shaded, bool p_transparent, bool p_double_sided, bool p_cut_alpha, bool p_opaque_prepass) {
+
+ int version = 0;
+ if (p_shaded)
+ version = 1;
+ if (p_transparent)
+ version |= 2;
+ if (p_cut_alpha)
+ version |= 4;
+ if (p_opaque_prepass)
+ version |= 8;
+ if (p_double_sided)
+ version |= 16;
+
+ if (materials_for_2d[version].is_valid()) {
+ return materials_for_2d[version]->get_rid();
+ }
+
+ Ref<SpatialMaterial> material;
+ material.instance();
+
+ material->set_flag(FLAG_UNSHADED, !p_shaded);
+ material->set_feature(FEATURE_TRANSPARENT, p_transparent);
+ material->set_cull_mode(p_double_sided ? CULL_DISABLED : CULL_BACK);
+ material->set_depth_draw_mode(p_opaque_prepass ? DEPTH_DRAW_ALPHA_OPAQUE_PREPASS : DEPTH_DRAW_OPAQUE_ONLY);
+ material->set_flag(FLAG_SRGB_VERTEX_COLOR, true);
+ material->set_flag(FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ material->set_flag(FLAG_USE_ALPHA_SCISSOR, p_cut_alpha);
+
+ materials_for_2d[version] = material;
+
+ return materials_for_2d[version]->get_rid();
+}
+
+void SpatialMaterial::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_albedo", "albedo"), &SpatialMaterial::set_albedo);
+ ClassDB::bind_method(D_METHOD("get_albedo"), &SpatialMaterial::get_albedo);
+
+ ClassDB::bind_method(D_METHOD("set_specular", "specular"), &SpatialMaterial::set_specular);
+ ClassDB::bind_method(D_METHOD("get_specular"), &SpatialMaterial::get_specular);
+
+ ClassDB::bind_method(D_METHOD("set_metallic", "metallic"), &SpatialMaterial::set_metallic);
+ ClassDB::bind_method(D_METHOD("get_metallic"), &SpatialMaterial::get_metallic);
+
+ ClassDB::bind_method(D_METHOD("set_roughness", "roughness"), &SpatialMaterial::set_roughness);
+ ClassDB::bind_method(D_METHOD("get_roughness"), &SpatialMaterial::get_roughness);
+
+ ClassDB::bind_method(D_METHOD("set_emission", "emission"), &SpatialMaterial::set_emission);
+ ClassDB::bind_method(D_METHOD("get_emission"), &SpatialMaterial::get_emission);
+
+ ClassDB::bind_method(D_METHOD("set_emission_energy", "emission_energy"), &SpatialMaterial::set_emission_energy);
+ ClassDB::bind_method(D_METHOD("get_emission_energy"), &SpatialMaterial::get_emission_energy);
+
+ ClassDB::bind_method(D_METHOD("set_normal_scale", "normal_scale"), &SpatialMaterial::set_normal_scale);
+ ClassDB::bind_method(D_METHOD("get_normal_scale"), &SpatialMaterial::get_normal_scale);
+
+ ClassDB::bind_method(D_METHOD("set_rim", "rim"), &SpatialMaterial::set_rim);
+ ClassDB::bind_method(D_METHOD("get_rim"), &SpatialMaterial::get_rim);
+
+ ClassDB::bind_method(D_METHOD("set_rim_tint", "rim_tint"), &SpatialMaterial::set_rim_tint);
+ ClassDB::bind_method(D_METHOD("get_rim_tint"), &SpatialMaterial::get_rim_tint);
+
+ ClassDB::bind_method(D_METHOD("set_clearcoat", "clearcoat"), &SpatialMaterial::set_clearcoat);
+ ClassDB::bind_method(D_METHOD("get_clearcoat"), &SpatialMaterial::get_clearcoat);
+
+ ClassDB::bind_method(D_METHOD("set_clearcoat_gloss", "clearcoat_gloss"), &SpatialMaterial::set_clearcoat_gloss);
+ ClassDB::bind_method(D_METHOD("get_clearcoat_gloss"), &SpatialMaterial::get_clearcoat_gloss);
+
+ ClassDB::bind_method(D_METHOD("set_anisotropy", "anisotropy"), &SpatialMaterial::set_anisotropy);
+ ClassDB::bind_method(D_METHOD("get_anisotropy"), &SpatialMaterial::get_anisotropy);
+
+ ClassDB::bind_method(D_METHOD("set_depth_scale", "depth_scale"), &SpatialMaterial::set_depth_scale);
+ ClassDB::bind_method(D_METHOD("get_depth_scale"), &SpatialMaterial::get_depth_scale);
+
+ ClassDB::bind_method(D_METHOD("set_subsurface_scattering_strength", "strength"), &SpatialMaterial::set_subsurface_scattering_strength);
+ ClassDB::bind_method(D_METHOD("get_subsurface_scattering_strength"), &SpatialMaterial::get_subsurface_scattering_strength);
+
+ ClassDB::bind_method(D_METHOD("set_refraction", "refraction"), &SpatialMaterial::set_refraction);
+ ClassDB::bind_method(D_METHOD("get_refraction"), &SpatialMaterial::get_refraction);
+
+ ClassDB::bind_method(D_METHOD("set_line_width", "line_width"), &SpatialMaterial::set_line_width);
+ ClassDB::bind_method(D_METHOD("get_line_width"), &SpatialMaterial::get_line_width);
+
+ ClassDB::bind_method(D_METHOD("set_point_size", "point_size"), &SpatialMaterial::set_point_size);
+ ClassDB::bind_method(D_METHOD("get_point_size"), &SpatialMaterial::get_point_size);
+
+ ClassDB::bind_method(D_METHOD("set_detail_uv", "detail_uv"), &SpatialMaterial::set_detail_uv);
+ ClassDB::bind_method(D_METHOD("get_detail_uv"), &SpatialMaterial::get_detail_uv);
+
+ ClassDB::bind_method(D_METHOD("set_blend_mode", "blend_mode"), &SpatialMaterial::set_blend_mode);
+ ClassDB::bind_method(D_METHOD("get_blend_mode"), &SpatialMaterial::get_blend_mode);
+
+ ClassDB::bind_method(D_METHOD("set_depth_draw_mode", "depth_draw_mode"), &SpatialMaterial::set_depth_draw_mode);
+ ClassDB::bind_method(D_METHOD("get_depth_draw_mode"), &SpatialMaterial::get_depth_draw_mode);
+
+ ClassDB::bind_method(D_METHOD("set_cull_mode", "cull_mode"), &SpatialMaterial::set_cull_mode);
+ ClassDB::bind_method(D_METHOD("get_cull_mode"), &SpatialMaterial::get_cull_mode);
+
+ ClassDB::bind_method(D_METHOD("set_diffuse_mode", "diffuse_mode"), &SpatialMaterial::set_diffuse_mode);
+ ClassDB::bind_method(D_METHOD("get_diffuse_mode"), &SpatialMaterial::get_diffuse_mode);
+
+ ClassDB::bind_method(D_METHOD("set_specular_mode", "specular_mode"), &SpatialMaterial::set_specular_mode);
+ ClassDB::bind_method(D_METHOD("get_specular_mode"), &SpatialMaterial::get_specular_mode);
+
+ ClassDB::bind_method(D_METHOD("set_flag", "flag", "enable"), &SpatialMaterial::set_flag);
+ ClassDB::bind_method(D_METHOD("get_flag", "flag"), &SpatialMaterial::get_flag);
+
+ ClassDB::bind_method(D_METHOD("set_feature", "feature", "enable"), &SpatialMaterial::set_feature);
+ ClassDB::bind_method(D_METHOD("get_feature", "feature"), &SpatialMaterial::get_feature);
+
+ ClassDB::bind_method(D_METHOD("set_texture", "param", "texture"), &SpatialMaterial::set_texture);
+ ClassDB::bind_method(D_METHOD("get_texture", "param"), &SpatialMaterial::get_texture);
+
+ ClassDB::bind_method(D_METHOD("set_detail_blend_mode", "detail_blend_mode"), &SpatialMaterial::set_detail_blend_mode);
+ ClassDB::bind_method(D_METHOD("get_detail_blend_mode"), &SpatialMaterial::get_detail_blend_mode);
+
+ ClassDB::bind_method(D_METHOD("set_uv1_scale", "scale"), &SpatialMaterial::set_uv1_scale);
+ ClassDB::bind_method(D_METHOD("get_uv1_scale"), &SpatialMaterial::get_uv1_scale);
+
+ ClassDB::bind_method(D_METHOD("set_uv1_offset", "offset"), &SpatialMaterial::set_uv1_offset);
+ ClassDB::bind_method(D_METHOD("get_uv1_offset"), &SpatialMaterial::get_uv1_offset);
+
+ ClassDB::bind_method(D_METHOD("set_uv1_triplanar_blend_sharpness", "sharpness"), &SpatialMaterial::set_uv1_triplanar_blend_sharpness);
+ ClassDB::bind_method(D_METHOD("get_uv1_triplanar_blend_sharpness"), &SpatialMaterial::get_uv1_triplanar_blend_sharpness);
+
+ ClassDB::bind_method(D_METHOD("set_uv2_scale", "scale"), &SpatialMaterial::set_uv2_scale);
+ ClassDB::bind_method(D_METHOD("get_uv2_scale"), &SpatialMaterial::get_uv2_scale);
+
+ ClassDB::bind_method(D_METHOD("set_uv2_offset", "offset"), &SpatialMaterial::set_uv2_offset);
+ ClassDB::bind_method(D_METHOD("get_uv2_offset"), &SpatialMaterial::get_uv2_offset);
+
+ ClassDB::bind_method(D_METHOD("set_uv2_triplanar_blend_sharpness", "sharpness"), &SpatialMaterial::set_uv2_triplanar_blend_sharpness);
+ ClassDB::bind_method(D_METHOD("get_uv2_triplanar_blend_sharpness"), &SpatialMaterial::get_uv2_triplanar_blend_sharpness);
+
+ ClassDB::bind_method(D_METHOD("set_billboard_mode", "mode"), &SpatialMaterial::set_billboard_mode);
+ ClassDB::bind_method(D_METHOD("get_billboard_mode"), &SpatialMaterial::get_billboard_mode);
+
+ ClassDB::bind_method(D_METHOD("set_particles_anim_h_frames", "frames"), &SpatialMaterial::set_particles_anim_h_frames);
+ ClassDB::bind_method(D_METHOD("get_particles_anim_h_frames"), &SpatialMaterial::get_particles_anim_h_frames);
+
+ ClassDB::bind_method(D_METHOD("set_particles_anim_v_frames", "frames"), &SpatialMaterial::set_particles_anim_v_frames);
+ ClassDB::bind_method(D_METHOD("get_particles_anim_v_frames"), &SpatialMaterial::get_particles_anim_v_frames);
+
+ ClassDB::bind_method(D_METHOD("set_particles_anim_loop", "frames"), &SpatialMaterial::set_particles_anim_loop);
+ ClassDB::bind_method(D_METHOD("get_particles_anim_loop"), &SpatialMaterial::get_particles_anim_loop);
+
+ ClassDB::bind_method(D_METHOD("set_depth_deep_parallax", "enable"), &SpatialMaterial::set_depth_deep_parallax);
+ ClassDB::bind_method(D_METHOD("is_depth_deep_parallax_enabled"), &SpatialMaterial::is_depth_deep_parallax_enabled);
+
+ ClassDB::bind_method(D_METHOD("set_depth_deep_parallax_min_layers", "layer"), &SpatialMaterial::set_depth_deep_parallax_min_layers);
+ ClassDB::bind_method(D_METHOD("get_depth_deep_parallax_min_layers"), &SpatialMaterial::get_depth_deep_parallax_min_layers);
+
+ ClassDB::bind_method(D_METHOD("set_depth_deep_parallax_max_layers", "layer"), &SpatialMaterial::set_depth_deep_parallax_max_layers);
+ ClassDB::bind_method(D_METHOD("get_depth_deep_parallax_max_layers"), &SpatialMaterial::get_depth_deep_parallax_max_layers);
+
+ ClassDB::bind_method(D_METHOD("set_grow", "amount"), &SpatialMaterial::set_grow);
+ ClassDB::bind_method(D_METHOD("get_grow"), &SpatialMaterial::get_grow);
+
+ ClassDB::bind_method(D_METHOD("set_alpha_scissor_threshold", "threshold"), &SpatialMaterial::set_alpha_scissor_threshold);
+ ClassDB::bind_method(D_METHOD("get_alpha_scissor_threshold"), &SpatialMaterial::get_alpha_scissor_threshold);
+
+ ClassDB::bind_method(D_METHOD("set_grow_enabled", "enable"), &SpatialMaterial::set_grow_enabled);
+ ClassDB::bind_method(D_METHOD("is_grow_enabled"), &SpatialMaterial::is_grow_enabled);
+
+ ClassDB::bind_method(D_METHOD("set_metallic_texture_channel", "channel"), &SpatialMaterial::set_metallic_texture_channel);
+ ClassDB::bind_method(D_METHOD("get_metallic_texture_channel"), &SpatialMaterial::get_metallic_texture_channel);
+
+ ClassDB::bind_method(D_METHOD("set_roughness_texture_channel", "channel"), &SpatialMaterial::set_roughness_texture_channel);
+ ClassDB::bind_method(D_METHOD("get_roughness_texture_channel"), &SpatialMaterial::get_roughness_texture_channel);
+
+ ClassDB::bind_method(D_METHOD("set_ao_texture_channel", "channel"), &SpatialMaterial::set_ao_texture_channel);
+ ClassDB::bind_method(D_METHOD("get_ao_texture_channel"), &SpatialMaterial::get_ao_texture_channel);
+
+ ClassDB::bind_method(D_METHOD("set_refraction_texture_channel", "channel"), &SpatialMaterial::set_refraction_texture_channel);
+ ClassDB::bind_method(D_METHOD("get_refraction_texture_channel"), &SpatialMaterial::get_refraction_texture_channel);
ADD_GROUP("Flags", "flags_");
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_vertex_lighting"), "set_flag", "get_flag", FLAG_USE_VERTEX_LIGHTING);
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_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_fixed_size"), "set_flag", "get_flag", FLAG_FIXED_SIZE);
ADD_GROUP("Vertex Color", "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"), "set_diffuse_mode", "get_diffuse_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "params_diffuse_mode", PROPERTY_HINT_ENUM, "Lambert,Lambert Wrap,Oren Nayar,Burley,Toon"), "set_diffuse_mode", "get_diffuse_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "params_specular_mode", PROPERTY_HINT_ENUM, "SchlickGGX,Blinn,Phong,Toon,Disabled"), "set_specular_mode", "get_specular_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_PROPERTY(PropertyInfo(Variant::INT, "params_billboard_mode", PROPERTY_HINT_ENUM, "Disabled,Enabled,Y-Billboard,Particle Billboard"), "set_billboard_mode", "get_billboard_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "params_grow"), "set_grow_enabled", "is_grow_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "params_grow_amount", PROPERTY_HINT_RANGE, "-16,10,0.01"), "set_grow", "get_grow");
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "params_use_alpha_scissor"), "set_flag", "get_flag", FLAG_USE_ALPHA_SCISSOR);
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "params_alpha_scissor_threshold", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_alpha_scissor_threshold", "get_alpha_scissor_threshold");
+ ADD_GROUP("Particles Anim", "particles_anim_");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "particles_anim_h_frames", PROPERTY_HINT_RANGE, "1,128,1"), "set_particles_anim_h_frames", "get_particles_anim_h_frames");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "particles_anim_v_frames", PROPERTY_HINT_RANGE, "1,128,1"), "set_particles_anim_v_frames", "get_particles_anim_v_frames");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "particles_anim_loop"), "set_particles_anim_loop", "get_particles_anim_loop");
ADD_GROUP("Albedo", "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"), "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("Metallic", "metallic_");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "metallic", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_metallic", "get_metallic");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "metallic_specular", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_specular", "get_specular");
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "metallic_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", TEXTURE_METALLIC);
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "metallic_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_metallic_texture_channel", "get_metallic_texture_channel");
+
+ ADD_GROUP("Roughness", "roughness_");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "roughness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_roughness", "get_roughness");
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "roughness_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", TEXTURE_ROUGHNESS);
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "roughness_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_roughness_texture_channel", "get_roughness_texture_channel");
ADD_GROUP("Emission", "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::COLOR, "emission", 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_GROUP("NormalMap", "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"), "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", 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"), "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", 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"), "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_PROPERTY(PropertyInfo(Variant::REAL, "anisotropy", PROPERTY_HINT_RANGE, "-1,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"), "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_PROPERTYI(PropertyInfo(Variant::BOOL, "ao_on_uv2"), "set_flag", "get_flag", FLAG_AO_ON_UV2);
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "ao_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_ao_texture_channel", "get_ao_texture_channel");
- ADD_GROUP("Height", "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("Depth", "depth_");
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "depth_enabled"), "set_feature", "get_feature", FEATURE_DEPTH_MAPPING);
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth_scale", PROPERTY_HINT_RANGE, "-16,16,0.01"), "set_depth_scale", "get_depth_scale");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "depth_deep_parallax"), "set_depth_deep_parallax", "is_depth_deep_parallax_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "depth_min_layers", PROPERTY_HINT_RANGE, "1,32,1"), "set_depth_deep_parallax_min_layers", "get_depth_deep_parallax_min_layers");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "depth_max_layers", PROPERTY_HINT_RANGE, "1,32,1"), "set_depth_deep_parallax_max_layers", "get_depth_deep_parallax_max_layers");
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "depth_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", TEXTURE_DEPTH);
ADD_GROUP("Subsurf Scatter", "subsurf_scatter_");
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "subsurf_scatter_enabled"), "set_feature", "get_feature", FEATURE_SUBSURACE_SCATTERING);
@@ -951,9 +1693,9 @@ void FixedSpatialMaterial::_bind_methods() {
ADD_GROUP("Refraction", "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_PROPERTY(PropertyInfo(Variant::REAL, "refraction_scale", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_refraction", "get_refraction");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "refraction_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", TEXTURE_REFRACTION);
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "refraction_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_refraction_texture_channel", "get_refraction_texture_channel");
ADD_GROUP("Detail", "detail_");
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "detail_enabled"), "set_feature", "get_feature", FEATURE_DETAIL);
@@ -964,25 +1706,29 @@ void FixedSpatialMaterial::_bind_methods() {
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"), "set_uv1_scale", "get_uv1_scale");
- ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "uv1_offset"), "set_uv1_offset", "get_uv1_offset");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "uv1_scale"), "set_uv1_scale", "get_uv1_scale");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "uv1_offset"), "set_uv1_offset", "get_uv1_offset");
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "uv1_triplanar"), "set_flag", "get_flag", FLAG_UV1_USE_TRIPLANAR);
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "uv1_triplanar_sharpness", PROPERTY_HINT_EXP_EASING), "set_uv1_triplanar_blend_sharpness", "get_uv1_triplanar_blend_sharpness");
ADD_GROUP("UV2", "uv2_");
- 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");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "uv2_scale"), "set_uv2_scale", "get_uv2_scale");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "uv2_offset"), "set_uv2_offset", "get_uv2_offset");
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "uv2_triplanar"), "set_flag", "get_flag", FLAG_UV2_USE_TRIPLANAR);
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "uv2_triplanar_sharpness", PROPERTY_HINT_EXP_EASING), "set_uv2_triplanar_blend_sharpness", "get_uv2_triplanar_blend_sharpness");
BIND_CONSTANT(TEXTURE_ALBEDO);
- BIND_CONSTANT(TEXTURE_SPECULAR);
+ BIND_CONSTANT(TEXTURE_METALLIC);
+ BIND_CONSTANT(TEXTURE_ROUGHNESS);
BIND_CONSTANT(TEXTURE_EMISSION);
BIND_CONSTANT(TEXTURE_NORMAL);
BIND_CONSTANT(TEXTURE_RIM);
BIND_CONSTANT(TEXTURE_CLEARCOAT);
BIND_CONSTANT(TEXTURE_FLOWMAP);
BIND_CONSTANT(TEXTURE_AMBIENT_OCCLUSION);
- BIND_CONSTANT(TEXTURE_HEIGHT);
+ BIND_CONSTANT(TEXTURE_DEPTH);
BIND_CONSTANT(TEXTURE_SUBSURFACE_SCATTERING);
BIND_CONSTANT(TEXTURE_REFRACTION);
- BIND_CONSTANT(TEXTURE_REFRACTION_ROUGHNESS);
BIND_CONSTANT(TEXTURE_DETAIL_MASK);
BIND_CONSTANT(TEXTURE_DETAIL_ALBEDO);
BIND_CONSTANT(TEXTURE_DETAIL_NORMAL);
@@ -998,7 +1744,7 @@ void FixedSpatialMaterial::_bind_methods() {
BIND_CONSTANT(FEATURE_CLEARCOAT);
BIND_CONSTANT(FEATURE_ANISOTROPY);
BIND_CONSTANT(FEATURE_AMBIENT_OCCLUSION);
- BIND_CONSTANT(FEATURE_HEIGHT_MAPPING);
+ BIND_CONSTANT(FEATURE_DEPTH_MAPPING);
BIND_CONSTANT(FEATURE_SUBSURACE_SCATTERING);
BIND_CONSTANT(FEATURE_REFRACTION);
BIND_CONSTANT(FEATURE_DETAIL);
@@ -1019,30 +1765,50 @@ void FixedSpatialMaterial::_bind_methods() {
BIND_CONSTANT(CULL_DISABLED);
BIND_CONSTANT(FLAG_UNSHADED);
+ BIND_CONSTANT(FLAG_USE_VERTEX_LIGHTING);
BIND_CONSTANT(FLAG_ONTOP);
BIND_CONSTANT(FLAG_ALBEDO_FROM_VERTEX_COLOR);
- BIND_CONSTANT(FLAG_SRGB_VERTEX_COLOR)
- BIND_CONSTANT(FLAG_USE_POINT_SIZE)
+ BIND_CONSTANT(FLAG_SRGB_VERTEX_COLOR);
+ BIND_CONSTANT(FLAG_USE_POINT_SIZE);
+ BIND_CONSTANT(FLAG_FIXED_SIZE);
+ BIND_CONSTANT(FLAG_UV1_USE_TRIPLANAR);
+ BIND_CONSTANT(FLAG_UV2_USE_TRIPLANAR);
+ BIND_CONSTANT(FLAG_AO_ON_UV2);
+ BIND_CONSTANT(FLAG_USE_ALPHA_SCISSOR);
BIND_CONSTANT(FLAG_MAX);
BIND_CONSTANT(DIFFUSE_LAMBERT);
- BIND_CONSTANT(DIFFUSE_LAMBERT_WRAP);
+ BIND_CONSTANT(DIFFUSE_HALF_LAMBERT);
BIND_CONSTANT(DIFFUSE_OREN_NAYAR);
BIND_CONSTANT(DIFFUSE_BURLEY);
+ BIND_CONSTANT(DIFFUSE_TOON);
+
+ BIND_CONSTANT(SPECULAR_SCHLICK_GGX);
+ BIND_CONSTANT(SPECULAR_BLINN);
+ BIND_CONSTANT(SPECULAR_PHONG);
+ BIND_CONSTANT(SPECULAR_TOON);
+ BIND_CONSTANT(SPECULAR_DISABLED);
+
+ BIND_CONSTANT(BILLBOARD_DISABLED);
+ BIND_CONSTANT(BILLBOARD_ENABLED);
+ BIND_CONSTANT(BILLBOARD_FIXED_Y);
+ BIND_CONSTANT(BILLBOARD_PARTICLES);
- BIND_CONSTANT(SPECULAR_MODE_METALLIC);
- BIND_CONSTANT(SPECULAR_MODE_SPECULAR);
+ BIND_CONSTANT(TEXTURE_CHANNEL_RED);
+ BIND_CONSTANT(TEXTURE_CHANNEL_GREEN);
+ BIND_CONSTANT(TEXTURE_CHANNEL_BLUE);
+ BIND_CONSTANT(TEXTURE_CHANNEL_ALPHA);
+ BIND_CONSTANT(TEXTURE_CHANNEL_GRAYSCALE);
}
-FixedSpatialMaterial::FixedSpatialMaterial()
+SpatialMaterial::SpatialMaterial()
: element(this) {
//initialize to right values
- specular_mode = SPECULAR_MODE_METALLIC;
- set_albedo(Color(0.7, 0.7, 0.7, 1.0));
- set_specular(Color(0.1, 0.1, 0.1));
+ set_albedo(Color(1.0, 1.0, 1.0, 1.0));
+ set_specular(0.5);
set_roughness(0.0);
- set_metalness(0.1);
+ set_metallic(0.0);
set_emission(Color(0, 0, 0));
set_emission_energy(1.0);
set_normal_scale(1);
@@ -1051,16 +1817,34 @@ FixedSpatialMaterial::FixedSpatialMaterial()
set_clearcoat(1);
set_clearcoat_gloss(0.5);
set_anisotropy(0);
- set_height_scale(1);
+ set_depth_scale(0.05);
set_subsurface_scattering_strength(0);
- set_refraction(0);
- set_refraction_roughness(0);
+ set_refraction(0.05);
set_line_width(1);
set_point_size(1);
- set_uv1_offset(Vector2(0, 0));
- set_uv1_scale(Vector2(1, 1));
- set_uv2_offset(Vector2(0, 0));
- set_uv2_scale(Vector2(1, 1));
+ set_uv1_offset(Vector3(0, 0, 0));
+ set_uv1_scale(Vector3(1, 1, 1));
+ set_uv1_triplanar_blend_sharpness(1);
+ set_uv2_offset(Vector3(0, 0, 0));
+ set_uv2_scale(Vector3(1, 1, 1));
+ set_uv2_triplanar_blend_sharpness(1);
+ set_billboard_mode(BILLBOARD_DISABLED);
+ set_particles_anim_h_frames(1);
+ set_particles_anim_v_frames(1);
+ set_particles_anim_loop(false);
+ set_alpha_scissor_threshold(0.98);
+
+ set_metallic_texture_channel(TEXTURE_CHANNEL_RED);
+ set_roughness_texture_channel(TEXTURE_CHANNEL_RED);
+ set_ao_texture_channel(TEXTURE_CHANNEL_RED);
+ set_refraction_texture_channel(TEXTURE_CHANNEL_RED);
+
+ grow_enabled = false;
+ set_grow(0.0);
+
+ deep_parallax = false;
+ set_depth_deep_parallax_min_layers(8);
+ set_depth_deep_parallax_max_layers(32);
detail_uv = DETAIL_UV_1;
blend_mode = BLEND_MODE_MIX;
@@ -1071,6 +1855,7 @@ FixedSpatialMaterial::FixedSpatialMaterial()
flags[i] = 0;
}
diffuse_mode = DIFFUSE_LAMBERT;
+ specular_mode = SPECULAR_SCHLICK_GGX;
for (int i = 0; i < FEATURE_MAX; i++) {
features[i] = false;
@@ -1081,7 +1866,7 @@ FixedSpatialMaterial::FixedSpatialMaterial()
_queue_shader_change();
}
-FixedSpatialMaterial::~FixedSpatialMaterial() {
+SpatialMaterial::~SpatialMaterial() {
if (material_mutex)
material_mutex->lock();
diff --git a/scene/resources/material.h b/scene/resources/material.h
index a8288153c3..140b2142c9 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,39 +42,69 @@
class Material : public Resource {
- GDCLASS(Material, Resource);
- RES_BASE_EXTENSION("mtl");
- OBJ_SAVE_TYPE(Material);
+ GDCLASS(Material, Resource)
+ RES_BASE_EXTENSION("material")
+ OBJ_SAVE_TYPE(Material)
RID material;
+ Ref<Material> next_pass;
protected:
_FORCE_INLINE_ RID _get_material() const { return material; }
+ static void _bind_methods();
public:
+ void set_next_pass(const Ref<Material> &p_pass);
+ Ref<Material> get_next_pass() const;
+
virtual RID get_rid() const;
Material();
virtual ~Material();
};
-class FixedSpatialMaterial : public Material {
+class ShaderMaterial : public Material {
+
+ GDCLASS(ShaderMaterial, Material);
+ Ref<Shader> shader;
+
+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;
+
+ static void _bind_methods();
- GDCLASS(FixedSpatialMaterial, Material)
+ void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const;
+
+public:
+ void set_shader(const Ref<Shader> &p_shader);
+ Ref<Shader> get_shader() const;
+
+ void set_shader_param(const StringName &p_param, const Variant &p_value);
+ Variant get_shader_param(const StringName &p_param) const;
+
+ ShaderMaterial();
+ ~ShaderMaterial();
+};
+
+class SpatialMaterial : public Material {
+
+ GDCLASS(SpatialMaterial, Material)
public:
enum TextureParam {
TEXTURE_ALBEDO,
- TEXTURE_SPECULAR,
+ TEXTURE_METALLIC,
+ TEXTURE_ROUGHNESS,
TEXTURE_EMISSION,
TEXTURE_NORMAL,
TEXTURE_RIM,
TEXTURE_CLEARCOAT,
TEXTURE_FLOWMAP,
TEXTURE_AMBIENT_OCCLUSION,
- TEXTURE_HEIGHT,
+ TEXTURE_DEPTH,
TEXTURE_SUBSURFACE_SCATTERING,
TEXTURE_REFRACTION,
- TEXTURE_REFRACTION_ROUGHNESS,
TEXTURE_DETAIL_MASK,
TEXTURE_DETAIL_ALBEDO,
TEXTURE_DETAIL_NORMAL,
@@ -94,7 +125,7 @@ public:
FEATURE_CLEARCOAT,
FEATURE_ANISOTROPY,
FEATURE_AMBIENT_OCCLUSION,
- FEATURE_HEIGHT_MAPPING,
+ FEATURE_DEPTH_MAPPING,
FEATURE_SUBSURACE_SCATTERING,
FEATURE_REFRACTION,
FEATURE_DETAIL,
@@ -124,42 +155,70 @@ public:
enum Flags {
FLAG_UNSHADED,
+ FLAG_USE_VERTEX_LIGHTING,
FLAG_ONTOP,
FLAG_ALBEDO_FROM_VERTEX_COLOR,
FLAG_SRGB_VERTEX_COLOR,
FLAG_USE_POINT_SIZE,
+ FLAG_FIXED_SIZE,
+ FLAG_UV1_USE_TRIPLANAR,
+ FLAG_UV2_USE_TRIPLANAR,
+ FLAG_AO_ON_UV2,
+ FLAG_USE_ALPHA_SCISSOR,
FLAG_MAX
};
enum DiffuseMode {
DIFFUSE_LAMBERT,
- DIFFUSE_LAMBERT_WRAP,
+ DIFFUSE_HALF_LAMBERT,
DIFFUSE_OREN_NAYAR,
DIFFUSE_BURLEY,
+ DIFFUSE_TOON,
};
enum SpecularMode {
- SPECULAR_MODE_METALLIC,
- SPECULAR_MODE_SPECULAR,
+ SPECULAR_SCHLICK_GGX,
+ SPECULAR_BLINN,
+ SPECULAR_PHONG,
+ SPECULAR_TOON,
+ SPECULAR_DISABLED,
+ };
+
+ enum BillboardMode {
+ BILLBOARD_DISABLED,
+ BILLBOARD_ENABLED,
+ BILLBOARD_FIXED_Y,
+ BILLBOARD_PARTICLES,
+ };
+
+ enum TextureChannel {
+ TEXTURE_CHANNEL_RED,
+ TEXTURE_CHANNEL_GREEN,
+ TEXTURE_CHANNEL_BLUE,
+ TEXTURE_CHANNEL_ALPHA,
+ TEXTURE_CHANNEL_GRAYSCALE
};
private:
union MaterialKey {
struct {
- uint32_t feature_mask : 14;
- uint32_t detail_uv : 1;
- uint32_t blend_mode : 2;
- uint32_t depth_draw_mode : 2;
- uint32_t cull_mode : 2;
- uint32_t flags : 5;
- uint32_t detail_blend_mode : 2;
- uint32_t diffuse_mode : 2;
- uint32_t invalid_key : 1;
- uint32_t specular_mode : 1;
+ uint64_t feature_mask : 11;
+ uint64_t detail_uv : 1;
+ uint64_t blend_mode : 2;
+ uint64_t depth_draw_mode : 2;
+ uint64_t cull_mode : 2;
+ uint64_t flags : 11;
+ uint64_t detail_blend_mode : 2;
+ uint64_t diffuse_mode : 3;
+ uint64_t specular_mode : 2;
+ uint64_t invalid_key : 1;
+ uint64_t deep_parallax : 1;
+ uint64_t billboard_mode : 2;
+ uint64_t grow : 1;
};
- uint32_t key;
+ uint64_t key;
bool operator<(const MaterialKey &p_key) const {
return key < p_key.key;
@@ -196,6 +255,9 @@ private:
mk.detail_blend_mode = detail_blend_mode;
mk.diffuse_mode = diffuse_mode;
mk.specular_mode = specular_mode;
+ mk.billboard_mode = billboard_mode;
+ mk.deep_parallax = deep_parallax ? 1 : 0;
+ mk.grow = grow_enabled;
return mk;
}
@@ -203,7 +265,7 @@ private:
struct ShaderNames {
StringName albedo;
StringName specular;
- StringName metalness;
+ StringName metallic;
StringName roughness;
StringName emission;
StringName emission_energy;
@@ -213,31 +275,48 @@ private:
StringName clearcoat;
StringName clearcoat_gloss;
StringName anisotropy;
- StringName height_scale;
+ StringName depth_scale;
StringName subsurface_scattering_strength;
StringName refraction;
- StringName refraction_roughness;
StringName point_size;
StringName uv1_scale;
StringName uv1_offset;
StringName uv2_scale;
StringName uv2_offset;
+ StringName particle_h_frames;
+ StringName particle_v_frames;
+ StringName particles_anim_loop;
+ StringName depth_min_layers;
+ StringName depth_max_layers;
+ StringName uv1_blend_sharpness;
+ StringName uv2_blend_sharpness;
+ StringName grow;
+
+ StringName metallic_texture_channel;
+ StringName roughness_texture_channel;
+ StringName ao_texture_channel;
+ StringName clearcoat_texture_channel;
+ StringName rim_texture_channel;
+ StringName depth_texture_channel;
+ StringName refraction_texture_channel;
+ StringName alpha_scissor_threshold;
+
StringName texture_names[TEXTURE_MAX];
};
static Mutex *material_mutex;
- static SelfList<FixedSpatialMaterial>::List dirty_materials;
+ static SelfList<SpatialMaterial>::List dirty_materials;
static ShaderNames *shader_names;
- SelfList<FixedSpatialMaterial> element;
+ SelfList<SpatialMaterial> element;
void _update_shader();
_FORCE_INLINE_ void _queue_shader_change();
_FORCE_INLINE_ bool _is_shader_dirty() const;
Color albedo;
- Color specular;
- float metalness;
+ float specular;
+ float metallic;
float roughness;
Color emission;
float emission_energy;
@@ -247,28 +326,45 @@ private:
float clearcoat;
float clearcoat_gloss;
float anisotropy;
- float height_scale;
+ float depth_scale;
float subsurface_scattering_strength;
float refraction;
- float refraction_roughness;
float line_width;
float point_size;
+ float alpha_scissor_threshold;
+ bool grow_enabled;
+ float grow;
+ int particles_anim_h_frames;
+ int particles_anim_v_frames;
+ bool particles_anim_loop;
- Vector2 uv1_scale;
- Vector2 uv1_offset;
+ Vector3 uv1_scale;
+ Vector3 uv1_offset;
+ float uv1_triplanar_sharpness;
- Vector2 uv2_scale;
- Vector2 uv2_offset;
+ Vector3 uv2_scale;
+ Vector3 uv2_offset;
+ float uv2_triplanar_sharpness;
DetailUV detail_uv;
+ bool deep_parallax;
+ int deep_parallax_min_layers;
+ int deep_parallax_max_layers;
+
BlendMode blend_mode;
BlendMode detail_blend_mode;
DepthDrawMode depth_draw_mode;
CullMode cull_mode;
bool flags[FLAG_MAX];
- DiffuseMode diffuse_mode;
SpecularMode specular_mode;
+ DiffuseMode diffuse_mode;
+ BillboardMode billboard_mode;
+
+ TextureChannel metallic_texture_channel;
+ TextureChannel roughness_texture_channel;
+ TextureChannel ao_texture_channel;
+ TextureChannel refraction_texture_channel;
bool features[FEATURE_MAX];
@@ -276,6 +372,12 @@ private:
_FORCE_INLINE_ void _validate_feature(const String &text, Feature feature, PropertyInfo &property) const;
+ enum {
+ MAX_MATERIALS_FOR_2D = 32
+ };
+
+ static Ref<SpatialMaterial> materials_for_2d[MAX_MATERIALS_FOR_2D]; //used by Sprite3D and other stuff
+
protected:
static void _bind_methods();
void _validate_property(PropertyInfo &property) const;
@@ -284,14 +386,11 @@ public:
void set_albedo(const Color &p_albedo);
Color get_albedo() const;
- void set_specular_mode(SpecularMode p_mode);
- SpecularMode get_specular_mode() const;
-
- void set_specular(const Color &p_specular);
- Color get_specular() const;
+ void set_specular(float p_specular);
+ float get_specular() const;
- void set_metalness(float p_metalness);
- float get_metalness() const;
+ void set_metallic(float p_metallic);
+ float get_metallic() const;
void set_roughness(float p_roughness);
float get_roughness() const;
@@ -320,18 +419,24 @@ public:
void set_anisotropy(float p_anisotropy);
float get_anisotropy() const;
- void set_height_scale(float p_height_scale);
- float get_height_scale() const;
+ void set_depth_scale(float p_depth_scale);
+ float get_depth_scale() const;
- void set_subsurface_scattering_strength(float p_strength);
+ void set_depth_deep_parallax(bool p_enable);
+ bool is_depth_deep_parallax_enabled() const;
+
+ void set_depth_deep_parallax_min_layers(int p_layer);
+ int get_depth_deep_parallax_min_layers() const;
+
+ void set_depth_deep_parallax_max_layers(int p_layer);
+ int get_depth_deep_parallax_max_layers() const;
+
+ void set_subsurface_scattering_strength(float p_subsurface_scattering_strength);
float get_subsurface_scattering_strength() const;
void set_refraction(float p_refraction);
float get_refraction() const;
- void set_refraction_roughness(float p_refraction_roughness);
- float get_refraction_roughness() const;
-
void set_line_width(float p_line_width);
float get_line_width() const;
@@ -356,6 +461,9 @@ public:
void set_diffuse_mode(DiffuseMode p_mode);
DiffuseMode get_diffuse_mode() const;
+ void set_specular_mode(SpecularMode p_mode);
+ SpecularMode get_specular_mode() const;
+
void set_flag(Flags p_flag, bool p_enabled);
bool get_flag(Flags p_flag) const;
@@ -365,35 +473,74 @@ public:
void set_feature(Feature p_feature, bool p_enabled);
bool get_feature(Feature p_feature) const;
- void set_uv1_scale(const Vector2 &p_scale);
- Vector2 get_uv1_scale() const;
+ void set_uv1_scale(const Vector3 &p_scale);
+ Vector3 get_uv1_scale() const;
+
+ void set_uv1_offset(const Vector3 &p_offset);
+ Vector3 get_uv1_offset() const;
+
+ void set_uv1_triplanar_blend_sharpness(float p_sharpness);
+ float get_uv1_triplanar_blend_sharpness() const;
+
+ void set_uv2_scale(const Vector3 &p_scale);
+ Vector3 get_uv2_scale() const;
+
+ void set_uv2_offset(const Vector3 &p_offset);
+ Vector3 get_uv2_offset() const;
+
+ void set_uv2_triplanar_blend_sharpness(float p_sharpness);
+ float get_uv2_triplanar_blend_sharpness() const;
- void set_uv1_offset(const Vector2 &p_offset);
- Vector2 get_uv1_offset() const;
+ void set_billboard_mode(BillboardMode p_mode);
+ BillboardMode get_billboard_mode() const;
- void set_uv2_scale(const Vector2 &p_scale);
- Vector2 get_uv2_scale() const;
+ void set_particles_anim_h_frames(int p_frames);
+ int get_particles_anim_h_frames() const;
+ void set_particles_anim_v_frames(int p_frames);
+ int get_particles_anim_v_frames() const;
- void set_uv2_offset(const Vector2 &p_offset);
- Vector2 get_uv2_offset() const;
+ void set_particles_anim_loop(int p_frames);
+ int get_particles_anim_loop() const;
+
+ void set_grow_enabled(bool p_enable);
+ bool is_grow_enabled() const;
+
+ void set_grow(float p_grow);
+ float get_grow() const;
+
+ void set_alpha_scissor_threshold(float p_treshold);
+ float get_alpha_scissor_threshold() const;
+
+ void set_metallic_texture_channel(TextureChannel p_channel);
+ TextureChannel get_metallic_texture_channel() const;
+ void set_roughness_texture_channel(TextureChannel p_channel);
+ TextureChannel get_roughness_texture_channel() const;
+ void set_ao_texture_channel(TextureChannel p_channel);
+ TextureChannel get_ao_texture_channel() const;
+ void set_refraction_texture_channel(TextureChannel p_channel);
+ TextureChannel get_refraction_texture_channel() const;
static void init_shaders();
static void finish_shaders();
static void flush_changes();
- FixedSpatialMaterial();
- virtual ~FixedSpatialMaterial();
+ static RID get_material_rid_for_2d(bool p_shaded, bool p_transparent, bool p_double_sided, bool p_cut_alpha, bool p_opaque_prepass);
+
+ SpatialMaterial();
+ virtual ~SpatialMaterial();
};
-VARIANT_ENUM_CAST(FixedSpatialMaterial::TextureParam)
-VARIANT_ENUM_CAST(FixedSpatialMaterial::DetailUV)
-VARIANT_ENUM_CAST(FixedSpatialMaterial::Feature)
-VARIANT_ENUM_CAST(FixedSpatialMaterial::BlendMode)
-VARIANT_ENUM_CAST(FixedSpatialMaterial::DepthDrawMode)
-VARIANT_ENUM_CAST(FixedSpatialMaterial::CullMode)
-VARIANT_ENUM_CAST(FixedSpatialMaterial::Flags)
-VARIANT_ENUM_CAST(FixedSpatialMaterial::DiffuseMode)
-VARIANT_ENUM_CAST(FixedSpatialMaterial::SpecularMode)
+VARIANT_ENUM_CAST(SpatialMaterial::TextureParam)
+VARIANT_ENUM_CAST(SpatialMaterial::DetailUV)
+VARIANT_ENUM_CAST(SpatialMaterial::Feature)
+VARIANT_ENUM_CAST(SpatialMaterial::BlendMode)
+VARIANT_ENUM_CAST(SpatialMaterial::DepthDrawMode)
+VARIANT_ENUM_CAST(SpatialMaterial::CullMode)
+VARIANT_ENUM_CAST(SpatialMaterial::Flags)
+VARIANT_ENUM_CAST(SpatialMaterial::DiffuseMode)
+VARIANT_ENUM_CAST(SpatialMaterial::SpecularMode)
+VARIANT_ENUM_CAST(SpatialMaterial::BillboardMode)
+VARIANT_ENUM_CAST(SpatialMaterial::TextureChannel)
//////////////////////
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index f951cf1620..af30e75aed 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,6 +32,401 @@
#include "scene/resources/convex_polygon_shape.h"
#include "surface_tool.h"
+void Mesh::_clear_triangle_mesh() const {
+
+ triangle_mesh.unref();
+ ;
+}
+
+Ref<TriangleMesh> Mesh::generate_triangle_mesh() const {
+
+ if (triangle_mesh.is_valid())
+ return triangle_mesh;
+
+ int facecount = 0;
+
+ for (int i = 0; i < get_surface_count(); i++) {
+
+ if (surface_get_primitive_type(i) != PRIMITIVE_TRIANGLES)
+ continue;
+
+ if (surface_get_format(i) & ARRAY_FORMAT_INDEX) {
+
+ facecount += surface_get_array_index_len(i);
+ } else {
+
+ facecount += surface_get_array_len(i);
+ }
+ }
+
+ if (facecount == 0 || (facecount % 3) != 0)
+ return triangle_mesh;
+
+ PoolVector<Vector3> faces;
+ faces.resize(facecount);
+ PoolVector<Vector3>::Write facesw = faces.write();
+
+ int widx = 0;
+
+ for (int i = 0; i < get_surface_count(); i++) {
+
+ if (surface_get_primitive_type(i) != PRIMITIVE_TRIANGLES)
+ continue;
+
+ Array a = surface_get_arrays(i);
+
+ int vc = surface_get_array_len(i);
+ PoolVector<Vector3> vertices = a[ARRAY_VERTEX];
+ PoolVector<Vector3>::Read vr = vertices.read();
+
+ if (surface_get_format(i) & ARRAY_FORMAT_INDEX) {
+
+ int ic = surface_get_array_index_len(i);
+ PoolVector<int> indices = a[ARRAY_INDEX];
+ PoolVector<int>::Read ir = indices.read();
+
+ for (int i = 0; i < ic; i++) {
+ int index = ir[i];
+ facesw[widx++] = vr[index];
+ }
+
+ } else {
+
+ for (int i = 0; i < vc; i++)
+ facesw[widx++] = vr[i];
+ }
+ }
+
+ facesw = PoolVector<Vector3>::Write();
+
+ triangle_mesh = Ref<TriangleMesh>(memnew(TriangleMesh));
+ triangle_mesh->create(faces);
+
+ return triangle_mesh;
+}
+
+PoolVector<Face3> Mesh::get_faces() const {
+
+ Ref<TriangleMesh> tm = generate_triangle_mesh();
+ if (tm.is_valid())
+ return tm->get_faces();
+ return PoolVector<Face3>();
+ /*
+ for (int i=0;i<surfaces.size();i++) {
+
+ if (VisualServer::get_singleton()->mesh_surface_get_primitive_type( mesh, i ) != VisualServer::PRIMITIVE_TRIANGLES )
+ continue;
+
+ PoolVector<int> indices;
+ PoolVector<Vector3> vertices;
+
+ vertices=VisualServer::get_singleton()->mesh_surface_get_array(mesh, i,VisualServer::ARRAY_VERTEX);
+
+ int len=VisualServer::get_singleton()->mesh_surface_get_array_index_len(mesh, i);
+ bool has_indices;
+
+ if (len>0) {
+
+ indices=VisualServer::get_singleton()->mesh_surface_get_array(mesh, i,VisualServer::ARRAY_INDEX);
+ has_indices=true;
+
+ } else {
+
+ len=vertices.size();
+ has_indices=false;
+ }
+
+ if (len<=0)
+ continue;
+
+ PoolVector<int>::Read indicesr = indices.read();
+ const int *indicesptr = indicesr.ptr();
+
+ PoolVector<Vector3>::Read verticesr = vertices.read();
+ const Vector3 *verticesptr = verticesr.ptr();
+
+ int old_faces=faces.size();
+ int new_faces=old_faces+(len/3);
+
+ faces.resize(new_faces);
+
+ PoolVector<Face3>::Write facesw = faces.write();
+ Face3 *facesptr=facesw.ptr();
+
+
+ for (int i=0;i<len/3;i++) {
+
+ Face3 face;
+
+ for (int j=0;j<3;j++) {
+
+ int idx=i*3+j;
+ face.vertex[j] = has_indices ? verticesptr[ indicesptr[ idx ] ] : verticesptr[idx];
+ }
+
+ facesptr[i+old_faces]=face;
+ }
+
+ }
+*/
+}
+
+Ref<Shape> Mesh::create_convex_shape() const {
+
+ PoolVector<Vector3> vertices;
+
+ for (int i = 0; i < get_surface_count(); i++) {
+
+ Array a = surface_get_arrays(i);
+ PoolVector<Vector3> v = a[ARRAY_VERTEX];
+ vertices.append_array(v);
+ }
+
+ Ref<ConvexPolygonShape> shape = memnew(ConvexPolygonShape);
+ shape->set_points(vertices);
+ return shape;
+}
+
+Ref<Shape> Mesh::create_trimesh_shape() const {
+
+ PoolVector<Face3> faces = get_faces();
+ if (faces.size() == 0)
+ return Ref<Shape>();
+
+ PoolVector<Vector3> face_points;
+ face_points.resize(faces.size() * 3);
+
+ for (int i = 0; i < face_points.size(); i++) {
+
+ Face3 f = faces.get(i / 3);
+ face_points.set(i, f.vertex[i % 3]);
+ }
+
+ Ref<ConcavePolygonShape> shape = memnew(ConcavePolygonShape);
+ shape->set_faces(face_points);
+ return shape;
+}
+
+Ref<Mesh> Mesh::create_outline(float p_margin) const {
+
+ Array arrays;
+ int index_accum = 0;
+ for (int i = 0; i < get_surface_count(); i++) {
+
+ if (surface_get_primitive_type(i) != PRIMITIVE_TRIANGLES)
+ continue;
+
+ Array a = surface_get_arrays(i);
+ int vcount = 0;
+
+ if (i == 0) {
+ arrays = a;
+ PoolVector<Vector3> v = a[ARRAY_VERTEX];
+ index_accum += v.size();
+ } else {
+
+ for (int j = 0; j < arrays.size(); j++) {
+
+ if (arrays[j].get_type() == Variant::NIL || a[j].get_type() == Variant::NIL) {
+ //mismatch, do not use
+ arrays[j] = Variant();
+ continue;
+ }
+
+ switch (j) {
+
+ case ARRAY_VERTEX:
+ case ARRAY_NORMAL: {
+
+ PoolVector<Vector3> dst = arrays[j];
+ PoolVector<Vector3> src = a[j];
+ if (j == ARRAY_VERTEX)
+ vcount = src.size();
+ if (dst.size() == 0 || src.size() == 0) {
+ arrays[j] = Variant();
+ continue;
+ }
+ dst.append_array(src);
+ arrays[j] = dst;
+ } break;
+ case ARRAY_TANGENT:
+ case ARRAY_BONES:
+ case ARRAY_WEIGHTS: {
+
+ PoolVector<real_t> dst = arrays[j];
+ PoolVector<real_t> src = a[j];
+ if (dst.size() == 0 || src.size() == 0) {
+ arrays[j] = Variant();
+ continue;
+ }
+ dst.append_array(src);
+ arrays[j] = dst;
+
+ } break;
+ case ARRAY_COLOR: {
+ PoolVector<Color> dst = arrays[j];
+ PoolVector<Color> src = a[j];
+ if (dst.size() == 0 || src.size() == 0) {
+ arrays[j] = Variant();
+ continue;
+ }
+ dst.append_array(src);
+ arrays[j] = dst;
+
+ } break;
+ case ARRAY_TEX_UV:
+ case ARRAY_TEX_UV2: {
+ PoolVector<Vector2> dst = arrays[j];
+ PoolVector<Vector2> src = a[j];
+ if (dst.size() == 0 || src.size() == 0) {
+ arrays[j] = Variant();
+ continue;
+ }
+ dst.append_array(src);
+ arrays[j] = dst;
+
+ } break;
+ case ARRAY_INDEX: {
+ PoolVector<int> dst = arrays[j];
+ PoolVector<int> src = a[j];
+ if (dst.size() == 0 || src.size() == 0) {
+ arrays[j] = Variant();
+ continue;
+ }
+ {
+ int ss = src.size();
+ PoolVector<int>::Write w = src.write();
+ for (int k = 0; k < ss; k++) {
+ w[k] += index_accum;
+ }
+ }
+ dst.append_array(src);
+ arrays[j] = dst;
+ index_accum += vcount;
+
+ } break;
+ }
+ }
+ }
+ }
+
+ {
+ PoolVector<int>::Write ir;
+ PoolVector<int> indices = arrays[ARRAY_INDEX];
+ bool has_indices = false;
+ PoolVector<Vector3> vertices = arrays[ARRAY_VERTEX];
+ int vc = vertices.size();
+ ERR_FAIL_COND_V(!vc, Ref<ArrayMesh>());
+ PoolVector<Vector3>::Write r = vertices.write();
+
+ if (indices.size()) {
+ vc = indices.size();
+ ir = indices.write();
+ has_indices = true;
+ }
+
+ Map<Vector3, Vector3> normal_accum;
+
+ //fill normals with triangle normals
+ for (int i = 0; i < vc; i += 3) {
+
+ Vector3 t[3];
+
+ if (has_indices) {
+ t[0] = r[ir[i + 0]];
+ t[1] = r[ir[i + 1]];
+ t[2] = r[ir[i + 2]];
+ } else {
+ t[0] = r[i + 0];
+ t[1] = r[i + 1];
+ t[2] = r[i + 2];
+ }
+
+ Vector3 n = Plane(t[0], t[1], t[2]).normal;
+
+ for (int j = 0; j < 3; j++) {
+
+ Map<Vector3, Vector3>::Element *E = normal_accum.find(t[j]);
+ if (!E) {
+ normal_accum[t[j]] = n;
+ } else {
+ float d = n.dot(E->get());
+ if (d < 1.0)
+ E->get() += n * (1.0 - d);
+ //E->get()+=n;
+ }
+ }
+ }
+
+ //normalize
+
+ for (Map<Vector3, Vector3>::Element *E = normal_accum.front(); E; E = E->next()) {
+ E->get().normalize();
+ }
+
+ //displace normals
+ int vc2 = vertices.size();
+
+ for (int i = 0; i < vc2; i++) {
+
+ Vector3 t = r[i];
+
+ Map<Vector3, Vector3>::Element *E = normal_accum.find(t);
+ ERR_CONTINUE(!E);
+
+ t += E->get() * p_margin;
+ r[i] = t;
+ }
+
+ r = PoolVector<Vector3>::Write();
+ arrays[ARRAY_VERTEX] = vertices;
+
+ if (!has_indices) {
+
+ PoolVector<int> new_indices;
+ new_indices.resize(vertices.size());
+ PoolVector<int>::Write iw = new_indices.write();
+
+ for (int j = 0; j < vc2; j += 3) {
+
+ iw[j] = j;
+ iw[j + 1] = j + 2;
+ iw[j + 2] = j + 1;
+ }
+
+ iw = PoolVector<int>::Write();
+ arrays[ARRAY_INDEX] = new_indices;
+
+ } else {
+
+ for (int j = 0; j < vc; j += 3) {
+
+ SWAP(ir[j + 1], ir[j + 2]);
+ }
+ ir = PoolVector<int>::Write();
+ arrays[ARRAY_INDEX] = indices;
+ }
+ }
+
+ Ref<ArrayMesh> newmesh = memnew(ArrayMesh);
+ newmesh->add_surface_from_arrays(PRIMITIVE_TRIANGLES, arrays);
+ return newmesh;
+}
+
+void Mesh::_bind_methods() {
+
+ BIND_CONSTANT(PRIMITIVE_POINTS);
+ BIND_CONSTANT(PRIMITIVE_LINES);
+ BIND_CONSTANT(PRIMITIVE_LINE_STRIP);
+ BIND_CONSTANT(PRIMITIVE_LINE_LOOP);
+ BIND_CONSTANT(PRIMITIVE_TRIANGLES);
+ BIND_CONSTANT(PRIMITIVE_TRIANGLE_STRIP);
+ BIND_CONSTANT(PRIMITIVE_TRIANGLE_FAN);
+}
+
+Mesh::Mesh() {
+}
+
static const char *_array_name[] = {
"vertex_array",
"normal_array",
@@ -44,34 +440,34 @@ static const char *_array_name[] = {
NULL
};
-static const Mesh::ArrayType _array_types[] = {
-
- Mesh::ARRAY_VERTEX,
- Mesh::ARRAY_NORMAL,
- Mesh::ARRAY_TANGENT,
- Mesh::ARRAY_COLOR,
- Mesh::ARRAY_TEX_UV,
- Mesh::ARRAY_TEX_UV2,
- Mesh::ARRAY_BONES,
- Mesh::ARRAY_WEIGHTS,
- Mesh::ARRAY_INDEX
+static const ArrayMesh::ArrayType _array_types[] = {
+
+ ArrayMesh::ARRAY_VERTEX,
+ ArrayMesh::ARRAY_NORMAL,
+ ArrayMesh::ARRAY_TANGENT,
+ ArrayMesh::ARRAY_COLOR,
+ ArrayMesh::ARRAY_TEX_UV,
+ ArrayMesh::ARRAY_TEX_UV2,
+ ArrayMesh::ARRAY_BONES,
+ ArrayMesh::ARRAY_WEIGHTS,
+ ArrayMesh::ARRAY_INDEX
};
/* compatibility */
static const int _format_translate[] = {
- Mesh::ARRAY_FORMAT_VERTEX,
- Mesh::ARRAY_FORMAT_NORMAL,
- Mesh::ARRAY_FORMAT_TANGENT,
- Mesh::ARRAY_FORMAT_COLOR,
- Mesh::ARRAY_FORMAT_TEX_UV,
- Mesh::ARRAY_FORMAT_TEX_UV2,
- Mesh::ARRAY_FORMAT_BONES,
- Mesh::ARRAY_FORMAT_WEIGHTS,
- Mesh::ARRAY_FORMAT_INDEX,
+ ArrayMesh::ARRAY_FORMAT_VERTEX,
+ ArrayMesh::ARRAY_FORMAT_NORMAL,
+ ArrayMesh::ARRAY_FORMAT_TANGENT,
+ ArrayMesh::ARRAY_FORMAT_COLOR,
+ ArrayMesh::ARRAY_FORMAT_TEX_UV,
+ ArrayMesh::ARRAY_FORMAT_TEX_UV2,
+ ArrayMesh::ARRAY_FORMAT_BONES,
+ ArrayMesh::ARRAY_FORMAT_WEIGHTS,
+ ArrayMesh::ARRAY_FORMAT_INDEX,
};
-bool Mesh::_set(const StringName &p_name, const Variant &p_value) {
+bool ArrayMesh::_set(const StringName &p_name, const Variant &p_value) {
String sname = p_name;
@@ -190,7 +586,10 @@ bool Mesh::_set(const StringName &p_name, const Variant &p_value) {
return false;
}
-bool Mesh::_get(const StringName &p_name, Variant &r_ret) const {
+bool ArrayMesh::_get(const StringName &p_name, Variant &r_ret) const {
+
+ if (_is_generated())
+ return false;
String sname = p_name;
@@ -266,7 +665,10 @@ bool Mesh::_get(const StringName &p_name, Variant &r_ret) const {
return true;
}
-void Mesh::_get_property_list(List<PropertyInfo> *p_list) const {
+void ArrayMesh::_get_property_list(List<PropertyInfo> *p_list) const {
+
+ if (_is_generated())
+ return;
if (blend_shapes.size()) {
p_list->push_back(PropertyInfo(Variant::POOL_STRING_ARRAY, "blend_shape/names", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR));
@@ -277,13 +679,17 @@ void Mesh::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::DICTIONARY, "surfaces/" + itos(i), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR));
p_list->push_back(PropertyInfo(Variant::STRING, "surface_" + itos(i + 1) + "/name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
- p_list->push_back(PropertyInfo(Variant::OBJECT, "surface_" + itos(i + 1) + "/material", PROPERTY_HINT_RESOURCE_TYPE, "Material", PROPERTY_USAGE_EDITOR));
+ if (surfaces[i].is_2d) {
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "surface_" + itos(i + 1) + "/material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,CanvasItemMaterial", PROPERTY_USAGE_EDITOR));
+ } else {
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "surface_" + itos(i + 1) + "/material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,SpatialMaterial", PROPERTY_USAGE_EDITOR));
+ }
}
p_list->push_back(PropertyInfo(Variant::RECT3, "custom_aabb/custom_aabb"));
}
-void Mesh::_recompute_aabb() {
+void ArrayMesh::_recompute_aabb() {
// regenerate AABB
aabb = Rect3();
@@ -297,16 +703,18 @@ void Mesh::_recompute_aabb() {
}
}
-void Mesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const Rect3 &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes, const Vector<Rect3> &p_bone_aabbs) {
+void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const Rect3 &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes, const Vector<Rect3> &p_bone_aabbs) {
Surface s;
s.aabb = p_aabb;
+ s.is_2d = p_format & ARRAY_FLAG_USE_2D_VERTICES;
surfaces.push_back(s);
+ _recompute_aabb();
VisualServer::get_singleton()->mesh_add_surface(mesh, p_format, (VS::PrimitiveType)p_primitive, p_array, p_vertex_count, p_index_array, p_index_count, p_aabb, p_blend_shapes, p_bone_aabbs);
}
-void Mesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, uint32_t p_flags) {
+void ArrayMesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, uint32_t p_flags) {
ERR_FAIL_COND(p_arrays.size() != ARRAY_MAX);
@@ -317,7 +725,8 @@ void Mesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array &p_arr
/* make aABB? */ {
- PoolVector<Vector3> vertices = p_arrays[ARRAY_VERTEX];
+ Variant arr = p_arrays[ARRAY_VERTEX];
+ PoolVector<Vector3> vertices = arr;
int len = vertices.size();
ERR_FAIL_COND(len == 0);
PoolVector<Vector3>::Read r = vertices.read();
@@ -328,38 +737,39 @@ void Mesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array &p_arr
for (int i = 0; i < len; i++) {
if (i == 0)
- aabb.pos = vtx[i];
+ aabb.position = vtx[i];
else
aabb.expand_to(vtx[i]);
}
surfaces[surfaces.size() - 1].aabb = aabb;
+ surfaces[surfaces.size() - 1].is_2d = arr.get_type() == Variant::POOL_VECTOR2_ARRAY;
_recompute_aabb();
}
- triangle_mesh = Ref<TriangleMesh>();
+ _clear_triangle_mesh();
_change_notify();
emit_changed();
}
-Array Mesh::surface_get_arrays(int p_surface) const {
+Array ArrayMesh::surface_get_arrays(int p_surface) const {
ERR_FAIL_INDEX_V(p_surface, surfaces.size(), Array());
return VisualServer::get_singleton()->mesh_surface_get_arrays(mesh, p_surface);
}
-Array Mesh::surface_get_blend_shape_arrays(int p_surface) const {
+Array ArrayMesh::surface_get_blend_shape_arrays(int p_surface) const {
ERR_FAIL_INDEX_V(p_surface, surfaces.size(), Array());
return Array();
}
-int Mesh::get_surface_count() const {
+int ArrayMesh::get_surface_count() const {
return surfaces.size();
}
-void Mesh::add_blend_shape(const StringName &p_name) {
+void ArrayMesh::add_blend_shape(const StringName &p_name) {
if (surfaces.size()) {
ERR_EXPLAIN("Can't add a shape key count if surfaces are already created.");
@@ -382,15 +792,15 @@ void Mesh::add_blend_shape(const StringName &p_name) {
VS::get_singleton()->mesh_set_blend_shape_count(mesh, blend_shapes.size());
}
-int Mesh::get_blend_shape_count() const {
+int ArrayMesh::get_blend_shape_count() const {
return blend_shapes.size();
}
-StringName Mesh::get_blend_shape_name(int p_index) const {
+StringName ArrayMesh::get_blend_shape_name(int p_index) const {
ERR_FAIL_INDEX_V(p_index, blend_shapes.size(), StringName());
return blend_shapes[p_index];
}
-void Mesh::clear_blend_shapes() {
+void ArrayMesh::clear_blend_shapes() {
if (surfaces.size()) {
ERR_EXPLAIN("Can't set shape key count if surfaces are already created.");
@@ -400,54 +810,54 @@ void Mesh::clear_blend_shapes() {
blend_shapes.clear();
}
-void Mesh::set_blend_shape_mode(BlendShapeMode p_mode) {
+void ArrayMesh::set_blend_shape_mode(BlendShapeMode p_mode) {
blend_shape_mode = p_mode;
VS::get_singleton()->mesh_set_blend_shape_mode(mesh, (VS::BlendShapeMode)p_mode);
}
-Mesh::BlendShapeMode Mesh::get_blend_shape_mode() const {
+ArrayMesh::BlendShapeMode ArrayMesh::get_blend_shape_mode() const {
return blend_shape_mode;
}
-void Mesh::surface_remove(int p_idx) {
+void ArrayMesh::surface_remove(int p_idx) {
ERR_FAIL_INDEX(p_idx, surfaces.size());
VisualServer::get_singleton()->mesh_remove_surface(mesh, p_idx);
surfaces.remove(p_idx);
- triangle_mesh = Ref<TriangleMesh>();
+ _clear_triangle_mesh();
_recompute_aabb();
_change_notify();
emit_changed();
}
-int Mesh::surface_get_array_len(int p_idx) const {
+int ArrayMesh::surface_get_array_len(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, surfaces.size(), -1);
return VisualServer::get_singleton()->mesh_surface_get_array_len(mesh, p_idx);
}
-int Mesh::surface_get_array_index_len(int p_idx) const {
+int ArrayMesh::surface_get_array_index_len(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, surfaces.size(), -1);
return VisualServer::get_singleton()->mesh_surface_get_array_index_len(mesh, p_idx);
}
-uint32_t Mesh::surface_get_format(int p_idx) const {
+uint32_t ArrayMesh::surface_get_format(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, surfaces.size(), 0);
return VisualServer::get_singleton()->mesh_surface_get_format(mesh, p_idx);
}
-Mesh::PrimitiveType Mesh::surface_get_primitive_type(int p_idx) const {
+ArrayMesh::PrimitiveType ArrayMesh::surface_get_primitive_type(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, surfaces.size(), PRIMITIVE_LINES);
return (PrimitiveType)VisualServer::get_singleton()->mesh_surface_get_primitive_type(mesh, p_idx);
}
-void Mesh::surface_set_material(int p_idx, const Ref<Material> &p_material) {
+void ArrayMesh::surface_set_material(int p_idx, const Ref<Material> &p_material) {
ERR_FAIL_INDEX(p_idx, surfaces.size());
if (surfaces[p_idx].material == p_material)
@@ -458,40 +868,40 @@ void Mesh::surface_set_material(int p_idx, const Ref<Material> &p_material) {
_change_notify("material");
}
-void Mesh::surface_set_name(int p_idx, const String &p_name) {
+void ArrayMesh::surface_set_name(int p_idx, const String &p_name) {
ERR_FAIL_INDEX(p_idx, surfaces.size());
surfaces[p_idx].name = p_name;
}
-String Mesh::surface_get_name(int p_idx) const {
+String ArrayMesh::surface_get_name(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, surfaces.size(), String());
return surfaces[p_idx].name;
}
-void Mesh::surface_set_custom_aabb(int p_idx, const Rect3 &p_aabb) {
+void ArrayMesh::surface_set_custom_aabb(int p_idx, const Rect3 &p_aabb) {
ERR_FAIL_INDEX(p_idx, surfaces.size());
surfaces[p_idx].aabb = p_aabb;
// set custom aabb too?
}
-Ref<Material> Mesh::surface_get_material(int p_idx) const {
+Ref<Material> ArrayMesh::surface_get_material(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, surfaces.size(), Ref<Material>());
return surfaces[p_idx].material;
}
-void Mesh::add_surface_from_mesh_data(const Geometry::MeshData &p_mesh_data) {
+void ArrayMesh::add_surface_from_mesh_data(const Geometry::MeshData &p_mesh_data) {
VisualServer::get_singleton()->mesh_add_surface_from_mesh_data(mesh, p_mesh_data);
Rect3 aabb;
for (int i = 0; i < p_mesh_data.vertices.size(); i++) {
if (i == 0)
- aabb.pos = p_mesh_data.vertices[i];
+ aabb.position = p_mesh_data.vertices[i];
else
aabb.expand_to(p_mesh_data.vertices[i]);
}
@@ -503,7 +913,7 @@ void Mesh::add_surface_from_mesh_data(const Geometry::MeshData &p_mesh_data) {
else
aabb.merge_with(s.aabb);
- triangle_mesh = Ref<TriangleMesh>();
+ _clear_triangle_mesh();
surfaces.push_back(s);
_change_notify();
@@ -511,129 +921,27 @@ void Mesh::add_surface_from_mesh_data(const Geometry::MeshData &p_mesh_data) {
emit_changed();
}
-RID Mesh::get_rid() const {
+RID ArrayMesh::get_rid() const {
return mesh;
}
-Rect3 Mesh::get_aabb() const {
+Rect3 ArrayMesh::get_aabb() const {
return aabb;
}
-void Mesh::set_custom_aabb(const Rect3 &p_custom) {
+void ArrayMesh::set_custom_aabb(const Rect3 &p_custom) {
custom_aabb = p_custom;
VS::get_singleton()->mesh_set_custom_aabb(mesh, custom_aabb);
}
-Rect3 Mesh::get_custom_aabb() const {
+Rect3 ArrayMesh::get_custom_aabb() const {
return custom_aabb;
}
-PoolVector<Face3> Mesh::get_faces() const {
-
- Ref<TriangleMesh> tm = generate_triangle_mesh();
- if (tm.is_valid())
- return tm->get_faces();
- return PoolVector<Face3>();
- /*
- for (int i=0;i<surfaces.size();i++) {
-
- if (VisualServer::get_singleton()->mesh_surface_get_primitive_type( mesh, i ) != VisualServer::PRIMITIVE_TRIANGLES )
- continue;
-
- PoolVector<int> indices;
- PoolVector<Vector3> vertices;
-
- vertices=VisualServer::get_singleton()->mesh_surface_get_array(mesh, i,VisualServer::ARRAY_VERTEX);
-
- int len=VisualServer::get_singleton()->mesh_surface_get_array_index_len(mesh, i);
- bool has_indices;
-
- if (len>0) {
-
- indices=VisualServer::get_singleton()->mesh_surface_get_array(mesh, i,VisualServer::ARRAY_INDEX);
- has_indices=true;
-
- } else {
-
- len=vertices.size();
- has_indices=false;
- }
-
- if (len<=0)
- continue;
-
- PoolVector<int>::Read indicesr = indices.read();
- const int *indicesptr = indicesr.ptr();
-
- PoolVector<Vector3>::Read verticesr = vertices.read();
- const Vector3 *verticesptr = verticesr.ptr();
-
- int old_faces=faces.size();
- int new_faces=old_faces+(len/3);
-
- faces.resize(new_faces);
-
- PoolVector<Face3>::Write facesw = faces.write();
- Face3 *facesptr=facesw.ptr();
-
-
- for (int i=0;i<len/3;i++) {
-
- Face3 face;
-
- for (int j=0;j<3;j++) {
-
- int idx=i*3+j;
- face.vertex[j] = has_indices ? verticesptr[ indicesptr[ idx ] ] : verticesptr[idx];
- }
-
- facesptr[i+old_faces]=face;
- }
-
- }
-*/
-}
-
-Ref<Shape> Mesh::create_convex_shape() const {
-
- PoolVector<Vector3> vertices;
-
- for (int i = 0; i < get_surface_count(); i++) {
-
- Array a = surface_get_arrays(i);
- PoolVector<Vector3> v = a[ARRAY_VERTEX];
- vertices.append_array(v);
- }
-
- Ref<ConvexPolygonShape> shape = memnew(ConvexPolygonShape);
- shape->set_points(vertices);
- return shape;
-}
-
-Ref<Shape> Mesh::create_trimesh_shape() const {
-
- PoolVector<Face3> faces = get_faces();
- if (faces.size() == 0)
- return Ref<Shape>();
-
- PoolVector<Vector3> face_points;
- face_points.resize(faces.size() * 3);
-
- for (int i = 0; i < face_points.size(); i++) {
-
- Face3 f = faces.get(i / 3);
- face_points.set(i, f.vertex[i % 3]);
- }
-
- Ref<ConcavePolygonShape> shape = memnew(ConcavePolygonShape);
- shape->set_faces(face_points);
- return shape;
-}
-
-void Mesh::center_geometry() {
+void ArrayMesh::center_geometry() {
/*
Vector3 ofs = aabb.pos+aabb.size*0.5;
@@ -661,13 +969,13 @@ void Mesh::center_geometry() {
*/
}
-void Mesh::regen_normalmaps() {
+void ArrayMesh::regen_normalmaps() {
Vector<Ref<SurfaceTool> > surfs;
for (int i = 0; i < get_surface_count(); i++) {
Ref<SurfaceTool> st = memnew(SurfaceTool);
- st->create_from(Ref<Mesh>(this), i);
+ st->create_from(Ref<ArrayMesh>(this), i);
surfs.push_back(st);
}
@@ -678,310 +986,42 @@ void Mesh::regen_normalmaps() {
for (int i = 0; i < surfs.size(); i++) {
surfs[i]->generate_tangents();
- surfs[i]->commit(Ref<Mesh>(this));
- }
-}
-
-Ref<TriangleMesh> Mesh::generate_triangle_mesh() const {
-
- if (triangle_mesh.is_valid())
- return triangle_mesh;
-
- int facecount = 0;
-
- for (int i = 0; i < get_surface_count(); i++) {
-
- if (surface_get_primitive_type(i) != PRIMITIVE_TRIANGLES)
- continue;
-
- if (surface_get_format(i) & ARRAY_FORMAT_INDEX) {
-
- facecount += surface_get_array_index_len(i);
- } else {
-
- facecount += surface_get_array_len(i);
- }
- }
-
- if (facecount == 0 || (facecount % 3) != 0)
- return triangle_mesh;
-
- PoolVector<Vector3> faces;
- faces.resize(facecount);
- PoolVector<Vector3>::Write facesw = faces.write();
-
- int widx = 0;
-
- for (int i = 0; i < get_surface_count(); i++) {
-
- if (surface_get_primitive_type(i) != PRIMITIVE_TRIANGLES)
- continue;
-
- Array a = surface_get_arrays(i);
-
- int vc = surface_get_array_len(i);
- PoolVector<Vector3> vertices = a[ARRAY_VERTEX];
- PoolVector<Vector3>::Read vr = vertices.read();
-
- if (surface_get_format(i) & ARRAY_FORMAT_INDEX) {
-
- int ic = surface_get_array_index_len(i);
- PoolVector<int> indices = a[ARRAY_INDEX];
- PoolVector<int>::Read ir = indices.read();
-
- for (int i = 0; i < ic; i++) {
- int index = ir[i];
- facesw[widx++] = vr[index];
- }
-
- } else {
-
- for (int i = 0; i < vc; i++)
- facesw[widx++] = vr[i];
- }
- }
-
- facesw = PoolVector<Vector3>::Write();
-
- triangle_mesh = Ref<TriangleMesh>(memnew(TriangleMesh));
- triangle_mesh->create(faces);
-
- return triangle_mesh;
-}
-
-Ref<Mesh> Mesh::create_outline(float p_margin) const {
-
- Array arrays;
- int index_accum = 0;
- for (int i = 0; i < get_surface_count(); i++) {
-
- if (surface_get_primitive_type(i) != PRIMITIVE_TRIANGLES)
- continue;
-
- Array a = surface_get_arrays(i);
- int vcount = 0;
-
- if (i == 0) {
- arrays = a;
- PoolVector<Vector3> v = a[ARRAY_VERTEX];
- index_accum += v.size();
- } else {
-
- for (int j = 0; j < arrays.size(); j++) {
-
- if (arrays[j].get_type() == Variant::NIL || a[j].get_type() == Variant::NIL) {
- //mismatch, do not use
- arrays[j] = Variant();
- continue;
- }
-
- switch (j) {
-
- case ARRAY_VERTEX:
- case ARRAY_NORMAL: {
-
- PoolVector<Vector3> dst = arrays[j];
- PoolVector<Vector3> src = a[j];
- if (j == ARRAY_VERTEX)
- vcount = src.size();
- if (dst.size() == 0 || src.size() == 0) {
- arrays[j] = Variant();
- continue;
- }
- dst.append_array(src);
- arrays[j] = dst;
- } break;
- case ARRAY_TANGENT:
- case ARRAY_BONES:
- case ARRAY_WEIGHTS: {
-
- PoolVector<real_t> dst = arrays[j];
- PoolVector<real_t> src = a[j];
- if (dst.size() == 0 || src.size() == 0) {
- arrays[j] = Variant();
- continue;
- }
- dst.append_array(src);
- arrays[j] = dst;
-
- } break;
- case ARRAY_COLOR: {
- PoolVector<Color> dst = arrays[j];
- PoolVector<Color> src = a[j];
- if (dst.size() == 0 || src.size() == 0) {
- arrays[j] = Variant();
- continue;
- }
- dst.append_array(src);
- arrays[j] = dst;
-
- } break;
- case ARRAY_TEX_UV:
- case ARRAY_TEX_UV2: {
- PoolVector<Vector2> dst = arrays[j];
- PoolVector<Vector2> src = a[j];
- if (dst.size() == 0 || src.size() == 0) {
- arrays[j] = Variant();
- continue;
- }
- dst.append_array(src);
- arrays[j] = dst;
-
- } break;
- case ARRAY_INDEX: {
- PoolVector<int> dst = arrays[j];
- PoolVector<int> src = a[j];
- if (dst.size() == 0 || src.size() == 0) {
- arrays[j] = Variant();
- continue;
- }
- {
- int ss = src.size();
- PoolVector<int>::Write w = src.write();
- for (int k = 0; k < ss; k++) {
- w[k] += index_accum;
- }
- }
- dst.append_array(src);
- arrays[j] = dst;
- index_accum += vcount;
-
- } break;
- }
- }
- }
+ surfs[i]->commit(Ref<ArrayMesh>(this));
}
-
- {
- PoolVector<int>::Write ir;
- PoolVector<int> indices = arrays[ARRAY_INDEX];
- bool has_indices = false;
- PoolVector<Vector3> vertices = arrays[ARRAY_VERTEX];
- int vc = vertices.size();
- ERR_FAIL_COND_V(!vc, Ref<Mesh>());
- PoolVector<Vector3>::Write r = vertices.write();
-
- if (indices.size()) {
- vc = indices.size();
- ir = indices.write();
- has_indices = true;
- }
-
- Map<Vector3, Vector3> normal_accum;
-
- //fill normals with triangle normals
- for (int i = 0; i < vc; i += 3) {
-
- Vector3 t[3];
-
- if (has_indices) {
- t[0] = r[ir[i + 0]];
- t[1] = r[ir[i + 1]];
- t[2] = r[ir[i + 2]];
- } else {
- t[0] = r[i + 0];
- t[1] = r[i + 1];
- t[2] = r[i + 2];
- }
-
- Vector3 n = Plane(t[0], t[1], t[2]).normal;
-
- for (int j = 0; j < 3; j++) {
-
- Map<Vector3, Vector3>::Element *E = normal_accum.find(t[j]);
- if (!E) {
- normal_accum[t[j]] = n;
- } else {
- float d = n.dot(E->get());
- if (d < 1.0)
- E->get() += n * (1.0 - d);
- //E->get()+=n;
- }
- }
- }
-
- //normalize
-
- for (Map<Vector3, Vector3>::Element *E = normal_accum.front(); E; E = E->next()) {
- E->get().normalize();
- }
-
- //displace normals
- int vc2 = vertices.size();
-
- for (int i = 0; i < vc2; i++) {
-
- Vector3 t = r[i];
-
- Map<Vector3, Vector3>::Element *E = normal_accum.find(t);
- ERR_CONTINUE(!E);
-
- t += E->get() * p_margin;
- r[i] = t;
- }
-
- r = PoolVector<Vector3>::Write();
- arrays[ARRAY_VERTEX] = vertices;
-
- if (!has_indices) {
-
- PoolVector<int> new_indices;
- new_indices.resize(vertices.size());
- PoolVector<int>::Write iw = new_indices.write();
-
- for (int j = 0; j < vc2; j += 3) {
-
- iw[j] = j;
- iw[j + 1] = j + 2;
- iw[j + 2] = j + 1;
- }
-
- iw = PoolVector<int>::Write();
- arrays[ARRAY_INDEX] = new_indices;
-
- } else {
-
- for (int j = 0; j < vc; j += 3) {
-
- SWAP(ir[j + 1], ir[j + 2]);
- }
- ir = PoolVector<int>::Write();
- arrays[ARRAY_INDEX] = indices;
- }
- }
-
- Ref<Mesh> newmesh = memnew(Mesh);
- newmesh->add_surface_from_arrays(PRIMITIVE_TRIANGLES, arrays);
- return newmesh;
}
-void Mesh::_bind_methods() {
-
- 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);
+void ArrayMesh::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("add_blend_shape", "name"), &ArrayMesh::add_blend_shape);
+ ClassDB::bind_method(D_METHOD("get_blend_shape_count"), &ArrayMesh::get_blend_shape_count);
+ ClassDB::bind_method(D_METHOD("get_blend_shape_name", "index"), &ArrayMesh::get_blend_shape_name);
+ ClassDB::bind_method(D_METHOD("clear_blend_shapes"), &ArrayMesh::clear_blend_shapes);
+ ClassDB::bind_method(D_METHOD("set_blend_shape_mode", "mode"), &ArrayMesh::set_blend_shape_mode);
+ ClassDB::bind_method(D_METHOD("get_blend_shape_mode"), &ArrayMesh::get_blend_shape_mode);
+
+ ClassDB::bind_method(D_METHOD("add_surface_from_arrays", "primitive", "arrays", "blend_shapes", "compress_flags"), &ArrayMesh::add_surface_from_arrays, DEFVAL(Array()), DEFVAL(ARRAY_COMPRESS_DEFAULT));
+ ClassDB::bind_method(D_METHOD("get_surface_count"), &ArrayMesh::get_surface_count);
+ ClassDB::bind_method(D_METHOD("surface_remove", "surf_idx"), &ArrayMesh::surface_remove);
+ ClassDB::bind_method(D_METHOD("surface_get_array_len", "surf_idx"), &ArrayMesh::surface_get_array_len);
+ ClassDB::bind_method(D_METHOD("surface_get_array_index_len", "surf_idx"), &ArrayMesh::surface_get_array_index_len);
+ ClassDB::bind_method(D_METHOD("surface_get_format", "surf_idx"), &ArrayMesh::surface_get_format);
+ ClassDB::bind_method(D_METHOD("surface_get_primitive_type", "surf_idx"), &ArrayMesh::surface_get_primitive_type);
+ ClassDB::bind_method(D_METHOD("surface_set_material", "surf_idx", "material"), &ArrayMesh::surface_set_material);
+ ClassDB::bind_method(D_METHOD("surface_get_material", "surf_idx"), &ArrayMesh::surface_get_material);
+ ClassDB::bind_method(D_METHOD("surface_set_name", "surf_idx", "name"), &ArrayMesh::surface_set_name);
+ ClassDB::bind_method(D_METHOD("surface_get_name", "surf_idx"), &ArrayMesh::surface_get_name);
+ ClassDB::bind_method(D_METHOD("create_trimesh_shape"), &ArrayMesh::create_trimesh_shape);
+ ClassDB::bind_method(D_METHOD("create_convex_shape"), &ArrayMesh::create_convex_shape);
+ ClassDB::bind_method(D_METHOD("create_outline", "margin"), &ArrayMesh::create_outline);
+ ClassDB::bind_method(D_METHOD("center_geometry"), &ArrayMesh::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::bind_method(D_METHOD("regen_normalmaps"), &ArrayMesh::regen_normalmaps);
ClassDB::set_method_flags(get_class_static(), _scs_create("regen_normalmaps"), METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR);
+ ClassDB::bind_method(D_METHOD("get_faces"), &ArrayMesh::get_faces);
+ ClassDB::bind_method(D_METHOD("generate_triangle_mesh"), &ArrayMesh::generate_triangle_mesh);
- 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);
+ ClassDB::bind_method(D_METHOD("set_custom_aabb", "aabb"), &ArrayMesh::set_custom_aabb);
+ ClassDB::bind_method(D_METHOD("get_custom_aabb"), &ArrayMesh::get_custom_aabb);
BIND_CONSTANT(NO_INDEX_ARRAY);
BIND_CONSTANT(ARRAY_WEIGHTS_SIZE);
@@ -1005,23 +1045,15 @@ void Mesh::_bind_methods() {
BIND_CONSTANT(ARRAY_FORMAT_BONES);
BIND_CONSTANT(ARRAY_FORMAT_WEIGHTS);
BIND_CONSTANT(ARRAY_FORMAT_INDEX);
-
- BIND_CONSTANT(PRIMITIVE_POINTS);
- BIND_CONSTANT(PRIMITIVE_LINES);
- BIND_CONSTANT(PRIMITIVE_LINE_STRIP);
- BIND_CONSTANT(PRIMITIVE_LINE_LOOP);
- BIND_CONSTANT(PRIMITIVE_TRIANGLES);
- BIND_CONSTANT(PRIMITIVE_TRIANGLE_STRIP);
- BIND_CONSTANT(PRIMITIVE_TRIANGLE_FAN);
}
-Mesh::Mesh() {
+ArrayMesh::ArrayMesh() {
mesh = VisualServer::get_singleton()->mesh_create();
blend_shape_mode = BLEND_SHAPE_MODE_RELATIVE;
}
-Mesh::~Mesh() {
+ArrayMesh::~ArrayMesh() {
VisualServer::get_singleton()->free(mesh);
}
diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h
index 8b1936ed06..ad3c10b6bc 100644
--- a/scene/resources/mesh.h
+++ b/scene/resources/mesh.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,10 +38,15 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
-class Mesh : public Resource {
+class Mesh : public Resource {
GDCLASS(Mesh, Resource);
- RES_BASE_EXTENSION("msh");
+
+ mutable Ref<TriangleMesh> triangle_mesh; //cached
+protected:
+ void _clear_triangle_mesh() const;
+
+ static void _bind_methods();
public:
enum {
@@ -110,11 +116,40 @@ public:
BLEND_SHAPE_MODE_RELATIVE = VS::BLEND_SHAPE_MODE_RELATIVE,
};
+ virtual int get_surface_count() const = 0;
+ virtual int surface_get_array_len(int p_idx) const = 0;
+ virtual int surface_get_array_index_len(int p_idx) const = 0;
+ virtual Array surface_get_arrays(int p_surface) const = 0;
+ virtual uint32_t surface_get_format(int p_idx) const = 0;
+ virtual PrimitiveType surface_get_primitive_type(int p_idx) const = 0;
+ virtual Ref<Material> surface_get_material(int p_idx) const = 0;
+ virtual int get_blend_shape_count() const = 0;
+ virtual StringName get_blend_shape_name(int p_index) const = 0;
+
+ PoolVector<Face3> get_faces() const;
+ Ref<TriangleMesh> generate_triangle_mesh() const;
+
+ Ref<Shape> create_trimesh_shape() const;
+ Ref<Shape> create_convex_shape() const;
+
+ Ref<Mesh> create_outline(float p_margin) const;
+
+ virtual Rect3 get_aabb() const = 0;
+
+ Mesh();
+};
+
+class ArrayMesh : public Mesh {
+
+ GDCLASS(ArrayMesh, Mesh);
+ RES_BASE_EXTENSION("mesh");
+
private:
struct Surface {
String name;
Rect3 aabb;
Ref<Material> material;
+ bool is_2d;
};
Vector<Surface> surfaces;
RID mesh;
@@ -123,11 +158,11 @@ private:
Vector<StringName> blend_shapes;
Rect3 custom_aabb;
- mutable Ref<TriangleMesh> triangle_mesh;
-
void _recompute_aabb();
protected:
+ virtual bool _is_generated() const { return false; }
+
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;
@@ -152,7 +187,7 @@ public:
int get_surface_count() const;
void surface_remove(int p_idx);
- void surface_set_custom_aabb(int p_surface, const Rect3 &p_aabb); //only recognized by driver
+ void surface_set_custom_aabb(int p_idx, const Rect3 &p_aabb); //only recognized by driver
int surface_get_array_len(int p_idx) const;
int surface_get_array_index_len(int p_idx) const;
@@ -174,19 +209,12 @@ public:
Rect3 get_aabb() const;
virtual RID get_rid() const;
- Ref<Shape> create_trimesh_shape() const;
- Ref<Shape> create_convex_shape() const;
-
- Ref<Mesh> create_outline(float p_margin) const;
-
void center_geometry();
void regen_normalmaps();
- PoolVector<Face3> get_faces() const;
- Ref<TriangleMesh> generate_triangle_mesh() const;
- Mesh();
+ ArrayMesh();
- ~Mesh();
+ ~ArrayMesh();
};
VARIANT_ENUM_CAST(Mesh::ArrayType);
diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp
index fcc1f80d25..f1092a90cb 100644
--- a/scene/resources/mesh_data_tool.cpp
+++ b/scene/resources/mesh_data_tool.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,7 +38,7 @@ void MeshDataTool::clear() {
format = 0;
}
-Error MeshDataTool::create_from_surface(const Ref<Mesh> &p_mesh, int p_surface) {
+Error MeshDataTool::create_from_surface(const Ref<ArrayMesh> &p_mesh, int p_surface) {
ERR_FAIL_COND_V(p_mesh.is_null(), ERR_INVALID_PARAMETER);
@@ -178,7 +179,7 @@ Error MeshDataTool::create_from_surface(const Ref<Mesh> &p_mesh, int p_surface)
return OK;
}
-Error MeshDataTool::commit_to_surface(const Ref<Mesh> &p_mesh) {
+Error MeshDataTool::commit_to_surface(const Ref<ArrayMesh> &p_mesh) {
ERR_FAIL_COND_V(p_mesh.is_null(), ERR_INVALID_PARAMETER);
Array arr;
@@ -308,7 +309,7 @@ Error MeshDataTool::commit_to_surface(const Ref<Mesh> &p_mesh) {
if (w.size())
arr[Mesh::ARRAY_WEIGHTS] = w;
- Ref<Mesh> ncmesh = p_mesh;
+ Ref<ArrayMesh> ncmesh = p_mesh;
int sc = ncmesh->get_surface_count();
ncmesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES, arr);
ncmesh->surface_set_material(sc, material);
@@ -559,7 +560,7 @@ void MeshDataTool::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_vertex_faces", "idx"), &MeshDataTool::get_vertex_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(D_METHOD("get_edge_faces", "idx"), &MeshDataTool::get_edge_faces);
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);
@@ -572,8 +573,8 @@ void MeshDataTool::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_face_normal", "idx"), &MeshDataTool::get_face_normal);
- ClassDB::bind_method(D_METHOD("set_material", "material:Material"), &MeshDataTool::set_material);
- ClassDB::bind_method(D_METHOD("get_material", "material"), &MeshDataTool::get_material);
+ ClassDB::bind_method(D_METHOD("set_material", "material"), &MeshDataTool::set_material);
+ ClassDB::bind_method(D_METHOD("get_material"), &MeshDataTool::get_material);
}
MeshDataTool::MeshDataTool() {
diff --git a/scene/resources/mesh_data_tool.h b/scene/resources/mesh_data_tool.h
index 14318a9f82..ad771edbd1 100644
--- a/scene/resources/mesh_data_tool.h
+++ b/scene/resources/mesh_data_tool.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -77,8 +78,8 @@ protected:
public:
void clear();
- Error create_from_surface(const Ref<Mesh> &p_mesh, int p_surface);
- Error commit_to_surface(const Ref<Mesh> &p_mesh);
+ Error create_from_surface(const Ref<ArrayMesh> &p_mesh, int p_surface);
+ Error commit_to_surface(const Ref<ArrayMesh> &p_mesh);
int get_format() const;
diff --git a/scene/resources/mesh_library.cpp b/scene/resources/mesh_library.cpp
index 92ca921f25..7d51a2617e 100644
--- a/scene/resources/mesh_library.cpp
+++ b/scene/resources/mesh_library.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -229,13 +230,13 @@ void MeshLibrary::_bind_methods() {
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("set_item_mesh", "id", "mesh"), &MeshLibrary::set_item_mesh);
+ ClassDB::bind_method(D_METHOD("set_item_navmesh", "id", "navmesh"), &MeshLibrary::set_item_navmesh);
+ ClassDB::bind_method(D_METHOD("set_item_shape", "id", "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("get_item_mesh", "id"), &MeshLibrary::get_item_mesh);
+ ClassDB::bind_method(D_METHOD("get_item_navmesh", "id"), &MeshLibrary::get_item_navmesh);
+ ClassDB::bind_method(D_METHOD("get_item_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);
diff --git a/scene/resources/mesh_library.h b/scene/resources/mesh_library.h
index 5f4a695c56..cc39110a99 100644
--- a/scene/resources/mesh_library.h
+++ b/scene/resources/mesh_library.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,7 +39,7 @@
class MeshLibrary : public Resource {
GDCLASS(MeshLibrary, Resource);
- RES_BASE_EXTENSION("gt");
+ RES_BASE_EXTENSION("meshlib");
struct Item {
String name;
diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp
index 6202109cd1..231e59cdb5 100644
--- a/scene/resources/multimesh.cpp
+++ b/scene/resources/multimesh.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -185,8 +186,8 @@ MultiMesh::TransformFormat MultiMesh::get_transform_format() const {
void MultiMesh::_bind_methods() {
- 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_mesh", "mesh"), &MultiMesh::set_mesh);
+ ClassDB::bind_method(D_METHOD("get_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);
diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h
index 1ecf76142a..7d6a0ce44f 100644
--- a/scene/resources/multimesh.h
+++ b/scene/resources/multimesh.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,7 +36,7 @@
class MultiMesh : public Resource {
GDCLASS(MultiMesh, Resource);
- RES_BASE_EXTENSION("mmsh");
+ RES_BASE_EXTENSION("multimesh");
public:
enum TransformFormat {
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 2bb9eda198..169c956546 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "packed_scene.h"
#include "core/core_string_names.h"
-#include "global_config.h"
#include "io/resource_loader.h"
+#include "project_settings.h"
#include "scene/2d/node_2d.h"
#include "scene/3d/spatial.h"
#include "scene/gui/control.h"
@@ -515,6 +516,9 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
bool isdefault = ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO) && value.is_zero()) || ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONONE) && value.is_one());
+ if (E->get().usage & PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE) {
+ isdefault = true; //is script default value
+ }
/*
if (nd.instance<0 && ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO) && value.is_zero()) || ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONONE) && value.is_one())) {
continue;
@@ -1123,26 +1127,26 @@ bool SceneState::is_connection(int p_node, const StringName &p_signal, int p_to_
return false;
}
-void SceneState::set_bundled_scene(const Dictionary &d) {
+void SceneState::set_bundled_scene(const Dictionary &p_dictionary) {
- ERR_FAIL_COND(!d.has("names"));
- ERR_FAIL_COND(!d.has("variants"));
- ERR_FAIL_COND(!d.has("node_count"));
- ERR_FAIL_COND(!d.has("nodes"));
- ERR_FAIL_COND(!d.has("conn_count"));
- ERR_FAIL_COND(!d.has("conns"));
- //ERR_FAIL_COND( !d.has("path"));
+ ERR_FAIL_COND(!p_dictionary.has("names"));
+ ERR_FAIL_COND(!p_dictionary.has("variants"));
+ ERR_FAIL_COND(!p_dictionary.has("node_count"));
+ ERR_FAIL_COND(!p_dictionary.has("nodes"));
+ ERR_FAIL_COND(!p_dictionary.has("conn_count"));
+ ERR_FAIL_COND(!p_dictionary.has("conns"));
+ //ERR_FAIL_COND( !p_dictionary.has("path"));
int version = 1;
- if (d.has("version"))
- version = d["version"];
+ if (p_dictionary.has("version"))
+ version = p_dictionary["version"];
if (version > PACK_VERSION) {
ERR_EXPLAIN("Save format version too new!");
ERR_FAIL();
}
- PoolVector<String> snames = d["names"];
+ PoolVector<String> snames = p_dictionary["names"];
if (snames.size()) {
int namecount = snames.size();
@@ -1152,7 +1156,7 @@ void SceneState::set_bundled_scene(const Dictionary &d) {
names[i] = r[i];
}
- Array svariants = d["variants"];
+ Array svariants = p_dictionary["variants"];
if (svariants.size()) {
int varcount = svariants.size();
@@ -1166,10 +1170,10 @@ void SceneState::set_bundled_scene(const Dictionary &d) {
variants.clear();
}
- nodes.resize(d["node_count"]);
+ nodes.resize(p_dictionary["node_count"]);
int nc = nodes.size();
if (nc) {
- PoolVector<int> snodes = d["nodes"];
+ PoolVector<int> snodes = p_dictionary["nodes"];
PoolVector<int>::Read r = snodes.read();
int idx = 0;
for (int i = 0; i < nc; i++) {
@@ -1193,12 +1197,12 @@ void SceneState::set_bundled_scene(const Dictionary &d) {
}
}
- connections.resize(d["conn_count"]);
+ connections.resize(p_dictionary["conn_count"]);
int cc = connections.size();
if (cc) {
- PoolVector<int> sconns = d["conns"];
+ PoolVector<int> sconns = p_dictionary["conns"];
PoolVector<int>::Read r = sconns.read();
int idx = 0;
for (int i = 0; i < cc; i++) {
@@ -1218,8 +1222,8 @@ void SceneState::set_bundled_scene(const Dictionary &d) {
}
Array np;
- if (d.has("node_paths")) {
- np = d["node_paths"];
+ if (p_dictionary.has("node_paths")) {
+ np = p_dictionary["node_paths"];
}
node_paths.resize(np.size());
for (int i = 0; i < np.size(); i++) {
@@ -1227,12 +1231,12 @@ void SceneState::set_bundled_scene(const Dictionary &d) {
}
Array ei;
- if (d.has("editable_instances")) {
- ei = d["editable_instances"];
+ if (p_dictionary.has("editable_instances")) {
+ ei = p_dictionary["editable_instances"];
}
- if (d.has("base_scene")) {
- base_scene_idx = d["base_scene"];
+ if (p_dictionary.has("base_scene")) {
+ base_scene_idx = p_dictionary["base_scene"];
}
editable_instances.resize(ei.size());
@@ -1240,7 +1244,7 @@ void SceneState::set_bundled_scene(const Dictionary &d) {
editable_instances[i] = ei[i];
}
- //path=d["path"];
+ //path=p_dictionary["path"];
}
Dictionary SceneState::get_bundled_scene() const {
@@ -1666,7 +1670,7 @@ void SceneState::_bind_methods() {
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_instance", "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);
@@ -1692,9 +1696,9 @@ SceneState::SceneState() {
////////////////
-void PackedScene::_set_bundled_scene(const Dictionary &d) {
+void PackedScene::_set_bundled_scene(const Dictionary &p_scene) {
- state->set_bundled_scene(d);
+ state->set_bundled_scene(p_scene);
}
Dictionary PackedScene::_get_bundled_scene() const {
@@ -1773,12 +1777,12 @@ void PackedScene::set_path(const String &p_path, bool p_take_over) {
void PackedScene::_bind_methods() {
- 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("pack", "path"), &PackedScene::pack);
+ ClassDB::bind_method(D_METHOD("instance", "edit_state"), &PackedScene::instance, DEFVAL(GEN_EDIT_STATE_DISABLED));
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);
+ ClassDB::bind_method(D_METHOD("get_state"), &PackedScene::get_state);
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "_bundled"), "_set_bundled_scene", "_get_bundled_scene");
diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h
index fe451884f5..2f18f5c263 100644
--- a/scene/resources/packed_scene.h
+++ b/scene/resources/packed_scene.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/plane_shape.cpp b/scene/resources/plane_shape.cpp
index e3535b1a63..d3ad454afc 100644
--- a/scene/resources/plane_shape.cpp
+++ b/scene/resources/plane_shape.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/plane_shape.h b/scene/resources/plane_shape.h
index 899aad7e01..2ed297a97e 100644
--- a/scene/resources/plane_shape.h
+++ b/scene/resources/plane_shape.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/polygon_path_finder.cpp b/scene/resources/polygon_path_finder.cpp
index 44ef828d02..80b413630a 100644
--- a/scene/resources/polygon_path_finder.cpp
+++ b/scene/resources/polygon_path_finder.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -70,7 +71,7 @@ void PolygonPathFinder::setup(const Vector<Vector2> &p_points, const Vector<int>
outside_point.y = i == 0 ? p_points[0].y : (MAX(p_points[i].y, outside_point.y));
if (i == 0) {
- bounds.pos = points[i].pos;
+ bounds.position = points[i].pos;
} else {
bounds.expand_to(points[i].pos);
}
diff --git a/scene/resources/polygon_path_finder.h b/scene/resources/polygon_path_finder.h
index cd2fea87d4..2d2fb1678e 100644
--- a/scene/resources/polygon_path_finder.h
+++ b/scene/resources/polygon_path_finder.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp
new file mode 100644
index 0000000000..6a3ddde02a
--- /dev/null
+++ b/scene/resources/primitive_meshes.cpp
@@ -0,0 +1,1478 @@
+/*************************************************************************/
+/* primitive_meshes.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "primitive_meshes.h"
+#include "servers/visual_server.h"
+
+/**
+ PrimitiveMesh
+*/
+void PrimitiveMesh::_update() const {
+
+ Array arr;
+ arr.resize(VS::ARRAY_MAX);
+ _create_mesh_array(arr);
+
+ PoolVector<Vector3> points = arr[VS::ARRAY_VERTEX];
+
+ aabb = Rect3();
+
+ int pc = points.size();
+ ERR_FAIL_COND(pc == 0);
+ {
+
+ PoolVector<Vector3>::Read r = points.read();
+ for (int i = 0; i < pc; i++) {
+ if (i == 0)
+ aabb.position = r[i];
+ else
+ aabb.expand_to(r[i]);
+ }
+ }
+
+ // in with the new
+ VisualServer::get_singleton()->mesh_clear(mesh);
+ VisualServer::get_singleton()->mesh_add_surface_from_arrays(mesh, (VisualServer::PrimitiveType)primitive_type, arr);
+ VisualServer::get_singleton()->mesh_surface_set_material(mesh, 0, material.is_null() ? RID() : material->get_rid());
+
+ pending_request = false;
+
+ _clear_triangle_mesh();
+}
+
+void PrimitiveMesh::_request_update() {
+
+ if (pending_request)
+ return;
+ _update();
+}
+
+int PrimitiveMesh::get_surface_count() const {
+ return 1;
+}
+
+int PrimitiveMesh::surface_get_array_len(int p_idx) const {
+ ERR_FAIL_INDEX_V(p_idx, 1, -1);
+ if (pending_request) {
+ _update();
+ }
+
+ return VisualServer::get_singleton()->mesh_surface_get_array_len(mesh, 0);
+}
+
+int PrimitiveMesh::surface_get_array_index_len(int p_idx) const {
+ ERR_FAIL_INDEX_V(p_idx, 1, -1);
+ if (pending_request) {
+ _update();
+ }
+
+ return VisualServer::get_singleton()->mesh_surface_get_array_index_len(mesh, 0);
+}
+
+Array PrimitiveMesh::surface_get_arrays(int p_surface) const {
+ ERR_FAIL_INDEX_V(p_surface, 1, Array());
+ if (pending_request) {
+ _update();
+ }
+
+ return VisualServer::get_singleton()->mesh_surface_get_arrays(mesh, 0);
+}
+
+uint32_t PrimitiveMesh::surface_get_format(int p_idx) const {
+ ERR_FAIL_INDEX_V(p_idx, 1, 0);
+ if (pending_request) {
+ _update();
+ }
+
+ return VisualServer::get_singleton()->mesh_surface_get_format(mesh, 0);
+}
+
+Mesh::PrimitiveType PrimitiveMesh::surface_get_primitive_type(int p_idx) const {
+ return primitive_type;
+}
+
+Ref<Material> PrimitiveMesh::surface_get_material(int p_idx) const {
+ return material;
+}
+
+int PrimitiveMesh::get_blend_shape_count() const {
+ return 0;
+}
+
+StringName PrimitiveMesh::get_blend_shape_name(int p_index) const {
+ return StringName();
+}
+
+Rect3 PrimitiveMesh::get_aabb() const {
+ if (pending_request) {
+ _update();
+ }
+
+ return aabb;
+}
+
+RID PrimitiveMesh::get_rid() const {
+ if (pending_request) {
+ _update();
+ }
+ return mesh;
+}
+
+void PrimitiveMesh::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("_update"), &PrimitiveMesh::_update);
+
+ ClassDB::bind_method(D_METHOD("set_material", "material"), &PrimitiveMesh::set_material);
+ ClassDB::bind_method(D_METHOD("get_material"), &PrimitiveMesh::get_material);
+
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_material", "get_material");
+}
+
+void PrimitiveMesh::set_material(const Ref<Material> &p_material) {
+ material = p_material;
+ if (!pending_request) {
+ // just apply it, else it'll happen when _update is called.
+ VisualServer::get_singleton()->mesh_surface_set_material(mesh, 0, material.is_null() ? RID() : material->get_rid());
+ _change_notify();
+ emit_changed();
+ };
+}
+
+Ref<Material> PrimitiveMesh::get_material() const {
+ return material;
+}
+
+PrimitiveMesh::PrimitiveMesh() {
+ // defaults
+ mesh = VisualServer::get_singleton()->mesh_create();
+
+ // assume primitive triangles as the type, correct for all but one and it will change this :)
+ primitive_type = Mesh::PRIMITIVE_TRIANGLES;
+
+ // make sure we do an update after we've finished constructing our object
+ pending_request = true;
+}
+
+PrimitiveMesh::~PrimitiveMesh() {
+ VisualServer::get_singleton()->free(mesh);
+}
+
+/**
+ CapsuleMesh
+*/
+
+void CapsuleMesh::_create_mesh_array(Array &p_arr) const {
+ int i, j, prevrow, thisrow, point;
+ float x, y, z, u, v, w;
+ float onethird = 1.0 / 3.0;
+ float twothirds = 2.0 / 3.0;
+
+ // note, this has been aligned with our collision shape but I've left the descriptions as top/middle/bottom
+
+ PoolVector<Vector3> points;
+ PoolVector<Vector3> normals;
+ PoolVector<float> tangents;
+ PoolVector<Vector2> uvs;
+ PoolVector<int> indices;
+ point = 0;
+
+#define ADD_TANGENT(m_x, m_y, m_z, m_d) \
+ tangents.push_back(m_x); \
+ tangents.push_back(m_y); \
+ tangents.push_back(m_z); \
+ tangents.push_back(m_d);
+
+ /* top hemisphere */
+ thisrow = 0;
+ prevrow = 0;
+ for (j = 0; j <= (rings + 1); j++) {
+ v = j;
+ w;
+
+ v /= (rings + 1);
+ w = sin(0.5 * Math_PI * v);
+ z = radius * cos(0.5 * Math_PI * v);
+
+ for (i = 0; i <= radial_segments; i++) {
+ u = i;
+ u /= radial_segments;
+
+ x = sin(u * (Math_PI * 2.0));
+ y = -cos(u * (Math_PI * 2.0));
+
+ Vector3 p = Vector3(x * radius * w, y * radius * w, z);
+ points.push_back(p + Vector3(0.0, 0.0, 0.5 * mid_height));
+ normals.push_back(p.normalized());
+ ADD_TANGENT(y, -x, 0.0, -1.0)
+ uvs.push_back(Vector2(u, v * onethird));
+ point++;
+
+ if (i > 0 && j > 0) {
+ indices.push_back(prevrow + i - 1);
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i - 1);
+
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i);
+ indices.push_back(thisrow + i - 1);
+ };
+ };
+
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ /* cylinder */
+ thisrow = point;
+ prevrow = 0;
+ for (j = 0; j <= (rings + 1); j++) {
+ v = j;
+ v /= (rings + 1);
+
+ z = mid_height * v;
+ z = (mid_height * 0.5) - z;
+
+ for (i = 0; i <= radial_segments; i++) {
+ u = i;
+ u /= radial_segments;
+
+ x = sin(u * (Math_PI * 2.0));
+ y = -cos(u * (Math_PI * 2.0));
+
+ Vector3 p = Vector3(x * radius, y * radius, z);
+ points.push_back(p);
+ normals.push_back(Vector3(x, y, 0.0));
+ ADD_TANGENT(y, -x, 0.0, -1.0)
+ uvs.push_back(Vector2(u, onethird + (v * onethird)));
+ point++;
+
+ if (i > 0 && j > 0) {
+ indices.push_back(prevrow + i - 1);
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i - 1);
+
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i);
+ indices.push_back(thisrow + i - 1);
+ };
+ };
+
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ /* bottom hemisphere */
+ thisrow = point;
+ prevrow = 0;
+ for (j = 0; j <= (rings + 1); j++) {
+ v = j;
+ w;
+
+ v /= (rings + 1);
+ v += 1.0;
+ w = sin(0.5 * Math_PI * v);
+ z = radius * cos(0.5 * Math_PI * v);
+
+ for (i = 0; i <= radial_segments; i++) {
+ float u = i;
+ u /= radial_segments;
+
+ x = sin(u * (Math_PI * 2.0));
+ y = -cos(u * (Math_PI * 2.0));
+
+ Vector3 p = Vector3(x * radius * w, y * radius * w, z);
+ points.push_back(p + Vector3(0.0, 0.0, -0.5 * mid_height));
+ normals.push_back(p.normalized());
+ ADD_TANGENT(y, -x, 0.0, -1.0)
+ uvs.push_back(Vector2(u, twothirds + ((v - 1.0) * onethird)));
+ point++;
+
+ if (i > 0 && j > 0) {
+ indices.push_back(prevrow + i - 1);
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i - 1);
+
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i);
+ indices.push_back(thisrow + i - 1);
+ };
+ };
+
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ p_arr[VS::ARRAY_VERTEX] = points;
+ p_arr[VS::ARRAY_NORMAL] = normals;
+ p_arr[VS::ARRAY_TANGENT] = tangents;
+ p_arr[VS::ARRAY_TEX_UV] = uvs;
+ p_arr[VS::ARRAY_INDEX] = indices;
+}
+
+void CapsuleMesh::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_radius", "radius"), &CapsuleMesh::set_radius);
+ ClassDB::bind_method(D_METHOD("get_radius"), &CapsuleMesh::get_radius);
+ ClassDB::bind_method(D_METHOD("set_mid_height", "mid_height"), &CapsuleMesh::set_mid_height);
+ ClassDB::bind_method(D_METHOD("get_mid_height"), &CapsuleMesh::get_mid_height);
+
+ ClassDB::bind_method(D_METHOD("set_radial_segments", "segments"), &CapsuleMesh::set_radial_segments);
+ ClassDB::bind_method(D_METHOD("get_radial_segments"), &CapsuleMesh::get_radial_segments);
+ ClassDB::bind_method(D_METHOD("set_rings", "rings"), &CapsuleMesh::set_rings);
+ ClassDB::bind_method(D_METHOD("get_rings"), &CapsuleMesh::get_rings);
+
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.1,100.0,0.1"), "set_radius", "get_radius");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "mid_height", PROPERTY_HINT_RANGE, "0.1,100.0,0.1"), "set_mid_height", "get_mid_height");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "radial_segments", PROPERTY_HINT_RANGE, "1,100,1"), "set_radial_segments", "get_radial_segments");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "1,100,1"), "set_rings", "get_rings");
+}
+
+void CapsuleMesh::set_radius(const float p_radius) {
+ radius = p_radius;
+ _request_update();
+}
+
+float CapsuleMesh::get_radius() const {
+ return radius;
+}
+
+void CapsuleMesh::set_mid_height(const float p_mid_height) {
+ mid_height = p_mid_height;
+ _request_update();
+}
+
+float CapsuleMesh::get_mid_height() const {
+ return mid_height;
+}
+
+void CapsuleMesh::set_radial_segments(const int p_segments) {
+ radial_segments = p_segments > 4 ? p_segments : 4;
+ _request_update();
+}
+
+int CapsuleMesh::get_radial_segments() const {
+ return radial_segments;
+}
+
+void CapsuleMesh::set_rings(const int p_rings) {
+ rings = p_rings > 1 ? p_rings : 1;
+ _request_update();
+}
+
+int CapsuleMesh::get_rings() const {
+ return rings;
+}
+
+CapsuleMesh::CapsuleMesh() {
+ // defaults
+ radius = 1.0;
+ mid_height = 1.0;
+ radial_segments = 64;
+ rings = 8;
+}
+
+/**
+ CubeMesh
+*/
+
+void CubeMesh::_create_mesh_array(Array &p_arr) const {
+ int i, j, prevrow, thisrow, point;
+ float x, y, z;
+ float onethird = 1.0 / 3.0;
+ float twothirds = 2.0 / 3.0;
+
+ Vector3 start_pos = size * -0.5;
+
+ // set our bounding box
+
+ PoolVector<Vector3> points;
+ PoolVector<Vector3> normals;
+ PoolVector<float> tangents;
+ PoolVector<Vector2> uvs;
+ PoolVector<int> indices;
+ point = 0;
+
+#define ADD_TANGENT(m_x, m_y, m_z, m_d) \
+ tangents.push_back(m_x); \
+ tangents.push_back(m_y); \
+ tangents.push_back(m_z); \
+ tangents.push_back(m_d);
+
+ // front + back
+ y = start_pos.y;
+ thisrow = point;
+ prevrow = 0;
+ for (j = 0; j <= subdivide_h + 1; j++) {
+ x = start_pos.x;
+ for (i = 0; i <= subdivide_w + 1; i++) {
+ float u = i;
+ float v = j;
+ u /= (3.0 * (subdivide_w + 1.0));
+ v /= (2.0 * (subdivide_h + 1.0));
+
+ // front
+ points.push_back(Vector3(x, -y, -start_pos.z)); // double negative on the Z!
+ normals.push_back(Vector3(0.0, 0.0, 1.0));
+ ADD_TANGENT(-1.0, 0.0, 0.0, -1.0);
+ uvs.push_back(Vector2(u, v));
+ point++;
+
+ // back
+ points.push_back(Vector3(-x, -y, start_pos.z));
+ normals.push_back(Vector3(0.0, 0.0, -1.0));
+ ADD_TANGENT(1.0, 0.0, 0.0, -1.0);
+ uvs.push_back(Vector2(twothirds + u, v));
+ point++;
+
+ if (i > 0 && j > 0) {
+ int i2 = i * 2;
+
+ // front
+ indices.push_back(prevrow + i2 - 2);
+ indices.push_back(prevrow + i2);
+ indices.push_back(thisrow + i2 - 2);
+ indices.push_back(prevrow + i2);
+ indices.push_back(thisrow + i2);
+ indices.push_back(thisrow + i2 - 2);
+
+ // back
+ indices.push_back(prevrow + i2 - 1);
+ indices.push_back(prevrow + i2 + 1);
+ indices.push_back(thisrow + i2 - 1);
+ indices.push_back(prevrow + i2 + 1);
+ indices.push_back(thisrow + i2 + 1);
+ indices.push_back(thisrow + i2 - 1);
+ };
+
+ x += size.x / (subdivide_w + 1.0);
+ };
+
+ y += size.y / (subdivide_h + 1.0);
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ // left + right
+ y = start_pos.y;
+ thisrow = point;
+ prevrow = 0;
+ for (j = 0; j <= (subdivide_h + 1); j++) {
+ z = start_pos.z;
+ for (i = 0; i <= (subdivide_d + 1); i++) {
+ float u = i;
+ float v = j;
+ u /= (3.0 * (subdivide_d + 1.0));
+ v /= (2.0 * (subdivide_h + 1.0));
+
+ // right
+ points.push_back(Vector3(-start_pos.x, -y, -z));
+ normals.push_back(Vector3(1.0, 0.0, 0.0));
+ ADD_TANGENT(0.0, 0.0, 1.0, -1.0);
+ uvs.push_back(Vector2(onethird + u, v));
+ point++;
+
+ // left
+ points.push_back(Vector3(start_pos.x, -y, z));
+ normals.push_back(Vector3(-1.0, 0.0, 0.0));
+ ADD_TANGENT(0.0, 0.0, -1.0, -1.0);
+ uvs.push_back(Vector2(u, 0.5 + v));
+ point++;
+
+ if (i > 0 && j > 0) {
+ int i2 = i * 2;
+
+ // right
+ indices.push_back(prevrow + i2 - 2);
+ indices.push_back(prevrow + i2);
+ indices.push_back(thisrow + i2 - 2);
+ indices.push_back(prevrow + i2);
+ indices.push_back(thisrow + i2);
+ indices.push_back(thisrow + i2 - 2);
+
+ // left
+ indices.push_back(prevrow + i2 - 1);
+ indices.push_back(prevrow + i2 + 1);
+ indices.push_back(thisrow + i2 - 1);
+ indices.push_back(prevrow + i2 + 1);
+ indices.push_back(thisrow + i2 + 1);
+ indices.push_back(thisrow + i2 - 1);
+ };
+
+ z += size.z / (subdivide_d + 1.0);
+ };
+
+ y += size.y / (subdivide_h + 1.0);
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ // top + bottom
+ z = start_pos.z;
+ thisrow = point;
+ prevrow = 0;
+ for (j = 0; j <= (subdivide_d + 1); j++) {
+ x = start_pos.x;
+ for (i = 0; i <= (subdivide_w + 1); i++) {
+ float u = i;
+ float v = j;
+ u /= (3.0 * (subdivide_w + 1.0));
+ v /= (2.0 * (subdivide_d + 1.0));
+
+ // top
+ points.push_back(Vector3(-x, -start_pos.y, -z));
+ normals.push_back(Vector3(0.0, 1.0, 0.0));
+ ADD_TANGENT(1.0, 0.0, 0.0, -1.0);
+ uvs.push_back(Vector2(onethird + u, 0.5 + v));
+ point++;
+
+ // bottom
+ points.push_back(Vector3(x, start_pos.y, -z));
+ normals.push_back(Vector3(0.0, -1.0, 0.0));
+ ADD_TANGENT(-1.0, 0.0, 0.0, -1.0);
+ uvs.push_back(Vector2(twothirds + u, 0.5 + v));
+ point++;
+
+ if (i > 0 && j > 0) {
+ int i2 = i * 2;
+
+ // top
+ indices.push_back(prevrow + i2 - 2);
+ indices.push_back(prevrow + i2);
+ indices.push_back(thisrow + i2 - 2);
+ indices.push_back(prevrow + i2);
+ indices.push_back(thisrow + i2);
+ indices.push_back(thisrow + i2 - 2);
+
+ // bottom
+ indices.push_back(prevrow + i2 - 1);
+ indices.push_back(prevrow + i2 + 1);
+ indices.push_back(thisrow + i2 - 1);
+ indices.push_back(prevrow + i2 + 1);
+ indices.push_back(thisrow + i2 + 1);
+ indices.push_back(thisrow + i2 - 1);
+ };
+
+ x += size.x / (subdivide_w + 1.0);
+ };
+
+ z += size.z / (subdivide_d + 1.0);
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ p_arr[VS::ARRAY_VERTEX] = points;
+ p_arr[VS::ARRAY_NORMAL] = normals;
+ p_arr[VS::ARRAY_TANGENT] = tangents;
+ p_arr[VS::ARRAY_TEX_UV] = uvs;
+ p_arr[VS::ARRAY_INDEX] = indices;
+}
+
+void CubeMesh::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_size", "size"), &CubeMesh::set_size);
+ ClassDB::bind_method(D_METHOD("get_size"), &CubeMesh::get_size);
+
+ ClassDB::bind_method(D_METHOD("set_subdivide_width", "subdivide"), &CubeMesh::set_subdivide_width);
+ ClassDB::bind_method(D_METHOD("get_subdivide_width"), &CubeMesh::get_subdivide_width);
+ ClassDB::bind_method(D_METHOD("set_subdivide_height", "divisions"), &CubeMesh::set_subdivide_height);
+ ClassDB::bind_method(D_METHOD("get_subdivide_height"), &CubeMesh::get_subdivide_height);
+ ClassDB::bind_method(D_METHOD("set_subdivide_depth", "divisions"), &CubeMesh::set_subdivide_depth);
+ ClassDB::bind_method(D_METHOD("get_subdivide_depth"), &CubeMesh::get_subdivide_depth);
+
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "size"), "set_size", "get_size");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_width", PROPERTY_HINT_RANGE, "0,100,1"), "set_subdivide_width", "get_subdivide_width");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_height", PROPERTY_HINT_RANGE, "0,100,1"), "set_subdivide_height", "get_subdivide_height");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_depth", PROPERTY_HINT_RANGE, "0,100,1"), "set_subdivide_depth", "get_subdivide_depth");
+}
+
+void CubeMesh::set_size(const Vector3 &p_size) {
+ size = p_size;
+ _request_update();
+}
+
+Vector3 CubeMesh::get_size() const {
+ return size;
+}
+
+void CubeMesh::set_subdivide_width(const int p_divisions) {
+ subdivide_w = p_divisions > 0 ? p_divisions : 0;
+ _request_update();
+}
+
+int CubeMesh::get_subdivide_width() const {
+ return subdivide_w;
+}
+
+void CubeMesh::set_subdivide_height(const int p_divisions) {
+ subdivide_h = p_divisions > 0 ? p_divisions : 0;
+ _request_update();
+}
+
+int CubeMesh::get_subdivide_height() const {
+ return subdivide_h;
+}
+
+void CubeMesh::set_subdivide_depth(const int p_divisions) {
+ subdivide_d = p_divisions > 0 ? p_divisions : 0;
+ _request_update();
+}
+
+int CubeMesh::get_subdivide_depth() const {
+ return subdivide_d;
+}
+
+CubeMesh::CubeMesh() {
+ // defaults
+ size = Vector3(2.0, 2.0, 2.0);
+ subdivide_w = 0;
+ subdivide_h = 0;
+ subdivide_d = 0;
+}
+
+/**
+ CylinderMesh
+*/
+
+void CylinderMesh::_create_mesh_array(Array &p_arr) const {
+ int i, j, prevrow, thisrow, point;
+ float x, y, z, u, v, radius;
+
+ radius = bottom_radius > top_radius ? bottom_radius : top_radius;
+
+ PoolVector<Vector3> points;
+ PoolVector<Vector3> normals;
+ PoolVector<float> tangents;
+ PoolVector<Vector2> uvs;
+ PoolVector<int> indices;
+ point = 0;
+
+#define ADD_TANGENT(m_x, m_y, m_z, m_d) \
+ tangents.push_back(m_x); \
+ tangents.push_back(m_y); \
+ tangents.push_back(m_z); \
+ tangents.push_back(m_d);
+
+ thisrow = 0;
+ prevrow = 0;
+ for (j = 0; j <= (rings + 1); j++) {
+ v = j;
+ v /= (rings + 1);
+
+ radius = top_radius + ((bottom_radius - top_radius) * v);
+
+ y = height * v;
+ y = (height * 0.5) - y;
+
+ for (i = 0; i <= radial_segments; i++) {
+ u = i;
+ u /= radial_segments;
+
+ x = sin(u * (Math_PI * 2.0));
+ z = cos(u * (Math_PI * 2.0));
+
+ Vector3 p = Vector3(x * radius, y, z * radius);
+ points.push_back(p);
+ normals.push_back(Vector3(x, 0.0, z));
+ ADD_TANGENT(-z, 0.0, x, -1.0)
+ uvs.push_back(Vector2(u, v * 0.5));
+ point++;
+
+ if (i > 0 && j > 0) {
+ indices.push_back(prevrow + i - 1);
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i - 1);
+
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i);
+ indices.push_back(thisrow + i - 1);
+ };
+ };
+
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ // add top
+ if (top_radius > 0.0) {
+ y = height * 0.5;
+
+ thisrow = point;
+ points.push_back(Vector3(0.0, y, 0.0));
+ normals.push_back(Vector3(0.0, 1.0, 0.0));
+ ADD_TANGENT(1.0, 0.0, 0.0, 1.0)
+ uvs.push_back(Vector2(0.25, 0.75));
+ point++;
+
+ for (i = 0; i <= radial_segments; i++) {
+ float r = i;
+ r /= radial_segments;
+
+ x = sin(r * (Math_PI * 2.0));
+ z = cos(r * (Math_PI * 2.0));
+
+ u = ((x + 1.0) * 0.25);
+ v = 0.5 + ((z + 1.0) * 0.25);
+
+ Vector3 p = Vector3(x * top_radius, y, z * top_radius);
+ points.push_back(p);
+ normals.push_back(Vector3(0.0, 1.0, 0.0));
+ ADD_TANGENT(1.0, 0.0, 0.0, 1.0)
+ uvs.push_back(Vector2(u, v));
+ point++;
+
+ if (i > 0) {
+ indices.push_back(thisrow);
+ indices.push_back(point - 1);
+ indices.push_back(point - 2);
+ };
+ };
+ };
+
+ // add bottom
+ if (bottom_radius > 0.0) {
+ y = height * -0.5;
+
+ thisrow = point;
+ points.push_back(Vector3(0.0, y, 0.0));
+ normals.push_back(Vector3(0.0, -1.0, 0.0));
+ ADD_TANGENT(-1.0, 0.0, 0.0, -1.0)
+ uvs.push_back(Vector2(0.75, 0.75));
+ point++;
+
+ for (i = 0; i <= radial_segments; i++) {
+ float r = i;
+ r /= radial_segments;
+
+ x = sin(r * (Math_PI * 2.0));
+ z = cos(r * (Math_PI * 2.0));
+
+ u = 0.5 + ((x + 1.0) * 0.25);
+ v = 1.0 - ((z + 1.0) * 0.25);
+
+ Vector3 p = Vector3(x * bottom_radius, y, z * bottom_radius);
+ points.push_back(p);
+ normals.push_back(Vector3(0.0, -1.0, 0.0));
+ ADD_TANGENT(-1.0, 0.0, 0.0, -1.0)
+ uvs.push_back(Vector2(u, v));
+ point++;
+
+ if (i > 0) {
+ indices.push_back(thisrow);
+ indices.push_back(point - 2);
+ indices.push_back(point - 1);
+ };
+ };
+ };
+
+ p_arr[VS::ARRAY_VERTEX] = points;
+ p_arr[VS::ARRAY_NORMAL] = normals;
+ p_arr[VS::ARRAY_TANGENT] = tangents;
+ p_arr[VS::ARRAY_TEX_UV] = uvs;
+ p_arr[VS::ARRAY_INDEX] = indices;
+}
+
+void CylinderMesh::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_top_radius", "radius"), &CylinderMesh::set_top_radius);
+ ClassDB::bind_method(D_METHOD("get_top_radius"), &CylinderMesh::get_top_radius);
+ ClassDB::bind_method(D_METHOD("set_bottom_radius", "radius"), &CylinderMesh::set_bottom_radius);
+ ClassDB::bind_method(D_METHOD("get_bottom_radius"), &CylinderMesh::get_bottom_radius);
+ ClassDB::bind_method(D_METHOD("set_height", "height"), &CylinderMesh::set_height);
+ ClassDB::bind_method(D_METHOD("get_height"), &CylinderMesh::get_height);
+
+ ClassDB::bind_method(D_METHOD("set_radial_segments", "segments"), &CylinderMesh::set_radial_segments);
+ ClassDB::bind_method(D_METHOD("get_radial_segments"), &CylinderMesh::get_radial_segments);
+ ClassDB::bind_method(D_METHOD("set_rings", "rings"), &CylinderMesh::set_rings);
+ ClassDB::bind_method(D_METHOD("get_rings"), &CylinderMesh::get_rings);
+
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "top_radius", PROPERTY_HINT_RANGE, "0.1,100.0,0.1"), "set_top_radius", "get_top_radius");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "bottom_radius", PROPERTY_HINT_RANGE, "0.1,100.0,0.1"), "set_bottom_radius", "get_bottom_radius");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_RANGE, "0.1,100.0,0.1"), "set_height", "get_height");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "radial_segments", PROPERTY_HINT_RANGE, "1,100,1"), "set_radial_segments", "get_radial_segments");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "1,100,1"), "set_rings", "get_rings");
+}
+
+void CylinderMesh::set_top_radius(const float p_radius) {
+ top_radius = p_radius;
+ _request_update();
+}
+
+float CylinderMesh::get_top_radius() const {
+ return top_radius;
+}
+
+void CylinderMesh::set_bottom_radius(const float p_radius) {
+ bottom_radius = p_radius;
+ _request_update();
+}
+
+float CylinderMesh::get_bottom_radius() const {
+ return bottom_radius;
+}
+
+void CylinderMesh::set_height(const float p_height) {
+ height = p_height;
+ _request_update();
+}
+
+float CylinderMesh::get_height() const {
+ return height;
+}
+
+void CylinderMesh::set_radial_segments(const int p_segments) {
+ radial_segments = p_segments > 4 ? p_segments : 4;
+ _request_update();
+}
+
+int CylinderMesh::get_radial_segments() const {
+ return radial_segments;
+}
+
+void CylinderMesh::set_rings(const int p_rings) {
+ rings = p_rings > 0 ? p_rings : 0;
+ _request_update();
+}
+
+int CylinderMesh::get_rings() const {
+ return rings;
+}
+
+CylinderMesh::CylinderMesh() {
+ // defaults
+ top_radius = 1.0;
+ bottom_radius = 1.0;
+ height = 2.0;
+ radial_segments = 64;
+ rings = 4;
+}
+
+/**
+ PlaneMesh
+*/
+
+void PlaneMesh::_create_mesh_array(Array &p_arr) const {
+ int i, j, prevrow, thisrow, point;
+ float x, z;
+
+ Size2 start_pos = size * -0.5;
+
+ PoolVector<Vector3> points;
+ PoolVector<Vector3> normals;
+ PoolVector<float> tangents;
+ PoolVector<Vector2> uvs;
+ PoolVector<int> indices;
+ point = 0;
+
+#define ADD_TANGENT(m_x, m_y, m_z, m_d) \
+ tangents.push_back(m_x); \
+ tangents.push_back(m_y); \
+ tangents.push_back(m_z); \
+ tangents.push_back(m_d);
+
+ /* top + bottom */
+ z = start_pos.y;
+ thisrow = point;
+ prevrow = 0;
+ for (j = 0; j <= (subdivide_d + 1); j++) {
+ x = start_pos.x;
+ for (i = 0; i <= (subdivide_w + 1); i++) {
+ float u = i;
+ float v = j;
+ u /= (subdivide_w + 1.0);
+ v /= (subdivide_d + 1.0);
+
+ points.push_back(Vector3(-x, 0.0, -z));
+ normals.push_back(Vector3(0.0, 1.0, 0.0));
+ ADD_TANGENT(1.0, 0.0, 0.0, -1.0);
+ uvs.push_back(Vector2(u, v));
+ point++;
+
+ if (i > 0 && j > 0) {
+ indices.push_back(prevrow + i - 1);
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i - 1);
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i);
+ indices.push_back(thisrow + i - 1);
+ };
+
+ x += size.x / (subdivide_w + 1.0);
+ };
+
+ z += size.y / (subdivide_d + 1.0);
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ p_arr[VS::ARRAY_VERTEX] = points;
+ p_arr[VS::ARRAY_NORMAL] = normals;
+ p_arr[VS::ARRAY_TANGENT] = tangents;
+ p_arr[VS::ARRAY_TEX_UV] = uvs;
+ p_arr[VS::ARRAY_INDEX] = indices;
+}
+
+void PlaneMesh::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_size", "size"), &PlaneMesh::set_size);
+ ClassDB::bind_method(D_METHOD("get_size"), &PlaneMesh::get_size);
+
+ ClassDB::bind_method(D_METHOD("set_subdivide_width", "subdivide"), &PlaneMesh::set_subdivide_width);
+ ClassDB::bind_method(D_METHOD("get_subdivide_width"), &PlaneMesh::get_subdivide_width);
+ ClassDB::bind_method(D_METHOD("set_subdivide_depth", "subdivide"), &PlaneMesh::set_subdivide_depth);
+ ClassDB::bind_method(D_METHOD("get_subdivide_depth"), &PlaneMesh::get_subdivide_depth);
+
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "size"), "set_size", "get_size");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_width", PROPERTY_HINT_RANGE, "0,100,1"), "set_subdivide_width", "get_subdivide_width");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_depth", PROPERTY_HINT_RANGE, "0,100,1"), "set_subdivide_depth", "get_subdivide_depth");
+}
+
+void PlaneMesh::set_size(const Size2 &p_size) {
+ size = p_size;
+ _request_update();
+}
+
+Size2 PlaneMesh::get_size() const {
+ return size;
+}
+
+void PlaneMesh::set_subdivide_width(const int p_divisions) {
+ subdivide_w = p_divisions > 0 ? p_divisions : 0;
+ _request_update();
+}
+
+int PlaneMesh::get_subdivide_width() const {
+ return subdivide_w;
+}
+
+void PlaneMesh::set_subdivide_depth(const int p_divisions) {
+ subdivide_d = p_divisions > 0 ? p_divisions : 0;
+ _request_update();
+}
+
+int PlaneMesh::get_subdivide_depth() const {
+ return subdivide_d;
+}
+
+PlaneMesh::PlaneMesh() {
+ // defaults
+ size = Size2(2.0, 2.0);
+ subdivide_w = 0;
+ subdivide_d = 0;
+}
+
+/**
+ PrismMesh
+*/
+
+void PrismMesh::_create_mesh_array(Array &p_arr) const {
+ int i, j, prevrow, thisrow, point;
+ float x, y, z;
+ float onethird = 1.0 / 3.0;
+ float twothirds = 2.0 / 3.0;
+
+ Vector3 start_pos = size * -0.5;
+
+ // set our bounding box
+
+ PoolVector<Vector3> points;
+ PoolVector<Vector3> normals;
+ PoolVector<float> tangents;
+ PoolVector<Vector2> uvs;
+ PoolVector<int> indices;
+ point = 0;
+
+#define ADD_TANGENT(m_x, m_y, m_z, m_d) \
+ tangents.push_back(m_x); \
+ tangents.push_back(m_y); \
+ tangents.push_back(m_z); \
+ tangents.push_back(m_d);
+
+ /* front + back */
+ y = start_pos.y;
+ thisrow = point;
+ prevrow = 0;
+ for (j = 0; j <= (subdivide_h + 1); j++) {
+ float scale = (y - start_pos.y) / size.y;
+ float scaled_size_x = size.x * scale;
+ float start_x = start_pos.x;
+ float offset_front = 0.0;
+ float offset_back = 0.0;
+
+ start_x += (1.0 - scale) * size.x * left_to_right;
+ offset_front += (1.0 - scale) * onethird * left_to_right;
+ offset_back = (1.0 - scale) * onethird * (1.0 - left_to_right);
+
+ x = 0.0;
+ for (i = 0; i <= (subdivide_w + 1); i++) {
+ float u = i;
+ float v = j;
+ u /= (3.0 * (subdivide_w + 1.0));
+ v /= (2.0 * (subdivide_h + 1.0));
+
+ u *= scale;
+
+ /* front */
+ points.push_back(Vector3(start_x + x, -y, -start_pos.z)); // double negative on the Z!
+ normals.push_back(Vector3(0.0, 0.0, 1.0));
+ ADD_TANGENT(-1.0, 0.0, 0.0, -1.0);
+ uvs.push_back(Vector2(offset_front + u, v));
+ point++;
+
+ /* back */
+ points.push_back(Vector3(start_x + scaled_size_x - x, -y, start_pos.z));
+ normals.push_back(Vector3(0.0, 0.0, -1.0));
+ ADD_TANGENT(1.0, 0.0, 0.0, -1.0);
+ uvs.push_back(Vector2(twothirds + offset_back + u, v));
+ point++;
+
+ if (i > 0 && j == 1) {
+ int i2 = i * 2;
+
+ /* front */
+ indices.push_back(prevrow + i2);
+ indices.push_back(thisrow + i2);
+ indices.push_back(thisrow + i2 - 2);
+
+ /* back */
+ indices.push_back(prevrow + i2 + 1);
+ indices.push_back(thisrow + i2 + 1);
+ indices.push_back(thisrow + i2 - 1);
+ } else if (i > 0 && j > 0) {
+ int i2 = i * 2;
+
+ /* front */
+ indices.push_back(prevrow + i2 - 2);
+ indices.push_back(prevrow + i2);
+ indices.push_back(thisrow + i2 - 2);
+ indices.push_back(prevrow + i2);
+ indices.push_back(thisrow + i2);
+ indices.push_back(thisrow + i2 - 2);
+
+ /* back */
+ indices.push_back(prevrow + i2 - 1);
+ indices.push_back(prevrow + i2 + 1);
+ indices.push_back(thisrow + i2 - 1);
+ indices.push_back(prevrow + i2 + 1);
+ indices.push_back(thisrow + i2 + 1);
+ indices.push_back(thisrow + i2 - 1);
+ };
+
+ x += scale * size.x / (subdivide_w + 1.0);
+ };
+
+ y += size.y / (subdivide_h + 1.0);
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ /* left + right */
+ Vector3 normal_left, normal_right;
+
+ normal_left = Vector3(-size.y, size.x * left_to_right, 0.0);
+ normal_right = Vector3(size.y, size.x * left_to_right, 0.0);
+ normal_left.normalize();
+ normal_right.normalize();
+
+ y = start_pos.y;
+ thisrow = point;
+ prevrow = 0;
+ for (j = 0; j <= (subdivide_h + 1); j++) {
+ float left, right;
+ float scale = (y - start_pos.y) / size.y;
+
+ left = start_pos.x + (size.x * (1.0 - scale) * left_to_right);
+ right = left + (size.x * scale);
+
+ z = start_pos.z;
+ for (i = 0; i <= (subdivide_d + 1); i++) {
+ float u = i;
+ float v = j;
+ u /= (3.0 * (subdivide_d + 1.0));
+ v /= (2.0 * (subdivide_h + 1.0));
+
+ /* right */
+ points.push_back(Vector3(right, -y, -z));
+ normals.push_back(normal_right);
+ ADD_TANGENT(0.0, 0.0, 1.0, -1.0);
+ uvs.push_back(Vector2(onethird + u, v));
+ point++;
+
+ /* left */
+ points.push_back(Vector3(left, -y, z));
+ normals.push_back(normal_left);
+ ADD_TANGENT(0.0, 0.0, -1.0, -1.0);
+ uvs.push_back(Vector2(u, 0.5 + v));
+ point++;
+
+ if (i > 0 && j > 0) {
+ int i2 = i * 2;
+
+ /* right */
+ indices.push_back(prevrow + i2 - 2);
+ indices.push_back(prevrow + i2);
+ indices.push_back(thisrow + i2 - 2);
+ indices.push_back(prevrow + i2);
+ indices.push_back(thisrow + i2);
+ indices.push_back(thisrow + i2 - 2);
+
+ /* left */
+ indices.push_back(prevrow + i2 - 1);
+ indices.push_back(prevrow + i2 + 1);
+ indices.push_back(thisrow + i2 - 1);
+ indices.push_back(prevrow + i2 + 1);
+ indices.push_back(thisrow + i2 + 1);
+ indices.push_back(thisrow + i2 - 1);
+ };
+
+ z += size.z / (subdivide_d + 1.0);
+ };
+
+ y += size.y / (subdivide_h + 1.0);
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ /* bottom */
+ z = start_pos.z;
+ thisrow = point;
+ prevrow = 0;
+ for (j = 0; j <= (subdivide_d + 1); j++) {
+ x = start_pos.x;
+ for (i = 0; i <= (subdivide_w + 1); i++) {
+ float u = i;
+ float v = j;
+ u /= (3.0 * (subdivide_w + 1.0));
+ v /= (2.0 * (subdivide_d + 1.0));
+
+ /* bottom */
+ points.push_back(Vector3(x, start_pos.y, -z));
+ normals.push_back(Vector3(0.0, -1.0, 0.0));
+ ADD_TANGENT(-1.0, 0.0, 0.0, -1.0);
+ uvs.push_back(Vector2(twothirds + u, 0.5 + v));
+ point++;
+
+ if (i > 0 && j > 0) {
+ /* bottom */
+ indices.push_back(prevrow + i - 1);
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i - 1);
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i);
+ indices.push_back(thisrow + i - 1);
+ };
+
+ x += size.x / (subdivide_w + 1.0);
+ };
+
+ z += size.z / (subdivide_d + 1.0);
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ p_arr[VS::ARRAY_VERTEX] = points;
+ p_arr[VS::ARRAY_NORMAL] = normals;
+ p_arr[VS::ARRAY_TANGENT] = tangents;
+ p_arr[VS::ARRAY_TEX_UV] = uvs;
+ p_arr[VS::ARRAY_INDEX] = indices;
+}
+
+void PrismMesh::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_left_to_right", "left_to_right"), &PrismMesh::set_left_to_right);
+ ClassDB::bind_method(D_METHOD("get_left_to_right"), &PrismMesh::get_left_to_right);
+
+ ClassDB::bind_method(D_METHOD("set_size", "size"), &PrismMesh::set_size);
+ ClassDB::bind_method(D_METHOD("get_size"), &PrismMesh::get_size);
+
+ ClassDB::bind_method(D_METHOD("set_subdivide_width", "segments"), &PrismMesh::set_subdivide_width);
+ ClassDB::bind_method(D_METHOD("get_subdivide_width"), &PrismMesh::get_subdivide_width);
+ ClassDB::bind_method(D_METHOD("set_subdivide_height", "segments"), &PrismMesh::set_subdivide_height);
+ ClassDB::bind_method(D_METHOD("get_subdivide_height"), &PrismMesh::get_subdivide_height);
+ ClassDB::bind_method(D_METHOD("set_subdivide_depth", "segments"), &PrismMesh::set_subdivide_depth);
+ ClassDB::bind_method(D_METHOD("get_subdivide_depth"), &PrismMesh::get_subdivide_depth);
+
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "left_to_right", PROPERTY_HINT_RANGE, "-2.0,2.0,0.1"), "set_left_to_right", "get_left_to_right");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "size", PROPERTY_HINT_RANGE, "0.1,100.0,0.1"), "set_size", "get_size");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_width", PROPERTY_HINT_RANGE, "0,100,1"), "set_subdivide_width", "get_subdivide_width");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_height", PROPERTY_HINT_RANGE, "0,100,1"), "set_subdivide_height", "get_subdivide_height");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_depth", PROPERTY_HINT_RANGE, "0,100,1"), "set_subdivide_depth", "get_subdivide_depth");
+}
+
+void PrismMesh::set_left_to_right(const float p_left_to_right) {
+ left_to_right = p_left_to_right;
+ _request_update();
+}
+
+float PrismMesh::get_left_to_right() const {
+ return left_to_right;
+}
+
+void PrismMesh::set_size(const Vector3 &p_size) {
+ size = p_size;
+ _request_update();
+}
+
+Vector3 PrismMesh::get_size() const {
+ return size;
+}
+
+void PrismMesh::set_subdivide_width(const int p_divisions) {
+ subdivide_w = p_divisions > 0 ? p_divisions : 0;
+ _request_update();
+}
+
+int PrismMesh::get_subdivide_width() const {
+ return subdivide_w;
+}
+
+void PrismMesh::set_subdivide_height(const int p_divisions) {
+ subdivide_h = p_divisions > 0 ? p_divisions : 0;
+ _request_update();
+}
+
+int PrismMesh::get_subdivide_height() const {
+ return subdivide_h;
+}
+
+void PrismMesh::set_subdivide_depth(const int p_divisions) {
+ subdivide_d = p_divisions > 0 ? p_divisions : 0;
+ _request_update();
+}
+
+int PrismMesh::get_subdivide_depth() const {
+ return subdivide_d;
+}
+
+PrismMesh::PrismMesh() {
+ // defaults
+ left_to_right = 0.5;
+ size = Vector3(2.0, 2.0, 2.0);
+ subdivide_w = 0;
+ subdivide_h = 0;
+ subdivide_d = 0;
+}
+
+/**
+ QuadMesh
+*/
+
+void QuadMesh::_create_mesh_array(Array &p_arr) const {
+ PoolVector<Vector3> faces;
+ PoolVector<Vector3> normals;
+ PoolVector<float> tangents;
+ PoolVector<Vector2> uvs;
+
+ faces.resize(4);
+ normals.resize(4);
+ tangents.resize(4 * 4);
+ uvs.resize(4);
+
+ for (int i = 0; i < 4; i++) {
+
+ static const Vector3 quad_faces[4] = {
+ Vector3(-1, -1, 0),
+ Vector3(-1, 1, 0),
+ Vector3(1, 1, 0),
+ Vector3(1, -1, 0),
+ };
+
+ faces.set(i, quad_faces[i]);
+ normals.set(i, Vector3(0, 0, 1));
+ tangents.set(i * 4 + 0, 1.0);
+ tangents.set(i * 4 + 1, 0.0);
+ tangents.set(i * 4 + 2, 0.0);
+ tangents.set(i * 4 + 3, 1.0);
+
+ static const Vector2 quad_uv[4] = {
+ Vector2(0, 1),
+ Vector2(0, 0),
+ Vector2(1, 0),
+ Vector2(1, 1),
+ };
+
+ uvs.set(i, quad_uv[i]);
+ }
+
+ p_arr[ARRAY_VERTEX] = faces;
+ p_arr[ARRAY_NORMAL] = normals;
+ p_arr[ARRAY_TANGENT] = tangents;
+ p_arr[ARRAY_TEX_UV] = uvs;
+};
+
+void QuadMesh::_bind_methods() {
+ // nothing here yet...
+}
+
+QuadMesh::QuadMesh() {
+ primitive_type = PRIMITIVE_TRIANGLE_FAN;
+}
+
+/**
+ SphereMesh
+*/
+
+void SphereMesh::_create_mesh_array(Array &p_arr) const {
+ int i, j, prevrow, thisrow, point;
+ float x, y, z;
+
+ // set our bounding box
+
+ PoolVector<Vector3> points;
+ PoolVector<Vector3> normals;
+ PoolVector<float> tangents;
+ PoolVector<Vector2> uvs;
+ PoolVector<int> indices;
+ point = 0;
+
+#define ADD_TANGENT(m_x, m_y, m_z, m_d) \
+ tangents.push_back(m_x); \
+ tangents.push_back(m_y); \
+ tangents.push_back(m_z); \
+ tangents.push_back(m_d);
+
+ thisrow = 0;
+ prevrow = 0;
+ for (j = 0; j <= (rings + 1); j++) {
+ float v = j;
+ float w;
+
+ v /= (rings + 1);
+ w = sin(Math_PI * v);
+ y = height * (is_hemisphere ? 1.0 : 0.5) * cos(Math_PI * v);
+
+ for (i = 0; i <= radial_segments; i++) {
+ float u = i;
+ u /= radial_segments;
+
+ x = sin(u * (Math_PI * 2.0));
+ z = cos(u * (Math_PI * 2.0));
+
+ if (is_hemisphere && y < 0.0) {
+ points.push_back(Vector3(x * radius * w, 0.0, z * radius * w));
+ normals.push_back(Vector3(0.0, -1.0, 0.0));
+ } else {
+ Vector3 p = Vector3(x * radius * w, y, z * radius * w);
+ points.push_back(p);
+ normals.push_back(p.normalized());
+ };
+ ADD_TANGENT(-z, 0.0, x, -1.0)
+ uvs.push_back(Vector2(u, v));
+ point++;
+
+ if (i > 0 && j > 0) {
+ indices.push_back(prevrow + i - 1);
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i - 1);
+
+ indices.push_back(prevrow + i);
+ indices.push_back(thisrow + i);
+ indices.push_back(thisrow + i - 1);
+ };
+ };
+
+ prevrow = thisrow;
+ thisrow = point;
+ };
+
+ p_arr[VS::ARRAY_VERTEX] = points;
+ p_arr[VS::ARRAY_NORMAL] = normals;
+ p_arr[VS::ARRAY_TANGENT] = tangents;
+ p_arr[VS::ARRAY_TEX_UV] = uvs;
+ p_arr[VS::ARRAY_INDEX] = indices;
+}
+
+void SphereMesh::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_radius", "radius"), &SphereMesh::set_radius);
+ ClassDB::bind_method(D_METHOD("get_radius"), &SphereMesh::get_radius);
+ ClassDB::bind_method(D_METHOD("set_height", "height"), &SphereMesh::set_height);
+ ClassDB::bind_method(D_METHOD("get_height"), &SphereMesh::get_height);
+
+ ClassDB::bind_method(D_METHOD("set_radial_segments", "radial_segments"), &SphereMesh::set_radial_segments);
+ ClassDB::bind_method(D_METHOD("get_radial_segments"), &SphereMesh::get_radial_segments);
+ ClassDB::bind_method(D_METHOD("set_rings", "rings"), &SphereMesh::set_rings);
+ ClassDB::bind_method(D_METHOD("get_rings"), &SphereMesh::get_rings);
+
+ ClassDB::bind_method(D_METHOD("set_is_hemisphere", "is_hemisphere"), &SphereMesh::set_is_hemisphere);
+ ClassDB::bind_method(D_METHOD("get_is_hemisphere"), &SphereMesh::get_is_hemisphere);
+
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.1,100.0,0.1"), "set_radius", "get_radius");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_RANGE, "0.1,100.0,0.1"), "set_height", "get_height");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "radial_segments", PROPERTY_HINT_RANGE, "1,100,1"), "set_radial_segments", "get_radial_segments");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "1,100,1"), "set_rings", "get_rings");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "is_hemisphere"), "set_is_hemisphere", "get_is_hemisphere");
+}
+
+void SphereMesh::set_radius(const float p_radius) {
+ radius = p_radius;
+ _request_update();
+}
+
+float SphereMesh::get_radius() const {
+ return radius;
+}
+
+void SphereMesh::set_height(const float p_height) {
+ height = p_height;
+ _request_update();
+}
+
+float SphereMesh::get_height() const {
+ return height;
+}
+
+void SphereMesh::set_radial_segments(const int p_radial_segments) {
+ radial_segments = p_radial_segments > 4 ? p_radial_segments : 4;
+ _request_update();
+}
+
+int SphereMesh::get_radial_segments() const {
+ return radial_segments;
+}
+
+void SphereMesh::set_rings(const int p_rings) {
+ rings = p_rings > 1 ? p_rings : 1;
+ _request_update();
+}
+
+int SphereMesh::get_rings() const {
+ return rings;
+}
+
+void SphereMesh::set_is_hemisphere(const bool p_is_hemisphere) {
+ is_hemisphere = p_is_hemisphere;
+ _request_update();
+}
+
+bool SphereMesh::get_is_hemisphere() const {
+ return is_hemisphere;
+}
+
+SphereMesh::SphereMesh() {
+ // defaults
+ radius = 1.0;
+ height = 2.0;
+ radial_segments = 64;
+ rings = 32;
+ is_hemisphere = false;
+}
diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h
new file mode 100644
index 0000000000..bcd5d30dd3
--- /dev/null
+++ b/scene/resources/primitive_meshes.h
@@ -0,0 +1,310 @@
+/*************************************************************************/
+/* primitive_meshes.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 PRIMITIVE_MESHES_H
+#define PRIMITIVE_MESHES_H
+
+#include "scene/resources/mesh.h"
+
+///@TODO probably should change a few integers to unsigned integers...
+
+/**
+ @author Bastiaan Olij <mux213@gmail.com>
+
+ Base class for all the classes in this file, handles a number of code functions that are shared among all meshes.
+ This class is set appart that it assumes a single surface is always generated for our mesh.
+*/
+class PrimitiveMesh : public Mesh {
+
+ GDCLASS(PrimitiveMesh, Mesh);
+
+private:
+ RID mesh;
+ mutable Rect3 aabb;
+
+ Ref<Material> material;
+
+ mutable bool pending_request;
+ void _update() const;
+
+protected:
+ Mesh::PrimitiveType primitive_type;
+
+ static void _bind_methods();
+
+ virtual void _create_mesh_array(Array &p_arr) const = 0;
+ void _request_update();
+
+public:
+ virtual int get_surface_count() const;
+ virtual int surface_get_array_len(int p_idx) const;
+ virtual int surface_get_array_index_len(int p_idx) const;
+ virtual Array surface_get_arrays(int p_surface) const;
+ virtual uint32_t surface_get_format(int p_idx) const;
+ virtual Mesh::PrimitiveType surface_get_primitive_type(int p_idx) const;
+ virtual Ref<Material> surface_get_material(int p_idx) const;
+ virtual int get_blend_shape_count() const;
+ virtual StringName get_blend_shape_name(int p_index) const;
+ virtual Rect3 get_aabb() const;
+ virtual RID get_rid() const;
+
+ void set_material(const Ref<Material> &p_material);
+ Ref<Material> get_material() const;
+
+ PrimitiveMesh();
+ ~PrimitiveMesh();
+};
+
+/**
+ Mesh for a simple capsule
+*/
+class CapsuleMesh : public PrimitiveMesh {
+ GDCLASS(CapsuleMesh, PrimitiveMesh);
+
+private:
+ float radius;
+ float mid_height;
+ int radial_segments;
+ int rings;
+
+protected:
+ static void _bind_methods();
+ virtual void _create_mesh_array(Array &p_arr) const;
+
+public:
+ void set_radius(const float p_radius);
+ float get_radius() const;
+
+ void set_mid_height(const float p_mid_height);
+ float get_mid_height() const;
+
+ void set_radial_segments(const int p_segments);
+ int get_radial_segments() const;
+
+ void set_rings(const int p_rings);
+ int get_rings() const;
+
+ CapsuleMesh();
+};
+
+/**
+ Similar to test cube but with subdivision support and different texture coordinates
+*/
+class CubeMesh : public PrimitiveMesh {
+
+ GDCLASS(CubeMesh, PrimitiveMesh);
+
+private:
+ Vector3 size;
+ int subdivide_w;
+ int subdivide_h;
+ int subdivide_d;
+
+protected:
+ static void _bind_methods();
+ virtual void _create_mesh_array(Array &p_arr) const;
+
+public:
+ void set_size(const Vector3 &p_size);
+ Vector3 get_size() const;
+
+ void set_subdivide_width(const int p_divisions);
+ int get_subdivide_width() const;
+
+ void set_subdivide_height(const int p_divisions);
+ int get_subdivide_height() const;
+
+ void set_subdivide_depth(const int p_divisions);
+ int get_subdivide_depth() const;
+
+ CubeMesh();
+};
+
+/**
+ A cylinder
+*/
+
+class CylinderMesh : public PrimitiveMesh {
+
+ GDCLASS(CylinderMesh, PrimitiveMesh);
+
+private:
+ float top_radius;
+ float bottom_radius;
+ float height;
+ int radial_segments;
+ int rings;
+
+protected:
+ static void _bind_methods();
+ virtual void _create_mesh_array(Array &p_arr) const;
+
+public:
+ void set_top_radius(const float p_radius);
+ float get_top_radius() const;
+
+ void set_bottom_radius(const float p_radius);
+ float get_bottom_radius() const;
+
+ void set_height(const float p_height);
+ float get_height() const;
+
+ void set_radial_segments(const int p_segments);
+ int get_radial_segments() const;
+
+ void set_rings(const int p_rings);
+ int get_rings() const;
+
+ CylinderMesh();
+};
+
+/**
+ Similar to quadmesh but with tesselation support
+*/
+class PlaneMesh : public PrimitiveMesh {
+
+ GDCLASS(PlaneMesh, PrimitiveMesh);
+
+private:
+ Size2 size;
+ int subdivide_w;
+ int subdivide_d;
+
+protected:
+ static void _bind_methods();
+ virtual void _create_mesh_array(Array &p_arr) const;
+
+public:
+ void set_size(const Size2 &p_size);
+ Size2 get_size() const;
+
+ void set_subdivide_width(const int p_divisions);
+ int get_subdivide_width() const;
+
+ void set_subdivide_depth(const int p_divisions);
+ int get_subdivide_depth() const;
+
+ PlaneMesh();
+};
+
+/**
+ A prism shapen, handy for ramps, triangles, etc.
+*/
+class PrismMesh : public PrimitiveMesh {
+
+ GDCLASS(PrismMesh, PrimitiveMesh);
+
+private:
+ float left_to_right;
+ Vector3 size;
+ int subdivide_w;
+ int subdivide_h;
+ int subdivide_d;
+
+protected:
+ static void _bind_methods();
+ virtual void _create_mesh_array(Array &p_arr) const;
+
+public:
+ void set_left_to_right(const float p_left_to_right);
+ float get_left_to_right() const;
+
+ void set_size(const Vector3 &p_size);
+ Vector3 get_size() const;
+
+ void set_subdivide_width(const int p_divisions);
+ int get_subdivide_width() const;
+
+ void set_subdivide_height(const int p_divisions);
+ int get_subdivide_height() const;
+
+ void set_subdivide_depth(const int p_divisions);
+ int get_subdivide_depth() const;
+
+ PrismMesh();
+};
+
+/**
+ Our original quadmesh...
+*/
+
+class QuadMesh : public PrimitiveMesh {
+
+ GDCLASS(QuadMesh, PrimitiveMesh)
+
+private:
+ // nothing? really? Maybe add size some day atleast... :)
+
+protected:
+ static void _bind_methods();
+ virtual void _create_mesh_array(Array &p_arr) const;
+
+public:
+ QuadMesh();
+};
+
+/**
+ A sphere..
+*/
+class SphereMesh : public PrimitiveMesh {
+
+ GDCLASS(SphereMesh, PrimitiveMesh);
+
+private:
+ float radius;
+ float height;
+ int radial_segments;
+ int rings;
+ bool is_hemisphere;
+
+protected:
+ static void _bind_methods();
+ virtual void _create_mesh_array(Array &p_arr) const;
+
+public:
+ void set_radius(const float p_radius);
+ float get_radius() const;
+
+ void set_height(const float p_height);
+ float get_height() const;
+
+ void set_radial_segments(const int p_radial_segments);
+ int get_radial_segments() const;
+
+ void set_rings(const int p_rings);
+ int get_rings() const;
+
+ void set_is_hemisphere(const bool p_is_hemisphere);
+ bool get_is_hemisphere() const;
+
+ SphereMesh();
+};
+
+#endif
diff --git a/scene/resources/ray_shape.cpp b/scene/resources/ray_shape.cpp
index 8187b8b3f1..3abb2a4fa1 100644
--- a/scene/resources/ray_shape.cpp
+++ b/scene/resources/ray_shape.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/ray_shape.h b/scene/resources/ray_shape.h
index f8dbf89e04..5a17e9414e 100644
--- a/scene/resources/ray_shape.h
+++ b/scene/resources/ray_shape.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp
index 06b5ac0316..bd9ec8cbc4 100644
--- a/scene/resources/rectangle_shape_2d.cpp
+++ b/scene/resources/rectangle_shape_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/rectangle_shape_2d.h b/scene/resources/rectangle_shape_2d.h
index 8de2f7580e..23db58ba07 100644
--- a/scene/resources/rectangle_shape_2d.h
+++ b/scene/resources/rectangle_shape_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/room.cpp b/scene/resources/room.cpp
index 9ec8914e2f..c89b7c72c7 100644
--- a/scene/resources/room.cpp
+++ b/scene/resources/room.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/room.h b/scene/resources/room.h
index c7db4b13d9..ba5c0eee1c 100644
--- a/scene/resources/room.h
+++ b/scene/resources/room.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -49,7 +50,7 @@ protected:
public:
virtual RID get_rid() const;
- void set_geometry_hint(const PoolVector<Face3> &geometry_hint);
+ void set_geometry_hint(const PoolVector<Face3> &p_geometry_hint);
PoolVector<Face3> get_geometry_hint() const;
RoomBounds();
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp
index 7162c9fc18..49cd030a9a 100644
--- a/scene/resources/scene_format_text.cpp
+++ b/scene/resources/scene_format_text.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "scene_format_text.h"
-#include "global_config.h"
#include "os/dir_access.h"
+#include "project_settings.h"
#include "version.h"
//version 2: changed names for basis, rect3, poolvectors, etc.
@@ -109,7 +110,7 @@ Error ResourceInteractiveLoaderText::_parse_ext_resource(VariantParser::Stream *
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
- path = GlobalConfig::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
+ path = ProjectSettings::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
}
r_res = ResourceLoader::load(path, type);
@@ -164,7 +165,7 @@ Error ResourceInteractiveLoaderText::poll() {
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
- path = GlobalConfig::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path));
+ path = ProjectSettings::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path));
}
if (remaps.has(path)) {
@@ -331,6 +332,7 @@ Error ResourceInteractiveLoaderText::poll() {
if (!ResourceCache::has(res_path)) {
resource->set_path(res_path);
}
+ resource->set_as_translation_remapped(translation_remapped);
}
return error;
}
@@ -605,14 +607,23 @@ int ResourceInteractiveLoaderText::get_stage_count() const {
return resources_total; //+ext_resources;
}
+void ResourceInteractiveLoaderText::set_translation_remapped(bool p_remapped) {
+
+ translation_remapped = p_remapped;
+}
+
+ResourceInteractiveLoaderText::ResourceInteractiveLoaderText() {
+ translation_remapped = false;
+}
+
ResourceInteractiveLoaderText::~ResourceInteractiveLoaderText() {
memdelete(f);
}
-void ResourceInteractiveLoaderText::get_dependencies(FileAccess *f, List<String> *p_dependencies, bool p_add_types) {
+void ResourceInteractiveLoaderText::get_dependencies(FileAccess *p_f, List<String> *p_dependencies, bool p_add_types) {
- open(f);
+ open(p_f);
ignore_resource_parsing = true;
ERR_FAIL_COND(error != OK);
@@ -637,7 +648,7 @@ void ResourceInteractiveLoaderText::get_dependencies(FileAccess *f, List<String>
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
- path = GlobalConfig::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path));
+ path = ProjectSettings::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path));
}
if (p_add_types) {
@@ -894,9 +905,9 @@ Ref<ResourceInteractiveLoader> ResourceFormatLoaderText::load_interactive(const
}
Ref<ResourceInteractiveLoaderText> ria = memnew(ResourceInteractiveLoaderText);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
- //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( ProjectSettings::get_singleton()->localize_path(p_path) );
ria->open(f);
return ria;
@@ -942,9 +953,9 @@ String ResourceFormatLoaderText::get_resource_type(const String &p_path) const {
}
Ref<ResourceInteractiveLoaderText> ria = memnew(ResourceInteractiveLoaderText);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
- //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( ProjectSettings::get_singleton()->localize_path(p_path) );
String r = ria->recognize(f);
return r;
}
@@ -958,9 +969,9 @@ void ResourceFormatLoaderText::get_dependencies(const String &p_path, List<Strin
}
Ref<ResourceInteractiveLoaderText> ria = memnew(ResourceInteractiveLoaderText);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
- //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( ProjectSettings::get_singleton()->localize_path(p_path) );
ria->get_dependencies(f, p_dependencies, p_add_types);
}
@@ -973,9 +984,9 @@ Error ResourceFormatLoaderText::rename_dependencies(const String &p_path, const
}
Ref<ResourceInteractiveLoaderText> ria = memnew(ResourceInteractiveLoaderText);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
- //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( ProjectSettings::get_singleton()->localize_path(p_path) );
return ria->rename_dependencies(f, p_path, p_map);
}
@@ -1107,7 +1118,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r
ERR_FAIL_COND_V(err, ERR_CANT_OPEN);
FileAccessRef _fref(f);
- local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ local_path = ProjectSettings::get_singleton()->localize_path(p_path);
relative_paths = p_flags & ResourceSaver::FLAG_RELATIVE_PATHS;
skip_editor = p_flags & ResourceSaver::FLAG_OMIT_EDITOR_PROPERTIES;
diff --git a/scene/resources/scene_format_text.h b/scene/resources/scene_format_text.h
index 99e7de6232..1ea6465c21 100644
--- a/scene/resources/scene_format_text.h
+++ b/scene/resources/scene_format_text.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,6 +38,7 @@
class ResourceInteractiveLoaderText : public ResourceInteractiveLoader {
+ bool translation_remapped;
String local_path;
String res_path;
String error_text;
@@ -93,12 +95,14 @@ public:
virtual Error poll();
virtual int get_stage() const;
virtual int get_stage_count() const;
+ virtual void set_translation_remapped(bool p_remapped);
void open(FileAccess *p_f, bool p_skip_first_tag = false);
String recognize(FileAccess *p_f);
void get_dependencies(FileAccess *p_f, List<String> *p_dependencies, bool p_add_types);
Error rename_dependencies(FileAccess *p_f, const String &p_path, const Map<String, String> &p_map);
+ ResourceInteractiveLoaderText();
~ResourceInteractiveLoaderText();
};
diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp
index 7a1114f895..99062d693b 100644
--- a/scene/resources/segment_shape_2d.cpp
+++ b/scene/resources/segment_shape_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,7 +35,7 @@
void SegmentShape2D::_update_shape() {
Rect2 r;
- r.pos = a;
+ r.position = a;
r.size = b;
Physics2DServer::get_singleton()->shape_set_data(get_rid(), r);
emit_changed();
@@ -68,7 +69,7 @@ void SegmentShape2D::draw(const RID &p_to_rid, const Color &p_color) {
Rect2 SegmentShape2D::get_rect() const {
Rect2 rect;
- rect.pos = a;
+ rect.position = a;
rect.expand_to(b);
return rect;
}
@@ -120,7 +121,7 @@ void RayShape2D::draw(const RID &p_to_rid, const Color &p_color) {
Rect2 RayShape2D::get_rect() const {
Rect2 rect;
- rect.pos = Vector2();
+ rect.position = Vector2();
rect.expand_to(Vector2(0, length));
rect = rect.grow(0.707 * 4);
return rect;
diff --git a/scene/resources/segment_shape_2d.h b/scene/resources/segment_shape_2d.h
index e58ce6be60..22fc1ab6e3 100644
--- a/scene/resources/segment_shape_2d.h
+++ b/scene/resources/segment_shape_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp
index fd058a4a6f..b72eb9fbef 100644
--- a/scene/resources/shader.cpp
+++ b/scene/resources/shader.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,7 @@
#include "shader.h"
#include "os/file_access.h"
#include "scene/scene_string_names.h"
+#include "servers/visual/shader_language.h"
#include "servers/visual_server.h"
#include "texture.h"
@@ -39,6 +41,18 @@ Shader::Mode Shader::get_mode() const {
void Shader::set_code(const String &p_code) {
+ String type = ShaderLanguage::get_shader_type(p_code);
+
+ print_line("mode: " + type);
+
+ if (type == "canvas_item") {
+ mode = MODE_CANVAS_ITEM;
+ } else if (type == "particles") {
+ mode = MODE_PARTICLES;
+ } else {
+ mode = MODE_SPATIAL;
+ }
+
VisualServer::get_singleton()->shader_set_code(shader, p_code);
params_cache_dirty = true;
emit_signal(SceneStringNames::get_singleton()->changed);
@@ -114,8 +128,8 @@ void Shader::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_code", "code"), &Shader::set_code);
ClassDB::bind_method(D_METHOD("get_code"), &Shader::get_code);
- 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(D_METHOD("set_default_texture_param", "param", "texture"), &Shader::set_default_texture_param);
+ ClassDB::bind_method(D_METHOD("get_default_texture_param", "param"), &Shader::get_default_texture_param);
ClassDB::bind_method(D_METHOD("has_param", "name"), &Shader::has_param);
@@ -128,10 +142,10 @@ void Shader::_bind_methods() {
BIND_CONSTANT(MODE_PARTICLES);
}
-Shader::Shader(Mode p_mode) {
+Shader::Shader() {
- mode = p_mode;
- shader = VisualServer::get_singleton()->shader_create(VS::ShaderMode(p_mode));
+ mode = MODE_SPATIAL;
+ shader = VisualServer::get_singleton()->shader_create();
params_cache_dirty = true;
}
diff --git a/scene/resources/shader.h b/scene/resources/shader.h
index bc98fbf737..0e8e48d82e 100644
--- a/scene/resources/shader.h
+++ b/scene/resources/shader.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -88,37 +89,10 @@ public:
virtual RID get_rid() const;
- Shader(Mode p_mode);
+ Shader();
~Shader();
};
VARIANT_ENUM_CAST(Shader::Mode);
-class SpatialShader : public Shader {
-
- GDCLASS(SpatialShader, Shader);
-
-public:
- SpatialShader()
- : Shader(MODE_SPATIAL){};
-};
-
-class CanvasItemShader : public Shader {
-
- GDCLASS(CanvasItemShader, Shader);
-
-public:
- CanvasItemShader()
- : Shader(MODE_CANVAS_ITEM){};
-};
-
-class ParticlesShader : public Shader {
-
- GDCLASS(ParticlesShader, Shader);
-
-public:
- ParticlesShader()
- : Shader(MODE_PARTICLES){};
-};
-
#endif // SHADER_H
diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp
index 28b8490cb4..f68aed6af9 100644
--- a/scene/resources/shader_graph.cpp
+++ b/scene/resources/shader_graph.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -237,11 +238,11 @@ void ShaderGraph::_bind_methods() {
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(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(D_METHOD("texture_input_node_set_value","shader_type","id","value"),&ShaderGraph::texture_input_node_set_value);
+ ClassDB::bind_method(D_METHOD("texture_input_node_get_value","shader_type","id"),&ShaderGraph::texture_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(D_METHOD("cubemap_input_node_set_value","shader_type","id","value"),&ShaderGraph::cubemap_input_node_set_value);
+ ClassDB::bind_method(D_METHOD("cubemap_input_node_get_value","shader_type","id"),&ShaderGraph::cubemap_input_node_get_value);
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);
@@ -253,7 +254,7 @@ void ShaderGraph::_bind_methods() {
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(D_METHOD("connect_node:Error","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::connect_node);
+ ClassDB::bind_method(D_METHOD("connect_node","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);
@@ -261,7 +262,7 @@ void ShaderGraph::_bind_methods() {
ClassDB::bind_method(D_METHOD("clear","shader_type"),&ShaderGraph::clear);
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(D_METHOD("node_get_state","shader_type","id"),&ShaderGraph::node_get_state);
ClassDB::bind_method(D_METHOD("_set_data"),&ShaderGraph::_set_data);
ClassDB::bind_method(D_METHOD("_get_data"),&ShaderGraph::_get_data);
diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h
index 190d76fce6..36578ce1f7 100644
--- a/scene/resources/shader_graph.h
+++ b/scene/resources/shader_graph.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,7 +37,7 @@
class ShaderGraph : public Shader {
GDCLASS( ShaderGraph, Shader );
- RES_BASE_EXTENSION("sgp");
+ RES_BASE_EXTENSION("vshader");
public:
diff --git a/scene/resources/shape.cpp b/scene/resources/shape.cpp
index c666ff0cd3..6be88374e5 100644
--- a/scene/resources/shape.cpp
+++ b/scene/resources/shape.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,7 @@
#include "shape.h"
#include "os/os.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
#include "scene/resources/mesh.h"
#include "servers/physics_server.h"
@@ -48,14 +49,14 @@ void Shape::add_vertices_to_array(PoolVector<Vector3> &array, const Transform &p
}
}
-Ref<Mesh> Shape::get_debug_mesh() {
+Ref<ArrayMesh> Shape::get_debug_mesh() {
if (debug_mesh_cache.is_valid())
return debug_mesh_cache;
Vector<Vector3> lines = _gen_debug_mesh_lines();
- debug_mesh_cache = Ref<Mesh>(memnew(Mesh));
+ debug_mesh_cache = Ref<ArrayMesh>(memnew(ArrayMesh));
if (!lines.empty()) {
//make mesh
diff --git a/scene/resources/shape.h b/scene/resources/shape.h
index 8a8ecf1228..c15638aeed 100644
--- a/scene/resources/shape.h
+++ b/scene/resources/shape.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,16 +31,16 @@
#define SHAPE_H
#include "resource.h"
-class Mesh;
+class ArrayMesh;
class Shape : public Resource {
GDCLASS(Shape, Resource);
OBJ_SAVE_TYPE(Shape);
- RES_BASE_EXTENSION("shp");
+ RES_BASE_EXTENSION("shape");
RID shape;
- Ref<Mesh> debug_mesh_cache;
+ Ref<ArrayMesh> debug_mesh_cache;
protected:
_FORCE_INLINE_ RID get_shape() const { return shape; }
@@ -49,7 +50,7 @@ protected:
public:
virtual RID get_rid() const { return shape; }
- Ref<Mesh> get_debug_mesh();
+ Ref<ArrayMesh> get_debug_mesh();
void add_vertices_to_array(PoolVector<Vector3> &array, const Transform &p_xform);
diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp
index 497110c6f9..818c749e8c 100644
--- a/scene/resources/shape_2d.cpp
+++ b/scene/resources/shape_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -98,10 +99,10 @@ void Shape2D::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("collide", "local_xform", "with_shape", "shape_xform"), &Shape2D::collide);
+ ClassDB::bind_method(D_METHOD("collide_with_motion", "local_xform", "local_motion", "with_shape", "shape_xform", "shape_motion"), &Shape2D::collide_with_motion);
+ ClassDB::bind_method(D_METHOD("collide_and_get_contacts", "local_xform", "with_shape", "shape_xform"), &Shape2D::collide_and_get_contacts);
+ ClassDB::bind_method(D_METHOD("collide_with_motion_and_get_contacts", "local_xform", "local_motion", "with_shape", "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_2d.h b/scene/resources/shape_2d.h
index afae74c385..c020fb9141 100644
--- a/scene/resources/shape_2d.h
+++ b/scene/resources/shape_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -46,10 +47,10 @@ public:
void set_custom_solver_bias(real_t p_bias);
real_t get_custom_solver_bias() const;
- bool collide_with_motion(const Transform2D &p_local_xform, const Vector2 &p_local_motion, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform, const Vector2 &p_p_shape_motion);
+ bool collide_with_motion(const Transform2D &p_local_xform, const Vector2 &p_local_motion, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform, const Vector2 &p_shape_motion);
bool collide(const Transform2D &p_local_xform, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform);
- Variant collide_with_motion_and_get_contacts(const Transform2D &p_local_xform, const Vector2 &p_local_motion, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform, const Vector2 &p_p_shape_motion);
+ Variant collide_with_motion_and_get_contacts(const Transform2D &p_local_xform, const Vector2 &p_local_motion, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform, const Vector2 &p_shape_motion);
Variant collide_and_get_contacts(const Transform2D &p_local_xform, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform);
virtual void draw(const RID &p_to_rid, const Color &p_color) {}
diff --git a/scene/resources/shape_line_2d.cpp b/scene/resources/shape_line_2d.cpp
index 777dbead52..c38ae04eff 100644
--- a/scene/resources/shape_line_2d.cpp
+++ b/scene/resources/shape_line_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -75,7 +76,7 @@ Rect2 LineShape2D::get_rect() const {
Vector2 l1[2] = { point - get_normal().tangent() * 100, point + get_normal().tangent() * 100 };
Vector2 l2[2] = { point, point + get_normal() * 30 };
Rect2 rect;
- rect.pos = l1[0];
+ rect.position = l1[0];
rect.expand_to(l1[1]);
rect.expand_to(l2[0]);
rect.expand_to(l2[1]);
diff --git a/scene/resources/shape_line_2d.h b/scene/resources/shape_line_2d.h
index cd62504d81..3e59bbc687 100644
--- a/scene/resources/shape_line_2d.h
+++ b/scene/resources/shape_line_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/sky_box.cpp b/scene/resources/sky_box.cpp
index cb3b1cf60d..5750960845 100644
--- a/scene/resources/sky_box.cpp
+++ b/scene/resources/sky_box.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,25 +30,28 @@
#include "sky_box.h"
#include "io/image_loader.h"
-void SkyBox::set_radiance_size(RadianceSize p_size) {
+void Sky::set_radiance_size(RadianceSize p_size) {
ERR_FAIL_INDEX(p_size, RADIANCE_SIZE_MAX);
radiance_size = p_size;
_radiance_changed();
}
-SkyBox::RadianceSize SkyBox::get_radiance_size() const {
+Sky::RadianceSize Sky::get_radiance_size() const {
return radiance_size;
}
-void SkyBox::_bind_methods() {
+void Sky::_bind_methods() {
- 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);
+ ClassDB::bind_method(D_METHOD("set_radiance_size", "size"), &Sky::set_radiance_size);
+ ClassDB::bind_method(D_METHOD("get_radiance_size"), &Sky::get_radiance_size);
- ADD_PROPERTY(PropertyInfo(Variant::INT, "radiance_size", PROPERTY_HINT_ENUM, "256,512,1024,2048"), "set_radiance_size", "get_radiance_size");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "radiance_size", PROPERTY_HINT_ENUM, "32,64,128,256,512,1024,2048"), "set_radiance_size", "get_radiance_size");
+ BIND_CONSTANT(RADIANCE_SIZE_32);
+ BIND_CONSTANT(RADIANCE_SIZE_64);
+ BIND_CONSTANT(RADIANCE_SIZE_128);
BIND_CONSTANT(RADIANCE_SIZE_256);
BIND_CONSTANT(RADIANCE_SIZE_512);
BIND_CONSTANT(RADIANCE_SIZE_1024);
@@ -55,123 +59,456 @@ void SkyBox::_bind_methods() {
BIND_CONSTANT(RADIANCE_SIZE_MAX);
}
-SkyBox::SkyBox() {
+Sky::Sky() {
radiance_size = RADIANCE_SIZE_512;
}
/////////////////////////////////////////
-void ImageSkyBox::_radiance_changed() {
+void PanoramaSky::_radiance_changed() {
- if (cube_map_valid) {
+ if (panorama.is_valid()) {
static const int size[RADIANCE_SIZE_MAX] = {
- 256, 512, 1024, 2048
+ 32, 64, 128, 256, 512, 1024, 2048
};
- VS::get_singleton()->skybox_set_texture(sky_box, cube_map, size[get_radiance_size()]);
+ VS::get_singleton()->sky_set_texture(sky, panorama->get_rid(), size[get_radiance_size()]);
}
}
-void ImageSkyBox::set_image_path(ImagePath p_image, const String &p_path) {
+void PanoramaSky::set_panorama(const Ref<Texture> &p_panorama) {
- ERR_FAIL_INDEX(p_image, IMAGE_PATH_MAX);
- image_path[p_image] = p_path;
+ panorama = p_panorama;
- bool all_ok = true;
- for (int i = 0; i < IMAGE_PATH_MAX; i++) {
- if (image_path[i] == String()) {
- all_ok = false;
- }
+ if (panorama.is_valid()) {
+
+ _radiance_changed();
+
+ } else {
+ VS::get_singleton()->sky_set_texture(sky, RID(), 0);
}
+}
- cube_map_valid = false;
+Ref<Texture> PanoramaSky::get_panorama() const {
- if (all_ok) {
+ return panorama;
+}
- Image images[IMAGE_PATH_MAX];
- int w = 0, h = 0;
- Image::Format format;
+RID PanoramaSky::get_rid() const {
- for (int i = 0; i < IMAGE_PATH_MAX; i++) {
- Error err = ImageLoader::load_image(image_path[i], &images[i]);
- if (err) {
- ERR_PRINTS("Error loading image for skybox: " + image_path[i]);
- return;
- }
+ return sky;
+}
+
+void PanoramaSky::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_panorama", "texture"), &PanoramaSky::set_panorama);
+ ClassDB::bind_method(D_METHOD("get_panorama"), &PanoramaSky::get_panorama);
+
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "panorama", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_panorama", "get_panorama");
+}
+
+PanoramaSky::PanoramaSky() {
+
+ sky = VS::get_singleton()->sky_create();
+}
+
+PanoramaSky::~PanoramaSky() {
+
+ VS::get_singleton()->free(sky);
+}
+//////////////////////////////////
+
+void ProceduralSky::_radiance_changed() {
+
+ if (update_queued)
+ return; //do nothing yet
+
+ static const int size[RADIANCE_SIZE_MAX] = {
+ 32, 64, 128, 256, 512, 1024, 2048
+ };
+ VS::get_singleton()->sky_set_texture(sky, texture, size[get_radiance_size()]);
+}
+
+void ProceduralSky::_update_sky() {
+
+ update_queued = false;
+
+ PoolVector<uint8_t> imgdata;
+
+ static const int size[TEXTURE_SIZE_MAX] = {
+ 256, 512, 1024, 2048, 4096
+ };
+
+ int w = size[texture_size];
+ int h = w / 2;
+
+ imgdata.resize(w * h * 4); //RGBE
+
+ {
+ PoolVector<uint8_t>::Write dataw = imgdata.write();
+
+ uint32_t *ptr = (uint32_t *)dataw.ptr();
+
+ Color sky_top_linear = sky_top_color.to_linear();
+ Color sky_horizon_linear = sky_horizon_color.to_linear();
+
+ Color ground_bottom_linear = ground_bottom_color.to_linear();
+ Color ground_horizon_linear = ground_horizon_color.to_linear();
+
+ //Color sun_linear = sun_color.to_linear();
+
+ Vector3 sun(0, 0, -1);
+
+ sun = Basis(Vector3(1, 0, 0), Math::deg2rad(sun_latitude)).xform(sun);
+ sun = Basis(Vector3(0, 1, 0), Math::deg2rad(sun_longitude)).xform(sun);
+
+ sun.normalize();
+
+ for (int i = 0; i < w; i++) {
+
+ float u = float(i) / (w - 1);
+ float phi = u * 2.0 * Math_PI;
+
+ for (int j = 0; j < h; j++) {
+
+ float v = float(j) / (h - 1);
+ float theta = v * Math_PI;
- if (i == 0) {
- w = images[0].get_width();
- h = images[0].get_height();
- format = images[0].get_format();
- } else {
- if (images[i].get_width() != w || images[i].get_height() != h || images[i].get_format() != format) {
- ERR_PRINTS("Image size mismatch (" + itos(images[i].get_width()) + "," + itos(images[i].get_height()) + ":" + Image::get_format_name(images[i].get_format()) + " when it should be " + itos(w) + "," + itos(h) + ":" + Image::get_format_name(format) + "): " + image_path[i]);
- return;
+ Vector3 normal(
+ Math::sin(phi) * Math::sin(theta) * -1.0,
+ Math::cos(theta),
+ Math::cos(phi) * Math::sin(theta) * -1.0);
+
+ normal.normalize();
+
+ float v_angle = Math::acos(normal.y);
+
+ Color color;
+
+ if (normal.y < 0) {
+ //ground
+
+ float c = (v_angle - (Math_PI * 0.5)) / (Math_PI * 0.5);
+ color = ground_horizon_linear.linear_interpolate(ground_bottom_linear, Math::ease(c, ground_curve));
+ } else {
+ float c = v_angle / (Math_PI * 0.5);
+ color = sky_horizon_linear.linear_interpolate(sky_top_linear, Math::ease(1.0 - c, sky_curve));
+
+ float sun_angle = Math::rad2deg(Math::acos(sun.dot(normal)));
+
+ if (sun_angle < sun_angle_min) {
+ color = color.blend(sun_color);
+ } else if (sun_angle < sun_angle_max) {
+
+ float c2 = (sun_angle - sun_angle_min) / (sun_angle_max - sun_angle_min);
+ c2 = Math::ease(c2, sun_curve);
+
+ color = color.blend(sun_color).linear_interpolate(color, c2);
+ }
}
+
+ ptr[j * w + i] = color.to_rgbe9995();
}
}
+ }
- VS::get_singleton()->texture_allocate(cube_map, w, h, format, VS::TEXTURE_FLAG_FILTER | VS::TEXTURE_FLAG_CUBEMAP | VS::TEXTURE_FLAG_MIPMAPS);
- for (int i = 0; i < IMAGE_PATH_MAX; i++) {
- VS::get_singleton()->texture_set_data(cube_map, images[i], VS::CubeMapSide(i));
- }
+ Ref<Image> image;
+ image.instance();
+ image->create(w, h, false, Image::FORMAT_RGBE9995, imgdata);
- cube_map_valid = true;
- _radiance_changed();
- }
+ VS::get_singleton()->texture_allocate(texture, w, h, Image::FORMAT_RGBE9995, VS::TEXTURE_FLAG_FILTER | VS::TEXTURE_FLAG_REPEAT);
+ VS::get_singleton()->texture_set_data(texture, image);
+ _radiance_changed();
}
-String ImageSkyBox::get_image_path(ImagePath p_image) const {
+void ProceduralSky::set_sky_top_color(const Color &p_sky_top) {
- ERR_FAIL_INDEX_V(p_image, IMAGE_PATH_MAX, String());
- return image_path[p_image];
+ sky_top_color = p_sky_top;
+ _queue_update();
}
-RID ImageSkyBox::get_rid() const {
+Color ProceduralSky::get_sky_top_color() const {
- return sky_box;
+ return sky_top_color;
}
-void ImageSkyBox::_bind_methods() {
+void ProceduralSky::set_sky_horizon_color(const Color &p_sky_horizon) {
- 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);
+ sky_horizon_color = p_sky_horizon;
+ _queue_update();
+}
+Color ProceduralSky::get_sky_horizon_color() const {
- List<String> extensions;
- ImageLoader::get_recognized_extensions(&extensions);
- String hints;
- for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
- if (hints != String()) {
- hints += ",";
- }
- hints += "*." + E->get();
- }
+ return sky_horizon_color;
+}
+
+void ProceduralSky::set_sky_curve(float p_curve) {
+
+ sky_curve = p_curve;
+ _queue_update();
+}
+float ProceduralSky::get_sky_curve() const {
+
+ return sky_curve;
+}
+
+void ProceduralSky::set_sky_energy(float p_energy) {
+
+ sky_energy = p_energy;
+ _queue_update();
+}
+float ProceduralSky::get_sky_energy() const {
+
+ return sky_energy;
+}
+
+void ProceduralSky::set_ground_bottom_color(const Color &p_ground_bottom) {
+
+ ground_bottom_color = p_ground_bottom;
+ _queue_update();
+}
+Color ProceduralSky::get_ground_bottom_color() const {
+
+ return ground_bottom_color;
+}
+
+void ProceduralSky::set_ground_horizon_color(const Color &p_ground_horizon) {
+
+ ground_horizon_color = p_ground_horizon;
+ _queue_update();
+}
+Color ProceduralSky::get_ground_horizon_color() const {
+
+ return ground_horizon_color;
+}
+
+void ProceduralSky::set_ground_curve(float p_curve) {
- ADD_GROUP("Image Path", "image_path_");
- 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);
+ ground_curve = p_curve;
+ _queue_update();
+}
+float ProceduralSky::get_ground_curve() const {
+
+ return ground_curve;
+}
+
+void ProceduralSky::set_ground_energy(float p_energy) {
+
+ ground_energy = p_energy;
+ _queue_update();
+}
+float ProceduralSky::get_ground_energy() const {
+
+ return ground_energy;
+}
+
+void ProceduralSky::set_sun_color(const Color &p_sun) {
+
+ sun_color = p_sun;
+ _queue_update();
+}
+Color ProceduralSky::get_sun_color() const {
+
+ return sun_color;
+}
+
+void ProceduralSky::set_sun_latitude(float p_angle) {
+
+ sun_latitude = p_angle;
+ _queue_update();
+}
+float ProceduralSky::get_sun_latitude() const {
+
+ return sun_latitude;
+}
+
+void ProceduralSky::set_sun_longitude(float p_angle) {
+
+ sun_longitude = p_angle;
+ _queue_update();
+}
+float ProceduralSky::get_sun_longitude() const {
+
+ return sun_longitude;
+}
+
+void ProceduralSky::set_sun_angle_min(float p_angle) {
+
+ sun_angle_min = p_angle;
+ _queue_update();
+}
+float ProceduralSky::get_sun_angle_min() const {
+
+ return sun_angle_min;
+}
+
+void ProceduralSky::set_sun_angle_max(float p_angle) {
+
+ sun_angle_max = p_angle;
+ _queue_update();
+}
+float ProceduralSky::get_sun_angle_max() const {
+
+ return sun_angle_max;
+}
+
+void ProceduralSky::set_sun_curve(float p_curve) {
+
+ sun_curve = p_curve;
+ _queue_update();
+}
+float ProceduralSky::get_sun_curve() const {
+
+ return sun_curve;
+}
+
+void ProceduralSky::set_sun_energy(float p_energy) {
+
+ sun_energy = p_energy;
+ _queue_update();
+}
+float ProceduralSky::get_sun_energy() const {
+
+ return sun_energy;
+}
+
+void ProceduralSky::set_texture_size(TextureSize p_size) {
+ ERR_FAIL_INDEX(p_size, TEXTURE_SIZE_MAX);
+
+ texture_size = p_size;
+ _queue_update();
+}
+ProceduralSky::TextureSize ProceduralSky::get_texture_size() const {
+ return texture_size;
+}
+
+RID ProceduralSky::get_rid() const {
+ return sky;
+}
+
+void ProceduralSky::_queue_update() {
+
+ if (update_queued)
+ return;
+
+ update_queued = true;
+ call_deferred("_update_sky");
+}
+
+void ProceduralSky::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("_update_sky"), &ProceduralSky::_update_sky);
+
+ ClassDB::bind_method(D_METHOD("set_sky_top_color", "color"), &ProceduralSky::set_sky_top_color);
+ ClassDB::bind_method(D_METHOD("get_sky_top_color"), &ProceduralSky::get_sky_top_color);
+
+ ClassDB::bind_method(D_METHOD("set_sky_horizon_color", "color"), &ProceduralSky::set_sky_horizon_color);
+ ClassDB::bind_method(D_METHOD("get_sky_horizon_color"), &ProceduralSky::get_sky_horizon_color);
+
+ ClassDB::bind_method(D_METHOD("set_sky_curve", "curve"), &ProceduralSky::set_sky_curve);
+ ClassDB::bind_method(D_METHOD("get_sky_curve"), &ProceduralSky::get_sky_curve);
+
+ ClassDB::bind_method(D_METHOD("set_sky_energy", "energy"), &ProceduralSky::set_sky_energy);
+ ClassDB::bind_method(D_METHOD("get_sky_energy"), &ProceduralSky::get_sky_energy);
+
+ ClassDB::bind_method(D_METHOD("set_ground_bottom_color", "color"), &ProceduralSky::set_ground_bottom_color);
+ ClassDB::bind_method(D_METHOD("get_ground_bottom_color"), &ProceduralSky::get_ground_bottom_color);
- BIND_CONSTANT(IMAGE_PATH_NEGATIVE_X);
- BIND_CONSTANT(IMAGE_PATH_POSITIVE_X);
- BIND_CONSTANT(IMAGE_PATH_NEGATIVE_Y);
- BIND_CONSTANT(IMAGE_PATH_POSITIVE_Y);
- BIND_CONSTANT(IMAGE_PATH_NEGATIVE_Z);
- BIND_CONSTANT(IMAGE_PATH_POSITIVE_Z);
- BIND_CONSTANT(IMAGE_PATH_MAX);
+ ClassDB::bind_method(D_METHOD("set_ground_horizon_color", "color"), &ProceduralSky::set_ground_horizon_color);
+ ClassDB::bind_method(D_METHOD("get_ground_horizon_color"), &ProceduralSky::get_ground_horizon_color);
+
+ ClassDB::bind_method(D_METHOD("set_ground_curve", "curve"), &ProceduralSky::set_ground_curve);
+ ClassDB::bind_method(D_METHOD("get_ground_curve"), &ProceduralSky::get_ground_curve);
+
+ ClassDB::bind_method(D_METHOD("set_ground_energy", "energy"), &ProceduralSky::set_ground_energy);
+ ClassDB::bind_method(D_METHOD("get_ground_energy"), &ProceduralSky::get_ground_energy);
+
+ ClassDB::bind_method(D_METHOD("set_sun_color", "color"), &ProceduralSky::set_sun_color);
+ ClassDB::bind_method(D_METHOD("get_sun_color"), &ProceduralSky::get_sun_color);
+
+ ClassDB::bind_method(D_METHOD("set_sun_latitude", "degrees"), &ProceduralSky::set_sun_latitude);
+ ClassDB::bind_method(D_METHOD("get_sun_latitude"), &ProceduralSky::get_sun_latitude);
+
+ ClassDB::bind_method(D_METHOD("set_sun_longitude", "degrees"), &ProceduralSky::set_sun_longitude);
+ ClassDB::bind_method(D_METHOD("get_sun_longitude"), &ProceduralSky::get_sun_longitude);
+
+ ClassDB::bind_method(D_METHOD("set_sun_angle_min", "degrees"), &ProceduralSky::set_sun_angle_min);
+ ClassDB::bind_method(D_METHOD("get_sun_angle_min"), &ProceduralSky::get_sun_angle_min);
+
+ ClassDB::bind_method(D_METHOD("set_sun_angle_max", "degrees"), &ProceduralSky::set_sun_angle_max);
+ ClassDB::bind_method(D_METHOD("get_sun_angle_max"), &ProceduralSky::get_sun_angle_max);
+
+ ClassDB::bind_method(D_METHOD("set_sun_curve", "curve"), &ProceduralSky::set_sun_curve);
+ ClassDB::bind_method(D_METHOD("get_sun_curve"), &ProceduralSky::get_sun_curve);
+
+ ClassDB::bind_method(D_METHOD("set_sun_energy", "energy"), &ProceduralSky::set_sun_energy);
+ ClassDB::bind_method(D_METHOD("get_sun_energy"), &ProceduralSky::get_sun_energy);
+
+ ClassDB::bind_method(D_METHOD("set_texture_size", "size"), &ProceduralSky::set_texture_size);
+ ClassDB::bind_method(D_METHOD("get_texture_size"), &ProceduralSky::get_texture_size);
+
+ ADD_GROUP("Sky", "sky_");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sky_top_color"), "set_sky_top_color", "get_sky_top_color");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sky_horizon_color"), "set_sky_horizon_color", "get_sky_horizon_color");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "sky_curve", PROPERTY_HINT_EXP_EASING), "set_sky_curve", "get_sky_curve");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "sky_energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_sky_energy", "get_sky_energy");
+
+ ADD_GROUP("Ground", "ground_");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ground_bottom_color"), "set_ground_bottom_color", "get_ground_bottom_color");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ground_horizon_color"), "set_ground_horizon_color", "get_ground_horizon_color");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "ground_curve", PROPERTY_HINT_EXP_EASING), "set_ground_curve", "get_ground_curve");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "ground_energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_ground_energy", "get_ground_energy");
+
+ ADD_GROUP("Sun", "sun_");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sun_color"), "set_sun_color", "get_sun_color");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_latitude", PROPERTY_HINT_RANGE, "-180,180,0.01"), "set_sun_latitude", "get_sun_latitude");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_longitude", PROPERTY_HINT_RANGE, "-180,180,0.01"), "set_sun_longitude", "get_sun_longitude");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_angle_min", PROPERTY_HINT_RANGE, "0,360,0.01"), "set_sun_angle_min", "get_sun_angle_min");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_angle_max", PROPERTY_HINT_RANGE, "0,360,0.01"), "set_sun_angle_max", "get_sun_angle_max");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_curve", PROPERTY_HINT_EXP_EASING), "set_sun_curve", "get_sun_curve");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_sun_energy", "get_sun_energy");
+
+ ADD_GROUP("Texture", "texture_");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "texture_size", PROPERTY_HINT_ENUM, "256,512,1024,2048,4096"), "set_texture_size", "get_texture_size");
+
+ BIND_CONSTANT(TEXTURE_SIZE_256);
+ BIND_CONSTANT(TEXTURE_SIZE_512);
+ BIND_CONSTANT(TEXTURE_SIZE_1024);
+ BIND_CONSTANT(TEXTURE_SIZE_2048);
+ BIND_CONSTANT(TEXTURE_SIZE_4096);
+ BIND_CONSTANT(TEXTURE_SIZE_MAX);
}
-ImageSkyBox::ImageSkyBox() {
+ProceduralSky::ProceduralSky() {
+
+ sky = VS::get_singleton()->sky_create();
+ texture = VS::get_singleton()->texture_create();
+
+ update_queued = false;
+ sky_top_color = Color::hex(0x0c74f9ff);
+ sky_horizon_color = Color::hex(0x8ed2e8ff);
+ sky_curve = 0.25;
+ sky_energy = 1;
+
+ ground_bottom_color = Color::hex(0x1a2530ff);
+ ground_horizon_color = Color::hex(0x7bc9f3ff);
+ ground_curve = 0.01;
+ ground_energy = 1;
+
+ sun_color = Color(1, 1, 1);
+ sun_latitude = 35;
+ sun_longitude = 0;
+ sun_angle_min = 1;
+ sun_angle_max = 100;
+ sun_curve = 0.05;
+ sun_energy = 16;
+
+ texture_size = TEXTURE_SIZE_1024;
- cube_map = VS::get_singleton()->texture_create();
- sky_box = VS::get_singleton()->skybox_create();
- cube_map_valid = false;
+ _queue_update();
}
-ImageSkyBox::~ImageSkyBox() {
+ProceduralSky::~ProceduralSky() {
- VS::get_singleton()->free(cube_map);
- VS::get_singleton()->free(sky_box);
+ VS::get_singleton()->free(sky);
+ VS::get_singleton()->free(texture);
}
diff --git a/scene/resources/sky_box.h b/scene/resources/sky_box.h
index 23ba077df3..8298d1b3c0 100644
--- a/scene/resources/sky_box.h
+++ b/scene/resources/sky_box.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,16 +27,19 @@
/* 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
+#ifndef Sky_H
+#define Sky_H
#include "scene/resources/texture.h"
-class SkyBox : public Resource {
- GDCLASS(SkyBox, Resource);
+class Sky : public Resource {
+ GDCLASS(Sky, Resource);
public:
enum RadianceSize {
+ RADIANCE_SIZE_32,
+ RADIANCE_SIZE_64,
+ RADIANCE_SIZE_128,
RADIANCE_SIZE_256,
RADIANCE_SIZE_512,
RADIANCE_SIZE_1024,
@@ -53,46 +57,133 @@ protected:
public:
void set_radiance_size(RadianceSize p_size);
RadianceSize get_radiance_size() const;
- SkyBox();
+ Sky();
};
-VARIANT_ENUM_CAST(SkyBox::RadianceSize)
+VARIANT_ENUM_CAST(Sky::RadianceSize)
-class ImageSkyBox : public SkyBox {
- GDCLASS(ImageSkyBox, SkyBox);
+class PanoramaSky : public Sky {
+ GDCLASS(PanoramaSky, Sky);
+
+private:
+ RID sky;
+ Ref<Texture> panorama;
+
+protected:
+ static void _bind_methods();
+ virtual void _radiance_changed();
public:
- enum ImagePath {
- IMAGE_PATH_NEGATIVE_X,
- IMAGE_PATH_POSITIVE_X,
- IMAGE_PATH_NEGATIVE_Y,
- IMAGE_PATH_POSITIVE_Y,
- IMAGE_PATH_NEGATIVE_Z,
- IMAGE_PATH_POSITIVE_Z,
- IMAGE_PATH_MAX
+ void set_panorama(const Ref<Texture> &p_panorama);
+ Ref<Texture> get_panorama() const;
+
+ virtual RID get_rid() const;
+
+ PanoramaSky();
+ ~PanoramaSky();
+};
+
+class ProceduralSky : public Sky {
+ GDCLASS(ProceduralSky, Sky);
+
+public:
+ enum TextureSize {
+ TEXTURE_SIZE_256,
+ TEXTURE_SIZE_512,
+ TEXTURE_SIZE_1024,
+ TEXTURE_SIZE_2048,
+ TEXTURE_SIZE_4096,
+ TEXTURE_SIZE_MAX
};
private:
- RID cube_map;
- RID sky_box;
- bool cube_map_valid;
+ Color sky_top_color;
+ Color sky_horizon_color;
+ float sky_curve;
+ float sky_energy;
+
+ Color ground_bottom_color;
+ Color ground_horizon_color;
+ float ground_curve;
+ float ground_energy;
+
+ Color sun_color;
+ float sun_latitude;
+ float sun_longitude;
+ float sun_angle_min;
+ float sun_angle_max;
+ float sun_curve;
+ float sun_energy;
+
+ TextureSize texture_size;
+
+ RID sky;
+ RID texture;
- String image_path[IMAGE_PATH_MAX];
+ bool update_queued;
protected:
static void _bind_methods();
virtual void _radiance_changed();
+ void _update_sky();
+ void _queue_update();
+
public:
- void set_image_path(ImagePath p_image, const String &p_path);
- String get_image_path(ImagePath p_image) const;
+ void set_sky_top_color(const Color &p_sky_top);
+ Color get_sky_top_color() const;
+
+ void set_sky_horizon_color(const Color &p_sky_horizon);
+ Color get_sky_horizon_color() const;
+
+ void set_sky_curve(float p_curve);
+ float get_sky_curve() const;
+
+ void set_sky_energy(float p_energy);
+ float get_sky_energy() const;
+
+ void set_ground_bottom_color(const Color &p_ground_bottom);
+ Color get_ground_bottom_color() const;
+
+ void set_ground_horizon_color(const Color &p_ground_horizon);
+ Color get_ground_horizon_color() const;
+
+ void set_ground_curve(float p_curve);
+ float get_ground_curve() const;
+
+ void set_ground_energy(float p_energy);
+ float get_ground_energy() const;
+
+ void set_sun_color(const Color &p_sun);
+ Color get_sun_color() const;
+
+ void set_sun_latitude(float p_angle);
+ float get_sun_latitude() const;
+
+ void set_sun_longitude(float p_angle);
+ float get_sun_longitude() const;
+
+ void set_sun_angle_min(float p_angle);
+ float get_sun_angle_min() const;
+
+ void set_sun_angle_max(float p_angle);
+ float get_sun_angle_max() const;
+
+ void set_sun_curve(float p_curve);
+ float get_sun_curve() const;
+
+ void set_sun_energy(float p_energy);
+ float get_sun_energy() const;
+
+ void set_texture_size(TextureSize p_size);
+ TextureSize get_texture_size() const;
virtual RID get_rid() const;
- ImageSkyBox();
- ~ImageSkyBox();
+ ProceduralSky();
+ ~ProceduralSky();
};
-VARIANT_ENUM_CAST(ImageSkyBox::ImagePath)
+VARIANT_ENUM_CAST(ProceduralSky::TextureSize)
-#endif // SKYBOX_H
+#endif // Sky_H
diff --git a/scene/resources/space_2d.cpp b/scene/resources/space_2d.cpp
index d0a18b98bd..2a618bb868 100644
--- a/scene/resources/space_2d.cpp
+++ b/scene/resources/space_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/space_2d.h b/scene/resources/space_2d.h
index b6c2607b13..3e08612d99 100644
--- a/scene/resources/space_2d.h
+++ b/scene/resources/space_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/sphere_shape.cpp b/scene/resources/sphere_shape.cpp
index c242e748a4..960554562f 100644
--- a/scene/resources/sphere_shape.cpp
+++ b/scene/resources/sphere_shape.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/sphere_shape.h b/scene/resources/sphere_shape.h
index 576c59ee7d..a3b5d2424b 100644
--- a/scene/resources/sphere_shape.h
+++ b/scene/resources/sphere_shape.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp
index 7a503207bc..48efa242e9 100644
--- a/scene/resources/style_box.cpp
+++ b/scene/resources/style_box.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,6 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "style_box.h"
+#include <limits.h>
bool StyleBox::test_mask(const Point2 &p_point, const Rect2 &p_rect) const {
@@ -103,14 +105,30 @@ void StyleBoxTexture::set_texture(RES p_texture) {
if (texture == p_texture)
return;
texture = p_texture;
+ region_rect = Rect2(Point2(), texture->get_size());
emit_signal("texture_changed");
emit_changed();
+ _change_notify("texture");
}
+
RES StyleBoxTexture::get_texture() const {
return texture;
}
+void StyleBoxTexture::set_normal_map(RES p_normal_map) {
+
+ if (normal_map == p_normal_map)
+ return;
+ normal_map = p_normal_map;
+ emit_changed();
+}
+
+RES StyleBoxTexture::get_normal_map() const {
+
+ return normal_map;
+}
+
void StyleBoxTexture::set_margin_size(Margin p_margin, float p_size) {
margin[p_margin] = p_size;
@@ -130,12 +148,21 @@ void StyleBoxTexture::draw(RID p_canvas_item, const Rect2 &p_rect) const {
if (texture.is_null())
return;
- Rect2 r = p_rect;
- r.pos.x -= expand_margin[MARGIN_LEFT];
- r.pos.y -= expand_margin[MARGIN_TOP];
- r.size.x += expand_margin[MARGIN_LEFT] + expand_margin[MARGIN_RIGHT];
- r.size.y += expand_margin[MARGIN_TOP] + expand_margin[MARGIN_BOTTOM];
- VisualServer::get_singleton()->canvas_item_add_nine_patch(p_canvas_item, r, region_rect, texture->get_rid(), Vector2(margin[MARGIN_LEFT], margin[MARGIN_TOP]), Vector2(margin[MARGIN_RIGHT], margin[MARGIN_BOTTOM]), VS::NINE_PATCH_STRETCH, VS::NINE_PATCH_STRETCH, draw_center, modulate);
+ Rect2 rect = p_rect;
+ Rect2 src_rect = region_rect;
+
+ texture->get_rect_region(rect, src_rect, rect, src_rect);
+
+ rect.position.x -= expand_margin[MARGIN_LEFT];
+ rect.position.y -= expand_margin[MARGIN_TOP];
+ rect.size.x += expand_margin[MARGIN_LEFT] + expand_margin[MARGIN_RIGHT];
+ rect.size.y += expand_margin[MARGIN_TOP] + expand_margin[MARGIN_BOTTOM];
+
+ RID normal_rid;
+ if (normal_map.is_valid())
+ normal_rid = normal_map->get_rid();
+
+ VisualServer::get_singleton()->canvas_item_add_nine_patch(p_canvas_item, rect, src_rect, texture->get_rid(), Vector2(margin[MARGIN_LEFT], margin[MARGIN_TOP]), Vector2(margin[MARGIN_RIGHT], margin[MARGIN_BOTTOM]), VS::NinePatchAxisMode(axis_h), VS::NinePatchAxisMode(axis_v), draw_center, modulate, normal_rid);
}
void StyleBoxTexture::set_draw_center(bool p_draw) {
@@ -184,6 +211,28 @@ Rect2 StyleBoxTexture::get_region_rect() const {
return region_rect;
}
+void StyleBoxTexture::set_h_axis_stretch_mode(AxisStretchMode p_mode) {
+
+ axis_h = p_mode;
+ emit_changed();
+}
+
+StyleBoxTexture::AxisStretchMode StyleBoxTexture::get_h_axis_stretch_mode() const {
+
+ return axis_h;
+}
+
+void StyleBoxTexture::set_v_axis_stretch_mode(AxisStretchMode p_mode) {
+
+ axis_v = p_mode;
+ emit_changed();
+}
+
+StyleBoxTexture::AxisStretchMode StyleBoxTexture::get_v_axis_stretch_mode() const {
+
+ return axis_v;
+}
+
void StyleBoxTexture::set_modulate(const Color &p_modulate) {
if (modulate == p_modulate)
return;
@@ -198,8 +247,11 @@ Color StyleBoxTexture::get_modulate() const {
void StyleBoxTexture::_bind_methods() {
- 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(D_METHOD("set_texture", "texture"), &StyleBoxTexture::set_texture);
+ ClassDB::bind_method(D_METHOD("get_texture"), &StyleBoxTexture::get_texture);
+
+ ClassDB::bind_method(D_METHOD("set_normal_map", "normal_map"), &StyleBoxTexture::set_normal_map);
+ ClassDB::bind_method(D_METHOD("get_normal_map"), &StyleBoxTexture::get_normal_map);
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);
@@ -216,9 +268,16 @@ void StyleBoxTexture::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_modulate", "color"), &StyleBoxTexture::set_modulate);
ClassDB::bind_method(D_METHOD("get_modulate"), &StyleBoxTexture::get_modulate);
+ ClassDB::bind_method(D_METHOD("set_h_axis_stretch_mode", "mode"), &StyleBoxTexture::set_h_axis_stretch_mode);
+ ClassDB::bind_method(D_METHOD("get_h_axis_stretch_mode"), &StyleBoxTexture::get_h_axis_stretch_mode);
+
+ ClassDB::bind_method(D_METHOD("set_v_axis_stretch_mode", "mode"), &StyleBoxTexture::set_v_axis_stretch_mode);
+ ClassDB::bind_method(D_METHOD("get_v_axis_stretch_mode"), &StyleBoxTexture::get_v_axis_stretch_mode);
+
ADD_SIGNAL(MethodInfo("texture_changed"));
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_normal_map", "get_normal_map");
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"), "set_margin_size", "get_margin_size", MARGIN_LEFT);
@@ -230,9 +289,16 @@ void StyleBoxTexture::_bind_methods() {
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("Axis Stretch", "axis_stretch_");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "axis_stretch_horizontal", PROPERTY_HINT_ENUM, "Stretch,Tile,Tile Fit"), "set_h_axis_stretch_mode", "get_h_axis_stretch_mode");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "axis_stretch_vertical", PROPERTY_HINT_ENUM, "Stretch,Tile,Tile Fit"), "set_v_axis_stretch_mode", "get_v_axis_stretch_mode");
ADD_GROUP("Modulate", "modulate_");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "modulate_color"), "set_modulate", "get_modulate");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draw_center"), "set_draw_center", "get_draw_center");
+
+ BIND_CONSTANT(AXIS_STRETCH_MODE_STRETCH);
+ BIND_CONSTANT(AXIS_STRETCH_MODE_TILE);
+ BIND_CONSTANT(AXIS_STRETCH_MODE_TILE_FIT);
}
StyleBoxTexture::StyleBoxTexture() {
@@ -243,6 +309,9 @@ StyleBoxTexture::StyleBoxTexture() {
}
draw_center = true;
modulate = Color(1, 1, 1, 1);
+
+ axis_h = AXIS_STRETCH_MODE_STRETCH;
+ axis_v = AXIS_STRETCH_MODE_STRETCH;
}
StyleBoxTexture::~StyleBoxTexture() {
}
@@ -255,137 +324,585 @@ void StyleBoxFlat::set_bg_color(const Color &p_color) {
emit_changed();
}
-void StyleBoxFlat::set_light_color(const Color &p_color) {
+Color StyleBoxFlat::get_bg_color() const {
- light_color = p_color;
- emit_changed();
+ return bg_color;
}
-void StyleBoxFlat::set_dark_color(const Color &p_color) {
- dark_color = p_color;
+void StyleBoxFlat::set_border_color_all(const Color &p_color) {
+ for (int i = 0; i < 4; i++) {
+
+ border_color.write()[i] = p_color;
+ }
emit_changed();
}
+Color StyleBoxFlat::get_border_color_all() const {
-Color StyleBoxFlat::get_bg_color() const {
+ return border_color[MARGIN_TOP];
+}
+void StyleBoxFlat::set_border_color(Margin p_border, const Color &p_color) {
- return bg_color;
+ border_color.write()[p_border] = p_color;
+ emit_changed();
}
-Color StyleBoxFlat::get_light_color() const {
+Color StyleBoxFlat::get_border_color(Margin p_border) const {
- return light_color;
+ return border_color[p_border];
}
-Color StyleBoxFlat::get_dark_color() const {
- return dark_color;
+void StyleBoxFlat::set_border_width_all(int p_size) {
+ border_width[0] = p_size;
+ border_width[1] = p_size;
+ border_width[2] = p_size;
+ border_width[3] = p_size;
+ emit_changed();
}
+int StyleBoxFlat::get_border_width_min() const {
-void StyleBoxFlat::set_border_size(int p_size) {
+ return MIN(MIN(border_width[0], border_width[1]), MIN(border_width[2], border_width[3]));
+}
- border_size = p_size;
+void StyleBoxFlat::set_border_width(Margin p_margin, int p_width) {
+ border_width[p_margin] = p_width;
emit_changed();
}
-int StyleBoxFlat::get_border_size() const {
- return border_size;
+int StyleBoxFlat::get_border_width(Margin p_margin) const {
+ return border_width[p_margin];
}
void StyleBoxFlat::set_border_blend(bool p_blend) {
- blend = p_blend;
+ blend_border = p_blend;
emit_changed();
}
-
bool StyleBoxFlat::get_border_blend() const {
- return blend;
+ return blend_border;
}
-void StyleBoxFlat::set_draw_center(bool p_draw) {
+void StyleBoxFlat::set_corner_radius_all(int radius) {
+
+ for (int i = 0; i < 4; i++) {
+ corner_radius[i] = radius;
+ }
- draw_center = p_draw;
emit_changed();
}
-bool StyleBoxFlat::get_draw_center() const {
+void StyleBoxFlat::set_corner_radius_individual(const int radius_top_left, const int radius_top_right, const int radius_botton_right, const int radius_bottom_left) {
+ corner_radius[0] = radius_top_left;
+ corner_radius[1] = radius_top_right;
+ corner_radius[2] = radius_botton_right;
+ corner_radius[3] = radius_bottom_left;
- return draw_center;
+ emit_changed();
+}
+int StyleBoxFlat::get_corner_radius_min() const {
+ int smallest = corner_radius[0];
+ for (int i = 1; i < 4; i++) {
+ if (smallest > corner_radius[i]) {
+ smallest = corner_radius[i];
+ }
+ }
+ return smallest;
+}
+
+void StyleBoxFlat::set_corner_radius(const Corner p_corner, const int radius) {
+
+ corner_radius[p_corner] = radius;
+ emit_changed();
+}
+int StyleBoxFlat::get_corner_radius(const Corner p_corner) const {
+ return corner_radius[p_corner];
+}
+
+void StyleBoxFlat::set_expand_margin_size(Margin p_expand_margin, float p_size) {
+
+ expand_margin[p_expand_margin] = p_size;
+ emit_changed();
+}
+float StyleBoxFlat::get_expand_margin_size(Margin p_expand_margin) const {
+ return expand_margin[p_expand_margin];
+}
+void StyleBoxFlat::set_filled(bool p_filled) {
+
+ filled = p_filled;
+ emit_changed();
+}
+bool StyleBoxFlat::is_filled() const {
+
+ return filled;
+}
+
+void StyleBoxFlat::set_shadow_color(const Color &p_color) {
+
+ shadow_color = p_color;
+ emit_changed();
+}
+Color StyleBoxFlat::get_shadow_color() const {
+
+ return shadow_color;
+}
+
+void StyleBoxFlat::set_shadow_size(const int &p_size) {
+
+ shadow_size = p_size;
+ emit_changed();
+}
+int StyleBoxFlat::get_shadow_size() const {
+
+ return shadow_size;
+}
+
+void StyleBoxFlat::set_anti_aliased(const bool &p_anti_aliased) {
+ anti_aliased = p_anti_aliased;
+ emit_changed();
+}
+bool StyleBoxFlat::is_anti_aliased() const {
+ return anti_aliased;
+}
+
+void StyleBoxFlat::set_aa_size(const int &p_aa_size) {
+ aa_size = p_aa_size;
+ emit_changed();
}
+int StyleBoxFlat::get_aa_size() const {
+ return aa_size;
+}
+
+void StyleBoxFlat::set_corner_detail(const int &p_corner_detail) {
+ corner_detail = p_corner_detail;
+ emit_changed();
+}
+int StyleBoxFlat::get_corner_detail() const {
+ return corner_detail;
+}
+
Size2 StyleBoxFlat::get_center_size() const {
return Size2();
}
+inline void set_inner_corner_radius(const Rect2 style_rect, const Rect2 inner_rect, const int corner_radius[4], int *inner_corner_radius) {
+ int border_left = inner_rect.position.x - style_rect.position.x;
+ int border_top = inner_rect.position.y - style_rect.position.y;
+ int border_right = style_rect.size.width - inner_rect.size.width - border_left;
+ int border_bottom = style_rect.size.height - inner_rect.size.height - border_top;
+
+ int rad;
+ //tl
+ rad = MIN(border_top, border_left);
+ inner_corner_radius[0] = MAX(corner_radius[0] - rad, 0);
+
+ //tr
+ rad = MIN(border_top, border_bottom);
+ inner_corner_radius[1] = MAX(corner_radius[1] - rad, 0);
+
+ //br
+ rad = MIN(border_bottom, border_right);
+ inner_corner_radius[2] = MAX(corner_radius[2] - rad, 0);
+
+ //bl
+ rad = MIN(border_bottom, border_left);
+ inner_corner_radius[3] = MAX(corner_radius[3] - rad, 0);
+}
+
+inline void draw_ring(Vector<Vector2> &verts, Vector<int> &indices, Vector<Color> &colors, const Rect2 style_rect, const int corner_radius[4],
+ const Rect2 ring_rect, const int border_width[4], const Color inner_color[4], const Color outer_color[4], const int corner_detail) {
+
+ int vert_offset = verts.size();
+ if (!vert_offset) {
+ vert_offset = 0;
+ }
+ int rings = (border_width[0] == 0 && border_width[1] == 0 && border_width[2] == 0 && border_width[3] == 0) ? 1 : 2;
+ rings = 2;
+
+ int ring_corner_radius[4];
+ set_inner_corner_radius(style_rect, ring_rect, corner_radius, ring_corner_radius);
+
+ //corner radius center points
+ Vector<Point2> outer_points;
+ outer_points.push_back(ring_rect.position + Vector2(ring_corner_radius[0], ring_corner_radius[0])); //tl
+ outer_points.push_back(Point2(ring_rect.position.x + ring_rect.size.x - ring_corner_radius[1], ring_rect.position.y + ring_corner_radius[1])); //tr
+ outer_points.push_back(ring_rect.position + ring_rect.size - Vector2(ring_corner_radius[2], ring_corner_radius[2])); //br
+ outer_points.push_back(Point2(ring_rect.position.x + ring_corner_radius[3], ring_rect.position.y + ring_rect.size.y - ring_corner_radius[3])); //bl
+
+ Rect2 inner_rect;
+ inner_rect = ring_rect.grow_individual(-border_width[MARGIN_LEFT], -border_width[MARGIN_TOP], -border_width[MARGIN_RIGHT], -border_width[MARGIN_BOTTOM]);
+ int inner_corner_radius[4];
+
+ Vector<Point2> inner_points;
+ set_inner_corner_radius(style_rect, inner_rect, corner_radius, inner_corner_radius);
+ inner_points.push_back(inner_rect.position + Vector2(inner_corner_radius[0], inner_corner_radius[0])); //tl
+ inner_points.push_back(Point2(inner_rect.position.x + inner_rect.size.x - inner_corner_radius[1], inner_rect.position.y + inner_corner_radius[1])); //tr
+ inner_points.push_back(inner_rect.position + inner_rect.size - Vector2(inner_corner_radius[2], inner_corner_radius[2])); //br
+ inner_points.push_back(Point2(inner_rect.position.x + inner_corner_radius[3], inner_rect.position.y + inner_rect.size.y - inner_corner_radius[3])); //bl
+
+ //calculate the vert array
+ for (int corner_index = 0; corner_index < 4; corner_index++) {
+ for (int detail = 0; detail <= corner_detail; detail++) {
+ for (int inner_outer = (2 - rings); inner_outer < 2; inner_outer++) {
+ float radius;
+ Color color;
+ Point2 corner_point;
+ if (inner_outer == 0) {
+ radius = inner_corner_radius[corner_index];
+ color = *inner_color;
+ corner_point = inner_points[corner_index];
+ } else {
+ radius = ring_corner_radius[corner_index];
+ color = *outer_color;
+ corner_point = outer_points[corner_index];
+ }
+ float x = radius * (float)cos((double)corner_index * Math_PI / 2.0 + (double)detail / (double)corner_detail * Math_PI / 2.0 + Math_PI) + corner_point.x;
+ float y = radius * (float)sin((double)corner_index * Math_PI / 2.0 + (double)detail / (double)corner_detail * Math_PI / 2.0 + Math_PI) + corner_point.y;
+ verts.push_back(Vector2(x, y));
+ colors.push_back(color);
+ }
+ }
+ }
+
+ if (rings == 2) {
+ int vert_count = (corner_detail + 1) * 4 * rings;
+ //fill the indices and the colors for the border
+ for (int i = 0; i < vert_count; i++) {
+ //poly 1
+ indices.push_back(vert_offset + ((i + 0) % vert_count));
+ indices.push_back(vert_offset + ((i + 2) % vert_count));
+ indices.push_back(vert_offset + ((i + 1) % vert_count));
+ //poly 2
+ indices.push_back(vert_offset + ((i + 1) % vert_count));
+ indices.push_back(vert_offset + ((i + 2) % vert_count));
+ indices.push_back(vert_offset + ((i + 3) % vert_count));
+ }
+ }
+}
+
+inline void adapt_values(int p_index_a, int p_index_b, int *adapted_values, const int *p_values, const real_t p_width, const int p_max_a, const int p_max_b) {
+ if (p_values[p_index_a] + p_values[p_index_b] > p_width) {
+ float factor;
+ int newValue;
+
+ factor = (float)p_width / (float)(p_values[p_index_a] + p_values[p_index_b]);
+
+ newValue = (int)(p_values[p_index_a] * factor);
+ if (newValue < adapted_values[p_index_a]) {
+ adapted_values[p_index_a] = newValue;
+ }
+ newValue = (int)(p_values[p_index_b] * factor);
+ if (newValue < adapted_values[p_index_b]) {
+ adapted_values[p_index_b] = newValue;
+ }
+ } else {
+ adapted_values[p_index_a] = MIN(p_values[p_index_a], adapted_values[p_index_a]);
+ adapted_values[p_index_b] = MIN(p_values[p_index_b], adapted_values[p_index_b]);
+ }
+ adapted_values[p_index_a] = MIN(p_max_a, adapted_values[p_index_a]);
+ adapted_values[p_index_b] = MIN(p_max_b, adapted_values[p_index_b]);
+}
void StyleBoxFlat::draw(RID p_canvas_item, const Rect2 &p_rect) const {
- VisualServer *vs = VisualServer::get_singleton();
- Rect2i r = p_rect;
+ //PREPARATIONS
+
+ bool rounded_corners = (corner_radius[0] > 0) || (corner_radius[1] > 0) || (corner_radius[2] > 0) || (corner_radius[3] > 0);
+ bool aa_on = rounded_corners && anti_aliased;
- for (int i = 0; i < border_size; i++) {
+ Rect2 style_rect = p_rect.grow_individual(expand_margin[MARGIN_LEFT], expand_margin[MARGIN_TOP], expand_margin[MARGIN_RIGHT], expand_margin[MARGIN_BOTTOM]);
+ if (aa_on) {
+ style_rect = style_rect.grow(-((aa_size + 1) / 2));
+ }
+
+ //adapt borders (prevent weired overlapping/glitchy drawings)
+ int width = style_rect.size.width;
+ int height = style_rect.size.height;
+ int adapted_border[4] = { INT_MAX, INT_MAX, INT_MAX, INT_MAX };
+ adapt_values(MARGIN_TOP, MARGIN_BOTTOM, adapted_border, border_width, height, height, height);
+ adapt_values(MARGIN_LEFT, MARGIN_RIGHT, adapted_border, border_width, width, width, width);
+
+ //adapt corners (prevent weired overlapping/glitchy drawings)
+ int adapted_corner[4] = { INT_MAX, INT_MAX, INT_MAX, INT_MAX };
+ adapt_values(CORNER_TOP_RIGHT, CORNER_BOTTOM_RIGHT, adapted_corner, corner_radius, height, height - adapted_border[MARGIN_BOTTOM], height - adapted_border[MARGIN_TOP]);
+ adapt_values(CORNER_TOP_LEFT, CORNER_BOTTOM_LEFT, adapted_corner, corner_radius, height, height - adapted_border[MARGIN_BOTTOM], height - adapted_border[MARGIN_TOP]);
+ adapt_values(CORNER_TOP_LEFT, CORNER_TOP_RIGHT, adapted_corner, corner_radius, width, width - adapted_border[MARGIN_RIGHT], width - adapted_border[MARGIN_LEFT]);
+ adapt_values(CORNER_BOTTOM_LEFT, CORNER_BOTTOM_RIGHT, adapted_corner, corner_radius, width, width - adapted_border[MARGIN_RIGHT], width - adapted_border[MARGIN_LEFT]);
- Color color_upleft = light_color;
- Color color_downright = dark_color;
+ Rect2 infill_rect = style_rect.grow_individual(-adapted_border[MARGIN_LEFT], -adapted_border[MARGIN_TOP], -adapted_border[MARGIN_RIGHT], -adapted_border[MARGIN_BOTTOM]);
- if (blend) {
+ Vector<Point2> verts;
+ Vector<int> indices;
+ Vector<Color> colors;
- color_upleft.r = (border_size - i) * color_upleft.r / border_size + i * bg_color.r / border_size;
- color_upleft.g = (border_size - i) * color_upleft.g / border_size + i * bg_color.g / border_size;
- color_upleft.b = (border_size - i) * color_upleft.b / border_size + i * bg_color.b / border_size;
+ //DRAWING
+ VisualServer *vs = VisualServer::get_singleton();
- color_downright.r = (border_size - i) * color_downright.r / border_size + i * bg_color.r / border_size;
- color_downright.g = (border_size - i) * color_downright.g / border_size + i * bg_color.g / border_size;
- color_downright.b = (border_size - i) * color_downright.b / border_size + i * bg_color.b / border_size;
+ //DRAW SHADOW
+ if (shadow_size > 0) {
+ int shadow_width[4] = { shadow_size, shadow_size, shadow_size, shadow_size };
+ Color shadow_colors[4] = { shadow_color, shadow_color, shadow_color, shadow_color };
+ Color shadow_colors_transparent[4];
+ for (int i = 0; i < 4; i++) {
+ shadow_colors_transparent[i] = Color(shadow_color.r, shadow_color.g, shadow_color.b, 0);
}
+ draw_ring(verts, indices, colors, style_rect, adapted_corner,
+ style_rect.grow(shadow_size), shadow_width, shadow_colors, shadow_colors_transparent, corner_detail);
+ }
- vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r.pos.x, r.pos.y + r.size.y - 1), Size2(r.size.x, 1)), color_downright);
- vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r.pos.x + r.size.x - 1, r.pos.y), Size2(1, r.size.y)), color_downright);
+ //DRAW border
+ Color bg_color_array[4] = { bg_color, bg_color, bg_color, bg_color };
+ const Color *inner_color = ((blend_border) ? bg_color_array : border_color.read().ptr());
+ draw_ring(verts, indices, colors, style_rect, adapted_corner,
+ style_rect, adapted_border, inner_color, border_color.read().ptr(), corner_detail);
+
+ //DRAW INFILL
+ if (filled) {
+ int temp_vert_offset = verts.size();
+ int no_border[4] = { 0, 0, 0, 0 };
+ draw_ring(verts, indices, colors, style_rect, adapted_corner,
+ infill_rect, no_border, &bg_color, &bg_color, corner_detail);
+ int added_vert_count = verts.size() - temp_vert_offset;
+ //fill the indices and the colors for the center
+ for (int index = 0; index <= added_vert_count / 2; index += 2) {
+ int i = index;
+ //poly 1
+ indices.push_back(temp_vert_offset + i);
+ indices.push_back(temp_vert_offset + added_vert_count - 4 - i);
+ indices.push_back(temp_vert_offset + i + 2);
+ //poly 1
+ indices.push_back(temp_vert_offset + i);
+ indices.push_back(temp_vert_offset + added_vert_count - 2 - i);
+ indices.push_back(temp_vert_offset + added_vert_count - 4 - i);
+ }
+ }
- vs->canvas_item_add_rect(p_canvas_item, Rect2(r.pos, Size2(r.size.x, 1)), color_upleft);
- vs->canvas_item_add_rect(p_canvas_item, Rect2(r.pos, Size2(1, r.size.y)), color_upleft);
+ if (aa_on) {
- r.pos.x++;
- r.pos.y++;
- r.size.x -= 2;
- r.size.y -= 2;
+ //HELPER ARRAYS
+ Color border_color_alpha[4];
+ for (int i = 0; i < 4; i++) {
+ Color c = border_color.read().ptr()[i];
+ border_color_alpha[i] = Color(c.r, c.g, c.b, 0);
+ }
+ Color alpha_bg = Color(bg_color.r, bg_color.g, bg_color.b, 0);
+ Color bg_color_array_alpha[4] = { alpha_bg, alpha_bg, alpha_bg, alpha_bg };
+
+ int aa_border_width[4] = { aa_size, aa_size, aa_size, aa_size };
+
+ if (filled) {
+ if (!blend_border) {
+ //INFILL AA
+ draw_ring(verts, indices, colors, style_rect, adapted_corner,
+ infill_rect.grow(aa_size), aa_border_width, bg_color_array, bg_color_array_alpha, corner_detail);
+ }
+ } else if (!(border_width[0] == 0 && border_width[1] == 0 && border_width[2] == 0 && border_width[3] == 0)) {
+ //DRAW INNER BORDER AA
+ draw_ring(verts, indices, colors, style_rect, adapted_corner,
+ infill_rect, aa_border_width, border_color_alpha, border_color.read().ptr(), corner_detail);
+ }
+ //DRAW OUTER BORDER AA
+ if (!(border_width[0] == 0 && border_width[1] == 0 && border_width[2] == 0 && border_width[3] == 0)) {
+ draw_ring(verts, indices, colors, style_rect, adapted_corner,
+ style_rect.grow(aa_size), aa_border_width, border_color.read().ptr(), border_color_alpha, corner_detail);
+ }
}
- if (draw_center)
- vs->canvas_item_add_rect(p_canvas_item, Rect2(r.pos, r.size), bg_color);
+ vs->canvas_item_add_triangle_array(p_canvas_item, indices, verts, colors);
}
float StyleBoxFlat::get_style_margin(Margin p_margin) const {
-
- return border_size;
+ return border_width[p_margin];
}
void StyleBoxFlat::_bind_methods() {
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_color", "color"), &StyleBoxFlat::set_border_color_all);
+ ClassDB::bind_method(D_METHOD("get_border_color", "color"), &StyleBoxFlat::get_border_color_all);
+
+ ClassDB::bind_method(D_METHOD("set_border_width_all", "width"), &StyleBoxFlat::set_border_width_all);
+ ClassDB::bind_method(D_METHOD("get_border_width_min"), &StyleBoxFlat::get_border_width_min);
+
+ ClassDB::bind_method(D_METHOD("set_border_width", "margin", "width"), &StyleBoxFlat::set_border_width);
+ ClassDB::bind_method(D_METHOD("get_border_width", "margin"), &StyleBoxFlat::get_border_width);
+
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);
+
+ ClassDB::bind_method(D_METHOD("set_corner_radius_individual", "radius_top_left", "radius_top_right", "radius_botton_right", "radius_bottom_left"), &StyleBoxFlat::set_corner_radius_individual);
+ ClassDB::bind_method(D_METHOD("set_corner_radius_all", "radius"), &StyleBoxFlat::set_corner_radius_all);
+
+ ClassDB::bind_method(D_METHOD("set_corner_radius", "corner", "radius"), &StyleBoxFlat::set_corner_radius);
+ ClassDB::bind_method(D_METHOD("get_corner_radius", "corner"), &StyleBoxFlat::get_corner_radius);
+
+ ClassDB::bind_method(D_METHOD("set_expand_margin", "margin", "size"), &StyleBoxFlat::set_expand_margin_size);
+ ClassDB::bind_method(D_METHOD("get_expand_margin", "margin"), &StyleBoxFlat::get_expand_margin_size);
+
+ ClassDB::bind_method(D_METHOD("set_filled", "filled"), &StyleBoxFlat::set_filled);
+ ClassDB::bind_method(D_METHOD("is_filled"), &StyleBoxFlat::is_filled);
+
+ ClassDB::bind_method(D_METHOD("set_shadow_color", "color"), &StyleBoxFlat::set_shadow_color);
+ ClassDB::bind_method(D_METHOD("get_shadow_color"), &StyleBoxFlat::get_shadow_color);
+
+ ClassDB::bind_method(D_METHOD("set_shadow_size", "size"), &StyleBoxFlat::set_shadow_size);
+ ClassDB::bind_method(D_METHOD("get_shadow_size"), &StyleBoxFlat::get_shadow_size);
+
+ ClassDB::bind_method(D_METHOD("set_anti_aliased", "anti_aliased"), &StyleBoxFlat::set_anti_aliased);
+ ClassDB::bind_method(D_METHOD("is_anti_aliased"), &StyleBoxFlat::is_anti_aliased);
+
+ ClassDB::bind_method(D_METHOD("set_aa_size", "size"), &StyleBoxFlat::set_aa_size);
+ ClassDB::bind_method(D_METHOD("get_aa_size"), &StyleBoxFlat::get_aa_size);
+
+ ClassDB::bind_method(D_METHOD("set_corner_detail", "detail"), &StyleBoxFlat::set_corner_detail);
+ ClassDB::bind_method(D_METHOD("get_corner_detail"), &StyleBoxFlat::get_corner_detail);
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, "filled"), "set_filled", "is_filled");
+
+ ADD_GROUP("Border Width", "border_width_");
+ ADD_PROPERTYI(PropertyInfo(Variant::INT, "border_width_left", PROPERTY_HINT_RANGE, "0,1024,1"), "set_border_width", "get_border_width", MARGIN_LEFT);
+ ADD_PROPERTYI(PropertyInfo(Variant::INT, "border_width_top", PROPERTY_HINT_RANGE, "0,1024,1"), "set_border_width", "get_border_width", MARGIN_TOP);
+ ADD_PROPERTYI(PropertyInfo(Variant::INT, "border_width_right", PROPERTY_HINT_RANGE, "0,1024,1"), "set_border_width", "get_border_width", MARGIN_RIGHT);
+ ADD_PROPERTYI(PropertyInfo(Variant::INT, "border_width_bottom", PROPERTY_HINT_RANGE, "0,1024,1"), "set_border_width", "get_border_width", MARGIN_BOTTOM);
+
+ ADD_GROUP("Border", "border_");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "border_color"), "set_border_color", "get_border_color");
+
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");
+
+ ADD_GROUP("Corner Radius", "corner_radius_");
+ ADD_PROPERTYI(PropertyInfo(Variant::INT, "corner_radius_top_left", PROPERTY_HINT_RANGE, "0,1024,1"), "set_corner_radius", "get_corner_radius", CORNER_TOP_LEFT);
+ ADD_PROPERTYI(PropertyInfo(Variant::INT, "corner_radius_top_right", PROPERTY_HINT_RANGE, "0,1024,1"), "set_corner_radius", "get_corner_radius", CORNER_TOP_RIGHT);
+ ADD_PROPERTYI(PropertyInfo(Variant::INT, "corner_radius_bottom_right", PROPERTY_HINT_RANGE, "0,1024,1"), "set_corner_radius", "get_corner_radius", CORNER_BOTTOM_RIGHT);
+ ADD_PROPERTYI(PropertyInfo(Variant::INT, "corner_radius_bottom_left", PROPERTY_HINT_RANGE, "0,1024,1"), "set_corner_radius", "get_corner_radius", CORNER_BOTTOM_LEFT);
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "corner_detail"), "set_corner_detail", "get_corner_detail");
+
+ ADD_GROUP("Expand Margin", "expand_margin_");
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_left", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_LEFT);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_right", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_RIGHT);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_top", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_TOP);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_bottom", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_BOTTOM);
+
+ ADD_GROUP("Shadow", "shadow_");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "shadow_color"), "set_shadow_color", "get_shadow_color");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_size"), "set_shadow_size", "get_shadow_size");
+
+ ADD_GROUP("Anti Aliasing", "anti_aliasing_");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "anti_aliasing"), "set_anti_aliased", "is_anti_aliased");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "anti_aliasing_size", PROPERTY_HINT_RANGE, "1,5,1"), "set_aa_size", "get_aa_size");
}
StyleBoxFlat::StyleBoxFlat() {
bg_color = Color(0.6, 0.6, 0.6);
- light_color = Color(0.8, 0.8, 0.8);
- dark_color = Color(0.8, 0.8, 0.8);
- draw_center = true;
- blend = true;
- border_size = 0;
+ shadow_color = Color(0, 0, 0, 0.6);
+
+ border_color.append(Color(0.8, 0.8, 0.8));
+ border_color.append(Color(0.8, 0.8, 0.8));
+ border_color.append(Color(0.8, 0.8, 0.8));
+ border_color.append(Color(0.8, 0.8, 0.8));
+
+ blend_border = false;
+ filled = true;
+ anti_aliased = true;
+
+ shadow_size = 0;
+ corner_detail = 8;
+ aa_size = 1;
+
+ border_width[0] = 0;
+ border_width[1] = 0;
+ border_width[2] = 0;
+ border_width[3] = 0;
+
+ expand_margin[0] = 0;
+ expand_margin[1] = 0;
+ expand_margin[2] = 0;
+ expand_margin[3] = 0;
+
+ corner_radius[0] = 0;
+ corner_radius[1] = 0;
+ corner_radius[2] = 0;
+ corner_radius[3] = 0;
}
StyleBoxFlat::~StyleBoxFlat() {
}
+
+void StyleBoxLine::set_color(const Color &p_color) {
+ color = p_color;
+ emit_changed();
+}
+Color StyleBoxLine::get_color() const {
+ return color;
+}
+
+void StyleBoxLine::set_thickness(int p_thickness) {
+ thickness = p_thickness;
+ emit_changed();
+}
+int StyleBoxLine::get_thickness() const {
+ return thickness;
+}
+
+void StyleBoxLine::set_vertical(bool p_vertical) {
+ vertical = p_vertical;
+}
+bool StyleBoxLine::is_vertical() const {
+ return vertical;
+}
+
+void StyleBoxLine::set_grow(float p_grow) {
+ grow = p_grow;
+ emit_changed();
+}
+float StyleBoxLine::get_grow() const {
+ return grow;
+}
+
+void StyleBoxLine::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_color", "color"), &StyleBoxLine::set_color);
+ ClassDB::bind_method(D_METHOD("get_color"), &StyleBoxLine::get_color);
+ ClassDB::bind_method(D_METHOD("set_thickness", "thickness"), &StyleBoxLine::set_thickness);
+ ClassDB::bind_method(D_METHOD("get_thickness"), &StyleBoxLine::get_thickness);
+ ClassDB::bind_method(D_METHOD("set_grow", "grow"), &StyleBoxLine::set_grow);
+ ClassDB::bind_method(D_METHOD("get_grow"), &StyleBoxLine::get_grow);
+ ClassDB::bind_method(D_METHOD("set_vertical", "vertical"), &StyleBoxLine::set_vertical);
+ ClassDB::bind_method(D_METHOD("is_vertical"), &StyleBoxLine::is_vertical);
+
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "thickness", PROPERTY_HINT_RANGE, "0,10"), "set_thickness", "get_thickness");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "vertical"), "set_vertical", "is_vertical");
+}
+float StyleBoxLine::get_style_margin(Margin p_margin) const {
+ return thickness;
+}
+Size2 StyleBoxLine::get_center_size() const {
+ return Size2();
+}
+
+void StyleBoxLine::draw(RID p_canvas_item, const Rect2 &p_rect) const {
+ VisualServer *vs = VisualServer::get_singleton();
+ Rect2i r = p_rect;
+
+ if (vertical) {
+ r.position.y -= grow;
+ r.size.y += grow * 2;
+ r.size.x = thickness;
+ } else {
+ r.position.x -= grow;
+ r.size.x += grow * 2;
+ r.size.y = thickness;
+ }
+
+ vs->canvas_item_add_rect(p_canvas_item, r, color);
+}
+
+StyleBoxLine::StyleBoxLine() {
+ grow = 1.0;
+ thickness = 1;
+ color = Color(0.0, 0.0, 0.0);
+ vertical = false;
+}
+StyleBoxLine::~StyleBoxLine() {}
diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h
index f0107ed71f..a750fae753 100644
--- a/scene/resources/style_box.h
+++ b/scene/resources/style_box.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,7 +39,7 @@
class StyleBox : public Resource {
GDCLASS(StyleBox, Resource);
- RES_BASE_EXTENSION("sbx");
+ RES_BASE_EXTENSION("stylebox");
OBJ_SAVE_TYPE(StyleBox);
float margin[4];
@@ -76,12 +77,23 @@ class StyleBoxTexture : public StyleBox {
GDCLASS(StyleBoxTexture, StyleBox);
+public:
+ enum AxisStretchMode {
+ AXIS_STRETCH_MODE_STRETCH,
+ AXIS_STRETCH_MODE_TILE,
+ AXIS_STRETCH_MODE_TILE_FIT,
+ };
+
+private:
float expand_margin[4];
float margin[4];
Rect2 region_rect;
Ref<Texture> texture;
+ Ref<Texture> normal_map;
bool draw_center;
Color modulate;
+ AxisStretchMode axis_h;
+ AxisStretchMode axis_v;
protected:
virtual float get_style_margin(Margin p_margin) const;
@@ -100,10 +112,19 @@ public:
void set_texture(RES p_texture);
RES get_texture() const;
+ void set_normal_map(RES p_normal_map);
+ RES get_normal_map() const;
+
void set_draw_center(bool p_draw);
bool get_draw_center() const;
virtual Size2 get_center_size() const;
+ void set_h_axis_stretch_mode(AxisStretchMode p_mode);
+ AxisStretchMode get_h_axis_stretch_mode() const;
+
+ void set_v_axis_stretch_mode(AxisStretchMode p_mode);
+ AxisStretchMode get_v_axis_stretch_mode() const;
+
void set_modulate(const Color &p_modulate);
Color get_modulate() const;
@@ -113,40 +134,88 @@ public:
~StyleBoxTexture();
};
+VARIANT_ENUM_CAST(StyleBoxTexture::AxisStretchMode)
+
class StyleBoxFlat : public StyleBox {
GDCLASS(StyleBoxFlat, StyleBox);
Color bg_color;
- Color light_color;
- Color dark_color;
+ Color shadow_color;
+ PoolVector<Color> border_color;
- int border_size;
+ int border_width[4];
+ int expand_margin[4];
+ int corner_radius[4];
- bool draw_center;
- bool blend;
+ bool filled;
+ bool blend_border;
+ bool anti_aliased;
+
+ int corner_detail;
+ int shadow_size;
+ int aa_size;
protected:
virtual float get_style_margin(Margin p_margin) const;
static void _bind_methods();
public:
+ //Color
void set_bg_color(const Color &p_color);
- void set_light_color(const Color &p_color);
- void set_dark_color(const Color &p_color);
-
Color get_bg_color() const;
- Color get_light_color() const;
- Color get_dark_color() const;
- void set_border_size(int p_size);
- int get_border_size() const;
+ //Border Color
+ void set_border_color_all(const Color &p_color);
+ Color get_border_color_all() const;
+ void set_border_color(Margin p_border, const Color &p_color);
+ Color get_border_color(Margin p_border) const;
+
+ //BORDER
+ //width
+ void set_border_width_all(int p_size);
+ int get_border_width_min() const;
+ void set_border_width(Margin p_margin, int p_size);
+ int get_border_width(Margin p_margin) const;
+
+ //blend
void set_border_blend(bool p_blend);
bool get_border_blend() const;
- void set_draw_center(bool p_draw);
- bool get_draw_center() const;
+ //CORNER
+ void set_corner_radius_all(int radius);
+ void set_corner_radius_individual(const int radius_top_left, const int radius_top_right, const int radius_botton_right, const int radius_bottom_left);
+ int get_corner_radius_min() const;
+
+ void set_corner_radius(Corner p_corner, const int radius);
+ int get_corner_radius(Corner p_corner) const;
+
+ void set_corner_detail(const int &p_corner_detail);
+ int get_corner_detail() const;
+
+ //EXPANDS
+ void set_expand_margin_size(Margin p_expand_margin, float p_size);
+ float get_expand_margin_size(Margin p_expand_margin) const;
+
+ //FILLED
+ void set_filled(bool p_draw);
+ bool is_filled() const;
+
+ //SHADOW
+ void set_shadow_color(const Color &p_color);
+ Color get_shadow_color() const;
+
+ void set_shadow_size(const int &p_size);
+ int get_shadow_size() const;
+
+ //ANTI_ALIASING
+ void set_anti_aliased(const bool &p_anit_aliasing);
+ bool is_anti_aliased() const;
+ //tempAA
+ void set_aa_size(const int &p_aa_size);
+ int get_aa_size() const;
+
virtual Size2 get_center_size() const;
virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const;
@@ -155,4 +224,38 @@ public:
~StyleBoxFlat();
};
+// just used to draw lines.
+class StyleBoxLine : public StyleBox {
+
+ GDCLASS(StyleBoxLine, StyleBox);
+ Color color;
+ int thickness;
+ bool vertical;
+ float grow;
+
+protected:
+ virtual float get_style_margin(Margin p_margin) const;
+ static void _bind_methods();
+
+public:
+ void set_color(const Color &p_color);
+ Color get_color() const;
+
+ void set_thickness(int p_thickness);
+ int get_thickness() const;
+
+ void set_vertical(bool p_vertical);
+ bool is_vertical() const;
+
+ void set_grow(float p_grow);
+ float get_grow() const;
+
+ virtual Size2 get_center_size() const;
+
+ virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const;
+
+ StyleBoxLine();
+ ~StyleBoxLine();
+};
+
#endif
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp
index 7564735cf2..9320676016 100644
--- a/scene/resources/surface_tool.cpp
+++ b/scene/resources/surface_tool.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,41 +28,41 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "surface_tool.h"
-#include "method_bind_ext.inc"
+#include "method_bind_ext.gen.inc"
#define _VERTEX_SNAP 0.0001
#define EQ_VERTEX_DIST 0.00001
-bool SurfaceTool::Vertex::operator==(const Vertex &p_b) const {
+bool SurfaceTool::Vertex::operator==(const Vertex &p_vertex) const {
- if (vertex != p_b.vertex)
+ if (vertex != p_vertex.vertex)
return false;
- if (uv != p_b.uv)
+ if (uv != p_vertex.uv)
return false;
- if (uv2 != p_b.uv2)
+ if (uv2 != p_vertex.uv2)
return false;
- if (normal != p_b.normal)
+ if (normal != p_vertex.normal)
return false;
- if (binormal != p_b.binormal)
+ if (binormal != p_vertex.binormal)
return false;
- if (color != p_b.color)
+ if (color != p_vertex.color)
return false;
- if (bones.size() != p_b.bones.size())
+ if (bones.size() != p_vertex.bones.size())
return false;
for (int i = 0; i < bones.size(); i++) {
- if (bones[i] != p_b.bones[i])
+ if (bones[i] != p_vertex.bones[i])
return false;
}
for (int i = 0; i < weights.size(); i++) {
- if (weights[i] != p_b.weights[i])
+ if (weights[i] != p_vertex.weights[i])
return false;
}
@@ -223,30 +224,22 @@ void SurfaceTool::add_index(int p_index) {
index_array.push_back(p_index);
}
-Ref<Mesh> SurfaceTool::commit(const Ref<Mesh> &p_existing) {
-
- Ref<Mesh> mesh;
- if (p_existing.is_valid())
- mesh = p_existing;
- else
- mesh = Ref<Mesh>(memnew(Mesh));
+Array SurfaceTool::commit_to_arrays() {
int varr_len = vertex_array.size();
- if (varr_len == 0)
- return mesh;
-
- int surface = mesh->get_surface_count();
-
Array a;
a.resize(Mesh::ARRAY_MAX);
for (int i = 0; i < Mesh::ARRAY_MAX; i++) {
- switch (format & (1 << i)) {
+ if (!(format & (1 << i)))
+ continue; //not in format
- case Mesh::ARRAY_FORMAT_VERTEX:
- case Mesh::ARRAY_FORMAT_NORMAL: {
+ switch (i) {
+
+ case Mesh::ARRAY_VERTEX:
+ case Mesh::ARRAY_NORMAL: {
PoolVector<Vector3> array;
array.resize(varr_len);
@@ -272,8 +265,8 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh> &p_existing) {
} break;
- case Mesh::ARRAY_FORMAT_TEX_UV:
- case Mesh::ARRAY_FORMAT_TEX_UV2: {
+ case Mesh::ARRAY_TEX_UV:
+ case Mesh::ARRAY_TEX_UV2: {
PoolVector<Vector2> array;
array.resize(varr_len);
@@ -298,7 +291,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh> &p_existing) {
w = PoolVector<Vector2>::Write();
a[i] = array;
} break;
- case Mesh::ARRAY_FORMAT_TANGENT: {
+ case Mesh::ARRAY_TANGENT: {
PoolVector<float> array;
array.resize(varr_len * 4);
@@ -322,7 +315,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh> &p_existing) {
a[i] = array;
} break;
- case Mesh::ARRAY_FORMAT_COLOR: {
+ case Mesh::ARRAY_COLOR: {
PoolVector<Color> array;
array.resize(varr_len);
@@ -338,7 +331,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh> &p_existing) {
w = PoolVector<Color>::Write();
a[i] = array;
} break;
- case Mesh::ARRAY_FORMAT_BONES: {
+ case Mesh::ARRAY_BONES: {
PoolVector<int> array;
array.resize(varr_len * 4);
@@ -360,7 +353,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh> &p_existing) {
a[i] = array;
} break;
- case Mesh::ARRAY_FORMAT_WEIGHTS: {
+ case Mesh::ARRAY_WEIGHTS: {
PoolVector<float> array;
array.resize(varr_len * 4);
@@ -382,7 +375,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh> &p_existing) {
a[i] = array;
} break;
- case Mesh::ARRAY_FORMAT_INDEX: {
+ case Mesh::ARRAY_INDEX: {
ERR_CONTINUE(index_array.size() == 0);
@@ -397,6 +390,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh> &p_existing) {
}
w = PoolVector<int>::Write();
+
a[i] = array;
} break;
@@ -404,6 +398,26 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh> &p_existing) {
}
}
+ return a;
+}
+
+Ref<ArrayMesh> SurfaceTool::commit(const Ref<ArrayMesh> &p_existing) {
+
+ Ref<ArrayMesh> mesh;
+ if (p_existing.is_valid())
+ mesh = p_existing;
+ else
+ mesh.instance();
+
+ int varr_len = vertex_array.size();
+
+ if (varr_len == 0)
+ return mesh;
+
+ int surface = mesh->get_surface_count();
+
+ Array a = commit_to_arrays();
+
mesh->add_surface_from_arrays(primitive, a);
if (material.is_valid())
mesh->surface_set_material(surface, material);
@@ -458,12 +472,17 @@ void SurfaceTool::deindex() {
vertex_array.push_back(varr[E->get()]);
}
format &= ~Mesh::ARRAY_FORMAT_INDEX;
+ index_array.clear();
}
void SurfaceTool::_create_list(const Ref<Mesh> &p_existing, int p_surface, List<Vertex> *r_vertex, List<int> *r_index, int &lformat) {
Array arr = p_existing->surface_get_arrays(p_surface);
ERR_FAIL_COND(arr.size() != VS::ARRAY_MAX);
+ _create_list_from_arrays(arr, r_vertex, r_index, lformat);
+}
+
+void SurfaceTool::_create_list_from_arrays(Array arr, List<Vertex> *r_vertex, List<int> *r_index, int &lformat) {
PoolVector<Vector3> varr = arr[VS::ARRAY_VERTEX];
PoolVector<Vector3> narr = arr[VS::ARRAY_NORMAL];
@@ -535,7 +554,7 @@ void SurfaceTool::_create_list(const Ref<Mesh> &p_existing, int p_surface, List<
if (lformat & VS::ARRAY_FORMAT_TANGENT) {
Plane p(tarr[i * 4 + 0], tarr[i * 4 + 1], tarr[i * 4 + 2], tarr[i * 4 + 3]);
v.tangent = p.normal;
- v.binormal = p.normal.cross(last_normal).normalized() * p.d;
+ v.binormal = p.normal.cross(v.tangent).normalized() * p.d;
}
if (lformat & VS::ARRAY_FORMAT_COLOR)
v.color = carr[i];
@@ -579,6 +598,13 @@ void SurfaceTool::_create_list(const Ref<Mesh> &p_existing, int p_surface, List<
}
}
+void SurfaceTool::create_from_triangle_arrays(const Array &p_arrays) {
+
+ clear();
+ primitive = Mesh::PRIMITIVE_TRIANGLES;
+ _create_list_from_arrays(p_arrays, &vertex_array, &index_array, format);
+}
+
void SurfaceTool::create_from(const Ref<Mesh> &p_existing, int p_surface) {
clear();
@@ -710,8 +736,9 @@ void SurfaceTool::generate_tangents() {
ERR_FAIL_COND(!res);
format |= Mesh::ARRAY_FORMAT_TANGENT;
- if (indexed)
+ if (indexed) {
index();
+ }
}
void SurfaceTool::generate_normals() {
@@ -783,7 +810,6 @@ void SurfaceTool::generate_normals() {
vertex_hash.clear();
if (E) {
smooth = smooth_groups[count];
- print_line("SMOOTH AT " + itos(count) + ": " + itos(smooth));
}
}
}
@@ -811,11 +837,13 @@ void SurfaceTool::clear() {
index_array.clear();
vertex_array.clear();
smooth_groups.clear();
+ material.unref();
}
void SurfaceTool::_bind_methods() {
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);
@@ -825,15 +853,25 @@ void SurfaceTool::_bind_methods() {
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("add_index", "index"), &SurfaceTool::add_index);
+
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("generate_tangents"), &SurfaceTool::generate_tangents);
+
+ ClassDB::bind_method(D_METHOD("add_to_format", "flags"), &SurfaceTool::add_to_format);
+
+ ClassDB::bind_method(D_METHOD("set_material", "material"), &SurfaceTool::set_material);
+
ClassDB::bind_method(D_METHOD("clear"), &SurfaceTool::clear);
+
+ ClassDB::bind_method(D_METHOD("create_from", "existing", "surface"), &SurfaceTool::create_from);
+ ClassDB::bind_method(D_METHOD("append_from", "existing", "surface", "transform"), &SurfaceTool::append_from);
+ ClassDB::bind_method(D_METHOD("commit", "existing"), &SurfaceTool::commit, DEFVAL(Variant()));
}
SurfaceTool::SurfaceTool() {
diff --git a/scene/resources/surface_tool.h b/scene/resources/surface_tool.h
index 542c21e7b8..fcc94753ca 100644
--- a/scene/resources/surface_tool.h
+++ b/scene/resources/surface_tool.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,9 +30,10 @@
#ifndef SURFACE_TOOL_H
#define SURFACE_TOOL_H
-#include "mikktspace.h"
#include "scene/resources/mesh.h"
+#include "thirdparty/misc/mikktspace.h"
+
class SurfaceTool : public Reference {
GDCLASS(SurfaceTool, Reference);
@@ -78,6 +80,7 @@ private:
Vector<float> last_weights;
Plane last_tangent;
+ void _create_list_from_arrays(Array arr, List<Vertex> *r_vertex, List<int> *r_index, int &lformat);
void _create_list(const Ref<Mesh> &p_existing, int p_surface, List<Vertex> *r_vertex, List<int> *r_index, int &lformat);
//mikktspace callbacks
@@ -99,8 +102,8 @@ public:
void add_normal(const Vector3 &p_normal);
void add_tangent(const Plane &p_tangent);
void add_uv(const Vector2 &p_uv);
- void add_uv2(const Vector2 &p_uv);
- void add_bones(const Vector<int> &p_indices);
+ void add_uv2(const Vector2 &p_uv2);
+ void add_bones(const Vector<int> &p_bones);
void add_weights(const Vector<float> &p_weights);
void add_smooth_group(bool p_smooth);
@@ -121,9 +124,11 @@ public:
List<Vertex> &get_vertex_array() { return vertex_array; }
+ void create_from_triangle_arrays(const Array &p_arrays);
+ Array commit_to_arrays();
void create_from(const Ref<Mesh> &p_existing, int p_surface);
void append_from(const Ref<Mesh> &p_existing, int p_surface, const Transform &p_xform);
- Ref<Mesh> commit(const Ref<Mesh> &p_existing = Ref<Mesh>());
+ Ref<ArrayMesh> commit(const Ref<ArrayMesh> &p_existing = Ref<ArrayMesh>());
SurfaceTool();
};
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index d08fc2634e..9a251c029d 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +28,9 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "texture.h"
+#include "core/method_bind_ext.gen.inc"
#include "core/os/os.h"
+#include "core_string_names.h"
#include "io/image_loader.h"
Size2 Texture::get_size() const {
@@ -35,17 +38,20 @@ Size2 Texture::get_size() const {
return Size2(get_width(), get_height());
}
-void Texture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose) const {
+void Texture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) const {
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, get_size()), get_rid(), false, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, get_size()), get_rid(), false, p_modulate, p_transpose, normal_rid);
}
-void Texture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose) const {
+void Texture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) const {
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, get_rid(), p_tile, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, get_rid(), p_tile, p_modulate, p_transpose, normal_rid);
}
-void Texture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose) const {
+void Texture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map, bool p_clip_uv) const {
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, get_rid(), p_src_rect, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, get_rid(), p_src_rect, p_modulate, p_transpose, normal_rid, p_clip_uv);
}
bool Texture::get_rect_region(const Rect2 &p_rect, const Rect2 &p_src_rect, Rect2 &r_rect, Rect2 &r_src_rect) const {
@@ -64,9 +70,10 @@ void Texture::_bind_methods() {
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));
+ ClassDB::bind_method(D_METHOD("draw", "canvas_item", "pos", "modulate", "transpose", "normal_map"), &Texture::draw, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("draw_rect", "canvas_item", "rect", "tile", "modulate", "transpose", "normal_map"), &Texture::draw_rect, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("draw_rect_region", "canvas_item", "rect", "src_rect", "modulate", "transpose", "normal_map", "clip_uv"), &Texture::draw_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("get_data"), &Texture::get_data);
BIND_CONSTANT(FLAG_MIPMAPS);
BIND_CONSTANT(FLAG_REPEAT);
@@ -85,14 +92,15 @@ Texture::Texture() {
void ImageTexture::reload_from_file() {
- String path = get_path();
+ String path = ResourceLoader::path_remap(get_path());
if (!path.is_resource_file())
return;
uint32_t flags = get_flags();
- Image img;
+ Ref<Image> img;
+ img.instance();
- Error err = ImageLoader::load_image(path, &img);
+ Error err = ImageLoader::load_image(path, img);
ERR_FAIL_COND(err != OK);
create_from_image(img, flags);
@@ -100,7 +108,7 @@ void ImageTexture::reload_from_file() {
bool ImageTexture::_set(const StringName &p_name, const Variant &p_value) {
- if (p_name == "image" && p_value.get_type() == Variant::IMAGE)
+ if (p_name == "image")
create_from_image(p_value, flags);
else if (p_name == "flags")
if (w * h == 0)
@@ -154,7 +162,7 @@ void ImageTexture::_get_property_list(List<PropertyInfo> *p_list) const {
}
p_list->push_back(PropertyInfo(Variant::INT, "flags", PROPERTY_HINT_FLAGS, "Mipmaps,Repeat,Filter,Anisotropic,sRGB,Mirrored Repeat"));
- p_list->push_back(PropertyInfo(Variant::IMAGE, "image", img_hint, String::num(lossy_storage_quality)));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "image", PROPERTY_HINT_RESOURCE_TYPE, "Image"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "size", PROPERTY_HINT_NONE, ""));
p_list->push_back(PropertyInfo(Variant::INT, "storage", PROPERTY_HINT_ENUM, "Uncompressed,Compress Lossy,Compress Lossless"));
p_list->push_back(PropertyInfo(Variant::REAL, "lossy_quality", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"));
@@ -166,8 +174,9 @@ void ImageTexture::_reload_hook(const RID &p_hook) {
if (!path.is_resource_file())
return;
- Image img;
- Error err = ImageLoader::load_image(path, &img);
+ Ref<Image> img;
+ img.instance();
+ Error err = ImageLoader::load_image(path, img);
ERR_FAIL_COND(err != OK);
@@ -184,14 +193,15 @@ void ImageTexture::create(int p_width, int p_height, Image::Format p_format, uin
w = p_width;
h = p_height;
}
-void ImageTexture::create_from_image(const Image &p_image, uint32_t p_flags) {
+void ImageTexture::create_from_image(const Ref<Image> &p_image, uint32_t p_flags) {
+ ERR_FAIL_COND(p_image.is_null());
flags = p_flags;
- w = p_image.get_width();
- h = p_image.get_height();
- format = p_image.get_format();
+ w = p_image->get_width();
+ h = p_image->get_height();
+ format = p_image->get_format();
- VisualServer::get_singleton()->texture_allocate(texture, p_image.get_width(), p_image.get_height(), p_image.get_format(), p_flags);
+ VisualServer::get_singleton()->texture_allocate(texture, p_image->get_width(), p_image->get_height(), p_image->get_format(), p_flags);
VisualServer::get_singleton()->texture_set_data(texture, p_image);
_change_notify();
}
@@ -219,12 +229,13 @@ Image::Format ImageTexture::get_format() const {
void ImageTexture::load(const String &p_path) {
- Image img;
- img.load(p_path);
+ Ref<Image> img;
+ img.instance();
+ img->load(p_path);
create_from_image(img);
}
-void ImageTexture::set_data(const Image &p_image) {
+void ImageTexture::set_data(const Ref<Image> &p_image) {
VisualServer::get_singleton()->texture_set_data(texture, p_image);
@@ -236,7 +247,7 @@ void ImageTexture::_resource_path_changed() {
String path = get_path();
}
-Image ImageTexture::get_data() const {
+Ref<Image> ImageTexture::get_data() const {
return VisualServer::get_singleton()->texture_get_data(texture);
}
@@ -256,64 +267,31 @@ RID ImageTexture::get_rid() const {
return texture;
}
-void ImageTexture::fix_alpha_edges() {
-
- if (format == Image::FORMAT_RGBA8 /*&& !(flags&FLAG_CUBEMAP)*/) {
-
- Image img = get_data();
- img.fix_alpha_edges();
- set_data(img);
- }
-}
-
-void ImageTexture::premultiply_alpha() {
-
- if (format == Image::FORMAT_RGBA8 /*&& !(flags&FLAG_CUBEMAP)*/) {
-
- Image img = get_data();
- img.premultiply_alpha();
- set_data(img);
- }
-}
-
-void ImageTexture::normal_to_xy() {
-
- Image img = get_data();
- img.normalmap_to_xy();
- create_from_image(img, flags);
-}
-
-void ImageTexture::shrink_x2_and_keep_size() {
-
- Size2 sizeov = get_size();
- Image img = get_data();
- img.resize(img.get_width() / 2, img.get_height() / 2, Image::INTERPOLATE_BILINEAR);
- create_from_image(img, flags);
- set_size_override(sizeov);
-}
-
bool ImageTexture::has_alpha() const {
return (format == Image::FORMAT_LA8 || format == Image::FORMAT_RGBA8);
}
-void ImageTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose) const {
+void ImageTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) const {
if ((w | h) == 0)
return;
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, Size2(w, h)), texture, false, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, Size2(w, h)), texture, false, p_modulate, p_transpose, normal_rid);
}
-void ImageTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose) const {
+void ImageTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) const {
if ((w | h) == 0)
return;
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, texture, p_tile, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, texture, p_tile, p_modulate, p_transpose, normal_rid);
}
-void ImageTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose) const {
+void ImageTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map, bool p_clip_uv) const {
if ((w | h) == 0)
return;
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, texture, p_src_rect, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, texture, p_src_rect, p_modulate, p_transpose, normal_rid, p_clip_uv);
}
void ImageTexture::set_size_override(const Size2 &p_size) {
@@ -357,7 +335,8 @@ float ImageTexture::get_lossy_storage_quality() const {
void ImageTexture::_set_data(Dictionary p_data) {
- Image img = p_data["image"];
+ Ref<Image> img = p_data["image"];
+ ERR_FAIL_COND(!img.is_valid());
uint32_t flags = p_data["flags"];
create_from_image(img, flags);
@@ -375,21 +354,12 @@ void ImageTexture::_bind_methods() {
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);
@@ -429,8 +399,17 @@ void StreamTexture::_requested_srgb(void *p_ud) {
request_srgb_callback(stex);
}
+void StreamTexture::_requested_normal(void *p_ud) {
+
+ StreamTexture *st = (StreamTexture *)p_ud;
+ Ref<StreamTexture> stex(st);
+ ERR_FAIL_COND(!request_normal_callback);
+ request_normal_callback(stex);
+}
+
StreamTexture::TextureFormatRequestCallback StreamTexture::request_3d_callback = NULL;
StreamTexture::TextureFormatRequestCallback StreamTexture::request_srgb_callback = NULL;
+StreamTexture::TextureFormatRequestCallback StreamTexture::request_normal_callback = NULL;
uint32_t StreamTexture::get_flags() const {
@@ -441,7 +420,9 @@ Image::Format StreamTexture::get_format() const {
return format;
}
-Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &flags, Image &image, int p_size_limit) {
+Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &flags, Ref<Image> &image, int p_size_limit) {
+
+ ERR_FAIL_COND_V(image.is_null(), ERR_INVALID_PARAMETER);
FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
ERR_FAIL_COND_V(!f, ERR_CANT_OPEN);
@@ -458,27 +439,38 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
flags = f->get_32(); //texture flags!
uint32_t df = f->get_32(); //data format
+/*
print_line("width: " + itos(tw));
print_line("height: " + itos(th));
print_line("flags: " + itos(flags));
print_line("df: " + itos(df));
+ */
+#ifdef TOOLS_ENABLED
if (request_3d_callback && df & FORMAT_BIT_DETECT_3D) {
- print_line("request detect 3D at " + p_path);
+ //print_line("request detect 3D at " + p_path);
VS::get_singleton()->texture_set_detect_3d_callback(texture, _requested_3d, this);
} else {
- print_line("not requesting detect 3D at " + p_path);
+ //print_line("not requesting detect 3D at " + p_path);
VS::get_singleton()->texture_set_detect_3d_callback(texture, NULL, NULL);
}
if (request_srgb_callback && df & FORMAT_BIT_DETECT_SRGB) {
- print_line("request detect srgb at " + p_path);
+ //print_line("request detect srgb at " + p_path);
VS::get_singleton()->texture_set_detect_srgb_callback(texture, _requested_srgb, this);
} else {
+ //print_line("not requesting detect srgb at " + p_path);
VS::get_singleton()->texture_set_detect_srgb_callback(texture, NULL, NULL);
- print_line("not requesting detect srgb at " + p_path);
}
+ if (request_srgb_callback && df & FORMAT_BIT_DETECT_NORMAL) {
+ //print_line("request detect srgb at " + p_path);
+ VS::get_singleton()->texture_set_detect_normal_callback(texture, _requested_normal, this);
+ } else {
+ //print_line("not requesting detect normal at " + p_path);
+ VS::get_singleton()->texture_set_detect_normal_callback(texture, NULL, NULL);
+ }
+#endif
if (!(df & FORMAT_BIT_STREAM)) {
p_size_limit = 0;
}
@@ -492,7 +484,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
uint32_t mipmaps = f->get_32();
uint32_t size = f->get_32();
- print_line("mipmaps: " + itos(mipmaps));
+ //print_line("mipmaps: " + itos(mipmaps));
while (mipmaps > 1 && p_size_limit > 0 && (sw > p_size_limit || sh > p_size_limit)) {
@@ -506,7 +498,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
}
//mipmaps need to be read independently, they will be later combined
- Vector<Image> mipmap_images;
+ Vector<Ref<Image> > mipmap_images;
int total_size = 0;
for (int i = 0; i < mipmaps; i++) {
@@ -522,23 +514,24 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
f->get_buffer(w.ptr(), size);
}
- Image img;
+ Ref<Image> img;
if (df & FORMAT_BIT_LOSSLESS) {
img = Image::lossless_unpacker(pv);
} else {
img = Image::lossy_unpacker(pv);
}
- if (img.empty()) {
+ if (img.is_null() || img->empty()) {
memdelete(f);
- ERR_FAIL_COND_V(img.empty(), ERR_FILE_CORRUPT);
+ ERR_FAIL_COND_V(img.is_null() || img->empty(), ERR_FILE_CORRUPT);
}
- total_size += img.get_data().size();
+
+ total_size += img->get_data().size();
mipmap_images.push_back(img);
}
- print_line("mipmap read total: " + itos(mipmap_images.size()));
+ //print_line("mipmap read total: " + itos(mipmap_images.size()));
memdelete(f); //no longer needed
@@ -557,7 +550,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
int ofs = 0;
for (int i = 0; i < mipmap_images.size(); i++) {
- PoolVector<uint8_t> id = mipmap_images[i].get_data();
+ PoolVector<uint8_t> id = mipmap_images[i]->get_data();
int len = id.size();
PoolVector<uint8_t>::Read r = id.read();
copymem(&w[ofs], r.ptr(), len);
@@ -565,7 +558,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
}
}
- image = Image(sw, sh, true, mipmap_images[0].get_format(), img_data);
+ image->create(sw, sh, true, mipmap_images[0]->get_format(), img_data);
return OK;
}
@@ -588,7 +581,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
memdelete(f);
- image = Image(tw, th, false, format, img_data);
+ image->create(tw, th, false, format, img_data);
return OK;
} else {
@@ -625,7 +618,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
{
PoolVector<uint8_t>::Write w = img_data.write();
int bytes = f->get_buffer(w.ptr(), total_size - ofs);
- print_line("requested read: " + itos(total_size - ofs) + " but got: " + itos(bytes));
+ //print_line("requested read: " + itos(total_size - ofs) + " but got: " + itos(bytes));
memdelete(f);
@@ -634,7 +627,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
}
}
- image = Image(sw, sh, true, format, img_data);
+ image->create(sw, sh, true, format, img_data);
return OK;
}
@@ -646,19 +639,20 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
Error StreamTexture::load(const String &p_path) {
int lw, lh, lflags;
- Image image;
+ Ref<Image> image;
+ image.instance();
Error err = _load_data(p_path, lw, lh, lflags, image);
if (err)
return err;
- VS::get_singleton()->texture_allocate(texture, image.get_width(), image.get_height(), image.get_format(), lflags);
+ VS::get_singleton()->texture_allocate(texture, image->get_width(), image->get_height(), image->get_format(), lflags);
VS::get_singleton()->texture_set_data(texture, image);
w = lw;
h = lh;
flags = lflags;
path_to_file = p_path;
- format = image.get_format();
+ format = image->get_format();
return OK;
}
@@ -680,23 +674,26 @@ RID StreamTexture::get_rid() const {
return texture;
}
-void StreamTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose) const {
+void StreamTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) const {
if ((w | h) == 0)
return;
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, Size2(w, h)), texture, false, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, Size2(w, h)), texture, false, p_modulate, p_transpose, normal_rid);
}
-void StreamTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose) const {
+void StreamTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) const {
if ((w | h) == 0)
return;
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, texture, p_tile, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, texture, p_tile, p_modulate, p_transpose, normal_rid);
}
-void StreamTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose) const {
+void StreamTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map, bool p_clip_uv) const {
if ((w | h) == 0)
return;
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, texture, p_src_rect, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, texture, p_src_rect, p_modulate, p_transpose, normal_rid, p_clip_uv);
}
bool StreamTexture::has_alpha() const {
@@ -704,7 +701,7 @@ bool StreamTexture::has_alpha() const {
return false;
}
-Image StreamTexture::get_data() const {
+Ref<Image> StreamTexture::get_data() const {
return VS::get_singleton()->texture_get_data(texture);
}
@@ -714,13 +711,16 @@ void StreamTexture::set_flags(uint32_t p_flags) {
void StreamTexture::reload_from_file() {
-#ifdef TOOLS_ENABLED
- String ipath = get_import_path();
- if (ipath.is_resource_file() && ipath != path_to_file) {
- path_to_file = ipath;
- }
-#endif
- load(path_to_file);
+ String path = get_path();
+ if (!path.is_resource_file())
+ return;
+
+ path = ResourceLoader::path_remap(path); //remap for translation
+ path = ResourceLoader::import_remap(path); //remap for import
+ if (!path.is_resource_file())
+ return;
+
+ load(path);
}
void StreamTexture::_bind_methods() {
@@ -831,7 +831,7 @@ void AtlasTexture::set_atlas(const Ref<Texture> &p_atlas) {
return;
atlas = p_atlas;
emit_changed();
- emit_signal("atlas_changed");
+ _change_notify("atlas");
}
Ref<Texture> AtlasTexture::get_atlas() const {
@@ -840,8 +840,11 @@ Ref<Texture> AtlasTexture::get_atlas() const {
void AtlasTexture::set_region(const Rect2 &p_region) {
+ if (region == p_region)
+ return;
region = p_region;
emit_changed();
+ _change_notify("region");
}
Rect2 AtlasTexture::get_region() const {
@@ -851,8 +854,11 @@ Rect2 AtlasTexture::get_region() const {
void AtlasTexture::set_margin(const Rect2 &p_margin) {
+ if (margin == p_margin)
+ return;
margin = p_margin;
emit_changed();
+ _change_notify("margin");
}
Rect2 AtlasTexture::get_margin() const {
@@ -862,8 +868,8 @@ Rect2 AtlasTexture::get_margin() const {
void AtlasTexture::_bind_methods() {
- 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(D_METHOD("set_atlas", "atlas"), &AtlasTexture::set_atlas);
+ ClassDB::bind_method(D_METHOD("get_atlas"), &AtlasTexture::get_atlas);
ClassDB::bind_method(D_METHOD("set_region", "region"), &AtlasTexture::set_region);
ClassDB::bind_method(D_METHOD("get_region"), &AtlasTexture::get_region);
@@ -871,14 +877,12 @@ void AtlasTexture::_bind_methods() {
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"), "set_atlas", "get_atlas");
ADD_PROPERTY(PropertyInfo(Variant::RECT2, "region"), "set_region", "get_region");
ADD_PROPERTY(PropertyInfo(Variant::RECT2, "margin"), "set_margin", "get_margin");
}
-void AtlasTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose) const {
+void AtlasTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) const {
Rect2 rc = region;
@@ -893,10 +897,11 @@ void AtlasTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_m
rc.size.height = atlas->get_height();
}
- VS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(p_pos + margin.pos, rc.size), atlas->get_rid(), rc, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(p_pos + margin.position, rc.size), atlas->get_rid(), rc, p_modulate, p_transpose, normal_rid);
}
-void AtlasTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose) const {
+void AtlasTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) const {
Rect2 rc = region;
@@ -912,11 +917,12 @@ void AtlasTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile
}
Vector2 scale = p_rect.size / (region.size + margin.size);
- Rect2 dr(p_rect.pos + margin.pos * scale, rc.size * scale);
+ Rect2 dr(p_rect.position + margin.position * scale, rc.size * scale);
- VS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, dr, atlas->get_rid(), rc, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, dr, atlas->get_rid(), rc, p_modulate, p_transpose, normal_rid);
}
-void AtlasTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose) const {
+void AtlasTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map, bool p_clip_uv) const {
//this might not necessarily work well if using a rect, needs to be fixed properly
Rect2 rc = region;
@@ -925,26 +931,27 @@ void AtlasTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, cons
return;
Rect2 src = p_src_rect;
- src.pos += (rc.pos - margin.pos);
+ src.position += (rc.position - margin.position);
Rect2 src_c = rc.clip(src);
if (src_c.size == Size2())
return;
- Vector2 ofs = (src_c.pos - src.pos);
+ Vector2 ofs = (src_c.position - src.position);
Vector2 scale = p_rect.size / p_src_rect.size;
if (scale.x < 0) {
- float mx = (margin.size.width - margin.pos.x);
- mx -= margin.pos.x;
+ float mx = (margin.size.width - margin.position.x);
+ mx -= margin.position.x;
ofs.x = -(ofs.x + mx);
}
if (scale.y < 0) {
- float my = margin.size.height - margin.pos.y;
- my -= margin.pos.y;
+ float my = margin.size.height - margin.position.y;
+ my -= margin.position.y;
ofs.y = -(ofs.y + my);
}
- Rect2 dr(p_rect.pos + ofs * scale, src_c.size * scale);
+ Rect2 dr(p_rect.position + ofs * scale, src_c.size * scale);
- VS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, dr, atlas->get_rid(), src_c, p_modulate, p_transpose);
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
+ VS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, dr, atlas->get_rid(), src_c, p_modulate, p_transpose, normal_rid, p_clip_uv);
}
bool AtlasTexture::get_rect_region(const Rect2 &p_rect, const Rect2 &p_src_rect, Rect2 &r_rect, Rect2 &r_src_rect) const {
@@ -955,24 +962,24 @@ bool AtlasTexture::get_rect_region(const Rect2 &p_rect, const Rect2 &p_src_rect,
return false;
Rect2 src = p_src_rect;
- src.pos += (rc.pos - margin.pos);
+ src.position += (rc.position - margin.position);
Rect2 src_c = rc.clip(src);
if (src_c.size == Size2())
return false;
- Vector2 ofs = (src_c.pos - src.pos);
+ Vector2 ofs = (src_c.position - src.position);
Vector2 scale = p_rect.size / p_src_rect.size;
if (scale.x < 0) {
- float mx = (margin.size.width - margin.pos.x);
- mx -= margin.pos.x;
+ float mx = (margin.size.width - margin.position.x);
+ mx -= margin.position.x;
ofs.x = -(ofs.x + mx);
}
if (scale.y < 0) {
- float my = margin.size.height - margin.pos.y;
- my -= margin.pos.y;
+ float my = margin.size.height - margin.position.y;
+ my -= margin.position.y;
ofs.y = -(ofs.y + my);
}
- Rect2 dr(p_rect.pos + ofs * scale, src_c.size * scale);
+ Rect2 dr(p_rect.position + ofs * scale, src_c.size * scale);
r_rect = dr;
r_src_rect = src_c;
@@ -1093,15 +1100,15 @@ Ref<Texture> LargeTexture::get_piece_texture(int p_idx) const {
void LargeTexture::_bind_methods() {
- ClassDB::bind_method(D_METHOD("add_piece", "ofs", "texture:Texture"), &LargeTexture::add_piece);
+ ClassDB::bind_method(D_METHOD("add_piece", "ofs", "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_piece_texture", "idx", "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(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(D_METHOD("get_piece_texture", "idx"), &LargeTexture::get_piece_texture);
ClassDB::bind_method(D_METHOD("_set_data", "data"), &LargeTexture::_set_data);
ClassDB::bind_method(D_METHOD("_get_data"), &LargeTexture::_get_data);
@@ -1109,16 +1116,16 @@ void LargeTexture::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_data", "_get_data");
}
-void LargeTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose) const {
+void LargeTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) const {
for (int i = 0; i < pieces.size(); i++) {
// TODO
- pieces[i].texture->draw(p_canvas_item, pieces[i].offset + p_pos, p_modulate, p_transpose);
+ pieces[i].texture->draw(p_canvas_item, pieces[i].offset + p_pos, p_modulate, p_transpose, p_normal_map);
}
}
-void LargeTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose) const {
+void LargeTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) const {
//tiling not supported for this
if (size.x == 0 || size.y == 0)
@@ -1126,13 +1133,14 @@ void LargeTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile
Size2 scale = p_rect.size / size;
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
for (int i = 0; i < pieces.size(); i++) {
// TODO
- pieces[i].texture->draw_rect(p_canvas_item, Rect2(pieces[i].offset * scale + p_rect.pos, pieces[i].texture->get_size() * scale), false, p_modulate, p_transpose);
+ pieces[i].texture->draw_rect(p_canvas_item, Rect2(pieces[i].offset * scale + p_rect.position, pieces[i].texture->get_size() * scale), false, p_modulate, p_transpose, p_normal_map);
}
}
-void LargeTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose) const {
+void LargeTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map, bool p_clip_uv) const {
//tiling not supported for this
if (p_src_rect.size.x == 0 || p_src_rect.size.y == 0)
@@ -1140,6 +1148,7 @@ void LargeTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, cons
Size2 scale = p_rect.size / p_src_rect.size;
+ RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
for (int i = 0; i < pieces.size(); i++) {
// TODO
@@ -1149,9 +1158,9 @@ void LargeTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, cons
Rect2 local = p_src_rect.clip(rect);
Rect2 target = local;
target.size *= scale;
- target.pos = p_rect.pos + (p_src_rect.pos + rect.pos) * scale;
- local.pos -= rect.pos;
- pieces[i].texture->draw_rect_region(p_canvas_item, target, local, p_modulate, p_transpose);
+ target.position = p_rect.position + (p_src_rect.position + rect.position) * scale;
+ local.position -= rect.position;
+ pieces[i].texture->draw_rect_region(p_canvas_item, target, local, p_modulate, p_transpose, p_normal_map, false);
}
}
@@ -1172,25 +1181,25 @@ uint32_t CubeMap::get_flags() const {
return flags;
}
-void CubeMap::set_side(Side p_side, const Image &p_image) {
+void CubeMap::set_side(Side p_side, const Ref<Image> &p_image) {
- ERR_FAIL_COND(p_image.empty());
+ ERR_FAIL_COND(p_image->empty());
ERR_FAIL_INDEX(p_side, 6);
if (!_is_valid()) {
- format = p_image.get_format();
- w = p_image.get_width();
- h = p_image.get_height();
- VS::get_singleton()->texture_allocate(cubemap, w, h, p_image.get_format(), flags | VS::TEXTURE_FLAG_CUBEMAP);
+ format = p_image->get_format();
+ w = p_image->get_width();
+ h = p_image->get_height();
+ VS::get_singleton()->texture_allocate(cubemap, w, h, p_image->get_format(), flags | VS::TEXTURE_FLAG_CUBEMAP);
}
VS::get_singleton()->texture_set_data(cubemap, p_image, VS::CubeMapSide(p_side));
valid[p_side] = true;
}
-Image CubeMap::get_side(Side p_side) const {
+Ref<Image> CubeMap::get_side(Side p_side) const {
if (!valid[p_side])
- return Image();
+ return Ref<Image>();
return VS::get_singleton()->texture_get_data(cubemap, VS::CubeMapSide(p_side));
}
@@ -1303,14 +1312,12 @@ void CubeMap::_get_property_list(List<PropertyInfo> *p_list) const {
}
p_list->push_back(PropertyInfo(Variant::INT, "flags", PROPERTY_HINT_FLAGS, "Mipmaps,Repeat,Filter"));
- p_list->push_back(PropertyInfo(Variant::IMAGE, "side/left", img_hint, String::num(lossy_storage_quality)));
- p_list->push_back(PropertyInfo(Variant::IMAGE, "side/right", img_hint, String::num(lossy_storage_quality)));
- p_list->push_back(PropertyInfo(Variant::IMAGE, "side/bottom", img_hint, String::num(lossy_storage_quality)));
- p_list->push_back(PropertyInfo(Variant::IMAGE, "side/top", img_hint, String::num(lossy_storage_quality)));
- p_list->push_back(PropertyInfo(Variant::IMAGE, "side/front", img_hint, String::num(lossy_storage_quality)));
- p_list->push_back(PropertyInfo(Variant::IMAGE, "side/back", img_hint, String::num(lossy_storage_quality)));
- p_list->push_back(PropertyInfo(Variant::INT, "storage", PROPERTY_HINT_ENUM, "Uncompressed,Compress Lossy,Compress Lossless", PROPERTY_USAGE_EDITOR));
- p_list->push_back(PropertyInfo(Variant::REAL, "lossy_quality", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "side/left", PROPERTY_HINT_RESOURCE_TYPE, "Image"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "side/right", PROPERTY_HINT_RESOURCE_TYPE, "Image"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "side/bottom", PROPERTY_HINT_RESOURCE_TYPE, "Image"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "side/top", PROPERTY_HINT_RESOURCE_TYPE, "Image"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "side/front", PROPERTY_HINT_RESOURCE_TYPE, "Image"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "side/back", PROPERTY_HINT_RESOURCE_TYPE, "Image"));
}
void CubeMap::_bind_methods() {
@@ -1367,3 +1374,209 @@ CubeMap::~CubeMap() {
BIND_CONSTANT( CUBEMAP_FRONT );
BIND_CONSTANT( CUBEMAP_BACK );
*/
+///////////////////////////
+
+void CurveTexture::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_width", "width"), &CurveTexture::set_width);
+
+ ClassDB::bind_method(D_METHOD("set_curve", "curve"), &CurveTexture::set_curve);
+ ClassDB::bind_method(D_METHOD("get_curve"), &CurveTexture::get_curve);
+
+ ClassDB::bind_method(D_METHOD("_update"), &CurveTexture::_update);
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "width", PROPERTY_HINT_RANGE, "32,4096"), "set_width", "get_width");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_curve", "get_curve");
+}
+
+void CurveTexture::set_width(int p_width) {
+
+ ERR_FAIL_COND(p_width < 32 || p_width > 4096);
+ _width = p_width;
+ _update();
+}
+
+int CurveTexture::get_width() const {
+
+ return _width;
+}
+
+void CurveTexture::ensure_default_setup(float p_min, float p_max) {
+ if (_curve.is_null()) {
+ Ref<Curve> curve = Ref<Curve>(memnew(Curve));
+ curve->add_point(Vector2(0, 1));
+ curve->add_point(Vector2(1, 1));
+ curve->set_min_value(p_min);
+ curve->set_max_value(p_max);
+ set_curve(curve);
+ // Min and max is 0..1 by default
+ }
+}
+
+void CurveTexture::set_curve(Ref<Curve> p_curve) {
+ if (_curve != p_curve) {
+ if (_curve.is_valid()) {
+ _curve->disconnect(CoreStringNames::get_singleton()->changed, this, "_update");
+ }
+ _curve = p_curve;
+ if (_curve.is_valid()) {
+ _curve->connect(CoreStringNames::get_singleton()->changed, this, "_update");
+ }
+ _update();
+ }
+}
+
+void CurveTexture::_update() {
+
+ PoolVector<uint8_t> data;
+ data.resize(_width * sizeof(float));
+
+ // The array is locked in that scope
+ {
+ PoolVector<uint8_t>::Write wd8 = data.write();
+ float *wd = (float *)wd8.ptr();
+
+ if (_curve.is_valid()) {
+ Curve &curve = **_curve;
+ for (int i = 0; i < _width; ++i) {
+ float t = i / static_cast<float>(_width);
+ wd[i] = curve.interpolate_baked(t);
+ }
+
+ } else {
+ for (int i = 0; i < _width; ++i) {
+ wd[i] = 0;
+ }
+ }
+ }
+
+ Ref<Image> image = memnew(Image(_width, 1, false, Image::FORMAT_RF, data));
+
+ VS::get_singleton()->texture_allocate(_texture, _width, 1, Image::FORMAT_RF, VS::TEXTURE_FLAG_FILTER);
+ VS::get_singleton()->texture_set_data(_texture, image);
+
+ emit_changed();
+}
+
+Ref<Curve> CurveTexture::get_curve() const {
+
+ return _curve;
+}
+
+RID CurveTexture::get_rid() const {
+
+ return _texture;
+}
+
+CurveTexture::CurveTexture() {
+ _width = 2048;
+ _texture = VS::get_singleton()->texture_create();
+}
+CurveTexture::~CurveTexture() {
+ VS::get_singleton()->free(_texture);
+}
+//////////////////
+
+//setter and getter names for property serialization
+#define COLOR_RAMP_GET_OFFSETS "get_offsets"
+#define COLOR_RAMP_GET_COLORS "get_colors"
+#define COLOR_RAMP_SET_OFFSETS "set_offsets"
+#define COLOR_RAMP_SET_COLORS "set_colors"
+
+GradientTexture::GradientTexture() {
+ update_pending = false;
+ width = 2048;
+
+ texture = VS::get_singleton()->texture_create();
+ _queue_update();
+}
+
+GradientTexture::~GradientTexture() {
+ VS::get_singleton()->free(texture);
+}
+
+void GradientTexture::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_gradient", "gradient"), &GradientTexture::set_gradient);
+ ClassDB::bind_method(D_METHOD("get_gradient"), &GradientTexture::get_gradient);
+
+ ClassDB::bind_method(D_METHOD("set_width", "width"), &GradientTexture::set_width);
+
+ ClassDB::bind_method(D_METHOD("_update"), &GradientTexture::_update);
+
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "gradient", PROPERTY_HINT_RESOURCE_TYPE, "Gradient"), "set_gradient", "get_gradient");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "width"), "set_width", "get_width");
+}
+
+void GradientTexture::set_gradient(Ref<Gradient> p_gradient) {
+ if (p_gradient == gradient)
+ return;
+ if (gradient.is_valid()) {
+ gradient->disconnect(CoreStringNames::get_singleton()->changed, this, "_update");
+ }
+ gradient = p_gradient;
+ if (gradient.is_valid()) {
+ gradient->connect(CoreStringNames::get_singleton()->changed, this, "_update");
+ }
+ _update();
+ emit_changed();
+}
+
+Ref<Gradient> GradientTexture::get_gradient() const {
+ return gradient;
+}
+
+void GradientTexture::_queue_update() {
+
+ if (update_pending)
+ return;
+
+ call_deferred("_update");
+}
+
+void GradientTexture::_update() {
+
+ if (gradient.is_null())
+ return;
+
+ update_pending = false;
+
+ PoolVector<uint8_t> data;
+ data.resize(width * 4);
+ {
+ PoolVector<uint8_t>::Write wd8 = data.write();
+ Gradient &g = **gradient;
+
+ for (int i = 0; i < width; i++) {
+
+ float ofs = float(i) / (width - 1);
+ Color color = g.get_color_at_offset(ofs);
+
+ wd8[i * 4 + 0] = uint8_t(CLAMP(color.r * 255.0, 0, 255));
+ wd8[i * 4 + 1] = uint8_t(CLAMP(color.g * 255.0, 0, 255));
+ wd8[i * 4 + 2] = uint8_t(CLAMP(color.b * 255.0, 0, 255));
+ wd8[i * 4 + 3] = uint8_t(CLAMP(color.a * 255.0, 0, 255));
+ }
+ }
+
+ Ref<Image> image = memnew(Image(width, 1, false, Image::FORMAT_RGBA8, data));
+
+ VS::get_singleton()->texture_allocate(texture, width, 1, Image::FORMAT_RGBA8, VS::TEXTURE_FLAG_FILTER);
+ VS::get_singleton()->texture_set_data(texture, image);
+
+ emit_changed();
+}
+
+void GradientTexture::set_width(int p_width) {
+
+ width = p_width;
+ _queue_update();
+}
+int GradientTexture::get_width() const {
+
+ return width;
+}
+
+Ref<Image> GradientTexture::get_data() const {
+ return VisualServer::get_singleton()->texture_get_data(texture);
+}
diff --git a/scene/resources/texture.h b/scene/resources/texture.h
index 0092fee836..6c20c71af0 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,9 +30,11 @@
#ifndef TEXTURE_H
#define TEXTURE_H
+#include "curve.h"
#include "io/resource_loader.h"
#include "math_2d.h"
#include "resource.h"
+#include "scene/resources/color_ramp.h"
#include "servers/visual_server.h"
/**
@@ -67,12 +70,12 @@ public:
virtual void set_flags(uint32_t p_flags) = 0;
virtual uint32_t get_flags() const = 0;
- virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) const;
- virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) const;
- 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 void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const;
+ virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const;
+ 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 Ref<Texture> &p_normal_map = Ref<Texture>(), bool p_clip_uv = true) 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(); }
+ virtual Ref<Image> get_data() const { return Ref<Image>(); }
Texture();
};
@@ -115,14 +118,14 @@ protected:
public:
void create(int p_width, int p_height, Image::Format p_format, uint32_t p_flags = FLAGS_DEFAULT);
- void create_from_image(const Image &p_image, uint32_t p_flags = FLAGS_DEFAULT);
+ void create_from_image(const Ref<Image> &p_image, uint32_t p_flags = FLAGS_DEFAULT);
void set_flags(uint32_t p_flags);
uint32_t get_flags() const;
Image::Format get_format() const;
void load(const String &p_path);
- void set_data(const Image &p_image);
- Image get_data() const;
+ void set_data(const Ref<Image> &p_image);
+ Ref<Image> get_data() const;
int get_width() const;
int get_height() const;
@@ -130,20 +133,15 @@ public:
virtual RID get_rid() const;
bool has_alpha() const;
- virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) const;
- virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) const;
- 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 void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const;
+ virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const;
+ 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 Ref<Texture> &p_normal_map = Ref<Texture>(), bool p_clip_uv = true) const;
void set_storage(Storage p_storage);
Storage get_storage() const;
void set_lossy_storage_quality(float p_lossy_storage_quality);
float get_lossy_storage_quality() const;
- void fix_alpha_edges();
- void premultiply_alpha();
- void normal_to_xy();
- void shrink_x2_and_keep_size();
-
void set_size_override(const Size2 &p_size);
virtual void set_path(const String &p_path, bool p_take_over = false);
@@ -171,10 +169,11 @@ public:
FORMAT_BIT_HAS_MIPMAPS = 1 << 23,
FORMAT_BIT_DETECT_3D = 1 << 24,
FORMAT_BIT_DETECT_SRGB = 1 << 25,
+ FORMAT_BIT_DETECT_NORMAL = 1 << 26,
};
private:
- Error _load_data(const String &p_path, int &tw, int &th, int &flags, Image &image, int p_size_limit = 0);
+ Error _load_data(const String &p_path, int &tw, int &th, int &flags, Ref<Image> &image, int p_size_limit = 0);
String path_to_file;
RID texture;
Image::Format format;
@@ -185,6 +184,7 @@ private:
static void _requested_3d(void *p_ud);
static void _requested_srgb(void *p_ud);
+ static void _requested_normal(void *p_ud);
protected:
static void _bind_methods();
@@ -194,6 +194,7 @@ public:
static TextureFormatRequestCallback request_3d_callback;
static TextureFormatRequestCallback request_srgb_callback;
+ static TextureFormatRequestCallback request_normal_callback;
uint32_t get_flags() const;
Image::Format get_format() const;
@@ -204,14 +205,14 @@ public:
int get_height() const;
virtual RID get_rid() const;
- virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) const;
- virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) const;
- 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 void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const;
+ virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const;
+ 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 Ref<Texture> &p_normal_map = Ref<Texture>(), bool p_clip_uv = true) const;
virtual bool has_alpha() const;
virtual void set_flags(uint32_t p_flags);
- virtual Image get_data() const;
+ virtual Ref<Image> get_data() const;
StreamTexture();
~StreamTexture();
@@ -230,7 +231,7 @@ VARIANT_ENUM_CAST(ImageTexture::Storage);
class AtlasTexture : public Texture {
GDCLASS(AtlasTexture, Texture);
- RES_BASE_EXTENSION("atex");
+ RES_BASE_EXTENSION("atlastex");
protected:
Ref<Texture> atlas;
@@ -258,9 +259,9 @@ public:
void set_margin(const Rect2 &p_margin);
Rect2 get_margin() const;
- virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) const;
- virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) const;
- 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 void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const;
+ virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const;
+ 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 Ref<Texture> &p_normal_map = Ref<Texture>(), bool p_clip_uv = true) const;
virtual bool get_rect_region(const Rect2 &p_rect, const Rect2 &p_src_rect, Rect2 &r_rect, Rect2 &r_src_rect) const;
AtlasTexture();
@@ -269,7 +270,7 @@ public:
class LargeTexture : public Texture {
GDCLASS(LargeTexture, Texture);
- RES_BASE_EXTENSION("ltex");
+ RES_BASE_EXTENSION("largetex");
protected:
struct Piece {
@@ -306,9 +307,9 @@ public:
Vector2 get_piece_offset(int p_idx) const;
Ref<Texture> get_piece_texture(int p_idx) const;
- virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) const;
- virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) const;
- 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 void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const;
+ virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const;
+ 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 Ref<Texture> &p_normal_map = Ref<Texture>(), bool p_clip_uv = true) const;
LargeTexture();
};
@@ -316,7 +317,7 @@ public:
class CubeMap : public Resource {
GDCLASS(CubeMap, Resource);
- RES_BASE_EXTENSION("cbm");
+ RES_BASE_EXTENSION("cubemap");
public:
enum Storage {
@@ -369,8 +370,8 @@ protected:
public:
void set_flags(uint32_t p_flags);
uint32_t get_flags() const;
- void set_side(Side p_side, const Image &p_image);
- Image get_side(Side p_side) const;
+ void set_side(Side p_side, const Ref<Image> &p_image);
+ Ref<Image> get_side(Side p_side) const;
Image::Format get_format() const;
int get_width() const;
@@ -390,10 +391,45 @@ public:
~CubeMap();
};
-VARIANT_ENUM_CAST(CubeMap::Flags);
-VARIANT_ENUM_CAST(CubeMap::Side);
-VARIANT_ENUM_CAST(CubeMap::Storage);
+VARIANT_ENUM_CAST(CubeMap::Flags)
+VARIANT_ENUM_CAST(CubeMap::Side)
+VARIANT_ENUM_CAST(CubeMap::Storage)
+
+class CurveTexture : public Texture {
+
+ GDCLASS(CurveTexture, Texture)
+ RES_BASE_EXTENSION("curvetex")
+
+private:
+ RID _texture;
+ Ref<Curve> _curve;
+ int _width;
+
+ void _update();
+protected:
+ static void _bind_methods();
+
+public:
+ void set_width(int p_width);
+ int get_width() const;
+
+ void ensure_default_setup(float p_min = 0, float p_max = 1);
+
+ void set_curve(Ref<Curve> p_curve);
+ Ref<Curve> get_curve() const;
+
+ virtual RID get_rid() const;
+
+ virtual int get_height() const { return 1; }
+ virtual bool has_alpha() const { return false; }
+
+ virtual void set_flags(uint32_t p_flags) {}
+ virtual uint32_t get_flags() const { return FLAG_FILTER; }
+
+ CurveTexture();
+ ~CurveTexture();
+};
/*
enum CubeMapSide {
@@ -408,4 +444,49 @@ VARIANT_ENUM_CAST(CubeMap::Storage);
*/
//VARIANT_ENUM_CAST( Texture::CubeMapSide );
+class GradientTexture : public Texture {
+ GDCLASS(GradientTexture, Texture)
+
+public:
+ struct Point {
+
+ float offset;
+ Color color;
+ bool operator<(const Point &p_ponit) const {
+ return offset < p_ponit.offset;
+ }
+ };
+
+private:
+ Ref<Gradient> gradient;
+ bool update_pending;
+ RID texture;
+ int width;
+
+ void _queue_update();
+ void _update();
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_gradient(Ref<Gradient> p_gradient);
+ Ref<Gradient> get_gradient() const;
+
+ void set_width(int p_width);
+ int get_width() const;
+
+ virtual RID get_rid() const { return texture; }
+ virtual int get_height() const { return 1; }
+ virtual bool has_alpha() const { return true; }
+
+ virtual void set_flags(uint32_t p_flags) {}
+ virtual uint32_t get_flags() const { return FLAG_FILTER; }
+
+ virtual Ref<Image> get_data() const;
+
+ GradientTexture();
+ virtual ~GradientTexture();
+};
+
#endif
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index c1ef3e8c1f..ac1bb105ac 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -628,21 +629,21 @@ void Theme::get_type_list(List<StringName> *p_list) const {
void Theme::_bind_methods() {
- 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("set_icon", "name", "type", "texture"), &Theme::set_icon);
+ ClassDB::bind_method(D_METHOD("get_icon", "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(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("set_stylebox", "name", "type", "texture"), &Theme::set_stylebox);
+ ClassDB::bind_method(D_METHOD("get_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(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("set_font", "name", "type", "font"), &Theme::set_font);
+ ClassDB::bind_method(D_METHOD("get_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);
@@ -882,7 +883,7 @@ RES ResourceFormatLoaderTheme::load(const String &p_path, const String &p_origin
ERR_FAIL_V(RES());
}
- sbflat->set_border_size(params[0].to_int());
+ sbflat->set_border_width_all(params[0].to_int());
if (!params[0].is_valid_integer()) {
@@ -928,8 +929,8 @@ RES ResourceFormatLoaderTheme::load(const String &p_path, const String &p_origin
dark = Color::html(params[3]);
}
- sbflat->set_dark_color(dark);
- sbflat->set_light_color(bright);
+ sbflat->set_border_color_all(bright);
+ // sbflat->set_dark_color(dark);
sbflat->set_bg_color(normal);
if (params.size() == ccodes + 5) {
diff --git a/scene/resources/theme.h b/scene/resources/theme.h
index 4de6fd78ca..5744c142d4 100644
--- a/scene/resources/theme.h
+++ b/scene/resources/theme.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -42,7 +43,7 @@
class Theme : public Resource {
GDCLASS(Theme, Resource);
- RES_BASE_EXTENSION("thm");
+ RES_BASE_EXTENSION("theme");
static Ref<Theme> default_theme;
@@ -142,8 +143,8 @@ public:
static void set_default(const Ref<Theme> &p_default);
static void set_default_icon(const Ref<Texture> &p_icon);
- static void set_default_style(const Ref<StyleBox> &p_default_style);
- static void set_default_font(const Ref<Font> &p_default_font);
+ static void set_default_style(const Ref<StyleBox> &p_style);
+ static void set_default_font(const Ref<Font> &p_font);
void set_default_theme_font(const Ref<Font> &p_default_font);
Ref<Font> get_default_theme_font() const;
@@ -158,7 +159,7 @@ public:
Ref<Shader> get_shader(const StringName &p_name, const StringName &p_type) const;
bool has_shader(const StringName &p_name, const StringName &p_type) const;
void clear_shader(const StringName &p_name, const StringName &p_type);
- void get_shader_list(const StringName &p_name, List<StringName> *p_list) const;
+ void get_shader_list(const StringName &p_type, List<StringName> *p_list) const;
void set_stylebox(const StringName &p_name, const StringName &p_type, const Ref<StyleBox> &p_style);
Ref<StyleBox> get_stylebox(const StringName &p_name, const StringName &p_type) const;
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 3e128379ae..44fe676ddc 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -44,18 +45,26 @@ bool TileSet::_set(const StringName &p_name, const Variant &p_value) {
tile_set_name(id, p_value);
else if (what == "texture")
tile_set_texture(id, p_value);
+ else if (what == "normal_map")
+ tile_set_normal_map(id, p_value);
else if (what == "tex_offset")
tile_set_texture_offset(id, p_value);
else if (what == "material")
tile_set_material(id, p_value);
else if (what == "modulate")
tile_set_modulate(id, p_value);
- else if (what == "shape_offset")
- tile_set_shape_offset(id, p_value);
else if (what == "region")
tile_set_region(id, p_value);
else if (what == "shape")
- tile_set_shape(id, p_value);
+ tile_set_shape(id, 0, p_value);
+ else if (what == "shape_offset") {
+ Transform2D xform = tile_get_shape_transform(id, 0);
+ xform.set_origin(p_value);
+ tile_set_shape_transform(id, 0, xform);
+ } else if (what == "shape_transform")
+ tile_set_shape_transform(id, 0, p_value);
+ else if (what == "shape_one_way")
+ tile_set_shape_one_way(id, 0, p_value);
else if (what == "shapes")
_tile_set_shapes(id, p_value);
else if (what == "occluder")
@@ -88,18 +97,24 @@ bool TileSet::_get(const StringName &p_name, Variant &r_ret) const {
r_ret = tile_get_name(id);
else if (what == "texture")
r_ret = tile_get_texture(id);
+ else if (what == "normal_map")
+ r_ret = tile_get_normal_map(id);
else if (what == "tex_offset")
r_ret = tile_get_texture_offset(id);
else if (what == "material")
r_ret = tile_get_material(id);
else if (what == "modulate")
r_ret = tile_get_modulate(id);
- else if (what == "shape_offset")
- r_ret = tile_get_shape_offset(id);
else if (what == "region")
r_ret = tile_get_region(id);
else if (what == "shape")
- r_ret = tile_get_shape(id);
+ r_ret = tile_get_shape(id, 0);
+ else if (what == "shape_offset")
+ r_ret = tile_get_shape_transform(id, 0).get_origin();
+ else if (what == "shape_transform")
+ r_ret = tile_get_shape_transform(id, 0);
+ else if (what == "shape_one_way")
+ r_ret = tile_get_shape_one_way(id, 0);
else if (what == "shapes")
r_ret = _tile_get_shapes(id);
else if (what == "occluder")
@@ -118,22 +133,25 @@ bool TileSet::_get(const StringName &p_name, Variant &r_ret) const {
void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
- for (Map<int, Data>::Element *E = tile_map.front(); E; E = E->next()) {
+ for (Map<int, TileData>::Element *E = tile_map.front(); E; E = E->next()) {
int id = E->key();
String pre = itos(id) + "/";
p_list->push_back(PropertyInfo(Variant::STRING, pre + "name"));
p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "tex_offset"));
- p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "material", PROPERTY_HINT_RESOURCE_TYPE, "CanvasItemMaterial"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial"));
p_list->push_back(PropertyInfo(Variant::COLOR, pre + "modulate"));
p_list->push_back(PropertyInfo(Variant::RECT2, pre + "region"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "occluder_offset"));
p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "occluder", PROPERTY_HINT_RESOURCE_TYPE, "OccluderPolygon2D"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "navigation_offset"));
p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "navigation", PROPERTY_HINT_RESOURCE_TYPE, "NavigationPolygon"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "shape_offset"));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "shape_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "shape_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape2D", PROPERTY_USAGE_EDITOR));
+ p_list->push_back(PropertyInfo(Variant::BOOL, pre + "shape_one_way", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "shapes", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR));
}
}
@@ -141,7 +159,7 @@ void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
void TileSet::create_tile(int p_id) {
ERR_FAIL_COND(tile_map.has(p_id));
- tile_map[p_id] = Data();
+ tile_map[p_id] = TileData();
_change_notify("");
emit_changed();
}
@@ -159,16 +177,29 @@ Ref<Texture> TileSet::tile_get_texture(int p_id) const {
return tile_map[p_id].texture;
}
-void TileSet::tile_set_material(int p_id, const Ref<CanvasItemMaterial> &p_material) {
+void TileSet::tile_set_normal_map(int p_id, const Ref<Texture> &p_normal_map) {
+
+ ERR_FAIL_COND(!tile_map.has(p_id));
+ tile_map[p_id].normal_map = p_normal_map;
+ emit_changed();
+}
+
+Ref<Texture> TileSet::tile_get_normal_map(int p_id) const {
+
+ ERR_FAIL_COND_V(!tile_map.has(p_id), Ref<Texture>());
+ return tile_map[p_id].normal_map;
+}
+
+void TileSet::tile_set_material(int p_id, const Ref<ShaderMaterial> &p_material) {
ERR_FAIL_COND(!tile_map.has(p_id));
tile_map[p_id].material = p_material;
emit_changed();
}
-Ref<CanvasItemMaterial> TileSet::tile_get_material(int p_id) const {
+Ref<ShaderMaterial> TileSet::tile_get_material(int p_id) const {
- ERR_FAIL_COND_V(!tile_map.has(p_id), Ref<CanvasItemMaterial>());
+ ERR_FAIL_COND_V(!tile_map.has(p_id), Ref<ShaderMaterial>());
return tile_map[p_id].material;
}
@@ -198,19 +229,6 @@ Vector2 TileSet::tile_get_texture_offset(int p_id) const {
return tile_map[p_id].offset;
}
-void TileSet::tile_set_shape_offset(int p_id, const Vector2 &p_offset) {
-
- ERR_FAIL_COND(!tile_map.has(p_id));
- tile_map[p_id].shape_offset = p_offset;
- emit_changed();
-}
-
-Vector2 TileSet::tile_get_shape_offset(int p_id) const {
-
- ERR_FAIL_COND_V(!tile_map.has(p_id), Vector2());
- return tile_map[p_id].shape_offset;
-}
-
void TileSet::tile_set_region(int p_id, const Rect2 &p_region) {
ERR_FAIL_COND(!tile_map.has(p_id));
@@ -237,23 +255,82 @@ String TileSet::tile_get_name(int p_id) const {
return tile_map[p_id].name;
}
-void TileSet::tile_set_shape(int p_id, const Ref<Shape2D> &p_shape) {
+void TileSet::tile_clear_shapes(int p_id) {
+ tile_map[p_id].shapes_data.clear();
+}
+
+void TileSet::tile_add_shape(int p_id, const Ref<Shape2D> &p_shape, const Transform2D &p_transform, bool p_one_way) {
ERR_FAIL_COND(!tile_map.has(p_id));
- tile_map[p_id].shapes.resize(1);
- tile_map[p_id].shapes[0] = p_shape;
+
+ ShapeData new_data = ShapeData();
+ new_data.shape = p_shape;
+ new_data.shape_transform = p_transform;
+ new_data.one_way_collision = p_one_way;
+
+ tile_map[p_id].shapes_data.push_back(new_data);
+};
+int TileSet::tile_get_shape_count(int p_id) const {
+
+ ERR_FAIL_COND_V(!tile_map.has(p_id), 0);
+
+ return tile_map[p_id].shapes_data.size();
+};
+
+void TileSet::tile_set_shape(int p_id, int p_shape_id, const Ref<Shape2D> &p_shape) {
+
+ ERR_FAIL_COND(!tile_map.has(p_id));
+ if (tile_map[p_id].shapes_data.size() <= p_shape_id)
+ tile_map[p_id].shapes_data.resize(p_shape_id + 1);
+ tile_map[p_id].shapes_data[p_shape_id].shape = p_shape;
emit_changed();
}
-Ref<Shape2D> TileSet::tile_get_shape(int p_id) const {
+Ref<Shape2D> TileSet::tile_get_shape(int p_id, int p_shape_id) const {
ERR_FAIL_COND_V(!tile_map.has(p_id), Ref<Shape2D>());
- if (tile_map[p_id].shapes.size() > 0)
- return tile_map[p_id].shapes[0];
+ if (tile_map[p_id].shapes_data.size() > p_shape_id)
+ return tile_map[p_id].shapes_data[p_shape_id].shape;
return Ref<Shape2D>();
}
+void TileSet::tile_set_shape_transform(int p_id, int p_shape_id, const Transform2D &p_offset) {
+
+ ERR_FAIL_COND(!tile_map.has(p_id));
+ if (tile_map[p_id].shapes_data.size() <= p_shape_id)
+ tile_map[p_id].shapes_data.resize(p_shape_id + 1);
+ tile_map[p_id].shapes_data[p_shape_id].shape_transform = p_offset;
+ emit_changed();
+}
+
+Transform2D TileSet::tile_get_shape_transform(int p_id, int p_shape_id) const {
+
+ ERR_FAIL_COND_V(!tile_map.has(p_id), Transform2D());
+ if (tile_map[p_id].shapes_data.size() > p_shape_id)
+ return tile_map[p_id].shapes_data[p_shape_id].shape_transform;
+
+ return Transform2D();
+}
+
+void TileSet::tile_set_shape_one_way(int p_id, int p_shape_id, const bool p_one_way) {
+
+ ERR_FAIL_COND(!tile_map.has(p_id));
+ if (tile_map[p_id].shapes_data.size() <= p_shape_id)
+ tile_map[p_id].shapes_data.resize(p_shape_id + 1);
+ tile_map[p_id].shapes_data[p_shape_id].one_way_collision = p_one_way;
+ emit_changed();
+}
+
+bool TileSet::tile_get_shape_one_way(int p_id, int p_shape_id) const {
+
+ ERR_FAIL_COND_V(!tile_map.has(p_id), false);
+ if (tile_map[p_id].shapes_data.size() > p_shape_id)
+ return tile_map[p_id].shapes_data[p_shape_id].one_way_collision;
+
+ return false;
+}
+
void TileSet::tile_set_light_occluder(int p_id, const Ref<OccluderPolygon2D> &p_light_occluder) {
ERR_FAIL_COND(!tile_map.has(p_id));
@@ -300,31 +377,65 @@ Vector2 TileSet::tile_get_occluder_offset(int p_id) const {
return tile_map[p_id].occluder_offset;
}
-void TileSet::tile_set_shapes(int p_id, const Vector<Ref<Shape2D> > &p_shapes) {
+void TileSet::tile_set_shapes(int p_id, const Vector<ShapeData> &p_shapes) {
ERR_FAIL_COND(!tile_map.has(p_id));
- tile_map[p_id].shapes = p_shapes;
+ tile_map[p_id].shapes_data = p_shapes;
emit_changed();
}
-Vector<Ref<Shape2D> > TileSet::tile_get_shapes(int p_id) const {
+Vector<TileSet::ShapeData> TileSet::tile_get_shapes(int p_id) const {
- ERR_FAIL_COND_V(!tile_map.has(p_id), Vector<Ref<Shape2D> >());
- return tile_map[p_id].shapes;
+ ERR_FAIL_COND_V(!tile_map.has(p_id), Vector<ShapeData>());
+
+ return tile_map[p_id].shapes_data;
}
void TileSet::_tile_set_shapes(int p_id, const Array &p_shapes) {
ERR_FAIL_COND(!tile_map.has(p_id));
- Vector<Ref<Shape2D> > shapes;
+ Vector<ShapeData> shapes_data;
+ Transform2D default_transform = tile_get_shape_transform(p_id, 0);
+ bool default_one_way = tile_get_shape_one_way(p_id, 0);
for (int i = 0; i < p_shapes.size(); i++) {
-
- Ref<Shape2D> s = p_shapes[i];
- if (s.is_valid())
- shapes.push_back(s);
+ ShapeData s = ShapeData();
+
+ if (p_shapes[i].get_type() == Variant::OBJECT) {
+ Ref<Shape2D> shape = p_shapes[i];
+ if (shape.is_null()) continue;
+
+ s.shape = shape;
+ s.shape_transform = default_transform;
+ s.one_way_collision = default_one_way;
+ } else if (p_shapes[i].get_type() == Variant::DICTIONARY) {
+ Dictionary d = p_shapes[i];
+
+ if (d.has("shape") && d["shape"].get_type() == Variant::OBJECT)
+ s.shape = d["shape"];
+ else
+ continue;
+
+ if (d.has("shape_transform") && d["shape_transform"].get_type() == Variant::TRANSFORM2D)
+ s.shape_transform = d["shape_transform"];
+ else if (d.has("shape_offset") && d["shape_offset"].get_type() == Variant::VECTOR2)
+ s.shape_transform = Transform2D(0, (Vector2)d["shape_offset"]);
+ else
+ s.shape_transform = default_transform;
+
+ if (d.has("one_way") && d["one_way"].get_type() == Variant::BOOL)
+ s.one_way_collision = d["one_way"];
+ else
+ s.one_way_collision = default_one_way;
+
+ } else {
+ ERR_EXPLAIN("Expected an array of objects or dictionaries for tile_set_shapes");
+ ERR_CONTINUE(true);
+ }
+
+ shapes_data.push_back(s);
}
- tile_set_shapes(p_id, shapes);
+ tile_map[p_id].shapes_data = shapes_data;
}
Array TileSet::_tile_get_shapes(int p_id) const {
@@ -332,9 +443,14 @@ Array TileSet::_tile_get_shapes(int p_id) const {
ERR_FAIL_COND_V(!tile_map.has(p_id), Array());
Array arr;
- Vector<Ref<Shape2D> > shp = tile_map[p_id].shapes;
- for (int i = 0; i < shp.size(); i++)
- arr.push_back(shp[i]);
+ Vector<ShapeData> data = tile_map[p_id].shapes_data;
+ for (int i = 0; i < data.size(); i++) {
+ Dictionary shape_data;
+ shape_data["shape"] = data[i].shape;
+ shape_data["shape_transform"] = data[i].shape_transform;
+ shape_data["one_way"] = data[i].one_way_collision;
+ arr.push_back(shape_data);
+ }
return arr;
}
@@ -343,7 +459,7 @@ Array TileSet::_get_tiles_ids() const {
Array arr;
- for (Map<int, Data>::Element *E = tile_map.front(); E; E = E->next()) {
+ for (Map<int, TileData>::Element *E = tile_map.front(); E; E = E->next()) {
arr.push_back(E->key());
}
@@ -352,7 +468,7 @@ Array TileSet::_get_tiles_ids() const {
void TileSet::get_tile_list(List<int> *p_tiles) const {
- for (Map<int, Data>::Element *E = tile_map.front(); E; E = E->next()) {
+ for (Map<int, TileData>::Element *E = tile_map.front(); E; E = E->next()) {
p_tiles->push_back(E->key());
}
@@ -381,7 +497,7 @@ int TileSet::get_last_unused_tile_id() const {
int TileSet::find_tile_by_name(const String &p_name) const {
- for (Map<int, Data>::Element *E = tile_map.front(); E; E = E->next()) {
+ for (Map<int, TileData>::Element *E = tile_map.front(); E; E = E->next()) {
if (p_name == E->get().name)
return E->key();
@@ -401,26 +517,32 @@ void TileSet::_bind_methods() {
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", "id", "texture"), &TileSet::tile_set_texture);
+ ClassDB::bind_method(D_METHOD("tile_get_texture", "id"), &TileSet::tile_get_texture);
+ ClassDB::bind_method(D_METHOD("tile_set_normal_map", "id", "normal_map"), &TileSet::tile_set_normal_map);
+ ClassDB::bind_method(D_METHOD("tile_get_normal_map", "id"), &TileSet::tile_get_normal_map);
+ ClassDB::bind_method(D_METHOD("tile_set_material", "id", "material"), &TileSet::tile_set_material);
+ ClassDB::bind_method(D_METHOD("tile_get_material", "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_shape", "id", "shape_id", "shape"), &TileSet::tile_set_shape);
+ ClassDB::bind_method(D_METHOD("tile_get_shape", "id", "shape_id"), &TileSet::tile_get_shape);
+ ClassDB::bind_method(D_METHOD("tile_set_shape_transform", "id", "shape_id", "shape_transform"), &TileSet::tile_set_shape_transform);
+ ClassDB::bind_method(D_METHOD("tile_get_shape_transform", "id", "shape_id"), &TileSet::tile_get_shape_transform);
+ ClassDB::bind_method(D_METHOD("tile_set_shape_one_way", "id", "shape_id", "one_way"), &TileSet::tile_set_shape_one_way);
+ ClassDB::bind_method(D_METHOD("tile_get_shape_one_way", "id", "shape_id"), &TileSet::tile_get_shape_one_way);
+ ClassDB::bind_method(D_METHOD("tile_add_shape", "id", "shape", "shape_transform", "one_way"), &TileSet::tile_add_shape, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("tile_get_shape_count", "id"), &TileSet::tile_get_shape_count);
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", "id", "navigation_polygon"), &TileSet::tile_set_navigation_polygon);
+ ClassDB::bind_method(D_METHOD("tile_get_navigation_polygon", "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_light_occluder", "id", "light_occluder"), &TileSet::tile_set_light_occluder);
+ ClassDB::bind_method(D_METHOD("tile_get_light_occluder", "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);
@@ -428,7 +550,7 @@ void TileSet::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("get_tiles_ids"), &TileSet::_get_tiles_ids);
}
TileSet::TileSet() {
diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h
index 53f68d00a5..7d7855811f 100644
--- a/scene/resources/tile_set.h
+++ b/scene/resources/tile_set.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -39,27 +40,39 @@ class TileSet : public Resource {
GDCLASS(TileSet, Resource);
- struct Data {
+public:
+ struct ShapeData {
+ Ref<Shape2D> shape;
+ Transform2D shape_transform;
+ bool one_way_collision;
+
+ ShapeData() {
+ one_way_collision = false;
+ }
+ };
+
+private:
+ struct TileData {
String name;
Ref<Texture> texture;
+ Ref<Texture> normal_map;
Vector2 offset;
- Vector2 shape_offset;
Rect2i region;
- Vector<Ref<Shape2D> > shapes;
+ Vector<ShapeData> shapes_data;
Vector2 occluder_offset;
Ref<OccluderPolygon2D> occluder;
Vector2 navigation_polygon_offset;
Ref<NavigationPolygon> navigation_polygon;
- Ref<CanvasItemMaterial> material;
+ Ref<ShaderMaterial> material;
Color modulate;
// Default modulate for back-compat
- explicit Data()
+ explicit TileData()
: modulate(1, 1, 1) {}
};
- Map<int, Data> tile_map;
+ Map<int, TileData> tile_map;
protected:
bool _set(const StringName &p_name, const Variant &p_value);
@@ -80,22 +93,35 @@ public:
void tile_set_texture(int p_id, const Ref<Texture> &p_texture);
Ref<Texture> tile_get_texture(int p_id) const;
+ void tile_set_normal_map(int p_id, const Ref<Texture> &p_normal_map);
+ Ref<Texture> tile_get_normal_map(int p_id) const;
+
void tile_set_texture_offset(int p_id, const Vector2 &p_offset);
Vector2 tile_get_texture_offset(int p_id) const;
- void tile_set_shape_offset(int p_id, const Vector2 &p_offset);
- Vector2 tile_get_shape_offset(int p_id) const;
-
void tile_set_region(int p_id, const Rect2 &p_region);
Rect2 tile_get_region(int p_id) const;
- void tile_set_shape(int p_id, const Ref<Shape2D> &p_shape);
- Ref<Shape2D> tile_get_shape(int p_id) const;
+ void tile_set_shape(int p_id, int p_shape_id, const Ref<Shape2D> &p_shape);
+ Ref<Shape2D> tile_get_shape(int p_id, int p_shape_id) const;
- void tile_set_material(int p_id, const Ref<CanvasItemMaterial> &p_material);
- Ref<CanvasItemMaterial> tile_get_material(int p_id) const;
+ void tile_set_shape_transform(int p_id, int p_shape_id, const Transform2D &p_offset);
+ Transform2D tile_get_shape_transform(int p_id, int p_shape_id) const;
- void tile_set_modulate(int p_id, const Color &p_color);
+ void tile_set_shape_one_way(int p_id, int p_shape_id, bool p_one_way);
+ bool tile_get_shape_one_way(int p_id, int p_shape_id) const;
+
+ void tile_clear_shapes(int p_id);
+ void tile_add_shape(int p_id, const Ref<Shape2D> &p_shape, const Transform2D &p_transform, bool p_one_way = false);
+ int tile_get_shape_count(int p_id) const;
+
+ void tile_set_shapes(int p_id, const Vector<ShapeData> &p_shapes);
+ Vector<ShapeData> tile_get_shapes(int p_id) const;
+
+ void tile_set_material(int p_id, const Ref<ShaderMaterial> &p_material);
+ Ref<ShaderMaterial> tile_get_material(int p_id) const;
+
+ void tile_set_modulate(int p_id, const Color &p_modulate);
Color tile_get_modulate(int p_id) const;
void tile_set_occluder_offset(int p_id, const Vector2 &p_offset);
@@ -110,9 +136,6 @@ public:
void tile_set_navigation_polygon(int p_id, const Ref<NavigationPolygon> &p_navigation_polygon);
Ref<NavigationPolygon> tile_get_navigation_polygon(int p_id) const;
- void tile_set_shapes(int p_id, const Vector<Ref<Shape2D> > &p_shapes);
- Vector<Ref<Shape2D> > tile_get_shapes(int p_id) const;
-
void remove_tile(int p_id);
bool has_tile(int p_id) const;
diff --git a/scene/resources/video_stream.cpp b/scene/resources/video_stream.cpp
index 47c40e4e6b..1b0e34b8db 100644
--- a/scene/resources/video_stream.cpp
+++ b/scene/resources/video_stream.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h
index 7c1bd94c8b..544973f581 100644
--- a/scene/resources/video_stream.h
+++ b/scene/resources/video_stream.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/scene/resources/world.cpp b/scene/resources/world.cpp
index dc62c2ab3e..b0d14125a0 100644
--- a/scene/resources/world.cpp
+++ b/scene/resources/world.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -279,19 +280,43 @@ Ref<Environment> World::get_environment() const {
return environment;
}
+void World::set_fallback_environment(const Ref<Environment> &p_environment) {
+
+ fallback_environment = p_environment;
+ if (fallback_environment.is_valid())
+ VS::get_singleton()->scenario_set_fallback_environment(scenario, p_environment->get_rid());
+ else
+ VS::get_singleton()->scenario_set_fallback_environment(scenario, RID());
+}
+
+Ref<Environment> World::get_fallback_environment() const {
+
+ return fallback_environment;
+}
+
PhysicsDirectSpaceState *World::get_direct_space_state() {
return PhysicsServer::get_singleton()->space_get_direct_state(space);
}
+void World::get_camera_list(List<Camera *> *r_cameras) {
+
+ for (Map<Camera *, SpatialIndexer::CameraData>::Element *E = indexer->cameras.front(); E; E = E->next()) {
+ r_cameras->push_back(E->key());
+ }
+}
+
void World::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("set_environment", "env"), &World::set_environment);
+ ClassDB::bind_method(D_METHOD("get_environment"), &World::get_environment);
+ ClassDB::bind_method(D_METHOD("set_fallback_environment", "env"), &World::set_fallback_environment);
+ ClassDB::bind_method(D_METHOD("get_fallback_environment"), &World::get_fallback_environment);
+ ClassDB::bind_method(D_METHOD("get_direct_space_state"), &World::get_direct_space_state);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "fallback_environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_fallback_environment", "get_fallback_environment");
}
World::World() {
diff --git a/scene/resources/world.h b/scene/resources/world.h
index a597633ca1..158086974c 100644
--- a/scene/resources/world.h
+++ b/scene/resources/world.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -40,13 +41,14 @@ class VisibilityNotifier;
class World : public Resource {
GDCLASS(World, Resource);
- RES_BASE_EXTENSION("wrd");
+ RES_BASE_EXTENSION("world");
private:
RID space;
RID scenario;
SpatialIndexer *indexer;
Ref<Environment> environment;
+ Ref<Environment> fallback_environment;
protected:
static void _bind_methods();
@@ -67,9 +69,15 @@ protected:
public:
RID get_space() const;
RID get_scenario() const;
+
void set_environment(const Ref<Environment> &p_environment);
Ref<Environment> get_environment() const;
+ void set_fallback_environment(const Ref<Environment> &p_environment);
+ Ref<Environment> get_fallback_environment() const;
+
+ void get_camera_list(List<Camera *> *r_cameras);
+
PhysicsDirectSpaceState *get_direct_space_state();
World();
diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp
index cb346199c9..2f43f903ba 100644
--- a/scene/resources/world_2d.cpp
+++ b/scene/resources/world_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,8 +31,7 @@
#include "servers/physics_2d_server.h"
#include "servers/visual_server.h"
//#include "servers/spatial_sound_2d_server.h"
-#include "global_config.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "scene/2d/camera_2d.h"
#include "scene/2d/visibility_notifier_2d.h"
#include "scene/main/viewport.h"
@@ -96,9 +96,9 @@ struct SpatialIndexer2D {
void _notifier_update_cells(VisibilityNotifier2D *p_notifier, const Rect2 &p_rect, bool p_add) {
- Point2i begin = p_rect.pos;
+ Point2i begin = p_rect.position;
begin /= cell_size;
- Point2i end = p_rect.pos + p_rect.size;
+ Point2i end = p_rect.position + p_rect.size;
end /= cell_size;
for (int i = begin.x; i <= end.x; i++) {
@@ -219,9 +219,9 @@ struct SpatialIndexer2D {
for (Map<Viewport *, ViewportData>::Element *E = viewports.front(); E; E = E->next()) {
- Point2i begin = E->get().rect.pos;
+ Point2i begin = E->get().rect.position;
begin /= cell_size;
- Point2i end = E->get().rect.pos + E->get().rect.size;
+ Point2i end = E->get().rect.position + E->get().rect.size;
end /= cell_size;
pass++;
List<VisibilityNotifier2D *> added;
@@ -359,18 +359,19 @@ RID World2D::get_space() {
return space;
}
-RID World2D::get_sound_space() {
+void World2D::get_viewport_list(List<Viewport *> *r_viewports) {
- return sound_space;
+ for (Map<Viewport *, SpatialIndexer2D::ViewportData>::Element *E = indexer->viewports.front(); E; E = E->next()) {
+ r_viewports->push_back(E->key());
+ }
}
void World2D::_bind_methods() {
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(D_METHOD("get_direct_space_state:Physics2DDirectSpaceState"), &World2D::get_direct_space_state);
+ ClassDB::bind_method(D_METHOD("get_direct_space_state"), &World2D::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 2bb5eb1526..f968b08a15 100644
--- a/scene/resources/world_2d.h
+++ b/scene/resources/world_2d.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,7 @@
#ifndef WORLD_2D_H
#define WORLD_2D_H
-#include "global_config.h"
+#include "project_settings.h"
#include "resource.h"
#include "servers/physics_2d_server.h"
@@ -43,7 +44,6 @@ class World2D : public Resource {
RID canvas;
RID space;
- RID sound_space;
SpatialIndexer2D *indexer;
@@ -65,10 +65,11 @@ protected:
public:
RID get_canvas();
RID get_space();
- RID get_sound_space();
Physics2DDirectSpaceState *get_direct_space_state();
+ void get_viewport_list(List<Viewport *> *r_viewports);
+
World2D();
~World2D();
};
diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp
index f0a33e0d3b..f247e7cde8 100644
--- a/scene/scene_string_names.cpp
+++ b/scene/scene_string_names.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,6 +33,9 @@ SceneStringNames *SceneStringNames::singleton = NULL;
SceneStringNames::SceneStringNames() {
+ _estimate_cost = StaticCString::create("_estimate_cost");
+ _compute_cost = StaticCString::create("_compute_cost");
+
resized = StaticCString::create("resized");
dot = StaticCString::create(".");
doubledot = StaticCString::create("..");
@@ -40,7 +44,7 @@ SceneStringNames::SceneStringNames() {
hide = StaticCString::create("hide");
visibility_changed = StaticCString::create("visibility_changed");
input_event = StaticCString::create("input_event");
- shader_shader = StaticCString::create("shader/shader");
+ shader = StaticCString::create("shader");
shader_unshaded = StaticCString::create("shader/unshaded");
shading_mode = StaticCString::create("shader/shading_mode");
tree_entered = StaticCString::create("tree_entered");
@@ -138,9 +142,9 @@ SceneStringNames::SceneStringNames() {
h_offset = StaticCString::create("h_offset");
v_offset = StaticCString::create("v_offset");
- transform_pos = StaticCString::create("transform/pos");
- transform_rot = StaticCString::create("transform/rot");
- transform_scale = StaticCString::create("transform/scale");
+ transform_pos = StaticCString::create("position");
+ transform_rot = StaticCString::create("rotation_deg");
+ transform_scale = StaticCString::create("scale");
_update_remote = StaticCString::create("_update_remote");
_update_pairs = StaticCString::create("_update_pairs");
@@ -154,8 +158,6 @@ SceneStringNames::SceneStringNames() {
line_separation = StaticCString::create("line_separation");
- play_play = StaticCString::create("play/play");
-
get_drag_data = StaticCString::create("get_drag_data");
drop_data = StaticCString::create("drop_data");
can_drop_data = StaticCString::create("can_drop_data");
diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h
index 8900bbe1d9..0b70cd36ff 100644
--- a/scene/scene_string_names.h
+++ b/scene/scene_string_names.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,7 @@
#ifndef SCENE_STRING_NAMES_H
#define SCENE_STRING_NAMES_H
-#include "path_db.h"
+#include "node_path.h"
#include "string_db.h"
class SceneStringNames {
@@ -49,6 +50,9 @@ class SceneStringNames {
public:
_FORCE_INLINE_ static SceneStringNames *get_singleton() { return singleton; }
+ StringName _estimate_cost;
+ StringName _compute_cost;
+
StringName resized;
StringName dot;
StringName doubledot;
@@ -60,7 +64,7 @@ public:
StringName gui_input;
StringName _gui_input;
StringName item_rect_changed;
- StringName shader_shader;
+ StringName shader;
StringName shader_unshaded;
StringName shading_mode;
StringName tree_entered;
@@ -169,8 +173,6 @@ public:
StringName _get_minimum_size;
- StringName play_play;
-
StringName _im_update;
StringName _queue_update;
diff --git a/servers/SCsub b/servers/SCsub
index eefa6278c4..df55010a36 100644
--- a/servers/SCsub
+++ b/servers/SCsub
@@ -7,12 +7,11 @@ env.add_source_files(env.servers_sources, "*.cpp")
Export('env')
+SConscript('arvr/SCsub')
SConscript('physics/SCsub')
SConscript('physics_2d/SCsub')
SConscript('visual/SCsub')
SConscript('audio/SCsub')
-SConscript('spatial_sound/SCsub')
-SConscript('spatial_sound_2d/SCsub')
lib = env.Library("servers", env.servers_sources)
diff --git a/modules/cscript/SCsub b/servers/arvr/SCsub
index 0882406761..ccc76e823f 100644
--- a/modules/cscript/SCsub
+++ b/servers/arvr/SCsub
@@ -2,6 +2,6 @@
Import('env')
-env.add_source_files(env.modules_sources, "*.cpp")
+env.add_source_files(env.servers_sources, "*.cpp")
Export('env')
diff --git a/servers/arvr/arvr_interface.cpp b/servers/arvr/arvr_interface.cpp
new file mode 100644
index 0000000000..81eb011932
--- /dev/null
+++ b/servers/arvr/arvr_interface.cpp
@@ -0,0 +1,82 @@
+/*************************************************************************/
+/* arvr_interface.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "arvr_interface.h"
+
+void ARVRInterface::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("get_name"), &ARVRInterface::get_name);
+
+ ClassDB::bind_method(D_METHOD("is_primary"), &ARVRInterface::is_primary);
+ ClassDB::bind_method(D_METHOD("set_is_primary", "enable"), &ARVRInterface::set_is_primary);
+
+ ClassDB::bind_method(D_METHOD("is_installed"), &ARVRInterface::is_installed);
+ ClassDB::bind_method(D_METHOD("hmd_is_present"), &ARVRInterface::hmd_is_present);
+ ClassDB::bind_method(D_METHOD("supports_hmd"), &ARVRInterface::supports_hmd);
+ ClassDB::bind_method(D_METHOD("is_initialized"), &ARVRInterface::is_initialized);
+ ClassDB::bind_method(D_METHOD("initialize"), &ARVRInterface::initialize);
+ ClassDB::bind_method(D_METHOD("uninitialize"), &ARVRInterface::uninitialize);
+
+ ClassDB::bind_method(D_METHOD("get_recommended_render_targetsize"), &ARVRInterface::get_recommended_render_targetsize);
+
+ // These are now purely used internally, we may expose them again if we expose CameraMatrix through Variant but reduz is not a fan for good reasons :)
+ // ClassDB::bind_method(D_METHOD("get_transform_for_eye", "eye", "cam_transform"), &ARVRInterface::get_transform_for_eye);
+ // ClassDB::bind_method(D_METHOD("get_projection_for_eye", "eye"), &ARVRInterface::get_projection_for_eye);
+ // ClassDB::bind_method(D_METHOD("commit_for_eye", "node:viewport"), &ARVRInterface::commit_for_eye);
+
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "primary"), "set_is_primary", "is_primary");
+
+ BIND_CONSTANT(EYE_MONO);
+ BIND_CONSTANT(EYE_LEFT);
+ BIND_CONSTANT(EYE_RIGHT);
+};
+
+StringName ARVRInterface::get_name() const {
+ return "Unknown";
+};
+
+bool ARVRInterface::is_primary() {
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL_V(arvr_server, false);
+
+ return arvr_server->get_primary_interface() == this;
+};
+
+void ARVRInterface::set_is_primary(bool p_is_primary) {
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL(arvr_server);
+
+ if (p_is_primary) {
+ ERR_FAIL_COND(!is_initialized());
+ ERR_FAIL_COND(!supports_hmd());
+
+ arvr_server->set_primary_interface(this);
+ } else {
+ arvr_server->clear_primary_interface_if(this);
+ };
+};
diff --git a/servers/arvr/arvr_interface.h b/servers/arvr/arvr_interface.h
new file mode 100644
index 0000000000..e405499fbb
--- /dev/null
+++ b/servers/arvr/arvr_interface.h
@@ -0,0 +1,89 @@
+/*************************************************************************/
+/* arvr_interface.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 ARVR_INTERFACE_H
+#define ARVR_INTERFACE_H
+
+#include "core/math/camera_matrix.h"
+#include "os/thread_safe.h"
+#include "scene/main/viewport.h"
+#include "servers/arvr_server.h"
+
+/**
+ @author Bastiaan Olij <mux213@gmail.com>
+
+ The ARVR interface is a template class ontop of which we build interface to differt AR, VR and tracking SDKs.
+ The idea is that we subclass this class, implement the logic, and then instantiate a singleton of each interface
+ when Godot starts. These instances do not initialize themselves but register themselves with the AR/VR server.
+
+ If the user wants to enable AR/VR the choose the interface they want to use and initialize it.
+
+ Note that we may make this into a fully instantiable class for GDNative support.
+*/
+
+class ARVRInterface : public Reference {
+ GDCLASS(ARVRInterface, Reference);
+
+protected:
+ _THREAD_SAFE_CLASS_
+
+ static void _bind_methods();
+
+public:
+ enum Eyes {
+ EYE_MONO, /* my son says we should call this EYE_CYCLOPS */
+ EYE_LEFT,
+ EYE_RIGHT
+ };
+
+ virtual StringName get_name() const;
+
+ bool is_primary();
+ void set_is_primary(bool p_is_primary);
+
+ virtual bool is_installed() = 0; /* returns true if the middle ware related to this interface has been installed */
+ virtual bool hmd_is_present() = 0; /* returns true if our HMD is connected */
+ virtual bool supports_hmd() = 0; /* returns true is this interface handles output to an HMD or only handles positioning */
+
+ virtual bool is_initialized() = 0; /* returns true if we've initialized this interface */
+ virtual bool initialize() = 0; /* initialize this interface, if this has an HMD it becomes the primary interface */
+ virtual void uninitialize() = 0; /* deinitialize this interface */
+
+ virtual Size2 get_recommended_render_targetsize() = 0; /* returns the recommended render target size per eye for this device */
+ virtual bool is_stereo() = 0; /* returns true if this interface requires stereo rendering (for VR HMDs) or mono rendering (for mobile AR) */
+ virtual Transform get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform) = 0; /* get each eyes camera transform, also implement EYE_MONO */
+ virtual CameraMatrix get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far) = 0; /* get each eyes projection matrix */
+ virtual void commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect) = 0; /* output the left or right eye */
+
+ virtual void process() = 0;
+};
+
+VARIANT_ENUM_CAST(ARVRInterface::Eyes);
+
+#endif
diff --git a/servers/arvr/arvr_positional_tracker.cpp b/servers/arvr/arvr_positional_tracker.cpp
new file mode 100644
index 0000000000..9f3d01267b
--- /dev/null
+++ b/servers/arvr/arvr_positional_tracker.cpp
@@ -0,0 +1,171 @@
+/*************************************************************************/
+/* arvr_postional_tracker.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "arvr_positional_tracker.h"
+#include "core/os/input.h"
+
+void ARVRPositionalTracker::_bind_methods() {
+ // this class is read only from GDScript, so we only have access to getters..
+ ClassDB::bind_method(D_METHOD("get_type"), &ARVRPositionalTracker::get_type);
+ ClassDB::bind_method(D_METHOD("get_name"), &ARVRPositionalTracker::get_name);
+ ClassDB::bind_method(D_METHOD("get_joy_id"), &ARVRPositionalTracker::get_joy_id);
+ ClassDB::bind_method(D_METHOD("get_tracks_orientation"), &ARVRPositionalTracker::get_tracks_orientation);
+ ClassDB::bind_method(D_METHOD("get_orientation"), &ARVRPositionalTracker::get_orientation);
+ ClassDB::bind_method(D_METHOD("get_tracks_position"), &ARVRPositionalTracker::get_tracks_position);
+ ClassDB::bind_method(D_METHOD("get_position"), &ARVRPositionalTracker::get_position);
+ ClassDB::bind_method(D_METHOD("get_transform", "adjust_by_reference_frame"), &ARVRPositionalTracker::get_transform);
+
+ // these functions we don't want to expose to normal users but do need to be callable from GDNative
+ ClassDB::bind_method(D_METHOD("_set_type", "type"), &ARVRPositionalTracker::set_type);
+ ClassDB::bind_method(D_METHOD("_set_name", "name"), &ARVRPositionalTracker::set_name);
+ ClassDB::bind_method(D_METHOD("_set_joy_id", "joy_id"), &ARVRPositionalTracker::set_joy_id);
+ ClassDB::bind_method(D_METHOD("_set_orientation", "orientation"), &ARVRPositionalTracker::set_orientation);
+ ClassDB::bind_method(D_METHOD("_set_rw_position", "rw_position"), &ARVRPositionalTracker::set_rw_position);
+};
+
+void ARVRPositionalTracker::set_type(ARVRServer::TrackerType p_type) {
+ if (type != p_type) {
+ type = p_type;
+
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL(arvr_server);
+
+ // get a tracker id for our type
+ tracker_id = arvr_server->get_free_tracker_id_for_type(p_type);
+ }
+};
+
+ARVRServer::TrackerType ARVRPositionalTracker::get_type() const {
+ return type;
+};
+
+void ARVRPositionalTracker::set_name(const String p_name) {
+ name = p_name;
+};
+
+StringName ARVRPositionalTracker::get_name() const {
+ return name;
+};
+
+int ARVRPositionalTracker::get_tracker_id() const {
+ return tracker_id;
+};
+
+void ARVRPositionalTracker::set_joy_id(int p_joy_id) {
+ joy_id = p_joy_id;
+};
+
+int ARVRPositionalTracker::get_joy_id() const {
+ return joy_id;
+};
+
+bool ARVRPositionalTracker::get_tracks_orientation() const {
+ return tracks_orientation;
+};
+
+void ARVRPositionalTracker::set_orientation(const Basis &p_orientation) {
+ _THREAD_SAFE_METHOD_
+
+ tracks_orientation = true; // obviously we have this
+ orientation = p_orientation;
+};
+
+Basis ARVRPositionalTracker::get_orientation() const {
+ _THREAD_SAFE_METHOD_
+
+ return orientation;
+};
+
+bool ARVRPositionalTracker::get_tracks_position() const {
+ return tracks_position;
+};
+
+void ARVRPositionalTracker::set_position(const Vector3 &p_position) {
+ _THREAD_SAFE_METHOD_
+
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL(arvr_server);
+ real_t world_scale = arvr_server->get_world_scale();
+ ERR_FAIL_COND(world_scale == 0);
+
+ tracks_position = true; // obviously we have this
+ rw_position = p_position / world_scale;
+};
+
+Vector3 ARVRPositionalTracker::get_position() const {
+ _THREAD_SAFE_METHOD_
+
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL_V(arvr_server, rw_position);
+ real_t world_scale = arvr_server->get_world_scale();
+
+ return rw_position * world_scale;
+};
+
+void ARVRPositionalTracker::set_rw_position(const Vector3 &p_rw_position) {
+ _THREAD_SAFE_METHOD_
+
+ tracks_position = true; // obviously we have this
+ rw_position = p_rw_position;
+};
+
+Vector3 ARVRPositionalTracker::get_rw_position() const {
+ _THREAD_SAFE_METHOD_
+
+ return rw_position;
+};
+
+Transform ARVRPositionalTracker::get_transform(bool p_adjust_by_reference_frame) const {
+ Transform new_transform;
+
+ new_transform.basis = get_orientation();
+ new_transform.origin = get_position();
+
+ if (p_adjust_by_reference_frame) {
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ ERR_FAIL_NULL_V(arvr_server, new_transform);
+
+ new_transform = arvr_server->get_reference_frame() * new_transform;
+ };
+
+ return new_transform;
+};
+
+ARVRPositionalTracker::ARVRPositionalTracker() {
+ type = ARVRServer::TRACKER_UNKNOWN;
+ name = "Unknown";
+ joy_id = -1;
+ tracker_id = 0;
+ tracks_orientation = false;
+ tracks_position = false;
+};
+
+ARVRPositionalTracker::~ARVRPositionalTracker(){
+
+};
diff --git a/servers/arvr/arvr_positional_tracker.h b/servers/arvr/arvr_positional_tracker.h
new file mode 100644
index 0000000000..dba203b73c
--- /dev/null
+++ b/servers/arvr/arvr_positional_tracker.h
@@ -0,0 +1,87 @@
+/*************************************************************************/
+/* arvr_positional_tracker.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 ARVR_POSITIONAL_TRACKER_H
+#define ARVR_POSITIONAL_TRACKER_H
+
+#include "os/thread_safe.h"
+#include "servers/arvr_server.h"
+
+/**
+ @author Bastiaan Olij <mux213@gmail.com>
+
+ The positional tracker object as an object that represents the position and orientation of a tracked object like a controller or headset.
+ An AR/VR Interface will registered the trackers it manages with our AR/VR server and update its position and orientation.
+ This is where potentially additional AR/VR interfaces may be active as there are AR/VR SDKs that solely deal with positional tracking.
+
+ @TODO:
+ - create subclass of spatial node that uses one of our positional trackers to automatically determine its position
+*/
+
+class ARVRPositionalTracker : public Object {
+ GDCLASS(ARVRPositionalTracker, Object);
+ _THREAD_SAFE_CLASS_
+
+private:
+ ARVRServer::TrackerType type; // type of tracker
+ StringName name; // (unique) name of the tracker
+ int tracker_id; // tracker index id that is unique per type
+ int joy_id; // if we also have a related joystick entity, the id of the joystick
+ bool tracks_orientation; // do we track orientation?
+ Basis orientation; // our orientation
+ bool tracks_position; // do we track position?
+ Vector3 rw_position; // our position "in the real world, so without world_scale applied"
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_type(ARVRServer::TrackerType p_type);
+ ARVRServer::TrackerType get_type() const;
+ void set_name(const String p_name);
+ StringName get_name() const;
+ int get_tracker_id() const;
+ void set_joy_id(int p_joy_id);
+ int get_joy_id() const;
+ bool get_tracks_orientation() const;
+ void set_orientation(const Basis &p_orientation);
+ Basis get_orientation() const;
+ bool get_tracks_position() const;
+ void set_position(const Vector3 &p_position); // set position with world_scale applied
+ Vector3 get_position() const; // get position with world_scale applied
+ void set_rw_position(const Vector3 &p_rw_position);
+ Vector3 get_rw_position() const;
+
+ Transform get_transform(bool p_adjust_by_reference_frame) const;
+
+ ARVRPositionalTracker();
+ ~ARVRPositionalTracker();
+};
+
+#endif
diff --git a/servers/arvr/arvr_script_interface.cpp b/servers/arvr/arvr_script_interface.cpp
new file mode 100644
index 0000000000..16e607920e
--- /dev/null
+++ b/servers/arvr/arvr_script_interface.cpp
@@ -0,0 +1,127 @@
+#include "arvr_script_interface.h"
+
+ARVRScriptInterface::ARVRScriptInterface() {
+ // testing
+ printf("Construct script interface");
+}
+
+ARVRScriptInterface::~ARVRScriptInterface() {
+ if (is_initialized()) {
+ uninitialize();
+ };
+
+ // testing
+ printf("Destruct script interface");
+}
+
+StringName ARVRScriptInterface::get_name() const {
+ if (get_script_instance() && get_script_instance()->has_method("get_name")) {
+ return get_script_instance()->call("get_name");
+ } else {
+ // just return something for now
+ return "ARVR Script interface";
+ }
+}
+
+bool ARVRScriptInterface::is_installed() {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("is_installed")), false);
+ return get_script_instance()->call("is_installed");
+}
+
+bool ARVRScriptInterface::hmd_is_present() {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("hmd_is_present")), false);
+ return get_script_instance()->call("hmd_is_present");
+}
+
+bool ARVRScriptInterface::supports_hmd() {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("supports_hmd")), false);
+ return get_script_instance()->call("supports_hmd");
+}
+
+bool ARVRScriptInterface::is_stereo() {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("is_stereo")), false);
+ return get_script_instance()->call("is_stereo");
+}
+
+bool ARVRScriptInterface::is_initialized() {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("is_initialized")), false);
+ return get_script_instance()->call("is_initialized");
+}
+
+bool ARVRScriptInterface::initialize() {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("initialize")), false);
+ return get_script_instance()->call("initialize");
+}
+
+void ARVRScriptInterface::uninitialize() {
+ ARVRServer *arvr_server = ARVRServer::get_singleton();
+ if (arvr_server != NULL) {
+ // Whatever happens, make sure this is no longer our primary interface
+ arvr_server->clear_primary_interface_if(this);
+ }
+
+ ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("uninitialize")));
+ get_script_instance()->call("uninitialize");
+}
+
+Size2 ARVRScriptInterface::get_recommended_render_targetsize() {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_recommended_render_targetsize")), Size2());
+ return get_script_instance()->call("get_recommended_render_targetsize");
+}
+
+Transform ARVRScriptInterface::get_transform_for_eye(Eyes p_eye, const Transform &p_cam_transform) {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_transform_for_eye")), Transform());
+ return get_script_instance()->call("get_transform_for_eye", p_eye, p_cam_transform);
+}
+
+// Suggestion from Reduz, as we can't return a CameraMatrix, return a PoolVector with our 16 floats
+PoolVector<float> ARVRScriptInterface::_get_projection_for_eye(Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far) {
+ ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("_get_projection_for_eye")), PoolVector<float>());
+ return get_script_instance()->call("_get_projection_for_eye", p_eye, p_aspect, p_z_near, p_z_far);
+}
+
+CameraMatrix ARVRScriptInterface::get_projection_for_eye(Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far) {
+ CameraMatrix cm;
+ int i = 0;
+ int j = 0;
+
+ PoolVector<float> cm_as_floats = _get_projection_for_eye(p_eye, p_aspect, p_z_near, p_z_far);
+
+ for (int k = 0; k < cm_as_floats.size() && i < 4; k++) {
+ cm.matrix[i][j] = cm_as_floats[k];
+ j++;
+ if (j == 4) {
+ j = 0;
+ i++;
+ };
+ };
+
+ return cm;
+}
+
+void ARVRScriptInterface::commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect) {
+ ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("commit_for_eye")));
+ get_script_instance()->call("commit_for_eye");
+}
+
+void ARVRScriptInterface::process() {
+ ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("process")));
+ get_script_instance()->call("process");
+}
+
+void ARVRScriptInterface::_bind_methods() {
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "is_installed"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "hmd_is_present"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "supports_hmd"));
+
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "is_initialized"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "initialize"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo("uninitialize"));
+
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "is_stereo"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::VECTOR2, "get_recommended_render_targetsize"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::TRANSFORM, "get_transform_for_eye", PropertyInfo(Variant::INT, "eye"), PropertyInfo(Variant::TRANSFORM, "cam_transform")));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo("_get_projection_for_eye"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo("commit_for_eye", PropertyInfo(Variant::INT, "eye"), PropertyInfo(Variant::_RID, "render_target")));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo("process"));
+}
diff --git a/servers/arvr/arvr_script_interface.h b/servers/arvr/arvr_script_interface.h
new file mode 100644
index 0000000000..04ca33901a
--- /dev/null
+++ b/servers/arvr/arvr_script_interface.h
@@ -0,0 +1,47 @@
+#ifndef SCRIPT_INTERFACE_H
+#define SCRIPT_INTERFACE_H
+
+#include "arvr_interface.h"
+
+/**
+ @authors Hinsbart & Karroffel
+
+ This subclass of our AR/VR interface forms a bridge to GDNative.
+*/
+
+class ARVRScriptInterface : public ARVRInterface {
+ GDCLASS(ARVRScriptInterface, ARVRInterface);
+
+protected:
+ static void _bind_methods();
+
+public:
+ ARVRScriptInterface();
+ ~ARVRScriptInterface();
+
+ virtual StringName get_name() const;
+
+ virtual bool is_installed();
+ virtual bool hmd_is_present();
+ virtual bool supports_hmd();
+
+ virtual bool is_initialized();
+ virtual bool initialize();
+ virtual void uninitialize();
+
+ virtual Size2 get_recommended_render_targetsize();
+ virtual bool is_stereo();
+ virtual Transform get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform);
+
+ // we expose a PoolVector<float> version of this function to GDNative
+ PoolVector<float> _get_projection_for_eye(Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far);
+
+ // and a CameraMatrix version to ARVRServer
+ virtual CameraMatrix get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far);
+
+ virtual void commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect);
+
+ virtual void process();
+};
+
+#endif // SCRIPT_INTERFACE_H
diff --git a/servers/arvr_server.cpp b/servers/arvr_server.cpp
new file mode 100644
index 0000000000..6398d87007
--- /dev/null
+++ b/servers/arvr_server.cpp
@@ -0,0 +1,313 @@
+/*************************************************************************/
+/* arvr_server.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "arvr_server.h"
+#include "arvr/arvr_interface.h"
+#include "arvr/arvr_positional_tracker.h"
+#include "project_settings.h"
+
+ARVRServer *ARVRServer::singleton = NULL;
+
+ARVRServer *ARVRServer::get_singleton() {
+ return singleton;
+};
+
+void ARVRServer::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("get_world_scale"), &ARVRServer::get_world_scale);
+ ClassDB::bind_method(D_METHOD("set_world_scale"), &ARVRServer::set_world_scale);
+ ClassDB::bind_method(D_METHOD("get_reference_frame"), &ARVRServer::get_reference_frame);
+ ClassDB::bind_method(D_METHOD("request_reference_frame", "ignore_tilt", "keep_height"), &ARVRServer::request_reference_frame);
+
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "world_scale"), "set_world_scale", "get_world_scale");
+
+ ClassDB::bind_method(D_METHOD("get_interface_count"), &ARVRServer::get_interface_count);
+ ClassDB::bind_method(D_METHOD("get_interface", "idx"), &ARVRServer::get_interface);
+ ClassDB::bind_method(D_METHOD("find_interface", "name"), &ARVRServer::find_interface);
+ ClassDB::bind_method(D_METHOD("get_tracker_count"), &ARVRServer::get_tracker_count);
+ ClassDB::bind_method(D_METHOD("get_tracker", "idx"), &ARVRServer::get_tracker);
+
+ ClassDB::bind_method(D_METHOD("set_primary_interface"), &ARVRServer::set_primary_interface);
+
+ ClassDB::bind_method(D_METHOD("add_interface"), &ARVRServer::add_interface);
+ ClassDB::bind_method(D_METHOD("remove_interface"), &ARVRServer::remove_interface);
+
+ BIND_CONSTANT(TRACKER_CONTROLLER);
+ BIND_CONSTANT(TRACKER_BASESTATION);
+ BIND_CONSTANT(TRACKER_ANCHOR);
+ BIND_CONSTANT(TRACKER_UNKNOWN);
+ BIND_CONSTANT(TRACKER_ANY_KNOWN);
+ BIND_CONSTANT(TRACKER_ANY);
+
+ ADD_SIGNAL(MethodInfo("interface_added", PropertyInfo(Variant::STRING, "name")));
+ ADD_SIGNAL(MethodInfo("interface_removed", PropertyInfo(Variant::STRING, "name")));
+
+ ADD_SIGNAL(MethodInfo("tracker_added", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::INT, "type")));
+ ADD_SIGNAL(MethodInfo("tracker_removed", PropertyInfo(Variant::STRING, "name")));
+};
+
+real_t ARVRServer::get_world_scale() const {
+ return world_scale;
+};
+
+void ARVRServer::set_world_scale(real_t p_world_scale) {
+ if (world_scale < 0.01) {
+ world_scale = 0.01;
+ } else if (world_scale > 1000.0) {
+ world_scale = 1000.0;
+ };
+
+ world_scale = p_world_scale;
+};
+
+Transform ARVRServer::get_world_origin() const {
+ return world_origin;
+};
+
+void ARVRServer::set_world_origin(const Transform p_world_origin) {
+ world_origin = p_world_origin;
+};
+
+Transform ARVRServer::get_reference_frame() const {
+ return reference_frame;
+};
+
+void ARVRServer::request_reference_frame(bool p_ignore_tilt, bool p_keep_height) {
+ if (primary_interface != NULL) {
+ // clear our current reference frame or we'll end up double adjusting it
+ reference_frame = Transform();
+
+ // requesting our EYE_MONO transform should return our current HMD position
+ Transform new_reference_frame = primary_interface->get_transform_for_eye(ARVRInterface::EYE_MONO, Transform());
+
+ // remove our tilt
+ if (p_ignore_tilt) {
+ // take the Y out of our Z
+ new_reference_frame.basis.set_axis(2, Vector3(new_reference_frame.basis.elements[0][2], 0.0, new_reference_frame.basis.elements[2][2]).normalized());
+
+ // Y is straight up
+ new_reference_frame.basis.set_axis(1, Vector3(0.0, 1.0, 0.0));
+
+ // and X is our cross reference
+ new_reference_frame.basis.set_axis(0, new_reference_frame.basis.get_axis(1).cross(new_reference_frame.basis.get_axis(2)).normalized());
+ };
+
+ // don't negate our height
+ if (p_keep_height) {
+ new_reference_frame.origin.y = 0.0;
+ };
+
+ reference_frame = new_reference_frame.inverse();
+ };
+};
+
+void ARVRServer::add_interface(const Ref<ARVRInterface> &p_interface) {
+ ERR_FAIL_COND(p_interface.is_null());
+
+ int idx = -1;
+ for (int i = 0; i < interfaces.size(); i++) {
+
+ if (interfaces[i] == p_interface) {
+ ERR_PRINT("Interface was already added");
+ return;
+ };
+ };
+
+ print_line("Registered interface " + p_interface->get_name());
+
+ interfaces.push_back(p_interface);
+ emit_signal("interface_added", p_interface->get_name());
+};
+
+void ARVRServer::remove_interface(const Ref<ARVRInterface> &p_interface) {
+ ERR_FAIL_COND(p_interface.is_null());
+
+ int idx = -1;
+ for (int i = 0; i < interfaces.size(); i++) {
+
+ if (interfaces[i] == p_interface) {
+
+ idx = i;
+ break;
+ };
+ };
+
+ ERR_FAIL_COND(idx == -1);
+
+ print_line("Removed interface" + p_interface->get_name());
+
+ emit_signal("interface_removed", p_interface->get_name());
+ interfaces.remove(idx);
+};
+
+int ARVRServer::get_interface_count() const {
+ return interfaces.size();
+};
+
+Ref<ARVRInterface> ARVRServer::get_interface(int p_index) const {
+ ERR_FAIL_INDEX_V(p_index, interfaces.size(), NULL);
+
+ return interfaces[p_index];
+};
+
+Ref<ARVRInterface> ARVRServer::find_interface(const String &p_name) const {
+ int idx = -1;
+ for (int i = 0; i < interfaces.size(); i++) {
+
+ if (interfaces[i]->get_name() == p_name) {
+
+ idx = i;
+ break;
+ };
+ };
+
+ ERR_FAIL_COND_V(idx == -1, NULL);
+
+ return interfaces[idx];
+};
+
+/*
+ A little extra info on the tracker ids, these are unique per tracker type so we get soem consistency in recognising our trackers, specifically controllers.
+
+ The first controller that is turned of will get ID 1, the second will get ID 2, etc.
+ The magic happens when one of the controllers is turned off, say controller 1 turns off, controller 2 will remain controller 2, controller 3 will remain controller 3.
+ If controller number 1 is turned on again it again gets ID 1 unless another new controller was turned on since.
+
+ The most likely scenario however is a controller that runs out of battery and another controller being used to replace it.
+ Because the controllers are often linked to physical objects, say you're holding a shield in controller 1, your left hand, and a gun in controller 2, your right hand, and controller 1 dies:
+ - using our tracker index would suddenly make the gun disappear and the shield jump into your right hand because controller 2 becomes controller 1.
+ - using this approach the shield disappears or is no longer tracked, but the gun stays firmly in your right hand because that is still controller 2, further more, if controller 1 is replaced the shield will return.
+*/
+
+bool ARVRServer::is_tracker_id_in_use_for_type(TrackerType p_tracker_type, int p_tracker_id) const {
+ for (int i = 0; i < trackers.size(); i++) {
+ if (trackers[i]->get_type() == p_tracker_type && trackers[i]->get_tracker_id() == p_tracker_id) {
+ return true;
+ };
+ };
+
+ // all good
+ return false;
+};
+
+int ARVRServer::get_free_tracker_id_for_type(TrackerType p_tracker_type) {
+ // we start checking at 1, 0 means that it's not a controller..
+ int tracker_id = 1;
+
+ while (is_tracker_id_in_use_for_type(p_tracker_type, tracker_id)) {
+ // try the next one
+ tracker_id++;
+ };
+
+ return tracker_id;
+};
+
+void ARVRServer::add_tracker(ARVRPositionalTracker *p_tracker) {
+ ERR_FAIL_NULL(p_tracker);
+
+ trackers.push_back(p_tracker);
+ emit_signal("tracker_added", p_tracker->get_name(), p_tracker->get_type());
+};
+
+void ARVRServer::remove_tracker(ARVRPositionalTracker *p_tracker) {
+ ERR_FAIL_NULL(p_tracker);
+
+ int idx = -1;
+ for (int i = 0; i < trackers.size(); i++) {
+
+ if (trackers[i] == p_tracker) {
+
+ idx = i;
+ break;
+ };
+ };
+
+ ERR_FAIL_COND(idx == -1);
+
+ emit_signal("tracker_removed", p_tracker->get_name());
+ trackers.remove(idx);
+};
+
+int ARVRServer::get_tracker_count() const {
+ return trackers.size();
+};
+
+ARVRPositionalTracker *ARVRServer::get_tracker(int p_index) const {
+ ERR_FAIL_INDEX_V(p_index, trackers.size(), NULL);
+
+ return trackers[p_index];
+};
+
+ARVRPositionalTracker *ARVRServer::find_by_type_and_id(TrackerType p_tracker_type, int p_tracker_id) const {
+ ERR_FAIL_COND_V(p_tracker_id == 0, NULL);
+
+ for (int i = 0; i < trackers.size(); i++) {
+ if (trackers[i]->get_type() == p_tracker_type && trackers[i]->get_tracker_id() == p_tracker_id) {
+ return trackers[i];
+ };
+ };
+
+ return NULL;
+};
+
+Ref<ARVRInterface> ARVRServer::get_primary_interface() const {
+ return primary_interface;
+};
+
+void ARVRServer::set_primary_interface(const Ref<ARVRInterface> &p_primary_interface) {
+ primary_interface = p_primary_interface;
+
+ print_line("Primary interface set to: " + primary_interface->get_name());
+};
+
+void ARVRServer::clear_primary_interface_if(const Ref<ARVRInterface> &p_primary_interface) {
+ if (primary_interface == p_primary_interface) {
+ print_line("Clearing primary interface");
+ primary_interface.unref();
+ };
+};
+
+ARVRServer::ARVRServer() {
+ singleton = this;
+ world_scale = 1.0;
+};
+
+ARVRServer::~ARVRServer() {
+ primary_interface.unref();
+
+ while (interfaces.size() > 0) {
+ interfaces.remove(0);
+ }
+
+ while (trackers.size() > 0) {
+ trackers.remove(0);
+ }
+
+ singleton = NULL;
+};
diff --git a/servers/arvr_server.h b/servers/arvr_server.h
new file mode 100644
index 0000000000..06e0a4561c
--- /dev/null
+++ b/servers/arvr_server.h
@@ -0,0 +1,167 @@
+/*************************************************************************/
+/* arvr_server.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 ARVR_SERVER_H
+#define ARVR_SERVER_H
+
+#include "os/thread_safe.h"
+#include "reference.h"
+#include "rid.h"
+#include "variant.h"
+
+class ARVRInterface;
+class ARVRPositionalTracker;
+
+/**
+ @author Bastiaan Olij <mux213@gmail.com>
+
+ The ARVR server is a singleton object that gives access to the various
+ objects and SDKs that are available on the system.
+ Because there can be multiple SDKs active this is exposed as an array
+ and our ARVR server object acts as a pass through
+ Also each positioning tracker is accessible from here.
+
+ I've added some additional info into this header file that should move
+ into the documention, I will do so when we're close to accepting this PR
+ or as a separate PR once this has been merged into the master branch.
+**/
+
+class ARVRServer : public Object {
+ GDCLASS(ARVRServer, Object);
+ _THREAD_SAFE_CLASS_
+
+public:
+ enum TrackerType {
+ TRACKER_CONTROLLER = 0x01, /* tracks a controller */
+ TRACKER_BASESTATION = 0x02, /* tracks location of a base station */
+ TRACKER_ANCHOR = 0x04, /* tracks an anchor point, used in AR to track a real live location */
+ TRACKER_UNKNOWN = 0x80, /* unknown tracker */
+
+ TRACKER_ANY_KNOWN = 0x7f, /* all except unknown */
+ TRACKER_ANY = 0xff /* used by get_connected_trackers to return all types */
+ };
+
+private:
+ Vector<Ref<ARVRInterface> > interfaces;
+ Vector<ARVRPositionalTracker *> trackers;
+
+ Ref<ARVRInterface> primary_interface; /* we'll identify one interface as primary, this will be used by our viewports */
+
+ real_t world_scale; /* scale by which we multiply our tracker positions */
+ Transform world_origin; /* our world origin point, maps a location in our virtual world to the origin point in our real world tracking volume */
+ Transform reference_frame; /* our reference frame */
+
+ bool is_tracker_id_in_use_for_type(TrackerType p_tracker_type, int p_tracker_id) const;
+
+protected:
+ static ARVRServer *singleton;
+
+ static void _bind_methods();
+
+public:
+ static ARVRServer *get_singleton();
+
+ /*
+ World scale allows you to specify a scale factor that is applied to all positioning vectors in our VR world in essence scaling up, or scaling down the world.
+ For stereoscopic rendering specifically this is very important to give an accurate sense of scale.
+ Add controllers into the mix and an accurate mapping of real world movement to percieved virtual movement becomes very important.
+
+ Most VR platforms, and our assumption, is that 1 unit in our virtual world equates to 1 meter in the real mode.
+ This scale basically effects the unit size relationship to real world size.
+
+ I may remove access to this property in GDScript in favour of exposing it on the ARVROrigin node
+ */
+ real_t get_world_scale() const;
+ void set_world_scale(real_t p_world_scale);
+
+ /*
+ The world maps the 0,0,0 coordinate of our real world coordinate system for our tracking volume to a location in our
+ virtual world. It is this origin point that should be moved when the player is moved through the world by controller
+ actions be it straffing, teleporting, etc. Movement of the player by moving through the physical space is always tracked
+ in relation to this point.
+
+ Note that the ARVROrigin spatial node in your scene automatically updates this property and it should be used instead of
+ direct access to this property and it therefor is not available in GDScript
+
+ Note: this should not be used in AR and should be ignored by an AR based interface as it would throw what you're looking at in the real world
+ and in the virtual world out of sync
+ */
+ Transform get_world_origin() const;
+ void set_world_origin(const Transform p_world_origin);
+
+ /*
+ Requesting a reference frame results in a matrix being calculated that ensures the HMD is positioned to 0,0,0 facing 0,0,-1 (need to verify this direction)
+ in the virtual world.
+
+ Note: this should not be used in AR and should be ignored by an AR based interface as it would throw what you're looking at in the real world
+ and in the virtual world out of sync
+ */
+ Transform get_reference_frame() const;
+ void request_reference_frame(bool p_ignore_tilt, bool p_keep_height);
+
+ /*
+ Interfaces are objects that 'glue' Godot to an AR or VR SDK such as the Oculus SDK, OpenVR, OpenHMD, etc.
+ */
+ void add_interface(const Ref<ARVRInterface> &p_interface);
+ void remove_interface(const Ref<ARVRInterface> &p_interface);
+ int get_interface_count() const;
+ Ref<ARVRInterface> get_interface(int p_index) const;
+ Ref<ARVRInterface> find_interface(const String &p_name) const;
+
+ /*
+ note, more then one interface can technically be active, especially on mobile, but only one interface is used for
+ rendering. This interface identifies itself by calling set_primary_interface when it is initialized
+ */
+ Ref<ARVRInterface> get_primary_interface() const;
+ void set_primary_interface(const Ref<ARVRInterface> &p_primary_interface);
+ void clear_primary_interface_if(const Ref<ARVRInterface> &p_primary_interface); /* this is automatically called if an interface destructs */
+
+ /*
+ Our trackers are objects that expose the orientation and position of physical devices such as controller, anchor points, etc.
+ They are created and managed by our active AR/VR interfaces.
+
+ Note that for trackers that
+ */
+ int get_free_tracker_id_for_type(TrackerType p_tracker_type);
+ void add_tracker(ARVRPositionalTracker *p_tracker);
+ void remove_tracker(ARVRPositionalTracker *p_tracker);
+ int get_tracker_count() const;
+ ARVRPositionalTracker *get_tracker(int p_index) const;
+ ARVRPositionalTracker *find_by_type_and_id(TrackerType p_tracker_type, int p_tracker_id) const;
+
+ ARVRServer();
+ ~ARVRServer();
+};
+
+#define ARVR ARVRServer
+
+VARIANT_ENUM_CAST(ARVRServer::TrackerType);
+
+#endif
diff --git a/servers/audio/audio_driver_dummy.cpp b/servers/audio/audio_driver_dummy.cpp
index e3022225a3..0f15b43b41 100644
--- a/servers/audio/audio_driver_dummy.cpp
+++ b/servers/audio/audio_driver_dummy.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,8 +29,8 @@
/*************************************************************************/
#include "audio_driver_dummy.h"
-#include "global_config.h"
#include "os/os.h"
+#include "project_settings.h"
Error AudioDriverDummy::init() {
diff --git a/servers/audio/audio_driver_dummy.h b/servers/audio/audio_driver_dummy.h
index 02f6a5407c..eadac44c5a 100644
--- a/servers/audio/audio_driver_dummy.h
+++ b/servers/audio/audio_driver_dummy.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/audio_effect.cpp b/servers/audio/audio_effect.cpp
index bb1179134c..edb79adb60 100644
--- a/servers/audio/audio_effect.cpp
+++ b/servers/audio/audio_effect.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/audio_effect.h b/servers/audio/audio_effect.h
index 6981cf0db7..570b2025b1 100644
--- a/servers/audio/audio_effect.h
+++ b/servers/audio/audio_effect.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/audio_filter_sw.cpp b/servers/audio/audio_filter_sw.cpp
index 4bfe31247b..4bf1cebf12 100644
--- a/servers/audio/audio_filter_sw.cpp
+++ b/servers/audio/audio_filter_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -241,28 +242,49 @@ AudioFilterSW::Processor::Processor() {
set_filter(NULL);
}
-void AudioFilterSW::Processor::set_filter(AudioFilterSW *p_filter) {
+void AudioFilterSW::Processor::set_filter(AudioFilterSW *p_filter, bool p_clear_history) {
- ha1 = ha2 = hb1 = hb2 = 0;
+ if (p_clear_history) {
+ ha1 = ha2 = hb1 = hb2 = 0;
+ }
filter = p_filter;
}
-void AudioFilterSW::Processor::update_coeffs() {
+void AudioFilterSW::Processor::update_coeffs(int p_interp_buffer_len) {
if (!filter)
return;
- filter->prepare_coefficients(&coeffs);
+ if (p_interp_buffer_len) { //interpolate
+ Coeffs old_coeffs = coeffs;
+ filter->prepare_coefficients(&coeffs);
+ incr_coeffs.a1 = (coeffs.a1 - old_coeffs.a1) / p_interp_buffer_len;
+ incr_coeffs.a2 = (coeffs.a2 - old_coeffs.a2) / p_interp_buffer_len;
+ incr_coeffs.b0 = (coeffs.b0 - old_coeffs.b0) / p_interp_buffer_len;
+ incr_coeffs.b1 = (coeffs.b1 - old_coeffs.b1) / p_interp_buffer_len;
+ incr_coeffs.b2 = (coeffs.b2 - old_coeffs.b2) / p_interp_buffer_len;
+ coeffs = old_coeffs;
+ } else {
+ filter->prepare_coefficients(&coeffs);
+ }
}
-void AudioFilterSW::Processor::process(float *p_samples, int p_amount, int p_stride) {
+void AudioFilterSW::Processor::process(float *p_samples, int p_amount, int p_stride, bool p_interpolate) {
if (!filter)
return;
- for (int i = 0; i < p_amount; i++) {
+ if (p_interpolate) {
+ for (int i = 0; i < p_amount; i++) {
+
+ process_one_interp(*p_samples);
+ p_samples += p_stride;
+ }
+ } else {
+ for (int i = 0; i < p_amount; i++) {
- process_one(*p_samples);
- p_samples += p_stride;
+ process_one(*p_samples);
+ p_samples += p_stride;
+ }
}
}
diff --git a/servers/audio/audio_filter_sw.h b/servers/audio/audio_filter_sw.h
index bbd006e525..caf735436a 100644
--- a/servers/audio/audio_filter_sw.h
+++ b/servers/audio/audio_filter_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -59,11 +60,14 @@ public:
AudioFilterSW *filter;
Coeffs coeffs;
float ha1, ha2, hb1, hb2; //history
+ Coeffs incr_coeffs;
+
public:
- void set_filter(AudioFilterSW *p_filter);
- void process(float *p_samples, int p_amount, int p_stride = 1);
- void update_coeffs();
+ void set_filter(AudioFilterSW *p_filter, bool p_clear_history = true);
+ void process(float *p_samples, int p_amount, int p_stride = 1, bool p_interpolate = false);
+ void update_coeffs(int p_interp_buffer_len = 0);
_ALWAYS_INLINE_ void process_one(float &p_sample);
+ _ALWAYS_INLINE_ void process_one_interp(float &p_sample);
Processor();
};
@@ -93,14 +97,30 @@ public:
/* inline methods */
-void AudioFilterSW::Processor::process_one(float &p_val) {
+void AudioFilterSW::Processor::process_one(float &p_sample) {
+
+ float pre = p_sample;
+ p_sample = (p_sample * coeffs.b0 + hb1 * coeffs.b1 + hb2 * coeffs.b2 + ha1 * coeffs.a1 + ha2 * coeffs.a2);
+ ha2 = ha1;
+ hb2 = hb1;
+ hb1 = pre;
+ ha1 = p_sample;
+}
+
+void AudioFilterSW::Processor::process_one_interp(float &p_sample) {
- float pre = p_val;
- p_val = (p_val * coeffs.b0 + hb1 * coeffs.b1 + hb2 * coeffs.b2 + ha1 * coeffs.a1 + ha2 * coeffs.a2);
+ float pre = p_sample;
+ p_sample = (p_sample * coeffs.b0 + hb1 * coeffs.b1 + hb2 * coeffs.b2 + ha1 * coeffs.a1 + ha2 * coeffs.a2);
ha2 = ha1;
hb2 = hb1;
hb1 = pre;
- ha1 = p_val;
+ ha1 = p_sample;
+
+ coeffs.b0 += incr_coeffs.b0;
+ coeffs.b1 += incr_coeffs.b1;
+ coeffs.b2 += incr_coeffs.b2;
+ coeffs.a1 += incr_coeffs.a1;
+ coeffs.a2 += incr_coeffs.a2;
}
#endif // AUDIO_FILTER_SW_H
diff --git a/servers/audio/audio_rb_resampler.cpp b/servers/audio/audio_rb_resampler.cpp
index bf10f813a2..a5d0a53be6 100644
--- a/servers/audio/audio_rb_resampler.cpp
+++ b/servers/audio/audio_rb_resampler.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/audio_rb_resampler.h b/servers/audio/audio_rb_resampler.h
index d775aed0d9..a906f1bb20 100644
--- a/servers/audio/audio_rb_resampler.h
+++ b/servers/audio/audio_rb_resampler.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp
index 5f77eb54f6..aa498cccad 100644
--- a/servers/audio/audio_stream.cpp
+++ b/servers/audio/audio_stream.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -80,3 +81,134 @@ void AudioStreamPlaybackResampled::mix(AudioFrame *p_buffer, float p_rate_scale,
}
}
}
+////////////////////////////////
+
+void AudioStreamRandomPitch::set_audio_stream(const Ref<AudioStream> &p_audio_stream) {
+
+ audio_stream = p_audio_stream;
+ if (audio_stream.is_valid()) {
+ for (Set<AudioStreamPlaybackRandomPitch *>::Element *E = playbacks.front(); E; E = E->next()) {
+ E->get()->playback = audio_stream->instance_playback();
+ }
+ }
+}
+
+Ref<AudioStream> AudioStreamRandomPitch::get_audio_stream() const {
+
+ return audio_stream;
+}
+
+void AudioStreamRandomPitch::set_random_pitch(float p_pitch) {
+
+ if (p_pitch < 1)
+ p_pitch = 1;
+ random_pitch = p_pitch;
+}
+
+float AudioStreamRandomPitch::get_random_pitch() const {
+ return random_pitch;
+}
+
+Ref<AudioStreamPlayback> AudioStreamRandomPitch::instance_playback() {
+ Ref<AudioStreamPlaybackRandomPitch> playback;
+ playback.instance();
+ if (audio_stream.is_valid())
+ playback->playback = audio_stream->instance_playback();
+
+ playbacks.insert(playback.ptr());
+ playback->random_pitch = Ref<AudioStreamRandomPitch>((AudioStreamRandomPitch *)this);
+ return playback;
+}
+
+String AudioStreamRandomPitch::get_stream_name() const {
+
+ if (audio_stream.is_valid()) {
+ return "Random: " + audio_stream->get_name();
+ }
+ return "RandomPitch";
+}
+
+void AudioStreamRandomPitch::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_audio_stream", "stream"), &AudioStreamRandomPitch::set_audio_stream);
+ ClassDB::bind_method(D_METHOD("get_audio_stream"), &AudioStreamRandomPitch::get_audio_stream);
+
+ ClassDB::bind_method(D_METHOD("set_random_pitch", "scale"), &AudioStreamRandomPitch::set_random_pitch);
+ ClassDB::bind_method(D_METHOD("get_random_pitch"), &AudioStreamRandomPitch::get_random_pitch);
+
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "audio_stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_audio_stream", "get_audio_stream");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "random_pitch", PROPERTY_HINT_RANGE, "1,16,0.01"), "set_random_pitch", "get_random_pitch");
+}
+
+AudioStreamRandomPitch::AudioStreamRandomPitch() {
+ random_pitch = 1.1;
+}
+
+void AudioStreamPlaybackRandomPitch::start(float p_from_pos) {
+ playing = playback;
+ float range_from = 1.0 / random_pitch->random_pitch;
+ float range_to = random_pitch->random_pitch;
+
+ pitch_scale = range_from + Math::randf() * (range_to - range_from);
+
+ if (playing.is_valid()) {
+ playing->start(p_from_pos);
+ }
+}
+
+void AudioStreamPlaybackRandomPitch::stop() {
+ if (playing.is_valid()) {
+ playing->stop();
+ ;
+ }
+}
+bool AudioStreamPlaybackRandomPitch::is_playing() const {
+ if (playing.is_valid()) {
+ return playing->is_playing();
+ }
+
+ return false;
+}
+
+int AudioStreamPlaybackRandomPitch::get_loop_count() const {
+ if (playing.is_valid()) {
+ return playing->get_loop_count();
+ }
+
+ return 0;
+}
+
+float AudioStreamPlaybackRandomPitch::get_pos() const {
+ if (playing.is_valid()) {
+ return playing->get_pos();
+ }
+
+ return 0;
+}
+void AudioStreamPlaybackRandomPitch::seek_pos(float p_time) {
+ if (playing.is_valid()) {
+ playing->seek_pos(p_time);
+ }
+}
+
+void AudioStreamPlaybackRandomPitch::mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames) {
+ if (playing.is_valid()) {
+ playing->mix(p_bufer, p_rate_scale * pitch_scale, p_frames);
+ } else {
+ for (int i = 0; i < p_frames; i++) {
+ p_bufer[i] = AudioFrame(0, 0);
+ }
+ }
+}
+
+float AudioStreamPlaybackRandomPitch::get_length() const {
+ if (playing.is_valid()) {
+ return playing->get_length();
+ }
+
+ return 0;
+}
+
+AudioStreamPlaybackRandomPitch::~AudioStreamPlaybackRandomPitch() {
+ random_pitch->playbacks.erase(this);
+}
diff --git a/servers/audio/audio_stream.h b/servers/audio/audio_stream.h
index 0d7b4adbfe..0d63e7af82 100644
--- a/servers/audio/audio_stream.h
+++ b/servers/audio/audio_stream.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,6 +31,7 @@
#define AUDIO_STREAM_H
#include "resource.h"
+#include "servers/audio/audio_filter_sw.h"
#include "servers/audio_server.h"
class AudioStreamPlayback : public Reference {
@@ -72,7 +74,7 @@ protected:
virtual float get_stream_sampling_rate() = 0;
public:
- virtual void mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames);
+ virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames);
AudioStreamPlaybackResampled() { mix_offset = 0; }
};
@@ -87,4 +89,58 @@ public:
virtual String get_stream_name() const = 0;
};
+class AudioStreamPlaybackRandomPitch;
+
+class AudioStreamRandomPitch : public AudioStream {
+
+ GDCLASS(AudioStreamRandomPitch, AudioStream)
+ friend class AudioStreamPlaybackRandomPitch;
+
+ Set<AudioStreamPlaybackRandomPitch *> playbacks;
+ Ref<AudioStream> audio_stream;
+ float random_pitch;
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_audio_stream(const Ref<AudioStream> &p_audio_stream);
+ Ref<AudioStream> get_audio_stream() const;
+
+ void set_random_pitch(float p_pitch);
+ float get_random_pitch() const;
+
+ virtual Ref<AudioStreamPlayback> instance_playback();
+ virtual String get_stream_name() const;
+
+ AudioStreamRandomPitch();
+};
+
+class AudioStreamPlaybackRandomPitch : public AudioStreamPlayback {
+
+ GDCLASS(AudioStreamPlaybackRandomPitch, AudioStreamPlayback)
+ friend class AudioStreamRandomPitch;
+
+ Ref<AudioStreamRandomPitch> random_pitch;
+ Ref<AudioStreamPlayback> playback;
+ Ref<AudioStreamPlayback> playing;
+ float pitch_scale;
+
+public:
+ virtual void start(float p_from_pos = 0.0);
+ virtual void stop();
+ virtual bool is_playing() const;
+
+ virtual int get_loop_count() const; //times it looped
+
+ virtual float get_pos() const;
+ virtual void seek_pos(float p_time);
+
+ virtual void mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames);
+
+ virtual float get_length() const; //if supported, otherwise return 0
+
+ ~AudioStreamPlaybackRandomPitch();
+};
+
#endif // AUDIO_STREAM_H
diff --git a/servers/audio/effects/audio_effect_amplify.cpp b/servers/audio/effects/audio_effect_amplify.cpp
index 6a4d03e517..91d1e84182 100644
--- a/servers/audio/effects/audio_effect_amplify.cpp
+++ b/servers/audio/effects/audio_effect_amplify.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_amplify.h b/servers/audio/effects/audio_effect_amplify.h
index 0c75b43691..bba9e352b2 100644
--- a/servers/audio/effects/audio_effect_amplify.h
+++ b/servers/audio/effects/audio_effect_amplify.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_chorus.cpp b/servers/audio/effects/audio_effect_chorus.cpp
index 27b03351c8..8fb7ef2cd0 100644
--- a/servers/audio/effects/audio_effect_chorus.cpp
+++ b/servers/audio/effects/audio_effect_chorus.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_chorus.h b/servers/audio/effects/audio_effect_chorus.h
index 9af9ab1b9a..5db335e288 100644
--- a/servers/audio/effects/audio_effect_chorus.h
+++ b/servers/audio/effects/audio_effect_chorus.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_compressor.cpp b/servers/audio/effects/audio_effect_compressor.cpp
index 8b67353229..491e6ecc81 100644
--- a/servers/audio/effects/audio_effect_compressor.cpp
+++ b/servers/audio/effects/audio_effect_compressor.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,7 +32,7 @@
void AudioEffectCompressorInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) {
- float treshold = Math::db2linear(base->treshold);
+ float threshold = Math::db2linear(base->threshold);
float sample_rate = AudioServer::get_singleton()->get_mix_rate();
float ratatcoef = exp(-1 / (0.00001f * sample_rate));
@@ -65,7 +66,7 @@ void AudioEffectCompressorInstance::process(const AudioFrame *p_src_frames, Audi
float peak = MAX(s.l, s.r);
- float overdb = 2.08136898f * Math::linear2db(peak / treshold);
+ float overdb = 2.08136898f * Math::linear2db(peak / threshold);
if (overdb < 0.0) //we only care about what goes over to compress
overdb = 0.0;
@@ -124,14 +125,14 @@ Ref<AudioEffectInstance> AudioEffectCompressor::instance() {
return ins;
}
-void AudioEffectCompressor::set_treshold(float p_treshold) {
+void AudioEffectCompressor::set_threshold(float p_threshold) {
- treshold = p_treshold;
+ threshold = p_threshold;
}
-float AudioEffectCompressor::get_treshold() const {
+float AudioEffectCompressor::get_threshold() const {
- return treshold;
+ return threshold;
}
void AudioEffectCompressor::set_ratio(float p_ratio) {
@@ -207,8 +208,8 @@ void AudioEffectCompressor::_validate_property(PropertyInfo &property) const {
void AudioEffectCompressor::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_treshold", "treshold"), &AudioEffectCompressor::set_treshold);
- ClassDB::bind_method(D_METHOD("get_treshold"), &AudioEffectCompressor::get_treshold);
+ ClassDB::bind_method(D_METHOD("set_threshold", "threshold"), &AudioEffectCompressor::set_threshold);
+ ClassDB::bind_method(D_METHOD("get_threshold"), &AudioEffectCompressor::get_threshold);
ClassDB::bind_method(D_METHOD("set_ratio", "ratio"), &AudioEffectCompressor::set_ratio);
ClassDB::bind_method(D_METHOD("get_ratio"), &AudioEffectCompressor::get_ratio);
@@ -228,7 +229,7 @@ void AudioEffectCompressor::_bind_methods() {
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"), "set_treshold", "get_treshold");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "threshold", PROPERTY_HINT_RANGE, "-60,0,0.1"), "set_threshold", "get_threshold");
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");
@@ -238,7 +239,7 @@ void AudioEffectCompressor::_bind_methods() {
}
AudioEffectCompressor::AudioEffectCompressor() {
- treshold = 0;
+ threshold = 0;
ratio = 4;
gain = 0;
attack_us = 20;
diff --git a/servers/audio/effects/audio_effect_compressor.h b/servers/audio/effects/audio_effect_compressor.h
index 34f80348db..550302056c 100644
--- a/servers/audio/effects/audio_effect_compressor.h
+++ b/servers/audio/effects/audio_effect_compressor.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -50,7 +51,7 @@ class AudioEffectCompressor : public AudioEffect {
GDCLASS(AudioEffectCompressor, AudioEffect)
friend class AudioEffectCompressorInstance;
- float treshold;
+ float threshold;
float ratio;
float gain;
float attack_us;
@@ -65,8 +66,8 @@ protected:
public:
Ref<AudioEffectInstance> instance();
- void set_treshold(float p_treshold);
- float get_treshold() const;
+ void set_threshold(float p_threshold);
+ float get_threshold() const;
void set_ratio(float p_ratio);
float get_ratio() const;
diff --git a/servers/audio/effects/audio_effect_delay.cpp b/servers/audio/effects/audio_effect_delay.cpp
index b643f801a7..de301fba6f 100644
--- a/servers/audio/effects/audio_effect_delay.cpp
+++ b/servers/audio/effects/audio_effect_delay.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_delay.h b/servers/audio/effects/audio_effect_delay.h
index 247fddac00..9d80c752d3 100644
--- a/servers/audio/effects/audio_effect_delay.h
+++ b/servers/audio/effects/audio_effect_delay.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_distortion.cpp b/servers/audio/effects/audio_effect_distortion.cpp
index e5430fcd21..87cf520e19 100644
--- a/servers/audio/effects/audio_effect_distortion.cpp
+++ b/servers/audio/effects/audio_effect_distortion.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_distortion.h b/servers/audio/effects/audio_effect_distortion.h
index 6cd92dea18..afeb6ac7ec 100644
--- a/servers/audio/effects/audio_effect_distortion.h
+++ b/servers/audio/effects/audio_effect_distortion.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -70,16 +71,16 @@ public:
void set_mode(Mode p_mode);
Mode get_mode() const;
- void set_pre_gain(float pre_gain);
+ void set_pre_gain(float p_pre_gain);
float get_pre_gain() const;
- void set_keep_hf_hz(float keep_hf_hz);
+ void set_keep_hf_hz(float p_keep_hf_hz);
float get_keep_hf_hz() const;
- void set_drive(float drive);
+ void set_drive(float p_drive);
float get_drive() const;
- void set_post_gain(float post_gain);
+ void set_post_gain(float p_post_gain);
float get_post_gain() const;
AudioEffectDistortion();
diff --git a/servers/audio/effects/audio_effect_eq.cpp b/servers/audio/effects/audio_effect_eq.cpp
index a103d34d0f..87f793f95e 100644
--- a/servers/audio/effects/audio_effect_eq.cpp
+++ b/servers/audio/effects/audio_effect_eq.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_eq.h b/servers/audio/effects/audio_effect_eq.h
index 917bf584c7..62041fe4f7 100644
--- a/servers/audio/effects/audio_effect_eq.h
+++ b/servers/audio/effects/audio_effect_eq.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_filter.cpp b/servers/audio/effects/audio_effect_filter.cpp
index 4c158ce44e..bcf1cc5756 100644
--- a/servers/audio/effects/audio_effect_filter.cpp
+++ b/servers/audio/effects/audio_effect_filter.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_filter.h b/servers/audio/effects/audio_effect_filter.h
index 4973630198..51932cdbf5 100644
--- a/servers/audio/effects/audio_effect_filter.h
+++ b/servers/audio/effects/audio_effect_filter.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_limiter.cpp b/servers/audio/effects/audio_effect_limiter.cpp
index 022d2d9aa4..9f39db0440 100644
--- a/servers/audio/effects/audio_effect_limiter.cpp
+++ b/servers/audio/effects/audio_effect_limiter.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,8 +31,8 @@
void AudioEffectLimiterInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) {
- float thresh = Math::db2linear(base->treshold);
- float threshdb = base->treshold;
+ float thresh = Math::db2linear(base->threshold);
+ float threshdb = base->threshold;
float ceiling = Math::db2linear(base->ceiling);
float ceildb = base->ceiling;
float makeup = Math::db2linear(ceildb - threshdb);
@@ -80,14 +81,14 @@ Ref<AudioEffectInstance> AudioEffectLimiter::instance() {
return ins;
}
-void AudioEffectLimiter::set_treshold_db(float p_treshold) {
+void AudioEffectLimiter::set_threshold_db(float p_threshold) {
- treshold = p_treshold;
+ threshold = p_threshold;
}
-float AudioEffectLimiter::get_treshold_db() const {
+float AudioEffectLimiter::get_threshold_db() const {
- return treshold;
+ return threshold;
}
void AudioEffectLimiter::set_ceiling_db(float p_ceiling) {
@@ -122,8 +123,8 @@ void AudioEffectLimiter::_bind_methods() {
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(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(D_METHOD("set_threshold_db", "threshold"), &AudioEffectLimiter::set_threshold_db);
+ ClassDB::bind_method(D_METHOD("get_threshold_db"), &AudioEffectLimiter::get_threshold_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);
@@ -132,13 +133,13 @@ void AudioEffectLimiter::_bind_methods() {
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"), "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, "threshold_db", PROPERTY_HINT_RANGE, "-30,0,0.1"), "set_threshold_db", "get_threshold_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() {
- treshold = 0;
+ threshold = 0;
ceiling = -0.1;
soft_clip = 2;
soft_clip_ratio = 10;
diff --git a/servers/audio/effects/audio_effect_limiter.h b/servers/audio/effects/audio_effect_limiter.h
index 9863a788f5..e15ffe5b34 100644
--- a/servers/audio/effects/audio_effect_limiter.h
+++ b/servers/audio/effects/audio_effect_limiter.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -48,7 +49,7 @@ class AudioEffectLimiter : public AudioEffect {
GDCLASS(AudioEffectLimiter, AudioEffect)
friend class AudioEffectLimiterInstance;
- float treshold;
+ float threshold;
float ceiling;
float soft_clip;
float soft_clip_ratio;
@@ -57,8 +58,8 @@ protected:
static void _bind_methods();
public:
- void set_treshold_db(float p_treshold);
- float get_treshold_db() const;
+ void set_threshold_db(float p_threshold);
+ float get_threshold_db() const;
void set_ceiling_db(float p_ceiling);
float get_ceiling_db() const;
diff --git a/servers/audio/effects/audio_effect_panner.cpp b/servers/audio/effects/audio_effect_panner.cpp
index ec0ccab453..a6103f580a 100644
--- a/servers/audio/effects/audio_effect_panner.cpp
+++ b/servers/audio/effects/audio_effect_panner.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_panner.h b/servers/audio/effects/audio_effect_panner.h
index 19bef45f1e..8c3edfbde0 100644
--- a/servers/audio/effects/audio_effect_panner.h
+++ b/servers/audio/effects/audio_effect_panner.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -53,7 +54,7 @@ protected:
public:
Ref<AudioEffectInstance> instance();
- void set_pan(float p_volume);
+ void set_pan(float p_cpanume);
float get_pan() const;
AudioEffectPanner();
diff --git a/servers/audio/effects/audio_effect_phaser.cpp b/servers/audio/effects/audio_effect_phaser.cpp
index 72549009c8..9af344d876 100644
--- a/servers/audio/effects/audio_effect_phaser.cpp
+++ b/servers/audio/effects/audio_effect_phaser.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_phaser.h b/servers/audio/effects/audio_effect_phaser.h
index 70b3a3a4c4..c587ca8239 100644
--- a/servers/audio/effects/audio_effect_phaser.h
+++ b/servers/audio/effects/audio_effect_phaser.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_pitch_shift.cpp b/servers/audio/effects/audio_effect_pitch_shift.cpp
index 6a14ba7155..1889934f29 100644
--- a/servers/audio/effects/audio_effect_pitch_shift.cpp
+++ b/servers/audio/effects/audio_effect_pitch_shift.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_pitch_shift.h b/servers/audio/effects/audio_effect_pitch_shift.h
index 610efdc0e1..08c8c59cc7 100644
--- a/servers/audio/effects/audio_effect_pitch_shift.h
+++ b/servers/audio/effects/audio_effect_pitch_shift.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_reverb.cpp b/servers/audio/effects/audio_effect_reverb.cpp
index f01bd266b8..7049204645 100644
--- a/servers/audio/effects/audio_effect_reverb.cpp
+++ b/servers/audio/effects/audio_effect_reverb.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_reverb.h b/servers/audio/effects/audio_effect_reverb.h
index 2c665ca916..d8f13da8b7 100644
--- a/servers/audio/effects/audio_effect_reverb.h
+++ b/servers/audio/effects/audio_effect_reverb.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_stereo_enhance.cpp b/servers/audio/effects/audio_effect_stereo_enhance.cpp
index 9aed528bd3..ebd48c0546 100644
--- a/servers/audio/effects/audio_effect_stereo_enhance.cpp
+++ b/servers/audio/effects/audio_effect_stereo_enhance.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/audio_effect_stereo_enhance.h b/servers/audio/effects/audio_effect_stereo_enhance.h
index 21331692e9..bad55614c6 100644
--- a/servers/audio/effects/audio_effect_stereo_enhance.h
+++ b/servers/audio/effects/audio_effect_stereo_enhance.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/eq.cpp b/servers/audio/effects/eq.cpp
index 857f81e856..4dd5eb0ebe 100644
--- a/servers/audio/effects/eq.cpp
+++ b/servers/audio/effects/eq.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/eq.h b/servers/audio/effects/eq.h
index a6d471cc4a..90d19e6e91 100644
--- a/servers/audio/effects/eq.h
+++ b/servers/audio/effects/eq.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/reverb.cpp b/servers/audio/effects/reverb.cpp
index 26e6f50667..7bc8c5cac3 100644
--- a/servers/audio/effects/reverb.cpp
+++ b/servers/audio/effects/reverb.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/effects/reverb.h b/servers/audio/effects/reverb.h
index 33f11e59fe..d4ddb3902a 100644
--- a/servers/audio/effects/reverb.h
+++ b/servers/audio/effects/reverb.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/reverb_sw.cpp b/servers/audio/reverb_sw.cpp
index ea89f7e198..45fd7fd7de 100644
--- a/servers/audio/reverb_sw.cpp
+++ b/servers/audio/reverb_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/reverb_sw.h b/servers/audio/reverb_sw.h
index 06a14322a6..f912734e65 100644
--- a/servers/audio/reverb_sw.h
+++ b/servers/audio/reverb_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio/voice_rb_sw.h b/servers/audio/voice_rb_sw.h
index 117a62a436..a4a5ec3ddd 100644
--- a/servers/audio/voice_rb_sw.h
+++ b/servers/audio/voice_rb_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp
index 5f70f52576..3547f86eb3 100644
--- a/servers/audio_server.cpp
+++ b/servers/audio_server.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,10 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "audio_server.h"
-#include "global_config.h"
#include "io/resource_loader.h"
#include "os/file_access.h"
#include "os/os.h"
+#include "project_settings.h"
#include "servers/audio/effects/audio_effect_compressor.h"
#ifdef TOOLS_ENABLED
@@ -65,7 +66,8 @@ void AudioDriver::audio_server_process(int p_frames, int32_t *p_buffer, bool p_u
void AudioDriver::update_mix_time(int p_frames) {
_mix_amount += p_frames;
- _last_mix_time = OS::get_singleton()->get_ticks_usec();
+ if (OS::get_singleton())
+ _last_mix_time = OS::get_singleton()->get_ticks_usec();
}
double AudioDriver::get_mix_time() const {
@@ -251,7 +253,7 @@ void AudioServer::_mix_step() {
if (!bus->channels[k].used) {
//see if any audio is contained, because channel was not used
- if (MAX(peak.r, peak.l) > Math::db2linear(channel_disable_treshold_db)) {
+ if (MAX(peak.r, peak.l) > Math::db2linear(channel_disable_threshold_db)) {
bus->channels[k].last_mix_with_audio = mix_frames;
} else if (mix_frames - bus->channels[k].last_mix_with_audio > channel_disable_frames) {
bus->channels[k].active = false;
@@ -514,6 +516,15 @@ String AudioServer::get_bus_name(int p_bus) const {
return buses[p_bus]->name;
}
+int AudioServer::get_bus_index(const StringName &p_bus_name) const {
+ for (int i = 0; i < buses.size(); ++i) {
+ if (buses[i]->name == p_bus_name) {
+ return i;
+ }
+ }
+ return -1;
+}
+
void AudioServer::set_bus_volume_db(int p_bus, float p_volume_db) {
ERR_FAIL_INDEX(p_bus, buses.size());
@@ -712,7 +723,7 @@ bool AudioServer::is_bus_channel_active(int p_bus, int p_channel) const {
void AudioServer::init() {
- channel_disable_treshold_db = GLOBAL_DEF("audio/channel_disable_treshold_db", -60.0);
+ channel_disable_threshold_db = GLOBAL_DEF("audio/channel_disable_threshold_db", -60.0);
channel_disable_frames = float(GLOBAL_DEF("audio/channel_disable_time", 2.0)) * get_mix_rate();
buffer_size = 1024; //harcoded for now
switch (get_speaker_mode()) {
@@ -760,7 +771,12 @@ void AudioServer::finish() {
}
buses.clear();
+
+ for (int i = 0; i < AudioDriverManager::get_driver_count(); i++) {
+ AudioDriverManager::get_driver(i)->finish();
+ }
}
+
void AudioServer::update() {
}
@@ -953,6 +969,7 @@ void AudioServer::_bind_methods() {
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(D_METHOD("get_bus_index", "bus_name"), &AudioServer::get_bus_index);
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);
@@ -969,11 +986,11 @@ void AudioServer::_bind_methods() {
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(D_METHOD("add_bus_effect", "bus_idx", "effect:AudioEffect"), &AudioServer::add_bus_effect, DEFVAL(-1));
+ ClassDB::bind_method(D_METHOD("add_bus_effect", "bus_idx", "effect", "at_pos"), &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(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("get_bus_effect_count", "bus_idx"), &AudioServer::get_bus_effect_count);
+ ClassDB::bind_method(D_METHOD("get_bus_effect", "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(D_METHOD("set_bus_effect_enabled", "bus_idx", "effect_idx", "enabled"), &AudioServer::set_bus_effect_enabled);
@@ -988,8 +1005,8 @@ void AudioServer::_bind_methods() {
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(D_METHOD("set_bus_layout", "bus_layout:AudioBusLayout"), &AudioServer::set_bus_layout);
- ClassDB::bind_method(D_METHOD("generate_bus_layout:AudioBusLayout"), &AudioServer::generate_bus_layout);
+ ClassDB::bind_method(D_METHOD("set_bus_layout", "bus_layout"), &AudioServer::set_bus_layout);
+ ClassDB::bind_method(D_METHOD("generate_bus_layout"), &AudioServer::generate_bus_layout);
ADD_SIGNAL(MethodInfo("bus_layout_changed"));
}
@@ -1007,6 +1024,7 @@ AudioServer::AudioServer() {
AudioServer::~AudioServer() {
memdelete(audio_data_lock);
+ singleton = NULL;
}
/////////////////////////////////
diff --git a/servers/audio_server.h b/servers/audio_server.h
index eed0a5e4c6..caa07891f7 100644
--- a/servers/audio_server.h
+++ b/servers/audio_server.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -112,7 +113,7 @@ private:
uint64_t mix_count;
uint64_t mix_frames;
- float channel_disable_treshold_db;
+ float channel_disable_threshold_db;
uint32_t channel_disable_frames;
int to_mix;
@@ -214,6 +215,7 @@ public:
void set_bus_name(int p_bus, const String &p_name);
String get_bus_name(int p_bus) const;
+ int get_bus_index(const StringName &p_bus_name) const;
void set_bus_volume_db(int p_bus, float p_volume_db);
float get_bus_volume_db(int p_bus) const;
diff --git a/servers/physics/area_pair_sw.cpp b/servers/physics/area_pair_sw.cpp
index d1040baa65..5c418c473f 100644
--- a/servers/physics/area_pair_sw.cpp
+++ b/servers/physics/area_pair_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,12 +32,13 @@
bool AreaPairSW::setup(real_t p_step) {
- if (!area->test_collision_mask(body)) {
- colliding = false;
- return false;
- }
+ bool result = false;
- bool result = CollisionSolverSW::solve_static(body->get_shape(body_shape), body->get_transform() * body->get_shape_transform(body_shape), area->get_shape(area_shape), area->get_transform() * area->get_shape_transform(area_shape), NULL, this);
+ if (area->is_shape_set_as_disabled(area_shape) || body->is_shape_set_as_disabled(body_shape)) {
+ result = false;
+ } else if (area->test_collision_mask(body) && CollisionSolverSW::solve_static(body->get_shape(body_shape), body->get_transform() * body->get_shape_transform(body_shape), area->get_shape(area_shape), area->get_transform() * area->get_shape_transform(area_shape), NULL, this)) {
+ result = true;
+ }
if (result != colliding) {
@@ -94,14 +96,13 @@ AreaPairSW::~AreaPairSW() {
bool Area2PairSW::setup(real_t p_step) {
- if (!area_a->test_collision_mask(area_b)) {
- colliding = false;
- return false;
+ bool result = false;
+ if (area_a->is_shape_set_as_disabled(shape_a) || area_b->is_shape_set_as_disabled(shape_b)) {
+ result = false;
+ } else if (area_a->test_collision_mask(area_b) && CollisionSolverSW::solve_static(area_a->get_shape(shape_a), area_a->get_transform() * area_a->get_shape_transform(shape_a), area_b->get_shape(shape_b), area_b->get_transform() * area_b->get_shape_transform(shape_b), NULL, this)) {
+ result = true;
}
- //bool result = area_a->test_collision_mask(area_b) && CollisionSolverSW::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);
- bool result = CollisionSolverSW::solve_static(area_a->get_shape(shape_a), area_a->get_transform() * area_a->get_shape_transform(shape_a), area_b->get_shape(shape_b), area_b->get_transform() * area_b->get_shape_transform(shape_b), NULL, this);
-
if (result != colliding) {
if (result) {
diff --git a/servers/physics/area_pair_sw.h b/servers/physics/area_pair_sw.h
index 8fc7e7efaa..75df6043ea 100644
--- a/servers/physics/area_pair_sw.h
+++ b/servers/physics/area_pair_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/area_sw.cpp b/servers/physics/area_sw.cpp
index dfb5d191bc..a310ed3411 100644
--- a/servers/physics/area_sw.cpp
+++ b/servers/physics/area_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/area_sw.h b/servers/physics/area_sw.h
index 2c0cd8dbcd..3dae1db13f 100644
--- a/servers/physics/area_sw.h
+++ b/servers/physics/area_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -153,6 +154,7 @@ public:
_FORCE_INLINE_ void add_constraint(ConstraintSW *p_constraint) { constraints.insert(p_constraint); }
_FORCE_INLINE_ void remove_constraint(ConstraintSW *p_constraint) { constraints.erase(p_constraint); }
_FORCE_INLINE_ const Set<ConstraintSW *> &get_constraints() const { return constraints; }
+ _FORCE_INLINE_ void clear_constraints() { constraints.clear(); }
void set_monitorable(bool p_monitorable);
_FORCE_INLINE_ bool is_monitorable() const { return monitorable; }
diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics/body_pair_sw.cpp
index 555d5f15c5..9ada1fbc50 100644
--- a/servers/physics/body_pair_sw.cpp
+++ b/servers/physics/body_pair_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -213,6 +214,11 @@ bool BodyPairSW::setup(real_t p_step) {
return false;
}
+ if (A->is_shape_set_as_disabled(shape_A) || B->is_shape_set_as_disabled(shape_B)) {
+ collided = false;
+ return false;
+ }
+
offset_B = B->get_transform().get_origin() - A->get_transform().get_origin();
validate_contacts();
@@ -312,12 +318,6 @@ bool BodyPairSW::setup(real_t p_step) {
B->add_contact(global_B, c.normal, depth, shape_B, global_A, shape_A, A->get_instance_id(), A->get_self(), crB);
}
- if (A->is_shape_set_as_trigger(shape_A) || B->is_shape_set_as_trigger(shape_B) || (A->get_mode() <= PhysicsServer::BODY_MODE_KINEMATIC && B->get_mode() <= PhysicsServer::BODY_MODE_KINEMATIC)) {
- c.active = false;
- collided = false;
- continue;
- }
-
c.active = true;
// Precompute normal mass, tangent mass, and bias.
diff --git a/servers/physics/body_pair_sw.h b/servers/physics/body_pair_sw.h
index fa426adafd..cb16849399 100644
--- a/servers/physics/body_pair_sw.h
+++ b/servers/physics/body_pair_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp
index 6b43ec31aa..e065fae2be 100644
--- a/servers/physics/body_sw.cpp
+++ b/servers/physics/body_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -494,7 +495,7 @@ void BodySW::integrate_forces(real_t p_step) {
Vector3 axis;
real_t angle;
- rot.get_axis_and_angle(axis, angle);
+ rot.get_axis_angle(axis, angle);
axis.normalize();
angular_velocity = axis.normalized() * (angle / p_step);
@@ -637,7 +638,7 @@ void BodySW::simulate_motion(const Transform& p_xform,real_t p_step) {
Vector3 axis;
real_t angle;
- rot.get_axis_and_angle(axis,angle);
+ rot.get_axis_angle(axis,angle);
axis.normalize();
angular_velocity=axis.normalized() * (angle/p_step);
linear_velocity = (p_xform.origin - get_transform().origin)/p_step;
@@ -705,7 +706,7 @@ bool BodySW::sleep_test(real_t p_step) {
else if (!can_sleep)
return false;
- if (Math::abs(angular_velocity.length()) < get_space()->get_body_angular_velocity_sleep_treshold() && Math::abs(linear_velocity.length_squared()) < get_space()->get_body_linear_velocity_sleep_treshold() * get_space()->get_body_linear_velocity_sleep_treshold()) {
+ if (Math::abs(angular_velocity.length()) < get_space()->get_body_angular_velocity_sleep_threshold() && Math::abs(linear_velocity.length_squared()) < get_space()->get_body_linear_velocity_sleep_threshold() * get_space()->get_body_linear_velocity_sleep_threshold()) {
still_time += p_step;
@@ -756,7 +757,8 @@ BodySW::BodySW()
contact_count = 0;
gravity_scale = 1.0;
-
+ linear_damp = -1;
+ angular_damp = -1;
area_angular_damp = 0;
area_linear_damp = 0;
diff --git a/servers/physics/body_sw.h b/servers/physics/body_sw.h
index 4b1af6fca5..512b868570 100644
--- a/servers/physics/body_sw.h
+++ b/servers/physics/body_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -193,6 +194,7 @@ public:
_FORCE_INLINE_ void add_constraint(ConstraintSW *p_constraint, int p_pos) { constraint_map[p_constraint] = p_pos; }
_FORCE_INLINE_ void remove_constraint(ConstraintSW *p_constraint) { constraint_map.erase(p_constraint); }
const Map<ConstraintSW *, int> &get_constraint_map() const { return constraint_map; }
+ _FORCE_INLINE_ void clear_constraint_map() { constraint_map.clear(); }
_FORCE_INLINE_ void set_omit_force_integration(bool p_omit_force_integration) { omit_force_integration = p_omit_force_integration; }
_FORCE_INLINE_ bool get_omit_force_integration() const { return omit_force_integration; }
diff --git a/servers/physics/broad_phase_basic.cpp b/servers/physics/broad_phase_basic.cpp
index ca9bb40842..05a2e1fdf8 100644
--- a/servers/physics/broad_phase_basic.cpp
+++ b/servers/physics/broad_phase_basic.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -104,6 +105,26 @@ int BroadPhaseBasic::get_subindex(ID p_id) const {
return E->get().subindex;
}
+int BroadPhaseBasic::cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) {
+
+ int rc = 0;
+
+ for (Map<ID, Element>::Element *E = element_map.front(); E; E = E->next()) {
+
+ const Rect3 aabb = E->get().aabb;
+ if (aabb.has_point(p_point)) {
+
+ p_results[rc] = E->get().owner;
+ p_result_indices[rc] = E->get().subindex;
+ rc++;
+ if (rc >= p_max_results)
+ break;
+ }
+ }
+
+ return rc;
+}
+
int BroadPhaseBasic::cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) {
int rc = 0;
@@ -148,10 +169,10 @@ void BroadPhaseBasic::set_pair_callback(PairCallback p_pair_callback, void *p_us
pair_userdata = p_userdata;
pair_callback = p_pair_callback;
}
-void BroadPhaseBasic::set_unpair_callback(UnpairCallback p_pair_callback, void *p_userdata) {
+void BroadPhaseBasic::set_unpair_callback(UnpairCallback p_unpair_callback, void *p_userdata) {
unpair_userdata = p_userdata;
- unpair_callback = p_pair_callback;
+ unpair_callback = p_unpair_callback;
}
void BroadPhaseBasic::update() {
diff --git a/servers/physics/broad_phase_basic.h b/servers/physics/broad_phase_basic.h
index 2824af6b68..8dabf72f11 100644
--- a/servers/physics/broad_phase_basic.h
+++ b/servers/physics/broad_phase_basic.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -90,6 +91,7 @@ public:
virtual bool is_static(ID p_id) const;
virtual int get_subindex(ID p_id) const;
+ virtual int cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
virtual int cull_aabb(const Rect3 &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
diff --git a/servers/physics/broad_phase_octree.cpp b/servers/physics/broad_phase_octree.cpp
index cb64077d9a..e1aaf4e31a 100644
--- a/servers/physics/broad_phase_octree.cpp
+++ b/servers/physics/broad_phase_octree.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -65,6 +66,11 @@ int BroadPhaseOctree::get_subindex(ID p_id) const {
return octree.get_subindex(p_id);
}
+int BroadPhaseOctree::cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) {
+
+ return octree.cull_point(p_point, p_results, p_max_results, p_result_indices);
+}
+
int BroadPhaseOctree::cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) {
return octree.cull_segment(p_from, p_to, p_results, p_max_results, p_result_indices);
@@ -72,7 +78,7 @@ int BroadPhaseOctree::cull_segment(const Vector3 &p_from, const Vector3 &p_to, C
int BroadPhaseOctree::cull_aabb(const Rect3 &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) {
- return octree.cull_AABB(p_aabb, p_results, p_max_results, p_result_indices);
+ return octree.cull_aabb(p_aabb, p_results, p_max_results, p_result_indices);
}
void *BroadPhaseOctree::_pair_callback(void *self, OctreeElementID p_A, CollisionObjectSW *p_object_A, int subindex_A, OctreeElementID p_B, CollisionObjectSW *p_object_B, int subindex_B) {
diff --git a/servers/physics/broad_phase_octree.h b/servers/physics/broad_phase_octree.h
index f9a8bd17ed..bd3ba6677a 100644
--- a/servers/physics/broad_phase_octree.h
+++ b/servers/physics/broad_phase_octree.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -46,7 +47,7 @@ class BroadPhaseOctree : public BroadPhaseSW {
public:
// 0 is an invalid ID
- virtual ID create(CollisionObjectSW *p_object_, int p_subindex = 0);
+ virtual ID create(CollisionObjectSW *p_object, int p_subindex = 0);
virtual void move(ID p_id, const Rect3 &p_aabb);
virtual void set_static(ID p_id, bool p_static);
virtual void remove(ID p_id);
@@ -55,6 +56,7 @@ public:
virtual bool is_static(ID p_id) const;
virtual int get_subindex(ID p_id) const;
+ virtual int cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
virtual int cull_aabb(const Rect3 &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
diff --git a/servers/physics/broad_phase_sw.cpp b/servers/physics/broad_phase_sw.cpp
index f9a19e558b..c3d42d4c2f 100644
--- a/servers/physics/broad_phase_sw.cpp
+++ b/servers/physics/broad_phase_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/broad_phase_sw.h b/servers/physics/broad_phase_sw.h
index df6ea1cc73..5564cf5077 100644
--- a/servers/physics/broad_phase_sw.h
+++ b/servers/physics/broad_phase_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -56,6 +57,7 @@ public:
virtual bool is_static(ID p_id) const = 0;
virtual int get_subindex(ID p_id) const = 0;
+ virtual int cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0;
virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0;
virtual int cull_aabb(const Rect3 &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0;
diff --git a/servers/physics/collision_object_sw.cpp b/servers/physics/collision_object_sw.cpp
index 36704b6eb8..d673088304 100644
--- a/servers/physics/collision_object_sw.cpp
+++ b/servers/physics/collision_object_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -163,7 +164,7 @@ void CollisionObjectSW::_update_shapes_with_motion(const Vector3 &p_motion) {
Rect3 shape_aabb = s.shape->get_aabb();
Transform xform = transform * s.xform;
shape_aabb = xform.xform(shape_aabb);
- shape_aabb = shape_aabb.merge(Rect3(shape_aabb.pos + p_motion, shape_aabb.size)); //use motion
+ shape_aabb = shape_aabb.merge(Rect3(shape_aabb.position + p_motion, shape_aabb.size)); //use motion
s.aabb_cache = shape_aabb;
space->get_broadphase()->move(s.bpid, shape_aabb);
@@ -207,7 +208,7 @@ CollisionObjectSW::CollisionObjectSW(Type p_type) {
type = p_type;
space = NULL;
instance_id = 0;
- layer_mask = 1;
+ collision_layer = 1;
collision_mask = 1;
ray_pickable = true;
}
diff --git a/servers/physics/collision_object_sw.h b/servers/physics/collision_object_sw.h
index 9a7626d583..44786829af 100644
--- a/servers/physics/collision_object_sw.h
+++ b/servers/physics/collision_object_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -52,7 +53,7 @@ private:
Type type;
RID self;
ObjectID instance_id;
- uint32_t layer_mask;
+ uint32_t collision_layer;
uint32_t collision_mask;
struct Shape {
@@ -63,9 +64,9 @@ private:
Rect3 aabb_cache; //for rayqueries
real_t area_cache;
ShapeSW *shape;
- bool trigger;
+ bool disabled;
- Shape() { trigger = false; }
+ Shape() { disabled = false; }
};
Vector<Shape> shapes;
@@ -97,7 +98,7 @@ protected:
void _set_static(bool p_static);
virtual void _shapes_changed() = 0;
- void _set_space(SpaceSW *space);
+ void _set_space(SpaceSW *p_space);
bool ray_pickable;
@@ -130,17 +131,17 @@ public:
_FORCE_INLINE_ void set_ray_pickable(bool p_enable) { ray_pickable = p_enable; }
_FORCE_INLINE_ bool is_ray_pickable() const { return ray_pickable; }
- _FORCE_INLINE_ void set_shape_as_trigger(int p_idx, bool p_enable) { shapes[p_idx].trigger = p_enable; }
- _FORCE_INLINE_ bool is_shape_set_as_trigger(int p_idx) const { return shapes[p_idx].trigger; }
+ _FORCE_INLINE_ void set_shape_as_disabled(int p_idx, bool p_enable) { shapes[p_idx].disabled = p_enable; }
+ _FORCE_INLINE_ bool is_shape_set_as_disabled(int p_idx) const { return shapes[p_idx].disabled; }
- _FORCE_INLINE_ void set_layer_mask(uint32_t p_mask) { layer_mask = p_mask; }
- _FORCE_INLINE_ uint32_t get_layer_mask() const { return layer_mask; }
+ _FORCE_INLINE_ void set_collision_layer(uint32_t p_layer) { collision_layer = p_layer; }
+ _FORCE_INLINE_ uint32_t get_collision_layer() const { return collision_layer; }
_FORCE_INLINE_ void set_collision_mask(uint32_t p_mask) { collision_mask = p_mask; }
_FORCE_INLINE_ uint32_t get_collision_mask() const { return collision_mask; }
_FORCE_INLINE_ bool test_collision_mask(CollisionObjectSW *p_other) const {
- return layer_mask & p_other->collision_mask || p_other->layer_mask & collision_mask;
+ return collision_layer & p_other->collision_mask || p_other->collision_layer & collision_mask;
}
void remove_shape(ShapeSW *p_shape);
diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp
index 003e6b3257..128f78e46e 100644
--- a/servers/physics/collision_solver_sat.cpp
+++ b/servers/physics/collision_solver_sat.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,7 @@
#include "collision_solver_sat.h"
#include "geometry.h"
-#define _EDGE_IS_VALID_SUPPORT_TRESHOLD 0.02
+#define _EDGE_IS_VALID_SUPPORT_THRESHOLD 0.02
struct _CollectorCallback {
diff --git a/servers/physics/collision_solver_sat.h b/servers/physics/collision_solver_sat.h
index 67ffb0b068..d5fae7798a 100644
--- a/servers/physics/collision_solver_sat.h
+++ b/servers/physics/collision_solver_sat.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/collision_solver_sw.cpp b/servers/physics/collision_solver_sw.cpp
index 0f6e964359..32a42bcaf4 100644
--- a/servers/physics/collision_solver_sw.cpp
+++ b/servers/physics/collision_solver_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -165,7 +166,7 @@ bool CollisionSolverSW::solve_concave(const ShapeSW *p_shape_A, const Transform
smin *= axis_scale;
smax *= axis_scale;
- local_aabb.pos[i] = smin;
+ local_aabb.position[i] = smin;
local_aabb.size[i] = smax - smin;
}
@@ -331,7 +332,7 @@ bool CollisionSolverSW::solve_distance(const ShapeSW *p_shape_A, const Transform
Rect3 cc_hint_aabb;
if (use_cc_hint) {
cc_hint_aabb = p_concave_hint;
- cc_hint_aabb.pos -= p_transform_B.origin;
+ cc_hint_aabb.position -= p_transform_B.origin;
}
Rect3 local_aabb;
@@ -352,7 +353,7 @@ bool CollisionSolverSW::solve_distance(const ShapeSW *p_shape_A, const Transform
smin *= axis_scale;
smax *= axis_scale;
- local_aabb.pos[i] = smin;
+ local_aabb.position[i] = smin;
local_aabb.size[i] = smax - smin;
}
diff --git a/servers/physics/collision_solver_sw.h b/servers/physics/collision_solver_sw.h
index b0f18dc0ac..5a4e864eb5 100644
--- a/servers/physics/collision_solver_sw.h
+++ b/servers/physics/collision_solver_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/constraint_sw.h b/servers/physics/constraint_sw.h
index 2cd0e1a420..d9f153a6a6 100644
--- a/servers/physics/constraint_sw.h
+++ b/servers/physics/constraint_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/gjk_epa.cpp b/servers/physics/gjk_epa.cpp
index 2c5610ee89..ab2a9b507a 100644
--- a/servers/physics/gjk_epa.cpp
+++ b/servers/physics/gjk_epa.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,6 +34,31 @@
/*************** Bullet's GJK-EPA2 IMPLEMENTATION *******************/
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2008 Erwin Coumans http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the
+use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+claim that you wrote the original software. If you use this software in a
+product, an acknowledgment in the product documentation would be appreciated
+but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/*
+GJK-EPA collision solver by Nathanael Presson, 2008
+*/
+
// Config
/* GJK */
diff --git a/servers/physics/gjk_epa.h b/servers/physics/gjk_epa.h
index ae5db733b5..316b991477 100644
--- a/servers/physics/gjk_epa.h
+++ b/servers/physics/gjk_epa.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/joints/cone_twist_joint_sw.cpp b/servers/physics/joints/cone_twist_joint_sw.cpp
index 8cab81de2c..d00eab53d3 100644
--- a/servers/physics/joints/cone_twist_joint_sw.cpp
+++ b/servers/physics/joints/cone_twist_joint_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,23 @@
/*
Adapted to Godot from the Bullet library.
-See corresponding header file for licensing info.
+*/
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+ConeTwistJointSW is Copyright (c) 2007 Starbreeze Studios
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+Written by: Marcus Hennix
*/
#include "cone_twist_joint_sw.h"
@@ -83,6 +100,7 @@ ConeTwistJointSW::ConeTwistJointSW(BodySW *rbA, BodySW *rbB, const Transform &rb
m_biasFactor = 0.3f;
m_relaxationFactor = 1.0f;
+ m_angularOnly = false;
m_solveTwistLimit = false;
m_solveSwingLimit = false;
@@ -92,7 +110,7 @@ ConeTwistJointSW::ConeTwistJointSW(BodySW *rbA, BodySW *rbB, const Transform &rb
m_appliedImpulse = 0;
}
-bool ConeTwistJointSW::setup(real_t p_step) {
+bool ConeTwistJointSW::setup(real_t p_timestep) {
m_appliedImpulse = real_t(0.);
//set bias, sign, clear accumulator
@@ -219,7 +237,7 @@ bool ConeTwistJointSW::setup(real_t p_step) {
return true;
}
-void ConeTwistJointSW::solve(real_t timeStep) {
+void ConeTwistJointSW::solve(real_t p_timestep) {
Vector3 pivotAInW = A->get_transform().xform(m_rbAFrame.origin);
Vector3 pivotBInW = B->get_transform().xform(m_rbBFrame.origin);
@@ -243,7 +261,7 @@ void ConeTwistJointSW::solve(real_t timeStep) {
rel_vel = normal.dot(vel);
//positional error (zeroth order error)
real_t depth = -(pivotAInW - pivotBInW).dot(normal); //this is the error projected on the normal
- real_t impulse = depth * tau / timeStep * jacDiagABInv - rel_vel * jacDiagABInv;
+ real_t impulse = depth * tau / p_timestep * jacDiagABInv - rel_vel * jacDiagABInv;
m_appliedImpulse += impulse;
Vector3 impulse_vector = normal * impulse;
A->apply_impulse(pivotAInW - A->get_transform().origin, impulse_vector);
@@ -258,7 +276,7 @@ void ConeTwistJointSW::solve(real_t timeStep) {
// solve swing limit
if (m_solveSwingLimit) {
- real_t amplitude = ((angVelB - angVelA).dot(m_swingAxis) * m_relaxationFactor * m_relaxationFactor + m_swingCorrection * (real_t(1.) / timeStep) * m_biasFactor);
+ real_t amplitude = ((angVelB - angVelA).dot(m_swingAxis) * m_relaxationFactor * m_relaxationFactor + m_swingCorrection * (real_t(1.) / p_timestep) * m_biasFactor);
real_t impulseMag = amplitude * m_kSwing;
// Clamp the accumulated impulse
@@ -274,7 +292,7 @@ void ConeTwistJointSW::solve(real_t timeStep) {
// solve twist limit
if (m_solveTwistLimit) {
- real_t amplitude = ((angVelB - angVelA).dot(m_twistAxis) * m_relaxationFactor * m_relaxationFactor + m_twistCorrection * (real_t(1.) / timeStep) * m_biasFactor);
+ real_t amplitude = ((angVelB - angVelA).dot(m_twistAxis) * m_relaxationFactor * m_relaxationFactor + m_twistCorrection * (real_t(1.) / p_timestep) * m_biasFactor);
real_t impulseMag = amplitude * m_kTwist;
// Clamp the accumulated impulse
diff --git a/servers/physics/joints/cone_twist_joint_sw.h b/servers/physics/joints/cone_twist_joint_sw.h
index c122c22258..f0e029712c 100644
--- a/servers/physics/joints/cone_twist_joint_sw.h
+++ b/servers/physics/joints/cone_twist_joint_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -103,8 +104,8 @@ public:
public:
virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_CONE_TWIST; }
- virtual bool setup(real_t p_step);
- virtual void solve(real_t p_step);
+ virtual bool setup(real_t p_timestep);
+ virtual void solve(real_t p_timestep);
ConeTwistJointSW(BodySW *rbA, BodySW *rbB, const Transform &rbAFrame, const Transform &rbBFrame);
diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp
index 1e07bc73fb..e1cd6ee7e5 100644
--- a/servers/physics/joints/generic_6dof_joint_sw.cpp
+++ b/servers/physics/joints/generic_6dof_joint_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,28 @@
/*
Adapted to Godot from the Bullet library.
-See corresponding header file for licensing info.
+*/
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/*
+2007-09-09
+Generic6DOFJointSW Refactored by Francisco Le?n
+email: projectileman@yahoo.com
+http://gimpact.sf.net
*/
#include "generic_6dof_joint_sw.h"
@@ -276,7 +298,7 @@ bool Generic6DOFJointSW::testAngularLimitMotor(int axis_index) {
return m_angularLimits[axis_index].needApplyTorques();
}
-bool Generic6DOFJointSW::setup(real_t p_step) {
+bool Generic6DOFJointSW::setup(real_t p_timestep) {
// Clear accumulated impulses for the next simulation step
m_linearLimits.m_accumulatedImpulse = Vector3(real_t(0.), real_t(0.), real_t(0.));
@@ -325,8 +347,8 @@ bool Generic6DOFJointSW::setup(real_t p_step) {
return true;
}
-void Generic6DOFJointSW::solve(real_t timeStep) {
- m_timeStep = timeStep;
+void Generic6DOFJointSW::solve(real_t p_timestep) {
+ m_timeStep = p_timestep;
//calculateTransforms();
diff --git a/servers/physics/joints/generic_6dof_joint_sw.h b/servers/physics/joints/generic_6dof_joint_sw.h
index bd9a1e5f0e..587a5850df 100644
--- a/servers/physics/joints/generic_6dof_joint_sw.h
+++ b/servers/physics/joints/generic_6dof_joint_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -263,8 +264,8 @@ public:
virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_6DOF; }
- virtual bool setup(real_t p_step);
- virtual void solve(real_t p_step);
+ virtual bool setup(real_t p_timestep);
+ virtual void solve(real_t p_timestep);
//! Calcs global transform of the offsets
/*!
diff --git a/servers/physics/joints/hinge_joint_sw.cpp b/servers/physics/joints/hinge_joint_sw.cpp
index eaa57af873..3938427cea 100644
--- a/servers/physics/joints/hinge_joint_sw.cpp
+++ b/servers/physics/joints/hinge_joint_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,21 @@
/*
Adapted to Godot from the Bullet library.
-See corresponding header file for licensing info.
+*/
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
*/
#include "hinge_joint_sw.h"
diff --git a/servers/physics/joints/hinge_joint_sw.h b/servers/physics/joints/hinge_joint_sw.h
index 013d9afdbf..5ebf0cb165 100644
--- a/servers/physics/joints/hinge_joint_sw.h
+++ b/servers/physics/joints/hinge_joint_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/joints/jacobian_entry_sw.h b/servers/physics/joints/jacobian_entry_sw.h
index b0b31ed797..537a9a8f3d 100644
--- a/servers/physics/joints/jacobian_entry_sw.h
+++ b/servers/physics/joints/jacobian_entry_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/joints/pin_joint_sw.cpp b/servers/physics/joints/pin_joint_sw.cpp
index e01514f4b6..0792ffeecd 100644
--- a/servers/physics/joints/pin_joint_sw.cpp
+++ b/servers/physics/joints/pin_joint_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,21 @@
/*
Adapted to Godot from the Bullet library.
-See corresponding header file for licensing info.
+*/
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
*/
#include "pin_joint_sw.h"
diff --git a/servers/physics/joints/pin_joint_sw.h b/servers/physics/joints/pin_joint_sw.h
index 9500d4b46d..1d580b6c21 100644
--- a/servers/physics/joints/pin_joint_sw.h
+++ b/servers/physics/joints/pin_joint_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -82,11 +83,11 @@ public:
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; }
+ void set_pos_a(const Vector3 &p_pos) { m_pivotInA = p_pos; }
+ void set_pos_b(const Vector3 &p_pos) { m_pivotInB = p_pos; }
- Vector3 get_pos_A() { return m_pivotInB; }
- Vector3 get_pos_B() { return m_pivotInA; }
+ Vector3 get_pos_a() { return m_pivotInB; }
+ Vector3 get_pos_b() { return m_pivotInA; }
PinJointSW(BodySW *p_body_a, const Vector3 &p_pos_a, BodySW *p_body_b, const Vector3 &p_pos_b);
~PinJointSW();
diff --git a/servers/physics/joints/slider_joint_sw.cpp b/servers/physics/joints/slider_joint_sw.cpp
index b8a6c1ecaf..947f46e960 100644
--- a/servers/physics/joints/slider_joint_sw.cpp
+++ b/servers/physics/joints/slider_joint_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,27 @@
/*
Adapted to Godot from the Bullet library.
-See corresponding header file for licensing info.
+*/
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/*
+Added by Roman Ponomarev (rponom@gmail.com)
+April 04, 2008
+
*/
#include "slider_joint_sw.h"
diff --git a/servers/physics/joints/slider_joint_sw.h b/servers/physics/joints/slider_joint_sw.h
index faf36bfe9e..7818ee2a5c 100644
--- a/servers/physics/joints/slider_joint_sw.h
+++ b/servers/physics/joints/slider_joint_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/joints_sw.h b/servers/physics/joints_sw.h
index 0f637faf79..b25939d523 100644
--- a/servers/physics/joints_sw.h
+++ b/servers/physics/joints_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp
index 6fc983a739..151fc44476 100644
--- a/servers/physics/physics_server_sw.cpp
+++ b/servers/physics/physics_server_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -221,12 +222,24 @@ void PhysicsServerSW::area_set_space(RID p_area, RID p_space) {
AreaSW *area = area_owner.get(p_area);
ERR_FAIL_COND(!area);
+
SpaceSW *space = NULL;
if (p_space.is_valid()) {
space = space_owner.get(p_space);
ERR_FAIL_COND(!space);
}
+ if (area->get_space() == space)
+ return; //pointless
+
+ for (Set<ConstraintSW *>::Element *E = area->get_constraints().front(); E; E = E->next()) {
+ RID self = E->get()->get_self();
+ if (!self.is_valid())
+ continue;
+ free(self);
+ }
+ area->clear_constraints();
+
area->set_space(space);
};
@@ -329,7 +342,15 @@ void PhysicsServerSW::area_clear_shapes(RID p_area) {
area->remove_shape(0);
}
-void PhysicsServerSW::area_attach_object_instance_ID(RID p_area, ObjectID p_ID) {
+void PhysicsServerSW::area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) {
+
+ AreaSW *area = area_owner.get(p_area);
+ ERR_FAIL_COND(!area);
+ ERR_FAIL_INDEX(p_shape_idx, area->get_shape_count());
+ area->set_shape_as_disabled(p_shape_idx, p_disabled);
+}
+
+void PhysicsServerSW::area_attach_object_instance_id(RID p_area, ObjectID p_ID) {
if (space_owner.owns(p_area)) {
SpaceSW *space = space_owner.get(p_area);
@@ -339,7 +360,7 @@ void PhysicsServerSW::area_attach_object_instance_ID(RID p_area, ObjectID p_ID)
ERR_FAIL_COND(!area);
area->set_instance_id(p_ID);
}
-ObjectID PhysicsServerSW::area_get_object_instance_ID(RID p_area) const {
+ObjectID PhysicsServerSW::area_get_object_instance_id(RID p_area) const {
if (space_owner.owns(p_area)) {
SpaceSW *space = space_owner.get(p_area);
@@ -388,12 +409,12 @@ Transform PhysicsServerSW::area_get_transform(RID p_area) const {
return area->get_transform();
};
-void PhysicsServerSW::area_set_layer_mask(RID p_area, uint32_t p_mask) {
+void PhysicsServerSW::area_set_collision_layer(RID p_area, uint32_t p_layer) {
AreaSW *area = area_owner.get(p_area);
ERR_FAIL_COND(!area);
- area->set_layer_mask(p_mask);
+ area->set_collision_layer(p_layer);
}
void PhysicsServerSW::area_set_collision_mask(RID p_area, uint32_t p_mask) {
@@ -417,7 +438,7 @@ void PhysicsServerSW::area_set_monitor_callback(RID p_area, Object *p_receiver,
AreaSW *area = area_owner.get(p_area);
ERR_FAIL_COND(!area);
- area->set_monitor_callback(p_receiver ? p_receiver->get_instance_ID() : 0, p_method);
+ area->set_monitor_callback(p_receiver ? p_receiver->get_instance_id() : 0, p_method);
}
void PhysicsServerSW::area_set_ray_pickable(RID p_area, bool p_enable) {
@@ -441,7 +462,7 @@ void PhysicsServerSW::area_set_area_monitor_callback(RID p_area, Object *p_recei
AreaSW *area = area_owner.get(p_area);
ERR_FAIL_COND(!area);
- area->set_area_monitor_callback(p_receiver ? p_receiver->get_instance_ID() : 0, p_method);
+ area->set_area_monitor_callback(p_receiver ? p_receiver->get_instance_id() : 0, p_method);
}
/* BODY API */
@@ -462,15 +483,23 @@ void PhysicsServerSW::body_set_space(RID p_body, RID p_space) {
BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
- SpaceSW *space = NULL;
+ SpaceSW *space = NULL;
if (p_space.is_valid()) {
space = space_owner.get(p_space);
ERR_FAIL_COND(!space);
}
if (body->get_space() == space)
- return; //pointles
+ return; //pointless
+
+ for (Map<ConstraintSW *, int>::Element *E = body->get_constraint_map().front(); E; E = E->next()) {
+ RID self = E->key()->get_self();
+ if (!self.is_valid())
+ continue;
+ free(self);
+ }
+ body->clear_constraint_map();
body->set_space(space);
};
@@ -550,21 +579,12 @@ RID PhysicsServerSW::body_get_shape(RID p_body, int p_shape_idx) const {
return shape->get_self();
}
-void PhysicsServerSW::body_set_shape_as_trigger(RID p_body, int p_shape_idx, bool p_enable) {
+void PhysicsServerSW::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) {
BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
ERR_FAIL_INDEX(p_shape_idx, body->get_shape_count());
- body->set_shape_as_trigger(p_shape_idx, p_enable);
-}
-
-bool PhysicsServerSW::body_is_shape_set_as_trigger(RID p_body, int p_shape_idx) const {
-
- BodySW *body = body_owner.get(p_body);
- ERR_FAIL_COND_V(!body, false);
- ERR_FAIL_INDEX_V(p_shape_idx, body->get_shape_count(), false);
-
- return body->is_shape_set_as_trigger(p_shape_idx);
+ body->set_shape_as_disabled(p_shape_idx, p_disabled);
}
Transform PhysicsServerSW::body_get_shape_transform(RID p_body, int p_shape_idx) const {
@@ -608,21 +628,21 @@ bool PhysicsServerSW::body_is_continuous_collision_detection_enabled(RID p_body)
return body->is_continuous_collision_detection_enabled();
}
-void PhysicsServerSW::body_set_layer_mask(RID p_body, uint32_t p_mask) {
+void PhysicsServerSW::body_set_collision_layer(RID p_body, uint32_t p_layer) {
BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
- body->set_layer_mask(p_mask);
+ body->set_collision_layer(p_layer);
body->wakeup();
}
-uint32_t PhysicsServerSW::body_get_layer_mask(RID p_body, uint32_t p_mask) const {
+uint32_t PhysicsServerSW::body_get_collision_layer(RID p_body) const {
const BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND_V(!body, 0);
- return body->get_layer_mask();
+ return body->get_collision_layer();
}
void PhysicsServerSW::body_set_collision_mask(RID p_body, uint32_t p_mask) {
@@ -634,7 +654,7 @@ void PhysicsServerSW::body_set_collision_mask(RID p_body, uint32_t p_mask) {
body->wakeup();
}
-uint32_t PhysicsServerSW::body_get_collision_mask(RID p_body, uint32_t p_mask) const {
+uint32_t PhysicsServerSW::body_get_collision_mask(RID p_body) const {
const BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND_V(!body, 0);
@@ -642,7 +662,7 @@ uint32_t PhysicsServerSW::body_get_collision_mask(RID p_body, uint32_t p_mask) c
return body->get_collision_mask();
}
-void PhysicsServerSW::body_attach_object_instance_ID(RID p_body, uint32_t p_ID) {
+void PhysicsServerSW::body_attach_object_instance_id(RID p_body, uint32_t p_ID) {
BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
@@ -650,7 +670,7 @@ void PhysicsServerSW::body_attach_object_instance_ID(RID p_body, uint32_t p_ID)
body->set_instance_id(p_ID);
};
-uint32_t PhysicsServerSW::body_get_object_instance_ID(RID p_body) const {
+uint32_t PhysicsServerSW::body_get_object_instance_id(RID p_body) const {
BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND_V(!body, 0);
@@ -664,7 +684,7 @@ void PhysicsServerSW::body_set_user_flags(RID p_body, uint32_t p_flags) {
ERR_FAIL_COND(!body);
};
-uint32_t PhysicsServerSW::body_get_user_flags(RID p_body, uint32_t p_flags) const {
+uint32_t PhysicsServerSW::body_get_user_flags(RID p_body) const {
BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND_V(!body, 0);
@@ -811,13 +831,13 @@ void PhysicsServerSW::body_get_collision_exceptions(RID p_body, List<RID> *p_exc
}
};
-void PhysicsServerSW::body_set_contacts_reported_depth_treshold(RID p_body, real_t p_treshold) {
+void PhysicsServerSW::body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold) {
BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
};
-real_t PhysicsServerSW::body_get_contacts_reported_depth_treshold(RID p_body) const {
+real_t PhysicsServerSW::body_get_contacts_reported_depth_threshold(RID p_body) const {
BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND_V(!body, 0);
@@ -857,7 +877,7 @@ void PhysicsServerSW::body_set_force_integration_callback(RID p_body, Object *p_
BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
- body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_ID() : ObjectID(0), p_method, p_udata);
+ body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(0), p_method, p_udata);
}
void PhysicsServerSW::body_set_ray_pickable(RID p_body, bool p_enable) {
@@ -874,6 +894,16 @@ bool PhysicsServerSW::body_is_ray_pickable(RID p_body) const {
return body->is_ray_pickable();
}
+bool PhysicsServerSW::body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, float p_margin, MotionResult *r_result) {
+
+ BodySW *body = body_owner.get(p_body);
+ ERR_FAIL_COND_V(!body, false);
+ ERR_FAIL_COND_V(!body->get_space(), false);
+ ERR_FAIL_COND_V(body->get_space()->is_locked(), false);
+
+ return body->get_space()->test_body_motion(body, p_from, p_motion, p_margin, r_result);
+}
+
/* JOINT API */
RID PhysicsServerSW::joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) {
@@ -914,38 +944,38 @@ real_t PhysicsServerSW::pin_joint_get_param(RID p_joint, PinJointParam p_param)
return pin_joint->get_param(p_param);
}
-void PhysicsServerSW::pin_joint_set_local_A(RID p_joint, const Vector3 &p_A) {
+void PhysicsServerSW::pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) {
JointSW *joint = joint_owner.get(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_PIN);
PinJointSW *pin_joint = static_cast<PinJointSW *>(joint);
- pin_joint->set_pos_A(p_A);
+ pin_joint->set_pos_a(p_A);
}
-Vector3 PhysicsServerSW::pin_joint_get_local_A(RID p_joint) const {
+Vector3 PhysicsServerSW::pin_joint_get_local_a(RID p_joint) const {
JointSW *joint = joint_owner.get(p_joint);
ERR_FAIL_COND_V(!joint, Vector3());
ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3());
PinJointSW *pin_joint = static_cast<PinJointSW *>(joint);
- return pin_joint->get_pos_A();
+ return pin_joint->get_pos_a();
}
-void PhysicsServerSW::pin_joint_set_local_B(RID p_joint, const Vector3 &p_B) {
+void PhysicsServerSW::pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) {
JointSW *joint = joint_owner.get(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_PIN);
PinJointSW *pin_joint = static_cast<PinJointSW *>(joint);
- pin_joint->set_pos_B(p_B);
+ pin_joint->set_pos_b(p_B);
}
-Vector3 PhysicsServerSW::pin_joint_get_local_B(RID p_joint) const {
+Vector3 PhysicsServerSW::pin_joint_get_local_b(RID p_joint) const {
JointSW *joint = joint_owner.get(p_joint);
ERR_FAIL_COND_V(!joint, Vector3());
ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3());
PinJointSW *pin_joint = static_cast<PinJointSW *>(joint);
- return pin_joint->get_pos_B();
+ return pin_joint->get_pos_b();
}
RID PhysicsServerSW::joint_create_hinge(RID p_body_A, const Transform &p_frame_A, RID p_body_B, const Transform &p_frame_B) {
@@ -1319,12 +1349,6 @@ void PhysicsServerSW::free(RID p_rid) {
body->remove_shape(0);
}
- while (body->get_constraint_map().size()) {
- RID self = body->get_constraint_map().front()->key()->get_self();
- ERR_FAIL_COND(!self.is_valid());
- free(self);
- }
-
body_owner.free(p_rid);
memdelete(body);
@@ -1529,8 +1553,9 @@ void PhysicsServerSW::_shape_col_cbk(const Vector3 &p_point_A, const Vector3 &p_
}
}
+PhysicsServerSW *PhysicsServerSW::singleton = NULL;
PhysicsServerSW::PhysicsServerSW() {
-
+ singleton = this;
BroadPhaseSW::create_func = BroadPhaseOctree::_create;
island_count = 0;
active_objects = 0;
diff --git a/servers/physics/physics_server_sw.h b/servers/physics/physics_server_sw.h
index cb5a339ee8..818922a989 100644
--- a/servers/physics/physics_server_sw.h
+++ b/servers/physics/physics_server_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -62,6 +63,8 @@ class PhysicsServerSW : public PhysicsServer {
//void _clear_query(QuerySW *p_query);
public:
+ static PhysicsServerSW *singleton;
+
struct CollCbkData {
int max;
@@ -116,20 +119,22 @@ public:
virtual void area_remove_shape(RID p_area, int p_shape_idx);
virtual void area_clear_shapes(RID p_area);
- virtual void area_attach_object_instance_ID(RID p_area, ObjectID p_ID);
- virtual ObjectID area_get_object_instance_ID(RID p_area) const;
+ virtual void area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled);
+
+ virtual void area_attach_object_instance_id(RID p_area, ObjectID p_ID);
+ virtual ObjectID area_get_object_instance_id(RID p_area) const;
virtual void area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value);
virtual void area_set_transform(RID p_area, const Transform &p_transform);
- virtual Variant area_get_param(RID p_parea, AreaParameter p_param) const;
+ virtual Variant area_get_param(RID p_area, AreaParameter p_param) const;
virtual Transform area_get_transform(RID p_area) const;
virtual void area_set_ray_pickable(RID p_area, bool p_enable);
virtual bool area_is_ray_pickable(RID p_area) const;
virtual void area_set_collision_mask(RID p_area, uint32_t p_mask);
- virtual void area_set_layer_mask(RID p_area, uint32_t p_mask);
+ virtual void area_set_collision_layer(RID p_area, uint32_t p_layer);
virtual void area_set_monitorable(RID p_area, bool p_monitorable);
@@ -155,26 +160,25 @@ public:
virtual RID body_get_shape(RID p_body, int p_shape_idx) const;
virtual Transform body_get_shape_transform(RID p_body, int p_shape_idx) const;
- virtual void body_set_shape_as_trigger(RID p_body, int p_shape_idx, bool p_enable);
- virtual bool body_is_shape_set_as_trigger(RID p_body, int p_shape_idx) const;
+ virtual void body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled);
virtual void body_remove_shape(RID p_body, int p_shape_idx);
virtual void body_clear_shapes(RID p_body);
- virtual void body_attach_object_instance_ID(RID p_body, uint32_t p_ID);
- virtual uint32_t body_get_object_instance_ID(RID p_body) const;
+ virtual void body_attach_object_instance_id(RID p_body, uint32_t p_ID);
+ virtual uint32_t body_get_object_instance_id(RID p_body) const;
virtual void body_set_enable_continuous_collision_detection(RID p_body, bool p_enable);
virtual bool body_is_continuous_collision_detection_enabled(RID p_body) const;
- virtual void body_set_layer_mask(RID p_body, uint32_t p_mask);
- virtual uint32_t body_get_layer_mask(RID p_body, uint32_t p_mask) const;
+ virtual void body_set_collision_layer(RID p_body, uint32_t p_layer);
+ virtual uint32_t body_get_collision_layer(RID p_body) const;
virtual void body_set_collision_mask(RID p_body, uint32_t p_mask);
- virtual uint32_t body_get_collision_mask(RID p_body, uint32_t p_mask) const;
+ virtual uint32_t body_get_collision_mask(RID p_body) const;
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 uint32_t body_get_user_flags(RID p_body) 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;
@@ -199,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, real_t p_treshold);
- virtual real_t body_get_contacts_reported_depth_treshold(RID p_body) const;
+ virtual void body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold);
+ virtual real_t body_get_contacts_reported_depth_threshold(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;
@@ -213,6 +217,8 @@ public:
virtual void body_set_ray_pickable(RID p_body, bool p_enable);
virtual bool body_is_ray_pickable(RID p_body) const;
+ virtual bool body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, float p_margin = 0.001, MotionResult *r_result = NULL);
+
/* JOINT API */
virtual RID joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B);
@@ -220,11 +226,11 @@ public:
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;
+ 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;
- virtual void pin_joint_set_local_B(RID p_joint, const Vector3 &p_B);
- virtual Vector3 pin_joint_get_local_B(RID p_joint) const;
+ virtual void pin_joint_set_local_b(RID p_joint, const Vector3 &p_B);
+ virtual Vector3 pin_joint_get_local_b(RID p_joint) const;
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);
diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp
index 4ce716c70a..b4004c8c94 100644
--- a/servers/physics/shape_sw.cpp
+++ b/servers/physics/shape_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,8 +32,8 @@
#include "quick_hull.h"
#include "sort.h"
#define _POINT_SNAP 0.001953125
-#define _EDGE_IS_VALID_SUPPORT_TRESHOLD 0.0002
-#define _FACE_IS_VALID_SUPPORT_TRESHOLD 0.9998
+#define _EDGE_IS_VALID_SUPPORT_THRESHOLD 0.0002
+#define _FACE_IS_VALID_SUPPORT_THRESHOLD 0.9998
void ShapeSW::configure(const Rect3 &p_aabb) {
aabb = p_aabb;
@@ -116,6 +117,20 @@ bool PlaneShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_en
return inters;
}
+bool PlaneShapeSW::intersect_point(const Vector3 &p_point) const {
+
+ return plane.distance_to(p_point) < 0;
+}
+
+Vector3 PlaneShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+
+ if (plane.is_point_over(p_point)) {
+ return plane.project(p_point);
+ } else {
+ return p_point;
+ }
+}
+
Vector3 PlaneShapeSW::get_moment_of_inertia(real_t p_mass) const {
return Vector3(); //wtf
@@ -164,7 +179,7 @@ Vector3 RayShapeSW::get_support(const Vector3 &p_normal) const {
void RayShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
- if (Math::abs(p_normal.z) < _EDGE_IS_VALID_SUPPORT_TRESHOLD) {
+ if (Math::abs(p_normal.z) < _EDGE_IS_VALID_SUPPORT_THRESHOLD) {
r_amount = 2;
r_supports[0] = Vector3(0, 0, 0);
@@ -183,6 +198,21 @@ bool RayShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end,
return false; //simply not possible
}
+bool RayShapeSW::intersect_point(const Vector3 &p_point) const {
+
+ return false; //simply not possible
+}
+
+Vector3 RayShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+
+ Vector3 s[2] = {
+ Vector3(0, 0, 0),
+ Vector3(0, 0, length)
+ };
+
+ return Geometry::get_closest_point_to_segment(p_point, s);
+}
+
Vector3 RayShapeSW::get_moment_of_inertia(real_t p_mass) const {
return Vector3();
@@ -244,6 +274,20 @@ bool SphereShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_e
return Geometry::segment_intersects_sphere(p_begin, p_end, Vector3(), radius, &r_result, &r_normal);
}
+bool SphereShapeSW::intersect_point(const Vector3 &p_point) const {
+
+ return p_point.length() < radius;
+}
+
+Vector3 SphereShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+
+ Vector3 p = p_point;
+ float l = p.length();
+ if (l < radius)
+ return p_point;
+ return (p / l) * radius;
+}
+
Vector3 SphereShapeSW::get_moment_of_inertia(real_t p_mass) const {
real_t s = 0.4 * p_mass * radius * radius;
@@ -305,7 +349,7 @@ void BoxShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_sup
Vector3 axis;
axis[i] = 1.0;
real_t dot = p_normal.dot(axis);
- if (Math::abs(dot) > _FACE_IS_VALID_SUPPORT_TRESHOLD) {
+ if (Math::abs(dot) > _FACE_IS_VALID_SUPPORT_THRESHOLD) {
//Vector3 axis_b;
@@ -349,7 +393,7 @@ void BoxShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_sup
Vector3 axis;
axis[i] = 1.0;
- if (Math::abs(p_normal.dot(axis)) < _EDGE_IS_VALID_SUPPORT_TRESHOLD) {
+ if (Math::abs(p_normal.dot(axis)) < _EDGE_IS_VALID_SUPPORT_THRESHOLD) {
r_amount = 2;
@@ -389,6 +433,62 @@ bool BoxShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end,
return aabb.intersects_segment(p_begin, p_end, &r_result, &r_normal);
}
+bool BoxShapeSW::intersect_point(const Vector3 &p_point) const {
+
+ return (Math::abs(p_point.x) < half_extents.x && Math::abs(p_point.y) < half_extents.y && Math::abs(p_point.z) < half_extents.z);
+}
+
+Vector3 BoxShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+
+ int outside = 0;
+ Vector3 min_point;
+
+ for (int i = 0; i < 3; i++) {
+
+ if (Math::abs(p_point[i]) > half_extents[i]) {
+ outside++;
+ if (outside == 1) {
+ //use plane if only one side matches
+ Vector3 n;
+ n[i] = SGN(p_point[i]);
+
+ Plane p(n, half_extents[i]);
+ min_point = p.project(p_point);
+ }
+ }
+ }
+
+ if (!outside)
+ return p_point; //it's inside, don't do anything else
+
+ if (outside == 1) //if only above one plane, this plane clearly wins
+ return min_point;
+
+ //check segments
+ float min_distance = 1e20;
+ Vector3 closest_vertex = half_extents * p_point.sign();
+ Vector3 s[2] = {
+ closest_vertex,
+ closest_vertex
+ };
+
+ for (int i = 0; i < 3; i++) {
+
+ s[1] = closest_vertex;
+ s[1][i] = -s[1][i]; //edge
+
+ Vector3 closest_edge = Geometry::get_closest_point_to_segment(p_point, s);
+
+ float d = p_point.distance_to(closest_edge);
+ if (d < min_distance) {
+ min_point = closest_edge;
+ min_distance = d;
+ }
+ }
+
+ return min_point;
+}
+
Vector3 BoxShapeSW::get_moment_of_inertia(real_t p_mass) const {
real_t lx = half_extents.x;
@@ -459,7 +559,7 @@ void CapsuleShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r
real_t d = n.z;
- if (Math::abs(d) < _EDGE_IS_VALID_SUPPORT_TRESHOLD) {
+ if (Math::abs(d) < _EDGE_IS_VALID_SUPPORT_THRESHOLD) {
// make it flat
n.z = 0.0;
@@ -541,6 +641,32 @@ bool CapsuleShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_
return collision;
}
+bool CapsuleShapeSW::intersect_point(const Vector3 &p_point) const {
+
+ if (Math::abs(p_point.z) < height * 0.5) {
+ return Vector3(p_point.x, p_point.y, 0).length() < radius;
+ } else {
+ Vector3 p = p_point;
+ p.z = Math::abs(p.z) - height * 0.5;
+ return p.length() < radius;
+ }
+}
+
+Vector3 CapsuleShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+
+ Vector3 s[2] = {
+ Vector3(0, 0, -height * 0.5),
+ Vector3(0, 0, height * 0.5),
+ };
+
+ Vector3 p = Geometry::get_closest_point_to_segment(p_point, s);
+
+ if (p.distance_to(p_point) < radius)
+ return p_point;
+
+ return p + (p_point - p).normalized() * radius;
+}
+
Vector3 CapsuleShapeSW::get_moment_of_inertia(real_t p_mass) const {
// use crappy AABB approximation
@@ -654,7 +780,7 @@ void ConvexPolygonShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vect
for (int i = 0; i < fc; i++) {
- if (faces[i].plane.normal.dot(p_normal) > _FACE_IS_VALID_SUPPORT_TRESHOLD) {
+ if (faces[i].plane.normal.dot(p_normal) > _FACE_IS_VALID_SUPPORT_THRESHOLD) {
int ic = faces[i].indices.size();
const int *ind = faces[i].indices.ptr();
@@ -684,7 +810,7 @@ void ConvexPolygonShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vect
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)) {
+ if (dot < _EDGE_IS_VALID_SUPPORT_THRESHOLD && (edges[i].a == vtx || edges[i].b == vtx)) {
r_amount = 2;
r_supports[0] = vertices[edges[i].a];
@@ -737,6 +863,81 @@ bool ConvexPolygonShapeSW::intersect_segment(const Vector3 &p_begin, const Vecto
return col;
}
+bool ConvexPolygonShapeSW::intersect_point(const Vector3 &p_point) const {
+
+ const Geometry::MeshData::Face *faces = mesh.faces.ptr();
+ int fc = mesh.faces.size();
+
+ for (int i = 0; i < fc; i++) {
+
+ if (faces[i].plane.distance_to(p_point) >= 0)
+ return false;
+ }
+
+ return true;
+}
+
+Vector3 ConvexPolygonShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+
+ const Geometry::MeshData::Face *faces = mesh.faces.ptr();
+ int fc = mesh.faces.size();
+ const Vector3 *vertices = mesh.vertices.ptr();
+
+ bool all_inside = true;
+ for (int i = 0; i < fc; i++) {
+
+ if (!faces[i].plane.is_point_over(p_point))
+ continue;
+
+ all_inside = false;
+ bool is_inside = true;
+ int ic = faces[i].indices.size();
+ const int *indices = faces[i].indices.ptr();
+
+ for (int j = 0; j < ic; j++) {
+
+ Vector3 a = vertices[indices[j]];
+ Vector3 b = vertices[indices[(j + 1) % ic]];
+ Vector3 n = (a - b).cross(faces[i].plane.normal).normalized();
+ if (Plane(a, n).is_point_over(p_point)) {
+ is_inside = false;
+ break;
+ }
+ }
+
+ if (is_inside) {
+ return faces[i].plane.project(p_point);
+ }
+ }
+
+ if (all_inside) {
+ return p_point;
+ }
+
+ float min_distance = 1e20;
+ Vector3 min_point;
+
+ //check edges
+ const Geometry::MeshData::Edge *edges = mesh.edges.ptr();
+ int ec = mesh.edges.size();
+ for (int i = 0; i < ec; i++) {
+
+ Vector3 s[2] = {
+ vertices[edges[i].a],
+ vertices[edges[i].b]
+ };
+
+ Vector3 closest = Geometry::get_closest_point_to_segment(p_point, s);
+ float d = closest.distance_to(p_point);
+ if (d < min_distance) {
+ min_distance = d;
+ min_point = closest;
+ }
+ }
+
+ return min_point;
+}
+
Vector3 ConvexPolygonShapeSW::get_moment_of_inertia(real_t p_mass) const {
// use crappy AABB approximation
@@ -756,7 +957,7 @@ void ConvexPolygonShapeSW::_setup(const Vector<Vector3> &p_vertices) {
for (int i = 0; i < mesh.vertices.size(); i++) {
if (i == 0)
- _aabb.pos = mesh.vertices[i];
+ _aabb.position = mesh.vertices[i];
else
_aabb.expand_to(mesh.vertices[i]);
}
@@ -817,7 +1018,7 @@ void FaceShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_su
Vector3 n = p_normal;
/** TEST FACE AS SUPPORT **/
- if (normal.dot(n) > _FACE_IS_VALID_SUPPORT_TRESHOLD) {
+ if (normal.dot(n) > _FACE_IS_VALID_SUPPORT_THRESHOLD) {
r_amount = 3;
for (int i = 0; i < 3; i++) {
@@ -853,7 +1054,7 @@ void FaceShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_su
// check if edge is valid as a support
real_t dot = (vertex[i] - vertex[nx]).normalized().dot(n);
dot = ABS(dot);
- if (dot < _EDGE_IS_VALID_SUPPORT_TRESHOLD) {
+ if (dot < _EDGE_IS_VALID_SUPPORT_THRESHOLD) {
r_amount = 2;
r_supports[0] = vertex[i];
@@ -879,6 +1080,16 @@ bool FaceShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end
return c;
}
+bool FaceShapeSW::intersect_point(const Vector3 &p_point) const {
+
+ return false; //face is flat
+}
+
+Vector3 FaceShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+
+ return Face3(vertex[0], vertex[1], vertex[2]).get_closest_point_to(p_point);
+}
+
Vector3 FaceShapeSW::get_moment_of_inertia(real_t p_mass) const {
return Vector3(); // Sorry, but i don't think anyone cares, FaceShape!
@@ -1045,6 +1256,16 @@ bool ConcavePolygonShapeSW::intersect_segment(const Vector3 &p_begin, const Vect
}
}
+bool ConcavePolygonShapeSW::intersect_point(const Vector3 &p_point) const {
+
+ return false; //face is flat
+}
+
+Vector3 ConcavePolygonShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+
+ return Vector3();
+}
+
void ConcavePolygonShapeSW::_cull(int p_idx, _CullParams *p_params) const {
const BVH *bvh = &p_params->bvh[p_idx];
@@ -1387,7 +1608,7 @@ void ConcavePolygonShapeSW::_setup(PoolVector<Vector3> p_faces) {
Face3 face(facesr[i * 3 + 0], facesr[i * 3 + 1], facesr[i * 3 + 2]);
bvh_arrayw[i].aabb = face.get_aabb();
- bvh_arrayw[i].center = bvh_arrayw[i].aabb.pos + bvh_arrayw[i].aabb.size * 0.5;
+ bvh_arrayw[i].center = bvh_arrayw[i].aabb.position + bvh_arrayw[i].aabb.size * 0.5;
bvh_arrayw[i].face_index = i;
facesw[i].indices[0] = i * 3 + 0;
facesw[i].indices[1] = i * 3 + 1;
@@ -1470,6 +1691,15 @@ bool HeightMapShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &
return false;
}
+bool HeightMapShapeSW::intersect_point(const Vector3 &p_point) const {
+ return false;
+}
+
+Vector3 HeightMapShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+
+ return Vector3();
+}
+
void HeightMapShapeSW::cull(const Rect3 &p_local_aabb, Callback p_callback, void *p_userdata) const {
}
@@ -1503,7 +1733,7 @@ void HeightMapShapeSW::_setup(PoolVector<real_t> p_heights, int p_width, int p_d
Vector3 pos(j * cell_size, h, i * cell_size);
if (i == 0 || j == 0)
- aabb.pos = pos;
+ aabb.position = pos;
else
aabb.expand_to(pos);
}
diff --git a/servers/physics/shape_sw.h b/servers/physics/shape_sw.h
index 442cbc39eb..52623c019d 100644
--- a/servers/physics/shape_sw.h
+++ b/servers/physics/shape_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -86,8 +87,9 @@ public:
virtual void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const = 0;
virtual Vector3 get_support(const Vector3 &p_normal) const;
virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const = 0;
-
+ virtual Vector3 get_closest_point_to(const Vector3 &p_point) const = 0;
virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_point, Vector3 &r_normal) const = 0;
+ virtual bool intersect_point(const Vector3 &p_point) const = 0;
virtual Vector3 get_moment_of_inertia(real_t p_mass) const = 0;
virtual void set_data(const Variant &p_data) = 0;
@@ -133,7 +135,8 @@ public:
virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const { r_amount = 0; }
virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const;
-
+ virtual bool intersect_point(const Vector3 &p_point) const;
+ virtual Vector3 get_closest_point_to(const Vector3 &p_point) const;
virtual Vector3 get_moment_of_inertia(real_t p_mass) const;
virtual void set_data(const Variant &p_data);
@@ -158,6 +161,8 @@ 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 bool intersect_point(const Vector3 &p_point) const;
+ virtual Vector3 get_closest_point_to(const Vector3 &p_point) const;
virtual Vector3 get_moment_of_inertia(real_t p_mass) const;
@@ -184,6 +189,8 @@ public:
virtual Vector3 get_support(const Vector3 &p_normal) const;
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 bool intersect_point(const Vector3 &p_point) const;
+ virtual Vector3 get_closest_point_to(const Vector3 &p_point) const;
virtual Vector3 get_moment_of_inertia(real_t p_mass) const;
@@ -208,6 +215,8 @@ public:
virtual Vector3 get_support(const Vector3 &p_normal) const;
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 bool intersect_point(const Vector3 &p_point) const;
+ virtual Vector3 get_closest_point_to(const Vector3 &p_point) const;
virtual Vector3 get_moment_of_inertia(real_t p_mass) const;
@@ -236,6 +245,8 @@ public:
virtual Vector3 get_support(const Vector3 &p_normal) const;
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 bool intersect_point(const Vector3 &p_point) const;
+ virtual Vector3 get_closest_point_to(const Vector3 &p_point) const;
virtual Vector3 get_moment_of_inertia(real_t p_mass) const;
@@ -260,6 +271,8 @@ public:
virtual Vector3 get_support(const Vector3 &p_normal) const;
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 bool intersect_point(const Vector3 &p_point) const;
+ virtual Vector3 get_closest_point_to(const Vector3 &p_point) const;
virtual Vector3 get_moment_of_inertia(real_t p_mass) const;
@@ -337,6 +350,8 @@ public:
virtual Vector3 get_support(const Vector3 &p_normal) const;
virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const;
+ virtual bool intersect_point(const Vector3 &p_point) const;
+ virtual Vector3 get_closest_point_to(const Vector3 &p_point) const;
virtual void cull(const Rect3 &p_local_aabb, Callback p_callback, void *p_userdata) const;
@@ -370,8 +385,10 @@ public:
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;
- virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const;
+ virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_point, Vector3 &r_normal) const;
+ virtual bool intersect_point(const Vector3 &p_point) const;
+ virtual Vector3 get_closest_point_to(const Vector3 &p_point) const;
virtual void cull(const Rect3 &p_local_aabb, Callback p_callback, void *p_userdata) const;
virtual Vector3 get_moment_of_inertia(real_t p_mass) const;
@@ -396,6 +413,8 @@ struct FaceShapeSW : public ShapeSW {
Vector3 get_support(const Vector3 &p_normal) const;
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;
+ virtual bool intersect_point(const Vector3 &p_point) const;
+ virtual Vector3 get_closest_point_to(const Vector3 &p_point) const;
Vector3 get_moment_of_inertia(real_t p_mass) const;
@@ -435,6 +454,8 @@ 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; }
+ virtual bool intersect_point(const Vector3 &p_point) const { return false; }
+ virtual Vector3 get_closest_point_to(const Vector3 &p_point) const { return p_point; }
Vector3 get_moment_of_inertia(real_t p_mass) const { return Vector3(); }
diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp
index 2043f9fed8..094cfa4656 100644
--- a/servers/physics/space_sw.cpp
+++ b/servers/physics/space_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,23 +29,67 @@
/*************************************************************************/
#include "space_sw.h"
#include "collision_solver_sw.h"
-#include "global_config.h"
#include "physics_server_sw.h"
+#include "project_settings.h"
-_FORCE_INLINE_ static bool _match_object_type_query(CollisionObjectSW *p_object, uint32_t p_layer_mask, uint32_t p_type_mask) {
+_FORCE_INLINE_ static bool _match_object_type_query(CollisionObjectSW *p_object, uint32_t p_collision_layer, uint32_t p_type_mask) {
+
+ if ((p_object->get_collision_layer() & p_collision_layer) == 0)
+ return false;
if (p_object->get_type() == CollisionObjectSW::TYPE_AREA)
return p_type_mask & PhysicsDirectSpaceState::TYPE_MASK_AREA;
- if ((p_object->get_layer_mask() & p_layer_mask) == 0)
- return false;
-
BodySW *body = static_cast<BodySW *>(p_object);
return (1 << body->get_mode()) & p_type_mask;
}
-bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude, uint32_t p_layer_mask, uint32_t p_object_type_mask, bool p_pick_ray) {
+int PhysicsDirectSpaceStateSW::intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask) {
+
+ ERR_FAIL_COND_V(space->locked, false);
+ int amount = space->broadphase->cull_point(p_point, space->intersection_query_results, SpaceSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
+ int cc = 0;
+
+ //Transform ai = p_xform.affine_inverse();
+
+ for (int i = 0; i < amount; i++) {
+
+ if (cc >= p_result_max)
+ break;
+
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
+ continue;
+
+ //area can't be picked by ray (default)
+
+ if (p_exclude.has(space->intersection_query_results[i]->get_self()))
+ continue;
+
+ const CollisionObjectSW *col_obj = space->intersection_query_results[i];
+ int shape_idx = space->intersection_query_subindex_results[i];
+
+ Transform inv_xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx);
+ inv_xform.affine_invert();
+
+ if (!col_obj->get_shape(shape_idx)->intersect_point(inv_xform.xform(p_point)))
+ continue;
+
+ r_results[cc].collider_id = col_obj->get_instance_id();
+ if (r_results[cc].collider_id != 0)
+ r_results[cc].collider = ObjectDB::get_instance(r_results[cc].collider_id);
+ else
+ r_results[cc].collider = NULL;
+ r_results[cc].rid = col_obj->get_self();
+ r_results[cc].shape = shape_idx;
+
+ cc++;
+ }
+
+ return cc;
+}
+
+bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask, bool p_pick_ray) {
ERR_FAIL_COND_V(space->locked, false);
@@ -66,7 +111,7 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vecto
for (int i = 0; i < amount; i++) {
- if (!_match_object_type_query(space->intersection_query_results[i], p_layer_mask, p_object_type_mask))
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
continue;
if (p_pick_ray && !(static_cast<CollisionObjectSW *>(space->intersection_query_results[i])->is_ray_pickable()))
@@ -122,7 +167,7 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vecto
return true;
}
-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) {
+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_collision_layer, uint32_t p_object_type_mask) {
if (p_result_max <= 0)
return 0;
@@ -143,7 +188,7 @@ int PhysicsDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Transfo
if (cc >= p_result_max)
break;
- if (!_match_object_type_query(space->intersection_query_results[i], p_layer_mask, p_object_type_mask))
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
continue;
//area can't be picked by ray (default)
@@ -173,13 +218,13 @@ int PhysicsDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Transfo
return cc;
}
-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) {
+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_collision_layer, uint32_t p_object_type_mask, ShapeRestInfo *r_info) {
ShapeSW *shape = static_cast<PhysicsServerSW *>(PhysicsServer::get_singleton())->shape_owner.get(p_shape);
ERR_FAIL_COND_V(!shape, false);
Rect3 aabb = p_xform.xform(shape->get_aabb());
- aabb = aabb.merge(Rect3(aabb.pos + p_motion, aabb.size)); //motion
+ aabb = aabb.merge(Rect3(aabb.position + p_motion, aabb.size)); //motion
aabb = aabb.grow(p_margin);
/*
@@ -203,7 +248,7 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transform
for (int i = 0; i < amount; i++) {
- if (!_match_object_type_query(space->intersection_query_results[i], p_layer_mask, p_object_type_mask))
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
continue;
if (p_exclude.has(space->intersection_query_results[i]->get_self()))
@@ -294,7 +339,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, 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) {
+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_collision_layer, uint32_t p_object_type_mask) {
if (p_result_max <= 0)
return 0;
@@ -324,7 +369,7 @@ bool PhysicsDirectSpaceStateSW::collide_shape(RID p_shape, const Transform &p_sh
for (int i = 0; i < amount; i++) {
- if (!_match_object_type_query(space->intersection_query_results[i], p_layer_mask, p_object_type_mask))
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
continue;
const CollisionObjectSW *col_obj = space->intersection_query_results[i];
@@ -373,7 +418,7 @@ static void _rest_cbk_result(const Vector3 &p_point_A, const Vector3 &p_point_B,
rd->best_object = rd->object;
rd->best_shape = rd->shape;
}
-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) {
+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_collision_layer, uint32_t p_object_type_mask) {
ShapeSW *shape = static_cast<PhysicsServerSW *>(PhysicsServer::get_singleton())->shape_owner.get(p_shape);
ERR_FAIL_COND_V(!shape, 0);
@@ -390,7 +435,7 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform &p_shape_
for (int i = 0; i < amount; i++) {
- if (!_match_object_type_query(space->intersection_query_results[i], p_layer_mask, p_object_type_mask))
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
continue;
const CollisionObjectSW *col_obj = space->intersection_query_results[i];
@@ -427,6 +472,48 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform &p_shape_
return true;
}
+Vector3 PhysicsDirectSpaceStateSW::get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const {
+
+ CollisionObjectSW *obj = NULL;
+ obj = PhysicsServerSW::singleton->area_owner.getornull(p_object);
+ if (!obj) {
+ obj = PhysicsServerSW::singleton->body_owner.getornull(p_object);
+ }
+ ERR_FAIL_COND_V(!obj, Vector3());
+
+ ERR_FAIL_COND_V(obj->get_space() != space, Vector3());
+
+ float min_distance = 1e20;
+ Vector3 min_point;
+
+ bool shapes_found = false;
+
+ for (int i = 0; i < obj->get_shape_count(); i++) {
+
+ if (obj->is_shape_set_as_disabled(i))
+ continue;
+
+ Transform shape_xform = obj->get_transform() * obj->get_shape_transform(i);
+ ShapeSW *shape = obj->get_shape(i);
+
+ Vector3 point = shape->get_closest_point_to(shape_xform.affine_inverse().xform(p_point));
+ point = shape_xform.xform(point);
+
+ float dist = point.distance_to(p_point);
+ if (dist < min_distance) {
+ min_distance = dist;
+ min_point = point;
+ }
+ shapes_found = true;
+ }
+
+ if (!shapes_found) {
+ return obj->get_transform().origin; //no shapes found, use distance to origin.
+ } else {
+ return min_point;
+ }
+}
+
PhysicsDirectSpaceStateSW::PhysicsDirectSpaceStateSW() {
space = NULL;
@@ -434,6 +521,337 @@ PhysicsDirectSpaceStateSW::PhysicsDirectSpaceStateSW() {
////////////////////////////////////////////////////////////////////////////////////////////////////////////
+int SpaceSW::_cull_aabb_for_body(BodySW *p_body, const Rect3 &p_aabb) {
+
+ int amount = broadphase->cull_aabb(p_aabb, intersection_query_results, INTERSECTION_QUERY_MAX, intersection_query_subindex_results);
+
+ for (int i = 0; i < amount; i++) {
+
+ bool keep = true;
+
+ if (intersection_query_results[i] == p_body)
+ keep = false;
+ else if (intersection_query_results[i]->get_type() == CollisionObjectSW::TYPE_AREA)
+ keep = false;
+ else if ((static_cast<BodySW *>(intersection_query_results[i])->test_collision_mask(p_body)) == 0)
+ keep = false;
+ else if (static_cast<BodySW *>(intersection_query_results[i])->has_exception(p_body->get_self()) || p_body->has_exception(intersection_query_results[i]->get_self()))
+ keep = false;
+ else if (static_cast<BodySW *>(intersection_query_results[i])->is_shape_set_as_disabled(intersection_query_subindex_results[i]))
+ keep = false;
+
+ if (!keep) {
+
+ if (i < amount - 1) {
+ SWAP(intersection_query_results[i], intersection_query_results[amount - 1]);
+ SWAP(intersection_query_subindex_results[i], intersection_query_subindex_results[amount - 1]);
+ }
+
+ amount--;
+ i--;
+ }
+ }
+
+ return amount;
+}
+
+bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Vector3 &p_motion, real_t p_margin, PhysicsServer::MotionResult *r_result) {
+
+ //give me back regular physics engine logic
+ //this is madness
+ //and most people using this function will think
+ //what it does is simpler than using physics
+ //this took about a week to get right..
+ //but is it right? who knows at this point..
+
+ if (r_result) {
+ r_result->collider_id = 0;
+ r_result->collider_shape = 0;
+ }
+ Rect3 body_aabb;
+
+ for (int i = 0; i < p_body->get_shape_count(); i++) {
+
+ if (i == 0)
+ body_aabb = p_body->get_shape_aabb(i);
+ else
+ body_aabb = body_aabb.merge(p_body->get_shape_aabb(i));
+ }
+
+ // Undo the currently transform the physics server is aware of and apply the provided one
+ body_aabb = p_from.xform(p_body->get_inv_transform().xform(body_aabb));
+ body_aabb = body_aabb.grow(p_margin);
+
+ Transform body_transform = p_from;
+
+ {
+ //STEP 1, FREE BODY IF STUCK
+
+ const int max_results = 32;
+ int recover_attempts = 4;
+ Vector3 sr[max_results * 2];
+
+ do {
+
+ PhysicsServerSW::CollCbkData cbk;
+ cbk.max = max_results;
+ cbk.amount = 0;
+ cbk.ptr = sr;
+
+ CollisionSolverSW::CallbackResult cbkres = NULL;
+
+ PhysicsServerSW::CollCbkData *cbkptr = NULL;
+ cbkptr = &cbk;
+ cbkres = PhysicsServerSW::_shape_col_cbk;
+
+ bool collided = false;
+
+ int amount = _cull_aabb_for_body(p_body, body_aabb);
+
+ for (int j = 0; j < p_body->get_shape_count(); j++) {
+ if (p_body->is_shape_set_as_disabled(j))
+ continue;
+
+ Transform body_shape_xform = body_transform * p_body->get_shape_transform(j);
+ ShapeSW *body_shape = p_body->get_shape(j);
+ for (int i = 0; i < amount; i++) {
+
+ const CollisionObjectSW *col_obj = intersection_query_results[i];
+ int shape_idx = intersection_query_subindex_results[i];
+
+ if (CollisionSolverSW::solve_static(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), cbkres, cbkptr, NULL, p_margin)) {
+ collided = cbk.amount > 0;
+ }
+ }
+ }
+
+ if (!collided) {
+ break;
+ }
+
+ Vector3 recover_motion;
+
+ for (int i = 0; i < cbk.amount; i++) {
+
+ Vector3 a = sr[i * 2 + 0];
+ Vector3 b = sr[i * 2 + 1];
+
+#if 0
+ Vector3 rel = b-a;
+ real_t d = rel.length();
+ if (d==0)
+ continue;
+
+ Vector3 n = rel/d;
+ real_t traveled = n.dot(recover_motion);
+ a+=n*traveled;
+
+ real_t d = a.distance_to(b);
+ if (d<margin)
+ continue;
+#endif
+ recover_motion += (b - a) * 0.4;
+ }
+
+ if (recover_motion == Vector3()) {
+ collided = false;
+ break;
+ }
+
+ body_transform.origin += recover_motion;
+ body_aabb.position += recover_motion;
+
+ recover_attempts--;
+
+ } while (recover_attempts);
+ }
+
+ real_t safe = 1.0;
+ real_t unsafe = 1.0;
+ int best_shape = -1;
+
+ {
+ // STEP 2 ATTEMPT MOTION
+
+ Rect3 motion_aabb = body_aabb;
+ motion_aabb.position += p_motion;
+ motion_aabb = motion_aabb.merge(body_aabb);
+
+ int amount = _cull_aabb_for_body(p_body, motion_aabb);
+
+ for (int j = 0; j < p_body->get_shape_count(); j++) {
+
+ if (p_body->is_shape_set_as_disabled(j))
+ continue;
+
+ Transform body_shape_xform = body_transform * p_body->get_shape_transform(j);
+ ShapeSW *body_shape = p_body->get_shape(j);
+
+ Transform body_shape_xform_inv = body_shape_xform.affine_inverse();
+ MotionShapeSW mshape;
+ mshape.shape = body_shape;
+ mshape.motion = body_shape_xform_inv.basis.xform(p_motion);
+
+ bool stuck = false;
+
+ real_t best_safe = 1;
+ real_t best_unsafe = 1;
+
+ for (int i = 0; i < amount; i++) {
+
+ const CollisionObjectSW *col_obj = intersection_query_results[i];
+ int shape_idx = intersection_query_subindex_results[i];
+
+ //test initial overlap, does it collide if going all the way?
+ Vector3 point_A, point_B;
+ Vector3 sep_axis = p_motion.normalized();
+
+ Transform col_obj_xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx);
+ //test initial overlap, does it collide if going all the way?
+ if (CollisionSolverSW::solve_distance(&mshape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, motion_aabb, &sep_axis)) {
+ //print_line("failed motion cast (no collision)");
+ continue;
+ }
+ sep_axis = p_motion.normalized();
+
+ if (!CollisionSolverSW::solve_distance(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, motion_aabb, &sep_axis)) {
+ //print_line("failed motion cast (no collision)");
+ stuck = true;
+ break;
+ }
+
+ //just do kinematic solving
+ real_t low = 0;
+ real_t hi = 1;
+ Vector3 mnormal = p_motion.normalized();
+
+ for (int i = 0; i < 8; i++) { //steps should be customizable..
+
+ real_t ofs = (low + hi) * 0.5;
+
+ Vector3 sep = mnormal; //important optimization for this to work fast enough
+
+ mshape.motion = body_shape_xform_inv.basis.xform(p_motion * ofs);
+
+ Vector3 lA, lB;
+
+ bool collided = !CollisionSolverSW::solve_distance(&mshape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, lA, lB, motion_aabb, &sep);
+
+ if (collided) {
+
+ //print_line(itos(i)+": "+rtos(ofs));
+ hi = ofs;
+ } else {
+
+ point_A = lA;
+ point_B = lB;
+ low = ofs;
+ }
+ }
+
+ if (low < best_safe) {
+ best_safe = low;
+ best_unsafe = hi;
+ }
+ }
+
+ if (stuck) {
+
+ safe = 0;
+ unsafe = 0;
+ best_shape = j; //sadly it's the best
+ break;
+ }
+ if (best_safe == 1.0) {
+ continue;
+ }
+ if (best_safe < safe) {
+
+ safe = best_safe;
+ unsafe = best_unsafe;
+ best_shape = j;
+ }
+ }
+ }
+
+ bool collided = false;
+ if (safe >= 1) {
+ //not collided
+ collided = false;
+ if (r_result) {
+
+ r_result->motion = p_motion;
+ r_result->remainder = Vector3();
+ r_result->motion += (body_transform.get_origin() - p_from.get_origin());
+ }
+
+ } else {
+
+ //it collided, let's get the rest info in unsafe advance
+ Transform ugt = body_transform;
+ ugt.origin += p_motion * unsafe;
+
+ _RestCallbackData rcd;
+ rcd.best_len = 0;
+ rcd.best_object = NULL;
+ rcd.best_shape = 0;
+
+ Transform body_shape_xform = ugt * p_body->get_shape_transform(best_shape);
+ ShapeSW *body_shape = p_body->get_shape(best_shape);
+
+ body_aabb.position += p_motion * unsafe;
+
+ int amount = _cull_aabb_for_body(p_body, body_aabb);
+
+ for (int i = 0; i < amount; i++) {
+
+ const CollisionObjectSW *col_obj = intersection_query_results[i];
+ int shape_idx = intersection_query_subindex_results[i];
+
+ rcd.object = col_obj;
+ rcd.shape = shape_idx;
+ bool sc = CollisionSolverSW::solve_static(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), _rest_cbk_result, &rcd, NULL, p_margin);
+ if (!sc)
+ continue;
+ }
+
+ if (rcd.best_len != 0) {
+
+ if (r_result) {
+ r_result->collider = rcd.best_object->get_self();
+ r_result->collider_id = rcd.best_object->get_instance_id();
+ r_result->collider_shape = rcd.best_shape;
+ r_result->collision_local_shape = best_shape;
+ r_result->collision_normal = rcd.best_normal;
+ r_result->collision_point = rcd.best_contact;
+ //r_result->collider_metadata = rcd.best_object->get_shape_metadata(rcd.best_shape);
+
+ const BodySW *body = static_cast<const BodySW *>(rcd.best_object);
+ //Vector3 rel_vec = r_result->collision_point - body->get_transform().get_origin();
+ // r_result->collider_velocity = Vector3(-body->get_angular_velocity() * rel_vec.y, body->get_angular_velocity() * rel_vec.x) + body->get_linear_velocity();
+ r_result->collider_velocity = body->get_linear_velocity() + (body->get_angular_velocity()).cross(body->get_transform().origin - rcd.best_contact); // * mPos);
+
+ r_result->motion = safe * p_motion;
+ r_result->remainder = p_motion - safe * p_motion;
+ r_result->motion += (body_transform.get_origin() - p_from.get_origin());
+ }
+
+ collided = true;
+ } else {
+ if (r_result) {
+
+ r_result->motion = p_motion;
+ r_result->remainder = Vector3();
+ r_result->motion += (body_transform.get_origin() - p_from.get_origin());
+ }
+
+ collided = false;
+ }
+ }
+
+ return collided;
+}
+
void *SpaceSW::_broadphase_pair(CollisionObjectSW *A, int p_subindex_A, CollisionObjectSW *B, int p_subindex_B, void *p_self) {
CollisionObjectSW::Type type_A = A->get_type();
@@ -596,8 +1014,8 @@ void SpaceSW::set_param(PhysicsServer::SpaceParameter p_param, real_t p_value) {
case PhysicsServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: contact_recycle_radius = p_value; break;
case PhysicsServer::SPACE_PARAM_CONTACT_MAX_SEPARATION: contact_max_separation = p_value; break;
case PhysicsServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: contact_max_allowed_penetration = p_value; break;
- case PhysicsServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD: body_linear_velocity_sleep_threshold = p_value; break;
- case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD: body_angular_velocity_sleep_threshold = p_value; break;
+ case PhysicsServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: body_linear_velocity_sleep_threshold = p_value; break;
+ case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: body_angular_velocity_sleep_threshold = p_value; break;
case PhysicsServer::SPACE_PARAM_BODY_TIME_TO_SLEEP: body_time_to_sleep = p_value; break;
case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO: body_angular_velocity_damp_ratio = p_value; break;
case PhysicsServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: constraint_bias = p_value; break;
@@ -611,8 +1029,8 @@ real_t SpaceSW::get_param(PhysicsServer::SpaceParameter p_param) const {
case PhysicsServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: return contact_recycle_radius;
case PhysicsServer::SPACE_PARAM_CONTACT_MAX_SEPARATION: return contact_max_separation;
case PhysicsServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: return contact_max_allowed_penetration;
- case PhysicsServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD: return body_linear_velocity_sleep_threshold;
- case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD: return body_angular_velocity_sleep_threshold;
+ case PhysicsServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: return body_linear_velocity_sleep_threshold;
+ case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: return body_angular_velocity_sleep_threshold;
case PhysicsServer::SPACE_PARAM_BODY_TIME_TO_SLEEP: return body_time_to_sleep;
case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO: return body_angular_velocity_damp_ratio;
case PhysicsServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: return constraint_bias;
diff --git a/servers/physics/space_sw.h b/servers/physics/space_sw.h
index 06538265bb..dc7799d992 100644
--- a/servers/physics/space_sw.h
+++ b/servers/physics/space_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,8 +36,8 @@
#include "body_sw.h"
#include "broad_phase_sw.h"
#include "collision_object_sw.h"
-#include "global_config.h"
#include "hash_map.h"
+#include "project_settings.h"
#include "typedefs.h"
class PhysicsDirectSpaceStateSW : public PhysicsDirectSpaceState {
@@ -46,11 +47,13 @@ class PhysicsDirectSpaceStateSW : public PhysicsDirectSpaceState {
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, 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);
+ virtual int intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION);
+ virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 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, real_t p_margin, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 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_collision_layer = 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_collision_layer = 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION);
+ virtual Vector3 get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const;
PhysicsDirectSpaceStateSW();
};
@@ -119,6 +122,8 @@ private:
friend class PhysicsDirectSpaceStateSW;
+ int _cull_aabb_for_body(BodySW *p_body, const Rect3 &p_aabb);
+
public:
_FORCE_INLINE_ void set_self(const RID &p_self) { self = p_self; }
_FORCE_INLINE_ RID get_self() const { return self; }
@@ -151,8 +156,8 @@ public:
_FORCE_INLINE_ real_t get_contact_max_separation() const { return contact_max_separation; }
_FORCE_INLINE_ real_t get_contact_max_allowed_penetration() const { return contact_max_allowed_penetration; }
_FORCE_INLINE_ real_t get_constraint_bias() const { return constraint_bias; }
- _FORCE_INLINE_ real_t get_body_linear_velocity_sleep_treshold() const { return body_linear_velocity_sleep_threshold; }
- _FORCE_INLINE_ real_t get_body_angular_velocity_sleep_treshold() const { return body_angular_velocity_sleep_threshold; }
+ _FORCE_INLINE_ real_t get_body_linear_velocity_sleep_threshold() const { return body_linear_velocity_sleep_threshold; }
+ _FORCE_INLINE_ real_t get_body_angular_velocity_sleep_threshold() const { return body_angular_velocity_sleep_threshold; }
_FORCE_INLINE_ real_t get_body_time_to_sleep() const { return body_time_to_sleep; }
_FORCE_INLINE_ real_t get_body_angular_velocity_damp_ratio() const { return body_angular_velocity_damp_ratio; }
@@ -191,6 +196,8 @@ public:
void set_elapsed_time(ElapsedTime p_time, uint64_t p_msec) { elapsed_time[p_time] = p_msec; }
uint64_t get_elapsed_time(ElapsedTime p_time) const { return elapsed_time[p_time]; }
+ bool test_body_motion(BodySW *p_body, const Transform &p_from, const Vector3 &p_motion, real_t p_margin, PhysicsServer::MotionResult *r_result);
+
SpaceSW();
~SpaceSW();
};
diff --git a/servers/physics/step_sw.cpp b/servers/physics/step_sw.cpp
index c7b1be7a9b..5b5f5201db 100644
--- a/servers/physics/step_sw.cpp
+++ b/servers/physics/step_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics/step_sw.h b/servers/physics/step_sw.h
index 54f5fe9857..893bcfa6ad 100644
--- a/servers/physics/step_sw.h
+++ b/servers/physics/step_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/area_2d_sw.cpp b/servers/physics_2d/area_2d_sw.cpp
index 885ede7cbf..fc5167c720 100644
--- a/servers/physics_2d/area_2d_sw.cpp
+++ b/servers/physics_2d/area_2d_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/area_2d_sw.h b/servers/physics_2d/area_2d_sw.h
index 8c52c96527..6d74a4b0f6 100644
--- a/servers/physics_2d/area_2d_sw.h
+++ b/servers/physics_2d/area_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -152,6 +153,7 @@ public:
_FORCE_INLINE_ void add_constraint(Constraint2DSW *p_constraint) { constraints.insert(p_constraint); }
_FORCE_INLINE_ void remove_constraint(Constraint2DSW *p_constraint) { constraints.erase(p_constraint); }
_FORCE_INLINE_ const Set<Constraint2DSW *> &get_constraints() const { return constraints; }
+ _FORCE_INLINE_ void clear_constraints() { constraints.clear(); }
void set_monitorable(bool p_monitorable);
_FORCE_INLINE_ bool is_monitorable() const { return monitorable; }
diff --git a/servers/physics_2d/area_pair_2d_sw.cpp b/servers/physics_2d/area_pair_2d_sw.cpp
index 769db8eb35..184db944da 100644
--- a/servers/physics_2d/area_pair_2d_sw.cpp
+++ b/servers/physics_2d/area_pair_2d_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,7 +32,13 @@
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);
+ bool result = false;
+
+ if (area->is_shape_set_as_disabled(area_shape) || body->is_shape_set_as_disabled(body_shape)) {
+ result = false;
+ } else if (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)) {
+ result = true;
+ }
if (result != colliding) {
@@ -89,7 +96,12 @@ AreaPair2DSW::~AreaPair2DSW() {
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);
+ bool result = false;
+ if (area_a->is_shape_set_as_disabled(shape_a) || area_b->is_shape_set_as_disabled(shape_b)) {
+ result = false;
+ } else if (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)) {
+ result = true;
+ }
if (result != colliding) {
diff --git a/servers/physics_2d/area_pair_2d_sw.h b/servers/physics_2d/area_pair_2d_sw.h
index 78be9572bf..05954424f8 100644
--- a/servers/physics_2d/area_pair_2d_sw.h
+++ b/servers/physics_2d/area_pair_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp
index 26f319559e..91b5646ef5 100644
--- a/servers/physics_2d/body_2d_sw.cpp
+++ b/servers/physics_2d/body_2d_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -620,7 +621,7 @@ bool Body2DSW::sleep_test(real_t p_step) {
else if (!can_sleep)
return false;
- if (Math::abs(angular_velocity) < get_space()->get_body_angular_velocity_sleep_treshold() && Math::abs(linear_velocity.length_squared()) < get_space()->get_body_linear_velocity_sleep_treshold() * get_space()->get_body_linear_velocity_sleep_treshold()) {
+ if (Math::abs(angular_velocity) < get_space()->get_body_angular_velocity_sleep_threshold() && Math::abs(linear_velocity.length_squared()) < get_space()->get_body_linear_velocity_sleep_threshold() * get_space()->get_body_linear_velocity_sleep_threshold()) {
still_time += p_step;
@@ -675,8 +676,6 @@ Body2DSW::Body2DSW()
area_linear_damp = 0;
contact_count = 0;
gravity_scale = 1.0;
- using_one_way_cache = false;
- one_way_collision_max_depth = 0.1;
first_integration = false;
still_time = 0;
diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h
index 7e4fef8df3..412f2f51cd 100644
--- a/servers/physics_2d/body_2d_sw.h
+++ b/servers/physics_2d/body_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -66,9 +67,6 @@ class Body2DSW : public CollisionObject2DSW {
Vector2 applied_force;
real_t applied_torque;
- Vector2 one_way_collision_direction;
- real_t one_way_collision_max_depth;
-
SelfList<Body2DSW> active_list;
SelfList<Body2DSW> inertia_update_list;
SelfList<Body2DSW> direct_state_query_list;
@@ -80,7 +78,6 @@ class Body2DSW : public CollisionObject2DSW {
bool can_sleep;
bool first_time_kinematic;
bool first_integration;
- bool using_one_way_cache;
void _update_inertia();
virtual void _shapes_changed();
Transform2D new_transform;
@@ -184,6 +181,7 @@ public:
_FORCE_INLINE_ void add_constraint(Constraint2DSW *p_constraint, int p_pos) { constraint_map[p_constraint] = p_pos; }
_FORCE_INLINE_ void remove_constraint(Constraint2DSW *p_constraint) { constraint_map.erase(p_constraint); }
const Map<Constraint2DSW *, int> &get_constraint_map() const { return constraint_map; }
+ _FORCE_INLINE_ void clear_constraint_map() { constraint_map.clear(); }
_FORCE_INLINE_ void set_omit_force_integration(bool p_omit_force_integration) { omit_force_integration = p_omit_force_integration; }
_FORCE_INLINE_ bool get_omit_force_integration() const { return omit_force_integration; }
@@ -245,17 +243,6 @@ public:
_FORCE_INLINE_ void set_continuous_collision_detection_mode(Physics2DServer::CCDMode p_mode) { continuous_cd_mode = p_mode; }
_FORCE_INLINE_ Physics2DServer::CCDMode get_continuous_collision_detection_mode() const { return continuous_cd_mode; }
- void set_one_way_collision_direction(const Vector2 &p_dir) {
- one_way_collision_direction = p_dir;
- using_one_way_cache = one_way_collision_direction != Vector2();
- }
- Vector2 get_one_way_collision_direction() const { return one_way_collision_direction; }
-
- 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; }
-
void set_space(Space2DSW *p_space);
void update_inertias();
diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp
index ee94a7acec..484d4503d0 100644
--- a/servers/physics_2d/body_pair_2d_sw.cpp
+++ b/servers/physics_2d/body_pair_2d_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -224,6 +225,11 @@ bool BodyPair2DSW::setup(real_t p_step) {
return false;
}
+ if (A->is_shape_set_as_disabled(shape_A) || B->is_shape_set_as_disabled(shape_B)) {
+ collided = false;
+ return false;
+ }
+
//use local A coordinates to avoid numerical issues on collision detection
offset_B = B->get_transform().get_origin() - A->get_transform().get_origin();
@@ -279,8 +285,8 @@ bool BodyPair2DSW::setup(real_t p_step) {
//if (!prev_collided) {
{
- if (A->is_using_one_way_collision()) {
- Vector2 direction = A->get_one_way_collision_direction();
+ if (A->is_shape_set_as_one_way_collision(shape_A)) {
+ Vector2 direction = xform_A.get_axis(1).normalized();
bool valid = false;
if (B->get_linear_velocity().dot(direction) >= 0) {
for (int i = 0; i < contact_count; i++) {
@@ -302,8 +308,8 @@ bool BodyPair2DSW::setup(real_t p_step) {
}
}
- if (B->is_using_one_way_collision()) {
- Vector2 direction = B->get_one_way_collision_direction();
+ if (B->is_shape_set_as_one_way_collision(shape_B)) {
+ Vector2 direction = xform_B.get_axis(1).normalized();
bool valid = false;
if (A->get_linear_velocity().dot(direction) >= 0) {
for (int i = 0; i < contact_count; i++) {
@@ -389,7 +395,7 @@ bool BodyPair2DSW::setup(real_t p_step) {
}
}
- if (A->is_shape_set_as_trigger(shape_A) || B->is_shape_set_as_trigger(shape_B) || (A->get_mode() <= Physics2DServer::BODY_MODE_KINEMATIC && B->get_mode() <= Physics2DServer::BODY_MODE_KINEMATIC)) {
+ if ((A->get_mode() <= Physics2DServer::BODY_MODE_KINEMATIC && B->get_mode() <= Physics2DServer::BODY_MODE_KINEMATIC)) {
c.active = false;
collided = false;
continue;
diff --git a/servers/physics_2d/body_pair_2d_sw.h b/servers/physics_2d/body_pair_2d_sw.h
index 023c182c31..4d2b3b31f9 100644
--- a/servers/physics_2d/body_pair_2d_sw.h
+++ b/servers/physics_2d/body_pair_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/broad_phase_2d_basic.cpp b/servers/physics_2d/broad_phase_2d_basic.cpp
index c282c0364e..76094ad98c 100644
--- a/servers/physics_2d/broad_phase_2d_basic.cpp
+++ b/servers/physics_2d/broad_phase_2d_basic.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -123,10 +124,10 @@ void BroadPhase2DBasic::set_pair_callback(PairCallback p_pair_callback, void *p_
pair_userdata = p_userdata;
pair_callback = p_pair_callback;
}
-void BroadPhase2DBasic::set_unpair_callback(UnpairCallback p_pair_callback, void *p_userdata) {
+void BroadPhase2DBasic::set_unpair_callback(UnpairCallback p_unpair_callback, void *p_userdata) {
unpair_userdata = p_userdata;
- unpair_callback = p_pair_callback;
+ unpair_callback = p_unpair_callback;
}
void BroadPhase2DBasic::update() {
diff --git a/servers/physics_2d/broad_phase_2d_basic.h b/servers/physics_2d/broad_phase_2d_basic.h
index 7c5d799f9a..edd788266a 100644
--- a/servers/physics_2d/broad_phase_2d_basic.h
+++ b/servers/physics_2d/broad_phase_2d_basic.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp
index 74c01e1220..0330bfa9f3 100644
--- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp
+++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "broad_phase_2d_hash_grid.h"
-#include "global_config.h"
+#include "project_settings.h"
#define LARGE_ELEMENT_FI 1.01239812
@@ -115,8 +116,8 @@ void BroadPhase2DHashGrid::_enter_grid(Element *p_elem, const Rect2 &p_rect, boo
return;
}
- Point2i from = (p_rect.pos / cell_size).floor();
- Point2i to = ((p_rect.pos + p_rect.size) / cell_size).floor();
+ Point2i from = (p_rect.position / cell_size).floor();
+ Point2i to = ((p_rect.position + p_rect.size) / cell_size).floor();
for (int i = from.x; i <= to.x; i++) {
@@ -202,9 +203,11 @@ void BroadPhase2DHashGrid::_exit_grid(Element *p_elem, const Rect2 &p_rect, bool
if (sz.width * sz.height > large_object_min_surface) {
//unpair all elements, instead of checking all, just check what is already paired, so we at least save from checking static vs static
- for (Map<Element *, PairData *>::Element *E = p_elem->paired.front(); E; E = E->next()) {
-
+ Map<Element *, PairData *>::Element *E = p_elem->paired.front();
+ while (E) {
+ Map<Element *, PairData *>::Element *next = E->next();
_unpair_attempt(p_elem, E->key());
+ E = next;
}
if (large_elements[p_elem].dec() == 0) {
@@ -213,8 +216,8 @@ void BroadPhase2DHashGrid::_exit_grid(Element *p_elem, const Rect2 &p_rect, bool
return;
}
- Point2i from = (p_rect.pos / cell_size).floor();
- Point2i to = ((p_rect.pos + p_rect.size) / cell_size).floor();
+ Point2i from = (p_rect.position / cell_size).floor();
+ Point2i to = ((p_rect.position + p_rect.size) / cell_size).floor();
for (int i = from.x; i <= to.x; i++) {
@@ -573,8 +576,8 @@ int BroadPhase2DHashGrid::cull_aabb(const Rect2 &p_aabb, CollisionObject2DSW **p
pass++;
- Point2i from = (p_aabb.pos / cell_size).floor();
- Point2i to = ((p_aabb.pos + p_aabb.size) / cell_size).floor();
+ Point2i from = (p_aabb.position / cell_size).floor();
+ Point2i to = ((p_aabb.position + p_aabb.size) / cell_size).floor();
int cullcount = 0;
for (int i = from.x; i <= to.x; i++) {
@@ -635,7 +638,7 @@ BroadPhase2DHashGrid::BroadPhase2DHashGrid() {
hash_table = memnew_arr(PosBin *, hash_table_size);
cell_size = GLOBAL_DEF("physics/2d/cell_size", 128);
- large_object_min_surface = GLOBAL_DEF("physics/2d/large_object_surface_treshold_in_cells", 512);
+ large_object_min_surface = GLOBAL_DEF("physics/2d/large_object_surface_threshold_in_cells", 512);
for (int i = 0; i < hash_table_size; i++)
hash_table[i] = NULL;
diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.h b/servers/physics_2d/broad_phase_2d_hash_grid.h
index f30f72d6db..0cb3edb94f 100644
--- a/servers/physics_2d/broad_phase_2d_hash_grid.h
+++ b/servers/physics_2d/broad_phase_2d_hash_grid.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -166,7 +167,7 @@ class BroadPhase2DHashGrid : public BroadPhase2DSW {
void _check_motion(Element *p_elem);
public:
- virtual ID create(CollisionObject2DSW *p_object_, int p_subindex = 0);
+ virtual ID create(CollisionObject2DSW *p_object, int p_subindex = 0);
virtual void move(ID p_id, const Rect2 &p_aabb);
virtual void set_static(ID p_id, bool p_static);
virtual void remove(ID p_id);
diff --git a/servers/physics_2d/broad_phase_2d_sw.cpp b/servers/physics_2d/broad_phase_2d_sw.cpp
index 8cde46217b..a412f76567 100644
--- a/servers/physics_2d/broad_phase_2d_sw.cpp
+++ b/servers/physics_2d/broad_phase_2d_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/broad_phase_2d_sw.h b/servers/physics_2d/broad_phase_2d_sw.h
index a255cc6ba7..0309cbe730 100644
--- a/servers/physics_2d/broad_phase_2d_sw.h
+++ b/servers/physics_2d/broad_phase_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/collision_object_2d_sw.cpp b/servers/physics_2d/collision_object_2d_sw.cpp
index 30bb9f6b52..8f13f1130a 100644
--- a/servers/physics_2d/collision_object_2d_sw.cpp
+++ b/servers/physics_2d/collision_object_2d_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -36,7 +37,8 @@ void CollisionObject2DSW::add_shape(Shape2DSW *p_shape, const Transform2D &p_tra
s.xform = p_transform;
s.xform_inv = s.xform.affine_inverse();
s.bpid = 0; //needs update
- s.trigger = false;
+ s.disabled = false;
+ s.one_way_collision = false;
shapes.push_back(s);
p_shape->add_owner(this);
_update_shapes();
@@ -168,7 +170,7 @@ void CollisionObject2DSW::_update_shapes_with_motion(const Vector2 &p_motion) {
Rect2 shape_aabb = s.shape->get_aabb();
Transform2D xform = transform * s.xform;
shape_aabb = xform.xform(shape_aabb);
- shape_aabb = shape_aabb.merge(Rect2(shape_aabb.pos + p_motion, shape_aabb.size)); //use motion
+ shape_aabb = shape_aabb.merge(Rect2(shape_aabb.position + p_motion, shape_aabb.size)); //use motion
s.aabb_cache = shape_aabb;
space->get_broadphase()->move(s.bpid, shape_aabb);
@@ -213,6 +215,6 @@ CollisionObject2DSW::CollisionObject2DSW(Type p_type) {
space = NULL;
instance_id = 0;
collision_mask = 1;
- layer_mask = 1;
+ collision_layer = 1;
pickable = true;
}
diff --git a/servers/physics_2d/collision_object_2d_sw.h b/servers/physics_2d/collision_object_2d_sw.h
index e6eec05f3d..ad8edb0b3d 100644
--- a/servers/physics_2d/collision_object_2d_sw.h
+++ b/servers/physics_2d/collision_object_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -57,8 +58,12 @@ private:
Rect2 aabb_cache; //for rayqueries
Shape2DSW *shape;
Variant metadata;
- bool trigger;
- Shape() { trigger = false; }
+ bool disabled;
+ bool one_way_collision;
+ Shape() {
+ disabled = false;
+ one_way_collision = false;
+ }
};
Vector<Shape> shapes;
@@ -66,7 +71,7 @@ private:
Transform2D transform;
Transform2D inv_transform;
uint32_t collision_mask;
- uint32_t layer_mask;
+ uint32_t collision_layer;
bool _static;
void _update_shapes();
@@ -85,7 +90,7 @@ protected:
void _set_static(bool p_static);
virtual void _shapes_changed() = 0;
- void _set_space(Space2DSW *space);
+ void _set_space(Space2DSW *p_space);
CollisionObject2DSW(Type p_type);
@@ -115,14 +120,17 @@ public:
_FORCE_INLINE_ Transform2D get_inv_transform() const { return inv_transform; }
_FORCE_INLINE_ Space2DSW *get_space() const { return space; }
- _FORCE_INLINE_ void set_shape_as_trigger(int p_idx, bool p_enable) { shapes[p_idx].trigger = p_enable; }
- _FORCE_INLINE_ bool is_shape_set_as_trigger(int p_idx) const { return shapes[p_idx].trigger; }
+ _FORCE_INLINE_ void set_shape_as_disabled(int p_idx, bool p_disabled) { shapes[p_idx].disabled = p_disabled; }
+ _FORCE_INLINE_ bool is_shape_set_as_disabled(int p_idx) const { return shapes[p_idx].disabled; }
+
+ _FORCE_INLINE_ void set_shape_as_one_way_collision(int p_idx, bool p_one_way_collision) { shapes[p_idx].one_way_collision = p_one_way_collision; }
+ _FORCE_INLINE_ bool is_shape_set_as_one_way_collision(int p_idx) const { return shapes[p_idx].one_way_collision; }
void set_collision_mask(uint32_t p_mask) { collision_mask = p_mask; }
_FORCE_INLINE_ uint32_t get_collision_mask() const { return collision_mask; }
- void set_layer_mask(uint32_t p_mask) { layer_mask = p_mask; }
- _FORCE_INLINE_ uint32_t get_layer_mask() const { return layer_mask; }
+ void set_collision_layer(uint32_t p_layer) { collision_layer = p_layer; }
+ _FORCE_INLINE_ uint32_t get_collision_layer() const { return collision_layer; }
void remove_shape(Shape2DSW *p_shape);
void remove_shape(int p_index);
@@ -136,7 +144,7 @@ public:
_FORCE_INLINE_ bool test_collision_mask(CollisionObject2DSW *p_other) const {
- return layer_mask & p_other->collision_mask || p_other->layer_mask & collision_mask;
+ return collision_layer & p_other->collision_mask || p_other->collision_layer & collision_mask;
}
virtual ~CollisionObject2DSW() {}
diff --git a/servers/physics_2d/collision_solver_2d_sat.cpp b/servers/physics_2d/collision_solver_2d_sat.cpp
index f72a7ef0e4..a5a6cd7eac 100644
--- a/servers/physics_2d/collision_solver_2d_sat.cpp
+++ b/servers/physics_2d/collision_solver_2d_sat.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/collision_solver_2d_sat.h b/servers/physics_2d/collision_solver_2d_sat.h
index a13c3dd14d..2a075e2a30 100644
--- a/servers/physics_2d/collision_solver_2d_sat.h
+++ b/servers/physics_2d/collision_solver_2d_sat.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp
index 6218af72a1..b482f826c2 100644
--- a/servers/physics_2d/collision_solver_2d_sw.cpp
+++ b/servers/physics_2d/collision_solver_2d_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -202,7 +203,7 @@ bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A, const Transf
smin *= axis_scale;
smax *= axis_scale;
- local_aabb.pos[i] = smin;
+ local_aabb.position[i] = smin;
local_aabb.size[i] = smax - smin;
}
diff --git a/servers/physics_2d/collision_solver_2d_sw.h b/servers/physics_2d/collision_solver_2d_sw.h
index 886cb90ace..aefd4d315d 100644
--- a/servers/physics_2d/collision_solver_2d_sw.h
+++ b/servers/physics_2d/collision_solver_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/constraint_2d_sw.h b/servers/physics_2d/constraint_2d_sw.h
index 659b5b3219..7ff28b0cf4 100644
--- a/servers/physics_2d/constraint_2d_sw.h
+++ b/servers/physics_2d/constraint_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp
index 0277586495..449765621e 100644
--- a/servers/physics_2d/joints_2d_sw.cpp
+++ b/servers/physics_2d/joints_2d_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/joints_2d_sw.h b/servers/physics_2d/joints_2d_sw.h
index 8fe38f365a..548a8b778f 100644
--- a/servers/physics_2d/joints_2d_sw.h
+++ b/servers/physics_2d/joints_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp
index 92555e26b6..3805075ac3 100644
--- a/servers/physics_2d/physics_2d_server_sw.cpp
+++ b/servers/physics_2d/physics_2d_server_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,8 +31,8 @@
#include "broad_phase_2d_basic.h"
#include "broad_phase_2d_hash_grid.h"
#include "collision_solver_2d_sw.h"
-#include "global_config.h"
#include "os/os.h"
+#include "project_settings.h"
#include "script_language.h"
RID Physics2DServerSW::shape_create(ShapeType p_shape) {
@@ -285,12 +286,24 @@ void Physics2DServerSW::area_set_space(RID p_area, RID p_space) {
Area2DSW *area = area_owner.get(p_area);
ERR_FAIL_COND(!area);
+
Space2DSW *space = NULL;
if (p_space.is_valid()) {
space = space_owner.get(p_space);
ERR_FAIL_COND(!space);
}
+ if (area->get_space() == space)
+ return; //pointless
+
+ for (Set<Constraint2DSW *>::Element *E = area->get_constraints().front(); E; E = E->next()) {
+ RID self = E->get()->get_self();
+ if (!self.is_valid())
+ continue;
+ free(self);
+ }
+ area->clear_constraints();
+
area->set_space(space);
};
@@ -351,6 +364,15 @@ void Physics2DServerSW::area_set_shape_transform(RID p_area, int p_shape_idx, co
area->set_shape_transform(p_shape_idx, p_transform);
}
+void Physics2DServerSW::area_set_shape_disabled(RID p_area, int p_shape, bool p_disabled) {
+
+ Area2DSW *area = area_owner.get(p_area);
+ ERR_FAIL_COND(!area);
+
+ ERR_FAIL_INDEX(p_shape, area->get_shape_count());
+ area->set_shape_as_disabled(p_shape, p_disabled);
+}
+
int Physics2DServerSW::area_get_shape_count(RID p_area) const {
Area2DSW *area = area_owner.get(p_area);
@@ -393,7 +415,7 @@ void Physics2DServerSW::area_clear_shapes(RID p_area) {
area->remove_shape(0);
}
-void Physics2DServerSW::area_attach_object_instance_ID(RID p_area, ObjectID p_ID) {
+void Physics2DServerSW::area_attach_object_instance_id(RID p_area, ObjectID p_ID) {
if (space_owner.owns(p_area)) {
Space2DSW *space = space_owner.get(p_area);
@@ -403,7 +425,7 @@ void Physics2DServerSW::area_attach_object_instance_ID(RID p_area, ObjectID p_ID
ERR_FAIL_COND(!area);
area->set_instance_id(p_ID);
}
-ObjectID Physics2DServerSW::area_get_object_instance_ID(RID p_area) const {
+ObjectID Physics2DServerSW::area_get_object_instance_id(RID p_area) const {
if (space_owner.owns(p_area)) {
Space2DSW *space = space_owner.get(p_area);
@@ -475,12 +497,12 @@ void Physics2DServerSW::area_set_collision_mask(RID p_area, uint32_t p_mask) {
area->set_collision_mask(p_mask);
}
-void Physics2DServerSW::area_set_layer_mask(RID p_area, uint32_t p_mask) {
+void Physics2DServerSW::area_set_collision_layer(RID p_area, uint32_t p_layer) {
Area2DSW *area = area_owner.get(p_area);
ERR_FAIL_COND(!area);
- area->set_layer_mask(p_mask);
+ area->set_collision_layer(p_layer);
}
void Physics2DServerSW::area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
@@ -488,7 +510,7 @@ void Physics2DServerSW::area_set_monitor_callback(RID p_area, Object *p_receiver
Area2DSW *area = area_owner.get(p_area);
ERR_FAIL_COND(!area);
- area->set_monitor_callback(p_receiver ? p_receiver->get_instance_ID() : 0, p_method);
+ area->set_monitor_callback(p_receiver ? p_receiver->get_instance_id() : 0, p_method);
}
void Physics2DServerSW::area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
@@ -496,7 +518,7 @@ void Physics2DServerSW::area_set_area_monitor_callback(RID p_area, Object *p_rec
Area2DSW *area = area_owner.get(p_area);
ERR_FAIL_COND(!area);
- area->set_area_monitor_callback(p_receiver ? p_receiver->get_instance_ID() : 0, p_method);
+ area->set_area_monitor_callback(p_receiver ? p_receiver->get_instance_id() : 0, p_method);
}
/* BODY API */
@@ -523,6 +545,17 @@ void Physics2DServerSW::body_set_space(RID p_body, RID p_space) {
ERR_FAIL_COND(!space);
}
+ if (body->get_space() == space)
+ return; //pointless
+
+ for (Map<Constraint2DSW *, int>::Element *E = body->get_constraint_map().front(); E; E = E->next()) {
+ RID self = E->key()->get_self();
+ if (!self.is_valid())
+ continue;
+ free(self);
+ }
+ body->clear_constraint_map();
+
body->set_space(space);
};
@@ -639,24 +672,23 @@ void Physics2DServerSW::body_clear_shapes(RID p_body) {
body->remove_shape(0);
}
-void Physics2DServerSW::body_set_shape_as_trigger(RID p_body, int p_shape_idx, bool p_enable) {
+void Physics2DServerSW::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) {
Body2DSW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
ERR_FAIL_INDEX(p_shape_idx, body->get_shape_count());
- body->set_shape_as_trigger(p_shape_idx, p_enable);
+ body->set_shape_as_disabled(p_shape_idx, p_disabled);
}
+void Physics2DServerSW::body_set_shape_as_one_way_collision(RID p_body, int p_shape_idx, bool p_enable) {
-bool Physics2DServerSW::body_is_shape_set_as_trigger(RID p_body, int p_shape_idx) const {
-
- const Body2DSW *body = body_owner.get(p_body);
- ERR_FAIL_COND_V(!body, false);
+ Body2DSW *body = body_owner.get(p_body);
+ ERR_FAIL_COND(!body);
- ERR_FAIL_INDEX_V(p_shape_idx, body->get_shape_count(), false);
+ ERR_FAIL_INDEX(p_shape_idx, body->get_shape_count());
- return body->is_shape_set_as_trigger(p_shape_idx);
+ body->set_shape_as_one_way_collision(p_shape_idx, p_enable);
}
void Physics2DServerSW::body_set_continuous_collision_detection_mode(RID p_body, CCDMode p_mode) {
@@ -674,7 +706,7 @@ Physics2DServerSW::CCDMode Physics2DServerSW::body_get_continuous_collision_dete
return body->get_continuous_collision_detection_mode();
}
-void Physics2DServerSW::body_attach_object_instance_ID(RID p_body, uint32_t p_ID) {
+void Physics2DServerSW::body_attach_object_instance_id(RID p_body, uint32_t p_ID) {
Body2DSW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
@@ -682,7 +714,7 @@ void Physics2DServerSW::body_attach_object_instance_ID(RID p_body, uint32_t p_ID
body->set_instance_id(p_ID);
};
-uint32_t Physics2DServerSW::body_get_object_instance_ID(RID p_body) const {
+uint32_t Physics2DServerSW::body_get_object_instance_id(RID p_body) const {
Body2DSW *body = body_owner.get(p_body);
ERR_FAIL_COND_V(!body, 0);
@@ -690,26 +722,26 @@ uint32_t Physics2DServerSW::body_get_object_instance_ID(RID p_body) const {
return body->get_instance_id();
};
-void Physics2DServerSW::body_set_layer_mask(RID p_body, uint32_t p_flags) {
+void Physics2DServerSW::body_set_collision_layer(RID p_body, uint32_t p_layer) {
Body2DSW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
- body->set_layer_mask(p_flags);
+ body->set_collision_layer(p_layer);
};
-uint32_t Physics2DServerSW::body_get_layer_mask(RID p_body) const {
+uint32_t Physics2DServerSW::body_get_collision_layer(RID p_body) const {
Body2DSW *body = body_owner.get(p_body);
ERR_FAIL_COND_V(!body, 0);
- return body->get_layer_mask();
+ return body->get_collision_layer();
};
-void Physics2DServerSW::body_set_collision_mask(RID p_body, uint32_t p_flags) {
+void Physics2DServerSW::body_set_collision_mask(RID p_body, uint32_t p_mask) {
Body2DSW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
- body->set_collision_mask(p_flags);
+ body->set_collision_mask(p_mask);
};
uint32_t Physics2DServerSW::body_get_collision_mask(RID p_body) const {
@@ -844,13 +876,13 @@ void Physics2DServerSW::body_get_collision_exceptions(RID p_body, List<RID> *p_e
}
};
-void Physics2DServerSW::body_set_contacts_reported_depth_treshold(RID p_body, real_t p_treshold) {
+void Physics2DServerSW::body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold) {
Body2DSW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
};
-real_t Physics2DServerSW::body_get_contacts_reported_depth_treshold(RID p_body) const {
+real_t Physics2DServerSW::body_get_contacts_reported_depth_threshold(RID p_body) const {
Body2DSW *body = body_owner.get(p_body);
ERR_FAIL_COND_V(!body, 0);
@@ -886,39 +918,11 @@ int Physics2DServerSW::body_get_max_contacts_reported(RID p_body) const {
return body->get_max_contacts_reported();
}
-void Physics2DServerSW::body_set_one_way_collision_direction(RID p_body, const Vector2 &p_direction) {
-
- Body2DSW *body = body_owner.get(p_body);
- ERR_FAIL_COND(!body);
- body->set_one_way_collision_direction(p_direction);
-}
-
-Vector2 Physics2DServerSW::body_get_one_way_collision_direction(RID p_body) const {
-
- Body2DSW *body = body_owner.get(p_body);
- ERR_FAIL_COND_V(!body, Vector2());
- return body->get_one_way_collision_direction();
-}
-
-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);
- body->set_one_way_collision_max_depth(p_max_depth);
-}
-
-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);
- return body->get_one_way_collision_max_depth();
-}
-
void Physics2DServerSW::body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata) {
Body2DSW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
- body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_ID() : ObjectID(0), p_method, p_udata);
+ body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(0), p_method, p_udata);
}
bool Physics2DServerSW::body_collide_shape(RID p_body, int p_body_shape, RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, Vector2 *r_results, int p_result_max, int &r_result_count) {
@@ -1092,19 +1096,13 @@ void Physics2DServerSW::free(RID p_rid) {
_clear_query(body->get_direct_state_query());
*/
- body->set_space(NULL);
+ body_set_space(p_rid, RID());
while (body->get_shape_count()) {
body->remove_shape(0);
}
- while (body->get_constraint_map().size()) {
- RID self = body->get_constraint_map().front()->key()->get_self();
- ERR_FAIL_COND(!self.is_valid());
- free(self);
- }
-
body_owner.free(p_rid);
memdelete(body);
@@ -1283,7 +1281,7 @@ Physics2DServerSW::Physics2DServerSW() {
island_count = 0;
active_objects = 0;
collision_pairs = 0;
- using_threads = int(GlobalConfig::get_singleton()->get("physics/2d/thread_model")) == 2;
+ using_threads = int(ProjectSettings::get_singleton()->get("physics/2d/thread_model")) == 2;
};
Physics2DServerSW::~Physics2DServerSW(){
diff --git a/servers/physics_2d/physics_2d_server_sw.h b/servers/physics_2d/physics_2d_server_sw.h
index b49c37ab21..e767aad1da 100644
--- a/servers/physics_2d/physics_2d_server_sw.h
+++ b/servers/physics_2d/physics_2d_server_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -122,20 +123,22 @@ public:
virtual RID area_get_shape(RID p_area, int p_shape_idx) const;
virtual Transform2D area_get_shape_transform(RID p_area, int p_shape_idx) const;
+ virtual void area_set_shape_disabled(RID p_area, int p_shape, bool p_disabled);
+
virtual void area_remove_shape(RID p_area, int p_shape_idx);
virtual void area_clear_shapes(RID p_area);
- virtual void area_attach_object_instance_ID(RID p_area, ObjectID p_ID);
- virtual ObjectID area_get_object_instance_ID(RID p_area) const;
+ virtual void area_attach_object_instance_id(RID p_area, ObjectID p_ID);
+ virtual ObjectID area_get_object_instance_id(RID p_area) const;
virtual void area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value);
virtual void area_set_transform(RID p_area, const Transform2D &p_transform);
- virtual Variant area_get_param(RID p_parea, AreaParameter p_param) const;
+ virtual Variant area_get_param(RID p_area, AreaParameter p_param) const;
virtual Transform2D area_get_transform(RID p_area) const;
virtual void area_set_monitorable(RID p_area, bool p_monitorable);
virtual void area_set_collision_mask(RID p_area, uint32_t p_mask);
- virtual void area_set_layer_mask(RID p_area, uint32_t p_mask);
+ virtual void area_set_collision_layer(RID p_area, uint32_t p_layer);
virtual void area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method);
virtual void area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method);
@@ -166,20 +169,20 @@ public:
virtual void body_remove_shape(RID p_body, int p_shape_idx);
virtual void body_clear_shapes(RID p_body);
- virtual void body_set_shape_as_trigger(RID p_body, int p_shape_idx, bool p_enable);
- virtual bool body_is_shape_set_as_trigger(RID p_body, int p_shape_idx) const;
+ virtual void body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled);
+ virtual void body_set_shape_as_one_way_collision(RID p_body, int p_shape_idx, bool p_enable);
- virtual void body_attach_object_instance_ID(RID p_body, uint32_t p_ID);
- virtual uint32_t body_get_object_instance_ID(RID p_body) const;
+ virtual void body_attach_object_instance_id(RID p_body, uint32_t p_ID);
+ virtual uint32_t body_get_object_instance_id(RID p_body) const;
virtual void body_set_continuous_collision_detection_mode(RID p_body, CCDMode p_mode);
virtual CCDMode body_get_continuous_collision_detection_mode(RID p_body) const;
- virtual void body_set_layer_mask(RID p_body, uint32_t p_mask);
- virtual uint32_t body_get_layer_mask(RID p_body) const;
+ virtual void body_set_collision_layer(RID p_body, uint32_t p_layer);
+ virtual uint32_t body_get_collision_layer(RID p_body) const;
virtual void body_set_collision_mask(RID p_body, uint32_t p_mask);
- virtual uint32_t body_get_collision_mask(RID p_) const;
+ virtual uint32_t body_get_collision_mask(RID p_body) 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;
@@ -202,8 +205,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, real_t p_treshold);
- virtual real_t body_get_contacts_reported_depth_treshold(RID p_body) const;
+ virtual void body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold);
+ virtual real_t body_get_contacts_reported_depth_threshold(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;
@@ -211,12 +214,6 @@ public:
virtual void body_set_max_contacts_reported(RID p_body, int p_contacts);
virtual int body_get_max_contacts_reported(RID p_body) const;
- 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, 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());
virtual bool body_collide_shape(RID p_body, int p_body_shape, RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, Vector2 *r_results, int p_result_max, int &r_result_count);
diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp
index ef1a5b333c..8d19153268 100644
--- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp
+++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -50,7 +51,7 @@ void Physics2DServerWrapMT::_thread_callback(void *_instance) {
void Physics2DServerWrapMT::thread_loop() {
- server_thread = Thread::get_caller_ID();
+ server_thread = Thread::get_caller_id();
OS::get_singleton()->make_rendering_thread();
@@ -160,20 +161,20 @@ Physics2DServerWrapMT::Physics2DServerWrapMT(Physics2DServer *p_contained, bool
step_thread_up = false;
alloc_mutex = Mutex::create();
- shape_pool_max_size = GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc");
- area_pool_max_size = GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc");
- body_pool_max_size = GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc");
- pin_joint_pool_max_size = GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc");
- groove_joint_pool_max_size = GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc");
- damped_spring_joint_pool_max_size = GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc");
+ shape_pool_max_size = GLOBAL_GET("memory/limits/multithreaded_server/rid_pool_prealloc");
+ area_pool_max_size = GLOBAL_GET("memory/limits/multithreaded_server/rid_pool_prealloc");
+ body_pool_max_size = GLOBAL_GET("memory/limits/multithreaded_server/rid_pool_prealloc");
+ pin_joint_pool_max_size = GLOBAL_GET("memory/limits/multithreaded_server/rid_pool_prealloc");
+ groove_joint_pool_max_size = GLOBAL_GET("memory/limits/multithreaded_server/rid_pool_prealloc");
+ damped_spring_joint_pool_max_size = GLOBAL_GET("memory/limits/multithreaded_server/rid_pool_prealloc");
if (!p_create_thread) {
- server_thread = Thread::get_caller_ID();
+ server_thread = Thread::get_caller_id();
} else {
server_thread = 0;
}
- main_thread = Thread::get_caller_ID();
+ main_thread = Thread::get_caller_id();
first_frame = true;
}
diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.h b/servers/physics_2d/physics_2d_server_wrap_mt.h
index ff30b2df09..8058709c06 100644
--- a/servers/physics_2d/physics_2d_server_wrap_mt.h
+++ b/servers/physics_2d/physics_2d_server_wrap_mt.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,8 +31,8 @@
#define PHYSICS2DSERVERWRAPMT_H
#include "command_queue_mt.h"
-#include "global_config.h"
#include "os/thread.h"
+#include "project_settings.h"
#include "servers/physics_2d_server.h"
#ifdef DEBUG_SYNC
@@ -97,7 +98,7 @@ public:
//these work well, but should be used from the main thread only
bool shape_collide(RID p_shape_A, const Transform2D &p_xform_A, const Vector2 &p_motion_A, RID p_shape_B, const Transform2D &p_xform_B, const Vector2 &p_motion_B, Vector2 *r_results, int p_result_max, int &r_result_count) {
- ERR_FAIL_COND_V(main_thread != Thread::get_caller_ID(), false);
+ ERR_FAIL_COND_V(main_thread != Thread::get_caller_id(), false);
return physics_2d_server->shape_collide(p_shape_A, p_xform_A, p_motion_A, p_shape_B, p_xform_B, p_motion_B, r_results, p_result_max, r_result_count);
}
@@ -113,20 +114,20 @@ public:
// this function only works on fixed process, errors and returns null otherwise
Physics2DDirectSpaceState *space_get_direct_state(RID p_space) {
- ERR_FAIL_COND_V(main_thread != Thread::get_caller_ID(), NULL);
+ ERR_FAIL_COND_V(main_thread != Thread::get_caller_id(), NULL);
return physics_2d_server->space_get_direct_state(p_space);
}
FUNC2(space_set_debug_contacts, RID, int);
virtual Vector<Vector2> space_get_contacts(RID p_space) const {
- ERR_FAIL_COND_V(main_thread != Thread::get_caller_ID(), Vector<Vector2>());
+ ERR_FAIL_COND_V(main_thread != Thread::get_caller_id(), Vector<Vector2>());
return physics_2d_server->space_get_contacts(p_space);
}
virtual int space_get_contact_count(RID p_space) const {
- ERR_FAIL_COND_V(main_thread != Thread::get_caller_ID(), 0);
+ ERR_FAIL_COND_V(main_thread != Thread::get_caller_id(), 0);
return physics_2d_server->space_get_contact_count(p_space);
}
@@ -144,6 +145,7 @@ public:
FUNC3(area_add_shape, RID, RID, const Transform2D &);
FUNC3(area_set_shape, RID, int, RID);
FUNC3(area_set_shape_transform, RID, int, const Transform2D &);
+ FUNC3(area_set_shape_disabled, RID, int, bool);
FUNC1RC(int, area_get_shape_count, RID);
FUNC2RC(RID, area_get_shape, RID, int);
@@ -151,8 +153,8 @@ public:
FUNC2(area_remove_shape, RID, int);
FUNC1(area_clear_shapes, RID);
- FUNC2(area_attach_object_instance_ID, RID, ObjectID);
- FUNC1RC(ObjectID, area_get_object_instance_ID, RID);
+ FUNC2(area_attach_object_instance_id, RID, ObjectID);
+ FUNC1RC(ObjectID, area_get_object_instance_id, RID);
FUNC3(area_set_param, RID, AreaParameter, const Variant &);
FUNC2(area_set_transform, RID, const Transform2D &);
@@ -161,7 +163,7 @@ public:
FUNC1RC(Transform2D, area_get_transform, RID);
FUNC2(area_set_collision_mask, RID, uint32_t);
- FUNC2(area_set_layer_mask, RID, uint32_t);
+ FUNC2(area_set_collision_layer, RID, uint32_t);
FUNC2(area_set_monitorable, RID, bool);
FUNC2(area_set_pickable, RID, bool);
@@ -190,20 +192,20 @@ public:
FUNC2RC(Variant, body_get_shape_metadata, RID, int);
FUNC2RC(RID, body_get_shape, RID, int);
- FUNC3(body_set_shape_as_trigger, RID, int, bool);
- FUNC2RC(bool, body_is_shape_set_as_trigger, RID, int);
+ FUNC3(body_set_shape_disabled, RID, int, bool);
+ FUNC3(body_set_shape_as_one_way_collision, RID, int, bool);
FUNC2(body_remove_shape, RID, int);
FUNC1(body_clear_shapes, RID);
- FUNC2(body_attach_object_instance_ID, RID, uint32_t);
- FUNC1RC(uint32_t, body_get_object_instance_ID, RID);
+ FUNC2(body_attach_object_instance_id, RID, uint32_t);
+ FUNC1RC(uint32_t, body_get_object_instance_id, RID);
FUNC2(body_set_continuous_collision_detection_mode, RID, CCDMode);
FUNC1RC(CCDMode, body_get_continuous_collision_detection_mode, RID);
- FUNC2(body_set_layer_mask, RID, uint32_t);
- FUNC1RC(uint32_t, body_get_layer_mask, RID);
+ FUNC2(body_set_collision_layer, RID, uint32_t);
+ FUNC1RC(uint32_t, body_get_collision_layer, RID);
FUNC2(body_set_collision_mask, RID, uint32_t);
FUNC1RC(uint32_t, body_get_collision_mask, RID);
@@ -231,14 +233,8 @@ public:
FUNC2(body_set_max_contacts_reported, RID, int);
FUNC1RC(int, body_get_max_contacts_reported, RID);
- 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, real_t);
- FUNC1RC(real_t, body_get_one_way_collision_max_depth, RID);
-
- FUNC2(body_set_contacts_reported_depth_treshold, RID, real_t);
- FUNC1RC(real_t, body_get_contacts_reported_depth_treshold, RID);
+ FUNC2(body_set_contacts_reported_depth_threshold, RID, real_t);
+ FUNC1RC(real_t, body_get_contacts_reported_depth_threshold, RID);
FUNC2(body_set_omit_force_integration, RID, bool);
FUNC1RC(bool, body_is_omitting_force_integration, RID);
@@ -253,7 +249,7 @@ public:
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);
+ 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);
}
diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp
index 32d632453a..e153ee985c 100644
--- a/servers/physics_2d/shape_2d_sw.cpp
+++ b/servers/physics_2d/shape_2d_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -196,7 +197,7 @@ Variant RayShape2DSW::get_data() const {
void SegmentShape2DSW::get_supports(const Vector2 &p_normal, Vector2 *r_supports, int &r_amount) const {
- if (Math::abs(p_normal.dot(n)) > _SEGMENT_IS_VALID_SUPPORT_TRESHOLD) {
+ if (Math::abs(p_normal.dot(n)) > _SEGMENT_IS_VALID_SUPPORT_THRESHOLD) {
r_supports[0] = a;
r_supports[1] = b;
r_amount = 2;
@@ -245,12 +246,12 @@ void SegmentShape2DSW::set_data(const Variant &p_data) {
ERR_FAIL_COND(p_data.get_type() != Variant::RECT2);
Rect2 r = p_data;
- a = r.pos;
+ a = r.position;
b = r.size;
n = (b - a).tangent();
Rect2 aabb;
- aabb.pos = a;
+ aabb.position = a;
aabb.expand_to(b);
if (aabb.size.x == 0)
aabb.size.x = 0.001;
@@ -262,7 +263,7 @@ void SegmentShape2DSW::set_data(const Variant &p_data) {
Variant SegmentShape2DSW::get_data() const {
Rect2 r;
- r.pos = a;
+ r.position = a;
r.size = b;
return r;
}
@@ -336,7 +337,7 @@ void RectangleShape2DSW::get_supports(const Vector2 &p_normal, Vector2 *r_suppor
Vector2 ag;
ag[i] = 1.0;
real_t dp = ag.dot(p_normal);
- if (Math::abs(dp) < _SEGMENT_IS_VALID_SUPPORT_TRESHOLD)
+ if (Math::abs(dp) < _SEGMENT_IS_VALID_SUPPORT_THRESHOLD)
continue;
real_t sgn = dp > 0 ? 1.0 : -1.0;
@@ -399,7 +400,7 @@ void CapsuleShape2DSW::get_supports(const Vector2 &p_normal, Vector2 *r_supports
real_t d = n.y;
- if (Math::abs(d) < (1.0 - _SEGMENT_IS_VALID_SUPPORT_TRESHOLD)) {
+ if (Math::abs(d) < (1.0 - _SEGMENT_IS_VALID_SUPPORT_THRESHOLD)) {
// make it flat
n.y = 0.0;
@@ -546,7 +547,7 @@ void ConvexPolygonShape2DSW::get_supports(const Vector2 &p_normal, Vector2 *r_su
}
//test segment
- if (points[i].normal.dot(p_normal) > _SEGMENT_IS_VALID_SUPPORT_TRESHOLD) {
+ if (points[i].normal.dot(p_normal) > _SEGMENT_IS_VALID_SUPPORT_THRESHOLD) {
r_amount = 2;
r_supports[0] = points[i].pos;
@@ -620,13 +621,13 @@ bool ConvexPolygonShape2DSW::intersect_segment(const Vector2 &p_begin, const Vec
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;
+ aabb.position = points[0].pos * p_scale;
for (int i = 0; i < point_count; i++) {
aabb.expand_to(points[i].pos * p_scale);
}
- return p_mass * aabb.size.dot(aabb.size) / 12.0 + p_mass * (aabb.pos + aabb.size * 0.5).length_squared();
+ return p_mass * aabb.size.dot(aabb.size) / 12.0 + p_mass * (aabb.position + aabb.size * 0.5).length_squared();
}
void ConvexPolygonShape2DSW::set_data(const Variant &p_data) {
@@ -676,7 +677,7 @@ void ConvexPolygonShape2DSW::set_data(const Variant &p_data) {
ERR_FAIL_COND(point_count == 0);
Rect2 aabb;
- aabb.pos = points[0].pos;
+ aabb.position = points[0].pos;
for (int i = 1; i < point_count; i++)
aabb.expand_to(points[i].pos);
@@ -941,7 +942,7 @@ void ConcavePolygonShape2DSW::set_data(const Variant &p_data) {
}
points.resize(pointmap.size());
- aabb.pos = pointmap.front()->key();
+ aabb.position = pointmap.front()->key();
for (Map<Point2, int>::Element *E = pointmap.front(); E; E = E->next()) {
aabb.expand_to(E->key());
@@ -952,7 +953,7 @@ void ConcavePolygonShape2DSW::set_data(const Variant &p_data) {
main_vbh.resize(segments.size());
for (int i = 0; i < main_vbh.size(); i++) {
- main_vbh[i].aabb.pos = points[segments[i].points[0]];
+ main_vbh[i].aabb.position = points[segments[i].points[0]];
main_vbh[i].aabb.expand_to(points[segments[i].points[1]]);
main_vbh[i].left = -1;
main_vbh[i].right = i;
diff --git a/servers/physics_2d/shape_2d_sw.h b/servers/physics_2d/shape_2d_sw.h
index 00d86da7fb..a75a4338e7 100644
--- a/servers/physics_2d/shape_2d_sw.h
+++ b/servers/physics_2d/shape_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,7 +31,7 @@
#define SHAPE_2D_2DSW_H
#include "servers/physics_2d_server.h"
-#define _SEGMENT_IS_VALID_SUPPORT_TRESHOLD 0.99998
+#define _SEGMENT_IS_VALID_SUPPORT_THRESHOLD 0.99998
/*
@@ -105,7 +106,7 @@ public:
if (r_amount == 1) {
- if (Math::abs(p_normal.dot(p_cast.normalized())) < (1.0 - _SEGMENT_IS_VALID_SUPPORT_TRESHOLD)) {
+ if (Math::abs(p_normal.dot(p_cast.normalized())) < (1.0 - _SEGMENT_IS_VALID_SUPPORT_THRESHOLD)) {
//make line because they are parallel
r_amount = 2;
r_supports[1] = r_supports[0] + p_cast;
@@ -116,7 +117,7 @@ public:
} else {
- if (Math::abs(p_normal.dot(p_cast.normalized())) < (1.0 - _SEGMENT_IS_VALID_SUPPORT_TRESHOLD)) {
+ if (Math::abs(p_normal.dot(p_cast.normalized())) < (1.0 - _SEGMENT_IS_VALID_SUPPORT_THRESHOLD)) {
//optimize line and make it larger because they are parallel
if ((r_supports[1] - r_supports[0]).dot(p_cast) > 0) {
//larger towards 1
@@ -512,7 +513,7 @@ class ConcavePolygonShape2DSW : public ConcaveShape2DSW {
_FORCE_INLINE_ bool operator()(const BVH &a, const BVH &b) const {
- return (a.aabb.pos.x + a.aabb.size.x * 0.5) < (b.aabb.pos.x + b.aabb.size.x * 0.5);
+ return (a.aabb.position.x + a.aabb.size.x * 0.5) < (b.aabb.position.x + b.aabb.size.x * 0.5);
}
};
@@ -520,7 +521,7 @@ class ConcavePolygonShape2DSW : public ConcaveShape2DSW {
_FORCE_INLINE_ bool operator()(const BVH &a, const BVH &b) const {
- return (a.aabb.pos.y + a.aabb.size.y * 0.5) < (b.aabb.pos.y + b.aabb.size.y * 0.5);
+ return (a.aabb.position.y + a.aabb.size.y * 0.5) < (b.aabb.position.y + b.aabb.size.y * 0.5);
}
};
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index a858a20f2c..29f879d8e9 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,9 +31,9 @@
#include "collision_solver_2d_sw.h"
#include "physics_2d_server_sw.h"
-_FORCE_INLINE_ static bool _match_object_type_query(CollisionObject2DSW *p_object, uint32_t p_layer_mask, uint32_t p_type_mask) {
+_FORCE_INLINE_ static bool _match_object_type_query(CollisionObject2DSW *p_object, uint32_t p_collision_layer, uint32_t p_type_mask) {
- if ((p_object->get_layer_mask() & p_layer_mask) == 0)
+ if ((p_object->get_collision_layer() & p_collision_layer) == 0)
return false;
if (p_object->get_type() == CollisionObject2DSW::TYPE_AREA)
@@ -43,13 +44,13 @@ _FORCE_INLINE_ static bool _match_object_type_query(CollisionObject2DSW *p_objec
return (1 << body->get_mode()) & p_type_mask;
}
-int Physics2DDirectSpaceStateSW::intersect_point(const Vector2 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_layer_mask, uint32_t p_object_type_mask, bool p_pick_point) {
+int Physics2DDirectSpaceStateSW::intersect_point(const Vector2 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask, bool p_pick_point) {
if (p_result_max <= 0)
return 0;
Rect2 aabb;
- aabb.pos = p_point - Vector2(0.00001, 0.00001);
+ aabb.position = p_point - Vector2(0.00001, 0.00001);
aabb.size = Vector2(0.00002, 0.00002);
int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, Space2DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
@@ -58,7 +59,7 @@ int Physics2DDirectSpaceStateSW::intersect_point(const Vector2 &p_point, ShapeRe
for (int i = 0; i < amount; i++) {
- if (!_match_object_type_query(space->intersection_query_results[i], p_layer_mask, p_object_type_mask))
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
continue;
if (p_exclude.has(space->intersection_query_results[i]->get_self()))
@@ -94,7 +95,7 @@ int Physics2DDirectSpaceStateSW::intersect_point(const Vector2 &p_point, ShapeRe
return cc;
}
-bool Physics2DDirectSpaceStateSW::intersect_ray(const Vector2 &p_from, const Vector2 &p_to, RayResult &r_result, const Set<RID> &p_exclude, uint32_t p_layer_mask, uint32_t p_object_type_mask) {
+bool Physics2DDirectSpaceStateSW::intersect_ray(const Vector2 &p_from, const Vector2 &p_to, RayResult &r_result, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask) {
ERR_FAIL_COND_V(space->locked, false);
@@ -116,7 +117,7 @@ bool Physics2DDirectSpaceStateSW::intersect_ray(const Vector2 &p_from, const Vec
for (int i = 0; i < amount; i++) {
- if (!_match_object_type_query(space->intersection_query_results[i], p_layer_mask, p_object_type_mask))
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
continue;
if (p_exclude.has(space->intersection_query_results[i]->get_self()))
@@ -174,7 +175,7 @@ bool Physics2DDirectSpaceStateSW::intersect_ray(const Vector2 &p_from, const Vec
return true;
}
-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) {
+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_collision_layer, uint32_t p_object_type_mask) {
if (p_result_max <= 0)
return 0;
@@ -191,7 +192,7 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Trans
for (int i = 0; i < amount; i++) {
- if (!_match_object_type_query(space->intersection_query_results[i], p_layer_mask, p_object_type_mask))
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
continue;
if (p_exclude.has(space->intersection_query_results[i]->get_self()))
@@ -216,13 +217,13 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Trans
return cc;
}
-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) {
+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_collision_layer, uint32_t p_object_type_mask) {
Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape);
ERR_FAIL_COND_V(!shape, false);
Rect2 aabb = p_xform.xform(shape->get_aabb());
- aabb = aabb.merge(Rect2(aabb.pos + p_motion, aabb.size)); //motion
+ aabb = aabb.merge(Rect2(aabb.position + p_motion, aabb.size)); //motion
aabb = aabb.grow(p_margin);
/*
@@ -237,7 +238,7 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transfor
for (int i = 0; i < amount; i++) {
- if (!_match_object_type_query(space->intersection_query_results[i], p_layer_mask, p_object_type_mask))
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
continue;
if (p_exclude.has(space->intersection_query_results[i]->get_self()))
@@ -264,14 +265,6 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transfor
//test initial overlap
if (CollisionSolver2DSW::solve(shape, p_xform, Vector2(), col_obj->get_shape(shape_idx), col_obj_xform, Vector2(), NULL, NULL, NULL, p_margin)) {
- if (col_obj->get_type() == CollisionObject2DSW::TYPE_BODY) {
- //if one way collision direction ignore initial overlap
- const Body2DSW *body = static_cast<const Body2DSW *>(col_obj);
- if (body->get_one_way_collision_direction() != Vector2()) {
- continue;
- }
- }
-
return false;
}
@@ -296,27 +289,6 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transfor
}
}
- if (col_obj->get_type() == CollisionObject2DSW::TYPE_BODY) {
-
- const Body2DSW *body = static_cast<const Body2DSW *>(col_obj);
- if (body->get_one_way_collision_direction() != Vector2()) {
-
- Vector2 cd[2];
- Physics2DServerSW::CollCbkData cbk;
- cbk.max = 1;
- cbk.amount = 0;
- cbk.ptr = cd;
- cbk.valid_dir = body->get_one_way_collision_direction();
- cbk.valid_depth = body->get_one_way_collision_max_depth();
-
- Vector2 sep = mnormal; //important optimization for this to work fast enough
- bool collided = CollisionSolver2DSW::solve(shape, p_xform, p_motion * (hi + space->contact_max_allowed_penetration), col_obj->get_shape(shape_idx), col_obj_xform, Vector2(), Physics2DServerSW::_shape_col_cbk, &cbk, &sep, p_margin);
- if (!collided || cbk.amount == 0) {
- continue;
- }
- }
- }
-
if (low < best_safe) {
best_safe = low;
best_unsafe = hi;
@@ -329,7 +301,7 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transfor
return true;
}
-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) {
+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_collision_layer, uint32_t p_object_type_mask) {
if (p_result_max <= 0)
return 0;
@@ -338,7 +310,7 @@ bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D &
ERR_FAIL_COND_V(!shape, 0);
Rect2 aabb = p_shape_xform.xform(shape->get_aabb());
- aabb = aabb.merge(Rect2(aabb.pos + p_motion, aabb.size)); //motion
+ aabb = aabb.merge(Rect2(aabb.position + p_motion, aabb.size)); //motion
aabb = aabb.grow(p_margin);
int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, Space2DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
@@ -360,7 +332,7 @@ bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D &
for (int i = 0; i < amount; i++) {
- if (!_match_object_type_query(space->intersection_query_results[i], p_layer_mask, p_object_type_mask))
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
continue;
const CollisionObject2DSW *col_obj = space->intersection_query_results[i];
@@ -368,15 +340,9 @@ bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D &
if (p_exclude.has(col_obj->get_self()))
continue;
- if (col_obj->get_type() == CollisionObject2DSW::TYPE_BODY) {
- const Body2DSW *body = static_cast<const Body2DSW *>(col_obj);
- cbk.valid_dir = body->get_one_way_collision_direction();
- cbk.valid_depth = body->get_one_way_collision_max_depth();
- } else {
- cbk.valid_dir = Vector2();
- cbk.valid_depth = 0;
- }
+ cbk.valid_dir = Vector2();
+ cbk.valid_depth = 0;
if (CollisionSolver2DSW::solve(shape, p_shape_xform, p_motion, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), Vector2(), cbkres, cbkptr, NULL, p_margin)) {
collided = p_result_max == 0 || cbk.amount > 0;
@@ -406,13 +372,10 @@ static void _rest_cbk_result(const Vector2 &p_point_A, const Vector2 &p_point_B,
_RestCallbackData2D *rd = (_RestCallbackData2D *)p_userdata;
if (rd->valid_dir != Vector2()) {
-
- if (rd->valid_dir != Vector2()) {
- if (p_point_A.distance_squared_to(p_point_B) > rd->valid_depth * rd->valid_depth)
- return;
- if (rd->valid_dir.dot((p_point_A - p_point_B).normalized()) < Math_PI * 0.25)
- return;
- }
+ if (p_point_A.distance_squared_to(p_point_B) > rd->valid_depth * rd->valid_depth)
+ return;
+ if (rd->valid_dir.dot((p_point_A - p_point_B).normalized()) < Math_PI * 0.25)
+ return;
}
Vector2 contact_rel = p_point_B - p_point_A;
@@ -427,13 +390,13 @@ static void _rest_cbk_result(const Vector2 &p_point_A, const Vector2 &p_point_B,
rd->best_shape = rd->shape;
}
-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) {
+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_collision_layer, uint32_t p_object_type_mask) {
Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape);
ERR_FAIL_COND_V(!shape, 0);
Rect2 aabb = p_shape_xform.xform(shape->get_aabb());
- aabb = aabb.merge(Rect2(aabb.pos + p_motion, aabb.size)); //motion
+ aabb = aabb.merge(Rect2(aabb.position + p_motion, aabb.size)); //motion
aabb = aabb.grow(p_margin);
int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, Space2DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
@@ -445,7 +408,7 @@ bool Physics2DDirectSpaceStateSW::rest_info(RID p_shape, const Transform2D &p_sh
for (int i = 0; i < amount; i++) {
- if (!_match_object_type_query(space->intersection_query_results[i], p_layer_mask, p_object_type_mask))
+ if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask))
continue;
const CollisionObject2DSW *col_obj = space->intersection_query_results[i];
@@ -454,16 +417,8 @@ bool Physics2DDirectSpaceStateSW::rest_info(RID p_shape, const Transform2D &p_sh
if (p_exclude.has(col_obj->get_self()))
continue;
- if (col_obj->get_type() == CollisionObject2DSW::TYPE_BODY) {
-
- const Body2DSW *body = static_cast<const Body2DSW *>(col_obj);
- rcd.valid_dir = body->get_one_way_collision_direction();
- rcd.valid_depth = body->get_one_way_collision_max_depth();
- } else {
- rcd.valid_dir = Vector2();
- rcd.valid_depth = 0;
- }
-
+ rcd.valid_dir = Vector2();
+ rcd.valid_depth = 0;
rcd.object = col_obj;
rcd.shape = shape_idx;
bool sc = CollisionSolver2DSW::solve(shape, p_shape_xform, p_motion, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), Vector2(), _rest_cbk_result, &rcd, NULL, p_margin);
@@ -516,7 +471,7 @@ int Space2DSW::_cull_aabb_for_body(Body2DSW *p_body, const Rect2 &p_aabb) {
keep = false;
else if (static_cast<Body2DSW *>(intersection_query_results[i])->has_exception(p_body->get_self()) || p_body->has_exception(intersection_query_results[i]->get_self()))
keep = false;
- else if (static_cast<Body2DSW *>(intersection_query_results[i])->is_shape_set_as_trigger(intersection_query_subindex_results[i]))
+ else if (static_cast<Body2DSW *>(intersection_query_results[i])->is_shape_set_as_disabled(intersection_query_subindex_results[i]))
keep = false;
if (!keep) {
@@ -588,7 +543,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
int amount = _cull_aabb_for_body(p_body, body_aabb);
for (int j = 0; j < p_body->get_shape_count(); j++) {
- if (p_body->is_shape_set_as_trigger(j))
+ if (p_body->is_shape_set_as_disabled(j))
continue;
Transform2D body_shape_xform = body_transform * p_body->get_shape_transform(j);
@@ -598,18 +553,10 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
const CollisionObject2DSW *col_obj = intersection_query_results[i];
int shape_idx = intersection_query_subindex_results[i];
- if (col_obj->get_type() == CollisionObject2DSW::TYPE_BODY) {
-
- const Body2DSW *body = static_cast<const Body2DSW *>(col_obj);
+ if (col_obj->is_shape_set_as_one_way_collision(shape_idx)) {
- Vector2 cdir = body->get_one_way_collision_direction();
- /*
- if (cdir!=Vector2() && p_motion.dot(cdir)<0)
- continue;
- */
-
- cbk.valid_dir = cdir;
- cbk.valid_depth = body->get_one_way_collision_max_depth();
+ cbk.valid_dir = body_shape_xform.get_axis(1).normalized();
+ cbk.valid_depth = p_margin; //only valid depth is the collision margin
} else {
cbk.valid_dir = Vector2();
cbk.valid_depth = 0;
@@ -655,7 +602,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
}
body_transform.elements[2] += recover_motion;
- body_aabb.pos += recover_motion;
+ body_aabb.position += recover_motion;
recover_attempts--;
@@ -670,14 +617,14 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
// STEP 2 ATTEMPT MOTION
Rect2 motion_aabb = body_aabb;
- motion_aabb.pos += p_motion;
+ motion_aabb.position += p_motion;
motion_aabb = motion_aabb.merge(body_aabb);
int amount = _cull_aabb_for_body(p_body, motion_aabb);
for (int j = 0; j < p_body->get_shape_count(); j++) {
- if (p_body->is_shape_set_as_trigger(j))
+ if (p_body->is_shape_set_as_disabled(j))
continue;
Transform2D body_shape_xform = body_transform * p_body->get_shape_transform(j);
@@ -702,12 +649,8 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
//test initial overlap
if (CollisionSolver2DSW::solve(body_shape, body_shape_xform, Vector2(), col_obj->get_shape(shape_idx), col_obj_xform, Vector2(), NULL, NULL, NULL, 0)) {
- if (col_obj->get_type() == CollisionObject2DSW::TYPE_BODY) {
- //if one way collision direction ignore initial overlap
- const Body2DSW *body = static_cast<const Body2DSW *>(col_obj);
- if (body->get_one_way_collision_direction() != Vector2()) {
- continue;
- }
+ if (col_obj->is_shape_set_as_one_way_collision(j)) {
+ continue;
}
stuck = true;
@@ -719,7 +662,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
real_t hi = 1;
Vector2 mnormal = p_motion.normalized();
- for (int i = 0; i < 8; i++) { //steps should be customizable..
+ for (int k = 0; k < 8; k++) { //steps should be customizable..
real_t ofs = (low + hi) * 0.5;
@@ -735,24 +678,21 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
}
}
- if (col_obj->get_type() == CollisionObject2DSW::TYPE_BODY) {
-
- const Body2DSW *body = static_cast<const Body2DSW *>(col_obj);
- if (body->get_one_way_collision_direction() != Vector2()) {
+ if (col_obj->is_shape_set_as_one_way_collision(j)) {
- Vector2 cd[2];
- Physics2DServerSW::CollCbkData cbk;
- cbk.max = 1;
- cbk.amount = 0;
- cbk.ptr = cd;
- cbk.valid_dir = body->get_one_way_collision_direction();
- cbk.valid_depth = body->get_one_way_collision_max_depth();
+ Vector2 cd[2];
+ Physics2DServerSW::CollCbkData cbk;
+ cbk.max = 1;
+ cbk.amount = 0;
+ cbk.ptr = cd;
+ cbk.valid_dir = body_shape_xform.get_axis(1).normalized();
+ ;
+ cbk.valid_depth = 10e20;
- Vector2 sep = mnormal; //important optimization for this to work fast enough
- bool collided = CollisionSolver2DSW::solve(body_shape, body_shape_xform, p_motion * (hi + contact_max_allowed_penetration), col_obj->get_shape(shape_idx), col_obj_xform, Vector2(), Physics2DServerSW::_shape_col_cbk, &cbk, &sep, 0);
- if (!collided || cbk.amount == 0) {
- continue;
- }
+ Vector2 sep = mnormal; //important optimization for this to work fast enough
+ bool collided = CollisionSolver2DSW::solve(body_shape, body_shape_xform, p_motion * (hi + contact_max_allowed_penetration), col_obj->get_shape(shape_idx), col_obj_xform, Vector2(), Physics2DServerSW::_shape_col_cbk, &cbk, &sep, 0);
+ if (!collided || cbk.amount == 0) {
+ continue;
}
}
@@ -806,7 +746,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
Transform2D body_shape_xform = ugt * p_body->get_shape_transform(best_shape);
Shape2DSW *body_shape = p_body->get_shape(best_shape);
- body_aabb.pos += p_motion * unsafe;
+ body_aabb.position += p_motion * unsafe;
int amount = _cull_aabb_for_body(p_body, body_aabb);
@@ -815,11 +755,10 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
const CollisionObject2DSW *col_obj = intersection_query_results[i];
int shape_idx = intersection_query_subindex_results[i];
- if (col_obj->get_type() == CollisionObject2DSW::TYPE_BODY) {
+ if (col_obj->is_shape_set_as_one_way_collision(shape_idx)) {
- const Body2DSW *body = static_cast<const Body2DSW *>(col_obj);
- rcd.valid_dir = body->get_one_way_collision_direction();
- rcd.valid_depth = body->get_one_way_collision_max_depth();
+ rcd.valid_dir = body_shape_xform.get_axis(1).normalized();
+ rcd.valid_depth = 10e20;
} else {
rcd.valid_dir = Vector2();
rcd.valid_depth = 0;
@@ -838,6 +777,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
r_result->collider = rcd.best_object->get_self();
r_result->collider_id = rcd.best_object->get_instance_id();
r_result->collider_shape = rcd.best_shape;
+ r_result->collision_local_shape = best_shape;
r_result->collision_normal = rcd.best_normal;
r_result->collision_point = rcd.best_contact;
r_result->collider_metadata = rcd.best_object->get_shape_metadata(rcd.best_shape);
@@ -865,162 +805,6 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
}
return collided;
-
-#if 0
- //give me back regular physics engine logic
- //this is madness
- //and most people using this function will think
- //what it does is simpler than using physics
- //this took about a week to get right..
- //but is it right? who knows at this point..
-
-
- colliding=false;
- ERR_FAIL_COND_V(!is_inside_tree(),Vector2());
- Physics2DDirectSpaceState *dss = Physics2DServer::get_singleton()->space_get_direct_state(get_world_2d()->get_space());
- ERR_FAIL_COND_V(!dss,Vector2());
- const int max_shapes=32;
- Vector2 sr[max_shapes*2];
- int res_shapes;
-
- Set<RID> exclude;
- exclude.insert(get_rid());
-
-
- //recover first
- int recover_attempts=4;
-
- bool collided=false;
- uint32_t mask=0;
- if (collide_static)
- mask|=Physics2DDirectSpaceState::TYPE_MASK_STATIC_BODY;
- if (collide_kinematic)
- mask|=Physics2DDirectSpaceState::TYPE_MASK_KINEMATIC_BODY;
- if (collide_rigid)
- mask|=Physics2DDirectSpaceState::TYPE_MASK_RIGID_BODY;
- if (collide_character)
- mask|=Physics2DDirectSpaceState::TYPE_MASK_CHARACTER_BODY;
-
- //print_line("motion: "+p_motion+" margin: "+rtos(margin));
-
- //print_line("margin: "+rtos(margin));
- do {
-
- //motion recover
- for(int i=0;i<get_shape_count();i++) {
-
- if (is_shape_set_as_trigger(i))
- continue;
- if (dss->collide_shape(get_shape(i)->get_rid(), get_global_transform() * get_shape_transform(i),Vector2(),margin,sr,max_shapes,res_shapes,exclude,get_layer_mask(),mask))
- collided=true;
-
- }
-
- if (!collided)
- break;
-
- Vector2 recover_motion;
-
- for(int i=0;i<res_shapes;i++) {
-
- Vector2 a = sr[i*2+0];
- Vector2 b = sr[i*2+1];
-
- real_t d = a.distance_to(b);
-
- /*
- if (d<margin)
- continue;
- */
- recover_motion+=(b-a)*0.4;
- }
-
- if (recover_motion==Vector2()) {
- collided=false;
- break;
- }
-
- Matrix32 gt = get_global_transform();
- gt.elements[2]+=recover_motion;
- set_global_transform(gt);
-
- recover_attempts--;
-
- } while (recover_attempts);
-
-
- //move second
- real_t safe = 1.0;
- real_t unsafe = 1.0;
- int best_shape=-1;
-
- for(int i=0;i<get_shape_count();i++) {
-
- if (is_shape_set_as_trigger(i))
- continue;
-
- 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) {
-
- safe=0;
- unsafe=0;
- best_shape=i; //sadly it's the best
- break;
- }
- if (lsafe==1.0) {
- continue;
- }
- if (lsafe < safe) {
-
- safe=lsafe;
- unsafe=lunsafe;
- best_shape=i;
- }
- }
-
-
- //print_line("best shape: "+itos(best_shape)+" motion "+p_motion);
-
- if (safe>=1) {
- //not collided
- colliding=false;
- } else {
-
- //it collided, let's get the rest info in unsafe advance
- Matrix32 ugt = get_global_transform();
- ugt.elements[2]+=p_motion*unsafe;
- Physics2DDirectSpaceState::ShapeRestInfo rest_info;
- bool c2 = dss->rest_info(get_shape(best_shape)->get_rid(), ugt*get_shape_transform(best_shape), Vector2(), margin,&rest_info,exclude,get_layer_mask(),mask);
- if (!c2) {
- //should not happen, but floating point precision is so weird..
-
- colliding=false;
- } else {
-
-
- //print_line("Travel: "+rtos(travel));
- colliding=true;
- collision=rest_info.point;
- normal=rest_info.normal;
- collider=rest_info.collider_id;
- collider_vel=rest_info.linear_velocity;
- collider_shape=rest_info.shape;
- collider_metadata=rest_info.metadata;
- }
-
- }
-
- Vector2 motion=p_motion*safe;
- Matrix32 gt = get_global_transform();
- gt.elements[2]+=motion;
- set_global_transform(gt);
-
- return p_motion-motion;
-
-#endif
- return false;
}
void *Space2DSW::_broadphase_pair(CollisionObject2DSW *A, int p_subindex_A, CollisionObject2DSW *B, int p_subindex_B, void *p_self) {
@@ -1186,8 +970,8 @@ void Space2DSW::set_param(Physics2DServer::SpaceParameter p_param, real_t p_valu
case Physics2DServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: contact_recycle_radius = p_value; break;
case Physics2DServer::SPACE_PARAM_CONTACT_MAX_SEPARATION: contact_max_separation = p_value; break;
case Physics2DServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: contact_max_allowed_penetration = p_value; break;
- case Physics2DServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD: body_linear_velocity_sleep_treshold = p_value; break;
- case Physics2DServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD: body_angular_velocity_sleep_treshold = p_value; break;
+ case Physics2DServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: body_linear_velocity_sleep_threshold = p_value; break;
+ case Physics2DServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: body_angular_velocity_sleep_threshold = p_value; break;
case Physics2DServer::SPACE_PARAM_BODY_TIME_TO_SLEEP: body_time_to_sleep = p_value; break;
case Physics2DServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: constraint_bias = p_value; break;
}
@@ -1200,8 +984,8 @@ real_t Space2DSW::get_param(Physics2DServer::SpaceParameter p_param) const {
case Physics2DServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: return contact_recycle_radius;
case Physics2DServer::SPACE_PARAM_CONTACT_MAX_SEPARATION: return contact_max_separation;
case Physics2DServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: return contact_max_allowed_penetration;
- case Physics2DServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD: return body_linear_velocity_sleep_treshold;
- case Physics2DServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD: return body_angular_velocity_sleep_treshold;
+ case Physics2DServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: return body_linear_velocity_sleep_threshold;
+ case Physics2DServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: return body_angular_velocity_sleep_threshold;
case Physics2DServer::SPACE_PARAM_BODY_TIME_TO_SLEEP: return body_time_to_sleep;
case Physics2DServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: return constraint_bias;
}
@@ -1242,8 +1026,8 @@ Space2DSW::Space2DSW() {
contact_max_allowed_penetration = 0.3;
constraint_bias = 0.2;
- body_linear_velocity_sleep_treshold = GLOBAL_DEF("physics/2d/sleep_threashold_linear", 2.0);
- body_angular_velocity_sleep_treshold = GLOBAL_DEF("physics/2d/sleep_threshold_angular", (8.0 / 180.0 * Math_PI));
+ body_linear_velocity_sleep_threshold = GLOBAL_DEF("physics/2d/sleep_threshold_linear", 2.0);
+ body_angular_velocity_sleep_threshold = GLOBAL_DEF("physics/2d/sleep_threshold_angular", (8.0 / 180.0 * Math_PI));
body_time_to_sleep = GLOBAL_DEF("physics/2d/time_before_sleep", 0.5);
broadphase = BroadPhase2DSW::create_func();
diff --git a/servers/physics_2d/space_2d_sw.h b/servers/physics_2d/space_2d_sw.h
index 103f328ed2..4bd81c054f 100644
--- a/servers/physics_2d/space_2d_sw.h
+++ b/servers/physics_2d/space_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,8 +36,8 @@
#include "body_pair_2d_sw.h"
#include "broad_phase_2d_sw.h"
#include "collision_object_2d_sw.h"
-#include "global_config.h"
#include "hash_map.h"
+#include "project_settings.h"
#include "typedefs.h"
class Physics2DDirectSpaceStateSW : public Physics2DDirectSpaceState {
@@ -46,12 +47,12 @@ class Physics2DDirectSpaceStateSW : public Physics2DDirectSpaceState {
public:
Space2DSW *space;
- 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, 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);
+ 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_collision_layer = 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_collision_layer = 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_collision_layer = 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_collision_layer = 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_collision_layer = 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION);
Physics2DDirectSpaceStateSW();
};
@@ -102,8 +103,8 @@ private:
CollisionObject2DSW *intersection_query_results[INTERSECTION_QUERY_MAX];
int intersection_query_subindex_results[INTERSECTION_QUERY_MAX];
- real_t body_linear_velocity_sleep_treshold;
- real_t body_angular_velocity_sleep_treshold;
+ real_t body_linear_velocity_sleep_threshold;
+ real_t body_angular_velocity_sleep_threshold;
real_t body_time_to_sleep;
bool locked;
@@ -151,8 +152,8 @@ public:
_FORCE_INLINE_ real_t get_contact_max_separation() const { return contact_max_separation; }
_FORCE_INLINE_ real_t get_contact_max_allowed_penetration() const { return contact_max_allowed_penetration; }
_FORCE_INLINE_ real_t get_constraint_bias() const { return constraint_bias; }
- _FORCE_INLINE_ real_t get_body_linear_velocity_sleep_treshold() const { return body_linear_velocity_sleep_treshold; }
- _FORCE_INLINE_ real_t get_body_angular_velocity_sleep_treshold() const { return body_angular_velocity_sleep_treshold; }
+ _FORCE_INLINE_ real_t get_body_linear_velocity_sleep_threshold() const { return body_linear_velocity_sleep_threshold; }
+ _FORCE_INLINE_ real_t get_body_angular_velocity_sleep_threshold() const { return body_angular_velocity_sleep_threshold; }
_FORCE_INLINE_ real_t get_body_time_to_sleep() const { return body_time_to_sleep; }
void update();
diff --git a/servers/physics_2d/step_2d_sw.cpp b/servers/physics_2d/step_2d_sw.cpp
index 55bc62975f..f43fef4eef 100644
--- a/servers/physics_2d/step_2d_sw.cpp
+++ b/servers/physics_2d/step_2d_sw.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d/step_2d_sw.h b/servers/physics_2d/step_2d_sw.h
index c743358b6a..bdcb34f3ae 100644
--- a/servers/physics_2d/step_2d_sw.h
+++ b/servers/physics_2d/step_2d_sw.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/physics_2d_server.cpp b/servers/physics_2d_server.cpp
index f922b8f7a1..27732b9c29 100644
--- a/servers/physics_2d_server.cpp
+++ b/servers/physics_2d_server.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -99,11 +100,11 @@ void Physics2DDirectBodyState::_bind_methods() {
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_shape_metadata", "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);
+ ClassDB::bind_method(D_METHOD("get_space_state"), &Physics2DDirectBodyState::get_space_state);
}
Physics2DDirectBodyState::Physics2DDirectBodyState() {}
@@ -153,13 +154,13 @@ float Physics2DShapeQueryParameters::get_margin() const {
return margin;
}
-void Physics2DShapeQueryParameters::set_layer_mask(int p_layer_mask) {
+void Physics2DShapeQueryParameters::set_collision_layer(int p_collision_layer) {
- layer_mask = p_layer_mask;
+ collision_layer = p_collision_layer;
}
-int Physics2DShapeQueryParameters::get_layer_mask() const {
+int Physics2DShapeQueryParameters::get_collision_layer() const {
- return layer_mask;
+ return collision_layer;
}
void Physics2DShapeQueryParameters::set_object_type_mask(int p_object_type_mask) {
@@ -190,7 +191,7 @@ Vector<RID> Physics2DShapeQueryParameters::get_exclude() const {
void Physics2DShapeQueryParameters::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_shape", "shape:Shape2D"), &Physics2DShapeQueryParameters::set_shape);
+ ClassDB::bind_method(D_METHOD("set_shape", "shape"), &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);
@@ -203,8 +204,8 @@ void Physics2DShapeQueryParameters::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_margin", "margin"), &Physics2DShapeQueryParameters::set_margin);
ClassDB::bind_method(D_METHOD("get_margin"), &Physics2DShapeQueryParameters::get_margin);
- 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(D_METHOD("set_collision_layer", "collision_layer"), &Physics2DShapeQueryParameters::set_collision_layer);
+ ClassDB::bind_method(D_METHOD("get_collision_layer"), &Physics2DShapeQueryParameters::get_collision_layer);
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);
@@ -216,7 +217,7 @@ void Physics2DShapeQueryParameters::_bind_methods() {
Physics2DShapeQueryParameters::Physics2DShapeQueryParameters() {
margin = 0;
- layer_mask = 0x7FFFFFFF;
+ collision_layer = 0x7FFFFFFF;
object_type_mask = Physics2DDirectSpaceState::TYPE_MASK_COLLISION;
}
@@ -244,11 +245,11 @@ Dictionary Physics2DDirectSpaceState::_intersect_ray(const Vector2 &p_from, cons
return d;
}
-Array Physics2DDirectSpaceState::_intersect_shape(const Ref<Physics2DShapeQueryParameters> &psq, int p_max_results) {
+Array Physics2DDirectSpaceState::_intersect_shape(const Ref<Physics2DShapeQueryParameters> &p_shape_query, int p_max_results) {
Vector<ShapeResult> sr;
sr.resize(p_max_results);
- int rc = intersect_shape(psq->shape, psq->transform, psq->motion, psq->margin, sr.ptr(), sr.size(), psq->exclude, psq->layer_mask, psq->object_type_mask);
+ int rc = intersect_shape(p_shape_query->shape, p_shape_query->transform, p_shape_query->motion, p_shape_query->margin, sr.ptr(), sr.size(), p_shape_query->exclude, p_shape_query->collision_layer, p_shape_query->object_type_mask);
Array ret;
ret.resize(rc);
for (int i = 0; i < rc; i++) {
@@ -265,10 +266,10 @@ Array Physics2DDirectSpaceState::_intersect_shape(const Ref<Physics2DShapeQueryP
return ret;
}
-Array Physics2DDirectSpaceState::_cast_motion(const Ref<Physics2DShapeQueryParameters> &psq) {
+Array Physics2DDirectSpaceState::_cast_motion(const Ref<Physics2DShapeQueryParameters> &p_shape_query) {
float closest_safe, closest_unsafe;
- bool res = cast_motion(psq->shape, psq->transform, psq->motion, psq->margin, closest_safe, closest_unsafe, psq->exclude, psq->layer_mask, psq->object_type_mask);
+ bool res = cast_motion(p_shape_query->shape, p_shape_query->transform, p_shape_query->motion, p_shape_query->margin, closest_safe, closest_unsafe, p_shape_query->exclude, p_shape_query->collision_layer, p_shape_query->object_type_mask);
if (!res)
return Array();
Array ret;
@@ -306,12 +307,12 @@ Array Physics2DDirectSpaceState::_intersect_point(const Vector2 &p_point, int p_
return r;
}
-Array Physics2DDirectSpaceState::_collide_shape(const Ref<Physics2DShapeQueryParameters> &psq, int p_max_results) {
+Array Physics2DDirectSpaceState::_collide_shape(const Ref<Physics2DShapeQueryParameters> &p_shape_query, int p_max_results) {
Vector<Vector2> ret;
ret.resize(p_max_results * 2);
int rc = 0;
- bool res = collide_shape(psq->shape, psq->transform, psq->motion, psq->margin, ret.ptr(), p_max_results, rc, psq->exclude, psq->layer_mask, psq->object_type_mask);
+ bool res = collide_shape(p_shape_query->shape, p_shape_query->transform, p_shape_query->motion, p_shape_query->margin, ret.ptr(), p_max_results, rc, p_shape_query->exclude, p_shape_query->collision_layer, p_shape_query->object_type_mask);
if (!res)
return Array();
Array r;
@@ -320,11 +321,11 @@ Array Physics2DDirectSpaceState::_collide_shape(const Ref<Physics2DShapeQueryPar
r[i] = ret[i];
return r;
}
-Dictionary Physics2DDirectSpaceState::_get_rest_info(const Ref<Physics2DShapeQueryParameters> &psq) {
+Dictionary Physics2DDirectSpaceState::_get_rest_info(const Ref<Physics2DShapeQueryParameters> &p_shape_query) {
ShapeRestInfo sri;
- bool res = rest_info(psq->shape, psq->transform, psq->motion, psq->margin, &sri, psq->exclude, psq->layer_mask, psq->object_type_mask);
+ bool res = rest_info(p_shape_query->shape, p_shape_query->transform, p_shape_query->motion, p_shape_query->margin, &sri, p_shape_query->exclude, p_shape_query->collision_layer, p_shape_query->object_type_mask);
Dictionary r;
if (!res)
return r;
@@ -345,12 +346,12 @@ Physics2DDirectSpaceState::Physics2DDirectSpaceState() {
void Physics2DDirectSpaceState::_bind_methods() {
- 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("intersect_point", "point", "max_results", "exclude", "collision_layer", "type_mask"), &Physics2DDirectSpaceState::_intersect_point, DEFVAL(32), DEFVAL(Array()), DEFVAL(0x7FFFFFFF), DEFVAL(TYPE_MASK_COLLISION));
+ ClassDB::bind_method(D_METHOD("intersect_ray", "from", "to", "exclude", "collision_layer", "type_mask"), &Physics2DDirectSpaceState::_intersect_ray, DEFVAL(Array()), DEFVAL(0x7FFFFFFF), DEFVAL(TYPE_MASK_COLLISION));
+ ClassDB::bind_method(D_METHOD("intersect_shape", "shape", "max_results"), &Physics2DDirectSpaceState::_intersect_shape, DEFVAL(32));
+ ClassDB::bind_method(D_METHOD("cast_motion", "shape"), &Physics2DDirectSpaceState::_cast_motion);
+ ClassDB::bind_method(D_METHOD("collide_shape", "shape", "max_results"), &Physics2DDirectSpaceState::_collide_shape, DEFVAL(32));
+ ClassDB::bind_method(D_METHOD("get_rest_info", "shape"), &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);
@@ -483,7 +484,7 @@ void Physics2DServer::_bind_methods() {
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(D_METHOD("space_get_direct_state", "space"), &Physics2DServer::space_get_direct_state);
ClassDB::bind_method(D_METHOD("area_create"), &Physics2DServer::area_create);
ClassDB::bind_method(D_METHOD("area_set_space", "area", "space"), &Physics2DServer::area_set_space);
@@ -495,6 +496,7 @@ void Physics2DServer::_bind_methods() {
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(D_METHOD("area_set_shape_disabled", "area", "shape_idx", "disable"), &Physics2DServer::area_set_shape_disabled);
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);
@@ -503,7 +505,7 @@ void Physics2DServer::_bind_methods() {
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(D_METHOD("area_set_layer_mask", "area", "mask"), &Physics2DServer::area_set_layer_mask);
+ ClassDB::bind_method(D_METHOD("area_set_collision_layer", "area", "layer"), &Physics2DServer::area_set_collision_layer);
ClassDB::bind_method(D_METHOD("area_set_collision_mask", "area", "mask"), &Physics2DServer::area_set_collision_mask);
ClassDB::bind_method(D_METHOD("area_set_param", "area", "param", "value"), &Physics2DServer::area_set_param);
@@ -512,8 +514,8 @@ void Physics2DServer::_bind_methods() {
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(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(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(D_METHOD("area_set_monitor_callback", "area", "receiver", "method"), &Physics2DServer::area_set_monitor_callback);
@@ -538,17 +540,17 @@ void Physics2DServer::_bind_methods() {
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(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(D_METHOD("body_set_shape_disabled", "body", "shape_idx", "disable"), &Physics2DServer::body_set_shape_disabled);
+ ClassDB::bind_method(D_METHOD("body_set_shape_as_one_way_collision", "body", "shape_idx", "enable"), &Physics2DServer::body_set_shape_as_one_way_collision);
- 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(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(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(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(D_METHOD("body_set_collision_layer", "body", "layer"), &Physics2DServer::body_set_collision_layer);
+ ClassDB::bind_method(D_METHOD("body_get_collision_layer", "body"), &Physics2DServer::body_get_collision_layer);
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);
@@ -570,18 +572,12 @@ void Physics2DServer::_bind_methods() {
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(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(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(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(D_METHOD("body_set_force_integration_callback", "body", "receiver", "method", "userdata"), &Physics2DServer::body_set_force_integration_callback, 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()));
+ ClassDB::bind_method(D_METHOD("body_test_motion", "body", "from", "motion", "margin", "result"), &Physics2DServer::_body_test_motion, DEFVAL(0.08), DEFVAL(Variant()));
/* JOINT API */
@@ -611,8 +607,8 @@ void Physics2DServer::_bind_methods() {
BIND_CONSTANT(SPACE_PARAM_CONTACT_RECYCLE_RADIUS);
BIND_CONSTANT(SPACE_PARAM_CONTACT_MAX_SEPARATION);
BIND_CONSTANT(SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION);
- BIND_CONSTANT(SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD);
- BIND_CONSTANT(SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD);
+ BIND_CONSTANT(SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD);
+ BIND_CONSTANT(SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD);
BIND_CONSTANT(SPACE_PARAM_BODY_TIME_TO_SLEEP);
BIND_CONSTANT(SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS);
diff --git a/servers/physics_2d_server.h b/servers/physics_2d_server.h
index 3c64d3df6a..f3acd8df18 100644
--- a/servers/physics_2d_server.h
+++ b/servers/physics_2d_server.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -96,7 +97,7 @@ class Physics2DShapeQueryParameters : public Reference {
Vector2 motion;
float margin;
Set<RID> exclude;
- uint32_t layer_mask;
+ uint32_t collision_layer;
uint32_t object_type_mask;
protected:
@@ -116,8 +117,8 @@ public:
void set_margin(float p_margin);
float get_margin() const;
- void set_layer_mask(int p_layer_mask);
- int get_layer_mask() const;
+ void set_collision_layer(int p_collision_layer);
+ int get_collision_layer() const;
void set_object_type_mask(int p_object_type_mask);
int get_object_type_mask() const;
@@ -165,7 +166,7 @@ public:
Variant metadata;
};
- 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) = 0;
+ 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0;
struct ShapeResult {
@@ -176,13 +177,13 @@ public:
Variant metadata;
};
- 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) = 0;
+ 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION, bool p_pick_point = false) = 0;
- 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) = 0;
+ 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0;
- 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) = 0;
+ 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0;
- 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) = 0;
+ 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0;
struct ShapeRestInfo {
@@ -195,7 +196,7 @@ public:
Variant metadata;
};
- 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) = 0;
+ 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0;
Physics2DDirectSpaceState();
};
@@ -271,8 +272,8 @@ public:
SPACE_PARAM_CONTACT_RECYCLE_RADIUS,
SPACE_PARAM_CONTACT_MAX_SEPARATION,
SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION,
- SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD,
- SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD,
+ SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD,
+ SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD,
SPACE_PARAM_BODY_TIME_TO_SLEEP,
SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS,
};
@@ -331,8 +332,10 @@ public:
virtual void area_remove_shape(RID p_area, int p_shape_idx) = 0;
virtual void area_clear_shapes(RID p_area) = 0;
- virtual void area_attach_object_instance_ID(RID p_area, ObjectID p_ID) = 0;
- virtual ObjectID area_get_object_instance_ID(RID p_area) const = 0;
+ virtual void area_set_shape_disabled(RID p_area, int p_shape, bool p_disabled) = 0;
+
+ virtual void area_attach_object_instance_id(RID p_area, ObjectID p_ID) = 0;
+ virtual ObjectID area_get_object_instance_id(RID p_area) const = 0;
virtual void area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) = 0;
virtual void area_set_transform(RID p_area, const Transform2D &p_transform) = 0;
@@ -341,7 +344,7 @@ public:
virtual Transform2D area_get_transform(RID p_area) const = 0;
virtual void area_set_collision_mask(RID p_area, uint32_t p_mask) = 0;
- virtual void area_set_layer_mask(RID p_area, uint32_t p_mask) = 0;
+ virtual void area_set_collision_layer(RID p_area, uint32_t p_layer) = 0;
virtual void area_set_monitorable(RID p_area, bool p_monitorable) = 0;
virtual void area_set_pickable(RID p_area, bool p_pickable) = 0;
@@ -379,14 +382,14 @@ public:
virtual Transform2D body_get_shape_transform(RID p_body, int p_shape_idx) const = 0;
virtual Variant body_get_shape_metadata(RID p_body, int p_shape_idx) const = 0;
- virtual void body_set_shape_as_trigger(RID p_body, int p_shape_idx, bool p_enable) = 0;
- virtual bool body_is_shape_set_as_trigger(RID p_body, int p_shape_idx) const = 0;
+ virtual void body_set_shape_disabled(RID p_body, int p_shape, bool p_disabled) = 0;
+ virtual void body_set_shape_as_one_way_collision(RID p_body, int p_shape, bool p_enabled) = 0;
virtual void body_remove_shape(RID p_body, int p_shape_idx) = 0;
virtual void body_clear_shapes(RID p_body) = 0;
- virtual void body_attach_object_instance_ID(RID p_body, uint32_t p_ID) = 0;
- virtual uint32_t body_get_object_instance_ID(RID p_body) const = 0;
+ virtual void body_attach_object_instance_id(RID p_body, uint32_t p_ID) = 0;
+ virtual uint32_t body_get_object_instance_id(RID p_body) const = 0;
enum CCDMode {
CCD_MODE_DISABLED,
@@ -397,8 +400,8 @@ public:
virtual void body_set_continuous_collision_detection_mode(RID p_body, CCDMode p_mode) = 0;
virtual CCDMode body_get_continuous_collision_detection_mode(RID p_body) const = 0;
- virtual void body_set_layer_mask(RID p_body, uint32_t p_mask) = 0;
- virtual uint32_t body_get_layer_mask(RID p_body) const = 0;
+ virtual void body_set_collision_layer(RID p_body, uint32_t p_layer) = 0;
+ virtual uint32_t body_get_collision_layer(RID p_body) const = 0;
virtual void body_set_collision_mask(RID p_body, uint32_t p_mask) = 0;
virtual uint32_t body_get_collision_mask(RID p_body) const = 0;
@@ -450,15 +453,9 @@ public:
virtual void body_set_max_contacts_reported(RID p_body, int p_contacts) = 0;
virtual int body_get_max_contacts_reported(RID p_body) const = 0;
- virtual void body_set_one_way_collision_direction(RID p_body, const Vector2 &p_direction) = 0;
- virtual Vector2 body_get_one_way_collision_direction(RID p_body) const = 0;
-
- virtual void body_set_one_way_collision_max_depth(RID p_body, float p_max_depth) = 0;
- virtual float body_get_one_way_collision_max_depth(RID p_body) const = 0;
-
//missing remove
- virtual void body_set_contacts_reported_depth_treshold(RID p_body, float p_treshold) = 0;
- virtual float body_get_contacts_reported_depth_treshold(RID p_body) const = 0;
+ virtual void body_set_contacts_reported_depth_threshold(RID p_body, float p_threshold) = 0;
+ virtual float body_get_contacts_reported_depth_threshold(RID p_body) const = 0;
virtual void body_set_omit_force_integration(RID p_body, bool p_omit) = 0;
virtual bool body_is_omitting_force_integration(RID p_body) const = 0;
@@ -477,6 +474,7 @@ public:
Vector2 collision_point;
Vector2 collision_normal;
Vector2 collider_velocity;
+ int collision_local_shape;
ObjectID collider_id;
RID collider;
int collider_shape;
diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp
index d8f77fbe0d..86bf6253ee 100644
--- a/servers/physics_server.cpp
+++ b/servers/physics_server.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -108,7 +109,7 @@ void PhysicsDirectBodyState::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("get_space_state"), &PhysicsDirectBodyState::get_space_state);
}
PhysicsDirectBodyState::PhysicsDirectBodyState() {}
@@ -150,13 +151,13 @@ float PhysicsShapeQueryParameters::get_margin() const {
return margin;
}
-void PhysicsShapeQueryParameters::set_layer_mask(int p_layer_mask) {
+void PhysicsShapeQueryParameters::set_collision_layer(int p_collision_layer) {
- layer_mask = p_layer_mask;
+ collision_layer = p_collision_layer;
}
-int PhysicsShapeQueryParameters::get_layer_mask() const {
+int PhysicsShapeQueryParameters::get_collision_layer() const {
- return layer_mask;
+ return collision_layer;
}
void PhysicsShapeQueryParameters::set_object_type_mask(int p_object_type_mask) {
@@ -187,7 +188,7 @@ Vector<RID> PhysicsShapeQueryParameters::get_exclude() const {
void PhysicsShapeQueryParameters::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_shape", "shape:Shape"), &PhysicsShapeQueryParameters::set_shape);
+ ClassDB::bind_method(D_METHOD("set_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);
@@ -197,8 +198,8 @@ void PhysicsShapeQueryParameters::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_margin", "margin"), &PhysicsShapeQueryParameters::set_margin);
ClassDB::bind_method(D_METHOD("get_margin"), &PhysicsShapeQueryParameters::get_margin);
- 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(D_METHOD("set_collision_layer", "collision_layer"), &PhysicsShapeQueryParameters::set_collision_layer);
+ ClassDB::bind_method(D_METHOD("get_collision_layer"), &PhysicsShapeQueryParameters::get_collision_layer);
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);
@@ -210,7 +211,7 @@ void PhysicsShapeQueryParameters::_bind_methods() {
PhysicsShapeQueryParameters::PhysicsShapeQueryParameters() {
margin = 0;
- layer_mask = 0x7FFFFFFF;
+ collision_layer = 0x7FFFFFFF;
object_type_mask = PhysicsDirectSpaceState::TYPE_MASK_COLLISION;
}
@@ -269,11 +270,11 @@ Dictionary PhysicsDirectSpaceState::_intersect_ray(const Vector3 &p_from, const
return d;
}
-Array PhysicsDirectSpaceState::_intersect_shape(const Ref<PhysicsShapeQueryParameters> &psq, int p_max_results) {
+Array PhysicsDirectSpaceState::_intersect_shape(const Ref<PhysicsShapeQueryParameters> &p_shape_query, int p_max_results) {
Vector<ShapeResult> sr;
sr.resize(p_max_results);
- int rc = intersect_shape(psq->shape, psq->transform, psq->margin, sr.ptr(), sr.size(), psq->exclude, psq->layer_mask, psq->object_type_mask);
+ int rc = intersect_shape(p_shape_query->shape, p_shape_query->transform, p_shape_query->margin, sr.ptr(), sr.size(), p_shape_query->exclude, p_shape_query->collision_layer, p_shape_query->object_type_mask);
Array ret;
ret.resize(rc);
for (int i = 0; i < rc; i++) {
@@ -289,10 +290,10 @@ Array PhysicsDirectSpaceState::_intersect_shape(const Ref<PhysicsShapeQueryParam
return ret;
}
-Array PhysicsDirectSpaceState::_cast_motion(const Ref<PhysicsShapeQueryParameters> &psq, const Vector3 &p_motion) {
+Array PhysicsDirectSpaceState::_cast_motion(const Ref<PhysicsShapeQueryParameters> &p_shape_query, const Vector3 &p_motion) {
float closest_safe, closest_unsafe;
- bool res = cast_motion(psq->shape, psq->transform, p_motion, psq->margin, closest_safe, closest_unsafe, psq->exclude, psq->layer_mask, psq->object_type_mask);
+ bool res = cast_motion(p_shape_query->shape, p_shape_query->transform, p_motion, p_shape_query->margin, closest_safe, closest_unsafe, p_shape_query->exclude, p_shape_query->collision_layer, p_shape_query->object_type_mask);
if (!res)
return Array();
Array ret;
@@ -301,12 +302,12 @@ Array PhysicsDirectSpaceState::_cast_motion(const Ref<PhysicsShapeQueryParameter
ret[1] = closest_unsafe;
return ret;
}
-Array PhysicsDirectSpaceState::_collide_shape(const Ref<PhysicsShapeQueryParameters> &psq, int p_max_results) {
+Array PhysicsDirectSpaceState::_collide_shape(const Ref<PhysicsShapeQueryParameters> &p_shape_query, int p_max_results) {
Vector<Vector3> ret;
ret.resize(p_max_results * 2);
int rc = 0;
- bool res = collide_shape(psq->shape, psq->transform, psq->margin, ret.ptr(), p_max_results, rc, psq->exclude, psq->layer_mask, psq->object_type_mask);
+ bool res = collide_shape(p_shape_query->shape, p_shape_query->transform, p_shape_query->margin, ret.ptr(), p_max_results, rc, p_shape_query->exclude, p_shape_query->collision_layer, p_shape_query->object_type_mask);
if (!res)
return Array();
Array r;
@@ -315,11 +316,11 @@ Array PhysicsDirectSpaceState::_collide_shape(const Ref<PhysicsShapeQueryParamet
r[i] = ret[i];
return r;
}
-Dictionary PhysicsDirectSpaceState::_get_rest_info(const Ref<PhysicsShapeQueryParameters> &psq) {
+Dictionary PhysicsDirectSpaceState::_get_rest_info(const Ref<PhysicsShapeQueryParameters> &p_shape_query) {
ShapeRestInfo sri;
- bool res = rest_info(psq->shape, psq->transform, psq->margin, &sri, psq->exclude, psq->layer_mask, psq->object_type_mask);
+ bool res = rest_info(p_shape_query->shape, p_shape_query->transform, p_shape_query->margin, &sri, p_shape_query->exclude, p_shape_query->collision_layer, p_shape_query->object_type_mask);
Dictionary r;
if (!res)
return r;
@@ -340,13 +341,13 @@ PhysicsDirectSpaceState::PhysicsDirectSpaceState() {
void PhysicsDirectSpaceState::_bind_methods() {
//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(D_METHOD("intersect_shape","shape","xform","result_max","exclude","umask"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(Array()),DEFVAL(0));
- 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);
+ ClassDB::bind_method(D_METHOD("intersect_ray", "from", "to", "exclude", "collision_layer", "type_mask"), &PhysicsDirectSpaceState::_intersect_ray, DEFVAL(Array()), DEFVAL(0x7FFFFFFF), DEFVAL(TYPE_MASK_COLLISION));
+ ClassDB::bind_method(D_METHOD("intersect_shape", "shape", "max_results"), &PhysicsDirectSpaceState::_intersect_shape, DEFVAL(32));
+ ClassDB::bind_method(D_METHOD("cast_motion", "shape", "motion"), &PhysicsDirectSpaceState::_cast_motion);
+ ClassDB::bind_method(D_METHOD("collide_shape", "shape", "max_results"), &PhysicsDirectSpaceState::_collide_shape, DEFVAL(32));
+ ClassDB::bind_method(D_METHOD("get_rest_info", "shape"), &PhysicsDirectSpaceState::_get_rest_info);
BIND_CONSTANT(TYPE_MASK_STATIC_BODY);
BIND_CONSTANT(TYPE_MASK_KINEMATIC_BODY);
@@ -404,7 +405,7 @@ void PhysicsServer::_bind_methods() {
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(D_METHOD("space_get_direct_state", "space"), &PhysicsServer::space_get_direct_state);
ClassDB::bind_method(D_METHOD("area_create"), &PhysicsServer::area_create);
ClassDB::bind_method(D_METHOD("area_set_space", "area", "space"), &PhysicsServer::area_set_space);
@@ -424,7 +425,7 @@ void PhysicsServer::_bind_methods() {
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(D_METHOD("area_set_layer_mask", "area", "mask"), &PhysicsServer::area_set_layer_mask);
+ ClassDB::bind_method(D_METHOD("area_set_collision_layer", "area", "layer"), &PhysicsServer::area_set_collision_layer);
ClassDB::bind_method(D_METHOD("area_set_collision_mask", "area", "mask"), &PhysicsServer::area_set_collision_mask);
ClassDB::bind_method(D_METHOD("area_set_param", "area", "param", "value"), &PhysicsServer::area_set_param);
@@ -433,8 +434,8 @@ void PhysicsServer::_bind_methods() {
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(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(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(D_METHOD("area_set_monitor_callback", "area", "receiver", "method"), &PhysicsServer::area_set_monitor_callback);
@@ -449,8 +450,8 @@ void PhysicsServer::_bind_methods() {
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(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(D_METHOD("body_set_collision_layer", "body", "layer"), &PhysicsServer::body_set_collision_layer);
+ ClassDB::bind_method(D_METHOD("body_get_collision_layer", "body"), &PhysicsServer::body_get_collision_layer);
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);
@@ -466,8 +467,8 @@ void PhysicsServer::_bind_methods() {
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(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(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(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);
@@ -515,11 +516,11 @@ void PhysicsServer::_bind_methods() {
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(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(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(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);
+ 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);
diff --git a/servers/physics_server.h b/servers/physics_server.h
index dbd0c79f06..b38e14eb0c 100644
--- a/servers/physics_server.h
+++ b/servers/physics_server.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -99,7 +100,7 @@ class PhysicsShapeQueryParameters : public Reference {
Transform transform;
float margin;
Set<RID> exclude;
- uint32_t layer_mask;
+ uint32_t collision_layer;
uint32_t object_type_mask;
protected:
@@ -116,8 +117,8 @@ public:
void set_margin(float p_margin);
float get_margin() const;
- void set_layer_mask(int p_layer_mask);
- int get_layer_mask() const;
+ void set_collision_layer(int p_collision_layer);
+ int get_collision_layer() const;
void set_object_type_mask(int p_object_type_mask);
int get_object_type_mask() const;
@@ -155,27 +156,29 @@ protected:
static void _bind_methods();
public:
- struct RayResult {
+ struct ShapeResult {
- Vector3 position;
- Vector3 normal;
RID rid;
ObjectID collider_id;
Object *collider;
int shape;
};
- virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_layer_mask = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION, bool p_pick_ray = false) = 0;
+ virtual int intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0;
- struct ShapeResult {
+ struct RayResult {
+ Vector3 position;
+ Vector3 normal;
RID rid;
ObjectID collider_id;
Object *collider;
int shape;
};
- 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) = 0;
+ virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION, bool p_pick_ray = false) = 0;
+
+ 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0;
struct ShapeRestInfo {
@@ -187,11 +190,13 @@ public:
Vector3 linear_velocity; //velocity at contact point
};
- 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) = 0;
+ 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION, ShapeRestInfo *r_info = NULL) = 0;
+
+ 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0;
- 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) = 0;
+ 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_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0;
- 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) = 0;
+ virtual Vector3 get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const = 0;
PhysicsDirectSpaceState();
};
@@ -260,8 +265,8 @@ public:
SPACE_PARAM_CONTACT_RECYCLE_RADIUS,
SPACE_PARAM_CONTACT_MAX_SEPARATION,
SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION,
- SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD,
- SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD,
+ SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD,
+ SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD,
SPACE_PARAM_BODY_TIME_TO_SLEEP,
SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO,
SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS,
@@ -321,8 +326,10 @@ public:
virtual void area_remove_shape(RID p_area, int p_shape_idx) = 0;
virtual void area_clear_shapes(RID p_area) = 0;
- virtual void area_attach_object_instance_ID(RID p_area, ObjectID p_ID) = 0;
- virtual ObjectID area_get_object_instance_ID(RID p_area) const = 0;
+ virtual void area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) = 0;
+
+ virtual void area_attach_object_instance_id(RID p_area, ObjectID p_ID) = 0;
+ virtual ObjectID area_get_object_instance_id(RID p_area) const = 0;
virtual void area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) = 0;
virtual void area_set_transform(RID p_area, const Transform &p_transform) = 0;
@@ -331,7 +338,7 @@ public:
virtual Transform area_get_transform(RID p_area) const = 0;
virtual void area_set_collision_mask(RID p_area, uint32_t p_mask) = 0;
- virtual void area_set_layer_mask(RID p_area, uint32_t p_mask) = 0;
+ virtual void area_set_collision_layer(RID p_area, uint32_t p_layer) = 0;
virtual void area_set_monitorable(RID p_area, bool p_monitorable) = 0;
@@ -369,26 +376,25 @@ public:
virtual RID body_get_shape(RID p_body, int p_shape_idx) const = 0;
virtual Transform body_get_shape_transform(RID p_body, int p_shape_idx) const = 0;
- virtual void body_set_shape_as_trigger(RID p_body, int p_shape_idx, bool p_enable) = 0;
- virtual bool body_is_shape_set_as_trigger(RID p_body, int p_shape_idx) const = 0;
-
virtual void body_remove_shape(RID p_body, int p_shape_idx) = 0;
virtual void body_clear_shapes(RID p_body) = 0;
- virtual void body_attach_object_instance_ID(RID p_body, uint32_t p_ID) = 0;
- virtual uint32_t body_get_object_instance_ID(RID p_body) const = 0;
+ virtual void body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) = 0;
+
+ virtual void body_attach_object_instance_id(RID p_body, uint32_t p_ID) = 0;
+ virtual uint32_t body_get_object_instance_id(RID p_body) const = 0;
virtual void body_set_enable_continuous_collision_detection(RID p_body, bool p_enable) = 0;
virtual bool body_is_continuous_collision_detection_enabled(RID p_body) const = 0;
- virtual void body_set_layer_mask(RID p_body, uint32_t p_mask) = 0;
- virtual uint32_t body_get_layer_mask(RID p_body, uint32_t p_mask) const = 0;
+ virtual void body_set_collision_layer(RID p_body, uint32_t p_layer) = 0;
+ virtual uint32_t body_get_collision_layer(RID p_body) const = 0;
virtual void body_set_collision_mask(RID p_body, uint32_t p_mask) = 0;
- virtual uint32_t body_get_collision_mask(RID p_body, uint32_t p_mask) const = 0;
+ virtual uint32_t body_get_collision_mask(RID p_body) const = 0;
virtual void body_set_user_flags(RID p_body, uint32_t p_flags) = 0;
- virtual uint32_t body_get_user_flags(RID p_body, uint32_t p_flags) const = 0;
+ virtual uint32_t body_get_user_flags(RID p_body) const = 0;
// common body variables
enum BodyParameter {
@@ -446,8 +452,8 @@ public:
virtual int body_get_max_contacts_reported(RID p_body) const = 0;
//missing remove
- virtual void body_set_contacts_reported_depth_treshold(RID p_body, float p_treshold) = 0;
- virtual float body_get_contacts_reported_depth_treshold(RID p_body) const = 0;
+ virtual void body_set_contacts_reported_depth_threshold(RID p_body, float p_threshold) = 0;
+ virtual float body_get_contacts_reported_depth_threshold(RID p_body) const = 0;
virtual void body_set_omit_force_integration(RID p_body, bool p_omit) = 0;
virtual bool body_is_omitting_force_integration(RID p_body) const = 0;
@@ -457,6 +463,23 @@ public:
virtual void body_set_ray_pickable(RID p_body, bool p_enable) = 0;
virtual bool body_is_ray_pickable(RID p_body) const = 0;
+ struct MotionResult {
+
+ Vector3 motion;
+ Vector3 remainder;
+
+ Vector3 collision_point;
+ Vector3 collision_normal;
+ Vector3 collider_velocity;
+ int collision_local_shape;
+ ObjectID collider_id;
+ RID collider;
+ int collider_shape;
+ Variant collider_metadata;
+ };
+
+ virtual bool body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, float p_margin = 0.001, MotionResult *r_result = NULL) = 0;
+
/* JOINT API */
enum JointType {
@@ -485,11 +508,11 @@ public:
virtual void pin_joint_set_param(RID p_joint, PinJointParam p_param, float p_value) = 0;
virtual float pin_joint_get_param(RID p_joint, PinJointParam p_param) const = 0;
- virtual void pin_joint_set_local_A(RID p_joint, const Vector3 &p_A) = 0;
- virtual Vector3 pin_joint_get_local_A(RID p_joint) const = 0;
+ virtual void pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) = 0;
+ virtual Vector3 pin_joint_get_local_a(RID p_joint) const = 0;
- virtual void pin_joint_set_local_B(RID p_joint, const Vector3 &p_B) = 0;
- virtual Vector3 pin_joint_get_local_B(RID p_joint) const = 0;
+ virtual void pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) = 0;
+ virtual Vector3 pin_joint_get_local_b(RID p_joint) const = 0;
enum HingeJointParam {
diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp
index 06bcb642ad..092f445c13 100644
--- a/servers/register_server_types.cpp
+++ b/servers/register_server_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,8 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "register_server_types.h"
-#include "global_config.h"
+#include "project_settings.h"
+#include "arvr/arvr_interface.h"
+#include "arvr/arvr_positional_tracker.h"
+#include "arvr/arvr_script_interface.h"
+#include "arvr_server.h"
#include "audio/audio_effect.h"
#include "audio/audio_stream.h"
#include "audio/effects/audio_effect_amplify.h"
@@ -69,20 +74,26 @@ static void _debugger_get_resource_usage(List<ScriptDebuggerRemote::ResourceUsag
}
ShaderTypes *shader_types = NULL;
+ARVRServer *arvr_server = NULL;
void register_server_types() {
+ arvr_server = memnew(ARVRServer);
- GLOBAL_DEF("memory/multithread/thread_rid_pool_prealloc", 20);
-
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("VisualServer", VisualServer::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("AudioServer", AudioServer::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("PhysicsServer", PhysicsServer::get_singleton()));
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("Physics2DServer", Physics2DServer::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("VisualServer", VisualServer::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("AudioServer", AudioServer::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("PhysicsServer", PhysicsServer::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Physics2DServer", Physics2DServer::get_singleton()));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ARVRServer", ARVRServer::get_singleton()));
shader_types = memnew(ShaderTypes);
+ ClassDB::register_virtual_class<ARVRInterface>();
+ ClassDB::register_class<ARVRPositionalTracker>();
+ ClassDB::register_class<ARVRScriptInterface>();
+
ClassDB::register_virtual_class<AudioStream>();
ClassDB::register_virtual_class<AudioStreamPlayback>();
+ ClassDB::register_class<AudioStreamRandomPitch>();
ClassDB::register_virtual_class<AudioEffect>();
ClassDB::register_class<AudioBusLayout>();
@@ -133,5 +144,9 @@ void register_server_types() {
void unregister_server_types() {
+ //@TODO move this into iPhone/Android implementation? just have this here for testing...
+ // mobile_interface = NULL;
+
memdelete(shader_types);
+ memdelete(arvr_server);
}
diff --git a/servers/register_server_types.h b/servers/register_server_types.h
index a3e7d3ee32..c183ccc8a4 100644
--- a/servers/register_server_types.h
+++ b/servers/register_server_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/server_wrap_mt_common.h b/servers/server_wrap_mt_common.h
index cfb65cf161..1ffa5ad14c 100644
--- a/servers/server_wrap_mt_common.h
+++ b/servers/server_wrap_mt_common.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,7 +30,7 @@
#define FUNC0R(m_r, m_type) \
virtual m_r m_type() { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, &ret); \
SYNC_DEBUG \
@@ -40,8 +41,9 @@
}
#define FUNCRID(m_type) \
+ List<RID> m_type##_id_pool; \
int m_type##allocn() { \
- for (int i = 0; i < m_type##_pool_max_size; i++) { \
+ for (int i = 0; i < pool_max_size; i++) { \
m_type##_id_pool.push_back(server_name->m_type##_create()); \
} \
return 0; \
@@ -53,7 +55,7 @@
} \
} \
virtual RID m_type##_create() { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
RID rid; \
alloc_mutex->lock(); \
if (m_type##_id_pool.size() == 0) { \
@@ -83,7 +85,7 @@
} \
} \
virtual RID m_type##_create(m_arg1 p1) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
RID rid; \
alloc_mutex->lock(); \
if (m_type##_id_pool.size() == 0) { \
@@ -113,7 +115,7 @@
} \
} \
virtual RID m_type##_create(m_arg1 p1, m_arg2 p2) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
RID rid; \
alloc_mutex->lock(); \
if (m_type##_id_pool.size() == 0) { \
@@ -143,7 +145,7 @@
} \
} \
virtual RID m_type##_create(m_arg1 p1, m_arg2 p2, m_arg3 p3) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
RID rid; \
alloc_mutex->lock(); \
if (m_type##_id_pool.size() == 0) { \
@@ -173,7 +175,7 @@
} \
} \
virtual RID m_type##_create(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
RID rid; \
alloc_mutex->lock(); \
if (m_type##_id_pool.size() == 0) { \
@@ -203,7 +205,7 @@
} \
} \
virtual RID m_type##_create(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
RID rid; \
alloc_mutex->lock(); \
if (m_type##_id_pool.size() == 0) { \
@@ -221,7 +223,7 @@
#define FUNC0RC(m_r, m_type) \
virtual m_r m_type() const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, &ret); \
SYNC_DEBUG \
@@ -233,7 +235,7 @@
#define FUNC0(m_type) \
virtual void m_type() { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type); \
} else { \
server_name->m_type(); \
@@ -242,7 +244,7 @@
#define FUNC0C(m_type) \
virtual void m_type() const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type); \
} else { \
server_name->m_type(); \
@@ -251,7 +253,7 @@
#define FUNC0S(m_type) \
virtual void m_type() { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type); \
} else { \
server_name->m_type(); \
@@ -260,7 +262,7 @@
#define FUNC0SC(m_type) \
virtual void m_type() const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type); \
} else { \
server_name->m_type(); \
@@ -271,7 +273,7 @@
#define FUNC1R(m_r, m_type, m_arg1) \
virtual m_r m_type(m_arg1 p1) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, &ret); \
SYNC_DEBUG \
@@ -283,7 +285,7 @@
#define FUNC1RC(m_r, m_type, m_arg1) \
virtual m_r m_type(m_arg1 p1) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, &ret); \
SYNC_DEBUG \
@@ -295,7 +297,7 @@
#define FUNC1S(m_type, m_arg1) \
virtual void m_type(m_arg1 p1) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1); \
} else { \
server_name->m_type(p1); \
@@ -304,7 +306,7 @@
#define FUNC1SC(m_type, m_arg1) \
virtual void m_type(m_arg1 p1) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1); \
} else { \
server_name->m_type(p1); \
@@ -313,7 +315,7 @@
#define FUNC1(m_type, m_arg1) \
virtual void m_type(m_arg1 p1) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1); \
} else { \
server_name->m_type(p1); \
@@ -322,7 +324,7 @@
#define FUNC1C(m_type, m_arg1) \
virtual void m_type(m_arg1 p1) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1); \
} else { \
server_name->m_type(p1); \
@@ -331,7 +333,7 @@
#define FUNC2R(m_r, m_type, m_arg1, m_arg2) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, &ret); \
SYNC_DEBUG \
@@ -343,7 +345,7 @@
#define FUNC2RC(m_r, m_type, m_arg1, m_arg2) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, &ret); \
SYNC_DEBUG \
@@ -355,7 +357,7 @@
#define FUNC2S(m_type, m_arg1, m_arg2) \
virtual void m_type(m_arg1 p1, m_arg2 p2) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2); \
} else { \
server_name->m_type(p1, p2); \
@@ -364,7 +366,7 @@
#define FUNC2SC(m_type, m_arg1, m_arg2) \
virtual void m_type(m_arg1 p1, m_arg2 p2) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2); \
} else { \
server_name->m_type(p1, p2); \
@@ -373,7 +375,7 @@
#define FUNC2(m_type, m_arg1, m_arg2) \
virtual void m_type(m_arg1 p1, m_arg2 p2) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2); \
} else { \
server_name->m_type(p1, p2); \
@@ -382,7 +384,7 @@
#define FUNC2C(m_type, m_arg1, m_arg2) \
virtual void m_type(m_arg1 p1, m_arg2 p2) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2); \
} else { \
server_name->m_type(p1, p2); \
@@ -391,7 +393,7 @@
#define FUNC3R(m_r, m_type, m_arg1, m_arg2, m_arg3) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, &ret); \
SYNC_DEBUG \
@@ -403,7 +405,7 @@
#define FUNC3RC(m_r, m_type, m_arg1, m_arg2, m_arg3) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, &ret); \
return ret; \
@@ -414,7 +416,7 @@
#define FUNC3S(m_type, m_arg1, m_arg2, m_arg3) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3); \
} else { \
server_name->m_type(p1, p2, p3); \
@@ -423,7 +425,7 @@
#define FUNC3SC(m_type, m_arg1, m_arg2, m_arg3) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3); \
} else { \
server_name->m_type(p1, p2, p3); \
@@ -432,7 +434,7 @@
#define FUNC3(m_type, m_arg1, m_arg2, m_arg3) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3); \
} else { \
server_name->m_type(p1, p2, p3); \
@@ -441,7 +443,7 @@
#define FUNC3C(m_type, m_arg1, m_arg2, m_arg3) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3); \
} else { \
server_name->m_type(p1, p2, p3); \
@@ -450,7 +452,7 @@
#define FUNC4R(m_r, m_type, m_arg1, m_arg2, m_arg3, m_arg4) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, p4, &ret); \
SYNC_DEBUG \
@@ -462,7 +464,7 @@
#define FUNC4RC(m_r, m_type, m_arg1, m_arg2, m_arg3, m_arg4) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, p4, &ret); \
SYNC_DEBUG \
@@ -474,7 +476,7 @@
#define FUNC4S(m_type, m_arg1, m_arg2, m_arg3, m_arg4) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3, p4); \
} else { \
server_name->m_type(p1, p2, p3, p4); \
@@ -483,7 +485,7 @@
#define FUNC4SC(m_type, m_arg1, m_arg2, m_arg3, m_arg4) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3, p4); \
} else { \
server_name->m_type(p1, p2, p3, p4); \
@@ -492,7 +494,7 @@
#define FUNC4(m_type, m_arg1, m_arg2, m_arg3, m_arg4) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4); \
} else { \
server_name->m_type(p1, p2, p3, p4); \
@@ -501,7 +503,7 @@
#define FUNC4C(m_type, m_arg1, m_arg2, m_arg3, m_arg4) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4); \
} else { \
server_name->m_type(p1, p2, p3, p4); \
@@ -510,7 +512,7 @@
#define FUNC5R(m_r, m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, &ret); \
SYNC_DEBUG \
@@ -522,7 +524,7 @@
#define FUNC5RC(m_r, m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, &ret); \
SYNC_DEBUG \
@@ -534,7 +536,7 @@
#define FUNC5S(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3, p4, p5); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5); \
@@ -543,7 +545,7 @@
#define FUNC5SC(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3, p4, p5); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5); \
@@ -552,7 +554,7 @@
#define FUNC5(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4, p5); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5); \
@@ -561,7 +563,7 @@
#define FUNC5C(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4, p5); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5); \
@@ -570,7 +572,7 @@
#define FUNC6R(m_r, m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, &ret); \
SYNC_DEBUG \
@@ -582,7 +584,7 @@
#define FUNC6RC(m_r, m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, &ret); \
return ret; \
@@ -593,7 +595,7 @@
#define FUNC6S(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6); \
@@ -602,7 +604,7 @@
#define FUNC6SC(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6); \
@@ -611,7 +613,7 @@
#define FUNC6(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6); \
@@ -620,7 +622,7 @@
#define FUNC6C(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6); \
@@ -629,7 +631,7 @@
#define FUNC7R(m_r, m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7, &ret); \
SYNC_DEBUG \
@@ -641,7 +643,7 @@
#define FUNC7RC(m_r, m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7, &ret); \
SYNC_DEBUG \
@@ -653,7 +655,7 @@
#define FUNC7S(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6, p7); \
@@ -662,7 +664,7 @@
#define FUNC7SC(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6, p7); \
@@ -671,7 +673,7 @@
#define FUNC7(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6, p7); \
@@ -680,7 +682,7 @@
#define FUNC7C(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6, p7); \
@@ -689,7 +691,7 @@
#define FUNC8R(m_r, m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7, m_arg8 p8) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7, p8, &ret); \
SYNC_DEBUG \
@@ -701,7 +703,7 @@
#define FUNC8RC(m_r, m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8) \
virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7, m_arg8 p8) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
m_r ret; \
command_queue.push_and_ret(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7, p8, &ret); \
SYNC_DEBUG \
@@ -713,7 +715,7 @@
#define FUNC8S(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7, m_arg8 p8) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7, p8); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6, p7, p8); \
@@ -722,7 +724,7 @@
#define FUNC8SC(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7, m_arg8 p8) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push_and_sync(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7, p8); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6, p7, p8); \
@@ -731,7 +733,7 @@
#define FUNC8(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7, m_arg8 p8) { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7, p8); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6, p7, p8); \
@@ -740,9 +742,36 @@
#define FUNC8C(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8) \
virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7, m_arg8 p8) const { \
- if (Thread::get_caller_ID() != server_thread) { \
+ if (Thread::get_caller_id() != server_thread) { \
command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7, p8); \
} else { \
server_name->m_type(p1, p2, p3, p4, p5, p6, p7, p8); \
} \
}
+
+#define FUNC9(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8, m_arg9) \
+ virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7, m_arg8 p8, m_arg9 p9) { \
+ if (Thread::get_caller_id() != server_thread) { \
+ command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7, p8, p9); \
+ } else { \
+ server_name->m_type(p1, p2, p3, p4, p5, p6, p7, p8, p9); \
+ } \
+ }
+
+#define FUNC10(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8, m_arg9, m_arg10) \
+ virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7, m_arg8 p8, m_arg9 p9, m_arg10 p10) { \
+ if (Thread::get_caller_id() != server_thread) { \
+ command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
+ } else { \
+ server_name->m_type(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
+ } \
+ }
+
+#define FUNC11(m_type, m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8, m_arg9, m_arg10, m_arg11) \
+ virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7, m_arg8 p8, m_arg9 p9, m_arg10 p10, m_arg11 p11) { \
+ if (Thread::get_caller_id() != server_thread) { \
+ command_queue.push(server_name, &ServerName::m_type, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
+ } else { \
+ server_name->m_type(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
+ } \
+ }
diff --git a/servers/visual/rasterizer.cpp b/servers/visual/rasterizer.cpp
index 1be65be927..f7ea158646 100644
--- a/servers/visual/rasterizer.cpp
+++ b/servers/visual/rasterizer.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,11 +38,11 @@ Rasterizer *Rasterizer::create() {
return _create_func();
}
-RasterizerStorage *RasterizerStorage::base_signleton = NULL;
+RasterizerStorage *RasterizerStorage::base_singleton = NULL;
RasterizerStorage::RasterizerStorage() {
- base_signleton = this;
+ base_singleton = this;
}
#if 0
@@ -54,10 +55,10 @@ RID Rasterizer::create_default_material() {
/* Fixed MAterial SHADER API */
-RID Rasterizer::_create_shader(const FixedSpatialMaterialShaderKey& p_key) {
+RID Rasterizer::_create_shader(const SpatialMaterialShaderKey& p_key) {
ERR_FAIL_COND_V(!p_key.valid,RID());
- Map<FixedSpatialMaterialShaderKey,FixedSpatialMaterialShader>::Element *E=fixed_material_shaders.find(p_key);
+ Map<SpatialMaterialShaderKey,SpatialMaterialShader>::Element *E=fixed_material_shaders.find(p_key);
if (E) {
E->get().refcount++;
@@ -66,7 +67,7 @@ RID Rasterizer::_create_shader(const FixedSpatialMaterialShaderKey& p_key) {
uint64_t t = OS::get_singleton()->get_ticks_usec();
- FixedSpatialMaterialShader fms;
+ SpatialMaterialShader fms;
fms.refcount=1;
fms.shader=shader_create();
@@ -312,12 +313,12 @@ RID Rasterizer::_create_shader(const FixedSpatialMaterialShaderKey& p_key) {
return fms.shader;
}
-void Rasterizer::_free_shader(const FixedSpatialMaterialShaderKey& p_key) {
+void Rasterizer::_free_shader(const SpatialMaterialShaderKey& p_key) {
if (p_key.valid==0)
return; //not a valid key
- Map<FixedSpatialMaterialShaderKey,FixedSpatialMaterialShader>::Element *E=fixed_material_shaders.find(p_key);
+ Map<SpatialMaterialShaderKey,SpatialMaterialShader>::Element *E=fixed_material_shaders.find(p_key);
ERR_FAIL_COND(!E);
E->get().refcount--;
@@ -329,12 +330,12 @@ void Rasterizer::_free_shader(const FixedSpatialMaterialShaderKey& p_key) {
}
-void Rasterizer::fixed_material_set_flag(RID p_material, VS::FixedSpatialMaterialFlags p_flag, bool p_enabled) {
+void Rasterizer::fixed_material_set_flag(RID p_material, VS::SpatialMaterialFlags p_flag, bool p_enabled) {
- Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND(!E);
- FixedSpatialMaterial &fm=*E->get();
+ SpatialMaterial &fm=*E->get();
switch(p_flag) {
@@ -350,11 +351,11 @@ void Rasterizer::fixed_material_set_flag(RID p_material, VS::FixedSpatialMateria
}
-bool Rasterizer::fixed_material_get_flag(RID p_material, VS::FixedSpatialMaterialFlags p_flag) const{
+bool Rasterizer::fixed_material_get_flag(RID p_material, VS::SpatialMaterialFlags p_flag) const{
- const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ const Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND_V(!E,false);
- const FixedSpatialMaterial &fm=*E->get();
+ const SpatialMaterial &fm=*E->get();
switch(p_flag) {
case VS::FIXED_MATERIAL_FLAG_USE_ALPHA: return fm.use_alpha;; break;
@@ -373,8 +374,8 @@ bool Rasterizer::fixed_material_get_flag(RID p_material, VS::FixedSpatialMateria
RID Rasterizer::fixed_material_create() {
RID mat = material_create();
- fixed_materials[mat]=memnew( FixedSpatialMaterial() );
- FixedSpatialMaterial &fm=*fixed_materials[mat];
+ fixed_materials[mat]=memnew( SpatialMaterial() );
+ SpatialMaterial &fm=*fixed_materials[mat];
fm.self=mat;
fm.get_key();
material_set_flag(mat,VS::MATERIAL_FLAG_COLOR_ARRAY_SRGB,true);
@@ -390,11 +391,11 @@ RID Rasterizer::fixed_material_create() {
-void Rasterizer::fixed_material_set_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter, const Variant& p_value){
+void Rasterizer::fixed_material_set_parameter(RID p_material, VS::SpatialMaterialParam p_parameter, const Variant& p_value){
- Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND(!E);
- FixedSpatialMaterial &fm=*E->get();
+ SpatialMaterial &fm=*E->get();
RID material=E->key();
ERR_FAIL_INDEX(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX);
@@ -417,24 +418,24 @@ void Rasterizer::fixed_material_set_parameter(RID p_material, VS::FixedSpatialMa
}
-Variant Rasterizer::fixed_material_get_parameter(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const{
+Variant Rasterizer::fixed_material_get_parameter(RID p_material,VS::SpatialMaterialParam p_parameter) const{
- const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ const Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND_V(!E,Variant());
- const FixedSpatialMaterial &fm=*E->get();
+ const SpatialMaterial &fm=*E->get();
ERR_FAIL_INDEX_V(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX,Variant());
return fm.param[p_parameter];
}
-void Rasterizer::fixed_material_set_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter, RID p_texture){
+void Rasterizer::fixed_material_set_texture(RID p_material,VS::SpatialMaterialParam p_parameter, RID p_texture){
- Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
if (!E) {
print_line("Not found: "+itos(p_material.get_id()));
}
ERR_FAIL_COND(!E);
- FixedSpatialMaterial &fm=*E->get();
+ SpatialMaterial &fm=*E->get();
ERR_FAIL_INDEX(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX);
@@ -449,22 +450,22 @@ void Rasterizer::fixed_material_set_texture(RID p_material,VS::FixedSpatialMater
}
-RID Rasterizer::fixed_material_get_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const{
+RID Rasterizer::fixed_material_get_texture(RID p_material,VS::SpatialMaterialParam p_parameter) const{
- const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ const Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND_V(!E,RID());
- const FixedSpatialMaterial &fm=*E->get();
+ const SpatialMaterial &fm=*E->get();
ERR_FAIL_INDEX_V(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX,RID());
return fm.texture[p_parameter];
}
-void Rasterizer::fixed_material_set_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter, VS::FixedSpatialMaterialTexCoordMode p_mode) {
+void Rasterizer::fixed_material_set_texcoord_mode(RID p_material,VS::SpatialMaterialParam p_parameter, VS::SpatialMaterialTexCoordMode p_mode) {
- Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND(!E);
- FixedSpatialMaterial &fm=*E->get();
+ SpatialMaterial &fm=*E->get();
ERR_FAIL_INDEX(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX);
fm.get_key();
@@ -476,11 +477,11 @@ void Rasterizer::fixed_material_set_texcoord_mode(RID p_material,VS::FixedSpatia
}
-VS::FixedSpatialMaterialTexCoordMode Rasterizer::fixed_material_get_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const {
+VS::SpatialMaterialTexCoordMode Rasterizer::fixed_material_get_texcoord_mode(RID p_material,VS::SpatialMaterialParam p_parameter) const {
- const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ const Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND_V(!E,VS::FIXED_MATERIAL_TEXCOORD_UV);
- const FixedSpatialMaterial &fm=*E->get();
+ const SpatialMaterial &fm=*E->get();
ERR_FAIL_INDEX_V(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX,VS::FIXED_MATERIAL_TEXCOORD_UV);
return fm.texture_tc[p_parameter];
@@ -488,9 +489,9 @@ VS::FixedSpatialMaterialTexCoordMode Rasterizer::fixed_material_get_texcoord_mod
void Rasterizer::fixed_material_set_uv_transform(RID p_material,const Transform& p_transform) {
- Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND(!E);
- FixedSpatialMaterial &fm=*E->get();
+ SpatialMaterial &fm=*E->get();
RID material=E->key();
VS::get_singleton()->material_set_param(material,_fixed_material_uv_xform_name,p_transform);
@@ -503,18 +504,18 @@ void Rasterizer::fixed_material_set_uv_transform(RID p_material,const Transform&
Transform Rasterizer::fixed_material_get_uv_transform(RID p_material) const {
- const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ const Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND_V(!E,Transform());
- const FixedSpatialMaterial &fm=*E->get();
+ const SpatialMaterial &fm=*E->get();
return fm.uv_xform;
}
-void Rasterizer::fixed_material_set_light_shader(RID p_material,VS::FixedSpatialMaterialLightShader p_shader) {
+void Rasterizer::fixed_material_set_light_shader(RID p_material,VS::SpatialMaterialLightShader p_shader) {
- Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND(!E);
- FixedSpatialMaterial &fm=*E->get();
+ SpatialMaterial &fm=*E->get();
fm.light_shader=p_shader;
@@ -523,20 +524,20 @@ void Rasterizer::fixed_material_set_light_shader(RID p_material,VS::FixedSpatial
}
-VS::FixedSpatialMaterialLightShader Rasterizer::fixed_material_get_light_shader(RID p_material) const {
+VS::SpatialMaterialLightShader Rasterizer::fixed_material_get_light_shader(RID p_material) const {
- const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ const Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND_V(!E,VS::FIXED_MATERIAL_LIGHT_SHADER_LAMBERT);
- const FixedSpatialMaterial &fm=*E->get();
+ const SpatialMaterial &fm=*E->get();
return fm.light_shader;
}
void Rasterizer::fixed_material_set_point_size(RID p_material,float p_size) {
- Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND(!E);
- FixedSpatialMaterial &fm=*E->get();
+ SpatialMaterial &fm=*E->get();
RID material=E->key();
VS::get_singleton()->material_set_param(material,_fixed_material_point_size_name,p_size);
@@ -548,9 +549,9 @@ void Rasterizer::fixed_material_set_point_size(RID p_material,float p_size) {
float Rasterizer::fixed_material_get_point_size(RID p_material) const{
- const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ const Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND_V(!E,1.0);
- const FixedSpatialMaterial &fm=*E->get();
+ const SpatialMaterial &fm=*E->get();
return fm.point_size;
@@ -561,9 +562,9 @@ void Rasterizer::_update_fixed_materials() {
while(fixed_material_dirty_list.first()) {
- FixedSpatialMaterial &fm=*fixed_material_dirty_list.first()->self();
+ SpatialMaterial &fm=*fixed_material_dirty_list.first()->self();
- FixedSpatialMaterialShaderKey new_key = fm.get_key();
+ SpatialMaterialShaderKey new_key = fm.get_key();
if (new_key.key!=fm.current_key.key) {
_free_shader(fm.current_key);
@@ -593,7 +594,7 @@ void Rasterizer::_update_fixed_materials() {
void Rasterizer::_free_fixed_material(const RID& p_material) {
- Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material);
+ Map<RID,SpatialMaterial*>::Element *E = fixed_materials.find(p_material);
if (E) {
@@ -636,7 +637,7 @@ Rasterizer::Rasterizer() {
draw_viewport_func=NULL;
- ERR_FAIL_COND( sizeof(FixedSpatialMaterialShaderKey)!=4);
+ ERR_FAIL_COND( sizeof(SpatialMaterialShaderKey)!=4);
}
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index 838ddead75..9405f6e012 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -51,25 +52,33 @@ public:
virtual RID environment_create() = 0;
virtual void environment_set_background(RID p_env, VS::EnvironmentBG p_bg) = 0;
- virtual void environment_set_skybox(RID p_env, RID p_skybox) = 0;
- virtual void environment_set_skybox_scale(RID p_env, float p_scale) = 0;
+ virtual void environment_set_sky(RID p_env, RID p_sky) = 0;
+ virtual void environment_set_sky_scale(RID p_env, float p_scale) = 0;
virtual void environment_set_bg_color(RID p_env, const Color &p_color) = 0;
virtual void environment_set_bg_energy(RID p_env, float p_energy) = 0;
virtual void environment_set_canvas_max_layer(RID p_env, int p_max_layer) = 0;
- virtual void environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy = 1.0, float p_skybox_contribution = 0.0) = 0;
+ virtual void environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy = 1.0, float p_sky_contribution = 0.0) = 0;
virtual void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, VS::EnvironmentDOFBlurQuality p_quality) = 0;
virtual void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, VS::EnvironmentDOFBlurQuality p_quality) = 0;
- virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_treshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_treshold, float p_hdr_bleed_scale, bool p_bicubic_upscale) = 0;
+ virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, bool p_bicubic_upscale) = 0;
virtual void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture) = 0;
- virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_accel, float p_fade, float p_depth_tolerance, bool p_smooth, bool p_roughness) = 0;
+ virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_int, float p_fade_out, float p_depth_tolerance, bool p_roughness) = 0;
virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, const Color &p_color, bool p_blur) = 0;
virtual void environment_set_tonemap(RID p_env, VS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) = 0;
virtual void environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp) = 0;
+ virtual void environment_set_fog(RID p_env, bool p_enable, const Color &p_color, const Color &p_sun_color, float p_sun_amount) = 0;
+ virtual void environment_set_fog_depth(RID p_env, bool p_enable, float p_depth_begin, float p_depth_curve, bool p_transmit, float p_transmit_curve) = 0;
+ virtual void environment_set_fog_height(RID p_env, bool p_enable, float p_min_height, float p_max_height, float p_height_curve) = 0;
+
+ virtual bool is_environment(RID p_env) = 0;
+ virtual VS::EnvironmentBG environment_get_background(RID p_env) = 0;
+ virtual int environment_get_canvas_max_layer(RID p_env) = 0;
+
struct InstanceBase : RID_Data {
VS::InstanceType base_type;
@@ -98,41 +107,36 @@ public:
//int baked_lightmap_id;
bool mirror : 8;
- bool depth_scale : 8;
- bool billboard : 8;
- bool billboard_y : 8;
bool receive_shadows : 8;
bool visible : 8;
+ bool baked_light : 8; //this flag is only to know if it actually did use baked light
float depth; //used for sorting
SelfList<InstanceBase> dependency_item;
- InstanceBase *baked_light; //baked light to use
- SelfList<InstanceBase> baked_light_item;
+ //InstanceBase *baked_light; //baked light to use
+ //SelfList<InstanceBase> baked_light_item;
virtual void base_removed() = 0;
virtual void base_changed() = 0;
virtual void base_material_changed() = 0;
InstanceBase()
- : dependency_item(this), baked_light_item(this) {
+ : dependency_item(this) {
base_type = VS::INSTANCE_NONE;
cast_shadows = VS::SHADOW_CASTING_SETTING_ON;
receive_shadows = true;
- depth_scale = false;
- billboard = false;
- billboard_y = false;
visible = true;
depth_layer = 0;
layer_mask = 1;
- baked_light = NULL;
+ baked_light = false;
}
};
virtual RID light_instance_create(RID p_light) = 0;
virtual void light_instance_set_transform(RID p_light_instance, const Transform &p_transform) = 0;
- virtual void light_instance_set_shadow_transform(RID p_light_instance, const CameraMatrix &p_projection, const Transform &p_transform, float p_far, float p_split, int p_pass) = 0;
+ virtual void light_instance_set_shadow_transform(RID p_light_instance, const CameraMatrix &p_projection, const Transform &p_transform, float p_far, float p_split, int p_pass, float p_bias_scale = 1.0) = 0;
virtual void light_instance_mark_visible(RID p_light_instance) = 0;
virtual RID reflection_atlas_create() = 0;
@@ -156,6 +160,7 @@ public:
virtual void render_shadow(RID p_light, RID p_shadow_atlas, int p_pass, InstanceBase **p_cull_result, int p_cull_count) = 0;
virtual void set_scene_pass(uint64_t p_pass) = 0;
+ virtual void set_debug_draw_mode(VS::ViewportDebugDraw p_debug_draw) = 0;
virtual bool free(RID p_rid) = 0;
@@ -168,11 +173,12 @@ public:
virtual RID texture_create() = 0;
virtual void texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT) = 0;
- virtual void texture_set_data(RID p_texture, const Image &p_image, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) = 0;
- virtual Image texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) const = 0;
+ virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) = 0;
+ virtual Ref<Image> texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) const = 0;
virtual void texture_set_flags(RID p_texture, uint32_t p_flags) = 0;
virtual uint32_t texture_get_flags(RID p_texture) const = 0;
virtual Image::Format texture_get_format(RID p_texture) const = 0;
+ virtual uint32_t texture_get_texid(RID p_texture) const = 0;
virtual uint32_t texture_get_width(RID p_texture) const = 0;
virtual uint32_t texture_get_height(RID p_texture) const = 0;
virtual void texture_set_size_override(RID p_texture, int p_width, int p_height) = 0;
@@ -188,20 +194,18 @@ public:
virtual void texture_set_detect_3d_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata) = 0;
virtual void texture_set_detect_srgb_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata) = 0;
+ virtual void texture_set_detect_normal_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata) = 0;
virtual void textures_keep_original(bool p_enable) = 0;
- /* SKYBOX API */
+ /* SKY API */
- virtual RID skybox_create() = 0;
- virtual void skybox_set_texture(RID p_skybox, RID p_cube_map, int p_radiance_size) = 0;
+ virtual RID sky_create() = 0;
+ virtual void sky_set_texture(RID p_sky, RID p_cube_map, int p_radiance_size) = 0;
/* SHADER API */
- virtual RID shader_create(VS::ShaderMode p_mode = VS::SHADER_SPATIAL) = 0;
-
- virtual void shader_set_mode(RID p_shader, VS::ShaderMode p_mode) = 0;
- virtual VS::ShaderMode shader_get_mode(RID p_shader) const = 0;
+ virtual RID shader_create() = 0;
virtual void shader_set_code(RID p_shader, const String &p_code) = 0;
virtual String shader_get_code(RID p_shader) const = 0;
@@ -222,6 +226,8 @@ public:
virtual void material_set_line_width(RID p_material, float p_width) = 0;
+ virtual void material_set_next_pass(RID p_material, RID p_next_material) = 0;
+
virtual bool material_is_animated(RID p_material) = 0;
virtual bool material_casts_shadows(RID p_material) = 0;
@@ -417,6 +423,9 @@ public:
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_normal_bias(RID p_probe, float p_range) = 0;
+ virtual float gi_probe_get_normal_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;
@@ -445,32 +454,38 @@ public:
virtual void particles_set_emitting(RID p_particles, bool p_emitting) = 0;
virtual void particles_set_amount(RID p_particles, int p_amount) = 0;
virtual void particles_set_lifetime(RID p_particles, float p_lifetime) = 0;
+ virtual void particles_set_one_shot(RID p_particles, bool p_one_shot) = 0;
virtual void particles_set_pre_process_time(RID p_particles, float p_time) = 0;
virtual void particles_set_explosiveness_ratio(RID p_particles, float p_ratio) = 0;
virtual void particles_set_randomness_ratio(RID p_particles, float p_ratio) = 0;
virtual void particles_set_custom_aabb(RID p_particles, const Rect3 &p_aabb) = 0;
- virtual void particles_set_gravity(RID p_particles, const Vector3 &p_gravity) = 0;
+ virtual void particles_set_speed_scale(RID p_particles, float p_scale) = 0;
virtual void particles_set_use_local_coordinates(RID p_particles, bool p_enable) = 0;
virtual void particles_set_process_material(RID p_particles, RID p_material) = 0;
-
- virtual void particles_set_emission_shape(RID p_particles, VS::ParticlesEmissionShape p_shape) = 0;
- virtual void particles_set_emission_sphere_radius(RID p_particles, float p_radius) = 0;
- virtual void particles_set_emission_box_extents(RID p_particles, const Vector3 &p_extents) = 0;
- virtual void particles_set_emission_points(RID p_particles, const PoolVector<Vector3> &p_points) = 0;
+ virtual void particles_set_fixed_fps(RID p_particles, int p_fps) = 0;
+ virtual void particles_set_fractional_delta(RID p_particles, bool p_enable) = 0;
+ virtual void particles_restart(RID p_particles) = 0;
virtual void particles_set_draw_order(RID p_particles, VS::ParticlesDrawOrder p_order) = 0;
virtual void particles_set_draw_passes(RID p_particles, int p_count) = 0;
- virtual void particles_set_draw_pass_material(RID p_particles, int p_pass, RID p_material) = 0;
virtual void particles_set_draw_pass_mesh(RID p_particles, int p_pass, RID p_mesh) = 0;
+ virtual void particles_request_process(RID p_particles) = 0;
virtual Rect3 particles_get_current_aabb(RID p_particles) = 0;
+ virtual Rect3 particles_get_aabb(RID p_particles) const = 0;
+
+ virtual void particles_set_emission_transform(RID p_particles, const Transform &p_transform) = 0;
+
+ virtual int particles_get_draw_passes(RID p_particles) const = 0;
+ virtual RID particles_get_draw_pass_mesh(RID p_particles, int p_pass) const = 0;
/* RENDER TARGET */
enum RenderTargetFlags {
RENDER_TARGET_VFLIP,
RENDER_TARGET_TRANSPARENT,
+ RENDER_TARGET_NO_3D_EFFECTS,
RENDER_TARGET_NO_3D,
RENDER_TARGET_NO_SAMPLING,
RENDER_TARGET_HDR,
@@ -481,7 +496,8 @@ public:
virtual void render_target_set_size(RID p_render_target, int p_width, int p_height) = 0;
virtual RID render_target_get_texture(RID p_render_target) const = 0;
virtual void render_target_set_flag(RID p_render_target, RenderTargetFlags p_flag, bool p_value) = 0;
- virtual bool render_target_renedered_in_frame(RID p_render_target) = 0;
+ virtual bool render_target_was_used(RID p_render_target) = 0;
+ virtual void render_target_clear_used(RID p_render_target) = 0;
virtual void render_target_set_msaa(RID p_render_target, VS::ViewportMSAA p_msaa) = 0;
/* CANVAS SHADOW */
@@ -500,7 +516,15 @@ public:
virtual void update_dirty_resources() = 0;
- static RasterizerStorage *base_signleton;
+ virtual void set_debug_generate_wireframes(bool p_generate) = 0;
+
+ virtual void render_info_begin_capture() = 0;
+ virtual void render_info_end_capture() = 0;
+ virtual int get_captured_render_info(VS::RenderInfo p_info) = 0;
+
+ virtual int get_render_info(VS::RenderInfo p_info) = 0;
+
+ static RasterizerStorage *base_singleton;
RasterizerStorage();
virtual ~RasterizerStorage() {}
};
@@ -513,7 +537,8 @@ public:
CANVAS_RECT_TILE = 2,
CANVAS_RECT_FLIP_H = 4,
CANVAS_RECT_FLIP_V = 8,
- CANVAS_RECT_TRANSPOSE = 16
+ CANVAS_RECT_TRANSPOSE = 16,
+ CANVAS_RECT_CLIP_UV = 32
};
struct Light : public RID_Data {
@@ -539,6 +564,7 @@ public:
float shadow_gradient_length;
VS::CanvasLightShadowFilter shadow_filter;
Color shadow_color;
+ float shadow_smooth;
void *texture_cache; // implementation dependent
Rect2 rect_cache;
@@ -577,6 +603,7 @@ public:
shadow_buffer_size = 256;
shadow_gradient_length = 0;
shadow_filter = VS::CANVAS_LIGHT_FILTER_NONE;
+ shadow_smooth = 0.0;
}
};
@@ -591,12 +618,14 @@ public:
enum Type {
TYPE_LINE,
+ TYPE_POLYLINE,
TYPE_RECT,
TYPE_NINEPATCH,
TYPE_PRIMITIVE,
TYPE_POLYGON,
TYPE_MESH,
TYPE_MULTIMESH,
+ TYPE_PARTICLES,
TYPE_CIRCLE,
TYPE_TRANSFORM,
TYPE_CLIP_IGNORE,
@@ -614,11 +643,24 @@ public:
bool antialiased;
CommandLine() { type = TYPE_LINE; }
};
+ struct CommandPolyLine : public Command {
+
+ bool antialiased;
+ Vector<Point2> triangles;
+ Vector<Color> triangle_colors;
+ Vector<Point2> lines;
+ Vector<Color> line_colors;
+ CommandPolyLine() {
+ type = TYPE_POLYLINE;
+ antialiased = false;
+ }
+ };
struct CommandRect : public Command {
Rect2 rect;
RID texture;
+ RID normal_map;
Color modulate;
Rect2 source;
uint8_t flags;
@@ -634,6 +676,7 @@ public:
Rect2 rect;
Rect2 source;
RID texture;
+ RID normal_map;
float margin[4];
bool draw_center;
Color color;
@@ -651,6 +694,7 @@ public:
Vector<Point2> uvs;
Vector<Color> colors;
RID texture;
+ RID normal_map;
float width;
CommandPrimitive() {
@@ -666,6 +710,7 @@ public:
Vector<Point2> uvs;
Vector<Color> colors;
RID texture;
+ RID normal_map;
int count;
CommandPolygon() {
@@ -688,6 +733,16 @@ public:
CommandMultiMesh() { type = TYPE_MULTIMESH; }
};
+ struct CommandParticles : public Command {
+
+ RID particles;
+ RID texture;
+ RID normal_map;
+ int h_frames;
+ int v_frames;
+ CommandParticles() { type = TYPE_PARTICLES; }
+ };
+
struct CommandCircle : public Command {
Point2 pos;
@@ -776,9 +831,34 @@ public:
case Item::Command::TYPE_LINE: {
const Item::CommandLine *line = static_cast<const Item::CommandLine *>(c);
- r.pos = line->from;
+ r.position = line->from;
r.expand_to(line->to);
} break;
+ case Item::Command::TYPE_POLYLINE: {
+
+ const Item::CommandPolyLine *pline = static_cast<const Item::CommandPolyLine *>(c);
+ if (pline->triangles.size()) {
+ for (int j = 0; j < pline->triangles.size(); j++) {
+
+ if (j == 0) {
+ r.position = pline->triangles[j];
+ } else {
+ r.expand_to(pline->triangles[j]);
+ }
+ }
+ } else {
+
+ for (int j = 0; j < pline->lines.size(); j++) {
+
+ if (j == 0) {
+ r.position = pline->lines[j];
+ } else {
+ r.expand_to(pline->lines[j]);
+ }
+ }
+ }
+
+ } break;
case Item::Command::TYPE_RECT: {
const Item::CommandRect *crect = static_cast<const Item::CommandRect *>(c);
@@ -793,7 +873,7 @@ public:
case Item::Command::TYPE_PRIMITIVE: {
const Item::CommandPrimitive *primitive = static_cast<const Item::CommandPrimitive *>(c);
- r.pos = primitive->points[0];
+ r.position = primitive->points[0];
for (int i = 1; i < primitive->points.size(); i++) {
r.expand_to(primitive->points[i]);
@@ -804,7 +884,7 @@ public:
const Item::CommandPolygon *polygon = static_cast<const Item::CommandPolygon *>(c);
int l = polygon->points.size();
const Point2 *pp = &polygon->points[0];
- r.pos = pp[0];
+ r.position = pp[0];
for (int i = 1; i < l; i++) {
r.expand_to(pp[i]);
@@ -813,23 +893,32 @@ public:
case Item::Command::TYPE_MESH: {
const Item::CommandMesh *mesh = static_cast<const Item::CommandMesh *>(c);
- Rect3 aabb = RasterizerStorage::base_signleton->mesh_get_aabb(mesh->mesh, mesh->skeleton);
+ Rect3 aabb = RasterizerStorage::base_singleton->mesh_get_aabb(mesh->mesh, mesh->skeleton);
- r = Rect2(aabb.pos.x, aabb.pos.y, aabb.size.x, aabb.size.y);
+ r = Rect2(aabb.position.x, aabb.position.y, aabb.size.x, aabb.size.y);
} break;
case Item::Command::TYPE_MULTIMESH: {
const Item::CommandMultiMesh *multimesh = static_cast<const Item::CommandMultiMesh *>(c);
- Rect3 aabb = RasterizerStorage::base_signleton->multimesh_get_aabb(multimesh->multimesh);
+ Rect3 aabb = RasterizerStorage::base_singleton->multimesh_get_aabb(multimesh->multimesh);
+
+ r = Rect2(aabb.position.x, aabb.position.y, aabb.size.x, aabb.size.y);
+
+ } break;
+ case Item::Command::TYPE_PARTICLES: {
- r = Rect2(aabb.pos.x, aabb.pos.y, aabb.size.x, aabb.size.y);
+ const Item::CommandParticles *particles_cmd = static_cast<const Item::CommandParticles *>(c);
+ if (particles_cmd->particles.is_valid()) {
+ Rect3 aabb = RasterizerStorage::base_singleton->particles_get_aabb(particles_cmd->particles);
+ r = Rect2(aabb.position.x, aabb.position.y, aabb.size.x, aabb.size.y);
+ }
} break;
case Item::Command::TYPE_CIRCLE: {
const Item::CommandCircle *circle = static_cast<const Item::CommandCircle *>(c);
- r.pos = Point2(-circle->radius, -circle->radius) + circle->pos;
+ r.position = Point2(-circle->radius, -circle->radius) + circle->pos;
r.size = Point2(circle->radius * 2.0, circle->radius * 2.0);
} break;
case Item::Command::TYPE_TRANSFORM: {
@@ -894,6 +983,7 @@ public:
};
virtual void canvas_begin() = 0;
+ virtual void canvas_end() = 0;
virtual void canvas_render_items(Item *p_item_list, int p_z, const Color &p_modulate, Light *p_light) = 0;
virtual void canvas_debug_viewport_shadows(Light *p_lights_with_shadow) = 0;
@@ -924,6 +1014,8 @@ public:
virtual void reset_canvas() = 0;
+ virtual void draw_window_margins(int *p_margins, RID *p_margin_textures) = 0;
+
virtual ~RasterizerCanvas() {}
};
@@ -938,6 +1030,8 @@ public:
virtual RasterizerCanvas *get_canvas() = 0;
virtual RasterizerScene *get_scene() = 0;
+ virtual void set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale) = 0;
+
virtual void initialize() = 0;
virtual void begin_frame() = 0;
virtual void set_current_render_target(RID p_render_target) = 0;
@@ -971,7 +1065,7 @@ protected:
/* Fixed Material Shader API */
- union FixedSpatialMaterialShaderKey {
+ union SpatialMaterialShaderKey {
struct {
uint16_t texcoord_mask;
@@ -987,21 +1081,21 @@ protected:
uint32_t key;
- _FORCE_INLINE_ bool operator<(const FixedSpatialMaterialShaderKey& p_key) const { return key<p_key.key; }
+ _FORCE_INLINE_ bool operator<(const SpatialMaterialShaderKey& p_key) const { return key<p_key.key; }
};
- struct FixedSpatialMaterialShader {
+ struct SpatialMaterialShader {
int refcount;
RID shader;
};
- Map<FixedSpatialMaterialShaderKey,FixedSpatialMaterialShader> fixed_material_shaders;
+ Map<SpatialMaterialShaderKey,SpatialMaterialShader> fixed_material_shaders;
- RID _create_shader(const FixedSpatialMaterialShaderKey& p_key);
- void _free_shader(const FixedSpatialMaterialShaderKey& p_key);
+ RID _create_shader(const SpatialMaterialShaderKey& p_key);
+ void _free_shader(const SpatialMaterialShaderKey& p_key);
- struct FixedSpatialMaterial {
+ struct SpatialMaterial {
RID self;
@@ -1012,19 +1106,19 @@ protected:
bool use_xy_normalmap;
float point_size;
Transform uv_xform;
- VS::FixedSpatialMaterialLightShader light_shader;
+ VS::SpatialMaterialLightShader light_shader;
RID texture[VS::FIXED_MATERIAL_PARAM_MAX];
Variant param[VS::FIXED_MATERIAL_PARAM_MAX];
- VS::FixedSpatialMaterialTexCoordMode texture_tc[VS::FIXED_MATERIAL_PARAM_MAX];
+ VS::SpatialMaterialTexCoordMode texture_tc[VS::FIXED_MATERIAL_PARAM_MAX];
- SelfList<FixedSpatialMaterial> dirty_list;
+ SelfList<SpatialMaterial> dirty_list;
- FixedSpatialMaterialShaderKey current_key;
+ SpatialMaterialShaderKey current_key;
- _FORCE_INLINE_ FixedSpatialMaterialShaderKey get_key() const {
+ _FORCE_INLINE_ SpatialMaterialShaderKey get_key() const {
- FixedSpatialMaterialShaderKey k;
+ SpatialMaterialShaderKey k;
k.key=0;
k.use_alpha=use_alpha;
k.use_color_array=use_color_array;
@@ -1045,7 +1139,7 @@ protected:
}
- FixedSpatialMaterial() : dirty_list(this) {
+ SpatialMaterial() : dirty_list(this) {
use_alpha=false;
use_color_array=false;
@@ -1077,9 +1171,9 @@ protected:
StringName _fixed_material_uv_xform_name;
StringName _fixed_material_point_size_name;
- Map<RID,FixedSpatialMaterial*> fixed_materials;
+ Map<RID,SpatialMaterial*> fixed_materials;
- SelfList<FixedSpatialMaterial>::List fixed_material_dirty_list;
+ SelfList<SpatialMaterial>::List fixed_material_dirty_list;
protected:
void _update_fixed_materials();
@@ -1166,23 +1260,23 @@ public:
virtual RID fixed_material_create();
- virtual void fixed_material_set_flag(RID p_material, VS::FixedSpatialMaterialFlags p_flag, bool p_enabled);
- virtual bool fixed_material_get_flag(RID p_material, VS::FixedSpatialMaterialFlags p_flag) const;
+ virtual void fixed_material_set_flag(RID p_material, VS::SpatialMaterialFlags p_flag, bool p_enabled);
+ virtual bool fixed_material_get_flag(RID p_material, VS::SpatialMaterialFlags p_flag) const;
- virtual void fixed_material_set_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter, const Variant& p_value);
- virtual Variant fixed_material_get_parameter(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const;
+ virtual void fixed_material_set_parameter(RID p_material, VS::SpatialMaterialParam p_parameter, const Variant& p_value);
+ virtual Variant fixed_material_get_parameter(RID p_material,VS::SpatialMaterialParam p_parameter) const;
- virtual void fixed_material_set_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter, RID p_texture);
- virtual RID fixed_material_get_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const;
+ virtual void fixed_material_set_texture(RID p_material,VS::SpatialMaterialParam p_parameter, RID p_texture);
+ virtual RID fixed_material_get_texture(RID p_material,VS::SpatialMaterialParam p_parameter) const;
- virtual void fixed_material_set_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter, VS::FixedSpatialMaterialTexCoordMode p_mode);
- virtual VS::FixedSpatialMaterialTexCoordMode fixed_material_get_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const;
+ virtual void fixed_material_set_texcoord_mode(RID p_material,VS::SpatialMaterialParam p_parameter, VS::SpatialMaterialTexCoordMode p_mode);
+ virtual VS::SpatialMaterialTexCoordMode fixed_material_get_texcoord_mode(RID p_material,VS::SpatialMaterialParam p_parameter) const;
virtual void fixed_material_set_uv_transform(RID p_material,const Transform& p_transform);
virtual Transform fixed_material_get_uv_transform(RID p_material) const;
- virtual void fixed_material_set_light_shader(RID p_material,VS::FixedSpatialMaterialLightShader p_shader);
- virtual VS::FixedSpatialMaterialLightShader fixed_material_get_light_shader(RID p_material) const;
+ virtual void fixed_material_set_light_shader(RID p_material,VS::SpatialMaterialLightShader p_shader);
+ virtual VS::SpatialMaterialLightShader fixed_material_get_light_shader(RID p_material) const;
virtual void fixed_material_set_point_size(RID p_material,float p_size);
virtual float fixed_material_get_point_size(RID p_material) const;
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index bc4452d5a8..49f9e161fa 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -81,7 +82,8 @@ String ShaderLanguage::get_operator_text(Operator p_op) {
"++"
"--",
"()",
- "construct" };
+ "construct",
+ "index" };
return op_names[p_op];
}
@@ -176,6 +178,9 @@ const char *ShaderLanguage::token_names[TK_MAX] = {
"PERIOD",
"UNIFORM",
"VARYING",
+ "IN",
+ "OUT",
+ "INOUT",
"RENDER_MODE",
"HINT_WHITE_TEXTURE",
"HINT_BLACK_TEXTURE",
@@ -185,6 +190,7 @@ const char *ShaderLanguage::token_names[TK_MAX] = {
"HINT_BLACK_ALBEDO_TEXTURE",
"HINT_COLOR",
"HINT_RANGE",
+ "SHADER_TYPE",
"CURSOR",
"ERROR",
"EOF",
@@ -258,6 +264,9 @@ const ShaderLanguage::KeyWord ShaderLanguage::keyword_list[] = {
{ TK_CF_RETURN, "return" },
{ TK_UNIFORM, "uniform" },
{ TK_VARYING, "varying" },
+ { TK_ARG_IN, "in" },
+ { TK_ARG_OUT, "out" },
+ { TK_ARG_INOUT, "inout" },
{ TK_RENDER_MODE, "render_mode" },
{ TK_HINT_WHITE_TEXTURE, "hint_white" },
{ TK_HINT_BLACK_TEXTURE, "hint_black" },
@@ -267,6 +276,7 @@ const ShaderLanguage::KeyWord ShaderLanguage::keyword_list[] = {
{ TK_HINT_BLACK_ALBEDO_TEXTURE, "hint_black_albedo" },
{ TK_HINT_COLOR, "hint_color" },
{ TK_HINT_RANGE, "hint_range" },
+ { TK_SHADER_TYPE, "shader_type" },
{ TK_ERROR, NULL }
};
@@ -368,7 +378,7 @@ ShaderLanguage::Token ShaderLanguage::_get_token() {
if (GETCHAR(0) == '=') {
char_idx++;
return _make_token(TK_OP_GREATER_EQUAL);
- } else if (GETCHAR(0) == '<') {
+ } else if (GETCHAR(0) == '>') {
char_idx++;
if (GETCHAR(0) == '=') {
char_idx++;
@@ -871,7 +881,7 @@ bool ShaderLanguage::_validate_operator(OperatorNode *p_op, DataType *r_ret_type
}
if (na == nb) {
- valid = (na > TYPE_BOOL && na < TYPE_MAT2) || (p_op->op == OP_MUL && na >= TYPE_MAT2 && na <= TYPE_MAT4);
+ valid = (na > TYPE_BOOL && na <= TYPE_MAT4);
ret_type = na;
} else if (na == TYPE_INT && nb == TYPE_IVEC2) {
valid = true;
@@ -900,15 +910,24 @@ bool ShaderLanguage::_validate_operator(OperatorNode *p_op, DataType *r_ret_type
} else if (na == TYPE_FLOAT && nb == TYPE_VEC4) {
valid = true;
ret_type = TYPE_VEC4;
- } else if (p_op->op == OP_MUL && na == TYPE_VEC2 && nb == TYPE_MAT2) {
+ } else if (p_op->op == OP_MUL && na == TYPE_FLOAT && nb == TYPE_MAT2) {
valid = true;
ret_type = TYPE_MAT2;
- } else if (p_op->op == OP_MUL && na == TYPE_VEC3 && nb == TYPE_MAT3) {
+ } else if (p_op->op == OP_MUL && na == TYPE_FLOAT && nb == TYPE_MAT3) {
valid = true;
ret_type = TYPE_MAT3;
- } else if (p_op->op == OP_MUL && na == TYPE_VEC4 && nb == TYPE_MAT4) {
+ } else if (p_op->op == OP_MUL && na == TYPE_FLOAT && nb == TYPE_MAT4) {
valid = true;
ret_type = TYPE_MAT4;
+ } else if (p_op->op == OP_MUL && na == TYPE_VEC2 && nb == TYPE_MAT2) {
+ valid = true;
+ ret_type = TYPE_VEC2;
+ } else if (p_op->op == OP_MUL && na == TYPE_VEC3 && nb == TYPE_MAT3) {
+ valid = true;
+ ret_type = TYPE_VEC3;
+ } else if (p_op->op == OP_MUL && na == TYPE_VEC4 && nb == TYPE_MAT4) {
+ valid = true;
+ ret_type = TYPE_VEC4;
}
} break;
case OP_ASSIGN_MOD:
@@ -977,14 +996,6 @@ bool ShaderLanguage::_validate_operator(OperatorNode *p_op, DataType *r_ret_type
DataType na = p_op->arguments[0]->get_datatype();
DataType nb = p_op->arguments[1]->get_datatype();
- if (na >= TYPE_UINT && na <= TYPE_UVEC4) {
- na = DataType(na - 4);
- }
-
- if (nb >= TYPE_UINT && nb <= TYPE_UVEC4) {
- nb = DataType(nb - 4);
- }
-
if (na == TYPE_INT && nb == TYPE_INT) {
valid = true;
ret_type = TYPE_INT;
@@ -1006,6 +1017,27 @@ bool ShaderLanguage::_validate_operator(OperatorNode *p_op, DataType *r_ret_type
} else if (na == TYPE_IVEC4 && nb == TYPE_IVEC4) {
valid = true;
ret_type = TYPE_IVEC4;
+ } else if (na == TYPE_UINT && nb == TYPE_UINT) {
+ valid = true;
+ ret_type = TYPE_UINT;
+ } else if (na == TYPE_UVEC2 && nb == TYPE_UINT) {
+ valid = true;
+ ret_type = TYPE_UVEC2;
+ } else if (na == TYPE_UVEC3 && nb == TYPE_UINT) {
+ valid = true;
+ ret_type = TYPE_UVEC3;
+ } else if (na == TYPE_UVEC4 && nb == TYPE_UINT) {
+ valid = true;
+ ret_type = TYPE_UVEC4;
+ } else if (na == TYPE_UVEC2 && nb == TYPE_UVEC2) {
+ valid = true;
+ ret_type = TYPE_UVEC2;
+ } else if (na == TYPE_UVEC3 && nb == TYPE_UVEC3) {
+ valid = true;
+ ret_type = TYPE_UVEC3;
+ } else if (na == TYPE_UVEC4 && nb == TYPE_UVEC4) {
+ valid = true;
+ ret_type = TYPE_UVEC4;
}
} break;
case OP_ASSIGN: {
@@ -1325,11 +1357,8 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = {
{ "tanh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } },
//builtins - exponential
{ "pow", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } },
- { "pow", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } },
{ "pow", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } },
- { "pow", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } },
{ "pow", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } },
- { "pow", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } },
{ "pow", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } },
{ "exp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } },
{ "exp", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } },
@@ -1651,25 +1680,19 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = {
{ "not", TYPE_BOOL, { TYPE_BVEC4, TYPE_VOID } },
//builtins - texture
- { "textureSize", TYPE_VEC2, { TYPE_SAMPLER2D, TYPE_INT, TYPE_VOID } },
- { "textureSize", TYPE_VEC2, { TYPE_ISAMPLER2D, TYPE_INT, TYPE_VOID } },
- { "textureSize", TYPE_VEC2, { TYPE_USAMPLER2D, TYPE_INT, TYPE_VOID } },
- { "textureSize", TYPE_VEC2, { TYPE_SAMPLERCUBE, TYPE_INT, TYPE_VOID } },
+ { "textureSize", TYPE_IVEC2, { TYPE_SAMPLER2D, TYPE_INT, TYPE_VOID } },
+ { "textureSize", TYPE_IVEC2, { TYPE_ISAMPLER2D, TYPE_INT, TYPE_VOID } },
+ { "textureSize", TYPE_IVEC2, { TYPE_USAMPLER2D, TYPE_INT, TYPE_VOID } },
+ { "textureSize", TYPE_IVEC2, { TYPE_SAMPLERCUBE, TYPE_INT, TYPE_VOID } },
{ "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_VOID } },
- { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_VOID } },
{ "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } },
- { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } },
{ "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_VOID } },
- { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_VOID } },
{ "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } },
- { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } },
{ "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_VOID } },
- { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_VOID } },
{ "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } },
- { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } },
{ "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VOID } },
{ "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } },
@@ -1689,9 +1712,9 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = {
{ "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } },
{ "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } },
- { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } },
- { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } },
- { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } },
+ { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } },
+ { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } },
+ { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } },
{ "textureLod", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } },
{ "texelFetch", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID } },
@@ -2308,9 +2331,17 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
bool ok = _parse_function_arguments(p_block, p_builtin_types, func, &carg);
+ //test if function was parsed first
for (int i = 0; i < shader->functions.size(); i++) {
if (shader->functions[i].name == name) {
- shader->functions[i].uses_function.insert(name);
+ //add to current function as dependency
+ for (int j = 0; j < shader->functions.size(); j++) {
+ if (shader->functions[j].name == current_function) {
+ shader->functions[j].uses_function.insert(name);
+ break;
+ }
+ }
+ break;
}
}
@@ -2514,24 +2545,15 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
}
} break;
- case TYPE_MAT2:
- ok = (ident == "x" || ident == "y");
- member_type = TYPE_VEC2;
- break;
- case TYPE_MAT3:
- ok = (ident == "x" || ident == "y" || ident == "z");
- member_type = TYPE_VEC3;
- break;
- case TYPE_MAT4:
- ok = (ident == "x" || ident == "y" || ident == "z" || ident == "w");
- member_type = TYPE_VEC4;
- break;
- default: {}
+
+ default: {
+ ok = false;
+ }
}
if (!ok) {
- _set_error("Invalid member for expression: ." + ident);
+ _set_error("Invalid member for " + get_datatype_name(dt) + " expression: ." + ident);
return NULL;
}
@@ -2552,6 +2574,116 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
//creates a subindexing expression in place
*/
+ } else if (tk.type == TK_BRACKET_OPEN) {
+
+ Node *index = _parse_and_reduce_expression(p_block, p_builtin_types);
+
+ if (index->get_datatype() != TYPE_INT && index->get_datatype() != TYPE_UINT) {
+ _set_error("Only integer datatypes are allowed for indexing");
+ return NULL;
+ }
+
+ bool index_valid = false;
+ DataType member_type;
+
+ switch (expr->get_datatype()) {
+ case TYPE_BVEC2:
+ case TYPE_VEC2:
+ case TYPE_IVEC2:
+ case TYPE_UVEC2:
+ case TYPE_MAT2:
+ if (index->type == Node::TYPE_CONSTANT) {
+ uint32_t index_constant = static_cast<ConstantNode *>(index)->values[0].uint;
+ if (index_constant >= 2) {
+ _set_error("Index out of range (0-1)");
+ return NULL;
+ }
+ } else {
+ _set_error("Only integer constants are allowed as index at the moment");
+ return NULL;
+ }
+ index_valid = true;
+ switch (expr->get_datatype()) {
+ case TYPE_BVEC2: member_type = TYPE_BOOL; break;
+ case TYPE_VEC2: member_type = TYPE_FLOAT; break;
+ case TYPE_IVEC2: member_type = TYPE_INT; break;
+ case TYPE_UVEC2: member_type = TYPE_UINT; break;
+ case TYPE_MAT2: member_type = TYPE_VEC2; break;
+ }
+
+ break;
+ case TYPE_BVEC3:
+ case TYPE_VEC3:
+ case TYPE_IVEC3:
+ case TYPE_UVEC3:
+ case TYPE_MAT3:
+ if (index->type == Node::TYPE_CONSTANT) {
+ uint32_t index_constant = static_cast<ConstantNode *>(index)->values[0].uint;
+ if (index_constant >= 3) {
+ _set_error("Index out of range (0-2)");
+ return NULL;
+ }
+ } else {
+ _set_error("Only integer constants are allowed as index at the moment");
+ return NULL;
+ }
+ index_valid = true;
+ switch (expr->get_datatype()) {
+ case TYPE_BVEC3: member_type = TYPE_BOOL; break;
+ case TYPE_VEC3: member_type = TYPE_FLOAT; break;
+ case TYPE_IVEC3: member_type = TYPE_INT; break;
+ case TYPE_UVEC3: member_type = TYPE_UINT; break;
+ case TYPE_MAT3: member_type = TYPE_VEC3; break;
+ }
+ break;
+ case TYPE_BVEC4:
+ case TYPE_VEC4:
+ case TYPE_IVEC4:
+ case TYPE_UVEC4:
+ case TYPE_MAT4:
+ if (index->type == Node::TYPE_CONSTANT) {
+ uint32_t index_constant = static_cast<ConstantNode *>(index)->values[0].uint;
+ if (index_constant >= 4) {
+ _set_error("Index out of range (0-3)");
+ return NULL;
+ }
+ } else {
+ _set_error("Only integer constants are allowed as index at the moment");
+ return NULL;
+ }
+ index_valid = true;
+ switch (expr->get_datatype()) {
+ case TYPE_BVEC4: member_type = TYPE_BOOL; break;
+ case TYPE_VEC4: member_type = TYPE_FLOAT; break;
+ case TYPE_IVEC4: member_type = TYPE_INT; break;
+ case TYPE_UVEC4: member_type = TYPE_UINT; break;
+ case TYPE_MAT4: member_type = TYPE_VEC4; break;
+ }
+ break;
+ default: {
+ _set_error("Object of type '" + get_datatype_name(expr->get_datatype()) + "' can't be indexed");
+ return NULL;
+ }
+ }
+
+ if (!index_valid) {
+ _set_error("Invalid index");
+ return NULL;
+ }
+
+ OperatorNode *op = alloc_node<OperatorNode>();
+ op->op = OP_INDEX;
+ op->return_cache = member_type;
+ op->arguments.push_back(expr);
+ op->arguments.push_back(index);
+ expr = op;
+
+ tk = _get_token();
+ if (tk.type != TK_BRACKET_CLOSE) {
+ _set_error("Expected ']' after indexing expression");
+ return NULL;
+ }
+
} else if (tk.type == TK_OP_INCREMENT || tk.type == TK_OP_DECREMENT) {
OperatorNode *op = alloc_node<OperatorNode>();
@@ -3052,7 +3184,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
tk = _get_token();
if (tk.type != TK_PARENTHESIS_CLOSE) {
- _set_error("Expected '(' after expression");
+ _set_error("Expected ')' after expression");
return ERR_PARSE_ERROR;
}
@@ -3063,6 +3195,8 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
p_block->statements.push_back(cf);
Error err = _parse_block(block, p_builtin_types, true, p_can_break, p_can_continue);
+ if (err)
+ return err;
pos = _get_tkpos();
tk = _get_token();
@@ -3076,6 +3210,81 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
} else {
_set_tkpos(pos); //rollback
}
+ } else if (tk.type == TK_CF_WHILE) {
+ //if () {}
+ tk = _get_token();
+ if (tk.type != TK_PARENTHESIS_OPEN) {
+ _set_error("Expected '(' after if");
+ return ERR_PARSE_ERROR;
+ }
+
+ ControlFlowNode *cf = alloc_node<ControlFlowNode>();
+ cf->flow_op = FLOW_OP_WHILE;
+ Node *n = _parse_and_reduce_expression(p_block, p_builtin_types);
+ if (!n)
+ return ERR_PARSE_ERROR;
+
+ tk = _get_token();
+ if (tk.type != TK_PARENTHESIS_CLOSE) {
+ _set_error("Expected ')' after expression");
+ return ERR_PARSE_ERROR;
+ }
+
+ BlockNode *block = alloc_node<BlockNode>();
+ block->parent_block = p_block;
+ cf->expressions.push_back(n);
+ cf->blocks.push_back(block);
+ p_block->statements.push_back(cf);
+
+ Error err = _parse_block(block, p_builtin_types, true, p_can_break, p_can_continue);
+ if (err)
+ return err;
+
+ } else if (tk.type == TK_CF_RETURN) {
+
+ //check return type
+ BlockNode *b = p_block;
+ while (b && !b->parent_function) {
+ b = b->parent_block;
+ }
+
+ if (!b) {
+ _set_error("Bug");
+ return ERR_BUG;
+ }
+
+ ControlFlowNode *flow = alloc_node<ControlFlowNode>();
+ flow->flow_op = FLOW_OP_RETURN;
+
+ pos = _get_tkpos();
+ tk = _get_token();
+ if (tk.type == TK_SEMICOLON) {
+ //all is good
+ if (b->parent_function->return_type != TYPE_VOID) {
+ _set_error("Expected return with expression of type '" + get_datatype_name(b->parent_function->return_type) + "'");
+ return ERR_PARSE_ERROR;
+ }
+ } else {
+ _set_tkpos(pos); //rollback, wants expression
+ Node *expr = _parse_and_reduce_expression(p_block, p_builtin_types);
+ if (!expr)
+ return ERR_PARSE_ERROR;
+
+ if (b->parent_function->return_type != expr->get_datatype()) {
+ _set_error("Expected return expression of type '" + get_datatype_name(b->parent_function->return_type) + "'");
+ return ERR_PARSE_ERROR;
+ }
+
+ tk = _get_token();
+ if (tk.type != TK_SEMICOLON) {
+ _set_error("Expected ';' after return expression");
+ return ERR_PARSE_ERROR;
+ }
+
+ flow->expressions.push_back(expr);
+ }
+
+ p_block->statements.push_back(flow);
} else {
@@ -3100,10 +3309,47 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
return OK;
}
-Error ShaderLanguage::_parse_shader(const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes) {
+Error ShaderLanguage::_parse_shader(const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes, const Set<String> &p_shader_types) {
Token tk = _get_token();
+ if (tk.type != TK_SHADER_TYPE) {
+ _set_error("Expected 'shader_type' at the begining of shader.");
+ return ERR_PARSE_ERROR;
+ }
+
+ tk = _get_token();
+
+ if (tk.type != TK_IDENTIFIER) {
+ _set_error("Expected identifier after 'shader_type', indicating type of shader.");
+ return ERR_PARSE_ERROR;
+ }
+
+ String shader_type_identifier;
+
+ shader_type_identifier = tk.text;
+
+ if (!p_shader_types.has(shader_type_identifier)) {
+
+ String valid;
+ for (Set<String>::Element *E = p_shader_types.front(); E; E = E->next()) {
+ if (valid != String()) {
+ valid += ", ";
+ }
+ valid += "'" + E->get() + "'";
+ }
+ _set_error("Invalid shader type, valid types are: " + valid);
+ return ERR_PARSE_ERROR;
+ }
+
+ tk = _get_token();
+
+ if (tk.type != TK_SEMICOLON) {
+ _set_error("Expected ';' after 'shader_type <type>'.");
+ }
+
+ tk = _get_token();
+
int texture_uniforms = 0;
int uniforms = 0;
@@ -3428,6 +3674,19 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, Map<StringName, DataTy
break;
}
+ ArgumentQualifier qualifier = ARGUMENT_QUALIFIER_IN;
+
+ if (tk.type == TK_ARG_IN) {
+ qualifier = ARGUMENT_QUALIFIER_IN;
+ tk = _get_token();
+ } else if (tk.type == TK_ARG_OUT) {
+ qualifier = ARGUMENT_QUALIFIER_OUT;
+ tk = _get_token();
+ } else if (tk.type == TK_ARG_INOUT) {
+ qualifier = ARGUMENT_QUALIFIER_INOUT;
+ tk = _get_token();
+ }
+
DataType ptype;
StringName pname;
DataPrecision pprecision = PRECISION_DEFAULT;
@@ -3466,6 +3725,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, Map<StringName, DataTy
arg.type = ptype;
arg.name = pname;
arg.precision = pprecision;
+ arg.qualifier = qualifier;
func_node->arguments.push_back(arg);
@@ -3515,7 +3775,42 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, Map<StringName, DataTy
return OK;
}
-Error ShaderLanguage::compile(const String &p_code, const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes) {
+String ShaderLanguage::get_shader_type(const String &p_code) {
+
+ bool reading_type = false;
+
+ String cur_identifier;
+
+ for (int i = 0; i < p_code.length(); i++) {
+
+ if (p_code[i] == ';') {
+ break;
+
+ } else if (p_code[i] <= 32) {
+ if (cur_identifier != String()) {
+ if (!reading_type) {
+ if (cur_identifier != "shader_type") {
+ return String();
+ }
+
+ reading_type = true;
+ cur_identifier = String();
+ } else {
+ return cur_identifier;
+ }
+ }
+ } else {
+ cur_identifier += String::chr(p_code[i]);
+ }
+ }
+
+ if (reading_type)
+ return cur_identifier;
+
+ return String();
+}
+
+Error ShaderLanguage::compile(const String &p_code, const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes, const Set<String> &p_shader_types) {
clear();
@@ -3524,7 +3819,7 @@ Error ShaderLanguage::compile(const String &p_code, const Map<StringName, Map<St
nodes = NULL;
shader = alloc_node<ShaderNode>();
- Error err = _parse_shader(p_functions, p_render_modes);
+ Error err = _parse_shader(p_functions, p_render_modes, p_shader_types);
if (err != OK) {
return err;
@@ -3532,7 +3827,7 @@ Error ShaderLanguage::compile(const String &p_code, const Map<StringName, Map<St
return OK;
}
-Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes, List<String> *r_options, String &r_call_hint) {
+Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes, const Set<String> &p_shader_types, List<String> *r_options, String &r_call_hint) {
clear();
@@ -3541,7 +3836,7 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Map<S
nodes = NULL;
shader = alloc_node<ShaderNode>();
- Error err = _parse_shader(p_functions, p_render_modes);
+ Error err = _parse_shader(p_functions, p_render_modes, p_shader_types);
switch (completion_type) {
diff --git a/servers/visual/shader_language.h b/servers/visual/shader_language.h
index a4757e3419..c92cbf2abb 100644
--- a/servers/visual/shader_language.h
+++ b/servers/visual/shader_language.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -130,6 +131,9 @@ public:
TK_PERIOD,
TK_UNIFORM,
TK_VARYING,
+ TK_ARG_IN,
+ TK_ARG_OUT,
+ TK_ARG_INOUT,
TK_RENDER_MODE,
TK_HINT_WHITE_TEXTURE,
TK_HINT_BLACK_TEXTURE,
@@ -139,6 +143,7 @@ public:
TK_HINT_BLACK_ALBEDO_TEXTURE,
TK_HINT_COLOR,
TK_HINT_RANGE,
+ TK_SHADER_TYPE,
TK_CURSOR,
TK_ERROR,
TK_EOF,
@@ -227,6 +232,7 @@ public:
OP_POST_DECREMENT,
OP_CALL,
OP_CONSTRUCT,
+ OP_INDEX,
OP_MAX
};
@@ -242,6 +248,13 @@ public:
};
+ enum ArgumentQualifier {
+ ARGUMENT_QUALIFIER_IN,
+ ARGUMENT_QUALIFIER_OUT,
+ ARGUMENT_QUALIFIER_INOUT,
+
+ };
+
struct Node {
Node *next;
@@ -363,6 +376,7 @@ public:
struct Argument {
+ ArgumentQualifier qualifier;
StringName name;
DataType type;
DataPrecision precision;
@@ -577,14 +591,16 @@ private:
Error _parse_block(BlockNode *p_block, const Map<StringName, DataType> &p_builtin_types, bool p_just_one = false, bool p_can_break = false, bool p_can_continue = false);
- Error _parse_shader(const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes);
+ Error _parse_shader(const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes, const Set<String> &p_shader_types);
public:
//static void get_keyword_list(ShaderType p_type,List<String> *p_keywords);
void clear();
- Error compile(const String &p_code, const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes);
- Error complete(const String &p_code, const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes, List<String> *r_options, String &r_call_hint);
+
+ static String get_shader_type(const String &p_code);
+ Error compile(const String &p_code, const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes, const Set<String> &p_shader_types);
+ Error complete(const String &p_code, const Map<StringName, Map<StringName, DataType> > &p_functions, const Set<String> &p_render_modes, const Set<String> &p_shader_types, List<String> *r_options, String &r_call_hint);
String get_error_text();
int get_error_line();
diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp
index c5e31b235a..3f1403d532 100644
--- a/servers/visual/shader_types.cpp
+++ b/servers/visual/shader_types.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,6 +39,10 @@ const Set<String> &ShaderTypes::get_modes(VS::ShaderMode p_mode) {
return shader_modes[p_mode].modes;
}
+const Set<String> &ShaderTypes::get_types() {
+ return shader_types;
+}
+
ShaderTypes *ShaderTypes::singleton = NULL;
ShaderTypes::ShaderTypes() {
@@ -47,7 +52,6 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["SRC_VERTEX"] = ShaderLanguage::TYPE_VEC3;
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["SRC_NORMAL"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["SRC_TANGENT"] = ShaderLanguage::TYPE_VEC4;
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["SRC_BONES"] = ShaderLanguage::TYPE_IVEC4;
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["SRC_WEIGHTS"] = ShaderLanguage::TYPE_VEC4;
@@ -61,11 +65,15 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["COLOR"] = ShaderLanguage::TYPE_VEC4;
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["POINT_SIZE"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["INSTANCE_ID"] = ShaderLanguage::TYPE_INT;
+ shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["INSTANCE_CUSTOM"] = ShaderLanguage::TYPE_VEC4;
+ shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["ROUGHNESS"] = ShaderLanguage::TYPE_FLOAT;
//builtins
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["WORLD_MATRIX"] = ShaderLanguage::TYPE_MAT4;
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["INV_CAMERA_MATRIX"] = ShaderLanguage::TYPE_MAT4;
+ shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["CAMERA_MATRIX"] = ShaderLanguage::TYPE_MAT4;
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["PROJECTION_MATRIX"] = ShaderLanguage::TYPE_MAT4;
+ shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["MODELVIEW_MATRIX"] = ShaderLanguage::TYPE_MAT4;
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["TIME"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["VIEWPORT_SIZE"] = ShaderLanguage::TYPE_VEC2;
@@ -83,7 +91,8 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["NORMAL"] = ShaderLanguage::TYPE_VEC3;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["ALBEDO"] = ShaderLanguage::TYPE_VEC3;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["ALPHA"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["SPECULAR"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["METALLIC"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["SPECULAR"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["ROUGHNESS"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["RIM"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["RIM_TINT"] = ShaderLanguage::TYPE_FLOAT;
@@ -94,10 +103,13 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["SSS_STRENGTH"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["AO"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["EMISSION"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["SPECIAL"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["DISCARD"] = ShaderLanguage::TYPE_BOOL;
+ shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["SCREEN_TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D;
+ shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["DEPTH_TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["SCREEN_UV"] = ShaderLanguage::TYPE_VEC2;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["POINT_COORD"] = ShaderLanguage::TYPE_VEC2;
+ shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["SIDE"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["ALPHA_SCISSOR"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["WORLD_MATRIX"] = ShaderLanguage::TYPE_MAT4;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["INV_CAMERA_MATRIX"] = ShaderLanguage::TYPE_MAT4;
@@ -122,7 +134,22 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_SPATIAL].modes.insert("unshaded");
shader_modes[VS::SHADER_SPATIAL].modes.insert("ontop");
- shader_modes[VS::SHADER_SPATIAL].modes.insert("skip_transform");
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_lambert");
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_half_lambert");
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_oren_nayar");
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_burley");
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_toon");
+
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_schlick_ggx");
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_blinn");
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_phong");
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_toon");
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_disabled");
+
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("skip_vertex_transform");
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("world_vertex_coords");
+
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("vertex_lighting");
/************ CANVAS ITEM **************************/
@@ -136,9 +163,11 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["PROJECTION_MATRIX"] = ShaderLanguage::TYPE_MAT4;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["EXTRA_MATRIX"] = ShaderLanguage::TYPE_MAT4;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["TIME"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["PARTICLE_CUSTOM"] = ShaderLanguage::TYPE_VEC4;
+ shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["AT_LIGHT_PASS"] = ShaderLanguage::TYPE_BOOL;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["SRC_COLOR"] = ShaderLanguage::TYPE_VEC4;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["POSITION"] = ShaderLanguage::TYPE_VEC2;
+ shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["FRAGCOORD"] = ShaderLanguage::TYPE_VEC4;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["NORMAL"] = ShaderLanguage::TYPE_VEC3;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["NORMALMAP"] = ShaderLanguage::TYPE_VEC3;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["NORMALMAP_DEPTH"] = ShaderLanguage::TYPE_FLOAT;
@@ -147,8 +176,12 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["TEXTURE_PIXEL_SIZE"] = ShaderLanguage::TYPE_VEC2;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["SCREEN_UV"] = ShaderLanguage::TYPE_VEC2;
+ shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["SCREEN_PIXEL_SIZE"] = ShaderLanguage::TYPE_VEC2;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["POINT_COORD"] = ShaderLanguage::TYPE_VEC2;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["TIME"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["AT_LIGHT_PASS"] = ShaderLanguage::TYPE_BOOL;
+ shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["SCREEN_TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D;
+ shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["SCREEN_UV"] = ShaderLanguage::TYPE_VEC2;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["POSITION"] = ShaderLanguage::TYPE_VEC2;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["NORMAL"] = ShaderLanguage::TYPE_VEC3;
@@ -156,8 +189,6 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["COLOR"] = ShaderLanguage::TYPE_VEC4;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["TEXTURE_PIXEL_SIZE"] = ShaderLanguage::TYPE_VEC2;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["VAR1"] = ShaderLanguage::TYPE_VEC4;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["VAR2"] = ShaderLanguage::TYPE_VEC4;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["SCREEN_UV"] = ShaderLanguage::TYPE_VEC2;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["LIGHT_VEC"] = ShaderLanguage::TYPE_VEC2;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["LIGHT_HEIGHT"] = ShaderLanguage::TYPE_FLOAT;
@@ -169,7 +200,7 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["POINT_COORD"] = ShaderLanguage::TYPE_VEC2;
shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["TIME"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("skip_transform");
+ shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("skip_vertex_transform");
shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("blend_mix");
shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("blend_add");
@@ -192,11 +223,17 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["TIME"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["LIFETIME"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["DELTA"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["SEED"] = ShaderLanguage::TYPE_BOOL;
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["ORIGIN"] = ShaderLanguage::TYPE_MAT4;
+ shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["NUMBER"] = ShaderLanguage::TYPE_UINT;
shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["INDEX"] = ShaderLanguage::TYPE_INT;
+ shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["EMISSION_TRANSFORM"] = ShaderLanguage::TYPE_MAT4;
+ shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["RANDOM_SEED"] = ShaderLanguage::TYPE_UINT;
shader_modes[VS::SHADER_PARTICLES].modes.insert("billboard");
shader_modes[VS::SHADER_PARTICLES].modes.insert("disable_force");
shader_modes[VS::SHADER_PARTICLES].modes.insert("disable_velocity");
+ shader_modes[VS::SHADER_PARTICLES].modes.insert("keep_data");
+
+ shader_types.insert("spatial");
+ shader_types.insert("canvas_item");
+ shader_types.insert("particles");
}
diff --git a/servers/visual/shader_types.h b/servers/visual/shader_types.h
index 1bddde8c82..b8cbabeec1 100644
--- a/servers/visual/shader_types.h
+++ b/servers/visual/shader_types.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -43,11 +44,14 @@ class ShaderTypes {
static ShaderTypes *singleton;
+ Set<String> shader_types;
+
public:
static ShaderTypes *get_singleton() { return singleton; }
const Map<StringName, Map<StringName, ShaderLanguage::DataType> > &get_functions(VS::ShaderMode p_mode);
const Set<String> &get_modes(VS::ShaderMode p_mode);
+ const Set<String> &get_types();
ShaderTypes();
};
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp
index 40fa779170..dcc16794e7 100644
--- a/servers/visual/visual_server_canvas.cpp
+++ b/servers/visual/visual_server_canvas.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -57,10 +58,16 @@ void VisualServerCanvas::_render_canvas_item(Item *p_canvas_item, const Transfor
if (!ci->visible)
return;
+ if (p_canvas_item->children_order_dirty) {
+
+ p_canvas_item->child_items.sort_custom<ItemIndexSort>();
+ p_canvas_item->children_order_dirty = false;
+ }
+
Rect2 rect = ci->get_rect();
Transform2D xform = p_transform * ci->xform;
Rect2 global_rect = xform.xform(rect);
- global_rect.pos += p_clip_rect.pos;
+ global_rect.position += p_clip_rect.position;
if (ci->use_parent_material && p_material_owner)
ci->material_owner = p_material_owner;
@@ -118,7 +125,7 @@ void VisualServerCanvas::_render_canvas_item(Item *p_canvas_item, const Transfor
ci->final_transform = xform;
ci->final_modulate = Color(modulate.r * ci->self_modulate.r, modulate.g * ci->self_modulate.g, modulate.b * ci->self_modulate.b, modulate.a * ci->self_modulate.a);
ci->global_rect_cache = global_rect;
- ci->global_rect_cache.pos -= p_clip_rect.pos;
+ ci->global_rect_cache.position -= p_clip_rect.position;
ci->light_masked = false;
int zidx = p_z - VS::CANVAS_ITEM_Z_MIN;
@@ -170,6 +177,12 @@ void VisualServerCanvas::render_canvas(Canvas *p_canvas, const Transform2D &p_tr
VSG::canvas_render->canvas_begin();
+ if (p_canvas->children_order_dirty) {
+
+ p_canvas->child_items.sort();
+ p_canvas->children_order_dirty = false;
+ }
+
int l = p_canvas->child_items.size();
Canvas::ChildItem *ci = p_canvas->child_items.ptr();
@@ -230,6 +243,8 @@ void VisualServerCanvas::render_canvas(Canvas *p_canvas, const Transform2D &p_tr
}
}
}
+
+ VSG::canvas_render->canvas_end();
}
RID VisualServerCanvas::canvas_create() {
@@ -394,6 +409,86 @@ void VisualServerCanvas::canvas_item_add_line(RID p_item, const Point2 &p_from,
canvas_item->commands.push_back(line);
}
+void VisualServerCanvas::canvas_item_add_polyline(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width, bool p_antialiased) {
+
+ ERR_FAIL_COND(p_points.size() < 2);
+ Item *canvas_item = canvas_item_owner.getornull(p_item);
+ ERR_FAIL_COND(!canvas_item);
+
+ Item::CommandPolyLine *pline = memnew(Item::CommandPolyLine);
+ ERR_FAIL_COND(!pline);
+
+ pline->antialiased = p_antialiased;
+
+ if (p_width <= 1) {
+ pline->lines = p_points;
+ pline->line_colors = p_colors;
+ if (pline->line_colors.size() == 0) {
+ pline->line_colors.push_back(Color(1, 1, 1, 1));
+ } else if (pline->line_colors.size() > 1 && pline->line_colors.size() != pline->lines.size()) {
+ pline->line_colors.resize(1);
+ }
+ } else {
+ //make a trianglestrip for drawing the line...
+ Vector2 prev_t;
+ pline->triangles.resize(p_points.size() * 2);
+ if (p_antialiased) {
+ pline->lines.resize(p_points.size() * 2);
+ }
+
+ if (p_colors.size() == 0) {
+ pline->triangle_colors.push_back(Color(1, 1, 1, 1));
+ if (p_antialiased) {
+ pline->line_colors.push_back(Color(1, 1, 1, 1));
+ }
+ }
+ if (p_colors.size() == 1) {
+ pline->triangle_colors = p_colors;
+ pline->line_colors = p_colors;
+ } else {
+ pline->triangle_colors.resize(pline->triangles.size());
+ pline->line_colors.resize(pline->lines.size());
+ }
+
+ for (int i = 0; i < p_points.size(); i++) {
+
+ Vector2 t;
+ if (i == p_points.size() - 1) {
+ t = prev_t;
+ } else {
+ t = (p_points[i + 1] - p_points[i]).normalized().tangent();
+ if (i == 0) {
+ prev_t = t;
+ }
+ }
+
+ Vector2 tangent = ((t + prev_t).normalized()) * p_width * 0.5;
+
+ if (p_antialiased) {
+ pline->lines[i] = p_points[i] + tangent;
+ pline->lines[p_points.size() * 2 - i - 1] = p_points[i] - tangent;
+ if (pline->line_colors.size() > 1) {
+ pline->line_colors[i] = p_colors[i];
+ pline->line_colors[p_points.size() * 2 - i - 1] = p_colors[i];
+ }
+ }
+
+ pline->triangles[i * 2 + 0] = p_points[i] + tangent;
+ pline->triangles[i * 2 + 1] = p_points[i] - tangent;
+
+ if (pline->triangle_colors.size() > 1) {
+
+ pline->triangle_colors[i * 2 + 0] = p_colors[i];
+ pline->triangle_colors[i * 2 + 1] = p_colors[i];
+ }
+
+ prev_t = t;
+ }
+ }
+ canvas_item->rect_dirty = true;
+ canvas_item->commands.push_back(pline);
+}
+
void VisualServerCanvas::canvas_item_add_rect(RID p_item, const Rect2 &p_rect, const Color &p_color) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
@@ -422,7 +517,7 @@ void VisualServerCanvas::canvas_item_add_circle(RID p_item, const Point2 &p_pos,
canvas_item->commands.push_back(circle);
}
-void VisualServerCanvas::canvas_item_add_texture_rect(RID p_item, const Rect2 &p_rect, RID p_texture, bool p_tile, const Color &p_modulate, bool p_transpose) {
+void VisualServerCanvas::canvas_item_add_texture_rect(RID p_item, const Rect2 &p_rect, RID p_texture, bool p_tile, const Color &p_modulate, bool p_transpose, RID p_normal_map) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -453,11 +548,12 @@ void VisualServerCanvas::canvas_item_add_texture_rect(RID p_item, const Rect2 &p
SWAP(rect->rect.size.x, rect->rect.size.y);
}
rect->texture = p_texture;
+ rect->normal_map = p_normal_map;
canvas_item->rect_dirty = true;
canvas_item->commands.push_back(rect);
}
-void VisualServerCanvas::canvas_item_add_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose) {
+void VisualServerCanvas::canvas_item_add_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, RID p_normal_map, bool p_clip_uv) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -467,6 +563,7 @@ void VisualServerCanvas::canvas_item_add_texture_rect_region(RID p_item, const R
rect->modulate = p_modulate;
rect->rect = p_rect;
rect->texture = p_texture;
+ rect->normal_map = p_normal_map;
rect->source = p_src_rect;
rect->flags = RasterizerCanvas::CANVAS_RECT_REGION;
@@ -485,12 +582,16 @@ void VisualServerCanvas::canvas_item_add_texture_rect_region(RID p_item, const R
SWAP(rect->rect.size.x, rect->rect.size.y);
}
+ if (p_clip_uv) {
+ rect->flags |= RasterizerCanvas::CANVAS_RECT_CLIP_UV;
+ }
+
canvas_item->rect_dirty = true;
canvas_item->commands.push_back(rect);
}
-void VisualServerCanvas::canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, VS::NinePatchAxisMode p_x_axis_mode, VS::NinePatchAxisMode p_y_axis_mode, bool p_draw_center, const Color &p_modulate) {
+void VisualServerCanvas::canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, VS::NinePatchAxisMode p_x_axis_mode, VS::NinePatchAxisMode p_y_axis_mode, bool p_draw_center, const Color &p_modulate, RID p_normal_map) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -498,6 +599,7 @@ void VisualServerCanvas::canvas_item_add_nine_patch(RID p_item, const Rect2 &p_r
Item::CommandNinePatch *style = memnew(Item::CommandNinePatch);
ERR_FAIL_COND(!style);
style->texture = p_texture;
+ style->normal_map = p_normal_map;
style->rect = p_rect;
style->source = p_source;
style->draw_center = p_draw_center;
@@ -512,7 +614,7 @@ void VisualServerCanvas::canvas_item_add_nine_patch(RID p_item, const Rect2 &p_r
canvas_item->commands.push_back(style);
}
-void VisualServerCanvas::canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width) {
+void VisualServerCanvas::canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width, RID p_normal_map) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -520,6 +622,7 @@ void VisualServerCanvas::canvas_item_add_primitive(RID p_item, const Vector<Poin
Item::CommandPrimitive *prim = memnew(Item::CommandPrimitive);
ERR_FAIL_COND(!prim);
prim->texture = p_texture;
+ prim->normal_map = p_normal_map;
prim->points = p_points;
prim->uvs = p_uvs;
prim->colors = p_colors;
@@ -529,7 +632,7 @@ void VisualServerCanvas::canvas_item_add_primitive(RID p_item, const Vector<Poin
canvas_item->commands.push_back(prim);
}
-void VisualServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture) {
+void VisualServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, RID p_normal_map) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -552,6 +655,7 @@ void VisualServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2
Item::CommandPolygon *polygon = memnew(Item::CommandPolygon);
ERR_FAIL_COND(!polygon);
polygon->texture = p_texture;
+ polygon->normal_map = p_normal_map;
polygon->points = p_points;
polygon->uvs = p_uvs;
polygon->colors = p_colors;
@@ -562,7 +666,7 @@ void VisualServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2
canvas_item->commands.push_back(polygon);
}
-void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, int p_count) {
+void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, int p_count, RID p_normal_map) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -590,6 +694,7 @@ void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector
Item::CommandPolygon *polygon = memnew(Item::CommandPolygon);
ERR_FAIL_COND(!polygon);
polygon->texture = p_texture;
+ polygon->normal_map = p_normal_map;
polygon->points = p_points;
polygon->uvs = p_uvs;
polygon->colors = p_colors;
@@ -624,6 +729,25 @@ void VisualServerCanvas::canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID
canvas_item->commands.push_back(m);
}
+void VisualServerCanvas::canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal, int p_h_frames, int p_v_frames) {
+
+ Item *canvas_item = canvas_item_owner.getornull(p_item);
+ ERR_FAIL_COND(!canvas_item);
+
+ Item::CommandParticles *part = memnew(Item::CommandParticles);
+ ERR_FAIL_COND(!part);
+ part->particles = p_particles;
+ part->texture = p_texture;
+ part->normal_map = p_normal;
+ part->h_frames = p_h_frames;
+ part->v_frames = p_v_frames;
+
+ //take the chance and request processing for them, at least once until they become visible again
+ VSG::storage->particles_request_process(p_particles);
+
+ canvas_item->commands.push_back(part);
+}
+
void VisualServerCanvas::canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_skeleton) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
@@ -913,6 +1037,13 @@ void VisualServerCanvas::canvas_light_set_shadow_color(RID p_light, const Color
clight->shadow_color = p_color;
}
+void VisualServerCanvas::canvas_light_set_shadow_smooth(RID p_light, float p_smooth) {
+
+ RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light);
+ ERR_FAIL_COND(!clight);
+ clight->shadow_smooth = p_smooth;
+}
+
RID VisualServerCanvas::canvas_light_occluder_create() {
RasterizerCanvas::LightOccluderInstance *occluder = memnew(RasterizerCanvas::LightOccluderInstance);
@@ -1037,7 +1168,7 @@ void VisualServerCanvas::canvas_occluder_polygon_set_shape_as_lines(RID p_occlud
PoolVector<Vector2>::Read r = p_shape.read();
for (int i = 0; i < lc; i++) {
if (i == 0)
- occluder_poly->aabb.pos = r[i];
+ occluder_poly->aabb.position = r[i];
else
occluder_poly->aabb.expand_to(r[i]);
}
diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h
index 3c2dde17d5..25d4973cb7 100644
--- a/servers/visual/visual_server_canvas.h
+++ b/servers/visual/visual_server_canvas.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -62,6 +63,14 @@ public:
}
};
+ struct ItemIndexSort {
+
+ _FORCE_INLINE_ bool operator()(const Item *p_left, const Item *p_right) const {
+
+ return p_left->index < p_right->index;
+ }
+ };
+
struct ItemPtrSort {
_FORCE_INLINE_ bool operator()(const Item *p_left, const Item *p_right) const {
@@ -162,16 +171,18 @@ public:
void canvas_item_set_draw_behind_parent(RID p_item, bool p_enable);
void canvas_item_add_line(RID p_item, const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width = 1.0, bool p_antialiased = false);
+ void canvas_item_add_polyline(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width = 1.0, bool p_antialiased = false);
void canvas_item_add_rect(RID p_item, const Rect2 &p_rect, const Color &p_color);
void canvas_item_add_circle(RID p_item, const Point2 &p_pos, float p_radius, const Color &p_color);
- void canvas_item_add_texture_rect(RID p_item, const Rect2 &p_rect, RID p_texture, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false);
- void canvas_item_add_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false);
- void canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, VS::NinePatchAxisMode p_x_axis_mode = VS::NINE_PATCH_STRETCH, VS::NinePatchAxisMode p_y_axis_mode = VS::NINE_PATCH_STRETCH, bool p_draw_center = true, const Color &p_modulate = Color(1, 1, 1));
- void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0);
- void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID());
- void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), int p_count = -1);
+ void canvas_item_add_texture_rect(RID p_item, const Rect2 &p_rect, RID p_texture, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, RID p_normal_map = RID());
+ void canvas_item_add_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, RID p_normal_map = RID(), bool p_clip_uv = true);
+ void canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, VS::NinePatchAxisMode p_x_axis_mode = VS::NINE_PATCH_STRETCH, VS::NinePatchAxisMode p_y_axis_mode = VS::NINE_PATCH_STRETCH, bool p_draw_center = true, const Color &p_modulate = Color(1, 1, 1), RID p_normal_map = RID());
+ void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0, RID p_normal_map = RID());
+ void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), RID p_normal_map = RID());
+ void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID());
void canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_skeleton = RID());
void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_skeleton = RID());
+ void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal, int p_h_frames, int p_v_frames);
void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform);
void canvas_item_add_clip_ignore(RID p_item, bool p_ignore);
void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable);
@@ -208,6 +219,7 @@ public:
void canvas_light_set_shadow_gradient_length(RID p_light, float p_length);
void canvas_light_set_shadow_filter(RID p_light, VS::CanvasLightShadowFilter p_filter);
void canvas_light_set_shadow_color(RID p_light, const Color &p_color);
+ void canvas_light_set_shadow_smooth(RID p_light, float p_smooth);
RID canvas_light_occluder_create();
void canvas_light_occluder_attach_to_canvas(RID p_occluder, RID p_canvas);
diff --git a/servers/visual/visual_server_global.cpp b/servers/visual/visual_server_global.cpp
index 75506f7add..a0f118dd67 100644
--- a/servers/visual/visual_server_global.cpp
+++ b/servers/visual/visual_server_global.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/visual/visual_server_global.h b/servers/visual/visual_server_global.h
index d55059cd55..079f03f1b1 100644
--- a/servers/visual/visual_server_global.h
+++ b/servers/visual/visual_server_global.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/visual/visual_server_light_baker.cpp b/servers/visual/visual_server_light_baker.cpp
index 493eeb49ca..67048eb54e 100644
--- a/servers/visual/visual_server_light_baker.cpp
+++ b/servers/visual/visual_server_light_baker.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/visual/visual_server_light_baker.h b/servers/visual/visual_server_light_baker.h
index 82909bb082..218c42bb1b 100644
--- a/servers/visual/visual_server_light_baker.h
+++ b/servers/visual/visual_server_light_baker.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index 2666a95595..4f16ae4125 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,9 +29,9 @@
/*************************************************************************/
#include "visual_server_raster.h"
#include "default_mouse_cursor.xpm"
-#include "global_config.h"
#include "io/marshalls.h"
#include "os/os.h"
+#include "project_settings.h"
#include "sort.h"
#include "visual_server_canvas.h"
#include "visual_server_global.h"
@@ -38,23 +39,31 @@
// careful, these may run in different threads than the visual server
-/* CURSOR */
-void VisualServerRaster::cursor_set_rotation(float p_rotation, int p_cursor) {
-}
-void VisualServerRaster::cursor_set_texture(RID p_texture, const Point2 &p_center_offset, int p_cursor, const Rect2 &p_region) {
-}
-void VisualServerRaster::cursor_set_visible(bool p_visible, int p_cursor) {
-}
-void VisualServerRaster::cursor_set_pos(const Point2 &p_pos, int p_cursor) {
-}
+int VisualServerRaster::changes = 0;
/* BLACK BARS */
void VisualServerRaster::black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom) {
+
+ black_margin[MARGIN_LEFT] = p_left;
+ black_margin[MARGIN_TOP] = p_top;
+ black_margin[MARGIN_RIGHT] = p_right;
+ black_margin[MARGIN_BOTTOM] = p_bottom;
}
+
void VisualServerRaster::black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom) {
+
+ black_image[MARGIN_LEFT] = p_left;
+ black_image[MARGIN_TOP] = p_top;
+ black_image[MARGIN_RIGHT] = p_right;
+ black_image[MARGIN_BOTTOM] = p_bottom;
}
+void VisualServerRaster::_draw_margins() {
+
+ VSG::canvas_render->draw_window_margins(black_margin, black_image);
+};
+
/* FREE */
void VisualServerRaster::free(RID p_rid) {
@@ -71,6 +80,19 @@ void VisualServerRaster::free(RID p_rid) {
/* EVENT QUEUING */
+void VisualServerRaster::request_frame_drawn_callback(Object *p_where, const StringName &p_method, const Variant &p_userdata) {
+
+ ERR_FAIL_NULL(p_where);
+ FrameDrawnCallbacks fdc;
+ fdc.object = p_where->get_instance_id();
+ fdc.method = p_method;
+ fdc.param = p_userdata;
+
+ frame_drawn_callbacks.push_back(fdc);
+
+ print_line("added callback to draw");
+}
+
void VisualServerRaster::draw() {
/*
@@ -89,6 +111,24 @@ void VisualServerRaster::draw() {
//_draw_cursors_and_margins();
VSG::rasterizer->end_frame();
//draw_extra_frame=VS:rasterizer->needs_to_draw_next_frame();
+
+ while (frame_drawn_callbacks.front()) {
+
+ Object *obj = ObjectDB::get_instance(frame_drawn_callbacks.front()->get().object);
+ if (obj) {
+ Variant::CallError ce;
+ const Variant *v = &frame_drawn_callbacks.front()->get().param;
+ obj->call(frame_drawn_callbacks.front()->get().method, &v, 1, ce);
+ if (ce.error != Variant::CallError::CALL_OK) {
+ String err = Variant::get_call_error_text(obj, frame_drawn_callbacks.front()->get().method, &v, 1, ce);
+ ERR_PRINTS("Error calling frame drawn function: " + err);
+ }
+ }
+
+ frame_drawn_callbacks.pop_front();
+ }
+
+ _draw_margins();
}
void VisualServerRaster::sync() {
}
@@ -113,12 +153,15 @@ void VisualServerRaster::finish() {
int VisualServerRaster::get_render_info(RenderInfo p_info) {
- return 0;
+ return VSG::storage->get_render_info(p_info);
}
/* TESTING */
-void VisualServerRaster::set_boot_image(const Image &p_image, const Color &p_color, bool p_scale) {
+void VisualServerRaster::set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale) {
+
+ redraw_request();
+ VSG::rasterizer->set_boot_image(p_image, p_color, p_scale);
}
void VisualServerRaster::set_default_clear_color(const Color &p_color) {
}
@@ -140,6 +183,11 @@ bool VisualServerRaster::has_os_feature(const String &p_feature) const {
return VSG::storage->has_os_feature(p_feature);
}
+void VisualServerRaster::set_debug_generate_wireframes(bool p_generate) {
+
+ VSG::storage->set_debug_generate_wireframes(p_generate);
+}
+
VisualServerRaster::VisualServerRaster() {
VSG::canvas = memnew(VisualServerCanvas);
@@ -149,6 +197,9 @@ VisualServerRaster::VisualServerRaster() {
VSG::storage = VSG::rasterizer->get_storage();
VSG::canvas_render = VSG::rasterizer->get_canvas();
VSG::scene_render = VSG::rasterizer->get_scene();
+
+ for (int i = 0; i < 4; i++)
+ black_margin[i] = 0;
}
VisualServerRaster::~VisualServerRaster() {
@@ -391,33 +442,33 @@ RID VisualServerRaster::fixed_material_create() {
return rasterizer->fixed_material_create();
}
-void VisualServerRaster::fixed_material_set_flag(RID p_material, FixedSpatialMaterialFlags p_flag, bool p_enabled) {
+void VisualServerRaster::fixed_material_set_flag(RID p_material, SpatialMaterialFlags p_flag, bool p_enabled) {
rasterizer->fixed_material_set_flag(p_material,p_flag,p_enabled);
}
-bool VisualServerRaster::fixed_material_get_flag(RID p_material, FixedSpatialMaterialFlags p_flag) const {
+bool VisualServerRaster::fixed_material_get_flag(RID p_material, SpatialMaterialFlags p_flag) const {
return rasterizer->fixed_material_get_flag(p_material,p_flag);
}
-void VisualServerRaster::fixed_material_set_param(RID p_material, FixedSpatialMaterialParam p_parameter, const Variant& p_value) {
+void VisualServerRaster::fixed_material_set_param(RID p_material, SpatialMaterialParam p_parameter, const Variant& p_value) {
VS_CHANGED;
rasterizer->fixed_material_set_parameter(p_material,p_parameter,p_value);
}
-Variant VisualServerRaster::fixed_material_get_param(RID p_material,FixedSpatialMaterialParam p_parameter) const {
+Variant VisualServerRaster::fixed_material_get_param(RID p_material,SpatialMaterialParam p_parameter) const {
return rasterizer->fixed_material_get_parameter(p_material,p_parameter);
}
-void VisualServerRaster::fixed_material_set_texture(RID p_material,FixedSpatialMaterialParam p_parameter, RID p_texture) {
+void VisualServerRaster::fixed_material_set_texture(RID p_material,SpatialMaterialParam p_parameter, RID p_texture) {
VS_CHANGED;
rasterizer->fixed_material_set_texture(p_material,p_parameter,p_texture);
}
-RID VisualServerRaster::fixed_material_get_texture(RID p_material,FixedSpatialMaterialParam p_parameter) const {
+RID VisualServerRaster::fixed_material_get_texture(RID p_material,SpatialMaterialParam p_parameter) const {
return rasterizer->fixed_material_get_texture(p_material,p_parameter);
}
@@ -425,12 +476,12 @@ RID VisualServerRaster::fixed_material_get_texture(RID p_material,FixedSpatialMa
-void VisualServerRaster::fixed_material_set_texcoord_mode(RID p_material,FixedSpatialMaterialParam p_parameter, FixedSpatialMaterialTexCoordMode p_mode) {
+void VisualServerRaster::fixed_material_set_texcoord_mode(RID p_material,SpatialMaterialParam p_parameter, SpatialMaterialTexCoordMode p_mode) {
VS_CHANGED;
rasterizer->fixed_material_set_texcoord_mode(p_material,p_parameter,p_mode);
}
-VS::FixedSpatialMaterialTexCoordMode VisualServerRaster::fixed_material_get_texcoord_mode(RID p_material,FixedSpatialMaterialParam p_parameter) const {
+VS::SpatialMaterialTexCoordMode VisualServerRaster::fixed_material_get_texcoord_mode(RID p_material,SpatialMaterialParam p_parameter) const {
return rasterizer->fixed_material_get_texcoord_mode(p_material,p_parameter);
}
@@ -457,14 +508,14 @@ Transform VisualServerRaster::fixed_material_get_uv_transform(RID p_material) co
return rasterizer->fixed_material_get_uv_transform(p_material);
}
-void VisualServerRaster::fixed_material_set_light_shader(RID p_material,FixedSpatialMaterialLightShader p_shader) {
+void VisualServerRaster::fixed_material_set_light_shader(RID p_material,SpatialMaterialLightShader p_shader) {
VS_CHANGED;
rasterizer->fixed_material_set_light_shader(p_material,p_shader);
}
-VisualServerRaster::FixedSpatialMaterialLightShader VisualServerRaster::fixed_material_get_light_shader(RID p_material) const{
+VisualServerRaster::SpatialMaterialLightShader VisualServerRaster::fixed_material_get_light_shader(RID p_material) const{
return rasterizer->fixed_material_get_light_shader(p_material);
}
@@ -2586,14 +2637,14 @@ AABB VisualServerRaster::instance_get_base_aabb(RID p_instance) const {
}
-void VisualServerRaster::instance_attach_object_instance_ID(RID p_instance,uint32_t p_ID) {
+void VisualServerRaster::instance_attach_object_instance_id(RID p_instance,uint32_t p_ID) {
VS_CHANGED;
Instance *instance = instance_owner.get( p_instance );
ERR_FAIL_COND( !instance );
instance->object_ID=p_ID;
}
-uint32_t VisualServerRaster::instance_get_object_instance_ID(RID p_instance) const {
+uint32_t VisualServerRaster::instance_get_object_instance_id(RID p_instance) const {
Instance *instance = instance_owner.get( p_instance );
ERR_FAIL_COND_V( !instance, 0 );
@@ -2851,7 +2902,7 @@ Vector<RID> VisualServerRaster::instances_cull_aabb(const AABB& p_aabb, RID p_sc
int culled=0;
Instance *cull[1024];
- culled=scenario->octree.cull_AABB(p_aabb,cull,1024);
+ culled=scenario->octree.cull_aabb(p_aabb,cull,1024);
for (int i=0;i<culled;i++) {
@@ -4521,7 +4572,7 @@ void VisualServerRaster::canvas_occluder_polygon_set_cull_mode(RID p_occluder_po
RID VisualServerRaster::canvas_item_material_create() {
- Rasterizer::CanvasItemMaterial *material = memnew( Rasterizer::CanvasItemMaterial );
+ Rasterizer::ShaderMaterial *material = memnew( Rasterizer::ShaderMaterial );
return canvas_item_material_owner.make_rid(material);
}
@@ -4529,7 +4580,7 @@ RID VisualServerRaster::canvas_item_material_create() {
void VisualServerRaster::canvas_item_material_set_shader(RID p_material, RID p_shader){
VS_CHANGED;
- Rasterizer::CanvasItemMaterial *material = canvas_item_material_owner.get( p_material );
+ Rasterizer::ShaderMaterial *material = canvas_item_material_owner.get( p_material );
ERR_FAIL_COND(!material);
material->shader=p_shader;
@@ -4537,7 +4588,7 @@ void VisualServerRaster::canvas_item_material_set_shader(RID p_material, RID p_s
void VisualServerRaster::canvas_item_material_set_shader_param(RID p_material, const StringName& p_param, const Variant& p_value){
VS_CHANGED;
- Rasterizer::CanvasItemMaterial *material = canvas_item_material_owner.get( p_material );
+ Rasterizer::ShaderMaterial *material = canvas_item_material_owner.get( p_material );
ERR_FAIL_COND(!material);
if (p_value.get_type()==Variant::NIL)
material->shader_param.erase(p_param);
@@ -4547,7 +4598,7 @@ void VisualServerRaster::canvas_item_material_set_shader_param(RID p_material, c
}
Variant VisualServerRaster::canvas_item_material_get_shader_param(RID p_material, const StringName& p_param) const{
- Rasterizer::CanvasItemMaterial *material = canvas_item_material_owner.get( p_material );
+ Rasterizer::ShaderMaterial *material = canvas_item_material_owner.get( p_material );
ERR_FAIL_COND_V(!material,Variant());
if (!material->shader_param.has(p_param)) {
ERR_FAIL_COND_V(!material->shader.is_valid(),Variant());
@@ -4560,7 +4611,7 @@ Variant VisualServerRaster::canvas_item_material_get_shader_param(RID p_material
void VisualServerRaster::canvas_item_material_set_shading_mode(RID p_material, CanvasItemShadingMode p_mode) {
VS_CHANGED;
- Rasterizer::CanvasItemMaterial *material = canvas_item_material_owner.get( p_material );
+ Rasterizer::ShaderMaterial *material = canvas_item_material_owner.get( p_material );
ERR_FAIL_COND(!material);
material->shading_mode=p_mode;
@@ -4869,7 +4920,7 @@ void VisualServerRaster::free( RID p_rid ) {
} else if (canvas_item_material_owner.owns(p_rid)) {
- Rasterizer::CanvasItemMaterial *material = canvas_item_material_owner.get(p_rid);
+ Rasterizer::ShaderMaterial *material = canvas_item_material_owner.get(p_rid);
ERR_FAIL_COND(!material);
for(Set<Rasterizer::CanvasItem*>::Element *E=material->owners.front();E;E=E->next()) {
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index 58e07057f2..596dd5c10e 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -56,10 +57,22 @@ class VisualServerRaster : public VisualServer {
};
- int changes;
+ static int changes;
bool draw_extra_frame;
RID test_cube;
+ int black_margin[4];
+ RID black_image[4];
+
+ struct FrameDrawnCallbacks {
+
+ ObjectID object;
+ StringName method;
+ Variant param;
+ };
+
+ List<FrameDrawnCallbacks> frame_drawn_callbacks;
+
#if 0
struct Room {
@@ -376,7 +389,7 @@ class VisualServerRaster : public VisualServer {
- mutable RID_Owner<Rasterizer::CanvasItemMaterial> canvas_item_material_owner;
+ mutable RID_Owner<Rasterizer::ShaderMaterial> canvas_item_material_owner;
@@ -574,7 +587,11 @@ class VisualServerRaster : public VisualServer {
#endif
+ void _draw_margins();
+
public:
+ _FORCE_INLINE_ static void redraw_request() { changes++; }
+
#define DISPLAY_CHANGED changes++;
#define BIND0R(m_r, m_name) \
@@ -583,6 +600,8 @@ public:
m_r m_name(m_type1 arg1) { return BINDBASE->m_name(arg1); }
#define BIND1RC(m_r, m_name, m_type1) \
m_r m_name(m_type1 arg1) const { return BINDBASE->m_name(arg1); }
+#define BIND2R(m_r, m_name, m_type1, m_type2) \
+ m_r m_name(m_type1 arg1, m_type2 arg2) { return BINDBASE->m_name(arg1, arg2); }
#define BIND2RC(m_r, m_name, m_type1, m_type2) \
m_r m_name(m_type1 arg1, m_type2 arg2) const { return BINDBASE->m_name(arg1, arg2); }
#define BIND3RC(m_r, m_name, m_type1, m_type2, m_type3) \
@@ -612,6 +631,8 @@ public:
void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8, m_type9 arg9) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); }
#define BIND10(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6, m_type7, m_type8, m_type9, m_type10) \
void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8, m_type9 arg9, m_type10 arg10) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); }
+#define BIND11(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6, m_type7, m_type8, m_type9, m_type10, m_type11) \
+ void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8, m_type9 arg9, m_type10 arg10, m_type11 arg11) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); }
//from now on, calls forwarded to this singleton
#define BINDBASE VSG::storage
@@ -620,18 +641,19 @@ public:
BIND0R(RID, texture_create)
BIND5(texture_allocate, RID, int, int, Image::Format, uint32_t)
- BIND3(texture_set_data, RID, const Image &, CubeMapSide)
- BIND2RC(Image, texture_get_data, RID, CubeMapSide)
+ BIND3(texture_set_data, RID, const Ref<Image> &, CubeMapSide)
+ BIND2RC(Ref<Image>, texture_get_data, RID, CubeMapSide)
BIND2(texture_set_flags, RID, uint32_t)
BIND1RC(uint32_t, texture_get_flags, RID)
BIND1RC(Image::Format, texture_get_format, RID)
+ BIND1RC(uint32_t, texture_get_texid, RID)
BIND1RC(uint32_t, texture_get_width, RID)
BIND1RC(uint32_t, texture_get_height, RID)
BIND3(texture_set_size_override, RID, int, int)
- BIND2RC(RID, texture_create_radiance_cubemap, RID, int)
BIND3(texture_set_detect_3d_callback, RID, TextureDetectCallback, void *)
BIND3(texture_set_detect_srgb_callback, RID, TextureDetectCallback, void *)
+ BIND3(texture_set_detect_normal_callback, RID, TextureDetectCallback, void *)
BIND2(texture_set_path, RID, const String &)
BIND1RC(String, texture_get_path, RID)
@@ -640,17 +662,14 @@ public:
BIND1(textures_keep_original, bool)
- /* SKYBOX API */
+ /* SKY API */
- BIND0R(RID, skybox_create)
- BIND3(skybox_set_texture, RID, RID, int)
+ BIND0R(RID, sky_create)
+ BIND3(sky_set_texture, RID, RID, int)
/* SHADER API */
- BIND1R(RID, shader_create, ShaderMode)
-
- BIND2(shader_set_mode, RID, ShaderMode)
- BIND1RC(ShaderMode, shader_get_mode, RID)
+ BIND0R(RID, shader_create)
BIND2(shader_set_code, RID, const String &)
BIND1RC(String, shader_get_code, RID)
@@ -671,6 +690,7 @@ public:
BIND2RC(Variant, material_get_param, RID, const StringName &)
BIND2(material_set_line_width, RID, float)
+ BIND2(material_set_next_pass, RID, RID)
/* MESH API */
@@ -829,6 +849,9 @@ public:
BIND2(gi_probe_set_bias, RID, float)
BIND1RC(float, gi_probe_get_bias, RID)
+ BIND2(gi_probe_set_normal_bias, RID, float)
+ BIND1RC(float, gi_probe_get_normal_bias, RID)
+
BIND2(gi_probe_set_propagation, RID, float)
BIND1RC(float, gi_probe_get_propagation, RID)
@@ -848,26 +871,25 @@ public:
BIND2(particles_set_emitting, RID, bool)
BIND2(particles_set_amount, RID, int)
BIND2(particles_set_lifetime, RID, float)
+ BIND2(particles_set_one_shot, RID, bool)
BIND2(particles_set_pre_process_time, RID, float)
BIND2(particles_set_explosiveness_ratio, RID, float)
BIND2(particles_set_randomness_ratio, RID, float)
BIND2(particles_set_custom_aabb, RID, const Rect3 &)
- BIND2(particles_set_gravity, RID, const Vector3 &)
+ BIND2(particles_set_speed_scale, RID, float)
BIND2(particles_set_use_local_coordinates, RID, bool)
BIND2(particles_set_process_material, RID, RID)
-
- BIND2(particles_set_emission_shape, RID, VS::ParticlesEmissionShape)
- BIND2(particles_set_emission_sphere_radius, RID, float)
- BIND2(particles_set_emission_box_extents, RID, const Vector3 &)
- BIND2(particles_set_emission_points, RID, const PoolVector<Vector3> &)
+ BIND2(particles_set_fixed_fps, RID, int)
+ BIND2(particles_set_fractional_delta, RID, bool)
+ BIND1(particles_restart, RID)
BIND2(particles_set_draw_order, RID, VS::ParticlesDrawOrder)
BIND2(particles_set_draw_passes, RID, int)
- BIND3(particles_set_draw_pass_material, RID, int, RID)
BIND3(particles_set_draw_pass_mesh, RID, int, RID)
- BIND1R(Rect3, particles_get_current_aabb, RID);
+ BIND1R(Rect3, particles_get_current_aabb, RID)
+ BIND2(particles_set_emission_transform, RID, const Transform &)
#undef BINDBASE
//from now on, calls forwarded to this singleton
@@ -891,6 +913,7 @@ public:
BIND0R(RID, viewport_create)
+ BIND2(viewport_set_use_arvr, RID, bool)
BIND3(viewport_set_size, RID, int, int)
BIND2(viewport_set_active, RID, bool)
@@ -925,6 +948,10 @@ public:
BIND3(viewport_set_shadow_atlas_quadrant_subdivision, RID, int, int)
BIND2(viewport_set_msaa, RID, ViewportMSAA)
BIND2(viewport_set_hdr, RID, bool)
+ BIND2(viewport_set_usage, RID, ViewportUsage)
+
+ BIND2R(int, viewport_get_render_info, RID, ViewportRenderInfo)
+ BIND2(viewport_set_debug_draw, RID, ViewportDebugDraw)
/* ENVIRONMENT API */
@@ -935,24 +962,27 @@ public:
BIND0R(RID, environment_create)
BIND2(environment_set_background, RID, EnvironmentBG)
- BIND2(environment_set_skybox, RID, RID)
- BIND2(environment_set_skybox_scale, RID, float)
+ BIND2(environment_set_sky, RID, RID)
+ BIND2(environment_set_sky_scale, RID, float)
BIND2(environment_set_bg_color, RID, const Color &)
BIND2(environment_set_bg_energy, RID, float)
BIND2(environment_set_canvas_max_layer, RID, int)
BIND4(environment_set_ambient_light, RID, const Color &, float, float)
- BIND8(environment_set_ssr, RID, bool, int, float, float, float, bool, bool)
+ BIND7(environment_set_ssr, RID, bool, int, float, float, float, bool)
BIND10(environment_set_ssao, RID, bool, float, float, float, float, float, float, const Color &, bool)
BIND6(environment_set_dof_blur_near, RID, bool, float, float, float, EnvironmentDOFBlurQuality)
BIND6(environment_set_dof_blur_far, RID, bool, float, float, float, EnvironmentDOFBlurQuality)
BIND10(environment_set_glow, RID, bool, int, float, float, float, EnvironmentGlowBlendMode, float, float, bool)
- BIND5(environment_set_fog, RID, bool, float, float, RID)
BIND9(environment_set_tonemap, RID, EnvironmentToneMapper, float, float, bool, float, float, float, float)
BIND6(environment_set_adjustment, RID, bool, float, float, float, RID)
+ BIND5(environment_set_fog, RID, bool, const Color &, const Color &, float)
+ BIND6(environment_set_fog_depth, RID, bool, float, float, bool, float)
+ BIND5(environment_set_fog_height, RID, bool, float, float, float)
+
/* SCENARIO API */
#undef BINDBASE
@@ -973,7 +1003,7 @@ public:
BIND2(instance_set_scenario, RID, RID) // from can be mesh, light, poly, area and portal so far.
BIND2(instance_set_layer_mask, RID, uint32_t)
BIND2(instance_set_transform, RID, const Transform &)
- BIND2(instance_attach_object_instance_ID, RID, ObjectID)
+ BIND2(instance_attach_object_instance_id, RID, ObjectID)
BIND3(instance_set_blend_shape_weight, RID, int, float)
BIND3(instance_set_surface_material, RID, int, RID)
BIND2(instance_set_visible, RID, bool)
@@ -1022,16 +1052,18 @@ public:
BIND2(canvas_item_set_draw_behind_parent, RID, bool)
BIND6(canvas_item_add_line, RID, const Point2 &, const Point2 &, const Color &, float, bool)
+ BIND5(canvas_item_add_polyline, RID, const Vector<Point2> &, const Vector<Color> &, float, bool)
BIND3(canvas_item_add_rect, RID, const Rect2 &, const Color &)
BIND4(canvas_item_add_circle, RID, const Point2 &, float, const Color &)
- BIND6(canvas_item_add_texture_rect, RID, const Rect2 &, RID, bool, const Color &, bool)
- BIND6(canvas_item_add_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, bool)
- BIND10(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &)
- BIND6(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, float)
- BIND5(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID)
- BIND7(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, int)
+ BIND7(canvas_item_add_texture_rect, RID, const Rect2 &, RID, bool, const Color &, bool, RID)
+ BIND8(canvas_item_add_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, bool, RID, bool)
+ BIND11(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &, RID)
+ BIND7(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, float, RID)
+ BIND6(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, RID)
+ BIND8(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, int, RID)
BIND3(canvas_item_add_mesh, RID, const RID &, RID)
BIND3(canvas_item_add_multimesh, RID, RID, RID)
+ BIND6(canvas_item_add_particles, RID, RID, RID, RID, int, int)
BIND2(canvas_item_add_set_transform, RID, const Transform2D &)
BIND2(canvas_item_add_clip_ignore, RID, bool)
BIND2(canvas_item_set_sort_children_by_y, RID, bool)
@@ -1068,6 +1100,7 @@ public:
BIND2(canvas_light_set_shadow_gradient_length, RID, float)
BIND2(canvas_light_set_shadow_filter, RID, CanvasLightShadowFilter)
BIND2(canvas_light_set_shadow_color, RID, const Color &)
+ BIND2(canvas_light_set_shadow_smooth, RID, float)
BIND0R(RID, canvas_light_occluder_create)
BIND2(canvas_light_occluder_attach_to_canvas, RID, RID)
@@ -1082,12 +1115,6 @@ public:
BIND2(canvas_occluder_polygon_set_cull_mode, RID, CanvasOccluderPolygonCullMode)
- /* CURSOR */
- virtual void cursor_set_rotation(float p_rotation, int p_cursor = 0); // radians
- virtual void cursor_set_texture(RID p_texture, const Point2 &p_center_offset = Point2(0, 0), int p_cursor = 0, const Rect2 &p_region = Rect2());
- virtual void cursor_set_visible(bool p_visible, int p_cursor = 0);
- virtual void cursor_set_pos(const Point2 &p_pos, int p_cursor = 0);
-
/* BLACK BARS */
virtual void black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom);
@@ -1099,6 +1126,8 @@ public:
/* EVENT QUEUING */
+ virtual void request_frame_drawn_callback(Object *p_where, const StringName &p_method, const Variant &p_userdata);
+
virtual void draw();
virtual void sync();
virtual bool has_changed() const;
@@ -1113,12 +1142,13 @@ public:
/* TESTING */
- virtual void set_boot_image(const Image &p_image, const Color &p_color, bool p_scale);
+ virtual void set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale);
virtual void set_default_clear_color(const Color &p_color);
virtual bool has_feature(Features p_feature) const;
virtual bool has_os_feature(const String &p_feature) const;
+ virtual void set_debug_generate_wireframes(bool p_generate);
VisualServerRaster();
~VisualServerRaster();
diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp
index 9b77ca9e1c..5faf0e67ca 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/visual/visual_server_scene.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +30,7 @@
#include "visual_server_scene.h"
#include "os/os.h"
#include "visual_server_global.h"
+#include "visual_server_raster.h"
/* CAMERA API */
RID VisualServerScene::camera_create() {
@@ -609,7 +611,8 @@ void VisualServerScene::instance_set_base(RID p_instance, RID p_base) {
} break;
case VS::INSTANCE_MESH:
case VS::INSTANCE_MULTIMESH:
- case VS::INSTANCE_IMMEDIATE: {
+ case VS::INSTANCE_IMMEDIATE:
+ case VS::INSTANCE_PARTICLES: {
InstanceGeometryData *geom = memnew(InstanceGeometryData);
instance->base_data = geom;
@@ -794,7 +797,7 @@ void VisualServerScene::instance_set_transform(RID p_instance, const Transform &
instance->transform = p_transform;
_instance_queue_update(instance, true);
}
-void VisualServerScene::instance_attach_object_instance_ID(RID p_instance, ObjectID p_ID) {
+void VisualServerScene::instance_attach_object_instance_id(RID p_instance, ObjectID p_ID) {
Instance *instance = instance_owner.get(p_instance);
ERR_FAIL_COND(!instance);
@@ -877,13 +880,13 @@ void VisualServerScene::instance_attach_skeleton(RID p_instance, RID p_skeleton)
return;
if (instance->skeleton.is_valid()) {
- VSG::storage->instance_remove_skeleton(p_skeleton, instance);
+ VSG::storage->instance_remove_skeleton(instance->skeleton, instance);
}
instance->skeleton = p_skeleton;
if (instance->skeleton.is_valid()) {
- VSG::storage->instance_add_skeleton(p_skeleton, instance);
+ VSG::storage->instance_add_skeleton(instance->skeleton, instance);
}
_instance_queue_update(instance, true);
@@ -907,7 +910,7 @@ Vector<ObjectID> VisualServerScene::instances_cull_aabb(const Rect3 &p_aabb, RID
int culled = 0;
Instance *cull[1024];
- culled = scenario->octree.cull_AABB(p_aabb, cull, 1024);
+ culled = scenario->octree.cull_aabb(p_aabb, cull, 1024);
for (int i = 0; i < culled; i++) {
@@ -975,16 +978,6 @@ void VisualServerScene::instance_geometry_set_flag(RID p_instance, VS::InstanceF
switch (p_flags) {
- case VS::INSTANCE_FLAG_BILLBOARD: {
-
- instance->billboard = p_enabled;
-
- } break;
- case VS::INSTANCE_FLAG_BILLBOARD_FIX_Y: {
-
- instance->billboard_y = p_enabled;
-
- } break;
case VS::INSTANCE_FLAG_CAST_SHADOW: {
if (p_enabled == true) {
instance->cast_shadows = VS::SHADOW_CASTING_SETTING_ON;
@@ -995,14 +988,14 @@ void VisualServerScene::instance_geometry_set_flag(RID p_instance, VS::InstanceF
instance->base_material_changed(); // to actually compute if shadows are visible or not
} break;
- case VS::INSTANCE_FLAG_DEPH_SCALE: {
+ case VS::INSTANCE_FLAG_VISIBLE_IN_ALL_ROOMS: {
- instance->depth_scale = p_enabled;
+ instance->visible_in_all_rooms = p_enabled;
} break;
- case VS::INSTANCE_FLAG_VISIBLE_IN_ALL_ROOMS: {
+ case VS::INSTANCE_FLAG_USE_BAKED_LIGHT: {
- instance->visible_in_all_rooms = p_enabled;
+ instance->baked_light = p_enabled;
} break;
}
@@ -1050,6 +1043,11 @@ void VisualServerScene::_update_instance(Instance *p_instance) {
reflection_probe->reflection_dirty = true;
}
+ if (p_instance->base_type == VS::INSTANCE_PARTICLES) {
+
+ VSG::storage->particles_set_emission_transform(p_instance->base, p_instance->transform);
+ }
+
if (p_instance->aabb.has_no_surface())
return;
@@ -1235,6 +1233,11 @@ void VisualServerScene::_update_instance_aabb(Instance *p_instance) {
new_aabb = VSG::storage->immediate_get_aabb(p_instance->base);
} break;
+ case VisualServer::INSTANCE_PARTICLES: {
+
+ new_aabb = VSG::storage->particles_get_aabb(p_instance->base);
+
+ } break;
#if 0
case VisualServer::INSTANCE_PARTICLES: {
@@ -1349,6 +1352,8 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
bool overlap = VSG::storage->light_directional_get_blend_splits(p_instance->base);
+ float first_radius = 0.0;
+
for (int i = 0; i < splits; i++) {
// setup a camera matrix for that range!
@@ -1375,9 +1380,11 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
// obtain the light frustm ranges (given endpoints)
- Vector3 x_vec = p_instance->transform.basis.get_axis(Vector3::AXIS_X).normalized();
- Vector3 y_vec = p_instance->transform.basis.get_axis(Vector3::AXIS_Y).normalized();
- Vector3 z_vec = p_instance->transform.basis.get_axis(Vector3::AXIS_Z).normalized();
+ Transform transform = p_instance->transform.orthonormalized(); //discard scale and stabilize light
+
+ Vector3 x_vec = transform.basis.get_axis(Vector3::AXIS_X).normalized();
+ Vector3 y_vec = transform.basis.get_axis(Vector3::AXIS_Y).normalized();
+ Vector3 z_vec = transform.basis.get_axis(Vector3::AXIS_Z).normalized();
//z_vec points agsint the camera, like in default opengl
float x_min, x_max;
@@ -1388,7 +1395,10 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
float y_min_cam, y_max_cam;
float z_min_cam, z_max_cam;
+ float bias_scale = 1.0;
+
//used for culling
+
for (int j = 0; j < 8; j++) {
float d_x = x_vec.dot(endpoints[j]);
@@ -1437,6 +1447,12 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
radius *= texture_size / (texture_size - 2.0); //add a texel by each side, so stepified texture will always fit
+ if (i == 0) {
+ first_radius = radius;
+ } else {
+ bias_scale = radius / first_radius;
+ }
+
x_max_cam = x_vec.dot(center) + radius;
x_min_cam = x_vec.dot(center) - radius;
y_max_cam = y_vec.dot(center) + radius;
@@ -1471,6 +1487,8 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
// a pre pass will need to be needed to determine the actual z-near to be used
+ Plane near_plane(p_instance->transform.origin, -p_instance->transform.basis.get_axis(2));
+
for (int j = 0; j < cull_count; j++) {
float min, max;
@@ -1483,6 +1501,8 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
}
instance->transformed_aabb.project_range_in_plane(Plane(z_vec, 0), min, max);
+ instance->depth = near_plane.distance_to(instance->transform.origin);
+ instance->depth_layer = 0;
if (max > z_max)
z_max = max;
}
@@ -1495,10 +1515,10 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
ortho_camera.set_orthogonal(-half_x, half_x, -half_y, half_y, 0, (z_max - z_min_cam));
Transform ortho_transform;
- ortho_transform.basis = p_instance->transform.basis;
+ ortho_transform.basis = transform.basis;
ortho_transform.origin = x_vec * (x_min_cam + half_x) + y_vec * (y_min_cam + half_y) + z_vec * z_max;
- VSG::scene_render->light_instance_set_shadow_transform(light->instance, ortho_camera, ortho_transform, 0, distances[i + 1], i);
+ VSG::scene_render->light_instance_set_shadow_transform(light->instance, ortho_camera, ortho_transform, 0, distances[i + 1], i, bias_scale);
}
VSG::scene_render->render_shadow(light->instance, p_shadow_atlas, i, (RasterizerScene::InstanceBase **)instance_shadow_cull_result, cull_count);
@@ -1528,6 +1548,7 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
planes[4] = p_instance->transform.xform(Plane(Vector3(0, -1, z).normalized(), radius));
int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK);
+ Plane near_plane(p_instance->transform.origin, p_instance->transform.basis.get_axis(2) * z);
for (int j = 0; j < cull_count; j++) {
@@ -1536,6 +1557,9 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
cull_count--;
SWAP(instance_shadow_cull_result[j], instance_shadow_cull_result[cull_count]);
j--;
+ } else {
+ instance->depth = near_plane.distance_to(instance->transform.origin);
+ instance->depth_layer = 0;
}
}
@@ -1576,6 +1600,7 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK);
+ Plane near_plane(xform.origin, -xform.basis.get_axis(2));
for (int j = 0; j < cull_count; j++) {
Instance *instance = instance_shadow_cull_result[j];
@@ -1583,6 +1608,9 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
cull_count--;
SWAP(instance_shadow_cull_result[j], instance_shadow_cull_result[cull_count]);
j--;
+ } else {
+ instance->depth = near_plane.distance_to(instance->transform.origin);
+ instance->depth_layer = 0;
}
}
@@ -1608,6 +1636,7 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
Vector<Plane> planes = cm.get_projection_planes(p_instance->transform);
int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK);
+ Plane near_plane(p_instance->transform.origin, -p_instance->transform.basis.get_axis(2));
for (int j = 0; j < cull_count; j++) {
Instance *instance = instance_shadow_cull_result[j];
@@ -1615,6 +1644,9 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
cull_count--;
SWAP(instance_shadow_cull_result[j], instance_shadow_cull_result[cull_count]);
j--;
+ } else {
+ instance->depth = near_plane.distance_to(instance->transform.origin);
+ instance->depth_layer = 0;
}
}
@@ -1626,6 +1658,7 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
}
void VisualServerScene::render_camera(RID p_camera, RID p_scenario, Size2 p_viewport_size, RID p_shadow_atlas) {
+ // render to mono camera
Camera *camera = camera_owner.getornull(p_camera);
ERR_FAIL_COND(!camera);
@@ -1665,6 +1698,25 @@ void VisualServerScene::render_camera(RID p_camera, RID p_scenario, Size2 p_view
_render_scene(camera->transform, camera_matrix, ortho, camera->env, camera->visible_layers, p_scenario, p_shadow_atlas, RID(), -1);
}
+void VisualServerScene::render_camera(Ref<ARVRInterface> &p_interface, ARVRInterface::Eyes p_eye, RID p_camera, RID p_scenario, Size2 p_viewport_size, RID p_shadow_atlas) {
+ // render for AR/VR interface
+
+ Camera *camera = camera_owner.getornull(p_camera);
+ ERR_FAIL_COND(!camera);
+
+ /* SETUP CAMERA, we are ignoring type and FOV here */
+ bool ortho = false;
+ float aspect = p_viewport_size.width / (float)p_viewport_size.height;
+ CameraMatrix camera_matrix = p_interface->get_projection_for_eye(p_eye, aspect, camera->znear, camera->zfar);
+
+ // We also ignore our camera position, it will have been positioned with a slightly old tracking position.
+ // Instead we take our origin point and have our ar/vr interface add fresh tracking data! Whoohoo!
+ Transform world_origin = ARVRServer::get_singleton()->get_world_origin();
+ Transform cam_transform = p_interface->get_transform_for_eye(p_eye, world_origin);
+
+ _render_scene(cam_transform, camera_matrix, ortho, camera->env, camera->visible_layers, p_scenario, p_shadow_atlas, RID(), -1);
+};
+
void VisualServerScene::_render_scene(const Transform p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_orthogonal, RID p_force_environment, uint32_t p_visible_layers, RID p_scenario, RID p_shadow_atlas, RID p_reflection_probe, int p_reflection_probe_pass) {
Scenario *scenario = scenario_owner.getornull(p_scenario);
@@ -1822,7 +1874,7 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform, const Cam
if (reflection_probe->reflection_dirty || VSG::scene_render->reflection_probe_instance_needs_redraw(reflection_probe->instance)) {
if (!reflection_probe->update_list.in_list()) {
reflection_probe->render_step = 0;
- reflection_probe_render_list.add(&reflection_probe->update_list);
+ reflection_probe_render_list.add_last(&reflection_probe->update_list);
}
reflection_probe->reflection_dirty = false;
@@ -1914,6 +1966,13 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform, const Cam
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(ins->base_data);
+ if (ins->base_type == VS::INSTANCE_PARTICLES) {
+ //particles visible? process them
+ VSG::storage->particles_request_process(ins->base);
+ //particles visible? request redraw
+ VisualServerRaster::redraw_request();
+ }
+
if (geom->lighting_dirty) {
int l = 0;
//only called when lights AABB enter/exit this geometry
@@ -2144,6 +2203,18 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform, const Cam
VSG::scene_render->render_scene(p_cam_transform, p_cam_projection, p_cam_orthogonal, (RasterizerScene::InstanceBase **)instance_cull_result, cull_count, light_instance_cull_result, light_cull_count + directional_light_count, reflection_probe_instance_cull_result, reflection_probe_cull_count, environment, p_shadow_atlas, scenario->reflection_atlas, p_reflection_probe, p_reflection_probe_pass);
}
+void VisualServerScene::render_empty_scene(RID p_scenario, RID p_shadow_atlas) {
+
+ Scenario *scenario = scenario_owner.getornull(p_scenario);
+
+ RID environment;
+ if (scenario->environment.is_valid())
+ environment = scenario->environment;
+ else
+ environment = scenario->fallback_environment;
+ VSG::scene_render->render_scene(Transform(), CameraMatrix(), true, NULL, 0, NULL, 0, NULL, 0, environment, p_shadow_atlas, scenario->reflection_atlas, RID(), 0);
+}
+
bool VisualServerScene::_render_reflection_probe_step(Instance *p_instance, int p_step) {
InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData *>(p_instance->base_data);
@@ -2574,11 +2645,11 @@ static float _get_normal_advance(const Vector3 &p_normal) {
return 1.0 / normal.dot(unorm);
}
-void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, const GIProbeDataCell *cells, InstanceGIProbeData::LocalData *local_data, const uint32_t *leaves, int leaf_count, const InstanceGIProbeData::LightCache &light_cache, int sign) {
+void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, const GIProbeDataCell *cells, InstanceGIProbeData::LocalData *local_data, const uint32_t *leaves, int p_leaf_count, const InstanceGIProbeData::LightCache &light_cache, int p_sign) {
- int light_r = int(light_cache.color.r * light_cache.energy * 1024.0) * sign;
- int light_g = int(light_cache.color.g * light_cache.energy * 1024.0) * sign;
- int light_b = int(light_cache.color.b * light_cache.energy * 1024.0) * sign;
+ int light_r = int(light_cache.color.r * light_cache.energy * 1024.0) * p_sign;
+ int light_g = int(light_cache.color.g * light_cache.energy * 1024.0) * p_sign;
+ int light_b = int(light_cache.color.b * light_cache.energy * 1024.0) * p_sign;
float limits[3] = { float(header->width), float(header->height), float(header->depth) };
Plane clip[3];
@@ -2614,7 +2685,7 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
uint64_t us = OS::get_singleton()->get_ticks_usec();
- for (int i = 0; i < leaf_count; i++) {
+ for (int i = 0; i < p_leaf_count; i++) {
uint32_t idx = leaves[i];
@@ -2665,8 +2736,8 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
success_count++;
}
}
- print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
- print_line("valid cells: " + itos(success_count));
+ //print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
+ //print_line("valid cells: " + itos(success_count));
} break;
case VS::LIGHT_OMNI:
@@ -2679,7 +2750,7 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
float local_radius = light_cache.radius * light_cache.transform.basis.get_axis(2).length();
- for (int i = 0; i < leaf_count; i++) {
+ for (int i = 0; i < p_leaf_count; i++) {
uint32_t idx = leaves[i];
@@ -2771,7 +2842,7 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
light->energy[2] += int32_t(light_b * att * ((cell->albedo) & 0xFF) / 255.0);
}
}
- print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
+ //print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
} break;
}
@@ -2870,7 +2941,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) {
if (stage >= probe_data->dynamic.mipmaps_3d.size())
continue; //no mipmap for this one
- print_line("generating mipmap stage: " + itos(stage));
+ //print_line("generating mipmap stage: " + itos(stage));
int level_cell_count = probe_data->dynamic.level_cell_lists[i].size();
const uint32_t *level_cells = probe_data->dynamic.level_cell_lists[i].ptr();
@@ -3305,6 +3376,38 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) {
} else {
can_cast_shadows = false;
}
+ } else if (p_instance->base_type == VS::INSTANCE_PARTICLES) {
+
+ bool cast_shadows = false;
+
+ int dp = VSG::storage->particles_get_draw_passes(p_instance->base);
+
+ for (int i = 0; i < dp; i++) {
+
+ RID mesh = VSG::storage->particles_get_draw_pass_mesh(p_instance->base, i);
+ if (!mesh.is_valid())
+ continue;
+
+ int sc = VSG::storage->mesh_get_surface_count(mesh);
+ for (int j = 0; j < sc; j++) {
+
+ RID mat = VSG::storage->mesh_surface_get_material(mesh, j);
+
+ if (!mat.is_valid()) {
+ cast_shadows = true;
+ break;
+ }
+
+ if (VSG::storage->material_casts_shadows(mat)) {
+ cast_shadows = true;
+ break;
+ }
+ }
+ }
+
+ if (!cast_shadows) {
+ can_cast_shadows = false;
+ }
}
}
diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h
index b02e6c820b..910e75c3e3 100644
--- a/servers/visual/visual_server_scene.h
+++ b/servers/visual/visual_server_scene.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,9 +36,9 @@
#include "geometry.h"
#include "octree.h"
#include "os/semaphore.h"
-#include "os/semaphore.h"
#include "os/thread.h"
#include "self_list.h"
+#include "servers/arvr/arvr_interface.h"
class VisualServerScene {
public:
@@ -117,7 +118,7 @@ public:
Camera() {
visible_layers = 0xFFFFFFFF;
- fov = 60;
+ fov = 65;
type = PERSPECTIVE;
znear = 0.1;
zfar = 100;
@@ -488,7 +489,7 @@ public:
virtual void instance_set_scenario(RID p_instance, RID p_scenario); // from can be mesh, light, poly, area and portal so far.
virtual void instance_set_layer_mask(RID p_instance, uint32_t p_mask);
virtual void instance_set_transform(RID p_instance, const Transform &p_transform);
- virtual void instance_attach_object_instance_ID(RID p_instance, ObjectID p_ID);
+ virtual void instance_attach_object_instance_id(RID p_instance, ObjectID p_ID);
virtual void instance_set_blend_shape_weight(RID p_instance, int p_shape, float p_weight);
virtual void instance_set_surface_material(RID p_instance, int p_surface, RID p_material);
virtual void instance_set_visible(RID p_instance, bool p_visible);
@@ -518,8 +519,10 @@ public:
_FORCE_INLINE_ void _light_instance_update_shadow(Instance *p_instance, const Transform p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_orthogonal, RID p_shadow_atlas, Scenario *p_scenario);
void _render_scene(const Transform p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_orthogonal, RID p_force_environment, uint32_t p_visible_layers, RID p_scenario, RID p_shadow_atlas, RID p_reflection_probe, int p_reflection_probe_pass);
+ void render_empty_scene(RID p_scenario, RID p_shadow_atlas);
void render_camera(RID p_camera, RID p_scenario, Size2 p_viewport_size, RID p_shadow_atlas);
+ void render_camera(Ref<ARVRInterface> &p_interface, ARVRInterface::Eyes p_eye, RID p_camera, RID p_scenario, Size2 p_viewport_size, RID p_shadow_atlas);
void update_dirty_instances();
//probes
@@ -564,7 +567,7 @@ public:
_FORCE_INLINE_ uint32_t _gi_bake_find_cell(const GIProbeDataCell *cells, int x, int y, int z, int p_cell_subdiv);
void _bake_gi_downscale_light(int p_idx, int p_level, const GIProbeDataCell *p_cells, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data, float p_propagate);
void _bake_gi_probe_light(const GIProbeDataHeader *header, const GIProbeDataCell *cells, InstanceGIProbeData::LocalData *local_data, const uint32_t *leaves, int p_leaf_count, const InstanceGIProbeData::LightCache &light_cache, int p_sign);
- void _bake_gi_probe(Instance *p_probe);
+ void _bake_gi_probe(Instance *p_gi_probe);
bool _check_gi_probe(Instance *p_gi_probe);
void _setup_gi_probe(Instance *p_instance);
diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp
index 7b8a725c5a..ad9dec090a 100644
--- a/servers/visual/visual_server_viewport.cpp
+++ b/servers/visual/visual_server_viewport.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,30 +28,31 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "visual_server_viewport.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "visual_server_canvas.h"
#include "visual_server_global.h"
#include "visual_server_scene.h"
-void VisualServerViewport::_draw_viewport(Viewport *p_viewport) {
+void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::Eyes p_eye) {
-/* Camera should always be BEFORE any other 3D */
-#if 0
- bool scenario_draw_canvas_bg=false;
- int scenario_canvas_max_layer=0;
+ /* Camera should always be BEFORE any other 3D */
- if (!p_viewport->hide_canvas && !p_viewport->disable_environment && scenario_owner.owns(p_viewport->scenario)) {
+ bool scenario_draw_canvas_bg = false; //draw canvas, or some layer of it, as BG for 3D instead of in front
+ int scenario_canvas_max_layer = 0;
- Scenario *scenario=scenario_owner.get(p_viewport->scenario);
- if (scenario->environment.is_valid()) {
- if (rasterizer->is_environment(scenario->environment)) {
- scenario_draw_canvas_bg=rasterizer->environment_get_background(scenario->environment)==VS::ENV_BG_CANVAS;
- scenario_canvas_max_layer=rasterizer->environment_get_background_param(scenario->environment,VS::ENV_BG_PARAM_CANVAS_MAX_LAYER);
- }
+ if (!p_viewport->hide_canvas && !p_viewport->disable_environment && VSG::scene->scenario_owner.owns(p_viewport->scenario)) {
+
+ VisualServerScene::Scenario *scenario = VSG::scene->scenario_owner.get(p_viewport->scenario);
+ if (VSG::scene_render->is_environment(scenario->environment)) {
+ scenario_draw_canvas_bg = VSG::scene_render->environment_get_background(scenario->environment) == VS::ENV_BG_CANVAS;
+
+ scenario_canvas_max_layer = VSG::scene_render->environment_get_canvas_max_layer(scenario->environment);
}
}
- bool can_draw_3d=!p_viewport->hide_scenario && camera_owner.owns(p_viewport->camera) && scenario_owner.owns(p_viewport->scenario);
+ bool can_draw_3d = !p_viewport->disable_3d && !p_viewport->disable_3d_by_usage && VSG::scene->camera_owner.owns(p_viewport->camera);
+#if 0
+
if (scenario_draw_canvas_bg) {
@@ -87,9 +89,14 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport) {
}
}
- if (!p_viewport->disable_3d && p_viewport->camera.is_valid()) {
+ if (!scenario_draw_canvas_bg && can_draw_3d) {
+ Ref<ARVRInterface> arvr_interface = ARVRServer::get_singleton()->get_primary_interface();
- VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
+ if (p_viewport->use_arvr && arvr_interface.is_valid()) {
+ VSG::scene->render_camera(arvr_interface, p_eye, p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
+ } else {
+ VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
+ }
}
if (!p_viewport->hide_canvas) {
@@ -132,7 +139,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport) {
cl->texture_cache = NULL;
Transform2D scale;
scale.scale(cl->rect_cache.size);
- scale.elements[2] = cl->rect_cache.pos;
+ scale.elements[2] = cl->rect_cache.position;
cl->light_shader_xform = (cl->xform_cache * scale).affine_inverse();
cl->light_shader_pos = cl->xform_cache[2];
if (cl->shadow_buffer.is_valid()) {
@@ -198,14 +205,15 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport) {
VSG::rasterizer->restore_render_target();
-#if 0
- if (scenario_draw_canvas_bg && canvas_map.front() && canvas_map.front()->key().layer>scenario_canvas_max_layer) {
-
- _draw_viewport_camera(p_viewport,!can_draw_3d);
- scenario_draw_canvas_bg=false;
+ if (scenario_draw_canvas_bg && canvas_map.front() && canvas_map.front()->key().layer > scenario_canvas_max_layer) {
+ if (can_draw_3d) {
+ VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
+ } else {
+ VSG::scene->render_empty_scene(p_viewport->scenario, p_viewport->shadow_atlas);
+ }
+ scenario_draw_canvas_bg = false;
}
-#endif
for (Map<Viewport::CanvasKey, Viewport::CanvasData *>::Element *E = canvas_map.front(); E; E = E->next()) {
@@ -228,34 +236,48 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport) {
VSG::canvas->render_canvas(canvas, xform, canvas_lights, lights_with_mask, clip_rect);
i++;
-#if 0
- if (scenario_draw_canvas_bg && E->key().layer>=scenario_canvas_max_layer) {
- _draw_viewport_camera(p_viewport,!can_draw_3d);
- scenario_draw_canvas_bg=false;
+
+ if (scenario_draw_canvas_bg && E->key().layer >= scenario_canvas_max_layer) {
+
+ if (can_draw_3d) {
+ VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
+ } else {
+ VSG::scene->render_empty_scene(p_viewport->scenario, p_viewport->shadow_atlas);
+ }
+
+ scenario_draw_canvas_bg = false;
}
-#endif
}
-#if 0
+
if (scenario_draw_canvas_bg) {
- _draw_viewport_camera(p_viewport,!can_draw_3d);
- scenario_draw_canvas_bg=false;
+
+ if (can_draw_3d) {
+ VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
+ } else {
+ VSG::scene->render_empty_scene(p_viewport->scenario, p_viewport->shadow_atlas);
+ }
+
+ scenario_draw_canvas_bg = false;
}
-#endif
//VSG::canvas_render->canvas_debug_viewport_shadows(lights_with_shadow);
}
}
void VisualServerViewport::draw_viewports() {
+ // get our arvr interface in case we need it
+ Ref<ARVRInterface> arvr_interface = ARVRServer::get_singleton()->get_primary_interface();
+ if (arvr_interface.is_valid()) {
+ // update our positioning information as late as possible...
+ arvr_interface->process();
+ }
- //sort viewports
-
- //draw viewports
-
- clear_color = GLOBAL_GET("rendering/viewport/default_clear_color");
+ clear_color = GLOBAL_GET("rendering/environment/default_clear_color");
+ //sort viewports
active_viewports.sort_custom<ViewportSort>();
+ //draw viewports
for (int i = 0; i < active_viewports.size(); i++) {
Viewport *vp = active_viewports[i];
@@ -265,23 +287,61 @@ void VisualServerViewport::draw_viewports() {
ERR_CONTINUE(!vp->render_target.is_valid());
- bool visible = vp->viewport_to_screen_rect != Rect2() || vp->update_mode == VS::VIEWPORT_UPDATE_ALWAYS || vp->update_mode == VS::VIEWPORT_UPDATE_ONCE;
+ bool visible = vp->viewport_to_screen_rect != Rect2() || vp->update_mode == VS::VIEWPORT_UPDATE_ALWAYS || vp->update_mode == VS::VIEWPORT_UPDATE_ONCE || (vp->update_mode == VS::VIEWPORT_UPDATE_WHEN_VISIBLE && VSG::storage->render_target_was_used(vp->render_target));
+ visible = visible && vp->size.x > 0 && vp->size.y > 0;
if (!visible)
continue;
- VSG::rasterizer->set_current_render_target(vp->render_target);
- _draw_viewport(vp);
+ VSG::storage->render_target_clear_used(vp->render_target);
+
+ if (vp->use_arvr && arvr_interface.is_valid()) {
+ // override our size, make sure it matches our required size
+ Size2 size = arvr_interface->get_recommended_render_targetsize();
+ VSG::storage->render_target_set_size(vp->render_target, size.x, size.y);
+
+ // render mono or left eye first
+ ARVRInterface::Eyes leftOrMono = arvr_interface->is_stereo() ? ARVRInterface::EYE_LEFT : ARVRInterface::EYE_MONO;
+ VSG::rasterizer->set_current_render_target(vp->render_target);
+ _draw_viewport(vp, leftOrMono);
+ arvr_interface->commit_for_eye(leftOrMono, vp->render_target, vp->viewport_to_screen_rect);
+
+ // render right eye
+ if (leftOrMono == ARVRInterface::EYE_LEFT) {
+ // commit for eye may have changed the render target
+ VSG::rasterizer->set_current_render_target(vp->render_target);
- if (vp->viewport_to_screen_rect != Rect2()) {
- //copy to screen if set as such
- VSG::rasterizer->set_current_render_target(RID());
- VSG::rasterizer->blit_render_target_to_screen(vp->render_target, vp->viewport_to_screen_rect, vp->viewport_to_screen);
+ _draw_viewport(vp, ARVRInterface::EYE_RIGHT);
+ arvr_interface->commit_for_eye(ARVRInterface::EYE_RIGHT, vp->render_target, vp->viewport_to_screen_rect);
+ }
+ } else {
+ VSG::rasterizer->set_current_render_target(vp->render_target);
+
+ VSG::scene_render->set_debug_draw_mode(vp->debug_draw);
+ VSG::storage->render_info_begin_capture();
+
+ // render standard mono camera
+ _draw_viewport(vp);
+
+ VSG::storage->render_info_end_capture();
+ vp->render_info[VS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_OBJECTS_IN_FRAME);
+ vp->render_info[VS::VIEWPORT_RENDER_INFO_VERTICES_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_VERTICES_IN_FRAME);
+ vp->render_info[VS::VIEWPORT_RENDER_INFO_MATERIAL_CHANGES_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_MATERIAL_CHANGES_IN_FRAME);
+ vp->render_info[VS::VIEWPORT_RENDER_INFO_SHADER_CHANGES_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_SHADER_CHANGES_IN_FRAME);
+ vp->render_info[VS::VIEWPORT_RENDER_INFO_SURFACE_CHANGES_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_SURFACE_CHANGES_IN_FRAME);
+ vp->render_info[VS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_DRAW_CALLS_IN_FRAME);
+
+ if (vp->viewport_to_screen_rect != Rect2()) {
+ //copy to screen if set as such
+ VSG::rasterizer->set_current_render_target(RID());
+ VSG::rasterizer->blit_render_target_to_screen(vp->render_target, vp->viewport_to_screen_rect, vp->viewport_to_screen);
+ }
}
if (vp->update_mode == VS::VIEWPORT_UPDATE_ONCE) {
vp->update_mode = VS::VIEWPORT_UPDATE_DISABLED;
}
+ VSG::scene_render->set_debug_draw_mode(VS::VIEWPORT_DEBUG_DRAW_DISABLED);
}
}
@@ -300,6 +360,13 @@ RID VisualServerViewport::viewport_create() {
return rid;
}
+void VisualServerViewport::viewport_set_use_arvr(RID p_viewport, bool p_use_arvr) {
+ Viewport *viewport = viewport_owner.getornull(p_viewport);
+ ERR_FAIL_COND(!viewport);
+
+ viewport->use_arvr = p_use_arvr;
+}
+
void VisualServerViewport::viewport_set_size(RID p_viewport, int p_width, int p_height) {
ERR_FAIL_COND(p_width < 0 && p_height < 0);
@@ -408,7 +475,8 @@ void VisualServerViewport::viewport_set_disable_3d(RID p_viewport, bool p_disabl
ERR_FAIL_COND(!viewport);
viewport->disable_3d = p_disable;
- VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_3D, p_disable);
+ //VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_3D, p_disable);
+ //this should be just for disabling rendering of 3D, to actually disable it, set usage
}
void VisualServerViewport::viewport_attach_camera(RID p_viewport, RID p_camera) {
@@ -517,6 +585,63 @@ void VisualServerViewport::viewport_set_hdr(RID p_viewport, bool p_enabled) {
VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_HDR, p_enabled);
}
+void VisualServerViewport::viewport_set_usage(RID p_viewport, VS::ViewportUsage p_usage) {
+
+ Viewport *viewport = viewport_owner.getornull(p_viewport);
+ ERR_FAIL_COND(!viewport);
+
+ switch (p_usage) {
+ case VS::VIEWPORT_USAGE_2D: {
+
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_3D, true);
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_3D_EFFECTS, true);
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_SAMPLING, false);
+
+ viewport->disable_3d_by_usage = true;
+ } break;
+ case VS::VIEWPORT_USAGE_2D_NO_SAMPLING: {
+
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_3D, true);
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_3D_EFFECTS, true);
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_SAMPLING, true);
+ viewport->disable_3d_by_usage = true;
+ } break;
+ case VS::VIEWPORT_USAGE_3D: {
+
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_3D, false);
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_3D_EFFECTS, false);
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_SAMPLING, false);
+ viewport->disable_3d_by_usage = false;
+ } break;
+ case VS::VIEWPORT_USAGE_3D_NO_EFFECTS: {
+
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_3D, false);
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_3D_EFFECTS, true);
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_NO_SAMPLING, false);
+ viewport->disable_3d_by_usage = false;
+ } break;
+ }
+}
+
+int VisualServerViewport::viewport_get_render_info(RID p_viewport, VS::ViewportRenderInfo p_info) {
+
+ ERR_FAIL_INDEX_V(p_info, VS::VIEWPORT_RENDER_INFO_MAX, -1);
+
+ Viewport *viewport = viewport_owner.getornull(p_viewport);
+ if (!viewport)
+ return 0; //there should be a lock here..
+
+ return viewport->render_info[p_info];
+}
+
+void VisualServerViewport::viewport_set_debug_draw(RID p_viewport, VS::ViewportDebugDraw p_draw) {
+
+ Viewport *viewport = viewport_owner.getornull(p_viewport);
+ ERR_FAIL_COND(!viewport);
+
+ viewport->debug_draw = p_draw;
+}
+
bool VisualServerViewport::free(RID p_rid) {
if (viewport_owner.owns(p_rid)) {
diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h
index 53ad6bde2b..93227d1c31 100644
--- a/servers/visual/visual_server_viewport.h
+++ b/servers/visual/visual_server_viewport.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,6 +32,7 @@
#include "rasterizer.h"
#include "self_list.h"
+#include "servers/arvr/arvr_interface.h"
#include "servers/visual_server.h"
class VisualServerViewport {
@@ -43,6 +45,8 @@ public:
RID self;
RID parent;
+ bool use_arvr; /* use arvr interface to override camera positioning and projection matrices and control output */
+
Size2i size;
RID camera;
RID scenario;
@@ -58,13 +62,15 @@ public:
bool hide_canvas;
bool disable_environment;
bool disable_3d;
+ bool disable_3d_by_usage;
RID shadow_atlas;
int shadow_atlas_size;
- VS::ViewportClearMode clear_mode;
+ int render_info[VS::VIEWPORT_RENDER_INFO_MAX];
+ VS::ViewportDebugDraw debug_draw;
- bool rendered_in_prev_frame;
+ VS::ViewportClearMode clear_mode;
struct CanvasKey {
@@ -95,11 +101,16 @@ public:
Viewport() {
update_mode = VS::VIEWPORT_UPDATE_WHEN_VISIBLE;
clear_mode = VS::VIEWPORT_CLEAR_ALWAYS;
- rendered_in_prev_frame = false;
disable_environment = false;
viewport_to_screen = 0;
shadow_atlas_size = 0;
disable_3d = false;
+ disable_3d_by_usage = false;
+ debug_draw = VS::VIEWPORT_DEBUG_DRAW_DISABLED;
+ for (int i = 0; i < VS::VIEWPORT_RENDER_INFO_MAX; i++) {
+ render_info[i] = 0;
+ }
+ use_arvr = false;
}
};
@@ -124,11 +135,13 @@ public:
private:
Color clear_color;
- void _draw_viewport(Viewport *p_viewport);
+ void _draw_viewport(Viewport *p_viewport, ARVRInterface::Eyes p_eye = ARVRInterface::EYE_MONO);
public:
RID viewport_create();
+ void viewport_set_use_arvr(RID p_viewport, bool p_use_arvr);
+
void viewport_set_size(RID p_viewport, int p_width, int p_height);
void viewport_attach_to_screen(RID p_viewport, const Rect2 &p_rect = Rect2(), int p_screen = 0);
@@ -163,6 +176,10 @@ public:
void viewport_set_msaa(RID p_viewport, VS::ViewportMSAA p_msaa);
void viewport_set_hdr(RID p_viewport, bool p_enabled);
+ void viewport_set_usage(RID p_viewport, VS::ViewportUsage p_usage);
+
+ virtual int viewport_get_render_info(RID p_viewport, VS::ViewportRenderInfo p_info);
+ virtual void viewport_set_debug_draw(RID p_viewport, VS::ViewportDebugDraw p_draw);
void draw_viewports();
diff --git a/servers/visual/visual_server_wrap_mt.cpp b/servers/visual/visual_server_wrap_mt.cpp
new file mode 100644
index 0000000000..827f47a16e
--- /dev/null
+++ b/servers/visual/visual_server_wrap_mt.cpp
@@ -0,0 +1,193 @@
+/*************************************************************************/
+/* visual_server_wrap_mt.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_wrap_mt.h"
+#include "os/os.h"
+#include "project_settings.h"
+
+void VisualServerWrapMT::thread_exit() {
+
+ exit = true;
+}
+
+void VisualServerWrapMT::thread_draw() {
+
+ draw_mutex->lock();
+
+ draw_pending--;
+ bool draw = (draw_pending == 0); // only draw when no more flushes are pending
+
+ draw_mutex->unlock();
+
+ if (draw) {
+
+ visual_server->draw();
+ }
+}
+
+void VisualServerWrapMT::thread_flush() {
+
+ draw_mutex->lock();
+
+ draw_pending--;
+
+ draw_mutex->unlock();
+}
+
+void VisualServerWrapMT::_thread_callback(void *_instance) {
+
+ VisualServerWrapMT *vsmt = reinterpret_cast<VisualServerWrapMT *>(_instance);
+
+ vsmt->thread_loop();
+}
+
+void VisualServerWrapMT::thread_loop() {
+
+ server_thread = Thread::get_caller_id();
+
+ OS::get_singleton()->make_rendering_thread();
+
+ visual_server->init();
+
+ exit = false;
+ draw_thread_up = true;
+ while (!exit) {
+ // flush commands one by one, until exit is requested
+ command_queue.wait_and_flush_one();
+ }
+
+ command_queue.flush_all(); // flush all
+
+ visual_server->finish();
+}
+
+/* EVENT QUEUING */
+
+void VisualServerWrapMT::sync() {
+
+ if (create_thread) {
+
+ /* TODO: sync with the thread */
+
+ /*
+ ERR_FAIL_COND(!draw_mutex);
+ draw_mutex->lock();
+ draw_pending++; //cambiar por un saferefcount
+ draw_mutex->unlock();
+ */
+ //command_queue.push( this, &VisualServerWrapMT::thread_flush);
+ } else {
+
+ command_queue.flush_all(); //flush all pending from other threads
+ }
+}
+
+void VisualServerWrapMT::draw() {
+
+ if (create_thread) {
+
+ /* TODO: Make it draw
+ ERR_FAIL_COND(!draw_mutex);
+ draw_mutex->lock();
+ draw_pending++; //cambiar por un saferefcount
+ draw_mutex->unlock();
+
+ command_queue.push( this, &VisualServerWrapMT::thread_draw);
+ */
+ } else {
+
+ visual_server->draw();
+ }
+}
+
+void VisualServerWrapMT::init() {
+
+ if (create_thread) {
+
+ draw_mutex = Mutex::create();
+ print_line("CREATING RENDER THREAD");
+ OS::get_singleton()->release_rendering_thread();
+ if (create_thread) {
+ thread = Thread::create(_thread_callback, this);
+ print_line("STARTING RENDER THREAD");
+ }
+ while (!draw_thread_up) {
+ OS::get_singleton()->delay_usec(1000);
+ }
+ print_line("DONE RENDER THREAD");
+ } else {
+
+ visual_server->init();
+ }
+}
+
+void VisualServerWrapMT::finish() {
+
+ if (thread) {
+
+ command_queue.push(this, &VisualServerWrapMT::thread_exit);
+ Thread::wait_to_finish(thread);
+ memdelete(thread);
+
+ texture_free_cached_ids();
+ //mesh_free_cached_ids();
+
+ thread = NULL;
+ } else {
+ visual_server->finish();
+ }
+
+ if (draw_mutex)
+ memdelete(draw_mutex);
+}
+
+VisualServerWrapMT::VisualServerWrapMT(VisualServer *p_contained, bool p_create_thread)
+ : command_queue(p_create_thread) {
+
+ visual_server = p_contained;
+ create_thread = p_create_thread;
+ thread = NULL;
+ draw_mutex = NULL;
+ draw_pending = 0;
+ draw_thread_up = false;
+ alloc_mutex = Mutex::create();
+ pool_max_size = GLOBAL_GET("memory/limits/multithreaded_server/rid_pool_prealloc");
+
+ if (!p_create_thread) {
+ server_thread = Thread::get_caller_id();
+ } else {
+ server_thread = 0;
+ }
+}
+
+VisualServerWrapMT::~VisualServerWrapMT() {
+
+ memdelete(visual_server);
+ memdelete(alloc_mutex);
+ //finish();
+}
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
new file mode 100644
index 0000000000..20223f9651
--- /dev/null
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -0,0 +1,590 @@
+/*************************************************************************/
+/* visual_server_wrap_mt.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_SERVER_WRAP_MT_H
+#define VISUAL_SERVER_WRAP_MT_H
+
+#include "command_queue_mt.h"
+#include "os/thread.h"
+#include "servers/visual_server.h"
+
+/**
+ @author Juan Linietsky <reduzio@gmail.com>
+*/
+class VisualServerWrapMT : public VisualServer {
+
+ // the real visual server
+ mutable VisualServer *visual_server;
+
+ mutable CommandQueueMT command_queue;
+
+ static void _thread_callback(void *_instance);
+ void thread_loop();
+
+ Thread::ID server_thread;
+ volatile bool exit;
+ Thread *thread;
+ volatile bool draw_thread_up;
+ bool create_thread;
+
+ Mutex *draw_mutex;
+ int draw_pending;
+ void thread_draw();
+ void thread_flush();
+
+ void thread_exit();
+
+ Mutex *alloc_mutex;
+
+ int pool_max_size;
+
+//#define DEBUG_SYNC
+
+#ifdef DEBUG_SYNC
+#define SYNC_DEBUG print_line("sync on: " + String(__FUNCTION__));
+#else
+#define SYNC_DEBUG
+#endif
+
+public:
+#define ServerName VisualServer
+#define ServerNameWrapMT VisualServerWrapMT
+#define server_name visual_server
+#include "servers/server_wrap_mt_common.h"
+
+ /* EVENT QUEUING */
+ FUNCRID(texture)
+ FUNC5(texture_allocate, RID, int, int, Image::Format, uint32_t)
+ FUNC3(texture_set_data, RID, const Ref<Image> &, CubeMapSide)
+ FUNC2RC(Ref<Image>, texture_get_data, RID, CubeMapSide)
+ FUNC2(texture_set_flags, RID, uint32_t)
+ FUNC1RC(uint32_t, texture_get_flags, RID)
+ FUNC1RC(Image::Format, texture_get_format, RID)
+ FUNC1RC(uint32_t, texture_get_texid, RID)
+ FUNC1RC(uint32_t, texture_get_width, RID)
+ FUNC1RC(uint32_t, texture_get_height, RID)
+ FUNC3(texture_set_size_override, RID, int, int)
+
+ FUNC3(texture_set_detect_3d_callback, RID, TextureDetectCallback, void *)
+ FUNC3(texture_set_detect_srgb_callback, RID, TextureDetectCallback, void *)
+ FUNC3(texture_set_detect_normal_callback, RID, TextureDetectCallback, void *)
+
+ FUNC2(texture_set_path, RID, const String &)
+ FUNC1RC(String, texture_get_path, RID)
+ FUNC1(texture_set_shrink_all_x2_on_set_data, bool)
+ FUNC1(texture_debug_usage, List<TextureInfo> *)
+
+ FUNC1(textures_keep_original, bool)
+
+ /* SKY API */
+
+ FUNC0R(RID, sky_create)
+ FUNC3(sky_set_texture, RID, RID, int)
+
+ /* SHADER API */
+
+ FUNC0R(RID, shader_create)
+
+ FUNC2(shader_set_code, RID, const String &)
+ FUNC1RC(String, shader_get_code, RID)
+
+ FUNC2SC(shader_get_param_list, RID, List<PropertyInfo> *)
+
+ FUNC3(shader_set_default_texture_param, RID, const StringName &, RID)
+ FUNC2RC(RID, shader_get_default_texture_param, RID, const StringName &)
+
+ /* COMMON MATERIAL API */
+
+ FUNC0R(RID, material_create)
+
+ FUNC2(material_set_shader, RID, RID)
+ FUNC1RC(RID, material_get_shader, RID)
+
+ FUNC3(material_set_param, RID, const StringName &, const Variant &)
+ FUNC2RC(Variant, material_get_param, RID, const StringName &)
+
+ FUNC2(material_set_line_width, RID, float)
+ FUNC2(material_set_next_pass, RID, RID)
+
+ /* MESH API */
+
+ FUNC0R(RID, mesh_create)
+
+ FUNC10(mesh_add_surface, RID, uint32_t, PrimitiveType, const PoolVector<uint8_t> &, int, const PoolVector<uint8_t> &, int, const Rect3 &, const Vector<PoolVector<uint8_t> > &, const Vector<Rect3> &)
+
+ FUNC2(mesh_set_blend_shape_count, RID, int)
+ FUNC1RC(int, mesh_get_blend_shape_count, RID)
+
+ FUNC2(mesh_set_blend_shape_mode, RID, BlendShapeMode)
+ FUNC1RC(BlendShapeMode, mesh_get_blend_shape_mode, RID)
+
+ FUNC3(mesh_surface_set_material, RID, int, RID)
+ FUNC2RC(RID, mesh_surface_get_material, RID, int)
+
+ FUNC2RC(int, mesh_surface_get_array_len, RID, int)
+ FUNC2RC(int, mesh_surface_get_array_index_len, RID, int)
+
+ FUNC2RC(PoolVector<uint8_t>, mesh_surface_get_array, RID, int)
+ FUNC2RC(PoolVector<uint8_t>, mesh_surface_get_index_array, RID, int)
+
+ FUNC2RC(uint32_t, mesh_surface_get_format, RID, int)
+ FUNC2RC(PrimitiveType, mesh_surface_get_primitive_type, RID, int)
+
+ FUNC2RC(Rect3, mesh_surface_get_aabb, RID, int)
+ FUNC2RC(Vector<PoolVector<uint8_t> >, mesh_surface_get_blend_shapes, RID, int)
+ FUNC2RC(Vector<Rect3>, mesh_surface_get_skeleton_aabb, RID, int)
+
+ FUNC2(mesh_remove_surface, RID, int)
+ FUNC1RC(int, mesh_get_surface_count, RID)
+
+ FUNC2(mesh_set_custom_aabb, RID, const Rect3 &)
+ FUNC1RC(Rect3, mesh_get_custom_aabb, RID)
+
+ FUNC1(mesh_clear, RID)
+
+ /* MULTIMESH API */
+
+ FUNC0R(RID, multimesh_create)
+
+ FUNC4(multimesh_allocate, RID, int, MultimeshTransformFormat, MultimeshColorFormat)
+ FUNC1RC(int, multimesh_get_instance_count, RID)
+
+ FUNC2(multimesh_set_mesh, RID, RID)
+ FUNC3(multimesh_instance_set_transform, RID, int, const Transform &)
+ FUNC3(multimesh_instance_set_transform_2d, RID, int, const Transform2D &)
+ FUNC3(multimesh_instance_set_color, RID, int, const Color &)
+
+ FUNC1RC(RID, multimesh_get_mesh, RID)
+ FUNC1RC(Rect3, multimesh_get_aabb, RID)
+
+ FUNC2RC(Transform, multimesh_instance_get_transform, RID, int)
+ FUNC2RC(Transform2D, multimesh_instance_get_transform_2d, RID, int)
+ FUNC2RC(Color, multimesh_instance_get_color, RID, int)
+
+ FUNC2(multimesh_set_visible_instances, RID, int)
+ FUNC1RC(int, multimesh_get_visible_instances, RID)
+
+ /* IMMEDIATE API */
+
+ FUNC0R(RID, immediate_create)
+ FUNC3(immediate_begin, RID, PrimitiveType, RID)
+ FUNC2(immediate_vertex, RID, const Vector3 &)
+ FUNC2(immediate_normal, RID, const Vector3 &)
+ FUNC2(immediate_tangent, RID, const Plane &)
+ FUNC2(immediate_color, RID, const Color &)
+ FUNC2(immediate_uv, RID, const Vector2 &)
+ FUNC2(immediate_uv2, RID, const Vector2 &)
+ FUNC1(immediate_end, RID)
+ FUNC1(immediate_clear, RID)
+ FUNC2(immediate_set_material, RID, RID)
+ FUNC1RC(RID, immediate_get_material, RID)
+
+ /* SKELETON API */
+
+ FUNC0R(RID, skeleton_create)
+ FUNC3(skeleton_allocate, RID, int, bool)
+ FUNC1RC(int, skeleton_get_bone_count, RID)
+ FUNC3(skeleton_bone_set_transform, RID, int, const Transform &)
+ FUNC2RC(Transform, skeleton_bone_get_transform, RID, int)
+ FUNC3(skeleton_bone_set_transform_2d, RID, int, const Transform2D &)
+ FUNC2RC(Transform2D, skeleton_bone_get_transform_2d, RID, int)
+
+ /* Light API */
+
+ FUNC1R(RID, light_create, LightType)
+
+ FUNC2(light_set_color, RID, const Color &)
+ FUNC3(light_set_param, RID, LightParam, float)
+ FUNC2(light_set_shadow, RID, bool)
+ FUNC2(light_set_shadow_color, RID, const Color &)
+ FUNC2(light_set_projector, RID, RID)
+ FUNC2(light_set_negative, RID, bool)
+ FUNC2(light_set_cull_mask, RID, uint32_t)
+
+ FUNC2(light_omni_set_shadow_mode, RID, LightOmniShadowMode)
+ FUNC2(light_omni_set_shadow_detail, RID, LightOmniShadowDetail)
+
+ FUNC2(light_directional_set_shadow_mode, RID, LightDirectionalShadowMode)
+ FUNC2(light_directional_set_blend_splits, RID, bool)
+
+ /* PROBE API */
+
+ FUNC0R(RID, reflection_probe_create)
+
+ FUNC2(reflection_probe_set_update_mode, RID, ReflectionProbeUpdateMode)
+ FUNC2(reflection_probe_set_intensity, RID, float)
+ FUNC2(reflection_probe_set_interior_ambient, RID, const Color &)
+ FUNC2(reflection_probe_set_interior_ambient_energy, RID, float)
+ FUNC2(reflection_probe_set_interior_ambient_probe_contribution, RID, float)
+ FUNC2(reflection_probe_set_max_distance, RID, float)
+ FUNC2(reflection_probe_set_extents, RID, const Vector3 &)
+ FUNC2(reflection_probe_set_origin_offset, RID, const Vector3 &)
+ FUNC2(reflection_probe_set_as_interior, RID, bool)
+ FUNC2(reflection_probe_set_enable_box_projection, RID, bool)
+ FUNC2(reflection_probe_set_enable_shadows, RID, bool)
+ FUNC2(reflection_probe_set_cull_mask, RID, uint32_t)
+
+ /* ROOM API */
+
+ FUNC0R(RID, room_create)
+ FUNC4(room_add_bounds, RID, const PoolVector<Vector2> &, float, const Transform &)
+ FUNC1(room_clear_bounds, RID)
+
+ /* PORTAL API */
+
+ // portals are only (x/y) points, forming a convex shape, which its clockwise
+ // order points outside. (z is 0);
+
+ FUNC0R(RID, portal_create)
+ FUNC2(portal_set_shape, RID, const Vector<Point2> &)
+ FUNC2(portal_set_enabled, RID, bool)
+ FUNC2(portal_set_disable_distance, RID, float)
+ FUNC2(portal_set_disabled_color, RID, const Color &)
+
+ /* BAKED LIGHT API */
+
+ FUNC0R(RID, gi_probe_create)
+
+ FUNC2(gi_probe_set_bounds, RID, const Rect3 &)
+ FUNC1RC(Rect3, gi_probe_get_bounds, RID)
+
+ FUNC2(gi_probe_set_cell_size, RID, float)
+ FUNC1RC(float, gi_probe_get_cell_size, RID)
+
+ FUNC2(gi_probe_set_to_cell_xform, RID, const Transform &)
+ FUNC1RC(Transform, gi_probe_get_to_cell_xform, RID)
+
+ FUNC2(gi_probe_set_dynamic_range, RID, int)
+ FUNC1RC(int, gi_probe_get_dynamic_range, RID)
+
+ FUNC2(gi_probe_set_energy, RID, float)
+ FUNC1RC(float, gi_probe_get_energy, RID)
+
+ FUNC2(gi_probe_set_bias, RID, float)
+ FUNC1RC(float, gi_probe_get_bias, RID)
+
+ FUNC2(gi_probe_set_normal_bias, RID, float)
+ FUNC1RC(float, gi_probe_get_normal_bias, RID)
+
+ FUNC2(gi_probe_set_propagation, RID, float)
+ FUNC1RC(float, gi_probe_get_propagation, RID)
+
+ FUNC2(gi_probe_set_interior, RID, bool)
+ FUNC1RC(bool, gi_probe_is_interior, RID)
+
+ FUNC2(gi_probe_set_compress, RID, bool)
+ FUNC1RC(bool, gi_probe_is_compressed, RID)
+
+ FUNC2(gi_probe_set_dynamic_data, RID, const PoolVector<int> &)
+ FUNC1RC(PoolVector<int>, gi_probe_get_dynamic_data, RID)
+
+ /* PARTICLES */
+
+ FUNC0R(RID, particles_create)
+
+ FUNC2(particles_set_emitting, RID, bool)
+ FUNC2(particles_set_amount, RID, int)
+ FUNC2(particles_set_lifetime, RID, float)
+ FUNC2(particles_set_one_shot, RID, bool)
+ FUNC2(particles_set_pre_process_time, RID, float)
+ FUNC2(particles_set_explosiveness_ratio, RID, float)
+ FUNC2(particles_set_randomness_ratio, RID, float)
+ FUNC2(particles_set_custom_aabb, RID, const Rect3 &)
+ FUNC2(particles_set_speed_scale, RID, float)
+ FUNC2(particles_set_use_local_coordinates, RID, bool)
+ FUNC2(particles_set_process_material, RID, RID)
+ FUNC2(particles_set_fixed_fps, RID, int)
+ FUNC2(particles_set_fractional_delta, RID, bool)
+ FUNC1(particles_restart, RID)
+
+ FUNC2(particles_set_draw_order, RID, VS::ParticlesDrawOrder)
+
+ FUNC2(particles_set_draw_passes, RID, int)
+ FUNC3(particles_set_draw_pass_mesh, RID, int, RID)
+ FUNC2(particles_set_emission_transform, RID, const Transform &)
+
+ FUNC1R(Rect3, particles_get_current_aabb, RID)
+
+ /* CAMERA API */
+
+ FUNC0R(RID, camera_create)
+ FUNC4(camera_set_perspective, RID, float, float, float)
+ FUNC4(camera_set_orthogonal, RID, float, float, float)
+ FUNC2(camera_set_transform, RID, const Transform &)
+ FUNC2(camera_set_cull_mask, RID, uint32_t)
+ FUNC2(camera_set_environment, RID, RID)
+ FUNC2(camera_set_use_vertical_aspect, RID, bool)
+
+ /* VIEWPORT TARGET API */
+
+ FUNC0R(RID, viewport_create)
+
+ FUNC2(viewport_set_use_arvr, RID, bool)
+
+ FUNC3(viewport_set_size, RID, int, int)
+
+ FUNC2(viewport_set_active, RID, bool)
+ FUNC2(viewport_set_parent_viewport, RID, RID)
+
+ FUNC2(viewport_set_clear_mode, RID, ViewportClearMode)
+
+ FUNC3(viewport_attach_to_screen, RID, const Rect2 &, int)
+ FUNC1(viewport_detach, RID)
+
+ FUNC2(viewport_set_update_mode, RID, ViewportUpdateMode)
+ FUNC2(viewport_set_vflip, RID, bool)
+
+ FUNC1RC(RID, viewport_get_texture, RID)
+
+ FUNC2(viewport_set_hide_scenario, RID, bool)
+ FUNC2(viewport_set_hide_canvas, RID, bool)
+ FUNC2(viewport_set_disable_environment, RID, bool)
+ FUNC2(viewport_set_disable_3d, RID, bool)
+
+ FUNC2(viewport_attach_camera, RID, RID)
+ FUNC2(viewport_set_scenario, RID, RID)
+ FUNC2(viewport_attach_canvas, RID, RID)
+
+ FUNC2(viewport_remove_canvas, RID, RID)
+ FUNC3(viewport_set_canvas_transform, RID, RID, const Transform2D &)
+ FUNC2(viewport_set_transparent_background, RID, bool)
+
+ FUNC2(viewport_set_global_canvas_transform, RID, const Transform2D &)
+ FUNC3(viewport_set_canvas_layer, RID, RID, int)
+ FUNC2(viewport_set_shadow_atlas_size, RID, int)
+ FUNC3(viewport_set_shadow_atlas_quadrant_subdivision, RID, int, int)
+ FUNC2(viewport_set_msaa, RID, ViewportMSAA)
+ FUNC2(viewport_set_hdr, RID, bool)
+ FUNC2(viewport_set_usage, RID, ViewportUsage)
+
+ //this passes directly to avoid stalling, but it's pretty dangerous, so dont call after freeing a viewport
+ virtual int viewport_get_render_info(RID p_viewport, ViewportRenderInfo p_info) {
+ return visual_server->viewport_get_render_info(p_viewport, p_info);
+ }
+
+ FUNC2(viewport_set_debug_draw, RID, ViewportDebugDraw)
+
+ /* ENVIRONMENT API */
+
+ FUNC0R(RID, environment_create)
+
+ FUNC2(environment_set_background, RID, EnvironmentBG)
+ FUNC2(environment_set_sky, RID, RID)
+ FUNC2(environment_set_sky_scale, RID, float)
+ FUNC2(environment_set_bg_color, RID, const Color &)
+ FUNC2(environment_set_bg_energy, RID, float)
+ FUNC2(environment_set_canvas_max_layer, RID, int)
+ FUNC4(environment_set_ambient_light, RID, const Color &, float, float)
+ FUNC7(environment_set_ssr, RID, bool, int, float, float, float, bool)
+ FUNC10(environment_set_ssao, RID, bool, float, float, float, float, float, float, const Color &, bool)
+
+ FUNC6(environment_set_dof_blur_near, RID, bool, float, float, float, EnvironmentDOFBlurQuality)
+ FUNC6(environment_set_dof_blur_far, RID, bool, float, float, float, EnvironmentDOFBlurQuality)
+ FUNC10(environment_set_glow, RID, bool, int, float, float, float, EnvironmentGlowBlendMode, float, float, bool)
+
+ FUNC9(environment_set_tonemap, RID, EnvironmentToneMapper, float, float, bool, float, float, float, float)
+
+ FUNC6(environment_set_adjustment, RID, bool, float, float, float, RID)
+
+ FUNC5(environment_set_fog, RID, bool, const Color &, const Color &, float)
+ FUNC6(environment_set_fog_depth, RID, bool, float, float, bool, float)
+ FUNC5(environment_set_fog_height, RID, bool, float, float, float)
+
+ FUNC0R(RID, scenario_create)
+
+ FUNC2(scenario_set_debug, RID, ScenarioDebugMode)
+ FUNC2(scenario_set_environment, RID, RID)
+ FUNC3(scenario_set_reflection_atlas_size, RID, int, int)
+ FUNC2(scenario_set_fallback_environment, RID, RID)
+
+ /* INSTANCING API */
+ // from can be mesh, light, area and portal so far.
+ FUNC0R(RID, instance_create)
+
+ FUNC2(instance_set_base, RID, RID) // from can be mesh, light, poly, area and portal so far.
+ FUNC2(instance_set_scenario, RID, RID) // from can be mesh, light, poly, area and portal so far.
+ FUNC2(instance_set_layer_mask, RID, uint32_t)
+ FUNC2(instance_set_transform, RID, const Transform &)
+ FUNC2(instance_attach_object_instance_id, RID, ObjectID)
+ FUNC3(instance_set_blend_shape_weight, RID, int, float)
+ FUNC3(instance_set_surface_material, RID, int, RID)
+ FUNC2(instance_set_visible, RID, bool)
+
+ FUNC2(instance_attach_skeleton, RID, RID)
+ FUNC2(instance_set_exterior, RID, bool)
+ FUNC2(instance_set_room, RID, RID)
+
+ FUNC2(instance_set_extra_visibility_margin, RID, real_t)
+
+ // don't use these in a game!
+ FUNC2RC(Vector<ObjectID>, instances_cull_aabb, const Rect3 &, RID)
+ FUNC3RC(Vector<ObjectID>, instances_cull_ray, const Vector3 &, const Vector3 &, RID)
+ FUNC2RC(Vector<ObjectID>, instances_cull_convex, const Vector<Plane> &, RID)
+
+ FUNC3(instance_geometry_set_flag, RID, InstanceFlags, bool)
+ FUNC2(instance_geometry_set_cast_shadows_setting, RID, ShadowCastingSetting)
+ FUNC2(instance_geometry_set_material_override, RID, RID)
+
+ FUNC5(instance_geometry_set_draw_range, RID, float, float, float, float)
+ FUNC2(instance_geometry_set_as_instance_lod, RID, RID)
+
+ /* CANVAS (2D) */
+
+ FUNC0R(RID, canvas_create)
+ FUNC3(canvas_set_item_mirroring, RID, RID, const Point2 &)
+ FUNC2(canvas_set_modulate, RID, const Color &)
+
+ FUNC0R(RID, canvas_item_create)
+ FUNC2(canvas_item_set_parent, RID, RID)
+
+ FUNC2(canvas_item_set_visible, RID, bool)
+ FUNC2(canvas_item_set_light_mask, RID, int)
+
+ FUNC2(canvas_item_set_transform, RID, const Transform2D &)
+ FUNC2(canvas_item_set_clip, RID, bool)
+ FUNC2(canvas_item_set_distance_field_mode, RID, bool)
+ FUNC3(canvas_item_set_custom_rect, RID, bool, const Rect2 &)
+ FUNC2(canvas_item_set_modulate, RID, const Color &)
+ FUNC2(canvas_item_set_self_modulate, RID, const Color &)
+
+ FUNC2(canvas_item_set_draw_behind_parent, RID, bool)
+
+ FUNC6(canvas_item_add_line, RID, const Point2 &, const Point2 &, const Color &, float, bool)
+ FUNC5(canvas_item_add_polyline, RID, const Vector<Point2> &, const Vector<Color> &, float, bool)
+ FUNC3(canvas_item_add_rect, RID, const Rect2 &, const Color &)
+ FUNC4(canvas_item_add_circle, RID, const Point2 &, float, const Color &)
+ FUNC7(canvas_item_add_texture_rect, RID, const Rect2 &, RID, bool, const Color &, bool, RID)
+ FUNC8(canvas_item_add_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, bool, RID, bool)
+ FUNC11(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &, RID)
+ FUNC7(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, float, RID)
+ FUNC6(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, RID)
+ FUNC8(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, int, RID)
+ FUNC3(canvas_item_add_mesh, RID, const RID &, RID)
+ FUNC3(canvas_item_add_multimesh, RID, RID, RID)
+ FUNC6(canvas_item_add_particles, RID, RID, RID, RID, int, int)
+ FUNC2(canvas_item_add_set_transform, RID, const Transform2D &)
+ FUNC2(canvas_item_add_clip_ignore, RID, bool)
+ FUNC2(canvas_item_set_sort_children_by_y, RID, bool)
+ FUNC2(canvas_item_set_z, RID, int)
+ FUNC2(canvas_item_set_z_as_relative_to_parent, RID, bool)
+ FUNC3(canvas_item_set_copy_to_backbuffer, RID, bool, const Rect2 &)
+
+ FUNC1(canvas_item_clear, RID)
+ FUNC2(canvas_item_set_draw_index, RID, int)
+
+ FUNC2(canvas_item_set_material, RID, RID)
+
+ FUNC2(canvas_item_set_use_parent_material, RID, bool)
+
+ FUNC0R(RID, canvas_light_create)
+ FUNC2(canvas_light_attach_to_canvas, RID, RID)
+ FUNC2(canvas_light_set_enabled, RID, bool)
+ FUNC2(canvas_light_set_scale, RID, float)
+ FUNC2(canvas_light_set_transform, RID, const Transform2D &)
+ FUNC2(canvas_light_set_texture, RID, RID)
+ FUNC2(canvas_light_set_texture_offset, RID, const Vector2 &)
+ FUNC2(canvas_light_set_color, RID, const Color &)
+ FUNC2(canvas_light_set_height, RID, float)
+ FUNC2(canvas_light_set_energy, RID, float)
+ FUNC3(canvas_light_set_z_range, RID, int, int)
+ FUNC3(canvas_light_set_layer_range, RID, int, int)
+ FUNC2(canvas_light_set_item_cull_mask, RID, int)
+ FUNC2(canvas_light_set_item_shadow_cull_mask, RID, int)
+
+ FUNC2(canvas_light_set_mode, RID, CanvasLightMode)
+
+ FUNC2(canvas_light_set_shadow_enabled, RID, bool)
+ FUNC2(canvas_light_set_shadow_buffer_size, RID, int)
+ FUNC2(canvas_light_set_shadow_gradient_length, RID, float)
+ FUNC2(canvas_light_set_shadow_filter, RID, CanvasLightShadowFilter)
+ FUNC2(canvas_light_set_shadow_color, RID, const Color &)
+ FUNC2(canvas_light_set_shadow_smooth, RID, float)
+
+ FUNC0R(RID, canvas_light_occluder_create)
+ FUNC2(canvas_light_occluder_attach_to_canvas, RID, RID)
+ FUNC2(canvas_light_occluder_set_enabled, RID, bool)
+ FUNC2(canvas_light_occluder_set_polygon, RID, RID)
+ FUNC2(canvas_light_occluder_set_transform, RID, const Transform2D &)
+ FUNC2(canvas_light_occluder_set_light_mask, RID, int)
+
+ FUNC0R(RID, canvas_occluder_polygon_create)
+ FUNC3(canvas_occluder_polygon_set_shape, RID, const PoolVector<Vector2> &, bool)
+ FUNC2(canvas_occluder_polygon_set_shape_as_lines, RID, const PoolVector<Vector2> &)
+
+ FUNC2(canvas_occluder_polygon_set_cull_mode, RID, CanvasOccluderPolygonCullMode)
+
+ /* BLACK BARS */
+
+ FUNC4(black_bars_set_margins, int, int, int, int)
+ FUNC4(black_bars_set_images, RID, RID, RID, RID)
+
+ /* FREE */
+
+ FUNC1(free, RID)
+
+ /* EVENT QUEUING */
+
+ FUNC3(request_frame_drawn_callback, Object *, const StringName &, const Variant &)
+
+ virtual void init();
+ virtual void finish();
+ virtual void draw();
+ virtual void sync();
+ FUNC0RC(bool, has_changed)
+
+ /* RENDER INFO */
+
+ //this passes directly to avoid stalling
+ virtual int get_render_info(RenderInfo p_info) {
+ return visual_server->get_render_info(p_info);
+ }
+
+ FUNC3(set_boot_image, const Ref<Image> &, const Color &, bool)
+ FUNC1(set_default_clear_color, const Color &)
+
+ FUNC0R(RID, get_test_cube)
+
+ FUNC1(set_debug_generate_wireframes, bool)
+
+ virtual bool has_feature(Features p_feature) const { return visual_server->has_feature(p_feature); }
+ virtual bool has_os_feature(const String &p_feature) const { return visual_server->has_os_feature(p_feature); }
+
+ VisualServerWrapMT(VisualServer *p_contained, bool p_create_thread);
+ ~VisualServerWrapMT();
+
+#undef ServerName
+#undef ServerNameWrapMT
+#undef server_name
+};
+
+#ifdef DEBUG_SYNC
+#undef DEBUG_SYNC
+#endif
+#undef SYNC_DEBUG
+
+#endif
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index a28c409b97..65dd4d7661 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "visual_server.h"
-#include "global_config.h"
-#include "method_bind_ext.inc"
+#include "method_bind_ext.gen.inc"
+#include "project_settings.h"
VisualServer *VisualServer::singleton = NULL;
VisualServer *(*VisualServer::create_func)() = NULL;
@@ -67,10 +68,11 @@ VisualServer *VisualServer::create() {
return NULL;
}
-RID VisualServer::texture_create_from_image(const Image &p_image, uint32_t p_flags) {
+RID VisualServer::texture_create_from_image(const Ref<Image> &p_image, uint32_t p_flags) {
+ ERR_FAIL_COND_V(!p_image.is_valid(), RID());
RID texture = texture_create();
- texture_allocate(texture, p_image.get_width(), p_image.get_height(), p_image.get_format(), p_flags); //if it has mipmaps, use, else generate
+ texture_allocate(texture, p_image->get_width(), p_image->get_height(), p_image->get_format(), p_flags); //if it has mipmaps, use, else generate
ERR_FAIL_COND_V(!texture.is_valid(), texture);
texture_set_data(texture, p_image);
@@ -119,12 +121,12 @@ RID VisualServer::get_test_texture() {
}
}
- Image data(TEST_TEXTURE_SIZE, TEST_TEXTURE_SIZE, false, Image::FORMAT_RGB8, test_data);
+ Ref<Image> data = memnew(Image(TEST_TEXTURE_SIZE, TEST_TEXTURE_SIZE, false, Image::FORMAT_RGB8, test_data));
test_texture = texture_create_from_image(data);
return test_texture;
-};
+}
void VisualServer::_free_internal_rids() {
@@ -134,11 +136,6 @@ void VisualServer::_free_internal_rids() {
free(white_texture);
if (test_material.is_valid())
free(test_material);
-
- for (int i = 0; i < 16; i++) {
- if (material_2d[i].is_valid())
- free(material_2d[i]);
- }
}
RID VisualServer::_make_test_cube() {
@@ -282,35 +279,6 @@ RID VisualServer::make_sphere_mesh(int p_lats, int p_lons, float p_radius) {
return mesh;
}
-RID VisualServer::material_2d_get(bool p_shaded, bool p_transparent, bool p_cut_alpha, bool p_opaque_prepass) {
-
- int version = 0;
- if (p_shaded)
- version = 1;
- if (p_transparent)
- version |= 2;
- if (p_cut_alpha)
- version |= 4;
- if (p_opaque_prepass)
- version |= 8;
- if (material_2d[version].is_valid())
- return material_2d[version];
-
- //not valid, make
-
- /* material_2d[version]=fixed_material_create();
- fixed_material_set_flag(material_2d[version],FIXED_MATERIAL_FLAG_USE_ALPHA,p_transparent);
- fixed_material_set_flag(material_2d[version],FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY,true);
- fixed_material_set_flag(material_2d[version],FIXED_MATERIAL_FLAG_DISCARD_ALPHA,p_cut_alpha);
- material_set_flag(material_2d[version],MATERIAL_FLAG_UNSHADED,!p_shaded);
- material_set_flag(material_2d[version],MATERIAL_FLAG_DOUBLE_SIDED,true);
- material_set_depth_draw_mode(material_2d[version],p_opaque_prepass?MATERIAL_DEPTH_DRAW_OPAQUE_PRE_PASS_ALPHA:MATERIAL_DEPTH_DRAW_OPAQUE_ONLY);
- fixed_material_set_texture(material_2d[version],FIXED_MATERIAL_PARAM_DIFFUSE,get_white_texture());
- //material cut alpha?*/
-
- return material_2d[version];
-}
-
RID VisualServer::get_white_texture() {
if (white_texture.is_valid())
@@ -323,7 +291,7 @@ RID VisualServer::get_white_texture() {
for (int i = 0; i < 16 * 3; i++)
w[i] = 255;
}
- Image white(4, 4, 0, Image::FORMAT_RGB8, wt);
+ Ref<Image> white = memnew(Image(4, 4, 0, Image::FORMAT_RGB8, wt));
white_texture = texture_create();
texture_allocate(white_texture, 4, 4, Image::FORMAT_RGB8);
texture_set_data(white_texture, white);
@@ -336,8 +304,6 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
PoolVector<uint8_t>::Write iw;
if (r_index_array.size()) {
- print_line("elements: " + itos(r_index_array.size()));
-
iw = r_index_array.write();
}
@@ -397,7 +363,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
}
}
- r_aabb = Rect3(Vector3(aabb.pos.x, aabb.pos.y, 0), Vector3(aabb.size.x, aabb.size.y, 0));
+ r_aabb = Rect3(Vector3(aabb.position.x, aabb.position.y, 0), Vector3(aabb.size.x, aabb.size.y, 0));
} else {
PoolVector<Vector3> array = p_arrays[ai];
@@ -463,7 +429,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
for (int i = 0; i < p_vertex_array_len; i++) {
- uint8_t vector[4] = {
+ int8_t vector[4] = {
CLAMP(src[i].x * 127, -128, 127),
CLAMP(src[i].y * 127, -128, 127),
CLAMP(src[i].z * 127, -128, 127),
@@ -768,7 +734,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
if (bptr->size.x < 0) {
//first
bptr[idx] = Rect3();
- bptr[idx].pos = v;
+ bptr[idx].position = v;
any_valid = true;
} else {
bptr[idx].expand_to(v);
@@ -1231,11 +1197,12 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, PoolVector<uint8_
if (p_format & ARRAY_COMPRESS_NORMAL) {
PoolVector<Vector3>::Write w = arr.write();
+ const float multiplier = 1.f / 127.f;
for (int j = 0; j < p_vertex_len; j++) {
- const uint8_t *v = (const uint8_t *)&r[j * total_elem_size + offsets[i]];
- w[j] = Vector3(float(v[0] / 255.0) * 2.0 - 1.0, float(v[1] / 255.0) * 2.0 - 1.0, float(v[2] / 255.0) * 2.0 - 1.0);
+ const int8_t *v = (const int8_t *)&r[j * total_elem_size + offsets[i]];
+ w[j] = Vector3(float(v[0]) * multiplier, float(v[1]) * multiplier, float(v[2]) * multiplier);
}
} else {
PoolVector<Vector3>::Write w = arr.write();
@@ -1259,9 +1226,9 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, PoolVector<uint8_
for (int j = 0; j < p_vertex_len; j++) {
- const uint8_t *v = (const uint8_t *)&r[j * total_elem_size + offsets[i]];
+ const int8_t *v = (const int8_t *)&r[j * total_elem_size + offsets[i]];
for (int k = 0; k < 4; k++) {
- w[j * 4 + k] = float(v[k] / 255.0) * 2.0 - 1.0;
+ w[j * 4 + k] = float(v[k] / 127.0);
}
}
} else {
@@ -1291,7 +1258,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, PoolVector<uint8_
for (int j = 0; j < p_vertex_len; j++) {
const uint8_t *v = (const uint8_t *)&r[j * total_elem_size + offsets[i]];
- w[j] = Color(float(v[0] / 255.0) * 2.0 - 1.0, float(v[1] / 255.0) * 2.0 - 1.0, float(v[2] / 255.0) * 2.0 - 1.0, float(v[3] / 255.0) * 2.0 - 1.0);
+ w[j] = Color(float(v[0] / 255.0), float(v[1] / 255.0), float(v[2] / 255.0), float(v[3] / 255.0));
}
} else {
PoolVector<Color>::Write w = arr.write();
@@ -1472,14 +1439,14 @@ Array VisualServer::mesh_surface_get_arrays(RID p_mesh, int p_surface) const {
void VisualServer::_bind_methods() {
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_create_from_image", "image", "flags"), &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(D_METHOD("texture_set_flags", "texture", "flags"), &VisualServer::texture_set_flags);
+ ClassDB::bind_method(D_METHOD("texture_get_flags", "texture"), &VisualServer::texture_get_flags);
+ ClassDB::bind_method(D_METHOD("texture_get_width", "texture"), &VisualServer::texture_get_width);
+ ClassDB::bind_method(D_METHOD("texture_get_height", "texture"), &VisualServer::texture_get_height);
ClassDB::bind_method(D_METHOD("texture_set_shrink_all_x2_on_set_data", "shrink"), &VisualServer::texture_set_shrink_all_x2_on_set_data);
}
@@ -1564,6 +1531,39 @@ VisualServer::VisualServer() {
//ERR_FAIL_COND(singleton);
singleton = this;
+ GLOBAL_DEF("rendering/vram_compression/import_s3tc", true);
+ GLOBAL_DEF("rendering/vram_compression/import_etc", false);
+ GLOBAL_DEF("rendering/vram_compression/import_etc2", true);
+ GLOBAL_DEF("rendering/vram_compression/import_pvrtc", false);
+
+ GLOBAL_DEF("rendering/quality/directional_shadow/size", 4096);
+ GLOBAL_DEF("rendering/quality/directional_shadow/size.mobile", 2048);
+ GLOBAL_DEF("rendering/quality/shadow_atlas/size", 4096);
+ GLOBAL_DEF("rendering/quality/shadow_atlas/size.mobile", 2048);
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/shadow_atlas/size", PropertyInfo(Variant::INT, "rendering/quality/shadow_atlas/size", PROPERTY_HINT_RANGE, "256,16384"));
+ GLOBAL_DEF("rendering/quality/shadow_atlas/quadrant_0_subdiv", 1);
+ GLOBAL_DEF("rendering/quality/shadow_atlas/quadrant_1_subdiv", 2);
+ GLOBAL_DEF("rendering/quality/shadow_atlas/quadrant_2_subdiv", 3);
+ GLOBAL_DEF("rendering/quality/shadow_atlas/quadrant_3_subdiv", 4);
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/shadow_atlas/quadrant_0_subdiv", PropertyInfo(Variant::INT, "rendering/quality/shadow_atlas/quadrant_0_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"));
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/shadow_atlas/quadrant_1_subdiv", PropertyInfo(Variant::INT, "rendering/quality/shadow_atlas/quadrant_1_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"));
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/shadow_atlas/quadrant_2_subdiv", PropertyInfo(Variant::INT, "rendering/quality/shadow_atlas/quadrant_2_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"));
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/shadow_atlas/quadrant_3_subdiv", PropertyInfo(Variant::INT, "rendering/quality/shadow_atlas/quadrant_3_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"));
+
+ GLOBAL_DEF("rendering/quality/shadows/filter_mode", 1);
+ GLOBAL_DEF("rendering/quality/shadows/filter_mode.mobile", 0);
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/shadows/filter_mode", PropertyInfo(Variant::INT, "rendering/quality/shadows/filter_mode", PROPERTY_HINT_ENUM, "Disabled,PCF5,PCF13"));
+
+ GLOBAL_DEF("rendering/quality/reflections/texture_array_reflections", true);
+ GLOBAL_DEF("rendering/quality/reflections/texture_array_reflections.mobile", false);
+ GLOBAL_DEF("rendering/quality/reflections/high_quality_ggx", true);
+ GLOBAL_DEF("rendering/quality/reflections/high_quality_ggx.mobile", false);
+
+ GLOBAL_DEF("rendering/quality/shading/force_vertex_shading", false);
+ GLOBAL_DEF("rendering/quality/shading/force_vertex_shading.mobile", true);
+
+ GLOBAL_DEF("rendering/quality/depth_prepass/enable", true);
+ GLOBAL_DEF("rendering/quality/depth_prepass/disable_for_vendors", "PowerVR,Mali,Adreno");
}
VisualServer::~VisualServer() {
diff --git a/servers/visual_server.h b/servers/visual_server.h
index dfa253ff25..ddf32a9ea1 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,6 +32,7 @@
#include "bsp_tree.h"
#include "geometry.h"
+#include "image.h"
#include "math_2d.h"
#include "object.h"
#include "rid.h"
@@ -58,7 +60,6 @@ protected:
RID test_texture;
RID white_texture;
RID test_material;
- RID material_2d[16];
Error _surface_set_data(Array p_arrays, uint32_t p_format, uint32_t *p_offsets, uint32_t p_stride, PoolVector<uint8_t> &r_vertex_array, int p_vertex_array_len, PoolVector<uint8_t> &r_index_array, int p_index_array_len, Rect3 &r_aabb, Vector<Rect3> r_bone_aabb);
@@ -105,13 +106,14 @@ public:
};
virtual RID texture_create() = 0;
- RID texture_create_from_image(const Image &p_image, uint32_t p_flags = TEXTURE_FLAGS_DEFAULT); // helper
+ RID texture_create_from_image(const Ref<Image> &p_image, uint32_t p_flags = TEXTURE_FLAGS_DEFAULT); // helper
virtual void texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags = TEXTURE_FLAGS_DEFAULT) = 0;
- virtual void texture_set_data(RID p_texture, const Image &p_image, CubeMapSide p_cube_side = CUBEMAP_LEFT) = 0;
- virtual Image texture_get_data(RID p_texture, CubeMapSide p_cube_side = CUBEMAP_LEFT) const = 0;
+ virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, CubeMapSide p_cube_side = CUBEMAP_LEFT) = 0;
+ virtual Ref<Image> texture_get_data(RID p_texture, CubeMapSide p_cube_side = CUBEMAP_LEFT) const = 0;
virtual void texture_set_flags(RID p_texture, uint32_t p_flags) = 0;
virtual uint32_t texture_get_flags(RID p_texture) const = 0;
virtual Image::Format texture_get_format(RID p_texture) const = 0;
+ virtual uint32_t texture_get_texid(RID p_texture) const = 0;
virtual uint32_t texture_get_width(RID p_texture) const = 0;
virtual uint32_t texture_get_height(RID p_texture) const = 0;
virtual void texture_set_size_override(RID p_texture, int p_width, int p_height) = 0;
@@ -125,6 +127,7 @@ public:
virtual void texture_set_detect_3d_callback(RID p_texture, TextureDetectCallback p_callback, void *p_userdata) = 0;
virtual void texture_set_detect_srgb_callback(RID p_texture, TextureDetectCallback p_callback, void *p_userdata) = 0;
+ virtual void texture_set_detect_normal_callback(RID p_texture, TextureDetectCallback p_callback, void *p_userdata) = 0;
struct TextureInfo {
RID texture;
@@ -138,10 +141,10 @@ public:
virtual void textures_keep_original(bool p_enable) = 0;
- /* SKYBOX API */
+ /* SKY API */
- virtual RID skybox_create() = 0;
- virtual void skybox_set_texture(RID p_skybox, RID p_cube_map, int p_radiance_size) = 0;
+ virtual RID sky_create() = 0;
+ virtual void sky_set_texture(RID p_sky, RID p_cube_map, int p_radiance_size) = 0;
/* SHADER API */
@@ -153,10 +156,7 @@ public:
SHADER_MAX
};
- virtual RID shader_create(ShaderMode p_mode = SHADER_SPATIAL) = 0;
-
- virtual void shader_set_mode(RID p_shader, ShaderMode p_mode) = 0;
- virtual ShaderMode shader_get_mode(RID p_shader) const = 0;
+ virtual RID shader_create() = 0;
virtual void shader_set_code(RID p_shader, const String &p_code) = 0;
virtual String shader_get_code(RID p_shader) const = 0;
@@ -176,6 +176,7 @@ public:
virtual Variant material_get_param(RID p_material, const StringName &p_param) const = 0;
virtual void material_set_line_width(RID p_material, float p_width) = 0;
+ virtual void material_set_next_pass(RID p_material, RID p_next_material) = 0;
/* MESH API */
@@ -358,7 +359,6 @@ public:
LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET,
LIGHT_PARAM_SHADOW_NORMAL_BIAS,
LIGHT_PARAM_SHADOW_BIAS,
- LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE,
LIGHT_PARAM_MAX
};
@@ -462,6 +462,9 @@ public:
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_normal_bias(RID p_probe, float p_range) = 0;
+ virtual float gi_probe_get_normal_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;
@@ -478,26 +481,17 @@ public:
virtual void particles_set_emitting(RID p_particles, bool p_emitting) = 0;
virtual void particles_set_amount(RID p_particles, int p_amount) = 0;
virtual void particles_set_lifetime(RID p_particles, float p_lifetime) = 0;
+ virtual void particles_set_one_shot(RID p_particles, bool p_one_shot) = 0;
virtual void particles_set_pre_process_time(RID p_particles, float p_time) = 0;
virtual void particles_set_explosiveness_ratio(RID p_particles, float p_ratio) = 0;
virtual void particles_set_randomness_ratio(RID p_particles, float p_ratio) = 0;
virtual void particles_set_custom_aabb(RID p_particles, const Rect3 &p_aabb) = 0;
- virtual void particles_set_gravity(RID p_particles, const Vector3 &p_gravity) = 0;
+ virtual void particles_set_speed_scale(RID p_particles, float p_scale) = 0;
virtual void particles_set_use_local_coordinates(RID p_particles, bool p_enable) = 0;
virtual void particles_set_process_material(RID p_particles, RID p_material) = 0;
-
- enum ParticlesEmissionShape {
- PARTICLES_EMSSION_POINT,
- PARTICLES_EMSSION_SPHERE,
- PARTICLES_EMSSION_BOX,
- PARTICLES_EMSSION_POINTS,
- PARTICLES_EMSSION_SEGMENTS,
- };
-
- virtual void particles_set_emission_shape(RID p_particles, ParticlesEmissionShape) = 0;
- virtual void particles_set_emission_sphere_radius(RID p_particles, float p_radius) = 0;
- virtual void particles_set_emission_box_extents(RID p_particles, const Vector3 &p_extents) = 0;
- virtual void particles_set_emission_points(RID p_particles, const PoolVector<Vector3> &p_points) = 0;
+ virtual void particles_set_fixed_fps(RID p_particles, int p_fps) = 0;
+ virtual void particles_set_fractional_delta(RID p_particles, bool p_enable) = 0;
+ virtual void particles_restart(RID p_particles) = 0;
enum ParticlesDrawOrder {
PARTICLES_DRAW_ORDER_INDEX,
@@ -507,17 +501,13 @@ public:
virtual void particles_set_draw_order(RID p_particles, ParticlesDrawOrder p_order) = 0;
- enum ParticlesDrawPassMode {
- PARTICLES_DRAW_PASS_MODE_QUAD,
- PARTICLES_DRAW_PASS_MODE_MESH
- };
-
virtual void particles_set_draw_passes(RID p_particles, int p_count) = 0;
- virtual void particles_set_draw_pass_material(RID p_particles, int p_pass, RID p_material) = 0;
virtual void particles_set_draw_pass_mesh(RID p_particles, int p_pass, RID p_mesh) = 0;
virtual Rect3 particles_get_current_aabb(RID p_particles) = 0;
+ virtual void particles_set_emission_transform(RID p_particles, const Transform &p_transform) = 0; //this is only used for 2D, in 3D it's automatic
+
/* CAMERA API */
virtual RID camera_create() = 0;
@@ -541,6 +531,7 @@ public:
virtual RID viewport_create() = 0;
+ virtual void viewport_set_use_arvr(RID p_viewport, bool p_use_arvr) = 0;
virtual void viewport_set_size(RID p_viewport, int p_width, int p_height) = 0;
virtual void viewport_set_active(RID p_viewport, bool p_active) = 0;
virtual void viewport_set_parent_viewport(RID p_viewport, RID p_parent_viewport) = 0;
@@ -596,7 +587,38 @@ public:
};
virtual void viewport_set_msaa(RID p_viewport, ViewportMSAA p_msaa) = 0;
+
+ enum ViewportUsage {
+ VIEWPORT_USAGE_2D,
+ VIEWPORT_USAGE_2D_NO_SAMPLING,
+ VIEWPORT_USAGE_3D,
+ VIEWPORT_USAGE_3D_NO_EFFECTS,
+ };
+
virtual void viewport_set_hdr(RID p_viewport, bool p_enabled) = 0;
+ virtual void viewport_set_usage(RID p_viewport, ViewportUsage p_usage) = 0;
+
+ enum ViewportRenderInfo {
+
+ VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME,
+ VIEWPORT_RENDER_INFO_VERTICES_IN_FRAME,
+ VIEWPORT_RENDER_INFO_MATERIAL_CHANGES_IN_FRAME,
+ VIEWPORT_RENDER_INFO_SHADER_CHANGES_IN_FRAME,
+ VIEWPORT_RENDER_INFO_SURFACE_CHANGES_IN_FRAME,
+ VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME,
+ VIEWPORT_RENDER_INFO_MAX
+ };
+
+ virtual int viewport_get_render_info(RID p_viewport, ViewportRenderInfo p_info) = 0;
+
+ enum ViewportDebugDraw {
+ VIEWPORT_DEBUG_DRAW_DISABLED,
+ VIEWPORT_DEBUG_DRAW_UNSHADED,
+ VIEWPORT_DEBUG_DRAW_OVERDRAW,
+ VIEWPORT_DEBUG_DRAW_WIREFRAME,
+ };
+
+ virtual void viewport_set_debug_draw(RID p_viewport, ViewportDebugDraw p_draw) = 0;
/* ENVIRONMENT API */
@@ -606,19 +628,19 @@ public:
ENV_BG_CLEAR_COLOR,
ENV_BG_COLOR,
- ENV_BG_SKYBOX,
+ ENV_BG_SKY,
ENV_BG_CANVAS,
ENV_BG_KEEP,
ENV_BG_MAX
};
virtual void environment_set_background(RID p_env, EnvironmentBG p_bg) = 0;
- virtual void environment_set_skybox(RID p_env, RID p_skybox) = 0;
- virtual void environment_set_skybox_scale(RID p_env, float p_scale) = 0;
+ virtual void environment_set_sky(RID p_env, RID p_sky) = 0;
+ virtual void environment_set_sky_scale(RID p_env, float p_scale) = 0;
virtual void environment_set_bg_color(RID p_env, const Color &p_color) = 0;
virtual void environment_set_bg_energy(RID p_env, float p_energy) = 0;
virtual void environment_set_canvas_max_layer(RID p_env, int p_max_layer) = 0;
- virtual void environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy = 1.0, float p_skybox_contribution = 0.0) = 0;
+ virtual void environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy = 1.0, float p_sky_contribution = 0.0) = 0;
//set default SSAO options
//set default SSR options
@@ -639,8 +661,7 @@ public:
GLOW_BLEND_MODE_SOFTLIGHT,
GLOW_BLEND_MODE_REPLACE,
};
- virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_treshold, EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_treshold, float p_hdr_bleed_scale, bool p_bicubic_upscale) = 0;
- virtual void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture) = 0;
+ virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, bool p_bicubic_upscale) = 0;
enum EnvironmentToneMapper {
ENV_TONE_MAPPER_LINEAR,
@@ -652,9 +673,13 @@ public:
virtual void environment_set_tonemap(RID p_env, EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_grey) = 0;
virtual void environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp) = 0;
- virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_accel, float p_fade, float p_depth_tolerance, bool p_smooth, bool p_roughness) = 0;
+ virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_in, float p_fade_out, float p_depth_tolerance, bool p_roughness) = 0;
virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, const Color &p_color, bool p_blur) = 0;
+ virtual void environment_set_fog(RID p_env, bool p_enable, const Color &p_color, const Color &p_sun_color, float p_sun_amount) = 0;
+ virtual void environment_set_fog_depth(RID p_env, bool p_enable, float p_depth_begin, float p_depth_curve, bool p_transmit, float p_transmit_curve) = 0;
+ virtual void environment_set_fog_height(RID p_env, bool p_enable, float p_min_height, float p_max_height, float p_height_curve) = 0;
+
/* SCENARIO API */
virtual RID scenario_create() = 0;
@@ -689,7 +714,7 @@ public:
INSTANCE_MAX,
/*INSTANCE_BAKED_LIGHT_SAMPLER,*/
- INSTANCE_GEOMETRY_MASK = (1 << INSTANCE_MESH) | (1 << INSTANCE_MULTIMESH) | (1 << INSTANCE_IMMEDIATE)
+ INSTANCE_GEOMETRY_MASK = (1 << INSTANCE_MESH) | (1 << INSTANCE_MULTIMESH) | (1 << INSTANCE_IMMEDIATE) | (1 << INSTANCE_PARTICLES)
};
virtual RID instance_create2(RID p_base, RID p_scenario);
@@ -701,7 +726,7 @@ public:
virtual void instance_set_scenario(RID p_instance, RID p_scenario) = 0; // from can be mesh, light, poly, area and portal so far.
virtual void instance_set_layer_mask(RID p_instance, uint32_t p_mask) = 0;
virtual void instance_set_transform(RID p_instance, const Transform &p_transform) = 0;
- virtual void instance_attach_object_instance_ID(RID p_instance, ObjectID p_ID) = 0;
+ virtual void instance_attach_object_instance_id(RID p_instance, ObjectID p_ID) = 0;
virtual void instance_set_blend_shape_weight(RID p_instance, int p_shape, float p_weight) = 0;
virtual void instance_set_surface_material(RID p_instance, int p_surface, RID p_material) = 0;
virtual void instance_set_visible(RID p_instance, bool p_visible) = 0;
@@ -718,10 +743,7 @@ public:
virtual Vector<ObjectID> instances_cull_convex(const Vector<Plane> &p_convex, RID p_scenario = RID()) const = 0;
enum InstanceFlags {
- INSTANCE_FLAG_BILLBOARD,
- INSTANCE_FLAG_BILLBOARD_FIX_Y,
INSTANCE_FLAG_CAST_SHADOW,
- INSTANCE_FLAG_DEPH_SCALE,
INSTANCE_FLAG_VISIBLE_IN_ALL_ROOMS,
INSTANCE_FLAG_USE_BAKED_LIGHT,
INSTANCE_FLAG_MAX
@@ -769,16 +791,18 @@ public:
};
virtual void canvas_item_add_line(RID p_item, const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width = 1.0, bool p_antialiased = false) = 0;
+ virtual void canvas_item_add_polyline(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width = 1.0, bool p_antialiased = false) = 0;
virtual void canvas_item_add_rect(RID p_item, const Rect2 &p_rect, const Color &p_color) = 0;
virtual void canvas_item_add_circle(RID p_item, const Point2 &p_pos, float p_radius, const Color &p_color) = 0;
- virtual void canvas_item_add_texture_rect(RID p_item, const Rect2 &p_rect, RID p_texture, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) = 0;
- virtual void canvas_item_add_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false) = 0;
- virtual void canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, NinePatchAxisMode p_x_axis_mode = NINE_PATCH_STRETCH, NinePatchAxisMode p_y_axis_mode = NINE_PATCH_STRETCH, bool p_draw_center = true, const Color &p_modulate = Color(1, 1, 1)) = 0;
- virtual void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0) = 0;
- virtual void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID()) = 0;
- virtual void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), int p_count = -1) = 0;
+ virtual void canvas_item_add_texture_rect(RID p_item, const Rect2 &p_rect, RID p_texture, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, RID p_normal_map = RID()) = 0;
+ virtual void canvas_item_add_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, RID p_normal_map = RID(), bool p_clip_uv = true) = 0;
+ virtual void canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, NinePatchAxisMode p_x_axis_mode = NINE_PATCH_STRETCH, NinePatchAxisMode p_y_axis_mode = NINE_PATCH_STRETCH, bool p_draw_center = true, const Color &p_modulate = Color(1, 1, 1), RID p_normal_map = RID()) = 0;
+ virtual void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0, RID p_normal_map = RID()) = 0;
+ virtual void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), RID p_normal_map = RID()) = 0;
+ virtual void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_skeleton = RID()) = 0;
virtual void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_skeleton = RID()) = 0;
+ virtual void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal_map, int p_h_frames, int p_v_frames) = 0;
virtual void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform) = 0;
virtual void canvas_item_add_clip_ignore(RID p_item, bool p_ignore) = 0;
virtual void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable) = 0;
@@ -830,6 +854,7 @@ public:
virtual void canvas_light_set_shadow_gradient_length(RID p_light, float p_length) = 0;
virtual void canvas_light_set_shadow_filter(RID p_light, CanvasLightShadowFilter p_filter) = 0;
virtual void canvas_light_set_shadow_color(RID p_light, const Color &p_color) = 0;
+ virtual void canvas_light_set_shadow_smooth(RID p_light, float p_smooth) = 0;
virtual RID canvas_light_occluder_create() = 0;
virtual void canvas_light_occluder_attach_to_canvas(RID p_occluder, RID p_canvas) = 0;
@@ -849,12 +874,6 @@ public:
};
virtual void canvas_occluder_polygon_set_cull_mode(RID p_occluder_polygon, CanvasOccluderPolygonCullMode p_mode) = 0;
- /* CURSOR */
- virtual void cursor_set_rotation(float p_rotation, int p_cursor = 0) = 0; // radians
- virtual void cursor_set_texture(RID p_texture, const Point2 &p_center_offset = Point2(0, 0), int p_cursor = 0, const Rect2 &p_region = Rect2()) = 0;
- virtual void cursor_set_visible(bool p_visible, int p_cursor = 0) = 0;
- virtual void cursor_set_pos(const Point2 &p_pos, int p_cursor = 0) = 0;
-
/* BLACK BARS */
virtual void black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom) = 0;
@@ -864,6 +883,8 @@ public:
virtual void free(RID p_rid) = 0; ///< free RIDs associated with the visual server
+ virtual void request_frame_drawn_callback(Object *p_where, const StringName &p_method, const Variant &p_userdata) = 0;
+
/* EVENT QUEUING */
virtual void draw() = 0;
@@ -892,8 +913,6 @@ public:
/* Materials for 2D on 3D */
- RID material_2d_get(bool p_shaded, bool p_transparent, bool p_cut_alpha, bool p_opaque_prepass);
-
/* TESTING */
virtual RID get_test_cube() = 0;
@@ -906,7 +925,7 @@ public:
virtual void mesh_add_surface_from_mesh_data(RID p_mesh, const Geometry::MeshData &p_mesh_data);
virtual void mesh_add_surface_from_planes(RID p_mesh, const PoolVector<Plane> &p_planes);
- virtual void set_boot_image(const Image &p_image, const Color &p_color, bool p_scale) = 0;
+ virtual void set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale) = 0;
virtual void set_default_clear_color(const Color &p_color) = 0;
enum Features {
@@ -918,6 +937,8 @@ public:
virtual bool has_os_feature(const String &p_feature) const = 0;
+ virtual void set_debug_generate_wireframes(bool p_generate) = 0;
+
VisualServer();
virtual ~VisualServer();
};
diff --git a/signal_renames.txt b/signal_renames.txt
deleted file mode 100644
index 859985cb11..0000000000
--- a/signal_renames.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-area_enter = area_entered
-area_exit = area_exited
-
-area_enter_shape = area_shape_entered
-area_exit_shape = area_shape_exited
-
-body_enter = body_entered
-body_exit = body_exited
-
-body_enter_shape = body_shape_entered
-body_exit_shape = body_shape_exited
-
-mouse_enter = mouse_entered
-mouse_exit = mouse_exited
-focus_enter = focus_entered
-focus_exit = focus_exited
-
-modal_close = modal_closed
-
-enter_tree = tree_entered
-exit_tree = tree_exited \ No newline at end of file
diff --git a/thirdparty/README.md b/thirdparty/README.md
index f35a95df37..4ed17168e8 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -1,6 +1,13 @@
# Third party libraries
+## b2d_convexdecomp
+
+- Upstream: https://github.com/erincatto/Box2D (Contributions/Utilities/ConvexDecomposition)
+- Version: TBD
+- License: zlib
+
+
## certs
- Upstream: ?
@@ -30,6 +37,18 @@ Check the diff of enet.h, protocol.c, and host.c with the 1.3.13
tarball before the next update.
+## etc2comp
+
+- Upstream: https://github.com/google/etc2comp
+- Version: 9cd0f9c (git)
+- License: Apache
+
+Files extracted from upstream source:
+
+- all .cpp and .h files in EtcLib/
+- README.md, LICENSE, AUTHORS
+
+
## fonts
- Upstream: ?
@@ -40,7 +59,7 @@ TODO.
## freetype
- Upstream: https://www.freetype.org
-- Version: 2.6.5
+- Version: 2.8
- License: FreeType License (BSD-like)
Files extracted from upstream source:
@@ -53,7 +72,7 @@ Files extracted from upstream source:
## glad
- Upstream: https://github.com/Dav1dde/glad
-- Version: 0.1.13a0
+- Version: 0.1.14a0
- License: MIT
The files we package are automatically generated.
@@ -88,7 +107,7 @@ Files extracted from upstream source:
## libpng
- Upstream: http://libpng.org/pub/png/libpng.html
-- Version: 1.6.28
+- Version: 1.6.31rc01
- License: libpng/zlib
Files extracted from upstream source:
@@ -105,6 +124,10 @@ Files extracted from upstream source:
- Version: 05cfdc2 (git)
- License: MIT, BSD-3-Clause
+Files extracted from upstream source:
+
+TODO.
+
## libvorbis
@@ -125,6 +148,10 @@ Files extracted from upstream source:
- Version: 1.6.0
- License: BSD-3-Clause
+Files extracted from upstream source:
+
+TODO.
+
## libwebp
@@ -142,6 +169,91 @@ changes to ensure they build for Javascript/HTML5. Those
changes are marked with `// -- GODOT --` comments.
+## minizip
+
+- Upstream: http://www.zlib.net
+- Version: 1.2.4 (zlib contrib)
+- License: zlib
+
+Files extracted from the upstream source:
+
+- contrib/minizip/{crypt.h,ioapi.{c,h},zip.{c,h},unzip.{c,h}}
+
+Important: Some files have Godot-made changes for use in core/io.
+TODO: Properly sync with version 1.2.4 and document changes.
+
+
+## misc
+
+Collection of single-file libraries used in Godot components.
+
+### core
+
+- `aes256.{cpp,h}`
+ * Upstream: http://www.literatecode.com/aes256
+ * Version: latest, as of April 2017
+ * License: ISC
+- `base64.{c,h}`
+ * Upstream: http://episec.com/people/edelkind/c.html
+ * Version: latest, as of April 2017
+ * License: Public Domain
+- `fastlz.{c,h}`
+ * Upstream: https://code.google.com/archive/p/fastlz
+ * Version: svn (r12)
+ * License: MIT
+- `hq2x.{cpp,h}`
+ * Upstream: https://github.com/brunexgeek/hqx
+ * Version: TBD, file structure differs
+ * License: Apache 2.0
+- `md5.{cpp,h}`
+ * Upstream: http://www.efgh.com/software/md5.htm
+ * Version: TBD, might not be latest from above URL
+ * License: RSA Message-Digest License
+- `pcg.{cpp,h}`
+ * Upstream: http://www.pcg-random.org
+ * Version: minimal C implemention, http://www.pcg-random.org/download.html
+ * License: Apache 2.0
+- `sha256.{c,h}`
+ * Upstream: https://github.com/ilvn/SHA256
+ * Version: git (35ff823, 2015)
+ * License: ISC
+- `smaz.{c,h}`
+ * Upstream: https://github.com/antirez/smaz
+ * Version: git (150e125, 2009)
+ * License: BSD 3-clause
+ * Modifications: use `const char*` instead of `char*` for input string
+- `triangulator.{cpp,h}`
+ * Upstream: https://github.com/ivanfratric/polypartition (`src/polypartition.cpp`)
+ * Version: TBD, class was renamed
+ * License: MIT
+
+### modules
+
+- `curl_hostcheck.{c,h}`
+ * Upstream: https://curl.haxx.se/
+ * Version: ? (2013)
+ * License: MIT
+- `yuv2rgb.h`
+ * Upstream: http://wss.co.uk/pinknoise/yuv2rgb/ (to check)
+ * Version: ?
+ * License: BSD
+
+### scene
+
+- `mikktspace.{c,h}`
+ * Upstream: https://wiki.blender.org/index.php/Dev:Shading/Tangent_Space_Normal_Maps
+ * Version: 1.0
+ * License: zlib
+- `stb_truetype.h`
+ * Upstream: https://github.com/nothings/stb
+ * Version: 1.11
+ * License: Public Domain (Unlicense) or MIT
+- `stb_vorbis.c`
+ * Upstream: https://github.com/nothings/stb
+ * Version: 1.09
+ * License: Public Domain (Unlicense) or MIT
+
+
## openssl
- Upstream: https://www.openssl.org
@@ -150,13 +262,29 @@ changes are marked with `// -- GODOT --` comments.
Files extracted from the upstream source:
-TODO.
+- Our `openssl/`: contains the headers installed in /usr/include/openssl;
+ gather them in the source tarball with `make links` and
+ `cp -f include/openssl/*.h ../openssl/openssl/`
+- Our `crypto/`: copy of upstream `crypto/`, with some cleanup (see below).
+- Our `ssl/`: copy of upstream `ssl/`, with some cleanup (see below).
+- Cleanup:
+ ```
+ find \( -name "Makefile" -o -name "*.S" -o -name "*.bat" -o -name "*.bc" \
+ -o -name "*.com" -o -name "*.cnf" -o -name "*.ec" -o -name "*.fre" \
+ -o -name "*.gcc" -o -name "*.in" -o -name "*.lnx" -o -name "*.m4" \
+ -o -name "*.pl" -o -name "*.pod" -o -name "*.s" -o -name "*.sh" \
+ -o -name "*.sol" -o -name "*test*" \) -delete
+ cd openssl; for file in *.h; do find ../{crypto,ssl} -name "$file" -delete; done
+ ```
+ For the rest check the `git status` and decide.
+- e_os.h
+- Apply the Godot-specific patches in the `patches/` folder.
## opus
- Upstream: https://opus-codec.org
-- Version: 1.1.3 (opus) and 0.8 (opusfile)
+- Version: 1.1.5 (opus) and 0.8 (opusfile)
- License: BSD-3-Clause
Files extracted from upstream source:
@@ -164,6 +292,7 @@ Files extracted from upstream source:
- all .c and .h files in src/ (both opus and opusfile),
except `opus_demo.c`
- all .h files in include/ (both opus and opusfile) as opus/
+- celt/ and silk/ subfolders
- COPYING
@@ -179,17 +308,6 @@ Files extracted from upstream source:
- LICENSE.TXT
-## rg-etc1
-
-- Upstream: https://github.com/richgel999/rg-etc1
-- Version: 1.04
-- License: zlib
-
-Files extracted from upstream source:
-
-- `rg_etc1.{cpp,h}`
-
-
## rtaudio
- Upstream: http://www.music.mcgill.ca/~gary/rtaudio/
@@ -204,7 +322,7 @@ Files extracted from upstream source:
## squish
- Upstream: https://sourceforge.net/projects/libsquish
-- Version: 1.14
+- Version: 1.15
- License: MIT
Files extracted from upstream source:
@@ -225,6 +343,21 @@ Files extracted from upstream source:
- COPYING and LICENSE
+## tinyexr
+
+- Upstream: https://github.com/syoyo/tinyexr
+- Version: 0.9.5+ (git a145d69)
+- License: BSD-3-Clause
+
+Files extracted from upstream source:
+
+- `tinyexr.{cc,h}`
+
+Important: Some changes were made to get TinyEXR to build on the ancient
+MinGW-w64 toolchain of Travis CI.
+https://github.com/godotengine/godot/commit/37f5e1dcd94611dd5b670f013abf0323e8b47def
+
+
## zlib
- Upstream: http://www.zlib.net/
@@ -234,3 +367,14 @@ Files extracted from upstream source:
Files extracted from upstream source:
- all .c and .h files
+
+## zstd
+
+- Upstream: https://github.com/facebook/zstd
+- Version: 1.3.0
+- License: BSD-3-Clause
+
+Files extracted from upstream source:
+
+- all .c and .h under lib/
+- README.md, LICENSE, PATENTS
diff --git a/drivers/convex_decomp/b2Glue.h b/thirdparty/b2d_convexdecomp/b2Glue.h
index 425486356e..425486356e 100644
--- a/drivers/convex_decomp/b2Glue.h
+++ b/thirdparty/b2d_convexdecomp/b2Glue.h
diff --git a/drivers/convex_decomp/b2Polygon.cpp b/thirdparty/b2d_convexdecomp/b2Polygon.cpp
index b6ead62c63..b6ead62c63 100644
--- a/drivers/convex_decomp/b2Polygon.cpp
+++ b/thirdparty/b2d_convexdecomp/b2Polygon.cpp
diff --git a/drivers/convex_decomp/b2Polygon.h b/thirdparty/b2d_convexdecomp/b2Polygon.h
index c466e28f7e..c466e28f7e 100644
--- a/drivers/convex_decomp/b2Polygon.h
+++ b/thirdparty/b2d_convexdecomp/b2Polygon.h
diff --git a/drivers/convex_decomp/b2Triangle.cpp b/thirdparty/b2d_convexdecomp/b2Triangle.cpp
index a0a30b9407..a0a30b9407 100644
--- a/drivers/convex_decomp/b2Triangle.cpp
+++ b/thirdparty/b2d_convexdecomp/b2Triangle.cpp
diff --git a/drivers/convex_decomp/b2Triangle.h b/thirdparty/b2d_convexdecomp/b2Triangle.h
index 99ab5cba69..99ab5cba69 100644
--- a/drivers/convex_decomp/b2Triangle.h
+++ b/thirdparty/b2d_convexdecomp/b2Triangle.h
diff --git a/thirdparty/enet/enet/godot.h b/thirdparty/enet/enet/godot.h
index 8f543966b5..75645153dd 100644
--- a/thirdparty/enet/enet/godot.h
+++ b/thirdparty/enet/enet/godot.h
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/thirdparty/enet/godot.cpp b/thirdparty/enet/godot.cpp
index e26340092d..f050b7b916 100644
--- a/thirdparty/enet/godot.cpp
+++ b/thirdparty/enet/godot.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/thirdparty/etc2comp/AUTHORS b/thirdparty/etc2comp/AUTHORS
new file mode 100644
index 0000000000..32daca27fe
--- /dev/null
+++ b/thirdparty/etc2comp/AUTHORS
@@ -0,0 +1,7 @@
+# This is the list of Etc2Comp authors for copyright purposes.
+#
+# This does not necessarily list everyone who has contributed code, since in
+# some cases, their employer may be the copyright holder. To see the full list
+# of contributors, see the revision history in source control.
+Google Inc.
+Blue Shift Inc.
diff --git a/thirdparty/etc2comp/Etc.cpp b/thirdparty/etc2comp/Etc.cpp
new file mode 100644
index 0000000000..a5ee706048
--- /dev/null
+++ b/thirdparty/etc2comp/Etc.cpp
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "EtcConfig.h"
+#include "Etc.h"
+#include "EtcFilter.h"
+
+#include <string.h>
+
+namespace Etc
+{
+ // ----------------------------------------------------------------------------------------------------
+ // C-style inteface to the encoder
+ //
+ void Encode(float *a_pafSourceRGBA,
+ unsigned int a_uiSourceWidth,
+ unsigned int a_uiSourceHeight,
+ Image::Format a_format,
+ ErrorMetric a_eErrMetric,
+ float a_fEffort,
+ unsigned int a_uiJobs,
+ unsigned int a_uiMaxJobs,
+ unsigned char **a_ppaucEncodingBits,
+ unsigned int *a_puiEncodingBitsBytes,
+ unsigned int *a_puiExtendedWidth,
+ unsigned int *a_puiExtendedHeight,
+ int *a_piEncodingTime_ms, bool a_bVerboseOutput)
+ {
+
+ Image image(a_pafSourceRGBA, a_uiSourceWidth,
+ a_uiSourceHeight,
+ a_eErrMetric);
+ image.m_bVerboseOutput = a_bVerboseOutput;
+ image.Encode(a_format, a_eErrMetric, a_fEffort, a_uiJobs, a_uiMaxJobs);
+
+ *a_ppaucEncodingBits = image.GetEncodingBits();
+ *a_puiEncodingBitsBytes = image.GetEncodingBitsBytes();
+ *a_puiExtendedWidth = image.GetExtendedWidth();
+ *a_puiExtendedHeight = image.GetExtendedHeight();
+ *a_piEncodingTime_ms = image.GetEncodingTimeMs();
+ }
+
+ void EncodeMipmaps(float *a_pafSourceRGBA,
+ unsigned int a_uiSourceWidth,
+ unsigned int a_uiSourceHeight,
+ Image::Format a_format,
+ ErrorMetric a_eErrMetric,
+ float a_fEffort,
+ unsigned int a_uiJobs,
+ unsigned int a_uiMaxJobs,
+ unsigned int a_uiMaxMipmaps,
+ unsigned int a_uiMipFilterFlags,
+ RawImage* a_pMipmapImages,
+ int *a_piEncodingTime_ms,
+ bool a_bVerboseOutput)
+ {
+ auto mipWidth = a_uiSourceWidth;
+ auto mipHeight = a_uiSourceHeight;
+ int totalEncodingTime = 0;
+ for(unsigned int mip = 0; mip < a_uiMaxMipmaps && mipWidth >= 1 && mipHeight >= 1; mip++)
+ {
+ float* pImageData = nullptr;
+ float* pMipImage = nullptr;
+
+ if(mip == 0)
+ {
+ pImageData = a_pafSourceRGBA;
+ }
+ else
+ {
+ pMipImage = new float[mipWidth*mipHeight*4];
+ if(FilterTwoPass(a_pafSourceRGBA, a_uiSourceWidth, a_uiSourceHeight, pMipImage, mipWidth, mipHeight, a_uiMipFilterFlags, Etc::FilterLanczos3) )
+ {
+ pImageData = pMipImage;
+ }
+ }
+
+ if ( pImageData )
+ {
+
+ Image image(pImageData, mipWidth, mipHeight, a_eErrMetric);
+
+ image.m_bVerboseOutput = a_bVerboseOutput;
+ image.Encode(a_format, a_eErrMetric, a_fEffort, a_uiJobs, a_uiMaxJobs);
+
+ a_pMipmapImages[mip].paucEncodingBits = std::shared_ptr<unsigned char>(image.GetEncodingBits(), [](unsigned char *p) { delete[] p; });
+ a_pMipmapImages[mip].uiEncodingBitsBytes = image.GetEncodingBitsBytes();
+ a_pMipmapImages[mip].uiExtendedWidth = image.GetExtendedWidth();
+ a_pMipmapImages[mip].uiExtendedHeight = image.GetExtendedHeight();
+
+ totalEncodingTime += image.GetEncodingTimeMs();
+ }
+
+ if(pMipImage)
+ {
+ delete[] pMipImage;
+ }
+
+ if (!pImageData)
+ {
+ break;
+ }
+
+ mipWidth >>= 1;
+ mipHeight >>= 1;
+ }
+
+ *a_piEncodingTime_ms = totalEncodingTime;
+ }
+
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+}
diff --git a/thirdparty/etc2comp/Etc.h b/thirdparty/etc2comp/Etc.h
new file mode 100644
index 0000000000..439388d649
--- /dev/null
+++ b/thirdparty/etc2comp/Etc.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcConfig.h"
+#include "EtcImage.h"
+#include "EtcColor.h"
+#include "EtcErrorMetric.h"
+#include <memory>
+
+#define ETCCOMP_MIN_EFFORT_LEVEL (0.0f)
+#define ETCCOMP_DEFAULT_EFFORT_LEVEL (40.0f)
+#define ETCCOMP_MAX_EFFORT_LEVEL (100.0f)
+
+namespace Etc
+{
+ class Block4x4EncodingBits;
+
+ struct RawImage
+ {
+ int uiExtendedWidth;
+ int uiExtendedHeight;
+ unsigned int uiEncodingBitsBytes;
+ std::shared_ptr<unsigned char> paucEncodingBits;
+ };
+
+
+
+ // C-style inteface to the encoder
+ void Encode(float *a_pafSourceRGBA,
+ unsigned int a_uiSourceWidth,
+ unsigned int a_uiSourceHeight,
+ Image::Format a_format,
+ ErrorMetric a_eErrMetric,
+ float a_fEffort,
+ unsigned int a_uiJobs,
+ unsigned int a_uimaxJobs,
+ unsigned char **a_ppaucEncodingBits,
+ unsigned int *a_puiEncodingBitsBytes,
+ unsigned int *a_puiExtendedWidth,
+ unsigned int *a_puiExtendedHeight,
+ int *a_piEncodingTime_ms, bool a_bVerboseOutput = false);
+
+ void EncodeMipmaps(float *a_pafSourceRGBA,
+ unsigned int a_uiSourceWidth,
+ unsigned int a_uiSourceHeight,
+ Image::Format a_format,
+ ErrorMetric a_eErrMetric,
+ float a_fEffort,
+ unsigned int a_uiJobs,
+ unsigned int a_uiMaxJobs,
+ unsigned int a_uiMaxMipmaps,
+ unsigned int a_uiMipFilterFlags,
+ RawImage* a_pMipmaps,
+ int *a_piEncodingTime_ms, bool a_bVerboseOutput = false);
+
+}
diff --git a/thirdparty/etc2comp/EtcBlock4x4.cpp b/thirdparty/etc2comp/EtcBlock4x4.cpp
new file mode 100644
index 0000000000..3082fe60db
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4.cpp
@@ -0,0 +1,425 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcBlock4x4.cpp
+
+Implements the state associated with each 4x4 block of pixels in an image
+
+Source images that are not a multiple of 4x4 are extended to fill the Block4x4 using pixels with an
+alpha of NAN
+
+*/
+
+#include "EtcConfig.h"
+#include "EtcBlock4x4.h"
+
+#include "EtcBlock4x4EncodingBits.h"
+#include "EtcColor.h"
+#include "EtcImage.h"
+#include "EtcColorFloatRGBA.h"
+#include "EtcBlock4x4Encoding_RGB8.h"
+#include "EtcBlock4x4Encoding_RGBA8.h"
+#include "EtcBlock4x4Encoding_RGB8A1.h"
+#include "EtcBlock4x4Encoding_R11.h"
+#include "EtcBlock4x4Encoding_RG11.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+namespace Etc
+{
+ // ETC pixels are scanned vertically.
+ // this mapping is for when someone wants to scan the ETC pixels horizontally
+ const unsigned int Block4x4::s_auiPixelOrderHScan[PIXELS] = { 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15 };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ Block4x4::Block4x4(void)
+ {
+ m_pimageSource = nullptr;
+ m_uiSourceH = 0;
+ m_uiSourceV = 0;
+
+ m_sourcealphamix = SourceAlphaMix::UNKNOWN;
+ m_boolBorderPixels = false;
+ m_boolPunchThroughPixels = false;
+
+ m_pencoding = nullptr;
+
+ m_errormetric = ErrorMetric::NUMERIC;
+
+ }
+ Block4x4::~Block4x4()
+ {
+ m_pimageSource = nullptr;
+ if (m_pencoding)
+ {
+ delete m_pencoding;
+ m_pencoding = nullptr;
+ }
+ }
+ // ----------------------------------------------------------------------------------------------------
+ // initialization prior to encoding from a source image
+ // [a_uiSourceH,a_uiSourceV] is the location of the block in a_pimageSource
+ // a_paucEncodingBits is the place to store the final encoding
+ // a_errormetric is used for finding the best encoding
+ //
+ void Block4x4::InitFromSource(Image *a_pimageSource,
+ unsigned int a_uiSourceH, unsigned int a_uiSourceV,
+ unsigned char *a_paucEncodingBits,
+ ErrorMetric a_errormetric)
+ {
+
+ Block4x4();
+
+ m_pimageSource = a_pimageSource;
+ m_uiSourceH = a_uiSourceH;
+ m_uiSourceV = a_uiSourceV;
+ m_errormetric = a_errormetric;
+
+ SetSourcePixels();
+
+ // set block encoder function
+ switch (m_pimageSource->GetFormat())
+ {
+ case Image::Format::ETC1:
+ m_pencoding = new Block4x4Encoding_ETC1;
+ break;
+
+ case Image::Format::RGB8:
+ case Image::Format::SRGB8:
+ m_pencoding = new Block4x4Encoding_RGB8;
+ break;
+
+ case Image::Format::RGBA8:
+ case Image::Format::SRGBA8:
+ if (a_errormetric == RGBX)
+ {
+ m_pencoding = new Block4x4Encoding_RGBA8;
+ }
+ else
+ {
+ switch (m_sourcealphamix)
+ {
+ case SourceAlphaMix::OPAQUE:
+ m_pencoding = new Block4x4Encoding_RGBA8_Opaque;
+ break;
+
+ case SourceAlphaMix::TRANSPARENT:
+ m_pencoding = new Block4x4Encoding_RGBA8_Transparent;
+ break;
+
+ case SourceAlphaMix::TRANSLUCENT:
+ m_pencoding = new Block4x4Encoding_RGBA8;
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+ break;
+ }
+ break;
+
+ case Image::Format::RGB8A1:
+ case Image::Format::SRGB8A1:
+ switch (m_sourcealphamix)
+ {
+ case SourceAlphaMix::OPAQUE:
+ m_pencoding = new Block4x4Encoding_RGB8A1_Opaque;
+ break;
+
+ case SourceAlphaMix::TRANSPARENT:
+ m_pencoding = new Block4x4Encoding_RGB8A1_Transparent;
+ break;
+
+ case SourceAlphaMix::TRANSLUCENT:
+ if (m_boolPunchThroughPixels)
+ {
+ m_pencoding = new Block4x4Encoding_RGB8A1;
+ }
+ else
+ {
+ m_pencoding = new Block4x4Encoding_RGB8A1_Opaque;
+ }
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+ break;
+
+ case Image::Format::R11:
+ case Image::Format::SIGNED_R11:
+ m_pencoding = new Block4x4Encoding_R11;
+ break;
+ case Image::Format::RG11:
+ case Image::Format::SIGNED_RG11:
+ m_pencoding = new Block4x4Encoding_RG11;
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ m_pencoding->InitFromSource(this, m_afrgbaSource,
+ a_paucEncodingBits, a_errormetric);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization of encoding state from a prior encoding using encoding bits
+ // [a_uiSourceH,a_uiSourceV] is the location of the block in a_pimageSource
+ // a_paucEncodingBits is the place to read the prior encoding
+ // a_imageformat is used to determine how to interpret a_paucEncodingBits
+ // a_errormetric was used for the prior encoding
+ //
+ void Block4x4::InitFromEtcEncodingBits(Image::Format a_imageformat,
+ unsigned int a_uiSourceH, unsigned int a_uiSourceV,
+ unsigned char *a_paucEncodingBits,
+ Image *a_pimageSource,
+ ErrorMetric a_errormetric)
+ {
+ Block4x4();
+
+ m_pimageSource = a_pimageSource;
+ m_uiSourceH = a_uiSourceH;
+ m_uiSourceV = a_uiSourceV;
+ m_errormetric = a_errormetric;
+
+ SetSourcePixels();
+
+ // set block encoder function
+ switch (a_imageformat)
+ {
+ case Image::Format::ETC1:
+ m_pencoding = new Block4x4Encoding_ETC1;
+ break;
+
+ case Image::Format::RGB8:
+ case Image::Format::SRGB8:
+ m_pencoding = new Block4x4Encoding_RGB8;
+ break;
+
+ case Image::Format::RGBA8:
+ case Image::Format::SRGBA8:
+ m_pencoding = new Block4x4Encoding_RGBA8;
+ break;
+
+ case Image::Format::RGB8A1:
+ case Image::Format::SRGB8A1:
+ m_pencoding = new Block4x4Encoding_RGB8A1;
+ break;
+
+ case Image::Format::R11:
+ case Image::Format::SIGNED_R11:
+ m_pencoding = new Block4x4Encoding_R11;
+ break;
+ case Image::Format::RG11:
+ case Image::Format::SIGNED_RG11:
+ m_pencoding = new Block4x4Encoding_RG11;
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ m_pencoding->InitFromEncodingBits(this, a_paucEncodingBits, m_afrgbaSource,
+ m_pimageSource->GetErrorMetric());
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set source pixels from m_pimageSource
+ // set m_alphamix
+ //
+ void Block4x4::SetSourcePixels(void)
+ {
+
+ Image::Format imageformat = m_pimageSource->GetFormat();
+
+ // alpha census
+ unsigned int uiTransparentSourcePixels = 0;
+ unsigned int uiOpaqueSourcePixels = 0;
+
+ // copy source to consecutive memory locations
+ // convert from image horizontal scan to block vertical scan
+ unsigned int uiPixel = 0;
+ for (unsigned int uiBlockPixelH = 0; uiBlockPixelH < Block4x4::COLUMNS; uiBlockPixelH++)
+ {
+ unsigned int uiSourcePixelH = m_uiSourceH + uiBlockPixelH;
+
+ for (unsigned int uiBlockPixelV = 0; uiBlockPixelV < Block4x4::ROWS; uiBlockPixelV++)
+ {
+ unsigned int uiSourcePixelV = m_uiSourceV + uiBlockPixelV;
+
+ ColorFloatRGBA *pfrgbaSource = m_pimageSource->GetSourcePixel(uiSourcePixelH, uiSourcePixelV);
+
+ // if pixel extends beyond source image because of block padding
+ if (pfrgbaSource == nullptr)
+ {
+ m_afrgbaSource[uiPixel] = ColorFloatRGBA(0.0f, 0.0f, 0.0f, NAN); // denotes border pixel
+ m_boolBorderPixels = true;
+ uiTransparentSourcePixels++;
+ }
+ else
+ {
+ //get teh current pixel data, and store some of the attributes
+ //before capping values to fit the encoder type
+
+ m_afrgbaSource[uiPixel] = (*pfrgbaSource).ClampRGBA();
+
+ if (m_afrgbaSource[uiPixel].fA == 1.0f || m_errormetric == RGBX)
+ {
+ m_pimageSource->m_iNumOpaquePixels++;
+ }
+ else if (m_afrgbaSource[uiPixel].fA == 0.0f)
+ {
+ m_pimageSource->m_iNumTransparentPixels++;
+ }
+ else if(m_afrgbaSource[uiPixel].fA > 0.0f && m_afrgbaSource[uiPixel].fA < 1.0f)
+ {
+ m_pimageSource->m_iNumTranslucentPixels++;
+ }
+ else
+ {
+ m_pimageSource->m_numOutOfRangeValues.fA++;
+ }
+
+ if (m_afrgbaSource[uiPixel].fR != 0.0f)
+ {
+ m_pimageSource->m_numColorValues.fR++;
+ //make sure we are getting a float between 0-1
+ if (m_afrgbaSource[uiPixel].fR - 1.0f > 0.0f)
+ {
+ m_pimageSource->m_numOutOfRangeValues.fR++;
+ }
+ }
+
+ if (m_afrgbaSource[uiPixel].fG != 0.0f)
+ {
+ m_pimageSource->m_numColorValues.fG++;
+ if (m_afrgbaSource[uiPixel].fG - 1.0f > 0.0f)
+ {
+ m_pimageSource->m_numOutOfRangeValues.fG++;
+ }
+ }
+ if (m_afrgbaSource[uiPixel].fB != 0.0f)
+ {
+ m_pimageSource->m_numColorValues.fB++;
+ if (m_afrgbaSource[uiPixel].fB - 1.0f > 0.0f)
+ {
+ m_pimageSource->m_numOutOfRangeValues.fB++;
+ }
+ }
+ // for formats with no alpha, set source alpha to 1
+ if (imageformat == Image::Format::ETC1 ||
+ imageformat == Image::Format::RGB8 ||
+ imageformat == Image::Format::SRGB8)
+ {
+ m_afrgbaSource[uiPixel].fA = 1.0f;
+ }
+
+ if (imageformat == Image::Format::R11 ||
+ imageformat == Image::Format::SIGNED_R11)
+ {
+ m_afrgbaSource[uiPixel].fA = 1.0f;
+ m_afrgbaSource[uiPixel].fG = 0.0f;
+ m_afrgbaSource[uiPixel].fB = 0.0f;
+ }
+
+ if (imageformat == Image::Format::RG11 ||
+ imageformat == Image::Format::SIGNED_RG11)
+ {
+ m_afrgbaSource[uiPixel].fA = 1.0f;
+ m_afrgbaSource[uiPixel].fB = 0.0f;
+ }
+
+
+ // for RGB8A1, set source alpha to 0.0 or 1.0
+ // set punch through flag
+ if (imageformat == Image::Format::RGB8A1 ||
+ imageformat == Image::Format::SRGB8A1)
+ {
+ if (m_afrgbaSource[uiPixel].fA >= 0.5f)
+ {
+ m_afrgbaSource[uiPixel].fA = 1.0f;
+ }
+ else
+ {
+ m_afrgbaSource[uiPixel].fA = 0.0f;
+ m_boolPunchThroughPixels = true;
+ }
+ }
+
+ if (m_afrgbaSource[uiPixel].fA == 1.0f || m_errormetric == RGBX)
+ {
+ uiOpaqueSourcePixels++;
+ }
+ else if (m_afrgbaSource[uiPixel].fA == 0.0f)
+ {
+ uiTransparentSourcePixels++;
+ }
+
+ }
+
+ uiPixel += 1;
+ }
+ }
+
+ if (uiOpaqueSourcePixels == PIXELS)
+ {
+ m_sourcealphamix = SourceAlphaMix::OPAQUE;
+ }
+ else if (uiTransparentSourcePixels == PIXELS)
+ {
+ m_sourcealphamix = SourceAlphaMix::TRANSPARENT;
+ }
+ else
+ {
+ m_sourcealphamix = SourceAlphaMix::TRANSLUCENT;
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // return a name for the encoding mode
+ //
+ const char * Block4x4::GetEncodingModeName(void)
+ {
+
+ switch (m_pencoding->GetMode())
+ {
+ case Block4x4Encoding::MODE_ETC1:
+ return "ETC1";
+ case Block4x4Encoding::MODE_T:
+ return "T";
+ case Block4x4Encoding::MODE_H:
+ return "H";
+ case Block4x4Encoding::MODE_PLANAR:
+ return "PLANAR";
+ default:
+ return "???";
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+}
diff --git a/thirdparty/etc2comp/EtcBlock4x4.h b/thirdparty/etc2comp/EtcBlock4x4.h
new file mode 100644
index 0000000000..0fd30c598d
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4.h
@@ -0,0 +1,172 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcColor.h"
+#include "EtcColorFloatRGBA.h"
+#include "EtcErrorMetric.h"
+#include "EtcImage.h"
+#include "EtcBlock4x4Encoding.h"
+
+namespace Etc
+{
+ class Block4x4EncodingBits;
+
+ class Block4x4
+ {
+ public:
+
+ static const unsigned int ROWS = 4;
+ static const unsigned int COLUMNS = 4;
+ static const unsigned int PIXELS = ROWS * COLUMNS;
+
+ // the alpha mix for a 4x4 block of pixels
+ enum class SourceAlphaMix
+ {
+ UNKNOWN,
+ //
+ OPAQUE, // all 1.0
+ TRANSPARENT, // all 0.0 or NAN
+ TRANSLUCENT // not all opaque or transparent
+ };
+
+ typedef void (Block4x4::*EncoderFunctionPtr)(void);
+
+ Block4x4(void);
+ ~Block4x4();
+ void InitFromSource(Image *a_pimageSource,
+ unsigned int a_uiSourceH,
+ unsigned int a_uiSourceV,
+ unsigned char *a_paucEncodingBits,
+ ErrorMetric a_errormetric);
+
+ void InitFromEtcEncodingBits(Image::Format a_imageformat,
+ unsigned int a_uiSourceH,
+ unsigned int a_uiSourceV,
+ unsigned char *a_paucEncodingBits,
+ Image *a_pimageSource,
+ ErrorMetric a_errormetric);
+
+ // return true if final iteration was performed
+ inline void PerformEncodingIteration(float a_fEffort)
+ {
+ m_pencoding->PerformIteration(a_fEffort);
+ }
+
+ inline void SetEncodingBitsFromEncoding(void)
+ {
+ m_pencoding->SetEncodingBits();
+ }
+
+ inline unsigned int GetSourceH(void)
+ {
+ return m_uiSourceH;
+ }
+
+ inline unsigned int GetSourceV(void)
+ {
+ return m_uiSourceV;
+ }
+
+ inline float GetError(void)
+ {
+ return m_pencoding->GetError();
+ }
+
+ static const unsigned int s_auiPixelOrderHScan[PIXELS];
+
+ inline ColorFloatRGBA * GetDecodedColors(void)
+ {
+ return m_pencoding->GetDecodedColors();
+ }
+
+ inline float * GetDecodedAlphas(void)
+ {
+ return m_pencoding->GetDecodedAlphas();
+ }
+
+ inline Block4x4Encoding::Mode GetEncodingMode(void)
+ {
+ return m_pencoding->GetMode();
+ }
+
+ inline bool GetFlip(void)
+ {
+ return m_pencoding->GetFlip();
+ }
+
+ inline bool IsDifferential(void)
+ {
+ return m_pencoding->IsDifferential();
+ }
+
+ inline ColorFloatRGBA * GetSource()
+ {
+ return m_afrgbaSource;
+ }
+
+ inline ErrorMetric GetErrorMetric()
+ {
+ return m_errormetric;
+ }
+
+ const char * GetEncodingModeName(void);
+
+ inline Block4x4Encoding * GetEncoding(void)
+ {
+ return m_pencoding;
+ }
+
+ inline SourceAlphaMix GetSourceAlphaMix(void)
+ {
+ return m_sourcealphamix;
+ }
+
+ inline Image * GetImageSource(void)
+ {
+ return m_pimageSource;
+ }
+
+ inline bool HasBorderPixels(void)
+ {
+ return m_boolBorderPixels;
+ }
+
+ inline bool HasPunchThroughPixels(void)
+ {
+ return m_boolPunchThroughPixels;
+ }
+
+ private:
+
+ void SetSourcePixels(void);
+
+ Image *m_pimageSource;
+ unsigned int m_uiSourceH;
+ unsigned int m_uiSourceV;
+ ErrorMetric m_errormetric;
+ ColorFloatRGBA m_afrgbaSource[PIXELS]; // vertical scan
+
+ SourceAlphaMix m_sourcealphamix;
+ bool m_boolBorderPixels; // marked as rgba(NAN, NAN, NAN, NAN)
+ bool m_boolPunchThroughPixels; // RGB8A1 or SRGB8A1 with any pixels with alpha < 0.5
+
+ Block4x4Encoding *m_pencoding;
+
+ };
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding.cpp
new file mode 100644
index 0000000000..7a9e68c4cf
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding.cpp
@@ -0,0 +1,261 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcBlock4x4Encoding.cpp
+
+Block4x4Encoding is the abstract base class for the different encoders. Each encoder targets a
+particular file format (e.g. ETC1, RGB8, RGBA8, R11)
+
+*/
+
+#include "EtcConfig.h"
+#include "EtcBlock4x4Encoding.h"
+
+#include "EtcBlock4x4EncodingBits.h"
+#include "EtcBlock4x4.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+namespace Etc
+{
+ // ----------------------------------------------------------------------------------------------------
+ //
+ const float Block4x4Encoding::LUMA_WEIGHT = 3.0f;
+ const float Block4x4Encoding::CHROMA_BLUE_WEIGHT = 0.5f;
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ Block4x4Encoding::Block4x4Encoding(void)
+ {
+
+ m_pblockParent = nullptr;
+
+ m_pafrgbaSource = nullptr;
+
+ m_boolBorderPixels = false;
+
+ m_fError = -1.0f;
+
+ m_mode = MODE_UNKNOWN;
+
+ m_uiEncodingIterations = 0;
+ m_boolDone = false;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afrgbaDecodedColors[uiPixel] = ColorFloatRGBA(-1.0f, -1.0f, -1.0f, -1.0f);
+ m_afDecodedAlphas[uiPixel] = -1.0f;
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialize the generic encoding for a 4x4 block
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // init the decoded pixels to -1 to mark them as undefined
+ // init the error to -1 to mark it as undefined
+ //
+ void Block4x4Encoding::Init(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric)
+ {
+
+ m_pblockParent = a_pblockParent;
+
+ m_pafrgbaSource = a_pafrgbaSource;
+
+ m_boolBorderPixels = m_pblockParent->HasBorderPixels();
+
+ m_fError = -1.0f;
+
+ m_uiEncodingIterations = 0;
+
+ m_errormetric = a_errormetric;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afrgbaDecodedColors[uiPixel] = ColorFloatRGBA(-1.0f, -1.0f, -1.0f, -1.0f);
+ m_afDecodedAlphas[uiPixel] = -1.0f;
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // calculate the error for the block by summing the pixel errors
+ //
+ void Block4x4Encoding::CalcBlockError(void)
+ {
+ m_fError = 0.0f;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_fError += CalcPixelError(m_afrgbaDecodedColors[uiPixel], m_afDecodedAlphas[uiPixel],
+ m_pafrgbaSource[uiPixel]);
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // calculate the error between the source pixel and the decoded pixel
+ // the error amount is base on the error metric
+ //
+ float Block4x4Encoding::CalcPixelError(ColorFloatRGBA a_frgbaDecodedColor, float a_fDecodedAlpha,
+ ColorFloatRGBA a_frgbaSourcePixel)
+ {
+
+ // if a border pixel
+ if (isnan(a_frgbaSourcePixel.fA))
+ {
+ return 0.0f;
+ }
+
+ if (m_errormetric == ErrorMetric::RGBA)
+ {
+ assert(a_fDecodedAlpha >= 0.0f);
+
+ float fDRed = (a_fDecodedAlpha * a_frgbaDecodedColor.fR) -
+ (a_frgbaSourcePixel.fA * a_frgbaSourcePixel.fR);
+ float fDGreen = (a_fDecodedAlpha * a_frgbaDecodedColor.fG) -
+ (a_frgbaSourcePixel.fA * a_frgbaSourcePixel.fG);
+ float fDBlue = (a_fDecodedAlpha * a_frgbaDecodedColor.fB) -
+ (a_frgbaSourcePixel.fA * a_frgbaSourcePixel.fB);
+
+ float fDAlpha = a_fDecodedAlpha - a_frgbaSourcePixel.fA;
+
+ return fDRed*fDRed + fDGreen*fDGreen + fDBlue*fDBlue + fDAlpha*fDAlpha;
+ }
+ else if (m_errormetric == ErrorMetric::RGBX)
+ {
+ assert(a_fDecodedAlpha >= 0.0f);
+
+ float fDRed = a_frgbaDecodedColor.fR - a_frgbaSourcePixel.fR;
+ float fDGreen = a_frgbaDecodedColor.fG - a_frgbaSourcePixel.fG;
+ float fDBlue = a_frgbaDecodedColor.fB - a_frgbaSourcePixel.fB;
+ float fDAlpha = a_fDecodedAlpha - a_frgbaSourcePixel.fA;
+
+ return fDRed*fDRed + fDGreen*fDGreen + fDBlue*fDBlue + fDAlpha*fDAlpha;
+ }
+ else if (m_errormetric == ErrorMetric::REC709)
+ {
+ assert(a_fDecodedAlpha >= 0.0f);
+
+ float fLuma1 = a_frgbaSourcePixel.fR*0.2126f + a_frgbaSourcePixel.fG*0.7152f + a_frgbaSourcePixel.fB*0.0722f;
+ float fChromaR1 = 0.5f * ((a_frgbaSourcePixel.fR - fLuma1) * (1.0f / (1.0f - 0.2126f)));
+ float fChromaB1 = 0.5f * ((a_frgbaSourcePixel.fB - fLuma1) * (1.0f / (1.0f - 0.0722f)));
+
+ float fLuma2 = a_frgbaDecodedColor.fR*0.2126f +
+ a_frgbaDecodedColor.fG*0.7152f +
+ a_frgbaDecodedColor.fB*0.0722f;
+ float fChromaR2 = 0.5f * ((a_frgbaDecodedColor.fR - fLuma2) * (1.0f / (1.0f - 0.2126f)));
+ float fChromaB2 = 0.5f * ((a_frgbaDecodedColor.fB - fLuma2) * (1.0f / (1.0f - 0.0722f)));
+
+ float fDeltaL = a_frgbaSourcePixel.fA * fLuma1 - a_fDecodedAlpha * fLuma2;
+ float fDeltaCr = a_frgbaSourcePixel.fA * fChromaR1 - a_fDecodedAlpha * fChromaR2;
+ float fDeltaCb = a_frgbaSourcePixel.fA * fChromaB1 - a_fDecodedAlpha * fChromaB2;
+
+ float fDAlpha = a_fDecodedAlpha - a_frgbaSourcePixel.fA;
+
+ // Favor Luma accuracy over Chroma, and Red over Blue
+ return LUMA_WEIGHT*fDeltaL*fDeltaL +
+ fDeltaCr*fDeltaCr +
+ CHROMA_BLUE_WEIGHT*fDeltaCb*fDeltaCb +
+ fDAlpha*fDAlpha;
+ #if 0
+ float fDRed = a_frgbaDecodedPixel.fR - a_frgbaSourcePixel.fR;
+ float fDGreen = a_frgbaDecodedPixel.fG - a_frgbaSourcePixel.fG;
+ float fDBlue = a_frgbaDecodedPixel.fB - a_frgbaSourcePixel.fB;
+ return 2.0f * 3.0f * fDeltaL * fDeltaL + fDRed*fDRed + fDGreen*fDGreen + fDBlue*fDBlue;
+#endif
+ }
+ else if (m_errormetric == ErrorMetric::NORMALXYZ)
+ {
+ float fDecodedX = 2.0f * a_frgbaDecodedColor.fR - 1.0f;
+ float fDecodedY = 2.0f * a_frgbaDecodedColor.fG - 1.0f;
+ float fDecodedZ = 2.0f * a_frgbaDecodedColor.fB - 1.0f;
+
+ float fDecodedLength = sqrtf(fDecodedX*fDecodedX + fDecodedY*fDecodedY + fDecodedZ*fDecodedZ);
+
+ if (fDecodedLength < 0.5f)
+ {
+ return 1.0f;
+ }
+ else if (fDecodedLength == 0.0f)
+ {
+ fDecodedX = 1.0f;
+ fDecodedY = 0.0f;
+ fDecodedZ = 0.0f;
+ }
+ else
+ {
+ fDecodedX /= fDecodedLength;
+ fDecodedY /= fDecodedLength;
+ fDecodedZ /= fDecodedLength;
+ }
+
+ float fSourceX = 2.0f * a_frgbaSourcePixel.fR - 1.0f;
+ float fSourceY = 2.0f * a_frgbaSourcePixel.fG - 1.0f;
+ float fSourceZ = 2.0f * a_frgbaSourcePixel.fB - 1.0f;
+
+ float fSourceLength = sqrtf(fSourceX*fSourceX + fSourceY*fSourceY + fSourceZ*fSourceZ);
+
+ if (fSourceLength == 0.0f)
+ {
+ fSourceX = 1.0f;
+ fSourceY = 0.0f;
+ fSourceZ = 0.0f;
+ }
+ else
+ {
+ fSourceX /= fSourceLength;
+ fSourceY /= fSourceLength;
+ fSourceZ /= fSourceLength;
+ }
+
+ float fDotProduct = fSourceX*fDecodedX + fSourceY*fDecodedY + fSourceZ*fDecodedZ;
+ float fNormalizedDotProduct = 1.0f - 0.5f * (fDotProduct + 1.0f);
+ float fDotProductError = fNormalizedDotProduct * fNormalizedDotProduct;
+
+ float fLength2 = fDecodedX*fDecodedX + fDecodedY*fDecodedY + fDecodedZ*fDecodedZ;
+ float fLength2Error = fabsf(1.0f - fLength2);
+
+ float fDeltaW = a_frgbaDecodedColor.fA - a_frgbaSourcePixel.fA;
+ float fErrorW = fDeltaW * fDeltaW;
+
+ return fDotProductError + fLength2Error + fErrorW;
+ }
+ else // ErrorMetric::NUMERIC
+ {
+ assert(a_fDecodedAlpha >= 0.0f);
+
+ float fDX = a_frgbaDecodedColor.fR - a_frgbaSourcePixel.fR;
+ float fDY = a_frgbaDecodedColor.fG - a_frgbaSourcePixel.fG;
+ float fDZ = a_frgbaDecodedColor.fB - a_frgbaSourcePixel.fB;
+ float fDW = a_frgbaDecodedColor.fA - a_frgbaSourcePixel.fA;
+
+ return fDX*fDX + fDY*fDY + fDZ*fDZ + fDW*fDW;
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
+
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding.h b/thirdparty/etc2comp/EtcBlock4x4Encoding.h
new file mode 100644
index 0000000000..c14c3b8616
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding.h
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcColorFloatRGBA.h"
+
+#include "EtcErrorMetric.h"
+
+#include <assert.h>
+#include <float.h>
+
+namespace Etc
+{
+ class Block4x4;
+
+ // abstract base class for specific encodings
+ class Block4x4Encoding
+ {
+ public:
+
+ static const unsigned int ROWS = 4;
+ static const unsigned int COLUMNS = 4;
+ static const unsigned int PIXELS = ROWS * COLUMNS;
+ static const float LUMA_WEIGHT;
+ static const float CHROMA_BLUE_WEIGHT;
+
+ typedef enum
+ {
+ MODE_UNKNOWN,
+ //
+ MODE_ETC1,
+ MODE_T,
+ MODE_H,
+ MODE_PLANAR,
+ MODE_R11,
+ MODE_RG11,
+ //
+ MODES
+ } Mode;
+
+ Block4x4Encoding(void);
+ //virtual ~Block4x4Encoding(void) =0;
+ virtual ~Block4x4Encoding(void) {}
+ virtual void InitFromSource(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+
+ unsigned char *a_paucEncodingBits, ErrorMetric a_errormetric) = 0;
+
+ virtual void InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+
+ ErrorMetric a_errormetric) = 0;
+
+ // perform an iteration of the encoding
+ // the first iteration must generate a complete, valid (if poor) encoding
+ virtual void PerformIteration(float a_fEffort) = 0;
+
+ void CalcBlockError(void);
+
+ inline float GetError(void)
+ {
+ assert(m_fError >= 0.0f);
+
+ return m_fError;
+ }
+
+ inline ColorFloatRGBA * GetDecodedColors(void)
+ {
+ return m_afrgbaDecodedColors;
+ }
+
+ inline float * GetDecodedAlphas(void)
+ {
+ return m_afDecodedAlphas;
+ }
+
+ virtual void SetEncodingBits(void) = 0;
+
+ virtual bool GetFlip(void) = 0;
+
+ virtual bool IsDifferential(void) = 0;
+
+ virtual bool HasSeverelyBentDifferentialColors(void) const = 0;
+
+ inline Mode GetMode(void)
+ {
+ return m_mode;
+ }
+
+ inline bool IsDone(void)
+ {
+ return m_boolDone;
+ }
+
+ inline void SetDoneIfPerfect()
+ {
+ if (GetError() == 0.0f)
+ {
+ m_boolDone = true;
+ }
+ }
+
+ float CalcPixelError(ColorFloatRGBA a_frgbaDecodedColor, float a_fDecodedAlpha,
+ ColorFloatRGBA a_frgbaSourcePixel);
+
+ protected:
+
+ void Init(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+
+ ErrorMetric a_errormetric);
+
+ Block4x4 *m_pblockParent;
+ ColorFloatRGBA *m_pafrgbaSource;
+
+ bool m_boolBorderPixels; // if block has any border pixels
+
+ ColorFloatRGBA m_afrgbaDecodedColors[PIXELS]; // decoded RGB components, ignore Alpha
+ float m_afDecodedAlphas[PIXELS]; // decoded alpha component
+ float m_fError; // error for RGBA relative to m_pafrgbaSource
+
+ // intermediate encoding
+ Mode m_mode;
+
+ unsigned int m_uiEncodingIterations;
+ bool m_boolDone; // all iterations have been done
+ ErrorMetric m_errormetric;
+
+ private:
+
+ };
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcBlock4x4EncodingBits.h b/thirdparty/etc2comp/EtcBlock4x4EncodingBits.h
new file mode 100644
index 0000000000..4065700379
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4EncodingBits.h
@@ -0,0 +1,315 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <assert.h>
+
+namespace Etc
+{
+
+ // ################################################################################
+ // Block4x4EncodingBits
+ // Base class for Block4x4EncodingBits_XXXX
+ // ################################################################################
+
+ class Block4x4EncodingBits
+ {
+ public:
+
+ enum class Format
+ {
+ UNKNOWN,
+ //
+ RGB8,
+ RGBA8,
+ R11,
+ RG11,
+ RGB8A1,
+ //
+ FORMATS
+ };
+
+ static unsigned int GetBytesPerBlock(Format a_format)
+ {
+ switch (a_format)
+ {
+ case Format::RGB8:
+ case Format::R11:
+ case Format::RGB8A1:
+ return 8;
+ break;
+
+ case Format::RGBA8:
+ case Format::RG11:
+ return 16;
+ break;
+
+ default:
+ return 0;
+ break;
+ }
+
+ }
+
+ };
+
+ // ################################################################################
+ // Block4x4EncodingBits_RGB8
+ // Encoding bits for the RGB portion of ETC1, RGB8, RGB8A1 and RGBA8
+ // ################################################################################
+
+ class Block4x4EncodingBits_RGB8
+ {
+ public:
+
+ static const unsigned int BYTES_PER_BLOCK = 8;
+
+ inline Block4x4EncodingBits_RGB8(void)
+ {
+ assert(sizeof(Block4x4EncodingBits_RGB8) == BYTES_PER_BLOCK);
+
+ for (unsigned int uiByte = 0; uiByte < BYTES_PER_BLOCK; uiByte++)
+ {
+ auc[uiByte] = 0;
+ }
+
+ }
+
+ typedef struct
+ {
+ unsigned red2 : 4;
+ unsigned red1 : 4;
+ //
+ unsigned green2 : 4;
+ unsigned green1 : 4;
+ //
+ unsigned blue2 : 4;
+ unsigned blue1 : 4;
+ //
+ unsigned flip : 1;
+ unsigned diff : 1;
+ unsigned cw2 : 3;
+ unsigned cw1 : 3;
+ //
+ unsigned int selectors;
+ } Individual;
+
+ typedef struct
+ {
+ signed dred2 : 3;
+ unsigned red1 : 5;
+ //
+ signed dgreen2 : 3;
+ unsigned green1 : 5;
+ //
+ signed dblue2 : 3;
+ unsigned blue1 : 5;
+ //
+ unsigned flip : 1;
+ unsigned diff : 1;
+ unsigned cw2 : 3;
+ unsigned cw1 : 3;
+ //
+ unsigned int selectors;
+ } Differential;
+
+ typedef struct
+ {
+ unsigned red1b : 2;
+ unsigned detect2 : 1;
+ unsigned red1a : 2;
+ unsigned detect1 : 3;
+ //
+ unsigned blue1 : 4;
+ unsigned green1 : 4;
+ //
+ unsigned green2 : 4;
+ unsigned red2 : 4;
+ //
+ unsigned db : 1;
+ unsigned diff : 1;
+ unsigned da : 2;
+ unsigned blue2 : 4;
+ //
+ unsigned int selectors;
+ } T;
+
+ typedef struct
+ {
+ unsigned green1a : 3;
+ unsigned red1 : 4;
+ unsigned detect1 : 1;
+ //
+ unsigned blue1b : 2;
+ unsigned detect3 : 1;
+ unsigned blue1a : 1;
+ unsigned green1b : 1;
+ unsigned detect2 : 3;
+ //
+ unsigned green2a : 3;
+ unsigned red2 : 4;
+ unsigned blue1c : 1;
+ //
+ unsigned db : 1;
+ unsigned diff : 1;
+ unsigned da : 1;
+ unsigned blue2 : 4;
+ unsigned green2b : 1;
+ //
+ unsigned int selectors;
+ } H;
+
+ typedef struct
+ {
+ unsigned originGreen1 : 1;
+ unsigned originRed : 6;
+ unsigned detect1 : 1;
+ //
+ unsigned originBlue1 : 1;
+ unsigned originGreen2 : 6;
+ unsigned detect2 : 1;
+ //
+ unsigned originBlue3 : 2;
+ unsigned detect4 : 1;
+ unsigned originBlue2 : 2;
+ unsigned detect3 : 3;
+ //
+ unsigned horizRed2 : 1;
+ unsigned diff : 1;
+ unsigned horizRed1 : 5;
+ unsigned originBlue4 : 1;
+ //
+ unsigned horizBlue1: 1;
+ unsigned horizGreen : 7;
+ //
+ unsigned vertRed1 : 3;
+ unsigned horizBlue2 : 5;
+ //
+ unsigned vertGreen1 : 5;
+ unsigned vertRed2 : 3;
+ //
+ unsigned vertBlue : 6;
+ unsigned vertGreen2 : 2;
+ } Planar;
+
+ union
+ {
+ unsigned char auc[BYTES_PER_BLOCK];
+ unsigned long int ul;
+ Individual individual;
+ Differential differential;
+ T t;
+ H h;
+ Planar planar;
+ };
+
+ };
+
+ // ################################################################################
+ // Block4x4EncodingBits_A8
+ // Encoding bits for the A portion of RGBA8
+ // ################################################################################
+
+ class Block4x4EncodingBits_A8
+ {
+ public:
+
+ static const unsigned int BYTES_PER_BLOCK = 8;
+ static const unsigned int SELECTOR_BYTES = 6;
+
+ typedef struct
+ {
+ unsigned base : 8;
+ unsigned table : 4;
+ unsigned multiplier : 4;
+ unsigned selectors0 : 8;
+ unsigned selectors1 : 8;
+ unsigned selectors2 : 8;
+ unsigned selectors3 : 8;
+ unsigned selectors4 : 8;
+ unsigned selectors5 : 8;
+ } Data;
+
+ Data data;
+
+ };
+
+ // ################################################################################
+ // Block4x4EncodingBits_R11
+ // Encoding bits for the R portion of R11
+ // ################################################################################
+
+ class Block4x4EncodingBits_R11
+ {
+ public:
+
+ static const unsigned int BYTES_PER_BLOCK = 8;
+ static const unsigned int SELECTOR_BYTES = 6;
+
+ typedef struct
+ {
+ unsigned base : 8;
+ unsigned table : 4;
+ unsigned multiplier : 4;
+ unsigned selectors0 : 8;
+ unsigned selectors1 : 8;
+ unsigned selectors2 : 8;
+ unsigned selectors3 : 8;
+ unsigned selectors4 : 8;
+ unsigned selectors5 : 8;
+ } Data;
+
+ Data data;
+
+ };
+
+ class Block4x4EncodingBits_RG11
+ {
+ public:
+
+ static const unsigned int BYTES_PER_BLOCK = 16;
+ static const unsigned int SELECTOR_BYTES = 12;
+
+ typedef struct
+ {
+ //Red portion
+ unsigned baseR : 8;
+ unsigned tableIndexR : 4;
+ unsigned multiplierR : 4;
+ unsigned selectorsR0 : 8;
+ unsigned selectorsR1 : 8;
+ unsigned selectorsR2 : 8;
+ unsigned selectorsR3 : 8;
+ unsigned selectorsR4 : 8;
+ unsigned selectorsR5 : 8;
+ //Green portion
+ unsigned baseG : 8;
+ unsigned tableIndexG : 4;
+ unsigned multiplierG : 4;
+ unsigned selectorsG0 : 8;
+ unsigned selectorsG1 : 8;
+ unsigned selectorsG2 : 8;
+ unsigned selectorsG3 : 8;
+ unsigned selectorsG4 : 8;
+ unsigned selectorsG5 : 8;
+ } Data;
+
+ Data data;
+
+ };
+
+}
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_ETC1.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_ETC1.cpp
new file mode 100644
index 0000000000..a27f74c0d5
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_ETC1.cpp
@@ -0,0 +1,1281 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcBlock4x4Encoding_ETC1.cpp
+
+Block4x4Encoding_ETC1 is the encoder to use when targetting file format ETC1. This encoder is also
+used for the ETC1 subset of file format RGB8, RGBA8 and RGB8A1
+
+*/
+
+#include "EtcConfig.h"
+#include "EtcBlock4x4Encoding_ETC1.h"
+
+#include "EtcBlock4x4.h"
+#include "EtcBlock4x4EncodingBits.h"
+#include "EtcDifferentialTrys.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <float.h>
+#include <limits>
+
+namespace Etc
+{
+
+ // pixel processing order if the flip bit = 0 (horizontal split)
+ const unsigned int Block4x4Encoding_ETC1::s_auiPixelOrderFlip0[PIXELS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+
+ // pixel processing order if the flip bit = 1 (vertical split)
+ const unsigned int Block4x4Encoding_ETC1::s_auiPixelOrderFlip1[PIXELS] = { 0, 1, 4, 5, 8, 9, 12, 13, 2, 3, 6, 7, 10, 11, 14, 15 };
+
+ // pixel processing order for horizontal scan (ETC normally does a vertical scan)
+ const unsigned int Block4x4Encoding_ETC1::s_auiPixelOrderHScan[PIXELS] = { 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15 };
+
+ // pixel indices for different block halves
+ const unsigned int Block4x4Encoding_ETC1::s_auiLeftPixelMapping[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+ const unsigned int Block4x4Encoding_ETC1::s_auiRightPixelMapping[8] = { 8, 9, 10, 11, 12, 13, 14, 15 };
+ const unsigned int Block4x4Encoding_ETC1::s_auiTopPixelMapping[8] = { 0, 1, 4, 5, 8, 9, 12, 13 };
+ const unsigned int Block4x4Encoding_ETC1::s_auiBottomPixelMapping[8] = { 2, 3, 6, 7, 10, 11, 14, 15 };
+
+ // CW ranges that the ETC1 decoders use
+ // CW is basically a contrast for the different selector bits, since these values are offsets to the base color
+ // the first axis in the array is indexed by the CW in the encoding bits
+ // the second axis in the array is indexed by the selector bits
+ float Block4x4Encoding_ETC1::s_aafCwTable[CW_RANGES][SELECTORS] =
+ {
+ { 2.0f / 255.0f, 8.0f / 255.0f, -2.0f / 255.0f, -8.0f / 255.0f },
+ { 5.0f / 255.0f, 17.0f / 255.0f, -5.0f / 255.0f, -17.0f / 255.0f },
+ { 9.0f / 255.0f, 29.0f / 255.0f, -9.0f / 255.0f, -29.0f / 255.0f },
+ { 13.0f / 255.0f, 42.0f / 255.0f, -13.0f / 255.0f, -42.0f / 255.0f },
+ { 18.0f / 255.0f, 60.0f / 255.0f, -18.0f / 255.0f, -60.0f / 255.0f },
+ { 24.0f / 255.0f, 80.0f / 255.0f, -24.0f / 255.0f, -80.0f / 255.0f },
+ { 33.0f / 255.0f, 106.0f / 255.0f, -33.0f / 255.0f, -106.0f / 255.0f },
+ { 47.0f / 255.0f, 183.0f / 255.0f, -47.0f / 255.0f, -183.0f / 255.0f }
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ Block4x4Encoding_ETC1::Block4x4Encoding_ETC1(void)
+ {
+ m_mode = MODE_ETC1;
+ m_boolDiff = false;
+ m_boolFlip = false;
+ m_frgbaColor1 = ColorFloatRGBA();
+ m_frgbaColor2 = ColorFloatRGBA();
+ m_uiCW1 = 0;
+ m_uiCW2 = 0;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = 0;
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ }
+
+ m_boolMostLikelyFlip = false;
+
+ m_fError = -1.0f;
+
+ m_fError1 = -1.0f;
+ m_fError2 = -1.0f;
+ m_boolSeverelyBentDifferentialColors = false;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ }
+
+ }
+
+ Block4x4Encoding_ETC1::~Block4x4Encoding_ETC1(void) {}
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization prior to encoding
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // a_pafrgbaSource points to a 4x4 block subset of the source image
+ // a_paucEncodingBits points to the final encoding bits
+ //
+ void Block4x4Encoding_ETC1::InitFromSource(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+ unsigned char *a_paucEncodingBits, ErrorMetric a_errormetric)
+ {
+
+ Block4x4Encoding::Init(a_pblockParent, a_pafrgbaSource,a_errormetric);
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ }
+
+ m_fError = -1.0f;
+
+ m_pencodingbitsRGB8 = (Block4x4EncodingBits_RGB8 *)(a_paucEncodingBits);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // a_pafrgbaSource points to a 4x4 block subset of the source image
+ // a_paucEncodingBits points to the final encoding bits of a previous encoding
+ //
+ void Block4x4Encoding_ETC1::InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric)
+ {
+
+ Block4x4Encoding::Init(a_pblockParent, a_pafrgbaSource,a_errormetric);
+ m_fError = -1.0f;
+
+ m_pencodingbitsRGB8 = (Block4x4EncodingBits_RGB8 *)a_paucEncodingBits;
+
+ m_mode = MODE_ETC1;
+ m_boolDiff = m_pencodingbitsRGB8->individual.diff;
+ m_boolFlip = m_pencodingbitsRGB8->individual.flip;
+ if (m_boolDiff)
+ {
+ int iR2 = (int)(m_pencodingbitsRGB8->differential.red1 + m_pencodingbitsRGB8->differential.dred2);
+ if (iR2 < 0)
+ {
+ iR2 = 0;
+ }
+ else if (iR2 > 31)
+ {
+ iR2 = 31;
+ }
+
+ int iG2 = (int)(m_pencodingbitsRGB8->differential.green1 + m_pencodingbitsRGB8->differential.dgreen2);
+ if (iG2 < 0)
+ {
+ iG2 = 0;
+ }
+ else if (iG2 > 31)
+ {
+ iG2 = 31;
+ }
+
+ int iB2 = (int)(m_pencodingbitsRGB8->differential.blue1 + m_pencodingbitsRGB8->differential.dblue2);
+ if (iB2 < 0)
+ {
+ iB2 = 0;
+ }
+ else if (iB2 > 31)
+ {
+ iB2 = 31;
+ }
+
+ m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB5(m_pencodingbitsRGB8->differential.red1, m_pencodingbitsRGB8->differential.green1, m_pencodingbitsRGB8->differential.blue1);
+ m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB5((unsigned char)iR2, (unsigned char)iG2, (unsigned char)iB2);
+
+ }
+ else
+ {
+ m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4(m_pencodingbitsRGB8->individual.red1, m_pencodingbitsRGB8->individual.green1, m_pencodingbitsRGB8->individual.blue1);
+ m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4(m_pencodingbitsRGB8->individual.red2, m_pencodingbitsRGB8->individual.green2, m_pencodingbitsRGB8->individual.blue2);
+ }
+
+ m_uiCW1 = m_pencodingbitsRGB8->individual.cw1;
+ m_uiCW2 = m_pencodingbitsRGB8->individual.cw2;
+
+ InitFromEncodingBits_Selectors();
+
+ Decode();
+
+ CalcBlockError();
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // init the selectors from a prior encoding
+ //
+ void Block4x4Encoding_ETC1::InitFromEncodingBits_Selectors(void)
+ {
+
+ unsigned char *paucSelectors = (unsigned char *)&m_pencodingbitsRGB8->individual.selectors;
+
+ for (unsigned int iPixel = 0; iPixel < PIXELS; iPixel++)
+ {
+ unsigned int uiByteMSB = (unsigned int)(1 - (iPixel / 8));
+ unsigned int uiByteLSB = (unsigned int)(3 - (iPixel / 8));
+ unsigned int uiShift = (unsigned int)(iPixel & 7);
+
+ unsigned int uiSelectorMSB = (unsigned int)((paucSelectors[uiByteMSB] >> uiShift) & 1);
+ unsigned int uiSelectorLSB = (unsigned int)((paucSelectors[uiByteLSB] >> uiShift) & 1);
+
+ m_auiSelectors[iPixel] = (uiSelectorMSB << 1) + uiSelectorLSB;
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // perform a single encoding iteration
+ // replace the encoding if a better encoding was found
+ // subsequent iterations generally take longer for each iteration
+ // set m_boolDone if encoding is perfect or encoding is finished based on a_fEffort
+ //
+ void Block4x4Encoding_ETC1::PerformIteration(float a_fEffort)
+ {
+ assert(!m_boolDone);
+
+ switch (m_uiEncodingIterations)
+ {
+ case 0:
+ PerformFirstIteration();
+ break;
+
+ case 1:
+ TryDifferential(m_boolMostLikelyFlip, 1, 0, 0);
+ break;
+
+ case 2:
+ TryIndividual(m_boolMostLikelyFlip, 1);
+ if (a_fEffort <= 49.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 3:
+ TryDifferential(!m_boolMostLikelyFlip, 1, 0, 0);
+ if (a_fEffort <= 59.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 4:
+ TryIndividual(!m_boolMostLikelyFlip, 1);
+ if (a_fEffort <= 69.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 5:
+ TryDegenerates1();
+ if (a_fEffort <= 79.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 6:
+ TryDegenerates2();
+ if (a_fEffort <= 89.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 7:
+ TryDegenerates3();
+ if (a_fEffort <= 99.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 8:
+ TryDegenerates4();
+ m_boolDone = true;
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+ m_uiEncodingIterations++;
+ SetDoneIfPerfect();
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // find best initial encoding to ensure block has a valid encoding
+ //
+ void Block4x4Encoding_ETC1::PerformFirstIteration(void)
+ {
+ CalculateMostLikelyFlip();
+
+ m_fError = FLT_MAX;
+
+ TryDifferential(m_boolMostLikelyFlip, 0, 0, 0);
+ SetDoneIfPerfect();
+ if (m_boolDone)
+ {
+ return;
+ }
+
+ TryIndividual(m_boolMostLikelyFlip, 0);
+ SetDoneIfPerfect();
+ if (m_boolDone)
+ {
+ return;
+ }
+ TryDifferential(!m_boolMostLikelyFlip, 0, 0, 0);
+ SetDoneIfPerfect();
+ if (m_boolDone)
+ {
+ return;
+ }
+ TryIndividual(!m_boolMostLikelyFlip, 0);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // algorithm:
+ // create a source average color for the Left, Right, Top and Bottom halves using the 8 pixels in each half
+ // note: the "gray line" is the line of equal delta RGB that goes thru the average color
+ // for each half:
+ // see how close each of the 8 pixels are to the "gray line" that goes thru the source average color
+ // create an error value that is the sum of the distances from the gray line
+ // h_error is the sum of Left and Right errors
+ // v_error is the sum of Top and Bottom errors
+ //
+ void Block4x4Encoding_ETC1::CalculateMostLikelyFlip(void)
+ {
+ static const bool DEBUG_PRINT = false;
+
+ CalculateSourceAverages();
+
+ float fLeftGrayErrorSum = 0.0f;
+ float fRightGrayErrorSum = 0.0f;
+ float fTopGrayErrorSum = 0.0f;
+ float fBottomGrayErrorSum = 0.0f;
+
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ ColorFloatRGBA *pfrgbaLeft = &m_pafrgbaSource[uiPixel];
+ ColorFloatRGBA *pfrgbaRight = &m_pafrgbaSource[uiPixel + 8];
+ ColorFloatRGBA *pfrgbaTop = &m_pafrgbaSource[s_auiTopPixelMapping[uiPixel]];
+ ColorFloatRGBA *pfrgbaBottom = &m_pafrgbaSource[s_auiBottomPixelMapping[uiPixel]];
+
+ float fLeftGrayError = CalcGrayDistance2(*pfrgbaLeft, m_frgbaSourceAverageLeft);
+ float fRightGrayError = CalcGrayDistance2(*pfrgbaRight, m_frgbaSourceAverageRight);
+ float fTopGrayError = CalcGrayDistance2(*pfrgbaTop, m_frgbaSourceAverageTop);
+ float fBottomGrayError = CalcGrayDistance2(*pfrgbaBottom, m_frgbaSourceAverageBottom);
+
+ fLeftGrayErrorSum += fLeftGrayError;
+ fRightGrayErrorSum += fRightGrayError;
+ fTopGrayErrorSum += fTopGrayError;
+ fBottomGrayErrorSum += fBottomGrayError;
+ }
+
+ if (DEBUG_PRINT)
+ {
+ printf("\n%.2f %.2f\n", fLeftGrayErrorSum + fRightGrayErrorSum, fTopGrayErrorSum + fBottomGrayErrorSum);
+ }
+
+ m_boolMostLikelyFlip = (fTopGrayErrorSum + fBottomGrayErrorSum) < (fLeftGrayErrorSum + fRightGrayErrorSum);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // calculate source pixel averages for each 2x2 quadrant in a 4x4 block
+ // these are used to determine the averages for each of the 4 different halves (left, right, top, bottom)
+ // ignore pixels that have alpha == NAN (these are border pixels outside of the source image)
+ // weight the averages based on a pixel's alpha
+ //
+ void Block4x4Encoding_ETC1::CalculateSourceAverages(void)
+ {
+ static const bool DEBUG_PRINT = false;
+
+ bool boolRGBX = m_pblockParent->GetImageSource()->GetErrorMetric() == ErrorMetric::RGBX;
+
+ if (m_pblockParent->GetSourceAlphaMix() == Block4x4::SourceAlphaMix::OPAQUE || boolRGBX)
+ {
+ ColorFloatRGBA frgbaSumUL = m_pafrgbaSource[0] + m_pafrgbaSource[1] + m_pafrgbaSource[4] + m_pafrgbaSource[5];
+ ColorFloatRGBA frgbaSumLL = m_pafrgbaSource[2] + m_pafrgbaSource[3] + m_pafrgbaSource[6] + m_pafrgbaSource[7];
+ ColorFloatRGBA frgbaSumUR = m_pafrgbaSource[8] + m_pafrgbaSource[9] + m_pafrgbaSource[12] + m_pafrgbaSource[13];
+ ColorFloatRGBA frgbaSumLR = m_pafrgbaSource[10] + m_pafrgbaSource[11] + m_pafrgbaSource[14] + m_pafrgbaSource[15];
+
+ m_frgbaSourceAverageLeft = (frgbaSumUL + frgbaSumLL) * 0.125f;
+ m_frgbaSourceAverageRight = (frgbaSumUR + frgbaSumLR) * 0.125f;
+ m_frgbaSourceAverageTop = (frgbaSumUL + frgbaSumUR) * 0.125f;
+ m_frgbaSourceAverageBottom = (frgbaSumLL + frgbaSumLR) * 0.125f;
+ }
+ else
+ {
+ float afSourceAlpha[PIXELS];
+
+ // treat alpha NAN as 0.0f
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ afSourceAlpha[uiPixel] = isnan(m_pafrgbaSource[uiPixel].fA) ?
+ 0.0f :
+ m_pafrgbaSource[uiPixel].fA;
+ }
+
+ ColorFloatRGBA afrgbaAlphaWeightedSource[PIXELS];
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ afrgbaAlphaWeightedSource[uiPixel] = m_pafrgbaSource[uiPixel] * afSourceAlpha[uiPixel];
+ }
+
+ ColorFloatRGBA frgbaSumUL = afrgbaAlphaWeightedSource[0] +
+ afrgbaAlphaWeightedSource[1] +
+ afrgbaAlphaWeightedSource[4] +
+ afrgbaAlphaWeightedSource[5];
+
+ ColorFloatRGBA frgbaSumLL = afrgbaAlphaWeightedSource[2] +
+ afrgbaAlphaWeightedSource[3] +
+ afrgbaAlphaWeightedSource[6] +
+ afrgbaAlphaWeightedSource[7];
+
+ ColorFloatRGBA frgbaSumUR = afrgbaAlphaWeightedSource[8] +
+ afrgbaAlphaWeightedSource[9] +
+ afrgbaAlphaWeightedSource[12] +
+ afrgbaAlphaWeightedSource[13];
+
+ ColorFloatRGBA frgbaSumLR = afrgbaAlphaWeightedSource[10] +
+ afrgbaAlphaWeightedSource[11] +
+ afrgbaAlphaWeightedSource[14] +
+ afrgbaAlphaWeightedSource[15];
+
+ float fWeightSumUL = afSourceAlpha[0] +
+ afSourceAlpha[1] +
+ afSourceAlpha[4] +
+ afSourceAlpha[5];
+
+ float fWeightSumLL = afSourceAlpha[2] +
+ afSourceAlpha[3] +
+ afSourceAlpha[6] +
+ afSourceAlpha[7];
+
+ float fWeightSumUR = afSourceAlpha[8] +
+ afSourceAlpha[9] +
+ afSourceAlpha[12] +
+ afSourceAlpha[13];
+
+ float fWeightSumLR = afSourceAlpha[10] +
+ afSourceAlpha[11] +
+ afSourceAlpha[14] +
+ afSourceAlpha[15];
+
+ ColorFloatRGBA frgbaSumLeft = frgbaSumUL + frgbaSumLL;
+ ColorFloatRGBA frgbaSumRight = frgbaSumUR + frgbaSumLR;
+ ColorFloatRGBA frgbaSumTop = frgbaSumUL + frgbaSumUR;
+ ColorFloatRGBA frgbaSumBottom = frgbaSumLL + frgbaSumLR;
+
+ float fWeightSumLeft = fWeightSumUL + fWeightSumLL;
+ float fWeightSumRight = fWeightSumUR + fWeightSumLR;
+ float fWeightSumTop = fWeightSumUL + fWeightSumUR;
+ float fWeightSumBottom = fWeightSumLL + fWeightSumLR;
+
+ // check to see if there is at least 1 pixel with non-zero alpha
+ // completely transparent block should not make it to this code
+ assert((fWeightSumLeft + fWeightSumRight) > 0.0f);
+ assert((fWeightSumTop + fWeightSumBottom) > 0.0f);
+
+ if (fWeightSumLeft > 0.0f)
+ {
+ m_frgbaSourceAverageLeft = frgbaSumLeft * (1.0f/fWeightSumLeft);
+ }
+ if (fWeightSumRight > 0.0f)
+ {
+ m_frgbaSourceAverageRight = frgbaSumRight * (1.0f/fWeightSumRight);
+ }
+ if (fWeightSumTop > 0.0f)
+ {
+ m_frgbaSourceAverageTop = frgbaSumTop * (1.0f/fWeightSumTop);
+ }
+ if (fWeightSumBottom > 0.0f)
+ {
+ m_frgbaSourceAverageBottom = frgbaSumBottom * (1.0f/fWeightSumBottom);
+ }
+
+ if (fWeightSumLeft == 0.0f)
+ {
+ assert(fWeightSumRight > 0.0f);
+ m_frgbaSourceAverageLeft = m_frgbaSourceAverageRight;
+ }
+ if (fWeightSumRight == 0.0f)
+ {
+ assert(fWeightSumLeft > 0.0f);
+ m_frgbaSourceAverageRight = m_frgbaSourceAverageLeft;
+ }
+ if (fWeightSumTop == 0.0f)
+ {
+ assert(fWeightSumBottom > 0.0f);
+ m_frgbaSourceAverageTop = m_frgbaSourceAverageBottom;
+ }
+ if (fWeightSumBottom == 0.0f)
+ {
+ assert(fWeightSumTop > 0.0f);
+ m_frgbaSourceAverageBottom = m_frgbaSourceAverageTop;
+ }
+ }
+
+
+
+ if (DEBUG_PRINT)
+ {
+ printf("\ntarget: [%.2f,%.2f,%.2f] [%.2f,%.2f,%.2f] [%.2f,%.2f,%.2f] [%.2f,%.2f,%.2f]\n",
+ m_frgbaSourceAverageLeft.fR, m_frgbaSourceAverageLeft.fG, m_frgbaSourceAverageLeft.fB,
+ m_frgbaSourceAverageRight.fR, m_frgbaSourceAverageRight.fG, m_frgbaSourceAverageRight.fB,
+ m_frgbaSourceAverageTop.fR, m_frgbaSourceAverageTop.fG, m_frgbaSourceAverageTop.fB,
+ m_frgbaSourceAverageBottom.fR, m_frgbaSourceAverageBottom.fG, m_frgbaSourceAverageBottom.fB);
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try an ETC1 differential mode encoding
+ // use a_boolFlip to set the encoding F bit
+ // use a_uiRadius to alter basecolor components in the range[-a_uiRadius:a_uiRadius]
+ // use a_iGrayOffset1 and a_iGrayOffset2 to offset the basecolor to search for degenerate encodings
+ // replace the encoding if the encoding error is less than previous encoding
+ //
+ void Block4x4Encoding_ETC1::TryDifferential(bool a_boolFlip, unsigned int a_uiRadius,
+ int a_iGrayOffset1, int a_iGrayOffset2)
+ {
+
+ ColorFloatRGBA frgbaColor1;
+ ColorFloatRGBA frgbaColor2;
+
+ const unsigned int *pauiPixelMapping1;
+ const unsigned int *pauiPixelMapping2;
+
+ if (a_boolFlip)
+ {
+ frgbaColor1 = m_frgbaSourceAverageTop;
+ frgbaColor2 = m_frgbaSourceAverageBottom;
+
+ pauiPixelMapping1 = s_auiTopPixelMapping;
+ pauiPixelMapping2 = s_auiBottomPixelMapping;
+ }
+ else
+ {
+ frgbaColor1 = m_frgbaSourceAverageLeft;
+ frgbaColor2 = m_frgbaSourceAverageRight;
+
+ pauiPixelMapping1 = s_auiLeftPixelMapping;
+ pauiPixelMapping2 = s_auiRightPixelMapping;
+ }
+
+ DifferentialTrys trys(frgbaColor1, frgbaColor2, pauiPixelMapping1, pauiPixelMapping2,
+ a_uiRadius, a_iGrayOffset1, a_iGrayOffset2);
+
+ Block4x4Encoding_ETC1 encodingTry = *this;
+ encodingTry.m_boolFlip = a_boolFlip;
+
+ encodingTry.TryDifferentialHalf(&trys.m_half1);
+ encodingTry.TryDifferentialHalf(&trys.m_half2);
+
+ // find best halves that are within differential range
+ DifferentialTrys::Try *ptryBest1 = nullptr;
+ DifferentialTrys::Try *ptryBest2 = nullptr;
+ encodingTry.m_fError = FLT_MAX;
+
+ // see if the best of each half are in differential range
+ int iDRed = trys.m_half2.m_ptryBest->m_iRed - trys.m_half1.m_ptryBest->m_iRed;
+ int iDGreen = trys.m_half2.m_ptryBest->m_iGreen - trys.m_half1.m_ptryBest->m_iGreen;
+ int iDBlue = trys.m_half2.m_ptryBest->m_iBlue - trys.m_half1.m_ptryBest->m_iBlue;
+ if (iDRed >= -4 && iDRed <= 3 && iDGreen >= -4 && iDGreen <= 3 && iDBlue >= -4 && iDBlue <= 3)
+ {
+ ptryBest1 = trys.m_half1.m_ptryBest;
+ ptryBest2 = trys.m_half2.m_ptryBest;
+ encodingTry.m_fError = trys.m_half1.m_ptryBest->m_fError + trys.m_half2.m_ptryBest->m_fError;
+ }
+ else
+ {
+ // else, find the next best halves that are in differential range
+ for (DifferentialTrys::Try *ptry1 = &trys.m_half1.m_atry[0];
+ ptry1 < &trys.m_half1.m_atry[trys.m_half1.m_uiTrys];
+ ptry1++)
+ {
+ for (DifferentialTrys::Try *ptry2 = &trys.m_half2.m_atry[0];
+ ptry2 < &trys.m_half2.m_atry[trys.m_half2.m_uiTrys];
+ ptry2++)
+ {
+ iDRed = ptry2->m_iRed - ptry1->m_iRed;
+ bool boolValidRedDelta = iDRed <= 3 && iDRed >= -4;
+ iDGreen = ptry2->m_iGreen - ptry1->m_iGreen;
+ bool boolValidGreenDelta = iDGreen <= 3 && iDGreen >= -4;
+ iDBlue = ptry2->m_iBlue - ptry1->m_iBlue;
+ bool boolValidBlueDelta = iDBlue <= 3 && iDBlue >= -4;
+
+ if (boolValidRedDelta && boolValidGreenDelta && boolValidBlueDelta)
+ {
+ float fError = ptry1->m_fError + ptry2->m_fError;
+
+ if (fError < encodingTry.m_fError)
+ {
+ encodingTry.m_fError = fError;
+
+ ptryBest1 = ptry1;
+ ptryBest2 = ptry2;
+ }
+ }
+
+ }
+ }
+ assert(encodingTry.m_fError < FLT_MAX);
+ assert(ptryBest1 != nullptr);
+ assert(ptryBest2 != nullptr);
+ }
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = MODE_ETC1;
+ m_boolDiff = true;
+ m_boolFlip = encodingTry.m_boolFlip;
+ m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB5((unsigned char)ptryBest1->m_iRed, (unsigned char)ptryBest1->m_iGreen, (unsigned char)ptryBest1->m_iBlue);
+ m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB5((unsigned char)ptryBest2->m_iRed, (unsigned char)ptryBest2->m_iGreen, (unsigned char)ptryBest2->m_iBlue);
+ m_uiCW1 = ptryBest1->m_uiCW;
+ m_uiCW2 = ptryBest2->m_uiCW;
+
+ for (unsigned int uiPixelOrder = 0; uiPixelOrder < PIXELS / 2; uiPixelOrder++)
+ {
+ unsigned int uiPixel1 = pauiPixelMapping1[uiPixelOrder];
+ unsigned int uiPixel2 = pauiPixelMapping2[uiPixelOrder];
+
+ unsigned int uiSelector1 = ptryBest1->m_auiSelectors[uiPixelOrder];
+ unsigned int uiSelector2 = ptryBest2->m_auiSelectors[uiPixelOrder];
+
+ m_auiSelectors[uiPixel1] = uiSelector1;
+ m_auiSelectors[uiPixel2] = ptryBest2->m_auiSelectors[uiPixelOrder];
+
+ float fDeltaRGB1 = s_aafCwTable[m_uiCW1][uiSelector1];
+ float fDeltaRGB2 = s_aafCwTable[m_uiCW2][uiSelector2];
+
+ m_afrgbaDecodedColors[uiPixel1] = (m_frgbaColor1 + fDeltaRGB1).ClampRGB();
+ m_afrgbaDecodedColors[uiPixel2] = (m_frgbaColor2 + fDeltaRGB2).ClampRGB();
+ }
+
+ m_fError1 = ptryBest1->m_fError;
+ m_fError2 = ptryBest2->m_fError;
+ m_boolSeverelyBentDifferentialColors = trys.m_boolSeverelyBentColors;
+ m_fError = m_fError1 + m_fError2;
+
+ // sanity check
+ {
+ int iRed1 = m_frgbaColor1.IntRed(31.0f);
+ int iGreen1 = m_frgbaColor1.IntGreen(31.0f);
+ int iBlue1 = m_frgbaColor1.IntBlue(31.0f);
+
+ int iRed2 = m_frgbaColor2.IntRed(31.0f);
+ int iGreen2 = m_frgbaColor2.IntGreen(31.0f);
+ int iBlue2 = m_frgbaColor2.IntBlue(31.0f);
+
+ iDRed = iRed2 - iRed1;
+ iDGreen = iGreen2 - iGreen1;
+ iDBlue = iBlue2 - iBlue1;
+
+ assert(iDRed >= -4 && iDRed < 4);
+ assert(iDGreen >= -4 && iDGreen < 4);
+ assert(iDBlue >= -4 && iDBlue < 4);
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try an ETC1 differential mode encoding for a half of a 4x4 block
+ // vary the basecolor components using a radius
+ //
+ void Block4x4Encoding_ETC1::TryDifferentialHalf(DifferentialTrys::Half *a_phalf)
+ {
+
+ a_phalf->m_ptryBest = nullptr;
+ float fBestTryError = FLT_MAX;
+
+ a_phalf->m_uiTrys = 0;
+ for (int iRed = a_phalf->m_iRed - (int)a_phalf->m_uiRadius;
+ iRed <= a_phalf->m_iRed + (int)a_phalf->m_uiRadius;
+ iRed++)
+ {
+ assert(iRed >= 0 && iRed <= 31);
+
+ for (int iGreen = a_phalf->m_iGreen - (int)a_phalf->m_uiRadius;
+ iGreen <= a_phalf->m_iGreen + (int)a_phalf->m_uiRadius;
+ iGreen++)
+ {
+ assert(iGreen >= 0 && iGreen <= 31);
+
+ for (int iBlue = a_phalf->m_iBlue - (int)a_phalf->m_uiRadius;
+ iBlue <= a_phalf->m_iBlue + (int)a_phalf->m_uiRadius;
+ iBlue++)
+ {
+ assert(iBlue >= 0 && iBlue <= 31);
+
+ DifferentialTrys::Try *ptry = &a_phalf->m_atry[a_phalf->m_uiTrys];
+ assert(ptry < &a_phalf->m_atry[DifferentialTrys::Half::MAX_TRYS]);
+
+ ptry->m_iRed = iRed;
+ ptry->m_iGreen = iGreen;
+ ptry->m_iBlue = iBlue;
+ ptry->m_fError = FLT_MAX;
+ ColorFloatRGBA frgbaColor = ColorFloatRGBA::ConvertFromRGB5((unsigned char)iRed, (unsigned char)iGreen, (unsigned char)iBlue);
+
+ // try each CW
+ for (unsigned int uiCW = 0; uiCW < CW_RANGES; uiCW++)
+ {
+ unsigned int auiPixelSelectors[PIXELS / 2];
+ ColorFloatRGBA afrgbaDecodedPixels[PIXELS / 2];
+ float afPixelErrors[PIXELS / 2] = { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX,
+ FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX };
+
+ // pre-compute decoded pixels for each selector
+ ColorFloatRGBA afrgbaSelectors[SELECTORS];
+ assert(SELECTORS == 4);
+ afrgbaSelectors[0] = (frgbaColor + s_aafCwTable[uiCW][0]).ClampRGB();
+ afrgbaSelectors[1] = (frgbaColor + s_aafCwTable[uiCW][1]).ClampRGB();
+ afrgbaSelectors[2] = (frgbaColor + s_aafCwTable[uiCW][2]).ClampRGB();
+ afrgbaSelectors[3] = (frgbaColor + s_aafCwTable[uiCW][3]).ClampRGB();
+
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ ColorFloatRGBA *pfrgbaSourcePixel = &m_pafrgbaSource[a_phalf->m_pauiPixelMapping[uiPixel]];
+ ColorFloatRGBA frgbaDecodedPixel;
+
+ for (unsigned int uiSelector = 0; uiSelector < SELECTORS; uiSelector++)
+ {
+ frgbaDecodedPixel = afrgbaSelectors[uiSelector];
+
+ float fPixelError;
+
+ fPixelError = CalcPixelError(frgbaDecodedPixel, m_afDecodedAlphas[a_phalf->m_pauiPixelMapping[uiPixel]],
+ *pfrgbaSourcePixel);
+
+ if (fPixelError < afPixelErrors[uiPixel])
+ {
+ auiPixelSelectors[uiPixel] = uiSelector;
+ afrgbaDecodedPixels[uiPixel] = frgbaDecodedPixel;
+ afPixelErrors[uiPixel] = fPixelError;
+ }
+
+ }
+ }
+
+ // add up all pixel errors
+ float fCWError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ fCWError += afPixelErrors[uiPixel];
+ }
+
+ // if best CW so far
+ if (fCWError < ptry->m_fError)
+ {
+ ptry->m_uiCW = uiCW;
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ ptry->m_auiSelectors[uiPixel] = auiPixelSelectors[uiPixel];
+ }
+ ptry->m_fError = fCWError;
+ }
+
+ }
+
+ if (ptry->m_fError < fBestTryError)
+ {
+ a_phalf->m_ptryBest = ptry;
+ fBestTryError = ptry->m_fError;
+ }
+
+ assert(ptry->m_fError < FLT_MAX);
+
+ a_phalf->m_uiTrys++;
+ }
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try an ETC1 individual mode encoding
+ // use a_boolFlip to set the encoding F bit
+ // use a_uiRadius to alter basecolor components in the range[-a_uiRadius:a_uiRadius]
+ // replace the encoding if the encoding error is less than previous encoding
+ //
+ void Block4x4Encoding_ETC1::TryIndividual(bool a_boolFlip, unsigned int a_uiRadius)
+ {
+
+ ColorFloatRGBA frgbaColor1;
+ ColorFloatRGBA frgbaColor2;
+
+ const unsigned int *pauiPixelMapping1;
+ const unsigned int *pauiPixelMapping2;
+
+ if (a_boolFlip)
+ {
+ frgbaColor1 = m_frgbaSourceAverageTop;
+ frgbaColor2 = m_frgbaSourceAverageBottom;
+
+ pauiPixelMapping1 = s_auiTopPixelMapping;
+ pauiPixelMapping2 = s_auiBottomPixelMapping;
+ }
+ else
+ {
+ frgbaColor1 = m_frgbaSourceAverageLeft;
+ frgbaColor2 = m_frgbaSourceAverageRight;
+
+ pauiPixelMapping1 = s_auiLeftPixelMapping;
+ pauiPixelMapping2 = s_auiRightPixelMapping;
+ }
+
+ IndividualTrys trys(frgbaColor1, frgbaColor2, pauiPixelMapping1, pauiPixelMapping2, a_uiRadius);
+
+ Block4x4Encoding_ETC1 encodingTry = *this;
+ encodingTry.m_boolFlip = a_boolFlip;
+
+ encodingTry.TryIndividualHalf(&trys.m_half1);
+ encodingTry.TryIndividualHalf(&trys.m_half2);
+
+ // use the best of each half
+ IndividualTrys::Try *ptryBest1 = trys.m_half1.m_ptryBest;
+ IndividualTrys::Try *ptryBest2 = trys.m_half2.m_ptryBest;
+ encodingTry.m_fError = trys.m_half1.m_ptryBest->m_fError + trys.m_half2.m_ptryBest->m_fError;
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = MODE_ETC1;
+ m_boolDiff = false;
+ m_boolFlip = encodingTry.m_boolFlip;
+ m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)ptryBest1->m_iRed, (unsigned char)ptryBest1->m_iGreen, (unsigned char)ptryBest1->m_iBlue);
+ m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)ptryBest2->m_iRed, (unsigned char)ptryBest2->m_iGreen, (unsigned char)ptryBest2->m_iBlue);
+ m_uiCW1 = ptryBest1->m_uiCW;
+ m_uiCW2 = ptryBest2->m_uiCW;
+
+ for (unsigned int uiPixelOrder = 0; uiPixelOrder < PIXELS / 2; uiPixelOrder++)
+ {
+ unsigned int uiPixel1 = pauiPixelMapping1[uiPixelOrder];
+ unsigned int uiPixel2 = pauiPixelMapping2[uiPixelOrder];
+
+ unsigned int uiSelector1 = ptryBest1->m_auiSelectors[uiPixelOrder];
+ unsigned int uiSelector2 = ptryBest2->m_auiSelectors[uiPixelOrder];
+
+ m_auiSelectors[uiPixel1] = uiSelector1;
+ m_auiSelectors[uiPixel2] = ptryBest2->m_auiSelectors[uiPixelOrder];
+
+ float fDeltaRGB1 = s_aafCwTable[m_uiCW1][uiSelector1];
+ float fDeltaRGB2 = s_aafCwTable[m_uiCW2][uiSelector2];
+
+ m_afrgbaDecodedColors[uiPixel1] = (m_frgbaColor1 + fDeltaRGB1).ClampRGB();
+ m_afrgbaDecodedColors[uiPixel2] = (m_frgbaColor2 + fDeltaRGB2).ClampRGB();
+ }
+
+ m_fError1 = ptryBest1->m_fError;
+ m_fError2 = ptryBest2->m_fError;
+ m_fError = m_fError1 + m_fError2;
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try an ETC1 differential mode encoding for a half of a 4x4 block
+ // vary the basecolor components using a radius
+ //
+ void Block4x4Encoding_ETC1::TryIndividualHalf(IndividualTrys::Half *a_phalf)
+ {
+
+ a_phalf->m_ptryBest = nullptr;
+ float fBestTryError = FLT_MAX;
+
+ a_phalf->m_uiTrys = 0;
+ for (int iRed = a_phalf->m_iRed - (int)a_phalf->m_uiRadius;
+ iRed <= a_phalf->m_iRed + (int)a_phalf->m_uiRadius;
+ iRed++)
+ {
+ assert(iRed >= 0 && iRed <= 15);
+
+ for (int iGreen = a_phalf->m_iGreen - (int)a_phalf->m_uiRadius;
+ iGreen <= a_phalf->m_iGreen + (int)a_phalf->m_uiRadius;
+ iGreen++)
+ {
+ assert(iGreen >= 0 && iGreen <= 15);
+
+ for (int iBlue = a_phalf->m_iBlue - (int)a_phalf->m_uiRadius;
+ iBlue <= a_phalf->m_iBlue + (int)a_phalf->m_uiRadius;
+ iBlue++)
+ {
+ assert(iBlue >= 0 && iBlue <= 15);
+
+ IndividualTrys::Try *ptry = &a_phalf->m_atry[a_phalf->m_uiTrys];
+ assert(ptry < &a_phalf->m_atry[IndividualTrys::Half::MAX_TRYS]);
+
+ ptry->m_iRed = iRed;
+ ptry->m_iGreen = iGreen;
+ ptry->m_iBlue = iBlue;
+ ptry->m_fError = FLT_MAX;
+ ColorFloatRGBA frgbaColor = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed, (unsigned char)iGreen, (unsigned char)iBlue);
+
+ // try each CW
+ for (unsigned int uiCW = 0; uiCW < CW_RANGES; uiCW++)
+ {
+ unsigned int auiPixelSelectors[PIXELS / 2];
+ ColorFloatRGBA afrgbaDecodedPixels[PIXELS / 2];
+ float afPixelErrors[PIXELS / 2] = { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX,
+ FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX };
+
+ // pre-compute decoded pixels for each selector
+ ColorFloatRGBA afrgbaSelectors[SELECTORS];
+ assert(SELECTORS == 4);
+ afrgbaSelectors[0] = (frgbaColor + s_aafCwTable[uiCW][0]).ClampRGB();
+ afrgbaSelectors[1] = (frgbaColor + s_aafCwTable[uiCW][1]).ClampRGB();
+ afrgbaSelectors[2] = (frgbaColor + s_aafCwTable[uiCW][2]).ClampRGB();
+ afrgbaSelectors[3] = (frgbaColor + s_aafCwTable[uiCW][3]).ClampRGB();
+
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ ColorFloatRGBA *pfrgbaSourcePixel = &m_pafrgbaSource[a_phalf->m_pauiPixelMapping[uiPixel]];
+ ColorFloatRGBA frgbaDecodedPixel;
+
+ for (unsigned int uiSelector = 0; uiSelector < SELECTORS; uiSelector++)
+ {
+ frgbaDecodedPixel = afrgbaSelectors[uiSelector];
+
+ float fPixelError;
+
+ fPixelError = CalcPixelError(frgbaDecodedPixel, m_afDecodedAlphas[a_phalf->m_pauiPixelMapping[uiPixel]],
+ *pfrgbaSourcePixel);
+
+ if (fPixelError < afPixelErrors[uiPixel])
+ {
+ auiPixelSelectors[uiPixel] = uiSelector;
+ afrgbaDecodedPixels[uiPixel] = frgbaDecodedPixel;
+ afPixelErrors[uiPixel] = fPixelError;
+ }
+
+ }
+ }
+
+ // add up all pixel errors
+ float fCWError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ fCWError += afPixelErrors[uiPixel];
+ }
+
+ // if best CW so far
+ if (fCWError < ptry->m_fError)
+ {
+ ptry->m_uiCW = uiCW;
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ ptry->m_auiSelectors[uiPixel] = auiPixelSelectors[uiPixel];
+ }
+ ptry->m_fError = fCWError;
+ }
+
+ }
+
+ if (ptry->m_fError < fBestTryError)
+ {
+ a_phalf->m_ptryBest = ptry;
+ fBestTryError = ptry->m_fError;
+ }
+
+ assert(ptry->m_fError < FLT_MAX);
+
+ a_phalf->m_uiTrys++;
+ }
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try version 1 of the degenerate search
+ // degenerate encodings use basecolor movement and a subset of the selectors to find useful encodings
+ // each subsequent version of the degenerate search uses more basecolor movement and is less likely to
+ // be successfull
+ //
+ void Block4x4Encoding_ETC1::TryDegenerates1(void)
+ {
+
+ TryDifferential(m_boolMostLikelyFlip, 1, -2, 0);
+ TryDifferential(m_boolMostLikelyFlip, 1, 2, 0);
+ TryDifferential(m_boolMostLikelyFlip, 1, 0, 2);
+ TryDifferential(m_boolMostLikelyFlip, 1, 0, -2);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try version 2 of the degenerate search
+ // degenerate encodings use basecolor movement and a subset of the selectors to find useful encodings
+ // each subsequent version of the degenerate search uses more basecolor movement and is less likely to
+ // be successfull
+ //
+ void Block4x4Encoding_ETC1::TryDegenerates2(void)
+ {
+
+ TryDifferential(!m_boolMostLikelyFlip, 1, -2, 0);
+ TryDifferential(!m_boolMostLikelyFlip, 1, 2, 0);
+ TryDifferential(!m_boolMostLikelyFlip, 1, 0, 2);
+ TryDifferential(!m_boolMostLikelyFlip, 1, 0, -2);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try version 3 of the degenerate search
+ // degenerate encodings use basecolor movement and a subset of the selectors to find useful encodings
+ // each subsequent version of the degenerate search uses more basecolor movement and is less likely to
+ // be successfull
+ //
+ void Block4x4Encoding_ETC1::TryDegenerates3(void)
+ {
+
+ TryDifferential(m_boolMostLikelyFlip, 1, -2, -2);
+ TryDifferential(m_boolMostLikelyFlip, 1, -2, 2);
+ TryDifferential(m_boolMostLikelyFlip, 1, 2, -2);
+ TryDifferential(m_boolMostLikelyFlip, 1, 2, 2);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try version 4 of the degenerate search
+ // degenerate encodings use basecolor movement and a subset of the selectors to find useful encodings
+ // each subsequent version of the degenerate search uses more basecolor movement and is less likely to
+ // be successfull
+ //
+ void Block4x4Encoding_ETC1::TryDegenerates4(void)
+ {
+
+ TryDifferential(m_boolMostLikelyFlip, 1, -4, 0);
+ TryDifferential(m_boolMostLikelyFlip, 1, 4, 0);
+ TryDifferential(m_boolMostLikelyFlip, 1, 0, 4);
+ TryDifferential(m_boolMostLikelyFlip, 1, 0, -4);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // find the best selector for each pixel based on a particular basecolor and CW that have been previously set
+ // calculate the selectors for each half of the block separately
+ // set the block error as the sum of each half's error
+ //
+ void Block4x4Encoding_ETC1::CalculateSelectors()
+ {
+ if (m_boolFlip)
+ {
+ CalculateHalfOfTheSelectors(0, s_auiTopPixelMapping);
+ CalculateHalfOfTheSelectors(1, s_auiBottomPixelMapping);
+ }
+ else
+ {
+ CalculateHalfOfTheSelectors(0, s_auiLeftPixelMapping);
+ CalculateHalfOfTheSelectors(1, s_auiRightPixelMapping);
+ }
+
+ m_fError = m_fError1 + m_fError2;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // choose best selectors for half of the block
+ // calculate the error for half of the block
+ //
+ void Block4x4Encoding_ETC1::CalculateHalfOfTheSelectors(unsigned int a_uiHalf,
+ const unsigned int *pauiPixelMapping)
+ {
+ static const bool DEBUG_PRINT = false;
+
+ ColorFloatRGBA *pfrgbaColor = a_uiHalf ? &m_frgbaColor2 : &m_frgbaColor1;
+ unsigned int *puiCW = a_uiHalf ? &m_uiCW2 : &m_uiCW1;
+
+ float *pfHalfError = a_uiHalf ? &m_fError2 : &m_fError1;
+ *pfHalfError = FLT_MAX;
+
+ // try each CW
+ for (unsigned int uiCW = 0; uiCW < CW_RANGES; uiCW++)
+ {
+ if (DEBUG_PRINT)
+ {
+ printf("\ncw=%u\n", uiCW);
+ }
+
+ unsigned int auiPixelSelectors[PIXELS / 2];
+ ColorFloatRGBA afrgbaDecodedPixels[PIXELS / 2];
+ float afPixelErrors[PIXELS / 2] = { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX };
+
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ if (DEBUG_PRINT)
+ {
+ printf("\tsource [%.2f,%.2f,%.2f]\n", m_pafrgbaSource[pauiPixelMapping[uiPixel]].fR,
+ m_pafrgbaSource[pauiPixelMapping[uiPixel]].fG, m_pafrgbaSource[pauiPixelMapping[uiPixel]].fB);
+ }
+
+ ColorFloatRGBA *pfrgbaSourcePixel = &m_pafrgbaSource[pauiPixelMapping[uiPixel]];
+ ColorFloatRGBA frgbaDecodedPixel;
+
+ for (unsigned int uiSelector = 0; uiSelector < SELECTORS; uiSelector++)
+ {
+ float fDeltaRGB = s_aafCwTable[uiCW][uiSelector];
+
+ frgbaDecodedPixel = (*pfrgbaColor + fDeltaRGB).ClampRGB();
+
+ float fPixelError;
+
+ fPixelError = CalcPixelError(frgbaDecodedPixel, m_afDecodedAlphas[pauiPixelMapping[uiPixel]],
+ *pfrgbaSourcePixel);
+
+ if (DEBUG_PRINT)
+ {
+ printf("\tpixel %u, index %u [%.2f,%.2f,%.2f], error %.2f", uiPixel, uiSelector,
+ frgbaDecodedPixel.fR,
+ frgbaDecodedPixel.fG,
+ frgbaDecodedPixel.fB,
+ fPixelError);
+ }
+
+ if (fPixelError < afPixelErrors[uiPixel])
+ {
+ if (DEBUG_PRINT)
+ {
+ printf(" *");
+ }
+
+ auiPixelSelectors[uiPixel] = uiSelector;
+ afrgbaDecodedPixels[uiPixel] = frgbaDecodedPixel;
+ afPixelErrors[uiPixel] = fPixelError;
+ }
+
+ if (DEBUG_PRINT)
+ {
+ printf("\n");
+ }
+ }
+ }
+
+ // add up all pixel errors
+ float fCWError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ fCWError += afPixelErrors[uiPixel];
+ }
+ if (DEBUG_PRINT)
+ {
+ printf("\terror %.2f\n", fCWError);
+ }
+
+ // if best CW so far
+ if (fCWError < *pfHalfError)
+ {
+ *pfHalfError = fCWError;
+ *puiCW = uiCW;
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ m_auiSelectors[pauiPixelMapping[uiPixel]] = auiPixelSelectors[uiPixel];
+ m_afrgbaDecodedColors[pauiPixelMapping[uiPixel]] = afrgbaDecodedPixels[uiPixel];
+ }
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state
+ //
+ void Block4x4Encoding_ETC1::SetEncodingBits(void)
+ {
+ assert(m_mode == MODE_ETC1);
+
+ if (m_boolDiff)
+ {
+ int iRed1 = m_frgbaColor1.IntRed(31.0f);
+ int iGreen1 = m_frgbaColor1.IntGreen(31.0f);
+ int iBlue1 = m_frgbaColor1.IntBlue(31.0f);
+
+ int iRed2 = m_frgbaColor2.IntRed(31.0f);
+ int iGreen2 = m_frgbaColor2.IntGreen(31.0f);
+ int iBlue2 = m_frgbaColor2.IntBlue(31.0f);
+
+ int iDRed2 = iRed2 - iRed1;
+ int iDGreen2 = iGreen2 - iGreen1;
+ int iDBlue2 = iBlue2 - iBlue1;
+
+ assert(iDRed2 >= -4 && iDRed2 < 4);
+ assert(iDGreen2 >= -4 && iDGreen2 < 4);
+ assert(iDBlue2 >= -4 && iDBlue2 < 4);
+
+ m_pencodingbitsRGB8->differential.red1 = (unsigned int)iRed1;
+ m_pencodingbitsRGB8->differential.green1 = (unsigned int)iGreen1;
+ m_pencodingbitsRGB8->differential.blue1 = (unsigned int)iBlue1;
+
+ m_pencodingbitsRGB8->differential.dred2 = iDRed2;
+ m_pencodingbitsRGB8->differential.dgreen2 = iDGreen2;
+ m_pencodingbitsRGB8->differential.dblue2 = iDBlue2;
+ }
+ else
+ {
+ m_pencodingbitsRGB8->individual.red1 = (unsigned int)m_frgbaColor1.IntRed(15.0f);
+ m_pencodingbitsRGB8->individual.green1 = (unsigned int)m_frgbaColor1.IntGreen(15.0f);
+ m_pencodingbitsRGB8->individual.blue1 = (unsigned int)m_frgbaColor1.IntBlue(15.0f);
+
+ m_pencodingbitsRGB8->individual.red2 = (unsigned int)m_frgbaColor2.IntRed(15.0f);
+ m_pencodingbitsRGB8->individual.green2 = (unsigned int)m_frgbaColor2.IntGreen(15.0f);
+ m_pencodingbitsRGB8->individual.blue2 = (unsigned int)m_frgbaColor2.IntBlue(15.0f);
+ }
+
+ m_pencodingbitsRGB8->individual.cw1 = m_uiCW1;
+ m_pencodingbitsRGB8->individual.cw2 = m_uiCW2;
+
+ SetEncodingBits_Selectors();
+
+ m_pencodingbitsRGB8->individual.diff = (unsigned int)m_boolDiff;
+ m_pencodingbitsRGB8->individual.flip = (unsigned int)m_boolFlip;
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the selectors in the encoding bits
+ //
+ void Block4x4Encoding_ETC1::SetEncodingBits_Selectors(void)
+ {
+
+ m_pencodingbitsRGB8->individual.selectors = 0;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ unsigned int uiSelector = m_auiSelectors[uiPixel];
+
+ // set index msb
+ m_pencodingbitsRGB8->individual.selectors |= (uiSelector >> 1) << (uiPixel ^ 8);
+
+ // set index lsb
+ m_pencodingbitsRGB8->individual.selectors |= (uiSelector & 1) << ((16 + uiPixel) ^ 8);
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the decoded colors and decoded alpha based on the encoding state
+ //
+ void Block4x4Encoding_ETC1::Decode(void)
+ {
+
+ const unsigned int *pauiPixelOrder = m_boolFlip ? s_auiPixelOrderFlip1 : s_auiPixelOrderFlip0;
+
+ for (unsigned int uiPixelOrder = 0; uiPixelOrder < PIXELS; uiPixelOrder++)
+ {
+ ColorFloatRGBA *pfrgbaCenter = uiPixelOrder < 8 ? &m_frgbaColor1 : &m_frgbaColor2;
+ unsigned int uiCW = uiPixelOrder < 8 ? m_uiCW1 : m_uiCW2;
+
+ unsigned int uiPixel = pauiPixelOrder[uiPixelOrder];
+
+ float fDelta = s_aafCwTable[uiCW][m_auiSelectors[uiPixel]];
+ m_afrgbaDecodedColors[uiPixel] = (*pfrgbaCenter + fDelta).ClampRGB();
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_ETC1.h b/thirdparty/etc2comp/EtcBlock4x4Encoding_ETC1.h
new file mode 100644
index 0000000000..c0dc84d5d5
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_ETC1.h
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcBlock4x4Encoding.h"
+#include "EtcBlock4x4EncodingBits.h"
+#include "EtcDifferentialTrys.h"
+#include "EtcIndividualTrys.h"
+
+namespace Etc
+{
+
+ // base class for Block4x4Encoding_RGB8
+ class Block4x4Encoding_ETC1 : public Block4x4Encoding
+ {
+ public:
+
+ Block4x4Encoding_ETC1(void);
+ virtual ~Block4x4Encoding_ETC1(void);
+
+ virtual void InitFromSource(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+
+ unsigned char *a_paucEncodingBits,
+ ErrorMetric a_errormetric);
+
+ virtual void InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+
+ ErrorMetric a_errormetric);
+
+ virtual void PerformIteration(float a_fEffort);
+
+ inline virtual bool GetFlip(void)
+ {
+ return m_boolFlip;
+ }
+
+ inline virtual bool IsDifferential(void)
+ {
+ return m_boolDiff;
+ }
+
+ virtual void SetEncodingBits(void);
+
+ void Decode(void);
+
+ inline ColorFloatRGBA GetColor1(void) const
+ {
+ return m_frgbaColor1;
+ }
+
+ inline ColorFloatRGBA GetColor2(void) const
+ {
+ return m_frgbaColor2;
+ }
+
+ inline const unsigned int * GetSelectors(void) const
+ {
+ return m_auiSelectors;
+ }
+
+ inline unsigned int GetCW1(void) const
+ {
+ return m_uiCW1;
+ }
+
+ inline unsigned int GetCW2(void) const
+ {
+ return m_uiCW2;
+ }
+
+ inline bool HasSeverelyBentDifferentialColors(void) const
+ {
+ return m_boolSeverelyBentDifferentialColors;
+ }
+
+ protected:
+
+ static const unsigned int s_auiPixelOrderFlip0[PIXELS];
+ static const unsigned int s_auiPixelOrderFlip1[PIXELS];
+ static const unsigned int s_auiPixelOrderHScan[PIXELS];
+
+ static const unsigned int s_auiLeftPixelMapping[8];
+ static const unsigned int s_auiRightPixelMapping[8];
+ static const unsigned int s_auiTopPixelMapping[8];
+ static const unsigned int s_auiBottomPixelMapping[8];
+
+ static const unsigned int SELECTOR_BITS = 2;
+ static const unsigned int SELECTORS = 1 << SELECTOR_BITS;
+
+ static const unsigned int CW_BITS = 3;
+ static const unsigned int CW_RANGES = 1 << CW_BITS;
+
+ static float s_aafCwTable[CW_RANGES][SELECTORS];
+ static unsigned char s_aucDifferentialCwRange[256];
+
+ static const int MAX_DIFFERENTIAL = 3;
+ static const int MIN_DIFFERENTIAL = -4;
+
+ void InitFromEncodingBits_Selectors(void);
+
+ void PerformFirstIteration(void);
+ void CalculateMostLikelyFlip(void);
+
+ void TryDifferential(bool a_boolFlip, unsigned int a_uiRadius,
+ int a_iGrayOffset1, int a_iGrayOffset2);
+ void TryDifferentialHalf(DifferentialTrys::Half *a_phalf);
+
+ void TryIndividual(bool a_boolFlip, unsigned int a_uiRadius);
+ void TryIndividualHalf(IndividualTrys::Half *a_phalf);
+
+ void TryDegenerates1(void);
+ void TryDegenerates2(void);
+ void TryDegenerates3(void);
+ void TryDegenerates4(void);
+
+ void CalculateSelectors();
+ void CalculateHalfOfTheSelectors(unsigned int a_uiHalf,
+ const unsigned int *pauiPixelMapping);
+
+ // calculate the distance2 of r_frgbaPixel from r_frgbaTarget's gray line
+ inline float CalcGrayDistance2(ColorFloatRGBA &r_frgbaPixel,
+ ColorFloatRGBA &r_frgbaTarget)
+ {
+ float fDeltaGray = ((r_frgbaPixel.fR - r_frgbaTarget.fR) +
+ (r_frgbaPixel.fG - r_frgbaTarget.fG) +
+ (r_frgbaPixel.fB - r_frgbaTarget.fB)) / 3.0f;
+
+ ColorFloatRGBA frgbaPointOnGrayLine = (r_frgbaTarget + fDeltaGray).ClampRGB();
+
+ float fDR = r_frgbaPixel.fR - frgbaPointOnGrayLine.fR;
+ float fDG = r_frgbaPixel.fG - frgbaPointOnGrayLine.fG;
+ float fDB = r_frgbaPixel.fB - frgbaPointOnGrayLine.fB;
+
+ return (fDR*fDR) + (fDG*fDG) + (fDB*fDB);
+ }
+
+ void SetEncodingBits_Selectors(void);
+
+ // intermediate encoding
+ bool m_boolDiff;
+ bool m_boolFlip;
+ ColorFloatRGBA m_frgbaColor1;
+ ColorFloatRGBA m_frgbaColor2;
+ unsigned int m_uiCW1;
+ unsigned int m_uiCW2;
+ unsigned int m_auiSelectors[PIXELS];
+
+ // state shared between iterations
+ ColorFloatRGBA m_frgbaSourceAverageLeft;
+ ColorFloatRGBA m_frgbaSourceAverageRight;
+ ColorFloatRGBA m_frgbaSourceAverageTop;
+ ColorFloatRGBA m_frgbaSourceAverageBottom;
+ bool m_boolMostLikelyFlip;
+
+ // stats
+ float m_fError1; // error for Etc1 half 1
+ float m_fError2; // error for Etc1 half 2
+ bool m_boolSeverelyBentDifferentialColors; // only valid if m_boolDiff;
+
+ // final encoding
+ Block4x4EncodingBits_RGB8 *m_pencodingbitsRGB8; // or RGB8 portion of Block4x4EncodingBits_RGB8A8
+
+ private:
+
+ void CalculateSourceAverages(void);
+
+ };
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_R11.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_R11.cpp
new file mode 100644
index 0000000000..4c012fbbf1
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_R11.cpp
@@ -0,0 +1,429 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcBlock4x4Encoding_R11.cpp
+
+Block4x4Encoding_R11 is the encoder to use when targetting file format R11 and SR11 (signed R11).
+
+*/
+
+#include "EtcConfig.h"
+#include "EtcBlock4x4Encoding_R11.h"
+
+#include "EtcBlock4x4EncodingBits.h"
+#include "EtcBlock4x4.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <float.h>
+#include <limits>
+
+namespace Etc
+{
+
+ // modifier values to use for R11, SR11, RG11 and SRG11
+ float Block4x4Encoding_R11::s_aafModifierTable[MODIFIER_TABLE_ENTRYS][SELECTORS]
+ {
+ { -3.0f / 255.0f, -6.0f / 255.0f, -9.0f / 255.0f, -15.0f / 255.0f, 2.0f / 255.0f, 5.0f / 255.0f, 8.0f / 255.0f, 14.0f / 255.0f },
+ { -3.0f / 255.0f, -7.0f / 255.0f, -10.0f / 255.0f, -13.0f / 255.0f, 2.0f / 255.0f, 6.0f / 255.0f, 9.0f / 255.0f, 12.0f / 255.0f },
+ { -2.0f / 255.0f, -5.0f / 255.0f, -8.0f / 255.0f, -13.0f / 255.0f, 1.0f / 255.0f, 4.0f / 255.0f, 7.0f / 255.0f, 12.0f / 255.0f },
+ { -2.0f / 255.0f, -4.0f / 255.0f, -6.0f / 255.0f, -13.0f / 255.0f, 1.0f / 255.0f, 3.0f / 255.0f, 5.0f / 255.0f, 12.0f / 255.0f },
+
+ { -3.0f / 255.0f, -6.0f / 255.0f, -8.0f / 255.0f, -12.0f / 255.0f, 2.0f / 255.0f, 5.0f / 255.0f, 7.0f / 255.0f, 11.0f / 255.0f },
+ { -3.0f / 255.0f, -7.0f / 255.0f, -9.0f / 255.0f, -11.0f / 255.0f, 2.0f / 255.0f, 6.0f / 255.0f, 8.0f / 255.0f, 10.0f / 255.0f },
+ { -4.0f / 255.0f, -7.0f / 255.0f, -8.0f / 255.0f, -11.0f / 255.0f, 3.0f / 255.0f, 6.0f / 255.0f, 7.0f / 255.0f, 10.0f / 255.0f },
+ { -3.0f / 255.0f, -5.0f / 255.0f, -8.0f / 255.0f, -11.0f / 255.0f, 2.0f / 255.0f, 4.0f / 255.0f, 7.0f / 255.0f, 10.0f / 255.0f },
+
+ { -2.0f / 255.0f, -6.0f / 255.0f, -8.0f / 255.0f, -10.0f / 255.0f, 1.0f / 255.0f, 5.0f / 255.0f, 7.0f / 255.0f, 9.0f / 255.0f },
+ { -2.0f / 255.0f, -5.0f / 255.0f, -8.0f / 255.0f, -10.0f / 255.0f, 1.0f / 255.0f, 4.0f / 255.0f, 7.0f / 255.0f, 9.0f / 255.0f },
+ { -2.0f / 255.0f, -4.0f / 255.0f, -8.0f / 255.0f, -10.0f / 255.0f, 1.0f / 255.0f, 3.0f / 255.0f, 7.0f / 255.0f, 9.0f / 255.0f },
+ { -2.0f / 255.0f, -5.0f / 255.0f, -7.0f / 255.0f, -10.0f / 255.0f, 1.0f / 255.0f, 4.0f / 255.0f, 6.0f / 255.0f, 9.0f / 255.0f },
+
+ { -3.0f / 255.0f, -4.0f / 255.0f, -7.0f / 255.0f, -10.0f / 255.0f, 2.0f / 255.0f, 3.0f / 255.0f, 6.0f / 255.0f, 9.0f / 255.0f },
+ { -1.0f / 255.0f, -2.0f / 255.0f, -3.0f / 255.0f, -10.0f / 255.0f, 0.0f / 255.0f, 1.0f / 255.0f, 2.0f / 255.0f, 9.0f / 255.0f },
+ { -4.0f / 255.0f, -6.0f / 255.0f, -8.0f / 255.0f, -9.0f / 255.0f, 3.0f / 255.0f, 5.0f / 255.0f, 7.0f / 255.0f, 8.0f / 255.0f },
+ { -3.0f / 255.0f, -5.0f / 255.0f, -7.0f / 255.0f, -9.0f / 255.0f, 2.0f / 255.0f, 4.0f / 255.0f, 6.0f / 255.0f, 8.0f / 255.0f }
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ Block4x4Encoding_R11::Block4x4Encoding_R11(void)
+ {
+
+ m_pencodingbitsR11 = nullptr;
+
+ }
+
+ Block4x4Encoding_R11::~Block4x4Encoding_R11(void) {}
+ // ----------------------------------------------------------------------------------------------------
+ // initialization prior to encoding
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // a_pafrgbaSource points to a 4x4 block subset of the source image
+ // a_paucEncodingBits points to the final encoding bits
+ //
+ void Block4x4Encoding_R11::InitFromSource(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+ unsigned char *a_paucEncodingBits, ErrorMetric a_errormetric)
+ {
+ Block4x4Encoding::Init(a_pblockParent, a_pafrgbaSource,a_errormetric);
+
+ m_pencodingbitsR11 = (Block4x4EncodingBits_R11 *)a_paucEncodingBits;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // a_pafrgbaSource points to a 4x4 block subset of the source image
+ // a_paucEncodingBits points to the final encoding bits of a previous encoding
+ //
+ void Block4x4Encoding_R11::InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric)
+ {
+ m_pencodingbitsR11 = (Block4x4EncodingBits_R11 *)a_paucEncodingBits;
+
+ // init RGB portion
+ Block4x4Encoding_RGB8::InitFromEncodingBits(a_pblockParent,
+ (unsigned char *)m_pencodingbitsR11,
+ a_pafrgbaSource,
+ a_errormetric);
+
+ // init R11 portion
+ {
+ m_mode = MODE_R11;
+ if (a_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_R11 || a_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_RG11)
+ {
+ m_fRedBase = (float)(signed char)m_pencodingbitsR11->data.base;
+ }
+ else
+ {
+ m_fRedBase = (float)(unsigned char)m_pencodingbitsR11->data.base;
+ }
+ m_fRedMultiplier = (float)m_pencodingbitsR11->data.multiplier;
+ m_uiRedModifierTableIndex = m_pencodingbitsR11->data.table;
+
+ unsigned long long int ulliSelectorBits = 0;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsR11->data.selectors0 << 40;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsR11->data.selectors1 << 32;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsR11->data.selectors2 << 24;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsR11->data.selectors3 << 16;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsR11->data.selectors4 << 8;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsR11->data.selectors5;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ unsigned int uiShift = 45 - (3 * uiPixel);
+ m_auiRedSelectors[uiPixel] = (ulliSelectorBits >> uiShift) & (SELECTORS - 1);
+ }
+
+ // decode the red channel
+ // calc red error
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ float fDecodedPixelData = 0.0f;
+ if (a_pblockParent->GetImageSource()->GetFormat() == Image::Format::R11 || a_pblockParent->GetImageSource()->GetFormat() == Image::Format::RG11)
+ {
+ fDecodedPixelData = DecodePixelRed(m_fRedBase, m_fRedMultiplier,
+ m_uiRedModifierTableIndex,
+ m_auiRedSelectors[uiPixel]);
+ }
+ else if (a_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_R11 || a_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_RG11)
+ {
+ fDecodedPixelData = DecodePixelRed(m_fRedBase + 128, m_fRedMultiplier,
+ m_uiRedModifierTableIndex,
+ m_auiRedSelectors[uiPixel]);
+ }
+ else
+ {
+ assert(0);
+ }
+ m_afrgbaDecodedColors[uiPixel] = ColorFloatRGBA(fDecodedPixelData, 0.0f, 0.0f, 1.0f);
+ }
+ CalcBlockError();
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // perform a single encoding iteration
+ // replace the encoding if a better encoding was found
+ // subsequent iterations generally take longer for each iteration
+ // set m_boolDone if encoding is perfect or encoding is finished based on a_fEffort
+ //
+ void Block4x4Encoding_R11::PerformIteration(float a_fEffort)
+ {
+ assert(!m_boolDone);
+ m_mode = MODE_R11;
+
+ switch (m_uiEncodingIterations)
+ {
+ case 0:
+ m_fError = FLT_MAX;
+ m_fRedBlockError = FLT_MAX; // artificially high value
+ CalculateR11(8, 0.0f, 0.0f);
+ m_fError = m_fRedBlockError;
+ break;
+
+ case 1:
+ CalculateR11(8, 2.0f, 1.0f);
+ m_fError = m_fRedBlockError;
+ if (a_fEffort <= 24.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 2:
+ CalculateR11(8, 12.0f, 1.0f);
+ m_fError = m_fRedBlockError;
+ if (a_fEffort <= 49.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 3:
+ CalculateR11(7, 6.0f, 1.0f);
+ m_fError = m_fRedBlockError;
+ break;
+
+ case 4:
+ CalculateR11(6, 3.0f, 1.0f);
+ m_fError = m_fRedBlockError;
+ break;
+
+ case 5:
+ CalculateR11(5, 1.0f, 0.0f);
+ m_fError = m_fRedBlockError;
+ m_boolDone = true;
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+ m_uiEncodingIterations++;
+ SetDoneIfPerfect();
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // find the best combination of base color, multiplier and selectors
+ //
+ // a_uiSelectorsUsed limits the number of selector combinations to try
+ // a_fBaseRadius limits the range of base colors to try
+ // a_fMultiplierRadius limits the range of multipliers to try
+ //
+ void Block4x4Encoding_R11::CalculateR11(unsigned int a_uiSelectorsUsed,
+ float a_fBaseRadius, float a_fMultiplierRadius)
+ {
+ // maps from virtual (monotonic) selector to ETC selector
+ static const unsigned int auiVirtualSelectorMap[8] = {3, 2, 1, 0, 4, 5, 6, 7};
+
+ // find min/max red
+ float fMinRed = 1.0f;
+ float fMaxRed = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ // ignore border pixels
+ float fAlpha = m_pafrgbaSource[uiPixel].fA;
+ if (isnan(fAlpha))
+ {
+ continue;
+ }
+
+ float fRed = m_pafrgbaSource[uiPixel].fR;
+
+ if (fRed < fMinRed)
+ {
+ fMinRed = fRed;
+ }
+ if (fRed > fMaxRed)
+ {
+ fMaxRed = fRed;
+ }
+ }
+ assert(fMinRed <= fMaxRed);
+
+ float fRedRange = (fMaxRed - fMinRed);
+
+ // try each modifier table entry
+ for (unsigned int uiTableEntry = 0; uiTableEntry < MODIFIER_TABLE_ENTRYS; uiTableEntry++)
+ {
+ for (unsigned int uiMinVirtualSelector = 0;
+ uiMinVirtualSelector <= (8- a_uiSelectorsUsed);
+ uiMinVirtualSelector++)
+ {
+ unsigned int uiMaxVirtualSelector = uiMinVirtualSelector + a_uiSelectorsUsed - 1;
+
+ unsigned int uiMinSelector = auiVirtualSelectorMap[uiMinVirtualSelector];
+ unsigned int uiMaxSelector = auiVirtualSelectorMap[uiMaxVirtualSelector];
+
+ float fTableEntryCenter = -s_aafModifierTable[uiTableEntry][uiMinSelector];
+
+ float fTableEntryRange = s_aafModifierTable[uiTableEntry][uiMaxSelector] -
+ s_aafModifierTable[uiTableEntry][uiMinSelector];
+
+ float fCenterRatio = fTableEntryCenter / fTableEntryRange;
+
+ float fCenter = fMinRed + fCenterRatio*fRedRange;
+ fCenter = roundf(255.0f * fCenter) / 255.0f;
+
+ float fMinBase = fCenter - (a_fBaseRadius / 255.0f);
+ if (fMinBase < 0.0f)
+ {
+ fMinBase = 0.0f;
+ }
+
+ float fMaxBase = fCenter + (a_fBaseRadius / 255.0f);
+ if (fMaxBase > 1.0f)
+ {
+ fMaxBase = 1.0f;
+ }
+
+ for (float fBase = fMinBase; fBase <= fMaxBase; fBase += (0.999999f / 255.0f))
+ {
+ float fRangeMultiplier = roundf(fRedRange / fTableEntryRange);
+
+ float fMinMultiplier = fRangeMultiplier - a_fMultiplierRadius;
+ if (fMinMultiplier < 1.0f)
+ {
+ fMinMultiplier = 0.0f;
+ }
+ else if (fMinMultiplier > 15.0f)
+ {
+ fMinMultiplier = 15.0f;
+ }
+
+ float fMaxMultiplier = fRangeMultiplier + a_fMultiplierRadius;
+ if (fMaxMultiplier < 1.0f)
+ {
+ fMaxMultiplier = 1.0f;
+ }
+ else if (fMaxMultiplier > 15.0f)
+ {
+ fMaxMultiplier = 15.0f;
+ }
+
+ for (float fMultiplier = fMinMultiplier; fMultiplier <= fMaxMultiplier; fMultiplier += 1.0f)
+ {
+ // find best selector for each pixel
+ unsigned int auiBestSelectors[PIXELS];
+ float afBestRedError[PIXELS];
+ float afBestPixelRed[PIXELS];
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ float fBestPixelRedError = FLT_MAX;
+
+ for (unsigned int uiSelector = 0; uiSelector < SELECTORS; uiSelector++)
+ {
+ float fPixelRed = DecodePixelRed(fBase * 255.0f, fMultiplier, uiTableEntry, uiSelector);
+
+ ColorFloatRGBA frgba(fPixelRed, m_pafrgbaSource[uiPixel].fG,0.0f,1.0f);
+
+ float fPixelRedError = CalcPixelError(frgba, 1.0f, m_pafrgbaSource[uiPixel]);
+
+ if (fPixelRedError < fBestPixelRedError)
+ {
+ fBestPixelRedError = fPixelRedError;
+ auiBestSelectors[uiPixel] = uiSelector;
+ afBestRedError[uiPixel] = fBestPixelRedError;
+ afBestPixelRed[uiPixel] = fPixelRed;
+ }
+ }
+ }
+ float fBlockError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ fBlockError += afBestRedError[uiPixel];
+ }
+ if (fBlockError < m_fRedBlockError)
+ {
+ m_fRedBlockError = fBlockError;
+
+ if (m_pblockParent->GetImageSource()->GetFormat() == Image::Format::R11 || m_pblockParent->GetImageSource()->GetFormat() == Image::Format::RG11)
+ {
+ m_fRedBase = 255.0f * fBase;
+ }
+ else if (m_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_R11 || m_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_RG11)
+ {
+ m_fRedBase = (fBase * 255) - 128;
+ }
+ else
+ {
+ assert(0);
+ }
+ m_fRedMultiplier = fMultiplier;
+ m_uiRedModifierTableIndex = uiTableEntry;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiRedSelectors[uiPixel] = auiBestSelectors[uiPixel];
+ float fBestPixelRed = afBestPixelRed[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = ColorFloatRGBA(fBestPixelRed, 0.0f, 0.0f, 1.0f);
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state
+ //
+ void Block4x4Encoding_R11::SetEncodingBits(void)
+ {
+ if (m_pblockParent->GetImageSource()->GetFormat() == Image::Format::R11 || m_pblockParent->GetImageSource()->GetFormat() == Image::Format::RG11)
+ {
+ m_pencodingbitsR11->data.base = (unsigned char)roundf(m_fRedBase);
+ }
+ else if (m_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_R11 || m_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_RG11)
+ {
+ m_pencodingbitsR11->data.base = (signed char)roundf(m_fRedBase);
+ }
+ else
+ {
+ assert(0);
+ }
+ m_pencodingbitsR11->data.table = m_uiRedModifierTableIndex;
+ m_pencodingbitsR11->data.multiplier = (unsigned char)roundf(m_fRedMultiplier);
+
+ unsigned long long int ulliSelectorBits = 0;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ unsigned int uiShift = 45 - (3 * uiPixel);
+ ulliSelectorBits |= ((unsigned long long int)m_auiRedSelectors[uiPixel]) << uiShift;
+ }
+
+ m_pencodingbitsR11->data.selectors0 = ulliSelectorBits >> 40;
+ m_pencodingbitsR11->data.selectors1 = ulliSelectorBits >> 32;
+ m_pencodingbitsR11->data.selectors2 = ulliSelectorBits >> 24;
+ m_pencodingbitsR11->data.selectors3 = ulliSelectorBits >> 16;
+ m_pencodingbitsR11->data.selectors4 = ulliSelectorBits >> 8;
+ m_pencodingbitsR11->data.selectors5 = ulliSelectorBits;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+}
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_R11.h b/thirdparty/etc2comp/EtcBlock4x4Encoding_R11.h
new file mode 100644
index 0000000000..b40c1e0036
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_R11.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcBlock4x4Encoding_RGB8.h"
+
+namespace Etc
+{
+ class Block4x4EncodingBits_R11;
+
+ // ################################################################################
+ // Block4x4Encoding_R11
+ // ################################################################################
+
+ class Block4x4Encoding_R11 : public Block4x4Encoding_RGB8
+ {
+ public:
+
+ Block4x4Encoding_R11(void);
+ virtual ~Block4x4Encoding_R11(void);
+
+ virtual void InitFromSource(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+ unsigned char *a_paucEncodingBits, ErrorMetric a_errormetric);
+
+ virtual void InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric);
+
+ virtual void PerformIteration(float a_fEffort);
+
+ virtual void SetEncodingBits(void);
+
+ inline float GetRedBase(void) const
+ {
+ return m_fRedBase;
+ }
+
+ inline float GetRedMultiplier(void) const
+ {
+ return m_fRedMultiplier;
+ }
+
+ inline int GetRedTableIndex(void) const
+ {
+ return m_uiRedModifierTableIndex;
+ }
+
+ inline const unsigned int * GetRedSelectors(void) const
+ {
+ return m_auiRedSelectors;
+ }
+
+ protected:
+
+ static const unsigned int MODIFIER_TABLE_ENTRYS = 16;
+ static const unsigned int SELECTOR_BITS = 3;
+ static const unsigned int SELECTORS = 1 << SELECTOR_BITS;
+
+ static float s_aafModifierTable[MODIFIER_TABLE_ENTRYS][SELECTORS];
+
+ void CalculateR11(unsigned int a_uiSelectorsUsed,
+ float a_fBaseRadius, float a_fMultiplierRadius);
+
+
+
+
+ inline float DecodePixelRed(float a_fBase, float a_fMultiplier,
+ unsigned int a_uiTableIndex, unsigned int a_uiSelector)
+ {
+ float fMultiplier = a_fMultiplier;
+ if (fMultiplier <= 0.0f)
+ {
+ fMultiplier = 1.0f / 8.0f;
+ }
+
+ float fPixelRed = a_fBase * 8 + 4 +
+ 8 * fMultiplier*s_aafModifierTable[a_uiTableIndex][a_uiSelector]*255;
+ fPixelRed /= 2047.0f;
+
+ if (fPixelRed < 0.0f)
+ {
+ fPixelRed = 0.0f;
+ }
+ else if (fPixelRed > 1.0f)
+ {
+ fPixelRed = 1.0f;
+ }
+
+ return fPixelRed;
+ }
+
+ Block4x4EncodingBits_R11 *m_pencodingbitsR11;
+
+ float m_fRedBase;
+ float m_fRedMultiplier;
+ float m_fRedBlockError;
+ unsigned int m_uiRedModifierTableIndex;
+ unsigned int m_auiRedSelectors[PIXELS];
+
+
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RG11.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_RG11.cpp
new file mode 100644
index 0000000000..417835db51
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RG11.cpp
@@ -0,0 +1,447 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcBlock4x4Encoding_RG11.cpp
+
+Block4x4Encoding_RG11 is the encoder to use when targetting file format RG11 and SRG11 (signed RG11).
+
+*/
+
+#include "EtcConfig.h"
+#include "EtcBlock4x4Encoding_RG11.h"
+
+#include "EtcBlock4x4EncodingBits.h"
+#include "EtcBlock4x4.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <float.h>
+#include <limits>
+
+namespace Etc
+{
+ // ----------------------------------------------------------------------------------------------------
+ //
+ Block4x4Encoding_RG11::Block4x4Encoding_RG11(void)
+ {
+ m_pencodingbitsRG11 = nullptr;
+ }
+
+ Block4x4Encoding_RG11::~Block4x4Encoding_RG11(void) {}
+ // ----------------------------------------------------------------------------------------------------
+ // initialization prior to encoding
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // a_pafrgbaSource points to a 4x4 block subset of the source image
+ // a_paucEncodingBits points to the final encoding bits
+ //
+ void Block4x4Encoding_RG11::InitFromSource(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+ unsigned char *a_paucEncodingBits, ErrorMetric a_errormetric)
+ {
+ Block4x4Encoding::Init(a_pblockParent, a_pafrgbaSource,a_errormetric);
+
+ m_pencodingbitsRG11 = (Block4x4EncodingBits_RG11 *)a_paucEncodingBits;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // a_pafrgbaSource points to a 4x4 block subset of the source image
+ // a_paucEncodingBits points to the final encoding bits of a previous encoding
+ //
+ void Block4x4Encoding_RG11::InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric)
+ {
+
+ m_pencodingbitsRG11 = (Block4x4EncodingBits_RG11 *)a_paucEncodingBits;
+
+ // init RGB portion
+ Block4x4Encoding_RGB8::InitFromEncodingBits(a_pblockParent,
+ (unsigned char *)m_pencodingbitsRG11,
+ a_pafrgbaSource,
+ a_errormetric);
+ m_fError = 0.0f;
+
+ {
+ m_mode = MODE_RG11;
+ if (a_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_RG11)
+ {
+ m_fRedBase = (float)(signed char)m_pencodingbitsRG11->data.baseR;
+ m_fGrnBase = (float)(signed char)m_pencodingbitsRG11->data.baseG;
+ }
+ else
+ {
+ m_fRedBase = (float)(unsigned char)m_pencodingbitsRG11->data.baseR;
+ m_fGrnBase = (float)(unsigned char)m_pencodingbitsRG11->data.baseG;
+ }
+ m_fRedMultiplier = (float)m_pencodingbitsRG11->data.multiplierR;
+ m_fGrnMultiplier = (float)m_pencodingbitsRG11->data.multiplierG;
+ m_uiRedModifierTableIndex = m_pencodingbitsRG11->data.tableIndexR;
+ m_uiGrnModifierTableIndex = m_pencodingbitsRG11->data.tableIndexG;
+
+ unsigned long long int ulliSelectorBitsR = 0;
+ ulliSelectorBitsR |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsR0 << 40;
+ ulliSelectorBitsR |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsR1 << 32;
+ ulliSelectorBitsR |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsR2 << 24;
+ ulliSelectorBitsR |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsR3 << 16;
+ ulliSelectorBitsR |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsR4 << 8;
+ ulliSelectorBitsR |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsR5;
+
+ unsigned long long int ulliSelectorBitsG = 0;
+ ulliSelectorBitsG |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsG0 << 40;
+ ulliSelectorBitsG |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsG1 << 32;
+ ulliSelectorBitsG |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsG2 << 24;
+ ulliSelectorBitsG |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsG3 << 16;
+ ulliSelectorBitsG |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsG4 << 8;
+ ulliSelectorBitsG |= (unsigned long long int)m_pencodingbitsRG11->data.selectorsG5;
+
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ unsigned int uiShift = 45 - (3 * uiPixel);
+ m_auiRedSelectors[uiPixel] = (ulliSelectorBitsR >> uiShift) & (SELECTORS - 1);
+ m_auiGrnSelectors[uiPixel] = (ulliSelectorBitsG >> uiShift) & (SELECTORS - 1);
+ }
+
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ float fRedDecodedData = 0.0f;
+ float fGrnDecodedData = 0.0f;
+ if (a_pblockParent->GetImageSource()->GetFormat() == Image::Format::RG11)
+ {
+ fRedDecodedData = DecodePixelRed(m_fRedBase, m_fRedMultiplier, m_uiRedModifierTableIndex, m_auiRedSelectors[uiPixel]);
+ fGrnDecodedData = DecodePixelRed(m_fGrnBase, m_fGrnMultiplier, m_uiGrnModifierTableIndex, m_auiGrnSelectors[uiPixel]);
+ }
+ else if (a_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_RG11)
+ {
+ fRedDecodedData = DecodePixelRed(m_fRedBase + 128, m_fRedMultiplier, m_uiRedModifierTableIndex, m_auiRedSelectors[uiPixel]);
+ fGrnDecodedData = DecodePixelRed(m_fGrnBase + 128, m_fGrnMultiplier, m_uiGrnModifierTableIndex, m_auiGrnSelectors[uiPixel]);
+ }
+ else
+ {
+ assert(0);
+ }
+ m_afrgbaDecodedColors[uiPixel] = ColorFloatRGBA(fRedDecodedData, fGrnDecodedData, 0.0f, 1.0f);
+ }
+
+ }
+
+ CalcBlockError();
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // perform a single encoding iteration
+ // replace the encoding if a better encoding was found
+ // subsequent iterations generally take longer for each iteration
+ // set m_boolDone if encoding is perfect or encoding is finished based on a_fEffort
+ //
+ void Block4x4Encoding_RG11::PerformIteration(float a_fEffort)
+ {
+ assert(!m_boolDone);
+
+ switch (m_uiEncodingIterations)
+ {
+ case 0:
+ m_fError = FLT_MAX;
+ m_fGrnBlockError = FLT_MAX; // artificially high value
+ m_fRedBlockError = FLT_MAX;
+ CalculateR11(8, 0.0f, 0.0f);
+ CalculateG11(8, 0.0f, 0.0f);
+ m_fError = (m_fGrnBlockError + m_fRedBlockError);
+ break;
+
+ case 1:
+ CalculateR11(8, 2.0f, 1.0f);
+ CalculateG11(8, 2.0f, 1.0f);
+ m_fError = (m_fGrnBlockError + m_fRedBlockError);
+ if (a_fEffort <= 24.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 2:
+ CalculateR11(8, 12.0f, 1.0f);
+ CalculateG11(8, 12.0f, 1.0f);
+ m_fError = (m_fGrnBlockError + m_fRedBlockError);
+ if (a_fEffort <= 49.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 3:
+ CalculateR11(7, 6.0f, 1.0f);
+ CalculateG11(7, 6.0f, 1.0f);
+ m_fError = (m_fGrnBlockError + m_fRedBlockError);
+ break;
+
+ case 4:
+ CalculateR11(6, 3.0f, 1.0f);
+ CalculateG11(6, 3.0f, 1.0f);
+ m_fError = (m_fGrnBlockError + m_fRedBlockError);
+ break;
+
+ case 5:
+ CalculateR11(5, 1.0f, 0.0f);
+ CalculateG11(5, 1.0f, 0.0f);
+ m_fError = (m_fGrnBlockError + m_fRedBlockError);
+ m_boolDone = true;
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+ m_uiEncodingIterations++;
+ SetDoneIfPerfect();
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // find the best combination of base color, multiplier and selectors
+ //
+ // a_uiSelectorsUsed limits the number of selector combinations to try
+ // a_fBaseRadius limits the range of base colors to try
+ // a_fMultiplierRadius limits the range of multipliers to try
+ //
+ void Block4x4Encoding_RG11::CalculateG11(unsigned int a_uiSelectorsUsed,
+ float a_fBaseRadius, float a_fMultiplierRadius)
+ {
+ // maps from virtual (monotonic) selector to etc selector
+ static const unsigned int auiVirtualSelectorMap[8] = { 3, 2, 1, 0, 4, 5, 6, 7 };
+
+ // find min/max Grn
+ float fMinGrn = 1.0f;
+ float fMaxGrn = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ // ignore border pixels
+ float fAlpha = m_pafrgbaSource[uiPixel].fA;
+ if (isnan(fAlpha))
+ {
+ continue;
+ }
+
+ float fGrn = m_pafrgbaSource[uiPixel].fG;
+
+ if (fGrn < fMinGrn)
+ {
+ fMinGrn = fGrn;
+ }
+ if (fGrn > fMaxGrn)
+ {
+ fMaxGrn = fGrn;
+ }
+ }
+ assert(fMinGrn <= fMaxGrn);
+
+ float fGrnRange = (fMaxGrn - fMinGrn);
+
+ // try each modifier table entry
+ for (unsigned int uiTableEntry = 0; uiTableEntry < MODIFIER_TABLE_ENTRYS; uiTableEntry++)
+ {
+ for (unsigned int uiMinVirtualSelector = 0;
+ uiMinVirtualSelector <= (8 - a_uiSelectorsUsed);
+ uiMinVirtualSelector++)
+ {
+ unsigned int uiMaxVirtualSelector = uiMinVirtualSelector + a_uiSelectorsUsed - 1;
+
+ unsigned int uiMinSelector = auiVirtualSelectorMap[uiMinVirtualSelector];
+ unsigned int uiMaxSelector = auiVirtualSelectorMap[uiMaxVirtualSelector];
+
+ float fTableEntryCenter = -s_aafModifierTable[uiTableEntry][uiMinSelector];
+
+ float fTableEntryRange = s_aafModifierTable[uiTableEntry][uiMaxSelector] -
+ s_aafModifierTable[uiTableEntry][uiMinSelector];
+
+ float fCenterRatio = fTableEntryCenter / fTableEntryRange;
+
+ float fCenter = fMinGrn + fCenterRatio*fGrnRange;
+ fCenter = roundf(255.0f * fCenter) / 255.0f;
+
+ float fMinBase = fCenter - (a_fBaseRadius / 255.0f);
+ if (fMinBase < 0.0f)
+ {
+ fMinBase = 0.0f;
+ }
+
+ float fMaxBase = fCenter + (a_fBaseRadius / 255.0f);
+ if (fMaxBase > 1.0f)
+ {
+ fMaxBase = 1.0f;
+ }
+
+ for (float fBase = fMinBase; fBase <= fMaxBase; fBase += (0.999999f / 255.0f))
+ {
+ float fRangeMultiplier = roundf(fGrnRange / fTableEntryRange);
+
+ float fMinMultiplier = fRangeMultiplier - a_fMultiplierRadius;
+ if (fMinMultiplier < 1.0f)
+ {
+ fMinMultiplier = 0.0f;
+ }
+ else if (fMinMultiplier > 15.0f)
+ {
+ fMinMultiplier = 15.0f;
+ }
+
+ float fMaxMultiplier = fRangeMultiplier + a_fMultiplierRadius;
+ if (fMaxMultiplier < 1.0f)
+ {
+ fMaxMultiplier = 1.0f;
+ }
+ else if (fMaxMultiplier > 15.0f)
+ {
+ fMaxMultiplier = 15.0f;
+ }
+
+ for (float fMultiplier = fMinMultiplier; fMultiplier <= fMaxMultiplier; fMultiplier += 1.0f)
+ {
+ // find best selector for each pixel
+ unsigned int auiBestSelectors[PIXELS];
+ float afBestGrnError[PIXELS];
+ float afBestPixelGrn[PIXELS];
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ float fBestPixelGrnError = FLT_MAX;
+
+ for (unsigned int uiSelector = 0; uiSelector < SELECTORS; uiSelector++)
+ {
+ //DecodePixelRed is not red channel specific
+ float fPixelGrn = DecodePixelRed(fBase * 255.0f, fMultiplier, uiTableEntry, uiSelector);
+
+ ColorFloatRGBA frgba(m_pafrgbaSource[uiPixel].fR, fPixelGrn, 0.0f, 1.0f);
+
+ float fPixelGrnError = CalcPixelError(frgba, 1.0f, m_pafrgbaSource[uiPixel]);
+
+ if (fPixelGrnError < fBestPixelGrnError)
+ {
+ fBestPixelGrnError = fPixelGrnError;
+ auiBestSelectors[uiPixel] = uiSelector;
+ afBestGrnError[uiPixel] = fBestPixelGrnError;
+ afBestPixelGrn[uiPixel] = fPixelGrn;
+ }
+ }
+ }
+ float fBlockError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ fBlockError += afBestGrnError[uiPixel];
+ }
+
+ if (fBlockError < m_fGrnBlockError)
+ {
+ m_fGrnBlockError = fBlockError;
+
+ if (m_pblockParent->GetImageSource()->GetFormat() == Image::Format::RG11)
+ {
+ m_fGrnBase = 255.0f * fBase;
+ }
+ else if (m_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_RG11)
+ {
+ m_fGrnBase = (fBase * 255) - 128;
+ }
+ else
+ {
+ assert(0);
+ }
+ m_fGrnMultiplier = fMultiplier;
+ m_uiGrnModifierTableIndex = uiTableEntry;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiGrnSelectors[uiPixel] = auiBestSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel].fG = afBestPixelGrn[uiPixel];
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state
+ //
+ void Block4x4Encoding_RG11::SetEncodingBits(void)
+ {
+ unsigned long long int ulliSelectorBitsR = 0;
+ unsigned long long int ulliSelectorBitsG = 0;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ unsigned int uiShift = 45 - (3 * uiPixel);
+ ulliSelectorBitsR |= ((unsigned long long int)m_auiRedSelectors[uiPixel]) << uiShift;
+ ulliSelectorBitsG |= ((unsigned long long int)m_auiGrnSelectors[uiPixel]) << uiShift;
+ }
+ if (m_pblockParent->GetImageSource()->GetFormat() == Image::Format::RG11)
+ {
+ m_pencodingbitsRG11->data.baseR = (unsigned char)roundf(m_fRedBase);
+ }
+ else if (m_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_RG11)
+ {
+ m_pencodingbitsRG11->data.baseR = (signed char)roundf(m_fRedBase);
+ }
+ else
+ {
+ assert(0);
+ }
+ m_pencodingbitsRG11->data.tableIndexR = m_uiRedModifierTableIndex;
+ m_pencodingbitsRG11->data.multiplierR = (unsigned char)roundf(m_fRedMultiplier);
+
+ m_pencodingbitsRG11->data.selectorsR0 = ulliSelectorBitsR >> 40;
+ m_pencodingbitsRG11->data.selectorsR1 = ulliSelectorBitsR >> 32;
+ m_pencodingbitsRG11->data.selectorsR2 = ulliSelectorBitsR >> 24;
+ m_pencodingbitsRG11->data.selectorsR3 = ulliSelectorBitsR >> 16;
+ m_pencodingbitsRG11->data.selectorsR4 = ulliSelectorBitsR >> 8;
+ m_pencodingbitsRG11->data.selectorsR5 = ulliSelectorBitsR;
+
+ if (m_pblockParent->GetImageSource()->GetFormat() == Image::Format::RG11)
+ {
+ m_pencodingbitsRG11->data.baseG = (unsigned char)roundf(m_fGrnBase);
+ }
+ else if (m_pblockParent->GetImageSource()->GetFormat() == Image::Format::SIGNED_RG11)
+ {
+ m_pencodingbitsRG11->data.baseG = (signed char)roundf(m_fGrnBase);
+ }
+ else
+ {
+ assert(0);
+ }
+ m_pencodingbitsRG11->data.tableIndexG = m_uiGrnModifierTableIndex;
+ m_pencodingbitsRG11->data.multiplierG = (unsigned char)roundf(m_fGrnMultiplier);
+
+ m_pencodingbitsRG11->data.selectorsG0 = ulliSelectorBitsG >> 40;
+ m_pencodingbitsRG11->data.selectorsG1 = ulliSelectorBitsG >> 32;
+ m_pencodingbitsRG11->data.selectorsG2 = ulliSelectorBitsG >> 24;
+ m_pencodingbitsRG11->data.selectorsG3 = ulliSelectorBitsG >> 16;
+ m_pencodingbitsRG11->data.selectorsG4 = ulliSelectorBitsG >> 8;
+ m_pencodingbitsRG11->data.selectorsG5 = ulliSelectorBitsG;
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+}
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RG11.h b/thirdparty/etc2comp/EtcBlock4x4Encoding_RG11.h
new file mode 100644
index 0000000000..d4993b8c5f
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RG11.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcBlock4x4Encoding_RGB8.h"
+#include "EtcBlock4x4Encoding_R11.h"
+
+namespace Etc
+{
+ class Block4x4EncodingBits_RG11;
+
+ // ################################################################################
+ // Block4x4Encoding_RG11
+ // ################################################################################
+
+ class Block4x4Encoding_RG11 : public Block4x4Encoding_R11
+ {
+ float m_fGrnBase;
+ float m_fGrnMultiplier;
+ float m_fGrnBlockError;
+ unsigned int m_auiGrnSelectors[PIXELS];
+ unsigned int m_uiGrnModifierTableIndex;
+ public:
+
+ Block4x4Encoding_RG11(void);
+ virtual ~Block4x4Encoding_RG11(void);
+
+ virtual void InitFromSource(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+
+ unsigned char *a_paucEncodingBits, ErrorMetric a_errormetric);
+
+ virtual void InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+
+ ErrorMetric a_errormetric);
+
+ virtual void PerformIteration(float a_fEffort);
+
+ virtual void SetEncodingBits(void);
+
+ Block4x4EncodingBits_RG11 *m_pencodingbitsRG11;
+
+ void CalculateG11(unsigned int a_uiSelectorsUsed, float a_fBaseRadius, float a_fMultiplierRadius);
+
+ inline float GetGrnBase(void) const
+ {
+ return m_fGrnBase;
+ }
+
+ inline float GetGrnMultiplier(void) const
+ {
+ return m_fGrnMultiplier;
+ }
+
+ inline int GetGrnTableIndex(void) const
+ {
+ return m_uiGrnModifierTableIndex;
+ }
+
+ inline const unsigned int * GetGrnSelectors(void) const
+ {
+ return m_auiGrnSelectors;
+ }
+
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp
new file mode 100644
index 0000000000..5656556db9
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp
@@ -0,0 +1,1730 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcBlock4x4Encoding_RGB8.cpp
+
+Block4x4Encoding_RGB8 is the encoder to use for the ETC2 extensions when targetting file format RGB8.
+This encoder is also used for the ETC2 subset of file format RGBA8.
+
+Block4x4Encoding_ETC1 encodes the ETC1 subset of RGB8.
+
+*/
+
+#include "EtcConfig.h"
+#include "EtcBlock4x4Encoding_RGB8.h"
+
+#include "EtcBlock4x4EncodingBits.h"
+#include "EtcBlock4x4.h"
+#include "EtcMath.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <float.h>
+#include <limits>
+
+namespace Etc
+{
+ float Block4x4Encoding_RGB8::s_afTHDistanceTable[TH_DISTANCES] =
+ {
+ 3.0f / 255.0f,
+ 6.0f / 255.0f,
+ 11.0f / 255.0f,
+ 16.0f / 255.0f,
+ 23.0f / 255.0f,
+ 32.0f / 255.0f,
+ 41.0f / 255.0f,
+ 64.0f / 255.0f
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ Block4x4Encoding_RGB8::Block4x4Encoding_RGB8(void)
+ {
+
+ m_pencodingbitsRGB8 = nullptr;
+
+ }
+
+ Block4x4Encoding_RGB8::~Block4x4Encoding_RGB8(void) {}
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // a_pafrgbaSource points to a 4x4 block subset of the source image
+ // a_paucEncodingBits points to the final encoding bits of a previous encoding
+ //
+ void Block4x4Encoding_RGB8::InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric)
+ {
+
+ // handle ETC1 modes
+ Block4x4Encoding_ETC1::InitFromEncodingBits(a_pblockParent,
+ a_paucEncodingBits, a_pafrgbaSource,a_errormetric);
+
+ m_pencodingbitsRGB8 = (Block4x4EncodingBits_RGB8 *)a_paucEncodingBits;
+
+ // detect if there is a T, H or Planar mode present
+ if (m_pencodingbitsRGB8->differential.diff)
+ {
+ int iRed1 = (int)m_pencodingbitsRGB8->differential.red1;
+ int iDRed2 = m_pencodingbitsRGB8->differential.dred2;
+ int iRed2 = iRed1 + iDRed2;
+
+ int iGreen1 = (int)m_pencodingbitsRGB8->differential.green1;
+ int iDGreen2 = m_pencodingbitsRGB8->differential.dgreen2;
+ int iGreen2 = iGreen1 + iDGreen2;
+
+ int iBlue1 = (int)m_pencodingbitsRGB8->differential.blue1;
+ int iDBlue2 = m_pencodingbitsRGB8->differential.dblue2;
+ int iBlue2 = iBlue1 + iDBlue2;
+
+ if (iRed2 < 0 || iRed2 > 31)
+ {
+ InitFromEncodingBits_T();
+ }
+ else if (iGreen2 < 0 || iGreen2 > 31)
+ {
+ InitFromEncodingBits_H();
+ }
+ else if (iBlue2 < 0 || iBlue2 > 31)
+ {
+ InitFromEncodingBits_Planar();
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding if T mode is detected
+ //
+ void Block4x4Encoding_RGB8::InitFromEncodingBits_T(void)
+ {
+
+ m_mode = MODE_T;
+
+ unsigned char ucRed1 = (unsigned char)((m_pencodingbitsRGB8->t.red1a << 2) +
+ m_pencodingbitsRGB8->t.red1b);
+ unsigned char ucGreen1 = m_pencodingbitsRGB8->t.green1;
+ unsigned char ucBlue1 = m_pencodingbitsRGB8->t.blue1;
+
+ unsigned char ucRed2 = m_pencodingbitsRGB8->t.red2;
+ unsigned char ucGreen2 = m_pencodingbitsRGB8->t.green2;
+ unsigned char ucBlue2 = m_pencodingbitsRGB8->t.blue2;
+
+ m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4(ucRed1, ucGreen1, ucBlue1);
+ m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4(ucRed2, ucGreen2, ucBlue2);
+
+ m_uiCW1 = (m_pencodingbitsRGB8->t.da << 1) + m_pencodingbitsRGB8->t.db;
+
+ Block4x4Encoding_ETC1::InitFromEncodingBits_Selectors();
+
+ DecodePixels_T();
+
+ CalcBlockError();
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding if H mode is detected
+ //
+ void Block4x4Encoding_RGB8::InitFromEncodingBits_H(void)
+ {
+
+ m_mode = MODE_H;
+
+ unsigned char ucRed1 = m_pencodingbitsRGB8->h.red1;
+ unsigned char ucGreen1 = (unsigned char)((m_pencodingbitsRGB8->h.green1a << 1) +
+ m_pencodingbitsRGB8->h.green1b);
+ unsigned char ucBlue1 = (unsigned char)((m_pencodingbitsRGB8->h.blue1a << 3) +
+ (m_pencodingbitsRGB8->h.blue1b << 1) +
+ m_pencodingbitsRGB8->h.blue1c);
+
+ unsigned char ucRed2 = m_pencodingbitsRGB8->h.red2;
+ unsigned char ucGreen2 = (unsigned char)((m_pencodingbitsRGB8->h.green2a << 1) +
+ m_pencodingbitsRGB8->h.green2b);
+ unsigned char ucBlue2 = m_pencodingbitsRGB8->h.blue2;
+
+ m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4(ucRed1, ucGreen1, ucBlue1);
+ m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4(ucRed2, ucGreen2, ucBlue2);
+
+ // used to determine the LSB of the CW
+ unsigned int uiRGB1 = (unsigned int)(((int)ucRed1 << 16) + ((int)ucGreen1 << 8) + (int)ucBlue1);
+ unsigned int uiRGB2 = (unsigned int)(((int)ucRed2 << 16) + ((int)ucGreen2 << 8) + (int)ucBlue2);
+
+ m_uiCW1 = (m_pencodingbitsRGB8->h.da << 2) + (m_pencodingbitsRGB8->h.db << 1);
+ if (uiRGB1 >= uiRGB2)
+ {
+ m_uiCW1++;
+ }
+
+ Block4x4Encoding_ETC1::InitFromEncodingBits_Selectors();
+
+ DecodePixels_H();
+
+ CalcBlockError();
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding if Planar mode is detected
+ //
+ void Block4x4Encoding_RGB8::InitFromEncodingBits_Planar(void)
+ {
+
+ m_mode = MODE_PLANAR;
+
+ unsigned char ucOriginRed = m_pencodingbitsRGB8->planar.originRed;
+ unsigned char ucOriginGreen = (unsigned char)((m_pencodingbitsRGB8->planar.originGreen1 << 6) +
+ m_pencodingbitsRGB8->planar.originGreen2);
+ unsigned char ucOriginBlue = (unsigned char)((m_pencodingbitsRGB8->planar.originBlue1 << 5) +
+ (m_pencodingbitsRGB8->planar.originBlue2 << 3) +
+ (m_pencodingbitsRGB8->planar.originBlue3 << 1) +
+ m_pencodingbitsRGB8->planar.originBlue4);
+
+ unsigned char ucHorizRed = (unsigned char)((m_pencodingbitsRGB8->planar.horizRed1 << 1) +
+ m_pencodingbitsRGB8->planar.horizRed2);
+ unsigned char ucHorizGreen = m_pencodingbitsRGB8->planar.horizGreen;
+ unsigned char ucHorizBlue = (unsigned char)((m_pencodingbitsRGB8->planar.horizBlue1 << 5) +
+ m_pencodingbitsRGB8->planar.horizBlue2);
+
+ unsigned char ucVertRed = (unsigned char)((m_pencodingbitsRGB8->planar.vertRed1 << 3) +
+ m_pencodingbitsRGB8->planar.vertRed2);
+ unsigned char ucVertGreen = (unsigned char)((m_pencodingbitsRGB8->planar.vertGreen1 << 2) +
+ m_pencodingbitsRGB8->planar.vertGreen2);
+ unsigned char ucVertBlue = m_pencodingbitsRGB8->planar.vertBlue;
+
+ m_frgbaColor1 = ColorFloatRGBA::ConvertFromR6G7B6(ucOriginRed, ucOriginGreen, ucOriginBlue);
+ m_frgbaColor2 = ColorFloatRGBA::ConvertFromR6G7B6(ucHorizRed, ucHorizGreen, ucHorizBlue);
+ m_frgbaColor3 = ColorFloatRGBA::ConvertFromR6G7B6(ucVertRed, ucVertGreen, ucVertBlue);
+
+ DecodePixels_Planar();
+
+ CalcBlockError();
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // perform a single encoding iteration
+ // replace the encoding if a better encoding was found
+ // subsequent iterations generally take longer for each iteration
+ // set m_boolDone if encoding is perfect or encoding is finished based on a_fEffort
+ //
+ void Block4x4Encoding_RGB8::PerformIteration(float a_fEffort)
+ {
+ assert(!m_boolDone);
+
+ switch (m_uiEncodingIterations)
+ {
+ case 0:
+ Block4x4Encoding_ETC1::PerformFirstIteration();
+ if (m_boolDone)
+ {
+ break;
+ }
+ TryPlanar(0);
+ SetDoneIfPerfect();
+ if (m_boolDone)
+ {
+ break;
+ }
+ TryTAndH(0);
+ break;
+
+ case 1:
+ Block4x4Encoding_ETC1::TryDifferential(m_boolMostLikelyFlip, 1, 0, 0);
+ break;
+
+ case 2:
+ Block4x4Encoding_ETC1::TryIndividual(m_boolMostLikelyFlip, 1);
+ break;
+
+ case 3:
+ Block4x4Encoding_ETC1::TryDifferential(!m_boolMostLikelyFlip, 1, 0, 0);
+ break;
+
+ case 4:
+ Block4x4Encoding_ETC1::TryIndividual(!m_boolMostLikelyFlip, 1);
+ break;
+
+ case 5:
+ TryPlanar(1);
+ if (a_fEffort <= 49.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 6:
+ TryTAndH(1);
+ if (a_fEffort <= 59.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 7:
+ Block4x4Encoding_ETC1::TryDegenerates1();
+ if (a_fEffort <= 69.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 8:
+ Block4x4Encoding_ETC1::TryDegenerates2();
+ if (a_fEffort <= 79.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 9:
+ Block4x4Encoding_ETC1::TryDegenerates3();
+ if (a_fEffort <= 89.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 10:
+ Block4x4Encoding_ETC1::TryDegenerates4();
+ m_boolDone = true;
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+ m_uiEncodingIterations++;
+
+ SetDoneIfPerfect();
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try encoding in Planar mode
+ // save this encoding if it improves the error
+ //
+ void Block4x4Encoding_RGB8::TryPlanar(unsigned int a_uiRadius)
+ {
+ Block4x4Encoding_RGB8 encodingTry = *this;
+
+ // init "try"
+ {
+ encodingTry.m_mode = MODE_PLANAR;
+ encodingTry.m_boolDiff = true;
+ encodingTry.m_boolFlip = false;
+ }
+
+ encodingTry.CalculatePlanarCornerColors();
+
+ encodingTry.DecodePixels_Planar();
+
+ encodingTry.CalcBlockError();
+
+ if (a_uiRadius > 0)
+ {
+ encodingTry.TwiddlePlanar();
+ }
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = MODE_PLANAR;
+ m_boolDiff = true;
+ m_boolFlip = false;
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_frgbaColor3 = encodingTry.m_frgbaColor3;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try encoding in T mode or H mode
+ // save this encoding if it improves the error
+ //
+ void Block4x4Encoding_RGB8::TryTAndH(unsigned int a_uiRadius)
+ {
+
+ CalculateBaseColorsForTAndH();
+
+ TryT(a_uiRadius);
+
+ TryH(a_uiRadius);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // calculate original values for base colors
+ // store them in m_frgbaOriginalColor1 and m_frgbaOriginalColor2
+ //
+ void Block4x4Encoding_RGB8::CalculateBaseColorsForTAndH(void)
+ {
+
+ bool boolRGBX = m_pblockParent->GetImageSource()->GetErrorMetric() == ErrorMetric::RGBX;
+
+ ColorFloatRGBA frgbaBlockAverage = (m_frgbaSourceAverageLeft + m_frgbaSourceAverageRight) * 0.5f;
+
+ // find pixel farthest from average gray line
+ unsigned int uiFarthestPixel = 0;
+ float fFarthestGrayDistance2 = 0.0f;
+ unsigned int uiTransparentPixels = 0;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ // don't count transparent
+ if (m_pafrgbaSource[uiPixel].fA == 0.0f && !boolRGBX)
+ {
+ uiTransparentPixels++;
+ }
+ else
+ {
+ float fGrayDistance2 = CalcGrayDistance2(m_pafrgbaSource[uiPixel], frgbaBlockAverage);
+
+ if (fGrayDistance2 > fFarthestGrayDistance2)
+ {
+ uiFarthestPixel = uiPixel;
+ fFarthestGrayDistance2 = fGrayDistance2;
+ }
+ }
+ }
+ // a transparent block should not reach this method
+ assert(uiTransparentPixels < PIXELS);
+
+ // set the original base colors to:
+ // half way to the farthest pixel and
+ // the mirror color on the other side of the average
+ ColorFloatRGBA frgbaOffset = (m_pafrgbaSource[uiFarthestPixel] - frgbaBlockAverage) * 0.5f;
+ m_frgbaOriginalColor1_TAndH = (frgbaBlockAverage + frgbaOffset).QuantizeR4G4B4();
+ m_frgbaOriginalColor2_TAndH = (frgbaBlockAverage - frgbaOffset).ClampRGB().QuantizeR4G4B4(); // the "other side" might be out of range
+
+ // move base colors to find best fit
+ for (unsigned int uiIteration = 0; uiIteration < 10; uiIteration++)
+ {
+ // find the center of pixels closest to each color
+ float fPixelsCloserToColor1 = 0.0f;
+ ColorFloatRGBA frgbSumPixelsCloserToColor1;
+ float fPixelsCloserToColor2 = 0.0f;
+ ColorFloatRGBA frgbSumPixelsCloserToColor2;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ // don't count transparent pixels
+ if (m_pafrgbaSource[uiPixel].fA == 0.0f)
+ {
+ continue;
+ }
+
+ float fGrayDistance2ToColor1 = CalcGrayDistance2(m_pafrgbaSource[uiPixel], m_frgbaOriginalColor1_TAndH);
+ float fGrayDistance2ToColor2 = CalcGrayDistance2(m_pafrgbaSource[uiPixel], m_frgbaOriginalColor2_TAndH);
+
+ ColorFloatRGBA frgbaAlphaWeightedSource = m_pafrgbaSource[uiPixel] * m_pafrgbaSource[uiPixel].fA;
+
+ if (fGrayDistance2ToColor1 <= fGrayDistance2ToColor2)
+ {
+ fPixelsCloserToColor1 += m_pafrgbaSource[uiPixel].fA;
+ frgbSumPixelsCloserToColor1 = frgbSumPixelsCloserToColor1 + frgbaAlphaWeightedSource;
+ }
+ else
+ {
+ fPixelsCloserToColor2 += m_pafrgbaSource[uiPixel].fA;
+ frgbSumPixelsCloserToColor2 = frgbSumPixelsCloserToColor2 + frgbaAlphaWeightedSource;
+ }
+ }
+ if (fPixelsCloserToColor1 == 0.0f || fPixelsCloserToColor2 == 0.0f)
+ {
+ break;
+ }
+
+ ColorFloatRGBA frgbAvgColor1Pixels = (frgbSumPixelsCloserToColor1 * (1.0f / fPixelsCloserToColor1)).QuantizeR4G4B4();
+ ColorFloatRGBA frgbAvgColor2Pixels = (frgbSumPixelsCloserToColor2 * (1.0f / fPixelsCloserToColor2)).QuantizeR4G4B4();
+
+ if (frgbAvgColor1Pixels.fR == m_frgbaOriginalColor1_TAndH.fR &&
+ frgbAvgColor1Pixels.fG == m_frgbaOriginalColor1_TAndH.fG &&
+ frgbAvgColor1Pixels.fB == m_frgbaOriginalColor1_TAndH.fB &&
+ frgbAvgColor2Pixels.fR == m_frgbaOriginalColor2_TAndH.fR &&
+ frgbAvgColor2Pixels.fG == m_frgbaOriginalColor2_TAndH.fG &&
+ frgbAvgColor2Pixels.fB == m_frgbaOriginalColor2_TAndH.fB)
+ {
+ break;
+ }
+
+ m_frgbaOriginalColor1_TAndH = frgbAvgColor1Pixels;
+ m_frgbaOriginalColor2_TAndH = frgbAvgColor2Pixels;
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try encoding in T mode
+ // save this encoding if it improves the error
+ //
+ // since pixels that use base color1 don't use the distance table, color1 and color2 can be twiddled independently
+ // better encoding can be found if TWIDDLE_RADIUS is set to 2, but it will be much slower
+ //
+ void Block4x4Encoding_RGB8::TryT(unsigned int a_uiRadius)
+ {
+ Block4x4Encoding_RGB8 encodingTry = *this;
+
+ // init "try"
+ {
+ encodingTry.m_mode = MODE_T;
+ encodingTry.m_boolDiff = true;
+ encodingTry.m_boolFlip = false;
+ encodingTry.m_fError = FLT_MAX;
+ }
+
+ int iColor1Red = m_frgbaOriginalColor1_TAndH.IntRed(15.0f);
+ int iColor1Green = m_frgbaOriginalColor1_TAndH.IntGreen(15.0f);
+ int iColor1Blue = m_frgbaOriginalColor1_TAndH.IntBlue(15.0f);
+
+ int iMinRed1 = iColor1Red - (int)a_uiRadius;
+ if (iMinRed1 < 0)
+ {
+ iMinRed1 = 0;
+ }
+ int iMaxRed1 = iColor1Red + (int)a_uiRadius;
+ if (iMaxRed1 > 15)
+ {
+ iMinRed1 = 15;
+ }
+
+ int iMinGreen1 = iColor1Green - (int)a_uiRadius;
+ if (iMinGreen1 < 0)
+ {
+ iMinGreen1 = 0;
+ }
+ int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
+ if (iMaxGreen1 > 15)
+ {
+ iMinGreen1 = 15;
+ }
+
+ int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
+ if (iMinBlue1 < 0)
+ {
+ iMinBlue1 = 0;
+ }
+ int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
+ if (iMaxBlue1 > 15)
+ {
+ iMinBlue1 = 15;
+ }
+
+ int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
+ int iColor2Green = m_frgbaOriginalColor2_TAndH.IntGreen(15.0f);
+ int iColor2Blue = m_frgbaOriginalColor2_TAndH.IntBlue(15.0f);
+
+ int iMinRed2 = iColor2Red - (int)a_uiRadius;
+ if (iMinRed2 < 0)
+ {
+ iMinRed2 = 0;
+ }
+ int iMaxRed2 = iColor2Red + (int)a_uiRadius;
+ if (iMaxRed2 > 15)
+ {
+ iMinRed2 = 15;
+ }
+
+ int iMinGreen2 = iColor2Green - (int)a_uiRadius;
+ if (iMinGreen2 < 0)
+ {
+ iMinGreen2 = 0;
+ }
+ int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
+ if (iMaxGreen2 > 15)
+ {
+ iMinGreen2 = 15;
+ }
+
+ int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
+ if (iMinBlue2 < 0)
+ {
+ iMinBlue2 = 0;
+ }
+ int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
+ if (iMaxBlue2 > 15)
+ {
+ iMinBlue2 = 15;
+ }
+
+ for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
+ {
+ encodingTry.m_uiCW1 = uiDistance;
+
+ // twiddle m_frgbaOriginalColor2_TAndH
+ // twiddle color2 first, since it affects 3 selectors, while color1 only affects one selector
+ //
+ for (int iRed2 = iMinRed2; iRed2 <= iMaxRed2; iRed2++)
+ {
+ for (int iGreen2 = iMinGreen2; iGreen2 <= iMaxGreen2; iGreen2++)
+ {
+ for (int iBlue2 = iMinBlue2; iBlue2 <= iMaxBlue2; iBlue2++)
+ {
+ for (unsigned int uiBaseColorSwaps = 0; uiBaseColorSwaps < 2; uiBaseColorSwaps++)
+ {
+ if (uiBaseColorSwaps == 0)
+ {
+ encodingTry.m_frgbaColor1 = m_frgbaOriginalColor1_TAndH;
+ encodingTry.m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed2, (unsigned char)iGreen2, (unsigned char)iBlue2);
+ }
+ else
+ {
+ encodingTry.m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed2, (unsigned char)iGreen2, (unsigned char)iBlue2);
+ encodingTry.m_frgbaColor2 = m_frgbaOriginalColor1_TAndH;
+ }
+
+ encodingTry.TryT_BestSelectorCombination();
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = encodingTry.m_mode;
+ m_boolDiff = encodingTry.m_boolDiff;
+ m_boolFlip = encodingTry.m_boolFlip;
+
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_uiCW1 = encodingTry.m_uiCW1;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = encodingTry.m_auiSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+ }
+ }
+ }
+ }
+ }
+
+ // twiddle m_frgbaOriginalColor1_TAndH
+ for (int iRed1 = iMinRed1; iRed1 <= iMaxRed1; iRed1++)
+ {
+ for (int iGreen1 = iMinGreen1; iGreen1 <= iMaxGreen1; iGreen1++)
+ {
+ for (int iBlue1 = iMinBlue1; iBlue1 <= iMaxBlue1; iBlue1++)
+ {
+ for (unsigned int uiBaseColorSwaps = 0; uiBaseColorSwaps < 2; uiBaseColorSwaps++)
+ {
+ if (uiBaseColorSwaps == 0)
+ {
+ encodingTry.m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed1, (unsigned char)iGreen1, (unsigned char)iBlue1);
+ encodingTry.m_frgbaColor2 = m_frgbaOriginalColor2_TAndH;
+ }
+ else
+ {
+ encodingTry.m_frgbaColor1 = m_frgbaOriginalColor2_TAndH;
+ encodingTry.m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed1, (unsigned char)iGreen1, (unsigned char)iBlue1);
+ }
+
+ encodingTry.TryT_BestSelectorCombination();
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = encodingTry.m_mode;
+ m_boolDiff = encodingTry.m_boolDiff;
+ m_boolFlip = encodingTry.m_boolFlip;
+
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_uiCW1 = encodingTry.m_uiCW1;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = encodingTry.m_auiSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // find best selector combination for TryT
+ // called on an encodingTry
+ //
+ void Block4x4Encoding_RGB8::TryT_BestSelectorCombination(void)
+ {
+
+ float fDistance = s_afTHDistanceTable[m_uiCW1];
+
+ unsigned int auiBestPixelSelectors[PIXELS];
+ float afBestPixelErrors[PIXELS] = { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX,
+ FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX };
+ ColorFloatRGBA afrgbaBestDecodedPixels[PIXELS];
+ ColorFloatRGBA afrgbaDecodedPixel[SELECTORS];
+
+ assert(SELECTORS == 4);
+ afrgbaDecodedPixel[0] = m_frgbaColor1;
+ afrgbaDecodedPixel[1] = (m_frgbaColor2 + fDistance).ClampRGB();
+ afrgbaDecodedPixel[2] = m_frgbaColor2;
+ afrgbaDecodedPixel[3] = (m_frgbaColor2 - fDistance).ClampRGB();
+
+ // try each selector
+ for (unsigned int uiSelector = 0; uiSelector < SELECTORS; uiSelector++)
+ {
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+
+ float fPixelError = CalcPixelError(afrgbaDecodedPixel[uiSelector], m_afDecodedAlphas[uiPixel],
+ m_pafrgbaSource[uiPixel]);
+
+ if (fPixelError < afBestPixelErrors[uiPixel])
+ {
+ afBestPixelErrors[uiPixel] = fPixelError;
+ auiBestPixelSelectors[uiPixel] = uiSelector;
+ afrgbaBestDecodedPixels[uiPixel] = afrgbaDecodedPixel[uiSelector];
+ }
+ }
+ }
+
+
+ // add up all of the pixel errors
+ float fBlockError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ fBlockError += afBestPixelErrors[uiPixel];
+ }
+
+ if (fBlockError < m_fError)
+ {
+ m_fError = fBlockError;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = auiBestPixelSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = afrgbaBestDecodedPixels[uiPixel];
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try encoding in T mode
+ // save this encoding if it improves the error
+ //
+ // since all pixels use the distance table, color1 and color2 can NOT be twiddled independently
+ // TWIDDLE_RADIUS of 2 is WAY too slow
+ //
+ void Block4x4Encoding_RGB8::TryH(unsigned int a_uiRadius)
+ {
+ Block4x4Encoding_RGB8 encodingTry = *this;
+
+ // init "try"
+ {
+ encodingTry.m_mode = MODE_H;
+ encodingTry.m_boolDiff = true;
+ encodingTry.m_boolFlip = false;
+ encodingTry.m_fError = FLT_MAX;
+ }
+
+ int iColor1Red = m_frgbaOriginalColor1_TAndH.IntRed(15.0f);
+ int iColor1Green = m_frgbaOriginalColor1_TAndH.IntGreen(15.0f);
+ int iColor1Blue = m_frgbaOriginalColor1_TAndH.IntBlue(15.0f);
+
+ int iMinRed1 = iColor1Red - (int)a_uiRadius;
+ if (iMinRed1 < 0)
+ {
+ iMinRed1 = 0;
+ }
+ int iMaxRed1 = iColor1Red + (int)a_uiRadius;
+ if (iMaxRed1 > 15)
+ {
+ iMinRed1 = 15;
+ }
+
+ int iMinGreen1 = iColor1Green - (int)a_uiRadius;
+ if (iMinGreen1 < 0)
+ {
+ iMinGreen1 = 0;
+ }
+ int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
+ if (iMaxGreen1 > 15)
+ {
+ iMinGreen1 = 15;
+ }
+
+ int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
+ if (iMinBlue1 < 0)
+ {
+ iMinBlue1 = 0;
+ }
+ int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
+ if (iMaxBlue1 > 15)
+ {
+ iMinBlue1 = 15;
+ }
+
+ int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
+ int iColor2Green = m_frgbaOriginalColor2_TAndH.IntGreen(15.0f);
+ int iColor2Blue = m_frgbaOriginalColor2_TAndH.IntBlue(15.0f);
+
+ int iMinRed2 = iColor2Red - (int)a_uiRadius;
+ if (iMinRed2 < 0)
+ {
+ iMinRed2 = 0;
+ }
+ int iMaxRed2 = iColor2Red + (int)a_uiRadius;
+ if (iMaxRed2 > 15)
+ {
+ iMinRed2 = 15;
+ }
+
+ int iMinGreen2 = iColor2Green - (int)a_uiRadius;
+ if (iMinGreen2 < 0)
+ {
+ iMinGreen2 = 0;
+ }
+ int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
+ if (iMaxGreen2 > 15)
+ {
+ iMinGreen2 = 15;
+ }
+
+ int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
+ if (iMinBlue2 < 0)
+ {
+ iMinBlue2 = 0;
+ }
+ int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
+ if (iMaxBlue2 > 15)
+ {
+ iMinBlue2 = 15;
+ }
+
+ for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
+ {
+ encodingTry.m_uiCW1 = uiDistance;
+
+ // twiddle m_frgbaOriginalColor1_TAndH
+ for (int iRed1 = iMinRed1; iRed1 <= iMaxRed1; iRed1++)
+ {
+ for (int iGreen1 = iMinGreen1; iGreen1 <= iMaxGreen1; iGreen1++)
+ {
+ for (int iBlue1 = iMinBlue1; iBlue1 <= iMaxBlue1; iBlue1++)
+ {
+ encodingTry.m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed1, (unsigned char)iGreen1, (unsigned char)iBlue1);
+ encodingTry.m_frgbaColor2 = m_frgbaOriginalColor2_TAndH;
+
+ // if color1 == color2, H encoding issues can pop up, so abort
+ if (iRed1 == iColor2Red && iGreen1 == iColor2Green && iBlue1 == iColor2Blue)
+ {
+ continue;
+ }
+
+ encodingTry.TryH_BestSelectorCombination();
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = encodingTry.m_mode;
+ m_boolDiff = encodingTry.m_boolDiff;
+ m_boolFlip = encodingTry.m_boolFlip;
+
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_uiCW1 = encodingTry.m_uiCW1;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = encodingTry.m_auiSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+ }
+ }
+ }
+ }
+
+ // twiddle m_frgbaOriginalColor2_TAndH
+ for (int iRed2 = iMinRed2; iRed2 <= iMaxRed2; iRed2++)
+ {
+ for (int iGreen2 = iMinGreen2; iGreen2 <= iMaxGreen2; iGreen2++)
+ {
+ for (int iBlue2 = iMinBlue2; iBlue2 <= iMaxBlue2; iBlue2++)
+ {
+ encodingTry.m_frgbaColor1 = m_frgbaOriginalColor1_TAndH;
+ encodingTry.m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed2, (unsigned char)iGreen2, (unsigned char)iBlue2);
+
+ // if color1 == color2, H encoding issues can pop up, so abort
+ if (iRed2 == iColor1Red && iGreen2 == iColor1Green && iBlue2 == iColor1Blue)
+ {
+ continue;
+ }
+
+ encodingTry.TryH_BestSelectorCombination();
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = encodingTry.m_mode;
+ m_boolDiff = encodingTry.m_boolDiff;
+ m_boolFlip = encodingTry.m_boolFlip;
+
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_uiCW1 = encodingTry.m_uiCW1;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = encodingTry.m_auiSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // find best selector combination for TryH
+ // called on an encodingTry
+ //
+ void Block4x4Encoding_RGB8::TryH_BestSelectorCombination(void)
+ {
+
+ float fDistance = s_afTHDistanceTable[m_uiCW1];
+
+ unsigned int auiBestPixelSelectors[PIXELS];
+ float afBestPixelErrors[PIXELS] = { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX,
+ FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX };
+ ColorFloatRGBA afrgbaBestDecodedPixels[PIXELS];
+ ColorFloatRGBA afrgbaDecodedPixel[SELECTORS];
+
+ assert(SELECTORS == 4);
+ afrgbaDecodedPixel[0] = (m_frgbaColor1 + fDistance).ClampRGB();
+ afrgbaDecodedPixel[1] = (m_frgbaColor1 - fDistance).ClampRGB();
+ afrgbaDecodedPixel[2] = (m_frgbaColor2 + fDistance).ClampRGB();
+ afrgbaDecodedPixel[3] = (m_frgbaColor2 - fDistance).ClampRGB();
+
+ // try each selector
+ for (unsigned int uiSelector = 0; uiSelector < SELECTORS; uiSelector++)
+ {
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+
+ float fPixelError = CalcPixelError(afrgbaDecodedPixel[uiSelector], m_afDecodedAlphas[uiPixel],
+ m_pafrgbaSource[uiPixel]);
+
+ if (fPixelError < afBestPixelErrors[uiPixel])
+ {
+ afBestPixelErrors[uiPixel] = fPixelError;
+ auiBestPixelSelectors[uiPixel] = uiSelector;
+ afrgbaBestDecodedPixels[uiPixel] = afrgbaDecodedPixel[uiSelector];
+ }
+ }
+ }
+
+
+ // add up all of the pixel errors
+ float fBlockError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ fBlockError += afBestPixelErrors[uiPixel];
+ }
+
+ if (fBlockError < m_fError)
+ {
+ m_fError = fBlockError;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = auiBestPixelSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = afrgbaBestDecodedPixels[uiPixel];
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // use linear regression to find the best fit for colors along the edges of the 4x4 block
+ //
+ void Block4x4Encoding_RGB8::CalculatePlanarCornerColors(void)
+ {
+ ColorFloatRGBA afrgbaRegression[MAX_PLANAR_REGRESSION_SIZE];
+ ColorFloatRGBA frgbaSlope;
+ ColorFloatRGBA frgbaOffset;
+
+ // top edge
+ afrgbaRegression[0] = m_pafrgbaSource[0];
+ afrgbaRegression[1] = m_pafrgbaSource[4];
+ afrgbaRegression[2] = m_pafrgbaSource[8];
+ afrgbaRegression[3] = m_pafrgbaSource[12];
+ ColorRegression(afrgbaRegression, 4, &frgbaSlope, &frgbaOffset);
+ m_frgbaColor1 = frgbaOffset;
+ m_frgbaColor2 = (frgbaSlope * 4.0f) + frgbaOffset;
+
+ // left edge
+ afrgbaRegression[0] = m_pafrgbaSource[0];
+ afrgbaRegression[1] = m_pafrgbaSource[1];
+ afrgbaRegression[2] = m_pafrgbaSource[2];
+ afrgbaRegression[3] = m_pafrgbaSource[3];
+ ColorRegression(afrgbaRegression, 4, &frgbaSlope, &frgbaOffset);
+ m_frgbaColor1 = (m_frgbaColor1 + frgbaOffset) * 0.5f; // average with top edge
+ m_frgbaColor3 = (frgbaSlope * 4.0f) + frgbaOffset;
+
+ // right edge
+ afrgbaRegression[0] = m_pafrgbaSource[12];
+ afrgbaRegression[1] = m_pafrgbaSource[13];
+ afrgbaRegression[2] = m_pafrgbaSource[14];
+ afrgbaRegression[3] = m_pafrgbaSource[15];
+ ColorRegression(afrgbaRegression, 4, &frgbaSlope, &frgbaOffset);
+ m_frgbaColor2 = (m_frgbaColor2 + frgbaOffset) * 0.5f; // average with top edge
+
+ // bottom edge
+ afrgbaRegression[0] = m_pafrgbaSource[3];
+ afrgbaRegression[1] = m_pafrgbaSource[7];
+ afrgbaRegression[2] = m_pafrgbaSource[11];
+ afrgbaRegression[3] = m_pafrgbaSource[15];
+ ColorRegression(afrgbaRegression, 4, &frgbaSlope, &frgbaOffset);
+ m_frgbaColor3 = (m_frgbaColor3 + frgbaOffset) * 0.5f; // average with left edge
+
+ // quantize corner colors to 6/7/6
+ m_frgbaColor1 = m_frgbaColor1.QuantizeR6G7B6();
+ m_frgbaColor2 = m_frgbaColor2.QuantizeR6G7B6();
+ m_frgbaColor3 = m_frgbaColor3.QuantizeR6G7B6();
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try different corner colors by slightly changing R, G and B independently
+ //
+ // R, G and B decoding and errors are independent, so R, G and B twiddles can be independent
+ //
+ // return true if improvement
+ //
+ bool Block4x4Encoding_RGB8::TwiddlePlanar(void)
+ {
+ bool boolImprovement = false;
+
+ while (TwiddlePlanarR())
+ {
+ boolImprovement = true;
+ }
+
+ while (TwiddlePlanarG())
+ {
+ boolImprovement = true;
+ }
+
+ while (TwiddlePlanarB())
+ {
+ boolImprovement = true;
+ }
+
+ return boolImprovement;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try different corner colors by slightly changing R
+ //
+ bool Block4x4Encoding_RGB8::TwiddlePlanarR()
+ {
+ bool boolImprovement = false;
+
+ Block4x4Encoding_RGB8 encodingTry = *this;
+
+ // init "try"
+ {
+ encodingTry.m_mode = MODE_PLANAR;
+ encodingTry.m_boolDiff = true;
+ encodingTry.m_boolFlip = false;
+ }
+
+ int iOriginRed = encodingTry.m_frgbaColor1.IntRed(63.0f);
+ int iHorizRed = encodingTry.m_frgbaColor2.IntRed(63.0f);
+ int iVertRed = encodingTry.m_frgbaColor3.IntRed(63.0f);
+
+ for (int iTryOriginRed = iOriginRed - 1; iTryOriginRed <= iOriginRed + 1; iTryOriginRed++)
+ {
+ // check for out of range
+ if (iTryOriginRed < 0 || iTryOriginRed > 63)
+ {
+ continue;
+ }
+
+ encodingTry.m_frgbaColor1.fR = ((iTryOriginRed << 2) + (iTryOriginRed >> 4)) / 255.0f;
+
+ for (int iTryHorizRed = iHorizRed - 1; iTryHorizRed <= iHorizRed + 1; iTryHorizRed++)
+ {
+ // check for out of range
+ if (iTryHorizRed < 0 || iTryHorizRed > 63)
+ {
+ continue;
+ }
+
+ encodingTry.m_frgbaColor2.fR = ((iTryHorizRed << 2) + (iTryHorizRed >> 4)) / 255.0f;
+
+ for (int iTryVertRed = iVertRed - 1; iTryVertRed <= iVertRed + 1; iTryVertRed++)
+ {
+ // check for out of range
+ if (iTryVertRed < 0 || iTryVertRed > 63)
+ {
+ continue;
+ }
+
+ // don't bother with null twiddle
+ if (iTryOriginRed == iOriginRed && iTryHorizRed == iHorizRed && iTryVertRed == iVertRed)
+ {
+ continue;
+ }
+
+ encodingTry.m_frgbaColor3.fR = ((iTryVertRed << 2) + (iTryVertRed >> 4)) / 255.0f;
+
+ encodingTry.DecodePixels_Planar();
+
+ encodingTry.CalcBlockError();
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = MODE_PLANAR;
+ m_boolDiff = true;
+ m_boolFlip = false;
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_frgbaColor3 = encodingTry.m_frgbaColor3;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+
+ boolImprovement = true;
+ }
+ }
+ }
+ }
+
+ return boolImprovement;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try different corner colors by slightly changing G
+ //
+ bool Block4x4Encoding_RGB8::TwiddlePlanarG()
+ {
+ bool boolImprovement = false;
+
+ Block4x4Encoding_RGB8 encodingTry = *this;
+
+ // init "try"
+ {
+ encodingTry.m_mode = MODE_PLANAR;
+ encodingTry.m_boolDiff = true;
+ encodingTry.m_boolFlip = false;
+ }
+
+ int iOriginGreen = encodingTry.m_frgbaColor1.IntGreen(127.0f);
+ int iHorizGreen = encodingTry.m_frgbaColor2.IntGreen(127.0f);
+ int iVertGreen = encodingTry.m_frgbaColor3.IntGreen(127.0f);
+
+ for (int iTryOriginGreen = iOriginGreen - 1; iTryOriginGreen <= iOriginGreen + 1; iTryOriginGreen++)
+ {
+ // check for out of range
+ if (iTryOriginGreen < 0 || iTryOriginGreen > 127)
+ {
+ continue;
+ }
+
+ encodingTry.m_frgbaColor1.fG = ((iTryOriginGreen << 1) + (iTryOriginGreen >> 6)) / 255.0f;
+
+ for (int iTryHorizGreen = iHorizGreen - 1; iTryHorizGreen <= iHorizGreen + 1; iTryHorizGreen++)
+ {
+ // check for out of range
+ if (iTryHorizGreen < 0 || iTryHorizGreen > 127)
+ {
+ continue;
+ }
+
+ encodingTry.m_frgbaColor2.fG = ((iTryHorizGreen << 1) + (iTryHorizGreen >> 6)) / 255.0f;
+
+ for (int iTryVertGreen = iVertGreen - 1; iTryVertGreen <= iVertGreen + 1; iTryVertGreen++)
+ {
+ // check for out of range
+ if (iTryVertGreen < 0 || iTryVertGreen > 127)
+ {
+ continue;
+ }
+
+ // don't bother with null twiddle
+ if (iTryOriginGreen == iOriginGreen &&
+ iTryHorizGreen == iHorizGreen &&
+ iTryVertGreen == iVertGreen)
+ {
+ continue;
+ }
+
+ encodingTry.m_frgbaColor3.fG = ((iTryVertGreen << 1) + (iTryVertGreen >> 6)) / 255.0f;
+
+ encodingTry.DecodePixels_Planar();
+
+ encodingTry.CalcBlockError();
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = MODE_PLANAR;
+ m_boolDiff = true;
+ m_boolFlip = false;
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_frgbaColor3 = encodingTry.m_frgbaColor3;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+
+ boolImprovement = true;
+ }
+ }
+ }
+ }
+
+ return boolImprovement;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try different corner colors by slightly changing B
+ //
+ bool Block4x4Encoding_RGB8::TwiddlePlanarB()
+ {
+ bool boolImprovement = false;
+
+ Block4x4Encoding_RGB8 encodingTry = *this;
+
+ // init "try"
+ {
+ encodingTry.m_mode = MODE_PLANAR;
+ encodingTry.m_boolDiff = true;
+ encodingTry.m_boolFlip = false;
+ }
+
+ int iOriginBlue = encodingTry.m_frgbaColor1.IntBlue(63.0f);
+ int iHorizBlue = encodingTry.m_frgbaColor2.IntBlue(63.0f);
+ int iVertBlue = encodingTry.m_frgbaColor3.IntBlue(63.0f);
+
+ for (int iTryOriginBlue = iOriginBlue - 1; iTryOriginBlue <= iOriginBlue + 1; iTryOriginBlue++)
+ {
+ // check for out of range
+ if (iTryOriginBlue < 0 || iTryOriginBlue > 63)
+ {
+ continue;
+ }
+
+ encodingTry.m_frgbaColor1.fB = ((iTryOriginBlue << 2) + (iTryOriginBlue >> 4)) / 255.0f;
+
+ for (int iTryHorizBlue = iHorizBlue - 1; iTryHorizBlue <= iHorizBlue + 1; iTryHorizBlue++)
+ {
+ // check for out of range
+ if (iTryHorizBlue < 0 || iTryHorizBlue > 63)
+ {
+ continue;
+ }
+
+ encodingTry.m_frgbaColor2.fB = ((iTryHorizBlue << 2) + (iTryHorizBlue >> 4)) / 255.0f;
+
+ for (int iTryVertBlue = iVertBlue - 1; iTryVertBlue <= iVertBlue + 1; iTryVertBlue++)
+ {
+ // check for out of range
+ if (iTryVertBlue < 0 || iTryVertBlue > 63)
+ {
+ continue;
+ }
+
+ // don't bother with null twiddle
+ if (iTryOriginBlue == iOriginBlue && iTryHorizBlue == iHorizBlue && iTryVertBlue == iVertBlue)
+ {
+ continue;
+ }
+
+ encodingTry.m_frgbaColor3.fB = ((iTryVertBlue << 2) + (iTryVertBlue >> 4)) / 255.0f;
+
+ encodingTry.DecodePixels_Planar();
+
+ encodingTry.CalcBlockError();
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = MODE_PLANAR;
+ m_boolDiff = true;
+ m_boolFlip = false;
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_frgbaColor3 = encodingTry.m_frgbaColor3;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+
+ boolImprovement = true;
+ }
+ }
+ }
+ }
+
+ return boolImprovement;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state
+ //
+ void Block4x4Encoding_RGB8::SetEncodingBits(void)
+ {
+
+ switch (m_mode)
+ {
+ case MODE_ETC1:
+ Block4x4Encoding_ETC1::SetEncodingBits();
+ break;
+
+ case MODE_T:
+ SetEncodingBits_T();
+ break;
+
+ case MODE_H:
+ SetEncodingBits_H();
+ break;
+
+ case MODE_PLANAR:
+ SetEncodingBits_Planar();
+ break;
+
+ default:
+ assert(false);
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state for T mode
+ //
+ void Block4x4Encoding_RGB8::SetEncodingBits_T(void)
+ {
+ static const bool SANITY_CHECK = true;
+
+ assert(m_mode == MODE_T);
+ assert(m_boolDiff == true);
+
+ unsigned int uiRed1 = (unsigned int)m_frgbaColor1.IntRed(15.0f);
+ unsigned int uiGreen1 = (unsigned int)m_frgbaColor1.IntGreen(15.0f);
+ unsigned int uiBlue1 = (unsigned int)m_frgbaColor1.IntBlue(15.0f);
+
+ unsigned int uiRed2 = (unsigned int)m_frgbaColor2.IntRed(15.0f);
+ unsigned int uiGreen2 = (unsigned int)m_frgbaColor2.IntGreen(15.0f);
+ unsigned int uiBlue2 = (unsigned int)m_frgbaColor2.IntBlue(15.0f);
+
+ m_pencodingbitsRGB8->t.red1a = uiRed1 >> 2;
+ m_pencodingbitsRGB8->t.red1b = uiRed1;
+ m_pencodingbitsRGB8->t.green1 = uiGreen1;
+ m_pencodingbitsRGB8->t.blue1 = uiBlue1;
+
+ m_pencodingbitsRGB8->t.red2 = uiRed2;
+ m_pencodingbitsRGB8->t.green2 = uiGreen2;
+ m_pencodingbitsRGB8->t.blue2 = uiBlue2;
+
+ m_pencodingbitsRGB8->t.da = m_uiCW1 >> 1;
+ m_pencodingbitsRGB8->t.db = m_uiCW1;
+
+ m_pencodingbitsRGB8->t.diff = 1;
+
+ Block4x4Encoding_ETC1::SetEncodingBits_Selectors();
+
+ // create an invalid R differential to trigger T mode
+ m_pencodingbitsRGB8->t.detect1 = 0;
+ m_pencodingbitsRGB8->t.detect2 = 0;
+ int iRed2 = (int)m_pencodingbitsRGB8->differential.red1 + (int)m_pencodingbitsRGB8->differential.dred2;
+ if (iRed2 >= 4)
+ {
+ m_pencodingbitsRGB8->t.detect1 = 7;
+ m_pencodingbitsRGB8->t.detect2 = 0;
+ }
+ else
+ {
+ m_pencodingbitsRGB8->t.detect1 = 0;
+ m_pencodingbitsRGB8->t.detect2 = 1;
+ }
+
+ if (SANITY_CHECK)
+ {
+ iRed2 = (int)m_pencodingbitsRGB8->differential.red1 + (int)m_pencodingbitsRGB8->differential.dred2;
+
+ // make sure red overflows
+ assert(iRed2 < 0 || iRed2 > 31);
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state for H mode
+ //
+ // colors and selectors may need to swap in order to generate lsb of distance index
+ //
+ void Block4x4Encoding_RGB8::SetEncodingBits_H(void)
+ {
+ static const bool SANITY_CHECK = true;
+
+ assert(m_mode == MODE_H);
+ assert(m_boolDiff == true);
+
+ unsigned int uiRed1 = (unsigned int)m_frgbaColor1.IntRed(15.0f);
+ unsigned int uiGreen1 = (unsigned int)m_frgbaColor1.IntGreen(15.0f);
+ unsigned int uiBlue1 = (unsigned int)m_frgbaColor1.IntBlue(15.0f);
+
+ unsigned int uiRed2 = (unsigned int)m_frgbaColor2.IntRed(15.0f);
+ unsigned int uiGreen2 = (unsigned int)m_frgbaColor2.IntGreen(15.0f);
+ unsigned int uiBlue2 = (unsigned int)m_frgbaColor2.IntBlue(15.0f);
+
+ unsigned int uiColor1 = (uiRed1 << 16) + (uiGreen1 << 8) + uiBlue1;
+ unsigned int uiColor2 = (uiRed2 << 16) + (uiGreen2 << 8) + uiBlue2;
+
+ bool boolOddDistance = m_uiCW1 & 1;
+ bool boolSwapColors = (uiColor1 < uiColor2) ^ !boolOddDistance;
+
+ if (boolSwapColors)
+ {
+ m_pencodingbitsRGB8->h.red1 = uiRed2;
+ m_pencodingbitsRGB8->h.green1a = uiGreen2 >> 1;
+ m_pencodingbitsRGB8->h.green1b = uiGreen2;
+ m_pencodingbitsRGB8->h.blue1a = uiBlue2 >> 3;
+ m_pencodingbitsRGB8->h.blue1b = uiBlue2 >> 1;
+ m_pencodingbitsRGB8->h.blue1c = uiBlue2;
+
+ m_pencodingbitsRGB8->h.red2 = uiRed1;
+ m_pencodingbitsRGB8->h.green2a = uiGreen1 >> 1;
+ m_pencodingbitsRGB8->h.green2b = uiGreen1;
+ m_pencodingbitsRGB8->h.blue2 = uiBlue1;
+
+ m_pencodingbitsRGB8->h.da = m_uiCW1 >> 2;
+ m_pencodingbitsRGB8->h.db = m_uiCW1 >> 1;
+ }
+ else
+ {
+ m_pencodingbitsRGB8->h.red1 = uiRed1;
+ m_pencodingbitsRGB8->h.green1a = uiGreen1 >> 1;
+ m_pencodingbitsRGB8->h.green1b = uiGreen1;
+ m_pencodingbitsRGB8->h.blue1a = uiBlue1 >> 3;
+ m_pencodingbitsRGB8->h.blue1b = uiBlue1 >> 1;
+ m_pencodingbitsRGB8->h.blue1c = uiBlue1;
+
+ m_pencodingbitsRGB8->h.red2 = uiRed2;
+ m_pencodingbitsRGB8->h.green2a = uiGreen2 >> 1;
+ m_pencodingbitsRGB8->h.green2b = uiGreen2;
+ m_pencodingbitsRGB8->h.blue2 = uiBlue2;
+
+ m_pencodingbitsRGB8->h.da = m_uiCW1 >> 2;
+ m_pencodingbitsRGB8->h.db = m_uiCW1 >> 1;
+ }
+
+ m_pencodingbitsRGB8->h.diff = 1;
+
+ Block4x4Encoding_ETC1::SetEncodingBits_Selectors();
+
+ if (boolSwapColors)
+ {
+ m_pencodingbitsRGB8->h.selectors ^= 0x0000FFFF;
+ }
+
+ // create an invalid R differential to trigger T mode
+ m_pencodingbitsRGB8->h.detect1 = 0;
+ m_pencodingbitsRGB8->h.detect2 = 0;
+ m_pencodingbitsRGB8->h.detect3 = 0;
+ int iRed2 = (int)m_pencodingbitsRGB8->differential.red1 + (int)m_pencodingbitsRGB8->differential.dred2;
+ int iGreen2 = (int)m_pencodingbitsRGB8->differential.green1 + (int)m_pencodingbitsRGB8->differential.dgreen2;
+ if (iRed2 < 0 || iRed2 > 31)
+ {
+ m_pencodingbitsRGB8->h.detect1 = 1;
+ }
+ if (iGreen2 >= 4)
+ {
+ m_pencodingbitsRGB8->h.detect2 = 7;
+ m_pencodingbitsRGB8->h.detect3 = 0;
+ }
+ else
+ {
+ m_pencodingbitsRGB8->h.detect2 = 0;
+ m_pencodingbitsRGB8->h.detect3 = 1;
+ }
+
+ if (SANITY_CHECK)
+ {
+ iRed2 = (int)m_pencodingbitsRGB8->differential.red1 + (int)m_pencodingbitsRGB8->differential.dred2;
+ iGreen2 = (int)m_pencodingbitsRGB8->differential.green1 + (int)m_pencodingbitsRGB8->differential.dgreen2;
+
+ // make sure red doesn't overflow and green does
+ assert(iRed2 >= 0 && iRed2 <= 31);
+ assert(iGreen2 < 0 || iGreen2 > 31);
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state for Planar mode
+ //
+ void Block4x4Encoding_RGB8::SetEncodingBits_Planar(void)
+ {
+ static const bool SANITY_CHECK = true;
+
+ assert(m_mode == MODE_PLANAR);
+ assert(m_boolDiff == true);
+
+ unsigned int uiOriginRed = (unsigned int)m_frgbaColor1.IntRed(63.0f);
+ unsigned int uiOriginGreen = (unsigned int)m_frgbaColor1.IntGreen(127.0f);
+ unsigned int uiOriginBlue = (unsigned int)m_frgbaColor1.IntBlue(63.0f);
+
+ unsigned int uiHorizRed = (unsigned int)m_frgbaColor2.IntRed(63.0f);
+ unsigned int uiHorizGreen = (unsigned int)m_frgbaColor2.IntGreen(127.0f);
+ unsigned int uiHorizBlue = (unsigned int)m_frgbaColor2.IntBlue(63.0f);
+
+ unsigned int uiVertRed = (unsigned int)m_frgbaColor3.IntRed(63.0f);
+ unsigned int uiVertGreen = (unsigned int)m_frgbaColor3.IntGreen(127.0f);
+ unsigned int uiVertBlue = (unsigned int)m_frgbaColor3.IntBlue(63.0f);
+
+ m_pencodingbitsRGB8->planar.originRed = uiOriginRed;
+ m_pencodingbitsRGB8->planar.originGreen1 = uiOriginGreen >> 6;
+ m_pencodingbitsRGB8->planar.originGreen2 = uiOriginGreen;
+ m_pencodingbitsRGB8->planar.originBlue1 = uiOriginBlue >> 5;
+ m_pencodingbitsRGB8->planar.originBlue2 = uiOriginBlue >> 3;
+ m_pencodingbitsRGB8->planar.originBlue3 = uiOriginBlue >> 1;
+ m_pencodingbitsRGB8->planar.originBlue4 = uiOriginBlue;
+
+ m_pencodingbitsRGB8->planar.horizRed1 = uiHorizRed >> 1;
+ m_pencodingbitsRGB8->planar.horizRed2 = uiHorizRed;
+ m_pencodingbitsRGB8->planar.horizGreen = uiHorizGreen;
+ m_pencodingbitsRGB8->planar.horizBlue1 = uiHorizBlue >> 5;
+ m_pencodingbitsRGB8->planar.horizBlue2 = uiHorizBlue;
+
+ m_pencodingbitsRGB8->planar.vertRed1 = uiVertRed >> 3;
+ m_pencodingbitsRGB8->planar.vertRed2 = uiVertRed;
+ m_pencodingbitsRGB8->planar.vertGreen1 = uiVertGreen >> 2;
+ m_pencodingbitsRGB8->planar.vertGreen2 = uiVertGreen;
+ m_pencodingbitsRGB8->planar.vertBlue = uiVertBlue;
+
+ m_pencodingbitsRGB8->planar.diff = 1;
+
+ // create valid RG differentials and an invalid B differential to trigger planar mode
+ m_pencodingbitsRGB8->planar.detect1 = 0;
+ m_pencodingbitsRGB8->planar.detect2 = 0;
+ m_pencodingbitsRGB8->planar.detect3 = 0;
+ m_pencodingbitsRGB8->planar.detect4 = 0;
+ int iRed2 = (int)m_pencodingbitsRGB8->differential.red1 + (int)m_pencodingbitsRGB8->differential.dred2;
+ int iGreen2 = (int)m_pencodingbitsRGB8->differential.green1 + (int)m_pencodingbitsRGB8->differential.dgreen2;
+ int iBlue2 = (int)m_pencodingbitsRGB8->differential.blue1 + (int)m_pencodingbitsRGB8->differential.dblue2;
+ if (iRed2 < 0 || iRed2 > 31)
+ {
+ m_pencodingbitsRGB8->planar.detect1 = 1;
+ }
+ if (iGreen2 < 0 || iGreen2 > 31)
+ {
+ m_pencodingbitsRGB8->planar.detect2 = 1;
+ }
+ if (iBlue2 >= 4)
+ {
+ m_pencodingbitsRGB8->planar.detect3 = 7;
+ m_pencodingbitsRGB8->planar.detect4 = 0;
+ }
+ else
+ {
+ m_pencodingbitsRGB8->planar.detect3 = 0;
+ m_pencodingbitsRGB8->planar.detect4 = 1;
+ }
+
+ if (SANITY_CHECK)
+ {
+ iRed2 = (int)m_pencodingbitsRGB8->differential.red1 + (int)m_pencodingbitsRGB8->differential.dred2;
+ iGreen2 = (int)m_pencodingbitsRGB8->differential.green1 + (int)m_pencodingbitsRGB8->differential.dgreen2;
+ iBlue2 = (int)m_pencodingbitsRGB8->differential.blue1 + (int)m_pencodingbitsRGB8->differential.dblue2;
+
+ // make sure red and green don't overflow and blue does
+ assert(iRed2 >= 0 && iRed2 <= 31);
+ assert(iGreen2 >= 0 && iGreen2 <= 31);
+ assert(iBlue2 < 0 || iBlue2 > 31);
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the decoded colors and decoded alpha based on the encoding state for T mode
+ //
+ void Block4x4Encoding_RGB8::DecodePixels_T(void)
+ {
+
+ float fDistance = s_afTHDistanceTable[m_uiCW1];
+ ColorFloatRGBA frgbaDistance(fDistance, fDistance, fDistance, 0.0f);
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ switch (m_auiSelectors[uiPixel])
+ {
+ case 0:
+ m_afrgbaDecodedColors[uiPixel] = m_frgbaColor1;
+ break;
+
+ case 1:
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor2 + frgbaDistance).ClampRGB();
+ break;
+
+ case 2:
+ m_afrgbaDecodedColors[uiPixel] = m_frgbaColor2;
+ break;
+
+ case 3:
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor2 - frgbaDistance).ClampRGB();
+ break;
+ }
+
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the decoded colors and decoded alpha based on the encoding state for H mode
+ //
+ void Block4x4Encoding_RGB8::DecodePixels_H(void)
+ {
+
+ float fDistance = s_afTHDistanceTable[m_uiCW1];
+ ColorFloatRGBA frgbaDistance(fDistance, fDistance, fDistance, 0.0f);
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ switch (m_auiSelectors[uiPixel])
+ {
+ case 0:
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor1 + frgbaDistance).ClampRGB();
+ break;
+
+ case 1:
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor1 - frgbaDistance).ClampRGB();
+ break;
+
+ case 2:
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor2 + frgbaDistance).ClampRGB();
+ break;
+
+ case 3:
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor2 - frgbaDistance).ClampRGB();
+ break;
+ }
+
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the decoded colors and decoded alpha based on the encoding state for Planar mode
+ //
+ void Block4x4Encoding_RGB8::DecodePixels_Planar(void)
+ {
+
+ int iRO = (int)roundf(m_frgbaColor1.fR * 255.0f);
+ int iGO = (int)roundf(m_frgbaColor1.fG * 255.0f);
+ int iBO = (int)roundf(m_frgbaColor1.fB * 255.0f);
+
+ int iRH = (int)roundf(m_frgbaColor2.fR * 255.0f);
+ int iGH = (int)roundf(m_frgbaColor2.fG * 255.0f);
+ int iBH = (int)roundf(m_frgbaColor2.fB * 255.0f);
+
+ int iRV = (int)roundf(m_frgbaColor3.fR * 255.0f);
+ int iGV = (int)roundf(m_frgbaColor3.fG * 255.0f);
+ int iBV = (int)roundf(m_frgbaColor3.fB * 255.0f);
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ int iX = (int)(uiPixel >> 2);
+ int iY = (int)(uiPixel & 3);
+
+ int iR = (iX*(iRH - iRO) + iY*(iRV - iRO) + 4*iRO + 2) >> 2;
+ int iG = (iX*(iGH - iGO) + iY*(iGV - iGO) + 4*iGO + 2) >> 2;
+ int iB = (iX*(iBH - iBO) + iY*(iBV - iBO) + 4*iBO + 2) >> 2;
+
+ ColorFloatRGBA frgba;
+ frgba.fR = (float)iR / 255.0f;
+ frgba.fG = (float)iG / 255.0f;
+ frgba.fB = (float)iB / 255.0f;
+ frgba.fA = 1.0f;
+
+ m_afrgbaDecodedColors[uiPixel] = frgba.ClampRGB();
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // perform a linear regression for the a_uiPixels in a_pafrgbaPixels[]
+ //
+ // output the closest color line using a_pfrgbaSlope and a_pfrgbaOffset
+ //
+ void Block4x4Encoding_RGB8::ColorRegression(ColorFloatRGBA *a_pafrgbaPixels, unsigned int a_uiPixels,
+ ColorFloatRGBA *a_pfrgbaSlope, ColorFloatRGBA *a_pfrgbaOffset)
+ {
+ typedef struct
+ {
+ float f[4];
+ } Float4;
+
+ Float4 *paf4Pixels = (Float4 *)(a_pafrgbaPixels);
+ Float4 *pf4Slope = (Float4 *)(a_pfrgbaSlope);
+ Float4 *pf4Offset = (Float4 *)(a_pfrgbaOffset);
+
+ float afX[MAX_PLANAR_REGRESSION_SIZE];
+ float afY[MAX_PLANAR_REGRESSION_SIZE];
+
+ // handle r, g and b separately. don't bother with a
+ for (unsigned int uiComponent = 0; uiComponent < 3; uiComponent++)
+ {
+ for (unsigned int uiPixel = 0; uiPixel < a_uiPixels; uiPixel++)
+ {
+ afX[uiPixel] = (float)uiPixel;
+ afY[uiPixel] = paf4Pixels[uiPixel].f[uiComponent];
+
+ }
+ Etc::Regression(afX, afY, a_uiPixels,
+ &(pf4Slope->f[uiComponent]), &(pf4Offset->f[uiComponent]));
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+}
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.h b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.h
new file mode 100644
index 0000000000..03754d5e3b
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcBlock4x4Encoding_ETC1.h"
+
+namespace Etc
+{
+
+ class Block4x4Encoding_RGB8 : public Block4x4Encoding_ETC1
+ {
+ public:
+
+ Block4x4Encoding_RGB8(void);
+ virtual ~Block4x4Encoding_RGB8(void);
+
+ virtual void InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+
+ ErrorMetric a_errormetric);
+
+ virtual void PerformIteration(float a_fEffort);
+
+ virtual void SetEncodingBits(void);
+
+ inline ColorFloatRGBA GetColor3(void) const
+ {
+ return m_frgbaColor3;
+ }
+
+ protected:
+
+ static const unsigned int PLANAR_CORNER_COLORS = 3;
+ static const unsigned int MAX_PLANAR_REGRESSION_SIZE = 4;
+ static const unsigned int TH_DISTANCES = 8;
+
+ static float s_afTHDistanceTable[TH_DISTANCES];
+
+ void TryPlanar(unsigned int a_uiRadius);
+ void TryTAndH(unsigned int a_uiRadius);
+
+ void InitFromEncodingBits_Planar(void);
+
+ ColorFloatRGBA m_frgbaColor3; // used for planar
+
+ void SetEncodingBits_T(void);
+ void SetEncodingBits_H(void);
+ void SetEncodingBits_Planar(void);
+
+ // state shared between iterations
+ ColorFloatRGBA m_frgbaOriginalColor1_TAndH;
+ ColorFloatRGBA m_frgbaOriginalColor2_TAndH;
+
+ void CalculateBaseColorsForTAndH(void);
+ void TryT(unsigned int a_uiRadius);
+ void TryT_BestSelectorCombination(void);
+ void TryH(unsigned int a_uiRadius);
+ void TryH_BestSelectorCombination(void);
+
+ private:
+
+ void InitFromEncodingBits_T(void);
+ void InitFromEncodingBits_H(void);
+
+ void CalculatePlanarCornerColors(void);
+
+ void ColorRegression(ColorFloatRGBA *a_pafrgbaPixels, unsigned int a_uiPixels,
+ ColorFloatRGBA *a_pfrgbaSlope, ColorFloatRGBA *a_pfrgbaOffset);
+
+ bool TwiddlePlanar(void);
+ bool TwiddlePlanarR();
+ bool TwiddlePlanarG();
+ bool TwiddlePlanarB();
+
+ void DecodePixels_T(void);
+ void DecodePixels_H(void);
+ void DecodePixels_Planar(void);
+
+ };
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp
new file mode 100644
index 0000000000..ba2b42fb05
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp
@@ -0,0 +1,1819 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcBlock4x4Encoding_RGB8A1.cpp contains:
+ Block4x4Encoding_RGB8A1
+ Block4x4Encoding_RGB8A1_Opaque
+ Block4x4Encoding_RGB8A1_Transparent
+
+These encoders are used when targetting file format RGB8A1.
+
+Block4x4Encoding_RGB8A1_Opaque is used when all pixels in the 4x4 block are opaque
+Block4x4Encoding_RGB8A1_Transparent is used when all pixels in the 4x4 block are transparent
+Block4x4Encoding_RGB8A1 is used when there is a mixture of alphas in the 4x4 block
+
+*/
+
+#include "EtcConfig.h"
+#include "EtcBlock4x4Encoding_RGB8A1.h"
+
+#include "EtcBlock4x4.h"
+#include "EtcBlock4x4EncodingBits.h"
+#include "EtcBlock4x4Encoding_RGB8.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+namespace Etc
+{
+
+ // ####################################################################################################
+ // Block4x4Encoding_RGB8A1
+ // ####################################################################################################
+
+ float Block4x4Encoding_RGB8A1::s_aafCwOpaqueUnsetTable[CW_RANGES][SELECTORS] =
+ {
+ { 0.0f / 255.0f, 8.0f / 255.0f, 0.0f / 255.0f, -8.0f / 255.0f },
+ { 0.0f / 255.0f, 17.0f / 255.0f, 0.0f / 255.0f, -17.0f / 255.0f },
+ { 0.0f / 255.0f, 29.0f / 255.0f, 0.0f / 255.0f, -29.0f / 255.0f },
+ { 0.0f / 255.0f, 42.0f / 255.0f, 0.0f / 255.0f, -42.0f / 255.0f },
+ { 0.0f / 255.0f, 60.0f / 255.0f, 0.0f / 255.0f, -60.0f / 255.0f },
+ { 0.0f / 255.0f, 80.0f / 255.0f, 0.0f / 255.0f, -80.0f / 255.0f },
+ { 0.0f / 255.0f, 106.0f / 255.0f, 0.0f / 255.0f, -106.0f / 255.0f },
+ { 0.0f / 255.0f, 183.0f / 255.0f, 0.0f / 255.0f, -183.0f / 255.0f }
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ Block4x4Encoding_RGB8A1::Block4x4Encoding_RGB8A1(void)
+ {
+ m_pencodingbitsRGB8 = nullptr;
+ m_boolOpaque = false;
+ m_boolTransparent = false;
+ m_boolPunchThroughPixels = true;
+
+ }
+ Block4x4Encoding_RGB8A1::~Block4x4Encoding_RGB8A1(void) {}
+ // ----------------------------------------------------------------------------------------------------
+ // initialization prior to encoding
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // a_pafrgbaSource points to a 4x4 block subset of the source image
+ // a_paucEncodingBits points to the final encoding bits
+ //
+ void Block4x4Encoding_RGB8A1::InitFromSource(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+ unsigned char *a_paucEncodingBits,
+ ErrorMetric a_errormetric)
+ {
+
+ Block4x4Encoding_RGB8::InitFromSource(a_pblockParent,
+ a_pafrgbaSource,
+ a_paucEncodingBits,
+ a_errormetric);
+
+ m_boolOpaque = a_pblockParent->GetSourceAlphaMix() == Block4x4::SourceAlphaMix::OPAQUE;
+ m_boolTransparent = a_pblockParent->GetSourceAlphaMix() == Block4x4::SourceAlphaMix::TRANSPARENT;
+ m_boolPunchThroughPixels = a_pblockParent->HasPunchThroughPixels();
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ if (m_pafrgbaSource[uiPixel].fA >= 0.5f)
+ {
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ }
+ else
+ {
+ m_afDecodedAlphas[uiPixel] = 0.0f;
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // a_pafrgbaSource points to a 4x4 block subset of the source image
+ // a_paucEncodingBits points to the final encoding bits of a previous encoding
+ //
+ void Block4x4Encoding_RGB8A1::InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric)
+ {
+
+
+ InitFromEncodingBits_ETC1(a_pblockParent,
+ a_paucEncodingBits,
+ a_pafrgbaSource,
+ a_errormetric);
+
+ m_pencodingbitsRGB8 = (Block4x4EncodingBits_RGB8 *)a_paucEncodingBits;
+
+ // detect if there is a T, H or Planar mode present
+ int iRed1 = m_pencodingbitsRGB8->differential.red1;
+ int iDRed2 = m_pencodingbitsRGB8->differential.dred2;
+ int iRed2 = iRed1 + iDRed2;
+
+ int iGreen1 = m_pencodingbitsRGB8->differential.green1;
+ int iDGreen2 = m_pencodingbitsRGB8->differential.dgreen2;
+ int iGreen2 = iGreen1 + iDGreen2;
+
+ int iBlue1 = m_pencodingbitsRGB8->differential.blue1;
+ int iDBlue2 = m_pencodingbitsRGB8->differential.dblue2;
+ int iBlue2 = iBlue1 + iDBlue2;
+
+ if (iRed2 < 0 || iRed2 > 31)
+ {
+ InitFromEncodingBits_T();
+ }
+ else if (iGreen2 < 0 || iGreen2 > 31)
+ {
+ InitFromEncodingBits_H();
+ }
+ else if (iBlue2 < 0 || iBlue2 > 31)
+ {
+ Block4x4Encoding_RGB8::InitFromEncodingBits_Planar();
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding assuming the encoding is an ETC1 mode.
+ // if it isn't an ETC1 mode, this will be overwritten later
+ //
+ void Block4x4Encoding_RGB8A1::InitFromEncodingBits_ETC1(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric)
+ {
+ Block4x4Encoding::Init(a_pblockParent, a_pafrgbaSource,
+ a_errormetric);
+
+ m_pencodingbitsRGB8 = (Block4x4EncodingBits_RGB8 *)a_paucEncodingBits;
+
+ m_mode = MODE_ETC1;
+ m_boolDiff = true;
+ m_boolFlip = m_pencodingbitsRGB8->differential.flip;
+ m_boolOpaque = m_pencodingbitsRGB8->differential.diff;
+
+ int iR2 = m_pencodingbitsRGB8->differential.red1 + m_pencodingbitsRGB8->differential.dred2;
+ if (iR2 < 0)
+ {
+ iR2 = 0;
+ }
+ else if (iR2 > 31)
+ {
+ iR2 = 31;
+ }
+
+ int iG2 = m_pencodingbitsRGB8->differential.green1 + m_pencodingbitsRGB8->differential.dgreen2;
+ if (iG2 < 0)
+ {
+ iG2 = 0;
+ }
+ else if (iG2 > 31)
+ {
+ iG2 = 31;
+ }
+
+ int iB2 = m_pencodingbitsRGB8->differential.blue1 + m_pencodingbitsRGB8->differential.dblue2;
+ if (iB2 < 0)
+ {
+ iB2 = 0;
+ }
+ else if (iB2 > 31)
+ {
+ iB2 = 31;
+ }
+
+ m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB5(m_pencodingbitsRGB8->differential.red1, m_pencodingbitsRGB8->differential.green1, m_pencodingbitsRGB8->differential.blue1);
+ m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB5((unsigned char)iR2, (unsigned char)iG2, (unsigned char)iB2);
+
+ m_uiCW1 = m_pencodingbitsRGB8->differential.cw1;
+ m_uiCW2 = m_pencodingbitsRGB8->differential.cw2;
+
+ Block4x4Encoding_ETC1::InitFromEncodingBits_Selectors();
+
+ Decode_ETC1();
+
+ CalcBlockError();
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding if T mode is detected
+ //
+ void Block4x4Encoding_RGB8A1::InitFromEncodingBits_T(void)
+ {
+ m_mode = MODE_T;
+
+ unsigned char ucRed1 = (unsigned char)((m_pencodingbitsRGB8->t.red1a << 2) +
+ m_pencodingbitsRGB8->t.red1b);
+ unsigned char ucGreen1 = m_pencodingbitsRGB8->t.green1;
+ unsigned char ucBlue1 = m_pencodingbitsRGB8->t.blue1;
+
+ unsigned char ucRed2 = m_pencodingbitsRGB8->t.red2;
+ unsigned char ucGreen2 = m_pencodingbitsRGB8->t.green2;
+ unsigned char ucBlue2 = m_pencodingbitsRGB8->t.blue2;
+
+ m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4(ucRed1, ucGreen1, ucBlue1);
+ m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4(ucRed2, ucGreen2, ucBlue2);
+
+ m_uiCW1 = (m_pencodingbitsRGB8->t.da << 1) + m_pencodingbitsRGB8->t.db;
+
+ Block4x4Encoding_ETC1::InitFromEncodingBits_Selectors();
+
+ DecodePixels_T();
+
+ CalcBlockError();
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding if H mode is detected
+ //
+ void Block4x4Encoding_RGB8A1::InitFromEncodingBits_H(void)
+ {
+ m_mode = MODE_H;
+
+ unsigned char ucRed1 = m_pencodingbitsRGB8->h.red1;
+ unsigned char ucGreen1 = (unsigned char)((m_pencodingbitsRGB8->h.green1a << 1) +
+ m_pencodingbitsRGB8->h.green1b);
+ unsigned char ucBlue1 = (unsigned char)((m_pencodingbitsRGB8->h.blue1a << 3) +
+ (m_pencodingbitsRGB8->h.blue1b << 1) +
+ m_pencodingbitsRGB8->h.blue1c);
+
+ unsigned char ucRed2 = m_pencodingbitsRGB8->h.red2;
+ unsigned char ucGreen2 = (unsigned char)((m_pencodingbitsRGB8->h.green2a << 1) +
+ m_pencodingbitsRGB8->h.green2b);
+ unsigned char ucBlue2 = m_pencodingbitsRGB8->h.blue2;
+
+ m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4(ucRed1, ucGreen1, ucBlue1);
+ m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4(ucRed2, ucGreen2, ucBlue2);
+
+ // used to determine the LSB of the CW
+ unsigned int uiRGB1 = (unsigned int)(((int)ucRed1 << 16) + ((int)ucGreen1 << 8) + (int)ucBlue1);
+ unsigned int uiRGB2 = (unsigned int)(((int)ucRed2 << 16) + ((int)ucGreen2 << 8) + (int)ucBlue2);
+
+ m_uiCW1 = (m_pencodingbitsRGB8->h.da << 2) + (m_pencodingbitsRGB8->h.db << 1);
+ if (uiRGB1 >= uiRGB2)
+ {
+ m_uiCW1++;
+ }
+
+ Block4x4Encoding_ETC1::InitFromEncodingBits_Selectors();
+
+ DecodePixels_H();
+
+ CalcBlockError();
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // for ETC1 modes, set the decoded colors and decoded alpha based on the encoding state
+ //
+ void Block4x4Encoding_RGB8A1::Decode_ETC1(void)
+ {
+
+ const unsigned int *pauiPixelOrder = m_boolFlip ? s_auiPixelOrderFlip1 : s_auiPixelOrderFlip0;
+
+ for (unsigned int uiPixelOrder = 0; uiPixelOrder < PIXELS; uiPixelOrder++)
+ {
+ ColorFloatRGBA *pfrgbaCenter = uiPixelOrder < 8 ? &m_frgbaColor1 : &m_frgbaColor2;
+ unsigned int uiCW = uiPixelOrder < 8 ? m_uiCW1 : m_uiCW2;
+
+ unsigned int uiPixel = pauiPixelOrder[uiPixelOrder];
+
+ float fDelta;
+ if (m_boolOpaque)
+ fDelta = Block4x4Encoding_ETC1::s_aafCwTable[uiCW][m_auiSelectors[uiPixel]];
+ else
+ fDelta = s_aafCwOpaqueUnsetTable[uiCW][m_auiSelectors[uiPixel]];
+
+ if (m_boolOpaque == false && m_auiSelectors[uiPixel] == TRANSPARENT_SELECTOR)
+ {
+ m_afrgbaDecodedColors[uiPixel] = ColorFloatRGBA();
+ m_afDecodedAlphas[uiPixel] = 0.0f;
+ }
+ else
+ {
+ m_afrgbaDecodedColors[uiPixel] = (*pfrgbaCenter + fDelta).ClampRGB();
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // for T mode, set the decoded colors and decoded alpha based on the encoding state
+ //
+ void Block4x4Encoding_RGB8A1::DecodePixels_T(void)
+ {
+
+ float fDistance = s_afTHDistanceTable[m_uiCW1];
+ ColorFloatRGBA frgbaDistance(fDistance, fDistance, fDistance, 0.0f);
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ switch (m_auiSelectors[uiPixel])
+ {
+ case 0:
+ m_afrgbaDecodedColors[uiPixel] = m_frgbaColor1;
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ break;
+
+ case 1:
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor2 + frgbaDistance).ClampRGB();
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ break;
+
+ case 2:
+ if (m_boolOpaque == false)
+ {
+ m_afrgbaDecodedColors[uiPixel] = ColorFloatRGBA();
+ m_afDecodedAlphas[uiPixel] = 0.0f;
+ }
+ else
+ {
+ m_afrgbaDecodedColors[uiPixel] = m_frgbaColor2;
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ }
+ break;
+
+ case 3:
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor2 - frgbaDistance).ClampRGB();
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ break;
+ }
+
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // for H mode, set the decoded colors and decoded alpha based on the encoding state
+ //
+ void Block4x4Encoding_RGB8A1::DecodePixels_H(void)
+ {
+
+ float fDistance = s_afTHDistanceTable[m_uiCW1];
+ ColorFloatRGBA frgbaDistance(fDistance, fDistance, fDistance, 0.0f);
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ switch (m_auiSelectors[uiPixel])
+ {
+ case 0:
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor1 + frgbaDistance).ClampRGB();
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ break;
+
+ case 1:
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor1 - frgbaDistance).ClampRGB();
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ break;
+
+ case 2:
+ if (m_boolOpaque == false)
+ {
+ m_afrgbaDecodedColors[uiPixel] = ColorFloatRGBA();
+ m_afDecodedAlphas[uiPixel] = 0.0f;
+ }
+ else
+ {
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor2 + frgbaDistance).ClampRGB();
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ }
+ break;
+
+ case 3:
+ m_afrgbaDecodedColors[uiPixel] = (m_frgbaColor2 - frgbaDistance).ClampRGB();
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ break;
+ }
+
+ }
+
+ }
+
+
+ // ----------------------------------------------------------------------------------------------------
+ // perform a single encoding iteration
+ // replace the encoding if a better encoding was found
+ // subsequent iterations generally take longer for each iteration
+ // set m_boolDone if encoding is perfect or encoding is finished based on a_fEffort
+ //
+ // RGB8A1 can't use individual mode
+ // RGB8A1 with transparent pixels can't use planar mode
+ //
+ void Block4x4Encoding_RGB8A1::PerformIteration(float a_fEffort)
+ {
+ assert(!m_boolOpaque);
+ assert(!m_boolTransparent);
+ assert(!m_boolDone);
+
+ switch (m_uiEncodingIterations)
+ {
+ case 0:
+ PerformFirstIteration();
+ break;
+
+ case 1:
+ TryDifferential(m_boolMostLikelyFlip, 1, 0, 0);
+ break;
+
+ case 2:
+ TryDifferential(!m_boolMostLikelyFlip, 1, 0, 0);
+ if (a_fEffort <= 39.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 3:
+ Block4x4Encoding_RGB8::CalculateBaseColorsForTAndH();
+ TryT(1);
+ TryH(1);
+ if (a_fEffort <= 49.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 4:
+ TryDegenerates1();
+ if (a_fEffort <= 59.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 5:
+ TryDegenerates2();
+ if (a_fEffort <= 69.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 6:
+ TryDegenerates3();
+ if (a_fEffort <= 79.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 7:
+ TryDegenerates4();
+ m_boolDone = true;
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+ m_uiEncodingIterations++;
+
+ SetDoneIfPerfect();
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // find best initial encoding to ensure block has a valid encoding
+ //
+ void Block4x4Encoding_RGB8A1::PerformFirstIteration(void)
+ {
+ Block4x4Encoding_ETC1::CalculateMostLikelyFlip();
+
+ m_fError = FLT_MAX;
+
+ TryDifferential(m_boolMostLikelyFlip, 0, 0, 0);
+ SetDoneIfPerfect();
+ if (m_boolDone)
+ {
+ return;
+ }
+ TryDifferential(!m_boolMostLikelyFlip, 0, 0, 0);
+ SetDoneIfPerfect();
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // mostly copied from ETC1
+ // differences:
+ // Block4x4Encoding_RGB8A1 encodingTry = *this;
+ //
+ void Block4x4Encoding_RGB8A1::TryDifferential(bool a_boolFlip, unsigned int a_uiRadius,
+ int a_iGrayOffset1, int a_iGrayOffset2)
+ {
+
+ ColorFloatRGBA frgbaColor1;
+ ColorFloatRGBA frgbaColor2;
+
+ const unsigned int *pauiPixelMapping1;
+ const unsigned int *pauiPixelMapping2;
+
+ if (a_boolFlip)
+ {
+ frgbaColor1 = m_frgbaSourceAverageTop;
+ frgbaColor2 = m_frgbaSourceAverageBottom;
+
+ pauiPixelMapping1 = s_auiTopPixelMapping;
+ pauiPixelMapping2 = s_auiBottomPixelMapping;
+ }
+ else
+ {
+ frgbaColor1 = m_frgbaSourceAverageLeft;
+ frgbaColor2 = m_frgbaSourceAverageRight;
+
+ pauiPixelMapping1 = s_auiLeftPixelMapping;
+ pauiPixelMapping2 = s_auiRightPixelMapping;
+ }
+
+ DifferentialTrys trys(frgbaColor1, frgbaColor2, pauiPixelMapping1, pauiPixelMapping2,
+ a_uiRadius, a_iGrayOffset1, a_iGrayOffset2);
+
+ Block4x4Encoding_RGB8A1 encodingTry = *this;
+ encodingTry.m_boolFlip = a_boolFlip;
+
+ encodingTry.TryDifferentialHalf(&trys.m_half1);
+ encodingTry.TryDifferentialHalf(&trys.m_half2);
+
+ // find best halves that are within differential range
+ DifferentialTrys::Try *ptryBest1 = nullptr;
+ DifferentialTrys::Try *ptryBest2 = nullptr;
+ encodingTry.m_fError = FLT_MAX;
+
+ // see if the best of each half are in differential range
+ int iDRed = trys.m_half2.m_ptryBest->m_iRed - trys.m_half1.m_ptryBest->m_iRed;
+ int iDGreen = trys.m_half2.m_ptryBest->m_iGreen - trys.m_half1.m_ptryBest->m_iGreen;
+ int iDBlue = trys.m_half2.m_ptryBest->m_iBlue - trys.m_half1.m_ptryBest->m_iBlue;
+ if (iDRed >= -4 && iDRed <= 3 && iDGreen >= -4 && iDGreen <= 3 && iDBlue >= -4 && iDBlue <= 3)
+ {
+ ptryBest1 = trys.m_half1.m_ptryBest;
+ ptryBest2 = trys.m_half2.m_ptryBest;
+ encodingTry.m_fError = trys.m_half1.m_ptryBest->m_fError + trys.m_half2.m_ptryBest->m_fError;
+ }
+ else
+ {
+ // else, find the next best halves that are in differential range
+ for (DifferentialTrys::Try *ptry1 = &trys.m_half1.m_atry[0];
+ ptry1 < &trys.m_half1.m_atry[trys.m_half1.m_uiTrys];
+ ptry1++)
+ {
+ for (DifferentialTrys::Try *ptry2 = &trys.m_half2.m_atry[0];
+ ptry2 < &trys.m_half2.m_atry[trys.m_half2.m_uiTrys];
+ ptry2++)
+ {
+ iDRed = ptry2->m_iRed - ptry1->m_iRed;
+ bool boolValidRedDelta = iDRed <= 3 && iDRed >= -4;
+ iDGreen = ptry2->m_iGreen - ptry1->m_iGreen;
+ bool boolValidGreenDelta = iDGreen <= 3 && iDGreen >= -4;
+ iDBlue = ptry2->m_iBlue - ptry1->m_iBlue;
+ bool boolValidBlueDelta = iDBlue <= 3 && iDBlue >= -4;
+
+ if (boolValidRedDelta && boolValidGreenDelta && boolValidBlueDelta)
+ {
+ float fError = ptry1->m_fError + ptry2->m_fError;
+
+ if (fError < encodingTry.m_fError)
+ {
+ encodingTry.m_fError = fError;
+
+ ptryBest1 = ptry1;
+ ptryBest2 = ptry2;
+ }
+ }
+
+ }
+ }
+ assert(encodingTry.m_fError < FLT_MAX);
+ assert(ptryBest1 != nullptr);
+ assert(ptryBest2 != nullptr);
+ }
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = MODE_ETC1;
+ m_boolDiff = true;
+ m_boolFlip = encodingTry.m_boolFlip;
+ m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB5((unsigned char)ptryBest1->m_iRed, (unsigned char)ptryBest1->m_iGreen, (unsigned char)ptryBest1->m_iBlue);
+ m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB5((unsigned char)ptryBest2->m_iRed, (unsigned char)ptryBest2->m_iGreen, (unsigned char)ptryBest2->m_iBlue);
+ m_uiCW1 = ptryBest1->m_uiCW;
+ m_uiCW2 = ptryBest2->m_uiCW;
+
+ m_fError = 0.0f;
+ for (unsigned int uiPixelOrder = 0; uiPixelOrder < PIXELS / 2; uiPixelOrder++)
+ {
+ unsigned int uiPixel1 = pauiPixelMapping1[uiPixelOrder];
+ unsigned int uiPixel2 = pauiPixelMapping2[uiPixelOrder];
+
+ unsigned int uiSelector1 = ptryBest1->m_auiSelectors[uiPixelOrder];
+ unsigned int uiSelector2 = ptryBest2->m_auiSelectors[uiPixelOrder];
+
+ m_auiSelectors[uiPixel1] = uiSelector1;
+ m_auiSelectors[uiPixel2] = ptryBest2->m_auiSelectors[uiPixelOrder];
+
+ if (uiSelector1 == TRANSPARENT_SELECTOR)
+ {
+ m_afrgbaDecodedColors[uiPixel1] = ColorFloatRGBA();
+ m_afDecodedAlphas[uiPixel1] = 0.0f;
+ }
+ else
+ {
+ float fDeltaRGB1 = s_aafCwOpaqueUnsetTable[m_uiCW1][uiSelector1];
+ m_afrgbaDecodedColors[uiPixel1] = (m_frgbaColor1 + fDeltaRGB1).ClampRGB();
+ m_afDecodedAlphas[uiPixel1] = 1.0f;
+ }
+
+ if (uiSelector2 == TRANSPARENT_SELECTOR)
+ {
+ m_afrgbaDecodedColors[uiPixel2] = ColorFloatRGBA();
+ m_afDecodedAlphas[uiPixel2] = 0.0f;
+ }
+ else
+ {
+ float fDeltaRGB2 = s_aafCwOpaqueUnsetTable[m_uiCW2][uiSelector2];
+ m_afrgbaDecodedColors[uiPixel2] = (m_frgbaColor2 + fDeltaRGB2).ClampRGB();
+ m_afDecodedAlphas[uiPixel2] = 1.0f;
+ }
+
+ float fDeltaA1 = m_afDecodedAlphas[uiPixel1] - m_pafrgbaSource[uiPixel1].fA;
+ m_fError += fDeltaA1 * fDeltaA1;
+ float fDeltaA2 = m_afDecodedAlphas[uiPixel2] - m_pafrgbaSource[uiPixel2].fA;
+ m_fError += fDeltaA2 * fDeltaA2;
+ }
+
+ m_fError1 = ptryBest1->m_fError;
+ m_fError2 = ptryBest2->m_fError;
+ m_boolSeverelyBentDifferentialColors = trys.m_boolSeverelyBentColors;
+ m_fError = m_fError1 + m_fError2;
+
+ // sanity check
+ {
+ int iRed1 = m_frgbaColor1.IntRed(31.0f);
+ int iGreen1 = m_frgbaColor1.IntGreen(31.0f);
+ int iBlue1 = m_frgbaColor1.IntBlue(31.0f);
+
+ int iRed2 = m_frgbaColor2.IntRed(31.0f);
+ int iGreen2 = m_frgbaColor2.IntGreen(31.0f);
+ int iBlue2 = m_frgbaColor2.IntBlue(31.0f);
+
+ iDRed = iRed2 - iRed1;
+ iDGreen = iGreen2 - iGreen1;
+ iDBlue = iBlue2 - iBlue1;
+
+ assert(iDRed >= -4 && iDRed < 4);
+ assert(iDGreen >= -4 && iDGreen < 4);
+ assert(iDBlue >= -4 && iDBlue < 4);
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // mostly copied from ETC1
+ // differences:
+ // uses s_aafCwOpaqueUnsetTable
+ // color for selector set to 0,0,0,0
+ //
+ void Block4x4Encoding_RGB8A1::TryDifferentialHalf(DifferentialTrys::Half *a_phalf)
+ {
+
+ a_phalf->m_ptryBest = nullptr;
+ float fBestTryError = FLT_MAX;
+
+ a_phalf->m_uiTrys = 0;
+ for (int iRed = a_phalf->m_iRed - (int)a_phalf->m_uiRadius;
+ iRed <= a_phalf->m_iRed + (int)a_phalf->m_uiRadius;
+ iRed++)
+ {
+ assert(iRed >= 0 && iRed <= 31);
+
+ for (int iGreen = a_phalf->m_iGreen - (int)a_phalf->m_uiRadius;
+ iGreen <= a_phalf->m_iGreen + (int)a_phalf->m_uiRadius;
+ iGreen++)
+ {
+ assert(iGreen >= 0 && iGreen <= 31);
+
+ for (int iBlue = a_phalf->m_iBlue - (int)a_phalf->m_uiRadius;
+ iBlue <= a_phalf->m_iBlue + (int)a_phalf->m_uiRadius;
+ iBlue++)
+ {
+ assert(iBlue >= 0 && iBlue <= 31);
+
+ DifferentialTrys::Try *ptry = &a_phalf->m_atry[a_phalf->m_uiTrys];
+ assert(ptry < &a_phalf->m_atry[DifferentialTrys::Half::MAX_TRYS]);
+
+ ptry->m_iRed = iRed;
+ ptry->m_iGreen = iGreen;
+ ptry->m_iBlue = iBlue;
+ ptry->m_fError = FLT_MAX;
+ ColorFloatRGBA frgbaColor = ColorFloatRGBA::ConvertFromRGB5((unsigned char)iRed, (unsigned char)iGreen, (unsigned char)iBlue);
+
+ // try each CW
+ for (unsigned int uiCW = 0; uiCW < CW_RANGES; uiCW++)
+ {
+ unsigned int auiPixelSelectors[PIXELS / 2];
+ ColorFloatRGBA afrgbaDecodedColors[PIXELS / 2];
+ float afPixelErrors[PIXELS / 2] = { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX,
+ FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX };
+
+ // pre-compute decoded pixels for each selector
+ ColorFloatRGBA afrgbaSelectors[SELECTORS];
+ assert(SELECTORS == 4);
+ afrgbaSelectors[0] = (frgbaColor + s_aafCwOpaqueUnsetTable[uiCW][0]).ClampRGB();
+ afrgbaSelectors[1] = (frgbaColor + s_aafCwOpaqueUnsetTable[uiCW][1]).ClampRGB();
+ afrgbaSelectors[2] = ColorFloatRGBA();
+ afrgbaSelectors[3] = (frgbaColor + s_aafCwOpaqueUnsetTable[uiCW][3]).ClampRGB();
+
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ ColorFloatRGBA *pfrgbaSourcePixel = &m_pafrgbaSource[a_phalf->m_pauiPixelMapping[uiPixel]];
+ ColorFloatRGBA frgbaDecodedPixel;
+
+ for (unsigned int uiSelector = 0; uiSelector < SELECTORS; uiSelector++)
+ {
+ if (pfrgbaSourcePixel->fA < 0.5f)
+ {
+ uiSelector = TRANSPARENT_SELECTOR;
+ }
+ else if (uiSelector == TRANSPARENT_SELECTOR)
+ {
+ continue;
+ }
+
+ frgbaDecodedPixel = afrgbaSelectors[uiSelector];
+
+ float fPixelError;
+
+ fPixelError = CalcPixelError(frgbaDecodedPixel, m_afDecodedAlphas[a_phalf->m_pauiPixelMapping[uiPixel]],
+ *pfrgbaSourcePixel);
+
+ if (fPixelError < afPixelErrors[uiPixel])
+ {
+ auiPixelSelectors[uiPixel] = uiSelector;
+ afrgbaDecodedColors[uiPixel] = frgbaDecodedPixel;
+ afPixelErrors[uiPixel] = fPixelError;
+ }
+
+ if (uiSelector == TRANSPARENT_SELECTOR)
+ {
+ break;
+ }
+ }
+ }
+
+ // add up all pixel errors
+ float fCWError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ fCWError += afPixelErrors[uiPixel];
+ }
+
+ // if best CW so far
+ if (fCWError < ptry->m_fError)
+ {
+ ptry->m_uiCW = uiCW;
+ for (unsigned int uiPixel = 0; uiPixel < 8; uiPixel++)
+ {
+ ptry->m_auiSelectors[uiPixel] = auiPixelSelectors[uiPixel];
+ }
+ ptry->m_fError = fCWError;
+ }
+
+ }
+
+ if (ptry->m_fError < fBestTryError)
+ {
+ a_phalf->m_ptryBest = ptry;
+ fBestTryError = ptry->m_fError;
+ }
+
+ assert(ptry->m_fError < FLT_MAX);
+
+ a_phalf->m_uiTrys++;
+ }
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try encoding in T mode
+ // save this encoding if it improves the error
+ //
+ // since pixels that use base color1 don't use the distance table, color1 and color2 can be twiddled independently
+ // better encoding can be found if TWIDDLE_RADIUS is set to 2, but it will be much slower
+ //
+ void Block4x4Encoding_RGB8A1::TryT(unsigned int a_uiRadius)
+ {
+ Block4x4Encoding_RGB8A1 encodingTry = *this;
+
+ // init "try"
+ {
+ encodingTry.m_mode = MODE_T;
+ encodingTry.m_boolDiff = true;
+ encodingTry.m_boolFlip = false;
+ encodingTry.m_fError = FLT_MAX;
+ }
+
+ int iColor1Red = m_frgbaOriginalColor1_TAndH.IntRed(15.0f);
+ int iColor1Green = m_frgbaOriginalColor1_TAndH.IntGreen(15.0f);
+ int iColor1Blue = m_frgbaOriginalColor1_TAndH.IntBlue(15.0f);
+
+ int iMinRed1 = iColor1Red - (int)a_uiRadius;
+ if (iMinRed1 < 0)
+ {
+ iMinRed1 = 0;
+ }
+ int iMaxRed1 = iColor1Red + (int)a_uiRadius;
+ if (iMaxRed1 > 15)
+ {
+ iMinRed1 = 15;
+ }
+
+ int iMinGreen1 = iColor1Green - (int)a_uiRadius;
+ if (iMinGreen1 < 0)
+ {
+ iMinGreen1 = 0;
+ }
+ int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
+ if (iMaxGreen1 > 15)
+ {
+ iMinGreen1 = 15;
+ }
+
+ int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
+ if (iMinBlue1 < 0)
+ {
+ iMinBlue1 = 0;
+ }
+ int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
+ if (iMaxBlue1 > 15)
+ {
+ iMinBlue1 = 15;
+ }
+
+ int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
+ int iColor2Green = m_frgbaOriginalColor2_TAndH.IntGreen(15.0f);
+ int iColor2Blue = m_frgbaOriginalColor2_TAndH.IntBlue(15.0f);
+
+ int iMinRed2 = iColor2Red - (int)a_uiRadius;
+ if (iMinRed2 < 0)
+ {
+ iMinRed2 = 0;
+ }
+ int iMaxRed2 = iColor2Red + (int)a_uiRadius;
+ if (iMaxRed2 > 15)
+ {
+ iMinRed2 = 15;
+ }
+
+ int iMinGreen2 = iColor2Green - (int)a_uiRadius;
+ if (iMinGreen2 < 0)
+ {
+ iMinGreen2 = 0;
+ }
+ int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
+ if (iMaxGreen2 > 15)
+ {
+ iMinGreen2 = 15;
+ }
+
+ int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
+ if (iMinBlue2 < 0)
+ {
+ iMinBlue2 = 0;
+ }
+ int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
+ if (iMaxBlue2 > 15)
+ {
+ iMinBlue2 = 15;
+ }
+
+ for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
+ {
+ encodingTry.m_uiCW1 = uiDistance;
+
+ // twiddle m_frgbaOriginalColor2_TAndH
+ // twiddle color2 first, since it affects 3 selectors, while color1 only affects one selector
+ //
+ for (int iRed2 = iMinRed2; iRed2 <= iMaxRed2; iRed2++)
+ {
+ for (int iGreen2 = iMinGreen2; iGreen2 <= iMaxGreen2; iGreen2++)
+ {
+ for (int iBlue2 = iMinBlue2; iBlue2 <= iMaxBlue2; iBlue2++)
+ {
+ for (unsigned int uiBaseColorSwaps = 0; uiBaseColorSwaps < 2; uiBaseColorSwaps++)
+ {
+ if (uiBaseColorSwaps == 0)
+ {
+ encodingTry.m_frgbaColor1 = m_frgbaOriginalColor1_TAndH;
+ encodingTry.m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed2, (unsigned char)iGreen2, (unsigned char)iBlue2);
+ }
+ else
+ {
+ encodingTry.m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed2, (unsigned char)iGreen2, (unsigned char)iBlue2);
+ encodingTry.m_frgbaColor2 = m_frgbaOriginalColor1_TAndH;
+ }
+
+ encodingTry.TryT_BestSelectorCombination();
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = encodingTry.m_mode;
+ m_boolDiff = encodingTry.m_boolDiff;
+ m_boolFlip = encodingTry.m_boolFlip;
+
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_uiCW1 = encodingTry.m_uiCW1;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = encodingTry.m_auiSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+ }
+ }
+ }
+ }
+ }
+
+ // twiddle m_frgbaOriginalColor1_TAndH
+ for (int iRed1 = iMinRed1; iRed1 <= iMaxRed1; iRed1++)
+ {
+ for (int iGreen1 = iMinGreen1; iGreen1 <= iMaxGreen1; iGreen1++)
+ {
+ for (int iBlue1 = iMinBlue1; iBlue1 <= iMaxBlue1; iBlue1++)
+ {
+ for (unsigned int uiBaseColorSwaps = 0; uiBaseColorSwaps < 2; uiBaseColorSwaps++)
+ {
+ if (uiBaseColorSwaps == 0)
+ {
+ encodingTry.m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed1, (unsigned char)iGreen1, (unsigned char)iBlue1);
+ encodingTry.m_frgbaColor2 = m_frgbaOriginalColor2_TAndH;
+ }
+ else
+ {
+ encodingTry.m_frgbaColor1 = m_frgbaOriginalColor2_TAndH;
+ encodingTry.m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed1, (unsigned char)iGreen1, (unsigned char)iBlue1);
+ }
+
+ encodingTry.TryT_BestSelectorCombination();
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = encodingTry.m_mode;
+ m_boolDiff = encodingTry.m_boolDiff;
+ m_boolFlip = encodingTry.m_boolFlip;
+
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_uiCW1 = encodingTry.m_uiCW1;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = encodingTry.m_auiSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // find best selector combination for TryT
+ // called on an encodingTry
+ //
+ void Block4x4Encoding_RGB8A1::TryT_BestSelectorCombination(void)
+ {
+
+ float fDistance = s_afTHDistanceTable[m_uiCW1];
+
+ unsigned int auiBestPixelSelectors[PIXELS];
+ float afBestPixelErrors[PIXELS] = { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX,
+ FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX };
+ ColorFloatRGBA afrgbaBestDecodedPixels[PIXELS];
+ ColorFloatRGBA afrgbaDecodedPixel[SELECTORS];
+
+ assert(SELECTORS == 4);
+ afrgbaDecodedPixel[0] = m_frgbaColor1;
+ afrgbaDecodedPixel[1] = (m_frgbaColor2 + fDistance).ClampRGB();
+ afrgbaDecodedPixel[2] = ColorFloatRGBA();
+ afrgbaDecodedPixel[3] = (m_frgbaColor2 - fDistance).ClampRGB();
+
+ // try each selector
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ unsigned int uiMinSelector = 0;
+ unsigned int uiMaxSelector = SELECTORS - 1;
+
+ if (m_pafrgbaSource[uiPixel].fA < 0.5f)
+ {
+ uiMinSelector = 2;
+ uiMaxSelector = 2;
+ }
+
+ for (unsigned int uiSelector = uiMinSelector; uiSelector <= uiMaxSelector; uiSelector++)
+ {
+ float fPixelError = CalcPixelError(afrgbaDecodedPixel[uiSelector], m_afDecodedAlphas[uiPixel],
+ m_pafrgbaSource[uiPixel]);
+
+ if (fPixelError < afBestPixelErrors[uiPixel])
+ {
+ afBestPixelErrors[uiPixel] = fPixelError;
+ auiBestPixelSelectors[uiPixel] = uiSelector;
+ afrgbaBestDecodedPixels[uiPixel] = afrgbaDecodedPixel[uiSelector];
+ }
+ }
+ }
+
+
+ // add up all of the pixel errors
+ float fBlockError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ fBlockError += afBestPixelErrors[uiPixel];
+ }
+
+ if (fBlockError < m_fError)
+ {
+ m_fError = fBlockError;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = auiBestPixelSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = afrgbaBestDecodedPixels[uiPixel];
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try encoding in H mode
+ // save this encoding if it improves the error
+ //
+ // since all pixels use the distance table, color1 and color2 can NOT be twiddled independently
+ // TWIDDLE_RADIUS of 2 is WAY too slow
+ //
+ void Block4x4Encoding_RGB8A1::TryH(unsigned int a_uiRadius)
+ {
+ Block4x4Encoding_RGB8A1 encodingTry = *this;
+
+ // init "try"
+ {
+ encodingTry.m_mode = MODE_H;
+ encodingTry.m_boolDiff = true;
+ encodingTry.m_boolFlip = false;
+ encodingTry.m_fError = FLT_MAX;
+ }
+
+ int iColor1Red = m_frgbaOriginalColor1_TAndH.IntRed(15.0f);
+ int iColor1Green = m_frgbaOriginalColor1_TAndH.IntGreen(15.0f);
+ int iColor1Blue = m_frgbaOriginalColor1_TAndH.IntBlue(15.0f);
+
+ int iMinRed1 = iColor1Red - (int)a_uiRadius;
+ if (iMinRed1 < 0)
+ {
+ iMinRed1 = 0;
+ }
+ int iMaxRed1 = iColor1Red + (int)a_uiRadius;
+ if (iMaxRed1 > 15)
+ {
+ iMinRed1 = 15;
+ }
+
+ int iMinGreen1 = iColor1Green - (int)a_uiRadius;
+ if (iMinGreen1 < 0)
+ {
+ iMinGreen1 = 0;
+ }
+ int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
+ if (iMaxGreen1 > 15)
+ {
+ iMinGreen1 = 15;
+ }
+
+ int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
+ if (iMinBlue1 < 0)
+ {
+ iMinBlue1 = 0;
+ }
+ int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
+ if (iMaxBlue1 > 15)
+ {
+ iMinBlue1 = 15;
+ }
+
+ int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
+ int iColor2Green = m_frgbaOriginalColor2_TAndH.IntGreen(15.0f);
+ int iColor2Blue = m_frgbaOriginalColor2_TAndH.IntBlue(15.0f);
+
+ int iMinRed2 = iColor2Red - (int)a_uiRadius;
+ if (iMinRed2 < 0)
+ {
+ iMinRed2 = 0;
+ }
+ int iMaxRed2 = iColor2Red + (int)a_uiRadius;
+ if (iMaxRed2 > 15)
+ {
+ iMinRed2 = 15;
+ }
+
+ int iMinGreen2 = iColor2Green - (int)a_uiRadius;
+ if (iMinGreen2 < 0)
+ {
+ iMinGreen2 = 0;
+ }
+ int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
+ if (iMaxGreen2 > 15)
+ {
+ iMinGreen2 = 15;
+ }
+
+ int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
+ if (iMinBlue2 < 0)
+ {
+ iMinBlue2 = 0;
+ }
+ int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
+ if (iMaxBlue2 > 15)
+ {
+ iMinBlue2 = 15;
+ }
+
+ for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
+ {
+ encodingTry.m_uiCW1 = uiDistance;
+
+ // twiddle m_frgbaOriginalColor1_TAndH
+ for (int iRed1 = iMinRed1; iRed1 <= iMaxRed1; iRed1++)
+ {
+ for (int iGreen1 = iMinGreen1; iGreen1 <= iMaxGreen1; iGreen1++)
+ {
+ for (int iBlue1 = iMinBlue1; iBlue1 <= iMaxBlue1; iBlue1++)
+ {
+ encodingTry.m_frgbaColor1 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed1, (unsigned char)iGreen1, (unsigned char)iBlue1);
+ encodingTry.m_frgbaColor2 = m_frgbaOriginalColor2_TAndH;
+
+ // if color1 == color2, H encoding issues can pop up, so abort
+ if (iRed1 == iColor2Red && iGreen1 == iColor2Green && iBlue1 == iColor2Blue)
+ {
+ continue;
+ }
+
+ encodingTry.TryH_BestSelectorCombination();
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = encodingTry.m_mode;
+ m_boolDiff = encodingTry.m_boolDiff;
+ m_boolFlip = encodingTry.m_boolFlip;
+
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_uiCW1 = encodingTry.m_uiCW1;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = encodingTry.m_auiSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+ }
+ }
+ }
+ }
+
+ // twiddle m_frgbaOriginalColor2_TAndH
+ for (int iRed2 = iMinRed2; iRed2 <= iMaxRed2; iRed2++)
+ {
+ for (int iGreen2 = iMinGreen2; iGreen2 <= iMaxGreen2; iGreen2++)
+ {
+ for (int iBlue2 = iMinBlue2; iBlue2 <= iMaxBlue2; iBlue2++)
+ {
+ encodingTry.m_frgbaColor1 = m_frgbaOriginalColor1_TAndH;
+ encodingTry.m_frgbaColor2 = ColorFloatRGBA::ConvertFromRGB4((unsigned char)iRed2, (unsigned char)iGreen2, (unsigned char)iBlue2);
+
+ // if color1 == color2, H encoding issues can pop up, so abort
+ if (iRed2 == iColor1Red && iGreen2 == iColor1Green && iBlue2 == iColor1Blue)
+ {
+ continue;
+ }
+
+ encodingTry.TryH_BestSelectorCombination();
+
+ if (encodingTry.m_fError < m_fError)
+ {
+ m_mode = encodingTry.m_mode;
+ m_boolDiff = encodingTry.m_boolDiff;
+ m_boolFlip = encodingTry.m_boolFlip;
+
+ m_frgbaColor1 = encodingTry.m_frgbaColor1;
+ m_frgbaColor2 = encodingTry.m_frgbaColor2;
+ m_uiCW1 = encodingTry.m_uiCW1;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = encodingTry.m_auiSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = encodingTry.m_afrgbaDecodedColors[uiPixel];
+ }
+
+ m_fError = encodingTry.m_fError;
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // find best selector combination for TryH
+ // called on an encodingTry
+ //
+ void Block4x4Encoding_RGB8A1::TryH_BestSelectorCombination(void)
+ {
+
+ // abort if colors and CW will pose an encoding problem
+ {
+ unsigned int uiRed1 = (unsigned int)m_frgbaColor1.IntRed(255.0f);
+ unsigned int uiGreen1 = (unsigned int)m_frgbaColor1.IntGreen(255.0f);
+ unsigned int uiBlue1 = (unsigned int)m_frgbaColor1.IntBlue(255.0f);
+ unsigned int uiColorValue1 = (uiRed1 << 16) + (uiGreen1 << 8) + uiBlue1;
+
+ unsigned int uiRed2 = (unsigned int)m_frgbaColor2.IntRed(255.0f);
+ unsigned int uiGreen2 = (unsigned int)m_frgbaColor2.IntGreen(255.0f);
+ unsigned int uiBlue2 = (unsigned int)m_frgbaColor2.IntBlue(255.0f);
+ unsigned int uiColorValue2 = (uiRed2 << 16) + (uiGreen2 << 8) + uiBlue2;
+
+ unsigned int uiCWLsb = m_uiCW1 & 1;
+
+ if ((uiColorValue1 >= (uiColorValue2 & uiCWLsb)) == 0 ||
+ (uiColorValue1 < (uiColorValue2 & uiCWLsb)) == 1)
+ {
+ return;
+ }
+ }
+
+ float fDistance = s_afTHDistanceTable[m_uiCW1];
+
+ unsigned int auiBestPixelSelectors[PIXELS];
+ float afBestPixelErrors[PIXELS] = { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX,
+ FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX };
+ ColorFloatRGBA afrgbaBestDecodedPixels[PIXELS];
+ ColorFloatRGBA afrgbaDecodedPixel[SELECTORS];
+
+ assert(SELECTORS == 4);
+ afrgbaDecodedPixel[0] = (m_frgbaColor1 + fDistance).ClampRGB();
+ afrgbaDecodedPixel[1] = (m_frgbaColor1 - fDistance).ClampRGB();
+ afrgbaDecodedPixel[2] = ColorFloatRGBA();;
+ afrgbaDecodedPixel[3] = (m_frgbaColor2 - fDistance).ClampRGB();
+
+
+ // try each selector
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ unsigned int uiMinSelector = 0;
+ unsigned int uiMaxSelector = SELECTORS - 1;
+
+ if (m_pafrgbaSource[uiPixel].fA < 0.5f)
+ {
+ uiMinSelector = 2;
+ uiMaxSelector = 2;
+ }
+
+ for (unsigned int uiSelector = uiMinSelector; uiSelector <= uiMaxSelector; uiSelector++)
+ {
+ float fPixelError = CalcPixelError(afrgbaDecodedPixel[uiSelector], m_afDecodedAlphas[uiPixel],
+ m_pafrgbaSource[uiPixel]);
+
+ if (fPixelError < afBestPixelErrors[uiPixel])
+ {
+ afBestPixelErrors[uiPixel] = fPixelError;
+ auiBestPixelSelectors[uiPixel] = uiSelector;
+ afrgbaBestDecodedPixels[uiPixel] = afrgbaDecodedPixel[uiSelector];
+ }
+ }
+ }
+
+
+ // add up all of the pixel errors
+ float fBlockError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ fBlockError += afBestPixelErrors[uiPixel];
+ }
+
+ if (fBlockError < m_fError)
+ {
+ m_fError = fBlockError;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = auiBestPixelSelectors[uiPixel];
+ m_afrgbaDecodedColors[uiPixel] = afrgbaBestDecodedPixels[uiPixel];
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try version 1 of the degenerate search
+ // degenerate encodings use basecolor movement and a subset of the selectors to find useful encodings
+ // each subsequent version of the degenerate search uses more basecolor movement and is less likely to
+ // be successfull
+ //
+ void Block4x4Encoding_RGB8A1::TryDegenerates1(void)
+ {
+
+ TryDifferential(m_boolMostLikelyFlip, 1, -2, 0);
+ TryDifferential(m_boolMostLikelyFlip, 1, 2, 0);
+ TryDifferential(m_boolMostLikelyFlip, 1, 0, 2);
+ TryDifferential(m_boolMostLikelyFlip, 1, 0, -2);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try version 2 of the degenerate search
+ // degenerate encodings use basecolor movement and a subset of the selectors to find useful encodings
+ // each subsequent version of the degenerate search uses more basecolor movement and is less likely to
+ // be successfull
+ //
+ void Block4x4Encoding_RGB8A1::TryDegenerates2(void)
+ {
+
+ TryDifferential(!m_boolMostLikelyFlip, 1, -2, 0);
+ TryDifferential(!m_boolMostLikelyFlip, 1, 2, 0);
+ TryDifferential(!m_boolMostLikelyFlip, 1, 0, 2);
+ TryDifferential(!m_boolMostLikelyFlip, 1, 0, -2);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try version 3 of the degenerate search
+ // degenerate encodings use basecolor movement and a subset of the selectors to find useful encodings
+ // each subsequent version of the degenerate search uses more basecolor movement and is less likely to
+ // be successfull
+ //
+ void Block4x4Encoding_RGB8A1::TryDegenerates3(void)
+ {
+
+ TryDifferential(m_boolMostLikelyFlip, 1, -2, -2);
+ TryDifferential(m_boolMostLikelyFlip, 1, -2, 2);
+ TryDifferential(m_boolMostLikelyFlip, 1, 2, -2);
+ TryDifferential(m_boolMostLikelyFlip, 1, 2, 2);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // try version 4 of the degenerate search
+ // degenerate encodings use basecolor movement and a subset of the selectors to find useful encodings
+ // each subsequent version of the degenerate search uses more basecolor movement and is less likely to
+ // be successfull
+ //
+ void Block4x4Encoding_RGB8A1::TryDegenerates4(void)
+ {
+
+ TryDifferential(m_boolMostLikelyFlip, 1, -4, 0);
+ TryDifferential(m_boolMostLikelyFlip, 1, 4, 0);
+ TryDifferential(m_boolMostLikelyFlip, 1, 0, 4);
+ TryDifferential(m_boolMostLikelyFlip, 1, 0, -4);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state
+ //
+ void Block4x4Encoding_RGB8A1::SetEncodingBits(void)
+ {
+ switch (m_mode)
+ {
+ case MODE_ETC1:
+ SetEncodingBits_ETC1();
+ break;
+
+ case MODE_T:
+ SetEncodingBits_T();
+ break;
+
+ case MODE_H:
+ SetEncodingBits_H();
+ break;
+
+ case MODE_PLANAR:
+ Block4x4Encoding_RGB8::SetEncodingBits_Planar();
+ break;
+
+ default:
+ assert(false);
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state if ETC1 mode
+ //
+ void Block4x4Encoding_RGB8A1::SetEncodingBits_ETC1(void)
+ {
+
+ // there is no individual mode in RGB8A1
+ assert(m_boolDiff);
+
+ int iRed1 = m_frgbaColor1.IntRed(31.0f);
+ int iGreen1 = m_frgbaColor1.IntGreen(31.0f);
+ int iBlue1 = m_frgbaColor1.IntBlue(31.0f);
+
+ int iRed2 = m_frgbaColor2.IntRed(31.0f);
+ int iGreen2 = m_frgbaColor2.IntGreen(31.0f);
+ int iBlue2 = m_frgbaColor2.IntBlue(31.0f);
+
+ int iDRed2 = iRed2 - iRed1;
+ int iDGreen2 = iGreen2 - iGreen1;
+ int iDBlue2 = iBlue2 - iBlue1;
+
+ assert(iDRed2 >= -4 && iDRed2 < 4);
+ assert(iDGreen2 >= -4 && iDGreen2 < 4);
+ assert(iDBlue2 >= -4 && iDBlue2 < 4);
+
+ m_pencodingbitsRGB8->differential.red1 = iRed1;
+ m_pencodingbitsRGB8->differential.green1 = iGreen1;
+ m_pencodingbitsRGB8->differential.blue1 = iBlue1;
+
+ m_pencodingbitsRGB8->differential.dred2 = iDRed2;
+ m_pencodingbitsRGB8->differential.dgreen2 = iDGreen2;
+ m_pencodingbitsRGB8->differential.dblue2 = iDBlue2;
+
+ m_pencodingbitsRGB8->individual.cw1 = m_uiCW1;
+ m_pencodingbitsRGB8->individual.cw2 = m_uiCW2;
+
+ SetEncodingBits_Selectors();
+
+ // in RGB8A1 encoding bits, opaque replaces differential
+ m_pencodingbitsRGB8->differential.diff = !m_boolPunchThroughPixels;
+
+ m_pencodingbitsRGB8->individual.flip = m_boolFlip;
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state if T mode
+ //
+ void Block4x4Encoding_RGB8A1::SetEncodingBits_T(void)
+ {
+ static const bool SANITY_CHECK = true;
+
+ assert(m_mode == MODE_T);
+ assert(m_boolDiff == true);
+
+ unsigned int uiRed1 = (unsigned int)m_frgbaColor1.IntRed(15.0f);
+ unsigned int uiGreen1 = (unsigned int)m_frgbaColor1.IntGreen(15.0f);
+ unsigned int uiBlue1 = (unsigned int)m_frgbaColor1.IntBlue(15.0f);
+
+ unsigned int uiRed2 = (unsigned int)m_frgbaColor2.IntRed(15.0f);
+ unsigned int uiGreen2 = (unsigned int)m_frgbaColor2.IntGreen(15.0f);
+ unsigned int uiBlue2 = (unsigned int)m_frgbaColor2.IntBlue(15.0f);
+
+ m_pencodingbitsRGB8->t.red1a = uiRed1 >> 2;
+ m_pencodingbitsRGB8->t.red1b = uiRed1;
+ m_pencodingbitsRGB8->t.green1 = uiGreen1;
+ m_pencodingbitsRGB8->t.blue1 = uiBlue1;
+
+ m_pencodingbitsRGB8->t.red2 = uiRed2;
+ m_pencodingbitsRGB8->t.green2 = uiGreen2;
+ m_pencodingbitsRGB8->t.blue2 = uiBlue2;
+
+ m_pencodingbitsRGB8->t.da = m_uiCW1 >> 1;
+ m_pencodingbitsRGB8->t.db = m_uiCW1;
+
+ // in RGB8A1 encoding bits, opaque replaces differential
+ m_pencodingbitsRGB8->differential.diff = !m_boolPunchThroughPixels;
+
+ Block4x4Encoding_ETC1::SetEncodingBits_Selectors();
+
+ // create an invalid R differential to trigger T mode
+ m_pencodingbitsRGB8->t.detect1 = 0;
+ m_pencodingbitsRGB8->t.detect2 = 0;
+ int iRed2 = (int)m_pencodingbitsRGB8->differential.red1 + (int)m_pencodingbitsRGB8->differential.dred2;
+ if (iRed2 >= 4)
+ {
+ m_pencodingbitsRGB8->t.detect1 = 7;
+ m_pencodingbitsRGB8->t.detect2 = 0;
+ }
+ else
+ {
+ m_pencodingbitsRGB8->t.detect1 = 0;
+ m_pencodingbitsRGB8->t.detect2 = 1;
+ }
+
+ if (SANITY_CHECK)
+ {
+ iRed2 = (int)m_pencodingbitsRGB8->differential.red1 + (int)m_pencodingbitsRGB8->differential.dred2;
+
+ // make sure red overflows
+ assert(iRed2 < 0 || iRed2 > 31);
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state if H mode
+ //
+ // colors and selectors may need to swap in order to generate lsb of distance index
+ //
+ void Block4x4Encoding_RGB8A1::SetEncodingBits_H(void)
+ {
+ static const bool SANITY_CHECK = true;
+
+ assert(m_mode == MODE_H);
+ assert(m_boolDiff == true);
+
+ unsigned int uiRed1 = (unsigned int)m_frgbaColor1.IntRed(15.0f);
+ unsigned int uiGreen1 = (unsigned int)m_frgbaColor1.IntGreen(15.0f);
+ unsigned int uiBlue1 = (unsigned int)m_frgbaColor1.IntBlue(15.0f);
+
+ unsigned int uiRed2 = (unsigned int)m_frgbaColor2.IntRed(15.0f);
+ unsigned int uiGreen2 = (unsigned int)m_frgbaColor2.IntGreen(15.0f);
+ unsigned int uiBlue2 = (unsigned int)m_frgbaColor2.IntBlue(15.0f);
+
+ unsigned int uiColor1 = (uiRed1 << 16) + (uiGreen1 << 8) + uiBlue1;
+ unsigned int uiColor2 = (uiRed2 << 16) + (uiGreen2 << 8) + uiBlue2;
+
+ bool boolOddDistance = m_uiCW1 & 1;
+ bool boolSwapColors = (uiColor1 < uiColor2) ^ !boolOddDistance;
+
+ if (boolSwapColors)
+ {
+ m_pencodingbitsRGB8->h.red1 = uiRed2;
+ m_pencodingbitsRGB8->h.green1a = uiGreen2 >> 1;
+ m_pencodingbitsRGB8->h.green1b = uiGreen2;
+ m_pencodingbitsRGB8->h.blue1a = uiBlue2 >> 3;
+ m_pencodingbitsRGB8->h.blue1b = uiBlue2 >> 1;
+ m_pencodingbitsRGB8->h.blue1c = uiBlue2;
+
+ m_pencodingbitsRGB8->h.red2 = uiRed1;
+ m_pencodingbitsRGB8->h.green2a = uiGreen1 >> 1;
+ m_pencodingbitsRGB8->h.green2b = uiGreen1;
+ m_pencodingbitsRGB8->h.blue2 = uiBlue1;
+
+ m_pencodingbitsRGB8->h.da = m_uiCW1 >> 2;
+ m_pencodingbitsRGB8->h.db = m_uiCW1 >> 1;
+ }
+ else
+ {
+ m_pencodingbitsRGB8->h.red1 = uiRed1;
+ m_pencodingbitsRGB8->h.green1a = uiGreen1 >> 1;
+ m_pencodingbitsRGB8->h.green1b = uiGreen1;
+ m_pencodingbitsRGB8->h.blue1a = uiBlue1 >> 3;
+ m_pencodingbitsRGB8->h.blue1b = uiBlue1 >> 1;
+ m_pencodingbitsRGB8->h.blue1c = uiBlue1;
+
+ m_pencodingbitsRGB8->h.red2 = uiRed2;
+ m_pencodingbitsRGB8->h.green2a = uiGreen2 >> 1;
+ m_pencodingbitsRGB8->h.green2b = uiGreen2;
+ m_pencodingbitsRGB8->h.blue2 = uiBlue2;
+
+ m_pencodingbitsRGB8->h.da = m_uiCW1 >> 2;
+ m_pencodingbitsRGB8->h.db = m_uiCW1 >> 1;
+ }
+
+ // in RGB8A1 encoding bits, opaque replaces differential
+ m_pencodingbitsRGB8->differential.diff = !m_boolPunchThroughPixels;
+
+ Block4x4Encoding_ETC1::SetEncodingBits_Selectors();
+
+ if (boolSwapColors)
+ {
+ m_pencodingbitsRGB8->h.selectors ^= 0x0000FFFF;
+ }
+
+ // create an invalid R differential to trigger T mode
+ m_pencodingbitsRGB8->h.detect1 = 0;
+ m_pencodingbitsRGB8->h.detect2 = 0;
+ m_pencodingbitsRGB8->h.detect3 = 0;
+ int iRed2 = (int)m_pencodingbitsRGB8->differential.red1 + (int)m_pencodingbitsRGB8->differential.dred2;
+ int iGreen2 = (int)m_pencodingbitsRGB8->differential.green1 + (int)m_pencodingbitsRGB8->differential.dgreen2;
+ if (iRed2 < 0 || iRed2 > 31)
+ {
+ m_pencodingbitsRGB8->h.detect1 = 1;
+ }
+ if (iGreen2 >= 4)
+ {
+ m_pencodingbitsRGB8->h.detect2 = 7;
+ m_pencodingbitsRGB8->h.detect3 = 0;
+ }
+ else
+ {
+ m_pencodingbitsRGB8->h.detect2 = 0;
+ m_pencodingbitsRGB8->h.detect3 = 1;
+ }
+
+ if (SANITY_CHECK)
+ {
+ iRed2 = (int)m_pencodingbitsRGB8->differential.red1 + (int)m_pencodingbitsRGB8->differential.dred2;
+ iGreen2 = (int)m_pencodingbitsRGB8->differential.green1 + (int)m_pencodingbitsRGB8->differential.dgreen2;
+
+ // make sure red doesn't overflow and green does
+ assert(iRed2 >= 0 && iRed2 <= 31);
+ assert(iGreen2 < 0 || iGreen2 > 31);
+ }
+
+ }
+
+ // ####################################################################################################
+ // Block4x4Encoding_RGB8A1_Opaque
+ // ####################################################################################################
+
+ // ----------------------------------------------------------------------------------------------------
+ // perform a single encoding iteration
+ // replace the encoding if a better encoding was found
+ // subsequent iterations generally take longer for each iteration
+ // set m_boolDone if encoding is perfect or encoding is finished based on a_fEffort
+ //
+ void Block4x4Encoding_RGB8A1_Opaque::PerformIteration(float a_fEffort)
+ {
+ assert(!m_boolPunchThroughPixels);
+ assert(!m_boolTransparent);
+ assert(!m_boolDone);
+
+ switch (m_uiEncodingIterations)
+ {
+ case 0:
+ PerformFirstIteration();
+ break;
+
+ case 1:
+ Block4x4Encoding_ETC1::TryDifferential(m_boolMostLikelyFlip, 1, 0, 0);
+ break;
+
+ case 2:
+ Block4x4Encoding_ETC1::TryDifferential(!m_boolMostLikelyFlip, 1, 0, 0);
+ break;
+
+ case 3:
+ Block4x4Encoding_RGB8::TryPlanar(1);
+ break;
+
+ case 4:
+ Block4x4Encoding_RGB8::TryTAndH(1);
+ if (a_fEffort <= 49.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 5:
+ Block4x4Encoding_ETC1::TryDegenerates1();
+ if (a_fEffort <= 59.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 6:
+ Block4x4Encoding_ETC1::TryDegenerates2();
+ if (a_fEffort <= 69.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 7:
+ Block4x4Encoding_ETC1::TryDegenerates3();
+ if (a_fEffort <= 79.5f)
+ {
+ m_boolDone = true;
+ }
+ break;
+
+ case 8:
+ Block4x4Encoding_ETC1::TryDegenerates4();
+ m_boolDone = true;
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+ m_uiEncodingIterations++;
+ SetDoneIfPerfect();
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // find best initial encoding to ensure block has a valid encoding
+ //
+ void Block4x4Encoding_RGB8A1_Opaque::PerformFirstIteration(void)
+ {
+
+ // set decoded alphas
+ // calculate alpha error
+ m_fError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+
+ float fDeltaA = 1.0f - m_pafrgbaSource[uiPixel].fA;
+ m_fError += fDeltaA * fDeltaA;
+ }
+
+ CalculateMostLikelyFlip();
+
+ m_fError = FLT_MAX;
+
+ Block4x4Encoding_ETC1::TryDifferential(m_boolMostLikelyFlip, 0, 0, 0);
+ SetDoneIfPerfect();
+ if (m_boolDone)
+ {
+ return;
+ }
+ Block4x4Encoding_ETC1::TryDifferential(!m_boolMostLikelyFlip, 0, 0, 0);
+ SetDoneIfPerfect();
+ if (m_boolDone)
+ {
+ return;
+ }
+ Block4x4Encoding_RGB8::TryPlanar(0);
+ SetDoneIfPerfect();
+ if (m_boolDone)
+ {
+ return;
+ }
+ Block4x4Encoding_RGB8::TryTAndH(0);
+ SetDoneIfPerfect();
+ }
+
+ // ####################################################################################################
+ // Block4x4Encoding_RGB8A1_Transparent
+ // ####################################################################################################
+
+ // ----------------------------------------------------------------------------------------------------
+ // perform a single encoding iteration
+ // replace the encoding if a better encoding was found
+ // subsequent iterations generally take longer for each iteration
+ // set m_boolDone if encoding is perfect or encoding is finished based on a_fEffort
+ //
+ void Block4x4Encoding_RGB8A1_Transparent::PerformIteration(float )
+ {
+ assert(!m_boolOpaque);
+ assert(m_boolTransparent);
+ assert(!m_boolDone);
+ assert(m_uiEncodingIterations == 0);
+
+ m_mode = MODE_ETC1;
+ m_boolDiff = true;
+ m_boolFlip = false;
+
+ m_uiCW1 = 0;
+ m_uiCW2 = 0;
+
+ m_frgbaColor1 = ColorFloatRGBA();
+ m_frgbaColor2 = ColorFloatRGBA();
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiSelectors[uiPixel] = TRANSPARENT_SELECTOR;
+
+ m_afrgbaDecodedColors[uiPixel] = ColorFloatRGBA();
+ m_afDecodedAlphas[uiPixel] = 0.0f;
+ }
+
+ CalcBlockError();
+
+ m_boolDone = true;
+ m_uiEncodingIterations++;
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+}
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.h b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.h
new file mode 100644
index 0000000000..ff26e462f8
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcBlock4x4Encoding_RGB8.h"
+#include "EtcErrorMetric.h"
+#include "EtcBlock4x4EncodingBits.h"
+
+namespace Etc
+{
+
+ // ################################################################################
+ // Block4x4Encoding_RGB8A1
+ // RGB8A1 if not completely opaque or transparent
+ // ################################################################################
+
+ class Block4x4Encoding_RGB8A1 : public Block4x4Encoding_RGB8
+ {
+ public:
+
+ static const unsigned int TRANSPARENT_SELECTOR = 2;
+
+ Block4x4Encoding_RGB8A1(void);
+ virtual ~Block4x4Encoding_RGB8A1(void);
+
+ virtual void InitFromSource(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+ unsigned char *a_paucEncodingBits,
+ ErrorMetric a_errormetric);
+
+ virtual void InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric);
+
+ virtual void PerformIteration(float a_fEffort);
+
+ virtual void SetEncodingBits(void);
+
+ void InitFromEncodingBits_ETC1(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric);
+
+ void InitFromEncodingBits_T(void);
+ void InitFromEncodingBits_H(void);
+
+ void PerformFirstIteration(void);
+
+ void Decode_ETC1(void);
+ void DecodePixels_T(void);
+ void DecodePixels_H(void);
+ void SetEncodingBits_ETC1(void);
+ void SetEncodingBits_T(void);
+ void SetEncodingBits_H(void);
+
+ protected:
+
+ bool m_boolOpaque; // all source pixels have alpha >= 0.5
+ bool m_boolTransparent; // all source pixels have alpha < 0.5
+ bool m_boolPunchThroughPixels; // some source pixels have alpha < 0.5
+
+ static float s_aafCwOpaqueUnsetTable[CW_RANGES][SELECTORS];
+
+ private:
+
+ void TryDifferential(bool a_boolFlip, unsigned int a_uiRadius,
+ int a_iGrayOffset1, int a_iGrayOffset2);
+ void TryDifferentialHalf(DifferentialTrys::Half *a_phalf);
+
+ void TryT(unsigned int a_uiRadius);
+ void TryT_BestSelectorCombination(void);
+ void TryH(unsigned int a_uiRadius);
+ void TryH_BestSelectorCombination(void);
+
+ void TryDegenerates1(void);
+ void TryDegenerates2(void);
+ void TryDegenerates3(void);
+ void TryDegenerates4(void);
+
+ };
+
+ // ################################################################################
+ // Block4x4Encoding_RGB8A1_Opaque
+ // RGB8A1 if all pixels have alpha==1
+ // ################################################################################
+
+ class Block4x4Encoding_RGB8A1_Opaque : public Block4x4Encoding_RGB8A1
+ {
+ public:
+
+ virtual void PerformIteration(float a_fEffort);
+
+ void PerformFirstIteration(void);
+
+ private:
+
+ };
+
+ // ################################################################################
+ // Block4x4Encoding_RGB8A1_Transparent
+ // RGB8A1 if all pixels have alpha==0
+ // ################################################################################
+
+ class Block4x4Encoding_RGB8A1_Transparent : public Block4x4Encoding_RGB8A1
+ {
+ public:
+
+ virtual void PerformIteration(float a_fEffort);
+
+ private:
+
+ };
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGBA8.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGBA8.cpp
new file mode 100644
index 0000000000..600c7ab405
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGBA8.cpp
@@ -0,0 +1,474 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcBlock4x4Encoding_RGBA8.cpp contains:
+ Block4x4Encoding_RGBA8
+ Block4x4Encoding_RGBA8_Opaque
+ Block4x4Encoding_RGBA8_Transparent
+
+These encoders are used when targetting file format RGBA8.
+
+Block4x4Encoding_RGBA8_Opaque is used when all pixels in the 4x4 block are opaque
+Block4x4Encoding_RGBA8_Transparent is used when all pixels in the 4x4 block are transparent
+Block4x4Encoding_RGBA8 is used when there is a mixture of alphas in the 4x4 block
+
+*/
+
+#include "EtcConfig.h"
+#include "EtcBlock4x4Encoding_RGBA8.h"
+
+#include "EtcBlock4x4EncodingBits.h"
+#include "EtcBlock4x4.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <float.h>
+#include <limits>
+
+namespace Etc
+{
+
+ // ####################################################################################################
+ // Block4x4Encoding_RGBA8
+ // ####################################################################################################
+
+ float Block4x4Encoding_RGBA8::s_aafModifierTable[MODIFIER_TABLE_ENTRYS][ALPHA_SELECTORS]
+ {
+ { -3.0f / 255.0f, -6.0f / 255.0f, -9.0f / 255.0f, -15.0f / 255.0f, 2.0f / 255.0f, 5.0f / 255.0f, 8.0f / 255.0f, 14.0f / 255.0f },
+ { -3.0f / 255.0f, -7.0f / 255.0f, -10.0f / 255.0f, -13.0f / 255.0f, 2.0f / 255.0f, 6.0f / 255.0f, 9.0f / 255.0f, 12.0f / 255.0f },
+ { -2.0f / 255.0f, -5.0f / 255.0f, -8.0f / 255.0f, -13.0f / 255.0f, 1.0f / 255.0f, 4.0f / 255.0f, 7.0f / 255.0f, 12.0f / 255.0f },
+ { -2.0f / 255.0f, -4.0f / 255.0f, -6.0f / 255.0f, -13.0f / 255.0f, 1.0f / 255.0f, 3.0f / 255.0f, 5.0f / 255.0f, 12.0f / 255.0f },
+
+ { -3.0f / 255.0f, -6.0f / 255.0f, -8.0f / 255.0f, -12.0f / 255.0f, 2.0f / 255.0f, 5.0f / 255.0f, 7.0f / 255.0f, 11.0f / 255.0f },
+ { -3.0f / 255.0f, -7.0f / 255.0f, -9.0f / 255.0f, -11.0f / 255.0f, 2.0f / 255.0f, 6.0f / 255.0f, 8.0f / 255.0f, 10.0f / 255.0f },
+ { -4.0f / 255.0f, -7.0f / 255.0f, -8.0f / 255.0f, -11.0f / 255.0f, 3.0f / 255.0f, 6.0f / 255.0f, 7.0f / 255.0f, 10.0f / 255.0f },
+ { -3.0f / 255.0f, -5.0f / 255.0f, -8.0f / 255.0f, -11.0f / 255.0f, 2.0f / 255.0f, 4.0f / 255.0f, 7.0f / 255.0f, 10.0f / 255.0f },
+
+ { -2.0f / 255.0f, -6.0f / 255.0f, -8.0f / 255.0f, -10.0f / 255.0f, 1.0f / 255.0f, 5.0f / 255.0f, 7.0f / 255.0f, 9.0f / 255.0f },
+ { -2.0f / 255.0f, -5.0f / 255.0f, -8.0f / 255.0f, -10.0f / 255.0f, 1.0f / 255.0f, 4.0f / 255.0f, 7.0f / 255.0f, 9.0f / 255.0f },
+ { -2.0f / 255.0f, -4.0f / 255.0f, -8.0f / 255.0f, -10.0f / 255.0f, 1.0f / 255.0f, 3.0f / 255.0f, 7.0f / 255.0f, 9.0f / 255.0f },
+ { -2.0f / 255.0f, -5.0f / 255.0f, -7.0f / 255.0f, -10.0f / 255.0f, 1.0f / 255.0f, 4.0f / 255.0f, 6.0f / 255.0f, 9.0f / 255.0f },
+
+ { -3.0f / 255.0f, -4.0f / 255.0f, -7.0f / 255.0f, -10.0f / 255.0f, 2.0f / 255.0f, 3.0f / 255.0f, 6.0f / 255.0f, 9.0f / 255.0f },
+ { -1.0f / 255.0f, -2.0f / 255.0f, -3.0f / 255.0f, -10.0f / 255.0f, 0.0f / 255.0f, 1.0f / 255.0f, 2.0f / 255.0f, 9.0f / 255.0f },
+ { -4.0f / 255.0f, -6.0f / 255.0f, -8.0f / 255.0f, -9.0f / 255.0f, 3.0f / 255.0f, 5.0f / 255.0f, 7.0f / 255.0f, 8.0f / 255.0f },
+ { -3.0f / 255.0f, -5.0f / 255.0f, -7.0f / 255.0f, -9.0f / 255.0f, 2.0f / 255.0f, 4.0f / 255.0f, 6.0f / 255.0f, 8.0f / 255.0f }
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ Block4x4Encoding_RGBA8::Block4x4Encoding_RGBA8(void)
+ {
+
+ m_pencodingbitsA8 = nullptr;
+
+ }
+ Block4x4Encoding_RGBA8::~Block4x4Encoding_RGBA8(void) {}
+ // ----------------------------------------------------------------------------------------------------
+ // initialization prior to encoding
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // a_pafrgbaSource points to a 4x4 block subset of the source image
+ // a_paucEncodingBits points to the final encoding bits
+ //
+ void Block4x4Encoding_RGBA8::InitFromSource(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+ unsigned char *a_paucEncodingBits, ErrorMetric a_errormetric)
+ {
+ Block4x4Encoding::Init(a_pblockParent, a_pafrgbaSource,a_errormetric);
+
+ m_pencodingbitsA8 = (Block4x4EncodingBits_A8 *)a_paucEncodingBits;
+ m_pencodingbitsRGB8 = (Block4x4EncodingBits_RGB8 *)(a_paucEncodingBits + sizeof(Block4x4EncodingBits_A8));
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // initialization from the encoding bits of a previous encoding
+ // a_pblockParent points to the block associated with this encoding
+ // a_errormetric is used to choose the best encoding
+ // a_pafrgbaSource points to a 4x4 block subset of the source image
+ // a_paucEncodingBits points to the final encoding bits of a previous encoding
+ //
+ void Block4x4Encoding_RGBA8::InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric)
+ {
+
+ m_pencodingbitsA8 = (Block4x4EncodingBits_A8 *)a_paucEncodingBits;
+ m_pencodingbitsRGB8 = (Block4x4EncodingBits_RGB8 *)(a_paucEncodingBits + sizeof(Block4x4EncodingBits_A8));
+
+ // init RGB portion
+ Block4x4Encoding_RGB8::InitFromEncodingBits(a_pblockParent,
+ (unsigned char *) m_pencodingbitsRGB8,
+ a_pafrgbaSource,
+ a_errormetric);
+
+ // init A8 portion
+ // has to be done after InitFromEncodingBits()
+ {
+ m_fBase = m_pencodingbitsA8->data.base / 255.0f;
+ m_fMultiplier = (float)m_pencodingbitsA8->data.multiplier;
+ m_uiModifierTableIndex = m_pencodingbitsA8->data.table;
+
+ unsigned long long int ulliSelectorBits = 0;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsA8->data.selectors0 << 40;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsA8->data.selectors1 << 32;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsA8->data.selectors2 << 24;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsA8->data.selectors3 << 16;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsA8->data.selectors4 << 8;
+ ulliSelectorBits |= (unsigned long long int)m_pencodingbitsA8->data.selectors5;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ unsigned int uiShift = 45 - (3 * uiPixel);
+ m_auiAlphaSelectors[uiPixel] = (ulliSelectorBits >> uiShift) & (ALPHA_SELECTORS - 1);
+ }
+
+ // decode the alphas
+ // calc alpha error
+ m_fError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afDecodedAlphas[uiPixel] = DecodePixelAlpha(m_fBase, m_fMultiplier,
+ m_uiModifierTableIndex,
+ m_auiAlphaSelectors[uiPixel]);
+
+ float fDeltaAlpha = m_afDecodedAlphas[uiPixel] - m_pafrgbaSource[uiPixel].fA;
+ m_fError += fDeltaAlpha * fDeltaAlpha;
+ }
+ }
+
+ // redo error calc to include alpha
+ CalcBlockError();
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // perform a single encoding iteration
+ // replace the encoding if a better encoding was found
+ // subsequent iterations generally take longer for each iteration
+ // set m_boolDone if encoding is perfect or encoding is finished based on a_fEffort
+ //
+ // similar to Block4x4Encoding_RGB8_Base::Encode_RGB8(), but with alpha added
+ //
+ void Block4x4Encoding_RGBA8::PerformIteration(float a_fEffort)
+ {
+ assert(!m_boolDone);
+
+ if (m_uiEncodingIterations == 0)
+ {
+ if (a_fEffort < 24.9f)
+ {
+ CalculateA8(0.0f);
+ }
+ else if (a_fEffort < 49.9f)
+ {
+ CalculateA8(1.0f);
+ }
+ else
+ {
+ CalculateA8(2.0f);
+ }
+ }
+
+ Block4x4Encoding_RGB8::PerformIteration(a_fEffort);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // find the best combination of base alpga, multiplier and selectors
+ //
+ // a_fRadius limits the range of base alpha to try
+ //
+ void Block4x4Encoding_RGBA8::CalculateA8(float a_fRadius)
+ {
+
+ // find min/max alpha
+ float fMinAlpha = 1.0f;
+ float fMaxAlpha = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ float fAlpha = m_pafrgbaSource[uiPixel].fA;
+
+ // ignore border pixels
+ if (isnan(fAlpha))
+ {
+ continue;
+ }
+
+ if (fAlpha < fMinAlpha)
+ {
+ fMinAlpha = fAlpha;
+ }
+ if (fAlpha > fMaxAlpha)
+ {
+ fMaxAlpha = fAlpha;
+ }
+ }
+ assert(fMinAlpha <= fMaxAlpha);
+
+ float fAlphaRange = fMaxAlpha - fMinAlpha;
+
+ // try each modifier table entry
+ m_fError = FLT_MAX; // artificially high value
+ for (unsigned int uiTableEntry = 0; uiTableEntry < MODIFIER_TABLE_ENTRYS; uiTableEntry++)
+ {
+ static const unsigned int MIN_VALUE_SELECTOR = 3;
+ static const unsigned int MAX_VALUE_SELECTOR = 7;
+
+ float fTableEntryCenter = -s_aafModifierTable[uiTableEntry][MIN_VALUE_SELECTOR];
+
+ float fTableEntryRange = s_aafModifierTable[uiTableEntry][MAX_VALUE_SELECTOR] -
+ s_aafModifierTable[uiTableEntry][MIN_VALUE_SELECTOR];
+
+ float fCenterRatio = fTableEntryCenter / fTableEntryRange;
+
+ float fCenter = fMinAlpha + fCenterRatio*fAlphaRange;
+ fCenter = roundf(255.0f * fCenter) / 255.0f;
+
+ float fMinBase = fCenter - (a_fRadius / 255.0f);
+ if (fMinBase < 0.0f)
+ {
+ fMinBase = 0.0f;
+ }
+
+ float fMaxBase = fCenter + (a_fRadius / 255.0f);
+ if (fMaxBase > 1.0f)
+ {
+ fMaxBase = 1.0f;
+ }
+
+ for (float fBase = fMinBase; fBase <= fMaxBase; fBase += (0.999999f / 255.0f))
+ {
+
+ float fRangeMultiplier = roundf(fAlphaRange / fTableEntryRange);
+
+ float fMinMultiplier = fRangeMultiplier - a_fRadius;
+ if (fMinMultiplier < 1.0f)
+ {
+ fMinMultiplier = 1.0f;
+ }
+ else if (fMinMultiplier > 15.0f)
+ {
+ fMinMultiplier = 15.0f;
+ }
+
+ float fMaxMultiplier = fRangeMultiplier + a_fRadius;
+ if (fMaxMultiplier < 1.0f)
+ {
+ fMaxMultiplier = 1.0f;
+ }
+ else if (fMaxMultiplier > 15.0f)
+ {
+ fMaxMultiplier = 15.0f;
+ }
+
+ for (float fMultiplier = fMinMultiplier; fMultiplier <= fMaxMultiplier; fMultiplier += 1.0f)
+ {
+ // find best selector for each pixel
+ unsigned int auiBestSelectors[PIXELS];
+ float afBestAlphaError[PIXELS];
+ float afBestDecodedAlphas[PIXELS];
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ float fBestPixelAlphaError = FLT_MAX;
+ for (unsigned int uiSelector = 0; uiSelector < ALPHA_SELECTORS; uiSelector++)
+ {
+ float fDecodedAlpha = DecodePixelAlpha(fBase, fMultiplier, uiTableEntry, uiSelector);
+
+ // border pixels (NAN) should have zero error
+ float fPixelDeltaAlpha = isnan(m_pafrgbaSource[uiPixel].fA) ?
+ 0.0f :
+ fDecodedAlpha - m_pafrgbaSource[uiPixel].fA;
+
+ float fPixelAlphaError = fPixelDeltaAlpha * fPixelDeltaAlpha;
+
+ if (fPixelAlphaError < fBestPixelAlphaError)
+ {
+ fBestPixelAlphaError = fPixelAlphaError;
+ auiBestSelectors[uiPixel] = uiSelector;
+ afBestAlphaError[uiPixel] = fBestPixelAlphaError;
+ afBestDecodedAlphas[uiPixel] = fDecodedAlpha;
+ }
+ }
+ }
+
+ float fBlockError = 0.0f;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ fBlockError += afBestAlphaError[uiPixel];
+ }
+
+ if (fBlockError < m_fError)
+ {
+ m_fError = fBlockError;
+
+ m_fBase = fBase;
+ m_fMultiplier = fMultiplier;
+ m_uiModifierTableIndex = uiTableEntry;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_auiAlphaSelectors[uiPixel] = auiBestSelectors[uiPixel];
+ m_afDecodedAlphas[uiPixel] = afBestDecodedAlphas[uiPixel];
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state
+ //
+ void Block4x4Encoding_RGBA8::SetEncodingBits(void)
+ {
+
+ // set the RGB8 portion
+ Block4x4Encoding_RGB8::SetEncodingBits();
+
+ // set the A8 portion
+ {
+ m_pencodingbitsA8->data.base = (unsigned char)roundf(255.0f * m_fBase);
+ m_pencodingbitsA8->data.table = m_uiModifierTableIndex;
+ m_pencodingbitsA8->data.multiplier = (unsigned char)roundf(m_fMultiplier);
+
+ unsigned long long int ulliSelectorBits = 0;
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ unsigned int uiShift = 45 - (3 * uiPixel);
+ ulliSelectorBits |= ((unsigned long long int)m_auiAlphaSelectors[uiPixel]) << uiShift;
+ }
+
+ m_pencodingbitsA8->data.selectors0 = ulliSelectorBits >> 40;
+ m_pencodingbitsA8->data.selectors1 = ulliSelectorBits >> 32;
+ m_pencodingbitsA8->data.selectors2 = ulliSelectorBits >> 24;
+ m_pencodingbitsA8->data.selectors3 = ulliSelectorBits >> 16;
+ m_pencodingbitsA8->data.selectors4 = ulliSelectorBits >> 8;
+ m_pencodingbitsA8->data.selectors5 = ulliSelectorBits;
+ }
+
+ }
+
+ // ####################################################################################################
+ // Block4x4Encoding_RGBA8_Opaque
+ // ####################################################################################################
+
+ // ----------------------------------------------------------------------------------------------------
+ // perform a single encoding iteration
+ // replace the encoding if a better encoding was found
+ // subsequent iterations generally take longer for each iteration
+ // set m_boolDone if encoding is perfect or encoding is finished based on a_fEffort
+ //
+ void Block4x4Encoding_RGBA8_Opaque::PerformIteration(float a_fEffort)
+ {
+ assert(!m_boolDone);
+
+ if (m_uiEncodingIterations == 0)
+ {
+ m_fError = 0.0f;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afDecodedAlphas[uiPixel] = 1.0f;
+ }
+ }
+
+ Block4x4Encoding_RGB8::PerformIteration(a_fEffort);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state
+ //
+ void Block4x4Encoding_RGBA8_Opaque::SetEncodingBits(void)
+ {
+
+ // set the RGB8 portion
+ Block4x4Encoding_RGB8::SetEncodingBits();
+
+ // set the A8 portion
+ m_pencodingbitsA8->data.base = 255;
+ m_pencodingbitsA8->data.table = 15;
+ m_pencodingbitsA8->data.multiplier = 15;
+ m_pencodingbitsA8->data.selectors0 = 0xFF;
+ m_pencodingbitsA8->data.selectors1 = 0xFF;
+ m_pencodingbitsA8->data.selectors2 = 0xFF;
+ m_pencodingbitsA8->data.selectors3 = 0xFF;
+ m_pencodingbitsA8->data.selectors4 = 0xFF;
+ m_pencodingbitsA8->data.selectors5 = 0xFF;
+
+ }
+
+ // ####################################################################################################
+ // Block4x4Encoding_RGBA8_Transparent
+ // ####################################################################################################
+
+ // ----------------------------------------------------------------------------------------------------
+ // perform a single encoding iteration
+ // replace the encoding if a better encoding was found
+ // subsequent iterations generally take longer for each iteration
+ // set m_boolDone if encoding is perfect or encoding is finished based on a_fEffort
+ //
+ void Block4x4Encoding_RGBA8_Transparent::PerformIteration(float )
+ {
+ assert(!m_boolDone);
+ assert(m_uiEncodingIterations == 0);
+
+ m_mode = MODE_ETC1;
+ m_boolDiff = true;
+ m_boolFlip = false;
+
+ for (unsigned int uiPixel = 0; uiPixel < PIXELS; uiPixel++)
+ {
+ m_afrgbaDecodedColors[uiPixel] = ColorFloatRGBA();
+ m_afDecodedAlphas[uiPixel] = 0.0f;
+ }
+
+ m_fError = 0.0f;
+
+ m_boolDone = true;
+ m_uiEncodingIterations++;
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits based on encoding state
+ //
+ void Block4x4Encoding_RGBA8_Transparent::SetEncodingBits(void)
+ {
+
+ Block4x4Encoding_RGB8::SetEncodingBits();
+
+ // set the A8 portion
+ m_pencodingbitsA8->data.base = 0;
+ m_pencodingbitsA8->data.table = 0;
+ m_pencodingbitsA8->data.multiplier = 1;
+ m_pencodingbitsA8->data.selectors0 = 0;
+ m_pencodingbitsA8->data.selectors1 = 0;
+ m_pencodingbitsA8->data.selectors2 = 0;
+ m_pencodingbitsA8->data.selectors3 = 0;
+ m_pencodingbitsA8->data.selectors4 = 0;
+ m_pencodingbitsA8->data.selectors5 = 0;
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+}
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGBA8.h b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGBA8.h
new file mode 100644
index 0000000000..5765d36b90
--- /dev/null
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGBA8.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcBlock4x4Encoding_RGB8.h"
+
+namespace Etc
+{
+ class Block4x4EncodingBits_A8;
+
+ // ################################################################################
+ // Block4x4Encoding_RGBA8
+ // RGBA8 if not completely opaque or transparent
+ // ################################################################################
+
+ class Block4x4Encoding_RGBA8 : public Block4x4Encoding_RGB8
+ {
+ public:
+
+ Block4x4Encoding_RGBA8(void);
+ virtual ~Block4x4Encoding_RGBA8(void);
+
+ virtual void InitFromSource(Block4x4 *a_pblockParent,
+ ColorFloatRGBA *a_pafrgbaSource,
+ unsigned char *a_paucEncodingBits, ErrorMetric a_errormetric);
+
+ virtual void InitFromEncodingBits(Block4x4 *a_pblockParent,
+ unsigned char *a_paucEncodingBits,
+ ColorFloatRGBA *a_pafrgbaSource,
+ ErrorMetric a_errormetric);
+
+ virtual void PerformIteration(float a_fEffort);
+
+ virtual void SetEncodingBits(void);
+
+ protected:
+
+ static const unsigned int MODIFIER_TABLE_ENTRYS = 16;
+ static const unsigned int ALPHA_SELECTOR_BITS = 3;
+ static const unsigned int ALPHA_SELECTORS = 1 << ALPHA_SELECTOR_BITS;
+
+ static float s_aafModifierTable[MODIFIER_TABLE_ENTRYS][ALPHA_SELECTORS];
+
+ void CalculateA8(float a_fRadius);
+
+ Block4x4EncodingBits_A8 *m_pencodingbitsA8; // A8 portion of Block4x4EncodingBits_RGBA8
+
+ float m_fBase;
+ float m_fMultiplier;
+ unsigned int m_uiModifierTableIndex;
+ unsigned int m_auiAlphaSelectors[PIXELS];
+
+ private:
+
+ inline float DecodePixelAlpha(float a_fBase, float a_fMultiplier,
+ unsigned int a_uiTableIndex, unsigned int a_uiSelector)
+ {
+ float fPixelAlpha = a_fBase +
+ a_fMultiplier*s_aafModifierTable[a_uiTableIndex][a_uiSelector];
+ if (fPixelAlpha < 0.0f)
+ {
+ fPixelAlpha = 0.0f;
+ }
+ else if (fPixelAlpha > 1.0f)
+ {
+ fPixelAlpha = 1.0f;
+ }
+
+ return fPixelAlpha;
+ }
+
+ };
+
+ // ################################################################################
+ // Block4x4Encoding_RGBA8_Opaque
+ // RGBA8 if all pixels have alpha==1
+ // ################################################################################
+
+ class Block4x4Encoding_RGBA8_Opaque : public Block4x4Encoding_RGBA8
+ {
+ public:
+
+ virtual void PerformIteration(float a_fEffort);
+
+ virtual void SetEncodingBits(void);
+
+ };
+
+ // ################################################################################
+ // Block4x4Encoding_RGBA8_Transparent
+ // RGBA8 if all pixels have alpha==0
+ // ################################################################################
+
+ class Block4x4Encoding_RGBA8_Transparent : public Block4x4Encoding_RGBA8
+ {
+ public:
+
+ virtual void PerformIteration(float a_fEffort);
+
+ virtual void SetEncodingBits(void);
+
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcColor.h b/thirdparty/etc2comp/EtcColor.h
new file mode 100644
index 0000000000..7ceae05b65
--- /dev/null
+++ b/thirdparty/etc2comp/EtcColor.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <math.h>
+
+namespace Etc
+{
+
+ inline float LogToLinear(float a_fLog)
+ {
+ static const float ALPHA = 0.055f;
+ static const float ONE_PLUS_ALPHA = 1.0f + ALPHA;
+
+ if (a_fLog <= 0.04045f)
+ {
+ return a_fLog / 12.92f;
+ }
+ else
+ {
+ return powf((a_fLog + ALPHA) / ONE_PLUS_ALPHA, 2.4f);
+ }
+ }
+
+ inline float LinearToLog(float &a_fLinear)
+ {
+ static const float ALPHA = 0.055f;
+ static const float ONE_PLUS_ALPHA = 1.0f + ALPHA;
+
+ if (a_fLinear <= 0.0031308f)
+ {
+ return 12.92f * a_fLinear;
+ }
+ else
+ {
+ return ONE_PLUS_ALPHA * powf(a_fLinear, (1.0f/2.4f)) - ALPHA;
+ }
+ }
+
+ class ColorR8G8B8A8
+ {
+ public:
+
+ unsigned char ucR;
+ unsigned char ucG;
+ unsigned char ucB;
+ unsigned char ucA;
+
+ };
+}
diff --git a/thirdparty/etc2comp/EtcColorFloatRGBA.h b/thirdparty/etc2comp/EtcColorFloatRGBA.h
new file mode 100644
index 0000000000..f2ca2c1f71
--- /dev/null
+++ b/thirdparty/etc2comp/EtcColorFloatRGBA.h
@@ -0,0 +1,321 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcConfig.h"
+#include "EtcColor.h"
+
+#include <math.h>
+
+namespace Etc
+{
+
+ class ColorFloatRGBA
+ {
+ public:
+
+ ColorFloatRGBA(void)
+ {
+ fR = fG = fB = fA = 0.0f;
+ }
+
+ ColorFloatRGBA(float a_fR, float a_fG, float a_fB, float a_fA)
+ {
+ fR = a_fR;
+ fG = a_fG;
+ fB = a_fB;
+ fA = a_fA;
+ }
+
+ inline ColorFloatRGBA operator+(ColorFloatRGBA& a_rfrgba)
+ {
+ ColorFloatRGBA frgba;
+ frgba.fR = fR + a_rfrgba.fR;
+ frgba.fG = fG + a_rfrgba.fG;
+ frgba.fB = fB + a_rfrgba.fB;
+ frgba.fA = fA + a_rfrgba.fA;
+ return frgba;
+ }
+
+ inline ColorFloatRGBA operator+(float a_f)
+ {
+ ColorFloatRGBA frgba;
+ frgba.fR = fR + a_f;
+ frgba.fG = fG + a_f;
+ frgba.fB = fB + a_f;
+ frgba.fA = fA;
+ return frgba;
+ }
+
+ inline ColorFloatRGBA operator-(float a_f)
+ {
+ ColorFloatRGBA frgba;
+ frgba.fR = fR - a_f;
+ frgba.fG = fG - a_f;
+ frgba.fB = fB - a_f;
+ frgba.fA = fA;
+ return frgba;
+ }
+
+ inline ColorFloatRGBA operator-(ColorFloatRGBA& a_rfrgba)
+ {
+ ColorFloatRGBA frgba;
+ frgba.fR = fR - a_rfrgba.fR;
+ frgba.fG = fG - a_rfrgba.fG;
+ frgba.fB = fB - a_rfrgba.fB;
+ frgba.fA = fA - a_rfrgba.fA;
+ return frgba;
+ }
+
+ inline ColorFloatRGBA operator*(float a_f)
+ {
+ ColorFloatRGBA frgba;
+ frgba.fR = fR * a_f;
+ frgba.fG = fG * a_f;
+ frgba.fB = fB * a_f;
+ frgba.fA = fA;
+
+ return frgba;
+ }
+
+ inline ColorFloatRGBA ScaleRGB(float a_f)
+ {
+ ColorFloatRGBA frgba;
+ frgba.fR = a_f * fR;
+ frgba.fG = a_f * fG;
+ frgba.fB = a_f * fB;
+ frgba.fA = fA;
+
+ return frgba;
+ }
+
+ inline ColorFloatRGBA RoundRGB(void)
+ {
+ ColorFloatRGBA frgba;
+ frgba.fR = roundf(fR);
+ frgba.fG = roundf(fG);
+ frgba.fB = roundf(fB);
+
+ return frgba;
+ }
+
+ inline ColorFloatRGBA ToLinear()
+ {
+ ColorFloatRGBA frgbaLinear;
+ frgbaLinear.fR = LogToLinear(fR);
+ frgbaLinear.fG = LogToLinear(fG);
+ frgbaLinear.fB = LogToLinear(fB);
+ frgbaLinear.fA = fA;
+
+ return frgbaLinear;
+ }
+
+ inline ColorFloatRGBA ToLog(void)
+ {
+ ColorFloatRGBA frgbaLog;
+ frgbaLog.fR = LinearToLog(fR);
+ frgbaLog.fG = LinearToLog(fG);
+ frgbaLog.fB = LinearToLog(fB);
+ frgbaLog.fA = fA;
+
+ return frgbaLog;
+ }
+
+ inline static ColorFloatRGBA ConvertFromRGBA8(unsigned char a_ucR,
+ unsigned char a_ucG, unsigned char a_ucB, unsigned char a_ucA)
+ {
+ ColorFloatRGBA frgba;
+
+ frgba.fR = (float)a_ucR / 255.0f;
+ frgba.fG = (float)a_ucG / 255.0f;
+ frgba.fB = (float)a_ucB / 255.0f;
+ frgba.fA = (float)a_ucA / 255.0f;
+
+ return frgba;
+ }
+
+ inline static ColorFloatRGBA ConvertFromRGB4(unsigned char a_ucR4,
+ unsigned char a_ucG4,
+ unsigned char a_ucB4)
+ {
+ ColorFloatRGBA frgba;
+
+ unsigned char ucR8 = (unsigned char)((a_ucR4 << 4) + a_ucR4);
+ unsigned char ucG8 = (unsigned char)((a_ucG4 << 4) + a_ucG4);
+ unsigned char ucB8 = (unsigned char)((a_ucB4 << 4) + a_ucB4);
+
+ frgba.fR = (float)ucR8 / 255.0f;
+ frgba.fG = (float)ucG8 / 255.0f;
+ frgba.fB = (float)ucB8 / 255.0f;
+ frgba.fA = 1.0f;
+
+ return frgba;
+ }
+
+ inline static ColorFloatRGBA ConvertFromRGB5(unsigned char a_ucR5,
+ unsigned char a_ucG5,
+ unsigned char a_ucB5)
+ {
+ ColorFloatRGBA frgba;
+
+ unsigned char ucR8 = (unsigned char)((a_ucR5 << 3) + (a_ucR5 >> 2));
+ unsigned char ucG8 = (unsigned char)((a_ucG5 << 3) + (a_ucG5 >> 2));
+ unsigned char ucB8 = (unsigned char)((a_ucB5 << 3) + (a_ucB5 >> 2));
+
+ frgba.fR = (float)ucR8 / 255.0f;
+ frgba.fG = (float)ucG8 / 255.0f;
+ frgba.fB = (float)ucB8 / 255.0f;
+ frgba.fA = 1.0f;
+
+ return frgba;
+ }
+
+ inline static ColorFloatRGBA ConvertFromR6G7B6(unsigned char a_ucR6,
+ unsigned char a_ucG7,
+ unsigned char a_ucB6)
+ {
+ ColorFloatRGBA frgba;
+
+ unsigned char ucR8 = (unsigned char)((a_ucR6 << 2) + (a_ucR6 >> 4));
+ unsigned char ucG8 = (unsigned char)((a_ucG7 << 1) + (a_ucG7 >> 6));
+ unsigned char ucB8 = (unsigned char)((a_ucB6 << 2) + (a_ucB6 >> 4));
+
+ frgba.fR = (float)ucR8 / 255.0f;
+ frgba.fG = (float)ucG8 / 255.0f;
+ frgba.fB = (float)ucB8 / 255.0f;
+ frgba.fA = 1.0f;
+
+ return frgba;
+ }
+
+ // quantize to 4 bits, expand to 8 bits
+ inline ColorFloatRGBA QuantizeR4G4B4(void) const
+ {
+ ColorFloatRGBA frgba = *this;
+
+ // quantize to 4 bits
+ frgba = frgba.ClampRGB().ScaleRGB(15.0f).RoundRGB();
+ unsigned int uiR4 = (unsigned int)frgba.fR;
+ unsigned int uiG4 = (unsigned int)frgba.fG;
+ unsigned int uiB4 = (unsigned int)frgba.fB;
+
+ // expand to 8 bits
+ frgba.fR = (float) ((uiR4 << 4) + uiR4);
+ frgba.fG = (float) ((uiG4 << 4) + uiG4);
+ frgba.fB = (float) ((uiB4 << 4) + uiB4);
+
+ frgba = frgba.ScaleRGB(1.0f/255.0f);
+
+ return frgba;
+ }
+
+ // quantize to 5 bits, expand to 8 bits
+ inline ColorFloatRGBA QuantizeR5G5B5(void) const
+ {
+ ColorFloatRGBA frgba = *this;
+
+ // quantize to 5 bits
+ frgba = frgba.ClampRGB().ScaleRGB(31.0f).RoundRGB();
+ unsigned int uiR5 = (unsigned int)frgba.fR;
+ unsigned int uiG5 = (unsigned int)frgba.fG;
+ unsigned int uiB5 = (unsigned int)frgba.fB;
+
+ // expand to 8 bits
+ frgba.fR = (float)((uiR5 << 3) + (uiR5 >> 2));
+ frgba.fG = (float)((uiG5 << 3) + (uiG5 >> 2));
+ frgba.fB = (float)((uiB5 << 3) + (uiB5 >> 2));
+
+ frgba = frgba.ScaleRGB(1.0f / 255.0f);
+
+ return frgba;
+ }
+
+ // quantize to 6/7/6 bits, expand to 8 bits
+ inline ColorFloatRGBA QuantizeR6G7B6(void) const
+ {
+ ColorFloatRGBA frgba = *this;
+
+ // quantize to 6/7/6 bits
+ ColorFloatRGBA frgba6 = frgba.ClampRGB().ScaleRGB(63.0f).RoundRGB();
+ ColorFloatRGBA frgba7 = frgba.ClampRGB().ScaleRGB(127.0f).RoundRGB();
+ unsigned int uiR6 = (unsigned int)frgba6.fR;
+ unsigned int uiG7 = (unsigned int)frgba7.fG;
+ unsigned int uiB6 = (unsigned int)frgba6.fB;
+
+ // expand to 8 bits
+ frgba.fR = (float)((uiR6 << 2) + (uiR6 >> 4));
+ frgba.fG = (float)((uiG7 << 1) + (uiG7 >> 6));
+ frgba.fB = (float)((uiB6 << 2) + (uiB6 >> 4));
+
+ frgba = frgba.ScaleRGB(1.0f / 255.0f);
+
+ return frgba;
+ }
+
+ inline ColorFloatRGBA ClampRGB(void)
+ {
+ ColorFloatRGBA frgba = *this;
+ if (frgba.fR < 0.0f) { frgba.fR = 0.0f; }
+ if (frgba.fR > 1.0f) { frgba.fR = 1.0f; }
+ if (frgba.fG < 0.0f) { frgba.fG = 0.0f; }
+ if (frgba.fG > 1.0f) { frgba.fG = 1.0f; }
+ if (frgba.fB < 0.0f) { frgba.fB = 0.0f; }
+ if (frgba.fB > 1.0f) { frgba.fB = 1.0f; }
+
+ return frgba;
+ }
+
+ inline ColorFloatRGBA ClampRGBA(void)
+ {
+ ColorFloatRGBA frgba = *this;
+ if (frgba.fR < 0.0f) { frgba.fR = 0.0f; }
+ if (frgba.fR > 1.0f) { frgba.fR = 1.0f; }
+ if (frgba.fG < 0.0f) { frgba.fG = 0.0f; }
+ if (frgba.fG > 1.0f) { frgba.fG = 1.0f; }
+ if (frgba.fB < 0.0f) { frgba.fB = 0.0f; }
+ if (frgba.fB > 1.0f) { frgba.fB = 1.0f; }
+ if (frgba.fA < 0.0f) { frgba.fA = 0.0f; }
+ if (frgba.fA > 1.0f) { frgba.fA = 1.0f; }
+
+ return frgba;
+ }
+
+ inline int IntRed(float a_fScale)
+ {
+ return (int)roundf(fR * a_fScale);
+ }
+
+ inline int IntGreen(float a_fScale)
+ {
+ return (int)roundf(fG * a_fScale);
+ }
+
+ inline int IntBlue(float a_fScale)
+ {
+ return (int)roundf(fB * a_fScale);
+ }
+
+ inline int IntAlpha(float a_fScale)
+ {
+ return (int)roundf(fA * a_fScale);
+ }
+
+ float fR, fG, fB, fA;
+ };
+
+}
+
diff --git a/thirdparty/etc2comp/EtcConfig.h b/thirdparty/etc2comp/EtcConfig.h
new file mode 100644
index 0000000000..3bfe1d99a8
--- /dev/null
+++ b/thirdparty/etc2comp/EtcConfig.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#ifdef _WIN32
+#define ETC_WINDOWS (1)
+#else
+#define ETC_WINDOWS (0)
+#endif
+
+#if __APPLE__
+#define ETC_OSX (1)
+#else
+#define ETC_OSX (0)
+#endif
+
+#if __unix__
+#define ETC_UNIX (1)
+#else
+#define ETC_UNIX (0)
+#endif
+
+
+// short names for common types
+#include <stdint.h>
+typedef int8_t i8;
+typedef int16_t i16;
+typedef int32_t i32;
+typedef int64_t i64;
+
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+
+typedef float f32;
+typedef double f64;
+
+// Keep asserts enabled in release builds during development
+#undef NDEBUG
+
+// 0=disable. stb_image can be used if you need to compress
+//other image formats like jpg
+#define USE_STB_IMAGE_LOAD 0
+
+#if ETC_WINDOWS
+#include <sdkddkver.h>
+#define _CRT_SECURE_NO_WARNINGS (1)
+#include <tchar.h>
+#endif
+
+#include <stdio.h>
+
diff --git a/thirdparty/etc2comp/EtcDifferentialTrys.cpp b/thirdparty/etc2comp/EtcDifferentialTrys.cpp
new file mode 100644
index 0000000000..ef4cd103d9
--- /dev/null
+++ b/thirdparty/etc2comp/EtcDifferentialTrys.cpp
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcDifferentialTrys.cpp
+
+Gathers the results of the various encoding trys for both halves of a 4x4 block for Differential mode
+
+*/
+
+#include "EtcConfig.h"
+#include "EtcDifferentialTrys.h"
+
+#include <assert.h>
+
+namespace Etc
+{
+
+ // ----------------------------------------------------------------------------------------------------
+ // construct a list of trys (encoding attempts)
+ //
+ // a_frgbaColor1 is the basecolor for the first half
+ // a_frgbaColor2 is the basecolor for the second half
+ // a_pauiPixelMapping1 is the pixel order for the first half
+ // a_pauiPixelMapping2 is the pixel order for the second half
+ // a_uiRadius is the amount to vary the base colors
+ //
+ DifferentialTrys::DifferentialTrys(ColorFloatRGBA a_frgbaColor1, ColorFloatRGBA a_frgbaColor2,
+ const unsigned int *a_pauiPixelMapping1,
+ const unsigned int *a_pauiPixelMapping2,
+ unsigned int a_uiRadius,
+ int a_iGrayOffset1, int a_iGrayOffset2)
+ {
+ assert(a_uiRadius <= MAX_RADIUS);
+
+ m_boolSeverelyBentColors = false;
+
+ ColorFloatRGBA frgbaQuantizedColor1 = a_frgbaColor1.QuantizeR5G5B5();
+ ColorFloatRGBA frgbaQuantizedColor2 = a_frgbaColor2.QuantizeR5G5B5();
+
+ // quantize base colors
+ // ensure that trys with a_uiRadius don't overflow
+ int iRed1 = MoveAwayFromEdge(frgbaQuantizedColor1.IntRed(31.0f)+a_iGrayOffset1, a_uiRadius);
+ int iGreen1 = MoveAwayFromEdge(frgbaQuantizedColor1.IntGreen(31.0f) + a_iGrayOffset1, a_uiRadius);
+ int iBlue1 = MoveAwayFromEdge(frgbaQuantizedColor1.IntBlue(31.0f) + a_iGrayOffset1, a_uiRadius);
+ int iRed2 = MoveAwayFromEdge(frgbaQuantizedColor2.IntRed(31.0f) + a_iGrayOffset2, a_uiRadius);
+ int iGreen2 = MoveAwayFromEdge(frgbaQuantizedColor2.IntGreen(31.0f) + a_iGrayOffset2, a_uiRadius);
+ int iBlue2 = MoveAwayFromEdge(frgbaQuantizedColor2.IntBlue(31.0f) + a_iGrayOffset2, a_uiRadius);
+
+ int iDeltaRed = iRed2 - iRed1;
+ int iDeltaGreen = iGreen2 - iGreen1;
+ int iDeltaBlue = iBlue2 - iBlue1;
+
+ // make sure components are within range
+ {
+ if (iDeltaRed > 3)
+ {
+ if (iDeltaRed > 7)
+ {
+ m_boolSeverelyBentColors = true;
+ }
+
+ iRed1 += (iDeltaRed - 3) / 2;
+ iRed2 = iRed1 + 3;
+ iDeltaRed = 3;
+ }
+ else if (iDeltaRed < -4)
+ {
+ if (iDeltaRed < -8)
+ {
+ m_boolSeverelyBentColors = true;
+ }
+
+ iRed1 += (iDeltaRed + 4) / 2;
+ iRed2 = iRed1 - 4;
+ iDeltaRed = -4;
+ }
+ assert(iRed1 >= (signed)(0 + a_uiRadius) && iRed1 <= (signed)(31 - a_uiRadius));
+ assert(iRed2 >= (signed)(0 + a_uiRadius) && iRed2 <= (signed)(31 - a_uiRadius));
+ assert(iDeltaRed >= -4 && iDeltaRed <= 3);
+
+ if (iDeltaGreen > 3)
+ {
+ if (iDeltaGreen > 7)
+ {
+ m_boolSeverelyBentColors = true;
+ }
+
+ iGreen1 += (iDeltaGreen - 3) / 2;
+ iGreen2 = iGreen1 + 3;
+ iDeltaGreen = 3;
+ }
+ else if (iDeltaGreen < -4)
+ {
+ if (iDeltaGreen < -8)
+ {
+ m_boolSeverelyBentColors = true;
+ }
+
+ iGreen1 += (iDeltaGreen + 4) / 2;
+ iGreen2 = iGreen1 - 4;
+ iDeltaGreen = -4;
+ }
+ assert(iGreen1 >= (signed)(0 + a_uiRadius) && iGreen1 <= (signed)(31 - a_uiRadius));
+ assert(iGreen2 >= (signed)(0 + a_uiRadius) && iGreen2 <= (signed)(31 - a_uiRadius));
+ assert(iDeltaGreen >= -4 && iDeltaGreen <= 3);
+
+ if (iDeltaBlue > 3)
+ {
+ if (iDeltaBlue > 7)
+ {
+ m_boolSeverelyBentColors = true;
+ }
+
+ iBlue1 += (iDeltaBlue - 3) / 2;
+ iBlue2 = iBlue1 + 3;
+ iDeltaBlue = 3;
+ }
+ else if (iDeltaBlue < -4)
+ {
+ if (iDeltaBlue < -8)
+ {
+ m_boolSeverelyBentColors = true;
+ }
+
+ iBlue1 += (iDeltaBlue + 4) / 2;
+ iBlue2 = iBlue1 - 4;
+ iDeltaBlue = -4;
+ }
+ assert(iBlue1 >= (signed)(0+a_uiRadius) && iBlue1 <= (signed)(31 - a_uiRadius));
+ assert(iBlue2 >= (signed)(0 + a_uiRadius) && iBlue2 <= (signed)(31 - a_uiRadius));
+ assert(iDeltaBlue >= -4 && iDeltaBlue <= 3);
+ }
+
+ m_half1.Init(iRed1, iGreen1, iBlue1, a_pauiPixelMapping1, a_uiRadius);
+ m_half2.Init(iRed2, iGreen2, iBlue2, a_pauiPixelMapping2, a_uiRadius);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ void DifferentialTrys::Half::Init(int a_iRed, int a_iGreen, int a_iBlue,
+ const unsigned int *a_pauiPixelMapping, unsigned int a_uiRadius)
+ {
+
+ m_iRed = a_iRed;
+ m_iGreen = a_iGreen;
+ m_iBlue = a_iBlue;
+
+ m_pauiPixelMapping = a_pauiPixelMapping;
+ m_uiRadius = a_uiRadius;
+
+ m_uiTrys = 0;
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcDifferentialTrys.h b/thirdparty/etc2comp/EtcDifferentialTrys.h
new file mode 100644
index 0000000000..71860908ff
--- /dev/null
+++ b/thirdparty/etc2comp/EtcDifferentialTrys.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcColorFloatRGBA.h"
+
+namespace Etc
+{
+
+ class DifferentialTrys
+ {
+ public:
+
+ static const unsigned int MAX_RADIUS = 2;
+
+ DifferentialTrys(ColorFloatRGBA a_frgbaColor1,
+ ColorFloatRGBA a_frgbaColor2,
+ const unsigned int *a_pauiPixelMapping1,
+ const unsigned int *a_pauiPixelMapping2,
+ unsigned int a_uiRadius,
+ int a_iGrayOffset1, int a_iGrayOffset2);
+
+ inline static int MoveAwayFromEdge(int a_i, int a_iDistance)
+ {
+ if (a_i < (0+ a_iDistance))
+ {
+ return (0 + a_iDistance);
+ }
+ else if (a_i > (31- a_iDistance))
+ {
+ return (31 - a_iDistance);
+ }
+
+ return a_i;
+ }
+
+ class Try
+ {
+ public :
+ static const unsigned int SELECTORS = 8; // per half
+
+ int m_iRed;
+ int m_iGreen;
+ int m_iBlue;
+ unsigned int m_uiCW;
+ unsigned int m_auiSelectors[SELECTORS];
+ float m_fError;
+ };
+
+ class Half
+ {
+ public:
+
+ static const unsigned int MAX_TRYS = 125;
+
+ void Init(int a_iRed, int a_iGreen, int a_iBlue,
+ const unsigned int *a_pauiPixelMapping,
+ unsigned int a_uiRadius);
+
+ // center of trys
+ int m_iRed;
+ int m_iGreen;
+ int m_iBlue;
+
+ const unsigned int *m_pauiPixelMapping;
+ unsigned int m_uiRadius;
+
+ unsigned int m_uiTrys;
+ Try m_atry[MAX_TRYS];
+
+ Try *m_ptryBest;
+ };
+
+ Half m_half1;
+ Half m_half2;
+
+ bool m_boolSeverelyBentColors;
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcErrorMetric.h b/thirdparty/etc2comp/EtcErrorMetric.h
new file mode 100644
index 0000000000..df4dcab4fb
--- /dev/null
+++ b/thirdparty/etc2comp/EtcErrorMetric.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+namespace Etc
+{
+
+ enum ErrorMetric
+ {
+ RGBA,
+ RGBX,
+ REC709,
+ NUMERIC,
+ NORMALXYZ,
+ //
+ ERROR_METRICS,
+ //
+ BT709 = REC709
+ };
+
+ inline const char *ErrorMetricToString(ErrorMetric errorMetric)
+ {
+ switch (errorMetric)
+ {
+ case RGBA:
+ return "RGBA";
+ case RGBX:
+ return "RGBX";
+ case REC709:
+ return "REC709";
+ case NUMERIC:
+ return "NUMERIC";
+ case NORMALXYZ:
+ return "NORMALXYZ";
+ case ERROR_METRICS:
+ default:
+ return "UNKNOWN";
+ }
+ }
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcFile.cpp b/thirdparty/etc2comp/EtcFile.cpp
new file mode 100644
index 0000000000..831a3aac45
--- /dev/null
+++ b/thirdparty/etc2comp/EtcFile.cpp
@@ -0,0 +1,390 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifdef _WIN32
+#define _CRT_SECURE_NO_WARNINGS (1)
+#endif
+
+#include "EtcConfig.h"
+
+
+#include "EtcFile.h"
+
+#include "EtcFileHeader.h"
+#include "EtcColor.h"
+#include "Etc.h"
+#include "EtcBlock4x4EncodingBits.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <stdlib.h>
+
+using namespace Etc;
+
+// ----------------------------------------------------------------------------------------------------
+//
+File::File(const char *a_pstrFilename, Format a_fileformat, Image::Format a_imageformat,
+ unsigned char *a_paucEncodingBits, unsigned int a_uiEncodingBitsBytes,
+ unsigned int a_uiSourceWidth, unsigned int a_uiSourceHeight,
+ unsigned int a_uiExtendedWidth, unsigned int a_uiExtendedHeight)
+{
+ if (a_pstrFilename == nullptr)
+ {
+ m_pstrFilename = const_cast<char *>("");
+ }
+ else
+ {
+ m_pstrFilename = new char[strlen(a_pstrFilename) + 1];
+ strcpy(m_pstrFilename, a_pstrFilename);
+ }
+
+ m_fileformat = a_fileformat;
+ if (m_fileformat == Format::INFER_FROM_FILE_EXTENSION)
+ {
+ // ***** TODO: add this later *****
+ m_fileformat = Format::KTX;
+ }
+
+ m_imageformat = a_imageformat;
+
+ m_uiNumMipmaps = 1;
+ m_pMipmapImages = new RawImage[m_uiNumMipmaps];
+ m_pMipmapImages[0].paucEncodingBits = std::shared_ptr<unsigned char>(a_paucEncodingBits, [](unsigned char *p) { delete[] p; } );
+ m_pMipmapImages[0].uiEncodingBitsBytes = a_uiEncodingBitsBytes;
+ m_pMipmapImages[0].uiExtendedWidth = a_uiExtendedWidth;
+ m_pMipmapImages[0].uiExtendedHeight = a_uiExtendedHeight;
+
+ m_uiSourceWidth = a_uiSourceWidth;
+ m_uiSourceHeight = a_uiSourceHeight;
+
+ switch (m_fileformat)
+ {
+ case Format::PKM:
+ m_pheader = new FileHeader_Pkm(this);
+ break;
+
+ case Format::KTX:
+ m_pheader = new FileHeader_Ktx(this);
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+}
+
+// ----------------------------------------------------------------------------------------------------
+//
+File::File(const char *a_pstrFilename, Format a_fileformat, Image::Format a_imageformat,
+ unsigned int a_uiNumMipmaps, RawImage *a_pMipmapImages,
+ unsigned int a_uiSourceWidth, unsigned int a_uiSourceHeight)
+{
+ if (a_pstrFilename == nullptr)
+ {
+ m_pstrFilename = const_cast<char *>("");
+ }
+ else
+ {
+ m_pstrFilename = new char[strlen(a_pstrFilename) + 1];
+ strcpy(m_pstrFilename, a_pstrFilename);
+ }
+
+ m_fileformat = a_fileformat;
+ if (m_fileformat == Format::INFER_FROM_FILE_EXTENSION)
+ {
+ // ***** TODO: add this later *****
+ m_fileformat = Format::KTX;
+ }
+
+ m_imageformat = a_imageformat;
+
+ m_uiNumMipmaps = a_uiNumMipmaps;
+ m_pMipmapImages = new RawImage[m_uiNumMipmaps];
+
+ for(unsigned int mip = 0; mip < m_uiNumMipmaps; mip++)
+ {
+ m_pMipmapImages[mip] = a_pMipmapImages[mip];
+ }
+
+ m_uiSourceWidth = a_uiSourceWidth;
+ m_uiSourceHeight = a_uiSourceHeight;
+
+ switch (m_fileformat)
+ {
+ case Format::PKM:
+ m_pheader = new FileHeader_Pkm(this);
+ break;
+
+ case Format::KTX:
+ m_pheader = new FileHeader_Ktx(this);
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+}
+
+// ----------------------------------------------------------------------------------------------------
+//
+File::File(const char *a_pstrFilename, Format a_fileformat)
+{
+ if (a_pstrFilename == nullptr)
+ {
+ return;
+ }
+ else
+ {
+ m_pstrFilename = new char[strlen(a_pstrFilename) + 1];
+ strcpy(m_pstrFilename, a_pstrFilename);
+ }
+
+ m_fileformat = a_fileformat;
+ if (m_fileformat == Format::INFER_FROM_FILE_EXTENSION)
+ {
+ // ***** TODO: add this later *****
+ m_fileformat = Format::KTX;
+ }
+
+ FILE *pfile = fopen(m_pstrFilename, "rb");
+ if (pfile == nullptr)
+ {
+ printf("ERROR: Couldn't open %s", m_pstrFilename);
+ exit(1);
+ }
+ fseek(pfile, 0, SEEK_END);
+ unsigned int fileSize = ftell(pfile);
+ fseek(pfile, 0, SEEK_SET);
+ size_t szResult;
+
+ m_pheader = new FileHeader_Ktx(this);
+ szResult = fread( ((FileHeader_Ktx*)m_pheader)->GetData(), 1, sizeof(FileHeader_Ktx::Data), pfile);
+ assert(szResult > 0);
+
+ m_uiNumMipmaps = 1;
+ m_pMipmapImages = new RawImage[m_uiNumMipmaps];
+
+ if (((FileHeader_Ktx*)m_pheader)->GetData()->m_u32BytesOfKeyValueData > 0)
+ fseek(pfile, ((FileHeader_Ktx*)m_pheader)->GetData()->m_u32BytesOfKeyValueData, SEEK_CUR);
+ szResult = fread(&m_pMipmapImages->uiEncodingBitsBytes, 1, sizeof(unsigned int), pfile);
+ assert(szResult > 0);
+
+ m_pMipmapImages->paucEncodingBits = std::shared_ptr<unsigned char>(new unsigned char[m_pMipmapImages->uiEncodingBitsBytes], [](unsigned char *p) { delete[] p; } );
+ assert(ftell(pfile) + m_pMipmapImages->uiEncodingBitsBytes <= fileSize);
+ szResult = fread(m_pMipmapImages->paucEncodingBits.get(), 1, m_pMipmapImages->uiEncodingBitsBytes, pfile);
+ assert(szResult == m_pMipmapImages->uiEncodingBitsBytes);
+
+ uint32_t uiInternalFormat = ((FileHeader_Ktx*)m_pheader)->GetData()->m_u32GlInternalFormat;
+ uint32_t uiBaseInternalFormat = ((FileHeader_Ktx*)m_pheader)->GetData()->m_u32GlBaseInternalFormat;
+
+ if (uiInternalFormat == (uint32_t)FileHeader_Ktx::InternalFormat::ETC1_RGB8 && uiBaseInternalFormat == (uint32_t)FileHeader_Ktx::BaseInternalFormat::ETC1_RGB8)
+ {
+ m_imageformat = Image::Format::ETC1;
+ }
+ else if (uiInternalFormat == (uint32_t)FileHeader_Ktx::InternalFormat::ETC2_RGB8 && uiBaseInternalFormat == (uint32_t)FileHeader_Ktx::BaseInternalFormat::ETC2_RGB8)
+ {
+ m_imageformat = Image::Format::RGB8;
+ }
+ else if (uiInternalFormat == (uint32_t)FileHeader_Ktx::InternalFormat::ETC2_RGB8A1 && uiBaseInternalFormat == (uint32_t)FileHeader_Ktx::BaseInternalFormat::ETC2_RGB8A1)
+ {
+ m_imageformat = Image::Format::RGB8A1;
+ }
+ else if (uiInternalFormat == (uint32_t)FileHeader_Ktx::InternalFormat::ETC2_RGBA8 && uiBaseInternalFormat == (uint32_t)FileHeader_Ktx::BaseInternalFormat::ETC2_RGBA8)
+ {
+ m_imageformat = Image::Format::RGBA8;
+ }
+ else if (uiInternalFormat == (uint32_t)FileHeader_Ktx::InternalFormat::ETC2_R11 && uiBaseInternalFormat == (uint32_t)FileHeader_Ktx::BaseInternalFormat::ETC2_R11)
+ {
+ m_imageformat = Image::Format::R11;
+ }
+ else if (uiInternalFormat == (uint32_t)FileHeader_Ktx::InternalFormat::ETC2_SIGNED_R11 && uiBaseInternalFormat == (uint32_t)FileHeader_Ktx::BaseInternalFormat::ETC2_R11)
+ {
+ m_imageformat = Image::Format::SIGNED_R11;
+ }
+ else if (uiInternalFormat == (uint32_t)FileHeader_Ktx::InternalFormat::ETC2_RG11 && uiBaseInternalFormat == (uint32_t)FileHeader_Ktx::BaseInternalFormat::ETC2_RG11)
+ {
+ m_imageformat = Image::Format::RG11;
+ }
+ else if (uiInternalFormat == (uint32_t)FileHeader_Ktx::InternalFormat::ETC2_SIGNED_RG11 && uiBaseInternalFormat == (uint32_t)FileHeader_Ktx::BaseInternalFormat::ETC2_RG11)
+ {
+ m_imageformat = Image::Format::SIGNED_RG11;
+ }
+ else
+ {
+ m_imageformat = Image::Format::UNKNOWN;
+ }
+
+ m_uiSourceWidth = ((FileHeader_Ktx*)m_pheader)->GetData()->m_u32PixelWidth;
+ m_uiSourceHeight = ((FileHeader_Ktx*)m_pheader)->GetData()->m_u32PixelHeight;
+ m_pMipmapImages->uiExtendedWidth = Image::CalcExtendedDimension((unsigned short)m_uiSourceWidth);
+ m_pMipmapImages->uiExtendedHeight = Image::CalcExtendedDimension((unsigned short)m_uiSourceHeight);
+
+ unsigned int uiBlocks = m_pMipmapImages->uiExtendedWidth * m_pMipmapImages->uiExtendedHeight / 16;
+ Block4x4EncodingBits::Format encodingbitsformat = Image::DetermineEncodingBitsFormat(m_imageformat);
+ unsigned int expectedbytes = uiBlocks * Block4x4EncodingBits::GetBytesPerBlock(encodingbitsformat);
+ assert(expectedbytes == m_pMipmapImages->uiEncodingBitsBytes);
+
+ fclose(pfile);
+}
+
+File::~File()
+{
+ if (m_pMipmapImages != nullptr)
+ {
+ delete [] m_pMipmapImages;
+ }
+
+ if(m_pstrFilename != nullptr)
+ {
+ delete[] m_pstrFilename;
+ m_pstrFilename = nullptr;
+ }
+ if (m_pheader != nullptr)
+ {
+ delete m_pheader;
+ m_pheader = nullptr;
+ }
+}
+
+void File::UseSingleBlock(int a_iPixelX, int a_iPixelY)
+{
+ if (a_iPixelX <= -1 || a_iPixelY <= -1)
+ return;
+ if (a_iPixelX >(int) m_uiSourceWidth)
+ {
+ //if we are using a ktx thats the size of a single block or less
+ //then make sure we use the 4x4 image as the single block
+ if (m_uiSourceWidth <= 4)
+ {
+ a_iPixelX = 0;
+ }
+ else
+ {
+ printf("blockAtHV: H coordinate out of range, capped to image width\n");
+ a_iPixelX = m_uiSourceWidth - 1;
+ }
+ }
+ if (a_iPixelY >(int) m_uiSourceHeight)
+ {
+ //if we are using a ktx thats the size of a single block or less
+ //then make sure we use the 4x4 image as the single block
+ if (m_uiSourceHeight <= 4)
+ {
+ a_iPixelY= 0;
+ }
+ else
+ {
+ printf("blockAtHV: V coordinate out of range, capped to image height\n");
+ a_iPixelY = m_uiSourceHeight - 1;
+ }
+ }
+
+ unsigned int origWidth = m_uiSourceWidth;
+ unsigned int origHeight = m_uiSourceHeight;
+
+ m_uiSourceWidth = 4;
+ m_uiSourceHeight = 4;
+
+ Block4x4EncodingBits::Format encodingbitsformat = Image::DetermineEncodingBitsFormat(m_imageformat);
+ unsigned int uiEncodingBitsBytesPerBlock = Block4x4EncodingBits::GetBytesPerBlock(encodingbitsformat);
+
+ int numMipmaps = 1;
+ RawImage* pMipmapImages = new RawImage[numMipmaps];
+ pMipmapImages[0].uiExtendedWidth = Image::CalcExtendedDimension((unsigned short)m_uiSourceWidth);
+ pMipmapImages[0].uiExtendedHeight = Image::CalcExtendedDimension((unsigned short)m_uiSourceHeight);
+ pMipmapImages[0].uiEncodingBitsBytes = 0;
+ pMipmapImages[0].paucEncodingBits = std::shared_ptr<unsigned char>(new unsigned char[uiEncodingBitsBytesPerBlock], [](unsigned char *p) { delete[] p; });
+
+ //block position in pixels
+ // remove the bottom 2 bits to get the block coordinates
+ unsigned int iBlockPosX = (a_iPixelX & 0xFFFFFFFC);
+ unsigned int iBlockPosY = (a_iPixelY & 0xFFFFFFFC);
+
+ int numXBlocks = (origWidth / 4);
+ int numYBlocks = (origHeight / 4);
+
+
+ // block location
+ //int iBlockX = (a_iPixelX % 4) == 0 ? a_iPixelX / 4.0f : (a_iPixelX / 4) + 1;
+ //int iBlockY = (a_iPixelY % 4) == 0 ? a_iPixelY / 4.0f : (a_iPixelY / 4) + 1;
+ //m_paucEncodingBits += ((iBlockY * numXBlocks) + iBlockX) * uiEncodingBitsBytesPerBlock;
+
+
+ unsigned int num = numXBlocks*numYBlocks;
+ unsigned int uiH = 0, uiV = 0;
+ unsigned char* pEncodingBits = m_pMipmapImages[0].paucEncodingBits.get();
+ for (unsigned int uiBlock = 0; uiBlock < num; uiBlock++)
+ {
+ if (uiH == iBlockPosX && uiV == iBlockPosY)
+ {
+ memcpy(pMipmapImages[0].paucEncodingBits.get(),pEncodingBits, uiEncodingBitsBytesPerBlock);
+ break;
+ }
+ pEncodingBits += uiEncodingBitsBytesPerBlock;
+ uiH += 4;
+
+ if (uiH >= origWidth)
+ {
+ uiH = 0;
+ uiV += 4;
+ }
+ }
+
+ delete [] m_pMipmapImages;
+ m_pMipmapImages = pMipmapImages;
+}
+// ----------------------------------------------------------------------------------------------------
+//
+void File::Write()
+{
+
+ FILE *pfile = fopen(m_pstrFilename, "wb");
+ if (pfile == nullptr)
+ {
+ printf("Error: couldn't open Etc file (%s)\n", m_pstrFilename);
+ exit(1);
+ }
+
+ m_pheader->Write(pfile);
+
+ for(unsigned int mip = 0; mip < m_uiNumMipmaps; mip++)
+ {
+ if(m_fileformat == Format::KTX)
+ {
+ // Write u32 image size
+ uint32_t u32ImageSize = m_pMipmapImages[mip].uiEncodingBitsBytes;
+ uint32_t szBytesWritten = fwrite(&u32ImageSize, 1, sizeof(u32ImageSize), pfile);
+ assert(szBytesWritten == sizeof(u32ImageSize));
+ }
+
+ unsigned int iResult = (int)fwrite(m_pMipmapImages[mip].paucEncodingBits.get(), 1, m_pMipmapImages[mip].uiEncodingBitsBytes, pfile);
+ if (iResult != m_pMipmapImages[mip].uiEncodingBitsBytes)
+ {
+ printf("Error: couldn't write Etc file (%s)\n", m_pstrFilename);
+ exit(1);
+ }
+ }
+
+ fclose(pfile);
+
+}
+
+// ----------------------------------------------------------------------------------------------------
+//
+
diff --git a/thirdparty/etc2comp/EtcFile.h b/thirdparty/etc2comp/EtcFile.h
new file mode 100644
index 0000000000..69bf3b2d3a
--- /dev/null
+++ b/thirdparty/etc2comp/EtcFile.h
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcColorFloatRGBA.h"
+#include "EtcImage.h"
+#include "Etc.h"
+
+namespace Etc
+{
+ class FileHeader;
+ class SourceImage;
+
+ class File
+ {
+ public:
+
+ enum class Format
+ {
+ INFER_FROM_FILE_EXTENSION,
+ PKM,
+ KTX,
+ };
+
+ File(const char *a_pstrFilename, Format a_fileformat, Image::Format a_imageformat,
+ unsigned char *a_paucEncodingBits, unsigned int a_uiEncodingBitsBytes,
+ unsigned int a_uiSourceWidth, unsigned int a_uiSourceHeight,
+ unsigned int a_uiExtendedWidth, unsigned int a_uiExtendedHeight);
+
+ File(const char *a_pstrFilename, Format a_fileformat, Image::Format a_imageformat,
+ unsigned int a_uiNumMipmaps, RawImage *pMipmapImages,
+ unsigned int a_uiSourceWidth, unsigned int a_uiSourceHeight );
+
+ File(const char *a_pstrFilename, Format a_fileformat);
+ ~File();
+ const char *GetFilename(void) { return m_pstrFilename; }
+
+ void Read(const char *a_pstrFilename);
+ void Write(void);
+
+ inline unsigned int GetSourceWidth(void)
+ {
+ return m_uiSourceWidth;
+ }
+
+ inline unsigned int GetSourceHeight(void)
+ {
+ return m_uiSourceHeight;
+ }
+
+ inline unsigned int GetExtendedWidth(unsigned int mipmapIndex = 0)
+ {
+ if (mipmapIndex < m_uiNumMipmaps)
+ {
+ return m_pMipmapImages[mipmapIndex].uiExtendedWidth;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ inline unsigned int GetExtendedHeight(unsigned int mipmapIndex = 0)
+ {
+ if (mipmapIndex < m_uiNumMipmaps)
+ {
+ return m_pMipmapImages[mipmapIndex].uiExtendedHeight;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ inline Image::Format GetImageFormat()
+ {
+ return m_imageformat;
+ }
+
+ inline unsigned int GetEncodingBitsBytes(unsigned int mipmapIndex = 0)
+ {
+ if (mipmapIndex < m_uiNumMipmaps)
+ {
+ return m_pMipmapImages[mipmapIndex].uiEncodingBitsBytes;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ inline unsigned char* GetEncodingBits(unsigned int mipmapIndex = 0)
+ {
+ if( mipmapIndex < m_uiNumMipmaps)
+ {
+ return m_pMipmapImages[mipmapIndex].paucEncodingBits.get();
+ }
+ else
+ {
+ return nullptr;
+ }
+ }
+
+ inline unsigned int GetNumMipmaps()
+ {
+ return m_uiNumMipmaps;
+ }
+
+ void UseSingleBlock(int a_iPixelX = -1, int a_iPixelY = -1);
+ private:
+
+ char *m_pstrFilename; // includes directory path and file extension
+ Format m_fileformat;
+ Image::Format m_imageformat;
+ FileHeader *m_pheader;
+ unsigned int m_uiNumMipmaps;
+ RawImage* m_pMipmapImages;
+ unsigned int m_uiSourceWidth;
+ unsigned int m_uiSourceHeight;
+ };
+
+}
diff --git a/thirdparty/etc2comp/EtcFileHeader.cpp b/thirdparty/etc2comp/EtcFileHeader.cpp
new file mode 100644
index 0000000000..f02fcab011
--- /dev/null
+++ b/thirdparty/etc2comp/EtcFileHeader.cpp
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "EtcFileHeader.h"
+
+#include "EtcBlock4x4EncodingBits.h"
+
+#include <assert.h>
+
+namespace Etc
+{
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ FileHeader_Pkm::FileHeader_Pkm(File *a_pfile)
+ {
+ m_pfile = a_pfile;
+
+ static const char s_acMagicNumberData[4] = { 'P', 'K', 'M', ' ' };
+ static const char s_acVersionData[2] = { '1', '0' };
+
+ for (unsigned int ui = 0; ui < sizeof(s_acMagicNumberData); ui++)
+ {
+ m_data.m_acMagicNumber[ui] = s_acMagicNumberData[ui];
+ }
+
+ for (unsigned int ui = 0; ui < sizeof(s_acVersionData); ui++)
+ {
+ m_data.m_acVersion[ui] = s_acVersionData[ui];
+ }
+
+ m_data.m_ucDataType_msb = 0; // ETC1_RGB_NO_MIPMAPS
+ m_data.m_ucDataType_lsb = 0;
+
+ m_data.m_ucOriginalWidth_msb = (unsigned char)(m_pfile->GetSourceWidth() >> 8);
+ m_data.m_ucOriginalWidth_lsb = m_pfile->GetSourceWidth() & 0xFF;
+ m_data.m_ucOriginalHeight_msb = (unsigned char)(m_pfile->GetSourceHeight() >> 8);
+ m_data.m_ucOriginalHeight_lsb = m_pfile->GetSourceHeight() & 0xFF;
+
+ m_data.m_ucExtendedWidth_msb = (unsigned char)(m_pfile->GetExtendedWidth() >> 8);
+ m_data.m_ucExtendedWidth_lsb = m_pfile->GetExtendedWidth() & 0xFF;
+ m_data.m_ucExtendedHeight_msb = (unsigned char)(m_pfile->GetExtendedHeight() >> 8);
+ m_data.m_ucExtendedHeight_lsb = m_pfile->GetExtendedHeight() & 0xFF;
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ void FileHeader_Pkm::Write(FILE *a_pfile)
+ {
+
+ fwrite(&m_data, sizeof(Data), 1, a_pfile);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ FileHeader_Ktx::FileHeader_Ktx(File *a_pfile)
+ {
+ m_pfile = a_pfile;
+
+ static const uint8_t s_au8Itentfier[12] =
+ {
+ 0xAB, 0x4B, 0x54, 0x58, // first four bytes of Byte[12] identifier
+ 0x20, 0x31, 0x31, 0xBB, // next four bytes of Byte[12] identifier
+ 0x0D, 0x0A, 0x1A, 0x0A // final four bytes of Byte[12] identifier
+ };
+
+ for (unsigned int ui = 0; ui < sizeof(s_au8Itentfier); ui++)
+ {
+ m_data.m_au8Identifier[ui] = s_au8Itentfier[ui];
+ }
+
+ m_data.m_u32Endianness = 0x04030201;
+ m_data.m_u32GlType = 0;
+ m_data.m_u32GlTypeSize = 1;
+ m_data.m_u32GlFormat = 0;
+
+ switch (m_pfile->GetImageFormat())
+ {
+ case Image::Format::RGB8:
+ case Image::Format::SRGB8:
+ m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_RGB8;
+ m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_RGB8;
+ break;
+
+ case Image::Format::RGBA8:
+ case Image::Format::SRGBA8:
+ m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_RGBA8;
+ m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_RGBA8;
+ break;
+
+ case Image::Format::RGB8A1:
+ case Image::Format::SRGB8A1:
+ m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_RGB8A1;
+ m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_RGB8A1;
+ break;
+
+ case Image::Format::R11:
+ m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_R11;
+ m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_R11;
+ break;
+
+ case Image::Format::SIGNED_R11:
+ m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_SIGNED_R11;
+ m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_R11;
+ break;
+
+ case Image::Format::RG11:
+ m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_RG11;
+ m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_RG11;
+ break;
+
+ case Image::Format::SIGNED_RG11:
+ m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_SIGNED_RG11;
+ m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_RG11;
+ break;
+
+ default:
+ m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC1_RGB8;
+ m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC1_RGB8;
+ break;
+ }
+
+ m_data.m_u32PixelWidth = 0;
+ m_data.m_u32PixelHeight = 0;
+ m_data.m_u32PixelDepth = 0;
+ m_data.m_u32NumberOfArrayElements = 0;
+ m_data.m_u32NumberOfFaces = 0;
+ m_data.m_u32BytesOfKeyValueData = 0;
+
+ m_pkeyvaluepair = nullptr;
+
+ m_u32Images = 0;
+ m_u32KeyValuePairs = 0;
+
+ m_data.m_u32PixelWidth = m_pfile->GetSourceWidth();
+ m_data.m_u32PixelHeight = m_pfile->GetSourceHeight();
+ m_data.m_u32PixelDepth = 0;
+ m_data.m_u32NumberOfArrayElements = 0;
+ m_data.m_u32NumberOfFaces = 1;
+ m_data.m_u32NumberOfMipmapLevels = m_pfile->GetNumMipmaps();
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ void FileHeader_Ktx::Write(FILE *a_pfile)
+ {
+ size_t szBytesWritten;
+
+ // Write header
+ szBytesWritten = fwrite(&m_data, 1, sizeof(Data), a_pfile);
+ assert(szBytesWritten == sizeof(Data));
+
+ // Write KeyAndValuePairs
+ if (m_u32KeyValuePairs)
+ {
+ fwrite(m_pkeyvaluepair, m_pkeyvaluepair->u32KeyAndValueByteSize, 1, a_pfile);
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ FileHeader_Ktx::Data *FileHeader_Ktx::GetData()
+ {
+ return &m_data;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcFileHeader.h b/thirdparty/etc2comp/EtcFileHeader.h
new file mode 100644
index 0000000000..55a9cb5d9d
--- /dev/null
+++ b/thirdparty/etc2comp/EtcFileHeader.h
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcFile.h"
+#include <stdio.h>
+#include <inttypes.h>
+
+namespace Etc
+{
+
+ class Image;
+
+ class FileHeader
+ {
+ public:
+
+ virtual void Write(FILE *a_pfile) = 0;
+ File GetFile();
+ virtual ~FileHeader(void) {}
+ protected:
+
+ File *m_pfile;
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ class FileHeader_Pkm : public FileHeader
+ {
+ public:
+
+ FileHeader_Pkm(File *a_pfile);
+
+ virtual void Write(FILE *a_pfile);
+ virtual ~FileHeader_Pkm(void) {}
+ private:
+
+ typedef struct
+ {
+ char m_acMagicNumber[4];
+ char m_acVersion[2];
+ unsigned char m_ucDataType_msb; // e.g. ETC1_RGB_NO_MIPMAPS
+ unsigned char m_ucDataType_lsb;
+ unsigned char m_ucExtendedWidth_msb; // padded to 4x4 blocks
+ unsigned char m_ucExtendedWidth_lsb;
+ unsigned char m_ucExtendedHeight_msb; // padded to 4x4 blocks
+ unsigned char m_ucExtendedHeight_lsb;
+ unsigned char m_ucOriginalWidth_msb;
+ unsigned char m_ucOriginalWidth_lsb;
+ unsigned char m_ucOriginalHeight_msb;
+ unsigned char m_ucOriginalHeight_lsb;
+ } Data;
+
+ Data m_data;
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ class FileHeader_Ktx : public FileHeader
+ {
+ public:
+
+ typedef struct
+ {
+ uint32_t u32KeyAndValueByteSize;
+ } KeyValuePair;
+
+ typedef struct
+ {
+ uint8_t m_au8Identifier[12];
+ uint32_t m_u32Endianness;
+ uint32_t m_u32GlType;
+ uint32_t m_u32GlTypeSize;
+ uint32_t m_u32GlFormat;
+ uint32_t m_u32GlInternalFormat;
+ uint32_t m_u32GlBaseInternalFormat;
+ uint32_t m_u32PixelWidth;
+ uint32_t m_u32PixelHeight;
+ uint32_t m_u32PixelDepth;
+ uint32_t m_u32NumberOfArrayElements;
+ uint32_t m_u32NumberOfFaces;
+ uint32_t m_u32NumberOfMipmapLevels;
+ uint32_t m_u32BytesOfKeyValueData;
+ } Data;
+
+ enum class InternalFormat
+ {
+ ETC1_RGB8 = 0x8D64,
+ ETC1_ALPHA8 = ETC1_RGB8,
+ //
+ ETC2_R11 = 0x9270,
+ ETC2_SIGNED_R11 = 0x9271,
+ ETC2_RG11 = 0x9272,
+ ETC2_SIGNED_RG11 = 0x9273,
+ ETC2_RGB8 = 0x9274,
+ ETC2_SRGB8 = 0x9275,
+ ETC2_RGB8A1 = 0x9276,
+ ETC2_SRGB8_PUNCHTHROUGH_ALPHA1 = 0x9277,
+ ETC2_RGBA8 = 0x9278
+ };
+
+ enum class BaseInternalFormat
+ {
+ ETC2_R11 = 0x1903,
+ ETC2_RG11 = 0x8227,
+ ETC1_RGB8 = 0x1907,
+ ETC1_ALPHA8 = ETC1_RGB8,
+ //
+ ETC2_RGB8 = 0x1907,
+ ETC2_RGB8A1 = 0x1908,
+ ETC2_RGBA8 = 0x1908,
+ };
+
+ FileHeader_Ktx(File *a_pfile);
+
+ virtual void Write(FILE *a_pfile);
+ virtual ~FileHeader_Ktx(void) {}
+
+ void AddKeyAndValue(KeyValuePair *a_pkeyvaluepair);
+
+ Data* GetData();
+
+ private:
+
+ Data m_data;
+ KeyValuePair *m_pkeyvaluepair;
+
+ uint32_t m_u32Images;
+ uint32_t m_u32KeyValuePairs;
+ };
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcFilter.cpp b/thirdparty/etc2comp/EtcFilter.cpp
new file mode 100644
index 0000000000..bc899a533e
--- /dev/null
+++ b/thirdparty/etc2comp/EtcFilter.cpp
@@ -0,0 +1,401 @@
+#include <stdlib.h>
+#include <math.h>
+#include "EtcFilter.h"
+
+
+namespace Etc
+{
+
+static const double PiConst = 3.14159265358979323846;
+
+inline double sinc(double x)
+{
+ if ( x == 0.0 )
+ {
+ return 1.0;
+ }
+
+ return sin(PiConst * x) / (PiConst * x);
+}
+
+//inline float sincf( float x )
+//{
+// x *= F_PI;
+// if (x < 0.01f && x > -0.01f)
+// {
+// return 1.0f + x*x*(-1.0f/6.0f + x*x*1.0f/120.0f);
+// }
+//
+// return sinf(x)/x;
+//}
+//
+//double bessel0(double x)
+//{
+// const double EPSILON_RATIO = 1E-16;
+// double xh, sum, pow, ds;
+// int k;
+//
+// xh = 0.5 * x;
+// sum = 1.0;
+// pow = 1.0;
+// k = 0;
+// ds = 1.0;
+// while (ds > sum * EPSILON_RATIO)
+// {
+// ++k;
+// pow = pow * (xh / k);
+// ds = pow * pow;
+// sum = sum + ds;
+// }
+//
+// return sum;
+//}
+
+//**--------------------------------------------------------------------------
+//** Name: kaiser(double alpha, double half_width, double x)
+//** Returns:
+//** Description: Alpha controls shape of filter. We are using 4.
+//**--------------------------------------------------------------------------
+//inline double kaiser(double alpha, double half_width, double x)
+//{
+// double ratio = (x / half_width);
+// return bessel0(alpha * sqrt(1 - ratio * ratio)) / bessel0(alpha);
+//}
+//
+//float Filter_Lanczos4Sinc(float x)
+//{
+// if (x <= -4.0f || x >= 4.0f) // half-width of 4
+// {
+// return 0.0;
+// }
+//
+// return sinc(0.875f * x) * sinc(0.25f * x);
+//}
+//
+//double Filter_Kaiser4( double t )
+//{
+// return kaiser( 4.0, 3.0, t);
+//}
+//
+//double Filter_KaiserOptimal( double t )
+//{
+// return kaiser( 8.93, 3.0f, t);
+//}
+
+double FilterLanczos3( double t )
+{
+ if ( t <= -3.0 || t >= 3.0 )
+ {
+ return 0.0;
+ }
+
+ return sinc( t ) * sinc( t / 3.0 );
+}
+
+double FilterBox( double t )
+{
+ return ( t > -0.5 && t < 0.5) ? 1.0 : 0.0;
+}
+
+double FilterLinear( double t )
+{
+ if (t < 0.0) t = -t;
+
+ return (t < 1.0) ? (1.0 - t) : 0.0;
+}
+
+
+//**--------------------------------------------------------------------------
+//** Name: CalcContributions( int srcSize,
+//** int destSize,
+//** double filterSize,
+//** bool wrap,
+//** double (*FilterProc)(double),
+//** FilterWeights contrib[] )
+//** Returns: void
+//** Description:
+//**--------------------------------------------------------------------------
+void CalcContributions( int srcSize, int destSize, double filterSize, bool wrap, double (*FilterProc)(double), FilterWeights contrib[] )
+{
+ double scale;
+ double filterScale;
+ double center;
+ double totalWeight;
+ double weight;
+ int iRight;
+ int iLeft;
+ int iDest;
+
+ scale = (double)destSize / srcSize;
+ if ( scale < 1.0 )
+ {
+ filterSize = filterSize / scale;
+ filterScale = scale;
+ }
+ else
+ {
+ filterScale = 1.0;
+ }
+
+ if ( filterSize > (double)MaxFilterSize )
+ {
+ filterSize = (double)MaxFilterSize;
+ }
+
+ for ( iDest = 0; iDest < destSize; ++iDest )
+ {
+ center = (double)iDest / scale;
+
+ iLeft = (int)ceil(center - filterSize);
+ iRight = (int)floor(center + filterSize);
+
+ if ( !wrap )
+ {
+ if ( iLeft < 0 )
+ {
+ iLeft = 0;
+ }
+
+ if ( iRight >= srcSize )
+ {
+ iRight = srcSize - 1;
+ }
+ }
+
+ int numWeights = iRight - iLeft + 1;
+
+ contrib[iDest].first = iLeft;
+ contrib[iDest].numWeights = numWeights;
+
+ totalWeight = 0;
+ double t = ((double)iLeft - center) * filterScale;
+ for (int i = 0; i < numWeights; i++)
+ {
+ weight = (*FilterProc)(t) * filterScale;
+ totalWeight += weight;
+ contrib[iDest].weight[i] = weight;
+ t += filterScale;
+ }
+
+ //**--------------------------------------------------------
+ //** Normalize weights by dividing by the sum of the weights
+ //**--------------------------------------------------------
+ if ( totalWeight > 0.0 )
+ {
+ for ( int i = 0; i < numWeights; i++)
+ {
+ contrib[iDest].weight[i] /= totalWeight;
+ }
+ }
+ }
+}
+
+//**-------------------------------------------------------------------------
+//** Name: Filter_TwoPass( RGBCOLOR *pSrcImage,
+//** int srcWidth, int srcHeight,
+//** RGBCOLOR *pDestImage,
+//** int destWidth, int destHeight,
+//** double (*FilterProc)(double) )
+//** Returns: 0 on failure and 1 on success
+//** Description: Filters a 2d image with a two pass filter by averaging the
+//** weighted contributions of the pixels within the filter region. The
+//** contributions are determined by a weighting function parameter.
+//**-------------------------------------------------------------------------
+int FilterTwoPass( RGBCOLOR *pSrcImage, int srcWidth, int srcHeight,
+ RGBCOLOR *pDestImage, int destWidth, int destHeight, unsigned int wrapFlags, double (*FilterProc)(double) )
+{
+ FilterWeights *contrib;
+ RGBCOLOR *pPixel;
+ RGBCOLOR *pSrcPixel;
+ RGBCOLOR *pTempImage;
+ int iRow;
+ int iCol;
+ int iSrcCol;
+ int iSrcRow;
+ int iWeight;
+ double dRed;
+ double dGreen;
+ double dBlue;
+ double dAlpha;
+ double filterSize = 3.0;
+
+ int maxDim = (srcWidth>srcHeight)?srcWidth:srcHeight;
+ contrib = (FilterWeights*)malloc(maxDim * sizeof(FilterWeights));
+
+ //**------------------------------------------------------------------------
+ //** Need to create a temporary image to stuff the horizontally scaled image
+ //**------------------------------------------------------------------------
+ pTempImage = (RGBCOLOR *)malloc( destWidth * srcHeight * sizeof(RGBCOLOR) );
+ if ( pTempImage == NULL )
+ {
+ return 0;
+ }
+
+ //**-------------------------------------------------------
+ //** Horizontally filter the image into the temporary image
+ //**-------------------------------------------------------
+ bool bWrapHorizontal = !!(wrapFlags&FILTER_WRAP_X);
+ CalcContributions( srcWidth, destWidth, filterSize, bWrapHorizontal, FilterProc, contrib );
+ for ( iRow = 0; iRow < srcHeight; iRow++ )
+ {
+ for ( iCol = 0; iCol < destWidth; iCol++ )
+ {
+ dRed = 0;
+ dGreen = 0;
+ dBlue = 0;
+ dAlpha = 0;
+
+ for ( iWeight = 0; iWeight < contrib[iCol].numWeights; iWeight++ )
+ {
+ iSrcCol = iWeight + contrib[iCol].first;
+ if (bWrapHorizontal)
+ {
+ iSrcCol = (iSrcCol < 0) ? (srcWidth + iSrcCol) : (iSrcCol >= srcWidth) ? (iSrcCol - srcWidth) : iSrcCol;
+ }
+ pSrcPixel = pSrcImage + (iRow * srcWidth) + iSrcCol;
+ dRed += contrib[iCol].weight[iWeight] * pSrcPixel->rgba[0];
+ dGreen += contrib[iCol].weight[iWeight] * pSrcPixel->rgba[1];
+ dBlue += contrib[iCol].weight[iWeight] * pSrcPixel->rgba[2];
+ dAlpha += contrib[iCol].weight[iWeight] * pSrcPixel->rgba[3];
+ }
+
+ pPixel = pTempImage + (iRow * destWidth) + iCol;
+ pPixel->rgba[0] = static_cast<unsigned char>(std::max(0.0, std::min(255.0, dRed)));
+ pPixel->rgba[1] = static_cast<unsigned char>(std::max(0.0, std::min(255.0, dGreen)));
+ pPixel->rgba[2] = static_cast<unsigned char>(std::max(0.0, std::min(255.0, dBlue)));
+ pPixel->rgba[3] = static_cast<unsigned char>(std::max(0.0, std::min(255.0, dAlpha)));
+ }
+ }
+
+ //**-------------------------------------------------------
+ //** Vertically filter the image into the destination image
+ //**-------------------------------------------------------
+ bool bWrapVertical = !!(wrapFlags&FILTER_WRAP_Y);
+ CalcContributions(srcHeight, destHeight, filterSize, bWrapVertical, FilterProc, contrib);
+ for ( iCol = 0; iCol < destWidth; iCol++ )
+ {
+ for ( iRow = 0; iRow < destHeight; iRow++ )
+ {
+ dRed = 0;
+ dGreen = 0;
+ dBlue = 0;
+ dAlpha = 0;
+
+ for ( iWeight = 0; iWeight < contrib[iRow].numWeights; iWeight++ )
+ {
+ iSrcRow = iWeight + contrib[iRow].first;
+ if (bWrapVertical)
+ {
+ iSrcRow = (iSrcRow < 0) ? (srcHeight + iSrcRow) : (iSrcRow >= srcHeight) ? (iSrcRow - srcHeight) : iSrcRow;
+ }
+ pSrcPixel = pTempImage + (iSrcRow * destWidth) + iCol;
+ dRed += contrib[iRow].weight[iWeight] * pSrcPixel->rgba[0];
+ dGreen += contrib[iRow].weight[iWeight] * pSrcPixel->rgba[1];
+ dBlue += contrib[iRow].weight[iWeight] * pSrcPixel->rgba[2];
+ dAlpha += contrib[iRow].weight[iWeight] * pSrcPixel->rgba[3];
+ }
+
+ pPixel = pDestImage + (iRow * destWidth) + iCol;
+ pPixel->rgba[0] = (unsigned char)(std::max( 0.0, std::min( 255.0, dRed)));
+ pPixel->rgba[1] = (unsigned char)(std::max( 0.0, std::min( 255.0, dGreen)));
+ pPixel->rgba[2] = (unsigned char)(std::max( 0.0, std::min( 255.0, dBlue)));
+ pPixel->rgba[3] = (unsigned char)(std::max( 0.0, std::min( 255.0, dAlpha)));
+ }
+ }
+
+ free( pTempImage );
+ free( contrib );
+
+ return 1;
+}
+
+//**-------------------------------------------------------------------------
+//** Name: FilterResample(RGBCOLOR *pSrcImage, int srcWidth, int srcHeight,
+//** RGBCOLOR *pDstImage, int dstWidth, int dstHeight)
+//** Returns: 1
+//** Description: This function runs a 2d box filter over the srouce image
+//** to produce the destination image.
+//**-------------------------------------------------------------------------
+void FilterResample( RGBCOLOR *pSrcImage, int srcWidth, int srcHeight,
+ RGBCOLOR *pDstImage, int dstWidth, int dstHeight )
+{
+ int iRow;
+ int iCol;
+ int iSampleRow;
+ int iSampleCol;
+ int iFirstSampleRow;
+ int iFirstSampleCol;
+ int iLastSampleRow;
+ int iLastSampleCol;
+ int red;
+ int green;
+ int blue;
+ int alpha;
+ int samples;
+ float xScale;
+ float yScale;
+
+ RGBCOLOR *pSrcPixel;
+ RGBCOLOR *pDstPixel;
+
+ xScale = (float)srcWidth / dstWidth;
+ yScale = (float)srcHeight / dstHeight;
+
+ for ( iRow = 0; iRow < dstHeight; iRow++ )
+ {
+ for ( iCol = 0; iCol < dstWidth; iCol++ )
+ {
+ iFirstSampleRow = (int)(iRow * yScale);
+ iLastSampleRow = (int)ceil(iFirstSampleRow + yScale - 1);
+ if ( iLastSampleRow >= srcHeight )
+ {
+ iLastSampleRow = srcHeight - 1;
+ }
+
+ iFirstSampleCol = (int)(iCol * xScale);
+ iLastSampleCol = (int)ceil(iFirstSampleCol + xScale - 1);
+ if ( iLastSampleCol >= srcWidth )
+ {
+ iLastSampleCol = srcWidth - 1;
+ }
+
+ samples = 0;
+ red = 0;
+ green = 0;
+ blue = 0;
+ alpha = 0;
+ for ( iSampleRow = iFirstSampleRow; iSampleRow <= iLastSampleRow; iSampleRow++ )
+ {
+ for ( iSampleCol = iFirstSampleCol; iSampleCol <= iLastSampleCol; iSampleCol++ )
+ {
+ pSrcPixel = pSrcImage + iSampleRow * srcWidth + iSampleCol;
+ red += pSrcPixel->rgba[0];
+ green += pSrcPixel->rgba[1];
+ blue += pSrcPixel->rgba[2];
+ alpha += pSrcPixel->rgba[3];
+
+ samples++;
+ }
+ }
+
+ pDstPixel = pDstImage + iRow * dstWidth + iCol;
+ if ( samples > 0 )
+ {
+ pDstPixel->rgba[0] = static_cast<uint8_t>(red / samples);
+ pDstPixel->rgba[1] = static_cast<uint8_t>(green / samples);
+ pDstPixel->rgba[2] = static_cast<uint8_t>(blue / samples);
+ pDstPixel->rgba[3] = static_cast<uint8_t>(alpha / samples);
+ }
+ else
+ {
+ pDstPixel->rgba[0] = static_cast<uint8_t>(red);
+ pDstPixel->rgba[1] = static_cast<uint8_t>(green);
+ pDstPixel->rgba[2] = static_cast<uint8_t>(blue);
+ pDstPixel->rgba[3] = static_cast<uint8_t>(alpha);
+ }
+ }
+ }
+}
+
+
+} \ No newline at end of file
diff --git a/thirdparty/etc2comp/EtcFilter.h b/thirdparty/etc2comp/EtcFilter.h
new file mode 100644
index 0000000000..fcf125c6df
--- /dev/null
+++ b/thirdparty/etc2comp/EtcFilter.h
@@ -0,0 +1,244 @@
+#pragma once
+#include <stdint.h>
+#include <algorithm>
+
+namespace Etc
+{
+
+enum FilterEnums
+{
+ MaxFilterSize = 32
+};
+
+enum WrapFlags
+{
+ FILTER_WRAP_NONE = 0,
+ FILTER_WRAP_X = 0x1,
+ FILTER_WRAP_Y = 0x2
+};
+
+typedef struct tagFilterWeights
+{
+ int first;
+ int numWeights;
+ double weight[MaxFilterSize * 2 + 1];
+} FilterWeights;
+
+typedef struct tagRGBCOLOR
+{
+ union
+ {
+ uint32_t ulColor;
+ uint8_t rgba[4];
+ };
+} RGBCOLOR;
+
+
+double FilterBox( double t );
+double FilterLinear( double t );
+double FilterLanczos3( double t );
+
+int FilterTwoPass( RGBCOLOR *pSrcImage, int srcWidth, int srcHeight,
+ RGBCOLOR *pDestImage, int destWidth, int destHeight, unsigned int wrapFlags, double (*FilterProc)(double) );
+void FilterResample( RGBCOLOR *pSrcImage, int srcWidth, int srcHeight,
+ RGBCOLOR *pDstImage, int dstWidth, int dstHeight );
+
+
+void CalcContributions(int srcSize, int destSize, double filterSize, bool wrap, double(*FilterProc)(double), FilterWeights contrib[]);
+
+template <typename T>
+void FilterResample(T *pSrcImage, int srcWidth, int srcHeight, T *pDstImage, int dstWidth, int dstHeight)
+{
+ float xScale;
+ float yScale;
+
+ T *pSrcPixel;
+ T *pDstPixel;
+
+ xScale = (float)srcWidth / dstWidth;
+ yScale = (float)srcHeight / dstHeight;
+
+ for (int iRow = 0; iRow < dstHeight; iRow++)
+ {
+ for (int iCol = 0; iCol < dstWidth; iCol++)
+ {
+ int samples;
+ int iFirstSampleRow;
+ int iFirstSampleCol;
+ int iLastSampleRow;
+ int iLastSampleCol;
+ float red;
+ float green;
+ float blue;
+ float alpha;
+
+ iFirstSampleRow = (int)(iRow * yScale);
+ iLastSampleRow = (int)ceil(iFirstSampleRow + yScale - 1);
+ if (iLastSampleRow >= srcHeight)
+ {
+ iLastSampleRow = srcHeight - 1;
+ }
+
+ iFirstSampleCol = (int)(iCol * xScale);
+ iLastSampleCol = (int)ceil(iFirstSampleCol + xScale - 1);
+ if (iLastSampleCol >= srcWidth)
+ {
+ iLastSampleCol = srcWidth - 1;
+ }
+
+ samples = 0;
+ red = 0.f;
+ green = 0.f;
+ blue = 0.f;
+ alpha = 0.f;
+ for (int iSampleRow = iFirstSampleRow; iSampleRow <= iLastSampleRow; iSampleRow++)
+ {
+ for (int iSampleCol = iFirstSampleCol; iSampleCol <= iLastSampleCol; iSampleCol++)
+ {
+ pSrcPixel = pSrcImage + (iSampleRow * srcWidth + iSampleCol) * 4;
+ red += static_cast<float>(pSrcPixel[0]);
+ green += static_cast<float>(pSrcPixel[1]);
+ blue += static_cast<float>(pSrcPixel[2]);
+ alpha += static_cast<float>(pSrcPixel[3]);
+
+ samples++;
+ }
+ }
+
+ pDstPixel = pDstImage + (iRow * dstWidth + iCol) * 4;
+ if (samples > 0)
+ {
+ pDstPixel[0] = static_cast<T>(red / samples);
+ pDstPixel[1] = static_cast<T>(green / samples);
+ pDstPixel[2] = static_cast<T>(blue / samples);
+ pDstPixel[3] = static_cast<T>(alpha / samples);
+ }
+ else
+ {
+ pDstPixel[0] = static_cast<T>(red);
+ pDstPixel[1] = static_cast<T>(green);
+ pDstPixel[2] = static_cast<T>(blue);
+ pDstPixel[3] = static_cast<T>(alpha);
+ }
+ }
+ }
+
+}
+
+//**-------------------------------------------------------------------------
+//** Name: Filter_TwoPass( RGBCOLOR *pSrcImage,
+//** int srcWidth, int srcHeight,
+//** RGBCOLOR *pDestImage,
+//** int destWidth, int destHeight,
+//** double (*FilterProc)(double) )
+//** Returns: 0 on failure and 1 on success
+//** Description: Filters a 2d image with a two pass filter by averaging the
+//** weighted contributions of the pixels within the filter region. The
+//** contributions are determined by a weighting function parameter.
+//**-------------------------------------------------------------------------
+template <typename T>
+int FilterTwoPass(T *pSrcImage, int srcWidth, int srcHeight,
+ T *pDestImage, int destWidth, int destHeight, unsigned int wrapFlags, double(*FilterProc)(double))
+{
+ const int numComponents = 4;
+ FilterWeights *contrib;
+ T *pPixel;
+ T *pTempImage;
+ double dRed;
+ double dGreen;
+ double dBlue;
+ double dAlpha;
+ double filterSize = 3.0;
+
+ int maxDim = (srcWidth>srcHeight) ? srcWidth : srcHeight;
+ contrib = new FilterWeights[maxDim];
+
+ //**------------------------------------------------------------------------
+ //** Need to create a temporary image to stuff the horizontally scaled image
+ //**------------------------------------------------------------------------
+ pTempImage = new T[destWidth * srcHeight * numComponents];
+ if (pTempImage == NULL)
+ {
+ return 0;
+ }
+
+ //**-------------------------------------------------------
+ //** Horizontally filter the image into the temporary image
+ //**-------------------------------------------------------
+ bool bWrapHorizontal = !!(wrapFlags&FILTER_WRAP_X);
+ CalcContributions(srcWidth, destWidth, filterSize, bWrapHorizontal, FilterProc, contrib);
+ for (int iRow = 0; iRow < srcHeight; iRow++)
+ {
+ for (int iCol = 0; iCol < destWidth; iCol++)
+ {
+ dRed = 0;
+ dGreen = 0;
+ dBlue = 0;
+ dAlpha = 0;
+
+ for (int iWeight = 0; iWeight < contrib[iCol].numWeights; iWeight++)
+ {
+ int iSrcCol = iWeight + contrib[iCol].first;
+ if(bWrapHorizontal)
+ {
+ iSrcCol = (iSrcCol < 0)?(srcWidth+iSrcCol):(iSrcCol >= srcWidth)?(iSrcCol-srcWidth):iSrcCol;
+ }
+ T* pSrcPixel = pSrcImage + ((iRow * srcWidth) + iSrcCol)*numComponents;
+ dRed += contrib[iCol].weight[iWeight] * pSrcPixel[0];
+ dGreen += contrib[iCol].weight[iWeight] * pSrcPixel[1];
+ dBlue += contrib[iCol].weight[iWeight] * pSrcPixel[2];
+ dAlpha += contrib[iCol].weight[iWeight] * pSrcPixel[3];
+ }
+
+ pPixel = pTempImage + ((iRow * destWidth) + iCol)*numComponents;
+ pPixel[0] = static_cast<T>(std::max(0.0, std::min(255.0, dRed)));
+ pPixel[1] = static_cast<T>(std::max(0.0, std::min(255.0, dGreen)));
+ pPixel[2] = static_cast<T>(std::max(0.0, std::min(255.0, dBlue)));
+ pPixel[3] = static_cast<T>(std::max(0.0, std::min(255.0, dAlpha)));
+ }
+ }
+
+ //**-------------------------------------------------------
+ //** Vertically filter the image into the destination image
+ //**-------------------------------------------------------
+ bool bWrapVertical = !!(wrapFlags&FILTER_WRAP_Y);
+ CalcContributions(srcHeight, destHeight, filterSize, bWrapVertical, FilterProc, contrib);
+ for (int iCol = 0; iCol < destWidth; iCol++)
+ {
+ for (int iRow = 0; iRow < destHeight; iRow++)
+ {
+ dRed = 0;
+ dGreen = 0;
+ dBlue = 0;
+ dAlpha = 0;
+
+ for (int iWeight = 0; iWeight < contrib[iRow].numWeights; iWeight++)
+ {
+ int iSrcRow = iWeight + contrib[iRow].first;
+ if (bWrapVertical)
+ {
+ iSrcRow = (iSrcRow < 0) ? (srcHeight + iSrcRow) : (iSrcRow >= srcHeight) ? (iSrcRow - srcHeight) : iSrcRow;
+ }
+ T* pSrcPixel = pTempImage + ((iSrcRow * destWidth) + iCol)*numComponents;
+ dRed += contrib[iRow].weight[iWeight] * pSrcPixel[0];
+ dGreen += contrib[iRow].weight[iWeight] * pSrcPixel[1];
+ dBlue += contrib[iRow].weight[iWeight] * pSrcPixel[2];
+ dAlpha += contrib[iRow].weight[iWeight] * pSrcPixel[3];
+ }
+
+ pPixel = pDestImage + ((iRow * destWidth) + iCol)*numComponents;
+ pPixel[0] = static_cast<T>(std::max(0.0, std::min(255.0, dRed)));
+ pPixel[1] = static_cast<T>(std::max(0.0, std::min(255.0, dGreen)));
+ pPixel[2] = static_cast<T>(std::max(0.0, std::min(255.0, dBlue)));
+ pPixel[3] = static_cast<T>(std::max(0.0, std::min(255.0, dAlpha)));
+ }
+ }
+
+ delete[] pTempImage;
+ delete[] contrib;
+
+ return 1;
+}
+
+
+} \ No newline at end of file
diff --git a/thirdparty/etc2comp/EtcImage.cpp b/thirdparty/etc2comp/EtcImage.cpp
new file mode 100644
index 0000000000..7a1058844d
--- /dev/null
+++ b/thirdparty/etc2comp/EtcImage.cpp
@@ -0,0 +1,685 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcImage.cpp
+
+Image is an array of 4x4 blocks that represent the encoding of the source image
+
+*/
+
+#include "EtcConfig.h"
+
+#include <stdlib.h>
+
+#include "EtcImage.h"
+
+#include "Etc.h"
+#include "EtcBlock4x4.h"
+#include "EtcBlock4x4EncodingBits.h"
+#include "EtcSortedBlockList.h"
+
+#if ETC_WINDOWS
+#include <windows.h>
+#endif
+#include <ctime>
+#include <chrono>
+#include <future>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+// fix conflict with Block4x4::AlphaMix
+#ifdef OPAQUE
+#undef OPAQUE
+#endif
+#ifdef TRANSPARENT
+#undef TRANSPARENT
+#endif
+
+namespace Etc
+{
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ Image::Image(void)
+ {
+ m_encodingStatus = EncodingStatus::SUCCESS;
+ m_warningsToCapture = EncodingStatus::SUCCESS;
+ m_pafrgbaSource = nullptr;
+
+ m_pablock = nullptr;
+
+ m_encodingbitsformat = Block4x4EncodingBits::Format::UNKNOWN;
+ m_uiEncodingBitsBytes = 0;
+ m_paucEncodingBits = nullptr;
+
+ m_format = Format::UNKNOWN;
+ m_iNumOpaquePixels = 0;
+ m_iNumTranslucentPixels = 0;
+ m_iNumTransparentPixels = 0;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // constructor using source image
+ // used to set state before Encode() is called
+ //
+ Image::Image(float *a_pafSourceRGBA, unsigned int a_uiSourceWidth,
+ unsigned int a_uiSourceHeight,
+ ErrorMetric a_errormetric)
+ {
+ m_encodingStatus = EncodingStatus::SUCCESS;
+ m_warningsToCapture = EncodingStatus::SUCCESS;
+ m_pafrgbaSource = (ColorFloatRGBA *) a_pafSourceRGBA;
+ m_uiSourceWidth = a_uiSourceWidth;
+ m_uiSourceHeight = a_uiSourceHeight;
+
+ m_uiExtendedWidth = CalcExtendedDimension((unsigned short)m_uiSourceWidth);
+ m_uiExtendedHeight = CalcExtendedDimension((unsigned short)m_uiSourceHeight);
+
+ m_uiBlockColumns = m_uiExtendedWidth >> 2;
+ m_uiBlockRows = m_uiExtendedHeight >> 2;
+
+ m_pablock = new Block4x4[GetNumberOfBlocks()];
+ assert(m_pablock);
+
+ m_format = Format::UNKNOWN;
+
+ m_encodingbitsformat = Block4x4EncodingBits::Format::UNKNOWN;
+ m_uiEncodingBitsBytes = 0;
+ m_paucEncodingBits = nullptr;
+
+ m_errormetric = a_errormetric;
+ m_fEffort = 0.0f;
+
+ m_iEncodeTime_ms = -1;
+
+ m_iNumOpaquePixels = 0;
+ m_iNumTranslucentPixels = 0;
+ m_iNumTransparentPixels = 0;
+ m_bVerboseOutput = false;
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // constructor using encoding bits
+ // recreates encoding state using a previously encoded image
+ //
+ Image::Image(Format a_format,
+ unsigned int a_uiSourceWidth, unsigned int a_uiSourceHeight,
+ unsigned char *a_paucEncidingBits, unsigned int a_uiEncodingBitsBytes,
+ Image *a_pimageSource, ErrorMetric a_errormetric)
+ {
+ m_encodingStatus = EncodingStatus::SUCCESS;
+ m_pafrgbaSource = nullptr;
+ m_uiSourceWidth = a_uiSourceWidth;
+ m_uiSourceHeight = a_uiSourceHeight;
+
+ m_uiExtendedWidth = CalcExtendedDimension((unsigned short)m_uiSourceWidth);
+ m_uiExtendedHeight = CalcExtendedDimension((unsigned short)m_uiSourceHeight);
+
+ m_uiBlockColumns = m_uiExtendedWidth >> 2;
+ m_uiBlockRows = m_uiExtendedHeight >> 2;
+
+ unsigned int uiBlocks = GetNumberOfBlocks();
+
+ m_pablock = new Block4x4[uiBlocks];
+ assert(m_pablock);
+
+ m_format = a_format;
+
+ m_iNumOpaquePixels = 0;
+ m_iNumTranslucentPixels = 0;
+ m_iNumTransparentPixels = 0;
+
+ m_encodingbitsformat = DetermineEncodingBitsFormat(m_format);
+ if (m_encodingbitsformat == Block4x4EncodingBits::Format::UNKNOWN)
+ {
+ AddToEncodingStatus(ERROR_UNKNOWN_FORMAT);
+ return;
+ }
+ m_uiEncodingBitsBytes = a_uiEncodingBitsBytes;
+ m_paucEncodingBits = a_paucEncidingBits;
+
+ m_errormetric = a_errormetric;
+ m_fEffort = 0.0f;
+ m_bVerboseOutput = false;
+ m_iEncodeTime_ms = -1;
+
+ unsigned char *paucEncodingBits = m_paucEncodingBits;
+ unsigned int uiEncodingBitsBytesPerBlock = Block4x4EncodingBits::GetBytesPerBlock(m_encodingbitsformat);
+
+ unsigned int uiH = 0;
+ unsigned int uiV = 0;
+ for (unsigned int uiBlock = 0; uiBlock < uiBlocks; uiBlock++)
+ {
+ m_pablock[uiBlock].InitFromEtcEncodingBits(a_format, uiH, uiV, paucEncodingBits,
+ a_pimageSource, a_errormetric);
+ paucEncodingBits += uiEncodingBitsBytesPerBlock;
+ uiH += 4;
+ if (uiH >= m_uiSourceWidth)
+ {
+ uiH = 0;
+ uiV += 4;
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ Image::~Image(void)
+ {
+ if (m_pablock != nullptr)
+ {
+ delete[] m_pablock;
+ m_pablock = nullptr;
+ }
+
+ /*if (m_paucEncodingBits != nullptr)
+ {
+ delete[] m_paucEncodingBits;
+ m_paucEncodingBits = nullptr;
+ }*/
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // encode an image
+ // create a set of encoding bits that conforms to a_format
+ // find best fit using a_errormetric
+ // explore a range of possible encodings based on a_fEffort (range = [0:100])
+ // speed up process using a_uiJobs as the number of process threads (a_uiJobs must not excede a_uiMaxJobs)
+ //
+ Image::EncodingStatus Image::Encode(Format a_format, ErrorMetric a_errormetric, float a_fEffort, unsigned int a_uiJobs, unsigned int a_uiMaxJobs)
+ {
+
+ auto start = std::chrono::steady_clock::now();
+
+ m_encodingStatus = EncodingStatus::SUCCESS;
+
+ m_format = a_format;
+ m_errormetric = a_errormetric;
+ m_fEffort = a_fEffort;
+
+ if (m_errormetric < 0 || m_errormetric > ERROR_METRICS)
+ {
+ AddToEncodingStatus(ERROR_UNKNOWN_ERROR_METRIC);
+ return m_encodingStatus;
+ }
+
+ if (m_fEffort < ETCCOMP_MIN_EFFORT_LEVEL)
+ {
+ AddToEncodingStatus(WARNING_EFFORT_OUT_OF_RANGE);
+ m_fEffort = ETCCOMP_MIN_EFFORT_LEVEL;
+ }
+ else if (m_fEffort > ETCCOMP_MAX_EFFORT_LEVEL)
+ {
+ AddToEncodingStatus(WARNING_EFFORT_OUT_OF_RANGE);
+ m_fEffort = ETCCOMP_MAX_EFFORT_LEVEL;
+ }
+ if (a_uiJobs < 1)
+ {
+ a_uiJobs = 1;
+ AddToEncodingStatus(WARNING_JOBS_OUT_OF_RANGE);
+ }
+ else if (a_uiJobs > a_uiMaxJobs)
+ {
+ a_uiJobs = a_uiMaxJobs;
+ AddToEncodingStatus(WARNING_JOBS_OUT_OF_RANGE);
+ }
+
+ m_encodingbitsformat = DetermineEncodingBitsFormat(m_format);
+
+ if (m_encodingbitsformat == Block4x4EncodingBits::Format::UNKNOWN)
+ {
+ AddToEncodingStatus(ERROR_UNKNOWN_FORMAT);
+ return m_encodingStatus;
+ }
+
+ assert(m_paucEncodingBits == nullptr);
+ m_uiEncodingBitsBytes = GetNumberOfBlocks() * Block4x4EncodingBits::GetBytesPerBlock(m_encodingbitsformat);
+ m_paucEncodingBits = new unsigned char[m_uiEncodingBitsBytes];
+
+ InitBlocksAndBlockSorter();
+
+
+ std::future<void> *handle = new std::future<void>[a_uiMaxJobs];
+
+ unsigned int uiNumThreadsNeeded = 0;
+ unsigned int uiUnfinishedBlocks = GetNumberOfBlocks();
+
+ uiNumThreadsNeeded = (uiUnfinishedBlocks < a_uiJobs) ? uiUnfinishedBlocks : a_uiJobs;
+
+ for (int i = 0; i < (int)uiNumThreadsNeeded - 1; i++)
+ {
+ handle[i] = async(std::launch::async, &Image::RunFirstPass, this, i, uiNumThreadsNeeded);
+ }
+
+ RunFirstPass(uiNumThreadsNeeded - 1, uiNumThreadsNeeded);
+
+ for (int i = 0; i < (int)uiNumThreadsNeeded - 1; i++)
+ {
+ handle[i].get();
+ }
+
+ // perform effort-based encoding
+ if (m_fEffort > ETCCOMP_MIN_EFFORT_LEVEL)
+ {
+ unsigned int uiFinishedBlocks = 0;
+ unsigned int uiTotalEffortBlocks = static_cast<unsigned int>(roundf(0.01f * m_fEffort * GetNumberOfBlocks()));
+
+ if (m_bVerboseOutput)
+ {
+ printf("effortblocks = %d\n", uiTotalEffortBlocks);
+ }
+ unsigned int uiPass = 0;
+ while (1)
+ {
+ if (m_bVerboseOutput)
+ {
+ uiPass++;
+ printf("pass %u\n", uiPass);
+ }
+ m_psortedblocklist->Sort();
+ uiUnfinishedBlocks = m_psortedblocklist->GetNumberOfSortedBlocks();
+ uiFinishedBlocks = GetNumberOfBlocks() - uiUnfinishedBlocks;
+ if (m_bVerboseOutput)
+ {
+ printf(" %u unfinished blocks\n", uiUnfinishedBlocks);
+ // m_psortedblocklist->Print();
+ }
+
+
+
+ //stop enocding when we did enough to satify the effort percentage
+ if (uiFinishedBlocks >= uiTotalEffortBlocks)
+ {
+ if (m_bVerboseOutput)
+ {
+ printf("Finished %d Blocks out of %d\n", uiFinishedBlocks, uiTotalEffortBlocks);
+ }
+ break;
+ }
+
+ unsigned int uiIteratedBlocks = 0;
+ unsigned int blocksToIterateThisPass = (uiTotalEffortBlocks - uiFinishedBlocks);
+ uiNumThreadsNeeded = (uiUnfinishedBlocks < a_uiJobs) ? uiUnfinishedBlocks : a_uiJobs;
+
+ if (uiNumThreadsNeeded <= 1)
+ {
+ //since we already how many blocks each thread will process
+ //cap the thread limit to do the proper amount of work, and not more
+ uiIteratedBlocks = IterateThroughWorstBlocks(blocksToIterateThisPass, 0, 1);
+ }
+ else
+ {
+ //we have a lot of work to do, so lets multi thread it
+ std::future<unsigned int> *handleToBlockEncoders = new std::future<unsigned int>[uiNumThreadsNeeded-1];
+
+ for (int i = 0; i < (int)uiNumThreadsNeeded - 1; i++)
+ {
+ handleToBlockEncoders[i] = async(std::launch::async, &Image::IterateThroughWorstBlocks, this, blocksToIterateThisPass, i, uiNumThreadsNeeded);
+ }
+ uiIteratedBlocks = IterateThroughWorstBlocks(blocksToIterateThisPass, uiNumThreadsNeeded - 1, uiNumThreadsNeeded);
+
+ for (int i = 0; i < (int)uiNumThreadsNeeded - 1; i++)
+ {
+ uiIteratedBlocks += handleToBlockEncoders[i].get();
+ }
+
+ delete[] handleToBlockEncoders;
+ }
+
+ if (m_bVerboseOutput)
+ {
+ printf(" %u iterated blocks\n", uiIteratedBlocks);
+ }
+ }
+ }
+
+ // generate Etc2-compatible bit-format 4x4 blocks
+ for (int i = 0; i < (int)a_uiJobs - 1; i++)
+ {
+ handle[i] = async(std::launch::async, &Image::SetEncodingBits, this, i, a_uiJobs);
+ }
+ SetEncodingBits(a_uiJobs - 1, a_uiJobs);
+
+ for (int i = 0; i < (int)a_uiJobs - 1; i++)
+ {
+ handle[i].get();
+ }
+
+ auto end = std::chrono::steady_clock::now();
+ std::chrono::milliseconds elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
+ m_iEncodeTime_ms = (int)elapsed.count();
+
+ delete[] handle;
+ delete m_psortedblocklist;
+ return m_encodingStatus;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // iterate the encoding thru the blocks with the worst error
+ // stop when a_uiMaxBlocks blocks have been iterated
+ // split the blocks between the process threads using a_uiMultithreadingOffset and a_uiMultithreadingStride
+ //
+ unsigned int Image::IterateThroughWorstBlocks(unsigned int a_uiMaxBlocks,
+ unsigned int a_uiMultithreadingOffset,
+ unsigned int a_uiMultithreadingStride)
+ {
+ assert(a_uiMultithreadingStride > 0);
+ unsigned int uiIteratedBlocks = a_uiMultithreadingOffset;
+
+ SortedBlockList::Link *plink = m_psortedblocklist->GetLinkToFirstBlock();
+ for (plink = plink->Advance(a_uiMultithreadingOffset);
+ plink != nullptr;
+ plink = plink->Advance(a_uiMultithreadingStride) )
+ {
+ if (uiIteratedBlocks >= a_uiMaxBlocks)
+ {
+ break;
+ }
+
+ plink->GetBlock()->PerformEncodingIteration(m_fEffort);
+
+ uiIteratedBlocks += a_uiMultithreadingStride;
+ }
+
+ return uiIteratedBlocks;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // determine which warnings to check for during Encode() based on encoding format
+ //
+ void Image::FindEncodingWarningTypesForCurFormat()
+ {
+ TrackEncodingWarning(WARNING_ALL_TRANSPARENT_PIXELS);
+ TrackEncodingWarning(WARNING_SOME_RGBA_NOT_0_TO_1);
+ switch (m_format)
+ {
+ case Image::Format::ETC1:
+ case Image::Format::RGB8:
+ case Image::Format::SRGB8:
+ TrackEncodingWarning(WARNING_SOME_NON_OPAQUE_PIXELS);
+ TrackEncodingWarning(WARNING_SOME_TRANSLUCENT_PIXELS);
+ break;
+
+ case Image::Format::RGB8A1:
+ case Image::Format::SRGB8A1:
+ TrackEncodingWarning(WARNING_SOME_TRANSLUCENT_PIXELS);
+ TrackEncodingWarning(WARNING_ALL_OPAQUE_PIXELS);
+ break;
+ case Image::Format::RGBA8:
+ case Image::Format::SRGBA8:
+ TrackEncodingWarning(WARNING_ALL_OPAQUE_PIXELS);
+ break;
+
+ case Image::Format::R11:
+ case Image::Format::SIGNED_R11:
+ TrackEncodingWarning(WARNING_SOME_NON_OPAQUE_PIXELS);
+ TrackEncodingWarning(WARNING_SOME_TRANSLUCENT_PIXELS);
+ TrackEncodingWarning(WARNING_SOME_GREEN_VALUES_ARE_NOT_ZERO);
+ TrackEncodingWarning(WARNING_SOME_BLUE_VALUES_ARE_NOT_ZERO);
+ break;
+
+ case Image::Format::RG11:
+ case Image::Format::SIGNED_RG11:
+ TrackEncodingWarning(WARNING_SOME_NON_OPAQUE_PIXELS);
+ TrackEncodingWarning(WARNING_SOME_TRANSLUCENT_PIXELS);
+ TrackEncodingWarning(WARNING_SOME_BLUE_VALUES_ARE_NOT_ZERO);
+ break;
+ case Image::Format::FORMATS:
+ case Image::Format::UNKNOWN:
+ default:
+ assert(0);
+ break;
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // examine source pixels to check for warnings
+ //
+ void Image::FindAndSetEncodingWarnings()
+ {
+ int numPixels = (m_uiBlockRows * 4) * (m_uiBlockColumns * 4);
+ if (m_iNumOpaquePixels == numPixels)
+ {
+ AddToEncodingStatusIfSignfigant(Image::EncodingStatus::WARNING_ALL_OPAQUE_PIXELS);
+ }
+ if (m_iNumOpaquePixels < numPixels)
+ {
+ AddToEncodingStatusIfSignfigant(Image::EncodingStatus::WARNING_SOME_NON_OPAQUE_PIXELS);
+ }
+ if (m_iNumTranslucentPixels > 0)
+ {
+ AddToEncodingStatusIfSignfigant(Image::EncodingStatus::WARNING_SOME_TRANSLUCENT_PIXELS);
+ }
+ if (m_iNumTransparentPixels == numPixels)
+ {
+ AddToEncodingStatusIfSignfigant(Image::EncodingStatus::WARNING_ALL_TRANSPARENT_PIXELS);
+ }
+ if (m_numColorValues.fB > 0.0f)
+ {
+ AddToEncodingStatusIfSignfigant(Image::EncodingStatus::WARNING_SOME_BLUE_VALUES_ARE_NOT_ZERO);
+ }
+ if (m_numColorValues.fG > 0.0f)
+ {
+ AddToEncodingStatusIfSignfigant(Image::EncodingStatus::WARNING_SOME_GREEN_VALUES_ARE_NOT_ZERO);
+ }
+
+ if (m_numOutOfRangeValues.fR > 0.0f || m_numOutOfRangeValues.fG > 0.0f)
+ {
+ AddToEncodingStatusIfSignfigant(Image::EncodingStatus::WARNING_SOME_RGBA_NOT_0_TO_1);
+ }
+ if (m_numOutOfRangeValues.fB > 0.0f || m_numOutOfRangeValues.fA > 0.0f)
+ {
+ AddToEncodingStatusIfSignfigant(Image::EncodingStatus::WARNING_SOME_RGBA_NOT_0_TO_1);
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // return a string name for a given image format
+ //
+ const char * Image::EncodingFormatToString(Image::Format a_format)
+ {
+ switch (a_format)
+ {
+ case Image::Format::ETC1:
+ return "ETC1";
+ case Image::Format::RGB8:
+ return "RGB8";
+ case Image::Format::SRGB8:
+ return "SRGB8";
+
+ case Image::Format::RGB8A1:
+ return "RGB8A1";
+ case Image::Format::SRGB8A1:
+ return "SRGB8A1";
+ case Image::Format::RGBA8:
+ return "RGBA8";
+ case Image::Format::SRGBA8:
+ return "SRGBA8";
+
+ case Image::Format::R11:
+ return "R11";
+ case Image::Format::SIGNED_R11:
+ return "SIGNED_R11";
+
+ case Image::Format::RG11:
+ return "RG11";
+ case Image::Format::SIGNED_RG11:
+ return "SIGNED_RG11";
+ case Image::Format::FORMATS:
+ case Image::Format::UNKNOWN:
+ default:
+ return "UNKNOWN";
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // return a string name for the image's format
+ //
+ const char * Image::EncodingFormatToString(void)
+ {
+ return EncodingFormatToString(m_format);
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // init image blocks prior to encoding
+ // init block sorter for subsequent sortings
+ // check for encoding warnings
+ //
+ void Image::InitBlocksAndBlockSorter(void)
+ {
+
+ FindEncodingWarningTypesForCurFormat();
+
+ // init each block
+ Block4x4 *pblock = m_pablock;
+ unsigned char *paucEncodingBits = m_paucEncodingBits;
+ for (unsigned int uiBlockRow = 0; uiBlockRow < m_uiBlockRows; uiBlockRow++)
+ {
+ unsigned int uiBlockV = uiBlockRow * 4;
+
+ for (unsigned int uiBlockColumn = 0; uiBlockColumn < m_uiBlockColumns; uiBlockColumn++)
+ {
+ unsigned int uiBlockH = uiBlockColumn * 4;
+
+ pblock->InitFromSource(this, uiBlockH, uiBlockV, paucEncodingBits, m_errormetric);
+
+ paucEncodingBits += Block4x4EncodingBits::GetBytesPerBlock(m_encodingbitsformat);
+
+ pblock++;
+ }
+ }
+
+ FindAndSetEncodingWarnings();
+
+ // init block sorter
+ {
+ m_psortedblocklist = new SortedBlockList(GetNumberOfBlocks(), 100);
+
+ for (unsigned int uiBlock = 0; uiBlock < GetNumberOfBlocks(); uiBlock++)
+ {
+ pblock = &m_pablock[uiBlock];
+ m_psortedblocklist->AddBlock(pblock);
+ }
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // run the first pass of the encoder
+ // the encoder generally finds a reasonable, fast encoding
+ // this is run on all blocks regardless of effort to ensure that all blocks have a valid encoding
+ //
+ void Image::RunFirstPass(unsigned int a_uiMultithreadingOffset, unsigned int a_uiMultithreadingStride)
+ {
+ assert(a_uiMultithreadingStride > 0);
+
+ for (unsigned int uiBlock = a_uiMultithreadingOffset;
+ uiBlock < GetNumberOfBlocks();
+ uiBlock += a_uiMultithreadingStride)
+ {
+ Block4x4 *pblock = &m_pablock[uiBlock];
+ pblock->PerformEncodingIteration(m_fEffort);
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // set the encoding bits (for the output file) based on the best encoding for each block
+ //
+ void Image::SetEncodingBits(unsigned int a_uiMultithreadingOffset,
+ unsigned int a_uiMultithreadingStride)
+ {
+ assert(a_uiMultithreadingStride > 0);
+
+ for (unsigned int uiBlock = a_uiMultithreadingOffset;
+ uiBlock < GetNumberOfBlocks();
+ uiBlock += a_uiMultithreadingStride)
+ {
+ Block4x4 *pblock = &m_pablock[uiBlock];
+ pblock->SetEncodingBitsFromEncoding();
+ }
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // return the image error
+ // image error is the sum of all block errors
+ //
+ float Image::GetError(void)
+ {
+ float fError = 0.0f;
+
+ for (unsigned int uiBlock = 0; uiBlock < GetNumberOfBlocks(); uiBlock++)
+ {
+ Block4x4 *pblock = &m_pablock[uiBlock];
+ fError += pblock->GetError();
+ }
+
+ return fError;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // determine the encoding bits format based on the encoding format
+ // the encoding bits format is a family of bit encodings that are shared across various encoding formats
+ //
+ Block4x4EncodingBits::Format Image::DetermineEncodingBitsFormat(Format a_format)
+ {
+ Block4x4EncodingBits::Format encodingbitsformat;
+
+ // determine encoding bits format from image format
+ switch (a_format)
+ {
+ case Format::ETC1:
+ case Format::RGB8:
+ case Format::SRGB8:
+ encodingbitsformat = Block4x4EncodingBits::Format::RGB8;
+ break;
+
+ case Format::RGBA8:
+ case Format::SRGBA8:
+ encodingbitsformat = Block4x4EncodingBits::Format::RGBA8;
+ break;
+
+ case Format::R11:
+ case Format::SIGNED_R11:
+ encodingbitsformat = Block4x4EncodingBits::Format::R11;
+ break;
+
+ case Format::RG11:
+ case Format::SIGNED_RG11:
+ encodingbitsformat = Block4x4EncodingBits::Format::RG11;
+ break;
+
+ case Format::RGB8A1:
+ case Format::SRGB8A1:
+ encodingbitsformat = Block4x4EncodingBits::Format::RGB8A1;
+ break;
+
+ default:
+ encodingbitsformat = Block4x4EncodingBits::Format::UNKNOWN;
+ break;
+ }
+
+ return encodingbitsformat;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcImage.h b/thirdparty/etc2comp/EtcImage.h
new file mode 100644
index 0000000000..bd807ac32e
--- /dev/null
+++ b/thirdparty/etc2comp/EtcImage.h
@@ -0,0 +1,249 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+//#include "Etc.h"
+#include "EtcColorFloatRGBA.h"
+#include "EtcBlock4x4EncodingBits.h"
+#include "EtcErrorMetric.h"
+
+
+namespace Etc
+{
+ class Block4x4;
+ class EncoderSpec;
+ class SortedBlockList;
+
+ class Image
+ {
+ public:
+
+ //the differnt warning and errors that can come up during encoding
+ enum EncodingStatus
+ {
+ SUCCESS = 0,
+ //
+ WARNING_THRESHOLD = 1 << 0,
+ //
+ WARNING_EFFORT_OUT_OF_RANGE = 1 << 1,
+ WARNING_JOBS_OUT_OF_RANGE = 1 << 2,
+ WARNING_SOME_NON_OPAQUE_PIXELS = 1 << 3,//just for opaque formats, etc1, rgb8, r11, rg11
+ WARNING_ALL_OPAQUE_PIXELS = 1 << 4,
+ WARNING_ALL_TRANSPARENT_PIXELS = 1 << 5,
+ WARNING_SOME_TRANSLUCENT_PIXELS = 1 << 6,//just for rgb8A1
+ WARNING_SOME_RGBA_NOT_0_TO_1 = 1 << 7,
+ WARNING_SOME_BLUE_VALUES_ARE_NOT_ZERO = 1 << 8,
+ WARNING_SOME_GREEN_VALUES_ARE_NOT_ZERO = 1 << 9,
+ //
+ ERROR_THRESHOLD = 1 << 16,
+ //
+ ERROR_UNKNOWN_FORMAT = 1 << 17,
+ ERROR_UNKNOWN_ERROR_METRIC = 1 << 18,
+ ERROR_ZERO_WIDTH_OR_HEIGHT = 1 << 19,
+ //
+ };
+
+ enum class Format
+ {
+ UNKNOWN,
+ //
+ ETC1,
+ //
+ // ETC2 formats
+ RGB8,
+ SRGB8,
+ RGBA8,
+ SRGBA8,
+ R11,
+ SIGNED_R11,
+ RG11,
+ SIGNED_RG11,
+ RGB8A1,
+ SRGB8A1,
+ //
+ FORMATS,
+ //
+ DEFAULT = SRGB8
+ };
+
+ // constructor using source image
+ Image(float *a_pafSourceRGBA, unsigned int a_uiSourceWidth,
+ unsigned int a_uiSourceHeight,
+ ErrorMetric a_errormetric);
+
+ // constructor using encoding bits
+ Image(Format a_format,
+ unsigned int a_uiSourceWidth, unsigned int a_uiSourceHeight,
+ unsigned char *a_paucEncidingBits, unsigned int a_uiEncodingBitsBytes,
+ Image *a_pimageSource,
+ ErrorMetric a_errormetric);
+
+ ~Image(void);
+
+ EncodingStatus Encode(Format a_format, ErrorMetric a_errormetric, float a_fEffort,
+ unsigned int a_uiJobs, unsigned int a_uiMaxJobs);
+
+ inline void AddToEncodingStatus(EncodingStatus a_encStatus)
+ {
+ m_encodingStatus = (EncodingStatus)((unsigned int)m_encodingStatus | (unsigned int)a_encStatus);
+ }
+
+ inline unsigned int GetSourceWidth(void)
+ {
+ return m_uiSourceWidth;
+ }
+
+ inline unsigned int GetSourceHeight(void)
+ {
+ return m_uiSourceHeight;
+ }
+
+ inline unsigned int GetExtendedWidth(void)
+ {
+ return m_uiExtendedWidth;
+ }
+
+ inline unsigned int GetExtendedHeight(void)
+ {
+ return m_uiExtendedHeight;
+ }
+
+ inline unsigned int GetNumberOfBlocks()
+ {
+ return m_uiBlockColumns * m_uiBlockRows;
+ }
+
+ inline Block4x4 * GetBlocks()
+ {
+ return m_pablock;
+ }
+
+ inline unsigned char * GetEncodingBits(void)
+ {
+ return m_paucEncodingBits;
+ }
+
+ inline unsigned int GetEncodingBitsBytes(void)
+ {
+ return m_uiEncodingBitsBytes;
+ }
+
+ inline int GetEncodingTimeMs(void)
+ {
+ return m_iEncodeTime_ms;
+ }
+
+ float GetError(void);
+
+ inline ColorFloatRGBA * GetSourcePixel(unsigned int a_uiH, unsigned int a_uiV)
+ {
+ if (a_uiH >= m_uiSourceWidth || a_uiV >= m_uiSourceHeight)
+ {
+ return nullptr;
+ }
+
+ return &m_pafrgbaSource[a_uiV*m_uiSourceWidth + a_uiH];
+ }
+
+ inline Format GetFormat(void)
+ {
+ return m_format;
+ }
+
+ static Block4x4EncodingBits::Format DetermineEncodingBitsFormat(Format a_format);
+
+ inline static unsigned short CalcExtendedDimension(unsigned short a_ushOriginalDimension)
+ {
+ return (unsigned short)((a_ushOriginalDimension + 3) & ~3);
+ }
+
+ inline ErrorMetric GetErrorMetric(void)
+ {
+ return m_errormetric;
+ }
+
+ static const char * EncodingFormatToString(Image::Format a_format);
+ const char * EncodingFormatToString(void);
+ //used to get basic information about the image data
+ int m_iNumOpaquePixels;
+ int m_iNumTranslucentPixels;
+ int m_iNumTransparentPixels;
+
+ ColorFloatRGBA m_numColorValues;
+ ColorFloatRGBA m_numOutOfRangeValues;
+
+ bool m_bVerboseOutput;
+ private:
+ //add a warning or error to check for while encoding
+ inline void TrackEncodingWarning(EncodingStatus a_encStatus)
+ {
+ m_warningsToCapture = (EncodingStatus)((unsigned int)m_warningsToCapture | (unsigned int)a_encStatus);
+ }
+
+ //report the warning if it is something we care about for this encoding
+ inline void AddToEncodingStatusIfSignfigant(EncodingStatus a_encStatus)
+ {
+ if ((EncodingStatus)((unsigned int)m_warningsToCapture & (unsigned int)a_encStatus) == a_encStatus)
+ {
+ AddToEncodingStatus(a_encStatus);
+ }
+ }
+
+ Image(void);
+ void FindEncodingWarningTypesForCurFormat();
+ void FindAndSetEncodingWarnings();
+
+ void InitBlocksAndBlockSorter(void);
+
+ void RunFirstPass(unsigned int a_uiMultithreadingOffset,
+ unsigned int a_uiMultithreadingStride);
+
+ void SetEncodingBits(unsigned int a_uiMultithreadingOffset,
+ unsigned int a_uiMultithreadingStride);
+
+ unsigned int IterateThroughWorstBlocks(unsigned int a_uiMaxBlocks,
+ unsigned int a_uiMultithreadingOffset,
+ unsigned int a_uiMultithreadingStride);
+
+ // inputs
+ ColorFloatRGBA *m_pafrgbaSource;
+ unsigned int m_uiSourceWidth;
+ unsigned int m_uiSourceHeight;
+ unsigned int m_uiExtendedWidth;
+ unsigned int m_uiExtendedHeight;
+ unsigned int m_uiBlockColumns;
+ unsigned int m_uiBlockRows;
+ // intermediate data
+ Block4x4 *m_pablock;
+ // encoding
+ Format m_format;
+ Block4x4EncodingBits::Format m_encodingbitsformat;
+ unsigned int m_uiEncodingBitsBytes; // for entire image
+ unsigned char *m_paucEncodingBits;
+ ErrorMetric m_errormetric;
+ float m_fEffort;
+ // stats
+ int m_iEncodeTime_ms;
+
+ SortedBlockList *m_psortedblocklist;
+ //this will hold any warning or errors that happen during encoding
+ EncodingStatus m_encodingStatus;
+ //these will be the warnings we are tracking
+ EncodingStatus m_warningsToCapture;
+ };
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcIndividualTrys.cpp b/thirdparty/etc2comp/EtcIndividualTrys.cpp
new file mode 100644
index 0000000000..56ff4c65ec
--- /dev/null
+++ b/thirdparty/etc2comp/EtcIndividualTrys.cpp
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcIndividualTrys.cpp
+
+Gathers the results of the various encoding trys for both halves of a 4x4 block for Individual mode
+
+*/
+
+#include "EtcConfig.h"
+#include "EtcIndividualTrys.h"
+
+#include <assert.h>
+
+namespace Etc
+{
+
+ // ----------------------------------------------------------------------------------------------------
+ // construct a list of trys (encoding attempts)
+ //
+ // a_frgbaColor1 is the basecolor for the first half
+ // a_frgbaColor2 is the basecolor for the second half
+ // a_pauiPixelMapping1 is the pixel order for the first half
+ // a_pauiPixelMapping2 is the pixel order for the second half
+ // a_uiRadius is the amount to vary the base colors
+ //
+ IndividualTrys::IndividualTrys(ColorFloatRGBA a_frgbaColor1, ColorFloatRGBA a_frgbaColor2,
+ const unsigned int *a_pauiPixelMapping1,
+ const unsigned int *a_pauiPixelMapping2,
+ unsigned int a_uiRadius)
+ {
+ assert(a_uiRadius <= MAX_RADIUS);
+
+ ColorFloatRGBA frgbaQuantizedColor1 = a_frgbaColor1.QuantizeR4G4B4();
+ ColorFloatRGBA frgbaQuantizedColor2 = a_frgbaColor2.QuantizeR4G4B4();
+
+ // quantize base colors
+ // ensure that trys with a_uiRadius don't overflow
+ int iRed1 = MoveAwayFromEdge(frgbaQuantizedColor1.IntRed(15.0f), a_uiRadius);
+ int iGreen1 = MoveAwayFromEdge(frgbaQuantizedColor1.IntGreen(15.0f), a_uiRadius);
+ int iBlue1 = MoveAwayFromEdge(frgbaQuantizedColor1.IntBlue(15.0f), a_uiRadius);
+ int iRed2 = MoveAwayFromEdge(frgbaQuantizedColor2.IntRed(15.0f), a_uiRadius);
+ int iGreen2 = MoveAwayFromEdge(frgbaQuantizedColor2.IntGreen(15.0f), a_uiRadius);
+ int iBlue2 = MoveAwayFromEdge(frgbaQuantizedColor2.IntBlue(15.0f), a_uiRadius);
+
+ m_half1.Init(iRed1, iGreen1, iBlue1, a_pauiPixelMapping1, a_uiRadius);
+ m_half2.Init(iRed2, iGreen2, iBlue2, a_pauiPixelMapping2, a_uiRadius);
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ void IndividualTrys::Half::Init(int a_iRed, int a_iGreen, int a_iBlue,
+ const unsigned int *a_pauiPixelMapping, unsigned int a_uiRadius)
+ {
+
+ m_iRed = a_iRed;
+ m_iGreen = a_iGreen;
+ m_iBlue = a_iBlue;
+
+ m_pauiPixelMapping = a_pauiPixelMapping;
+ m_uiRadius = a_uiRadius;
+
+ m_uiTrys = 0;
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcIndividualTrys.h b/thirdparty/etc2comp/EtcIndividualTrys.h
new file mode 100644
index 0000000000..5fb12fbcf4
--- /dev/null
+++ b/thirdparty/etc2comp/EtcIndividualTrys.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "EtcColorFloatRGBA.h"
+
+namespace Etc
+{
+
+ class IndividualTrys
+ {
+ public:
+
+ static const unsigned int MAX_RADIUS = 1;
+
+ IndividualTrys(ColorFloatRGBA a_frgbaColor1,
+ ColorFloatRGBA a_frgbaColor2,
+ const unsigned int *a_pauiPixelMapping1,
+ const unsigned int *a_pauiPixelMapping2,
+ unsigned int a_uiRadius);
+
+ inline static int MoveAwayFromEdge(int a_i, int a_iDistance)
+ {
+ if (a_i < (0+ a_iDistance))
+ {
+ return (0 + a_iDistance);
+ }
+ else if (a_i > (15- a_iDistance))
+ {
+ return (15 - a_iDistance);
+ }
+
+ return a_i;
+ }
+
+ class Try
+ {
+ public :
+ static const unsigned int SELECTORS = 8; // per half
+
+ int m_iRed;
+ int m_iGreen;
+ int m_iBlue;
+ unsigned int m_uiCW;
+ unsigned int m_auiSelectors[SELECTORS];
+ float m_fError;
+ };
+
+ class Half
+ {
+ public:
+
+ static const unsigned int MAX_TRYS = 27;
+
+ void Init(int a_iRed, int a_iGreen, int a_iBlue,
+ const unsigned int *a_pauiPixelMapping,
+ unsigned int a_uiRadius);
+
+ // center of trys
+ int m_iRed;
+ int m_iGreen;
+ int m_iBlue;
+
+ const unsigned int *m_pauiPixelMapping;
+ unsigned int m_uiRadius;
+
+ unsigned int m_uiTrys;
+ Try m_atry[MAX_TRYS];
+
+ Try *m_ptryBest;
+ };
+
+ Half m_half1;
+ Half m_half2;
+
+ };
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcMath.cpp b/thirdparty/etc2comp/EtcMath.cpp
new file mode 100644
index 0000000000..096d5f7ab9
--- /dev/null
+++ b/thirdparty/etc2comp/EtcMath.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "EtcConfig.h"
+#include "EtcMath.h"
+
+namespace Etc
+{
+
+ // ----------------------------------------------------------------------------------------------------
+ // calculate the line that best fits the set of XY points contained in a_afX[] and a_afY[]
+ // use a_fSlope and a_fOffset to define that line
+ //
+ bool Regression(float a_afX[], float a_afY[], unsigned int a_Points,
+ float *a_fSlope, float *a_fOffset)
+ {
+ float fPoints = (float)a_Points;
+
+ float fSumX = 0.0f;
+ float fSumY = 0.0f;
+ float fSumXY = 0.0f;
+ float fSumX2 = 0.0f;
+
+ for (unsigned int uiPoint = 0; uiPoint < a_Points; uiPoint++)
+ {
+ fSumX += a_afX[uiPoint];
+ fSumY += a_afY[uiPoint];
+ fSumXY += a_afX[uiPoint] * a_afY[uiPoint];
+ fSumX2 += a_afX[uiPoint] * a_afX[uiPoint];
+ }
+
+ float fDivisor = fPoints*fSumX2 - fSumX*fSumX;
+
+ // if vertical line
+ if (fDivisor == 0.0f)
+ {
+ *a_fSlope = 0.0f;
+ *a_fOffset = 0.0f;
+ return true;
+ }
+
+ *a_fSlope = (fPoints*fSumXY - fSumX*fSumY) / fDivisor;
+ *a_fOffset = (fSumY - (*a_fSlope)*fSumX) / fPoints;
+
+ return false;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcMath.h b/thirdparty/etc2comp/EtcMath.h
new file mode 100644
index 0000000000..c58c9a91bc
--- /dev/null
+++ b/thirdparty/etc2comp/EtcMath.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <math.h>
+
+namespace Etc
+{
+
+ // ----------------------------------------------------------------------------------------------------
+ // return true if vertical line
+ bool Regression(float a_afX[], float a_afY[], unsigned int a_Points,
+ float *a_fSlope, float *a_fOffset);
+
+ inline float ConvertMSEToPSNR(float a_fMSE)
+ {
+ if (a_fMSE == 0.0f)
+ {
+ return INFINITY;
+ }
+
+ return 10.0f * log10f(1.0f / a_fMSE);
+ }
+
+
+}
diff --git a/thirdparty/etc2comp/EtcSortedBlockList.cpp b/thirdparty/etc2comp/EtcSortedBlockList.cpp
new file mode 100644
index 0000000000..bfa6b7b3fa
--- /dev/null
+++ b/thirdparty/etc2comp/EtcSortedBlockList.cpp
@@ -0,0 +1,228 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+EtcSortedBlockList.cpp
+
+SortedBlockList is a list of 4x4 blocks that can be used by the "effort" system to prioritize
+the encoding of the 4x4 blocks.
+
+The sorting is done with buckets, where each bucket is an indication of how much error each 4x4 block has
+
+*/
+
+#include "EtcConfig.h"
+#include "EtcSortedBlockList.h"
+
+#include "EtcBlock4x4.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+namespace Etc
+{
+
+ // ----------------------------------------------------------------------------------------------------
+ // construct an empty list
+ //
+ // allocate enough memory to add all of the image's 4x4 blocks later
+ // allocate enough buckets to sort the blocks
+ //
+ SortedBlockList::SortedBlockList(unsigned int a_uiImageBlocks, unsigned int a_uiBuckets)
+ {
+ m_uiImageBlocks = a_uiImageBlocks;
+ m_iBuckets = (int)a_uiBuckets;
+
+ m_uiAddedBlocks = 0;
+ m_uiSortedBlocks = 0;
+ m_palinkPool = new Link[m_uiImageBlocks];
+ m_pabucket = new Bucket[m_iBuckets];
+ m_fMaxError = 0.0f;
+
+ InitBuckets();
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+ SortedBlockList::~SortedBlockList(void)
+ {
+ delete[] m_palinkPool;
+ delete[] m_pabucket;
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // add a 4x4 block to the list
+ // the 4x4 block will be sorted later
+ //
+ void SortedBlockList::AddBlock(Block4x4 *a_pblock)
+ {
+ assert(m_uiAddedBlocks < m_uiImageBlocks);
+ Link *plink = &m_palinkPool[m_uiAddedBlocks++];
+ plink->Init(a_pblock);
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // sort all of the 4x4 blocks that have been added to the list
+ //
+ // first, determine the maximum error, then assign an error range to each bucket
+ // next, determine which bucket each 4x4 block belongs to based on the 4x4 block's error
+ // add the 4x4 block to the appropriate bucket
+ // lastly, walk thru the buckets and add each bucket to a sorted linked list
+ //
+ // the resultant sorting is an approximate sorting from most to least error
+ //
+ void SortedBlockList::Sort(void)
+ {
+ assert(m_uiAddedBlocks == m_uiImageBlocks);
+ InitBuckets();
+
+ // find max block error
+ m_fMaxError = -1.0f;
+
+ for (unsigned int uiLink = 0; uiLink < m_uiAddedBlocks; uiLink++)
+ {
+ Link *plinkBlock = &m_palinkPool[uiLink];
+
+ float fBlockError = plinkBlock->GetBlock()->GetError();
+ if (fBlockError > m_fMaxError)
+ {
+ m_fMaxError = fBlockError;
+ }
+ }
+ // prevent divide by zero or divide by negative
+ if (m_fMaxError <= 0.0f)
+ {
+ m_fMaxError = 1.0f;
+ }
+ //used for debugging
+ //int numDone = 0;
+ // put all of the blocks with unfinished encodings into the appropriate bucket
+ m_uiSortedBlocks = 0;
+ for (unsigned int uiLink = 0; uiLink < m_uiAddedBlocks; uiLink++)
+ {
+ Link *plinkBlock = &m_palinkPool[uiLink];
+
+ // if the encoding is done, don't add it to the list
+ if (plinkBlock->GetBlock()->GetEncoding()->IsDone())
+ {
+ //numDone++;
+ continue;
+ }
+
+ // calculate the appropriate sort bucket
+ float fBlockError = plinkBlock->GetBlock()->GetError();
+ int iBucket = (int) floorf(m_iBuckets * fBlockError / m_fMaxError);
+ // clamp to bucket index
+ iBucket = iBucket < 0 ? 0 : iBucket >= m_iBuckets ? m_iBuckets - 1 : iBucket;
+
+ // add block to bucket
+ {
+ Bucket *pbucket = &m_pabucket[iBucket];
+ if (pbucket->plinkLast)
+ {
+ pbucket->plinkLast->SetNext(plinkBlock);
+ pbucket->plinkLast = plinkBlock;
+ }
+ else
+ {
+ pbucket->plinkFirst = pbucket->plinkLast = plinkBlock;
+ }
+ plinkBlock->SetNext(nullptr);
+ }
+
+ m_uiSortedBlocks++;
+
+ if (0)
+ {
+ printf("%u: e=%.3f\n", uiLink, fBlockError);
+ Print();
+ printf("\n\n\n");
+ }
+ }
+ //printf("num blocks already done: %d\n",numDone);
+ //link the blocks together across buckets
+ m_plinkFirst = nullptr;
+ m_plinkLast = nullptr;
+ for (int iBucket = m_iBuckets - 1; iBucket >= 0; iBucket--)
+ {
+ Bucket *pbucket = &m_pabucket[iBucket];
+
+ if (pbucket->plinkFirst)
+ {
+ if (m_plinkFirst == nullptr)
+ {
+ m_plinkFirst = pbucket->plinkFirst;
+ }
+ else
+ {
+ assert(pbucket->plinkLast->GetNext() == nullptr);
+ m_plinkLast->SetNext(pbucket->plinkFirst);
+ }
+
+ m_plinkLast = pbucket->plinkLast;
+ }
+ }
+
+
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // clear all of the buckets. normally done in preparation for a sort
+ //
+ void SortedBlockList::InitBuckets(void)
+ {
+ for (int iBucket = 0; iBucket < m_iBuckets; iBucket++)
+ {
+ Bucket *pbucket = &m_pabucket[iBucket];
+
+ pbucket->plinkFirst = 0;
+ pbucket->plinkLast = 0;
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ // print out the list of sorted 4x4 blocks
+ // normally used for debugging
+ //
+ void SortedBlockList::Print(void)
+ {
+ for (int iBucket = m_iBuckets-1; iBucket >= 0; iBucket--)
+ {
+ Bucket *pbucket = &m_pabucket[iBucket];
+
+ unsigned int uiBlocks = 0;
+ for (Link *plink = pbucket->plinkFirst; plink != nullptr; plink = plink->GetNext() )
+ {
+ uiBlocks++;
+
+ if (plink == pbucket->plinkLast)
+ {
+ break;
+ }
+ }
+
+ float fBucketError = m_fMaxError * iBucket / m_iBuckets;
+ float fBucketRMS = sqrtf(fBucketError / (4.0f*16.0f) );
+ printf("%3d: e=%.3f rms=%.6f %u\n", iBucket, fBucketError, fBucketRMS, uiBlocks);
+ }
+ }
+
+ // ----------------------------------------------------------------------------------------------------
+ //
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/EtcSortedBlockList.h b/thirdparty/etc2comp/EtcSortedBlockList.h
new file mode 100644
index 0000000000..960e8adc34
--- /dev/null
+++ b/thirdparty/etc2comp/EtcSortedBlockList.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2015 The Etc2Comp Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+namespace Etc
+{
+ class Block4x4;
+
+ class SortedBlockList
+ {
+ public:
+
+ class Link
+ {
+ public:
+
+ inline void Init(Block4x4 *a_pblock)
+ {
+ m_pblock = a_pblock;
+ m_plinkNext = nullptr;
+ }
+
+ inline Block4x4 * GetBlock(void)
+ {
+ return m_pblock;
+ }
+
+ inline void SetNext(Link *a_plinkNext)
+ {
+ m_plinkNext = a_plinkNext;
+ }
+
+ inline Link * GetNext(void)
+ {
+ return m_plinkNext;
+ }
+
+ inline Link * Advance(unsigned int a_uiSteps = 1)
+ {
+ Link *plink = this;
+
+ for (unsigned int uiStep = 0; uiStep < a_uiSteps; uiStep++)
+ {
+ if (plink == nullptr)
+ {
+ break;
+ }
+
+ plink = plink->m_plinkNext;
+ }
+
+ return plink;
+ }
+
+ private:
+
+ Block4x4 *m_pblock;
+ Link *m_plinkNext;
+ };
+
+ SortedBlockList(unsigned int a_uiImageBlocks, unsigned int a_uiBuckets);
+ ~SortedBlockList(void);
+
+ void AddBlock(Block4x4 *a_pblock);
+
+ void Sort(void);
+
+ inline Link * GetLinkToFirstBlock(void)
+ {
+ return m_plinkFirst;
+ }
+
+ inline unsigned int GetNumberOfAddedBlocks(void)
+ {
+ return m_uiAddedBlocks;
+ }
+
+ inline unsigned int GetNumberOfSortedBlocks(void)
+ {
+ return m_uiSortedBlocks;
+ }
+
+ void Print(void);
+
+ private:
+
+ void InitBuckets(void);
+
+ class Bucket
+ {
+ public:
+ Link *plinkFirst;
+ Link *plinkLast;
+ };
+
+ unsigned int m_uiImageBlocks;
+ int m_iBuckets;
+
+ unsigned int m_uiAddedBlocks;
+ unsigned int m_uiSortedBlocks;
+ Link *m_palinkPool;
+ Bucket *m_pabucket;
+ float m_fMaxError;
+
+ Link *m_plinkFirst;
+ Link *m_plinkLast;
+
+ };
+
+} // namespace Etc
diff --git a/thirdparty/etc2comp/LICENSE b/thirdparty/etc2comp/LICENSE
new file mode 100644
index 0000000000..75b52484ea
--- /dev/null
+++ b/thirdparty/etc2comp/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/thirdparty/etc2comp/README.md b/thirdparty/etc2comp/README.md
new file mode 100644
index 0000000000..1c70ae9f4e
--- /dev/null
+++ b/thirdparty/etc2comp/README.md
@@ -0,0 +1,197 @@
+# Etc2Comp - Texture to ETC2 compressor
+
+Etc2Comp is a command line tool that converts textures (e.g. bitmaps)
+into the [ETC2](https://en.wikipedia.org/wiki/Ericsson_Texture_Compression)
+format. The tool is built with a focus on encoding performance
+to reduce the amount of time required to compile asset heavy applications as
+well as reduce overall application size.
+
+This repo provides source code that can be compiled into a binary. The
+binary can then be used to convert textures to the ETC2 format.
+
+Important: This is not an official Google product. It is an experimental
+library published as-is. Please see the CONTRIBUTORS.md file for information
+about questions or issues.
+
+## Setup
+This project uses [CMake](https://cmake.org/) to generate platform-specific
+build files:
+ - Linux: make files
+ - OS X: Xcode workspace files
+ - Microsoft Windows: Visual Studio solution files
+ - Note: CMake supports other formats, but this doc only provides steps for
+ one of each platform for brevity.
+
+Refer to each platform's setup section to setup your environment and build
+an Etc2Comp binary. Then skip to the usage section of this page for examples
+of how to use the library.
+
+### Setup for OS X
+ build tested on this config:
+ OS X 10.9.5 i7 16GB RAM
+ Xcode 5.1.1
+ cmake 3.2.3
+
+Start by downloading and installing the following components if they are not
+already installed on your development machine.
+ - *Xcode* version 5.1.1, or greater
+ - [CMake](https://cmake.org/download/) version 3.2.3, or greater
+
+To build the Etc2Comp binary:
+ 1. Open a *Terminal* window and navigate to the project directory.
+ 1. Run `mkdir build_xcode`
+ 1. Run `cd build_xcode`
+ 1. Run `cmake -G Xcode ../`
+ 1. Open *Xcode* and import the `build_xcode/EtcTest.xcodeproj` file.
+ 1. Open the Product menu and choose Build For -> Running.
+ 1. Once the build succeeds the binary located at `build_xcode/EtcTool/Debug/EtcTool`
+can be executed.
+
+Optional
+Xcode EtcTool ‘Run’ preferences
+note: if the build_xcode/EtcTest.xcodeproj is manually deleted then some Xcode preferences
+will need to be set by hand after cmake is run (these prefs are retained across
+cmake updates if the .xcodeproj is not deleted/removed)
+
+1. Set the active scheme to ‘EtcTool’
+1. Edit the scheme
+1. Select option ‘Run EtcTool’, then tab ‘Arguments’.
+Add this launch argument: ‘-argfile ../../EtcTool/args.txt’
+1. Select tab ‘Options’ and set a custom working directory to: ‘$(SRCROOT)/Build_Xcode/EtcTool’
+
+### SetUp for Windows
+
+1. Open a *Terminal* window and navigate to the project directory.
+1. Run `mkdir build_vs`
+1. Run `cd build_vs`
+1. Run CMAKE, noting what build version you need, and pointing to the parent directory as the source root;
+ For VS 2013 : `cmake -G "Visual Studio 12 2013 Win64" ../`
+ For VS 2015 : `cmake -G "Visual Studio 14 2015 Win64" ../`
+ NOTE: To see what supported Visual Studio outputs there are, run `cmake -G`
+1. open the 'EtcTest' solution
+1. make the 'EtcTool' project the start up project
+1. (optional) in the project properties, under 'Debugging ->command arguments'
+add the argfile textfile thats included in the EtcTool directory.
+example: -argfile C:\etc2\EtcTool\Args.txt
+
+### Setup For Linux
+The Linux build was tested on this config:
+ Ubuntu desktop 14.04
+ gcc/g++ 4.8
+ cmake 2.8.12.2
+
+1. Verify linux has cmake and C++-11 capable g++ installed
+1. Open shell
+1. Run `mkdir build_linux`
+1. Run `cd build_linux`
+1. Run `cmake ../`
+1. Run `make`
+1. navigate to the newly created EtcTool directory `cd EtcTool`
+1. run the executable: `./EtcTool -argfile ../../EtcTool/args.txt`
+
+Skip to the <a href="#usage">Usage</a> section for more information about using the
+tool.
+
+## Usage
+
+### Command Line Usage
+EtcTool can be run from the command line with the following usage:
+ etctool.exe source_image [options ...] -output encoded_image
+
+The encoder will use an array of RGBA floats read from the source_image to create
+an ETC1 or ETC2 encoded image in encoded_image. The RGBA floats should be in the
+range [0:1].
+
+Options:
+
+ -analyze <analysis_folder>
+ -argfile <arg_file> additional command line arguments read from a file
+ -blockAtHV <H V> encodes a single block that contains the
+ pixel specified by the H V coordinates
+ -compare <comparison_image> compares source_image to comparison_image
+ -effort <amount> number between 0 and 100 to specify the encoding quality
+ (100 is the highest quality)
+ -errormetric <error_metric> specify the error metric, the options are
+ rgba, rgbx, rec709, numeric and normalxyz
+ -format <etc_format> ETC1, RGB8, SRGB8, RGBA8, SRGB8, RGB8A1,
+ SRGB8A1 or R11
+ -help prints this message
+ -jobs or -j <thread_count> specifies the number of threads (default=1)
+ -normalizexyz normalize RGB to have a length of 1
+ -verbose or -v shows status information during the encoding
+ process
+ -mipmaps or -m <mip_count> sets the maximum number of mipaps to generate (default=1)
+ -mipwrap or -w <x|y|xy> sets the mipmap filter wrap mode (default=clamp)
+
+* -analyze will run an analysis of the encoding and place it in folder
+"analysis_folder" (e.g. ../analysis/kodim05). within the analysis_folder, a folder
+will be created with a name of the current date/time (e.g. 20151204_153306). this
+date/time folder is used to compare encodings of the same texture over time.
+within the date/time folder is a text file with several encoding stats and a 2x png
+image showing the encoding mode for each 4x4 block.
+
+* -argfile allows additional command line arguments to be placed in a text file
+
+* -blockAtHV selects the 4x4 pixel subset of the source image at position (H,V).
+This is mainly used for debugging
+
+* -compare compares the source image to the created encoded image. The encoding
+will dictate what error analysis is used in the comparison.
+
+* -effort uses an "amount" between 0 and 100 to determine how much additional effort
+to apply during the encoding.
+
+* -errormetric selects the fitting algorithm used by the encoder. "rgba" calculates
+RMS error using RGB components that are weighted by A. "rgbx" calculates RMS error
+using RGBA components, where A is treated as an additional data channel, instead of
+as alpha. "rec709" is similar to "rgba", except the RGB components are also weighted
+according to Rec709. "numeric" calculates RMS error using unweighted RGBA components.
+"normalize" calculates error based on dot product and vector length for RGB and RMS
+error for A.
+
+* -help prints out the usage message
+
+* -jobs enables multi-threading to speed up image encoding
+
+* -normalizexyz normalizes the source RGB to have a length of 1.
+
+* -verbose shows information on the current encoding process. It will then display the
+PSNR and time time it took to encode the image.
+
+* -mipmaps takes an argument that specifies how many mipmaps to generate from the
+source image. The mipmaps are generated with a lanczos3 filter using edge clamping.
+If the mipmaps option is not specified no mipmaps are created.
+
+* -mipwrap takes an argument that specifies the mipmap filter wrap mode. The options
+are "x", "y" and "xy" which specify wrapping in x only, y only or x and y respectively.
+The default options are clamping in both x and y.
+
+Note: Path names can use slashes or backslashes. The tool will convert the
+slashes to the appropriate polarity for the current platform.
+
+
+## API
+
+The library supports two different APIs - a C-like API that is not heavily
+class-based and a class-based API.
+
+main() in EtcTool.cpp contains an example of both APIs.
+
+The Encode() method now returns an EncodingStatus that contains bit flags for
+reporting various warnings and flags encountered when encoding.
+
+
+## Copyright
+Copyright 2015 Etc2Comp Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/thirdparty/freetype/include/freetype/config/ftconfig.h b/thirdparty/freetype/include/freetype/config/ftconfig.h
index 157a704fa8..889aebf5ab 100644
--- a/thirdparty/freetype/include/freetype/config/ftconfig.h
+++ b/thirdparty/freetype/include/freetype/config/ftconfig.h
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific configuration file (specification only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -143,6 +143,14 @@ FT_BEGIN_HEADER
#endif
+ /* Fix compiler warning with sgi compiler */
+#if defined( __sgi ) && !defined( __GNUC__ )
+#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
+#pragma set woff 3505
+#endif
+#endif
+
+
/*************************************************************************/
/* */
/* <Section> */
@@ -325,6 +333,15 @@ FT_BEGIN_HEADER
#endif
+#ifdef _WIN64
+ /* only 64bit Windows uses the LLP64 data model, i.e., */
+ /* 32bit integers, 64bit pointers */
+#define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
+#else
+#define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
+#endif
+
+
/*************************************************************************/
/* */
/* miscellaneous */
@@ -338,10 +355,11 @@ FT_BEGIN_HEADER
/* typeof condition taken from gnulib's `intprops.h' header file */
-#if ( __GNUC__ >= 2 || \
- defined( __IBM__TYPEOF__ ) || \
- ( __SUNPRO_C >= 0x5110 && !__STDC__ ) )
-#define FT_TYPEOF( type ) (__typeof__ (type))
+#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
+ ( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
+ defined( __IBM__TYPEOF__ ) ) || \
+ ( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
+#define FT_TYPEOF( type ) ( __typeof__ ( type ) )
#else
#define FT_TYPEOF( type ) /* empty */
#endif
diff --git a/thirdparty/freetype/include/freetype/config/ftheader.h b/thirdparty/freetype/include/freetype/config/ftheader.h
index 68e14834d4..d491af57c3 100644
--- a/thirdparty/freetype/include/freetype/config/ftheader.h
+++ b/thirdparty/freetype/include/freetype/config/ftheader.h
@@ -4,7 +4,7 @@
/* */
/* Build macros of the FreeType 2 library. */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -357,6 +357,19 @@
/*************************************************************************
*
* @macro:
+ * FT_PCF_DRIVER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * structures and macros related to the PCF driver module.
+ *
+ */
+#define FT_PCF_DRIVER_H <freetype/ftpcfdrv.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
* FT_TYPE1_TABLES_H
*
* @description:
diff --git a/thirdparty/freetype/include/freetype/config/ftoption.h b/thirdparty/freetype/include/freetype/config/ftoption.h
index afd32f1cda..1bf6e8f534 100644
--- a/thirdparty/freetype/include/freetype/config/ftoption.h
+++ b/thirdparty/freetype/include/freetype/config/ftoption.h
@@ -4,7 +4,7 @@
/* */
/* User-selectable configuration macros (specification only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -77,6 +77,36 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
+ /* If you enable this configuration option, FreeType recognizes an */
+ /* environment variable called `FREETYPE_PROPERTIES', which can be used */
+ /* to control the various font drivers and modules. The controllable */
+ /* properties are listed in the section `Controlling FreeType Modules' */
+ /* in the reference's table of contents; currently there are properties */
+ /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), */
+ /* TrueType (file `ftttdrv.h'), and PCF (file `ftpcfdrv.h'). */
+ /* */
+ /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */
+ /* multiple lines for better readability). */
+ /* */
+ /* <optional whitespace> */
+ /* <module-name1> ':' */
+ /* <property-name1> '=' <property-value1> */
+ /* <whitespace> */
+ /* <module-name2> ':' */
+ /* <property-name2> '=' <property-value2> */
+ /* ... */
+ /* */
+ /* Example: */
+ /* */
+ /* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */
+ /* cff:no-stem-darkening=1 \ */
+ /* autofitter:warping=1 */
+ /* */
+#define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+
+
+ /*************************************************************************/
+ /* */
/* Uncomment the line below if you want to activate sub-pixel rendering */
/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
/* */
@@ -148,7 +178,7 @@ FT_BEGIN_HEADER
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
-/* #define FT_CONFIG_OPTION_USE_LZW */ // -GODOT-
+#define FT_CONFIG_OPTION_USE_LZW
/*************************************************************************/
@@ -163,7 +193,7 @@ FT_BEGIN_HEADER
/* Define this macro if you want to enable this `feature'. See also */
/* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
/* */
-/* #define FT_CONFIG_OPTION_USE_ZLIB */ // -GODOT-
+#define FT_CONFIG_OPTION_USE_ZLIB
/*************************************************************************/
@@ -492,7 +522,21 @@ FT_BEGIN_HEADER
/* code will be used. */
/* */
/* Setting this macro is needed for systems that prohibit address */
- /* fixups, such as BREW. */
+ /* fixups, such as BREW. [Note that standard compilers like gcc or */
+ /* clang handle PIC generation automatically; you don't have to set */
+ /* FT_CONFIG_OPTION_PIC, which is only necessary for very special */
+ /* compilers.] */
+ /* */
+ /* Note that FT_CONFIG_OPTION_PIC support is not available for all */
+ /* modules (see `modules.cfg' for a complete list). For building with */
+ /* FT_CONFIG_OPTION_PIC support, do the following. */
+ /* */
+ /* 0. Clone the repository. */
+ /* 1. Define FT_CONFIG_OPTION_PIC. */
+ /* 2. Remove all subdirectories in `src' that don't have */
+ /* FT_CONFIG_OPTION_PIC support. */
+ /* 3. Comment out the corresponding modules in `modules.cfg'. */
+ /* 4. Compile. */
/* */
/* #define FT_CONFIG_OPTION_PIC */
@@ -596,17 +640,21 @@ FT_BEGIN_HEADER
/* [1] for a technical overview on what this means. See `ttinterp.h' */
/* for more details on the LEAN option. */
/* */
- /* There are three options. */
+ /* There are three possible values. */
/* */
- /* 1. This option is associated with the `Infinality' moniker. */
- /* Contributed by an individual nicknamed Infinality with the goal of */
+ /* Value 1: */
+ /* This value is associated with the `Infinality' moniker, */
+ /* contributed by an individual nicknamed Infinality with the goal of */
/* making TrueType fonts render better than on Windows. A high */
/* amount of configurability and flexibility, down to rules for */
/* single glyphs in fonts, but also very slow. Its experimental and */
/* slow nature and the original developer losing interest meant that */
/* this option was never enabled in default builds. */
/* */
- /* 2. The new default mode for the TrueType driver. The Infinality code */
+ /* The corresponding interpreter version is v38. */
+ /* */
+ /* Value 2: */
+ /* The new default mode for the TrueType driver. The Infinality code */
/* base was stripped to the bare minimum and all configurability */
/* removed in the name of speed and simplicity. The configurability */
/* was mainly aimed at legacy fonts like Arial, Times New Roman, or */
@@ -616,14 +664,19 @@ FT_BEGIN_HEADER
/* that modern and web fonts render well while legacy fonts render */
/* okay. */
/* */
- /* 3. Compile both. */
+ /* The corresponding interpreter version is v40. */
+ /* */
+ /* Value 3: */
+ /* Compile both, making both v38 and v40 available (the latter is the */
+ /* default). */
/* */
/* By undefining these, you get rendering behavior like on Windows */
/* without ClearType, i.e., Windows XP without ClearType enabled and */
/* Win9x (interpreter version v35). Or not, depending on how much */
/* hinting blood and testing tears the font designer put into a given */
/* font. If you define one or both subpixel hinting options, you can */
- /* switch between between v35 and the ones you define. */
+ /* switch between between v35 and the ones you define (using */
+ /* `FT_Property_Set'). */
/* */
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
@@ -631,7 +684,7 @@ FT_BEGIN_HEADER
/* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 */
+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
@@ -791,6 +844,33 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
/**** ****/
+ /**** P C F D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* There are many PCF fonts just called `Fixed' which look completely */
+ /* different, and which have nothing to do with each other. When */
+ /* selecting `Fixed' in KDE or Gnome one gets results that appear rather */
+ /* random, the style changes often if one changes the size and one */
+ /* cannot select some fonts at all. This option makes the PCF module */
+ /* prepend the foundry name (plus a space) to the family name. */
+ /* */
+ /* We also check whether we have `wide' characters; all put together, we */
+ /* get family names like `Sony Fixed' or `Misc Fixed Wide'. */
+ /* */
+ /* If this option is activated, it can be controlled with the */
+ /* `no-long-family-names' property of the pcf driver module. */
+ /* */
+/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
@@ -806,7 +886,9 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
- /* Compile autofit module with Indic script support. */
+ /* Compile autofit module with fallback Indic script support, covering */
+ /* some scripts that the `latin' submodule of the autofit module doesn't */
+ /* (yet) handle. */
/* */
#define AF_CONFIG_OPTION_INDIC
@@ -825,6 +907,26 @@ FT_BEGIN_HEADER
/* */
#define AF_CONFIG_OPTION_USE_WARPER
+ /*************************************************************************/
+ /* */
+ /* Use TrueType-like size metrics for `light' auto-hinting. */
+ /* */
+ /* It is strongly recommended to avoid this option, which exists only to */
+ /* help some legacy applications retain its appearance and behaviour */
+ /* with respect to auto-hinted TrueType fonts. */
+ /* */
+ /* The very reason this option exists at all are GNU/Linux distributions */
+ /* like Fedora that did not un-patch the following change (which was */
+ /* present in FreeType between versions 2.4.6 and 2.7.1, inclusive). */
+ /* */
+ /* 2011-07-16 Steven Chu <steven.f.chu@gmail.com> */
+ /* */
+ /* [truetype] Fix metrics on size request for scalable fonts. */
+ /* */
+ /* This problematic commit is now reverted (more or less). */
+ /* */
+/* #define AF_CONFIG_OPTION_TT_SIZE_METRICS */
+
/* */
@@ -842,6 +944,7 @@ FT_BEGIN_HEADER
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
#endif
@@ -850,6 +953,7 @@ FT_BEGIN_HEADER
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
#endif
#endif
+#endif
/*
diff --git a/thirdparty/freetype/include/freetype/config/ftstdlib.h b/thirdparty/freetype/include/freetype/config/ftstdlib.h
index 562e255810..05a4845fd5 100644
--- a/thirdparty/freetype/include/freetype/config/ftstdlib.h
+++ b/thirdparty/freetype/include/freetype/config/ftstdlib.h
@@ -5,7 +5,7 @@
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -142,7 +142,8 @@
/**********************************************************************/
-#define ft_atol atol
+#define ft_strtol strtol
+#define ft_getenv getenv
/**********************************************************************/
diff --git a/thirdparty/freetype/include/freetype/freetype.h b/thirdparty/freetype/include/freetype/freetype.h
index 45e10c48a2..2989fbb5e1 100644
--- a/thirdparty/freetype/include/freetype/freetype.h
+++ b/thirdparty/freetype/include/freetype/freetype.h
@@ -4,7 +4,7 @@
/* */
/* FreeType high-level API and common types (specification only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -175,6 +175,7 @@ FT_BEGIN_HEADER
/* FT_Done_Face */
/* FT_Reference_Face */
/* FT_New_Memory_Face */
+ /* FT_Face_Properties */
/* FT_Open_Face */
/* FT_Open_Args */
/* FT_Parameter */
@@ -265,8 +266,8 @@ FT_BEGIN_HEADER
/* FT_Glyph_Metrics */
/* */
/* <Description> */
- /* A structure used to model the metrics of a single glyph. The */
- /* values are expressed in 26.6 fractional pixel format; if the flag */
+ /* A structure to model the metrics of a single glyph. The values */
+ /* are expressed in 26.6 fractional pixel format; if the flag */
/* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
/* are expressed in font units instead. */
/* */
@@ -305,6 +306,11 @@ FT_BEGIN_HEADER
/* `horiAdvance' or `vertAdvance'; you have to manually adjust these */
/* values to account for the added width and height. */
/* */
+ /* FreeType doesn't use the `VORG' table data for CFF fonts because */
+ /* it doesn't have an interface to quickly retrieve the glyph height. */
+ /* The y~coordinate of the vertical origin can be simply computed as */
+ /* `vertBearingY + height' after loading a glyph. */
+ /* */
typedef struct FT_Glyph_Metrics_
{
FT_Pos width;
@@ -349,10 +355,10 @@ FT_BEGIN_HEADER
/* */
/* <Note> */
/* Windows FNT: */
- /* The nominal size given in a FNT font is not reliable. Thus when */
- /* the driver finds it incorrect, it sets `size' to some calculated */
- /* values and sets `x_ppem' and `y_ppem' to the pixel width and */
- /* height given in the font, respectively. */
+ /* The nominal size given in a FNT font is not reliable. If the */
+ /* driver finds it incorrect, it sets `size' to some calculated */
+ /* values, and `x_ppem' and `y_ppem' to the pixel width and height */
+ /* given in the font, respectively. */
/* */
/* TrueType embedded bitmaps: */
/* `size', `width', and `height' values are not contained in the */
@@ -421,9 +427,9 @@ FT_BEGIN_HEADER
/* FT_Module */
/* */
/* <Description> */
- /* A handle to a given FreeType module object. Each module can be a */
+ /* A handle to a given FreeType module object. A module can be a */
/* font driver, a renderer, or anything else that provides services */
- /* to the formers. */
+ /* to the former. */
/* */
typedef struct FT_ModuleRec_* FT_Module;
@@ -434,8 +440,8 @@ FT_BEGIN_HEADER
/* FT_Driver */
/* */
/* <Description> */
- /* A handle to a given FreeType font driver object. Each font driver */
- /* is a special module capable of creating faces from font files. */
+ /* A handle to a given FreeType font driver object. A font driver */
+ /* is a module capable of creating faces from font files. */
/* */
typedef struct FT_DriverRec_* FT_Driver;
@@ -446,10 +452,10 @@ FT_BEGIN_HEADER
/* FT_Renderer */
/* */
/* <Description> */
- /* A handle to a given FreeType renderer. A renderer is a special */
- /* module in charge of converting a glyph image to a bitmap, when */
- /* necessary. Each renderer supports a given glyph image format, and */
- /* one or more target surface depths. */
+ /* A handle to a given FreeType renderer. A renderer is a module in */
+ /* charge of converting a glyph's outline image to a bitmap. It */
+ /* supports a single glyph image format, and one or more target */
+ /* surface depths. */
/* */
typedef struct FT_RendererRec_* FT_Renderer;
@@ -467,15 +473,15 @@ FT_BEGIN_HEADER
/* FT_Face */
/* */
/* <Description> */
- /* A handle to a given typographic face object. A face object models */
- /* a given typeface, in a given style. */
+ /* A handle to a typographic face object. A face object models a */
+ /* given typeface, in a given style. */
/* */
/* <Note> */
- /* Each face object also owns a single @FT_GlyphSlot object, as well */
+ /* A face object also owns a single @FT_GlyphSlot object, as well */
/* as one or more @FT_Size objects. */
/* */
/* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
- /* a given filepathname or a custom input stream. */
+ /* a given filepath or a custom input stream. */
/* */
/* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
/* */
@@ -500,11 +506,11 @@ FT_BEGIN_HEADER
/* FT_Size */
/* */
/* <Description> */
- /* A handle to an object used to model a face scaled to a given */
+ /* A handle to an object that models a face scaled to a given */
/* character size. */
/* */
/* <Note> */
- /* Each @FT_Face has an _active_ @FT_Size object that is used by */
+ /* An @FT_Face has one _active_ @FT_Size object that is used by */
/* functions like @FT_Load_Glyph to determine the scaling */
/* transformation that in turn is used to load and hint glyphs and */
/* metrics. */
@@ -531,9 +537,8 @@ FT_BEGIN_HEADER
/* FT_GlyphSlot */
/* */
/* <Description> */
- /* A handle to a given `glyph slot'. A slot is a container where it */
- /* is possible to load any of the glyphs contained in its parent */
- /* face. */
+ /* A handle to a given `glyph slot'. A slot is a container that can */
+ /* hold any of the glyphs contained in its parent face. */
/* */
/* In other words, each time you call @FT_Load_Glyph or */
/* @FT_Load_Char, the slot's content is erased by the new glyph data, */
@@ -552,13 +557,14 @@ FT_BEGIN_HEADER
/* FT_CharMap */
/* */
/* <Description> */
- /* A handle to a given character map. A charmap is used to translate */
- /* character codes in a given encoding into glyph indexes for its */
- /* parent's face. Some font formats may provide several charmaps per */
- /* font. */
+ /* A handle to a character map (usually abbreviated to `charmap'). A */
+ /* charmap is used to translate character codes in a given encoding */
+ /* into glyph indexes for its parent's face. Some font formats may */
+ /* provide several charmaps per font. */
/* */
/* Each face object owns zero or more charmaps, but only one of them */
- /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
+ /* can be `active', providing the data used by @FT_Get_Char_Index or */
+ /* @FT_Load_Char. */
/* */
/* The list of available charmaps in a face is available through the */
/* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
@@ -615,8 +621,8 @@ FT_BEGIN_HEADER
/* FT_Encoding */
/* */
/* <Description> */
- /* An enumeration used to specify character sets supported by */
- /* charmaps. Used in the @FT_Select_Charmap API function. */
+ /* An enumeration to specify character sets supported by charmaps. */
+ /* Used in the @FT_Select_Charmap API function. */
/* */
/* <Note> */
/* Despite the name, this enumeration lists specific character */
@@ -630,18 +636,17 @@ FT_BEGIN_HEADER
/* The encoding value~0 is reserved. */
/* */
/* FT_ENCODING_UNICODE :: */
- /* Corresponds to the Unicode character set. This value covers */
- /* all versions of the Unicode repertoire, including ASCII and */
- /* Latin-1. Most fonts include a Unicode charmap, but not all */
- /* of them. */
+ /* The Unicode character set. This value covers all versions of */
+ /* the Unicode repertoire, including ASCII and Latin-1. Most fonts */
+ /* include a Unicode charmap, but not all of them. */
/* */
/* For example, if you want to access Unicode value U+1F028 (and */
/* the font contains it), use value 0x1F028 as the input value for */
/* @FT_Get_Char_Index. */
/* */
/* FT_ENCODING_MS_SYMBOL :: */
- /* Corresponds to the Microsoft Symbol encoding, used to encode */
- /* mathematical symbols and wingdings. For more information, see */
+ /* Microsoft Symbol encoding, used to encode mathematical symbols */
+ /* and wingdings. For more information, see */
/* `http://www.microsoft.com/typography/otspec/recom.htm', */
/* `http://www.kostis.net/charsets/symbol.htm', and */
/* `http://www.kostis.net/charsets/wingding.htm'. */
@@ -650,60 +655,60 @@ FT_BEGIN_HEADER
/* Area) in the range U+F020-U+F0FF. */
/* */
/* FT_ENCODING_SJIS :: */
- /* Corresponds to Japanese SJIS encoding. More info at */
- /* `http://en.wikipedia.org/wiki/Shift_JIS'. */
- /* See note on multi-byte encodings below. */
+ /* Shift JIS encoding for Japanese. More info at */
+ /* `http://en.wikipedia.org/wiki/Shift_JIS'. See note on */
+ /* multi-byte encodings below. */
/* */
- /* FT_ENCODING_GB2312 :: */
- /* Corresponds to an encoding system for Simplified Chinese as */
- /* used in mainland China. */
+ /* FT_ENCODING_PRC :: */
+ /* Corresponds to encoding systems mainly for Simplified Chinese as */
+ /* used in People's Republic of China (PRC). The encoding layout */
+ /* is based on GB~2312 and its supersets GBK and GB~18030. */
/* */
/* FT_ENCODING_BIG5 :: */
/* Corresponds to an encoding system for Traditional Chinese as */
/* used in Taiwan and Hong Kong. */
/* */
/* FT_ENCODING_WANSUNG :: */
- /* Corresponds to the Korean encoding system known as Wansung. */
+ /* Corresponds to the Korean encoding system known as Extended */
+ /* Wansung (MS Windows code page 949). */
/* For more information see */
- /* `https://msdn.microsoft.com/en-US/goglobal/cc305154'. */
+ /* `http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit949.txt'. */
/* */
/* FT_ENCODING_JOHAB :: */
/* The Korean standard character set (KS~C 5601-1992), which */
/* corresponds to MS Windows code page 1361. This character set */
- /* includes all possible Hangeul character combinations. */
+ /* includes all possible Hangul character combinations. */
/* */
/* FT_ENCODING_ADOBE_LATIN_1 :: */
/* Corresponds to a Latin-1 encoding as defined in a Type~1 */
/* PostScript font. It is limited to 256 character codes. */
/* */
/* FT_ENCODING_ADOBE_STANDARD :: */
- /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
- /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
- /* codes. */
+ /* Adobe Standard encoding, as found in Type~1, CFF, and */
+ /* OpenType/CFF fonts. It is limited to 256 character codes. */
/* */
/* FT_ENCODING_ADOBE_EXPERT :: */
- /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
- /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
- /* codes. */
+ /* Adobe Expert encoding, as found in Type~1, CFF, and OpenType/CFF */
+ /* fonts. It is limited to 256 character codes. */
/* */
/* FT_ENCODING_ADOBE_CUSTOM :: */
/* Corresponds to a custom encoding, as found in Type~1, CFF, and */
/* OpenType/CFF fonts. It is limited to 256 character codes. */
/* */
/* FT_ENCODING_APPLE_ROMAN :: */
- /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
- /* and OpenType fonts contain a charmap for this encoding, since */
- /* older versions of Mac OS are able to use it. */
+ /* Apple roman encoding. Many TrueType and OpenType fonts contain */
+ /* a charmap for this 8-bit encoding, since older versions of Mac */
+ /* OS are able to use it. */
/* */
/* FT_ENCODING_OLD_LATIN_2 :: */
- /* This value is deprecated and was never used nor reported by */
+ /* This value is deprecated and was neither used nor reported by */
/* FreeType. Don't use or test for it. */
/* */
/* FT_ENCODING_MS_SJIS :: */
/* Same as FT_ENCODING_SJIS. Deprecated. */
/* */
/* FT_ENCODING_MS_GB2312 :: */
- /* Same as FT_ENCODING_GB2312. Deprecated. */
+ /* Same as FT_ENCODING_PRC. Deprecated. */
/* */
/* FT_ENCODING_MS_BIG5 :: */
/* Same as FT_ENCODING_BIG5. Deprecated. */
@@ -716,7 +721,7 @@ FT_BEGIN_HEADER
/* */
/* <Note> */
/* By default, FreeType automatically synthesizes a Unicode charmap */
- /* for PostScript fonts, using their glyph names dictionaries. */
+ /* for PostScript fonts, using their glyph name dictionaries. */
/* However, it also reports the encodings defined explicitly in the */
/* font file, for the cases when they are needed, with the Adobe */
/* values as well. */
@@ -736,7 +741,7 @@ FT_BEGIN_HEADER
/* Russian). */
/* */
/* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
- /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
+ /* and `encoding_id' is not `TT_MAC_ID_ROMAN' (otherwise it is set to */
/* FT_ENCODING_APPLE_ROMAN). */
/* */
/* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
@@ -748,9 +753,9 @@ FT_BEGIN_HEADER
/* to get an idea how to do that. Basically, if the language ID */
/* is~0, don't use it, otherwise subtract 1 from the language ID. */
/* Then examine `encoding_id'. If, for example, `encoding_id' is */
- /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
+ /* `TT_MAC_ID_ROMAN' and the language ID (minus~1) is */
/* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
- /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
+ /* `TT_MAC_ID_ARABIC' with `TT_MAC_LANGID_FARSI' means the Farsi */
/* variant the Arabic encoding. */
/* */
typedef enum FT_Encoding_
@@ -761,14 +766,15 @@ FT_BEGIN_HEADER
FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ),
FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ),
- FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ),
+ FT_ENC_TAG( FT_ENCODING_PRC, 'g', 'b', ' ', ' ' ),
FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ),
FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ),
- /* for backwards compatibility */
+ /* for backward compatibility */
+ FT_ENCODING_GB2312 = FT_ENCODING_PRC,
FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,
- FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,
+ FT_ENCODING_MS_GB2312 = FT_ENCODING_PRC,
FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,
FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,
@@ -793,7 +799,7 @@ FT_BEGIN_HEADER
#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
#define ft_encoding_sjis FT_ENCODING_SJIS
-#define ft_encoding_gb2312 FT_ENCODING_GB2312
+#define ft_encoding_gb2312 FT_ENCODING_PRC
#define ft_encoding_big5 FT_ENCODING_BIG5
#define ft_encoding_wansung FT_ENCODING_WANSUNG
#define ft_encoding_johab FT_ENCODING_JOHAB
@@ -820,11 +826,11 @@ FT_BEGIN_HEADER
/* */
/* platform_id :: An ID number describing the platform for the */
/* following encoding ID. This comes directly from */
- /* the TrueType specification and should be emulated */
- /* for other formats. */
+ /* the TrueType specification and gets emulated for */
+ /* other formats. */
/* */
/* encoding_id :: A platform specific encoding number. This also */
- /* comes from the TrueType specification and should be */
+ /* comes from the TrueType specification and gets */
/* emulated similarly. */
/* */
typedef struct FT_CharMapRec_
@@ -852,8 +858,8 @@ FT_BEGIN_HEADER
/* FT_Face_Internal */
/* */
/* <Description> */
- /* An opaque handle to an `FT_Face_InternalRec' structure, used to */
- /* model private data of a given @FT_Face object. */
+ /* An opaque handle to an `FT_Face_InternalRec' structure that models */
+ /* the private data of a given @FT_Face object. */
/* */
/* This structure might change between releases of FreeType~2 and is */
/* not generally available to client applications. */
@@ -873,7 +879,7 @@ FT_BEGIN_HEADER
/* <Fields> */
/* num_faces :: The number of faces in the font file. Some */
/* font formats can have multiple faces in */
- /* a font file. */
+ /* a single font file. */
/* */
/* face_index :: This field holds two different values. */
/* Bits 0-15 are the index of the face in the */
@@ -881,14 +887,15 @@ FT_BEGIN_HEADER
/* are set to~0 if there is only one face in */
/* the font file. */
/* */
- /* Bits 16-30 are relevant to GX variation */
- /* fonts only, holding the named instance */
- /* index for the current face index (starting */
- /* with value~1; value~0 indicates font access */
- /* without GX variation data). For non-GX */
- /* fonts, bits 16-30 are ignored. If we have */
- /* the third named instance of face~4, say, */
- /* `face_index' is set to 0x00030004. */
+ /* Bits 16-30 are relevant to GX and OpenType */
+ /* variation fonts only, holding the named */
+ /* instance index for the current face index */
+ /* (starting with value~1; value~0 indicates */
+ /* font access without a named instance). For */
+ /* non-variation fonts, bits 16-30 are */
+ /* ignored. If we have the third named */
+ /* instance of face~4, say, `face_index' is */
+ /* set to 0x00030004. */
/* */
/* Bit 31 is always zero (this is, */
/* `face_index' is always a positive value). */
@@ -902,17 +909,21 @@ FT_BEGIN_HEADER
/* @FT_STYLE_FLAG_XXX for the details. Bits */
/* 16-30 hold the number of named instances */
/* available for the current face if we have a */
- /* GX variation (sub)font. Bit 31 is always */
- /* zero (this is, `style_flags' is always a */
- /* positive value). */
+ /* GX or OpenType variation (sub)font. Bit 31 */
+ /* is always zero (this is, `style_flags' is */
+ /* always a positive value). Note that a */
+ /* variation font has always at least one */
+ /* named instance, namely the default */
+ /* instance. */
/* */
/* num_glyphs :: The number of glyphs in the face. If the */
/* face is scalable and has sbits (see */
/* `num_fixed_sizes'), it is set to the number */
/* of outline glyphs. */
/* */
- /* For CID-keyed fonts, this value gives the */
- /* highest CID used in the font. */
+ /* For CID-keyed fonts (not in an SFNT */
+ /* wrapper) this value gives the highest CID */
+ /* used in the font. */
/* */
/* family_name :: The face's family name. This is an ASCII */
/* string, usually in English, that describes */
@@ -951,6 +962,10 @@ FT_BEGIN_HEADER
/* strikes in the face. It is set to NULL if */
/* there is no bitmap strike. */
/* */
+ /* Note that FreeType tries to sanitize the */
+ /* strike data since they are sometimes sloppy */
+ /* or incorrect, but this can easily fail. */
+ /* */
/* num_charmaps :: The number of charmaps in the face. */
/* */
/* charmaps :: An array of the charmaps of the face. */
@@ -986,8 +1001,8 @@ FT_BEGIN_HEADER
/* expressed in font units. For font formats */
/* not having this information, it is set to */
/* `bbox.yMin'. Note that this field is */
- /* usually negative. Only relevant for */
- /* scalable formats. */
+ /* negative for values below the baseline. */
+ /* Only relevant for scalable formats. */
/* */
/* height :: This value is the vertical distance */
/* between two consecutive baselines, */
@@ -1030,6 +1045,12 @@ FT_BEGIN_HEADER
/* Fields may be changed after a call to @FT_Attach_File or */
/* @FT_Attach_Stream. */
/* */
+ /* For an OpenType variation font, the values of the following fields */
+ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */
+ /* friends) if the font contains an `MVAR' table: `ascender', */
+ /* `descender', `height', `underline_position', and */
+ /* `underline_thickness'. */
+ /* */
typedef struct FT_FaceRec_
{
FT_Long num_faces;
@@ -1101,49 +1122,51 @@ FT_BEGIN_HEADER
/* */
/* <Values> */
/* FT_FACE_FLAG_SCALABLE :: */
- /* Indicates that the face contains outline glyphs. This doesn't */
- /* prevent bitmap strikes, i.e., a face can have both this and */
+ /* The face contains outline glyphs. Note that a face can contain */
+ /* bitmap strikes also, i.e., a face can have both this flag and */
/* @FT_FACE_FLAG_FIXED_SIZES set. */
/* */
/* FT_FACE_FLAG_FIXED_SIZES :: */
- /* Indicates that the face contains bitmap strikes. See also the */
+ /* The face contains bitmap strikes. See also the */
/* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */
/* */
/* FT_FACE_FLAG_FIXED_WIDTH :: */
- /* Indicates that the face contains fixed-width characters (like */
- /* Courier, Lucido, MonoType, etc.). */
+ /* The face contains fixed-width characters (like Courier, Lucida, */
+ /* MonoType, etc.). */
/* */
/* FT_FACE_FLAG_SFNT :: */
- /* Indicates that the face uses the `sfnt' storage scheme. For */
- /* now, this means TrueType and OpenType. */
+ /* The face uses the SFNT storage scheme. For now, this means */
+ /* TrueType and OpenType. */
/* */
/* FT_FACE_FLAG_HORIZONTAL :: */
- /* Indicates that the face contains horizontal glyph metrics. This */
- /* should be set for all common formats. */
+ /* The face contains horizontal glyph metrics. This should be set */
+ /* for all common formats. */
/* */
/* FT_FACE_FLAG_VERTICAL :: */
- /* Indicates that the face contains vertical glyph metrics. This */
- /* is only available in some formats, not all of them. */
+ /* The face contains vertical glyph metrics. This is only */
+ /* available in some formats, not all of them. */
/* */
/* FT_FACE_FLAG_KERNING :: */
- /* Indicates that the face contains kerning information. If set, */
- /* the kerning distance can be retrieved through the function */
- /* @FT_Get_Kerning. Otherwise the function always return the */
- /* vector (0,0). Note that FreeType doesn't handle kerning data */
- /* from the `GPOS' table (as present in some OpenType fonts). */
+ /* The face contains kerning information. If set, the kerning */
+ /* distance can be retrieved using the function @FT_Get_Kerning. */
+ /* Otherwise the function always return the vector (0,0). Note */
+ /* that FreeType doesn't handle kerning data from the SFNT `GPOS' */
+ /* table (as present in many OpenType fonts). */
/* */
/* FT_FACE_FLAG_FAST_GLYPHS :: */
/* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
/* */
/* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
- /* Indicates that the font contains multiple masters and is capable */
- /* of interpolating between them. See the multiple-masters */
- /* specific API for details. */
+ /* The face contains multiple masters and is capable of */
+ /* interpolating between them. Supported formats are Adobe MM, */
+ /* TrueType GX, and OpenType variation fonts. */
+ /* */
+ /* See the multiple-masters specific API for details. */
/* */
/* FT_FACE_FLAG_GLYPH_NAMES :: */
- /* Indicates that the font contains glyph names that can be */
- /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */
- /* fonts contain broken glyph name tables. Use the function */
+ /* The face contains glyph names, which can be retrieved using */
+ /* @FT_Get_Glyph_Name. Note that some TrueType fonts contain */
+ /* broken glyph name tables. Use the function */
/* @FT_Has_PS_Glyph_Names when needed. */
/* */
/* FT_FACE_FLAG_EXTERNAL_STREAM :: */
@@ -1152,31 +1175,31 @@ FT_BEGIN_HEADER
/* when @FT_Done_Face is called. Don't read or test this flag. */
/* */
/* FT_FACE_FLAG_HINTER :: */
- /* Set if the font driver has a hinting machine of its own. For */
- /* example, with TrueType fonts, it makes sense to use data from */
- /* the SFNT `gasp' table only if the native TrueType hinting engine */
- /* (with the bytecode interpreter) is available and active. */
+ /* The font driver has a hinting machine of its own. For example, */
+ /* with TrueType fonts, it makes sense to use data from the SFNT */
+ /* `gasp' table only if the native TrueType hinting engine (with */
+ /* the bytecode interpreter) is available and active. */
/* */
/* FT_FACE_FLAG_CID_KEYED :: */
- /* Set if the font is CID-keyed. In that case, the font is not */
- /* accessed by glyph indices but by CID values. For subsetted */
- /* CID-keyed fonts this has the consequence that not all index */
- /* values are a valid argument to FT_Load_Glyph. Only the CID */
- /* values for which corresponding glyphs in the subsetted font */
- /* exist make FT_Load_Glyph return successfully; in all other cases */
- /* you get an `FT_Err_Invalid_Argument' error. */
- /* */
- /* Note that CID-keyed fonts that are in an SFNT wrapper don't */
- /* have this flag set since the glyphs are accessed in the normal */
- /* way (using contiguous indices); the `CID-ness' isn't visible to */
- /* the application. */
+ /* The face is CID-keyed. In that case, the face is not accessed */
+ /* by glyph indices but by CID values. For subsetted CID-keyed */
+ /* fonts this has the consequence that not all index values are a */
+ /* valid argument to @FT_Load_Glyph. Only the CID values for which */
+ /* corresponding glyphs in the subsetted font exist make */
+ /* `FT_Load_Glyph' return successfully; in all other cases you get */
+ /* an `FT_Err_Invalid_Argument' error. */
+ /* */
+ /* Note that CID-keyed fonts that are in an SFNT wrapper (this is, */
+ /* all OpenType/CFF fonts) don't have this flag set since the */
+ /* glyphs are accessed in the normal way (using contiguous */
+ /* indices); the `CID-ness' isn't visible to the application. */
/* */
/* FT_FACE_FLAG_TRICKY :: */
- /* Set if the font is `tricky', this is, it always needs the */
- /* font format's native hinting engine to get a reasonable result. */
- /* A typical example is the Chinese font `mingli.ttf' that uses */
- /* TrueType bytecode instructions to move and scale all of its */
- /* subglyphs. */
+ /* The face is `tricky', this is, it always needs the font format's */
+ /* native hinting engine to get a reasonable result. A typical */
+ /* example is the old Chinese font `mingli.ttf' (but not */
+ /* `mingliu.ttc') that uses TrueType bytecode instructions to move */
+ /* and scale all of its subglyphs. */
/* */
/* It is not possible to auto-hint such fonts using */
/* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
@@ -1188,8 +1211,8 @@ FT_BEGIN_HEADER
/* tricky fonts; they are hard-coded in file `ttobjs.c'. */
/* */
/* FT_FACE_FLAG_COLOR :: */
- /* Set if the font has color glyph tables. To access color glyphs */
- /* use @FT_LOAD_COLOR. */
+ /* The face has color glyph tables. To access color glyphs use */
+ /* @FT_LOAD_COLOR. */
/* */
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
@@ -1261,7 +1284,7 @@ FT_BEGIN_HEADER
* @description:
* A macro that returns true whenever a face object contains a scalable
* font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,
- * and PFR font formats.
+ * and PFR font formats).
*
*/
#define FT_IS_SCALABLE( face ) \
@@ -1361,6 +1384,20 @@ FT_BEGIN_HEADER
/*************************************************************************
*
* @macro:
+ * FT_IS_NAMED_INSTANCE( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object is a named instance
+ * of a GX or OpenType variation font.
+ *
+ */
+#define FT_IS_NAMED_INSTANCE( face ) \
+ ( (face)->face_index & 0x7FFF0000L )
+
+
+ /*************************************************************************
+ *
+ * @macro:
* FT_IS_CID_KEYED( face )
*
* @description:
@@ -1410,15 +1447,15 @@ FT_BEGIN_HEADER
/* FT_STYLE_FLAG_XXX */
/* */
/* <Description> */
- /* A list of bit flags used to indicate the style of a given face. */
- /* These are used in the `style_flags' field of @FT_FaceRec. */
+ /* A list of bit flags to indicate the style of a given face. These */
+ /* are used in the `style_flags' field of @FT_FaceRec. */
/* */
/* <Values> */
/* FT_STYLE_FLAG_ITALIC :: */
- /* Indicates that a given face style is italic or oblique. */
+ /* The face style is italic or oblique. */
/* */
/* FT_STYLE_FLAG_BOLD :: */
- /* Indicates that a given face is bold. */
+ /* The face is bold. */
/* */
/* <Note> */
/* The style information as provided by FreeType is very basic. More */
@@ -1459,43 +1496,50 @@ FT_BEGIN_HEADER
/* hence the term `ppem' (pixels per EM). It is also */
/* referred to as `nominal height'. */
/* */
- /* x_scale :: A 16.16 fractional scaling value used to convert */
+ /* x_scale :: A 16.16 fractional scaling value to convert */
/* horizontal metrics from font units to 26.6 */
/* fractional pixels. Only relevant for scalable */
/* font formats. */
/* */
- /* y_scale :: A 16.16 fractional scaling value used to convert */
+ /* y_scale :: A 16.16 fractional scaling value to convert */
/* vertical metrics from font units to 26.6 */
/* fractional pixels. Only relevant for scalable */
/* font formats. */
/* */
- /* ascender :: The ascender in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
+ /* ascender :: The ascender in 26.6 fractional pixels, rounded up */
+ /* to an integer value. See @FT_FaceRec for the */
+ /* details. */
/* */
- /* descender :: The descender in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
+ /* descender :: The descender in 26.6 fractional pixels, rounded */
+ /* down to an integer value. See @FT_FaceRec for the */
+ /* details. */
/* */
- /* height :: The height in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
+ /* height :: The height in 26.6 fractional pixels, rounded to */
+ /* an integer value. See @FT_FaceRec for the */
+ /* details. */
/* */
/* max_advance :: The maximum advance width in 26.6 fractional */
- /* pixels. See @FT_FaceRec for the details. */
+ /* pixels, rounded to an integer value. See */
+ /* @FT_FaceRec for the details. */
/* */
/* <Note> */
/* The scaling values, if relevant, are determined first during a */
/* size changing operation. The remaining fields are then set by the */
/* driver. For scalable formats, they are usually set to scaled */
- /* values of the corresponding fields in @FT_FaceRec. */
+ /* values of the corresponding fields in @FT_FaceRec. Some values */
+ /* like ascender or descender are rounded for historical reasons; */
+ /* more precise values (for outline fonts) can be derived by scaling */
+ /* the corresponding @FT_FaceRec values manually. */
/* */
- /* Note that due to glyph hinting, these values might not be exact */
- /* for certain fonts. Thus they must be treated as unreliable */
- /* with an error margin of at least one pixel! */
+ /* Note that due to glyph hinting and the selected rendering mode */
+ /* these values are usually not exact; consequently, they must be */
+ /* treated as unreliable with an error margin of at least one pixel! */
/* */
/* Indeed, the only way to get the exact metrics is to render _all_ */
/* glyphs. As this would be a definite performance hit, it is up to */
/* client applications to perform such computations. */
/* */
- /* The FT_Size_Metrics structure is valid for bitmap fonts also. */
+ /* The `FT_Size_Metrics' structure is valid for bitmap fonts also. */
/* */
typedef struct FT_Size_Metrics_
{
@@ -1635,8 +1679,8 @@ FT_BEGIN_HEADER
/* contained in the glyph slot. Typically */
/* @FT_GLYPH_FORMAT_BITMAP, */
/* @FT_GLYPH_FORMAT_OUTLINE, or */
- /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */
- /* possible. */
+ /* @FT_GLYPH_FORMAT_COMPOSITE, but other values */
+ /* are possible. */
/* */
/* bitmap :: This field is used as a bitmap descriptor */
/* when the slot format is */
@@ -1651,16 +1695,15 @@ FT_BEGIN_HEADER
/* glyph slot contains a bitmap. */
/* */
/* bitmap_top :: The bitmap's top bearing expressed in integer */
- /* pixels. Remember that this is the distance */
- /* from the baseline to the top-most glyph */
- /* scanline, upwards y~coordinates being */
- /* *positive*. */
+ /* pixels. This is the distance from the */
+ /* baseline to the top-most glyph scanline, */
+ /* upwards y~coordinates being *positive*. */
/* */
/* outline :: The outline descriptor for the current glyph */
/* image if its format is */
/* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */
/* loaded, `outline' can be transformed, */
- /* distorted, embolded, etc. However, it must */
+ /* distorted, emboldened, etc. However, it must */
/* not be freed. */
/* */
/* num_subglyphs :: The number of subglyphs in a composite glyph. */
@@ -1676,15 +1719,13 @@ FT_BEGIN_HEADER
/* control_data :: Certain font drivers can also return the */
/* control data for a given glyph image (e.g. */
/* TrueType bytecode, Type~1 charstrings, etc.). */
- /* This field is a pointer to such data. */
+ /* This field is a pointer to such data; it is */
+ /* currently internal to FreeType. */
/* */
/* control_len :: This is the length in bytes of the control */
- /* data. */
+ /* data. Currently internal to FreeType. */
/* */
- /* other :: Really wicked formats can use this pointer to */
- /* present their own glyph image to client */
- /* applications. Note that the application */
- /* needs to know about the image format. */
+ /* other :: Reserved. */
/* */
/* lsb_delta :: The difference between hinted and unhinted */
/* left side bearing while auto-hinting is */
@@ -1701,7 +1742,7 @@ FT_BEGIN_HEADER
/* formats). */
/* */
/* This image can later be converted into a bitmap by calling */
- /* @FT_Render_Glyph. This function finds the current renderer for */
+ /* @FT_Render_Glyph. This function searches the current renderer for */
/* the native image's format, then invokes it. */
/* */
/* The renderer is in charge of transforming the native image through */
@@ -1713,34 +1754,65 @@ FT_BEGIN_HEADER
/* position (e.g., coordinates (0,0) on the baseline). Of course, */
/* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
/* */
- /* <Note> */
/* Here is a small pseudo code fragment that shows how to use */
- /* `lsb_delta' and `rsb_delta': */
+ /* `lsb_delta' and `rsb_delta' to do fractional positioning of */
+ /* glyphs: */
+ /* */
+ /* { */
+ /* FT_GlyphSlot slot = face->glyph; */
+ /* FT_Pos origin_x = 0; */
+ /* */
+ /* */
+ /* for all glyphs do */
+ /* <load glyph with `FT_Load_Glyph'> */
+ /* */
+ /* FT_Outline_Translate( slot->outline, origin_x & 63, 0 ); */
+ /* */
+ /* <save glyph image, or render glyph, or ...> */
+ /* */
+ /* <compute kern between current and next glyph */
+ /* and add it to `origin_x'> */
+ /* */
+ /* origin_x += slot->advance.x; */
+ /* origin_x += slot->rsb_delta - slot->lsb_relta; */
+ /* endfor */
+ /* } */
+ /* */
+ /* Here is another small pseudo code fragment that shows how to use */
+ /* `lsb_delta' and `rsb_delta' to improve integer positioning of */
+ /* glyphs: */
/* */
/* { */
- /* FT_Pos origin_x = 0; */
- /* FT_Pos prev_rsb_delta = 0; */
+ /* FT_GlyphSlot slot = face->glyph; */
+ /* FT_Pos origin_x = 0; */
+ /* FT_Pos prev_rsb_delta = 0; */
/* */
/* */
/* for all glyphs do */
- /* <compute kern between current and previous glyph and add it to */
- /* `origin_x'> */
+ /* <compute kern between current and previous glyph */
+ /* and add it to `origin_x'> */
/* */
/* <load glyph with `FT_Load_Glyph'> */
/* */
- /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
+ /* if ( prev_rsb_delta - slot->lsb_delta >= 32 ) */
/* origin_x -= 64; */
- /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
+ /* else if ( prev_rsb_delta - slot->lsb_delta < -32 ) */
/* origin_x += 64; */
/* */
- /* prev_rsb_delta = face->glyph->rsb_delta; */
+ /* prev_rsb_delta = slot->rsb_delta; */
/* */
/* <save glyph image, or render glyph, or ...> */
/* */
- /* origin_x += face->glyph->advance.x; */
+ /* origin_x += slot->advance.x; */
/* endfor */
/* } */
/* */
+ /* If you use strong auto-hinting, you *must* apply these delta */
+ /* values! Otherwise you will experience far too large inter-glyph */
+ /* spacing at small rendering sizes in most cases. Note that it */
+ /* doesn't harm to use the above code for other hinting modes also, */
+ /* since the delta values are zero then. */
+ /* */
typedef struct FT_GlyphSlotRec_
{
FT_Library library;
@@ -1805,7 +1877,8 @@ FT_BEGIN_HEADER
/* <Note> */
/* In case you want to provide your own memory allocating routines, */
/* use @FT_New_Library instead, followed by a call to */
- /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
+ /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module) */
+ /* and @FT_Set_Default_Properties. */
/* */
/* See the documentation of @FT_Library and @FT_Face for */
/* multi-threading issues. */
@@ -1813,6 +1886,11 @@ FT_BEGIN_HEADER
/* If you need reference-counting (cf. @FT_Reference_Library), use */
/* @FT_New_Library and @FT_Done_Library. */
/* */
+ /* If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is */
+ /* set, this function reads the `FREETYPE_PROPERTIES' environment */
+ /* variable to control driver properties. See sections @auto_hinter, */
+ /* @cff_driver, @pcf_driver, and @tt_driver for more. */
+ /* */
FT_EXPORT( FT_Error )
FT_Init_FreeType( FT_Library *alibrary );
@@ -1883,8 +1961,8 @@ FT_BEGIN_HEADER
/* FT_Parameter */
/* */
/* <Description> */
- /* A simple structure used to pass more or less generic parameters to */
- /* @FT_Open_Face. */
+ /* A simple structure to pass more or less generic parameters to */
+ /* @FT_Open_Face and @FT_Face_Properties. */
/* */
/* <Fields> */
/* tag :: A four-byte identification tag. */
@@ -1909,9 +1987,9 @@ FT_BEGIN_HEADER
/* FT_Open_Args */
/* */
/* <Description> */
- /* A structure used to indicate how to open a new font file or */
- /* stream. A pointer to such a structure can be used as a parameter */
- /* for the functions @FT_Open_Face and @FT_Attach_Stream. */
+ /* A structure to indicate how to open a new font file or stream. A */
+ /* pointer to such a structure can be used as a parameter for the */
+ /* functions @FT_Open_Face and @FT_Attach_Stream. */
/* */
/* <Fields> */
/* flags :: A set of bit flags indicating how to use the */
@@ -1926,9 +2004,10 @@ FT_BEGIN_HEADER
/* stream :: A handle to a source stream object. */
/* */
/* driver :: This field is exclusively used by @FT_Open_Face; */
- /* it simply specifies the font driver to use to open */
- /* the face. If set to~0, FreeType tries to load the */
- /* face with each one of the drivers in its list. */
+ /* it simply specifies the font driver to use for */
+ /* opening the face. If set to NULL, FreeType tries */
+ /* to load the face with each one of the drivers in */
+ /* its list. */
/* */
/* num_params :: The number of extra parameters. */
/* */
@@ -1958,7 +2037,7 @@ FT_BEGIN_HEADER
/* `num_params' and `params' is used. They are ignored otherwise. */
/* */
/* Ideally, both the `pathname' and `params' fields should be tagged */
- /* as `const'; this is missing for API backwards compatibility. In */
+ /* as `const'; this is missing for API backward compatibility. In */
/* other words, applications should treat them as read-only. */
/* */
typedef struct FT_Open_Args_
@@ -1981,7 +2060,7 @@ FT_BEGIN_HEADER
/* FT_New_Face */
/* */
/* <Description> */
- /* This function calls @FT_Open_Face to open a font by its pathname. */
+ /* Call @FT_Open_Face to open a font by its pathname. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
@@ -2016,8 +2095,8 @@ FT_BEGIN_HEADER
/* FT_New_Memory_Face */
/* */
/* <Description> */
- /* This function calls @FT_Open_Face to open a font that has been */
- /* loaded into memory. */
+ /* Call @FT_Open_Face to open a font that has been loaded into */
+ /* memory. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
@@ -2069,20 +2148,21 @@ FT_BEGIN_HEADER
/* with value~0). Set it to~0 if there is only one */
/* face in the font file. */
/* */
- /* Bits 16-30 are relevant to GX variation fonts only, */
- /* specifying the named instance index for the current */
- /* face index (starting with value~1; value~0 makes */
- /* FreeType ignore named instances). For non-GX fonts, */
- /* bits 16-30 are ignored. Assuming that you want to */
- /* access the third named instance in face~4, */
- /* `face_index' should be set to 0x00030004. If you */
- /* want to access face~4 without GX variation handling, */
- /* simply set `face_index' to value~4. */
- /* */
- /* FT_Open_Face and its siblings can be used to quickly */
- /* check whether the font format of a given font */
- /* resource is supported by FreeType. In general, if */
- /* the `face_index' argument is negative, the */
+ /* Bits 16-30 are relevant to GX and OpenType variation */
+ /* fonts only, specifying the named instance index for */
+ /* the current face index (starting with value~1; */
+ /* value~0 makes FreeType ignore named instances). For */
+ /* non-variation fonts, bits 16-30 are ignored. */
+ /* Assuming that you want to access the third named */
+ /* instance in face~4, `face_index' should be set to */
+ /* 0x00030004. If you want to access face~4 without */
+ /* variation handling, simply set `face_index' to */
+ /* value~4. */
+ /* */
+ /* `FT_Open_Face' and its siblings can be used to */
+ /* quickly check whether the font format of a given */
+ /* font resource is supported by FreeType. In general, */
+ /* if the `face_index' argument is negative, the */
/* function's return value is~0 if the font format is */
/* recognized, or non-zero otherwise. The function */
/* allocates a more or less empty face handle in */
@@ -2091,10 +2171,10 @@ FT_BEGIN_HEADER
/* `face->num_faces' and `face->style_flags'. For any */
/* negative value of `face_index', `face->num_faces' */
/* gives the number of faces within the font file. For */
- /* the negative value `-(N+1)' (with `N' a 16-bit */
- /* value), bits 16-30 in `face->style_flags' give the */
- /* number of named instances in face `N' if we have a */
- /* GX variation font (or zero otherwise). After */
+ /* the negative value `-(N+1)' (with `N' a non-negative */
+ /* 16-bit value), bits 16-30 in `face->style_flags' */
+ /* give the number of named instances in face `N' if we */
+ /* have a variation font (or zero otherwise). After */
/* examination, the returned @FT_Face structure should */
/* be deallocated with a call to @FT_Done_Face. */
/* */
@@ -2201,7 +2281,7 @@ FT_BEGIN_HEADER
/* FT_Attach_File */
/* */
/* <Description> */
- /* This function calls @FT_Attach_Stream to attach a file. */
+ /* Call @FT_Attach_Stream to attach a file. */
/* */
/* <InOut> */
/* face :: The target face object. */
@@ -2245,7 +2325,7 @@ FT_BEGIN_HEADER
/* */
/* Client applications are expected to know what they are doing */
/* when invoking this function. Most drivers simply do not implement */
- /* file attachments. */
+ /* file or stream attachments. */
/* */
FT_EXPORT( FT_Error )
FT_Attach_Stream( FT_Face face,
@@ -2308,7 +2388,10 @@ FT_BEGIN_HEADER
/* FT_Select_Size */
/* */
/* <Description> */
- /* Select a bitmap strike. */
+ /* Select a bitmap strike. To be more precise, this function sets */
+ /* the scaling factors of the active @FT_Size object in a face so */
+ /* that bitmaps from this particular strike are taken by */
+ /* @FT_Load_Glyph and friends. */
/* */
/* <InOut> */
/* face :: A handle to a target face object. */
@@ -2320,6 +2403,20 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
+ /* <Note> */
+ /* For bitmaps embedded in outline fonts it is common that only a */
+ /* subset of the available glyphs at a given ppem value is available. */
+ /* FreeType silently uses outlines if there is no bitmap for a given */
+ /* glyph index. */
+ /* */
+ /* For GX and OpenType variation fonts, a bitmap strike makes sense */
+ /* only if the default instance is active (this is, no glyph */
+ /* variation takes place); otherwise, FreeType simply ignores bitmap */
+ /* strikes. The same is true for all named instances that are */
+ /* different from the default instance. */
+ /* */
+ /* Don't use this function if you are using the FreeType cache API. */
+ /* */
FT_EXPORT( FT_Error )
FT_Select_Size( FT_Face face,
FT_Int strike_index );
@@ -2331,16 +2428,25 @@ FT_BEGIN_HEADER
/* FT_Size_Request_Type */
/* */
/* <Description> */
- /* An enumeration type that lists the supported size request types. */
+ /* An enumeration type that lists the supported size request types, */
+ /* i.e., what input size (in font units) maps to the requested output */
+ /* size (in pixels, as computed from the arguments of */
+ /* @FT_Size_Request). */
/* */
/* <Values> */
/* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
/* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
/* used to determine both scaling values. */
/* */
+ /* This is the standard scaling found in most applications. In */
+ /* particular, use this size request type for TrueType fonts if */
+ /* they provide optical scaling or something similar. Note, */
+ /* however, that `units_per_EM' is a rather abstract value which */
+ /* bears no relation to the actual size of the glyphs in a font. */
+ /* */
/* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
/* The real dimension. The sum of the `ascender' and (minus of) */
- /* the `descender' fields of @FT_FaceRec are used to determine both */
+ /* the `descender' fields of @FT_FaceRec is used to determine both */
/* scaling values. */
/* */
/* FT_SIZE_REQUEST_TYPE_BBOX :: */
@@ -2386,27 +2492,36 @@ FT_BEGIN_HEADER
/* FT_Size_RequestRec */
/* */
/* <Description> */
- /* A structure used to model a size request. */
+ /* A structure to model a size request. */
/* */
/* <Fields> */
/* type :: See @FT_Size_Request_Type. */
/* */
- /* width :: The desired width. */
+ /* width :: The desired width, given as a 26.6 fractional */
+ /* point value (with 72pt = 1in). */
/* */
- /* height :: The desired height. */
+ /* height :: The desired height, given as a 26.6 fractional */
+ /* point value (with 72pt = 1in). */
/* */
- /* horiResolution :: The horizontal resolution. If set to zero, */
- /* `width' is treated as a 26.6 fractional pixel */
- /* value. */
+ /* horiResolution :: The horizontal resolution (dpi, i.e., pixels per */
+ /* inch). If set to zero, `width' is treated as a */
+ /* 26.6 fractional *pixel* value, which gets */
+ /* internally rounded to an integer. */
/* */
- /* vertResolution :: The vertical resolution. If set to zero, */
- /* `height' is treated as a 26.6 fractional pixel */
- /* value. */
+ /* vertResolution :: The vertical resolution (dpi, i.e., pixels per */
+ /* inch). If set to zero, `height' is treated as a */
+ /* 26.6 fractional *pixel* value, which gets */
+ /* internally rounded to an integer. */
/* */
/* <Note> */
- /* If `width' is zero, then the horizontal scaling value is set equal */
+ /* If `width' is zero, the horizontal scaling value is set equal */
/* to the vertical scaling value, and vice versa. */
/* */
+ /* If `type' is FT_SIZE_REQUEST_TYPE_SCALES, `width' and `height' are */
+ /* interpreted directly as 16.16 fractional scaling values, without */
+ /* any further modification, and both `horiResolution' and */
+ /* `vertResolution' are ignored. */
+ /* */
typedef struct FT_Size_RequestRec_
{
FT_Size_Request_Type type;
@@ -2456,7 +2571,11 @@ FT_BEGIN_HEADER
/* size is dependent entirely on how the size is defined in the */
/* source face. The font designer chooses the final size of each */
/* glyph relative to this size. For more information refer to */
- /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */
+ /* `https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'. */
+ /* */
+ /* Contrary to @FT_Set_Char_Size, this function doesn't have special */
+ /* code to normalize zero-valued widths, heights, or resolutions */
+ /* (which lead to errors in most cases). */
/* */
/* Don't use this function if you are using the FreeType cache API. */
/* */
@@ -2471,8 +2590,7 @@ FT_BEGIN_HEADER
/* FT_Set_Char_Size */
/* */
/* <Description> */
- /* This function calls @FT_Request_Size to request the nominal size */
- /* (in points). */
+ /* Call @FT_Request_Size to request the nominal size (in points). */
/* */
/* <InOut> */
/* face :: A handle to a target face object. */
@@ -2490,6 +2608,10 @@ FT_BEGIN_HEADER
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
+ /* While this function allows fractional points as input values, the */
+ /* resulting ppem value for the given resolution is always rounded to */
+ /* the nearest integer. */
+ /* */
/* If either the character width or height is zero, it is set equal */
/* to the other value. */
/* */
@@ -2515,8 +2637,7 @@ FT_BEGIN_HEADER
/* FT_Set_Pixel_Sizes */
/* */
/* <Description> */
- /* This function calls @FT_Request_Size to request the nominal size */
- /* (in pixels). */
+ /* Call @FT_Request_Size to request the nominal size (in pixels). */
/* */
/* <InOut> */
/* face :: A handle to the target face object. */
@@ -2530,8 +2651,8 @@ FT_BEGIN_HEADER
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
- /* You should not rely on the resulting glyphs matching, or being */
- /* constrained, to this pixel size. Refer to @FT_Request_Size to */
+ /* You should not rely on the resulting glyphs matching or being */
+ /* constrained to this pixel size. Refer to @FT_Request_Size to */
/* understand how requested sizes relate to actual sizes. */
/* */
/* Don't use this function if you are using the FreeType cache API. */
@@ -2548,8 +2669,7 @@ FT_BEGIN_HEADER
/* FT_Load_Glyph */
/* */
/* <Description> */
- /* A function used to load a single glyph into the glyph slot of a */
- /* face object. */
+ /* Load a glyph into the glyph slot of a face object. */
/* */
/* <InOut> */
/* face :: A handle to the target face object where the glyph */
@@ -2594,8 +2714,8 @@ FT_BEGIN_HEADER
/* FT_Load_Char */
/* */
/* <Description> */
- /* A function used to load a single glyph into the glyph slot of a */
- /* face object, according to its character code. */
+ /* Load a glyph into the glyph slot of a face object, accessed by its */
+ /* character code. */
/* */
/* <InOut> */
/* face :: A handle to a target face object where the glyph */
@@ -2617,6 +2737,10 @@ FT_BEGIN_HEADER
/* <Note> */
/* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */
/* */
+ /* Many fonts contain glyphs that can't be loaded by this function */
+ /* since its glyph indices are not listed in any of the font's */
+ /* charmaps. */
+ /* */
FT_EXPORT( FT_Error )
FT_Load_Char( FT_Face face,
FT_ULong char_code,
@@ -2629,8 +2753,8 @@ FT_BEGIN_HEADER
* FT_LOAD_XXX
*
* @description:
- * A list of bit field constants used with @FT_Load_Glyph to indicate
- * what kind of operations to perform during glyph loading.
+ * A list of bit field constants for @FT_Load_Glyph to indicate what
+ * kind of operations to perform during glyph loading.
*
* @values:
* FT_LOAD_DEFAULT ::
@@ -2642,13 +2766,13 @@ FT_BEGIN_HEADER
* The bitmap data can be accessed from the glyph slot (see note
* below).
*
- * 2. If no embedded bitmap is searched or found, FreeType looks for a
- * scalable outline. If one is found, it is loaded from the font
- * file, scaled to device pixels, then `hinted' to the pixel grid
- * in order to optimize it. The outline data can be accessed from
- * the glyph slot (see note below).
+ * 2. If no embedded bitmap is searched for or found, FreeType looks
+ * for a scalable outline. If one is found, it is loaded from
+ * the font file, scaled to device pixels, then `hinted' to the
+ * pixel grid in order to optimize it. The outline data can be
+ * accessed from the glyph slot (see note below).
*
- * Note that by default, the glyph loader doesn't render outlines into
+ * Note that by default the glyph loader doesn't render outlines into
* bitmaps. The following flags are used to modify this default
* behaviour to more specific and useful cases.
*
@@ -2695,13 +2819,13 @@ FT_BEGIN_HEADER
* various font formats.
*
* FT_LOAD_FORCE_AUTOHINT ::
- * Indicates that the auto-hinter is preferred over the font's native
- * hinter. See also the note below.
+ * Prefer the auto-hinter over the font's native hinter. See also
+ * the note below.
*
* FT_LOAD_PEDANTIC ::
- * Indicates that the font driver should perform pedantic verifications
- * during glyph loading. This is mostly used to detect broken glyphs
- * in fonts. By default, FreeType tries to handle broken fonts also.
+ * Make the font driver perform pedantic verifications during glyph
+ * loading. This is mostly used to detect broken glyphs in fonts.
+ * By default, FreeType tries to handle broken fonts also.
*
* In particular, errors from the TrueType bytecode engine are not
* passed to the application if this flag is not set; this might
@@ -2709,17 +2833,16 @@ FT_BEGIN_HEADER
* bytecode is buggy.
*
* FT_LOAD_NO_RECURSE ::
- * Indicate that the font driver should not load composite glyphs
- * recursively. Instead, it should set the `num_subglyph' and
- * `subglyphs' values of the glyph slot accordingly, and set
- * `glyph->format' to @FT_GLYPH_FORMAT_COMPOSITE. The description of
- * subglyphs can then be accessed with @FT_Get_SubGlyph_Info.
+ * Don't load composite glyphs recursively. Instead, the font
+ * driver should set the `num_subglyph' and `subglyphs' values of
+ * the glyph slot accordingly, and set `glyph->format' to
+ * @FT_GLYPH_FORMAT_COMPOSITE. The description of subglyphs can
+ * then be accessed with @FT_Get_SubGlyph_Info.
*
* This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
*
* FT_LOAD_IGNORE_TRANSFORM ::
- * Indicates that the transform matrix set by @FT_Set_Transform should
- * be ignored.
+ * Ignore the transform matrix set by @FT_Set_Transform.
*
* FT_LOAD_MONOCHROME ::
* This flag is used with @FT_LOAD_RENDER to indicate that you want to
@@ -2731,31 +2854,37 @@ FT_BEGIN_HEADER
* monochrome-optimized hinting algorithm is used.
*
* FT_LOAD_LINEAR_DESIGN ::
- * Indicates that the `linearHoriAdvance' and `linearVertAdvance'
- * fields of @FT_GlyphSlotRec should be kept in font units. See
- * @FT_GlyphSlotRec for details.
+ * Keep `linearHoriAdvance' and `linearVertAdvance' fields of
+ * @FT_GlyphSlotRec in font units. See @FT_GlyphSlotRec for
+ * details.
*
* FT_LOAD_NO_AUTOHINT ::
- * Disable auto-hinter. See also the note below.
+ * Disable the auto-hinter. See also the note below.
*
* FT_LOAD_COLOR ::
- * This flag is used to request loading of color embedded-bitmap
- * images. The resulting color bitmaps, if available, will have the
- * @FT_PIXEL_MODE_BGRA format. When the flag is not used and color
- * bitmaps are found, they will be converted to 256-level gray
- * bitmaps transparently. Those bitmaps will be in the
+ * Load embedded color bitmap images. The resulting color bitmaps,
+ * if available, will have the @FT_PIXEL_MODE_BGRA format. If the
+ * flag is not set and color bitmaps are found, they are converted
+ * to 256-level gray bitmaps transparently, using the
* @FT_PIXEL_MODE_GRAY format.
*
* FT_LOAD_COMPUTE_METRICS ::
- * This flag sets computing glyph metrics without the use of bundled
- * metrics tables (for example, the `hdmx' table in TrueType fonts).
- * Well-behaving fonts have optimized bundled metrics and these should
- * be used. This flag is mainly used by font validating or font
+ * Compute glyph metrics from the glyph data, without the use of
+ * bundled metrics tables (for example, the `hdmx' table in TrueType
+ * fonts). This flag is mainly used by font validating or font
* editing applications, which need to ignore, verify, or edit those
* tables.
*
* Currently, this flag is only implemented for TrueType fonts.
*
+ * FT_LOAD_BITMAP_METRICS_ONLY ::
+ * Request loading of the metrics and bitmap image information of a
+ * (possibly embedded) bitmap glyph without allocating or copying
+ * the bitmap image data itself. No effect if the target glyph is
+ * not a bitmap image.
+ *
+ * This flag unsets @FT_LOAD_RENDER.
+ *
* FT_LOAD_CROP_BITMAP ::
* Ignored. Deprecated.
*
@@ -2799,13 +2928,14 @@ FT_BEGIN_HEADER
#define FT_LOAD_MONOCHROME ( 1L << 12 )
#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
- /* Bits 16..19 are used by `FT_LOAD_TARGET_' */
+ /* Bits 16-19 are used by `FT_LOAD_TARGET_' */
#define FT_LOAD_COLOR ( 1L << 20 )
#define FT_LOAD_COMPUTE_METRICS ( 1L << 21 )
+#define FT_LOAD_BITMAP_METRICS_ONLY ( 1L << 22 )
/* */
- /* used internally only by certain font drivers! */
+ /* used internally only by certain font drivers */
#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
@@ -2816,37 +2946,48 @@ FT_BEGIN_HEADER
* FT_LOAD_TARGET_XXX
*
* @description:
- * A list of values that are used to select a specific hinting algorithm
- * to use by the hinter. You should OR one of these values to your
- * `load_flags' when calling @FT_Load_Glyph.
+ * A list of values to select a specific hinting algorithm for the
+ * hinter. You should OR one of these values to your `load_flags'
+ * when calling @FT_Load_Glyph.
*
- * Note that font's native hinters may ignore the hinting algorithm you
- * have specified (e.g., the TrueType bytecode interpreter). You can set
- * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.
+ * Note that a font's native hinters may ignore the hinting algorithm
+ * you have specified (e.g., the TrueType bytecode interpreter). You
+ * can set @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is
+ * used.
*
* @values:
* FT_LOAD_TARGET_NORMAL ::
- * This corresponds to the default hinting algorithm, optimized for
- * standard gray-level rendering. For monochrome output, use
- * @FT_LOAD_TARGET_MONO instead.
+ * The default hinting algorithm, optimized for standard gray-level
+ * rendering. For monochrome output, use @FT_LOAD_TARGET_MONO
+ * instead.
*
* FT_LOAD_TARGET_LIGHT ::
* A lighter hinting algorithm for gray-level modes. Many generated
* glyphs are fuzzier but better resemble their original shape. This
* is achieved by snapping glyphs to the pixel grid only vertically
- * (Y-axis), as is done by Microsoft's ClearType and Adobe's
- * proprietary font renderer. This preserves inter-glyph spacing in
+ * (Y-axis), as is done by FreeType's new CFF engine or Microsoft's
+ * ClearType font renderer. This preserves inter-glyph spacing in
* horizontal text. The snapping is done either by the native font
- * driver if the driver itself and the font support it or by the
+ * driver, if the driver itself and the font support it, or by the
* auto-hinter.
*
+ * Advance widths are rounded to integer values; however, using the
+ * `lsb_delta' and `rsb_delta' fields of @FT_GlyphSlotRec, it is
+ * possible to get fractional advance widths for sub-pixel positioning
+ * (which is recommended to use).
+ *
+ * If configuration option AF_CONFIG_OPTION_TT_SIZE_METRICS is active,
+ * TrueType-like metrics are used to make this mode behave similarly
+ * as in unpatched FreeType versions between 2.4.6 and 2.7.1
+ * (inclusive).
+ *
* FT_LOAD_TARGET_MONO ::
* Strong hinting algorithm that should only be used for monochrome
* output. The result is probably unpleasant if the glyph is rendered
* in non-monochrome modes.
*
* FT_LOAD_TARGET_LCD ::
- * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally
+ * A variant of @FT_LOAD_TARGET_LIGHT optimized for horizontally
* decimated LCD displays.
*
* FT_LOAD_TARGET_LCD_V ::
@@ -2874,6 +3015,13 @@ FT_BEGIN_HEADER
* FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
* }
*
+ * In general, you should stick with one rendering mode. For example,
+ * switching between @FT_LOAD_TARGET_NORMAL and @FT_LOAD_TARGET_MONO
+ * enforces a lot of recomputation for TrueType fonts, which is slow.
+ * Another reason is caching: Selecting a different mode usually causes
+ * changes in both the outlines and the rasterized bitmaps; it is thus
+ * necessary to empty the cache after a mode switch to avoid false hits.
+ *
*/
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
@@ -2903,18 +3051,17 @@ FT_BEGIN_HEADER
/* FT_Set_Transform */
/* */
/* <Description> */
- /* A function used to set the transformation that is applied to glyph */
- /* images when they are loaded into a glyph slot through */
- /* @FT_Load_Glyph. */
+ /* Set the transformation that is applied to glyph images when they */
+ /* are loaded into a glyph slot through @FT_Load_Glyph. */
/* */
/* <InOut> */
/* face :: A handle to the source face object. */
/* */
/* <Input> */
- /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */
- /* the identity matrix. */
- /* delta :: A pointer to the translation vector. Use~0 for the null */
- /* vector. */
+ /* matrix :: A pointer to the transformation's 2x2 matrix. Use NULL */
+ /* for the identity matrix. */
+ /* delta :: A pointer to the translation vector. Use NULL for the */
+ /* null vector. */
/* */
/* <Note> */
/* The transformation is only applied to scalable image formats after */
@@ -2937,9 +3084,8 @@ FT_BEGIN_HEADER
/* FT_Render_Mode */
/* */
/* <Description> */
- /* An enumeration type that lists the render modes supported by */
- /* FreeType~2. Each mode corresponds to a specific type of scanline */
- /* conversion performed on the outline. */
+ /* Render modes supported by FreeType~2. Each mode corresponds to a */
+ /* specific type of scanline conversion performed on the outline. */
/* */
/* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
/* field in the @FT_GlyphSlotRec structure gives the format of the */
@@ -2952,8 +3098,8 @@ FT_BEGIN_HEADER
/* */
/* <Values> */
/* FT_RENDER_MODE_NORMAL :: */
- /* This is the default render mode; it corresponds to 8-bit */
- /* anti-aliased bitmaps. */
+ /* Default render mode; it corresponds to 8-bit anti-aliased */
+ /* bitmaps. */
/* */
/* FT_RENDER_MODE_LIGHT :: */
/* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
@@ -2978,11 +3124,11 @@ FT_BEGIN_HEADER
/* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
/* */
/* <Note> */
- /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
- /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
- /* (not active in the default builds). It is up to the caller to */
- /* either call @FT_Library_SetLcdFilter (if available) or do the */
- /* filtering itself. */
+ /* The LCD-optimized glyph bitmaps produced by `FT_Render_Glyph' can */
+ /* be filtered to reduce color-fringes by using */
+ /* @FT_Library_SetLcdFilter (not active in the default builds). It */
+ /* is up to the caller to either call `FT_Library_SetLcdFilter' (if */
+ /* available) or do the filtering itself. */
/* */
/* The selected render mode only affects vector glyphs of a font. */
/* Embedded bitmaps often have a different pixel mode like */
@@ -3023,16 +3169,16 @@ FT_BEGIN_HEADER
/* convert. */
/* */
/* <Input> */
- /* render_mode :: This is the render mode used to render the glyph */
- /* image into a bitmap. See @FT_Render_Mode for a */
- /* list of possible values. */
+ /* render_mode :: The render mode used to render the glyph image into */
+ /* a bitmap. See @FT_Render_Mode for a list of */
+ /* possible values. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* To get meaningful results, font scaling values must be set with */
- /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */
+ /* functions like @FT_Set_Char_Size before calling `FT_Render_Glyph'. */
/* */
/* When FreeType outputs a bitmap of a glyph, it really outputs an */
/* alpha coverage map. If a pixel is completely covered by a */
@@ -3058,7 +3204,7 @@ FT_BEGIN_HEADER
/* this does not translate to 50% brightness for that pixel on our */
/* sRGB and gamma~2.2 screens. Due to their non-linearity, they */
/* dwell longer in the darks and only a pixel value of about 186 */
- /* results in 50% brightness – 128 ends up too dark on both bright */
+ /* results in 50% brightness -- 128 ends up too dark on both bright */
/* and dark backgrounds. The net result is that dark text looks */
/* burnt-out, pixely and blotchy on bright background, bright text */
/* too frail on dark backgrounds, and colored text on colored */
@@ -3122,17 +3268,15 @@ FT_BEGIN_HEADER
/* FT_Kerning_Mode */
/* */
/* <Description> */
- /* An enumeration used to specify which kerning values to return in */
+ /* An enumeration to specify the format of kerning values returned by */
/* @FT_Get_Kerning. */
/* */
/* <Values> */
/* FT_KERNING_DEFAULT :: Return grid-fitted kerning distances in */
- /* pixels (value is~0). Whether they are */
- /* scaled depends on @FT_LOAD_NO_SCALE. */
+ /* 26.6 fractional pixels. */
/* */
/* FT_KERNING_UNFITTED :: Return un-grid-fitted kerning distances in */
- /* 26.6 fractional pixels. Whether they are */
- /* scaled depends on @FT_LOAD_NO_SCALE. */
+ /* 26.6 fractional pixels. */
/* */
/* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
/* units. */
@@ -3142,9 +3286,13 @@ FT_BEGIN_HEADER
/* FreeType heuristically scale down kerning distances at small ppem */
/* values so that they don't become too big. */
/* */
+ /* Both FT_KERNING_DEFAULT and FT_KERNING_UNFITTED use the current */
+ /* horizontal scaling factor (as set e.g. with @FT_Set_Char_Size) to */
+ /* convert font units to pixels. */
+ /* */
typedef enum FT_Kerning_Mode_
{
- FT_KERNING_DEFAULT = 0,
+ FT_KERNING_DEFAULT = 0,
FT_KERNING_UNFITTED,
FT_KERNING_UNSCALED
@@ -3164,7 +3312,7 @@ FT_BEGIN_HEADER
/* FT_Get_Kerning */
/* */
/* <Description> */
- /* Return the kerning vector between two glyphs of a same face. */
+ /* Return the kerning vector between two glyphs of the same face. */
/* */
/* <Input> */
/* face :: A handle to a source face object. */
@@ -3192,6 +3340,10 @@ FT_BEGIN_HEADER
/* kernings, are out of the scope of this API function -- they can be */
/* implemented through format-specific interfaces. */
/* */
+ /* Kerning for OpenType fonts implemented in a `GPOS' table is not */
+ /* supported; use @FT_HAS_KERNING to find out whether a font has data */
+ /* that can be extracted with `FT_Get_Kerning'. */
+ /* */
FT_EXPORT( FT_Error )
FT_Get_Kerning( FT_Face face,
FT_UInt left_glyph,
@@ -3231,7 +3383,7 @@ FT_BEGIN_HEADER
/* @FT_Attach_Stream). */
/* */
/* Only very few AFM files come with track kerning data; please refer */
- /* to the Adobe's AFM specification for more details. */
+ /* to Adobe's AFM specification for more details. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Track_Kerning( FT_Face face,
@@ -3293,7 +3445,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Retrieve the ASCII PostScript name of a given face, if available. */
- /* This only works with PostScript and TrueType fonts. */
+ /* This only works with PostScript, TrueType, and OpenType fonts. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
@@ -3305,6 +3457,13 @@ FT_BEGIN_HEADER
/* The returned pointer is owned by the face and is destroyed with */
/* it. */
/* */
+ /* For variation fonts, this string changes if you select a different */
+ /* instance, and you have to call `FT_Get_PostScript_Name' again to */
+ /* retrieve it. FreeType follows Adobe TechNote #5902, `Generating */
+ /* PostScript Names for Fonts Using OpenType Font Variations'. */
+ /* */
+ /* http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/5902.AdobePSNameGeneration.html */
+ /* */
FT_EXPORT( const char* )
FT_Get_Postscript_Name( FT_Face face );
@@ -3364,7 +3523,8 @@ FT_BEGIN_HEADER
/* the face (i.e., if it is not listed in the `face->charmaps' */
/* table). */
/* */
- /* It also fails if a type~14 charmap is selected. */
+ /* It also fails if an OpenType type~14 charmap is selected (which */
+ /* doesn't map character codes to glyph indices at all). */
/* */
FT_EXPORT( FT_Error )
FT_Set_Charmap( FT_Face face,
@@ -3399,7 +3559,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Return the glyph index of a given character code. This function */
- /* uses a charmap object to do the mapping. */
+ /* uses the currently selected charmap to do the mapping. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
@@ -3433,9 +3593,8 @@ FT_BEGIN_HEADER
/* FT_Get_First_Char */
/* */
/* <Description> */
- /* This function is used to return the first character code in the */
- /* current charmap of a given face. It also returns the */
- /* corresponding glyph index. */
+ /* Return the first character code in the current charmap of a given */
+ /* face, together with its corresponding glyph index. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
@@ -3448,7 +3607,7 @@ FT_BEGIN_HEADER
/* The charmap's first character code. */
/* */
/* <Note> */
- /* You should use this function with @FT_Get_Next_Char to be able to */
+ /* You should use this function together with @FT_Get_Next_Char to */
/* parse all character codes available in a given charmap. The code */
/* should look like this: */
/* */
@@ -3488,12 +3647,13 @@ FT_BEGIN_HEADER
/* FT_Get_Next_Char */
/* */
/* <Description> */
- /* This function is used to return the next character code in the */
- /* current charmap of a given face following the value `char_code', */
- /* as well as the corresponding glyph index. */
+ /* Return the next character code in the current charmap of a given */
+ /* face following the value `char_code', as well as the corresponding */
+ /* glyph index. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
+ /* */
/* char_code :: The starting character code. */
/* */
/* <Output> */
@@ -3506,7 +3666,7 @@ FT_BEGIN_HEADER
/* <Note> */
/* You should use this function with @FT_Get_First_Char to walk */
/* over all character codes available in a given charmap. See the */
- /* note for this function for a simple code example. */
+ /* note for that function for a simple code example. */
/* */
/* Note that `*agindex' is set to~0 when there are no more codes in */
/* the charmap. */
@@ -3517,14 +3677,109 @@ FT_BEGIN_HEADER
FT_UInt *agindex );
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Face_Properties
+ *
+ * @description:
+ * Set or override certain (library or module-wide) properties on a
+ * face-by-face basis. Useful for finer-grained control and avoiding
+ * locks on shared structures (threads can modify their own faces as
+ * they see fit).
+ *
+ * Contrary to @FT_Property_Set, this function uses @FT_Parameter so
+ * that you can pass multiple properties to the target face in one call.
+ * Note that only a subset of the available properties can be
+ * controlled.
+ *
+ * * Stem darkening (@FT_PARAM_TAG_STEM_DARKENING, corresponding to the
+ * property `no-stem-darkening' provided by the `autofit' and `cff'
+ * modules; see @no-stem-darkening[autofit] and
+ * @no-stem-darkening[cff]).
+ *
+ * * LCD filter weights (@FT_PARAM_TAG_LCD_FILTER_WEIGHTS, corresponding
+ * to function @FT_Library_SetLcdFilterWeights).
+ *
+ * * Seed value for the CFF `random' operator
+ * (@FT_PARAM_TAG_RANDOM_SEED, corresponding to the `random-seed'
+ * property provided by the `cff' module; see @random-seed).
+ *
+ * Pass NULL as `data' in @FT_Parameter for a given tag to reset the
+ * option and use the library or module default again.
+ *
+ * @input:
+ * face ::
+ * A handle to the source face object.
+ *
+ * num_properties ::
+ * The number of properties that follow.
+ *
+ * properties ::
+ * A handle to an @FT_Parameter array with `num_properties' elements.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * Here an example that sets three properties. You must define
+ * FT_CONFIG_OPTION_SUBPIXEL_RENDERING to make the LCD filter examples
+ * work.
+ *
+ * {
+ * FT_Parameter property1;
+ * FT_Bool darken_stems = 1;
+ *
+ * FT_Parameter property2;
+ * FT_LcdFiveTapFilter custom_weight =
+ * { 0x11, 0x44, 0x56, 0x44, 0x11 };
+ *
+ * FT_Parameter property3;
+ * FT_Int32 random_seed = 314159265;
+ *
+ * FT_Parameter properties[3] = { property1,
+ * property2,
+ * property3 };
+ *
+ *
+ * property1.tag = FT_PARAM_TAG_STEM_DARKENING;
+ * property1.data = &darken_stems;
+ *
+ * property2.tag = FT_PARAM_TAG_LCD_FILTER_WEIGHTS;
+ * property2.data = custom_weight;
+ *
+ * property3.tag = FT_PARAM_TAG_RANDOM_SEED;
+ * property3.data = &random_seed;
+ *
+ * FT_Face_Properties( face, 3, properties );
+ * }
+ *
+ * The next example resets a single property to its default value.
+ *
+ * {
+ * FT_Parameter property;
+ *
+ *
+ * property.tag = FT_PARAM_TAG_LCD_FILTER_WEIGHTS;
+ * property.data = NULL;
+ *
+ * FT_Face_Properties( face, 1, &property );
+ * }
+ *
+ */
+ FT_EXPORT( FT_Error )
+ FT_Face_Properties( FT_Face face,
+ FT_UInt num_properties,
+ FT_Parameter* properties );
+
+
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Name_Index */
/* */
/* <Description> */
- /* Return the glyph index of a given glyph name. This function uses */
- /* driver specific objects to do the translation. */
+ /* Return the glyph index of a given glyph name. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
@@ -3545,8 +3800,10 @@ FT_BEGIN_HEADER
* FT_SUBGLYPH_FLAG_XXX
*
* @description:
- * A list of constants used to describe subglyphs. Please refer to the
- * TrueType specification for the meaning of the various flags.
+ * A list of constants describing subglyphs. Please refer to the
+ * `glyf' table description in the OpenType specification for the
+ * meaning of the various flags (which get synthesized for
+ * non-OpenType subglyphs).
*
* @values:
* FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
@@ -3607,7 +3864,7 @@ FT_BEGIN_HEADER
* @note:
* The values of `*p_arg1', `*p_arg2', and `*p_transform' must be
* interpreted depending on the flags returned in `*p_flags'. See the
- * TrueType specification for details.
+ * OpenType specification for details.
*
*/
FT_EXPORT( FT_Error )
@@ -3647,33 +3904,31 @@ FT_BEGIN_HEADER
/* the font software copyright owner. */
/* */
/* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
- /* If this bit is set, the font may be embedded and temporarily */
- /* loaded on the remote system. Documents containing Preview & */
- /* Print fonts must be opened `read-only'; no edits can be applied */
- /* to the document. */
+ /* The font may be embedded and temporarily loaded on the remote */
+ /* system. Documents containing Preview & Print fonts must be */
+ /* opened `read-only'; no edits can be applied to the document. */
/* */
/* FT_FSTYPE_EDITABLE_EMBEDDING :: */
- /* If this bit is set, the font may be embedded but must only be */
- /* installed temporarily on other systems. In contrast to Preview */
- /* & Print fonts, documents containing editable fonts may be opened */
- /* for reading, editing is permitted, and changes may be saved. */
+ /* The font may be embedded but must only be installed temporarily */
+ /* on other systems. In contrast to Preview & Print fonts, */
+ /* documents containing editable fonts may be opened for reading, */
+ /* editing is permitted, and changes may be saved. */
/* */
/* FT_FSTYPE_NO_SUBSETTING :: */
- /* If this bit is set, the font may not be subsetted prior to */
- /* embedding. */
+ /* The font may not be subsetted prior to embedding. */
/* */
/* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
- /* If this bit is set, only bitmaps contained in the font may be */
- /* embedded; no outline data may be embedded. If there are no */
- /* bitmaps available in the font, then the font is unembeddable. */
+ /* Only bitmaps contained in the font may be embedded; no outline */
+ /* data may be embedded. If there are no bitmaps available in the */
+ /* font, then the font is unembeddable. */
/* */
/* <Note> */
/* The flags are ORed together, thus more than a single value can be */
/* returned. */
/* */
- /* While the fsType flags can indicate that a font may be embedded, a */
- /* license with the font vendor may be separately required to use the */
- /* font in this way. */
+ /* While the `fsType' flags can indicate that a font may be embedded, */
+ /* a license with the font vendor may be separately required to use */
+ /* the font in this way. */
/* */
#define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000
#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002
@@ -3689,13 +3944,13 @@ FT_BEGIN_HEADER
/* FT_Get_FSType_Flags */
/* */
/* <Description> */
- /* Return the fsType flags for a font. */
+ /* Return the `fsType' flags for a font. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
/* */
/* <Return> */
- /* The fsType flags, @FT_FSTYPE_XXX. */
+ /* The `fsType' flags, see @FT_FSTYPE_XXX. */
/* */
/* <Note> */
/* Use this function rather than directly reading the `fs_type' field */
@@ -3715,39 +3970,51 @@ FT_BEGIN_HEADER
/* glyph_variants */
/* */
/* <Title> */
- /* Glyph Variants */
+ /* Unicode Variation Sequences */
/* */
/* <Abstract> */
- /* The FreeType~2 interface to Unicode Ideographic Variation */
- /* Sequences (IVS), using the SFNT cmap format~14. */
+ /* The FreeType~2 interface to Unicode Variation Sequences (UVS), */
+ /* using the SFNT cmap format~14. */
/* */
/* <Description> */
- /* Many CJK characters have variant forms. They are a sort of grey */
- /* area somewhere between being totally irrelevant and semantically */
- /* distinct; for this reason, the Unicode consortium decided to */
- /* introduce Ideographic Variation Sequences (IVS), consisting of a */
- /* Unicode base character and one of 240 variant selectors */
- /* (U+E0100-U+E01EF), instead of further extending the already huge */
- /* code range for CJK characters. */
- /* */
- /* An IVS is registered and unique; for further details please refer */
- /* to Unicode Technical Standard #37, the Ideographic Variation */
- /* Database: */
- /* */
- /* http://www.unicode.org/reports/tr37/ */
- /* */
- /* To date (November 2014), the character with the most variants is */
- /* U+9089, having 32 such IVS. */
- /* */
- /* Adobe and MS decided to support IVS with a new cmap subtable */
- /* (format~14). It is an odd subtable because it is not a mapping of */
- /* input code points to glyphs, but contains lists of all variants */
- /* supported by the font. */
- /* */
- /* A variant may be either `default' or `non-default'. A default */
- /* variant is the one you will get for that code point if you look it */
- /* up in the standard Unicode cmap. A non-default variant is a */
- /* different glyph. */
+ /* Many characters, especially for CJK scripts, have variant forms. */
+ /* They are a sort of grey area somewhere between being totally */
+ /* irrelevant and semantically distinct; for this reason, the Unicode */
+ /* consortium decided to introduce Variation Sequences (VS), */
+ /* consisting of a Unicode base character and a variation selector */
+ /* instead of further extending the already huge number of */
+ /* characters. */
+ /* */
+ /* Unicode maintains two different sets, namely `Standardized */
+ /* Variation Sequences' and registered `Ideographic Variation */
+ /* Sequences' (IVS), collected in the `Ideographic Variation */
+ /* Database' (IVD). */
+ /* */
+ /* http://unicode.org/Public/UCD/latest/ucd/StandardizedVariants.txt */
+ /* http://unicode.org/reports/tr37/ */
+ /* http://unicode.org/ivd/ */
+ /* */
+ /* To date (January 2017), the character with the most ideographic */
+ /* variations is U+9089, having 32 such IVS. */
+ /* */
+ /* Three Mongolian Variation Selectors have the values U+180B-U+180D; */
+ /* 256 generic Variation Selectors are encoded in the ranges */
+ /* U+FE00-U+FE0F and U+E0100-U+E01EF. IVS currently use Variation */
+ /* Selectors from the range U+E0100-U+E01EF only. */
+ /* */
+ /* A VS consists of the base character value followed by a single */
+ /* Variation Selector. For example, to get the first variation of */
+ /* U+9089, you have to write the character sequence `U+9089 U+E0100'. */
+ /* */
+ /* Adobe and MS decided to support both standardized and ideographic */
+ /* VS with a new cmap subtable (format~14). It is an odd subtable */
+ /* because it is not a mapping of input code points to glyphs, but */
+ /* contains lists of all variations supported by the font. */
+ /* */
+ /* A variation may be either `default' or `non-default' for a given */
+ /* font. A default variation is the one you will get for that code */
+ /* point if you look it up in the standard Unicode cmap. A */
+ /* non-default variation is a different glyph. */
/* */
/*************************************************************************/
@@ -3803,8 +4070,8 @@ FT_BEGIN_HEADER
/* FT_Face_GetCharVariantIsDefault */
/* */
/* <Description> */
- /* Check whether this variant of this Unicode character is the one to */
- /* be found in the `cmap'. */
+ /* Check whether this variation of this Unicode character is the one */
+ /* to be found in the `cmap'. */
/* */
/* <Input> */
/* face :: */
@@ -3818,7 +4085,7 @@ FT_BEGIN_HEADER
/* */
/* <Return> */
/* 1~if found in the standard (Unicode) cmap, 0~if found in the */
- /* variation selector cmap, or -1 if it is not a variant. */
+ /* variation selector cmap, or -1 if it is not a variation. */
/* */
/* <Note> */
/* This function is only meaningful if the font has a variation */
@@ -3839,7 +4106,7 @@ FT_BEGIN_HEADER
/* FT_Face_GetVariantSelectors */
/* */
/* <Description> */
- /* Return a zero-terminated list of Unicode variant selectors found */
+ /* Return a zero-terminated list of Unicode variation selectors found */
/* in the font. */
/* */
/* <Input> */
@@ -3848,7 +4115,7 @@ FT_BEGIN_HEADER
/* */
/* <Return> */
/* A pointer to an array of selector code points, or NULL if there is */
- /* no valid variant selector cmap subtable. */
+ /* no valid variation selector cmap subtable. */
/* */
/* <Note> */
/* The last item in the array is~0; the array is owned by the */
@@ -3868,7 +4135,7 @@ FT_BEGIN_HEADER
/* FT_Face_GetVariantsOfChar */
/* */
/* <Description> */
- /* Return a zero-terminated list of Unicode variant selectors found */
+ /* Return a zero-terminated list of Unicode variation selectors found */
/* for the specified character code. */
/* */
/* <Input> */
@@ -3879,7 +4146,7 @@ FT_BEGIN_HEADER
/* The character codepoint in Unicode. */
/* */
/* <Return> */
- /* A pointer to an array of variant selector code points that are */
+ /* A pointer to an array of variation selector code points that are */
/* active for the given character, or NULL if the corresponding list */
/* is empty. */
/* */
@@ -3903,19 +4170,19 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Return a zero-terminated list of Unicode character codes found for */
- /* the specified variant selector. */
+ /* the specified variation selector. */
/* */
/* <Input> */
/* face :: */
/* A handle to the source face object. */
/* */
/* variantSelector :: */
- /* The variant selector code point in Unicode. */
+ /* The variation selector code point in Unicode. */
/* */
/* <Return> */
/* A list of all the code points that are specified by this selector */
/* (both default and non-default codes are returned) or NULL if there */
- /* is no valid cmap or the variant selector is invalid. */
+ /* is no valid cmap or the variation selector is invalid. */
/* */
/* <Note> */
/* The last item in the array is~0; the array is owned by the */
@@ -3965,16 +4232,17 @@ FT_BEGIN_HEADER
/* FT_MulDiv */
/* */
/* <Description> */
- /* A very simple function used to perform the computation `(a*b)/c' */
- /* with maximum accuracy (it uses a 64-bit intermediate integer */
- /* whenever necessary). */
+ /* Compute `(a*b)/c' with maximum accuracy, using a 64-bit */
+ /* intermediate integer whenever necessary. */
/* */
/* This function isn't necessarily as fast as some processor specific */
/* operations, but is at least completely portable. */
/* */
/* <Input> */
/* a :: The first multiplier. */
+ /* */
/* b :: The second multiplier. */
+ /* */
/* c :: The divisor. */
/* */
/* <Return> */
@@ -3994,12 +4262,12 @@ FT_BEGIN_HEADER
/* FT_MulFix */
/* */
/* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */
- /* used to multiply a given value by a 16.16 fixed-point factor. */
+ /* Compute `(a*b)/0x10000' with maximum accuracy. Its main use is to */
+ /* multiply a given value by a 16.16 fixed-point factor. */
/* */
/* <Input> */
/* a :: The first multiplier. */
+ /* */
/* b :: The second multiplier. Use a 16.16 factor here whenever */
/* possible (see note below). */
/* */
@@ -4028,12 +4296,12 @@ FT_BEGIN_HEADER
/* FT_DivFix */
/* */
/* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
- /* used to divide a given value by a 16.16 fixed-point factor. */
+ /* Compute `(a*0x10000)/b' with maximum accuracy. Its main use is to */
+ /* divide a given value by a 16.16 fixed-point factor. */
/* */
/* <Input> */
/* a :: The numerator. */
+ /* */
/* b :: The denominator. Use a 16.16 factor here. */
/* */
/* <Return> */
@@ -4050,13 +4318,13 @@ FT_BEGIN_HEADER
/* FT_RoundFix */
/* */
/* <Description> */
- /* A very simple function used to round a 16.16 fixed number. */
+ /* Round a 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number to be rounded. */
/* */
/* <Return> */
- /* `a' rounded to nearest 16.16 fixed integer, halfway cases away */
+ /* `a' rounded to the nearest 16.16 fixed integer, halfway cases away */
/* from zero. */
/* */
FT_EXPORT( FT_Fixed )
@@ -4069,8 +4337,7 @@ FT_BEGIN_HEADER
/* FT_CeilFix */
/* */
/* <Description> */
- /* A very simple function used to compute the ceiling function of a */
- /* 16.16 fixed number. */
+ /* Compute the smallest following integer of a 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number for which the ceiling function is to be computed. */
@@ -4088,8 +4355,7 @@ FT_BEGIN_HEADER
/* FT_FloorFix */
/* */
/* <Description> */
- /* A very simple function used to compute the floor function of a */
- /* 16.16 fixed number. */
+ /* Compute the largest previous integer of a 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number for which the floor function is to be computed. */
@@ -4175,8 +4441,8 @@ FT_BEGIN_HEADER
*
*/
#define FREETYPE_MAJOR 2
-#define FREETYPE_MINOR 6
-#define FREETYPE_PATCH 5
+#define FREETYPE_MINOR 8
+#define FREETYPE_PATCH 0
/*************************************************************************/
diff --git a/thirdparty/freetype/include/freetype/ftadvanc.h b/thirdparty/freetype/include/freetype/ftadvanc.h
index 023dd84b7a..dea96e0db4 100644
--- a/thirdparty/freetype/include/freetype/ftadvanc.h
+++ b/thirdparty/freetype/include/freetype/ftadvanc.h
@@ -4,7 +4,7 @@
/* */
/* Quick computation of advance widths (specification only). */
/* */
-/* Copyright 2008-2016 by */
+/* Copyright 2008-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftautoh.h b/thirdparty/freetype/include/freetype/ftautoh.h
index 40c8003c4a..abd540f0b5 100644
--- a/thirdparty/freetype/include/freetype/ftautoh.h
+++ b/thirdparty/freetype/include/freetype/ftautoh.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for controlling the auto-hinter (specification only). */
/* */
-/* Copyright 2012-2016 by */
+/* Copyright 2012-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -428,6 +428,9 @@ FT_BEGIN_HEADER
* @note:
* This property can be used with @FT_Property_Get also.
*
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values 1 and 0 for `on' and `off', respectively).
+ *
* The warping code can also change advance widths. Have a look at the
* `lsb_delta' and `rsb_delta' fields in the @FT_GlyphSlotRec structure
* for details on improving inter-glyph distances while rendering.
@@ -445,7 +448,7 @@ FT_BEGIN_HEADER
* no-stem-darkening[autofit]
*
* @description:
- * *Experimental* *only,* *requires* *linear* *alpha* *blending* *and*
+ * *Experimental* *only*, *requires* *linear* *alpha* *blending* *and*
* *gamma* *correction*
*
* Stem darkening emboldens glyphs at smaller sizes to make them more
@@ -473,7 +476,32 @@ FT_BEGIN_HEADER
* The smaller the size (especially 9ppem and down), the higher the loss
* of emboldening versus the CFF driver.
*
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable similar to the CFF driver. It can also be set per face
+ * using @FT_Face_Properties with @FT_PARAM_TAG_STEM_DARKENING.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_STEM_DARKENING
+ *
+ * @description:
+ * An @FT_Parameter tag to be used with @FT_Face_Properties. The
+ * corresponding Boolean argument specifies whether to apply stem
+ * darkening, overriding the global default values or the values set up
+ * with @FT_Property_Set (see @no-stem-darkening[autofit] and
+ * @no-stem-darkening[cff]).
+ *
+ * This is a passive setting that only takes effect if the font driver
+ * or autohinter honors it, which the CFF driver always does, but the
+ * autohinter only in `light' hinting mode (as of version 2.7.0).
+ *
*/
+#define FT_PARAM_TAG_STEM_DARKENING \
+ FT_MAKE_TAG( 'd', 'a', 'r', 'k' )
/**************************************************************************
@@ -489,6 +517,8 @@ FT_BEGIN_HEADER
* CFF_CONFIG_OPTION_DARKENING_PARAMETER_* #defines for consistency.
* Note the differences described in @no-stem-darkening[autofit].
*
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable similar to the CFF driver.
*/
diff --git a/thirdparty/freetype/include/freetype/ftbbox.h b/thirdparty/freetype/include/freetype/ftbbox.h
index 2a4d214416..f03bdc1e1e 100644
--- a/thirdparty/freetype/include/freetype/ftbbox.h
+++ b/thirdparty/freetype/include/freetype/ftbbox.h
@@ -4,7 +4,7 @@
/* */
/* FreeType exact bbox computation (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftbdf.h b/thirdparty/freetype/include/freetype/ftbdf.h
index 016dba086d..3d3106bad0 100644
--- a/thirdparty/freetype/include/freetype/ftbdf.h
+++ b/thirdparty/freetype/include/freetype/ftbdf.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing BDF-specific strings (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftbitmap.h b/thirdparty/freetype/include/freetype/ftbitmap.h
index 0eac7b9d7d..04b2402ad0 100644
--- a/thirdparty/freetype/include/freetype/ftbitmap.h
+++ b/thirdparty/freetype/include/freetype/ftbitmap.h
@@ -4,7 +4,7 @@
/* */
/* FreeType utility functions for bitmaps (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftbzip2.h b/thirdparty/freetype/include/freetype/ftbzip2.h
index b7f2eee87d..9147a790a4 100644
--- a/thirdparty/freetype/include/freetype/ftbzip2.h
+++ b/thirdparty/freetype/include/freetype/ftbzip2.h
@@ -4,7 +4,7 @@
/* */
/* Bzip2-compressed stream support. */
/* */
-/* Copyright 2010-2016 by */
+/* Copyright 2010-2017 by */
/* Joel Klinghed. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftcache.h b/thirdparty/freetype/include/freetype/ftcache.h
index 883c88d5d2..5ff3ccf404 100644
--- a/thirdparty/freetype/include/freetype/ftcache.h
+++ b/thirdparty/freetype/include/freetype/ftcache.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Cache subsystem (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftcffdrv.h b/thirdparty/freetype/include/freetype/ftcffdrv.h
index ad34541fdb..477b6ddb18 100644
--- a/thirdparty/freetype/include/freetype/ftcffdrv.h
+++ b/thirdparty/freetype/include/freetype/ftcffdrv.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for controlling the CFF driver (specification only). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -113,6 +113,7 @@ FT_BEGIN_HEADER
* hinting-engine[cff]
* no-stem-darkening[cff]
* darkening-parameters[cff]
+ * random-seed
*
*/
@@ -148,6 +149,8 @@ FT_BEGIN_HEADER
* @note:
* This property can be used with @FT_Property_Get also.
*
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values `adobe' or `freetype').
*/
@@ -199,6 +202,11 @@ FT_BEGIN_HEADER
* @note:
* This property can be used with @FT_Property_Get also.
*
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values 1 and 0 for `on' and `off', respectively).
+ * It can also be set per face using @FT_Face_Properties with
+ * @FT_PARAM_TAG_STEM_DARKENING.
+ *
*/
@@ -248,7 +256,58 @@ FT_BEGIN_HEADER
* @note:
* This property can be used with @FT_Property_Get also.
*
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable, using eight comma-separated integers without spaces. Here
+ * the above example, using `\' to break the line for readability.
+ *
+ * {
+ * FREETYPE_PROPERTIES=\
+ * cff:darkening-parameters=500,300,1000,200,1500,100,2000,0
+ * }
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * random-seed
+ *
+ * @description:
+ * By default, the seed value for the CFF `random' operator is set to a
+ * random value. However, mainly for debugging purposes, it is often
+ * necessary to use a known value as a seed so that the pseudo-random
+ * number sequences generated by `random' are repeatable.
+ *
+ * The `random-seed' property does that. Its argument is a signed 32bit
+ * integer; if the value is zero or negative, the seed given by the
+ * `intitialRandomSeed' private DICT operator in a CFF file gets used
+ * (or a default value if there is no such operator). If the value is
+ * positive, use it instead of `initialRandomSeed', which is
+ * consequently ignored.
+ *
+ * @note:
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable. It can also be set per face using @FT_Face_Properties with
+ * @FT_PARAM_TAG_RANDOM_SEED.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_RANDOM_SEED
+ *
+ * @description:
+ * An @FT_Parameter tag to be used with @FT_Face_Properties. The
+ * corresponding 32bit signed integer argument overrides the CFF
+ * module's random seed value with a face-specific one; see
+ * @random-seed.
+ *
*/
+#define FT_PARAM_TAG_RANDOM_SEED \
+ FT_MAKE_TAG( 's', 'e', 'e', 'd' )
+
/* */
diff --git a/thirdparty/freetype/include/freetype/ftchapters.h b/thirdparty/freetype/include/freetype/ftchapters.h
index ab4389530e..a0a121b0a1 100644
--- a/thirdparty/freetype/include/freetype/ftchapters.h
+++ b/thirdparty/freetype/include/freetype/ftchapters.h
@@ -77,6 +77,7 @@
/* auto_hinter */
/* cff_driver */
/* tt_driver */
+/* pcf_driver */
/* */
/***************************************************************************/
diff --git a/thirdparty/freetype/include/freetype/ftcid.h b/thirdparty/freetype/include/freetype/ftcid.h
index e1bc9fe015..4adcbeeda9 100644
--- a/thirdparty/freetype/include/freetype/ftcid.h
+++ b/thirdparty/freetype/include/freetype/ftcid.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing CID font information (specification). */
/* */
-/* Copyright 2007-2016 by */
+/* Copyright 2007-2017 by */
/* Dereg Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/fterrdef.h b/thirdparty/freetype/include/freetype/fterrdef.h
index 3f53dd5820..cabbac8273 100644
--- a/thirdparty/freetype/include/freetype/fterrdef.h
+++ b/thirdparty/freetype/include/freetype/fterrdef.h
@@ -4,7 +4,7 @@
/* */
/* FreeType error codes (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -231,6 +231,8 @@
"invalid PostScript (post) table format" )
FT_ERRORDEF_( Invalid_Post_Table, 0x9B,
"invalid PostScript (post) table" )
+ FT_ERRORDEF_( DEF_In_Glyf_Bytecode, 0x9C,
+ "found FDEF or IDEF opcode in glyf bytecode" )
/* CFF, CID, and Type 1 errors */
diff --git a/thirdparty/freetype/include/freetype/fterrors.h b/thirdparty/freetype/include/freetype/fterrors.h
index e15bfb001e..42769fa7bf 100644
--- a/thirdparty/freetype/include/freetype/fterrors.h
+++ b/thirdparty/freetype/include/freetype/fterrors.h
@@ -4,7 +4,7 @@
/* */
/* FreeType error code handling (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -106,7 +106,7 @@
/* */
/* #undefine __FTERRORS_H__ */
/* */
- /* work for backwards compatibility. */
+ /* work for backward compatibility. */
/* */
#if !( defined( FTERRORS_H_ ) && defined ( __FTERRORS_H__ ) )
#define FTERRORS_H_
diff --git a/thirdparty/freetype/include/freetype/ftfntfmt.h b/thirdparty/freetype/include/freetype/ftfntfmt.h
index bd423247bb..337758328a 100644
--- a/thirdparty/freetype/include/freetype/ftfntfmt.h
+++ b/thirdparty/freetype/include/freetype/ftfntfmt.h
@@ -4,7 +4,7 @@
/* */
/* Support functions for font formats. */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftgasp.h b/thirdparty/freetype/include/freetype/ftgasp.h
index 3f5b3bc695..ce18d64784 100644
--- a/thirdparty/freetype/include/freetype/ftgasp.h
+++ b/thirdparty/freetype/include/freetype/ftgasp.h
@@ -4,7 +4,7 @@
/* */
/* Access of TrueType's `gasp' table (specification). */
/* */
-/* Copyright 2007-2016 by */
+/* Copyright 2007-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -92,8 +92,8 @@
#define FT_GASP_NO_TABLE -1
#define FT_GASP_DO_GRIDFIT 0x01
#define FT_GASP_DO_GRAY 0x02
+#define FT_GASP_SYMMETRIC_GRIDFIT 0x04
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
-#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
/*************************************************************************
@@ -102,17 +102,25 @@
* FT_Get_Gasp
*
* @description:
- * Read the `gasp' table from a TrueType or OpenType font file and
- * return the entry corresponding to a given character pixel size.
+ * For a TrueType or OpenType font file, return the rasterizer behaviour
+ * flags from the font's `gasp' table corresponding to a given
+ * character pixel size.
*
* @input:
* face :: The source face handle.
+ *
* ppem :: The vertical character pixel size.
*
* @return:
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
* `gasp' table in the face.
*
+ * @note:
+ * If you want to use the MM functionality of OpenType variation fonts
+ * (i.e., using @FT_Set_Var_Design_Coordinates and friends), call this
+ * function *after* setting an instance since the return values can
+ * change.
+ *
* @since:
* 2.3.0
*/
diff --git a/thirdparty/freetype/include/freetype/ftglyph.h b/thirdparty/freetype/include/freetype/ftglyph.h
index d9840a81fc..79879a7ac7 100644
--- a/thirdparty/freetype/include/freetype/ftglyph.h
+++ b/thirdparty/freetype/include/freetype/ftglyph.h
@@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -453,7 +453,7 @@ FT_BEGIN_HEADER
/* */
/* */
/* // load glyph */
- /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
+ /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAULT ); */
/* */
/* // extract glyph image */
/* error = FT_Get_Glyph( face->glyph, &glyph ); */
diff --git a/thirdparty/freetype/include/freetype/ftgxval.h b/thirdparty/freetype/include/freetype/ftgxval.h
index a58e86a040..f239c71eb1 100644
--- a/thirdparty/freetype/include/freetype/ftgxval.h
+++ b/thirdparty/freetype/include/freetype/ftgxval.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/include/freetype/ftgzip.h b/thirdparty/freetype/include/freetype/ftgzip.h
index 3932ce6887..bd5ceaab9f 100644
--- a/thirdparty/freetype/include/freetype/ftgzip.h
+++ b/thirdparty/freetype/include/freetype/ftgzip.h
@@ -4,7 +4,7 @@
/* */
/* Gzip-compressed stream support. */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftimage.h b/thirdparty/freetype/include/freetype/ftimage.h
index 28b2704e80..1a049ef16d 100644
--- a/thirdparty/freetype/include/freetype/ftimage.h
+++ b/thirdparty/freetype/include/freetype/ftimage.h
@@ -5,7 +5,7 @@
/* FreeType glyph image formats and default raster interface */
/* (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -619,7 +619,7 @@ FT_BEGIN_HEADER
/* */
/* { */
/* x' = (x << shift) - delta */
- /* y' = (x << shift) - delta */
+ /* y' = (y << shift) - delta */
/* } */
/* */
/* Set the values of `shift' and `delta' to~0 to get the original */
@@ -860,16 +860,6 @@ FT_BEGIN_HEADER
/* This can be used to write anti-aliased outlines directly to a */
/* given background bitmap, and even perform translucency. */
/* */
- /* Note that the `count' field cannot be greater than a fixed value */
- /* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */
- /* `ftoption.h'. By default, this value is set to~32, which means */
- /* that if there are more than 32~spans on a given scanline, the */
- /* callback is called several times with the same `y' parameter in */
- /* order to draw all callbacks. */
- /* */
- /* Otherwise, the callback is only called once per scan-line, and */
- /* only for those scanlines that do have `gray' pixels on them. */
- /* */
typedef void
(*FT_SpanFunc)( int y,
int count,
@@ -1190,6 +1180,7 @@ FT_BEGIN_HEADER
typedef struct FT_Raster_Funcs_
{
FT_Glyph_Format glyph_format;
+
FT_Raster_NewFunc raster_new;
FT_Raster_ResetFunc raster_reset;
FT_Raster_SetModeFunc raster_set_mode;
diff --git a/thirdparty/freetype/include/freetype/ftincrem.h b/thirdparty/freetype/include/freetype/ftincrem.h
index 46b58b7917..f6ae2baed6 100644
--- a/thirdparty/freetype/include/freetype/ftincrem.h
+++ b/thirdparty/freetype/include/freetype/ftincrem.h
@@ -4,7 +4,7 @@
/* */
/* FreeType incremental loading (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftlcdfil.h b/thirdparty/freetype/include/freetype/ftlcdfil.h
index e06a8957f5..680bd90c89 100644
--- a/thirdparty/freetype/include/freetype/ftlcdfil.h
+++ b/thirdparty/freetype/include/freetype/ftlcdfil.h
@@ -5,7 +5,7 @@
/* FreeType API for color filtering of subpixel bitmap glyphs */
/* (specification). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -268,6 +268,9 @@ FT_BEGIN_HEADER
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
*
+ * LCD filter weights can also be set per face using @FT_Face_Properties
+ * with @FT_PARAM_TAG_LCD_FILTER_WEIGHTS.
+ *
* @since:
* 2.4.0
*/
@@ -275,6 +278,38 @@ FT_BEGIN_HEADER
FT_Library_SetLcdFilterWeights( FT_Library library,
unsigned char *weights );
+
+ /**************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_LCD_FILTER_WEIGHTS
+ *
+ * @description:
+ * An @FT_Parameter tag to be used with @FT_Face_Properties. The
+ * corresponding argument specifies the five LCD filter weights for a
+ * given face (if using @FT_LOAD_TARGET_LCD, for example), overriding
+ * the global default values or the values set up with
+ * @FT_Library_SetLcdFilterWeights.
+ *
+ */
+#define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \
+ FT_MAKE_TAG( 'l', 'c', 'd', 'f' )
+
+
+ /*
+ * @type:
+ * FT_LcdFiveTapFilter
+ *
+ * @description:
+ * A typedef for passing the five LCD filter weights to
+ * @FT_Face_Properties within an @FT_Parameter structure.
+ *
+ */
+#define FT_LCD_FILTER_FIVE_TAPS 5
+
+ typedef FT_Byte FT_LcdFiveTapFilter[FT_LCD_FILTER_FIVE_TAPS];
+
+
/* */
diff --git a/thirdparty/freetype/include/freetype/ftlist.h b/thirdparty/freetype/include/freetype/ftlist.h
index 82f437ac61..5309cb18ba 100644
--- a/thirdparty/freetype/include/freetype/ftlist.h
+++ b/thirdparty/freetype/include/freetype/ftlist.h
@@ -4,7 +4,7 @@
/* */
/* Generic list support for FreeType (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftlzw.h b/thirdparty/freetype/include/freetype/ftlzw.h
index 582e2c1465..a82c95e7c9 100644
--- a/thirdparty/freetype/include/freetype/ftlzw.h
+++ b/thirdparty/freetype/include/freetype/ftlzw.h
@@ -4,7 +4,7 @@
/* */
/* LZW-compressed stream support. */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftmac.h b/thirdparty/freetype/include/freetype/ftmac.h
index adb15cadf3..ad97c6e4c3 100644
--- a/thirdparty/freetype/include/freetype/ftmac.h
+++ b/thirdparty/freetype/include/freetype/ftmac.h
@@ -4,7 +4,7 @@
/* */
/* Additional Mac-specific API. */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftmm.h b/thirdparty/freetype/include/freetype/ftmm.h
index 6c05f0c390..c41b80ea67 100644
--- a/thirdparty/freetype/include/freetype/ftmm.h
+++ b/thirdparty/freetype/include/freetype/ftmm.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Multiple Master font interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -43,11 +43,10 @@ FT_BEGIN_HEADER
/* Master fonts, i.e., the selection of specific design instances by */
/* setting design axis coordinates. */
/* */
- /* George Williams has extended this interface to make it work with */
- /* both Type~1 Multiple Masters fonts and GX distortable (var) */
- /* fonts. Some of these routines only work with MM fonts, others */
- /* will work with both types. They are similar enough that a */
- /* consistent interface makes sense. */
+ /* Besides Adobe MM fonts, the interface supports Apple's TrueType GX */
+ /* and OpenType variation fonts. Some of the routines only work with */
+ /* Adobe MM fonts, others will work with all three types. They are */
+ /* similar enough that a consistent interface makes sense. */
/* */
/*************************************************************************/
@@ -58,10 +57,11 @@ FT_BEGIN_HEADER
/* FT_MM_Axis */
/* */
/* <Description> */
- /* A simple structure used to model a given axis in design space for */
- /* Multiple Masters fonts. */
+ /* A structure to model a given axis in design space for Multiple */
+ /* Masters fonts. */
/* */
- /* This structure can't be used for GX var fonts. */
+ /* This structure can't be used for TrueType GX or OpenType variation */
+ /* fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
@@ -85,10 +85,11 @@ FT_BEGIN_HEADER
/* FT_Multi_Master */
/* */
/* <Description> */
- /* A structure used to model the axes and space of a Multiple Masters */
+ /* A structure to model the axes and space of a Multiple Masters */
/* font. */
/* */
- /* This structure can't be used for GX var fonts. */
+ /* This structure can't be used for TrueType GX or OpenType variation */
+ /* fonts. */
/* */
/* <Fields> */
/* num_axis :: Number of axes. Cannot exceed~4. */
@@ -115,27 +116,35 @@ FT_BEGIN_HEADER
/* FT_Var_Axis */
/* */
/* <Description> */
- /* A simple structure used to model a given axis in design space for */
- /* Multiple Masters and GX var fonts. */
+ /* A structure to model a given axis in design space for Multiple */
+ /* Masters, TrueType GX, and OpenType variation fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
- /* Not always meaningful for GX. */
+ /* Not always meaningful for TrueType GX or OpenType */
+ /* variation fonts. */
/* */
/* minimum :: The axis's minimum design coordinate. */
/* */
/* def :: The axis's default design coordinate. */
- /* FreeType computes meaningful default values for MM; it */
- /* is then an integer value, not in 16.16 format. */
+ /* FreeType computes meaningful default values for Adobe */
+ /* MM fonts. */
/* */
/* maximum :: The axis's maximum design coordinate. */
/* */
- /* tag :: The axis's tag (the GX equivalent to `name'). */
- /* FreeType provides default values for MM if possible. */
+ /* tag :: The axis's tag (the equivalent to `name' for TrueType */
+ /* GX and OpenType variation fonts). FreeType provides */
+ /* default values for Adobe MM fonts if possible. */
/* */
- /* strid :: The entry in `name' table (another GX version of */
- /* `name'). */
- /* Not meaningful for MM. */
+ /* strid :: The axis name entry in the font's `name' table. This */
+ /* is another (and often better) version of the `name' */
+ /* field for TrueType GX or OpenType variation fonts. Not */
+ /* meaningful for Adobe MM fonts. */
+ /* */
+ /* <Note> */
+ /* The fields `minimum', `def', and `maximum' are 16.16 fractional */
+ /* values for TrueType GX and OpenType variation fonts. For Adobe MM */
+ /* fonts, the values are integers. */
/* */
typedef struct FT_Var_Axis_
{
@@ -157,20 +166,25 @@ FT_BEGIN_HEADER
/* FT_Var_Named_Style */
/* */
/* <Description> */
- /* A simple structure used to model a named style in a GX var font. */
+ /* A structure to model a named instance in a TrueType GX or OpenType */
+ /* variation font. */
/* */
- /* This structure can't be used for MM fonts. */
+ /* This structure can't be used for Adobe MM fonts. */
/* */
/* <Fields> */
- /* coords :: The design coordinates for this style. */
+ /* coords :: The design coordinates for this instance. */
/* This is an array with one entry for each axis. */
/* */
- /* strid :: The entry in `name' table identifying this style. */
+ /* strid :: The entry in `name' table identifying this instance. */
+ /* */
+ /* psid :: The entry in `name' table identifying a PostScript name */
+ /* for this instance. */
/* */
typedef struct FT_Var_Named_Style_
{
FT_Fixed* coords;
FT_UInt strid;
+ FT_UInt psid; /* since 2.7.1 */
} FT_Var_Named_Style;
@@ -181,35 +195,43 @@ FT_BEGIN_HEADER
/* FT_MM_Var */
/* */
/* <Description> */
- /* A structure used to model the axes and space of a Multiple Masters */
- /* or GX var distortable font. */
+ /* A structure to model the axes and space of a Adobe MM, TrueType */
+ /* GX, or OpenType variation font. */
/* */
- /* Some fields are specific to one format and not to the other. */
+ /* Some fields are specific to one format and not to the others. */
/* */
/* <Fields> */
/* num_axis :: The number of axes. The maximum value is~4 for */
- /* MM; no limit in GX. */
+ /* Adobe MM fonts; no limit in TrueType GX or */
+ /* OpenType variation fonts. */
/* */
/* num_designs :: The number of designs; should be normally */
- /* 2^num_axis for MM fonts. Not meaningful for GX */
+ /* 2^num_axis for Adobe MM fonts. Not meaningful */
+ /* for TrueType GX or OpenType variation fonts */
/* (where every glyph could have a different */
/* number of designs). */
/* */
- /* num_namedstyles :: The number of named styles; only meaningful for */
- /* GX that allows certain design coordinates to */
- /* have a string ID (in the `name' table) */
- /* associated with them. The font can tell the */
- /* user that, for example, Weight=1.5 is `Bold'. */
+ /* num_namedstyles :: The number of named styles; a `named style' is */
+ /* a tuple of design coordinates that has a string */
+ /* ID (in the `name' table) associated with it. */
+ /* The font can tell the user that, for example, */
+ /* [Weight=1.5,Width=1.1] is `Bold'. Another name */
+ /* for `named style' is `named instance'. */
+ /* */
+ /* For Adobe Multiple Masters fonts, this value is */
+ /* always zero because the format does not support */
+ /* named styles. */
/* */
/* axis :: An axis descriptor table. */
- /* GX fonts contain slightly more data than MM. */
+ /* TrueType GX and OpenType variation fonts */
+ /* contain slightly more data than Adobe MM fonts. */
/* Memory management of this pointer is done */
/* internally by FreeType. */
/* */
- /* namedstyle :: A named style table. */
- /* Only meaningful with GX. */
- /* Memory management of this pointer is done */
- /* internally by FreeType. */
+ /* namedstyle :: A named style (instance) table. */
+ /* Only meaningful for TrueType GX and OpenType */
+ /* variation fonts. Memory management of this */
+ /* pointer is done internally by FreeType. */
/* */
typedef struct FT_MM_Var_
{
@@ -228,9 +250,10 @@ FT_BEGIN_HEADER
/* FT_Get_Multi_Master */
/* */
/* <Description> */
- /* Retrieve the Multiple Master descriptor of a given font. */
+ /* Retrieve a variation descriptor of a given Adobe MM font. */
/* */
- /* This function can't be used with GX fonts. */
+ /* This function can't be used with TrueType GX or OpenType variation */
+ /* fonts. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
@@ -252,13 +275,15 @@ FT_BEGIN_HEADER
/* FT_Get_MM_Var */
/* */
/* <Description> */
- /* Retrieve the Multiple Master/GX var descriptor of a given font. */
+ /* Retrieve a variation descriptor for a given font. */
+ /* */
+ /* This function works with all supported variation formats. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Output> */
- /* amaster :: The Multiple Masters/GX var descriptor. */
+ /* amaster :: The variation descriptor. */
/* Allocates a data structure, which the user must */
/* deallocate with `free' after use. */
/* */
@@ -276,10 +301,11 @@ FT_BEGIN_HEADER
/* FT_Set_MM_Design_Coordinates */
/* */
/* <Description> */
- /* For Multiple Masters fonts, choose an interpolated font design */
- /* through design coordinates. */
+ /* For Adobe MM fonts, choose an interpolated font design through */
+ /* design coordinates. */
/* */
- /* This function can't be used with GX fonts. */
+ /* This function can't be used with TrueType GX or OpenType variation */
+ /* fonts. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
@@ -307,8 +333,9 @@ FT_BEGIN_HEADER
/* FT_Set_Var_Design_Coordinates */
/* */
/* <Description> */
- /* For Multiple Master or GX Var fonts, choose an interpolated font */
- /* design through design coordinates. */
+ /* Choose an interpolated font design through design coordinates. */
+ /* */
+ /* This function works with all supported variation formats. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
@@ -333,11 +360,43 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Function> */
+ /* FT_Get_Var_Design_Coordinates */
+ /* */
+ /* <Description> */
+ /* Get the design coordinates of the currently selected interpolated */
+ /* font. */
+ /* */
+ /* This function works with all supported variation formats. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* num_coords :: The number of design coordinates to retrieve. If it */
+ /* is larger than the number of axes, set the excess */
+ /* values to~0. */
+ /* */
+ /* <Output> */
+ /* coords :: The design coordinates array. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Var_Design_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
/* FT_Set_MM_Blend_Coordinates */
/* */
/* <Description> */
- /* For Multiple Masters and GX var fonts, choose an interpolated font */
- /* design through normalized blend coordinates. */
+ /* Choose an interpolated font design through normalized blend */
+ /* coordinates. */
+ /* */
+ /* This function works with all supported variation formats. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
@@ -349,7 +408,9 @@ FT_BEGIN_HEADER
/* use default values for the remaining axes. */
/* */
/* coords :: The design coordinates array (each element must be */
- /* between 0 and 1.0). */
+ /* between 0 and 1.0 for Adobe MM fonts, and between */
+ /* -1.0 and 1.0 for TrueType GX and OpenType variation */
+ /* fonts). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
@@ -363,6 +424,37 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Function> */
+ /* FT_Get_MM_Blend_Coordinates */
+ /* */
+ /* <Description> */
+ /* Get the normalized blend coordinates of the currently selected */
+ /* interpolated font. */
+ /* */
+ /* This function works with all supported variation formats. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* num_coords :: The number of normalized blend coordinates to */
+ /* retrieve. If it is larger than the number of axes, */
+ /* set the excess values to~0.5 for Adobe MM fonts, and */
+ /* to~0 for TrueType GX and OpenType variation fonts. */
+ /* */
+ /* <Output> */
+ /* coords :: The normalized blend coordinates array. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_MM_Blend_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
/* FT_Set_Var_Blend_Coordinates */
/* */
/* <Description> */
@@ -373,6 +465,20 @@ FT_BEGIN_HEADER
FT_UInt num_coords,
FT_Fixed* coords );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Var_Blend_Coordinates */
+ /* */
+ /* <Description> */
+ /* This is another name of @FT_Get_MM_Blend_Coordinates. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Var_Blend_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
/* */
diff --git a/thirdparty/freetype/include/freetype/ftmodapi.h b/thirdparty/freetype/include/freetype/ftmodapi.h
index b4d2758efa..4147aadf8b 100644
--- a/thirdparty/freetype/include/freetype/ftmodapi.h
+++ b/thirdparty/freetype/include/freetype/ftmodapi.h
@@ -4,7 +4,7 @@
/* */
/* FreeType modules public interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -89,6 +89,7 @@ FT_BEGIN_HEADER
/* */
/* FT_Property_Set */
/* FT_Property_Get */
+ /* FT_Set_Default_Properties */
/* */
/* FT_New_Library */
/* FT_Done_Library */
@@ -440,6 +441,47 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Function> */
+ /* FT_Set_Default_Properties */
+ /* */
+ /* <Description> */
+ /* If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is */
+ /* set, this function reads the `FREETYPE_PROPERTIES' environment */
+ /* variable to control driver properties. See sections @auto_hinter, */
+ /* @cff_driver, @pcf_driver, and @tt_driver for more. */
+ /* */
+ /* If the compilation option is not set, this function does nothing. */
+ /* */
+ /* `FREETYPE_PROPERTIES' has the following syntax form (broken here */
+ /* into multiple lines for better readability). */
+ /* */
+ /* { */
+ /* <optional whitespace> */
+ /* <module-name1> ':' */
+ /* <property-name1> '=' <property-value1> */
+ /* <whitespace> */
+ /* <module-name2> ':' */
+ /* <property-name2> '=' <property-value2> */
+ /* ... */
+ /* } */
+ /* */
+ /* Example: */
+ /* */
+ /* { */
+ /* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */
+ /* cff:no-stem-darkening=1 \ */
+ /* autofitter:warping=1 */
+ /* } */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to a new library object. */
+ /* */
+ FT_EXPORT( void )
+ FT_Set_Default_Properties( FT_Library library );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
/* FT_Reference_Library */
/* */
/* <Description> */
@@ -477,8 +519,9 @@ FT_BEGIN_HEADER
/* valid for the life of the @FT_Library object. */
/* */
/* Normally, you would call this function (followed by a call to */
- /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
- /* instead of @FT_Init_FreeType to initialize the FreeType library. */
+ /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module, */
+ /* and a call to @FT_Set_Default_Properties) instead of */
+ /* @FT_Init_FreeType to initialize the FreeType library. */
/* */
/* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */
/* library instance. */
diff --git a/thirdparty/freetype/include/freetype/ftmoderr.h b/thirdparty/freetype/include/freetype/ftmoderr.h
index 2a7671c816..7f608375e8 100644
--- a/thirdparty/freetype/include/freetype/ftmoderr.h
+++ b/thirdparty/freetype/include/freetype/ftmoderr.h
@@ -4,7 +4,7 @@
/* */
/* FreeType module error offsets (specification). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftotval.h b/thirdparty/freetype/include/freetype/ftotval.h
index 3e6e18d8a6..b5d27cfe74 100644
--- a/thirdparty/freetype/include/freetype/ftotval.h
+++ b/thirdparty/freetype/include/freetype/ftotval.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating OpenType tables (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftoutln.h b/thirdparty/freetype/include/freetype/ftoutln.h
index 6a6451207c..07f73ebb1b 100644
--- a/thirdparty/freetype/include/freetype/ftoutln.h
+++ b/thirdparty/freetype/include/freetype/ftoutln.h
@@ -5,7 +5,7 @@
/* Support for the FT_Outline type used to store glyph shapes of */
/* most scalable font formats (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -115,6 +115,10 @@ FT_BEGIN_HEADER
/* outline for stroking purposes (otherwise it would result in a */
/* visible dot when round caps are used). */
/* */
+ /* Similarly, the function returns success for an empty outline also */
+ /* (doing nothing, this is, not calling any emitter); if necessary, */
+ /* you should filter this out, too. */
+ /* */
FT_EXPORT( FT_Error )
FT_Outline_Decompose( FT_Outline* outline,
const FT_Outline_Funcs* func_interface,
@@ -213,6 +217,10 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
+ /* <Note> */
+ /* An empty outline, or an outline with a single point only is also */
+ /* valid. */
+ /* */
FT_EXPORT( FT_Error )
FT_Outline_Check( FT_Outline* outline );
diff --git a/thirdparty/freetype/include/freetype/ftpcfdrv.h b/thirdparty/freetype/include/freetype/ftpcfdrv.h
new file mode 100644
index 0000000000..6622c936fb
--- /dev/null
+++ b/thirdparty/freetype/include/freetype/ftpcfdrv.h
@@ -0,0 +1,105 @@
+/***************************************************************************/
+/* */
+/* ftpcfdrv.h */
+/* */
+/* FreeType API for controlling the PCF driver (specification only). */
+/* */
+/* Copyright 2017 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef FTPCFDRV_H_
+#define FTPCFDRV_H_
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * pcf_driver
+ *
+ * @title:
+ * The PCF driver
+ *
+ * @abstract:
+ * Controlling the PCF driver module.
+ *
+ * @description:
+ * While FreeType's PCF driver doesn't expose API functions by itself,
+ * it is possible to control its behaviour with @FT_Property_Set and
+ * @FT_Property_Get. Right now, there is a single property
+ * `no-long-family-names' available if FreeType is compiled with
+ * PCF_CONFIG_OPTION_LONG_FAMILY_NAMES.
+ *
+ * The PCF driver's module name is `pcf'.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * no-long-family-names
+ *
+ * @description:
+ * If PCF_CONFIG_OPTION_LONG_FAMILY_NAMES is active while compiling
+ * FreeType, the PCF driver constructs long family names.
+ *
+ * There are many PCF fonts just called `Fixed' which look completely
+ * different, and which have nothing to do with each other. When
+ * selecting `Fixed' in KDE or Gnome one gets results that appear rather
+ * random, the style changes often if one changes the size and one
+ * cannot select some fonts at all. The improve this situation, the PCF
+ * module prepends the foundry name (plus a space) to the family name.
+ * It also checks whether there are `wide' characters; all put together,
+ * family names like `Sony Fixed' or `Misc Fixed Wide' are constructed.
+ *
+ * If `no-long-family-names' is set, this feature gets switched off.
+ *
+ * {
+ * FT_Library library;
+ * FT_Bool no_long_family_names = TRUE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "pcf",
+ * "no-long-family-names",
+ * &no_long_family_names );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values 1 and 0 for `on' and `off', respectively).
+ *
+ */
+
+
+FT_END_HEADER
+
+
+#endif /* FTPCFDRV_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/include/freetype/ftpfr.h b/thirdparty/freetype/include/freetype/ftpfr.h
index 2e1bff2f67..f2a6ae9349 100644
--- a/thirdparty/freetype/include/freetype/ftpfr.h
+++ b/thirdparty/freetype/include/freetype/ftpfr.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing PFR-specific data (specification only). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftrender.h b/thirdparty/freetype/include/freetype/ftrender.h
index 9f7ed9e9d9..960837580a 100644
--- a/thirdparty/freetype/include/freetype/ftrender.h
+++ b/thirdparty/freetype/include/freetype/ftrender.h
@@ -4,7 +4,7 @@
/* */
/* FreeType renderer modules public interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -75,6 +75,7 @@ FT_BEGIN_HEADER
{
FT_Long glyph_size;
FT_Glyph_Format glyph_format;
+
FT_Glyph_InitFunc glyph_init;
FT_Glyph_DoneFunc glyph_done;
FT_Glyph_CopyFunc glyph_copy;
diff --git a/thirdparty/freetype/include/freetype/ftsizes.h b/thirdparty/freetype/include/freetype/ftsizes.h
index 55e0d5ccfd..2f3958a857 100644
--- a/thirdparty/freetype/include/freetype/ftsizes.h
+++ b/thirdparty/freetype/include/freetype/ftsizes.h
@@ -4,7 +4,7 @@
/* */
/* FreeType size objects management (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftsnames.h b/thirdparty/freetype/include/freetype/ftsnames.h
index a7b51c2cba..a316540576 100644
--- a/thirdparty/freetype/include/freetype/ftsnames.h
+++ b/thirdparty/freetype/include/freetype/ftsnames.h
@@ -2,12 +2,12 @@
/* */
/* ftsnames.h */
/* */
-/* Simple interface to access SFNT name tables (which are used */
+/* Simple interface to access SFNT `name' tables (which are used */
/* to hold font names, copyright info, notices, etc.) (specification). */
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -49,7 +49,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* The TrueType and OpenType specifications allow the inclusion of */
- /* a special `names table' in font files. This table contains */
+ /* a special names table (`name') in font files. This table contains */
/* textual (and internationalized) information regarding the font, */
/* like family name, copyright, version, etc. */
/* */
@@ -70,30 +70,37 @@ FT_BEGIN_HEADER
/* */
/* <Fields> */
/* platform_id :: The platform ID for `string'. */
+ /* See @TT_PLATFORM_XXX for possible values. */
/* */
/* encoding_id :: The encoding ID for `string'. */
+ /* See @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
+ /* @TT_ISO_ID_XXX, @TT_MS_ID_XXX, and @TT_ADOBE_ID_XXX */
+ /* for possible values. */
/* */
/* language_id :: The language ID for `string'. */
+ /* See @TT_MAC_LANGID_XXX and @TT_MS_LANGID_XXX for */
+ /* possible values. */
+ /* */
+ /* Registered OpenType values for `language_id' are */
+ /* always smaller than 0x8000; values equal or larger */
+ /* than 0x8000 usually indicate a language tag string */
+ /* (introduced in OpenType version 1.6). Use function */
+ /* @FT_Get_Sfnt_LangTag with `language_id' as its */
+ /* argument to retrieve the associated language tag. */
/* */
/* name_id :: An identifier for `string'. */
+ /* See @TT_NAME_ID_XXX for possible values. */
/* */
/* string :: The `name' string. Note that its format differs */
- /* depending on the (platform,encoding) pair. It can */
- /* be a Pascal String, a UTF-16 one, etc. */
- /* */
- /* Generally speaking, the string is not */
- /* zero-terminated. Please refer to the TrueType */
- /* specification for details. */
+ /* depending on the (platform,encoding) pair, being */
+ /* either a string of bytes (without a terminating */
+ /* NULL byte) or containing UTF-16BE entities. */
/* */
/* string_len :: The length of `string' in bytes. */
/* */
/* <Note> */
- /* Possible values for `platform_id', `encoding_id', `language_id', */
- /* and `name_id' are given in the file `ttnameid.h'. For details */
- /* please refer to the TrueType or OpenType specification. */
- /* */
- /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
- /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
+ /* Please refer to the TrueType or OpenType specification for more */
+ /* details. */
/* */
typedef struct FT_SfntName_
{
@@ -103,7 +110,7 @@ FT_BEGIN_HEADER
FT_UShort name_id;
FT_Byte* string; /* this string is *not* null-terminated! */
- FT_UInt string_len; /* in bytes */
+ FT_UInt string_len; /* in bytes */
} FT_SfntName;
@@ -147,47 +154,127 @@ FT_BEGIN_HEADER
/* */
/* <Note> */
/* The `string' array returned in the `aname' structure is not */
- /* null-terminated. The application should deallocate it if it is no */
- /* longer in use. */
+ /* null-terminated. Note that you don't have to deallocate `string' */
+ /* by yourself; FreeType takes care of it if you call @FT_Done_Face. */
/* */
/* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
/* `name' table entries, then do a loop until you get the right */
/* platform, encoding, and name ID. */
/* */
+ /* `name' table format~1 entries can use language tags also, see */
+ /* @FT_Get_Sfnt_LangTag. */
+ /* */
FT_EXPORT( FT_Error )
FT_Get_Sfnt_Name( FT_Face face,
FT_UInt idx,
FT_SfntName *aname );
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_SfntLangTag */
+ /* */
+ /* <Description> */
+ /* A structure to model a language tag entry from an SFNT `name' */
+ /* table. */
+ /* */
+ /* <Fields> */
+ /* string :: The language tag string, encoded in UTF-16BE */
+ /* (without trailing NULL bytes). */
+ /* */
+ /* string_len :: The length of `string' in *bytes*. */
+ /* */
+ /* <Note> */
+ /* Please refer to the TrueType or OpenType specification for more */
+ /* details. */
+ /* */
+ typedef struct FT_SfntLangTag_
+ {
+ FT_Byte* string; /* this string is *not* null-terminated! */
+ FT_UInt string_len; /* in bytes */
+
+ } FT_SfntLangTag;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Sfnt_LangTag */
+ /* */
+ /* <Description> */
+ /* Retrieve the language tag associated with a language ID of an SFNT */
+ /* `name' table entry. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* langID :: The language ID, as returned by @FT_Get_Sfnt_Name. */
+ /* This is always a value larger than 0x8000. */
+ /* */
+ /* <Output> */
+ /* alangTag :: The language tag associated with the `name' table */
+ /* entry's language ID. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The `string' array returned in the `alangTag' structure is not */
+ /* null-terminated. Note that you don't have to deallocate `string' */
+ /* by yourself; FreeType takes care of it if you call @FT_Done_Face. */
+ /* */
+ /* Only `name' table format~1 supports language tags. For format~0 */
+ /* tables, this function always returns FT_Err_Invalid_Table. For */
+ /* invalid format~1 language ID values, FT_Err_Invalid_Argument is */
+ /* returned. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Sfnt_LangTag( FT_Face face,
+ FT_UInt langID,
+ FT_SfntLangTag *alangTag );
+
+
/***************************************************************************
*
* @constant:
- * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
+ * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
*
* @description:
- * A constant used as the tag of @FT_Parameter structures to make
- * FT_Open_Face() ignore preferred family subfamily names in `name'
- * table since OpenType version 1.4. For backwards compatibility with
- * legacy systems that have a 4-face-per-family restriction.
+ * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
+ * family names in the `name' table (introduced in OpenType version
+ * 1.4). Use this for backward compatibility with legacy systems that
+ * have a four-faces-per-family restriction.
*
*/
-#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
+#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \
+ FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
+
+
+ /* this constant is deprecated */
+#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \
+ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
/***************************************************************************
*
* @constant:
- * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
+ * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
*
* @description:
- * A constant used as the tag of @FT_Parameter structures to make
- * FT_Open_Face() ignore preferred subfamily names in `name' table since
- * OpenType version 1.4. For backwards compatibility with legacy
- * systems that have a 4-face-per-family restriction.
+ * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
+ * subfamily names in the `name' table (introduced in OpenType version
+ * 1.4). Use this for backward compatibility with legacy systems that
+ * have a four-faces-per-family restriction.
*
*/
-#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
+#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \
+ FT_MAKE_TAG( 'i', 'g', 'p', 's' )
+
+
+ /* this constant is deprecated */
+#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \
+ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
/* */
diff --git a/thirdparty/freetype/include/freetype/ftstroke.h b/thirdparty/freetype/include/freetype/ftstroke.h
index b3b9922dad..4a20667c5e 100644
--- a/thirdparty/freetype/include/freetype/ftstroke.h
+++ b/thirdparty/freetype/include/freetype/ftstroke.h
@@ -4,7 +4,7 @@
/* */
/* FreeType path stroker (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -136,7 +136,7 @@ FT_BEGIN_HEADER
* FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line
* join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias
* for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for
- * backwards compatibility.
+ * backward compatibility.
*/
typedef enum FT_Stroker_LineJoin_
{
diff --git a/thirdparty/freetype/include/freetype/ftsynth.h b/thirdparty/freetype/include/freetype/ftsynth.h
index fdfcb6912b..1863fa2383 100644
--- a/thirdparty/freetype/include/freetype/ftsynth.h
+++ b/thirdparty/freetype/include/freetype/ftsynth.h
@@ -5,7 +5,7 @@
/* FreeType synthesizing code for emboldening and slanting */
/* (specification). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftsystem.h b/thirdparty/freetype/include/freetype/ftsystem.h
index a75f958022..1aa4762ad6 100644
--- a/thirdparty/freetype/include/freetype/ftsystem.h
+++ b/thirdparty/freetype/include/freetype/ftsystem.h
@@ -4,7 +4,7 @@
/* */
/* FreeType low-level system interface definition (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/fttrigon.h b/thirdparty/freetype/include/freetype/fttrigon.h
index f789b524cb..89f0350675 100644
--- a/thirdparty/freetype/include/freetype/fttrigon.h
+++ b/thirdparty/freetype/include/freetype/fttrigon.h
@@ -4,7 +4,7 @@
/* */
/* FreeType trigonometric functions (specification). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftttdrv.h b/thirdparty/freetype/include/freetype/ftttdrv.h
index 0d868bc259..26bc5e966a 100644
--- a/thirdparty/freetype/include/freetype/ftttdrv.h
+++ b/thirdparty/freetype/include/freetype/ftttdrv.h
@@ -5,7 +5,7 @@
/* FreeType API for controlling the TrueType driver */
/* (specification only). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -110,7 +110,7 @@ FT_BEGIN_HEADER
* TrueType interpreter fully allows the advance width to be adjusted in
* this mode, just the DWrite client will ignore those changes.
*
- * _ClearType_ _Backwards_ _Compatibility_
+ * _ClearType_ _Backward_ _Compatibility_
*
* This is a set of exceptions made in the TrueType interpreter to
* minimize hinting techniques that were problematic with the extra
@@ -118,9 +118,9 @@ FT_BEGIN_HEADER
* http://www.beatstamm.com/typography/RTRCh4.htm#Sec1 and
* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx.
* This technique is not to be confused with ClearType compatible
- * widths. ClearType backwards compatibility has no direct impact on
+ * widths. ClearType backward compatibility has no direct impact on
* changing advance widths, but there might be an indirect impact on
- * disabling some deltas. This could be worked around in backwards
+ * disabling some deltas. This could be worked around in backward
* compatibility mode.
*
* _Native_ _ClearType_ _Mode_
@@ -138,7 +138,6 @@ FT_BEGIN_HEADER
* interpreter-version
*
* @description:
-
* Currently, three versions are available, two representing the
* bytecode interpreter with subpixel hinting support (old `Infinality'
* code and new stripped-down and higher performance `minimal' code) and
@@ -181,6 +180,8 @@ FT_BEGIN_HEADER
* @note:
* This property can be used with @FT_Property_Get also.
*
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values `35', `38', or `40').
*/
@@ -224,7 +225,7 @@ FT_BEGIN_HEADER
* filtering.
*
* If FreeType has not been compiled with the configuration option
- * FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 or~40 causes
+ * TT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 or~40 causes
* an `FT_Err_Unimplemented_Feature' error.
*
* Depending on the graphics framework, Microsoft uses different
diff --git a/thirdparty/freetype/include/freetype/fttypes.h b/thirdparty/freetype/include/freetype/fttypes.h
index 2673e79c3c..eab8adaad4 100644
--- a/thirdparty/freetype/include/freetype/fttypes.h
+++ b/thirdparty/freetype/include/freetype/fttypes.h
@@ -4,7 +4,7 @@
/* */
/* FreeType simple types definitions (specification only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftwinfnt.h b/thirdparty/freetype/include/freetype/ftwinfnt.h
index a1a715baa1..1eeef6c8ba 100644
--- a/thirdparty/freetype/include/freetype/ftwinfnt.h
+++ b/thirdparty/freetype/include/freetype/ftwinfnt.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing Windows fnt-specific data. */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/autohint.h b/thirdparty/freetype/include/freetype/internal/autohint.h
index 7ef82b8f3c..bae83e7384 100644
--- a/thirdparty/freetype/include/freetype/internal/autohint.h
+++ b/thirdparty/freetype/include/freetype/internal/autohint.h
@@ -4,7 +4,7 @@
/* */
/* High-level `autohint' module-specific interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/ftcalc.h b/thirdparty/freetype/include/freetype/internal/ftcalc.h
index 8a884f680a..c9ac9d8246 100644
--- a/thirdparty/freetype/include/freetype/internal/ftcalc.h
+++ b/thirdparty/freetype/include/freetype/internal/ftcalc.h
@@ -4,7 +4,7 @@
/* */
/* Arithmetic computations (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/ftdebug.h b/thirdparty/freetype/include/freetype/internal/ftdebug.h
index d110457157..5dcd2b1740 100644
--- a/thirdparty/freetype/include/freetype/internal/ftdebug.h
+++ b/thirdparty/freetype/include/freetype/internal/ftdebug.h
@@ -4,7 +4,7 @@
/* */
/* Debugging and logging component (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/ftdriver.h b/thirdparty/freetype/include/freetype/internal/ftdriver.h
index 3e1e66e979..e82fa8d41f 100644
--- a/thirdparty/freetype/include/freetype/internal/ftdriver.h
+++ b/thirdparty/freetype/include/freetype/internal/ftdriver.h
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -67,15 +67,6 @@ FT_BEGIN_HEADER
FT_Int32 load_flags );
- typedef FT_UInt
- (*FT_CharMap_CharIndexFunc)( FT_CharMap charmap,
- FT_Long charcode );
-
- typedef FT_Long
- (*FT_CharMap_CharNextFunc)( FT_CharMap charmap,
- FT_Long charcode );
-
-
typedef FT_Error
(*FT_Face_GetKerningFunc)( FT_Face face,
FT_UInt left_glyph,
diff --git a/thirdparty/freetype/include/freetype/internal/ftgloadr.h b/thirdparty/freetype/include/freetype/internal/ftgloadr.h
index bebf5dbba2..f41c3df554 100644
--- a/thirdparty/freetype/include/freetype/internal/ftgloadr.h
+++ b/thirdparty/freetype/include/freetype/internal/ftgloadr.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph loader (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/ftmemory.h b/thirdparty/freetype/include/freetype/internal/ftmemory.h
index 8c06fc21a5..59e5b58a57 100644
--- a/thirdparty/freetype/include/freetype/internal/ftmemory.h
+++ b/thirdparty/freetype/include/freetype/internal/ftmemory.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType memory management macros (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -108,10 +108,12 @@ extern "C++"
/*
* The allocation functions return a pointer, and the error code
- * is written to through the `p_error' parameter. See below for
- * for documentation.
+ * is written to through the `p_error' parameter.
*/
+ /* The `q' variants of the functions below (`q' for `quick') don't fill */
+ /* the allocated or reallocated memory with zero bytes. */
+
FT_BASE( FT_Pointer )
ft_mem_alloc( FT_Memory memory,
FT_Long size,
@@ -143,6 +145,9 @@ extern "C++"
const void* P );
+ /* The `Q' variants of the macros below (`Q' for `quick') don't fill */
+ /* the allocated or reallocated memory with zero bytes. */
+
#define FT_MEM_ALLOC( ptr, size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, \
(FT_Long)(size), \
diff --git a/thirdparty/freetype/include/freetype/internal/ftobjs.h b/thirdparty/freetype/include/freetype/internal/ftobjs.h
index e3fa32083b..558409166d 100644
--- a/thirdparty/freetype/include/freetype/internal/ftobjs.h
+++ b/thirdparty/freetype/include/freetype/internal/ftobjs.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType private base classes (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -193,6 +193,7 @@ FT_BEGIN_HEADER
typedef struct FT_CMap_ClassRec_
{
FT_ULong size;
+
FT_CMap_InitFunc init;
FT_CMap_DoneFunc done;
FT_CMap_CharIndexFunc char_index;
@@ -341,6 +342,20 @@ FT_BEGIN_HEADER
/* this data when first opened. This field exists only if */
/* @FT_CONFIG_OPTION_INCREMENTAL is defined. */
/* */
+ /* no_stem_darkening :: */
+ /* Overrides the module-level default, see @stem-darkening[cff], */
+ /* for example. FALSE and TRUE toggle stem darkening on and off, */
+ /* respectively, value~-1 means to use the module/driver default. */
+ /* */
+ /* random_seed :: */
+ /* If positive, override the seed value for the CFF `random' */
+ /* operator. Value~0 means to use the font's value. Value~-1 */
+ /* means to use the CFF driver's default. */
+ /* */
+ /* lcd_weights :: */
+ /* Overrides the library default with custom weights for the 5-tap */
+ /* FIR filter. `{0, 0, 0, 0, 0}' means to use the library default. */
+ /* */
/* refcount :: */
/* A counter initialized to~1 at the time an @FT_Face structure is */
/* created. @FT_Reference_Face increments this counter, and */
@@ -349,9 +364,9 @@ FT_BEGIN_HEADER
/* */
typedef struct FT_Face_InternalRec_
{
- FT_Matrix transform_matrix;
- FT_Vector transform_delta;
- FT_Int transform_flags;
+ FT_Matrix transform_matrix;
+ FT_Vector transform_delta;
+ FT_Int transform_flags;
FT_ServiceCacheRec services;
@@ -359,7 +374,13 @@ FT_BEGIN_HEADER
FT_Incremental_InterfaceRec* incremental_interface;
#endif
- FT_Int refcount;
+ FT_Char no_stem_darkening;
+ FT_Int32 random_seed;
+#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+ FT_LcdFiveTapFilter lcd_weights; /* preset or custom filter weights */
+#endif
+
+ FT_Int refcount;
} FT_Face_InternalRec;
@@ -412,8 +433,6 @@ FT_BEGIN_HEADER
} FT_GlyphSlot_InternalRec;
-#if 0
-
/*************************************************************************/
/* */
/* <Struct> */
@@ -421,17 +440,25 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* This structure contains the internal fields of each FT_Size */
- /* object. Currently, it's empty. */
+ /* object. */
+ /* */
+ /* <Fields> */
+ /* module_data :: Data specific to a driver module. */
+ /* */
+ /* autohint_mode :: The used auto-hinting mode. */
+ /* */
+ /* autohint_metrics :: Metrics used by the auto-hinter. */
/* */
/*************************************************************************/
typedef struct FT_Size_InternalRec_
{
- /* empty */
+ void* module_data;
- } FT_Size_InternalRec;
+ FT_Render_Mode autohint_mode;
+ FT_Size_Metrics autohint_metrics;
-#endif
+ } FT_Size_InternalRec;
/*************************************************************************/
@@ -530,7 +557,16 @@ FT_BEGIN_HEADER
FT_BASE( FT_Pointer )
ft_module_get_service( FT_Module module,
- const char* service_id );
+ const char* service_id,
+ FT_Bool global );
+
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ FT_BASE( FT_Error )
+ ft_property_string_set( FT_Library library,
+ const FT_String* module_name,
+ const FT_String* property_name,
+ FT_String* value );
+#endif
/* */
@@ -765,12 +801,19 @@ FT_BEGIN_HEADER
/* This hook is used by the TrueType debugger. It must be set to an */
/* alternate truetype bytecode interpreter function. */
-#define FT_DEBUG_HOOK_TRUETYPE 0
+#define FT_DEBUG_HOOK_TRUETYPE 0
typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
FT_Render_Mode render_mode,
- FT_Library library );
+ FT_Byte* weights );
+
+
+ /* This is the default LCD filter, an in-place, 5-tap FIR filter. */
+ FT_BASE( void )
+ ft_lcd_filter_fir( FT_Bitmap* bitmap,
+ FT_Render_Mode mode,
+ FT_LcdFiveTapFilter weights );
/*************************************************************************/
@@ -811,14 +854,17 @@ FT_BEGIN_HEADER
/* handle to the current renderer for the */
/* FT_GLYPH_FORMAT_OUTLINE format. */
/* */
- /* auto_hinter :: XXX */
+ /* auto_hinter :: The auto-hinter module interface. */
/* */
/* raster_pool :: The raster object's render pool. This can */
/* ideally be changed dynamically at run-time. */
/* */
/* raster_pool_size :: The size of the render pool in bytes. */
/* */
- /* debug_hooks :: XXX */
+ /* debug_hooks :: An array of four function pointers that allow */
+ /* debuggers to hook into a font format's */
+ /* interpreter. Currently, only the TrueType */
+ /* bytecode debugger uses this. */
/* */
/* lcd_filter :: If subpixel rendering is activated, the */
/* selected LCD filter mode. */
@@ -866,7 +912,7 @@ FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
FT_LcdFilter lcd_filter;
FT_Int lcd_extra; /* number of extra pixels */
- FT_Byte lcd_weights[7]; /* filter weights, if any */
+ FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */
FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
#endif
diff --git a/thirdparty/freetype/include/freetype/internal/ftpic.h b/thirdparty/freetype/include/freetype/internal/ftpic.h
index 6d800a08a1..0d43ed20f7 100644
--- a/thirdparty/freetype/include/freetype/internal/ftpic.h
+++ b/thirdparty/freetype/include/freetype/internal/ftpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services (declaration). */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/ftrfork.h b/thirdparty/freetype/include/freetype/internal/ftrfork.h
index b923401e68..25a44a4487 100644
--- a/thirdparty/freetype/include/freetype/internal/ftrfork.h
+++ b/thirdparty/freetype/include/freetype/internal/ftrfork.h
@@ -4,7 +4,7 @@
/* */
/* Embedded resource forks accessor (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -43,11 +43,12 @@ FT_BEGIN_HEADER
typedef struct FT_RFork_Ref_
{
- FT_UShort res_id;
- FT_Long offset;
+ FT_Short res_id;
+ FT_Long offset;
} FT_RFork_Ref;
+
#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
typedef FT_Error
(*ft_raccess_guess_func)( FT_Library library,
diff --git a/thirdparty/freetype/include/freetype/internal/ftserv.h b/thirdparty/freetype/include/freetype/internal/ftserv.h
index 91897177ba..71ef9cac3a 100644
--- a/thirdparty/freetype/include/freetype/internal/ftserv.h
+++ b/thirdparty/freetype/include/freetype/internal/ftserv.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType services (specification only). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -109,27 +109,27 @@ FT_BEGIN_HEADER
*/
#ifdef __cplusplus
-#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
- FT_BEGIN_STMNT \
- FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
- FT_Pointer _tmp_; \
- FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
- \
- \
- _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
- *_pptr_ = _tmp_; \
+#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
+ FT_BEGIN_STMNT \
+ FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
+ FT_Pointer _tmp_; \
+ FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
+ \
+ \
+ _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id, 1 ); \
+ *_pptr_ = _tmp_; \
FT_END_STMNT
#else /* !C++ */
-#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
- FT_BEGIN_STMNT \
- FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
- FT_Pointer _tmp_; \
- \
- \
- _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
- ptr = _tmp_; \
+#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
+ FT_BEGIN_STMNT \
+ FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
+ FT_Pointer _tmp_; \
+ \
+ \
+ _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id, 1 ); \
+ ptr = _tmp_; \
FT_END_STMNT
#endif /* !C++ */
@@ -167,6 +167,7 @@ FT_BEGIN_HEADER
/* FT_DEFINE_SERVICEDESCREC5 */
/* FT_DEFINE_SERVICEDESCREC6 */
/* FT_DEFINE_SERVICEDESCREC7 */
+ /* FT_DEFINE_SERVICEDESCREC8 */
/* */
/* <Description> */
/* Used to initialize an array of FT_ServiceDescRec structures. */
@@ -283,6 +284,52 @@ FT_BEGIN_HEADER
{ NULL, NULL } \
};
+#define FT_DEFINE_SERVICEDESCREC8( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7, \
+ serv_id_8, serv_data_8 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { serv_id_2, serv_data_2 }, \
+ { serv_id_3, serv_data_3 }, \
+ { serv_id_4, serv_data_4 }, \
+ { serv_id_5, serv_data_5 }, \
+ { serv_id_6, serv_data_6 }, \
+ { serv_id_7, serv_data_7 }, \
+ { serv_id_8, serv_data_8 }, \
+ { NULL, NULL } \
+ };
+
+#define FT_DEFINE_SERVICEDESCREC9( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7, \
+ serv_id_8, serv_data_8, \
+ serv_id_9, serv_data_9 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { serv_id_2, serv_data_2 }, \
+ { serv_id_3, serv_data_3 }, \
+ { serv_id_4, serv_data_4 }, \
+ { serv_id_5, serv_data_5 }, \
+ { serv_id_6, serv_data_6 }, \
+ { serv_id_7, serv_data_7 }, \
+ { serv_id_8, serv_data_8 }, \
+ { serv_id_9, serv_data_9 }, \
+ { NULL, NULL } \
+ };
+
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICEDESCREC1( class_, \
@@ -593,6 +640,121 @@ FT_BEGIN_HEADER
return FT_Err_Ok; \
}
+#define FT_DEFINE_SERVICEDESCREC8( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7, \
+ serv_id_8, serv_data_8 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 9 ) ) \
+ return error; \
+ \
+ clazz[0].serv_id = serv_id_1; \
+ clazz[0].serv_data = serv_data_1; \
+ clazz[1].serv_id = serv_id_2; \
+ clazz[1].serv_data = serv_data_2; \
+ clazz[2].serv_id = serv_id_3; \
+ clazz[2].serv_data = serv_data_3; \
+ clazz[3].serv_id = serv_id_4; \
+ clazz[3].serv_data = serv_data_4; \
+ clazz[4].serv_id = serv_id_5; \
+ clazz[4].serv_data = serv_data_5; \
+ clazz[5].serv_id = serv_id_6; \
+ clazz[5].serv_data = serv_data_6; \
+ clazz[6].serv_id = serv_id_7; \
+ clazz[6].serv_data = serv_data_7; \
+ clazz[7].serv_id = serv_id_8; \
+ clazz[7].serv_data = serv_data_8; \
+ clazz[8].serv_id = NULL; \
+ clazz[8].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+#define FT_DEFINE_SERVICEDESCREC9( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7, \
+ serv_id_8, serv_data_8, \
+ serv_id_9, serv_data_9 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 10 ) ) \
+ return error; \
+ \
+ clazz[0].serv_id = serv_id_1; \
+ clazz[0].serv_data = serv_data_1; \
+ clazz[1].serv_id = serv_id_2; \
+ clazz[1].serv_data = serv_data_2; \
+ clazz[2].serv_id = serv_id_3; \
+ clazz[2].serv_data = serv_data_3; \
+ clazz[3].serv_id = serv_id_4; \
+ clazz[3].serv_data = serv_data_4; \
+ clazz[4].serv_id = serv_id_5; \
+ clazz[4].serv_data = serv_data_5; \
+ clazz[5].serv_id = serv_id_6; \
+ clazz[5].serv_data = serv_data_6; \
+ clazz[6].serv_id = serv_id_7; \
+ clazz[6].serv_data = serv_data_7; \
+ clazz[7].serv_id = serv_id_8; \
+ clazz[7].serv_data = serv_data_8; \
+ clazz[8].serv_id = serv_id_9; \
+ clazz[8].serv_data = serv_data_9; \
+ clazz[9].serv_id = NULL; \
+ clazz[9].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
#endif /* FT_CONFIG_OPTION_PIC */
@@ -635,6 +797,7 @@ FT_BEGIN_HEADER
{
FT_Pointer service_POSTSCRIPT_FONT_NAME;
FT_Pointer service_MULTI_MASTERS;
+ FT_Pointer service_METRICS_VARIATIONS;
FT_Pointer service_GLYPH_DICT;
FT_Pointer service_PFR_METRICS;
FT_Pointer service_WINFNT;
@@ -655,7 +818,7 @@ FT_BEGIN_HEADER
* FT_FACE_LOOKUP_SERVICE
*
* @description:
- * This macro is used to lookup a service from a face's driver module
+ * This macro is used to look up a service from a face's driver module
* using its cache.
*
* @input:
@@ -739,6 +902,7 @@ FT_BEGIN_HEADER
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
+#define FT_SERVICE_METRICS_VARIATIONS_H <freetype/internal/services/svmetric.h>
#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h>
#define FT_SERVICE_OPENTYPE_VALIDATE_H <freetype/internal/services/svotval.h>
#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h>
diff --git a/thirdparty/freetype/include/freetype/internal/ftstream.h b/thirdparty/freetype/include/freetype/internal/ftstream.h
index 6d04875657..3e2c07b269 100644
--- a/thirdparty/freetype/include/freetype/internal/ftstream.h
+++ b/thirdparty/freetype/include/freetype/internal/ftstream.h
@@ -4,7 +4,7 @@
/* */
/* Stream handling (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -502,7 +502,7 @@ FT_BEGIN_HEADER
#define FT_STREAM_READ_AT( position, buffer, count ) \
FT_SET_ERROR( FT_Stream_ReadAt( stream, \
(FT_ULong)(position), \
- (FT_Byte*)buffer, \
+ (FT_Byte*)(buffer), \
(FT_ULong)(count) ) )
#define FT_STREAM_READ_FIELDS( fields, object ) \
diff --git a/thirdparty/freetype/include/freetype/internal/fttrace.h b/thirdparty/freetype/include/freetype/internal/fttrace.h
index efb3355954..caf5fc9460 100644
--- a/thirdparty/freetype/include/freetype/internal/fttrace.h
+++ b/thirdparty/freetype/include/freetype/internal/fttrace.h
@@ -4,7 +4,7 @@
/* */
/* Tracing handling (specification only). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/ftvalid.h b/thirdparty/freetype/include/freetype/internal/ftvalid.h
index aac92c9af8..df6f7c5778 100644
--- a/thirdparty/freetype/include/freetype/internal/ftvalid.h
+++ b/thirdparty/freetype/include/freetype/internal/ftvalid.h
@@ -4,7 +4,7 @@
/* */
/* FreeType validation support (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/internal.h b/thirdparty/freetype/include/freetype/internal/internal.h
index 8c3c14c12a..02046813a3 100644
--- a/thirdparty/freetype/include/freetype/internal/internal.h
+++ b/thirdparty/freetype/include/freetype/internal/internal.h
@@ -4,7 +4,7 @@
/* */
/* Internal header files (specification only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/psaux.h b/thirdparty/freetype/include/freetype/internal/psaux.h
index 15dedfd28e..935eb1a9c7 100644
--- a/thirdparty/freetype/include/freetype/internal/psaux.h
+++ b/thirdparty/freetype/include/freetype/internal/psaux.h
@@ -5,7 +5,7 @@
/* Auxiliary functions and data structures related to PostScript fonts */
/* (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -817,7 +817,7 @@ FT_BEGIN_HEADER
} PSAux_ServiceRec, *PSAux_Service;
- /* backwards-compatible type definition */
+ /* backward compatible type definition */
typedef PSAux_ServiceRec PSAux_Interface;
diff --git a/thirdparty/freetype/include/freetype/internal/pshints.h b/thirdparty/freetype/include/freetype/internal/pshints.h
index e60dc9cd55..49116eb443 100644
--- a/thirdparty/freetype/include/freetype/internal/pshints.h
+++ b/thirdparty/freetype/include/freetype/internal/pshints.h
@@ -6,7 +6,7 @@
/* recorders (specification only). These are used to support native */
/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svbdf.h b/thirdparty/freetype/include/freetype/internal/services/svbdf.h
index c24475fc20..eeebf67da1 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svbdf.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svbdf.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType BDF services (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svcid.h b/thirdparty/freetype/include/freetype/internal/services/svcid.h
index dbbe6044a4..cce94d8df6 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svcid.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svcid.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType CID font services (specification). */
/* */
-/* Copyright 2007-2016 by */
+/* Copyright 2007-2017 by */
/* Derek Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h b/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h
index bd295c9c6b..376d9255bb 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType font format service (specification only). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svgldict.h b/thirdparty/freetype/include/freetype/internal/services/svgldict.h
index fff29bc40c..0cd13618d8 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svgldict.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svgldict.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph dictionary services (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svgxval.h b/thirdparty/freetype/include/freetype/internal/services/svgxval.h
index fb8ffba83c..71bfa97af8 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svgxval.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svgxval.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svkern.h b/thirdparty/freetype/include/freetype/internal/services/svkern.h
index a636f1af1c..b8344e96e9 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svkern.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svkern.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType Kerning service (specification). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svmetric.h b/thirdparty/freetype/include/freetype/internal/services/svmetric.h
new file mode 100644
index 0000000000..1f7d5ddd0c
--- /dev/null
+++ b/thirdparty/freetype/include/freetype/internal/services/svmetric.h
@@ -0,0 +1,153 @@
+/***************************************************************************/
+/* */
+/* svmetric.h */
+/* */
+/* The FreeType services for metrics variations (specification). */
+/* */
+/* Copyright 2016-2017 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef SVMETRIC_H_
+#define SVMETRIC_H_
+
+#include FT_INTERNAL_SERVICE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*
+ * A service to manage the `HVAR, `MVAR', and `VVAR' OpenType tables.
+ *
+ */
+
+#define FT_SERVICE_ID_METRICS_VARIATIONS "metrics-variations"
+
+
+ /* HVAR */
+
+ typedef FT_Error
+ (*FT_HAdvance_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ typedef FT_Error
+ (*FT_LSB_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ typedef FT_Error
+ (*FT_RSB_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ /* VVAR */
+
+ typedef FT_Error
+ (*FT_VAdvance_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ typedef FT_Error
+ (*FT_TSB_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ typedef FT_Error
+ (*FT_BSB_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ typedef FT_Error
+ (*FT_VOrg_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ /* MVAR */
+
+ typedef void
+ (*FT_Metrics_Adjust_Func)( FT_Face face );
+
+
+ FT_DEFINE_SERVICE( MetricsVariations )
+ {
+ FT_HAdvance_Adjust_Func hadvance_adjust;
+ FT_LSB_Adjust_Func lsb_adjust;
+ FT_RSB_Adjust_Func rsb_adjust;
+
+ FT_VAdvance_Adjust_Func vadvance_adjust;
+ FT_TSB_Adjust_Func tsb_adjust;
+ FT_BSB_Adjust_Func bsb_adjust;
+ FT_VOrg_Adjust_Func vorg_adjust;
+
+ FT_Metrics_Adjust_Func metrics_adjust;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
+ hadvance_adjust_, \
+ lsb_adjust_, \
+ rsb_adjust_, \
+ vadvance_adjust_, \
+ tsb_adjust_, \
+ bsb_adjust_, \
+ vorg_adjust_, \
+ metrics_adjust_ ) \
+ static const FT_Service_MetricsVariationsRec class_ = \
+ { \
+ hadvance_adjust_, \
+ lsb_adjust_, \
+ rsb_adjust_, \
+ vadvance_adjust_, \
+ tsb_adjust_, \
+ bsb_adjust_, \
+ vorg_adjust_, \
+ metrics_adjust_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
+ hadvance_adjust_, \
+ lsb_adjust_, \
+ rsb_adjust_, \
+ vadvance_adjust_, \
+ tsb_adjust_, \
+ bsb_adjust_, \
+ vorg_adjust_, \
+ metrics_adjust_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Service_MetricsVariationsRec* clazz ) \
+ { \
+ clazz->hadvance_adjust = hadvance_adjust_; \
+ clazz->lsb_adjust = lsb_adjust_; \
+ clazz->rsb_adjust = rsb_adjust_; \
+ clazz->vadvance_adjust = vadvance_adjust_; \
+ clazz->tsb_adjust = tsb_adjust_; \
+ clazz->bsb_adjust = bsb_adjust_; \
+ clazz->vorg_adjust = vorg_adjust_; \
+ clazz->metrics_adjust = metrics_adjust_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* SVMETRIC_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svmm.h b/thirdparty/freetype/include/freetype/internal/services/svmm.h
index b78a19f8e0..1d51cd9090 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svmm.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svmm.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType Multiple Masters and GX var services (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -58,46 +58,92 @@ FT_BEGIN_HEADER
FT_UInt num_coords,
FT_Long* coords );
+ typedef FT_Error
+ (*FT_Get_Var_Design_Func)( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+ typedef FT_Error
+ (*FT_Get_MM_Blend_Func)( FT_Face face,
+ FT_UInt num_coords,
+ FT_Long* coords );
+
+ typedef FT_Error
+ (*FT_Get_Var_Blend_Func)( FT_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords,
+ FT_Fixed* *normalizedcoords,
+ FT_MM_Var* *mm_var );
+
+ typedef void
+ (*FT_Done_Blend_Func)( FT_Face );
+
FT_DEFINE_SERVICE( MultiMasters )
{
FT_Get_MM_Func get_mm;
FT_Set_MM_Design_Func set_mm_design;
FT_Set_MM_Blend_Func set_mm_blend;
+ FT_Get_MM_Blend_Func get_mm_blend;
FT_Get_MM_Var_Func get_mm_var;
FT_Set_Var_Design_Func set_var_design;
+ FT_Get_Var_Design_Func get_var_design;
+
+ /* for internal use; only needed for code sharing between modules */
+ FT_Get_Var_Blend_Func get_var_blend;
+ FT_Done_Blend_Func done_blend;
};
#ifndef FT_CONFIG_OPTION_PIC
-#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
- get_mm_, \
- set_mm_design_, \
- set_mm_blend_, \
- get_mm_var_, \
- set_var_design_ ) \
- static const FT_Service_MultiMastersRec class_ = \
- { \
- get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_ \
+#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_, \
+ get_var_design_, \
+ get_var_blend_, \
+ done_blend_ ) \
+ static const FT_Service_MultiMastersRec class_ = \
+ { \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_, \
+ get_var_design_, \
+ get_var_blend_, \
+ done_blend_ \
};
#else /* FT_CONFIG_OPTION_PIC */
-#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
- get_mm_, \
- set_mm_design_, \
- set_mm_blend_, \
- get_mm_var_, \
- set_var_design_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
- { \
- clazz->get_mm = get_mm_; \
- clazz->set_mm_design = set_mm_design_; \
- clazz->set_mm_blend = set_mm_blend_; \
- clazz->get_mm_var = get_mm_var_; \
- clazz->set_var_design = set_var_design_; \
+#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_, \
+ get_var_design_, \
+ get_var_blend_, \
+ done_blend_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
+ { \
+ clazz->get_mm = get_mm_; \
+ clazz->set_mm_design = set_mm_design_; \
+ clazz->set_mm_blend = set_mm_blend_; \
+ clazz->get_mm_blend = get_mm_blend_; \
+ clazz->get_mm_var = get_mm_var_; \
+ clazz->set_var_design = set_var_design_; \
+ clazz->get_var_design = get_var_design_; \
+ clazz->get_var_blend = get_var_blend_; \
+ clazz->done_blend = done_blend_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svotval.h b/thirdparty/freetype/include/freetype/internal/services/svotval.h
index bc929d4bd9..ac84abee46 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svotval.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svotval.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType OpenType validation service (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svpfr.h b/thirdparty/freetype/include/freetype/internal/services/svpfr.h
index d0f7c4df95..c9a182fe39 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svpfr.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svpfr.h
@@ -4,7 +4,7 @@
/* */
/* Internal PFR service functions (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svpostnm.h b/thirdparty/freetype/include/freetype/internal/services/svpostnm.h
index f124380050..022cdec195 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svpostnm.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svpostnm.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript name services (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svprop.h b/thirdparty/freetype/include/freetype/internal/services/svprop.h
index 870e90ed7c..eb2d4eed15 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svprop.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svprop.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType property service (specification). */
/* */
-/* Copyright 2012-2016 by */
+/* Copyright 2012-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -29,7 +29,8 @@ FT_BEGIN_HEADER
typedef FT_Error
(*FT_Properties_SetFunc)( FT_Module module,
const char* property_name,
- const void* value );
+ const void* value,
+ FT_Bool value_is_string );
typedef FT_Error
(*FT_Properties_GetFunc)( FT_Module module,
diff --git a/thirdparty/freetype/include/freetype/internal/services/svpscmap.h b/thirdparty/freetype/include/freetype/internal/services/svpscmap.h
index 9acc21690f..b32122e5d6 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svpscmap.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svpscmap.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript charmap service (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h b/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h
index f2c8060440..0220ce529c 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript info service (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svsfnt.h b/thirdparty/freetype/include/freetype/internal/services/svsfnt.h
index 0f38cf195f..49d18e43e0 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svsfnt.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svsfnt.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType SFNT table loading service (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svttcmap.h b/thirdparty/freetype/include/freetype/internal/services/svttcmap.h
index 772c72189e..30f7feec71 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svttcmap.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svttcmap.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType TrueType/sfnt cmap extra information service. */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* Masatake YAMATO, Redhat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svtteng.h b/thirdparty/freetype/include/freetype/internal/services/svtteng.h
index c55061a034..e4b368ad40 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svtteng.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svtteng.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType TrueType engine query service (specification). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svttglyf.h b/thirdparty/freetype/include/freetype/internal/services/svttglyf.h
index c33edd46de..b7793059fd 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svttglyf.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svttglyf.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType TrueType glyph service. */
/* */
-/* Copyright 2007-2016 by */
+/* Copyright 2007-2017 by */
/* David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h b/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h
index c2f6d4c6d3..c94b7e1073 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType Windows FNT/FONT service (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/sfnt.h b/thirdparty/freetype/include/freetype/internal/sfnt.h
index e139315a1f..b8667a003a 100644
--- a/thirdparty/freetype/include/freetype/internal/sfnt.h
+++ b/thirdparty/freetype/include/freetype/internal/sfnt.h
@@ -4,7 +4,7 @@
/* */
/* High-level `sfnt' driver interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -458,6 +458,37 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <FuncType> */
+ /* TT_Get_Name_ID_Func */
+ /* */
+ /* <Description> */
+ /* Search whether an ENGLISH version for a given name ID is in the */
+ /* `name' table. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* nameid :: The name id of the name record to return. */
+ /* */
+ /* <Out> */
+ /* win :: If non-negative, an index into the `name' table with */
+ /* the corresponding (3,1) or (3,0) Windows entry. */
+ /* */
+ /* apple :: If non-negative, an index into the `name' table with */
+ /* the corresponding (1,0) Apple entry. */
+ /* */
+ /* <Return> */
+ /* 1 if there is either a win or apple entry (or both), 0 otheriwse. */
+ /* */
+ typedef FT_Bool
+ (*TT_Get_Name_ID_Func)( TT_Face face,
+ FT_UShort nameid,
+ FT_Int *win,
+ FT_Int *apple );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
/* TT_Load_Table_Func */
/* */
/* <Description> */
@@ -588,6 +619,7 @@ FT_BEGIN_HEADER
TT_Get_Metrics_Func get_metrics;
TT_Get_Name_Func get_name;
+ TT_Get_Name_ID_Func get_name_id;
} SFNT_Interface;
@@ -628,7 +660,8 @@ FT_BEGIN_HEADER
set_sbit_strike_, \
load_strike_metrics_, \
get_metrics_, \
- get_name_ ) \
+ get_name_, \
+ get_name_id_ ) \
static const SFNT_Interface class_ = \
{ \
goto_table_, \
@@ -661,6 +694,7 @@ FT_BEGIN_HEADER
load_strike_metrics_, \
get_metrics_, \
get_name_, \
+ get_name_id_ \
};
#else /* FT_CONFIG_OPTION_PIC */
@@ -699,7 +733,8 @@ FT_BEGIN_HEADER
set_sbit_strike_, \
load_strike_metrics_, \
get_metrics_, \
- get_name_ ) \
+ get_name_, \
+ get_name_id_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
SFNT_Interface* clazz ) \
@@ -736,6 +771,7 @@ FT_BEGIN_HEADER
clazz->load_strike_metrics = load_strike_metrics_; \
clazz->get_metrics = get_metrics_; \
clazz->get_name = get_name_; \
+ clazz->get_name_id = get_name_id_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
diff --git a/thirdparty/freetype/include/freetype/internal/t1types.h b/thirdparty/freetype/include/freetype/internal/t1types.h
index 494c011fc7..b2e35d42d1 100644
--- a/thirdparty/freetype/include/freetype/internal/t1types.h
+++ b/thirdparty/freetype/include/freetype/internal/t1types.h
@@ -5,7 +5,7 @@
/* Basic Type1/Type2 type definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/tttypes.h b/thirdparty/freetype/include/freetype/internal/tttypes.h
index 4110d50285..c0758e25fc 100644
--- a/thirdparty/freetype/include/freetype/internal/tttypes.h
+++ b/thirdparty/freetype/include/freetype/internal/tttypes.h
@@ -5,7 +5,7 @@
/* Basic SFNT/TrueType type definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -243,7 +243,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Struct> */
- /* TT_NameEntryRec */
+ /* TT_NameRec */
/* */
/* <Description> */
/* A structure modeling TrueType name records. Name records are used */
@@ -267,7 +267,7 @@ FT_BEGIN_HEADER
/* string :: A pointer to the string's bytes. Note that these */
/* are usually UTF-16 encoded characters. */
/* */
- typedef struct TT_NameEntryRec_
+ typedef struct TT_NameRec_
{
FT_UShort platformID;
FT_UShort encodingID;
@@ -279,9 +279,39 @@ FT_BEGIN_HEADER
/* this last field is not defined in the spec */
/* but used by the FreeType engine */
- FT_Byte* string;
+ FT_Byte* string;
- } TT_NameEntryRec, *TT_NameEntry;
+ } TT_NameRec, *TT_Name;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_LangTagRec */
+ /* */
+ /* <Description> */
+ /* A structure modeling language tag records in SFNT `name' tables, */
+ /* introduced in OpenType version 1.6. */
+ /* */
+ /* <Fields> */
+ /* stringLength :: The length of the string in bytes. */
+ /* */
+ /* stringOffset :: The offset to the string in the `name' table. */
+ /* */
+ /* string :: A pointer to the string's bytes. Note that these */
+ /* are UTF-16BE encoded characters. */
+ /* */
+ typedef struct TT_LangTagRec_
+ {
+ FT_UShort stringLength;
+ FT_ULong stringOffset;
+
+ /* this last field is not defined in the spec */
+ /* but used by the FreeType engine */
+
+ FT_Byte* string;
+
+ } TT_LangTagRec, *TT_LangTag;
/*************************************************************************/
@@ -293,24 +323,30 @@ FT_BEGIN_HEADER
/* A structure modeling the TrueType name table. */
/* */
/* <Fields> */
- /* format :: The format of the name table. */
+ /* format :: The format of the name table. */
+ /* */
+ /* numNameRecords :: The number of names in table. */
/* */
- /* numNameRecords :: The number of names in table. */
+ /* storageOffset :: The offset of the name table in the `name' */
+ /* TrueType table. */
/* */
- /* storageOffset :: The offset of the name table in the `name' */
- /* TrueType table. */
+ /* names :: An array of name records. */
/* */
- /* names :: An array of name records. */
+ /* numLangTagRecords :: The number of language tags in table. */
/* */
- /* stream :: the file's input stream. */
+ /* langTags :: An array of language tag records. */
+ /* */
+ /* stream :: The file's input stream. */
/* */
typedef struct TT_NameTableRec_
{
- FT_UShort format;
- FT_UInt numNameRecords;
- FT_UInt storageOffset;
- TT_NameEntryRec* names;
- FT_Stream stream;
+ FT_UShort format;
+ FT_UInt numNameRecords;
+ FT_UInt storageOffset;
+ TT_NameRec* names;
+ FT_UInt numLangTagRecords;
+ TT_LangTagRec* langTags;
+ FT_Stream stream;
} TT_NameTableRec, *TT_NameTable;
@@ -1060,6 +1096,34 @@ FT_BEGIN_HEADER
} TT_SbitTableType;
+ /* OpenType 1.8 brings new tables for variation font support; */
+ /* to make the old MM and GX fonts still work we need to check */
+ /* the presence (and validity) of the functionality provided */
+ /* by those tables. The following flag macros are for the */
+ /* field `variation_support'. */
+ /* */
+ /* Note that `fvar' gets checked immediately at font loading, */
+ /* while the other features are only loaded if MM support is */
+ /* actually requested. */
+
+ /* FVAR */
+#define TT_FACE_FLAG_VAR_FVAR ( 1 << 0 )
+
+ /* HVAR */
+#define TT_FACE_FLAG_VAR_HADVANCE ( 1 << 1 )
+#define TT_FACE_FLAG_VAR_LSB ( 1 << 2 )
+#define TT_FACE_FLAG_VAR_RSB ( 1 << 3 )
+
+ /* VVAR */
+#define TT_FACE_FLAG_VAR_VADVANCE ( 1 << 4 )
+#define TT_FACE_FLAG_VAR_TSB ( 1 << 5 )
+#define TT_FACE_FLAG_VAR_BSB ( 1 << 6 )
+#define TT_FACE_FLAG_VAR_VORG ( 1 << 7 )
+
+ /* MVAR */
+#define TT_FACE_FLAG_VAR_MVAR ( 1 << 8 )
+
+
/*************************************************************************/
/* */
/* TrueType Face Type */
@@ -1161,6 +1225,11 @@ FT_BEGIN_HEADER
/* */
/* psnames :: A pointer to the PostScript names service. */
/* */
+ /* mm :: A pointer to the Multiple Masters service. */
+ /* */
+ /* var :: A pointer to the Metrics Variations */
+ /* service. */
+ /* */
/* hdmx :: The face's horizontal device metrics */
/* (`hdmx' table). This table is optional in */
/* TrueType/OpenType fonts. */
@@ -1182,18 +1251,6 @@ FT_BEGIN_HEADER
/* file `ttconfig.h' for comments on the */
/* TT_CONFIG_OPTION_POSTSCRIPT_NAMES option. */
/* */
- /* num_locations :: The number of glyph locations in this */
- /* TrueType file. This should be */
- /* identical to the number of glyphs. */
- /* Ignored for Type 2 fonts. */
- /* */
- /* glyph_locations :: An array of longs. These are offsets to */
- /* glyph data within the `glyf' table. */
- /* Ignored for Type 2 font faces. */
- /* */
- /* glyf_len :: The length of the `glyf' table. Needed */
- /* for malformed `loca' tables. */
- /* */
/* font_program_size :: Size in bytecodes of the face's font */
/* program. 0 if none defined. Ignored for */
/* Type 2 fonts. */
@@ -1219,20 +1276,22 @@ FT_BEGIN_HEADER
/* units. Comes from the `cvt ' table. */
/* Ignored for Type 2 fonts. */
/* */
- /* num_kern_pairs :: The number of kerning pairs present in the */
- /* font file. The engine only loads the */
- /* first horizontal format 0 kern table it */
- /* finds in the font file. Ignored for */
- /* Type 2 fonts. */
- /* */
- /* kern_table_index :: The index of the kerning table in the font */
- /* kerning directory. Ignored for Type 2 */
- /* fonts. */
- /* */
/* interpreter :: A pointer to the TrueType bytecode */
/* interpreters field is also used to hook */
/* the debugger in `ttdebug'. */
/* */
+ /* extra :: Reserved for third-party font drivers. */
+ /* */
+ /* postscript_name :: The PS name of the font. Used by the */
+ /* postscript name service. */
+ /* */
+ /* glyf_len :: The length of the `glyf' table. Needed */
+ /* for malformed `loca' tables. */
+ /* */
+ /* glyf_offset :: The file offset of the `glyf' table. */
+ /* */
+ /* is_cff2 :: Set if the font format is CFF2. */
+ /* */
/* doblend :: A boolean which is set if the font should */
/* be blended (this is for GX var). */
/* */
@@ -1240,10 +1299,98 @@ FT_BEGIN_HEADER
/* variation tables (rather like Multiple */
/* Master data). */
/* */
- /* extra :: Reserved for third-party font drivers. */
+ /* is_default_instance :: Set if the glyph outlines can be used */
+ /* unmodified (i.e., without applying glyph */
+ /* variation deltas). */
/* */
- /* postscript_name :: The PS name of the font. Used by the */
- /* postscript name service. */
+ /* variation_support :: Flags that indicate which OpenType */
+ /* functionality related to font variation */
+ /* support is present, valid, and usable. */
+ /* For example, TT_FACE_FLAG_VAR_FVAR is only */
+ /* set if we have at least one design axis. */
+ /* */
+ /* var_postscript_prefix :: */
+ /* The PostScript name prefix needed for */
+ /* constructing a variation font instance's */
+ /* PS name . */
+ /* */
+ /* var_postscript_prefix_len :: */
+ /* The length of the `var_postscript_prefix' */
+ /* string. */
+ /* */
+ /* horz_metrics_size :: The size of the `hmtx' table. */
+ /* */
+ /* vert_metrics_size :: The size of the `vmtx' table. */
+ /* */
+ /* num_locations :: The number of glyph locations in this */
+ /* TrueType file. This should be */
+ /* identical to the number of glyphs. */
+ /* Ignored for Type 2 fonts. */
+ /* */
+ /* glyph_locations :: An array of longs. These are offsets to */
+ /* glyph data within the `glyf' table. */
+ /* Ignored for Type 2 font faces. */
+ /* */
+ /* hdmx_table :: A pointer to the `hdmx' table. */
+ /* */
+ /* hdmx_table_size :: The size of the `hdmx' table. */
+ /* */
+ /* hdmx_record_count :: The number of hdmx records. */
+ /* */
+ /* hdmx_record_size :: The size of a single hdmx record. */
+ /* */
+ /* hdmx_record_sizes :: An array holding the ppem sizes available */
+ /* in the `hdmx' table. */
+ /* */
+ /* sbit_table :: A pointer to the font's embedded bitmap */
+ /* location table. */
+ /* */
+ /* sbit_table_size :: The size of `sbit_table'. */
+ /* */
+ /* sbit_table_type :: The sbit table type (CBLC, sbix, etc.). */
+ /* */
+ /* sbit_num_strikes :: The number of sbit strikes exposed by */
+ /* FreeType's API, omitting invalid strikes. */
+ /* */
+ /* sbit_strike_map :: A mapping between the strike indices */
+ /* exposed by the API and the indices used in */
+ /* the font's sbit table. */
+ /* */
+ /* kern_table :: A pointer to the `kern' table. */
+ /* */
+ /* kern_table_size :: The size of the `kern' table. */
+ /* */
+ /* num_kern_tables :: The number of supported kern subtables */
+ /* (up to 32; FreeType recognizes only */
+ /* horizontal ones with format 0). */
+ /* */
+ /* kern_avail_bits :: The availability status of kern subtables; */
+ /* if bit n is set, table n is available. */
+ /* */
+ /* kern_order_bits :: The sortedness status of kern subtables; */
+ /* if bit n is set, table n is sorted. */
+ /* */
+ /* bdf :: Data related to an SFNT font's `bdf' */
+ /* table; see `tttypes.h'. */
+ /* */
+ /* horz_metrics_offset :: The file offset of the `hmtx' table. */
+ /* */
+ /* vert_metrics_offset :: The file offset of the `vmtx' table. */
+ /* */
+ /* sph_found_func_flags :: Flags identifying special bytecode */
+ /* functions (used by the v38 implementation */
+ /* of the bytecode interpreter). */
+ /* */
+ /* sph_compatibility_mode :: */
+ /* This flag is set if we are in ClearType */
+ /* backward compatibility mode (used by the */
+ /* v38 implementation of the bytecode */
+ /* interpreter). */
+ /* */
+ /* ebdt_start :: The file offset of the sbit data table */
+ /* (CBDT, bdat, etc.). */
+ /* */
+ /* ebdt_size :: The size of the sbit data table. */
/* */
typedef struct TT_FaceRec_
{
@@ -1288,6 +1435,16 @@ FT_BEGIN_HEADER
/* handle glyph names <-> unicode & Mac values */
void* psnames;
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* a typeless pointer to the FT_Service_MultiMasters table used to */
+ /* handle variation fonts */
+ void* mm;
+
+ /* a typeless pointer to the FT_Service_MetricsVariationsRec table */
+ /* used to handle the HVAR, VVAR, and MVAR OpenType tables */
+ void* var;
+#endif
+
/***********************************************************************/
/* */
@@ -1311,7 +1468,7 @@ FT_BEGIN_HEADER
/***********************************************************************/
/* */
- /* TrueType-specific fields (ignored by the OTF-Type2 driver) */
+ /* TrueType-specific fields (ignored by the CFF driver) */
/* */
/***********************************************************************/
@@ -1344,18 +1501,25 @@ FT_BEGIN_HEADER
const char* postscript_name;
FT_ULong glyf_len;
+ FT_ULong glyf_offset; /* since 2.7.1 */
+
+ FT_Bool is_cff2; /* since 2.7.1 */
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_Bool doblend;
GX_Blend blend;
+
+ FT_Bool is_default_instance; /* since 2.7.1 */
+ FT_UInt32 variation_support; /* since 2.7.1 */
+
+ const char* var_postscript_prefix; /* since 2.7.2 */
+ FT_UInt var_postscript_prefix_len; /* since 2.7.2 */
+
#endif
/* since version 2.2 */
- FT_Byte* horz_metrics;
FT_ULong horz_metrics_size;
-
- FT_Byte* vert_metrics;
FT_ULong vert_metrics_size;
FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */
@@ -1371,6 +1535,7 @@ FT_BEGIN_HEADER
FT_ULong sbit_table_size;
TT_SbitTableType sbit_table_type;
FT_UInt sbit_num_strikes;
+ FT_UInt* sbit_strike_map;
FT_Byte* kern_table;
FT_ULong kern_table_size;
@@ -1393,6 +1558,12 @@ FT_BEGIN_HEADER
FT_Bool sph_compatibility_mode;
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
+#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+ /* since 2.7 */
+ FT_ULong ebdt_start; /* either `CBDT', `EBDT', or `bdat' */
+ FT_ULong ebdt_size;
+#endif
+
} TT_FaceRec;
@@ -1485,8 +1656,6 @@ FT_BEGIN_HEADER
FT_Vector pp1;
FT_Vector pp2;
- FT_ULong glyf_offset;
-
/* the zone where we load our glyphs */
TT_GlyphZoneRec base;
TT_GlyphZoneRec zone;
diff --git a/thirdparty/freetype/include/freetype/t1tables.h b/thirdparty/freetype/include/freetype/t1tables.h
index e272324ba2..3f6b36e108 100644
--- a/thirdparty/freetype/include/freetype/t1tables.h
+++ b/thirdparty/freetype/include/freetype/t1tables.h
@@ -5,7 +5,7 @@
/* Basic Type 1/Type 2 tables definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -291,7 +291,7 @@ FT_BEGIN_HEADER
} PS_DesignMapRec, *PS_DesignMap;
- /* backwards-compatible definition */
+ /* backward compatible definition */
typedef PS_DesignMapRec T1_DesignMap;
@@ -326,7 +326,7 @@ FT_BEGIN_HEADER
} PS_BlendRec, *PS_Blend;
- /* backwards-compatible definition */
+ /* backward compatible definition */
typedef PS_BlendRec T1_Blend;
diff --git a/thirdparty/freetype/include/freetype/ttnameid.h b/thirdparty/freetype/include/freetype/ttnameid.h
index ce707f1645..494d677186 100644
--- a/thirdparty/freetype/include/freetype/ttnameid.h
+++ b/thirdparty/freetype/include/freetype/ttnameid.h
@@ -4,7 +4,7 @@
/* */
/* TrueType name ID definitions (specification only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -36,7 +36,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* Possible values for the `platform' identifier code in the name */
- /* records of the TTF `name' table. */
+ /* records of an SFNT `name' table. */
/* */
/*************************************************************************/
@@ -119,14 +119,19 @@ FT_BEGIN_HEADER
* TT_APPLE_ID_VARIANT_SELECTOR ::
* From Adobe, not Apple. Not a normal cmap. Specifies variations
* on a real cmap.
+ *
+ * TT_APPLE_ID_FULL_UNICODE ::
+ * Used for fallback fonts that provide complete Unicode coverage with
+ * a type~13 cmap.
*/
-#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */
-#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */
-#define TT_APPLE_ID_ISO_10646 2 /* deprecated */
-#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */
+#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */
+#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */
+#define TT_APPLE_ID_ISO_10646 2 /* deprecated */
+#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */
#define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */
-#define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */
+#define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */
+#define TT_APPLE_ID_FULL_UNICODE 6 /* used with type 13 cmaps */
/***********************************************************************
@@ -137,42 +142,6 @@ FT_BEGIN_HEADER
* @description:
* A list of valid values for the `encoding_id' for
* @TT_PLATFORM_MACINTOSH charmaps and name entries.
- *
- * @values:
- * TT_MAC_ID_ROMAN ::
- * TT_MAC_ID_JAPANESE ::
- * TT_MAC_ID_TRADITIONAL_CHINESE ::
- * TT_MAC_ID_KOREAN ::
- * TT_MAC_ID_ARABIC ::
- * TT_MAC_ID_HEBREW ::
- * TT_MAC_ID_GREEK ::
- * TT_MAC_ID_RUSSIAN ::
- * TT_MAC_ID_RSYMBOL ::
- * TT_MAC_ID_DEVANAGARI ::
- * TT_MAC_ID_GURMUKHI ::
- * TT_MAC_ID_GUJARATI ::
- * TT_MAC_ID_ORIYA ::
- * TT_MAC_ID_BENGALI ::
- * TT_MAC_ID_TAMIL ::
- * TT_MAC_ID_TELUGU ::
- * TT_MAC_ID_KANNADA ::
- * TT_MAC_ID_MALAYALAM ::
- * TT_MAC_ID_SINHALESE ::
- * TT_MAC_ID_BURMESE ::
- * TT_MAC_ID_KHMER ::
- * TT_MAC_ID_THAI ::
- * TT_MAC_ID_LAOTIAN ::
- * TT_MAC_ID_GEORGIAN ::
- * TT_MAC_ID_ARMENIAN ::
- * TT_MAC_ID_MALDIVIAN ::
- * TT_MAC_ID_SIMPLIFIED_CHINESE ::
- * TT_MAC_ID_TIBETAN ::
- * TT_MAC_ID_MONGOLIAN ::
- * TT_MAC_ID_GEEZ ::
- * TT_MAC_ID_SLAVIC ::
- * TT_MAC_ID_VIETNAMESE ::
- * TT_MAC_ID_SINDHI ::
- * TT_MAC_ID_UNINTERP ::
*/
#define TT_MAC_ID_ROMAN 0
@@ -247,44 +216,47 @@ FT_BEGIN_HEADER
*
* @values:
* TT_MS_ID_SYMBOL_CS ::
- * Corresponds to Microsoft symbol encoding. See
- * @FT_ENCODING_MS_SYMBOL.
+ * Microsoft symbol encoding. See @FT_ENCODING_MS_SYMBOL.
*
* TT_MS_ID_UNICODE_CS ::
- * Corresponds to a Microsoft WGL4 charmap, matching Unicode. See
+ * Microsoft WGL4 charmap, matching Unicode. See
* @FT_ENCODING_UNICODE.
*
* TT_MS_ID_SJIS ::
- * Corresponds to SJIS Japanese encoding. See @FT_ENCODING_SJIS.
+ * Shift JIS Japanese encoding. See @FT_ENCODING_SJIS.
*
- * TT_MS_ID_GB2312 ::
- * Corresponds to Simplified Chinese as used in Mainland China. See
- * @FT_ENCODING_GB2312.
+ * TT_MS_ID_PRC ::
+ * Chinese encodings as used in the People's Republic of China (PRC).
+ * This means the encodings GB~2312 and its supersets GBK and
+ * GB~18030. See @FT_ENCODING_PRC.
*
* TT_MS_ID_BIG_5 ::
- * Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.
- * See @FT_ENCODING_BIG5.
+ * Traditional Chinese as used in Taiwan and Hong Kong. See
+ * @FT_ENCODING_BIG5.
*
* TT_MS_ID_WANSUNG ::
- * Corresponds to Korean Wansung encoding. See @FT_ENCODING_WANSUNG.
+ * Korean Extended Wansung encoding. See @FT_ENCODING_WANSUNG.
*
* TT_MS_ID_JOHAB ::
- * Corresponds to Johab encoding. See @FT_ENCODING_JOHAB.
+ * Korean Johab encoding. See @FT_ENCODING_JOHAB.
*
* TT_MS_ID_UCS_4 ::
- * Corresponds to UCS-4 or UTF-32 charmaps. This has been added to
- * the OpenType specification version 1.4 (mid-2001.)
+ * UCS-4 or UTF-32 charmaps. This has been added to the OpenType
+ * specification version 1.4 (mid-2001).
*/
#define TT_MS_ID_SYMBOL_CS 0
#define TT_MS_ID_UNICODE_CS 1
#define TT_MS_ID_SJIS 2
-#define TT_MS_ID_GB2312 3
+#define TT_MS_ID_PRC 3
#define TT_MS_ID_BIG_5 4
#define TT_MS_ID_WANSUNG 5
#define TT_MS_ID_JOHAB 6
#define TT_MS_ID_UCS_4 10
+ /* this value is deprecated */
+#define TT_MS_ID_GB2312 TT_MS_ID_PRC
+
/***********************************************************************
*
@@ -312,17 +284,22 @@ FT_BEGIN_HEADER
#define TT_ADOBE_ID_LATIN_1 3
- /*************************************************************************/
- /* */
- /* Possible values of the language identifier field in the name records */
- /* of the TTF `name' table if the `platform' identifier code is */
- /* TT_PLATFORM_MACINTOSH. These values are also used as return values */
- /* for function @FT_Get_CMap_Language_ID. */
- /* */
- /* The canonical source for the Apple assigned Language ID's is at */
- /* */
- /* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html */
- /* */
+ /***********************************************************************
+ *
+ * @enum:
+ * TT_MAC_LANGID_XXX
+ *
+ * @description:
+ * Possible values of the language identifier field in the name records
+ * of the SFNT `name' table if the `platform' identifier code is
+ * @TT_PLATFORM_MACINTOSH. These values are also used as return values
+ * for function @FT_Get_CMap_Language_ID.
+ *
+ * The canonical source for Apple's IDs is
+ *
+ * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html
+ */
+
#define TT_MAC_LANGID_ENGLISH 0
#define TT_MAC_LANGID_FRENCH 1
#define TT_MAC_LANGID_GERMAN 2
@@ -433,15 +410,6 @@ FT_BEGIN_HEADER
#define TT_MAC_LANGID_JAVANESE 138
#define TT_MAC_LANGID_SUNDANESE 139
-
-#if 0 /* these seem to be errors that have been dropped */
-
-#define TT_MAC_LANGID_SCOTTISH_GAELIC 140
-#define TT_MAC_LANGID_IRISH_GAELIC 141
-
-#endif
-
-
/* The following codes are new as of 2000-03-10 */
#define TT_MAC_LANGID_GALICIAN 140
#define TT_MAC_LANGID_AFRIKAANS 141
@@ -456,18 +424,30 @@ FT_BEGIN_HEADER
#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150
- /*************************************************************************/
- /* */
- /* Possible values of the language identifier field in the name records */
- /* of the TTF `name' table if the `platform' identifier code is */
- /* TT_PLATFORM_MICROSOFT. */
- /* */
- /* The canonical source for the MS assigned LCIDs is */
- /* */
- /* http://www.microsoft.com/globaldev/reference/lcid-all.mspx */
- /* */
+ /***********************************************************************
+ *
+ * @enum:
+ * TT_MS_LANGID_XXX
+ *
+ * @description:
+ * Possible values of the language identifier field in the name records
+ * of the SFNT `name' table if the `platform' identifier code is
+ * @TT_PLATFORM_MICROSOFT. These values are also used as return values
+ * for function @FT_Get_CMap_Language_ID.
+ *
+ * The canonical source for Microsoft's IDs is
+ *
+ * http://www.microsoft.com/globaldev/reference/lcid-all.mspx ,
+ *
+ * however, we only provide macros for language identifiers present in
+ * the OpenType specification: Microsoft has abandoned the concept of
+ * LCIDs (language code identifiers), and format~1 of the `name' table
+ * provides a better mechanism for languages not covered here.
+ *
+ * More legacy values not listed in the reference can be found in the
+ * @FT_TRUETYPE_IDS_H header file.
+ */
-#define TT_MS_LANGID_ARABIC_GENERAL 0x0001
#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401
#define TT_MS_LANGID_ARABIC_IRAQ 0x0801
#define TT_MS_LANGID_ARABIC_EGYPT 0x0C01
@@ -485,39 +465,20 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3C01
#define TT_MS_LANGID_ARABIC_QATAR 0x4001
#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402
-#define TT_MS_LANGID_CATALAN_SPAIN 0x0403
-#define TT_MS_LANGID_CHINESE_GENERAL 0x0004
+#define TT_MS_LANGID_CATALAN_CATALAN 0x0403
#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404
#define TT_MS_LANGID_CHINESE_PRC 0x0804
#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0C04
#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004
-
-#if 1 /* this looks like the correct value */
-#define TT_MS_LANGID_CHINESE_MACAU 0x1404
-#else /* but beware, Microsoft may change its mind...
- the most recent Word reference has the following: */
-#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG
-#endif
-
-#if 0 /* used only with .NET `cultures'; commented out */
-#define TT_MS_LANGID_CHINESE_TRADITIONAL 0x7C04
-#endif
-
+#define TT_MS_LANGID_CHINESE_MACAO 0x1404
#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405
#define TT_MS_LANGID_DANISH_DENMARK 0x0406
#define TT_MS_LANGID_GERMAN_GERMANY 0x0407
#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807
#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0C07
#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007
-#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407
+#define TT_MS_LANGID_GERMAN_LIECHTENSTEIN 0x1407
#define TT_MS_LANGID_GREEK_GREECE 0x0408
-
- /* don't ask what this one means... It is commented out currently. */
-#if 0
-#define TT_MS_LANGID_GREEK_GREECE2 0x2008
-#endif
-
-#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009
#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809
#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0C09
@@ -531,14 +492,12 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2C09
#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009
#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409
-#define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809
-#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3C09
#define TT_MS_LANGID_ENGLISH_INDIA 0x4009
#define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409
#define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809
#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040A
#define TT_MS_LANGID_SPANISH_MEXICO 0x080A
-#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0C0A
+#define TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT 0x0C0A
#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100A
#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140A
#define TT_MS_LANGID_SPANISH_PANAMA 0x180A
@@ -557,9 +516,6 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4C0A
#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500A
#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540A
- /* The following ID blatantly violate MS specs by using a */
- /* sublanguage > 0x1F. */
-#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40AU
#define TT_MS_LANGID_FINNISH_FINLAND 0x040B
#define TT_MS_LANGID_FRENCH_FRANCE 0x040C
#define TT_MS_LANGID_FRENCH_BELGIUM 0x080C
@@ -567,27 +523,13 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100C
#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140C
#define TT_MS_LANGID_FRENCH_MONACO 0x180C
-#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1C0C
-#define TT_MS_LANGID_FRENCH_REUNION 0x200C
-#define TT_MS_LANGID_FRENCH_CONGO 0x240C
- /* which was formerly: */
-#define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO
-#define TT_MS_LANGID_FRENCH_SENEGAL 0x280C
-#define TT_MS_LANGID_FRENCH_CAMEROON 0x2C0C
-#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300C
-#define TT_MS_LANGID_FRENCH_MALI 0x340C
-#define TT_MS_LANGID_FRENCH_MOROCCO 0x380C
-#define TT_MS_LANGID_FRENCH_HAITI 0x3C0C
- /* and another violation of the spec (see 0xE40AU) */
-#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40CU
#define TT_MS_LANGID_HEBREW_ISRAEL 0x040D
#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040E
#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040F
#define TT_MS_LANGID_ITALIAN_ITALY 0x0410
#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810
#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411
-#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412
-#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812
+#define TT_MS_LANGID_KOREAN_KOREA 0x0412
#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413
#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813
#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414
@@ -595,26 +537,17 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_POLISH_POLAND 0x0415
#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416
#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816
-#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417
+#define TT_MS_LANGID_ROMANSH_SWITZERLAND 0x0417
#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418
-#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419
-#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819
#define TT_MS_LANGID_CROATIAN_CROATIA 0x041A
#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081A
#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0C1A
-
-#if 0 /* this used to be this value, but it looks like we were wrong */
-#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101A
-#else /* current sources say */
#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101A
#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141A
- /* and XPsp2 Platform SDK added (2004-07-26) */
- /* Names are shortened to be significant within 40 chars. */
#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181A
-#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181A
-#endif
-
+#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x1C1A
+#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC 0x201A
#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041B
#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041C
#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041D
@@ -622,36 +555,30 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_THAI_THAILAND 0x041E
#define TT_MS_LANGID_TURKISH_TURKEY 0x041F
#define TT_MS_LANGID_URDU_PAKISTAN 0x0420
-#define TT_MS_LANGID_URDU_INDIA 0x0820
#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421
#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422
#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423
-#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424
+#define TT_MS_LANGID_SLOVENIAN_SLOVENIA 0x0424
#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425
#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426
#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427
-#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
#define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428
-#define TT_MS_LANGID_FARSI_IRAN 0x0429
#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042A
#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042B
#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042C
#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082C
-#define TT_MS_LANGID_BASQUE_SPAIN 0x042D
-#define TT_MS_LANGID_SORBIAN_GERMANY 0x042E
+#define TT_MS_LANGID_BASQUE_BASQUE 0x042D
+#define TT_MS_LANGID_UPPER_SORBIAN_GERMANY 0x042E
+#define TT_MS_LANGID_LOWER_SORBIAN_GERMANY 0x082E
#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042F
-#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430
-#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431
-#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432
-#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433
-#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434
-#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435
+#define TT_MS_LANGID_SETSWANA_SOUTH_AFRICA 0x0432
+#define TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA 0x0434
+#define TT_MS_LANGID_ISIZULU_SOUTH_AFRICA 0x0435
#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436
#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437
#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438
#define TT_MS_LANGID_HINDI_INDIA 0x0439
#define TT_MS_LANGID_MALTESE_MALTA 0x043A
- /* Added by XPsp2 Platform SDK (2004-07-26) */
#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043B
#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083B
#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3B
@@ -661,37 +588,21 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3B
#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203B
#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243B
- /* ... and we also keep our old identifier... */
-#define TT_MS_LANGID_SAAMI_LAPONIA 0x043B
-
-#if 0 /* this seems to be a previous inversion */
-#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C
-#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C
-#else
-#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C
-#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C
-#endif
-
-#define TT_MS_LANGID_YIDDISH_GERMANY 0x043D
+#define TT_MS_LANGID_IRISH_IRELAND 0x083C
#define TT_MS_LANGID_MALAY_MALAYSIA 0x043E
#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E
-#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043F
-#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440
- /* alias declared in Windows 2000 */
-#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
- TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN
-
-#define TT_MS_LANGID_SWAHILI_KENYA 0x0441
+#define TT_MS_LANGID_KAZAKH_KAZAKHSTAN 0x043F
+#define TT_MS_LANGID_KYRGYZ_KYRGYZSTAN /* Cyrillic*/ 0x0440
+#define TT_MS_LANGID_KISWAHILI_KENYA 0x0441
#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843
-#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444
+#define TT_MS_LANGID_TATAR_RUSSIA 0x0444
#define TT_MS_LANGID_BENGALI_INDIA 0x0445
#define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845
#define TT_MS_LANGID_PUNJABI_INDIA 0x0446
-#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN 0x0846
#define TT_MS_LANGID_GUJARATI_INDIA 0x0447
-#define TT_MS_LANGID_ORIYA_INDIA 0x0448
+#define TT_MS_LANGID_ODIA_INDIA 0x0448
#define TT_MS_LANGID_TAMIL_INDIA 0x0449
#define TT_MS_LANGID_TELUGU_INDIA 0x044A
#define TT_MS_LANGID_KANNADA_INDIA 0x044B
@@ -700,142 +611,241 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_MARATHI_INDIA 0x044E
#define TT_MS_LANGID_SANSKRIT_INDIA 0x044F
#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450
-#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN 0x0850
-#define TT_MS_LANGID_TIBETAN_CHINA 0x0451
- /* Don't use the next constant! It has */
- /* (1) the wrong spelling (Dzonghka) */
- /* (2) Microsoft doesn't officially define it -- */
- /* at least it is not in the List of Local */
- /* ID Values. */
- /* (3) Dzongkha is not the same language as */
- /* Tibetan, so merging it is wrong anyway. */
- /* */
- /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW. */
-#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851
-
-#if 0
- /* the following used to be defined */
-#define TT_MS_LANGID_TIBETAN_BHUTAN 0x0451
- /* ... but it was changed; */
-#else
- /* So we will continue to #define it, but with the correct value */
-#define TT_MS_LANGID_TIBETAN_BHUTAN TT_MS_LANGID_DZONGHKA_BHUTAN
-#endif
-
-#define TT_MS_LANGID_WELSH_WALES 0x0452
+#define TT_MS_LANGID_MONGOLIAN_PRC 0x0850
+#define TT_MS_LANGID_TIBETAN_PRC 0x0451
+#define TT_MS_LANGID_WELSH_UNITED_KINGDOM 0x0452
#define TT_MS_LANGID_KHMER_CAMBODIA 0x0453
#define TT_MS_LANGID_LAO_LAOS 0x0454
-#define TT_MS_LANGID_BURMESE_MYANMAR 0x0455
-#define TT_MS_LANGID_GALICIAN_SPAIN 0x0456
+#define TT_MS_LANGID_GALICIAN_GALICIAN 0x0456
#define TT_MS_LANGID_KONKANI_INDIA 0x0457
-#define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458
-#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459
-#define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859
- /* Missing a LCID for Sindhi in Devanagari script */
#define TT_MS_LANGID_SYRIAC_SYRIA 0x045A
-#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045B
-#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045C
+#define TT_MS_LANGID_SINHALA_SRI_LANKA 0x045B
#define TT_MS_LANGID_INUKTITUT_CANADA 0x045D
+#define TT_MS_LANGID_INUKTITUT_CANADA_LATIN 0x085D
#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045E
-#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045F
-#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085F
- /* Missing a LCID for Tifinagh script */
-#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460
- /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */
- /* script is yet unclear... might be Arabic, Nagari or Sharada */
-#define TT_MS_LANGID_KASHMIRI_SASIA 0x0860
- /* ... and aliased (by MS) for compatibility reasons. */
-#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA
+#define TT_MS_LANGID_TAMAZIGHT_ALGERIA 0x085F
#define TT_MS_LANGID_NEPALI_NEPAL 0x0461
-#define TT_MS_LANGID_NEPALI_INDIA 0x0861
#define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462
#define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463
#define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464
#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465
- /* alias declared in Windows 2000 */
-#define TT_MS_LANGID_DIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES
-#define TT_MS_LANGID_EDO_NIGERIA 0x0466
-#define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467
#define TT_MS_LANGID_HAUSA_NIGERIA 0x0468
-#define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469
#define TT_MS_LANGID_YORUBA_NIGERIA 0x046A
#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046B
#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086B
#define TT_MS_LANGID_QUECHUA_PERU 0x0C6B
-#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046C
- /* Also spelled by XPsp2 Platform SDK (2004-07-26) */
-#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \
- TT_MS_LANGID_SEPEDI_SOUTH_AFRICA
- /* language codes 0x046D, 0x046E and 0x046F are (still) unknown. */
+#define TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA 0x046C
+#define TT_MS_LANGID_BASHKIR_RUSSIA 0x046D
+#define TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG 0x046E
+#define TT_MS_LANGID_GREENLANDIC_GREENLAND 0x046F
#define TT_MS_LANGID_IGBO_NIGERIA 0x0470
+#define TT_MS_LANGID_YI_PRC 0x0478
+#define TT_MS_LANGID_MAPUDUNGUN_CHILE 0x047A
+#define TT_MS_LANGID_MOHAWK_MOHAWK 0x047C
+#define TT_MS_LANGID_BRETON_FRANCE 0x047E
+#define TT_MS_LANGID_UIGHUR_PRC 0x0480
+#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481
+#define TT_MS_LANGID_OCCITAN_FRANCE 0x0482
+#define TT_MS_LANGID_CORSICAN_FRANCE 0x0483
+#define TT_MS_LANGID_ALSATIAN_FRANCE 0x0484
+#define TT_MS_LANGID_YAKUT_RUSSIA 0x0485
+#define TT_MS_LANGID_KICHE_GUATEMALA 0x0486
+#define TT_MS_LANGID_KINYARWANDA_RWANDA 0x0487
+#define TT_MS_LANGID_WOLOF_SENEGAL 0x0488
+#define TT_MS_LANGID_DARI_AFGHANISTAN 0x048C
+
+ /* */
+
+
+ /* legacy macro definitions not present in OpenType 1.8.1 */
+#define TT_MS_LANGID_ARABIC_GENERAL 0x0001
+#define TT_MS_LANGID_CATALAN_SPAIN \
+ TT_MS_LANGID_CATALAN_CATALAN
+#define TT_MS_LANGID_CHINESE_GENERAL 0x0004
+#define TT_MS_LANGID_CHINESE_MACAU \
+ TT_MS_LANGID_CHINESE_MACAO
+#define TT_MS_LANGID_GERMAN_LIECHTENSTEI \
+ TT_MS_LANGID_GERMAN_LIECHTENSTEIN
+#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009
+#define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809
+#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3C09
+#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT \
+ TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT
+#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40AU
+#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1C0C
+#define TT_MS_LANGID_FRENCH_REUNION 0x200C
+#define TT_MS_LANGID_FRENCH_CONGO 0x240C
+ /* which was formerly: */
+#define TT_MS_LANGID_FRENCH_ZAIRE \
+ TT_MS_LANGID_FRENCH_CONGO
+#define TT_MS_LANGID_FRENCH_SENEGAL 0x280C
+#define TT_MS_LANGID_FRENCH_CAMEROON 0x2C0C
+#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300C
+#define TT_MS_LANGID_FRENCH_MALI 0x340C
+#define TT_MS_LANGID_FRENCH_MOROCCO 0x380C
+#define TT_MS_LANGID_FRENCH_HAITI 0x3C0C
+#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40CU
+#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA \
+ TT_MS_LANGID_KOREAN_KOREA
+#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812
+#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND \
+ TT_MS_LANGID_ROMANSH_SWITZERLAND
+#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
+#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819
+#define TT_MS_LANGID_URDU_INDIA 0x0820
+#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
+#define TT_MS_LANGID_SLOVENE_SLOVENIA \
+ TT_MS_LANGID_SLOVENIAN_SLOVENIA
+#define TT_MS_LANGID_FARSI_IRAN 0x0429
+#define TT_MS_LANGID_BASQUE_SPAIN \
+ TT_MS_LANGID_BASQUE_BASQUE
+#define TT_MS_LANGID_SORBIAN_GERMANY \
+ TT_MS_LANGID_UPPER_SORBIAN_GERMANY
+#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430
+#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431
+#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA \
+ TT_MS_LANGID_SETSWANA_SOUTH_AFRICA
+#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433
+#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA \
+ TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA
+#define TT_MS_LANGID_ZULU_SOUTH_AFRICA \
+ TT_MS_LANGID_ISIZULU_SOUTH_AFRICA
+#define TT_MS_LANGID_SAAMI_LAPONIA 0x043B
+ /* the next two values are incorrectly inverted */
+#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C
+#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C
+#define TT_MS_LANGID_YIDDISH_GERMANY 0x043D
+#define TT_MS_LANGID_KAZAK_KAZAKSTAN \
+ TT_MS_LANGID_KAZAKH_KAZAKHSTAN
+#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
+ TT_MS_LANGID_KYRGYZ_KYRGYZSTAN
+#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN \
+ TT_MS_LANGID_KYRGYZ_KYRGYZSTAN
+#define TT_MS_LANGID_SWAHILI_KENYA \
+ TT_MS_LANGID_KISWAHILI_KENYA
+#define TT_MS_LANGID_TATAR_TATARSTAN \
+ TT_MS_LANGID_TATAR_RUSSIA
+#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN 0x0846
+#define TT_MS_LANGID_ORIYA_INDIA \
+ TT_MS_LANGID_ODIA_INDIA
+#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN \
+ TT_MS_LANGID_MONGOLIAN_PRC
+#define TT_MS_LANGID_TIBETAN_CHINA \
+ TT_MS_LANGID_TIBETAN_PRC
+#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851
+#define TT_MS_LANGID_TIBETAN_BHUTAN \
+ TT_MS_LANGID_DZONGHKA_BHUTAN
+#define TT_MS_LANGID_WELSH_WALES \
+ TT_MS_LANGID_WELSH_UNITED_KINGDOM
+#define TT_MS_LANGID_BURMESE_MYANMAR 0x0455
+#define TT_MS_LANGID_GALICIAN_SPAIN \
+ TT_MS_LANGID_GALICIAN_GALICIAN
+#define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458
+#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459
+#define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859
+#define TT_MS_LANGID_SINHALESE_SRI_LANKA \
+ TT_MS_LANGID_SINHALA_SRI_LANKA
+#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045C
+#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045F
+#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN \
+ TT_MS_LANGID_TAMAZIGHT_ALGERIA
+#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460
+#define TT_MS_LANGID_KASHMIRI_SASIA 0x0860
+#define TT_MS_LANGID_KASHMIRI_INDIA \
+ TT_MS_LANGID_KASHMIRI_SASIA
+#define TT_MS_LANGID_NEPALI_INDIA 0x0861
+#define TT_MS_LANGID_DIVEHI_MALDIVES \
+ TT_MS_LANGID_DHIVEHI_MALDIVES
+#define TT_MS_LANGID_EDO_NIGERIA 0x0466
+#define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467
+#define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469
+#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA \
+ TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA
+#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \
+ TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA
#define TT_MS_LANGID_KANURI_NIGERIA 0x0471
#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472
#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473
#define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873
- /* also spelled in the `Passport SDK' list as: */
-#define TT_MS_LANGID_TIGRIGNA_ERYTREA TT_MS_LANGID_TIGRIGNA_ERYTHREA
+#define TT_MS_LANGID_TIGRIGNA_ERYTREA \
+ TT_MS_LANGID_TIGRIGNA_ERYTHREA
#define TT_MS_LANGID_GUARANI_PARAGUAY 0x0474
#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475
#define TT_MS_LANGID_LATIN 0x0476
#define TT_MS_LANGID_SOMALI_SOMALIA 0x0477
- /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */
- /* not written (but OTOH the peculiar writing system is worth */
- /* studying). */
-#define TT_MS_LANGID_YI_CHINA 0x0478
+#define TT_MS_LANGID_YI_CHINA \
+ TT_MS_LANGID_YI_PRC
#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479
- /* language codes from 0x047A to 0x047F are (still) unknown. */
-#define TT_MS_LANGID_UIGHUR_CHINA 0x0480
-#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481
+#define TT_MS_LANGID_UIGHUR_CHINA \
+ TT_MS_LANGID_UIGHUR_PRC
-#if 0 /* not deemed useful for fonts */
-#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04FF
-#endif
+ /***********************************************************************
+ *
+ * @enum:
+ * TT_NAME_ID_XXX
+ *
+ * @description:
+ * Possible values of the `name' identifier field in the name records of
+ * an SFNT `name' table. These values are platform independent.
+ */
- /*************************************************************************/
- /* */
- /* Possible values of the `name' identifier field in the name records of */
- /* the TTF `name' table. These values are platform independent. */
- /* */
-#define TT_NAME_ID_COPYRIGHT 0
-#define TT_NAME_ID_FONT_FAMILY 1
-#define TT_NAME_ID_FONT_SUBFAMILY 2
-#define TT_NAME_ID_UNIQUE_ID 3
-#define TT_NAME_ID_FULL_NAME 4
-#define TT_NAME_ID_VERSION_STRING 5
-#define TT_NAME_ID_PS_NAME 6
-#define TT_NAME_ID_TRADEMARK 7
+#define TT_NAME_ID_COPYRIGHT 0
+#define TT_NAME_ID_FONT_FAMILY 1
+#define TT_NAME_ID_FONT_SUBFAMILY 2
+#define TT_NAME_ID_UNIQUE_ID 3
+#define TT_NAME_ID_FULL_NAME 4
+#define TT_NAME_ID_VERSION_STRING 5
+#define TT_NAME_ID_PS_NAME 6
+#define TT_NAME_ID_TRADEMARK 7
/* the following values are from the OpenType spec */
-#define TT_NAME_ID_MANUFACTURER 8
-#define TT_NAME_ID_DESIGNER 9
-#define TT_NAME_ID_DESCRIPTION 10
-#define TT_NAME_ID_VENDOR_URL 11
-#define TT_NAME_ID_DESIGNER_URL 12
-#define TT_NAME_ID_LICENSE 13
-#define TT_NAME_ID_LICENSE_URL 14
+#define TT_NAME_ID_MANUFACTURER 8
+#define TT_NAME_ID_DESIGNER 9
+#define TT_NAME_ID_DESCRIPTION 10
+#define TT_NAME_ID_VENDOR_URL 11
+#define TT_NAME_ID_DESIGNER_URL 12
+#define TT_NAME_ID_LICENSE 13
+#define TT_NAME_ID_LICENSE_URL 14
/* number 15 is reserved */
-#define TT_NAME_ID_PREFERRED_FAMILY 16
-#define TT_NAME_ID_PREFERRED_SUBFAMILY 17
-#define TT_NAME_ID_MAC_FULL_NAME 18
+#define TT_NAME_ID_TYPOGRAPHIC_FAMILY 16
+#define TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY 17
+#define TT_NAME_ID_MAC_FULL_NAME 18
/* The following code is new as of 2000-01-21 */
-#define TT_NAME_ID_SAMPLE_TEXT 19
+#define TT_NAME_ID_SAMPLE_TEXT 19
/* This is new in OpenType 1.3 */
-#define TT_NAME_ID_CID_FINDFONT_NAME 20
+#define TT_NAME_ID_CID_FINDFONT_NAME 20
/* This is new in OpenType 1.5 */
-#define TT_NAME_ID_WWS_FAMILY 21
-#define TT_NAME_ID_WWS_SUBFAMILY 22
+#define TT_NAME_ID_WWS_FAMILY 21
+#define TT_NAME_ID_WWS_SUBFAMILY 22
+ /* This is new in OpenType 1.7 */
+#define TT_NAME_ID_LIGHT_BACKGROUND 23
+#define TT_NAME_ID_DARK_BACKGROUND 24
- /*************************************************************************/
- /* */
- /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */
- /* */
- /* Updated 08-Nov-2008. */
- /* */
+ /* This is new in OpenType 1.8 */
+#define TT_NAME_ID_VARIATIONS_PREFIX 25
+
+ /* these two values are deprecated */
+#define TT_NAME_ID_PREFERRED_FAMILY TT_NAME_ID_TYPOGRAPHIC_FAMILY
+#define TT_NAME_ID_PREFERRED_SUBFAMILY TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY
+
+
+ /***********************************************************************
+ *
+ * @enum:
+ * TT_UCR_XXX
+ *
+ * @description:
+ * Possible bit mask values for the `ulUnicodeRangeX' fields in an SFNT
+ * `OS/2' table.
+ */
+
+ /* ulUnicodeRange1 */
+ /* --------------- */
/* Bit 0 Basic Latin */
#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */
@@ -857,7 +867,7 @@ FT_BEGIN_HEADER
/* U+A700-U+A71F */
/* Bit 6 Combining Diacritical Marks */
/* Combining Diacritical Marks Supplement */
-#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */
+#define TT_UCR_COMBINING_DIACRITICAL_MARKS (1L << 6) /* U+0300-U+036F */
/* U+1DC0-U+1DFF */
/* Bit 7 Greek and Coptic */
#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
@@ -925,12 +935,17 @@ FT_BEGIN_HEADER
/* Supplemental Punctuation */
#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
/* U+2E00-U+2E7F */
+
+ /* ulUnicodeRange2 */
+ /* --------------- */
+
/* Bit 32 Superscripts And Subscripts */
#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
/* Bit 33 Currency Symbols */
#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
/* Bit 34 Combining Diacritical Marks For Symbols */
-#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */
+#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
+ (1L << 2) /* U+20D0-U+20FF */
/* Bit 35 Letterlike Symbols */
#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
/* Bit 36 Number Forms */
@@ -996,13 +1011,13 @@ FT_BEGIN_HEADER
/* Bit 57 High Surrogates */
/* High Private Use Surrogates */
/* Low Surrogates */
- /* */
+
/* According to OpenType specs v.1.3+, */
/* setting bit 57 implies that there is */
/* at least one codepoint beyond the */
/* Basic Multilingual Plane that is */
/* supported by this font. So it really */
- /* means >= U+10000 */
+ /* means >= U+10000. */
#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */
/* U+DB80-U+DBFF */
/* U+DC00-U+DFFF */
@@ -1034,7 +1049,11 @@ FT_BEGIN_HEADER
/* Bit 62 Alphabetic Presentation Forms */
#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
/* Bit 63 Arabic Presentation Forms-A */
-#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */
+#define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1L << 31) /* U+FB50-U+FDFF */
+
+ /* ulUnicodeRange3 */
+ /* --------------- */
+
/* Bit 64 Combining Half Marks */
#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
/* Bit 65 Vertical forms */
@@ -1044,7 +1063,7 @@ FT_BEGIN_HEADER
/* Bit 66 Small Form Variants */
#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
/* Bit 67 Arabic Presentation Forms-B */
-#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFE */
+#define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1L << 3) /* U+FE70-U+FEFE */
/* Bit 68 Halfwidth and Fullwidth Forms */
#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
/* Bit 69 Specials */
@@ -1123,6 +1142,10 @@ FT_BEGIN_HEADER
#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */
/* Bit 95 New Tai Lue */
#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */
+
+ /* ulUnicodeRange4 */
+ /* --------------- */
+
/* Bit 96 Buginese */
#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */
/* Bit 97 Glagolitic */
@@ -1191,42 +1214,18 @@ FT_BEGIN_HEADER
/*U+1F000-U+1F02F*/
/* Bit 123-127 Reserved for process-internal usage */
+ /* */
- /*************************************************************************/
- /* */
- /* Some compilers have a very limited length of identifiers. */
- /* */
-#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )
-#define HAVE_LIMIT_ON_IDENTS
-#endif
-
-
-#ifndef HAVE_LIMIT_ON_IDENTS
-
-
- /*************************************************************************/
- /* */
- /* Here some alias #defines in order to be clearer. */
- /* */
- /* These are not always #defined to stay within the 31~character limit, */
- /* which some compilers have. */
- /* */
- /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */
- /* Borland compilers (read: from BC++ 3.1 on) can increase this limit. */
- /* If you get a warning with such a compiler, use the -i40 switch. */
- /* */
-#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \
- TT_UCR_ARABIC_PRESENTATIONS_A
-#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \
- TT_UCR_ARABIC_PRESENTATIONS_B
-
-#define TT_UCR_COMBINING_DIACRITICAL_MARKS \
- TT_UCR_COMBINING_DIACRITICS
-#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
- TT_UCR_COMBINING_DIACRITICS_SYMB
-
+ /* for backward compatibility with older FreeType versions */
+#define TT_UCR_ARABIC_PRESENTATION_A \
+ TT_UCR_ARABIC_PRESENTATION_FORMS_A
+#define TT_UCR_ARABIC_PRESENTATION_B \
+ TT_UCR_ARABIC_PRESENTATION_FORMS_B
-#endif /* !HAVE_LIMIT_ON_IDENTS */
+#define TT_UCR_COMBINING_DIACRITICS \
+ TT_UCR_COMBINING_DIACRITICAL_MARKS
+#define TT_UCR_COMBINING_DIACRITICS_SYMB \
+ TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB
FT_END_HEADER
diff --git a/thirdparty/freetype/include/freetype/tttables.h b/thirdparty/freetype/include/freetype/tttables.h
index 1c075dcf66..58312044ca 100644
--- a/thirdparty/freetype/include/freetype/tttables.h
+++ b/thirdparty/freetype/include/freetype/tttables.h
@@ -5,7 +5,7 @@
/* Basic SFNT/TrueType tables definitions and interface */
/* (specification only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -45,8 +45,9 @@ FT_BEGIN_HEADER
/* TrueType specific table types and functions. */
/* */
/* <Description> */
- /* This section contains the definition of TrueType-specific tables */
- /* as well as some routines used to access and process them. */
+ /* This section contains definitions of some basic tables specific to */
+ /* TrueType and OpenType as well as some routines used to access and */
+ /* process them. */
/* */
/* <Order> */
/* TT_Header */
@@ -76,8 +77,8 @@ FT_BEGIN_HEADER
/* TT_Header */
/* */
/* <Description> */
- /* A structure used to model a TrueType font header table. All */
- /* fields follow the TrueType specification. */
+ /* A structure to model a TrueType font header table. All fields */
+ /* follow the OpenType specification. */
/* */
typedef struct TT_Header_
{
@@ -114,9 +115,9 @@ FT_BEGIN_HEADER
/* TT_HoriHeader */
/* */
/* <Description> */
- /* A structure used to model a TrueType horizontal header, the `hhea' */
+ /* A structure to model a TrueType horizontal header, the `hhea' */
/* table, as well as the corresponding horizontal metrics table, */
- /* i.e., the `hmtx' table. */
+ /* `hmtx'. */
/* */
/* <Fields> */
/* Version :: The table version. */
@@ -131,7 +132,7 @@ FT_BEGIN_HEADER
/* glyphs found in the font (maybe ASCII). */
/* */
/* You should use the `sTypoAscender' field */
- /* of the OS/2 table instead if you want */
+ /* of the `OS/2' table instead if you want */
/* the correct one. */
/* */
/* Descender :: The font's descender, i.e., the distance */
@@ -145,7 +146,7 @@ FT_BEGIN_HEADER
/* glyphs found in the font (maybe ASCII). */
/* */
/* You should use the `sTypoDescender' */
- /* field of the OS/2 table instead if you */
+ /* field of the `OS/2' table instead if you */
/* want the correct one. */
/* */
/* Line_Gap :: The font's line gap, i.e., the distance */
@@ -175,6 +176,8 @@ FT_BEGIN_HEADER
/* caret_Slope_Run :: The run coefficient of the cursor's */
/* slope. */
/* */
+ /* caret_Offset :: The cursor's offset for slanted fonts. */
+ /* */
/* Reserved :: 8~reserved bytes. */
/* */
/* metric_Data_Format :: Always~0. */
@@ -188,13 +191,10 @@ FT_BEGIN_HEADER
/* short_metrics :: A pointer into the `hmtx' table. */
/* */
/* <Note> */
- /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
- /* be identical except for the names of their fields, */
- /* which are different. */
- /* */
- /* This ensures that a single function in the `ttload' */
- /* module is able to read both the horizontal and vertical */
- /* headers. */
+ /* For an OpenType variation font, the values of the following fields */
+ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */
+ /* friends) if the font contains an `MVAR' table: `caret_Slope_Rise', */
+ /* `caret_Slope_Run', and `caret_Offset'. */
/* */
typedef struct TT_HoriHeader_
{
@@ -217,9 +217,9 @@ FT_BEGIN_HEADER
FT_Short metric_Data_Format;
FT_UShort number_Of_HMetrics;
- /* The following fields are not defined by the TrueType specification */
+ /* The following fields are not defined by the OpenType specification */
/* but they are used to connect the metrics header to the relevant */
- /* `HMTX' table. */
+ /* `hmtx' table. */
void* long_metrics;
void* short_metrics;
@@ -234,8 +234,8 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* A structure used to model a TrueType vertical header, the `vhea' */
- /* table, as well as the corresponding vertical metrics table, i.e., */
- /* the `vmtx' table. */
+ /* table, as well as the corresponding vertical metrics table, */
+ /* `vmtx'. */
/* */
/* <Fields> */
/* Version :: The table version. */
@@ -251,8 +251,8 @@ FT_BEGIN_HEADER
/* ASCII). */
/* */
/* You should use the `sTypoAscender' */
- /* field of the OS/2 table instead if you */
- /* want the correct one. */
+ /* field of the `OS/2' table instead if */
+ /* you want the correct one. */
/* */
/* Descender :: The font's descender, i.e., the */
/* distance from the baseline to the */
@@ -266,8 +266,8 @@ FT_BEGIN_HEADER
/* ASCII). */
/* */
/* You should use the `sTypoDescender' */
- /* field of the OS/2 table instead if you */
- /* want the correct one. */
+ /* field of the `OS/2' table instead if */
+ /* you want the correct one. */
/* */
/* Line_Gap :: The font's line gap, i.e., the distance */
/* to add to the ascender and descender to */
@@ -297,30 +297,26 @@ FT_BEGIN_HEADER
/* slope. */
/* */
/* caret_Offset :: The cursor's offset for slanted fonts. */
- /* This value is `reserved' in vmtx */
- /* version 1.0. */
/* */
/* Reserved :: 8~reserved bytes. */
/* */
/* metric_Data_Format :: Always~0. */
/* */
- /* number_Of_HMetrics :: Number of VMetrics entries in the */
+ /* number_Of_VMetrics :: Number of VMetrics entries in the */
/* `vmtx' table -- this value can be */
/* smaller than the total number of glyphs */
/* in the font. */
/* */
- /* long_metrics :: A pointer into the `vmtx' table. */
+ /* long_metrics :: A pointer into the `vmtx' table. */
/* */
- /* short_metrics :: A pointer into the `vmtx' table. */
+ /* short_metrics :: A pointer into the `vmtx' table. */
/* */
/* <Note> */
- /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
- /* be identical except for the names of their fields, */
- /* which are different. */
- /* */
- /* This ensures that a single function in the `ttload' */
- /* module is able to read both the horizontal and vertical */
- /* headers. */
+ /* For an OpenType variation font, the values of the following fields */
+ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */
+ /* friends) if the font contains an `MVAR' table: `Ascender', */
+ /* `Descender', `Line_Gap', `caret_Slope_Rise', `caret_Slope_Run', */
+ /* and `caret_Offset'. */
/* */
typedef struct TT_VertHeader_
{
@@ -331,9 +327,9 @@ FT_BEGIN_HEADER
FT_UShort advance_Height_Max; /* advance height maximum */
- FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */
- FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */
- FT_Short yMax_Extent; /* xmax or ymax extents */
+ FT_Short min_Top_Side_Bearing; /* minimum top-sb */
+ FT_Short min_Bottom_Side_Bearing; /* minimum bottom-sb */
+ FT_Short yMax_Extent; /* ymax extents */
FT_Short caret_Slope_Rise;
FT_Short caret_Slope_Run;
FT_Short caret_Offset;
@@ -343,9 +339,9 @@ FT_BEGIN_HEADER
FT_Short metric_Data_Format;
FT_UShort number_Of_VMetrics;
- /* The following fields are not defined by the TrueType specification */
- /* but they're used to connect the metrics header to the relevant */
- /* `HMTX' or `VMTX' table. */
+ /* The following fields are not defined by the OpenType specification */
+ /* but they are used to connect the metrics header to the relevant */
+ /* `vmtx' table. */
void* long_metrics;
void* short_metrics;
@@ -359,12 +355,28 @@ FT_BEGIN_HEADER
/* TT_OS2 */
/* */
/* <Description> */
- /* A structure used to model a TrueType OS/2 table. All fields */
- /* comply to the OpenType specification. */
+ /* A structure to model a TrueType `OS/2' table. All fields comply */
+ /* to the OpenType specification. */
+ /* */
+ /* Note that we now support old Mac fonts that do not include an */
+ /* `OS/2' table. In this case, the `version' field is always set to */
+ /* 0xFFFF. */
/* */
- /* Note that we now support old Mac fonts that do not include an OS/2 */
- /* table. In this case, the `version' field is always set to 0xFFFF. */
+ /* <Note> */
+ /* For an OpenType variation font, the values of the following fields */
+ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */
+ /* friends) if the font contains an `MVAR' table: `sCapHeight', */
+ /* `sTypoAscender', `sTypoDescender', `sTypoLineGap', `sxHeight', */
+ /* `usWinAscent', `usWinDescent', `yStrikeoutPosition', */
+ /* `yStrikeoutSize', `ySubscriptXOffset', `ySubScriptXSize', */
+ /* `ySubscriptYOffset', `ySubscriptYSize', `ySuperscriptXOffset', */
+ /* `ySuperscriptXSize', `ySuperscriptYOffset', and */
+ /* `ySuperscriptYSize'. */
+ /* */
+ /* Possible values for bits in the `ulUnicodeRangeX' fields are given */
+ /* by the @TT_UCR_XXX macros. */
/* */
+
typedef struct TT_OS2_
{
FT_UShort version; /* 0x0001 - more or 0xFFFF */
@@ -429,10 +441,16 @@ FT_BEGIN_HEADER
/* TT_Postscript */
/* */
/* <Description> */
- /* A structure used to model a TrueType PostScript table. All fields */
- /* comply to the TrueType specification. This structure does not */
- /* reference the PostScript glyph names, which can be nevertheless */
- /* accessed with the `ttpost' module. */
+ /* A structure to model a TrueType `post' table. All fields comply */
+ /* to the OpenType specification. This structure does not reference */
+ /* a font's PostScript glyph names; use @FT_Get_Glyph_Name to */
+ /* retrieve them. */
+ /* */
+ /* <Note> */
+ /* For an OpenType variation font, the values of the following fields */
+ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */
+ /* friends) if the font contains an `MVAR' table: `underlinePosition' */
+ /* and `underlineThickness'. */
/* */
typedef struct TT_Postscript_
{
@@ -446,8 +464,8 @@ FT_BEGIN_HEADER
FT_ULong minMemType1;
FT_ULong maxMemType1;
- /* Glyph names follow in the file, but we don't */
- /* load them by default. See the ttpost.c file. */
+ /* Glyph names follow in the `post' table, but we don't */
+ /* load them by default. */
} TT_Postscript;
@@ -458,8 +476,8 @@ FT_BEGIN_HEADER
/* TT_PCLT */
/* */
/* <Description> */
- /* A structure used to model a TrueType PCLT table. All fields */
- /* comply to the TrueType specification. */
+ /* A structure to model a TrueType `PCLT' table. All fields comply */
+ /* to the OpenType specification. */
/* */
typedef struct TT_PCLT_
{
@@ -488,9 +506,9 @@ FT_BEGIN_HEADER
/* TT_MaxProfile */
/* */
/* <Description> */
- /* The maximum profile is a table containing many max values, which */
- /* can be used to pre-allocate arrays. This ensures that no memory */
- /* allocation occurs during a glyph load. */
+ /* The maximum profile (`maxp') table contains many max values, which */
+ /* can be used to pre-allocate arrays for speeding up glyph loading */
+ /* and hinting. */
/* */
/* <Fields> */
/* version :: The version number. */
@@ -500,21 +518,19 @@ FT_BEGIN_HEADER
/* */
/* maxPoints :: The maximum number of points in a */
/* non-composite TrueType glyph. See also */
- /* the structure element */
/* `maxCompositePoints'. */
/* */
/* maxContours :: The maximum number of contours in a */
/* non-composite TrueType glyph. See also */
- /* the structure element */
/* `maxCompositeContours'. */
/* */
/* maxCompositePoints :: The maximum number of points in a */
- /* composite TrueType glyph. See also the */
- /* structure element `maxPoints'. */
+ /* composite TrueType glyph. See also */
+ /* `maxPoints'. */
/* */
/* maxCompositeContours :: The maximum number of contours in a */
- /* composite TrueType glyph. See also the */
- /* structure element `maxContours'. */
+ /* composite TrueType glyph. See also */
+ /* `maxContours'. */
/* */
/* maxZones :: The maximum number of zones used for */
/* glyph hinting. */
@@ -575,8 +591,9 @@ FT_BEGIN_HEADER
/* FT_Sfnt_Tag */
/* */
/* <Description> */
- /* An enumeration used to specify the index of an SFNT table. */
- /* Used in the @FT_Get_Sfnt_Table API function. */
+ /* An enumeration to specify indices of SFNT tables loaded and parsed */
+ /* by FreeType during initialization of an SFNT font. Used in the */
+ /* @FT_Get_Sfnt_Table API function. */
/* */
/* <Values> */
/* FT_SFNT_HEAD :: To access the font's @TT_Header structure. */
@@ -624,7 +641,7 @@ FT_BEGIN_HEADER
/* FT_Get_Sfnt_Table */
/* */
/* <Description> */
- /* Return a pointer to a given SFNT table within a face. */
+ /* Return a pointer to a given SFNT table stored within a face. */
/* */
/* <Input> */
/* face :: A handle to the source. */
@@ -632,7 +649,7 @@ FT_BEGIN_HEADER
/* tag :: The index of the SFNT table. */
/* */
/* <Return> */
- /* A type-less pointer to the table. This will be~0 in case of */
+ /* A type-less pointer to the table. This will be NULL in case of */
/* error, or if the corresponding table was not found *OR* loaded */
/* from the file. */
/* */
@@ -661,70 +678,70 @@ FT_BEGIN_HEADER
FT_Sfnt_Tag tag );
- /**************************************************************************
- *
- * @function:
- * FT_Load_Sfnt_Table
- *
- * @description:
- * Load any font table into client memory.
- *
- * @input:
- * face ::
- * A handle to the source face.
- *
- * tag ::
- * The four-byte tag of the table to load. Use the value~0 if you want
- * to access the whole font file. Otherwise, you can use one of the
- * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
- * one with @FT_MAKE_TAG.
- *
- * offset ::
- * The starting offset in the table (or file if tag == 0).
- *
- * @output:
- * buffer ::
- * The target buffer address. The client must ensure that the memory
- * array is big enough to hold the data.
- *
- * @inout:
- * length ::
- * If the `length' parameter is NULL, then try to load the whole table.
- * Return an error code if it fails.
- *
- * Else, if `*length' is~0, exit immediately while returning the
- * table's (or file) full size in it.
- *
- * Else the number of bytes to read from the table or file, from the
- * starting offset.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If you need to determine the table's length you should first call this
- * function with `*length' set to~0, as in the following example:
- *
- * {
- * FT_ULong length = 0;
- *
- *
- * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
- * if ( error ) { ... table does not exist ... }
- *
- * buffer = malloc( length );
- * if ( buffer == NULL ) { ... not enough memory ... }
- *
- * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
- * if ( error ) { ... could not load table ... }
- * }
- *
- * Note that structures like @TT_Header or @TT_OS2 can't be used with
- * this function; they are limited to @FT_Get_Sfnt_Table. Reason is that
- * those structures depend on the processor architecture, with varying
- * size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).
- *
- */
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Load_Sfnt_Table
+ *
+ * @description:
+ * Load any SFNT font table into client memory.
+ *
+ * @input:
+ * face ::
+ * A handle to the source face.
+ *
+ * tag ::
+ * The four-byte tag of the table to load. Use value~0 if you want
+ * to access the whole font file. Otherwise, you can use one of the
+ * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
+ * one with @FT_MAKE_TAG.
+ *
+ * offset ::
+ * The starting offset in the table (or file if tag~==~0).
+ *
+ * @output:
+ * buffer ::
+ * The target buffer address. The client must ensure that the memory
+ * array is big enough to hold the data.
+ *
+ * @inout:
+ * length ::
+ * If the `length' parameter is NULL, try to load the whole table.
+ * Return an error code if it fails.
+ *
+ * Else, if `*length' is~0, exit immediately while returning the
+ * table's (or file) full size in it.
+ *
+ * Else the number of bytes to read from the table or file, from the
+ * starting offset.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If you need to determine the table's length you should first call this
+ * function with `*length' set to~0, as in the following example:
+ *
+ * {
+ * FT_ULong length = 0;
+ *
+ *
+ * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
+ * if ( error ) { ... table does not exist ... }
+ *
+ * buffer = malloc( length );
+ * if ( buffer == NULL ) { ... not enough memory ... }
+ *
+ * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
+ * if ( error ) { ... could not load table ... }
+ * }
+ *
+ * Note that structures like @TT_Header or @TT_OS2 can't be used with
+ * this function; they are limited to @FT_Get_Sfnt_Table. Reason is that
+ * those structures depend on the processor architecture, with varying
+ * size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).
+ *
+ */
FT_EXPORT( FT_Error )
FT_Load_Sfnt_Table( FT_Face face,
FT_ULong tag,
@@ -733,41 +750,41 @@ FT_BEGIN_HEADER
FT_ULong* length );
- /**************************************************************************
- *
- * @function:
- * FT_Sfnt_Table_Info
- *
- * @description:
- * Return information on an SFNT table.
- *
- * @input:
- * face ::
- * A handle to the source face.
- *
- * table_index ::
- * The index of an SFNT table. The function returns
- * FT_Err_Table_Missing for an invalid value.
- *
- * @inout:
- * tag ::
- * The name tag of the SFNT table. If the value is NULL, `table_index'
- * is ignored, and `length' returns the number of SFNT tables in the
- * font.
- *
- * @output:
- * length ::
- * The length of the SFNT table (or the number of SFNT tables, depending
- * on `tag').
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * While parsing fonts, FreeType handles SFNT tables with length zero as
- * missing.
- *
- */
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Sfnt_Table_Info
+ *
+ * @description:
+ * Return information on an SFNT table.
+ *
+ * @input:
+ * face ::
+ * A handle to the source face.
+ *
+ * table_index ::
+ * The index of an SFNT table. The function returns
+ * FT_Err_Table_Missing for an invalid value.
+ *
+ * @inout:
+ * tag ::
+ * The name tag of the SFNT table. If the value is NULL, `table_index'
+ * is ignored, and `length' returns the number of SFNT tables in the
+ * font.
+ *
+ * @output:
+ * length ::
+ * The length of the SFNT table (or the number of SFNT tables, depending
+ * on `tag').
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * While parsing fonts, FreeType handles SFNT tables with length zero as
+ * missing.
+ *
+ */
FT_EXPORT( FT_Error )
FT_Sfnt_Table_Info( FT_Face face,
FT_UInt table_index,
@@ -781,16 +798,16 @@ FT_BEGIN_HEADER
/* FT_Get_CMap_Language_ID */
/* */
/* <Description> */
- /* Return TrueType/sfnt specific cmap language ID. Definitions of */
- /* language ID values are in `ttnameid.h'. */
+ /* Return cmap language ID as specified in the OpenType standard. */
+ /* Definitions of language ID values are in file @FT_TRUETYPE_IDS_H. */
/* */
/* <Input> */
/* charmap :: */
/* The target charmap. */
/* */
/* <Return> */
- /* The language ID of `charmap'. If `charmap' doesn't belong to a */
- /* TrueType/sfnt face, just return~0 as the default value. */
+ /* The language ID of `charmap'. If `charmap' doesn't belong to an */
+ /* SFNT face, just return~0 as the default value. */
/* */
/* For a format~14 cmap (to access Unicode IVS), the return value is */
/* 0xFFFFFFFF. */
@@ -805,15 +822,15 @@ FT_BEGIN_HEADER
/* FT_Get_CMap_Format */
/* */
/* <Description> */
- /* Return TrueType/sfnt specific cmap format. */
+ /* Return the format of an SFNT `cmap' table. */
/* */
/* <Input> */
/* charmap :: */
/* The target charmap. */
/* */
/* <Return> */
- /* The format of `charmap'. If `charmap' doesn't belong to a */
- /* TrueType/sfnt face, return -1. */
+ /* The format of `charmap'. If `charmap' doesn't belong to an SFNT */
+ /* face, return -1. */
/* */
FT_EXPORT( FT_Long )
FT_Get_CMap_Format( FT_CharMap charmap );
diff --git a/thirdparty/freetype/include/freetype/tttags.h b/thirdparty/freetype/include/freetype/tttags.h
index f3c9aa5fc7..32eb2fdc26 100644
--- a/thirdparty/freetype/include/freetype/tttags.h
+++ b/thirdparty/freetype/include/freetype/tttags.h
@@ -4,7 +4,7 @@
/* */
/* Tags for TrueType and OpenType tables (specification only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -43,6 +43,7 @@ FT_BEGIN_HEADER
#define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' )
#define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' )
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
+#define TTAG_CFF2 FT_MAKE_TAG( 'C', 'F', 'F', '2' )
#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
@@ -61,6 +62,7 @@ FT_BEGIN_HEADER
#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
+#define TTAG_HVAR FT_MAKE_TAG( 'H', 'V', 'A', 'R' )
#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
@@ -79,6 +81,7 @@ FT_BEGIN_HEADER
#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
+#define TTAG_MVAR FT_MAKE_TAG( 'M', 'V', 'A', 'R' )
#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
@@ -100,6 +103,7 @@ FT_BEGIN_HEADER
#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' )
+#define TTAG_VVAR FT_MAKE_TAG( 'V', 'V', 'A', 'R' )
#define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' )
diff --git a/thirdparty/freetype/include/freetype/ttunpat.h b/thirdparty/freetype/include/freetype/ttunpat.h
index ca4676baf8..f5e417089e 100644
--- a/thirdparty/freetype/include/freetype/ttunpat.h
+++ b/thirdparty/freetype/include/freetype/ttunpat.h
@@ -3,9 +3,9 @@
/* ttunpat.h */
/* */
/* Definitions for the unpatented TrueType hinting system. */
-/* Obsolete, retained for backwards compatibility. */
+/* Obsolete, retained for backward compatibility. */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Written by Graham Asher <graham.asher@btinternet.com> */
diff --git a/thirdparty/freetype/include/ft2build.h b/thirdparty/freetype/include/ft2build.h
index 1e8a9b4994..e7d808f3f4 100644
--- a/thirdparty/freetype/include/ft2build.h
+++ b/thirdparty/freetype/include/ft2build.h
@@ -4,7 +4,7 @@
/* */
/* FreeType 2 build and setup macros. */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -34,7 +34,6 @@
#ifndef FT2BUILD_H_
#define FT2BUILD_H_
-#define FT2_BUILD_LIBRARY
#include <freetype/config/ftheader.h>
#endif /* FT2BUILD_H_ */
diff --git a/thirdparty/freetype/src/autofit/afangles.c b/thirdparty/freetype/src/autofit/afangles.c
index b856e57a8b..ccdae84136 100644
--- a/thirdparty/freetype/src/autofit/afangles.c
+++ b/thirdparty/freetype/src/autofit/afangles.c
@@ -5,7 +5,7 @@
/* Routines used to compute vector angles with limited accuracy */
/* and very high speed. It also contains sorting routines (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afblue.c b/thirdparty/freetype/src/autofit/afblue.c
index 95786ed6f2..a00c3a0765 100644
--- a/thirdparty/freetype/src/autofit/afblue.c
+++ b/thirdparty/freetype/src/autofit/afblue.c
@@ -7,7 +7,7 @@
/* */
/* Auto-fitter data for blue strings (body). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -26,30 +26,76 @@
af_blue_strings[] =
{
/* */
+ '\xF0', '\x9E', '\xA4', '\x8C', ' ', '\xF0', '\x9E', '\xA4', '\x85', ' ', '\xF0', '\x9E', '\xA4', '\x88', ' ', '\xF0', '\x9E', '\xA4', '\x8F', ' ', '\xF0', '\x9E', '\xA4', '\x94', ' ', '\xF0', '\x9E', '\xA4', '\x9A', /* 𞤌 𞤅 𞤈 𞤠𞤔 𞤚 */
+ '\0',
+ '\xF0', '\x9E', '\xA4', '\x82', ' ', '\xF0', '\x9E', '\xA4', '\x96', /* 𞤂 𞤖 */
+ '\0',
+ '\xF0', '\x9E', '\xA4', '\xAC', ' ', '\xF0', '\x9E', '\xA4', '\xAE', ' ', '\xF0', '\x9E', '\xA4', '\xBB', ' ', '\xF0', '\x9E', '\xA4', '\xBC', ' ', '\xF0', '\x9E', '\xA4', '\xBE', /* 𞤬 𞤮 𞤻 𞤼 𞤾 */
+ '\0',
+ '\xF0', '\x9E', '\xA4', '\xA4', ' ', '\xF0', '\x9E', '\xA4', '\xA8', ' ', '\xF0', '\x9E', '\xA4', '\xA9', ' ', '\xF0', '\x9E', '\xA4', '\xAD', ' ', '\xF0', '\x9E', '\xA4', '\xB4', ' ', '\xF0', '\x9E', '\xA4', '\xB8', ' ', '\xF0', '\x9E', '\xA4', '\xBA', ' ', '\xF0', '\x9E', '\xA5', '\x80', /* 𞤤 𞤨 𞤩 𞤭 𞤴 𞤸 𞤺 𞥀 */
+ '\0',
'\xD8', '\xA7', ' ', '\xD8', '\xA5', ' ', '\xD9', '\x84', ' ', '\xD9', '\x83', ' ', '\xD8', '\xB7', ' ', '\xD8', '\xB8', /* ا إ ل ك ط ظ */
'\0',
'\xD8', '\xAA', ' ', '\xD8', '\xAB', ' ', '\xD8', '\xB7', ' ', '\xD8', '\xB8', ' ', '\xD9', '\x83', /* ت ث ط ظ ك */
'\0',
'\xD9', '\x80', /* Ù€ */
'\0',
- '\xD4', '\xB1', ' ', '\xD5', '\x84', ' ', '\xD5', '\x92', ' ', '\xD5', '\x93', ' ', '\xD4', '\xB2', ' ', '\xD4', '\xB3', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x95', /* Ô± Õ„ Õ’ Õ“ Ô² Ô³ Ô´ Õ• */
+ '\xD4', '\xB1', ' ', '\xD5', '\x84', ' ', '\xD5', '\x92', ' ', '\xD5', '\x8D', ' ', '\xD4', '\xB2', ' ', '\xD4', '\xB3', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x95', /* Ô± Õ„ Õ’ Õ Ô² Ô³ Ô´ Õ• */
'\0',
- '\xD5', '\x92', ' ', '\xD5', '\x88', ' ', '\xD5', '\x93', ' ', '\xD5', '\x83', ' ', '\xD5', '\x87', ' ', '\xD5', '\x8D', ' ', '\xD5', '\x8F', ' ', '\xD5', '\x95', /* Õ’ Õˆ Õ“ Õƒ Õ‡ Õ Õ Õ• */
+ '\xD5', '\x92', ' ', '\xD5', '\x88', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x83', ' ', '\xD5', '\x87', ' ', '\xD5', '\x8D', ' ', '\xD5', '\x8F', ' ', '\xD5', '\x95', /* Õ’ Õˆ Ô´ Õƒ Õ‡ Õ Õ Õ• */
'\0',
- '\xD5', '\xA5', ' ', '\xD5', '\xA7', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xB4', ' ', '\xD5', '\xBE', ' ', '\xD6', '\x83', ' ', '\xD6', '\x86', ' ', '\xD6', '\x83', /* Õ¥ Õ§ Õ« Õ´ Õ¾ Öƒ Ö† Öƒ */
+ '\xD5', '\xA5', ' ', '\xD5', '\xA7', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xB4', ' ', '\xD5', '\xBE', ' ', '\xD6', '\x86', ' ', '\xD5', '\xB3', /* Õ¥ Õ§ Õ« Õ´ Õ¾ Ö† Õ³ */
'\0',
- '\xD5', '\xA1', ' ', '\xD5', '\xB5', ' ', '\xD6', '\x82', ' ', '\xD5', '\xBD', ' ', '\xD5', '\xA3', ' ', '\xD5', '\xBB', ' ', '\xD6', '\x80', ' ', '\xD6', '\x85', /* Õ¡ Õµ Ö‚ Õ½ Õ£ Õ» Ö€ Ö… */
+ '\xD5', '\xA1', ' ', '\xD5', '\xB5', ' ', '\xD6', '\x82', ' ', '\xD5', '\xBD', ' ', '\xD5', '\xA3', ' ', '\xD5', '\xB7', ' ', '\xD6', '\x80', ' ', '\xD6', '\x85', /* Õ¡ Õµ Ö‚ Õ½ Õ£ Õ· Ö€ Ö… */
'\0',
'\xD5', '\xB0', ' ', '\xD5', '\xB8', ' ', '\xD5', '\xB3', ' ', '\xD5', '\xA1', ' ', '\xD5', '\xA5', ' ', '\xD5', '\xAE', ' ', '\xD5', '\xBD', ' ', '\xD6', '\x85', /* Õ° Õ¸ Õ³ Õ¡ Õ¥ Õ® Õ½ Ö… */
'\0',
'\xD5', '\xA2', ' ', '\xD5', '\xA8', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xAC', ' ', '\xD5', '\xB2', ' ', '\xD5', '\xBA', ' ', '\xD6', '\x83', ' ', '\xD6', '\x81', /* Õ¢ Õ¨ Õ« Õ¬ Õ² Õº Öƒ Ö */
'\0',
+ '\xF0', '\x90', '\xAC', '\x80', ' ', '\xF0', '\x90', '\xAC', '\x81', ' ', '\xF0', '\x90', '\xAC', '\x90', ' ', '\xF0', '\x90', '\xAC', '\x9B', /* 𬀠ð¬ ð¬ 𬛠*/
+ '\0',
+ '\xF0', '\x90', '\xAC', '\x80', ' ', '\xF0', '\x90', '\xAC', '\x81', /* 𬀠ð¬ */
+ '\0',
+ '\xEA', '\x9A', '\xA7', ' ', '\xEA', '\x9A', '\xA8', ' ', '\xEA', '\x9B', '\x9B', ' ', '\xEA', '\x9B', '\x89', ' ', '\xEA', '\x9B', '\x81', ' ', '\xEA', '\x9B', '\x88', ' ', '\xEA', '\x9B', '\xAB', ' ', '\xEA', '\x9B', '\xAF', /* êš§ ꚨ ê›› ꛉ ê› ê›ˆ ꛫ ꛯ */
+ '\0',
+ '\xEA', '\x9A', '\xAD', ' ', '\xEA', '\x9A', '\xB3', ' ', '\xEA', '\x9A', '\xB6', ' ', '\xEA', '\x9B', '\xAC', ' ', '\xEA', '\x9A', '\xA2', ' ', '\xEA', '\x9A', '\xBD', ' ', '\xEA', '\x9B', '\xAF', ' ', '\xEA', '\x9B', '\xB2', /* ꚭ ꚳ ꚶ ꛬ ꚢ ꚽ ꛯ ꛲ */
+ '\0',
'\xE0', '\xA6', '\x85', ' ', '\xE0', '\xA6', '\xA1', ' ', '\xE0', '\xA6', '\xA4', ' ', '\xE0', '\xA6', '\xA8', ' ', '\xE0', '\xA6', '\xAC', ' ', '\xE0', '\xA6', '\xAD', ' ', '\xE0', '\xA6', '\xB2', ' ', '\xE0', '\xA6', '\x95', /* অ ড ত ন ব ভ ল ক */
'\0',
'\xE0', '\xA6', '\x87', ' ', '\xE0', '\xA6', '\x9F', ' ', '\xE0', '\xA6', '\xA0', ' ', '\xE0', '\xA6', '\xBF', ' ', '\xE0', '\xA7', '\x80', ' ', '\xE0', '\xA7', '\x88', ' ', '\xE0', '\xA7', '\x97', /* ই ট ঠ ি ী ৈ ৗ */
'\0',
'\xE0', '\xA6', '\x93', ' ', '\xE0', '\xA6', '\x8F', ' ', '\xE0', '\xA6', '\xA1', ' ', '\xE0', '\xA6', '\xA4', ' ', '\xE0', '\xA6', '\xA8', ' ', '\xE0', '\xA6', '\xAC', ' ', '\xE0', '\xA6', '\xB2', ' ', '\xE0', '\xA6', '\x95', /* ও ঠড ত ন ব ল ক */
'\0',
+ '\xE1', '\x9D', '\x90', ' ', '\xE1', '\x9D', '\x88', /* á ሠ*/
+ '\0',
+ '\xE1', '\x9D', '\x85', ' ', '\xE1', '\x9D', '\x8A', ' ', '\xE1', '\x9D', '\x8E', /* á… áŠ áŽ */
+ '\0',
+ '\xE1', '\x9D', '\x82', ' ', '\xE1', '\x9D', '\x83', ' ', '\xE1', '\x9D', '\x89', ' ', '\xE1', '\x9D', '\x8C', /* Ⴀრበጠ*/
+ '\0',
+ '\xE1', '\x9D', '\x80', ' ', '\xE1', '\x9D', '\x83', ' ', '\xE1', '\x9D', '\x86', ' ', '\xE1', '\x9D', '\x89', ' ', '\xE1', '\x9D', '\x8B', ' ', '\xE1', '\x9D', '\x8F', ' ', '\xE1', '\x9D', '\x91', /* ဠრᆠበዠá á‘ */
+ '\0',
+ '\xE1', '\x97', '\x9C', ' ', '\xE1', '\x96', '\xB4', ' ', '\xE1', '\x90', '\x81', ' ', '\xE1', '\x92', '\xA3', ' ', '\xE1', '\x91', '\xAB', ' ', '\xE1', '\x91', '\x8E', ' ', '\xE1', '\x94', '\x91', ' ', '\xE1', '\x97', '\xB0', /* á—œ á–´ á á’£ á‘« ᑎ ᔑ á—° */
+ '\0',
+ '\xE1', '\x97', '\xB6', ' ', '\xE1', '\x96', '\xB5', ' ', '\xE1', '\x92', '\xA7', ' ', '\xE1', '\x90', '\x83', ' ', '\xE1', '\x91', '\x8C', ' ', '\xE1', '\x92', '\x8D', ' ', '\xE1', '\x94', '\x91', ' ', '\xE1', '\x97', '\xA2', /* ᗶ ᖵ ᒧ რᑌ ᒠᔑ ᗢ */
+ '\0',
+ '\xE1', '\x93', '\x93', ' ', '\xE1', '\x93', '\x95', ' ', '\xE1', '\x93', '\x80', ' ', '\xE1', '\x93', '\x82', ' ', '\xE1', '\x93', '\x84', ' ', '\xE1', '\x95', '\x84', ' ', '\xE1', '\x95', '\x86', ' ', '\xE1', '\x98', '\xA3', /* ᓓ ᓕ ᓀ ᓂ ᓄ ᕄ ᕆ ᘣ */
+ '\0',
+ '\xE1', '\x95', '\x83', ' ', '\xE1', '\x93', '\x82', ' ', '\xE1', '\x93', '\x80', ' ', '\xE1', '\x95', '\x82', ' ', '\xE1', '\x93', '\x97', ' ', '\xE1', '\x93', '\x9A', ' ', '\xE1', '\x95', '\x86', ' ', '\xE1', '\x98', '\xA3', /* ᕃ ᓂ ᓀ ᕂ ᓗ ᓚ ᕆ ᘣ */
+ '\0',
+ '\xE1', '\x90', '\xAA', ' ', '\xE1', '\x99', '\x86', ' ', '\xE1', '\xA3', '\x98', ' ', '\xE1', '\x90', '\xA2', ' ', '\xE1', '\x92', '\xBE', ' ', '\xE1', '\xA3', '\x97', ' ', '\xE1', '\x94', '\x86', /* ᪠ᙆ ᣘ ᢠᒾ ᣗ ᔆ */
+ '\0',
+ '\xE1', '\x99', '\x86', ' ', '\xE1', '\x97', '\xAE', ' ', '\xE1', '\x92', '\xBB', ' ', '\xE1', '\x90', '\x9E', ' ', '\xE1', '\x94', '\x86', ' ', '\xE1', '\x92', '\xA1', ' ', '\xE1', '\x92', '\xA2', ' ', '\xE1', '\x93', '\x91', /* ᙆ ᗮ ᒻ ហᔆ ᒡ ᒢ ᓑ */
+ '\0',
+ '\xF0', '\x90', '\x8A', '\xA7', ' ', '\xF0', '\x90', '\x8A', '\xAB', ' ', '\xF0', '\x90', '\x8A', '\xAC', ' ', '\xF0', '\x90', '\x8A', '\xAD', ' ', '\xF0', '\x90', '\x8A', '\xB1', ' ', '\xF0', '\x90', '\x8A', '\xBA', ' ', '\xF0', '\x90', '\x8A', '\xBC', ' ', '\xF0', '\x90', '\x8A', '\xBF', /* ðŠ§ ðŠ« ðŠ¬ ðŠ­ ðŠ± ðŠº ðŠ¼ ðŠ¿ */
+ '\0',
+ '\xF0', '\x90', '\x8A', '\xA3', ' ', '\xF0', '\x90', '\x8A', '\xA7', ' ', '\xF0', '\x90', '\x8A', '\xB7', ' ', '\xF0', '\x90', '\x8B', '\x80', ' ', '\xF0', '\x90', '\x8A', '\xAB', ' ', '\xF0', '\x90', '\x8A', '\xB8', ' ', '\xF0', '\x90', '\x8B', '\x89', /* ðŠ£ ðŠ§ ðŠ· ð‹€ ðŠ« ðŠ¸ ð‹‰ */
+ '\0',
+ '\xF0', '\x91', '\x84', '\x83', ' ', '\xF0', '\x91', '\x84', '\x85', ' ', '\xF0', '\x91', '\x84', '\x89', ' ', '\xF0', '\x91', '\x84', '\x99', ' ', '\xF0', '\x91', '\x84', '\x97', /* 𑄃 𑄅 𑄉 𑄙 𑄗 */
+ '\0',
+ '\xF0', '\x91', '\x84', '\x85', ' ', '\xF0', '\x91', '\x84', '\x9B', ' ', '\xF0', '\x91', '\x84', '\x9D', ' ', '\xF0', '\x91', '\x84', '\x97', ' ', '\xF0', '\x91', '\x84', '\x93', /* ð‘„… ð‘„› ð‘„ ð‘„— ð‘„“ */
+ '\0',
+ '\xF0', '\x91', '\x84', '\x96', '\xF0', '\x91', '\x84', '\xB3', '\xF0', '\x91', '\x84', '\xA2', ' ', '\xF0', '\x91', '\x84', '\x98', '\xF0', '\x91', '\x84', '\xB3', '\xF0', '\x91', '\x84', '\xA2', ' ', '\xF0', '\x91', '\x84', '\x99', '\xF0', '\x91', '\x84', '\xB3', '\xF0', '\x91', '\x84', '\xA2', ' ', '\xF0', '\x91', '\x84', '\xA4', '\xF0', '\x91', '\x84', '\xB3', '\xF0', '\x91', '\x84', '\xA2', ' ', '\xF0', '\x91', '\x84', '\xA5', '\xF0', '\x91', '\x84', '\xB3', '\xF0', '\x91', '\x84', '\xA2', /* 𑄖𑄳𑄢 𑄘𑄳𑄢 𑄙𑄳𑄢 𑄤𑄳𑄢 𑄥𑄳𑄢 */
+ '\0',
'\xE1', '\x8F', '\x86', ' ', '\xE1', '\x8E', '\xBB', ' ', '\xE1', '\x8E', '\xAC', ' ', '\xE1', '\x8F', '\x83', ' ', '\xE1', '\x8E', '\xA4', ' ', '\xE1', '\x8F', '\xA3', ' ', '\xE1', '\x8E', '\xA6', ' ', '\xE1', '\x8F', '\x95', /* ᆠᎻ Ꭼ რᎤ ᣠᎦ ᕠ*/
'\0',
'\xEA', '\xAE', '\x92', ' ', '\xEA', '\xAE', '\xA4', ' ', '\xEA', '\xAE', '\xB6', ' ', '\xEA', '\xAD', '\xB4', ' ', '\xEA', '\xAD', '\xBE', ' ', '\xEA', '\xAE', '\x97', ' ', '\xEA', '\xAE', '\x9D', ' ', '\xEA', '\xAE', '\xBF', /* ê®’ ꮤ ê®¶ ê­´ ê­¾ ê®— ê® ê®¿ */
@@ -58,6 +104,20 @@
'\0',
'\xE1', '\x8F', '\xB8', ' ', '\xEA', '\xAE', '\x90', ' ', '\xEA', '\xAD', '\xB9', ' ', '\xEA', '\xAD', '\xBB', /* á¸ ê® ê­¹ ê­» */
'\0',
+ '\xE2', '\xB2', '\x8C', ' ', '\xE2', '\xB2', '\x8E', ' ', '\xE2', '\xB2', '\xA0', ' ', '\xE2', '\xB3', '\x9E', ' ', '\xE2', '\xB2', '\x9E', ' ', '\xE2', '\xB2', '\x90', ' ', '\xE2', '\xB2', '\xA4', ' ', '\xE2', '\xB3', '\x8A', /* Ⲍ Ⲏ Ⲡ Ⳟ Ⲟ ⲠⲤ Ⳋ */
+ '\0',
+ '\xE2', '\xB3', '\x90', ' ', '\xE2', '\xB3', '\x98', ' ', '\xE2', '\xB3', '\x9E', ' ', '\xE2', '\xB2', '\x8E', ' ', '\xE2', '\xB2', '\x9E', ' ', '\xE2', '\xB2', '\x90', ' ', '\xE2', '\xB3', '\x9C', ' ', '\xE2', '\xB2', '\xB0', /* ⳠⳘ Ⳟ Ⲏ Ⲟ ⲠⳜ Ⲱ */
+ '\0',
+ '\xE2', '\xB2', '\x8D', ' ', '\xE2', '\xB2', '\x8F', ' ', '\xE2', '\xB2', '\xA1', ' ', '\xE2', '\xB3', '\x9F', ' ', '\xE2', '\xB2', '\x9F', ' ', '\xE2', '\xB2', '\x91', ' ', '\xE2', '\xB2', '\xA5', ' ', '\xE2', '\xB3', '\x8B', /* ⲠⲠⲡ ⳟ ⲟ ⲑ ⲥ ⳋ */
+ '\0',
+ '\xE2', '\xB3', '\x91', ' ', '\xE2', '\xB3', '\x99', ' ', '\xE2', '\xB3', '\x9F', ' ', '\xE2', '\xB2', '\x8F', ' ', '\xE2', '\xB2', '\x9F', ' ', '\xE2', '\xB2', '\x91', ' ', '\xE2', '\xB3', '\x9D', ' ', '\xE2', '\xB3', '\x92', /* ⳑ ⳙ ⳟ Ⲡⲟ ⲑ ⳠⳒ */
+ '\0',
+ '\xF0', '\x90', '\xA0', '\x8D', ' ', '\xF0', '\x90', '\xA0', '\x99', ' ', '\xF0', '\x90', '\xA0', '\xB3', ' ', '\xF0', '\x90', '\xA0', '\xB1', ' ', '\xF0', '\x90', '\xA0', '\x85', ' ', '\xF0', '\x90', '\xA0', '\x93', ' ', '\xF0', '\x90', '\xA0', '\xA3', ' ', '\xF0', '\x90', '\xA0', '\xA6', /* ð  ð ™ ð ³ ð ± ð … ð “ ð £ ð ¦ */
+ '\0',
+ '\xF0', '\x90', '\xA0', '\x83', ' ', '\xF0', '\x90', '\xA0', '\x8A', ' ', '\xF0', '\x90', '\xA0', '\x9B', ' ', '\xF0', '\x90', '\xA0', '\xA3', ' ', '\xF0', '\x90', '\xA0', '\xB3', ' ', '\xF0', '\x90', '\xA0', '\xB5', ' ', '\xF0', '\x90', '\xA0', '\x90', /* ð ƒ ð Š ð › ð £ ð ³ ð µ ð  */
+ '\0',
+ '\xF0', '\x90', '\xA0', '\x88', ' ', '\xF0', '\x90', '\xA0', '\x8F', ' ', '\xF0', '\x90', '\xA0', '\x96', /* ð ˆ ð  ð – */
+ '\0',
'\xD0', '\x91', ' ', '\xD0', '\x92', ' ', '\xD0', '\x95', ' ', '\xD0', '\x9F', ' ', '\xD0', '\x97', ' ', '\xD0', '\x9E', ' ', '\xD0', '\xA1', ' ', '\xD0', '\xAD', /* Б В Е П З О С Э */
'\0',
'\xD0', '\x91', ' ', '\xD0', '\x92', ' ', '\xD0', '\x95', ' ', '\xD0', '\xA8', ' ', '\xD0', '\x97', ' ', '\xD0', '\x9E', ' ', '\xD0', '\xA1', ' ', '\xD0', '\xAD', /* Б В Е Ш З О С Э */
@@ -66,6 +126,14 @@
'\0',
'\xD1', '\x80', ' ', '\xD1', '\x83', ' ', '\xD1', '\x84', /* р у ф */
'\0',
+ '\xF0', '\x90', '\x90', '\x82', ' ', '\xF0', '\x90', '\x90', '\x84', ' ', '\xF0', '\x90', '\x90', '\x8B', ' ', '\xF0', '\x90', '\x90', '\x97', ' ', '\xF0', '\x90', '\x90', '\x91', /* ð‚ ð„ ð‹ ð— ð‘ */
+ '\0',
+ '\xF0', '\x90', '\x90', '\x80', ' ', '\xF0', '\x90', '\x90', '\x82', ' ', '\xF0', '\x90', '\x90', '\x84', ' ', '\xF0', '\x90', '\x90', '\x97', ' ', '\xF0', '\x90', '\x90', '\x9B', /* ð€ ð‚ ð„ ð— ð› */
+ '\0',
+ '\xF0', '\x90', '\x90', '\xAA', ' ', '\xF0', '\x90', '\x90', '\xAC', ' ', '\xF0', '\x90', '\x90', '\xB3', ' ', '\xF0', '\x90', '\x90', '\xBF', ' ', '\xF0', '\x90', '\x90', '\xB9', /* ðª ð¬ ð³ ð¿ ð¹ */
+ '\0',
+ '\xF0', '\x90', '\x90', '\xA8', ' ', '\xF0', '\x90', '\x90', '\xAA', ' ', '\xF0', '\x90', '\x90', '\xAC', ' ', '\xF0', '\x90', '\x90', '\xBF', ' ', '\xF0', '\x90', '\x91', '\x83', /* ð¨ ðª ð¬ ð¿ 𑃠*/
+ '\0',
'\xE0', '\xA4', '\x95', ' ', '\xE0', '\xA4', '\xAE', ' ', '\xE0', '\xA4', '\x85', ' ', '\xE0', '\xA4', '\x86', ' ', '\xE0', '\xA4', '\xA5', ' ', '\xE0', '\xA4', '\xA7', ' ', '\xE0', '\xA4', '\xAD', ' ', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */
'\0',
'\xE0', '\xA4', '\x88', ' ', '\xE0', '\xA4', '\x90', ' ', '\xE0', '\xA4', '\x93', ' ', '\xE0', '\xA4', '\x94', ' ', '\xE0', '\xA4', '\xBF', ' ', '\xE0', '\xA5', '\x80', ' ', '\xE0', '\xA5', '\x8B', ' ', '\xE0', '\xA5', '\x8C', /* ई ठओ औ ि ी ो ौ */
@@ -98,6 +166,18 @@
'\0',
'\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x98', ' ', '\xE2', '\xB4', '\x9D', /* â´„ â´… â´” â´• â´ â´‚ â´˜ â´ */
'\0',
+ '\xE2', '\xB0', '\x85', ' ', '\xE2', '\xB0', '\x94', ' ', '\xE2', '\xB0', '\xAA', ' ', '\xE2', '\xB0', '\x84', ' ', '\xE2', '\xB0', '\x82', ' ', '\xE2', '\xB0', '\x8A', ' ', '\xE2', '\xB0', '\xAB', ' ', '\xE2', '\xB0', '\x8B', /* â°… â°” â°ª â°„ â°‚ â°Š â°« â°‹ */
+ '\0',
+ '\xE2', '\xB0', '\x85', ' ', '\xE2', '\xB0', '\x84', ' ', '\xE2', '\xB0', '\x82', ' ', '\xE2', '\xB0', '\xAA', ' ', '\xE2', '\xB0', '\x9E', ' ', '\xE2', '\xB0', '\xA1', ' ', '\xE2', '\xB0', '\x8A', ' ', '\xE2', '\xB0', '\x94', /* â°… â°„ â°‚ â°ª â°ž â°¡ â°Š â°” */
+ '\0',
+ '\xE2', '\xB0', '\xB5', ' ', '\xE2', '\xB1', '\x84', ' ', '\xE2', '\xB1', '\x9A', ' ', '\xE2', '\xB0', '\xB4', ' ', '\xE2', '\xB0', '\xB2', ' ', '\xE2', '\xB0', '\xBA', ' ', '\xE2', '\xB1', '\x9B', ' ', '\xE2', '\xB0', '\xBB', /* ⰵ ⱄ ⱚ ⰴ ⰲ ⰺ ⱛ ⰻ */
+ '\0',
+ '\xE2', '\xB0', '\xB5', ' ', '\xE2', '\xB0', '\xB4', ' ', '\xE2', '\xB0', '\xB2', ' ', '\xE2', '\xB1', '\x9A', ' ', '\xE2', '\xB1', '\x8E', ' ', '\xE2', '\xB1', '\x91', ' ', '\xE2', '\xB0', '\xBA', ' ', '\xE2', '\xB1', '\x84', /* ⰵ ⰴ ⰲ ⱚ ⱎ ⱑ ⰺ ⱄ */
+ '\0',
+ '\xF0', '\x90', '\x8C', '\xB2', ' ', '\xF0', '\x90', '\x8C', '\xB6', ' ', '\xF0', '\x90', '\x8D', '\x80', ' ', '\xF0', '\x90', '\x8D', '\x84', ' ', '\xF0', '\x90', '\x8C', '\xB4', ' ', '\xF0', '\x90', '\x8D', '\x83', ' ', '\xF0', '\x90', '\x8D', '\x88', ' ', '\xF0', '\x90', '\x8C', '\xBE', /* ðŒ² ðŒ¶ ð€ ð„ ðŒ´ ðƒ ðˆ ðŒ¾ */
+ '\0',
+ '\xF0', '\x90', '\x8C', '\xB6', ' ', '\xF0', '\x90', '\x8C', '\xB4', ' ', '\xF0', '\x90', '\x8D', '\x83', ' ', '\xF0', '\x90', '\x8D', '\x88', /* ðŒ¶ ðŒ´ ðƒ ðˆ */
+ '\0',
'\xCE', '\x93', ' ', '\xCE', '\x92', ' ', '\xCE', '\x95', ' ', '\xCE', '\x96', ' ', '\xCE', '\x98', ' ', '\xCE', '\x9F', ' ', '\xCE', '\xA9', /* Γ Β Ε Ζ Θ Ο Ω */
'\0',
'\xCE', '\x92', ' ', '\xCE', '\x94', ' ', '\xCE', '\x96', ' ', '\xCE', '\x9E', ' ', '\xCE', '\x98', ' ', '\xCE', '\x9F', /* Β Δ Ζ Ξ Θ Ο */
@@ -138,6 +218,16 @@
'\0',
'\xE0', '\xB2', '\x85', ' ', '\xE0', '\xB2', '\x89', ' ', '\xE0', '\xB2', '\x8E', ' ', '\xE0', '\xB2', '\xB2', ' ', '\xE0', '\xB3', '\xA6', ' ', '\xE0', '\xB3', '\xA8', ' ', '\xE0', '\xB3', '\xAC', ' ', '\xE0', '\xB3', '\xAD', /* ಅ ಉ ಎ ಲ ೦ ೨ ೬ ೭ */
'\0',
+ '\xEA', '\xA4', '\x85', ' ', '\xEA', '\xA4', '\x8F', ' ', '\xEA', '\xA4', '\x81', ' ', '\xEA', '\xA4', '\x8B', ' ', '\xEA', '\xA4', '\x80', ' ', '\xEA', '\xA4', '\x8D', /* ꤅ ê¤ ê¤ ê¤‹ ꤀ ê¤ */
+ '\0',
+ '\xEA', '\xA4', '\x88', ' ', '\xEA', '\xA4', '\x98', ' ', '\xEA', '\xA4', '\x80', ' ', '\xEA', '\xA4', '\x8D', ' ', '\xEA', '\xA4', '\xA2', /* ꤈ ꤘ ꤀ ê¤ ê¤¢ */
+ '\0',
+ '\xEA', '\xA4', '\x96', ' ', '\xEA', '\xA4', '\xA1', /* ꤖ ꤡ */
+ '\0',
+ '\xEA', '\xA4', '\x91', ' ', '\xEA', '\xA4', '\x9C', ' ', '\xEA', '\xA4', '\x9E', /* ꤑ ꤜ ꤞ */
+ '\0',
+ '\xEA', '\xA4', '\x91', '\xEA', '\xA4', '\xAC', ' ', '\xEA', '\xA4', '\x9C', '\xEA', '\xA4', '\xAD', ' ', '\xEA', '\xA4', '\x94', '\xEA', '\xA4', '\xAC', /* ꤑ꤬ ꤜ꤭ ꤔ꤬ */
+ '\0',
'\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x91', ' ', '\xE1', '\x9E', '\x93', ' ', '\xE1', '\x9E', '\xA7', ' ', '\xE1', '\x9E', '\xA9', ' ', '\xE1', '\x9E', '\xB6', /* áž áž‘ áž“ áž§ áž© áž¶ */
'\0',
'\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x80', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x82', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x90', /* ក្ក ក្ហក្គ ក្ហ*/
@@ -168,7 +258,9 @@
'\0',
'f', ' ', 'i', ' ', 'j', ' ', 'k', ' ', 'd', ' ', 'b', ' ', 'h', /* f i j k d b h */
'\0',
- 'x', ' ', 'z', ' ', 'r', ' ', 'o', ' ', 'e', ' ', 's', ' ', 'c', /* x z r o e s c */
+ 'u', ' ', 'v', ' ', 'x', ' ', 'z', ' ', 'o', ' ', 'e', ' ', 's', ' ', 'c', /* u v x z o e s c */
+ '\0',
+ 'n', ' ', 'r', ' ', 'x', ' ', 'z', ' ', 'o', ' ', 'e', ' ', 's', ' ', 'c', /* n r x z o e s c */
'\0',
'p', ' ', 'q', ' ', 'g', ' ', 'j', ' ', 'y', /* p q g j y */
'\0',
@@ -192,6 +284,10 @@
'\0',
'\xE1', '\xB5', '\x96', ' ', '\xCA', '\xB8', ' ', '\xE1', '\xB5', '\x8D', /* ᵖ ʸ ᵠ*/
'\0',
+ '\xEA', '\x93', '\xA1', ' ', '\xEA', '\x93', '\xA7', ' ', '\xEA', '\x93', '\xB1', ' ', '\xEA', '\x93', '\xB6', ' ', '\xEA', '\x93', '\xA9', ' ', '\xEA', '\x93', '\x9A', ' ', '\xEA', '\x93', '\xB5', ' ', '\xEA', '\x93', '\xB3', /* ꓡ ꓧ ꓱ ꓶ ꓩ ꓚ ꓵ ꓳ */
+ '\0',
+ '\xEA', '\x93', '\x95', ' ', '\xEA', '\x93', '\x9C', ' ', '\xEA', '\x93', '\x9E', ' ', '\xEA', '\x93', '\xA1', ' ', '\xEA', '\x93', '\x9B', ' ', '\xEA', '\x93', '\xA2', ' ', '\xEA', '\x93', '\xB3', ' ', '\xEA', '\x93', '\xB4', /* ꓕ ꓜ ꓞ ꓡ ꓛ ꓢ ꓳ ꓴ */
+ '\0',
'\xE0', '\xB4', '\x92', ' ', '\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xB1', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', ' ', '\xE0', '\xB4', '\x9A', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\xAA', /* à´’ à´Ÿ à´  à´± à´š à´ª à´šàµà´š à´ªàµà´ª */
'\0',
'\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xA7', ' ', '\xE0', '\xB4', '\xB6', ' ', '\xE0', '\xB4', '\x98', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xA5', ' ', '\xE0', '\xB4', '\xB2', /* à´Ÿ à´  à´§ à´¶ à´˜ à´š à´¥ à´² */
@@ -204,12 +300,68 @@
'\0',
'\xE1', '\x80', '\x89', ' ', '\xE1', '\x80', '\x8A', ' ', '\xE1', '\x80', '\xA5', ' ', '\xE1', '\x80', '\xA9', ' ', '\xE1', '\x80', '\xA8', ' ', '\xE1', '\x81', '\x82', ' ', '\xE1', '\x81', '\x85', ' ', '\xE1', '\x81', '\x89', /* ဉ ည ဥ ဩ ဨ á‚ á… á‰ */
'\0',
+ '\xDF', '\x90', ' ', '\xDF', '\x89', ' ', '\xDF', '\x92', ' ', '\xDF', '\x9F', ' ', '\xDF', '\x96', ' ', '\xDF', '\x9C', ' ', '\xDF', '\xA0', ' ', '\xDF', '\xA5', /* ß ß‰ ß’ ߟ ß– ßœ ß  ߥ */
+ '\0',
+ '\xDF', '\x80', ' ', '\xDF', '\x98', ' ', '\xDF', '\xA1', ' ', '\xDF', '\xA0', ' ', '\xDF', '\xA5', /* ߀ ߘ ߡ ߠ ߥ */
+ '\0',
+ '\xDF', '\x8F', ' ', '\xDF', '\x9B', ' ', '\xDF', '\x8B', /* ß ß› ß‹ */
+ '\0',
+ '\xDF', '\x8E', ' ', '\xDF', '\x8F', ' ', '\xDF', '\x9B', ' ', '\xDF', '\x8B', /* ߎ ß ß› ß‹ */
+ '\0',
+ '\xE1', '\xB1', '\x9B', ' ', '\xE1', '\xB1', '\x9C', ' ', '\xE1', '\xB1', '\x9D', ' ', '\xE1', '\xB1', '\xA1', ' ', '\xE1', '\xB1', '\xA2', ' ', '\xE1', '\xB1', '\xA5', /* ᱛ ᱜ ᱠᱡ ᱢ ᱥ */
+ '\0',
+ '\xF0', '\x90', '\xB0', '\x97', ' ', '\xF0', '\x90', '\xB0', '\x98', ' ', '\xF0', '\x90', '\xB0', '\xA7', /* ð°— ð°˜ ð°§ */
+ '\0',
+ '\xF0', '\x90', '\xB0', '\x89', ' ', '\xF0', '\x90', '\xB0', '\x97', ' ', '\xF0', '\x90', '\xB0', '\xA6', ' ', '\xF0', '\x90', '\xB0', '\xA7', /* ð°‰ ð°— ð°¦ ð°§ */
+ '\0',
+ '\xF0', '\x90', '\x92', '\xBE', ' ', '\xF0', '\x90', '\x93', '\x8D', ' ', '\xF0', '\x90', '\x93', '\x92', ' ', '\xF0', '\x90', '\x93', '\x93', ' ', '\xF0', '\x90', '\x92', '\xBB', ' ', '\xF0', '\x90', '\x93', '\x82', ' ', '\xF0', '\x90', '\x92', '\xB5', ' ', '\xF0', '\x90', '\x93', '\x86', /* ð’¾ ð“ 𓒠𓓠𒻠𓂠𒵠𓆠*/
+ '\0',
+ '\xF0', '\x90', '\x92', '\xB0', ' ', '\xF0', '\x90', '\x93', '\x8D', ' ', '\xF0', '\x90', '\x93', '\x82', ' ', '\xF0', '\x90', '\x92', '\xBF', ' ', '\xF0', '\x90', '\x93', '\x8E', ' ', '\xF0', '\x90', '\x92', '\xB9', /* ð’° ð“ 𓂠𒿠𓎠𒹠*/
+ '\0',
+ '\xF0', '\x90', '\x92', '\xBC', ' ', '\xF0', '\x90', '\x92', '\xBD', ' ', '\xF0', '\x90', '\x92', '\xBE', /* ð’¼ ð’½ ð’¾ */
+ '\0',
+ '\xF0', '\x90', '\x93', '\xB5', ' ', '\xF0', '\x90', '\x93', '\xB6', ' ', '\xF0', '\x90', '\x93', '\xBA', ' ', '\xF0', '\x90', '\x93', '\xBB', ' ', '\xF0', '\x90', '\x93', '\x9D', ' ', '\xF0', '\x90', '\x93', '\xA3', ' ', '\xF0', '\x90', '\x93', '\xAA', ' ', '\xF0', '\x90', '\x93', '\xAE', /* 𓵠𓶠𓺠𓻠ð“ 𓣠𓪠𓮠*/
+ '\0',
+ '\xF0', '\x90', '\x93', '\x98', ' ', '\xF0', '\x90', '\x93', '\x9A', ' ', '\xF0', '\x90', '\x93', '\xA3', ' ', '\xF0', '\x90', '\x93', '\xB5', ' ', '\xF0', '\x90', '\x93', '\xA1', ' ', '\xF0', '\x90', '\x93', '\xA7', ' ', '\xF0', '\x90', '\x93', '\xAA', ' ', '\xF0', '\x90', '\x93', '\xB6', /* 𓘠𓚠𓣠𓵠𓡠𓧠𓪠𓶠*/
+ '\0',
+ '\xF0', '\x90', '\x93', '\xA4', ' ', '\xF0', '\x90', '\x93', '\xA6', ' ', '\xF0', '\x90', '\x93', '\xB8', ' ', '\xF0', '\x90', '\x93', '\xB9', ' ', '\xF0', '\x90', '\x93', '\x9B', /* 𓤠𓦠𓸠𓹠𓛠*/
+ '\0',
+ '\xF0', '\x90', '\x93', '\xA4', ' ', '\xF0', '\x90', '\x93', '\xA5', ' ', '\xF0', '\x90', '\x93', '\xA6', /* 𓤠𓥠𓦠*/
+ '\0',
+ '\xF0', '\x90', '\x92', '\x86', ' ', '\xF0', '\x90', '\x92', '\x89', ' ', '\xF0', '\x90', '\x92', '\x90', ' ', '\xF0', '\x90', '\x92', '\x92', ' ', '\xF0', '\x90', '\x92', '\x98', ' ', '\xF0', '\x90', '\x92', '\x9B', ' ', '\xF0', '\x90', '\x92', '\xA0', ' ', '\xF0', '\x90', '\x92', '\xA3', /* ð’† ð’‰ ð’ ð’’ ð’˜ ð’› ð’  ð’£ */
+ '\0',
+ '\xF0', '\x90', '\x92', '\x80', ' ', '\xF0', '\x90', '\x92', '\x82', ' ', '\xF0', '\x90', '\x92', '\x86', ' ', '\xF0', '\x90', '\x92', '\x88', ' ', '\xF0', '\x90', '\x92', '\x8A', ' ', '\xF0', '\x90', '\x92', '\x92', ' ', '\xF0', '\x90', '\x92', '\xA0', ' ', '\xF0', '\x90', '\x92', '\xA9', /* ð’€ ð’‚ ð’† ð’ˆ ð’Š ð’’ ð’  ð’© */
+ '\0',
+ '\xEA', '\xA2', '\x9C', ' ', '\xEA', '\xA2', '\x9E', ' ', '\xEA', '\xA2', '\xB3', ' ', '\xEA', '\xA2', '\x82', ' ', '\xEA', '\xA2', '\x96', ' ', '\xEA', '\xA2', '\x92', ' ', '\xEA', '\xA2', '\x9D', ' ', '\xEA', '\xA2', '\x9B', /* ꢜ ꢞ ꢳ ꢂ ꢖ ꢒ ê¢ ê¢› */
+ '\0',
+ '\xEA', '\xA2', '\x82', ' ', '\xEA', '\xA2', '\xA8', ' ', '\xEA', '\xA2', '\xBA', ' ', '\xEA', '\xA2', '\xA4', ' ', '\xEA', '\xA2', '\x8E', /* ꢂ ꢨ ꢺ ꢤ ꢎ */
+ '\0',
+ '\xF0', '\x90', '\x91', '\x95', ' ', '\xF0', '\x90', '\x91', '\x99', /* ð‘• ð‘™ */
+ '\0',
+ '\xF0', '\x90', '\x91', '\x94', ' ', '\xF0', '\x90', '\x91', '\x96', ' ', '\xF0', '\x90', '\x91', '\x97', ' ', '\xF0', '\x90', '\x91', '\xB9', ' ', '\xF0', '\x90', '\x91', '\xBB', /* 𑔠𑖠𑗠𑹠𑻠*/
+ '\0',
+ '\xF0', '\x90', '\x91', '\x9F', ' ', '\xF0', '\x90', '\x91', '\xA3', /* 𑟠𑣠*/
+ '\0',
+ '\xF0', '\x90', '\x91', '\xB1', ' ', '\xF0', '\x90', '\x91', '\xB2', ' ', '\xF0', '\x90', '\x91', '\xB3', ' ', '\xF0', '\x90', '\x91', '\xB4', ' ', '\xF0', '\x90', '\x91', '\xB8', ' ', '\xF0', '\x90', '\x91', '\xBA', ' ', '\xF0', '\x90', '\x91', '\xBC', /* 𑱠𑲠𑳠𑴠𑸠𑺠𑼠*/
+ '\0',
+ '\xF0', '\x90', '\x91', '\xB4', ' ', '\xF0', '\x90', '\x91', '\xBB', ' ', '\xF0', '\x90', '\x91', '\xB9', /* 𑴠𑻠𑹠*/
+ '\0',
'\xE0', '\xB6', '\x89', ' ', '\xE0', '\xB6', '\x9A', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xB3', ' ', '\xE0', '\xB6', '\xB4', ' ', '\xE0', '\xB6', '\xBA', ' ', '\xE0', '\xB6', '\xBD', ' ', '\xE0', '\xB7', '\x86', /* ඉ ක චඳ ප ය ල ෆ */
'\0',
'\xE0', '\xB6', '\x91', ' ', '\xE0', '\xB6', '\x94', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xA2', ' ', '\xE0', '\xB6', '\xA7', ' ', '\xE0', '\xB6', '\xAE', ' ', '\xE0', '\xB6', '\xB0', ' ', '\xE0', '\xB6', '\xBB', /* à¶‘ à¶” à¶ à¶¢ à¶§ à¶® à¶° à¶» */
'\0',
'\xE0', '\xB6', '\xAF', ' ', '\xE0', '\xB6', '\xB3', ' ', '\xE0', '\xB6', '\x8B', ' ', '\xE0', '\xB6', '\xBD', ' ', '\xE0', '\xB6', '\xAD', '\xE0', '\xB7', '\x96', ' ', '\xE0', '\xB6', '\xAD', '\xE0', '\xB7', '\x94', ' ', '\xE0', '\xB6', '\xB6', '\xE0', '\xB7', '\x94', ' ', '\xE0', '\xB6', '\xAF', '\xE0', '\xB7', '\x94', /* ද ඳ උ ල තූ තු බු දු */
'\0',
+ '\xE1', '\xAE', '\x8B', ' ', '\xE1', '\xAE', '\x9E', ' ', '\xE1', '\xAE', '\xAE', ' ', '\xE1', '\xAE', '\xBD', ' ', '\xE1', '\xAE', '\xB0', ' ', '\xE1', '\xAE', '\x88', /* ᮋ ᮞ ᮮ ᮽ ᮰ ᮈ */
+ '\0',
+ '\xE1', '\xAE', '\x84', ' ', '\xE1', '\xAE', '\x94', ' ', '\xE1', '\xAE', '\x95', ' ', '\xE1', '\xAE', '\x97', ' ', '\xE1', '\xAE', '\xB0', ' ', '\xE1', '\xAE', '\x86', ' ', '\xE1', '\xAE', '\x88', ' ', '\xE1', '\xAE', '\x89', /* ᮄ ᮔ ᮕ ᮗ ᮰ ᮆ ᮈ ᮉ */
+ '\0',
+ '\xE1', '\xAE', '\xBC', ' ', '\xE1', '\xB3', '\x84', /* ᮼ ᳄ */
+ '\0',
+ '\xEA', '\xAA', '\x86', ' ', '\xEA', '\xAA', '\x94', ' ', '\xEA', '\xAA', '\x92', ' ', '\xEA', '\xAA', '\x96', ' ', '\xEA', '\xAA', '\xAB', /* ꪆ ꪔ ꪒ ꪖ ꪫ */
+ '\0',
+ '\xEA', '\xAA', '\x89', ' ', '\xEA', '\xAA', '\xAB', ' ', '\xEA', '\xAA', '\xAE', /* ꪉ ꪫ ꪮ */
+ '\0',
'\xE0', '\xAE', '\x89', ' ', '\xE0', '\xAE', '\x92', ' ', '\xE0', '\xAE', '\x93', ' ', '\xE0', '\xAE', '\xB1', ' ', '\xE0', '\xAE', '\x88', ' ', '\xE0', '\xAE', '\x95', ' ', '\xE0', '\xAE', '\x99', ' ', '\xE0', '\xAE', '\x9A', /* உ ஒ ஓ ற ஈ க ங ச */
'\0',
'\xE0', '\xAE', '\x95', ' ', '\xE0', '\xAE', '\x9A', ' ', '\xE0', '\xAE', '\xB2', ' ', '\xE0', '\xAE', '\xB6', ' ', '\xE0', '\xAE', '\x89', ' ', '\xE0', '\xAE', '\x99', ' ', '\xE0', '\xAE', '\x9F', ' ', '\xE0', '\xAE', '\xAA', /* க ச ல ஶ உ ங ட ப */
@@ -231,6 +383,12 @@
'\xE0', '\xB8', '\x8D', ' ', '\xE0', '\xB8', '\x90', /* ภภ*/
'\0',
'\xE0', '\xB9', '\x90', ' ', '\xE0', '\xB9', '\x91', ' ', '\xE0', '\xB9', '\x93', /* ๠๑ ๓ */
+ '\0',
+ '\xE2', '\xB5', '\x94', ' ', '\xE2', '\xB5', '\x99', ' ', '\xE2', '\xB5', '\x9B', ' ', '\xE2', '\xB5', '\x9E', ' ', '\xE2', '\xB4', '\xB5', ' ', '\xE2', '\xB4', '\xBC', ' ', '\xE2', '\xB4', '\xB9', ' ', '\xE2', '\xB5', '\x8E', /* ⵔ ⵙ ⵛ ⵞ ⴵ ⴼ ⴹ ⵎ */
+ '\0',
+ '\xEA', '\x97', '\x8D', ' ', '\xEA', '\x98', '\x96', ' ', '\xEA', '\x98', '\x99', ' ', '\xEA', '\x98', '\x9C', ' ', '\xEA', '\x96', '\x9C', ' ', '\xEA', '\x96', '\x9D', ' ', '\xEA', '\x94', '\x85', ' ', '\xEA', '\x95', '\xA2', /* ê— ê˜– ꘙ ꘜ ê–œ ê– ê”… ê•¢ */
+ '\0',
+ '\xEA', '\x97', '\x8D', ' ', '\xEA', '\x98', '\x96', ' ', '\xEA', '\x98', '\x99', ' ', '\xEA', '\x97', '\x9E', ' ', '\xEA', '\x94', '\x85', ' ', '\xEA', '\x95', '\xA2', ' ', '\xEA', '\x96', '\x9C', ' ', '\xEA', '\x94', '\x86', /* ê— ê˜– ꘙ ê—ž ê”… ê•¢ ê–œ ꔆ */
#ifdef AF_CONFIG_OPTION_CJK
'\0',
'\xE4', '\xBB', '\x96', ' ', '\xE4', '\xBB', '\xAC', ' ', '\xE4', '\xBD', '\xA0', ' ', '\xE4', '\xBE', '\x86', ' ', '\xE5', '\x80', '\x91', ' ', '\xE5', '\x88', '\xB0', ' ', '\xE5', '\x92', '\x8C', ' ', '\xE5', '\x9C', '\xB0', /* 他 们 你 來 們 到 和 地 */
@@ -281,6 +439,12 @@
af_blue_stringsets[] =
{
/* */
+ { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_ADLAM_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_ARABIC_BOTTOM, 0 },
{ AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL },
@@ -293,6 +457,12 @@
{ AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 },
{ AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_AVESTAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_AVESTAN_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_BAMUM_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_BAMUM_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_BENGALI_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_BENGALI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_BENGALI_BASE, AF_BLUE_PROPERTY_LATIN_TOP |
@@ -300,6 +470,27 @@
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_BENGALI_BASE, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_BUHID_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_BUHID_LARGE, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_BUHID_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_BUHID_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_CHAKMA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_CHAKMA_BOTTOM, 0 },
+ { AF_BLUE_STRING_CHAKMA_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 },
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_CARIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_CARIAN_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_CHEROKEE_CAPITAL, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_CHEROKEE_CAPITAL, 0 },
{ AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
@@ -308,6 +499,17 @@
{ AF_BLUE_STRING_CHEROKEE_SMALL, 0 },
{ AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_COPTIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_CYPRIOT_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_CYPRIOT_BOTTOM, 0 },
+ { AF_BLUE_STRING_CYPRIOT_SMALL, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_CYPRIOT_SMALL, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
@@ -323,6 +525,12 @@
{ AF_BLUE_STRING_DEVANAGARI_BASE, 0 },
{ AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_DESERET_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
@@ -340,6 +548,15 @@
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_GOTHIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_GOTHIC_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
@@ -368,6 +585,13 @@
{ AF_BLUE_STRING_HEBREW_BOTTOM, 0 },
{ AF_BLUE_STRING_HEBREW_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_KAYAH_LI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_KAYAH_LI_BOTTOM, 0 },
+ { AF_BLUE_STRING_KAYAH_LI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_KAYAH_LI_DESCENDER, 0 },
+ { AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_KANNADA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_KANNADA_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
@@ -392,9 +616,9 @@
{ AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
+ { AF_BLUE_STRING_LATIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_LATIN_SMALL, 0 },
+ { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, 0 },
{ AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
@@ -413,6 +637,9 @@
{ AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 },
{ AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_LISU_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_LISU_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
@@ -422,14 +649,55 @@
{ AF_BLUE_STRING_MYANMAR_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_MYANMAR_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_NKO_BOTTOM, 0 },
+ { AF_BLUE_STRING_NKO_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_NKO_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_OL_CHIKI, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_OL_CHIKI, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_OLD_TURKIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_OLD_TURKIC_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 },
+ { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_OSMANYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_OSMANYA_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_SAURASHTRA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_SAURASHTRA_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 },
+ { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 },
+ { AF_BLUE_STRING_SHAVIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_SINHALA_BOTTOM, 0 },
{ AF_BLUE_STRING_SINHALA_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_SUNDANESE_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_SUNDANESE_BOTTOM, 0 },
+ { AF_BLUE_STRING_SUNDANESE_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_TAMIL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_TAMIL_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_TAI_VIET_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_TAI_VIET_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_TELUGU_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
@@ -442,6 +710,12 @@
{ AF_BLUE_STRING_THAI_LARGE_DESCENDER, 0 },
{ AF_BLUE_STRING_THAI_DIGIT_TOP, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_TIFINAGH, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_TIFINAGH, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_VAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_VAI_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
#ifdef AF_CONFIG_OPTION_CJK
{ AF_BLUE_STRING_CJK_TOP, AF_BLUE_PROPERTY_CJK_TOP },
{ AF_BLUE_STRING_CJK_BOTTOM, 0 },
diff --git a/thirdparty/freetype/src/autofit/afblue.cin b/thirdparty/freetype/src/autofit/afblue.cin
index 0c3cae818f..f9080c54d4 100644
--- a/thirdparty/freetype/src/autofit/afblue.cin
+++ b/thirdparty/freetype/src/autofit/afblue.cin
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter data for blue strings (body). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afblue.dat b/thirdparty/freetype/src/autofit/afblue.dat
index 0734ec71f0..454923e9ca 100644
--- a/thirdparty/freetype/src/autofit/afblue.dat
+++ b/thirdparty/freetype/src/autofit/afblue.dat
@@ -2,7 +2,7 @@
//
// Auto-fitter data for blue strings.
//
-// Copyright 2013-2016 by
+// Copyright 2013-2017 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used,
@@ -74,6 +74,15 @@
AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
+ AF_BLUE_STRING_ADLAM_CAPITAL_TOP
+ "𞤌 𞤅 𞤈 𞤠𞤔 𞤚"
+ AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM
+ "𞤂 𞤖"
+ AF_BLUE_STRING_ADLAM_SMALL_TOP
+ "𞤬 𞤮 𞤻 𞤼 𞤾"
+ AF_BLUE_STRING_ADLAM_SMALL_BOTTOM
+ "𞤤 𞤨 𞤩 𞤭 𞤴 𞤸 𞤺 𞥀"
+
AF_BLUE_STRING_ARABIC_TOP
"ا إ ل ك ط ظ"
AF_BLUE_STRING_ARABIC_BOTTOM
@@ -87,18 +96,28 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
"Ù€"
AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP
- "Ô± Õ„ Õ’ Õ“ Ô² Ô³ Ô´ Õ•"
+ "Ô± Õ„ Õ’ Õ Ô² Ô³ Ô´ Õ•"
AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM
- "Õ’ Õˆ Õ“ Õƒ Õ‡ Õ Õ Õ•"
+ "Õ’ Õˆ Ô´ Õƒ Õ‡ Õ Õ Õ•"
AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER
- "Õ¥ Õ§ Õ« Õ´ Õ¾ Öƒ Ö† Öƒ"
+ "Õ¥ Õ§ Õ« Õ´ Õ¾ Ö† Õ³"
AF_BLUE_STRING_ARMENIAN_SMALL_TOP
- "Õ¡ Õµ Ö‚ Õ½ Õ£ Õ» Ö€ Ö…"
+ "Õ¡ Õµ Ö‚ Õ½ Õ£ Õ· Ö€ Ö…"
AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM
"Õ° Õ¸ Õ³ Õ¡ Õ¥ Õ® Õ½ Ö…"
AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER
"Õ¢ Õ¨ Õ« Õ¬ Õ² Õº Öƒ Ö"
+ AF_BLUE_STRING_AVESTAN_TOP
+ "𬀠ð¬ ð¬ ð¬›"
+ AF_BLUE_STRING_AVESTAN_BOTTOM
+ "𬀠ð¬"
+
+ AF_BLUE_STRING_BAMUM_TOP
+ "êš§ ꚨ ê›› ꛉ ê› ê›ˆ ꛫ ꛯ"
+ AF_BLUE_STRING_BAMUM_BOTTOM
+ "ꚭ ꚳ ꚶ ꛬ ꚢ ꚽ ꛯ ꛲"
+
AF_BLUE_STRING_BENGALI_BASE
"অ ড ত ন ব ভ ল ক"
AF_BLUE_STRING_BENGALI_TOP
@@ -106,6 +125,40 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_BENGALI_HEAD
"ও ঠড ত ন ব ল ক"
+ AF_BLUE_STRING_BUHID_TOP
+ "á áˆ"
+ AF_BLUE_STRING_BUHID_LARGE
+ "á… áŠ áŽ"
+ AF_BLUE_STRING_BUHID_SMALL
+ "ႠრበáŒ"
+ AF_BLUE_STRING_BUHID_BOTTOM
+ "ဠრᆠበዠá á‘"
+
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP
+ "á—œ á–´ á á’£ á‘« ᑎ ᔑ á—°"
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM
+ "ᗶ ᖵ ᒧ რᑌ ᒠᔑ ᗢ"
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP
+ "ᓓ ᓕ ᓀ ᓂ ᓄ ᕄ ᕆ ᘣ"
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM
+ "ᕃ ᓂ ᓀ ᕂ ᓗ ᓚ ᕆ ᘣ"
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP
+ "᪠ᙆ ᣘ ᢠᒾ ᣗ ᔆ"
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM
+ "ᙆ ᗮ ᒻ ហᔆ ᒡ ᒢ ᓑ"
+
+ AF_BLUE_STRING_CARIAN_TOP
+ "ðŠ§ ðŠ« ðŠ¬ ðŠ­ ðŠ± ðŠº ðŠ¼ ðŠ¿"
+ AF_BLUE_STRING_CARIAN_BOTTOM
+ "ðŠ£ ðŠ§ ðŠ· ð‹€ ðŠ« ðŠ¸ ð‹‰"
+
+ AF_BLUE_STRING_CHAKMA_TOP
+ "𑄃 𑄅 𑄉 𑄙 𑄗"
+ AF_BLUE_STRING_CHAKMA_BOTTOM
+ "ð‘„… ð‘„› ð‘„ ð‘„— ð‘„“"
+ AF_BLUE_STRING_CHAKMA_DESCENDER
+ "𑄖𑄳𑄢 𑄘𑄳𑄢 𑄙𑄳𑄢 𑄤𑄳𑄢 𑄥𑄳𑄢"
+
AF_BLUE_STRING_CHEROKEE_CAPITAL
"ᆠᎻ Ꭼ რᎤ ᣠᎦ á•"
AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER
@@ -115,6 +168,22 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER
"á¸ ê® ê­¹ ê­»"
+ AF_BLUE_STRING_COPTIC_CAPITAL_TOP
+ "Ⲍ Ⲏ Ⲡ Ⳟ Ⲟ ⲠⲤ Ⳋ"
+ AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM
+ "ⳠⳘ Ⳟ Ⲏ Ⲟ ⲠⳜ Ⲱ"
+ AF_BLUE_STRING_COPTIC_SMALL_TOP
+ "ⲠⲠⲡ ⳟ ⲟ ⲑ ⲥ ⳋ"
+ AF_BLUE_STRING_COPTIC_SMALL_BOTTOM
+ "ⳑ ⳙ ⳟ Ⲡⲟ ⲑ ⳠⳒ"
+
+ AF_BLUE_STRING_CYPRIOT_TOP
+ "ð  ð ™ ð ³ ð ± ð … ð “ ð £ ð ¦"
+ AF_BLUE_STRING_CYPRIOT_BOTTOM
+ "ð ƒ ð Š ð › ð £ ð ³ ð µ ð "
+ AF_BLUE_STRING_CYPRIOT_SMALL
+ "ð ˆ ð  ð –"
+
AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP
"Б В Е П З О С Э"
AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM
@@ -124,6 +193,15 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER
"р у ф"
+ AF_BLUE_STRING_DESERET_CAPITAL_TOP
+ "ð‚ ð„ ð‹ ð— ð‘"
+ AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM
+ "ð€ ð‚ ð„ ð— ð›"
+ AF_BLUE_STRING_DESERET_SMALL_TOP
+ "ðª ð¬ ð³ ð¿ ð¹"
+ AF_BLUE_STRING_DESERET_SMALL_BOTTOM
+ "ð¨ ðª ð¬ ð¿ ð‘ƒ"
+
AF_BLUE_STRING_DEVANAGARI_BASE
"क म अ आ थ ध भ श"
AF_BLUE_STRING_DEVANAGARI_TOP
@@ -164,6 +242,20 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER
"â´„ â´… â´” â´• â´ â´‚ â´˜ â´"
+ AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP
+ "â°… â°” â°ª â°„ â°‚ â°Š â°« â°‹"
+ AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM
+ "â°… â°„ â°‚ â°ª â°ž â°¡ â°Š â°”"
+ AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP
+ "ⰵ ⱄ ⱚ ⰴ ⰲ ⰺ ⱛ ⰻ"
+ AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM
+ "ⰵ ⰴ ⰲ ⱚ ⱎ ⱑ ⰺ ⱄ"
+
+ AF_BLUE_STRING_GOTHIC_TOP
+ "ðŒ² ðŒ¶ ð€ ð„ ðŒ´ ðƒ ðˆ ðŒ¾"
+ AF_BLUE_STRING_GOTHIC_BOTTOM
+ "ðŒ¶ ðŒ´ ðƒ ðˆ"
+
AF_BLUE_STRING_GREEK_CAPITAL_TOP
"Γ Β Ε Ζ Θ Ο Ω"
AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM
@@ -209,6 +301,17 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_KANNADA_BOTTOM
"ಅ ಉ ಎ ಲ ೦ ೨ ೬ ೭"
+ AF_BLUE_STRING_KAYAH_LI_TOP
+ "꤅ ê¤ ê¤ ê¤‹ ꤀ ê¤"
+ AF_BLUE_STRING_KAYAH_LI_BOTTOM
+ "꤈ ꤘ ꤀ ê¤ ê¤¢"
+ AF_BLUE_STRING_KAYAH_LI_ASCENDER
+ "ꤖ ꤡ"
+ AF_BLUE_STRING_KAYAH_LI_DESCENDER
+ "ꤑ ꤜ ꤞ"
+ AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER
+ "ꤑ꤬ ꤜ꤭ ꤔ꤬"
+
AF_BLUE_STRING_KHMER_TOP
"áž áž‘ áž“ áž§ áž© áž¶"
AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP
@@ -242,8 +345,10 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
"H E Z L O C U S"
AF_BLUE_STRING_LATIN_SMALL_F_TOP
"f i j k d b h"
- AF_BLUE_STRING_LATIN_SMALL
- "x z r o e s c"
+ AF_BLUE_STRING_LATIN_SMALL_TOP
+ "u v x z o e s c"
+ AF_BLUE_STRING_LATIN_SMALL_BOTTOM
+ "n r x z o e s c"
AF_BLUE_STRING_LATIN_SMALL_DESCENDER
"p q g j y"
@@ -272,6 +377,11 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER
"áµ– ʸ áµ"
+ AF_BLUE_STRING_LISU_TOP
+ "ꓡ ꓧ ꓱ ꓶ ꓩ ꓚ ꓵ ꓳ"
+ AF_BLUE_STRING_LISU_BOTTOM
+ "ꓕ ꓜ ꓞ ꓡ ꓛ ꓢ ꓳ ꓴ"
+
AF_BLUE_STRING_MALAYALAM_TOP
"à´’ à´Ÿ à´  à´± à´š à´ª à´šàµà´š à´ªàµà´ª"
AF_BLUE_STRING_MALAYALAM_BOTTOM
@@ -286,6 +396,59 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_MYANMAR_DESCENDER
"ဉ ည ဥ ဩ ဨ á‚ á… á‰"
+ AF_BLUE_STRING_NKO_TOP
+ "ß ß‰ ß’ ߟ ß– ßœ ß  ߥ"
+ AF_BLUE_STRING_NKO_BOTTOM
+ "߀ ߘ ߡ ߠ ߥ"
+ AF_BLUE_STRING_NKO_SMALL_TOP
+ "ß ß› ß‹"
+ AF_BLUE_STRING_NKO_SMALL_BOTTOM
+ "ߎ ß ß› ß‹"
+
+ AF_BLUE_STRING_OL_CHIKI
+ "ᱛ ᱜ ᱠᱡ ᱢ ᱥ"
+
+ AF_BLUE_STRING_OLD_TURKIC_TOP
+ "ð°— ð°˜ ð°§"
+ AF_BLUE_STRING_OLD_TURKIC_BOTTOM
+ "ð°‰ ð°— ð°¦ ð°§"
+
+ AF_BLUE_STRING_OSAGE_CAPITAL_TOP
+ "ð’¾ ð“ ð“’ ð““ ð’» ð“‚ ð’µ ð“†"
+ AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM
+ "ð’° ð“ 𓂠𒿠𓎠ð’¹"
+ AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER
+ "ð’¼ ð’½ ð’¾"
+ AF_BLUE_STRING_OSAGE_SMALL_TOP
+ "𓵠𓶠𓺠𓻠ð“ 𓣠𓪠ð“®"
+ AF_BLUE_STRING_OSAGE_SMALL_BOTTOM
+ "𓘠𓚠𓣠𓵠𓡠𓧠𓪠ð“¶"
+ AF_BLUE_STRING_OSAGE_SMALL_ASCENDER
+ "𓤠𓦠𓸠𓹠ð“›"
+ AF_BLUE_STRING_OSAGE_SMALL_DESCENDER
+ "𓤠𓥠ð“¦"
+
+ AF_BLUE_STRING_OSMANYA_TOP
+ "ð’† ð’‰ ð’ ð’’ ð’˜ ð’› ð’  ð’£"
+ AF_BLUE_STRING_OSMANYA_BOTTOM
+ "ð’€ ð’‚ ð’† ð’ˆ ð’Š ð’’ ð’  ð’©"
+
+ AF_BLUE_STRING_SAURASHTRA_TOP
+ "ꢜ ꢞ ꢳ ꢂ ꢖ ꢒ ê¢ ê¢›"
+ AF_BLUE_STRING_SAURASHTRA_BOTTOM
+ "ꢂ ꢨ ꢺ ꢤ ꢎ"
+
+ AF_BLUE_STRING_SHAVIAN_TOP
+ "ð‘• ð‘™"
+ AF_BLUE_STRING_SHAVIAN_BOTTOM
+ "𑔠𑖠𑗠𑹠ð‘»"
+ AF_BLUE_STRING_SHAVIAN_DESCENDER
+ "𑟠ð‘£"
+ AF_BLUE_STRING_SHAVIAN_SMALL_TOP
+ "𑱠𑲠𑳠𑴠𑸠𑺠ð‘¼"
+ AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM
+ "ð‘´ ð‘» ð‘¹"
+
AF_BLUE_STRING_SINHALA_TOP
"ඉ ක චඳ ප ය ල ෆ"
AF_BLUE_STRING_SINHALA_BOTTOM
@@ -293,6 +456,18 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_SINHALA_DESCENDER
"ද ඳ උ ල තූ තු බු දු"
+ AF_BLUE_STRING_SUNDANESE_TOP
+ "ᮋ ᮞ ᮮ ᮽ ᮰ ᮈ"
+ AF_BLUE_STRING_SUNDANESE_BOTTOM
+ "ᮄ ᮔ ᮕ ᮗ ᮰ ᮆ ᮈ ᮉ"
+ AF_BLUE_STRING_SUNDANESE_DESCENDER
+ "ᮼ ᳄"
+
+ AF_BLUE_STRING_TAI_VIET_TOP
+ "ꪆ ꪔ ꪒ ꪖ ꪫ"
+ AF_BLUE_STRING_TAI_VIET_BOTTOM
+ "ꪉ ꪫ ꪮ"
+
AF_BLUE_STRING_TAMIL_TOP
"உ ஒ ஓ ற ஈ க ங ச"
AF_BLUE_STRING_TAMIL_BOTTOM
@@ -318,6 +493,14 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_THAI_DIGIT_TOP
"๠๑ ๓"
+ AF_BLUE_STRING_TIFINAGH
+ "ⵔ ⵙ ⵛ ⵞ ⴵ ⴼ ⴹ ⵎ"
+
+ AF_BLUE_STRING_VAI_TOP
+ "ê— ê˜– ꘙ ꘜ ê–œ ê– ê”… ê•¢"
+ AF_BLUE_STRING_VAI_BOTTOM
+ "ê— ê˜– ꘙ ê—ž ê”… ê•¢ ê–œ ꔆ"
+
#ifdef AF_CONFIG_OPTION_CJK
@@ -483,6 +666,14 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
+ AF_BLUE_STRINGSET_ADLM
+ { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_ADLAM_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_ARAB
{ AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_ARABIC_BOTTOM, 0 }
@@ -499,6 +690,16 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_AVST
+ { AF_BLUE_STRING_AVESTAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_AVESTAN_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_BAMU
+ { AF_BLUE_STRING_BAMUM_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_BAMUM_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_BENG
{ AF_BLUE_STRING_BENGALI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_BENGALI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -508,6 +709,35 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_BENGALI_BASE, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_BUHD
+ { AF_BLUE_STRING_BUHID_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_BUHID_LARGE, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_BUHID_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_BUHID_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_CAKM
+ { AF_BLUE_STRING_CHAKMA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_CHAKMA_BOTTOM, 0 }
+ { AF_BLUE_STRING_CHAKMA_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_CANS
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 }
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_CARI
+ { AF_BLUE_STRING_CARIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_CARIAN_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_CHER
{ AF_BLUE_STRING_CHEROKEE_CAPITAL, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_CHEROKEE_CAPITAL, 0 }
@@ -518,6 +748,21 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_COPT
+ { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_COPTIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_CPRT
+ { AF_BLUE_STRING_CYPRIOT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_CYPRIOT_BOTTOM, 0 }
+ { AF_BLUE_STRING_CYPRIOT_SMALL, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_CYPRIOT_SMALL, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_CYRL
{ AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 }
@@ -537,6 +782,14 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_DSRT
+ { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_DESERET_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_ETHI
{ AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 }
@@ -561,6 +814,19 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_GLAG
+ { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_GOTH
+ { AF_BLUE_STRING_GOTHIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_GOTHIC_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_GREK
{ AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 }
@@ -597,6 +863,15 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_HEBREW_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_KALI
+ { AF_BLUE_STRING_KAYAH_LI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_KAYAH_LI_BOTTOM, 0 }
+ { AF_BLUE_STRING_KAYAH_LI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_KAYAH_LI_DESCENDER, 0 }
+ { AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_KNDA
{ AF_BLUE_STRING_KANNADA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_KANNADA_BOTTOM, 0 }
@@ -630,9 +905,9 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 }
{ AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
+ { AF_BLUE_STRING_LATIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_LATIN_SMALL, 0 }
+ { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, 0 }
{ AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
@@ -656,6 +931,11 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_LISU
+ { AF_BLUE_STRING_LISU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LISU_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_MLYM
{ AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 }
@@ -669,20 +949,79 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MYANMAR_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_NKOO
+ { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_NKO_BOTTOM, 0 }
+ { AF_BLUE_STRING_NKO_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_NKO_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_NONE
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_OLCK
+ { AF_BLUE_STRING_OL_CHIKI, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_OL_CHIKI, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_ORKH
+ { AF_BLUE_STRING_OLD_TURKIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_OLD_TURKIC_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_OSGE
+ { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 }
+ { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_OSMA
+ { AF_BLUE_STRING_OSMANYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_OSMANYA_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_SAUR
+ { AF_BLUE_STRING_SAURASHTRA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_SAURASHTRA_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_SHAW
+ { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 }
+ { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 }
+ { AF_BLUE_STRING_SHAVIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_SINH
{ AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_SINHALA_BOTTOM, 0 }
{ AF_BLUE_STRING_SINHALA_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_SUND
+ { AF_BLUE_STRING_SUNDANESE_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_SUNDANESE_BOTTOM, 0 }
+ { AF_BLUE_STRING_SUNDANESE_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_TAML
{ AF_BLUE_STRING_TAMIL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_TAMIL_BOTTOM, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_TAVT
+ { AF_BLUE_STRING_TAI_VIET_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_TAI_VIET_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_TELU
{ AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_TELUGU_BOTTOM, 0 }
@@ -699,6 +1038,15 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_THAI_DIGIT_TOP, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_TFNG
+ { AF_BLUE_STRING_TIFINAGH, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_TIFINAGH, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_VAII
+ { AF_BLUE_STRING_VAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_VAI_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
#ifdef AF_CONFIG_OPTION_CJK
diff --git a/thirdparty/freetype/src/autofit/afblue.h b/thirdparty/freetype/src/autofit/afblue.h
index 41f838e457..e227dbf50b 100644
--- a/thirdparty/freetype/src/autofit/afblue.h
+++ b/thirdparty/freetype/src/autofit/afblue.h
@@ -7,7 +7,7 @@
/* */
/* Auto-fitter data for blue strings (specification). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -77,110 +77,189 @@ FT_BEGIN_HEADER
typedef enum AF_Blue_String_
{
- AF_BLUE_STRING_ARABIC_TOP = 0,
- AF_BLUE_STRING_ARABIC_BOTTOM = 18,
- AF_BLUE_STRING_ARABIC_JOIN = 33,
- AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP = 36,
- AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM = 60,
- AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER = 84,
- AF_BLUE_STRING_ARMENIAN_SMALL_TOP = 108,
- AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM = 132,
- AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER = 156,
- AF_BLUE_STRING_BENGALI_BASE = 180,
- AF_BLUE_STRING_BENGALI_TOP = 212,
- AF_BLUE_STRING_BENGALI_HEAD = 240,
- AF_BLUE_STRING_CHEROKEE_CAPITAL = 272,
- AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER = 304,
- AF_BLUE_STRING_CHEROKEE_SMALL = 336,
- AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER = 368,
- AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 384,
- AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 408,
- AF_BLUE_STRING_CYRILLIC_SMALL = 432,
- AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 456,
- AF_BLUE_STRING_DEVANAGARI_BASE = 465,
- AF_BLUE_STRING_DEVANAGARI_TOP = 497,
- AF_BLUE_STRING_DEVANAGARI_HEAD = 529,
- AF_BLUE_STRING_DEVANAGARI_BOTTOM = 561,
- AF_BLUE_STRING_ETHIOPIC_TOP = 569,
- AF_BLUE_STRING_ETHIOPIC_BOTTOM = 601,
- AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP = 633,
- AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM = 665,
- AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER = 697,
- AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER = 729,
- AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP = 761,
- AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM = 793,
- AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP = 825,
- AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM = 857,
- AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER = 889,
- AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER = 921,
- AF_BLUE_STRING_GREEK_CAPITAL_TOP = 953,
- AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 974,
- AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 992,
- AF_BLUE_STRING_GREEK_SMALL = 1010,
- AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 1034,
- AF_BLUE_STRING_GUJARATI_TOP = 1058,
- AF_BLUE_STRING_GUJARATI_BOTTOM = 1090,
- AF_BLUE_STRING_GUJARATI_ASCENDER = 1122,
- AF_BLUE_STRING_GUJARATI_DESCENDER = 1172,
- AF_BLUE_STRING_GUJARATI_DIGIT_TOP = 1205,
- AF_BLUE_STRING_GURMUKHI_BASE = 1225,
- AF_BLUE_STRING_GURMUKHI_HEAD = 1257,
- AF_BLUE_STRING_GURMUKHI_TOP = 1289,
- AF_BLUE_STRING_GURMUKHI_BOTTOM = 1321,
- AF_BLUE_STRING_GURMUKHI_DIGIT_TOP = 1353,
- AF_BLUE_STRING_HEBREW_TOP = 1373,
- AF_BLUE_STRING_HEBREW_BOTTOM = 1397,
- AF_BLUE_STRING_HEBREW_DESCENDER = 1415,
- AF_BLUE_STRING_KANNADA_TOP = 1430,
- AF_BLUE_STRING_KANNADA_BOTTOM = 1474,
- AF_BLUE_STRING_KHMER_TOP = 1506,
- AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 1530,
- AF_BLUE_STRING_KHMER_BOTTOM = 1570,
- AF_BLUE_STRING_KHMER_DESCENDER = 1602,
- AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 1636,
- AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 1723,
- AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 1731,
- AF_BLUE_STRING_LAO_TOP = 1739,
- AF_BLUE_STRING_LAO_BOTTOM = 1771,
- AF_BLUE_STRING_LAO_ASCENDER = 1803,
- AF_BLUE_STRING_LAO_LARGE_ASCENDER = 1819,
- AF_BLUE_STRING_LAO_DESCENDER = 1831,
- AF_BLUE_STRING_LATIN_CAPITAL_TOP = 1855,
- AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 1871,
- AF_BLUE_STRING_LATIN_SMALL_F_TOP = 1887,
- AF_BLUE_STRING_LATIN_SMALL = 1901,
- AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 1915,
- AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 1925,
- AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 1945,
- AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 1965,
- AF_BLUE_STRING_LATIN_SUBS_SMALL = 1985,
- AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 2021,
- AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 2041,
- AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 2072,
- AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 2101,
- AF_BLUE_STRING_LATIN_SUPS_SMALL = 2127,
- AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 2152,
- AF_BLUE_STRING_MALAYALAM_TOP = 2163,
- AF_BLUE_STRING_MALAYALAM_BOTTOM = 2207,
- AF_BLUE_STRING_MYANMAR_TOP = 2239,
- AF_BLUE_STRING_MYANMAR_BOTTOM = 2271,
- AF_BLUE_STRING_MYANMAR_ASCENDER = 2303,
- AF_BLUE_STRING_MYANMAR_DESCENDER = 2331,
- AF_BLUE_STRING_SINHALA_TOP = 2363,
- AF_BLUE_STRING_SINHALA_BOTTOM = 2395,
- AF_BLUE_STRING_SINHALA_DESCENDER = 2427,
- AF_BLUE_STRING_TAMIL_TOP = 2471,
- AF_BLUE_STRING_TAMIL_BOTTOM = 2503,
- AF_BLUE_STRING_TELUGU_TOP = 2535,
- AF_BLUE_STRING_TELUGU_BOTTOM = 2563,
- AF_BLUE_STRING_THAI_TOP = 2591,
- AF_BLUE_STRING_THAI_BOTTOM = 2615,
- AF_BLUE_STRING_THAI_ASCENDER = 2643,
- AF_BLUE_STRING_THAI_LARGE_ASCENDER = 2655,
- AF_BLUE_STRING_THAI_DESCENDER = 2667,
- AF_BLUE_STRING_THAI_LARGE_DESCENDER = 2683,
- AF_BLUE_STRING_THAI_DIGIT_TOP = 2691,
- af_blue_1_1 = 2702,
+ AF_BLUE_STRING_ADLAM_CAPITAL_TOP = 0,
+ AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM = 30,
+ AF_BLUE_STRING_ADLAM_SMALL_TOP = 40,
+ AF_BLUE_STRING_ADLAM_SMALL_BOTTOM = 65,
+ AF_BLUE_STRING_ARABIC_TOP = 105,
+ AF_BLUE_STRING_ARABIC_BOTTOM = 123,
+ AF_BLUE_STRING_ARABIC_JOIN = 138,
+ AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP = 141,
+ AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM = 165,
+ AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER = 189,
+ AF_BLUE_STRING_ARMENIAN_SMALL_TOP = 210,
+ AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM = 234,
+ AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER = 258,
+ AF_BLUE_STRING_AVESTAN_TOP = 282,
+ AF_BLUE_STRING_AVESTAN_BOTTOM = 302,
+ AF_BLUE_STRING_BAMUM_TOP = 312,
+ AF_BLUE_STRING_BAMUM_BOTTOM = 344,
+ AF_BLUE_STRING_BENGALI_BASE = 376,
+ AF_BLUE_STRING_BENGALI_TOP = 408,
+ AF_BLUE_STRING_BENGALI_HEAD = 436,
+ AF_BLUE_STRING_BUHID_TOP = 468,
+ AF_BLUE_STRING_BUHID_LARGE = 476,
+ AF_BLUE_STRING_BUHID_SMALL = 488,
+ AF_BLUE_STRING_BUHID_BOTTOM = 504,
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP = 532,
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM = 564,
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP = 596,
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM = 628,
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP = 660,
+ AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM = 688,
+ AF_BLUE_STRING_CARIAN_TOP = 720,
+ AF_BLUE_STRING_CARIAN_BOTTOM = 760,
+ AF_BLUE_STRING_CHAKMA_TOP = 795,
+ AF_BLUE_STRING_CHAKMA_BOTTOM = 820,
+ AF_BLUE_STRING_CHAKMA_DESCENDER = 845,
+ AF_BLUE_STRING_CHEROKEE_CAPITAL = 910,
+ AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER = 942,
+ AF_BLUE_STRING_CHEROKEE_SMALL = 974,
+ AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER = 1006,
+ AF_BLUE_STRING_COPTIC_CAPITAL_TOP = 1022,
+ AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM = 1054,
+ AF_BLUE_STRING_COPTIC_SMALL_TOP = 1086,
+ AF_BLUE_STRING_COPTIC_SMALL_BOTTOM = 1118,
+ AF_BLUE_STRING_CYPRIOT_TOP = 1150,
+ AF_BLUE_STRING_CYPRIOT_BOTTOM = 1190,
+ AF_BLUE_STRING_CYPRIOT_SMALL = 1225,
+ AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 1240,
+ AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 1264,
+ AF_BLUE_STRING_CYRILLIC_SMALL = 1288,
+ AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 1312,
+ AF_BLUE_STRING_DESERET_CAPITAL_TOP = 1321,
+ AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM = 1346,
+ AF_BLUE_STRING_DESERET_SMALL_TOP = 1371,
+ AF_BLUE_STRING_DESERET_SMALL_BOTTOM = 1396,
+ AF_BLUE_STRING_DEVANAGARI_BASE = 1421,
+ AF_BLUE_STRING_DEVANAGARI_TOP = 1453,
+ AF_BLUE_STRING_DEVANAGARI_HEAD = 1485,
+ AF_BLUE_STRING_DEVANAGARI_BOTTOM = 1517,
+ AF_BLUE_STRING_ETHIOPIC_TOP = 1525,
+ AF_BLUE_STRING_ETHIOPIC_BOTTOM = 1557,
+ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP = 1589,
+ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM = 1621,
+ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER = 1653,
+ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER = 1685,
+ AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP = 1717,
+ AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM = 1749,
+ AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP = 1781,
+ AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM = 1813,
+ AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER = 1845,
+ AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER = 1877,
+ AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP = 1909,
+ AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM = 1941,
+ AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP = 1973,
+ AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM = 2005,
+ AF_BLUE_STRING_GOTHIC_TOP = 2037,
+ AF_BLUE_STRING_GOTHIC_BOTTOM = 2077,
+ AF_BLUE_STRING_GREEK_CAPITAL_TOP = 2097,
+ AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 2118,
+ AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 2136,
+ AF_BLUE_STRING_GREEK_SMALL = 2154,
+ AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 2178,
+ AF_BLUE_STRING_GUJARATI_TOP = 2202,
+ AF_BLUE_STRING_GUJARATI_BOTTOM = 2234,
+ AF_BLUE_STRING_GUJARATI_ASCENDER = 2266,
+ AF_BLUE_STRING_GUJARATI_DESCENDER = 2316,
+ AF_BLUE_STRING_GUJARATI_DIGIT_TOP = 2349,
+ AF_BLUE_STRING_GURMUKHI_BASE = 2369,
+ AF_BLUE_STRING_GURMUKHI_HEAD = 2401,
+ AF_BLUE_STRING_GURMUKHI_TOP = 2433,
+ AF_BLUE_STRING_GURMUKHI_BOTTOM = 2465,
+ AF_BLUE_STRING_GURMUKHI_DIGIT_TOP = 2497,
+ AF_BLUE_STRING_HEBREW_TOP = 2517,
+ AF_BLUE_STRING_HEBREW_BOTTOM = 2541,
+ AF_BLUE_STRING_HEBREW_DESCENDER = 2559,
+ AF_BLUE_STRING_KANNADA_TOP = 2574,
+ AF_BLUE_STRING_KANNADA_BOTTOM = 2618,
+ AF_BLUE_STRING_KAYAH_LI_TOP = 2650,
+ AF_BLUE_STRING_KAYAH_LI_BOTTOM = 2674,
+ AF_BLUE_STRING_KAYAH_LI_ASCENDER = 2694,
+ AF_BLUE_STRING_KAYAH_LI_DESCENDER = 2702,
+ AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER = 2714,
+ AF_BLUE_STRING_KHMER_TOP = 2735,
+ AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 2759,
+ AF_BLUE_STRING_KHMER_BOTTOM = 2799,
+ AF_BLUE_STRING_KHMER_DESCENDER = 2831,
+ AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 2865,
+ AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 2952,
+ AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 2960,
+ AF_BLUE_STRING_LAO_TOP = 2968,
+ AF_BLUE_STRING_LAO_BOTTOM = 3000,
+ AF_BLUE_STRING_LAO_ASCENDER = 3032,
+ AF_BLUE_STRING_LAO_LARGE_ASCENDER = 3048,
+ AF_BLUE_STRING_LAO_DESCENDER = 3060,
+ AF_BLUE_STRING_LATIN_CAPITAL_TOP = 3084,
+ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 3100,
+ AF_BLUE_STRING_LATIN_SMALL_F_TOP = 3116,
+ AF_BLUE_STRING_LATIN_SMALL_TOP = 3130,
+ AF_BLUE_STRING_LATIN_SMALL_BOTTOM = 3146,
+ AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 3162,
+ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 3172,
+ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 3192,
+ AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 3212,
+ AF_BLUE_STRING_LATIN_SUBS_SMALL = 3232,
+ AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 3268,
+ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 3288,
+ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 3319,
+ AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 3348,
+ AF_BLUE_STRING_LATIN_SUPS_SMALL = 3374,
+ AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 3399,
+ AF_BLUE_STRING_LISU_TOP = 3410,
+ AF_BLUE_STRING_LISU_BOTTOM = 3442,
+ AF_BLUE_STRING_MALAYALAM_TOP = 3474,
+ AF_BLUE_STRING_MALAYALAM_BOTTOM = 3518,
+ AF_BLUE_STRING_MYANMAR_TOP = 3550,
+ AF_BLUE_STRING_MYANMAR_BOTTOM = 3582,
+ AF_BLUE_STRING_MYANMAR_ASCENDER = 3614,
+ AF_BLUE_STRING_MYANMAR_DESCENDER = 3642,
+ AF_BLUE_STRING_NKO_TOP = 3674,
+ AF_BLUE_STRING_NKO_BOTTOM = 3698,
+ AF_BLUE_STRING_NKO_SMALL_TOP = 3713,
+ AF_BLUE_STRING_NKO_SMALL_BOTTOM = 3722,
+ AF_BLUE_STRING_OL_CHIKI = 3734,
+ AF_BLUE_STRING_OLD_TURKIC_TOP = 3758,
+ AF_BLUE_STRING_OLD_TURKIC_BOTTOM = 3773,
+ AF_BLUE_STRING_OSAGE_CAPITAL_TOP = 3793,
+ AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM = 3833,
+ AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER = 3863,
+ AF_BLUE_STRING_OSAGE_SMALL_TOP = 3878,
+ AF_BLUE_STRING_OSAGE_SMALL_BOTTOM = 3918,
+ AF_BLUE_STRING_OSAGE_SMALL_ASCENDER = 3958,
+ AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 3983,
+ AF_BLUE_STRING_OSMANYA_TOP = 3998,
+ AF_BLUE_STRING_OSMANYA_BOTTOM = 4038,
+ AF_BLUE_STRING_SAURASHTRA_TOP = 4078,
+ AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4110,
+ AF_BLUE_STRING_SHAVIAN_TOP = 4130,
+ AF_BLUE_STRING_SHAVIAN_BOTTOM = 4140,
+ AF_BLUE_STRING_SHAVIAN_DESCENDER = 4165,
+ AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4175,
+ AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4210,
+ AF_BLUE_STRING_SINHALA_TOP = 4225,
+ AF_BLUE_STRING_SINHALA_BOTTOM = 4257,
+ AF_BLUE_STRING_SINHALA_DESCENDER = 4289,
+ AF_BLUE_STRING_SUNDANESE_TOP = 4333,
+ AF_BLUE_STRING_SUNDANESE_BOTTOM = 4357,
+ AF_BLUE_STRING_SUNDANESE_DESCENDER = 4389,
+ AF_BLUE_STRING_TAI_VIET_TOP = 4397,
+ AF_BLUE_STRING_TAI_VIET_BOTTOM = 4417,
+ AF_BLUE_STRING_TAMIL_TOP = 4429,
+ AF_BLUE_STRING_TAMIL_BOTTOM = 4461,
+ AF_BLUE_STRING_TELUGU_TOP = 4493,
+ AF_BLUE_STRING_TELUGU_BOTTOM = 4521,
+ AF_BLUE_STRING_THAI_TOP = 4549,
+ AF_BLUE_STRING_THAI_BOTTOM = 4573,
+ AF_BLUE_STRING_THAI_ASCENDER = 4601,
+ AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4613,
+ AF_BLUE_STRING_THAI_DESCENDER = 4625,
+ AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4641,
+ AF_BLUE_STRING_THAI_DIGIT_TOP = 4649,
+ AF_BLUE_STRING_TIFINAGH = 4661,
+ AF_BLUE_STRING_VAI_TOP = 4693,
+ AF_BLUE_STRING_VAI_BOTTOM = 4725,
+ af_blue_1_1 = 4756,
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,
AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203,
@@ -239,34 +318,59 @@ FT_BEGIN_HEADER
typedef enum AF_Blue_Stringset_
{
- AF_BLUE_STRINGSET_ARAB = 0,
- AF_BLUE_STRINGSET_ARMN = 4,
- AF_BLUE_STRINGSET_BENG = 11,
- AF_BLUE_STRINGSET_CHER = 16,
- AF_BLUE_STRINGSET_CYRL = 23,
- AF_BLUE_STRINGSET_DEVA = 29,
- AF_BLUE_STRINGSET_ETHI = 35,
- AF_BLUE_STRINGSET_GEOR = 38,
- AF_BLUE_STRINGSET_GEOK = 43,
- AF_BLUE_STRINGSET_GREK = 50,
- AF_BLUE_STRINGSET_GUJR = 57,
- AF_BLUE_STRINGSET_GURU = 63,
- AF_BLUE_STRINGSET_HEBR = 69,
- AF_BLUE_STRINGSET_KNDA = 73,
- AF_BLUE_STRINGSET_KHMR = 76,
- AF_BLUE_STRINGSET_KHMS = 82,
- AF_BLUE_STRINGSET_LAO = 85,
- AF_BLUE_STRINGSET_LATN = 91,
- AF_BLUE_STRINGSET_LATB = 98,
- AF_BLUE_STRINGSET_LATP = 105,
- AF_BLUE_STRINGSET_MLYM = 112,
- AF_BLUE_STRINGSET_MYMR = 115,
- AF_BLUE_STRINGSET_NONE = 120,
- AF_BLUE_STRINGSET_SINH = 121,
- AF_BLUE_STRINGSET_TAML = 125,
- AF_BLUE_STRINGSET_TELU = 128,
- AF_BLUE_STRINGSET_THAI = 131,
- af_blue_2_1 = 139,
+ AF_BLUE_STRINGSET_ADLM = 0,
+ AF_BLUE_STRINGSET_ARAB = 5,
+ AF_BLUE_STRINGSET_ARMN = 9,
+ AF_BLUE_STRINGSET_AVST = 16,
+ AF_BLUE_STRINGSET_BAMU = 19,
+ AF_BLUE_STRINGSET_BENG = 22,
+ AF_BLUE_STRINGSET_BUHD = 27,
+ AF_BLUE_STRINGSET_CAKM = 32,
+ AF_BLUE_STRINGSET_CANS = 36,
+ AF_BLUE_STRINGSET_CARI = 43,
+ AF_BLUE_STRINGSET_CHER = 46,
+ AF_BLUE_STRINGSET_COPT = 53,
+ AF_BLUE_STRINGSET_CPRT = 58,
+ AF_BLUE_STRINGSET_CYRL = 63,
+ AF_BLUE_STRINGSET_DEVA = 69,
+ AF_BLUE_STRINGSET_DSRT = 75,
+ AF_BLUE_STRINGSET_ETHI = 80,
+ AF_BLUE_STRINGSET_GEOR = 83,
+ AF_BLUE_STRINGSET_GEOK = 88,
+ AF_BLUE_STRINGSET_GLAG = 95,
+ AF_BLUE_STRINGSET_GOTH = 100,
+ AF_BLUE_STRINGSET_GREK = 103,
+ AF_BLUE_STRINGSET_GUJR = 110,
+ AF_BLUE_STRINGSET_GURU = 116,
+ AF_BLUE_STRINGSET_HEBR = 122,
+ AF_BLUE_STRINGSET_KALI = 126,
+ AF_BLUE_STRINGSET_KNDA = 132,
+ AF_BLUE_STRINGSET_KHMR = 135,
+ AF_BLUE_STRINGSET_KHMS = 141,
+ AF_BLUE_STRINGSET_LAO = 144,
+ AF_BLUE_STRINGSET_LATN = 150,
+ AF_BLUE_STRINGSET_LATB = 157,
+ AF_BLUE_STRINGSET_LATP = 164,
+ AF_BLUE_STRINGSET_LISU = 171,
+ AF_BLUE_STRINGSET_MLYM = 174,
+ AF_BLUE_STRINGSET_MYMR = 177,
+ AF_BLUE_STRINGSET_NKOO = 182,
+ AF_BLUE_STRINGSET_NONE = 187,
+ AF_BLUE_STRINGSET_OLCK = 188,
+ AF_BLUE_STRINGSET_ORKH = 191,
+ AF_BLUE_STRINGSET_OSGE = 194,
+ AF_BLUE_STRINGSET_OSMA = 202,
+ AF_BLUE_STRINGSET_SAUR = 205,
+ AF_BLUE_STRINGSET_SHAW = 208,
+ AF_BLUE_STRINGSET_SINH = 214,
+ AF_BLUE_STRINGSET_SUND = 218,
+ AF_BLUE_STRINGSET_TAML = 222,
+ AF_BLUE_STRINGSET_TAVT = 225,
+ AF_BLUE_STRINGSET_TELU = 228,
+ AF_BLUE_STRINGSET_THAI = 231,
+ AF_BLUE_STRINGSET_TFNG = 239,
+ AF_BLUE_STRINGSET_VAII = 242,
+ af_blue_2_1 = 245,
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
af_blue_2_1_1 = af_blue_2_1 + 2,
diff --git a/thirdparty/freetype/src/autofit/afblue.hin b/thirdparty/freetype/src/autofit/afblue.hin
index dd44e77254..268bcbc531 100644
--- a/thirdparty/freetype/src/autofit/afblue.hin
+++ b/thirdparty/freetype/src/autofit/afblue.hin
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter data for blue strings (specification). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afcjk.c b/thirdparty/freetype/src/autofit/afcjk.c
index 4823c1d7f8..61e29cdeda 100644
--- a/thirdparty/freetype/src/autofit/afcjk.c
+++ b/thirdparty/freetype/src/autofit/afcjk.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for CJK writing system (body). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -29,13 +29,13 @@
#include "afglobal.h"
#include "afpic.h"
#include "aflatin.h"
+#include "afcjk.h"
#ifdef AF_CONFIG_OPTION_CJK
#undef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
-#include "afcjk.h"
#include "aferrors.h"
@@ -563,7 +563,7 @@
FT_Face face )
{
FT_Bool started = 0, same_width = 1;
- FT_Fixed advance, old_advance = 0;
+ FT_Fixed advance = 0, old_advance = 0;
void* shaper_buf;
@@ -1398,9 +1398,9 @@
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
/*
- * We adjust stems to full pixels only if we don't use the `light' mode.
+ * We adjust stems to full pixels unless in `light' or `lcd' mode.
*/
- if ( mode != FT_RENDER_MODE_LIGHT )
+ if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
if ( mode == FT_RENDER_MODE_MONO )
@@ -2351,13 +2351,13 @@
sizeof ( AF_CJKMetricsRec ),
- (AF_WritingSystem_InitMetricsFunc) af_cjk_metrics_init,
- (AF_WritingSystem_ScaleMetricsFunc)af_cjk_metrics_scale,
- (AF_WritingSystem_DoneMetricsFunc) NULL,
- (AF_WritingSystem_GetStdWidthsFunc)af_cjk_get_standard_widths,
+ (AF_WritingSystem_InitMetricsFunc) af_cjk_metrics_init, /* style_metrics_init */
+ (AF_WritingSystem_ScaleMetricsFunc)af_cjk_metrics_scale, /* style_metrics_scale */
+ (AF_WritingSystem_DoneMetricsFunc) NULL, /* style_metrics_done */
+ (AF_WritingSystem_GetStdWidthsFunc)af_cjk_get_standard_widths, /* style_metrics_getstdw */
- (AF_WritingSystem_InitHintsFunc) af_cjk_hints_init,
- (AF_WritingSystem_ApplyHintsFunc) af_cjk_hints_apply
+ (AF_WritingSystem_InitHintsFunc) af_cjk_hints_init, /* style_hints_init */
+ (AF_WritingSystem_ApplyHintsFunc) af_cjk_hints_apply /* style_hints_apply */
)
@@ -2371,13 +2371,13 @@
sizeof ( AF_CJKMetricsRec ),
- (AF_WritingSystem_InitMetricsFunc) NULL,
- (AF_WritingSystem_ScaleMetricsFunc)NULL,
- (AF_WritingSystem_DoneMetricsFunc) NULL,
- (AF_WritingSystem_GetStdWidthsFunc)NULL,
+ (AF_WritingSystem_InitMetricsFunc) NULL, /* style_metrics_init */
+ (AF_WritingSystem_ScaleMetricsFunc)NULL, /* style_metrics_scale */
+ (AF_WritingSystem_DoneMetricsFunc) NULL, /* style_metrics_done */
+ (AF_WritingSystem_GetStdWidthsFunc)NULL, /* style_metrics_getstdw */
- (AF_WritingSystem_InitHintsFunc) NULL,
- (AF_WritingSystem_ApplyHintsFunc) NULL
+ (AF_WritingSystem_InitHintsFunc) NULL, /* style_hints_init */
+ (AF_WritingSystem_ApplyHintsFunc) NULL /* style_hints_apply */
)
diff --git a/thirdparty/freetype/src/autofit/afcjk.h b/thirdparty/freetype/src/autofit/afcjk.h
index 40d1184386..84f892f909 100644
--- a/thirdparty/freetype/src/autofit/afcjk.h
+++ b/thirdparty/freetype/src/autofit/afcjk.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for CJK writing system (specification). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afcover.h b/thirdparty/freetype/src/autofit/afcover.h
index 1c39a707ef..1b18c666ab 100644
--- a/thirdparty/freetype/src/autofit/afcover.h
+++ b/thirdparty/freetype/src/autofit/afcover.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter coverages (specification only). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afdummy.c b/thirdparty/freetype/src/autofit/afdummy.c
index f3960c85fd..61c32db5bf 100644
--- a/thirdparty/freetype/src/autofit/afdummy.c
+++ b/thirdparty/freetype/src/autofit/afdummy.c
@@ -5,7 +5,7 @@
/* Auto-fitter dummy routines to be used if no hinting should be */
/* performed (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -62,13 +62,13 @@
sizeof ( AF_StyleMetricsRec ),
- (AF_WritingSystem_InitMetricsFunc) NULL,
- (AF_WritingSystem_ScaleMetricsFunc)NULL,
- (AF_WritingSystem_DoneMetricsFunc) NULL,
- (AF_WritingSystem_GetStdWidthsFunc)NULL,
+ (AF_WritingSystem_InitMetricsFunc) NULL, /* style_metrics_init */
+ (AF_WritingSystem_ScaleMetricsFunc)NULL, /* style_metrics_scale */
+ (AF_WritingSystem_DoneMetricsFunc) NULL, /* style_metrics_done */
+ (AF_WritingSystem_GetStdWidthsFunc)NULL, /* style_metrics_getstdw */
- (AF_WritingSystem_InitHintsFunc) af_dummy_hints_init,
- (AF_WritingSystem_ApplyHintsFunc) af_dummy_hints_apply
+ (AF_WritingSystem_InitHintsFunc) af_dummy_hints_init, /* style_hints_init */
+ (AF_WritingSystem_ApplyHintsFunc) af_dummy_hints_apply /* style_hints_apply */
)
diff --git a/thirdparty/freetype/src/autofit/afdummy.h b/thirdparty/freetype/src/autofit/afdummy.h
index 7e58d1a9a5..ebaa7d76ea 100644
--- a/thirdparty/freetype/src/autofit/afdummy.h
+++ b/thirdparty/freetype/src/autofit/afdummy.h
@@ -5,7 +5,7 @@
/* Auto-fitter dummy routines to be used if no hinting should be */
/* performed (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/aferrors.h b/thirdparty/freetype/src/autofit/aferrors.h
index 53c01f64dd..dde182f3c8 100644
--- a/thirdparty/freetype/src/autofit/aferrors.h
+++ b/thirdparty/freetype/src/autofit/aferrors.h
@@ -4,7 +4,7 @@
/* */
/* Autofitter error codes (specification only). */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afglobal.c b/thirdparty/freetype/src/autofit/afglobal.c
index ac6dcafc0f..85bef001f7 100644
--- a/thirdparty/freetype/src/autofit/afglobal.c
+++ b/thirdparty/freetype/src/autofit/afglobal.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter routines to compute global hinting values (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -168,7 +168,7 @@
AF_Script_UniRange range;
- if ( script_class->script_uni_ranges == NULL )
+ if ( !script_class->script_uni_ranges )
continue;
/*
@@ -411,23 +411,11 @@
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
hb_font_destroy( globals->hb_font );
- globals->hb_font = NULL;
-
hb_buffer_destroy( globals->hb_buf );
- globals->hb_buf = NULL;
#endif
- globals->glyph_count = 0;
- globals->stem_darkening_for_ppem = 0;
- globals->darken_x = 0;
- globals->darken_y = 0;
- globals->standard_vertical_width = 0;
- globals->standard_horizontal_width = 0;
- globals->scale_down_factor = 0;
- /* no need to free this one! */
- globals->glyph_styles = NULL;
- globals->face = NULL;
-
+ /* no need to free `globals->glyph_styles'; */
+ /* it is part of the `globals' array */
FT_FREE( globals );
}
}
@@ -465,7 +453,7 @@
[style_class->writing_system];
metrics = globals->metrics[style];
- if ( metrics == NULL )
+ if ( !metrics )
{
/* create the global metrics object if necessary */
FT_Memory memory = globals->face->memory;
diff --git a/thirdparty/freetype/src/autofit/afglobal.h b/thirdparty/freetype/src/autofit/afglobal.h
index ce6b9e8f26..de6142ea26 100644
--- a/thirdparty/freetype/src/autofit/afglobal.h
+++ b/thirdparty/freetype/src/autofit/afglobal.h
@@ -5,7 +5,7 @@
/* Auto-fitter routines to compute global hinting values */
/* (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afhints.c b/thirdparty/freetype/src/autofit/afhints.c
index 6c3d032d1c..f1ff0baef8 100644
--- a/thirdparty/freetype/src/autofit/afhints.c
+++ b/thirdparty/freetype/src/autofit/afhints.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -45,7 +45,7 @@
if ( axis->num_segments < AF_SEGMENTS_EMBEDDED )
{
- if ( axis->segments == NULL )
+ if ( !axis->segments )
{
axis->segments = axis->embedded.segments;
axis->max_segments = AF_SEGMENTS_EMBEDDED;
@@ -110,7 +110,7 @@
if ( axis->num_edges < AF_EDGES_EMBEDDED )
{
- if ( axis->edges == NULL )
+ if ( !axis->edges )
{
axis->edges = axis->embedded.edges;
axis->max_edges = AF_EDGES_EMBEDDED;
@@ -420,20 +420,19 @@
dimension == AF_DIMENSION_HORZ ? "vertical"
: "horizontal" ));
if ( axis->num_segments )
- AF_DUMP(( " index pos dir from to"
- " link serif edge"
+ AF_DUMP(( " index pos delta dir from to "
+ " link serif edge"
" height extra flags\n" ));
else
AF_DUMP(( " (none)\n" ));
for ( seg = segments; seg < limit; seg++ )
- AF_DUMP(( " %5d %5.2g %5s %4d %4d"
+ AF_DUMP(( " %5d %5d %5d %5s %4d %4d"
" %4s %5s %4s"
" %6d %5d %11s\n",
AF_INDEX_NUM( seg, segments ),
- dimension == AF_DIMENSION_HORZ
- ? (int)seg->first->ox / 64.0
- : (int)seg->first->oy / 64.0,
+ seg->pos,
+ seg->delta,
af_dir_str( (AF_Direction)seg->dir ),
AF_INDEX_NUM( seg->first, points ),
AF_INDEX_NUM( seg->last, points ),
@@ -553,18 +552,26 @@
* note: AF_DIMENSION_HORZ corresponds to _vertical_ edges
* since they have a constant X coordinate.
*/
- AF_DUMP(( "Table of %s edges:\n",
- dimension == AF_DIMENSION_HORZ ? "vertical"
- : "horizontal" ));
+ if ( dimension == AF_DIMENSION_HORZ )
+ AF_DUMP(( "Table of %s edges (1px=%.2fu, 10u=%.2fpx):\n",
+ "vertical",
+ 65536.0 * 64.0 / hints->x_scale,
+ 10.0 * hints->x_scale / 65536.0 / 64.0 ));
+ else
+ AF_DUMP(( "Table of %s edges (1px=%.2fu, 10u=%.2fpx):\n",
+ "horizontal",
+ 65536.0 * 64.0 / hints->y_scale,
+ 10.0 * hints->y_scale / 65536.0 / 64.0 ));
+
if ( axis->num_edges )
- AF_DUMP(( " index pos dir link serif"
- " blue opos pos flags\n" ));
+ AF_DUMP(( " index pos dir link serif"
+ " blue opos pos flags\n" ));
else
AF_DUMP(( " (none)\n" ));
for ( edge = edges; edge < limit; edge++ )
- AF_DUMP(( " %5d %5.2g %5s %4s %5s"
- " %c %5.2f %5.2f %11s\n",
+ AF_DUMP(( " %5d %7.2f %5s %4s %5s"
+ " %c %7.2f %7.2f %11s\n",
AF_INDEX_NUM( edge, edges ),
(int)edge->opos / 64.0,
af_dir_str( (AF_Direction)edge->dir ),
@@ -736,7 +743,7 @@
if ( new_max <= AF_CONTOURS_EMBEDDED )
{
- if ( hints->contours == NULL )
+ if ( !hints->contours )
{
hints->contours = hints->embedded.contours;
hints->max_contours = AF_CONTOURS_EMBEDDED;
@@ -765,7 +772,7 @@
if ( new_max <= AF_POINTS_EMBEDDED )
{
- if ( hints->points == NULL )
+ if ( !hints->points )
{
hints->points = hints->embedded.points;
hints->max_points = AF_POINTS_EMBEDDED;
@@ -1175,7 +1182,7 @@
AF_Point point, first, last;
- if ( edge == NULL )
+ if ( !edge )
continue;
first = seg->first;
@@ -1201,7 +1208,7 @@
AF_Point point, first, last;
- if ( edge == NULL )
+ if ( !edge )
continue;
first = seg->first;
diff --git a/thirdparty/freetype/src/autofit/afhints.h b/thirdparty/freetype/src/autofit/afhints.h
index 5142e6ed21..16638b1030 100644
--- a/thirdparty/freetype/src/autofit/afhints.h
+++ b/thirdparty/freetype/src/autofit/afhints.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -260,6 +260,7 @@ FT_BEGIN_HEADER
FT_Byte flags; /* edge/segment flags for this segment */
FT_Char dir; /* segment direction */
FT_Short pos; /* position of segment */
+ FT_Short delta; /* deviation from segment position */
FT_Short min_coord; /* minimum coordinate of segment */
FT_Short max_coord; /* maximum coordinate of segment */
FT_Short height; /* the hinted segment height */
diff --git a/thirdparty/freetype/src/autofit/afindic.c b/thirdparty/freetype/src/autofit/afindic.c
index 097a2b2995..23be46ed51 100644
--- a/thirdparty/freetype/src/autofit/afindic.c
+++ b/thirdparty/freetype/src/autofit/afindic.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for Indic writing system (body). */
/* */
-/* Copyright 2007-2016 by */
+/* Copyright 2007-2017 by */
/* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -18,13 +18,13 @@
#include "aftypes.h"
#include "aflatin.h"
+#include "afcjk.h"
#ifdef AF_CONFIG_OPTION_INDIC
#include "afindic.h"
#include "aferrors.h"
-#include "afcjk.h"
#ifdef AF_CONFIG_OPTION_USE_WARPER
@@ -121,13 +121,13 @@
sizeof ( AF_CJKMetricsRec ),
- (AF_WritingSystem_InitMetricsFunc) af_indic_metrics_init,
- (AF_WritingSystem_ScaleMetricsFunc)af_indic_metrics_scale,
- (AF_WritingSystem_DoneMetricsFunc) NULL,
- (AF_WritingSystem_GetStdWidthsFunc)af_indic_get_standard_widths,
+ (AF_WritingSystem_InitMetricsFunc) af_indic_metrics_init, /* style_metrics_init */
+ (AF_WritingSystem_ScaleMetricsFunc)af_indic_metrics_scale, /* style_metrics_scale */
+ (AF_WritingSystem_DoneMetricsFunc) NULL, /* style_metrics_done */
+ (AF_WritingSystem_GetStdWidthsFunc)af_indic_get_standard_widths, /* style_metrics_getstdw */
- (AF_WritingSystem_InitHintsFunc) af_indic_hints_init,
- (AF_WritingSystem_ApplyHintsFunc) af_indic_hints_apply
+ (AF_WritingSystem_InitHintsFunc) af_indic_hints_init, /* style_hints_init */
+ (AF_WritingSystem_ApplyHintsFunc) af_indic_hints_apply /* style_hints_apply */
)
@@ -141,13 +141,13 @@
sizeof ( AF_CJKMetricsRec ),
- (AF_WritingSystem_InitMetricsFunc) NULL,
- (AF_WritingSystem_ScaleMetricsFunc)NULL,
- (AF_WritingSystem_DoneMetricsFunc) NULL,
- (AF_WritingSystem_GetStdWidthsFunc)NULL,
+ (AF_WritingSystem_InitMetricsFunc) NULL, /* style_metrics_init */
+ (AF_WritingSystem_ScaleMetricsFunc)NULL, /* style_metrics_scale */
+ (AF_WritingSystem_DoneMetricsFunc) NULL, /* style_metrics_done */
+ (AF_WritingSystem_GetStdWidthsFunc)NULL, /* style_metrics_getstdw */
- (AF_WritingSystem_InitHintsFunc) NULL,
- (AF_WritingSystem_ApplyHintsFunc) NULL
+ (AF_WritingSystem_InitHintsFunc) NULL, /* style_hints_init */
+ (AF_WritingSystem_ApplyHintsFunc) NULL /* style_hints_apply */
)
diff --git a/thirdparty/freetype/src/autofit/afindic.h b/thirdparty/freetype/src/autofit/afindic.h
index 0772e07a29..ec9e263161 100644
--- a/thirdparty/freetype/src/autofit/afindic.h
+++ b/thirdparty/freetype/src/autofit/afindic.h
@@ -5,7 +5,7 @@
/* Auto-fitter hinting routines for Indic writing system */
/* (specification). */
/* */
-/* Copyright 2007-2016 by */
+/* Copyright 2007-2017 by */
/* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/aflatin.c b/thirdparty/freetype/src/autofit/aflatin.c
index 7ccf3f6e37..11fa523c83 100644
--- a/thirdparty/freetype/src/autofit/aflatin.c
+++ b/thirdparty/freetype/src/autofit/aflatin.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin writing system (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -265,6 +265,45 @@
}
+ static void
+ af_latin_sort_blue( FT_UInt count,
+ AF_LatinBlue* table )
+ {
+ FT_UInt i, j;
+ AF_LatinBlue swap;
+
+
+ /* we sort from bottom to top */
+ for ( i = 1; i < count; i++ )
+ {
+ for ( j = i; j > 0; j-- )
+ {
+ FT_Pos a, b;
+
+
+ if ( table[j - 1]->flags & ( AF_LATIN_BLUE_TOP |
+ AF_LATIN_BLUE_SUB_TOP ) )
+ a = table[j - 1]->ref.org;
+ else
+ a = table[j - 1]->shoot.org;
+
+ if ( table[j]->flags & ( AF_LATIN_BLUE_TOP |
+ AF_LATIN_BLUE_SUB_TOP ) )
+ b = table[j]->ref.org;
+ else
+ b = table[j]->shoot.org;
+
+ if ( b >= a )
+ break;
+
+ swap = table[j];
+ table[j] = table[j - 1];
+ table[j - 1] = swap;
+ }
+ }
+ }
+
+
/* Find all blue zones. Flat segments give the reference points, */
/* round segments the overshoot positions. */
@@ -928,6 +967,60 @@
af_shaper_buf_destroy( face, shaper_buf );
+ /* we finally check whether blue zones are ordered; */
+ /* `ref' and `shoot' values of two blue zones must not overlap */
+ if ( axis->blue_count )
+ {
+ FT_UInt i;
+ AF_LatinBlue blue_sorted[AF_BLUE_STRINGSET_MAX_LEN + 2];
+
+
+ for ( i = 0; i < axis->blue_count; i++ )
+ blue_sorted[i] = &axis->blues[i];
+
+ /* sort bottoms of blue zones... */
+ af_latin_sort_blue( axis->blue_count, blue_sorted );
+
+ /* ...and adjust top values if necessary */
+ for ( i = 0; i < axis->blue_count - 1; i++ )
+ {
+ FT_Pos* a;
+ FT_Pos* b;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_Bool a_is_top = 0;
+#endif
+
+
+ if ( blue_sorted[i]->flags & ( AF_LATIN_BLUE_TOP |
+ AF_LATIN_BLUE_SUB_TOP ) )
+ {
+ a = &blue_sorted[i]->shoot.org;
+#ifdef FT_DEBUG_LEVEL_TRACE
+ a_is_top = 1;
+#endif
+ }
+ else
+ a = &blue_sorted[i]->ref.org;
+
+ if ( blue_sorted[i + 1]->flags & ( AF_LATIN_BLUE_TOP |
+ AF_LATIN_BLUE_SUB_TOP ) )
+ b = &blue_sorted[i + 1]->shoot.org;
+ else
+ b = &blue_sorted[i + 1]->ref.org;
+
+ if ( *a > *b )
+ {
+ *a = *b;
+ FT_TRACE5(( "blue zone overlap:"
+ " adjusting %s %d to %ld\n",
+ a_is_top ? "overshoot" : "reference",
+ blue_sorted[i] - axis->blues,
+ *a ));
+ }
+ }
+ }
+
FT_TRACE5(( "\n" ));
return;
@@ -941,7 +1034,7 @@
FT_Face face )
{
FT_Bool started = 0, same_width = 1;
- FT_Fixed advance, old_advance = 0;
+ FT_Fixed advance = 0, old_advance = 0;
void* shaper_buf;
@@ -1076,7 +1169,7 @@
FT_UInt ppem;
- scaled = FT_MulFix( blue->shoot.org, scaler->y_scale );
+ scaled = FT_MulFix( blue->shoot.org, scale );
ppem = metrics->root.scaler.face->size->metrics.x_ppem;
limit = metrics->root.globals->increase_x_height;
threshold = 40;
@@ -1123,18 +1216,18 @@
if ( dist == 0 )
{
- scale = new_scale;
-
FT_TRACE5((
"af_latin_metrics_scale_dim:"
" x height alignment (style `%s'):\n"
" "
- " vertical scaling changed from %.4f to %.4f (by %d%%)\n"
+ " vertical scaling changed from %.5f to %.5f (by %d%%)\n"
"\n",
af_style_names[metrics->root.style_class->style],
- axis->org_scale / 65536.0,
scale / 65536.0,
+ new_scale / 65536.0,
( fitted - scaled ) * 100 / scaled ));
+
+ scale = new_scale;
}
#ifdef FT_DEBUG_LEVEL_TRACE
else
@@ -1536,8 +1629,9 @@
/* points are different: we are just leaving an edge, thus */
/* record a new segment */
- segment->last = point;
- segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 );
+ segment->last = point;
+ segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 );
+ segment->delta = (FT_Short)( ( max_pos - min_pos ) >> 1 );
/* a segment is round if either its first or last point */
/* is a control point, and the length of the on points */
@@ -1950,6 +2044,10 @@
FT_Memory memory = hints->memory;
AF_LatinAxis laxis = &((AF_LatinMetrics)hints->metrics)->axis[dim];
+#ifdef FT_CONFIG_OPTION_PIC
+ AF_FaceGlobals globals = hints->metrics->globals;
+#endif
+
AF_StyleClass style_class = hints->metrics->style_class;
AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
[style_class->script];
@@ -1966,6 +2064,7 @@
FT_Fixed scale;
FT_Pos edge_distance_threshold;
FT_Pos segment_length_threshold;
+ FT_Pos segment_width_threshold;
axis->num_edges = 0;
@@ -1987,9 +2086,15 @@
* corresponding threshold in font units.
*/
if ( dim == AF_DIMENSION_HORZ )
- segment_length_threshold = FT_DivFix( 64, hints->y_scale );
+ segment_length_threshold = FT_DivFix( 64, hints->y_scale );
else
- segment_length_threshold = 0;
+ segment_length_threshold = 0;
+
+ /*
+ * Similarly, we ignore segments that have a width delta
+ * larger than 0.5px (i.e., a width larger than 1px).
+ */
+ segment_width_threshold = FT_DivFix( 32, scale );
/*********************************************************************/
/* */
@@ -2022,9 +2127,10 @@
FT_Int ee;
- /* ignore too short segments and, in this loop, */
- /* one-point segments without a direction */
+ /* ignore too short segments, too wide ones, and, in this loop, */
+ /* one-point segments without a direction */
if ( seg->height < segment_length_threshold ||
+ seg->delta > segment_width_threshold ||
seg->dir == AF_DIR_NONE )
continue;
@@ -2202,7 +2308,7 @@
seg->serif->edge &&
seg->serif->edge != edge );
- if ( ( seg->link && seg->link->edge != NULL ) || is_serif )
+ if ( ( seg->link && seg->link->edge ) || is_serif )
{
AF_Edge edge2;
AF_Segment seg2;
@@ -2469,23 +2575,23 @@
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
/*
- * We adjust stems to full pixels only if we don't use the `light' mode.
+ * We adjust stems to full pixels unless in `light' or `lcd' mode.
*/
- if ( mode != FT_RENDER_MODE_LIGHT )
+ if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
if ( mode == FT_RENDER_MODE_MONO )
other_flags |= AF_LATIN_HINTS_MONO;
/*
- * In `light' hinting mode we disable horizontal hinting completely.
+ * In `light' or `lcd' mode we disable horizontal hinting completely.
* We also do it if the face is italic.
*
* However, if warping is enabled (which only works in `light' hinting
* mode), advance widths get adjusted, too.
*/
- if ( mode == FT_RENDER_MODE_LIGHT ||
- ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
+ if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
+ ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
#ifdef AF_CONFIG_OPTION_USE_WARPER
@@ -2825,6 +2931,10 @@
AF_Edge anchor = NULL;
FT_Int has_serifs = 0;
+#ifdef FT_CONFIG_OPTION_PIC
+ AF_FaceGlobals globals = hints->metrics->globals;
+#endif
+
AF_StyleClass style_class = hints->metrics->style_class;
AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
[style_class->script];
@@ -3468,13 +3578,13 @@
sizeof ( AF_LatinMetricsRec ),
- (AF_WritingSystem_InitMetricsFunc) af_latin_metrics_init,
- (AF_WritingSystem_ScaleMetricsFunc)af_latin_metrics_scale,
- (AF_WritingSystem_DoneMetricsFunc) NULL,
- (AF_WritingSystem_GetStdWidthsFunc)af_latin_get_standard_widths,
+ (AF_WritingSystem_InitMetricsFunc) af_latin_metrics_init, /* style_metrics_init */
+ (AF_WritingSystem_ScaleMetricsFunc)af_latin_metrics_scale, /* style_metrics_scale */
+ (AF_WritingSystem_DoneMetricsFunc) NULL, /* style_metrics_done */
+ (AF_WritingSystem_GetStdWidthsFunc)af_latin_get_standard_widths, /* style_metrics_getstdw */
- (AF_WritingSystem_InitHintsFunc) af_latin_hints_init,
- (AF_WritingSystem_ApplyHintsFunc) af_latin_hints_apply
+ (AF_WritingSystem_InitHintsFunc) af_latin_hints_init, /* style_hints_init */
+ (AF_WritingSystem_ApplyHintsFunc) af_latin_hints_apply /* style_hints_apply */
)
diff --git a/thirdparty/freetype/src/autofit/aflatin.h b/thirdparty/freetype/src/autofit/aflatin.h
index fe6bbd801a..d80e125ddc 100644
--- a/thirdparty/freetype/src/autofit/aflatin.h
+++ b/thirdparty/freetype/src/autofit/aflatin.h
@@ -5,7 +5,7 @@
/* Auto-fitter hinting routines for latin writing system */
/* (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/aflatin2.c b/thirdparty/freetype/src/autofit/aflatin2.c
index 5db4a41141..0607278b1e 100644
--- a/thirdparty/freetype/src/autofit/aflatin2.c
+++ b/thirdparty/freetype/src/autofit/aflatin2.c
@@ -9,7 +9,7 @@
/* */
/* Auto-fitter hinting routines for latin writing system (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -23,6 +23,9 @@
#include FT_ADVANCES_H
+
+#ifdef FT_OPTION_AUTOFIT2
+
#include "afglobal.h"
#include "aflatin.h"
#include "aflatin2.h"
@@ -1303,7 +1306,7 @@
seg->serif->edge &&
seg->serif->edge != edge );
- if ( ( seg->link && seg->link->edge != NULL ) || is_serif )
+ if ( ( seg->link && seg->link->edge ) || is_serif )
{
AF_Edge edge2;
AF_Segment seg2;
@@ -1555,20 +1558,20 @@
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
/*
- * We adjust stems to full pixels only if we don't use the `light' mode.
+ * We adjust stems to full pixels unless in `light' or `lcd' mode.
*/
- if ( mode != FT_RENDER_MODE_LIGHT )
+ if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
if ( mode == FT_RENDER_MODE_MONO )
other_flags |= AF_LATIN_HINTS_MONO;
/*
- * In `light' hinting mode we disable horizontal hinting completely.
+ * In `light' or `lcd' mode we disable horizontal hinting completely.
* We also do it if the face is italic.
*/
- if ( mode == FT_RENDER_MODE_LIGHT ||
- ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
+ if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
+ ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
#ifdef AF_CONFIG_OPTION_USE_WARPER
@@ -2410,14 +2413,21 @@
sizeof ( AF_LatinMetricsRec ),
- (AF_WritingSystem_InitMetricsFunc) af_latin2_metrics_init,
- (AF_WritingSystem_ScaleMetricsFunc)af_latin2_metrics_scale,
- (AF_WritingSystem_DoneMetricsFunc) NULL,
- (AF_WritingSystem_GetStdWidthsFunc)af_latin2_get_standard_widths,
+ (AF_WritingSystem_InitMetricsFunc) af_latin2_metrics_init, /* style_metrics_init */
+ (AF_WritingSystem_ScaleMetricsFunc)af_latin2_metrics_scale, /* style_metrics_scale */
+ (AF_WritingSystem_DoneMetricsFunc) NULL, /* style_metrics_done */
+ (AF_WritingSystem_GetStdWidthsFunc)af_latin2_get_standard_widths, /* style_metrics_getstdw */
- (AF_WritingSystem_InitHintsFunc) af_latin2_hints_init,
- (AF_WritingSystem_ApplyHintsFunc) af_latin2_hints_apply
+ (AF_WritingSystem_InitHintsFunc) af_latin2_hints_init, /* style_hints_init */
+ (AF_WritingSystem_ApplyHintsFunc) af_latin2_hints_apply /* style_hints_apply */
)
+#else /* !FT_OPTION_AUTOFIT2 */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _af_latin2_dummy;
+
+#endif /* !FT_OPTION_AUTOFIT2 */
+
/* END */
diff --git a/thirdparty/freetype/src/autofit/aflatin2.h b/thirdparty/freetype/src/autofit/aflatin2.h
index f83f704289..2d0b154f58 100644
--- a/thirdparty/freetype/src/autofit/aflatin2.h
+++ b/thirdparty/freetype/src/autofit/aflatin2.h
@@ -10,7 +10,7 @@
/* Auto-fitter hinting routines for latin writing system */
/* (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afloader.c b/thirdparty/freetype/src/autofit/afloader.c
index 26bba065bb..78c4368b61 100644
--- a/thirdparty/freetype/src/autofit/afloader.c
+++ b/thirdparty/freetype/src/autofit/afloader.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter glyph loading routines (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -51,7 +51,7 @@
loader->face = face;
loader->globals = (AF_FaceGlobals)face->autohint.data;
- if ( loader->globals == NULL )
+ if ( !loader->globals )
{
error = af_face_globals_new( face, &loader->globals, module );
if ( !error )
@@ -86,169 +86,316 @@
( (FT_Fixed)( (f) * 65536.0 + 0.5 ) )
- /* Do the main work of `af_loader_load_glyph'. Note that we never */
- /* have to deal with composite glyphs as those get loaded into */
- /* FT_GLYPH_FORMAT_OUTLINE by the recursed `FT_Load_Glyph' function. */
- /* In the rare cases where FT_LOAD_NO_RECURSE is set, it implies */
- /* FT_LOAD_NO_SCALE and as such the auto-hinter is never called. */
-
static FT_Error
- af_loader_load_g( AF_Loader loader,
- AF_Scaler scaler,
- FT_UInt glyph_index,
- FT_Int32 load_flags )
+ af_loader_embolden_glyph_in_slot( AF_Loader loader,
+ FT_Face face,
+ AF_StyleMetrics style_metrics )
{
- AF_Module module = loader->globals->module;
+ FT_Error error = FT_Err_Ok;
- FT_Error error;
- FT_Face face = loader->face;
- AF_StyleMetrics metrics = loader->metrics;
- AF_GlyphHints hints = loader->hints;
- FT_GlyphSlot slot = face->glyph;
- FT_Slot_Internal internal = slot->internal;
- FT_GlyphLoader gloader = internal->loader;
- FT_Int32 flags;
+ FT_GlyphSlot slot = face->glyph;
+ AF_FaceGlobals globals = loader->globals;
+ AF_WritingSystemClass writing_system_class;
+ FT_Size_Metrics* size_metrics = &face->size->internal->autohint_metrics;
- flags = load_flags | FT_LOAD_LINEAR_DESIGN;
- error = FT_Load_Glyph( face, glyph_index, flags );
- if ( error )
+ FT_Pos stdVW = 0;
+ FT_Pos stdHW = 0;
+
+ FT_Bool size_changed = size_metrics->x_ppem !=
+ globals->stem_darkening_for_ppem;
+
+ FT_Fixed em_size = af_intToFixed( face->units_per_EM );
+ FT_Fixed em_ratio = FT_DivFix( af_intToFixed( 1000 ), em_size );
+
+ FT_Matrix scale_down_matrix = { 0x10000L, 0, 0, 0x10000L };
+
+
+ /* Skip stem darkening for broken fonts. */
+ if ( !face->units_per_EM )
+ {
+ error = FT_ERR( Corrupted_Font_Header );
goto Exit;
+ }
/*
- * Apply stem darkening (emboldening) here before hints are applied to
- * the outline. Glyphs are scaled down proportionally to the
- * emboldening so that curve points don't fall outside their precomputed
- * blue zones.
- *
- * Any emboldening done by the font driver (e.g., the CFF driver)
- * doesn't reach here because the autohinter loads the unprocessed
- * glyphs in font units for analysis (functions `af_*_metrics_init_*')
- * and then above to prepare it for the rasterizers by itself,
- * independently of the font driver. So emboldening must be done here,
- * within the autohinter.
- *
- * All glyphs to be autohinted pass through here one by one. The
- * standard widths can therefore change from one glyph to the next,
- * depending on what script a glyph is assigned to (each script has its
- * own set of standard widths and other metrics). The darkening amount
- * must therefore be recomputed for each size and
- * `standard_{vertical,horizontal}_width' change.
+ * We depend on the writing system (script analyzers) to supply
+ * standard widths for the script of the glyph we are looking at. If
+ * it can't deliver, stem darkening is disabled.
*/
- if ( !module->no_stem_darkening )
+ writing_system_class =
+ AF_WRITING_SYSTEM_CLASSES_GET[style_metrics->style_class->writing_system];
+
+ if ( writing_system_class->style_metrics_getstdw )
+ writing_system_class->style_metrics_getstdw( style_metrics,
+ &stdHW,
+ &stdVW );
+ else
{
- AF_FaceGlobals globals = loader->globals;
- AF_WritingSystemClass writing_system_class;
+ error = FT_ERR( Unimplemented_Feature );
+ goto Exit;
+ }
- FT_Pos stdVW = 0;
- FT_Pos stdHW = 0;
+ if ( size_changed ||
+ ( stdVW > 0 && stdVW != globals->standard_vertical_width ) )
+ {
+ FT_Fixed darken_by_font_units_x, darken_x;
- FT_Bool size_changed = face->size->metrics.x_ppem
- != globals->stem_darkening_for_ppem;
- FT_Fixed em_size = af_intToFixed( face->units_per_EM );
- FT_Fixed em_ratio = FT_DivFix( af_intToFixed( 1000 ), em_size );
+ darken_by_font_units_x =
+ af_intToFixed( af_loader_compute_darkening( loader,
+ face,
+ stdVW ) );
+ darken_x = FT_DivFix( FT_MulFix( darken_by_font_units_x,
+ size_metrics->x_scale ),
+ em_ratio );
- FT_Matrix scale_down_matrix = { 0x10000L, 0, 0, 0x10000L };
+ globals->standard_vertical_width = stdVW;
+ globals->stem_darkening_for_ppem = size_metrics->x_ppem;
+ globals->darken_x = af_fixedToInt( darken_x );
+ }
+ if ( size_changed ||
+ ( stdHW > 0 && stdHW != globals->standard_horizontal_width ) )
+ {
+ FT_Fixed darken_by_font_units_y, darken_y;
+
+
+ darken_by_font_units_y =
+ af_intToFixed( af_loader_compute_darkening( loader,
+ face,
+ stdHW ) );
+ darken_y = FT_DivFix( FT_MulFix( darken_by_font_units_y,
+ size_metrics->y_scale ),
+ em_ratio );
- /* Skip stem darkening for broken fonts. */
- if ( !face->units_per_EM )
- goto After_Emboldening;
+ globals->standard_horizontal_width = stdHW;
+ globals->stem_darkening_for_ppem = size_metrics->x_ppem;
+ globals->darken_y = af_fixedToInt( darken_y );
/*
- * We depend on the writing system (script analyzers) to supply
- * standard widths for the script of the glyph we are looking at. If
- * it can't deliver, stem darkening is effectively disabled.
+ * Scale outlines down on the Y-axis to keep them inside their blue
+ * zones. The stronger the emboldening, the stronger the downscaling
+ * (plus heuristical padding to prevent outlines still falling out
+ * their zones due to rounding).
+ *
+ * Reason: `FT_Outline_Embolden' works by shifting the rightmost
+ * points of stems farther to the right, and topmost points farther
+ * up. This positions points on the Y-axis outside their
+ * pre-computed blue zones and leads to distortion when applying the
+ * hints in the code further below. Code outside this emboldening
+ * block doesn't know we are presenting it with modified outlines the
+ * analyzer didn't see!
+ *
+ * An unfortunate side effect of downscaling is that the emboldening
+ * effect is slightly decreased. The loss becomes more pronounced
+ * versus the CFF driver at smaller sizes, e.g., at 9ppem and below.
*/
- writing_system_class =
- AF_WRITING_SYSTEM_CLASSES_GET[metrics->style_class->writing_system];
+ globals->scale_down_factor =
+ FT_DivFix( em_size - ( darken_by_font_units_y + af_intToFixed( 8 ) ),
+ em_size );
+ }
- if ( writing_system_class->style_metrics_getstdw )
- writing_system_class->style_metrics_getstdw( metrics,
- &stdHW,
- &stdVW );
- else
- goto After_Emboldening;
+ FT_Outline_EmboldenXY( &slot->outline,
+ globals->darken_x,
+ globals->darken_y );
+ scale_down_matrix.yy = globals->scale_down_factor;
+ FT_Outline_Transform( &slot->outline, &scale_down_matrix );
- if ( size_changed ||
- ( stdVW > 0 && stdVW != globals->standard_vertical_width ) )
- {
- FT_Fixed darken_by_font_units_x, darken_x;
+ Exit:
+ return error;
+ }
- darken_by_font_units_x =
- af_intToFixed( af_loader_compute_darkening( loader,
- face,
- stdVW ) );
- darken_x = FT_DivFix( FT_MulFix( darken_by_font_units_x,
- face->size->metrics.x_scale ),
- em_ratio );
+ /* Load the glyph at index into the current slot of a face and hint it. */
- globals->standard_vertical_width = stdVW;
- globals->stem_darkening_for_ppem = face->size->metrics.x_ppem;
- globals->darken_x = af_fixedToInt( darken_x );
- }
+ FT_LOCAL_DEF( FT_Error )
+ af_loader_load_glyph( AF_Loader loader,
+ AF_Module module,
+ FT_Face face,
+ FT_UInt glyph_index,
+ FT_Int32 load_flags )
+ {
+ FT_Error error;
+
+ FT_Size size = face->size;
+ FT_Size_Internal size_internal = size->internal;
+ FT_GlyphSlot slot = face->glyph;
+ FT_Slot_Internal slot_internal = slot->internal;
+ FT_GlyphLoader gloader = slot_internal->loader;
+
+ AF_GlyphHints hints = loader->hints;
+ AF_ScalerRec scaler;
+ AF_StyleMetrics style_metrics;
+ FT_UInt style_options = AF_STYLE_NONE_DFLT;
+ AF_StyleClass style_class;
+ AF_WritingSystemClass writing_system_class;
- if ( size_changed ||
- ( stdHW > 0 && stdHW != globals->standard_horizontal_width ) )
+#ifdef FT_CONFIG_OPTION_PIC
+ AF_FaceGlobals globals = loader->globals;
+#endif
+
+
+ if ( !size )
+ return FT_THROW( Invalid_Size_Handle );
+
+ FT_ZERO( &scaler );
+
+ if ( !size_internal->autohint_metrics.x_scale ||
+ size_internal->autohint_mode != FT_LOAD_TARGET_MODE( load_flags ) )
+ {
+ /* switching between hinting modes usually means different scaling */
+ /* values; this later on enforces recomputation of everything */
+ /* related to the current size */
+
+ size_internal->autohint_mode = FT_LOAD_TARGET_MODE( load_flags );
+ size_internal->autohint_metrics = size->metrics;
+
+#ifdef AF_CONFIG_OPTION_TT_SIZE_METRICS
{
- FT_Fixed darken_by_font_units_y, darken_y;
-
-
- darken_by_font_units_y =
- af_intToFixed( af_loader_compute_darkening( loader,
- face,
- stdHW ) );
- darken_y = FT_DivFix( FT_MulFix( darken_by_font_units_y,
- face->size->metrics.y_scale ),
- em_ratio );
-
- globals->standard_horizontal_width = stdHW;
- globals->stem_darkening_for_ppem = face->size->metrics.x_ppem;
- globals->darken_y = af_fixedToInt( darken_y );
-
- /*
- * Scale outlines down on the Y-axis to keep them inside their blue
- * zones. The stronger the emboldening, the stronger the
- * downscaling (plus heuristical padding to prevent outlines still
- * falling out their zones due to rounding).
- *
- * Reason: `FT_Outline_Embolden' works by shifting the rightmost
- * points of stems farther to the right, and topmost points farther
- * up. This positions points on the Y-axis outside their
- * pre-computed blue zones and leads to distortion when applying the
- * hints in the code further below. Code outside this emboldening
- * block doesn't know we are presenting it with modified outlines
- * the analyzer didn't see!
- *
- * An unfortunate side effect of downscaling is that the emboldening
- * effect is slightly decreased. The loss becomes more pronounced
- * versus the CFF driver at smaller sizes, e.g., at 9ppem and below.
- */
- globals->scale_down_factor =
- FT_DivFix( em_size - ( darken_by_font_units_y + af_intToFixed( 8 ) ),
- em_size );
+ FT_Size_Metrics* size_metrics = &size_internal->autohint_metrics;
+
+
+ /* set metrics to integer values and adjust scaling accordingly; */
+ /* this is the same setup as with TrueType fonts, cf. function */
+ /* `tt_size_reset' in file `ttobjs.c' */
+ size_metrics->ascender = FT_PIX_ROUND(
+ FT_MulFix( face->ascender,
+ size_metrics->y_scale ) );
+ size_metrics->descender = FT_PIX_ROUND(
+ FT_MulFix( face->descender,
+ size_metrics->y_scale ) );
+ size_metrics->height = FT_PIX_ROUND(
+ FT_MulFix( face->height,
+ size_metrics->y_scale ) );
+
+ size_metrics->x_scale = FT_DivFix( size_metrics->x_ppem << 6,
+ face->units_per_EM );
+ size_metrics->y_scale = FT_DivFix( size_metrics->y_ppem << 6,
+ face->units_per_EM );
+ size_metrics->max_advance = FT_PIX_ROUND(
+ FT_MulFix( face->max_advance_width,
+ size_metrics->x_scale ) );
}
+#endif /* AF_CONFIG_OPTION_TT_SIZE_METRICS */
+ }
+
+ /*
+ * TODO: This code currently doesn't support fractional advance widths,
+ * i.e., placing hinted glyphs at anything other than integer
+ * x-positions. This is only relevant for the warper code, which
+ * scales and shifts glyphs to optimize blackness of stems (hinting on
+ * the x-axis by nature places things on pixel integers, hinting on the
+ * y-axis only, i.e., LIGHT mode, doesn't touch the x-axis). The delta
+ * values of the scaler would need to be adjusted.
+ */
+ scaler.face = face;
+ scaler.x_scale = size_internal->autohint_metrics.x_scale;
+ scaler.x_delta = 0;
+ scaler.y_scale = size_internal->autohint_metrics.y_scale;
+ scaler.y_delta = 0;
+
+ scaler.render_mode = FT_LOAD_TARGET_MODE( load_flags );
+ scaler.flags = 0;
+
+ /* note that the fallback style can't be changed anymore */
+ /* after the first call of `af_loader_load_glyph' */
+ error = af_loader_reset( loader, module, face );
+ if ( error )
+ goto Exit;
+
+#ifdef FT_OPTION_AUTOFIT2
+ /* XXX: undocumented hook to activate the latin2 writing system. */
+ if ( load_flags & ( 1UL << 20 ) )
+ style_options = AF_STYLE_LTN2_DFLT;
+#endif
+
+ /*
+ * Glyphs (really code points) are assigned to scripts. Script
+ * analysis is done lazily: For each glyph that passes through here,
+ * the corresponding script analyzer is called, but returns immediately
+ * if it has been run already.
+ */
+ error = af_face_globals_get_metrics( loader->globals, glyph_index,
+ style_options, &style_metrics );
+ if ( error )
+ goto Exit;
+
+ style_class = style_metrics->style_class;
+ writing_system_class =
+ AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
- FT_Outline_EmboldenXY( &slot->outline,
- globals->darken_x,
- globals->darken_y );
+ loader->metrics = style_metrics;
- scale_down_matrix.yy = globals->scale_down_factor;
- FT_Outline_Transform( &slot->outline, &scale_down_matrix );
+ if ( writing_system_class->style_metrics_scale )
+ writing_system_class->style_metrics_scale( style_metrics, &scaler );
+ else
+ style_metrics->scaler = scaler;
+
+ if ( writing_system_class->style_hints_init )
+ {
+ error = writing_system_class->style_hints_init( hints,
+ style_metrics );
+ if ( error )
+ goto Exit;
}
- After_Emboldening:
- loader->transformed = internal->glyph_transformed;
+ /*
+ * Do the main work of `af_loader_load_glyph'. Note that we never have
+ * to deal with composite glyphs as those get loaded into
+ * FT_GLYPH_FORMAT_OUTLINE by the recursed `FT_Load_Glyph' function.
+ * In the rare cases where FT_LOAD_NO_RECURSE is set, it implies
+ * FT_LOAD_NO_SCALE and as such the auto-hinter is never called.
+ */
+ load_flags |= FT_LOAD_NO_SCALE |
+ FT_LOAD_IGNORE_TRANSFORM |
+ FT_LOAD_LINEAR_DESIGN;
+ load_flags &= ~FT_LOAD_RENDER;
+
+ error = FT_Load_Glyph( face, glyph_index, load_flags );
+ if ( error )
+ goto Exit;
+
+ /*
+ * Apply stem darkening (emboldening) here before hints are applied to
+ * the outline. Glyphs are scaled down proportionally to the
+ * emboldening so that curve points don't fall outside their
+ * precomputed blue zones.
+ *
+ * Any emboldening done by the font driver (e.g., the CFF driver)
+ * doesn't reach here because the autohinter loads the unprocessed
+ * glyphs in font units for analysis (functions `af_*_metrics_init_*')
+ * and then above to prepare it for the rasterizers by itself,
+ * independently of the font driver. So emboldening must be done here,
+ * within the autohinter.
+ *
+ * All glyphs to be autohinted pass through here one by one. The
+ * standard widths can therefore change from one glyph to the next,
+ * depending on what script a glyph is assigned to (each script has its
+ * own set of standard widths and other metrics). The darkening amount
+ * must therefore be recomputed for each size and
+ * `standard_{vertical,horizontal}_width' change.
+ *
+ * Ignore errors and carry on without emboldening.
+ *
+ */
+
+ /* stem darkening only works well in `light' mode */
+ if ( scaler.render_mode == FT_RENDER_MODE_LIGHT &&
+ ( !face->internal->no_stem_darkening ||
+ ( face->internal->no_stem_darkening < 0 &&
+ !module->no_stem_darkening ) ) )
+ af_loader_embolden_glyph_in_slot( loader, face, style_metrics );
+
+ loader->transformed = slot_internal->glyph_transformed;
if ( loader->transformed )
{
FT_Matrix inverse;
- loader->trans_matrix = internal->glyph_matrix;
- loader->trans_delta = internal->glyph_delta;
+ loader->trans_matrix = slot_internal->glyph_matrix;
+ loader->trans_delta = slot_internal->glyph_delta;
inverse = loader->trans_matrix;
if ( !FT_Matrix_Invert( &inverse ) )
@@ -264,8 +411,8 @@
loader->trans_delta.x,
loader->trans_delta.y );
- /* compute original horizontal phantom points (and ignore */
- /* vertical ones) */
+ /* compute original horizontal phantom points */
+ /* (and ignore vertical ones) */
loader->pp1.x = hints->x_delta;
loader->pp1.y = hints->y_delta;
loader->pp2.x = FT_MulFix( slot->metrics.horiAdvance,
@@ -276,30 +423,21 @@
if ( slot->outline.n_points == 0 )
goto Hint_Metrics;
- /* now load the slot image into the auto-outline and run the */
- /* automatic hinting process */
- {
-#ifdef FT_CONFIG_OPTION_PIC
- AF_FaceGlobals globals = loader->globals;
-#endif
- AF_StyleClass style_class = metrics->style_class;
- AF_WritingSystemClass writing_system_class =
- AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
-
-
- if ( writing_system_class->style_hints_apply )
- writing_system_class->style_hints_apply( glyph_index,
- hints,
- &gloader->base.outline,
- metrics );
- }
+ /* now load the slot image into the auto-outline */
+ /* and run the automatic hinting process */
+ if ( writing_system_class->style_hints_apply )
+ writing_system_class->style_hints_apply( glyph_index,
+ hints,
+ &gloader->base.outline,
+ style_metrics );
/* we now need to adjust the metrics according to the change in */
/* width/positioning that occurred during the hinting process */
- if ( scaler->render_mode != FT_RENDER_MODE_LIGHT )
+ if ( scaler.render_mode != FT_RENDER_MODE_LIGHT )
{
- FT_Pos old_rsb, old_lsb, new_lsb;
- FT_Pos pp1x_uh, pp2x_uh;
+ FT_Pos old_rsb, old_lsb, new_lsb;
+ FT_Pos pp1x_uh, pp2x_uh;
+
AF_AxisHints axis = &hints->axis[AF_DIMENSION_HORZ];
AF_Edge edge1 = axis->edges; /* leftmost edge */
AF_Edge edge2 = edge1 +
@@ -309,12 +447,12 @@
if ( axis->num_edges > 1 && AF_HINTS_DO_ADVANCE( hints ) )
{
old_rsb = loader->pp2.x - edge2->opos;
- old_lsb = edge1->opos;
+ /* loader->pp1.x is always zero at this point of time */
+ old_lsb = edge1->opos /* - loader->pp1.x */;
new_lsb = edge1->pos;
/* remember unhinted values to later account */
/* for rounding errors */
-
pp1x_uh = new_lsb - old_lsb;
pp2x_uh = edge2->pos + old_rsb;
@@ -352,6 +490,8 @@
slot->rsb_delta = loader->pp2.x - pp2x;
}
}
+ /* `light' mode uses integer advance widths */
+ /* but sets `lsb_delta' and `rsb_delta' */
else
{
FT_Pos pp1x = loader->pp1.x;
@@ -380,8 +520,8 @@
vvector.x = slot->metrics.vertBearingX - slot->metrics.horiBearingX;
vvector.y = slot->metrics.vertBearingY - slot->metrics.horiBearingY;
- vvector.x = FT_MulFix( vvector.x, metrics->scaler.x_scale );
- vvector.y = FT_MulFix( vvector.y, metrics->scaler.y_scale );
+ vvector.x = FT_MulFix( vvector.x, style_metrics->scaler.x_scale );
+ vvector.y = FT_MulFix( vvector.y, style_metrics->scaler.y_scale );
/* transform the hinted outline if needed */
if ( loader->transformed )
@@ -389,12 +529,12 @@
FT_Outline_Transform( &gloader->base.outline, &loader->trans_matrix );
FT_Vector_Transform( &vvector, &loader->trans_matrix );
}
-#if 1
+
/* we must translate our final outline by -pp1.x and compute */
/* the new metrics */
if ( loader->pp1.x )
FT_Outline_Translate( &gloader->base.outline, -loader->pp1.x, 0 );
-#endif
+
FT_Outline_Get_CBox( &gloader->base.outline, &bbox );
bbox.xMin = FT_PIX_FLOOR( bbox.xMin );
@@ -413,20 +553,14 @@
/* for mono-width fonts (like Andale, Courier, etc.) we need */
/* to keep the original rounded advance width; ditto for */
/* digits if all have the same advance width */
-#if 0
- if ( !FT_IS_FIXED_WIDTH( slot->face ) )
- slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
- else
- slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
- x_scale );
-#else
- if ( scaler->render_mode != FT_RENDER_MODE_LIGHT &&
+ if ( scaler.render_mode != FT_RENDER_MODE_LIGHT &&
( FT_IS_FIXED_WIDTH( slot->face ) ||
( af_face_globals_is_digit( loader->globals, glyph_index ) &&
- metrics->digits_have_same_width ) ) )
+ style_metrics->digits_have_same_width ) ) )
{
- slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
- metrics->scaler.x_scale );
+ slot->metrics.horiAdvance =
+ FT_MulFix( slot->metrics.horiAdvance,
+ style_metrics->scaler.x_scale );
/* Set delta values to 0. Otherwise code that uses them is */
/* going to ruin the fixed advance width. */
@@ -439,23 +573,13 @@
if ( slot->metrics.horiAdvance )
slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
}
-#endif
slot->metrics.vertAdvance = FT_MulFix( slot->metrics.vertAdvance,
- metrics->scaler.y_scale );
+ style_metrics->scaler.y_scale );
slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );
-#if 0
- /* reassign all outline fields except flags to protect them */
- slot->outline.n_contours = internal->loader->base.outline.n_contours;
- slot->outline.n_points = internal->loader->base.outline.n_points;
- slot->outline.points = internal->loader->base.outline.points;
- slot->outline.tags = internal->loader->base.outline.tags;
- slot->outline.contours = internal->loader->base.outline.contours;
-#endif
-
slot->format = FT_GLYPH_FORMAT_OUTLINE;
}
@@ -464,85 +588,6 @@
}
- /* Load a glyph. */
-
- FT_LOCAL_DEF( FT_Error )
- af_loader_load_glyph( AF_Loader loader,
- AF_Module module,
- FT_Face face,
- FT_UInt gindex,
- FT_Int32 load_flags )
- {
- FT_Error error;
- FT_Size size = face->size;
- AF_ScalerRec scaler;
-
-
- if ( !size )
- return FT_THROW( Invalid_Size_Handle );
-
- FT_ZERO( &scaler );
-
- scaler.face = face;
- scaler.x_scale = size->metrics.x_scale;
- scaler.x_delta = 0; /* XXX: TODO: add support for sub-pixel hinting */
- scaler.y_scale = size->metrics.y_scale;
- scaler.y_delta = 0; /* XXX: TODO: add support for sub-pixel hinting */
-
- scaler.render_mode = FT_LOAD_TARGET_MODE( load_flags );
- scaler.flags = 0; /* XXX: fix this */
-
- error = af_loader_reset( loader, module, face );
- if ( !error )
- {
- AF_StyleMetrics metrics;
- FT_UInt options = AF_STYLE_NONE_DFLT;
-
-
-#ifdef FT_OPTION_AUTOFIT2
- /* XXX: undocumented hook to activate the latin2 writing system */
- if ( load_flags & ( 1UL << 20 ) )
- options = AF_STYLE_LTN2_DFLT;
-#endif
-
- error = af_face_globals_get_metrics( loader->globals, gindex,
- options, &metrics );
- if ( !error )
- {
-#ifdef FT_CONFIG_OPTION_PIC
- AF_FaceGlobals globals = loader->globals;
-#endif
- AF_StyleClass style_class = metrics->style_class;
- AF_WritingSystemClass writing_system_class =
- AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
-
-
- loader->metrics = metrics;
-
- if ( writing_system_class->style_metrics_scale )
- writing_system_class->style_metrics_scale( metrics, &scaler );
- else
- metrics->scaler = scaler;
-
- load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;
- load_flags &= ~FT_LOAD_RENDER;
-
- if ( writing_system_class->style_hints_init )
- {
- error = writing_system_class->style_hints_init( loader->hints,
- metrics );
- if ( error )
- goto Exit;
- }
-
- error = af_loader_load_g( loader, &scaler, gindex, load_flags );
- }
- }
- Exit:
- return error;
- }
-
-
/*
* Compute amount of font units the face should be emboldened by, in
* analogy to the CFF driver's `cf2_computeDarkening' function. See there
diff --git a/thirdparty/freetype/src/autofit/afloader.h b/thirdparty/freetype/src/autofit/afloader.h
index 0062eb9b07..2578abed16 100644
--- a/thirdparty/freetype/src/autofit/afloader.h
+++ b/thirdparty/freetype/src/autofit/afloader.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter glyph loading routines (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afmodule.c b/thirdparty/freetype/src/autofit/afmodule.c
index 4127382c00..9d7ba224da 100644
--- a/thirdparty/freetype/src/autofit/afmodule.c
+++ b/thirdparty/freetype/src/autofit/afmodule.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter module implementation (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -104,21 +104,45 @@
}
+#ifdef FT_CONFIG_OPTION_PIC
+
+#undef AF_SCRIPT_CLASSES_GET
+#define AF_SCRIPT_CLASSES_GET \
+ ( GET_PIC( ft_module->library )->af_script_classes )
+
+#undef AF_STYLE_CLASSES_GET
+#define AF_STYLE_CLASSES_GET \
+ ( GET_PIC( ft_module->library )->af_style_classes )
+
+#endif
+
+
static FT_Error
af_property_set( FT_Module ft_module,
const char* property_name,
- const void* value )
+ const void* value,
+ FT_Bool value_is_string )
{
FT_Error error = FT_Err_Ok;
AF_Module module = (AF_Module)ft_module;
+#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ FT_UNUSED( value_is_string );
+#endif
+
if ( !ft_strcmp( property_name, "fallback-script" ) )
{
- FT_UInt* fallback_script = (FT_UInt*)value;
+ FT_UInt* fallback_script;
+ FT_UInt ss;
- FT_UInt ss;
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ return FT_THROW( Invalid_Argument );
+#endif
+
+ fallback_script = (FT_UInt*)value;
/* We translate the fallback script to a fallback style that uses */
/* `fallback-script' as its script and `AF_COVERAGE_NONE' as its */
@@ -147,19 +171,33 @@
}
else if ( !ft_strcmp( property_name, "default-script" ) )
{
- FT_UInt* default_script = (FT_UInt*)value;
+ FT_UInt* default_script;
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ return FT_THROW( Invalid_Argument );
+#endif
+
+ default_script = (FT_UInt*)value;
+
module->default_script = *default_script;
return error;
}
else if ( !ft_strcmp( property_name, "increase-x-height" ) )
{
- FT_Prop_IncreaseXHeight* prop = (FT_Prop_IncreaseXHeight*)value;
+ FT_Prop_IncreaseXHeight* prop;
AF_FaceGlobals globals;
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ return FT_THROW( Invalid_Argument );
+#endif
+
+ prop = (FT_Prop_IncreaseXHeight*)value;
+
error = af_property_get_face_globals( prop->face, &globals, module );
if ( !error )
globals->increase_x_height = prop->limit;
@@ -169,27 +207,76 @@
#ifdef AF_CONFIG_OPTION_USE_WARPER
else if ( !ft_strcmp( property_name, "warping" ) )
{
- FT_Bool* warping = (FT_Bool*)value;
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+ long w = ft_strtol( s, NULL, 10 );
+
+
+ if ( w == 0 )
+ module->warping = 0;
+ else if ( w == 1 )
+ module->warping = 1;
+ else
+ return FT_THROW( Invalid_Argument );
+ }
+ else
+#endif
+ {
+ FT_Bool* warping = (FT_Bool*)value;
- module->warping = *warping;
+ module->warping = *warping;
+ }
return error;
}
#endif /* AF_CONFIG_OPTION_USE_WARPER */
else if ( !ft_strcmp( property_name, "darkening-parameters" ) )
{
- FT_Int* darken_params = (FT_Int*)value;
+ FT_Int* darken_params;
+ FT_Int x1, y1, x2, y2, x3, y3, x4, y4;
+
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ FT_Int dp[8];
+
+
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+ char* ep;
+ int i;
+
+
+ /* eight comma-separated numbers */
+ for ( i = 0; i < 7; i++ )
+ {
+ dp[i] = (FT_Int)ft_strtol( s, &ep, 10 );
+ if ( *ep != ',' || s == ep )
+ return FT_THROW( Invalid_Argument );
- FT_Int x1 = darken_params[0];
- FT_Int y1 = darken_params[1];
- FT_Int x2 = darken_params[2];
- FT_Int y2 = darken_params[3];
- FT_Int x3 = darken_params[4];
- FT_Int y3 = darken_params[5];
- FT_Int x4 = darken_params[6];
- FT_Int y4 = darken_params[7];
+ s = ep + 1;
+ }
+ dp[7] = (FT_Int)ft_strtol( s, &ep, 10 );
+ if ( !( *ep == '\0' || *ep == ' ' ) || s == ep )
+ return FT_THROW( Invalid_Argument );
+
+ darken_params = dp;
+ }
+ else
+#endif
+ darken_params = (FT_Int*)value;
+
+ x1 = darken_params[0];
+ y1 = darken_params[1];
+ x2 = darken_params[2];
+ y2 = darken_params[3];
+ x3 = darken_params[4];
+ y3 = darken_params[5];
+ x4 = darken_params[6];
+ y4 = darken_params[7];
if ( x1 < 0 || x2 < 0 || x3 < 0 || x4 < 0 ||
y1 < 0 || y2 < 0 || y3 < 0 || y4 < 0 ||
@@ -210,10 +297,26 @@
}
else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
{
- FT_Bool* no_stem_darkening = (FT_Bool*)value;
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+ long nsd = ft_strtol( s, NULL, 10 );
- module->no_stem_darkening = *no_stem_darkening;
+ if ( !nsd )
+ module->no_stem_darkening = FALSE;
+ else
+ module->no_stem_darkening = TRUE;
+ }
+ else
+#endif
+ {
+ FT_Bool* no_stem_darkening = (FT_Bool*)value;
+
+
+ module->no_stem_darkening = *no_stem_darkening;
+ }
return error;
}
@@ -329,12 +432,14 @@
FT_DEFINE_SERVICE_PROPERTIESREC(
af_service_properties,
+
(FT_Properties_SetFunc)af_property_set, /* set_property */
(FT_Properties_GetFunc)af_property_get ) /* get_property */
FT_DEFINE_SERVICEDESCREC1(
af_services,
+
FT_SERVICE_ID_PROPERTIES, &AF_SERVICE_PROPERTIES_GET )
@@ -427,9 +532,16 @@
error = af_loader_load_glyph( loader, module, slot->face,
glyph_index, load_flags );
- af_glyph_hints_dump_points( hints, 0 );
- af_glyph_hints_dump_segments( hints, 0 );
- af_glyph_hints_dump_edges( hints, 0 );
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( ft_trace_levels[FT_COMPONENT] )
+ {
+#endif
+ af_glyph_hints_dump_points( hints, 0 );
+ af_glyph_hints_dump_segments( hints, 0 );
+ af_glyph_hints_dump_edges( hints, 0 );
+#ifdef FT_DEBUG_LEVEL_TRACE
+ }
+#endif
af_loader_done( loader );
@@ -460,6 +572,7 @@
FT_DEFINE_AUTOHINTER_INTERFACE(
af_autofitter_interface,
+
NULL, /* reset_face */
NULL, /* get_global_hints */
NULL, /* done_global_hints */
@@ -478,9 +591,10 @@
(const void*)&AF_INTERFACE_GET,
- (FT_Module_Constructor)af_autofitter_init,
- (FT_Module_Destructor) af_autofitter_done,
- (FT_Module_Requester) af_get_interface )
+ (FT_Module_Constructor)af_autofitter_init, /* module_init */
+ (FT_Module_Destructor) af_autofitter_done, /* module_done */
+ (FT_Module_Requester) af_get_interface /* get_interface */
+ )
/* END */
diff --git a/thirdparty/freetype/src/autofit/afmodule.h b/thirdparty/freetype/src/autofit/afmodule.h
index e65db5f5cb..0571d14d59 100644
--- a/thirdparty/freetype/src/autofit/afmodule.h
+++ b/thirdparty/freetype/src/autofit/afmodule.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter module implementation (specification). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afpic.c b/thirdparty/freetype/src/autofit/afpic.c
index 3cbd9168e3..3125e03e27 100644
--- a/thirdparty/freetype/src/autofit/afpic.c
+++ b/thirdparty/freetype/src/autofit/afpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for autofit module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afpic.h b/thirdparty/freetype/src/autofit/afpic.h
index 98a45a26ba..8cd3392123 100644
--- a/thirdparty/freetype/src/autofit/afpic.h
+++ b/thirdparty/freetype/src/autofit/afpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for autofit module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -69,7 +69,7 @@ FT_BEGIN_HEADER
#define GET_PIC( lib ) \
- ( (AFModulePIC*)((lib)->pic_container.autofit) )
+ ( (AFModulePIC*)( (lib)->pic_container.autofit ) )
#define AF_SERVICES_GET \
( GET_PIC( library )->af_services )
diff --git a/thirdparty/freetype/src/autofit/afranges.c b/thirdparty/freetype/src/autofit/afranges.c
index 732f3d1629..7f37eea1e0 100644
--- a/thirdparty/freetype/src/autofit/afranges.c
+++ b/thirdparty/freetype/src/autofit/afranges.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter Unicode script ranges (body). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -52,8 +52,21 @@
/* not be affected by blue zones, regardless of whether this is a */
/* spacing or no-spacing glyph */
- /* the `ta_xxxx_nonbase_uniranges' ranges must be strict subsets */
- /* of the corresponding `ta_xxxx_uniranges' ranges */
+ /* the `af_xxxx_nonbase_uniranges' ranges must be strict subsets */
+ /* of the corresponding `af_xxxx_uniranges' ranges */
+
+
+ const AF_Script_UniRangeRec af_adlm_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1E900, 0x1E95F ), /* Adlam */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_adlm_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1D944, 0x1E94A ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
const AF_Script_UniRangeRec af_arab_uniranges[] =
@@ -106,6 +119,37 @@
};
+ const AF_Script_UniRangeRec af_avst_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x10B00, 0x10B3F ), /* Avestan */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_avst_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x10B39, 0x10B3F ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_bamu_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0xA6A0, 0xA6FF ), /* Bamum */
+#if 0
+ /* The characters in the Bamum supplement are pictograms, */
+ /* not (directly) related to the syllabic Bamum script */
+ AF_UNIRANGE_REC( 0x16800, 0x16A3F ), /* Bamum Supplement */
+#endif
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_bamu_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0xA6F0, 0xA6F1 ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
const AF_Script_UniRangeRec af_beng_uniranges[] =
{
AF_UNIRANGE_REC( 0x0980, 0x09FF ), /* Bengali */
@@ -123,6 +167,58 @@
};
+ const AF_Script_UniRangeRec af_buhd_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1740, 0x175F ), /* Buhid */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_buhd_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1752, 0x1753 ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_cakm_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x11100, 0x1114F ), /* Chakma */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_cakm_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x11100, 0x11102 ),
+ AF_UNIRANGE_REC( 0x11127, 0x11134 ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_cans_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1400, 0x167F ), /* Unified Canadian Aboriginal Syllabics */
+ AF_UNIRANGE_REC( 0x18B0, 0x18FF ), /* Unified Canadian Aboriginal Syllabics Extended */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_cans_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_cari_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x102A0, 0x102DF ), /* Carian */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_cari_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
const AF_Script_UniRangeRec af_cher_uniranges[] =
{
AF_UNIRANGE_REC( 0x13A0, 0x13FF ), /* Cherokee */
@@ -136,6 +232,31 @@
};
+ const AF_Script_UniRangeRec af_copt_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x2C80, 0x2CFF ), /* Coptic */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_copt_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x2CEF, 0x2CF1 ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_cprt_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x10800, 0x1083F ), /* Cypriot */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_cprt_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
const AF_Script_UniRangeRec af_cyrl_uniranges[] =
{
AF_UNIRANGE_REC( 0x0400, 0x04FF ), /* Cyrillic */
@@ -187,6 +308,18 @@
};
+ const AF_Script_UniRangeRec af_dsrt_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x10400, 0x1044F ), /* Deseret */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_dsrt_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
const AF_Script_UniRangeRec af_ethi_uniranges[] =
{
AF_UNIRANGE_REC( 0x1200, 0x137F ), /* Ethiopic */
@@ -233,6 +366,32 @@
};
+ const AF_Script_UniRangeRec af_glag_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x2C00, 0x2C5F ), /* Glagolitic */
+ AF_UNIRANGE_REC( 0x1E000, 0x1E02F ), /* Glagolitic Supplement */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_glag_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1E000, 0x1E02F ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_goth_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x10330, 0x1034F ), /* Gothic */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_goth_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
const AF_Script_UniRangeRec af_grek_uniranges[] =
{
AF_UNIRANGE_REC( 0x0370, 0x03FF ), /* Greek and Coptic */
@@ -305,6 +464,19 @@
};
+ const AF_Script_UniRangeRec af_kali_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0xA900, 0xA92F ), /* Kayah Li */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_kali_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0xA926, 0xA92D ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
const AF_Script_UniRangeRec af_knda_uniranges[] =
{
AF_UNIRANGE_REC( 0x0C80, 0x0CFF ), /* Kannada */
@@ -463,6 +635,18 @@
};
+ const AF_Script_UniRangeRec af_lisu_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0xA4D0, 0xA4FF ), /* Lisu */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_lisu_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
const AF_Script_UniRangeRec af_mlym_uniranges[] =
{
AF_UNIRANGE_REC( 0x0D00, 0x0D7F ), /* Malayalam */
@@ -480,27 +664,40 @@
const AF_Script_UniRangeRec af_mymr_uniranges[] =
{
- AF_UNIRANGE_REC( 0x1000, 0x109F ), /* Myanmar */
- AF_UNIRANGE_REC( 0xA9E0, 0xA9FF ), /* Myanmar Extended-B */
- AF_UNIRANGE_REC( 0xAA60, 0xAA7F ), /* Myanmar Extended-A */
- AF_UNIRANGE_REC( 0, 0 )
+ AF_UNIRANGE_REC( 0x1000, 0x109F ), /* Myanmar */
+ AF_UNIRANGE_REC( 0xA9E0, 0xA9FF ), /* Myanmar Extended-B */
+ AF_UNIRANGE_REC( 0xAA60, 0xAA7F ), /* Myanmar Extended-A */
+ AF_UNIRANGE_REC( 0, 0 )
};
const AF_Script_UniRangeRec af_mymr_nonbase_uniranges[] =
{
- AF_UNIRANGE_REC( 0x102D, 0x1030 ),
- AF_UNIRANGE_REC( 0x1032, 0x1037 ),
- AF_UNIRANGE_REC( 0x103A, 0x103A ),
- AF_UNIRANGE_REC( 0x103D, 0x103E ),
- AF_UNIRANGE_REC( 0x1058, 0x1059 ),
- AF_UNIRANGE_REC( 0x105E, 0x1060 ),
- AF_UNIRANGE_REC( 0x1071, 0x1074 ),
- AF_UNIRANGE_REC( 0x1082, 0x1082 ),
- AF_UNIRANGE_REC( 0x1085, 0x1086 ),
- AF_UNIRANGE_REC( 0x108D, 0x108D ),
- AF_UNIRANGE_REC( 0xA9E5, 0xA9E5 ),
- AF_UNIRANGE_REC( 0xAA7C, 0xAA7C ),
- AF_UNIRANGE_REC( 0, 0 )
+ AF_UNIRANGE_REC( 0x102D, 0x1030 ),
+ AF_UNIRANGE_REC( 0x1032, 0x1037 ),
+ AF_UNIRANGE_REC( 0x103A, 0x103A ),
+ AF_UNIRANGE_REC( 0x103D, 0x103E ),
+ AF_UNIRANGE_REC( 0x1058, 0x1059 ),
+ AF_UNIRANGE_REC( 0x105E, 0x1060 ),
+ AF_UNIRANGE_REC( 0x1071, 0x1074 ),
+ AF_UNIRANGE_REC( 0x1082, 0x1082 ),
+ AF_UNIRANGE_REC( 0x1085, 0x1086 ),
+ AF_UNIRANGE_REC( 0x108D, 0x108D ),
+ AF_UNIRANGE_REC( 0xA9E5, 0xA9E5 ),
+ AF_UNIRANGE_REC( 0xAA7C, 0xAA7C ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_nkoo_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x07C0, 0x07FF ), /* N'Ko */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_nkoo_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x07EB, 0x07F5 ),
+ AF_UNIRANGE_REC( 0, 0 )
};
@@ -515,6 +712,80 @@
};
+ const AF_Script_UniRangeRec af_olck_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1C50, 0x1C7F ), /* Ol Chiki */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_olck_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_orkh_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x10C00, 0x10C4F ), /* Old Turkic */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_orkh_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_osge_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x104B0, 0x104FF ), /* Osage */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_osge_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_osma_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x10480, 0x104AF ), /* Osmanya */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_osma_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_saur_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0xA880, 0xA8DF ), /* Saurashtra */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_saur_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0xA880, 0xA881 ),
+ AF_UNIRANGE_REC( 0xA8B4, 0xA8C5 ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_shaw_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x10450, 0x1047F ), /* Shavian */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_shaw_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
const AF_Script_UniRangeRec af_sinh_uniranges[] =
{
AF_UNIRANGE_REC( 0x0D80, 0x0DFF ), /* Sinhala */
@@ -529,6 +800,21 @@
};
+ const AF_Script_UniRangeRec af_sund_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1B80, 0x1BBF ), /* Sundanese */
+ AF_UNIRANGE_REC( 0x1CC0, 0x1CCF ), /* Sundanese Supplement */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_sund_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1B80, 0x1B82 ),
+ AF_UNIRANGE_REC( 0x1BA1, 0x1BAD ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
const AF_Script_UniRangeRec af_taml_uniranges[] =
{
AF_UNIRANGE_REC( 0x0B80, 0x0BFF ), /* Tamil */
@@ -544,6 +830,23 @@
};
+ const AF_Script_UniRangeRec af_tavt_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0xAA80, 0xAADF ), /* Tai Viet */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_tavt_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0xAAB0, 0xAAB0 ),
+ AF_UNIRANGE_REC( 0xAAB2, 0xAAB4 ),
+ AF_UNIRANGE_REC( 0xAAB7, 0xAAB8 ),
+ AF_UNIRANGE_REC( 0xAABE, 0xAABF ),
+ AF_UNIRANGE_REC( 0xAAC1, 0xAAC1 ),
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
const AF_Script_UniRangeRec af_telu_uniranges[] =
{
AF_UNIRANGE_REC( 0x0C00, 0x0C7F ), /* Telugu */
@@ -575,6 +878,30 @@
};
+ const AF_Script_UniRangeRec af_tfng_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x2D30, 0x2D7F ), /* Tifinagh */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_tfng_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
+ const AF_Script_UniRangeRec af_vaii_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0xA500, 0xA63F ), /* Vai */
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+ const AF_Script_UniRangeRec af_vaii_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0, 0 )
+ };
+
+
#ifdef AF_CONFIG_OPTION_INDIC
const AF_Script_UniRangeRec af_limb_uniranges[] =
@@ -610,21 +937,6 @@
};
- const AF_Script_UniRangeRec af_sund_uniranges[] =
- {
- AF_UNIRANGE_REC( 0x1B80, 0x1BBF ), /* Sundanese */
- AF_UNIRANGE_REC( 0x1CC0, 0x1CCF ), /* Sundanese Supplement */
- AF_UNIRANGE_REC( 0, 0 )
- };
-
- const AF_Script_UniRangeRec af_sund_nonbase_uniranges[] =
- {
- AF_UNIRANGE_REC( 0x1B80, 0x1B82 ),
- AF_UNIRANGE_REC( 0x1BA1, 0x1BAD ),
- AF_UNIRANGE_REC( 0, 0 )
- };
-
-
const AF_Script_UniRangeRec af_sylo_uniranges[] =
{
AF_UNIRANGE_REC( 0xA800, 0xA82F ), /* Syloti Nagri */
diff --git a/thirdparty/freetype/src/autofit/afranges.h b/thirdparty/freetype/src/autofit/afranges.h
index 1a0e4b1535..72d9eaad2c 100644
--- a/thirdparty/freetype/src/autofit/afranges.h
+++ b/thirdparty/freetype/src/autofit/afranges.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter Unicode script ranges (specification). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afscript.h b/thirdparty/freetype/src/autofit/afscript.h
index 33c3012981..7547a9e6f9 100644
--- a/thirdparty/freetype/src/autofit/afscript.h
+++ b/thirdparty/freetype/src/autofit/afscript.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter scripts (specification only). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -30,6 +30,12 @@
/* use `HB_SCRIPT_INVALID' as the HarfBuzz script name tag for */
/* them. */
+ SCRIPT( adlm, ADLM,
+ "Adlam",
+ HB_SCRIPT_ADLAM,
+ HINTING_BOTTOM_TO_TOP,
+ "\xF0\x9E\xA4\x8C \xF0\x9E\xA4\xAE" ) /* 𞤌 𞤮 */
+
SCRIPT( arab, ARAB,
"Arabic",
HB_SCRIPT_ARABIC,
@@ -40,7 +46,19 @@
"Armenian",
HB_SCRIPT_ARMENIAN,
HINTING_BOTTOM_TO_TOP,
- "\xD6\x85 \xD5\x95" ) /* Ö… Õ• */
+ "\xD5\xBD \xD5\x8D" ) /* Õ½ Õ */
+
+ SCRIPT( avst, AVST,
+ "Avestan",
+ HB_SCRIPT_AVESTAN,
+ HINTING_BOTTOM_TO_TOP,
+ "\xF0\x90\xAC\x9A" ) /* 𬚠*/
+
+ SCRIPT( bamu, BAMU,
+ "Bamum",
+ HB_SCRIPT_BAMUM,
+ HINTING_BOTTOM_TO_TOP,
+ "\xEA\x9B\x81 \xEA\x9B\xAF" ) /* ê› ê›¯ */
/* there are no simple forms for letters; we thus use two digit shapes */
SCRIPT( beng, BENG,
@@ -49,12 +67,48 @@
HINTING_TOP_TO_BOTTOM,
"\xE0\xA7\xA6 \xE0\xA7\xAA" ) /* ০ ৪ */
+ SCRIPT( buhd, BUHD,
+ "Buhid",
+ HB_SCRIPT_BUHID,
+ HINTING_BOTTOM_TO_TOP,
+ "\xE1\x9D\x8B \xE1\x9D\x8F" ) /* á‹ á */
+
+ SCRIPT( cakm, CAKM,
+ "Chakma",
+ HB_SCRIPT_CHAKMA,
+ HINTING_BOTTOM_TO_TOP,
+ "\xF0\x91\x84\xA4 \xF0\x91\x84\x89 \xF0\x91\x84\x9B" ) /* 𑄤 𑄉 𑄛 */
+
+ SCRIPT( cans, CANS,
+ "Canadian Syllabics",
+ HB_SCRIPT_CANADIAN_SYLLABICS,
+ HINTING_BOTTOM_TO_TOP,
+ "\xE1\x91\x8C \xE1\x93\x9A" ) /* ᑌ ᓚ */
+
+ SCRIPT( cari, CARI,
+ "Carian",
+ HB_SCRIPT_CARIAN,
+ HINTING_BOTTOM_TO_TOP,
+ "\xF0\x90\x8A\xAB \xF0\x90\x8B\x89" ) /* ðŠ« ð‹‰ */
+
SCRIPT( cher, CHER,
"Cherokee",
HB_SCRIPT_CHEROKEE,
HINTING_BOTTOM_TO_TOP,
"\xE1\x8E\xA4 \xE1\x8F\x85 \xEA\xAE\x95" ) /* Ꭴ á… ê®• */
+ SCRIPT( copt, COPT,
+ "Coptic",
+ HB_SCRIPT_COPTIC,
+ HINTING_BOTTOM_TO_TOP,
+ "\xE2\xB2\x9E \xE2\xB2\x9F" ) /* Ⲟ ⲟ */
+
+ SCRIPT( cprt, CPRT,
+ "Cypriot",
+ HB_SCRIPT_CYPRIOT,
+ HINTING_BOTTOM_TO_TOP,
+ "\xF0\x90\xA0\x85 \xF0\x90\xA0\xA3" ) /* ð … ð £ */
+
SCRIPT( cyrl, CYRL,
"Cyrillic",
HB_SCRIPT_CYRILLIC,
@@ -67,6 +121,12 @@
HINTING_TOP_TO_BOTTOM,
"\xE0\xA4\xA0 \xE0\xA4\xB5 \xE0\xA4\x9F" ) /* ठ व ट */
+ SCRIPT( dsrt, DSRT,
+ "Deseret",
+ HB_SCRIPT_DESERET,
+ HINTING_BOTTOM_TO_TOP,
+ "\xF0\x90\x90\x84 \xF0\x90\x90\xAC" ) /* ð„ ð¬ */
+
SCRIPT( ethi, ETHI,
"Ethiopic",
HB_SCRIPT_ETHIOPIC,
@@ -85,6 +145,18 @@
HINTING_BOTTOM_TO_TOP,
"\xE1\x82\xB6 \xE1\x82\xB1 \xE2\xB4\x99" ) /* Ⴖ Ⴑ ⴙ */
+ SCRIPT( glag, GLAG,
+ "Glagolitic",
+ HB_SCRIPT_GLAGOLITIC,
+ HINTING_BOTTOM_TO_TOP,
+ "\xE2\xB0\x95 \xE2\xB1\x85" ) /* â°• â±… */
+
+ SCRIPT( goth, GOTH,
+ "Gothic",
+ HB_SCRIPT_GOTHIC,
+ HINTING_TOP_TO_BOTTOM,
+ "\xF0\x90\x8C\xB4 \xF0\x90\x8C\xBE \xF0\x90\x8D\x83" ) /* ðŒ´ ðŒ¾ ðƒ */
+
SCRIPT( grek, GREK,
"Greek",
HB_SCRIPT_GREEK,
@@ -109,6 +181,12 @@
HINTING_BOTTOM_TO_TOP,
"\xD7\x9D" ) /* × */
+ SCRIPT( kali, KALI,
+ "Kayah Li",
+ HB_SCRIPT_KAYAH_LI,
+ HINTING_BOTTOM_TO_TOP,
+ "\xEA\xA4\x8D \xEA\xA4\x80" ) /* ê¤ ê¤€ */
+
SCRIPT( knda, KNDA,
"Kannada",
HB_SCRIPT_KANNADA,
@@ -153,6 +231,12 @@
HINTING_BOTTOM_TO_TOP,
"\xE1\xB5\x92 \xE1\xB4\xBC \xE2\x81\xB0" ) /* áµ’ á´¼ â° */
+ SCRIPT( lisu, LISU,
+ "Lisu",
+ HB_SCRIPT_LISU,
+ HINTING_BOTTOM_TO_TOP,
+ "\xEA\x93\xB3" ) /* ꓳ */
+
SCRIPT( mlym, MLYM,
"Malayalam",
HB_SCRIPT_MALAYALAM,
@@ -165,18 +249,67 @@
HINTING_BOTTOM_TO_TOP,
"\xE1\x80\x9D \xE1\x80\x84 \xE1\x80\x82" ) /* ဠင ဂ */
+ SCRIPT( nkoo, NKOO,
+ "N'Ko",
+ HB_SCRIPT_NKO,
+ HINTING_BOTTOM_TO_TOP,
+ "\xDF\x8B \xDF\x80" ) /* ߋ ߀ */
+
SCRIPT( none, NONE,
"no script",
HB_SCRIPT_INVALID,
HINTING_BOTTOM_TO_TOP,
"" )
+ SCRIPT( olck, OLCK,
+ "Ol Chiki",
+ HB_SCRIPT_OL_CHIKI,
+ HINTING_BOTTOM_TO_TOP,
+ "\xE1\xB1\x9B" ) /* á±› */
+
+ SCRIPT( orkh, ORKH,
+ "Old Turkic",
+ HB_SCRIPT_OLD_TURKIC,
+ HINTING_BOTTOM_TO_TOP,
+ "\xF0\x90\xB0\x97" ) /* ð°— */
+
+ SCRIPT( osge, OSGE,
+ "Osage",
+ HB_SCRIPT_OSAGE,
+ HINTING_BOTTOM_TO_TOP,
+ "\xF0\x90\x93\x82 \xF0\x90\x93\xAA" ) /* 𓂠𓪠*/
+
+ SCRIPT( osma, OSMA,
+ "Osmanya",
+ HB_SCRIPT_OSMANYA,
+ HINTING_BOTTOM_TO_TOP,
+ "\xF0\x90\x92\x86 \xF0\x90\x92\xA0" ) /* ð’† ð’  */
+
+ SCRIPT( saur, SAUR,
+ "Saurashtra",
+ HB_SCRIPT_SAURASHTRA,
+ HINTING_BOTTOM_TO_TOP,
+ "\xEA\xA2\x9D \xEA\xA3\x90" ) /* ê¢ ê£ */
+
+ SCRIPT( shaw, SHAW,
+ "Shavian",
+ HB_SCRIPT_SHAVIAN,
+ HINTING_BOTTOM_TO_TOP,
+ "\xF0\x90\x91\xB4" ) /* ð‘´ */
+
SCRIPT( sinh, SINH,
"Sinhala",
HB_SCRIPT_SINHALA,
HINTING_BOTTOM_TO_TOP,
"\xE0\xB6\xA7" ) /* à¶§ */
+ /* only digit zero has a simple (round) shape in the Sundanese script */
+ SCRIPT( sund, SUND,
+ "Sundanese",
+ HB_SCRIPT_SUNDANESE,
+ HINTING_BOTTOM_TO_TOP,
+ "\xE1\xAE\xB0" ) /* á®° */
+
/* only digit zero has a simple (round) shape in the Tamil script */
SCRIPT( taml, TAML,
"Tamil",
@@ -184,6 +317,12 @@
HINTING_BOTTOM_TO_TOP,
"\xE0\xAF\xA6" ) /* ௦ */
+ SCRIPT( tavt, TAVT,
+ "Tai Viet",
+ HB_SCRIPT_TAI_VIET,
+ HINTING_BOTTOM_TO_TOP,
+ "\xEA\xAA\x92 \xEA\xAA\xAB" ) /* ꪒ ꪫ */
+
/* there are no simple forms for letters; we thus use two digit shapes */
SCRIPT( telu, TELU,
"Telugu",
@@ -197,6 +336,18 @@
HINTING_BOTTOM_TO_TOP,
"\xE0\xB8\xB2 \xE0\xB9\x85 \xE0\xB9\x90" ) /* า ๅ ๠*/
+ SCRIPT( tfng, TFNG,
+ "Tifinagh",
+ HB_SCRIPT_TIFINAGH,
+ HINTING_BOTTOM_TO_TOP,
+ "\xE2\xB5\x94" ) /* âµ” */
+
+ SCRIPT( vaii, VAII,
+ "Vai",
+ HB_SCRIPT_VAI,
+ HINTING_BOTTOM_TO_TOP,
+ "\xEA\x98\x93 \xEA\x96\x9C \xEA\x96\xB4" ) /* ꘓ ꖜ ꖴ */
+
#ifdef AF_CONFIG_OPTION_INDIC
SCRIPT( limb, LIMB,
@@ -211,12 +362,6 @@
HINTING_BOTTOM_TO_TOP,
"o" ) /* XXX */
- SCRIPT( sund, SUND,
- "Sundanese",
- HB_SCRIPT_SUNDANESE,
- HINTING_BOTTOM_TO_TOP,
- "o" ) /* XXX */
-
SCRIPT( sylo, SYLO,
"Syloti Nagri",
HB_SCRIPT_SYLOTI_NAGRI,
diff --git a/thirdparty/freetype/src/autofit/afshaper.c b/thirdparty/freetype/src/autofit/afshaper.c
index 6d13b65859..da92fad3ed 100644
--- a/thirdparty/freetype/src/autofit/afshaper.c
+++ b/thirdparty/freetype/src/autofit/afshaper.c
@@ -4,7 +4,7 @@
/* */
/* HarfBuzz interface for accessing OpenType features (body). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afshaper.h b/thirdparty/freetype/src/autofit/afshaper.h
index 0d41f78762..9185d19003 100644
--- a/thirdparty/freetype/src/autofit/afshaper.h
+++ b/thirdparty/freetype/src/autofit/afshaper.h
@@ -4,7 +4,7 @@
/* */
/* HarfBuzz interface for accessing OpenType features (specification). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afstyles.h b/thirdparty/freetype/src/autofit/afstyles.h
index e83a95bb59..a5e13d8944 100644
--- a/thirdparty/freetype/src/autofit/afstyles.h
+++ b/thirdparty/freetype/src/autofit/afstyles.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter styles (specification only). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -83,6 +83,13 @@
DEFAULT )
+ STYLE( adlm_dflt, ADLM_DFLT,
+ "Adlam default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_ADLM,
+ AF_BLUE_STRINGSET_ADLM,
+ AF_COVERAGE_DEFAULT )
+
STYLE( arab_dflt, ARAB_DFLT,
"Arabic default style",
AF_WRITING_SYSTEM_LATIN,
@@ -97,6 +104,20 @@
AF_BLUE_STRINGSET_ARMN,
AF_COVERAGE_DEFAULT )
+ STYLE( avst_dflt, AVST_DFLT,
+ "Avestan default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_AVST,
+ AF_BLUE_STRINGSET_AVST,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( bamu_dflt, BAMU_DFLT,
+ "Bamum default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_BAMU,
+ AF_BLUE_STRINGSET_BAMU,
+ AF_COVERAGE_DEFAULT )
+
STYLE( beng_dflt, BENG_DFLT,
"Bengali default style",
AF_WRITING_SYSTEM_LATIN,
@@ -104,6 +125,34 @@
AF_BLUE_STRINGSET_BENG,
AF_COVERAGE_DEFAULT )
+ STYLE( buhd_dflt, BUHD_DFLT,
+ "Buhid default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_BUHD,
+ AF_BLUE_STRINGSET_BUHD,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( cakm_dflt, CAKM_DFLT,
+ "Chakma default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_CAKM,
+ AF_BLUE_STRINGSET_CAKM,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( cans_dflt, CANS_DFLT,
+ "Canadian Syllabics default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_CANS,
+ AF_BLUE_STRINGSET_CANS,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( cari_dflt, CARI_DFLT,
+ "Carian default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_CARI,
+ AF_BLUE_STRINGSET_CARI,
+ AF_COVERAGE_DEFAULT )
+
STYLE( cher_dflt, CHER_DFLT,
"Cherokee default style",
AF_WRITING_SYSTEM_LATIN,
@@ -111,6 +160,20 @@
AF_BLUE_STRINGSET_CHER,
AF_COVERAGE_DEFAULT )
+ STYLE( copt_dflt, COPT_DFLT,
+ "Coptic default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_COPT,
+ AF_BLUE_STRINGSET_COPT,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( cprt_dflt, CPRT_DFLT,
+ "Cypriot default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_CPRT,
+ AF_BLUE_STRINGSET_CPRT,
+ AF_COVERAGE_DEFAULT )
+
META_STYLE_LATIN( cyrl, CYRL, "Cyrillic" )
STYLE( deva_dflt, DEVA_DFLT,
@@ -120,6 +183,13 @@
AF_BLUE_STRINGSET_DEVA,
AF_COVERAGE_DEFAULT )
+ STYLE( dsrt_dflt, DSRT_DFLT,
+ "Deseret default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_DSRT,
+ AF_BLUE_STRINGSET_DSRT,
+ AF_COVERAGE_DEFAULT )
+
STYLE( ethi_dflt, ETHI_DFLT,
"Ethiopic default style",
AF_WRITING_SYSTEM_LATIN,
@@ -141,6 +211,20 @@
AF_BLUE_STRINGSET_GEOK,
AF_COVERAGE_DEFAULT )
+ STYLE( glag_dflt, GLAG_DFLT,
+ "Glagolitic default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_GLAG,
+ AF_BLUE_STRINGSET_GLAG,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( goth_dflt, GOTH_DFLT,
+ "Gothic default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_GOTH,
+ AF_BLUE_STRINGSET_GOTH,
+ AF_COVERAGE_DEFAULT )
+
META_STYLE_LATIN( grek, GREK, "Greek" )
STYLE( gujr_dflt, GUJR_DFLT,
@@ -164,6 +248,13 @@
AF_BLUE_STRINGSET_HEBR,
AF_COVERAGE_DEFAULT )
+ STYLE( kali_dflt, KALI_DFLT,
+ "Kayah Li default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_KALI,
+ AF_BLUE_STRINGSET_KALI,
+ AF_COVERAGE_DEFAULT )
+
STYLE( knda_dflt, KNDA_DFLT,
"Kannada default style",
AF_WRITING_SYSTEM_LATIN,
@@ -217,6 +308,13 @@
AF_COVERAGE_DEFAULT )
#endif
+ STYLE( lisu_dflt, LISU_DFLT,
+ "Lisu default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_LISU,
+ AF_BLUE_STRINGSET_LISU,
+ AF_COVERAGE_DEFAULT )
+
STYLE( mlym_dflt, MLYM_DFLT,
"Malayalam default style",
AF_WRITING_SYSTEM_LATIN,
@@ -231,6 +329,13 @@
AF_BLUE_STRINGSET_MYMR,
AF_COVERAGE_DEFAULT )
+ STYLE( nkoo_dflt, NKOO_DFLT,
+ "N'Ko default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_NKOO,
+ AF_BLUE_STRINGSET_NKOO,
+ AF_COVERAGE_DEFAULT )
+
STYLE( none_dflt, NONE_DFLT,
"no style",
AF_WRITING_SYSTEM_DUMMY,
@@ -238,6 +343,48 @@
AF_BLUE_STRINGSET_NONE,
AF_COVERAGE_DEFAULT )
+ STYLE( olck_dflt, OLCK_DFLT,
+ "Ol Chiki default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_OLCK,
+ AF_BLUE_STRINGSET_OLCK,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( orkh_dflt, ORKH_DFLT,
+ "Old Turkic default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_ORKH,
+ AF_BLUE_STRINGSET_ORKH,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( osge_dflt, OSGE_DFLT,
+ "Osage default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_OSGE,
+ AF_BLUE_STRINGSET_OSGE,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( osma_dflt, OSMA_DFLT,
+ "Osmanya default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_OSMA,
+ AF_BLUE_STRINGSET_OSMA,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( saur_dflt, SAUR_DFLT,
+ "Saurashtra default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_SAUR,
+ AF_BLUE_STRINGSET_SAUR,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( shaw_dflt, SHAW_DFLT,
+ "Shavian default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_SHAW,
+ AF_BLUE_STRINGSET_SHAW,
+ AF_COVERAGE_DEFAULT )
+
STYLE( sinh_dflt, SINH_DFLT,
"Sinhala default style",
AF_WRITING_SYSTEM_LATIN,
@@ -245,6 +392,13 @@
AF_BLUE_STRINGSET_SINH,
AF_COVERAGE_DEFAULT )
+ STYLE( sund_dflt, SUND_DFLT,
+ "Sundanese default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_SUND,
+ AF_BLUE_STRINGSET_SUND,
+ AF_COVERAGE_DEFAULT )
+
STYLE( taml_dflt, TAML_DFLT,
"Tamil default style",
AF_WRITING_SYSTEM_LATIN,
@@ -252,6 +406,13 @@
AF_BLUE_STRINGSET_TAML,
AF_COVERAGE_DEFAULT )
+ STYLE( tavt_dflt, TAVT_DFLT,
+ "Tai Viet default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_TAVT,
+ AF_BLUE_STRINGSET_TAVT,
+ AF_COVERAGE_DEFAULT )
+
STYLE( telu_dflt, TELU_DFLT,
"Telugu default style",
AF_WRITING_SYSTEM_LATIN,
@@ -266,6 +427,20 @@
AF_BLUE_STRINGSET_THAI,
AF_COVERAGE_DEFAULT )
+ STYLE( tfng_dflt, TFNG_DFLT,
+ "Tifinagh default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_TFNG,
+ AF_BLUE_STRINGSET_TFNG,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( vaii_dflt, VAII_DFLT,
+ "Vai default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_VAII,
+ AF_BLUE_STRINGSET_VAII,
+ AF_COVERAGE_DEFAULT )
+
#ifdef AF_CONFIG_OPTION_INDIC
/* no blue stringset support for the Indic writing system yet */
@@ -280,7 +455,6 @@
STYLE_DEFAULT_INDIC( limb, LIMB, "Limbu" )
STYLE_DEFAULT_INDIC( orya, ORYA, "Oriya" )
- STYLE_DEFAULT_INDIC( sund, SUND, "Sundanese" )
STYLE_DEFAULT_INDIC( sylo, SYLO, "Syloti Nagri" )
STYLE_DEFAULT_INDIC( tibt, TIBT, "Tibetan" )
diff --git a/thirdparty/freetype/src/autofit/aftypes.h b/thirdparty/freetype/src/autofit/aftypes.h
index ef62043c8a..718dab70b6 100644
--- a/thirdparty/freetype/src/autofit/aftypes.h
+++ b/thirdparty/freetype/src/autofit/aftypes.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter types (specification only). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -221,7 +221,7 @@ extern void* _af_debug_hints;
(*AF_WritingSystem_InitHintsFunc)( AF_GlyphHints hints,
AF_StyleMetrics metrics );
- typedef void
+ typedef FT_Error
(*AF_WritingSystem_ApplyHintsFunc)( FT_UInt glyph_index,
AF_GlyphHints hints,
FT_Outline* outline,
@@ -575,6 +575,7 @@ extern void* _af_debug_hints;
m_init, \
m_scale, \
m_done, \
+ m_stdw, \
h_init, \
h_apply ) \
FT_LOCAL_DEF( void ) \
diff --git a/thirdparty/freetype/src/autofit/afwarp.c b/thirdparty/freetype/src/autofit/afwarp.c
index ce1806c9d3..f99aa6d987 100644
--- a/thirdparty/freetype/src/autofit/afwarp.c
+++ b/thirdparty/freetype/src/autofit/afwarp.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter warping algorithm (body). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -98,7 +98,6 @@
if ( xx1min + w < warper->x2min )
xx1min = warper->x2min - w;
- xx1max = warper->x1max;
if ( xx1max + w > warper->x2max )
xx1max = warper->x2max - w;
diff --git a/thirdparty/freetype/src/autofit/afwarp.h b/thirdparty/freetype/src/autofit/afwarp.h
index 6d96f86d73..2e85cbd851 100644
--- a/thirdparty/freetype/src/autofit/afwarp.h
+++ b/thirdparty/freetype/src/autofit/afwarp.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter warping algorithm (specification). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afwrtsys.h b/thirdparty/freetype/src/autofit/afwrtsys.h
index 842f4921a4..86749a2a83 100644
--- a/thirdparty/freetype/src/autofit/afwrtsys.h
+++ b/thirdparty/freetype/src/autofit/afwrtsys.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter writing systems (specification only). */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/autofit.c b/thirdparty/freetype/src/autofit/autofit.c
index dda9aeb6d7..bbedad7b5f 100644
--- a/thirdparty/freetype/src/autofit/autofit.c
+++ b/thirdparty/freetype/src/autofit/autofit.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter module (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -18,29 +18,22 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
-#include "afpic.c"
+
#include "afangles.c"
#include "afblue.c"
+#include "afcjk.c"
+#include "afdummy.c"
#include "afglobal.c"
#include "afhints.c"
-
-#include "afranges.c"
-
-#include "afdummy.c"
+#include "afindic.c"
#include "aflatin.c"
-#ifdef FT_OPTION_AUTOFIT2
#include "aflatin2.c"
-#endif
-#include "afcjk.c"
-#include "afindic.c"
-
-#include "afshaper.c"
-
#include "afloader.c"
#include "afmodule.c"
-
-#ifdef AF_CONFIG_OPTION_USE_WARPER
+#include "afpic.c"
+#include "afranges.c"
+#include "afshaper.c"
#include "afwarp.c"
-#endif
+
/* END */
diff --git a/thirdparty/freetype/src/autofit/module.mk b/thirdparty/freetype/src/autofit/module.mk
index 98f0612b99..c4e249b6f1 100644
--- a/thirdparty/freetype/src/autofit/module.mk
+++ b/thirdparty/freetype/src/autofit/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2003-2016 by
+# Copyright 2003-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/autofit/rules.mk b/thirdparty/freetype/src/autofit/rules.mk
index 1ef4704649..ec4e1302d1 100644
--- a/thirdparty/freetype/src/autofit/rules.mk
+++ b/thirdparty/freetype/src/autofit/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2003-2016 by
+# Copyright 2003-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/base/basepic.c b/thirdparty/freetype/src/base/basepic.c
index f2cea90d7c..57fb8169ad 100644
--- a/thirdparty/freetype/src/base/basepic.c
+++ b/thirdparty/freetype/src/base/basepic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for base. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/basepic.h b/thirdparty/freetype/src/base/basepic.h
index a1a75a0bad..258d4ce2ba 100644
--- a/thirdparty/freetype/src/base/basepic.h
+++ b/thirdparty/freetype/src/base/basepic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for base. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftadvanc.c b/thirdparty/freetype/src/base/ftadvanc.c
index 9e2ab89845..1557607fc5 100644
--- a/thirdparty/freetype/src/base/ftadvanc.c
+++ b/thirdparty/freetype/src/base/ftadvanc.c
@@ -4,7 +4,7 @@
/* */
/* Quick computation of advance widths (body). */
/* */
-/* Copyright 2008-2016 by */
+/* Copyright 2008-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -36,7 +36,7 @@
if ( flags & FT_LOAD_NO_SCALE )
return FT_Err_Ok;
- if ( face->size == NULL )
+ if ( !face->size )
return FT_THROW( Invalid_Size_Handle );
if ( flags & FT_LOAD_VERTICAL_LAYOUT )
@@ -60,12 +60,13 @@
/* - unscaled load */
/* - unhinted load */
/* - light-hinted load */
- /* - neither a MM nor a GX font */
+ /* - if a variations font, it must have an `HVAR' or `VVAR' */
+ /* table (thus the old MM or GX fonts don't qualify; this */
+ /* gets checked by the driver-specific functions) */
-#define LOAD_ADVANCE_FAST_CHECK( face, flags ) \
- ( ( flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) || \
- FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_LIGHT ) && \
- !FT_HAS_MULTIPLE_MASTERS( face ) )
+#define LOAD_ADVANCE_FAST_CHECK( face, flags ) \
+ ( flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) || \
+ FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_LIGHT )
/* documentation is in ftadvanc.h */
diff --git a/thirdparty/freetype/src/base/ftapi.c b/thirdparty/freetype/src/base/ftapi.c
index b94c3eb9fb..4262d37e39 100644
--- a/thirdparty/freetype/src/base/ftapi.c
+++ b/thirdparty/freetype/src/base/ftapi.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType compatibility functions (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -38,7 +38,7 @@
/*************************************************************************/
/*************************************************************************/
- /* backwards compatibility API */
+ /* backward compatibility API */
FT_BASE_DEF( void )
FT_New_Memory_Stream( FT_Library library,
diff --git a/thirdparty/freetype/src/base/ftbase.c b/thirdparty/freetype/src/base/ftbase.c
index ab1af6f9f3..55f7359942 100644
--- a/thirdparty/freetype/src/base/ftbase.c
+++ b/thirdparty/freetype/src/base/ftbase.c
@@ -4,7 +4,7 @@
/* */
/* Single object library component (body only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,26 +17,23 @@
#include <ft2build.h>
-
#define FT_MAKE_OPTION_SINGLE_OBJECT
-#include "ftpic.c"
#include "basepic.c"
#include "ftadvanc.c"
#include "ftcalc.c"
#include "ftdbgmem.c"
#include "ftgloadr.c"
#include "fthash.c"
+#include "ftmac.c"
#include "ftobjs.c"
#include "ftoutln.c"
+#include "ftpic.c"
#include "ftrfork.c"
#include "ftsnames.c"
#include "ftstream.c"
#include "fttrigon.c"
#include "ftutil.c"
-#ifdef FT_MACINTOSH
-#include "ftmac.c"
-#endif
/* END */
diff --git a/thirdparty/freetype/src/base/ftbase.h b/thirdparty/freetype/src/base/ftbase.h
index 717fdaae24..2072284f06 100644
--- a/thirdparty/freetype/src/base/ftbase.h
+++ b/thirdparty/freetype/src/base/ftbase.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType private functions used in base module (specification). */
/* */
-/* Copyright 2008-2016 by */
+/* Copyright 2008-2017 by */
/* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftbbox.c b/thirdparty/freetype/src/base/ftbbox.c
index d3e45ffa0d..6e19da63cb 100644
--- a/thirdparty/freetype/src/base/ftbbox.c
+++ b/thirdparty/freetype/src/base/ftbbox.c
@@ -4,7 +4,7 @@
/* */
/* FreeType bbox computation (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -423,12 +423,15 @@
}
- FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
- (FT_Outline_MoveTo_Func) BBox_Move_To,
- (FT_Outline_LineTo_Func) BBox_Line_To,
- (FT_Outline_ConicTo_Func)BBox_Conic_To,
- (FT_Outline_CubicTo_Func)BBox_Cubic_To,
- 0, 0
+ FT_DEFINE_OUTLINE_FUNCS(
+ bbox_interface,
+
+ (FT_Outline_MoveTo_Func) BBox_Move_To, /* move_to */
+ (FT_Outline_LineTo_Func) BBox_Line_To, /* line_to */
+ (FT_Outline_ConicTo_Func)BBox_Conic_To, /* conic_to */
+ (FT_Outline_CubicTo_Func)BBox_Cubic_To, /* cubic_to */
+ 0, /* shift */
+ 0 /* delta */
)
@@ -457,6 +460,7 @@
{
abbox->xMin = abbox->xMax = 0;
abbox->yMin = abbox->yMax = 0;
+
return 0;
}
@@ -468,10 +472,10 @@
for ( n = 0; n < outline->n_points; n++ )
{
- FT_UPDATE_BBOX( vec, cbox);
+ FT_UPDATE_BBOX( vec, cbox );
if ( FT_CURVE_TAG( outline->tags[n] ) == FT_CURVE_TAG_ON )
- FT_UPDATE_BBOX( vec, bbox);
+ FT_UPDATE_BBOX( vec, bbox );
vec++;
}
@@ -487,8 +491,10 @@
TBBox_Rec user;
#ifdef FT_CONFIG_OPTION_PIC
- FT_Outline_Funcs bbox_interface;
- Init_Class_bbox_interface(&bbox_interface);
+ FT_Outline_Funcs bbox_interface;
+
+
+ Init_Class_bbox_interface( &bbox_interface );
#endif
user.bbox = bbox;
diff --git a/thirdparty/freetype/src/base/ftbdf.c b/thirdparty/freetype/src/base/ftbdf.c
index 4aafc2b98e..40f0ca2bb8 100644
--- a/thirdparty/freetype/src/base/ftbdf.c
+++ b/thirdparty/freetype/src/base/ftbdf.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing BDF-specific strings (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftbitmap.c b/thirdparty/freetype/src/base/ftbitmap.c
index 24fead3e15..88c88c4c1b 100644
--- a/thirdparty/freetype/src/base/ftbitmap.c
+++ b/thirdparty/freetype/src/base/ftbitmap.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility functions for bitmaps (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -76,7 +76,7 @@
source_pitch_sign = source->pitch < 0 ? -1 : 1;
target_pitch_sign = target->pitch < 0 ? -1 : 1;
- if ( source->buffer == NULL )
+ if ( !source->buffer )
{
*target = *source;
if ( source_pitch_sign != target_pitch_sign )
diff --git a/thirdparty/freetype/src/base/ftcalc.c b/thirdparty/freetype/src/base/ftcalc.c
index 67549d0c43..f0525502f3 100644
--- a/thirdparty/freetype/src/base/ftcalc.c
+++ b/thirdparty/freetype/src/base/ftcalc.c
@@ -4,7 +4,7 @@
/* */
/* Arithmetic computations (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -449,8 +449,8 @@
FT_Add64( &temp, &temp2, &temp );
/* last attempt to ditch long division */
- a = temp.hi == 0 ? temp.lo / c
- : ft_div64by32( temp.hi, temp.lo, c );
+ a = ( temp.hi == 0 ) ? temp.lo / c
+ : ft_div64by32( temp.hi, temp.lo, c );
}
a_ = (FT_Long)a;
@@ -492,8 +492,8 @@
ft_multo64( a, b, &temp );
/* last attempt to ditch long division */
- a = temp.hi == 0 ? temp.lo / c
- : ft_div64by32( temp.hi, temp.lo, c );
+ a = ( temp.hi == 0 ) ? temp.lo / c
+ : ft_div64by32( temp.hi, temp.lo, c );
}
a_ = (FT_Long)a;
diff --git a/thirdparty/freetype/src/base/ftcid.c b/thirdparty/freetype/src/base/ftcid.c
index 251bbd009a..398396b845 100644
--- a/thirdparty/freetype/src/base/ftcid.c
+++ b/thirdparty/freetype/src/base/ftcid.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing CID font information. */
/* */
-/* Copyright 2007-2016 by */
+/* Copyright 2007-2017 by */
/* Derek Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftdbgmem.c b/thirdparty/freetype/src/base/ftdbgmem.c
index 6ab5072748..242246bfd1 100644
--- a/thirdparty/freetype/src/base/ftdbgmem.c
+++ b/thirdparty/freetype/src/base/ftdbgmem.c
@@ -4,7 +4,7 @@
/* */
/* Memory debugger (body). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -268,7 +268,7 @@
ft_mem_table_alloc(
table,
new_size * (FT_Long)sizeof ( FT_MemNode ) );
- if ( new_buckets == NULL )
+ if ( !new_buckets )
return;
FT_ARRAY_ZERO( new_buckets, new_size );
@@ -309,7 +309,7 @@
table = (FT_MemTable)memory->alloc( memory, sizeof ( *table ) );
- if ( table == NULL )
+ if ( !table )
goto Exit;
FT_ZERO( table );
@@ -466,7 +466,7 @@
for (;;)
{
node = *pnode;
- if ( node == NULL )
+ if ( !node )
break;
if ( node->file_name == _ft_debug_file &&
@@ -477,7 +477,7 @@
}
node = (FT_MemSource)ft_mem_table_alloc( table, sizeof ( *node ) );
- if ( node == NULL )
+ if ( !node )
ft_mem_debug_panic(
"not enough memory to perform memory debugging\n" );
@@ -545,7 +545,7 @@
/* we need to create a new node in this table */
node = (FT_MemNode)ft_mem_table_alloc( table, sizeof ( *node ) );
- if ( node == NULL )
+ if ( !node )
ft_mem_debug_panic( "not enough memory to run memory tests" );
node->address = address;
@@ -717,7 +717,7 @@
FT_MemTable table = (FT_MemTable)memory->user;
- if ( block == NULL )
+ if ( !block )
ft_mem_debug_panic( "trying to free NULL in (%s:%ld)",
FT_FILENAME( _ft_debug_file ),
_ft_debug_lineno );
@@ -755,7 +755,7 @@
/* the following is valid according to ANSI C */
#if 0
- if ( block == NULL || cur_size == 0 )
+ if ( !block || !cur_size )
ft_mem_debug_panic( "trying to reallocate NULL in (%s:%ld)",
file_name, line_no );
#endif
@@ -799,7 +799,7 @@
return NULL;
new_block = (FT_Pointer)ft_mem_table_alloc( table, new_size );
- if ( new_block == NULL )
+ if ( !new_block )
return NULL;
ft_mem_table_set( table, (FT_Byte*)new_block, new_size, delta );
@@ -840,9 +840,9 @@
memory->free = ft_mem_debug_free;
p = getenv( "FT2_ALLOC_TOTAL_MAX" );
- if ( p != NULL )
+ if ( p )
{
- FT_Long total_max = ft_atol( p );
+ FT_Long total_max = ft_strtol( p, NULL, 10 );
if ( total_max > 0 )
@@ -853,9 +853,9 @@
}
p = getenv( "FT2_ALLOC_COUNT_MAX" );
- if ( p != NULL )
+ if ( p )
{
- FT_Long total_count = ft_atol( p );
+ FT_Long total_count = ft_strtol( p, NULL, 10 );
if ( total_count > 0 )
@@ -866,9 +866,9 @@
}
p = getenv( "FT2_KEEP_ALIVE" );
- if ( p != NULL )
+ if ( p )
{
- FT_Long keep_alive = ft_atol( p );
+ FT_Long keep_alive = ft_strtol( p, NULL, 10 );
if ( keep_alive > 0 )
diff --git a/thirdparty/freetype/src/base/ftdebug.c b/thirdparty/freetype/src/base/ftdebug.c
index 40925d14a0..20c617089f 100644
--- a/thirdparty/freetype/src/base/ftdebug.c
+++ b/thirdparty/freetype/src/base/ftdebug.c
@@ -4,7 +4,7 @@
/* */
/* Debugging and logging component (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftfntfmt.c b/thirdparty/freetype/src/base/ftfntfmt.c
index c6eb3190c6..dcbeba0053 100644
--- a/thirdparty/freetype/src/base/ftfntfmt.c
+++ b/thirdparty/freetype/src/base/ftfntfmt.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file for font formats (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftfstype.c b/thirdparty/freetype/src/base/ftfstype.c
index ae56c8fc8d..cec4fb3025 100644
--- a/thirdparty/freetype/src/base/ftfstype.c
+++ b/thirdparty/freetype/src/base/ftfstype.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file to access FSType data (body). */
/* */
-/* Copyright 2008-2016 by */
+/* Copyright 2008-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftgasp.c b/thirdparty/freetype/src/base/ftgasp.c
index e38e55b6c0..477b72558c 100644
--- a/thirdparty/freetype/src/base/ftgasp.c
+++ b/thirdparty/freetype/src/base/ftgasp.c
@@ -4,7 +4,7 @@
/* */
/* Access of TrueType's `gasp' table (body). */
/* */
-/* Copyright 2007-2016 by */
+/* Copyright 2007-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftgloadr.c b/thirdparty/freetype/src/base/ftgloadr.c
index c4f0ff70f4..8134003b4b 100644
--- a/thirdparty/freetype/src/base/ftgloadr.c
+++ b/thirdparty/freetype/src/base/ftgloadr.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph loader (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftglyph.c b/thirdparty/freetype/src/base/ftglyph.c
index c2376dd03a..9bfb330508 100644
--- a/thirdparty/freetype/src/base/ftglyph.c
+++ b/thirdparty/freetype/src/base/ftglyph.c
@@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -132,16 +132,18 @@
}
- FT_DEFINE_GLYPH(ft_bitmap_glyph_class,
+ FT_DEFINE_GLYPH(
+ ft_bitmap_glyph_class,
+
sizeof ( FT_BitmapGlyphRec ),
FT_GLYPH_FORMAT_BITMAP,
- ft_bitmap_glyph_init,
- ft_bitmap_glyph_done,
- ft_bitmap_glyph_copy,
- 0, /* FT_Glyph_TransformFunc */
- ft_bitmap_glyph_bbox,
- 0 /* FT_Glyph_PrepareFunc */
+ ft_bitmap_glyph_init, /* FT_Glyph_InitFunc glyph_init */
+ ft_bitmap_glyph_done, /* FT_Glyph_DoneFunc glyph_done */
+ ft_bitmap_glyph_copy, /* FT_Glyph_CopyFunc glyph_copy */
+ NULL, /* FT_Glyph_TransformFunc glyph_transform */
+ ft_bitmap_glyph_bbox, /* FT_Glyph_GetBBoxFunc glyph_bbox */
+ NULL /* FT_Glyph_PrepareFunc glyph_prepare */
)
@@ -260,16 +262,18 @@
}
- FT_DEFINE_GLYPH( ft_outline_glyph_class,
+ FT_DEFINE_GLYPH(
+ ft_outline_glyph_class,
+
sizeof ( FT_OutlineGlyphRec ),
FT_GLYPH_FORMAT_OUTLINE,
- ft_outline_glyph_init,
- ft_outline_glyph_done,
- ft_outline_glyph_copy,
- ft_outline_glyph_transform,
- ft_outline_glyph_bbox,
- ft_outline_glyph_prepare
+ ft_outline_glyph_init, /* FT_Glyph_InitFunc glyph_init */
+ ft_outline_glyph_done, /* FT_Glyph_DoneFunc glyph_done */
+ ft_outline_glyph_copy, /* FT_Glyph_CopyFunc glyph_copy */
+ ft_outline_glyph_transform, /* FT_Glyph_TransformFunc glyph_transform */
+ ft_outline_glyph_bbox, /* FT_Glyph_GetBBoxFunc glyph_bbox */
+ ft_outline_glyph_prepare /* FT_Glyph_PrepareFunc glyph_prepare */
)
@@ -542,8 +546,8 @@
/* we render the glyph into a glyph bitmap using a `dummy' glyph slot */
/* then calling FT_Render_Glyph_Internal() */
- FT_MEM_ZERO( &dummy, sizeof ( dummy ) );
- FT_MEM_ZERO( &dummy_internal, sizeof ( dummy_internal ) );
+ FT_ZERO( &dummy );
+ FT_ZERO( &dummy_internal );
dummy.internal = &dummy_internal;
dummy.library = library;
dummy.format = clazz->glyph_format;
diff --git a/thirdparty/freetype/src/base/ftgxval.c b/thirdparty/freetype/src/base/ftgxval.c
index 6667b371a1..ff24d336df 100644
--- a/thirdparty/freetype/src/base/ftgxval.c
+++ b/thirdparty/freetype/src/base/ftgxval.c
@@ -2,9 +2,9 @@
/* */
/* ftgxval.c */
/* */
-/* FreeType API for validating TrueTyepGX/AAT tables (body). */
+/* FreeType API for validating TrueTypeGX/AAT tables (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/base/ftinit.c b/thirdparty/freetype/src/base/ftinit.c
index c2dd0a7b37..b3b08fa541 100644
--- a/thirdparty/freetype/src/base/ftinit.c
+++ b/thirdparty/freetype/src/base/ftinit.c
@@ -4,7 +4,7 @@
/* */
/* FreeType initialization layer (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -226,6 +226,94 @@
}
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+
+#define MAX_LENGTH 128
+
+ /* documentation is in ftmodapi.h */
+
+ FT_EXPORT_DEF( void )
+ FT_Set_Default_Properties( FT_Library library )
+ {
+ const char* env;
+ const char* p;
+ const char* q;
+
+ char module_name[MAX_LENGTH + 1];
+ char property_name[MAX_LENGTH + 1];
+ char property_value[MAX_LENGTH + 1];
+
+ int i;
+
+
+ env = ft_getenv( "FREETYPE_PROPERTIES" );
+ if ( !env )
+ return;
+
+ for ( p = env; *p; p++ )
+ {
+ /* skip leading whitespace and separators */
+ if ( *p == ' ' || *p == '\t' )
+ continue;
+
+ /* read module name, followed by `:' */
+ q = p;
+ for ( i = 0; i < MAX_LENGTH; i++ )
+ {
+ if ( !*p || *p == ':' )
+ break;
+ module_name[i] = *p++;
+ }
+ module_name[i] = '\0';
+
+ if ( !*p || *p != ':' || p == q )
+ break;
+
+ /* read property name, followed by `=' */
+ q = ++p;
+ for ( i = 0; i < MAX_LENGTH; i++ )
+ {
+ if ( !*p || *p == '=' )
+ break;
+ property_name[i] = *p++;
+ }
+ property_name[i] = '\0';
+
+ if ( !*p || *p != '=' || p == q )
+ break;
+
+ /* read property value, followed by whitespace (if any) */
+ q = ++p;
+ for ( i = 0; i < MAX_LENGTH; i++ )
+ {
+ if ( !*p || *p == ' ' || *p == '\t' )
+ break;
+ property_value[i] = *p++;
+ }
+ property_value[i] = '\0';
+
+ if ( !( *p == '\0' || *p == ' ' || *p == '\t' ) || p == q )
+ break;
+
+ /* we completely ignore errors */
+ ft_property_string_set( library,
+ module_name,
+ property_name,
+ property_value );
+ }
+ }
+
+#else
+
+ FT_EXPORT_DEF( void )
+ FT_Set_Default_Properties( FT_Library library )
+ {
+ FT_UNUSED( library );
+ }
+
+#endif
+
+
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_Error )
@@ -256,6 +344,8 @@
else
FT_Add_Default_Modules( *alibrary );
+ FT_Set_Default_Properties( *alibrary );
+
return error;
}
diff --git a/thirdparty/freetype/src/base/ftlcdfil.c b/thirdparty/freetype/src/base/ftlcdfil.c
index 8bcbed7aab..611b39f570 100644
--- a/thirdparty/freetype/src/base/ftlcdfil.c
+++ b/thirdparty/freetype/src/base/ftlcdfil.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for color filtering of subpixel bitmap glyphs (body). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -30,14 +30,13 @@
#define USE_LEGACY
/* FIR filter used by the default and light filters */
- static void
- _ft_lcd_filter_fir( FT_Bitmap* bitmap,
- FT_Render_Mode mode,
- FT_Library library )
+ FT_BASE( void )
+ ft_lcd_filter_fir( FT_Bitmap* bitmap,
+ FT_Render_Mode mode,
+ FT_LcdFiveTapFilter weights )
{
- FT_Byte* weights = library->lcd_weights;
- FT_UInt width = (FT_UInt)bitmap->width;
- FT_UInt height = (FT_UInt)bitmap->rows;
+ FT_UInt width = (FT_UInt)bitmap->width;
+ FT_UInt height = (FT_UInt)bitmap->rows;
/* horizontal in-place FIR filter */
@@ -176,7 +175,7 @@
static void
_ft_lcd_filter_legacy( FT_Bitmap* bitmap,
FT_Render_Mode mode,
- FT_Library library )
+ FT_Byte* weights )
{
FT_UInt width = (FT_UInt)bitmap->width;
FT_UInt height = (FT_UInt)bitmap->rows;
@@ -189,7 +188,7 @@
{ 65538 * 1/13, 65538 * 1/6, 65538 * 9/13 }
};
- FT_UNUSED( library );
+ FT_UNUSED( weights );
/* horizontal in-place intra-pixel filter */
@@ -295,8 +294,8 @@
if ( !weights )
return FT_THROW( Invalid_Argument );
- ft_memcpy( library->lcd_weights, weights, 5 );
- library->lcd_filter_func = _ft_lcd_filter_fir;
+ ft_memcpy( library->lcd_weights, weights, FT_LCD_FILTER_FIVE_TAPS );
+ library->lcd_filter_func = ft_lcd_filter_fir;
library->lcd_extra = 2;
return FT_Err_Ok;
@@ -307,10 +306,10 @@
FT_Library_SetLcdFilter( FT_Library library,
FT_LcdFilter filter )
{
- static const FT_Byte default_filter[5] =
- { 0x08, 0x4d, 0x56, 0x4d, 0x08 };
- static const FT_Byte light_filter[5] =
- { 0x00, 0x55, 0x56, 0x55, 0x00 };
+ static const FT_LcdFiveTapFilter default_weights =
+ { 0x08, 0x4d, 0x56, 0x4d, 0x08 };
+ static const FT_LcdFiveTapFilter light_weights =
+ { 0x00, 0x55, 0x56, 0x55, 0x00 };
if ( !library )
@@ -324,14 +323,18 @@
break;
case FT_LCD_FILTER_DEFAULT:
- ft_memcpy( library->lcd_weights, default_filter, 5 );
- library->lcd_filter_func = _ft_lcd_filter_fir;
+ ft_memcpy( library->lcd_weights,
+ default_weights,
+ FT_LCD_FILTER_FIVE_TAPS );
+ library->lcd_filter_func = ft_lcd_filter_fir;
library->lcd_extra = 2;
break;
case FT_LCD_FILTER_LIGHT:
- ft_memcpy( library->lcd_weights, light_filter, 5 );
- library->lcd_filter_func = _ft_lcd_filter_fir;
+ ft_memcpy( library->lcd_weights,
+ light_weights,
+ FT_LCD_FILTER_FIVE_TAPS );
+ library->lcd_filter_func = ft_lcd_filter_fir;
library->lcd_extra = 2;
break;
@@ -356,6 +359,17 @@
#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+ FT_BASE( void )
+ ft_lcd_filter_fir( FT_Bitmap* bitmap,
+ FT_Render_Mode mode,
+ FT_LcdFiveTapFilter weights )
+ {
+ FT_UNUSED( bitmap );
+ FT_UNUSED( mode );
+ FT_UNUSED( weights );
+ }
+
+
FT_EXPORT_DEF( FT_Error )
FT_Library_SetLcdFilterWeights( FT_Library library,
unsigned char *weights )
diff --git a/thirdparty/freetype/src/base/ftmac.c b/thirdparty/freetype/src/base/ftmac.c
index e97fdbfc22..4b92066da3 100644
--- a/thirdparty/freetype/src/base/ftmac.c
+++ b/thirdparty/freetype/src/base/ftmac.c
@@ -8,7 +8,7 @@
/* This file is for Mac OS X only; see builds/mac/ftoldmac.c for */
/* classic platforms built by MPW. */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -71,6 +71,9 @@
#include FT_INTERNAL_STREAM_H
#include "ftbase.h"
+
+#ifdef FT_MACINTOSH
+
/* This is for Mac OS X. Without redefinition, OS_INLINE */
/* expands to `static inline' which doesn't survive the */
/* -ansi compilation flag of GCC. */
@@ -118,8 +121,6 @@
#endif
-#ifdef FT_MACINTOSH
-
/* This function is deprecated because FSSpec is deprecated in Mac OS X */
FT_EXPORT_DEF( FT_Error )
FT_GetFile_From_Mac_Name( const char* fontName,
@@ -605,7 +606,7 @@
for (;;)
{
post_data = Get1Resource( TTAG_POST, res_id++ );
- if ( post_data == NULL )
+ if ( !post_data )
break; /* we are done */
code = (*post_data)[0];
@@ -644,7 +645,7 @@
for (;;)
{
post_data = Get1Resource( TTAG_POST, res_id++ );
- if ( post_data == NULL )
+ if ( !post_data )
break; /* we are done */
post_size = (FT_ULong)GetHandleSize( post_data ) - 2;
@@ -655,7 +656,7 @@
if ( last_code != -1 )
{
/* we are done adding a chunk, fill in the size field */
- if ( size_p != NULL )
+ if ( size_p )
{
*size_p++ = (FT_Byte)( pfb_chunk_size & 0xFF );
*size_p++ = (FT_Byte)( ( pfb_chunk_size >> 8 ) & 0xFF );
@@ -743,7 +744,7 @@
sfnt = GetResource( TTAG_sfnt, sfnt_id );
- if ( sfnt == NULL )
+ if ( !sfnt )
return FT_THROW( Invalid_Handle );
sfnt_size = (FT_ULong)GetHandleSize( sfnt );
@@ -821,7 +822,7 @@
return FT_THROW( Cannot_Open_Resource );
num_faces_in_res = 0;
- for ( res_index = 1; ; ++res_index )
+ for ( res_index = 1; ; res_index++ )
{
short num_faces_in_fond;
@@ -942,13 +943,14 @@
/* if it works, fine. */
error = FT_New_Face_From_Suitcase( library, pathname, face_index, aface );
- if ( error == 0 )
- return error;
+ if ( error )
+ {
+ /* let it fall through to normal loader (.ttf, .otf, etc.); */
+ /* we signal this by returning no error and no FT_Face */
+ *aface = NULL;
+ }
- /* let it fall through to normal loader (.ttf, .otf, etc.); */
- /* we signal this by returning no error and no FT_Face */
- *aface = NULL;
- return 0;
+ return FT_Err_Ok;
}
@@ -982,12 +984,13 @@
/* try resourcefork based font: LWFN, FFIL */
error = FT_New_Face_From_Resource( library, (UInt8 *)pathname,
face_index, aface );
- if ( error != 0 || *aface != NULL )
+ if ( error || *aface )
return error;
/* let it fall through to normal loader (.ttf, .otf, etc.) */
args.flags = FT_OPEN_PATHNAME;
args.pathname = (char*)pathname;
+
return FT_Open_Face( library, &args, face_index, aface );
}
@@ -1027,7 +1030,7 @@
error = FT_THROW( Cannot_Open_Resource );
error = FT_New_Face_From_Resource( library, pathname, face_index, aface );
- if ( error != 0 || *aface != NULL )
+ if ( error || *aface )
return error;
/* fallback to datafork font */
@@ -1074,7 +1077,12 @@
#endif
}
-#endif /* FT_MACINTOSH */
+#else /* !FT_MACINTOSH */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _ft_mac_dummy;
+
+#endif /* !FT_MACINTOSH */
/* END */
diff --git a/thirdparty/freetype/src/base/ftmm.c b/thirdparty/freetype/src/base/ftmm.c
index 6b759ca467..2cb56a39be 100644
--- a/thirdparty/freetype/src/base/ftmm.c
+++ b/thirdparty/freetype/src/base/ftmm.c
@@ -4,7 +4,7 @@
/* */
/* Multiple Master font support (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,6 +22,7 @@
#include FT_MULTIPLE_MASTERS_H
#include FT_INTERNAL_OBJECTS_H
#include FT_SERVICE_MULTIPLE_MASTERS_H
+#include FT_SERVICE_METRICS_VARIATIONS_H
/*************************************************************************/
@@ -62,6 +63,34 @@
}
+ static FT_Error
+ ft_face_get_mvar_service( FT_Face face,
+ FT_Service_MetricsVariations *aservice )
+ {
+ FT_Error error;
+
+
+ *aservice = NULL;
+
+ if ( !face )
+ return FT_THROW( Invalid_Face_Handle );
+
+ error = FT_ERR( Invalid_Argument );
+
+ if ( FT_HAS_MULTIPLE_MASTERS( face ) )
+ {
+ FT_FACE_LOOKUP_SERVICE( face,
+ *aservice,
+ METRICS_VARIATIONS );
+
+ if ( *aservice )
+ error = FT_Err_Ok;
+ }
+
+ return error;
+ }
+
+
/* documentation is in ftmm.h */
FT_EXPORT_DEF( FT_Error )
@@ -140,6 +169,13 @@
error = service->set_mm_design( face, num_coords, coords );
}
+ /* enforce recomputation of auto-hinting data */
+ if ( !error && face->autohint.finalizer )
+ {
+ face->autohint.finalizer( face->autohint.data );
+ face->autohint.data = NULL;
+ }
+
return error;
}
@@ -151,6 +187,50 @@
FT_UInt num_coords,
FT_Fixed* coords )
{
+ FT_Error error;
+ FT_Service_MultiMasters service_mm = NULL;
+ FT_Service_MetricsVariations service_mvar = NULL;
+
+
+ /* check of `face' delayed to `ft_face_get_mm_service' */
+
+ if ( !coords )
+ return FT_THROW( Invalid_Argument );
+
+ error = ft_face_get_mm_service( face, &service_mm );
+ if ( !error )
+ {
+ error = FT_ERR( Invalid_Argument );
+ if ( service_mm->set_var_design )
+ error = service_mm->set_var_design( face, num_coords, coords );
+ }
+
+ if ( !error )
+ {
+ (void)ft_face_get_mvar_service( face, &service_mvar );
+
+ if ( service_mvar && service_mvar->metrics_adjust )
+ service_mvar->metrics_adjust( face );
+ }
+
+ /* enforce recomputation of auto-hinting data */
+ if ( !error && face->autohint.finalizer )
+ {
+ face->autohint.finalizer( face->autohint.data );
+ face->autohint.data = NULL;
+ }
+
+ return error;
+ }
+
+
+ /* documentation is in ftmm.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Get_Var_Design_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
FT_Error error;
FT_Service_MultiMasters service;
@@ -164,8 +244,8 @@
if ( !error )
{
error = FT_ERR( Invalid_Argument );
- if ( service->set_var_design )
- error = service->set_var_design( face, num_coords, coords );
+ if ( service->get_var_design )
+ error = service->get_var_design( face, num_coords, coords );
}
return error;
@@ -179,6 +259,97 @@
FT_UInt num_coords,
FT_Fixed* coords )
{
+ FT_Error error;
+ FT_Service_MultiMasters service_mm = NULL;
+ FT_Service_MetricsVariations service_mvar = NULL;
+
+
+ /* check of `face' delayed to `ft_face_get_mm_service' */
+
+ if ( !coords )
+ return FT_THROW( Invalid_Argument );
+
+ error = ft_face_get_mm_service( face, &service_mm );
+ if ( !error )
+ {
+ error = FT_ERR( Invalid_Argument );
+ if ( service_mm->set_mm_blend )
+ error = service_mm->set_mm_blend( face, num_coords, coords );
+ }
+
+ if ( !error )
+ {
+ (void)ft_face_get_mvar_service( face, &service_mvar );
+
+ if ( service_mvar && service_mvar->metrics_adjust )
+ service_mvar->metrics_adjust( face );
+ }
+
+ /* enforce recomputation of auto-hinting data */
+ if ( !error && face->autohint.finalizer )
+ {
+ face->autohint.finalizer( face->autohint.data );
+ face->autohint.data = NULL;
+ }
+
+ return error;
+ }
+
+
+ /* documentation is in ftmm.h */
+
+ /* This is exactly the same as the previous function. It exists for */
+ /* orthogonality. */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Set_Var_Blend_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ FT_Error error;
+ FT_Service_MultiMasters service_mm = NULL;
+ FT_Service_MetricsVariations service_mvar = NULL;
+
+
+ /* check of `face' delayed to `ft_face_get_mm_service' */
+
+ if ( !coords )
+ return FT_THROW( Invalid_Argument );
+
+ error = ft_face_get_mm_service( face, &service_mm );
+ if ( !error )
+ {
+ error = FT_ERR( Invalid_Argument );
+ if ( service_mm->set_mm_blend )
+ error = service_mm->set_mm_blend( face, num_coords, coords );
+ }
+
+ if ( !error )
+ {
+ (void)ft_face_get_mvar_service( face, &service_mvar );
+
+ if ( service_mvar && service_mvar->metrics_adjust )
+ service_mvar->metrics_adjust( face );
+ }
+
+ /* enforce recomputation of auto-hinting data */
+ if ( !error && face->autohint.finalizer )
+ {
+ face->autohint.finalizer( face->autohint.data );
+ face->autohint.data = NULL;
+ }
+
+ return error;
+ }
+
+
+ /* documentation is in ftmm.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Get_MM_Blend_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
FT_Error error;
FT_Service_MultiMasters service;
@@ -192,8 +363,8 @@
if ( !error )
{
error = FT_ERR( Invalid_Argument );
- if ( service->set_mm_blend )
- error = service->set_mm_blend( face, num_coords, coords );
+ if ( service->get_mm_blend )
+ error = service->get_mm_blend( face, num_coords, coords );
}
return error;
@@ -206,7 +377,7 @@
/* orthogonality. */
FT_EXPORT_DEF( FT_Error )
- FT_Set_Var_Blend_Coordinates( FT_Face face,
+ FT_Get_Var_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords )
{
@@ -223,8 +394,8 @@
if ( !error )
{
error = FT_ERR( Invalid_Argument );
- if ( service->set_mm_blend )
- error = service->set_mm_blend( face, num_coords, coords );
+ if ( service->get_mm_blend )
+ error = service->get_mm_blend( face, num_coords, coords );
}
return error;
diff --git a/thirdparty/freetype/src/base/ftobjs.c b/thirdparty/freetype/src/base/ftobjs.c
index c2dc6183b0..539116e85c 100644
--- a/thirdparty/freetype/src/base/ftobjs.c
+++ b/thirdparty/freetype/src/base/ftobjs.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType private base classes (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -37,6 +37,9 @@
#include FT_SERVICE_KERNING_H
#include FT_SERVICE_TRUETYPE_ENGINE_H
+#include FT_AUTOHINTER_H
+#include FT_CFF_DRIVER_H
+
#ifdef FT_CONFIG_OPTION_MAC_FONTS
#include "ftbase.h"
#endif
@@ -79,6 +82,15 @@
#define GRID_FIT_METRICS
+ /* forward declaration */
+ static FT_Error
+ ft_open_face_internal( FT_Library library,
+ const FT_Open_Args* args,
+ FT_Long face_index,
+ FT_Face *aface,
+ FT_Bool test_mac_fonts );
+
+
FT_BASE_DEF( FT_Pointer )
ft_service_list_lookup( FT_ServiceDesc service_descriptors,
const char* service_id )
@@ -453,7 +465,8 @@
Exit:
- FT_TRACE4(( "FT_New_GlyphSlot: Return %d\n", error ));
+ FT_TRACE4(( "FT_New_GlyphSlot: Return 0x%x\n", error ));
+
return error;
}
@@ -641,6 +654,9 @@
load_flags &= ~FT_LOAD_RENDER;
}
+ if ( load_flags & FT_LOAD_BITMAP_METRICS_ONLY )
+ load_flags &= ~FT_LOAD_RENDER;
+
/*
* Determine whether we need to auto-hint or not.
* The general rules are:
@@ -686,7 +702,7 @@
/* check the size of the `fpgm' and `prep' tables, too -- */
/* the assumption is that there don't exist real TTFs where */
/* both `fpgm' and `prep' tables are missing */
- if ( ( mode == FT_RENDER_MODE_LIGHT &&
+ if ( ( mode == FT_RENDER_MODE_LIGHT &&
!FT_DRIVER_HINTS_LIGHTLY( driver ) ) ||
( FT_IS_SFNT( face ) &&
ttface->num_locations &&
@@ -1102,7 +1118,7 @@
end = first + face->num_charmaps; /* points after the last one */
- for ( cur = first; cur < end; ++cur )
+ for ( cur = first; cur < end; cur++ )
{
if ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&
cur[0]->encoding_id == TT_APPLE_ID_VARIANT_SELECTOR &&
@@ -1173,6 +1189,8 @@
}
#endif
+ face->internal->random_seed = -1;
+
if ( clazz->init_face )
error = clazz->init_face( *astream,
face,
@@ -1237,7 +1255,7 @@
args.pathname = (char*)pathname;
args.stream = NULL;
- return FT_Open_Face( library, &args, face_index, aface );
+ return ft_open_face_internal( library, &args, face_index, aface, 1 );
}
#endif
@@ -1264,7 +1282,7 @@
args.memory_size = file_size;
args.stream = NULL;
- return FT_Open_Face( library, &args, face_index, aface );
+ return ft_open_face_internal( library, &args, face_index, aface, 1 );
}
@@ -1299,7 +1317,7 @@
/* Finalizer for a memory stream; gets called by FT_Done_Face(). */
/* It frees the memory it uses. */
- /* From ftmac.c. */
+ /* From `ftmac.c'. */
static void
memory_stream_close( FT_Stream stream )
{
@@ -1315,7 +1333,7 @@
/* Create a new memory stream from a buffer and a size. */
- /* From ftmac.c. */
+ /* From `ftmac.c'. */
static FT_Error
new_memory_stream( FT_Library library,
FT_Byte* base,
@@ -1335,7 +1353,7 @@
return FT_THROW( Invalid_Argument );
*astream = NULL;
- memory = library->memory;
+ memory = library->memory;
if ( FT_NEW( stream ) )
goto Exit;
@@ -1351,7 +1369,7 @@
/* Create a new FT_Face given a buffer and a driver name. */
- /* from ftmac.c */
+ /* From `ftmac.c'. */
FT_LOCAL_DEF( FT_Error )
open_face_from_buffer( FT_Library library,
FT_Byte* base,
@@ -1377,11 +1395,11 @@
return error;
}
- args.flags = FT_OPEN_STREAM;
+ args.flags = FT_OPEN_STREAM;
args.stream = stream;
if ( driver_name )
{
- args.flags = args.flags | FT_OPEN_DRIVER;
+ args.flags = args.flags | FT_OPEN_DRIVER;
args.driver = FT_Get_Module( library, driver_name );
}
@@ -1395,9 +1413,9 @@
face_index &= 0x7FFF0000L; /* retain GX data */
#endif
- error = FT_Open_Face( library, &args, face_index, aface );
+ error = ft_open_face_internal( library, &args, face_index, aface, 0 );
- if ( error == FT_Err_Ok )
+ if ( !error )
(*aface)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM;
else
#ifdef FT_MACINTOSH
@@ -1589,6 +1607,7 @@
{
FT_Error error = FT_ERR( Cannot_Open_Resource );
FT_Memory memory = library->memory;
+
FT_Byte* pfb_data = NULL;
int i, type, flags;
FT_ULong len;
@@ -1604,12 +1623,12 @@
/* Find the length of all the POST resources, concatenated. Assume */
/* worst case (each resource in its own section). */
pfb_len = 0;
- for ( i = 0; i < resource_cnt; ++i )
+ for ( i = 0; i < resource_cnt; i++ )
{
error = FT_Stream_Seek( stream, (FT_ULong)offsets[i] );
if ( error )
goto Exit;
- if ( FT_READ_ULONG( temp ) )
+ if ( FT_READ_ULONG( temp ) ) /* actually LONG */
goto Exit;
/* FT2 allocator takes signed long buffer length,
@@ -1617,12 +1636,15 @@
*/
FT_TRACE4(( " POST fragment #%d: length=0x%08x"
" total pfb_len=0x%08x\n",
- i, temp, pfb_len + temp + 6));
+ i, temp, pfb_len + temp + 6 ));
+
if ( FT_MAC_RFORK_MAX_LEN < temp ||
FT_MAC_RFORK_MAX_LEN - temp < pfb_len + 6 )
{
FT_TRACE2(( " MacOS resource length cannot exceed"
- " 0x%08x\n", FT_MAC_RFORK_MAX_LEN ));
+ " 0x%08x\n",
+ FT_MAC_RFORK_MAX_LEN ));
+
error = FT_THROW( Invalid_Offset );
goto Exit;
}
@@ -1630,15 +1652,20 @@
pfb_len += temp + 6;
}
- FT_TRACE2(( " total buffer size to concatenate %d"
- " POST fragments: 0x%08x\n",
- resource_cnt, pfb_len + 2));
- if ( pfb_len + 2 < 6 ) {
+ FT_TRACE2(( " total buffer size to concatenate"
+ " %d POST fragments: 0x%08x\n",
+ resource_cnt, pfb_len + 2 ));
+
+ if ( pfb_len + 2 < 6 )
+ {
FT_TRACE2(( " too long fragment length makes"
- " pfb_len confused: pfb_len=0x%08x\n", pfb_len ));
+ " pfb_len confused: pfb_len=0x%08x\n",
+ pfb_len ));
+
error = FT_THROW( Array_Too_Large );
goto Exit;
}
+
if ( FT_ALLOC( pfb_data, (FT_Long)pfb_len + 2 ) )
goto Exit;
@@ -1651,9 +1678,10 @@
pfb_pos = 6;
pfb_lenpos = 2;
- len = 0;
+ len = 0;
type = 1;
- for ( i = 0; i < resource_cnt; ++i )
+
+ for ( i = 0; i < resource_cnt; i++ )
{
error = FT_Stream_Seek( stream, (FT_ULong)offsets[i] );
if ( error )
@@ -1672,18 +1700,24 @@
if ( FT_READ_USHORT( flags ) )
goto Exit2;
- FT_TRACE3(( "POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n",
- i, offsets[i], rlen, flags ));
+
+ FT_TRACE3(( "POST fragment[%d]:"
+ " offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n",
+ i, offsets[i], rlen, flags ));
error = FT_ERR( Array_Too_Large );
- /* postpone the check of rlen longer than buffer until FT_Stream_Read() */
+
+ /* postpone the check of `rlen longer than buffer' */
+ /* until `FT_Stream_Read' */
+
if ( ( flags >> 8 ) == 0 ) /* Comment, should not be loaded */
{
- FT_TRACE3(( " Skip POST fragment #%d because it is a comment\n", i ));
+ FT_TRACE3(( " Skip POST fragment #%d because it is a comment\n",
+ i ));
continue;
}
- /* the flags are part of the resource, so rlen >= 2. */
+ /* the flags are part of the resource, so rlen >= 2, */
/* but some fonts declare rlen = 0 for empty fragment */
if ( rlen > 2 )
rlen -= 2;
@@ -1695,9 +1729,12 @@
else
{
FT_TRACE3(( " Write POST fragment #%d header (4-byte) to buffer"
- " %p + 0x%08x\n", i, pfb_data, pfb_lenpos ));
+ " %p + 0x%08x\n",
+ i, pfb_data, pfb_lenpos ));
+
if ( pfb_lenpos + 3 > pfb_len + 2 )
goto Exit2;
+
pfb_data[pfb_lenpos ] = (FT_Byte)( len );
pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 );
pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 );
@@ -1707,13 +1744,16 @@
break;
FT_TRACE3(( " Write POST fragment #%d header (6-byte) to buffer"
- " %p + 0x%08x\n", i, pfb_data, pfb_pos ));
+ " %p + 0x%08x\n",
+ i, pfb_data, pfb_pos ));
+
if ( pfb_pos + 6 > pfb_len + 2 )
goto Exit2;
+
pfb_data[pfb_pos++] = 0x80;
type = flags >> 8;
- len = rlen;
+ len = rlen;
pfb_data[pfb_pos++] = (FT_Byte)type;
pfb_lenpos = pfb_pos;
@@ -1727,14 +1767,18 @@
goto Exit2;
FT_TRACE3(( " Load POST fragment #%d (%d byte) to buffer"
- " %p + 0x%08x\n", i, rlen, pfb_data, pfb_pos ));
+ " %p + 0x%08x\n",
+ i, rlen, pfb_data, pfb_pos ));
+
error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen );
if ( error )
goto Exit2;
+
pfb_pos += rlen;
}
error = FT_ERR( Array_Too_Large );
+
if ( pfb_pos + 2 > pfb_len + 2 )
goto Exit2;
pfb_data[pfb_pos++] = 0x80;
@@ -1755,11 +1799,12 @@
aface );
Exit2:
- if ( error == FT_ERR( Array_Too_Large ) )
+ if ( FT_ERR_EQ( error, Array_Too_Large ) )
FT_TRACE2(( " Abort due to too-short buffer to store"
" all POST fragments\n" ));
- else if ( error == FT_ERR( Invalid_Offset ) )
+ else if ( FT_ERR_EQ( error, Invalid_Offset ) )
FT_TRACE2(( " Abort due to invalid offset in a POST fragment\n" ));
+
if ( error )
error = FT_ERR( Cannot_Open_Resource );
FT_FREE( pfb_data );
@@ -1803,7 +1848,7 @@
if ( FT_READ_LONG( rlen ) )
goto Exit;
- if ( rlen == -1 )
+ if ( rlen < 1 )
return FT_THROW( Cannot_Open_Resource );
if ( (FT_ULong)rlen > FT_MAC_RFORK_MAX_LEN )
return FT_THROW( Invalid_Offset );
@@ -1856,19 +1901,19 @@
{
FT_Memory memory = library->memory;
FT_Error error;
- FT_Long map_offset, rdara_pos;
+ FT_Long map_offset, rdata_pos;
FT_Long *data_offsets;
FT_Long count;
error = FT_Raccess_Get_HeaderInfo( library, stream, resource_offset,
- &map_offset, &rdara_pos );
+ &map_offset, &rdata_pos );
if ( error )
return error;
/* POST resources must be sorted to concatenate properly */
error = FT_Raccess_Get_DataOffsets( library, stream,
- map_offset, rdara_pos,
+ map_offset, rdata_pos,
TTAG_POST, TRUE,
&data_offsets, &count );
if ( !error )
@@ -1885,7 +1930,7 @@
/* sfnt resources should not be sorted to preserve the face order by
QuickDraw API */
error = FT_Raccess_Get_DataOffsets( library, stream,
- map_offset, rdara_pos,
+ map_offset, rdata_pos,
TTAG_sfnt, FALSE,
&data_offsets, &count );
if ( !error )
@@ -1918,7 +1963,7 @@
FT_Long dlen, offset;
- if ( NULL == stream )
+ if ( !stream )
return FT_THROW( Invalid_Stream_Operation );
error = FT_Stream_Seek( stream, 0 );
@@ -1992,13 +2037,15 @@
{
FT_TRACE3(( "Skip rule %d: darwin vfs resource fork"
" is already checked and"
- " no font is found\n", i ));
+ " no font is found\n",
+ i ));
continue;
}
if ( errors[i] )
{
- FT_TRACE3(( "Error[%d] has occurred in rule %d\n", errors[i], i ));
+ FT_TRACE3(( "Error 0x%x has occurred in rule %d\n",
+ errors[i], i ));
continue;
}
@@ -2108,6 +2155,17 @@
FT_Long face_index,
FT_Face *aface )
{
+ return ft_open_face_internal( library, args, face_index, aface, 1 );
+ }
+
+
+ static FT_Error
+ ft_open_face_internal( FT_Library library,
+ const FT_Open_Args* args,
+ FT_Long face_index,
+ FT_Face *aface,
+ FT_Bool test_mac_fonts )
+ {
FT_Error error;
FT_Driver driver = NULL;
FT_Memory memory = NULL;
@@ -2118,6 +2176,23 @@
FT_Module* cur;
FT_Module* limit;
+#ifndef FT_CONFIG_OPTION_MAC_FONTS
+ FT_UNUSED( test_mac_fonts );
+#endif
+
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_TRACE3(( "FT_Open_Face: " ));
+ if ( face_index < 0 )
+ FT_TRACE3(( "Requesting number of faces and named instances\n"));
+ else
+ {
+ FT_TRACE3(( "Requesting face %ld", face_index & 0xFFFFL ));
+ if ( face_index & 0x7FFF0000L )
+ FT_TRACE3(( ", named instance %ld", face_index >> 16 ));
+ FT_TRACE3(( "\n" ));
+ }
+#endif
/* test for valid `library' delayed to `FT_Stream_New' */
@@ -2195,7 +2270,8 @@
goto Success;
#ifdef FT_CONFIG_OPTION_MAC_FONTS
- if ( ft_strcmp( cur[0]->clazz->module_name, "truetype" ) == 0 &&
+ if ( test_mac_fonts &&
+ ft_strcmp( cur[0]->clazz->module_name, "truetype" ) == 0 &&
FT_ERR_EQ( error, Table_Missing ) )
{
/* TrueType but essential tables are missing */
@@ -2232,16 +2308,20 @@
goto Fail2;
#if !defined( FT_MACINTOSH ) && defined( FT_CONFIG_OPTION_MAC_FONTS )
- error = load_mac_face( library, stream, face_index, aface, args );
- if ( !error )
+ if ( test_mac_fonts )
{
- /* We don't want to go to Success here. We've already done that. */
- /* On the other hand, if we succeeded we still need to close this */
- /* stream (we opened a different stream which extracted the */
- /* interesting information out of this stream here. That stream */
- /* will still be open and the face will point to it). */
- FT_Stream_Free( stream, external_stream );
- return error;
+ error = load_mac_face( library, stream, face_index, aface, args );
+ if ( !error )
+ {
+ /* We don't want to go to Success here. We've already done */
+ /* that. On the other hand, if we succeeded we still need to */
+ /* close this stream (we opened a different stream which */
+ /* extracted the interesting information out of this stream */
+ /* here. That stream will still be open and the face will */
+ /* point to it). */
+ FT_Stream_Free( stream, external_stream );
+ return error;
+ }
}
if ( FT_ERR_NEQ( error, Unknown_File_Format ) )
@@ -2314,11 +2394,24 @@
if ( bsize->height < 0 )
- bsize->height = (FT_Short)-bsize->height;
+ bsize->height = -bsize->height;
if ( bsize->x_ppem < 0 )
- bsize->x_ppem = (FT_Short)-bsize->x_ppem;
+ bsize->x_ppem = -bsize->x_ppem;
if ( bsize->y_ppem < 0 )
bsize->y_ppem = -bsize->y_ppem;
+
+ /* check whether negation actually has worked */
+ if ( bsize->height < 0 || bsize->x_ppem < 0 || bsize->y_ppem < 0 )
+ {
+ FT_TRACE0(( "FT_Open_Face:"
+ " Invalid bitmap dimensions for strike %d,"
+ " now disabled\n", i ));
+ bsize->width = 0;
+ bsize->height = 0;
+ bsize->size = 0;
+ bsize->x_ppem = 0;
+ bsize->y_ppem = 0;
+ }
}
}
@@ -2336,6 +2429,12 @@
internal->transform_delta.y = 0;
internal->refcount = 1;
+
+ internal->no_stem_darkening = -1;
+
+#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+ ft_memset( internal->lcd_weights, 0, FT_LCD_FILTER_FIVE_TAPS );
+#endif
}
if ( aface )
@@ -2352,7 +2451,20 @@
destroy_face( memory, face, driver );
Exit:
- FT_TRACE4(( "FT_Open_Face: Return %d\n", error ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( !error && face_index < 0 )
+ {
+ FT_TRACE3(( "FT_Open_Face: The font has %ld face%s\n"
+ " and %ld named instance%s for face %ld\n",
+ face->num_faces,
+ face->num_faces == 1 ? "" : "s",
+ face->style_flags >> 16,
+ ( face->style_flags >> 16 ) == 1 ? "" : "s",
+ -face_index - 1 ));
+ }
+#endif
+
+ FT_TRACE4(( "FT_Open_Face: Return 0x%x\n", error ));
return error;
}
@@ -2493,6 +2605,8 @@
FT_Size size = NULL;
FT_ListNode node = NULL;
+ FT_Size_Internal internal = NULL;
+
if ( !face )
return FT_THROW( Invalid_Face_Handle );
@@ -2515,8 +2629,10 @@
size->face = face;
- /* for now, do not use any internal fields in size objects */
- size->internal = NULL;
+ if ( FT_NEW( internal ) )
+ goto Exit;
+
+ size->internal = internal;
if ( clazz->init_size )
error = clazz->init_size( size );
@@ -2618,6 +2734,9 @@
w = FT_PIX_ROUND( w );
h = FT_PIX_ROUND( h );
+ if ( !w || !h )
+ return FT_THROW( Invalid_Pixel_Size );
+
for ( i = 0; i < face->num_fixed_sizes; i++ )
{
FT_Bitmap_Size* bsize = face->available_sizes + i;
@@ -2637,6 +2756,8 @@
}
}
+ FT_TRACE3(( "FT_Match_Size: no matching bitmap strike\n" ));
+
return FT_THROW( Invalid_Pixel_Size );
}
@@ -2939,6 +3060,10 @@
req->type >= FT_SIZE_REQUEST_TYPE_MAX )
return FT_THROW( Invalid_Argument );
+ /* signal the auto-hinter to recompute its size metrics */
+ /* (if requested) */
+ face->size->internal->autohint_metrics.x_scale = 0;
+
clazz = face->driver->clazz;
if ( clazz->request_size )
@@ -3356,7 +3481,7 @@
FT_CMap cmap = NULL;
- if ( clazz == NULL || charmap == NULL || charmap->face == NULL )
+ if ( !clazz || !charmap || !charmap->face )
return FT_THROW( Invalid_Argument );
face = charmap->face;
@@ -3485,6 +3610,90 @@
/* documentation is in freetype.h */
+ FT_EXPORT_DEF( FT_Error )
+ FT_Face_Properties( FT_Face face,
+ FT_UInt num_properties,
+ FT_Parameter* properties )
+ {
+ FT_Error error = FT_Err_Ok;
+
+
+ if ( num_properties > 0 && !properties )
+ {
+ error = FT_THROW( Invalid_Argument );
+ goto Exit;
+ }
+
+ for ( ; num_properties > 0; num_properties-- )
+ {
+ if ( properties->tag == FT_PARAM_TAG_STEM_DARKENING )
+ {
+ if ( properties->data )
+ {
+ if ( *( (FT_Bool*)properties->data ) == TRUE )
+ face->internal->no_stem_darkening = FALSE;
+ else
+ face->internal->no_stem_darkening = TRUE;
+ }
+ else
+ {
+ /* use module default */
+ face->internal->no_stem_darkening = -1;
+ }
+ }
+ else if ( properties->tag == FT_PARAM_TAG_LCD_FILTER_WEIGHTS )
+ {
+#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+ if ( properties->data )
+ ft_memcpy( face->internal->lcd_weights,
+ properties->data,
+ FT_LCD_FILTER_FIVE_TAPS );
+ else
+ {
+ /* Value NULL indicates `no custom weights, use library */
+ /* defaults', signaled by filling the weight field with zeros. */
+ ft_memset( face->internal->lcd_weights,
+ 0,
+ FT_LCD_FILTER_FIVE_TAPS );
+ }
+#else
+ error = FT_THROW( Unimplemented_Feature );
+ goto Exit;
+#endif
+ }
+ else if ( properties->tag == FT_PARAM_TAG_RANDOM_SEED )
+ {
+ if ( properties->data )
+ {
+ face->internal->random_seed = *( (FT_Int32*)properties->data );
+ if ( face->internal->random_seed < 0 )
+ face->internal->random_seed = 0;
+ }
+ else
+ {
+ /* use module default */
+ face->internal->random_seed = -1;
+ }
+ }
+ else
+ {
+ error = FT_THROW( Invalid_Argument );
+ goto Exit;
+ }
+
+ if ( error )
+ break;
+
+ properties++;
+ }
+
+ Exit:
+ return error;
+ }
+
+
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_UInt )
FT_Face_GetCharVariantIndex( FT_Face face,
FT_ULong charcode,
@@ -3501,19 +3710,21 @@
FT_CMap ucmap = FT_CMAP( face->charmap );
- if ( charmap != NULL )
+ if ( charmap )
{
FT_CMap vcmap = FT_CMAP( charmap );
if ( charcode > 0xFFFFFFFFUL )
{
- FT_TRACE1(( "FT_Get_Char_Index: too large charcode" ));
+ FT_TRACE1(( "FT_Face_GetCharVariantIndex:"
+ " too large charcode" ));
FT_TRACE1(( " 0x%x is truncated\n", charcode ));
}
if ( variantSelector > 0xFFFFFFFFUL )
{
- FT_TRACE1(( "FT_Get_Char_Index: too large variantSelector" ));
+ FT_TRACE1(( "FT_Face_GetCharVariantIndex:"
+ " too large variantSelector" ));
FT_TRACE1(( " 0x%x is truncated\n", variantSelector ));
}
@@ -3542,19 +3753,21 @@
FT_CharMap charmap = find_variant_selector_charmap( face );
- if ( charmap != NULL )
+ if ( charmap )
{
FT_CMap vcmap = FT_CMAP( charmap );
if ( charcode > 0xFFFFFFFFUL )
{
- FT_TRACE1(( "FT_Get_Char_Index: too large charcode" ));
+ FT_TRACE1(( "FT_Face_GetCharVariantIsDefault:"
+ " too large charcode" ));
FT_TRACE1(( " 0x%x is truncated\n", charcode ));
}
if ( variantSelector > 0xFFFFFFFFUL )
{
- FT_TRACE1(( "FT_Get_Char_Index: too large variantSelector" ));
+ FT_TRACE1(( "FT_Face_GetCharVariantIsDefault:"
+ " too large variantSelector" ));
FT_TRACE1(( " 0x%x is truncated\n", variantSelector ));
}
@@ -3581,7 +3794,7 @@
FT_CharMap charmap = find_variant_selector_charmap( face );
- if ( charmap != NULL )
+ if ( charmap )
{
FT_CMap vcmap = FT_CMAP( charmap );
FT_Memory memory = FT_FACE_MEMORY( face );
@@ -3609,7 +3822,7 @@
FT_CharMap charmap = find_variant_selector_charmap( face );
- if ( charmap != NULL )
+ if ( charmap )
{
FT_CMap vcmap = FT_CMAP( charmap );
FT_Memory memory = FT_FACE_MEMORY( face );
@@ -3617,7 +3830,7 @@
if ( charcode > 0xFFFFFFFFUL )
{
- FT_TRACE1(( "FT_Get_Char_Index: too large charcode" ));
+ FT_TRACE1(( "FT_Face_GetVariantsOfChar: too large charcode" ));
FT_TRACE1(( " 0x%x is truncated\n", charcode ));
}
@@ -3643,7 +3856,7 @@
FT_CharMap charmap = find_variant_selector_charmap( face );
- if ( charmap != NULL )
+ if ( charmap )
{
FT_CMap vcmap = FT_CMAP( charmap );
FT_Memory memory = FT_FACE_MEMORY( face );
@@ -3771,7 +3984,7 @@
if ( face && FT_IS_SFNT( face ) )
{
FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
- if ( service != NULL )
+ if ( service )
table = service->get_table( face, tag );
}
@@ -3795,7 +4008,7 @@
return FT_THROW( Invalid_Face_Handle );
FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
- if ( service == NULL )
+ if ( !service )
return FT_THROW( Unimplemented_Feature );
return service->load_table( face, tag, offset, buffer, length );
@@ -3820,7 +4033,7 @@
return FT_THROW( Invalid_Face_Handle );
FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
- if ( service == NULL )
+ if ( !service )
return FT_THROW( Unimplemented_Feature );
return service->table_info( face, table_index, tag, &offset, length );
@@ -3842,7 +4055,7 @@
face = charmap->face;
FT_FACE_FIND_SERVICE( face, service, TT_CMAP );
- if ( service == NULL )
+ if ( !service )
return 0;
if ( service->get_cmap_info( charmap, &cmap_info ))
return 0;
@@ -3866,7 +4079,7 @@
face = charmap->face;
FT_FACE_FIND_SERVICE( face, service, TT_CMAP );
- if ( service == NULL )
+ if ( !service )
return -1;
if ( service->get_cmap_info( charmap, &cmap_info ))
return -1;
@@ -4196,7 +4409,7 @@
if ( ft_trace_levels[trace_bitmap] >= 3 )
{
/* we convert to a single bitmap format for computing the checksum */
- if ( !error )
+ if ( !error && slot->bitmap.buffer )
{
FT_Bitmap bitmap;
FT_Error err;
@@ -4475,7 +4688,8 @@
FT_BASE_DEF( FT_Pointer )
ft_module_get_service( FT_Module module,
- const char* service_id )
+ const char* service_id,
+ FT_Bool global )
{
FT_Pointer result = NULL;
@@ -4488,7 +4702,7 @@
if ( module->clazz->get_interface )
result = module->clazz->get_interface( module, service_id );
- if ( result == NULL )
+ if ( global && !result )
{
/* we didn't find it, look in all other modules then */
FT_Library library = module->library;
@@ -4505,7 +4719,7 @@
if ( cur[0]->clazz->get_interface )
{
result = cur[0]->clazz->get_interface( cur[0], service_id );
- if ( result != NULL )
+ if ( result )
break;
}
}
@@ -4564,7 +4778,8 @@
const FT_String* module_name,
const FT_String* property_name,
void* value,
- FT_Bool set )
+ FT_Bool set,
+ FT_Bool value_is_string )
{
FT_Module* cur;
FT_Module* limit;
@@ -4634,8 +4849,13 @@
return FT_THROW( Unimplemented_Feature );
}
- return set ? service->set_property( cur[0], property_name, value )
- : service->get_property( cur[0], property_name, value );
+ return set ? service->set_property( cur[0],
+ property_name,
+ value,
+ value_is_string )
+ : service->get_property( cur[0],
+ property_name,
+ value );
}
@@ -4651,7 +4871,8 @@
module_name,
property_name,
(void*)value,
- TRUE );
+ TRUE,
+ FALSE );
}
@@ -4667,10 +4888,33 @@
module_name,
property_name,
value,
+ FALSE,
FALSE );
}
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+
+ /* this variant is used for handling the FREETYPE_PROPERTIES */
+ /* environment variable */
+
+ FT_BASE_DEF( FT_Error )
+ ft_property_string_set( FT_Library library,
+ const FT_String* module_name,
+ const FT_String* property_name,
+ FT_String* value )
+ {
+ return ft_property_do( library,
+ module_name,
+ property_name,
+ (void*)value,
+ TRUE,
+ TRUE );
+ }
+
+#endif
+
+
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -4926,7 +5170,8 @@
service = (FT_Service_TrueTypeEngine)
ft_module_get_service( module,
- FT_SERVICE_ID_TRUETYPE_ENGINE );
+ FT_SERVICE_ID_TRUETYPE_ENGINE,
+ 0 );
if ( service )
result = service->engine_type;
}
diff --git a/thirdparty/freetype/src/base/ftotval.c b/thirdparty/freetype/src/base/ftotval.c
index fe54e0228a..5fa098691e 100644
--- a/thirdparty/freetype/src/base/ftotval.c
+++ b/thirdparty/freetype/src/base/ftotval.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating OpenType tables (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftoutln.c b/thirdparty/freetype/src/base/ftoutln.c
index fc28225c6a..464a066dcc 100644
--- a/thirdparty/freetype/src/base/ftoutln.c
+++ b/thirdparty/freetype/src/base/ftoutln.c
@@ -4,7 +4,7 @@
/* */
/* FreeType outline management (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -287,7 +287,7 @@
return FT_Err_Ok;
Exit:
- FT_TRACE5(( "FT_Outline_Decompose: Error %d\n", error ));
+ FT_TRACE5(( "FT_Outline_Decompose: Error 0x%x\n", error ));
return error;
Invalid_Outline:
diff --git a/thirdparty/freetype/src/base/ftpatent.c b/thirdparty/freetype/src/base/ftpatent.c
index 4861be130e..9900f99bfc 100644
--- a/thirdparty/freetype/src/base/ftpatent.c
+++ b/thirdparty/freetype/src/base/ftpatent.c
@@ -3,9 +3,9 @@
/* ftpatent.c */
/* */
/* FreeType API for checking patented TrueType bytecode instructions */
-/* (body). Obsolete, retained for backwards compatibility. */
+/* (body). Obsolete, retained for backward compatibility. */
/* */
-/* Copyright 2007-2016 by */
+/* Copyright 2007-2017 by */
/* David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftpfr.c b/thirdparty/freetype/src/base/ftpfr.c
index 81faa529c3..5cc0b70726 100644
--- a/thirdparty/freetype/src/base/ftpfr.c
+++ b/thirdparty/freetype/src/base/ftpfr.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing PFR-specific data (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftpic.c b/thirdparty/freetype/src/base/ftpic.c
index 03769dba22..0f84fddc98 100644
--- a/thirdparty/freetype/src/base/ftpic.c
+++ b/thirdparty/freetype/src/base/ftpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services (body). */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftrfork.c b/thirdparty/freetype/src/base/ftrfork.c
index 4660c971cf..f7b81375dd 100644
--- a/thirdparty/freetype/src/base/ftrfork.c
+++ b/thirdparty/freetype/src/base/ftrfork.c
@@ -4,7 +4,7 @@
/* */
/* Embedded resource forks accessor (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */
@@ -56,7 +56,7 @@
{
FT_Error error;
unsigned char head[16], head2[16];
- FT_Long map_pos, rdata_len;
+ FT_Long map_pos, map_len, rdata_len;
int allzeros, allmatch, i;
FT_Long type_list;
@@ -67,12 +67,15 @@
if ( error )
return error;
- error = FT_Stream_Read( stream, (FT_Byte *)head, 16 );
+ error = FT_Stream_Read( stream, (FT_Byte*)head, 16 );
if ( error )
return error;
/* ensure positive values */
- if ( head[0] >= 0x80 || head[4] >= 0x80 || head[8] >= 0x80 )
+ if ( head[0] >= 0x80 ||
+ head[4] >= 0x80 ||
+ head[8] >= 0x80 ||
+ head[12] >= 0x80 )
return FT_THROW( Unknown_File_Format );
*rdata_pos = ( head[ 0] << 24 ) |
@@ -87,14 +90,36 @@
( head[ 9] << 16 ) |
( head[10] << 8 ) |
head[11];
+ map_len = ( head[12] << 24 ) |
+ ( head[13] << 16 ) |
+ ( head[14] << 8 ) |
+ head[15];
- /* map_len = head[12] .. head[15] */
-
- if ( *rdata_pos != map_pos - rdata_len || map_pos == 0 )
+ /* the map must not be empty */
+ if ( !map_pos )
return FT_THROW( Unknown_File_Format );
- if ( FT_LONG_MAX - rfork_offset < *rdata_pos ||
- FT_LONG_MAX - rfork_offset < map_pos )
+ /* check whether rdata and map overlap */
+ if ( *rdata_pos < map_pos )
+ {
+ if ( *rdata_pos > map_pos - rdata_len )
+ return FT_THROW( Unknown_File_Format );
+ }
+ else
+ {
+ if ( map_pos > *rdata_pos - map_len )
+ return FT_THROW( Unknown_File_Format );
+ }
+
+ /* check whether end of rdata or map exceeds stream size */
+ if ( FT_LONG_MAX - rdata_len < *rdata_pos ||
+ FT_LONG_MAX - map_len < map_pos ||
+
+ FT_LONG_MAX - ( *rdata_pos + rdata_len ) < rfork_offset ||
+ FT_LONG_MAX - ( map_pos + map_len ) < rfork_offset ||
+
+ (FT_ULong)( rfork_offset + *rdata_pos + rdata_len ) > stream->size ||
+ (FT_ULong)( rfork_offset + map_pos + map_len ) > stream->size )
return FT_THROW( Unknown_File_Format );
*rdata_pos += rfork_offset;
@@ -112,7 +137,7 @@
allzeros = 1;
allmatch = 1;
- for ( i = 0; i < 16; ++i )
+ for ( i = 0; i < 16; i++ )
{
if ( head2[i] != 0 )
allzeros = 0;
@@ -124,15 +149,14 @@
/* If we have reached this point then it is probably a mac resource */
/* file. Now, does it contain any interesting resources? */
- /* Skip handle to next resource map, the file resource number, and */
- /* attributes. */
+
(void)FT_STREAM_SKIP( 4 /* skip handle to next resource map */
+ 2 /* skip file resource number */
+ 2 ); /* skip attributes */
- if ( FT_READ_USHORT( type_list ) )
+ if ( FT_READ_SHORT( type_list ) )
return error;
- if ( type_list == -1 )
+ if ( type_list < 0 )
return FT_THROW( Unknown_File_Format );
error = FT_Stream_Seek( stream, (FT_ULong)( map_pos + type_list ) );
@@ -181,15 +205,34 @@
if ( error )
return error;
- if ( FT_READ_USHORT( cnt ) )
+ if ( FT_READ_SHORT( cnt ) )
return error;
cnt++;
- for ( i = 0; i < cnt; ++i )
+ /* `rpos' is a signed 16bit integer offset to resource records; the */
+ /* size of a resource record is 12 bytes. The map header is 28 bytes, */
+ /* and a type list needs 10 bytes or more. If we assume that the name */
+ /* list is empty and we have only a single entry in the type list, */
+ /* there can be at most */
+ /* */
+ /* (32768 - 28 - 10) / 12 = 2727 */
+ /* */
+ /* resources. */
+ /* */
+ /* A type list starts with a two-byte counter, followed by 10-byte */
+ /* type records. Assuming that there are no resources, the number of */
+ /* type records can be at most */
+ /* */
+ /* (32768 - 28 - 2) / 8 = 4079 */
+ /* */
+ if ( cnt > 4079 )
+ return FT_THROW( Invalid_Table );
+
+ for ( i = 0; i < cnt; i++ )
{
if ( FT_READ_LONG( tag_internal ) ||
- FT_READ_USHORT( subcnt ) ||
- FT_READ_USHORT( rpos ) )
+ FT_READ_SHORT( subcnt ) ||
+ FT_READ_SHORT( rpos ) )
return error;
FT_TRACE2(( "Resource tags: %c%c%c%c\n",
@@ -205,6 +248,11 @@
*count = subcnt + 1;
rpos += map_offset;
+ /* a zero count might be valid in the resource specification, */
+ /* however, it is completely useless to us */
+ if ( *count < 1 || *count > 2727 )
+ return FT_THROW( Invalid_Table );
+
error = FT_Stream_Seek( stream, (FT_ULong)rpos );
if ( error )
return error;
@@ -212,35 +260,44 @@
if ( FT_NEW_ARRAY( ref, *count ) )
return error;
- for ( j = 0; j < *count; ++j )
+ for ( j = 0; j < *count; j++ )
{
- if ( FT_READ_USHORT( ref[j].res_id ) )
+ if ( FT_READ_SHORT( ref[j].res_id ) )
goto Exit;
- if ( FT_STREAM_SKIP( 2 ) ) /* resource name */
+ if ( FT_STREAM_SKIP( 2 ) ) /* resource name offset */
goto Exit;
- if ( FT_READ_LONG( temp ) )
+ if ( FT_READ_LONG( temp ) ) /* attributes (8bit), offset (24bit) */
goto Exit;
- if ( FT_STREAM_SKIP( 4 ) ) /* mbz */
+ if ( FT_STREAM_SKIP( 4 ) ) /* mbz */
+ goto Exit;
+
+ if ( ref[j].res_id < 0 || temp < 0 )
+ {
+ error = FT_THROW( Invalid_Table );
goto Exit;
+ }
ref[j].offset = temp & 0xFFFFFFL;
+
FT_TRACE3(( " [%d]:"
" resource_id=0x%04x, offset=0x%08x\n",
j, ref[j].res_id, ref[j].offset ));
}
- if (sort_by_res_id)
+ if ( sort_by_res_id )
{
- ft_qsort( ref, (size_t)*count, sizeof ( FT_RFork_Ref ),
- ( int(*)(const void*, const void*) )
- ft_raccess_sort_ref_by_id );
+ ft_qsort( ref,
+ (size_t)*count,
+ sizeof ( FT_RFork_Ref ),
+ ( int(*)(const void*,
+ const void*) )ft_raccess_sort_ref_by_id );
FT_TRACE3(( " -- sort resources by their ids --\n" ));
- for ( j = 0; j < *count; ++ j ) {
+
+ for ( j = 0; j < *count; j++ )
FT_TRACE3(( " [%d]:"
" resource_id=0x%04x, offset=0x%08x\n",
j, ref[j].res_id, ref[j].offset ));
- }
}
if ( FT_NEW_ARRAY( offsets_internal, *count ) )
@@ -250,7 +307,7 @@
* gap between reference IDs are acceptable?
* further investigation on Apple implementation is needed.
*/
- for ( j = 0; j < *count; ++j )
+ for ( j = 0; j < *count; j++ )
offsets_internal[j] = rdata_pos + ref[j].offset;
*offsets = offsets_internal;
diff --git a/thirdparty/freetype/src/base/ftsnames.c b/thirdparty/freetype/src/base/ftsnames.c
index ce7964118c..3609450088 100644
--- a/thirdparty/freetype/src/base/ftsnames.c
+++ b/thirdparty/freetype/src/base/ftsnames.c
@@ -7,7 +7,7 @@
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,6 +20,8 @@
#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
#include FT_SFNT_NAMES_H
#include FT_INTERNAL_TRUETYPE_TYPES_H
#include FT_INTERNAL_STREAM_H
@@ -54,11 +56,11 @@
if ( idx < (FT_UInt)ttface->num_names )
{
- TT_NameEntryRec* entry = ttface->name_table.names + idx;
+ TT_Name entry = ttface->name_table.names + idx;
/* load name on demand */
- if ( entry->stringLength > 0 && entry->string == NULL )
+ if ( entry->stringLength > 0 && !entry->string )
{
FT_Memory memory = face->memory;
FT_Stream stream = face->stream;
@@ -88,6 +90,58 @@
}
+ /* documentation is in ftsnames.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Get_Sfnt_LangTag( FT_Face face,
+ FT_UInt langID,
+ FT_SfntLangTag *alangTag )
+ {
+ FT_Error error = FT_ERR( Invalid_Argument );
+
+
+ if ( alangTag && face && FT_IS_SFNT( face ) )
+ {
+ TT_Face ttface = (TT_Face)face;
+
+
+ if ( ttface->name_table.format != 1 )
+ return FT_THROW( Invalid_Table );
+
+ if ( langID > 0x8000U &&
+ langID - 0x8000U < ttface->name_table.numLangTagRecords )
+ {
+ TT_LangTag entry = ttface->name_table.langTags +
+ ( langID - 0x8000U );
+
+
+ /* load name on demand */
+ if ( entry->stringLength > 0 && !entry->string )
+ {
+ FT_Memory memory = face->memory;
+ FT_Stream stream = face->stream;
+
+
+ if ( FT_NEW_ARRAY ( entry->string, entry->stringLength ) ||
+ FT_STREAM_SEEK( entry->stringOffset ) ||
+ FT_STREAM_READ( entry->string, entry->stringLength ) )
+ {
+ FT_FREE( entry->string );
+ entry->stringLength = 0;
+ }
+ }
+
+ alangTag->string = (FT_Byte*)entry->string;
+ alangTag->string_len = entry->stringLength;
+
+ error = FT_Err_Ok;
+ }
+ }
+
+ return error;
+ }
+
+
#endif /* TT_CONFIG_OPTION_SFNT_NAMES */
diff --git a/thirdparty/freetype/src/base/ftstream.c b/thirdparty/freetype/src/base/ftstream.c
index bb512a7ccb..a3f8c8b3c9 100644
--- a/thirdparty/freetype/src/base/ftstream.c
+++ b/thirdparty/freetype/src/base/ftstream.c
@@ -4,7 +4,7 @@
/* */
/* I/O stream support (body). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftstroke.c b/thirdparty/freetype/src/base/ftstroke.c
index 4f3c4937b5..d32de0d62b 100644
--- a/thirdparty/freetype/src/base/ftstroke.c
+++ b/thirdparty/freetype/src/base/ftstroke.c
@@ -4,7 +4,7 @@
/* */
/* FreeType path stroker (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftsynth.c b/thirdparty/freetype/src/base/ftsynth.c
index 4b66a33c3f..66dae6037a 100644
--- a/thirdparty/freetype/src/base/ftsynth.c
+++ b/thirdparty/freetype/src/base/ftsynth.c
@@ -4,7 +4,7 @@
/* */
/* FreeType synthesizing code for emboldening and slanting (body). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -130,7 +130,7 @@
if ( ( ystr >> 6 ) > FT_INT_MAX || ( ystr >> 6 ) < FT_INT_MIN )
{
FT_TRACE1(( "FT_GlyphSlot_Embolden:" ));
- FT_TRACE1(( "too strong embolding parameter ystr=%d\n", ystr ));
+ FT_TRACE1(( "too strong emboldening parameter ystr=%d\n", ystr ));
return;
}
error = FT_GlyphSlot_Own_Bitmap( slot );
diff --git a/thirdparty/freetype/src/base/ftsystem.c b/thirdparty/freetype/src/base/ftsystem.c
index ac1f01c8bc..324f949a49 100644
--- a/thirdparty/freetype/src/base/ftsystem.c
+++ b/thirdparty/freetype/src/base/ftsystem.c
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific FreeType low-level system interface (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/fttrigon.c b/thirdparty/freetype/src/base/fttrigon.c
index 7b582c8a3d..7a4d17c829 100644
--- a/thirdparty/freetype/src/base/fttrigon.c
+++ b/thirdparty/freetype/src/base/fttrigon.c
@@ -4,7 +4,7 @@
/* */
/* FreeType trigonometric functions (body). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/fttype1.c b/thirdparty/freetype/src/base/fttype1.c
index 5c0fce8686..4d16a6371a 100644
--- a/thirdparty/freetype/src/base/fttype1.c
+++ b/thirdparty/freetype/src/base/fttype1.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file for PS names support (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftutil.c b/thirdparty/freetype/src/base/ftutil.c
index fad7d1a5fb..dccc209f4d 100644
--- a/thirdparty/freetype/src/base/ftutil.c
+++ b/thirdparty/freetype/src/base/ftutil.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file for memory and list management (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -74,7 +74,7 @@
if ( size > 0 )
{
block = memory->alloc( memory, size );
- if ( block == NULL )
+ if ( !block )
error = FT_THROW( Out_Of_Memory );
}
else if ( size < 0 )
@@ -141,7 +141,7 @@
}
else if ( cur_count == 0 )
{
- FT_ASSERT( block == NULL );
+ FT_ASSERT( !block );
block = ft_mem_alloc( memory, new_count*item_size, &error );
}
@@ -153,7 +153,7 @@
block2 = memory->realloc( memory, cur_size, new_size, block );
- if ( block2 == NULL )
+ if ( !block2 )
error = FT_THROW( Out_Of_Memory );
else
block = block2;
diff --git a/thirdparty/freetype/src/base/ftwinfnt.c b/thirdparty/freetype/src/base/ftwinfnt.c
index 89e9155098..05baa02da6 100644
--- a/thirdparty/freetype/src/base/ftwinfnt.c
+++ b/thirdparty/freetype/src/base/ftwinfnt.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing Windows FNT specific info (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/rules.mk b/thirdparty/freetype/src/base/rules.mk
index aa424c5463..2a1e93cb00 100644
--- a/thirdparty/freetype/src/base/rules.mk
+++ b/thirdparty/freetype/src/base/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/bdf/bdf.c b/thirdparty/freetype/src/bdf/bdf.c
index f95fb76225..e54df6649b 100644
--- a/thirdparty/freetype/src/bdf/bdf.c
+++ b/thirdparty/freetype/src/bdf/bdf.c
@@ -24,9 +24,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-#define FT_MAKE_OPTION_SINGLE_OBJECT
+#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
+
#include "bdflib.c"
#include "bdfdrivr.c"
diff --git a/thirdparty/freetype/src/bdf/bdfdrivr.c b/thirdparty/freetype/src/bdf/bdfdrivr.c
index a381cf68f5..a2242be014 100644
--- a/thirdparty/freetype/src/bdf/bdfdrivr.c
+++ b/thirdparty/freetype/src/bdf/bdfdrivr.c
@@ -276,7 +276,7 @@ THE SOFTWARE.
len = lengths[nn];
- if ( src == NULL )
+ if ( !src )
continue;
/* separate elements with a space */
@@ -423,7 +423,7 @@ THE SOFTWARE.
else
bdfface->family_name = NULL;
- if ( ( error = bdf_interpret_style( face ) ) != 0 )
+ if ( FT_SET_ERROR( bdf_interpret_style( face ) ) )
goto Exit;
/* the number of glyphs (with one slot for the undefined glyph */
@@ -439,7 +439,7 @@ THE SOFTWARE.
FT_Short resolution_x = 0, resolution_y = 0;
- FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) );
+ FT_ZERO( bsize );
bsize->height = (FT_Short)( font->font_ascent + font->font_descent );
@@ -866,10 +866,10 @@ THE SOFTWARE.
0x10000L,
0x20000L,
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
- 0, /* FT_Module_Constructor module_init */
- 0, /* FT_Module_Destructor module_done */
+ NULL, /* FT_Module_Constructor module_init */
+ NULL, /* FT_Module_Destructor module_done */
bdf_driver_requester /* FT_Module_Requester get_interface */
},
@@ -879,16 +879,16 @@ THE SOFTWARE.
BDF_Face_Init, /* FT_Face_InitFunc init_face */
BDF_Face_Done, /* FT_Face_DoneFunc done_face */
- 0, /* FT_Size_InitFunc init_size */
- 0, /* FT_Size_DoneFunc done_size */
- 0, /* FT_Slot_InitFunc init_slot */
- 0, /* FT_Slot_DoneFunc done_slot */
+ NULL, /* FT_Size_InitFunc init_size */
+ NULL, /* FT_Size_DoneFunc done_size */
+ NULL, /* FT_Slot_InitFunc init_slot */
+ NULL, /* FT_Slot_DoneFunc done_slot */
BDF_Glyph_Load, /* FT_Slot_LoadFunc load_glyph */
- 0, /* FT_Face_GetKerningFunc get_kerning */
- 0, /* FT_Face_AttachFunc attach_file */
- 0, /* FT_Face_GetAdvancesFunc get_advances */
+ NULL, /* FT_Face_GetKerningFunc get_kerning */
+ NULL, /* FT_Face_AttachFunc attach_file */
+ NULL, /* FT_Face_GetAdvancesFunc get_advances */
BDF_Size_Request, /* FT_Size_RequestFunc request_size */
BDF_Size_Select /* FT_Size_SelectFunc select_size */
diff --git a/thirdparty/freetype/src/bdf/bdflib.c b/thirdparty/freetype/src/bdf/bdflib.c
index e1dce954ff..7fd95a7385 100644
--- a/thirdparty/freetype/src/bdf/bdflib.c
+++ b/thirdparty/freetype/src/bdf/bdflib.c
@@ -1119,7 +1119,7 @@
/* See whether this property type exists yet or not. */
/* If not, create it. */
propid = ft_hash_str_lookup( name, &(font->proptbl) );
- if ( propid == NULL )
+ if ( !propid )
{
error = bdf_create_property( name, BDF_ATOM, font );
if ( error )
@@ -1144,7 +1144,7 @@
}
fp = font->props + font->props_size;
- FT_MEM_ZERO( fp, sizeof ( bdf_property_t ) );
+ FT_ZERO( fp );
font->props_size++;
}
@@ -2301,7 +2301,7 @@
p->font->comments[p->font->comments_len] = 0;
}
}
- else if ( error == FT_Err_Ok )
+ else if ( !error )
error = FT_THROW( Invalid_File_Format );
*font = p->font;
diff --git a/thirdparty/freetype/src/bzip2/ftbzip2.c b/thirdparty/freetype/src/bzip2/ftbzip2.c
new file mode 100644
index 0000000000..7fc71e7079
--- /dev/null
+++ b/thirdparty/freetype/src/bzip2/ftbzip2.c
@@ -0,0 +1,525 @@
+/***************************************************************************/
+/* */
+/* ftbzip2.c */
+/* */
+/* FreeType support for .bz2 compressed files. */
+/* */
+/* This optional component relies on libbz2. It should mainly be used to */
+/* parse compressed PCF fonts, as found with many X11 server */
+/* distributions. */
+/* */
+/* Copyright 2010-2017 by */
+/* Joel Klinghed. */
+/* */
+/* based on `src/gzip/ftgzip.c' */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_MEMORY_H
+#include FT_INTERNAL_STREAM_H
+#include FT_INTERNAL_DEBUG_H
+#include FT_BZIP2_H
+#include FT_CONFIG_STANDARD_LIBRARY_H
+
+
+#include FT_MODULE_ERRORS_H
+
+#undef FTERRORS_H_
+
+#undef FT_ERR_PREFIX
+#define FT_ERR_PREFIX Bzip2_Err_
+#define FT_ERR_BASE FT_Mod_Err_Bzip2
+
+#include FT_ERRORS_H
+
+
+#ifdef FT_CONFIG_OPTION_USE_BZIP2
+
+#ifdef FT_CONFIG_OPTION_PIC
+#error "bzip2 code does not support PIC yet"
+#endif
+
+#define BZ_NO_STDIO /* Do not need FILE */
+#include <bzlib.h>
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***** *****/
+/***** B Z I P 2 M E M O R Y M A N A G E M E N T *****/
+/***** *****/
+/***************************************************************************/
+/***************************************************************************/
+
+ /* it is better to use FreeType memory routines instead of raw
+ 'malloc/free' */
+
+ typedef void *(* alloc_func)(void*, int, int);
+ typedef void (* free_func)(void*, void*);
+
+ static void*
+ ft_bzip2_alloc( FT_Memory memory,
+ int items,
+ int size )
+ {
+ FT_ULong sz = (FT_ULong)size * (FT_ULong)items;
+ FT_Error error;
+ FT_Pointer p = NULL;
+
+
+ (void)FT_ALLOC( p, sz );
+ return p;
+ }
+
+
+ static void
+ ft_bzip2_free( FT_Memory memory,
+ void* address )
+ {
+ FT_MEM_FREE( address );
+ }
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***** *****/
+/***** B Z I P 2 F I L E D E S C R I P T O R *****/
+/***** *****/
+/***************************************************************************/
+/***************************************************************************/
+
+#define FT_BZIP2_BUFFER_SIZE 4096
+
+ typedef struct FT_BZip2FileRec_
+ {
+ FT_Stream source; /* parent/source stream */
+ FT_Stream stream; /* embedding stream */
+ FT_Memory memory; /* memory allocator */
+ bz_stream bzstream; /* bzlib input stream */
+
+ FT_Byte input[FT_BZIP2_BUFFER_SIZE]; /* input read buffer */
+
+ FT_Byte buffer[FT_BZIP2_BUFFER_SIZE]; /* output buffer */
+ FT_ULong pos; /* position in output */
+ FT_Byte* cursor;
+ FT_Byte* limit;
+
+ } FT_BZip2FileRec, *FT_BZip2File;
+
+
+ /* check and skip .bz2 header - we don't support `transparent' compression */
+ static FT_Error
+ ft_bzip2_check_header( FT_Stream stream )
+ {
+ FT_Error error = FT_Err_Ok;
+ FT_Byte head[4];
+
+
+ if ( FT_STREAM_SEEK( 0 ) ||
+ FT_STREAM_READ( head, 4 ) )
+ goto Exit;
+
+ /* head[0] && head[1] are the magic numbers; */
+ /* head[2] is the version, and head[3] the blocksize */
+ if ( head[0] != 0x42 ||
+ head[1] != 0x5A ||
+ head[2] != 0x68 ) /* only support bzip2 (huffman) */
+ {
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ Exit:
+ return error;
+ }
+
+
+ static FT_Error
+ ft_bzip2_file_init( FT_BZip2File zip,
+ FT_Stream stream,
+ FT_Stream source )
+ {
+ bz_stream* bzstream = &zip->bzstream;
+ FT_Error error = FT_Err_Ok;
+
+
+ zip->stream = stream;
+ zip->source = source;
+ zip->memory = stream->memory;
+
+ zip->limit = zip->buffer + FT_BZIP2_BUFFER_SIZE;
+ zip->cursor = zip->limit;
+ zip->pos = 0;
+
+ /* check .bz2 header */
+ {
+ stream = source;
+
+ error = ft_bzip2_check_header( stream );
+ if ( error )
+ goto Exit;
+
+ if ( FT_STREAM_SEEK( 0 ) )
+ goto Exit;
+ }
+
+ /* initialize bzlib */
+ bzstream->bzalloc = (alloc_func)ft_bzip2_alloc;
+ bzstream->bzfree = (free_func) ft_bzip2_free;
+ bzstream->opaque = zip->memory;
+
+ bzstream->avail_in = 0;
+ bzstream->next_in = (char*)zip->buffer;
+
+ if ( BZ2_bzDecompressInit( bzstream, 0, 0 ) != BZ_OK ||
+ !bzstream->next_in )
+ error = FT_THROW( Invalid_File_Format );
+
+ Exit:
+ return error;
+ }
+
+
+ static void
+ ft_bzip2_file_done( FT_BZip2File zip )
+ {
+ bz_stream* bzstream = &zip->bzstream;
+
+
+ BZ2_bzDecompressEnd( bzstream );
+
+ /* clear the rest */
+ bzstream->bzalloc = NULL;
+ bzstream->bzfree = NULL;
+ bzstream->opaque = NULL;
+ bzstream->next_in = NULL;
+ bzstream->next_out = NULL;
+ bzstream->avail_in = 0;
+ bzstream->avail_out = 0;
+
+ zip->memory = NULL;
+ zip->source = NULL;
+ zip->stream = NULL;
+ }
+
+
+ static FT_Error
+ ft_bzip2_file_reset( FT_BZip2File zip )
+ {
+ FT_Stream stream = zip->source;
+ FT_Error error;
+
+
+ if ( !FT_STREAM_SEEK( 0 ) )
+ {
+ bz_stream* bzstream = &zip->bzstream;
+
+
+ BZ2_bzDecompressEnd( bzstream );
+
+ bzstream->avail_in = 0;
+ bzstream->next_in = (char*)zip->input;
+ bzstream->avail_out = 0;
+ bzstream->next_out = (char*)zip->buffer;
+
+ zip->limit = zip->buffer + FT_BZIP2_BUFFER_SIZE;
+ zip->cursor = zip->limit;
+ zip->pos = 0;
+
+ BZ2_bzDecompressInit( bzstream, 0, 0 );
+ }
+
+ return error;
+ }
+
+
+ static FT_Error
+ ft_bzip2_file_fill_input( FT_BZip2File zip )
+ {
+ bz_stream* bzstream = &zip->bzstream;
+ FT_Stream stream = zip->source;
+ FT_ULong size;
+
+
+ if ( stream->read )
+ {
+ size = stream->read( stream, stream->pos, zip->input,
+ FT_BZIP2_BUFFER_SIZE );
+ if ( size == 0 )
+ {
+ zip->limit = zip->cursor;
+ return FT_THROW( Invalid_Stream_Operation );
+ }
+ }
+ else
+ {
+ size = stream->size - stream->pos;
+ if ( size > FT_BZIP2_BUFFER_SIZE )
+ size = FT_BZIP2_BUFFER_SIZE;
+
+ if ( size == 0 )
+ {
+ zip->limit = zip->cursor;
+ return FT_THROW( Invalid_Stream_Operation );
+ }
+
+ FT_MEM_COPY( zip->input, stream->base + stream->pos, size );
+ }
+ stream->pos += size;
+
+ bzstream->next_in = (char*)zip->input;
+ bzstream->avail_in = size;
+
+ return FT_Err_Ok;
+ }
+
+
+ static FT_Error
+ ft_bzip2_file_fill_output( FT_BZip2File zip )
+ {
+ bz_stream* bzstream = &zip->bzstream;
+ FT_Error error = FT_Err_Ok;
+
+
+ zip->cursor = zip->buffer;
+ bzstream->next_out = (char*)zip->cursor;
+ bzstream->avail_out = FT_BZIP2_BUFFER_SIZE;
+
+ while ( bzstream->avail_out > 0 )
+ {
+ int err;
+
+
+ if ( bzstream->avail_in == 0 )
+ {
+ error = ft_bzip2_file_fill_input( zip );
+ if ( error )
+ break;
+ }
+
+ err = BZ2_bzDecompress( bzstream );
+
+ if ( err == BZ_STREAM_END )
+ {
+ zip->limit = (FT_Byte*)bzstream->next_out;
+ if ( zip->limit == zip->cursor )
+ error = FT_THROW( Invalid_Stream_Operation );
+ break;
+ }
+ else if ( err != BZ_OK )
+ {
+ zip->limit = zip->cursor;
+ error = FT_THROW( Invalid_Stream_Operation );
+ break;
+ }
+ }
+
+ return error;
+ }
+
+
+ /* fill output buffer; `count' must be <= FT_BZIP2_BUFFER_SIZE */
+ static FT_Error
+ ft_bzip2_file_skip_output( FT_BZip2File zip,
+ FT_ULong count )
+ {
+ FT_Error error = FT_Err_Ok;
+ FT_ULong delta;
+
+
+ for (;;)
+ {
+ delta = (FT_ULong)( zip->limit - zip->cursor );
+ if ( delta >= count )
+ delta = count;
+
+ zip->cursor += delta;
+ zip->pos += delta;
+
+ count -= delta;
+ if ( count == 0 )
+ break;
+
+ error = ft_bzip2_file_fill_output( zip );
+ if ( error )
+ break;
+ }
+
+ return error;
+ }
+
+
+ static FT_ULong
+ ft_bzip2_file_io( FT_BZip2File zip,
+ FT_ULong pos,
+ FT_Byte* buffer,
+ FT_ULong count )
+ {
+ FT_ULong result = 0;
+ FT_Error error;
+
+
+ /* Reset inflate stream if we're seeking backwards. */
+ /* Yes, that is not too efficient, but it saves memory :-) */
+ if ( pos < zip->pos )
+ {
+ error = ft_bzip2_file_reset( zip );
+ if ( error )
+ goto Exit;
+ }
+
+ /* skip unwanted bytes */
+ if ( pos > zip->pos )
+ {
+ error = ft_bzip2_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) );
+ if ( error )
+ goto Exit;
+ }
+
+ if ( count == 0 )
+ goto Exit;
+
+ /* now read the data */
+ for (;;)
+ {
+ FT_ULong delta;
+
+
+ delta = (FT_ULong)( zip->limit - zip->cursor );
+ if ( delta >= count )
+ delta = count;
+
+ FT_MEM_COPY( buffer, zip->cursor, delta );
+ buffer += delta;
+ result += delta;
+ zip->cursor += delta;
+ zip->pos += delta;
+
+ count -= delta;
+ if ( count == 0 )
+ break;
+
+ error = ft_bzip2_file_fill_output( zip );
+ if ( error )
+ break;
+ }
+
+ Exit:
+ return result;
+ }
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***** *****/
+/***** B Z E M B E D D I N G S T R E A M *****/
+/***** *****/
+/***************************************************************************/
+/***************************************************************************/
+
+ static void
+ ft_bzip2_stream_close( FT_Stream stream )
+ {
+ FT_BZip2File zip = (FT_BZip2File)stream->descriptor.pointer;
+ FT_Memory memory = stream->memory;
+
+
+ if ( zip )
+ {
+ /* finalize bzip file descriptor */
+ ft_bzip2_file_done( zip );
+
+ FT_FREE( zip );
+
+ stream->descriptor.pointer = NULL;
+ }
+ }
+
+
+ static unsigned long
+ ft_bzip2_stream_io( FT_Stream stream,
+ unsigned long offset,
+ unsigned char* buffer,
+ unsigned long count )
+ {
+ FT_BZip2File zip = (FT_BZip2File)stream->descriptor.pointer;
+
+
+ return ft_bzip2_file_io( zip, offset, buffer, count );
+ }
+
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Stream_OpenBzip2( FT_Stream stream,
+ FT_Stream source )
+ {
+ FT_Error error;
+ FT_Memory memory;
+ FT_BZip2File zip = NULL;
+
+
+ if ( !stream || !source )
+ {
+ error = FT_THROW( Invalid_Stream_Handle );
+ goto Exit;
+ }
+
+ memory = source->memory;
+
+ /*
+ * check the header right now; this prevents allocating unnecessary
+ * objects when we don't need them
+ */
+ error = ft_bzip2_check_header( source );
+ if ( error )
+ goto Exit;
+
+ FT_ZERO( stream );
+ stream->memory = memory;
+
+ if ( !FT_QNEW( zip ) )
+ {
+ error = ft_bzip2_file_init( zip, stream, source );
+ if ( error )
+ {
+ FT_FREE( zip );
+ goto Exit;
+ }
+
+ stream->descriptor.pointer = zip;
+ }
+
+ stream->size = 0x7FFFFFFFL; /* don't know the real size! */
+ stream->pos = 0;
+ stream->base = 0;
+ stream->read = ft_bzip2_stream_io;
+ stream->close = ft_bzip2_stream_close;
+
+ Exit:
+ return error;
+ }
+
+#else /* !FT_CONFIG_OPTION_USE_BZIP2 */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Stream_OpenBzip2( FT_Stream stream,
+ FT_Stream source )
+ {
+ FT_UNUSED( stream );
+ FT_UNUSED( source );
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+#endif /* !FT_CONFIG_OPTION_USE_BZIP2 */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/bzip2/rules.mk b/thirdparty/freetype/src/bzip2/rules.mk
new file mode 100644
index 0000000000..f63ddc4d34
--- /dev/null
+++ b/thirdparty/freetype/src/bzip2/rules.mk
@@ -0,0 +1,64 @@
+#
+# FreeType 2 BZIP2 support configuration rules
+#
+
+# Copyright 2010-2017 by
+# Joel Klinghed.
+#
+# based on `src/lzw/rules.mk'
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT. By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
+
+# BZIP2 driver directory
+#
+BZIP2_DIR := $(SRC_DIR)/bzip2
+
+
+# compilation flags for the driver
+#
+BZIP2_COMPILE := $(CC) $(ANSIFLAGS) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
+
+
+# BZIP2 support sources (i.e., C files)
+#
+BZIP2_DRV_SRC := $(BZIP2_DIR)/ftbzip2.c
+
+# BZIP2 driver object(s)
+#
+# BZIP2_DRV_OBJ_M is used during `multi' builds
+# BZIP2_DRV_OBJ_S is used during `single' builds
+#
+BZIP2_DRV_OBJ_M := $(OBJ_DIR)/ftbzip2.$O
+BZIP2_DRV_OBJ_S := $(OBJ_DIR)/ftbzip2.$O
+
+# BZIP2 support source file for single build
+#
+BZIP2_DRV_SRC_S := $(BZIP2_DIR)/ftbzip2.c
+
+
+# BZIP2 support - single object
+#
+$(BZIP2_DRV_OBJ_S): $(BZIP2_DRV_SRC_S) $(BZIP2_DRV_SRC) $(FREETYPE_H) $(BZIP2_DRV_H)
+ $(BZIP2_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BZIP2_DRV_SRC_S))
+
+
+# BZIP2 support - multiple objects
+#
+$(OBJ_DIR)/%.$O: $(BZIP2_DIR)/%.c $(FREETYPE_H) $(BZIP2_DRV_H)
+ $(BZIP2_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
+
+
+# update main driver object lists
+#
+DRV_OBJS_S += $(BZIP2_DRV_OBJ_S)
+DRV_OBJS_M += $(BZIP2_DRV_OBJ_M)
+
+
+# EOF
diff --git a/thirdparty/freetype/src/cache/ftcache.c b/thirdparty/freetype/src/cache/ftcache.c
index 50941df4c4..8226188314 100644
--- a/thirdparty/freetype/src/cache/ftcache.c
+++ b/thirdparty/freetype/src/cache/ftcache.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType Caching sub-system (body only). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,15 +17,16 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
#include <ft2build.h>
-#include "ftcmru.c"
-#include "ftcmanag.c"
+
+#include "ftcbasic.c"
#include "ftccache.c"
#include "ftccmap.c"
#include "ftcglyph.c"
#include "ftcimage.c"
+#include "ftcmanag.c"
+#include "ftcmru.c"
#include "ftcsbits.c"
-#include "ftcbasic.c"
+
/* END */
diff --git a/thirdparty/freetype/src/cache/ftcbasic.c b/thirdparty/freetype/src/cache/ftcbasic.c
index 8e6de8c41c..289bd5c430 100644
--- a/thirdparty/freetype/src/cache/ftcbasic.c
+++ b/thirdparty/freetype/src/cache/ftcbasic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType basic cache interface (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -237,12 +237,14 @@
{
{
sizeof ( FTC_BasicFamilyRec ),
- ftc_basic_family_compare,
- ftc_basic_family_init,
- 0, /* FTC_MruNode_ResetFunc */
- 0 /* FTC_MruNode_DoneFunc */
+
+ ftc_basic_family_compare, /* FTC_MruNode_CompareFunc node_compare */
+ ftc_basic_family_init, /* FTC_MruNode_InitFunc node_init */
+ NULL, /* FTC_MruNode_ResetFunc node_reset */
+ NULL /* FTC_MruNode_DoneFunc node_done */
},
- ftc_basic_family_load_glyph
+
+ ftc_basic_family_load_glyph /* FTC_IFamily_LoadGlyphFunc family_load_glyph */
};
@@ -250,16 +252,17 @@
const FTC_GCacheClassRec ftc_basic_image_cache_class =
{
{
- ftc_inode_new,
- ftc_inode_weight,
- ftc_gnode_compare,
- ftc_basic_gnode_compare_faceid,
- ftc_inode_free,
+ ftc_inode_new, /* FTC_Node_NewFunc node_new */
+ ftc_inode_weight, /* FTC_Node_WeightFunc node_weight */
+ ftc_gnode_compare, /* FTC_Node_CompareFunc node_compare */
+ ftc_basic_gnode_compare_faceid, /* FTC_Node_CompareFunc node_remove_faceid */
+ ftc_inode_free, /* FTC_Node_FreeFunc node_free */
sizeof ( FTC_GCacheRec ),
- ftc_gcache_init,
- ftc_gcache_done
+ ftc_gcache_init, /* FTC_Cache_InitFunc cache_init */
+ ftc_gcache_done /* FTC_Cache_DoneFunc cache_done */
},
+
(FTC_MruListClass)&ftc_basic_image_family_class
};
@@ -419,11 +422,12 @@
{
{
sizeof ( FTC_BasicFamilyRec ),
- ftc_basic_family_compare,
- ftc_basic_family_init,
- 0, /* FTC_MruNode_ResetFunc */
- 0 /* FTC_MruNode_DoneFunc */
+ ftc_basic_family_compare, /* FTC_MruNode_CompareFunc node_compare */
+ ftc_basic_family_init, /* FTC_MruNode_InitFunc node_init */
+ NULL, /* FTC_MruNode_ResetFunc node_reset */
+ NULL /* FTC_MruNode_DoneFunc node_done */
},
+
ftc_basic_family_get_count,
ftc_basic_family_load_bitmap
};
@@ -433,16 +437,17 @@
const FTC_GCacheClassRec ftc_basic_sbit_cache_class =
{
{
- ftc_snode_new,
- ftc_snode_weight,
- ftc_snode_compare,
- ftc_basic_gnode_compare_faceid,
- ftc_snode_free,
+ ftc_snode_new, /* FTC_Node_NewFunc node_new */
+ ftc_snode_weight, /* FTC_Node_WeightFunc node_weight */
+ ftc_snode_compare, /* FTC_Node_CompareFunc node_compare */
+ ftc_basic_gnode_compare_faceid, /* FTC_Node_CompareFunc node_remove_faceid */
+ ftc_snode_free, /* FTC_Node_FreeFunc node_free */
sizeof ( FTC_GCacheRec ),
- ftc_gcache_init,
- ftc_gcache_done
+ ftc_gcache_init, /* FTC_Cache_InitFunc cache_init */
+ ftc_gcache_done /* FTC_Cache_DoneFunc cache_done */
},
+
(FTC_MruListClass)&ftc_basic_sbit_family_class
};
diff --git a/thirdparty/freetype/src/cache/ftccache.c b/thirdparty/freetype/src/cache/ftccache.c
index 3b1a4bc7e4..37dc3abb1d 100644
--- a/thirdparty/freetype/src/cache/ftccache.c
+++ b/thirdparty/freetype/src/cache/ftccache.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType internal cache interface (body). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -147,7 +147,7 @@
for (;;)
{
node = *pnode;
- if ( node == NULL )
+ if ( !node )
break;
if ( node->hash & ( mask + 1 ) )
@@ -232,7 +232,7 @@
FTC_Node node = *pnode;
- if ( node == NULL )
+ if ( !node )
{
FT_TRACE0(( "ftc_node_hash_unlink: unknown node\n" ));
return;
@@ -288,7 +288,7 @@
cache = manager->caches[node->cache_index];
#ifdef FT_DEBUG_ERROR
- if ( cache == NULL )
+ if ( !cache )
{
FT_TRACE0(( "ftc_node_destroy: invalid node handle\n" ));
return;
@@ -494,7 +494,7 @@
FTC_Node_CompareFunc compare = cache->clazz.node_compare;
- if ( cache == NULL || anode == NULL )
+ if ( !cache || !anode )
return FT_THROW( Invalid_Argument );
/* Go to the `top' node of the list sharing same masked hash */
@@ -505,7 +505,7 @@
for (;;)
{
node = *pnode;
- if ( node == NULL )
+ if ( !node )
goto NewNode;
if ( node->hash == hash &&
@@ -523,7 +523,7 @@
/* Update pnode by modified linked list */
while ( *pnode != node )
{
- if ( *pnode == NULL )
+ if ( !*pnode )
{
FT_ERROR(( "FTC_Cache_Lookup: oops!!! node missing\n" ));
goto NewNode;
@@ -582,7 +582,7 @@
FT_Bool list_changed = FALSE;
- if ( node == NULL )
+ if ( !node )
break;
if ( cache->clazz.node_remove_faceid( node, face_id,
diff --git a/thirdparty/freetype/src/cache/ftccache.h b/thirdparty/freetype/src/cache/ftccache.h
index 1b1295951f..d3c11ce082 100644
--- a/thirdparty/freetype/src/cache/ftccache.h
+++ b/thirdparty/freetype/src/cache/ftccache.h
@@ -4,7 +4,7 @@
/* */
/* FreeType internal cache interface (specification). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -227,7 +227,7 @@ FT_BEGIN_HEADER
for (;;) \
{ \
_node = *_pnode; \
- if ( _node == NULL ) \
+ if ( !_node ) \
goto NewNode_; \
\
if ( _node->hash == _hash && \
@@ -245,7 +245,7 @@ FT_BEGIN_HEADER
/* Update _pnode by possibly modified linked list */ \
while ( *_pnode != _node ) \
{ \
- if ( *_pnode == NULL ) \
+ if ( !*_pnode ) \
{ \
FT_ERROR(( "FTC_CACHE_LOOKUP_CMP: oops!!! node missing\n" )); \
goto NewNode_; \
@@ -325,7 +325,7 @@ FT_BEGIN_HEADER
break; \
\
_try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \
- if ( _try_done > 0 && ( list_changed != NULL ) ) \
+ if ( _try_done > 0 && list_changed != NULL ) \
*(FT_Bool*)( list_changed ) = TRUE; \
\
if ( _try_done == 0 ) \
diff --git a/thirdparty/freetype/src/cache/ftccback.h b/thirdparty/freetype/src/cache/ftccback.h
index 279e94d923..2681e8c022 100644
--- a/thirdparty/freetype/src/cache/ftccback.h
+++ b/thirdparty/freetype/src/cache/ftccback.h
@@ -4,7 +4,7 @@
/* */
/* Callback functions of the caching sub-system (specification only). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftccmap.c b/thirdparty/freetype/src/cache/ftccmap.c
index 41a0ce97dd..2fa84979c8 100644
--- a/thirdparty/freetype/src/cache/ftccmap.c
+++ b/thirdparty/freetype/src/cache/ftccmap.c
@@ -4,7 +4,7 @@
/* */
/* FreeType CharMap cache (body) */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -201,15 +201,15 @@
static
const FTC_CacheClassRec ftc_cmap_cache_class =
{
- ftc_cmap_node_new,
- ftc_cmap_node_weight,
- ftc_cmap_node_compare,
- ftc_cmap_node_remove_faceid,
- ftc_cmap_node_free,
+ ftc_cmap_node_new, /* FTC_Node_NewFunc node_new */
+ ftc_cmap_node_weight, /* FTC_Node_WeightFunc node_weight */
+ ftc_cmap_node_compare, /* FTC_Node_CompareFunc node_compare */
+ ftc_cmap_node_remove_faceid, /* FTC_Node_CompareFunc node_remove_faceid */
+ ftc_cmap_node_free, /* FTC_Node_FreeFunc node_free */
sizeof ( FTC_CacheRec ),
- ftc_cache_init,
- ftc_cache_done,
+ ftc_cache_init, /* FTC_Cache_InitFunc cache_init */
+ ftc_cache_done, /* FTC_Cache_DoneFunc cache_done */
};
diff --git a/thirdparty/freetype/src/cache/ftcerror.h b/thirdparty/freetype/src/cache/ftcerror.h
index 1fd7357a8b..84fe52f546 100644
--- a/thirdparty/freetype/src/cache/ftcerror.h
+++ b/thirdparty/freetype/src/cache/ftcerror.h
@@ -4,7 +4,7 @@
/* */
/* Caching sub-system error codes (specification only). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcglyph.c b/thirdparty/freetype/src/cache/ftcglyph.c
index c4046812dd..d2468f2f43 100644
--- a/thirdparty/freetype/src/cache/ftcglyph.c
+++ b/thirdparty/freetype/src/cache/ftcglyph.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Glyph Image (FT_Glyph) cache (body). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcglyph.h b/thirdparty/freetype/src/cache/ftcglyph.h
index dc7be06f03..cab58ed311 100644
--- a/thirdparty/freetype/src/cache/ftcglyph.h
+++ b/thirdparty/freetype/src/cache/ftcglyph.h
@@ -4,7 +4,7 @@
/* */
/* FreeType abstract glyph cache (specification). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcimage.c b/thirdparty/freetype/src/cache/ftcimage.c
index 74040aa745..359f818cce 100644
--- a/thirdparty/freetype/src/cache/ftcimage.c
+++ b/thirdparty/freetype/src/cache/ftcimage.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Image cache (body). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcimage.h b/thirdparty/freetype/src/cache/ftcimage.h
index 25aa43b97e..14049af9d2 100644
--- a/thirdparty/freetype/src/cache/ftcimage.h
+++ b/thirdparty/freetype/src/cache/ftcimage.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Generic Image cache (specification) */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcmanag.c b/thirdparty/freetype/src/cache/ftcmanag.c
index 661a32af5b..edec2b6b5b 100644
--- a/thirdparty/freetype/src/cache/ftcmanag.c
+++ b/thirdparty/freetype/src/cache/ftcmanag.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Cache Manager (body). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -156,10 +156,11 @@
const FTC_MruListClassRec ftc_size_list_class =
{
sizeof ( FTC_SizeNodeRec ),
- ftc_size_node_compare,
- ftc_size_node_init,
- ftc_size_node_reset,
- ftc_size_node_done
+
+ ftc_size_node_compare, /* FTC_MruNode_CompareFunc node_compare */
+ ftc_size_node_init, /* FTC_MruNode_InitFunc node_init */
+ ftc_size_node_reset, /* FTC_MruNode_ResetFunc node_reset */
+ ftc_size_node_done /* FTC_MruNode_DoneFunc node_done */
};
@@ -296,10 +297,10 @@
{
sizeof ( FTC_FaceNodeRec),
- ftc_face_node_compare,
- ftc_face_node_init,
- 0, /* FTC_MruNode_ResetFunc */
- ftc_face_node_done
+ ftc_face_node_compare, /* FTC_MruNode_CompareFunc node_compare */
+ ftc_face_node_init, /* FTC_MruNode_InitFunc node_init */
+ NULL, /* FTC_MruNode_ResetFunc node_reset */
+ ftc_face_node_done /* FTC_MruNode_DoneFunc node_done */
};
@@ -552,7 +553,7 @@
manager->num_nodes ));
#endif
- if ( manager->cur_weight < manager->max_weight || first == NULL )
+ if ( manager->cur_weight < manager->max_weight || !first )
return;
/* go to last node -- it's a circular list */
@@ -637,7 +638,7 @@
/* try to remove `count' nodes from the list */
- if ( first == NULL ) /* empty list! */
+ if ( !first ) /* empty list! */
return 0;
/* go to last node - it's a circular list */
diff --git a/thirdparty/freetype/src/cache/ftcmanag.h b/thirdparty/freetype/src/cache/ftcmanag.h
index f2c434a135..556842e131 100644
--- a/thirdparty/freetype/src/cache/ftcmanag.h
+++ b/thirdparty/freetype/src/cache/ftcmanag.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Cache Manager (specification). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcmru.c b/thirdparty/freetype/src/cache/ftcmru.c
index d107584a19..e293269f2f 100644
--- a/thirdparty/freetype/src/cache/ftcmru.c
+++ b/thirdparty/freetype/src/cache/ftcmru.c
@@ -4,7 +4,7 @@
/* */
/* FreeType MRU support (body). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -76,7 +76,7 @@
FTC_MruNode first = *plist;
- FT_ASSERT( first != NULL );
+ FT_ASSERT( first );
if ( first != node )
{
@@ -126,7 +126,7 @@
FTC_MruNode prev, next;
- FT_ASSERT( first != NULL );
+ FT_ASSERT( first );
#ifdef FT_DEBUG_ERROR
{
@@ -238,7 +238,7 @@
FTC_MruNode *anode )
{
FT_Error error;
- FTC_MruNode node = NULL;
+ FTC_MruNode node = NULL;
FT_Memory memory = list->memory;
@@ -296,7 +296,7 @@
node = FTC_MruList_Find( list, key );
- if ( node == NULL )
+ if ( !node )
return FTC_MruList_New( list, key, anode );
*anode = node;
@@ -332,7 +332,7 @@
first = list->nodes;
- while ( first && ( selection == NULL || selection( first, key ) ) )
+ while ( first && ( !selection || selection( first, key ) ) )
{
FTC_MruList_Remove( list, first );
first = list->nodes;
diff --git a/thirdparty/freetype/src/cache/ftcmru.h b/thirdparty/freetype/src/cache/ftcmru.h
index ae3c4ce23a..c4c330d558 100644
--- a/thirdparty/freetype/src/cache/ftcmru.h
+++ b/thirdparty/freetype/src/cache/ftcmru.h
@@ -4,7 +4,7 @@
/* */
/* Simple MRU list-cache (specification). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -108,6 +108,7 @@ FT_BEGIN_HEADER
typedef struct FTC_MruListClassRec_
{
FT_Offset node_size;
+
FTC_MruNode_CompareFunc node_compare;
FTC_MruNode_InitFunc node_init;
FTC_MruNode_ResetFunc node_reset;
@@ -115,6 +116,7 @@ FT_BEGIN_HEADER
} FTC_MruListClassRec;
+
typedef struct FTC_MruListRec_
{
FT_UInt num_nodes;
diff --git a/thirdparty/freetype/src/cache/ftcsbits.c b/thirdparty/freetype/src/cache/ftcsbits.c
index d6f1ddcd4e..2f9336decd 100644
--- a/thirdparty/freetype/src/cache/ftcsbits.c
+++ b/thirdparty/freetype/src/cache/ftcsbits.c
@@ -4,7 +4,7 @@
/* */
/* FreeType sbits manager (body). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -378,7 +378,7 @@
*
*/
- if ( sbit->buffer == NULL && sbit->width == 255 )
+ if ( !sbit->buffer && sbit->width == 255 )
{
FT_ULong size;
FT_Error error;
diff --git a/thirdparty/freetype/src/cache/ftcsbits.h b/thirdparty/freetype/src/cache/ftcsbits.h
index a0600ede09..1e15ce9764 100644
--- a/thirdparty/freetype/src/cache/ftcsbits.h
+++ b/thirdparty/freetype/src/cache/ftcsbits.h
@@ -4,7 +4,7 @@
/* */
/* A small-bitmap cache (specification). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/rules.mk b/thirdparty/freetype/src/cache/rules.mk
index 827e259f90..6204689505 100644
--- a/thirdparty/freetype/src/cache/rules.mk
+++ b/thirdparty/freetype/src/cache/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2000-2016 by
+# Copyright 2000-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/cff/cf2arrst.c b/thirdparty/freetype/src/cff/cf2arrst.c
index 89f3e9f1d7..6796450fe1 100644
--- a/thirdparty/freetype/src/cff/cf2arrst.c
+++ b/thirdparty/freetype/src/cff/cf2arrst.c
@@ -58,7 +58,7 @@
FT_Error* error,
size_t sizeItem )
{
- FT_ASSERT( arrstack != NULL );
+ FT_ASSERT( arrstack );
/* initialize the structure */
arrstack->memory = memory;
@@ -78,7 +78,7 @@
FT_Memory memory = arrstack->memory; /* for FT_FREE */
- FT_ASSERT( arrstack != NULL );
+ FT_ASSERT( arrstack );
arrstack->allocated = 0;
arrstack->count = 0;
@@ -95,7 +95,7 @@
cf2_arrstack_setNumElements( CF2_ArrStack arrstack,
size_t numElements )
{
- FT_ASSERT( arrstack != NULL );
+ FT_ASSERT( arrstack );
{
FT_Error error = FT_Err_Ok; /* for FT_REALLOC */
@@ -140,7 +140,7 @@
cf2_arrstack_setCount( CF2_ArrStack arrstack,
size_t numElements )
{
- FT_ASSERT( arrstack != NULL );
+ FT_ASSERT( arrstack );
if ( numElements > arrstack->allocated )
{
@@ -157,7 +157,7 @@
FT_LOCAL_DEF( void )
cf2_arrstack_clear( CF2_ArrStack arrstack )
{
- FT_ASSERT( arrstack != NULL );
+ FT_ASSERT( arrstack );
arrstack->count = 0;
}
@@ -167,7 +167,7 @@
FT_LOCAL_DEF( size_t )
cf2_arrstack_size( const CF2_ArrStack arrstack )
{
- FT_ASSERT( arrstack != NULL );
+ FT_ASSERT( arrstack );
return arrstack->count;
}
@@ -176,7 +176,7 @@
FT_LOCAL_DEF( void* )
cf2_arrstack_getBuffer( const CF2_ArrStack arrstack )
{
- FT_ASSERT( arrstack != NULL );
+ FT_ASSERT( arrstack );
return arrstack->ptr;
}
@@ -190,7 +190,7 @@
void* newPtr;
- FT_ASSERT( arrstack != NULL );
+ FT_ASSERT( arrstack );
if ( idx >= arrstack->count )
{
@@ -212,7 +212,7 @@
cf2_arrstack_push( CF2_ArrStack arrstack,
const void* ptr )
{
- FT_ASSERT( arrstack != NULL );
+ FT_ASSERT( arrstack );
if ( arrstack->count == arrstack->allocated )
{
@@ -225,7 +225,7 @@
}
}
- FT_ASSERT( ptr != NULL );
+ FT_ASSERT( ptr );
{
size_t offset = arrstack->count * arrstack->sizeItem;
diff --git a/thirdparty/freetype/src/cff/cf2error.c b/thirdparty/freetype/src/cff/cf2error.c
index b5595a3d1f..e3dd69f50d 100644
--- a/thirdparty/freetype/src/cff/cf2error.c
+++ b/thirdparty/freetype/src/cff/cf2error.c
@@ -44,7 +44,7 @@
cf2_setError( FT_Error* error,
FT_Error value )
{
- if ( error && *error == 0 )
+ if ( error && !*error )
*error = value;
}
diff --git a/thirdparty/freetype/src/cff/cf2error.h b/thirdparty/freetype/src/cff/cf2error.h
index 512edd1d21..d2c770d297 100644
--- a/thirdparty/freetype/src/cff/cf2error.h
+++ b/thirdparty/freetype/src/cff/cf2error.h
@@ -66,7 +66,7 @@ FT_BEGIN_HEADER
* model our error mechanism on a Java-like exception mechanism.
* When we assign an error code we are thus `throwing' an error.
*
- * The perservation of an error code is done by coding convention.
+ * The preservation of an error code is done by coding convention.
* Upon a function call if the error code is anything other than
* `FT_Err_Ok', which is guaranteed to be zero, we
* will return without altering that error. This will allow the
diff --git a/thirdparty/freetype/src/cff/cf2fixed.h b/thirdparty/freetype/src/cff/cf2fixed.h
index 74af37708b..2e4b5032fa 100644
--- a/thirdparty/freetype/src/cff/cf2fixed.h
+++ b/thirdparty/freetype/src/cff/cf2fixed.h
@@ -51,8 +51,8 @@ FT_BEGIN_HEADER
#define CF2_FIXED_MAX ( (CF2_Fixed)0x7FFFFFFFL )
#define CF2_FIXED_MIN ( (CF2_Fixed)0x80000000L )
-#define CF2_FIXED_ONE 0x10000L
-#define CF2_FIXED_EPSILON 0x0001
+#define CF2_FIXED_ONE ( (CF2_Fixed)0x10000L )
+#define CF2_FIXED_EPSILON ( (CF2_Fixed)0x0001 )
/* in C 89, left and right shift of negative numbers is */
/* implementation specific behaviour in the general case */
diff --git a/thirdparty/freetype/src/cff/cf2font.c b/thirdparty/freetype/src/cff/cf2font.c
index 83fd348f2d..a86e3619b4 100644
--- a/thirdparty/freetype/src/cff/cf2font.c
+++ b/thirdparty/freetype/src/cff/cf2font.c
@@ -234,7 +234,8 @@
}
- /* set up values for the current FontDict and matrix */
+ /* set up values for the current FontDict and matrix; */
+ /* called for each glyph to be rendered */
/* caller's transform is adjusted for subpixel positioning */
static void
@@ -246,6 +247,9 @@
FT_Bool needExtraSetup = FALSE;
+ CFF_VStoreRec* vstore;
+ FT_Bool hasVariations = FALSE;
+
/* character space units */
CF2_Fixed boldenX = font->syntheticEmboldeningAmountX;
CF2_Fixed boldenY = font->syntheticEmboldeningAmountY;
@@ -253,6 +257,9 @@
CFF_SubFont subFont;
CF2_Fixed ppem;
+ CF2_UInt lenNormalizedV = 0;
+ FT_Fixed* normalizedV = NULL;
+
/* clear previous error */
font->error = FT_Err_Ok;
@@ -266,6 +273,48 @@
needExtraSetup = TRUE;
}
+ /* check for variation vectors */
+ vstore = cf2_getVStore( decoder );
+ hasVariations = ( vstore->dataCount != 0 );
+
+ if ( hasVariations )
+ {
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* check whether Private DICT in this subfont needs to be reparsed */
+ font->error = cf2_getNormalizedVector( decoder,
+ &lenNormalizedV,
+ &normalizedV );
+ if ( font->error )
+ return;
+
+ if ( cff_blend_check_vector( &subFont->blend,
+ subFont->private_dict.vsindex,
+ lenNormalizedV,
+ normalizedV ) )
+ {
+ /* blend has changed, reparse */
+ cff_load_private_dict( decoder->cff,
+ subFont,
+ lenNormalizedV,
+ normalizedV );
+ needExtraSetup = TRUE;
+ }
+#endif
+
+ /* copy from subfont */
+ font->blend.font = subFont->blend.font;
+
+ /* clear state of charstring blend */
+ font->blend.usedBV = FALSE;
+
+ /* initialize value for charstring */
+ font->vsindex = subFont->private_dict.vsindex;
+
+ /* store vector inputs for blends in charstring */
+ font->lenNDV = lenNormalizedV;
+ font->NDV = normalizedV;
+ }
+
/* if ppem has changed, we need to recompute some cached data */
/* note: because of CID font matrix concatenation, ppem and transform */
/* do not necessarily track. */
@@ -423,7 +472,8 @@
/* compute blue zones for this instance */
cf2_blues_init( &font->blues, font );
- }
+
+ } /* needExtraSetup */
}
diff --git a/thirdparty/freetype/src/cff/cf2font.h b/thirdparty/freetype/src/cff/cf2font.h
index bd05e69e7b..17ecd17bbb 100644
--- a/thirdparty/freetype/src/cff/cf2font.h
+++ b/thirdparty/freetype/src/cff/cf2font.h
@@ -42,6 +42,7 @@
#include "cf2ft.h"
#include "cf2blues.h"
+#include "cffload.h"
FT_BEGIN_HEADER
@@ -63,6 +64,7 @@ FT_BEGIN_HEADER
FT_Memory memory;
FT_Error error; /* shared error for this instance */
+ FT_Bool isCFF2;
CF2_RenderingFlags renderingFlags;
/* variables that depend on Transform: */
@@ -74,6 +76,12 @@ FT_BEGIN_HEADER
CF2_Matrix outerTransform; /* post hinting; includes rotations */
CF2_Fixed ppem; /* transform-dependent */
+ /* variation data */
+ CFF_BlendRec blend; /* cached charstring blend vector */
+ CF2_UInt vsindex; /* current vsindex */
+ CF2_UInt lenNDV; /* current length NDV or zero */
+ FT_Fixed* NDV; /* ptr to current NDV or NULL */
+
CF2_Int unitsPerEm;
CF2_Fixed syntheticEmboldeningAmountX; /* character space units */
diff --git a/thirdparty/freetype/src/cff/cf2ft.c b/thirdparty/freetype/src/cff/cf2ft.c
index 55f3206ac2..eb8472f119 100644
--- a/thirdparty/freetype/src/cff/cf2ft.c
+++ b/thirdparty/freetype/src/cff/cf2ft.c
@@ -104,7 +104,8 @@
FT_Memory memory = font->memory;
- (void)memory;
+ FT_FREE( font->blend.lastNDV );
+ FT_FREE( font->blend.BV );
}
}
@@ -239,7 +240,7 @@
FT_Memory memory,
FT_Error* error )
{
- FT_MEM_ZERO( outline, sizeof ( CF2_OutlineRec ) );
+ FT_ZERO( outline );
outline->root.memory = memory;
outline->root.error = error;
@@ -311,7 +312,7 @@
font = (CF2_Font)decoder->cff->cf2_instance.data;
/* on first glyph, allocate instance structure */
- if ( decoder->cff->cf2_instance.data == NULL )
+ if ( !decoder->cff->cf2_instance.data )
{
decoder->cff->cf2_instance.finalizer =
(FT_Generic_Finalizer)cf2_free_instance;
@@ -339,6 +340,11 @@
CFF_Builder* builder = &decoder->builder;
CFF_Driver driver = (CFF_Driver)FT_FACE_DRIVER( builder->face );
+ FT_Bool no_stem_darkening_driver =
+ driver->no_stem_darkening;
+ FT_Char no_stem_darkening_font =
+ builder->face->root.internal->no_stem_darkening;
+
/* local error */
FT_Error error2 = FT_Err_Ok;
CF2_BufferRec buf;
@@ -366,10 +372,15 @@
&hinted,
&scaled );
+ /* copy isCFF2 boolean from TT_Face to CF2_Font */
+ font->isCFF2 = builder->face->is_cff2;
+
font->renderingFlags = 0;
if ( hinted )
font->renderingFlags |= CF2_FlagsHinted;
- if ( scaled && !driver->no_stem_darkening )
+ if ( scaled && ( !no_stem_darkening_font ||
+ ( no_stem_darkening_font < 0 &&
+ !no_stem_darkening_driver ) ) )
font->renderingFlags |= CF2_FlagsDarkened;
font->darkenParams[0] = driver->darken_params[0];
@@ -413,6 +424,44 @@
}
+ /* get pointer to VStore structure */
+ FT_LOCAL_DEF( CFF_VStore )
+ cf2_getVStore( CFF_Decoder* decoder )
+ {
+ FT_ASSERT( decoder && decoder->cff );
+
+ return &decoder->cff->vstore;
+ }
+
+
+ /* get maxstack value from CFF2 Top DICT */
+ FT_LOCAL_DEF( FT_UInt )
+ cf2_getMaxstack( CFF_Decoder* decoder )
+ {
+ FT_ASSERT( decoder && decoder->cff );
+
+ return decoder->cff->top_font.font_dict.maxstack;
+ }
+
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* Get normalized design vector for current render request; */
+ /* return pointer and length. */
+ /* */
+ /* Note: Uses FT_Fixed not CF2_Fixed for the vector. */
+ FT_LOCAL_DEF( FT_Error )
+ cf2_getNormalizedVector( CFF_Decoder* decoder,
+ CF2_UInt *len,
+ FT_Fixed* *vec )
+ {
+ FT_ASSERT( decoder && decoder->builder.face );
+ FT_ASSERT( vec && len );
+
+ return cff_get_var_blend( decoder->builder.face, len, NULL, vec, NULL );
+ }
+#endif
+
+
/* get `y_ppem' from `CFF_Size' */
FT_LOCAL_DEF( CF2_Fixed )
cf2_getPpemY( CFF_Decoder* decoder )
diff --git a/thirdparty/freetype/src/cff/cf2ft.h b/thirdparty/freetype/src/cff/cf2ft.h
index 8e55e841a0..b054a6e950 100644
--- a/thirdparty/freetype/src/cff/cf2ft.h
+++ b/thirdparty/freetype/src/cff/cf2ft.h
@@ -64,6 +64,18 @@ FT_BEGIN_HEADER
FT_LOCAL( CFF_SubFont )
cf2_getSubfont( CFF_Decoder* decoder );
+ FT_LOCAL( CFF_VStore )
+ cf2_getVStore( CFF_Decoder* decoder );
+
+ FT_LOCAL( FT_UInt )
+ cf2_getMaxstack( CFF_Decoder* decoder );
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ FT_LOCAL( FT_Error )
+ cf2_getNormalizedVector( CFF_Decoder* decoder,
+ CF2_UInt *len,
+ FT_Fixed* *vec );
+#endif
FT_LOCAL( CF2_Fixed )
cf2_getPpemY( CFF_Decoder* decoder );
diff --git a/thirdparty/freetype/src/cff/cf2hints.c b/thirdparty/freetype/src/cff/cf2hints.c
index bbbe8e3c32..c8f7dfeba6 100644
--- a/thirdparty/freetype/src/cff/cf2hints.c
+++ b/thirdparty/freetype/src/cff/cf2hints.c
@@ -401,10 +401,10 @@
/* calculate all four possibilities; moves down are negative */
CF2_Fixed downMoveDown = 0 - fracDown;
CF2_Fixed upMoveDown = 0 - fracUp;
- CF2_Fixed downMoveUp = fracDown == 0
+ CF2_Fixed downMoveUp = ( fracDown == 0 )
? 0
: cf2_intToFixed( 1 ) - fracDown;
- CF2_Fixed upMoveUp = fracUp == 0
+ CF2_Fixed upMoveUp = ( fracUp == 0 )
? 0
: cf2_intToFixed( 1 ) - fracUp;
diff --git a/thirdparty/freetype/src/cff/cf2intrp.c b/thirdparty/freetype/src/cff/cf2intrp.c
index 7d663dd0ec..40bd9059a1 100644
--- a/thirdparty/freetype/src/cff/cf2intrp.c
+++ b/thirdparty/freetype/src/cff/cf2intrp.c
@@ -47,6 +47,8 @@
#include "cf2error.h"
+#include "cffload.h"
+
/*************************************************************************/
/* */
@@ -58,12 +60,6 @@
#define FT_COMPONENT trace_cf2interp
- /* some operators are not implemented yet */
-#define CF2_FIXME FT_TRACE4(( "cf2_interpT2CharString:" \
- " operator not implemented yet\n" ))
-
-
-
FT_LOCAL_DEF( void )
cf2_hintmask_init( CF2_HintMask hintmask,
FT_Error* error )
@@ -215,8 +211,8 @@
cf2_cmdESC, /* 12 */
cf2_cmdRESERVED_13, /* 13 */
cf2_cmdENDCHAR, /* 14 */
- cf2_cmdRESERVED_15, /* 15 */
- cf2_cmdRESERVED_16, /* 16 */
+ cf2_cmdVSINDEX, /* 15 */
+ cf2_cmdBLEND, /* 16 */
cf2_cmdRESERVED_17, /* 17 */
cf2_cmdHSTEMHM, /* 18 */
cf2_cmdHINTMASK, /* 19 */
@@ -273,7 +269,8 @@
cf2_escHFLEX, /* 34 */
cf2_escFLEX, /* 35 */
cf2_escHFLEX1, /* 36 */
- cf2_escFLEX1 /* 37 */
+ cf2_escFLEX1, /* 37 */
+ cf2_escRESERVED_38 /* 38 & all higher */
};
@@ -336,22 +333,22 @@
FT_Bool doConditionalLastRead )
{
CF2_Fixed vals[14];
- CF2_UInt index;
+ CF2_UInt idx;
FT_Bool isHFlex;
CF2_Int top, i, j;
vals[0] = *curX;
vals[1] = *curY;
- index = 0;
- isHFlex = readFromStack[9] == FALSE;
+ idx = 0;
+ isHFlex = FT_BOOL( readFromStack[9] == FALSE );
top = isHFlex ? 9 : 10;
for ( i = 0; i < top; i++ )
{
vals[i + 2] = vals[i];
if ( readFromStack[i] )
- vals[i + 2] += cf2_stack_getReal( opStack, index++ );
+ vals[i + 2] += cf2_stack_getReal( opStack, idx++ );
}
if ( isHFlex )
@@ -361,7 +358,7 @@
{
FT_Bool lastIsX = (FT_Bool)( cf2_fixedAbs( vals[10] - *curX ) >
cf2_fixedAbs( vals[11] - *curY ) );
- CF2_Fixed lastVal = cf2_stack_getReal( opStack, index );
+ CF2_Fixed lastVal = cf2_stack_getReal( opStack, idx );
if ( lastIsX )
@@ -378,12 +375,12 @@
else
{
if ( readFromStack[10] )
- vals[12] = vals[10] + cf2_stack_getReal( opStack, index++ );
+ vals[12] = vals[10] + cf2_stack_getReal( opStack, idx++ );
else
vals[12] = *curX;
if ( readFromStack[11] )
- vals[13] = vals[11] + cf2_stack_getReal( opStack, index );
+ vals[13] = vals[11] + cf2_stack_getReal( opStack, idx );
else
vals[13] = *curY;
}
@@ -403,6 +400,43 @@
}
+ /* Blend numOperands on the stack, */
+ /* store results into the first numBlends values, */
+ /* then pop remaining arguments. */
+ static void
+ cf2_doBlend( const CFF_Blend blend,
+ CF2_Stack opStack,
+ CF2_UInt numBlends )
+ {
+ CF2_UInt delta;
+ CF2_UInt base;
+ CF2_UInt i, j;
+ CF2_UInt numOperands = (CF2_UInt)( numBlends * blend->lenBV );
+
+
+ base = cf2_stack_count( opStack ) - numOperands;
+ delta = base + numBlends;
+
+ for ( i = 0; i < numBlends; i++ )
+ {
+ const CF2_Fixed* weight = &blend->BV[1];
+
+ /* start with first term */
+ CF2_Fixed sum = cf2_stack_getReal( opStack, i + base );
+
+
+ for ( j = 1; j < blend->lenBV; j++ )
+ sum += FT_MulFix( *weight++, cf2_stack_getReal( opStack, delta++ ) );
+
+ /* store blended result */
+ cf2_stack_setReal( opStack, i + base, sum );
+ }
+
+ /* leave only `numBlends' results on stack */
+ cf2_stack_pop( opStack, numOperands - numBlends );
+ }
+
+
/*
* `error' is a shared error code used by many objects in this
* routine. Before the code continues from an error, it must check and
@@ -445,6 +479,7 @@
CF2_Fixed hintOriginY = curY;
CF2_Stack opStack = NULL;
+ FT_UInt stackSize;
FT_Byte op1; /* first opcode byte */
CF2_F16Dot16 storage[CF2_STORAGE_SIZE]; /* for `put' and `get' */
@@ -469,6 +504,8 @@
CF2_GlyphPathRec glyphPath;
+ FT_ZERO( &storage );
+
/* initialize the remaining objects */
cf2_arrstack_init( &subrStack,
memory,
@@ -518,19 +555,24 @@
* If one of the above operators occurs without explicitly specifying
* a width, we assume the default width.
*
+ * CFF2 charstrings always return the default width (0).
+ *
*/
- haveWidth = FALSE;
+ haveWidth = font->isCFF2 ? TRUE : FALSE;
*width = cf2_getDefaultWidthX( decoder );
/*
- * Note: at this point, all pointers to resources must be NULL
- * and all local objects must be initialized.
- * There must be no branches to exit: above this point.
+ * Note: At this point, all pointers to resources must be NULL
+ * and all local objects must be initialized.
+ * There must be no branches to `exit:' above this point.
*
*/
/* allocate an operand stack */
- opStack = cf2_stack_init( memory, error );
+ stackSize = font->isCFF2 ? cf2_getMaxstack( decoder )
+ : CF2_OPERAND_STACK_SIZE;
+ opStack = cf2_stack_init( memory, error, stackSize );
+
if ( !opStack )
{
lastError = FT_THROW( Out_Of_Memory );
@@ -559,14 +601,23 @@
{
/* If we've reached the end of the charstring, simulate a */
/* cf2_cmdRETURN or cf2_cmdENDCHAR. */
+ /* We do this for both CFF and CFF2. */
if ( charstringIndex )
op1 = cf2_cmdRETURN; /* end of buffer for subroutine */
else
op1 = cf2_cmdENDCHAR; /* end of buffer for top level charstring */
}
else
+ {
op1 = (FT_Byte)cf2_buf_readByte( charstring );
+ /* Explicit RETURN and ENDCHAR in CFF2 should be ignored. */
+ /* Note: Trace message will report 0 instead of 11 or 14. */
+ if ( ( op1 == cf2_cmdRETURN || op1 == cf2_cmdENDCHAR ) &&
+ font->isCFF2 )
+ op1 = cf2_cmdRESERVED_0;
+ }
+
/* check for errors once per loop */
if ( *error )
goto exit;
@@ -584,13 +635,78 @@
case cf2_cmdRESERVED_2:
case cf2_cmdRESERVED_9:
case cf2_cmdRESERVED_13:
- case cf2_cmdRESERVED_15:
- case cf2_cmdRESERVED_16:
case cf2_cmdRESERVED_17:
/* we may get here if we have a prior error */
FT_TRACE4(( " unknown op (%d)\n", op1 ));
break;
+ case cf2_cmdVSINDEX:
+ FT_TRACE4(( " vsindex\n" ));
+
+ if ( !font->isCFF2 )
+ break; /* clear stack & ignore */
+
+ if ( font->blend.usedBV )
+ {
+ /* vsindex not allowed after blend */
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ {
+ FT_Int temp = cf2_stack_popInt( opStack );
+
+
+ if ( temp >= 0 )
+ font->vsindex = (FT_UInt)temp;
+ }
+ break;
+
+ case cf2_cmdBLEND:
+ {
+ FT_UInt numBlends;
+
+
+ FT_TRACE4(( " blend\n" ));
+
+ if ( !font->isCFF2 )
+ break; /* clear stack & ignore */
+
+ /* do we have a `blend' op in a non-variant font? */
+ if ( !font->blend.font )
+ {
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ /* check cached blend vector */
+ if ( cff_blend_check_vector( &font->blend,
+ font->vsindex,
+ font->lenNDV,
+ font->NDV ) )
+ {
+ lastError = cff_blend_build_vector( &font->blend,
+ font->vsindex,
+ font->lenNDV,
+ font->NDV );
+ if ( lastError )
+ goto exit;
+ }
+
+ /* do the blend */
+ numBlends = (FT_UInt)cf2_stack_popInt( opStack );
+ if ( numBlends > stackSize )
+ {
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ cf2_doBlend( &font->blend, opStack, numBlends );
+
+ font->blend.usedBV = TRUE;
+ }
+ continue; /* do not clear the stack */
+
case cf2_cmdHSTEMHM:
case cf2_cmdHSTEM:
FT_TRACE4(( op1 == cf2_cmdHSTEMHM ? " hstemhm\n" : " hstem\n" ));
@@ -659,16 +775,16 @@
case cf2_cmdRLINETO:
{
- CF2_UInt index;
+ CF2_UInt idx;
CF2_UInt count = cf2_stack_count( opStack );
FT_TRACE4(( " rlineto\n" ));
- for ( index = 0; index < count; index += 2 )
+ for ( idx = 0; idx < count; idx += 2 )
{
- curX += cf2_stack_getReal( opStack, index + 0 );
- curY += cf2_stack_getReal( opStack, index + 1 );
+ curX += cf2_stack_getReal( opStack, idx + 0 );
+ curY += cf2_stack_getReal( opStack, idx + 1 );
cf2_glyphpath_lineTo( &glyphPath, curX, curY );
}
@@ -680,17 +796,17 @@
case cf2_cmdHLINETO:
case cf2_cmdVLINETO:
{
- CF2_UInt index;
+ CF2_UInt idx;
CF2_UInt count = cf2_stack_count( opStack );
- FT_Bool isX = op1 == cf2_cmdHLINETO;
+ FT_Bool isX = FT_BOOL( op1 == cf2_cmdHLINETO );
FT_TRACE4(( isX ? " hlineto\n" : " vlineto\n" ));
- for ( index = 0; index < count; index++ )
+ for ( idx = 0; idx < count; idx++ )
{
- CF2_Fixed v = cf2_stack_getReal( opStack, index );
+ CF2_Fixed v = cf2_stack_getReal( opStack, idx );
if ( isX )
@@ -711,33 +827,33 @@
case cf2_cmdRRCURVETO:
{
CF2_UInt count = cf2_stack_count( opStack );
- CF2_UInt index = 0;
+ CF2_UInt idx = 0;
FT_TRACE4(( op1 == cf2_cmdRCURVELINE ? " rcurveline\n"
: " rrcurveto\n" ));
- while ( index + 6 <= count )
+ while ( idx + 6 <= count )
{
- CF2_Fixed x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;
- CF2_Fixed y1 = cf2_stack_getReal( opStack, index + 1 ) + curY;
- CF2_Fixed x2 = cf2_stack_getReal( opStack, index + 2 ) + x1;
- CF2_Fixed y2 = cf2_stack_getReal( opStack, index + 3 ) + y1;
- CF2_Fixed x3 = cf2_stack_getReal( opStack, index + 4 ) + x2;
- CF2_Fixed y3 = cf2_stack_getReal( opStack, index + 5 ) + y2;
+ CF2_Fixed x1 = cf2_stack_getReal( opStack, idx + 0 ) + curX;
+ CF2_Fixed y1 = cf2_stack_getReal( opStack, idx + 1 ) + curY;
+ CF2_Fixed x2 = cf2_stack_getReal( opStack, idx + 2 ) + x1;
+ CF2_Fixed y2 = cf2_stack_getReal( opStack, idx + 3 ) + y1;
+ CF2_Fixed x3 = cf2_stack_getReal( opStack, idx + 4 ) + x2;
+ CF2_Fixed y3 = cf2_stack_getReal( opStack, idx + 5 ) + y2;
cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
- curX = x3;
- curY = y3;
- index += 6;
+ curX = x3;
+ curY = y3;
+ idx += 6;
}
if ( op1 == cf2_cmdRCURVELINE )
{
- curX += cf2_stack_getReal( opStack, index + 0 );
- curY += cf2_stack_getReal( opStack, index + 1 );
+ curX += cf2_stack_getReal( opStack, idx + 0 );
+ curY += cf2_stack_getReal( opStack, idx + 1 );
cf2_glyphpath_lineTo( &glyphPath, curX, curY );
}
@@ -828,440 +944,469 @@
FT_Byte op2 = (FT_Byte)cf2_buf_readByte( charstring );
+ /* first switch for 2-byte operators handles CFF2 */
+ /* and opcodes that are reserved for both CFF and CFF2 */
switch ( op2 )
{
- case cf2_escDOTSECTION:
- /* something about `flip type of locking' -- ignore it */
- FT_TRACE4(( " dotsection\n" ));
+ case cf2_escHFLEX:
+ {
+ static const FT_Bool readFromStack[12] =
+ {
+ TRUE /* dx1 */, FALSE /* dy1 */,
+ TRUE /* dx2 */, TRUE /* dy2 */,
+ TRUE /* dx3 */, FALSE /* dy3 */,
+ TRUE /* dx4 */, FALSE /* dy4 */,
+ TRUE /* dx5 */, FALSE /* dy5 */,
+ TRUE /* dx6 */, FALSE /* dy6 */
+ };
- break;
- case cf2_escAND:
- {
- CF2_F16Dot16 arg1;
- CF2_F16Dot16 arg2;
+ FT_TRACE4(( " hflex\n" ));
+
+ cf2_doFlex( opStack,
+ &curX,
+ &curY,
+ &glyphPath,
+ readFromStack,
+ FALSE /* doConditionalLastRead */ );
+ }
+ continue;
+ case cf2_escFLEX:
+ {
+ static const FT_Bool readFromStack[12] =
+ {
+ TRUE /* dx1 */, TRUE /* dy1 */,
+ TRUE /* dx2 */, TRUE /* dy2 */,
+ TRUE /* dx3 */, TRUE /* dy3 */,
+ TRUE /* dx4 */, TRUE /* dy4 */,
+ TRUE /* dx5 */, TRUE /* dy5 */,
+ TRUE /* dx6 */, TRUE /* dy6 */
+ };
- FT_TRACE4(( " and\n" ));
- arg2 = cf2_stack_popFixed( opStack );
- arg1 = cf2_stack_popFixed( opStack );
+ FT_TRACE4(( " flex\n" ));
- cf2_stack_pushInt( opStack, arg1 && arg2 );
+ cf2_doFlex( opStack,
+ &curX,
+ &curY,
+ &glyphPath,
+ readFromStack,
+ FALSE /* doConditionalLastRead */ );
}
- continue; /* do not clear the stack */
+ break; /* TODO: why is this not a continue? */
- case cf2_escOR:
+ case cf2_escHFLEX1:
{
- CF2_F16Dot16 arg1;
- CF2_F16Dot16 arg2;
-
+ static const FT_Bool readFromStack[12] =
+ {
+ TRUE /* dx1 */, TRUE /* dy1 */,
+ TRUE /* dx2 */, TRUE /* dy2 */,
+ TRUE /* dx3 */, FALSE /* dy3 */,
+ TRUE /* dx4 */, FALSE /* dy4 */,
+ TRUE /* dx5 */, TRUE /* dy5 */,
+ TRUE /* dx6 */, FALSE /* dy6 */
+ };
- FT_TRACE4(( " or\n" ));
- arg2 = cf2_stack_popFixed( opStack );
- arg1 = cf2_stack_popFixed( opStack );
+ FT_TRACE4(( " hflex1\n" ));
- cf2_stack_pushInt( opStack, arg1 || arg2 );
+ cf2_doFlex( opStack,
+ &curX,
+ &curY,
+ &glyphPath,
+ readFromStack,
+ FALSE /* doConditionalLastRead */ );
}
- continue; /* do not clear the stack */
+ continue;
- case cf2_escNOT:
+ case cf2_escFLEX1:
{
- CF2_F16Dot16 arg;
-
+ static const FT_Bool readFromStack[12] =
+ {
+ TRUE /* dx1 */, TRUE /* dy1 */,
+ TRUE /* dx2 */, TRUE /* dy2 */,
+ TRUE /* dx3 */, TRUE /* dy3 */,
+ TRUE /* dx4 */, TRUE /* dy4 */,
+ TRUE /* dx5 */, TRUE /* dy5 */,
+ FALSE /* dx6 */, FALSE /* dy6 */
+ };
- FT_TRACE4(( " not\n" ));
- arg = cf2_stack_popFixed( opStack );
+ FT_TRACE4(( " flex1\n" ));
- cf2_stack_pushInt( opStack, !arg );
+ cf2_doFlex( opStack,
+ &curX,
+ &curY,
+ &glyphPath,
+ readFromStack,
+ TRUE /* doConditionalLastRead */ );
}
- continue; /* do not clear the stack */
+ continue;
+
+ /* these opcodes are reserved in both CFF & CFF2 */
+ case cf2_escRESERVED_1:
+ case cf2_escRESERVED_2:
+ case cf2_escRESERVED_6:
+ case cf2_escRESERVED_7:
+ case cf2_escRESERVED_8:
+ case cf2_escRESERVED_13:
+ case cf2_escRESERVED_16:
+ case cf2_escRESERVED_17:
+ case cf2_escRESERVED_19:
+ case cf2_escRESERVED_25:
+ case cf2_escRESERVED_31:
+ case cf2_escRESERVED_32:
+ case cf2_escRESERVED_33:
+ FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+ break;
- case cf2_escABS:
+ default:
{
- CF2_F16Dot16 arg;
+ if ( font->isCFF2 || op2 >= cf2_escRESERVED_38 )
+ FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+ else
+ {
+ /* second switch for 2-byte operators handles just CFF */
+ switch ( op2 )
+ {
+ case cf2_escDOTSECTION:
+ /* something about `flip type of locking' -- ignore it */
+ FT_TRACE4(( " dotsection\n" ));
- FT_TRACE4(( " abs\n" ));
+ break;
- arg = cf2_stack_popFixed( opStack );
+ case cf2_escAND:
+ {
+ CF2_F16Dot16 arg1;
+ CF2_F16Dot16 arg2;
- cf2_stack_pushFixed( opStack, FT_ABS( arg ) );
- }
- continue; /* do not clear the stack */
- case cf2_escADD:
- {
- CF2_F16Dot16 summand1;
- CF2_F16Dot16 summand2;
+ FT_TRACE4(( " and\n" ));
+ arg2 = cf2_stack_popFixed( opStack );
+ arg1 = cf2_stack_popFixed( opStack );
- FT_TRACE4(( " add\n" ));
+ cf2_stack_pushInt( opStack, arg1 && arg2 );
+ }
+ continue; /* do not clear the stack */
- summand2 = cf2_stack_popFixed( opStack );
- summand1 = cf2_stack_popFixed( opStack );
+ case cf2_escOR:
+ {
+ CF2_F16Dot16 arg1;
+ CF2_F16Dot16 arg2;
- cf2_stack_pushFixed( opStack, summand1 + summand2 );
- }
- continue; /* do not clear the stack */
- case cf2_escSUB:
- {
- CF2_F16Dot16 minuend;
- CF2_F16Dot16 subtrahend;
+ FT_TRACE4(( " or\n" ));
+ arg2 = cf2_stack_popFixed( opStack );
+ arg1 = cf2_stack_popFixed( opStack );
- FT_TRACE4(( " sub\n" ));
+ cf2_stack_pushInt( opStack, arg1 || arg2 );
+ }
+ continue; /* do not clear the stack */
- subtrahend = cf2_stack_popFixed( opStack );
- minuend = cf2_stack_popFixed( opStack );
+ case cf2_escNOT:
+ {
+ CF2_F16Dot16 arg;
- cf2_stack_pushFixed( opStack, minuend - subtrahend );
- }
- continue; /* do not clear the stack */
- case cf2_escDIV:
- {
- CF2_F16Dot16 dividend;
- CF2_F16Dot16 divisor;
+ FT_TRACE4(( " not\n" ));
+ arg = cf2_stack_popFixed( opStack );
- FT_TRACE4(( " div\n" ));
+ cf2_stack_pushInt( opStack, !arg );
+ }
+ continue; /* do not clear the stack */
- divisor = cf2_stack_popFixed( opStack );
- dividend = cf2_stack_popFixed( opStack );
+ case cf2_escABS:
+ {
+ CF2_F16Dot16 arg;
- cf2_stack_pushFixed( opStack, FT_DivFix( dividend, divisor ) );
- }
- continue; /* do not clear the stack */
- case cf2_escNEG:
- {
- CF2_F16Dot16 arg;
+ FT_TRACE4(( " abs\n" ));
+ arg = cf2_stack_popFixed( opStack );
- FT_TRACE4(( " neg\n" ));
+ cf2_stack_pushFixed( opStack, FT_ABS( arg ) );
+ }
+ continue; /* do not clear the stack */
- arg = cf2_stack_popFixed( opStack );
+ case cf2_escADD:
+ {
+ CF2_F16Dot16 summand1;
+ CF2_F16Dot16 summand2;
- cf2_stack_pushFixed( opStack, -arg );
- }
- continue; /* do not clear the stack */
- case cf2_escEQ:
- {
- CF2_F16Dot16 arg1;
- CF2_F16Dot16 arg2;
+ FT_TRACE4(( " add\n" ));
+ summand2 = cf2_stack_popFixed( opStack );
+ summand1 = cf2_stack_popFixed( opStack );
- FT_TRACE4(( " eq\n" ));
+ cf2_stack_pushFixed( opStack, summand1 + summand2 );
+ }
+ continue; /* do not clear the stack */
- arg2 = cf2_stack_popFixed( opStack );
- arg1 = cf2_stack_popFixed( opStack );
+ case cf2_escSUB:
+ {
+ CF2_F16Dot16 minuend;
+ CF2_F16Dot16 subtrahend;
- cf2_stack_pushInt( opStack, arg1 == arg2 );
- }
- continue; /* do not clear the stack */
- case cf2_escDROP:
- FT_TRACE4(( " drop\n" ));
+ FT_TRACE4(( " sub\n" ));
- (void)cf2_stack_popFixed( opStack );
- continue; /* do not clear the stack */
+ subtrahend = cf2_stack_popFixed( opStack );
+ minuend = cf2_stack_popFixed( opStack );
- case cf2_escPUT:
- {
- CF2_F16Dot16 val;
- CF2_Int idx;
+ cf2_stack_pushFixed( opStack, minuend - subtrahend );
+ }
+ continue; /* do not clear the stack */
+ case cf2_escDIV:
+ {
+ CF2_F16Dot16 dividend;
+ CF2_F16Dot16 divisor;
- FT_TRACE4(( " put\n" ));
- idx = cf2_stack_popInt( opStack );
- val = cf2_stack_popFixed( opStack );
+ FT_TRACE4(( " div\n" ));
- if ( idx >= 0 && idx < CF2_STORAGE_SIZE )
- storage[idx] = val;
- }
- continue; /* do not clear the stack */
+ divisor = cf2_stack_popFixed( opStack );
+ dividend = cf2_stack_popFixed( opStack );
- case cf2_escGET:
- {
- CF2_Int idx;
+ cf2_stack_pushFixed( opStack, FT_DivFix( dividend, divisor ) );
+ }
+ continue; /* do not clear the stack */
+ case cf2_escNEG:
+ {
+ CF2_F16Dot16 arg;
- FT_TRACE4(( " get\n" ));
- idx = cf2_stack_popInt( opStack );
+ FT_TRACE4(( " neg\n" ));
- if ( idx >= 0 && idx < CF2_STORAGE_SIZE )
- cf2_stack_pushFixed( opStack, storage[idx] );
- }
- continue; /* do not clear the stack */
+ arg = cf2_stack_popFixed( opStack );
- case cf2_escIFELSE:
- {
- CF2_F16Dot16 arg1;
- CF2_F16Dot16 arg2;
- CF2_F16Dot16 cond1;
- CF2_F16Dot16 cond2;
+ cf2_stack_pushFixed( opStack, -arg );
+ }
+ continue; /* do not clear the stack */
+ case cf2_escEQ:
+ {
+ CF2_F16Dot16 arg1;
+ CF2_F16Dot16 arg2;
- FT_TRACE4(( " ifelse\n" ));
- cond2 = cf2_stack_popFixed( opStack );
- cond1 = cf2_stack_popFixed( opStack );
- arg2 = cf2_stack_popFixed( opStack );
- arg1 = cf2_stack_popFixed( opStack );
+ FT_TRACE4(( " eq\n" ));
- cf2_stack_pushFixed( opStack, cond1 <= cond2 ? arg1 : arg2 );
- }
- continue; /* do not clear the stack */
+ arg2 = cf2_stack_popFixed( opStack );
+ arg1 = cf2_stack_popFixed( opStack );
- case cf2_escRANDOM: /* in spec */
- FT_TRACE4(( " random\n" ));
+ cf2_stack_pushInt( opStack, arg1 == arg2 );
+ }
+ continue; /* do not clear the stack */
- CF2_FIXME;
- break;
+ case cf2_escDROP:
+ FT_TRACE4(( " drop\n" ));
- case cf2_escMUL:
- {
- CF2_F16Dot16 factor1;
- CF2_F16Dot16 factor2;
+ (void)cf2_stack_popFixed( opStack );
+ continue; /* do not clear the stack */
+ case cf2_escPUT:
+ {
+ CF2_F16Dot16 val;
+ CF2_Int idx;
- FT_TRACE4(( " mul\n" ));
- factor2 = cf2_stack_popFixed( opStack );
- factor1 = cf2_stack_popFixed( opStack );
+ FT_TRACE4(( " put\n" ));
- cf2_stack_pushFixed( opStack, FT_MulFix( factor1, factor2 ) );
- }
- continue; /* do not clear the stack */
+ idx = cf2_stack_popInt( opStack );
+ val = cf2_stack_popFixed( opStack );
- case cf2_escSQRT:
- {
- CF2_F16Dot16 arg;
+ if ( idx >= 0 && idx < CF2_STORAGE_SIZE )
+ storage[idx] = val;
+ }
+ continue; /* do not clear the stack */
+ case cf2_escGET:
+ {
+ CF2_Int idx;
- FT_TRACE4(( " sqrt\n" ));
- arg = cf2_stack_popFixed( opStack );
- if ( arg > 0 )
- {
- FT_Fixed root = arg;
- FT_Fixed new_root;
+ FT_TRACE4(( " get\n" ));
+ idx = cf2_stack_popInt( opStack );
- /* Babylonian method */
- for (;;)
- {
- new_root = ( root + FT_DivFix( arg, root ) + 1 ) >> 1;
- if ( new_root == root )
- break;
- root = new_root;
- }
- arg = new_root;
- }
- else
- arg = 0;
+ if ( idx >= 0 && idx < CF2_STORAGE_SIZE )
+ cf2_stack_pushFixed( opStack, storage[idx] );
+ }
+ continue; /* do not clear the stack */
- cf2_stack_pushFixed( opStack, arg );
- }
- continue; /* do not clear the stack */
+ case cf2_escIFELSE:
+ {
+ CF2_F16Dot16 arg1;
+ CF2_F16Dot16 arg2;
+ CF2_F16Dot16 cond1;
+ CF2_F16Dot16 cond2;
- case cf2_escDUP:
- {
- CF2_F16Dot16 arg;
+ FT_TRACE4(( " ifelse\n" ));
- FT_TRACE4(( " dup\n" ));
+ cond2 = cf2_stack_popFixed( opStack );
+ cond1 = cf2_stack_popFixed( opStack );
+ arg2 = cf2_stack_popFixed( opStack );
+ arg1 = cf2_stack_popFixed( opStack );
- arg = cf2_stack_popFixed( opStack );
+ cf2_stack_pushFixed( opStack, cond1 <= cond2 ? arg1 : arg2 );
+ }
+ continue; /* do not clear the stack */
- cf2_stack_pushFixed( opStack, arg );
- cf2_stack_pushFixed( opStack, arg );
- }
- continue; /* do not clear the stack */
+ case cf2_escRANDOM: /* in spec */
+ {
+ CF2_F16Dot16 r;
- case cf2_escEXCH:
- {
- CF2_F16Dot16 arg1;
- CF2_F16Dot16 arg2;
+ FT_TRACE4(( " random\n" ));
- FT_TRACE4(( " exch\n" ));
+ /* only use the lower 16 bits of `random' */
+ /* to generate a number in the range (0;1] */
+ r = (CF2_F16Dot16)
+ ( ( decoder->current_subfont->random & 0xFFFF ) + 1 );
- arg2 = cf2_stack_popFixed( opStack );
- arg1 = cf2_stack_popFixed( opStack );
+ decoder->current_subfont->random =
+ cff_random( decoder->current_subfont->random );
- cf2_stack_pushFixed( opStack, arg2 );
- cf2_stack_pushFixed( opStack, arg1 );
- }
- continue; /* do not clear the stack */
+ cf2_stack_pushFixed( opStack, r );
+ }
+ continue; /* do not clear the stack */
- case cf2_escINDEX:
- {
- CF2_Int idx;
- CF2_UInt size;
+ case cf2_escMUL:
+ {
+ CF2_F16Dot16 factor1;
+ CF2_F16Dot16 factor2;
- FT_TRACE4(( " index\n" ));
+ FT_TRACE4(( " mul\n" ));
- idx = cf2_stack_popInt( opStack );
- size = cf2_stack_count( opStack );
+ factor2 = cf2_stack_popFixed( opStack );
+ factor1 = cf2_stack_popFixed( opStack );
- if ( size > 0 )
- {
- /* for `cf2_stack_getReal', index 0 is bottom of stack */
- CF2_UInt gr_idx;
+ cf2_stack_pushFixed( opStack, FT_MulFix( factor1, factor2 ) );
+ }
+ continue; /* do not clear the stack */
+ case cf2_escSQRT:
+ {
+ CF2_F16Dot16 arg;
- if ( idx < 0 )
- gr_idx = size - 1;
- else if ( (CF2_UInt)idx >= size )
- gr_idx = 0;
- else
- gr_idx = size - 1 - (CF2_UInt)idx;
- cf2_stack_pushFixed( opStack,
- cf2_stack_getReal( opStack, gr_idx ) );
- }
- }
- continue; /* do not clear the stack */
+ FT_TRACE4(( " sqrt\n" ));
- case cf2_escROLL:
- {
- CF2_Int idx;
- CF2_Int count;
+ arg = cf2_stack_popFixed( opStack );
+ if ( arg > 0 )
+ {
+ FT_Fixed root = arg;
+ FT_Fixed new_root;
- FT_TRACE4(( " roll\n" ));
+ /* Babylonian method */
+ for (;;)
+ {
+ new_root = ( root + FT_DivFix( arg, root ) + 1 ) >> 1;
+ if ( new_root == root )
+ break;
+ root = new_root;
+ }
+ arg = new_root;
+ }
+ else
+ arg = 0;
- idx = cf2_stack_popInt( opStack );
- count = cf2_stack_popInt( opStack );
+ cf2_stack_pushFixed( opStack, arg );
+ }
+ continue; /* do not clear the stack */
- cf2_stack_roll( opStack, count, idx );
- }
- continue; /* do not clear the stack */
+ case cf2_escDUP:
+ {
+ CF2_F16Dot16 arg;
- case cf2_escHFLEX:
- {
- static const FT_Bool readFromStack[12] =
- {
- TRUE /* dx1 */, FALSE /* dy1 */,
- TRUE /* dx2 */, TRUE /* dy2 */,
- TRUE /* dx3 */, FALSE /* dy3 */,
- TRUE /* dx4 */, FALSE /* dy4 */,
- TRUE /* dx5 */, FALSE /* dy5 */,
- TRUE /* dx6 */, FALSE /* dy6 */
- };
+ FT_TRACE4(( " dup\n" ));
- FT_TRACE4(( " hflex\n" ));
+ arg = cf2_stack_popFixed( opStack );
- cf2_doFlex( opStack,
- &curX,
- &curY,
- &glyphPath,
- readFromStack,
- FALSE /* doConditionalLastRead */ );
- }
- continue;
+ cf2_stack_pushFixed( opStack, arg );
+ cf2_stack_pushFixed( opStack, arg );
+ }
+ continue; /* do not clear the stack */
- case cf2_escFLEX:
- {
- static const FT_Bool readFromStack[12] =
- {
- TRUE /* dx1 */, TRUE /* dy1 */,
- TRUE /* dx2 */, TRUE /* dy2 */,
- TRUE /* dx3 */, TRUE /* dy3 */,
- TRUE /* dx4 */, TRUE /* dy4 */,
- TRUE /* dx5 */, TRUE /* dy5 */,
- TRUE /* dx6 */, TRUE /* dy6 */
- };
+ case cf2_escEXCH:
+ {
+ CF2_F16Dot16 arg1;
+ CF2_F16Dot16 arg2;
- FT_TRACE4(( " flex\n" ));
+ FT_TRACE4(( " exch\n" ));
- cf2_doFlex( opStack,
- &curX,
- &curY,
- &glyphPath,
- readFromStack,
- FALSE /* doConditionalLastRead */ );
- }
- break; /* TODO: why is this not a continue? */
+ arg2 = cf2_stack_popFixed( opStack );
+ arg1 = cf2_stack_popFixed( opStack );
- case cf2_escHFLEX1:
- {
- static const FT_Bool readFromStack[12] =
- {
- TRUE /* dx1 */, TRUE /* dy1 */,
- TRUE /* dx2 */, TRUE /* dy2 */,
- TRUE /* dx3 */, FALSE /* dy3 */,
- TRUE /* dx4 */, FALSE /* dy4 */,
- TRUE /* dx5 */, TRUE /* dy5 */,
- TRUE /* dx6 */, FALSE /* dy6 */
- };
+ cf2_stack_pushFixed( opStack, arg2 );
+ cf2_stack_pushFixed( opStack, arg1 );
+ }
+ continue; /* do not clear the stack */
+ case cf2_escINDEX:
+ {
+ CF2_Int idx;
+ CF2_UInt size;
- FT_TRACE4(( " hflex1\n" ));
- cf2_doFlex( opStack,
- &curX,
- &curY,
- &glyphPath,
- readFromStack,
- FALSE /* doConditionalLastRead */ );
- }
- continue;
+ FT_TRACE4(( " index\n" ));
- case cf2_escFLEX1:
- {
- static const FT_Bool readFromStack[12] =
- {
- TRUE /* dx1 */, TRUE /* dy1 */,
- TRUE /* dx2 */, TRUE /* dy2 */,
- TRUE /* dx3 */, TRUE /* dy3 */,
- TRUE /* dx4 */, TRUE /* dy4 */,
- TRUE /* dx5 */, TRUE /* dy5 */,
- FALSE /* dx6 */, FALSE /* dy6 */
- };
+ idx = cf2_stack_popInt( opStack );
+ size = cf2_stack_count( opStack );
+ if ( size > 0 )
+ {
+ /* for `cf2_stack_getReal', index 0 is bottom of stack */
+ CF2_UInt gr_idx;
- FT_TRACE4(( " flex1\n" ));
- cf2_doFlex( opStack,
- &curX,
- &curY,
- &glyphPath,
- readFromStack,
- TRUE /* doConditionalLastRead */ );
- }
- continue;
+ if ( idx < 0 )
+ gr_idx = size - 1;
+ else if ( (CF2_UInt)idx >= size )
+ gr_idx = 0;
+ else
+ gr_idx = size - 1 - (CF2_UInt)idx;
- case cf2_escRESERVED_1:
- case cf2_escRESERVED_2:
- case cf2_escRESERVED_6:
- case cf2_escRESERVED_7:
- case cf2_escRESERVED_8:
- case cf2_escRESERVED_13:
- case cf2_escRESERVED_16:
- case cf2_escRESERVED_17:
- case cf2_escRESERVED_19:
- case cf2_escRESERVED_25:
- case cf2_escRESERVED_31:
- case cf2_escRESERVED_32:
- case cf2_escRESERVED_33:
- default:
- FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+ cf2_stack_pushFixed( opStack,
+ cf2_stack_getReal( opStack, gr_idx ) );
+ }
+ }
+ continue; /* do not clear the stack */
- }; /* end of switch statement checking `op2' */
+ case cf2_escROLL:
+ {
+ CF2_Int idx;
+ CF2_Int count;
+
+ FT_TRACE4(( " roll\n" ));
+
+ idx = cf2_stack_popInt( opStack );
+ count = cf2_stack_popInt( opStack );
+
+ cf2_stack_roll( opStack, count, idx );
+ }
+ continue; /* do not clear the stack */
+
+ } /* end of 2nd switch checking op2 */
+ }
+ }
+ } /* end of 1st switch checking op2 */
} /* case cf2_cmdESC */
+
break;
case cf2_cmdENDCHAR:
@@ -1283,7 +1428,8 @@
/* close path if still open */
cf2_glyphpath_closeOpenPath( &glyphPath );
- if ( cf2_stack_count( opStack ) > 1 )
+ /* disable seac for CFF2 (charstring ending with args on stack) */
+ if ( !font->isCFF2 && cf2_stack_count( opStack ) > 1 )
{
/* must be either 4 or 5 -- */
/* this is a (deprecated) implied `seac' operator */
@@ -1454,35 +1600,35 @@
case cf2_cmdRLINECURVE:
{
CF2_UInt count = cf2_stack_count( opStack );
- CF2_UInt index = 0;
+ CF2_UInt idx = 0;
FT_TRACE4(( " rlinecurve\n" ));
- while ( index + 6 < count )
+ while ( idx + 6 < count )
{
- curX += cf2_stack_getReal( opStack, index + 0 );
- curY += cf2_stack_getReal( opStack, index + 1 );
+ curX += cf2_stack_getReal( opStack, idx + 0 );
+ curY += cf2_stack_getReal( opStack, idx + 1 );
cf2_glyphpath_lineTo( &glyphPath, curX, curY );
- index += 2;
+ idx += 2;
}
- while ( index < count )
+ while ( idx < count )
{
- CF2_Fixed x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;
- CF2_Fixed y1 = cf2_stack_getReal( opStack, index + 1 ) + curY;
- CF2_Fixed x2 = cf2_stack_getReal( opStack, index + 2 ) + x1;
- CF2_Fixed y2 = cf2_stack_getReal( opStack, index + 3 ) + y1;
- CF2_Fixed x3 = cf2_stack_getReal( opStack, index + 4 ) + x2;
- CF2_Fixed y3 = cf2_stack_getReal( opStack, index + 5 ) + y2;
+ CF2_Fixed x1 = cf2_stack_getReal( opStack, idx + 0 ) + curX;
+ CF2_Fixed y1 = cf2_stack_getReal( opStack, idx + 1 ) + curY;
+ CF2_Fixed x2 = cf2_stack_getReal( opStack, idx + 2 ) + x1;
+ CF2_Fixed y2 = cf2_stack_getReal( opStack, idx + 3 ) + y1;
+ CF2_Fixed x3 = cf2_stack_getReal( opStack, idx + 4 ) + x2;
+ CF2_Fixed y3 = cf2_stack_getReal( opStack, idx + 5 ) + y2;
cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
- curX = x3;
- curY = y3;
- index += 6;
+ curX = x3;
+ curY = y3;
+ idx += 6;
}
cf2_stack_clear( opStack );
@@ -1492,42 +1638,42 @@
case cf2_cmdVVCURVETO:
{
CF2_UInt count, count1 = cf2_stack_count( opStack );
- CF2_UInt index = 0;
+ CF2_UInt idx = 0;
/* if `cf2_stack_count' isn't of the form 4n or 4n+1, */
/* we enforce it by clearing the second bit */
/* (and sorting the stack indexing to suit) */
- count = count1 & ~2U;
- index += count1 - count;
+ count = count1 & ~2U;
+ idx += count1 - count;
FT_TRACE4(( " vvcurveto\n" ));
- while ( index < count )
+ while ( idx < count )
{
CF2_Fixed x1, y1, x2, y2, x3, y3;
- if ( ( count - index ) & 1 )
+ if ( ( count - idx ) & 1 )
{
- x1 = cf2_stack_getReal( opStack, index ) + curX;
+ x1 = cf2_stack_getReal( opStack, idx ) + curX;
- ++index;
+ idx++;
}
else
x1 = curX;
- y1 = cf2_stack_getReal( opStack, index + 0 ) + curY;
- x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;
- y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;
+ y1 = cf2_stack_getReal( opStack, idx + 0 ) + curY;
+ x2 = cf2_stack_getReal( opStack, idx + 1 ) + x1;
+ y2 = cf2_stack_getReal( opStack, idx + 2 ) + y1;
x3 = x2;
- y3 = cf2_stack_getReal( opStack, index + 3 ) + y2;
+ y3 = cf2_stack_getReal( opStack, idx + 3 ) + y2;
cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
- curX = x3;
- curY = y3;
- index += 4;
+ curX = x3;
+ curY = y3;
+ idx += 4;
}
cf2_stack_clear( opStack );
@@ -1537,42 +1683,42 @@
case cf2_cmdHHCURVETO:
{
CF2_UInt count, count1 = cf2_stack_count( opStack );
- CF2_UInt index = 0;
+ CF2_UInt idx = 0;
/* if `cf2_stack_count' isn't of the form 4n or 4n+1, */
/* we enforce it by clearing the second bit */
/* (and sorting the stack indexing to suit) */
- count = count1 & ~2U;
- index += count1 - count;
+ count = count1 & ~2U;
+ idx += count1 - count;
FT_TRACE4(( " hhcurveto\n" ));
- while ( index < count )
+ while ( idx < count )
{
CF2_Fixed x1, y1, x2, y2, x3, y3;
- if ( ( count - index ) & 1 )
+ if ( ( count - idx ) & 1 )
{
- y1 = cf2_stack_getReal( opStack, index ) + curY;
+ y1 = cf2_stack_getReal( opStack, idx ) + curY;
- ++index;
+ idx++;
}
else
y1 = curY;
- x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;
- x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;
- y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;
- x3 = cf2_stack_getReal( opStack, index + 3 ) + x2;
+ x1 = cf2_stack_getReal( opStack, idx + 0 ) + curX;
+ x2 = cf2_stack_getReal( opStack, idx + 1 ) + x1;
+ y2 = cf2_stack_getReal( opStack, idx + 2 ) + y1;
+ x3 = cf2_stack_getReal( opStack, idx + 3 ) + x2;
y3 = y2;
cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
- curX = x3;
- curY = y3;
- index += 4;
+ curX = x3;
+ curY = y3;
+ idx += 4;
}
cf2_stack_clear( opStack );
@@ -1583,38 +1729,38 @@
case cf2_cmdHVCURVETO:
{
CF2_UInt count, count1 = cf2_stack_count( opStack );
- CF2_UInt index = 0;
+ CF2_UInt idx = 0;
- FT_Bool alternate = op1 == cf2_cmdHVCURVETO;
+ FT_Bool alternate = FT_BOOL( op1 == cf2_cmdHVCURVETO );
/* if `cf2_stack_count' isn't of the form 8n, 8n+1, */
/* 8n+4, or 8n+5, we enforce it by clearing the */
/* second bit */
/* (and sorting the stack indexing to suit) */
- count = count1 & ~2U;
- index += count1 - count;
+ count = count1 & ~2U;
+ idx += count1 - count;
FT_TRACE4(( alternate ? " hvcurveto\n" : " vhcurveto\n" ));
- while ( index < count )
+ while ( idx < count )
{
CF2_Fixed x1, x2, x3, y1, y2, y3;
if ( alternate )
{
- x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;
+ x1 = cf2_stack_getReal( opStack, idx + 0 ) + curX;
y1 = curY;
- x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;
- y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;
- y3 = cf2_stack_getReal( opStack, index + 3 ) + y2;
+ x2 = cf2_stack_getReal( opStack, idx + 1 ) + x1;
+ y2 = cf2_stack_getReal( opStack, idx + 2 ) + y1;
+ y3 = cf2_stack_getReal( opStack, idx + 3 ) + y2;
- if ( count - index == 5 )
+ if ( count - idx == 5 )
{
- x3 = cf2_stack_getReal( opStack, index + 4 ) + x2;
+ x3 = cf2_stack_getReal( opStack, idx + 4 ) + x2;
- ++index;
+ idx++;
}
else
x3 = x2;
@@ -1624,16 +1770,16 @@
else
{
x1 = curX;
- y1 = cf2_stack_getReal( opStack, index + 0 ) + curY;
- x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;
- y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;
- x3 = cf2_stack_getReal( opStack, index + 3 ) + x2;
+ y1 = cf2_stack_getReal( opStack, idx + 0 ) + curY;
+ x2 = cf2_stack_getReal( opStack, idx + 1 ) + x1;
+ y2 = cf2_stack_getReal( opStack, idx + 2 ) + y1;
+ x3 = cf2_stack_getReal( opStack, idx + 3 ) + x2;
- if ( count - index == 5 )
+ if ( count - idx == 5 )
{
- y3 = cf2_stack_getReal( opStack, index + 4 ) + y2;
+ y3 = cf2_stack_getReal( opStack, idx + 4 ) + y2;
- ++index;
+ idx++;
}
else
y3 = y2;
@@ -1643,9 +1789,9 @@
cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
- curX = x3;
- curY = y3;
- index += 4;
+ curX = x3;
+ curY = y3;
+ idx += 4;
}
cf2_stack_clear( opStack );
@@ -1734,7 +1880,7 @@
( byte3 << 8 ) |
byte4 );
- FT_TRACE4(( " %.2f", v / 65536.0 ));
+ FT_TRACE4(( " %.5f", v / 65536.0 ));
cf2_stack_pushFixed( opStack, v );
}
@@ -1755,6 +1901,9 @@
/* check whether last error seen is also the first one */
cf2_setError( error, lastError );
+ if ( *error )
+ FT_TRACE4(( "charstring error %d\n", *error ));
+
/* free resources from objects we've used */
cf2_glyphpath_finalize( &glyphPath );
cf2_arrstack_finalize( &vStemHintArray );
diff --git a/thirdparty/freetype/src/cff/cf2stack.c b/thirdparty/freetype/src/cff/cf2stack.c
index 6fafd901f3..12a026d21d 100644
--- a/thirdparty/freetype/src/cff/cf2stack.c
+++ b/thirdparty/freetype/src/cff/cf2stack.c
@@ -51,21 +51,31 @@
/* `error'). */
FT_LOCAL_DEF( CF2_Stack )
cf2_stack_init( FT_Memory memory,
- FT_Error* e )
+ FT_Error* e,
+ FT_UInt stackSize )
{
- FT_Error error = FT_Err_Ok; /* for FT_QNEW */
+ FT_Error error = FT_Err_Ok; /* for FT_NEW */
CF2_Stack stack = NULL;
- if ( !FT_QNEW( stack ) )
+ if ( !FT_NEW( stack ) )
{
- /* initialize the structure; FT_QNEW zeroes it */
+ /* initialize the structure; FT_NEW zeroes it */
stack->memory = memory;
stack->error = e;
- stack->top = &stack->buffer[0]; /* empty stack */
}
+ /* allocate the stack buffer */
+ if ( FT_NEW_ARRAY( stack->buffer, stackSize ) )
+ {
+ FT_FREE( stack );
+ return NULL;
+ }
+
+ stack->stackSize = stackSize;
+ stack->top = stack->buffer; /* empty stack */
+
return stack;
}
@@ -77,6 +87,8 @@
{
FT_Memory memory = stack->memory;
+ /* free the buffer */
+ FT_FREE( stack->buffer );
/* free the main structure */
FT_FREE( stack );
@@ -87,7 +99,7 @@
FT_LOCAL_DEF( CF2_UInt )
cf2_stack_count( CF2_Stack stack )
{
- return (CF2_UInt)( stack->top - &stack->buffer[0] );
+ return (CF2_UInt)( stack->top - stack->buffer );
}
@@ -95,7 +107,7 @@
cf2_stack_pushInt( CF2_Stack stack,
CF2_Int val )
{
- if ( stack->top == &stack->buffer[CF2_OPERAND_STACK_SIZE] )
+ if ( stack->top == stack->buffer + stack->stackSize )
{
CF2_SET_ERROR( stack->error, Stack_Overflow );
return; /* stack overflow */
@@ -103,7 +115,7 @@
stack->top->u.i = val;
stack->top->type = CF2_NumberInt;
- ++stack->top;
+ stack->top++;
}
@@ -111,7 +123,7 @@
cf2_stack_pushFixed( CF2_Stack stack,
CF2_Fixed val )
{
- if ( stack->top == &stack->buffer[CF2_OPERAND_STACK_SIZE] )
+ if ( stack->top == stack->buffer + stack->stackSize )
{
CF2_SET_ERROR( stack->error, Stack_Overflow );
return; /* stack overflow */
@@ -119,7 +131,7 @@
stack->top->u.r = val;
stack->top->type = CF2_NumberFixed;
- ++stack->top;
+ stack->top++;
}
@@ -127,7 +139,7 @@
FT_LOCAL_DEF( CF2_Int )
cf2_stack_popInt( CF2_Stack stack )
{
- if ( stack->top == &stack->buffer[0] )
+ if ( stack->top == stack->buffer )
{
CF2_SET_ERROR( stack->error, Stack_Underflow );
return 0; /* underflow */
@@ -138,7 +150,7 @@
return 0; /* type mismatch */
}
- --stack->top;
+ stack->top--;
return stack->top->u.i;
}
@@ -149,13 +161,13 @@
FT_LOCAL_DEF( CF2_Fixed )
cf2_stack_popFixed( CF2_Stack stack )
{
- if ( stack->top == &stack->buffer[0] )
+ if ( stack->top == stack->buffer )
{
CF2_SET_ERROR( stack->error, Stack_Underflow );
return cf2_intToFixed( 0 ); /* underflow */
}
- --stack->top;
+ stack->top--;
switch ( stack->top->type )
{
@@ -175,7 +187,7 @@
cf2_stack_getReal( CF2_Stack stack,
CF2_UInt idx )
{
- FT_ASSERT( cf2_stack_count( stack ) <= CF2_OPERAND_STACK_SIZE );
+ FT_ASSERT( cf2_stack_count( stack ) <= stack->stackSize );
if ( idx >= cf2_stack_count( stack ) )
{
@@ -195,7 +207,38 @@
}
- FT_LOCAL( void )
+ /* provide random access to stack */
+ FT_LOCAL_DEF( void )
+ cf2_stack_setReal( CF2_Stack stack,
+ CF2_UInt idx,
+ CF2_Fixed val )
+ {
+ if ( idx > cf2_stack_count( stack ) )
+ {
+ CF2_SET_ERROR( stack->error, Stack_Overflow );
+ return;
+ }
+
+ stack->buffer[idx].u.r = val;
+ stack->buffer[idx].type = CF2_NumberFixed;
+ }
+
+
+ /* discard (pop) num values from stack */
+ FT_LOCAL_DEF( void )
+ cf2_stack_pop( CF2_Stack stack,
+ CF2_UInt num )
+ {
+ if ( num > cf2_stack_count( stack ) )
+ {
+ CF2_SET_ERROR( stack->error, Stack_Underflow );
+ return;
+ }
+ stack->top -= num;
+ }
+
+
+ FT_LOCAL_DEF( void )
cf2_stack_roll( CF2_Stack stack,
CF2_Int count,
CF2_Int shift )
@@ -278,7 +321,7 @@
FT_LOCAL_DEF( void )
cf2_stack_clear( CF2_Stack stack )
{
- stack->top = &stack->buffer[0];
+ stack->top = stack->buffer;
}
diff --git a/thirdparty/freetype/src/cff/cf2stack.h b/thirdparty/freetype/src/cff/cf2stack.h
index e740a7ac41..ef08eefe41 100644
--- a/thirdparty/freetype/src/cff/cf2stack.h
+++ b/thirdparty/freetype/src/cff/cf2stack.h
@@ -62,15 +62,17 @@ FT_BEGIN_HEADER
{
FT_Memory memory;
FT_Error* error;
- CF2_StackNumber buffer[CF2_OPERAND_STACK_SIZE];
+ CF2_StackNumber* buffer;
CF2_StackNumber* top;
+ FT_UInt stackSize;
} CF2_StackRec, *CF2_Stack;
FT_LOCAL( CF2_Stack )
cf2_stack_init( FT_Memory memory,
- FT_Error* error );
+ FT_Error* error,
+ FT_UInt stackSize );
FT_LOCAL( void )
cf2_stack_free( CF2_Stack stack );
@@ -92,6 +94,14 @@ FT_BEGIN_HEADER
FT_LOCAL( CF2_Fixed )
cf2_stack_getReal( CF2_Stack stack,
CF2_UInt idx );
+ FT_LOCAL( void )
+ cf2_stack_setReal( CF2_Stack stack,
+ CF2_UInt idx,
+ CF2_Fixed val );
+
+ FT_LOCAL( void )
+ cf2_stack_pop( CF2_Stack stack,
+ CF2_UInt num );
FT_LOCAL( void )
cf2_stack_roll( CF2_Stack stack,
diff --git a/thirdparty/freetype/src/cff/cff.c b/thirdparty/freetype/src/cff/cff.c
index 86ca1be040..397f6dfafe 100644
--- a/thirdparty/freetype/src/cff/cff.c
+++ b/thirdparty/freetype/src/cff/cff.c
@@ -4,7 +4,7 @@
/* */
/* FreeType OpenType driver component (body only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,16 +17,15 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
#include <ft2build.h>
-#include "cffpic.c"
+#include "cffcmap.c"
#include "cffdrivr.c"
+#include "cffgload.c"
#include "cffparse.c"
+#include "cffpic.c"
#include "cffload.c"
#include "cffobjs.c"
-#include "cffgload.c"
-#include "cffcmap.c"
#include "cf2arrst.c"
#include "cf2blues.c"
@@ -38,4 +37,5 @@
#include "cf2read.c"
#include "cf2stack.c"
+
/* END */
diff --git a/thirdparty/freetype/src/cff/cffcmap.c b/thirdparty/freetype/src/cff/cffcmap.c
index 3ef48328c5..4adce7a54d 100644
--- a/thirdparty/freetype/src/cff/cffcmap.c
+++ b/thirdparty/freetype/src/cff/cffcmap.c
@@ -4,7 +4,7 @@
/* */
/* CFF character mapping table (cmap) support (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -104,15 +104,21 @@
}
- FT_DEFINE_CMAP_CLASS(cff_cmap_encoding_class_rec,
+ FT_DEFINE_CMAP_CLASS(
+ cff_cmap_encoding_class_rec,
+
sizeof ( CFF_CMapStdRec ),
- (FT_CMap_InitFunc) cff_cmap_encoding_init,
- (FT_CMap_DoneFunc) cff_cmap_encoding_done,
- (FT_CMap_CharIndexFunc)cff_cmap_encoding_char_index,
- (FT_CMap_CharNextFunc) cff_cmap_encoding_char_next,
+ (FT_CMap_InitFunc) cff_cmap_encoding_init, /* init */
+ (FT_CMap_DoneFunc) cff_cmap_encoding_done, /* done */
+ (FT_CMap_CharIndexFunc)cff_cmap_encoding_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) cff_cmap_encoding_char_next, /* char_next */
- NULL, NULL, NULL, NULL, NULL
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL /* variantchar_list */
)
@@ -202,15 +208,22 @@
}
- FT_DEFINE_CMAP_CLASS(cff_cmap_unicode_class_rec,
+ FT_DEFINE_CMAP_CLASS(
+ cff_cmap_unicode_class_rec,
+
sizeof ( PS_UnicodesRec ),
- (FT_CMap_InitFunc) cff_cmap_unicode_init,
- (FT_CMap_DoneFunc) cff_cmap_unicode_done,
- (FT_CMap_CharIndexFunc)cff_cmap_unicode_char_index,
- (FT_CMap_CharNextFunc) cff_cmap_unicode_char_next,
+ (FT_CMap_InitFunc) cff_cmap_unicode_init, /* init */
+ (FT_CMap_DoneFunc) cff_cmap_unicode_done, /* done */
+ (FT_CMap_CharIndexFunc)cff_cmap_unicode_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) cff_cmap_unicode_char_next, /* char_next */
- NULL, NULL, NULL, NULL, NULL
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL /* variantchar_list */
)
+
/* END */
diff --git a/thirdparty/freetype/src/cff/cffcmap.h b/thirdparty/freetype/src/cff/cffcmap.h
index 23795d5090..7792e04248 100644
--- a/thirdparty/freetype/src/cff/cffcmap.h
+++ b/thirdparty/freetype/src/cff/cffcmap.h
@@ -4,7 +4,7 @@
/* */
/* CFF character mapping table (cmap) support (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cff/cffdrivr.c b/thirdparty/freetype/src/cff/cffdrivr.c
index 950a9605c3..38bfc2ca3d 100644
--- a/thirdparty/freetype/src/cff/cffdrivr.c
+++ b/thirdparty/freetype/src/cff/cffdrivr.c
@@ -4,7 +4,7 @@
/* */
/* OpenType font driver implementation (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -32,6 +32,11 @@
#include "cffcmap.h"
#include "cffparse.h"
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include FT_SERVICE_MULTIPLE_MASTERS_H
+#include FT_SERVICE_METRICS_VARIATIONS_H
+#endif
+
#include "cfferrs.h"
#include "cffpic.h"
@@ -207,6 +212,13 @@
if ( flags & FT_LOAD_VERTICAL_LAYOUT )
{
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* no fast retrieval for blended MM fonts without VVAR table */
+ if ( !ttface->is_default_instance &&
+ !( ttface->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
+ return FT_THROW( Unimplemented_Feature );
+#endif
+
/* check whether we have data from the `vmtx' table at all; */
/* otherwise we extract the info from the CFF glyphstrings */
/* (instead of synthesizing a global value using the `OS/2' */
@@ -232,6 +244,13 @@
}
else
{
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* no fast retrieval for blended MM fonts without HVAR table */
+ if ( !ttface->is_default_instance &&
+ !( ttface->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
+ return FT_THROW( Unimplemented_Feature );
+#endif
+
/* check whether we have data from the `hmtx' table at all */
if ( !ttface->horizontal.number_Of_HMetrics )
goto Missing_Table;
@@ -291,6 +310,35 @@
FT_Error error;
+ /* CFF2 table does not have glyph names; */
+ /* we need to use `post' table method */
+ if ( font->version_major == 2 )
+ {
+ FT_Library library = FT_FACE_LIBRARY( face );
+ FT_Module sfnt_module = FT_Get_Module( library, "sfnt" );
+ FT_Service_GlyphDict service =
+ (FT_Service_GlyphDict)ft_module_get_service(
+ sfnt_module,
+ FT_SERVICE_ID_GLYPH_DICT,
+ 0 );
+
+
+ if ( service && service->get_name )
+ return service->get_name( FT_FACE( face ),
+ glyph_index,
+ buffer,
+ buffer_max );
+ else
+ {
+ FT_ERROR(( "cff_get_glyph_name:"
+ " cannot get glyph name from a CFF2 font\n"
+ " "
+ " without the `PSNames' module\n" ));
+ error = FT_THROW( Missing_Module );
+ goto Exit;
+ }
+ }
+
if ( !font->psnames )
{
FT_ERROR(( "cff_get_glyph_name:"
@@ -332,6 +380,31 @@
cff = (CFF_FontRec *)face->extra.data;
charset = &cff->charset;
+ /* CFF2 table does not have glyph names; */
+ /* we need to use `post' table method */
+ if ( cff->version_major == 2 )
+ {
+ FT_Library library = FT_FACE_LIBRARY( face );
+ FT_Module sfnt_module = FT_Get_Module( library, "sfnt" );
+ FT_Service_GlyphDict service =
+ (FT_Service_GlyphDict)ft_module_get_service(
+ sfnt_module,
+ FT_SERVICE_ID_GLYPH_DICT,
+ 0 );
+
+
+ if ( service && service->name_index )
+ return service->name_index( FT_FACE( face ), glyph_name );
+ else
+ {
+ FT_ERROR(( "cff_get_name_index:"
+ " cannot get glyph index from a CFF2 font\n"
+ " "
+ " without the `PSNames' module\n" ));
+ return 0;
+ }
+ }
+
FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
if ( !psnames )
return 0;
@@ -358,6 +431,7 @@
FT_DEFINE_SERVICE_GLYPHDICTREC(
cff_service_glyph_dict,
+
(FT_GlyphDict_GetNameFunc) cff_get_glyph_name, /* get_name */
(FT_GlyphDict_NameIndexFunc)cff_get_name_index /* name_index */
)
@@ -383,11 +457,11 @@
FT_Error error = FT_Err_Ok;
- if ( cff && cff->font_info == NULL )
+ if ( cff && !cff->font_info )
{
- CFF_FontRecDict dict = &cff->top_font.font_dict;
+ CFF_FontRecDict dict = &cff->top_font.font_dict;
PS_FontInfoRec *font_info = NULL;
- FT_Memory memory = face->root.memory;
+ FT_Memory memory = face->root.memory;
if ( FT_ALLOC( font_info, sizeof ( *font_info ) ) )
@@ -421,6 +495,7 @@
FT_DEFINE_SERVICE_PSINFOREC(
cff_service_ps_info,
+
(PS_GetFontInfoFunc) cff_ps_get_font_info, /* ps_get_font_info */
(PS_GetFontExtraFunc) NULL, /* ps_get_font_extra */
(PS_HasGlyphNamesFunc) cff_ps_has_glyph_names, /* ps_has_glyph_names */
@@ -453,7 +528,8 @@
FT_Service_PsFontName service =
(FT_Service_PsFontName)ft_module_get_service(
sfnt_module,
- FT_SERVICE_ID_POSTSCRIPT_FONT_NAME );
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME,
+ 0 );
if ( service && service->get_ps_font_name )
@@ -466,6 +542,7 @@
FT_DEFINE_SERVICE_PSFONTNAMEREC(
cff_service_ps_name,
+
(FT_PsName_GetFunc)cff_get_ps_name /* get_ps_font_name */
)
@@ -491,21 +568,21 @@
FT_Library library = FT_FACE_LIBRARY( face );
- cmap_info->language = 0;
- cmap_info->format = 0;
-
if ( cmap->clazz != &CFF_CMAP_ENCODING_CLASS_REC_GET &&
cmap->clazz != &CFF_CMAP_UNICODE_CLASS_REC_GET )
{
FT_Module sfnt = FT_Get_Module( library, "sfnt" );
FT_Service_TTCMaps service =
(FT_Service_TTCMaps)ft_module_get_service( sfnt,
- FT_SERVICE_ID_TT_CMAP );
+ FT_SERVICE_ID_TT_CMAP,
+ 0 );
if ( service && service->get_cmap_info )
error = service->get_cmap_info( charmap, cmap_info );
}
+ else
+ error = FT_THROW( Invalid_CharMap_Format );
return error;
}
@@ -513,6 +590,7 @@
FT_DEFINE_SERVICE_TTCMAPSREC(
cff_service_get_cmap_info,
+
(TT_CMap_Info_GetFunc)cff_get_cmap_info /* get_cmap_info */
)
@@ -544,7 +622,7 @@
if ( registry )
{
- if ( cff->registry == NULL )
+ if ( !cff->registry )
cff->registry = cff_index_get_sid_string( cff,
dict->cid_registry );
*registry = cff->registry;
@@ -552,7 +630,7 @@
if ( ordering )
{
- if ( cff->ordering == NULL )
+ if ( !cff->ordering )
cff->ordering = cff_index_get_sid_string( cff,
dict->cid_ordering );
*ordering = cff->ordering;
@@ -643,6 +721,7 @@
FT_DEFINE_SERVICE_CIDREC(
cff_service_cid_info,
+
(FT_CID_GetRegistryOrderingSupplementFunc)
cff_get_ros, /* get_ros */
(FT_CID_GetIsInternallyCIDKeyedFunc)
@@ -659,26 +738,62 @@
static FT_Error
cff_property_set( FT_Module module, /* CFF_Driver */
const char* property_name,
- const void* value )
+ const void* value,
+ FT_Bool value_is_string )
{
FT_Error error = FT_Err_Ok;
CFF_Driver driver = (CFF_Driver)module;
+#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ FT_UNUSED( value_is_string );
+#endif
+
if ( !ft_strcmp( property_name, "darkening-parameters" ) )
{
- FT_Int* darken_params = (FT_Int*)value;
+ FT_Int* darken_params;
+ FT_Int x1, y1, x2, y2, x3, y3, x4, y4;
- FT_Int x1 = darken_params[0];
- FT_Int y1 = darken_params[1];
- FT_Int x2 = darken_params[2];
- FT_Int y2 = darken_params[3];
- FT_Int x3 = darken_params[4];
- FT_Int y3 = darken_params[5];
- FT_Int x4 = darken_params[6];
- FT_Int y4 = darken_params[7];
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ FT_Int dp[8];
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+ char* ep;
+ int i;
+
+
+ /* eight comma-separated numbers */
+ for ( i = 0; i < 7; i++ )
+ {
+ dp[i] = (FT_Int)ft_strtol( s, &ep, 10 );
+ if ( *ep != ',' || s == ep )
+ return FT_THROW( Invalid_Argument );
+
+ s = ep + 1;
+ }
+
+ dp[7] = (FT_Int)ft_strtol( s, &ep, 10 );
+ if ( !( *ep == '\0' || *ep == ' ' ) || s == ep )
+ return FT_THROW( Invalid_Argument );
+
+ darken_params = dp;
+ }
+ else
+#endif
+ darken_params = (FT_Int*)value;
+
+ x1 = darken_params[0];
+ y1 = darken_params[1];
+ x2 = darken_params[2];
+ y2 = darken_params[3];
+ x3 = darken_params[4];
+ y3 = darken_params[5];
+ x4 = darken_params[6];
+ y4 = darken_params[7];
+
if ( x1 < 0 || x2 < 0 || x3 < 0 || x4 < 0 ||
y1 < 0 || y2 < 0 || y3 < 0 || y4 < 0 ||
x1 > x2 || x2 > x3 || x3 > x4 ||
@@ -698,26 +813,85 @@
}
else if ( !ft_strcmp( property_name, "hinting-engine" ) )
{
- FT_UInt* hinting_engine = (FT_UInt*)value;
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
- if ( *hinting_engine == FT_CFF_HINTING_ADOBE
+ if ( !ft_strcmp( s, "adobe" ) )
+ driver->hinting_engine = FT_CFF_HINTING_ADOBE;
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
- || *hinting_engine == FT_CFF_HINTING_FREETYPE
+ else if ( !ft_strcmp( s, "freetype" ) )
+ driver->hinting_engine = FT_CFF_HINTING_FREETYPE;
#endif
- )
- driver->hinting_engine = *hinting_engine;
+ else
+ return FT_THROW( Invalid_Argument );
+ }
else
- error = FT_ERR( Unimplemented_Feature );
+#endif
+ {
+ FT_UInt* hinting_engine = (FT_UInt*)value;
- return error;
+
+ if ( *hinting_engine == FT_CFF_HINTING_ADOBE
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ || *hinting_engine == FT_CFF_HINTING_FREETYPE
+#endif
+ )
+ driver->hinting_engine = *hinting_engine;
+ else
+ error = FT_ERR( Unimplemented_Feature );
+
+ return error;
+ }
}
else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
{
- FT_Bool* no_stem_darkening = (FT_Bool*)value;
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+ long nsd = ft_strtol( s, NULL, 10 );
+
+
+ if ( !nsd )
+ driver->no_stem_darkening = FALSE;
+ else
+ driver->no_stem_darkening = TRUE;
+ }
+ else
+#endif
+ {
+ FT_Bool* no_stem_darkening = (FT_Bool*)value;
+
+
+ driver->no_stem_darkening = *no_stem_darkening;
+ }
+
+ return error;
+ }
+ else if ( !ft_strcmp( property_name, "random-seed" ) )
+ {
+ FT_Int32 random_seed;
- driver->no_stem_darkening = *no_stem_darkening;
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+
+
+ random_seed = (FT_Int32)ft_strtol( s, NULL, 10 );
+ }
+ else
+#endif
+ random_seed = *(FT_Int32*)value;
+
+ if ( random_seed < 0 )
+ random_seed = 0;
+
+ driver->random_seed = random_seed;
return error;
}
@@ -783,10 +957,137 @@
FT_DEFINE_SERVICE_PROPERTIESREC(
cff_service_properties,
+
(FT_Properties_SetFunc)cff_property_set, /* set_property */
(FT_Properties_GetFunc)cff_property_get ) /* get_property */
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+ /*
+ * MULTIPLE MASTER SERVICE
+ *
+ */
+
+ static FT_Error
+ cff_set_mm_blend( CFF_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+
+ return mm->set_mm_blend( FT_FACE( face ), num_coords, coords );
+ }
+
+
+ static FT_Error
+ cff_get_mm_blend( CFF_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+
+ return mm->get_mm_blend( FT_FACE( face ), num_coords, coords );
+ }
+
+
+ static FT_Error
+ cff_get_mm_var( CFF_Face face,
+ FT_MM_Var* *master )
+ {
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+
+ return mm->get_mm_var( FT_FACE( face ), master );
+ }
+
+
+ static FT_Error
+ cff_set_var_design( CFF_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+
+ return mm->set_var_design( FT_FACE( face ), num_coords, coords );
+ }
+
+
+ static FT_Error
+ cff_get_var_design( CFF_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+
+ return mm->get_var_design( FT_FACE( face ), num_coords, coords );
+ }
+
+
+ FT_DEFINE_SERVICE_MULTIMASTERSREC(
+ cff_service_multi_masters,
+
+ (FT_Get_MM_Func) NULL, /* get_mm */
+ (FT_Set_MM_Design_Func) NULL, /* set_mm_design */
+ (FT_Set_MM_Blend_Func) cff_set_mm_blend, /* set_mm_blend */
+ (FT_Get_MM_Blend_Func) cff_get_mm_blend, /* get_mm_blend */
+ (FT_Get_MM_Var_Func) cff_get_mm_var, /* get_mm_var */
+ (FT_Set_Var_Design_Func)cff_set_var_design, /* set_var_design */
+ (FT_Get_Var_Design_Func)cff_get_var_design, /* get_var_design */
+
+ (FT_Get_Var_Blend_Func) cff_get_var_blend, /* get_var_blend */
+ (FT_Done_Blend_Func) cff_done_blend /* done_blend */
+ )
+
+
+ /*
+ * METRICS VARIATIONS SERVICE
+ *
+ */
+
+ static FT_Error
+ cff_hadvance_adjust( CFF_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue )
+ {
+ FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)face->var;
+
+
+ return var->hadvance_adjust( FT_FACE( face ), gindex, avalue );
+ }
+
+
+ static void
+ cff_metrics_adjust( CFF_Face face )
+ {
+ FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)face->var;
+
+
+ var->metrics_adjust( FT_FACE( face ) );
+ }
+
+
+ FT_DEFINE_SERVICE_METRICSVARIATIONSREC(
+ cff_service_metrics_variations,
+
+ (FT_HAdvance_Adjust_Func)cff_hadvance_adjust, /* hadvance_adjust */
+ (FT_LSB_Adjust_Func) NULL, /* lsb_adjust */
+ (FT_RSB_Adjust_Func) NULL, /* rsb_adjust */
+
+ (FT_VAdvance_Adjust_Func)NULL, /* vadvance_adjust */
+ (FT_TSB_Adjust_Func) NULL, /* tsb_adjust */
+ (FT_BSB_Adjust_Func) NULL, /* bsb_adjust */
+ (FT_VOrg_Adjust_Func) NULL, /* vorg_adjust */
+
+ (FT_Metrics_Adjust_Func) cff_metrics_adjust /* metrics_adjust */
+ )
+#endif
+
+
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -799,9 +1100,25 @@
/*************************************************************************/
/*************************************************************************/
-#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
+#if !defined FT_CONFIG_OPTION_NO_GLYPH_NAMES && \
+ defined TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ FT_DEFINE_SERVICEDESCREC9(
+ cff_services,
+
+ FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
+ FT_SERVICE_ID_MULTI_MASTERS, &CFF_SERVICE_MULTI_MASTERS_GET,
+ FT_SERVICE_ID_METRICS_VARIATIONS, &CFF_SERVICE_METRICS_VAR_GET,
+ FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
+ FT_SERVICE_ID_GLYPH_DICT, &CFF_SERVICE_GLYPH_DICT_GET,
+ FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
+ FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
+ FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET
+ )
+#elif !defined FT_CONFIG_OPTION_NO_GLYPH_NAMES
FT_DEFINE_SERVICEDESCREC7(
cff_services,
+
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
@@ -810,9 +1127,23 @@
FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET
)
+#elif defined TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ FT_DEFINE_SERVICEDESCREC8(
+ cff_services,
+
+ FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
+ FT_SERVICE_ID_MULTI_MASTERS, &CFF_SERVICE_MULTI_MASTERS_GET,
+ FT_SERVICE_ID_METRICS_VARIATIONS, &CFF_SERVICE_METRICS_VAR_GET,
+ FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
+ FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
+ FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
+ FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET
+ )
#else
FT_DEFINE_SERVICEDESCREC6(
cff_services,
+
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
@@ -842,7 +1173,7 @@
#endif
result = ft_service_list_lookup( CFF_SERVICES_GET, module_interface );
- if ( result != NULL )
+ if ( result )
return result;
/* `driver' is not yet evaluated in non-PIC mode */
@@ -882,7 +1213,7 @@
0x10000L,
0x20000L,
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
cff_driver_init, /* FT_Module_Constructor module_init */
cff_driver_done, /* FT_Module_Destructor module_done */
@@ -902,7 +1233,7 @@
cff_glyph_load, /* FT_Slot_LoadFunc load_glyph */
cff_get_kerning, /* FT_Face_GetKerningFunc get_kerning */
- 0, /* FT_Face_AttachFunc attach_file */
+ NULL, /* FT_Face_AttachFunc attach_file */
cff_get_advances, /* FT_Face_GetAdvancesFunc get_advances */
cff_size_request, /* FT_Size_RequestFunc request_size */
diff --git a/thirdparty/freetype/src/cff/cffdrivr.h b/thirdparty/freetype/src/cff/cffdrivr.h
index d7b0598374..05381e66db 100644
--- a/thirdparty/freetype/src/cff/cffdrivr.h
+++ b/thirdparty/freetype/src/cff/cffdrivr.h
@@ -4,7 +4,7 @@
/* */
/* High-level OpenType driver interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cff/cfferrs.h b/thirdparty/freetype/src/cff/cfferrs.h
index e7fc6eb71c..40808c1051 100644
--- a/thirdparty/freetype/src/cff/cfferrs.h
+++ b/thirdparty/freetype/src/cff/cfferrs.h
@@ -4,7 +4,7 @@
/* */
/* CFF error codes (specification only). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cff/cffgload.c b/thirdparty/freetype/src/cff/cffgload.c
index 752c18ed92..940804850e 100644
--- a/thirdparty/freetype/src/cff/cffgload.c
+++ b/thirdparty/freetype/src/cff/cffgload.c
@@ -4,7 +4,7 @@
/* */
/* OpenType Glyph Loader (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -278,11 +278,15 @@
if ( hinting && size )
{
- CFF_Internal internal = (CFF_Internal)size->root.internal;
+ FT_Size ftsize = FT_SIZE( size );
+ CFF_Internal internal = (CFF_Internal)ftsize->internal->module_data;
- builder->hints_globals = (void *)internal->topfont;
- builder->hints_funcs = glyph->root.internal->glyph_hints;
+ if ( internal )
+ {
+ builder->hints_globals = (void *)internal->topfont;
+ builder->hints_funcs = glyph->root.internal->glyph_hints;
+ }
}
}
@@ -391,7 +395,7 @@
/* clear everything */
- FT_MEM_ZERO( decoder, sizeof ( *decoder ) );
+ FT_ZERO( decoder );
/* initialize builder */
cff_builder_init( &decoder->builder, face, size, slot, hinting );
@@ -440,7 +444,8 @@
if ( builder->hints_funcs && size )
{
- CFF_Internal internal = (CFF_Internal)size->root.internal;
+ FT_Size ftsize = FT_SIZE( size );
+ CFF_Internal internal = (CFF_Internal)ftsize->internal->module_data;
/* for CFFs without subfonts, this value has already been set */
@@ -457,7 +462,7 @@
decoder->glyph_width = sub->private_dict.default_width;
decoder->nominal_width = sub->private_dict.nominal_width;
- decoder->current_subfont = sub; /* for Adobe's CFF handler */
+ decoder->current_subfont = sub;
Exit:
return error;
@@ -913,7 +918,6 @@
FT_Byte* limit;
CFF_Builder* builder = &decoder->builder;
FT_Pos x, y;
- FT_Fixed seed;
FT_Fixed* stack;
FT_Int charstring_type =
decoder->cff->top_font.font_dict.charstring_type;
@@ -929,15 +933,6 @@
decoder->num_hints = 0;
decoder->read_width = 1;
- /* compute random seed from stack address of parameter */
- seed = (FT_Fixed)( ( (FT_Offset)(char*)&seed ^
- (FT_Offset)(char*)&decoder ^
- (FT_Offset)(char*)&charstring_base ) &
- FT_ULONG_MAX );
- seed = ( seed ^ ( seed >> 10 ) ^ ( seed >> 20 ) ) & 0xFFFFL;
- if ( seed == 0 )
- seed = 0x7384;
-
/* initialize the decoder */
decoder->top = decoder->stack;
decoder->zone = decoder->zones;
@@ -1026,7 +1021,7 @@
if ( !( val & 0xFFFFL ) )
FT_TRACE4(( " %hd", (FT_Short)( (FT_UInt32)val >> 16 ) ));
else
- FT_TRACE4(( " %.2f", val / 65536.0 ));
+ FT_TRACE4(( " %.5f", val / 65536.0 ));
#endif
}
@@ -2104,22 +2099,16 @@
break;
case cff_op_random:
- {
- FT_Fixed Rand;
-
+ FT_TRACE4(( " random\n" ));
- FT_TRACE4(( " rand\n" ));
-
- Rand = seed;
- if ( Rand >= 0x8000L )
- Rand++;
+ /* only use the lower 16 bits of `random' */
+ /* to generate a number in the range (0;1] */
+ args[0] = (FT_Fixed)
+ ( ( decoder->current_subfont->random & 0xFFFF ) + 1 );
+ args++;
- args[0] = Rand;
- seed = FT_MulFix( seed, 0x10000L - seed );
- if ( seed == 0 )
- seed += 0x2873;
- args++;
- }
+ decoder->current_subfont->random =
+ cff_random( decoder->current_subfont->random );
break;
case cff_op_mul:
@@ -2445,7 +2434,7 @@
case cff_op_and:
{
- FT_Fixed cond = args[0] && args[1];
+ FT_Fixed cond = ( args[0] && args[1] );
FT_TRACE4(( " and\n" ));
@@ -2457,7 +2446,7 @@
case cff_op_or:
{
- FT_Fixed cond = args[0] || args[1];
+ FT_Fixed cond = ( args[0] || args[1] );
FT_TRACE4(( " or\n" ));
@@ -2481,7 +2470,7 @@
case cff_op_eq:
{
- FT_Fixed cond = args[0] == args[1];
+ FT_Fixed cond = ( args[0] == args[1] );
FT_TRACE4(( " eq\n" ));
@@ -2942,6 +2931,7 @@
cff_decoder_init( &decoder, face, size, glyph, hinting,
FT_LOAD_TARGET_MODE( load_flags ) );
+ /* this is for pure CFFs */
if ( load_flags & FT_LOAD_ADVANCE_ONLY )
decoder.width_only = TRUE;
diff --git a/thirdparty/freetype/src/cff/cffgload.h b/thirdparty/freetype/src/cff/cffgload.h
index b875fbed90..0fa93b4398 100644
--- a/thirdparty/freetype/src/cff/cffgload.h
+++ b/thirdparty/freetype/src/cff/cffgload.h
@@ -4,7 +4,7 @@
/* */
/* OpenType Glyph Loader (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cff/cffload.c b/thirdparty/freetype/src/cff/cffload.c
index 3d1bda97b9..3beaeb1c8e 100644
--- a/thirdparty/freetype/src/cff/cffload.c
+++ b/thirdparty/freetype/src/cff/cffload.c
@@ -4,7 +4,7 @@
/* */
/* OpenType and CFF data/program tables loader (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -23,12 +23,20 @@
#include FT_TRUETYPE_TAGS_H
#include FT_TYPE1_TABLES_H
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include FT_MULTIPLE_MASTERS_H
+#include FT_SERVICE_MULTIPLE_MASTERS_H
+#endif
+
#include "cffload.h"
#include "cffparse.h"
#include "cfferrs.h"
+#define FT_FIXED_ONE ( (FT_Fixed)0x10000 )
+
+
#if 1
static const FT_UShort cff_isoadobe_charset[229] =
@@ -225,19 +233,33 @@
static FT_Error
cff_index_init( CFF_Index idx,
FT_Stream stream,
- FT_Bool load )
+ FT_Bool load,
+ FT_Bool cff2 )
{
FT_Error error;
FT_Memory memory = stream->memory;
- FT_UShort count;
+ FT_UInt count;
- FT_MEM_ZERO( idx, sizeof ( *idx ) );
+ FT_ZERO( idx );
idx->stream = stream;
idx->start = FT_STREAM_POS();
- if ( !FT_READ_USHORT( count ) &&
- count > 0 )
+
+ if ( cff2 )
+ {
+ if ( FT_READ_ULONG( count ) )
+ goto Exit;
+ idx->hdr_size = 5;
+ }
+ else
+ {
+ if ( FT_READ_USHORT( count ) )
+ goto Exit;
+ idx->hdr_size = 3;
+ }
+
+ if ( count > 0 )
{
FT_Byte offsize;
FT_ULong size;
@@ -258,7 +280,7 @@
idx->off_size = offsize;
size = (FT_ULong)( count + 1 ) * offsize;
- idx->data_offset = idx->start + 3 + size;
+ idx->data_offset = idx->start + idx->hdr_size + size;
if ( FT_STREAM_SKIP( size - offsize ) )
goto Exit;
@@ -310,7 +332,7 @@
FT_FRAME_RELEASE( idx->bytes );
FT_FREE( idx->offsets );
- FT_MEM_ZERO( idx, sizeof ( *idx ) );
+ FT_ZERO( idx );
}
}
@@ -323,7 +345,7 @@
FT_Memory memory = stream->memory;
- if ( idx->count > 0 && idx->offsets == NULL )
+ if ( idx->count > 0 && !idx->offsets )
{
FT_Byte offsize = idx->off_size;
FT_ULong data_size;
@@ -335,7 +357,7 @@
data_size = (FT_ULong)( idx->count + 1 ) * offsize;
if ( FT_NEW_ARRAY( idx->offsets, idx->count + 1 ) ||
- FT_STREAM_SEEK( idx->start + 3 ) ||
+ FT_STREAM_SEEK( idx->start + idx->hdr_size ) ||
FT_FRAME_ENTER( data_size ) )
goto Exit;
@@ -395,7 +417,7 @@
*table = NULL;
- if ( idx->offsets == NULL )
+ if ( !idx->offsets )
{
error = cff_index_load_offsets( idx );
if ( error )
@@ -493,7 +515,7 @@
FT_ULong pos = element * idx->off_size;
- if ( FT_STREAM_SEEK( idx->start + 3 + pos ) )
+ if ( FT_STREAM_SEEK( idx->start + idx->hdr_size + pos ) )
goto Exit;
off1 = cff_index_read_offset( idx, &error );
@@ -589,20 +611,26 @@
FT_UInt element )
{
CFF_Index idx = &font->name_index;
- FT_Memory memory = idx->stream->memory;
+ FT_Memory memory;
FT_Byte* bytes;
FT_ULong byte_len;
FT_Error error;
FT_String* name = 0;
+ if ( !idx->stream ) /* CFF2 does not include a name index */
+ goto Exit;
+
+ memory = idx->stream->memory;
+
error = cff_index_access_element( idx, element, &bytes, &byte_len );
if ( error )
goto Exit;
if ( !FT_ALLOC( name, byte_len + 1 ) )
{
- FT_MEM_COPY( name, bytes, byte_len );
+ if ( byte_len )
+ FT_MEM_COPY( name, bytes, byte_len );
name[byte_len] = 0;
}
cff_index_forget_element( idx, &bytes );
@@ -724,6 +752,11 @@
FT_Byte fd = 0;
+ /* if there is no FDSelect, return zero */
+ /* Note: CFF2 with just one Font Dict has no FDSelect */
+ if ( !fdselect->data )
+ goto Exit;
+
switch ( fdselect->format )
{
case 0:
@@ -776,6 +809,7 @@
;
}
+ Exit:
return fd;
}
@@ -1054,6 +1088,522 @@
static void
+ cff_vstore_done( CFF_VStoreRec* vstore,
+ FT_Memory memory )
+ {
+ FT_UInt i;
+
+
+ /* free regionList and axisLists */
+ if ( vstore->varRegionList )
+ {
+ for ( i = 0; i < vstore->regionCount; i++ )
+ FT_FREE( vstore->varRegionList[i].axisList );
+ }
+ FT_FREE( vstore->varRegionList );
+
+ /* free varData and indices */
+ if ( vstore->varData )
+ {
+ for ( i = 0; i < vstore->dataCount; i++ )
+ FT_FREE( vstore->varData[i].regionIndices );
+ }
+ FT_FREE( vstore->varData );
+ }
+
+
+ /* convert 2.14 to Fixed */
+ #define FT_fdot14ToFixed( x ) ( (FT_Fixed)( (FT_ULong)(x) << 2 ) )
+
+
+ static FT_Error
+ cff_vstore_load( CFF_VStoreRec* vstore,
+ FT_Stream stream,
+ FT_ULong base_offset,
+ FT_ULong offset )
+ {
+ FT_Memory memory = stream->memory;
+ FT_Error error = FT_ERR( Invalid_File_Format );
+
+ FT_ULong* dataOffsetArray = NULL;
+ FT_UInt i, j;
+
+
+ /* no offset means no vstore to parse */
+ if ( offset )
+ {
+ FT_UInt vsOffset;
+ FT_UInt format;
+ FT_ULong regionListOffset;
+
+
+ /* we need to parse the table to determine its size; */
+ /* skip table length */
+ if ( FT_STREAM_SEEK( base_offset + offset ) ||
+ FT_STREAM_SKIP( 2 ) )
+ goto Exit;
+
+ /* actual variation store begins after the length */
+ vsOffset = FT_STREAM_POS();
+
+ /* check the header */
+ if ( FT_READ_USHORT( format ) )
+ goto Exit;
+ if ( format != 1 )
+ {
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ /* read top level fields */
+ if ( FT_READ_ULONG( regionListOffset ) ||
+ FT_READ_USHORT( vstore->dataCount ) )
+ goto Exit;
+
+ /* make temporary copy of item variation data offsets; */
+ /* we'll parse region list first, then come back */
+ if ( FT_NEW_ARRAY( dataOffsetArray, vstore->dataCount ) )
+ goto Exit;
+
+ for ( i = 0; i < vstore->dataCount; i++ )
+ {
+ if ( FT_READ_ULONG( dataOffsetArray[i] ) )
+ goto Exit;
+ }
+
+ /* parse regionList and axisLists */
+ if ( FT_STREAM_SEEK( vsOffset + regionListOffset ) ||
+ FT_READ_USHORT( vstore->axisCount ) ||
+ FT_READ_USHORT( vstore->regionCount ) )
+ goto Exit;
+
+ if ( FT_NEW_ARRAY( vstore->varRegionList, vstore->regionCount ) )
+ goto Exit;
+
+ for ( i = 0; i < vstore->regionCount; i++ )
+ {
+ CFF_VarRegion* region = &vstore->varRegionList[i];
+
+
+ if ( FT_NEW_ARRAY( region->axisList, vstore->axisCount ) )
+ goto Exit;
+
+ for ( j = 0; j < vstore->axisCount; j++ )
+ {
+ CFF_AxisCoords* axis = &region->axisList[j];
+
+ FT_Int16 start14, peak14, end14;
+
+
+ if ( FT_READ_SHORT( start14 ) ||
+ FT_READ_SHORT( peak14 ) ||
+ FT_READ_SHORT( end14 ) )
+ goto Exit;
+
+ axis->startCoord = FT_fdot14ToFixed( start14 );
+ axis->peakCoord = FT_fdot14ToFixed( peak14 );
+ axis->endCoord = FT_fdot14ToFixed( end14 );
+ }
+ }
+
+ /* use dataOffsetArray now to parse varData items */
+ if ( FT_NEW_ARRAY( vstore->varData, vstore->dataCount ) )
+ goto Exit;
+
+ for ( i = 0; i < vstore->dataCount; i++ )
+ {
+ CFF_VarData* data = &vstore->varData[i];
+
+
+ if ( FT_STREAM_SEEK( vsOffset + dataOffsetArray[i] ) )
+ goto Exit;
+
+ /* ignore `itemCount' and `shortDeltaCount' */
+ /* because CFF2 has no delta sets */
+ if ( FT_STREAM_SKIP( 4 ) )
+ goto Exit;
+
+ /* Note: just record values; consistency is checked later */
+ /* by cff_blend_build_vector when it consumes `vstore' */
+
+ if ( FT_READ_USHORT( data->regionIdxCount ) )
+ goto Exit;
+
+ if ( FT_NEW_ARRAY( data->regionIndices, data->regionIdxCount ) )
+ goto Exit;
+
+ for ( j = 0; j < data->regionIdxCount; j++ )
+ {
+ if ( FT_READ_USHORT( data->regionIndices[j] ) )
+ goto Exit;
+ }
+ }
+ }
+
+ error = FT_Err_Ok;
+
+ Exit:
+ FT_FREE( dataOffsetArray );
+ if ( error )
+ cff_vstore_done( vstore, memory );
+
+ return error;
+ }
+
+
+ /* Clear blend stack (after blend values are consumed). */
+ /* */
+ /* TODO: Should do this in cff_run_parse, but subFont */
+ /* ref is not available there. */
+ /* */
+ /* Allocation is not changed when stack is cleared. */
+ FT_LOCAL_DEF( void )
+ cff_blend_clear( CFF_SubFont subFont )
+ {
+ subFont->blend_top = subFont->blend_stack;
+ subFont->blend_used = 0;
+ }
+
+
+ /* Blend numOperands on the stack, */
+ /* store results into the first numBlends values, */
+ /* then pop remaining arguments. */
+ /* */
+ /* This is comparable to `cf2_doBlend' but */
+ /* the cffparse stack is different and can't be written. */
+ /* Blended values are written to a different buffer, */
+ /* using reserved operator 255. */
+ /* */
+ /* Blend calculation is done in 16.16 fixed point. */
+ FT_LOCAL_DEF( FT_Error )
+ cff_blend_doBlend( CFF_SubFont subFont,
+ CFF_Parser parser,
+ FT_UInt numBlends )
+ {
+ FT_UInt delta;
+ FT_UInt base;
+ FT_UInt i, j;
+ FT_UInt size;
+
+ CFF_Blend blend = &subFont->blend;
+
+ FT_Memory memory = subFont->blend.font->memory; /* for FT_REALLOC */
+ FT_Error error = FT_Err_Ok; /* for FT_REALLOC */
+
+ /* compute expected number of operands for this blend */
+ FT_UInt numOperands = (FT_UInt)( numBlends * blend->lenBV );
+ FT_UInt count = (FT_UInt)( parser->top - 1 - parser->stack );
+
+
+ if ( numOperands > count )
+ {
+ FT_TRACE4(( " cff_blend_doBlend: Stack underflow %d args\n", count ));
+
+ error = FT_THROW( Stack_Underflow );
+ goto Exit;
+ }
+
+ /* check whether we have room for `numBlends' values at `blend_top' */
+ size = 5 * numBlends; /* add 5 bytes per entry */
+ if ( subFont->blend_used + size > subFont->blend_alloc )
+ {
+ FT_Byte* blend_stack_old = subFont->blend_stack;
+ FT_Byte* blend_top_old = subFont->blend_top;
+
+
+ /* increase or allocate `blend_stack' and reset `blend_top'; */
+ /* prepare to append `numBlends' values to the buffer */
+ if ( FT_REALLOC( subFont->blend_stack,
+ subFont->blend_alloc,
+ subFont->blend_alloc + size ) )
+ goto Exit;
+
+ subFont->blend_top = subFont->blend_stack + subFont->blend_used;
+ subFont->blend_alloc += size;
+
+ /* iterate over the parser stack and adjust pointers */
+ /* if the reallocated buffer has a different address */
+ if ( blend_stack_old &&
+ subFont->blend_stack != blend_stack_old )
+ {
+ FT_PtrDist offset = subFont->blend_stack - blend_stack_old;
+ FT_Byte** p;
+
+
+ for ( p = parser->stack; p < parser->top; p++ )
+ {
+ if ( *p >= blend_stack_old && *p < blend_top_old )
+ *p += offset;
+ }
+ }
+ }
+ subFont->blend_used += size;
+
+ base = count - numOperands; /* index of first blend arg */
+ delta = base + numBlends; /* index of first delta arg */
+
+ for ( i = 0; i < numBlends; i++ )
+ {
+ const FT_Int32* weight = &blend->BV[1];
+ FT_Int32 sum;
+
+
+ /* convert inputs to 16.16 fixed point */
+ sum = cff_parse_num( parser, &parser->stack[i + base] ) * 65536;
+
+ for ( j = 1; j < blend->lenBV; j++ )
+ sum += FT_MulFix( *weight++,
+ cff_parse_num( parser,
+ &parser->stack[delta++] ) * 65536 );
+
+ /* point parser stack to new value on blend_stack */
+ parser->stack[i + base] = subFont->blend_top;
+
+ /* Push blended result as Type 2 5-byte fixed point number. This */
+ /* will not conflict with actual DICTs because 255 is a reserved */
+ /* opcode in both CFF and CFF2 DICTs. See `cff_parse_num' for */
+ /* decode of this, which rounds to an integer. */
+ *subFont->blend_top++ = 255;
+ *subFont->blend_top++ = ( (FT_UInt32)sum & 0xFF000000U ) >> 24;
+ *subFont->blend_top++ = ( (FT_UInt32)sum & 0x00FF0000U ) >> 16;
+ *subFont->blend_top++ = ( (FT_UInt32)sum & 0x0000FF00U ) >> 8;
+ *subFont->blend_top++ = (FT_UInt32)sum & 0x000000FFU;
+ }
+
+ /* leave only numBlends results on parser stack */
+ parser->top = &parser->stack[base + numBlends];
+
+ Exit:
+ return error;
+ }
+
+
+ /* Compute a blend vector from variation store index and normalized */
+ /* vector based on pseudo-code in OpenType Font Variations Overview. */
+ /* */
+ /* Note: lenNDV == 0 produces a default blend vector, (1,0,0,...). */
+ FT_LOCAL_DEF( FT_Error )
+ cff_blend_build_vector( CFF_Blend blend,
+ FT_UInt vsindex,
+ FT_UInt lenNDV,
+ FT_Fixed* NDV )
+ {
+ FT_Error error = FT_Err_Ok; /* for FT_REALLOC */
+ FT_Memory memory = blend->font->memory; /* for FT_REALLOC */
+
+ FT_UInt len;
+ CFF_VStore vs;
+ CFF_VarData* varData;
+ FT_UInt master;
+
+
+ FT_ASSERT( lenNDV == 0 || NDV );
+
+ blend->builtBV = FALSE;
+
+ vs = &blend->font->vstore;
+
+ /* VStore and fvar must be consistent */
+ if ( lenNDV != 0 && lenNDV != vs->axisCount )
+ {
+ FT_TRACE4(( " cff_blend_build_vector: Axis count mismatch\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ if ( vsindex >= vs->dataCount )
+ {
+ FT_TRACE4(( " cff_blend_build_vector: vsindex out of range\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ /* select the item variation data structure */
+ varData = &vs->varData[vsindex];
+
+ /* prepare buffer for the blend vector */
+ len = varData->regionIdxCount + 1; /* add 1 for default component */
+ if ( FT_REALLOC( blend->BV,
+ blend->lenBV * sizeof( *blend->BV ),
+ len * sizeof( *blend->BV ) ) )
+ goto Exit;
+
+ blend->lenBV = len;
+
+ /* outer loop steps through master designs to be blended */
+ for ( master = 0; master < len; master++ )
+ {
+ FT_UInt j;
+ FT_UInt idx;
+ CFF_VarRegion* varRegion;
+
+
+ /* default factor is always one */
+ if ( master == 0 )
+ {
+ blend->BV[master] = FT_FIXED_ONE;
+ FT_TRACE4(( " build blend vector len %d\n"
+ " [ %f ",
+ len,
+ blend->BV[master] / 65536.0 ));
+ continue;
+ }
+
+ /* VStore array does not include default master, so subtract one */
+ idx = varData->regionIndices[master - 1];
+ varRegion = &vs->varRegionList[idx];
+
+ if ( idx >= vs->regionCount )
+ {
+ FT_TRACE4(( " cff_blend_build_vector:"
+ " region index out of range\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ /* Note: `lenNDV' could be zero. */
+ /* In that case, build default blend vector (1,0,0...). */
+ if ( !lenNDV )
+ {
+ blend->BV[master] = 0;
+ continue;
+ }
+
+ /* In the normal case, initialize each component to 1 */
+ /* before inner loop. */
+ blend->BV[master] = FT_FIXED_ONE; /* default */
+
+ /* inner loop steps through axes in this region */
+ for ( j = 0; j < lenNDV; j++ )
+ {
+ CFF_AxisCoords* axis = &varRegion->axisList[j];
+ FT_Fixed axisScalar;
+
+
+ /* compute the scalar contribution of this axis; */
+ /* ignore invalid ranges */
+ if ( axis->startCoord > axis->peakCoord ||
+ axis->peakCoord > axis->endCoord )
+ axisScalar = FT_FIXED_ONE;
+
+ else if ( axis->startCoord < 0 &&
+ axis->endCoord > 0 &&
+ axis->peakCoord != 0 )
+ axisScalar = FT_FIXED_ONE;
+
+ /* peak of 0 means ignore this axis */
+ else if ( axis->peakCoord == 0 )
+ axisScalar = FT_FIXED_ONE;
+
+ /* ignore this region if coords are out of range */
+ else if ( NDV[j] < axis->startCoord ||
+ NDV[j] > axis->endCoord )
+ axisScalar = 0;
+
+ /* calculate a proportional factor */
+ else
+ {
+ if ( NDV[j] == axis->peakCoord )
+ axisScalar = FT_FIXED_ONE;
+ else if ( NDV[j] < axis->peakCoord )
+ axisScalar = FT_DivFix( NDV[j] - axis->startCoord,
+ axis->peakCoord - axis->startCoord );
+ else
+ axisScalar = FT_DivFix( axis->endCoord - NDV[j],
+ axis->endCoord - axis->peakCoord );
+ }
+
+ /* take product of all the axis scalars */
+ blend->BV[master] = FT_MulFix( blend->BV[master], axisScalar );
+ }
+
+ FT_TRACE4(( ", %f ",
+ blend->BV[master] / 65536.0 ));
+ }
+
+ FT_TRACE4(( "]\n" ));
+
+ /* record the parameters used to build the blend vector */
+ blend->lastVsindex = vsindex;
+
+ if ( lenNDV != 0 )
+ {
+ /* user has set a normalized vector */
+ if ( FT_REALLOC( blend->lastNDV,
+ blend->lenNDV * sizeof ( *NDV ),
+ lenNDV * sizeof ( *NDV ) ) )
+ goto Exit;
+
+ FT_MEM_COPY( blend->lastNDV,
+ NDV,
+ lenNDV * sizeof ( *NDV ) );
+ }
+
+ blend->lenNDV = lenNDV;
+ blend->builtBV = TRUE;
+
+ Exit:
+ return error;
+ }
+
+
+ /* `lenNDV' is zero for default vector; */
+ /* return TRUE if blend vector needs to be built. */
+ FT_LOCAL_DEF( FT_Bool )
+ cff_blend_check_vector( CFF_Blend blend,
+ FT_UInt vsindex,
+ FT_UInt lenNDV,
+ FT_Fixed* NDV )
+ {
+ if ( !blend->builtBV ||
+ blend->lastVsindex != vsindex ||
+ blend->lenNDV != lenNDV ||
+ ( lenNDV &&
+ memcmp( NDV,
+ blend->lastNDV,
+ lenNDV * sizeof ( *NDV ) ) != 0 ) )
+ {
+ /* need to build blend vector */
+ return TRUE;
+ }
+
+ return FALSE;
+ }
+
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+ FT_LOCAL_DEF( FT_Error )
+ cff_get_var_blend( CFF_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords,
+ FT_Fixed* *normalizedcoords,
+ FT_MM_Var* *mm_var )
+ {
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+
+ return mm->get_var_blend( FT_FACE( face ),
+ num_coords,
+ coords,
+ normalizedcoords,
+ mm_var );
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cff_done_blend( CFF_Face face )
+ {
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+
+ mm->done_blend( FT_FACE( face ) );
+ }
+
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
+
+ static void
cff_encoding_done( CFF_Encoding encoding )
{
encoding->format = 0;
@@ -1305,31 +1855,148 @@
}
+ /* Parse private dictionary; first call is always from `cff_face_init', */
+ /* so NDV has not been set for CFF2 variation. */
+ /* */
+ /* `cff_slot_load' must call this function each time NDV changes. */
+ FT_LOCAL_DEF( FT_Error )
+ cff_load_private_dict( CFF_Font font,
+ CFF_SubFont subfont,
+ FT_UInt lenNDV,
+ FT_Fixed* NDV )
+ {
+ FT_Error error = FT_Err_Ok;
+ CFF_ParserRec parser;
+ CFF_FontRecDict top = &subfont->font_dict;
+ CFF_Private priv = &subfont->private_dict;
+ FT_Stream stream = font->stream;
+ FT_UInt stackSize;
+
+
+ /* store handle needed to access memory, vstore for blend; */
+ /* we need this for clean-up even if there is no private DICT */
+ subfont->blend.font = font;
+ subfont->blend.usedBV = FALSE; /* clear state */
+
+ if ( !top->private_offset || !top->private_size )
+ goto Exit2; /* no private DICT, do nothing */
+
+ /* set defaults */
+ FT_ZERO( priv );
+
+ priv->blue_shift = 7;
+ priv->blue_fuzz = 1;
+ priv->lenIV = -1;
+ priv->expansion_factor = (FT_Fixed)( 0.06 * 0x10000L );
+ priv->blue_scale = (FT_Fixed)( 0.039625 * 0x10000L * 1000 );
+
+ /* provide inputs for blend calculations */
+ priv->subfont = subfont;
+ subfont->lenNDV = lenNDV;
+ subfont->NDV = NDV;
+
+ /* add 1 for the operator */
+ stackSize = font->cff2 ? font->top_font.font_dict.maxstack + 1
+ : CFF_MAX_STACK_DEPTH + 1;
+
+ if ( cff_parser_init( &parser,
+ font->cff2 ? CFF2_CODE_PRIVATE : CFF_CODE_PRIVATE,
+ priv,
+ font->library,
+ stackSize,
+ top->num_designs,
+ top->num_axes ) )
+ goto Exit;
+
+ if ( FT_STREAM_SEEK( font->base_offset + top->private_offset ) ||
+ FT_FRAME_ENTER( top->private_size ) )
+ goto Exit;
+
+ FT_TRACE4(( " private dictionary:\n" ));
+ error = cff_parser_run( &parser,
+ (FT_Byte*)stream->cursor,
+ (FT_Byte*)stream->limit );
+ FT_FRAME_EXIT();
+
+ if ( error )
+ goto Exit;
+
+ /* ensure that `num_blue_values' is even */
+ priv->num_blue_values &= ~1;
+
+ /* sanitize `initialRandomSeed' to be a positive value, if necessary; */
+ /* this is not mandated by the specification but by our implementation */
+ if ( priv->initial_random_seed < 0 )
+ priv->initial_random_seed = -priv->initial_random_seed;
+ else if ( priv->initial_random_seed == 0 )
+ priv->initial_random_seed = 987654321;
+
+ Exit:
+ /* clean up */
+ cff_blend_clear( subfont ); /* clear blend stack */
+ cff_parser_done( &parser ); /* free parser stack */
+
+ Exit2:
+ /* no clean up (parser not initialized) */
+ return error;
+ }
+
+
+ FT_LOCAL_DEF( FT_UInt32 )
+ cff_random( FT_UInt32 r )
+ {
+ /* a 32bit version of the `xorshift' algorithm */
+ r ^= r << 13;
+ r ^= r >> 17;
+ r ^= r << 5;
+
+ return r;
+ }
+
+
+ /* There are 3 ways to call this function, distinguished by code. */
+ /* */
+ /* . CFF_CODE_TOPDICT for either a CFF Top DICT or a CFF Font DICT */
+ /* . CFF2_CODE_TOPDICT for CFF2 Top DICT */
+ /* . CFF2_CODE_FONTDICT for CFF2 Font DICT */
+
static FT_Error
- cff_subfont_load( CFF_SubFont font,
+ cff_subfont_load( CFF_SubFont subfont,
CFF_Index idx,
FT_UInt font_index,
FT_Stream stream,
FT_ULong base_offset,
- FT_Library library )
+ FT_UInt code,
+ CFF_Font font,
+ CFF_Face face )
{
FT_Error error;
CFF_ParserRec parser;
FT_Byte* dict = NULL;
FT_ULong dict_len;
- CFF_FontRecDict top = &font->font_dict;
- CFF_Private priv = &font->private_dict;
-
-
- cff_parser_init( &parser,
- CFF_CODE_TOPDICT,
- &font->font_dict,
- library,
- 0,
- 0 );
+ CFF_FontRecDict top = &subfont->font_dict;
+ CFF_Private priv = &subfont->private_dict;
+
+ FT_Bool cff2 = FT_BOOL( code == CFF2_CODE_TOPDICT ||
+ code == CFF2_CODE_FONTDICT );
+ FT_UInt stackSize = cff2 ? CFF2_DEFAULT_STACK
+ : CFF_MAX_STACK_DEPTH;
+
+
+ /* Note: We use default stack size for CFF2 Font DICT because */
+ /* Top and Font DICTs are not allowed to have blend operators. */
+ error = cff_parser_init( &parser,
+ code,
+ &subfont->font_dict,
+ font->library,
+ stackSize,
+ 0,
+ 0 );
+ if ( error )
+ goto Exit;
/* set defaults */
- FT_MEM_ZERO( top, sizeof ( *top ) );
+ FT_ZERO( top );
top->underline_position = -( 100L << 16 );
top->underline_thickness = 50L << 16;
@@ -1352,14 +2019,35 @@
top->cid_ordering = 0xFFFFU;
top->cid_font_name = 0xFFFFU;
- error = cff_index_access_element( idx, font_index, &dict, &dict_len );
+ /* set default stack size */
+ top->maxstack = cff2 ? CFF2_DEFAULT_STACK : 48;
+
+ if ( idx->count ) /* count is nonzero for a real index */
+ error = cff_index_access_element( idx, font_index, &dict, &dict_len );
+ else
+ {
+ /* CFF2 has a fake top dict index; */
+ /* simulate `cff_index_access_element' */
+
+ /* Note: macros implicitly use `stream' and set `error' */
+ if ( FT_STREAM_SEEK( idx->data_offset ) ||
+ FT_FRAME_EXTRACT( idx->data_size, dict ) )
+ goto Exit;
+
+ dict_len = idx->data_size;
+ }
+
if ( !error )
{
FT_TRACE4(( " top dictionary:\n" ));
error = cff_parser_run( &parser, dict, dict + dict_len );
}
- cff_index_forget_element( idx, &dict );
+ /* clean up regardless of error */
+ if ( idx->count )
+ cff_index_forget_element( idx, &dict );
+ else
+ FT_FRAME_RELEASE( dict );
if ( error )
goto Exit;
@@ -1368,39 +2056,62 @@
if ( top->cid_registry != 0xFFFFU )
goto Exit;
- /* parse the private dictionary, if any */
- if ( top->private_offset && top->private_size )
+ /* Parse the private dictionary, if any. */
+ /* */
+ /* CFF2 does not have a private dictionary in the Top DICT */
+ /* but may have one in a Font DICT. We need to parse */
+ /* the latter here in order to load any local subrs. */
+ error = cff_load_private_dict( font, subfont, 0, 0 );
+ if ( error )
+ goto Exit;
+
+ if ( !cff2 )
{
- /* set defaults */
- FT_MEM_ZERO( priv, sizeof ( *priv ) );
-
- priv->blue_shift = 7;
- priv->blue_fuzz = 1;
- priv->lenIV = -1;
- priv->expansion_factor = (FT_Fixed)( 0.06 * 0x10000L );
- priv->blue_scale = (FT_Fixed)( 0.039625 * 0x10000L * 1000 );
-
- cff_parser_init( &parser,
- CFF_CODE_PRIVATE,
- priv,
- library,
- top->num_designs,
- top->num_axes );
-
- if ( FT_STREAM_SEEK( base_offset + font->font_dict.private_offset ) ||
- FT_FRAME_ENTER( font->font_dict.private_size ) )
- goto Exit;
+ /*
+ * Initialize the random number generator.
+ *
+ * . If we have a face-specific seed, use it.
+ * If non-zero, update it to a positive value.
+ *
+ * . Otherwise, use the seed from the CFF driver.
+ * If non-zero, update it to a positive value.
+ *
+ * . If the random value is zero, use the seed given by the subfont's
+ * `initialRandomSeed' value.
+ *
+ */
+ if ( face->root.internal->random_seed == -1 )
+ {
+ CFF_Driver driver = (CFF_Driver)FT_FACE_DRIVER( face );
- FT_TRACE4(( " private dictionary:\n" ));
- error = cff_parser_run( &parser,
- (FT_Byte*)stream->cursor,
- (FT_Byte*)stream->limit );
- FT_FRAME_EXIT();
- if ( error )
- goto Exit;
- /* ensure that `num_blue_values' is even */
- priv->num_blue_values &= ~1;
+ subfont->random = (FT_UInt32)driver->random_seed;
+ if ( driver->random_seed )
+ {
+ do
+ {
+ driver->random_seed =
+ (FT_Int32)cff_random( (FT_UInt32)driver->random_seed );
+
+ } while ( driver->random_seed < 0 );
+ }
+ }
+ else
+ {
+ subfont->random = (FT_UInt32)face->root.internal->random_seed;
+ if ( face->root.internal->random_seed )
+ {
+ do
+ {
+ face->root.internal->random_seed =
+ (FT_Int32)cff_random( (FT_UInt32)face->root.internal->random_seed );
+
+ } while ( face->root.internal->random_seed < 0 );
+ }
+ }
+
+ if ( !subfont->random )
+ subfont->random = (FT_UInt32)priv->initial_random_seed;
}
/* read the local subrs, if any */
@@ -1410,17 +2121,19 @@
priv->local_subrs_offset ) )
goto Exit;
- error = cff_index_init( &font->local_subrs_index, stream, 1 );
+ error = cff_index_init( &subfont->local_subrs_index, stream, 1, cff2 );
if ( error )
goto Exit;
- error = cff_index_get_pointers( &font->local_subrs_index,
- &font->local_subrs, NULL, NULL );
+ error = cff_index_get_pointers( &subfont->local_subrs_index,
+ &subfont->local_subrs, NULL, NULL );
if ( error )
goto Exit;
}
Exit:
+ cff_parser_done( &parser ); /* free parser stack */
+
return error;
}
@@ -1433,6 +2146,10 @@
{
cff_index_done( &subfont->local_subrs_index );
FT_FREE( subfont->local_subrs );
+
+ FT_FREE( subfont->blend.lastNDV );
+ FT_FREE( subfont->blend.BV );
+ FT_FREE( subfont->blend_stack );
}
}
@@ -1442,18 +2159,19 @@
FT_Stream stream,
FT_Int face_index,
CFF_Font font,
- FT_Bool pure_cff )
+ CFF_Face face,
+ FT_Bool pure_cff,
+ FT_Bool cff2 )
{
static const FT_Frame_Field cff_header_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE CFF_FontRec
- FT_FRAME_START( 4 ),
+ FT_FRAME_START( 3 ),
FT_FRAME_BYTE( version_major ),
FT_FRAME_BYTE( version_minor ),
FT_FRAME_BYTE( header_size ),
- FT_FRAME_BYTE( absolute_offsize ),
FT_FRAME_END
};
@@ -1468,43 +2186,133 @@
FT_ZERO( font );
FT_ZERO( &string_index );
- font->stream = stream;
- font->memory = memory;
- dict = &font->top_font.font_dict;
- base_offset = FT_STREAM_POS();
+ dict = &font->top_font.font_dict;
+ base_offset = FT_STREAM_POS();
+
+ font->library = library;
+ font->stream = stream;
+ font->memory = memory;
+ font->cff2 = cff2;
+ font->base_offset = base_offset;
/* read CFF font header */
if ( FT_STREAM_READ_FIELDS( cff_header_fields, font ) )
goto Exit;
- /* check format */
- if ( font->version_major != 1 ||
- font->header_size < 4 ||
- font->absolute_offsize > 4 )
+ if ( cff2 )
{
- FT_TRACE2(( " not a CFF font header\n" ));
- error = FT_THROW( Unknown_File_Format );
- goto Exit;
+ if ( font->version_major != 2 ||
+ font->header_size < 5 )
+ {
+ FT_TRACE2(( " not a CFF2 font header\n" ));
+ error = FT_THROW( Unknown_File_Format );
+ goto Exit;
+ }
+
+ if ( FT_READ_USHORT( font->top_dict_length ) )
+ goto Exit;
+ }
+ else
+ {
+ FT_Byte absolute_offset;
+
+
+ if ( FT_READ_BYTE( absolute_offset ) )
+ goto Exit;
+
+ if ( font->version_major != 1 ||
+ font->header_size < 4 ||
+ absolute_offset > 4 )
+ {
+ FT_TRACE2(( " not a CFF font header\n" ));
+ error = FT_THROW( Unknown_File_Format );
+ goto Exit;
+ }
}
/* skip the rest of the header */
- if ( FT_STREAM_SKIP( font->header_size - 4 ) )
+ if ( FT_STREAM_SEEK( base_offset + font->header_size ) )
+ {
+ /* For pure CFFs we have read only four bytes so far. Contrary to */
+ /* other formats like SFNT those bytes doesn't define a signature; */
+ /* it is thus possible that the font isn't a CFF at all. */
+ if ( pure_cff )
+ {
+ FT_TRACE2(( " not a CFF file\n" ));
+ error = FT_THROW( Unknown_File_Format );
+ }
goto Exit;
+ }
- /* read the name, top dict, string and global subrs index */
- if ( FT_SET_ERROR( cff_index_init( &font->name_index,
- stream, 0 ) ) ||
- FT_SET_ERROR( cff_index_init( &font->font_dict_index,
- stream, 0 ) ) ||
- FT_SET_ERROR( cff_index_init( &string_index,
- stream, 1 ) ) ||
- FT_SET_ERROR( cff_index_init( &font->global_subrs_index,
- stream, 1 ) ) ||
- FT_SET_ERROR( cff_index_get_pointers( &string_index,
- &font->strings,
- &font->string_pool,
- &font->string_pool_size ) ) )
- goto Exit;
+ if ( cff2 )
+ {
+ /* For CFF2, the top dict data immediately follow the header */
+ /* and the length is stored in the header `offSize' field; */
+ /* there is no index for it. */
+ /* */
+ /* Use the `font_dict_index' to save the current position */
+ /* and length of data, but leave count at zero as an indicator. */
+ FT_ZERO( &font->font_dict_index );
+
+ font->font_dict_index.data_offset = FT_STREAM_POS();
+ font->font_dict_index.data_size = font->top_dict_length;
+
+ /* skip the top dict data for now, we will parse it later */
+ if ( FT_STREAM_SKIP( font->top_dict_length ) )
+ goto Exit;
+
+ /* next, read the global subrs index */
+ if ( FT_SET_ERROR( cff_index_init( &font->global_subrs_index,
+ stream, 1, cff2 ) ) )
+ goto Exit;
+ }
+ else
+ {
+ /* for CFF, read the name, top dict, string and global subrs index */
+ if ( FT_SET_ERROR( cff_index_init( &font->name_index,
+ stream, 0, cff2 ) ) )
+ {
+ if ( pure_cff )
+ {
+ FT_TRACE2(( " not a CFF file\n" ));
+ error = FT_THROW( Unknown_File_Format );
+ }
+ goto Exit;
+ }
+
+ /* if we have an empty font name, */
+ /* it must be the only font in the CFF */
+ if ( font->name_index.count > 1 &&
+ font->name_index.data_size < font->name_index.count )
+ {
+ /* for pure CFFs, we still haven't checked enough bytes */
+ /* to be sure that it is a CFF at all */
+ error = pure_cff ? FT_THROW( Unknown_File_Format )
+ : FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ if ( FT_SET_ERROR( cff_index_init( &font->font_dict_index,
+ stream, 0, cff2 ) ) ||
+ FT_SET_ERROR( cff_index_init( &string_index,
+ stream, 1, cff2 ) ) ||
+ FT_SET_ERROR( cff_index_init( &font->global_subrs_index,
+ stream, 1, cff2 ) ) ||
+ FT_SET_ERROR( cff_index_get_pointers( &string_index,
+ &font->strings,
+ &font->string_pool,
+ &font->string_pool_size ) ) )
+ goto Exit;
+
+ /* there must be a Top DICT index entry for each name index entry */
+ if ( font->name_index.count > font->font_dict_index.count )
+ {
+ FT_ERROR(( "cff_font_load:"
+ " not enough entries in Top DICT index\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+ }
font->num_strings = string_index.count;
@@ -1550,34 +2358,48 @@
subfont_index,
stream,
base_offset,
- library );
+ cff2 ? CFF2_CODE_TOPDICT : CFF_CODE_TOPDICT,
+ font,
+ face );
if ( error )
goto Exit;
if ( FT_STREAM_SEEK( base_offset + dict->charstrings_offset ) )
goto Exit;
- error = cff_index_init( &font->charstrings_index, stream, 0 );
+ error = cff_index_init( &font->charstrings_index, stream, 0, cff2 );
if ( error )
goto Exit;
- /* now, check for a CID font */
- if ( dict->cid_registry != 0xFFFFU )
+ /* now, check for a CID or CFF2 font */
+ if ( dict->cid_registry != 0xFFFFU ||
+ cff2 )
{
CFF_IndexRec fd_index;
CFF_SubFont sub = NULL;
FT_UInt idx;
+ /* for CFF2, read the Variation Store if available; */
+ /* this must follow the Top DICT parse and precede any Private DICT */
+ error = cff_vstore_load( &font->vstore,
+ stream,
+ base_offset,
+ dict->vstore_offset );
+ if ( error )
+ goto Exit;
+
/* this is a CID-keyed font, we must now allocate a table of */
/* sub-fonts, then load each of them separately */
if ( FT_STREAM_SEEK( base_offset + dict->cid_fd_array_offset ) )
goto Exit;
- error = cff_index_init( &fd_index, stream, 0 );
+ error = cff_index_init( &fd_index, stream, 0, cff2 );
if ( error )
goto Exit;
+ /* Font Dicts are not limited to 256 for CFF2. */
+ /* TODO: support this for CFF2 */
if ( fd_index.count > CFF_MAX_CID_FONTS )
{
FT_TRACE0(( "cff_font_load: FD array too large in CID font\n" ));
@@ -1598,17 +2420,26 @@
{
sub = font->subfonts[idx];
FT_TRACE4(( "parsing subfont %u\n", idx ));
- error = cff_subfont_load( sub, &fd_index, idx,
- stream, base_offset, library );
+ error = cff_subfont_load( sub,
+ &fd_index,
+ idx,
+ stream,
+ base_offset,
+ cff2 ? CFF2_CODE_FONTDICT
+ : CFF_CODE_TOPDICT,
+ font,
+ face );
if ( error )
goto Fail_CID;
}
- /* now load the FD Select array */
- error = CFF_Load_FD_Select( &font->fd_select,
- font->charstrings_index.count,
- stream,
- base_offset + dict->cid_fd_select_offset );
+ /* now load the FD Select array; */
+ /* CFF2 omits FDSelect if there is only one FD */
+ if ( !cff2 || fd_index.count > 1 )
+ error = CFF_Load_FD_Select( &font->fd_select,
+ font->charstrings_index.count,
+ stream,
+ base_offset + dict->cid_fd_select_offset );
Fail_CID:
cff_index_done( &fd_index );
@@ -1636,7 +2467,7 @@
goto Exit;
/* read the Charset and Encoding tables if available */
- if ( font->num_glyphs > 0 )
+ if ( !cff2 && font->num_glyphs > 0 )
{
FT_Bool invert = FT_BOOL( dict->cid_registry != 0xFFFFU && pure_cff );
@@ -1684,7 +2515,7 @@
cff_index_done( &font->charstrings_index );
/* release font dictionaries, but only if working with */
- /* a CID keyed CFF font */
+ /* a CID keyed CFF font or a CFF2 font */
if ( font->num_subfonts > 0 )
{
for ( idx = 0; idx < font->num_subfonts; idx++ )
@@ -1696,6 +2527,7 @@
cff_encoding_done( &font->encoding );
cff_charset_done( &font->charset, font->stream );
+ cff_vstore_done( &font->vstore, memory );
cff_subfont_done( memory, &font->top_font );
diff --git a/thirdparty/freetype/src/cff/cffload.h b/thirdparty/freetype/src/cff/cffload.h
index 1dd07baf11..c745e8127b 100644
--- a/thirdparty/freetype/src/cff/cffload.h
+++ b/thirdparty/freetype/src/cff/cffload.h
@@ -4,7 +4,7 @@
/* */
/* OpenType & CFF data/program tables loader (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,6 +22,8 @@
#include <ft2build.h>
#include "cfftypes.h"
+#include "cffparse.h"
+#include "cffobjs.h" /* for CFF_Face */
FT_BEGIN_HEADER
@@ -59,21 +61,64 @@ FT_BEGIN_HEADER
FT_UInt cid );
+ FT_LOCAL( FT_UInt32 )
+ cff_random( FT_UInt32 r );
+
FT_LOCAL( FT_Error )
- cff_font_load( FT_Library library,
- FT_Stream stream,
- FT_Int face_index,
- CFF_Font font,
- FT_Bool pure_cff );
+ cff_font_load( FT_Library library,
+ FT_Stream stream,
+ FT_Int face_index,
+ CFF_Font font,
+ CFF_Face face,
+ FT_Bool pure_cff,
+ FT_Bool cff2 );
FT_LOCAL( void )
cff_font_done( CFF_Font font );
+ FT_LOCAL( FT_Error )
+ cff_load_private_dict( CFF_Font font,
+ CFF_SubFont subfont,
+ FT_UInt lenNDV,
+ FT_Fixed* NDV );
+
FT_LOCAL( FT_Byte )
cff_fd_select_get( CFF_FDSelect fdselect,
FT_UInt glyph_index );
+ FT_LOCAL( FT_Bool )
+ cff_blend_check_vector( CFF_Blend blend,
+ FT_UInt vsindex,
+ FT_UInt lenNDV,
+ FT_Fixed* NDV );
+
+ FT_LOCAL( FT_Error )
+ cff_blend_build_vector( CFF_Blend blend,
+ FT_UInt vsindex,
+ FT_UInt lenNDV,
+ FT_Fixed* NDV );
+
+ FT_LOCAL( void )
+ cff_blend_clear( CFF_SubFont subFont );
+
+ FT_LOCAL( FT_Error )
+ cff_blend_doBlend( CFF_SubFont subfont,
+ CFF_Parser parser,
+ FT_UInt numBlends );
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ FT_LOCAL( FT_Error )
+ cff_get_var_blend( CFF_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords,
+ FT_Fixed* *normalizedcoords,
+ FT_MM_Var* *mm_var );
+
+ FT_LOCAL( void )
+ cff_done_blend( CFF_Face face );
+#endif
+
FT_END_HEADER
diff --git a/thirdparty/freetype/src/cff/cffobjs.c b/thirdparty/freetype/src/cff/cffobjs.c
index 0f0769677f..61613933ff 100644
--- a/thirdparty/freetype/src/cff/cffobjs.c
+++ b/thirdparty/freetype/src/cff/cffobjs.c
@@ -4,7 +4,7 @@
/* */
/* OpenType objects manager (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -27,6 +27,11 @@
#include FT_INTERNAL_SFNT_H
#include FT_CFF_DRIVER_H
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include FT_MULTIPLE_MASTERS_H
+#include FT_SERVICE_MULTIPLE_MASTERS_H
+#endif
+
#include "cffobjs.h"
#include "cffload.h"
#include "cffcmap.h"
@@ -49,9 +54,6 @@
/* */
/* SIZE FUNCTIONS */
/* */
- /* Note that we store the global hints in the size's `internal' root */
- /* field. */
- /* */
/*************************************************************************/
@@ -75,10 +77,11 @@
FT_LOCAL_DEF( void )
cff_size_done( FT_Size cffsize ) /* CFF_Size */
{
+ FT_Memory memory = cffsize->face->memory;
CFF_Size size = (CFF_Size)cffsize;
CFF_Face face = (CFF_Face)size->root.face;
CFF_Font font = (CFF_Font)face->extra.data;
- CFF_Internal internal = (CFF_Internal)cffsize->internal;
+ CFF_Internal internal = (CFF_Internal)cffsize->internal->module_data;
if ( internal )
@@ -98,7 +101,7 @@
funcs->destroy( internal->subfonts[i - 1] );
}
- /* `internal' is freed by destroy_size (in ftobjs.c) */
+ FT_FREE( internal );
}
}
@@ -114,7 +117,7 @@
FT_UInt n, count;
- FT_MEM_ZERO( priv, sizeof ( *priv ) );
+ FT_ZERO( priv );
count = priv->num_blue_values = cpriv->num_blue_values;
for ( n = 0; n < count; n++ )
@@ -194,7 +197,7 @@
goto Exit;
}
- cffsize->internal = (FT_Size_Internal)(void*)internal;
+ cffsize->internal->module_data = internal;
}
size->strike_index = 0xFFFFFFFFUL;
@@ -224,7 +227,7 @@
{
CFF_Face face = (CFF_Face)size->face;
CFF_Font font = (CFF_Font)face->extra.data;
- CFF_Internal internal = (CFF_Internal)size->internal;
+ CFF_Internal internal = (CFF_Internal)size->internal->module_data;
FT_Long top_upm = (FT_Long)font->top_font.font_dict.units_per_em;
FT_UInt i;
@@ -296,7 +299,7 @@
{
CFF_Face cffface = (CFF_Face)size->face;
CFF_Font font = (CFF_Font)cffface->extra.data;
- CFF_Internal internal = (CFF_Internal)size->internal;
+ CFF_Internal internal = (CFF_Internal)size->internal->module_data;
FT_Long top_upm = (FT_Long)font->top_font.font_dict.units_per_em;
FT_UInt i;
@@ -450,7 +453,7 @@
FT_Int idx;
- for ( idx = 1; idx <= style_name_length; ++idx )
+ for ( idx = 1; idx <= style_name_length; idx++ )
{
if ( family_name[family_name_length - idx] !=
style_name[style_name_length - idx] )
@@ -469,7 +472,7 @@
family_name[idx] == ' ' ||
family_name[idx] == '_' ||
family_name[idx] == '+' ) )
- --idx;
+ idx--;
if ( idx > 0 )
family_name[idx + 1] = '\0';
@@ -491,6 +494,7 @@
FT_Service_PsCMaps psnames;
PSHinter_Service pshinter;
FT_Bool pure_cff = 1;
+ FT_Bool cff2 = 0;
FT_Bool sfnt_format = 0;
FT_Library library = cffface->driver->root.library;
@@ -516,6 +520,7 @@
goto Exit;
/* check whether we have a valid OpenType file */
+ FT_TRACE2(( " " ));
error = sfnt->init_face( stream, face, face_index, num_params, params );
if ( !error )
{
@@ -553,8 +558,18 @@
goto Exit;
}
- /* now load the CFF part of the file */
- error = face->goto_table( face, TTAG_CFF, stream, 0 );
+ /* now load the CFF part of the file; */
+ /* give priority to CFF2 */
+ error = face->goto_table( face, TTAG_CFF2, stream, 0 );
+ if ( !error )
+ {
+ cff2 = 1;
+ face->is_cff2 = cff2;
+ }
+
+ if ( FT_ERR_EQ( error, Table_Missing ) )
+ error = face->goto_table( face, TTAG_CFF, stream, 0 );
+
if ( error )
goto Exit;
}
@@ -579,7 +594,13 @@
goto Exit;
face->extra.data = cff;
- error = cff_font_load( library, stream, face_index, cff, pure_cff );
+ error = cff_font_load( library,
+ stream,
+ face_index,
+ cff,
+ face,
+ pure_cff,
+ cff2 );
if ( error )
goto Exit;
@@ -667,6 +688,56 @@
}
#endif /* FT_DEBUG_LEVEL_TRACE */
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ {
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+ FT_Int instance_index = face_index >> 16;
+
+
+ if ( FT_HAS_MULTIPLE_MASTERS( cffface ) &&
+ mm &&
+ instance_index > 0 )
+ {
+ FT_MM_Var* mm_var;
+
+
+ error = mm->get_mm_var( cffface, NULL );
+ if ( error )
+ goto Exit;
+
+ mm->get_var_blend( cffface, NULL, NULL, NULL, &mm_var );
+
+ if ( mm_var->namedstyle )
+ {
+ FT_Var_Named_Style* named_style;
+ FT_String* style_name;
+
+
+ /* in `face_index', the instance index starts with value 1 */
+ named_style = mm_var->namedstyle + instance_index - 1;
+ error = sfnt->get_name( face,
+ (FT_UShort)named_style->strid,
+ &style_name );
+ if ( error )
+ goto Exit;
+
+ /* set style name; if already set, replace it */
+ if ( face->root.style_name )
+ FT_FREE( face->root.style_name );
+ face->root.style_name = style_name;
+
+ /* finally, select the named instance */
+ error = mm->set_var_design( cffface,
+ mm_var->num_axis,
+ named_style->coords );
+ if ( error )
+ goto Exit;
+ }
+ }
+ }
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
if ( !dict->has_font_matrix )
dict->units_per_em = pure_cff ? 1000 : face->root.units_per_EM;
@@ -949,7 +1020,6 @@
cffface->style_flags = flags;
}
-
#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
/* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */
/* has unset this flag because of the 3.0 `post' table. */
@@ -960,7 +1030,6 @@
if ( dict->cid_registry != 0xFFFFU && pure_cff )
cffface->face_flags |= FT_FACE_FLAG_CID_KEYED;
-
/*******************************************************************/
/* */
/* Compute char maps. */
@@ -1011,7 +1080,7 @@
error = FT_Err_Ok;
/* if no Unicode charmap was previously selected, select this one */
- if ( cffface->charmap == NULL && nn != (FT_UInt)cffface->num_charmaps )
+ if ( !cffface->charmap && nn != (FT_UInt)cffface->num_charmaps )
cffface->charmap = cffface->charmaps[nn];
Skip_Unicode:
@@ -1079,6 +1148,11 @@
FT_FREE( face->extra.data );
}
}
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ cff_done_blend( face );
+ face->blend = NULL;
+#endif
}
@@ -1087,6 +1161,8 @@
{
CFF_Driver driver = (CFF_Driver)module;
+ FT_UInt32 seed;
+
/* set default property values, cf. `ftcffdrv.h' */
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
@@ -1106,6 +1182,18 @@
driver->darken_params[6] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4;
driver->darken_params[7] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4;
+ /* compute random seed from some memory addresses */
+ seed = (FT_UInt32)( (FT_Offset)(char*)&seed ^
+ (FT_Offset)(char*)&module ^
+ (FT_Offset)(char*)module->memory );
+ seed = seed ^ ( seed >> 10 ) ^ ( seed >> 20 );
+
+ driver->random_seed = (FT_Int32)seed;
+ if ( driver->random_seed < 0 )
+ driver->random_seed = -driver->random_seed;
+ else if ( driver->random_seed == 0 )
+ driver->random_seed = 123456789;
+
return FT_Err_Ok;
}
diff --git a/thirdparty/freetype/src/cff/cffobjs.h b/thirdparty/freetype/src/cff/cffobjs.h
index 9dc77536bd..1dba694c53 100644
--- a/thirdparty/freetype/src/cff/cffobjs.h
+++ b/thirdparty/freetype/src/cff/cffobjs.h
@@ -4,7 +4,7 @@
/* */
/* OpenType objects manager (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -118,10 +118,10 @@ FT_BEGIN_HEADER
{
FT_DriverRec root;
- FT_UInt hinting_engine;
- FT_Bool no_stem_darkening;
-
- FT_Int darken_params[8];
+ FT_UInt hinting_engine;
+ FT_Bool no_stem_darkening;
+ FT_Int darken_params[8];
+ FT_Int32 random_seed;
} CFF_DriverRec;
diff --git a/thirdparty/freetype/src/cff/cffparse.c b/thirdparty/freetype/src/cff/cffparse.c
index a4f986b67c..e1511bdbd1 100644
--- a/thirdparty/freetype/src/cff/cffparse.c
+++ b/thirdparty/freetype/src/cff/cffparse.c
@@ -4,7 +4,7 @@
/* */
/* CFF token stream parser (body) */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,6 +24,7 @@
#include "cfferrs.h"
#include "cffpic.h"
#include "cffgload.h"
+#include "cffload.h"
/*************************************************************************/
@@ -36,22 +37,52 @@
#define FT_COMPONENT trace_cffparse
- FT_LOCAL_DEF( void )
+ FT_LOCAL_DEF( FT_Error )
cff_parser_init( CFF_Parser parser,
FT_UInt code,
void* object,
FT_Library library,
+ FT_UInt stackSize,
FT_UShort num_designs,
FT_UShort num_axes )
{
- FT_MEM_ZERO( parser, sizeof ( *parser ) );
+ FT_Memory memory = library->memory; /* for FT_NEW_ARRAY */
+ FT_Error error; /* for FT_NEW_ARRAY */
+
+
+ FT_ZERO( parser );
+#if 0
parser->top = parser->stack;
+#endif
parser->object_code = code;
parser->object = object;
parser->library = library;
parser->num_designs = num_designs;
parser->num_axes = num_axes;
+
+ /* allocate the stack buffer */
+ if ( FT_NEW_ARRAY( parser->stack, stackSize ) )
+ {
+ FT_FREE( parser->stack );
+ goto Exit;
+ }
+
+ parser->stackSize = stackSize;
+ parser->top = parser->stack; /* empty stack */
+
+ Exit:
+ return error;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cff_parser_done( CFF_Parser parser )
+ {
+ FT_Memory memory = parser->library->memory; /* for FT_FREE */
+
+
+ FT_FREE( parser->stack );
}
@@ -402,24 +433,54 @@
/* read a number, either integer or real */
- static FT_Long
- cff_parse_num( FT_Byte** d )
+ FT_LOCAL_DEF( FT_Long )
+ cff_parse_num( CFF_Parser parser,
+ FT_Byte** d )
{
- return **d == 30 ? ( cff_parse_real( d[0], d[1], 0, NULL ) >> 16 )
- : cff_parse_integer( d[0], d[1] );
+ if ( **d == 30 )
+ {
+ /* binary-coded decimal is truncated to integer */
+ return cff_parse_real( *d, parser->limit, 0, NULL ) >> 16;
+ }
+
+ else if ( **d == 255 )
+ {
+ /* 16.16 fixed point is used internally for CFF2 blend results. */
+ /* Since these are trusted values, a limit check is not needed. */
+
+ /* After the 255, 4 bytes give the number. */
+ /* The blend value is converted to integer, with rounding; */
+ /* due to the right-shift we don't need the lowest byte. */
+#if 0
+ return (FT_Short)(
+ ( ( ( (FT_UInt32)*( d[0] + 1 ) << 24 ) |
+ ( (FT_UInt32)*( d[0] + 2 ) << 16 ) |
+ ( (FT_UInt32)*( d[0] + 3 ) << 8 ) |
+ (FT_UInt32)*( d[0] + 4 ) ) + 0x8000U ) >> 16 );
+#else
+ return (FT_Short)(
+ ( ( ( (FT_UInt32)*( d[0] + 1 ) << 16 ) |
+ ( (FT_UInt32)*( d[0] + 2 ) << 8 ) |
+ (FT_UInt32)*( d[0] + 3 ) ) + 0x80U ) >> 8 );
+#endif
+ }
+
+ else
+ return cff_parse_integer( *d, parser->limit );
}
/* read a floating point number, either integer or real */
static FT_Fixed
- do_fixed( FT_Byte** d,
- FT_Long scaling )
+ do_fixed( CFF_Parser parser,
+ FT_Byte** d,
+ FT_Long scaling )
{
if ( **d == 30 )
- return cff_parse_real( d[0], d[1], scaling, NULL );
+ return cff_parse_real( *d, parser->limit, scaling, NULL );
else
{
- FT_Long val = cff_parse_integer( d[0], d[1] );
+ FT_Long val = cff_parse_integer( *d, parser->limit );
if ( scaling )
@@ -447,19 +508,21 @@
/* read a floating point number, either integer or real */
static FT_Fixed
- cff_parse_fixed( FT_Byte** d )
+ cff_parse_fixed( CFF_Parser parser,
+ FT_Byte** d )
{
- return do_fixed( d, 0 );
+ return do_fixed( parser, d, 0 );
}
/* read a floating point number, either integer or real, */
/* but return `10^scaling' times the number read in */
static FT_Fixed
- cff_parse_fixed_scaled( FT_Byte** d,
- FT_Long scaling )
+ cff_parse_fixed_scaled( CFF_Parser parser,
+ FT_Byte** d,
+ FT_Long scaling )
{
- return do_fixed( d, scaling );
+ return do_fixed( parser, d, scaling );
}
@@ -467,13 +530,14 @@
/* and return it as precise as possible -- `scaling' returns */
/* the scaling factor (as a power of 10) */
static FT_Fixed
- cff_parse_fixed_dynamic( FT_Byte** d,
- FT_Long* scaling )
+ cff_parse_fixed_dynamic( CFF_Parser parser,
+ FT_Byte** d,
+ FT_Long* scaling )
{
FT_ASSERT( scaling );
if ( **d == 30 )
- return cff_parse_real( d[0], d[1], 0, scaling );
+ return cff_parse_real( *d, parser->limit, 0, scaling );
else
{
FT_Long number;
@@ -543,7 +607,7 @@
for ( i = 0; i < 6; i++ )
{
- values[i] = cff_parse_fixed_dynamic( data++, &scalings[i] );
+ values[i] = cff_parse_fixed_dynamic( parser, data++, &scalings[i] );
if ( values[i] )
{
if ( scalings[i] > max_scaling )
@@ -640,10 +704,10 @@
if ( parser->top >= parser->stack + 4 )
{
- bbox->xMin = FT_RoundFix( cff_parse_fixed( data++ ) );
- bbox->yMin = FT_RoundFix( cff_parse_fixed( data++ ) );
- bbox->xMax = FT_RoundFix( cff_parse_fixed( data++ ) );
- bbox->yMax = FT_RoundFix( cff_parse_fixed( data ) );
+ bbox->xMin = FT_RoundFix( cff_parse_fixed( parser, data++ ) );
+ bbox->yMin = FT_RoundFix( cff_parse_fixed( parser, data++ ) );
+ bbox->xMax = FT_RoundFix( cff_parse_fixed( parser, data++ ) );
+ bbox->yMax = FT_RoundFix( cff_parse_fixed( parser, data ) );
error = FT_Err_Ok;
FT_TRACE4(( " [%d %d %d %d]\n",
@@ -672,7 +736,7 @@
FT_Long tmp;
- tmp = cff_parse_num( data++ );
+ tmp = cff_parse_num( parser, data++ );
if ( tmp < 0 )
{
FT_ERROR(( "cff_parse_private_dict: Invalid dictionary size\n" ));
@@ -681,7 +745,7 @@
}
dict->private_size = (FT_ULong)tmp;
- tmp = cff_parse_num( data );
+ tmp = cff_parse_num( parser, data );
if ( tmp < 0 )
{
FT_ERROR(( "cff_parse_private_dict: Invalid dictionary offset\n" ));
@@ -726,7 +790,7 @@
/* currently, we handle only the first argument */
if ( parser->top >= parser->stack + 5 )
{
- FT_Long num_designs = cff_parse_num( parser->stack );
+ FT_Long num_designs = cff_parse_num( parser, parser->stack );
if ( num_designs > 16 || num_designs < 2 )
@@ -763,11 +827,11 @@
if ( parser->top >= parser->stack + 3 )
{
- dict->cid_registry = (FT_UInt)cff_parse_num( data++ );
- dict->cid_ordering = (FT_UInt)cff_parse_num( data++ );
+ dict->cid_registry = (FT_UInt)cff_parse_num( parser, data++ );
+ dict->cid_ordering = (FT_UInt)cff_parse_num( parser, data++ );
if ( **data == 30 )
FT_TRACE1(( "cff_parse_cid_ros: real supplement is rounded\n" ));
- dict->cid_supplement = cff_parse_num( data );
+ dict->cid_supplement = cff_parse_num( parser, data );
if ( dict->cid_supplement < 0 )
FT_TRACE1(( "cff_parse_cid_ros: negative supplement %d is found\n",
dict->cid_supplement ));
@@ -783,6 +847,123 @@
}
+ static FT_Error
+ cff_parse_vsindex( CFF_Parser parser )
+ {
+ /* vsindex operator can only be used in a Private DICT */
+ CFF_Private priv = (CFF_Private)parser->object;
+ FT_Byte** data = parser->stack;
+ CFF_Blend blend;
+ FT_Error error;
+
+
+ if ( !priv || !priv->subfont )
+ {
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ blend = &priv->subfont->blend;
+
+ if ( blend->usedBV )
+ {
+ FT_ERROR(( " cff_parse_vsindex: vsindex not allowed after blend\n" ));
+ error = FT_THROW( Syntax_Error );
+ goto Exit;
+ }
+
+ priv->vsindex = (FT_UInt)cff_parse_num( parser, data++ );
+
+ FT_TRACE4(( " %d\n", priv->vsindex ));
+
+ error = FT_Err_Ok;
+
+ Exit:
+ return error;
+ }
+
+
+ static FT_Error
+ cff_parse_blend( CFF_Parser parser )
+ {
+ /* blend operator can only be used in a Private DICT */
+ CFF_Private priv = (CFF_Private)parser->object;
+ CFF_SubFont subFont;
+ CFF_Blend blend;
+ FT_UInt numBlends;
+ FT_Error error;
+
+
+ if ( !priv || !priv->subfont )
+ {
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ subFont = priv->subfont;
+ blend = &subFont->blend;
+
+ if ( cff_blend_check_vector( blend,
+ priv->vsindex,
+ subFont->lenNDV,
+ subFont->NDV ) )
+ {
+ error = cff_blend_build_vector( blend,
+ priv->vsindex,
+ subFont->lenNDV,
+ subFont->NDV );
+ if ( error )
+ goto Exit;
+ }
+
+ numBlends = (FT_UInt)cff_parse_num( parser, parser->top - 1 );
+ if ( numBlends > parser->stackSize )
+ {
+ FT_ERROR(( "cff_parse_blend: Invalid number of blends\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ FT_TRACE4(( " %d values blended\n", numBlends ));
+
+ error = cff_blend_doBlend( subFont, parser, numBlends );
+
+ blend->usedBV = TRUE;
+
+ Exit:
+ return error;
+ }
+
+
+ /* maxstack operator increases parser and operand stacks for CFF2 */
+ static FT_Error
+ cff_parse_maxstack( CFF_Parser parser )
+ {
+ /* maxstack operator can only be used in a Top DICT */
+ CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;
+ FT_Byte** data = parser->stack;
+ FT_Error error = FT_Err_Ok;
+
+
+ if ( !dict )
+ {
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ dict->maxstack = (FT_UInt)cff_parse_num( parser, data++ );
+ if ( dict->maxstack > CFF2_MAX_STACK )
+ dict->maxstack = CFF2_MAX_STACK;
+ if ( dict->maxstack < CFF2_DEFAULT_STACK )
+ dict->maxstack = CFF2_DEFAULT_STACK;
+
+ FT_TRACE4(( " %d\n", dict->maxstack ));
+
+ Exit:
+ return error;
+ }
+
+
#define CFF_FIELD_NUM( code, name, id ) \
CFF_FIELD( code, name, id, cff_kind_num )
#define CFF_FIELD_FIXED( code, name, id ) \
@@ -794,9 +975,6 @@
#define CFF_FIELD_BOOL( code, name, id ) \
CFF_FIELD( code, name, id, cff_kind_bool )
-#define CFFCODE_TOPDICT 0x1000
-#define CFFCODE_PRIVATE 0x2000
-
#ifndef FT_CONFIG_OPTION_PIC
@@ -817,6 +995,15 @@
0, 0 \
},
+#define CFF_FIELD_BLEND( code, id ) \
+ { \
+ cff_kind_blend, \
+ code | CFFCODE, \
+ 0, 0, \
+ cff_parse_blend, \
+ 0, 0 \
+ },
+
#define CFF_FIELD( code, name, id, kind ) \
{ \
kind, \
@@ -860,6 +1047,16 @@
id \
},
+#define CFF_FIELD_BLEND( code, id ) \
+ { \
+ cff_kind_blend, \
+ code | CFFCODE, \
+ 0, 0, \
+ cff_parse_blend, \
+ 0, 0, \
+ id \
+ },
+
#define CFF_FIELD( code, name, id, kind ) \
{ \
kind, \
@@ -926,6 +1123,8 @@
#define CFF_FIELD_DELTA( code, name, max, id ) i++;
#undef CFF_FIELD_CALLBACK
#define CFF_FIELD_CALLBACK( code, name, id ) i++;
+#undef CFF_FIELD_BLEND
+#define CFF_FIELD_BLEND( code, id ) i++;
#include "cfftoken.h"
@@ -973,6 +1172,17 @@
clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ ); \
i++;
+#undef CFF_FIELD_BLEND
+#define CFF_FIELD_BLEND( code_, id_ ) \
+ clazz[i].kind = cff_kind_blend; \
+ clazz[i].code = code_ | CFFCODE; \
+ clazz[i].offset = 0; \
+ clazz[i].size = 0; \
+ clazz[i].reader = cff_parse_blend; \
+ clazz[i].array_max = 0; \
+ clazz[i].count_offset = 0; \
+ i++;
+
#include "cfftoken.h"
clazz[i].kind = 0;
@@ -1023,6 +1233,18 @@
clazz[i].id = id_; \
i++;
+#undef CFF_FIELD_BLEND
+#define CFF_FIELD_BLEND( code_, id_ ) \
+ clazz[i].kind = cff_kind_blend; \
+ clazz[i].code = code_ | CFFCODE; \
+ clazz[i].offset = 0; \
+ clazz[i].size = 0; \
+ clazz[i].reader = cff_parse_blend; \
+ clazz[i].array_max = 0; \
+ clazz[i].count_offset = 0; \
+ clazz[i].id = id_; \
+ i++;
+
#include "cfftoken.h"
clazz[i].kind = 0;
@@ -1067,11 +1289,13 @@
{
FT_UInt v = *p;
-
- if ( v >= 27 && v != 31 )
+ /* Opcode 31 is legacy MM T2 operator, not a number. */
+ /* Opcode 255 is reserved and should not appear in fonts; */
+ /* it is used internally for CFF2 blends. */
+ if ( v >= 27 && v != 31 && v != 255 )
{
/* it's a number; we will push its position on the stack */
- if ( parser->top - parser->stack >= CFF_MAX_STACK_DEPTH )
+ if ( (FT_UInt)( parser->top - parser->stack ) >= parser->stackSize )
goto Stack_Overflow;
*parser->top++ = p;
@@ -1132,8 +1356,8 @@
charstring_len = (FT_ULong)( p - charstring_base ) + 1;
/* construct CFF_Decoder object */
- FT_MEM_ZERO( &decoder, sizeof ( decoder ) );
- FT_MEM_ZERO( &cff_rec, sizeof ( cff_rec ) );
+ FT_ZERO( &decoder );
+ FT_ZERO( &cff_rec );
cff_rec.top_font.font_dict.num_designs = parser->num_designs;
cff_rec.top_font.font_dict.num_axes = parser->num_axes;
@@ -1162,7 +1386,7 @@
FT_Bool neg;
- if ( parser->top - parser->stack >= CFF_MAX_STACK_DEPTH )
+ if ( (FT_UInt)( parser->top - parser->stack ) >= parser->stackSize )
goto Stack_Overflow;
*parser->top++ = q;
@@ -1239,13 +1463,17 @@
/* and look for it in our current list. */
FT_UInt code;
- FT_UInt num_args = (FT_UInt)
- ( parser->top - parser->stack );
+ FT_UInt num_args;
const CFF_Field_Handler* field;
+ if ( (FT_UInt)( parser->top - parser->stack ) >= parser->stackSize )
+ goto Stack_Overflow;
+
+ num_args = (FT_UInt)( parser->top - parser->stack );
*parser->top = p;
- code = v;
+ code = v;
+
if ( v == 12 )
{
/* two byte operator */
@@ -1280,15 +1508,15 @@
case cff_kind_bool:
case cff_kind_string:
case cff_kind_num:
- val = cff_parse_num( parser->stack );
+ val = cff_parse_num( parser, parser->stack );
goto Store_Number;
case cff_kind_fixed:
- val = cff_parse_fixed( parser->stack );
+ val = cff_parse_fixed( parser, parser->stack );
goto Store_Number;
case cff_kind_fixed_thousand:
- val = cff_parse_fixed_scaled( parser->stack, 3 );
+ val = cff_parse_fixed_scaled( parser, parser->stack, 3 );
Store_Number:
switch ( field->size )
@@ -1357,7 +1585,7 @@
val = 0;
while ( num_args > 0 )
{
- val += cff_parse_num( data++ );
+ val += cff_parse_num( parser, data++ );
switch ( field->size )
{
case (8 / FT_CHAR_BIT):
@@ -1386,7 +1614,7 @@
}
break;
- default: /* callback */
+ default: /* callback or blend */
error = field->reader( parser );
if ( error )
goto Exit;
@@ -1400,7 +1628,10 @@
Found:
/* clear stack */
- parser->top = parser->stack;
+ /* TODO: could clear blend stack here, */
+ /* but we don't have access to subFont */
+ if ( field->kind != cff_kind_blend )
+ parser->top = parser->stack;
}
p++;
}
diff --git a/thirdparty/freetype/src/cff/cffparse.h b/thirdparty/freetype/src/cff/cffparse.h
index a95970edcb..83d1bba45f 100644
--- a/thirdparty/freetype/src/cff/cffparse.h
+++ b/thirdparty/freetype/src/cff/cffparse.h
@@ -4,7 +4,7 @@
/* */
/* CFF token stream parser (specification) */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -28,10 +28,25 @@
FT_BEGIN_HEADER
+ /* CFF uses constant parser stack size; */
+ /* CFF2 can increase from default 193 */
#define CFF_MAX_STACK_DEPTH 96
-#define CFF_CODE_TOPDICT 0x1000
-#define CFF_CODE_PRIVATE 0x2000
+ /*
+ * There are plans to remove the `maxstack' operator in a forthcoming
+ * revision of the CFF2 specification, increasing the (then static) stack
+ * size to 513. By making the default stack size equal to the maximum
+ * stack size, the operator is essentially disabled, which has the
+ * desired effect in FreeType.
+ */
+#define CFF2_MAX_STACK 513
+#define CFF2_DEFAULT_STACK 513
+
+#define CFF_CODE_TOPDICT 0x1000
+#define CFF_CODE_PRIVATE 0x2000
+#define CFF2_CODE_TOPDICT 0x3000
+#define CFF2_CODE_FONTDICT 0x4000
+#define CFF2_CODE_PRIVATE 0x5000
typedef struct CFF_ParserRec_
@@ -41,8 +56,9 @@ FT_BEGIN_HEADER
FT_Byte* limit;
FT_Byte* cursor;
- FT_Byte* stack[CFF_MAX_STACK_DEPTH + 1];
+ FT_Byte** stack;
FT_Byte** top;
+ FT_UInt stackSize; /* allocated size */
FT_UInt object_code;
void* object;
@@ -53,14 +69,22 @@ FT_BEGIN_HEADER
} CFF_ParserRec, *CFF_Parser;
- FT_LOCAL( void )
+ FT_LOCAL( FT_Long )
+ cff_parse_num( CFF_Parser parser,
+ FT_Byte** d );
+
+ FT_LOCAL( FT_Error )
cff_parser_init( CFF_Parser parser,
FT_UInt code,
void* object,
FT_Library library,
+ FT_UInt stackSize,
FT_UShort num_designs,
FT_UShort num_axes );
+ FT_LOCAL( void )
+ cff_parser_done( CFF_Parser parser );
+
FT_LOCAL( FT_Error )
cff_parser_run( CFF_Parser parser,
FT_Byte* start,
@@ -77,6 +101,7 @@ FT_BEGIN_HEADER
cff_kind_bool,
cff_kind_delta,
cff_kind_callback,
+ cff_kind_blend,
cff_kind_max /* do not remove */
};
diff --git a/thirdparty/freetype/src/cff/cffpic.c b/thirdparty/freetype/src/cff/cffpic.c
index a0bc34fd5f..4e9ba12b3f 100644
--- a/thirdparty/freetype/src/cff/cffpic.c
+++ b/thirdparty/freetype/src/cff/cffpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for cff module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cff/cffpic.h b/thirdparty/freetype/src/cff/cffpic.h
index bed6b35a86..5db39cd627 100644
--- a/thirdparty/freetype/src/cff/cffpic.h
+++ b/thirdparty/freetype/src/cff/cffpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for cff module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -32,6 +32,8 @@
#define CFF_SERVICE_CID_INFO_GET cff_service_cid_info
#define CFF_SERVICE_PROPERTIES_GET cff_service_properties
#define CFF_SERVICES_GET cff_services
+#define CFF_SERVICE_MULTI_MASTERS_GET cff_service_multi_masters
+#define CFF_SERVICE_METRICS_VAR_GET cff_service_metrics_variations
#define CFF_CMAP_ENCODING_CLASS_REC_GET cff_cmap_encoding_class_rec
#define CFF_CMAP_UNICODE_CLASS_REC_GET cff_cmap_unicode_class_rec
#define CFF_FIELD_HANDLERS_GET cff_field_handlers
@@ -45,22 +47,26 @@
#include FT_SERVICE_TT_CMAP_H
#include FT_SERVICE_CID_H
#include FT_SERVICE_PROPERTIES_H
+#include FT_SERVICE_MULTIPLE_MASTERS_H
+#include FT_SERVICE_METRICS_VARIATIONS_H
FT_BEGIN_HEADER
typedef struct CffModulePIC_
{
- FT_ServiceDescRec* cff_services;
- CFF_Field_Handler* cff_field_handlers;
- FT_Service_PsInfoRec cff_service_ps_info;
- FT_Service_GlyphDictRec cff_service_glyph_dict;
- FT_Service_PsFontNameRec cff_service_ps_name;
- FT_Service_TTCMapsRec cff_service_get_cmap_info;
- FT_Service_CIDRec cff_service_cid_info;
- FT_Service_PropertiesRec cff_service_properties;
- FT_CMap_ClassRec cff_cmap_encoding_class_rec;
- FT_CMap_ClassRec cff_cmap_unicode_class_rec;
+ FT_ServiceDescRec* cff_services;
+ CFF_Field_Handler* cff_field_handlers;
+ FT_Service_PsInfoRec cff_service_ps_info;
+ FT_Service_GlyphDictRec cff_service_glyph_dict;
+ FT_Service_PsFontNameRec cff_service_ps_name;
+ FT_Service_TTCMapsRec cff_service_get_cmap_info;
+ FT_Service_CIDRec cff_service_cid_info;
+ FT_Service_PropertiesRec cff_service_properties;
+ FT_Service_MultiMastersRec cff_service_multi_masters;
+ FT_Service_MetricsVariationsRec cff_service_metrics_variations;
+ FT_CMap_ClassRec cff_cmap_encoding_class_rec;
+ FT_CMap_ClassRec cff_cmap_unicode_class_rec;
} CffModulePIC;
@@ -82,6 +88,10 @@ FT_BEGIN_HEADER
( GET_PIC( library )->cff_service_properties )
#define CFF_SERVICES_GET \
( GET_PIC( library )->cff_services )
+#define CFF_SERVICE_MULTI_MASTERS_GET \
+ ( GET_PIC( library )->cff_service_multi_masters )
+#define CFF_SERVICE_METRICS_VAR_GET \
+ ( GET_PIC( library )->cff_service_metrics_variations )
#define CFF_CMAP_ENCODING_CLASS_REC_GET \
( GET_PIC( library )->cff_cmap_encoding_class_rec )
#define CFF_CMAP_UNICODE_CLASS_REC_GET \
diff --git a/thirdparty/freetype/src/cff/cfftoken.h b/thirdparty/freetype/src/cff/cfftoken.h
index 22637c780b..3222e933f1 100644
--- a/thirdparty/freetype/src/cff/cfftoken.h
+++ b/thirdparty/freetype/src/cff/cfftoken.h
@@ -4,7 +4,7 @@
/* */
/* CFF token definitions (specification only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,7 +20,7 @@
#define FT_STRUCTURE CFF_FontRecDictRec
#undef CFFCODE
-#define CFFCODE CFFCODE_TOPDICT
+#define CFFCODE CFF_CODE_TOPDICT
CFF_FIELD_STRING ( 0, version, "Version" )
CFF_FIELD_STRING ( 1, notice, "Notice" )
@@ -78,7 +78,7 @@
#undef FT_STRUCTURE
#define FT_STRUCTURE CFF_PrivateRec
#undef CFFCODE
-#define CFFCODE CFFCODE_PRIVATE
+#define CFFCODE CFF_CODE_PRIVATE
CFF_FIELD_DELTA ( 6, blue_values, 14, "BlueValues" )
CFF_FIELD_DELTA ( 7, other_blues, 10, "OtherBlues" )
@@ -102,4 +102,49 @@
CFF_FIELD_NUM ( 21, nominal_width, "nominalWidthX" )
+#undef FT_STRUCTURE
+#define FT_STRUCTURE CFF_FontRecDictRec
+#undef CFFCODE
+#define CFFCODE CFF2_CODE_TOPDICT
+
+ CFF_FIELD_CALLBACK( 0x107, font_matrix, "FontMatrix" )
+ CFF_FIELD_NUM ( 17, charstrings_offset, "CharStrings" )
+ CFF_FIELD_NUM ( 0x124, cid_fd_array_offset, "FDArray" )
+ CFF_FIELD_NUM ( 0x125, cid_fd_select_offset, "FDSelect" )
+ CFF_FIELD_NUM ( 24, vstore_offset, "vstore" )
+ CFF_FIELD_CALLBACK( 25, maxstack, "maxstack" )
+
+
+#undef FT_STRUCTURE
+#define FT_STRUCTURE CFF_FontRecDictRec
+#undef CFFCODE
+#define CFFCODE CFF2_CODE_FONTDICT
+
+ CFF_FIELD_CALLBACK( 18, private_dict, "Private" )
+ CFF_FIELD_CALLBACK( 0x107, font_matrix, "FontMatrix" )
+
+
+#undef FT_STRUCTURE
+#define FT_STRUCTURE CFF_PrivateRec
+#undef CFFCODE
+#define CFFCODE CFF2_CODE_PRIVATE
+
+ CFF_FIELD_DELTA ( 6, blue_values, 14, "BlueValues" )
+ CFF_FIELD_DELTA ( 7, other_blues, 10, "OtherBlues" )
+ CFF_FIELD_DELTA ( 8, family_blues, 14, "FamilyBlues" )
+ CFF_FIELD_DELTA ( 9, family_other_blues, 10, "FamilyOtherBlues" )
+ CFF_FIELD_FIXED_1000( 0x109, blue_scale, "BlueScale" )
+ CFF_FIELD_NUM ( 0x10A, blue_shift, "BlueShift" )
+ CFF_FIELD_NUM ( 0x10B, blue_fuzz, "BlueFuzz" )
+ CFF_FIELD_NUM ( 10, standard_width, "StdHW" )
+ CFF_FIELD_NUM ( 11, standard_height, "StdVW" )
+ CFF_FIELD_DELTA ( 0x10C, snap_widths, 13, "StemSnapH" )
+ CFF_FIELD_DELTA ( 0x10D, snap_heights, 13, "StemSnapV" )
+ CFF_FIELD_NUM ( 0x111, language_group, "LanguageGroup" )
+ CFF_FIELD_FIXED ( 0x112, expansion_factor, "ExpansionFactor" )
+ CFF_FIELD_CALLBACK ( 22, vsindex, "vsindex" )
+ CFF_FIELD_BLEND ( 23, "blend" )
+ CFF_FIELD_NUM ( 19, local_subrs_offset, "Subrs" )
+
+
/* END */
diff --git a/thirdparty/freetype/src/cff/cfftypes.h b/thirdparty/freetype/src/cff/cfftypes.h
index 4426c7e4f1..74f569f08b 100644
--- a/thirdparty/freetype/src/cff/cfftypes.h
+++ b/thirdparty/freetype/src/cff/cfftypes.h
@@ -5,7 +5,7 @@
/* Basic OpenType/CFF type definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -64,6 +64,7 @@ FT_BEGIN_HEADER
{
FT_Stream stream;
FT_ULong start;
+ FT_UInt hdr_size;
FT_UInt count;
FT_Byte off_size;
FT_ULong data_offset;
@@ -102,6 +103,79 @@ FT_BEGIN_HEADER
} CFF_CharsetRec, *CFF_Charset;
+ /* cf. similar fields in file `ttgxvar.h' from the `truetype' module */
+
+ typedef struct CFF_VarData_
+ {
+#if 0
+ FT_UInt itemCount; /* not used; always zero */
+ FT_UInt shortDeltaCount; /* not used; always zero */
+#endif
+
+ FT_UInt regionIdxCount; /* number of region indexes */
+ FT_UInt* regionIndices; /* array of `regionIdxCount' indices; */
+ /* these index `varRegionList' */
+ } CFF_VarData;
+
+
+ /* contribution of one axis to a region */
+ typedef struct CFF_AxisCoords_
+ {
+ FT_Fixed startCoord;
+ FT_Fixed peakCoord; /* zero peak means no effect (factor = 1) */
+ FT_Fixed endCoord;
+
+ } CFF_AxisCoords;
+
+
+ typedef struct CFF_VarRegion_
+ {
+ CFF_AxisCoords* axisList; /* array of axisCount records */
+
+ } CFF_VarRegion;
+
+
+ typedef struct CFF_VStoreRec_
+ {
+ FT_UInt dataCount;
+ CFF_VarData* varData; /* array of dataCount records */
+ /* vsindex indexes this array */
+ FT_UShort axisCount;
+ FT_UInt regionCount; /* total number of regions defined */
+ CFF_VarRegion* varRegionList;
+
+ } CFF_VStoreRec, *CFF_VStore;
+
+
+ /* forward reference */
+ typedef struct CFF_FontRec_* CFF_Font;
+
+
+ /* This object manages one cached blend vector. */
+ /* */
+ /* There is a BlendRec for Private DICT parsing in each subfont */
+ /* and a BlendRec for charstrings in CF2_Font instance data. */
+ /* A cached BV may be used across DICTs or Charstrings if inputs */
+ /* have not changed. */
+ /* */
+ /* `usedBV' is reset at the start of each parse or charstring. */
+ /* vsindex cannot be changed after a BV is used. */
+ /* */
+ /* Note: NDV is long (32/64 bit), while BV is 16.16 (FT_Int32). */
+ typedef struct CFF_BlendRec_
+ {
+ FT_Bool builtBV; /* blendV has been built */
+ FT_Bool usedBV; /* blendV has been used */
+ CFF_Font font; /* top level font struct */
+ FT_UInt lastVsindex; /* last vsindex used */
+ FT_UInt lenNDV; /* normDV length (aka numAxes) */
+ FT_Fixed* lastNDV; /* last NDV used */
+ FT_UInt lenBV; /* BlendV length (aka numMasters) */
+ FT_Int32* BV; /* current blendV (per DICT/glyph) */
+
+ } CFF_BlendRec, *CFF_Blend;
+
+
typedef struct CFF_FontRecDictRec_
{
FT_UInt version;
@@ -151,9 +225,17 @@ FT_BEGIN_HEADER
FT_UShort num_designs;
FT_UShort num_axes;
+ /* fields for CFF2 */
+ FT_ULong vstore_offset;
+ FT_UInt maxstack;
+
} CFF_FontRecDictRec, *CFF_FontRecDict;
+ /* forward reference */
+ typedef struct CFF_SubFontRec_* CFF_SubFont;
+
+
typedef struct CFF_PrivateRec_
{
FT_Byte num_blue_values;
@@ -186,6 +268,10 @@ FT_BEGIN_HEADER
FT_Pos default_width;
FT_Pos nominal_width;
+ /* fields for CFF2 */
+ FT_UInt vsindex;
+ CFF_SubFont subfont;
+
} CFF_PrivateRec, *CFF_Private;
@@ -213,10 +299,31 @@ FT_BEGIN_HEADER
CFF_FontRecDictRec font_dict;
CFF_PrivateRec private_dict;
- CFF_IndexRec local_subrs_index;
- FT_Byte** local_subrs; /* array of pointers into Local Subrs INDEX data */
+ /* fields for CFF2 */
+ CFF_BlendRec blend; /* current blend vector */
+ FT_UInt lenNDV; /* current length NDV or zero */
+ FT_Fixed* NDV; /* ptr to current NDV or NULL */
+
+ /* `blend_stack' is a writable buffer to hold blend results. */
+ /* This buffer is to the side of the normal cff parser stack; */
+ /* `cff_parse_blend' and `cff_blend_doBlend' push blend results here. */
+ /* The normal stack then points to these values instead of the DICT */
+ /* because all other operators in Private DICT clear the stack. */
+ /* `blend_stack' could be cleared at each operator other than blend. */
+ /* Blended values are stored as 5-byte fixed point values. */
+
+ FT_Byte* blend_stack; /* base of stack allocation */
+ FT_Byte* blend_top; /* first empty slot */
+ FT_UInt blend_used; /* number of bytes in use */
+ FT_UInt blend_alloc; /* number of bytes allocated */
+
+ CFF_IndexRec local_subrs_index;
+ FT_Byte** local_subrs; /* array of pointers */
+ /* into Local Subrs INDEX data */
- } CFF_SubFontRec, *CFF_SubFont;
+ FT_UInt32 random;
+
+ } CFF_SubFontRec;
#define CFF_MAX_CID_FONTS 256
@@ -224,16 +331,20 @@ FT_BEGIN_HEADER
typedef struct CFF_FontRec_
{
+ FT_Library library;
FT_Stream stream;
- FT_Memory memory;
+ FT_Memory memory; /* TODO: take this from stream->memory? */
+ FT_ULong base_offset; /* offset to start of CFF */
FT_UInt num_faces;
FT_UInt num_glyphs;
FT_Byte version_major;
FT_Byte version_minor;
FT_Byte header_size;
- FT_Byte absolute_offsize;
+ FT_UInt top_dict_length; /* cff2 only */
+
+ FT_Bool cff2;
CFF_IndexRec name_index;
CFF_IndexRec top_dict_index;
@@ -280,7 +391,10 @@ FT_BEGIN_HEADER
/* since version 2.4.12 */
FT_Generic cf2_instance;
- } CFF_FontRec, *CFF_Font;
+ /* since version 2.7.1 */
+ CFF_VStoreRec vstore; /* parsed vstore structure */
+
+ } CFF_FontRec;
FT_END_HEADER
diff --git a/thirdparty/freetype/src/cff/module.mk b/thirdparty/freetype/src/cff/module.mk
index 1b4781afed..2975aeed8c 100644
--- a/thirdparty/freetype/src/cff/module.mk
+++ b/thirdparty/freetype/src/cff/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/cff/rules.mk b/thirdparty/freetype/src/cff/rules.mk
index 92f68b1ede..86840bfe3c 100644
--- a/thirdparty/freetype/src/cff/rules.mk
+++ b/thirdparty/freetype/src/cff/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/cid/ciderrs.h b/thirdparty/freetype/src/cid/ciderrs.h
index 1dc98c7cdd..709dc8cd1e 100644
--- a/thirdparty/freetype/src/cid/ciderrs.h
+++ b/thirdparty/freetype/src/cid/ciderrs.h
@@ -4,7 +4,7 @@
/* */
/* CID error codes (specification only). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidgload.c b/thirdparty/freetype/src/cid/cidgload.c
index c7b95593ee..b96c33334d 100644
--- a/thirdparty/freetype/src/cid/cidgload.c
+++ b/thirdparty/freetype/src/cid/cidgload.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 Glyph Loader (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidgload.h b/thirdparty/freetype/src/cid/cidgload.h
index 62d664b3af..7f816b5bc7 100644
--- a/thirdparty/freetype/src/cid/cidgload.h
+++ b/thirdparty/freetype/src/cid/cidgload.h
@@ -4,7 +4,7 @@
/* */
/* OpenType Glyph Loader (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidload.c b/thirdparty/freetype/src/cid/cidload.c
index d4f1ad1a7f..ff0722110d 100644
--- a/thirdparty/freetype/src/cid/cidload.c
+++ b/thirdparty/freetype/src/cid/cidload.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 font loader (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -461,6 +461,9 @@
FT_Byte* p;
+ if ( !num_subrs )
+ continue;
+
/* reallocate offsets array if needed */
if ( num_subrs + 1 > max_offsets )
{
@@ -570,7 +573,7 @@
{
FT_UNUSED( face );
- FT_MEM_ZERO( loader, sizeof ( *loader ) );
+ FT_ZERO( loader );
}
@@ -733,9 +736,11 @@
}
/* we must convert the data section from hexadecimal to binary */
- if ( FT_ALLOC( face->binary_data, parser->binary_length ) ||
- cid_hex_to_binary( face->binary_data, parser->binary_length,
- parser->data_offset, face ) )
+ if ( FT_ALLOC( face->binary_data, parser->binary_length ) ||
+ FT_SET_ERROR( cid_hex_to_binary( face->binary_data,
+ parser->binary_length,
+ parser->data_offset,
+ face ) ) )
goto Exit;
FT_Stream_OpenMemory( face->cid_stream,
@@ -777,7 +782,8 @@
CID_FaceDict dict = cid->font_dicts + n;
- if ( dict->sd_bytes < 0 )
+ if ( dict->sd_bytes < 0 ||
+ ( dict->num_subrs && dict->sd_bytes < 1 ) )
{
FT_ERROR(( "cid_parse_dict: Invalid `SDBytes' value\n" ));
error = FT_THROW( Invalid_File_Format );
diff --git a/thirdparty/freetype/src/cid/cidload.h b/thirdparty/freetype/src/cid/cidload.h
index 680f0d8fc5..45a0e6df25 100644
--- a/thirdparty/freetype/src/cid/cidload.h
+++ b/thirdparty/freetype/src/cid/cidload.h
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 font loader (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidobjs.c b/thirdparty/freetype/src/cid/cidobjs.c
index 2d2600fd4c..ceda8ff97f 100644
--- a/thirdparty/freetype/src/cid/cidobjs.c
+++ b/thirdparty/freetype/src/cid/cidobjs.c
@@ -4,7 +4,7 @@
/* */
/* CID objects manager (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -113,16 +113,16 @@
CID_Size size = (CID_Size)cidsize;
- if ( cidsize->internal )
+ if ( cidsize->internal->module_data )
{
PSH_Globals_Funcs funcs;
funcs = cid_size_get_globals_funcs( size );
if ( funcs )
- funcs->destroy( (PSH_Globals)cidsize->internal );
+ funcs->destroy( (PSH_Globals)cidsize->internal->module_data );
- cidsize->internal = NULL;
+ cidsize->internal->module_data = NULL;
}
}
@@ -145,7 +145,7 @@
error = funcs->create( cidsize->face->memory, priv, &globals );
if ( !error )
- cidsize->internal = (FT_Size_Internal)(void*)globals;
+ cidsize->internal->module_data = globals;
}
return error;
@@ -164,7 +164,7 @@
funcs = cid_size_get_globals_funcs( (CID_Size)size );
if ( funcs )
- funcs->set_scale( (PSH_Globals)size->internal,
+ funcs->set_scale( (PSH_Globals)size->internal->module_data,
size->metrics.x_scale,
size->metrics.y_scale,
0, 0 );
diff --git a/thirdparty/freetype/src/cid/cidobjs.h b/thirdparty/freetype/src/cid/cidobjs.h
index 5dd377a9f8..8bcf886e10 100644
--- a/thirdparty/freetype/src/cid/cidobjs.h
+++ b/thirdparty/freetype/src/cid/cidobjs.h
@@ -4,7 +4,7 @@
/* */
/* CID objects manager (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidparse.c b/thirdparty/freetype/src/cid/cidparse.c
index 73aca2ac6a..007609bbdf 100644
--- a/thirdparty/freetype/src/cid/cidparse.c
+++ b/thirdparty/freetype/src/cid/cidparse.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 parser (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -65,7 +65,7 @@
FT_Byte *arg1, *arg2;
- FT_MEM_ZERO( parser, sizeof ( *parser ) );
+ FT_ZERO( parser );
psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );
parser->stream = stream;
@@ -138,13 +138,13 @@
ft_strncmp( (char*)p, STARTDATA, STARTDATA_LEN ) == 0 )
{
/* save offset of binary data after `StartData' */
- offset += (FT_ULong)( p - buffer ) + STARTDATA_LEN;
+ offset += (FT_ULong)( p - buffer ) + STARTDATA_LEN + 1;
goto Found;
}
else if ( p[1] == 's' &&
ft_strncmp( (char*)p, SFNTS, SFNTS_LEN ) == 0 )
{
- offset += (FT_ULong)( p - buffer ) + SFNTS_LEN;
+ offset += (FT_ULong)( p - buffer ) + SFNTS_LEN + 1;
goto Found;
}
}
@@ -199,7 +199,7 @@
limit = parser->root.limit;
cur = parser->root.cursor;
- while ( cur < limit - SFNTS_LEN )
+ while ( cur <= limit - SFNTS_LEN )
{
if ( parser->root.error )
{
@@ -208,12 +208,12 @@
}
if ( cur[0] == 'S' &&
- cur < limit - STARTDATA_LEN &&
+ cur <= limit - STARTDATA_LEN &&
ft_strncmp( (char*)cur, STARTDATA, STARTDATA_LEN ) == 0 )
{
if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 )
{
- FT_Long tmp = ft_atol( (const char *)arg2 );
+ FT_Long tmp = ft_strtol( (const char *)arg2, NULL, 10 );
if ( tmp < 0 )
diff --git a/thirdparty/freetype/src/cid/cidparse.h b/thirdparty/freetype/src/cid/cidparse.h
index 7268dc6ae8..20bebb942b 100644
--- a/thirdparty/freetype/src/cid/cidparse.h
+++ b/thirdparty/freetype/src/cid/cidparse.h
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 parser (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidriver.c b/thirdparty/freetype/src/cid/cidriver.c
index 64141ab6b1..bb611a961e 100644
--- a/thirdparty/freetype/src/cid/cidriver.c
+++ b/thirdparty/freetype/src/cid/cidriver.c
@@ -4,7 +4,7 @@
/* */
/* CID driver interface (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -206,7 +206,7 @@
0x10000L, /* version 1.0 of driver */
0x20000L, /* requires FreeType 2.0 */
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
cid_driver_init, /* FT_Module_Constructor module_init */
cid_driver_done, /* FT_Module_Destructor module_done */
@@ -226,12 +226,12 @@
cid_slot_load_glyph, /* FT_Slot_LoadFunc load_glyph */
- 0, /* FT_Face_GetKerningFunc get_kerning */
- 0, /* FT_Face_AttachFunc attach_file */
- 0, /* FT_Face_GetAdvancesFunc get_advances */
+ NULL, /* FT_Face_GetKerningFunc get_kerning */
+ NULL, /* FT_Face_AttachFunc attach_file */
+ NULL, /* FT_Face_GetAdvancesFunc get_advances */
cid_size_request, /* FT_Size_RequestFunc request_size */
- 0 /* FT_Size_SelectFunc select_size */
+ NULL /* FT_Size_SelectFunc select_size */
};
diff --git a/thirdparty/freetype/src/cid/cidriver.h b/thirdparty/freetype/src/cid/cidriver.h
index a359a78907..76640c57ba 100644
--- a/thirdparty/freetype/src/cid/cidriver.h
+++ b/thirdparty/freetype/src/cid/cidriver.h
@@ -4,7 +4,7 @@
/* */
/* High-level CID driver interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidtoken.h b/thirdparty/freetype/src/cid/cidtoken.h
index 9c773fd094..653cc5586e 100644
--- a/thirdparty/freetype/src/cid/cidtoken.h
+++ b/thirdparty/freetype/src/cid/cidtoken.h
@@ -4,7 +4,7 @@
/* */
/* CID token definitions (specification only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/module.mk b/thirdparty/freetype/src/cid/module.mk
index d9585d7816..b30b8679b9 100644
--- a/thirdparty/freetype/src/cid/module.mk
+++ b/thirdparty/freetype/src/cid/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/cid/rules.mk b/thirdparty/freetype/src/cid/rules.mk
index f33aab00d6..fcddd92eca 100644
--- a/thirdparty/freetype/src/cid/rules.mk
+++ b/thirdparty/freetype/src/cid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/cid/type1cid.c b/thirdparty/freetype/src/cid/type1cid.c
index de3bdf7705..93e6f810db 100644
--- a/thirdparty/freetype/src/cid/type1cid.c
+++ b/thirdparty/freetype/src/cid/type1cid.c
@@ -4,7 +4,7 @@
/* */
/* FreeType OpenType driver component (body only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,13 +17,13 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
#include <ft2build.h>
-#include "cidparse.c"
+
+#include "cidgload.c"
#include "cidload.c"
#include "cidobjs.c"
+#include "cidparse.c"
#include "cidriver.c"
-#include "cidgload.c"
/* END */
diff --git a/thirdparty/freetype/src/gxvalid/README b/thirdparty/freetype/src/gxvalid/README
index d3ac49c3e2..7201459aaf 100644
--- a/thirdparty/freetype/src/gxvalid/README
+++ b/thirdparty/freetype/src/gxvalid/README
@@ -413,7 +413,7 @@ gxvalid: TrueType GX validator
format assured for Windows and OS/2 support is only subtable
format 0. The Microsoft TrueType specification also describes
subtable format 2, but does not mention which platforms support
- it. Aubtable formats 1, 3, and higher are documented as reserved
+ it. Subtable formats 1, 3, and higher are documented as reserved
for future use. Therefore, the classic version can store subtable
formats 0 and 2, at least. `ttfdump.exe', a font tool provided by
Microsoft, ignores the subtable format written in the subtable
@@ -518,7 +518,7 @@ gxvalid: TrueType GX validator
------------------------------------------------------------------------
-Copyright 2004-2016 by
+Copyright 2004-2017 by
suzuki toshiya, Masatake YAMATO, Red hat K.K.,
David Turner, Robert Wilhelm, and Werner Lemberg.
diff --git a/thirdparty/freetype/src/gxvalid/gxvalid.c b/thirdparty/freetype/src/gxvalid/gxvalid.c
index 7fb868cad1..da485141d3 100644
--- a/thirdparty/freetype/src/gxvalid/gxvalid.c
+++ b/thirdparty/freetype/src/gxvalid/gxvalid.c
@@ -4,7 +4,7 @@
/* */
/* FreeType validator for TrueTypeGX/AAT tables (body only). */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -16,15 +16,17 @@
/* */
/***************************************************************************/
-#define FT_MAKE_OPTION_SINGLE_OBJECT
+#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
-#include "gxvfeat.c"
-#include "gxvcommn.c"
#include "gxvbsln.c"
-#include "gxvtrak.c"
+#include "gxvcommn.c"
+#include "gxvfeat.c"
#include "gxvjust.c"
+#include "gxvkern.c"
+#include "gxvlcar.c"
+#include "gxvmod.c"
#include "gxvmort.c"
#include "gxvmort0.c"
#include "gxvmort1.c"
@@ -37,11 +39,9 @@
#include "gxvmorx2.c"
#include "gxvmorx4.c"
#include "gxvmorx5.c"
-#include "gxvkern.c"
#include "gxvopbd.c"
#include "gxvprop.c"
-#include "gxvlcar.c"
-#include "gxvmod.c"
+#include "gxvtrak.c"
/* END */
diff --git a/thirdparty/freetype/src/gxvalid/gxvalid.h b/thirdparty/freetype/src/gxvalid/gxvalid.h
index 7a3ab795ef..78116ef85a 100644
--- a/thirdparty/freetype/src/gxvalid/gxvalid.h
+++ b/thirdparty/freetype/src/gxvalid/gxvalid.h
@@ -2,9 +2,9 @@
/* */
/* gxvalid.h */
/* */
-/* TrueTyeeGX/AAT table validation (specification only). */
+/* TrueTypeGX/AAT table validation (specification only). */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvbsln.c b/thirdparty/freetype/src/gxvalid/gxvbsln.c
index 493b20c31a..81dff7304d 100644
--- a/thirdparty/freetype/src/gxvalid/gxvbsln.c
+++ b/thirdparty/freetype/src/gxvalid/gxvbsln.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT bsln table validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvcommn.c b/thirdparty/freetype/src/gxvalid/gxvcommn.c
index 4b5e41539a..db0a91ea74 100644
--- a/thirdparty/freetype/src/gxvalid/gxvcommn.c
+++ b/thirdparty/freetype/src/gxvalid/gxvcommn.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT common tables validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -454,7 +454,7 @@
}
- /* ================= Segment Single Format 2 Loolup Table ============== */
+ /* ================= Segment Single Format 2 Lookup Table ============== */
/*
* Apple spec says:
*
@@ -789,7 +789,7 @@
FT_INVALID_FORMAT;
func = fmt_funcs_table[format];
- if ( func == NULL )
+ if ( !func )
FT_INVALID_FORMAT;
func( p, limit, gxvalid );
@@ -972,7 +972,7 @@
FT_UShort i;
- ft_memset( nGlyphInClass, 0, 256 );
+ FT_MEM_ZERO( nGlyphInClass, 256 );
for ( i = 0; i < nGlyphs; i++ )
@@ -1161,7 +1161,7 @@
break;
}
- if ( NULL != gxvalid->statetable.entry_validate_func )
+ if ( gxvalid->statetable.entry_validate_func )
gxvalid->statetable.entry_validate_func( state,
flags,
&glyphOffset,
@@ -1244,10 +1244,10 @@
if ( stateSize > 0xFF )
FT_INVALID_DATA;
- if ( gxvalid->statetable.optdata_load_func != NULL )
+ if ( gxvalid->statetable.optdata_load_func )
gxvalid->statetable.optdata_load_func( p, limit, gxvalid );
- if ( gxvalid->statetable.subtable_setup_func != NULL)
+ if ( gxvalid->statetable.subtable_setup_func )
setup_func = gxvalid->statetable.subtable_setup_func;
else
setup_func = gxv_StateTable_subtable_setup;
@@ -1534,7 +1534,7 @@
goto Exit;
}
- if ( NULL != gxvalid->xstatetable.entry_validate_func )
+ if ( gxvalid->xstatetable.entry_validate_func )
gxvalid->xstatetable.entry_validate_func( state,
flags,
&glyphOffset,
@@ -1591,10 +1591,10 @@
GXV_TRACE(( "StateTable Subtables\n" ));
- if ( gxvalid->xstatetable.optdata_load_func != NULL )
+ if ( gxvalid->xstatetable.optdata_load_func )
gxvalid->xstatetable.optdata_load_func( p, limit, gxvalid );
- if ( gxvalid->xstatetable.subtable_setup_func != NULL )
+ if ( gxvalid->xstatetable.subtable_setup_func )
setup_func = gxvalid->xstatetable.subtable_setup_func;
else
setup_func = gxv_XStateTable_subtable_setup;
diff --git a/thirdparty/freetype/src/gxvalid/gxvcommn.h b/thirdparty/freetype/src/gxvalid/gxvcommn.h
index 9470c8412b..10b1c800f0 100644
--- a/thirdparty/freetype/src/gxvalid/gxvcommn.h
+++ b/thirdparty/freetype/src/gxvalid/gxvcommn.h
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT common tables validation (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxverror.h b/thirdparty/freetype/src/gxvalid/gxverror.h
index 2e53355ce4..80a2b8a262 100644
--- a/thirdparty/freetype/src/gxvalid/gxverror.h
+++ b/thirdparty/freetype/src/gxvalid/gxverror.h
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT validation module error codes (specification only). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvfeat.c b/thirdparty/freetype/src/gxvalid/gxvfeat.c
index 5bff7c261d..2e3ec6f9be 100644
--- a/thirdparty/freetype/src/gxvalid/gxvfeat.c
+++ b/thirdparty/freetype/src/gxvalid/gxvfeat.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT feat table validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvfeat.h b/thirdparty/freetype/src/gxvalid/gxvfeat.h
index 284bada891..8c0e847eb7 100644
--- a/thirdparty/freetype/src/gxvalid/gxvfeat.h
+++ b/thirdparty/freetype/src/gxvalid/gxvfeat.h
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT feat table validation (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvfgen.c b/thirdparty/freetype/src/gxvalid/gxvfgen.c
index 667dac3cde..8cc08cd9c3 100644
--- a/thirdparty/freetype/src/gxvalid/gxvfgen.c
+++ b/thirdparty/freetype/src/gxvalid/gxvfgen.c
@@ -5,7 +5,7 @@
/* Generate feature registry data for gxv `feat' validator. */
/* This program is derived from gxfeatreg.c in gxlayout. */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* This file may only be used, */
diff --git a/thirdparty/freetype/src/gxvalid/gxvjust.c b/thirdparty/freetype/src/gxvalid/gxvjust.c
index 20d29bfbc8..c8cfd83eac 100644
--- a/thirdparty/freetype/src/gxvalid/gxvjust.c
+++ b/thirdparty/freetype/src/gxvalid/gxvjust.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT just table validation (body). */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvkern.c b/thirdparty/freetype/src/gxvalid/gxvkern.c
index ee1ab36f70..9f9037387d 100644
--- a/thirdparty/freetype/src/gxvalid/gxvkern.c
+++ b/thirdparty/freetype/src/gxvalid/gxvkern.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT kern table validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvlcar.c b/thirdparty/freetype/src/gxvalid/gxvlcar.c
index d31b6410bd..775d5229f2 100644
--- a/thirdparty/freetype/src/gxvalid/gxvlcar.c
+++ b/thirdparty/freetype/src/gxvalid/gxvlcar.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT lcar table validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmod.c b/thirdparty/freetype/src/gxvalid/gxvmod.c
index e589a7fb79..84e9275baf 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmod.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmod.c
@@ -4,7 +4,7 @@
/* */
/* FreeType's TrueTypeGX/AAT validation module implementation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -274,11 +274,11 @@
0x10000L,
0x20000L,
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
- (FT_Module_Constructor)0,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) gxvalid_get_service
+ (FT_Module_Constructor)NULL, /* module_init */
+ (FT_Module_Destructor) NULL, /* module_done */
+ (FT_Module_Requester) gxvalid_get_service /* get_interface */
};
diff --git a/thirdparty/freetype/src/gxvalid/gxvmod.h b/thirdparty/freetype/src/gxvalid/gxvmod.h
index 8b82e91070..df25e60cb2 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmod.h
+++ b/thirdparty/freetype/src/gxvalid/gxvmod.h
@@ -5,7 +5,7 @@
/* FreeType's TrueTypeGX/AAT validation module implementation */
/* (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort.c b/thirdparty/freetype/src/gxvalid/gxvmort.c
index b83a2b2c0f..184a6317c0 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT mort table validation (body). */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -205,7 +205,7 @@
FT_INVALID_FORMAT;
func = fmt_funcs_table[type];
- if ( func == NULL )
+ if ( !func )
GXV_TRACE(( "morx type %d is reserved\n", type ));
func( p, p + rest, gxvalid );
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort.h b/thirdparty/freetype/src/gxvalid/gxvmort.h
index 5fd228212a..d0543adcc5 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort.h
+++ b/thirdparty/freetype/src/gxvalid/gxvmort.h
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT common definition for mort table (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort0.c b/thirdparty/freetype/src/gxvalid/gxvmort0.c
index e11f5ddc49..a75fad7768 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort0.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort0.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type0 (Indic Script Rearrangement) subtable. */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort1.c b/thirdparty/freetype/src/gxvalid/gxvmort1.c
index fd761d0692..361ef2262d 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort1.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort1.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type1 (Contextual Substitution) subtable. */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort2.c b/thirdparty/freetype/src/gxvalid/gxvmort2.c
index 08455dec6b..c17e51e323 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort2.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort2.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type2 (Ligature Substitution) subtable. */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort4.c b/thirdparty/freetype/src/gxvalid/gxvmort4.c
index 6f7bbb8710..041bab369f 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort4.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort4.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type4 (Non-Contextual Glyph Substitution) subtable. */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort5.c b/thirdparty/freetype/src/gxvalid/gxvmort5.c
index 54ddbe2b15..4751eceaa0 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort5.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort5.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type5 (Contextual Glyph Insertion) subtable. */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx.c b/thirdparty/freetype/src/gxvalid/gxvmorx.c
index a3abe435a6..2bb4f3b8b1 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT morx table validation (body). */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -98,7 +98,7 @@
FT_INVALID_FORMAT;
func = fmt_funcs_table[type];
- if ( func == NULL )
+ if ( !func )
GXV_TRACE(( "morx type %d is reserved\n", type ));
func( p, p + rest, gxvalid );
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx.h b/thirdparty/freetype/src/gxvalid/gxvmorx.h
index 9ba25c14a4..20cec58672 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx.h
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx.h
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT common definition for morx table (specification). */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx0.c b/thirdparty/freetype/src/gxvalid/gxvmorx0.c
index 4abb7368f2..e0a0a92438 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx0.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx0.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type0 (Indic Script Rearrangement) subtable. */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx1.c b/thirdparty/freetype/src/gxvalid/gxvmorx1.c
index e581848c2b..9afebdbfa8 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx1.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx1.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type1 (Contextual Substitution) subtable. */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx2.c b/thirdparty/freetype/src/gxvalid/gxvmorx2.c
index 9495cca489..3a60cf68a4 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx2.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx2.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type2 (Ligature Substitution) subtable. */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx4.c b/thirdparty/freetype/src/gxvalid/gxvmorx4.c
index 3b7731bbce..29555685af 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx4.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx4.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT morx table validation */
/* body for "morx" type4 (Non-Contextual Glyph Substitution) subtable. */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx5.c b/thirdparty/freetype/src/gxvalid/gxvmorx5.c
index 0e96166c02..05c11417ef 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx5.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx5.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type5 (Contextual Glyph Insertion) subtable. */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvopbd.c b/thirdparty/freetype/src/gxvalid/gxvopbd.c
index e3ba082e16..11580d8b2a 100644
--- a/thirdparty/freetype/src/gxvalid/gxvopbd.c
+++ b/thirdparty/freetype/src/gxvalid/gxvopbd.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT opbd table validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvprop.c b/thirdparty/freetype/src/gxvalid/gxvprop.c
index 61b3aeee30..7d398b7e66 100644
--- a/thirdparty/freetype/src/gxvalid/gxvprop.c
+++ b/thirdparty/freetype/src/gxvalid/gxvprop.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT prop table validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvtrak.c b/thirdparty/freetype/src/gxvalid/gxvtrak.c
index 0f07c04e2a..dd49825565 100644
--- a/thirdparty/freetype/src/gxvalid/gxvtrak.c
+++ b/thirdparty/freetype/src/gxvalid/gxvtrak.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT trak table validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/module.mk b/thirdparty/freetype/src/gxvalid/module.mk
index b431384a5c..7f87e10812 100644
--- a/thirdparty/freetype/src/gxvalid/module.mk
+++ b/thirdparty/freetype/src/gxvalid/module.mk
@@ -2,7 +2,7 @@
# FreeType 2 gxvalid module definition
#
-# Copyright 2004-2016 by
+# Copyright 2004-2017 by
# suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
diff --git a/thirdparty/freetype/src/gxvalid/rules.mk b/thirdparty/freetype/src/gxvalid/rules.mk
index 424f2a6377..10ec08c5b0 100644
--- a/thirdparty/freetype/src/gxvalid/rules.mk
+++ b/thirdparty/freetype/src/gxvalid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004-2016 by
+# Copyright 2004-2017 by
# suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
diff --git a/thirdparty/freetype/src/gzip/adler32.c b/thirdparty/freetype/src/gzip/adler32.c
new file mode 100644
index 0000000000..c53f9dd125
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/adler32.c
@@ -0,0 +1,48 @@
+/* adler32.c -- compute the Adler-32 checksum of a data stream
+ * Copyright (C) 1995-2002 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#include "zlib.h"
+
+#define BASE 65521L /* largest prime smaller than 65536 */
+#define NMAX 5552
+/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
+#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
+#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
+#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
+#define DO16(buf) DO8(buf,0); DO8(buf,8);
+
+/* ========================================================================= */
+ZEXPORT(uLong) adler32( /* adler, buf, len) */
+ uLong adler,
+ const Bytef *buf,
+ uInt len )
+{
+ unsigned long s1 = adler & 0xffff;
+ unsigned long s2 = (adler >> 16) & 0xffff;
+ int k;
+
+ if (buf == Z_NULL) return 1L;
+
+ while (len > 0) {
+ k = len < NMAX ? len : NMAX;
+ len -= k;
+ while (k >= 16) {
+ DO16(buf);
+ buf += 16;
+ k -= 16;
+ }
+ if (k != 0) do {
+ s1 += *buf++;
+ s2 += s1;
+ } while (--k);
+ s1 %= BASE;
+ s2 %= BASE;
+ }
+ return (s2 << 16) | s1;
+}
diff --git a/thirdparty/freetype/src/gzip/ftgzip.c b/thirdparty/freetype/src/gzip/ftgzip.c
new file mode 100644
index 0000000000..c487786d99
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/ftgzip.c
@@ -0,0 +1,816 @@
+/***************************************************************************/
+/* */
+/* ftgzip.c */
+/* */
+/* FreeType support for .gz compressed files. */
+/* */
+/* This optional component relies on zlib. It should mainly be used to */
+/* parse compressed PCF fonts, as found with many X11 server */
+/* distributions. */
+/* */
+/* Copyright 2002-2017 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_MEMORY_H
+#include FT_INTERNAL_STREAM_H
+#include FT_INTERNAL_DEBUG_H
+#include FT_GZIP_H
+#include FT_CONFIG_STANDARD_LIBRARY_H
+
+
+#include FT_MODULE_ERRORS_H
+
+#undef FTERRORS_H_
+
+#undef FT_ERR_PREFIX
+#define FT_ERR_PREFIX Gzip_Err_
+#define FT_ERR_BASE FT_Mod_Err_Gzip
+
+#include FT_ERRORS_H
+
+
+#ifdef FT_CONFIG_OPTION_USE_ZLIB
+
+#ifdef FT_CONFIG_OPTION_PIC
+#error "gzip code does not support PIC yet"
+#endif
+
+#ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB
+
+#include <zlib.h>
+
+#else /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */
+
+ /* In this case, we include our own modified sources of the ZLib */
+ /* within the `gzip' component. The modifications were necessary */
+ /* to #include all files without conflicts, as well as preventing */
+ /* the definition of `extern' functions that may cause linking */
+ /* conflicts when a program is linked with both FreeType and the */
+ /* original ZLib. */
+
+#ifndef USE_ZLIB_ZCALLOC
+#define MY_ZCALLOC /* prevent all zcalloc() & zfree() in zutil.c */
+#endif
+
+ /* Note that our `zlib.h' includes `ftzconf.h' instead of `zconf.h'; */
+ /* the main reason is that even a global `zlib.h' includes `zconf.h' */
+ /* with */
+ /* */
+ /* #include "zconf.h" */
+ /* */
+ /* instead of the expected */
+ /* */
+ /* #include <zconf.h> */
+ /* */
+ /* so that configuration with `FT_CONFIG_OPTION_SYSTEM_ZLIB' might */
+ /* include the wrong `zconf.h' file, leading to errors. */
+#include "zlib.h"
+
+#undef SLOW
+#define SLOW 1 /* we can't use asm-optimized sources here! */
+
+#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
+ /* We disable the warning `conversion from XXX to YYY, */
+ /* possible loss of data' in order to compile cleanly with */
+ /* the maximum level of warnings: zlib is non-FreeType */
+ /* code. */
+#pragma warning( push )
+#pragma warning( disable : 4244 )
+#endif /* _MSC_VER */
+
+ /* Urgh. `inflate_mask' must not be declared twice -- C++ doesn't like
+ this. We temporarily disable it and load all necessary header files. */
+#define NO_INFLATE_MASK
+#include "zutil.h"
+#include "inftrees.h"
+#include "infblock.h"
+#include "infcodes.h"
+#include "infutil.h"
+#undef NO_INFLATE_MASK
+
+ /* infutil.c must be included before infcodes.c */
+#include "zutil.c"
+#include "inftrees.c"
+#include "infutil.c"
+#include "infcodes.c"
+#include "infblock.c"
+#include "inflate.c"
+#include "adler32.c"
+
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
+
+#endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***** *****/
+/***** Z L I B M E M O R Y M A N A G E M E N T *****/
+/***** *****/
+/***************************************************************************/
+/***************************************************************************/
+
+ /* it is better to use FreeType memory routines instead of raw
+ 'malloc/free' */
+
+ static voidpf
+ ft_gzip_alloc( FT_Memory memory,
+ uInt items,
+ uInt size )
+ {
+ FT_ULong sz = (FT_ULong)size * items;
+ FT_Error error;
+ FT_Pointer p = NULL;
+
+
+ (void)FT_ALLOC( p, sz );
+ return p;
+ }
+
+
+ static void
+ ft_gzip_free( FT_Memory memory,
+ voidpf address )
+ {
+ FT_MEM_FREE( address );
+ }
+
+
+#if !defined( FT_CONFIG_OPTION_SYSTEM_ZLIB ) && !defined( USE_ZLIB_ZCALLOC )
+
+ local voidpf
+ zcalloc ( voidpf opaque,
+ unsigned items,
+ unsigned size )
+ {
+ return ft_gzip_alloc( (FT_Memory)opaque, items, size );
+ }
+
+ local void
+ zcfree( voidpf opaque,
+ voidpf ptr )
+ {
+ ft_gzip_free( (FT_Memory)opaque, ptr );
+ }
+
+#endif /* !SYSTEM_ZLIB && !USE_ZLIB_ZCALLOC */
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***** *****/
+/***** Z L I B F I L E D E S C R I P T O R *****/
+/***** *****/
+/***************************************************************************/
+/***************************************************************************/
+
+#define FT_GZIP_BUFFER_SIZE 4096
+
+ typedef struct FT_GZipFileRec_
+ {
+ FT_Stream source; /* parent/source stream */
+ FT_Stream stream; /* embedding stream */
+ FT_Memory memory; /* memory allocator */
+ z_stream zstream; /* zlib input stream */
+
+ FT_ULong start; /* starting position, after .gz header */
+ FT_Byte input[FT_GZIP_BUFFER_SIZE]; /* input read buffer */
+
+ FT_Byte buffer[FT_GZIP_BUFFER_SIZE]; /* output buffer */
+ FT_ULong pos; /* position in output */
+ FT_Byte* cursor;
+ FT_Byte* limit;
+
+ } FT_GZipFileRec, *FT_GZipFile;
+
+
+ /* gzip flag byte */
+#define FT_GZIP_ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
+#define FT_GZIP_HEAD_CRC 0x02 /* bit 1 set: header CRC present */
+#define FT_GZIP_EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
+#define FT_GZIP_ORIG_NAME 0x08 /* bit 3 set: original file name present */
+#define FT_GZIP_COMMENT 0x10 /* bit 4 set: file comment present */
+#define FT_GZIP_RESERVED 0xE0 /* bits 5..7: reserved */
+
+
+ /* check and skip .gz header - we don't support `transparent' compression */
+ static FT_Error
+ ft_gzip_check_header( FT_Stream stream )
+ {
+ FT_Error error;
+ FT_Byte head[4];
+
+
+ if ( FT_STREAM_SEEK( 0 ) ||
+ FT_STREAM_READ( head, 4 ) )
+ goto Exit;
+
+ /* head[0] && head[1] are the magic numbers; */
+ /* head[2] is the method, and head[3] the flags */
+ if ( head[0] != 0x1F ||
+ head[1] != 0x8B ||
+ head[2] != Z_DEFLATED ||
+ (head[3] & FT_GZIP_RESERVED) )
+ {
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ /* skip time, xflags and os code */
+ (void)FT_STREAM_SKIP( 6 );
+
+ /* skip the extra field */
+ if ( head[3] & FT_GZIP_EXTRA_FIELD )
+ {
+ FT_UInt len;
+
+
+ if ( FT_READ_USHORT_LE( len ) ||
+ FT_STREAM_SKIP( len ) )
+ goto Exit;
+ }
+
+ /* skip original file name */
+ if ( head[3] & FT_GZIP_ORIG_NAME )
+ for (;;)
+ {
+ FT_UInt c;
+
+
+ if ( FT_READ_BYTE( c ) )
+ goto Exit;
+
+ if ( c == 0 )
+ break;
+ }
+
+ /* skip .gz comment */
+ if ( head[3] & FT_GZIP_COMMENT )
+ for (;;)
+ {
+ FT_UInt c;
+
+
+ if ( FT_READ_BYTE( c ) )
+ goto Exit;
+
+ if ( c == 0 )
+ break;
+ }
+
+ /* skip CRC */
+ if ( head[3] & FT_GZIP_HEAD_CRC )
+ if ( FT_STREAM_SKIP( 2 ) )
+ goto Exit;
+
+ Exit:
+ return error;
+ }
+
+
+ static FT_Error
+ ft_gzip_file_init( FT_GZipFile zip,
+ FT_Stream stream,
+ FT_Stream source )
+ {
+ z_stream* zstream = &zip->zstream;
+ FT_Error error = FT_Err_Ok;
+
+
+ zip->stream = stream;
+ zip->source = source;
+ zip->memory = stream->memory;
+
+ zip->limit = zip->buffer + FT_GZIP_BUFFER_SIZE;
+ zip->cursor = zip->limit;
+ zip->pos = 0;
+
+ /* check and skip .gz header */
+ {
+ stream = source;
+
+ error = ft_gzip_check_header( stream );
+ if ( error )
+ goto Exit;
+
+ zip->start = FT_STREAM_POS();
+ }
+
+ /* initialize zlib -- there is no zlib header in the compressed stream */
+ zstream->zalloc = (alloc_func)ft_gzip_alloc;
+ zstream->zfree = (free_func) ft_gzip_free;
+ zstream->opaque = stream->memory;
+
+ zstream->avail_in = 0;
+ zstream->next_in = zip->buffer;
+
+ if ( inflateInit2( zstream, -MAX_WBITS ) != Z_OK ||
+ !zstream->next_in )
+ error = FT_THROW( Invalid_File_Format );
+
+ Exit:
+ return error;
+ }
+
+
+ static void
+ ft_gzip_file_done( FT_GZipFile zip )
+ {
+ z_stream* zstream = &zip->zstream;
+
+
+ inflateEnd( zstream );
+
+ /* clear the rest */
+ zstream->zalloc = NULL;
+ zstream->zfree = NULL;
+ zstream->opaque = NULL;
+ zstream->next_in = NULL;
+ zstream->next_out = NULL;
+ zstream->avail_in = 0;
+ zstream->avail_out = 0;
+
+ zip->memory = NULL;
+ zip->source = NULL;
+ zip->stream = NULL;
+ }
+
+
+ static FT_Error
+ ft_gzip_file_reset( FT_GZipFile zip )
+ {
+ FT_Stream stream = zip->source;
+ FT_Error error;
+
+
+ if ( !FT_STREAM_SEEK( zip->start ) )
+ {
+ z_stream* zstream = &zip->zstream;
+
+
+ inflateReset( zstream );
+
+ zstream->avail_in = 0;
+ zstream->next_in = zip->input;
+ zstream->avail_out = 0;
+ zstream->next_out = zip->buffer;
+
+ zip->limit = zip->buffer + FT_GZIP_BUFFER_SIZE;
+ zip->cursor = zip->limit;
+ zip->pos = 0;
+ }
+
+ return error;
+ }
+
+
+ static FT_Error
+ ft_gzip_file_fill_input( FT_GZipFile zip )
+ {
+ z_stream* zstream = &zip->zstream;
+ FT_Stream stream = zip->source;
+ FT_ULong size;
+
+
+ if ( stream->read )
+ {
+ size = stream->read( stream, stream->pos, zip->input,
+ FT_GZIP_BUFFER_SIZE );
+ if ( size == 0 )
+ {
+ zip->limit = zip->cursor;
+ return FT_THROW( Invalid_Stream_Operation );
+ }
+ }
+ else
+ {
+ size = stream->size - stream->pos;
+ if ( size > FT_GZIP_BUFFER_SIZE )
+ size = FT_GZIP_BUFFER_SIZE;
+
+ if ( size == 0 )
+ {
+ zip->limit = zip->cursor;
+ return FT_THROW( Invalid_Stream_Operation );
+ }
+
+ FT_MEM_COPY( zip->input, stream->base + stream->pos, size );
+ }
+ stream->pos += size;
+
+ zstream->next_in = zip->input;
+ zstream->avail_in = size;
+
+ return FT_Err_Ok;
+ }
+
+
+ static FT_Error
+ ft_gzip_file_fill_output( FT_GZipFile zip )
+ {
+ z_stream* zstream = &zip->zstream;
+ FT_Error error = FT_Err_Ok;
+
+
+ zip->cursor = zip->buffer;
+ zstream->next_out = zip->cursor;
+ zstream->avail_out = FT_GZIP_BUFFER_SIZE;
+
+ while ( zstream->avail_out > 0 )
+ {
+ int err;
+
+
+ if ( zstream->avail_in == 0 )
+ {
+ error = ft_gzip_file_fill_input( zip );
+ if ( error )
+ break;
+ }
+
+ err = inflate( zstream, Z_NO_FLUSH );
+
+ if ( err == Z_STREAM_END )
+ {
+ zip->limit = zstream->next_out;
+ if ( zip->limit == zip->cursor )
+ error = FT_THROW( Invalid_Stream_Operation );
+ break;
+ }
+ else if ( err != Z_OK )
+ {
+ zip->limit = zip->cursor;
+ error = FT_THROW( Invalid_Stream_Operation );
+ break;
+ }
+ }
+
+ return error;
+ }
+
+
+ /* fill output buffer; `count' must be <= FT_GZIP_BUFFER_SIZE */
+ static FT_Error
+ ft_gzip_file_skip_output( FT_GZipFile zip,
+ FT_ULong count )
+ {
+ FT_Error error = FT_Err_Ok;
+ FT_ULong delta;
+
+
+ for (;;)
+ {
+ delta = (FT_ULong)( zip->limit - zip->cursor );
+ if ( delta >= count )
+ delta = count;
+
+ zip->cursor += delta;
+ zip->pos += delta;
+
+ count -= delta;
+ if ( count == 0 )
+ break;
+
+ error = ft_gzip_file_fill_output( zip );
+ if ( error )
+ break;
+ }
+
+ return error;
+ }
+
+
+ static FT_ULong
+ ft_gzip_file_io( FT_GZipFile zip,
+ FT_ULong pos,
+ FT_Byte* buffer,
+ FT_ULong count )
+ {
+ FT_ULong result = 0;
+ FT_Error error;
+
+
+ /* Reset inflate stream if we're seeking backwards. */
+ /* Yes, that is not too efficient, but it saves memory :-) */
+ if ( pos < zip->pos )
+ {
+ error = ft_gzip_file_reset( zip );
+ if ( error )
+ goto Exit;
+ }
+
+ /* skip unwanted bytes */
+ if ( pos > zip->pos )
+ {
+ error = ft_gzip_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) );
+ if ( error )
+ goto Exit;
+ }
+
+ if ( count == 0 )
+ goto Exit;
+
+ /* now read the data */
+ for (;;)
+ {
+ FT_ULong delta;
+
+
+ delta = (FT_ULong)( zip->limit - zip->cursor );
+ if ( delta >= count )
+ delta = count;
+
+ FT_MEM_COPY( buffer, zip->cursor, delta );
+ buffer += delta;
+ result += delta;
+ zip->cursor += delta;
+ zip->pos += delta;
+
+ count -= delta;
+ if ( count == 0 )
+ break;
+
+ error = ft_gzip_file_fill_output( zip );
+ if ( error )
+ break;
+ }
+
+ Exit:
+ return result;
+ }
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***** *****/
+/***** G Z E M B E D D I N G S T R E A M *****/
+/***** *****/
+/***************************************************************************/
+/***************************************************************************/
+
+ static void
+ ft_gzip_stream_close( FT_Stream stream )
+ {
+ FT_GZipFile zip = (FT_GZipFile)stream->descriptor.pointer;
+ FT_Memory memory = stream->memory;
+
+
+ if ( zip )
+ {
+ /* finalize gzip file descriptor */
+ ft_gzip_file_done( zip );
+
+ FT_FREE( zip );
+
+ stream->descriptor.pointer = NULL;
+ }
+
+ if ( !stream->read )
+ FT_FREE( stream->base );
+ }
+
+
+ static unsigned long
+ ft_gzip_stream_io( FT_Stream stream,
+ unsigned long offset,
+ unsigned char* buffer,
+ unsigned long count )
+ {
+ FT_GZipFile zip = (FT_GZipFile)stream->descriptor.pointer;
+
+
+ return ft_gzip_file_io( zip, offset, buffer, count );
+ }
+
+
+ static FT_ULong
+ ft_gzip_get_uncompressed_size( FT_Stream stream )
+ {
+ FT_Error error;
+ FT_ULong old_pos;
+ FT_ULong result = 0;
+
+
+ old_pos = stream->pos;
+ if ( !FT_Stream_Seek( stream, stream->size - 4 ) )
+ {
+ result = FT_Stream_ReadULongLE( stream, &error );
+ if ( error )
+ result = 0;
+
+ (void)FT_Stream_Seek( stream, old_pos );
+ }
+
+ return result;
+ }
+
+
+ /* documentation is in ftgzip.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Stream_OpenGzip( FT_Stream stream,
+ FT_Stream source )
+ {
+ FT_Error error;
+ FT_Memory memory;
+ FT_GZipFile zip = NULL;
+
+
+ if ( !stream || !source )
+ {
+ error = FT_THROW( Invalid_Stream_Handle );
+ goto Exit;
+ }
+
+ memory = source->memory;
+
+ /*
+ * check the header right now; this prevents allocating un-necessary
+ * objects when we don't need them
+ */
+ error = ft_gzip_check_header( source );
+ if ( error )
+ goto Exit;
+
+ FT_ZERO( stream );
+ stream->memory = memory;
+
+ if ( !FT_QNEW( zip ) )
+ {
+ error = ft_gzip_file_init( zip, stream, source );
+ if ( error )
+ {
+ FT_FREE( zip );
+ goto Exit;
+ }
+
+ stream->descriptor.pointer = zip;
+ }
+
+ /*
+ * We use the following trick to try to dramatically improve the
+ * performance while dealing with small files. If the original stream
+ * size is less than a certain threshold, we try to load the whole font
+ * file into memory. This saves us from using the 32KB buffer needed
+ * to inflate the file, plus the two 4KB intermediate input/output
+ * buffers used in the `FT_GZipFile' structure.
+ */
+ {
+ FT_ULong zip_size = ft_gzip_get_uncompressed_size( source );
+
+
+ if ( zip_size != 0 && zip_size < 40 * 1024 )
+ {
+ FT_Byte* zip_buff = NULL;
+
+
+ if ( !FT_ALLOC( zip_buff, zip_size ) )
+ {
+ FT_ULong count;
+
+
+ count = ft_gzip_file_io( zip, 0, zip_buff, zip_size );
+ if ( count == zip_size )
+ {
+ ft_gzip_file_done( zip );
+ FT_FREE( zip );
+
+ stream->descriptor.pointer = NULL;
+
+ stream->size = zip_size;
+ stream->pos = 0;
+ stream->base = zip_buff;
+ stream->read = NULL;
+ stream->close = ft_gzip_stream_close;
+
+ goto Exit;
+ }
+
+ ft_gzip_file_io( zip, 0, NULL, 0 );
+ FT_FREE( zip_buff );
+ }
+ error = FT_Err_Ok;
+ }
+
+ if ( zip_size )
+ stream->size = zip_size;
+ else
+ stream->size = 0x7FFFFFFFL; /* don't know the real size! */
+ }
+
+ stream->pos = 0;
+ stream->base = NULL;
+ stream->read = ft_gzip_stream_io;
+ stream->close = ft_gzip_stream_close;
+
+ Exit:
+ return error;
+ }
+
+
+ /* documentation is in ftgzip.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Gzip_Uncompress( FT_Memory memory,
+ FT_Byte* output,
+ FT_ULong* output_len,
+ const FT_Byte* input,
+ FT_ULong input_len )
+ {
+ z_stream stream;
+ int err;
+
+
+ /* check for `input' delayed to `inflate' */
+
+ if ( !memory || ! output_len || !output )
+ return FT_THROW( Invalid_Argument );
+
+ /* this function is modeled after zlib's `uncompress' function */
+
+ stream.next_in = (Bytef*)input;
+ stream.avail_in = (uInt)input_len;
+
+ stream.next_out = output;
+ stream.avail_out = (uInt)*output_len;
+
+ stream.zalloc = (alloc_func)ft_gzip_alloc;
+ stream.zfree = (free_func) ft_gzip_free;
+ stream.opaque = memory;
+
+ err = inflateInit2( &stream, MAX_WBITS );
+ if ( err != Z_OK )
+ return FT_THROW( Invalid_Argument );
+
+ err = inflate( &stream, Z_FINISH );
+ if ( err != Z_STREAM_END )
+ {
+ inflateEnd( &stream );
+ if ( err == Z_OK )
+ err = Z_BUF_ERROR;
+ }
+ else
+ {
+ *output_len = stream.total_out;
+
+ err = inflateEnd( &stream );
+ }
+
+ if ( err == Z_MEM_ERROR )
+ return FT_THROW( Out_Of_Memory );
+
+ if ( err == Z_BUF_ERROR )
+ return FT_THROW( Array_Too_Large );
+
+ if ( err == Z_DATA_ERROR )
+ return FT_THROW( Invalid_Table );
+
+ return FT_Err_Ok;
+ }
+
+
+#else /* !FT_CONFIG_OPTION_USE_ZLIB */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Stream_OpenGzip( FT_Stream stream,
+ FT_Stream source )
+ {
+ FT_UNUSED( stream );
+ FT_UNUSED( source );
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Gzip_Uncompress( FT_Memory memory,
+ FT_Byte* output,
+ FT_ULong* output_len,
+ const FT_Byte* input,
+ FT_ULong input_len )
+ {
+ FT_UNUSED( memory );
+ FT_UNUSED( output );
+ FT_UNUSED( output_len );
+ FT_UNUSED( input );
+ FT_UNUSED( input_len );
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+#endif /* !FT_CONFIG_OPTION_USE_ZLIB */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/gzip/ftzconf.h b/thirdparty/freetype/src/gzip/ftzconf.h
new file mode 100644
index 0000000000..3abf0ba03b
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/ftzconf.h
@@ -0,0 +1,284 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2002 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef _ZCONF_H
+#define _ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ */
+#ifdef Z_PREFIX
+# define deflateInit_ z_deflateInit_
+# define deflate z_deflate
+# define deflateEnd z_deflateEnd
+# define inflateInit_ z_inflateInit_
+# define inflate z_inflate
+# define inflateEnd z_inflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateCopy z_deflateCopy
+# define deflateReset z_deflateReset
+# define deflateParams z_deflateParams
+# define inflateInit2_ z_inflateInit2_
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateReset z_inflateReset
+# define compress z_compress
+# define compress2 z_compress2
+# define uncompress z_uncompress
+# define adler32 z_adler32
+# define crc32 z_crc32
+# define get_crc_table z_get_crc_table
+
+# define Byte z_Byte
+# define uInt z_uInt
+# define uLong z_uLong
+# define Bytef z_Bytef
+# define charf z_charf
+# define intf z_intf
+# define uIntf z_uIntf
+# define uLongf z_uLongf
+# define voidpf z_voidpf
+# define voidp z_voidp
+#endif
+
+#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
+# define WIN32
+#endif
+#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
+# ifndef __32BIT__
+# define __32BIT__
+# endif
+#endif
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+
+/* WinCE doesn't have errno.h */
+#ifdef _WIN32_WCE
+# define NO_ERRNO_H
+#endif
+
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#if defined(MSDOS) && !defined(__32BIT__)
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
+# define STDC
+#endif
+#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
+# ifndef STDC
+# define STDC
+# endif
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const
+# endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Old Borland C and LCC incorrectly complains about missing returns: */
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
+# define NEED_DUMMY_RETURN
+#endif
+
+#if defined(__LCC__)
+# define NEED_DUMMY_RETURN
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+#endif
+#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
+# ifndef __32BIT__
+# define SMALL_MEDIUM
+# define FAR _far
+# endif
+#endif
+
+/* Compile with -DZLIB_DLL for Windows DLL support */
+#if defined(ZLIB_DLL)
+# if defined(_WINDOWS) || defined(WINDOWS)
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+# define ZEXPORT(x) x WINAPI
+# ifdef WIN32
+# define ZEXPORTVA(x) x WINAPIV
+# else
+# define ZEXPORTVA(x) x FAR _cdecl _export
+# endif
+# endif
+# if defined (__BORLANDC__)
+# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
+# include <windows.h>
+# define ZEXPORT(x) x __declspec(dllexport) WINAPI
+# define ZEXPORTRVA(x) x __declspec(dllexport) WINAPIV
+# else
+# if defined (_Windows) && defined (__DLL__)
+# define ZEXPORT(x) x _export
+# define ZEXPORTVA(x) x _export
+# endif
+# endif
+# endif
+#endif
+
+
+#ifndef ZEXPORT
+# define ZEXPORT(x) static x
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA(x) static x
+#endif
+#ifndef ZEXTERN
+# define ZEXTERN(x) static x
+#endif
+#ifndef ZEXTERNDEF
+# define ZEXTERNDEF(x) static x
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(MACOS) && !defined(TARGET_OS_MAC)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <sys/types.h> /* for off_t */
+# include <unistd.h> /* for SEEK_* and off_t */
+# define z_off_t off_t
+#endif
+#ifndef SEEK_SET
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+# pragma map(deflateInit_,"DEIN")
+# pragma map(deflateInit2_,"DEIN2")
+# pragma map(deflateEnd,"DEEND")
+# pragma map(inflateInit_,"ININ")
+# pragma map(inflateInit2_,"ININ2")
+# pragma map(inflateEnd,"INEND")
+# pragma map(inflateSync,"INSY")
+# pragma map(inflateSetDictionary,"INSEDI")
+# pragma map(inflate_blocks,"INBL")
+# pragma map(inflate_blocks_new,"INBLNE")
+# pragma map(inflate_blocks_free,"INBLFR")
+# pragma map(inflate_blocks_reset,"INBLRE")
+# pragma map(inflate_codes_free,"INCOFR")
+# pragma map(inflate_codes,"INCO")
+# pragma map(inflate_fast,"INFA")
+# pragma map(inflate_flush,"INFLU")
+# pragma map(inflate_mask,"INMA")
+# pragma map(inflate_set_dictionary,"INSEDI2")
+# pragma map(inflate_copyright,"INCOPY")
+# pragma map(inflate_trees_bits,"INTRBI")
+# pragma map(inflate_trees_dynamic,"INTRDY")
+# pragma map(inflate_trees_fixed,"INTRFI")
+# pragma map(inflate_trees_free,"INTRFR")
+#endif
+
+#endif /* _ZCONF_H */
diff --git a/thirdparty/freetype/src/gzip/infblock.c b/thirdparty/freetype/src/gzip/infblock.c
new file mode 100644
index 0000000000..d6e2dc297d
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/infblock.c
@@ -0,0 +1,387 @@
+/* infblock.c -- interpret and process block types to last block
+ * Copyright (C) 1995-2002 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+#include "inftrees.h"
+#include "infcodes.h"
+#include "infutil.h"
+
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+/* Table for deflate from PKZIP's appnote.txt. */
+local const uInt border[] = { /* Order of the bit length code lengths */
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+/*
+ Notes beyond the 1.93a appnote.txt:
+
+ 1. Distance pointers never point before the beginning of the output
+ stream.
+ 2. Distance pointers can point back across blocks, up to 32k away.
+ 3. There is an implied maximum of 7 bits for the bit length table and
+ 15 bits for the actual data.
+ 4. If only one code exists, then it is encoded using one bit. (Zero
+ would be more efficient, but perhaps a little confusing.) If two
+ codes exist, they are coded using one bit each (0 and 1).
+ 5. There is no way of sending zero distance codes--a dummy must be
+ sent if there are none. (History: a pre 2.0 version of PKZIP would
+ store blocks with no distance codes, but this was discovered to be
+ too harsh a criterion.) Valid only for 1.93a. 2.04c does allow
+ zero distance codes, which is sent as one code of zero bits in
+ length.
+ 6. There are up to 286 literal/length codes. Code 256 represents the
+ end-of-block. Note however that the static length tree defines
+ 288 codes just to fill out the Huffman codes. Codes 286 and 287
+ cannot be used though, since there is no length base or extra bits
+ defined for them. Similarily, there are up to 30 distance codes.
+ However, static trees define 32 codes (all 5 bits) to fill out the
+ Huffman codes, but the last two had better not show up in the data.
+ 7. Unzip can check dynamic Huffman blocks for complete code sets.
+ The exception is that a single code would not be complete (see #4).
+ 8. The five bits following the block type is really the number of
+ literal codes sent minus 257.
+ 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
+ (1+6+6). Therefore, to output three times the length, you output
+ three codes (1+1+1), whereas to output four times the same length,
+ you only need two codes (1+3). Hmm.
+ 10. In the tree reconstruction algorithm, Code = Code + Increment
+ only if BitLength(i) is not zero. (Pretty obvious.)
+ 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
+ 12. Note: length code 284 can represent 227-258, but length code 285
+ really is 258. The last length deserves its own, short code
+ since it gets used a lot in very redundant files. The length
+ 258 is special since 258 - 3 (the min match length) is 255.
+ 13. The literal/length and distance code bit lengths are read as a
+ single stream of lengths. It is possible (and advantageous) for
+ a repeat code (16, 17, or 18) to go across the boundary between
+ the two sets of lengths.
+ */
+
+
+local void inflate_blocks_reset( /* s, z, c) */
+inflate_blocks_statef *s,
+z_streamp z,
+uLongf *c )
+{
+ if (c != Z_NULL)
+ *c = s->check;
+ if (s->mode == BTREE || s->mode == DTREE)
+ ZFREE(z, s->sub.trees.blens);
+ if (s->mode == CODES)
+ inflate_codes_free(s->sub.decode.codes, z);
+ s->mode = TYPE;
+ s->bitk = 0;
+ s->bitb = 0;
+ s->read = s->write = s->window;
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
+ Tracev((stderr, "inflate: blocks reset\n"));
+}
+
+
+local inflate_blocks_statef *inflate_blocks_new( /* z, c, w) */
+z_streamp z,
+check_func c,
+uInt w )
+{
+ inflate_blocks_statef *s;
+
+ if ((s = (inflate_blocks_statef *)ZALLOC
+ (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
+ return s;
+ if ((s->hufts =
+ (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL)
+ {
+ ZFREE(z, s);
+ return Z_NULL;
+ }
+ if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
+ {
+ ZFREE(z, s->hufts);
+ ZFREE(z, s);
+ return Z_NULL;
+ }
+ s->end = s->window + w;
+ s->checkfn = c;
+ s->mode = TYPE;
+ Tracev((stderr, "inflate: blocks allocated\n"));
+ inflate_blocks_reset(s, z, Z_NULL);
+ return s;
+}
+
+
+local int inflate_blocks( /* s, z, r) */
+inflate_blocks_statef *s,
+z_streamp z,
+int r )
+{
+ uInt t; /* temporary storage */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+
+ /* copy input/output information to locals (UPDATE macro restores) */
+ LOAD
+
+ /* process input based on current state */
+ while (1) switch (s->mode)
+ {
+ case TYPE:
+ NEEDBITS(3)
+ t = (uInt)b & 7;
+ s->last = t & 1;
+ switch (t >> 1)
+ {
+ case 0: /* stored */
+ Tracev((stderr, "inflate: stored block%s\n",
+ s->last ? " (last)" : ""));
+ DUMPBITS(3)
+ t = k & 7; /* go to byte boundary */
+ DUMPBITS(t)
+ s->mode = LENS; /* get length of stored block */
+ break;
+ case 1: /* fixed */
+ Tracev((stderr, "inflate: fixed codes block%s\n",
+ s->last ? " (last)" : ""));
+ {
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+
+ inflate_trees_fixed(&bl, &bd, (const inflate_huft**)&tl,
+ (const inflate_huft**)&td, z);
+ s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
+ if (s->sub.decode.codes == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ }
+ DUMPBITS(3)
+ s->mode = CODES;
+ break;
+ case 2: /* dynamic */
+ Tracev((stderr, "inflate: dynamic codes block%s\n",
+ s->last ? " (last)" : ""));
+ DUMPBITS(3)
+ s->mode = TABLE;
+ break;
+ case 3: /* illegal */
+ DUMPBITS(3)
+ s->mode = BAD;
+ z->msg = (char*)"invalid block type";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ break;
+ case LENS:
+ NEEDBITS(32)
+ if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
+ {
+ s->mode = BAD;
+ z->msg = (char*)"invalid stored block lengths";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ s->sub.left = (uInt)b & 0xffff;
+ b = k = 0; /* dump bits */
+ Tracev((stderr, "inflate: stored length %u\n", s->sub.left));
+ s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);
+ break;
+ case STORED:
+ if (n == 0)
+ LEAVE
+ NEEDOUT
+ t = s->sub.left;
+ if (t > n) t = n;
+ if (t > m) t = m;
+ zmemcpy(q, p, t);
+ p += t; n -= t;
+ q += t; m -= t;
+ if ((s->sub.left -= t) != 0)
+ break;
+ Tracev((stderr, "inflate: stored end, %lu total out\n",
+ z->total_out + (q >= s->read ? q - s->read :
+ (s->end - s->read) + (q - s->window))));
+ s->mode = s->last ? DRY : TYPE;
+ break;
+ case TABLE:
+ NEEDBITS(14)
+ s->sub.trees.table = t = (uInt)b & 0x3fff;
+#ifndef PKZIP_BUG_WORKAROUND
+ if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
+ {
+ s->mode = BAD;
+ z->msg = (char*)"too many length or distance symbols";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+#endif
+ t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
+ if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ DUMPBITS(14)
+ s->sub.trees.index = 0;
+ Tracev((stderr, "inflate: table sizes ok\n"));
+ s->mode = BTREE;
+ case BTREE:
+ while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
+ {
+ NEEDBITS(3)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
+ DUMPBITS(3)
+ }
+ while (s->sub.trees.index < 19)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
+ s->sub.trees.bb = 7;
+ t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
+ &s->sub.trees.tb, s->hufts, z);
+ if (t != Z_OK)
+ {
+ r = t;
+ if (r == Z_DATA_ERROR)
+ {
+ ZFREE(z, s->sub.trees.blens);
+ s->mode = BAD;
+ }
+ LEAVE
+ }
+ s->sub.trees.index = 0;
+ Tracev((stderr, "inflate: bits tree ok\n"));
+ s->mode = DTREE;
+ case DTREE:
+ while (t = s->sub.trees.table,
+ s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
+ {
+ inflate_huft *h;
+ uInt i, j, c;
+
+ t = s->sub.trees.bb;
+ NEEDBITS(t)
+ h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
+ t = h->bits;
+ c = h->base;
+ if (c < 16)
+ {
+ DUMPBITS(t)
+ s->sub.trees.blens[s->sub.trees.index++] = c;
+ }
+ else /* c == 16..18 */
+ {
+ i = c == 18 ? 7 : c - 14;
+ j = c == 18 ? 11 : 3;
+ NEEDBITS(t + i)
+ DUMPBITS(t)
+ j += (uInt)b & inflate_mask[i];
+ DUMPBITS(i)
+ i = s->sub.trees.index;
+ t = s->sub.trees.table;
+ if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
+ (c == 16 && i < 1))
+ {
+ ZFREE(z, s->sub.trees.blens);
+ s->mode = BAD;
+ z->msg = (char*)"invalid bit length repeat";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
+ do {
+ s->sub.trees.blens[i++] = c;
+ } while (--j);
+ s->sub.trees.index = i;
+ }
+ }
+ s->sub.trees.tb = Z_NULL;
+ {
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+ inflate_codes_statef *c;
+
+ bl = 9; /* must be <= 9 for lookahead assumptions */
+ bd = 6; /* must be <= 9 for lookahead assumptions */
+ t = s->sub.trees.table;
+ t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
+ s->sub.trees.blens, &bl, &bd, &tl, &td,
+ s->hufts, z);
+ if (t != Z_OK)
+ {
+ if (t == (uInt)Z_DATA_ERROR)
+ {
+ ZFREE(z, s->sub.trees.blens);
+ s->mode = BAD;
+ }
+ r = t;
+ LEAVE
+ }
+ Tracev((stderr, "inflate: trees ok\n"));
+ if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ s->sub.decode.codes = c;
+ }
+ ZFREE(z, s->sub.trees.blens);
+ s->mode = CODES;
+ case CODES:
+ UPDATE
+ if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
+ return inflate_flush(s, z, r);
+ r = Z_OK;
+ inflate_codes_free(s->sub.decode.codes, z);
+ LOAD
+ Tracev((stderr, "inflate: codes end, %lu total out\n",
+ z->total_out + (q >= s->read ? q - s->read :
+ (s->end - s->read) + (q - s->window))));
+ if (!s->last)
+ {
+ s->mode = TYPE;
+ break;
+ }
+ s->mode = DRY;
+ case DRY:
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ s->mode = DONE;
+ case DONE:
+ r = Z_STREAM_END;
+ LEAVE
+ case BAD:
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+#ifdef NEED_DUMMY_RETURN
+ return 0;
+#endif
+}
+
+
+local int inflate_blocks_free( /* s, z) */
+inflate_blocks_statef *s,
+z_streamp z )
+{
+ inflate_blocks_reset(s, z, Z_NULL);
+ ZFREE(z, s->window);
+ ZFREE(z, s->hufts);
+ ZFREE(z, s);
+ Tracev((stderr, "inflate: blocks freed\n"));
+ return Z_OK;
+}
+
+
diff --git a/thirdparty/freetype/src/gzip/infblock.h b/thirdparty/freetype/src/gzip/infblock.h
new file mode 100644
index 0000000000..c2535a1e45
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/infblock.h
@@ -0,0 +1,36 @@
+/* infblock.h -- header to use infblock.c
+ * Copyright (C) 1995-2002 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+#ifndef _INFBLOCK_H
+#define _INFBLOCK_H
+
+struct inflate_blocks_state;
+typedef struct inflate_blocks_state FAR inflate_blocks_statef;
+
+local inflate_blocks_statef * inflate_blocks_new OF((
+ z_streamp z,
+ check_func c, /* check function */
+ uInt w)); /* window size */
+
+local int inflate_blocks OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int)); /* initial return code */
+
+local void inflate_blocks_reset OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ uLongf *)); /* check value on output */
+
+local int inflate_blocks_free OF((
+ inflate_blocks_statef *,
+ z_streamp));
+
+#endif /* _INFBLOCK_H */
diff --git a/thirdparty/freetype/src/gzip/infcodes.c b/thirdparty/freetype/src/gzip/infcodes.c
new file mode 100644
index 0000000000..f7bfd58c4f
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/infcodes.c
@@ -0,0 +1,250 @@
+/* infcodes.c -- process literals and length/distance pairs
+ * Copyright (C) 1995-2002 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "infblock.h"
+#include "infcodes.h"
+#include "infutil.h"
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
+ START, /* x: set up for LEN */
+ LEN, /* i: get length/literal/eob next */
+ LENEXT, /* i: getting length extra (have base) */
+ DIST, /* i: get distance next */
+ DISTEXT, /* i: getting distance extra */
+ COPY, /* o: copying bytes in window, waiting for space */
+ LIT, /* o: got literal, waiting for output space */
+ WASH, /* o: got eob, possibly still output waiting */
+ END, /* x: got eob and all data flushed */
+ BADCODE} /* x: got error */
+inflate_codes_mode;
+
+/* inflate codes private state */
+struct inflate_codes_state {
+
+ /* mode */
+ inflate_codes_mode mode; /* current inflate_codes mode */
+
+ /* mode dependent information */
+ uInt len;
+ union {
+ struct {
+ inflate_huft *tree; /* pointer into tree */
+ uInt need; /* bits needed */
+ } code; /* if LEN or DIST, where in tree */
+ uInt lit; /* if LIT, literal */
+ struct {
+ uInt get; /* bits to get for extra */
+ uInt dist; /* distance back to copy from */
+ } copy; /* if EXT or COPY, where and how much */
+ } sub; /* submode */
+
+ /* mode independent information */
+ Byte lbits; /* ltree bits decoded per branch */
+ Byte dbits; /* dtree bits decoder per branch */
+ inflate_huft *ltree; /* literal/length/eob tree */
+ inflate_huft *dtree; /* distance tree */
+
+};
+
+
+local inflate_codes_statef *inflate_codes_new( /* bl, bd, tl, td, z) */
+uInt bl, uInt bd,
+inflate_huft *tl,
+inflate_huft *td, /* need separate declaration for Borland C++ */
+z_streamp z )
+{
+ inflate_codes_statef *c;
+
+ if ((c = (inflate_codes_statef *)
+ ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)
+ {
+ c->mode = START;
+ c->lbits = (Byte)bl;
+ c->dbits = (Byte)bd;
+ c->ltree = tl;
+ c->dtree = td;
+ Tracev((stderr, "inflate: codes new\n"));
+ }
+ return c;
+}
+
+
+local int inflate_codes( /* s, z, r) */
+inflate_blocks_statef *s,
+z_streamp z,
+int r )
+{
+ uInt j; /* temporary storage */
+ inflate_huft *t; /* temporary pointer */
+ uInt e; /* extra bits or operation */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+ Bytef *f; /* pointer to copy strings from */
+ inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
+
+ /* copy input/output information to locals (UPDATE macro restores) */
+ LOAD
+
+ /* process input and output based on current state */
+ while (1) switch (c->mode)
+ { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
+ case START: /* x: set up for LEN */
+#ifndef SLOW
+ if (m >= 258 && n >= 10)
+ {
+ UPDATE
+ r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
+ LOAD
+ if (r != Z_OK)
+ {
+ c->mode = r == Z_STREAM_END ? WASH : BADCODE;
+ break;
+ }
+ }
+#endif /* !SLOW */
+ c->sub.code.need = c->lbits;
+ c->sub.code.tree = c->ltree;
+ c->mode = LEN;
+ case LEN: /* i: get length/literal/eob next */
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e == 0) /* literal */
+ {
+ c->sub.lit = t->base;
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", t->base));
+ c->mode = LIT;
+ break;
+ }
+ if (e & 16) /* length */
+ {
+ c->sub.copy.get = e & 15;
+ c->len = t->base;
+ c->mode = LENEXT;
+ break;
+ }
+ if ((e & 64) == 0) /* next table */
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ if (e & 32) /* end of block */
+ {
+ Tracevv((stderr, "inflate: end of block\n"));
+ c->mode = WASH;
+ break;
+ }
+ c->mode = BADCODE; /* invalid code */
+ z->msg = (char*)"invalid literal/length code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case LENEXT: /* i: getting length extra (have base) */
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->len += (uInt)b & inflate_mask[j];
+ DUMPBITS(j)
+ c->sub.code.need = c->dbits;
+ c->sub.code.tree = c->dtree;
+ Tracevv((stderr, "inflate: length %u\n", c->len));
+ c->mode = DIST;
+ case DIST: /* i: get distance next */
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e & 16) /* distance */
+ {
+ c->sub.copy.get = e & 15;
+ c->sub.copy.dist = t->base;
+ c->mode = DISTEXT;
+ break;
+ }
+ if ((e & 64) == 0) /* next table */
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ c->mode = BADCODE; /* invalid code */
+ z->msg = (char*)"invalid distance code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case DISTEXT: /* i: getting distance extra */
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->sub.copy.dist += (uInt)b & inflate_mask[j];
+ DUMPBITS(j)
+ Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
+ c->mode = COPY;
+ case COPY: /* o: copying bytes in window, waiting for space */
+ f = q - c->sub.copy.dist;
+ while (f < s->window) /* modulo window size-"while" instead */
+ f += s->end - s->window; /* of "if" handles invalid distances */
+ while (c->len)
+ {
+ NEEDOUT
+ OUTBYTE(*f++)
+ if (f == s->end)
+ f = s->window;
+ c->len--;
+ }
+ c->mode = START;
+ break;
+ case LIT: /* o: got literal, waiting for output space */
+ NEEDOUT
+ OUTBYTE(c->sub.lit)
+ c->mode = START;
+ break;
+ case WASH: /* o: got eob, possibly more output */
+ if (k > 7) /* return unused byte, if any */
+ {
+ Assert(k < 16, "inflate_codes grabbed too many bytes")
+ k -= 8;
+ n++;
+ p--; /* can always return one */
+ }
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ c->mode = END;
+ case END:
+ r = Z_STREAM_END;
+ LEAVE
+ case BADCODE: /* x: got error */
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
+}
+
+
+local void inflate_codes_free( /* c, z) */
+inflate_codes_statef *c,
+z_streamp z )
+{
+ ZFREE(z, c);
+ Tracev((stderr, "inflate: codes free\n"));
+}
diff --git a/thirdparty/freetype/src/gzip/infcodes.h b/thirdparty/freetype/src/gzip/infcodes.h
new file mode 100644
index 0000000000..154d7f896c
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/infcodes.h
@@ -0,0 +1,31 @@
+/* infcodes.h -- header to use infcodes.c
+ * Copyright (C) 1995-2002 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+#ifndef _INFCODES_H
+#define _INFCODES_H
+
+struct inflate_codes_state;
+typedef struct inflate_codes_state FAR inflate_codes_statef;
+
+local inflate_codes_statef *inflate_codes_new OF((
+ uInt, uInt,
+ inflate_huft *, inflate_huft *,
+ z_streamp ));
+
+local int inflate_codes OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int));
+
+local void inflate_codes_free OF((
+ inflate_codes_statef *,
+ z_streamp ));
+
+#endif /* _INFCODES_H */
diff --git a/thirdparty/freetype/src/gzip/inffixed.h b/thirdparty/freetype/src/gzip/inffixed.h
new file mode 100644
index 0000000000..4d4760ea00
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/inffixed.h
@@ -0,0 +1,151 @@
+/* inffixed.h -- table for decoding fixed codes
+ * Generated automatically by the maketree.c program
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+local const uInt fixed_bl = 9;
+local const uInt fixed_bd = 5;
+local const inflate_huft fixed_tl[] = {
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
+ };
+local const inflate_huft fixed_td[] = {
+ {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
+ {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
+ {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
+ {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
+ {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
+ {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
+ {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
+ {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
+ };
diff --git a/thirdparty/freetype/src/gzip/inflate.c b/thirdparty/freetype/src/gzip/inflate.c
new file mode 100644
index 0000000000..8877fa3eb2
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/inflate.c
@@ -0,0 +1,273 @@
+/* inflate.c -- zlib interface to inflate modules
+ * Copyright (C) 1995-2002 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+
+#define DONE INFLATE_DONE
+#define BAD INFLATE_BAD
+
+typedef enum {
+ METHOD, /* waiting for method byte */
+ FLAG, /* waiting for flag byte */
+ DICT4, /* four dictionary check bytes to go */
+ DICT3, /* three dictionary check bytes to go */
+ DICT2, /* two dictionary check bytes to go */
+ DICT1, /* one dictionary check byte to go */
+ DICT0, /* waiting for inflateSetDictionary */
+ BLOCKS, /* decompressing blocks */
+ CHECK4, /* four check bytes to go */
+ CHECK3, /* three check bytes to go */
+ CHECK2, /* two check bytes to go */
+ CHECK1, /* one check byte to go */
+ DONE, /* finished check, done */
+ BAD} /* got an error--stay here */
+inflate_mode;
+
+/* inflate private state */
+struct internal_state {
+
+ /* mode */
+ inflate_mode mode; /* current inflate mode */
+
+ /* mode dependent information */
+ union {
+ uInt method; /* if FLAGS, method byte */
+ struct {
+ uLong was; /* computed check value */
+ uLong need; /* stream check value */
+ } check; /* if CHECK, check values to compare */
+ uInt marker; /* if BAD, inflateSync's marker bytes count */
+ } sub; /* submode */
+
+ /* mode independent information */
+ int nowrap; /* flag for no wrapper */
+ uInt wbits; /* log2(window size) (8..15, defaults to 15) */
+ inflate_blocks_statef
+ *blocks; /* current inflate_blocks state */
+
+};
+
+
+ZEXPORT(int) inflateReset( /* z) */
+z_streamp z )
+{
+ if (z == Z_NULL || z->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ z->total_in = z->total_out = 0;
+ z->msg = Z_NULL;
+ z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
+ inflate_blocks_reset(z->state->blocks, z, Z_NULL);
+ Tracev((stderr, "inflate: reset\n"));
+ return Z_OK;
+}
+
+
+ZEXPORT(int) inflateEnd( /* z) */
+z_streamp z )
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
+ return Z_STREAM_ERROR;
+ if (z->state->blocks != Z_NULL)
+ inflate_blocks_free(z->state->blocks, z);
+ ZFREE(z, z->state);
+ z->state = Z_NULL;
+ Tracev((stderr, "inflate: end\n"));
+ return Z_OK;
+}
+
+
+ZEXPORT(int) inflateInit2_( /* z, w, version, stream_size) */
+z_streamp z,
+int w,
+const char *version,
+int stream_size )
+{
+ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+ stream_size != sizeof(z_stream))
+ return Z_VERSION_ERROR;
+
+ /* initialize state */
+ if (z == Z_NULL)
+ return Z_STREAM_ERROR;
+ z->msg = Z_NULL;
+ if (z->zalloc == Z_NULL)
+ {
+ z->zalloc = zcalloc;
+ z->opaque = (voidpf)0;
+ }
+ if (z->zfree == Z_NULL) z->zfree = zcfree;
+ if ((z->state = (struct internal_state FAR *)
+ ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)
+ return Z_MEM_ERROR;
+ z->state->blocks = Z_NULL;
+
+ /* handle undocumented nowrap option (no zlib header or check) */
+ z->state->nowrap = 0;
+ if (w < 0)
+ {
+ w = - w;
+ z->state->nowrap = 1;
+ }
+
+ /* set window size */
+ if (w < 8 || w > 15)
+ {
+ inflateEnd(z);
+ return Z_STREAM_ERROR;
+ }
+ z->state->wbits = (uInt)w;
+
+ /* create inflate_blocks state */
+ if ((z->state->blocks =
+ inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w))
+ == Z_NULL)
+ {
+ inflateEnd(z);
+ return Z_MEM_ERROR;
+ }
+ Tracev((stderr, "inflate: allocated\n"));
+
+ /* reset state */
+ inflateReset(z);
+ return Z_OK;
+}
+
+
+
+#undef NEEDBYTE
+#define NEEDBYTE {if(z->avail_in==0)return r;r=f;}
+
+#undef NEXTBYTE
+#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
+
+
+ZEXPORT(int) inflate( /* z, f) */
+z_streamp z,
+int f )
+{
+ int r;
+ uInt b;
+
+ if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)
+ return Z_STREAM_ERROR;
+ f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
+ r = Z_BUF_ERROR;
+ while (1) switch (z->state->mode)
+ {
+ case METHOD:
+ NEEDBYTE
+ if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"unknown compression method";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"invalid window size";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ z->state->mode = FLAG;
+ case FLAG:
+ NEEDBYTE
+ b = NEXTBYTE;
+ if (((z->state->sub.method << 8) + b) % 31)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"incorrect header check";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ Tracev((stderr, "inflate: zlib header ok\n"));
+ if (!(b & PRESET_DICT))
+ {
+ z->state->mode = BLOCKS;
+ break;
+ }
+ z->state->mode = DICT4;
+ case DICT4:
+ NEEDBYTE
+ z->state->sub.check.need = (uLong)NEXTBYTE << 24;
+ z->state->mode = DICT3;
+ case DICT3:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 16;
+ z->state->mode = DICT2;
+ case DICT2:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 8;
+ z->state->mode = DICT1;
+ case DICT1:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE;
+ z->adler = z->state->sub.check.need;
+ z->state->mode = DICT0;
+ return Z_NEED_DICT;
+ case DICT0:
+ z->state->mode = BAD;
+ z->msg = (char*)"need dictionary";
+ z->state->sub.marker = 0; /* can try inflateSync */
+ return Z_STREAM_ERROR;
+ case BLOCKS:
+ r = inflate_blocks(z->state->blocks, z, r);
+ if (r == Z_DATA_ERROR)
+ {
+ z->state->mode = BAD;
+ z->state->sub.marker = 0; /* can try inflateSync */
+ break;
+ }
+ if (r == Z_OK)
+ r = f;
+ if (r != Z_STREAM_END)
+ return r;
+ r = f;
+ inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
+ if (z->state->nowrap)
+ {
+ z->state->mode = DONE;
+ break;
+ }
+ z->state->mode = CHECK4;
+ case CHECK4:
+ NEEDBYTE
+ z->state->sub.check.need = (uLong)NEXTBYTE << 24;
+ z->state->mode = CHECK3;
+ case CHECK3:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 16;
+ z->state->mode = CHECK2;
+ case CHECK2:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 8;
+ z->state->mode = CHECK1;
+ case CHECK1:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE;
+
+ if (z->state->sub.check.was != z->state->sub.check.need)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"incorrect data check";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ Tracev((stderr, "inflate: zlib check ok\n"));
+ z->state->mode = DONE;
+ case DONE:
+ return Z_STREAM_END;
+ case BAD:
+ return Z_DATA_ERROR;
+ default:
+ return Z_STREAM_ERROR;
+ }
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
+}
+
diff --git a/thirdparty/freetype/src/gzip/inftrees.c b/thirdparty/freetype/src/gzip/inftrees.c
new file mode 100644
index 0000000000..56f52b1701
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/inftrees.c
@@ -0,0 +1,468 @@
+/* inftrees.c -- generate Huffman trees for efficient decoding
+ * Copyright (C) 1995-2002 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+
+#if !defined(BUILDFIXED) && !defined(STDC)
+# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */
+#endif
+
+
+#if 0
+local const char inflate_copyright[] =
+ " inflate 1.1.4 Copyright 1995-2002 Mark Adler ";
+#endif
+/*
+ If you use the zlib library in a product, an acknowledgment is welcome
+ in the documentation of your product. If for some reason you cannot
+ include such an acknowledgment, I would appreciate that you keep this
+ copyright string in the executable of your product.
+ */
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+
+local int huft_build OF((
+ uIntf *, /* code lengths in bits */
+ uInt, /* number of codes */
+ uInt, /* number of "simple" codes */
+ const uIntf *, /* list of base values for non-simple codes */
+ const uIntf *, /* list of extra bits for non-simple codes */
+ inflate_huft * FAR*,/* result: starting table */
+ uIntf *, /* maximum lookup bits (returns actual) */
+ inflate_huft *, /* space for trees */
+ uInt *, /* hufts used in space */
+ uIntf * )); /* space for values */
+
+/* Tables for deflate from PKZIP's appnote.txt. */
+local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+ /* see note #13 above about 258 */
+local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
+ 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */
+local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+ 8193, 12289, 16385, 24577};
+local const uInt cpdext[30] = { /* Extra bits for distance codes */
+ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
+ 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
+ 12, 12, 13, 13};
+
+/*
+ Huffman code decoding is performed using a multi-level table lookup.
+ The fastest way to decode is to simply build a lookup table whose
+ size is determined by the longest code. However, the time it takes
+ to build this table can also be a factor if the data being decoded
+ is not very long. The most common codes are necessarily the
+ shortest codes, so those codes dominate the decoding time, and hence
+ the speed. The idea is you can have a shorter table that decodes the
+ shorter, more probable codes, and then point to subsidiary tables for
+ the longer codes. The time it costs to decode the longer codes is
+ then traded against the time it takes to make longer tables.
+
+ This results of this trade are in the variables lbits and dbits
+ below. lbits is the number of bits the first level table for literal/
+ length codes can decode in one step, and dbits is the same thing for
+ the distance codes. Subsequent tables are also less than or equal to
+ those sizes. These values may be adjusted either when all of the
+ codes are shorter than that, in which case the longest code length in
+ bits is used, or when the shortest code is *longer* than the requested
+ table size, in which case the length of the shortest code in bits is
+ used.
+
+ There are two different values for the two tables, since they code a
+ different number of possibilities each. The literal/length table
+ codes 286 possible values, or in a flat code, a little over eight
+ bits. The distance table codes 30 possible values, or a little less
+ than five bits, flat. The optimum values for speed end up being
+ about one bit more than those, so lbits is 8+1 and dbits is 5+1.
+ The optimum values may differ though from machine to machine, and
+ possibly even between compilers. Your mileage may vary.
+ */
+
+
+/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
+#define BMAX 15 /* maximum bit length of any code */
+
+local int huft_build( /* b, n, s, d, e, t, m, hp, hn, v) */
+uIntf *b, /* code lengths in bits (all assumed <= BMAX) */
+uInt n, /* number of codes (assumed <= 288) */
+uInt s, /* number of simple-valued codes (0..s-1) */
+const uIntf *d, /* list of base values for non-simple codes */
+const uIntf *e, /* list of extra bits for non-simple codes */
+inflate_huft * FAR *t, /* result: starting table */
+uIntf *m, /* maximum lookup bits, returns actual */
+inflate_huft *hp, /* space for trees */
+uInt *hn, /* hufts used in space */
+uIntf *v /* working area: values in order of bit length */
+/* Given a list of code lengths and a maximum table size, make a set of
+ tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
+ if the given code set is incomplete (the tables are still built in this
+ case), or Z_DATA_ERROR if the input is invalid. */
+)
+{
+
+ uInt a; /* counter for codes of length k */
+ uInt c[BMAX+1]; /* bit length count table */
+ uInt f; /* i repeats in table every f entries */
+ int g; /* maximum code length */
+ int h; /* table level */
+ uInt i; /* counter, current code */
+ uInt j; /* counter */
+ int k; /* number of bits in current code */
+ int l; /* bits per table (returned in m) */
+ uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */
+ uIntf *p; /* pointer into c[], b[], or v[] */
+ inflate_huft *q; /* points to current table */
+ struct inflate_huft_s r; /* table entry for structure assignment */
+ inflate_huft *u[BMAX]; /* table stack */
+ int w; /* bits before this table == (l * h) */
+ uInt x[BMAX+1]; /* bit offsets, then code stack */
+ uIntf *xp; /* pointer into x */
+ int y; /* number of dummy codes added */
+ uInt z; /* number of entries in current table */
+
+
+ /* Make compiler happy */
+ r.base = 0;
+
+ /* Generate counts for each bit length */
+ p = c;
+#define C0 *p++ = 0;
+#define C2 C0 C0 C0 C0
+#define C4 C2 C2 C2 C2
+ C4 /* clear c[]--assume BMAX+1 is 16 */
+ p = b; i = n;
+ do {
+ c[*p++]++; /* assume all entries <= BMAX */
+ } while (--i);
+ if (c[0] == n) /* null input--all zero length codes */
+ {
+ *t = (inflate_huft *)Z_NULL;
+ *m = 0;
+ return Z_OK;
+ }
+
+
+ /* Find minimum and maximum length, bound *m by those */
+ l = *m;
+ for (j = 1; j <= BMAX; j++)
+ if (c[j])
+ break;
+ k = j; /* minimum code length */
+ if ((uInt)l < j)
+ l = j;
+ for (i = BMAX; i; i--)
+ if (c[i])
+ break;
+ g = i; /* maximum code length */
+ if ((uInt)l > i)
+ l = i;
+ *m = l;
+
+
+ /* Adjust last length count to fill out codes, if needed */
+ for (y = 1 << j; j < i; j++, y <<= 1)
+ if ((y -= c[j]) < 0)
+ return Z_DATA_ERROR;
+ if ((y -= c[i]) < 0)
+ return Z_DATA_ERROR;
+ c[i] += y;
+
+
+ /* Generate starting offsets into the value table for each length */
+ x[1] = j = 0;
+ p = c + 1; xp = x + 2;
+ while (--i) { /* note that i == g from above */
+ *xp++ = (j += *p++);
+ }
+
+
+ /* Make a table of values in order of bit lengths */
+ p = b; i = 0;
+ do {
+ if ((j = *p++) != 0)
+ v[x[j]++] = i;
+ } while (++i < n);
+ n = x[g]; /* set n to length of v */
+
+
+ /* Generate the Huffman codes and for each, make the table entries */
+ x[0] = i = 0; /* first Huffman code is zero */
+ p = v; /* grab values in bit order */
+ h = -1; /* no tables yet--level -1 */
+ w = -l; /* bits decoded == (l * h) */
+ u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */
+ q = (inflate_huft *)Z_NULL; /* ditto */
+ z = 0; /* ditto */
+
+ /* go through the bit lengths (k already is bits in shortest code) */
+ for (; k <= g; k++)
+ {
+ a = c[k];
+ while (a--)
+ {
+ /* here i is the Huffman code of length k bits for value *p */
+ /* make tables up to required level */
+ while (k > w + l)
+ {
+ h++;
+ w += l; /* previous table always l bits */
+
+ /* compute minimum size table less than or equal to l bits */
+ z = g - w;
+ z = z > (uInt)l ? (uInt)l : z; /* table size upper limit */
+ if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
+ { /* too few codes for k-w bit table */
+ f -= a + 1; /* deduct codes from patterns left */
+ xp = c + k;
+ if (j < z)
+ while (++j < z) /* try smaller tables up to z bits */
+ {
+ if ((f <<= 1) <= *++xp)
+ break; /* enough codes to use up j bits */
+ f -= *xp; /* else deduct codes from patterns */
+ }
+ }
+ z = 1 << j; /* table entries for j-bit table */
+
+ /* allocate new table */
+ if (*hn + z > MANY) /* (note: doesn't matter for fixed) */
+ return Z_DATA_ERROR; /* overflow of MANY */
+ u[h] = q = hp + *hn;
+ *hn += z;
+
+ /* connect to last table, if there is one */
+ if (h)
+ {
+ x[h] = i; /* save pattern for backing up */
+ r.bits = (Byte)l; /* bits to dump before this table */
+ r.exop = (Byte)j; /* bits in this table */
+ j = i >> (w - l);
+ r.base = (uInt)(q - u[h-1] - j); /* offset to this table */
+ u[h-1][j] = r; /* connect to last table */
+ }
+ else
+ *t = q; /* first table is returned result */
+ }
+
+ /* set up table entry in r */
+ r.bits = (Byte)(k - w);
+ if (p >= v + n)
+ r.exop = 128 + 64; /* out of values--invalid code */
+ else if (*p < s)
+ {
+ r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */
+ r.base = *p++; /* simple code is just the value */
+ }
+ else
+ {
+ r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */
+ r.base = d[*p++ - s];
+ }
+
+ /* fill code-like entries with r */
+ f = 1 << (k - w);
+ for (j = i >> w; j < z; j += f)
+ q[j] = r;
+
+ /* backwards increment the k-bit code i */
+ for (j = 1 << (k - 1); i & j; j >>= 1)
+ i ^= j;
+ i ^= j;
+
+ /* backup over finished tables */
+ mask = (1 << w) - 1; /* needed on HP, cc -O bug */
+ while ((i & mask) != x[h])
+ {
+ h--; /* don't need to update q */
+ w -= l;
+ mask = (1 << w) - 1;
+ }
+ }
+ }
+
+
+ /* Return Z_BUF_ERROR if we were given an incomplete table */
+ return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
+}
+
+
+local int inflate_trees_bits( /* c, bb, tb, hp, z) */
+uIntf *c, /* 19 code lengths */
+uIntf *bb, /* bits tree desired/actual depth */
+inflate_huft * FAR *tb, /* bits tree result */
+inflate_huft *hp, /* space for trees */
+z_streamp z /* for messages */
+)
+{
+ int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
+
+ if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+ r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL,
+ tb, bb, hp, &hn, v);
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed dynamic bit lengths tree";
+ else if (r == Z_BUF_ERROR || *bb == 0)
+ {
+ z->msg = (char*)"incomplete dynamic bit lengths tree";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+}
+
+
+local int inflate_trees_dynamic( /* nl, nd, c, bl, bd, tl, td, hp, z) */
+uInt nl, /* number of literal/length codes */
+uInt nd, /* number of distance codes */
+uIntf *c, /* that many (total) code lengths */
+uIntf *bl, /* literal desired/actual bit depth */
+uIntf *bd, /* distance desired/actual bit depth */
+inflate_huft * FAR *tl, /* literal/length tree result */
+inflate_huft * FAR *td, /* distance tree result */
+inflate_huft *hp, /* space for trees */
+z_streamp z /* for messages */
+)
+{
+ int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
+
+ /* allocate work area */
+ if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+
+ /* build literal/length tree */
+ r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v);
+ if (r != Z_OK || *bl == 0)
+ {
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed literal/length tree";
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"incomplete literal/length tree";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+ }
+
+ /* build distance tree */
+ r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v);
+ if (r != Z_OK || (*bd == 0 && nl > 257))
+ {
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed distance tree";
+ else if (r == Z_BUF_ERROR) {
+#if 0
+ {
+#endif
+#ifdef PKZIP_BUG_WORKAROUND
+ r = Z_OK;
+ }
+#else
+ z->msg = (char*)"incomplete distance tree";
+ r = Z_DATA_ERROR;
+ }
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"empty distance tree with lengths";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+#endif
+ }
+
+ /* done */
+ ZFREE(z, v);
+ return Z_OK;
+}
+
+
+/* build fixed tables only once--keep them here */
+#ifdef BUILDFIXED
+local int fixed_built = 0;
+#define FIXEDH 544 /* number of hufts used by fixed tables */
+local inflate_huft fixed_mem[FIXEDH];
+local uInt fixed_bl;
+local uInt fixed_bd;
+local inflate_huft *fixed_tl;
+local inflate_huft *fixed_td;
+#else
+#include "inffixed.h"
+#endif
+
+
+local int inflate_trees_fixed( /* bl, bd, tl, td, z) */
+uIntf *bl, /* literal desired/actual bit depth */
+uIntf *bd, /* distance desired/actual bit depth */
+const inflate_huft * FAR *tl, /* literal/length tree result */
+const inflate_huft * FAR *td, /* distance tree result */
+z_streamp z /* for memory allocation */
+)
+{
+#ifdef BUILDFIXED
+ /* build fixed tables if not already */
+ if (!fixed_built)
+ {
+ int k; /* temporary variable */
+ uInt f = 0; /* number of hufts used in fixed_mem */
+ uIntf *c; /* length list for huft_build */
+ uIntf *v; /* work area for huft_build */
+
+ /* allocate memory */
+ if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+ if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ {
+ ZFREE(z, c);
+ return Z_MEM_ERROR;
+ }
+
+ /* literal table */
+ for (k = 0; k < 144; k++)
+ c[k] = 8;
+ for (; k < 256; k++)
+ c[k] = 9;
+ for (; k < 280; k++)
+ c[k] = 7;
+ for (; k < 288; k++)
+ c[k] = 8;
+ fixed_bl = 9;
+ huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl,
+ fixed_mem, &f, v);
+
+ /* distance table */
+ for (k = 0; k < 30; k++)
+ c[k] = 5;
+ fixed_bd = 5;
+ huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd,
+ fixed_mem, &f, v);
+
+ /* done */
+ ZFREE(z, v);
+ ZFREE(z, c);
+ fixed_built = 1;
+ }
+#else
+ FT_UNUSED(z);
+#endif
+ *bl = fixed_bl;
+ *bd = fixed_bd;
+ *tl = fixed_tl;
+ *td = fixed_td;
+ return Z_OK;
+}
diff --git a/thirdparty/freetype/src/gzip/inftrees.h b/thirdparty/freetype/src/gzip/inftrees.h
new file mode 100644
index 0000000000..07bf2aa0bf
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/inftrees.h
@@ -0,0 +1,63 @@
+/* inftrees.h -- header to use inftrees.c
+ * Copyright (C) 1995-2002 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* Huffman code lookup table entry--this entry is four bytes for machines
+ that have 16-bit pointers (e.g. PC's in the small or medium model). */
+
+#ifndef _INFTREES_H
+#define _INFTREES_H
+
+typedef struct inflate_huft_s FAR inflate_huft;
+
+struct inflate_huft_s {
+ union {
+ struct {
+ Byte Exop; /* number of extra bits or operation */
+ Byte Bits; /* number of bits in this code or subcode */
+ } what;
+ uInt pad; /* pad structure to a power of 2 (4 bytes for */
+ } word; /* 16-bit, 8 bytes for 32-bit int's) */
+ uInt base; /* literal, length base, distance base,
+ or table offset */
+};
+
+/* Maximum size of dynamic tree. The maximum found in a long but non-
+ exhaustive search was 1004 huft structures (850 for length/literals
+ and 154 for distances, the latter actually the result of an
+ exhaustive search). The actual maximum is not known, but the
+ value below is more than safe. */
+#define MANY 1440
+
+local int inflate_trees_bits OF((
+ uIntf *, /* 19 code lengths */
+ uIntf *, /* bits tree desired/actual depth */
+ inflate_huft * FAR *, /* bits tree result */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
+
+local int inflate_trees_dynamic OF((
+ uInt, /* number of literal/length codes */
+ uInt, /* number of distance codes */
+ uIntf *, /* that many (total) code lengths */
+ uIntf *, /* literal desired/actual bit depth */
+ uIntf *, /* distance desired/actual bit depth */
+ inflate_huft * FAR *, /* literal/length tree result */
+ inflate_huft * FAR *, /* distance tree result */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
+
+local int inflate_trees_fixed OF((
+ uIntf *, /* literal desired/actual bit depth */
+ uIntf *, /* distance desired/actual bit depth */
+ const inflate_huft * FAR *, /* literal/length tree result */
+ const inflate_huft * FAR *, /* distance tree result */
+ z_streamp)); /* for memory allocation */
+
+#endif /* _INFTREES_H */
diff --git a/thirdparty/freetype/src/gzip/infutil.c b/thirdparty/freetype/src/gzip/infutil.c
new file mode 100644
index 0000000000..6087b40647
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/infutil.c
@@ -0,0 +1,86 @@
+/* inflate_util.c -- data and routines common to blocks and codes
+ * Copyright (C) 1995-2002 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+#include "inftrees.h"
+#include "infcodes.h"
+#include "infutil.h"
+
+
+/* And'ing with mask[n] masks the lower n bits */
+local const uInt inflate_mask[17] = {
+ 0x0000,
+ 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
+ 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
+};
+
+
+/* copy as much as possible from the sliding window to the output area */
+local int inflate_flush( /* s, z, r) */
+inflate_blocks_statef *s,
+z_streamp z,
+int r )
+{
+ uInt n;
+ Bytef *p;
+ Bytef *q;
+
+ /* local copies of source and destination pointers */
+ p = z->next_out;
+ q = s->read;
+
+ /* compute number of bytes to copy as far as end of window */
+ n = (uInt)((q <= s->write ? s->write : s->end) - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ /* update counters */
+ z->avail_out -= n;
+ z->total_out += n;
+
+ /* update check information */
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ /* copy as far as end of window */
+ zmemcpy(p, q, n);
+ p += n;
+ q += n;
+
+ /* see if more to copy at beginning of window */
+ if (q == s->end)
+ {
+ /* wrap pointers */
+ q = s->window;
+ if (s->write == s->end)
+ s->write = s->window;
+
+ /* compute bytes to copy */
+ n = (uInt)(s->write - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ /* update counters */
+ z->avail_out -= n;
+ z->total_out += n;
+
+ /* update check information */
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ /* copy */
+ zmemcpy(p, q, n);
+ p += n;
+ q += n;
+ }
+
+ /* update pointers */
+ z->next_out = p;
+ s->read = q;
+
+ /* done */
+ return r;
+}
diff --git a/thirdparty/freetype/src/gzip/infutil.h b/thirdparty/freetype/src/gzip/infutil.h
new file mode 100644
index 0000000000..7174b6dd0f
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/infutil.h
@@ -0,0 +1,98 @@
+/* infutil.h -- types and macros common to blocks and codes
+ * Copyright (C) 1995-2002 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+#ifndef _INFUTIL_H
+#define _INFUTIL_H
+
+typedef enum {
+ TYPE, /* get type bits (3, including end bit) */
+ LENS, /* get lengths for stored */
+ STORED, /* processing stored block */
+ TABLE, /* get table lengths */
+ BTREE, /* get bit lengths tree for a dynamic block */
+ DTREE, /* get length, distance trees for a dynamic block */
+ CODES, /* processing fixed or dynamic block */
+ DRY, /* output remaining window bytes */
+ DONE, /* finished last block, done */
+ BAD} /* got a data error--stuck here */
+inflate_block_mode;
+
+/* inflate blocks semi-private state */
+struct inflate_blocks_state {
+
+ /* mode */
+ inflate_block_mode mode; /* current inflate_block mode */
+
+ /* mode dependent information */
+ union {
+ uInt left; /* if STORED, bytes left to copy */
+ struct {
+ uInt table; /* table lengths (14 bits) */
+ uInt index; /* index into blens (or border) */
+ uIntf *blens; /* bit lengths of codes */
+ uInt bb; /* bit length tree depth */
+ inflate_huft *tb; /* bit length decoding tree */
+ } trees; /* if DTREE, decoding info for trees */
+ struct {
+ inflate_codes_statef
+ *codes;
+ } decode; /* if CODES, current state */
+ } sub; /* submode */
+ uInt last; /* true if this block is the last block */
+
+ /* mode independent information */
+ uInt bitk; /* bits in bit buffer */
+ uLong bitb; /* bit buffer */
+ inflate_huft *hufts; /* single malloc for tree space */
+ Bytef *window; /* sliding window */
+ Bytef *end; /* one byte after sliding window */
+ Bytef *read; /* window read pointer */
+ Bytef *write; /* window write pointer */
+ check_func checkfn; /* check function */
+ uLong check; /* check on output */
+
+};
+
+
+/* defines for inflate input/output */
+/* update pointers and return */
+#define UPDBITS {s->bitb=b;s->bitk=k;}
+#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
+#define UPDOUT {s->write=q;}
+#define UPDATE {UPDBITS UPDIN UPDOUT}
+#define LEAVE {UPDATE return inflate_flush(s,z,r);}
+/* get bytes and bits */
+#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
+#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
+#define NEXTBYTE (n--,*p++)
+#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
+#define DUMPBITS(j) {b>>=(j);k-=(j);}
+/* output bytes */
+#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q)
+#define LOADOUT {q=s->write;m=(uInt)WAVAIL;}
+#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
+#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
+#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
+#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
+/* load local pointers */
+#define LOAD {LOADIN LOADOUT}
+
+/* masks for lower bits (size given to avoid silly warnings with Visual C++) */
+#ifndef NO_INFLATE_MASK
+local uInt inflate_mask[17];
+#endif
+
+/* copy as much as possible from the sliding window to the output area */
+local int inflate_flush OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int));
+
+#endif
diff --git a/thirdparty/freetype/src/gzip/rules.mk b/thirdparty/freetype/src/gzip/rules.mk
new file mode 100644
index 0000000000..bc7d5fa631
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/rules.mk
@@ -0,0 +1,83 @@
+#
+# FreeType 2 GZip support configuration rules
+#
+
+
+# Copyright 2002-2017 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT. By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
+
+# gzip driver directory
+#
+GZIP_DIR := $(SRC_DIR)/gzip
+
+
+# compilation flags for the driver
+#
+ifeq ($(SYSTEM_ZLIB),)
+ GZIP_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(GZIP_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
+else
+ GZIP_COMPILE := $(CC) $(ANSIFLAGS) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
+endif
+
+
+# gzip support sources
+#
+# All source and header files get loaded by `ftgzip.c' only if SYSTEM_ZLIB
+# is not defined (regardless whether we have a `single' or a `multi' build).
+# However, it doesn't harm if we add everything as a dependency
+# unconditionally.
+#
+GZIP_DRV_SRCS := $(GZIP_DIR)/adler32.c \
+ $(GZIP_DIR)/ftzconf.h \
+ $(GZIP_DIR)/infblock.c \
+ $(GZIP_DIR)/infblock.h \
+ $(GZIP_DIR)/infcodes.c \
+ $(GZIP_DIR)/infcodes.h \
+ $(GZIP_DIR)/inffixed.h \
+ $(GZIP_DIR)/inflate.c \
+ $(GZIP_DIR)/inftrees.c \
+ $(GZIP_DIR)/inftrees.h \
+ $(GZIP_DIR)/infutil.c \
+ $(GZIP_DIR)/infutil.h \
+ $(GZIP_DIR)/zlib.h \
+ $(GZIP_DIR)/zutil.c \
+ $(GZIP_DIR)/zutil.h
+
+
+# gzip driver object(s)
+#
+# GZIP_DRV_OBJ is used during both `single' and `multi' builds
+#
+GZIP_DRV_OBJ := $(OBJ_DIR)/ftgzip.$O
+
+
+# gzip main source file
+#
+GZIP_DRV_SRC := $(GZIP_DIR)/ftgzip.c
+
+
+# gzip support - object
+#
+$(GZIP_DRV_OBJ): $(GZIP_DRV_SRC) $(GZIP_DRV_SRCS) $(FREETYPE_H)
+ $(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GZIP_DRV_SRC))
+
+
+# update main driver object lists
+#
+DRV_OBJS_S += $(GZIP_DRV_OBJ)
+DRV_OBJS_M += $(GZIP_DRV_OBJ)
+
+
+# EOF
diff --git a/thirdparty/freetype/src/gzip/zlib.h b/thirdparty/freetype/src/gzip/zlib.h
new file mode 100644
index 0000000000..a4e82c6a02
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/zlib.h
@@ -0,0 +1,830 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+ version 1.1.4, March 11th, 2002
+
+ Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+
+ The data format used by the zlib library is described by RFCs (Request for
+ Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
+ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef _ZLIB_H
+#define _ZLIB_H
+
+#include "ftzconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.1.4"
+
+/*
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed
+ data. This version of the library supports only one compression method
+ (deflation) but other algorithms will be added later and will have the same
+ stream interface.
+
+ Compression can be done in a single step if the buffers are large
+ enough (for example if an input file is mmap'ed), or can be done by
+ repeated calls of the compression function. In the latter case, the
+ application must provide more input and/or consume the output
+ (providing more output space) before each call.
+
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never
+ crash even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void (*free_func) OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ Bytef *next_in; /* next input byte */
+ uInt avail_in; /* number of bytes available at next_in */
+ uLong total_in; /* total nb of input bytes read so far */
+
+ Bytef *next_out; /* next output byte should be put there */
+ uInt avail_out; /* remaining free space at next_out */
+ uLong total_out; /* total nb of bytes output so far */
+
+ char *msg; /* last error message, NULL if no error */
+ struct internal_state FAR *state; /* not visible by applications */
+
+ alloc_func zalloc; /* used to allocate the internal state */
+ free_func zfree; /* used to free the internal state */
+ voidpf opaque; /* private data object passed to zalloc and zfree */
+
+ int data_type; /* best guess about the data type: ascii or binary */
+ uLong adler; /* adler32 value of the uncompressed data */
+ uLong reserved; /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+ The application must update next_in and avail_in when avail_in has
+ dropped to zero. It must update next_out and avail_out when avail_out
+ has dropped to zero. The application must initialize zalloc, zfree and
+ opaque before calling the init function. All other fields are set by the
+ compression library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
+ opaque value.
+
+ zalloc must return Z_NULL if there is not enough memory for the object.
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
+ thread safe.
+
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this
+ if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
+ pointers returned by zalloc for objects of exactly 65536 bytes *must*
+ have their offset normalized to zero. The default allocation function
+ provided by this library ensures this (see zutil.c). To reduce memory
+ requirements and avoid any allocation of 64K objects, at the expense of
+ compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or
+ progress reports. After compression, total_in holds the total size of
+ the uncompressed data and may be saved for use in the decompressor
+ (particularly if the decompressor wants to decompress everything in
+ a single step).
+*/
+
+ /* constants */
+
+#define Z_NO_FLUSH 0
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_SYNC_FLUSH 2
+#define Z_FULL_FLUSH 3
+#define Z_FINISH 4
+/* Allowed flush values; see deflate() below for details */
+
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative
+ * values are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+/* compression levels */
+
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_DEFAULT_STRATEGY 0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY 0
+#define Z_ASCII 1
+#define Z_UNKNOWN 2
+/* Possible values of the data_type field */
+
+#define Z_DEFLATED 8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+
+
+ /* basic functions */
+
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+ If the first character differs, the library code actually used is
+ not compatible with the zlib.h header file used by the application.
+ This check is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN(int) deflateInit OF((z_streamp strm, int level));
+
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller.
+ If zalloc and zfree are set to Z_NULL, deflateInit updates them to
+ use default allocation functions.
+
+ The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at
+ all (the input data is simply copied a block at a time).
+ Z_DEFAULT_COMPRESSION requests a default compromise between speed and
+ compression (currently equivalent to level 6).
+
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+ Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+ with the version assumed by the caller (ZLIB_VERSION).
+ msg is set to null if there is no error message. deflateInit does not
+ perform any compression: this will be done by deflate().
+*/
+
+
+/*
+ deflate compresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce some
+ output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. deflate performs one or both of the
+ following actions:
+
+ - Compress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in and avail_in are updated and
+ processing will resume at this point for the next call of deflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. This action is forced if the parameter flush is non zero.
+ Forcing flush frequently degrades the compression ratio, so this parameter
+ should be set only when necessary (in interactive applications).
+ Some output may be provided even if flush is not set.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating avail_in or avail_out accordingly; avail_out
+ should never be zero before the call. The application can consume the
+ compressed output when it wants, for example when the output buffer is full
+ (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
+ and with zero avail_out, it must be called again after making room in the
+ output buffer because there might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+ flushed to the output buffer and the output is aligned on a byte boundary, so
+ that the decompressor can get all input data available so far. (In particular
+ avail_in is zero after the call if enough output space has been provided
+ before the call.) Flushing may degrade compression for some compression
+ algorithms and so it should be used only when necessary.
+
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+ restart from this point if previous compressed data has been damaged or if
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ the compression.
+
+ If deflate returns with avail_out == 0, this function must be called again
+ with the same value of the flush parameter and more output space (updated
+ avail_out), until the flush is complete (deflate returns with non-zero
+ avail_out).
+
+ If the parameter flush is set to Z_FINISH, pending input is processed,
+ pending output is flushed and deflate returns with Z_STREAM_END if there
+ was enough output space; if deflate returns with Z_OK, this function must be
+ called again with Z_FINISH and more output space (updated avail_out) but no
+ more input data, until it returns with Z_STREAM_END or an error. After
+ deflate has returned Z_STREAM_END, the only possible operations on the
+ stream are deflateReset or deflateEnd.
+
+ Z_FINISH can be used immediately after deflateInit if all the compression
+ is to be done in a single step. In this case, avail_out must be at least
+ 0.1% larger than avail_in plus 12 bytes. If deflate does not return
+ Z_STREAM_END, then it must be called again as described above.
+
+ deflate() sets strm->adler to the adler32 checksum of all input read
+ so far (that is, total_in bytes).
+
+ deflate() may update data_type if it can make a good guess about
+ the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
+ binary. This field is only for information purposes and does not affect
+ the compression algorithm in any manner.
+
+ deflate() returns Z_OK if some progress has been made (more input
+ processed or more output produced), Z_STREAM_END if all input has been
+ consumed and all output has been produced (only when flush is set to
+ Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+ if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero).
+*/
+
+
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+ stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+ prematurely (some input or output was discarded). In the error case,
+ msg may be set but then points to a static string (which must not be
+ deallocated).
+*/
+
+
+/*
+ZEXTERN(int) inflateInit OF((z_streamp strm));
+
+ Initializes the internal stream state for decompression. The fields
+ next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+ value depends on the compression method), inflateInit determines the
+ compression method from the zlib header and allocates all data structures
+ accordingly; otherwise the allocation will be deferred to the first call of
+ inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+ use default allocation functions.
+
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller. msg is set to null if there is no error
+ message. inflateInit does not perform any decompression apart from reading
+ the zlib header if present: this will be done by inflate(). (So next_in and
+ avail_in may be modified, but next_out and avail_out are unchanged.)
+*/
+
+
+ZEXTERN(int) inflate OF((z_streamp strm, int flush));
+/*
+ inflate decompresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may some
+ introduce some output latency (reading input without producing any output)
+ except when forced to flush.
+
+ The detailed semantics are as follows. inflate performs one or both of the
+ following actions:
+
+ - Decompress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in is updated and processing
+ will resume at this point for the next call of inflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. inflate() provides as much output as possible, until there
+ is no more input data or no more space in the output buffer (see below
+ about the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating the next_* and avail_* values accordingly.
+ The application can consume the uncompressed output when it wants, for
+ example when the output buffer is full (avail_out == 0), or after each
+ call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+ must be called again after making room in the output buffer because there
+ might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
+ output as possible to the output buffer. The flushing behavior of inflate is
+ not specified for values of the flush parameter other than Z_SYNC_FLUSH
+ and Z_FINISH, but the current implementation actually flushes as much output
+ as possible anyway.
+
+ inflate() should normally be called until it returns Z_STREAM_END or an
+ error. However if all decompression is to be performed in a single step
+ (a single call of inflate), the parameter flush should be set to
+ Z_FINISH. In this case all pending input is processed and all pending
+ output is flushed; avail_out must be large enough to hold all the
+ uncompressed data. (The size of the uncompressed data may have been saved
+ by the compressor for this purpose.) The next operation on this stream must
+ be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+ is never required, but can be used to inform inflate that a faster routine
+ may be used for the single inflate() call.
+
+ If a preset dictionary is needed at this point (see inflateSetDictionary
+ below), inflate sets strm-adler to the adler32 checksum of the
+ dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
+ it sets strm->adler to the adler32 checksum of all output produced
+ so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
+ an error code as described below. At the end of the stream, inflate()
+ checks that its computed adler32 checksum is equal to that saved by the
+ compressor and returns Z_STREAM_END only if the checksum is correct.
+
+ inflate() returns Z_OK if some progress has been made (more input processed
+ or more output produced), Z_STREAM_END if the end of the compressed data has
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+ corrupted (input stream not conforming to the zlib format or incorrect
+ adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
+ (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if no progress is possible or if there was not
+ enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
+ case, the application may then call inflateSync to look for a good
+ compression block.
+*/
+
+
+ZEXTERN(int) inflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+ was inconsistent. In the error case, msg may be set but then points to a
+ static string (which must not be deallocated).
+*/
+
+ /* Advanced functions */
+
+/*
+ The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN(int) deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
+
+ This is another version of deflateInit with more compression options. The
+ fields next_in, zalloc, zfree and opaque must be initialized before by
+ the caller.
+
+ The method parameter is the compression method. It must be Z_DEFLATED in
+ this version of the library.
+
+ The windowBits parameter is the base two logarithm of the window size
+ (the size of the history buffer). It should be in the range 8..15 for this
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
+ deflateInit is used instead.
+
+ The memLevel parameter specifies how much memory should be allocated
+ for the internal compression state. memLevel=1 uses minimum memory but
+ is slow and reduces compression ratio; memLevel=9 uses maximum memory
+ for optimal speed. The default value is 8. See zconf.h for total memory
+ usage as a function of windowBits and memLevel.
+
+ The strategy parameter is used to tune the compression algorithm. Use the
+ value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+ filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
+ string match). Filtered data consists mostly of small values with a
+ somewhat random distribution. In this case, the compression algorithm is
+ tuned to compress them better. The effect of Z_FILTERED is to force more
+ Huffman coding and less string matching; it is somewhat intermediate
+ between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
+ the compression ratio but not the correctness of the compressed output even
+ if it is not set appropriately.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+ method). msg is set to null if there is no error message. deflateInit2 does
+ not perform any compression: this will be done by deflate().
+*/
+
+/*
+ Initializes the compression dictionary from the given byte sequence
+ without producing any compressed output. This function must be called
+ immediately after deflateInit, deflateInit2 or deflateReset, before any
+ call of deflate. The compressor and decompressor must use exactly the same
+ dictionary (see inflateSetDictionary).
+
+ The dictionary should consist of strings (byte sequences) that are likely
+ to be encountered later in the data to be compressed, with the most commonly
+ used strings preferably put towards the end of the dictionary. Using a
+ dictionary is most useful when the data to be compressed is short and can be
+ predicted with good accuracy; the data can then be compressed better than
+ with the default empty dictionary.
+
+ Depending on the size of the compression data structures selected by
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
+ discarded, for example if the dictionary is larger than the window size in
+ deflate or deflate2. Thus the strings most likely to be useful should be
+ put at the end of the dictionary, not at the front.
+
+ Upon return of this function, strm->adler is set to the Adler32 value
+ of the dictionary; the decompressor may later use this value to determine
+ which dictionary has been used by the compressor. (The Adler32 value
+ applies to the whole dictionary even if only a subset of the dictionary is
+ actually used by the compressor.)
+
+ deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent (for example if deflate has already been called for this stream
+ or if the compression method is bsort). deflateSetDictionary does not
+ perform any compression: this will be done by deflate().
+*/
+
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when several compression strategies will be
+ tried, for example when there are several ways of pre-processing the input
+ data with a filter. The streams that will be discarded should then be freed
+ by calling deflateEnd. Note that deflateCopy duplicates the internal
+ compression state which can be quite large, so this strategy is slow and
+ can consume lots of memory.
+
+ deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+/*
+ This function is equivalent to deflateEnd followed by deflateInit,
+ but does not free and reallocate all the internal compression state.
+ The stream will keep the same compression level and any other attributes
+ that may have been set by deflateInit2.
+
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+/*
+ Dynamically update the compression level and compression strategy. The
+ interpretation of level and strategy is as in deflateInit2. This can be
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different
+ strategy. If the compression level is changed, the input available so far
+ is compressed with the old level (and may be flushed); the new level will
+ take effect only at the next call of deflate().
+
+ Before the call of deflateParams, the stream state must be set as for
+ a call of deflate(), since the currently available input may have to
+ be compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+ deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+ stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
+ if strm->avail_out was zero.
+*/
+
+/*
+ZEXTERN(int) inflateInit2 OF((z_streamp strm,
+ int windowBits));
+
+ This is another version of inflateInit with an extra parameter. The
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+ before by the caller.
+
+ The windowBits parameter is the base two logarithm of the maximum window
+ size (the size of the history buffer). It should be in the range 8..15 for
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. If a compressed stream with a larger window size is given as
+ input, inflate() will return with the error code Z_DATA_ERROR instead of
+ trying to allocate a larger window.
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
+ memLevel). msg is set to null if there is no error message. inflateInit2
+ does not perform any decompression apart from reading the zlib header if
+ present: this will be done by inflate(). (So next_in and avail_in may be
+ modified, but next_out and avail_out are unchanged.)
+*/
+
+/*
+ Initializes the decompression dictionary from the given uncompressed byte
+ sequence. This function must be called immediately after a call of inflate
+ if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the Adler32 value returned by this call of
+ inflate. The compressor and decompressor must use exactly the same
+ dictionary (see deflateSetDictionary).
+
+ inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+ expected one (incorrect Adler32 value). inflateSetDictionary does not
+ perform any decompression: this will be done by subsequent calls of
+ inflate().
+*/
+
+/*
+ Skips invalid compressed data until a full flush point (see above the
+ description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+ if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+ or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+ case, the application may save the current value of total_in which
+ indicates where valid compressed data was found. In the error case, the
+ application may repeatedly call inflateSync, providing more input each time,
+ until success or end of the input data.
+*/
+
+ZEXTERN(int) inflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to inflateEnd followed by inflateInit,
+ but does not free and reallocate all the internal decompression state.
+ The stream will keep attributes that may have been set by inflateInit2.
+
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+
+ /* utility functions */
+
+/*
+ The following utility functions are implemented on top of the
+ basic stream-oriented functions. To simplify the interface, some
+ default options are assumed (compression level and memory usage,
+ standard memory allocation functions). The source code of these
+ utility functions can easily be modified if you need special options.
+*/
+
+/*
+ Compresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be at least 0.1% larger than
+ sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
+ compressed buffer.
+ This function can be used to compress a whole file at once if the
+ input file is mmap'ed.
+ compress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer.
+*/
+
+/*
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+/*
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be large enough to hold the
+ entire uncompressed data. (The size of the uncompressed data must have
+ been saved previously by the compressor and transmitted to the decompressor
+ by some mechanism outside the scope of this compression library.)
+ Upon exit, destLen is the actual size of the compressed buffer.
+ This function can be used to decompress a whole file at once if the
+ input file is mmap'ed.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted.
+*/
+
+
+/*
+ Opens a gzip (.gz) file for reading or writing. The mode parameter
+ is as in fopen ("rb" or "wb") but can also include a compression level
+ ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
+ Huffman only compression as in "wb1h". (See the description
+ of deflateInit2 for more information about the strategy parameter.)
+
+ gzopen can be used to read a file which is not in gzip format; in this
+ case gzread will directly read from the file without decompression.
+
+ gzopen returns NULL if the file could not be opened or if there was
+ insufficient memory to allocate the (de)compression state; errno
+ can be checked to distinguish the two cases (if errno is zero, the
+ zlib error is Z_MEM_ERROR). */
+
+/*
+ gzdopen() associates a gzFile with the file descriptor fd. File
+ descriptors are obtained from calls like open, dup, creat, pipe or
+ fileno (in the file has been previously opened with fopen).
+ The mode parameter is as in gzopen.
+ The next call of gzclose on the returned gzFile will also close the
+ file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
+ descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
+ gzdopen returns NULL if there was insufficient memory to allocate
+ the (de)compression state.
+*/
+
+/*
+ Dynamically update the compression level or strategy. See the description
+ of deflateInit2 for the meaning of these parameters.
+ gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+ opened for writing.
+*/
+
+/*
+ Reads the given number of uncompressed bytes from the compressed file.
+ If the input file was not in gzip format, gzread copies the given number
+ of bytes into the buffer.
+ gzread returns the number of uncompressed bytes actually read (0 for
+ end of file, -1 for error). */
+
+/*
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of uncompressed bytes actually written
+ (0 in case of error).
+*/
+
+/*
+ Converts, formats, and writes the args to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written (0 in case of error).
+*/
+
+/*
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+/*
+ Reads bytes from the compressed file until len-1 characters are read, or
+ a newline character is read and transferred to buf, or an end-of-file
+ condition is encountered. The string is then terminated with a null
+ character.
+ gzgets returns buf, or Z_NULL in case of error.
+*/
+
+/*
+ Writes c, converted to an unsigned char, into the compressed file.
+ gzputc returns the value that was written, or -1 in case of error.
+*/
+
+/*
+ Reads one byte from the compressed file. gzgetc returns this byte
+ or -1 in case of end of file or error.
+*/
+
+/*
+ Flushes all pending output into the compressed file. The parameter
+ flush is as in the deflate() function. The return value is the zlib
+ error number (see function gzerror below). gzflush returns Z_OK if
+ the flush parameter is Z_FINISH and all output could be flushed.
+ gzflush should be called only when strictly necessary because it can
+ degrade compression.
+*/
+
+/*
+ Sets the starting position for the next gzread or gzwrite on the
+ given compressed file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
+ the value SEEK_END is not supported.
+ If the file is opened for reading, this function is emulated but can be
+ extremely slow. If the file is opened for writing, only forward seeks are
+ supported; gzseek then compresses a sequence of zeroes up to the new
+ starting position.
+
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error, in
+ particular if the file is opened for writing and the new starting position
+ would be before the current position.
+*/
+
+/*
+ Rewinds the given file. This function is supported only for reading.
+
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+/*
+ Returns the starting position for the next gzread or gzwrite on the
+ given compressed file. This position represents a number of bytes in the
+ uncompressed data stream.
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+/*
+ Returns 1 when EOF has previously been detected reading the given
+ input stream, otherwise zero.
+*/
+
+/*
+ Flushes all pending output if necessary, closes the compressed file
+ and deallocates all the (de)compression state. The return value is the zlib
+ error number (see function gzerror below).
+*/
+
+/*
+ Returns the error message for the last error which occurred on the
+ given compressed file. errnum is set to zlib error number. If an
+ error occurred in the file system and not in the compression library,
+ errnum is set to Z_ERRNO and the application may consult errno
+ to get the exact error code.
+*/
+
+ /* checksum functions */
+
+/*
+ These functions are not related to compression but are exported
+ anyway because they might be useful in applications using the
+ compression library.
+*/
+
+ZEXTERN(uLong) adler32 OF((uLong adler, const Bytef *buf, uInt len));
+
+/*
+ Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+ return the updated checksum. If buf is NULL, this function returns
+ the required initial value for the checksum.
+ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+ much faster. Usage example:
+
+ uLong adler = adler32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ adler = adler32(adler, buffer, length);
+ }
+ if (adler != original_adler) error();
+*/
+
+/*
+ Update a running crc with the bytes buf[0..len-1] and return the updated
+ crc. If buf is NULL, this function returns the required initial value
+ for the crc. Pre- and post-conditioning (one's complement) is performed
+ within this function so it shouldn't be done by the application.
+ Usage example:
+
+ uLong crc = crc32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ crc = crc32(crc, buffer, length);
+ }
+ if (crc != original_crc) error();
+*/
+
+
+ /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN(int) inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
+#define deflateInit(strm, level) \
+ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+ inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZLIB_H */
diff --git a/thirdparty/freetype/src/gzip/zutil.c b/thirdparty/freetype/src/gzip/zutil.c
new file mode 100644
index 0000000000..7ad0c1f81b
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/zutil.c
@@ -0,0 +1,181 @@
+/* zutil.c -- target dependent utility functions for the compression library
+ * Copyright (C) 1995-2002 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#include "zutil.h"
+
+#ifndef STDC
+extern void exit OF((int));
+#endif
+
+
+#ifndef HAVE_MEMCPY
+
+void zmemcpy(dest, source, len)
+ Bytef* dest;
+ const Bytef* source;
+ uInt len;
+{
+ if (len == 0) return;
+ do {
+ *dest++ = *source++; /* ??? to be unrolled */
+ } while (--len != 0);
+}
+
+int zmemcmp(s1, s2, len)
+ const Bytef* s1;
+ const Bytef* s2;
+ uInt len;
+{
+ uInt j;
+
+ for (j = 0; j < len; j++) {
+ if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
+ }
+ return 0;
+}
+
+void zmemzero(dest, len)
+ Bytef* dest;
+ uInt len;
+{
+ if (len == 0) return;
+ do {
+ *dest++ = 0; /* ??? to be unrolled */
+ } while (--len != 0);
+}
+#endif
+
+#if defined( MSDOS ) && defined( __TURBOC__ ) && !defined( MY_ZCALLOC )
+#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__)
+/* Small and medium model in Turbo C are for now limited to near allocation
+ * with reduced MAX_WBITS and MAX_MEM_LEVEL
+ */
+# define MY_ZCALLOC
+
+/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
+ * and farmalloc(64K) returns a pointer with an offset of 8, so we
+ * must fix the pointer. Warning: the pointer must be put back to its
+ * original form in order to free it, use zcfree().
+ */
+
+#define MAX_PTR 10
+/* 10*64K = 640K */
+
+local int next_ptr = 0;
+
+typedef struct ptr_table_s {
+ voidpf org_ptr;
+ voidpf new_ptr;
+} ptr_table;
+
+local ptr_table table[MAX_PTR];
+/* This table is used to remember the original form of pointers
+ * to large buffers (64K). Such pointers are normalized with a zero offset.
+ * Since MSDOS is not a preemptive multitasking OS, this table is not
+ * protected from concurrent access. This hack doesn't work anyway on
+ * a protected system like OS/2. Use Microsoft C instead.
+ */
+
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+ voidpf buf = opaque; /* just to make some compilers happy */
+ ulg bsize = (ulg)items*size;
+
+ /* If we allocate less than 65520 bytes, we assume that farmalloc
+ * will return a usable pointer which doesn't have to be normalized.
+ */
+ if (bsize < 65520L) {
+ buf = farmalloc(bsize);
+ if (*(ush*)&buf != 0) return buf;
+ } else {
+ buf = farmalloc(bsize + 16L);
+ }
+ if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
+ table[next_ptr].org_ptr = buf;
+
+ /* Normalize the pointer to seg:0 */
+ *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
+ *(ush*)&buf = 0;
+ table[next_ptr++].new_ptr = buf;
+ return buf;
+}
+
+void zcfree (voidpf opaque, voidpf ptr)
+{
+ int n;
+ if (*(ush*)&ptr != 0) { /* object < 64K */
+ farfree(ptr);
+ return;
+ }
+ /* Find the original pointer */
+ for (n = 0; n < next_ptr; n++) {
+ if (ptr != table[n].new_ptr) continue;
+
+ farfree(table[n].org_ptr);
+ while (++n < next_ptr) {
+ table[n-1] = table[n];
+ }
+ next_ptr--;
+ return;
+ }
+ ptr = opaque; /* just to make some compilers happy */
+ Assert(0, "zcfree: ptr not found");
+}
+#endif
+#endif /* MSDOS && __TURBOC__ */
+
+
+#if defined(M_I86) && !defined(__32BIT__) && !defined( MY_ZCALLOC )
+/* Microsoft C in 16-bit mode */
+
+# define MY_ZCALLOC
+
+#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
+# define _halloc halloc
+# define _hfree hfree
+#endif
+
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+ if (opaque) opaque = 0; /* to make compiler happy */
+ return _halloc((long)items, size);
+}
+
+void zcfree (voidpf opaque, voidpf ptr)
+{
+ if (opaque) opaque = 0; /* to make compiler happy */
+ _hfree(ptr);
+}
+
+#endif /* MSC */
+
+
+#ifndef MY_ZCALLOC /* Any system without a special alloc function */
+
+#ifndef STDC
+extern voidp ft_scalloc OF((uInt items, uInt size));
+extern void ft_sfree OF((voidpf ptr));
+#endif
+
+voidpf zcalloc (opaque, items, size)
+ voidpf opaque;
+ unsigned items;
+ unsigned size;
+{
+ if (opaque) items += size - size; /* make compiler happy */
+ return (voidpf)ft_scalloc(items, size);
+}
+
+void zcfree (opaque, ptr)
+ voidpf opaque;
+ voidpf ptr;
+{
+ ft_sfree(ptr);
+ if (opaque) return; /* make compiler happy */
+}
+
+#endif /* MY_ZCALLOC */
diff --git a/thirdparty/freetype/src/gzip/zutil.h b/thirdparty/freetype/src/gzip/zutil.h
new file mode 100644
index 0000000000..c9688cd9c0
--- /dev/null
+++ b/thirdparty/freetype/src/gzip/zutil.h
@@ -0,0 +1,215 @@
+/* zutil.h -- internal interface and configuration of the compression library
+ * Copyright (C) 1995-2002 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id$ */
+
+#ifndef _Z_UTIL_H
+#define _Z_UTIL_H
+
+#include "zlib.h"
+
+#ifdef STDC
+# include <stddef.h>
+# include <string.h>
+# include <stdlib.h>
+#endif
+#ifdef NO_ERRNO_H
+ extern int errno;
+#else
+# include <errno.h>
+#endif
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+typedef unsigned char uch;
+typedef uch FAR uchf;
+typedef unsigned short ush;
+typedef ush FAR ushf;
+typedef unsigned long ulg;
+
+
+#define ERR_RETURN(strm,err) \
+ return (strm->msg = (char*)ERR_MSG(err), (err))
+/* To be used only when the state is known to be valid */
+
+ /* common constants */
+
+#ifndef DEF_WBITS
+# define DEF_WBITS MAX_WBITS
+#endif
+/* default windowBits for decompression. MAX_WBITS is for compression only */
+
+#if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+#else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+/* default memLevel */
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES 2
+/* The three kinds of block type */
+
+#define MIN_MATCH 3
+#define MAX_MATCH 258
+/* The minimum and maximum match lengths */
+
+#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+
+ /* target dependencies */
+
+#ifdef MSDOS
+# define OS_CODE 0x00
+# if defined(__TURBOC__) || defined(__BORLANDC__)
+# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+ /* Allow compilation with ANSI keywords only enabled */
+ void _Cdecl farfree( void *block );
+ void *_Cdecl farmalloc( unsigned long nbytes );
+# else
+# include <alloc.h>
+# endif
+# else /* MSC or DJGPP */
+# endif
+#endif
+
+#ifdef OS2
+# define OS_CODE 0x06
+#endif
+
+#ifdef WIN32 /* Window 95 & Windows NT */
+# define OS_CODE 0x0b
+#endif
+
+#if defined(VAXC) || defined(VMS)
+# define OS_CODE 0x02
+# define F_OPEN(name, mode) \
+ ft_fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
+#endif
+
+#ifdef AMIGA
+# define OS_CODE 0x01
+#endif
+
+#if defined(ATARI) || defined(atarist)
+# define OS_CODE 0x05
+#endif
+
+#if defined(MACOS) || defined(TARGET_OS_MAC)
+# define OS_CODE 0x07
+# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+# include <unix.h> /* for fdopen */
+# else
+# ifndef fdopen
+# define fdopen(fd,mode) NULL /* No fdopen() */
+# endif
+# endif
+#endif
+
+#ifdef __50SERIES /* Prime/PRIMOS */
+# define OS_CODE 0x0F
+#endif
+
+#ifdef TOPS20
+# define OS_CODE 0x0a
+#endif
+
+#if defined(_BEOS_) || defined(RISCOS)
+# define fdopen(fd,mode) NULL /* No fdopen() */
+#endif
+
+#if (defined(_MSC_VER) && (_MSC_VER > 600))
+# define fdopen(fd,type) _fdopen(fd,type)
+#endif
+
+
+ /* Common defaults */
+
+#ifndef OS_CODE
+# define OS_CODE 0x03 /* assume Unix */
+#endif
+
+#ifndef F_OPEN
+# define F_OPEN(name, mode) ft_fopen((name), (mode))
+#endif
+
+ /* functions */
+
+#ifdef HAVE_STRERROR
+ extern char *strerror OF((int));
+# define zstrerror(errnum) strerror(errnum)
+#else
+# define zstrerror(errnum) ""
+#endif
+
+#if defined(pyr)
+# define NO_MEMCPY
+#endif
+#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
+ /* Use our own functions for small and medium model with MSC <= 5.0.
+ * You may have to use the same strategy for Borland C (untested).
+ * The __SC__ check is for Symantec.
+ */
+# define NO_MEMCPY
+#endif
+#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
+# define HAVE_MEMCPY
+#endif
+#ifdef HAVE_MEMCPY
+# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
+# define zmemcpy _fmemcpy
+# define zmemcmp _fmemcmp
+# define zmemzero(dest, len) _fmemset(dest, 0, len)
+# else
+# define zmemcpy ft_memcpy
+# define zmemcmp ft_memcmp
+# define zmemzero(dest, len) ft_memset(dest, 0, len)
+# endif
+#else
+ extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+ extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+ extern void zmemzero OF((Bytef* dest, uInt len));
+#endif
+
+/* Diagnostic functions */
+#ifdef DEBUG
+# include <stdio.h>
+ extern int z_verbose;
+ extern void z_error OF((char *m));
+# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+# define Trace(x) {if (z_verbose>=0) fprintf x ;}
+# define Tracev(x) {if (z_verbose>0) fprintf x ;}
+# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
+#else
+# define Assert(cond,msg)
+# define Trace(x)
+# define Tracev(x)
+# define Tracevv(x)
+# define Tracec(c,x)
+# define Tracecv(c,x)
+#endif
+
+
+typedef uLong (*check_func) OF((uLong check, const Bytef *buf,
+ uInt len));
+local voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
+local void zcfree OF((voidpf opaque, voidpf ptr));
+
+#define ZALLOC(strm, items, size) \
+ (*((strm)->zalloc))((strm)->opaque, (items), (size))
+#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
+#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+
+#endif /* _Z_UTIL_H */
diff --git a/thirdparty/freetype/src/lzw/ftlzw.c b/thirdparty/freetype/src/lzw/ftlzw.c
new file mode 100644
index 0000000000..941f6cef4c
--- /dev/null
+++ b/thirdparty/freetype/src/lzw/ftlzw.c
@@ -0,0 +1,420 @@
+/***************************************************************************/
+/* */
+/* ftlzw.c */
+/* */
+/* FreeType support for .Z compressed files. */
+/* */
+/* This optional component relies on NetBSD's zopen(). It should mainly */
+/* be used to parse compressed PCF fonts, as found with many X11 server */
+/* distributions. */
+/* */
+/* Copyright 2004-2017 by */
+/* Albert Chin-A-Young. */
+/* */
+/* based on code in `src/gzip/ftgzip.c' */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+#include <ft2build.h>
+#include FT_INTERNAL_MEMORY_H
+#include FT_INTERNAL_STREAM_H
+#include FT_INTERNAL_DEBUG_H
+#include FT_LZW_H
+#include FT_CONFIG_STANDARD_LIBRARY_H
+
+
+#include FT_MODULE_ERRORS_H
+
+#undef FTERRORS_H_
+
+#undef FT_ERR_PREFIX
+#define FT_ERR_PREFIX LZW_Err_
+#define FT_ERR_BASE FT_Mod_Err_LZW
+
+#include FT_ERRORS_H
+
+
+#ifdef FT_CONFIG_OPTION_USE_LZW
+
+#ifdef FT_CONFIG_OPTION_PIC
+#error "lzw code does not support PIC yet"
+#endif
+
+#include "ftzopen.h"
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***** *****/
+/***** M E M O R Y M A N A G E M E N T *****/
+/***** *****/
+/***************************************************************************/
+/***************************************************************************/
+
+/***************************************************************************/
+/***************************************************************************/
+/***** *****/
+/***** F I L E D E S C R I P T O R *****/
+/***** *****/
+/***************************************************************************/
+/***************************************************************************/
+
+#define FT_LZW_BUFFER_SIZE 4096
+
+ typedef struct FT_LZWFileRec_
+ {
+ FT_Stream source; /* parent/source stream */
+ FT_Stream stream; /* embedding stream */
+ FT_Memory memory; /* memory allocator */
+ FT_LzwStateRec lzw; /* lzw decompressor state */
+
+ FT_Byte buffer[FT_LZW_BUFFER_SIZE]; /* output buffer */
+ FT_ULong pos; /* position in output */
+ FT_Byte* cursor;
+ FT_Byte* limit;
+
+ } FT_LZWFileRec, *FT_LZWFile;
+
+
+ /* check and skip .Z header */
+ static FT_Error
+ ft_lzw_check_header( FT_Stream stream )
+ {
+ FT_Error error;
+ FT_Byte head[2];
+
+
+ if ( FT_STREAM_SEEK( 0 ) ||
+ FT_STREAM_READ( head, 2 ) )
+ goto Exit;
+
+ /* head[0] && head[1] are the magic numbers */
+ if ( head[0] != 0x1F ||
+ head[1] != 0x9D )
+ error = FT_THROW( Invalid_File_Format );
+
+ Exit:
+ return error;
+ }
+
+
+ static FT_Error
+ ft_lzw_file_init( FT_LZWFile zip,
+ FT_Stream stream,
+ FT_Stream source )
+ {
+ FT_LzwState lzw = &zip->lzw;
+ FT_Error error;
+
+
+ zip->stream = stream;
+ zip->source = source;
+ zip->memory = stream->memory;
+
+ zip->limit = zip->buffer + FT_LZW_BUFFER_SIZE;
+ zip->cursor = zip->limit;
+ zip->pos = 0;
+
+ /* check and skip .Z header */
+ error = ft_lzw_check_header( source );
+ if ( error )
+ goto Exit;
+
+ /* initialize internal lzw variable */
+ ft_lzwstate_init( lzw, source );
+
+ Exit:
+ return error;
+ }
+
+
+ static void
+ ft_lzw_file_done( FT_LZWFile zip )
+ {
+ /* clear the rest */
+ ft_lzwstate_done( &zip->lzw );
+
+ zip->memory = NULL;
+ zip->source = NULL;
+ zip->stream = NULL;
+ }
+
+
+ static FT_Error
+ ft_lzw_file_reset( FT_LZWFile zip )
+ {
+ FT_Stream stream = zip->source;
+ FT_Error error;
+
+
+ if ( !FT_STREAM_SEEK( 0 ) )
+ {
+ ft_lzwstate_reset( &zip->lzw );
+
+ zip->limit = zip->buffer + FT_LZW_BUFFER_SIZE;
+ zip->cursor = zip->limit;
+ zip->pos = 0;
+ }
+
+ return error;
+ }
+
+
+ static FT_Error
+ ft_lzw_file_fill_output( FT_LZWFile zip )
+ {
+ FT_LzwState lzw = &zip->lzw;
+ FT_ULong count;
+ FT_Error error = FT_Err_Ok;
+
+
+ zip->cursor = zip->buffer;
+
+ count = ft_lzwstate_io( lzw, zip->buffer, FT_LZW_BUFFER_SIZE );
+
+ zip->limit = zip->cursor + count;
+
+ if ( count == 0 )
+ error = FT_THROW( Invalid_Stream_Operation );
+
+ return error;
+ }
+
+
+ /* fill output buffer; `count' must be <= FT_LZW_BUFFER_SIZE */
+ static FT_Error
+ ft_lzw_file_skip_output( FT_LZWFile zip,
+ FT_ULong count )
+ {
+ FT_Error error = FT_Err_Ok;
+
+
+ /* first, we skip what we can from the output buffer */
+ {
+ FT_ULong delta = (FT_ULong)( zip->limit - zip->cursor );
+
+
+ if ( delta >= count )
+ delta = count;
+
+ zip->cursor += delta;
+ zip->pos += delta;
+
+ count -= delta;
+ }
+
+ /* next, we skip as many bytes remaining as possible */
+ while ( count > 0 )
+ {
+ FT_ULong delta = FT_LZW_BUFFER_SIZE;
+ FT_ULong numread;
+
+
+ if ( delta > count )
+ delta = count;
+
+ numread = ft_lzwstate_io( &zip->lzw, NULL, delta );
+ if ( numread < delta )
+ {
+ /* not enough bytes */
+ error = FT_THROW( Invalid_Stream_Operation );
+ break;
+ }
+
+ zip->pos += delta;
+ count -= delta;
+ }
+
+ return error;
+ }
+
+
+ static FT_ULong
+ ft_lzw_file_io( FT_LZWFile zip,
+ FT_ULong pos,
+ FT_Byte* buffer,
+ FT_ULong count )
+ {
+ FT_ULong result = 0;
+ FT_Error error;
+
+
+ /* seeking backwards. */
+ if ( pos < zip->pos )
+ {
+ /* If the new position is within the output buffer, simply */
+ /* decrement pointers, otherwise we reset the stream completely! */
+ if ( ( zip->pos - pos ) <= (FT_ULong)( zip->cursor - zip->buffer ) )
+ {
+ zip->cursor -= zip->pos - pos;
+ zip->pos = pos;
+ }
+ else
+ {
+ error = ft_lzw_file_reset( zip );
+ if ( error )
+ goto Exit;
+ }
+ }
+
+ /* skip unwanted bytes */
+ if ( pos > zip->pos )
+ {
+ error = ft_lzw_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) );
+ if ( error )
+ goto Exit;
+ }
+
+ if ( count == 0 )
+ goto Exit;
+
+ /* now read the data */
+ for (;;)
+ {
+ FT_ULong delta;
+
+
+ delta = (FT_ULong)( zip->limit - zip->cursor );
+ if ( delta >= count )
+ delta = count;
+
+ FT_MEM_COPY( buffer + result, zip->cursor, delta );
+ result += delta;
+ zip->cursor += delta;
+ zip->pos += delta;
+
+ count -= delta;
+ if ( count == 0 )
+ break;
+
+ error = ft_lzw_file_fill_output( zip );
+ if ( error )
+ break;
+ }
+
+ Exit:
+ return result;
+ }
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***** *****/
+/***** L Z W E M B E D D I N G S T R E A M *****/
+/***** *****/
+/***************************************************************************/
+/***************************************************************************/
+
+ static void
+ ft_lzw_stream_close( FT_Stream stream )
+ {
+ FT_LZWFile zip = (FT_LZWFile)stream->descriptor.pointer;
+ FT_Memory memory = stream->memory;
+
+
+ if ( zip )
+ {
+ /* finalize lzw file descriptor */
+ ft_lzw_file_done( zip );
+
+ FT_FREE( zip );
+
+ stream->descriptor.pointer = NULL;
+ }
+ }
+
+
+ static unsigned long
+ ft_lzw_stream_io( FT_Stream stream,
+ unsigned long offset,
+ unsigned char* buffer,
+ unsigned long count )
+ {
+ FT_LZWFile zip = (FT_LZWFile)stream->descriptor.pointer;
+
+
+ return ft_lzw_file_io( zip, offset, buffer, count );
+ }
+
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Stream_OpenLZW( FT_Stream stream,
+ FT_Stream source )
+ {
+ FT_Error error;
+ FT_Memory memory;
+ FT_LZWFile zip = NULL;
+
+
+ if ( !stream || !source )
+ {
+ error = FT_THROW( Invalid_Stream_Handle );
+ goto Exit;
+ }
+
+ memory = source->memory;
+
+ /*
+ * Check the header right now; this prevents allocation of a huge
+ * LZWFile object (400 KByte of heap memory) if not necessary.
+ *
+ * Did I mention that you should never use .Z compressed font
+ * files?
+ */
+ error = ft_lzw_check_header( source );
+ if ( error )
+ goto Exit;
+
+ FT_ZERO( stream );
+ stream->memory = memory;
+
+ if ( !FT_NEW( zip ) )
+ {
+ error = ft_lzw_file_init( zip, stream, source );
+ if ( error )
+ {
+ FT_FREE( zip );
+ goto Exit;
+ }
+
+ stream->descriptor.pointer = zip;
+ }
+
+ stream->size = 0x7FFFFFFFL; /* don't know the real size! */
+ stream->pos = 0;
+ stream->base = 0;
+ stream->read = ft_lzw_stream_io;
+ stream->close = ft_lzw_stream_close;
+
+ Exit:
+ return error;
+ }
+
+
+#include "ftzopen.c"
+
+
+#else /* !FT_CONFIG_OPTION_USE_LZW */
+
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Stream_OpenLZW( FT_Stream stream,
+ FT_Stream source )
+ {
+ FT_UNUSED( stream );
+ FT_UNUSED( source );
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+
+#endif /* !FT_CONFIG_OPTION_USE_LZW */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/lzw/ftzopen.c b/thirdparty/freetype/src/lzw/ftzopen.c
new file mode 100644
index 0000000000..486c546c14
--- /dev/null
+++ b/thirdparty/freetype/src/lzw/ftzopen.c
@@ -0,0 +1,424 @@
+/***************************************************************************/
+/* */
+/* ftzopen.c */
+/* */
+/* FreeType support for .Z compressed files. */
+/* */
+/* This optional component relies on NetBSD's zopen(). It should mainly */
+/* be used to parse compressed PCF fonts, as found with many X11 server */
+/* distributions. */
+/* */
+/* Copyright 2005-2017 by */
+/* David Turner. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+#include "ftzopen.h"
+#include FT_INTERNAL_MEMORY_H
+#include FT_INTERNAL_STREAM_H
+#include FT_INTERNAL_DEBUG_H
+
+
+ static int
+ ft_lzwstate_refill( FT_LzwState state )
+ {
+ FT_ULong count;
+
+
+ if ( state->in_eof )
+ return -1;
+
+ count = FT_Stream_TryRead( state->source,
+ state->buf_tab,
+ state->num_bits ); /* WHY? */
+
+ state->buf_size = (FT_UInt)count;
+ state->buf_total += count;
+ state->in_eof = FT_BOOL( count < state->num_bits );
+ state->buf_offset = 0;
+
+ state->buf_size <<= 3;
+ if ( state->buf_size > state->num_bits )
+ state->buf_size -= state->num_bits - 1;
+ else
+ return -1; /* not enough data */
+
+ if ( count == 0 ) /* end of file */
+ return -1;
+
+ return 0;
+ }
+
+
+ static FT_Int32
+ ft_lzwstate_get_code( FT_LzwState state )
+ {
+ FT_UInt num_bits = state->num_bits;
+ FT_UInt offset = state->buf_offset;
+ FT_Byte* p;
+ FT_Int result;
+
+
+ if ( state->buf_clear ||
+ offset >= state->buf_size ||
+ state->free_ent >= state->free_bits )
+ {
+ if ( state->free_ent >= state->free_bits )
+ {
+ state->num_bits = ++num_bits;
+ if ( num_bits > LZW_MAX_BITS )
+ return -1;
+
+ state->free_bits = state->num_bits < state->max_bits
+ ? (FT_UInt)( ( 1UL << num_bits ) - 256 )
+ : state->max_free + 1;
+ }
+
+ if ( state->buf_clear )
+ {
+ state->num_bits = num_bits = LZW_INIT_BITS;
+ state->free_bits = (FT_UInt)( ( 1UL << num_bits ) - 256 );
+ state->buf_clear = 0;
+ }
+
+ if ( ft_lzwstate_refill( state ) < 0 )
+ return -1;
+
+ offset = 0;
+ }
+
+ state->buf_offset = offset + num_bits;
+
+ p = &state->buf_tab[offset >> 3];
+ offset &= 7;
+ result = *p++ >> offset;
+ offset = 8 - offset;
+ num_bits -= offset;
+
+ if ( num_bits >= 8 )
+ {
+ result |= *p++ << offset;
+ offset += 8;
+ num_bits -= 8;
+ }
+ if ( num_bits > 0 )
+ result |= ( *p & LZW_MASK( num_bits ) ) << offset;
+
+ return result;
+ }
+
+
+ /* grow the character stack */
+ static int
+ ft_lzwstate_stack_grow( FT_LzwState state )
+ {
+ if ( state->stack_top >= state->stack_size )
+ {
+ FT_Memory memory = state->memory;
+ FT_Error error;
+ FT_Offset old_size = state->stack_size;
+ FT_Offset new_size = old_size;
+
+ new_size = new_size + ( new_size >> 1 ) + 4;
+
+ if ( state->stack == state->stack_0 )
+ {
+ state->stack = NULL;
+ old_size = 0;
+ }
+
+ /* requirement of the character stack larger than 1<<LZW_MAX_BITS */
+ /* implies bug in the decompression code */
+ if ( new_size > ( 1 << LZW_MAX_BITS ) )
+ {
+ new_size = 1 << LZW_MAX_BITS;
+ if ( new_size == old_size )
+ return -1;
+ }
+
+ if ( FT_RENEW_ARRAY( state->stack, old_size, new_size ) )
+ return -1;
+
+ state->stack_size = new_size;
+ }
+ return 0;
+ }
+
+
+ /* grow the prefix/suffix arrays */
+ static int
+ ft_lzwstate_prefix_grow( FT_LzwState state )
+ {
+ FT_UInt old_size = state->prefix_size;
+ FT_UInt new_size = old_size;
+ FT_Memory memory = state->memory;
+ FT_Error error;
+
+
+ if ( new_size == 0 ) /* first allocation -> 9 bits */
+ new_size = 512;
+ else
+ new_size += new_size >> 2; /* don't grow too fast */
+
+ /*
+ * Note that the `suffix' array is located in the same memory block
+ * pointed to by `prefix'.
+ *
+ * I know that sizeof(FT_Byte) == 1 by definition, but it is clearer
+ * to write it literally.
+ *
+ */
+ if ( FT_REALLOC_MULT( state->prefix, old_size, new_size,
+ sizeof ( FT_UShort ) + sizeof ( FT_Byte ) ) )
+ return -1;
+
+ /* now adjust `suffix' and move the data accordingly */
+ state->suffix = (FT_Byte*)( state->prefix + new_size );
+
+ FT_MEM_MOVE( state->suffix,
+ state->prefix + old_size,
+ old_size * sizeof ( FT_Byte ) );
+
+ state->prefix_size = new_size;
+ return 0;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ ft_lzwstate_reset( FT_LzwState state )
+ {
+ state->in_eof = 0;
+ state->buf_offset = 0;
+ state->buf_size = 0;
+ state->buf_clear = 0;
+ state->buf_total = 0;
+ state->stack_top = 0;
+ state->num_bits = LZW_INIT_BITS;
+ state->phase = FT_LZW_PHASE_START;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ ft_lzwstate_init( FT_LzwState state,
+ FT_Stream source )
+ {
+ FT_ZERO( state );
+
+ state->source = source;
+ state->memory = source->memory;
+
+ state->prefix = NULL;
+ state->suffix = NULL;
+ state->prefix_size = 0;
+
+ state->stack = state->stack_0;
+ state->stack_size = sizeof ( state->stack_0 );
+
+ ft_lzwstate_reset( state );
+ }
+
+
+ FT_LOCAL_DEF( void )
+ ft_lzwstate_done( FT_LzwState state )
+ {
+ FT_Memory memory = state->memory;
+
+
+ ft_lzwstate_reset( state );
+
+ if ( state->stack != state->stack_0 )
+ FT_FREE( state->stack );
+
+ FT_FREE( state->prefix );
+ state->suffix = NULL;
+
+ FT_ZERO( state );
+ }
+
+
+#define FTLZW_STACK_PUSH( c ) \
+ FT_BEGIN_STMNT \
+ if ( state->stack_top >= state->stack_size && \
+ ft_lzwstate_stack_grow( state ) < 0 ) \
+ goto Eof; \
+ \
+ state->stack[state->stack_top++] = (FT_Byte)(c); \
+ FT_END_STMNT
+
+
+ FT_LOCAL_DEF( FT_ULong )
+ ft_lzwstate_io( FT_LzwState state,
+ FT_Byte* buffer,
+ FT_ULong out_size )
+ {
+ FT_ULong result = 0;
+
+ FT_UInt old_char = state->old_char;
+ FT_UInt old_code = state->old_code;
+ FT_UInt in_code = state->in_code;
+
+
+ if ( out_size == 0 )
+ goto Exit;
+
+ switch ( state->phase )
+ {
+ case FT_LZW_PHASE_START:
+ {
+ FT_Byte max_bits;
+ FT_Int32 c;
+
+
+ /* skip magic bytes, and read max_bits + block_flag */
+ if ( FT_Stream_Seek( state->source, 2 ) != 0 ||
+ FT_Stream_TryRead( state->source, &max_bits, 1 ) != 1 )
+ goto Eof;
+
+ state->max_bits = max_bits & LZW_BIT_MASK;
+ state->block_mode = max_bits & LZW_BLOCK_MASK;
+ state->max_free = (FT_UInt)( ( 1UL << state->max_bits ) - 256 );
+
+ if ( state->max_bits > LZW_MAX_BITS )
+ goto Eof;
+
+ state->num_bits = LZW_INIT_BITS;
+ state->free_ent = ( state->block_mode ? LZW_FIRST
+ : LZW_CLEAR ) - 256;
+ in_code = 0;
+
+ state->free_bits = state->num_bits < state->max_bits
+ ? (FT_UInt)( ( 1UL << state->num_bits ) - 256 )
+ : state->max_free + 1;
+
+ c = ft_lzwstate_get_code( state );
+ if ( c < 0 || c > 255 )
+ goto Eof;
+
+ old_code = old_char = (FT_UInt)c;
+
+ if ( buffer )
+ buffer[result] = (FT_Byte)old_char;
+
+ if ( ++result >= out_size )
+ goto Exit;
+
+ state->phase = FT_LZW_PHASE_CODE;
+ }
+ /* fall-through */
+
+ case FT_LZW_PHASE_CODE:
+ {
+ FT_Int32 c;
+ FT_UInt code;
+
+
+ NextCode:
+ c = ft_lzwstate_get_code( state );
+ if ( c < 0 )
+ goto Eof;
+
+ code = (FT_UInt)c;
+
+ if ( code == LZW_CLEAR && state->block_mode )
+ {
+ /* why not LZW_FIRST-256 ? */
+ state->free_ent = ( LZW_FIRST - 1 ) - 256;
+ state->buf_clear = 1;
+
+ /* not quite right, but at least more predictable */
+ old_code = 0;
+ old_char = 0;
+
+ goto NextCode;
+ }
+
+ in_code = code; /* save code for later */
+
+ if ( code >= 256U )
+ {
+ /* special case for KwKwKwK */
+ if ( code - 256U >= state->free_ent )
+ {
+ /* corrupted LZW stream */
+ if ( code - 256U > state->free_ent )
+ goto Eof;
+
+ FTLZW_STACK_PUSH( old_char );
+ code = old_code;
+ }
+
+ while ( code >= 256U )
+ {
+ if ( !state->prefix )
+ goto Eof;
+
+ FTLZW_STACK_PUSH( state->suffix[code - 256] );
+ code = state->prefix[code - 256];
+ }
+ }
+
+ old_char = code;
+ FTLZW_STACK_PUSH( old_char );
+
+ state->phase = FT_LZW_PHASE_STACK;
+ }
+ /* fall-through */
+
+ case FT_LZW_PHASE_STACK:
+ {
+ while ( state->stack_top > 0 )
+ {
+ state->stack_top--;
+
+ if ( buffer )
+ buffer[result] = state->stack[state->stack_top];
+
+ if ( ++result == out_size )
+ goto Exit;
+ }
+
+ /* now create new entry */
+ if ( state->free_ent < state->max_free )
+ {
+ if ( state->free_ent >= state->prefix_size &&
+ ft_lzwstate_prefix_grow( state ) < 0 )
+ goto Eof;
+
+ FT_ASSERT( state->free_ent < state->prefix_size );
+
+ state->prefix[state->free_ent] = (FT_UShort)old_code;
+ state->suffix[state->free_ent] = (FT_Byte) old_char;
+
+ state->free_ent += 1;
+ }
+
+ old_code = in_code;
+
+ state->phase = FT_LZW_PHASE_CODE;
+ goto NextCode;
+ }
+
+ default: /* state == EOF */
+ ;
+ }
+
+ Exit:
+ state->old_code = old_code;
+ state->old_char = old_char;
+ state->in_code = in_code;
+
+ return result;
+
+ Eof:
+ state->phase = FT_LZW_PHASE_EOF;
+ goto Exit;
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/lzw/ftzopen.h b/thirdparty/freetype/src/lzw/ftzopen.h
new file mode 100644
index 0000000000..a108862c0a
--- /dev/null
+++ b/thirdparty/freetype/src/lzw/ftzopen.h
@@ -0,0 +1,172 @@
+/***************************************************************************/
+/* */
+/* ftzopen.h */
+/* */
+/* FreeType support for .Z compressed files. */
+/* */
+/* This optional component relies on NetBSD's zopen(). It should mainly */
+/* be used to parse compressed PCF fonts, as found with many X11 server */
+/* distributions. */
+/* */
+/* Copyright 2005-2017 by */
+/* David Turner. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+#ifndef FTZOPEN_H_
+#define FTZOPEN_H_
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+ /*
+ * This is a complete re-implementation of the LZW file reader,
+ * since the old one was incredibly badly written, using
+ * 400 KByte of heap memory before decompressing anything.
+ *
+ */
+
+#define FT_LZW_IN_BUFF_SIZE 64
+#define FT_LZW_DEFAULT_STACK_SIZE 64
+
+#define LZW_INIT_BITS 9
+#define LZW_MAX_BITS 16
+
+#define LZW_CLEAR 256
+#define LZW_FIRST 257
+
+#define LZW_BIT_MASK 0x1F
+#define LZW_BLOCK_MASK 0x80
+#define LZW_MASK( n ) ( ( 1U << (n) ) - 1U )
+
+
+ typedef enum FT_LzwPhase_
+ {
+ FT_LZW_PHASE_START = 0,
+ FT_LZW_PHASE_CODE,
+ FT_LZW_PHASE_STACK,
+ FT_LZW_PHASE_EOF
+
+ } FT_LzwPhase;
+
+
+ /*
+ * state of LZW decompressor
+ *
+ * small technical note
+ * --------------------
+ *
+ * We use a few tricks in this implementation that are explained here to
+ * ease debugging and maintenance.
+ *
+ * - First of all, the `prefix' and `suffix' arrays contain the suffix
+ * and prefix for codes over 256; this means that
+ *
+ * prefix_of(code) == state->prefix[code-256]
+ * suffix_of(code) == state->suffix[code-256]
+ *
+ * Each prefix is a 16-bit code, and each suffix an 8-bit byte.
+ *
+ * Both arrays are stored in a single memory block, pointed to by
+ * `state->prefix'. This means that the following equality is always
+ * true:
+ *
+ * state->suffix == (FT_Byte*)(state->prefix + state->prefix_size)
+ *
+ * Of course, state->prefix_size is the number of prefix/suffix slots
+ * in the arrays, corresponding to codes 256..255+prefix_size.
+ *
+ * - `free_ent' is the index of the next free entry in the `prefix'
+ * and `suffix' arrays. This means that the corresponding `next free
+ * code' is really `256+free_ent'.
+ *
+ * Moreover, `max_free' is the maximum value that `free_ent' can reach.
+ *
+ * `max_free' corresponds to `(1 << max_bits) - 256'. Note that this
+ * value is always <= 0xFF00, which means that both `free_ent' and
+ * `max_free' can be stored in an FT_UInt variable, even on 16-bit
+ * machines.
+ *
+ * If `free_ent == max_free', you cannot add new codes to the
+ * prefix/suffix table.
+ *
+ * - `num_bits' is the current number of code bits, starting at 9 and
+ * growing each time `free_ent' reaches the value of `free_bits'. The
+ * latter is computed as follows
+ *
+ * if num_bits < max_bits:
+ * free_bits = (1 << num_bits)-256
+ * else:
+ * free_bits = max_free + 1
+ *
+ * Since the value of `max_free + 1' can never be reached by
+ * `free_ent', `num_bits' cannot grow larger than `max_bits'.
+ */
+
+ typedef struct FT_LzwStateRec_
+ {
+ FT_LzwPhase phase;
+ FT_Int in_eof;
+
+ FT_Byte buf_tab[16];
+ FT_UInt buf_offset;
+ FT_UInt buf_size;
+ FT_Bool buf_clear;
+ FT_Offset buf_total;
+
+ FT_UInt max_bits; /* max code bits, from file header */
+ FT_Int block_mode; /* block mode flag, from file header */
+ FT_UInt max_free; /* (1 << max_bits) - 256 */
+
+ FT_UInt num_bits; /* current code bit number */
+ FT_UInt free_ent; /* index of next free entry */
+ FT_UInt free_bits; /* if reached by free_ent, increment num_bits */
+ FT_UInt old_code;
+ FT_UInt old_char;
+ FT_UInt in_code;
+
+ FT_UShort* prefix; /* always dynamically allocated / reallocated */
+ FT_Byte* suffix; /* suffix = (FT_Byte*)(prefix + prefix_size) */
+ FT_UInt prefix_size; /* number of slots in `prefix' or `suffix' */
+
+ FT_Byte* stack; /* character stack */
+ FT_UInt stack_top;
+ FT_Offset stack_size;
+ FT_Byte stack_0[FT_LZW_DEFAULT_STACK_SIZE]; /* minimize heap alloc */
+
+ FT_Stream source; /* source stream */
+ FT_Memory memory;
+
+ } FT_LzwStateRec, *FT_LzwState;
+
+
+ FT_LOCAL( void )
+ ft_lzwstate_init( FT_LzwState state,
+ FT_Stream source );
+
+ FT_LOCAL( void )
+ ft_lzwstate_done( FT_LzwState state );
+
+
+ FT_LOCAL( void )
+ ft_lzwstate_reset( FT_LzwState state );
+
+
+ FT_LOCAL( FT_ULong )
+ ft_lzwstate_io( FT_LzwState state,
+ FT_Byte* buffer,
+ FT_ULong out_size );
+
+/* */
+
+#endif /* FTZOPEN_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/lzw/rules.mk b/thirdparty/freetype/src/lzw/rules.mk
new file mode 100644
index 0000000000..e7bf68a065
--- /dev/null
+++ b/thirdparty/freetype/src/lzw/rules.mk
@@ -0,0 +1,72 @@
+#
+# FreeType 2 LZW support configuration rules
+#
+
+
+# Copyright 2004-2017 by
+# Albert Chin-A-Young.
+#
+# based on `src/lzw/rules.mk'
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT. By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
+
+# LZW driver directory
+#
+LZW_DIR := $(SRC_DIR)/lzw
+
+
+# compilation flags for the driver
+#
+LZW_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(LZW_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
+
+
+# LZW support sources (i.e., C files)
+#
+LZW_DRV_SRC := $(LZW_DIR)/ftlzw.c
+
+# LZW support headers
+#
+LZW_DRV_H := $(LZW_DIR)/ftzopen.h \
+ $(LZW_DIR)/ftzopen.c
+
+
+# LZW driver object(s)
+#
+# LZW_DRV_OBJ_M is used during `multi' builds
+# LZW_DRV_OBJ_S is used during `single' builds
+#
+LZW_DRV_OBJ_M := $(OBJ_DIR)/ftlzw.$O
+LZW_DRV_OBJ_S := $(OBJ_DIR)/ftlzw.$O
+
+# LZW support source file for single build
+#
+LZW_DRV_SRC_S := $(LZW_DIR)/ftlzw.c
+
+
+# LZW support - single object
+#
+$(LZW_DRV_OBJ_S): $(LZW_DRV_SRC_S) $(LZW_DRV_SRC) $(FREETYPE_H) $(LZW_DRV_H)
+ $(LZW_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(LZW_DRV_SRC_S))
+
+
+# LZW support - multiple objects
+#
+$(OBJ_DIR)/%.$O: $(LZW_DIR)/%.c $(FREETYPE_H) $(LZW_DRV_H)
+ $(LZW_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
+
+
+# update main driver object lists
+#
+DRV_OBJS_S += $(LZW_DRV_OBJ_S)
+DRV_OBJS_M += $(LZW_DRV_OBJ_M)
+
+
+# EOF
diff --git a/thirdparty/freetype/src/otvalid/module.mk b/thirdparty/freetype/src/otvalid/module.mk
index b929cdbab0..5ee1265db8 100644
--- a/thirdparty/freetype/src/otvalid/module.mk
+++ b/thirdparty/freetype/src/otvalid/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004-2016 by
+# Copyright 2004-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/otvalid/otvalid.c b/thirdparty/freetype/src/otvalid/otvalid.c
index 932a974a31..312751a1f4 100644
--- a/thirdparty/freetype/src/otvalid/otvalid.c
+++ b/thirdparty/freetype/src/otvalid/otvalid.c
@@ -4,7 +4,7 @@
/* */
/* FreeType validator for OpenType tables (body only). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -15,8 +15,8 @@
/* */
/***************************************************************************/
-#define FT_MAKE_OPTION_SINGLE_OBJECT
+#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
#include "otvbase.c"
@@ -28,4 +28,5 @@
#include "otvmath.c"
#include "otvmod.c"
+
/* END */
diff --git a/thirdparty/freetype/src/otvalid/otvalid.h b/thirdparty/freetype/src/otvalid/otvalid.h
index 93438a0639..f2969ccccc 100644
--- a/thirdparty/freetype/src/otvalid/otvalid.h
+++ b/thirdparty/freetype/src/otvalid/otvalid.h
@@ -4,7 +4,7 @@
/* */
/* OpenType table validation (specification only). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvbase.c b/thirdparty/freetype/src/otvalid/otvbase.c
index e86e8bb2f0..3adad8439c 100644
--- a/thirdparty/freetype/src/otvalid/otvbase.c
+++ b/thirdparty/freetype/src/otvalid/otvbase.c
@@ -4,7 +4,7 @@
/* */
/* OpenType BASE table validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvcommn.c b/thirdparty/freetype/src/otvalid/otvcommn.c
index 2e88e102be..3407d2ad4a 100644
--- a/thirdparty/freetype/src/otvalid/otvcommn.c
+++ b/thirdparty/freetype/src/otvalid/otvcommn.c
@@ -4,7 +4,7 @@
/* */
/* OpenType common tables validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -68,7 +68,7 @@
OTV_LIMIT_CHECK( GlyphCount * 2 ); /* GlyphArray */
- for ( i = 0; i < GlyphCount; ++i )
+ for ( i = 0; i < GlyphCount; i++ )
{
FT_UInt gid;
diff --git a/thirdparty/freetype/src/otvalid/otvcommn.h b/thirdparty/freetype/src/otvalid/otvcommn.h
index 44e0c63793..10a603ebb9 100644
--- a/thirdparty/freetype/src/otvalid/otvcommn.h
+++ b/thirdparty/freetype/src/otvalid/otvcommn.h
@@ -4,7 +4,7 @@
/* */
/* OpenType common tables validation (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otverror.h b/thirdparty/freetype/src/otvalid/otverror.h
index e7c8db0d58..699903987c 100644
--- a/thirdparty/freetype/src/otvalid/otverror.h
+++ b/thirdparty/freetype/src/otvalid/otverror.h
@@ -4,7 +4,7 @@
/* */
/* OpenType validation module error codes (specification only). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvgdef.c b/thirdparty/freetype/src/otvalid/otvgdef.c
index f19e300e51..27b9a69ca8 100644
--- a/thirdparty/freetype/src/otvalid/otvgdef.c
+++ b/thirdparty/freetype/src/otvalid/otvgdef.c
@@ -4,7 +4,7 @@
/* */
/* OpenType GDEF table validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvgpos.c b/thirdparty/freetype/src/otvalid/otvgpos.c
index e904ea5d6c..0fbcc2077c 100644
--- a/thirdparty/freetype/src/otvalid/otvgpos.c
+++ b/thirdparty/freetype/src/otvalid/otvgpos.c
@@ -4,7 +4,7 @@
/* */
/* OpenType GPOS table validation (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvgpos.h b/thirdparty/freetype/src/otvalid/otvgpos.h
index 2c09e64f97..99b0ad3915 100644
--- a/thirdparty/freetype/src/otvalid/otvgpos.h
+++ b/thirdparty/freetype/src/otvalid/otvgpos.h
@@ -4,7 +4,7 @@
/* */
/* OpenType GPOS table validator (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvgsub.c b/thirdparty/freetype/src/otvalid/otvgsub.c
index c2b28569f1..f9bd8dc5d8 100644
--- a/thirdparty/freetype/src/otvalid/otvgsub.c
+++ b/thirdparty/freetype/src/otvalid/otvgsub.c
@@ -4,7 +4,7 @@
/* */
/* OpenType GSUB table validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvjstf.c b/thirdparty/freetype/src/otvalid/otvjstf.c
index e19c1c1213..57a38f95c9 100644
--- a/thirdparty/freetype/src/otvalid/otvjstf.c
+++ b/thirdparty/freetype/src/otvalid/otvjstf.c
@@ -4,7 +4,7 @@
/* */
/* OpenType JSTF table validation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvmath.c b/thirdparty/freetype/src/otvalid/otvmath.c
index 6c785b6fda..a14d369700 100644
--- a/thirdparty/freetype/src/otvalid/otvmath.c
+++ b/thirdparty/freetype/src/otvalid/otvmath.c
@@ -4,7 +4,7 @@
/* */
/* OpenType MATH table validation (body). */
/* */
-/* Copyright 2007-2016 by */
+/* Copyright 2007-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Written by George Williams. */
@@ -60,7 +60,7 @@
table_size = 2 * ( 56 + 51 );
p += 4 * 2; /* First 4 constants have no device tables */
- for ( i = 0; i < 51; ++i )
+ for ( i = 0; i < 51; i++ )
{
p += 2; /* skip the value */
OTV_OPTIONAL_OFFSET( DeviceTableOffset );
@@ -110,7 +110,7 @@
OTV_SIZE_CHECK( Coverage );
otv_Coverage_validate( table + Coverage, otvalid, (FT_Int)cnt );
- for ( i = 0; i < cnt; ++i )
+ for ( i = 0; i < cnt; i++ )
{
p += 2; /* Skip the value */
OTV_OPTIONAL_OFFSET( DeviceTableOffset );
@@ -151,7 +151,7 @@
table_size = 4 + 4 * cnt;
/* Heights */
- for ( i = 0; i < cnt; ++i )
+ for ( i = 0; i < cnt; i++ )
{
p += 2; /* Skip the value */
OTV_OPTIONAL_OFFSET( DeviceTableOffset );
@@ -161,7 +161,7 @@
}
/* One more Kerning value */
- for ( i = 0; i < cnt + 1; ++i )
+ for ( i = 0; i < cnt + 1; i++ )
{
p += 2; /* Skip the value */
OTV_OPTIONAL_OFFSET( DeviceTableOffset );
@@ -198,9 +198,9 @@
OTV_SIZE_CHECK( Coverage );
otv_Coverage_validate( table + Coverage, otvalid, (FT_Int)cnt );
- for ( i = 0; i < cnt; ++i )
+ for ( i = 0; i < cnt; i++ )
{
- for ( j = 0; j < 4; ++j )
+ for ( j = 0; j < 4; j++ )
{
OTV_OPTIONAL_OFFSET( MKRecordOffset );
OTV_SIZE_CHECK( MKRecordOffset );
@@ -296,7 +296,7 @@
if ( DeviceTableOffset )
otv_Device_validate( table + DeviceTableOffset, otvalid );
- for ( i = 0; i < pcnt; ++i )
+ for ( i = 0; i < pcnt; i++ )
{
FT_UInt gid;
@@ -332,7 +332,7 @@
OTV_LIMIT_CHECK( 4 * vcnt );
table_size = 4 + 4 * vcnt;
- for ( i = 0; i < vcnt; ++i )
+ for ( i = 0; i < vcnt; i++ )
{
FT_UInt gid;
@@ -384,14 +384,14 @@
if ( HCoverage )
otv_Coverage_validate( table + HCoverage, otvalid, (FT_Int)hcnt );
- for ( i = 0; i < vcnt; ++i )
+ for ( i = 0; i < vcnt; i++ )
{
OTV_OPTIONAL_OFFSET( Offset );
OTV_SIZE_CHECK( Offset );
otv_MathGlyphConstruction_validate( table + Offset, otvalid );
}
- for ( i = 0; i < hcnt; ++i )
+ for ( i = 0; i < hcnt; i++ )
{
OTV_OPTIONAL_OFFSET( Offset );
OTV_SIZE_CHECK( Offset );
diff --git a/thirdparty/freetype/src/otvalid/otvmod.c b/thirdparty/freetype/src/otvalid/otvmod.c
index 972bd1baac..35ffc43d3a 100644
--- a/thirdparty/freetype/src/otvalid/otvmod.c
+++ b/thirdparty/freetype/src/otvalid/otvmod.c
@@ -4,7 +4,7 @@
/* */
/* FreeType's OpenType validation module implementation (body). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -271,11 +271,11 @@
0x10000L,
0x20000L,
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
- (FT_Module_Constructor)0,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) otvalid_get_service
+ (FT_Module_Constructor)NULL, /* module_init */
+ (FT_Module_Destructor) NULL, /* module_done */
+ (FT_Module_Requester) otvalid_get_service /* get_interface */
};
diff --git a/thirdparty/freetype/src/otvalid/otvmod.h b/thirdparty/freetype/src/otvalid/otvmod.h
index e464030ab0..30d401ddca 100644
--- a/thirdparty/freetype/src/otvalid/otvmod.h
+++ b/thirdparty/freetype/src/otvalid/otvmod.h
@@ -5,7 +5,7 @@
/* FreeType's OpenType validation module implementation */
/* (specification). */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/rules.mk b/thirdparty/freetype/src/otvalid/rules.mk
index 077447fcb6..10329a96ea 100644
--- a/thirdparty/freetype/src/otvalid/rules.mk
+++ b/thirdparty/freetype/src/otvalid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004-2016 by
+# Copyright 2004-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/pcf/pcf.c b/thirdparty/freetype/src/pcf/pcf.c
index 11d5b7b2a0..8ffd6e280b 100644
--- a/thirdparty/freetype/src/pcf/pcf.c
+++ b/thirdparty/freetype/src/pcf/pcf.c
@@ -26,11 +26,11 @@ THE SOFTWARE.
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
-
#include <ft2build.h>
-#include "pcfutil.c"
-#include "pcfread.c"
+
#include "pcfdrivr.c"
+#include "pcfread.c"
+#include "pcfutil.c"
+
/* END */
diff --git a/thirdparty/freetype/src/pcf/pcf.h b/thirdparty/freetype/src/pcf/pcf.h
index c726e5ec6b..f0390cb1eb 100644
--- a/thirdparty/freetype/src/pcf/pcf.h
+++ b/thirdparty/freetype/src/pcf/pcf.h
@@ -163,6 +163,15 @@ FT_BEGIN_HEADER
} PCF_FaceRec, *PCF_Face;
+ typedef struct PCF_DriverRec_
+ {
+ FT_DriverRec root;
+
+ FT_Bool no_long_family_names;
+
+ } PCF_DriverRec, *PCF_Driver;
+
+
/* macros for pcf font format */
#define LSBFirst 0
diff --git a/thirdparty/freetype/src/pcf/pcfdrivr.c b/thirdparty/freetype/src/pcf/pcfdrivr.c
index 0996d10793..9f4d36d111 100644
--- a/thirdparty/freetype/src/pcf/pcfdrivr.c
+++ b/thirdparty/freetype/src/pcf/pcfdrivr.c
@@ -49,6 +49,8 @@ THE SOFTWARE.
#include FT_SERVICE_BDF_H
#include FT_SERVICE_FONT_FORMAT_H
+#include FT_SERVICE_PROPERTIES_H
+#include FT_PCF_DRIVER_H
/*************************************************************************/
@@ -286,6 +288,7 @@ THE SOFTWARE.
/* this didn't work, try gzip support! */
+ FT_TRACE2(( " ... try gzip stream\n" ));
error2 = FT_Stream_OpenGzip( &face->comp_stream, stream );
if ( FT_ERR_EQ( error2, Unimplemented_Feature ) )
goto Fail;
@@ -301,6 +304,7 @@ THE SOFTWARE.
/* this didn't work, try LZW support! */
+ FT_TRACE2(( " ... try LZW stream\n" ));
error3 = FT_Stream_OpenLZW( &face->comp_stream, stream );
if ( FT_ERR_EQ( error3, Unimplemented_Feature ) )
goto Fail;
@@ -316,6 +320,7 @@ THE SOFTWARE.
/* this didn't work, try Bzip2 support! */
+ FT_TRACE2(( " ... try Bzip2 stream\n" ));
error4 = FT_Stream_OpenBzip2( &face->comp_stream, stream );
if ( FT_ERR_EQ( error4, Unimplemented_Feature ) )
goto Fail;
@@ -492,8 +497,6 @@ THE SOFTWARE.
PCF_Metric metric;
FT_ULong bytes;
- FT_UNUSED( load_flags );
-
FT_TRACE1(( "PCF_Glyph_Load: glyph index %d\n", glyph_index ));
@@ -523,11 +526,6 @@ THE SOFTWARE.
bitmap->num_grays = 1;
bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
- FT_TRACE6(( "BIT_ORDER %d ; BYTE_ORDER %d ; GLYPH_PAD %d\n",
- PCF_BIT_ORDER( face->bitmapsFormat ),
- PCF_BYTE_ORDER( face->bitmapsFormat ),
- PCF_GLYPH_PAD( face->bitmapsFormat ) ));
-
switch ( PCF_GLYPH_PAD( face->bitmapsFormat ) )
{
case 1:
@@ -550,6 +548,24 @@ THE SOFTWARE.
return FT_THROW( Invalid_File_Format );
}
+ slot->format = FT_GLYPH_FORMAT_BITMAP;
+ slot->bitmap_left = metric->leftSideBearing;
+ slot->bitmap_top = metric->ascent;
+
+ slot->metrics.horiAdvance = (FT_Pos)( metric->characterWidth * 64 );
+ slot->metrics.horiBearingX = (FT_Pos)( metric->leftSideBearing * 64 );
+ slot->metrics.horiBearingY = (FT_Pos)( metric->ascent * 64 );
+ slot->metrics.width = (FT_Pos)( ( metric->rightSideBearing -
+ metric->leftSideBearing ) * 64 );
+ slot->metrics.height = (FT_Pos)( bitmap->rows * 64 );
+
+ ft_synthesize_vertical_metrics( &slot->metrics,
+ ( face->accel.fontAscent +
+ face->accel.fontDescent ) * 64 );
+
+ if ( load_flags & FT_LOAD_BITMAP_METRICS_ONLY )
+ goto Exit;
+
/* XXX: to do: are there cases that need repadding the bitmap? */
bytes = (FT_ULong)bitmap->pitch * bitmap->rows;
@@ -582,21 +598,6 @@ THE SOFTWARE.
}
}
- slot->format = FT_GLYPH_FORMAT_BITMAP;
- slot->bitmap_left = metric->leftSideBearing;
- slot->bitmap_top = metric->ascent;
-
- slot->metrics.horiAdvance = (FT_Pos)( metric->characterWidth * 64 );
- slot->metrics.horiBearingX = (FT_Pos)( metric->leftSideBearing * 64 );
- slot->metrics.horiBearingY = (FT_Pos)( metric->ascent * 64 );
- slot->metrics.width = (FT_Pos)( ( metric->rightSideBearing -
- metric->leftSideBearing ) * 64 );
- slot->metrics.height = (FT_Pos)( bitmap->rows * 64 );
-
- ft_synthesize_vertical_metrics( &slot->metrics,
- ( face->accel.fontAscent +
- face->accel.fontDescent ) * 64 );
-
Exit:
return error;
}
@@ -617,7 +618,7 @@ THE SOFTWARE.
prop = pcf_find_property( face, prop_name );
- if ( prop != NULL )
+ if ( prop )
{
if ( prop->isString )
{
@@ -626,19 +627,23 @@ THE SOFTWARE.
}
else
{
- if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )
+ if ( prop->value.l > 0x7FFFFFFFL ||
+ prop->value.l < ( -1 - 0x7FFFFFFFL ) )
{
- FT_TRACE1(( "pcf_get_bdf_property: " ));
- FT_TRACE1(( "too large integer 0x%x is truncated\n" ));
+ FT_TRACE1(( "pcf_get_bdf_property:" ));
+ FT_TRACE1(( " too large integer 0x%x is truncated\n" ));
}
- /* Apparently, the PCF driver loads all properties as signed integers!
- * This really doesn't seem to be a problem, because this is
- * sufficient for any meaningful values.
+
+ /*
+ * The PCF driver loads all properties as signed integers.
+ * This really doesn't seem to be a problem, because this is
+ * sufficient for any meaningful values.
*/
aproperty->type = BDF_PROPERTY_TYPE_INTEGER;
aproperty->u.integer = (FT_Int32)prop->value.l;
}
- return 0;
+
+ return FT_Err_Ok;
}
return FT_THROW( Invalid_Argument );
@@ -653,7 +658,7 @@ THE SOFTWARE.
*acharset_encoding = face->charset_encoding;
*acharset_registry = face->charset_registry;
- return 0;
+ return FT_Err_Ok;
}
@@ -664,6 +669,116 @@ THE SOFTWARE.
};
+ /*
+ * PROPERTY SERVICE
+ *
+ */
+ static FT_Error
+ pcf_property_set( FT_Module module, /* PCF_Driver */
+ const char* property_name,
+ const void* value,
+ FT_Bool value_is_string )
+ {
+#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
+
+ FT_Error error = FT_Err_Ok;
+ PCF_Driver driver = (PCF_Driver)module;
+
+#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ FT_UNUSED( value_is_string );
+#endif
+
+
+ if ( !ft_strcmp( property_name, "no-long-family-names" ) )
+ {
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+ long lfn = ft_strtol( s, NULL, 10 );
+
+
+ if ( lfn == 0 )
+ driver->no_long_family_names = 0;
+ else if ( lfn == 1 )
+ driver->no_long_family_names = 1;
+ else
+ return FT_THROW( Invalid_Argument );
+ }
+ else
+#endif
+ {
+ FT_Bool* no_long_family_names = (FT_Bool*)value;
+
+
+ driver->no_long_family_names = *no_long_family_names;
+ }
+
+ return error;
+ }
+
+#else /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
+
+ FT_UNUSED( module );
+ FT_UNUSED( value );
+ FT_UNUSED( value_is_string );
+#ifndef FT_DEBUG_LEVEL_TRACE
+ FT_UNUSED( property_name );
+#endif
+
+#endif /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
+
+ FT_TRACE0(( "pcf_property_set: missing property `%s'\n",
+ property_name ));
+ return FT_THROW( Missing_Property );
+ }
+
+
+ static FT_Error
+ pcf_property_get( FT_Module module, /* PCF_Driver */
+ const char* property_name,
+ const void* value )
+ {
+#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
+
+ FT_Error error = FT_Err_Ok;
+ PCF_Driver driver = (PCF_Driver)module;
+
+
+ if ( !ft_strcmp( property_name, "no-long-family-names" ) )
+ {
+ FT_Bool no_long_family_names = driver->no_long_family_names;
+ FT_Bool* val = (FT_Bool*)value;
+
+
+ *val = no_long_family_names;
+
+ return error;
+ }
+
+#else /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
+
+ FT_UNUSED( module );
+ FT_UNUSED( value );
+#ifndef FT_DEBUG_LEVEL_TRACE
+ FT_UNUSED( property_name );
+#endif
+
+#endif /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
+
+ FT_TRACE0(( "pcf_property_get: missing property `%s'\n",
+ property_name ));
+ return FT_THROW( Missing_Property );
+ }
+
+
+ FT_DEFINE_SERVICE_PROPERTIESREC(
+ pcf_service_properties,
+
+ (FT_Properties_SetFunc)pcf_property_set, /* set_property */
+ (FT_Properties_GetFunc)pcf_property_get ) /* get_property */
+
+
/*
*
* SERVICE LIST
@@ -674,6 +789,7 @@ THE SOFTWARE.
{
{ FT_SERVICE_ID_BDF, &pcf_service_bdf },
{ FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_PCF },
+ { FT_SERVICE_ID_PROPERTIES, &pcf_service_properties },
{ NULL, NULL }
};
@@ -688,22 +804,45 @@ THE SOFTWARE.
}
+ FT_CALLBACK_DEF( FT_Error )
+ pcf_driver_init( FT_Module module ) /* PCF_Driver */
+ {
+#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
+ PCF_Driver driver = (PCF_Driver)module;
+
+
+ driver->no_long_family_names = 0;
+#else
+ FT_UNUSED( module );
+#endif
+
+ return FT_Err_Ok;
+ }
+
+
+ FT_CALLBACK_DEF( void )
+ pcf_driver_done( FT_Module module ) /* PCF_Driver */
+ {
+ FT_UNUSED( module );
+ }
+
+
FT_CALLBACK_TABLE_DEF
const FT_Driver_ClassRec pcf_driver_class =
{
{
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_NO_OUTLINES,
- sizeof ( FT_DriverRec ),
+ sizeof ( PCF_DriverRec ),
"pcf",
0x10000L,
0x20000L,
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
- 0, /* FT_Module_Constructor module_init */
- 0, /* FT_Module_Destructor module_done */
+ pcf_driver_init, /* FT_Module_Constructor module_init */
+ pcf_driver_done, /* FT_Module_Destructor module_done */
pcf_driver_requester /* FT_Module_Requester get_interface */
},
@@ -713,16 +852,16 @@ THE SOFTWARE.
PCF_Face_Init, /* FT_Face_InitFunc init_face */
PCF_Face_Done, /* FT_Face_DoneFunc done_face */
- 0, /* FT_Size_InitFunc init_size */
- 0, /* FT_Size_DoneFunc done_size */
- 0, /* FT_Slot_InitFunc init_slot */
- 0, /* FT_Slot_DoneFunc done_slot */
+ NULL, /* FT_Size_InitFunc init_size */
+ NULL, /* FT_Size_DoneFunc done_size */
+ NULL, /* FT_Slot_InitFunc init_slot */
+ NULL, /* FT_Slot_DoneFunc done_slot */
PCF_Glyph_Load, /* FT_Slot_LoadFunc load_glyph */
- 0, /* FT_Face_GetKerningFunc get_kerning */
- 0, /* FT_Face_AttachFunc attach_file */
- 0, /* FT_Face_GetAdvancesFunc get_advances */
+ NULL, /* FT_Face_GetKerningFunc get_kerning */
+ NULL, /* FT_Face_AttachFunc attach_file */
+ NULL, /* FT_Face_GetAdvancesFunc get_advances */
PCF_Size_Request, /* FT_Size_RequestFunc request_size */
PCF_Size_Select /* FT_Size_SelectFunc select_size */
diff --git a/thirdparty/freetype/src/pcf/pcfread.c b/thirdparty/freetype/src/pcf/pcfread.c
index a86b45d6bf..3eacf2baf6 100644
--- a/thirdparty/freetype/src/pcf/pcfread.c
+++ b/thirdparty/freetype/src/pcf/pcfread.c
@@ -50,8 +50,15 @@ THE SOFTWARE.
#ifdef FT_DEBUG_LEVEL_TRACE
static const char* const tableNames[] =
{
- "prop", "accl", "mtrcs", "bmps", "imtrcs",
- "enc", "swidth", "names", "accel"
+ "properties",
+ "accelerators",
+ "metrics",
+ "bitmaps",
+ "ink metrics",
+ "encodings",
+ "swidths",
+ "glyph names",
+ "BDF accelerators"
};
#endif
@@ -109,17 +116,20 @@ THE SOFTWARE.
if ( stream->size < 16 )
return FT_THROW( Invalid_File_Format );
- /* we need 16 bytes per TOC entry */
- if ( toc->count > stream->size >> 4 )
+ /* we need 16 bytes per TOC entry, */
+ /* and there can be most 9 tables */
+ if ( toc->count > ( stream->size >> 4 ) ||
+ toc->count > 9 )
{
FT_TRACE0(( "pcf_read_TOC: adjusting number of tables"
" (from %d to %d)\n",
- toc->count, stream->size >> 4 ));
- toc->count = stream->size >> 4;
+ toc->count,
+ FT_MIN( stream->size >> 4, 9 ) ));
+ toc->count = FT_MIN( stream->size >> 4, 9 );
}
if ( FT_NEW_ARRAY( face->toc.tables, toc->count ) )
- return FT_THROW( Out_Of_Memory );
+ return error;
tables = face->toc.tables;
for ( n = 0; n < toc->count; n++ )
@@ -232,8 +242,8 @@ THE SOFTWARE.
if ( tables[i].type == (FT_UInt)( 1 << j ) )
name = tableNames[j];
- FT_TRACE4(( " %d: type=%s, format=0x%X, "
- "size=%ld (0x%lX), offset=%ld (0x%lX)\n",
+ FT_TRACE4(( " %d: type=%s, format=0x%X,"
+ " size=%ld (0x%lX), offset=%ld (0x%lX)\n",
i, name,
tables[i].format,
tables[i].size, tables[i].size,
@@ -319,7 +329,7 @@ THE SOFTWARE.
/* parsing normal metrics */
- fields = PCF_BYTE_ORDER( format ) == MSBFirst
+ fields = ( PCF_BYTE_ORDER( format ) == MSBFirst )
? pcf_metric_msb_header
: pcf_metric_header;
@@ -343,6 +353,17 @@ THE SOFTWARE.
metric->attributes = 0;
}
+ FT_TRACE5(( " width=%d,"
+ " lsb=%d, rsb=%d,"
+ " ascent=%d, descent=%d,"
+ " attributes=%d\n",
+ metric->characterWidth,
+ metric->leftSideBearing,
+ metric->rightSideBearing,
+ metric->ascent,
+ metric->descent,
+ metric->attributes ));
+
Exit:
return error;
}
@@ -461,7 +482,7 @@ THE SOFTWARE.
{
PCF_ParseProperty props = NULL;
PCF_Property properties = NULL;
- FT_ULong nprops, i;
+ FT_ULong nprops, orig_nprops, i;
FT_ULong format, size;
FT_Error error;
FT_Memory memory = FT_FACE( face )->memory;
@@ -481,32 +502,43 @@ THE SOFTWARE.
if ( FT_READ_ULONG_LE( format ) )
goto Bail;
- FT_TRACE4(( "pcf_get_properties:\n" ));
-
- FT_TRACE4(( " format = %ld\n", format ));
+ FT_TRACE4(( "pcf_get_properties:\n"
+ " format: 0x%lX (%s)\n",
+ format,
+ PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB" ));
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
goto Bail;
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
- (void)FT_READ_ULONG( nprops );
+ (void)FT_READ_ULONG( orig_nprops );
else
- (void)FT_READ_ULONG_LE( nprops );
+ (void)FT_READ_ULONG_LE( orig_nprops );
if ( error )
goto Bail;
- FT_TRACE4(( " nprop = %d (truncate %d props)\n",
- (int)nprops, nprops - (FT_ULong)(int)nprops ));
-
- nprops = (FT_ULong)(int)nprops;
+ FT_TRACE4(( " number of properties: %ld\n", orig_nprops ));
/* rough estimate */
- if ( nprops > size / PCF_PROPERTY_SIZE )
+ if ( orig_nprops > size / PCF_PROPERTY_SIZE )
{
error = FT_THROW( Invalid_Table );
goto Bail;
}
+ /* as a heuristic limit to avoid excessive allocation in */
+ /* gzip bombs (i.e., very small, invalid input data that */
+ /* pretends to expand to an insanely large file) we only */
+ /* load the first 256 properties */
+ if ( orig_nprops > 256 )
+ {
+ FT_TRACE0(( "pcf_get_properties:"
+ " only loading first 256 properties\n" ));
+ nprops = 256;
+ }
+ else
+ nprops = orig_nprops;
+
face->nprops = (int)nprops;
if ( FT_NEW_ARRAY( props, nprops ) )
@@ -526,14 +558,23 @@ THE SOFTWARE.
}
}
+ /* this skip will only work if we really have an extremely large */
+ /* number of properties; it will fail for fake data, avoiding an */
+ /* unnecessarily large allocation later on */
+ if ( FT_STREAM_SKIP( ( orig_nprops - nprops ) * PCF_PROPERTY_SIZE ) )
+ {
+ error = FT_THROW( Invalid_Stream_Skip );
+ goto Bail;
+ }
+
/* pad the property array */
/* */
/* clever here - nprops is the same as the number of odd-units read, */
/* as only isStringProp are odd length (Keith Packard) */
/* */
- if ( nprops & 3 )
+ if ( orig_nprops & 3 )
{
- i = 4 - ( nprops & 3 );
+ i = 4 - ( orig_nprops & 3 );
if ( FT_STREAM_SKIP( i ) )
{
error = FT_THROW( Invalid_Stream_Skip );
@@ -548,15 +589,24 @@ THE SOFTWARE.
if ( error )
goto Bail;
- FT_TRACE4(( " string_size = %ld\n", string_size ));
+ FT_TRACE4(( " string size: %ld\n", string_size ));
/* rough estimate */
- if ( string_size > size - nprops * PCF_PROPERTY_SIZE )
+ if ( string_size > size - orig_nprops * PCF_PROPERTY_SIZE )
{
error = FT_THROW( Invalid_Table );
goto Bail;
}
+ /* the strings in the `strings' array are PostScript strings, */
+ /* which can have a maximum length of 65536 characters each */
+ if ( string_size > 16777472 ) /* 256 * (65536 + 1) */
+ {
+ FT_TRACE0(( "pcf_get_properties:"
+ " loading only 16777472 bytes of strings array\n" ));
+ string_size = 16777472;
+ }
+
/* allocate one more byte so that we have a final null byte */
if ( FT_NEW_ARRAY( strings, string_size + 1 ) )
goto Bail;
@@ -570,6 +620,7 @@ THE SOFTWARE.
face->properties = properties;
+ FT_TRACE4(( "\n" ));
for ( i = 0; i < nprops; i++ )
{
FT_Long name_offset = props[i].name;
@@ -632,7 +683,7 @@ THE SOFTWARE.
FT_Memory memory = FT_FACE( face )->memory;
FT_ULong format, size;
PCF_Metric metrics = NULL;
- FT_ULong nmetrics, i;
+ FT_ULong nmetrics, orig_nmetrics, i;
error = pcf_seek_to_table_type( stream,
@@ -647,6 +698,13 @@ THE SOFTWARE.
if ( FT_READ_ULONG_LE( format ) )
goto Bail;
+ FT_TRACE4(( "pcf_get_metrics:\n"
+ " format: 0x%lX (%s, %s)\n",
+ format,
+ PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB",
+ PCF_FORMAT_MATCH( format, PCF_COMPRESSED_METRICS ) ?
+ "compressed" : "uncompressed" ));
+
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) &&
!PCF_FORMAT_MATCH( format, PCF_COMPRESSED_METRICS ) )
return FT_THROW( Invalid_File_Format );
@@ -654,61 +712,70 @@ THE SOFTWARE.
if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
{
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
- (void)FT_READ_ULONG( nmetrics );
+ (void)FT_READ_ULONG( orig_nmetrics );
else
- (void)FT_READ_ULONG_LE( nmetrics );
+ (void)FT_READ_ULONG_LE( orig_nmetrics );
}
else
{
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
- (void)FT_READ_USHORT( nmetrics );
+ (void)FT_READ_USHORT( orig_nmetrics );
else
- (void)FT_READ_USHORT_LE( nmetrics );
+ (void)FT_READ_USHORT_LE( orig_nmetrics );
}
if ( error )
return FT_THROW( Invalid_File_Format );
- face->nmetrics = nmetrics;
-
- if ( !nmetrics )
- return FT_THROW( Invalid_Table );
-
- FT_TRACE4(( "pcf_get_metrics:\n" ));
-
- FT_TRACE4(( " number of metrics: %d\n", nmetrics ));
+ FT_TRACE4(( " number of metrics: %ld\n", orig_nmetrics ));
/* rough estimate */
if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
{
- if ( nmetrics > size / PCF_METRIC_SIZE )
+ if ( orig_nmetrics > size / PCF_METRIC_SIZE )
return FT_THROW( Invalid_Table );
}
else
{
- if ( nmetrics > size / PCF_COMPRESSED_METRIC_SIZE )
+ if ( orig_nmetrics > size / PCF_COMPRESSED_METRIC_SIZE )
return FT_THROW( Invalid_Table );
}
+ if ( !orig_nmetrics )
+ return FT_THROW( Invalid_Table );
+
+ /* PCF is a format from ancient times; Unicode was in its */
+ /* infancy, and widely used two-byte character sets for CJK */
+ /* scripts (Big 5, GB 2312, JIS X 0208, etc.) did have at most */
+ /* 15000 characters. Even the more exotic CNS 11643 and CCCII */
+ /* standards, which were essentially three-byte character sets, */
+ /* provided less then 65536 assigned characters. */
+ /* */
+ /* While technically possible to have a larger number of glyphs */
+ /* in PCF files, we thus limit the number to 65536. */
+ if ( orig_nmetrics > 65536 )
+ {
+ FT_TRACE0(( "pcf_get_metrics:"
+ " only loading first 65536 metrics\n" ));
+ nmetrics = 65536;
+ }
+ else
+ nmetrics = orig_nmetrics;
+
+ face->nmetrics = nmetrics;
+
if ( FT_NEW_ARRAY( face->metrics, nmetrics ) )
- return FT_THROW( Out_Of_Memory );
+ return error;
metrics = face->metrics;
+
+ FT_TRACE4(( "\n" ));
for ( i = 0; i < nmetrics; i++, metrics++ )
{
+ FT_TRACE5(( " idx %ld:", i ));
error = pcf_get_metric( stream, format, metrics );
metrics->bits = 0;
- FT_TRACE5(( " idx %d: width=%d, "
- "lsb=%d, rsb=%d, ascent=%d, descent=%d, swidth=%d\n",
- i,
- metrics->characterWidth,
- metrics->leftSideBearing,
- metrics->rightSideBearing,
- metrics->ascent,
- metrics->descent,
- metrics->attributes ));
-
if ( error )
break;
@@ -716,7 +783,7 @@ THE SOFTWARE.
/* compute a glyph's bitmap dimensions, thus setting them to zero in */
/* case of an error disables this particular glyph only */
if ( metrics->rightSideBearing < metrics->leftSideBearing ||
- metrics->ascent + metrics->descent < 0 )
+ metrics->ascent < -metrics->descent )
{
metrics->characterWidth = 0;
metrics->leftSideBearing = 0;
@@ -746,7 +813,7 @@ THE SOFTWARE.
FT_Long* offsets = NULL;
FT_Long bitmapSizes[GLYPHPADOPTIONS];
FT_ULong format, size;
- FT_ULong nbitmaps, i, sizebitmaps = 0;
+ FT_ULong nbitmaps, orig_nbitmaps, i, sizebitmaps = 0;
error = pcf_seek_to_table_type( stream,
@@ -764,18 +831,40 @@ THE SOFTWARE.
format = FT_GET_ULONG_LE();
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
- nbitmaps = FT_GET_ULONG();
+ orig_nbitmaps = FT_GET_ULONG();
else
- nbitmaps = FT_GET_ULONG_LE();
+ orig_nbitmaps = FT_GET_ULONG_LE();
FT_Stream_ExitFrame( stream );
+ FT_TRACE4(( "pcf_get_bitmaps:\n"
+ " format: 0x%lX\n"
+ " (%s, %s,\n"
+ " padding=%d bits, scanning=%d bits)\n",
+ format,
+ PCF_BYTE_ORDER( format ) == MSBFirst
+ ? "most significant byte first"
+ : "least significant byte first",
+ PCF_BIT_ORDER( format ) == MSBFirst
+ ? "most significant bit first"
+ : "least significant bit first",
+ 8 << PCF_GLYPH_PAD_INDEX( format ),
+ 8 << PCF_SCAN_UNIT_INDEX( format ) ));
+
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
return FT_THROW( Invalid_File_Format );
- FT_TRACE4(( "pcf_get_bitmaps:\n" ));
+ FT_TRACE4(( " number of bitmaps: %ld\n", orig_nbitmaps ));
- FT_TRACE4(( " number of bitmaps: %d\n", nbitmaps ));
+ /* see comment in `pcf_get_metrics' */
+ if ( orig_nbitmaps > 65536 )
+ {
+ FT_TRACE0(( "pcf_get_bitmaps:"
+ " only loading first 65536 bitmaps\n" ));
+ nbitmaps = 65536;
+ }
+ else
+ nbitmaps = orig_nbitmaps;
if ( nbitmaps != face->nmetrics )
return FT_THROW( Invalid_File_Format );
@@ -783,6 +872,7 @@ THE SOFTWARE.
if ( FT_NEW_ARRAY( offsets, nbitmaps ) )
return error;
+ FT_TRACE5(( "\n" ));
for ( i = 0; i < nbitmaps; i++ )
{
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
@@ -790,7 +880,7 @@ THE SOFTWARE.
else
(void)FT_READ_LONG_LE( offsets[i] );
- FT_TRACE5(( " bitmap %d: offset %ld (0x%lX)\n",
+ FT_TRACE5(( " bitmap %ld: offset %ld (0x%lX)\n",
i, offsets[i], offsets[i] ));
}
if ( error )
@@ -807,17 +897,19 @@ THE SOFTWARE.
sizebitmaps = (FT_ULong)bitmapSizes[PCF_GLYPH_PAD_INDEX( format )];
- FT_TRACE4(( " padding %d implies a size of %ld\n",
- i, bitmapSizes[i] ));
+ FT_TRACE4(( " %ld-bit padding implies a size of %ld\n",
+ 8 << i, bitmapSizes[i] ));
}
- FT_TRACE4(( " %d bitmaps, padding index %ld\n",
+ FT_TRACE4(( " %ld bitmaps, using %ld-bit padding\n",
nbitmaps,
- PCF_GLYPH_PAD_INDEX( format ) ));
- FT_TRACE4(( " bitmap size = %d\n", sizebitmaps ));
+ 8 << PCF_GLYPH_PAD_INDEX( format ) ));
+ FT_TRACE4(( " bitmap size: %ld\n", sizebitmaps ));
FT_UNUSED( sizebitmaps ); /* only used for debugging */
+ /* right now, we only check the bitmap offsets; */
+ /* actual bitmaps are only loaded on demand */
for ( i = 0; i < nbitmaps; i++ )
{
/* rough estimate */
@@ -825,7 +917,7 @@ THE SOFTWARE.
( (FT_ULong)offsets[i] > size ) )
{
FT_TRACE0(( "pcf_get_bitmaps:"
- " invalid offset to bitmap data of glyph %d\n", i ));
+ " invalid offset to bitmap data of glyph %ld\n", i ));
}
else
face->metrics[i].bits = stream->pos + (FT_ULong)offsets[i];
@@ -889,10 +981,20 @@ THE SOFTWARE.
FT_Stream_ExitFrame( stream );
+ FT_TRACE4(( "pcf_get_encodings:\n"
+ " format: 0x%lX (%s)\n",
+ format,
+ PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB" ));
+
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
return FT_THROW( Invalid_File_Format );
- /* sanity checks */
+ FT_TRACE4(( " firstCol 0x%X, lastCol 0x%X\n"
+ " firstRow 0x%X, lastRow 0x%X\n",
+ firstCol, lastCol,
+ firstRow, lastRow ));
+
+ /* sanity checks; we limit numbers of rows and columns to 256 */
if ( firstCol < 0 ||
firstCol > lastCol ||
lastCol > 0xFF ||
@@ -901,21 +1003,18 @@ THE SOFTWARE.
lastRow > 0xFF )
return FT_THROW( Invalid_Table );
- FT_TRACE4(( "pdf_get_encodings:\n" ));
-
- FT_TRACE4(( " firstCol %d, lastCol %d, firstRow %d, lastRow %d\n",
- firstCol, lastCol, firstRow, lastRow ));
-
nencoding = (FT_ULong)( lastCol - firstCol + 1 ) *
(FT_ULong)( lastRow - firstRow + 1 );
if ( FT_NEW_ARRAY( encoding, nencoding ) )
- return FT_THROW( Out_Of_Memory );
+ return error;
error = FT_Stream_EnterFrame( stream, 2 * nencoding );
if ( error )
goto Bail;
+ FT_TRACE5(( "\n" ));
+
k = 0;
for ( i = firstRow; i <= lastRow; i++ )
{
@@ -1024,6 +1123,15 @@ THE SOFTWARE.
if ( FT_READ_ULONG_LE( format ) )
goto Bail;
+ FT_TRACE4(( "pcf_get_accel%s:\n"
+ " format: 0x%lX (%s, %s)\n",
+ type == PCF_BDF_ACCELERATORS ? " (getting BDF accelerators)"
+ : "",
+ format,
+ PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB",
+ PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) ?
+ "accelerated" : "not accelerated" ));
+
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) &&
!PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) )
goto Bail;
@@ -1039,12 +1147,29 @@ THE SOFTWARE.
goto Bail;
}
+ FT_TRACE5(( " noOverlap=%s, constantMetrics=%s,"
+ " terminalFont=%s, constantWidth=%s\n"
+ " inkInside=%s, inkMetrics=%s, drawDirection=%s\n"
+ " fontAscent=%ld, fontDescent=%ld, maxOverlap=%ld\n",
+ accel->noOverlap ? "yes" : "no",
+ accel->constantMetrics ? "yes" : "no",
+ accel->terminalFont ? "yes" : "no",
+ accel->constantWidth ? "yes" : "no",
+ accel->inkInside ? "yes" : "no",
+ accel->inkMetrics ? "yes" : "no",
+ accel->drawDirection ? "RTL" : "LTR",
+ accel->fontAscent,
+ accel->fontDescent,
+ accel->maxOverlap ));
+
+ FT_TRACE5(( " minbounds:" ));
error = pcf_get_metric( stream,
format & ( ~PCF_FORMAT_MASK ),
&(accel->minbounds) );
if ( error )
goto Bail;
+ FT_TRACE5(( " maxbounds:" ));
error = pcf_get_metric( stream,
format & ( ~PCF_FORMAT_MASK ),
&(accel->maxbounds) );
@@ -1053,12 +1178,14 @@ THE SOFTWARE.
if ( PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) )
{
+ FT_TRACE5(( " ink minbounds:" ));
error = pcf_get_metric( stream,
format & ( ~PCF_FORMAT_MASK ),
&(accel->ink_minbounds) );
if ( error )
goto Bail;
+ FT_TRACE5(( " ink maxbounds:" ));
error = pcf_get_metric( stream,
format & ( ~PCF_FORMAT_MASK ),
&(accel->ink_maxbounds) );
@@ -1067,7 +1194,7 @@ THE SOFTWARE.
}
else
{
- accel->ink_minbounds = accel->minbounds; /* I'm not sure about this */
+ accel->ink_minbounds = accel->minbounds;
accel->ink_maxbounds = accel->maxbounds;
}
@@ -1156,7 +1283,7 @@ THE SOFTWARE.
len = lengths[nn];
- if ( src == NULL )
+ if ( !src )
continue;
/* separate elements with a space */
@@ -1260,14 +1387,81 @@ THE SOFTWARE.
if ( face->accel.constantWidth )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
- if ( ( error = pcf_interpret_style( face ) ) != 0 )
- goto Exit;
+ if ( FT_SET_ERROR( pcf_interpret_style( face ) ) )
+ goto Exit;
prop = pcf_find_property( face, "FAMILY_NAME" );
if ( prop && prop->isString )
{
- if ( FT_STRDUP( root->family_name, prop->value.atom ) )
- goto Exit;
+
+#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
+
+ PCF_Driver driver = (PCF_Driver)FT_FACE_DRIVER( face );
+
+
+ if ( !driver->no_long_family_names )
+ {
+ /* Prepend the foundry name plus a space to the family name. */
+ /* There are many fonts just called `Fixed' which look */
+ /* completely different, and which have nothing to do with each */
+ /* other. When selecting `Fixed' in KDE or Gnome one gets */
+ /* results that appear rather random, the style changes often if */
+ /* one changes the size and one cannot select some fonts at all. */
+ /* */
+ /* We also check whether we have `wide' characters; all put */
+ /* together, we get family names like `Sony Fixed' or `Misc */
+ /* Fixed Wide'. */
+
+ PCF_Property foundry_prop, point_size_prop, average_width_prop;
+
+ int l = ft_strlen( prop->value.atom ) + 1;
+ int wide = 0;
+
+
+ foundry_prop = pcf_find_property( face, "FOUNDRY" );
+ point_size_prop = pcf_find_property( face, "POINT_SIZE" );
+ average_width_prop = pcf_find_property( face, "AVERAGE_WIDTH" );
+
+ if ( point_size_prop && average_width_prop )
+ {
+ if ( average_width_prop->value.l >= point_size_prop->value.l )
+ {
+ /* This font is at least square shaped or even wider */
+ wide = 1;
+ l += ft_strlen( " Wide" );
+ }
+ }
+
+ if ( foundry_prop && foundry_prop->isString )
+ {
+ l += ft_strlen( foundry_prop->value.atom ) + 1;
+
+ if ( FT_NEW_ARRAY( root->family_name, l ) )
+ goto Exit;
+
+ ft_strcpy( root->family_name, foundry_prop->value.atom );
+ ft_strcat( root->family_name, " " );
+ ft_strcat( root->family_name, prop->value.atom );
+ }
+ else
+ {
+ if ( FT_NEW_ARRAY( root->family_name, l ) )
+ goto Exit;
+
+ ft_strcpy( root->family_name, prop->value.atom );
+ }
+
+ if ( wide )
+ ft_strcat( root->family_name, " Wide" );
+ }
+ else
+
+#endif /* PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
+
+ {
+ if ( FT_STRDUP( root->family_name, prop->value.atom ) )
+ goto Exit;
+ }
}
else
root->family_name = NULL;
@@ -1290,7 +1484,7 @@ THE SOFTWARE.
FT_Short resolution_x = 0, resolution_y = 0;
- FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) );
+ FT_ZERO( bsize );
/* for simplicity, we take absolute values of integer properties */
diff --git a/thirdparty/freetype/src/pfr/module.mk b/thirdparty/freetype/src/pfr/module.mk
index bf7808c72f..7b84da9708 100644
--- a/thirdparty/freetype/src/pfr/module.mk
+++ b/thirdparty/freetype/src/pfr/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2016 by
+# Copyright 2002-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/pfr/pfr.c b/thirdparty/freetype/src/pfr/pfr.c
index 1a433960a5..4f31f5d9bc 100644
--- a/thirdparty/freetype/src/pfr/pfr.c
+++ b/thirdparty/freetype/src/pfr/pfr.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR driver component. */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -15,15 +15,16 @@
/* */
/***************************************************************************/
-#define FT_MAKE_OPTION_SINGLE_OBJECT
+#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
-#include "pfrload.c"
-#include "pfrgload.c"
#include "pfrcmap.c"
-#include "pfrobjs.c"
#include "pfrdrivr.c"
+#include "pfrgload.c"
+#include "pfrload.c"
+#include "pfrobjs.c"
#include "pfrsbit.c"
+
/* END */
diff --git a/thirdparty/freetype/src/pfr/pfrcmap.c b/thirdparty/freetype/src/pfr/pfrcmap.c
index a1439c2e9f..1d6b15be48 100644
--- a/thirdparty/freetype/src/pfr/pfrcmap.c
+++ b/thirdparty/freetype/src/pfr/pfrcmap.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR cmap handling (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -161,12 +161,16 @@
{
sizeof ( PFR_CMapRec ),
- (FT_CMap_InitFunc) pfr_cmap_init,
- (FT_CMap_DoneFunc) pfr_cmap_done,
- (FT_CMap_CharIndexFunc)pfr_cmap_char_index,
- (FT_CMap_CharNextFunc) pfr_cmap_char_next,
+ (FT_CMap_InitFunc) pfr_cmap_init, /* init */
+ (FT_CMap_DoneFunc) pfr_cmap_done, /* done */
+ (FT_CMap_CharIndexFunc)pfr_cmap_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) pfr_cmap_char_next, /* char_next */
- NULL, NULL, NULL, NULL, NULL
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL /* variantchar_list */
};
diff --git a/thirdparty/freetype/src/pfr/pfrcmap.h b/thirdparty/freetype/src/pfr/pfrcmap.h
index 4a8a4d0a67..957bf65b4c 100644
--- a/thirdparty/freetype/src/pfr/pfrcmap.h
+++ b/thirdparty/freetype/src/pfr/pfrcmap.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR cmap handling (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrdrivr.c b/thirdparty/freetype/src/pfr/pfrdrivr.c
index b81c15e560..195cdb76ac 100644
--- a/thirdparty/freetype/src/pfr/pfrdrivr.c
+++ b/thirdparty/freetype/src/pfr/pfrdrivr.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR driver interface (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -181,10 +181,10 @@
0x10000L,
0x20000L,
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
- 0, /* FT_Module_Constructor module_init */
- 0, /* FT_Module_Destructor module_done */
+ NULL, /* FT_Module_Constructor module_init */
+ NULL, /* FT_Module_Destructor module_done */
pfr_get_service /* FT_Module_Requester get_interface */
},
@@ -194,19 +194,19 @@
pfr_face_init, /* FT_Face_InitFunc init_face */
pfr_face_done, /* FT_Face_DoneFunc done_face */
- 0, /* FT_Size_InitFunc init_size */
- 0, /* FT_Size_DoneFunc done_size */
+ NULL, /* FT_Size_InitFunc init_size */
+ NULL, /* FT_Size_DoneFunc done_size */
pfr_slot_init, /* FT_Slot_InitFunc init_slot */
pfr_slot_done, /* FT_Slot_DoneFunc done_slot */
pfr_slot_load, /* FT_Slot_LoadFunc load_glyph */
pfr_get_kerning, /* FT_Face_GetKerningFunc get_kerning */
- 0, /* FT_Face_AttachFunc attach_file */
- 0, /* FT_Face_GetAdvancesFunc get_advances */
+ NULL, /* FT_Face_AttachFunc attach_file */
+ NULL, /* FT_Face_GetAdvancesFunc get_advances */
- 0, /* FT_Size_RequestFunc request_size */
- 0, /* FT_Size_SelectFunc select_size */
+ NULL, /* FT_Size_RequestFunc request_size */
+ NULL, /* FT_Size_SelectFunc select_size */
};
diff --git a/thirdparty/freetype/src/pfr/pfrdrivr.h b/thirdparty/freetype/src/pfr/pfrdrivr.h
index 32b2d9eab3..b81d56017e 100644
--- a/thirdparty/freetype/src/pfr/pfrdrivr.h
+++ b/thirdparty/freetype/src/pfr/pfrdrivr.h
@@ -4,7 +4,7 @@
/* */
/* High-level Type PFR driver interface (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrerror.h b/thirdparty/freetype/src/pfr/pfrerror.h
index 9305f8fb58..ef044e32c9 100644
--- a/thirdparty/freetype/src/pfr/pfrerror.h
+++ b/thirdparty/freetype/src/pfr/pfrerror.h
@@ -4,7 +4,7 @@
/* */
/* PFR error codes (specification only). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrgload.c b/thirdparty/freetype/src/pfr/pfrgload.c
index f9cd1f63bb..93f5fc7090 100644
--- a/thirdparty/freetype/src/pfr/pfrgload.c
+++ b/thirdparty/freetype/src/pfr/pfrgload.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR glyph loader (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrgload.h b/thirdparty/freetype/src/pfr/pfrgload.h
index 908d4378a4..6612323871 100644
--- a/thirdparty/freetype/src/pfr/pfrgload.h
+++ b/thirdparty/freetype/src/pfr/pfrgload.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR glyph loader (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrload.c b/thirdparty/freetype/src/pfr/pfrload.c
index e509e70b5d..4f84165828 100644
--- a/thirdparty/freetype/src/pfr/pfrload.c
+++ b/thirdparty/freetype/src/pfr/pfrload.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR loader (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -562,7 +562,7 @@
FT_UInt len = (FT_UInt)( limit - p );
- if ( phy_font->font_id != NULL )
+ if ( phy_font->font_id )
goto Exit;
if ( FT_ALLOC( phy_font->font_id, len + 1 ) )
@@ -589,7 +589,7 @@
FT_Memory memory = phy_font->memory;
- if ( phy_font->vertical.stem_snaps != NULL )
+ if ( phy_font->vertical.stem_snaps )
goto Exit;
PFR_CHECK( 1 );
diff --git a/thirdparty/freetype/src/pfr/pfrload.h b/thirdparty/freetype/src/pfr/pfrload.h
index 0f7a2bb239..f9475ae062 100644
--- a/thirdparty/freetype/src/pfr/pfrload.h
+++ b/thirdparty/freetype/src/pfr/pfrload.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR loader (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrobjs.c b/thirdparty/freetype/src/pfr/pfrobjs.c
index 769a3b6164..4b1703f51c 100644
--- a/thirdparty/freetype/src/pfr/pfrobjs.c
+++ b/thirdparty/freetype/src/pfr/pfrobjs.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR object methods (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -185,7 +185,7 @@
* nothing.
*/
pfrface->family_name = phy_font->family_name;
- if ( pfrface->family_name == NULL )
+ if ( !pfrface->family_name )
pfrface->family_name = phy_font->font_id;
/* note that the style name can be NULL in certain PFR fonts,
@@ -342,8 +342,12 @@
/* try to load an embedded bitmap */
if ( ( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP ) ) == 0 )
{
- error = pfr_slot_load_bitmap( slot, size, gindex );
- if ( error == 0 )
+ error = pfr_slot_load_bitmap(
+ slot,
+ size,
+ gindex,
+ ( load_flags & FT_LOAD_BITMAP_METRICS_ONLY ) != 0 );
+ if ( !error )
goto Exit;
}
diff --git a/thirdparty/freetype/src/pfr/pfrobjs.h b/thirdparty/freetype/src/pfr/pfrobjs.h
index 335aca8854..d6ad6562df 100644
--- a/thirdparty/freetype/src/pfr/pfrobjs.h
+++ b/thirdparty/freetype/src/pfr/pfrobjs.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR object methods (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrsbit.c b/thirdparty/freetype/src/pfr/pfrsbit.c
index 144f50c0b3..54e7d0e6cc 100644
--- a/thirdparty/freetype/src/pfr/pfrsbit.c
+++ b/thirdparty/freetype/src/pfr/pfrsbit.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR bitmap loader (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -578,7 +578,8 @@
FT_LOCAL( FT_Error )
pfr_slot_load_bitmap( PFR_Slot glyph,
PFR_Size size,
- FT_UInt glyph_index )
+ FT_UInt glyph_index,
+ FT_Bool metrics_only )
{
FT_Error error;
PFR_Face face = (PFR_Face) glyph->root.face;
@@ -775,6 +776,9 @@
glyph->root.bitmap_left = (FT_Int)xpos;
glyph->root.bitmap_top = (FT_Int)( ypos + (FT_Long)ysize );
+ if ( metrics_only )
+ goto Exit1;
+
/* Allocate and read bitmap data */
{
FT_ULong len = (FT_ULong)glyph->root.bitmap.pitch * ysize;
diff --git a/thirdparty/freetype/src/pfr/pfrsbit.h b/thirdparty/freetype/src/pfr/pfrsbit.h
index 94ead28ca7..fc270f50a8 100644
--- a/thirdparty/freetype/src/pfr/pfrsbit.h
+++ b/thirdparty/freetype/src/pfr/pfrsbit.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR bitmap loader (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -26,7 +26,8 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
pfr_slot_load_bitmap( PFR_Slot glyph,
PFR_Size size,
- FT_UInt glyph_index );
+ FT_UInt glyph_index,
+ FT_Bool metrics_only );
FT_END_HEADER
diff --git a/thirdparty/freetype/src/pfr/pfrtypes.h b/thirdparty/freetype/src/pfr/pfrtypes.h
index bd6c2cd30c..c3d542c209 100644
--- a/thirdparty/freetype/src/pfr/pfrtypes.h
+++ b/thirdparty/freetype/src/pfr/pfrtypes.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR data structures (specification only). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/rules.mk b/thirdparty/freetype/src/pfr/rules.mk
index 39bb9e941a..9940f62286 100644
--- a/thirdparty/freetype/src/pfr/rules.mk
+++ b/thirdparty/freetype/src/pfr/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2016 by
+# Copyright 2002-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/psaux/afmparse.c b/thirdparty/freetype/src/psaux/afmparse.c
index 9fb0ac0e2b..ff2cc8cf08 100644
--- a/thirdparty/freetype/src/psaux/afmparse.c
+++ b/thirdparty/freetype/src/psaux/afmparse.c
@@ -4,7 +4,7 @@
/* */
/* AFM parser (body). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,6 +20,8 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
+#ifndef T1_CONFIG_OPTION_NO_AFM
+
#include "afmparse.h"
#include "psconv.h"
@@ -973,5 +975,12 @@
return error;
}
+#else /* T1_CONFIG_OPTION_NO_AFM */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _afm_parse_dummy;
+
+#endif /* T1_CONFIG_OPTION_NO_AFM */
+
/* END */
diff --git a/thirdparty/freetype/src/psaux/afmparse.h b/thirdparty/freetype/src/psaux/afmparse.h
index 6d8b193ffc..cd2beb7804 100644
--- a/thirdparty/freetype/src/psaux/afmparse.h
+++ b/thirdparty/freetype/src/psaux/afmparse.h
@@ -4,7 +4,7 @@
/* */
/* AFM parser (specification). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/module.mk b/thirdparty/freetype/src/psaux/module.mk
index 630c4f39dd..c70a227166 100644
--- a/thirdparty/freetype/src/psaux/module.mk
+++ b/thirdparty/freetype/src/psaux/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/psaux/psaux.c b/thirdparty/freetype/src/psaux/psaux.c
index 33b462ef15..c373aa7d5b 100644
--- a/thirdparty/freetype/src/psaux/psaux.c
+++ b/thirdparty/freetype/src/psaux/psaux.c
@@ -4,7 +4,7 @@
/* */
/* FreeType auxiliary PostScript driver component (body only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,18 +17,14 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
#include <ft2build.h>
-#include "psobjs.c"
-#include "psauxmod.c"
-#include "t1decode.c"
-#include "t1cmap.c"
-#ifndef T1_CONFIG_OPTION_NO_AFM
#include "afmparse.c"
-#endif
-
+#include "psauxmod.c"
#include "psconv.c"
+#include "psobjs.c"
+#include "t1cmap.c"
+#include "t1decode.c"
/* END */
diff --git a/thirdparty/freetype/src/psaux/psauxerr.h b/thirdparty/freetype/src/psaux/psauxerr.h
index 9739157fc4..1d7ac6001b 100644
--- a/thirdparty/freetype/src/psaux/psauxerr.h
+++ b/thirdparty/freetype/src/psaux/psauxerr.h
@@ -4,7 +4,7 @@
/* */
/* PS auxiliary module error codes (specification only). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/psauxmod.c b/thirdparty/freetype/src/psaux/psauxmod.c
index 80805e6951..1f589cefc2 100644
--- a/thirdparty/freetype/src/psaux/psauxmod.c
+++ b/thirdparty/freetype/src/psaux/psauxmod.c
@@ -4,7 +4,7 @@
/* */
/* FreeType auxiliary PostScript module implementation (body). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -30,52 +30,56 @@
FT_CALLBACK_TABLE_DEF
const PS_Table_FuncsRec ps_table_funcs =
{
- ps_table_new,
- ps_table_done,
- ps_table_add,
- ps_table_release
+ ps_table_new, /* init */
+ ps_table_done, /* done */
+ ps_table_add, /* add */
+ ps_table_release /* release */
};
FT_CALLBACK_TABLE_DEF
const PS_Parser_FuncsRec ps_parser_funcs =
{
- ps_parser_init,
- ps_parser_done,
- ps_parser_skip_spaces,
- ps_parser_skip_PS_token,
- ps_parser_to_int,
- ps_parser_to_fixed,
- ps_parser_to_bytes,
- ps_parser_to_coord_array,
- ps_parser_to_fixed_array,
- ps_parser_to_token,
- ps_parser_to_token_array,
- ps_parser_load_field,
- ps_parser_load_field_table
+ ps_parser_init, /* init */
+ ps_parser_done, /* done */
+
+ ps_parser_skip_spaces, /* skip_spaces */
+ ps_parser_skip_PS_token, /* skip_PS_token */
+
+ ps_parser_to_int, /* to_int */
+ ps_parser_to_fixed, /* to_fixed */
+ ps_parser_to_bytes, /* to_bytes */
+ ps_parser_to_coord_array, /* to_coord_array */
+ ps_parser_to_fixed_array, /* to_fixed_array */
+ ps_parser_to_token, /* to_token */
+ ps_parser_to_token_array, /* to_token_array */
+
+ ps_parser_load_field, /* load_field */
+ ps_parser_load_field_table /* load_field_table */
};
FT_CALLBACK_TABLE_DEF
const T1_Builder_FuncsRec t1_builder_funcs =
{
- t1_builder_init,
- t1_builder_done,
- t1_builder_check_points,
- t1_builder_add_point,
- t1_builder_add_point1,
- t1_builder_add_contour,
- t1_builder_start_point,
- t1_builder_close_contour
+ t1_builder_init, /* init */
+ t1_builder_done, /* done */
+
+ t1_builder_check_points, /* check_points */
+ t1_builder_add_point, /* add_point */
+ t1_builder_add_point1, /* add_point1 */
+ t1_builder_add_contour, /* add_contour */
+ t1_builder_start_point, /* start_point */
+ t1_builder_close_contour /* close_contour */
};
FT_CALLBACK_TABLE_DEF
const T1_Decoder_FuncsRec t1_decoder_funcs =
{
- t1_decoder_init,
- t1_decoder_done,
- t1_decoder_parse_charstrings
+ t1_decoder_init, /* init */
+ t1_decoder_done, /* done */
+ t1_decoder_parse_charstrings /* parse_charstrings */
};
@@ -83,9 +87,9 @@
FT_CALLBACK_TABLE_DEF
const AFM_Parser_FuncsRec afm_parser_funcs =
{
- afm_parser_init,
- afm_parser_done,
- afm_parser_parse
+ afm_parser_init, /* init */
+ afm_parser_done, /* done */
+ afm_parser_parse /* parse */
};
#endif
@@ -130,9 +134,9 @@
&psaux_interface, /* module-specific interface */
- (FT_Module_Constructor)0,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) 0
+ (FT_Module_Constructor)NULL, /* module_init */
+ (FT_Module_Destructor) NULL, /* module_done */
+ (FT_Module_Requester) NULL /* get_interface */
};
diff --git a/thirdparty/freetype/src/psaux/psauxmod.h b/thirdparty/freetype/src/psaux/psauxmod.h
index b1dbb06904..926f37eba5 100644
--- a/thirdparty/freetype/src/psaux/psauxmod.h
+++ b/thirdparty/freetype/src/psaux/psauxmod.h
@@ -4,7 +4,7 @@
/* */
/* FreeType auxiliary PostScript module implementation (specification). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/psconv.c b/thirdparty/freetype/src/psaux/psconv.c
index fdaca7fb5d..b092482194 100644
--- a/thirdparty/freetype/src/psaux/psconv.c
+++ b/thirdparty/freetype/src/psaux/psconv.c
@@ -4,7 +4,7 @@
/* */
/* Some convenience conversions (body). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/psconv.h b/thirdparty/freetype/src/psaux/psconv.h
index 062de36413..cab254ac5a 100644
--- a/thirdparty/freetype/src/psaux/psconv.h
+++ b/thirdparty/freetype/src/psaux/psconv.h
@@ -4,7 +4,7 @@
/* */
/* Some convenience conversions (specification). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/psobjs.c b/thirdparty/freetype/src/psaux/psobjs.c
index f208b5fc63..f04edea411 100644
--- a/thirdparty/freetype/src/psaux/psobjs.c
+++ b/thirdparty/freetype/src/psaux/psobjs.c
@@ -4,7 +4,7 @@
/* */
/* Auxiliary functions for PostScript fonts (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -344,7 +344,7 @@
FT_Byte c = *cur;
- ++cur;
+ cur++;
if ( c == '\\' )
{
@@ -370,17 +370,17 @@
case '\\':
case '(':
case ')':
- ++cur;
+ cur++;
break;
default:
/* skip octal escape or ignore backslash */
- for ( i = 0; i < 3 && cur < limit; ++i )
+ for ( i = 0; i < 3 && cur < limit; i++ )
{
if ( !IS_OCTAL_DIGIT( *cur ) )
break;
- ++cur;
+ cur++;
}
}
}
@@ -455,19 +455,19 @@
FT_ASSERT( **acur == '{' );
- for ( cur = *acur; cur < limit && error == FT_Err_Ok; ++cur )
+ for ( cur = *acur; cur < limit && error == FT_Err_Ok; cur++ )
{
switch ( *cur )
{
case '{':
- ++embed;
+ embed++;
break;
case '}':
- --embed;
+ embed--;
if ( embed == 0 )
{
- ++cur;
+ cur++;
goto end;
}
break;
@@ -695,7 +695,7 @@
/* ************ otherwise, it is any token **************/
default:
token->start = cur;
- token->type = ( *cur == '/' ? T1_TOKEN_TYPE_KEY : T1_TOKEN_TYPE_ANY );
+ token->type = ( *cur == '/' ) ? T1_TOKEN_TYPE_KEY : T1_TOKEN_TYPE_ANY;
ps_parser_skip_PS_token( parser );
cur = parser->cursor;
if ( !parser->error )
@@ -750,7 +750,7 @@
if ( !token.type )
break;
- if ( tokens != NULL && cur < limit )
+ if ( tokens && cur < limit )
*cur = token;
cur++;
@@ -815,12 +815,12 @@
old_cur = cur;
- if ( coords != NULL && count >= max_coords )
+ if ( coords && count >= max_coords )
break;
/* call PS_Conv_ToFixed() even if coords == NULL */
/* to properly parse number at `cur' */
- *( coords != NULL ? &coords[count] : &dummy ) =
+ *( coords ? &coords[count] : &dummy ) =
(FT_Short)( PS_Conv_ToFixed( &cur, limit, 0 ) >> 16 );
if ( old_cur == cur )
@@ -895,12 +895,12 @@
old_cur = cur;
- if ( values != NULL && count >= max_values )
+ if ( values && count >= max_values )
break;
/* call PS_Conv_ToFixed() even if coords == NULL */
/* to properly parse number at `cur' */
- *( values != NULL ? &values[count] : &dummy ) =
+ *( values ? &values[count] : &dummy ) =
PS_Conv_ToFixed( &cur, limit, power_ten );
if ( old_cur == cur )
@@ -1172,7 +1172,7 @@
/* for this to work (FT_String**)q must have been */
/* initialized to NULL */
- if ( *(FT_String**)q != NULL )
+ if ( *(FT_String**)q )
{
FT_TRACE0(( "ps_parser_load_field: overwriting field %s\n",
field->ident ));
@@ -1551,7 +1551,7 @@
builder->current = &loader->current.outline;
FT_GlyphLoader_Rewind( loader );
- builder->hints_globals = size->internal;
+ builder->hints_globals = size->internal->module_data;
builder->hints_funcs = NULL;
if ( hinting )
@@ -1718,6 +1718,14 @@
first = outline->n_contours <= 1
? 0 : outline->contours[outline->n_contours - 2] + 1;
+ /* in malformed fonts it can happen that a contour was started */
+ /* but no points were added */
+ if ( outline->n_contours && first == outline->n_points )
+ {
+ outline->n_contours--;
+ return;
+ }
+
/* We must not include the last point in the path if it */
/* is located on the first point. */
if ( outline->n_points > 1 )
diff --git a/thirdparty/freetype/src/psaux/psobjs.h b/thirdparty/freetype/src/psaux/psobjs.h
index 4c7178e79f..202e5b2416 100644
--- a/thirdparty/freetype/src/psaux/psobjs.h
+++ b/thirdparty/freetype/src/psaux/psobjs.h
@@ -4,7 +4,7 @@
/* */
/* Auxiliary functions for PostScript fonts (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/rules.mk b/thirdparty/freetype/src/psaux/rules.mk
index 19787b5f82..542ae12d2b 100644
--- a/thirdparty/freetype/src/psaux/rules.mk
+++ b/thirdparty/freetype/src/psaux/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/psaux/t1cmap.c b/thirdparty/freetype/src/psaux/t1cmap.c
index 43abb98615..45b713eb7b 100644
--- a/thirdparty/freetype/src/psaux/t1cmap.c
+++ b/thirdparty/freetype/src/psaux/t1cmap.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 character map support (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -45,7 +45,7 @@
cmap->code_to_sid = is_expert ? psnames->adobe_expert_encoding
: psnames->adobe_std_encoding;
- FT_ASSERT( cmap->code_to_sid != NULL );
+ FT_ASSERT( cmap->code_to_sid );
}
@@ -136,12 +136,16 @@
{
sizeof ( T1_CMapStdRec ),
- (FT_CMap_InitFunc) t1_cmap_standard_init,
- (FT_CMap_DoneFunc) t1_cmap_std_done,
- (FT_CMap_CharIndexFunc)t1_cmap_std_char_index,
- (FT_CMap_CharNextFunc) t1_cmap_std_char_next,
+ (FT_CMap_InitFunc) t1_cmap_standard_init, /* init */
+ (FT_CMap_DoneFunc) t1_cmap_std_done, /* done */
+ (FT_CMap_CharIndexFunc)t1_cmap_std_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) t1_cmap_std_char_next, /* char_next */
- NULL, NULL, NULL, NULL, NULL
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL /* variantchar_list */
};
@@ -161,12 +165,16 @@
{
sizeof ( T1_CMapStdRec ),
- (FT_CMap_InitFunc) t1_cmap_expert_init,
- (FT_CMap_DoneFunc) t1_cmap_std_done,
- (FT_CMap_CharIndexFunc)t1_cmap_std_char_index,
- (FT_CMap_CharNextFunc) t1_cmap_std_char_next,
+ (FT_CMap_InitFunc) t1_cmap_expert_init, /* init */
+ (FT_CMap_DoneFunc) t1_cmap_std_done, /* done */
+ (FT_CMap_CharIndexFunc)t1_cmap_std_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) t1_cmap_std_char_next, /* char_next */
- NULL, NULL, NULL, NULL, NULL
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL /* variantchar_list */
};
@@ -193,7 +201,7 @@
cmap->count = (FT_UInt)encoding->code_last - cmap->first;
cmap->indices = encoding->char_index;
- FT_ASSERT( cmap->indices != NULL );
+ FT_ASSERT( cmap->indices );
FT_ASSERT( encoding->code_first <= encoding->code_last );
return 0;
@@ -232,7 +240,7 @@
FT_UInt32 char_code = *pchar_code;
- ++char_code;
+ char_code++;
if ( char_code < cmap->first )
char_code = cmap->first;
@@ -257,12 +265,16 @@
{
sizeof ( T1_CMapCustomRec ),
- (FT_CMap_InitFunc) t1_cmap_custom_init,
- (FT_CMap_DoneFunc) t1_cmap_custom_done,
- (FT_CMap_CharIndexFunc)t1_cmap_custom_char_index,
- (FT_CMap_CharNextFunc) t1_cmap_custom_char_next,
+ (FT_CMap_InitFunc) t1_cmap_custom_init, /* init */
+ (FT_CMap_DoneFunc) t1_cmap_custom_done, /* done */
+ (FT_CMap_CharIndexFunc)t1_cmap_custom_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) t1_cmap_custom_char_next, /* char_next */
- NULL, NULL, NULL, NULL, NULL
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL /* variantchar_list */
};
@@ -343,12 +355,16 @@
{
sizeof ( PS_UnicodesRec ),
- (FT_CMap_InitFunc) t1_cmap_unicode_init,
- (FT_CMap_DoneFunc) t1_cmap_unicode_done,
- (FT_CMap_CharIndexFunc)t1_cmap_unicode_char_index,
- (FT_CMap_CharNextFunc) t1_cmap_unicode_char_next,
+ (FT_CMap_InitFunc) t1_cmap_unicode_init, /* init */
+ (FT_CMap_DoneFunc) t1_cmap_unicode_done, /* done */
+ (FT_CMap_CharIndexFunc)t1_cmap_unicode_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) t1_cmap_unicode_char_next, /* char_next */
- NULL, NULL, NULL, NULL, NULL
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL /* variantchar_list */
};
diff --git a/thirdparty/freetype/src/psaux/t1cmap.h b/thirdparty/freetype/src/psaux/t1cmap.h
index 5e1277dc63..7870245a3a 100644
--- a/thirdparty/freetype/src/psaux/t1cmap.h
+++ b/thirdparty/freetype/src/psaux/t1cmap.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 character map support (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/t1decode.c b/thirdparty/freetype/src/psaux/t1decode.c
index 98f6ce1c87..7dd45135de 100644
--- a/thirdparty/freetype/src/psaux/t1decode.c
+++ b/thirdparty/freetype/src/psaux/t1decode.c
@@ -4,7 +4,7 @@
/* */
/* PostScript Type 1 decoding routines (body). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -405,9 +405,7 @@
( decoder->buildchar == NULL ) );
if ( decoder->buildchar && decoder->len_buildchar > 0 )
- ft_memset( &decoder->buildchar[0],
- 0,
- sizeof ( decoder->buildchar[0] ) * decoder->len_buildchar );
+ FT_ARRAY_ZERO( decoder->buildchar, decoder->len_buildchar );
FT_TRACE4(( "\n"
"Start charstring\n" ));
@@ -668,9 +666,9 @@
#ifdef FT_DEBUG_LEVEL_TRACE
if ( large_int )
- FT_TRACE4(( " %ld", value ));
+ FT_TRACE4(( " %d", value ));
else
- FT_TRACE4(( " %ld", value / 65536 ));
+ FT_TRACE4(( " %d", value / 65536 ));
#endif
*top++ = value;
@@ -736,7 +734,7 @@
if ( arg_cnt != 3 )
goto Unexpected_OtherSubr;
- if ( decoder->flex_state == 0 ||
+ if ( !decoder->flex_state ||
decoder->num_flex_vectors != 7 )
{
FT_ERROR(( "t1_decoder_parse_charstrings:"
@@ -754,13 +752,12 @@
if ( arg_cnt != 0 )
goto Unexpected_OtherSubr;
+ if ( FT_SET_ERROR( t1_builder_start_point( builder, x, y ) ) ||
+ FT_SET_ERROR( t1_builder_check_points( builder, 6 ) ) )
+ goto Fail;
+
decoder->flex_state = 1;
decoder->num_flex_vectors = 0;
- if ( ( error = t1_builder_start_point( builder, x, y ) )
- != FT_Err_Ok ||
- ( error = t1_builder_check_points( builder, 6 ) )
- != FT_Err_Ok )
- goto Fail;
break;
case 2: /* add flex vectors */
@@ -771,7 +768,7 @@
if ( arg_cnt != 0 )
goto Unexpected_OtherSubr;
- if ( decoder->flex_state == 0 )
+ if ( !decoder->flex_state )
{
FT_ERROR(( "t1_decoder_parse_charstrings:"
" missing flex start\n" ));
@@ -783,10 +780,19 @@
/* point without adding any point to the outline */
idx = decoder->num_flex_vectors++;
if ( idx > 0 && idx < 7 )
+ {
+ /* in malformed fonts it is possible to have other */
+ /* opcodes in the middle of a flex (which don't */
+ /* increase `num_flex_vectors'); we thus have to */
+ /* check whether we can add a point */
+ if ( FT_SET_ERROR( t1_builder_check_points( builder, 1 ) ) )
+ goto Syntax_Error;
+
t1_builder_add_point( builder,
x,
y,
(FT_Byte)( idx == 3 || idx == 6 ) );
+ }
}
break;
@@ -876,7 +882,7 @@
PS_Blend blend = decoder->blend;
- if ( arg_cnt != 1 || blend == NULL )
+ if ( arg_cnt != 1 || !blend )
goto Unexpected_OtherSubr;
idx = Fix2Int( top[0] );
@@ -944,7 +950,7 @@
PS_Blend blend = decoder->blend;
- if ( arg_cnt != 2 || blend == NULL )
+ if ( arg_cnt != 2 || !blend )
goto Unexpected_OtherSubr;
idx = Fix2Int( top[1] );
@@ -965,7 +971,7 @@
PS_Blend blend = decoder->blend;
- if ( arg_cnt != 1 || blend == NULL )
+ if ( arg_cnt != 1 || !blend )
goto Unexpected_OtherSubr;
idx = Fix2Int( top[0] );
@@ -1123,7 +1129,7 @@
FT_TRACE4(( "BuildCharArray = [ " ));
- for ( i = 0; i < decoder->len_buildchar; ++i )
+ for ( i = 0; i < decoder->len_buildchar; i++ )
FT_TRACE4(( "%d ", decoder->buildchar[i] ));
FT_TRACE4(( "]\n" ));
@@ -1201,8 +1207,7 @@
case op_hlineto:
FT_TRACE4(( " hlineto" ));
- if ( ( error = t1_builder_start_point( builder, x, y ) )
- != FT_Err_Ok )
+ if ( FT_SET_ERROR( t1_builder_start_point( builder, x, y ) ) )
goto Fail;
x += top[0];
@@ -1223,10 +1228,8 @@
case op_hvcurveto:
FT_TRACE4(( " hvcurveto" ));
- if ( ( error = t1_builder_start_point( builder, x, y ) )
- != FT_Err_Ok ||
- ( error = t1_builder_check_points( builder, 3 ) )
- != FT_Err_Ok )
+ if ( FT_SET_ERROR( t1_builder_start_point( builder, x, y ) ) ||
+ FT_SET_ERROR( t1_builder_check_points( builder, 3 ) ) )
goto Fail;
x += top[0];
@@ -1241,16 +1244,14 @@
case op_rlineto:
FT_TRACE4(( " rlineto" ));
- if ( ( error = t1_builder_start_point( builder, x, y ) )
- != FT_Err_Ok )
+ if ( FT_SET_ERROR( t1_builder_start_point( builder, x, y ) ) )
goto Fail;
x += top[0];
y += top[1];
Add_Line:
- if ( ( error = t1_builder_add_point1( builder, x, y ) )
- != FT_Err_Ok )
+ if ( FT_SET_ERROR( t1_builder_add_point1( builder, x, y ) ) )
goto Fail;
break;
@@ -1270,10 +1271,8 @@
case op_rrcurveto:
FT_TRACE4(( " rrcurveto" ));
- if ( ( error = t1_builder_start_point( builder, x, y ) )
- != FT_Err_Ok ||
- ( error = t1_builder_check_points( builder, 3 ) )
- != FT_Err_Ok )
+ if ( FT_SET_ERROR( t1_builder_start_point( builder, x, y ) ) ||
+ FT_SET_ERROR( t1_builder_check_points( builder, 3 ) ) )
goto Fail;
x += top[0];
@@ -1292,10 +1291,8 @@
case op_vhcurveto:
FT_TRACE4(( " vhcurveto" ));
- if ( ( error = t1_builder_start_point( builder, x, y ) )
- != FT_Err_Ok ||
- ( error = t1_builder_check_points( builder, 3 ) )
- != FT_Err_Ok )
+ if ( FT_SET_ERROR( t1_builder_start_point( builder, x, y ) ) ||
+ FT_SET_ERROR( t1_builder_check_points( builder, 3 ) ) )
goto Fail;
y += top[0];
@@ -1310,8 +1307,7 @@
case op_vlineto:
FT_TRACE4(( " vlineto" ));
- if ( ( error = t1_builder_start_point( builder, x, y ) )
- != FT_Err_Ok )
+ if ( FT_SET_ERROR( t1_builder_start_point( builder, x, y ) ) )
goto Fail;
y += top[0];
@@ -1336,7 +1332,7 @@
/* otherwise, we divide numbers in 16.16 format -- */
/* in both cases, it is the same operation */
*top = FT_DivFix( top[0], top[1] );
- ++top;
+ top++;
large_int = FALSE;
break;
@@ -1591,7 +1587,7 @@
FT_Render_Mode hint_mode,
T1_Decoder_Callback parse_callback )
{
- FT_MEM_ZERO( decoder, sizeof ( *decoder ) );
+ FT_ZERO( decoder );
/* retrieve PSNames interface from list of current modules */
{
diff --git a/thirdparty/freetype/src/psaux/t1decode.h b/thirdparty/freetype/src/psaux/t1decode.h
index 0f5adfa156..12c27de775 100644
--- a/thirdparty/freetype/src/psaux/t1decode.h
+++ b/thirdparty/freetype/src/psaux/t1decode.h
@@ -4,7 +4,7 @@
/* */
/* PostScript Type 1 decoding routines (specification). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/module.mk b/thirdparty/freetype/src/pshinter/module.mk
index 63110c46a6..77e35c4c10 100644
--- a/thirdparty/freetype/src/pshinter/module.mk
+++ b/thirdparty/freetype/src/pshinter/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/pshinter/pshalgo.c b/thirdparty/freetype/src/pshinter/pshalgo.c
index 8f131be759..9ad1a3a02a 100644
--- a/thirdparty/freetype/src/pshinter/pshalgo.c
+++ b/thirdparty/freetype/src/pshinter/pshalgo.c
@@ -4,7 +4,7 @@
/* */
/* PostScript hinting algorithm (body). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -898,7 +898,7 @@
static void
psh_print_zone( PSH_Zone zone )
{
- printf( "zone [scale,delta,min,max] = [%.3f,%.3f,%d,%d]\n",
+ printf( "zone [scale,delta,min,max] = [%.5f,%.2f,%d,%d]\n",
zone->scale / 65536.0,
zone->delta / 64.0,
zone->min,
@@ -1162,7 +1162,7 @@
/* clear all fields */
- FT_MEM_ZERO( glyph, sizeof ( *glyph ) );
+ FT_ZERO( glyph );
memory = glyph->memory = globals->memory;
@@ -1531,7 +1531,7 @@
}
}
- if ( point->hint == NULL )
+ if ( !point->hint )
{
for ( nn = 0; nn < num_hints; nn++ )
{
@@ -1572,8 +1572,8 @@
PS_Mask mask = table->hint_masks->masks;
FT_UInt num_masks = table->hint_masks->num_masks;
FT_UInt first = 0;
- FT_Int major_dir = dimension == 0 ? PSH_DIR_VERTICAL
- : PSH_DIR_HORIZONTAL;
+ FT_Int major_dir = ( dimension == 0 ) ? PSH_DIR_VERTICAL
+ : PSH_DIR_HORIZONTAL;
PSH_Dimension dim = &glyph->globals->dimension[dimension];
FT_Fixed scale = dim->scale_mult;
FT_Int threshold;
diff --git a/thirdparty/freetype/src/pshinter/pshalgo.h b/thirdparty/freetype/src/pshinter/pshalgo.h
index f1bda65013..62e97d152b 100644
--- a/thirdparty/freetype/src/pshinter/pshalgo.h
+++ b/thirdparty/freetype/src/pshinter/pshalgo.h
@@ -4,7 +4,7 @@
/* */
/* PostScript hinting algorithm (specification). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshglob.c b/thirdparty/freetype/src/pshinter/pshglob.c
index 2ac5ef1558..c68770c73a 100644
--- a/thirdparty/freetype/src/pshinter/pshglob.c
+++ b/thirdparty/freetype/src/pshinter/pshglob.c
@@ -5,7 +5,7 @@
/* PostScript hinter global hinting management (body). */
/* Inspired by the new auto-hinter module. */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
diff --git a/thirdparty/freetype/src/pshinter/pshglob.h b/thirdparty/freetype/src/pshinter/pshglob.h
index 45c957b6ef..8801cbada4 100644
--- a/thirdparty/freetype/src/pshinter/pshglob.h
+++ b/thirdparty/freetype/src/pshinter/pshglob.h
@@ -4,7 +4,7 @@
/* */
/* PostScript hinter global hinting management. */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshinter.c b/thirdparty/freetype/src/pshinter/pshinter.c
index 614e0bb3d8..13e07e1485 100644
--- a/thirdparty/freetype/src/pshinter/pshinter.c
+++ b/thirdparty/freetype/src/pshinter/pshinter.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PostScript Hinting module */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,13 +17,13 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
#include <ft2build.h>
-#include "pshpic.c"
-#include "pshrec.c"
-#include "pshglob.c"
+
#include "pshalgo.c"
+#include "pshglob.c"
#include "pshmod.c"
+#include "pshpic.c"
+#include "pshrec.c"
/* END */
diff --git a/thirdparty/freetype/src/pshinter/pshmod.c b/thirdparty/freetype/src/pshinter/pshmod.c
index fa4ad1f564..860dc0ae82 100644
--- a/thirdparty/freetype/src/pshinter/pshmod.c
+++ b/thirdparty/freetype/src/pshinter/pshmod.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PostScript hinter module implementation (body). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -95,9 +95,11 @@
FT_DEFINE_PSHINTER_INTERFACE(
pshinter_interface,
+
pshinter_get_globals_funcs,
pshinter_get_t1_funcs,
- pshinter_get_t2_funcs )
+ pshinter_get_t2_funcs
+ )
FT_DEFINE_MODULE(
@@ -111,9 +113,9 @@
&PSHINTER_INTERFACE_GET, /* module-specific interface */
- (FT_Module_Constructor)ps_hinter_init,
- (FT_Module_Destructor) ps_hinter_done,
- (FT_Module_Requester) NULL ) /* no additional interface for now */
-
+ (FT_Module_Constructor)ps_hinter_init, /* module_init */
+ (FT_Module_Destructor) ps_hinter_done, /* module_done */
+ (FT_Module_Requester) NULL /* get_interface */
+ )
/* END */
diff --git a/thirdparty/freetype/src/pshinter/pshmod.h b/thirdparty/freetype/src/pshinter/pshmod.h
index 39112a9561..1d2b40fa13 100644
--- a/thirdparty/freetype/src/pshinter/pshmod.h
+++ b/thirdparty/freetype/src/pshinter/pshmod.h
@@ -4,7 +4,7 @@
/* */
/* PostScript hinter module interface (specification). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshnterr.h b/thirdparty/freetype/src/pshinter/pshnterr.h
index 7a94588b87..73d144e34c 100644
--- a/thirdparty/freetype/src/pshinter/pshnterr.h
+++ b/thirdparty/freetype/src/pshinter/pshnterr.h
@@ -4,7 +4,7 @@
/* */
/* PS Hinter error codes (specification only). */
/* */
-/* Copyright 2003-2016 by */
+/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshpic.c b/thirdparty/freetype/src/pshinter/pshpic.c
index d0a3d8ebc9..c0d3a64f29 100644
--- a/thirdparty/freetype/src/pshinter/pshpic.c
+++ b/thirdparty/freetype/src/pshinter/pshpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for pshinter module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshpic.h b/thirdparty/freetype/src/pshinter/pshpic.h
index 75ee573544..8d9a01c9c5 100644
--- a/thirdparty/freetype/src/pshinter/pshpic.h
+++ b/thirdparty/freetype/src/pshinter/pshpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for pshinter module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshrec.c b/thirdparty/freetype/src/pshinter/pshrec.c
index d7cc4a0d21..fff6d34250 100644
--- a/thirdparty/freetype/src/pshinter/pshrec.c
+++ b/thirdparty/freetype/src/pshinter/pshrec.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PostScript hints recorder (body). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -818,7 +818,7 @@
ps_hints_init( PS_Hints hints,
FT_Memory memory )
{
- FT_MEM_ZERO( hints, sizeof ( *hints ) );
+ FT_ZERO( hints );
hints->memory = memory;
}
@@ -1140,7 +1140,7 @@
FT_LOCAL_DEF( void )
t1_hints_funcs_init( T1_Hints_FuncsRec* funcs )
{
- FT_MEM_ZERO( (char*)funcs, sizeof ( *funcs ) );
+ FT_ZERO( funcs );
funcs->open = (T1_Hints_OpenFunc) t1_hints_open;
funcs->close = (T1_Hints_CloseFunc) ps_hints_close;
@@ -1206,7 +1206,7 @@
FT_LOCAL_DEF( void )
t2_hints_funcs_init( T2_Hints_FuncsRec* funcs )
{
- FT_MEM_ZERO( funcs, sizeof ( *funcs ) );
+ FT_ZERO( funcs );
funcs->open = (T2_Hints_OpenFunc) t2_hints_open;
funcs->close = (T2_Hints_CloseFunc) ps_hints_close;
diff --git a/thirdparty/freetype/src/pshinter/pshrec.h b/thirdparty/freetype/src/pshinter/pshrec.h
index 97e6f0ed51..e10bc2b120 100644
--- a/thirdparty/freetype/src/pshinter/pshrec.h
+++ b/thirdparty/freetype/src/pshinter/pshrec.h
@@ -4,7 +4,7 @@
/* */
/* Postscript (Type1/Type2) hints recorder (specification). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/rules.mk b/thirdparty/freetype/src/pshinter/rules.mk
index 67ecf7862f..2be6404380 100644
--- a/thirdparty/freetype/src/pshinter/rules.mk
+++ b/thirdparty/freetype/src/pshinter/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2001-2016 by
+# Copyright 2001-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/psnames/module.mk b/thirdparty/freetype/src/psnames/module.mk
index ba29af813c..ddd22960c1 100644
--- a/thirdparty/freetype/src/psnames/module.mk
+++ b/thirdparty/freetype/src/psnames/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/psnames/psmodule.c b/thirdparty/freetype/src/psnames/psmodule.c
index 345402d7cc..3ff8cb911b 100644
--- a/thirdparty/freetype/src/psnames/psmodule.c
+++ b/thirdparty/freetype/src/psnames/psmodule.c
@@ -4,7 +4,7 @@
/* */
/* PSNames module implementation (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,6 +22,9 @@
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include "psmodule.h"
+
+#include "pstables.h"
+#define DEFINE_PS_TABLES
#include "pstables.h"
#include "psnamerr.h"
@@ -525,6 +528,7 @@
FT_DEFINE_SERVICE_PSCMAPSREC(
pscmaps_interface,
+
(PS_Unicode_ValueFunc) ps_unicode_value, /* unicode_value */
(PS_Unicodes_InitFunc) ps_unicodes_init, /* unicodes_init */
(PS_Unicodes_CharIndexFunc)ps_unicodes_char_index, /* unicodes_char_index */
@@ -534,12 +538,14 @@
(PS_Adobe_Std_StringsFunc) ps_get_standard_strings, /* adobe_std_strings */
t1_standard_encoding, /* adobe_std_encoding */
- t1_expert_encoding ) /* adobe_expert_encoding */
+ t1_expert_encoding /* adobe_expert_encoding */
+ )
#else
FT_DEFINE_SERVICE_PSCMAPSREC(
pscmaps_interface,
+
NULL, /* unicode_value */
NULL, /* unicodes_init */
NULL, /* unicodes_char_index */
@@ -549,13 +555,15 @@
(PS_Adobe_Std_StringsFunc) ps_get_standard_strings, /* adobe_std_strings */
t1_standard_encoding, /* adobe_std_encoding */
- t1_expert_encoding ) /* adobe_expert_encoding */
+ t1_expert_encoding /* adobe_expert_encoding */
+ )
#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
FT_DEFINE_SERVICEDESCREC1(
pscmaps_services,
+
FT_SERVICE_ID_POSTSCRIPT_CMAPS, &PSCMAPS_INTERFACE_GET )
@@ -601,9 +609,11 @@
PUT_PS_NAMES_SERVICE(
(void*)&PSCMAPS_INTERFACE_GET ), /* module specific interface */
- (FT_Module_Constructor)NULL,
- (FT_Module_Destructor) NULL,
- (FT_Module_Requester) PUT_PS_NAMES_SERVICE( psnames_get_service ) )
+
+ (FT_Module_Constructor)NULL, /* module_init */
+ (FT_Module_Destructor) NULL, /* module_done */
+ (FT_Module_Requester) PUT_PS_NAMES_SERVICE( psnames_get_service ) /* get_interface */
+ )
/* END */
diff --git a/thirdparty/freetype/src/psnames/psmodule.h b/thirdparty/freetype/src/psnames/psmodule.h
index ee3c6cb631..6983b79234 100644
--- a/thirdparty/freetype/src/psnames/psmodule.h
+++ b/thirdparty/freetype/src/psnames/psmodule.h
@@ -4,7 +4,7 @@
/* */
/* High-level PSNames module interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psnames/psnamerr.h b/thirdparty/freetype/src/psnames/psnamerr.h
index 3a9f65323b..f90bf5ea43 100644
--- a/thirdparty/freetype/src/psnames/psnamerr.h
+++ b/thirdparty/freetype/src/psnames/psnamerr.h
@@ -4,7 +4,7 @@
/* */
/* PS names module error codes (specification only). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psnames/psnames.c b/thirdparty/freetype/src/psnames/psnames.c
index e7b2c0b5ef..22466d6230 100644
--- a/thirdparty/freetype/src/psnames/psnames.c
+++ b/thirdparty/freetype/src/psnames/psnames.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PSNames module component (body only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,10 +17,10 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
#include <ft2build.h>
-#include "pspic.c"
+
#include "psmodule.c"
+#include "pspic.c"
/* END */
diff --git a/thirdparty/freetype/src/psnames/pspic.c b/thirdparty/freetype/src/psnames/pspic.c
index a78ec5aa81..8b9003439b 100644
--- a/thirdparty/freetype/src/psnames/pspic.c
+++ b/thirdparty/freetype/src/psnames/pspic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for psnames module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psnames/pspic.h b/thirdparty/freetype/src/psnames/pspic.h
index 48348765cf..14497e73fa 100644
--- a/thirdparty/freetype/src/psnames/pspic.h
+++ b/thirdparty/freetype/src/psnames/pspic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for psnames module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psnames/pstables.h b/thirdparty/freetype/src/psnames/pstables.h
index eb827fa5ea..e0f5e30804 100644
--- a/thirdparty/freetype/src/psnames/pstables.h
+++ b/thirdparty/freetype/src/psnames/pstables.h
@@ -4,7 +4,7 @@
/* */
/* PostScript glyph names. */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -19,7 +19,16 @@
/* This file has been generated automatically -- do not edit! */
- static const char ft_standard_glyph_names[3696] =
+#ifndef DEFINE_PS_TABLES
+#ifdef __cplusplus
+ extern "C"
+#else
+ extern
+#endif
+#endif
+ const char ft_standard_glyph_names[3696]
+#ifdef DEFINE_PS_TABLES
+ =
{
'.','n','u','l','l', 0,
'n','o','n','m','a','r','k','i','n','g','r','e','t','u','r','n', 0,
@@ -441,14 +450,25 @@
'R','e','g','u','l','a','r', 0,
'R','o','m','a','n', 0,
'S','e','m','i','b','o','l','d', 0,
- };
+ }
+#endif /* DEFINE_PS_TABLES */
+ ;
#define FT_NUM_MAC_NAMES 258
/* Values are offsets into the `ft_standard_glyph_names' table */
- static const short ft_mac_names[FT_NUM_MAC_NAMES] =
+#ifndef DEFINE_PS_TABLES
+#ifdef __cplusplus
+ extern "C"
+#else
+ extern
+#endif
+#endif
+ const short ft_mac_names[FT_NUM_MAC_NAMES]
+#ifdef DEFINE_PS_TABLES
+ =
{
253, 0, 6, 261, 267, 274, 283, 294, 301, 309, 758, 330, 340, 351,
360, 365, 371, 378, 385, 391, 396, 400, 404, 410, 415, 420, 424, 430,
@@ -469,14 +489,25 @@
1066,1073,1101,1143,1536,1783,1596,1843,1253,1207,1319,1579,1826,1229,
1270,1313,1323,1171,1290,1332,1211,1235,1276, 169, 175, 182, 189, 200,
209, 218, 225, 232, 239, 246
- };
+ }
+#endif /* DEFINE_PS_TABLES */
+ ;
#define FT_NUM_SID_NAMES 391
/* Values are offsets into the `ft_standard_glyph_names' table */
- static const short ft_sid_names[FT_NUM_SID_NAMES] =
+#ifndef DEFINE_PS_TABLES
+#ifdef __cplusplus
+ extern "C"
+#else
+ extern
+#endif
+#endif
+ const short ft_sid_names[FT_NUM_SID_NAMES]
+#ifdef DEFINE_PS_TABLES
+ =
{
253, 261, 267, 274, 283, 294, 301, 309, 319, 330, 340, 351, 360, 365,
371, 378, 385, 391, 396, 400, 404, 410, 415, 420, 424, 430, 436, 441,
@@ -506,11 +537,22 @@
3237,3249,3264,3275,3283,3297,3309,3321,3338,3353,3365,3377,3394,3409,
3418,3430,3442,3454,3471,3483,3498,3506,3518,3530,3542,3559,3574,3586,
3597,3612,3620,3628,3636,3644,3650,3655,3660,3666,3673,3681,3687
- };
+ }
+#endif /* DEFINE_PS_TABLES */
+ ;
/* the following are indices into the SID name table */
- static const unsigned short t1_standard_encoding[256] =
+#ifndef DEFINE_PS_TABLES
+#ifdef __cplusplus
+ extern "C"
+#else
+ extern
+#endif
+#endif
+ const unsigned short t1_standard_encoding[256]
+#ifdef DEFINE_PS_TABLES
+ =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -528,11 +570,22 @@
137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,138, 0,139, 0, 0, 0, 0,140,141,142,143, 0, 0, 0, 0,
0,144, 0, 0, 0,145, 0, 0,146,147,148,149, 0, 0, 0, 0
- };
+ }
+#endif /* DEFINE_PS_TABLES */
+ ;
/* the following are indices into the SID name table */
- static const unsigned short t1_expert_encoding[256] =
+#ifndef DEFINE_PS_TABLES
+#ifdef __cplusplus
+ extern "C"
+#else
+ extern
+#endif
+#endif
+ const unsigned short t1_expert_encoding[256]
+#ifdef DEFINE_PS_TABLES
+ =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -550,7 +603,9 @@
331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,
347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,
363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378
- };
+ }
+#endif /* DEFINE_PS_TABLES */
+ ;
/*
@@ -564,7 +619,16 @@
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
- static const unsigned char ft_adobe_glyph_list[55997L] =
+#ifndef DEFINE_PS_TABLES
+#ifdef __cplusplus
+ extern "C"
+#else
+ extern
+#endif
+#endif
+ const unsigned char ft_adobe_glyph_list[55997L]
+#ifdef DEFINE_PS_TABLES
+ =
{
0, 52, 0,106, 2,167, 3, 63, 4,220, 6,125, 9,143, 10, 23,
11,137, 12,199, 14,246, 15, 87, 16,233, 17,219, 18,104, 19, 88,
@@ -4066,9 +4130,12 @@
248,232,239,239,107,128, 2,144,243,244,242,239,235,101,128, 1,
182,117, 2,218,167,218,178,232,233,242,225,231,225,238, 97,128,
48, 90,235,225,244,225,235,225,238, 97,128, 48,186
- };
+ }
+#endif /* DEFINE_PS_TABLES */
+ ;
+#ifdef DEFINE_PS_TABLES
/*
* This function searches the compressed table efficiently.
*/
@@ -4163,6 +4230,7 @@
NotFound:
return 0;
}
+#endif /* DEFINE_PS_TABLES */
#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
diff --git a/thirdparty/freetype/src/psnames/rules.mk b/thirdparty/freetype/src/psnames/rules.mk
index 9849f4053a..69fa732200 100644
--- a/thirdparty/freetype/src/psnames/rules.mk
+++ b/thirdparty/freetype/src/psnames/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/raster/ftmisc.h b/thirdparty/freetype/src/raster/ftmisc.h
index 981ce32279..d1e6627ab4 100644
--- a/thirdparty/freetype/src/raster/ftmisc.h
+++ b/thirdparty/freetype/src/raster/ftmisc.h
@@ -5,7 +5,7 @@
/* Miscellaneous macros for stand-alone rasterizer (specification */
/* only). */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
diff --git a/thirdparty/freetype/src/raster/ftraster.c b/thirdparty/freetype/src/raster/ftraster.c
index 0fa2f2687f..c5643f6334 100644
--- a/thirdparty/freetype/src/raster/ftraster.c
+++ b/thirdparty/freetype/src/raster/ftraster.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -251,6 +251,10 @@
#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count )
#endif
+#ifndef FT_ZERO
+#define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) )
+#endif
+
/* FMulDiv means `Fast MulDiv'; it is used in case where `b' is */
/* typically a small value and the result of a*b is known to fit into */
/* 32 bits. */
@@ -1516,8 +1520,9 @@
state_bez = y1 < y3 ? Ascending_State : Descending_State;
if ( ras.state != state_bez )
{
- Bool o = state_bez == Ascending_State ? IS_BOTTOM_OVERSHOOT( y1 )
- : IS_TOP_OVERSHOOT( y1 );
+ Bool o = ( state_bez == Ascending_State )
+ ? IS_BOTTOM_OVERSHOOT( y1 )
+ : IS_TOP_OVERSHOOT( y1 );
/* finalize current profile if any */
@@ -1652,8 +1657,9 @@
/* detect a change of direction */
if ( ras.state != state_bez )
{
- Bool o = state_bez == Ascending_State ? IS_BOTTOM_OVERSHOOT( y1 )
- : IS_TOP_OVERSHOOT( y1 );
+ Bool o = ( state_bez == Ascending_State )
+ ? IS_BOTTOM_OVERSHOOT( y1 )
+ : IS_TOP_OVERSHOOT( y1 );
/* finalize current profile if any */
@@ -2386,7 +2392,7 @@
pxl = e2;
/* check that the other pixel isn't set */
- e1 = pxl == e1 ? e2 : e1;
+ e1 = ( pxl == e1 ) ? e2 : e1;
e1 = TRUNC( e1 );
@@ -2587,7 +2593,7 @@
pxl = e2;
/* check that the other pixel isn't set */
- e1 = pxl == e1 ? e2 : e1;
+ e1 = ( pxl == e1 ) ? e2 : e1;
e1 = TRUNC( e1 );
@@ -3057,7 +3063,7 @@
*araster = (FT_Raster)&the_raster;
- FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) );
+ FT_ZERO( &the_raster );
ft_black_init( &the_raster );
return 0;
@@ -3208,11 +3214,12 @@
FT_GLYPH_FORMAT_OUTLINE,
- (FT_Raster_New_Func) ft_black_new,
- (FT_Raster_Reset_Func) ft_black_reset,
- (FT_Raster_Set_Mode_Func)ft_black_set_mode,
- (FT_Raster_Render_Func) ft_black_render,
- (FT_Raster_Done_Func) ft_black_done )
+ (FT_Raster_New_Func) ft_black_new, /* raster_new */
+ (FT_Raster_Reset_Func) ft_black_reset, /* raster_reset */
+ (FT_Raster_Set_Mode_Func)ft_black_set_mode, /* raster_set_mode */
+ (FT_Raster_Render_Func) ft_black_render, /* raster_render */
+ (FT_Raster_Done_Func) ft_black_done /* raster_done */
+ )
/* END */
diff --git a/thirdparty/freetype/src/raster/ftraster.h b/thirdparty/freetype/src/raster/ftraster.h
index 65cd5f9609..6b3050cb3d 100644
--- a/thirdparty/freetype/src/raster/ftraster.h
+++ b/thirdparty/freetype/src/raster/ftraster.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
diff --git a/thirdparty/freetype/src/raster/ftrend1.c b/thirdparty/freetype/src/raster/ftrend1.c
index 494f112234..1a83e9e477 100644
--- a/thirdparty/freetype/src/raster/ftrend1.c
+++ b/thirdparty/freetype/src/raster/ftrend1.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer interface (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -88,7 +88,7 @@
FT_GlyphSlot slot,
FT_BBox* cbox )
{
- FT_MEM_ZERO( cbox, sizeof ( *cbox ) );
+ FT_ZERO( cbox );
if ( slot->format == render->glyph_format )
FT_Outline_Get_CBox( &slot->outline, cbox );
@@ -224,7 +224,8 @@
}
- FT_DEFINE_RENDERER( ft_raster1_renderer_class,
+ FT_DEFINE_RENDERER(
+ ft_raster1_renderer_class,
FT_MODULE_RENDERER,
sizeof ( FT_RendererRec ),
@@ -233,21 +234,20 @@
0x10000L,
0x20000L,
- 0, /* module specific interface */
+ NULL, /* module specific interface */
- (FT_Module_Constructor)ft_raster1_init,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) 0
- ,
+ (FT_Module_Constructor)ft_raster1_init, /* module_init */
+ (FT_Module_Destructor) NULL, /* module_done */
+ (FT_Module_Requester) NULL, /* get_interface */
FT_GLYPH_FORMAT_OUTLINE,
- (FT_Renderer_RenderFunc) ft_raster1_render,
- (FT_Renderer_TransformFunc)ft_raster1_transform,
- (FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox,
- (FT_Renderer_SetModeFunc) ft_raster1_set_mode,
+ (FT_Renderer_RenderFunc) ft_raster1_render, /* render_glyph */
+ (FT_Renderer_TransformFunc)ft_raster1_transform, /* transform_glyph */
+ (FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox, /* get_glyph_cbox */
+ (FT_Renderer_SetModeFunc) ft_raster1_set_mode, /* set_mode */
- (FT_Raster_Funcs*) &FT_STANDARD_RASTER_GET
+ (FT_Raster_Funcs*)&FT_STANDARD_RASTER_GET /* raster_class */
)
diff --git a/thirdparty/freetype/src/raster/ftrend1.h b/thirdparty/freetype/src/raster/ftrend1.h
index a431f185d2..cff702d140 100644
--- a/thirdparty/freetype/src/raster/ftrend1.h
+++ b/thirdparty/freetype/src/raster/ftrend1.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/raster/module.mk b/thirdparty/freetype/src/raster/module.mk
index f4a5f8e838..aad39cb56a 100644
--- a/thirdparty/freetype/src/raster/module.mk
+++ b/thirdparty/freetype/src/raster/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/raster/raster.c b/thirdparty/freetype/src/raster/raster.c
index 5b21dcbc6a..46a6690b17 100644
--- a/thirdparty/freetype/src/raster/raster.c
+++ b/thirdparty/freetype/src/raster/raster.c
@@ -4,7 +4,7 @@
/* */
/* FreeType monochrome rasterer module component (body only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,11 +17,11 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
#include <ft2build.h>
-#include "rastpic.c"
+
#include "ftraster.c"
#include "ftrend1.c"
+#include "rastpic.c"
/* END */
diff --git a/thirdparty/freetype/src/raster/rasterrs.h b/thirdparty/freetype/src/raster/rasterrs.h
index 44da7fca56..0d646908ad 100644
--- a/thirdparty/freetype/src/raster/rasterrs.h
+++ b/thirdparty/freetype/src/raster/rasterrs.h
@@ -4,7 +4,7 @@
/* */
/* monochrome renderer error codes (specification only). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/raster/rastpic.c b/thirdparty/freetype/src/raster/rastpic.c
index dcfa92eef7..7085339b7b 100644
--- a/thirdparty/freetype/src/raster/rastpic.c
+++ b/thirdparty/freetype/src/raster/rastpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for raster module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/raster/rastpic.h b/thirdparty/freetype/src/raster/rastpic.h
index 7815876383..dcd691310d 100644
--- a/thirdparty/freetype/src/raster/rastpic.h
+++ b/thirdparty/freetype/src/raster/rastpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for raster module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/raster/rules.mk b/thirdparty/freetype/src/raster/rules.mk
index 929faa3a95..0462c93177 100644
--- a/thirdparty/freetype/src/raster/rules.mk
+++ b/thirdparty/freetype/src/raster/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/sfnt/module.mk b/thirdparty/freetype/src/sfnt/module.mk
index ca19e096a3..81dea17de0 100644
--- a/thirdparty/freetype/src/sfnt/module.mk
+++ b/thirdparty/freetype/src/sfnt/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/sfnt/pngshim.c b/thirdparty/freetype/src/sfnt/pngshim.c
index 2815759ccb..b9b296ea5f 100644
--- a/thirdparty/freetype/src/sfnt/pngshim.c
+++ b/thirdparty/freetype/src/sfnt/pngshim.c
@@ -4,7 +4,7 @@
/* */
/* PNG Bitmap glyph support. */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* Google, Inc. */
/* Written by Stuart Gill and Behdad Esfahbod. */
/* */
@@ -24,9 +24,10 @@
#include FT_CONFIG_STANDARD_LIBRARY_H
-#ifdef FT_CONFIG_OPTION_USE_PNG
+#if defined( TT_CONFIG_OPTION_EMBEDDED_BITMAPS ) && \
+ defined( FT_CONFIG_OPTION_USE_PNG )
- /* We always include <stjmp.h>, so make libpng shut up! */
+ /* We always include <setjmp.h>, so make libpng shut up! */
#define PNG_SKIP_SETJMP_CHECK 1
#include <png.h>
#include "pngshim.h"
@@ -184,7 +185,8 @@
FT_Memory memory,
FT_Byte* data,
FT_UInt png_len,
- FT_Bool populate_map_and_metrics )
+ FT_Bool populate_map_and_metrics,
+ FT_Bool metrics_only )
{
FT_Bitmap *map = &slot->bitmap;
FT_Error error = FT_Err_Ok;
@@ -258,9 +260,6 @@
if ( populate_map_and_metrics )
{
- FT_ULong size;
-
-
metrics->width = (FT_UShort)imgWidth;
metrics->height = (FT_UShort)imgHeight;
@@ -276,13 +275,6 @@
error = FT_THROW( Array_Too_Large );
goto DestroyExit;
}
-
- /* this doesn't overflow: 0x7FFF * 0x7FFF * 4 < 2^32 */
- size = map->rows * (FT_ULong)map->pitch;
-
- error = ft_glyphslot_alloc_bitmap( slot, size );
- if ( error )
- goto DestroyExit;
}
/* convert palette/gray image to rgb */
@@ -334,6 +326,9 @@
goto DestroyExit;
}
+ if ( metrics_only )
+ goto DestroyExit;
+
switch ( color_type )
{
default:
@@ -349,6 +344,17 @@
break;
}
+ if ( populate_map_and_metrics )
+ {
+ /* this doesn't overflow: 0x7FFF * 0x7FFF * 4 < 2^32 */
+ FT_ULong size = map->rows * (FT_ULong)map->pitch;
+
+
+ error = ft_glyphslot_alloc_bitmap( slot, size );
+ if ( error )
+ goto DestroyExit;
+ }
+
if ( FT_NEW_ARRAY( rows, imgHeight ) )
{
error = FT_THROW( Out_Of_Memory );
@@ -372,7 +378,12 @@
return error;
}
-#endif /* FT_CONFIG_OPTION_USE_PNG */
+#else /* !(TT_CONFIG_OPTION_EMBEDDED_BITMAPS && FT_CONFIG_OPTION_USE_PNG) */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _pngshim_dummy;
+
+#endif /* !(TT_CONFIG_OPTION_EMBEDDED_BITMAPS && FT_CONFIG_OPTION_USE_PNG) */
/* END */
diff --git a/thirdparty/freetype/src/sfnt/pngshim.h b/thirdparty/freetype/src/sfnt/pngshim.h
index ff05871332..344eceac12 100644
--- a/thirdparty/freetype/src/sfnt/pngshim.h
+++ b/thirdparty/freetype/src/sfnt/pngshim.h
@@ -4,7 +4,7 @@
/* */
/* PNG Bitmap glyph support. */
/* */
-/* Copyright 2013-2016 by */
+/* Copyright 2013-2017 by */
/* Google, Inc. */
/* Written by Stuart Gill and Behdad Esfahbod. */
/* */
@@ -38,7 +38,8 @@ FT_BEGIN_HEADER
FT_Memory memory,
FT_Byte* data,
FT_UInt png_len,
- FT_Bool populate_map_and_metrics );
+ FT_Bool populate_map_and_metrics,
+ FT_Bool metrics_only );
#endif
diff --git a/thirdparty/freetype/src/sfnt/rules.mk b/thirdparty/freetype/src/sfnt/rules.mk
index e9fc421567..230d56c946 100644
--- a/thirdparty/freetype/src/sfnt/rules.mk
+++ b/thirdparty/freetype/src/sfnt/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/sfnt/sfdriver.c b/thirdparty/freetype/src/sfnt/sfdriver.c
index 47e8967752..991433ee4c 100644
--- a/thirdparty/freetype/src/sfnt/sfdriver.c
+++ b/thirdparty/freetype/src/sfnt/sfdriver.c
@@ -4,7 +4,7 @@
/* */
/* High-level SFNT driver interface (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,6 +20,7 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_SFNT_H
#include FT_INTERNAL_OBJECTS_H
+#include FT_TRUETYPE_IDS_H
#include "sfdriver.h"
#include "ttload.h"
@@ -50,6 +51,11 @@
#include FT_SERVICE_SFNT_H
#include FT_SERVICE_TT_CMAP_H
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include FT_MULTIPLE_MASTERS_H
+#include FT_SERVICE_MULTIPLE_MASTERS_H
+#endif
+
/*************************************************************************/
/* */
@@ -88,7 +94,7 @@
break;
case FT_SFNT_OS2:
- table = face->os2.version == 0xFFFFU ? NULL : &face->os2;
+ table = ( face->os2.version == 0xFFFFU ) ? NULL : &face->os2;
break;
case FT_SFNT_POST:
@@ -139,9 +145,11 @@
FT_DEFINE_SERVICE_SFNT_TABLEREC(
sfnt_service_sfnt_table,
+
(FT_SFNT_TableLoadFunc)tt_face_load_any, /* load_table */
(FT_SFNT_TableGetFunc) get_sfnt_table, /* get_table */
- (FT_SFNT_TableInfoFunc)sfnt_table_info ) /* table_info */
+ (FT_SFNT_TableInfoFunc)sfnt_table_info /* table_info */
+ )
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
@@ -152,7 +160,7 @@
*/
static FT_Error
- sfnt_get_glyph_name( TT_Face face,
+ sfnt_get_glyph_name( FT_Face face,
FT_UInt glyph_index,
FT_Pointer buffer,
FT_UInt buffer_max )
@@ -161,7 +169,7 @@
FT_Error error;
- error = tt_face_get_ps_name( face, glyph_index, &gname );
+ error = tt_face_get_ps_name( (TT_Face)face, glyph_index, &gname );
if ( !error )
FT_STRCPYN( buffer, gname, buffer_max );
@@ -170,26 +178,26 @@
static FT_UInt
- sfnt_get_name_index( TT_Face face,
+ sfnt_get_name_index( FT_Face face,
FT_String* glyph_name )
{
- FT_Face root = &face->root;
+ TT_Face ttface = (TT_Face)face;
FT_UInt i, max_gid = FT_UINT_MAX;
- if ( root->num_glyphs < 0 )
+ if ( face->num_glyphs < 0 )
return 0;
- else if ( (FT_ULong)root->num_glyphs < FT_UINT_MAX )
- max_gid = (FT_UInt)root->num_glyphs;
+ else if ( (FT_ULong)face->num_glyphs < FT_UINT_MAX )
+ max_gid = (FT_UInt)face->num_glyphs;
else
FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08x\n",
- FT_UINT_MAX, root->num_glyphs ));
+ FT_UINT_MAX, face->num_glyphs ));
for ( i = 0; i < max_gid; i++ )
{
FT_String* gname;
- FT_Error error = tt_face_get_ps_name( face, i, &gname );
+ FT_Error error = tt_face_get_ps_name( ttface, i, &gname );
if ( error )
@@ -205,9 +213,10 @@
FT_DEFINE_SERVICE_GLYPHDICTREC(
sfnt_service_glyph_dict,
- (FT_GlyphDict_GetNameFunc) sfnt_get_glyph_name, /* get_name */
- (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index ) /* name_index */
+ (FT_GlyphDict_GetNameFunc) sfnt_get_glyph_name, /* get_name */
+ (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index /* name_index */
+ )
#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
@@ -217,120 +226,847 @@
*
*/
- static const char*
- sfnt_get_ps_name( TT_Face face )
+ /* an array representing allowed ASCII characters in a PS string */
+ static const unsigned char sfnt_ps_map[16] =
{
- FT_Int n, found_win, found_apple;
- const char* result = NULL;
+ /* 4 0 C 8 */
+ 0x00, 0x00, /* 0x00: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 */
+ 0x00, 0x00, /* 0x10: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 */
+ 0xDE, 0x7C, /* 0x20: 1 1 0 1 1 1 1 0 0 1 1 1 1 1 0 0 */
+ 0xFF, 0xAF, /* 0x30: 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 */
+ 0xFF, 0xFF, /* 0x40: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 */
+ 0xFF, 0xD7, /* 0x50: 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 */
+ 0xFF, 0xFF, /* 0x60: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 */
+ 0xFF, 0x57 /* 0x70: 1 1 1 1 1 1 1 1 0 1 0 1 0 1 1 1 */
+ };
+
+
+ static int
+ sfnt_is_postscript( int c )
+ {
+ unsigned int cc;
- /* shouldn't happen, but just in case to avoid memory leaks */
- if ( face->postscript_name )
- return face->postscript_name;
+ if ( c < 0 || c >= 0x80 )
+ return 0;
- /* scan the name table to see whether we have a Postscript name here, */
- /* either in Macintosh or Windows platform encodings */
- found_win = -1;
- found_apple = -1;
+ cc = (unsigned int)c;
+
+ return sfnt_ps_map[cc >> 3] & ( 1 << ( cc & 0x07 ) );
+ }
+
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+ /* Only ASCII letters and digits are taken for a variation font */
+ /* instance's PostScript name. */
+ /* */
+ /* `ft_isalnum' is a macro, but we need a function here, thus */
+ /* this definition. */
+ static int
+ sfnt_is_alphanumeric( int c )
+ {
+ return ft_isalnum( c );
+ }
+
+
+ /* the implementation of MurmurHash3 is taken and adapted from */
+ /* https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp */
+
+#define ROTL32( x, r ) ( x << r ) | ( x >> ( 32 - r ) )
+
+
+ static FT_UInt32
+ fmix32( FT_UInt32 h )
+ {
+ h ^= h >> 16;
+ h *= 0x85ebca6b;
+ h ^= h >> 13;
+ h *= 0xc2b2ae35;
+ h ^= h >> 16;
+
+ return h;
+ }
+
+
+ static void
+ murmur_hash_3_128( const void* key,
+ const unsigned int len,
+ FT_UInt32 seed,
+ void* out )
+ {
+ const FT_Byte* data = (const FT_Byte*)key;
+ const int nblocks = (int)len / 16;
+
+ FT_UInt32 h1 = seed;
+ FT_UInt32 h2 = seed;
+ FT_UInt32 h3 = seed;
+ FT_UInt32 h4 = seed;
+
+ const FT_UInt32 c1 = 0x239b961b;
+ const FT_UInt32 c2 = 0xab0e9789;
+ const FT_UInt32 c3 = 0x38b34ae5;
+ const FT_UInt32 c4 = 0xa1e38b93;
+
+ const FT_UInt32* blocks = (const FT_UInt32*)( data + nblocks * 16 );
+
+ int i;
+
+
+ for( i = -nblocks; i; i++ )
+ {
+ FT_UInt32 k1 = blocks[i * 4 + 0];
+ FT_UInt32 k2 = blocks[i * 4 + 1];
+ FT_UInt32 k3 = blocks[i * 4 + 2];
+ FT_UInt32 k4 = blocks[i * 4 + 3];
+
+
+ k1 *= c1;
+ k1 = ROTL32( k1, 15 );
+ k1 *= c2;
+ h1 ^= k1;
+
+ h1 = ROTL32( h1, 19 );
+ h1 += h2;
+ h1 = h1 * 5 + 0x561ccd1b;
+
+ k2 *= c2;
+ k2 = ROTL32( k2, 16 );
+ k2 *= c3;
+ h2 ^= k2;
+
+ h2 = ROTL32( h2, 17 );
+ h2 += h3;
+ h2 = h2 * 5 + 0x0bcaa747;
+
+ k3 *= c3;
+ k3 = ROTL32( k3, 17 );
+ k3 *= c4;
+ h3 ^= k3;
+
+ h3 = ROTL32( h3, 15 );
+ h3 += h4;
+ h3 = h3 * 5 + 0x96cd1c35;
+
+ k4 *= c4;
+ k4 = ROTL32( k4, 18 );
+ k4 *= c1;
+ h4 ^= k4;
+
+ h4 = ROTL32( h4, 13 );
+ h4 += h1;
+ h4 = h4 * 5 + 0x32ac3b17;
+ }
- for ( n = 0; n < face->num_names; n++ )
{
- TT_NameEntryRec* name = face->name_table.names + n;
+ const FT_Byte* tail = (const FT_Byte*)( data + nblocks * 16 );
+ FT_UInt32 k1 = 0;
+ FT_UInt32 k2 = 0;
+ FT_UInt32 k3 = 0;
+ FT_UInt32 k4 = 0;
- if ( name->nameID == 6 && name->stringLength > 0 )
+
+ switch ( len & 15 )
{
- if ( name->platformID == 3 &&
- name->encodingID == 1 &&
- name->languageID == 0x409 )
- found_win = n;
-
- if ( name->platformID == 1 &&
- name->encodingID == 0 &&
- name->languageID == 0 )
- found_apple = n;
+ case 15:
+ k4 ^= (FT_UInt32)tail[14] << 16;
+ case 14:
+ k4 ^= (FT_UInt32)tail[13] << 8;
+ case 13:
+ k4 ^= (FT_UInt32)tail[12];
+ k4 *= c4;
+ k4 = ROTL32( k4, 18 );
+ k4 *= c1;
+ h4 ^= k4;
+
+ case 12:
+ k3 ^= (FT_UInt32)tail[11] << 24;
+ case 11:
+ k3 ^= (FT_UInt32)tail[10] << 16;
+ case 10:
+ k3 ^= (FT_UInt32)tail[9] << 8;
+ case 9:
+ k3 ^= (FT_UInt32)tail[8];
+ k3 *= c3;
+ k3 = ROTL32( k3, 17 );
+ k3 *= c4;
+ h3 ^= k3;
+
+ case 8:
+ k2 ^= (FT_UInt32)tail[7] << 24;
+ case 7:
+ k2 ^= (FT_UInt32)tail[6] << 16;
+ case 6:
+ k2 ^= (FT_UInt32)tail[5] << 8;
+ case 5:
+ k2 ^= (FT_UInt32)tail[4];
+ k2 *= c2;
+ k2 = ROTL32( k2, 16 );
+ k2 *= c3;
+ h2 ^= k2;
+
+ case 4:
+ k1 ^= (FT_UInt32)tail[3] << 24;
+ case 3:
+ k1 ^= (FT_UInt32)tail[2] << 16;
+ case 2:
+ k1 ^= (FT_UInt32)tail[1] << 8;
+ case 1:
+ k1 ^= (FT_UInt32)tail[0];
+ k1 *= c1;
+ k1 = ROTL32( k1, 15 );
+ k1 *= c2;
+ h1 ^= k1;
}
}
- if ( found_win != -1 )
+ h1 ^= len;
+ h2 ^= len;
+ h3 ^= len;
+ h4 ^= len;
+
+ h1 += h2;
+ h1 += h3;
+ h1 += h4;
+
+ h2 += h1;
+ h3 += h1;
+ h4 += h1;
+
+ h1 = fmix32( h1 );
+ h2 = fmix32( h2 );
+ h3 = fmix32( h3 );
+ h4 = fmix32( h4 );
+
+ h1 += h2;
+ h1 += h3;
+ h1 += h4;
+
+ h2 += h1;
+ h3 += h1;
+ h4 += h1;
+
+ ((FT_UInt32*)out)[0] = h1;
+ ((FT_UInt32*)out)[1] = h2;
+ ((FT_UInt32*)out)[2] = h3;
+ ((FT_UInt32*)out)[3] = h4;
+ }
+
+
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
+
+ typedef int (*char_type_func)( int c );
+
+
+ /* handling of PID/EID 3/0 and 3/1 is the same */
+#define IS_WIN( n ) ( (n)->platformID == 3 && \
+ ( (n)->encodingID == 1 || (n)->encodingID == 0 ) && \
+ (n)->languageID == 0x409 )
+
+#define IS_APPLE( n ) ( (n)->platformID == 1 && \
+ (n)->encodingID == 0 && \
+ (n)->languageID == 0 )
+
+ static char*
+ get_win_string( FT_Memory memory,
+ FT_Stream stream,
+ TT_Name entry,
+ char_type_func char_type,
+ FT_Bool report_invalid_characters )
+ {
+ FT_Error error = FT_Err_Ok;
+
+ char* result = NULL;
+ FT_String* r;
+ FT_Char* p;
+ FT_UInt len;
+
+ FT_UNUSED( error );
+
+
+ if ( FT_ALLOC( result, entry->stringLength / 2 + 1 ) )
+ return NULL;
+
+ if ( FT_STREAM_SEEK( entry->stringOffset ) ||
+ FT_FRAME_ENTER( entry->stringLength ) )
{
- FT_Memory memory = face->root.memory;
- TT_NameEntryRec* name = face->name_table.names + found_win;
- FT_UInt len = name->stringLength / 2;
- FT_Error error = FT_Err_Ok;
+ FT_FREE( result );
+ entry->stringLength = 0;
+ entry->stringOffset = 0;
+ FT_FREE( entry->string );
- FT_UNUSED( error );
+ return NULL;
+ }
+ r = (FT_String*)result;
+ p = (FT_Char*)stream->cursor;
- if ( !FT_ALLOC( result, name->stringLength + 1 ) )
+ for ( len = entry->stringLength / 2; len > 0; len--, p += 2 )
+ {
+ if ( p[0] == 0 )
{
- FT_Stream stream = face->name_table.stream;
- FT_String* r = (FT_String*)result;
- FT_Char* p;
+ if ( char_type( p[1] ) )
+ *r++ = p[1];
+ else
+ {
+ if ( report_invalid_characters )
+ {
+ FT_TRACE0(( "get_win_string:"
+ " Character `%c' (0x%X) invalid in PS name string\n",
+ p[1], p[1] ));
+ /* it's not the job of FreeType to correct PS names... */
+ *r++ = p[1];
+ }
+ }
+ }
+ }
+ *r = '\0';
+
+ FT_FRAME_EXIT();
+
+ return result;
+ }
+
+
+ static char*
+ get_apple_string( FT_Memory memory,
+ FT_Stream stream,
+ TT_Name entry,
+ char_type_func char_type,
+ FT_Bool report_invalid_characters )
+ {
+ FT_Error error = FT_Err_Ok;
+
+ char* result = NULL;
+ FT_String* r;
+ FT_Char* p;
+ FT_UInt len;
+
+ FT_UNUSED( error );
+
+ if ( FT_ALLOC( result, entry->stringLength + 1 ) )
+ return NULL;
+
+ if ( FT_STREAM_SEEK( entry->stringOffset ) ||
+ FT_FRAME_ENTER( entry->stringLength ) )
+ {
+ FT_FREE( result );
+ entry->stringOffset = 0;
+ entry->stringLength = 0;
+ FT_FREE( entry->string );
- if ( FT_STREAM_SEEK( name->stringOffset ) ||
- FT_FRAME_ENTER( name->stringLength ) )
+ return NULL;
+ }
+
+ r = (FT_String*)result;
+ p = (FT_Char*)stream->cursor;
+
+ for ( len = entry->stringLength; len > 0; len--, p++ )
+ {
+ if ( char_type( *p ) )
+ *r++ = *p;
+ else
+ {
+ if ( report_invalid_characters )
{
- FT_FREE( result );
- name->stringLength = 0;
- name->stringOffset = 0;
- FT_FREE( name->string );
+ FT_TRACE0(( "get_apple_string:"
+ " Character `%c' (0x%X) invalid in PS name string\n",
+ *p, *p ));
+ /* it's not the job of FreeType to correct PS names... */
+ *r++ = *p;
+ }
+ }
+ }
+ *r = '\0';
+
+ FT_FRAME_EXIT();
+
+ return result;
+ }
+
+
+ static FT_Bool
+ sfnt_get_name_id( TT_Face face,
+ FT_UShort id,
+ FT_Int *win,
+ FT_Int *apple )
+ {
+ FT_Int n;
+
+
+ *win = -1;
+ *apple = -1;
+
+ for ( n = 0; n < face->num_names; n++ )
+ {
+ TT_Name name = face->name_table.names + n;
+
+
+ if ( name->nameID == id && name->stringLength > 0 )
+ {
+ if ( IS_WIN( name ) )
+ *win = n;
+
+ if ( IS_APPLE( name ) )
+ *apple = n;
+ }
+ }
+
+ return ( *win >= 0 ) || ( *apple >= 0 );
+ }
+
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+ /*
+ The maximum length of an axis value descriptor.
+
+ We need 65536 different values for the decimal fraction; this fits
+ nicely into five decimal places. Consequently, it consists of
+
+ . the minus sign if the number is negative,
+ . up to five characters for the digits before the decimal point,
+ . the decimal point if there is a fractional part, and
+ . up to five characters for the digits after the decimal point.
+
+ We also need one byte for the leading `_' character and up to four
+ bytes for the axis tag.
+ */
+#define MAX_VALUE_DESCRIPTOR_LEN ( 1 + 5 + 1 + 5 + 1 + 4 )
+
+
+ /* the maximum length of PostScript font names */
+#define MAX_PS_NAME_LEN 127
+
+
+ /*
+ * Find the shortest decimal representation of a 16.16 fixed point
+ * number. The function fills `buf' with the result, returning a pointer
+ * to the position after the representation's last byte.
+ */
+
+ static char*
+ fixed2float( FT_Int fixed,
+ char* buf )
+ {
+ char* p;
+ char* q;
+ char tmp[5];
+
+ FT_Int int_part;
+ FT_Int frac_part;
+
+ FT_Int i;
+
- goto Exit;
+ p = buf;
+
+ if ( fixed == 0 )
+ {
+ *p++ = '0';
+ return p;
+ }
+
+ if ( fixed < 0 )
+ {
+ *p++ = '-';
+ fixed = -fixed;
+ }
+
+ int_part = ( fixed >> 16 ) & 0xFFFF;
+ frac_part = fixed & 0xFFFF;
+
+ /* get digits of integer part (in reverse order) */
+ q = tmp;
+ while ( int_part > 0 )
+ {
+ *q++ = '0' + int_part % 10;
+ int_part /= 10;
+ }
+
+ /* copy digits in correct order to buffer */
+ while ( q > tmp )
+ *p++ = *--q;
+
+ if ( !frac_part )
+ return p;
+
+ /* save position of point */
+ q = p;
+ *p++ = '.';
+
+ /* apply rounding */
+ frac_part = frac_part * 10 + 5;
+
+ /* get digits of fractional part */
+ for ( i = 0; i < 5; i++ )
+ {
+ *p++ = '0' + (char)( frac_part / 0x10000L );
+
+ frac_part %= 0x10000L;
+ if ( !frac_part )
+ break;
+
+ frac_part *= 10;
+ }
+
+ /*
+ If the remainder stored in `frac_part' (after the last FOR loop) is
+ smaller than 34480*10, the resulting decimal value minus 0.00001 is
+ an equivalent representation of `fixed'.
+
+ The above FOR loop always finds the larger of the two values; I
+ verified this by iterating over all possible fixed point numbers.
+
+ If the remainder is 17232*10, both values are equally good, and we
+ take the next even number (following IEEE 754's `round to nearest,
+ ties to even' rounding rule).
+
+ If the remainder is smaller than 17232*10, the lower of the two
+ numbers is nearer to the exact result (values 17232 and 34480 were
+ also found by testing all possible fixed point values).
+
+ We use this to find a shorter decimal representation. If not ending
+ with digit zero, we take the representation with less error.
+ */
+ p--;
+ if ( p - q == 5 ) /* five digits? */
+ {
+ /* take the representation that has zero as the last digit */
+ if ( frac_part < 34480 * 10 &&
+ *p == '1' )
+ *p = '0';
+
+ /* otherwise use the one with less error */
+ else if ( frac_part == 17232 * 10 &&
+ *p & 1 )
+ *p -= 1;
+
+ else if ( frac_part < 17232 * 10 &&
+ *p != '0' )
+ *p -= 1;
+ }
+
+ /* remove trailing zeros */
+ while ( *p == '0' )
+ *p-- = '\0';
+
+ return p + 1;
+ }
+
+
+ static const char hexdigits[16] =
+ {
+ '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
+ };
+
+
+ static const char*
+ sfnt_get_var_ps_name( TT_Face face )
+ {
+ FT_Error error;
+ FT_Memory memory = face->root.memory;
+
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+ FT_UInt num_coords;
+ FT_Fixed* coords;
+ FT_MM_Var* mm_var;
+
+ FT_Int found, win, apple;
+ FT_UInt i, j;
+
+ char* result = NULL;
+ char* p;
+
+
+ if ( !face->var_postscript_prefix )
+ {
+ FT_UInt len;
+
+
+ /* check whether we have a Variations PostScript Name Prefix */
+ found = sfnt_get_name_id( face,
+ TT_NAME_ID_VARIATIONS_PREFIX,
+ &win,
+ &apple );
+ if ( !found )
+ {
+ /* otherwise use the typographic family name */
+ found = sfnt_get_name_id( face,
+ TT_NAME_ID_TYPOGRAPHIC_FAMILY,
+ &win,
+ &apple );
+ }
+
+ if ( !found )
+ {
+ /* as a last resort we try the family name; note that this is */
+ /* not in the Adobe TechNote, but GX fonts (which predate the */
+ /* TechNote) benefit from this behaviour */
+ found = sfnt_get_name_id( face,
+ TT_NAME_ID_FONT_FAMILY,
+ &win,
+ &apple );
+ }
+
+ if ( !found )
+ {
+ FT_TRACE0(( "sfnt_get_var_ps_name:"
+ " Can't construct PS name prefix for font instances\n" ));
+ return NULL;
+ }
+
+ /* prefer Windows entries over Apple */
+ if ( win != -1 )
+ result = get_win_string( face->root.memory,
+ face->name_table.stream,
+ face->name_table.names + win,
+ sfnt_is_alphanumeric,
+ 0 );
+ else
+ result = get_apple_string( face->root.memory,
+ face->name_table.stream,
+ face->name_table.names + apple,
+ sfnt_is_alphanumeric,
+ 0 );
+
+ len = ft_strlen( result );
+
+ /* sanitize if necessary; we reserve space for 36 bytes (a 128bit */
+ /* checksum as a hex number, preceded by `-' and followed by three */
+ /* ASCII dots, to be used if the constructed PS name would be too */
+ /* long); this is also sufficient for a single instance */
+ if ( len > MAX_PS_NAME_LEN - ( 1 + 32 + 3 ) )
+ {
+ len = MAX_PS_NAME_LEN - ( 1 + 32 + 3 );
+ result[len] = '\0';
+
+ FT_TRACE0(( "sfnt_get_var_ps_name:"
+ " Shortening variation PS name prefix\n"
+ " "
+ " to %d characters\n", len ));
+ }
+
+ face->var_postscript_prefix = result;
+ face->var_postscript_prefix_len = len;
+ }
+
+ mm->get_var_blend( FT_FACE( face ),
+ &num_coords,
+ &coords,
+ NULL,
+ &mm_var );
+
+ if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) )
+ {
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
+
+ FT_Long instance = ( ( face->root.face_index & 0x7FFF0000L ) >> 16 ) - 1;
+ FT_UInt psid = mm_var->namedstyle[instance].psid;
+
+ char* ps_name = NULL;
+
+
+ /* try first to load the name string with index `postScriptNameID' */
+ if ( psid == 6 ||
+ ( psid > 255 && psid < 32768 ) )
+ (void)sfnt->get_name( face, (FT_UShort)psid, &ps_name );
+
+ if ( ps_name )
+ {
+ result = ps_name;
+ p = result + ft_strlen( result ) + 1;
+
+ goto check_length;
+ }
+ else
+ {
+ /* otherwise construct a name using `subfamilyNameID' */
+ FT_UInt strid = mm_var->namedstyle[instance].strid;
+
+ char* subfamily_name;
+ char* s;
+
+
+ (void)sfnt->get_name( face, (FT_UShort)strid, &subfamily_name );
+
+ if ( !subfamily_name )
+ {
+ FT_TRACE1(( "sfnt_get_var_ps_name:"
+ " can't construct named instance PS name;\n"
+ " "
+ " trying to construct normal instance PS name\n" ));
+ goto construct_instance_name;
}
- p = (FT_Char*)stream->cursor;
+ /* after the prefix we have character `-' followed by the */
+ /* subfamily name (using only characters a-z, A-Z, and 0-9) */
+ if ( FT_ALLOC( result, face->var_postscript_prefix_len +
+ 1 + ft_strlen( subfamily_name ) + 1 ) )
+ return NULL;
- for ( ; len > 0; len--, p += 2 )
+ ft_strcpy( result, face->var_postscript_prefix );
+
+ p = result + face->var_postscript_prefix_len;
+ *p++ = '-';
+
+ s = subfamily_name;
+ while ( *s )
{
- if ( p[0] == 0 && p[1] >= 32 )
- *r++ = p[1];
+ if ( ft_isalnum( *s ) )
+ *p++ = *s;
+ s++;
}
- *r = '\0';
+ *p++ = '\0';
+
+ FT_FREE( subfamily_name );
+ }
+ }
+ else
+ {
+ FT_Var_Axis* axis;
- FT_FRAME_EXIT();
+
+ construct_instance_name:
+ axis = mm_var->axis;
+
+ if ( FT_ALLOC( result,
+ face->var_postscript_prefix_len +
+ num_coords * MAX_VALUE_DESCRIPTOR_LEN + 1 ) )
+ return NULL;
+
+ p = result;
+
+ ft_strcpy( p, face->var_postscript_prefix );
+ p += face->var_postscript_prefix_len;
+
+ for ( i = 0; i < num_coords; i++, coords++, axis++ )
+ {
+ char t;
+
+
+ /* omit axis value descriptor if it is identical */
+ /* to the default axis value */
+ if ( *coords == axis->def )
+ continue;
+
+ *p++ = '_';
+ p = fixed2float( *coords, p );
+
+ t = (char)( axis->tag >> 24 );
+ if ( t != ' ' && ft_isalnum( t ) )
+ *p++ = t;
+ t = (char)( axis->tag >> 16 );
+ if ( t != ' ' && ft_isalnum( t ) )
+ *p++ = t;
+ t = (char)( axis->tag >> 8 );
+ if ( t != ' ' && ft_isalnum( t ) )
+ *p++ = t;
+ t = (char)axis->tag;
+ if ( t != ' ' && ft_isalnum( t ) )
+ *p++ = t;
}
- goto Exit;
}
- if ( found_apple != -1 )
+ check_length:
+ if ( p - result > MAX_PS_NAME_LEN )
{
- FT_Memory memory = face->root.memory;
- TT_NameEntryRec* name = face->name_table.names + found_apple;
- FT_UInt len = name->stringLength;
- FT_Error error = FT_Err_Ok;
+ /* the PS name is too long; replace the part after the prefix with */
+ /* a checksum; we use MurmurHash 3 with a hash length of 128 bit */
+
+ FT_UInt32 seed = 123456789;
+
+ FT_UInt32 hash[4];
+ FT_UInt32* h;
+
- FT_UNUSED( error );
+ murmur_hash_3_128( result, p - result, seed, hash );
+ p = result + face->var_postscript_prefix_len;
+ *p++ = '-';
- if ( !FT_ALLOC( result, len + 1 ) )
+ /* we convert the hash value to hex digits from back to front */
+ p += 32 + 3;
+ h = hash + 3;
+
+ *p-- = '\0';
+ *p-- = '.';
+ *p-- = '.';
+ *p-- = '.';
+
+ for ( i = 0; i < 4; i++, h-- )
{
- FT_Stream stream = face->name_table.stream;
+ FT_UInt32 v = *h;
- if ( FT_STREAM_SEEK( name->stringOffset ) ||
- FT_STREAM_READ( result, len ) )
+ for ( j = 0; j < 8; j++ )
{
- name->stringOffset = 0;
- name->stringLength = 0;
- FT_FREE( name->string );
- FT_FREE( result );
- goto Exit;
+ *p-- = hexdigits[v & 0xF];
+ v >>= 4;
}
- ((char*)result)[len] = '\0';
}
}
- Exit:
+ return result;
+ }
+
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
+
+ static const char*
+ sfnt_get_ps_name( TT_Face face )
+ {
+ FT_Int found, win, apple;
+ const char* result = NULL;
+
+
+ if ( face->postscript_name )
+ return face->postscript_name;
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ if ( face->blend )
+ {
+ face->postscript_name = sfnt_get_var_ps_name( face );
+ return face->postscript_name;
+ }
+#endif
+
+ /* scan the name table to see whether we have a Postscript name here, */
+ /* either in Macintosh or Windows platform encodings */
+ found = sfnt_get_name_id( face, TT_NAME_ID_PS_NAME, &win, &apple );
+ if ( !found )
+ return NULL;
+
+ /* prefer Windows entries over Apple */
+ if ( win != -1 )
+ result = get_win_string( face->root.memory,
+ face->name_table.stream,
+ face->name_table.names + win,
+ sfnt_is_postscript,
+ 1 );
+ else
+ result = get_apple_string( face->root.memory,
+ face->name_table.stream,
+ face->name_table.names + apple,
+ sfnt_is_postscript,
+ 1 );
+
face->postscript_name = result;
+
return result;
}
FT_DEFINE_SERVICE_PSFONTNAMEREC(
sfnt_service_ps_name,
- (FT_PsName_GetFunc)sfnt_get_ps_name ) /* get_ps_font_name */
+
+ (FT_PsName_GetFunc)sfnt_get_ps_name /* get_ps_font_name */
+ )
/*
@@ -338,7 +1074,9 @@
*/
FT_DEFINE_SERVICE_TTCMAPSREC(
tt_service_get_cmap_info,
- (TT_CMap_Info_GetFunc)tt_get_cmap_info ) /* get_cmap_info */
+
+ (TT_CMap_Info_GetFunc)tt_get_cmap_info /* get_cmap_info */
+ )
#ifdef TT_CONFIG_OPTION_BDF
@@ -381,8 +1119,10 @@
FT_DEFINE_SERVICE_BDFRec(
sfnt_service_bdf,
+
(FT_BDF_GetCharsetIdFunc)sfnt_get_charset_id, /* get_charset_id */
- (FT_BDF_GetPropertyFunc) tt_face_find_bdf_prop ) /* get_property */
+ (FT_BDF_GetPropertyFunc) tt_face_find_bdf_prop /* get_property */
+ )
#endif /* TT_CONFIG_OPTION_BDF */
@@ -395,6 +1135,7 @@
#if defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES && defined TT_CONFIG_OPTION_BDF
FT_DEFINE_SERVICEDESCREC5(
sfnt_services,
+
FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_GLYPH_DICT, &SFNT_SERVICE_GLYPH_DICT_GET,
@@ -403,6 +1144,7 @@
#elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES
FT_DEFINE_SERVICEDESCREC4(
sfnt_services,
+
FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_GLYPH_DICT, &SFNT_SERVICE_GLYPH_DICT_GET,
@@ -410,6 +1152,7 @@
#elif defined TT_CONFIG_OPTION_BDF
FT_DEFINE_SERVICEDESCREC4(
sfnt_services,
+
FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_BDF, &SFNT_SERVICE_BDF_GET,
@@ -417,6 +1160,7 @@
#else
FT_DEFINE_SERVICEDESCREC3(
sfnt_services,
+
FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_TT_CMAP, &TT_SERVICE_CMAP_INFO_GET )
@@ -459,55 +1203,64 @@
FT_DEFINE_SFNT_INTERFACE(
sfnt_interface,
- tt_face_goto_table,
- sfnt_init_face,
- sfnt_load_face,
- sfnt_done_face,
- sfnt_get_interface,
+ tt_face_goto_table, /* TT_Loader_GotoTableFunc goto_table */
+
+ sfnt_init_face, /* TT_Init_Face_Func init_face */
+ sfnt_load_face, /* TT_Load_Face_Func load_face */
+ sfnt_done_face, /* TT_Done_Face_Func done_face */
+ sfnt_get_interface, /* FT_Module_Requester get_interface */
- tt_face_load_any,
+ tt_face_load_any, /* TT_Load_Any_Func load_any */
- tt_face_load_head,
- tt_face_load_hhea,
- tt_face_load_cmap,
- tt_face_load_maxp,
- tt_face_load_os2,
- tt_face_load_post,
+ tt_face_load_head, /* TT_Load_Table_Func load_head */
+ tt_face_load_hhea, /* TT_Load_Metrics_Func load_hhea */
+ tt_face_load_cmap, /* TT_Load_Table_Func load_cmap */
+ tt_face_load_maxp, /* TT_Load_Table_Func load_maxp */
+ tt_face_load_os2, /* TT_Load_Table_Func load_os2 */
+ tt_face_load_post, /* TT_Load_Table_Func load_post */
- tt_face_load_name,
- tt_face_free_name,
+ tt_face_load_name, /* TT_Load_Table_Func load_name */
+ tt_face_free_name, /* TT_Free_Table_Func free_name */
- tt_face_load_kern,
- tt_face_load_gasp,
- tt_face_load_pclt,
+ tt_face_load_kern, /* TT_Load_Table_Func load_kern */
+ tt_face_load_gasp, /* TT_Load_Table_Func load_gasp */
+ tt_face_load_pclt, /* TT_Load_Table_Func load_init */
/* see `ttload.h' */
PUT_EMBEDDED_BITMAPS( tt_face_load_bhed ),
-
+ /* TT_Load_Table_Func load_bhed */
PUT_EMBEDDED_BITMAPS( tt_face_load_sbit_image ),
+ /* TT_Load_SBit_Image_Func load_sbit_image */
/* see `ttpost.h' */
PUT_PS_NAMES( tt_face_get_ps_name ),
+ /* TT_Get_PS_Name_Func get_psname */
PUT_PS_NAMES( tt_face_free_ps_names ),
+ /* TT_Free_Table_Func free_psnames */
/* since version 2.1.8 */
- tt_face_get_kerning,
+ tt_face_get_kerning, /* TT_Face_GetKerningFunc get_kerning */
/* since version 2.2 */
- tt_face_load_font_dir,
- tt_face_load_hmtx,
+ tt_face_load_font_dir, /* TT_Load_Table_Func load_font_dir */
+ tt_face_load_hmtx, /* TT_Load_Metrics_Func load_hmtx */
/* see `ttsbit.h' and `sfnt.h' */
PUT_EMBEDDED_BITMAPS( tt_face_load_sbit ),
+ /* TT_Load_Table_Func load_eblc */
PUT_EMBEDDED_BITMAPS( tt_face_free_sbit ),
+ /* TT_Free_Table_Func free_eblc */
PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike ),
+ /* TT_Set_SBit_Strike_Func set_sbit_strike */
PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ),
+ /* TT_Load_Strike_Metrics_Func load_strike_metrics */
- tt_face_get_metrics,
+ tt_face_get_metrics, /* TT_Get_Metrics_Func get_metrics */
- tt_face_get_name
+ tt_face_get_name, /* TT_Get_Name_Func get_name */
+ sfnt_get_name_id /* TT_Get_Name_ID_Func get_name_id */
)
@@ -523,9 +1276,10 @@
(const void*)&SFNT_INTERFACE_GET, /* module specific interface */
- (FT_Module_Constructor)0,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) sfnt_get_interface )
+ (FT_Module_Constructor)NULL, /* module_init */
+ (FT_Module_Destructor) NULL, /* module_done */
+ (FT_Module_Requester) sfnt_get_interface /* get_interface */
+ )
/* END */
diff --git a/thirdparty/freetype/src/sfnt/sfdriver.h b/thirdparty/freetype/src/sfnt/sfdriver.h
index 2694488e20..38710b60f2 100644
--- a/thirdparty/freetype/src/sfnt/sfdriver.h
+++ b/thirdparty/freetype/src/sfnt/sfdriver.h
@@ -4,7 +4,7 @@
/* */
/* High-level SFNT driver interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/sferrors.h b/thirdparty/freetype/src/sfnt/sferrors.h
index c2f9fdfead..3cf73d725d 100644
--- a/thirdparty/freetype/src/sfnt/sferrors.h
+++ b/thirdparty/freetype/src/sfnt/sferrors.h
@@ -4,7 +4,7 @@
/* */
/* SFNT error codes (specification only). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/sfnt.c b/thirdparty/freetype/src/sfnt/sfnt.c
index 952d6d425a..6cf8c9ef30 100644
--- a/thirdparty/freetype/src/sfnt/sfnt.c
+++ b/thirdparty/freetype/src/sfnt/sfnt.c
@@ -4,7 +4,7 @@
/* */
/* Single object library component. */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,27 +17,19 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
#include <ft2build.h>
+
+#include "pngshim.c"
+#include "sfdriver.c"
#include "sfntpic.c"
-#include "ttload.c"
-#include "ttmtx.c"
+#include "sfobjs.c"
+#include "ttbdf.c"
#include "ttcmap.c"
#include "ttkern.c"
-#include "sfobjs.c"
-#include "sfdriver.c"
-
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-#include "pngshim.c"
-#include "ttsbit.c"
-#endif
-
-#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
+#include "ttload.c"
+#include "ttmtx.c"
#include "ttpost.c"
-#endif
+#include "ttsbit.c"
-#ifdef TT_CONFIG_OPTION_BDF
-#include "ttbdf.c"
-#endif
/* END */
diff --git a/thirdparty/freetype/src/sfnt/sfntpic.c b/thirdparty/freetype/src/sfnt/sfntpic.c
index 1f596c0936..8eadd601fd 100644
--- a/thirdparty/freetype/src/sfnt/sfntpic.c
+++ b/thirdparty/freetype/src/sfnt/sfntpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for sfnt module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/sfntpic.h b/thirdparty/freetype/src/sfnt/sfntpic.h
index 5ce96d3938..3afb668db0 100644
--- a/thirdparty/freetype/src/sfnt/sfntpic.h
+++ b/thirdparty/freetype/src/sfnt/sfntpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for sfnt module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/sfobjs.c b/thirdparty/freetype/src/sfnt/sfobjs.c
index 2e8c1ecde6..ac2e620e5d 100644
--- a/thirdparty/freetype/src/sfnt/sfobjs.c
+++ b/thirdparty/freetype/src/sfnt/sfobjs.c
@@ -4,7 +4,7 @@
/* */
/* SFNT object management (base). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -28,6 +28,12 @@
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_SFNT_NAMES_H
#include FT_GZIP_H
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include FT_SERVICE_MULTIPLE_MASTERS_H
+#include FT_SERVICE_METRICS_VARIATIONS_H
+#endif
+
#include "sferrors.h"
#ifdef TT_CONFIG_OPTION_BDF
@@ -48,8 +54,8 @@
/* convert a UTF-16 name entry to ASCII */
static FT_String*
- tt_name_entry_ascii_from_utf16( TT_NameEntry entry,
- FT_Memory memory )
+ tt_name_ascii_from_utf16( TT_Name entry,
+ FT_Memory memory )
{
FT_String* string = NULL;
FT_UInt len, code, n;
@@ -83,8 +89,8 @@
/* convert an Apple Roman or symbol name entry to ASCII */
static FT_String*
- tt_name_entry_ascii_from_other( TT_NameEntry entry,
- FT_Memory memory )
+ tt_name_ascii_from_other( TT_Name entry,
+ FT_Memory memory )
{
FT_String* string = NULL;
FT_UInt len, code, n;
@@ -116,8 +122,8 @@
}
- typedef FT_String* (*TT_NameEntry_ConvertFunc)( TT_NameEntry entry,
- FT_Memory memory );
+ typedef FT_String* (*TT_Name_ConvertFunc)( TT_Name entry,
+ FT_Memory memory );
/* documentation is in sfnt.h */
@@ -127,20 +133,21 @@
FT_UShort nameid,
FT_String** name )
{
- FT_Memory memory = face->root.memory;
- FT_Error error = FT_Err_Ok;
- FT_String* result = NULL;
- FT_UShort n;
- TT_NameEntryRec* rec;
- FT_Int found_apple = -1;
- FT_Int found_apple_roman = -1;
- FT_Int found_apple_english = -1;
- FT_Int found_win = -1;
- FT_Int found_unicode = -1;
+ FT_Memory memory = face->root.memory;
+ FT_Error error = FT_Err_Ok;
+ FT_String* result = NULL;
+ FT_UShort n;
+ TT_Name rec;
+
+ FT_Int found_apple = -1;
+ FT_Int found_apple_roman = -1;
+ FT_Int found_apple_english = -1;
+ FT_Int found_win = -1;
+ FT_Int found_unicode = -1;
- FT_Bool is_english = 0;
+ FT_Bool is_english = 0;
- TT_NameEntry_ConvertFunc convert;
+ TT_Name_ConvertFunc convert;
FT_ASSERT( name );
@@ -225,7 +232,7 @@
/* all Unicode strings are encoded using UTF-16BE */
case TT_MS_ID_UNICODE_CS:
case TT_MS_ID_SYMBOL_CS:
- convert = tt_name_entry_ascii_from_utf16;
+ convert = tt_name_ascii_from_utf16;
break;
case TT_MS_ID_UCS_4:
@@ -234,7 +241,7 @@
/* MsGothic font shipped with Windows Vista shows that this really */
/* means UTF-16 encoded names (UCS-4 values are only used within */
/* charmaps). */
- convert = tt_name_entry_ascii_from_utf16;
+ convert = tt_name_ascii_from_utf16;
break;
default:
@@ -244,17 +251,17 @@
else if ( found_apple >= 0 )
{
rec = face->name_table.names + found_apple;
- convert = tt_name_entry_ascii_from_other;
+ convert = tt_name_ascii_from_other;
}
else if ( found_unicode >= 0 )
{
rec = face->name_table.names + found_unicode;
- convert = tt_name_entry_ascii_from_utf16;
+ convert = tt_name_ascii_from_utf16;
}
if ( rec && convert )
{
- if ( rec->string == NULL )
+ if ( !rec->string )
{
FT_Stream stream = face->name_table.stream;
@@ -304,7 +311,7 @@
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_UCS_4, FT_ENCODING_UNICODE },
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, FT_ENCODING_UNICODE },
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_SJIS, FT_ENCODING_SJIS },
- { TT_PLATFORM_MICROSOFT, TT_MS_ID_GB2312, FT_ENCODING_GB2312 },
+ { TT_PLATFORM_MICROSOFT, TT_MS_ID_PRC, FT_ENCODING_PRC },
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_BIG_5, FT_ENCODING_BIG5 },
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_WANSUNG, FT_ENCODING_WANSUNG },
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_JOHAB, FT_ENCODING_JOHAB }
@@ -798,6 +805,9 @@
if ( FT_STREAM_READ_FIELDS( ttc_header_fields, &face->ttc_header ) )
return error;
+ FT_TRACE3(( " with %ld subfonts\n",
+ face->ttc_header.count ));
+
if ( face->ttc_header.count == 0 )
return FT_THROW( Invalid_Table );
@@ -872,6 +882,31 @@
FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS );
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ if ( !face->mm )
+ {
+ /* we want the MM interface from the `truetype' module only */
+ FT_Module tt_module = FT_Get_Module( library, "truetype" );
+
+
+ face->mm = ft_module_get_service( tt_module,
+ FT_SERVICE_ID_MULTI_MASTERS,
+ 0 );
+ }
+
+ if ( !face->var )
+ {
+ /* we want the metrics variations interface */
+ /* from the `truetype' module only */
+ FT_Module tt_module = FT_Get_Module( library, "truetype" );
+
+
+ face->var = ft_module_get_service( tt_module,
+ FT_SERVICE_ID_METRICS_VARIATIONS,
+ 0 );
+ }
+#endif
+
FT_TRACE2(( "SFNT driver\n" ));
error = sfnt_open_font( stream, face );
@@ -881,10 +916,14 @@
/* Stream may have changed in sfnt_open_font. */
stream = face->root.stream;
- FT_TRACE2(( "sfnt_init_face: %08p, %ld\n", face, face_instance_index ));
+ FT_TRACE2(( "sfnt_init_face: %08p, %d\n", face, face_instance_index ));
face_index = FT_ABS( face_instance_index ) & 0xFFFF;
+ /* value -(N+1) requests information on index N */
+ if ( face_instance_index < 0 )
+ face_index--;
+
if ( face_index >= face->ttc_header.count )
{
if ( face_instance_index >= 0 )
@@ -903,6 +942,8 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
{
+ FT_Memory memory = face->root.memory;
+
FT_ULong fvar_len;
FT_ULong version;
@@ -915,6 +956,11 @@
FT_Int instance_index;
+ FT_Byte* default_values = NULL;
+ FT_Byte* instance_values = NULL;
+
+
+ face->is_default_instance = 1;
instance_index = FT_ABS( face_instance_index ) >> 16;
@@ -923,7 +969,7 @@
fvar_len < 20 ||
FT_READ_ULONG( version ) ||
FT_READ_USHORT( offset ) ||
- FT_STREAM_SKIP( 2 ) ||
+ FT_STREAM_SKIP( 2 ) /* reserved */ ||
FT_READ_USHORT( num_axes ) ||
FT_READ_USHORT( axis_size ) ||
FT_READ_USHORT( num_instances ) ||
@@ -937,31 +983,90 @@
instance_size = 0;
}
- /* check that the data is bound by the table length; */
- /* based on similar code in function `TT_Get_MM_Var' */
+ /* check that the data is bound by the table length */
if ( version != 0x00010000UL ||
axis_size != 20 ||
+ num_axes == 0 ||
+ /* `num_axes' limit implied by 16-bit `instance_size' */
num_axes > 0x3FFE ||
- instance_size != 4 + 4 * num_axes ||
+ !( instance_size == 4 + 4 * num_axes ||
+ instance_size == 6 + 4 * num_axes ) ||
+ /* `num_instances' limit implied by limited range of name IDs */
num_instances > 0x7EFF ||
offset +
axis_size * num_axes +
instance_size * num_instances > fvar_len )
num_instances = 0;
+ else
+ face->variation_support |= TT_FACE_FLAG_VAR_FVAR;
- /* we don't support Multiple Master CFFs yet */
- if ( !face->goto_table( face, TTAG_CFF, stream, 0 ) )
- num_instances = 0;
+ /*
+ * As documented in the OpenType specification, an entry for the
+ * default instance may be omitted in the named instance table. In
+ * particular this means that even if there is no named instance
+ * table in the font we actually do have a named instance, namely the
+ * default instance.
+ *
+ * For consistency, we always want the default instance in our list
+ * of named instances. If it is missing, we try to synthesize it
+ * later on. Here, we have to adjust `num_instances' accordingly.
+ */
- /* we support at most 2^15 - 1 instances */
- if ( num_instances >= ( 1U << 15 ) - 1 )
+ if ( ( face->variation_support & TT_FACE_FLAG_VAR_FVAR ) &&
+ !( FT_ALLOC( default_values, num_axes * 4 ) ||
+ FT_ALLOC( instance_values, num_axes * 4 ) ) )
{
- if ( face_instance_index >= 0 )
- return FT_THROW( Invalid_Argument );
- else
- num_instances = 0;
+ /* the current stream position is 16 bytes after the table start */
+ FT_ULong array_start = FT_STREAM_POS() - 16 + offset;
+ FT_ULong default_value_offset, instance_offset;
+
+ FT_Byte* p;
+ FT_UInt i;
+
+
+ default_value_offset = array_start + 8;
+ p = default_values;
+
+ for ( i = 0; i < num_axes; i++ )
+ {
+ (void)FT_STREAM_READ_AT( default_value_offset, p, 4 );
+
+ default_value_offset += axis_size;
+ p += 4;
+ }
+
+ instance_offset = array_start + axis_size * num_axes + 4;
+
+ for ( i = 0; i < num_instances; i++ )
+ {
+ (void)FT_STREAM_READ_AT( instance_offset,
+ instance_values,
+ num_axes * 4 );
+
+ if ( !ft_memcmp( default_values, instance_values, num_axes * 4 ) )
+ break;
+
+ instance_offset += instance_size;
+ }
+
+ if ( i == num_instances )
+ {
+ /* no default instance in named instance table; */
+ /* we thus have to synthesize it */
+ num_instances++;
+ }
}
+ FT_FREE( default_values );
+ FT_FREE( instance_values );
+
+ /* we don't support Multiple Master CFFs yet; */
+ /* note that `glyf' or `CFF2' have precedence */
+ if ( face->goto_table( face, TTAG_glyf, stream, 0 ) &&
+ face->goto_table( face, TTAG_CFF2, stream, 0 ) &&
+ !face->goto_table( face, TTAG_CFF, stream, 0 ) )
+ num_instances = 0;
+
/* instance indices in `face_instance_index' start with index 1, */
/* thus `>' and not `>=' */
if ( instance_index > num_instances )
@@ -977,7 +1082,7 @@
#endif
face->root.num_faces = face->ttc_header.count;
- face->root.face_index = face_index;
+ face->root.face_index = face_instance_index;
return error;
}
@@ -1039,8 +1144,8 @@
FT_Bool has_outline;
FT_Bool is_apple_sbit;
FT_Bool is_apple_sbix;
- FT_Bool ignore_preferred_family = FALSE;
- FT_Bool ignore_preferred_subfamily = FALSE;
+ FT_Bool ignore_typographic_family = FALSE;
+ FT_Bool ignore_typographic_subfamily = FALSE;
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
@@ -1055,10 +1160,10 @@
for ( i = 0; i < num_params; i++ )
{
- if ( params[i].tag == FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY )
- ignore_preferred_family = TRUE;
- else if ( params[i].tag == FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY )
- ignore_preferred_subfamily = TRUE;
+ if ( params[i].tag == FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY )
+ ignore_typographic_family = TRUE;
+ else if ( params[i].tag == FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY )
+ ignore_typographic_subfamily = TRUE;
}
}
@@ -1083,12 +1188,14 @@
/* do we have outlines in there? */
#ifdef FT_CONFIG_OPTION_INCREMENTAL
- has_outline = FT_BOOL( face->root.internal->incremental_interface != 0 ||
- tt_face_lookup_table( face, TTAG_glyf ) != 0 ||
- tt_face_lookup_table( face, TTAG_CFF ) != 0 );
+ has_outline = FT_BOOL( face->root.internal->incremental_interface ||
+ tt_face_lookup_table( face, TTAG_glyf ) ||
+ tt_face_lookup_table( face, TTAG_CFF ) ||
+ tt_face_lookup_table( face, TTAG_CFF2 ) );
#else
- has_outline = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) != 0 ||
- tt_face_lookup_table( face, TTAG_CFF ) != 0 );
+ has_outline = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) ||
+ tt_face_lookup_table( face, TTAG_CFF ) ||
+ tt_face_lookup_table( face, TTAG_CFF2 ) );
#endif
is_apple_sbit = 0;
@@ -1220,30 +1327,10 @@
/* embedded bitmap support */
if ( sfnt->load_eblc )
- {
LOAD_( eblc );
- if ( error )
- {
- /* a font which contains neither bitmaps nor outlines is */
- /* still valid (although rather useless in most cases); */
- /* however, you can find such stripped fonts in PDFs */
- if ( FT_ERR_EQ( error, Table_Missing ) )
- error = FT_Err_Ok;
- else
- goto Exit;
- }
- }
+ /* consider the pclt, kerning, and gasp tables as optional */
LOAD_( pclt );
- if ( error )
- {
- if ( FT_ERR_NEQ( error, Table_Missing ) )
- goto Exit;
-
- face->pclt.Version = 0;
- }
-
- /* consider the kerning and gasp tables as optional */
LOAD_( gasp );
LOAD_( kern );
@@ -1259,27 +1346,27 @@
face->root.style_name = NULL;
if ( face->os2.version != 0xFFFFU && face->os2.fsSelection & 256 )
{
- if ( !ignore_preferred_family )
- GET_NAME( PREFERRED_FAMILY, &face->root.family_name );
+ if ( !ignore_typographic_family )
+ GET_NAME( TYPOGRAPHIC_FAMILY, &face->root.family_name );
if ( !face->root.family_name )
GET_NAME( FONT_FAMILY, &face->root.family_name );
- if ( !ignore_preferred_subfamily )
- GET_NAME( PREFERRED_SUBFAMILY, &face->root.style_name );
+ if ( !ignore_typographic_subfamily )
+ GET_NAME( TYPOGRAPHIC_SUBFAMILY, &face->root.style_name );
if ( !face->root.style_name )
GET_NAME( FONT_SUBFAMILY, &face->root.style_name );
}
else
{
GET_NAME( WWS_FAMILY, &face->root.family_name );
- if ( !face->root.family_name && !ignore_preferred_family )
- GET_NAME( PREFERRED_FAMILY, &face->root.family_name );
+ if ( !face->root.family_name && !ignore_typographic_family )
+ GET_NAME( TYPOGRAPHIC_FAMILY, &face->root.family_name );
if ( !face->root.family_name )
GET_NAME( FONT_FAMILY, &face->root.family_name );
GET_NAME( WWS_SUBFAMILY, &face->root.style_name );
- if ( !face->root.style_name && !ignore_preferred_subfamily )
- GET_NAME( PREFERRED_SUBFAMILY, &face->root.style_name );
+ if ( !face->root.style_name && !ignore_typographic_subfamily )
+ GET_NAME( TYPOGRAPHIC_SUBFAMILY, &face->root.style_name );
if ( !face->root.style_name )
GET_NAME( FONT_SUBFAMILY, &face->root.style_name );
}
@@ -1327,10 +1414,14 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
/* Don't bother to load the tables unless somebody asks for them. */
/* No need to do work which will (probably) not be used. */
- if ( tt_face_lookup_table( face, TTAG_glyf ) != 0 &&
- tt_face_lookup_table( face, TTAG_fvar ) != 0 &&
- tt_face_lookup_table( face, TTAG_gvar ) != 0 )
- flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;
+ if ( face->variation_support & TT_FACE_FLAG_VAR_FVAR )
+ {
+ if ( tt_face_lookup_table( face, TTAG_glyf ) != 0 &&
+ tt_face_lookup_table( face, TTAG_gvar ) != 0 )
+ flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;
+ if ( tt_face_lookup_table( face, TTAG_CFF2 ) != 0 )
+ flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;
+ }
#endif
root->face_flags = flags;
@@ -1393,7 +1484,7 @@
charmap->encoding_id );
#if 0
- if ( root->charmap == NULL &&
+ if ( !root->charmap &&
charmap->encoding == FT_ENCODING_UNICODE )
{
/* set 'root->charmap' to the first Unicode encoding we find */
@@ -1411,7 +1502,7 @@
* depths in the FT_Bitmap_Size record. This is a design error.
*/
{
- FT_UInt i, count;
+ FT_UInt count;
count = face->sbit_num_strikes;
@@ -1423,6 +1514,9 @@
FT_Short avgwidth = face->os2.xAvgCharWidth;
FT_Size_Metrics metrics;
+ FT_UInt* sbit_strike_map = NULL;
+ FT_UInt strike_idx, bsize_idx;
+
if ( em_size == 0 || face->os2.version == 0xFFFFU )
{
@@ -1430,31 +1524,50 @@
em_size = 1;
}
- if ( FT_NEW_ARRAY( root->available_sizes, count ) )
+ /* to avoid invalid strike data in the `available_sizes' field */
+ /* of `FT_Face', we map `available_sizes' indices to strike */
+ /* indices */
+ if ( FT_NEW_ARRAY( root->available_sizes, count ) ||
+ FT_NEW_ARRAY( sbit_strike_map, count ) )
goto Exit;
- for ( i = 0; i < count; i++ )
+ bsize_idx = 0;
+ for ( strike_idx = 0; strike_idx < count; strike_idx++ )
{
- FT_Bitmap_Size* bsize = root->available_sizes + i;
+ FT_Bitmap_Size* bsize = root->available_sizes + bsize_idx;
- error = sfnt->load_strike_metrics( face, i, &metrics );
+ error = sfnt->load_strike_metrics( face, strike_idx, &metrics );
if ( error )
- goto Exit;
+ continue;
bsize->height = (FT_Short)( metrics.height >> 6 );
- bsize->width = (FT_Short)(
- ( avgwidth * metrics.x_ppem + em_size / 2 ) / em_size );
+ bsize->width = (FT_Short)(
+ ( avgwidth * metrics.x_ppem + em_size / 2 ) / em_size );
bsize->x_ppem = metrics.x_ppem << 6;
bsize->y_ppem = metrics.y_ppem << 6;
/* assume 72dpi */
bsize->size = metrics.y_ppem << 6;
+
+ /* only use strikes with valid PPEM values */
+ if ( bsize->x_ppem && bsize->y_ppem )
+ sbit_strike_map[bsize_idx++] = strike_idx;
}
- root->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
- root->num_fixed_sizes = (FT_Int)count;
+ /* reduce array size to the actually used elements */
+ (void)FT_RENEW_ARRAY( sbit_strike_map, count, bsize_idx );
+
+ /* from now on, all strike indices are mapped */
+ /* using `sbit_strike_map' */
+ if ( bsize_idx )
+ {
+ face->sbit_strike_map = sbit_strike_map;
+
+ root->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
+ root->num_fixed_sizes = (FT_Int)bsize_idx;
+ }
}
}
@@ -1615,18 +1728,10 @@
face->cmap_size = 0;
}
- /* freeing the horizontal metrics */
- {
- FT_Stream stream = FT_FACE_STREAM( face );
-
+ face->horz_metrics_size = 0;
+ face->vert_metrics_size = 0;
- FT_FRAME_RELEASE( face->horz_metrics );
- FT_FRAME_RELEASE( face->vert_metrics );
- face->horz_metrics_size = 0;
- face->vert_metrics_size = 0;
- }
-
- /* freeing the vertical ones, if any */
+ /* freeing vertical metrics, if any */
if ( face->vertical_info )
{
FT_FREE( face->vertical.long_metrics );
@@ -1648,9 +1753,13 @@
/* freeing sbit size table */
FT_FREE( face->root.available_sizes );
+ FT_FREE( face->sbit_strike_map );
face->root.num_fixed_sizes = 0;
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_FREE( face->postscript_name );
+ FT_FREE( face->var_postscript_prefix );
+#endif
face->sfnt = NULL;
}
diff --git a/thirdparty/freetype/src/sfnt/sfobjs.h b/thirdparty/freetype/src/sfnt/sfobjs.h
index 60b5698edd..705381459a 100644
--- a/thirdparty/freetype/src/sfnt/sfobjs.h
+++ b/thirdparty/freetype/src/sfnt/sfobjs.h
@@ -4,7 +4,7 @@
/* */
/* SFNT object management (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttbdf.c b/thirdparty/freetype/src/sfnt/ttbdf.c
index f891691118..2196e3791e 100644
--- a/thirdparty/freetype/src/sfnt/ttbdf.c
+++ b/thirdparty/freetype/src/sfnt/ttbdf.c
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded BDF properties (body). */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -48,7 +48,7 @@
FT_Stream stream = FT_FACE(face)->stream;
- if ( bdf->table != NULL )
+ if ( bdf->table )
FT_FRAME_RELEASE( bdf->table );
bdf->table_end = NULL;
@@ -165,7 +165,7 @@
error = FT_ERR( Invalid_Argument );
- if ( size == NULL || property_name == NULL )
+ if ( !size || !property_name )
goto Exit;
property_len = ft_strlen( property_name );
@@ -177,6 +177,7 @@
FT_UInt _ppem = FT_NEXT_USHORT( p );
FT_UInt _count = FT_NEXT_USHORT( p );
+
if ( _ppem == size->metrics.y_ppem )
{
count = _count;
@@ -193,6 +194,7 @@
{
FT_UInt type = FT_PEEK_USHORT( p + 4 );
+
if ( ( type & 0x10 ) != 0 )
{
FT_UInt32 name_offset = FT_PEEK_ULONG( p );
@@ -244,7 +246,12 @@
return error;
}
-#endif /* TT_CONFIG_OPTION_BDF */
+#else /* !TT_CONFIG_OPTION_BDF */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _tt_bdf_dummy;
+
+#endif /* !TT_CONFIG_OPTION_BDF */
/* END */
diff --git a/thirdparty/freetype/src/sfnt/ttbdf.h b/thirdparty/freetype/src/sfnt/ttbdf.h
index ae521c60b6..398b620600 100644
--- a/thirdparty/freetype/src/sfnt/ttbdf.h
+++ b/thirdparty/freetype/src/sfnt/ttbdf.h
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded BDF properties (specification). */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttcmap.c b/thirdparty/freetype/src/sfnt/ttcmap.c
index 01255a887e..5afa6ae4b7 100644
--- a/thirdparty/freetype/src/sfnt/ttcmap.c
+++ b/thirdparty/freetype/src/sfnt/ttcmap.c
@@ -4,7 +4,7 @@
/* */
/* TrueType character mapping table (cmap) support (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -180,22 +180,24 @@
FT_DEFINE_TT_CMAP(
tt_cmap0_class_rec,
- sizeof ( TT_CMapRec ),
- (FT_CMap_InitFunc) tt_cmap_init,
- (FT_CMap_DoneFunc) NULL,
- (FT_CMap_CharIndexFunc)tt_cmap0_char_index,
- (FT_CMap_CharNextFunc) tt_cmap0_char_next,
+ sizeof ( TT_CMapRec ),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ (FT_CMap_InitFunc) tt_cmap_init, /* init */
+ (FT_CMap_DoneFunc) NULL, /* done */
+ (FT_CMap_CharIndexFunc)tt_cmap0_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) tt_cmap0_char_next, /* char_next */
+
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL, /* variantchar_list */
0,
- (TT_CMap_ValidateFunc)tt_cmap0_validate,
- (TT_CMap_Info_GetFunc)tt_cmap0_get_info )
+ (TT_CMap_ValidateFunc)tt_cmap0_validate, /* validate */
+ (TT_CMap_Info_GetFunc)tt_cmap0_get_info /* get_cmap_info */
+ )
#endif /* TT_CONFIG_CMAP_FORMAT_0 */
@@ -571,22 +573,24 @@
FT_DEFINE_TT_CMAP(
tt_cmap2_class_rec,
- sizeof ( TT_CMapRec ),
- (FT_CMap_InitFunc) tt_cmap_init,
- (FT_CMap_DoneFunc) NULL,
- (FT_CMap_CharIndexFunc)tt_cmap2_char_index,
- (FT_CMap_CharNextFunc) tt_cmap2_char_next,
+ sizeof ( TT_CMapRec ),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ (FT_CMap_InitFunc) tt_cmap_init, /* init */
+ (FT_CMap_DoneFunc) NULL, /* done */
+ (FT_CMap_CharIndexFunc)tt_cmap2_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) tt_cmap2_char_next, /* char_next */
+
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL, /* variantchar_list */
2,
- (TT_CMap_ValidateFunc)tt_cmap2_validate,
- (TT_CMap_Info_GetFunc)tt_cmap2_get_info )
+ (TT_CMap_ValidateFunc)tt_cmap2_validate, /* validate */
+ (TT_CMap_Info_GetFunc)tt_cmap2_get_info /* get_cmap_info */
+ )
#endif /* TT_CONFIG_CMAP_FORMAT_2 */
@@ -763,6 +767,9 @@
static void
tt_cmap4_next( TT_CMap4 cmap )
{
+ TT_Face face = (TT_Face)cmap->cmap.cmap.charmap.face;
+ FT_Byte* limit = face->cmap_table + face->cmap_size;
+
FT_UInt charcode;
@@ -788,15 +795,19 @@
FT_Byte* p = values + 2 * ( charcode - cmap->cur_start );
+ /* if p > limit, the whole segment is invalid */
+ if ( p > limit )
+ goto Next_Segment;
+
do
{
FT_UInt gindex = FT_NEXT_USHORT( p );
- if ( gindex != 0 )
+ if ( gindex )
{
gindex = (FT_UInt)( (FT_Int)gindex + delta ) & 0xFFFFU;
- if ( gindex != 0 )
+ if ( gindex )
{
cmap->cur_charcode = charcode;
cmap->cur_gindex = gindex;
@@ -812,7 +823,26 @@
FT_UInt gindex = (FT_UInt)( (FT_Int)charcode + delta ) & 0xFFFFU;
- if ( gindex != 0 )
+ if ( gindex >= (FT_UInt)face->root.num_glyphs )
+ {
+ /* we have an invalid glyph index; if there is an overflow, */
+ /* we can adjust `charcode', otherwise the whole segment is */
+ /* invalid */
+ gindex = 0;
+
+ if ( (FT_Int)charcode + delta < 0 &&
+ (FT_Int)end + delta >= 0 )
+ charcode = (FT_UInt)( -delta );
+
+ else if ( (FT_Int)charcode + delta < 0x10000L &&
+ (FT_Int)end + delta >= 0x10000L )
+ charcode = (FT_UInt)( 0x10000L - delta );
+
+ else
+ goto Next_Segment;
+ }
+
+ if ( gindex )
{
cmap->cur_charcode = charcode;
cmap->cur_gindex = gindex;
@@ -822,6 +852,7 @@
}
}
+ Next_Segment:
/* we need to find another range */
if ( tt_cmap4_set_range( cmap, cmap->cur_range + 1 ) < 0 )
break;
@@ -1170,6 +1201,9 @@
FT_UInt32* pcharcode,
FT_Bool next )
{
+ TT_Face face = (TT_Face)cmap->cmap.charmap.face;
+ FT_Byte* limit = face->cmap_table + face->cmap_size;
+
FT_UInt num_segs2, start, end, offset;
FT_Int delta;
FT_UInt max, min, mid, num_segs;
@@ -1221,10 +1255,6 @@
if ( mid >= num_segs - 1 &&
start == 0xFFFFU && end == 0xFFFFU )
{
- TT_Face face = (TT_Face)cmap->cmap.charmap.face;
- FT_Byte* limit = face->cmap_table + face->cmap_size;
-
-
if ( offset && p + offset + 2 > limit )
{
delta = 1;
@@ -1347,13 +1377,40 @@
if ( offset )
{
p += offset + ( charcode - start ) * 2;
+
+ /* if p > limit, the whole segment is invalid */
+ if ( next && p > limit )
+ break;
+
gindex = TT_PEEK_USHORT( p );
- if ( gindex != 0 )
+ if ( gindex )
+ {
gindex = (FT_UInt)( (FT_Int)gindex + delta ) & 0xFFFFU;
+ if ( gindex >= (FT_UInt)face->root.num_glyphs )
+ gindex = 0;
+ }
}
else
+ {
gindex = (FT_UInt)( (FT_Int)charcode + delta ) & 0xFFFFU;
+ if ( next && gindex >= (FT_UInt)face->root.num_glyphs )
+ {
+ /* we have an invalid glyph index; if there is an overflow, */
+ /* we can adjust `charcode', otherwise the whole segment is */
+ /* invalid */
+ gindex = 0;
+
+ if ( (FT_Int)charcode + delta < 0 &&
+ (FT_Int)end + delta >= 0 )
+ charcode = (FT_UInt)( -delta );
+
+ else if ( (FT_Int)charcode + delta < 0x10000L &&
+ (FT_Int)end + delta >= 0x10000L )
+ charcode = (FT_UInt)( 0x10000L - delta );
+ }
+ }
+
break;
}
}
@@ -1463,21 +1520,24 @@
FT_DEFINE_TT_CMAP(
tt_cmap4_class_rec,
- sizeof ( TT_CMap4Rec ),
- (FT_CMap_InitFunc) tt_cmap4_init,
- (FT_CMap_DoneFunc) NULL,
- (FT_CMap_CharIndexFunc)tt_cmap4_char_index,
- (FT_CMap_CharNextFunc) tt_cmap4_char_next,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ sizeof ( TT_CMap4Rec ),
+
+ (FT_CMap_InitFunc) tt_cmap4_init, /* init */
+ (FT_CMap_DoneFunc) NULL, /* done */
+ (FT_CMap_CharIndexFunc)tt_cmap4_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) tt_cmap4_char_next, /* char_next */
+
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL, /* variantchar_list */
4,
- (TT_CMap_ValidateFunc)tt_cmap4_validate,
- (TT_CMap_Info_GetFunc)tt_cmap4_get_info )
+ (TT_CMap_ValidateFunc)tt_cmap4_validate, /* validate */
+ (TT_CMap_Info_GetFunc)tt_cmap4_get_info /* get_cmap_info */
+ )
#endif /* TT_CONFIG_CMAP_FORMAT_4 */
@@ -1630,22 +1690,24 @@
FT_DEFINE_TT_CMAP(
tt_cmap6_class_rec,
- sizeof ( TT_CMapRec ),
- (FT_CMap_InitFunc) tt_cmap_init,
- (FT_CMap_DoneFunc) NULL,
- (FT_CMap_CharIndexFunc)tt_cmap6_char_index,
- (FT_CMap_CharNextFunc) tt_cmap6_char_next,
+ sizeof ( TT_CMapRec ),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ (FT_CMap_InitFunc) tt_cmap_init, /* init */
+ (FT_CMap_DoneFunc) NULL, /* done */
+ (FT_CMap_CharIndexFunc)tt_cmap6_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) tt_cmap6_char_next, /* char_next */
+
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL, /* variantchar_list */
6,
- (TT_CMap_ValidateFunc)tt_cmap6_validate,
- (TT_CMap_Info_GetFunc)tt_cmap6_get_info )
+ (TT_CMap_ValidateFunc)tt_cmap6_validate, /* validate */
+ (TT_CMap_Info_GetFunc)tt_cmap6_get_info /* get_cmap_info */
+ )
#endif /* TT_CONFIG_CMAP_FORMAT_6 */
@@ -1922,22 +1984,24 @@
FT_DEFINE_TT_CMAP(
tt_cmap8_class_rec,
- sizeof ( TT_CMapRec ),
- (FT_CMap_InitFunc) tt_cmap_init,
- (FT_CMap_DoneFunc) NULL,
- (FT_CMap_CharIndexFunc)tt_cmap8_char_index,
- (FT_CMap_CharNextFunc) tt_cmap8_char_next,
+ sizeof ( TT_CMapRec ),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ (FT_CMap_InitFunc) tt_cmap_init, /* init */
+ (FT_CMap_DoneFunc) NULL, /* done */
+ (FT_CMap_CharIndexFunc)tt_cmap8_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) tt_cmap8_char_next, /* char_next */
+
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL, /* variantchar_list */
8,
- (TT_CMap_ValidateFunc)tt_cmap8_validate,
- (TT_CMap_Info_GetFunc)tt_cmap8_get_info )
+ (TT_CMap_ValidateFunc)tt_cmap8_validate, /* validate */
+ (TT_CMap_Info_GetFunc)tt_cmap8_get_info /* get_cmap_info */
+ )
#endif /* TT_CONFIG_CMAP_FORMAT_8 */
@@ -2092,22 +2156,24 @@
FT_DEFINE_TT_CMAP(
tt_cmap10_class_rec,
- sizeof ( TT_CMapRec ),
- (FT_CMap_InitFunc) tt_cmap_init,
- (FT_CMap_DoneFunc) NULL,
- (FT_CMap_CharIndexFunc)tt_cmap10_char_index,
- (FT_CMap_CharNextFunc) tt_cmap10_char_next,
+ sizeof ( TT_CMapRec ),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ (FT_CMap_InitFunc) tt_cmap_init, /* init */
+ (FT_CMap_DoneFunc) NULL, /* done */
+ (FT_CMap_CharIndexFunc)tt_cmap10_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) tt_cmap10_char_next, /* char_next */
+
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL, /* variantchar_list */
10,
- (TT_CMap_ValidateFunc)tt_cmap10_validate,
- (TT_CMap_Info_GetFunc)tt_cmap10_get_info )
+ (TT_CMap_ValidateFunc)tt_cmap10_validate, /* validate */
+ (TT_CMap_Info_GetFunc)tt_cmap10_get_info /* get_cmap_info */
+ )
#endif /* TT_CONFIG_CMAP_FORMAT_10 */
@@ -2446,22 +2512,24 @@
FT_DEFINE_TT_CMAP(
tt_cmap12_class_rec,
- sizeof ( TT_CMap12Rec ),
- (FT_CMap_InitFunc) tt_cmap12_init,
- (FT_CMap_DoneFunc) NULL,
- (FT_CMap_CharIndexFunc)tt_cmap12_char_index,
- (FT_CMap_CharNextFunc) tt_cmap12_char_next,
+ sizeof ( TT_CMap12Rec ),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ (FT_CMap_InitFunc) tt_cmap12_init, /* init */
+ (FT_CMap_DoneFunc) NULL, /* done */
+ (FT_CMap_CharIndexFunc)tt_cmap12_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) tt_cmap12_char_next, /* char_next */
+
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL, /* variantchar_list */
12,
- (TT_CMap_ValidateFunc)tt_cmap12_validate,
- (TT_CMap_Info_GetFunc)tt_cmap12_get_info )
+ (TT_CMap_ValidateFunc)tt_cmap12_validate, /* validate */
+ (TT_CMap_Info_GetFunc)tt_cmap12_get_info /* get_cmap_info */
+ )
#endif /* TT_CONFIG_CMAP_FORMAT_12 */
@@ -2770,22 +2838,24 @@
FT_DEFINE_TT_CMAP(
tt_cmap13_class_rec,
- sizeof ( TT_CMap13Rec ),
- (FT_CMap_InitFunc) tt_cmap13_init,
- (FT_CMap_DoneFunc) NULL,
- (FT_CMap_CharIndexFunc)tt_cmap13_char_index,
- (FT_CMap_CharNextFunc) tt_cmap13_char_next,
+ sizeof ( TT_CMap13Rec ),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ (FT_CMap_InitFunc) tt_cmap13_init, /* init */
+ (FT_CMap_DoneFunc) NULL, /* done */
+ (FT_CMap_CharIndexFunc)tt_cmap13_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) tt_cmap13_char_next, /* char_next */
+
+ (FT_CMap_CharVarIndexFunc) NULL, /* char_var_index */
+ (FT_CMap_CharVarIsDefaultFunc)NULL, /* char_var_default */
+ (FT_CMap_VariantListFunc) NULL, /* variant_list */
+ (FT_CMap_CharVariantListFunc) NULL, /* charvariant_list */
+ (FT_CMap_VariantCharListFunc) NULL, /* variantchar_list */
13,
- (TT_CMap_ValidateFunc)tt_cmap13_validate,
- (TT_CMap_Info_GetFunc)tt_cmap13_get_info )
+ (TT_CMap_ValidateFunc)tt_cmap13_validate, /* validate */
+ (TT_CMap_Info_GetFunc)tt_cmap13_get_info /* get_cmap_info */
+ )
#endif /* TT_CONFIG_CMAP_FORMAT_13 */
@@ -2876,7 +2946,7 @@
cmap->max_results = 0;
- if ( memory != NULL && cmap->results != NULL )
+ if ( memory && cmap->results )
FT_FREE( cmap->results );
}
@@ -2983,7 +3053,7 @@
if ( numRanges > (FT_ULong)( valid->limit - defp ) / 4 )
FT_INVALID_TOO_SHORT;
- for ( i = 0; i < numRanges; ++i )
+ for ( i = 0; i < numRanges; i++ )
{
FT_ULong base = TT_NEXT_UINT24( defp );
FT_ULong cnt = FT_NEXT_BYTE( defp );
@@ -3016,7 +3086,7 @@
if ( numMappings > ( (FT_ULong)( valid->limit - ndp ) ) / 5 )
FT_INVALID_TOO_SHORT;
- for ( i = 0; i < numMappings; ++i )
+ for ( i = 0; i < numMappings; i++ )
{
FT_ULong uni = TT_NEXT_UINT24( ndp );
FT_ULong gid = TT_NEXT_USHORT( ndp );
@@ -3257,7 +3327,7 @@
return NULL;
result = cmap14->results;
- for ( i = 0; i < count; ++i )
+ for ( i = 0; i < count; i++ )
{
result[i] = (FT_UInt32)TT_NEXT_UINT24( p );
p += 8;
@@ -3282,7 +3352,7 @@
if ( tt_cmap14_ensure( cmap14, ( count + 1 ), memory ) )
return NULL;
- for ( q = cmap14->results; count > 0; --count )
+ for ( q = cmap14->results; count > 0; count-- )
{
FT_UInt32 varSel = TT_NEXT_UINT24( p );
FT_ULong defOff = TT_NEXT_ULONG( p );
@@ -3341,7 +3411,7 @@
if ( tt_cmap14_ensure( cmap14, ( cnt + 1 ), memory ) )
return NULL;
- for ( q = cmap14->results; numRanges > 0; --numRanges )
+ for ( q = cmap14->results; numRanges > 0; numRanges-- )
{
FT_UInt32 uni = (FT_UInt32)TT_NEXT_UINT24( p );
@@ -3378,7 +3448,7 @@
return NULL;
ret = cmap14->results;
- for ( i = 0; i < numMappings; ++i )
+ for ( i = 0; i < numMappings; i++ )
{
ret[i] = (FT_UInt32)TT_NEXT_UINT24( p );
p += 2;
@@ -3462,10 +3532,10 @@
{
if ( nuni > duni + dcnt )
{
- for ( k = 0; k <= dcnt; ++k )
+ for ( k = 0; k <= dcnt; k++ )
ret[i++] = duni + k;
- ++di;
+ di++;
if ( di > numRanges )
break;
@@ -3479,7 +3549,7 @@
ret[i++] = nuni;
/* If it is within the default range then ignore it -- */
/* that should not have happened */
- ++ni;
+ ni++;
if ( ni > numMappings )
break;
@@ -3498,7 +3568,7 @@
{
ret[i++] = (FT_UInt32)TT_NEXT_UINT24( p );
p += 2;
- ++ni;
+ ni++;
}
}
else if ( di <= numRanges )
@@ -3506,7 +3576,7 @@
/* If we get here then we have run out of all non-default */
/* mappings. We have read one default range which we haven't */
/* stored and there may be others that need to be read. */
- for ( k = 0; k <= dcnt; ++k )
+ for ( k = 0; k <= dcnt; k++ )
ret[i++] = duni + k;
while ( di < numRanges )
@@ -3514,9 +3584,9 @@
duni = (FT_UInt32)TT_NEXT_UINT24( dp );
dcnt = FT_NEXT_BYTE( dp );
- for ( k = 0; k <= dcnt; ++k )
+ for ( k = 0; k <= dcnt; k++ )
ret[i++] = duni + k;
- ++di;
+ di++;
}
}
@@ -3529,23 +3599,25 @@
FT_DEFINE_TT_CMAP(
tt_cmap14_class_rec,
- sizeof ( TT_CMap14Rec ),
- (FT_CMap_InitFunc) tt_cmap14_init,
- (FT_CMap_DoneFunc) tt_cmap14_done,
- (FT_CMap_CharIndexFunc)tt_cmap14_char_index,
- (FT_CMap_CharNextFunc) tt_cmap14_char_next,
+ sizeof ( TT_CMap14Rec ),
+
+ (FT_CMap_InitFunc) tt_cmap14_init, /* init */
+ (FT_CMap_DoneFunc) tt_cmap14_done, /* done */
+ (FT_CMap_CharIndexFunc)tt_cmap14_char_index, /* char_index */
+ (FT_CMap_CharNextFunc) tt_cmap14_char_next, /* char_next */
- /* Format 14 extension functions */
- (FT_CMap_CharVarIndexFunc) tt_cmap14_char_var_index,
- (FT_CMap_CharVarIsDefaultFunc)tt_cmap14_char_var_isdefault,
- (FT_CMap_VariantListFunc) tt_cmap14_variants,
- (FT_CMap_CharVariantListFunc) tt_cmap14_char_variants,
- (FT_CMap_VariantCharListFunc) tt_cmap14_variant_chars,
+ /* Format 14 extension functions */
+ (FT_CMap_CharVarIndexFunc) tt_cmap14_char_var_index,
+ (FT_CMap_CharVarIsDefaultFunc)tt_cmap14_char_var_isdefault,
+ (FT_CMap_VariantListFunc) tt_cmap14_variants,
+ (FT_CMap_CharVariantListFunc) tt_cmap14_char_variants,
+ (FT_CMap_VariantCharListFunc) tt_cmap14_variant_chars,
14,
- (TT_CMap_ValidateFunc)tt_cmap14_validate,
- (TT_CMap_Info_GetFunc)tt_cmap14_get_info )
+ (TT_CMap_ValidateFunc)tt_cmap14_validate, /* validate */
+ (TT_CMap_Info_GetFunc)tt_cmap14_get_info /* get_cmap_info */
+ )
#endif /* TT_CONFIG_CMAP_FORMAT_14 */
@@ -3684,7 +3756,7 @@
error = clazz->validate( cmap, FT_VALIDATOR( &valid ) );
}
- if ( valid.validator.error == 0 )
+ if ( !valid.validator.error )
{
FT_CMap ttcmap;
@@ -3710,7 +3782,7 @@
}
}
- if ( *pclazz == NULL )
+ if ( !*pclazz )
{
FT_TRACE0(( "tt_face_build_cmaps:"
" unsupported cmap sub-table ignored\n" ));
diff --git a/thirdparty/freetype/src/sfnt/ttcmap.h b/thirdparty/freetype/src/sfnt/ttcmap.h
index 2273cbd961..83f12df241 100644
--- a/thirdparty/freetype/src/sfnt/ttcmap.h
+++ b/thirdparty/freetype/src/sfnt/ttcmap.h
@@ -4,7 +4,7 @@
/* */
/* TrueType character mapping table (cmap) support (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttcmapc.h b/thirdparty/freetype/src/sfnt/ttcmapc.h
index 7c732fbd36..9a5e70825e 100644
--- a/thirdparty/freetype/src/sfnt/ttcmapc.h
+++ b/thirdparty/freetype/src/sfnt/ttcmapc.h
@@ -4,7 +4,7 @@
/* */
/* TT CMAP classes definitions (specification only). */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttkern.c b/thirdparty/freetype/src/sfnt/ttkern.c
index 6f9fa522d5..c97e5789ac 100644
--- a/thirdparty/freetype/src/sfnt/ttkern.c
+++ b/thirdparty/freetype/src/sfnt/ttkern.c
@@ -5,7 +5,7 @@
/* Load the basic TrueType kerning table. This doesn't handle */
/* kerning data within the GPOS table at the moment. */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -108,8 +108,8 @@
p_next = p_limit;
/* only use horizontal kerning tables */
- if ( ( coverage & ~8U ) != 0x0001 ||
- p + 8 > p_limit )
+ if ( ( coverage & 3U ) != 0x0001 ||
+ p + 8 > p_next )
goto NextTable;
num_pairs = FT_NEXT_USHORT( p );
@@ -214,8 +214,7 @@
if ( ( face->kern_avail_bits & mask ) == 0 )
goto NextTable;
- if ( p + 8 > next )
- goto NextTable;
+ FT_ASSERT( p + 8 <= next ); /* tested in tt_face_load_kern */
num_pairs = FT_NEXT_USHORT( p );
p += 6;
diff --git a/thirdparty/freetype/src/sfnt/ttkern.h b/thirdparty/freetype/src/sfnt/ttkern.h
index 85dd5c31ae..db1a30bdb0 100644
--- a/thirdparty/freetype/src/sfnt/ttkern.h
+++ b/thirdparty/freetype/src/sfnt/ttkern.h
@@ -5,7 +5,7 @@
/* Load the basic TrueType kerning table. This doesn't handle */
/* kerning data within the GPOS table at the moment. */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttload.c b/thirdparty/freetype/src/sfnt/ttload.c
index 2f5b2c3843..df99baa53e 100644
--- a/thirdparty/freetype/src/sfnt/ttload.c
+++ b/thirdparty/freetype/src/sfnt/ttload.c
@@ -5,7 +5,7 @@
/* Load the basic TrueType tables, i.e., tables that can be either in */
/* TTF or OTF fonts (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -679,7 +679,7 @@
/*************************************************************************/
/* */
/* <Function> */
- /* tt_face_load_max_profile */
+ /* tt_face_load_maxp */
/* */
/* <Description> */
/* Loads the maximum profile into a face object. */
@@ -775,15 +775,6 @@
maxProfile->maxTwilightPoints = 0xFFFFU - 4;
}
-
- /* we arbitrarily limit recursion to avoid stack exhaustion */
- if ( maxProfile->maxComponentDepth > 100 )
- {
- FT_TRACE0(( "tt_face_load_maxp:"
- " abnormally large component depth (%d) set to 100\n",
- maxProfile->maxComponentDepth ));
- maxProfile->maxComponentDepth = 100;
- }
}
FT_TRACE3(( "numGlyphs: %u\n", maxProfile->numGlyphs ));
@@ -817,7 +808,6 @@
FT_Memory memory = stream->memory;
FT_ULong table_pos, table_len;
FT_ULong storage_start, storage_limit;
- FT_UInt count;
TT_NameTable table;
static const FT_Frame_Field name_table_fields[] =
@@ -835,7 +825,7 @@
static const FT_Frame_Field name_record_fields[] =
{
#undef FT_STRUCTURE
-#define FT_STRUCTURE TT_NameEntryRec
+#define FT_STRUCTURE TT_NameRec
/* no FT_FRAME_START */
FT_FRAME_USHORT( platformID ),
@@ -847,6 +837,17 @@
FT_FRAME_END
};
+ static const FT_Frame_Field langTag_record_fields[] =
+ {
+#undef FT_STRUCTURE
+#define FT_STRUCTURE TT_LangTagRec
+
+ /* no FT_FRAME_START */
+ FT_FRAME_USHORT( stringLength ),
+ FT_FRAME_USHORT( stringOffset ),
+ FT_FRAME_END
+ };
+
table = &face->name_table;
table->stream = stream;
@@ -857,18 +858,17 @@
table_pos = FT_STREAM_POS();
-
if ( FT_STREAM_READ_FIELDS( name_table_fields, table ) )
goto Exit;
- /* Some popular Asian fonts have an invalid `storageOffset' value */
- /* (it should be at least "6 + 12*num_names"). However, the string */
- /* offsets, computed as "storageOffset + entry->stringOffset", are */
- /* valid pointers within the name table... */
- /* */
- /* We thus can't check `storageOffset' right now. */
- /* */
- storage_start = table_pos + 6 + 12*table->numNameRecords;
+ /* Some popular Asian fonts have an invalid `storageOffset' value (it */
+ /* should be at least `6 + 12*numNameRecords'). However, the string */
+ /* offsets, computed as `storageOffset + entry->stringOffset', are */
+ /* valid pointers within the name table... */
+ /* */
+ /* We thus can't check `storageOffset' right now. */
+ /* */
+ storage_start = table_pos + 6 + 12 * table->numNameRecords;
storage_limit = table_pos + table_len;
if ( storage_start > storage_limit )
@@ -878,18 +878,56 @@
goto Exit;
}
- /* Allocate the array of name records. */
- count = table->numNameRecords;
- table->numNameRecords = 0;
+ /* `name' format 1 contains additional language tag records, */
+ /* which we load first */
+ if ( table->format == 1 )
+ {
+ if ( FT_STREAM_SEEK( storage_start ) ||
+ FT_READ_USHORT( table->numLangTagRecords ) )
+ goto Exit;
+
+ storage_start += 2 + 4 * table->numLangTagRecords;
+
+ /* allocate language tag records array */
+ if ( FT_NEW_ARRAY( table->langTags, table->numLangTagRecords ) ||
+ FT_FRAME_ENTER( table->numLangTagRecords * 4 ) )
+ goto Exit;
+
+ /* load language tags */
+ {
+ TT_LangTag entry = table->langTags;
+ TT_LangTag limit = entry + table->numLangTagRecords;
+
- if ( FT_NEW_ARRAY( table->names, count ) ||
- FT_FRAME_ENTER( count * 12 ) )
+ for ( ; entry < limit; entry++ )
+ {
+ (void)FT_STREAM_READ_FIELDS( langTag_record_fields, entry );
+
+ /* check that the langTag string is within the table */
+ entry->stringOffset += table_pos + table->storageOffset;
+ if ( entry->stringOffset < storage_start ||
+ entry->stringOffset + entry->stringLength > storage_limit )
+ {
+ /* invalid entry; ignore it */
+ entry->stringLength = 0;
+ }
+ }
+ }
+
+ FT_FRAME_EXIT();
+
+ (void)FT_STREAM_SEEK( table_pos + 6 );
+ }
+
+ /* allocate name records array */
+ if ( FT_NEW_ARRAY( table->names, table->numNameRecords ) ||
+ FT_FRAME_ENTER( table->numNameRecords * 12 ) )
goto Exit;
- /* Load the name records and determine how much storage is needed */
- /* to hold the strings themselves. */
+ /* load name records */
{
- TT_NameEntryRec* entry = table->names;
+ TT_Name entry = table->names;
+ FT_UInt count = table->numNameRecords;
for ( ; count > 0; count-- )
@@ -906,22 +944,37 @@
if ( entry->stringOffset < storage_start ||
entry->stringOffset + entry->stringLength > storage_limit )
{
- /* invalid entry - ignore it */
- entry->stringOffset = 0;
- entry->stringLength = 0;
+ /* invalid entry; ignore it */
continue;
}
+ /* assure that we have a valid language tag ID, and */
+ /* that the corresponding langTag entry is valid, too */
+ if ( table->format == 1 && entry->languageID >= 0x8000U )
+ {
+ if ( entry->languageID - 0x8000U >= table->numLangTagRecords ||
+ !table->langTags[entry->languageID - 0x8000U].stringLength )
+ {
+ /* invalid entry; ignore it */
+ continue;
+ }
+ }
+
entry++;
}
- table->numNameRecords = (FT_UInt)( entry - table->names );
+ /* reduce array size to the actually used elements */
+ count = (FT_UInt)( entry - table->names );
+ (void)FT_RENEW_ARRAY( table->names,
+ table->numNameRecords,
+ count );
+ table->numNameRecords = count;
}
FT_FRAME_EXIT();
/* everything went well, update face->num_names */
- face->num_names = (FT_UShort) table->numNameRecords;
+ face->num_names = (FT_UShort)table->numNameRecords;
Exit:
return error;
@@ -931,7 +984,7 @@
/*************************************************************************/
/* */
/* <Function> */
- /* tt_face_free_names */
+ /* tt_face_free_name */
/* */
/* <Description> */
/* Frees the name records. */
@@ -944,25 +997,36 @@
{
FT_Memory memory = face->root.driver->root.memory;
TT_NameTable table = &face->name_table;
- TT_NameEntry entry = table->names;
- FT_UInt count = table->numNameRecords;
if ( table->names )
{
- for ( ; count > 0; count--, entry++ )
- {
+ TT_Name entry = table->names;
+ TT_Name limit = entry + table->numNameRecords;
+
+
+ for ( ; entry < limit; entry++ )
FT_FREE( entry->string );
- entry->stringLength = 0;
- }
- /* free strings table */
FT_FREE( table->names );
}
- table->numNameRecords = 0;
- table->format = 0;
- table->storageOffset = 0;
+ if ( table->langTags )
+ {
+ TT_LangTag entry = table->langTags;
+ TT_LangTag limit = entry + table->numLangTagRecords;
+
+
+ for ( ; entry < limit; entry++ )
+ FT_FREE( entry->string );
+
+ FT_FREE( table->langTags );
+ }
+
+ table->numNameRecords = 0;
+ table->numLangTagRecords = 0;
+ table->format = 0;
+ table->storageOffset = 0;
}
@@ -1193,8 +1257,8 @@
#define FT_STRUCTURE TT_Postscript
FT_FRAME_START( 32 ),
- FT_FRAME_ULONG( FormatType ),
- FT_FRAME_ULONG( italicAngle ),
+ FT_FRAME_LONG ( FormatType ),
+ FT_FRAME_LONG ( italicAngle ),
FT_FRAME_SHORT( underlinePosition ),
FT_FRAME_SHORT( underlineThickness ),
FT_FRAME_ULONG( isFixedPitch ),
diff --git a/thirdparty/freetype/src/sfnt/ttload.h b/thirdparty/freetype/src/sfnt/ttload.h
index bec42b94b4..296da86ed3 100644
--- a/thirdparty/freetype/src/sfnt/ttload.h
+++ b/thirdparty/freetype/src/sfnt/ttload.h
@@ -5,7 +5,7 @@
/* Load the basic TrueType tables, i.e., tables that can be either in */
/* TTF or OTF fonts (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttmtx.c b/thirdparty/freetype/src/sfnt/ttmtx.c
index 186f873dae..394c6db85c 100644
--- a/thirdparty/freetype/src/sfnt/ttmtx.c
+++ b/thirdparty/freetype/src/sfnt/ttmtx.c
@@ -4,7 +4,7 @@
/* */
/* Load the metrics tables common to TTF and OTF fonts (body). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,11 +20,24 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_TRUETYPE_TAGS_H
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include FT_SERVICE_METRICS_VARIATIONS_H
+#endif
+
#include "ttmtx.h"
#include "sferrors.h"
+ /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
+ /* be identical except for the names of their fields, */
+ /* which are different. */
+ /* */
+ /* This ensures that `tt_face_load_hmtx' is able to read */
+ /* both the horizontal and vertical headers. */
+
+
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
@@ -214,6 +227,11 @@
FT_ULong table_pos, table_size, table_end;
FT_UShort k;
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ FT_Service_MetricsVariations var =
+ (FT_Service_MetricsVariations)face->var;
+#endif
+
if ( vertical )
{
@@ -274,6 +292,34 @@
*abearing = 0;
*aadvance = 0;
}
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ if ( var )
+ {
+ FT_Face f = FT_FACE( face );
+ FT_Int a = (FT_Int)*aadvance;
+ FT_Int b = (FT_Int)*abearing;
+
+
+ if ( vertical )
+ {
+ if ( var->vadvance_adjust )
+ var->vadvance_adjust( f, gindex, &a );
+ if ( var->tsb_adjust )
+ var->tsb_adjust( f, gindex, &b );
+ }
+ else
+ {
+ if ( var->hadvance_adjust )
+ var->hadvance_adjust( f, gindex, &a );
+ if ( var->lsb_adjust )
+ var->lsb_adjust( f, gindex, &b );
+ }
+
+ *aadvance = (FT_UShort)a;
+ *abearing = (FT_Short)b;
+ }
+#endif
}
diff --git a/thirdparty/freetype/src/sfnt/ttmtx.h b/thirdparty/freetype/src/sfnt/ttmtx.h
index 78395def33..2b93ab2f0e 100644
--- a/thirdparty/freetype/src/sfnt/ttmtx.h
+++ b/thirdparty/freetype/src/sfnt/ttmtx.h
@@ -4,7 +4,7 @@
/* */
/* Load the metrics tables common to TTF and OTF fonts (specification). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttpost.c b/thirdparty/freetype/src/sfnt/ttpost.c
index 3277f1ec4f..540d5f2546 100644
--- a/thirdparty/freetype/src/sfnt/ttpost.c
+++ b/thirdparty/freetype/src/sfnt/ttpost.c
@@ -5,7 +5,7 @@
/* PostScript name table processing for TrueType and OpenType fonts */
/* (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -29,6 +29,10 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_TRUETYPE_TAGS_H
+
+
+#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
+
#include "ttpost.h"
#include "sferrors.h"
@@ -326,7 +330,9 @@
goto Exit;
/* check the number of glyphs */
- if ( num_glyphs > face->max_profile.numGlyphs || num_glyphs > 258 )
+ if ( num_glyphs > face->max_profile.numGlyphs ||
+ num_glyphs > 258 ||
+ num_glyphs < 1 )
{
error = FT_THROW( Invalid_File_Format );
goto Exit;
@@ -559,5 +565,12 @@
return FT_Err_Ok;
}
+#else /* !TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _tt_post_dummy;
+
+#endif /* !TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
+
/* END */
diff --git a/thirdparty/freetype/src/sfnt/ttpost.h b/thirdparty/freetype/src/sfnt/ttpost.h
index ede45fd84c..722485e32d 100644
--- a/thirdparty/freetype/src/sfnt/ttpost.h
+++ b/thirdparty/freetype/src/sfnt/ttpost.h
@@ -5,7 +5,7 @@
/* PostScript name table processing for TrueType and OpenType fonts */
/* (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttsbit.c b/thirdparty/freetype/src/sfnt/ttsbit.c
index e24e7d6cdd..0c76a55779 100644
--- a/thirdparty/freetype/src/sfnt/ttsbit.c
+++ b/thirdparty/freetype/src/sfnt/ttsbit.c
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded bitmap support (body). */
/* */
-/* Copyright 2005-2016 by */
+/* Copyright 2005-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Copyright 2013 by Google, Inc. */
@@ -24,6 +24,10 @@
#include FT_INTERNAL_STREAM_H
#include FT_TRUETYPE_TAGS_H
#include FT_BITMAP_H
+
+
+#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+
#include "ttsbit.h"
#include "sferrors.h"
@@ -48,6 +52,7 @@
{
FT_Error error;
FT_ULong table_size;
+ FT_ULong table_start;
face->sbit_table = NULL;
@@ -83,6 +88,8 @@
goto Exit;
}
+ table_start = FT_STREAM_POS();
+
switch ( (FT_UInt)face->sbit_table_type )
{
case TT_SBIT_TABLE_TYPE_EBLC:
@@ -104,8 +111,12 @@
version = FT_NEXT_LONG( p );
num_strikes = FT_NEXT_ULONG( p );
+ /* there's at least one font (FZShuSong-Z01, version 3) */
+ /* that uses the wrong byte order for the `version' field */
if ( ( (FT_ULong)version & 0xFFFF0000UL ) != 0x00020000UL &&
- ( (FT_ULong)version & 0xFFFF0000UL ) != 0x00030000UL )
+ ( (FT_ULong)version & 0x0000FFFFUL ) != 0x00000200UL &&
+ ( (FT_ULong)version & 0xFFFF0000UL ) != 0x00030000UL &&
+ ( (FT_ULong)version & 0x0000FFFFUL ) != 0x00000300UL )
{
error = FT_THROW( Unknown_File_Format );
goto Exit;
@@ -190,12 +201,51 @@
break;
default:
+ /* we ignore unknown table formats */
error = FT_THROW( Unknown_File_Format );
break;
}
if ( !error )
- FT_TRACE3(( "sbit_num_strikes: %u\n", face->sbit_num_strikes ));
+ FT_TRACE3(( "tt_face_load_sbit_strikes: found %u strikes\n",
+ face->sbit_num_strikes ));
+
+ face->ebdt_start = 0;
+ face->ebdt_size = 0;
+
+ if ( face->sbit_table_type == TT_SBIT_TABLE_TYPE_SBIX )
+ {
+ /* the `sbix' table is self-contained; */
+ /* it has no associated data table */
+ face->ebdt_start = table_start;
+ face->ebdt_size = table_size;
+ }
+ else if ( face->sbit_table_type != TT_SBIT_TABLE_TYPE_NONE )
+ {
+ FT_ULong ebdt_size;
+
+
+ error = face->goto_table( face, TTAG_CBDT, stream, &ebdt_size );
+ if ( error )
+ error = face->goto_table( face, TTAG_EBDT, stream, &ebdt_size );
+ if ( error )
+ error = face->goto_table( face, TTAG_bdat, stream, &ebdt_size );
+
+ if ( !error )
+ {
+ face->ebdt_start = FT_STREAM_POS();
+ face->ebdt_size = ebdt_size;
+ }
+ }
+
+ if ( !face->ebdt_size )
+ {
+ FT_TRACE2(( "tt_face_load_sbit_strikes:"
+ " no embedded bitmap data table found;\n"
+ " "
+ " resetting number of strikes to zero\n" ));
+ face->sbit_num_strikes = 0;
+ }
return FT_Err_Ok;
@@ -239,8 +289,22 @@
FT_ULong strike_index,
FT_Size_Metrics* metrics )
{
- if ( strike_index >= (FT_ULong)face->sbit_num_strikes )
- return FT_THROW( Invalid_Argument );
+ /* we have to test for the existence of `sbit_strike_map' */
+ /* because the function gets also used at the very beginning */
+ /* to construct `sbit_strike_map' itself */
+ if ( face->sbit_strike_map )
+ {
+ if ( strike_index >= (FT_ULong)face->root.num_fixed_sizes )
+ return FT_THROW( Invalid_Argument );
+
+ /* map to real index */
+ strike_index = face->sbit_strike_map[strike_index];
+ }
+ else
+ {
+ if ( strike_index >= (FT_ULong)face->sbit_num_strikes )
+ return FT_THROW( Invalid_Argument );
+ }
switch ( (FT_UInt)face->sbit_table_type )
{
@@ -284,7 +348,8 @@
FT_TRACE2(( "tt_face_load_strike_metrics:"
" sanitizing invalid ascender and descender\n"
" "
- " values for strike (%d, %d)\n",
+ " values for strike %d (%dppem, %dppem)\n",
+ strike_index,
metrics->x_ppem, metrics->y_ppem ));
/* sanitize buggy ascender and descender values */
@@ -323,6 +388,16 @@
strike[18] + /* max_width */
(FT_Char)strike[23] /* min_advance_SB */
) * 64;
+
+ /* set the scale values (in 16.16 units) so advances */
+ /* from the hmtx and vmtx table are scaled correctly */
+ metrics->x_scale = FT_MulDiv( metrics->x_ppem,
+ 64 * 0x10000,
+ face->header.Units_Per_EM );
+ metrics->y_scale = FT_MulDiv( metrics->y_ppem,
+ 64 * 0x10000,
+ face->header.Units_Per_EM );
+
return FT_Err_Ok;
}
@@ -332,7 +407,6 @@
FT_UInt offset;
FT_UShort upem, ppem, resolution;
TT_HoriHeader *hori;
- FT_ULong table_size;
FT_Pos ppem_; /* to reduce casts */
FT_Error error;
@@ -342,15 +416,11 @@
p = face->sbit_table + 8 + 4 * strike_index;
offset = FT_NEXT_ULONG( p );
- error = face->goto_table( face, TTAG_sbix, stream, &table_size );
- if ( error )
- return error;
-
- if ( offset + 4 > table_size )
+ if ( offset + 4 > face->ebdt_size )
return FT_THROW( Invalid_File_Format );
- if ( FT_STREAM_SEEK( FT_STREAM_POS() + offset ) ||
- FT_FRAME_ENTER( 4 ) )
+ if ( FT_STREAM_SEEK( face->ebdt_start + offset ) ||
+ FT_FRAME_ENTER( 4 ) )
return error;
ppem = FT_GET_USHORT();
@@ -414,17 +484,15 @@
FT_ULong strike_index,
TT_SBit_MetricsRec* metrics )
{
- FT_Error error;
+ FT_Error error = FT_ERR( Table_Missing );
FT_Stream stream = face->root.stream;
- FT_ULong ebdt_size;
- error = face->goto_table( face, TTAG_CBDT, stream, &ebdt_size );
- if ( error )
- error = face->goto_table( face, TTAG_EBDT, stream, &ebdt_size );
- if ( error )
- error = face->goto_table( face, TTAG_bdat, stream, &ebdt_size );
- if ( error )
+ strike_index = face->sbit_strike_map[strike_index];
+
+ if ( !face->ebdt_size )
+ goto Exit;
+ if ( FT_STREAM_SEEK( face->ebdt_start ) )
goto Exit;
decoder->face = face;
@@ -435,8 +503,8 @@
decoder->metrics_loaded = 0;
decoder->bitmap_allocated = 0;
- decoder->ebdt_start = FT_STREAM_POS();
- decoder->ebdt_size = ebdt_size;
+ decoder->ebdt_start = face->ebdt_start;
+ decoder->ebdt_size = face->ebdt_size;
decoder->eblc_base = face->sbit_table;
decoder->eblc_limit = face->sbit_table + face->sbit_table_size;
@@ -481,7 +549,8 @@
static FT_Error
- tt_sbit_decoder_alloc_bitmap( TT_SBitDecoder decoder )
+ tt_sbit_decoder_alloc_bitmap( TT_SBitDecoder decoder,
+ FT_Bool metrics_only )
{
FT_Error error = FT_Err_Ok;
FT_UInt width, height;
@@ -544,6 +613,9 @@
if ( size == 0 )
goto Exit; /* exit successfully! */
+ if ( metrics_only )
+ goto Exit; /* only metrics are requested */
+
error = ft_glyphslot_alloc_bitmap( decoder->face->root.glyph, size );
if ( error )
goto Exit;
@@ -610,7 +682,8 @@
FT_UInt glyph_index,
FT_Int x_pos,
FT_Int y_pos,
- FT_UInt recurse_count );
+ FT_UInt recurse_count,
+ FT_Bool metrics_only );
typedef FT_Error (*TT_SBitDecoder_LoadFunc)(
TT_SBitDecoder decoder,
@@ -854,7 +927,7 @@
}
*pwrite++ |= ( ( rval >> nbits ) & 0xFF ) &
- ( ~( 0xFF << w ) << ( 8 - w - x_pos ) );
+ ( ~( 0xFFU << w ) << ( 8 - w - x_pos ) );
rval <<= 8;
w = line_bits - w;
@@ -940,7 +1013,9 @@
gindex,
x_pos + dx,
y_pos + dy,
- recurse_count + 1 );
+ recurse_count + 1,
+ /* request full bitmap image */
+ FALSE );
if ( error )
break;
}
@@ -1004,6 +1079,7 @@
decoder->stream->memory,
p,
png_len,
+ FALSE,
FALSE );
Exit:
@@ -1022,7 +1098,8 @@
FT_ULong glyph_size,
FT_Int x_pos,
FT_Int y_pos,
- FT_UInt recurse_count )
+ FT_UInt recurse_count,
+ FT_Bool metrics_only )
{
FT_Error error;
FT_Stream stream = decoder->stream;
@@ -1144,11 +1221,15 @@
if ( !decoder->bitmap_allocated )
{
- error = tt_sbit_decoder_alloc_bitmap( decoder );
+ error = tt_sbit_decoder_alloc_bitmap( decoder, metrics_only );
+
if ( error )
goto Fail;
}
+ if ( metrics_only )
+ goto Fail; /* this is not an error */
+
error = loader( decoder, p, p_limit, x_pos, y_pos, recurse_count );
}
@@ -1165,7 +1246,8 @@
FT_UInt glyph_index,
FT_Int x_pos,
FT_Int y_pos,
- FT_UInt recurse_count )
+ FT_UInt recurse_count,
+ FT_Bool metrics_only )
{
FT_Byte* p = decoder->eblc_base + decoder->strike_index_array;
FT_Byte* p_limit = decoder->eblc_limit;
@@ -1350,7 +1432,8 @@
image_end,
x_pos,
y_pos,
- recurse_count );
+ recurse_count,
+ metrics_only );
Failure:
return FT_THROW( Invalid_Table );
@@ -1369,10 +1452,10 @@
FT_UInt glyph_index,
FT_Stream stream,
FT_Bitmap *map,
- TT_SBit_MetricsRec *metrics )
+ TT_SBit_MetricsRec *metrics,
+ FT_Bool metrics_only )
{
- FT_UInt sbix_pos, strike_offset, glyph_start, glyph_end;
- FT_ULong table_size;
+ FT_UInt strike_offset, glyph_start, glyph_end;
FT_Int originOffsetX, originOffsetY;
FT_Tag graphicType;
FT_Int recurse_depth = 0;
@@ -1381,7 +1464,12 @@
FT_Byte* p;
FT_UNUSED( map );
+#ifndef FT_CONFIG_OPTION_USE_PNG
+ FT_UNUSED( metrics_only );
+#endif
+
+ strike_index = face->sbit_strike_map[strike_index];
metrics->width = 0;
metrics->height = 0;
@@ -1389,21 +1477,18 @@
p = face->sbit_table + 8 + 4 * strike_index;
strike_offset = FT_NEXT_ULONG( p );
- error = face->goto_table( face, TTAG_sbix, stream, &table_size );
- if ( error )
- return error;
- sbix_pos = FT_STREAM_POS();
-
retry:
if ( glyph_index > (FT_UInt)face->root.num_glyphs )
return FT_THROW( Invalid_Argument );
- if ( strike_offset >= table_size ||
- table_size - strike_offset < 4 + glyph_index * 4 + 8 )
+ if ( strike_offset >= face->ebdt_size ||
+ face->ebdt_size - strike_offset < 4 + glyph_index * 4 + 8 )
return FT_THROW( Invalid_File_Format );
- if ( FT_STREAM_SEEK( sbix_pos + strike_offset + 4 + glyph_index * 4 ) ||
- FT_FRAME_ENTER( 8 ) )
+ if ( FT_STREAM_SEEK( face->ebdt_start +
+ strike_offset + 4 +
+ glyph_index * 4 ) ||
+ FT_FRAME_ENTER( 8 ) )
return error;
glyph_start = FT_GET_ULONG();
@@ -1413,13 +1498,13 @@
if ( glyph_start == glyph_end )
return FT_THROW( Invalid_Argument );
- if ( glyph_start > glyph_end ||
- glyph_end - glyph_start < 8 ||
- table_size - strike_offset < glyph_end )
+ if ( glyph_start > glyph_end ||
+ glyph_end - glyph_start < 8 ||
+ face->ebdt_size - strike_offset < glyph_end )
return FT_THROW( Invalid_File_Format );
- if ( FT_STREAM_SEEK( sbix_pos + strike_offset + glyph_start ) ||
- FT_FRAME_ENTER( glyph_end - glyph_start ) )
+ if ( FT_STREAM_SEEK( face->ebdt_start + strike_offset + glyph_start ) ||
+ FT_FRAME_ENTER( glyph_end - glyph_start ) )
return error;
originOffsetX = FT_GET_SHORT();
@@ -1450,7 +1535,8 @@
stream->memory,
stream->cursor,
glyph_end - glyph_start - 8,
- TRUE );
+ TRUE,
+ metrics_only );
#else
error = FT_THROW( Unimplemented_Feature );
#endif
@@ -1510,23 +1596,27 @@
error = tt_sbit_decoder_init( decoder, face, strike_index, metrics );
if ( !error )
{
- error = tt_sbit_decoder_load_image( decoder,
- glyph_index,
- 0,
- 0,
- 0 );
+ error = tt_sbit_decoder_load_image(
+ decoder,
+ glyph_index,
+ 0,
+ 0,
+ 0,
+ ( load_flags & FT_LOAD_BITMAP_METRICS_ONLY ) != 0 );
tt_sbit_decoder_done( decoder );
}
}
break;
case TT_SBIT_TABLE_TYPE_SBIX:
- error = tt_face_load_sbix_image( face,
- strike_index,
- glyph_index,
- stream,
- map,
- metrics );
+ error = tt_face_load_sbix_image(
+ face,
+ strike_index,
+ glyph_index,
+ stream,
+ map,
+ metrics,
+ ( load_flags & FT_LOAD_BITMAP_METRICS_ONLY ) != 0 );
break;
default:
@@ -1535,9 +1625,10 @@
}
/* Flatten color bitmaps if color was not requested. */
- if ( !error &&
- !( load_flags & FT_LOAD_COLOR ) &&
- map->pixel_mode == FT_PIXEL_MODE_BGRA )
+ if ( !error &&
+ !( load_flags & FT_LOAD_COLOR ) &&
+ !( load_flags & FT_LOAD_BITMAP_METRICS_ONLY ) &&
+ map->pixel_mode == FT_PIXEL_MODE_BGRA )
{
FT_Bitmap new_map;
FT_Library library = face->root.glyph->library;
@@ -1563,5 +1654,12 @@
return error;
}
+#else /* !TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _tt_sbit_dummy;
+
+#endif /* !TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
+
-/* EOF */
+/* END */
diff --git a/thirdparty/freetype/src/sfnt/ttsbit.h b/thirdparty/freetype/src/sfnt/ttsbit.h
index d8a8167083..e859ddda45 100644
--- a/thirdparty/freetype/src/sfnt/ttsbit.h
+++ b/thirdparty/freetype/src/sfnt/ttsbit.h
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded bitmap support (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/smooth/ftgrays.c b/thirdparty/freetype/src/smooth/ftgrays.c
index 0bf3ac6ffb..e9a3ce7a7c 100644
--- a/thirdparty/freetype/src/smooth/ftgrays.c
+++ b/thirdparty/freetype/src/smooth/ftgrays.c
@@ -4,7 +4,7 @@
/* */
/* A new `perfect' anti-aliasing renderer (body). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -286,6 +286,10 @@ typedef ptrdiff_t FT_PtrDist;
#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count )
#endif
+#ifndef FT_ZERO
+#define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) )
+#endif
+
/* as usual, for the speed hungry :-) */
#undef RAS_ARG
@@ -337,7 +341,8 @@ typedef ptrdiff_t FT_PtrDist;
/* Compute `dividend / divisor' and return both its quotient and */
/* remainder, cast to a specific type. This macro also ensures that */
- /* the remainder is always positive. */
+ /* the remainder is always positive. We use the remainder to keep */
+ /* track of accumulating errors and compensate for them. */
#define FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \
FT_BEGIN_STMNT \
(quotient) = (type)( (dividend) / (divisor) ); \
@@ -371,8 +376,9 @@ typedef ptrdiff_t FT_PtrDist;
/* These macros speed up repetitive divisions by replacing them */
/* with multiplications and right shifts. */
-#define FT_UDIVPREP( b ) \
- long b ## _r = (long)( FT_ULONG_MAX >> PIXEL_BITS ) / ( b )
+#define FT_UDIVPREP( c, b ) \
+ long b ## _r = c ? (long)( FT_ULONG_MAX >> PIXEL_BITS ) / ( b ) \
+ : 0
#define FT_UDIV( a, b ) \
( ( (unsigned long)( a ) * (unsigned long)( b ## _r ) ) >> \
( sizeof( long ) * FT_CHAR_BIT - PIXEL_BITS ) )
@@ -403,9 +409,12 @@ typedef ptrdiff_t FT_PtrDist;
} TCell;
+ typedef struct TPixmap_
+ {
+ unsigned char* origin; /* pixmap origin at the bottom-left */
+ int pitch; /* pitch to go down one row */
- /* maximum number of gray spans in a call to the span callback */
-#define FT_MAX_GRAY_SPANS 32
+ } TPixmap;
/* maximum number of gray cells in the buffer */
#if FT_RENDER_POOL_SIZE > 2048
@@ -430,12 +439,12 @@ typedef ptrdiff_t FT_PtrDist;
TCoord ex, ey;
TCoord min_ex, max_ex;
TCoord min_ey, max_ey;
- TCoord count_ex, count_ey;
TArea area;
TCoord cover;
int invalid;
+ PCell* ycells;
PCell cells;
FT_PtrDist max_cells;
FT_PtrDist num_cells;
@@ -443,16 +452,10 @@ typedef ptrdiff_t FT_PtrDist;
TPos x, y;
FT_Outline outline;
- FT_Bitmap target;
-
- FT_Span gray_spans[FT_MAX_GRAY_SPANS];
- int num_gray_spans;
+ TPixmap target;
FT_Raster_Span_Func render_span;
void* render_span_data;
- int span_y;
-
- PCell* ycells;
} gray_TWorker, *gray_PWorker;
@@ -482,17 +485,17 @@ typedef ptrdiff_t FT_PtrDist;
static void
gray_dump_cells( RAS_ARG )
{
- int yindex;
+ int y;
- for ( yindex = 0; yindex < ras.count_ey; yindex++ )
+ for ( y = ras.min_ey; y < ras.max_ey; y++ )
{
- PCell cell;
+ PCell cell = ras.ycells[y - ras.min_ey];
- printf( "%3d:", yindex );
+ printf( "%3d:", y );
- for ( cell = ras.ycells[yindex]; cell != NULL; cell = cell->next )
+ for ( ; cell != NULL; cell = cell->next )
printf( " (%3d, c:%4d, a:%6d)",
cell->x, cell->cover, cell->area );
printf( "\n" );
@@ -506,25 +509,22 @@ typedef ptrdiff_t FT_PtrDist;
/* */
/* Record the current cell in the table. */
/* */
- static PCell
- gray_find_cell( RAS_ARG )
+ static void
+ gray_record_cell( RAS_ARG )
{
PCell *pcell, cell;
TCoord x = ras.ex;
- if ( x > ras.count_ex )
- x = ras.count_ex;
-
- pcell = &ras.ycells[ras.ey];
+ pcell = &ras.ycells[ras.ey - ras.min_ey];
for (;;)
{
cell = *pcell;
- if ( cell == NULL || cell->x > x )
+ if ( !cell || cell->x > x )
break;
if ( cell->x == x )
- goto Exit;
+ goto Found;
pcell = &cell->next;
}
@@ -532,30 +532,21 @@ typedef ptrdiff_t FT_PtrDist;
if ( ras.num_cells >= ras.max_cells )
ft_longjmp( ras.jump_buffer, 1 );
+ /* insert new cell */
cell = ras.cells + ras.num_cells++;
cell->x = x;
- cell->area = 0;
- cell->cover = 0;
+ cell->area = ras.area;
+ cell->cover = ras.cover;
cell->next = *pcell;
*pcell = cell;
- Exit:
- return cell;
- }
-
+ return;
- static void
- gray_record_cell( RAS_ARG )
- {
- if ( ras.area | ras.cover )
- {
- PCell cell = gray_find_cell( RAS_VAR );
-
-
- cell->area += ras.area;
- cell->cover += ras.cover;
- }
+ Found:
+ /* update old cell */
+ cell->area += ras.area;
+ cell->cover += ras.cover;
}
@@ -577,58 +568,23 @@ typedef ptrdiff_t FT_PtrDist;
/* Note that if a cell is to the left of the clipping region, it is */
/* actually set to the (min_ex-1) horizontal position. */
- /* All cells that are on the left of the clipping region go to the */
- /* min_ex - 1 horizontal position. */
- ey -= ras.min_ey;
-
- if ( ex > ras.max_ex )
- ex = ras.max_ex;
-
- ex -= ras.min_ex;
- if ( ex < 0 )
- ex = -1;
-
- /* are we moving to a different cell ? */
- if ( ex != ras.ex || ey != ras.ey )
- {
- /* record the current one if it is valid */
- if ( !ras.invalid )
- gray_record_cell( RAS_VAR );
-
- ras.area = 0;
- ras.cover = 0;
- ras.ex = ex;
- ras.ey = ey;
- }
-
- ras.invalid = ( (unsigned int)ey >= (unsigned int)ras.count_ey ||
- ex >= ras.count_ex );
- }
-
-
- /*************************************************************************/
- /* */
- /* Start a new contour at a given cell. */
- /* */
- static void
- gray_start_cell( RAS_ARG_ TCoord ex,
- TCoord ey )
- {
- if ( ex > ras.max_ex )
- ex = ras.max_ex;
-
if ( ex < ras.min_ex )
ex = ras.min_ex - 1;
- ras.area = 0;
- ras.cover = 0;
- ras.ex = ex - ras.min_ex;
- ras.ey = ey - ras.min_ey;
- ras.invalid = 0;
+ /* record the current one if it is valid */
+ if ( !ras.invalid )
+ gray_record_cell( RAS_VAR );
+
+ ras.area = 0;
+ ras.cover = 0;
+ ras.ex = ex;
+ ras.ey = ey;
- gray_set_cell( RAS_VAR_ ex, ey );
+ ras.invalid = ( ey >= ras.max_ey || ey < ras.min_ey ||
+ ex >= ras.max_ex );
}
+
#ifndef FT_LONG64
/*************************************************************************/
@@ -642,7 +598,7 @@ typedef ptrdiff_t FT_PtrDist;
TPos x2,
TCoord y2 )
{
- TCoord ex1, ex2, fx1, fx2, first, delta, mod;
+ TCoord ex1, ex2, fx1, fx2, first, dy, delta, mod;
TPos p, dx;
int incr;
@@ -657,30 +613,29 @@ typedef ptrdiff_t FT_PtrDist;
return;
}
- fx1 = (TCoord)( x1 - SUBPIXELS( ex1 ) );
- fx2 = (TCoord)( x2 - SUBPIXELS( ex2 ) );
+ fx1 = (TCoord)( x1 - SUBPIXELS( ex1 ) );
+ fx2 = (TCoord)( x2 - SUBPIXELS( ex2 ) );
/* everything is located in a single cell. That is easy! */
/* */
if ( ex1 == ex2 )
- {
- delta = y2 - y1;
- ras.area += (TArea)(( fx1 + fx2 ) * delta);
- ras.cover += delta;
- return;
- }
+ goto End;
/* ok, we'll have to render a run of adjacent cells on the same */
/* scanline... */
/* */
- p = ( ONE_PIXEL - fx1 ) * ( y2 - y1 );
- first = ONE_PIXEL;
- incr = 1;
- dx = x2 - x1;
+ dx = x2 - x1;
+ dy = y2 - y1;
- if ( dx < 0 )
+ if ( dx > 0 )
{
- p = fx1 * ( y2 - y1 );
+ p = ( ONE_PIXEL - fx1 ) * dy;
+ first = ONE_PIXEL;
+ incr = 1;
+ }
+ else
+ {
+ p = fx1 * dy;
first = 0;
incr = -1;
dx = -dx;
@@ -688,34 +643,31 @@ typedef ptrdiff_t FT_PtrDist;
FT_DIV_MOD( TCoord, p, dx, delta, mod );
- ras.area += (TArea)(( fx1 + first ) * delta);
+ ras.area += (TArea)( ( fx1 + first ) * delta );
ras.cover += delta;
-
- ex1 += incr;
+ y1 += delta;
+ ex1 += incr;
gray_set_cell( RAS_VAR_ ex1, ey );
- y1 += delta;
if ( ex1 != ex2 )
{
TCoord lift, rem;
- p = ONE_PIXEL * ( y2 - y1 + delta );
+ p = ONE_PIXEL * dy;
FT_DIV_MOD( TCoord, p, dx, lift, rem );
- mod -= (int)dx;
-
do
{
delta = lift;
mod += rem;
- if ( mod >= 0 )
+ if ( mod >= (TCoord)dx )
{
mod -= (TCoord)dx;
delta++;
}
- ras.area += (TArea)(ONE_PIXEL * delta);
+ ras.area += (TArea)( ONE_PIXEL * delta );
ras.cover += delta;
y1 += delta;
ex1 += incr;
@@ -723,9 +675,13 @@ typedef ptrdiff_t FT_PtrDist;
} while ( ex1 != ex2 );
}
- delta = y2 - y1;
- ras.area += (TArea)(( fx2 + ONE_PIXEL - first ) * delta);
- ras.cover += delta;
+ fx1 = ONE_PIXEL - first;
+
+ End:
+ dy = y2 - y1;
+
+ ras.area += (TArea)( ( fx1 + fx2 ) * dy );
+ ras.cover += dy;
}
@@ -764,8 +720,6 @@ typedef ptrdiff_t FT_PtrDist;
dy = to_y - ras.y;
/* vertical line - avoid calling gray_render_scanline */
- incr = 1;
-
if ( dx == 0 )
{
TCoord ex = TRUNC( ras.x );
@@ -773,8 +727,12 @@ typedef ptrdiff_t FT_PtrDist;
TArea area;
- first = ONE_PIXEL;
- if ( dy < 0 )
+ if ( dy > 0)
+ {
+ first = ONE_PIXEL;
+ incr = 1;
+ }
+ else
{
first = 0;
incr = -1;
@@ -806,11 +764,13 @@ typedef ptrdiff_t FT_PtrDist;
}
/* ok, we have to render several scanlines */
- p = ( ONE_PIXEL - fy1 ) * dx;
- first = ONE_PIXEL;
- incr = 1;
-
- if ( dy < 0 )
+ if ( dy > 0)
+ {
+ p = ( ONE_PIXEL - fy1 ) * dx;
+ first = ONE_PIXEL;
+ incr = 1;
+ }
+ else
{
p = fy1 * dx;
first = 0;
@@ -833,13 +793,12 @@ typedef ptrdiff_t FT_PtrDist;
p = ONE_PIXEL * dx;
FT_DIV_MOD( TCoord, p, dy, lift, rem );
- mod -= (TCoord)dy;
do
{
delta = lift;
mod += rem;
- if ( mod >= 0 )
+ if ( mod >= (TCoord)dy )
{
mod -= (TCoord)dy;
delta++;
@@ -929,8 +888,8 @@ typedef ptrdiff_t FT_PtrDist;
else /* any other line */
{
TPos prod = dx * fy1 - dy * fx1;
- FT_UDIVPREP( dx );
- FT_UDIVPREP( dy );
+ FT_UDIVPREP( ex1 != ex2, dx );
+ FT_UDIVPREP( ey1 != ey2, dy );
/* The fundamental value `prod' determines which side and the */
@@ -1218,15 +1177,11 @@ typedef ptrdiff_t FT_PtrDist;
TPos x, y;
- /* record current cell, if any */
- if ( !ras.invalid )
- gray_record_cell( RAS_VAR );
-
/* start to a new position */
x = UPSCALE( to->x );
y = UPSCALE( to->y );
- gray_start_cell( RAS_VAR_ TRUNC( x ), TRUNC( y ) );
+ gray_set_cell( RAS_VAR_ TRUNC( x ), TRUNC( y ) );
ras.x = x;
ras.y = y;
@@ -1265,79 +1220,23 @@ typedef ptrdiff_t FT_PtrDist;
static void
- gray_render_span( int y,
- int count,
- const FT_Span* spans,
- gray_PWorker worker )
- {
- unsigned char* p;
- FT_Bitmap* map = &worker->target;
-
-
- /* first of all, compute the scanline offset */
- p = (unsigned char*)map->buffer - y * map->pitch;
- if ( map->pitch >= 0 )
- p += ( map->rows - 1 ) * (unsigned int)map->pitch;
-
- for ( ; count > 0; count--, spans++ )
- {
- unsigned char coverage = spans->coverage;
-
-
- if ( coverage )
- {
- unsigned char* q = p + spans->x;
-
-
- /* For small-spans it is faster to do it by ourselves than
- * calling `memset'. This is mainly due to the cost of the
- * function call.
- */
- switch ( spans->len )
- {
- case 7: *q++ = coverage;
- case 6: *q++ = coverage;
- case 5: *q++ = coverage;
- case 4: *q++ = coverage;
- case 3: *q++ = coverage;
- case 2: *q++ = coverage;
- case 1: *q = coverage;
- case 0: break;
- default:
- FT_MEM_SET( q, coverage, spans->len );
- }
- }
- }
- }
-
-
- static void
gray_hline( RAS_ARG_ TCoord x,
TCoord y,
- TArea area,
+ TArea coverage,
TCoord acount )
{
- int coverage;
-
-
- /* compute the coverage line's coverage, depending on the */
- /* outline fill rule */
- /* */
- /* the coverage percentage is area/(PIXEL_BITS*PIXEL_BITS*2) */
- /* */
- coverage = (int)( area >> ( PIXEL_BITS * 2 + 1 - 8 ) );
- /* use range 0..256 */
+ /* scale the coverage from 0..(ONE_PIXEL*ONE_PIXEL*2) to 0..256 */
+ coverage >>= PIXEL_BITS * 2 + 1 - 8;
if ( coverage < 0 )
- coverage = -coverage;
+ coverage = -coverage - 1;
+ /* compute the line's coverage depending on the outline fill rule */
if ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL )
{
coverage &= 511;
- if ( coverage > 256 )
- coverage = 512 - coverage;
- else if ( coverage == 256 )
- coverage = 255;
+ if ( coverage >= 256 )
+ coverage = 511 - coverage;
}
else
{
@@ -1346,64 +1245,40 @@ typedef ptrdiff_t FT_PtrDist;
coverage = 255;
}
- y += ras.min_ey;
- x += ras.min_ex;
-
- if ( coverage )
+ if ( ras.render_span ) /* for FT_RASTER_FLAG_DIRECT only */
{
- FT_Span* span;
- int count;
-
-
- /* see whether we can add this span to the current list */
- count = ras.num_gray_spans;
- span = ras.gray_spans + count - 1;
- if ( span->coverage == coverage &&
- span->x + span->len == x &&
- ras.span_y == y &&
- count > 0 )
- {
- span->len = (unsigned short)( span->len + acount );
- return;
- }
-
- if ( ras.span_y != y || count >= FT_MAX_GRAY_SPANS )
- {
- if ( ras.render_span && count > 0 )
- ras.render_span( ras.span_y, count, ras.gray_spans,
- ras.render_span_data );
+ FT_Span span;
-#ifdef FT_DEBUG_LEVEL_TRACE
-
- if ( count > 0 )
- {
- int n;
+ span.x = (short)x;
+ span.len = (unsigned short)acount;
+ span.coverage = (unsigned char)coverage;
- FT_TRACE7(( "y = %3d ", ras.span_y ));
- span = ras.gray_spans;
- for ( n = 0; n < count; n++, span++ )
- FT_TRACE7(( "[%d..%d]:%02x ",
- span->x, span->x + span->len - 1, span->coverage ));
- FT_TRACE7(( "\n" ));
- }
-
-#endif /* FT_DEBUG_LEVEL_TRACE */
+ ras.render_span( y, 1, &span, ras.render_span_data );
+ }
+ else
+ {
+ unsigned char* q = ras.target.origin - ras.target.pitch * y + x;
+ unsigned char c = (unsigned char)coverage;
- ras.num_gray_spans = 0;
- ras.span_y = (int)y;
- span = ras.gray_spans;
+ /* For small-spans it is faster to do it by ourselves than
+ * calling `memset'. This is mainly due to the cost of the
+ * function call.
+ */
+ switch ( acount )
+ {
+ case 7: *q++ = c;
+ case 6: *q++ = c;
+ case 5: *q++ = c;
+ case 4: *q++ = c;
+ case 3: *q++ = c;
+ case 2: *q++ = c;
+ case 1: *q = c;
+ case 0: break;
+ default:
+ FT_MEM_SET( q, c, acount );
}
- else
- span++;
-
- /* add a gray span to the current list */
- span->x = (short)x;
- span->len = (unsigned short)acount;
- span->coverage = (unsigned char)coverage;
-
- ras.num_gray_spans++;
}
}
@@ -1411,71 +1286,38 @@ typedef ptrdiff_t FT_PtrDist;
static void
gray_sweep( RAS_ARG )
{
- int yindex;
+ int y;
- if ( ras.num_cells == 0 )
- return;
-
- ras.num_gray_spans = 0;
- ras.span_y = 0;
-
FT_TRACE7(( "gray_sweep: start\n" ));
- for ( yindex = 0; yindex < ras.count_ey; yindex++ )
+ for ( y = ras.min_ey; y < ras.max_ey; y++ )
{
- PCell cell = ras.ycells[yindex];
- TCoord cover = 0;
- TCoord x = 0;
+ PCell cell = ras.ycells[y - ras.min_ey];
+ TCoord x = ras.min_ex;
+ TArea cover = 0;
+ TArea area;
for ( ; cell != NULL; cell = cell->next )
{
- TArea area;
-
-
- if ( cell->x > x && cover != 0 )
- gray_hline( RAS_VAR_ x, yindex, (TArea)cover * ( ONE_PIXEL * 2 ),
- cell->x - x );
+ if ( cover != 0 && cell->x > x )
+ gray_hline( RAS_VAR_ x, y, cover, cell->x - x );
- cover += cell->cover;
- area = (TArea)cover * ( ONE_PIXEL * 2 ) - cell->area;
+ cover += (TArea)cell->cover * ( ONE_PIXEL * 2 );
+ area = cover - cell->area;
- if ( area != 0 && cell->x >= 0 )
- gray_hline( RAS_VAR_ cell->x, yindex, area, 1 );
+ if ( area != 0 && cell->x >= ras.min_ex )
+ gray_hline( RAS_VAR_ cell->x, y, area, 1 );
x = cell->x + 1;
}
if ( cover != 0 )
- gray_hline( RAS_VAR_ x, yindex, (TArea)cover * ( ONE_PIXEL * 2 ),
- ras.count_ex - x );
- }
-
- if ( ras.render_span && ras.num_gray_spans > 0 )
- ras.render_span( ras.span_y, ras.num_gray_spans,
- ras.gray_spans, ras.render_span_data );
-
-#ifdef FT_DEBUG_LEVEL_TRACE
-
- if ( ras.num_gray_spans > 0 )
- {
- FT_Span* span;
- int n;
-
-
- FT_TRACE7(( "y = %3d ", ras.span_y ));
- span = ras.gray_spans;
- for ( n = 0; n < ras.num_gray_spans; n++, span++ )
- FT_TRACE7(( "[%d..%d]:%02x ",
- span->x, span->x + span->len - 1, span->coverage ));
- FT_TRACE7(( "\n" ));
+ gray_hline( RAS_VAR_ x, y, cover, ras.max_ex - x );
}
FT_TRACE7(( "gray_sweep: end\n" ));
-
-#endif /* FT_DEBUG_LEVEL_TRACE */
-
}
@@ -1754,7 +1596,7 @@ typedef ptrdiff_t FT_PtrDist;
return 0;
Exit:
- FT_TRACE5(( "FT_Outline_Decompose: Error %d\n", error ));
+ FT_TRACE5(( "FT_Outline_Decompose: Error 0x%x\n", error ));
return error;
Invalid_Outline:
@@ -1839,22 +1681,17 @@ typedef ptrdiff_t FT_PtrDist;
#endif /* STANDALONE_ */
- typedef struct gray_TBand_
- {
- TCoord min, max;
-
- } gray_TBand;
-
-
FT_DEFINE_OUTLINE_FUNCS(
func_interface,
- (FT_Outline_MoveTo_Func) gray_move_to,
- (FT_Outline_LineTo_Func) gray_line_to,
- (FT_Outline_ConicTo_Func)gray_conic_to,
- (FT_Outline_CubicTo_Func)gray_cubic_to,
- 0,
- 0 )
+ (FT_Outline_MoveTo_Func) gray_move_to, /* move_to */
+ (FT_Outline_LineTo_Func) gray_line_to, /* line_to */
+ (FT_Outline_ConicTo_Func)gray_conic_to, /* conic_to */
+ (FT_Outline_CubicTo_Func)gray_cubic_to, /* cubic_to */
+
+ 0, /* shift */
+ 0 /* delta */
+ )
static int
@@ -1892,20 +1729,21 @@ typedef ptrdiff_t FT_PtrDist;
static int
gray_convert_glyph( RAS_ARG )
{
- TCell buffer[FT_MAX_GRAY_POOL];
- TCoord band_size = FT_MAX_GRAY_POOL / 8;
- int num_bands;
- TCoord min, max, max_y;
- gray_TBand bands[32]; /* enough to accommodate bisections */
- gray_TBand* band;
+ TCell buffer[FT_MAX_GRAY_POOL];
+ TCoord band_size = FT_MAX_GRAY_POOL / 8;
+ TCoord count = ras.max_ey - ras.min_ey;
+ int num_bands;
+ TCoord min, max, max_y;
+ TCoord bands[32]; /* enough to accommodate bisections */
+ TCoord* band;
/* set up vertical bands */
- if ( ras.count_ey > band_size )
+ if ( count > band_size )
{
/* two divisions rounded up */
- num_bands = (int)( ( ras.count_ey + band_size - 1) / band_size );
- band_size = ( ras.count_ey + num_bands - 1 ) / num_bands;
+ num_bands = (int)( ( count + band_size - 1) / band_size );
+ band_size = ( count + num_bands - 1 ) / num_bands;
}
min = ras.min_ey;
@@ -1917,41 +1755,37 @@ typedef ptrdiff_t FT_PtrDist;
if ( max > max_y )
max = max_y;
- bands[0].min = min;
- bands[0].max = max;
- band = bands;
+ band = bands;
+ band[1] = min;
+ band[0] = max;
do
{
- TCoord bottom, top, middle;
+ TCoord width = band[0] - band[1];
int error;
/* memory management */
{
- size_t ycount = (size_t)( band->max - band->min );
+ size_t ycount = (size_t)width;
size_t cell_start;
cell_start = ( ycount * sizeof ( PCell ) + sizeof ( TCell ) - 1 ) /
sizeof ( TCell );
- if ( FT_MAX_GRAY_POOL - cell_start < 2 )
- goto ReduceBands;
-
ras.cells = buffer + cell_start;
ras.max_cells = (FT_PtrDist)( FT_MAX_GRAY_POOL - cell_start );
+ ras.num_cells = 0;
ras.ycells = (PCell*)buffer;
while ( ycount )
ras.ycells[--ycount] = NULL;
}
- ras.num_cells = 0;
ras.invalid = 1;
- ras.min_ey = band->min;
- ras.max_ey = band->max;
- ras.count_ey = band->max - band->min;
+ ras.min_ey = band[1];
+ ras.max_ey = band[0];
error = gray_convert_glyph_inner( RAS_VAR );
@@ -1964,25 +1798,20 @@ typedef ptrdiff_t FT_PtrDist;
else if ( error != ErrRaster_Memory_Overflow )
return 1;
- ReduceBands:
/* render pool overflow; we will reduce the render band by half */
- bottom = band->min;
- top = band->max;
- middle = bottom + ( ( top - bottom ) >> 1 );
+ width >>= 1;
/* This is too complex for a single scanline; there must */
/* be some problems. */
- if ( middle == bottom )
+ if ( width == 0 )
{
FT_TRACE7(( "gray_convert_glyph: rotten glyph\n" ));
return 1;
}
- band[1].min = bottom;
- band[1].max = middle;
- band[0].min = middle;
- band[0].max = top;
band++;
+ band[1] = band[0];
+ band[0] += width;
} while ( band >= bands );
}
@@ -1994,16 +1823,22 @@ typedef ptrdiff_t FT_PtrDist;
gray_raster_render( FT_Raster raster,
const FT_Raster_Params* params )
{
- const FT_Outline* outline = (const FT_Outline*)params->source;
- const FT_Bitmap* target_map = params->target;
+ const FT_Outline* outline = (const FT_Outline*)params->source;
+ const FT_Bitmap* target_map = params->target;
FT_BBox cbox, clip;
+#ifndef FT_STATIC_RASTER
gray_TWorker worker[1];
+#endif
if ( !raster )
return FT_THROW( Invalid_Argument );
+ /* this version does not support monochrome rendering */
+ if ( !( params->flags & FT_RASTER_FLAG_AA ) )
+ return FT_THROW( Invalid_Mode );
+
if ( !outline )
return FT_THROW( Invalid_Outline );
@@ -2018,9 +1853,19 @@ typedef ptrdiff_t FT_PtrDist;
outline->contours[outline->n_contours - 1] + 1 )
return FT_THROW( Invalid_Outline );
- /* if direct mode is not set, we must have a target bitmap */
- if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )
+ ras.outline = *outline;
+
+ if ( params->flags & FT_RASTER_FLAG_DIRECT )
+ {
+ if ( !params->gray_spans )
+ return 0;
+
+ ras.render_span = (FT_Raster_Span_Func)params->gray_spans;
+ ras.render_span_data = params->user;
+ }
+ else
{
+ /* if direct mode is not set, we must have a target bitmap */
if ( !target_map )
return FT_THROW( Invalid_Argument );
@@ -2030,11 +1875,18 @@ typedef ptrdiff_t FT_PtrDist;
if ( !target_map->buffer )
return FT_THROW( Invalid_Argument );
- }
- /* this version does not support monochrome rendering */
- if ( !( params->flags & FT_RASTER_FLAG_AA ) )
- return FT_THROW( Invalid_Mode );
+ if ( target_map->pitch < 0 )
+ ras.target.origin = target_map->buffer;
+ else
+ ras.target.origin = target_map->buffer
+ + ( target_map->rows - 1 ) * (unsigned int)target_map->pitch;
+
+ ras.target.pitch = target_map->pitch;
+
+ ras.render_span = (FT_Raster_Span_Func)NULL;
+ ras.render_span_data = NULL;
+ }
FT_Outline_Get_CBox( outline, &cbox );
@@ -2077,23 +1929,6 @@ typedef ptrdiff_t FT_PtrDist;
if ( ras.max_ex <= ras.min_ex || ras.max_ey <= ras.min_ey )
return 0;
- ras.count_ex = ras.max_ex - ras.min_ex;
- ras.count_ey = ras.max_ey - ras.min_ey;
-
- ras.outline = *outline;
-
- if ( params->flags & FT_RASTER_FLAG_DIRECT )
- {
- ras.render_span = (FT_Raster_Span_Func)params->gray_spans;
- ras.render_span_data = params->user;
- }
- else
- {
- ras.target = *target_map;
- ras.render_span = (FT_Raster_Span_Func)gray_render_span;
- ras.render_span_data = &ras;
- }
-
return gray_convert_glyph( RAS_VAR );
}
@@ -2113,7 +1948,7 @@ typedef ptrdiff_t FT_PtrDist;
*araster = (FT_Raster)&the_raster;
- FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) );
+ FT_ZERO( &the_raster );
return 0;
}
@@ -2189,11 +2024,12 @@ typedef ptrdiff_t FT_PtrDist;
FT_GLYPH_FORMAT_OUTLINE,
- (FT_Raster_New_Func) gray_raster_new,
- (FT_Raster_Reset_Func) gray_raster_reset,
- (FT_Raster_Set_Mode_Func)gray_raster_set_mode,
- (FT_Raster_Render_Func) gray_raster_render,
- (FT_Raster_Done_Func) gray_raster_done )
+ (FT_Raster_New_Func) gray_raster_new, /* raster_new */
+ (FT_Raster_Reset_Func) gray_raster_reset, /* raster_reset */
+ (FT_Raster_Set_Mode_Func)gray_raster_set_mode, /* raster_set_mode */
+ (FT_Raster_Render_Func) gray_raster_render, /* raster_render */
+ (FT_Raster_Done_Func) gray_raster_done /* raster_done */
+ )
/* END */
diff --git a/thirdparty/freetype/src/smooth/ftgrays.h b/thirdparty/freetype/src/smooth/ftgrays.h
index 21c2badcaf..a5447da1a9 100644
--- a/thirdparty/freetype/src/smooth/ftgrays.h
+++ b/thirdparty/freetype/src/smooth/ftgrays.h
@@ -4,7 +4,7 @@
/* */
/* FreeType smooth renderer declaration */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/smooth/ftsmerrs.h b/thirdparty/freetype/src/smooth/ftsmerrs.h
index a759b91c17..a528c61832 100644
--- a/thirdparty/freetype/src/smooth/ftsmerrs.h
+++ b/thirdparty/freetype/src/smooth/ftsmerrs.h
@@ -4,7 +4,7 @@
/* */
/* smooth renderer error codes (specification only). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/smooth/ftsmooth.c b/thirdparty/freetype/src/smooth/ftsmooth.c
index 79276765b1..435854e673 100644
--- a/thirdparty/freetype/src/smooth/ftsmooth.c
+++ b/thirdparty/freetype/src/smooth/ftsmooth.c
@@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (body). */
/* */
-/* Copyright 2000-2016 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -87,7 +87,7 @@
FT_GlyphSlot slot,
FT_BBox* cbox )
{
- FT_MEM_ZERO( cbox, sizeof ( *cbox ) );
+ FT_ZERO( cbox );
if ( slot->format == render->glyph_format )
FT_Outline_Get_CBox( &slot->outline, cbox );
@@ -114,14 +114,68 @@
#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
FT_Pos height_org, width_org;
#endif
- FT_Int hmul = mode == FT_RENDER_MODE_LCD;
- FT_Int vmul = mode == FT_RENDER_MODE_LCD_V;
+ FT_Int hmul = ( mode == FT_RENDER_MODE_LCD );
+ FT_Int vmul = ( mode == FT_RENDER_MODE_LCD_V );
FT_Raster_Params params;
FT_Bool have_outline_shifted = FALSE;
FT_Bool have_buffer = FALSE;
+#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+
+ FT_Int lcd_extra = 0;
+ FT_LcdFiveTapFilter lcd_weights = { 0 };
+ FT_Bool have_custom_weight = FALSE;
+ FT_Bitmap_LcdFilterFunc lcd_filter_func = NULL;
+
+
+ if ( slot->face )
+ {
+ FT_Char i;
+
+
+ for ( i = 0; i < FT_LCD_FILTER_FIVE_TAPS; i++ )
+ if ( slot->face->internal->lcd_weights[i] != 0 )
+ {
+ have_custom_weight = TRUE;
+ break;
+ }
+ }
+
+ /*
+ * The LCD filter can be set library-wide and per-face. Face overrides
+ * library. If the face filter weights are all zero (the default), it
+ * means that the library default should be used.
+ */
+ if ( have_custom_weight )
+ {
+ /*
+ * A per-font filter is set. It always uses the default 5-tap
+ * in-place FIR filter that needs 2 extra pixels.
+ */
+ ft_memcpy( lcd_weights,
+ slot->face->internal->lcd_weights,
+ FT_LCD_FILTER_FIVE_TAPS );
+ lcd_filter_func = ft_lcd_filter_fir;
+ lcd_extra = 2;
+ }
+ else
+ {
+ /*
+ * The face's lcd_weights is {0, 0, 0, 0, 0}, meaning `use library
+ * default'. If the library is set to use no LCD filtering
+ * (lcd_filter_func == NULL), `lcd_filter_func' here is also set to
+ * NULL and the tests further below pass over the filtering process.
+ */
+ ft_memcpy( lcd_weights,
+ slot->library->lcd_weights,
+ FT_LCD_FILTER_FIVE_TAPS );
+ lcd_filter_func = slot->library->lcd_filter_func;
+ lcd_extra = slot->library->lcd_extra;
+ }
+
+#endif /*FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
/* check glyph image format */
if ( slot->format != render->glyph_format )
@@ -177,28 +231,23 @@
height *= 3;
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
- if ( slot->library->lcd_filter_func )
+ if ( lcd_filter_func )
{
- FT_Int extra = slot->library->lcd_extra;
-
-
if ( hmul )
{
- x_shift += 64 * ( extra >> 1 );
- x_left -= extra >> 1;
- width += 3 * extra;
+ x_shift += 64 * ( lcd_extra >> 1 );
+ x_left -= lcd_extra >> 1;
+ width += 3 * lcd_extra;
pitch = FT_PAD_CEIL( width, 4 );
}
if ( vmul )
{
- y_shift += 64 * ( extra >> 1 );
- y_top += extra >> 1;
- height += 3 * extra;
+ y_shift += 64 * ( lcd_extra >> 1 );
+ y_top += lcd_extra >> 1;
+ height += 3 * lcd_extra;
}
}
-
#endif
/*
@@ -299,8 +348,8 @@
if ( error )
goto Exit;
- if ( slot->library->lcd_filter_func )
- slot->library->lcd_filter_func( bitmap, mode, slot->library );
+ if ( lcd_filter_func )
+ lcd_filter_func( bitmap, mode, lcd_weights );
#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
@@ -428,7 +477,8 @@
}
- FT_DEFINE_RENDERER( ft_smooth_renderer_class,
+ FT_DEFINE_RENDERER(
+ ft_smooth_renderer_class,
FT_MODULE_RENDERER,
sizeof ( FT_RendererRec ),
@@ -437,25 +487,25 @@
0x10000L,
0x20000L,
- 0, /* module specific interface */
+ NULL, /* module specific interface */
- (FT_Module_Constructor)ft_smooth_init,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) 0
- ,
+ (FT_Module_Constructor)ft_smooth_init, /* module_init */
+ (FT_Module_Destructor) NULL, /* module_done */
+ (FT_Module_Requester) NULL, /* get_interface */
FT_GLYPH_FORMAT_OUTLINE,
- (FT_Renderer_RenderFunc) ft_smooth_render,
- (FT_Renderer_TransformFunc)ft_smooth_transform,
- (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox,
- (FT_Renderer_SetModeFunc) ft_smooth_set_mode,
+ (FT_Renderer_RenderFunc) ft_smooth_render, /* render_glyph */
+ (FT_Renderer_TransformFunc)ft_smooth_transform, /* transform_glyph */
+ (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */
+ (FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */
- (FT_Raster_Funcs*) &FT_GRAYS_RASTER_GET
+ (FT_Raster_Funcs*)&FT_GRAYS_RASTER_GET /* raster_class */
)
- FT_DEFINE_RENDERER( ft_smooth_lcd_renderer_class,
+ FT_DEFINE_RENDERER(
+ ft_smooth_lcd_renderer_class,
FT_MODULE_RENDERER,
sizeof ( FT_RendererRec ),
@@ -464,24 +514,25 @@
0x10000L,
0x20000L,
- 0, /* module specific interface */
+ NULL, /* module specific interface */
- (FT_Module_Constructor)ft_smooth_init,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) 0
- ,
+ (FT_Module_Constructor)ft_smooth_init, /* module_init */
+ (FT_Module_Destructor) NULL, /* module_done */
+ (FT_Module_Requester) NULL, /* get_interface */
FT_GLYPH_FORMAT_OUTLINE,
- (FT_Renderer_RenderFunc) ft_smooth_render_lcd,
- (FT_Renderer_TransformFunc)ft_smooth_transform,
- (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox,
- (FT_Renderer_SetModeFunc) ft_smooth_set_mode,
+ (FT_Renderer_RenderFunc) ft_smooth_render_lcd, /* render_glyph */
+ (FT_Renderer_TransformFunc)ft_smooth_transform, /* transform_glyph */
+ (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */
+ (FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */
- (FT_Raster_Funcs*) &FT_GRAYS_RASTER_GET
+ (FT_Raster_Funcs*)&FT_GRAYS_RASTER_GET /* raster_class */
)
- FT_DEFINE_RENDERER( ft_smooth_lcdv_renderer_class,
+
+ FT_DEFINE_RENDERER(
+ ft_smooth_lcdv_renderer_class,
FT_MODULE_RENDERER,
sizeof ( FT_RendererRec ),
@@ -490,21 +541,20 @@
0x10000L,
0x20000L,
- 0, /* module specific interface */
+ NULL, /* module specific interface */
- (FT_Module_Constructor)ft_smooth_init,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) 0
- ,
+ (FT_Module_Constructor)ft_smooth_init, /* module_init */
+ (FT_Module_Destructor) NULL, /* module_done */
+ (FT_Module_Requester) NULL, /* get_interface */
FT_GLYPH_FORMAT_OUTLINE,
- (FT_Renderer_RenderFunc) ft_smooth_render_lcd_v,
- (FT_Renderer_TransformFunc)ft_smooth_transform,
- (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox,
- (FT_Renderer_SetModeFunc) ft_smooth_set_mode,
+ (FT_Renderer_RenderFunc) ft_smooth_render_lcd_v, /* render_glyph */
+ (FT_Renderer_TransformFunc)ft_smooth_transform, /* transform_glyph */
+ (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */
+ (FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */
- (FT_Raster_Funcs*) &FT_GRAYS_RASTER_GET
+ (FT_Raster_Funcs*)&FT_GRAYS_RASTER_GET /* raster_class */
)
diff --git a/thirdparty/freetype/src/smooth/ftsmooth.h b/thirdparty/freetype/src/smooth/ftsmooth.h
index c7c28c244c..6dfd65726c 100644
--- a/thirdparty/freetype/src/smooth/ftsmooth.h
+++ b/thirdparty/freetype/src/smooth/ftsmooth.h
@@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -27,18 +27,11 @@
FT_BEGIN_HEADER
-#ifndef FT_CONFIG_OPTION_NO_STD_RASTER
- FT_DECLARE_RENDERER( ft_std_renderer_class )
-#endif
-
-#ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER
FT_DECLARE_RENDERER( ft_smooth_renderer_class )
FT_DECLARE_RENDERER( ft_smooth_lcd_renderer_class )
- FT_DECLARE_RENDERER( ft_smooth_lcd_v_renderer_class )
-#endif
-
+ FT_DECLARE_RENDERER( ft_smooth_lcdv_renderer_class )
FT_END_HEADER
diff --git a/thirdparty/freetype/src/smooth/ftspic.c b/thirdparty/freetype/src/smooth/ftspic.c
index 6c2b2329b3..fb89be3488 100644
--- a/thirdparty/freetype/src/smooth/ftspic.c
+++ b/thirdparty/freetype/src/smooth/ftspic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for smooth module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/smooth/ftspic.h b/thirdparty/freetype/src/smooth/ftspic.h
index fe76152770..9ddd1c7905 100644
--- a/thirdparty/freetype/src/smooth/ftspic.h
+++ b/thirdparty/freetype/src/smooth/ftspic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for smooth module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/smooth/module.mk b/thirdparty/freetype/src/smooth/module.mk
index f3cb044039..804e9b1386 100644
--- a/thirdparty/freetype/src/smooth/module.mk
+++ b/thirdparty/freetype/src/smooth/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/smooth/rules.mk b/thirdparty/freetype/src/smooth/rules.mk
index 5e94f73519..dfdc9bc30f 100644
--- a/thirdparty/freetype/src/smooth/rules.mk
+++ b/thirdparty/freetype/src/smooth/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/smooth/smooth.c b/thirdparty/freetype/src/smooth/smooth.c
index 97ca3e5995..e0460d9d46 100644
--- a/thirdparty/freetype/src/smooth/smooth.c
+++ b/thirdparty/freetype/src/smooth/smooth.c
@@ -4,7 +4,7 @@
/* */
/* FreeType anti-aliasing rasterer module component (body only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,11 +17,11 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
#include <ft2build.h>
-#include "ftspic.c"
+
#include "ftgrays.c"
#include "ftsmooth.c"
+#include "ftspic.c"
/* END */
diff --git a/thirdparty/freetype/src/truetype/module.mk b/thirdparty/freetype/src/truetype/module.mk
index 80c9832b2c..563c584e2b 100644
--- a/thirdparty/freetype/src/truetype/module.mk
+++ b/thirdparty/freetype/src/truetype/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/truetype/rules.mk b/thirdparty/freetype/src/truetype/rules.mk
index 3bf7cf770d..ad3d007455 100644
--- a/thirdparty/freetype/src/truetype/rules.mk
+++ b/thirdparty/freetype/src/truetype/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/truetype/truetype.c b/thirdparty/freetype/src/truetype/truetype.c
index 23e2ea00a7..301b82ad1c 100644
--- a/thirdparty/freetype/src/truetype/truetype.c
+++ b/thirdparty/freetype/src/truetype/truetype.c
@@ -4,7 +4,7 @@
/* */
/* FreeType TrueType driver component (body only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,22 +17,16 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
#include <ft2build.h>
-#include "ttpic.c"
+
#include "ttdriver.c" /* driver interface */
-#include "ttpload.c" /* tables loader */
#include "ttgload.c" /* glyph loader */
-#include "ttobjs.c" /* object manager */
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
+#include "ttgxvar.c" /* gx distortable font */
#include "ttinterp.c"
+#include "ttobjs.c" /* object manager */
+#include "ttpic.c"
+#include "ttpload.c" /* tables loader */
#include "ttsubpix.c"
-#endif
-
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-#include "ttgxvar.c" /* gx distortable font */
-#endif
/* END */
diff --git a/thirdparty/freetype/src/truetype/ttdriver.c b/thirdparty/freetype/src/truetype/ttdriver.c
index c9d4081efe..a1653b241c 100644
--- a/thirdparty/freetype/src/truetype/ttdriver.c
+++ b/thirdparty/freetype/src/truetype/ttdriver.c
@@ -4,7 +4,7 @@
/* */
/* TrueType font driver implementation (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,6 +25,7 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include FT_MULTIPLE_MASTERS_H
#include FT_SERVICE_MULTIPLE_MASTERS_H
+#include FT_SERVICE_METRICS_VARIATIONS_H
#endif
#include FT_SERVICE_TRUETYPE_ENGINE_H
@@ -61,26 +62,48 @@
static FT_Error
tt_property_set( FT_Module module, /* TT_Driver */
const char* property_name,
- const void* value )
+ const void* value,
+ FT_Bool value_is_string )
{
FT_Error error = FT_Err_Ok;
TT_Driver driver = (TT_Driver)module;
+#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ FT_UNUSED( value_is_string );
+#endif
+
if ( !ft_strcmp( property_name, "interpreter-version" ) )
{
- FT_UInt* interpreter_version = (FT_UInt*)value;
+ FT_UInt interpreter_version;
- if ( *interpreter_version == TT_INTERPRETER_VERSION_35
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+
+
+ interpreter_version = (FT_UInt)ft_strtol( s, NULL, 10 );
+ }
+ else
+#endif
+ {
+ FT_UInt* iv = (FT_UInt*)value;
+
+
+ interpreter_version = *iv;
+ }
+
+ if ( interpreter_version == TT_INTERPRETER_VERSION_35
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
- || *interpreter_version == TT_INTERPRETER_VERSION_38
+ || interpreter_version == TT_INTERPRETER_VERSION_38
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- || *interpreter_version == TT_INTERPRETER_VERSION_40
+ || interpreter_version == TT_INTERPRETER_VERSION_40
#endif
)
- driver->interpreter_version = *interpreter_version;
+ driver->interpreter_version = interpreter_version;
else
error = FT_ERR( Unimplemented_Feature );
@@ -122,8 +145,10 @@
FT_DEFINE_SERVICE_PROPERTIESREC(
tt_service_properties,
+
(FT_Properties_SetFunc)tt_property_set, /* set_property */
- (FT_Properties_GetFunc)tt_property_get ) /* get_property */
+ (FT_Properties_GetFunc)tt_property_get /* get_property */
+ )
/*************************************************************************/
@@ -199,13 +224,20 @@
FT_Fixed *advances )
{
FT_UInt nn;
- TT_Face face = (TT_Face) ttface;
+ TT_Face face = (TT_Face)ttface;
/* XXX: TODO: check for sbits */
if ( flags & FT_LOAD_VERTICAL_LAYOUT )
{
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* no fast retrieval for blended MM fonts without VVAR table */
+ if ( !face->is_default_instance &&
+ !( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
+ return FT_THROW( Unimplemented_Feature );
+#endif
+
for ( nn = 0; nn < count; nn++ )
{
FT_Short tsb;
@@ -219,6 +251,13 @@
}
else
{
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* no fast retrieval for blended MM fonts without HVAR table */
+ if ( !face->is_default_instance &&
+ !( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
+ return FT_THROW( Unimplemented_Feature );
+#endif
+
for ( nn = 0; nn < count; nn++ )
{
FT_Short lsb;
@@ -265,15 +304,17 @@
/* use the scaled metrics, even when tt_size_reset fails */
FT_Select_Metrics( size->face, strike_index );
- tt_size_reset( ttsize ); /* ignore return value */
+ tt_size_reset( ttsize, 0 ); /* ignore return value */
}
else
{
- SFNT_Service sfnt = (SFNT_Service) ttface->sfnt;
- FT_Size_Metrics* metrics = &size->metrics;
+ SFNT_Service sfnt = (SFNT_Service)ttface->sfnt;
+ FT_Size_Metrics* size_metrics = &size->metrics;
- error = sfnt->load_strike_metrics( ttface, strike_index, metrics );
+ error = sfnt->load_strike_metrics( ttface,
+ strike_index,
+ size_metrics );
if ( error )
ttsize->strike_index = 0xFFFFFFFFUL;
}
@@ -297,7 +338,7 @@
if ( FT_HAS_FIXED_SIZES( size->face ) )
{
TT_Face ttface = (TT_Face)size->face;
- SFNT_Service sfnt = (SFNT_Service) ttface->sfnt;
+ SFNT_Service sfnt = (SFNT_Service)ttface->sfnt;
FT_ULong strike_index;
@@ -315,8 +356,28 @@
if ( FT_IS_SCALABLE( size->face ) )
{
- error = tt_size_reset( ttsize );
- ttsize->root.metrics = ttsize->metrics;
+ error = tt_size_reset( ttsize, 0 );
+
+#ifdef TT_USE_BYTECODE_INTERPRETER
+ /* for the `MPS' bytecode instruction we need the point size */
+ if ( !error )
+ {
+ FT_UInt resolution =
+ ttsize->metrics->x_ppem > ttsize->metrics->y_ppem
+ ? req->horiResolution
+ : req->vertResolution;
+
+
+ /* if we don't have a resolution value, assume 72dpi */
+ if ( req->type == FT_SIZE_REQUEST_TYPE_SCALES ||
+ !resolution )
+ resolution = 72;
+
+ ttsize->point_size = FT_MulDiv( ttsize->ttmetrics.ppem,
+ 64 * 72,
+ resolution );
+ }
+#endif
}
return error;
@@ -398,6 +459,11 @@
load_flags |= FT_LOAD_NO_HINTING;
}
+ /* use hinted metrics only if we load a glyph with hinting */
+ size->metrics = ( load_flags & FT_LOAD_NO_HINTING )
+ ? &ttsize->metrics
+ : &size->hinted_metrics;
+
/* now load the glyph outline if necessary */
error = TT_Load_Glyph( size, slot, glyph_index, load_flags );
@@ -421,14 +487,38 @@
/*************************************************************************/
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
FT_DEFINE_SERVICE_MULTIMASTERSREC(
tt_service_gx_multi_masters,
+
(FT_Get_MM_Func) NULL, /* get_mm */
(FT_Set_MM_Design_Func) NULL, /* set_mm_design */
(FT_Set_MM_Blend_Func) TT_Set_MM_Blend, /* set_mm_blend */
+ (FT_Get_MM_Blend_Func) TT_Get_MM_Blend, /* get_mm_blend */
(FT_Get_MM_Var_Func) TT_Get_MM_Var, /* get_mm_var */
- (FT_Set_Var_Design_Func)TT_Set_Var_Design ) /* set_var_design */
-#endif
+ (FT_Set_Var_Design_Func)TT_Set_Var_Design, /* set_var_design */
+ (FT_Get_Var_Design_Func)TT_Get_Var_Design, /* get_var_design */
+
+ (FT_Get_Var_Blend_Func) tt_get_var_blend, /* get_var_blend */
+ (FT_Done_Blend_Func) tt_done_blend /* done_blend */
+ )
+
+ FT_DEFINE_SERVICE_METRICSVARIATIONSREC(
+ tt_service_metrics_variations,
+
+ (FT_HAdvance_Adjust_Func)tt_hadvance_adjust, /* hadvance_adjust */
+ (FT_LSB_Adjust_Func) NULL, /* lsb_adjust */
+ (FT_RSB_Adjust_Func) NULL, /* rsb_adjust */
+
+ (FT_VAdvance_Adjust_Func)tt_vadvance_adjust, /* vadvance_adjust */
+ (FT_TSB_Adjust_Func) NULL, /* tsb_adjust */
+ (FT_BSB_Adjust_Func) NULL, /* bsb_adjust */
+ (FT_VOrg_Adjust_Func) NULL, /* vorg_adjust */
+
+ (FT_Metrics_Adjust_Func) tt_apply_mvar /* metrics_adjust */
+ )
+
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
static const FT_Service_TrueTypeEngineRec tt_service_truetype_engine =
@@ -447,20 +537,25 @@
FT_DEFINE_SERVICE_TTGLYFREC(
tt_service_truetype_glyf,
- (TT_Glyf_GetLocationFunc)tt_face_get_location ) /* get_location */
+
+ (TT_Glyf_GetLocationFunc)tt_face_get_location /* get_location */
+ )
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- FT_DEFINE_SERVICEDESCREC5(
+ FT_DEFINE_SERVICEDESCREC6(
tt_services,
- FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TRUETYPE,
- FT_SERVICE_ID_MULTI_MASTERS, &TT_SERVICE_GX_MULTI_MASTERS_GET,
- FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
- FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET,
- FT_SERVICE_ID_PROPERTIES, &TT_SERVICE_PROPERTIES_GET )
+
+ FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TRUETYPE,
+ FT_SERVICE_ID_MULTI_MASTERS, &TT_SERVICE_GX_MULTI_MASTERS_GET,
+ FT_SERVICE_ID_METRICS_VARIATIONS, &TT_SERVICE_METRICS_VARIATIONS_GET,
+ FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
+ FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET,
+ FT_SERVICE_ID_PROPERTIES, &TT_SERVICE_PROPERTIES_GET )
#else
FT_DEFINE_SERVICEDESCREC4(
tt_services,
+
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TRUETYPE,
FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET,
@@ -488,7 +583,7 @@
#endif
result = ft_service_list_lookup( TT_SERVICES_GET, tt_interface );
- if ( result != NULL )
+ if ( result )
return result;
#ifndef FT_CONFIG_OPTION_PIC
@@ -539,7 +634,7 @@
0x10000L, /* driver version == 1.0 */
0x20000L, /* driver requires FreeType 2.0 or above */
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
tt_driver_init, /* FT_Module_Constructor module_init */
tt_driver_done, /* FT_Module_Destructor module_done */
@@ -554,12 +649,12 @@
tt_size_init, /* FT_Size_InitFunc init_size */
tt_size_done, /* FT_Size_DoneFunc done_size */
tt_slot_init, /* FT_Slot_InitFunc init_slot */
- 0, /* FT_Slot_DoneFunc done_slot */
+ NULL, /* FT_Slot_DoneFunc done_slot */
tt_glyph_load, /* FT_Slot_LoadFunc load_glyph */
tt_get_kerning, /* FT_Face_GetKerningFunc get_kerning */
- 0, /* FT_Face_AttachFunc attach_file */
+ NULL, /* FT_Face_AttachFunc attach_file */
tt_get_advances, /* FT_Face_GetAdvancesFunc get_advances */
tt_size_request, /* FT_Size_RequestFunc request_size */
diff --git a/thirdparty/freetype/src/truetype/ttdriver.h b/thirdparty/freetype/src/truetype/ttdriver.h
index 74392bbd02..3bcba7f745 100644
--- a/thirdparty/freetype/src/truetype/ttdriver.h
+++ b/thirdparty/freetype/src/truetype/ttdriver.h
@@ -4,7 +4,7 @@
/* */
/* High-level TrueType driver interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/tterrors.h b/thirdparty/freetype/src/truetype/tterrors.h
index 895989f5fd..a49f205156 100644
--- a/thirdparty/freetype/src/truetype/tterrors.h
+++ b/thirdparty/freetype/src/truetype/tterrors.h
@@ -4,7 +4,7 @@
/* */
/* TrueType error codes (specification only). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttgload.c b/thirdparty/freetype/src/truetype/ttgload.c
index 8be9b6ae65..b7a844a6c7 100644
--- a/thirdparty/freetype/src/truetype/ttgload.c
+++ b/thirdparty/freetype/src/truetype/ttgload.c
@@ -4,7 +4,7 @@
/* */
/* TrueType Glyph Loader (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -18,6 +18,7 @@
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
+#include FT_CONFIG_CONFIG_H
#include FT_INTERNAL_CALC_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_SFNT_H
@@ -162,7 +163,7 @@
/* This may not be the right place for this, but it works... */
/* Note that we have to unconditionally load the tweaks since */
/* it is possible that glyphs individually switch ClearType's */
- /* backwards compatibility mode on and off. */
+ /* backward compatibility mode on and off. */
sph_set_tweaks( loader, glyph_index );
}
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
@@ -194,39 +195,39 @@
if ( face->root.internal->incremental_interface &&
face->root.internal->incremental_interface->funcs->get_glyph_metrics )
{
- FT_Incremental_MetricsRec metrics;
+ FT_Incremental_MetricsRec incr_metrics;
FT_Error error;
- metrics.bearing_x = loader->left_bearing;
- metrics.bearing_y = 0;
- metrics.advance = loader->advance;
- metrics.advance_v = 0;
+ incr_metrics.bearing_x = loader->left_bearing;
+ incr_metrics.bearing_y = 0;
+ incr_metrics.advance = loader->advance;
+ incr_metrics.advance_v = 0;
error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
face->root.internal->incremental_interface->object,
- glyph_index, FALSE, &metrics );
+ glyph_index, FALSE, &incr_metrics );
if ( error )
goto Exit;
- left_bearing = (FT_Short)metrics.bearing_x;
- advance_width = (FT_UShort)metrics.advance;
+ left_bearing = (FT_Short)incr_metrics.bearing_x;
+ advance_width = (FT_UShort)incr_metrics.advance;
#if 0
/* GWW: Do I do the same for vertical metrics? */
- metrics.bearing_x = 0;
- metrics.bearing_y = loader->top_bearing;
- metrics.advance = loader->vadvance;
+ incr_metrics.bearing_x = 0;
+ incr_metrics.bearing_y = loader->top_bearing;
+ incr_metrics.advance = loader->vadvance;
error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
face->root.internal->incremental_interface->object,
- glyph_index, TRUE, &metrics );
+ glyph_index, TRUE, &incr_metrics );
if ( error )
goto Exit;
- top_bearing = (FT_Short)metrics.bearing_y;
- advance_height = (FT_UShort)metrics.advance;
+ top_bearing = (FT_Short)incr_metrics.bearing_y;
+ advance_height = (FT_UShort)incr_metrics.advance;
#endif /* 0 */
@@ -332,7 +333,6 @@
FT_Outline* outline;
FT_UShort n_ins;
FT_Int n_points;
- FT_ULong tmp;
FT_Byte *flag, *flag_limit;
FT_Byte c, count;
@@ -398,18 +398,21 @@
FT_TRACE5(( " Instructions size: %u\n", n_ins ));
- /* check it */
- if ( ( limit - p ) < n_ins )
- {
- FT_TRACE0(( "TT_Load_Simple_Glyph: instruction count mismatch\n" ));
- error = FT_THROW( Too_Many_Hints );
- goto Fail;
- }
-
#ifdef TT_USE_BYTECODE_INTERPRETER
if ( IS_HINTED( load->load_flags ) )
{
+ FT_ULong tmp;
+
+
+ /* check instructions size */
+ if ( ( limit - p ) < n_ins )
+ {
+ FT_TRACE1(( "TT_Load_Simple_Glyph: instruction count mismatch\n" ));
+ error = FT_THROW( Too_Many_Hints );
+ goto Fail;
+ }
+
/* we don't trust `maxSizeOfInstructions' in the `maxp' table */
/* and thus update the bytecode array size by ourselves */
@@ -441,7 +444,7 @@
flag = (FT_Byte*)outline->tags;
flag_limit = flag + n_points;
- FT_ASSERT( flag != NULL );
+ FT_ASSERT( flag );
while ( flag < flag_limit )
{
@@ -775,8 +778,8 @@
}
else
{
- loader->exec->metrics.x_scale = loader->size->metrics.x_scale;
- loader->exec->metrics.y_scale = loader->size->metrics.y_scale;
+ loader->exec->metrics.x_scale = loader->size->metrics->x_scale;
+ loader->exec->metrics.y_scale = loader->size->metrics->y_scale;
}
#endif
@@ -818,11 +821,11 @@
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* Save possibly modified glyph phantom points unless in v40 backwards */
+ /* Save possibly modified glyph phantom points unless in v40 backward */
/* compatibility mode, where no movement on the x axis means no reason */
/* to change bearings or advance widths. */
if ( !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
- !loader->exec->backwards_compatibility ) )
+ !loader->exec->backward_compatibility ) )
{
#endif
loader->pp1 = zone->cur[zone->n_points - 4];
@@ -886,13 +889,23 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( loader->face->doblend )
+ if ( !loader->face->is_default_instance )
{
/* Deltas apply to the unscaled data. */
error = TT_Vary_Apply_Glyph_Deltas( loader->face,
loader->glyph_index,
outline,
(FT_UInt)n_points );
+
+ /* recalculate linear horizontal and vertical advances */
+ /* if we don't have HVAR and VVAR, respectively */
+ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
+ loader->linear = outline->points[n_points - 3].x -
+ outline->points[n_points - 4].x;
+ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
+ loader->vadvance = outline->points[n_points - 1].x -
+ outline->points[n_points - 2].x;
+
if ( error )
return error;
}
@@ -913,7 +926,7 @@
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
FT_String* family = face->root.family_name;
- FT_UInt ppem = loader->size->metrics.x_ppem;
+ FT_UInt ppem = loader->size->metrics->x_ppem;
FT_String* style = face->root.style_name;
FT_UInt x_scale_factor = 1000;
#endif
@@ -942,9 +955,9 @@
if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ||
x_scale_factor != 1000 )
{
- x_scale = FT_MulDiv( loader->size->metrics.x_scale,
+ x_scale = FT_MulDiv( loader->size->metrics->x_scale,
(FT_Long)x_scale_factor, 1000 );
- y_scale = loader->size->metrics.y_scale;
+ y_scale = loader->size->metrics->y_scale;
/* compensate for any scaling by de/emboldening; */
/* the amount was determined via experimentation */
@@ -964,8 +977,8 @@
/* scale the glyph */
if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
{
- x_scale = loader->size->metrics.x_scale;
- y_scale = loader->size->metrics.y_scale;
+ x_scale = loader->size->metrics->x_scale;
+ y_scale = loader->size->metrics->y_scale;
do_scale = TRUE;
}
@@ -1123,8 +1136,8 @@
if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) )
{
- FT_Fixed x_scale = loader->size->metrics.x_scale;
- FT_Fixed y_scale = loader->size->metrics.y_scale;
+ FT_Fixed x_scale = loader->size->metrics->x_scale;
+ FT_Fixed y_scale = loader->size->metrics->y_scale;
x = FT_MulFix( x, x_scale );
@@ -1382,7 +1395,7 @@
/* a utility function to retrieve i-th node from given FT_List */
static FT_ListNode
ft_list_get_node_at( FT_List list,
- FT_UInt index )
+ FT_UInt idx )
{
FT_ListNode cur;
@@ -1392,10 +1405,10 @@
for ( cur = list->head; cur; cur = cur->next )
{
- if ( !index )
+ if ( !idx )
return cur;
- index--;
+ idx--;
}
return NULL;
@@ -1436,13 +1449,12 @@
FT_TRACE5(( " nesting level: %d\n", recurse_count ));
#endif
- /* some fonts have an incorrect value of `maxComponentDepth', */
- /* thus we allow depth 1 to catch the majority of them */
- if ( recurse_count > 1 &&
- recurse_count > face->max_profile.maxComponentDepth )
+ /* some fonts have an incorrect value of `maxComponentDepth' */
+ if ( recurse_count > face->max_profile.maxComponentDepth )
{
- error = FT_THROW( Invalid_Composite );
- goto Exit;
+ FT_TRACE1(( "load_truetype_glyph: maxComponentDepth set to %d\n",
+ recurse_count ));
+ face->max_profile.maxComponentDepth = (FT_UShort)recurse_count;
}
#ifndef FT_CONFIG_OPTION_INCREMENTAL
@@ -1458,8 +1470,8 @@
if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
{
- x_scale = loader->size->metrics.x_scale;
- y_scale = loader->size->metrics.y_scale;
+ x_scale = loader->size->metrics->x_scale;
+ y_scale = loader->size->metrics->y_scale;
}
else
{
@@ -1488,7 +1500,7 @@
offset = 0;
loader->byte_len = glyph_data.length;
- FT_MEM_ZERO( &inc_stream, sizeof ( inc_stream ) );
+ FT_ZERO( &inc_stream );
FT_Stream_OpenMemory( &inc_stream,
glyph_data.pointer,
(FT_ULong)glyph_data.length );
@@ -1506,10 +1518,10 @@
{
#ifdef FT_CONFIG_OPTION_INCREMENTAL
/* for the incremental interface, `glyf_offset' is always zero */
- if ( !loader->glyf_offset &&
+ if ( !face->glyf_offset &&
!face->root.internal->incremental_interface )
#else
- if ( !loader->glyf_offset )
+ if ( !face->glyf_offset )
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
{
FT_TRACE2(( "no `glyf' table but non-zero `loca' entry\n" ));
@@ -1518,7 +1530,7 @@
}
error = face->access_glyph_frame( loader, glyph_index,
- loader->glyf_offset + offset,
+ face->glyf_offset + offset,
(FT_UInt)loader->byte_len );
if ( error )
goto Exit;
@@ -1565,7 +1577,7 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( loader->face->doblend )
+ if ( !loader->face->is_default_instance )
{
/* a small outline structure with four elements for */
/* communication with `TT_Vary_Apply_Glyph_Deltas' */
@@ -1608,6 +1620,14 @@
loader->pp3.y = points[2].y;
loader->pp4.x = points[3].x;
loader->pp4.y = points[3].y;
+
+
+ /* recalculate linear horizontal and vertical advances */
+ /* if we don't have HVAR and VVAR, respectively */
+ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
+ loader->linear = loader->pp2.x - loader->pp1.x;
+ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
+ loader->vadvance = loader->pp4.x - loader->pp3.x;
}
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
@@ -1692,7 +1712,7 @@
/* check whether we already have a composite glyph with this index */
if ( FT_List_Find( &loader->composites,
- (void*)(unsigned long)glyph_index ) )
+ FT_UINT_TO_POINTER( glyph_index ) ) )
{
FT_TRACE1(( "TT_Load_Composite_Glyph:"
" infinite recursion detected\n" ));
@@ -1701,13 +1721,13 @@
}
else if ( node )
- node->data = (void*)(unsigned long)glyph_index;
+ node->data = FT_UINT_TO_POINTER( glyph_index );
else
{
if ( FT_NEW( node ) )
goto Exit;
- node->data = (void*)(unsigned long)glyph_index;
+ node->data = FT_UINT_TO_POINTER( glyph_index );
FT_List_Add( &loader->composites, node );
}
@@ -1728,7 +1748,7 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( face->doblend )
+ if ( !face->is_default_instance )
{
short i, limit;
FT_SubGlyph subglyph;
@@ -1797,22 +1817,22 @@
/* this call provides additional offsets */
/* for each component's translation */
- if ( ( error = TT_Vary_Apply_Glyph_Deltas(
- face,
- glyph_index,
- &outline,
- (FT_UInt)outline.n_points ) ) != 0 )
+ if ( FT_SET_ERROR( TT_Vary_Apply_Glyph_Deltas(
+ face,
+ glyph_index,
+ &outline,
+ (FT_UInt)outline.n_points ) ) )
goto Exit1;
subglyph = gloader->current.subglyphs;
for ( i = 0; i < limit; i++, subglyph++ )
{
- /* XXX: overflow check for subglyph->{arg1,arg2}. */
- /* Deltas must be within signed 16-bit, */
- /* but the restriction of summed deltas is not clear */
- subglyph->arg1 = (FT_Int16)points[i].x;
- subglyph->arg2 = (FT_Int16)points[i].y;
+ if ( subglyph->flags & ARGS_ARE_XY_VALUES )
+ {
+ subglyph->arg1 = (FT_Int16)points[i].x;
+ subglyph->arg2 = (FT_Int16)points[i].y;
+ }
}
loader->pp1.x = points[i + 0].x;
@@ -1825,6 +1845,13 @@
loader->pp4.x = points[i + 3].x;
loader->pp4.y = points[i + 3].y;
+ /* recalculate linear horizontal and vertical advances */
+ /* if we don't have HVAR and VVAR, respectively */
+ if ( !( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
+ loader->linear = loader->pp2.x - loader->pp1.x;
+ if ( !( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
+ loader->vadvance = loader->pp4.x - loader->pp3.x;
+
Exit1:
FT_FREE( outline.points );
FT_FREE( outline.tags );
@@ -1884,6 +1911,9 @@
{
FT_Vector pp[4];
+ FT_Int linear_hadvance;
+ FT_Int linear_vadvance;
+
/* Each time we call load_truetype_glyph in this loop, the */
/* value of `gloader.base.subglyphs' can change due to table */
@@ -1896,6 +1926,9 @@
pp[2] = loader->pp3;
pp[3] = loader->pp4;
+ linear_hadvance = loader->linear;
+ linear_vadvance = loader->vadvance;
+
num_base_points = (FT_UInt)gloader->base.outline.n_points;
error = load_truetype_glyph( loader,
@@ -1915,6 +1948,9 @@
loader->pp2 = pp[1];
loader->pp3 = pp[2];
loader->pp4 = pp[3];
+
+ loader->linear = linear_hadvance;
+ loader->vadvance = linear_vadvance;
}
num_points = (FT_UInt)gloader->base.outline.n_points;
@@ -2002,7 +2038,7 @@
y_scale = 0x10000L;
if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
- y_scale = size->root.metrics.y_scale;
+ y_scale = size->metrics->y_scale;
if ( glyph->format != FT_GLYPH_FORMAT_COMPOSITE )
FT_Outline_Get_CBox( &glyph->outline, &bbox );
@@ -2017,24 +2053,24 @@
glyph->metrics.horiBearingY = bbox.yMax;
glyph->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
- /* Adjust advance width to the value contained in the hdmx table */
- /* unless FT_LOAD_COMPUTE_METRICS is set or backwards compatibility */
- /* mode of the v40 interpreter is active. See `ttinterp.h' for */
- /* details on backwards compatibility mode. */
+ /* Adjust advance width to the value contained in the hdmx table */
+ /* unless FT_LOAD_COMPUTE_METRICS is set or backward compatibility */
+ /* mode of the v40 interpreter is active. See `ttinterp.h' for */
+ /* details on backward compatibility mode. */
if (
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
- ( loader->exec && loader->exec->backwards_compatibility ) ) &&
+ !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
+ ( loader->exec && loader->exec->backward_compatibility ) ) &&
#endif
- !face->postscript.isFixedPitch &&
- IS_HINTED( loader->load_flags ) &&
- !( loader->load_flags & FT_LOAD_COMPUTE_METRICS ) )
+ !face->postscript.isFixedPitch &&
+ IS_HINTED( loader->load_flags ) &&
+ !( loader->load_flags & FT_LOAD_COMPUTE_METRICS ) )
{
FT_Byte* widthp;
widthp = tt_face_get_device_metrics( face,
- size->root.metrics.x_ppem,
+ size->metrics->x_ppem,
glyph_index );
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
@@ -2116,7 +2152,7 @@
#ifdef FT_CONFIG_OPTION_INCREMENTAL
{
FT_Incremental_InterfaceRec* incr;
- FT_Incremental_MetricsRec metrics;
+ FT_Incremental_MetricsRec incr_metrics;
FT_Error error;
@@ -2126,19 +2162,19 @@
/* overriding metrics for this glyph. */
if ( incr && incr->funcs->get_glyph_metrics )
{
- metrics.bearing_x = 0;
- metrics.bearing_y = top;
- metrics.advance = advance;
+ incr_metrics.bearing_x = 0;
+ incr_metrics.bearing_y = top;
+ incr_metrics.advance = advance;
error = incr->funcs->get_glyph_metrics( incr->object,
glyph_index,
TRUE,
- &metrics );
+ &incr_metrics );
if ( error )
return error;
- top = metrics.bearing_y;
- advance = metrics.advance;
+ top = incr_metrics.bearing_y;
+ advance = incr_metrics.advance;
}
}
@@ -2180,7 +2216,7 @@
SFNT_Service sfnt;
FT_Stream stream;
FT_Error error;
- TT_SBit_MetricsRec metrics;
+ TT_SBit_MetricsRec sbit_metrics;
face = (TT_Face)glyph->face;
@@ -2193,34 +2229,34 @@
(FT_UInt)load_flags,
stream,
&glyph->bitmap,
- &metrics );
+ &sbit_metrics );
if ( !error )
{
glyph->outline.n_points = 0;
glyph->outline.n_contours = 0;
- glyph->metrics.width = (FT_Pos)metrics.width * 64;
- glyph->metrics.height = (FT_Pos)metrics.height * 64;
+ glyph->metrics.width = (FT_Pos)sbit_metrics.width * 64;
+ glyph->metrics.height = (FT_Pos)sbit_metrics.height * 64;
- glyph->metrics.horiBearingX = (FT_Pos)metrics.horiBearingX * 64;
- glyph->metrics.horiBearingY = (FT_Pos)metrics.horiBearingY * 64;
- glyph->metrics.horiAdvance = (FT_Pos)metrics.horiAdvance * 64;
+ glyph->metrics.horiBearingX = (FT_Pos)sbit_metrics.horiBearingX * 64;
+ glyph->metrics.horiBearingY = (FT_Pos)sbit_metrics.horiBearingY * 64;
+ glyph->metrics.horiAdvance = (FT_Pos)sbit_metrics.horiAdvance * 64;
- glyph->metrics.vertBearingX = (FT_Pos)metrics.vertBearingX * 64;
- glyph->metrics.vertBearingY = (FT_Pos)metrics.vertBearingY * 64;
- glyph->metrics.vertAdvance = (FT_Pos)metrics.vertAdvance * 64;
+ glyph->metrics.vertBearingX = (FT_Pos)sbit_metrics.vertBearingX * 64;
+ glyph->metrics.vertBearingY = (FT_Pos)sbit_metrics.vertBearingY * 64;
+ glyph->metrics.vertAdvance = (FT_Pos)sbit_metrics.vertAdvance * 64;
glyph->format = FT_GLYPH_FORMAT_BITMAP;
if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
{
- glyph->bitmap_left = metrics.vertBearingX;
- glyph->bitmap_top = metrics.vertBearingY;
+ glyph->bitmap_left = sbit_metrics.vertBearingX;
+ glyph->bitmap_top = sbit_metrics.vertBearingY;
}
else
{
- glyph->bitmap_left = metrics.horiBearingX;
- glyph->bitmap_top = metrics.horiBearingY;
+ glyph->bitmap_left = sbit_metrics.horiBearingX;
+ glyph->bitmap_top = sbit_metrics.horiBearingY;
}
}
@@ -2237,23 +2273,23 @@
FT_Int32 load_flags,
FT_Bool glyf_table_only )
{
- FT_Error error;
-
TT_Face face;
FT_Stream stream;
+
#ifdef TT_USE_BYTECODE_INTERPRETER
+ FT_Error error;
FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
-#endif
#if defined TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY || \
defined TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( (TT_Face)glyph->face );
#endif
+#endif
face = (TT_Face)glyph->face;
stream = face->root.stream;
- FT_MEM_ZERO( loader, sizeof ( TT_LoaderRec ) );
+ FT_ZERO( loader );
#ifdef TT_USE_BYTECODE_INTERPRETER
@@ -2498,32 +2534,6 @@
#endif /* TT_USE_BYTECODE_INTERPRETER */
- /* seek to the beginning of the glyph table -- for Type 42 fonts */
- /* the table might be accessed from a Postscript stream or something */
- /* else... */
-
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
-
- if ( face->root.internal->incremental_interface )
- loader->glyf_offset = 0;
- else
-
-#endif
-
- {
- error = face->goto_table( face, TTAG_glyf, stream, 0 );
-
- if ( FT_ERR_EQ( error, Table_Missing ) )
- loader->glyf_offset = 0;
- else if ( error )
- {
- FT_ERROR(( "tt_loader_init: could not access glyph table\n" ));
- return error;
- }
- else
- loader->glyf_offset = FT_STREAM_POS();
- }
-
/* get face's glyph loader */
if ( !glyf_table_only )
{
@@ -2594,17 +2604,21 @@
FT_Error error;
TT_LoaderRec loader;
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#define IS_DEFAULT_INSTANCE ( ( (TT_Face)glyph->face )->is_default_instance )
+#else
+#define IS_DEFAULT_INSTANCE 1
+#endif
+
FT_TRACE1(( "TT_Load_Glyph: glyph index %d\n", glyph_index ));
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
- /* try to load embedded bitmap if any */
- /* */
- /* XXX: The convention should be emphasized in */
- /* the documents because it can be confusing. */
+ /* try to load embedded bitmap (if any) */
if ( size->strike_index != 0xFFFFFFFFUL &&
- ( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
+ ( load_flags & FT_LOAD_NO_BITMAP ) == 0 &&
+ IS_DEFAULT_INSTANCE )
{
error = load_sbit_image( size, glyph, glyph_index, load_flags );
if ( !error )
@@ -2623,11 +2637,11 @@
if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance )
glyph->metrics.horiAdvance =
FT_MulFix( glyph->linearHoriAdvance,
- size->root.metrics.x_scale );
+ size->metrics->x_scale );
if ( !glyph->metrics.vertAdvance && glyph->linearVertAdvance )
glyph->metrics.vertAdvance =
FT_MulFix( glyph->linearVertAdvance,
- size->root.metrics.y_scale );
+ size->metrics->y_scale );
}
return FT_Err_Ok;
@@ -2638,14 +2652,20 @@
/* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */
if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid )
- return FT_THROW( Invalid_Size_Handle );
+ {
+ error = FT_THROW( Invalid_Size_Handle );
+ goto Exit;
+ }
if ( load_flags & FT_LOAD_SBITS_ONLY )
- return FT_THROW( Invalid_Argument );
+ {
+ error = FT_THROW( Invalid_Argument );
+ goto Exit;
+ }
error = tt_loader_init( &loader, size, glyph, load_flags, FALSE );
if ( error )
- return error;
+ goto Exit;
glyph->format = FT_GLYPH_FORMAT_OUTLINE;
glyph->num_subglyphs = 0;
@@ -2717,9 +2737,16 @@
/* TrueType glyphs at all sizes using the bytecode interpreter. */
/* */
if ( !( load_flags & FT_LOAD_NO_SCALE ) &&
- size->root.metrics.y_ppem < 24 )
+ size->metrics->y_ppem < 24 )
glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
+ Exit:
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( error )
+ FT_TRACE1(( " failed (error code 0x%x)\n",
+ error ));
+#endif
+
return error;
}
diff --git a/thirdparty/freetype/src/truetype/ttgload.h b/thirdparty/freetype/src/truetype/ttgload.h
index bfa29e4ff8..1dd6c841db 100644
--- a/thirdparty/freetype/src/truetype/ttgload.h
+++ b/thirdparty/freetype/src/truetype/ttgload.h
@@ -4,7 +4,7 @@
/* */
/* TrueType Glyph Loader (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttgxvar.c b/thirdparty/freetype/src/truetype/ttgxvar.c
index 9a02c5a8c1..0cedb6bdfa 100644
--- a/thirdparty/freetype/src/truetype/ttgxvar.c
+++ b/thirdparty/freetype/src/truetype/ttgxvar.c
@@ -4,7 +4,7 @@
/* */
/* TrueType GX Font Variation loader */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,10 +22,6 @@
/* */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6[fgca]var.html */
/* */
- /* The documentation for `fvar' is inconsistent. At one point it says */
- /* that `countSizePairs' should be 3, at another point 2. It should */
- /* be 2. */
- /* */
/* The documentation for `gvar' is not intelligible; `cvar' refers you */
/* to `gvar' and is thus also incomprehensible. */
/* */
@@ -49,7 +45,9 @@
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_SFNT_H
#include FT_TRUETYPE_TAGS_H
+#include FT_TRUETYPE_IDS_H
#include FT_MULTIPLE_MASTERS_H
+#include FT_LIST_H
#include "ttpload.h"
#include "ttgxvar.h"
@@ -158,48 +156,49 @@
return NULL;
}
- if ( FT_NEW_ARRAY( points, n ) )
+ /* in the nested loops below we increase `i' twice; */
+ /* it is faster to simply allocate one more slot */
+ /* than to add another test within the loop */
+ if ( FT_NEW_ARRAY( points, n + 1 ) )
return NULL;
*point_cnt = n;
- i = 0;
+ first = 0;
+ i = 0;
while ( i < n )
{
runcnt = FT_GET_BYTE();
if ( runcnt & GX_PT_POINTS_ARE_WORDS )
{
runcnt &= GX_PT_POINT_RUN_COUNT_MASK;
- first = FT_GET_USHORT();
+ first += FT_GET_USHORT();
points[i++] = first;
- if ( runcnt < 1 || i + runcnt > n )
- goto Exit;
-
/* first point not included in run count */
for ( j = 0; j < runcnt; j++ )
{
first += FT_GET_USHORT();
points[i++] = first;
+ if ( i >= n )
+ break;
}
}
else
{
- first = FT_GET_BYTE();
+ first += FT_GET_BYTE();
points[i++] = first;
- if ( runcnt < 1 || i + runcnt > n )
- goto Exit;
-
for ( j = 0; j < runcnt; j++ )
{
first += FT_GET_BYTE();
points[i++] = first;
+ if ( i >= n )
+ break;
}
}
}
- Exit:
return points;
}
@@ -321,7 +320,7 @@
FT_TRACE2(( "AVAR " ));
- blend->avar_checked = TRUE;
+ blend->avar_loaded = TRUE;
error = face->goto_table( face, TTAG_avar, stream, &table_len );
if ( error )
{
@@ -345,7 +344,7 @@
if ( axisCount != (FT_Long)blend->mmvar->num_axis )
{
- FT_TRACE2(( "ft_var_load_avar: number of axes in `avar' and `cvar'\n"
+ FT_TRACE2(( "ft_var_load_avar: number of axes in `avar' and `fvar'\n"
" table are different\n" ));
goto Exit;
}
@@ -379,7 +378,7 @@
segment->correspondence[j].fromCoord = FT_GET_SHORT() * 4;
segment->correspondence[j].toCoord = FT_GET_SHORT() * 4;
- FT_TRACE5(( " mapping %.4f to %.4f\n",
+ FT_TRACE5(( " mapping %.5f to %.5f\n",
segment->correspondence[j].fromCoord / 65536.0,
segment->correspondence[j].toCoord / 65536.0 ));
}
@@ -392,6 +391,996 @@
}
+ /* some macros we need */
+ #define FT_FIXED_ONE ( (FT_Fixed)0x10000 )
+
+ #define FT_fdot14ToFixed( x ) \
+ ( (FT_Fixed)( (FT_ULong)(x) << 2 ) )
+ #define FT_intToFixed( i ) \
+ ( (FT_Fixed)( (FT_ULong)(i) << 16 ) )
+ #define FT_fixedToInt( x ) \
+ ( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) )
+
+
+ static FT_Error
+ ft_var_load_item_variation_store( TT_Face face,
+ FT_ULong offset,
+ GX_ItemVarStore itemStore )
+ {
+ FT_Stream stream = FT_FACE_STREAM( face );
+ FT_Memory memory = stream->memory;
+
+ FT_Error error;
+ FT_UShort format;
+ FT_ULong region_offset;
+ FT_UInt i, j, k;
+ FT_UInt shortDeltaCount;
+
+ GX_Blend blend = face->blend;
+ GX_ItemVarData varData;
+
+ FT_ULong* dataOffsetArray = NULL;
+
+
+ if ( FT_STREAM_SEEK( offset ) ||
+ FT_READ_USHORT( format ) )
+ goto Exit;
+
+ if ( format != 1 )
+ {
+ FT_TRACE2(( "ft_var_load_item_variation_store: bad store format %d\n",
+ format ));
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
+ /* read top level fields */
+ if ( FT_READ_ULONG( region_offset ) ||
+ FT_READ_USHORT( itemStore->dataCount ) )
+ goto Exit;
+
+ /* we need at least one entry in `itemStore->varData' */
+ if ( !itemStore->dataCount )
+ {
+ FT_TRACE2(( "ft_var_load_item_variation_store: missing varData\n" ));
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
+ /* make temporary copy of item variation data offsets; */
+ /* we will parse region list first, then come back */
+ if ( FT_NEW_ARRAY( dataOffsetArray, itemStore->dataCount ) )
+ goto Exit;
+
+ for ( i = 0; i < itemStore->dataCount; i++ )
+ {
+ if ( FT_READ_ULONG( dataOffsetArray[i] ) )
+ goto Exit;
+ }
+
+ /* parse array of region records (region list) */
+ if ( FT_STREAM_SEEK( offset + region_offset ) )
+ goto Exit;
+
+ if ( FT_READ_USHORT( itemStore->axisCount ) ||
+ FT_READ_USHORT( itemStore->regionCount ) )
+ goto Exit;
+
+ if ( itemStore->axisCount != (FT_Long)blend->mmvar->num_axis )
+ {
+ FT_TRACE2(( "ft_var_load_item_variation_store:"
+ " number of axes in item variation store\n"
+ " "
+ " and `fvar' table are different\n" ));
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
+ if ( FT_NEW_ARRAY( itemStore->varRegionList, itemStore->regionCount ) )
+ goto Exit;
+
+ for ( i = 0; i < itemStore->regionCount; i++ )
+ {
+ GX_AxisCoords axisCoords;
+
+
+ if ( FT_NEW_ARRAY( itemStore->varRegionList[i].axisList,
+ itemStore->axisCount ) )
+ goto Exit;
+
+ axisCoords = itemStore->varRegionList[i].axisList;
+
+ for ( j = 0; j < itemStore->axisCount; j++ )
+ {
+ FT_Short start, peak, end;
+
+
+ if ( FT_READ_SHORT( start ) ||
+ FT_READ_SHORT( peak ) ||
+ FT_READ_SHORT( end ) )
+ goto Exit;
+
+ axisCoords[j].startCoord = FT_fdot14ToFixed( start );
+ axisCoords[j].peakCoord = FT_fdot14ToFixed( peak );
+ axisCoords[j].endCoord = FT_fdot14ToFixed( end );
+ }
+ }
+
+ /* end of region list parse */
+
+ /* use dataOffsetArray now to parse varData items */
+ if ( FT_NEW_ARRAY( itemStore->varData, itemStore->dataCount ) )
+ goto Exit;
+
+ for ( i = 0; i < itemStore->dataCount; i++ )
+ {
+ varData = &itemStore->varData[i];
+
+ if ( FT_STREAM_SEEK( offset + dataOffsetArray[i] ) )
+ goto Exit;
+
+ if ( FT_READ_USHORT( varData->itemCount ) ||
+ FT_READ_USHORT( shortDeltaCount ) ||
+ FT_READ_USHORT( varData->regionIdxCount ) )
+ goto Exit;
+
+ /* check some data consistency */
+ if ( shortDeltaCount > varData->regionIdxCount )
+ {
+ FT_TRACE2(( "bad short count %d or region count %d\n",
+ shortDeltaCount,
+ varData->regionIdxCount ));
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
+ if ( varData->regionIdxCount > itemStore->regionCount )
+ {
+ FT_TRACE2(( "inconsistent regionCount %d in varData[%d]\n",
+ varData->regionIdxCount,
+ i ));
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
+ /* parse region indices */
+ if ( FT_NEW_ARRAY( varData->regionIndices,
+ varData->regionIdxCount ) )
+ goto Exit;
+
+ for ( j = 0; j < varData->regionIdxCount; j++ )
+ {
+ if ( FT_READ_USHORT( varData->regionIndices[j] ) )
+ goto Exit;
+
+ if ( varData->regionIndices[j] >= itemStore->regionCount )
+ {
+ FT_TRACE2(( "bad region index %d\n",
+ varData->regionIndices[j] ));
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+ }
+
+ /* Parse delta set. */
+ /* */
+ /* On input, deltas are (shortDeltaCount + regionIdxCount) bytes */
+ /* each; on output, deltas are expanded to `regionIdxCount' shorts */
+ /* each. */
+ if ( FT_NEW_ARRAY( varData->deltaSet,
+ varData->regionIdxCount * varData->itemCount ) )
+ goto Exit;
+
+ /* the delta set is stored as a 2-dimensional array of shorts; */
+ /* sign-extend signed bytes to signed shorts */
+ for ( j = 0; j < varData->itemCount * varData->regionIdxCount; )
+ {
+ for ( k = 0; k < shortDeltaCount; k++, j++ )
+ {
+ /* read the short deltas */
+ FT_Short delta;
+
+
+ if ( FT_READ_SHORT( delta ) )
+ goto Exit;
+
+ varData->deltaSet[j] = delta;
+ }
+
+ for ( ; k < varData->regionIdxCount; k++, j++ )
+ {
+ /* read the (signed) byte deltas */
+ FT_Char delta;
+
+
+ if ( FT_READ_CHAR( delta ) )
+ goto Exit;
+
+ varData->deltaSet[j] = delta;
+ }
+ }
+ }
+
+ Exit:
+ FT_FREE( dataOffsetArray );
+
+ return error;
+ }
+
+
+ static FT_Error
+ ft_var_load_delta_set_index_mapping( TT_Face face,
+ FT_ULong offset,
+ GX_DeltaSetIdxMap map,
+ GX_ItemVarStore itemStore )
+ {
+ FT_Stream stream = FT_FACE_STREAM( face );
+ FT_Memory memory = stream->memory;
+
+ FT_Error error;
+
+ FT_UShort format;
+ FT_UInt entrySize;
+ FT_UInt innerBitCount;
+ FT_UInt innerIndexMask;
+ FT_UInt i, j;
+
+
+ if ( FT_STREAM_SEEK( offset ) ||
+ FT_READ_USHORT( format ) ||
+ FT_READ_USHORT( map->mapCount ) )
+ goto Exit;
+
+ if ( format & 0xFFC0 )
+ {
+ FT_TRACE2(( "bad map format %d\n", format ));
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
+ /* bytes per entry: 1, 2, 3, or 4 */
+ entrySize = ( ( format & 0x0030 ) >> 4 ) + 1;
+ innerBitCount = ( format & 0x000F ) + 1;
+ innerIndexMask = ( 1 << innerBitCount ) - 1;
+
+ if ( FT_NEW_ARRAY( map->innerIndex, map->mapCount ) )
+ goto Exit;
+
+ if ( FT_NEW_ARRAY( map->outerIndex, map->mapCount ) )
+ goto Exit;
+
+ for ( i = 0; i < map->mapCount; i++ )
+ {
+ FT_UInt mapData = 0;
+ FT_UInt outerIndex, innerIndex;
+
+
+ /* read map data one unsigned byte at a time, big endian */
+ for ( j = 0; j < entrySize; j++ )
+ {
+ FT_Byte data;
+
+
+ if ( FT_READ_BYTE( data ) )
+ goto Exit;
+
+ mapData = ( mapData << 8 ) | data;
+ }
+
+ outerIndex = mapData >> innerBitCount;
+
+ if ( outerIndex >= itemStore->dataCount )
+ {
+ FT_TRACE2(( "outerIndex[%d] == %d out of range\n",
+ i,
+ outerIndex ));
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
+ map->outerIndex[i] = outerIndex;
+
+ innerIndex = mapData & innerIndexMask;
+
+ if ( innerIndex >= itemStore->varData[outerIndex].itemCount )
+ {
+ FT_TRACE2(( "innerIndex[%d] == %d out of range\n",
+ i,
+ innerIndex ));
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
+ map->innerIndex[i] = innerIndex;
+ }
+
+ Exit:
+ return error;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* ft_var_load_hvvar */
+ /* */
+ /* <Description> */
+ /* If `vertical' is zero, parse the `HVAR' table and set */
+ /* `blend->hvar_loaded' to TRUE. On success, `blend->hvar_checked' */
+ /* is set to TRUE. */
+ /* */
+ /* If `vertical' is not zero, parse the `VVAR' table and set */
+ /* `blend->vvar_loaded' to TRUE. On success, `blend->vvar_checked' */
+ /* is set to TRUE. */
+ /* */
+ /* Some memory may remain allocated on error; it is always freed in */
+ /* `tt_done_blend', however. */
+ /* */
+ /* <InOut> */
+ /* face :: The font face. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ static FT_Error
+ ft_var_load_hvvar( TT_Face face,
+ FT_Bool vertical )
+ {
+ FT_Stream stream = FT_FACE_STREAM( face );
+ FT_Memory memory = stream->memory;
+
+ GX_Blend blend = face->blend;
+
+ GX_HVVarTable table;
+
+ FT_Error error;
+ FT_UShort majorVersion;
+ FT_ULong table_len;
+ FT_ULong table_offset;
+ FT_ULong store_offset;
+ FT_ULong widthMap_offset;
+
+
+ if ( vertical )
+ {
+ blend->vvar_loaded = TRUE;
+
+ FT_TRACE2(( "VVAR " ));
+
+ error = face->goto_table( face, TTAG_VVAR, stream, &table_len );
+ }
+ else
+ {
+ blend->hvar_loaded = TRUE;
+
+ FT_TRACE2(( "HVAR " ));
+
+ error = face->goto_table( face, TTAG_HVAR, stream, &table_len );
+ }
+
+ if ( error )
+ {
+ FT_TRACE2(( "is missing\n" ));
+ goto Exit;
+ }
+
+ table_offset = FT_STREAM_POS();
+
+ /* skip minor version */
+ if ( FT_READ_USHORT( majorVersion ) ||
+ FT_STREAM_SKIP( 2 ) )
+ goto Exit;
+
+ if ( majorVersion != 1 )
+ {
+ FT_TRACE2(( "bad table version %d\n", majorVersion ));
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
+ if ( FT_READ_ULONG( store_offset ) ||
+ FT_READ_ULONG( widthMap_offset ) )
+ goto Exit;
+
+ if ( vertical )
+ {
+ if ( FT_NEW( blend->vvar_table ) )
+ goto Exit;
+ table = blend->vvar_table;
+ }
+ else
+ {
+ if ( FT_NEW( blend->hvar_table ) )
+ goto Exit;
+ table = blend->hvar_table;
+ }
+
+ error = ft_var_load_item_variation_store(
+ face,
+ table_offset + store_offset,
+ &table->itemStore );
+ if ( error )
+ goto Exit;
+
+ if ( widthMap_offset )
+ {
+ error = ft_var_load_delta_set_index_mapping(
+ face,
+ table_offset + widthMap_offset,
+ &table->widthMap,
+ &table->itemStore );
+ if ( error )
+ goto Exit;
+ }
+
+ FT_TRACE2(( "loaded\n" ));
+ error = FT_Err_Ok;
+
+ Exit:
+ if ( !error )
+ {
+ if ( vertical )
+ {
+ blend->vvar_checked = TRUE;
+
+ /* FreeType doesn't provide functions to quickly retrieve */
+ /* TSB, BSB, or VORG values; we thus don't have to implement */
+ /* support for those three item variation stores. */
+
+ face->variation_support |= TT_FACE_FLAG_VAR_VADVANCE;
+ }
+ else
+ {
+ blend->hvar_checked = TRUE;
+
+ /* FreeType doesn't provide functions to quickly retrieve */
+ /* LSB or RSB values; we thus don't have to implement */
+ /* support for those two item variation stores. */
+
+ face->variation_support |= TT_FACE_FLAG_VAR_HADVANCE;
+ }
+ }
+
+ return error;
+ }
+
+
+ static FT_Int
+ ft_var_get_item_delta( TT_Face face,
+ GX_ItemVarStore itemStore,
+ FT_UInt outerIndex,
+ FT_UInt innerIndex )
+ {
+ GX_ItemVarData varData;
+ FT_Short* deltaSet;
+
+ FT_UInt master, j;
+ FT_Fixed netAdjustment = 0; /* accumulated adjustment */
+ FT_Fixed scaledDelta;
+ FT_Fixed delta;
+
+
+ /* See pseudo code from `Font Variations Overview' */
+ /* in the OpenType specification. */
+
+ varData = &itemStore->varData[outerIndex];
+ deltaSet = &varData->deltaSet[varData->regionIdxCount * innerIndex];
+
+ /* outer loop steps through master designs to be blended */
+ for ( master = 0; master < varData->regionIdxCount; master++ )
+ {
+ FT_Fixed scalar = FT_FIXED_ONE;
+ FT_UInt regionIndex = varData->regionIndices[master];
+
+ GX_AxisCoords axis = itemStore->varRegionList[regionIndex].axisList;
+
+
+ /* inner loop steps through axes in this region */
+ for ( j = 0; j < itemStore->axisCount; j++, axis++ )
+ {
+ FT_Fixed axisScalar;
+
+
+ /* compute the scalar contribution of this axis; */
+ /* ignore invalid ranges */
+ if ( axis->startCoord > axis->peakCoord ||
+ axis->peakCoord > axis->endCoord )
+ axisScalar = FT_FIXED_ONE;
+
+ else if ( axis->startCoord < 0 &&
+ axis->endCoord > 0 &&
+ axis->peakCoord != 0 )
+ axisScalar = FT_FIXED_ONE;
+
+ /* peak of 0 means ignore this axis */
+ else if ( axis->peakCoord == 0 )
+ axisScalar = FT_FIXED_ONE;
+
+ /* ignore this region if coords are out of range */
+ else if ( face->blend->normalizedcoords[j] < axis->startCoord ||
+ face->blend->normalizedcoords[j] > axis->endCoord )
+ axisScalar = 0;
+
+ /* calculate a proportional factor */
+ else
+ {
+ if ( face->blend->normalizedcoords[j] == axis->peakCoord )
+ axisScalar = FT_FIXED_ONE;
+ else if ( face->blend->normalizedcoords[j] < axis->peakCoord )
+ axisScalar =
+ FT_DivFix( face->blend->normalizedcoords[j] - axis->startCoord,
+ axis->peakCoord - axis->startCoord );
+ else
+ axisScalar =
+ FT_DivFix( axis->endCoord - face->blend->normalizedcoords[j],
+ axis->endCoord - axis->peakCoord );
+ }
+
+ /* take product of all the axis scalars */
+ scalar = FT_MulFix( scalar, axisScalar );
+
+ } /* per-axis loop */
+
+ /* get the scaled delta for this region */
+ delta = FT_intToFixed( deltaSet[master] );
+ scaledDelta = FT_MulFix( scalar, delta );
+
+ /* accumulate the adjustments from each region */
+ netAdjustment = netAdjustment + scaledDelta;
+
+ } /* per-region loop */
+
+ return FT_fixedToInt( netAdjustment );
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* tt_hvadvance_adjust */
+ /* */
+ /* <Description> */
+ /* Apply `HVAR' advance width or `VVAR' advance height adjustment of */
+ /* a given glyph. */
+ /* */
+ /* <Input> */
+ /* gindex :: The glyph index. */
+ /* */
+ /* vertical :: If set, handle `VVAR' table. */
+ /* */
+ /* <InOut> */
+ /* face :: The font face. */
+ /* */
+ /* adelta :: Points to width or height value that gets modified. */
+ /* */
+ static FT_Error
+ tt_hvadvance_adjust( TT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue,
+ FT_Bool vertical )
+ {
+ FT_Error error = FT_Err_Ok;
+ FT_UInt innerIndex, outerIndex;
+ FT_Int delta;
+
+ GX_HVVarTable table;
+
+
+ if ( !face->doblend || !face->blend )
+ goto Exit;
+
+ if ( vertical )
+ {
+ if ( !face->blend->vvar_loaded )
+ {
+ /* initialize vvar table */
+ face->blend->vvar_error = ft_var_load_hvvar( face, 1 );
+ }
+
+ if ( !face->blend->vvar_checked )
+ {
+ error = face->blend->vvar_error;
+ goto Exit;
+ }
+
+ table = face->blend->vvar_table;
+ }
+ else
+ {
+ if ( !face->blend->hvar_loaded )
+ {
+ /* initialize hvar table */
+ face->blend->hvar_error = ft_var_load_hvvar( face, 0 );
+ }
+
+ if ( !face->blend->hvar_checked )
+ {
+ error = face->blend->hvar_error;
+ goto Exit;
+ }
+
+ table = face->blend->hvar_table;
+ }
+
+ /* advance width or height adjustments are always present in an */
+ /* `HVAR' or `VVAR' table; no need to test for this capability */
+
+ if ( table->widthMap.innerIndex )
+ {
+ FT_UInt idx = gindex;
+
+
+ if ( idx >= table->widthMap.mapCount )
+ idx = table->widthMap.mapCount - 1;
+
+ /* trust that HVAR parser has checked indices */
+ outerIndex = table->widthMap.outerIndex[idx];
+ innerIndex = table->widthMap.innerIndex[idx];
+ }
+ else
+ {
+ GX_ItemVarData varData;
+
+
+ /* no widthMap data */
+ outerIndex = 0;
+ innerIndex = gindex;
+
+ varData = &table->itemStore.varData[outerIndex];
+ if ( gindex >= varData->itemCount )
+ {
+ FT_TRACE2(( "gindex %d out of range\n", gindex ));
+ error = FT_THROW( Invalid_Argument );
+ goto Exit;
+ }
+ }
+
+ delta = ft_var_get_item_delta( face,
+ &table->itemStore,
+ outerIndex,
+ innerIndex );
+
+ FT_TRACE5(( "%s value %d adjusted by %d units (%s)\n",
+ vertical ? "vertical height" : "horizontal width",
+ *avalue,
+ delta,
+ vertical ? "VVAR" : "HVAR" ));
+
+ *avalue += delta;
+
+ Exit:
+ return error;
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
+ tt_hadvance_adjust( TT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue )
+ {
+ return tt_hvadvance_adjust( face, gindex, avalue, 0 );
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
+ tt_vadvance_adjust( TT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue )
+ {
+ return tt_hvadvance_adjust( face, gindex, avalue, 1 );
+ }
+
+
+#define GX_VALUE_SIZE 8
+
+ /* all values are FT_Short or FT_UShort entities; */
+ /* we treat them consistently as FT_Short */
+#define GX_VALUE_CASE( tag, dflt ) \
+ case MVAR_TAG_ ## tag : \
+ p = (FT_Short*)&face->dflt; \
+ break
+
+#define GX_GASP_CASE( idx ) \
+ case MVAR_TAG_GASP_ ## idx : \
+ if ( idx < face->gasp.numRanges - 1 ) \
+ p = (FT_Short*)&face->gasp.gaspRanges[idx].maxPPEM; \
+ else \
+ p = NULL; \
+ break
+
+
+ static FT_Short*
+ ft_var_get_value_pointer( TT_Face face,
+ FT_ULong mvar_tag )
+ {
+ FT_Short* p;
+
+
+ switch ( mvar_tag )
+ {
+ GX_GASP_CASE( 0 );
+ GX_GASP_CASE( 1 );
+ GX_GASP_CASE( 2 );
+ GX_GASP_CASE( 3 );
+ GX_GASP_CASE( 4 );
+ GX_GASP_CASE( 5 );
+ GX_GASP_CASE( 6 );
+ GX_GASP_CASE( 7 );
+ GX_GASP_CASE( 8 );
+ GX_GASP_CASE( 9 );
+
+ GX_VALUE_CASE( CPHT, os2.sCapHeight );
+ GX_VALUE_CASE( HASC, os2.sTypoAscender );
+ GX_VALUE_CASE( HCLA, os2.usWinAscent );
+ GX_VALUE_CASE( HCLD, os2.usWinDescent );
+ GX_VALUE_CASE( HCOF, horizontal.caret_Offset );
+ GX_VALUE_CASE( HCRN, horizontal.caret_Slope_Run );
+ GX_VALUE_CASE( HCRS, horizontal.caret_Slope_Rise );
+ GX_VALUE_CASE( HDSC, os2.sTypoDescender );
+ GX_VALUE_CASE( HLGP, os2.sTypoLineGap );
+ GX_VALUE_CASE( SBXO, os2.ySubscriptXOffset);
+ GX_VALUE_CASE( SBXS, os2.ySubscriptXSize );
+ GX_VALUE_CASE( SBYO, os2.ySubscriptYOffset );
+ GX_VALUE_CASE( SBYS, os2.ySubscriptYSize );
+ GX_VALUE_CASE( SPXO, os2.ySuperscriptXOffset );
+ GX_VALUE_CASE( SPXS, os2.ySuperscriptXSize );
+ GX_VALUE_CASE( SPYO, os2.ySuperscriptYOffset );
+ GX_VALUE_CASE( SPYS, os2.ySuperscriptYSize );
+ GX_VALUE_CASE( STRO, os2.yStrikeoutPosition );
+ GX_VALUE_CASE( STRS, os2.yStrikeoutSize );
+ GX_VALUE_CASE( UNDO, postscript.underlinePosition );
+ GX_VALUE_CASE( UNDS, postscript.underlineThickness );
+ GX_VALUE_CASE( VASC, vertical.Ascender );
+ GX_VALUE_CASE( VCOF, vertical.caret_Offset );
+ GX_VALUE_CASE( VCRN, vertical.caret_Slope_Run );
+ GX_VALUE_CASE( VCRS, vertical.caret_Slope_Rise );
+ GX_VALUE_CASE( VDSC, vertical.Descender );
+ GX_VALUE_CASE( VLGP, vertical.Line_Gap );
+ GX_VALUE_CASE( XHGT, os2.sxHeight );
+
+ default:
+ /* ignore unknown tag */
+ p = NULL;
+ }
+
+ return p;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* ft_var_load_mvar */
+ /* */
+ /* <Description> */
+ /* Parse the `MVAR' table. */
+ /* */
+ /* Some memory may remain allocated on error; it is always freed in */
+ /* `tt_done_blend', however. */
+ /* */
+ /* <InOut> */
+ /* face :: The font face. */
+ /* */
+ static void
+ ft_var_load_mvar( TT_Face face )
+ {
+ FT_Stream stream = FT_FACE_STREAM( face );
+ FT_Memory memory = stream->memory;
+
+ GX_Blend blend = face->blend;
+ GX_ItemVarStore itemStore;
+ GX_Value value, limit;
+
+ FT_Error error;
+ FT_UShort majorVersion;
+ FT_ULong table_len;
+ FT_ULong table_offset;
+ FT_UShort store_offset;
+ FT_ULong records_offset;
+
+
+ FT_TRACE2(( "MVAR " ));
+
+ error = face->goto_table( face, TTAG_MVAR, stream, &table_len );
+ if ( error )
+ {
+ FT_TRACE2(( "is missing\n" ));
+ return;
+ }
+
+ table_offset = FT_STREAM_POS();
+
+ /* skip minor version */
+ if ( FT_READ_USHORT( majorVersion ) ||
+ FT_STREAM_SKIP( 2 ) )
+ return;
+
+ if ( majorVersion != 1 )
+ {
+ FT_TRACE2(( "bad table version %d\n", majorVersion ));
+ return;
+ }
+
+ if ( FT_NEW( blend->mvar_table ) )
+ return;
+
+ /* skip reserved entry and value record size */
+ if ( FT_STREAM_SKIP( 4 ) ||
+ FT_READ_USHORT( blend->mvar_table->valueCount ) ||
+ FT_READ_USHORT( store_offset ) )
+ return;
+
+ records_offset = FT_STREAM_POS();
+
+ error = ft_var_load_item_variation_store(
+ face,
+ table_offset + store_offset,
+ &blend->mvar_table->itemStore );
+ if ( error )
+ return;
+
+ if ( FT_NEW_ARRAY( blend->mvar_table->values,
+ blend->mvar_table->valueCount ) )
+ return;
+
+ if ( FT_STREAM_SEEK( records_offset ) ||
+ FT_FRAME_ENTER( blend->mvar_table->valueCount * GX_VALUE_SIZE ) )
+ return;
+
+ value = blend->mvar_table->values;
+ limit = value + blend->mvar_table->valueCount;
+ itemStore = &blend->mvar_table->itemStore;
+
+ for ( ; value < limit; value++ )
+ {
+ value->tag = FT_GET_ULONG();
+ value->outerIndex = FT_GET_USHORT();
+ value->innerIndex = FT_GET_USHORT();
+
+ if ( value->outerIndex >= itemStore->dataCount ||
+ value->innerIndex >= itemStore->varData[value->outerIndex]
+ .itemCount )
+ {
+ error = FT_THROW( Invalid_Table );
+ break;
+ }
+ }
+
+ FT_FRAME_EXIT();
+
+ if ( error )
+ return;
+
+ FT_TRACE2(( "loaded\n" ));
+
+ value = blend->mvar_table->values;
+ limit = value + blend->mvar_table->valueCount;
+
+ /* save original values of the data MVAR is going to modify */
+ for ( ; value < limit; value++ )
+ {
+ FT_Short* p = ft_var_get_value_pointer( face, value->tag );
+
+
+ if ( p )
+ value->unmodified = *p;
+#ifdef FT_DEBUG_LEVEL_TRACE
+ else
+ FT_TRACE1(( "ft_var_load_mvar: Ignoring unknown tag `%c%c%c%c'\n",
+ (FT_Char)( value->tag >> 24 ),
+ (FT_Char)( value->tag >> 16 ),
+ (FT_Char)( value->tag >> 8 ),
+ (FT_Char)( value->tag ) ));
+#endif
+ }
+
+ face->variation_support |= TT_FACE_FLAG_VAR_MVAR;
+ }
+
+
+ static FT_Error
+ tt_size_reset_iterator( FT_ListNode node,
+ void* user )
+ {
+ TT_Size size = (TT_Size)node->data;
+
+ FT_UNUSED( user );
+
+
+ tt_size_reset( size, 1 );
+
+ return FT_Err_Ok;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* tt_apply_mvar */
+ /* */
+ /* <Description> */
+ /* Apply `MVAR' table adjustments. */
+ /* */
+ /* <InOut> */
+ /* face :: The font face. */
+ /* */
+ FT_LOCAL_DEF( void )
+ tt_apply_mvar( TT_Face face )
+ {
+ GX_Blend blend = face->blend;
+ GX_Value value, limit;
+
+
+ if ( !( face->variation_support & TT_FACE_FLAG_VAR_MVAR ) )
+ return;
+
+ value = blend->mvar_table->values;
+ limit = value + blend->mvar_table->valueCount;
+
+ for ( ; value < limit; value++ )
+ {
+ FT_Short* p = ft_var_get_value_pointer( face, value->tag );
+ FT_Int delta;
+
+
+ delta = ft_var_get_item_delta( face,
+ &blend->mvar_table->itemStore,
+ value->outerIndex,
+ value->innerIndex );
+
+ if ( p )
+ {
+ FT_TRACE5(( "value %c%c%c%c (%d units) adjusted by %d units (MVAR)\n",
+ (FT_Char)( value->tag >> 24 ),
+ (FT_Char)( value->tag >> 16 ),
+ (FT_Char)( value->tag >> 8 ),
+ (FT_Char)( value->tag ),
+ value->unmodified,
+ delta ));
+
+ /* since we handle both signed and unsigned values as FT_Short, */
+ /* ensure proper overflow arithmetic */
+ *p = (FT_Short)( value->unmodified + (FT_Short)delta );
+ }
+ }
+
+ /* adjust all derived values */
+ {
+ FT_Face root = &face->root;
+
+
+ if ( face->os2.version != 0xFFFFU )
+ {
+ if ( face->os2.sTypoAscender || face->os2.sTypoDescender )
+ {
+ root->ascender = face->os2.sTypoAscender;
+ root->descender = face->os2.sTypoDescender;
+
+ root->height = root->ascender - root->descender +
+ face->os2.sTypoLineGap;
+ }
+ else
+ {
+ root->ascender = (FT_Short)face->os2.usWinAscent;
+ root->descender = -(FT_Short)face->os2.usWinDescent;
+
+ root->height = root->ascender - root->descender;
+ }
+ }
+
+ root->underline_position = face->postscript.underlinePosition -
+ face->postscript.underlineThickness / 2;
+ root->underline_thickness = face->postscript.underlineThickness;
+
+ /* iterate over all FT_Size objects and call `tt_size_reset' */
+ /* to propagate the metrics changes */
+ FT_List_Iterate( &root->sizes_list,
+ tt_size_reset_iterator,
+ NULL );
+ }
+ }
+
+
typedef struct GX_GVar_Head_
{
FT_Long version;
@@ -453,10 +1442,10 @@
FT_TRACE2(( "GVAR " ));
- if ( ( error = face->goto_table( face,
- TTAG_gvar,
- stream,
- &table_len ) ) != 0 )
+ if ( FT_SET_ERROR( face->goto_table( face,
+ TTAG_gvar,
+ stream,
+ &table_len ) ) )
{
FT_TRACE2(( "is missing\n" ));
goto Exit;
@@ -491,10 +1480,9 @@
goto Exit;
}
- /* rough sanity check: offsets can be either 2 or 4 bytes, */
- /* and a single variation needs at least 4 bytes per glyph */
+ /* rough sanity check: offsets can be either 2 or 4 bytes */
if ( (FT_ULong)gvar_head.glyphCount *
- ( ( gvar_head.flags & 1 ) ? 8 : 6 ) > table_len )
+ ( ( gvar_head.flags & 1 ) ? 4 : 2 ) > table_len )
{
FT_TRACE1(( "ft_var_load_gvar: invalid number of glyphs\n" ));
error = FT_THROW( Invalid_Table );
@@ -555,7 +1543,7 @@
{
blend->tuplecoords[i * gvar_head.axisCount + j] =
FT_GET_SHORT() * 4; /* convert to FT_Fixed */
- FT_TRACE5(( "%.4f ",
+ FT_TRACE5(( "%.5f ",
blend->tuplecoords[i * gvar_head.axisCount + j] / 65536.0 ));
}
FT_TRACE5(( "]\n" ));
@@ -611,10 +1599,10 @@
for ( i = 0; i < blend->num_axis; i++ )
{
- FT_TRACE6(( " axis coordinate %d (%.4f):\n",
+ FT_TRACE6(( " axis coordinate %d (%.5f):\n",
i, blend->normalizedcoords[i] / 65536.0 ));
if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )
- FT_TRACE6(( " intermediate coordinates %d (%.4f, %.4f):\n",
+ FT_TRACE6(( " intermediate coordinates %d (%.5f, %.5f):\n",
i,
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
@@ -639,7 +1627,7 @@
if ( blend->normalizedcoords[i] == tuple_coords[i] )
{
- FT_TRACE6(( " tuple coordinate value %.4f fits perfectly\n",
+ FT_TRACE6(( " tuple coordinate value %.5f fits perfectly\n",
tuple_coords[i] / 65536.0 ));
/* `apply' does not change */
continue;
@@ -652,13 +1640,13 @@
if ( blend->normalizedcoords[i] < FT_MIN( 0, tuple_coords[i] ) ||
blend->normalizedcoords[i] > FT_MAX( 0, tuple_coords[i] ) )
{
- FT_TRACE6(( " tuple coordinate value %.4f is exceeded, stop\n",
+ FT_TRACE6(( " tuple coordinate value %.5f is exceeded, stop\n",
tuple_coords[i] / 65536.0 ));
apply = 0;
break;
}
- FT_TRACE6(( " tuple coordinate value %.4f fits\n",
+ FT_TRACE6(( " tuple coordinate value %.5f fits\n",
tuple_coords[i] / 65536.0 ));
apply = FT_MulDiv( apply,
blend->normalizedcoords[i],
@@ -671,7 +1659,7 @@
if ( blend->normalizedcoords[i] < im_start_coords[i] ||
blend->normalizedcoords[i] > im_end_coords[i] )
{
- FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] is exceeded,"
+ FT_TRACE6(( " intermediate tuple range [%.5f;%.5f] is exceeded,"
" stop\n",
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
@@ -681,7 +1669,7 @@
else if ( blend->normalizedcoords[i] < tuple_coords[i] )
{
- FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n",
+ FT_TRACE6(( " intermediate tuple range [%.5f;%.5f] fits\n",
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
apply = FT_MulDiv( apply,
@@ -691,7 +1679,7 @@
else
{
- FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n",
+ FT_TRACE6(( " intermediate tuple range [%.5f;%.5f] fits\n",
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
apply = FT_MulDiv( apply,
@@ -701,12 +1689,196 @@
}
}
- FT_TRACE6(( " apply factor is %.4f\n", apply / 65536.0 ));
+ FT_TRACE6(( " apply factor is %.5f\n", apply / 65536.0 ));
return apply;
}
+ /* convert from design coordinates to normalized coordinates */
+
+ static void
+ ft_var_to_normalized( TT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords,
+ FT_Fixed* normalized )
+ {
+ GX_Blend blend;
+ FT_MM_Var* mmvar;
+ FT_UInt i, j;
+ FT_Var_Axis* a;
+ GX_AVarSegment av;
+
+
+ blend = face->blend;
+ mmvar = blend->mmvar;
+
+ if ( num_coords > mmvar->num_axis )
+ {
+ FT_TRACE2(( "ft_var_to_normalized:"
+ " only using first %d of %d coordinates\n",
+ mmvar->num_axis, num_coords ));
+ num_coords = mmvar->num_axis;
+ }
+
+ /* Axis normalization is a two-stage process. First we normalize */
+ /* based on the [min,def,max] values for the axis to be [-1,0,1]. */
+ /* Then, if there's an `avar' table, we renormalize this range. */
+
+ FT_TRACE5(( "design coordinates:\n" ));
+
+ a = mmvar->axis;
+ for ( i = 0; i < num_coords; i++, a++ )
+ {
+ FT_Fixed coord = coords[i];
+
+
+ FT_TRACE5(( " %.5f\n", coord / 65536.0 ));
+ if ( coord > a->maximum || coord < a->minimum )
+ {
+ FT_TRACE1((
+ "ft_var_to_normalized: design coordinate %.5f\n"
+ " is out of range [%.5f;%.5f]; clamping\n",
+ coord / 65536.0,
+ a->minimum / 65536.0,
+ a->maximum / 65536.0 ));
+
+ if ( coord > a->maximum)
+ coord = a->maximum;
+ else
+ coord = a->minimum;
+ }
+
+ if ( coord < a->def )
+ normalized[i] = -FT_DivFix( coords[i] - a->def,
+ a->minimum - a->def );
+ else if ( coord > a->def )
+ normalized[i] = FT_DivFix( coords[i] - a->def,
+ a->maximum - a->def );
+ else
+ normalized[i] = 0;
+ }
+
+ FT_TRACE5(( "\n" ));
+
+ for ( ; i < mmvar->num_axis; i++ )
+ normalized[i] = 0;
+
+ if ( blend->avar_segment )
+ {
+ FT_TRACE5(( "normalized design coordinates"
+ " before applying `avar' data:\n" ));
+
+ av = blend->avar_segment;
+ for ( i = 0; i < mmvar->num_axis; i++, av++ )
+ {
+ for ( j = 1; j < (FT_UInt)av->pairCount; j++ )
+ {
+ if ( normalized[i] < av->correspondence[j].fromCoord )
+ {
+ FT_TRACE5(( " %.5f\n", normalized[i] / 65536.0 ));
+
+ normalized[i] =
+ FT_MulDiv( normalized[i] - av->correspondence[j - 1].fromCoord,
+ av->correspondence[j].toCoord -
+ av->correspondence[j - 1].toCoord,
+ av->correspondence[j].fromCoord -
+ av->correspondence[j - 1].fromCoord ) +
+ av->correspondence[j - 1].toCoord;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+
+ /* convert from normalized coordinates to design coordinates */
+
+ static void
+ ft_var_to_design( TT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords,
+ FT_Fixed* design )
+ {
+ GX_Blend blend;
+ FT_MM_Var* mmvar;
+ FT_Var_Axis* a;
+
+ FT_UInt i, j, nc;
+
+
+ blend = face->blend;
+
+ nc = num_coords;
+ if ( num_coords > blend->num_axis )
+ {
+ FT_TRACE2(( "ft_var_to_design:"
+ " only using first %d of %d coordinates\n",
+ blend->num_axis, num_coords ));
+ nc = blend->num_axis;
+ }
+
+ if ( face->doblend )
+ {
+ for ( i = 0; i < nc; i++ )
+ design[i] = coords[i];
+ }
+ else
+ {
+ for ( i = 0; i < nc; i++ )
+ design[i] = 0;
+ }
+
+ for ( ; i < num_coords; i++ )
+ design[i] = 0;
+
+ if ( blend->avar_segment )
+ {
+ GX_AVarSegment av = blend->avar_segment;
+
+
+ FT_TRACE5(( "design coordinates"
+ " after removing `avar' distortion:\n" ));
+
+ for ( i = 0; i < nc; i++, av++ )
+ {
+ for ( j = 1; j < (FT_UInt)av->pairCount; j++ )
+ {
+ if ( design[i] < av->correspondence[j].toCoord )
+ {
+ design[i] =
+ FT_MulDiv( design[i] - av->correspondence[j - 1].toCoord,
+ av->correspondence[j].fromCoord -
+ av->correspondence[j - 1].fromCoord,
+ av->correspondence[j].toCoord -
+ av->correspondence[j - 1].toCoord ) +
+ av->correspondence[j - 1].fromCoord;
+
+ FT_TRACE5(( " %.5f\n", design[i] / 65536.0 ));
+ break;
+ }
+ }
+ }
+ }
+
+ mmvar = blend->mmvar;
+ a = mmvar->axis;
+
+ for ( i = 0; i < nc; i++, a++ )
+ {
+ if ( design[i] < 0 )
+ design[i] = a->def + FT_MulFix( design[i],
+ a->def - a->minimum );
+ else if ( design[i] > 0 )
+ design[i] = a->def + FT_MulFix( design[i],
+ a->maximum - a->def );
+ else
+ design[i] = a->def;
+ }
+ }
+
+
/*************************************************************************/
/*************************************************************************/
/***** *****/
@@ -720,7 +1892,6 @@
{
FT_Long version;
FT_UShort offsetToData;
- FT_UShort countSizePairs;
FT_UShort axisCount;
FT_UShort axisSize;
FT_UShort instanceCount;
@@ -748,7 +1919,8 @@
/* */
/* <Description> */
/* Check that the font's `fvar' table is valid, parse it, and return */
- /* those data. */
+ /* those data. It also loads (and parses) the `MVAR' table, if */
+ /* possible. */
/* */
/* <InOut> */
/* face :: The font face. */
@@ -770,13 +1942,17 @@
FT_ULong table_len;
FT_Error error = FT_Err_Ok;
FT_ULong fvar_start;
- FT_Int i, j;
+ FT_UInt i, j;
FT_MM_Var* mmvar = NULL;
FT_Fixed* next_coords;
+ FT_Fixed* nsc;
FT_String* next_name;
FT_Var_Axis* a;
+ FT_Fixed* c;
FT_Var_Named_Style* ns;
GX_FVar_Head fvar_head;
+ FT_Bool usePsName;
+ FT_UInt num_instances;
static const FT_Frame_Field fvar_fields[] =
{
@@ -785,13 +1961,13 @@
#define FT_STRUCTURE GX_FVar_Head
FT_FRAME_START( 16 ),
- FT_FRAME_LONG ( version ),
- FT_FRAME_USHORT( offsetToData ),
- FT_FRAME_USHORT( countSizePairs ),
- FT_FRAME_USHORT( axisCount ),
- FT_FRAME_USHORT( axisSize ),
- FT_FRAME_USHORT( instanceCount ),
- FT_FRAME_USHORT( instanceSize ),
+ FT_FRAME_LONG ( version ),
+ FT_FRAME_USHORT ( offsetToData ),
+ FT_FRAME_SKIP_SHORT,
+ FT_FRAME_USHORT ( axisCount ),
+ FT_FRAME_USHORT ( axisSize ),
+ FT_FRAME_USHORT ( instanceCount ),
+ FT_FRAME_USHORT ( instanceSize ),
FT_FRAME_END
};
@@ -815,21 +1991,26 @@
/* read the font data and set up the internal representation */
/* if not already done */
- if ( face->blend == NULL )
+ if ( !face->blend )
{
FT_TRACE2(( "FVAR " ));
/* both `fvar' and `gvar' must be present */
- if ( ( error = face->goto_table( face, TTAG_gvar,
- stream, &table_len ) ) != 0 )
+ if ( FT_SET_ERROR( face->goto_table( face, TTAG_gvar,
+ stream, &table_len ) ) )
{
- FT_TRACE1(( "\n"
- "TT_Get_MM_Var: `gvar' table is missing\n" ));
- goto Exit;
+ /* CFF2 is an alternate to gvar here */
+ if ( FT_SET_ERROR( face->goto_table( face, TTAG_CFF2,
+ stream, &table_len ) ) )
+ {
+ FT_TRACE1(( "\n"
+ "TT_Get_MM_Var: `gvar' or `CFF2' table is missing\n" ));
+ goto Exit;
+ }
}
- if ( ( error = face->goto_table( face, TTAG_fvar,
- stream, &table_len ) ) != 0 )
+ if ( FT_SET_ERROR( face->goto_table( face, TTAG_fvar,
+ stream, &table_len ) ) )
{
FT_TRACE1(( "is missing\n" ));
goto Exit;
@@ -837,30 +2018,13 @@
fvar_start = FT_STREAM_POS( );
+ /* the validity of the `fvar' header data was already checked */
+ /* in function `sfnt_init_face' */
if ( FT_STREAM_READ_FIELDS( fvar_fields, &fvar_head ) )
goto Exit;
- if ( fvar_head.version != (FT_Long)0x00010000L ||
-#if 0
- /* fonts like `JamRegular.ttf' have an incorrect value for */
- /* `countSizePairs'; since value 2 is hard-coded in `fvar' */
- /* version 1.0, we simply ignore it */
- fvar_head.countSizePairs != 2 ||
-#endif
- fvar_head.axisSize != 20 ||
- /* axisCount limit implied by 16-bit instanceSize */
- fvar_head.axisCount > 0x3FFE ||
- fvar_head.instanceSize != 4 + 4 * fvar_head.axisCount ||
- /* instanceCount limit implied by limited range of name IDs */
- fvar_head.instanceCount > 0x7EFF ||
- fvar_head.offsetToData + fvar_head.axisCount * 20U +
- fvar_head.instanceCount * fvar_head.instanceSize > table_len )
- {
- FT_TRACE1(( "\n"
- "TT_Get_MM_Var: invalid `fvar' header\n" ));
- error = FT_THROW( Invalid_Table );
- goto Exit;
- }
+ usePsName = FT_BOOL( fvar_head.instanceSize ==
+ 6 + 4 * fvar_head.axisCount );
FT_TRACE2(( "loaded\n" ));
@@ -869,12 +2033,18 @@
if ( FT_NEW( face->blend ) )
goto Exit;
- /* cannot overflow 32-bit arithmetic because of limits above */
+ /* `num_instances' holds the number of all named instances, */
+ /* including the default instance which might be missing */
+ /* in fvar's table of named instances */
+ num_instances = face->root.style_flags >> 16;
+
+ /* cannot overflow 32-bit arithmetic because of the size limits */
+ /* used in the `fvar' table validity check in `sfnt_init_face' */
face->blend->mmvar_len =
sizeof ( FT_MM_Var ) +
fvar_head.axisCount * sizeof ( FT_Var_Axis ) +
- fvar_head.instanceCount * sizeof ( FT_Var_Named_Style ) +
- fvar_head.instanceCount * fvar_head.axisCount * sizeof ( FT_Fixed ) +
+ num_instances * sizeof ( FT_Var_Named_Style ) +
+ num_instances * fvar_head.axisCount * sizeof ( FT_Fixed ) +
5 * fvar_head.axisCount;
if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) )
@@ -891,15 +2061,15 @@
/* may have a different number of designs */
/* (or tuples, as called by Apple) */
mmvar->num_namedstyles =
- fvar_head.instanceCount;
+ num_instances;
mmvar->axis =
(FT_Var_Axis*)&( mmvar[1] );
mmvar->namedstyle =
(FT_Var_Named_Style*)&( mmvar->axis[fvar_head.axisCount] );
next_coords =
- (FT_Fixed*)&( mmvar->namedstyle[fvar_head.instanceCount] );
- for ( i = 0; i < fvar_head.instanceCount; i++ )
+ (FT_Fixed*)&( mmvar->namedstyle[num_instances] );
+ for ( i = 0; i < num_instances; i++ )
{
mmvar->namedstyle[i].coords = next_coords;
next_coords += fvar_head.axisCount;
@@ -937,7 +2107,18 @@
a->name[3] = (FT_String)( ( a->tag ) & 0xFF );
a->name[4] = '\0';
- FT_TRACE5(( " \"%s\": minimum=%.4f, default=%.4f, maximum=%.4f\n",
+ if ( a->minimum > a->def ||
+ a->def > a->maximum )
+ {
+ FT_TRACE2(( "TT_Get_MM_Var:"
+ " invalid \"%s\" axis record; disabling\n",
+ a->name ));
+
+ a->minimum = a->def;
+ a->maximum = a->def;
+ }
+
+ FT_TRACE5(( " \"%s\": minimum=%.5f, default=%.5f, maximum=%.5f\n",
a->name,
a->minimum / 65536.0,
a->def / 65536.0,
@@ -948,25 +2129,99 @@
FT_TRACE5(( "\n" ));
- ns = mmvar->namedstyle;
+ /* named instance coordinates are stored as design coordinates; */
+ /* we have to convert them to normalized coordinates also */
+ if ( FT_NEW_ARRAY( face->blend->normalized_stylecoords,
+ fvar_head.axisCount * num_instances ) )
+ goto Exit;
+
+ if ( fvar_head.instanceCount && !face->blend->avar_loaded )
+ ft_var_load_avar( face );
+
+ ns = mmvar->namedstyle;
+ nsc = face->blend->normalized_stylecoords;
for ( i = 0; i < fvar_head.instanceCount; i++, ns++ )
{
- if ( FT_FRAME_ENTER( 4L + 4L * fvar_head.axisCount ) )
+ /* PostScript names add 2 bytes to the instance record size */
+ if ( FT_FRAME_ENTER( ( usePsName ? 6L : 4L ) +
+ 4L * fvar_head.axisCount ) )
goto Exit;
ns->strid = FT_GET_USHORT();
(void) /* flags = */ FT_GET_USHORT();
- for ( j = 0; j < fvar_head.axisCount; j++ )
- ns->coords[j] = FT_GET_LONG();
+ c = ns->coords;
+ for ( j = 0; j < fvar_head.axisCount; j++, c++ )
+ *c = FT_GET_LONG();
+
+ if ( usePsName )
+ ns->psid = FT_GET_USHORT();
+
+ ft_var_to_normalized( face,
+ fvar_head.axisCount,
+ ns->coords,
+ nsc );
+ nsc += fvar_head.axisCount;
FT_FRAME_EXIT();
}
+
+ if ( num_instances != fvar_head.instanceCount )
+ {
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
+
+ FT_Int found, dummy1, dummy2;
+ FT_UInt strid = 0xFFFFFFFFUL;
+
+
+ /* the default instance is missing in array the */
+ /* of named instances; try to synthesize an entry */
+ found = sfnt->get_name_id( face,
+ TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY,
+ &dummy1,
+ &dummy2 );
+ if ( found )
+ strid = TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY;
+ else
+ {
+ found = sfnt->get_name_id( face,
+ TT_NAME_ID_FONT_SUBFAMILY,
+ &dummy1,
+ &dummy2 );
+ if ( found )
+ strid = TT_NAME_ID_FONT_SUBFAMILY;
+ }
+
+ if ( found )
+ {
+ found = sfnt->get_name_id( face,
+ TT_NAME_ID_PS_NAME,
+ &dummy1,
+ &dummy2 );
+ if ( found )
+ {
+ FT_TRACE5(( "TT_Get_MM_Var:"
+ " Adding default instance to named instances\n" ));
+
+ ns = &mmvar->namedstyle[fvar_head.instanceCount];
+
+ ns->strid = strid;
+ ns->psid = TT_NAME_ID_PS_NAME;
+
+ a = mmvar->axis;
+ c = ns->coords;
+ for ( j = 0; j < fvar_head.axisCount; j++, a++, c++ )
+ *c = a->def;
+ }
+ }
+ }
+
+ ft_var_load_mvar( face );
}
/* fill the output array if requested */
- if ( master != NULL )
+ if ( master )
{
FT_UInt n;
@@ -1016,40 +2271,17 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Set_MM_Blend */
- /* */
- /* <Description> */
- /* Set the blend (normalized) coordinates for this instance of the */
- /* font. Check that the `gvar' table is reasonable and does some */
- /* initial preparation. */
- /* */
- /* <InOut> */
- /* face :: The font. */
- /* Initialize the blend structure with `gvar' data. */
- /* */
- /* <Input> */
- /* num_coords :: The number of available coordinates. If it is */
- /* larger than the number of axes, ignore the excess */
- /* values. If it is smaller than the number of axes, */
- /* use the default value (0) for the remaining axes. */
- /* */
- /* coords :: An array of `num_coords', each between [-1,1]. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- FT_LOCAL_DEF( FT_Error )
- TT_Set_MM_Blend( TT_Face face,
+ static FT_Error
+ tt_set_mm_blend( TT_Face face,
FT_UInt num_coords,
- FT_Fixed* coords )
+ FT_Fixed* coords,
+ FT_Bool set_design_coords )
{
FT_Error error = FT_Err_Ok;
GX_Blend blend;
FT_MM_Var* mmvar;
- FT_UInt i;
+ FT_UInt i, j;
+ FT_Bool is_default_instance = 1;
FT_Memory memory = face->root.memory;
enum
@@ -1063,9 +2295,9 @@
face->doblend = FALSE;
- if ( face->blend == NULL )
+ if ( !face->blend )
{
- if ( ( error = TT_Get_MM_Var( face, NULL ) ) != 0 )
+ if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
goto Exit;
}
@@ -1074,7 +2306,8 @@
if ( num_coords > mmvar->num_axis )
{
- FT_TRACE2(( "TT_Set_MM_Blend: only using first %d of %d coordinates\n",
+ FT_TRACE2(( "TT_Set_MM_Blend:"
+ " only using first %d of %d coordinates\n",
mmvar->num_axis, num_coords ));
num_coords = mmvar->num_axis;
}
@@ -1083,24 +2316,33 @@
for ( i = 0; i < num_coords; i++ )
{
- FT_TRACE5(( " %.4f\n", coords[i] / 65536.0 ));
+ FT_TRACE5(( " %.5f\n", coords[i] / 65536.0 ));
if ( coords[i] < -0x00010000L || coords[i] > 0x00010000L )
{
- FT_TRACE1(( "TT_Set_MM_Blend: normalized design coordinate %.4f\n"
+ FT_TRACE1(( "TT_Set_MM_Blend: normalized design coordinate %.5f\n"
" is out of range [-1;1]\n",
coords[i] / 65536.0 ));
error = FT_THROW( Invalid_Argument );
goto Exit;
}
+
+ if ( coords[i] != 0 )
+ is_default_instance = 0;
}
FT_TRACE5(( "\n" ));
- if ( blend->glyphoffsets == NULL )
- if ( ( error = ft_var_load_gvar( face ) ) != 0 )
+ if ( !face->is_cff2 && !blend->glyphoffsets )
+ if ( FT_SET_ERROR( ft_var_load_gvar( face ) ) )
+ goto Exit;
+
+ if ( !blend->coords )
+ {
+ if ( FT_NEW_ARRAY( blend->coords, mmvar->num_axis ) )
goto Exit;
+ }
- if ( blend->normalizedcoords == NULL )
+ if ( !blend->normalizedcoords )
{
if ( FT_NEW_ARRAY( blend->normalizedcoords, mmvar->num_axis ) )
goto Exit;
@@ -1144,9 +2386,15 @@
coords,
num_coords * sizeof ( FT_Fixed ) );
+ if ( set_design_coords )
+ ft_var_to_design( face,
+ num_coords,
+ blend->normalizedcoords,
+ blend->coords );
+
face->doblend = TRUE;
- if ( face->cvt != NULL )
+ if ( face->cvt )
{
switch ( manageCvt )
{
@@ -1171,6 +2419,36 @@
}
}
+ /* check whether the current variation tuple coincides */
+ /* with a named instance */
+
+ for ( i = 0; i < blend->mmvar->num_namedstyles; i++ )
+ {
+ FT_Fixed* nsc = blend->normalized_stylecoords + i * blend->num_axis;
+ FT_Fixed* ns = blend->normalizedcoords;
+
+
+ for ( j = 0; j < blend->num_axis; j++, nsc++, ns++ )
+ {
+ if ( *nsc != *ns )
+ break;
+ }
+
+ if ( j == blend->num_axis )
+ break;
+ }
+
+ /* adjust named instance index */
+ face->root.face_index &= 0xFFFF;
+ if ( i < blend->mmvar->num_namedstyles )
+ face->root.face_index |= ( i + 1 ) << 16;
+
+ face->is_default_instance = is_default_instance;
+
+ /* enforce recomputation of the PostScript name; */
+ FT_FREE( face->postscript_name );
+ face->postscript_name = NULL;
+
Exit:
return error;
}
@@ -1179,6 +2457,108 @@
/*************************************************************************/
/* */
/* <Function> */
+ /* TT_Set_MM_Blend */
+ /* */
+ /* <Description> */
+ /* Set the blend (normalized) coordinates for this instance of the */
+ /* font. Check that the `gvar' table is reasonable and does some */
+ /* initial preparation. */
+ /* */
+ /* <InOut> */
+ /* face :: The font. */
+ /* Initialize the blend structure with `gvar' data. */
+ /* */
+ /* <Input> */
+ /* num_coords :: The number of available coordinates. If it is */
+ /* larger than the number of axes, ignore the excess */
+ /* values. If it is smaller than the number of axes, */
+ /* use the default value (0) for the remaining axes. */
+ /* */
+ /* coords :: An array of `num_coords', each between [-1,1]. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_LOCAL_DEF( FT_Error )
+ TT_Set_MM_Blend( TT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ return tt_set_mm_blend( face, num_coords, coords, 1 );
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* TT_Get_MM_Blend */
+ /* */
+ /* <Description> */
+ /* Get the blend (normalized) coordinates for this instance of the */
+ /* font. */
+ /* */
+ /* <InOut> */
+ /* face :: The font. */
+ /* Initialize the blend structure with `gvar' data. */
+ /* */
+ /* <Input> */
+ /* num_coords :: The number of available coordinates. If it is */
+ /* larger than the number of axes, set the excess */
+ /* values to 0. */
+ /* */
+ /* coords :: An array of `num_coords', each between [-1,1]. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_LOCAL_DEF( FT_Error )
+ TT_Get_MM_Blend( TT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ FT_Error error = FT_Err_Ok;
+ GX_Blend blend;
+ FT_UInt i, nc;
+
+
+ if ( !face->blend )
+ {
+ if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
+ return error;
+ }
+
+ blend = face->blend;
+
+ nc = num_coords;
+ if ( num_coords > blend->num_axis )
+ {
+ FT_TRACE2(( "TT_Get_MM_Blend:"
+ " only using first %d of %d coordinates\n",
+ blend->num_axis, num_coords ));
+ nc = blend->num_axis;
+ }
+
+ if ( face->doblend )
+ {
+ for ( i = 0; i < nc; i++ )
+ coords[i] = blend->normalizedcoords[i];
+ }
+ else
+ {
+ for ( i = 0; i < nc; i++ )
+ coords[i] = 0;
+ }
+
+ for ( ; i < num_coords; i++ )
+ coords[i] = 0;
+
+ return FT_Err_Ok;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
/* TT_Set_Var_Design */
/* */
/* <Description> */
@@ -1206,19 +2586,21 @@
FT_UInt num_coords,
FT_Fixed* coords )
{
- FT_Error error = FT_Err_Ok;
- FT_Fixed* normalized = NULL;
- GX_Blend blend;
- FT_MM_Var* mmvar;
- FT_UInt i, j;
- FT_Var_Axis* a;
- GX_AVarSegment av;
- FT_Memory memory = face->root.memory;
+ FT_Error error = FT_Err_Ok;
+ GX_Blend blend;
+ FT_MM_Var* mmvar;
+ FT_UInt i;
+ FT_Memory memory = face->root.memory;
+
+ FT_Var_Axis* a;
+ FT_Fixed* c;
+ FT_Fixed* normalized = NULL;
- if ( face->blend == NULL )
+
+ if ( !face->blend )
{
- if ( ( error = TT_Get_MM_Var( face, NULL ) ) != 0 )
+ if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
goto Exit;
}
@@ -1233,79 +2615,101 @@
num_coords = mmvar->num_axis;
}
- /* Axis normalization is a two stage process. First we normalize */
- /* based on the [min,def,max] values for the axis to be [-1,0,1]. */
- /* Then, if there's an `avar' table, we renormalize this range. */
+ if ( !blend->coords )
+ {
+ if ( FT_NEW_ARRAY( blend->coords, mmvar->num_axis ) )
+ goto Exit;
+ }
+
+ FT_MEM_COPY( blend->coords,
+ coords,
+ num_coords * sizeof ( FT_Fixed ) );
+
+ a = mmvar->axis + num_coords;
+ c = coords + num_coords;
+ for ( i = num_coords; i < mmvar->num_axis; i++, a++, c++ )
+ *c = a->def;
if ( FT_NEW_ARRAY( normalized, mmvar->num_axis ) )
goto Exit;
- FT_TRACE5(( "design coordinates:\n" ));
+ if ( !face->blend->avar_loaded )
+ ft_var_load_avar( face );
- a = mmvar->axis;
- for ( i = 0; i < num_coords; i++, a++ )
- {
- FT_TRACE5(( " %.4f\n", coords[i] / 65536.0 ));
- if ( coords[i] > a->maximum || coords[i] < a->minimum )
- {
- FT_TRACE1(( "TT_Set_Var_Design: normalized design coordinate %.4f\n"
- " is out of range [%.4f;%.4f]\n",
- coords[i] / 65536.0,
- a->minimum / 65536.0,
- a->maximum / 65536.0 ));
- error = FT_THROW( Invalid_Argument );
- goto Exit;
- }
+ ft_var_to_normalized( face, num_coords, coords, normalized );
- if ( coords[i] < a->def )
- normalized[i] = -FT_DivFix( coords[i] - a->def,
- a->minimum - a->def );
- else if ( a->maximum == a->def )
- normalized[i] = 0;
- else
- normalized[i] = FT_DivFix( coords[i] - a->def,
- a->maximum - a->def );
- }
+ error = tt_set_mm_blend( face, mmvar->num_axis, normalized, 0 );
- FT_TRACE5(( "\n" ));
+ Exit:
+ FT_FREE( normalized );
+ return error;
+ }
- for ( ; i < mmvar->num_axis; i++ )
- normalized[i] = 0;
- if ( !blend->avar_checked )
- ft_var_load_avar( face );
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* TT_Get_Var_Design */
+ /* */
+ /* <Description> */
+ /* Get the design coordinates of the currently selected interpolated */
+ /* font. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* num_coords :: The number of design coordinates to retrieve. If it */
+ /* is larger than the number of axes, set the excess */
+ /* values to~0. */
+ /* */
+ /* <Output> */
+ /* coords :: The design coordinates array. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_LOCAL_DEF( FT_Error )
+ TT_Get_Var_Design( TT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ FT_Error error = FT_Err_Ok;
+ GX_Blend blend;
+ FT_UInt i, nc;
- if ( blend->avar_segment != NULL )
+
+ if ( !face->blend )
{
- FT_TRACE5(( "normalized design coordinates"
- " before applying `avar' data:\n" ));
+ if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
+ return error;
+ }
- av = blend->avar_segment;
- for ( i = 0; i < mmvar->num_axis; i++, av++ )
- {
- for ( j = 1; j < (FT_UInt)av->pairCount; j++ )
- {
- FT_TRACE5(( " %.4f\n", normalized[i] / 65536.0 ));
- if ( normalized[i] < av->correspondence[j].fromCoord )
- {
- normalized[i] =
- FT_MulDiv( normalized[i] - av->correspondence[j - 1].fromCoord,
- av->correspondence[j].toCoord -
- av->correspondence[j - 1].toCoord,
- av->correspondence[j].fromCoord -
- av->correspondence[j - 1].fromCoord ) +
- av->correspondence[j - 1].toCoord;
- break;
- }
- }
- }
+ blend = face->blend;
+
+ nc = num_coords;
+ if ( num_coords > blend->num_axis )
+ {
+ FT_TRACE2(( "TT_Get_Var_Design:"
+ " only using first %d of %d coordinates\n",
+ blend->num_axis, num_coords ));
+ nc = blend->num_axis;
}
- error = TT_Set_MM_Blend( face, mmvar->num_axis, normalized );
+ if ( face->doblend )
+ {
+ for ( i = 0; i < nc; i++ )
+ coords[i] = blend->coords[i];
+ }
+ else
+ {
+ for ( i = 0; i < nc; i++ )
+ coords[i] = 0;
+ }
- Exit:
- FT_FREE( normalized );
- return error;
+ for ( ; i < num_coords; i++ )
+ coords[i] = 0;
+
+ return FT_Err_Ok;
}
@@ -1362,7 +2766,7 @@
FT_TRACE2(( "CVAR " ));
- if ( blend == NULL )
+ if ( !blend )
{
FT_TRACE2(( "\n"
"tt_face_vary_cvt: no blend specified\n" ));
@@ -1370,7 +2774,7 @@
goto Exit;
}
- if ( face->cvt == NULL )
+ if ( !face->cvt )
{
FT_TRACE2(( "\n"
"tt_face_vary_cvt: no `cvt ' table\n" ));
@@ -1413,7 +2817,8 @@
offsetToData = FT_GET_USHORT();
/* rough sanity test */
- if ( offsetToData + tupleCount * 4 > table_len )
+ if ( offsetToData + ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) * 4 >
+ table_len )
{
FT_TRACE2(( "tt_face_vary_cvt:"
" invalid CVT variation array header\n" ));
@@ -1497,7 +2902,7 @@
table_len,
point_count == 0 ? face->cvt_size
: point_count );
- if ( localpoints == NULL || deltas == NULL )
+ if ( !localpoints || !deltas )
; /* failure, ignore it */
else if ( localpoints == ALL_POINTS )
@@ -1545,10 +2950,15 @@
for ( j = 0; j < point_count; j++ )
{
- int pindex = localpoints[j];
- FT_Long orig_cvt = face->cvt[pindex];
+ int pindex;
+ FT_Long orig_cvt;
+ pindex = localpoints[j];
+ if ( (FT_ULong)pindex >= face->cvt_size )
+ continue;
+
+ orig_cvt = face->cvt[pindex];
face->cvt[pindex] = (FT_Short)( orig_cvt +
FT_MulFix( deltas[j], apply ) );
@@ -1671,25 +3081,12 @@
d1 = out1 - in1;
d2 = out2 - in2;
- if ( out1 == out2 || in1 == in2 )
- {
- for ( p = p1; p <= p2; p++ )
- {
- out = in_points[p].x;
-
- if ( out <= in1 )
- out += d1;
- else if ( out >= in2 )
- out += d2;
- else
- out = out1;
-
- out_points[p].x = out;
- }
- }
- else
+ /* If the reference points have the same coordinate but different */
+ /* delta, inferred delta is zero. Otherwise interpolate. */
+ if ( in1 != in2 || out1 == out2 )
{
- FT_Fixed scale = FT_DivFix( out2 - out1, in2 - in1 );
+ FT_Fixed scale = in1 != in2 ? FT_DivFix( out2 - out1, in2 - in1 )
+ : 0;
for ( p = p1; p <= p2; p++ )
@@ -1716,12 +3113,11 @@
/* modeled after `Ins_IUP */
static void
- tt_handle_deltas( FT_Outline* outline,
- FT_Vector* in_points,
- FT_Bool* has_delta )
+ tt_interpolate_deltas( FT_Outline* outline,
+ FT_Vector* out_points,
+ FT_Vector* in_points,
+ FT_Bool* has_delta )
{
- FT_Vector* out_points;
-
FT_Int first_point;
FT_Int end_point;
@@ -1736,8 +3132,6 @@
if ( !outline->n_contours )
return;
- out_points = outline->points;
-
contour = 0;
point = 0;
@@ -1841,6 +3235,7 @@
GX_Blend blend = face->blend;
FT_Vector* points_org = NULL;
+ FT_Vector* points_out = NULL;
FT_Bool* has_delta = NULL;
FT_Error error;
@@ -1859,7 +3254,7 @@
FT_Short *deltas_x, *deltas_y;
- if ( !face->doblend || blend == NULL )
+ if ( !face->doblend || !blend )
return FT_THROW( Invalid_Argument );
if ( glyph_index >= blend->gv_glyphcnt ||
@@ -1872,6 +3267,7 @@
}
if ( FT_NEW_ARRAY( points_org, n_points ) ||
+ FT_NEW_ARRAY( points_out, n_points ) ||
FT_NEW_ARRAY( has_delta, n_points ) )
goto Fail1;
@@ -1894,7 +3290,8 @@
offsetToData = FT_GET_USHORT();
/* rough sanity test */
- if ( offsetToData + tupleCount * 4 > blend->gvar_size )
+ if ( offsetToData + ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) * 4 >
+ blend->gvar_size )
{
FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
" invalid glyph variation array header\n" ));
@@ -1922,6 +3319,9 @@
FT_TRACE5(( "gvar: there are %d tuples:\n",
tupleCount & GX_TC_TUPLE_COUNT_MASK ));
+ for ( j = 0; j < n_points; j++ )
+ points_org[j] = outline->points[j];
+
for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); i++ )
{
FT_UInt tupleDataSize;
@@ -1976,10 +3376,10 @@
here = FT_Stream_FTell( stream );
+ FT_Stream_SeekSet( stream, offsetToData );
+
if ( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS )
{
- FT_Stream_SeekSet( stream, offsetToData );
-
localpoints = ft_var_readpackedpoints( stream,
blend->gvar_size,
&point_count );
@@ -2000,7 +3400,7 @@
point_count == 0 ? n_points
: point_count );
- if ( points == NULL || deltas_y == NULL || deltas_x == NULL )
+ if ( !points || !deltas_y || !deltas_x )
; /* failure, ignore it */
else if ( points == ALL_POINTS )
@@ -2015,22 +3415,48 @@
/* this means that there are deltas for every point in the glyph */
for ( j = 0; j < n_points; j++ )
{
-#ifdef FT_DEBUG_LEVEL_TRACE
- FT_Vector point_org = outline->points[j];
-#endif
+ FT_Pos delta_x = FT_MulFix( deltas_x[j], apply );
+ FT_Pos delta_y = FT_MulFix( deltas_y[j], apply );
- outline->points[j].x += FT_MulFix( deltas_x[j], apply );
- outline->points[j].y += FT_MulFix( deltas_y[j], apply );
+ if ( j < n_points - 3 )
+ {
+ outline->points[j].x += delta_x;
+ outline->points[j].y += delta_y;
+ }
+ else
+ {
+ /* To avoid double adjustment of advance width or height, */
+ /* adjust phantom points only if there is no HVAR or VVAR */
+ /* support, respectively. */
+ if ( j == ( n_points - 3 ) &&
+ !( face->variation_support &
+ TT_FACE_FLAG_VAR_HADVANCE ) )
+ outline->points[j].x += delta_x;
+
+ else if ( j == ( n_points - 2 ) &&
+ !( face->variation_support &
+ TT_FACE_FLAG_VAR_LSB ) )
+ outline->points[j].x += delta_x;
+
+ else if ( j == ( n_points - 1 ) &&
+ !( face->variation_support &
+ TT_FACE_FLAG_VAR_VADVANCE ) )
+ outline->points[j].y += delta_y;
+
+ else if ( j == ( n_points - 0 ) &&
+ !( face->variation_support &
+ TT_FACE_FLAG_VAR_TSB ) )
+ outline->points[j].y += delta_y;
+ }
#ifdef FT_DEBUG_LEVEL_TRACE
- if ( ( point_org.x != outline->points[j].x ) ||
- ( point_org.y != outline->points[j].y ) )
+ if ( delta_x || delta_y )
{
FT_TRACE7(( " %d: (%d, %d) -> (%d, %d)\n",
j,
- point_org.x,
- point_org.y,
+ outline->points[j].x - delta_x,
+ outline->points[j].y - delta_y,
outline->points[j].x,
outline->points[j].y ));
count++;
@@ -2044,9 +3470,6 @@
#endif
}
- else if ( localpoints == NULL )
- ; /* failure, ignore it */
-
else
{
#ifdef FT_DEBUG_LEVEL_TRACE
@@ -2058,13 +3481,13 @@
/* IUP bytecode instruction */
for ( j = 0; j < n_points; j++ )
{
- points_org[j] = outline->points[j];
has_delta[j] = FALSE;
+ points_out[j] = points_org[j];
}
for ( j = 0; j < point_count; j++ )
{
- FT_UShort idx = localpoints[j];
+ FT_UShort idx = points[j];
if ( idx >= n_points )
@@ -2072,34 +3495,43 @@
has_delta[idx] = TRUE;
- outline->points[idx].x += FT_MulFix( deltas_x[j], apply );
- outline->points[idx].y += FT_MulFix( deltas_y[j], apply );
+ points_out[idx].x += FT_MulFix( deltas_x[j], apply );
+ points_out[idx].y += FT_MulFix( deltas_y[j], apply );
}
/* no need to handle phantom points here, */
/* since solitary points can't be interpolated */
- tt_handle_deltas( outline,
- points_org,
- has_delta );
+ tt_interpolate_deltas( outline,
+ points_out,
+ points_org,
+ has_delta );
-#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE7(( " point deltas:\n" ));
- for ( j = 0; j < n_points; j++)
+ for ( j = 0; j < n_points; j++ )
{
- if ( ( points_org[j].x != outline->points[j].x ) ||
- ( points_org[j].y != outline->points[j].y ) )
+ FT_Pos delta_x = points_out[j].x - points_org[j].x;
+ FT_Pos delta_y = points_out[j].y - points_org[j].y;
+
+
+ outline->points[j].x += delta_x;
+ outline->points[j].y += delta_y;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( delta_x || delta_y )
{
FT_TRACE7(( " %d: (%d, %d) -> (%d, %d)\n",
j,
- points_org[j].x,
- points_org[j].y,
+ outline->points[j].x - delta_x,
+ outline->points[j].y - delta_y,
outline->points[j].x,
outline->points[j].y ));
count++;
}
+#endif
}
+#ifdef FT_DEBUG_LEVEL_TRACE
if ( !count )
FT_TRACE7(( " none\n" ));
#endif
@@ -2128,6 +3560,7 @@
Fail1:
FT_FREE( points_org );
+ FT_FREE( points_out );
FT_FREE( has_delta );
return error;
@@ -2137,37 +3570,150 @@
/*************************************************************************/
/* */
/* <Function> */
+ /* tt_get_var_blend */
+ /* */
+ /* <Description> */
+ /* An extended internal version of `TT_Get_MM_Blend' that returns */
+ /* pointers instead of copying data, without any initialization of */
+ /* the MM machinery in case it isn't loaded yet. */
+ /* */
+ FT_LOCAL_DEF( FT_Error )
+ tt_get_var_blend( TT_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords,
+ FT_Fixed* *normalizedcoords,
+ FT_MM_Var* *mm_var )
+ {
+ if ( face->blend )
+ {
+ if ( num_coords )
+ *num_coords = face->blend->num_axis;
+ if ( coords )
+ *coords = face->blend->coords;
+ if ( normalizedcoords )
+ *normalizedcoords = face->blend->normalizedcoords;
+ if ( mm_var )
+ *mm_var = face->blend->mmvar;
+ }
+ else
+ {
+ if ( num_coords )
+ *num_coords = 0;
+ if ( coords )
+ *coords = NULL;
+ if ( mm_var )
+ *mm_var = NULL;
+ }
+
+ return FT_Err_Ok;
+ }
+
+
+ static void
+ ft_var_done_item_variation_store( TT_Face face,
+ GX_ItemVarStore itemStore )
+ {
+ FT_Memory memory = FT_FACE_MEMORY( face );
+ FT_UInt i;
+
+
+ if ( itemStore->varData )
+ {
+ for ( i = 0; i < itemStore->dataCount; i++ )
+ {
+ FT_FREE( itemStore->varData[i].regionIndices );
+ FT_FREE( itemStore->varData[i].deltaSet );
+ }
+
+ FT_FREE( itemStore->varData );
+ }
+
+ if ( itemStore->varRegionList )
+ {
+ for ( i = 0; i < itemStore->regionCount; i++ )
+ FT_FREE( itemStore->varRegionList[i].axisList );
+
+ FT_FREE( itemStore->varRegionList );
+ }
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
/* tt_done_blend */
/* */
/* <Description> */
/* Free the blend internal data structure. */
/* */
FT_LOCAL_DEF( void )
- tt_done_blend( FT_Memory memory,
- GX_Blend blend )
+ tt_done_blend( TT_Face face )
{
- if ( blend != NULL )
+ FT_Memory memory = FT_FACE_MEMORY( face );
+ GX_Blend blend = face->blend;
+
+
+ if ( blend )
{
- FT_UInt i;
+ FT_UInt i, num_axes;
+ /* blend->num_axis might not be set up yet */
+ num_axes = blend->mmvar->num_axis;
+
+ FT_FREE( blend->coords );
FT_FREE( blend->normalizedcoords );
+ FT_FREE( blend->normalized_stylecoords );
FT_FREE( blend->mmvar );
- if ( blend->avar_segment != NULL )
+ if ( blend->avar_segment )
{
- for ( i = 0; i < blend->num_axis; i++ )
+ for ( i = 0; i < num_axes; i++ )
FT_FREE( blend->avar_segment[i].correspondence );
FT_FREE( blend->avar_segment );
}
+ if ( blend->hvar_table )
+ {
+ ft_var_done_item_variation_store( face,
+ &blend->hvar_table->itemStore );
+
+ FT_FREE( blend->hvar_table->widthMap.innerIndex );
+ FT_FREE( blend->hvar_table->widthMap.outerIndex );
+ FT_FREE( blend->hvar_table );
+ }
+
+ if ( blend->vvar_table )
+ {
+ ft_var_done_item_variation_store( face,
+ &blend->vvar_table->itemStore );
+
+ FT_FREE( blend->vvar_table->widthMap.innerIndex );
+ FT_FREE( blend->vvar_table->widthMap.outerIndex );
+ FT_FREE( blend->vvar_table );
+ }
+
+ if ( blend->mvar_table )
+ {
+ ft_var_done_item_variation_store( face,
+ &blend->mvar_table->itemStore );
+
+ FT_FREE( blend->mvar_table->values );
+ FT_FREE( blend->mvar_table );
+ }
+
FT_FREE( blend->tuplecoords );
FT_FREE( blend->glyphoffsets );
FT_FREE( blend );
}
}
-#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+#else /* !TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _tt_gxvar_dummy;
+
+#endif /* !TT_CONFIG_OPTION_GX_VAR_SUPPORT */
/* END */
diff --git a/thirdparty/freetype/src/truetype/ttgxvar.h b/thirdparty/freetype/src/truetype/ttgxvar.h
index aa8f6ea592..7e81719a3e 100644
--- a/thirdparty/freetype/src/truetype/ttgxvar.h
+++ b/thirdparty/freetype/src/truetype/ttgxvar.h
@@ -4,7 +4,7 @@
/* */
/* TrueType GX Font Variation loader (specification) */
/* */
-/* Copyright 2004-2016 by */
+/* Copyright 2004-2017 by */
/* David Turner, Robert Wilhelm, Werner Lemberg and George Williams. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -61,6 +61,152 @@ FT_BEGIN_HEADER
} GX_AVarSegmentRec, *GX_AVarSegment;
+ typedef struct GX_ItemVarDataRec_
+ {
+ FT_UInt itemCount; /* number of delta sets per item */
+ FT_UInt regionIdxCount; /* number of region indices in this data */
+ FT_UInt* regionIndices; /* array of `regionCount' indices; */
+ /* these index `varRegionList' */
+ FT_Short* deltaSet; /* array of `itemCount' deltas */
+ /* use `innerIndex' for this array */
+
+ } GX_ItemVarDataRec, *GX_ItemVarData;
+
+
+ /* contribution of one axis to a region */
+ typedef struct GX_AxisCoordsRec_
+ {
+ FT_Fixed startCoord;
+ FT_Fixed peakCoord; /* zero means no effect (factor = 1) */
+ FT_Fixed endCoord;
+
+ } GX_AxisCoordsRec, *GX_AxisCoords;
+
+
+ typedef struct GX_VarRegionRec_
+ {
+ GX_AxisCoords axisList; /* array of axisCount records */
+
+ } GX_VarRegionRec, *GX_VarRegion;
+
+
+ /* item variation store */
+ typedef struct GX_ItemVarStoreRec_
+ {
+ FT_UInt dataCount;
+ GX_ItemVarData varData; /* array of dataCount records; */
+ /* use `outerIndex' for this array */
+ FT_UShort axisCount;
+ FT_UInt regionCount; /* total number of regions defined */
+ GX_VarRegion varRegionList;
+
+ } GX_ItemVarStoreRec, *GX_ItemVarStore;
+
+
+ typedef struct GX_DeltaSetIdxMapRec_
+ {
+ FT_UInt mapCount;
+ FT_UInt* outerIndex; /* indices to item var data */
+ FT_UInt* innerIndex; /* indices to delta set */
+
+ } GX_DeltaSetIdxMapRec, *GX_DeltaSetIdxMap;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* GX_HVVarTableRec */
+ /* */
+ /* <Description> */
+ /* Data from either the `HVAR' or `VVAR' table. */
+ /* */
+ typedef struct GX_HVVarTableRec_
+ {
+ GX_ItemVarStoreRec itemStore; /* Item Variation Store */
+ GX_DeltaSetIdxMapRec widthMap; /* Advance Width Mapping */
+
+#if 0
+ GX_DeltaSetIdxMapRec lsbMap; /* not implemented */
+ GX_DeltaSetIdxMapRec rsbMap; /* not implemented */
+
+ GX_DeltaSetIdxMapRec tsbMap; /* not implemented */
+ GX_DeltaSetIdxMapRec bsbMap; /* not implemented */
+ GX_DeltaSetIdxMapRec vorgMap; /* not implemented */
+#endif
+
+ } GX_HVVarTableRec, *GX_HVVarTable;
+
+
+#define MVAR_TAG_GASP_0 FT_MAKE_TAG( 'g', 's', 'p', '0' )
+#define MVAR_TAG_GASP_1 FT_MAKE_TAG( 'g', 's', 'p', '1' )
+#define MVAR_TAG_GASP_2 FT_MAKE_TAG( 'g', 's', 'p', '2' )
+#define MVAR_TAG_GASP_3 FT_MAKE_TAG( 'g', 's', 'p', '3' )
+#define MVAR_TAG_GASP_4 FT_MAKE_TAG( 'g', 's', 'p', '4' )
+#define MVAR_TAG_GASP_5 FT_MAKE_TAG( 'g', 's', 'p', '5' )
+#define MVAR_TAG_GASP_6 FT_MAKE_TAG( 'g', 's', 'p', '6' )
+#define MVAR_TAG_GASP_7 FT_MAKE_TAG( 'g', 's', 'p', '7' )
+#define MVAR_TAG_GASP_8 FT_MAKE_TAG( 'g', 's', 'p', '8' )
+#define MVAR_TAG_GASP_9 FT_MAKE_TAG( 'g', 's', 'p', '9' )
+
+#define MVAR_TAG_CPHT FT_MAKE_TAG( 'c', 'p', 'h', 't' )
+#define MVAR_TAG_HASC FT_MAKE_TAG( 'h', 'a', 's', 'c' )
+#define MVAR_TAG_HCLA FT_MAKE_TAG( 'h', 'c', 'l', 'a' )
+#define MVAR_TAG_HCLD FT_MAKE_TAG( 'h', 'c', 'l', 'd' )
+#define MVAR_TAG_HCOF FT_MAKE_TAG( 'h', 'c', 'o', 'f' )
+#define MVAR_TAG_HCRN FT_MAKE_TAG( 'h', 'c', 'r', 'n' )
+#define MVAR_TAG_HCRS FT_MAKE_TAG( 'h', 'c', 'r', 's' )
+#define MVAR_TAG_HDSC FT_MAKE_TAG( 'h', 'd', 's', 'c' )
+#define MVAR_TAG_HLGP FT_MAKE_TAG( 'h', 'l', 'g', 'p' )
+#define MVAR_TAG_SBXO FT_MAKE_TAG( 's', 'b', 'x', 'o' )
+#define MVAR_TAG_SBXS FT_MAKE_TAG( 's', 'b', 'x', 's' )
+#define MVAR_TAG_SBYO FT_MAKE_TAG( 's', 'b', 'y', 'o' )
+#define MVAR_TAG_SBYS FT_MAKE_TAG( 's', 'b', 'y', 's' )
+#define MVAR_TAG_SPXO FT_MAKE_TAG( 's', 'p', 'x', 'o' )
+#define MVAR_TAG_SPXS FT_MAKE_TAG( 's', 'p', 'x', 's' )
+#define MVAR_TAG_SPYO FT_MAKE_TAG( 's', 'p', 'y', 'o' )
+#define MVAR_TAG_SPYS FT_MAKE_TAG( 's', 'p', 'y', 's' )
+#define MVAR_TAG_STRO FT_MAKE_TAG( 's', 't', 'r', 'o' )
+#define MVAR_TAG_STRS FT_MAKE_TAG( 's', 't', 'r', 's' )
+#define MVAR_TAG_UNDO FT_MAKE_TAG( 'u', 'n', 'd', 'o' )
+#define MVAR_TAG_UNDS FT_MAKE_TAG( 'u', 'n', 'd', 's' )
+#define MVAR_TAG_VASC FT_MAKE_TAG( 'v', 'a', 's', 'c' )
+#define MVAR_TAG_VCOF FT_MAKE_TAG( 'v', 'c', 'o', 'f' )
+#define MVAR_TAG_VCRN FT_MAKE_TAG( 'v', 'c', 'r', 'n' )
+#define MVAR_TAG_VCRS FT_MAKE_TAG( 'v', 'c', 'r', 's' )
+#define MVAR_TAG_VDSC FT_MAKE_TAG( 'v', 'd', 's', 'c' )
+#define MVAR_TAG_VLGP FT_MAKE_TAG( 'v', 'l', 'g', 'p' )
+#define MVAR_TAG_XHGT FT_MAKE_TAG( 'x', 'h', 'g', 't' )
+
+
+ typedef struct GX_ValueRec_
+ {
+ FT_ULong tag;
+ FT_UShort outerIndex;
+ FT_UShort innerIndex;
+
+ FT_Short unmodified; /* values are either FT_Short or FT_UShort */
+
+ } GX_ValueRec, *GX_Value;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* GX_MVarTableRec */
+ /* */
+ /* <Description> */
+ /* Data from the `MVAR' table. */
+ /* */
+ typedef struct GX_MVarTableRec_
+ {
+ FT_UShort valueCount;
+
+ GX_ItemVarStoreRec itemStore; /* Item Variation Store */
+ GX_Value values; /* Value Records */
+
+ } GX_MVarTableRec, *GX_MVarTable;
+
+
/*************************************************************************/
/* */
/* <Struct> */
@@ -68,32 +214,120 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Data for interpolating a font from a distortable font specified */
- /* by the GX *var tables ([fgca]var). */
+ /* by the GX *var tables ([fgcahvm]var). */
/* */
/* <Fields> */
- /* num_axis :: The number of axes along which interpolation */
- /* may happen */
+ /* num_axis :: */
+ /* The number of axes along which interpolation may happen. */
+ /* */
+ /* coords :: */
+ /* An array of design coordinates (in user space) indicating the */
+ /* contribution along each axis to the final interpolated font. */
+ /* `normalizedcoords' holds the same values. */
+ /* */
+ /* normalizedcoords :: */
+ /* An array of normalized values (between [-1,1]) indicating the */
+ /* contribution along each axis to the final interpolated font. */
+ /* `coords' holds the same values. */
+ /* */
+ /* mmvar :: */
+ /* Data from the `fvar' table. */
+ /* */
+ /* mmvar_len :: */
+ /* The length of the `mmvar' structure. */
+ /* */
+ /* normalized_stylecoords :: */
+ /* A two-dimensional array that holds the named instance data from */
+ /* `mmvar' as normalized values. */
+ /* */
+ /* avar_loaded :: */
+ /* A Boolean; if set, FreeType tried to load (and parse) the `avar' */
+ /* table. */
+ /* */
+ /* avar_segment :: */
+ /* Data from the `avar' table. */
+ /* */
+ /* hvar_loaded :: */
+ /* A Boolean; if set, FreeType tried to load (and parse) the `hvar' */
+ /* table. */
+ /* */
+ /* hvar_checked :: */
+ /* A Boolean; if set, FreeType successfully loaded and parsed the */
+ /* `hvar' table. */
+ /* */
+ /* hvar_error :: */
+ /* If loading and parsing of the `hvar' table failed, this field */
+ /* holds the corresponding error code. */
+ /* */
+ /* hvar_table :: */
+ /* Data from the `hvar' table. */
+ /* */
+ /* vvar_loaded :: */
+ /* A Boolean; if set, FreeType tried to load (and parse) the `vvar' */
+ /* table. */
+ /* */
+ /* vvar_checked :: */
+ /* A Boolean; if set, FreeType successfully loaded and parsed the */
+ /* `vvar' table. */
+ /* */
+ /* vvar_error :: */
+ /* If loading and parsing of the `vvar' table failed, this field */
+ /* holds the corresponding error code. */
+ /* */
+ /* vvar_table :: */
+ /* Data from the `vvar' table. */
+ /* */
+ /* mvar_table :: */
+ /* Data from the `mvar' table. */
+ /* */
+ /* tuplecount :: */
+ /* The number of shared tuples in the `gvar' table. */
+ /* */
+ /* tuplecoords :: */
+ /* A two-dimensional array that holds the shared tuple coordinates */
+ /* in the `gvar' table. */
/* */
- /* normalizedcoords :: A normalized value (between [-1,1]) indicating */
- /* the contribution along each axis to the final */
- /* interpolated font. */
+ /* gv_glyphcnt :: */
+ /* The number of glyphs handled in the `gvar' table. */
+ /* */
+ /* glyphoffsets :: */
+ /* Offsets into the glyph variation data array. */
+ /* */
+ /* gvar_size :: */
+ /* The size of the `gvar' table. */
/* */
typedef struct GX_BlendRec_
{
FT_UInt num_axis;
+ FT_Fixed* coords;
FT_Fixed* normalizedcoords;
FT_MM_Var* mmvar;
FT_Offset mmvar_len;
- FT_Bool avar_checked;
- GX_AVarSegment avar_segment;
+ FT_Fixed* normalized_stylecoords;
+ /* normalized_stylecoords[num_namedstyles][num_axis] */
+
+ FT_Bool avar_loaded;
+ GX_AVarSegment avar_segment; /* avar_segment[num_axis] */
+
+ FT_Bool hvar_loaded;
+ FT_Bool hvar_checked;
+ FT_Error hvar_error;
+ GX_HVVarTable hvar_table;
+
+ FT_Bool vvar_loaded;
+ FT_Bool vvar_checked;
+ FT_Error vvar_error;
+ GX_HVVarTable vvar_table;
- FT_UInt tuplecount; /* shared tuples in `gvar' */
- FT_Fixed* tuplecoords; /* tuplecoords[tuplecount][num_axis] */
+ GX_MVarTable mvar_table;
+
+ FT_UInt tuplecount;
+ FT_Fixed* tuplecoords; /* tuplecoords[tuplecount][num_axis] */
FT_UInt gv_glyphcnt;
- FT_ULong* glyphoffsets;
+ FT_ULong* glyphoffsets; /* glyphoffsets[gv_glyphcnt + 1] */
FT_ULong gvar_size;
@@ -149,6 +383,11 @@ FT_BEGIN_HEADER
FT_Fixed* coords );
FT_LOCAL( FT_Error )
+ TT_Get_MM_Blend( TT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+ FT_LOCAL( FT_Error )
TT_Set_Var_Design( TT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
@@ -157,6 +396,10 @@ FT_BEGIN_HEADER
TT_Get_MM_Var( TT_Face face,
FT_MM_Var* *master );
+ FT_LOCAL( FT_Error )
+ TT_Get_Var_Design( TT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
FT_LOCAL( FT_Error )
tt_face_vary_cvt( TT_Face face,
@@ -169,10 +412,28 @@ FT_BEGIN_HEADER
FT_Outline* outline,
FT_UInt n_points );
+ FT_LOCAL( FT_Error )
+ tt_hadvance_adjust( TT_Face face,
+ FT_UInt gindex,
+ FT_Int *adelta );
+
+ FT_LOCAL( FT_Error )
+ tt_vadvance_adjust( TT_Face face,
+ FT_UInt gindex,
+ FT_Int *adelta );
+
+ FT_LOCAL( void )
+ tt_apply_mvar( TT_Face face );
+
+ FT_LOCAL( FT_Error )
+ tt_get_var_blend( TT_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords,
+ FT_Fixed* *normalizedcoords,
+ FT_MM_Var* *mm_var );
FT_LOCAL( void )
- tt_done_blend( FT_Memory memory,
- GX_Blend blend );
+ tt_done_blend( TT_Face face );
FT_END_HEADER
diff --git a/thirdparty/freetype/src/truetype/ttinterp.c b/thirdparty/freetype/src/truetype/ttinterp.c
index 8fe83c5ea8..af31408cbf 100644
--- a/thirdparty/freetype/src/truetype/ttinterp.c
+++ b/thirdparty/freetype/src/truetype/ttinterp.c
@@ -4,7 +4,7 @@
/* */
/* TrueType bytecode interpreter (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -26,10 +26,14 @@
#include FT_TRIGONOMETRY_H
#include FT_SYSTEM_H
#include FT_TRUETYPE_DRIVER_H
+#include FT_MULTIPLE_MASTERS_H
#include "ttinterp.h"
#include "tterrors.h"
#include "ttsubpix.h"
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include "ttgxvar.h"
+#endif
#ifdef TT_USE_BYTECODE_INTERPRETER
@@ -125,7 +129,7 @@
coderange = &exec->codeRangeTable[range - 1];
- FT_ASSERT( coderange->base != NULL );
+ FT_ASSERT( coderange->base );
/* NOTE: Because the last instruction of a program may be a CALL */
/* which will return to the first byte *after* the code */
@@ -396,8 +400,9 @@
exec->maxIDefs = size->max_instruction_defs;
exec->FDefs = size->function_defs;
exec->IDefs = size->instruction_defs;
+ exec->pointSize = size->point_size;
exec->tt_metrics = size->ttmetrics;
- exec->metrics = size->metrics;
+ exec->metrics = *size->metrics;
exec->maxFunc = size->max_func;
exec->maxIns = size->max_ins;
@@ -418,7 +423,7 @@
/* In case of multi-threading it can happen that the old size object */
/* no longer exists, thus we must clear all glyph zone references. */
- ft_memset( &exec->zp0, 0, sizeof ( exec->zp0 ) );
+ FT_ZERO( &exec->zp0 );
exec->zp1 = exec->zp0;
exec->zp2 = exec->zp0;
}
@@ -681,17 +686,17 @@
/* IUP[0] */ PACK( 0, 0 ),
/* IUP[1] */ PACK( 0, 0 ),
- /* SHP[0] */ PACK( 0, 0 ),
- /* SHP[1] */ PACK( 0, 0 ),
+ /* SHP[0] */ PACK( 0, 0 ), /* loops */
+ /* SHP[1] */ PACK( 0, 0 ), /* loops */
/* SHC[0] */ PACK( 1, 0 ),
/* SHC[1] */ PACK( 1, 0 ),
/* SHZ[0] */ PACK( 1, 0 ),
/* SHZ[1] */ PACK( 1, 0 ),
- /* SHPIX */ PACK( 1, 0 ),
- /* IP */ PACK( 0, 0 ),
+ /* SHPIX */ PACK( 1, 0 ), /* loops */
+ /* IP */ PACK( 0, 0 ), /* loops */
/* MSIRP[0] */ PACK( 2, 0 ),
/* MSIRP[1] */ PACK( 2, 0 ),
- /* AlignRP */ PACK( 0, 0 ),
+ /* AlignRP */ PACK( 0, 0 ), /* loops */
/* RTDG */ PACK( 0, 0 ),
/* MIAP[0] */ PACK( 2, 0 ),
/* MIAP[1] */ PACK( 2, 0 ),
@@ -764,7 +769,7 @@
/* SANGW */ PACK( 1, 0 ),
/* AA */ PACK( 1, 0 ),
- /* FlipPT */ PACK( 0, 0 ),
+ /* FlipPT */ PACK( 0, 0 ), /* loops */
/* FlipRgON */ PACK( 2, 0 ),
/* FlipRgOFF */ PACK( 2, 0 ),
/* INS_$83 */ PACK( 0, 0 ),
@@ -782,8 +787,8 @@
/* INS_$8F */ PACK( 0, 0 ),
/* INS_$90 */ PACK( 0, 0 ),
- /* INS_$91 */ PACK( 0, 0 ),
- /* INS_$92 */ PACK( 0, 0 ),
+ /* GETVAR */ PACK( 0, 0 ), /* will be handled specially */
+ /* GETDATA */ PACK( 0, 1 ),
/* INS_$93 */ PACK( 0, 0 ),
/* INS_$94 */ PACK( 0, 0 ),
/* INS_$95 */ PACK( 0, 0 ),
@@ -1065,8 +1070,13 @@
"7 INS_$8F",
"7 INS_$90",
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ "6 GETVAR",
+ "7 GETDATA",
+#else
"7 INS_$91",
"7 INS_$92",
+#endif
"7 INS_$93",
"7 INS_$94",
"7 INS_$95",
@@ -1603,7 +1613,7 @@
range = &exc->codeRangeTable[aRange - 1];
- if ( range->base == NULL ) /* invalid coderange */
+ if ( !range->base ) /* invalid coderange */
{
exc->error = FT_THROW( Invalid_CodeRange );
return FAILURE;
@@ -1646,7 +1656,7 @@
/* zone :: The affected glyph zone. */
/* */
/* <Note> */
- /* See `ttinterp.h' for details on backwards compatibility mode. */
+ /* See `ttinterp.h' for details on backward compatibility mode. */
/* `Touches' the point. */
/* */
static void
@@ -1674,7 +1684,7 @@
/* Exception to the post-IUP curfew: Allow the x component of */
/* diagonal moves, but only post-IUP. DejaVu tries to adjust */
/* diagonal stems like on `Z' and `z' post-IUP. */
- if ( SUBPIXEL_HINTING_MINIMAL && !exc->backwards_compatibility )
+ if ( SUBPIXEL_HINTING_MINIMAL && !exc->backward_compatibility )
zone->cur[point].x += FT_MulDiv( distance, v, exc->F_dot_P );
else
#endif
@@ -1690,10 +1700,10 @@
if ( v != 0 )
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- if ( !( SUBPIXEL_HINTING_MINIMAL &&
- exc->backwards_compatibility &&
- exc->iupx_called &&
- exc->iupy_called ) )
+ if ( !( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility &&
+ exc->iupx_called &&
+ exc->iupy_called ) )
#endif
zone->cur[point].y += FT_MulDiv( distance, v, exc->F_dot_P );
@@ -1746,7 +1756,7 @@
/* */
/* The following versions are used whenever both vectors are both */
/* along one of the coordinate unit vectors, i.e. in 90% of the cases. */
- /* See `ttinterp.h' for details on backwards compatibility mode. */
+ /* See `ttinterp.h' for details on backward compatibility mode. */
/* */
/*************************************************************************/
@@ -1764,7 +1774,7 @@
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- if ( SUBPIXEL_HINTING_MINIMAL && !exc->backwards_compatibility )
+ if ( SUBPIXEL_HINTING_MINIMAL && !exc->backward_compatibility )
zone->cur[point].x += distance;
else
#endif
@@ -1786,7 +1796,7 @@
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
if ( !( SUBPIXEL_HINTING_MINIMAL &&
- exc->backwards_compatibility &&
+ exc->backward_compatibility &&
exc->iupx_called && exc->iupy_called ) )
#endif
zone->cur[point].y += distance;
@@ -2574,13 +2584,20 @@
Ins_MPS( TT_ExecContext exc,
FT_Long* args )
{
- /* Note: The point size should be irrelevant in a given font program; */
- /* we thus decide to return only the PPEM value. */
-#if 0
- args[0] = exc->metrics.pointSize;
-#else
- args[0] = exc->func_cur_ppem( exc );
-#endif
+ if ( NO_SUBPIXEL_HINTING )
+ {
+ /* Microsoft's GDI bytecode interpreter always returns value 12; */
+ /* we return the current PPEM value instead. */
+ args[0] = exc->func_cur_ppem( exc );
+ }
+ else
+ {
+ /* A possible practical application of the MPS instruction is to */
+ /* implement optical scaling and similar features, which should be */
+ /* based on perceptual attributes, thus independent of the */
+ /* resolution. */
+ args[0] = exc->pointSize;
+ }
}
@@ -2873,7 +2890,7 @@
/* */
/* NEG[]: NEGate */
/* Opcode range: 0x65 */
- /* Stack: f26.6 --> f26.6 */
+ /* Stack: f26.6 --> f26.6 */
/* */
static void
Ins_NEG( FT_Long* args )
@@ -3113,7 +3130,7 @@
/*************************************************************************/
/* */
/* MAX[]: MAXimum */
- /* Opcode range: 0x68 */
+ /* Opcode range: 0x8B */
/* Stack: int32? int32? --> int32 */
/* */
static void
@@ -3127,7 +3144,7 @@
/*************************************************************************/
/* */
/* MIN[]: MINimum */
- /* Opcode range: 0x69 */
+ /* Opcode range: 0x8C */
/* Stack: int32? int32? --> int32 */
/* */
static void
@@ -3371,13 +3388,27 @@
FT_Long* args )
{
if ( args[0] == 0 && exc->args == 0 )
+ {
exc->error = FT_THROW( Bad_Argument );
+ return;
+ }
+
exc->IP += args[0];
if ( exc->IP < 0 ||
( exc->callTop > 0 &&
exc->IP > exc->callStack[exc->callTop - 1].Def->end ) )
+ {
exc->error = FT_THROW( Bad_Argument );
+ return;
+ }
+
exc->step_ins = FALSE;
+
+ if ( args[0] < 0 )
+ {
+ if ( ++exc->neg_jump_counter > exc->neg_jump_counter_max )
+ exc->error = FT_THROW( Execution_Too_Long );
+ }
}
@@ -3533,6 +3564,13 @@
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
+ /* FDEF is only allowed in `prep' or `fpgm' */
+ if ( exc->curRange == tt_coderange_glyph )
+ {
+ exc->error = FT_THROW( DEF_In_Glyf_Bytecode );
+ return;
+ }
+
/* some font programs are broken enough to redefine functions! */
/* We will then parse the current table. */
@@ -3932,6 +3970,10 @@
Ins_Goto_CodeRange( exc, def->range, def->start );
exc->step_ins = FALSE;
+
+ exc->loopcall_counter += (FT_ULong)args[0];
+ if ( exc->loopcall_counter > exc->loopcall_counter_max )
+ exc->error = FT_THROW( Execution_Too_Long );
}
return;
@@ -3955,6 +3997,13 @@
TT_DefRecord* limit;
+ /* we enable IDEF only in `prep' or `fpgm' */
+ if ( exc->curRange == tt_coderange_glyph )
+ {
+ exc->error = FT_THROW( DEF_In_Glyf_Bytecode );
+ return;
+ }
+
/* First of all, look for the same function in our table */
def = exc->IDefs;
@@ -4002,6 +4051,7 @@
exc->error = FT_THROW( Nested_DEFS );
return;
case 0x2D: /* ENDF */
+ def->end = exc->IP;
return;
}
}
@@ -4485,7 +4535,7 @@
/* */
/* FLIPOFF[]: Set auto-FLIP to OFF */
/* Opcode range: 0x4E */
- /* Stack: --> */
+ /* Stack: --> */
/* */
static void
Ins_FLIPOFF( TT_ExecContext exc )
@@ -5076,11 +5126,11 @@
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* Native ClearType fonts sign a waiver that turns off all backwards */
+ /* Native ClearType fonts sign a waiver that turns off all backward */
/* compatibility hacks and lets them program points to the grid like */
/* it's 1996. They might sign a waiver for just one glyph, though. */
if ( SUBPIXEL_HINTING_MINIMAL )
- exc->backwards_compatibility = !FT_BOOL( L == 4 );
+ exc->backward_compatibility = !FT_BOOL( L == 4 );
#endif
}
}
@@ -5137,14 +5187,14 @@
/* */
/* SCANTYPE[]: SCAN TYPE */
/* Opcode range: 0x8D */
- /* Stack: uint32? --> */
+ /* Stack: uint16 --> */
/* */
static void
Ins_SCANTYPE( TT_ExecContext exc,
FT_Long* args )
{
if ( args[0] >= 0 )
- exc->GS.scan_type = (FT_Int)args[0];
+ exc->GS.scan_type = (FT_Int)args[0] & 0xFFFF;
}
@@ -5168,11 +5218,11 @@
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* See `ttinterp.h' for details on backwards compatibility mode. */
- if ( SUBPIXEL_HINTING_MINIMAL &&
- exc->backwards_compatibility &&
- exc->iupx_called &&
- exc->iupy_called )
+ /* See `ttinterp.h' for details on backward compatibility mode. */
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility &&
+ exc->iupx_called &&
+ exc->iupy_called )
goto Fail;
#endif
@@ -5223,11 +5273,11 @@
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* See `ttinterp.h' for details on backwards compatibility mode. */
- if ( SUBPIXEL_HINTING_MINIMAL &&
- exc->backwards_compatibility &&
- exc->iupx_called &&
- exc->iupy_called )
+ /* See `ttinterp.h' for details on backward compatibility mode. */
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility &&
+ exc->iupx_called &&
+ exc->iupy_called )
return;
#endif
@@ -5261,11 +5311,11 @@
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* See `ttinterp.h' for details on backwards compatibility mode. */
- if ( SUBPIXEL_HINTING_MINIMAL &&
- exc->backwards_compatibility &&
- exc->iupx_called &&
- exc->iupy_called )
+ /* See `ttinterp.h' for details on backward compatibility mode. */
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility &&
+ exc->iupx_called &&
+ exc->iupy_called )
return;
#endif
@@ -5328,7 +5378,7 @@
}
- /* See `ttinterp.h' for details on backwards compatibility mode. */
+ /* See `ttinterp.h' for details on backward compatibility mode. */
static void
Move_Zp2_Point( TT_ExecContext exc,
FT_UShort point,
@@ -5339,8 +5389,8 @@
if ( exc->GS.freeVector.x != 0 )
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- if ( !( SUBPIXEL_HINTING_MINIMAL &&
- exc->backwards_compatibility ) )
+ if ( !( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility ) )
#endif
exc->zp2.cur[point].x += dx;
@@ -5351,10 +5401,10 @@
if ( exc->GS.freeVector.y != 0 )
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- if ( !( SUBPIXEL_HINTING_MINIMAL &&
- exc->backwards_compatibility &&
- exc->iupx_called &&
- exc->iupy_called ) )
+ if ( !( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility &&
+ exc->iupx_called &&
+ exc->iupy_called ) )
#endif
exc->zp2.cur[point].y += dy;
@@ -5541,9 +5591,9 @@
FT_Int B1, B2;
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- FT_Bool in_twilight = exc->GS.gep0 == 0 || \
- exc->GS.gep1 == 0 || \
- exc->GS.gep2 == 0;
+ FT_Bool in_twilight = FT_BOOL( exc->GS.gep0 == 0 ||
+ exc->GS.gep1 == 0 ||
+ exc->GS.gep2 == 0 );
#endif
@@ -5651,14 +5701,14 @@
else
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- if ( SUBPIXEL_HINTING_MINIMAL &&
- exc->backwards_compatibility )
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility )
{
/* Special case: allow SHPIX to move points in the twilight zone. */
/* Otherwise, treat SHPIX the same as DELTAP. Unbreaks various */
/* fonts such as older versions of Rokkitt and DTL Argo T Light */
- /* that would glitch severly after calling ALIGNRP after a blocked */
- /* SHPIX. */
+ /* that would glitch severely after calling ALIGNRP after a */
+ /* blocked SHPIX. */
if ( in_twilight ||
( !( exc->iupx_called && exc->iupy_called ) &&
( ( exc->is_composite && exc->GS.freeVector.y != 0 ) ||
@@ -6088,7 +6138,6 @@
exc->GS.freeVector.x != 0 &&
!( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
control_value_cutin = minimum_distance = 0;
- else
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
/* XXX: UNDOCUMENTED! cvt[-1] = 0 always */
@@ -6417,7 +6466,7 @@
R.x = FT_MulDiv( val, dax, discriminant );
R.y = FT_MulDiv( val, day, discriminant );
- /* XXX: Block in backwards_compatibility and/or post-IUP? */
+ /* XXX: Block in backward_compatibility and/or post-IUP? */
exc->zp2.cur[point].x = exc->zp1.cur[a0].x + R.x;
exc->zp2.cur[point].y = exc->zp1.cur[a0].y + R.y;
}
@@ -6425,7 +6474,7 @@
{
/* else, take the middle of the middles of A and B */
- /* XXX: Block in backwards_compatibility and/or post-IUP? */
+ /* XXX: Block in backward_compatibility and/or post-IUP? */
exc->zp2.cur[point].x = ( exc->zp1.cur[a0].x +
exc->zp1.cur[a1].x +
exc->zp0.cur[b0].x +
@@ -6502,7 +6551,9 @@
* Otherwise, by definition, the value of exc->twilight.orus[n] is (0,0),
* for every n.
*/
- twilight = exc->GS.gep0 == 0 || exc->GS.gep1 == 0 || exc->GS.gep2 == 0;
+ twilight = ( exc->GS.gep0 == 0 ||
+ exc->GS.gep1 == 0 ||
+ exc->GS.gep2 == 0 );
if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) )
{
@@ -6550,7 +6601,7 @@
cur_range = PROJECT( &exc->zp1.cur[exc->GS.rp2], cur_base );
}
- for ( ; exc->GS.loop > 0; --exc->GS.loop )
+ for ( ; exc->GS.loop > 0; exc->GS.loop-- )
{
FT_UInt point = (FT_UInt)exc->stack[--exc->args];
FT_F26Dot6 org_dist, cur_dist, new_dist;
@@ -6815,11 +6866,11 @@
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* See `ttinterp.h' for details on backwards compatibility mode. */
+ /* See `ttinterp.h' for details on backward compatibility mode. */
/* Allow IUP until it has been called on both axes. Immediately */
/* return on subsequent ones. */
- if ( SUBPIXEL_HINTING_MINIMAL &&
- exc->backwards_compatibility )
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility )
{
if ( exc->iupx_called && exc->iupy_called )
return;
@@ -7061,10 +7112,10 @@
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* See `ttinterp.h' for details on backwards compatibility */
- /* mode. */
- if ( SUBPIXEL_HINTING_MINIMAL &&
- exc->backwards_compatibility )
+ /* See `ttinterp.h' for details on backward compatibility */
+ /* mode. */
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility )
{
if ( !( exc->iupx_called && exc->iupy_called ) &&
( ( exc->is_composite && exc->GS.freeVector.y != 0 ) ||
@@ -7208,7 +7259,7 @@
{
if ( exc->ignore_x_mode )
{
- /* if in ClearType backwards compatibility mode, */
+ /* if in ClearType backward compatibility mode, */
/* we sometimes change the TrueType version dynamically */
K = exc->rasterizer_version;
FT_TRACE6(( "Setting rasterizer version %d\n",
@@ -7228,7 +7279,7 @@
/* Return Bit(s): 8 */
/* */
if ( ( args[0] & 2 ) != 0 && exc->tt_metrics.rotated )
- K |= 0x80;
+ K |= 1 << 8;
/********************************/
/* GLYPH STRETCHED */
@@ -7236,7 +7287,18 @@
/* Return Bit(s): 9 */
/* */
if ( ( args[0] & 4 ) != 0 && exc->tt_metrics.stretched )
- K |= 1 << 8;
+ K |= 1 << 9;
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /********************************/
+ /* VARIATION GLYPH */
+ /* Selector Bit: 3 */
+ /* Return Bit(s): 10 */
+ /* */
+ /* XXX: UNDOCUMENTED! */
+ if ( (args[0] & 8 ) != 0 && exc->face->blend )
+ K |= 1 << 10;
+#endif
/********************************/
/* BI-LEVEL HINTING AND */
@@ -7380,6 +7442,57 @@
}
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+ /*************************************************************************/
+ /* */
+ /* GETVARIATION[]: get normalized variation (blend) coordinates */
+ /* Opcode range: 0x91 */
+ /* Stack: --> f2.14... */
+ /* */
+ /* XXX: UNDOCUMENTED! There is no official documentation from Apple for */
+ /* this bytecode instruction. Active only if a font has GX */
+ /* variation axes. */
+ /* */
+ static void
+ Ins_GETVARIATION( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ FT_UInt num_axes = exc->face->blend->num_axis;
+ FT_Fixed* coords = exc->face->blend->normalizedcoords;
+
+ FT_UInt i;
+
+
+ if ( BOUNDS( num_axes, exc->stackSize + 1 - exc->top ) )
+ {
+ exc->error = FT_THROW( Stack_Overflow );
+ return;
+ }
+
+ for ( i = 0; i < num_axes; i++ )
+ args[i] = coords[i] >> 2; /* convert 16.16 to 2.14 format */
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* GETDATA[]: no idea what this is good for */
+ /* Opcode range: 0x92 */
+ /* Stack: --> 17 */
+ /* */
+ /* XXX: UNDOCUMENTED! There is no documentation from Apple for this */
+ /* very weird bytecode instruction. */
+ /* */
+ static void
+ Ins_GETDATA( FT_Long* args )
+ {
+ args[0] = 17;
+ }
+
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
+
static void
Ins_UNKNOWN( TT_ExecContext exc )
{
@@ -7453,7 +7566,8 @@
FT_EXPORT_DEF( FT_Error )
TT_RunIns( TT_ExecContext exc )
{
- FT_Long ins_counter = 0; /* executed instructions counter */
+ FT_ULong ins_counter = 0; /* executed instructions counter */
+ FT_ULong num_twilight_points;
FT_UShort i;
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
@@ -7475,20 +7589,72 @@
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* Toggle backwards compatibility according to what font says, except */
+ /* Toggle backward compatibility according to what font says, except */
/* when it's a `tricky' font that heavily relies on the interpreter to */
- /* render glyphs correctly, e.g. DFKai-SB. Backwards compatibility */
+ /* render glyphs correctly, e.g. DFKai-SB. Backward compatibility */
/* hacks may break it. */
if ( SUBPIXEL_HINTING_MINIMAL &&
!FT_IS_TRICKY( &exc->face->root ) )
- exc->backwards_compatibility = !( exc->GS.instruct_control & 4 );
+ exc->backward_compatibility = !( exc->GS.instruct_control & 4 );
else
- exc->backwards_compatibility = FALSE;
+ exc->backward_compatibility = FALSE;
exc->iupx_called = FALSE;
exc->iupy_called = FALSE;
#endif
+ /* We restrict the number of twilight points to a reasonable, */
+ /* heuristic value to avoid slow execution of malformed bytecode. */
+ num_twilight_points = FT_MAX( 30,
+ 2 * ( exc->pts.n_points + exc->cvtSize ) );
+ if ( exc->twilight.n_points > num_twilight_points )
+ {
+ if ( num_twilight_points > 0xFFFFU )
+ num_twilight_points = 0xFFFFU;
+
+ FT_TRACE5(( "TT_RunIns: Resetting number of twilight points\n"
+ " from %d to the more reasonable value %d\n",
+ exc->twilight.n_points,
+ num_twilight_points ));
+ exc->twilight.n_points = (FT_UShort)num_twilight_points;
+ }
+
+ /* Set up loop detectors. We restrict the number of LOOPCALL loops */
+ /* and the number of JMPR, JROT, and JROF calls with a negative */
+ /* argument to values that depend on various parameters like the */
+ /* size of the CVT table or the number of points in the current */
+ /* glyph (if applicable). */
+ /* */
+ /* The idea is that in real-world bytecode you either iterate over */
+ /* all CVT entries (in the `prep' table), or over all points (or */
+ /* contours, in the `glyf' table) of a glyph, and such iterations */
+ /* don't happen very often. */
+ exc->loopcall_counter = 0;
+ exc->neg_jump_counter = 0;
+
+ /* The maximum values are heuristic. */
+ if ( exc->pts.n_points )
+ exc->loopcall_counter_max = FT_MAX( 50,
+ 10 * exc->pts.n_points ) +
+ FT_MAX( 50,
+ exc->cvtSize / 10 );
+ else
+ exc->loopcall_counter_max = FT_MAX( 100,
+ 10 * exc->cvtSize );
+
+ /* as a protection against an unreasonable number of CVT entries */
+ /* we assume at most 100 control values per glyph for the counter */
+ if ( exc->loopcall_counter_max >
+ 100 * (FT_ULong)exc->face->root.num_glyphs )
+ exc->loopcall_counter_max = 100 * (FT_ULong)exc->face->root.num_glyphs;
+
+ FT_TRACE5(( "TT_RunIns: Limiting total number of loops in LOOPCALL"
+ " to %d\n", exc->loopcall_counter_max ));
+
+ exc->neg_jump_counter_max = exc->loopcall_counter_max;
+ FT_TRACE5(( "TT_RunIns: Limiting total number of backward jumps"
+ " to %d\n", exc->neg_jump_counter_max ));
+
/* set PPEM and CVT functions */
exc->tt_metrics.ratio = 0;
if ( exc->metrics.x_ppem != exc->metrics.y_ppem )
@@ -7566,7 +7732,21 @@
exc->args = 0;
}
- exc->new_top = exc->args + ( Pop_Push_Count[exc->opcode] & 15 );
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ if ( exc->opcode == 0x91 )
+ {
+ /* this is very special: GETVARIATION returns */
+ /* a variable number of arguments */
+
+ /* it is the job of the application to `activate' GX handling, */
+ /* this is, calling any of the GX API functions on the current */
+ /* font to select a variation instance */
+ if ( exc->face->blend )
+ exc->new_top = exc->args + exc->face->blend->num_axis;
+ }
+ else
+#endif
+ exc->new_top = exc->args + ( Pop_Push_Count[exc->opcode] & 15 );
/* `new_top' is the new top of the stack, after the instruction's */
/* execution. `top' will be set to `new_top' after the `switch' */
@@ -7759,7 +7939,7 @@
Ins_ALIGNPTS( exc, args );
break;
- case 0x28: /* ???? */
+ case 0x28: /* RAW */
Ins_UNKNOWN( exc );
break;
@@ -8111,10 +8291,33 @@
Ins_INSTCTRL( exc, args );
break;
- case 0x8F:
+ case 0x8F: /* ADJUST */
+ case 0x90: /* ADJUST */
Ins_UNKNOWN( exc );
break;
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ case 0x91:
+ /* it is the job of the application to `activate' GX handling, */
+ /* this is, calling any of the GX API functions on the current */
+ /* font to select a variation instance */
+ if ( exc->face->blend )
+ Ins_GETVARIATION( exc, args );
+ else
+ Ins_UNKNOWN( exc );
+ break;
+
+ case 0x92:
+ /* there is at least one MS font (LaoUI.ttf version 5.01) that */
+ /* uses IDEFs for 0x91 and 0x92; for this reason we activate */
+ /* GETDATA for GX fonts only, similar to GETVARIATION */
+ if ( exc->face->blend )
+ Ins_GETDATA( args );
+ else
+ Ins_UNKNOWN( exc );
+ break;
+#endif
+
default:
if ( opcode >= 0xE0 )
Ins_MIRP( exc, args );
@@ -8212,29 +8415,25 @@
} while ( !exc->instruction_trap );
LNo_Error_:
+ FT_TRACE4(( " %d instructions executed\n", ins_counter ));
return FT_Err_Ok;
LErrorCodeOverflow_:
exc->error = FT_THROW( Code_Overflow );
LErrorLabel_:
- /* If any errors have occurred, function tables may be broken. */
- /* Force a re-execution of `prep' and `fpgm' tables if no */
- /* bytecode debugger is run. */
- if ( exc->error &&
- !exc->instruction_trap &&
- exc->curRange == tt_coderange_glyph )
- {
+ if ( exc->error && !exc->instruction_trap )
FT_TRACE1(( " The interpreter returned error 0x%x\n", exc->error ));
- exc->size->bytecode_ready = -1;
- exc->size->cvt_ready = -1;
- }
return exc->error;
}
+#else /* !TT_USE_BYTECODE_INTERPRETER */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _tt_interp_dummy;
-#endif /* TT_USE_BYTECODE_INTERPRETER */
+#endif /* !TT_USE_BYTECODE_INTERPRETER */
/* END */
diff --git a/thirdparty/freetype/src/truetype/ttinterp.h b/thirdparty/freetype/src/truetype/ttinterp.h
index df7ce51f1c..55e472091c 100644
--- a/thirdparty/freetype/src/truetype/ttinterp.h
+++ b/thirdparty/freetype/src/truetype/ttinterp.h
@@ -4,7 +4,7 @@
/* */
/* TrueType bytecode interpreter (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -170,6 +170,7 @@ FT_BEGIN_HEADER
pts,
twilight;
+ FT_Long pointSize; /* in 26.6 format */
FT_Size_Metrics metrics;
TT_Size_Metrics tt_metrics; /* size metrics */
@@ -255,7 +256,7 @@ FT_BEGIN_HEADER
* Modern TrueType fonts are usually rendered through Microsoft's
* collection of rendering techniques called ClearType (e.g., subpixel
* rendering and subpixel hinting). When ClearType was introduced, most
- * fonts were not ready. Microsoft decided to implement a backwards
+ * fonts were not ready. Microsoft decided to implement a backward
* compatibility mode that employed several simple to complicated
* assumptions and tricks that modified the interpretation of the
* bytecode contained in these fonts to make them look ClearType-y
@@ -315,12 +316,12 @@ FT_BEGIN_HEADER
* very specific patterns (`superhinting') for pre-ClearType-displays,
* the worse the results.
*
- * Microsoft defines a way to turn off backwards compatibility and
+ * Microsoft defines a way to turn off backward compatibility and
* interpret instructions as before (called `native ClearType')[2][3].
* The font designer then regains full control and is responsible for
* making the font work correctly with ClearType without any
* hand-holding by the interpreter or rasterizer[4]. The v40
- * interpreter assumes backwards compatibility by default, which can be
+ * interpreter assumes backward compatibility by default, which can be
* turned off the same way by executing the following in the control
* program (cf. `Ins_INSTCTRL').
*
@@ -330,7 +331,7 @@ FT_BEGIN_HEADER
* [1] Tricky fonts as FreeType defines them rely on the bytecode
* interpreter to display correctly. Hacks can interfere with them,
* so they get treated like native ClearType fonts (v40 with
- * backwards compatibility turned off). Cf. `TT_RunIns'.
+ * backward compatibility turned off). Cf. `TT_RunIns'.
*
* [2] Proposed by Microsoft's Greg Hitchcock in
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
@@ -356,10 +357,10 @@ FT_BEGIN_HEADER
/* is managed differently. */
FT_Bool vertical_lcd_lean;
- /* Default to backwards compatibility mode in v40 interpreter. If */
+ /* Default to backward compatibility mode in v40 interpreter. If */
/* this is false, it implies the interpreter is in v35 or in native */
/* ClearType mode. */
- FT_Bool backwards_compatibility;
+ FT_Bool backward_compatibility;
/* Useful for detecting and denying post-IUP trickery that is usually */
/* used to fix pixel patterns (`superhinting'). */
@@ -407,6 +408,14 @@ FT_BEGIN_HEADER
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
+ /* We maintain two counters (in addition to the instruction counter) */
+ /* that act as loop detectors for LOOPCALL and jump opcodes with */
+ /* negative arguments. */
+ FT_ULong loopcall_counter;
+ FT_ULong loopcall_counter_max;
+ FT_ULong neg_jump_counter;
+ FT_ULong neg_jump_counter_max;
+
} TT_ExecContextRec;
diff --git a/thirdparty/freetype/src/truetype/ttobjs.c b/thirdparty/freetype/src/truetype/ttobjs.c
index ed3be2dbee..4db0f289f8 100644
--- a/thirdparty/freetype/src/truetype/ttobjs.c
+++ b/thirdparty/freetype/src/truetype/ttobjs.c
@@ -4,7 +4,7 @@
/* */
/* Objects manager (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -117,7 +117,7 @@
FT_Error error;
- FT_MEM_ZERO( zone, sizeof ( *zone ) );
+ FT_ZERO( zone );
zone->memory = memory;
if ( FT_NEW_ARRAY( zone->org, maxPoints ) ||
@@ -147,20 +147,43 @@
{
#define TRICK_NAMES_MAX_CHARACTERS 19
-#define TRICK_NAMES_COUNT 9
+#define TRICK_NAMES_COUNT 18
static const char trick_names[TRICK_NAMES_COUNT]
[TRICK_NAMES_MAX_CHARACTERS + 1] =
{
+ /*
+ PostScript names are given in brackets if they differ from the
+ family name. The version numbers, together with the copyright or
+ release year data, are taken from fonts available to the
+ developers.
+
+ Note that later versions of the fonts might be no longer tricky;
+ for example, `MingLiU' version 7.00 (file `mingliu.ttc' from
+ Windows 7) is an ordinary TTC with non-tricky subfonts.
+ */
+
+ "cpop", /* dftt-p7.ttf; version 1.00, 1992 [DLJGyShoMedium] */
+ "DFGirl-W6-WIN-BF", /* dftt-h6.ttf; version 1.00, 1993 */
"DFKaiSho-SB", /* dfkaisb.ttf */
"DFKaiShu",
- "DFKai-SB", /* kaiu.ttf */
+ "DFKai-SB", /* kaiu.ttf; version 3.00, 1998 [DFKaiShu-SB-Estd-BF] */
+ "DLC", /* dftt-m7.ttf; version 1.00, 1993 [DLCMingBold] */
+ /* dftt-f5.ttf; version 1.00, 1993 [DLCFongSung] */
+ "DLCHayMedium", /* dftt-b5.ttf; version 1.00, 1993 */
+ "DLCHayBold", /* dftt-b7.ttf; version 1.00, 1993 */
+ "DLCKaiMedium", /* dftt-k5.ttf; version 1.00, 1992 */
+ "DLCLiShu", /* dftt-l5.ttf; version 1.00, 1992 */
+ "DLCRoundBold", /* dftt-r7.ttf; version 1.00, 1993 */
"HuaTianKaiTi?", /* htkt2.ttf */
"HuaTianSongTi?", /* htst3.ttf */
- "Ming(for ISO10646)", /* hkscsiic.ttf & iicore.ttf */
- "MingLiU", /* mingliu.ttf & mingliu.ttc */
- "PMingLiU", /* mingliu.ttc */
- "MingLi43", /* mingli.ttf */
+ "Ming(for ISO10646)", /* hkscsiic.ttf; version 0.12, 2007 [Ming] */
+ /* iicore.ttf; version 0.07, 2007 [Ming] */
+ "MingLiU", /* mingliu.ttf */
+ /* mingliu.ttc; version 3.21, 2001 */
+ "MingMedium", /* dftt-m5.ttf; version 1.00, 1993 [DLCMingMedium] */
+ "PMingLiU", /* mingliu.ttc; version 3.21, 2001 */
+ "MingLi43", /* mingli.ttf; version 1.00, 1992 */
};
int nn;
@@ -242,7 +265,7 @@
tt_check_trickyness_sfnt_ids( TT_Face face )
{
#define TRICK_SFNT_IDS_PER_FACE 3
-#define TRICK_SFNT_IDS_NUM_FACES 18
+#define TRICK_SFNT_IDS_NUM_FACES 19
static const tt_sfnt_id_rec sfnt_id[TRICK_SFNT_IDS_NUM_FACES]
[TRICK_SFNT_IDS_PER_FACE] = {
@@ -266,7 +289,7 @@
{ 0x5A30CA3BUL, 0x00009063UL }, /* fpgm */
{ 0x13A42602UL, 0x0000007EUL } /* prep */
},
- { /* DFKaiShu2 */
+ { /* DFKaiShu, variant */
{ 0x11E5EAD4UL, 0x00000350UL }, /* cvt */
{ 0xA6E78C01UL, 0x00008998UL }, /* fpgm */
{ 0x13A42602UL, 0x0000007EUL } /* prep */
@@ -340,6 +363,11 @@
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0xF055FC48UL, 0x000001C2UL }, /* fpgm */
{ 0x3900DED3UL, 0x00001E18UL } /* prep */
+ },
+ { /* MINGLI.TTF, 1992 */
+ { 0x00170003UL, 0x00000060UL }, /* cvt */
+ { 0xDBB4306EUL, 0x000058AAUL }, /* fpgm */
+ { 0xD643482AUL, 0x00000035UL } /* prep */
}
};
@@ -536,6 +564,7 @@
goto Exit;
/* check that we have a valid TrueType file */
+ FT_TRACE2(( " " ));
error = sfnt->init_face( stream, face, face_index, num_params, params );
/* Stream may have changed. */
@@ -577,58 +606,50 @@
if ( FT_IS_SCALABLE( ttface ) )
{
-
#ifdef FT_CONFIG_OPTION_INCREMENTAL
-
if ( !ttface->internal->incremental_interface )
- error = tt_face_load_loca( face, stream );
- if ( !error )
- error = tt_face_load_cvt( face, stream );
- if ( !error )
- error = tt_face_load_fpgm( face, stream );
- if ( !error )
- error = tt_face_load_prep( face, stream );
-
- /* Check the scalable flag based on `loca'. */
- if ( !ttface->internal->incremental_interface &&
- ttface->num_fixed_sizes &&
- face->glyph_locations &&
- tt_check_single_notdef( ttface ) )
+#endif
{
- FT_TRACE5(( "tt_face_init:"
- " Only the `.notdef' glyph has an outline.\n"
- " "
- " Resetting scalable flag to FALSE.\n" ));
+ error = tt_face_load_loca( face, stream );
- ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
+ /* having a (non-zero) `glyf' table without */
+ /* a `loca' table is not valid */
+ if ( face->glyf_len && FT_ERR_EQ( error, Table_Missing ) )
+ goto Exit;
+ if ( error )
+ goto Exit;
}
-#else /* !FT_CONFIG_OPTION_INCREMENTAL */
+ /* `fpgm', `cvt', and `prep' are optional */
+ error = tt_face_load_cvt( face, stream );
+ if ( error && FT_ERR_NEQ( error, Table_Missing ) )
+ goto Exit;
- if ( !error )
- error = tt_face_load_loca( face, stream );
- if ( !error )
- error = tt_face_load_cvt( face, stream );
- if ( !error )
- error = tt_face_load_fpgm( face, stream );
- if ( !error )
- error = tt_face_load_prep( face, stream );
+ error = tt_face_load_fpgm( face, stream );
+ if ( error && FT_ERR_NEQ( error, Table_Missing ) )
+ goto Exit;
+
+ error = tt_face_load_prep( face, stream );
+ if ( error && FT_ERR_NEQ( error, Table_Missing ) )
+ goto Exit;
/* Check the scalable flag based on `loca'. */
- if ( ttface->num_fixed_sizes &&
- face->glyph_locations &&
- tt_check_single_notdef( ttface ) )
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ if ( !ttface->internal->incremental_interface )
+#endif
{
- FT_TRACE5(( "tt_face_init:"
- " Only the `.notdef' glyph has an outline.\n"
- " "
- " Resetting scalable flag to FALSE.\n" ));
+ if ( ttface->num_fixed_sizes &&
+ face->glyph_locations &&
+ tt_check_single_notdef( ttface ) )
+ {
+ FT_TRACE5(( "tt_face_init:"
+ " Only the `.notdef' glyph has an outline.\n"
+ " "
+ " Resetting scalable flag to FALSE.\n" ));
- ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
+ ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
+ }
}
-
-#endif /* !FT_CONFIG_OPTION_INCREMENTAL */
-
}
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
@@ -671,6 +692,8 @@
named_style->coords );
if ( error )
goto Exit;
+
+ tt_apply_mvar( face );
}
}
}
@@ -739,7 +762,7 @@
face->cvt_program_size = 0;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- tt_done_blend( memory, face->blend );
+ tt_done_blend( face );
face->blend = NULL;
#endif
}
@@ -797,14 +820,14 @@
exec->pedantic_hinting = pedantic;
{
- FT_Size_Metrics* metrics = &exec->metrics;
- TT_Size_Metrics* tt_metrics = &exec->tt_metrics;
+ FT_Size_Metrics* size_metrics = &exec->metrics;
+ TT_Size_Metrics* tt_metrics = &exec->tt_metrics;
- metrics->x_ppem = 0;
- metrics->y_ppem = 0;
- metrics->x_scale = 0;
- metrics->y_scale = 0;
+ size_metrics->x_ppem = 0;
+ size_metrics->y_ppem = 0;
+ size_metrics->x_scale = 0;
+ size_metrics->y_scale = 0;
tt_metrics->ppem = 0;
tt_metrics->scale = 0;
@@ -827,6 +850,11 @@
FT_TRACE4(( "Executing `fpgm' table.\n" ));
error = face->interpreter( exec );
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( error )
+ FT_TRACE4(( " interpretation failed with error code 0x%x\n",
+ error ));
+#endif
}
else
error = FT_Err_Ok;
@@ -890,8 +918,12 @@
TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 );
FT_TRACE4(( "Executing `prep' table.\n" ));
-
error = face->interpreter( exec );
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( error )
+ FT_TRACE4(( " interpretation failed with error code 0x%x\n",
+ error ));
+#endif
}
else
error = FT_Err_Ok;
@@ -1010,17 +1042,17 @@
/* Set default metrics */
{
- TT_Size_Metrics* metrics = &size->ttmetrics;
+ TT_Size_Metrics* tt_metrics = &size->ttmetrics;
- metrics->rotated = FALSE;
- metrics->stretched = FALSE;
+ tt_metrics->rotated = FALSE;
+ tt_metrics->stretched = FALSE;
/* set default engine compensation */
- metrics->compensations[0] = 0; /* gray */
- metrics->compensations[1] = 0; /* black */
- metrics->compensations[2] = 0; /* white */
- metrics->compensations[3] = 0; /* reserved */
+ tt_metrics->compensations[0] = 0; /* gray */
+ tt_metrics->compensations[1] = 0; /* black */
+ tt_metrics->compensations[2] = 0; /* white */
+ tt_metrics->compensations[3] = 0; /* reserved */
}
/* allocate function defs, instruction defs, cvt, and storage area */
@@ -1083,8 +1115,10 @@
if ( size->bytecode_ready < 0 )
error = tt_size_init_bytecode( (FT_Size)size, pedantic );
+ else
+ error = size->bytecode_ready;
- if ( error || size->bytecode_ready )
+ if ( error )
goto Exit;
/* rescale CVT when needed */
@@ -1116,6 +1150,8 @@
error = tt_size_run_prep( size, pedantic );
}
+ else
+ error = size->cvt_ready;
Exit:
return error;
@@ -1192,26 +1228,32 @@
/* have been changed. */
/* */
/* <Input> */
- /* size :: A handle to the target size object. */
+ /* size :: A handle to the target size object. */
+ /* */
+ /* only_height :: Only recompute ascender, descender, and height. */
/* */
FT_LOCAL_DEF( FT_Error )
- tt_size_reset( TT_Size size )
+ tt_size_reset( TT_Size size,
+ FT_Bool only_height )
{
TT_Face face;
- FT_Error error = FT_Err_Ok;
- FT_Size_Metrics* metrics;
-
+ FT_Size_Metrics* size_metrics;
- size->ttmetrics.valid = FALSE;
face = (TT_Face)size->root.face;
- metrics = &size->metrics;
+ /* nothing to do for CFF2 */
+ if ( face->is_cff2 )
+ return FT_Err_Ok;
+
+ size->ttmetrics.valid = FALSE;
+
+ size_metrics = &size->hinted_metrics;
/* copy the result from base layer */
- *metrics = size->root.metrics;
+ *size_metrics = size->root.metrics;
- if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 )
+ if ( size_metrics->x_ppem < 1 || size_metrics->y_ppem < 1 )
return FT_THROW( Invalid_PPem );
/* This bit flag, if set, indicates that the ppems must be */
@@ -1220,48 +1262,62 @@
/* */
if ( face->header.Flags & 8 )
{
- metrics->x_scale = FT_DivFix( metrics->x_ppem << 6,
- face->root.units_per_EM );
- metrics->y_scale = FT_DivFix( metrics->y_ppem << 6,
- face->root.units_per_EM );
-
- metrics->ascender =
- FT_PIX_ROUND( FT_MulFix( face->root.ascender, metrics->y_scale ) );
- metrics->descender =
- FT_PIX_ROUND( FT_MulFix( face->root.descender, metrics->y_scale ) );
- metrics->height =
- FT_PIX_ROUND( FT_MulFix( face->root.height, metrics->y_scale ) );
- metrics->max_advance =
- FT_PIX_ROUND( FT_MulFix( face->root.max_advance_width,
- metrics->x_scale ) );
+ /* the TT spec always asks for ROUND, not FLOOR or CEIL */
+ size_metrics->ascender = FT_PIX_ROUND(
+ FT_MulFix( face->root.ascender,
+ size_metrics->y_scale ) );
+ size_metrics->descender = FT_PIX_ROUND(
+ FT_MulFix( face->root.descender,
+ size_metrics->y_scale ) );
+ size_metrics->height = FT_PIX_ROUND(
+ FT_MulFix( face->root.height,
+ size_metrics->y_scale ) );
+ }
+
+ size->ttmetrics.valid = TRUE;
+
+ if ( only_height )
+ return FT_Err_Ok;
+
+ if ( face->header.Flags & 8 )
+ {
+ /* base scaling values on integer ppem values, */
+ /* as mandated by the TrueType specification */
+ size_metrics->x_scale = FT_DivFix( size_metrics->x_ppem << 6,
+ face->root.units_per_EM );
+ size_metrics->y_scale = FT_DivFix( size_metrics->y_ppem << 6,
+ face->root.units_per_EM );
+
+ size_metrics->max_advance = FT_PIX_ROUND(
+ FT_MulFix( face->root.max_advance_width,
+ size_metrics->x_scale ) );
}
/* compute new transformation */
- if ( metrics->x_ppem >= metrics->y_ppem )
+ if ( size_metrics->x_ppem >= size_metrics->y_ppem )
{
- size->ttmetrics.scale = metrics->x_scale;
- size->ttmetrics.ppem = metrics->x_ppem;
+ size->ttmetrics.scale = size_metrics->x_scale;
+ size->ttmetrics.ppem = size_metrics->x_ppem;
size->ttmetrics.x_ratio = 0x10000L;
- size->ttmetrics.y_ratio = FT_DivFix( metrics->y_ppem,
- metrics->x_ppem );
+ size->ttmetrics.y_ratio = FT_DivFix( size_metrics->y_ppem,
+ size_metrics->x_ppem );
}
else
{
- size->ttmetrics.scale = metrics->y_scale;
- size->ttmetrics.ppem = metrics->y_ppem;
- size->ttmetrics.x_ratio = FT_DivFix( metrics->x_ppem,
- metrics->y_ppem );
+ size->ttmetrics.scale = size_metrics->y_scale;
+ size->ttmetrics.ppem = size_metrics->y_ppem;
+ size->ttmetrics.x_ratio = FT_DivFix( size_metrics->x_ppem,
+ size_metrics->y_ppem );
size->ttmetrics.y_ratio = 0x10000L;
}
+ size->metrics = size_metrics;
+
#ifdef TT_USE_BYTECODE_INTERPRETER
size->cvt_ready = -1;
#endif /* TT_USE_BYTECODE_INTERPRETER */
- if ( !error )
- size->ttmetrics.valid = TRUE;
-
- return error;
+ return FT_Err_Ok;
}
diff --git a/thirdparty/freetype/src/truetype/ttobjs.h b/thirdparty/freetype/src/truetype/ttobjs.h
index ed61a7d517..cdacee75e5 100644
--- a/thirdparty/freetype/src/truetype/ttobjs.h
+++ b/thirdparty/freetype/src/truetype/ttobjs.h
@@ -4,7 +4,7 @@
/* */
/* Objects manager (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -278,7 +278,8 @@ FT_BEGIN_HEADER
/* we have our own copy of metrics so that we can modify */
/* it without affecting auto-hinting (when used) */
- FT_Size_Metrics metrics;
+ FT_Size_Metrics* metrics; /* for the current rendering mode */
+ FT_Size_Metrics hinted_metrics; /* for the hinted rendering mode */
TT_Size_Metrics ttmetrics;
@@ -286,6 +287,8 @@ FT_BEGIN_HEADER
#ifdef TT_USE_BYTECODE_INTERPRETER
+ FT_Long point_size; /* for the `MPS' bytecode instruction */
+
FT_UInt num_function_defs; /* number of function definitions */
FT_UInt max_function_defs;
TT_DefArray function_defs; /* table of function definitions */
@@ -387,7 +390,8 @@ FT_BEGIN_HEADER
#endif /* TT_USE_BYTECODE_INTERPRETER */
FT_LOCAL( FT_Error )
- tt_size_reset( TT_Size size );
+ tt_size_reset( TT_Size size,
+ FT_Bool only_height );
/*************************************************************************/
diff --git a/thirdparty/freetype/src/truetype/ttpic.c b/thirdparty/freetype/src/truetype/ttpic.c
index 54a5b8bed6..66bd7e1934 100644
--- a/thirdparty/freetype/src/truetype/ttpic.c
+++ b/thirdparty/freetype/src/truetype/ttpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for truetype module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttpic.h b/thirdparty/freetype/src/truetype/ttpic.h
index f725865c5c..1410cd73c3 100644
--- a/thirdparty/freetype/src/truetype/ttpic.h
+++ b/thirdparty/freetype/src/truetype/ttpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for truetype module. */
/* */
-/* Copyright 2009-2016 by */
+/* Copyright 2009-2017 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,15 +25,17 @@
#ifndef FT_CONFIG_OPTION_PIC
-#define TT_SERVICES_GET tt_services
-#define TT_SERVICE_GX_MULTI_MASTERS_GET tt_service_gx_multi_masters
-#define TT_SERVICE_TRUETYPE_GLYF_GET tt_service_truetype_glyf
-#define TT_SERVICE_PROPERTIES_GET tt_service_properties
+#define TT_SERVICES_GET tt_services
+#define TT_SERVICE_GX_MULTI_MASTERS_GET tt_service_gx_multi_masters
+#define TT_SERVICE_METRICS_VARIATIONS_GET tt_service_metrics_variations
+#define TT_SERVICE_TRUETYPE_GLYF_GET tt_service_truetype_glyf
+#define TT_SERVICE_PROPERTIES_GET tt_service_properties
#else /* FT_CONFIG_OPTION_PIC */
#include FT_MULTIPLE_MASTERS_H
#include FT_SERVICE_MULTIPLE_MASTERS_H
+#include FT_SERVICE_METRICS_VARIATIONS_H
#include FT_SERVICE_TRUETYPE_GLYF_H
#include FT_SERVICE_PROPERTIES_H
@@ -42,12 +44,13 @@ FT_BEGIN_HEADER
typedef struct TTModulePIC_
{
- FT_ServiceDescRec* tt_services;
+ FT_ServiceDescRec* tt_services;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- FT_Service_MultiMastersRec tt_service_gx_multi_masters;
+ FT_Service_MultiMastersRec tt_service_gx_multi_masters;
+ FT_Service_MetricsVariationsRec tt_service_metrics_variations;
#endif
- FT_Service_TTGlyfRec tt_service_truetype_glyf;
- FT_Service_PropertiesRec tt_service_properties;
+ FT_Service_TTGlyfRec tt_service_truetype_glyf;
+ FT_Service_PropertiesRec tt_service_properties;
} TTModulePIC;
@@ -56,6 +59,8 @@ FT_BEGIN_HEADER
( (TTModulePIC*)((lib)->pic_container.truetype) )
#define TT_SERVICES_GET \
( GET_PIC( library )->tt_services )
+#define TT_SERVICE_METRICS_VARIATIONS_GET \
+ ( GET_PIC( library )->tt_service_metrics_variations )
#define TT_SERVICE_GX_MULTI_MASTERS_GET \
( GET_PIC( library )->tt_service_gx_multi_masters )
#define TT_SERVICE_TRUETYPE_GLYF_GET \
diff --git a/thirdparty/freetype/src/truetype/ttpload.c b/thirdparty/freetype/src/truetype/ttpload.c
index ca158ac50b..70ac15da4a 100644
--- a/thirdparty/freetype/src/truetype/ttpload.c
+++ b/thirdparty/freetype/src/truetype/ttpload.c
@@ -4,7 +4,7 @@
/* */
/* TrueType-specific tables loader (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -73,9 +73,21 @@
/* it is possible that a font doesn't have a glyf table at all */
/* or its size is zero */
if ( FT_ERR_EQ( error, Table_Missing ) )
- face->glyf_len = 0;
+ {
+ face->glyf_len = 0;
+ face->glyf_offset = 0;
+ }
else if ( error )
goto Exit;
+ else
+ {
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ if ( face->root.internal->incremental_interface )
+ face->glyf_offset = 0;
+ else
+#endif
+ face->glyf_offset = FT_STREAM_POS();
+ }
FT_TRACE2(( "Locations " ));
error = face->goto_table( face, TTAG_loca, stream, &table_len );
@@ -92,8 +104,7 @@
if ( table_len >= 0x40000L )
{
FT_TRACE2(( "table too large\n" ));
- error = FT_THROW( Invalid_Table );
- goto Exit;
+ table_len = 0x3FFFFL;
}
face->num_locations = table_len >> shift;
}
@@ -104,8 +115,7 @@
if ( table_len >= 0x20000L )
{
FT_TRACE2(( "table too large\n" ));
- error = FT_THROW( Invalid_Table );
- goto Exit;
+ table_len = 0x1FFFFL;
}
face->num_locations = table_len >> shift;
}
@@ -222,13 +232,13 @@
}
}
- /* Check broken location data */
+ /* Check broken location data. */
if ( pos1 > face->glyf_len )
{
FT_TRACE1(( "tt_face_get_location:"
- " too large offset=0x%08lx found for gid=0x%04lx,\n"
+ " too large offset (0x%08lx) found for glyph index %ld,\n"
" "
- " exceeding the end of glyf table (0x%08lx)\n",
+ " exceeding the end of `glyf' table (0x%08lx)\n",
pos1, gindex, face->glyf_len ));
*asize = 0;
return 0;
@@ -236,12 +246,26 @@
if ( pos2 > face->glyf_len )
{
- FT_TRACE1(( "tt_face_get_location:"
- " too large offset=0x%08lx found for gid=0x%04lx,\n"
- " "
- " truncate at the end of glyf table (0x%08lx)\n",
- pos2, gindex + 1, face->glyf_len ));
- pos2 = face->glyf_len;
+ /* We try to sanitize the last `loca' entry. */
+ if ( gindex == face->num_locations - 1 )
+ {
+ FT_TRACE1(( "tt_face_get_location:"
+ " too large offset (0x%08lx) found for glyph index %ld,\n"
+ " "
+ " truncating at the end of `glyf' table (0x%08lx)\n",
+ pos2, gindex + 1, face->glyf_len ));
+ pos2 = face->glyf_len;
+ }
+ else
+ {
+ FT_TRACE1(( "tt_face_get_location:"
+ " too large offset (0x%08lx) found for glyph index %ld,\n"
+ " "
+ " exceeding the end of `glyf' table (0x%08lx)\n",
+ pos2, gindex + 1, face->glyf_len ));
+ *asize = 0;
+ return 0;
+ }
}
/* The `loca' table must be ordered; it refers to the length of */
@@ -500,7 +524,7 @@
{
FT_Error error;
FT_Memory memory = stream->memory;
- FT_UInt version, nn, num_records;
+ FT_UInt nn, num_records;
FT_ULong table_size, record_size;
FT_Byte* p;
FT_Byte* limit;
@@ -517,7 +541,10 @@
p = face->hdmx_table;
limit = p + table_size;
- version = FT_NEXT_USHORT( p );
+ /* Given that `hdmx' tables are losing its importance (for example, */
+ /* variation fonts introduced in OpenType 1.8 must not have this */
+ /* table) we no longer test for a correct `version' field. */
+ p += 2;
num_records = FT_NEXT_USHORT( p );
record_size = FT_NEXT_ULONG( p );
@@ -536,10 +563,10 @@
record_size &= 0xFFFFU;
/* The limit for `num_records' is a heuristic value. */
- if ( version != 0 ||
- num_records > 255 ||
- record_size > 0x10001L ||
- record_size < 4 )
+ if ( num_records > 255 ||
+ ( num_records > 0 &&
+ ( record_size > 0x10001L ||
+ record_size < 4 ) ) )
{
error = FT_THROW( Invalid_File_Format );
goto Fail;
diff --git a/thirdparty/freetype/src/truetype/ttpload.h b/thirdparty/freetype/src/truetype/ttpload.h
index aa2e38e6e7..79079f345a 100644
--- a/thirdparty/freetype/src/truetype/ttpload.h
+++ b/thirdparty/freetype/src/truetype/ttpload.h
@@ -4,7 +4,7 @@
/* */
/* TrueType-specific tables loader (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttsubpix.c b/thirdparty/freetype/src/truetype/ttsubpix.c
index 03950960a4..1c8cf01109 100644
--- a/thirdparty/freetype/src/truetype/ttsubpix.c
+++ b/thirdparty/freetype/src/truetype/ttsubpix.c
@@ -4,7 +4,7 @@
/* */
/* TrueType Subpixel Hinting. */
/* */
-/* Copyright 2010-2016 by */
+/* Copyright 2010-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -27,7 +27,8 @@
#include "ttsubpix.h"
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
+#if defined( TT_USE_BYTECODE_INTERPRETER ) && \
+ defined( TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY )
/*************************************************************************/
/* */
@@ -905,7 +906,7 @@
{
TT_Face face = loader->face;
FT_String* family = face->root.family_name;
- FT_UInt ppem = loader->size->metrics.x_ppem;
+ FT_UInt ppem = loader->size->metrics->x_ppem;
FT_String* style = face->root.style_name;
@@ -1000,12 +1001,14 @@
}
}
-#else /* !TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
+#else /* !(TT_USE_BYTECODE_INTERPRETER && */
+ /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY) */
/* ANSI C doesn't like empty source files */
typedef int _tt_subpix_dummy;
-#endif /* !TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
+#endif /* !(TT_USE_BYTECODE_INTERPRETER && */
+ /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY) */
/* END */
diff --git a/thirdparty/freetype/src/truetype/ttsubpix.h b/thirdparty/freetype/src/truetype/ttsubpix.h
index 86844da666..c68f97ff07 100644
--- a/thirdparty/freetype/src/truetype/ttsubpix.h
+++ b/thirdparty/freetype/src/truetype/ttsubpix.h
@@ -4,7 +4,7 @@
/* */
/* TrueType Subpixel Hinting. */
/* */
-/* Copyright 2010-2016 by */
+/* Copyright 2010-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/module.mk b/thirdparty/freetype/src/type1/module.mk
index d7ab520c74..f299d6fe88 100644
--- a/thirdparty/freetype/src/type1/module.mk
+++ b/thirdparty/freetype/src/type1/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/type1/rules.mk b/thirdparty/freetype/src/type1/rules.mk
index bdec29479f..97bef288f0 100644
--- a/thirdparty/freetype/src/type1/rules.mk
+++ b/thirdparty/freetype/src/type1/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/type1/t1afm.c b/thirdparty/freetype/src/type1/t1afm.c
index bbd843c1c3..11a2646fc2 100644
--- a/thirdparty/freetype/src/type1/t1afm.c
+++ b/thirdparty/freetype/src/type1/t1afm.c
@@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,6 +24,8 @@
#include "t1errors.h"
+#ifndef T1_CONFIG_OPTION_NO_AFM
+
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
@@ -208,7 +210,7 @@
kp++;
}
- if ( oldcharmap != NULL )
+ if ( oldcharmap )
error = FT_Set_Charmap( t1_face, oldcharmap );
if ( error )
goto Exit;
@@ -309,14 +311,14 @@
{
t1_face->face_flags |= FT_FACE_FLAG_KERNING;
face->afm_data = fi;
- fi = NULL;
+ fi = NULL;
}
}
FT_FRAME_EXIT();
Exit:
- if ( fi != NULL )
+ if ( fi )
T1_Done_Metrics( memory, fi );
return error;
@@ -402,5 +404,12 @@
return FT_Err_Ok;
}
+#else /* T1_CONFIG_OPTION_NO_AFM */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _t1_afm_dummy;
+
+#endif /* T1_CONFIG_OPTION_NO_AFM */
+
/* END */
diff --git a/thirdparty/freetype/src/type1/t1afm.h b/thirdparty/freetype/src/type1/t1afm.h
index 3a864f2379..9f62cd013d 100644
--- a/thirdparty/freetype/src/type1/t1afm.h
+++ b/thirdparty/freetype/src/type1/t1afm.h
@@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1driver.c b/thirdparty/freetype/src/type1/t1driver.c
index f1e60d4523..c2089947f9 100644
--- a/thirdparty/freetype/src/type1/t1driver.c
+++ b/thirdparty/freetype/src/type1/t1driver.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 driver interface (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -122,8 +122,13 @@
(FT_Get_MM_Func) T1_Get_Multi_Master, /* get_mm */
(FT_Set_MM_Design_Func) T1_Set_MM_Design, /* set_mm_design */
(FT_Set_MM_Blend_Func) T1_Set_MM_Blend, /* set_mm_blend */
+ (FT_Get_MM_Blend_Func) T1_Get_MM_Blend, /* get_mm_blend */
(FT_Get_MM_Var_Func) T1_Get_MM_Var, /* get_mm_var */
- (FT_Set_Var_Design_Func)T1_Set_Var_Design /* set_var_design */
+ (FT_Set_Var_Design_Func)T1_Set_Var_Design, /* set_var_design */
+ (FT_Get_Var_Design_Func)T1_Get_Var_Design, /* get_var_design */
+
+ (FT_Get_Var_Blend_Func) NULL, /* get_var_blend */
+ (FT_Done_Blend_Func) T1_Done_Blend /* done_blend */
};
#endif
@@ -714,7 +719,7 @@
0x10000L,
0x20000L,
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
T1_Driver_Init, /* FT_Module_Constructor module_init */
T1_Driver_Done, /* FT_Module_Destructor module_done */
@@ -735,8 +740,8 @@
T1_Load_Glyph, /* FT_Slot_LoadFunc load_glyph */
#ifdef T1_CONFIG_OPTION_NO_AFM
- 0, /* FT_Face_GetKerningFunc get_kerning */
- 0, /* FT_Face_AttachFunc attach_file */
+ NULL, /* FT_Face_GetKerningFunc get_kerning */
+ NULL, /* FT_Face_AttachFunc attach_file */
#else
Get_Kerning, /* FT_Face_GetKerningFunc get_kerning */
T1_Read_Metrics, /* FT_Face_AttachFunc attach_file */
@@ -744,7 +749,7 @@
T1_Get_Advances, /* FT_Face_GetAdvancesFunc get_advances */
T1_Size_Request, /* FT_Size_RequestFunc request_size */
- 0 /* FT_Size_SelectFunc select_size */
+ NULL /* FT_Size_SelectFunc select_size */
};
diff --git a/thirdparty/freetype/src/type1/t1driver.h b/thirdparty/freetype/src/type1/t1driver.h
index 78d8e38aa9..292786448d 100644
--- a/thirdparty/freetype/src/type1/t1driver.h
+++ b/thirdparty/freetype/src/type1/t1driver.h
@@ -4,7 +4,7 @@
/* */
/* High-level Type 1 driver interface (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1errors.h b/thirdparty/freetype/src/type1/t1errors.h
index 9ba470ed6c..492dbb4a42 100644
--- a/thirdparty/freetype/src/type1/t1errors.h
+++ b/thirdparty/freetype/src/type1/t1errors.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 error codes (specification only). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1gload.c b/thirdparty/freetype/src/type1/t1gload.c
index ea36f64142..aaf19b6dcc 100644
--- a/thirdparty/freetype/src/type1/t1gload.c
+++ b/thirdparty/freetype/src/type1/t1gload.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 Glyph Loader (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1gload.h b/thirdparty/freetype/src/type1/t1gload.h
index 975f227853..cc4d5e734f 100644
--- a/thirdparty/freetype/src/type1/t1gload.h
+++ b/thirdparty/freetype/src/type1/t1gload.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 Glyph Loader (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1load.c b/thirdparty/freetype/src/type1/t1load.c
index c981adcf2c..f5c661f7de 100644
--- a/thirdparty/freetype/src/type1/t1load.c
+++ b/thirdparty/freetype/src/type1/t1load.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 font loader (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -237,7 +237,7 @@
if ( ncv <= axismap->blend_points[0] )
return INT_TO_FIXED( axismap->design_points[0] );
- for ( j = 1; j < axismap->num_points; ++j )
+ for ( j = 1; j < axismap->num_points; j++ )
{
if ( ncv <= axismap->blend_points[j] )
return INT_TO_FIXED( axismap->design_points[j - 1] ) +
@@ -321,12 +321,12 @@
mmvar->num_axis = mmaster.num_axis;
mmvar->num_designs = mmaster.num_designs;
- mmvar->num_namedstyles = ~0U; /* Does not apply */
+ mmvar->num_namedstyles = 0; /* Not supported */
mmvar->axis = (FT_Var_Axis*)&mmvar[1];
/* Point to axes after MM_Var struct */
mmvar->namedstyle = NULL;
- for ( i = 0; i < mmaster.num_axis; ++i )
+ for ( i = 0; i < mmaster.num_axis; i++ )
{
mmvar->axis[i].name = mmaster.axis[i].name;
mmvar->axis[i].minimum = INT_TO_FIXED( mmaster.axis[i].minimum);
@@ -354,7 +354,7 @@
axiscoords,
blend->num_axis );
- for ( i = 0; i < mmaster.num_axis; ++i )
+ for ( i = 0; i < mmaster.num_axis; i++ )
mmvar->axis[i].def = mm_axis_unmap( &blend->design_map[i],
axiscoords[i] );
}
@@ -413,6 +413,41 @@
FT_LOCAL_DEF( FT_Error )
+ T1_Get_MM_Blend( T1_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ PS_Blend blend = face->blend;
+
+ FT_Fixed axiscoords[4];
+ FT_UInt i, nc;
+
+
+ if ( !blend )
+ return FT_THROW( Invalid_Argument );
+
+ mm_weights_unmap( blend->weight_vector,
+ axiscoords,
+ blend->num_axis );
+
+ nc = num_coords;
+ if ( num_coords > blend->num_axis )
+ {
+ FT_TRACE2(( "T1_Get_MM_Blend: only using first %d of %d coordinates\n",
+ blend->num_axis, num_coords ));
+ nc = blend->num_axis;
+ }
+
+ for ( i = 0; i < nc; i++ )
+ coords[i] = axiscoords[i];
+ for ( ; i < num_coords; i++ )
+ coords[i] = 0x8000;
+
+ return FT_Err_Ok;
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
T1_Set_MM_Design( T1_Face face,
FT_UInt num_coords,
FT_Long* coords )
@@ -504,13 +539,49 @@
if ( num_coords > T1_MAX_MM_AXIS )
num_coords = T1_MAX_MM_AXIS;
- for ( i = 0; i < num_coords; ++i )
+ for ( i = 0; i < num_coords; i++ )
lcoords[i] = FIXED_TO_INT( coords[i] );
return T1_Set_MM_Design( face, num_coords, lcoords );
}
+ FT_LOCAL_DEF( FT_Error )
+ T1_Get_Var_Design( T1_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ PS_Blend blend = face->blend;
+
+ FT_Fixed axiscoords[4];
+ FT_UInt i, nc;
+
+
+ if ( !blend )
+ return FT_THROW( Invalid_Argument );
+
+ mm_weights_unmap( blend->weight_vector,
+ axiscoords,
+ blend->num_axis );
+
+ nc = num_coords;
+ if ( num_coords > blend->num_axis )
+ {
+ FT_TRACE2(( "T1_Get_Var_Design:"
+ " only using first %d of %d coordinates\n",
+ blend->num_axis, num_coords ));
+ nc = blend->num_axis;
+ }
+
+ for ( i = 0; i < nc; i++ )
+ coords[i] = mm_axis_unmap( &blend->design_map[i], axiscoords[i] );
+ for ( ; i < num_coords; i++ )
+ coords[i] = 0;
+
+ return FT_Err_Ok;
+ }
+
+
FT_LOCAL_DEF( void )
T1_Done_Blend( T1_Face face )
{
@@ -1406,7 +1477,6 @@
FT_Error error;
FT_Int num_subrs;
FT_UInt count;
- FT_Hash hash = NULL;
PSAux_Service psaux = (PSAux_Service)face->psaux;
@@ -1433,7 +1503,7 @@
}
/* we certainly need more than 8 bytes per subroutine */
- if ( parser->root.limit > parser->root.cursor &&
+ if ( parser->root.limit >= parser->root.cursor &&
num_subrs > ( parser->root.limit - parser->root.cursor ) >> 3 )
{
/*
@@ -1457,14 +1527,12 @@
( parser->root.limit - parser->root.cursor ) >> 3 ));
num_subrs = ( parser->root.limit - parser->root.cursor ) >> 3;
- if ( !hash )
+ if ( !loader->subrs_hash )
{
- if ( FT_NEW( hash ) )
+ if ( FT_NEW( loader->subrs_hash ) )
goto Fail;
- loader->subrs_hash = hash;
-
- error = ft_hash_num_init( hash, memory );
+ error = ft_hash_num_init( loader->subrs_hash, memory );
if ( error )
goto Fail;
}
@@ -1527,9 +1595,9 @@
/* if we use a hash, the subrs index is the key, and a running */
/* counter specified for `T1_Add_Table' acts as the value */
- if ( hash )
+ if ( loader->subrs_hash )
{
- ft_hash_num_insert( idx, count, hash, memory );
+ ft_hash_num_insert( idx, count, loader->subrs_hash, memory );
idx = count;
}
@@ -1776,6 +1844,12 @@
}
}
+ if ( !n )
+ {
+ error = FT_THROW( Invalid_File_Format );
+ goto Fail;
+ }
+
loader->num_glyphs = n;
/* if /.notdef is found but does not occupy index 0, do our magic. */
@@ -2104,7 +2178,7 @@
parser->root.error = t1_load_keyword( face,
loader,
keyword );
- if ( parser->root.error != FT_Err_Ok )
+ if ( parser->root.error )
{
if ( FT_ERR_EQ( parser->root.error, Ignore ) )
parser->root.error = FT_Err_Ok;
@@ -2143,7 +2217,7 @@
{
FT_UNUSED( face );
- FT_MEM_ZERO( loader, sizeof ( *loader ) );
+ FT_ZERO( loader );
}
diff --git a/thirdparty/freetype/src/type1/t1load.h b/thirdparty/freetype/src/type1/t1load.h
index b96fe5a746..2d86984f0e 100644
--- a/thirdparty/freetype/src/type1/t1load.h
+++ b/thirdparty/freetype/src/type1/t1load.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 font loader (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -70,7 +70,7 @@ FT_BEGIN_HEADER
T1_Get_Multi_Master( T1_Face face,
FT_Multi_Master* master );
- FT_LOCAL_DEF( FT_Error )
+ FT_LOCAL( FT_Error )
T1_Get_MM_Var( T1_Face face,
FT_MM_Var* *master );
@@ -80,11 +80,21 @@ FT_BEGIN_HEADER
FT_Fixed* coords );
FT_LOCAL( FT_Error )
+ T1_Get_MM_Blend( T1_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+ FT_LOCAL( FT_Error )
T1_Set_MM_Design( T1_Face face,
FT_UInt num_coords,
FT_Long* coords );
- FT_LOCAL_DEF( FT_Error )
+ FT_LOCAL( FT_Error )
+ T1_Get_Var_Design( T1_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+ FT_LOCAL( FT_Error )
T1_Set_Var_Design( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
diff --git a/thirdparty/freetype/src/type1/t1objs.c b/thirdparty/freetype/src/type1/t1objs.c
index a009117133..97c16b0fdf 100644
--- a/thirdparty/freetype/src/type1/t1objs.c
+++ b/thirdparty/freetype/src/type1/t1objs.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 objects manager (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -49,9 +49,6 @@
/* */
/* SIZE FUNCTIONS */
/* */
- /* note that we store the global hints in the size's "internal" root */
- /* field */
- /* */
/*************************************************************************/
@@ -77,16 +74,16 @@
T1_Size size = (T1_Size)t1size;
- if ( size->root.internal )
+ if ( t1size->internal->module_data )
{
PSH_Globals_Funcs funcs;
funcs = T1_Size_Get_Globals_Funcs( size );
if ( funcs )
- funcs->destroy( (PSH_Globals)size->root.internal );
+ funcs->destroy( (PSH_Globals)t1size->internal->module_data );
- size->root.internal = NULL;
+ t1size->internal->module_data = NULL;
}
}
@@ -108,7 +105,7 @@
error = funcs->create( size->root.face->memory,
&face->type1.private_dict, &globals );
if ( !error )
- size->root.internal = (FT_Size_Internal)(void*)globals;
+ t1size->internal->module_data = globals;
}
return error;
@@ -126,7 +123,7 @@
FT_Request_Metrics( size->root.face, req );
if ( funcs )
- funcs->set_scale( (PSH_Globals)size->root.internal,
+ funcs->set_scale( (PSH_Globals)t1size->internal->module_data,
size->root.metrics.x_scale,
size->root.metrics.y_scale,
0, 0 );
diff --git a/thirdparty/freetype/src/type1/t1objs.h b/thirdparty/freetype/src/type1/t1objs.h
index 94fbdee9ae..39d26bf8b9 100644
--- a/thirdparty/freetype/src/type1/t1objs.h
+++ b/thirdparty/freetype/src/type1/t1objs.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 objects manager (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1parse.c b/thirdparty/freetype/src/type1/t1parse.c
index 563d9f37bb..18dd26434c 100644
--- a/thirdparty/freetype/src/type1/t1parse.c
+++ b/thirdparty/freetype/src/type1/t1parse.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 parser (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -437,7 +437,7 @@
*cur == '\t' ||
(test_cr && *cur == '\r' ) ||
*cur == '\n' ) )
- ++cur;
+ cur++;
if ( cur >= limit )
{
FT_ERROR(( "T1_Get_Private_Dict:"
diff --git a/thirdparty/freetype/src/type1/t1parse.h b/thirdparty/freetype/src/type1/t1parse.h
index affa818e63..3396680d1a 100644
--- a/thirdparty/freetype/src/type1/t1parse.h
+++ b/thirdparty/freetype/src/type1/t1parse.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 parser (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1tokens.h b/thirdparty/freetype/src/type1/t1tokens.h
index a84f291a6b..ca0c55f903 100644
--- a/thirdparty/freetype/src/type1/t1tokens.h
+++ b/thirdparty/freetype/src/type1/t1tokens.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 tokenizer (specification). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/type1.c b/thirdparty/freetype/src/type1/type1.c
index bb8aca97f9..81795376ef 100644
--- a/thirdparty/freetype/src/type1/type1.c
+++ b/thirdparty/freetype/src/type1/type1.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Type 1 driver component (body only). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,17 +17,14 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
-
#include <ft2build.h>
-#include "t1parse.c"
-#include "t1load.c"
-#include "t1objs.c"
-#include "t1driver.c"
-#include "t1gload.c"
-#ifndef T1_CONFIG_OPTION_NO_AFM
#include "t1afm.c"
-#endif
+#include "t1driver.c"
+#include "t1gload.c"
+#include "t1load.c"
+#include "t1objs.c"
+#include "t1parse.c"
/* END */
diff --git a/thirdparty/freetype/src/type42/module.mk b/thirdparty/freetype/src/type42/module.mk
index a7e27b7236..2f52806808 100644
--- a/thirdparty/freetype/src/type42/module.mk
+++ b/thirdparty/freetype/src/type42/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2016 by
+# Copyright 2002-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/type42/rules.mk b/thirdparty/freetype/src/type42/rules.mk
index 80710eff67..d7e8965015 100644
--- a/thirdparty/freetype/src/type42/rules.mk
+++ b/thirdparty/freetype/src/type42/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2016 by
+# Copyright 2002-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/type42/t42drivr.c b/thirdparty/freetype/src/type42/t42drivr.c
index c63ed0c812..366cfb3a1d 100644
--- a/thirdparty/freetype/src/type42/t42drivr.c
+++ b/thirdparty/freetype/src/type42/t42drivr.c
@@ -4,7 +4,7 @@
/* */
/* High-level Type 42 driver interface (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -81,7 +81,8 @@
if ( glyph_name[0] == gname[0] && !ft_strcmp( glyph_name, gname ) )
- return (FT_UInt)ft_atol( (const char *)face->type1.charstrings[i] );
+ return (FT_UInt)ft_strtol( (const char *)face->type1.charstrings[i],
+ NULL, 10 );
}
return 0;
@@ -213,7 +214,7 @@
0x10000L,
0x20000L,
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
T42_Driver_Init, /* FT_Module_Constructor module_init */
T42_Driver_Done, /* FT_Module_Destructor module_done */
@@ -233,9 +234,9 @@
T42_GlyphSlot_Load, /* FT_Slot_LoadFunc load_glyph */
- 0, /* FT_Face_GetKerningFunc get_kerning */
- 0, /* FT_Face_AttachFunc attach_file */
- 0, /* FT_Face_GetAdvancesFunc get_advances */
+ NULL, /* FT_Face_GetKerningFunc get_kerning */
+ NULL, /* FT_Face_AttachFunc attach_file */
+ NULL, /* FT_Face_GetAdvancesFunc get_advances */
T42_Size_Request, /* FT_Size_RequestFunc request_size */
T42_Size_Select /* FT_Size_SelectFunc select_size */
diff --git a/thirdparty/freetype/src/type42/t42drivr.h b/thirdparty/freetype/src/type42/t42drivr.h
index 6ddfb639d5..1ac4a0a1a1 100644
--- a/thirdparty/freetype/src/type42/t42drivr.h
+++ b/thirdparty/freetype/src/type42/t42drivr.h
@@ -4,7 +4,7 @@
/* */
/* High-level Type 42 driver interface (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/t42error.h b/thirdparty/freetype/src/type42/t42error.h
index e1097cc81e..fda92abf57 100644
--- a/thirdparty/freetype/src/type42/t42error.h
+++ b/thirdparty/freetype/src/type42/t42error.h
@@ -4,7 +4,7 @@
/* */
/* Type 42 error codes (specification only). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/t42objs.c b/thirdparty/freetype/src/type42/t42objs.c
index 4672c6e164..87e5206b7f 100644
--- a/thirdparty/freetype/src/type42/t42objs.c
+++ b/thirdparty/freetype/src/type42/t42objs.c
@@ -4,7 +4,7 @@
/* */
/* Type 42 objects manager (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -590,7 +590,7 @@
FT_Error error = FT_Err_Ok;
- if ( face->glyph == NULL )
+ if ( !face->glyph )
{
/* First glyph slot for this face */
slot->ttslot = t42face->ttf_face->glyph;
@@ -656,8 +656,9 @@
FT_TRACE1(( "T42_GlyphSlot_Load: glyph index %d\n", glyph_index ));
/* map T42 glyph index to embedded TTF's glyph index */
- glyph_index = (FT_UInt)ft_atol(
- (const char *)t42face->type1.charstrings[glyph_index] );
+ glyph_index = (FT_UInt)ft_strtol(
+ (const char *)t42face->type1.charstrings[glyph_index],
+ NULL, 10 );
t42_glyphslot_clear( t42slot->ttslot );
error = ttclazz->load_glyph( t42slot->ttslot,
diff --git a/thirdparty/freetype/src/type42/t42objs.h b/thirdparty/freetype/src/type42/t42objs.h
index 87a40452f4..eb4c5bf69f 100644
--- a/thirdparty/freetype/src/type42/t42objs.h
+++ b/thirdparty/freetype/src/type42/t42objs.h
@@ -4,7 +4,7 @@
/* */
/* Type 42 objects manager (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/t42parse.c b/thirdparty/freetype/src/type42/t42parse.c
index f948916afa..e7c6770bd2 100644
--- a/thirdparty/freetype/src/type42/t42parse.c
+++ b/thirdparty/freetype/src/type42/t42parse.c
@@ -4,7 +4,7 @@
/* */
/* Type 42 font parser (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -936,7 +936,7 @@
if ( *cur == '/' || *cur == '(' )
{
FT_UInt len;
- FT_Bool have_literal = ( *cur == '(' );
+ FT_Bool have_literal = FT_BOOL( *cur == '(' );
if ( cur + ( have_literal ? 3 : 2 ) >= limit )
@@ -1268,7 +1268,7 @@
{
FT_UNUSED( face );
- FT_MEM_ZERO( loader, sizeof ( *loader ) );
+ FT_ZERO( loader );
loader->num_glyphs = 0;
loader->num_chars = 0;
diff --git a/thirdparty/freetype/src/type42/t42parse.h b/thirdparty/freetype/src/type42/t42parse.h
index ba9e857190..7a68606f2e 100644
--- a/thirdparty/freetype/src/type42/t42parse.h
+++ b/thirdparty/freetype/src/type42/t42parse.h
@@ -4,7 +4,7 @@
/* */
/* Type 42 font parser (specification). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/t42types.h b/thirdparty/freetype/src/type42/t42types.h
index 850a156e45..2306ab6c77 100644
--- a/thirdparty/freetype/src/type42/t42types.h
+++ b/thirdparty/freetype/src/type42/t42types.h
@@ -4,7 +4,7 @@
/* */
/* Type 42 font data types (specification only). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/type42.c b/thirdparty/freetype/src/type42/type42.c
index 0d17a9b1dc..ae8ac26782 100644
--- a/thirdparty/freetype/src/type42/type42.c
+++ b/thirdparty/freetype/src/type42/type42.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Type 42 driver component. */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -15,11 +15,13 @@
/* */
/***************************************************************************/
-#define FT_MAKE_OPTION_SINGLE_OBJECT
+#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
+
+#include "t42drivr.c"
#include "t42objs.c"
#include "t42parse.c"
-#include "t42drivr.c"
+
/* END */
diff --git a/thirdparty/freetype/src/winfonts/fnterrs.h b/thirdparty/freetype/src/winfonts/fnterrs.h
index 6835d3e64f..4251021a70 100644
--- a/thirdparty/freetype/src/winfonts/fnterrs.h
+++ b/thirdparty/freetype/src/winfonts/fnterrs.h
@@ -4,7 +4,7 @@
/* */
/* Win FNT/FON error codes (specification only). */
/* */
-/* Copyright 2001-2016 by */
+/* Copyright 2001-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/winfonts/module.mk b/thirdparty/freetype/src/winfonts/module.mk
index 83da5732f1..ffc53a19f9 100644
--- a/thirdparty/freetype/src/winfonts/module.mk
+++ b/thirdparty/freetype/src/winfonts/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/winfonts/rules.mk b/thirdparty/freetype/src/winfonts/rules.mk
index 2fd7b822a2..73e825d9ae 100644
--- a/thirdparty/freetype/src/winfonts/rules.mk
+++ b/thirdparty/freetype/src/winfonts/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/winfonts/winfnt.c b/thirdparty/freetype/src/winfonts/winfnt.c
index 1c74ccd5ab..9811fbb05a 100644
--- a/thirdparty/freetype/src/winfonts/winfnt.c
+++ b/thirdparty/freetype/src/winfonts/winfnt.c
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver for Windows FNT/FON files */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* Copyright 2003 Huw D M Davies for Codeweavers */
/* Copyright 2007 Dmitry Timoshkov for Codeweavers */
@@ -561,7 +561,7 @@
error = fnt_font_load( face->font, stream );
if ( error )
{
- FT_TRACE2(( "font #%lu load error %d\n",
+ FT_TRACE2(( "font #%lu load error 0x%x\n",
dir_entry2.name, error ));
goto Fail;
}
@@ -759,6 +759,14 @@
if ( error )
goto Fail;
+ /* sanity check */
+ if ( !face->font->header.pixel_height )
+ {
+ FT_TRACE2(( "invalid pixel height\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Fail;
+ }
+
/* we now need to fill the root FT_Face fields */
/* with relevant information */
{
@@ -992,8 +1000,6 @@
FT_ULong offset;
FT_Bool new_format;
- FT_UNUSED( load_flags );
-
if ( !face )
{
@@ -1047,6 +1053,26 @@
goto Exit;
}
+ bitmap->rows = font->header.pixel_height;
+ bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
+
+ slot->bitmap_left = 0;
+ slot->bitmap_top = font->header.ascent;
+ slot->format = FT_GLYPH_FORMAT_BITMAP;
+
+ /* now set up metrics */
+ slot->metrics.width = (FT_Pos)( bitmap->width << 6 );
+ slot->metrics.height = (FT_Pos)( bitmap->rows << 6 );
+ slot->metrics.horiAdvance = (FT_Pos)( bitmap->width << 6 );
+ slot->metrics.horiBearingX = 0;
+ slot->metrics.horiBearingY = slot->bitmap_top << 6;
+
+ ft_synthesize_vertical_metrics( &slot->metrics,
+ (FT_Pos)( bitmap->rows << 6 ) );
+
+ if ( load_flags & FT_LOAD_BITMAP_METRICS_ONLY )
+ goto Exit;
+
/* jump to glyph data */
p = font->fnt_frame + /* font->header.bits_offset */ + offset;
@@ -1058,11 +1084,9 @@
FT_Byte* write;
- bitmap->pitch = (int)pitch;
- bitmap->rows = font->header.pixel_height;
- bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
-
- if ( offset + pitch * bitmap->rows > font->header.file_size )
+ bitmap->pitch = (int)pitch;
+ if ( !pitch ||
+ offset + pitch * bitmap->rows > font->header.file_size )
{
FT_TRACE2(( "invalid bitmap width\n" ));
error = FT_THROW( Invalid_File_Format );
@@ -1084,22 +1108,9 @@
for ( write = column; p < limit; p++, write += bitmap->pitch )
*write = *p;
}
- }
- slot->internal->flags = FT_GLYPH_OWN_BITMAP;
- slot->bitmap_left = 0;
- slot->bitmap_top = font->header.ascent;
- slot->format = FT_GLYPH_FORMAT_BITMAP;
-
- /* now set up metrics */
- slot->metrics.width = (FT_Pos)( bitmap->width << 6 );
- slot->metrics.height = (FT_Pos)( bitmap->rows << 6 );
- slot->metrics.horiAdvance = (FT_Pos)( bitmap->width << 6 );
- slot->metrics.horiBearingX = 0;
- slot->metrics.horiBearingY = slot->bitmap_top << 6;
-
- ft_synthesize_vertical_metrics( &slot->metrics,
- (FT_Pos)( bitmap->rows << 6 ) );
+ slot->internal->flags = FT_GLYPH_OWN_BITMAP;
+ }
Exit:
return error;
@@ -1161,10 +1172,10 @@
0x10000L,
0x20000L,
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
- 0, /* FT_Module_Constructor module_init */
- 0, /* FT_Module_Destructor module_done */
+ NULL, /* FT_Module_Constructor module_init */
+ NULL, /* FT_Module_Destructor module_done */
winfnt_get_service /* FT_Module_Requester get_interface */
},
@@ -1174,16 +1185,16 @@
FNT_Face_Init, /* FT_Face_InitFunc init_face */
FNT_Face_Done, /* FT_Face_DoneFunc done_face */
- 0, /* FT_Size_InitFunc init_size */
- 0, /* FT_Size_DoneFunc done_size */
- 0, /* FT_Slot_InitFunc init_slot */
- 0, /* FT_Slot_DoneFunc done_slot */
+ NULL, /* FT_Size_InitFunc init_size */
+ NULL, /* FT_Size_DoneFunc done_size */
+ NULL, /* FT_Slot_InitFunc init_slot */
+ NULL, /* FT_Slot_DoneFunc done_slot */
FNT_Load_Glyph, /* FT_Slot_LoadFunc load_glyph */
- 0, /* FT_Face_GetKerningFunc get_kerning */
- 0, /* FT_Face_AttachFunc attach_file */
- 0, /* FT_Face_GetAdvancesFunc get_advances */
+ NULL, /* FT_Face_GetKerningFunc get_kerning */
+ NULL, /* FT_Face_AttachFunc attach_file */
+ NULL, /* FT_Face_GetAdvancesFunc get_advances */
FNT_Size_Request, /* FT_Size_RequestFunc request_size */
FNT_Size_Select /* FT_Size_SelectFunc select_size */
diff --git a/thirdparty/freetype/src/winfonts/winfnt.h b/thirdparty/freetype/src/winfonts/winfnt.h
index 9a4f32d5b0..884b645a2d 100644
--- a/thirdparty/freetype/src/winfonts/winfnt.h
+++ b/thirdparty/freetype/src/winfonts/winfnt.h
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver for Windows FNT/FON files */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* Copyright 2007 Dmitry Timoshkov for Codeweavers */
/* */
diff --git a/thirdparty/glad/glad.c b/thirdparty/glad/glad.c
index 70a93f8d25..2d756ec3f6 100644
--- a/thirdparty/glad/glad.c
+++ b/thirdparty/glad/glad.c
@@ -1,6 +1,6 @@
/*
- OpenGL loader generated by glad 0.1.13a0 on Fri Jan 6 19:27:07 2017.
+ OpenGL loader generated by glad 0.1.14a0 on Wed Jun 14 20:12:45 2017.
Language/Generator: C/C++
Specification: gl
@@ -30,7 +30,7 @@ static void* get_proc(const char *namez);
static HMODULE libGL;
typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
-PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
+static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
static
int open_gl(void) {
@@ -57,7 +57,7 @@ static void* libGL;
#ifndef __APPLE__
typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*);
-PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
+static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
#endif
static
@@ -152,19 +152,19 @@ static int get_exts(void) {
exts = (const char *)glGetString(GL_EXTENSIONS);
#ifdef _GLAD_IS_SOME_NEW_VERSION
} else {
- int index;
+ unsigned int index;
num_exts_i = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i);
if (num_exts_i > 0) {
- exts_i = (const char **)realloc((void *)exts_i, num_exts_i * sizeof *exts_i);
+ exts_i = (const char **)realloc((void *)exts_i, (size_t)num_exts_i * (sizeof *exts_i));
}
if (exts_i == NULL) {
return 0;
}
- for(index = 0; index < num_exts_i; index++) {
+ for(index = 0; index < (unsigned)num_exts_i; index++) {
exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index);
}
}
@@ -174,7 +174,7 @@ static int get_exts(void) {
static void free_exts(void) {
if (exts_i != NULL) {
- free((char **)exts_i);
+ free((void *)exts_i);
exts_i = NULL;
}
}
diff --git a/thirdparty/glad/glad/glad.h b/thirdparty/glad/glad/glad.h
index e5eb22e297..cb78df071e 100644
--- a/thirdparty/glad/glad/glad.h
+++ b/thirdparty/glad/glad/glad.h
@@ -1,6 +1,6 @@
/*
- OpenGL loader generated by glad 0.1.13a0 on Fri Jan 6 19:27:07 2017.
+ OpenGL loader generated by glad 0.1.14a0 on Wed Jun 14 20:12:45 2017.
Language/Generator: C/C++
Specification: gl
@@ -54,7 +54,7 @@ typedef void* (* GLADloadproc)(const char *name);
#ifndef GLAPI
# if defined(GLAD_GLAPI_EXPORT)
-# if defined(WIN32) || defined(__CYGWIN__)
+# if defined(_WIN32) || defined(__CYGWIN__)
# if defined(GLAD_GLAPI_EXPORT_BUILD)
# if defined(__GNUC__)
# define GLAPI __attribute__ ((dllexport)) extern
@@ -183,6 +183,7 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen
typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
typedef unsigned short GLhalfNV;
typedef GLintptr GLvdpauSurfaceNV;
+typedef void (APIENTRY *GLVULKANPROCNV)(void);
#define GL_DEPTH_BUFFER_BIT 0x00000100
#define GL_STENCIL_BUFFER_BIT 0x00000400
#define GL_COLOR_BUFFER_BIT 0x00004000
@@ -264,7 +265,6 @@ typedef GLintptr GLvdpauSurfaceNV;
#define GL_BLEND_SRC 0x0BE1
#define GL_BLEND 0x0BE2
#define GL_LOGIC_OP_MODE 0x0BF0
-#define GL_COLOR_LOGIC_OP 0x0BF2
#define GL_DRAW_BUFFER 0x0C01
#define GL_READ_BUFFER 0x0C02
#define GL_SCISSOR_BOX 0x0C10
@@ -292,21 +292,9 @@ typedef GLintptr GLvdpauSurfaceNV;
#define GL_SUBPIXEL_BITS 0x0D50
#define GL_TEXTURE_1D 0x0DE0
#define GL_TEXTURE_2D 0x0DE1
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_POINT 0x2A01
-#define GL_POLYGON_OFFSET_LINE 0x2A02
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_TEXTURE_BINDING_1D 0x8068
-#define GL_TEXTURE_BINDING_2D 0x8069
#define GL_TEXTURE_WIDTH 0x1000
#define GL_TEXTURE_HEIGHT 0x1001
-#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
#define GL_TEXTURE_BORDER_COLOR 0x1004
-#define GL_TEXTURE_RED_SIZE 0x805C
-#define GL_TEXTURE_GREEN_SIZE 0x805D
-#define GL_TEXTURE_BLUE_SIZE 0x805E
-#define GL_TEXTURE_ALPHA_SIZE 0x805F
#define GL_DONT_CARE 0x1100
#define GL_FASTEST 0x1101
#define GL_NICEST 0x1102
@@ -317,7 +305,6 @@ typedef GLintptr GLvdpauSurfaceNV;
#define GL_INT 0x1404
#define GL_UNSIGNED_INT 0x1405
#define GL_FLOAT 0x1406
-#define GL_DOUBLE 0x140A
#define GL_STACK_OVERFLOW 0x0503
#define GL_STACK_UNDERFLOW 0x0504
#define GL_CLEAR 0x1500
@@ -369,23 +356,7 @@ typedef GLintptr GLvdpauSurfaceNV;
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_WRAP_S 0x2802
#define GL_TEXTURE_WRAP_T 0x2803
-#define GL_PROXY_TEXTURE_1D 0x8063
-#define GL_PROXY_TEXTURE_2D 0x8064
#define GL_REPEAT 0x2901
-#define GL_R3_G3_B2 0x2A10
-#define GL_RGB4 0x804F
-#define GL_RGB5 0x8050
-#define GL_RGB8 0x8051
-#define GL_RGB10 0x8052
-#define GL_RGB12 0x8053
-#define GL_RGB16 0x8054
-#define GL_RGBA2 0x8055
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGBA8 0x8058
-#define GL_RGB10_A2 0x8059
-#define GL_RGBA12 0x805A
-#define GL_RGBA16 0x805B
#define GL_CURRENT_BIT 0x00000001
#define GL_POINT_BIT 0x00000002
#define GL_LINE_BIT 0x00000004
@@ -404,9 +375,6 @@ typedef GLintptr GLvdpauSurfaceNV;
#define GL_TEXTURE_BIT 0x00040000
#define GL_SCISSOR_BIT 0x00080000
#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF
-#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
-#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
-#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
#define GL_QUAD_STRIP 0x0008
#define GL_POLYGON 0x0009
#define GL_ACCUM 0x0100
@@ -446,14 +414,6 @@ typedef GLintptr GLvdpauSurfaceNV;
#define GL_PIXEL_MAP_G_TO_G 0x0C77
#define GL_PIXEL_MAP_B_TO_B 0x0C78
#define GL_PIXEL_MAP_A_TO_A 0x0C79
-#define GL_VERTEX_ARRAY_POINTER 0x808E
-#define GL_NORMAL_ARRAY_POINTER 0x808F
-#define GL_COLOR_ARRAY_POINTER 0x8090
-#define GL_INDEX_ARRAY_POINTER 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
-#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
-#define GL_SELECTION_BUFFER_POINTER 0x0DF3
#define GL_CURRENT_COLOR 0x0B00
#define GL_CURRENT_INDEX 0x0B01
#define GL_CURRENT_NORMAL 0x0B02
@@ -499,11 +459,9 @@ typedef GLintptr GLvdpauSurfaceNV;
#define GL_PROJECTION_MATRIX 0x0BA7
#define GL_TEXTURE_MATRIX 0x0BA8
#define GL_ATTRIB_STACK_DEPTH 0x0BB0
-#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
#define GL_ALPHA_TEST 0x0BC0
#define GL_ALPHA_TEST_FUNC 0x0BC1
#define GL_ALPHA_TEST_REF 0x0BC2
-#define GL_INDEX_LOGIC_OP 0x0BF1
#define GL_LOGIC_OP 0x0BF1
#define GL_AUX_BUFFERS 0x0C00
#define GL_INDEX_CLEAR_VALUE 0x0C20
@@ -553,7 +511,6 @@ typedef GLintptr GLvdpauSurfaceNV;
#define GL_MAX_NAME_STACK_DEPTH 0x0D37
#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
-#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
#define GL_INDEX_BITS 0x0D51
#define GL_RED_BITS 0x0D52
#define GL_GREEN_BITS 0x0D53
@@ -589,35 +546,8 @@ typedef GLintptr GLvdpauSurfaceNV;
#define GL_MAP1_GRID_SEGMENTS 0x0DD1
#define GL_MAP2_GRID_DOMAIN 0x0DD2
#define GL_MAP2_GRID_SEGMENTS 0x0DD3
-#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
-#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
-#define GL_SELECTION_BUFFER_SIZE 0x0DF4
-#define GL_VERTEX_ARRAY 0x8074
-#define GL_NORMAL_ARRAY 0x8075
-#define GL_COLOR_ARRAY 0x8076
-#define GL_INDEX_ARRAY 0x8077
-#define GL_TEXTURE_COORD_ARRAY 0x8078
-#define GL_EDGE_FLAG_ARRAY 0x8079
-#define GL_VERTEX_ARRAY_SIZE 0x807A
-#define GL_VERTEX_ARRAY_TYPE 0x807B
-#define GL_VERTEX_ARRAY_STRIDE 0x807C
-#define GL_NORMAL_ARRAY_TYPE 0x807E
-#define GL_NORMAL_ARRAY_STRIDE 0x807F
-#define GL_COLOR_ARRAY_SIZE 0x8081
-#define GL_COLOR_ARRAY_TYPE 0x8082
-#define GL_COLOR_ARRAY_STRIDE 0x8083
-#define GL_INDEX_ARRAY_TYPE 0x8085
-#define GL_INDEX_ARRAY_STRIDE 0x8086
-#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
-#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
#define GL_TEXTURE_COMPONENTS 0x1003
#define GL_TEXTURE_BORDER 0x1005
-#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE 0x8061
-#define GL_TEXTURE_PRIORITY 0x8066
-#define GL_TEXTURE_RESIDENT 0x8067
#define GL_AMBIENT 0x1200
#define GL_DIFFUSE 0x1201
#define GL_SPECULAR 0x1202
@@ -664,6 +594,91 @@ typedef GLintptr GLvdpauSurfaceNV;
#define GL_OBJECT_PLANE 0x2501
#define GL_EYE_PLANE 0x2502
#define GL_CLAMP 0x2900
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
+#define GL_LIGHT0 0x4000
+#define GL_LIGHT1 0x4001
+#define GL_LIGHT2 0x4002
+#define GL_LIGHT3 0x4003
+#define GL_LIGHT4 0x4004
+#define GL_LIGHT5 0x4005
+#define GL_LIGHT6 0x4006
+#define GL_LIGHT7 0x4007
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_GREEN_SIZE 0x805D
+#define GL_TEXTURE_BLUE_SIZE 0x805E
+#define GL_TEXTURE_ALPHA_SIZE 0x805F
+#define GL_DOUBLE 0x140A
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_2D 0x8064
+#define GL_R3_G3_B2 0x2A10
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB8 0x8051
+#define GL_RGB10 0x8052
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGBA2 0x8055
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGBA8 0x8058
+#define GL_RGB10_A2 0x8059
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_INDEX_ARRAY_POINTER 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
+#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
+#define GL_SELECTION_BUFFER_POINTER 0x0DF3
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#define GL_INDEX_LOGIC_OP 0x0BF1
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
+#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
+#define GL_SELECTION_BUFFER_SIZE 0x0DF4
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_COLOR_ARRAY 0x8076
+#define GL_INDEX_ARRAY 0x8077
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_EDGE_FLAG_ARRAY 0x8079
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_INDEX_ARRAY_TYPE 0x8085
+#define GL_INDEX_ARRAY_STRIDE 0x8086
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE 0x8061
+#define GL_TEXTURE_PRIORITY 0x8066
+#define GL_TEXTURE_RESIDENT 0x8067
#define GL_ALPHA4 0x803B
#define GL_ALPHA8 0x803C
#define GL_ALPHA12 0x803D
@@ -697,20 +712,6 @@ typedef GLintptr GLvdpauSurfaceNV;
#define GL_T2F_N3F_V3F 0x2A2B
#define GL_T2F_C4F_N3F_V3F 0x2A2C
#define GL_T4F_C4F_N3F_V4F 0x2A2D
-#define GL_CLIP_PLANE0 0x3000
-#define GL_CLIP_PLANE1 0x3001
-#define GL_CLIP_PLANE2 0x3002
-#define GL_CLIP_PLANE3 0x3003
-#define GL_CLIP_PLANE4 0x3004
-#define GL_CLIP_PLANE5 0x3005
-#define GL_LIGHT0 0x4000
-#define GL_LIGHT1 0x4001
-#define GL_LIGHT2 0x4002
-#define GL_LIGHT3 0x4003
-#define GL_LIGHT4 0x4004
-#define GL_LIGHT5 0x4005
-#define GL_LIGHT6 0x4006
-#define GL_LIGHT7 0x4007
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
diff --git a/thirdparty/libpng/arm/filter_neon.S b/thirdparty/libpng/arm/filter_neon.S
index 3b061d6bbf..09267c6030 100644
--- a/thirdparty/libpng/arm/filter_neon.S
+++ b/thirdparty/libpng/arm/filter_neon.S
@@ -1,9 +1,9 @@
/* filter_neon.S - NEON optimised filter functions
*
- * Copyright (c) 2014 Glenn Randers-Pehrson
+ * Copyright (c) 2014,2017 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
- * Last changed in libpng 1.6.16 [December 22, 2014]
+ * Last changed in libpng 1.6.31 [(PENDING RELEASE)]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -16,7 +16,7 @@
#define PNG_VERSION_INFO_ONLY
#include "../pngpriv.h"
-#if defined(__linux__) && defined(__ELF__)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
#endif
diff --git a/thirdparty/libpng/png.c b/thirdparty/libpng/png.c
index 78ce39f46d..87fda0b306 100644
--- a/thirdparty/libpng/png.c
+++ b/thirdparty/libpng/png.c
@@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions
*
- * Last changed in libpng 1.6.28 [January 5, 2017]
+ * Last changed in libpng 1.6.31 [(PENDING RELEASE)]
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -14,7 +14,27 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_28 Your_png_h_is_not_version_1_6_28;
+typedef png_libpng_version_1_6_31rc01 Your_png_h_is_not_version_1_6_31rc01;
+
+#ifdef __GNUC__
+/* The version tests may need to be added to, but the problem warning has
+ * consistently been fixed in GCC versions which obtain wide-spread release.
+ * The problem is that many versions of GCC rearrange comparison expressions in
+ * the optimizer in such a way that the results of the comparison will change
+ * if signed integer overflow occurs. Such comparisons are not permitted in
+ * ANSI C90, however GCC isn't clever enough to work out that that do not occur
+ * below in png_ascii_from_fp and png_muldiv, so it produces a warning with
+ * -Wextra. Unfortunately this is highly dependent on the optimizer and the
+ * machine architecture so the warning comes and goes unpredictably and is
+ * impossible to "fix", even were that a good idea.
+ */
+#if __GNUC__ == 7 && __GNUC_MINOR__ == 1
+#define GCC_STRICT_OVERFLOW 1
+#endif /* GNU 7.1.x */
+#endif /* GNU */
+#ifndef GCC_STRICT_OVERFLOW
+#define GCC_STRICT_OVERFLOW 0
+#endif
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
@@ -595,6 +615,16 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
}
#endif
+#ifdef PNG_eXIf_SUPPORTED
+ /* Free any eXIf entry */
+ if (((mask & PNG_FREE_EXIF) & info_ptr->free_me) != 0)
+ {
+ png_free(png_ptr, info_ptr->exif);
+ info_ptr->exif = NULL;
+ info_ptr->valid &= ~PNG_INFO_eXIf;
+ }
+#endif
+
#ifdef PNG_hIST_SUPPORTED
/* Free any hIST entry */
if (((mask & PNG_FREE_HIST) & info_ptr->free_me) != 0)
@@ -776,14 +806,14 @@ png_get_copyright(png_const_structrp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
- "libpng version 1.6.28 - January 5, 2017" PNG_STRING_NEWLINE \
+ "libpng version 1.6.31rc01 - July 19, 2017" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
- return "libpng version 1.6.28 - January 5, 2017\
+ return "libpng version 1.6.31rc01 - July 19, 2017\
Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@@ -2832,7 +2862,7 @@ png_pow10(int power)
if (power < 0)
{
if (power < DBL_MIN_10_EXP) return 0;
- recip = 1, power = -power;
+ recip = 1; power = -power;
}
if (power > 0)
@@ -2857,6 +2887,14 @@ png_pow10(int power)
/* Function to format a floating point value in ASCII with a given
* precision.
*/
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic push
+/* The problem arises below with exp_b10, which can never overflow because it
+ * comes, originally, from frexp and is therefore limited to a range which is
+ * typically +/-710 (log2(DBL_MAX)/log2(DBL_MIN)).
+ */
+#pragma GCC diagnostic warning "-Wstrict-overflow=2"
+#endif /* GCC_STRICT_OVERFLOW */
void /* PRIVATE */
png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
double fp, unsigned int precision)
@@ -2910,7 +2948,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
double test = png_pow10(exp_b10+1);
if (test <= DBL_MAX)
- ++exp_b10, base = test;
+ {
+ ++exp_b10; base = test;
+ }
else
break;
@@ -2924,7 +2964,10 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
* test on DBL_MAX above.
*/
fp /= base;
- while (fp >= 1) fp /= 10, ++exp_b10;
+ while (fp >= 1)
+ {
+ fp /= 10; ++exp_b10;
+ }
/* Because of the code above fp may, at this point, be
* less than .1, this is ok because the code below can
@@ -2941,7 +2984,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
*/
if (exp_b10 < 0 && exp_b10 > -3) /* PLUS 3 TOTAL 4 */
{
- czero = (unsigned int)(-exp_b10); /* PLUS 2 digits: TOTAL 3 */
+ czero = 0U-exp_b10; /* PLUS 2 digits: TOTAL 3 */
exp_b10 = 0; /* Dot added below before first output. */
}
else
@@ -2975,7 +3018,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
/* Rounding up to 10, handle that here. */
if (czero > 0)
{
- --czero, d = 1;
+ --czero; d = 1;
if (cdigits == 0) --clead;
}
else
@@ -2989,7 +3032,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
else if (ch == 46)
{
- ch = *--ascii, ++size;
+ ch = *--ascii; ++size;
/* Advance exp_b10 to '1', so that the
* decimal point happens after the
* previous digit.
@@ -3016,7 +3059,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
int ch = *--ascii;
if (ch == 46)
- ++size, exp_b10 = 1;
+ {
+ ++size; exp_b10 = 1;
+ }
/* Else lost a leading zero, so 'exp_b10' is
* still ok at (-1)
@@ -3052,21 +3097,26 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
*/
if (exp_b10 != (-1))
{
- if (exp_b10 == 0) *ascii++ = 46, --size;
+ if (exp_b10 == 0)
+ {
+ *ascii++ = 46; --size;
+ }
/* PLUS 1: TOTAL 4 */
--exp_b10;
}
- *ascii++ = 48, --czero;
+ *ascii++ = 48; --czero;
}
if (exp_b10 != (-1))
{
if (exp_b10 == 0)
- *ascii++ = 46, --size; /* counted above */
+ {
+ *ascii++ = 46; --size; /* counted above */
+ }
--exp_b10;
}
- *ascii++ = (char)(48 + (int)d), ++cdigits;
+ *ascii++ = (char)(48 + (int)d); ++cdigits;
}
}
while (cdigits+czero < precision+clead && fp > DBL_MIN);
@@ -3075,7 +3125,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
/* Check for an exponent, if we don't need one we are
* done and just need to terminate the string. At
- * this point exp_b10==(-1) is effectively if flag - it got
+ * this point exp_b10==(-1) is effectively a flag - it got
* to '-1' because of the decrement after outputting
* the decimal point above (the exponent required is
* *not* -1!)
@@ -3089,7 +3139,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
* zeros were *not* output, so this doesn't increase
* the output count.
*/
- while (--exp_b10 >= 0) *ascii++ = 48;
+ while (exp_b10-- > 0) *ascii++ = 48;
*ascii = 0;
@@ -3107,7 +3157,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
*/
size -= cdigits;
- *ascii++ = 69, --size; /* 'E': PLUS 1 TOTAL 2+precision */
+ *ascii++ = 69; --size; /* 'E': PLUS 1 TOTAL 2+precision */
/* The following use of an unsigned temporary avoids ambiguities in
* the signed arithmetic on exp_b10 and permits GCC at least to do
@@ -3118,12 +3168,12 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
if (exp_b10 < 0)
{
- *ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */
- uexp_b10 = (unsigned int)(-exp_b10);
+ *ascii++ = 45; --size; /* '-': PLUS 1 TOTAL 3+precision */
+ uexp_b10 = 0U-exp_b10;
}
else
- uexp_b10 = (unsigned int)exp_b10;
+ uexp_b10 = 0U+exp_b10;
cdigits = 0;
@@ -3166,6 +3216,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
/* Here on buffer too small. */
png_error(png_ptr, "ASCII conversion buffer too small");
}
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic pop
+#endif /* GCC_STRICT_OVERFLOW */
# endif /* FLOATING_POINT */
@@ -3185,7 +3238,9 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
/* Avoid overflow here on the minimum integer. */
if (fp < 0)
- *ascii++ = 45, num = (png_uint_32)(-fp);
+ {
+ *ascii++ = 45; num = (png_uint_32)(-fp);
+ }
else
num = (png_uint_32)fp;
@@ -3223,7 +3278,10 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
* then ndigits digits to first:
*/
i = 5;
- while (ndigits < i) *ascii++ = 48, --i;
+ while (ndigits < i)
+ {
+ *ascii++ = 48; --i;
+ }
while (ndigits >= first) *ascii++ = digits[--ndigits];
/* Don't output the trailing zeros! */
}
@@ -3274,6 +3332,15 @@ png_fixed(png_const_structrp png_ptr, double fp, png_const_charp text)
* the nearest .00001). Overflow and divide by zero are signalled in
* the result, a boolean - true on success, false on overflow.
*/
+#if GCC_STRICT_OVERFLOW /* from above */
+/* It is not obvious which comparison below gets optimized in such a way that
+ * signed overflow would change the result; looking through the code does not
+ * reveal any tests which have the form GCC complains about, so presumably the
+ * optimizer is moving an add or subtract into the 'if' somewhere.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-Wstrict-overflow=2"
+#endif /* GCC_STRICT_OVERFLOW */
int
png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
png_int_32 divisor)
@@ -3388,6 +3455,9 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
return 0;
}
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic pop
+#endif /* GCC_STRICT_OVERFLOW */
#endif /* READ_GAMMA || INCH_CONVERSIONS */
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
@@ -4260,13 +4330,13 @@ png_set_option(png_structrp png_ptr, int option, int onoff)
if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT &&
(option & 1) == 0)
{
- png_uint_32 mask = 3 << option;
- png_uint_32 setting = (2 + (onoff != 0)) << option;
+ png_uint_32 mask = 3U << option;
+ png_uint_32 setting = (2U + (onoff != 0)) << option;
png_uint_32 current = png_ptr->options;
png_ptr->options = (png_uint_32)(((current & ~mask) | setting) & 0xff);
- return (current & mask) >> option;
+ return (int)(current & mask) >> option;
}
return PNG_OPTION_INVALID;
@@ -4278,7 +4348,7 @@ png_set_option(png_structrp png_ptr, int option, int onoff)
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
/* sRGB conversion tables; these are machine generated with the code in
* contrib/tools/makesRGB.c. The actual sRGB transfer curve defined in the
- * specification (see the article at http://en.wikipedia.org/wiki/SRGB)
+ * specification (see the article at https://en.wikipedia.org/wiki/SRGB)
* is used, not the gamma=1/2.2 approximation use elsewhere in libpng.
* The sRGB to linear table is exact (to the nearest 16-bit linear fraction).
* The inverse (linear to sRGB) table has accuracies as follows:
diff --git a/thirdparty/libpng/png.h b/thirdparty/libpng/png.h
index e4cf032816..80ecc82c3a 100644
--- a/thirdparty/libpng/png.h
+++ b/thirdparty/libpng/png.h
@@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.6.28, January 5, 2017
+ * libpng version 1.6.31rc01, July 19, 2017
*
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -12,7 +12,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
- * libpng versions 0.97, January 1998, through 1.6.28, January 5, 2017:
+ * libpng versions 0.97, January 1998, through 1.6.31rc01, July 19, 2017:
* Glenn Randers-Pehrson.
* See also "Contributing Authors", below.
*/
@@ -25,7 +25,7 @@
*
* This code is released under the libpng license.
*
- * libpng versions 1.0.7, July 1, 2000 through 1.6.28, January 5, 2017 are
+ * libpng versions 1.0.7, July 1, 2000 through 1.6.31rc01, July 19, 2017 are
* Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
* derived from libpng-1.0.6, and are distributed according to the same
* disclaimer and license as libpng-1.0.6 with the following individuals
@@ -38,6 +38,8 @@
* Gilles Vollant
* James Yu
* Mandar Sahastrabuddhe
+ * Google Inc.
+ * Vadim Barkov
*
* and with the following additions to the disclaimer:
*
@@ -211,7 +213,7 @@
* ...
* 1.5.28 15 10527 15.so.15.28[.0]
* ...
- * 1.6.28 16 10628 16.so.16.28[.0]
+ * 1.6.31 16 10631 16.so.16.31[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@@ -232,20 +234,20 @@
*
* See libpng.txt or libpng.3 for more information. The PNG specification
* is available as a W3C Recommendation and as an ISO Specification,
- * <http://www.w3.org/TR/2003/REC-PNG-20031110/
+ * <https://www.w3.org/TR/2003/REC-PNG-20031110/
*/
/*
* Y2K compliance in libpng:
* =========================
*
- * January 5, 2017
+ * July 19, 2017
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
- * upward through 1.6.28 are Y2K compliant. It is my belief that
+ * upward through 1.6.31rc01 are Y2K compliant. It is my belief that
* earlier versions were also Y2K compliant.
*
* Libpng only has two year fields. One is a 2-byte unsigned integer
@@ -307,8 +309,8 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.28"
-#define PNG_HEADER_VERSION_STRING " libpng version 1.6.28 - January 5, 2017\n"
+#define PNG_LIBPNG_VER_STRING "1.6.31rc01"
+#define PNG_HEADER_VERSION_STRING " libpng version 1.6.31rc01 - July 19, 2017\n"
#define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16
@@ -316,13 +318,13 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
-#define PNG_LIBPNG_VER_RELEASE 28
+#define PNG_LIBPNG_VER_RELEASE 31
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/
-#define PNG_LIBPNG_VER_BUILD 0
+#define PNG_LIBPNG_VER_BUILD 01
/* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1
@@ -339,7 +341,7 @@
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
PNG_LIBPNG_BUILD_PRIVATE */
-#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
+#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_RC
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
* We must not include leading zeros.
@@ -347,7 +349,7 @@
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/
-#define PNG_LIBPNG_VER 10628 /* 1.6.28 */
+#define PNG_LIBPNG_VER 10631 /* 1.6.31 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -457,7 +459,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
-typedef char* png_libpng_version_1_6_28;
+typedef char* png_libpng_version_1_6_31rc01;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
@@ -774,6 +776,7 @@ typedef png_unknown_chunk * * png_unknown_chunkpp;
#define PNG_INFO_sPLT 0x2000U /* ESR, 1.0.6 */
#define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */
#define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */
+#define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */
/* This is used for the transformation routines, as some of them
* change these values for the row. It also should enable using
@@ -1786,7 +1789,8 @@ PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr,
#define PNG_FREE_PLTE 0x1000U
#define PNG_FREE_TRNS 0x2000U
#define PNG_FREE_TEXT 0x4000U
-#define PNG_FREE_ALL 0x7fffU
+#define PNG_FREE_EXIF 0x8000U /* Added at libpng-1.6.31 */
+#define PNG_FREE_ALL 0xffffU
#define PNG_FREE_MUL 0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
#ifdef PNG_USER_MEM_SUPPORTED
@@ -2005,6 +2009,13 @@ PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,
png_fixed_point int_blue_Z))
#endif
+#ifdef PNG_eXIf_SUPPORTED
+PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_bytep *exif));
+PNG_EXPORT(247, void, png_set_eXIf, (png_const_structrp png_ptr,
+ png_inforp info_ptr, const png_bytep exif));
+#endif
+
#ifdef PNG_gAMA_SUPPORTED
PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,
png_const_inforp info_ptr, double *file_gamma))
@@ -2023,9 +2034,6 @@ PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr,
#ifdef PNG_hIST_SUPPORTED
PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,
png_inforp info_ptr, png_uint_16p *hist));
-#endif
-
-#ifdef PNG_hIST_SUPPORTED
PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,
png_inforp info_ptr, png_const_uint_16p hist));
#endif
@@ -2751,7 +2759,7 @@ typedef struct
*
* When the simplified API needs to convert between sRGB and linear colorspaces,
* the actual sRGB transfer curve defined in the sRGB specification (see the
- * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+ * article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
* approximation used elsewhere in libpng.
*
* When an alpha channel is present it is expected to denote pixel coverage
@@ -3224,7 +3232,10 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
# define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */
#endif
#define PNG_IGNORE_ADLER32 8
-#define PNG_OPTION_NEXT 10 /* Next option - numbers must be even */
+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
+# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions supported */
+#endif
+#define PNG_OPTION_NEXT 12 /* Next option - numbers must be even */
/* Return values: NOTE: there are four values and 'off' is *not* zero */
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */
@@ -3248,7 +3259,7 @@ PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,
* one to use is one more than this.)
*/
#ifdef PNG_EXPORT_LAST_ORDINAL
- PNG_EXPORT_LAST_ORDINAL(245);
+ PNG_EXPORT_LAST_ORDINAL(247);
#endif
#ifdef __cplusplus
diff --git a/thirdparty/libpng/pngconf.h b/thirdparty/libpng/pngconf.h
index 5e8b40bcfb..9308d6a60a 100644
--- a/thirdparty/libpng/pngconf.h
+++ b/thirdparty/libpng/pngconf.h
@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
- * libpng version 1.6.28, January 5, 2017
+ * libpng version 1.6.31rc01, July 19, 2017
*
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/thirdparty/libpng/pngerror.c b/thirdparty/libpng/pngerror.c
index 00d76f7c05..37f26c6558 100644
--- a/thirdparty/libpng/pngerror.c
+++ b/thirdparty/libpng/pngerror.c
@@ -1,8 +1,8 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.31 [(PENDING RELEASE)]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -163,7 +163,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
case PNG_NUMBER_FORMAT_02u:
/* Expects at least 2 digits. */
mincount = 2;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case PNG_NUMBER_FORMAT_u:
*--end = digits[number % 10];
@@ -173,7 +173,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
case PNG_NUMBER_FORMAT_02x:
/* This format expects at least two digits */
mincount = 2;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case PNG_NUMBER_FORMAT_x:
*--end = digits[number & 0xf];
diff --git a/thirdparty/libpng/pngget.c b/thirdparty/libpng/pngget.c
index 141c393330..ace9e6351f 100644
--- a/thirdparty/libpng/pngget.c
+++ b/thirdparty/libpng/pngget.c
@@ -773,6 +773,24 @@ png_get_sPLT(png_const_structrp png_ptr, png_inforp info_ptr,
}
#endif
+#ifdef PNG_eXIf_SUPPORTED
+png_uint_32 PNGAPI
+png_get_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
+ png_bytep *exif)
+{
+ png_debug1(1, "in %s retrieval function", "eXIf");
+
+ if (png_ptr != NULL && info_ptr != NULL &&
+ (info_ptr->valid & PNG_INFO_eXIf) != 0 && exif != NULL)
+ {
+ *exif = info_ptr->exif;
+ return (PNG_INFO_eXIf);
+ }
+
+ return (0);
+}
+#endif
+
#ifdef PNG_hIST_SUPPORTED
png_uint_32 PNGAPI
png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
diff --git a/thirdparty/libpng/pnginfo.h b/thirdparty/libpng/pnginfo.h
index 361ed8be70..6e6d46a62b 100644
--- a/thirdparty/libpng/pnginfo.h
+++ b/thirdparty/libpng/pnginfo.h
@@ -185,6 +185,11 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */
#endif
+#ifdef PNG_eXIf_SUPPORTED
+ int num_exif;
+ png_bytep exif;
+#endif
+
#ifdef PNG_hIST_SUPPORTED
/* The hIST chunk contains the relative frequency or importance of the
* various palette entries, so that a viewer can intelligently select a
diff --git a/thirdparty/libpng/pnglibconf.h b/thirdparty/libpng/pnglibconf.h
index ee70573605..8738ebdfc2 100644
--- a/thirdparty/libpng/pnglibconf.h
+++ b/thirdparty/libpng/pnglibconf.h
@@ -1,10 +1,10 @@
-/* libpng 1.6.28 STANDARD API DEFINITION */
+/* libpng 1.6.31rc01 STANDARD API DEFINITION */
/* pnglibconf.h - library build configuration */
-/* Libpng version 1.6.28 - January 5, 2017 */
+/* Libpng version 1.6.31rc01 - July 19, 2017 */
-/* Copyright (c) 1998-2015 Glenn Randers-Pehrson */
+/* Copyright (c) 1998-2017 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
/* For conditions of distribution and use, see the disclaimer */
@@ -20,6 +20,8 @@
#define PNG_ALIGNED_MEMORY_SUPPORTED
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
+/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
+/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
#define PNG_BENIGN_ERRORS_SUPPORTED
#define PNG_BENIGN_READ_ERRORS_SUPPORTED
/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
@@ -82,6 +84,7 @@
#define PNG_READ_USER_TRANSFORM_SUPPORTED
#define PNG_READ_bKGD_SUPPORTED
#define PNG_READ_cHRM_SUPPORTED
+#define PNG_READ_eXIf_SUPPORTED
#define PNG_READ_gAMA_SUPPORTED
#define PNG_READ_hIST_SUPPORTED
#define PNG_READ_iCCP_SUPPORTED
@@ -151,6 +154,7 @@
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#define PNG_WRITE_bKGD_SUPPORTED
#define PNG_WRITE_cHRM_SUPPORTED
+#define PNG_WRITE_eXIf_SUPPORTED
#define PNG_WRITE_gAMA_SUPPORTED
#define PNG_WRITE_hIST_SUPPORTED
#define PNG_WRITE_iCCP_SUPPORTED
@@ -168,6 +172,7 @@
#define PNG_WRITE_zTXt_SUPPORTED
#define PNG_bKGD_SUPPORTED
#define PNG_cHRM_SUPPORTED
+#define PNG_eXIf_SUPPORTED
#define PNG_gAMA_SUPPORTED
#define PNG_hIST_SUPPORTED
#define PNG_iCCP_SUPPORTED
diff --git a/thirdparty/libpng/pngpriv.h b/thirdparty/libpng/pngpriv.h
index ed61165b2d..7c273bd5e3 100644
--- a/thirdparty/libpng/pngpriv.h
+++ b/thirdparty/libpng/pngpriv.h
@@ -1,8 +1,8 @@
/* pngpriv.h - private declarations for use inside libpng
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.31 [(PENDING RELEASE)]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -35,7 +35,9 @@
* Windows/Visual Studio) there is no effect; the OS specific tests below are
* still required (as of 2011-05-02.)
*/
-#define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
+#ifndef _POSIX_SOURCE
+# define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
+#endif
#ifndef PNG_VERSION_INFO_ONLY
/* Standard library headers not required by png.h: */
@@ -190,6 +192,50 @@
# endif
#endif
+#ifndef PNG_POWERPC_VSX_OPT
+# if defined(__PPC64__) && defined(__ALTIVEC__) && defined(__VSX__)
+# define PNG_POWERPC_VSX_OPT 2
+# else
+# define PNG_POWERPC_VSX_OPT 0
+# endif
+#endif
+
+#ifndef PNG_INTEL_SSE_OPT
+# ifdef PNG_INTEL_SSE
+ /* Only check for SSE if the build configuration has been modified to
+ * enable SSE optimizations. This means that these optimizations will
+ * be off by default. See contrib/intel for more details.
+ */
+# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
+ defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
+ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
+# define PNG_INTEL_SSE_OPT 1
+# endif
+# endif
+#endif
+
+#if PNG_INTEL_SSE_OPT > 0
+# ifndef PNG_INTEL_SSE_IMPLEMENTATION
+# if defined(__SSE4_1__) || defined(__AVX__)
+ /* We are not actually using AVX, but checking for AVX is the best
+ way we can detect SSE4.1 and SSSE3 on MSVC.
+ */
+# define PNG_INTEL_SSE_IMPLEMENTATION 3
+# elif defined(__SSSE3__)
+# define PNG_INTEL_SSE_IMPLEMENTATION 2
+# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
+ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
+# define PNG_INTEL_SSE_IMPLEMENTATION 1
+# else
+# define PNG_INTEL_SSE_IMPLEMENTATION 0
+# endif
+# endif
+
+# if PNG_INTEL_SSE_IMPLEMENTATION > 0
+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
+# endif
+#endif
+
#if PNG_MIPS_MSA_OPT > 0
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_msa
# ifndef PNG_MIPS_MSA_IMPLEMENTATION
@@ -210,6 +256,11 @@
# endif
#endif /* PNG_MIPS_MSA_OPT > 0 */
+#if PNG_POWERPC_VSX_OPT > 0
+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_vsx
+# define PNG_POWERPC_VSX_IMPLEMENTATION 1
+#endif
+
/* Is this a build of a DLL where compilation of the object modules requires
* different preprocessor settings to those required for a simple library? If
@@ -403,6 +454,21 @@
# define png_fixed_error(s1,s2) png_err(s1)
#endif
+/* Some fixed point APIs are still required even if not exported because
+ * they get used by the corresponding floating point APIs. This magic
+ * deals with this:
+ */
+#ifdef PNG_FIXED_POINT_SUPPORTED
+# define PNGFAPI PNGAPI
+#else
+# define PNGFAPI /* PRIVATE */
+#endif
+
+#ifndef PNG_VERSION_INFO_ONLY
+/* Other defines specific to compilers can go here. Try to keep
+ * them inside an appropriate ifdef/endif pair for portability.
+ */
+
/* C allows up-casts from (void*) to any pointer and (const void*) to any
* pointer to a const object. C++ regards this as a type error and requires an
* explicit, static, cast and provides the static_cast<> rune to ensure that
@@ -417,25 +483,20 @@
static_cast<type>(static_cast<const void*>(value))
#else
# define png_voidcast(type, value) (value)
-# define png_constcast(type, value) ((type)(value))
+# ifdef _WIN64
+# ifdef __GNUC__
+ typedef unsigned long long png_ptruint;
+# else
+ typedef unsigned __int64 png_ptruint;
+# endif
+# else
+ typedef unsigned long png_ptruint;
+# endif
+# define png_constcast(type, value) ((type)(png_ptruint)(const void*)(value))
# define png_aligncast(type, value) ((void*)(value))
# define png_aligncastconst(type, value) ((const void*)(value))
#endif /* __cplusplus */
-/* Some fixed point APIs are still required even if not exported because
- * they get used by the corresponding floating point APIs. This magic
- * deals with this:
- */
-#ifdef PNG_FIXED_POINT_SUPPORTED
-# define PNGFAPI PNGAPI
-#else
-# define PNGFAPI /* PRIVATE */
-#endif
-
-#ifndef PNG_VERSION_INFO_ONLY
-/* Other defines specific to compilers can go here. Try to keep
- * them inside an appropriate ifdef/endif pair for portability.
- */
#if defined(PNG_FLOATING_POINT_SUPPORTED) ||\
defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
/* png.c requires the following ANSI-C constants if the conversion of
@@ -781,6 +842,7 @@
#define png_PLTE PNG_U32( 80, 76, 84, 69)
#define png_bKGD PNG_U32( 98, 75, 71, 68)
#define png_cHRM PNG_U32( 99, 72, 82, 77)
+#define png_eXIf PNG_U32(101, 88, 73, 102) /* registered July 2017 */
#define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */
#define png_gAMA PNG_U32(103, 65, 77, 65)
#define png_gIFg PNG_U32(103, 73, 70, 103)
@@ -1256,6 +1318,38 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_msa,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
+#if PNG_POWERPC_VSX_OPT > 0
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_vsx,(png_row_infop row_info,
+ png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+#endif
+
+#if PNG_INTEL_SSE_IMPLEMENTATION > 0
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+#endif
+
/* Choose the best filter to use and filter the row data */
PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
png_row_infop row_info),PNG_EMPTY);
@@ -1348,6 +1442,11 @@ PNG_INTERNAL_FUNCTION(void,png_handle_cHRM,(png_structrp png_ptr,
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
#endif
+#ifdef PNG_READ_eXIf_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_handle_eXIf,(png_structrp png_ptr,
+ png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
+#endif
+
#ifdef PNG_READ_gAMA_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr,
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
@@ -1991,6 +2090,11 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
+
+# if PNG_INTEL_SSE_IMPLEMENTATION > 0
+PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
+# endif
#endif
PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
diff --git a/thirdparty/libpng/pngread.c b/thirdparty/libpng/pngread.c
index 106a80588c..b44d4dfbb5 100644
--- a/thirdparty/libpng/pngread.c
+++ b/thirdparty/libpng/pngread.c
@@ -1,8 +1,8 @@
/* pngread.c - read a PNG file
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.31 [(PENDING RELEASE)]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -1883,7 +1883,7 @@ png_create_colormap_entry(png_image_read_control *display,
{
case 4:
entry[afirst ? 0 : 3] = (png_uint_16)alpha;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 3:
if (alpha < 65535)
@@ -1905,7 +1905,7 @@ png_create_colormap_entry(png_image_read_control *display,
case 2:
entry[1 ^ afirst] = (png_uint_16)alpha;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 1:
if (alpha < 65535)
@@ -1934,6 +1934,7 @@ png_create_colormap_entry(png_image_read_control *display,
{
case 4:
entry[afirst ? 0 : 3] = (png_byte)alpha;
+ /* FALLTHROUGH */
case 3:
entry[afirst + (2 ^ bgr)] = (png_byte)blue;
entry[afirst + 1] = (png_byte)green;
@@ -1942,6 +1943,7 @@ png_create_colormap_entry(png_image_read_control *display,
case 2:
entry[1 ^ afirst] = (png_byte)alpha;
+ /* FALLTHROUGH */
case 1:
entry[afirst] = (png_byte)green;
break;
@@ -2861,7 +2863,7 @@ png_image_read_colormap(png_voidp argument)
case P_sRGB:
/* Change to 8-bit sRGB */
png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB);
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case P_FILE:
if (png_ptr->bit_depth > 8)
@@ -3179,8 +3181,7 @@ png_image_read_colormapped(png_voidp argument)
image->colormap_entries == 244 /* 216 + 1 + 27 */)
break;
- /* goto bad_output; */
- /* FALL THROUGH */
+ goto bad_output;
default:
bad_output:
diff --git a/thirdparty/libpng/pngrtran.c b/thirdparty/libpng/pngrtran.c
index 0b4f4f9068..9285983848 100644
--- a/thirdparty/libpng/pngrtran.c
+++ b/thirdparty/libpng/pngrtran.c
@@ -1,8 +1,8 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Last changed in libpng 1.6.24 [August 4, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.31 [(PENDING RELEASE)]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -49,6 +49,7 @@ png_set_crc_action(png_structrp png_ptr, int crit_action, int ancil_action)
case PNG_CRC_WARN_DISCARD: /* Not a valid action for critical data */
png_warning(png_ptr,
"Can't discard critical data on CRC error");
+ /* FALLTHROUGH */
case PNG_CRC_ERROR_QUIT: /* Error/quit */
case PNG_CRC_DEFAULT:
@@ -1253,7 +1254,7 @@ png_init_rgb_transformations(png_structrp png_ptr)
default:
case 8:
- /* FALL THROUGH (Already 8 bits) */
+ /* FALLTHROUGH */ /* (Already 8 bits) */
case 16:
/* Already a full 16 bits */
@@ -2934,7 +2935,7 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
* using the equation given in Poynton's ColorFAQ of 1998-01-04 at
* <http://www.inforamp.net/~poynton/> (THIS LINK IS DEAD June 2008 but
* versions dated 1998 through November 2002 have been archived at
- * http://web.archive.org/web/20000816232553/http://www.inforamp.net/
+ * https://web.archive.org/web/20000816232553/www.inforamp.net/
* ~poynton/notes/colour_and_gamma/ColorFAQ.txt )
* Charles Poynton poynton at poynton.com
*
@@ -4302,7 +4303,7 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
if (num_trans > 0)
{
sp = row + (png_size_t)row_width - 1;
- dp = row + (png_size_t)(row_width << 2) - 1;
+ dp = row + ((png_size_t)row_width << 2) - 1;
for (i = 0; i < row_width; i++)
{
@@ -4463,7 +4464,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
{
gray = gray & 0xff;
sp = row + (png_size_t)row_width - 1;
- dp = row + (png_size_t)(row_width << 1) - 1;
+ dp = row + ((png_size_t)row_width << 1) - 1;
for (i = 0; i < row_width; i++)
{
@@ -4519,7 +4520,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
png_byte green = (png_byte)(trans_color->green & 0xff);
png_byte blue = (png_byte)(trans_color->blue & 0xff);
sp = row + (png_size_t)row_info->rowbytes - 1;
- dp = row + (png_size_t)(row_width << 2) - 1;
+ dp = row + ((png_size_t)row_width << 2) - 1;
for (i = 0; i < row_width; i++)
{
if (*(sp - 2) == red && *(sp - 1) == green && *(sp) == blue)
@@ -4542,7 +4543,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
png_byte green_low = (png_byte)(trans_color->green & 0xff);
png_byte blue_low = (png_byte)(trans_color->blue & 0xff);
sp = row + row_info->rowbytes - 1;
- dp = row + (png_size_t)(row_width << 3) - 1;
+ dp = row + ((png_size_t)row_width << 3) - 1;
for (i = 0; i < row_width; i++)
{
if (*(sp - 5) == red_high &&
@@ -4601,7 +4602,9 @@ png_do_expand_16(png_row_infop row_info, png_bytep row)
png_byte *sp = row + row_info->rowbytes; /* source, last byte + 1 */
png_byte *dp = sp + row_info->rowbytes; /* destination, end + 1 */
while (dp > sp)
- dp[-2] = dp[-1] = *--sp, dp -= 2;
+ {
+ dp[-2] = dp[-1] = *--sp; dp -= 2;
+ }
row_info->rowbytes *= 2;
row_info->bit_depth = 16;
diff --git a/thirdparty/libpng/pngrutil.c b/thirdparty/libpng/pngrutil.c
index bee0ea1158..9cde64845c 100644
--- a/thirdparty/libpng/pngrutil.c
+++ b/thirdparty/libpng/pngrutil.c
@@ -1,8 +1,8 @@
/* pngrutil.c - utilities to read a PNG file
*
- * Last changed in libpng 1.6.27 [January 5, 2017]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.31 [(PENDING RELEASE)]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -418,7 +418,7 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
}
-#if ZLIB_VERNUM >= 0x1281 && \
+#if ZLIB_VERNUM >= 0x1290 && \
defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON)
/* Turn off validation of the ADLER32 checksum in IDAT chunks */
@@ -2009,6 +2009,44 @@ png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
}
#endif
+#ifdef PNG_READ_eXIf_SUPPORTED
+void /* PRIVATE */
+png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
+{
+ unsigned int i;
+ png_bytep eXIf_buf;
+
+ png_debug(1, "in png_handle_eXIf");
+
+ if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
+ png_chunk_error(png_ptr, "missing IHDR");
+
+ else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_eXIf) != 0)
+ {
+ png_crc_finish(png_ptr, length);
+ png_chunk_benign_error(png_ptr, "duplicate");
+ return;
+ }
+
+ eXIf_buf = png_voidcast(png_bytep,
+ png_malloc_warn(png_ptr, length));
+
+ for (i = 0; i < length; i++)
+ {
+ png_byte buf[1];
+ png_crc_read(png_ptr, buf, 1);
+ eXIf_buf[i] = buf[0];
+ }
+
+ if (png_crc_finish(png_ptr, 0) != 0)
+ return;
+
+ info_ptr->num_exif = length;
+
+ png_set_eXIf(png_ptr, info_ptr, eXIf_buf);
+}
+#endif
+
#ifdef PNG_READ_hIST_SUPPORTED
void /* PRIVATE */
png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
@@ -2537,6 +2575,9 @@ png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
png_ptr->mode |= PNG_AFTER_IDAT;
+ /* Note, "length" is sufficient here; we won't be adding
+ * a null terminator later.
+ */
buffer = png_read_buffer(png_ptr, length, 2/*silent*/);
if (buffer == NULL)
@@ -2975,7 +3016,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
case 2:
png_ptr->user_chunk_cache_max = 1;
png_chunk_benign_error(png_ptr, "no space in chunk cache");
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 1:
/* NOTE: prior to 1.6.0 this case resulted in an unknown critical
* chunk being skipped, now there will be a hard error below.
@@ -2984,7 +3025,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
default: /* not at limit */
--(png_ptr->user_chunk_cache_max);
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 0: /* no limit */
# endif /* USER_LIMITS */
/* Here when the limit isn't reached or when limits are compiled
@@ -3377,7 +3418,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
*/
do
{
- dp[0] = sp[0], dp[1] = sp[1];
+ dp[0] = sp[0]; dp[1] = sp[1];
if (row_width <= bytes_to_jump)
return;
@@ -3398,7 +3439,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
*/
for (;;)
{
- dp[0] = sp[0], dp[1] = sp[1], dp[2] = sp[2];
+ dp[0] = sp[0]; dp[1] = sp[1]; dp[2] = sp[2];
if (row_width <= bytes_to_jump)
return;
@@ -3887,7 +3928,10 @@ png_read_filter_row_paeth_1byte_pixel(png_row_infop row_info, png_bytep row,
/* Find the best predictor, the least of pa, pb, pc favoring the earlier
* ones in the case of a tie.
*/
- if (pb < pa) pa = pb, a = b;
+ if (pb < pa)
+ {
+ pa = pb; a = b;
+ }
if (pc < pa) a = c;
/* Calculate the current pixel in a, and move the previous row pixel to c
@@ -3939,7 +3983,10 @@ png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row,
pc = (p + pc) < 0 ? -(p + pc) : p + pc;
#endif
- if (pb < pa) pa = pb, a = b;
+ if (pb < pa)
+ {
+ pa = pb; a = b;
+ }
if (pc < pa) a = c;
a += *row;
diff --git a/thirdparty/libpng/pngset.c b/thirdparty/libpng/pngset.c
index 28ff3a064d..998473557f 100644
--- a/thirdparty/libpng/pngset.c
+++ b/thirdparty/libpng/pngset.c
@@ -1,8 +1,8 @@
/* pngset.c - storage of image information into info struct
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.30 [June 28, 2017]
+ * Copyright (c) 1998-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -134,6 +134,39 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X,
#endif /* cHRM */
+#ifdef PNG_eXIf_SUPPORTED
+void PNGAPI
+png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
+ const png_bytep eXIf_buf)
+{
+ int i;
+
+ png_debug1(1, "in %s storage function", "eXIf");
+
+ if (png_ptr == NULL || info_ptr == NULL)
+ return;
+
+ png_free_data(png_ptr, info_ptr, PNG_FREE_EXIF, 0);
+
+ info_ptr->exif = png_voidcast(png_bytep, png_malloc_warn(png_ptr,
+ info_ptr->num_exif));
+
+ if (info_ptr->exif == NULL)
+ {
+ png_warning(png_ptr, "Insufficient memory for eXIf chunk data");
+
+ return;
+ }
+
+ info_ptr->free_me |= PNG_FREE_EXIF;
+
+ for (i = 0; i < info_ptr->num_exif; i++)
+ info_ptr->exif[i] = eXIf_buf[i];
+
+ info_ptr->valid |= PNG_INFO_eXIf;
+}
+#endif /* eXIf */
+
#ifdef PNG_gAMA_SUPPORTED
void PNGFAPI
png_set_gAMA_fixed(png_const_structrp png_ptr, png_inforp info_ptr,
@@ -1102,8 +1135,9 @@ png_set_sPLT(png_const_structrp png_ptr,
info_ptr->valid |= PNG_INFO_sPLT;
++(info_ptr->splt_palettes_num);
++np;
+ ++entries;
}
- while (++entries, --nentries);
+ while (--nentries);
if (nentries > 0)
png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR);
@@ -1696,14 +1730,16 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
png_byte ch = (png_byte)*key++;
if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/))
- *new_key++ = ch, ++key_len, space = 0;
+ {
+ *new_key++ = ch; ++key_len; space = 0;
+ }
else if (space == 0)
{
/* A space or an invalid character when one wasn't seen immediately
* before; output just a space.
*/
- *new_key++ = 32, ++key_len, space = 1;
+ *new_key++ = 32; ++key_len; space = 1;
/* If the character was not a space then it is invalid. */
if (ch != 32)
@@ -1716,7 +1752,7 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
if (key_len > 0 && space != 0) /* trailing space */
{
- --key_len, --new_key;
+ --key_len; --new_key;
if (bad_character == 0)
bad_character = 32;
}
diff --git a/thirdparty/libpng/pngstruct.h b/thirdparty/libpng/pngstruct.h
index 749d7e35b1..44b79dea74 100644
--- a/thirdparty/libpng/pngstruct.h
+++ b/thirdparty/libpng/pngstruct.h
@@ -479,5 +479,8 @@ struct png_struct_def
png_colorspace colorspace;
#endif
#endif
+
+/* New member added in libpng-1.6.31 */
+ int num_exif;
};
#endif /* PNGSTRUCT_H */
diff --git a/thirdparty/libpng/pngtrans.c b/thirdparty/libpng/pngtrans.c
index da7413fb80..326ac33f0e 100644
--- a/thirdparty/libpng/pngtrans.c
+++ b/thirdparty/libpng/pngtrans.c
@@ -1,8 +1,8 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.30 [June 28, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -514,11 +514,15 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channel and, for sp, the filler */
- sp += 2, ++dp;
+ {
+ sp += 2; ++dp;
+ }
/* For a 1 pixel wide image there is nothing to do */
while (sp < ep)
- *dp++ = *sp, sp += 2;
+ {
+ *dp++ = *sp; sp += 2;
+ }
row_info->pixel_depth = 8;
}
@@ -528,10 +532,14 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channel and, for sp, the filler */
- sp += 4, dp += 2;
+ {
+ sp += 4; dp += 2;
+ }
while (sp < ep)
- *dp++ = *sp++, *dp++ = *sp, sp += 3;
+ {
+ *dp++ = *sp++; *dp++ = *sp; sp += 3;
+ }
row_info->pixel_depth = 16;
}
@@ -554,11 +562,15 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channels and, for sp, the filler */
- sp += 4, dp += 3;
+ {
+ sp += 4; dp += 3;
+ }
/* Note that the loop adds 3 to dp and 4 to sp each time. */
while (sp < ep)
- *dp++ = *sp++, *dp++ = *sp++, *dp++ = *sp, sp += 2;
+ {
+ *dp++ = *sp++; *dp++ = *sp++; *dp++ = *sp; sp += 2;
+ }
row_info->pixel_depth = 24;
}
@@ -568,14 +580,16 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channels and, for sp, the filler */
- sp += 8, dp += 6;
+ {
+ sp += 8; dp += 6;
+ }
while (sp < ep)
{
/* Copy 6 bytes, skip 2 */
- *dp++ = *sp++, *dp++ = *sp++;
- *dp++ = *sp++, *dp++ = *sp++;
- *dp++ = *sp++, *dp++ = *sp, sp += 3;
+ *dp++ = *sp++; *dp++ = *sp++;
+ *dp++ = *sp++; *dp++ = *sp++;
+ *dp++ = *sp++; *dp++ = *sp; sp += 3;
}
row_info->pixel_depth = 48;
diff --git a/thirdparty/libpng/pngwrite.c b/thirdparty/libpng/pngwrite.c
index 07088ee75e..8c2952e794 100644
--- a/thirdparty/libpng/pngwrite.c
+++ b/thirdparty/libpng/pngwrite.c
@@ -1,8 +1,8 @@
/* pngwrite.c - general routines to write a PNG file
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.31 [(PENDING RELEASE)]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -1007,8 +1007,8 @@ png_set_filter(png_structrp png_ptr, int method, int filters)
case 5:
case 6:
case 7: png_app_error(png_ptr, "Unknown row filter for method 0");
- /* FALL THROUGH */
#endif /* WRITE_FILTER */
+ /* FALLTHROUGH */
case PNG_FILTER_VALUE_NONE:
png_ptr->do_filter = PNG_FILTER_NONE; break;
@@ -1875,7 +1875,7 @@ png_image_set_PLTE(png_image_write_control *display)
tRNS[i] = entry[afirst ? 0 : 3];
if (tRNS[i] < 255)
num_trans = i+1;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 3:
palette[i].blue = entry[afirst + (2 ^ bgr)];
palette[i].green = entry[afirst + 1];
@@ -1886,7 +1886,7 @@ png_image_set_PLTE(png_image_write_control *display)
tRNS[i] = entry[1 ^ afirst];
if (tRNS[i] < 255)
num_trans = i+1;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 1:
palette[i].blue = palette[i].red = palette[i].green =
entry[afirst];
diff --git a/thirdparty/libpng/pngwutil.c b/thirdparty/libpng/pngwutil.c
index d1a82d45e1..348bb524dd 100644
--- a/thirdparty/libpng/pngwutil.c
+++ b/thirdparty/libpng/pngwutil.c
@@ -675,6 +675,7 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
int interlace_type)
{
png_byte buf[13]; /* Buffer to store the IHDR info */
+ int is_invalid_depth;
png_debug(1, "in png_write_IHDR");
@@ -700,11 +701,11 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
break;
case PNG_COLOR_TYPE_RGB:
+ is_invalid_depth = (bit_depth != 8);
#ifdef PNG_WRITE_16BIT_SUPPORTED
- if (bit_depth != 8 && bit_depth != 16)
-#else
- if (bit_depth != 8)
+ is_invalid_depth = (is_invalid_depth && bit_depth != 16);
#endif
+ if (is_invalid_depth)
png_error(png_ptr, "Invalid bit depth for RGB image");
png_ptr->channels = 3;
@@ -726,18 +727,22 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
break;
case PNG_COLOR_TYPE_GRAY_ALPHA:
- if (bit_depth != 8 && bit_depth != 16)
+ is_invalid_depth = (bit_depth != 8);
+#ifdef PNG_WRITE_16BIT_SUPPORTED
+ is_invalid_depth = (is_invalid_depth && bit_depth != 16);
+#endif
+ if (is_invalid_depth)
png_error(png_ptr, "Invalid bit depth for grayscale+alpha image");
png_ptr->channels = 2;
break;
case PNG_COLOR_TYPE_RGB_ALPHA:
+ is_invalid_depth = (bit_depth != 8);
#ifdef PNG_WRITE_16BIT_SUPPORTED
- if (bit_depth != 8 && bit_depth != 16)
-#else
- if (bit_depth != 8)
+ is_invalid_depth = (is_invalid_depth && bit_depth != 16);
#endif
+ if (is_invalid_depth)
png_error(png_ptr, "Invalid bit depth for RGBA image");
png_ptr->channels = 4;
@@ -998,7 +1003,8 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input,
optimize_cmf(data, png_image_size(png_ptr));
#endif
- png_write_complete_chunk(png_ptr, png_IDAT, data, size);
+ if (size > 0)
+ png_write_complete_chunk(png_ptr, png_IDAT, data, size);
png_ptr->mode |= PNG_HAVE_IDAT;
png_ptr->zstream.next_out = data;
@@ -1044,7 +1050,8 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input,
optimize_cmf(data, png_image_size(png_ptr));
#endif
- png_write_complete_chunk(png_ptr, png_IDAT, data, size);
+ if (size > 0)
+ png_write_complete_chunk(png_ptr, png_IDAT, data, size);
png_ptr->zstream.avail_out = 0;
png_ptr->zstream.next_out = NULL;
png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT;
@@ -1466,6 +1473,37 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type)
}
#endif
+#ifdef PNG_WRITE_eXIf_SUPPORTED
+/* Write the Exif data */
+void /* PRIVATE */
+png_write_eXIf(png_structrp png_ptr, png_bytep exif, int num_exif)
+{
+ int i;
+ png_byte buf[3];
+
+ png_debug(1, "in png_write_eXIf");
+
+ if (num_exif > (int)png_ptr->num_exif)
+ {
+ png_debug2(3, "num_exif = %d, png_ptr->num_exif = %d", num_exif,
+ png_ptr->num_exif);
+
+ png_warning(png_ptr, "Invalid number of exif bytes specified");
+ return;
+ }
+
+ png_write_chunk_header(png_ptr, png_eXIf, (png_uint_32)(num_exif));
+
+ for (i = 0; i < num_exif; i++)
+ {
+ buf[i] = exif[i];
+ png_write_chunk_data(png_ptr, buf, (png_size_t)1);
+ }
+
+ png_write_chunk_end(png_ptr);
+}
+#endif
+
#ifdef PNG_WRITE_hIST_SUPPORTED
/* Write the histogram */
void /* PRIVATE */
diff --git a/core/io/LICENSE-InfoZip.txt b/thirdparty/minizip/LICENSE-InfoZip.txt
index bcfe47e978..bcfe47e978 100644
--- a/core/io/LICENSE-InfoZip.txt
+++ b/thirdparty/minizip/LICENSE-InfoZip.txt
diff --git a/core/io/LICENSE-MiniZip.txt b/thirdparty/minizip/LICENSE-MiniZip.txt
index 0e8950f86f..0e8950f86f 100644
--- a/core/io/LICENSE-MiniZip.txt
+++ b/thirdparty/minizip/LICENSE-MiniZip.txt
diff --git a/core/io/crypt.h b/thirdparty/minizip/crypt.h
index a01d08d932..a01d08d932 100644
--- a/core/io/crypt.h
+++ b/thirdparty/minizip/crypt.h
diff --git a/core/io/ioapi.c b/thirdparty/minizip/ioapi.c
index d6063a5fe6..d6063a5fe6 100644
--- a/core/io/ioapi.c
+++ b/thirdparty/minizip/ioapi.c
diff --git a/core/io/ioapi.h b/thirdparty/minizip/ioapi.h
index cb6cb7e766..cb6cb7e766 100644
--- a/core/io/ioapi.h
+++ b/thirdparty/minizip/ioapi.h
diff --git a/core/io/unzip.c b/thirdparty/minizip/unzip.c
index 7aa0a86d13..7aa0a86d13 100644
--- a/core/io/unzip.c
+++ b/thirdparty/minizip/unzip.c
diff --git a/core/io/unzip.h b/thirdparty/minizip/unzip.h
index f67c3b2fa8..f67c3b2fa8 100644
--- a/core/io/unzip.h
+++ b/thirdparty/minizip/unzip.h
diff --git a/core/io/zip.c b/thirdparty/minizip/zip.c
index 27a3d3cdc1..27a3d3cdc1 100644
--- a/core/io/zip.c
+++ b/thirdparty/minizip/zip.c
diff --git a/core/io/zip.h b/thirdparty/minizip/zip.h
index 37478b34c0..37478b34c0 100644
--- a/core/io/zip.h
+++ b/thirdparty/minizip/zip.h
diff --git a/core/io/aes256.cpp b/thirdparty/misc/aes256.cpp
index dc271928b4..dc271928b4 100644
--- a/core/io/aes256.cpp
+++ b/thirdparty/misc/aes256.cpp
diff --git a/core/io/aes256.h b/thirdparty/misc/aes256.h
index 8fcc25a4de..8fcc25a4de 100644
--- a/core/io/aes256.h
+++ b/thirdparty/misc/aes256.h
diff --git a/core/io/base64.c b/thirdparty/misc/base64.c
index 0929ae5db5..0929ae5db5 100644
--- a/core/io/base64.c
+++ b/thirdparty/misc/base64.c
diff --git a/core/io/base64.h b/thirdparty/misc/base64.h
index 456ef1811b..4c300382c1 100644
--- a/core/io/base64.h
+++ b/thirdparty/misc/base64.h
@@ -11,9 +11,8 @@
extern "C" {
-uint32_t base64_encode (char* to, char* from, uint32_t len);
-uint32_t base64_decode (char* to, char* from, uint32_t len);
-
+uint32_t base64_encode(char *to, char *from, uint32_t len);
+uint32_t base64_decode(char *to, char *from, uint32_t len);
};
#endif /* BASE64_H */
diff --git a/modules/openssl/curl_hostcheck.c b/thirdparty/misc/curl_hostcheck.c
index feef232619..feef232619 100644
--- a/modules/openssl/curl_hostcheck.c
+++ b/thirdparty/misc/curl_hostcheck.c
diff --git a/modules/openssl/curl_hostcheck.h b/thirdparty/misc/curl_hostcheck.h
index 1b7fbe81e3..1b7fbe81e3 100644
--- a/modules/openssl/curl_hostcheck.h
+++ b/thirdparty/misc/curl_hostcheck.h
diff --git a/core/io/fastlz.c b/thirdparty/misc/fastlz.c
index 508f6ea2ae..508f6ea2ae 100644
--- a/core/io/fastlz.c
+++ b/thirdparty/misc/fastlz.c
diff --git a/core/io/fastlz.h b/thirdparty/misc/fastlz.h
index e5ca8dfc02..e5ca8dfc02 100644
--- a/core/io/fastlz.h
+++ b/thirdparty/misc/fastlz.h
diff --git a/core/hq2x.cpp b/thirdparty/misc/hq2x.cpp
index 7ebb505d64..7ebb505d64 100644
--- a/core/hq2x.cpp
+++ b/thirdparty/misc/hq2x.cpp
diff --git a/core/hq2x.h b/thirdparty/misc/hq2x.h
index 8f119d2a01..8f119d2a01 100644
--- a/core/hq2x.h
+++ b/thirdparty/misc/hq2x.h
diff --git a/core/io/md5.cpp b/thirdparty/misc/md5.cpp
index 5a88328dd4..1653ab0be5 100644
--- a/core/io/md5.cpp
+++ b/thirdparty/misc/md5.cpp
@@ -1,5 +1,3 @@
-#include "md5.h"
-
/*
**********************************************************************
** md5.c **
@@ -34,7 +32,7 @@
*/
/* -- include the following line if the md5.h header file is separate -- */
-/* #include "md5.h" */
+#include "md5.h"
/* forward declaration */
static void Transform (uint32_t *buf, uint32_t *in);
diff --git a/core/io/md5.h b/thirdparty/misc/md5.h
index e99d58b443..e99d58b443 100644
--- a/core/io/md5.h
+++ b/thirdparty/misc/md5.h
diff --git a/scene/resources/mikktspace.c b/thirdparty/misc/mikktspace.c
index 62aa2da251..62aa2da251 100644
--- a/scene/resources/mikktspace.c
+++ b/thirdparty/misc/mikktspace.c
diff --git a/scene/resources/mikktspace.h b/thirdparty/misc/mikktspace.h
index 52c44a713c..52c44a713c 100644
--- a/scene/resources/mikktspace.h
+++ b/thirdparty/misc/mikktspace.h
diff --git a/core/math/pcg.cpp b/thirdparty/misc/pcg.cpp
index eac3b36d36..eac3b36d36 100644
--- a/core/math/pcg.cpp
+++ b/thirdparty/misc/pcg.cpp
diff --git a/core/math/pcg.h b/thirdparty/misc/pcg.h
index 81f4c9770e..81f4c9770e 100644
--- a/core/math/pcg.h
+++ b/thirdparty/misc/pcg.h
diff --git a/core/io/sha256.c b/thirdparty/misc/sha256.c
index 68a4339af9..68a4339af9 100644
--- a/core/io/sha256.c
+++ b/thirdparty/misc/sha256.c
diff --git a/core/io/sha256.h b/thirdparty/misc/sha256.h
index e19e56b4cc..e19e56b4cc 100644
--- a/core/io/sha256.h
+++ b/thirdparty/misc/sha256.h
diff --git a/thirdparty/misc/smaz.c b/thirdparty/misc/smaz.c
new file mode 100644
index 0000000000..555dfea844
--- /dev/null
+++ b/thirdparty/misc/smaz.c
@@ -0,0 +1,207 @@
+/*
+Copyright (c) 2006-2009, Salvatore Sanfilippo
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of Smaz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <string.h>
+
+/* Our compression codebook, used for compression */
+static const char *Smaz_cb[241] = {
+"\002s,\266", "\003had\232\002leW", "\003on \216", "", "\001yS",
+"\002ma\255\002li\227", "\003or \260", "", "\002ll\230\003s t\277",
+"\004fromg\002mel", "", "\003its\332", "\001z\333", "\003ingF", "\001>\336",
+"\001 \000\003 (\002nc\344", "\002nd=\003 on\312",
+"\002ne\213\003hat\276\003re q", "", "\002ngT\003herz\004have\306\003s o\225",
+"", "\003ionk\003s a\254\002ly\352", "\003hisL\003 inN\003 be\252", "",
+"\003 fo\325\003 of \003 ha\311", "", "\002of\005",
+"\003 co\241\002no\267\003 ma\370", "", "", "\003 cl\356\003enta\003 an7",
+"\002ns\300\001\"e", "\003n t\217\002ntP\003s, \205",
+"\002pe\320\003 we\351\002om\223", "\002on\037", "", "\002y G", "\003 wa\271",
+"\003 re\321\002or*", "", "\002=\"\251\002ot\337", "\003forD\002ou[",
+"\003 toR", "\003 th\r", "\003 it\366",
+"\003but\261\002ra\202\003 wi\363\002</\361", "\003 wh\237", "\002 4",
+"\003nd ?", "\002re!", "", "\003ng c", "",
+"\003ly \307\003ass\323\001a\004\002rir", "", "", "", "\002se_", "\003of \"",
+"\003div\364\002ros\003ere\240", "", "\002ta\310\001bZ\002si\324", "",
+"\003and\a\002rs\335", "\002rt\362", "\002teE", "\003ati\316", "\002so\263",
+"\002th\021", "\002tiJ\001c\034\003allp", "\003ate\345", "\002ss\246",
+"\002stM", "", "\002><\346", "\002to\024", "\003arew", "\001d\030",
+"\002tr\303", "", "\001\n1\003 a \222", "\003f tv\002veo", "\002un\340", "",
+"\003e o\242", "\002a \243\002wa\326\001e\002", "\002ur\226\003e a\274",
+"\002us\244\003\n\r\n\247", "\002ut\304\003e c\373", "\002we\221", "", "",
+"\002wh\302", "\001f,", "", "", "", "\003d t\206", "", "", "\003th \343",
+"\001g;", "", "", "\001\r9\003e s\265", "\003e t\234", "", "\003to Y",
+"\003e\r\n\236", "\002d \036\001h\022", "", "\001,Q", "\002 a\031", "\002 b^",
+"\002\r\n\025\002 cI", "\002 d\245", "\002 e\253", "\002 fh\001i\b\002e \v",
+"", "\002 hU\001-\314", "\002 i8", "", "", "\002 l\315", "\002 m{",
+"\002f :\002 n\354", "\002 o\035", "\002 p}\001.n\003\r\n\r\250", "",
+"\002 r\275", "\002 s>", "\002 t\016", "", "\002g \235\005which+\003whi\367",
+"\002 w5", "\001/\305", "\003as \214", "\003at \207", "", "\003who\331", "",
+"\001l\026\002h \212", "", "\002, $", "", "\004withV", "", "", "", "\001m-", "",
+"", "\002ac\357", "\002ad\350", "\003TheH", "", "", "\004this\233\001n\t",
+"", "\002. y", "", "\002alX\003e, \365", "\003tio\215\002be\\",
+"\002an\032\003ver\347", "", "\004that0\003tha\313\001o\006", "\003was2",
+"\002arO", "\002as.", "\002at'\003the\001\004they\200\005there\322\005theird",
+"\002ce\210", "\004were]", "", "\002ch\231\002l \264\001p<", "", "",
+"\003one\256", "", "\003he \023\002dej", "\003ter\270", "\002cou", "",
+"\002by\177\002di\201\002eax", "", "\002ec\327", "\002edB", "\002ee\353", "",
+"", "\001r\f\002n )", "", "", "", "\002el\262", "", "\003in i\002en3", "",
+"\002o `\001s\n", "", "\002er\033", "\003is t\002es6", "", "\002ge\371",
+"\004.com\375", "\002fo\334\003our\330", "\003ch \301\001t\003", "\002hab", "",
+"\003men\374", "", "\002he\020", "", "", "\001u&", "\002hif", "",
+"\003not\204\002ic\203", "\003ed @\002id\355", "", "", "\002ho\273",
+"\002r K\001vm", "", "", "", "\003t t\257\002il\360", "\002im\342",
+"\003en \317\002in\017", "\002io\220", "\002s \027\001wA", "", "\003er |",
+"\003es ~\002is%", "\002it/", "", "\002iv\272", "",
+"\002t #\ahttp://C\001x\372", "\002la\211", "\001<\341", "\003, a\224"
+};
+
+/* Reverse compression codebook, used for decompression */
+static char *Smaz_rcb[254] = {
+" ", "the", "e", "t", "a", "of", "o", "and", "i", "n", "s", "e ", "r", " th",
+" t", "in", "he", "th", "h", "he ", "to", "\r\n", "l", "s ", "d", " a", "an",
+"er", "c", " o", "d ", "on", " of", "re", "of ", "t ", ", ", "is", "u", "at",
+" ", "n ", "or", "which", "f", "m", "as", "it", "that", "\n", "was", "en",
+" ", " w", "es", " an", " i", "\r", "f ", "g", "p", "nd", " s", "nd ", "ed ",
+"w", "ed", "http://", "for", "te", "ing", "y ", "The", " c", "ti", "r ", "his",
+"st", " in", "ar", "nt", ",", " to", "y", "ng", " h", "with", "le", "al", "to ",
+"b", "ou", "be", "were", " b", "se", "o ", "ent", "ha", "ng ", "their", "\"",
+"hi", "from", " f", "in ", "de", "ion", "me", "v", ".", "ve", "all", "re ",
+"ri", "ro", "is ", "co", "f t", "are", "ea", ". ", "her", " m", "er ", " p",
+"es ", "by", "they", "di", "ra", "ic", "not", "s, ", "d t", "at ", "ce", "la",
+"h ", "ne", "as ", "tio", "on ", "n t", "io", "we", " a ", "om", ", a", "s o",
+"ur", "li", "ll", "ch", "had", "this", "e t", "g ", "e\r\n", " wh", "ere",
+" co", "e o", "a ", "us", " d", "ss", "\n\r\n", "\r\n\r", "=\"", " be", " e",
+"s a", "ma", "one", "t t", "or ", "but", "el", "so", "l ", "e s", "s,", "no",
+"ter", " wa", "iv", "ho", "e a", " r", "hat", "s t", "ns", "ch ", "wh", "tr",
+"ut", "/", "have", "ly ", "ta", " ha", " on", "tha", "-", " l", "ati", "en ",
+"pe", " re", "there", "ass", "si", " fo", "wa", "ec", "our", "who", "its", "z",
+"fo", "rs", ">", "ot", "un", "<", "im", "th ", "nc", "ate", "><", "ver", "ad",
+" we", "ly", "ee", " n", "id", " cl", "ac", "il", "</", "rt", " wi", "div",
+"e, ", " it", "whi", " ma", "ge", "x", "e c", "men", ".com"
+};
+
+int smaz_compress(const char *in, int inlen, char *out, int outlen) {
+ unsigned int h1,h2,h3=0;
+ int verblen = 0, _outlen = outlen;
+ char verb[256], *_out = out;
+
+ while(inlen) {
+ int j = 7, needed;
+ char *flush = NULL;
+ char *slot;
+
+ h1 = h2 = in[0]<<3;
+ if (inlen > 1) h2 += in[1];
+ if (inlen > 2) h3 = h2^in[2];
+ if (j > inlen) j = inlen;
+
+ /* Try to lookup substrings into the hash table, starting from the
+ * longer to the shorter substrings */
+ for (; j > 0; j--) {
+ switch(j) {
+ case 1: slot = Smaz_cb[h1%241]; break;
+ case 2: slot = Smaz_cb[h2%241]; break;
+ default: slot = Smaz_cb[h3%241]; break;
+ }
+ while(slot[0]) {
+ if (slot[0] == j && memcmp(slot+1,in,j) == 0) {
+ /* Match found in the hash table,
+ * prepare a verbatim bytes flush if needed */
+ if (verblen) {
+ needed = (verblen == 1) ? 2 : 2+verblen;
+ flush = out;
+ out += needed;
+ outlen -= needed;
+ }
+ /* Emit the byte */
+ if (outlen <= 0) return _outlen+1;
+ out[0] = slot[slot[0]+1];
+ out++;
+ outlen--;
+ inlen -= j;
+ in += j;
+ goto out;
+ } else {
+ slot += slot[0]+2;
+ }
+ }
+ }
+ /* Match not found - add the byte to the verbatim buffer */
+ verb[verblen] = in[0];
+ verblen++;
+ inlen--;
+ in++;
+out:
+ /* Prepare a flush if we reached the flush length limit, and there
+ * is not already a pending flush operation. */
+ if (!flush && (verblen == 256 || (verblen > 0 && inlen == 0))) {
+ needed = (verblen == 1) ? 2 : 2+verblen;
+ flush = out;
+ out += needed;
+ outlen -= needed;
+ if (outlen < 0) return _outlen+1;
+ }
+ /* Perform a verbatim flush if needed */
+ if (flush) {
+ if (verblen == 1) {
+ flush[0] = (signed char)254;
+ flush[1] = verb[0];
+ } else {
+ flush[0] = (signed char)255;
+ flush[1] = (signed char)(verblen-1);
+ memcpy(flush+2,verb,verblen);
+ }
+ flush = NULL;
+ verblen = 0;
+ }
+ }
+ return out-_out;
+}
+
+int smaz_decompress(const char *in, int inlen, char *out, int outlen) {
+ unsigned char *c = (unsigned char*) in;
+ char *_out = out;
+ int _outlen = outlen;
+
+ while(inlen) {
+ if (*c == 254) {
+ /* Verbatim byte */
+ if (outlen < 1) return _outlen+1;
+ *out = *(c+1);
+ out++;
+ outlen--;
+ c += 2;
+ inlen -= 2;
+ } else if (*c == 255) {
+ /* Verbatim string */
+ int len = (*(c+1))+1;
+ if (outlen < len) return _outlen+1;
+ memcpy(out,c+2,len);
+ out += len;
+ outlen -= len;
+ c += 2+len;
+ inlen -= 2+len;
+ } else {
+ /* Codebook entry */
+ const char *s = Smaz_rcb[*c];
+ int len = strlen(s);
+
+ if (outlen < len) return _outlen+1;
+ memcpy(out,s,len);
+ out += len;
+ outlen -= len;
+ c++;
+ inlen--;
+ }
+ }
+ return out-_out;
+}
diff --git a/thirdparty/misc/smaz.h b/thirdparty/misc/smaz.h
new file mode 100644
index 0000000000..a9d8a337a7
--- /dev/null
+++ b/thirdparty/misc/smaz.h
@@ -0,0 +1,20 @@
+/*
+Copyright (c) 2006-2009, Salvatore Sanfilippo
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of Smaz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef _SMAZ_H
+#define _SMAZ_H
+
+int smaz_compress(const char *in, int inlen, char *out, int outlen);
+int smaz_decompress(const char *in, int inlen, char *out, int outlen);
+
+#endif
diff --git a/scene/resources/stb_truetype.h b/thirdparty/misc/stb_truetype.h
index 016972785a..016972785a 100644
--- a/scene/resources/stb_truetype.h
+++ b/thirdparty/misc/stb_truetype.h
diff --git a/thirdparty/stb_vorbis/stb_vorbis.c b/thirdparty/misc/stb_vorbis.c
index c4f24d5898..c4f24d5898 100644
--- a/thirdparty/stb_vorbis/stb_vorbis.c
+++ b/thirdparty/misc/stb_vorbis.c
diff --git a/core/math/triangulator.cpp b/thirdparty/misc/triangulator.cpp
index 75b2b064c4..75b2b064c4 100644
--- a/core/math/triangulator.cpp
+++ b/thirdparty/misc/triangulator.cpp
diff --git a/core/math/triangulator.h b/thirdparty/misc/triangulator.h
index b6dd7e8236..b6dd7e8236 100644
--- a/core/math/triangulator.h
+++ b/thirdparty/misc/triangulator.h
diff --git a/modules/theora/yuv2rgb.h b/thirdparty/misc/yuv2rgb.h
index a9bef76da8..d0c2813a75 100644
--- a/modules/theora/yuv2rgb.h
+++ b/thirdparty/misc/yuv2rgb.h
@@ -1,5 +1,28 @@
/* Thirdparty code presumably from http://wss.co.uk/pinknoise/yuv2rgb/ */
-/* FIXME: Move to thirdparty dir */
+
+/*
+This YUV2RGB code is Copyright (C) 2008-11 Robin Watts
+<theorarm@wss.co.uk>.
+
+The software is released under the BSD license.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+In particular, I warrant absolutely nothing about how patent free
+this method is. It is your responsibility to ensure that this code
+does not infringe any patents that apply in your area before you
+ship it.
+*/
#ifndef YUV2RGB_H
#define YUV2RGB_H
diff --git a/thirdparty/openssl/crypto/LPdir_nyi.c b/thirdparty/openssl/crypto/LPdir_nyi.c
index 283d5b0636..b16e84957b 100644
--- a/thirdparty/openssl/crypto/LPdir_nyi.c
+++ b/thirdparty/openssl/crypto/LPdir_nyi.c
@@ -1,7 +1,4 @@
/*
- * $LP: LPlib/source/LPdir_win.c,v 1.1 2004/06/14 10:07:56 _cvs_levitte Exp $
- */
-/*
* Copyright (c) 2004, Richard Levitte <richard@levitte.org>
* All rights reserved.
*
diff --git a/thirdparty/openssl/crypto/LPdir_unix.c b/thirdparty/openssl/crypto/LPdir_unix.c
index bead6abd71..c97e260492 100644
--- a/thirdparty/openssl/crypto/LPdir_unix.c
+++ b/thirdparty/openssl/crypto/LPdir_unix.c
@@ -1,8 +1,4 @@
/*
- * $LP: LPlib/source/LPdir_unix.c,v 1.11 2004/09/23 22:07:22 _cvs_levitte Exp
- * $
- */
-/*
* Copyright (c) 2004, Richard Levitte <richard@levitte.org>
* All rights reserved.
*
diff --git a/thirdparty/openssl/crypto/LPdir_win32.c b/thirdparty/openssl/crypto/LPdir_win32.c
index b1c983d87f..84f61117b8 100644
--- a/thirdparty/openssl/crypto/LPdir_win32.c
+++ b/thirdparty/openssl/crypto/LPdir_win32.c
@@ -1,8 +1,4 @@
/*
- * $LP: LPlib/source/LPdir_win32.c,v 1.3 2004/08/26 13:36:05 _cvs_levitte Exp
- * $
- */
-/*
* Copyright (c) 2004, Richard Levitte <richard@levitte.org>
* All rights reserved.
*
diff --git a/thirdparty/openssl/crypto/LPdir_wince.c b/thirdparty/openssl/crypto/LPdir_wince.c
index ae8a56f4be..a8377f30f4 100644
--- a/thirdparty/openssl/crypto/LPdir_wince.c
+++ b/thirdparty/openssl/crypto/LPdir_wince.c
@@ -1,8 +1,4 @@
/*
- * $LP: LPlib/source/LPdir_wince.c,v 1.3 2004/08/26 13:36:05 _cvs_levitte Exp
- * $
- */
-/*
* Copyright (c) 2004, Richard Levitte <richard@levitte.org>
* All rights reserved.
*
diff --git a/thirdparty/openssl/crypto/asn1/a_bitstr.c b/thirdparty/openssl/crypto/asn1/a_bitstr.c
index f906188b11..c429342e03 100644
--- a/thirdparty/openssl/crypto/asn1/a_bitstr.c
+++ b/thirdparty/openssl/crypto/asn1/a_bitstr.c
@@ -114,10 +114,11 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
*(p++) = (unsigned char)bits;
d = a->data;
- memcpy(p, d, len);
- p += len;
- if (len > 0)
+ if (len > 0) {
+ memcpy(p, d, len);
+ p += len;
p[-1] &= (0xff << bits);
+ }
*pp = p;
return (ret);
}
diff --git a/thirdparty/openssl/crypto/asn1/a_bytes.c b/thirdparty/openssl/crypto/asn1/a_bytes.c
index 385b53986a..65e5394664 100644
--- a/thirdparty/openssl/crypto/asn1/a_bytes.c
+++ b/thirdparty/openssl/crypto/asn1/a_bytes.c
@@ -60,7 +60,12 @@
#include "cryptlib.h"
#include <openssl/asn1.h>
-static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c);
+static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c,
+ int depth);
+static ASN1_STRING *int_d2i_ASN1_bytes(ASN1_STRING **a,
+ const unsigned char **pp, long length,
+ int Ptag, int Pclass, int depth,
+ int *perr);
/*
* type is a 'bitmap' of acceptable string types.
*/
@@ -99,7 +104,7 @@ ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp,
ret = (*a);
if (len != 0) {
- s = (unsigned char *)OPENSSL_malloc((int)len + 1);
+ s = OPENSSL_malloc((int)len + 1);
if (s == NULL) {
i = ERR_R_MALLOC_FAILURE;
goto err;
@@ -154,15 +159,38 @@ int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass)
return (r);
}
+/*
+ * Maximum recursion depth of d2i_ASN1_bytes(): much more than should be
+ * encountered in pratice.
+ */
+
+#define ASN1_BYTES_MAXDEPTH 20
+
ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
long length, int Ptag, int Pclass)
{
+ int err = 0;
+ ASN1_STRING *s = int_d2i_ASN1_bytes(a, pp, length, Ptag, Pclass, 0, &err);
+ if (err != 0)
+ ASN1err(ASN1_F_D2I_ASN1_BYTES, err);
+ return s;
+}
+
+static ASN1_STRING *int_d2i_ASN1_bytes(ASN1_STRING **a,
+ const unsigned char **pp, long length,
+ int Ptag, int Pclass,
+ int depth, int *perr)
+{
ASN1_STRING *ret = NULL;
const unsigned char *p;
unsigned char *s;
long len;
int inf, tag, xclass;
- int i = 0;
+
+ if (depth > ASN1_BYTES_MAXDEPTH) {
+ *perr = ASN1_R_NESTED_ASN1_STRING;
+ return NULL;
+ }
if ((a == NULL) || ((*a) == NULL)) {
if ((ret = ASN1_STRING_new()) == NULL)
@@ -173,18 +201,19 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
p = *pp;
inf = ASN1_get_object(&p, &len, &tag, &xclass, length);
if (inf & 0x80) {
- i = ASN1_R_BAD_OBJECT_HEADER;
+ *perr = ASN1_R_BAD_OBJECT_HEADER;
goto err;
}
if (tag != Ptag) {
- i = ASN1_R_WRONG_TAG;
+ *perr = ASN1_R_WRONG_TAG;
goto err;
}
if (inf & V_ASN1_CONSTRUCTED) {
ASN1_const_CTX c;
+ c.error = 0;
c.pp = pp;
c.p = p;
c.inf = inf;
@@ -192,17 +221,18 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
c.tag = Ptag;
c.xclass = Pclass;
c.max = (length == 0) ? 0 : (p + length);
- if (!asn1_collate_primitive(ret, &c))
+ if (!asn1_collate_primitive(ret, &c, depth)) {
+ *perr = c.error;
goto err;
- else {
+ } else {
p = c.p;
}
} else {
if (len != 0) {
if ((ret->length < len) || (ret->data == NULL)) {
- s = (unsigned char *)OPENSSL_malloc((int)len + 1);
+ s = OPENSSL_malloc((int)len + 1);
if (s == NULL) {
- i = ERR_R_MALLOC_FAILURE;
+ *perr = ERR_R_MALLOC_FAILURE;
goto err;
}
if (ret->data != NULL)
@@ -230,7 +260,6 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
err:
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
ASN1_STRING_free(ret);
- ASN1err(ASN1_F_D2I_ASN1_BYTES, i);
return (NULL);
}
@@ -242,7 +271,8 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
* There have been a few bug fixes for this function from Paul Keogh
* <paul.keogh@sse.ie>, many thanks to him
*/
-static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c)
+static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c,
+ int depth)
{
ASN1_STRING *os = NULL;
BUF_MEM b;
@@ -270,9 +300,8 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c)
}
c->q = c->p;
- if (d2i_ASN1_bytes(&os, &c->p, c->max - c->p, c->tag, c->xclass)
- == NULL) {
- c->error = ERR_R_ASN1_LIB;
+ if (int_d2i_ASN1_bytes(&os, &c->p, c->max - c->p, c->tag, c->xclass,
+ depth + 1, &c->error) == NULL) {
goto err;
}
@@ -297,7 +326,6 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c)
ASN1_STRING_free(os);
return (1);
err:
- ASN1err(ASN1_F_ASN1_COLLATE_PRIMITIVE, c->error);
if (os != NULL)
ASN1_STRING_free(os);
if (b.data != NULL)
diff --git a/thirdparty/openssl/crypto/asn1/a_digest.c b/thirdparty/openssl/crypto/asn1/a_digest.c
index 7cbc4751cd..57a04f768c 100644
--- a/thirdparty/openssl/crypto/asn1/a_digest.c
+++ b/thirdparty/openssl/crypto/asn1/a_digest.c
@@ -86,8 +86,10 @@ int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
p = str;
i2d(data, &p);
- if (!EVP_Digest(str, i, md, len, type, NULL))
+ if (!EVP_Digest(str, i, md, len, type, NULL)) {
+ OPENSSL_free(str);
return 0;
+ }
OPENSSL_free(str);
return (1);
}
@@ -104,8 +106,10 @@ int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn,
if (!str)
return (0);
- if (!EVP_Digest(str, i, md, len, type, NULL))
+ if (!EVP_Digest(str, i, md, len, type, NULL)) {
+ OPENSSL_free(str);
return 0;
+ }
OPENSSL_free(str);
return (1);
}
diff --git a/thirdparty/openssl/crypto/asn1/a_gentm.c b/thirdparty/openssl/crypto/asn1/a_gentm.c
index fa76dcac91..8511813785 100644
--- a/thirdparty/openssl/crypto/asn1/a_gentm.c
+++ b/thirdparty/openssl/crypto/asn1/a_gentm.c
@@ -202,7 +202,7 @@ int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d)
if (a[o] == 'Z')
o++;
else if ((a[o] == '+') || (a[o] == '-')) {
- int offsign = a[o] == '-' ? -1 : 1, offset = 0;
+ int offsign = a[o] == '-' ? 1 : -1, offset = 0;
o++;
if (o + 4 > l)
goto err;
diff --git a/thirdparty/openssl/crypto/asn1/a_object.c b/thirdparty/openssl/crypto/asn1/a_object.c
index 27f9c16914..229a40ffa3 100644
--- a/thirdparty/openssl/crypto/asn1/a_object.c
+++ b/thirdparty/openssl/crypto/asn1/a_object.c
@@ -73,7 +73,7 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
return (0);
objsize = ASN1_object_size(0, a->length, V_ASN1_OBJECT);
- if (pp == NULL)
+ if (pp == NULL || objsize == -1)
return objsize;
p = *pp;
@@ -174,8 +174,12 @@ int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
if (!tmp)
goto err;
}
- while (blsize--)
- tmp[i++] = (unsigned char)BN_div_word(bl, 0x80L);
+ while (blsize--) {
+ BN_ULONG t = BN_div_word(bl, 0x80L);
+ if (t == (BN_ULONG)-1)
+ goto err;
+ tmp[i++] = (unsigned char)t;
+ }
} else {
for (;;) {
diff --git a/thirdparty/openssl/crypto/asn1/a_set.c b/thirdparty/openssl/crypto/asn1/a_set.c
index bf3f971889..5fb5865575 100644
--- a/thirdparty/openssl/crypto/asn1/a_set.c
+++ b/thirdparty/openssl/crypto/asn1/a_set.c
@@ -57,6 +57,7 @@
*/
#include <stdio.h>
+#include <limits.h>
#include "cryptlib.h"
#include <openssl/asn1_mac.h>
@@ -98,10 +99,14 @@ int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp,
if (a == NULL)
return (0);
- for (i = sk_OPENSSL_BLOCK_num(a) - 1; i >= 0; i--)
+ for (i = sk_OPENSSL_BLOCK_num(a) - 1; i >= 0; i--) {
+ int tmplen = i2d(sk_OPENSSL_BLOCK_value(a, i), NULL);
+ if (tmplen > INT_MAX - ret)
+ return -1;
ret += i2d(sk_OPENSSL_BLOCK_value(a, i), NULL);
+ }
r = ASN1_object_size(1, ret, ex_tag);
- if (pp == NULL)
+ if (pp == NULL || r == -1)
return (r);
p = *pp;
diff --git a/thirdparty/openssl/crypto/asn1/a_strex.c b/thirdparty/openssl/crypto/asn1/a_strex.c
index 35fd44cd22..2d562f9345 100644
--- a/thirdparty/openssl/crypto/asn1/a_strex.c
+++ b/thirdparty/openssl/crypto/asn1/a_strex.c
@@ -337,7 +337,7 @@ static const signed char tag2nbyte[] = {
-1, -1, -1, -1, -1, /* 5-9 */
-1, -1, 0, -1, /* 10-13 */
-1, -1, -1, -1, /* 15-17 */
- -1, 1, 1, /* 18-20 */
+ 1, 1, 1, /* 18-20 */
-1, 1, 1, 1, /* 21-24 */
-1, 1, -1, /* 25-27 */
4, -1, 2 /* 28-30 */
diff --git a/thirdparty/openssl/crypto/asn1/a_strnid.c b/thirdparty/openssl/crypto/asn1/a_strnid.c
index 5224345368..99ffe73787 100644
--- a/thirdparty/openssl/crypto/asn1/a_strnid.c
+++ b/thirdparty/openssl/crypto/asn1/a_strnid.c
@@ -192,7 +192,8 @@ static const ASN1_STRING_TABLE tbl_standard[] = {
{NID_name, 1, ub_name, DIRSTRING_TYPE, 0},
{NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
{NID_domainComponent, 1, -1, B_ASN1_IA5STRING, STABLE_NO_MASK},
- {NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}
+ {NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK},
+ {NID_jurisdictionCountryName, 2, 2, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}
};
static int sk_table_cmp(const ASN1_STRING_TABLE *const *a,
@@ -250,6 +251,7 @@ int ASN1_STRING_TABLE_add(int nid,
}
tmp->flags = flags | STABLE_FLAGS_MALLOC;
tmp->nid = nid;
+ tmp->minsize = tmp->maxsize = -1;
new_nid = 1;
} else
tmp->flags = (tmp->flags & STABLE_FLAGS_MALLOC) | flags;
diff --git a/thirdparty/openssl/crypto/asn1/a_time.c b/thirdparty/openssl/crypto/asn1/a_time.c
index fcb2d565cd..0eeb79cd42 100644
--- a/thirdparty/openssl/crypto/asn1/a_time.c
+++ b/thirdparty/openssl/crypto/asn1/a_time.c
@@ -137,7 +137,7 @@ int ASN1_TIME_check(ASN1_TIME *t)
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t,
ASN1_GENERALIZEDTIME **out)
{
- ASN1_GENERALIZEDTIME *ret;
+ ASN1_GENERALIZEDTIME *ret = NULL;
char *str;
int newlen;
@@ -146,22 +146,21 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t,
if (!out || !*out) {
if (!(ret = ASN1_GENERALIZEDTIME_new()))
- return NULL;
- if (out)
- *out = ret;
- } else
+ goto err;
+ } else {
ret = *out;
+ }
/* If already GeneralizedTime just copy across */
if (t->type == V_ASN1_GENERALIZEDTIME) {
if (!ASN1_STRING_set(ret, t->data, t->length))
- return NULL;
- return ret;
+ goto err;
+ goto done;
}
/* grow the string */
if (!ASN1_STRING_set(ret, NULL, t->length + 2))
- return NULL;
+ goto err;
/* ASN1_STRING_set() allocated 'len + 1' bytes. */
newlen = t->length + 2 + 1;
str = (char *)ret->data;
@@ -173,9 +172,18 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t,
BUF_strlcat(str, (char *)t->data, newlen);
- return ret;
+ done:
+ if (out != NULL && *out == NULL)
+ *out = ret;
+ return ret;
+
+ err:
+ if (out == NULL || *out != ret)
+ ASN1_GENERALIZEDTIME_free(ret);
+ return NULL;
}
+
int ASN1_TIME_set_string(ASN1_TIME *s, const char *str)
{
ASN1_TIME t;
diff --git a/thirdparty/openssl/crypto/asn1/a_utctm.c b/thirdparty/openssl/crypto/asn1/a_utctm.c
index 724a10be4e..0344482cc2 100644
--- a/thirdparty/openssl/crypto/asn1/a_utctm.c
+++ b/thirdparty/openssl/crypto/asn1/a_utctm.c
@@ -172,7 +172,7 @@ int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d)
if (a[o] == 'Z')
o++;
else if ((a[o] == '+') || (a[o] == '-')) {
- int offsign = a[o] == '-' ? -1 : 1, offset = 0;
+ int offsign = a[o] == '-' ? 1 : -1, offset = 0;
o++;
if (o + 4 > l)
goto err;
diff --git a/thirdparty/openssl/crypto/asn1/ameth_lib.c b/thirdparty/openssl/crypto/asn1/ameth_lib.c
index 5389c04347..43ddebba33 100644
--- a/thirdparty/openssl/crypto/asn1/ameth_lib.c
+++ b/thirdparty/openssl/crypto/asn1/ameth_lib.c
@@ -93,7 +93,9 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] = {
&eckey_asn1_meth,
#endif
&hmac_asn1_meth,
+#ifndef OPENSSL_NO_CMAC
&cmac_asn1_meth,
+#endif
#ifndef OPENSSL_NO_DH
&dhx_asn1_meth
#endif
diff --git a/thirdparty/openssl/crypto/asn1/asn1_lib.c b/thirdparty/openssl/crypto/asn1/asn1_lib.c
index 874b1af8b0..e63e82a8b4 100644
--- a/thirdparty/openssl/crypto/asn1/asn1_lib.c
+++ b/thirdparty/openssl/crypto/asn1/asn1_lib.c
@@ -256,26 +256,30 @@ static void asn1_put_length(unsigned char **pp, int length)
int ASN1_object_size(int constructed, int length, int tag)
{
- int ret;
-
- ret = length;
- ret++;
+ int ret = 1;
+ if (length < 0)
+ return -1;
if (tag >= 31) {
while (tag > 0) {
tag >>= 7;
ret++;
}
}
- if (constructed == 2)
- return ret + 3;
- ret++;
- if (length > 127) {
- while (length > 0) {
- length >>= 8;
- ret++;
+ if (constructed == 2) {
+ ret += 3;
+ } else {
+ ret++;
+ if (length > 127) {
+ int tmplen = length;
+ while (tmplen > 0) {
+ tmplen >>= 8;
+ ret++;
+ }
}
}
- return (ret);
+ if (ret >= INT_MAX - length)
+ return -1;
+ return ret + length;
}
static int _asn1_Finish(ASN1_const_CTX *c)
@@ -324,7 +328,7 @@ int asn1_GetSequence(ASN1_const_CTX *c, long *length)
return (0);
}
if (c->inf == (1 | V_ASN1_CONSTRUCTED))
- c->slen = *length + *(c->pp) - c->p;
+ c->slen = *length;
c->eos = 0;
return (1);
}
@@ -366,7 +370,7 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)
else
len = strlen(data);
}
- if ((str->length < len) || (str->data == NULL)) {
+ if ((str->length <= len) || (str->data == NULL)) {
c = str->data;
if (c == NULL)
str->data = OPENSSL_malloc(len + 1);
diff --git a/thirdparty/openssl/crypto/asn1/asn_mime.c b/thirdparty/openssl/crypto/asn1/asn_mime.c
index 96110c540f..5170906c62 100644
--- a/thirdparty/openssl/crypto/asn1/asn_mime.c
+++ b/thirdparty/openssl/crypto/asn1/asn_mime.c
@@ -289,7 +289,7 @@ int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
if ((flags & SMIME_DETACHED) && data) {
/* We want multipart/signed */
/* Generate a random boundary */
- if (RAND_pseudo_bytes((unsigned char *)bound, 32) < 0)
+ if (RAND_bytes((unsigned char *)bound, 32) <= 0)
return 0;
for (i = 0; i < 32; i++) {
c = bound[i] & 0xf;
@@ -623,6 +623,8 @@ static int multi_split(BIO *bio, char *bound, STACK_OF(BIO) **ret)
if (bpart)
sk_BIO_push(parts, bpart);
bpart = BIO_new(BIO_s_mem());
+ if (bpart == NULL)
+ return 1;
BIO_set_mem_eof_return(bpart, 0);
} else if (eol)
BIO_write(bpart, "\r\n", 2);
diff --git a/thirdparty/openssl/crypto/asn1/bio_asn1.c b/thirdparty/openssl/crypto/asn1/bio_asn1.c
index 60189b3b2c..c3afff69dc 100644
--- a/thirdparty/openssl/crypto/asn1/bio_asn1.c
+++ b/thirdparty/openssl/crypto/asn1/bio_asn1.c
@@ -170,10 +170,12 @@ static int asn1_bio_init(BIO_ASN1_BUF_CTX *ctx, int size)
ctx->copylen = 0;
ctx->asn1_class = V_ASN1_UNIVERSAL;
ctx->asn1_tag = V_ASN1_OCTET_STRING;
- ctx->ex_buf = 0;
- ctx->ex_pos = 0;
+ ctx->ex_buf = NULL;
ctx->ex_len = 0;
+ ctx->ex_pos = 0;
ctx->state = ASN1_STATE_START;
+ ctx->prefix = ctx->prefix_free = ctx->suffix = ctx->suffix_free = NULL;
+ ctx->ex_arg = NULL;
return 1;
}
diff --git a/thirdparty/openssl/crypto/asn1/bio_ndef.c b/thirdparty/openssl/crypto/asn1/bio_ndef.c
index 31949b8794..8d7046633c 100644
--- a/thirdparty/openssl/crypto/asn1/bio_ndef.c
+++ b/thirdparty/openssl/crypto/asn1/bio_ndef.c
@@ -136,6 +136,7 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it)
ndef_aux->ndef_bio = sarg.ndef_bio;
ndef_aux->boundary = sarg.boundary;
ndef_aux->out = out;
+ ndef_aux->derbuf = NULL;
BIO_ctrl(asn_bio, BIO_C_SET_EX_ARG, 0, ndef_aux);
diff --git a/thirdparty/openssl/crypto/asn1/d2i_pr.c b/thirdparty/openssl/crypto/asn1/d2i_pr.c
index d21829af19..86dcf5fba9 100644
--- a/thirdparty/openssl/crypto/asn1/d2i_pr.c
+++ b/thirdparty/openssl/crypto/asn1/d2i_pr.c
@@ -97,15 +97,17 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
if (!ret->ameth->old_priv_decode ||
!ret->ameth->old_priv_decode(ret, &p, length)) {
if (ret->ameth->priv_decode) {
+ EVP_PKEY *tmp;
PKCS8_PRIV_KEY_INFO *p8 = NULL;
p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
if (!p8)
goto err;
- EVP_PKEY_free(ret);
- ret = EVP_PKCS82PKEY(p8);
+ tmp = EVP_PKCS82PKEY(p8);
PKCS8_PRIV_KEY_INFO_free(p8);
- if (ret == NULL)
+ if (tmp == NULL)
goto err;
+ EVP_PKEY_free(ret);
+ ret = tmp;
} else {
ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB);
goto err;
diff --git a/thirdparty/openssl/crypto/asn1/f_enum.c b/thirdparty/openssl/crypto/asn1/f_enum.c
index 591c3b5781..527f1d8f87 100644
--- a/thirdparty/openssl/crypto/asn1/f_enum.c
+++ b/thirdparty/openssl/crypto/asn1/f_enum.c
@@ -138,7 +138,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
bufp = (unsigned char *)buf;
if (first) {
first = 0;
- if ((bufp[0] == '0') && (buf[1] == '0')) {
+ if ((bufp[0] == '0') && (bufp[1] == '0')) {
bufp += 2;
i -= 2;
}
@@ -160,8 +160,6 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
i * 2);
if (sp == NULL) {
ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ERR_R_MALLOC_FAILURE);
- if (s != NULL)
- OPENSSL_free(s);
goto err;
}
s = sp;
@@ -199,5 +197,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
err_sl:
ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_SHORT_LINE);
}
+ if (ret != 1)
+ OPENSSL_free(s);
return (ret);
}
diff --git a/thirdparty/openssl/crypto/asn1/f_int.c b/thirdparty/openssl/crypto/asn1/f_int.c
index 4a81f81c88..e6ed7f1e77 100644
--- a/thirdparty/openssl/crypto/asn1/f_int.c
+++ b/thirdparty/openssl/crypto/asn1/f_int.c
@@ -152,7 +152,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
bufp = (unsigned char *)buf;
if (first) {
first = 0;
- if ((bufp[0] == '0') && (buf[1] == '0')) {
+ if ((bufp[0] == '0') && (bufp[1] == '0')) {
bufp += 2;
i -= 2;
}
@@ -172,8 +172,6 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
sp = OPENSSL_realloc_clean(s, slen, num + i * 2);
if (sp == NULL) {
ASN1err(ASN1_F_A2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE);
- if (s != NULL)
- OPENSSL_free(s);
goto err;
}
s = sp;
@@ -211,5 +209,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
err_sl:
ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_SHORT_LINE);
}
+ if (ret != 1)
+ OPENSSL_free(s);
return (ret);
}
diff --git a/thirdparty/openssl/crypto/asn1/f_string.c b/thirdparty/openssl/crypto/asn1/f_string.c
index 6a6cf34714..0f7b9cfb11 100644
--- a/thirdparty/openssl/crypto/asn1/f_string.c
+++ b/thirdparty/openssl/crypto/asn1/f_string.c
@@ -166,8 +166,6 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
i * 2);
if (sp == NULL) {
ASN1err(ASN1_F_A2I_ASN1_STRING, ERR_R_MALLOC_FAILURE);
- if (s != NULL)
- OPENSSL_free(s);
goto err;
}
s = sp;
@@ -205,5 +203,7 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
err_sl:
ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_SHORT_LINE);
}
+ if (ret != 1)
+ OPENSSL_free(s);
return (ret);
}
diff --git a/thirdparty/openssl/crypto/asn1/i2d_pr.c b/thirdparty/openssl/crypto/asn1/i2d_pr.c
index 4d338ac55a..12966ec536 100644
--- a/thirdparty/openssl/crypto/asn1/i2d_pr.c
+++ b/thirdparty/openssl/crypto/asn1/i2d_pr.c
@@ -69,10 +69,13 @@ int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp)
}
if (a->ameth && a->ameth->priv_encode) {
PKCS8_PRIV_KEY_INFO *p8 = EVP_PKEY2PKCS8(a);
- int ret = i2d_PKCS8_PRIV_KEY_INFO(p8, pp);
- PKCS8_PRIV_KEY_INFO_free(p8);
+ int ret = 0;
+ if (p8 != NULL) {
+ ret = i2d_PKCS8_PRIV_KEY_INFO(p8, pp);
+ PKCS8_PRIV_KEY_INFO_free(p8);
+ }
return ret;
}
ASN1err(ASN1_F_I2D_PRIVATEKEY, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
- return (-1);
+ return -1;
}
diff --git a/thirdparty/openssl/crypto/asn1/p5_pbe.c b/thirdparty/openssl/crypto/asn1/p5_pbe.c
index bdbfdcd67c..e2a1def53f 100644
--- a/thirdparty/openssl/crypto/asn1/p5_pbe.c
+++ b/thirdparty/openssl/crypto/asn1/p5_pbe.c
@@ -101,7 +101,7 @@ int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter,
sstr = ASN1_STRING_data(pbe->salt);
if (salt)
memcpy(sstr, salt, saltlen);
- else if (RAND_pseudo_bytes(sstr, saltlen) < 0)
+ else if (RAND_bytes(sstr, saltlen) <= 0)
goto err;
if (!ASN1_item_pack(pbe, ASN1_ITEM_rptr(PBEPARAM), &pbe_str)) {
diff --git a/thirdparty/openssl/crypto/asn1/p5_pbev2.c b/thirdparty/openssl/crypto/asn1/p5_pbev2.c
index 73ba4a3d67..4c037d3d2c 100644
--- a/thirdparty/openssl/crypto/asn1/p5_pbev2.c
+++ b/thirdparty/openssl/crypto/asn1/p5_pbev2.c
@@ -91,12 +91,11 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
unsigned char *salt, int saltlen,
unsigned char *aiv, int prf_nid)
{
- X509_ALGOR *scheme = NULL, *kalg = NULL, *ret = NULL;
+ X509_ALGOR *scheme = NULL, *ret = NULL;
int alg_nid, keylen;
EVP_CIPHER_CTX ctx;
unsigned char iv[EVP_MAX_IV_LENGTH];
PBE2PARAM *pbe2 = NULL;
- ASN1_OBJECT *obj;
alg_nid = EVP_CIPHER_type(cipher);
if (alg_nid == NID_undef) {
@@ -104,7 +103,6 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER);
goto err;
}
- obj = OBJ_nid2obj(alg_nid);
if (!(pbe2 = PBE2PARAM_new()))
goto merr;
@@ -112,7 +110,7 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
/* Setup the AlgorithmIdentifier for the encryption scheme */
scheme = pbe2->encryption;
- scheme->algorithm = obj;
+ scheme->algorithm = OBJ_nid2obj(alg_nid);
if (!(scheme->parameter = ASN1_TYPE_new()))
goto merr;
@@ -120,7 +118,7 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
if (EVP_CIPHER_iv_length(cipher)) {
if (aiv)
memcpy(iv, aiv, EVP_CIPHER_iv_length(cipher));
- else if (RAND_pseudo_bytes(iv, EVP_CIPHER_iv_length(cipher)) < 0)
+ else if (RAND_bytes(iv, EVP_CIPHER_iv_length(cipher)) <= 0)
goto err;
}
@@ -188,11 +186,9 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
err:
PBE2PARAM_free(pbe2);
/* Note 'scheme' is freed as part of pbe2 */
- X509_ALGOR_free(kalg);
X509_ALGOR_free(ret);
return NULL;
-
}
X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
@@ -225,7 +221,7 @@ X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen,
if (salt)
memcpy(osalt->data, salt, saltlen);
- else if (RAND_pseudo_bytes(osalt->data, saltlen) < 0)
+ else if (RAND_bytes(osalt->data, saltlen) <= 0)
goto merr;
if (iter <= 0)
diff --git a/thirdparty/openssl/crypto/asn1/t_req.c b/thirdparty/openssl/crypto/asn1/t_req.c
index 024553ab19..70aba4cc3b 100644
--- a/thirdparty/openssl/crypto/asn1/t_req.c
+++ b/thirdparty/openssl/crypto/asn1/t_req.c
@@ -196,6 +196,7 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
if (BIO_puts(bp, ":") <= 0)
goto err;
if ((type == V_ASN1_PRINTABLESTRING) ||
+ (type == V_ASN1_UTF8STRING) ||
(type == V_ASN1_T61STRING) ||
(type == V_ASN1_IA5STRING)) {
if (BIO_write(bp, (char *)bs->data, bs->length)
diff --git a/thirdparty/openssl/crypto/asn1/tasn_dec.c b/thirdparty/openssl/crypto/asn1/tasn_dec.c
index 6bdcd5c542..d49a5d5792 100644
--- a/thirdparty/openssl/crypto/asn1/tasn_dec.c
+++ b/thirdparty/openssl/crypto/asn1/tasn_dec.c
@@ -400,7 +400,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
if (tt->flags & ASN1_TFLG_ADB_MASK) {
const ASN1_TEMPLATE *seqtt;
ASN1_VALUE **pseqval;
- seqtt = asn1_do_adb(pval, tt, 1);
+ seqtt = asn1_do_adb(pval, tt, 0);
+ if (seqtt == NULL)
+ continue;
pseqval = asn1_get_field_ptr(pval, seqtt);
ASN1_template_free(pseqval, seqtt);
}
@@ -411,7 +413,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
const ASN1_TEMPLATE *seqtt;
ASN1_VALUE **pseqval;
seqtt = asn1_do_adb(pval, tt, 1);
- if (!seqtt)
+ if (seqtt == NULL)
goto err;
pseqval = asn1_get_field_ptr(pval, seqtt);
/* Have we ran out of data? */
@@ -476,7 +478,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
for (; i < it->tcount; tt++, i++) {
const ASN1_TEMPLATE *seqtt;
seqtt = asn1_do_adb(pval, tt, 1);
- if (!seqtt)
+ if (seqtt == NULL)
goto err;
if (seqtt->flags & ASN1_TFLG_OPTIONAL) {
ASN1_VALUE **pseqval;
@@ -671,6 +673,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
}
len -= p - q;
if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val, skfield)) {
+ ASN1_item_ex_free(&skfield, ASN1_ITEM_ptr(tt->item));
ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_MALLOC_FAILURE);
goto err;
}
diff --git a/thirdparty/openssl/crypto/asn1/tasn_enc.c b/thirdparty/openssl/crypto/asn1/tasn_enc.c
index f7f83e56a9..081a9d534f 100644
--- a/thirdparty/openssl/crypto/asn1/tasn_enc.c
+++ b/thirdparty/openssl/crypto/asn1/tasn_enc.c
@@ -59,6 +59,7 @@
#include <stddef.h>
#include <string.h>
+#include <limits.h>
#include "cryptlib.h"
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
@@ -216,17 +217,19 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
const ASN1_TEMPLATE *seqtt;
ASN1_VALUE **pseqval;
+ int tmplen;
seqtt = asn1_do_adb(pval, tt, 1);
if (!seqtt)
return 0;
pseqval = asn1_get_field_ptr(pval, seqtt);
- /* FIXME: check for errors in enhanced version */
- seqcontlen += asn1_template_ex_i2d(pseqval, NULL, seqtt,
- -1, aclass);
+ tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass);
+ if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen))
+ return -1;
+ seqcontlen += tmplen;
}
seqlen = ASN1_object_size(ndef, seqcontlen, tag);
- if (!out)
+ if (!out || seqlen == -1)
return seqlen;
/* Output SEQUENCE header */
ASN1_put_object(out, ndef, seqcontlen, tag, aclass);
@@ -339,19 +342,24 @@ static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
/* Determine total length of items */
skcontlen = 0;
for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) {
+ int tmplen;
skitem = sk_ASN1_VALUE_value(sk, i);
- skcontlen += ASN1_item_ex_i2d(&skitem, NULL,
- ASN1_ITEM_ptr(tt->item),
- -1, iclass);
+ tmplen = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item),
+ -1, iclass);
+ if (tmplen == -1 || (skcontlen > INT_MAX - tmplen))
+ return -1;
+ skcontlen += tmplen;
}
sklen = ASN1_object_size(ndef, skcontlen, sktag);
+ if (sklen == -1)
+ return -1;
/* If EXPLICIT need length of surrounding tag */
if (flags & ASN1_TFLG_EXPTAG)
ret = ASN1_object_size(ndef, sklen, ttag);
else
ret = sklen;
- if (!out)
+ if (!out || ret == -1)
return ret;
/* Now encode this lot... */
@@ -380,7 +388,7 @@ static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
return 0;
/* Find length of EXPLICIT tag */
ret = ASN1_object_size(ndef, i, ttag);
- if (out) {
+ if (out && ret != -1) {
/* Output tag and item */
ASN1_put_object(out, ndef, i, ttag, tclass);
ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass);
diff --git a/thirdparty/openssl/crypto/asn1/tasn_new.c b/thirdparty/openssl/crypto/asn1/tasn_new.c
index b0c73beeb5..54f459d1ed 100644
--- a/thirdparty/openssl/crypto/asn1/tasn_new.c
+++ b/thirdparty/openssl/crypto/asn1/tasn_new.c
@@ -158,7 +158,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
}
asn1_set_choice_selector(pval, -1, it);
if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
- goto auxerr;
+ goto auxerr2;
break;
case ASN1_ITYPE_NDEF_SEQUENCE:
@@ -186,10 +186,10 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
pseqval = asn1_get_field_ptr(pval, tt);
if (!ASN1_template_new(pseqval, tt))
- goto memerr;
+ goto memerr2;
}
if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
- goto auxerr;
+ goto auxerr2;
break;
}
#ifdef CRYPTO_MDEBUG
@@ -198,6 +198,8 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
#endif
return 1;
+ memerr2:
+ ASN1_item_ex_free(pval, it);
memerr:
ASN1err(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW, ERR_R_MALLOC_FAILURE);
#ifdef CRYPTO_MDEBUG
@@ -206,9 +208,10 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
#endif
return 0;
+ auxerr2:
+ ASN1_item_ex_free(pval, it);
auxerr:
ASN1err(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW, ASN1_R_AUX_ERROR);
- ASN1_item_ex_free(pval, it);
#ifdef CRYPTO_MDEBUG
if (it->sname)
CRYPTO_pop_info();
diff --git a/thirdparty/openssl/crypto/asn1/tasn_prn.c b/thirdparty/openssl/crypto/asn1/tasn_prn.c
index 5e7d53e985..f628caddbd 100644
--- a/thirdparty/openssl/crypto/asn1/tasn_prn.c
+++ b/thirdparty/openssl/crypto/asn1/tasn_prn.c
@@ -204,7 +204,8 @@ static int asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent,
} else
asn1_cb = 0;
- if (*fld == NULL) {
+ if (((it->itype != ASN1_ITYPE_PRIMITIVE)
+ || (it->utype != V_ASN1_BOOLEAN)) && *fld == NULL) {
if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_ABSENT) {
if (!nohdr && !asn1_print_fsname(out, indent, fname, sname, pctx))
return 0;
@@ -446,6 +447,8 @@ static int asn1_print_integer_ctx(BIO *out, ASN1_INTEGER *str,
char *s;
int ret = 1;
s = i2s_ASN1_INTEGER(NULL, str);
+ if (s == NULL)
+ return 0;
if (BIO_puts(out, s) <= 0)
ret = 0;
OPENSSL_free(s);
@@ -496,11 +499,16 @@ static int asn1_primitive_print(BIO *out, ASN1_VALUE **fld,
return 0;
if (pf && pf->prim_print)
return pf->prim_print(out, fld, it, indent, pctx);
- str = (ASN1_STRING *)*fld;
- if (it->itype == ASN1_ITYPE_MSTRING)
+ if (it->itype == ASN1_ITYPE_MSTRING) {
+ str = (ASN1_STRING *)*fld;
utype = str->type & ~V_ASN1_NEG;
- else
+ } else {
utype = it->utype;
+ if (utype == V_ASN1_BOOLEAN)
+ str = NULL;
+ else
+ str = (ASN1_STRING *)*fld;
+ }
if (utype == V_ASN1_ANY) {
ASN1_TYPE *atype = (ASN1_TYPE *)*fld;
utype = atype->type;
diff --git a/thirdparty/openssl/crypto/asn1/tasn_utl.c b/thirdparty/openssl/crypto/asn1/tasn_utl.c
index 41726d8feb..e14889feb1 100644
--- a/thirdparty/openssl/crypto/asn1/tasn_utl.c
+++ b/thirdparty/openssl/crypto/asn1/tasn_utl.c
@@ -234,7 +234,7 @@ const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt,
sfld = offset2ptr(*pval, adb->offset);
/* Check if NULL */
- if (!sfld) {
+ if (*sfld == NULL) {
if (!adb->null_tt)
goto err;
return adb->null_tt;
diff --git a/thirdparty/openssl/crypto/asn1/x_bignum.c b/thirdparty/openssl/crypto/asn1/x_bignum.c
index eaf046639d..c644199c9f 100644
--- a/thirdparty/openssl/crypto/asn1/x_bignum.c
+++ b/thirdparty/openssl/crypto/asn1/x_bignum.c
@@ -78,6 +78,8 @@ static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
const ASN1_ITEM *it);
static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
int utype, char *free_cont, const ASN1_ITEM *it);
+static int bn_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it,
+ int indent, const ASN1_PCTX *pctx);
static ASN1_PRIMITIVE_FUNCS bignum_pf = {
NULL, 0,
@@ -85,7 +87,8 @@ static ASN1_PRIMITIVE_FUNCS bignum_pf = {
bn_free,
0,
bn_c2i,
- bn_i2c
+ bn_i2c,
+ bn_print
};
ASN1_ITEM_start(BIGNUM)
@@ -151,3 +154,13 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
}
return 1;
}
+
+static int bn_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it,
+ int indent, const ASN1_PCTX *pctx)
+{
+ if (!BN_print(out, *(BIGNUM **)pval))
+ return 0;
+ if (BIO_puts(out, "\n") <= 0)
+ return 0;
+ return 1;
+}
diff --git a/thirdparty/openssl/crypto/asn1/x_crl.c b/thirdparty/openssl/crypto/asn1/x_crl.c
index 027950330d..c78ded89ef 100644
--- a/thirdparty/openssl/crypto/asn1/x_crl.c
+++ b/thirdparty/openssl/crypto/asn1/x_crl.c
@@ -254,6 +254,7 @@ static int crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
for (idx = 0; idx < sk_X509_EXTENSION_num(exts); idx++) {
int nid;
+
ext = sk_X509_EXTENSION_value(exts, idx);
nid = OBJ_obj2nid(ext->object);
if (nid == NID_freshest_crl)
@@ -263,7 +264,7 @@ static int crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
if ((nid == NID_issuing_distribution_point)
|| (nid == NID_authority_key_identifier)
|| (nid == NID_delta_crl))
- break;;
+ continue;
crl->flags |= EXFLAG_CRITICAL;
break;
}
diff --git a/thirdparty/openssl/crypto/asn1/x_long.c b/thirdparty/openssl/crypto/asn1/x_long.c
index 3aed44a3dd..aecb95069d 100644
--- a/thirdparty/openssl/crypto/asn1/x_long.c
+++ b/thirdparty/openssl/crypto/asn1/x_long.c
@@ -126,7 +126,7 @@ static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
* set.
*/
if (ltmp < 0)
- utmp = -ltmp - 1;
+ utmp = 0 - (unsigned long)ltmp - 1;
else
utmp = ltmp;
clen = BN_num_bits_word(utmp);
@@ -155,19 +155,41 @@ static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
int utype, char *free_cont, const ASN1_ITEM *it)
{
- int neg, i;
+ int neg = -1, i;
long ltmp;
unsigned long utmp = 0;
char *cp = (char *)pval;
+
+ if (len) {
+ /*
+ * Check possible pad byte. Worst case, we're skipping past actual
+ * content, but since that's only with 0x00 and 0xff and we set neg
+ * accordingly, the result will be correct in the end anyway.
+ */
+ switch (cont[0]) {
+ case 0xff:
+ cont++;
+ len--;
+ neg = 1;
+ break;
+ case 0:
+ cont++;
+ len--;
+ neg = 0;
+ break;
+ }
+ }
if (len > (int)sizeof(long)) {
ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
return 0;
}
- /* Is it negative? */
- if (len && (cont[0] & 0x80))
- neg = 1;
- else
- neg = 0;
+ if (neg == -1) {
+ /* Is it negative? */
+ if (len && (cont[0] & 0x80))
+ neg = 1;
+ else
+ neg = 0;
+ }
utmp = 0;
for (i = 0; i < len; i++) {
utmp <<= 8;
@@ -178,8 +200,8 @@ static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
}
ltmp = (long)utmp;
if (neg) {
- ltmp++;
ltmp = -ltmp;
+ ltmp--;
}
if (ltmp == it->size) {
ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
diff --git a/thirdparty/openssl/crypto/asn1/x_name.c b/thirdparty/openssl/crypto/asn1/x_name.c
index a858c2993b..1fb7ad1cbf 100644
--- a/thirdparty/openssl/crypto/asn1/x_name.c
+++ b/thirdparty/openssl/crypto/asn1/x_name.c
@@ -178,6 +178,16 @@ static void x509_name_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
*pval = NULL;
}
+static void local_sk_X509_NAME_ENTRY_free(STACK_OF(X509_NAME_ENTRY) *ne)
+{
+ sk_X509_NAME_ENTRY_free(ne);
+}
+
+static void local_sk_X509_NAME_ENTRY_pop_free(STACK_OF(X509_NAME_ENTRY) *ne)
+{
+ sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free);
+}
+
static int x509_name_ex_d2i(ASN1_VALUE **val,
const unsigned char **in, long len,
const ASN1_ITEM *it, int tag, int aclass,
@@ -199,10 +209,8 @@ static int x509_name_ex_d2i(ASN1_VALUE **val,
int i, j, ret;
STACK_OF(X509_NAME_ENTRY) *entries;
X509_NAME_ENTRY *entry;
- if (len > X509_NAME_MAX) {
- ASN1err(ASN1_F_X509_NAME_EX_D2I, ASN1_R_TOO_LONG);
- return 0;
- }
+ if (len > X509_NAME_MAX)
+ len = X509_NAME_MAX;
q = p;
/* Get internal representation of Name */
@@ -230,13 +238,14 @@ static int x509_name_ex_d2i(ASN1_VALUE **val,
entry->set = i;
if (!sk_X509_NAME_ENTRY_push(nm.x->entries, entry))
goto err;
+ sk_X509_NAME_ENTRY_set(entries, j, NULL);
}
- sk_X509_NAME_ENTRY_free(entries);
}
- sk_STACK_OF_X509_NAME_ENTRY_free(intname.s);
ret = x509_name_canon(nm.x);
if (!ret)
goto err;
+ sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
+ local_sk_X509_NAME_ENTRY_free);
nm.x->modified = 0;
*val = nm.a;
*in = p;
@@ -244,6 +253,8 @@ static int x509_name_ex_d2i(ASN1_VALUE **val,
err:
if (nm.x != NULL)
X509_NAME_free(nm.x);
+ sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
+ local_sk_X509_NAME_ENTRY_pop_free);
ASN1err(ASN1_F_X509_NAME_EX_D2I, ERR_R_NESTED_ASN1_ERROR);
return 0;
}
@@ -269,16 +280,6 @@ static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out,
return ret;
}
-static void local_sk_X509_NAME_ENTRY_free(STACK_OF(X509_NAME_ENTRY) *ne)
-{
- sk_X509_NAME_ENTRY_free(ne);
-}
-
-static void local_sk_X509_NAME_ENTRY_pop_free(STACK_OF(X509_NAME_ENTRY) *ne)
-{
- sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free);
-}
-
static int x509_name_encode(X509_NAME *a)
{
union {
@@ -301,8 +302,10 @@ static int x509_name_encode(X509_NAME *a)
entries = sk_X509_NAME_ENTRY_new_null();
if (!entries)
goto memerr;
- if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname.s, entries))
+ if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname.s, entries)) {
+ sk_X509_NAME_ENTRY_free(entries);
goto memerr;
+ }
set = entry->set;
}
if (!sk_X509_NAME_ENTRY_push(entries, entry))
@@ -372,8 +375,10 @@ static int x509_name_canon(X509_NAME *a)
entries = sk_X509_NAME_ENTRY_new_null();
if (!entries)
goto err;
- if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries))
+ if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)) {
+ sk_X509_NAME_ENTRY_free(entries);
goto err;
+ }
set = entry->set;
}
tmpentry = X509_NAME_ENTRY_new();
diff --git a/thirdparty/openssl/crypto/asn1/x_x509.c b/thirdparty/openssl/crypto/asn1/x_x509.c
index e31e1e750d..aada4a8413 100644
--- a/thirdparty/openssl/crypto/asn1/x_x509.c
+++ b/thirdparty/openssl/crypto/asn1/x_x509.c
@@ -199,12 +199,26 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
return NULL;
}
-int i2d_X509_AUX(X509 *a, unsigned char **pp)
+/*
+ * Serialize trusted certificate to *pp or just return the required buffer
+ * length if pp == NULL. We ultimately want to avoid modifying *pp in the
+ * error path, but that depends on similar hygiene in lower-level functions.
+ * Here we avoid compounding the problem.
+ */
+static int i2d_x509_aux_internal(X509 *a, unsigned char **pp)
{
int length, tmplen;
unsigned char *start = pp != NULL ? *pp : NULL;
+
+ OPENSSL_assert(pp == NULL || *pp != NULL);
+
+ /*
+ * This might perturb *pp on error, but fixing that belongs in i2d_X509()
+ * not here. It should be that if a == NULL length is zero, but we check
+ * both just in case.
+ */
length = i2d_X509(a, pp);
- if (length < 0 || a == NULL)
+ if (length <= 0 || a == NULL)
return length;
tmplen = i2d_X509_CERT_AUX(a->aux, pp);
@@ -218,6 +232,42 @@ int i2d_X509_AUX(X509 *a, unsigned char **pp)
return length;
}
+/*
+ * Serialize trusted certificate to *pp, or just return the required buffer
+ * length if pp == NULL.
+ *
+ * When pp is not NULL, but *pp == NULL, we allocate the buffer, but since
+ * we're writing two ASN.1 objects back to back, we can't have i2d_X509() do
+ * the allocation, nor can we allow i2d_X509_CERT_AUX() to increment the
+ * allocated buffer.
+ */
+int i2d_X509_AUX(X509 *a, unsigned char **pp)
+{
+ int length;
+ unsigned char *tmp;
+
+ /* Buffer provided by caller */
+ if (pp == NULL || *pp != NULL)
+ return i2d_x509_aux_internal(a, pp);
+
+ /* Obtain the combined length */
+ if ((length = i2d_x509_aux_internal(a, NULL)) <= 0)
+ return length;
+
+ /* Allocate requisite combined storage */
+ *pp = tmp = OPENSSL_malloc(length);
+ if (tmp == NULL)
+ return -1; /* Push error onto error stack? */
+
+ /* Encode, but keep *pp at the originally malloced pointer */
+ length = i2d_x509_aux_internal(a, &tmp);
+ if (length <= 0) {
+ OPENSSL_free(*pp);
+ *pp = NULL;
+ }
+ return length;
+}
+
int i2d_re_X509_tbs(X509 *x, unsigned char **pp)
{
x->cert_info->enc.modified = 1;
diff --git a/thirdparty/openssl/crypto/bio/b_print.c b/thirdparty/openssl/crypto/bio/b_print.c
index 90248fa2aa..eb3ab75934 100644
--- a/thirdparty/openssl/crypto/bio/b_print.c
+++ b/thirdparty/openssl/crypto/bio/b_print.c
@@ -423,9 +423,15 @@ _dopr(char **sbuffer,
break;
}
}
- *truncated = (currlen > *maxlen - 1);
- if (*truncated)
- currlen = *maxlen - 1;
+ /*
+ * We have to truncate if there is no dynamic buffer and we have filled the
+ * static buffer.
+ */
+ if (buffer == NULL) {
+ *truncated = (currlen > *maxlen - 1);
+ if (*truncated)
+ currlen = *maxlen - 1;
+ }
if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
return 0;
*retlen = currlen - 1;
@@ -496,7 +502,7 @@ fmtint(char **sbuffer,
if (!(flags & DP_F_UNSIGNED)) {
if (value < 0) {
signvalue = '-';
- uvalue = -value;
+ uvalue = -(unsigned LLONG)value;
} else if (flags & DP_F_PLUS)
signvalue = '+';
else if (flags & DP_F_SPACE)
diff --git a/thirdparty/openssl/crypto/bio/bf_nbio.c b/thirdparty/openssl/crypto/bio/bf_nbio.c
index a04f32a008..4842bb4c82 100644
--- a/thirdparty/openssl/crypto/bio/bf_nbio.c
+++ b/thirdparty/openssl/crypto/bio/bf_nbio.c
@@ -139,7 +139,7 @@ static int nbiof_read(BIO *b, char *out, int outl)
BIO_clear_retry_flags(b);
#if 1
- if (RAND_pseudo_bytes(&n, 1) < 0)
+ if (RAND_bytes(&n, 1) <= 0)
return -1;
num = (n & 0x07);
@@ -179,7 +179,7 @@ static int nbiof_write(BIO *b, const char *in, int inl)
num = nt->lwn;
nt->lwn = 0;
} else {
- if (RAND_pseudo_bytes(&n, 1) < 0)
+ if (RAND_bytes(&n, 1) <= 0)
return -1;
num = (n & 7);
}
diff --git a/thirdparty/openssl/crypto/bio/bio_cb.c b/thirdparty/openssl/crypto/bio/bio_cb.c
index d3e860686c..f96294bb43 100644
--- a/thirdparty/openssl/crypto/bio/bio_cb.c
+++ b/thirdparty/openssl/crypto/bio/bio_cb.c
@@ -78,6 +78,9 @@ long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp,
len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio);
+ /* Ignore errors and continue printing the other information. */
+ if (len < 0)
+ len = 0;
p = buf + len;
p_maxlen = sizeof(buf) - len;
diff --git a/thirdparty/openssl/crypto/bio/bss_bio.c b/thirdparty/openssl/crypto/bio/bss_bio.c
index 4d8727f8f8..3dd8187729 100644
--- a/thirdparty/openssl/crypto/bio/bss_bio.c
+++ b/thirdparty/openssl/crypto/bio/bss_bio.c
@@ -149,9 +149,13 @@ static int bio_new(BIO *bio)
return 0;
b->peer = NULL;
+ b->closed = 0;
+ b->len = 0;
+ b->offset = 0;
/* enough for one TLS record (just a default) */
b->size = 17 * 1024;
b->buf = NULL;
+ b->request = 0;
bio->ptr = b;
return 1;
@@ -655,16 +659,15 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
break;
case BIO_CTRL_EOF:
- {
- BIO *other_bio = ptr;
-
- if (other_bio) {
- struct bio_bio_st *other_b = other_bio->ptr;
+ if (b->peer != NULL) {
+ struct bio_bio_st *peer_b = b->peer->ptr;
- assert(other_b != NULL);
- ret = other_b->len == 0 && other_b->closed;
- } else
+ if (peer_b->len == 0 && peer_b->closed)
ret = 1;
+ else
+ ret = 0;
+ } else {
+ ret = 1;
}
break;
diff --git a/thirdparty/openssl/crypto/bio/bss_file.c b/thirdparty/openssl/crypto/bio/bss_file.c
index bfba93e62b..0cf67e5b77 100644
--- a/thirdparty/openssl/crypto/bio/bss_file.c
+++ b/thirdparty/openssl/crypto/bio/bss_file.c
@@ -174,7 +174,11 @@ BIO *BIO_new_file(const char *filename, const char *mode)
if (file == NULL) {
SYSerr(SYS_F_FOPEN, get_last_sys_error());
ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");
- if (errno == ENOENT)
+ if (errno == ENOENT
+# ifdef ENXIO
+ || errno == ENXIO
+# endif
+ )
BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE);
else
BIOerr(BIO_F_BIO_NEW_FILE, ERR_R_SYS_LIB);
@@ -247,7 +251,7 @@ static int MS_CALLBACK file_read(BIO *b, char *out, int outl)
ret = fread(out, 1, (int)outl, (FILE *)b->ptr);
if (ret == 0
&& (b->flags & BIO_FLAGS_UPLINK) ? UP_ferror((FILE *)b->ptr) :
- ferror((FILE *)b->ptr)) {
+ ferror((FILE *)b->ptr)) {
SYSerr(SYS_F_FREAD, get_last_sys_error());
BIOerr(BIO_F_FILE_READ, ERR_R_SYS_LIB);
ret = -1;
@@ -283,6 +287,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
FILE *fp = (FILE *)b->ptr;
FILE **fpp;
char p[4];
+ int st;
switch (cmd) {
case BIO_C_FILE_SEEK:
@@ -314,8 +319,11 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
# if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES)
# define _IOB_ENTRIES 20
# endif
-# if defined(_IOB_ENTRIES)
/* Safety net to catch purely internal BIO_set_fp calls */
+# if defined(_MSC_VER) && _MSC_VER>=1900
+ if (ptr == stdin || ptr == stdout || ptr == stderr)
+ BIO_clear_flags(b, BIO_FLAGS_UPLINK);
+# elif defined(_IOB_ENTRIES)
if ((size_t)ptr >= (size_t)stdin &&
(size_t)ptr < (size_t)(stdin + _IOB_ENTRIES))
BIO_clear_flags(b, BIO_FLAGS_UPLINK);
@@ -420,10 +428,14 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
b->shutdown = (int)num;
break;
case BIO_CTRL_FLUSH:
- if (b->flags & BIO_FLAGS_UPLINK)
- UP_fflush(b->ptr);
- else
- fflush((FILE *)b->ptr);
+ st = b->flags & BIO_FLAGS_UPLINK
+ ? UP_fflush(b->ptr) : fflush((FILE *)b->ptr);
+ if (st == EOF) {
+ SYSerr(SYS_F_FFLUSH, get_last_sys_error());
+ ERR_add_error_data(1, "fflush()");
+ BIOerr(BIO_F_FILE_CTRL, ERR_R_SYS_LIB);
+ ret = 0;
+ }
break;
case BIO_CTRL_DUP:
ret = 1;
diff --git a/thirdparty/openssl/crypto/bio/bss_rtcp.c b/thirdparty/openssl/crypto/bio/bss_rtcp.c
index 09f14f48dc..5c98a8234d 100644
--- a/thirdparty/openssl/crypto/bio/bss_rtcp.c
+++ b/thirdparty/openssl/crypto/bio/bss_rtcp.c
@@ -170,6 +170,8 @@ static int rtcp_new(BIO *bi)
bi->num = 0;
bi->flags = 0;
bi->ptr = OPENSSL_malloc(sizeof(struct rpc_ctx));
+ if (bi->ptr == NULL)
+ return (0);
ctx = (struct rpc_ctx *)bi->ptr;
ctx->filled = 0;
ctx->pos = 0;
diff --git a/thirdparty/openssl/crypto/bn/asm/x86_64-gcc.c b/thirdparty/openssl/crypto/bn/asm/x86_64-gcc.c
index d77dc433d4..1729b479d4 100644
--- a/thirdparty/openssl/crypto/bn/asm/x86_64-gcc.c
+++ b/thirdparty/openssl/crypto/bn/asm/x86_64-gcc.c
@@ -194,7 +194,7 @@ BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
BN_ULONG ret, waste;
asm("divq %4":"=a"(ret), "=d"(waste)
- : "a"(l), "d"(h), "g"(d)
+ : "a"(l), "d"(h), "r"(d)
: "cc");
return ret;
diff --git a/thirdparty/openssl/crypto/bn/bn_div.c b/thirdparty/openssl/crypto/bn/bn_div.c
index 72e6ce3f74..bc37671cf1 100644
--- a/thirdparty/openssl/crypto/bn/bn_div.c
+++ b/thirdparty/openssl/crypto/bn/bn_div.c
@@ -155,7 +155,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
({ asm volatile ( \
"divl %4" \
: "=a"(q), "=d"(rem) \
- : "a"(n1), "d"(n0), "g"(d0) \
+ : "a"(n1), "d"(n0), "r"(d0) \
: "cc"); \
q; \
})
@@ -170,7 +170,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
({ asm volatile ( \
"divq %4" \
: "=a"(q), "=d"(rem) \
- : "a"(n1), "d"(n0), "g"(d0) \
+ : "a"(n1), "d"(n0), "r"(d0) \
: "cc"); \
q; \
})
diff --git a/thirdparty/openssl/crypto/bn/bn_exp.c b/thirdparty/openssl/crypto/bn/bn_exp.c
index 1670f01d1d..195a7867a4 100644
--- a/thirdparty/openssl/crypto/bn/bn_exp.c
+++ b/thirdparty/openssl/crypto/bn/bn_exp.c
@@ -180,8 +180,9 @@ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
goto err;
}
}
- if (r != rr)
- BN_copy(r, rr);
+ if (r != rr && BN_copy(r, rr) == NULL)
+ goto err;
+
ret = 1;
err:
BN_CTX_end(ctx);
diff --git a/thirdparty/openssl/crypto/bn/bn_lib.c b/thirdparty/openssl/crypto/bn/bn_lib.c
index 80105fff41..10b78f5126 100644
--- a/thirdparty/openssl/crypto/bn/bn_lib.c
+++ b/thirdparty/openssl/crypto/bn/bn_lib.c
@@ -569,7 +569,7 @@ void BN_clear(BIGNUM *a)
{
bn_check_top(a);
if (a->d != NULL)
- memset(a->d, 0, a->dmax * sizeof(a->d[0]));
+ OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0]));
a->top = 0;
a->neg = 0;
}
diff --git a/thirdparty/openssl/crypto/bn/bn_mul.c b/thirdparty/openssl/crypto/bn/bn_mul.c
index b174850b6b..3c618dc307 100644
--- a/thirdparty/openssl/crypto/bn/bn_mul.c
+++ b/thirdparty/openssl/crypto/bn/bn_mul.c
@@ -1083,8 +1083,9 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
end:
#endif
bn_correct_top(rr);
- if (r != rr)
- BN_copy(r, rr);
+ if (r != rr && BN_copy(r, rr) == NULL)
+ goto err;
+
ret = 1;
err:
bn_check_top(r);
diff --git a/thirdparty/openssl/crypto/bn/bn_prime.c b/thirdparty/openssl/crypto/bn/bn_prime.c
index 1d256874c9..e911e15785 100644
--- a/thirdparty/openssl/crypto/bn/bn_prime.c
+++ b/thirdparty/openssl/crypto/bn/bn_prime.c
@@ -252,7 +252,6 @@ int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
BN_CTX *ctx = NULL;
BIGNUM *A1, *A1_odd, *check; /* taken from ctx */
BN_MONT_CTX *mont = NULL;
- const BIGNUM *A = NULL;
if (BN_cmp(a, BN_value_one()) <= 0)
return 0;
@@ -278,24 +277,14 @@ int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
goto err;
BN_CTX_start(ctx);
- /* A := abs(a) */
- if (a->neg) {
- BIGNUM *t;
- if ((t = BN_CTX_get(ctx)) == NULL)
- goto err;
- BN_copy(t, a);
- t->neg = 0;
- A = t;
- } else
- A = a;
A1 = BN_CTX_get(ctx);
A1_odd = BN_CTX_get(ctx);
check = BN_CTX_get(ctx);
if (check == NULL)
goto err;
- /* compute A1 := A - 1 */
- if (!BN_copy(A1, A))
+ /* compute A1 := a - 1 */
+ if (!BN_copy(A1, a))
goto err;
if (!BN_sub_word(A1, 1))
goto err;
@@ -311,11 +300,11 @@ int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
if (!BN_rshift(A1_odd, A1, k))
goto err;
- /* Montgomery setup for computations mod A */
+ /* Montgomery setup for computations mod a */
mont = BN_MONT_CTX_new();
if (mont == NULL)
goto err;
- if (!BN_MONT_CTX_set(mont, A, ctx))
+ if (!BN_MONT_CTX_set(mont, a, ctx))
goto err;
for (i = 0; i < checks; i++) {
@@ -323,9 +312,9 @@ int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
goto err;
if (!BN_add_word(check, 1))
goto err;
- /* now 1 <= check < A */
+ /* now 1 <= check < a */
- j = witness(check, A, A1, A1_odd, k, ctx, mont);
+ j = witness(check, a, A1, A1_odd, k, ctx, mont);
if (j == -1)
goto err;
if (j) {
diff --git a/thirdparty/openssl/crypto/bn/bn_prime.h b/thirdparty/openssl/crypto/bn/bn_prime.h
index 5cf0de169e..489af8b424 100644
--- a/thirdparty/openssl/crypto/bn/bn_prime.h
+++ b/thirdparty/openssl/crypto/bn/bn_prime.h
@@ -64,263 +64,263 @@ typedef unsigned short prime_t;
typedef unsigned char prime_t;
#endif
static const prime_t primes[NUMPRIMES] = {
- 2, 3, 5, 7, 11, 13, 17, 19,
- 23, 29, 31, 37, 41, 43, 47, 53,
- 59, 61, 67, 71, 73, 79, 83, 89,
- 97, 101, 103, 107, 109, 113, 127, 131,
- 137, 139, 149, 151, 157, 163, 167, 173,
- 179, 181, 191, 193, 197, 199, 211, 223,
- 227, 229, 233, 239, 241, 251,
+ 2, 3, 5, 7, 11, 13, 17, 19,
+ 23, 29, 31, 37, 41, 43, 47, 53,
+ 59, 61, 67, 71, 73, 79, 83, 89,
+ 97, 101, 103, 107, 109, 113, 127, 131,
+ 137, 139, 149, 151, 157, 163, 167, 173,
+ 179, 181, 191, 193, 197, 199, 211, 223,
+ 227, 229, 233, 239, 241, 251,
#ifndef EIGHT_BIT
- 257, 263,
- 269, 271, 277, 281, 283, 293, 307, 311,
- 313, 317, 331, 337, 347, 349, 353, 359,
- 367, 373, 379, 383, 389, 397, 401, 409,
- 419, 421, 431, 433, 439, 443, 449, 457,
- 461, 463, 467, 479, 487, 491, 499, 503,
- 509, 521, 523, 541, 547, 557, 563, 569,
- 571, 577, 587, 593, 599, 601, 607, 613,
- 617, 619, 631, 641, 643, 647, 653, 659,
- 661, 673, 677, 683, 691, 701, 709, 719,
- 727, 733, 739, 743, 751, 757, 761, 769,
- 773, 787, 797, 809, 811, 821, 823, 827,
- 829, 839, 853, 857, 859, 863, 877, 881,
- 883, 887, 907, 911, 919, 929, 937, 941,
- 947, 953, 967, 971, 977, 983, 991, 997,
- 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049,
- 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097,
- 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163,
- 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223,
- 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283,
- 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321,
- 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423,
- 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459,
- 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511,
- 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571,
- 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619,
- 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693,
- 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747,
- 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811,
- 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877,
- 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949,
- 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003,
- 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069,
- 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129,
- 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203,
- 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267,
- 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311,
- 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377,
- 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423,
- 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503,
- 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579,
- 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657,
- 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693,
- 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741,
- 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801,
- 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861,
- 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939,
- 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011,
- 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079,
- 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167,
- 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221,
- 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301,
- 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347,
- 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413,
- 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491,
- 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541,
- 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607,
- 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671,
- 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727,
- 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797,
- 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863,
- 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923,
- 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003,
- 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057,
- 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129,
- 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211,
- 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259,
- 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337,
- 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409,
- 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481,
- 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547,
- 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621,
- 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673,
- 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751,
- 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813,
- 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909,
- 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967,
- 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011,
- 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087,
- 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167,
- 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233,
- 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309,
- 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399,
- 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443,
- 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507,
- 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573,
- 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653,
- 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711,
- 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791,
- 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849,
- 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897,
- 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007,
- 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073,
- 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133,
- 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211,
- 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271,
- 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329,
- 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379,
- 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473,
- 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563,
- 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637,
- 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701,
- 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779,
- 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833,
- 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907,
- 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971,
- 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027,
- 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121,
- 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207,
- 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253,
- 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349,
- 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457,
- 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517,
- 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561,
- 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621,
- 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691,
- 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757,
- 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853,
- 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919,
- 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009,
- 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087,
- 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161,
- 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231,
- 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291,
- 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369,
- 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443,
- 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537,
- 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609,
- 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677,
- 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731,
- 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803,
- 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861,
- 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941,
- 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011,
- 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091,
- 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161,
- 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227,
- 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311,
- 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377,
- 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433,
- 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491,
- 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587,
- 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649,
- 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733,
- 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791,
- 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857,
- 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929,
- 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037,
- 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099,
- 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163,
- 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247,
- 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303,
- 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369,
- 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459,
- 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531,
- 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627,
- 10631, 10639, 10651, 10657, 10663, 10667, 10687, 10691,
- 10709, 10711, 10723, 10729, 10733, 10739, 10753, 10771,
- 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859,
- 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937,
- 10939, 10949, 10957, 10973, 10979, 10987, 10993, 11003,
- 11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087,
- 11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161,
- 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251,
- 11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317,
- 11321, 11329, 11351, 11353, 11369, 11383, 11393, 11399,
- 11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483,
- 11489, 11491, 11497, 11503, 11519, 11527, 11549, 11551,
- 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657,
- 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731,
- 11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813,
- 11821, 11827, 11831, 11833, 11839, 11863, 11867, 11887,
- 11897, 11903, 11909, 11923, 11927, 11933, 11939, 11941,
- 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011,
- 12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101,
- 12107, 12109, 12113, 12119, 12143, 12149, 12157, 12161,
- 12163, 12197, 12203, 12211, 12227, 12239, 12241, 12251,
- 12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323,
- 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401,
- 12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473,
- 12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527,
- 12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589,
- 12601, 12611, 12613, 12619, 12637, 12641, 12647, 12653,
- 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739,
- 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821,
- 12823, 12829, 12841, 12853, 12889, 12893, 12899, 12907,
- 12911, 12917, 12919, 12923, 12941, 12953, 12959, 12967,
- 12973, 12979, 12983, 13001, 13003, 13007, 13009, 13033,
- 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109,
- 13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177,
- 13183, 13187, 13217, 13219, 13229, 13241, 13249, 13259,
- 13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337,
- 13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421,
- 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499,
- 13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597,
- 13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681,
- 13687, 13691, 13693, 13697, 13709, 13711, 13721, 13723,
- 13729, 13751, 13757, 13759, 13763, 13781, 13789, 13799,
- 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879,
- 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933,
- 13963, 13967, 13997, 13999, 14009, 14011, 14029, 14033,
- 14051, 14057, 14071, 14081, 14083, 14087, 14107, 14143,
- 14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221,
- 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323,
- 14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407,
- 14411, 14419, 14423, 14431, 14437, 14447, 14449, 14461,
- 14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549,
- 14551, 14557, 14561, 14563, 14591, 14593, 14621, 14627,
- 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699,
- 14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753,
- 14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821,
- 14827, 14831, 14843, 14851, 14867, 14869, 14879, 14887,
- 14891, 14897, 14923, 14929, 14939, 14947, 14951, 14957,
- 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073,
- 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137,
- 15139, 15149, 15161, 15173, 15187, 15193, 15199, 15217,
- 15227, 15233, 15241, 15259, 15263, 15269, 15271, 15277,
- 15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331,
- 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401,
- 15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473,
- 15493, 15497, 15511, 15527, 15541, 15551, 15559, 15569,
- 15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643,
- 15647, 15649, 15661, 15667, 15671, 15679, 15683, 15727,
- 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773,
- 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859,
- 15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919,
- 15923, 15937, 15959, 15971, 15973, 15991, 16001, 16007,
- 16033, 16057, 16061, 16063, 16067, 16069, 16073, 16087,
- 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183,
- 16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249,
- 16253, 16267, 16273, 16301, 16319, 16333, 16339, 16349,
- 16361, 16363, 16369, 16381, 16411, 16417, 16421, 16427,
- 16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493,
- 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603,
- 16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661,
- 16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747,
- 16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843,
- 16871, 16879, 16883, 16889, 16901, 16903, 16921, 16927,
- 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993,
- 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053,
- 17077, 17093, 17099, 17107, 17117, 17123, 17137, 17159,
- 17167, 17183, 17189, 17191, 17203, 17207, 17209, 17231,
- 17239, 17257, 17291, 17293, 17299, 17317, 17321, 17327,
- 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389,
- 17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467,
- 17471, 17477, 17483, 17489, 17491, 17497, 17509, 17519,
- 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599,
- 17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683,
- 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783,
- 17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863,
+ 257, 263,
+ 269, 271, 277, 281, 283, 293, 307, 311,
+ 313, 317, 331, 337, 347, 349, 353, 359,
+ 367, 373, 379, 383, 389, 397, 401, 409,
+ 419, 421, 431, 433, 439, 443, 449, 457,
+ 461, 463, 467, 479, 487, 491, 499, 503,
+ 509, 521, 523, 541, 547, 557, 563, 569,
+ 571, 577, 587, 593, 599, 601, 607, 613,
+ 617, 619, 631, 641, 643, 647, 653, 659,
+ 661, 673, 677, 683, 691, 701, 709, 719,
+ 727, 733, 739, 743, 751, 757, 761, 769,
+ 773, 787, 797, 809, 811, 821, 823, 827,
+ 829, 839, 853, 857, 859, 863, 877, 881,
+ 883, 887, 907, 911, 919, 929, 937, 941,
+ 947, 953, 967, 971, 977, 983, 991, 997,
+ 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049,
+ 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097,
+ 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163,
+ 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223,
+ 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283,
+ 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321,
+ 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423,
+ 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459,
+ 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511,
+ 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571,
+ 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619,
+ 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693,
+ 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747,
+ 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811,
+ 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877,
+ 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949,
+ 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003,
+ 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069,
+ 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129,
+ 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203,
+ 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267,
+ 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311,
+ 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377,
+ 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423,
+ 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503,
+ 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579,
+ 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657,
+ 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693,
+ 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741,
+ 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801,
+ 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861,
+ 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939,
+ 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011,
+ 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079,
+ 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167,
+ 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221,
+ 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301,
+ 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347,
+ 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413,
+ 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491,
+ 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541,
+ 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607,
+ 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671,
+ 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727,
+ 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797,
+ 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863,
+ 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923,
+ 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003,
+ 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057,
+ 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129,
+ 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211,
+ 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259,
+ 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337,
+ 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409,
+ 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481,
+ 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547,
+ 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621,
+ 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673,
+ 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751,
+ 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813,
+ 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909,
+ 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967,
+ 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011,
+ 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087,
+ 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167,
+ 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233,
+ 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309,
+ 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399,
+ 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443,
+ 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507,
+ 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573,
+ 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653,
+ 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711,
+ 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791,
+ 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849,
+ 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897,
+ 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007,
+ 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073,
+ 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133,
+ 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211,
+ 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271,
+ 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329,
+ 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379,
+ 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473,
+ 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563,
+ 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637,
+ 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701,
+ 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779,
+ 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833,
+ 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907,
+ 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971,
+ 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027,
+ 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121,
+ 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207,
+ 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253,
+ 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349,
+ 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457,
+ 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517,
+ 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561,
+ 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621,
+ 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691,
+ 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757,
+ 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853,
+ 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919,
+ 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009,
+ 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087,
+ 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161,
+ 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231,
+ 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291,
+ 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369,
+ 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443,
+ 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537,
+ 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609,
+ 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677,
+ 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731,
+ 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803,
+ 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861,
+ 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941,
+ 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011,
+ 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091,
+ 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161,
+ 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227,
+ 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311,
+ 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377,
+ 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433,
+ 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491,
+ 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587,
+ 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649,
+ 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733,
+ 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791,
+ 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857,
+ 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929,
+ 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037,
+ 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099,
+ 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163,
+ 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247,
+ 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303,
+ 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369,
+ 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459,
+ 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531,
+ 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627,
+ 10631, 10639, 10651, 10657, 10663, 10667, 10687, 10691,
+ 10709, 10711, 10723, 10729, 10733, 10739, 10753, 10771,
+ 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859,
+ 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937,
+ 10939, 10949, 10957, 10973, 10979, 10987, 10993, 11003,
+ 11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087,
+ 11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161,
+ 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251,
+ 11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317,
+ 11321, 11329, 11351, 11353, 11369, 11383, 11393, 11399,
+ 11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483,
+ 11489, 11491, 11497, 11503, 11519, 11527, 11549, 11551,
+ 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657,
+ 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731,
+ 11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813,
+ 11821, 11827, 11831, 11833, 11839, 11863, 11867, 11887,
+ 11897, 11903, 11909, 11923, 11927, 11933, 11939, 11941,
+ 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011,
+ 12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101,
+ 12107, 12109, 12113, 12119, 12143, 12149, 12157, 12161,
+ 12163, 12197, 12203, 12211, 12227, 12239, 12241, 12251,
+ 12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323,
+ 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401,
+ 12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473,
+ 12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527,
+ 12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589,
+ 12601, 12611, 12613, 12619, 12637, 12641, 12647, 12653,
+ 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739,
+ 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821,
+ 12823, 12829, 12841, 12853, 12889, 12893, 12899, 12907,
+ 12911, 12917, 12919, 12923, 12941, 12953, 12959, 12967,
+ 12973, 12979, 12983, 13001, 13003, 13007, 13009, 13033,
+ 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109,
+ 13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177,
+ 13183, 13187, 13217, 13219, 13229, 13241, 13249, 13259,
+ 13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337,
+ 13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421,
+ 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499,
+ 13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597,
+ 13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681,
+ 13687, 13691, 13693, 13697, 13709, 13711, 13721, 13723,
+ 13729, 13751, 13757, 13759, 13763, 13781, 13789, 13799,
+ 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879,
+ 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933,
+ 13963, 13967, 13997, 13999, 14009, 14011, 14029, 14033,
+ 14051, 14057, 14071, 14081, 14083, 14087, 14107, 14143,
+ 14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221,
+ 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323,
+ 14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407,
+ 14411, 14419, 14423, 14431, 14437, 14447, 14449, 14461,
+ 14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549,
+ 14551, 14557, 14561, 14563, 14591, 14593, 14621, 14627,
+ 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699,
+ 14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753,
+ 14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821,
+ 14827, 14831, 14843, 14851, 14867, 14869, 14879, 14887,
+ 14891, 14897, 14923, 14929, 14939, 14947, 14951, 14957,
+ 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073,
+ 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137,
+ 15139, 15149, 15161, 15173, 15187, 15193, 15199, 15217,
+ 15227, 15233, 15241, 15259, 15263, 15269, 15271, 15277,
+ 15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331,
+ 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401,
+ 15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473,
+ 15493, 15497, 15511, 15527, 15541, 15551, 15559, 15569,
+ 15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643,
+ 15647, 15649, 15661, 15667, 15671, 15679, 15683, 15727,
+ 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773,
+ 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859,
+ 15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919,
+ 15923, 15937, 15959, 15971, 15973, 15991, 16001, 16007,
+ 16033, 16057, 16061, 16063, 16067, 16069, 16073, 16087,
+ 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183,
+ 16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249,
+ 16253, 16267, 16273, 16301, 16319, 16333, 16339, 16349,
+ 16361, 16363, 16369, 16381, 16411, 16417, 16421, 16427,
+ 16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493,
+ 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603,
+ 16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661,
+ 16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747,
+ 16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843,
+ 16871, 16879, 16883, 16889, 16901, 16903, 16921, 16927,
+ 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993,
+ 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053,
+ 17077, 17093, 17099, 17107, 17117, 17123, 17137, 17159,
+ 17167, 17183, 17189, 17191, 17203, 17207, 17209, 17231,
+ 17239, 17257, 17291, 17293, 17299, 17317, 17321, 17327,
+ 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389,
+ 17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467,
+ 17471, 17477, 17483, 17489, 17491, 17497, 17509, 17519,
+ 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599,
+ 17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683,
+ 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783,
+ 17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863,
#endif
};
diff --git a/thirdparty/openssl/crypto/bn/bn_print.c b/thirdparty/openssl/crypto/bn/bn_print.c
index bfa31efc56..f85a6550a5 100644
--- a/thirdparty/openssl/crypto/bn/bn_print.c
+++ b/thirdparty/openssl/crypto/bn/bn_print.c
@@ -72,12 +72,9 @@ char *BN_bn2hex(const BIGNUM *a)
char *buf;
char *p;
- if (a->neg && BN_is_zero(a)) {
- /* "-0" == 3 bytes including NULL terminator */
- buf = OPENSSL_malloc(3);
- } else {
- buf = OPENSSL_malloc(a->top * BN_BYTES * 2 + 2);
- }
+ if (BN_is_zero(a))
+ return OPENSSL_strdup("0");
+ buf = OPENSSL_malloc(a->top * BN_BYTES * 2 + 2);
if (buf == NULL) {
BNerr(BN_F_BN_BN2HEX, ERR_R_MALLOC_FAILURE);
goto err;
@@ -85,8 +82,6 @@ char *BN_bn2hex(const BIGNUM *a)
p = buf;
if (a->neg)
*(p++) = '-';
- if (BN_is_zero(a))
- *(p++) = '0';
for (i = a->top - 1; i >= 0; i--) {
for (j = BN_BITS2 - 8; j >= 0; j -= 8) {
/* strip leading zeros */
@@ -111,6 +106,7 @@ char *BN_bn2dec(const BIGNUM *a)
char *p;
BIGNUM *t = NULL;
BN_ULONG *bn_data = NULL, *lp;
+ int bn_data_num;
/*-
* get an upper bound for the length of the decimal integer
@@ -120,9 +116,9 @@ char *BN_bn2dec(const BIGNUM *a)
*/
i = BN_num_bits(a) * 3;
num = (i / 10 + i / 1000 + 1) + 1;
- bn_data =
- (BN_ULONG *)OPENSSL_malloc((num / BN_DEC_NUM + 1) * sizeof(BN_ULONG));
- buf = (char *)OPENSSL_malloc(num + 3);
+ bn_data_num = num / BN_DEC_NUM + 1;
+ bn_data = OPENSSL_malloc(bn_data_num * sizeof(BN_ULONG));
+ buf = OPENSSL_malloc(num + 3);
if ((buf == NULL) || (bn_data == NULL)) {
BNerr(BN_F_BN_BN2DEC, ERR_R_MALLOC_FAILURE);
goto err;
@@ -140,9 +136,12 @@ char *BN_bn2dec(const BIGNUM *a)
if (BN_is_negative(t))
*p++ = '-';
- i = 0;
while (!BN_is_zero(t)) {
+ if (lp - bn_data >= bn_data_num)
+ goto err;
*lp = BN_div_word(t, BN_DEC_CONV);
+ if (*lp == (BN_ULONG)-1)
+ goto err;
lp++;
}
lp--;
@@ -240,10 +239,12 @@ int BN_hex2bn(BIGNUM **bn, const char *a)
}
ret->top = h;
bn_correct_top(ret);
- ret->neg = neg;
*bn = ret;
bn_check_top(ret);
+ /* Don't set the negative flag if it's zero. */
+ if (ret->top != 0)
+ ret->neg = neg;
return (num);
err:
if (*bn == NULL)
@@ -295,7 +296,7 @@ int BN_dec2bn(BIGNUM **bn, const char *a)
if (j == BN_DEC_NUM)
j = 0;
l = 0;
- while (*a) {
+ while (--i >= 0) {
l *= 10;
l += *a - '0';
a++;
@@ -306,11 +307,13 @@ int BN_dec2bn(BIGNUM **bn, const char *a)
j = 0;
}
}
- ret->neg = neg;
bn_correct_top(ret);
*bn = ret;
bn_check_top(ret);
+ /* Don't set the negative flag if it's zero. */
+ if (ret->top != 0)
+ ret->neg = neg;
return (num);
err:
if (*bn == NULL)
@@ -321,6 +324,7 @@ int BN_dec2bn(BIGNUM **bn, const char *a)
int BN_asc2bn(BIGNUM **bn, const char *a)
{
const char *p = a;
+
if (*p == '-')
p++;
@@ -331,7 +335,8 @@ int BN_asc2bn(BIGNUM **bn, const char *a)
if (!BN_dec2bn(bn, p))
return 0;
}
- if (*a == '-')
+ /* Don't set the negative flag if it's zero. */
+ if (*a == '-' && (*bn)->top != 0)
(*bn)->neg = 1;
return 1;
}
diff --git a/thirdparty/openssl/crypto/bn/bn_rand.c b/thirdparty/openssl/crypto/bn/bn_rand.c
index f9fb2e9e45..60d3f2260b 100644
--- a/thirdparty/openssl/crypto/bn/bn_rand.c
+++ b/thirdparty/openssl/crypto/bn/bn_rand.c
@@ -121,15 +121,14 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
int ret = 0, bit, bytes, mask;
time_t tim;
- if (bits < 0 || (bits == 1 && top > 0)) {
- BNerr(BN_F_BNRAND, BN_R_BITS_TOO_SMALL);
- return 0;
- }
-
if (bits == 0) {
+ if (top != -1 || bottom != 0)
+ goto toosmall;
BN_zero(rnd);
return 1;
}
+ if (bits < 0 || (bits == 1 && top > 0))
+ goto toosmall;
bytes = (bits + 7) / 8;
bit = (bits - 1) % 8;
@@ -145,13 +144,9 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
time(&tim);
RAND_add(&tim, sizeof(tim), 0.0);
- if (pseudorand) {
- if (RAND_pseudo_bytes(buf, bytes) == -1)
- goto err;
- } else {
- if (RAND_bytes(buf, bytes) <= 0)
- goto err;
- }
+ /* We ignore the value of pseudorand and always call RAND_bytes */
+ if (RAND_bytes(buf, bytes) <= 0)
+ goto err;
#if 1
if (pseudorand == 2) {
@@ -199,6 +194,10 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
}
bn_check_top(rnd);
return (ret);
+
+toosmall:
+ BNerr(BN_F_BNRAND, BN_R_BITS_TOO_SMALL);
+ return 0;
}
int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
diff --git a/thirdparty/openssl/crypto/bn/bn_sqr.c b/thirdparty/openssl/crypto/bn/bn_sqr.c
index 3ca69879ee..256d26e8db 100644
--- a/thirdparty/openssl/crypto/bn/bn_sqr.c
+++ b/thirdparty/openssl/crypto/bn/bn_sqr.c
@@ -143,8 +143,9 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
rr->top = max - 1;
else
rr->top = max;
- if (rr != r)
- BN_copy(r, rr);
+ if (r != rr && BN_copy(r, rr) == NULL)
+ goto err;
+
ret = 1;
err:
bn_check_top(rr);
diff --git a/thirdparty/openssl/crypto/bn/bn_word.c b/thirdparty/openssl/crypto/bn/bn_word.c
index b031a60b5b..9b5f9cb98c 100644
--- a/thirdparty/openssl/crypto/bn/bn_word.c
+++ b/thirdparty/openssl/crypto/bn/bn_word.c
@@ -72,10 +72,32 @@ BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w)
if (w == 0)
return (BN_ULONG)-1;
+#ifndef BN_LLONG
+ /*
+ * If |w| is too long and we don't have BN_ULLONG then we need to fall
+ * back to using BN_div_word
+ */
+ if (w > ((BN_ULONG)1 << BN_BITS4)) {
+ BIGNUM *tmp = BN_dup(a);
+ if (tmp == NULL)
+ return (BN_ULONG)-1;
+
+ ret = BN_div_word(tmp, w);
+ BN_free(tmp);
+
+ return ret;
+ }
+#endif
+
bn_check_top(a);
w &= BN_MASK2;
for (i = a->top - 1; i >= 0; i--) {
#ifndef BN_LLONG
+ /*
+ * We can assume here that | w <= ((BN_ULONG)1 << BN_BITS4) | and so
+ * | ret < ((BN_ULONG)1 << BN_BITS4) | and therefore the shifts here are
+ * safe and will not overflow
+ */
ret = ((ret << BN_BITS4) | ((a->d[i] >> BN_BITS4) & BN_MASK2l)) % w;
ret = ((ret << BN_BITS4) | (a->d[i] & BN_MASK2l)) % w;
#else
diff --git a/thirdparty/openssl/crypto/cms/cms_enc.c b/thirdparty/openssl/crypto/cms/cms_enc.c
index b14b4b68b5..90b1fcc750 100644
--- a/thirdparty/openssl/crypto/cms/cms_enc.c
+++ b/thirdparty/openssl/crypto/cms/cms_enc.c
@@ -119,7 +119,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
/* Generate a random IV if we need one */
ivlen = EVP_CIPHER_CTX_iv_length(ctx);
if (ivlen > 0) {
- if (RAND_pseudo_bytes(iv, ivlen) <= 0)
+ if (RAND_bytes(iv, ivlen) <= 0)
goto err;
piv = iv;
}
@@ -179,10 +179,9 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
CMS_R_CIPHER_INITIALISATION_ERROR);
goto err;
}
-
- if (piv) {
+ if (enc) {
calg->parameter = ASN1_TYPE_new();
- if (!calg->parameter) {
+ if (calg->parameter == NULL) {
CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO, ERR_R_MALLOC_FAILURE);
goto err;
}
@@ -191,6 +190,11 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR);
goto err;
}
+ /* If parameter type not set omit parameter */
+ if (calg->parameter->type == V_ASN1_UNDEF) {
+ ASN1_TYPE_free(calg->parameter);
+ calg->parameter = NULL;
+ }
}
ok = 1;
diff --git a/thirdparty/openssl/crypto/cms/cms_ess.c b/thirdparty/openssl/crypto/cms/cms_ess.c
index 8631a2eb2b..8212560628 100644
--- a/thirdparty/openssl/crypto/cms/cms_ess.c
+++ b/thirdparty/openssl/crypto/cms/cms_ess.c
@@ -107,8 +107,7 @@ CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,
else {
if (!ASN1_STRING_set(rr->signedContentIdentifier, NULL, 32))
goto merr;
- if (RAND_pseudo_bytes(rr->signedContentIdentifier->data, 32)
- <= 0)
+ if (RAND_bytes(rr->signedContentIdentifier->data, 32) <= 0)
goto err;
}
diff --git a/thirdparty/openssl/crypto/cms/cms_kari.c b/thirdparty/openssl/crypto/cms/cms_kari.c
index 2cfcdb29cd..ee283172d3 100644
--- a/thirdparty/openssl/crypto/cms/cms_kari.c
+++ b/thirdparty/openssl/crypto/cms/cms_kari.c
@@ -401,9 +401,12 @@ static int cms_wrap_init(CMS_KeyAgreeRecipientInfo *kari,
* Pick a cipher based on content encryption cipher. If it is DES3 use
* DES3 wrap otherwise use AES wrap similar to key size.
*/
+#ifndef OPENSSL_NO_DES
if (EVP_CIPHER_type(cipher) == NID_des_ede3_cbc)
kekcipher = EVP_des_ede3_wrap();
- else if (keylen <= 16)
+ else
+#endif
+ if (keylen <= 16)
kekcipher = EVP_aes_128_wrap();
else if (keylen <= 24)
kekcipher = EVP_aes_192_wrap();
diff --git a/thirdparty/openssl/crypto/cms/cms_lib.c b/thirdparty/openssl/crypto/cms/cms_lib.c
index d6cb60d02d..6d27c4969b 100644
--- a/thirdparty/openssl/crypto/cms/cms_lib.c
+++ b/thirdparty/openssl/crypto/cms/cms_lib.c
@@ -413,6 +413,8 @@ static STACK_OF(CMS_CertificateChoices)
return &cms->d.signedData->certificates;
case NID_pkcs7_enveloped:
+ if (cms->d.envelopedData->originatorInfo == NULL)
+ return NULL;
return &cms->d.envelopedData->originatorInfo->certificates;
default:
@@ -488,6 +490,8 @@ static STACK_OF(CMS_RevocationInfoChoice)
return &cms->d.signedData->crls;
case NID_pkcs7_enveloped:
+ if (cms->d.envelopedData->originatorInfo == NULL)
+ return NULL;
return &cms->d.envelopedData->originatorInfo->crls;
default:
diff --git a/thirdparty/openssl/crypto/cms/cms_pwri.c b/thirdparty/openssl/crypto/cms/cms_pwri.c
index b91c01691f..5c817caf2f 100644
--- a/thirdparty/openssl/crypto/cms/cms_pwri.c
+++ b/thirdparty/openssl/crypto/cms/cms_pwri.c
@@ -134,7 +134,7 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
ivlen = EVP_CIPHER_CTX_iv_length(&ctx);
if (ivlen > 0) {
- if (RAND_pseudo_bytes(iv, ivlen) <= 0)
+ if (RAND_bytes(iv, ivlen) <= 0)
goto err;
if (EVP_EncryptInit_ex(&ctx, NULL, NULL, NULL, iv) <= 0) {
CMSerr(CMS_F_CMS_ADD0_RECIPIENT_PASSWORD, ERR_R_EVP_LIB);
@@ -301,7 +301,7 @@ static int kek_wrap_key(unsigned char *out, size_t *outlen,
memcpy(out + 4, in, inlen);
/* Add random padding to end */
if (olen > inlen + 4
- && RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen) < 0)
+ && RAND_bytes(out + 4 + inlen, olen - 4 - inlen) <= 0)
return 0;
/* Encrypt twice */
EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
diff --git a/thirdparty/openssl/crypto/comp/c_rle.c b/thirdparty/openssl/crypto/comp/c_rle.c
index e9aabbd166..41919613ee 100644
--- a/thirdparty/openssl/crypto/comp/c_rle.c
+++ b/thirdparty/openssl/crypto/comp/c_rle.c
@@ -31,12 +31,11 @@ static int rle_compress_block(COMP_CTX *ctx, unsigned char *out,
unsigned int olen, unsigned char *in,
unsigned int ilen)
{
- /* int i; */
+ if (ilen == 0)
+ return 0;
- if (ilen == 0 || olen < (ilen - 1)) {
- /* ZZZZZZZZZZZZZZZZZZZZZZ */
- return (-1);
- }
+ if (olen <= ilen)
+ return -1;
*(out++) = 0;
memcpy(out, in, ilen);
@@ -49,14 +48,16 @@ static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
{
int i;
- if (olen < (ilen - 1)) {
- /* ZZZZZZZZZZZZZZZZZZZZZZ */
- return (-1);
- }
+ if (ilen == 0)
+ return 0;
+
+ if (olen < (ilen - 1))
+ return -1;
i = *(in++);
- if (i == 0) {
- memcpy(out, in, ilen - 1);
- }
+ if (i != 0)
+ return -1;
+
+ memcpy(out, in, ilen - 1);
return (ilen - 1);
}
diff --git a/thirdparty/openssl/crypto/conf/conf_def.c b/thirdparty/openssl/crypto/conf/conf_def.c
index 68c77cec7d..75e309aaca 100644
--- a/thirdparty/openssl/crypto/conf/conf_def.c
+++ b/thirdparty/openssl/crypto/conf/conf_def.c
@@ -69,6 +69,12 @@
#include <openssl/buffer.h>
#include <openssl/err.h>
+/*
+ * The maximum length we can grow a value to after variable expansion. 64k
+ * should be more than enough for all reasonable uses.
+ */
+#define MAX_CONF_VALUE_LENGTH 65536
+
static char *eat_ws(CONF *conf, char *p);
static char *eat_alpha_numeric(CONF *conf, char *p);
static void clear_comments(CONF *conf, char *p);
@@ -530,6 +536,8 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
} else if (IS_EOF(conf, *from))
break;
else if (*from == '$') {
+ size_t newsize;
+
/* try to expand it */
rrp = NULL;
s = &(from[1]);
@@ -584,8 +592,12 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
CONFerr(CONF_F_STR_COPY, CONF_R_VARIABLE_HAS_NO_VALUE);
goto err;
}
- if (!BUF_MEM_grow_clean(buf,
- (strlen(p) + buf->length - (e - from)))) {
+ newsize = strlen(p) + buf->length - (e - from);
+ if (newsize > MAX_CONF_VALUE_LENGTH) {
+ CONFerr(CONF_F_STR_COPY, CONF_R_VARIABLE_EXPANSION_TOO_LONG);
+ goto err;
+ }
+ if (!BUF_MEM_grow_clean(buf, newsize)) {
CONFerr(CONF_F_STR_COPY, ERR_R_MALLOC_FAILURE);
goto err;
}
diff --git a/thirdparty/openssl/crypto/conf/conf_def.h b/thirdparty/openssl/crypto/conf/conf_def.h
index 7d897b89f1..48b3442181 100644
--- a/thirdparty/openssl/crypto/conf/conf_def.h
+++ b/thirdparty/openssl/crypto/conf/conf_def.h
@@ -81,34 +81,34 @@
#define KEYTYPES(c) ((unsigned short *)((c)->meth_data))
#ifndef CHARSET_EBCDIC
-# define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT)
-# define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT)
-# define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF)
-# define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC)
-# define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER)
-# define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS)
-# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC)
+# define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT)
+# define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT)
+# define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF)
+# define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC)
+# define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER)
+# define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS)
+# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC)
# define IS_ALPHA_NUMERIC_PUNCT(c,a) \
(KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
-# define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE)
-# define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
-# define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)
+# define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE)
+# define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
+# define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)
-#else /* CHARSET_EBCDIC */
+#else /*CHARSET_EBCDIC*/
-# define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT)
-# define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT)
-# define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF)
-# define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC)
-# define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER)
-# define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS)
-# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC)
+# define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT)
+# define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT)
+# define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF)
+# define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC)
+# define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER)
+# define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS)
+# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC)
# define IS_ALPHA_NUMERIC_PUNCT(c,a) \
(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
-# define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE)
-# define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE)
-# define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT)
-#endif /* CHARSET_EBCDIC */
+# define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE)
+# define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE)
+# define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT)
+#endif /*CHARSET_EBCDIC*/
static unsigned short CONF_type_default[256] = {
0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
diff --git a/thirdparty/openssl/crypto/conf/conf_err.c b/thirdparty/openssl/crypto/conf/conf_err.c
index bb5e2fe252..b0b6896f83 100644
--- a/thirdparty/openssl/crypto/conf/conf_err.c
+++ b/thirdparty/openssl/crypto/conf/conf_err.c
@@ -115,6 +115,8 @@ static ERR_STRING_DATA CONF_str_reasons[] = {
{ERR_REASON(CONF_R_UNABLE_TO_CREATE_NEW_SECTION),
"unable to create new section"},
{ERR_REASON(CONF_R_UNKNOWN_MODULE_NAME), "unknown module name"},
+ {ERR_REASON(CONF_R_VARIABLE_EXPANSION_TOO_LONG),
+ "variable expansion too long"},
{ERR_REASON(CONF_R_VARIABLE_HAS_NO_VALUE), "variable has no value"},
{0, NULL}
};
diff --git a/thirdparty/openssl/crypto/conf/conf_mod.c b/thirdparty/openssl/crypto/conf/conf_mod.c
index 9acfca4f71..e0c9a67ff6 100644
--- a/thirdparty/openssl/crypto/conf/conf_mod.c
+++ b/thirdparty/openssl/crypto/conf/conf_mod.c
@@ -288,6 +288,10 @@ static CONF_MODULE *module_add(DSO *dso, const char *name,
tmod->dso = dso;
tmod->name = BUF_strdup(name);
+ if (tmod->name == NULL) {
+ OPENSSL_free(tmod);
+ return NULL;
+ }
tmod->init = ifunc;
tmod->finish = ffunc;
tmod->links = 0;
diff --git a/thirdparty/openssl/crypto/conf/ssleay.cnf b/thirdparty/openssl/crypto/conf/ssleay.cnf
deleted file mode 100644
index ed33af601e..0000000000
--- a/thirdparty/openssl/crypto/conf/ssleay.cnf
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# This is a test configuration file for use in SSLeay etc...
-#
-
-init = 5
-in\#it1 =10
-init2='10'
-init3='10\''
-init4="10'"
-init5='='10\'' again'
-
-SSLeay::version = 0.5.0
-
-[genrsa]
-default_bits = 512
-SSLEAY::version = 0.5.0
-
-[gendh]
-default_bits = 512
-def_generator = 2
-
-[s_client]
-cipher1 = DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5\
-cipher2 = 'DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5'
-cipher3 = "DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5"
-cipher4 = DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
-
-[ default ]
-cert_dir = $ENV::HOME/.ca_certs
-
-HOME = /tmp/eay
-
-tmp_cert_dir = $HOME/.ca_certs
-tmp2_cert_dir = thisis$(HOME)stuff
-
-LOGNAME = Eric Young (home=$HOME)
-
-[ special ]
-
-H=$HOME
-H=$default::HOME
-H=$ENV::HOME
-#
-# SSLeay example configuration file.
-# This is mostly being used for generation of certificate requests.
-#
-
-RANDFILE = $HOME/.rand
-
-[ req ]
-default_bits = 512
-default_keyfile = privkey.pem
-
-Attribute_type_1 = countryName
-Attribute_text_1 = Country Name (2 letter code)
-Attribute_default_1 = AU
-
-Attribute_type_2 = stateOrProvinceName
-Attribute_text_2 = State or Province Name (full name)
-Attribute_default_2 = Queensland
-
-Attribute_type_3 = localityName
-Attribute_text_3 = Locality Name (eg, city)
-
-Attribute_type_4 = organizationName
-Attribute_text_4 = Organization Name (eg, company)
-Attribute_default_4 = Mincom Pty Ltd
-
-Attribute_type_5 = organizationalUnitName
-Attribute_text_5 = Organizational Unit Name (eg, section)
-Attribute_default_5 = TR
-
-Attribute_type_6 = commonName
-Attribute_text_6 = Common Name (eg, YOUR name)
-
-Attribute_type_7 = emailAddress
-Attribute_text_7 = Email Address
-
diff --git a/thirdparty/openssl/crypto/crypto-lib.com b/thirdparty/openssl/crypto/crypto-lib.com
deleted file mode 100644
index 1423cac288..0000000000
--- a/thirdparty/openssl/crypto/crypto-lib.com
+++ /dev/null
@@ -1,1537 +0,0 @@
-$!
-$! CRYPTO-LIB.COM
-$! Written By: Robert Byer
-$! Vice-President
-$! A-Com Computing, Inc.
-$! byer@mail.all-net.net
-$!
-$! Changes by Richard Levitte <richard@levitte.org>
-$! Zoltan Arpadffy <arpadffy@polarhome.com>
-$!
-$! This command files compiles and creates the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB"
-$! library for OpenSSL. The "xxx" denotes the machine architecture, ALPHA,
-$! IA64 or VAX.
-$!
-$! It was re-written so it would try to determine what "C" compiler to use
-$! or you can specify which "C" compiler to use.
-$!
-$! Specify the following as P1 to build just that part or ALL to just
-$! build everything.
-$!
-$! LIBRARY To just compile the [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library.
-$! APPS To just compile the [.xxx.EXE.CRYPTO]*.EXE
-$! ALL To do both LIBRARY and APPS
-$!
-$! Specify DEBUG or NODEBUG as P2 to compile with or without debugger
-$! information.
-$!
-$! Specify which compiler at P3 to try to compile under.
-$!
-$! VAXC For VAX C.
-$! DECC For DEC C.
-$! GNUC For GNU C.
-$!
-$! If you don't specify a compiler, it will try to determine which
-$! "C" compiler to use.
-$!
-$! P4, if defined, sets a TCP/IP library to use, through one of the following
-$! keywords:
-$!
-$! UCX For UCX
-$! TCPIP For TCPIP (post UCX)
-$! SOCKETSHR For SOCKETSHR+NETLIB
-$!
-$! P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
-$!
-$! P6, if defined, sets a choice of crypto methods to compile.
-$! WARNING: this should only be done to recompile some part of an already
-$! fully compiled library.
-$!
-$! P7, if defined, specifies the C pointer size. Ignored on VAX.
-$! ("64=ARGV" gives more efficient code with HP C V7.3 or newer.)
-$! Supported values are:
-$!
-$! "" Compile with default (/NOPOINTER_SIZE)
-$! 32 Compile with /POINTER_SIZE=32 (SHORT)
-$! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV]).
-$! (Automatically select ARGV if compiler supports it.)
-$! 64= Compile with /POINTER_SIZE=64 (LONG).
-$! 64=ARGV Compile with /POINTER_SIZE=64=ARGV (LONG=ARGV).
-$!
-$! P8, if defined, specifies a directory where ZLIB files (zlib.h,
-$! libz.olb) may be found. Optionally, a non-default object library
-$! name may be included ("dev:[dir]libz_64.olb", for example).
-$!
-$!
-$! Announce/identify.
-$!
-$ proc = f$environment( "procedure")
-$ write sys$output "@@@ "+ -
- f$parse( proc, , , "name")+ f$parse( proc, , , "type")
-$!
-$! Define A TCP/IP Library That We Will Need To Link To.
-$! (That Is, If We Need To Link To One.)
-$!
-$ TCPIP_LIB = ""
-$ ZLIB_LIB = ""
-$!
-$! Check Which Architecture We Are Using.
-$!
-$ IF (F$GETSYI("CPU").LT.128)
-$ THEN
-$!
-$! The Architecture Is VAX
-$!
-$ ARCH = "VAX"
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! The Architecture Is Alpha, IA64 or whatever comes in the future.
-$!
-$ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
-$ IF (ARCH .EQS. "") THEN ARCH = "UNK"
-$!
-$! End The Architecture Check.
-$!
-$ ENDIF
-$!
-$ ARCHD = ARCH
-$ LIB32 = "32"
-$ OPT_FILE = ""
-$ POINTER_SIZE = ""
-$!
-$! Define The Different Encryption Types.
-$! NOTE: Some might think this list ugly. However, it's made this way to
-$! reflect the SDIRS variable in [-]Makefile.org as closely as possible,
-$! thereby making it fairly easy to verify that the lists are the same.
-$!
-$ ET_WHIRLPOOL = "WHRLPOOL"
-$ IF ARCH .EQS. "VAX" THEN ET_WHIRLPOOL = ""
-$ ENCRYPT_TYPES = "Basic,"+ -
- "OBJECTS,"+ -
- "MD4,MD5,SHA,MDC2,HMAC,RIPEMD,"+ET_WHIRLPOOL+","+ -
- "DES,AES,RC2,RC4,IDEA,BF,CAST,CAMELLIA,SEED,MODES,"+ -
- "BN,EC,RSA,DSA,ECDSA,DH,ECDH,DSO,ENGINE,"+ -
- "BUFFER,BIO,STACK,LHASH,RAND,ERR,"+ -
- "EVP,EVP_2,EVP_3,ASN1,ASN1_2,PEM,X509,X509V3,"+ -
- "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ -
- "CMS,PQUEUE,TS,JPAKE,SRP,STORE,CMAC"
-$!
-$! Check To Make Sure We Have Valid Command Line Parameters.
-$!
-$ GOSUB CHECK_OPTIONS
-$!
-$! Define The OBJ and EXE Directories.
-$!
-$ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.CRYPTO]
-$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]
-$!
-$! Specify the destination directory in any /MAP option.
-$!
-$ if (LINKMAP .eqs. "MAP")
-$ then
-$ LINKMAP = LINKMAP+ "=''EXE_DIR'"
-$ endif
-$!
-$! Add the location prefix to the linker options file name.
-$!
-$ if (OPT_FILE .nes. "")
-$ then
-$ OPT_FILE = EXE_DIR+ OPT_FILE
-$ endif
-$!
-$! Initialise logical names and such
-$!
-$ GOSUB INITIALISE
-$!
-$! Tell The User What Kind of Machine We Run On.
-$!
-$ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'"
-$!
-$!
-$! Check To See If The Architecture Specific OBJ Directory Exists.
-$!
-$ IF (F$PARSE(OBJ_DIR).EQS."")
-$ THEN
-$!
-$! It Dosen't Exist, So Create It.
-$!
-$ CREATE/DIR 'OBJ_DIR'
-$!
-$! End The Architecture Specific OBJ Directory Check.
-$!
-$ ENDIF
-$!
-$! Check To See If The Architecture Specific Directory Exists.
-$!
-$ IF (F$PARSE(EXE_DIR).EQS."")
-$ THEN
-$!
-$! It Dosen't Exist, So Create It.
-$!
-$ CREATE/DIRECTORY 'EXE_DIR'
-$!
-$! End The Architecture Specific Directory Check.
-$!
-$ ENDIF
-$!
-$! Define The Library Name.
-$!
-$ LIB_NAME := 'EXE_DIR'SSL_LIBCRYPTO'LIB32'.OLB
-$!
-$! Define The CRYPTO-LIB We Are To Use.
-$!
-$ CRYPTO_LIB := 'EXE_DIR'SSL_LIBCRYPTO'LIB32'.OLB
-$!
-$! Check To See If We Already Have A "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library...
-$!
-$ IF (F$SEARCH(LIB_NAME).EQS."")
-$ THEN
-$!
-$! Guess Not, Create The Library.
-$!
-$ LIBRARY/CREATE/OBJECT 'LIB_NAME'
-$!
-$! End The Library Check.
-$!
-$ ENDIF
-$!
-$! Build our options file for the application
-$!
-$ GOSUB CHECK_OPT_FILE
-$!
-$! Define The Different Encryption "library" Strings.
-$!
-$!!! Test apps disabled, as they aren't supported at all,
-$!!! not even in the unix build
-$!!! APPS_DES = "DES/DES,CBC3_ENC"
-$!!! APPS_PKCS7 = "ENC/ENC;DEC/DEC;SIGN/SIGN;VERIFY/VERIFY,EXAMPLE"
-$
-$! These variables are ordered as the SDIRS variable from the top Makefile.org
-$! The contents of these variables are copied from the LIBOBJ variable in the
-$! corresponding Makefile from each corresponding subdirectory, with .o stripped
-$! and spaces replaced with commas.
-$ LIB_ = "cryptlib,mem,mem_dbg,cversion,ex_data,cpt_err,ebcdic,"+ -
- "uid,o_time,o_str,o_dir,o_fips,o_init,fips_ers,mem_clr"
-$ LIB_OBJECTS = "o_names,obj_dat,obj_lib,obj_err,obj_xref"
-$ LIB_MD2 = "md2_dgst,md2_one"
-$ LIB_MD4 = "md4_dgst,md4_one"
-$ LIB_MD5 = "md5_dgst,md5_one"
-$ LIB_SHA = "sha_dgst,sha1dgst,sha_one,sha1_one,sha256,sha512"
-$ LIB_MDC2 = "mdc2dgst,mdc2_one"
-$ LIB_HMAC = "hmac,hm_ameth,hm_pmeth"
-$ LIB_RIPEMD = "rmd_dgst,rmd_one"
-$ LIB_WHRLPOOL = "wp_dgst,wp_block"
-$ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ -
- "ecb3_enc,cfb64enc,cfb64ede,cfb_enc,ofb64ede,"+ -
- "enc_read,enc_writ,ofb64enc,"+ -
- "ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ -
- "des_enc,fcrypt_b,"+ -
- "fcrypt,xcbc_enc,rpc_enc,cbc_cksm,"+ -
- "ede_cbcm_enc,des_old,des_old2,read2pwd"
-$ LIB_AES = "aes_misc,aes_ecb,aes_cfb,aes_ofb,aes_ctr,aes_ige,aes_wrap,"+ -
- "aes_core,aes_cbc"
-$ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64"
-$ LIB_RC4 = "rc4_enc,rc4_skey,rc4_utl"
-$ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64"
-$ LIB_IDEA = "i_cbc,i_cfb64,i_ofb64,i_ecb,i_skey"
-$ LIB_BF = "bf_skey,bf_ecb,bf_enc,bf_cfb64,bf_ofb64"
-$ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64"
-$ LIB_CAMELLIA = "cmll_ecb,cmll_ofb,cmll_cfb,cmll_ctr,"+ -
- "cmll_utl,camellia,cmll_misc,cmll_cbc"
-$ LIB_SEED = "seed,seed_ecb,seed_cbc,seed_cfb,seed_ofb"
-$ LIB_MODES = "cbc128,ctr128,cts128,cfb128,ofb128,gcm128,"+ -
- "ccm128,xts128,wrap128"
-$ LIB_BN_ASM = "[.asm]vms.mar,vms-helper"
-$ IF F$TRNLNM("OPENSSL_NO_ASM") .OR. ARCH .NES. "VAX" THEN -
- LIB_BN_ASM = "bn_asm"
-$ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_ctx,bn_mul,bn_mod,"+ -
- "bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ -
- "bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ -
- "bn_recp,bn_mont,bn_mpi,bn_exp2,bn_gf2m,bn_nist,"+ -
- "bn_depr,bn_const,bn_x931p"
-$ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_nist,ec_cvt,ec_mult,"+ -
- "ec_err,ec_curve,ec_check,ec_print,ec_asn1,ec_key,"+ -
- "ec2_smpl,ec2_mult,ec_ameth,ec_pmeth,eck_prn,"+ -
- "ecp_nistp224,ecp_nistp256,ecp_nistp521,ecp_nistputil,"+ -
- "ecp_oct,ec2_oct,ec_oct"
-$ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ -
- "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ -
- "rsa_pss,rsa_x931,rsa_asn1,rsa_depr,rsa_ameth,rsa_prn,"+ -
- "rsa_pmeth,rsa_crpt"
-$ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,"+ -
- "dsa_err,dsa_ossl,dsa_depr,dsa_ameth,dsa_pmeth,dsa_prn"
-$ LIB_ECDSA = "ecs_lib,ecs_asn1,ecs_ossl,ecs_sign,ecs_vrf,ecs_err"
-$ LIB_DH = "dh_asn1,dh_gen,dh_key,dh_lib,dh_check,dh_err,dh_depr,"+ -
- "dh_ameth,dh_pmeth,dh_prn,dh_rfc5114,dh_kdf"
-$ LIB_ECDH = "ech_lib,ech_ossl,ech_key,ech_err,ech_kdf"
-$ LIB_DSO = "dso_dl,dso_dlfcn,dso_err,dso_lib,dso_null,"+ -
- "dso_openssl,dso_win32,dso_vms,dso_beos"
-$ LIB_ENGINE = "eng_err,eng_lib,eng_list,eng_init,eng_ctrl,"+ -
- "eng_table,eng_pkey,eng_fat,eng_all,"+ -
- "tb_rsa,tb_dsa,tb_ecdsa,tb_dh,tb_ecdh,tb_rand,tb_store,"+ -
- "tb_cipher,tb_digest,tb_pkmeth,tb_asnmth,"+ -
- "eng_openssl,eng_cnf,eng_dyn,eng_cryptodev,"+ -
- "eng_rdrand"
-$ LIB_BUFFER = "buffer,buf_str,buf_err"
-$ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
- "bss_mem,bss_null,bss_fd,"+ -
- "bss_file,bss_sock,bss_conn,"+ -
- "bf_null,bf_buff,b_print,b_dump,"+ -
- "b_sock,bss_acpt,bf_nbio,bss_log,bss_bio,"+ -
- "bss_dgram,"+ -
- "bf_lbuf,bss_rtcp" ! The last two are VMS specific
-$ LIB_STACK = "stack"
-$ LIB_LHASH = "lhash,lh_stats"
-$ LIB_RAND = "md_rand,randfile,rand_lib,rand_err,rand_egd,"+ -
- "rand_vms" ! The last one is VMS specific
-$ LIB_ERR = "err,err_all,err_prn"
-$ LIB_EVP = "encode,digest,evp_enc,evp_key,evp_acnf,evp_cnf,"+ -
- "e_des,e_bf,e_idea,e_des3,e_camellia,"+ -
- "e_rc4,e_aes,names,e_seed,"+ -
- "e_xcbc_d,e_rc2,e_cast,e_rc5"
-$ LIB_EVP_2 = "m_null,m_md2,m_md4,m_md5,m_sha,m_sha1,m_wp," + -
- "m_dss,m_dss1,m_mdc2,m_ripemd,m_ecdsa,"+ -
- "p_open,p_seal,p_sign,p_verify,p_lib,p_enc,p_dec,"+ -
- "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ -
- "c_all,c_allc,c_alld,evp_lib,bio_ok,"+-
- "evp_pkey,evp_pbe,p5_crpt,p5_crpt2"
-$ LIB_EVP_3 = "e_old,pmeth_lib,pmeth_fn,pmeth_gn,m_sigver,"+ -
- "e_aes_cbc_hmac_sha1,e_aes_cbc_hmac_sha256,e_rc4_hmac_md5"
-$ LIB_ASN1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ -
- "a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,"+ -
- "a_enum,a_utf8,a_sign,a_digest,a_verify,a_mbstr,a_strex,"+ -
- "x_algor,x_val,x_pubkey,x_sig,x_req,x_attrib,x_bignum,"+ -
- "x_long,x_name,x_x509,x_x509a,x_crl,x_info,x_spki,nsseq,"+ -
- "x_nx509,d2i_pu,d2i_pr,i2d_pu,i2d_pr"
-$ LIB_ASN1_2 = "t_req,t_x509,t_x509a,t_crl,t_pkey,t_spki,t_bitst,"+ -
- "tasn_new,tasn_fre,tasn_enc,tasn_dec,tasn_utl,tasn_typ,"+ -
- "tasn_prn,ameth_lib,"+ -
- "f_int,f_string,n_pkey,"+ -
- "f_enum,x_pkey,a_bool,x_exten,bio_asn1,bio_ndef,asn_mime,"+ -
- "asn1_gen,asn1_par,asn1_lib,asn1_err,a_bytes,a_strnid,"+ -
- "evp_asn1,asn_pack,p5_pbe,p5_pbev2,p8_pkey,asn_moid"
-$ LIB_PEM = "pem_sign,pem_seal,pem_info,pem_lib,pem_all,pem_err,"+ -
- "pem_x509,pem_xaux,pem_oth,pem_pk8,pem_pkey,pvkfmt"
-$ LIB_X509 = "x509_def,x509_d2,x509_r2x,x509_cmp,"+ -
- "x509_obj,x509_req,x509spki,x509_vfy,"+ -
- "x509_set,x509cset,x509rset,x509_err,"+ -
- "x509name,x509_v3,x509_ext,x509_att,"+ -
- "x509type,x509_lu,x_all,x509_txt,"+ -
- "x509_trs,by_file,by_dir,x509_vpm"
-$ LIB_X509V3 = "v3_bcons,v3_bitst,v3_conf,v3_extku,v3_ia5,v3_lib,"+ -
- "v3_prn,v3_utl,v3err,v3_genn,v3_alt,v3_skey,v3_akey,v3_pku,"+ -
- "v3_int,v3_enum,v3_sxnet,v3_cpols,v3_crld,v3_purp,v3_info,"+ -
- "v3_ocsp,v3_akeya,v3_pmaps,v3_pcons,v3_ncons,v3_pcia,v3_pci,"+ -
- "pcy_cache,pcy_node,pcy_data,pcy_map,pcy_tree,pcy_lib,"+ -
- "v3_asid,v3_addr,v3_scts"
-$ LIB_CONF = "conf_err,conf_lib,conf_api,conf_def,conf_mod,conf_mall,conf_sap"
-$ LIB_TXT_DB = "txt_db"
-$ LIB_PKCS7 = "pk7_asn1,pk7_lib,pkcs7err,pk7_doit,pk7_smime,pk7_attr,"+ -
- "pk7_mime,bio_pk7"
-$ LIB_PKCS12 = "p12_add,p12_asn,p12_attr,p12_crpt,p12_crt,p12_decr,"+ -
- "p12_init,p12_key,p12_kiss,p12_mutl,"+ -
- "p12_utl,p12_npas,pk12err,p12_p8d,p12_p8e"
-$ LIB_COMP = "comp_lib,comp_err,"+ -
- "c_rle,c_zlib"
-$ LIB_OCSP = "ocsp_asn,ocsp_ext,ocsp_ht,ocsp_lib,ocsp_cl,"+ -
- "ocsp_srv,ocsp_prn,ocsp_vfy,ocsp_err"
-$ LIB_UI_COMPAT = ",ui_compat"
-$ LIB_UI = "ui_err,ui_lib,ui_openssl,ui_util"+LIB_UI_COMPAT
-$ LIB_KRB5 = "krb5_asn"
-$ LIB_CMS = "cms_lib,cms_asn1,cms_att,cms_io,cms_smime,cms_err,"+ -
- "cms_sd,cms_dd,cms_cd,cms_env,cms_enc,cms_ess,"+ -
- "cms_pwri,cms_kari"
-$ LIB_PQUEUE = "pqueue"
-$ LIB_TS = "ts_err,ts_req_utils,ts_req_print,ts_rsp_utils,ts_rsp_print,"+ -
- "ts_rsp_sign,ts_rsp_verify,ts_verify_ctx,ts_lib,ts_conf,"+ -
- "ts_asn1"
-$ LIB_JPAKE = "jpake,jpake_err"
-$ LIB_SRP = "srp_lib,srp_vfy"
-$ LIB_STORE = "str_err,str_lib,str_meth,str_mem"
-$ LIB_CMAC = "cmac,cm_ameth,cm_pmeth"
-$!
-$! Setup exceptional compilations
-$!
-$ CC3_SHOWN = 0
-$ CC4_SHOWN = 0
-$ CC5_SHOWN = 0
-$ CC6_SHOWN = 0
-$!
-$! The following lists must have leading and trailing commas, and no
-$! embedded spaces. (They are scanned for ",name,".)
-$!
-$ ! Add definitions for no threads on OpenVMS 7.1 and higher.
-$ COMPILEWITH_CC3 = ",bss_rtcp,"
-$ ! Disable the DOLLARID warning. Not needed with /STANDARD=RELAXED.
-$ COMPILEWITH_CC4 = "" !!! ",a_utctm,bss_log,o_time,o_dir,"
-$ ! Disable disjoint optimization on VAX with DECC.
-$ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + -
- "seed,sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
-$ ! Disable the MIXLINKAGE warning.
-$ COMPILEWITH_CC6 = "" !!! ",enc_read,set_key,"
-$!
-$! Figure Out What Other Modules We Are To Build.
-$!
-$ BUILD_SET:
-$!
-$! Define A Module Counter.
-$!
-$ MODULE_COUNTER = 0
-$!
-$! Top Of The Loop.
-$!
-$ MODULE_NEXT:
-$!
-$! Extract The Module Name From The Encryption List.
-$!
-$ MODULE_NAME = F$EDIT(F$ELEMENT(MODULE_COUNTER,",",ENCRYPT_TYPES),"COLLAPSE")
-$ IF MODULE_NAME.EQS."Basic" THEN MODULE_NAME = ""
-$ MODULE_NAME1 = MODULE_NAME
-$!
-$! Check To See If We Are At The End Of The Module List.
-$!
-$ IF (MODULE_NAME.EQS.",")
-$ THEN
-$!
-$! We Are At The End Of The Module List, Go To MODULE_DONE.
-$!
-$ GOTO MODULE_DONE
-$!
-$! End The Module List Check.
-$!
-$ ENDIF
-$!
-$! Increment The Moudle Counter.
-$!
-$ MODULE_COUNTER = MODULE_COUNTER + 1
-$!
-$! Create The Library and Apps Module Names.
-$!
-$ LIB_MODULE = "LIB_" + MODULE_NAME
-$ APPS_MODULE = "APPS_" + MODULE_NAME
-$ IF (F$EXTRACT(0,5,MODULE_NAME).EQS."ASN1_")
-$ THEN
-$ MODULE_NAME = "ASN1"
-$ ENDIF
-$ IF (F$EXTRACT(0,4,MODULE_NAME).EQS."EVP_")
-$ THEN
-$ MODULE_NAME = "EVP"
-$ ENDIF
-$!
-$! Set state (can be LIB and APPS)
-$!
-$ STATE = "LIB"
-$ IF BUILDALL .EQS. "APPS" THEN STATE = "APPS"
-$!
-$! Check if the library module name actually is defined
-$!
-$ IF F$TYPE('LIB_MODULE') .EQS. ""
-$ THEN
-$ WRITE SYS$ERROR ""
-$ WRITE SYS$ERROR "The module ",MODULE_NAME1," does not exist. Continuing..."
-$ WRITE SYS$ERROR ""
-$ GOTO MODULE_NEXT
-$ ENDIF
-$!
-$! Top Of The Module Loop.
-$!
-$ MODULE_AGAIN:
-$!
-$! Tell The User What Module We Are Building.
-$!
-$ IF (MODULE_NAME1.NES."")
-$ THEN
-$ IF STATE .EQS. "LIB"
-$ THEN
-$ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Library Files. (",BUILDALL,",",STATE,")"
-$ ELSE IF F$TYPE('APPS_MODULE') .NES. ""
-$ THEN
-$ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Applications. (",BUILDALL,",",STATE,")"
-$ ENDIF
-$ ENDIF
-$ ENDIF
-$!
-$! Define A File Counter And Set It To "0".
-$!
-$ FILE_COUNTER = 0
-$ APPLICATION = ""
-$ APPLICATION_COUNTER = 0
-$!
-$! Top Of The File Loop.
-$!
-$ NEXT_FILE:
-$!
-$! Look in the LIB_MODULE is we're in state LIB
-$!
-$ IF STATE .EQS. "LIB"
-$ THEN
-$!
-$! O.K, Extract The File Name From The File List.
-$!
-$ FILE_NAME = F$EDIT(F$ELEMENT(FILE_COUNTER,",",'LIB_MODULE'),"COLLAPSE")
-$!
-$! else
-$!
-$ ELSE
-$ FILE_NAME = ","
-$!
-$ IF F$TYPE('APPS_MODULE') .NES. ""
-$ THEN
-$!
-$! Extract The File Name From The File List.
-$! This part is a bit more complicated.
-$!
-$ IF APPLICATION .EQS. ""
-$ THEN
-$ APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
-$ APPLICATION_COUNTER = APPLICATION_COUNTER + 1
-$ APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
-$ APPLICATION = F$ELEMENT(0,"/",APPLICATION)
-$ FILE_COUNTER = 0
-$ ENDIF
-$
-$! WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
-$! SHOW SYMBOL APPLICATION*
-$!
-$ IF APPLICATION .NES. ";"
-$ THEN
-$ FILE_NAME = F$EDIT(F$ELEMENT(FILE_COUNTER,",",APPLICATION_OBJECTS),"COLLAPSE")
-$ IF FILE_NAME .EQS. ","
-$ THEN
-$ APPLICATION = ""
-$ GOTO NEXT_FILE
-$ ENDIF
-$ ENDIF
-$ ENDIF
-$ ENDIF
-$!
-$! Check To See If We Are At The End Of The File List.
-$!
-$ IF (FILE_NAME.EQS.",")
-$ THEN
-$!
-$! We Are At The End Of The File List, Change State Or Goto FILE_DONE.
-$!
-$ IF STATE .EQS. "LIB" .AND. BUILDALL .NES. "LIBRARY"
-$ THEN
-$ STATE = "APPS"
-$ GOTO MODULE_AGAIN
-$ ELSE
-$ GOTO FILE_DONE
-$ ENDIF
-$!
-$! End The File List Check.
-$!
-$ ENDIF
-$!
-$! Increment The Counter.
-$!
-$ FILE_COUNTER = FILE_COUNTER + 1
-$!
-$! Create The Source File Name.
-$!
-$ TMP_FILE_NAME = F$ELEMENT(1,"]",FILE_NAME)
-$ IF TMP_FILE_NAME .EQS. "]" THEN TMP_FILE_NAME = FILE_NAME
-$ IF F$ELEMENT(0,".",TMP_FILE_NAME) .EQS. TMP_FILE_NAME THEN -
- FILE_NAME = FILE_NAME + ".c"
-$ IF (MODULE_NAME.NES."")
-$ THEN
-$ SOURCE_FILE = "SYS$DISK:[." + MODULE_NAME+ "]" + FILE_NAME
-$ ELSE
-$ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME
-$ ENDIF
-$ SOURCE_FILE = SOURCE_FILE - "]["
-$!
-$! Create The Object File Name.
-$!
-$ OBJECT_FILE = OBJ_DIR + F$PARSE(FILE_NAME,,,"NAME","SYNTAX_ONLY") + ".OBJ"
-$ ON WARNING THEN GOTO NEXT_FILE
-$!
-$! Check To See If The File We Want To Compile Is Actually There.
-$!
-$ IF (F$SEARCH(SOURCE_FILE).EQS."")
-$ THEN
-$!
-$! Tell The User That The File Doesn't Exist.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Doesn't Exist."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Exit The Build.
-$!
-$ GOTO EXIT
-$!
-$! End The File Exist Check.
-$!
-$ ENDIF
-$!
-$! Tell The User We Are Compiling The File.
-$!
-$ IF (MODULE_NAME.EQS."")
-$ THEN
-$ WRITE SYS$OUTPUT "Compiling The ",FILE_NAME," File. (",BUILDALL,",",STATE,")"
-$ ENDIF
-$ IF (MODULE_NAME.NES."")
-$ THEN
-$ WRITE SYS$OUTPUT " ",FILE_NAME,""
-$ ENDIF
-$!
-$! Compile The File.
-$!
-$ ON ERROR THEN GOTO NEXT_FILE
-$ FILE_NAME0 = ","+ F$ELEMENT(0,".",FILE_NAME)+ ","
-$ IF FILE_NAME - ".mar" .NES. FILE_NAME
-$ THEN
-$ MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
-$ ELSE
-$ IF COMPILEWITH_CC3 - FILE_NAME0 .NES. COMPILEWITH_CC3
-$ THEN
-$ write sys$output " \Using special rule (3)"
-$ if (.not. CC3_SHOWN)
-$ then
-$ CC3_SHOWN = 1
-$ x = " "+ CC3
-$ write /symbol sys$output x
-$ endif
-$ CC3/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
-$ ELSE
-$ IF COMPILEWITH_CC4 - FILE_NAME0 .NES. COMPILEWITH_CC4
-$ THEN
-$ write /symbol sys$output " \Using special rule (4)"
-$ if (.not. CC4_SHOWN)
-$ then
-$ CC4_SHOWN = 1
-$ x = " "+ CC4
-$ write /symbol sys$output x
-$ endif
-$ CC4/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
-$ ELSE
-$ IF CC5_DIFFERENT .AND. -
- (COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5)
-$ THEN
-$ write sys$output " \Using special rule (5)"
-$ if (.not. CC5_SHOWN)
-$ then
-$ CC5_SHOWN = 1
-$ x = " "+ CC5
-$ write /symbol sys$output x
-$ endif
-$ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
-$ ELSE
-$ IF COMPILEWITH_CC6 - FILE_NAME0 .NES. COMPILEWITH_CC6
-$ THEN
-$ write sys$output " \Using special rule (6)"
-$ if (.not. CC6_SHOWN)
-$ then
-$ CC6_SHOWN = 1
-$ x = " "+ CC6
-$ write /symbol sys$output x
-$ endif
-$ CC6/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
-$ ELSE
-$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
-$ ENDIF
-$ ENDIF
-$ ENDIF
-$ ENDIF
-$ ENDIF
-$ IF STATE .EQS. "LIB"
-$ THEN
-$!
-$! Add It To The Library.
-$!
-$ LIBRARY/REPLACE 'LIB_NAME' 'OBJECT_FILE'
-$!
-$! Time To Clean Up The Object File.
-$!
-$ DELETE 'OBJECT_FILE';*
-$ ENDIF
-$!
-$! Go Back And Do It Again.
-$!
-$ GOTO NEXT_FILE
-$!
-$! All Done With This Library Part.
-$!
-$ FILE_DONE:
-$!
-$! Time To Build Some Applications
-$!
-$ IF F$TYPE('APPS_MODULE') .NES. "" .AND. BUILDALL .NES. "LIBRARY"
-$ THEN
-$ APPLICATION_COUNTER = 0
-$ NEXT_APPLICATION:
-$ APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
-$ IF APPLICATION .EQS. ";" THEN GOTO APPLICATION_DONE
-$
-$ APPLICATION_COUNTER = APPLICATION_COUNTER + 1
-$ APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
-$ APPLICATION = F$ELEMENT(0,"/",APPLICATION)
-$
-$! WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
-$! SHOW SYMBOL APPLICATION*
-$!
-$! Tell the user what happens
-$!
-$ WRITE SYS$OUTPUT " ",APPLICATION,".exe"
-$!
-$! Link The Program.
-$!
-$ ON ERROR THEN GOTO NEXT_APPLICATION
-$!
-$! Link With A TCP/IP Library.
-$!
-$ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' -
- /EXE='EXE_DIR''APPLICATION'.EXE -
- 'OBJ_DIR''APPLICATION_OBJECTS', -
- 'CRYPTO_LIB'/LIBRARY -
- 'TCPIP_LIB' -
- 'ZLIB_LIB' -
- ,'OPT_FILE' /OPTIONS
-$!
-$ GOTO NEXT_APPLICATION
-$ APPLICATION_DONE:
-$ ENDIF
-$!
-$! Go Back And Get The Next Module.
-$!
-$ GOTO MODULE_NEXT
-$!
-$! All Done With This Module.
-$!
-$ MODULE_DONE:
-$!
-$! Tell The User That We Are All Done.
-$!
-$ WRITE SYS$OUTPUT "All Done..."
-$ EXIT:
-$ GOSUB CLEANUP
-$ EXIT
-$!
-$! Check For The Link Option FIle.
-$!
-$ CHECK_OPT_FILE:
-$!
-$! Check To See If We Need To Make A VAX C Option File.
-$!
-$ IF (COMPILER.EQS."VAXC")
-$ THEN
-$!
-$! Check To See If We Already Have A VAX C Linker Option File.
-$!
-$ IF (F$SEARCH(OPT_FILE).EQS."")
-$ THEN
-$!
-$! We Need A VAX C Linker Option File.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File To Link Against
-! The Sharable VAX C Runtime Library.
-!
-SYS$SHARE:VAXCRTL.EXE/SHARE
-$EOD
-$!
-$! End The Option File Check.
-$!
-$ ENDIF
-$!
-$! End The VAXC Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Need A GNU C Option File.
-$!
-$ IF (COMPILER.EQS."GNUC")
-$ THEN
-$!
-$! Check To See If We Already Have A GNU C Linker Option File.
-$!
-$ IF (F$SEARCH(OPT_FILE).EQS."")
-$ THEN
-$!
-$! We Need A GNU C Linker Option File.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File To Link Against
-! The Sharable C Runtime Library.
-!
-GNU_CC:[000000]GCCLIB/LIBRARY
-SYS$SHARE:VAXCRTL/SHARE
-$EOD
-$!
-$! End The Option File Check.
-$!
-$ ENDIF
-$!
-$! End The GNU C Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Need A DEC C Option File.
-$!
-$ IF (COMPILER.EQS."DECC")
-$ THEN
-$!
-$! Check To See If We Already Have A DEC C Linker Option File.
-$!
-$ IF (F$SEARCH(OPT_FILE).EQS."")
-$ THEN
-$!
-$! Figure Out If We Need A non-VAX Or A VAX Linker Option File.
-$!
-$ IF ARCH .EQS. "VAX"
-$ THEN
-$!
-$! We Need A DEC C Linker Option File For VAX.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File To Link Against
-! The Sharable DEC C Runtime Library.
-!
-SYS$SHARE:DECC$SHR.EXE/SHARE
-$EOD
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Create The non-VAX Linker Option File.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File For non-VAX To Link Against
-! The Sharable C Runtime Library.
-!
-SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
-SYS$SHARE:CMA$OPEN_RTL/SHARE
-$EOD
-$!
-$! End The DEC C Option File Check.
-$!
-$ ENDIF
-$!
-$! End The Option File Search.
-$!
-$ ENDIF
-$!
-$! End The DEC C Check.
-$!
-$ ENDIF
-$!
-$! Tell The User What Linker Option File We Are Using.
-$!
-$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
-$!
-$! Time To RETURN.
-$!
-$ RETURN
-$!
-$! Check The User's Options.
-$!
-$ CHECK_OPTIONS:
-$!
-$! Check To See If P1 Is Blank.
-$!
-$ IF (P1.EQS."ALL")
-$ THEN
-$!
-$! P1 Is Blank, So Build Everything.
-$!
-$ BUILDALL = "TRUE"
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Else, Check To See If P1 Has A Valid Argument.
-$!
-$ IF (P1.EQS."LIBRARY").OR.(P1.EQS."APPS")
-$ THEN
-$!
-$! A Valid Argument.
-$!
-$ BUILDALL = P1
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Tell The User We Don't Know What They Want.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " ALL : Just Build Everything."
-$ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library."
-$ WRITE SYS$OUTPUT " APPS : To Compile Just The [.xxx.EXE.CRYPTO]*.EXE Programs."
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " Where 'xxx' Stands For:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " ALPHA[64]: Alpha Architecture."
-$ WRITE SYS$OUTPUT " IA64[64] : IA64 Architecture."
-$ WRITE SYS$OUTPUT " VAX : VAX Architecture."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$! End The Valid Argument Check.
-$!
-$ ENDIF
-$!
-$! End The P1 Check.
-$!
-$ ENDIF
-$!
-$! Check To See If P2 Is Blank.
-$!
-$ IF (P2.EQS."NODEBUG")
-$ THEN
-$!
-$! P2 Is NODEBUG, So Compile Without The Debugger Information.
-$!
-$ DEBUGGER = "NODEBUG"
-$ LINKMAP = "NOMAP"
-$ TRACEBACK = "NOTRACEBACK"
-$ GCC_OPTIMIZE = "OPTIMIZE"
-$ CC_OPTIMIZE = "OPTIMIZE"
-$ MACRO_OPTIMIZE = "OPTIMIZE"
-$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
-$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
-$ ELSE
-$!
-$! Check To See If We Are To Compile With Debugger Information.
-$!
-$ IF (P2.EQS."DEBUG")
-$ THEN
-$!
-$! Compile With Debugger Information.
-$!
-$ DEBUGGER = "DEBUG"
-$ LINKMAP = "MAP"
-$ TRACEBACK = "TRACEBACK"
-$ GCC_OPTIMIZE = "NOOPTIMIZE"
-$ CC_OPTIMIZE = "NOOPTIMIZE"
-$ MACRO_OPTIMIZE = "NOOPTIMIZE"
-$ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
-$ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
-$ ELSE
-$!
-$! They Entered An Invalid Option.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
-$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$! End The Valid Argument Check.
-$!
-$ ENDIF
-$!
-$! End The P2 Check.
-$!
-$ ENDIF
-$!
-$! Special Threads For OpenVMS v7.1 Or Later
-$!
-$! Written By: Richard Levitte
-$! richard@levitte.org
-$!
-$!
-$! Check To See If We Have A Option For P5.
-$!
-$ IF (P5.EQS."")
-$ THEN
-$!
-$! Get The Version Of VMS We Are Using.
-$!
-$ ISSEVEN :=
-$ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
-$ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
-$!
-$! Check To See If The VMS Version Is v7.1 Or Later.
-$!
-$ IF (TMP.GE.71)
-$ THEN
-$!
-$! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
-$!
-$ ISSEVEN := ,PTHREAD_USE_D4
-$!
-$! End The VMS Version Check.
-$!
-$ ENDIF
-$!
-$! End The P5 Check.
-$!
-$ ENDIF
-$!
-$! Check P7 (POINTER_SIZE).
-$!
-$ IF (P7 .NES. "") .AND. (ARCH .NES. "VAX")
-$ THEN
-$!
-$ IF (P7 .EQS. "32")
-$ THEN
-$ POINTER_SIZE = " /POINTER_SIZE=32"
-$ ELSE
-$ POINTER_SIZE = F$EDIT( P7, "COLLAPSE, UPCASE")
-$ IF ((POINTER_SIZE .EQS. "64") .OR. -
- (POINTER_SIZE .EQS. "64=") .OR. -
- (POINTER_SIZE .EQS. "64=ARGV"))
-$ THEN
-$ ARCHD = ARCH+ "_64"
-$ LIB32 = ""
-$ POINTER_SIZE = " /POINTER_SIZE=64"
-$ ELSE
-$!
-$! Tell The User Entered An Invalid Option.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ", P7, -
- " Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT -
- " """" : Compile with default (short) pointers."
-$ WRITE SYS$OUTPUT -
- " 32 : Compile with 32-bit (short) pointers."
-$ WRITE SYS$OUTPUT -
- " 64 : Compile with 64-bit (long) pointers (auto ARGV)."
-$ WRITE SYS$OUTPUT -
- " 64= : Compile with 64-bit (long) pointers (no ARGV)."
-$ WRITE SYS$OUTPUT -
- " 64=ARGV : Compile with 64-bit (long) pointers (ARGV)."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$ ENDIF
-$!
-$ ENDIF
-$!
-$! End The P7 (POINTER_SIZE) Check.
-$!
-$ ENDIF
-$!
-$! Set basic C compiler /INCLUDE directories.
-$!
-$ CC_INCLUDES = "SYS$DISK:[.''ARCHD'],SYS$DISK:[],SYS$DISK:[-],"+ -
- "SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.MODES],SYS$DISK:[.ASN1],SYS$DISK:[.EVP]"
-$!
-$! Check To See If P3 Is Blank.
-$!
-$ IF (P3.EQS."")
-$ THEN
-$!
-$! O.K., The User Didn't Specify A Compiler, Let's Try To
-$! Find Out Which One To Use.
-$!
-$! Check To See If We Have GNU C.
-$!
-$ IF (F$TRNLNM("GNU_CC").NES."")
-$ THEN
-$!
-$! Looks Like GNUC, Set To Use GNUC.
-$!
-$ P3 = "GNUC"
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Check To See If We Have VAXC Or DECC.
-$!
-$ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
-$ THEN
-$!
-$! Looks Like DECC, Set To Use DECC.
-$!
-$ P3 = "DECC"
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Looks Like VAXC, Set To Use VAXC.
-$!
-$ P3 = "VAXC"
-$!
-$! End The VAXC Compiler Check.
-$!
-$ ENDIF
-$!
-$! End The DECC & VAXC Compiler Check.
-$!
-$ ENDIF
-$!
-$! End The Compiler Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Have A Option For P4.
-$!
-$ IF (P4.EQS."")
-$ THEN
-$!
-$! Find out what socket library we have available
-$!
-$ IF F$PARSE("SOCKETSHR:") .NES. ""
-$ THEN
-$!
-$! We have SOCKETSHR, and it is my opinion that it's the best to use.
-$!
-$ P4 = "SOCKETSHR"
-$!
-$! Tell the user
-$!
-$ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
-$!
-$! Else, let's look for something else
-$!
-$ ELSE
-$!
-$! Like UCX (the reason to do this before Multinet is that the UCX
-$! emulation is easier to use...)
-$!
-$ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
- .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
- .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
-$ THEN
-$!
-$! Last resort: a UCX or UCX-compatible library
-$!
-$ P4 = "UCX"
-$!
-$! Tell the user
-$!
-$ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
-$!
-$! That was all...
-$!
-$ ENDIF
-$ ENDIF
-$ ENDIF
-$!
-$! Set Up Initial CC Definitions, Possibly With User Ones
-$!
-$ CCDEFS = "TCPIP_TYPE_''P4',DSO_VMS"
-$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
-$ CCEXTRAFLAGS = ""
-$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
-$ CCDISABLEWARNINGS = "" !!! "MAYLOSEDATA3" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
-$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. ""
-$ THEN
-$ IF CCDISABLEWARNINGS .NES. THEN CCDISABLEWARNINGS = CCDISABLEWARNINGS + ","
-$ CCDISABLEWARNINGS = CCDISABLEWARNINGS + USER_CCDISABLEWARNINGS
-$ ENDIF
-$!
-$! Check To See If We Have A ZLIB Option.
-$!
-$ ZLIB = P8
-$ IF (ZLIB .NES. "")
-$ THEN
-$!
-$! Check for expected ZLIB files.
-$!
-$ err = 0
-$ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY")
-$ if (f$search( file1) .eqs. "")
-$ then
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
-$ WRITE SYS$OUTPUT " Can't find header: ''file1'"
-$ err = 1
-$ endif
-$ file1 = f$parse( "A.;", ZLIB)- "A.;"
-$!
-$ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY")
-$ if (f$search( file2) .eqs. "")
-$ then
-$ if (err .eq. 0)
-$ then
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
-$ endif
-$ WRITE SYS$OUTPUT " Can't find library: ''file2'"
-$ WRITE SYS$OUTPUT ""
-$ err = err+ 2
-$ endif
-$ if (err .eq. 1)
-$ then
-$ WRITE SYS$OUTPUT ""
-$ endif
-$!
-$ if (err .ne. 0)
-$ then
-$ EXIT
-$ endif
-$!
-$ CCDEFS = """ZLIB=1"", "+ CCDEFS
-$ CC_INCLUDES = CC_INCLUDES+ ", "+ file1
-$ ZLIB_LIB = ", ''file2' /library"
-$!
-$! Print info
-$!
-$ WRITE SYS$OUTPUT "ZLIB library spec: ", file2
-$!
-$! End The ZLIB Check.
-$!
-$ ENDIF
-$!
-$! Check To See If The User Entered A Valid Parameter.
-$!
-$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
-$ THEN
-$!
-$! Check To See If The User Wanted DECC.
-$!
-$ IF (P3.EQS."DECC")
-$ THEN
-$!
-$! Looks Like DECC, Set To Use DECC.
-$!
-$ COMPILER = "DECC"
-$!
-$! Tell The User We Are Using DECC.
-$!
-$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
-$!
-$! Use DECC...
-$!
-$ CC = "CC"
-$ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
- THEN CC = "CC/DECC"
-$ CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ -
- "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + -
- " /INCLUDE=(''CC_INCLUDES')"+ -
- CCEXTRAFLAGS
-$!
-$! Define The Linker Options File Name.
-$!
-$ OPT_FILE = "VAX_DECC_OPTIONS.OPT"
-$!
-$! End DECC Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Are To Use VAXC.
-$!
-$ IF (P3.EQS."VAXC")
-$ THEN
-$!
-$! Looks Like VAXC, Set To Use VAXC.
-$!
-$ COMPILER = "VAXC"
-$!
-$! Tell The User We Are Using VAX C.
-$!
-$ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
-$!
-$! Compile Using VAXC.
-$!
-$ CC = "CC"
-$ IF ARCH.NES."VAX"
-$ THEN
-$ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
-$ EXIT
-$ ENDIF
-$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
-$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
- "/INCLUDE=(''CC_INCLUDES')"+ -
- CCEXTRAFLAGS
-$ CCDEFS = """VAXC""," + CCDEFS
-$!
-$! Define <sys> As SYS$COMMON:[SYSLIB]
-$!
-$ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
-$!
-$! Define The Linker Options File Name.
-$!
-$ OPT_FILE = "VAX_VAXC_OPTIONS.OPT"
-$!
-$! End VAXC Check
-$!
-$ ENDIF
-$!
-$! Check To See If We Are To Use GNU C.
-$!
-$ IF (P3.EQS."GNUC")
-$ THEN
-$!
-$! Looks Like GNUC, Set To Use GNUC.
-$!
-$ COMPILER = "GNUC"
-$!
-$! Tell The User We Are Using GNUC.
-$!
-$ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
-$!
-$! Use GNU C...
-$!
-$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
- "/INCLUDE=(''CC_INCLUDES')"+ -
- CCEXTRAFLAGS
-$!
-$! Define The Linker Options File Name.
-$!
-$ OPT_FILE = "VAX_GNUC_OPTIONS.OPT"
-$!
-$! End The GNU C Check.
-$!
-$ ENDIF
-$!
-$! Set up default defines
-$!
-$ CCDEFS = """FLAT_INC=1""," + CCDEFS
-$!
-$! Finish up the definition of CC.
-$!
-$ IF COMPILER .EQS. "DECC"
-$ THEN
-$! Not all compiler versions support MAYLOSEDATA3.
-$ OPT_TEST = "MAYLOSEDATA3"
-$ DEFINE /USER_MODE SYS$ERROR NL:
-$ DEFINE /USER_MODE SYS$OUTPUT NL:
-$ 'CC' /NOCROSS_REFERENCE /NOLIST /NOOBJECT -
- /WARNINGS = DISABLE = ('OPT_TEST', EMPTYFILE) NL:
-$ IF ($SEVERITY)
-$ THEN
-$ IF CCDISABLEWARNINGS .NES. "" THEN -
- CCDISABLEWARNINGS = CCDISABLEWARNINGS+ ","
-$ CCDISABLEWARNINGS = CCDISABLEWARNINGS+ OPT_TEST
-$ ENDIF
-$ IF CCDISABLEWARNINGS .EQS. ""
-$ THEN
-$ CC4DISABLEWARNINGS = "DOLLARID"
-$ CC6DISABLEWARNINGS = "MIXLINKAGE"
-$ ELSE
-$ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
-$ CC6DISABLEWARNINGS = CCDISABLEWARNINGS + ",MIXLINKAGE"
-$ CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
-$ ENDIF
-$ CC4DISABLEWARNINGS = " /WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
-$ CC6DISABLEWARNINGS = " /WARNING=(DISABLE=(" + CC6DISABLEWARNINGS + "))"
-$ ELSE
-$ CCDISABLEWARNINGS = ""
-$ CC4DISABLEWARNINGS = ""
-$ CC6DISABLEWARNINGS = ""
-$ ENDIF
-$ CC3 = CC + " /DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS
-$ CC = CC + " /DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
-$ IF ARCH .EQS. "VAX" .AND. COMPILER .EQS. "DECC" .AND. P2 .NES. "DEBUG"
-$ THEN
-$ CC5 = CC + " /OPTIMIZE=NODISJOINT"
-$ CC5_DIFFERENT = 1
-$ ELSE
-$ CC5 = CC
-$ CC5_DIFFERENT = 0
-$ ENDIF
-$ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
-$ CC6 = CC - CCDISABLEWARNINGS + CC6DISABLEWARNINGS
-$!
-$! Show user the result
-$!
-$ WRITE/SYMBOL SYS$OUTPUT "Main C Compiling Command: ",CC
-$!
-$! Else The User Entered An Invalid Argument.
-$!
-$ ELSE
-$!
-$! Tell The User We Don't Know What They Want.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
-$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
-$ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$! End The Valid Argument Check.
-$!
-$ ENDIF
-$!
-$! Build a MACRO command for the architecture at hand
-$!
-$ IF ARCH .EQS. "VAX" THEN MACRO = "MACRO/''DEBUGGER'"
-$ IF ARCH .NES. "VAX" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'"
-$!
-$! Show user the result
-$!
-$ WRITE/SYMBOL SYS$OUTPUT "Main MACRO Compiling Command: ",MACRO
-$!
-$! Time to check the contents, and to make sure we get the correct library.
-$!
-$ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" -
- .OR. P4.EQS."TCPIP" .OR. P4.EQS."NONE"
-$ THEN
-$!
-$! Check to see if SOCKETSHR was chosen
-$!
-$ IF P4.EQS."SOCKETSHR"
-$ THEN
-$!
-$! Set the library to use SOCKETSHR
-$!
-$ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS"
-$!
-$! Done with SOCKETSHR
-$!
-$ ENDIF
-$!
-$! Check to see if MULTINET was chosen
-$!
-$ IF P4.EQS."MULTINET"
-$ THEN
-$!
-$! Set the library to use UCX emulation.
-$!
-$ P4 = "UCX"
-$!
-$! Done with MULTINET
-$!
-$ ENDIF
-$!
-$! Check to see if UCX was chosen
-$!
-$ IF P4.EQS."UCX"
-$ THEN
-$!
-$! Set the library to use UCX.
-$!
-$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS"
-$ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
-$ THEN
-$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS"
-$ ELSE
-$ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
- TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS"
-$ ENDIF
-$!
-$! Done with UCX
-$!
-$ ENDIF
-$!
-$! Check to see if TCPIP was chosen
-$!
-$ IF P4.EQS."TCPIP"
-$ THEN
-$!
-$! Set the library to use TCPIP (post UCX).
-$!
-$ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS"
-$!
-$! Done with TCPIP
-$!
-$ ENDIF
-$!
-$! Check to see if NONE was chosen
-$!
-$ IF P4.EQS."NONE"
-$ THEN
-$!
-$! Do not use a TCPIP library.
-$!
-$ TCPIP_LIB = ""
-$!
-$! Done with TCPIP
-$!
-$ ENDIF
-$!
-$! Print info
-$!
-$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- ","
-$!
-$! Else The User Entered An Invalid Argument.
-$!
-$ ELSE
-$!
-$! Tell The User We Don't Know What They Want.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
-$ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
-$ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$! Done with TCP/IP libraries
-$!
-$ ENDIF
-$!
-$! Check if the user wanted to compile just a subset of all the encryption
-$! methods.
-$!
-$ IF P6 .NES. ""
-$ THEN
-$ ENCRYPT_TYPES = P6
-$ ENDIF
-$!
-$! Time To RETURN...
-$!
-$ RETURN
-$!
-$ INITIALISE:
-$!
-$! Save old value of the logical name OPENSSL
-$!
-$ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
-$!
-$! Save directory information
-$!
-$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
-$ __HERE = F$EDIT(__HERE,"UPCASE")
-$ __TOP = __HERE - "CRYPTO]"
-$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
-$!
-$! Set up the logical name OPENSSL to point at the include directory
-$!
-$ DEFINE OPENSSL/NOLOG '__INCLUDE'
-$!
-$! Done
-$!
-$ RETURN
-$!
-$ CLEANUP:
-$!
-$! Restore the logical name OPENSSL if it had a value
-$!
-$ IF __SAVE_OPENSSL .EQS. ""
-$ THEN
-$ DEASSIGN OPENSSL
-$ ELSE
-$ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL'
-$ ENDIF
-$!
-$! Done
-$!
-$ RETURN
diff --git a/thirdparty/openssl/crypto/des/asm/des_enc.m4 b/thirdparty/openssl/crypto/des/asm/des_enc.m4
deleted file mode 100644
index dda08e126d..0000000000
--- a/thirdparty/openssl/crypto/des/asm/des_enc.m4
+++ /dev/null
@@ -1,2101 +0,0 @@
-! des_enc.m4
-! des_enc.S (generated from des_enc.m4)
-!
-! UltraSPARC assembler version of the LibDES/SSLeay/OpenSSL des_enc.c file.
-!
-! Version 1.0. 32-bit version.
-!
-! June 8, 2000.
-!
-! Version 2.0. 32/64-bit, PIC-ification, blended CPU adaptation
-! by Andy Polyakov.
-!
-! January 1, 2003.
-!
-! Assembler version: Copyright Svend Olaf Mikkelsen.
-!
-! Original C code: Copyright Eric A. Young.
-!
-! This code can be freely used by LibDES/SSLeay/OpenSSL users.
-!
-! The LibDES/SSLeay/OpenSSL copyright notices must be respected.
-!
-! This version can be redistributed.
-!
-! To expand the m4 macros: m4 -B 8192 des_enc.m4 > des_enc.S
-!
-! Global registers 1 to 5 are used. This is the same as done by the
-! cc compiler. The UltraSPARC load/store little endian feature is used.
-!
-! Instruction grouping often refers to one CPU cycle.
-!
-! Assemble through gcc: gcc -c -mcpu=ultrasparc -o des_enc.o des_enc.S
-!
-! Assemble through cc: cc -c -xarch=v8plusa -o des_enc.o des_enc.S
-!
-! Performance improvement according to './apps/openssl speed des'
-!
-! 32-bit build:
-! 23% faster than cc-5.2 -xarch=v8plus -xO5
-! 115% faster than gcc-3.2.1 -m32 -mcpu=ultrasparc -O5
-! 64-bit build:
-! 50% faster than cc-5.2 -xarch=v9 -xO5
-! 100% faster than gcc-3.2.1 -m64 -mcpu=ultrasparc -O5
-!
-
-.ident "des_enc.m4 2.1"
-.file "des_enc-sparc.S"
-
-#include <openssl/opensslconf.h>
-
-#if defined(__SUNPRO_C) && defined(__sparcv9)
-# define ABI64 /* They've said -xarch=v9 at command line */
-#elif defined(__GNUC__) && defined(__arch64__)
-# define ABI64 /* They've said -m64 at command line */
-#endif
-
-#ifdef ABI64
- .register %g2,#scratch
- .register %g3,#scratch
-# define FRAME -192
-# define BIAS 2047
-# define LDPTR ldx
-# define STPTR stx
-# define ARG0 128
-# define ARGSZ 8
-# ifndef OPENSSL_SYSNAME_ULTRASPARC
-# define OPENSSL_SYSNAME_ULTRASPARC
-# endif
-#else
-# define FRAME -96
-# define BIAS 0
-# define LDPTR ld
-# define STPTR st
-# define ARG0 68
-# define ARGSZ 4
-#endif
-
-#define LOOPS 7
-
-#define global0 %g0
-#define global1 %g1
-#define global2 %g2
-#define global3 %g3
-#define global4 %g4
-#define global5 %g5
-
-#define local0 %l0
-#define local1 %l1
-#define local2 %l2
-#define local3 %l3
-#define local4 %l4
-#define local5 %l5
-#define local7 %l6
-#define local6 %l7
-
-#define in0 %i0
-#define in1 %i1
-#define in2 %i2
-#define in3 %i3
-#define in4 %i4
-#define in5 %i5
-#define in6 %i6
-#define in7 %i7
-
-#define out0 %o0
-#define out1 %o1
-#define out2 %o2
-#define out3 %o3
-#define out4 %o4
-#define out5 %o5
-#define out6 %o6
-#define out7 %o7
-
-#define stub stb
-
-changequote({,})
-
-
-! Macro definitions:
-
-
-! {ip_macro}
-!
-! The logic used in initial and final permutations is the same as in
-! the C code. The permutations are done with a clever shift, xor, and
-! technique.
-!
-! The macro also loads address sbox 1 to 5 to global 1 to 5, address
-! sbox 6 to local6, and addres sbox 8 to out3.
-!
-! Rotates the halfs 3 left to bring the sbox bits in convenient positions.
-!
-! Loads key first round from address in parameter 5 to out0, out1.
-!
-! After the the original LibDES initial permutation, the resulting left
-! is in the variable initially used for right and vice versa. The macro
-! implements the possibility to keep the halfs in the original registers.
-!
-! parameter 1 left
-! parameter 2 right
-! parameter 3 result left (modify in first round)
-! parameter 4 result right (use in first round)
-! parameter 5 key address
-! parameter 6 1/2 for include encryption/decryption
-! parameter 7 1 for move in1 to in3
-! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
-! parameter 9 1 for load ks3 and ks2 to in4 and in3
-
-define(ip_macro, {
-
-! {ip_macro}
-! $1 $2 $4 $3 $5 $6 $7 $8 $9
-
- ld [out2+256], local1
- srl $2, 4, local4
-
- xor local4, $1, local4
- ifelse($7,1,{mov in1, in3},{nop})
-
- ld [out2+260], local2
- and local4, local1, local4
- ifelse($8,1,{mov in3, in4},{})
- ifelse($8,2,{mov in4, in3},{})
-
- ld [out2+280], out4 ! loop counter
- sll local4, 4, local1
- xor $1, local4, $1
-
- ld [out2+264], local3
- srl $1, 16, local4
- xor $2, local1, $2
-
- ifelse($9,1,{LDPTR KS3, in4},{})
- xor local4, $2, local4
- nop !sethi %hi(DES_SPtrans), global1 ! sbox addr
-
- ifelse($9,1,{LDPTR KS2, in3},{})
- and local4, local2, local4
- nop !or global1, %lo(DES_SPtrans), global1 ! sbox addr
-
- sll local4, 16, local1
- xor $2, local4, $2
-
- srl $2, 2, local4
- xor $1, local1, $1
-
- sethi %hi(16711680), local5
- xor local4, $1, local4
-
- and local4, local3, local4
- or local5, 255, local5
-
- sll local4, 2, local2
- xor $1, local4, $1
-
- srl $1, 8, local4
- xor $2, local2, $2
-
- xor local4, $2, local4
- add global1, 768, global4
-
- and local4, local5, local4
- add global1, 1024, global5
-
- ld [out2+272], local7
- sll local4, 8, local1
- xor $2, local4, $2
-
- srl $2, 1, local4
- xor $1, local1, $1
-
- ld [$5], out0 ! key 7531
- xor local4, $1, local4
- add global1, 256, global2
-
- ld [$5+4], out1 ! key 8642
- and local4, local7, local4
- add global1, 512, global3
-
- sll local4, 1, local1
- xor $1, local4, $1
-
- sll $1, 3, local3
- xor $2, local1, $2
-
- sll $2, 3, local2
- add global1, 1280, local6 ! address sbox 8
-
- srl $1, 29, local4
- add global1, 1792, out3 ! address sbox 8
-
- srl $2, 29, local1
- or local4, local3, $4
-
- or local2, local1, $3
-
- ifelse($6, 1, {
-
- ld [out2+284], local5 ! 0x0000FC00 used in the rounds
- or local2, local1, $3
- xor $4, out0, local1
-
- call .des_enc.1
- and local1, 252, local1
-
- },{})
-
- ifelse($6, 2, {
-
- ld [out2+284], local5 ! 0x0000FC00 used in the rounds
- or local2, local1, $3
- xor $4, out0, local1
-
- call .des_dec.1
- and local1, 252, local1
-
- },{})
-})
-
-
-! {rounds_macro}
-!
-! The logic used in the DES rounds is the same as in the C code,
-! except that calculations for sbox 1 and sbox 5 begin before
-! the previous round is finished.
-!
-! In each round one half (work) is modified based on key and the
-! other half (use).
-!
-! In this version we do two rounds in a loop repeated 7 times
-! and two rounds seperately.
-!
-! One half has the bits for the sboxes in the following positions:
-!
-! 777777xx555555xx333333xx111111xx
-!
-! 88xx666666xx444444xx222222xx8888
-!
-! The bits for each sbox are xor-ed with the key bits for that box.
-! The above xx bits are cleared, and the result used for lookup in
-! the sbox table. Each sbox entry contains the 4 output bits permuted
-! into 32 bits according to the P permutation.
-!
-! In the description of DES, left and right are switched after
-! each round, except after last round. In this code the original
-! left and right are kept in the same register in all rounds, meaning
-! that after the 16 rounds the result for right is in the register
-! originally used for left.
-!
-! parameter 1 first work (left in first round)
-! parameter 2 first use (right in first round)
-! parameter 3 enc/dec 1/-1
-! parameter 4 loop label
-! parameter 5 key address register
-! parameter 6 optional address for key next encryption/decryption
-! parameter 7 not empty for include retl
-!
-! also compares in2 to 8
-
-define(rounds_macro, {
-
-! {rounds_macro}
-! $1 $2 $3 $4 $5 $6 $7 $8 $9
-
- xor $2, out0, local1
-
- ld [out2+284], local5 ! 0x0000FC00
- ba $4
- and local1, 252, local1
-
- .align 32
-
-$4:
- ! local6 is address sbox 6
- ! out3 is address sbox 8
- ! out4 is loop counter
-
- ld [global1+local1], local1
- xor $2, out1, out1 ! 8642
- xor $2, out0, out0 ! 7531
- ! fmovs %f0, %f0 ! fxor used for alignment
-
- srl out1, 4, local0 ! rotate 4 right
- and out0, local5, local3 ! 3
- ! fmovs %f0, %f0
-
- ld [$5+$3*8], local7 ! key 7531 next round
- srl local3, 8, local3 ! 3
- and local0, 252, local2 ! 2
- ! fmovs %f0, %f0
-
- ld [global3+local3],local3 ! 3
- sll out1, 28, out1 ! rotate
- xor $1, local1, $1 ! 1 finished, local1 now sbox 7
-
- ld [global2+local2], local2 ! 2
- srl out0, 24, local1 ! 7
- or out1, local0, out1 ! rotate
-
- ldub [out2+local1], local1 ! 7 (and 0xFC)
- srl out1, 24, local0 ! 8
- and out1, local5, local4 ! 4
-
- ldub [out2+local0], local0 ! 8 (and 0xFC)
- srl local4, 8, local4 ! 4
- xor $1, local2, $1 ! 2 finished local2 now sbox 6
-
- ld [global4+local4],local4 ! 4
- srl out1, 16, local2 ! 6
- xor $1, local3, $1 ! 3 finished local3 now sbox 5
-
- ld [out3+local0],local0 ! 8
- and local2, 252, local2 ! 6
- add global1, 1536, local5 ! address sbox 7
-
- ld [local6+local2], local2 ! 6
- srl out0, 16, local3 ! 5
- xor $1, local4, $1 ! 4 finished
-
- ld [local5+local1],local1 ! 7
- and local3, 252, local3 ! 5
- xor $1, local0, $1 ! 8 finished
-
- ld [global5+local3],local3 ! 5
- xor $1, local2, $1 ! 6 finished
- subcc out4, 1, out4
-
- ld [$5+$3*8+4], out0 ! key 8642 next round
- xor $1, local7, local2 ! sbox 5 next round
- xor $1, local1, $1 ! 7 finished
-
- srl local2, 16, local2 ! sbox 5 next round
- xor $1, local3, $1 ! 5 finished
-
- ld [$5+$3*16+4], out1 ! key 8642 next round again
- and local2, 252, local2 ! sbox5 next round
-! next round
- xor $1, local7, local7 ! 7531
-
- ld [global5+local2], local2 ! 5
- srl local7, 24, local3 ! 7
- xor $1, out0, out0 ! 8642
-
- ldub [out2+local3], local3 ! 7 (and 0xFC)
- srl out0, 4, local0 ! rotate 4 right
- and local7, 252, local1 ! 1
-
- sll out0, 28, out0 ! rotate
- xor $2, local2, $2 ! 5 finished local2 used
-
- srl local0, 8, local4 ! 4
- and local0, 252, local2 ! 2
- ld [local5+local3], local3 ! 7
-
- srl local0, 16, local5 ! 6
- or out0, local0, out0 ! rotate
- ld [global2+local2], local2 ! 2
-
- srl out0, 24, local0
- ld [$5+$3*16], out0 ! key 7531 next round
- and local4, 252, local4 ! 4
-
- and local5, 252, local5 ! 6
- ld [global4+local4], local4 ! 4
- xor $2, local3, $2 ! 7 finished local3 used
-
- and local0, 252, local0 ! 8
- ld [local6+local5], local5 ! 6
- xor $2, local2, $2 ! 2 finished local2 now sbox 3
-
- srl local7, 8, local2 ! 3 start
- ld [out3+local0], local0 ! 8
- xor $2, local4, $2 ! 4 finished
-
- and local2, 252, local2 ! 3
- ld [global1+local1], local1 ! 1
- xor $2, local5, $2 ! 6 finished local5 used
-
- ld [global3+local2], local2 ! 3
- xor $2, local0, $2 ! 8 finished
- add $5, $3*16, $5 ! enc add 8, dec add -8 to key pointer
-
- ld [out2+284], local5 ! 0x0000FC00
- xor $2, out0, local4 ! sbox 1 next round
- xor $2, local1, $2 ! 1 finished
-
- xor $2, local2, $2 ! 3 finished
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- bne,pt %icc, $4
-#else
- bne $4
-#endif
- and local4, 252, local1 ! sbox 1 next round
-
-! two rounds more:
-
- ld [global1+local1], local1
- xor $2, out1, out1
- xor $2, out0, out0
-
- srl out1, 4, local0 ! rotate
- and out0, local5, local3
-
- ld [$5+$3*8], local7 ! key 7531
- srl local3, 8, local3
- and local0, 252, local2
-
- ld [global3+local3],local3
- sll out1, 28, out1 ! rotate
- xor $1, local1, $1 ! 1 finished, local1 now sbox 7
-
- ld [global2+local2], local2
- srl out0, 24, local1
- or out1, local0, out1 ! rotate
-
- ldub [out2+local1], local1
- srl out1, 24, local0
- and out1, local5, local4
-
- ldub [out2+local0], local0
- srl local4, 8, local4
- xor $1, local2, $1 ! 2 finished local2 now sbox 6
-
- ld [global4+local4],local4
- srl out1, 16, local2
- xor $1, local3, $1 ! 3 finished local3 now sbox 5
-
- ld [out3+local0],local0
- and local2, 252, local2
- add global1, 1536, local5 ! address sbox 7
-
- ld [local6+local2], local2
- srl out0, 16, local3
- xor $1, local4, $1 ! 4 finished
-
- ld [local5+local1],local1
- and local3, 252, local3
- xor $1, local0, $1
-
- ld [global5+local3],local3
- xor $1, local2, $1 ! 6 finished
- cmp in2, 8
-
- ifelse($6,{}, {}, {ld [out2+280], out4}) ! loop counter
- xor $1, local7, local2 ! sbox 5 next round
- xor $1, local1, $1 ! 7 finished
-
- ld [$5+$3*8+4], out0
- srl local2, 16, local2 ! sbox 5 next round
- xor $1, local3, $1 ! 5 finished
-
- and local2, 252, local2
-! next round (two rounds more)
- xor $1, local7, local7 ! 7531
-
- ld [global5+local2], local2
- srl local7, 24, local3
- xor $1, out0, out0 ! 8642
-
- ldub [out2+local3], local3
- srl out0, 4, local0 ! rotate
- and local7, 252, local1
-
- sll out0, 28, out0 ! rotate
- xor $2, local2, $2 ! 5 finished local2 used
-
- srl local0, 8, local4
- and local0, 252, local2
- ld [local5+local3], local3
-
- srl local0, 16, local5
- or out0, local0, out0 ! rotate
- ld [global2+local2], local2
-
- srl out0, 24, local0
- ifelse($6,{}, {}, {ld [$6], out0}) ! key next encryption/decryption
- and local4, 252, local4
-
- and local5, 252, local5
- ld [global4+local4], local4
- xor $2, local3, $2 ! 7 finished local3 used
-
- and local0, 252, local0
- ld [local6+local5], local5
- xor $2, local2, $2 ! 2 finished local2 now sbox 3
-
- srl local7, 8, local2 ! 3 start
- ld [out3+local0], local0
- xor $2, local4, $2
-
- and local2, 252, local2
- ld [global1+local1], local1
- xor $2, local5, $2 ! 6 finished local5 used
-
- ld [global3+local2], local2
- srl $1, 3, local3
- xor $2, local0, $2
-
- ifelse($6,{}, {}, {ld [$6+4], out1}) ! key next encryption/decryption
- sll $1, 29, local4
- xor $2, local1, $2
-
- ifelse($7,{}, {}, {retl})
- xor $2, local2, $2
-})
-
-
-! {fp_macro}
-!
-! parameter 1 right (original left)
-! parameter 2 left (original right)
-! parameter 3 1 for optional store to [in0]
-! parameter 4 1 for load input/output address to local5/7
-!
-! The final permutation logic switches the halfes, meaning that
-! left and right ends up the the registers originally used.
-
-define(fp_macro, {
-
-! {fp_macro}
-! $1 $2 $3 $4 $5 $6 $7 $8 $9
-
- ! initially undo the rotate 3 left done after initial permutation
- ! original left is received shifted 3 right and 29 left in local3/4
-
- sll $2, 29, local1
- or local3, local4, $1
-
- srl $2, 3, $2
- sethi %hi(0x55555555), local2
-
- or $2, local1, $2
- or local2, %lo(0x55555555), local2
-
- srl $2, 1, local3
- sethi %hi(0x00ff00ff), local1
- xor local3, $1, local3
- or local1, %lo(0x00ff00ff), local1
- and local3, local2, local3
- sethi %hi(0x33333333), local4
- sll local3, 1, local2
-
- xor $1, local3, $1
-
- srl $1, 8, local3
- xor $2, local2, $2
- xor local3, $2, local3
- or local4, %lo(0x33333333), local4
- and local3, local1, local3
- sethi %hi(0x0000ffff), local1
- sll local3, 8, local2
-
- xor $2, local3, $2
-
- srl $2, 2, local3
- xor $1, local2, $1
- xor local3, $1, local3
- or local1, %lo(0x0000ffff), local1
- and local3, local4, local3
- sethi %hi(0x0f0f0f0f), local4
- sll local3, 2, local2
-
- ifelse($4,1, {LDPTR INPUT, local5})
- xor $1, local3, $1
-
- ifelse($4,1, {LDPTR OUTPUT, local7})
- srl $1, 16, local3
- xor $2, local2, $2
- xor local3, $2, local3
- or local4, %lo(0x0f0f0f0f), local4
- and local3, local1, local3
- sll local3, 16, local2
-
- xor $2, local3, local1
-
- srl local1, 4, local3
- xor $1, local2, $1
- xor local3, $1, local3
- and local3, local4, local3
- sll local3, 4, local2
-
- xor $1, local3, $1
-
- ! optional store:
-
- ifelse($3,1, {st $1, [in0]})
-
- xor local1, local2, $2
-
- ifelse($3,1, {st $2, [in0+4]})
-
-})
-
-
-! {fp_ip_macro}
-!
-! Does initial permutation for next block mixed with
-! final permutation for current block.
-!
-! parameter 1 original left
-! parameter 2 original right
-! parameter 3 left ip
-! parameter 4 right ip
-! parameter 5 1: load ks1/ks2 to in3/in4, add 120 to in4
-! 2: mov in4 to in3
-!
-! also adds -8 to length in2 and loads loop counter to out4
-
-define(fp_ip_macro, {
-
-! {fp_ip_macro}
-! $1 $2 $3 $4 $5 $6 $7 $8 $9
-
- define({temp1},{out4})
- define({temp2},{local3})
-
- define({ip1},{local1})
- define({ip2},{local2})
- define({ip4},{local4})
- define({ip5},{local5})
-
- ! $1 in local3, local4
-
- ld [out2+256], ip1
- sll out5, 29, temp1
- or local3, local4, $1
-
- srl out5, 3, $2
- ifelse($5,2,{mov in4, in3})
-
- ld [out2+272], ip5
- srl $4, 4, local0
- or $2, temp1, $2
-
- srl $2, 1, temp1
- xor temp1, $1, temp1
-
- and temp1, ip5, temp1
- xor local0, $3, local0
-
- sll temp1, 1, temp2
- xor $1, temp1, $1
-
- and local0, ip1, local0
- add in2, -8, in2
-
- sll local0, 4, local7
- xor $3, local0, $3
-
- ld [out2+268], ip4
- srl $1, 8, temp1
- xor $2, temp2, $2
- ld [out2+260], ip2
- srl $3, 16, local0
- xor $4, local7, $4
- xor temp1, $2, temp1
- xor local0, $4, local0
- and temp1, ip4, temp1
- and local0, ip2, local0
- sll temp1, 8, temp2
- xor $2, temp1, $2
- sll local0, 16, local7
- xor $4, local0, $4
-
- srl $2, 2, temp1
- xor $1, temp2, $1
-
- ld [out2+264], temp2 ! ip3
- srl $4, 2, local0
- xor $3, local7, $3
- xor temp1, $1, temp1
- xor local0, $3, local0
- and temp1, temp2, temp1
- and local0, temp2, local0
- sll temp1, 2, temp2
- xor $1, temp1, $1
- sll local0, 2, local7
- xor $3, local0, $3
-
- srl $1, 16, temp1
- xor $2, temp2, $2
- srl $3, 8, local0
- xor $4, local7, $4
- xor temp1, $2, temp1
- xor local0, $4, local0
- and temp1, ip2, temp1
- and local0, ip4, local0
- sll temp1, 16, temp2
- xor $2, temp1, local4
- sll local0, 8, local7
- xor $4, local0, $4
-
- srl $4, 1, local0
- xor $3, local7, $3
-
- srl local4, 4, temp1
- xor local0, $3, local0
-
- xor $1, temp2, $1
- and local0, ip5, local0
-
- sll local0, 1, local7
- xor temp1, $1, temp1
-
- xor $3, local0, $3
- xor $4, local7, $4
-
- sll $3, 3, local5
- and temp1, ip1, temp1
-
- sll temp1, 4, temp2
- xor $1, temp1, $1
-
- ifelse($5,1,{LDPTR KS2, in4})
- sll $4, 3, local2
- xor local4, temp2, $2
-
- ! reload since used as temporar:
-
- ld [out2+280], out4 ! loop counter
-
- srl $3, 29, local0
- ifelse($5,1,{add in4, 120, in4})
-
- ifelse($5,1,{LDPTR KS1, in3})
- srl $4, 29, local7
-
- or local0, local5, $4
- or local2, local7, $3
-
-})
-
-
-
-! {load_little_endian}
-!
-! parameter 1 address
-! parameter 2 destination left
-! parameter 3 destination right
-! parameter 4 temporar
-! parameter 5 label
-
-define(load_little_endian, {
-
-! {load_little_endian}
-! $1 $2 $3 $4 $5 $6 $7 $8 $9
-
- ! first in memory to rightmost in register
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- andcc $1, 3, global0
- bne,pn %icc, $5
- nop
-
- lda [$1] 0x88, $2
- add $1, 4, $4
-
- ba,pt %icc, $5a
- lda [$4] 0x88, $3
-#endif
-
-$5:
- ldub [$1+3], $2
-
- ldub [$1+2], $4
- sll $2, 8, $2
- or $2, $4, $2
-
- ldub [$1+1], $4
- sll $2, 8, $2
- or $2, $4, $2
-
- ldub [$1+0], $4
- sll $2, 8, $2
- or $2, $4, $2
-
-
- ldub [$1+3+4], $3
-
- ldub [$1+2+4], $4
- sll $3, 8, $3
- or $3, $4, $3
-
- ldub [$1+1+4], $4
- sll $3, 8, $3
- or $3, $4, $3
-
- ldub [$1+0+4], $4
- sll $3, 8, $3
- or $3, $4, $3
-$5a:
-
-})
-
-
-! {load_little_endian_inc}
-!
-! parameter 1 address
-! parameter 2 destination left
-! parameter 3 destination right
-! parameter 4 temporar
-! parameter 4 label
-!
-! adds 8 to address
-
-define(load_little_endian_inc, {
-
-! {load_little_endian_inc}
-! $1 $2 $3 $4 $5 $6 $7 $8 $9
-
- ! first in memory to rightmost in register
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- andcc $1, 3, global0
- bne,pn %icc, $5
- nop
-
- lda [$1] 0x88, $2
- add $1, 4, $1
-
- lda [$1] 0x88, $3
- ba,pt %icc, $5a
- add $1, 4, $1
-#endif
-
-$5:
- ldub [$1+3], $2
-
- ldub [$1+2], $4
- sll $2, 8, $2
- or $2, $4, $2
-
- ldub [$1+1], $4
- sll $2, 8, $2
- or $2, $4, $2
-
- ldub [$1+0], $4
- sll $2, 8, $2
- or $2, $4, $2
-
- ldub [$1+3+4], $3
- add $1, 8, $1
-
- ldub [$1+2+4-8], $4
- sll $3, 8, $3
- or $3, $4, $3
-
- ldub [$1+1+4-8], $4
- sll $3, 8, $3
- or $3, $4, $3
-
- ldub [$1+0+4-8], $4
- sll $3, 8, $3
- or $3, $4, $3
-$5a:
-
-})
-
-
-! {load_n_bytes}
-!
-! Loads 1 to 7 bytes little endian
-! Remaining bytes are zeroed.
-!
-! parameter 1 address
-! parameter 2 length
-! parameter 3 destination register left
-! parameter 4 destination register right
-! parameter 5 temp
-! parameter 6 temp2
-! parameter 7 label
-! parameter 8 return label
-
-define(load_n_bytes, {
-
-! {load_n_bytes}
-! $1 $2 $5 $6 $7 $8 $7 $8 $9
-
-$7.0: call .+8
- sll $2, 2, $6
-
- add %o7,$7.jmp.table-$7.0,$5
-
- add $5, $6, $5
- mov 0, $4
-
- ld [$5], $5
-
- jmp %o7+$5
- mov 0, $3
-
-$7.7:
- ldub [$1+6], $5
- sll $5, 16, $5
- or $3, $5, $3
-$7.6:
- ldub [$1+5], $5
- sll $5, 8, $5
- or $3, $5, $3
-$7.5:
- ldub [$1+4], $5
- or $3, $5, $3
-$7.4:
- ldub [$1+3], $5
- sll $5, 24, $5
- or $4, $5, $4
-$7.3:
- ldub [$1+2], $5
- sll $5, 16, $5
- or $4, $5, $4
-$7.2:
- ldub [$1+1], $5
- sll $5, 8, $5
- or $4, $5, $4
-$7.1:
- ldub [$1+0], $5
- ba $8
- or $4, $5, $4
-
- .align 4
-
-$7.jmp.table:
- .word 0
- .word $7.1-$7.0
- .word $7.2-$7.0
- .word $7.3-$7.0
- .word $7.4-$7.0
- .word $7.5-$7.0
- .word $7.6-$7.0
- .word $7.7-$7.0
-})
-
-
-! {store_little_endian}
-!
-! parameter 1 address
-! parameter 2 source left
-! parameter 3 source right
-! parameter 4 temporar
-
-define(store_little_endian, {
-
-! {store_little_endian}
-! $1 $2 $3 $4 $5 $6 $7 $8 $9
-
- ! rightmost in register to first in memory
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- andcc $1, 3, global0
- bne,pn %icc, $5
- nop
-
- sta $2, [$1] 0x88
- add $1, 4, $4
-
- ba,pt %icc, $5a
- sta $3, [$4] 0x88
-#endif
-
-$5:
- and $2, 255, $4
- stub $4, [$1+0]
-
- srl $2, 8, $4
- and $4, 255, $4
- stub $4, [$1+1]
-
- srl $2, 16, $4
- and $4, 255, $4
- stub $4, [$1+2]
-
- srl $2, 24, $4
- stub $4, [$1+3]
-
-
- and $3, 255, $4
- stub $4, [$1+0+4]
-
- srl $3, 8, $4
- and $4, 255, $4
- stub $4, [$1+1+4]
-
- srl $3, 16, $4
- and $4, 255, $4
- stub $4, [$1+2+4]
-
- srl $3, 24, $4
- stub $4, [$1+3+4]
-
-$5a:
-
-})
-
-
-! {store_n_bytes}
-!
-! Stores 1 to 7 bytes little endian
-!
-! parameter 1 address
-! parameter 2 length
-! parameter 3 source register left
-! parameter 4 source register right
-! parameter 5 temp
-! parameter 6 temp2
-! parameter 7 label
-! parameter 8 return label
-
-define(store_n_bytes, {
-
-! {store_n_bytes}
-! $1 $2 $5 $6 $7 $8 $7 $8 $9
-
-$7.0: call .+8
- sll $2, 2, $6
-
- add %o7,$7.jmp.table-$7.0,$5
-
- add $5, $6, $5
-
- ld [$5], $5
-
- jmp %o7+$5
- nop
-
-$7.7:
- srl $3, 16, $5
- and $5, 0xff, $5
- stub $5, [$1+6]
-$7.6:
- srl $3, 8, $5
- and $5, 0xff, $5
- stub $5, [$1+5]
-$7.5:
- and $3, 0xff, $5
- stub $5, [$1+4]
-$7.4:
- srl $4, 24, $5
- stub $5, [$1+3]
-$7.3:
- srl $4, 16, $5
- and $5, 0xff, $5
- stub $5, [$1+2]
-$7.2:
- srl $4, 8, $5
- and $5, 0xff, $5
- stub $5, [$1+1]
-$7.1:
- and $4, 0xff, $5
-
-
- ba $8
- stub $5, [$1]
-
- .align 4
-
-$7.jmp.table:
-
- .word 0
- .word $7.1-$7.0
- .word $7.2-$7.0
- .word $7.3-$7.0
- .word $7.4-$7.0
- .word $7.5-$7.0
- .word $7.6-$7.0
- .word $7.7-$7.0
-})
-
-
-define(testvalue,{1})
-
-define(register_init, {
-
-! For test purposes:
-
- sethi %hi(testvalue), local0
- or local0, %lo(testvalue), local0
-
- ifelse($1,{},{}, {mov local0, $1})
- ifelse($2,{},{}, {mov local0, $2})
- ifelse($3,{},{}, {mov local0, $3})
- ifelse($4,{},{}, {mov local0, $4})
- ifelse($5,{},{}, {mov local0, $5})
- ifelse($6,{},{}, {mov local0, $6})
- ifelse($7,{},{}, {mov local0, $7})
- ifelse($8,{},{}, {mov local0, $8})
-
- mov local0, local1
- mov local0, local2
- mov local0, local3
- mov local0, local4
- mov local0, local5
- mov local0, local7
- mov local0, local6
- mov local0, out0
- mov local0, out1
- mov local0, out2
- mov local0, out3
- mov local0, out4
- mov local0, out5
- mov local0, global1
- mov local0, global2
- mov local0, global3
- mov local0, global4
- mov local0, global5
-
-})
-
-.section ".text"
-
- .align 32
-
-.des_enc:
-
- ! key address in3
- ! loads key next encryption/decryption first round from [in4]
-
- rounds_macro(in5, out5, 1, .des_enc.1, in3, in4, retl)
-
-
- .align 32
-
-.des_dec:
-
- ! implemented with out5 as first parameter to avoid
- ! register exchange in ede modes
-
- ! key address in4
- ! loads key next encryption/decryption first round from [in3]
-
- rounds_macro(out5, in5, -1, .des_dec.1, in4, in3, retl)
-
-
-
-! void DES_encrypt1(data, ks, enc)
-! *******************************
-
- .align 32
- .global DES_encrypt1
- .type DES_encrypt1,#function
-
-DES_encrypt1:
-
- save %sp, FRAME, %sp
-
- sethi %hi(.PIC.DES_SPtrans-1f),global1
- or global1,%lo(.PIC.DES_SPtrans-1f),global1
-1: call .+8
- add %o7,global1,global1
- sub global1,.PIC.DES_SPtrans-.des_and,out2
-
- ld [in0], in5 ! left
- cmp in2, 0 ! enc
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- be,pn %icc, .encrypt.dec ! enc/dec
-#else
- be .encrypt.dec
-#endif
- ld [in0+4], out5 ! right
-
- ! parameter 6 1/2 for include encryption/decryption
- ! parameter 7 1 for move in1 to in3
- ! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
-
- ip_macro(in5, out5, in5, out5, in3, 0, 1, 1)
-
- rounds_macro(in5, out5, 1, .des_encrypt1.1, in3, in4) ! in4 not used
-
- fp_macro(in5, out5, 1) ! 1 for store to [in0]
-
- ret
- restore
-
-.encrypt.dec:
-
- add in1, 120, in3 ! use last subkey for first round
-
- ! parameter 6 1/2 for include encryption/decryption
- ! parameter 7 1 for move in1 to in3
- ! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
-
- ip_macro(in5, out5, out5, in5, in4, 2, 0, 1) ! include dec, ks in4
-
- fp_macro(out5, in5, 1) ! 1 for store to [in0]
-
- ret
- restore
-
-.DES_encrypt1.end:
- .size DES_encrypt1,.DES_encrypt1.end-DES_encrypt1
-
-
-! void DES_encrypt2(data, ks, enc)
-!*********************************
-
- ! encrypts/decrypts without initial/final permutation
-
- .align 32
- .global DES_encrypt2
- .type DES_encrypt2,#function
-
-DES_encrypt2:
-
- save %sp, FRAME, %sp
-
- sethi %hi(.PIC.DES_SPtrans-1f),global1
- or global1,%lo(.PIC.DES_SPtrans-1f),global1
-1: call .+8
- add %o7,global1,global1
- sub global1,.PIC.DES_SPtrans-.des_and,out2
-
- ! Set sbox address 1 to 6 and rotate halfs 3 left
- ! Errors caught by destest? Yes. Still? *NO*
-
- !sethi %hi(DES_SPtrans), global1 ! address sbox 1
-
- !or global1, %lo(DES_SPtrans), global1 ! sbox 1
-
- add global1, 256, global2 ! sbox 2
- add global1, 512, global3 ! sbox 3
-
- ld [in0], out5 ! right
- add global1, 768, global4 ! sbox 4
- add global1, 1024, global5 ! sbox 5
-
- ld [in0+4], in5 ! left
- add global1, 1280, local6 ! sbox 6
- add global1, 1792, out3 ! sbox 8
-
- ! rotate
-
- sll in5, 3, local5
- mov in1, in3 ! key address to in3
-
- sll out5, 3, local7
- srl in5, 29, in5
-
- srl out5, 29, out5
- add in5, local5, in5
-
- add out5, local7, out5
- cmp in2, 0
-
- ! we use our own stackframe
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- be,pn %icc, .encrypt2.dec ! decryption
-#else
- be .encrypt2.dec
-#endif
- STPTR in0, [%sp+BIAS+ARG0+0*ARGSZ]
-
- ld [in3], out0 ! key 7531 first round
- mov LOOPS, out4 ! loop counter
-
- ld [in3+4], out1 ! key 8642 first round
- sethi %hi(0x0000FC00), local5
-
- call .des_enc
- mov in3, in4
-
- ! rotate
- sll in5, 29, in0
- srl in5, 3, in5
- sll out5, 29, in1
- add in5, in0, in5
- srl out5, 3, out5
- LDPTR [%sp+BIAS+ARG0+0*ARGSZ], in0
- add out5, in1, out5
- st in5, [in0]
- st out5, [in0+4]
-
- ret
- restore
-
-
-.encrypt2.dec:
-
- add in3, 120, in4
-
- ld [in4], out0 ! key 7531 first round
- mov LOOPS, out4 ! loop counter
-
- ld [in4+4], out1 ! key 8642 first round
- sethi %hi(0x0000FC00), local5
-
- mov in5, local1 ! left expected in out5
- mov out5, in5
-
- call .des_dec
- mov local1, out5
-
-.encrypt2.finish:
-
- ! rotate
- sll in5, 29, in0
- srl in5, 3, in5
- sll out5, 29, in1
- add in5, in0, in5
- srl out5, 3, out5
- LDPTR [%sp+BIAS+ARG0+0*ARGSZ], in0
- add out5, in1, out5
- st out5, [in0]
- st in5, [in0+4]
-
- ret
- restore
-
-.DES_encrypt2.end:
- .size DES_encrypt2, .DES_encrypt2.end-DES_encrypt2
-
-
-! void DES_encrypt3(data, ks1, ks2, ks3)
-! **************************************
-
- .align 32
- .global DES_encrypt3
- .type DES_encrypt3,#function
-
-DES_encrypt3:
-
- save %sp, FRAME, %sp
-
- sethi %hi(.PIC.DES_SPtrans-1f),global1
- or global1,%lo(.PIC.DES_SPtrans-1f),global1
-1: call .+8
- add %o7,global1,global1
- sub global1,.PIC.DES_SPtrans-.des_and,out2
-
- ld [in0], in5 ! left
- add in2, 120, in4 ! ks2
-
- ld [in0+4], out5 ! right
- mov in3, in2 ! save ks3
-
- ! parameter 6 1/2 for include encryption/decryption
- ! parameter 7 1 for mov in1 to in3
- ! parameter 8 1 for mov in3 to in4
- ! parameter 9 1 for load ks3 and ks2 to in4 and in3
-
- ip_macro(in5, out5, in5, out5, in3, 1, 1, 0, 0)
-
- call .des_dec
- mov in2, in3 ! preload ks3
-
- call .des_enc
- nop
-
- fp_macro(in5, out5, 1)
-
- ret
- restore
-
-.DES_encrypt3.end:
- .size DES_encrypt3,.DES_encrypt3.end-DES_encrypt3
-
-
-! void DES_decrypt3(data, ks1, ks2, ks3)
-! **************************************
-
- .align 32
- .global DES_decrypt3
- .type DES_decrypt3,#function
-
-DES_decrypt3:
-
- save %sp, FRAME, %sp
-
- sethi %hi(.PIC.DES_SPtrans-1f),global1
- or global1,%lo(.PIC.DES_SPtrans-1f),global1
-1: call .+8
- add %o7,global1,global1
- sub global1,.PIC.DES_SPtrans-.des_and,out2
-
- ld [in0], in5 ! left
- add in3, 120, in4 ! ks3
-
- ld [in0+4], out5 ! right
- mov in2, in3 ! ks2
-
- ! parameter 6 1/2 for include encryption/decryption
- ! parameter 7 1 for mov in1 to in3
- ! parameter 8 1 for mov in3 to in4
- ! parameter 9 1 for load ks3 and ks2 to in4 and in3
-
- ip_macro(in5, out5, out5, in5, in4, 2, 0, 0, 0)
-
- call .des_enc
- add in1, 120, in4 ! preload ks1
-
- call .des_dec
- nop
-
- fp_macro(out5, in5, 1)
-
- ret
- restore
-
-.DES_decrypt3.end:
- .size DES_decrypt3,.DES_decrypt3.end-DES_decrypt3
-
-! void DES_ncbc_encrypt(input, output, length, schedule, ivec, enc)
-! *****************************************************************
-
-
- .align 32
- .global DES_ncbc_encrypt
- .type DES_ncbc_encrypt,#function
-
-DES_ncbc_encrypt:
-
- save %sp, FRAME, %sp
-
- define({INPUT}, { [%sp+BIAS+ARG0+0*ARGSZ] })
- define({OUTPUT}, { [%sp+BIAS+ARG0+1*ARGSZ] })
- define({IVEC}, { [%sp+BIAS+ARG0+4*ARGSZ] })
-
- sethi %hi(.PIC.DES_SPtrans-1f),global1
- or global1,%lo(.PIC.DES_SPtrans-1f),global1
-1: call .+8
- add %o7,global1,global1
- sub global1,.PIC.DES_SPtrans-.des_and,out2
-
- cmp in5, 0 ! enc
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- be,pn %icc, .ncbc.dec
-#else
- be .ncbc.dec
-#endif
- STPTR in4, IVEC
-
- ! addr left right temp label
- load_little_endian(in4, in5, out5, local3, .LLE1) ! iv
-
- addcc in2, -8, in2 ! bytes missing when first block done
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- bl,pn %icc, .ncbc.enc.seven.or.less
-#else
- bl .ncbc.enc.seven.or.less
-#endif
- mov in3, in4 ! schedule
-
-.ncbc.enc.next.block:
-
- load_little_endian(in0, out4, global4, local3, .LLE2) ! block
-
-.ncbc.enc.next.block_1:
-
- xor in5, out4, in5 ! iv xor
- xor out5, global4, out5 ! iv xor
-
- ! parameter 8 1 for move in3 to in4, 2 for move in4 to in3
- ip_macro(in5, out5, in5, out5, in3, 0, 0, 2)
-
-.ncbc.enc.next.block_2:
-
-!// call .des_enc ! compares in2 to 8
-! rounds inlined for alignment purposes
-
- add global1, 768, global4 ! address sbox 4 since register used below
-
- rounds_macro(in5, out5, 1, .ncbc.enc.1, in3, in4) ! include encryption ks in3
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- bl,pn %icc, .ncbc.enc.next.block_fp
-#else
- bl .ncbc.enc.next.block_fp
-#endif
- add in0, 8, in0 ! input address
-
- ! If 8 or more bytes are to be encrypted after this block,
- ! we combine final permutation for this block with initial
- ! permutation for next block. Load next block:
-
- load_little_endian(in0, global3, global4, local5, .LLE12)
-
- ! parameter 1 original left
- ! parameter 2 original right
- ! parameter 3 left ip
- ! parameter 4 right ip
- ! parameter 5 1: load ks1/ks2 to in3/in4, add 120 to in4
- ! 2: mov in4 to in3
- !
- ! also adds -8 to length in2 and loads loop counter to out4
-
- fp_ip_macro(out0, out1, global3, global4, 2)
-
- store_little_endian(in1, out0, out1, local3, .SLE10) ! block
-
- ld [in3], out0 ! key 7531 first round next block
- mov in5, local1
- xor global3, out5, in5 ! iv xor next block
-
- ld [in3+4], out1 ! key 8642
- add global1, 512, global3 ! address sbox 3 since register used
- xor global4, local1, out5 ! iv xor next block
-
- ba .ncbc.enc.next.block_2
- add in1, 8, in1 ! output adress
-
-.ncbc.enc.next.block_fp:
-
- fp_macro(in5, out5)
-
- store_little_endian(in1, in5, out5, local3, .SLE1) ! block
-
- addcc in2, -8, in2 ! bytes missing when next block done
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- bpos,pt %icc, .ncbc.enc.next.block ! also jumps if 0
-#else
- bpos .ncbc.enc.next.block
-#endif
- add in1, 8, in1
-
-.ncbc.enc.seven.or.less:
-
- cmp in2, -8
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- ble,pt %icc, .ncbc.enc.finish
-#else
- ble .ncbc.enc.finish
-#endif
- nop
-
- add in2, 8, local1 ! bytes to load
-
- ! addr, length, dest left, dest right, temp, temp2, label, ret label
- load_n_bytes(in0, local1, global4, out4, local2, local3, .LNB1, .ncbc.enc.next.block_1)
-
- ! Loads 1 to 7 bytes little endian to global4, out4
-
-
-.ncbc.enc.finish:
-
- LDPTR IVEC, local4
- store_little_endian(local4, in5, out5, local5, .SLE2) ! ivec
-
- ret
- restore
-
-
-.ncbc.dec:
-
- STPTR in0, INPUT
- cmp in2, 0 ! length
- add in3, 120, in3
-
- LDPTR IVEC, local7 ! ivec
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- ble,pn %icc, .ncbc.dec.finish
-#else
- ble .ncbc.dec.finish
-#endif
- mov in3, in4 ! schedule
-
- STPTR in1, OUTPUT
- mov in0, local5 ! input
-
- load_little_endian(local7, in0, in1, local3, .LLE3) ! ivec
-
-.ncbc.dec.next.block:
-
- load_little_endian(local5, in5, out5, local3, .LLE4) ! block
-
- ! parameter 6 1/2 for include encryption/decryption
- ! parameter 7 1 for mov in1 to in3
- ! parameter 8 1 for mov in3 to in4
-
- ip_macro(in5, out5, out5, in5, in4, 2, 0, 1) ! include decryprion ks in4
-
- fp_macro(out5, in5, 0, 1) ! 1 for input and output address to local5/7
-
- ! in2 is bytes left to be stored
- ! in2 is compared to 8 in the rounds
-
- xor out5, in0, out4 ! iv xor
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- bl,pn %icc, .ncbc.dec.seven.or.less
-#else
- bl .ncbc.dec.seven.or.less
-#endif
- xor in5, in1, global4 ! iv xor
-
- ! Load ivec next block now, since input and output address might be the same.
-
- load_little_endian_inc(local5, in0, in1, local3, .LLE5) ! iv
-
- store_little_endian(local7, out4, global4, local3, .SLE3)
-
- STPTR local5, INPUT
- add local7, 8, local7
- addcc in2, -8, in2
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- bg,pt %icc, .ncbc.dec.next.block
-#else
- bg .ncbc.dec.next.block
-#endif
- STPTR local7, OUTPUT
-
-
-.ncbc.dec.store.iv:
-
- LDPTR IVEC, local4 ! ivec
- store_little_endian(local4, in0, in1, local5, .SLE4)
-
-.ncbc.dec.finish:
-
- ret
- restore
-
-.ncbc.dec.seven.or.less:
-
- load_little_endian_inc(local5, in0, in1, local3, .LLE13) ! ivec
-
- store_n_bytes(local7, in2, global4, out4, local3, local4, .SNB1, .ncbc.dec.store.iv)
-
-
-.DES_ncbc_encrypt.end:
- .size DES_ncbc_encrypt, .DES_ncbc_encrypt.end-DES_ncbc_encrypt
-
-
-! void DES_ede3_cbc_encrypt(input, output, lenght, ks1, ks2, ks3, ivec, enc)
-! **************************************************************************
-
-
- .align 32
- .global DES_ede3_cbc_encrypt
- .type DES_ede3_cbc_encrypt,#function
-
-DES_ede3_cbc_encrypt:
-
- save %sp, FRAME, %sp
-
- define({KS1}, { [%sp+BIAS+ARG0+3*ARGSZ] })
- define({KS2}, { [%sp+BIAS+ARG0+4*ARGSZ] })
- define({KS3}, { [%sp+BIAS+ARG0+5*ARGSZ] })
-
- sethi %hi(.PIC.DES_SPtrans-1f),global1
- or global1,%lo(.PIC.DES_SPtrans-1f),global1
-1: call .+8
- add %o7,global1,global1
- sub global1,.PIC.DES_SPtrans-.des_and,out2
-
- LDPTR [%fp+BIAS+ARG0+7*ARGSZ], local3 ! enc
- LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local4 ! ivec
- cmp local3, 0 ! enc
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- be,pn %icc, .ede3.dec
-#else
- be .ede3.dec
-#endif
- STPTR in4, KS2
-
- STPTR in5, KS3
-
- load_little_endian(local4, in5, out5, local3, .LLE6) ! ivec
-
- addcc in2, -8, in2 ! bytes missing after next block
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- bl,pn %icc, .ede3.enc.seven.or.less
-#else
- bl .ede3.enc.seven.or.less
-#endif
- STPTR in3, KS1
-
-.ede3.enc.next.block:
-
- load_little_endian(in0, out4, global4, local3, .LLE7)
-
-.ede3.enc.next.block_1:
-
- LDPTR KS2, in4
- xor in5, out4, in5 ! iv xor
- xor out5, global4, out5 ! iv xor
-
- LDPTR KS1, in3
- add in4, 120, in4 ! for decryption we use last subkey first
- nop
-
- ip_macro(in5, out5, in5, out5, in3)
-
-.ede3.enc.next.block_2:
-
- call .des_enc ! ks1 in3
- nop
-
- call .des_dec ! ks2 in4
- LDPTR KS3, in3
-
- call .des_enc ! ks3 in3 compares in2 to 8
- nop
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- bl,pn %icc, .ede3.enc.next.block_fp
-#else
- bl .ede3.enc.next.block_fp
-#endif
- add in0, 8, in0
-
- ! If 8 or more bytes are to be encrypted after this block,
- ! we combine final permutation for this block with initial
- ! permutation for next block. Load next block:
-
- load_little_endian(in0, global3, global4, local5, .LLE11)
-
- ! parameter 1 original left
- ! parameter 2 original right
- ! parameter 3 left ip
- ! parameter 4 right ip
- ! parameter 5 1: load ks1/ks2 to in3/in4, add 120 to in4
- ! 2: mov in4 to in3
- !
- ! also adds -8 to length in2 and loads loop counter to out4
-
- fp_ip_macro(out0, out1, global3, global4, 1)
-
- store_little_endian(in1, out0, out1, local3, .SLE9) ! block
-
- mov in5, local1
- xor global3, out5, in5 ! iv xor next block
-
- ld [in3], out0 ! key 7531
- add global1, 512, global3 ! address sbox 3
- xor global4, local1, out5 ! iv xor next block
-
- ld [in3+4], out1 ! key 8642
- add global1, 768, global4 ! address sbox 4
- ba .ede3.enc.next.block_2
- add in1, 8, in1
-
-.ede3.enc.next.block_fp:
-
- fp_macro(in5, out5)
-
- store_little_endian(in1, in5, out5, local3, .SLE5) ! block
-
- addcc in2, -8, in2 ! bytes missing when next block done
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- bpos,pt %icc, .ede3.enc.next.block
-#else
- bpos .ede3.enc.next.block
-#endif
- add in1, 8, in1
-
-.ede3.enc.seven.or.less:
-
- cmp in2, -8
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- ble,pt %icc, .ede3.enc.finish
-#else
- ble .ede3.enc.finish
-#endif
- nop
-
- add in2, 8, local1 ! bytes to load
-
- ! addr, length, dest left, dest right, temp, temp2, label, ret label
- load_n_bytes(in0, local1, global4, out4, local2, local3, .LNB2, .ede3.enc.next.block_1)
-
-.ede3.enc.finish:
-
- LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local4 ! ivec
- store_little_endian(local4, in5, out5, local5, .SLE6) ! ivec
-
- ret
- restore
-
-.ede3.dec:
-
- STPTR in0, INPUT
- add in5, 120, in5
-
- STPTR in1, OUTPUT
- mov in0, local5
- add in3, 120, in3
-
- STPTR in3, KS1
- cmp in2, 0
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- ble %icc, .ede3.dec.finish
-#else
- ble .ede3.dec.finish
-#endif
- STPTR in5, KS3
-
- LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local7 ! iv
- load_little_endian(local7, in0, in1, local3, .LLE8)
-
-.ede3.dec.next.block:
-
- load_little_endian(local5, in5, out5, local3, .LLE9)
-
- ! parameter 6 1/2 for include encryption/decryption
- ! parameter 7 1 for mov in1 to in3
- ! parameter 8 1 for mov in3 to in4
- ! parameter 9 1 for load ks3 and ks2 to in4 and in3
-
- ip_macro(in5, out5, out5, in5, in4, 2, 0, 0, 1) ! inc .des_dec ks3 in4
-
- call .des_enc ! ks2 in3
- LDPTR KS1, in4
-
- call .des_dec ! ks1 in4
- nop
-
- fp_macro(out5, in5, 0, 1) ! 1 for input and output address local5/7
-
- ! in2 is bytes left to be stored
- ! in2 is compared to 8 in the rounds
-
- xor out5, in0, out4
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- bl,pn %icc, .ede3.dec.seven.or.less
-#else
- bl .ede3.dec.seven.or.less
-#endif
- xor in5, in1, global4
-
- load_little_endian_inc(local5, in0, in1, local3, .LLE10) ! iv next block
-
- store_little_endian(local7, out4, global4, local3, .SLE7) ! block
-
- STPTR local5, INPUT
- addcc in2, -8, in2
- add local7, 8, local7
-
-#ifdef OPENSSL_SYSNAME_ULTRASPARC
- bg,pt %icc, .ede3.dec.next.block
-#else
- bg .ede3.dec.next.block
-#endif
- STPTR local7, OUTPUT
-
-.ede3.dec.store.iv:
-
- LDPTR [%fp+BIAS+ARG0+6*ARGSZ], local4 ! ivec
- store_little_endian(local4, in0, in1, local5, .SLE8) ! ivec
-
-.ede3.dec.finish:
-
- ret
- restore
-
-.ede3.dec.seven.or.less:
-
- load_little_endian_inc(local5, in0, in1, local3, .LLE14) ! iv
-
- store_n_bytes(local7, in2, global4, out4, local3, local4, .SNB2, .ede3.dec.store.iv)
-
-
-.DES_ede3_cbc_encrypt.end:
- .size DES_ede3_cbc_encrypt,.DES_ede3_cbc_encrypt.end-DES_ede3_cbc_encrypt
-
- .align 256
- .type .des_and,#object
- .size .des_and,284
-
-.des_and:
-
-! This table is used for AND 0xFC when it is known that register
-! bits 8-31 are zero. Makes it possible to do three arithmetic
-! operations in one cycle.
-
- .byte 0, 0, 0, 0, 4, 4, 4, 4
- .byte 8, 8, 8, 8, 12, 12, 12, 12
- .byte 16, 16, 16, 16, 20, 20, 20, 20
- .byte 24, 24, 24, 24, 28, 28, 28, 28
- .byte 32, 32, 32, 32, 36, 36, 36, 36
- .byte 40, 40, 40, 40, 44, 44, 44, 44
- .byte 48, 48, 48, 48, 52, 52, 52, 52
- .byte 56, 56, 56, 56, 60, 60, 60, 60
- .byte 64, 64, 64, 64, 68, 68, 68, 68
- .byte 72, 72, 72, 72, 76, 76, 76, 76
- .byte 80, 80, 80, 80, 84, 84, 84, 84
- .byte 88, 88, 88, 88, 92, 92, 92, 92
- .byte 96, 96, 96, 96, 100, 100, 100, 100
- .byte 104, 104, 104, 104, 108, 108, 108, 108
- .byte 112, 112, 112, 112, 116, 116, 116, 116
- .byte 120, 120, 120, 120, 124, 124, 124, 124
- .byte 128, 128, 128, 128, 132, 132, 132, 132
- .byte 136, 136, 136, 136, 140, 140, 140, 140
- .byte 144, 144, 144, 144, 148, 148, 148, 148
- .byte 152, 152, 152, 152, 156, 156, 156, 156
- .byte 160, 160, 160, 160, 164, 164, 164, 164
- .byte 168, 168, 168, 168, 172, 172, 172, 172
- .byte 176, 176, 176, 176, 180, 180, 180, 180
- .byte 184, 184, 184, 184, 188, 188, 188, 188
- .byte 192, 192, 192, 192, 196, 196, 196, 196
- .byte 200, 200, 200, 200, 204, 204, 204, 204
- .byte 208, 208, 208, 208, 212, 212, 212, 212
- .byte 216, 216, 216, 216, 220, 220, 220, 220
- .byte 224, 224, 224, 224, 228, 228, 228, 228
- .byte 232, 232, 232, 232, 236, 236, 236, 236
- .byte 240, 240, 240, 240, 244, 244, 244, 244
- .byte 248, 248, 248, 248, 252, 252, 252, 252
-
- ! 5 numbers for initil/final permutation
-
- .word 0x0f0f0f0f ! offset 256
- .word 0x0000ffff ! 260
- .word 0x33333333 ! 264
- .word 0x00ff00ff ! 268
- .word 0x55555555 ! 272
-
- .word 0 ! 276
- .word LOOPS ! 280
- .word 0x0000FC00 ! 284
-
- .global DES_SPtrans
- .type DES_SPtrans,#object
- .size DES_SPtrans,2048
-.align 64
-DES_SPtrans:
-.PIC.DES_SPtrans:
- ! nibble 0
- .word 0x02080800, 0x00080000, 0x02000002, 0x02080802
- .word 0x02000000, 0x00080802, 0x00080002, 0x02000002
- .word 0x00080802, 0x02080800, 0x02080000, 0x00000802
- .word 0x02000802, 0x02000000, 0x00000000, 0x00080002
- .word 0x00080000, 0x00000002, 0x02000800, 0x00080800
- .word 0x02080802, 0x02080000, 0x00000802, 0x02000800
- .word 0x00000002, 0x00000800, 0x00080800, 0x02080002
- .word 0x00000800, 0x02000802, 0x02080002, 0x00000000
- .word 0x00000000, 0x02080802, 0x02000800, 0x00080002
- .word 0x02080800, 0x00080000, 0x00000802, 0x02000800
- .word 0x02080002, 0x00000800, 0x00080800, 0x02000002
- .word 0x00080802, 0x00000002, 0x02000002, 0x02080000
- .word 0x02080802, 0x00080800, 0x02080000, 0x02000802
- .word 0x02000000, 0x00000802, 0x00080002, 0x00000000
- .word 0x00080000, 0x02000000, 0x02000802, 0x02080800
- .word 0x00000002, 0x02080002, 0x00000800, 0x00080802
- ! nibble 1
- .word 0x40108010, 0x00000000, 0x00108000, 0x40100000
- .word 0x40000010, 0x00008010, 0x40008000, 0x00108000
- .word 0x00008000, 0x40100010, 0x00000010, 0x40008000
- .word 0x00100010, 0x40108000, 0x40100000, 0x00000010
- .word 0x00100000, 0x40008010, 0x40100010, 0x00008000
- .word 0x00108010, 0x40000000, 0x00000000, 0x00100010
- .word 0x40008010, 0x00108010, 0x40108000, 0x40000010
- .word 0x40000000, 0x00100000, 0x00008010, 0x40108010
- .word 0x00100010, 0x40108000, 0x40008000, 0x00108010
- .word 0x40108010, 0x00100010, 0x40000010, 0x00000000
- .word 0x40000000, 0x00008010, 0x00100000, 0x40100010
- .word 0x00008000, 0x40000000, 0x00108010, 0x40008010
- .word 0x40108000, 0x00008000, 0x00000000, 0x40000010
- .word 0x00000010, 0x40108010, 0x00108000, 0x40100000
- .word 0x40100010, 0x00100000, 0x00008010, 0x40008000
- .word 0x40008010, 0x00000010, 0x40100000, 0x00108000
- ! nibble 2
- .word 0x04000001, 0x04040100, 0x00000100, 0x04000101
- .word 0x00040001, 0x04000000, 0x04000101, 0x00040100
- .word 0x04000100, 0x00040000, 0x04040000, 0x00000001
- .word 0x04040101, 0x00000101, 0x00000001, 0x04040001
- .word 0x00000000, 0x00040001, 0x04040100, 0x00000100
- .word 0x00000101, 0x04040101, 0x00040000, 0x04000001
- .word 0x04040001, 0x04000100, 0x00040101, 0x04040000
- .word 0x00040100, 0x00000000, 0x04000000, 0x00040101
- .word 0x04040100, 0x00000100, 0x00000001, 0x00040000
- .word 0x00000101, 0x00040001, 0x04040000, 0x04000101
- .word 0x00000000, 0x04040100, 0x00040100, 0x04040001
- .word 0x00040001, 0x04000000, 0x04040101, 0x00000001
- .word 0x00040101, 0x04000001, 0x04000000, 0x04040101
- .word 0x00040000, 0x04000100, 0x04000101, 0x00040100
- .word 0x04000100, 0x00000000, 0x04040001, 0x00000101
- .word 0x04000001, 0x00040101, 0x00000100, 0x04040000
- ! nibble 3
- .word 0x00401008, 0x10001000, 0x00000008, 0x10401008
- .word 0x00000000, 0x10400000, 0x10001008, 0x00400008
- .word 0x10401000, 0x10000008, 0x10000000, 0x00001008
- .word 0x10000008, 0x00401008, 0x00400000, 0x10000000
- .word 0x10400008, 0x00401000, 0x00001000, 0x00000008
- .word 0x00401000, 0x10001008, 0x10400000, 0x00001000
- .word 0x00001008, 0x00000000, 0x00400008, 0x10401000
- .word 0x10001000, 0x10400008, 0x10401008, 0x00400000
- .word 0x10400008, 0x00001008, 0x00400000, 0x10000008
- .word 0x00401000, 0x10001000, 0x00000008, 0x10400000
- .word 0x10001008, 0x00000000, 0x00001000, 0x00400008
- .word 0x00000000, 0x10400008, 0x10401000, 0x00001000
- .word 0x10000000, 0x10401008, 0x00401008, 0x00400000
- .word 0x10401008, 0x00000008, 0x10001000, 0x00401008
- .word 0x00400008, 0x00401000, 0x10400000, 0x10001008
- .word 0x00001008, 0x10000000, 0x10000008, 0x10401000
- ! nibble 4
- .word 0x08000000, 0x00010000, 0x00000400, 0x08010420
- .word 0x08010020, 0x08000400, 0x00010420, 0x08010000
- .word 0x00010000, 0x00000020, 0x08000020, 0x00010400
- .word 0x08000420, 0x08010020, 0x08010400, 0x00000000
- .word 0x00010400, 0x08000000, 0x00010020, 0x00000420
- .word 0x08000400, 0x00010420, 0x00000000, 0x08000020
- .word 0x00000020, 0x08000420, 0x08010420, 0x00010020
- .word 0x08010000, 0x00000400, 0x00000420, 0x08010400
- .word 0x08010400, 0x08000420, 0x00010020, 0x08010000
- .word 0x00010000, 0x00000020, 0x08000020, 0x08000400
- .word 0x08000000, 0x00010400, 0x08010420, 0x00000000
- .word 0x00010420, 0x08000000, 0x00000400, 0x00010020
- .word 0x08000420, 0x00000400, 0x00000000, 0x08010420
- .word 0x08010020, 0x08010400, 0x00000420, 0x00010000
- .word 0x00010400, 0x08010020, 0x08000400, 0x00000420
- .word 0x00000020, 0x00010420, 0x08010000, 0x08000020
- ! nibble 5
- .word 0x80000040, 0x00200040, 0x00000000, 0x80202000
- .word 0x00200040, 0x00002000, 0x80002040, 0x00200000
- .word 0x00002040, 0x80202040, 0x00202000, 0x80000000
- .word 0x80002000, 0x80000040, 0x80200000, 0x00202040
- .word 0x00200000, 0x80002040, 0x80200040, 0x00000000
- .word 0x00002000, 0x00000040, 0x80202000, 0x80200040
- .word 0x80202040, 0x80200000, 0x80000000, 0x00002040
- .word 0x00000040, 0x00202000, 0x00202040, 0x80002000
- .word 0x00002040, 0x80000000, 0x80002000, 0x00202040
- .word 0x80202000, 0x00200040, 0x00000000, 0x80002000
- .word 0x80000000, 0x00002000, 0x80200040, 0x00200000
- .word 0x00200040, 0x80202040, 0x00202000, 0x00000040
- .word 0x80202040, 0x00202000, 0x00200000, 0x80002040
- .word 0x80000040, 0x80200000, 0x00202040, 0x00000000
- .word 0x00002000, 0x80000040, 0x80002040, 0x80202000
- .word 0x80200000, 0x00002040, 0x00000040, 0x80200040
- ! nibble 6
- .word 0x00004000, 0x00000200, 0x01000200, 0x01000004
- .word 0x01004204, 0x00004004, 0x00004200, 0x00000000
- .word 0x01000000, 0x01000204, 0x00000204, 0x01004000
- .word 0x00000004, 0x01004200, 0x01004000, 0x00000204
- .word 0x01000204, 0x00004000, 0x00004004, 0x01004204
- .word 0x00000000, 0x01000200, 0x01000004, 0x00004200
- .word 0x01004004, 0x00004204, 0x01004200, 0x00000004
- .word 0x00004204, 0x01004004, 0x00000200, 0x01000000
- .word 0x00004204, 0x01004000, 0x01004004, 0x00000204
- .word 0x00004000, 0x00000200, 0x01000000, 0x01004004
- .word 0x01000204, 0x00004204, 0x00004200, 0x00000000
- .word 0x00000200, 0x01000004, 0x00000004, 0x01000200
- .word 0x00000000, 0x01000204, 0x01000200, 0x00004200
- .word 0x00000204, 0x00004000, 0x01004204, 0x01000000
- .word 0x01004200, 0x00000004, 0x00004004, 0x01004204
- .word 0x01000004, 0x01004200, 0x01004000, 0x00004004
- ! nibble 7
- .word 0x20800080, 0x20820000, 0x00020080, 0x00000000
- .word 0x20020000, 0x00800080, 0x20800000, 0x20820080
- .word 0x00000080, 0x20000000, 0x00820000, 0x00020080
- .word 0x00820080, 0x20020080, 0x20000080, 0x20800000
- .word 0x00020000, 0x00820080, 0x00800080, 0x20020000
- .word 0x20820080, 0x20000080, 0x00000000, 0x00820000
- .word 0x20000000, 0x00800000, 0x20020080, 0x20800080
- .word 0x00800000, 0x00020000, 0x20820000, 0x00000080
- .word 0x00800000, 0x00020000, 0x20000080, 0x20820080
- .word 0x00020080, 0x20000000, 0x00000000, 0x00820000
- .word 0x20800080, 0x20020080, 0x20020000, 0x00800080
- .word 0x20820000, 0x00000080, 0x00800080, 0x20020000
- .word 0x20820080, 0x00800000, 0x20800000, 0x20000080
- .word 0x00820000, 0x00020080, 0x20020080, 0x20800000
- .word 0x00000080, 0x20820000, 0x00820080, 0x00000000
- .word 0x20000000, 0x20800080, 0x00020000, 0x00820080
-
diff --git a/thirdparty/openssl/crypto/des/des-lib.com b/thirdparty/openssl/crypto/des/des-lib.com
deleted file mode 100644
index 348f1c0470..0000000000
--- a/thirdparty/openssl/crypto/des/des-lib.com
+++ /dev/null
@@ -1,1005 +0,0 @@
-$!
-$! DES-LIB.COM
-$! Written By: Robert Byer
-$! Vice-President
-$! A-Com Computing, Inc.
-$! byer@mail.all-net.net
-$!
-$! Changes by Richard Levitte <richard@levitte.org>
-$!
-$! This command files compiles and creates the
-$! "[.xxx.EXE.CRYPTO.DES]LIBDES.OLB" library. The "xxx" denotes the machine
-$! architecture of ALPHA, IA64 or VAX.
-$!
-$! It was re-written to try to determine which "C" compiler to try to use
-$! or the user can specify a compiler in P3.
-$!
-$! Specify one of the following to build just that part, specify "ALL" to
-$! just build everything.
-$!
-$! ALL To Just Build "Everything".
-$! LIBRARY To Just Build The [.xxx.EXE.CRYPTO.DES]LIBDES.OLB Library.
-$! DESTEST To Just Build The [.xxx.EXE.CRYPTO.DES]DESTEST.EXE Program.
-$! SPEED To Just Build The [.xxx.EXE.CRYPTO.DES]SPEED.EXE Program.
-$! RPW To Just Build The [.xxx.EXE.CRYPTO.DES]RPW.EXE Program.
-$! DES To Just Build The [.xxx.EXE.CRYPTO.DES]DES.EXE Program.
-$! DES_OPTS To Just Build The [.xxx.EXE.CRYPTO.DES]DES_OPTS.EXE Program.
-$!
-$! Specify either DEBUG or NODEBUG as P2 to compile with or without
-$! debugging information.
-$!
-$! Specify which compiler at P3 to try to compile under.
-$!
-$! VAXC For VAX C.
-$! DECC For DEC C.
-$! GNUC For GNU C.
-$!
-$! If you don't speficy a compiler, it will try to determine which
-$! "C" compiler to try to use.
-$!
-$! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
-$!
-$!
-$! Make sure we know what architecture we run on.
-$!
-$!
-$! Check Which Architecture We Are Using.
-$!
-$ IF (F$GETSYI("CPU").LT.128)
-$ THEN
-$!
-$! The Architecture Is VAX
-$!
-$ ARCH := VAX
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! The Architecture Is Alpha, IA64 or whatever comes in the future.
-$!
-$ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
-$ IF (ARCH .EQS. "") THEN ARCH = "UNK"
-$!
-$! End The Architecture Check.
-$!
-$ ENDIF
-$!
-$! Define The OBJ Directory Name.
-$!
-$ OBJ_DIR := SYS$DISK:[--.'ARCH'.OBJ.CRYPTO.DES]
-$!
-$! Define The EXE Directory Name.
-$!
-$ EXE_DIR :== SYS$DISK:[--.'ARCH'.EXE.CRYPTO.DES]
-$!
-$! Check To Make Sure We Have Valid Command Line Parameters.
-$!
-$ GOSUB CHECK_OPTIONS
-$!
-$! Tell The User What Kind of Machine We Run On.
-$!
-$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
-$!
-$! Check To See If The Architecture Specific OBJ Directory Exists.
-$!
-$ IF (F$PARSE(OBJ_DIR).EQS."")
-$ THEN
-$!
-$! It Dosen't Exist, So Create It.
-$!
-$ CREATE/DIR 'OBJ_DIR'
-$!
-$! End The Architecture Specific OBJ Directory Check.
-$!
-$ ENDIF
-$!
-$! Check To See If The Architecture Specific Directory Exists.
-$!
-$ IF (F$PARSE(EXE_DIR).EQS."")
-$ THEN
-$!
-$! It Dosen't Exist, So Create It.
-$!
-$ CREATE/DIR 'EXE_DIR'
-$!
-$! End The Architecture Specific Directory Check.
-$!
-$ ENDIF
-$!
-$! Define The Library Name.
-$!
-$ LIB_NAME := 'EXE_DIR'LIBDES.OLB
-$!
-$! Check To See What We Are To Do.
-$!
-$ IF (BUILDALL.EQS."TRUE")
-$ THEN
-$!
-$! Since Nothing Special Was Specified, Do Everything.
-$!
-$ GOSUB LIBRARY
-$ GOSUB DESTEST
-$ GOSUB SPEED
-$ GOSUB RPW
-$ GOSUB DES
-$ GOSUB DES_OPTS
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Build Just What The User Wants Us To Build.
-$!
-$ GOSUB 'BUILDALL'
-$!
-$! End The BUILDALL Check.
-$!
-$ ENDIF
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$ LIBRARY:
-$!
-$! Tell The User That We Are Compiling.
-$!
-$ WRITE SYS$OUTPUT "Compiling The ",LIB_NAME," Files."
-$!
-$! Check To See If We Already Have A "[.xxx.EXE.CRYPTO.DES]LIBDES.OLB" Library...
-$!
-$ IF (F$SEARCH(LIB_NAME).EQS."")
-$ THEN
-$!
-$! Guess Not, Create The Library.
-$!
-$ LIBRARY/CREATE/OBJECT 'LIB_NAME'
-$!
-$! End The Library Exist Check.
-$!
-$ ENDIF
-$!
-$! Define The DES Library Files.
-$!
-$ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ -
- "ecb3_enc,cfb64enc,cfb64ede,cfb_enc,ofb64ede,"+ -
- "enc_read,enc_writ,ofb64enc,"+ -
- "ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ -
- "des_enc,fcrypt_b,read2pwd,"+ -
- "fcrypt,xcbc_enc,read_pwd,rpc_enc,cbc_cksm,supp"
-$!
-$! Define A File Counter And Set It To "0".
-$!
-$ FILE_COUNTER = 0
-$!
-$! Top Of The File Loop.
-$!
-$ NEXT_FILE:
-$!
-$! O.K, Extract The File Name From The File List.
-$!
-$ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",LIB_DES)
-$!
-$! Check To See If We Are At The End Of The File List.
-$!
-$ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE
-$!
-$! Increment The Counter.
-$!
-$ FILE_COUNTER = FILE_COUNTER + 1
-$!
-$! Create The Source File Name.
-$!
-$ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C"
-$!
-$! Tell The User We Are Compiling The Source File.
-$!
-$ WRITE SYS$OUTPUT " ",FILE_NAME,".C"
-$!
-$! Create The Object File Name.
-$!
-$ OBJECT_FILE = OBJ_DIR + FILE_NAME + "." + ARCH + "OBJ"
-$ ON WARNING THEN GOTO NEXT_FILE
-$!
-$! Check To See If The File We Want To Compile Actually Exists.
-$!
-$ IF (F$SEARCH(SOURCE_FILE).EQS."")
-$ THEN
-$!
-$! Tell The User That The File Dosen't Exist.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Exit The Build.
-$!
-$ EXIT
-$!
-$! End The File Exists Check.
-$!
-$ ENDIF
-$!
-$! Compile The File.
-$!
-$ ON ERROR THEN GOTO NEXT_FILE
-$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
-$!
-$! Add It To The Library.
-$!
-$ LIBRARY/REPLACE/OBJECT 'LIB_NAME' 'OBJECT_FILE'
-$!
-$! Time To Clean Up The Object File.
-$!
-$ DELETE 'OBJECT_FILE';*
-$!
-$! Go Back And Do It Again.
-$!
-$ GOTO NEXT_FILE
-$!
-$! All Done With This Library Part.
-$!
-$ FILE_DONE:
-$!
-$! Tell The User That We Are All Done.
-$!
-$ WRITE SYS$OUTPUT "Library ",LIB_NAME," Built."
-$!
-$! All Done, Time To Return.
-$!
-$ RETURN
-$!
-$! Compile The DESTEST Program.
-$!
-$ DESTEST:
-$!
-$! Check To See If We Have The Proper Libraries.
-$!
-$ GOSUB LIB_CHECK
-$!
-$! Check To See If We Have A Linker Option File.
-$!
-$ GOSUB CHECK_OPT_FILE
-$!
-$! Check To See If The File We Want To Compile Actually Exists.
-$!
-$ IF (F$SEARCH("SYS$DISK:[]DESTEST.C").EQS."")
-$ THEN
-$!
-$! Tell The User That The File Dosen't Exist.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The File DESTEST.C Dosen't Exist."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Exit The Build.
-$!
-$ EXIT
-$!
-$! End The DESTEST.C File Check.
-$!
-$ ENDIF
-$!
-$! Tell The User What We Are Building.
-$!
-$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DESTEST.EXE"
-$!
-$! Compile The DESTEST Program.
-$!
-$ CC/OBJECT='OBJ_DIR'DESTEST.OBJ SYS$DISK:[]DESTEST.C
-$!
-$! Link The DESTEST Program.
-$!
-$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DESTEST.EXE -
- 'OBJ_DIR'DESTEST.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
-$!
-$! All Done, Time To Return.
-$!
-$ RETURN
-$!
-$! Compile The SPEED Program.
-$!
-$ SPEED:
-$!
-$! Check To See If We Have The Proper Libraries.
-$!
-$ GOSUB LIB_CHECK
-$!
-$! Check To See If We Have A Linker Option File.
-$!
-$ GOSUB CHECK_OPT_FILE
-$!
-$! Check To See If The File We Want To Compile Actually Exists.
-$!
-$ IF (F$SEARCH("SYS$DISK:[]SPEED.C").EQS."")
-$ THEN
-$!
-$! Tell The User That The File Dosen't Exist.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The File SPEED.C Dosen't Exist."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Exit The Build.
-$!
-$ EXIT
-$!
-$! End The SPEED.C File Check.
-$!
-$ ENDIF
-$!
-$! Tell The User What We Are Building.
-$!
-$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"SPEED.EXE"
-$!
-$! Compile The SPEED Program.
-$!
-$ CC/OBJECT='OBJ_DIR'SPEED.OBJ SYS$DISK:[]SPEED.C
-$!
-$! Link The SPEED Program.
-$!
-$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'SPEED.EXE -
- 'OBJ_DIR'SPEED.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
-$!
-$! All Done, Time To Return.
-$!
-$ RETURN
-$!
-$! Compile The RPW Program.
-$!
-$ RPW:
-$!
-$! Check To See If We Have The Proper Libraries.
-$!
-$ GOSUB LIB_CHECK
-$!
-$! Check To See If We Have A Linker Option File.
-$!
-$ GOSUB CHECK_OPT_FILE
-$!
-$! Check To See If The File We Want To Compile Actually Exists.
-$!
-$ IF (F$SEARCH("SYS$DISK:[]RPW.C").EQS."")
-$ THEN
-$!
-$! Tell The User That The File Dosen't Exist.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The File RPW.C Dosen't Exist."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Exit The Build.
-$!
-$ EXIT
-$!
-$! End The RPW.C File Check.
-$!
-$ ENDIF
-$!
-$! Tell The User What We Are Building.
-$!
-$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"RPW.EXE"
-$!
-$! Compile The RPW Program.
-$!
-$ CC/OBJECT='OBJ_DIR'RPW.OBJ SYS$DISK:[]RPW.C
-$!
-$! Link The RPW Program.
-$!
-$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'RPW.EXE -
- 'OBJ_DIR'RPW.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
-$!
-$! All Done, Time To Return.
-$!
-$ RETURN
-$!
-$! Compile The DES Program.
-$!
-$ DES:
-$!
-$! Check To See If We Have The Proper Libraries.
-$!
-$ GOSUB LIB_CHECK
-$!
-$! Check To See If We Have A Linker Option File.
-$!
-$ GOSUB CHECK_OPT_FILE
-$!
-$! Check To See If The File We Want To Compile Actually Exists.
-$!
-$ IF (F$SEARCH("SYS$DISK:[]DES.C").EQS."")
-$ THEN
-$!
-$! Tell The User That The File Dosen't Exist.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The File DES.C Dosen't Exist."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Exit The Build.
-$!
-$ EXIT
-$!
-$! End The DES.C File Check.
-$!
-$ ENDIF
-$!
-$! Tell The User What We Are Building.
-$!
-$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DES.EXE"
-$!
-$! Compile The DES Program.
-$!
-$ CC/OBJECT='OBJ_DIR'DES.OBJ SYS$DISK:[]DES.C
-$ CC/OBJECT='OBJ_DIR'DES.OBJ SYS$DISK:[]CBC3_ENC.C
-$!
-$! Link The DES Program.
-$!
-$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DES.EXE -
- 'OBJ_DIR'DES.OBJ,'OBJ_DIR'CBC3_ENC.OBJ,-
- 'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
-$!
-$! All Done, Time To Return.
-$!
-$ RETURN
-$!
-$! Compile The DES_OPTS Program.
-$!
-$ DES_OPTS:
-$!
-$! Check To See If We Have The Proper Libraries.
-$!
-$ GOSUB LIB_CHECK
-$!
-$! Check To See If We Have A Linker Option File.
-$!
-$ GOSUB CHECK_OPT_FILE
-$!
-$! Check To See If The File We Want To Compile Actually Exists.
-$!
-$ IF (F$SEARCH("SYS$DISK:[]DES_OPTS.C").EQS."")
-$ THEN
-$!
-$! Tell The User That The File Dosen't Exist.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The File DES_OPTS.C Dosen't Exist."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Exit The Build.
-$!
-$ EXIT
-$!
-$! End The DES_OPTS.C File Check.
-$!
-$ ENDIF
-$!
-$! Tell The User What We Are Building.
-$!
-$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DES_OPTS.EXE"
-$!
-$! Compile The DES_OPTS Program.
-$!
-$ CC/OBJECT='OBJ_DIR'DES_OPTS.OBJ SYS$DISK:[]DES_OPTS.C
-$!
-$! Link The DES_OPTS Program.
-$!
-$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DES_OPTS.EXE -
- 'OBJ_DIR'DES_OPTS.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
-$!
-$! All Done, Time To Return.
-$!
-$ RETURN
-$ EXIT
-$!
-$! Check For The Link Option FIle.
-$!
-$ CHECK_OPT_FILE:
-$!
-$! Check To See If We Need To Make A VAX C Option File.
-$!
-$ IF (COMPILER.EQS."VAXC")
-$ THEN
-$!
-$! Check To See If We Already Have A VAX C Linker Option File.
-$!
-$ IF (F$SEARCH(OPT_FILE).EQS."")
-$ THEN
-$!
-$! We Need A VAX C Linker Option File.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File To Link Agianst
-! The Sharable VAX C Runtime Library.
-!
-SYS$SHARE:VAXCRTL.EXE/SHARE
-$EOD
-$!
-$! End The Option File Check.
-$!
-$ ENDIF
-$!
-$! End The VAXC Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Need A GNU C Option File.
-$!
-$ IF (COMPILER.EQS."GNUC")
-$ THEN
-$!
-$! Check To See If We Already Have A GNU C Linker Option File.
-$!
-$ IF (F$SEARCH(OPT_FILE).EQS."")
-$ THEN
-$!
-$! We Need A GNU C Linker Option File.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File To Link Agianst
-! The Sharable C Runtime Library.
-!
-GNU_CC:[000000]GCCLIB/LIBRARY
-SYS$SHARE:VAXCRTL/SHARE
-$EOD
-$!
-$! End The Option File Check.
-$!
-$ ENDIF
-$!
-$! End The GNU C Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Need A DEC C Option File.
-$!
-$ IF (COMPILER.EQS."DECC")
-$ THEN
-$!
-$! Check To See If We Already Have A DEC C Linker Option File.
-$!
-$ IF (F$SEARCH(OPT_FILE).EQS."")
-$ THEN
-$!
-$! Figure Out If We Need An non-VAX Or A VAX Linker Option File.
-$!
-$ IF (F$GETSYI("CPU").LT.128)
-$ THEN
-$!
-$! We Need A DEC C Linker Option File For VAX.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File To Link Agianst
-! The Sharable DEC C Runtime Library.
-!
-SYS$SHARE:DECC$SHR.EXE/SHARE
-$EOD
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Create The non-VAX Linker Option File.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File For non-VAX To Link Agianst
-! The Sharable C Runtime Library.
-!
-SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
-SYS$SHARE:CMA$OPEN_RTL/SHARE
-$EOD
-$!
-$! End The DEC C Option File Check.
-$!
-$ ENDIF
-$!
-$! End The Option File Search.
-$!
-$ ENDIF
-$!
-$! End The DEC C Check.
-$!
-$ ENDIF
-$!
-$! Tell The User What Linker Option File We Are Using.
-$!
-$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
-$!
-$! Time To RETURN.
-$!
-$ RETURN
-$!
-$! Library Check.
-$!
-$ LIB_CHECK:
-$!
-$! Look For The Library LIBDES.OLB.
-$!
-$ IF (F$SEARCH(LIB_NAME).EQS."")
-$ THEN
-$!
-$! Tell The User We Can't Find The [.xxx.CRYPTO.DES]LIBDES.OLB Library.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "Can't Find The Library ",LIB_NAME,"."
-$ WRITE SYS$OUTPUT "We Can't Link Without It."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Since We Can't Link Without It, Exit.
-$!
-$ EXIT
-$ ENDIF
-$!
-$! Time To Return.
-$!
-$ RETURN
-$!
-$! Check The User's Options.
-$!
-$ CHECK_OPTIONS:
-$!
-$! Check To See If We Are To "Just Build Everything".
-$!
-$ IF (P1.EQS."ALL")
-$ THEN
-$!
-$! P1 Is "ALL", So Build Everything.
-$!
-$ BUILDALL = "TRUE"
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Else, Check To See If P1 Has A Valid Argument.
-$!
-$ IF (P1.EQS."LIBRARY").OR.(P1.EQS."DESTEST").OR.(P1.EQS."SPEED") -
- .OR.(P1.EQS."RPW").OR.(P1.EQS."DES").OR.(P1.EQS."DES_OPTS")
-$ THEN
-$!
-$! A Valid Argument.
-$!
-$ BUILDALL = P1
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Tell The User We Don't Know What They Want.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " ALL : Just Build Everything."
-$ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.CRYPTO.DES]LIBDES.OLB Library."
-$ WRITE SYS$OUTPUT " DESTEST : To Compile Just The [.xxx.EXE.CRYPTO.DES]DESTEST.EXE Program."
-$ WRITE SYS$OUTPUT " SPEED : To Compile Just The [.xxx.EXE.CRYPTO.DES]SPEED.EXE Program."
-$ WRITE SYS$OUTPUT " RPW : To Compile Just The [.xxx.EXE.CRYPTO.DES]RPW.EXE Program."
-$ WRITE SYS$OUTPUT " DES : To Compile Just The [.xxx.EXE.CRYPTO.DES]DES.EXE Program."
-$ WRITE SYS$OUTPUT " DES_OPTS : To Compile Just The [.xxx.EXE.CRYTPO.DES]DES_OPTS.EXE Program."
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " Where 'xxx' Stands For: "
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " ALPHA : Alpha Architecture."
-$ WRITE SYS$OUTPUT " IA64 : IA64 Architecture."
-$ WRITE SYS$OUTPUT " VAX : VAX Architecture."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$! End The Valid Argument Check.
-$!
-$ ENDIF
-$!
-$! End The P1 Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Are To Compile Without Debugger Information.
-$!
-$ IF (P2.EQS."NODEBUG")
-$ THEN
-$!
-$! P2 Is Blank, So Compile Without Debugger Information.
-$!
-$ DEBUGGER = "NODEBUG"
-$ TRACEBACK = "NOTRACEBACK"
-$ GCC_OPTIMIZE = "OPTIMIZE"
-$ CC_OPTIMIZE = "OPTIMIZE"
-$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
-$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Check To See If We Are To Compile With Debugger Information.
-$!
-$ IF (P2.EQS."DEBUG")
-$ THEN
-$!
-$! Compile With Debugger Information.
-$!
-$ DEBUGGER = "DEBUG"
-$ TRACEBACK = "TRACEBACK"
-$ GCC_OPTIMIZE = "NOOPTIMIZE"
-$ CC_OPTIMIZE = "NOOPTIMIZE"
-$ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
-$ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Tell The User Entered An Invalid Option..
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
-$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$! End The Valid Argument Check.
-$!
-$ ENDIF
-$!
-$! End The P2 Check.
-$!
-$ ENDIF
-$!
-$! Special Threads For OpenVMS v7.1 Or Later.
-$!
-$! Written By: Richard Levitte
-$! richard@levitte.org
-$!
-$!
-$! Check To See If We Have A Option For P4.
-$!
-$ IF (P4.EQS."")
-$ THEN
-$!
-$! Get The Version Of VMS We Are Using.
-$!
-$ ISSEVEN := ""
-$ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
-$ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
-$!
-$! Check To See If The VMS Version Is v7.1 Or Later.
-$!
-$ IF (TMP.GE.71)
-$ THEN
-$!
-$! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
-$!
-$ ISSEVEN := ,PTHREAD_USE_D4
-$!
-$! End The VMS Version Check.
-$!
-$ ENDIF
-$!
-$! End The P4 Check.
-$!
-$ ENDIF
-$!
-$! Check To See If P3 Is Blank.
-$!
-$ IF (P3.EQS."")
-$ THEN
-$!
-$! O.K., The User Didn't Specify A Compiler, Let's Try To
-$! Find Out Which One To Use.
-$!
-$! Check To See If We Have GNU C.
-$!
-$ IF (F$TRNLNM("GNU_CC").NES."")
-$ THEN
-$!
-$! Looks Like GNUC, Set To Use GNUC.
-$!
-$ P3 = "GNUC"
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Check To See If We Have VAXC Or DECC.
-$!
-$ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
-$ THEN
-$!
-$! Looks Like DECC, Set To Use DECC.
-$!
-$ P3 = "DECC"
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Looks Like VAXC, Set To Use VAXC.
-$!
-$ P3 = "VAXC"
-$!
-$! End The VAXC Compiler Check.
-$!
-$ ENDIF
-$!
-$! End The DECC & VAXC Compiler Check.
-$!
-$ ENDIF
-$!
-$! End The Compiler Check.
-$!
-$ ENDIF
-$!
-$! Set Up Initial CC Definitions, Possibly With User Ones
-$!
-$ CCDEFS = ""
-$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = USER_CCDEFS
-$ CCEXTRAFLAGS = ""
-$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
-$ CCDISABLEWARNINGS = ""
-$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
- CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS
-$!
-$! Check To See If The User Entered A Valid Paramter.
-$!
-$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
-$ THEN
-$!
-$! Check To See If The User Wanted DECC.
-$!
-$ IF (P3.EQS."DECC")
-$ THEN
-$!
-$! Looks Like DECC, Set To Use DECC.
-$!
-$ COMPILER = "DECC"
-$!
-$! Tell The User We Are Using DECC.
-$!
-$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
-$!
-$! Use DECC...
-$!
-$ CC = "CC"
-$ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
- THEN CC = "CC/DECC"
-$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
- "/NOLIST/PREFIX=ALL" + CCEXTRAFLAGS
-$!
-$! Define The Linker Options File Name.
-$!
-$ OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT"
-$!
-$! End DECC Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Are To Use VAXC.
-$!
-$ IF (P3.EQS."VAXC")
-$ THEN
-$!
-$! Looks Like VAXC, Set To Use VAXC.
-$!
-$ COMPILER = "VAXC"
-$!
-$! Tell The User We Are Using VAX C.
-$!
-$ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
-$!
-$! Compile Using VAXC.
-$!
-$ CC = "CC"
-$ IF ARCH.NES."VAX"
-$ THEN
-$ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
-$ EXIT
-$ ENDIF
-$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
-$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS
-$ CCDEFS = """VAXC""," + CCDEFS
-$!
-$! Define <sys> As SYS$COMMON:[SYSLIB]
-$!
-$ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
-$!
-$! Define The Linker Options File Name.
-$!
-$ OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT"
-$!
-$! End VAXC Check
-$!
-$ ENDIF
-$!
-$! Check To See If We Are To Use GNU C.
-$!
-$ IF (P3.EQS."GNUC")
-$ THEN
-$!
-$! Looks Like GNUC, Set To Use GNUC.
-$!
-$ COMPILER = "GNUC"
-$!
-$! Tell The User We Are Using GNUC.
-$!
-$ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
-$!
-$! Use GNU C...
-$!
-$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS
-$!
-$! Define The Linker Options File Name.
-$!
-$ OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT"
-$!
-$! End The GNU C Check.
-$!
-$ ENDIF
-$!
-$! Set up default defines
-$!
-$ CCDEFS = """FLAT_INC=1""," + CCDEFS
-$!
-$! Finish up the definition of CC.
-$!
-$ IF COMPILER .EQS. "DECC"
-$ THEN
-$ IF CCDISABLEWARNINGS .EQS. ""
-$ THEN
-$ CC4DISABLEWARNINGS = "DOLLARID"
-$ ELSE
-$ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
-$ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
-$ ENDIF
-$ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
-$ ELSE
-$ CCDISABLEWARNINGS = ""
-$ CC4DISABLEWARNINGS = ""
-$ ENDIF
-$ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
-$!
-$! Show user the result
-$!
-$ WRITE SYS$OUTPUT "Main Compiling Command: ",CC
-$!
-$! Else The User Entered An Invalid Argument.
-$!
-$ ELSE
-$!
-$! Tell The User We Don't Know What They Want.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
-$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
-$ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$! End The P3 Check.
-$!
-$ ENDIF
-$!
-$! Time To RETURN...
-$!
-$ RETURN
diff --git a/thirdparty/openssl/crypto/des/des.c b/thirdparty/openssl/crypto/des/des.c
index 586aed7237..d7374382d8 100644
--- a/thirdparty/openssl/crypto/des/des.c
+++ b/thirdparty/openssl/crypto/des/des.c
@@ -456,7 +456,7 @@ void doencryption(void)
len = l - rem;
if (feof(DES_IN)) {
for (i = 7 - rem; i > 0; i--) {
- if (RAND_pseudo_bytes(buf + l++, 1) < 0)
+ if (RAND_bytes(buf + l++, 1) <= 0)
goto problems;
}
buf[l++] = rem;
diff --git a/thirdparty/openssl/crypto/des/enc_writ.c b/thirdparty/openssl/crypto/des/enc_writ.c
index bfaabde516..c2aaa8e98c 100644
--- a/thirdparty/openssl/crypto/des/enc_writ.c
+++ b/thirdparty/openssl/crypto/des/enc_writ.c
@@ -135,7 +135,7 @@ int DES_enc_write(int fd, const void *_buf, int len,
if (len < 8) {
cp = shortbuf;
memcpy(shortbuf, buf, len);
- if (RAND_pseudo_bytes(shortbuf + len, 8 - len) < 0) {
+ if (RAND_bytes(shortbuf + len, 8 - len) <= 0) {
return -1;
}
rnum = 8;
diff --git a/thirdparty/openssl/crypto/des/makefile.bc b/thirdparty/openssl/crypto/des/makefile.bc
deleted file mode 100644
index 1fe6d4915a..0000000000
--- a/thirdparty/openssl/crypto/des/makefile.bc
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Origional BC Makefile from Teun <Teun.Nijssen@kub.nl>
-#
-#
-CC = bcc
-TLIB = tlib /0 /C
-# note: the -3 flag produces code for 386, 486, Pentium etc; omit it for 286s
-OPTIMIZE= -3 -O2
-#WINDOWS= -W
-CFLAGS = -c -ml -d $(OPTIMIZE) $(WINDOWS) -DMSDOS
-LFLAGS = -ml $(WINDOWS)
-
-.c.obj:
- $(CC) $(CFLAGS) $*.c
-
-.obj.exe:
- $(CC) $(LFLAGS) -e$*.exe $*.obj libdes.lib
-
-all: $(LIB) destest.exe rpw.exe des.exe speed.exe
-
-# "make clean": use a directory containing only libdes .exe and .obj files...
-clean:
- del *.exe
- del *.obj
- del libdes.lib
- del libdes.rsp
-
-OBJS= cbc_cksm.obj cbc_enc.obj ecb_enc.obj pcbc_enc.obj \
- qud_cksm.obj rand_key.obj set_key.obj str2key.obj \
- enc_read.obj enc_writ.obj fcrypt.obj cfb_enc.obj \
- ecb3_enc.obj ofb_enc.obj cbc3_enc.obj read_pwd.obj\
- cfb64enc.obj ofb64enc.obj ede_enc.obj cfb64ede.obj\
- ofb64ede.obj supp.obj
-
-LIB= libdes.lib
-
-$(LIB): $(OBJS)
- del $(LIB)
- makersp "+%s &\n" &&|
- $(OBJS)
-| >libdes.rsp
- $(TLIB) libdes.lib @libdes.rsp,nul
- del libdes.rsp
-
-destest.exe: destest.obj libdes.lib
-rpw.exe: rpw.obj libdes.lib
-speed.exe: speed.obj libdes.lib
-des.exe: des.obj libdes.lib
-
-
diff --git a/thirdparty/openssl/crypto/des/set_key.c b/thirdparty/openssl/crypto/des/set_key.c
index 8fd8fe14bb..d9c5e7fcb3 100644
--- a/thirdparty/openssl/crypto/des/set_key.c
+++ b/thirdparty/openssl/crypto/des/set_key.c
@@ -120,7 +120,7 @@ int DES_check_key_parity(const_DES_cblock *key)
}
/*-
- * Weak and semi week keys as take from
+ * Weak and semi weak keys as taken from
* %A D.W. Davies
* %A W.L. Price
* %T Security for Computer Networks
diff --git a/thirdparty/openssl/crypto/des/t/test b/thirdparty/openssl/crypto/des/t/test
deleted file mode 100644
index 97acd0552e..0000000000
--- a/thirdparty/openssl/crypto/des/t/test
+++ /dev/null
@@ -1,27 +0,0 @@
-#!./perl
-
-BEGIN { push(@INC, qw(../../../lib ../../lib ../lib lib)); }
-
-use DES;
-
-$key='00000000';
-$ks=DES::set_key($key);
-@a=split(//,$ks);
-foreach (@a) { printf "%02x-",ord($_); }
-print "\n";
-
-
-$key=DES::random_key();
-print "($_)\n";
-@a=split(//,$key);
-foreach (@a) { printf "%02x-",ord($_); }
-print "\n";
-$str="this is and again into the breach";
-($k1,$k2)=DES::string_to_2keys($str);
-@a=split(//,$k1);
-foreach (@a) { printf "%02x-",ord($_); }
-print "\n";
-@a=split(//,$k2);
-foreach (@a) { printf "%02x-",ord($_); }
-print "\n";
-
diff --git a/thirdparty/openssl/crypto/des/times/486-50.sol b/thirdparty/openssl/crypto/des/times/486-50.sol
deleted file mode 100644
index 0de62d6db3..0000000000
--- a/thirdparty/openssl/crypto/des/times/486-50.sol
+++ /dev/null
@@ -1,16 +0,0 @@
-Solaris 2.4, 486 50mhz, gcc 2.6.3
-options des ecb/s
-16 r2 i 43552.51 100.0%
-16 r1 i 43487.45 99.9%
-16 c p 43003.23 98.7%
-16 r2 p 42339.00 97.2%
-16 c i 41900.91 96.2%
-16 r1 p 41360.64 95.0%
- 4 c i 38728.48 88.9%
- 4 c p 38225.63 87.8%
- 4 r1 i 38085.79 87.4%
- 4 r2 i 37825.64 86.9%
- 4 r2 p 34611.00 79.5%
- 4 r1 p 31802.00 73.0%
--DDES_UNROLL -DDES_RISC2
-
diff --git a/thirdparty/openssl/crypto/des/times/586-100.lnx b/thirdparty/openssl/crypto/des/times/586-100.lnx
deleted file mode 100644
index 4323914a11..0000000000
--- a/thirdparty/openssl/crypto/des/times/586-100.lnx
+++ /dev/null
@@ -1,20 +0,0 @@
-Pentium 100
-Linux 2 kernel
-gcc 2.7.0 -O3 -fomit-frame-pointer
-No X server running, just a console, it makes the top speed jump from 151,000
-to 158,000 :-).
-options des ecb/s
-assember 281000.00 177.1%
-16 r1 p 158667.40 100.0%
-16 r1 i 148471.70 93.6%
-16 r2 p 143961.80 90.7%
-16 r2 i 141689.20 89.3%
- 4 r1 i 140100.00 88.3%
- 4 r2 i 134049.40 84.5%
-16 c i 124145.20 78.2%
-16 c p 121584.20 76.6%
- 4 c i 118116.00 74.4%
- 4 r2 p 117977.90 74.4%
- 4 c p 114971.40 72.5%
- 4 r1 p 114578.40 72.2%
--DDES_UNROLL -DDES_RISC1 -DDES_PTR
diff --git a/thirdparty/openssl/crypto/des/times/686-200.fre b/thirdparty/openssl/crypto/des/times/686-200.fre
deleted file mode 100644
index 7d83f6adee..0000000000
--- a/thirdparty/openssl/crypto/des/times/686-200.fre
+++ /dev/null
@@ -1,18 +0,0 @@
-Pentium 100
-Free BSD 2.1.5 kernel
-gcc 2.7.2.2 -O3 -fomit-frame-pointer
-options des ecb/s
-assember 578000.00 133.1%
-16 r2 i 434454.80 100.0%
-16 r1 i 433621.43 99.8%
-16 r2 p 431375.69 99.3%
- 4 r1 i 423722.30 97.5%
- 4 r2 i 422399.40 97.2%
-16 r1 p 421739.40 97.1%
-16 c i 399027.94 91.8%
-16 c p 372251.70 85.7%
- 4 c i 365118.35 84.0%
- 4 c p 352880.51 81.2%
- 4 r2 p 255104.90 58.7%
- 4 r1 p 251289.18 57.8%
--DDES_UNROLL -DDES_RISC2
diff --git a/thirdparty/openssl/crypto/des/times/sparc.gcc b/thirdparty/openssl/crypto/des/times/sparc.gcc
deleted file mode 100644
index 8eaa042104..0000000000
--- a/thirdparty/openssl/crypto/des/times/sparc.gcc
+++ /dev/null
@@ -1,17 +0,0 @@
-solaris 2.5.1 - sparc 10 50mhz - gcc 2.7.2
-
-options des ecb/s
-16 c i 124382.70 100.0%
- 4 c i 118884.68 95.6%
-16 c p 112261.20 90.3%
-16 r2 i 111777.10 89.9%
-16 r2 p 108896.30 87.5%
-16 r1 p 108791.59 87.5%
- 4 c p 107290.10 86.3%
- 4 r1 p 104583.80 84.1%
-16 r1 i 104206.20 83.8%
- 4 r2 p 103709.80 83.4%
- 4 r2 i 98306.43 79.0%
- 4 r1 i 91525.80 73.6%
--DDES_UNROLL
-
diff --git a/thirdparty/openssl/crypto/dh/dh_ameth.c b/thirdparty/openssl/crypto/dh/dh_ameth.c
index ac72468bd1..4558283576 100644
--- a/thirdparty/openssl/crypto/dh/dh_ameth.c
+++ b/thirdparty/openssl/crypto/dh/dh_ameth.c
@@ -519,7 +519,7 @@ static int dh_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from)
static int dh_missing_parameters(const EVP_PKEY *a)
{
- if (!a->pkey.dh->p || !a->pkey.dh->g)
+ if (a->pkey.dh == NULL || a->pkey.dh->p == NULL || a->pkey.dh->g == NULL)
return 1;
return 0;
}
diff --git a/thirdparty/openssl/crypto/dh/dh_key.c b/thirdparty/openssl/crypto/dh/dh_key.c
index 1d80fb2c5f..387558f146 100644
--- a/thirdparty/openssl/crypto/dh/dh_key.c
+++ b/thirdparty/openssl/crypto/dh/dh_key.c
@@ -223,6 +223,8 @@ static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
goto err;
BN_CTX_start(ctx);
tmp = BN_CTX_get(ctx);
+ if (tmp == NULL)
+ goto err;
if (dh->priv_key == NULL) {
DHerr(DH_F_COMPUTE_KEY, DH_R_NO_PRIVATE_VALUE);
diff --git a/thirdparty/openssl/crypto/dsa/dsa_ameth.c b/thirdparty/openssl/crypto/dsa/dsa_ameth.c
index cc83d6e6ad..c4fa105747 100644
--- a/thirdparty/openssl/crypto/dsa/dsa_ameth.c
+++ b/thirdparty/openssl/crypto/dsa/dsa_ameth.c
@@ -350,7 +350,7 @@ static int dsa_missing_parameters(const EVP_PKEY *pkey)
{
DSA *dsa;
dsa = pkey->pkey.dsa;
- if ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))
+ if (dsa == NULL || dsa->p == NULL || dsa->q == NULL || dsa->g == NULL)
return 1;
return 0;
}
diff --git a/thirdparty/openssl/crypto/dsa/dsa_gen.c b/thirdparty/openssl/crypto/dsa/dsa_gen.c
index 15f3bb4f3f..1fce0f81c2 100644
--- a/thirdparty/openssl/crypto/dsa/dsa_gen.c
+++ b/thirdparty/openssl/crypto/dsa/dsa_gen.c
@@ -185,6 +185,9 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
p = BN_CTX_get(ctx);
test = BN_CTX_get(ctx);
+ if (test == NULL)
+ goto err;
+
if (!BN_lshift(test, BN_value_one(), bits - 1))
goto err;
@@ -197,7 +200,7 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
goto err;
if (!seed_len || !seed_in) {
- if (RAND_pseudo_bytes(seed, qsize) < 0)
+ if (RAND_bytes(seed, qsize) <= 0)
goto err;
seed_is_random = 1;
} else {
@@ -491,7 +494,7 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N,
goto err;
if (!seed_in) {
- if (RAND_pseudo_bytes(seed, seed_len) < 0)
+ if (RAND_bytes(seed, seed_len) <= 0)
goto err;
}
/* step 2 */
diff --git a/thirdparty/openssl/crypto/dsa/dsa_ossl.c b/thirdparty/openssl/crypto/dsa/dsa_ossl.c
index efc4f1b6ae..58013a4a13 100644
--- a/thirdparty/openssl/crypto/dsa/dsa_ossl.c
+++ b/thirdparty/openssl/crypto/dsa/dsa_ossl.c
@@ -247,11 +247,13 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
do
if (!BN_rand_range(&k, dsa->q))
goto err;
- while (BN_is_zero(&k)) ;
+ while (BN_is_zero(&k));
+
if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0) {
BN_set_flags(&k, BN_FLG_CONSTTIME);
}
+
if (dsa->flags & DSA_FLAG_CACHE_MONT_P) {
if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p,
CRYPTO_LOCK_DSA, dsa->p, ctx))
@@ -264,6 +266,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
if (!BN_copy(&kq, &k))
goto err;
+ BN_set_flags(&kq, BN_FLG_CONSTTIME);
+
/*
* We do not want timing information to leak the length of k, so we
* compute g^k using an equivalent exponent of fixed length. (This
@@ -282,6 +286,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
} else {
K = &k;
}
+
DSA_BN_MOD_EXP(goto err, dsa, r, dsa->g, K, dsa->p, ctx,
dsa->method_mont_p);
if (!BN_mod(r, r, dsa->q, ctx))
diff --git a/thirdparty/openssl/crypto/dsa/dsa_pmeth.c b/thirdparty/openssl/crypto/dsa/dsa_pmeth.c
index 42b8bb0862..78724839b5 100644
--- a/thirdparty/openssl/crypto/dsa/dsa_pmeth.c
+++ b/thirdparty/openssl/crypto/dsa/dsa_pmeth.c
@@ -180,7 +180,7 @@ static int pkey_dsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
DSAerr(DSA_F_PKEY_DSA_CTRL, DSA_R_INVALID_DIGEST_TYPE);
return 0;
}
- dctx->md = p2;
+ dctx->pmd = p2;
return 1;
case EVP_PKEY_CTRL_MD:
diff --git a/thirdparty/openssl/crypto/ec/ec2_mult.c b/thirdparty/openssl/crypto/ec/ec2_mult.c
index 68cc8771d5..1f9cc00aea 100644
--- a/thirdparty/openssl/crypto/ec/ec2_mult.c
+++ b/thirdparty/openssl/crypto/ec/ec2_mult.c
@@ -267,7 +267,7 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group,
BN_CTX *ctx)
{
BIGNUM *x1, *x2, *z1, *z2;
- int ret = 0, i;
+ int ret = 0, i, group_top;
BN_ULONG mask, word;
if (r == point) {
@@ -297,10 +297,12 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group,
x2 = &r->X;
z2 = &r->Y;
- bn_wexpand(x1, group->field.top);
- bn_wexpand(z1, group->field.top);
- bn_wexpand(x2, group->field.top);
- bn_wexpand(z2, group->field.top);
+ group_top = group->field.top;
+ if (bn_wexpand(x1, group_top) == NULL
+ || bn_wexpand(z1, group_top) == NULL
+ || bn_wexpand(x2, group_top) == NULL
+ || bn_wexpand(z2, group_top) == NULL)
+ goto err;
if (!BN_GF2m_mod_arr(x1, &point->X, group->poly))
goto err; /* x1 = x */
@@ -329,14 +331,14 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group,
for (; i >= 0; i--) {
word = scalar->d[i];
while (mask) {
- BN_consttime_swap(word & mask, x1, x2, group->field.top);
- BN_consttime_swap(word & mask, z1, z2, group->field.top);
+ BN_consttime_swap(word & mask, x1, x2, group_top);
+ BN_consttime_swap(word & mask, z1, z2, group_top);
if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx))
goto err;
if (!gf2m_Mdouble(group, x1, z1, ctx))
goto err;
- BN_consttime_swap(word & mask, x1, x2, group->field.top);
- BN_consttime_swap(word & mask, z1, z2, group->field.top);
+ BN_consttime_swap(word & mask, x1, x2, group_top);
+ BN_consttime_swap(word & mask, z1, z2, group_top);
mask >>= 1;
}
mask = BN_TBIT;
diff --git a/thirdparty/openssl/crypto/ec/ec_ameth.c b/thirdparty/openssl/crypto/ec/ec_ameth.c
index 83e208cfe4..2c41c6e7a9 100644
--- a/thirdparty/openssl/crypto/ec/ec_ameth.c
+++ b/thirdparty/openssl/crypto/ec/ec_ameth.c
@@ -66,9 +66,12 @@
#endif
#include <openssl/asn1t.h>
#include "asn1_locl.h"
+#include "ec_lcl.h"
+#ifndef OPENSSL_NO_CMS
static int ecdh_cms_decrypt(CMS_RecipientInfo *ri);
static int ecdh_cms_encrypt(CMS_RecipientInfo *ri);
+#endif
static int eckey_param2type(int *pptype, void **ppval, EC_KEY *ec_key)
{
@@ -221,6 +224,8 @@ static int eckey_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
const EC_GROUP *group = EC_KEY_get0_group(b->pkey.ec);
const EC_POINT *pa = EC_KEY_get0_public_key(a->pkey.ec),
*pb = EC_KEY_get0_public_key(b->pkey.ec);
+ if (group == NULL || pa == NULL || pb == NULL)
+ return -2;
r = EC_POINT_cmp(group, pa, pb, NULL);
if (r == 0)
return 1;
@@ -299,15 +304,13 @@ static int eckey_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
static int eckey_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
{
- EC_KEY *ec_key;
+ EC_KEY ec_key = *(pkey->pkey.ec);
unsigned char *ep, *p;
int eplen, ptype;
void *pval;
- unsigned int tmp_flags, old_flags;
+ unsigned int old_flags;
- ec_key = pkey->pkey.ec;
-
- if (!eckey_param2type(&ptype, &pval, ec_key)) {
+ if (!eckey_param2type(&ptype, &pval, &ec_key)) {
ECerr(EC_F_ECKEY_PRIV_ENCODE, EC_R_DECODE_ERROR);
return 0;
}
@@ -318,34 +321,31 @@ static int eckey_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
* do not include the parameters in the SEC1 private key see PKCS#11
* 12.11
*/
- old_flags = EC_KEY_get_enc_flags(ec_key);
- tmp_flags = old_flags | EC_PKEY_NO_PARAMETERS;
- EC_KEY_set_enc_flags(ec_key, tmp_flags);
- eplen = i2d_ECPrivateKey(ec_key, NULL);
+ old_flags = EC_KEY_get_enc_flags(&ec_key);
+ EC_KEY_set_enc_flags(&ec_key, old_flags | EC_PKEY_NO_PARAMETERS);
+
+ eplen = i2d_ECPrivateKey(&ec_key, NULL);
if (!eplen) {
- EC_KEY_set_enc_flags(ec_key, old_flags);
ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB);
return 0;
}
ep = (unsigned char *)OPENSSL_malloc(eplen);
if (!ep) {
- EC_KEY_set_enc_flags(ec_key, old_flags);
ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_MALLOC_FAILURE);
return 0;
}
p = ep;
- if (!i2d_ECPrivateKey(ec_key, &p)) {
- EC_KEY_set_enc_flags(ec_key, old_flags);
+ if (!i2d_ECPrivateKey(&ec_key, &p)) {
OPENSSL_free(ep);
ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB);
return 0;
}
- /* restore old encoding flags */
- EC_KEY_set_enc_flags(ec_key, old_flags);
if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(NID_X9_62_id_ecPublicKey), 0,
- ptype, pval, ep, eplen))
+ ptype, pval, ep, eplen)) {
+ OPENSSL_free(ep);
return 0;
+ }
return 1;
}
@@ -378,7 +378,7 @@ static int ec_bits(const EVP_PKEY *pkey)
static int ec_missing_parameters(const EVP_PKEY *pkey)
{
- if (EC_KEY_get0_group(pkey->pkey.ec) == NULL)
+ if (pkey->pkey.ec == NULL || EC_KEY_get0_group(pkey->pkey.ec) == NULL)
return 1;
return 0;
}
@@ -398,6 +398,8 @@ static int ec_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b)
{
const EC_GROUP *group_a = EC_KEY_get0_group(a->pkey.ec),
*group_b = EC_KEY_get0_group(b->pkey.ec);
+ if (group_a == NULL || group_b == NULL)
+ return -2;
if (EC_GROUP_cmp(group_a, group_b, NULL))
return 0;
else
diff --git a/thirdparty/openssl/crypto/ec/ec_asn1.c b/thirdparty/openssl/crypto/ec/ec_asn1.c
index 33abf61f44..b0cd3e1788 100644
--- a/thirdparty/openssl/crypto/ec/ec_asn1.c
+++ b/thirdparty/openssl/crypto/ec/ec_asn1.c
@@ -62,17 +62,22 @@
#include <openssl/asn1t.h>
#include <openssl/objects.h>
+#define OSSL_NELEM(x) (sizeof(x)/sizeof(x[0]))
+
int EC_GROUP_get_basis_type(const EC_GROUP *group)
{
- int i = 0;
+ int i;
if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
NID_X9_62_characteristic_two_field)
/* everything else is currently not supported */
return 0;
- while (group->poly[i] != 0)
- i++;
+ /* Find the last non-zero element of group->poly[] */
+ for (i = 0;
+ i < (int)OSSL_NELEM(group->poly) && group->poly[i] != 0;
+ i++)
+ continue;
if (i == 4)
return NID_X9_62_ppBasis;
diff --git a/thirdparty/openssl/crypto/ec/ec_key.c b/thirdparty/openssl/crypto/ec/ec_key.c
index bc94ab5661..456080ecfe 100644
--- a/thirdparty/openssl/crypto/ec/ec_key.c
+++ b/thirdparty/openssl/crypto/ec/ec_key.c
@@ -377,9 +377,9 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
return 0;
}
ctx = BN_CTX_new();
- if (!ctx)
- goto err;
-
+ if (ctx == NULL)
+ return 0;
+ BN_CTX_start(ctx);
point = EC_POINT_new(key->group);
if (!point)
@@ -432,10 +432,9 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
ok = 1;
err:
- if (ctx)
- BN_CTX_free(ctx);
- if (point)
- EC_POINT_free(point);
+ BN_CTX_end(ctx);
+ BN_CTX_free(ctx);
+ EC_POINT_free(point);
return ok;
}
diff --git a/thirdparty/openssl/crypto/ec/ec_mult.c b/thirdparty/openssl/crypto/ec/ec_mult.c
index 23b8c3089b..24ca67a6ef 100644
--- a/thirdparty/openssl/crypto/ec/ec_mult.c
+++ b/thirdparty/openssl/crypto/ec/ec_mult.c
@@ -68,10 +68,14 @@
#include "ec_lcl.h"
/*
- * This file implements the wNAF-based interleaving multi-exponentation method
- * (<URL:http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller.html#multiexp>);
- * for multiplication with precomputation, we use wNAF splitting
- * (<URL:http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller.html#fastexp>).
+ * This file implements the wNAF-based interleaving multi-exponentiation method
+ * Formerly at:
+ * http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller.html#multiexp
+ * You might now find it here:
+ * http://link.springer.com/chapter/10.1007%2F3-540-45537-X_13
+ * http://www.bmoeller.de/pdf/TI-01-08.multiexp.pdf
+ * For multiplication with precomputation, we use wNAF splitting, formerly at:
+ * http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller.html#fastexp
*/
/* structure for precomputed multiples of the generator */
diff --git a/thirdparty/openssl/crypto/ec/eck_prn.c b/thirdparty/openssl/crypto/ec/eck_prn.c
index df9b37a750..176ec1f173 100644
--- a/thirdparty/openssl/crypto/ec/eck_prn.c
+++ b/thirdparty/openssl/crypto/ec/eck_prn.c
@@ -342,7 +342,7 @@ static int print_bin(BIO *fp, const char *name, const unsigned char *buf,
size_t len, int off)
{
size_t i;
- char str[128];
+ char str[128 + 1 + 4];
if (buf == NULL)
return 1;
diff --git a/thirdparty/openssl/crypto/ec/ecp_nistz256.c b/thirdparty/openssl/crypto/ec/ecp_nistz256.c
index ca44d0aaee..99b8d613c8 100644
--- a/thirdparty/openssl/crypto/ec/ecp_nistz256.c
+++ b/thirdparty/openssl/crypto/ec/ecp_nistz256.c
@@ -82,19 +82,36 @@ typedef struct ec_pre_comp_st {
} EC_PRE_COMP;
/* Functions implemented in assembly */
+/*
+ * Most of below mentioned functions *preserve* the property of inputs
+ * being fully reduced, i.e. being in [0, modulus) range. Simply put if
+ * inputs are fully reduced, then output is too. Note that reverse is
+ * not true, in sense that given partially reduced inputs output can be
+ * either, not unlikely reduced. And "most" in first sentence refers to
+ * the fact that given the calculations flow one can tolerate that
+ * addition, 1st function below, produces partially reduced result *if*
+ * multiplications by 2 and 3, which customarily use addition, fully
+ * reduce it. This effectively gives two options: a) addition produces
+ * fully reduced result [as long as inputs are, just like remaining
+ * functions]; b) addition is allowed to produce partially reduced
+ * result, but multiplications by 2 and 3 perform additional reduction
+ * step. Choice between the two can be platform-specific, but it was a)
+ * in all cases so far...
+ */
+/* Modular add: res = a+b mod P */
+void ecp_nistz256_add(BN_ULONG res[P256_LIMBS],
+ const BN_ULONG a[P256_LIMBS],
+ const BN_ULONG b[P256_LIMBS]);
/* Modular mul by 2: res = 2*a mod P */
void ecp_nistz256_mul_by_2(BN_ULONG res[P256_LIMBS],
const BN_ULONG a[P256_LIMBS]);
-/* Modular div by 2: res = a/2 mod P */
-void ecp_nistz256_div_by_2(BN_ULONG res[P256_LIMBS],
- const BN_ULONG a[P256_LIMBS]);
/* Modular mul by 3: res = 3*a mod P */
void ecp_nistz256_mul_by_3(BN_ULONG res[P256_LIMBS],
const BN_ULONG a[P256_LIMBS]);
-/* Modular add: res = a+b mod P */
-void ecp_nistz256_add(BN_ULONG res[P256_LIMBS],
- const BN_ULONG a[P256_LIMBS],
- const BN_ULONG b[P256_LIMBS]);
+
+/* Modular div by 2: res = a/2 mod P */
+void ecp_nistz256_div_by_2(BN_ULONG res[P256_LIMBS],
+ const BN_ULONG a[P256_LIMBS]);
/* Modular sub: res = a-b mod P */
void ecp_nistz256_sub(BN_ULONG res[P256_LIMBS],
const BN_ULONG a[P256_LIMBS],
@@ -205,21 +222,29 @@ static BN_ULONG is_equal(const BN_ULONG a[P256_LIMBS],
return is_zero(res);
}
-static BN_ULONG is_one(const BN_ULONG a[P256_LIMBS])
+static BN_ULONG is_one(const BIGNUM *z)
{
- BN_ULONG res;
-
- res = a[0] ^ ONE[0];
- res |= a[1] ^ ONE[1];
- res |= a[2] ^ ONE[2];
- res |= a[3] ^ ONE[3];
- if (P256_LIMBS == 8) {
- res |= a[4] ^ ONE[4];
- res |= a[5] ^ ONE[5];
- res |= a[6] ^ ONE[6];
+ BN_ULONG res = 0;
+ BN_ULONG *a = z->d;
+
+ if (z->top == (P256_LIMBS - P256_LIMBS / 8)) {
+ res = a[0] ^ ONE[0];
+ res |= a[1] ^ ONE[1];
+ res |= a[2] ^ ONE[2];
+ res |= a[3] ^ ONE[3];
+ if (P256_LIMBS == 8) {
+ res |= a[4] ^ ONE[4];
+ res |= a[5] ^ ONE[5];
+ res |= a[6] ^ ONE[6];
+ /*
+ * no check for a[7] (being zero) on 32-bit platforms,
+ * because value of "one" takes only 7 limbs.
+ */
+ }
+ res = is_zero(res);
}
- return is_zero(res);
+ return res;
}
static int ecp_nistz256_set_words(BIGNUM *a, BN_ULONG words[P256_LIMBS])
@@ -315,19 +340,16 @@ static void ecp_nistz256_point_add(P256_POINT *r,
const BN_ULONG *in2_y = b->Y;
const BN_ULONG *in2_z = b->Z;
- /* We encode infinity as (0,0), which is not on the curve,
- * so it is OK. */
- in1infty = (in1_x[0] | in1_x[1] | in1_x[2] | in1_x[3] |
- in1_y[0] | in1_y[1] | in1_y[2] | in1_y[3]);
+ /*
+ * Infinity in encoded as (,,0)
+ */
+ in1infty = (in1_z[0] | in1_z[1] | in1_z[2] | in1_z[3]);
if (P256_LIMBS == 8)
- in1infty |= (in1_x[4] | in1_x[5] | in1_x[6] | in1_x[7] |
- in1_y[4] | in1_y[5] | in1_y[6] | in1_y[7]);
+ in1infty |= (in1_z[4] | in1_z[5] | in1_z[6] | in1_z[7]);
- in2infty = (in2_x[0] | in2_x[1] | in2_x[2] | in2_x[3] |
- in2_y[0] | in2_y[1] | in2_y[2] | in2_y[3]);
+ in2infty = (in2_z[0] | in2_z[1] | in2_z[2] | in2_z[3]);
if (P256_LIMBS == 8)
- in2infty |= (in2_x[4] | in2_x[5] | in2_x[6] | in2_x[7] |
- in2_y[4] | in2_y[5] | in2_y[6] | in2_y[7]);
+ in2infty |= (in2_z[4] | in2_z[5] | in2_z[6] | in2_z[7]);
in1infty = is_zero(in1infty);
in2infty = is_zero(in2infty);
@@ -416,15 +438,16 @@ static void ecp_nistz256_point_add_affine(P256_POINT *r,
const BN_ULONG *in2_y = b->Y;
/*
- * In affine representation we encode infty as (0,0), which is not on the
- * curve, so it is OK
+ * Infinity in encoded as (,,0)
*/
- in1infty = (in1_x[0] | in1_x[1] | in1_x[2] | in1_x[3] |
- in1_y[0] | in1_y[1] | in1_y[2] | in1_y[3]);
+ in1infty = (in1_z[0] | in1_z[1] | in1_z[2] | in1_z[3]);
if (P256_LIMBS == 8)
- in1infty |= (in1_x[4] | in1_x[5] | in1_x[6] | in1_x[7] |
- in1_y[4] | in1_y[5] | in1_y[6] | in1_y[7]);
+ in1infty |= (in1_z[4] | in1_z[5] | in1_z[6] | in1_z[7]);
+ /*
+ * In affine representation we encode infinity as (0,0), which is
+ * not on the curve, so it is OK
+ */
in2infty = (in2_x[0] | in2_x[1] | in2_x[2] | in2_x[3] |
in2_y[0] | in2_y[1] | in2_y[2] | in2_y[3]);
if (P256_LIMBS == 8)
@@ -741,9 +764,8 @@ static int ecp_nistz256_is_affine_G(const EC_POINT *generator)
{
return (generator->X.top == P256_LIMBS) &&
(generator->Y.top == P256_LIMBS) &&
- (generator->Z.top == (P256_LIMBS - P256_LIMBS / 8)) &&
is_equal(generator->X.d, def_xG) &&
- is_equal(generator->Y.d, def_yG) && is_one(generator->Z.d);
+ is_equal(generator->Y.d, def_yG) && is_one(&generator->Z);
}
static int ecp_nistz256_mult_precompute(EC_GROUP *group, BN_CTX *ctx)
@@ -1249,6 +1271,8 @@ static int ecp_nistz256_points_mul(const EC_GROUP *group,
} else
#endif
{
+ BN_ULONG infty;
+
/* First window */
wvalue = (p_str[0] << 1) & mask;
index += window_size;
@@ -1260,7 +1284,30 @@ static int ecp_nistz256_points_mul(const EC_GROUP *group,
ecp_nistz256_neg(p.p.Z, p.p.Y);
copy_conditional(p.p.Y, p.p.Z, wvalue & 1);
- memcpy(p.p.Z, ONE, sizeof(ONE));
+ /*
+ * Since affine infinity is encoded as (0,0) and
+ * Jacobian ias (,,0), we need to harmonize them
+ * by assigning "one" or zero to Z.
+ */
+ infty = (p.p.X[0] | p.p.X[1] | p.p.X[2] | p.p.X[3] |
+ p.p.Y[0] | p.p.Y[1] | p.p.Y[2] | p.p.Y[3]);
+ if (P256_LIMBS == 8)
+ infty |= (p.p.X[4] | p.p.X[5] | p.p.X[6] | p.p.X[7] |
+ p.p.Y[4] | p.p.Y[5] | p.p.Y[6] | p.p.Y[7]);
+
+ infty = 0 - is_zero(infty);
+ infty = ~infty;
+
+ p.p.Z[0] = ONE[0] & infty;
+ p.p.Z[1] = ONE[1] & infty;
+ p.p.Z[2] = ONE[2] & infty;
+ p.p.Z[3] = ONE[3] & infty;
+ if (P256_LIMBS == 8) {
+ p.p.Z[4] = ONE[4] & infty;
+ p.p.Z[5] = ONE[5] & infty;
+ p.p.Z[6] = ONE[6] & infty;
+ p.p.Z[7] = ONE[7] & infty;
+ }
for (i = 1; i < 37; i++) {
unsigned int off = (index - 1) / 8;
@@ -1331,7 +1378,7 @@ static int ecp_nistz256_points_mul(const EC_GROUP *group,
!ecp_nistz256_set_words(&r->Z, p.p.Z)) {
goto err;
}
- r->Z_is_one = is_one(p.p.Z) & 1;
+ r->Z_is_one = is_one(&r->Z) & 1;
ret = 1;
diff --git a/thirdparty/openssl/crypto/ecdh/ech_ossl.c b/thirdparty/openssl/crypto/ecdh/ech_ossl.c
index df115cc262..d3b05247fe 100644
--- a/thirdparty/openssl/crypto/ecdh/ech_ossl.c
+++ b/thirdparty/openssl/crypto/ecdh/ech_ossl.c
@@ -212,7 +212,9 @@ static int ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
BN_CTX_end(ctx);
if (ctx)
BN_CTX_free(ctx);
- if (buf)
+ if (buf) {
+ OPENSSL_cleanse(buf, buflen);
OPENSSL_free(buf);
+ }
return (ret);
}
diff --git a/thirdparty/openssl/crypto/engine/eng_cryptodev.c b/thirdparty/openssl/crypto/engine/eng_cryptodev.c
index 8fb9c3373d..af59471c47 100644
--- a/thirdparty/openssl/crypto/engine/eng_cryptodev.c
+++ b/thirdparty/openssl/crypto/engine/eng_cryptodev.c
@@ -26,6 +26,7 @@
*
*/
+#include <string.h>
#include <openssl/objects.h>
#include <openssl/engine.h>
#include <openssl/evp.h>
@@ -809,14 +810,15 @@ static int cryptodev_digest_update(EVP_MD_CTX *ctx, const void *data,
if (!(ctx->flags & EVP_MD_CTX_FLAG_ONESHOT)) {
/* if application doesn't support one buffer */
- state->mac_data =
+ char *mac_data =
OPENSSL_realloc(state->mac_data, state->mac_len + count);
- if (!state->mac_data) {
+ if (mac_data == NULL) {
printf("cryptodev_digest_update: realloc failed\n");
return (0);
}
+ state->mac_data = mac_data;
memcpy(state->mac_data + state->mac_len, data, count);
state->mac_len += count;
@@ -934,11 +936,15 @@ static int cryptodev_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
return (0);
}
+ dstate->mac_len = fstate->mac_len;
if (fstate->mac_len != 0) {
if (fstate->mac_data != NULL) {
dstate->mac_data = OPENSSL_malloc(fstate->mac_len);
+ if (dstate->mac_data == NULL) {
+ printf("cryptodev_digest_init: malloc failed\n");
+ return 0;
+ }
memcpy(dstate->mac_data, fstate->mac_data, fstate->mac_len);
- dstate->mac_len = fstate->mac_len;
}
}
@@ -1064,8 +1070,7 @@ static void zapparams(struct crypt_kop *kop)
int i;
for (i = 0; i < kop->crk_iparams + kop->crk_oparams; i++) {
- if (kop->crk_param[i].crp_p)
- free(kop->crk_param[i].crp_p);
+ OPENSSL_free(kop->crk_param[i].crp_p);
kop->crk_param[i].crp_p = NULL;
kop->crk_param[i].crp_nbits = 0;
}
@@ -1078,16 +1083,25 @@ cryptodev_asym(struct crypt_kop *kop, int rlen, BIGNUM *r, int slen,
int fd, ret = -1;
if ((fd = get_asym_dev_crypto()) < 0)
- return (ret);
+ return ret;
if (r) {
- kop->crk_param[kop->crk_iparams].crp_p = calloc(rlen, sizeof(char));
+ kop->crk_param[kop->crk_iparams].crp_p = OPENSSL_malloc(rlen);
+ if (kop->crk_param[kop->crk_iparams].crp_p == NULL)
+ return ret;
+ memset(kop->crk_param[kop->crk_iparams].crp_p, 0, (size_t)rlen);
kop->crk_param[kop->crk_iparams].crp_nbits = rlen * 8;
kop->crk_oparams++;
}
if (s) {
- kop->crk_param[kop->crk_iparams + 1].crp_p =
- calloc(slen, sizeof(char));
+ kop->crk_param[kop->crk_iparams + 1].crp_p = OPENSSL_malloc(slen);
+ /* No need to free the kop->crk_iparams parameter if it was allocated,
+ * callers of this routine have to free allocated parameters through
+ * zapparams both in case of success and failure
+ */
+ if (kop->crk_param[kop->crk_iparams+1].crp_p == NULL)
+ return ret;
+ memset(kop->crk_param[kop->crk_iparams + 1].crp_p, 0, (size_t)slen);
kop->crk_param[kop->crk_iparams + 1].crp_nbits = slen * 8;
kop->crk_oparams++;
}
@@ -1100,7 +1114,7 @@ cryptodev_asym(struct crypt_kop *kop, int rlen, BIGNUM *r, int slen,
ret = 0;
}
- return (ret);
+ return ret;
}
static int
diff --git a/thirdparty/openssl/crypto/err/err.c b/thirdparty/openssl/crypto/err/err.c
index e77d963b6b..0b1fcfc1f1 100644
--- a/thirdparty/openssl/crypto/err/err.c
+++ b/thirdparty/openssl/crypto/err/err.c
@@ -172,6 +172,7 @@ static ERR_STRING_DATA ERR_str_functs[] = {
# endif
{ERR_PACK(0, SYS_F_OPENDIR, 0), "opendir"},
{ERR_PACK(0, SYS_F_FREAD, 0), "fread"},
+ {ERR_PACK(0, SYS_F_FFLUSH, 0), "fflush"},
{0, NULL},
};
@@ -868,6 +869,9 @@ void ERR_error_string_n(unsigned long e, char *buf, size_t len)
const char *ls, *fs, *rs;
unsigned long l, f, r;
+ if (len == 0)
+ return;
+
l = ERR_GET_LIB(e);
f = ERR_GET_FUNC(e);
r = ERR_GET_REASON(e);
diff --git a/thirdparty/openssl/crypto/err/openssl.ec b/thirdparty/openssl/crypto/err/openssl.ec
deleted file mode 100644
index 139afe3234..0000000000
--- a/thirdparty/openssl/crypto/err/openssl.ec
+++ /dev/null
@@ -1,98 +0,0 @@
-# crypto/err/openssl.ec
-
-# configuration file for util/mkerr.pl
-
-# files that may have to be rewritten by util/mkerr.pl
-L ERR NONE NONE
-L BN crypto/bn/bn.h crypto/bn/bn_err.c
-L RSA crypto/rsa/rsa.h crypto/rsa/rsa_err.c
-L DH crypto/dh/dh.h crypto/dh/dh_err.c
-L EVP crypto/evp/evp.h crypto/evp/evp_err.c
-L BUF crypto/buffer/buffer.h crypto/buffer/buf_err.c
-L OBJ crypto/objects/objects.h crypto/objects/obj_err.c
-L PEM crypto/pem/pem.h crypto/pem/pem_err.c
-L DSA crypto/dsa/dsa.h crypto/dsa/dsa_err.c
-L X509 crypto/x509/x509.h crypto/x509/x509_err.c
-L ASN1 crypto/asn1/asn1.h crypto/asn1/asn1_err.c
-L CONF crypto/conf/conf.h crypto/conf/conf_err.c
-L CRYPTO crypto/crypto.h crypto/cpt_err.c
-L EC crypto/ec/ec.h crypto/ec/ec_err.c
-L SSL ssl/ssl.h ssl/ssl_err.c
-L BIO crypto/bio/bio.h crypto/bio/bio_err.c
-L PKCS7 crypto/pkcs7/pkcs7.h crypto/pkcs7/pkcs7err.c
-L X509V3 crypto/x509v3/x509v3.h crypto/x509v3/v3err.c
-L PKCS12 crypto/pkcs12/pkcs12.h crypto/pkcs12/pk12err.c
-L RAND crypto/rand/rand.h crypto/rand/rand_err.c
-L DSO crypto/dso/dso.h crypto/dso/dso_err.c
-L ENGINE crypto/engine/engine.h crypto/engine/eng_err.c
-L OCSP crypto/ocsp/ocsp.h crypto/ocsp/ocsp_err.c
-L UI crypto/ui/ui.h crypto/ui/ui_err.c
-L COMP crypto/comp/comp.h crypto/comp/comp_err.c
-L ECDSA crypto/ecdsa/ecdsa.h crypto/ecdsa/ecs_err.c
-L ECDH crypto/ecdh/ecdh.h crypto/ecdh/ech_err.c
-L STORE crypto/store/store.h crypto/store/str_err.c
-L TS crypto/ts/ts.h crypto/ts/ts_err.c
-L HMAC crypto/hmac/hmac.h crypto/hmac/hmac_err.c
-L CMS crypto/cms/cms.h crypto/cms/cms_err.c
-L JPAKE crypto/jpake/jpake.h crypto/jpake/jpake_err.c
-
-# additional header files to be scanned for function names
-L NONE crypto/x509/x509_vfy.h NONE
-L NONE crypto/ec/ec_lcl.h NONE
-L NONE crypto/asn1/asn_lcl.h NONE
-L NONE crypto/cms/cms_lcl.h NONE
-L NONE ssl/ssl_locl.h NONE
-
-
-F RSAREF_F_RSA_BN2BIN
-F RSAREF_F_RSA_PRIVATE_DECRYPT
-F RSAREF_F_RSA_PRIVATE_ENCRYPT
-F RSAREF_F_RSA_PUBLIC_DECRYPT
-F RSAREF_F_RSA_PUBLIC_ENCRYPT
-#F SSL_F_CLIENT_CERTIFICATE
-
-R SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
-R SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
-R SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
-R SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
-R SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030
-R SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
-R SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
-R SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
-R SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
-R SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044
-R SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
-R SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046
-R SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
-R SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
-R SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049
-R SSL_R_TLSV1_ALERT_DECODE_ERROR 1050
-R SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
-R SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
-R SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
-R SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
-R SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
-R SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
-R SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
-R SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
-R SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
-R SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111
-R SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
-R SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113
-R SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114
-
-R RSAREF_R_CONTENT_ENCODING 0x0400
-R RSAREF_R_DATA 0x0401
-R RSAREF_R_DIGEST_ALGORITHM 0x0402
-R RSAREF_R_ENCODING 0x0403
-R RSAREF_R_KEY 0x0404
-R RSAREF_R_KEY_ENCODING 0x0405
-R RSAREF_R_LEN 0x0406
-R RSAREF_R_MODULUS_LEN 0x0407
-R RSAREF_R_NEED_RANDOM 0x0408
-R RSAREF_R_PRIVATE_KEY 0x0409
-R RSAREF_R_PUBLIC_KEY 0x040a
-R RSAREF_R_SIGNATURE 0x040b
-R RSAREF_R_SIGNATURE_ENCODING 0x040c
-R RSAREF_R_ENCRYPTION_ALGORITHM 0x040d
-
diff --git a/thirdparty/openssl/crypto/evp/bio_enc.c b/thirdparty/openssl/crypto/evp/bio_enc.c
index 363e0246ae..0806f233b6 100644
--- a/thirdparty/openssl/crypto/evp/bio_enc.c
+++ b/thirdparty/openssl/crypto/evp/bio_enc.c
@@ -201,9 +201,14 @@ static int enc_read(BIO *b, char *out, int outl)
break;
}
} else {
- EVP_CipherUpdate(&(ctx->cipher),
- (unsigned char *)ctx->buf, &ctx->buf_len,
- (unsigned char *)&(ctx->buf[BUF_OFFSET]), i);
+ if (!EVP_CipherUpdate(&ctx->cipher,
+ (unsigned char *)ctx->buf, &ctx->buf_len,
+ (unsigned char *)&(ctx->buf[BUF_OFFSET]),
+ i)) {
+ BIO_clear_retry_flags(b);
+ ctx->ok = 0;
+ return 0;
+ }
ctx->cont = 1;
/*
* Note: it is possible for EVP_CipherUpdate to decrypt zero
@@ -260,9 +265,13 @@ static int enc_write(BIO *b, const char *in, int inl)
ctx->buf_off = 0;
while (inl > 0) {
n = (inl > ENC_BLOCK_SIZE) ? ENC_BLOCK_SIZE : inl;
- EVP_CipherUpdate(&(ctx->cipher),
- (unsigned char *)ctx->buf, &ctx->buf_len,
- (unsigned char *)in, n);
+ if (!EVP_CipherUpdate(&ctx->cipher,
+ (unsigned char *)ctx->buf, &ctx->buf_len,
+ (unsigned char *)in, n)) {
+ BIO_clear_retry_flags(b);
+ ctx->ok = 0;
+ return 0;
+ }
inl -= n;
in += n;
diff --git a/thirdparty/openssl/crypto/evp/bio_ok.c b/thirdparty/openssl/crypto/evp/bio_ok.c
index 5c32e35e17..16e151f110 100644
--- a/thirdparty/openssl/crypto/evp/bio_ok.c
+++ b/thirdparty/openssl/crypto/evp/bio_ok.c
@@ -491,7 +491,7 @@ static int sig_out(BIO *b)
* FIXME: there's absolutely no guarantee this makes any sense at all,
* particularly now EVP_MD_CTX has been restructured.
*/
- if (RAND_pseudo_bytes(md->md_data, md->digest->md_size) < 0)
+ if (RAND_bytes(md->md_data, md->digest->md_size) <= 0)
goto berr;
memcpy(&(ctx->buf[ctx->buf_len]), md->md_data, md->digest->md_size);
longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size);
diff --git a/thirdparty/openssl/crypto/evp/c_all.c b/thirdparty/openssl/crypto/evp/c_all.c
index a3ed00d4c1..719e34d22f 100644
--- a/thirdparty/openssl/crypto/evp/c_all.c
+++ b/thirdparty/openssl/crypto/evp/c_all.c
@@ -82,9 +82,4 @@ void OPENSSL_add_all_algorithms_noconf(void)
OPENSSL_cpuid_setup();
OpenSSL_add_all_ciphers();
OpenSSL_add_all_digests();
-#ifndef OPENSSL_NO_ENGINE
-# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
- ENGINE_setup_bsd_cryptodev();
-# endif
-#endif
}
diff --git a/thirdparty/openssl/crypto/evp/digest.c b/thirdparty/openssl/crypto/evp/digest.c
index 5b642b23fc..4db179629d 100644
--- a/thirdparty/openssl/crypto/evp/digest.c
+++ b/thirdparty/openssl/crypto/evp/digest.c
@@ -253,10 +253,10 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
{
#ifdef OPENSSL_FIPS
- return FIPS_digestupdate(ctx, data, count);
-#else
- return ctx->update(ctx, data, count);
+ if (FIPS_mode())
+ return FIPS_digestupdate(ctx, data, count);
#endif
+ return ctx->update(ctx, data, count);
}
/* The caller can assume that this removes any secret data from the context */
@@ -271,10 +271,11 @@ int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
/* The caller can assume that this removes any secret data from the context */
int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
{
-#ifdef OPENSSL_FIPS
- return FIPS_digestfinal(ctx, md, size);
-#else
int ret;
+#ifdef OPENSSL_FIPS
+ if (FIPS_mode())
+ return FIPS_digestfinal(ctx, md, size);
+#endif
OPENSSL_assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE);
ret = ctx->digest->final(ctx, md);
@@ -284,9 +285,8 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
ctx->digest->cleanup(ctx);
EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
}
- memset(ctx->md_data, 0, ctx->digest->ctx_size);
+ OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
return ret;
-#endif
}
int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
diff --git a/thirdparty/openssl/crypto/evp/e_aes.c b/thirdparty/openssl/crypto/evp/e_aes.c
index 1734a823c1..b45b364466 100644
--- a/thirdparty/openssl/crypto/evp/e_aes.c
+++ b/thirdparty/openssl/crypto/evp/e_aes.c
@@ -155,10 +155,10 @@ void AES_ctr32_encrypt(const unsigned char *in, unsigned char *out,
const unsigned char ivec[AES_BLOCK_SIZE]);
# endif
# ifdef AES_XTS_ASM
-void AES_xts_encrypt(const char *inp, char *out, size_t len,
+void AES_xts_encrypt(const unsigned char *inp, unsigned char *out, size_t len,
const AES_KEY *key1, const AES_KEY *key2,
const unsigned char iv[16]);
-void AES_xts_decrypt(const char *inp, char *out, size_t len,
+void AES_xts_decrypt(const unsigned char *inp, unsigned char *out, size_t len,
const AES_KEY *key1, const AES_KEY *key2,
const unsigned char iv[16]);
# endif
@@ -1120,6 +1120,8 @@ BLOCK_CIPHER_generic_pack(NID_aes, 128, EVP_CIPH_FLAG_FIPS)
static int aes_gcm_cleanup(EVP_CIPHER_CTX *c)
{
EVP_AES_GCM_CTX *gctx = c->cipher_data;
+ if (gctx == NULL)
+ return 0;
OPENSSL_cleanse(&gctx->gcm, sizeof(gctx->gcm));
if (gctx->iv != c->iv)
OPENSSL_free(gctx->iv);
@@ -1235,10 +1237,15 @@ static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
{
unsigned int len = c->buf[arg - 2] << 8 | c->buf[arg - 1];
/* Correct length for explicit IV */
+ if (len < EVP_GCM_TLS_EXPLICIT_IV_LEN)
+ return 0;
len -= EVP_GCM_TLS_EXPLICIT_IV_LEN;
/* If decrypting correct for tag too */
- if (!c->encrypt)
+ if (!c->encrypt) {
+ if (len < EVP_GCM_TLS_TAG_LEN)
+ return 0;
len -= EVP_GCM_TLS_TAG_LEN;
+ }
c->buf[arg - 2] = len >> 8;
c->buf[arg - 1] = len & 0xff;
}
diff --git a/thirdparty/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c b/thirdparty/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c
index 6dfd590a4a..d114710e98 100644
--- a/thirdparty/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c
+++ b/thirdparty/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c
@@ -859,6 +859,8 @@ static int aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
key->payload_length = len;
if ((key->aux.tls_ver =
p[arg - 4] << 8 | p[arg - 3]) >= TLS1_1_VERSION) {
+ if (len < AES_BLOCK_SIZE)
+ return 0;
len -= AES_BLOCK_SIZE;
p[arg - 2] = len >> 8;
p[arg - 1] = len;
diff --git a/thirdparty/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c b/thirdparty/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c
index 46c9d03389..917ae0751d 100644
--- a/thirdparty/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c
+++ b/thirdparty/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c
@@ -825,15 +825,19 @@ static int aesni_cbc_hmac_sha256_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
case EVP_CTRL_AEAD_TLS1_AAD:
{
unsigned char *p = ptr;
- unsigned int len = p[arg - 2] << 8 | p[arg - 1];
+ unsigned int len;
if (arg != EVP_AEAD_TLS1_AAD_LEN)
return -1;
+ len = p[arg - 2] << 8 | p[arg - 1];
+
if (ctx->encrypt) {
key->payload_length = len;
if ((key->aux.tls_ver =
p[arg - 4] << 8 | p[arg - 3]) >= TLS1_1_VERSION) {
+ if (len < AES_BLOCK_SIZE)
+ return 0;
len -= AES_BLOCK_SIZE;
p[arg - 2] = len >> 8;
p[arg - 1] = len;
diff --git a/thirdparty/openssl/crypto/evp/e_des3.c b/thirdparty/openssl/crypto/evp/e_des3.c
index 0e910d6d80..ab8126e5c9 100644
--- a/thirdparty/openssl/crypto/evp/e_des3.c
+++ b/thirdparty/openssl/crypto/evp/e_des3.c
@@ -212,6 +212,8 @@ static int des_ede3_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
size_t n;
unsigned char c[1], d[1];
+ if (!EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS))
+ inl *= 8;
for (n = 0; n < inl; ++n) {
c[0] = (in[n / 8] & (1 << (7 - n % 8))) ? 0x80 : 0;
DES_ede3_cfb_encrypt(c, d, 1, 1,
diff --git a/thirdparty/openssl/crypto/evp/e_rc4_hmac_md5.c b/thirdparty/openssl/crypto/evp/e_rc4_hmac_md5.c
index 2da1117829..93cfe3f107 100644
--- a/thirdparty/openssl/crypto/evp/e_rc4_hmac_md5.c
+++ b/thirdparty/openssl/crypto/evp/e_rc4_hmac_md5.c
@@ -99,7 +99,7 @@ static int rc4_hmac_md5_init_key(EVP_CIPHER_CTX *ctx,
return 1;
}
-# if !defined(OPENSSL_NO_ASM) && ( \
+# if defined(RC4_ASM) && defined(MD5_ASM) && ( \
defined(__x86_64) || defined(__x86_64__) || \
defined(_M_AMD64) || defined(_M_X64) || \
defined(__INTEL__) ) && \
@@ -254,6 +254,8 @@ static int rc4_hmac_md5_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
MD5_Init(&key->tail);
MD5_Update(&key->tail, hmac_key, sizeof(hmac_key));
+ OPENSSL_cleanse(hmac_key, sizeof(hmac_key));
+
return 1;
}
case EVP_CTRL_AEAD_TLS1_AAD:
@@ -267,6 +269,8 @@ static int rc4_hmac_md5_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
len = p[arg - 2] << 8 | p[arg - 1];
if (!ctx->encrypt) {
+ if (len < MD5_DIGEST_LENGTH)
+ return -1;
len -= MD5_DIGEST_LENGTH;
p[arg - 2] = len >> 8;
p[arg - 1] = len;
diff --git a/thirdparty/openssl/crypto/evp/e_seed.c b/thirdparty/openssl/crypto/evp/e_seed.c
index 7249d1b1ee..3d01eacac0 100644
--- a/thirdparty/openssl/crypto/evp/e_seed.c
+++ b/thirdparty/openssl/crypto/evp/e_seed.c
@@ -70,7 +70,8 @@ typedef struct {
} EVP_SEED_KEY;
IMPLEMENT_BLOCK_CIPHER(seed, ks, SEED, EVP_SEED_KEY, NID_seed,
- 16, 16, 16, 128, 0, seed_init_key, 0, 0, 0, 0)
+ 16, 16, 16, 128, EVP_CIPH_FLAG_DEFAULT_ASN1,
+ seed_init_key, 0, 0, 0, 0)
static int seed_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc)
diff --git a/thirdparty/openssl/crypto/evp/evp_enc.c b/thirdparty/openssl/crypto/evp/evp_enc.c
index 7d7be245b0..be577bac76 100644
--- a/thirdparty/openssl/crypto/evp/evp_enc.c
+++ b/thirdparty/openssl/crypto/evp/evp_enc.c
@@ -170,7 +170,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
#ifdef OPENSSL_FIPS
if (FIPS_mode()) {
- const EVP_CIPHER *fcipher;
+ const EVP_CIPHER *fcipher = NULL;
if (cipher)
fcipher = evp_get_fips_cipher(cipher);
if (fcipher)
@@ -182,6 +182,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
if (ctx->cipher->ctx_size) {
ctx->cipher_data = OPENSSL_malloc(ctx->cipher->ctx_size);
if (!ctx->cipher_data) {
+ ctx->cipher = NULL;
EVPerr(EVP_F_EVP_CIPHERINIT_EX, ERR_R_MALLOC_FAILURE);
return 0;
}
@@ -193,6 +194,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
ctx->flags &= EVP_CIPHER_CTX_FLAG_WRAP_ALLOW;
if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) {
if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL)) {
+ ctx->cipher = NULL;
EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_INITIALIZATION_ERROR);
return 0;
}
@@ -654,6 +656,7 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in)
if (in->cipher_data && in->cipher->ctx_size) {
out->cipher_data = OPENSSL_malloc(in->cipher->ctx_size);
if (!out->cipher_data) {
+ out->cipher = NULL;
EVPerr(EVP_F_EVP_CIPHER_CTX_COPY, ERR_R_MALLOC_FAILURE);
return 0;
}
@@ -661,6 +664,10 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in)
}
if (in->cipher->flags & EVP_CIPH_CUSTOM_COPY)
- return in->cipher->ctrl((EVP_CIPHER_CTX *)in, EVP_CTRL_COPY, 0, out);
+ if (!in->cipher->ctrl((EVP_CIPHER_CTX *)in, EVP_CTRL_COPY, 0, out)) {
+ out->cipher = NULL;
+ EVPerr(EVP_F_EVP_CIPHER_CTX_COPY, EVP_R_INITIALIZATION_ERROR);
+ return 0;
+ }
return 1;
}
diff --git a/thirdparty/openssl/crypto/evp/evp_err.c b/thirdparty/openssl/crypto/evp/evp_err.c
index 15cf5532b3..bcd841eb77 100644
--- a/thirdparty/openssl/crypto/evp/evp_err.c
+++ b/thirdparty/openssl/crypto/evp/evp_err.c
@@ -1,6 +1,6 @@
/* crypto/evp/evp_err.c */
/* ====================================================================
- * Copyright (c) 1999-2013 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2016 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -192,6 +192,7 @@ static ERR_STRING_DATA EVP_str_reasons[] = {
{ERR_REASON(EVP_R_INPUT_NOT_INITIALIZED), "input not initialized"},
{ERR_REASON(EVP_R_INVALID_DIGEST), "invalid digest"},
{ERR_REASON(EVP_R_INVALID_FIPS_MODE), "invalid fips mode"},
+ {ERR_REASON(EVP_R_INVALID_KEY), "invalid key"},
{ERR_REASON(EVP_R_INVALID_KEY_LENGTH), "invalid key length"},
{ERR_REASON(EVP_R_INVALID_OPERATION), "invalid operation"},
{ERR_REASON(EVP_R_IV_TOO_LARGE), "iv too large"},
diff --git a/thirdparty/openssl/crypto/evp/evptests.txt b/thirdparty/openssl/crypto/evp/evptests.txt
deleted file mode 100644
index 4e9958b3b5..0000000000
--- a/thirdparty/openssl/crypto/evp/evptests.txt
+++ /dev/null
@@ -1,401 +0,0 @@
-#cipher:key:iv:plaintext:ciphertext:0/1(decrypt/encrypt)
-#aadcipher:key:iv:plaintext:ciphertext:aad:tag:0/1(decrypt/encrypt)
-#digest:::input:output
-
-# SHA(1) tests (from shatest.c)
-SHA1:::616263:a9993e364706816aba3e25717850c26c9cd0d89d
-
-# MD5 tests (from md5test.c)
-MD5::::d41d8cd98f00b204e9800998ecf8427e
-MD5:::61:0cc175b9c0f1b6a831c399e269772661
-MD5:::616263:900150983cd24fb0d6963f7d28e17f72
-MD5:::6d65737361676520646967657374:f96b697d7cb7938d525a2f31aaf161d0
-MD5:::6162636465666768696a6b6c6d6e6f707172737475767778797a:c3fcd3d76192e4007dfb496cca67e13b
-MD5:::4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a30313233343536373839:d174ab98d277d9f5a5611c2c9f419d9f
-MD5:::3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930:57edf4a22be3c955ac49da2e2107b67a
-
-# AES 128 ECB tests (from FIPS-197 test vectors, encrypt)
-
-AES-128-ECB:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:69C4E0D86A7B0430D8CDB78070B4C55A:1
-
-# AES 192 ECB tests (from FIPS-197 test vectors, encrypt)
-
-AES-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:DDA97CA4864CDFE06EAF70A0EC0D7191:1
-
-# AES 256 ECB tests (from FIPS-197 test vectors, encrypt)
-
-AES-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:8EA2B7CA516745BFEAFC49904B496089:1
-
-# AES 128 ECB tests (from NIST test vectors, encrypt)
-
-#AES-128-ECB:00000000000000000000000000000000::00000000000000000000000000000000:C34C052CC0DA8D73451AFE5F03BE297F:1
-
-# AES 128 ECB tests (from NIST test vectors, decrypt)
-
-#AES-128-ECB:00000000000000000000000000000000::44416AC2D1F53C583303917E6BE9EBE0:00000000000000000000000000000000:0
-
-# AES 192 ECB tests (from NIST test vectors, decrypt)
-
-#AES-192-ECB:000000000000000000000000000000000000000000000000::48E31E9E256718F29229319C19F15BA4:00000000000000000000000000000000:0
-
-# AES 256 ECB tests (from NIST test vectors, decrypt)
-
-#AES-256-ECB:0000000000000000000000000000000000000000000000000000000000000000::058CCFFDBBCB382D1F6F56585D8A4ADE:00000000000000000000000000000000:0
-
-# AES 128 CBC tests (from NIST test vectors, encrypt)
-
-#AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:8A05FC5E095AF4848A08D328D3688E3D:1
-
-# AES 192 CBC tests (from NIST test vectors, encrypt)
-
-#AES-192-CBC:000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:7BD966D53AD8C1BB85D2ADFAE87BB104:1
-
-# AES 256 CBC tests (from NIST test vectors, encrypt)
-
-#AES-256-CBC:0000000000000000000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:FE3C53653E2F45B56FCD88B2CC898FF0:1
-
-# AES 128 CBC tests (from NIST test vectors, decrypt)
-
-#AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:FACA37E0B0C85373DF706E73F7C9AF86:00000000000000000000000000000000:0
-
-# AES tests from NIST document SP800-38A
-# For all ECB encrypts and decrypts, the transformed sequence is
-# AES-bits-ECB:key::plaintext:ciphertext:encdec
-# ECB-AES128.Encrypt and ECB-AES128.Decrypt
-AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:3AD77BB40D7A3660A89ECAF32466EF97
-AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:F5D3D58503B9699DE785895A96FDBAAF
-AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:43B1CD7F598ECE23881B00E3ED030688
-AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:7B0C785E27E8AD3F8223207104725DD4
-# ECB-AES192.Encrypt and ECB-AES192.Decrypt
-AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:BD334F1D6E45F25FF712A214571FA5CC
-AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:974104846D0AD3AD7734ECB3ECEE4EEF
-AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:EF7AFD2270E2E60ADCE0BA2FACE6444E
-AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:9A4B41BA738D6C72FB16691603C18E0E
-# ECB-AES256.Encrypt and ECB-AES256.Decrypt
-AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:F3EED1BDB5D2A03C064B5A7E3DB181F8
-AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:591CCB10D410ED26DC5BA74A31362870
-AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:B6ED21B99CA6F4F9F153E7B1BEAFED1D
-AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:23304B7A39F9F3FF067D8D8F9E24ECC7
-# For all CBC encrypts and decrypts, the transformed sequence is
-# AES-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec
-# CBC-AES128.Encrypt and CBC-AES128.Decrypt
-AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:7649ABAC8119B246CEE98E9B12E9197D
-AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:7649ABAC8119B246CEE98E9B12E9197D:AE2D8A571E03AC9C9EB76FAC45AF8E51:5086CB9B507219EE95DB113A917678B2
-AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:5086CB9B507219EE95DB113A917678B2:30C81C46A35CE411E5FBC1191A0A52EF:73BED6B8E3C1743B7116E69E22229516
-AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:73BED6B8E3C1743B7116E69E22229516:F69F2445DF4F9B17AD2B417BE66C3710:3FF1CAA1681FAC09120ECA307586E1A7
-# CBC-AES192.Encrypt and CBC-AES192.Decrypt
-AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:4F021DB243BC633D7178183A9FA071E8
-AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:4F021DB243BC633D7178183A9FA071E8:AE2D8A571E03AC9C9EB76FAC45AF8E51:B4D9ADA9AD7DEDF4E5E738763F69145A
-AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:B4D9ADA9AD7DEDF4E5E738763F69145A:30C81C46A35CE411E5FBC1191A0A52EF:571B242012FB7AE07FA9BAAC3DF102E0
-AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:571B242012FB7AE07FA9BAAC3DF102E0:F69F2445DF4F9B17AD2B417BE66C3710:08B0E27988598881D920A9E64F5615CD
-# CBC-AES256.Encrypt and CBC-AES256.Decrypt
-AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:F58C4C04D6E5F1BA779EABFB5F7BFBD6
-AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:F58C4C04D6E5F1BA779EABFB5F7BFBD6:AE2D8A571E03AC9C9EB76FAC45AF8E51:9CFC4E967EDB808D679F777BC6702C7D
-AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:9CFC4E967EDB808D679F777BC6702C7D:30C81C46A35CE411E5FBC1191A0A52EF:39F23369A9D9BACFA530E26304231461
-AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39F23369A9D9BACFA530E26304231461:F69F2445DF4F9B17AD2B417BE66C3710:B2EB05E2C39BE9FCDA6C19078C6A9D1B
-# We don't support CFB{1,8}-AESxxx.{En,De}crypt
-# For all CFB128 encrypts and decrypts, the transformed sequence is
-# AES-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec
-# CFB128-AES128.Encrypt
-AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1
-AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:1
-AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:1
-AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:1
-# CFB128-AES128.Decrypt
-AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0
-AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:0
-AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:0
-AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:0
-# CFB128-AES192.Encrypt
-AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1
-AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:1
-AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:1
-AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:1
-# CFB128-AES192.Decrypt
-AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0
-AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:0
-AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:0
-AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:0
-# CFB128-AES256.Encrypt
-AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1
-AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:1
-AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:1
-AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:1
-# CFB128-AES256.Decrypt
-AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0
-AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:0
-AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:0
-AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:0
-# For all OFB encrypts and decrypts, the transformed sequence is
-# AES-bits-CFB:key:IV/output':plaintext:ciphertext:encdec
-# OFB-AES128.Encrypt
-AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1
-AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1
-AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1
-AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1
-# OFB-AES128.Decrypt
-AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0
-AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:0
-AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:0
-AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:0
-# OFB-AES192.Encrypt
-AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1
-AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1
-AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1
-AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1
-# OFB-AES192.Decrypt
-AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0
-AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0
-AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0
-AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0
-# OFB-AES256.Encrypt
-AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1
-AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:1
-AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:1
-AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:1
-# OFB-AES256.Decrypt
-AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0
-AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:0
-AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0
-AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0
-
-# AES Counter test vectors from RFC3686
-aes-128-ctr:AE6852F8121067CC4BF7A5765577F39E:00000030000000000000000000000001:53696E676C6520626C6F636B206D7367:E4095D4FB7A7B3792D6175A3261311B8:1
-aes-128-ctr:7E24067817FAE0D743D6CE1F32539163:006CB6DBC0543B59DA48D90B00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:5104A106168A72D9790D41EE8EDAD388EB2E1EFC46DA57C8FCE630DF9141BE28:1
-aes-128-ctr:7691BE035E5020A8AC6E618529F9A0DC:00E0017B27777F3F4A1786F000000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:C1CF48A89F2FFDD9CF4652E9EFDB72D74540A42BDE6D7836D59A5CEAAEF3105325B2072F:1
-
-aes-192-ctr:16AF5B145FC9F579C175F93E3BFB0EED863D06CCFDB78515:0000004836733C147D6D93CB00000001:53696E676C6520626C6F636B206D7367:4B55384FE259C9C84E7935A003CBE928:1
-aes-192-ctr:7C5CB2401B3DC33C19E7340819E0F69C678C3DB8E6F6A91A:0096B03B020C6EADC2CB500D00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:453243FC609B23327EDFAAFA7131CD9F8490701C5AD4A79CFC1FE0FF42F4FB00:1
-aes-192-ctr:02BF391EE8ECB159B959617B0965279BF59B60A786D3E0FE:0007BDFD5CBD60278DCC091200000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:96893FC55E5C722F540B7DD1DDF7E758D288BC95C69165884536C811662F2188ABEE0935:1
-
-aes-256-ctr:776BEFF2851DB06F4C8A0542C8696F6C6A81AF1EEC96B4D37FC1D689E6C1C104:00000060DB5672C97AA8F0B200000001:53696E676C6520626C6F636B206D7367:145AD01DBF824EC7560863DC71E3E0C0:1
-aes-256-ctr:F6D66D6BD52D59BB0796365879EFF886C66DD51A5B6A99744B50590C87A23884:00FAAC24C1585EF15A43D87500000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:F05E231B3894612C49EE000B804EB2A9B8306B508F839D6A5530831D9344AF1C:1
-aes-256-ctr:FF7A617CE69148E4F1726E2F43581DE2AA62D9F805532EDFF1EED687FB54153D:001CC5B751A51D70A1C1114800000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:EB6C52821D0BBBF7CE7594462ACA4FAAB407DF866569FD07F48CC0B583D6071F1EC0E6B8:1
-
-# DES ECB tests (from destest)
-
-DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7
-DES-ECB:FFFFFFFFFFFFFFFF::FFFFFFFFFFFFFFFF:7359B2163E4EDC58
-DES-ECB:3000000000000000::1000000000000001:958E6E627A05557B
-DES-ECB:1111111111111111::1111111111111111:F40379AB9E0EC533
-DES-ECB:0123456789ABCDEF::1111111111111111:17668DFC7292532D
-DES-ECB:1111111111111111::0123456789ABCDEF:8A5AE1F81AB8F2DD
-DES-ECB:FEDCBA9876543210::0123456789ABCDEF:ED39D950FA74BCC4
-
-# DESX-CBC tests (from destest)
-DESX-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:846B2914851E9A2954732F8AA0A611C115CDC2D7951B1053A63C5E03B21AA3C4
-
-# DES EDE3 CBC tests (from destest)
-DES-EDE3-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:3FE301C962AC01D02213763C1CBD4CDC799657C064ECF5D41C673812CFDE9675
-
-# RC4 tests (from rc4test)
-RC4:0123456789abcdef0123456789abcdef::0123456789abcdef:75b7878099e0c596
-RC4:0123456789abcdef0123456789abcdef::0000000000000000:7494c2e7104b0879
-RC4:00000000000000000000000000000000::0000000000000000:de188941a3375d3a
-RC4:ef012345ef012345ef012345ef012345::0000000000000000000000000000000000000000:d6a141a7ec3c38dfbd615a1162e1c7ba36b67858
-RC4:0123456789abcdef0123456789abcdef::123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345678:66a0949f8af7d6891f7f832ba833c00c892ebe30143ce28740011ecf
-RC4:ef012345ef012345ef012345ef012345::00000000000000000000:d6a141a7ec3c38dfbd61
-
-
-# Camellia tests from RFC3713
-# For all ECB encrypts and decrypts, the transformed sequence is
-# CAMELLIA-bits-ECB:key::plaintext:ciphertext:encdec
-CAMELLIA-128-ECB:0123456789abcdeffedcba9876543210::0123456789abcdeffedcba9876543210:67673138549669730857065648eabe43
-CAMELLIA-192-ECB:0123456789abcdeffedcba98765432100011223344556677::0123456789abcdeffedcba9876543210:b4993401b3e996f84ee5cee7d79b09b9
-CAMELLIA-256-ECB:0123456789abcdeffedcba987654321000112233445566778899aabbccddeeff::0123456789abcdeffedcba9876543210:9acc237dff16d76c20ef7c919e3a7509
-
-# ECB-CAMELLIA128.Encrypt
-CAMELLIA-128-ECB:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:77CF412067AF8270613529149919546F:1
-CAMELLIA-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:B22F3C36B72D31329EEE8ADDC2906C68:1
-CAMELLIA-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:2EDF1F3418D53B88841FC8985FB1ECF2:1
-
-# ECB-CAMELLIA128.Encrypt and ECB-CAMELLIA128.Decrypt
-CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:432FC5DCD628115B7C388D770B270C96
-CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:0BE1F14023782A22E8384C5ABB7FAB2B
-CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:A0A1ABCD1893AB6FE0FE5B65DF5F8636
-CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:E61925E0D5DFAA9BB29F815B3076E51A
-
-# ECB-CAMELLIA192.Encrypt and ECB-CAMELLIA192.Decrypt
-CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:CCCC6C4E138B45848514D48D0D3439D3
-CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:5713C62C14B2EC0F8393B6AFD6F5785A
-CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:B40ED2B60EB54D09D030CF511FEEF366
-CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:909DBD95799096748CB27357E73E1D26
-
-# ECB-CAMELLIA256.Encrypt and ECB-CAMELLIA256.Decrypt
-CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:BEFD219B112FA00098919CD101C9CCFA
-CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:C91D3A8F1AEA08A9386CF4B66C0169EA
-CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:A623D711DC5F25A51BB8A80D56397D28
-CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:7960109FB6DC42947FCFE59EA3C5EB6B
-
-# For all CBC encrypts and decrypts, the transformed sequence is
-# CAMELLIA-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec
-# CBC-CAMELLIA128.Encrypt and CBC-CAMELLIA128.Decrypt
-CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:1607CF494B36BBF00DAEB0B503C831AB
-CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:1607CF494B36BBF00DAEB0B503C831AB:AE2D8A571E03AC9C9EB76FAC45AF8E51:A2F2CF671629EF7840C5A5DFB5074887
-CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:A2F2CF671629EF7840C5A5DFB5074887:30C81C46A35CE411E5FBC1191A0A52EF:0F06165008CF8B8B5A63586362543E54
-CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:36A84CDAFD5F9A85ADA0F0A993D6D577:F69F2445DF4F9B17AD2B417BE66C3710:74C64268CDB8B8FAF5B34E8AF3732980
-
-# CBC-CAMELLIA192.Encrypt and CBC-CAMELLIA192.Decrypt
-CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:2A4830AB5AC4A1A2405955FD2195CF93
-CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2A4830AB5AC4A1A2405955FD2195CF93:AE2D8A571E03AC9C9EB76FAC45AF8E51:5D5A869BD14CE54264F892A6DD2EC3D5
-CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:5D5A869BD14CE54264F892A6DD2EC3D5:30C81C46A35CE411E5FBC1191A0A52EF:37D359C3349836D884E310ADDF68C449
-CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:37D359C3349836D884E310ADDF68C449:F69F2445DF4F9B17AD2B417BE66C3710:01FAAA930B4AB9916E9668E1428C6B08
-
-# CBC-CAMELLIA256.Encrypt and CBC-CAMELLIA256.Decrypt
-CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:E6CFA35FC02B134A4D2C0B6737AC3EDA
-CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E6CFA35FC02B134A4D2C0B6737AC3EDA:AE2D8A571E03AC9C9EB76FAC45AF8E51:36CBEB73BD504B4070B1B7DE2B21EB50
-CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:36CBEB73BD504B4070B1B7DE2B21EB50:30C81C46A35CE411E5FBC1191A0A52EF:E31A6055297D96CA3330CDF1B1860A83
-CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E31A6055297D96CA3330CDF1B1860A83:F69F2445DF4F9B17AD2B417BE66C3710:5D563F6D1CCCF236051C0C5C1C58F28F
-
-# We don't support CFB{1,8}-CAMELLIAxxx.{En,De}crypt
-# For all CFB128 encrypts and decrypts, the transformed sequence is
-# CAMELLIA-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec
-# CFB128-CAMELLIA128.Encrypt
-CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1
-CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:1
-CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:1
-CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:9C2157A664626D1DEF9EA420FDE69B96:F69F2445DF4F9B17AD2B417BE66C3710:742A25F0542340C7BAEF24CA8482BB09:1
-
-# CFB128-CAMELLIA128.Decrypt
-CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0
-CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:0
-CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:0
-CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:9C2157A664626D1DEF9EA420FDE69B96:F69F2445DF4F9B17AD2B417BE66C3710:742A25F0542340C7BAEF24CA8482BB09:0
-
-# CFB128-CAMELLIA192.Encrypt
-CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:1
-CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:C832BB9780677DAA82D9B6860DCD565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:86F8491627906D780C7A6D46EA331F98:1
-CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:86F8491627906D780C7A6D46EA331F98:30C81C46A35CE411E5FBC1191A0A52EF:69511CCE594CF710CB98BB63D7221F01:1
-CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:69511CCE594CF710CB98BB63D7221F01:F69F2445DF4F9B17AD2B417BE66C3710:D5B5378A3ABED55803F25565D8907B84:1
-
-# CFB128-CAMELLIA192.Decrypt
-CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:0
-CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:C832BB9780677DAA82D9B6860DCD565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:86F8491627906D780C7A6D46EA331F98:0
-CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:86F8491627906D780C7A6D46EA331F98:30C81C46A35CE411E5FBC1191A0A52EF:69511CCE594CF710CB98BB63D7221F01:0
-CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:69511CCE594CF710CB98BB63D7221F01:F69F2445DF4F9B17AD2B417BE66C3710:D5B5378A3ABED55803F25565D8907B84:0
-
-# CFB128-CAMELLIA256.Encrypt
-CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1
-CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:1
-CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:1
-CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:555FC3F34BDD2D54C62D9E3BF338C1C4:F69F2445DF4F9B17AD2B417BE66C3710:5953ADCE14DB8C7F39F1BD39F359BFFA:1
-
-# CFB128-CAMELLIA256.Decrypt
-CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0
-CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:0
-CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:0
-CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:555FC3F34BDD2D54C62D9E3BF338C1C4:F69F2445DF4F9B17AD2B417BE66C3710:5953ADCE14DB8C7F39F1BD39F359BFFA:0
-
-# For all OFB encrypts and decrypts, the transformed sequence is
-# CAMELLIA-bits-OFB:key:IV/output':plaintext:ciphertext:encdec
-# OFB-CAMELLIA128.Encrypt
-CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1
-CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:1
-CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:1
-CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:1
-
-# OFB-CAMELLIA128.Decrypt
-CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0
-CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:0
-CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:0
-CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:0
-
-# OFB-CAMELLIA192.Encrypt
-CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:1
-CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:1
-CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:1
-CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:1
-
-# OFB-CAMELLIA192.Decrypt
-CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:0
-CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:0
-CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:0
-CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:0
-
-# OFB-CAMELLIA256.Encrypt
-CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1
-CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:1
-CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:1
-CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0A4A0404E26AA78A27CB271E8BF3CF20:1
-
-# OFB-CAMELLIA256.Decrypt
-CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0
-CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:0
-CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:0
-CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0A4A0404E26AA78A27CB271E8BF3CF20:0
-
-# SEED test vectors from RFC4269
-SEED-ECB:00000000000000000000000000000000::000102030405060708090A0B0C0D0E0F:5EBAC6E0054E166819AFF1CC6D346CDB:0
-SEED-ECB:000102030405060708090A0B0C0D0E0F::00000000000000000000000000000000:C11F22F20140505084483597E4370F43:0
-SEED-ECB:4706480851E61BE85D74BFB3FD956185::83A2F8A288641FB9A4E9A5CC2F131C7D:EE54D13EBCAE706D226BC3142CD40D4A:0
-SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:0
-SEED-ECB:00000000000000000000000000000000::000102030405060708090A0B0C0D0E0F:5EBAC6E0054E166819AFF1CC6D346CDB:1
-SEED-ECB:000102030405060708090A0B0C0D0E0F::00000000000000000000000000000000:C11F22F20140505084483597E4370F43:1
-SEED-ECB:4706480851E61BE85D74BFB3FD956185::83A2F8A288641FB9A4E9A5CC2F131C7D:EE54D13EBCAE706D226BC3142CD40D4A:1
-SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:1
-
-# AES CCM 256 bit key
-aes-256-ccm:1bde3251d41a8b5ea013c195ae128b218b3e0306376357077ef1c1c78548b92e:5b8e40746f6b98e00f1d13ff41:53bd72a97089e312422bf72e242377b3c6ee3e2075389b999c4ef7f28bd2b80a:9a5fcccdb4cf04e7293d2775cc76a488f042382d949b43b7d6bb2b9864786726:c17a32514eb6103f3249e076d4c871dc97e04b286699e54491dc18f6d734d4c0:2024931d73bca480c24a24ece6b6c2bf
-
-# AES GCM test vectors from http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-spec.pdf
-aes-128-gcm:00000000000000000000000000000000:000000000000000000000000::::58e2fccefa7e3061367f1d57a4e7455a
-aes-128-gcm:00000000000000000000000000000000:000000000000000000000000:00000000000000000000000000000000:0388dace60b6a392f328c2b971b2fe78::ab6e47d42cec13bdf53a67b21257bddf
-aes-128-gcm:feffe9928665731c6d6a8f9467308308:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255:42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091473f5985::4d5c2af327cd64a62cf35abd2ba6fab4
-aes-128-gcm:feffe9928665731c6d6a8f9467308308:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091:feedfacedeadbeeffeedfacedeadbeefabaddad2:5bc94fbc3221a5db94fae95ae7121a47
-aes-128-gcm:feffe9928665731c6d6a8f9467308308:cafebabefacedbad:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:61353b4c2806934a777ff51fa22a4755699b2a714fcdc6f83766e5f97b6c742373806900e49f24b22b097544d4896b424989b5e1ebac0f07c23f4598:feedfacedeadbeeffeedfacedeadbeefabaddad2:3612d2e79e3b0785561be14aaca2fccb
-aes-128-gcm:feffe9928665731c6d6a8f9467308308:9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:8ce24998625615b603a033aca13fb894be9112a5c3a211a8ba262a3cca7e2ca701e4a9a4fba43c90ccdcb281d48c7c6fd62875d2aca417034c34aee5:feedfacedeadbeeffeedfacedeadbeefabaddad2:619cc5aefffe0bfa462af43c1699d050
-aes-192-gcm:000000000000000000000000000000000000000000000000:000000000000000000000000::::cd33b28ac773f74ba00ed1f312572435
-aes-192-gcm:000000000000000000000000000000000000000000000000:000000000000000000000000:00000000000000000000000000000000:98e7247c07f0fe411c267e4384b0f600::2ff58d80033927ab8ef4d4587514f0fb
-aes-192-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255:3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710acade256::9924a7c8587336bfb118024db8674a14
-aes-192-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710:feedfacedeadbeeffeedfacedeadbeefabaddad2:2519498e80f1478f37ba55bd6d27618c
-aes-192-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c:cafebabefacedbad:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:0f10f599ae14a154ed24b36e25324db8c566632ef2bbb34f8347280fc4507057fddc29df9a471f75c66541d4d4dad1c9e93a19a58e8b473fa0f062f7:feedfacedeadbeeffeedfacedeadbeefabaddad2:65dcc57fcf623a24094fcca40d3533f8
-aes-192-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c:9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:d27e88681ce3243c4830165a8fdcf9ff1de9a1d8e6b447ef6ef7b79828666e4581e79012af34ddd9e2f037589b292db3e67c036745fa22e7e9b7373b:feedfacedeadbeeffeedfacedeadbeefabaddad2:dcf566ff291c25bbb8568fc3d376a6d9
-aes-256-gcm:0000000000000000000000000000000000000000000000000000000000000000:000000000000000000000000::::530f8afbc74536b9a963b4f1c4cb738b
-aes-256-gcm:0000000000000000000000000000000000000000000000000000000000000000:000000000000000000000000:00000000000000000000000000000000:cea7403d4d606b6e074ec5d3baf39d18::d0d1c8a799996bf0265b98b5d48ab919
-aes-256-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255:522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015ad::b094dac5d93471bdec1a502270e3cc6c
-aes-256-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662:feedfacedeadbeeffeedfacedeadbeefabaddad2:76fc6ece0f4e1768cddf8853bb2d551b
-aes-256-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308:cafebabefacedbad:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:c3762df1ca787d32ae47c13bf19844cbaf1ae14d0b976afac52ff7d79bba9de0feb582d33934a4f0954cc2363bc73f7862ac430e64abe499f47c9b1f:feedfacedeadbeeffeedfacedeadbeefabaddad2:3a337dbf46a792c45e454913fe2ea8f2
-aes-256-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308:9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:5a8def2f0c9e53f1f75d7853659e2a20eeb2b22aafde6419a058ab4f6f746bf40fc0c3b780f244452da3ebf1c5d82cdea2418997200ef82e44ae7e3f:feedfacedeadbeeffeedfacedeadbeefabaddad2:a44a8266ee1c8eb0c8b5d4cf5ae9f19a
-# local add-ons, primarily streaming ghash tests
-# 128 bytes aad
-aes-128-gcm:00000000000000000000000000000000:000000000000000000000000:::d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015ad:5fea793a2d6f974d37e68e0cb8ff9492
-# 48 bytes plaintext
-aes-128-gcm:00000000000000000000000000000000:000000000000000000000000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:0388dace60b6a392f328c2b971b2fe78f795aaab494b5923f7fd89ff948bc1e0200211214e7394da2089b6acd093abe0::9dd0a376b08e40eb00c35f29f9ea61a4
-# 80 bytes plaintext
-aes-128-gcm:00000000000000000000000000000000:000000000000000000000000:0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:0388dace60b6a392f328c2b971b2fe78f795aaab494b5923f7fd89ff948bc1e0200211214e7394da2089b6acd093abe0c94da219118e297d7b7ebcbcc9c388f28ade7d85a8ee35616f7124a9d5270291::98885a3a22bd4742fe7b72172193b163
-# 128 bytes plaintext
-aes-128-gcm:00000000000000000000000000000000:000000000000000000000000:0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:0388dace60b6a392f328c2b971b2fe78f795aaab494b5923f7fd89ff948bc1e0200211214e7394da2089b6acd093abe0c94da219118e297d7b7ebcbcc9c388f28ade7d85a8ee35616f7124a9d527029195b84d1b96c690ff2f2de30bf2ec89e00253786e126504f0dab90c48a30321de3345e6b0461e7c9e6c6b7afedde83f40::cac45f60e31efd3b5a43b98a22ce1aa1
-# 192 bytes plaintext, iv is chosen so that initial counter LSB is 0xFF
-aes-128-gcm:00000000000000000000000000000000:ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:56b3373ca9ef6e4a2b64fe1e9a17b61425f10d47a75a5fce13efc6bc784af24f4141bdd48cf7c770887afd573cca5418a9aeffcd7c5ceddfc6a78397b9a85b499da558257267caab2ad0b23ca476a53cb17fb41c4b8b475cb4f3f7165094c229c9e8c4dc0a2a5ff1903e501511221376a1cdb8364c5061a20cae74bc4acd76ceb0abc9fd3217ef9f8c90be402ddf6d8697f4f880dff15bfb7a6b28241ec8fe183c2d59e3f9dfff653c7126f0acb9e64211f42bae12af462b1070bef1ab5e3606::566f8ef683078bfdeeffa869d751a017
-# 80 bytes plaintext, submitted by Intel
-aes-128-gcm:843ffcf5d2b72694d19ed01d01249412:dbcca32ebf9b804617c3aa9e:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f:6268c6fa2a80b2d137467f092f657ac04d89be2beaa623d61b5a868c8f03ff95d3dcee23ad2f1ab3a6c80eaf4b140eb05de3457f0fbc111a6b43d0763aa422a3013cf1dc37fe417d1fbfc449b75d4cc5:00000000000000000000000000000000101112131415161718191a1b1c1d1e1f:3b629ccfbc1119b7319e1dce2cd6fd6d
-
-# AES XTS test vectors from IEEE Std 1619-2007
-aes-128-xts:0000000000000000000000000000000000000000000000000000000000000000:00000000000000000000000000000000:0000000000000000000000000000000000000000000000000000000000000000:917cf69ebd68b2ec9b9fe9a3eadda692cd43d2f59598ed858c02c2652fbf922e
-aes-128-xts:1111111111111111111111111111111122222222222222222222222222222222:33333333330000000000000000000000:4444444444444444444444444444444444444444444444444444444444444444:c454185e6a16936e39334038acef838bfb186fff7480adc4289382ecd6d394f0
-aes-128-xts:fffefdfcfbfaf9f8f7f6f5f4f3f2f1f022222222222222222222222222222222:33333333330000000000000000000000:4444444444444444444444444444444444444444444444444444444444444444:af85336b597afc1a900b2eb21ec949d292df4c047e0b21532186a5971a227a89
-aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:00000000000000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:27a7479befa1d476489f308cd4cfa6e2a96e4bbe3208ff25287dd3819616e89cc78cf7f5e543445f8333d8fa7f56000005279fa5d8b5e4ad40e736ddb4d35412328063fd2aab53e5ea1e0a9f332500a5df9487d07a5c92cc512c8866c7e860ce93fdf166a24912b422976146ae20ce846bb7dc9ba94a767aaef20c0d61ad02655ea92dc4c4e41a8952c651d33174be51a10c421110e6d81588ede82103a252d8a750e8768defffed9122810aaeb99f9172af82b604dc4b8e51bcb08235a6f4341332e4ca60482a4ba1a03b3e65008fc5da76b70bf1690db4eae29c5f1badd03c5ccf2a55d705ddcd86d449511ceb7ec30bf12b1fa35b913f9f747a8afd1b130e94bff94effd01a91735ca1726acd0b197c4e5b03393697e126826fb6bbde8ecc1e08298516e2c9ed03ff3c1b7860f6de76d4cecd94c8119855ef5297ca67e9f3e7ff72b1e99785ca0a7e7720c5b36dc6d72cac9574c8cbbc2f801e23e56fd344b07f22154beba0f08ce8891e643ed995c94d9a69c9f1b5f499027a78572aeebd74d20cc39881c213ee770b1010e4bea718846977ae119f7a023ab58cca0ad752afe656bb3c17256a9f6e9bf19fdd5a38fc82bbe872c5539edb609ef4f79c203ebb140f2e583cb2ad15b4aa5b655016a8449277dbd477ef2c8d6c017db738b18deb4a427d1923ce3ff262735779a418f20a282df920147beabe421ee5319d0568
-aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:01000000000000000000000000000000:27a7479befa1d476489f308cd4cfa6e2a96e4bbe3208ff25287dd3819616e89cc78cf7f5e543445f8333d8fa7f56000005279fa5d8b5e4ad40e736ddb4d35412328063fd2aab53e5ea1e0a9f332500a5df9487d07a5c92cc512c8866c7e860ce93fdf166a24912b422976146ae20ce846bb7dc9ba94a767aaef20c0d61ad02655ea92dc4c4e41a8952c651d33174be51a10c421110e6d81588ede82103a252d8a750e8768defffed9122810aaeb99f9172af82b604dc4b8e51bcb08235a6f4341332e4ca60482a4ba1a03b3e65008fc5da76b70bf1690db4eae29c5f1badd03c5ccf2a55d705ddcd86d449511ceb7ec30bf12b1fa35b913f9f747a8afd1b130e94bff94effd01a91735ca1726acd0b197c4e5b03393697e126826fb6bbde8ecc1e08298516e2c9ed03ff3c1b7860f6de76d4cecd94c8119855ef5297ca67e9f3e7ff72b1e99785ca0a7e7720c5b36dc6d72cac9574c8cbbc2f801e23e56fd344b07f22154beba0f08ce8891e643ed995c94d9a69c9f1b5f499027a78572aeebd74d20cc39881c213ee770b1010e4bea718846977ae119f7a023ab58cca0ad752afe656bb3c17256a9f6e9bf19fdd5a38fc82bbe872c5539edb609ef4f79c203ebb140f2e583cb2ad15b4aa5b655016a8449277dbd477ef2c8d6c017db738b18deb4a427d1923ce3ff262735779a418f20a282df920147beabe421ee5319d0568:264d3ca8512194fec312c8c9891f279fefdd608d0c027b60483a3fa811d65ee59d52d9e40ec5672d81532b38b6b089ce951f0f9c35590b8b978d175213f329bb1c2fd30f2f7f30492a61a532a79f51d36f5e31a7c9a12c286082ff7d2394d18f783e1a8e72c722caaaa52d8f065657d2631fd25bfd8e5baad6e527d763517501c68c5edc3cdd55435c532d7125c8614deed9adaa3acade5888b87bef641c4c994c8091b5bcd387f3963fb5bc37aa922fbfe3df4e5b915e6eb514717bdd2a74079a5073f5c4bfd46adf7d282e7a393a52579d11a028da4d9cd9c77124f9648ee383b1ac763930e7162a8d37f350b2f74b8472cf09902063c6b32e8c2d9290cefbd7346d1c779a0df50edcde4531da07b099c638e83a755944df2aef1aa31752fd323dcb710fb4bfbb9d22b925bc3577e1b8949e729a90bbafeacf7f7879e7b1147e28ba0bae940db795a61b15ecf4df8db07b824bb062802cc98a9545bb2aaeed77cb3fc6db15dcd7d80d7d5bc406c4970a3478ada8899b329198eb61c193fb6275aa8ca340344a75a862aebe92eee1ce032fd950b47d7704a3876923b4ad62844bf4a09c4dbe8b4397184b7471360c9564880aedddb9baa4af2e75394b08cd32ff479c57a07d3eab5d54de5f9738b8d27f27a9f0ab11799d7b7ffefb2704c95c6ad12c39f1e867a4b7b1d7818a4b753dfd2a89ccb45e001a03a867b187f225dd
-aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:02000000000000000000000000000000:264d3ca8512194fec312c8c9891f279fefdd608d0c027b60483a3fa811d65ee59d52d9e40ec5672d81532b38b6b089ce951f0f9c35590b8b978d175213f329bb1c2fd30f2f7f30492a61a532a79f51d36f5e31a7c9a12c286082ff7d2394d18f783e1a8e72c722caaaa52d8f065657d2631fd25bfd8e5baad6e527d763517501c68c5edc3cdd55435c532d7125c8614deed9adaa3acade5888b87bef641c4c994c8091b5bcd387f3963fb5bc37aa922fbfe3df4e5b915e6eb514717bdd2a74079a5073f5c4bfd46adf7d282e7a393a52579d11a028da4d9cd9c77124f9648ee383b1ac763930e7162a8d37f350b2f74b8472cf09902063c6b32e8c2d9290cefbd7346d1c779a0df50edcde4531da07b099c638e83a755944df2aef1aa31752fd323dcb710fb4bfbb9d22b925bc3577e1b8949e729a90bbafeacf7f7879e7b1147e28ba0bae940db795a61b15ecf4df8db07b824bb062802cc98a9545bb2aaeed77cb3fc6db15dcd7d80d7d5bc406c4970a3478ada8899b329198eb61c193fb6275aa8ca340344a75a862aebe92eee1ce032fd950b47d7704a3876923b4ad62844bf4a09c4dbe8b4397184b7471360c9564880aedddb9baa4af2e75394b08cd32ff479c57a07d3eab5d54de5f9738b8d27f27a9f0ab11799d7b7ffefb2704c95c6ad12c39f1e867a4b7b1d7818a4b753dfd2a89ccb45e001a03a867b187f225dd:fa762a3680b76007928ed4a4f49a9456031b704782e65e16cecb54ed7d017b5e18abd67b338e81078f21edb7868d901ebe9c731a7c18b5e6dec1d6a72e078ac9a4262f860beefa14f4e821018272e411a951502b6e79066e84252c3346f3aa62344351a291d4bedc7a07618bdea2af63145cc7a4b8d4070691ae890cd65733e7946e9021a1dffc4c59f159425ee6d50ca9b135fa6162cea18a939838dc000fb386fad086acce5ac07cb2ece7fd580b00cfa5e98589631dc25e8e2a3daf2ffdec26531659912c9d8f7a15e5865ea8fb5816d6207052bd7128cd743c12c8118791a4736811935eb982a532349e31dd401e0b660a568cb1a4711f552f55ded59f1f15bf7196b3ca12a91e488ef59d64f3a02bf45239499ac6176ae321c4a211ec545365971c5d3f4f09d4eb139bfdf2073d33180b21002b65cc9865e76cb24cd92c874c24c18350399a936ab3637079295d76c417776b94efce3a0ef7206b15110519655c956cbd8b2489405ee2b09a6b6eebe0c53790a12a8998378b33a5b71159625f4ba49d2a2fdba59fbf0897bc7aabd8d707dc140a80f0f309f835d3da54ab584e501dfa0ee977fec543f74186a802b9a37adb3e8291eca04d66520d229e60401e7282bef486ae059aa70696e0e305d777140a7a883ecdcb69b9ff938e8a4231864c69ca2c2043bed007ff3e605e014bcf518138dc3a25c5e236171a2d01d6
-aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:fd000000000000000000000000000000:8e41b78c390b5af9d758bb214a67e9f6bf7727b09ac6124084c37611398fa45daad94868600ed391fb1acd4857a95b466e62ef9f4b377244d1c152e7b30d731aad30c716d214b707aed99eb5b5e580b3e887cf7497465651d4b60e6042051da3693c3b78c14489543be8b6ad0ba629565bba202313ba7b0d0c94a3252b676f46cc02ce0f8a7d34c0ed229129673c1f61aed579d08a9203a25aac3a77e9db60267996db38df637356d9dcd1632e369939f2a29d89345c66e05066f1a3677aef18dea4113faeb629e46721a66d0a7e785d3e29af2594eb67dfa982affe0aac058f6e15864269b135418261fc3afb089472cf68c45dd7f231c6249ba0255e1e033833fc4d00a3fe02132d7bc3873614b8aee34273581ea0325c81f0270affa13641d052d36f0757d484014354d02d6883ca15c24d8c3956b1bd027bcf41f151fd8023c5340e5606f37e90fdb87c86fb4fa634b3718a30bace06a66eaf8f63c4aa3b637826a87fe8cfa44282e92cb1615af3a28e53bc74c7cba1a0977be9065d0c1a5dec6c54ae38d37f37aa35283e048e5530a85c4e7a29d7b92ec0c3169cdf2a805c7604bce60049b9fb7b8eaac10f51ae23794ceba68bb58112e293b9b692ca721b37c662f8574ed4dba6f88e170881c82cddc1034a0ca7e284bf0962b6b26292d836fa9f73c1ac770eef0f2d3a1eaf61d3e03555fd424eedd67e18a18094f888:d55f684f81f4426e9fde92a5ff02df2ac896af63962888a97910c1379e20b0a3b1db613fb7fe2e07004329ea5c22bfd33e3dbe4cf58cc608c2c26c19a2e2fe22f98732c2b5cb844cc6c0702d91e1d50fc4382a7eba5635cd602432a2306ac4ce82f8d70c8d9bc15f918fe71e74c622d5cf71178bf6e0b9cc9f2b41dd8dbe441c41cd0c73a6dc47a348f6702f9d0e9b1b1431e948e299b9ec2272ab2c5f0c7be86affa5dec87a0bee81d3d50007edaa2bcfccb35605155ff36ed8edd4a40dcd4b243acd11b2b987bdbfaf91a7cac27e9c5aea525ee53de7b2d3332c8644402b823e94a7db26276d2d23aa07180f76b4fd29b9c0823099c9d62c519880aee7e9697617c1497d47bf3e571950311421b6b734d38b0db91eb85331b91ea9f61530f54512a5a52a4bad589eb69781d537f23297bb459bdad2948a29e1550bf4787e0be95bb173cf5fab17dab7a13a052a63453d97ccec1a321954886b7a1299faaeecae35c6eaaca753b041b5e5f093bf83397fd21dd6b3012066fcc058cc32c3b09d7562dee29509b5839392c9ff05f51f3166aaac4ac5f238038a3045e6f72e48ef0fe8bc675e82c318a268e43970271bf119b81bf6a982746554f84e72b9f00280a320a08142923c23c883423ff949827f29bbacdc1ccdb04938ce6098c95ba6b32528f4ef78eed778b2e122ddfd1cbdd11d1c0a6783e011fc536d63d053260637
-aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:fe000000000000000000000000000000:d55f684f81f4426e9fde92a5ff02df2ac896af63962888a97910c1379e20b0a3b1db613fb7fe2e07004329ea5c22bfd33e3dbe4cf58cc608c2c26c19a2e2fe22f98732c2b5cb844cc6c0702d91e1d50fc4382a7eba5635cd602432a2306ac4ce82f8d70c8d9bc15f918fe71e74c622d5cf71178bf6e0b9cc9f2b41dd8dbe441c41cd0c73a6dc47a348f6702f9d0e9b1b1431e948e299b9ec2272ab2c5f0c7be86affa5dec87a0bee81d3d50007edaa2bcfccb35605155ff36ed8edd4a40dcd4b243acd11b2b987bdbfaf91a7cac27e9c5aea525ee53de7b2d3332c8644402b823e94a7db26276d2d23aa07180f76b4fd29b9c0823099c9d62c519880aee7e9697617c1497d47bf3e571950311421b6b734d38b0db91eb85331b91ea9f61530f54512a5a52a4bad589eb69781d537f23297bb459bdad2948a29e1550bf4787e0be95bb173cf5fab17dab7a13a052a63453d97ccec1a321954886b7a1299faaeecae35c6eaaca753b041b5e5f093bf83397fd21dd6b3012066fcc058cc32c3b09d7562dee29509b5839392c9ff05f51f3166aaac4ac5f238038a3045e6f72e48ef0fe8bc675e82c318a268e43970271bf119b81bf6a982746554f84e72b9f00280a320a08142923c23c883423ff949827f29bbacdc1ccdb04938ce6098c95ba6b32528f4ef78eed778b2e122ddfd1cbdd11d1c0a6783e011fc536d63d053260637:72efc1ebfe1ee25975a6eb3aa8589dda2b261f1c85bdab442a9e5b2dd1d7c3957a16fc08e526d4b1223f1b1232a11af274c3d70dac57f83e0983c498f1a6f1aecb021c3e70085a1e527f1ce41ee5911a82020161529cd82773762daf5459de94a0a82adae7e1703c808543c29ed6fb32d9e004327c1355180c995a07741493a09c21ba01a387882da4f62534b87bb15d60d197201c0fd3bf30c1500a3ecfecdd66d8721f90bcc4c17ee925c61b0a03727a9c0d5f5ca462fbfa0af1c2513a9d9d4b5345bd27a5f6e653f751693e6b6a2b8ead57d511e00e58c45b7b8d005af79288f5c7c22fd4f1bf7a898b03a5634c6a1ae3f9fae5de4f296a2896b23e7ed43ed14fa5a2803f4d28f0d3ffcf24757677aebdb47bb388378708948a8d4126ed1839e0da29a537a8c198b3c66ab00712dd261674bf45a73d67f76914f830ca014b65596f27e4cf62de66125a5566df9975155628b400fbfb3a29040ed50faffdbb18aece7c5c44693260aab386c0a37b11b114f1c415aebb653be468179428d43a4d8bc3ec38813eca30a13cf1bb18d524f1992d44d8b1a42ea30b22e6c95b199d8d182f8840b09d059585c31ad691fa0619ff038aca2c39a943421157361717c49d322028a74648113bd8c9d7ec77cf3c89c1ec8718ceff8516d96b34c3c614f10699c9abc4ed0411506223bea16af35c883accdbe1104eef0cfdb54e12fb230a
-aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:ff000000000000000000000000000000:72efc1ebfe1ee25975a6eb3aa8589dda2b261f1c85bdab442a9e5b2dd1d7c3957a16fc08e526d4b1223f1b1232a11af274c3d70dac57f83e0983c498f1a6f1aecb021c3e70085a1e527f1ce41ee5911a82020161529cd82773762daf5459de94a0a82adae7e1703c808543c29ed6fb32d9e004327c1355180c995a07741493a09c21ba01a387882da4f62534b87bb15d60d197201c0fd3bf30c1500a3ecfecdd66d8721f90bcc4c17ee925c61b0a03727a9c0d5f5ca462fbfa0af1c2513a9d9d4b5345bd27a5f6e653f751693e6b6a2b8ead57d511e00e58c45b7b8d005af79288f5c7c22fd4f1bf7a898b03a5634c6a1ae3f9fae5de4f296a2896b23e7ed43ed14fa5a2803f4d28f0d3ffcf24757677aebdb47bb388378708948a8d4126ed1839e0da29a537a8c198b3c66ab00712dd261674bf45a73d67f76914f830ca014b65596f27e4cf62de66125a5566df9975155628b400fbfb3a29040ed50faffdbb18aece7c5c44693260aab386c0a37b11b114f1c415aebb653be468179428d43a4d8bc3ec38813eca30a13cf1bb18d524f1992d44d8b1a42ea30b22e6c95b199d8d182f8840b09d059585c31ad691fa0619ff038aca2c39a943421157361717c49d322028a74648113bd8c9d7ec77cf3c89c1ec8718ceff8516d96b34c3c614f10699c9abc4ed0411506223bea16af35c883accdbe1104eef0cfdb54e12fb230a:3260ae8dad1f4a32c5cafe3ab0eb95549d461a67ceb9e5aa2d3afb62dece0553193ba50c75be251e08d1d08f1088576c7efdfaaf3f459559571e12511753b07af073f35da06af0ce0bbf6b8f5ccc5cea500ec1b211bd51f63b606bf6528796ca12173ba39b8935ee44ccce646f90a45bf9ccc567f0ace13dc2d53ebeedc81f58b2e41179dddf0d5a5c42f5d8506c1a5d2f8f59f3ea873cbcd0eec19acbf325423bd3dcb8c2b1bf1d1eaed0eba7f0698e4314fbeb2f1566d1b9253008cbccf45a2b0d9c5c9c21474f4076e02be26050b99dee4fd68a4cf890e496e4fcae7b70f94ea5a9062da0daeba1993d2ccd1dd3c244b8428801495a58b216547e7e847c46d1d756377b6242d2e5fb83bf752b54e0df71e889f3a2bb0f4c10805bf3c590376e3c24e22ff57f7fa965577375325cea5d920db94b9c336b455f6e894c01866fe9fbb8c8d3f70a2957285f6dfb5dcd8cbf54782f8fe7766d4723819913ac773421e3a31095866bad22c86a6036b2518b2059b4229d18c8c2ccbdf906c6cc6e82464ee57bddb0bebcb1dc645325bfb3e665ef7251082c88ebb1cf203bd779fdd38675713c8daadd17e1cabee432b09787b6ddf3304e38b731b45df5df51b78fcfb3d32466028d0ba36555e7e11ab0ee0666061d1645d962444bc47a38188930a84b4d561395c73c087021927ca638b7afc8a8679ccb84c26555440ec7f10445cd
-
-aes-256-xts:27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592:ff000000000000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:1c3b3a102f770386e4836c99e370cf9bea00803f5e482357a4ae12d414a3e63b5d31e276f8fe4a8d66b317f9ac683f44680a86ac35adfc3345befecb4bb188fd5776926c49a3095eb108fd1098baec70aaa66999a72a82f27d848b21d4a741b0c5cd4d5fff9dac89aeba122961d03a757123e9870f8acf1000020887891429ca2a3e7a7d7df7b10355165c8b9a6d0a7de8b062c4500dc4cd120c0f7418dae3d0b5781c34803fa75421c790dfe1de1834f280d7667b327f6c8cd7557e12ac3a0f93ec05c52e0493ef31a12d3d9260f79a289d6a379bc70c50841473d1a8cc81ec583e9645e07b8d9670655ba5bbcfecc6dc3966380ad8fecb17b6ba02469a020a84e18e8f84252070c13e9f1f289be54fbc481457778f616015e1327a02b140f1505eb309326d68378f8374595c849d84f4c333ec4423885143cb47bd71c5edae9be69a2ffeceb1bec9de244fbe15992b11b77c040f12bd8f6a975a44a0f90c29a9abc3d4d893927284c58754cce294529f8614dcd2aba991925fedc4ae74ffac6e333b93eb4aff0479da9a410e4450e0dd7ae4c6e2910900575da401fc07059f645e8b7e9bfdef33943054ff84011493c27b3429eaedb4ed5376441a77ed43851ad77f16f541dfd269d50d6a5f14fb0aab1cbb4c1550be97f7ab4066193c4caa773dad38014bd2092fa755c824bb5e54c4f36ffda9fcea70b9c6e693e148c151
-aes-256-xts:27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592:ffff0000000000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:77a31251618a15e6b92d1d66dffe7b50b50bad552305ba0217a610688eff7e11e1d0225438e093242d6db274fde801d4cae06f2092c728b2478559df58e837c2469ee4a4fa794e4bbc7f39bc026e3cb72c33b0888f25b4acf56a2a9804f1ce6d3d6e1dc6ca181d4b546179d55544aa7760c40d06741539c7e3cd9d2f6650b2013fd0eeb8c2b8e3d8d240ccae2d4c98320a7442e1c8d75a42d6e6cfa4c2eca1798d158c7aecdf82490f24bb9b38e108bcda12c3faf9a21141c3613b58367f922aaa26cd22f23d708dae699ad7cb40a8ad0b6e2784973dcb605684c08b8d6998c69aac049921871ebb65301a4619ca80ecb485a31d744223ce8ddc2394828d6a80470c092f5ba413c3378fa6054255c6f9df4495862bbb3287681f931b687c888abf844dfc8fc28331e579928cd12bd2390ae123cf03818d14dedde5c0c24c8ab018bfca75ca096f2d531f3d1619e785f1ada437cab92e980558b3dce1474afb75bfedbf8ff54cb2618e0244c9ac0d3c66fb51598cd2db11f9be39791abe447c63094f7c453b7ff87cb5bb36b7c79efb0872d17058b83b15ab0866ad8a58656c5a7e20dbdf308b2461d97c0ec0024a2715055249cf3b478ddd4740de654f75ca686e0d7345c69ed50cdc2a8b332b1f8824108ac937eb050585608ee734097fc09054fbff89eeaeea791f4a7ab1f9868294a4f9e27b42af8100cb9d59cef9645803
-aes-256-xts:27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592:ffffff00000000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:e387aaa58ba483afa7e8eb469778317ecf4cf573aa9d4eac23f2cdf914e4e200a8b490e42ee646802dc6ee2b471b278195d60918ececb44bf79966f83faba0499298ebc699c0c8634715a320bb4f075d622e74c8c932004f25b41e361025b5a87815391f6108fc4afa6a05d9303c6ba68a128a55705d415985832fdeaae6c8e19110e84d1b1f199a2692119edc96132658f09da7c623efcec712537a3d94c0bf5d7e352ec94ae5797fdb377dc1551150721adf15bd26a8efc2fcaad56881fa9e62462c28f30ae1ceaca93c345cf243b73f542e2074a705bd2643bb9f7cc79bb6e7091ea6e232df0f9ad0d6cf502327876d82207abf2115cdacf6d5a48f6c1879a65b115f0f8b3cb3c59d15dd8c769bc014795a1837f3901b5845eb491adfefe097b1fa30a12fc1f65ba22905031539971a10f2f36c321bb51331cdefb39e3964c7ef079994f5b69b2edd83a71ef549971ee93f44eac3938fcdd61d01fa71799da3a8091c4c48aa9ed263ff0749df95d44fef6a0bb578ec69456aa5408ae32c7af08ad7ba8921287e3bbee31b767be06a0e705c864a769137df28292283ea81a2480241b44d9921cdbec1bc28dc1fda114bd8e5217ac9d8ebafa720e9da4f9ace231cc949e5b96fe76ffc21063fddc83a6b8679c00d35e09576a875305bed5f36ed242c8900dd1fa965bc950dfce09b132263a1eef52dd6888c309f5a7d712826
-aes-256-xts:27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592:ffffffff000000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:bf53d2dade78e822a4d949a9bc6766b01b06a8ef70d26748c6a7fc36d80ae4c5520f7c4ab0ac8544424fa405162fef5a6b7f229498063618d39f0003cb5fb8d1c86b643497da1ff945c8d3bedeca4f479702a7a735f043ddb1d6aaade3c4a0ac7ca7f3fa5279bef56f82cd7a2f38672e824814e10700300a055e1630b8f1cb0e919f5e942010a416e2bf48cb46993d3cb6a51c19bacf864785a00bc2ecff15d350875b246ed53e68be6f55bd7e05cfc2b2ed6432198a6444b6d8c247fab941f569768b5c429366f1d3f00f0345b96123d56204c01c63b22ce78baf116e525ed90fdea39fa469494d3866c31e05f295ff21fea8d4e6e13d67e47ce722e9698a1c1048d68ebcde76b86fcf976eab8aa9790268b7068e017a8b9b749409514f1053027fd16c3786ea1bac5f15cb79711ee2abe82f5cf8b13ae73030ef5b9e4457e75d1304f988d62dd6fc4b94ed38ba831da4b7634971b6cd8ec325d9c61c00f1df73627ed3745a5e8489f3a95c69639c32cd6e1d537a85f75cc844726e8a72fc0077ad22000f1d5078f6b866318c668f1ad03d5a5fced5219f2eabbd0aa5c0f460d183f04404a0d6f469558e81fab24a167905ab4c7878502ad3e38fdbe62a41556cec37325759533ce8f25f367c87bb5578d667ae93f9e2fd99bcbc5f2fbba88cf6516139420fcff3b7361d86322c4bd84c82f335abb152c4a93411373aaa8220
-aes-256-xts:27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592:ffffffffff0000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:64497e5a831e4a932c09be3e5393376daa599548b816031d224bbf50a818ed2350eae7e96087c8a0db51ad290bd00c1ac1620857635bf246c176ab463be30b808da548081ac847b158e1264be25bb0910bbc92647108089415d45fab1b3d2604e8a8eff1ae4020cfa39936b66827b23f371b92200be90251e6d73c5f86de5fd4a950781933d79a28272b782a2ec313efdfcc0628f43d744c2dc2ff3dcb66999b50c7ca895b0c64791eeaa5f29499fb1c026f84ce5b5c72ba1083cddb5ce45434631665c333b60b11593fb253c5179a2c8db813782a004856a1653011e93fb6d876c18366dd8683f53412c0c180f9c848592d593f8609ca736317d356e13e2bff3a9f59cd9aeb19cd482593d8c46128bb32423b37a9adfb482b99453fbe25a41bf6feb4aa0bef5ed24bf73c762978025482c13115e4015aac992e5613a3b5c2f685b84795cb6e9b2656d8c88157e52c42f978d8634c43d06fea928f2822e465aa6576e9bf419384506cc3ce3c54ac1a6f67dc66f3b30191e698380bc999b05abce19dc0c6dcc2dd001ec535ba18deb2df1a101023108318c75dc98611a09dc48a0acdec676fabdf222f07e026f059b672b56e5cbc8e1d21bbd867dd927212054681d70ea737134cdfce93b6f82ae22423274e58a0821cc5502e2d0ab4585e94de6975be5e0b4efce51cd3e70c25a1fbbbd609d273ad5b0d59631c531f6a0a57b9
-
-aes-128-xts:fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0:9a785634120000000000000000000000:000102030405060708090a0b0c0d0e0f10:6c1625db4671522d3d7599601de7ca09ed
-aes-128-xts:fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0:9a785634120000000000000000000000:000102030405060708090a0b0c0d0e0f1011:d069444b7a7e0cab09e24447d24deb1fedbf
-aes-128-xts:fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0:9a785634120000000000000000000000:000102030405060708090a0b0c0d0e0f101112:e5df1351c0544ba1350b3363cd8ef4beedbf9d
-aes-128-xts:fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0:9a785634120000000000000000000000:000102030405060708090a0b0c0d0e0f10111213:9d84c813f719aa2c7be3f66171c7c5c2edbf9dac
-aes-128-xts:e0e1e2e3e4e5e6e7e8e9eaebecedeeefc0c1c2c3c4c5c6c7c8c9cacbcccdcecf:21436587a90000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:38b45812ef43a05bd957e545907e223b954ab4aaf088303ad910eadf14b42be68b2461149d8c8ba85f992be970bc621f1b06573f63e867bf5875acafa04e42ccbd7bd3c2a0fb1fff791ec5ec36c66ae4ac1e806d81fbf709dbe29e471fad38549c8e66f5345d7c1eb94f405d1ec785cc6f6a68f6254dd8339f9d84057e01a17741990482999516b5611a38f41bb6478e6f173f320805dd71b1932fc333cb9ee39936beea9ad96fa10fb4112b901734ddad40bc1878995f8e11aee7d141a2f5d48b7a4e1e7f0b2c04830e69a4fd1378411c2f287edf48c6c4e5c247a19680f7fe41cefbd49b582106e3616cbbe4dfb2344b2ae9519391f3e0fb4922254b1d6d2d19c6d4d537b3a26f3bcc51588b32f3eca0829b6a5ac72578fb814fb43cf80d64a233e3f997a3f02683342f2b33d25b492536b93becb2f5e1a8b82f5b883342729e8ae09d16938841a21a97fb543eea3bbff59f13c1a18449e398701c1ad51648346cbc04c27bb2da3b93a1372ccae548fb53bee476f9e9c91773b1bb19828394d55d3e1a20ed69113a860b6829ffa847224604435070221b257e8dff783615d2cae4803a93aa4334ab482a0afac9c0aeda70b45a481df5dec5df8cc0f423c77a5fd46cd312021d4b438862419a791be03bb4d97c0e59578542531ba466a83baf92cefc151b5cc1611a167893819b63fb8a6b18e86de60290fa72b797b0ce59f3
-# AES wrap tests from RFC3394
-id-aes128-wrap:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:1FA68B0A8112B447AEF34BD8FB5A7B829D3E862371D2CFE5
-id-aes192-wrap:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:96778B25AE6CA435F92B5B97C050AED2468AB8A17AD84E5D
-id-aes256-wrap:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:64E8C3F9CE0F5BA263E9777905818A2A93C8191E7D6E8AE7
-id-aes192-wrap:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF0001020304050607:031D33264E15D33268F24EC260743EDCE1C6C7DDEE725A936BA814915C6762D2
-id-aes256-wrap:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF0001020304050607:A8F9BC1612C68B3FF6E6F4FBE30E71E4769C8B80A32CB8958CD5D17D6B254DA1
-id-aes256-wrap:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF000102030405060708090A0B0C0D0E0F:28C9F404C4B810F4CBCCB35CFB87F8263F5786E2D80ED326CBC7F0E71A99F43BFB988B9B7A02DD21
diff --git a/thirdparty/openssl/crypto/evp/openbsd_hw.c b/thirdparty/openssl/crypto/evp/openbsd_hw.c
index 75d12e2330..07decf2674 100644
--- a/thirdparty/openssl/crypto/evp/openbsd_hw.c
+++ b/thirdparty/openssl/crypto/evp/openbsd_hw.c
@@ -133,6 +133,10 @@ static int dev_crypto_init_key(EVP_CIPHER_CTX *ctx, int cipher,
return 0;
CDATA(ctx)->key = OPENSSL_malloc(MAX_HW_KEY);
+ if (CDATA(ctx)->key == NULL {
+ err("CDATA(ctx)->key memory allocation failed");
+ return 0;
+ }
assert(ctx->cipher->iv_len <= MAX_HW_IV);
@@ -186,6 +190,11 @@ static int dev_crypto_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
if (((unsigned long)in & 3) || cinl != inl) {
cin = OPENSSL_malloc(cinl);
+ if (cin == NULL) {
+ err("cin - memory allocation failed");
+ abort();
+ return 0;
+ }
memcpy(cin, in, inl);
cryp.src = cin;
}
@@ -334,6 +343,11 @@ static int do_digest(int ses, unsigned char *md, const void *data, int len)
char *dcopy;
dcopy = OPENSSL_malloc(len);
+ if (dcopy == NULL) {
+ err("dcopy - memory allocation failed");
+ abort();
+ return 0;
+ }
memcpy(dcopy, data, len);
cryp.src = dcopy;
cryp.dst = cryp.src; // FIXME!!!
@@ -364,6 +378,10 @@ static int dev_crypto_md5_update(EVP_MD_CTX *ctx, const void *data,
return do_digest(md_data->sess.ses, md_data->md, data, len);
md_data->data = OPENSSL_realloc(md_data->data, md_data->len + len);
+ if (md_data->data == NULL) {
+ err("DEV_CRYPTO_MD5_UPDATE: unable to allocate memory");
+ abort();
+ }
memcpy(md_data->data + md_data->len, data, len);
md_data->len += len;
@@ -397,6 +415,10 @@ static int dev_crypto_md5_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
assert(from->digest->flags & EVP_MD_FLAG_ONESHOT);
to_md->data = OPENSSL_malloc(from_md->len);
+ if (to_md->data == NULL) {
+ err("DEV_CRYPTO_MD5_COPY: unable to allocate memory");
+ abort();
+ }
memcpy(to_md->data, from_md->data, from_md->len);
return 1;
diff --git a/thirdparty/openssl/crypto/evp/p_lib.c b/thirdparty/openssl/crypto/evp/p_lib.c
index c0171244d5..545d04fd77 100644
--- a/thirdparty/openssl/crypto/evp/p_lib.c
+++ b/thirdparty/openssl/crypto/evp/p_lib.c
@@ -130,6 +130,14 @@ int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from)
EVPerr(EVP_F_EVP_PKEY_COPY_PARAMETERS, EVP_R_MISSING_PARAMETERS);
goto err;
}
+
+ if (!EVP_PKEY_missing_parameters(to)) {
+ if (EVP_PKEY_cmp_parameters(to, from) == 1)
+ return 1;
+ EVPerr(EVP_F_EVP_PKEY_COPY_PARAMETERS, EVP_R_DIFFERENT_PARAMETERS);
+ return 0;
+ }
+
if (from->ameth && from->ameth->param_copy)
return from->ameth->param_copy(to, from);
err:
diff --git a/thirdparty/openssl/crypto/evp/pmeth_fn.c b/thirdparty/openssl/crypto/evp/pmeth_fn.c
index a8b7f2f6d5..727869e3ee 100644
--- a/thirdparty/openssl/crypto/evp/pmeth_fn.c
+++ b/thirdparty/openssl/crypto/evp/pmeth_fn.c
@@ -65,20 +65,22 @@
#include "evp_locl.h"
#define M_check_autoarg(ctx, arg, arglen, err) \
- if (ctx->pmeth->flags & EVP_PKEY_FLAG_AUTOARGLEN) \
- { \
- size_t pksize = (size_t)EVP_PKEY_size(ctx->pkey); \
- if (!arg) \
- { \
- *arglen = pksize; \
- return 1; \
- } \
- else if (*arglen < pksize) \
- { \
- EVPerr(err, EVP_R_BUFFER_TOO_SMALL); /*ckerr_ignore*/\
- return 0; \
- } \
- }
+ if (ctx->pmeth->flags & EVP_PKEY_FLAG_AUTOARGLEN) { \
+ size_t pksize = (size_t)EVP_PKEY_size(ctx->pkey); \
+ \
+ if (pksize == 0) { \
+ EVPerr(err, EVP_R_INVALID_KEY); /*ckerr_ignore*/ \
+ return 0; \
+ } \
+ if (!arg) { \
+ *arglen = pksize; \
+ return 1; \
+ } \
+ if (*arglen < pksize) { \
+ EVPerr(err, EVP_R_BUFFER_TOO_SMALL); /*ckerr_ignore*/ \
+ return 0; \
+ } \
+ }
int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx)
{
diff --git a/thirdparty/openssl/crypto/evp/pmeth_gn.c b/thirdparty/openssl/crypto/evp/pmeth_gn.c
index 6435f1b632..6a4d3573ff 100644
--- a/thirdparty/openssl/crypto/evp/pmeth_gn.c
+++ b/thirdparty/openssl/crypto/evp/pmeth_gn.c
@@ -149,8 +149,10 @@ int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
if (!ppkey)
return -1;
- if (!*ppkey)
+ if (*ppkey == NULL)
*ppkey = EVP_PKEY_new();
+ if (*ppkey == NULL)
+ return -1;
ret = ctx->pmeth->keygen(ctx, *ppkey);
if (ret <= 0) {
diff --git a/thirdparty/openssl/crypto/evp/pmeth_lib.c b/thirdparty/openssl/crypto/evp/pmeth_lib.c
index 9f81d10021..b7b7bdcd02 100644
--- a/thirdparty/openssl/crypto/evp/pmeth_lib.c
+++ b/thirdparty/openssl/crypto/evp/pmeth_lib.c
@@ -91,7 +91,9 @@ static const EVP_PKEY_METHOD *standard_methods[] = {
&ec_pkey_meth,
#endif
&hmac_pkey_meth,
+#ifndef OPENSSL_NO_CMAC
&cmac_pkey_meth,
+#endif
#ifndef OPENSSL_NO_DH
&dhx_pkey_meth
#endif
@@ -186,6 +188,7 @@ static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id)
if (pmeth->init) {
if (pmeth->init(ret) <= 0) {
+ ret->pmeth = NULL;
EVP_PKEY_CTX_free(ret);
return NULL;
}
@@ -197,6 +200,7 @@ static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id)
EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags)
{
EVP_PKEY_METHOD *pmeth;
+
pmeth = OPENSSL_malloc(sizeof(EVP_PKEY_METHOD));
if (!pmeth)
return NULL;
@@ -205,33 +209,6 @@ EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags)
pmeth->pkey_id = id;
pmeth->flags = flags | EVP_PKEY_FLAG_DYNAMIC;
-
- pmeth->init = 0;
- pmeth->copy = 0;
- pmeth->cleanup = 0;
- pmeth->paramgen_init = 0;
- pmeth->paramgen = 0;
- pmeth->keygen_init = 0;
- pmeth->keygen = 0;
- pmeth->sign_init = 0;
- pmeth->sign = 0;
- pmeth->verify_init = 0;
- pmeth->verify = 0;
- pmeth->verify_recover_init = 0;
- pmeth->verify_recover = 0;
- pmeth->signctx_init = 0;
- pmeth->signctx = 0;
- pmeth->verifyctx_init = 0;
- pmeth->verifyctx = 0;
- pmeth->encrypt_init = 0;
- pmeth->encrypt = 0;
- pmeth->decrypt_init = 0;
- pmeth->decrypt = 0;
- pmeth->derive_init = 0;
- pmeth->derive = 0;
- pmeth->ctrl = 0;
- pmeth->ctrl_str = 0;
-
return pmeth;
}
@@ -339,6 +316,7 @@ EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *pctx)
if (pctx->pmeth->copy(rctx, pctx) > 0)
return rctx;
+ rctx->pmeth = NULL;
EVP_PKEY_CTX_free(rctx);
return NULL;
diff --git a/thirdparty/openssl/crypto/ex_data.c b/thirdparty/openssl/crypto/ex_data.c
index f96a51781a..108a1959ea 100644
--- a/thirdparty/openssl/crypto/ex_data.c
+++ b/thirdparty/openssl/crypto/ex_data.c
@@ -331,7 +331,11 @@ static EX_CLASS_ITEM *def_get_class(int class_index)
* from the insert will be NULL
*/
(void)lh_EX_CLASS_ITEM_insert(ex_data, gen);
- p = gen;
+ p = lh_EX_CLASS_ITEM_retrieve(ex_data, &d);
+ if (p != gen) {
+ sk_CRYPTO_EX_DATA_FUNCS_free(gen->meth);
+ OPENSSL_free(gen);
+ }
}
}
}
@@ -455,7 +459,7 @@ static int int_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
CRYPTO_EX_DATA *from)
{
int mx, j, i;
- char *ptr;
+ void *ptr;
CRYPTO_EX_DATA_FUNCS **storage = NULL;
EX_CLASS_ITEM *item;
if (!from->sk)
@@ -469,6 +473,8 @@ static int int_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
if (j < mx)
mx = j;
if (mx > 0) {
+ if (!CRYPTO_set_ex_data(to, mx - 1, NULL))
+ goto skip;
storage = OPENSSL_malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS *));
if (!storage)
goto skip;
@@ -499,11 +505,12 @@ static void int_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
int mx, i;
EX_CLASS_ITEM *item;
void *ptr;
+ CRYPTO_EX_DATA_FUNCS *f;
CRYPTO_EX_DATA_FUNCS **storage = NULL;
if (ex_data == NULL)
- return;
+ goto err;
if ((item = def_get_class(class_index)) == NULL)
- return;
+ goto err;
CRYPTO_r_lock(CRYPTO_LOCK_EX_DATA);
mx = sk_CRYPTO_EX_DATA_FUNCS_num(item->meth);
if (mx > 0) {
@@ -515,23 +522,23 @@ static void int_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
}
skip:
CRYPTO_r_unlock(CRYPTO_LOCK_EX_DATA);
- if ((mx > 0) && !storage) {
- CRYPTOerr(CRYPTO_F_INT_FREE_EX_DATA, ERR_R_MALLOC_FAILURE);
- return;
- }
for (i = 0; i < mx; i++) {
- if (storage[i] && storage[i]->free_func) {
+ if (storage != NULL)
+ f = storage[i];
+ else {
+ CRYPTO_r_lock(CRYPTO_LOCK_EX_DATA);
+ f = sk_CRYPTO_EX_DATA_FUNCS_value(item->meth, i);
+ CRYPTO_r_unlock(CRYPTO_LOCK_EX_DATA);
+ }
+ if (f != NULL && f->free_func != NULL) {
ptr = CRYPTO_get_ex_data(ad, i);
- storage[i]->free_func(obj, ptr, ad, i,
- storage[i]->argl, storage[i]->argp);
+ f->free_func(obj, ptr, ad, i, f->argl, f->argp);
}
}
- if (storage)
- OPENSSL_free(storage);
- if (ad->sk) {
- sk_void_free(ad->sk);
- ad->sk = NULL;
- }
+ OPENSSL_free(storage);
+ err:
+ sk_void_free(ad->sk);
+ ad->sk = NULL;
}
/********************************************************************/
diff --git a/thirdparty/openssl/crypto/hmac/hm_pmeth.c b/thirdparty/openssl/crypto/hmac/hm_pmeth.c
index 0ffff79cc4..0a59a01cf0 100644
--- a/thirdparty/openssl/crypto/hmac/hm_pmeth.c
+++ b/thirdparty/openssl/crypto/hmac/hm_pmeth.c
@@ -99,15 +99,18 @@ static int pkey_hmac_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)
sctx = src->data;
dctx = dst->data;
dctx->md = sctx->md;
- HMAC_CTX_init(&dctx->ctx);
if (!HMAC_CTX_copy(&dctx->ctx, &sctx->ctx))
- return 0;
- if (sctx->ktmp.data) {
+ goto err;
+ if (sctx->ktmp.data != NULL) {
if (!ASN1_OCTET_STRING_set(&dctx->ktmp,
sctx->ktmp.data, sctx->ktmp.length))
- return 0;
+ goto err;
}
return 1;
+ err:
+ HMAC_CTX_cleanup(&dctx->ctx);
+ OPENSSL_free(dctx);
+ return 0;
}
static void pkey_hmac_cleanup(EVP_PKEY_CTX *ctx)
diff --git a/thirdparty/openssl/crypto/hmac/hmac.c b/thirdparty/openssl/crypto/hmac/hmac.c
index 51a0a3efcd..213504e85f 100644
--- a/thirdparty/openssl/crypto/hmac/hmac.c
+++ b/thirdparty/openssl/crypto/hmac/hmac.c
@@ -234,7 +234,7 @@ void HMAC_CTX_cleanup(HMAC_CTX *ctx)
EVP_MD_CTX_cleanup(&ctx->i_ctx);
EVP_MD_CTX_cleanup(&ctx->o_ctx);
EVP_MD_CTX_cleanup(&ctx->md_ctx);
- memset(ctx, 0, sizeof *ctx);
+ OPENSSL_cleanse(ctx, sizeof *ctx);
}
unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
diff --git a/thirdparty/openssl/crypto/include/internal/bn_conf.h b/thirdparty/openssl/crypto/include/internal/bn_conf.h
new file mode 100644
index 0000000000..34bd8b78b4
--- /dev/null
+++ b/thirdparty/openssl/crypto/include/internal/bn_conf.h
@@ -0,0 +1,28 @@
+/* WARNING: do not edit! */
+/* Generated by Makefile from crypto/include/internal/bn_conf.h.in */
+/*
+ * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef HEADER_BN_CONF_H
+# define HEADER_BN_CONF_H
+
+/*
+ * The contents of this file are not used in the UEFI build, as
+ * both 32-bit and 64-bit builds are supported from a single run
+ * of the Configure script.
+ */
+
+/* Should we define BN_DIV2W here? */
+
+/* Only one for the following should be defined */
+#define SIXTY_FOUR_BIT_LONG
+#undef SIXTY_FOUR_BIT
+#undef THIRTY_TWO_BIT
+
+#endif
diff --git a/thirdparty/openssl/crypto/include/internal/dso_conf.h b/thirdparty/openssl/crypto/include/internal/dso_conf.h
new file mode 100644
index 0000000000..7a52dd1f1a
--- /dev/null
+++ b/thirdparty/openssl/crypto/include/internal/dso_conf.h
@@ -0,0 +1,16 @@
+/* WARNING: do not edit! */
+/* Generated by Makefile from crypto/include/internal/dso_conf.h.in */
+/*
+ * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef HEADER_DSO_CONF_H
+# define HEADER_DSO_CONF_H
+
+# define DSO_EXTENSION ".so"
+#endif
diff --git a/thirdparty/openssl/crypto/install-crypto.com b/thirdparty/openssl/crypto/install-crypto.com
deleted file mode 100755
index af1d75b526..0000000000
--- a/thirdparty/openssl/crypto/install-crypto.com
+++ /dev/null
@@ -1,196 +0,0 @@
-$! INSTALL.COM -- Installs the files in a given directory tree
-$!
-$! Author: Richard Levitte <richard@levitte.org>
-$! Time of creation: 22-MAY-1998 10:13
-$!
-$! Changes by Zoltan Arpadffy <zoli@polarhome.com>
-$!
-$! P1 root of the directory tree
-$! P2 "64" for 64-bit pointers.
-$!
-$!
-$! Announce/identify.
-$!
-$ proc = f$environment( "procedure")
-$ write sys$output "@@@ "+ -
- f$parse( proc, , , "name")+ f$parse( proc, , , "type")
-$!
-$ on error then goto tidy
-$ on control_c then goto tidy
-$!
-$ if (p1 .eqs. "")
-$ then
-$ write sys$output "First argument missing."
-$ write sys$output -
- "It should be the directory where you want things installed."
-$ exit
-$ endif
-$!
-$ if (f$getsyi( "cpu") .lt. 128)
-$ then
-$ arch = "VAX"
-$ else
-$ arch = f$edit( f$getsyi( "arch_name"), "upcase")
-$ if (arch .eqs. "") then arch = "UNK"
-$ endif
-$!
-$ archd = arch
-$ lib32 = "32"
-$ shr = "_SHR32"
-$!
-$ if (p2 .nes. "")
-$ then
-$ if (p2 .eqs. "64")
-$ then
-$ archd = arch+ "_64"
-$ lib32 = ""
-$ shr = "_SHR"
-$ else
-$ if (p2 .nes. "32")
-$ then
-$ write sys$output "Second argument invalid."
-$ write sys$output "It should be "32", "64", or nothing."
-$ exit
-$ endif
-$ endif
-$ endif
-$!
-$ root = f$parse( p1, "[]A.;0", , , "syntax_only, no_conceal") - "A.;0"
-$ root_dev = f$parse( root, , , "device", "syntax_only")
-$ root_dir = f$parse( root, , , "directory", "syntax_only") - -
- "[000000." - "][" - "[" - "]"
-$ root = root_dev + "[" + root_dir
-$!
-$ define /nolog wrk_sslroot 'root'.] /trans=conc
-$ define /nolog wrk_sslinclude wrk_sslroot:[include]
-$ define /nolog wrk_sslxlib wrk_sslroot:['arch'_lib]
-$!
-$ if f$parse("wrk_sslroot:[000000]") .eqs. "" then -
- create /directory /log wrk_sslroot:[000000]
-$ if f$parse("wrk_sslinclude:") .eqs. "" then -
- create /directory /log wrk_sslinclude:
-$ if f$parse("wrk_sslxlib:") .eqs. "" then -
- create /directory /log wrk_sslxlib:
-$!
-$ sdirs := , -
- 'archd', -
- objects, -
- md4, md5, sha, mdc2, hmac, ripemd, whrlpool, -
- des, aes, rc2, rc4, idea, bf, cast, camellia, seed, -
- bn, ec, rsa, dsa, ecdsa, dh, ecdh, dso, engine, -
- buffer, bio, stack, lhash, rand, err, -
- evp, asn1, pem, x509, x509v3, conf, txt_db, pkcs7, pkcs12, comp, ocsp, -
- ui, krb5, -
- store, cms, pqueue, ts, jpake
-$!
-$ exheader_ := crypto.h, opensslv.h, ebcdic.h, symhacks.h, ossl_typ.h
-$ exheader_'archd' := opensslconf.h
-$ exheader_objects := objects.h, obj_mac.h
-$ exheader_md2 := md2.h
-$ exheader_md4 := md4.h
-$ exheader_md5 := md5.h
-$ exheader_sha := sha.h
-$ exheader_mdc2 := mdc2.h
-$ exheader_hmac := hmac.h
-$ exheader_ripemd := ripemd.h
-$ exheader_whrlpool := whrlpool.h
-$ exheader_des := des.h, des_old.h
-$ exheader_aes := aes.h
-$ exheader_rc2 := rc2.h
-$ exheader_rc4 := rc4.h
-$ exheader_rc5 := rc5.h
-$ exheader_idea := idea.h
-$ exheader_bf := blowfish.h
-$ exheader_cast := cast.h
-$ exheader_camellia := camellia.h
-$ exheader_seed := seed.h
-$ exheader_modes := modes.h
-$ exheader_bn := bn.h
-$ exheader_ec := ec.h
-$ exheader_rsa := rsa.h
-$ exheader_dsa := dsa.h
-$ exheader_ecdsa := ecdsa.h
-$ exheader_dh := dh.h
-$ exheader_ecdh := ecdh.h
-$ exheader_dso := dso.h
-$ exheader_engine := engine.h
-$ exheader_buffer := buffer.h
-$ exheader_bio := bio.h
-$ exheader_stack := stack.h, safestack.h
-$ exheader_lhash := lhash.h
-$ exheader_rand := rand.h
-$ exheader_err := err.h
-$ exheader_evp := evp.h
-$ exheader_asn1 := asn1.h, asn1_mac.h, asn1t.h
-$ exheader_pem := pem.h, pem2.h
-$ exheader_x509 := x509.h, x509_vfy.h
-$ exheader_x509v3 := x509v3.h
-$ exheader_conf := conf.h, conf_api.h
-$ exheader_txt_db := txt_db.h
-$ exheader_pkcs7 := pkcs7.h
-$ exheader_pkcs12 := pkcs12.h
-$ exheader_comp := comp.h
-$ exheader_ocsp := ocsp.h
-$ exheader_ui := ui.h, ui_compat.h
-$ exheader_krb5 := krb5_asn.h
-$! exheader_store := store.h, str_compat.h
-$ exheader_store := store.h
-$ exheader_cms := cms.h
-$ exheader_pqueue := pqueue.h
-$ exheader_ts := ts.h
-$ exheader_jpake := jpake.h
-$ libs := ssl_libcrypto
-$!
-$ exe_dir := [-.'archd'.exe.crypto]
-$!
-$! Header files.
-$!
-$ i = 0
-$ loop_sdirs:
-$ d = f$edit( f$element( i, ",", sdirs), "trim")
-$ i = i + 1
-$ if d .eqs. "," then goto loop_sdirs_end
-$ tmp = exheader_'d'
-$ if (d .nes. "") then d = "."+ d
-$ copy /protection = w:re ['d']'tmp' wrk_sslinclude: /log
-$ goto loop_sdirs
-$ loop_sdirs_end:
-$!
-$! Object libraries, shareable images.
-$!
-$ i = 0
-$ loop_lib:
-$ e = f$edit( f$element( i, ",", libs), "trim")
-$ i = i + 1
-$ if e .eqs. "," then goto loop_lib_end
-$ set noon
-$ file = exe_dir+ e+ lib32+ ".olb"
-$ if f$search( file) .nes. ""
-$ then
-$ copy /protection = w:re 'file' wrk_sslxlib: /log
-$ endif
-$!
-$ file = exe_dir+ e+ shr+ ".exe"
-$ if f$search( file) .nes. ""
-$ then
-$ copy /protection = w:re 'file' wrk_sslxlib: /log
-$ endif
-$ set on
-$ goto loop_lib
-$ loop_lib_end:
-$!
-$ tidy:
-$!
-$ call deass wrk_sslroot
-$ call deass wrk_sslinclude
-$ call deass wrk_sslxlib
-$!
-$ exit
-$!
-$ deass: subroutine
-$ if (f$trnlnm( p1, "LNM$PROCESS") .nes. "")
-$ then
-$ deassign /process 'p1'
-$ endif
-$ endsubroutine
-$!
diff --git a/thirdparty/openssl/crypto/jpake/jpake.c b/thirdparty/openssl/crypto/jpake/jpake.c
index ebc0975575..2ba75f0172 100644
--- a/thirdparty/openssl/crypto/jpake/jpake.c
+++ b/thirdparty/openssl/crypto/jpake/jpake.c
@@ -116,6 +116,8 @@ JPAKE_CTX *JPAKE_CTX_new(const char *name, const char *peer_name,
const BIGNUM *secret)
{
JPAKE_CTX *ctx = OPENSSL_malloc(sizeof *ctx);
+ if (ctx == NULL)
+ return NULL;
JPAKE_CTX_init(ctx, name, peer_name, p, g, q, secret);
@@ -151,6 +153,8 @@ static void hashbn(SHA_CTX *sha, const BIGNUM *bn)
size_t l = BN_num_bytes(bn);
unsigned char *bin = OPENSSL_malloc(l);
+ if (bin == NULL)
+ return;
hashlength(sha, l);
BN_bn2bin(bn, bin);
SHA1_Update(sha, bin, l);
diff --git a/thirdparty/openssl/crypto/lhash/lhash.c b/thirdparty/openssl/crypto/lhash/lhash.c
index 53c5c138bb..f20353aea3 100644
--- a/thirdparty/openssl/crypto/lhash/lhash.c
+++ b/thirdparty/openssl/crypto/lhash/lhash.c
@@ -335,8 +335,8 @@ static void expand(_LHASH *lh)
n = (LHASH_NODE **)OPENSSL_realloc(lh->b,
(int)(sizeof(LHASH_NODE *) * j));
if (n == NULL) {
-/* fputs("realloc error in lhash",stderr); */
lh->error++;
+ lh->num_nodes--;
lh->p = 0;
return;
}
diff --git a/thirdparty/openssl/crypto/md2/md2_dgst.c b/thirdparty/openssl/crypto/md2/md2_dgst.c
index 9cd79f8d70..7f5d9ba69b 100644
--- a/thirdparty/openssl/crypto/md2/md2_dgst.c
+++ b/thirdparty/openssl/crypto/md2/md2_dgst.c
@@ -219,6 +219,6 @@ int MD2_Final(unsigned char *md, MD2_CTX *c)
for (i = 0; i < 16; i++)
md[i] = (UCHAR) (p1[i] & 0xff);
- memset((char *)&c, 0, sizeof(c));
+ OPENSSL_cleanse(c, sizeof(*c));
return 1;
}
diff --git a/thirdparty/openssl/crypto/md32_common.h b/thirdparty/openssl/crypto/md32_common.h
index 96828d2693..b5a04bf133 100644
--- a/thirdparty/openssl/crypto/md32_common.h
+++ b/thirdparty/openssl/crypto/md32_common.h
@@ -109,6 +109,8 @@
* <appro@fy.chalmers.se>
*/
+#include <openssl/crypto.h>
+
#if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN)
# error "DATA_ORDER must be defined!"
#endif
@@ -329,6 +331,12 @@ int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len)
data += n;
len -= n;
c->num = 0;
+ /*
+ * We use memset rather than OPENSSL_cleanse() here deliberately.
+ * Using OPENSSL_cleanse() here could be a performance issue. It
+ * will get properly cleansed on finalisation so this isn't a
+ * security problem.
+ */
memset(p, 0, HASH_CBLOCK); /* keep it zeroed */
} else {
memcpy(p + n, data, len);
@@ -384,7 +392,7 @@ int HASH_FINAL(unsigned char *md, HASH_CTX *c)
p -= HASH_CBLOCK;
HASH_BLOCK_DATA_ORDER(c, p, 1);
c->num = 0;
- memset(p, 0, HASH_CBLOCK);
+ OPENSSL_cleanse(p, HASH_CBLOCK);
#ifndef HASH_MAKE_STRING
# error "HASH_MAKE_STRING must be defined!"
diff --git a/thirdparty/openssl/crypto/mdc2/mdc2dgst.c b/thirdparty/openssl/crypto/mdc2/mdc2dgst.c
index 6615cf84d7..2dce493633 100644
--- a/thirdparty/openssl/crypto/mdc2/mdc2dgst.c
+++ b/thirdparty/openssl/crypto/mdc2/mdc2dgst.c
@@ -91,7 +91,7 @@ int MDC2_Update(MDC2_CTX *c, const unsigned char *in, size_t len)
i = c->num;
if (i != 0) {
- if (i + len < MDC2_BLOCK) {
+ if (len < MDC2_BLOCK - i) {
/* partial block */
memcpy(&(c->data[i]), in, len);
c->num += (int)len;
diff --git a/thirdparty/openssl/crypto/mem.c b/thirdparty/openssl/crypto/mem.c
index fdad49b76e..dd4c9ce9e0 100644
--- a/thirdparty/openssl/crypto/mem.c
+++ b/thirdparty/openssl/crypto/mem.c
@@ -82,6 +82,14 @@ static void *default_malloc_ex(size_t num, const char *file, int line)
static void *(*malloc_ex_func) (size_t, const char *file, int line)
= default_malloc_ex;
+#ifdef OPENSSL_SYS_VMS
+# if __INITIAL_POINTER_SIZE == 64
+# define realloc _realloc64
+# elif __INITIAL_POINTER_SIZE == 32
+# define realloc _realloc32
+# endif
+#endif
+
static void *(*realloc_func) (void *, size_t) = realloc;
static void *default_realloc_ex(void *str, size_t num,
const char *file, int line)
@@ -92,7 +100,11 @@ static void *default_realloc_ex(void *str, size_t num,
static void *(*realloc_ex_func) (void *, size_t, const char *file, int line)
= default_realloc_ex;
-static void (*free_func) (void *) = free;
+#ifdef OPENSSL_SYS_VMS
+ static void (*free_func) (__void_ptr64) = free;
+#else
+ static void (*free_func) (void *) = free;
+#endif
static void *(*malloc_locked_func) (size_t) = malloc;
static void *default_malloc_locked_ex(size_t num, const char *file, int line)
@@ -103,7 +115,11 @@ static void *default_malloc_locked_ex(size_t num, const char *file, int line)
static void *(*malloc_locked_ex_func) (size_t, const char *file, int line)
= default_malloc_locked_ex;
-static void (*free_locked_func) (void *) = free;
+#ifdef OPENSSL_SYS_VMS
+ static void (*free_locked_func) (__void_ptr64) = free;
+#else
+ static void (*free_locked_func) (void *) = free;
+#endif
/* may be changed as long as 'allow_customize_debug' is set */
/* XXX use correct function pointer types */
@@ -134,12 +150,12 @@ static long (*get_debug_options_func) (void) = NULL;
int CRYPTO_set_mem_functions(void *(*m) (size_t), void *(*r) (void *, size_t),
void (*f) (void *))
{
- /* Dummy call just to ensure OPENSSL_init() gets linked in */
- OPENSSL_init();
if (!allow_customize)
return 0;
if ((m == 0) || (r == 0) || (f == 0))
return 0;
+ /* Dummy call just to ensure OPENSSL_init() gets linked in */
+ OPENSSL_init();
malloc_func = m;
malloc_ex_func = default_malloc_ex;
realloc_func = r;
@@ -298,18 +314,6 @@ void *CRYPTO_malloc_locked(int num, const char *file, int line)
if (malloc_debug_func != NULL)
malloc_debug_func(ret, num, file, line, 1);
-#ifndef OPENSSL_CPUID_OBJ
- /*
- * Create a dependency on the value of 'cleanse_ctr' so our memory
- * sanitisation function can't be optimised out. NB: We only do this for
- * >2Kb so the overhead doesn't bother us.
- */
- if (ret && (num > 2048)) {
- extern unsigned char cleanse_ctr;
- ((unsigned char *)ret)[0] = cleanse_ctr;
- }
-#endif
-
return ret;
}
@@ -346,18 +350,6 @@ void *CRYPTO_malloc(int num, const char *file, int line)
if (malloc_debug_func != NULL)
malloc_debug_func(ret, num, file, line, 1);
-#ifndef OPENSSL_CPUID_OBJ
- /*
- * Create a dependency on the value of 'cleanse_ctr' so our memory
- * sanitisation function can't be optimised out. NB: We only do this for
- * >2Kb so the overhead doesn't bother us.
- */
- if (ret && (num > 2048)) {
- extern unsigned char cleanse_ctr;
- ((unsigned char *)ret)[0] = cleanse_ctr;
- }
-#endif
-
return ret;
}
diff --git a/thirdparty/openssl/crypto/mem_clr.c b/thirdparty/openssl/crypto/mem_clr.c
index ab85344eef..579e9d1825 100644
--- a/thirdparty/openssl/crypto/mem_clr.c
+++ b/thirdparty/openssl/crypto/mem_clr.c
@@ -60,22 +60,16 @@
#include <string.h>
#include <openssl/crypto.h>
-unsigned char cleanse_ctr = 0;
+/*
+ * Pointer to memset is volatile so that compiler must de-reference
+ * the pointer and can't assume that it points to any function in
+ * particular (such as memset, which it then might further "optimize")
+ */
+typedef void *(*memset_t)(void *,int,size_t);
+
+static volatile memset_t memset_func = memset;
void OPENSSL_cleanse(void *ptr, size_t len)
{
- unsigned char *p = ptr;
- size_t loop = len, ctr = cleanse_ctr;
-
- if (ptr == NULL)
- return;
-
- while (loop--) {
- *(p++) = (unsigned char)ctr;
- ctr += (17 + ((size_t)p & 0xF));
- }
- p = memchr(ptr, (unsigned char)ctr, len);
- if (p)
- ctr += (63 + (size_t)p);
- cleanse_ctr = (unsigned char)ctr;
+ memset_func(ptr, 0, len);
}
diff --git a/thirdparty/openssl/crypto/modes/ctr128.c b/thirdparty/openssl/crypto/modes/ctr128.c
index bcafd6b6bf..d4b22728e6 100644
--- a/thirdparty/openssl/crypto/modes/ctr128.c
+++ b/thirdparty/openssl/crypto/modes/ctr128.c
@@ -100,7 +100,7 @@ static void ctr128_inc_aligned(unsigned char *counter)
--n;
d = data[n] += c;
/* did addition carry? */
- c = ((d - c) ^ d) >> (sizeof(size_t) * 8 - 1);
+ c = ((d - c) & ~d) >> (sizeof(size_t) * 8 - 1);
} while (n);
}
#endif
diff --git a/thirdparty/openssl/crypto/o_dir.c b/thirdparty/openssl/crypto/o_dir.c
index f9dbed8711..fb3b2fd8e4 100644
--- a/thirdparty/openssl/crypto/o_dir.c
+++ b/thirdparty/openssl/crypto/o_dir.c
@@ -73,7 +73,8 @@
#include "o_dir.h"
#define LPDIR_H
-#if defined OPENSSL_SYS_UNIX || defined DJGPP
+#if defined OPENSSL_SYS_UNIX || defined DJGPP \
+ || (defined __VMS_VER && __VMS_VER >= 70000000)
# include "LPdir_unix.c"
#elif defined OPENSSL_SYS_VMS
# include "LPdir_vms.c"
diff --git a/thirdparty/openssl/crypto/o_init.c b/thirdparty/openssl/crypto/o_init.c
index 2088388128..185841ea04 100644
--- a/thirdparty/openssl/crypto/o_init.c
+++ b/thirdparty/openssl/crypto/o_init.c
@@ -73,6 +73,9 @@ void OPENSSL_init(void)
done = 1;
#ifdef OPENSSL_FIPS
FIPS_set_locking_callbacks(CRYPTO_lock, CRYPTO_add_lock);
+# ifndef OPENSSL_NO_DEPRECATED
+ FIPS_crypto_set_id_callback(CRYPTO_thread_id);
+# endif
FIPS_set_error_callbacks(ERR_put_error, ERR_add_error_vdata);
FIPS_set_malloc_callbacks(CRYPTO_malloc, CRYPTO_free);
RAND_init_fips();
diff --git a/thirdparty/openssl/crypto/o_str.c b/thirdparty/openssl/crypto/o_str.c
index c10842300d..1854798e2c 100644
--- a/thirdparty/openssl/crypto/o_str.c
+++ b/thirdparty/openssl/crypto/o_str.c
@@ -59,16 +59,15 @@
#include <ctype.h>
#include <e_os.h>
+// -- GODOT start --
+#include <openssl/opensslconf.h>
+// -- GODOT end --
#include "o_str.h"
#if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && \
!defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && \
!defined(NETWARE_CLIB)
-#ifdef _WIN32
-#include <string.h>
-#else
-#include <strings.h>
-#endif
+# include <strings.h>
#endif
int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n)
diff --git a/thirdparty/openssl/crypto/o_time.c b/thirdparty/openssl/crypto/o_time.c
index 635dae184d..04d805d9a9 100644..100755
--- a/thirdparty/openssl/crypto/o_time.c
+++ b/thirdparty/openssl/crypto/o_time.c
@@ -78,18 +78,36 @@
# include <descrip.h>
# include <stdlib.h>
# endif /* ndef VMS_GMTIME_OK */
-#endif
+
+
+/*
+ * Needed to pick up the correct definitions and declarations in some of the
+ * DEC C Header Files (*.H).
+ */
+# define __NEW_STARLET 1
+
+# if (defined(__alpha) || defined(__ia64))
+# include <iledef.h>
+# else
+
+/* VAX */
+typedef struct _ile3 { /* Copied from ILEDEF.H for Alpha */
+# pragma __nomember_alignment
+ unsigned short int ile3$w_length; /* Length of buffer in bytes */
+ unsigned short int ile3$w_code; /* Item code value */
+ void *ile3$ps_bufaddr; /* Buffer address */
+ unsigned short int *ile3$ps_retlen_addr; /* Address of word for returned length */
+} ILE3;
+# endif /* alpha || ia64 */
+#endif /* OPENSSL_SYS_VMS */
struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
{
struct tm *ts = NULL;
#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_OS2) && (!defined(OPENSSL_SYS_VMS) || defined(gmtime_r)) && !defined(OPENSSL_SYS_MACOSX) && !defined(OPENSSL_SYS_SUNOS)
- /*
- * should return &data, but doesn't on some systems, so we don't even
- * look at the return value
- */
- gmtime_r(timer, result);
+ if (gmtime_r(timer, result) == NULL)
+ return NULL;
ts = result;
#elif !defined(OPENSSL_SYS_VMS) || defined(VMS_GMTIME_OK)
ts = gmtime(timer);
@@ -105,26 +123,42 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
static $DESCRIPTOR(lognam, "SYS$TIMEZONE_DIFFERENTIAL");
char logvalue[256];
unsigned int reslen = 0;
- struct {
- short buflen;
- short code;
- void *bufaddr;
- unsigned int *reslen;
- } itemlist[] = {
- {
- 0, LNM$_STRING, 0, 0
- },
- {
- 0, 0, 0, 0
- },
- };
+# if __INITIAL_POINTER_SIZE == 64
+ ILEB_64 itemlist[2], *pitem;
+# else
+ ILE3 itemlist[2], *pitem;
+# endif
int status;
time_t t;
+
+ /*
+ * Setup an itemlist for the call to $TRNLNM - Translate Logical Name.
+ */
+ pitem = itemlist;
+
+# if __INITIAL_POINTER_SIZE == 64
+ pitem->ileb_64$w_mbo = 1;
+ pitem->ileb_64$w_code = LNM$_STRING;
+ pitem->ileb_64$l_mbmo = -1;
+ pitem->ileb_64$q_length = sizeof (logvalue);
+ pitem->ileb_64$pq_bufaddr = logvalue;
+ pitem->ileb_64$pq_retlen_addr = (unsigned __int64 *) &reslen;
+ pitem++;
+ /* Last item of the item list is null terminated */
+ pitem->ileb_64$q_length = pitem->ileb_64$w_code = 0;
+# else
+ pitem->ile3$w_length = sizeof (logvalue);
+ pitem->ile3$w_code = LNM$_STRING;
+ pitem->ile3$ps_bufaddr = logvalue;
+ pitem->ile3$ps_retlen_addr = (unsigned short int *) &reslen;
+ pitem++;
+ /* Last item of the item list is null terminated */
+ pitem->ile3$w_length = pitem->ile3$w_code = 0;
+# endif
+
+
/* Get the value for SYS$TIMEZONE_DIFFERENTIAL */
- itemlist[0].buflen = sizeof(logvalue);
- itemlist[0].bufaddr = logvalue;
- itemlist[0].reslen = &reslen;
status = sys$trnlnm(0, &tabnam, &lognam, 0, itemlist);
if (!(status & 1))
return NULL;
@@ -132,7 +166,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
t = *timer;
-/* The following is extracted from the DEC C header time.h */
+ /* The following is extracted from the DEC C header time.h */
/*
** Beginning in OpenVMS Version 7.0 mktime, time, ctime, strftime
** have two implementations. One implementation is provided
diff --git a/thirdparty/openssl/crypto/objects/o_names.c b/thirdparty/openssl/crypto/objects/o_names.c
index 24859926ac..f106905ffa 100644
--- a/thirdparty/openssl/crypto/objects/o_names.c
+++ b/thirdparty/openssl/crypto/objects/o_names.c
@@ -191,7 +191,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data)
onp = (OBJ_NAME *)OPENSSL_malloc(sizeof(OBJ_NAME));
if (onp == NULL) {
/* ERROR */
- return (0);
+ return 0;
}
onp->name = name;
@@ -216,10 +216,11 @@ int OBJ_NAME_add(const char *name, int type, const char *data)
} else {
if (lh_OBJ_NAME_error(names_lh)) {
/* ERROR */
- return (0);
+ OPENSSL_free(onp);
+ return 0;
}
}
- return (1);
+ return 1;
}
int OBJ_NAME_remove(const char *name, int type)
diff --git a/thirdparty/openssl/crypto/ocsp/ocsp_cl.c b/thirdparty/openssl/crypto/ocsp/ocsp_cl.c
index b3612c8dfc..fca7db0b71 100644
--- a/thirdparty/openssl/crypto/ocsp/ocsp_cl.c
+++ b/thirdparty/openssl/crypto/ocsp/ocsp_cl.c
@@ -93,8 +93,10 @@ OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid)
if (one->reqCert)
OCSP_CERTID_free(one->reqCert);
one->reqCert = cid;
- if (req && !sk_OCSP_ONEREQ_push(req->tbsRequest->requestList, one))
+ if (req && !sk_OCSP_ONEREQ_push(req->tbsRequest->requestList, one)) {
+ one->reqCert = NULL; /* do not free on error */
goto err;
+ }
return one;
err:
OCSP_ONEREQ_free(one);
diff --git a/thirdparty/openssl/crypto/ocsp/ocsp_ext.c b/thirdparty/openssl/crypto/ocsp/ocsp_ext.c
index c19648c732..55af31b573 100644
--- a/thirdparty/openssl/crypto/ocsp/ocsp_ext.c
+++ b/thirdparty/openssl/crypto/ocsp/ocsp_ext.c
@@ -361,7 +361,7 @@ static int ocsp_add1_nonce(STACK_OF(X509_EXTENSION) **exts,
ASN1_put_object(&tmpval, 0, len, V_ASN1_OCTET_STRING, V_ASN1_UNIVERSAL);
if (val)
memcpy(tmpval, val, len);
- else if (RAND_pseudo_bytes(tmpval, len) < 0)
+ else if (RAND_bytes(tmpval, len) <= 0)
goto err;
if (!X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce,
&os, 0, X509V3_ADD_REPLACE))
diff --git a/thirdparty/openssl/crypto/ocsp/ocsp_lib.c b/thirdparty/openssl/crypto/ocsp/ocsp_lib.c
index cabf53933a..ff781e56e7 100644
--- a/thirdparty/openssl/crypto/ocsp/ocsp_lib.c
+++ b/thirdparty/openssl/crypto/ocsp/ocsp_lib.c
@@ -271,12 +271,18 @@ int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
err:
if (buf)
OPENSSL_free(buf);
- if (*ppath)
+ if (*ppath) {
OPENSSL_free(*ppath);
- if (*pport)
+ *ppath = NULL;
+ }
+ if (*pport) {
OPENSSL_free(*pport);
- if (*phost)
+ *pport = NULL;
+ }
+ if (*phost) {
OPENSSL_free(*phost);
+ *phost = NULL;
+ }
return 0;
}
diff --git a/thirdparty/openssl/crypto/opensslconf.h.in b/thirdparty/openssl/crypto/opensslconf.h.in
deleted file mode 100644
index 7a1c85d6ec..0000000000
--- a/thirdparty/openssl/crypto/opensslconf.h.in
+++ /dev/null
@@ -1,154 +0,0 @@
-/* crypto/opensslconf.h.in */
-
-/* Generate 80386 code? */
-#undef I386_ONLY
-
-#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
-#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
-#define ENGINESDIR "/usr/local/lib/engines"
-#define OPENSSLDIR "/usr/local/ssl"
-#endif
-#endif
-
-#undef OPENSSL_UNISTD
-#define OPENSSL_UNISTD <unistd.h>
-
-#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
-
-#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
-#define IDEA_INT unsigned int
-#endif
-
-#if defined(HEADER_MD2_H) && !defined(MD2_INT)
-#define MD2_INT unsigned int
-#endif
-
-#if defined(HEADER_RC2_H) && !defined(RC2_INT)
-/* I need to put in a mod for the alpha - eay */
-#define RC2_INT unsigned int
-#endif
-
-#if defined(HEADER_RC4_H)
-#if !defined(RC4_INT)
-/* using int types make the structure larger but make the code faster
- * on most boxes I have tested - up to %20 faster. */
-/*
- * I don't know what does "most" mean, but declaring "int" is a must on:
- * - Intel P6 because partial register stalls are very expensive;
- * - elder Alpha because it lacks byte load/store instructions;
- */
-#define RC4_INT unsigned int
-#endif
-#if !defined(RC4_CHUNK)
-/*
- * This enables code handling data aligned at natural CPU word
- * boundary. See crypto/rc4/rc4_enc.c for further details.
- */
-#undef RC4_CHUNK
-#endif
-#endif
-
-#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)
-/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
- * %20 speed up (longs are 8 bytes, int's are 4). */
-#ifndef DES_LONG
-#define DES_LONG unsigned long
-#endif
-#endif
-
-#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
-#define CONFIG_HEADER_BN_H
-#undef BN_LLONG
-
-/* Should we define BN_DIV2W here? */
-
-/* Only one for the following should be defined */
-#undef SIXTY_FOUR_BIT_LONG
-#undef SIXTY_FOUR_BIT
-#define THIRTY_TWO_BIT
-#endif
-
-#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
-#define CONFIG_HEADER_RC4_LOCL_H
-/* if this is defined data[i] is used instead of *data, this is a %20
- * speedup on x86 */
-#undef RC4_INDEX
-#endif
-
-#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
-#define CONFIG_HEADER_BF_LOCL_H
-#undef BF_PTR
-#endif /* HEADER_BF_LOCL_H */
-
-#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
-#define CONFIG_HEADER_DES_LOCL_H
-#ifndef DES_DEFAULT_OPTIONS
-/* the following is tweaked from a config script, that is why it is a
- * protected undef/define */
-#ifndef DES_PTR
-#undef DES_PTR
-#endif
-
-/* This helps C compiler generate the correct code for multiple functional
- * units. It reduces register dependancies at the expense of 2 more
- * registers */
-#ifndef DES_RISC1
-#undef DES_RISC1
-#endif
-
-#ifndef DES_RISC2
-#undef DES_RISC2
-#endif
-
-#if defined(DES_RISC1) && defined(DES_RISC2)
-#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
-#endif
-
-/* Unroll the inner loop, this sometimes helps, sometimes hinders.
- * Very mucy CPU dependant */
-#ifndef DES_UNROLL
-#undef DES_UNROLL
-#endif
-
-/* These default values were supplied by
- * Peter Gutman <pgut001@cs.auckland.ac.nz>
- * They are only used if nothing else has been defined */
-#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)
-/* Special defines which change the way the code is built depending on the
- CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
- even newer MIPS CPU's, but at the moment one size fits all for
- optimization options. Older Sparc's work better with only UNROLL, but
- there's no way to tell at compile time what it is you're running on */
-
-#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
-# define DES_PTR
-# define DES_RISC1
-# define DES_UNROLL
-#elif defined( __ultrix ) /* Older MIPS */
-# define DES_PTR
-# define DES_RISC2
-# define DES_UNROLL
-#elif defined( __osf1__ ) /* Alpha */
-# define DES_PTR
-# define DES_RISC2
-#elif defined ( _AIX ) /* RS6000 */
- /* Unknown */
-#elif defined( __hpux ) /* HP-PA */
- /* Unknown */
-#elif defined( __aux ) /* 68K */
- /* Unknown */
-#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
-# define DES_UNROLL
-#elif defined( __sgi ) /* Newer MIPS */
-# define DES_PTR
-# define DES_RISC2
-# define DES_UNROLL
-#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */
-# define DES_PTR
-# define DES_RISC1
-# define DES_UNROLL
-#endif /* Systems-specific speed defines */
-#endif
-
-#endif /* DES_DEFAULT_OPTIONS */
-#endif /* HEADER_DES_LOCL_H */
diff --git a/thirdparty/openssl/crypto/pem/pem_err.c b/thirdparty/openssl/crypto/pem/pem_err.c
index e1f4fdb432..4e5f8e936c 100644
--- a/thirdparty/openssl/crypto/pem/pem_err.c
+++ b/thirdparty/openssl/crypto/pem/pem_err.c
@@ -1,6 +1,6 @@
/* crypto/pem/pem_err.c */
/* ====================================================================
- * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2016 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -132,6 +132,7 @@ static ERR_STRING_DATA PEM_str_reasons[] = {
"expecting private key blob"},
{ERR_REASON(PEM_R_EXPECTING_PUBLIC_KEY_BLOB),
"expecting public key blob"},
+ {ERR_REASON(PEM_R_HEADER_TOO_LONG), "header too long"},
{ERR_REASON(PEM_R_INCONSISTENT_HEADER), "inconsistent header"},
{ERR_REASON(PEM_R_KEYBLOB_HEADER_PARSE_ERROR),
"keyblob header parse error"},
diff --git a/thirdparty/openssl/crypto/pem/pem_lib.c b/thirdparty/openssl/crypto/pem/pem_lib.c
index fe881d6641..c82b3c0ae2 100644
--- a/thirdparty/openssl/crypto/pem/pem_lib.c
+++ b/thirdparty/openssl/crypto/pem/pem_lib.c
@@ -105,17 +105,23 @@ int PEM_def_callback(char *buf, int num, int w, void *key)
prompt = "Enter PEM pass phrase:";
for (;;) {
- i = EVP_read_pw_string_min(buf, MIN_LENGTH, num, prompt, w);
+ /*
+ * We assume that w == 0 means decryption,
+ * while w == 1 means encryption
+ */
+ int min_len = w ? MIN_LENGTH : 0;
+
+ i = EVP_read_pw_string_min(buf, min_len, num, prompt, w);
if (i != 0) {
PEMerr(PEM_F_PEM_DEF_CALLBACK, PEM_R_PROBLEMS_GETTING_PASSWORD);
memset(buf, 0, (unsigned int)num);
return (-1);
}
j = strlen(buf);
- if (j < MIN_LENGTH) {
+ if (min_len && j < min_len) {
fprintf(stderr,
"phrase is too short, needs to be at least %d chars\n",
- MIN_LENGTH);
+ min_len);
} else
break;
}
@@ -387,7 +393,7 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp,
}
RAND_add(data, i, 0); /* put in the RSA key. */
OPENSSL_assert(enc->iv_len <= (int)sizeof(iv));
- if (RAND_pseudo_bytes(iv, enc->iv_len) < 0) /* Generate a salt */
+ if (RAND_bytes(iv, enc->iv_len) <= 0) /* Generate a salt */
goto err;
/*
* The 'iv' is used as the iv and as a salt. It is NOT taken from
diff --git a/thirdparty/openssl/crypto/pem/pvkfmt.c b/thirdparty/openssl/crypto/pem/pvkfmt.c
index 61864468f6..1ce5a1e319 100644
--- a/thirdparty/openssl/crypto/pem/pvkfmt.c
+++ b/thirdparty/openssl/crypto/pem/pvkfmt.c
@@ -127,6 +127,9 @@ static int read_lebn(const unsigned char **in, unsigned int nbyte, BIGNUM **r)
# define MS_KEYTYPE_KEYX 0x1
# define MS_KEYTYPE_SIGN 0x2
+/* Maximum length of a blob after header */
+# define BLOB_MAX_LENGTH 102400
+
/* The PVK file magic number: seems to spell out "bobsfile", who is Bob? */
# define MS_PVKMAGIC 0xb0b5f11eL
/* Salt length for PVK files */
@@ -272,6 +275,10 @@ static EVP_PKEY *do_b2i_bio(BIO *in, int ispub)
return NULL;
length = blob_length(bitlen, isdss, ispub);
+ if (length > BLOB_MAX_LENGTH) {
+ PEMerr(PEM_F_DO_B2I_BIO, PEM_R_HEADER_TOO_LONG);
+ return NULL;
+ }
buf = OPENSSL_malloc(length);
if (!buf) {
PEMerr(PEM_F_DO_B2I_BIO, ERR_R_MALLOC_FAILURE);
diff --git a/thirdparty/openssl/crypto/pkcs12/p12_mutl.c b/thirdparty/openssl/crypto/pkcs12/p12_mutl.c
index a9277827ff..b1f7381a6f 100644
--- a/thirdparty/openssl/crypto/pkcs12/p12_mutl.c
+++ b/thirdparty/openssl/crypto/pkcs12/p12_mutl.c
@@ -159,7 +159,10 @@ int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen,
const EVP_MD *md_type)
{
- if (!(p12->mac = PKCS12_MAC_DATA_new()))
+ PKCS12_MAC_DATA_free(p12->mac);
+ p12->mac = NULL;
+
+ if ((p12->mac = PKCS12_MAC_DATA_new()) == NULL)
return PKCS12_ERROR;
if (iter > 1) {
if (!(p12->mac->iter = M_ASN1_INTEGER_new())) {
@@ -179,7 +182,7 @@ int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen,
}
p12->mac->salt->length = saltlen;
if (!salt) {
- if (RAND_pseudo_bytes(p12->mac->salt->data, saltlen) < 0)
+ if (RAND_bytes(p12->mac->salt->data, saltlen) <= 0)
return 0;
} else
memcpy(p12->mac->salt->data, salt, saltlen);
diff --git a/thirdparty/openssl/crypto/pkcs12/p12_npas.c b/thirdparty/openssl/crypto/pkcs12/p12_npas.c
index a89b61abab..9e8ebb2a78 100644
--- a/thirdparty/openssl/crypto/pkcs12/p12_npas.c
+++ b/thirdparty/openssl/crypto/pkcs12/p12_npas.c
@@ -66,17 +66,18 @@
/* PKCS#12 password change routine */
-static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass);
-static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass,
- char *newpass);
-static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass);
+static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass);
+static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *oldpass,
+ const char *newpass);
+static int newpass_bag(PKCS12_SAFEBAG *bag, const char *oldpass,
+ const char *newpass);
static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen);
/*
* Change the password on a PKCS#12 structure.
*/
-int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass)
+int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass)
{
/* Check for NULL PKCS12 structure */
@@ -103,20 +104,21 @@ int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass)
/* Parse the outer PKCS#12 structure */
-static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass)
+static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass)
{
- STACK_OF(PKCS7) *asafes, *newsafes;
- STACK_OF(PKCS12_SAFEBAG) *bags;
+ STACK_OF(PKCS7) *asafes = NULL, *newsafes = NULL;
+ STACK_OF(PKCS12_SAFEBAG) *bags = NULL;
int i, bagnid, pbe_nid = 0, pbe_iter = 0, pbe_saltlen = 0;
PKCS7 *p7, *p7new;
- ASN1_OCTET_STRING *p12_data_tmp = NULL, *macnew = NULL;
+ ASN1_OCTET_STRING *p12_data_tmp = NULL;
unsigned char mac[EVP_MAX_MD_SIZE];
unsigned int maclen;
+ int rv = 0;
- if (!(asafes = PKCS12_unpack_authsafes(p12)))
- return 0;
- if (!(newsafes = sk_PKCS7_new_null()))
- return 0;
+ if ((asafes = PKCS12_unpack_authsafes(p12)) == NULL)
+ goto err;
+ if ((newsafes = sk_PKCS7_new_null()) == NULL)
+ goto err;
for (i = 0; i < sk_PKCS7_num(asafes); i++) {
p7 = sk_PKCS7_value(asafes, i);
bagnid = OBJ_obj2nid(p7->type);
@@ -125,67 +127,57 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass)
} else if (bagnid == NID_pkcs7_encrypted) {
bags = PKCS12_unpack_p7encdata(p7, oldpass, -1);
if (!alg_get(p7->d.encrypted->enc_data->algorithm,
- &pbe_nid, &pbe_iter, &pbe_saltlen)) {
- sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
- bags = NULL;
- }
- } else
+ &pbe_nid, &pbe_iter, &pbe_saltlen))
+ goto err;
+ } else {
continue;
- if (!bags) {
- sk_PKCS7_pop_free(asafes, PKCS7_free);
- return 0;
- }
- if (!newpass_bags(bags, oldpass, newpass)) {
- sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
- sk_PKCS7_pop_free(asafes, PKCS7_free);
- return 0;
}
+ if (bags == NULL)
+ goto err;
+ if (!newpass_bags(bags, oldpass, newpass))
+ goto err;
/* Repack bag in same form with new password */
if (bagnid == NID_pkcs7_data)
p7new = PKCS12_pack_p7data(bags);
else
p7new = PKCS12_pack_p7encdata(pbe_nid, newpass, -1, NULL,
pbe_saltlen, pbe_iter, bags);
+ if (!p7new || !sk_PKCS7_push(newsafes, p7new))
+ goto err;
sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
- if (!p7new) {
- sk_PKCS7_pop_free(asafes, PKCS7_free);
- return 0;
- }
- sk_PKCS7_push(newsafes, p7new);
+ bags = NULL;
}
- sk_PKCS7_pop_free(asafes, PKCS7_free);
/* Repack safe: save old safe in case of error */
p12_data_tmp = p12->authsafes->d.data;
- if (!(p12->authsafes->d.data = ASN1_OCTET_STRING_new()))
- goto saferr;
+ if ((p12->authsafes->d.data = ASN1_OCTET_STRING_new()) == NULL)
+ goto err;
if (!PKCS12_pack_authsafes(p12, newsafes))
- goto saferr;
-
+ goto err;
if (!PKCS12_gen_mac(p12, newpass, -1, mac, &maclen))
- goto saferr;
- if (!(macnew = ASN1_OCTET_STRING_new()))
- goto saferr;
- if (!ASN1_OCTET_STRING_set(macnew, mac, maclen))
- goto saferr;
- ASN1_OCTET_STRING_free(p12->mac->dinfo->digest);
- p12->mac->dinfo->digest = macnew;
- ASN1_OCTET_STRING_free(p12_data_tmp);
-
- return 1;
-
- saferr:
- /* Restore old safe */
- ASN1_OCTET_STRING_free(p12->authsafes->d.data);
- ASN1_OCTET_STRING_free(macnew);
- p12->authsafes->d.data = p12_data_tmp;
- return 0;
-
+ goto err;
+ if (!ASN1_OCTET_STRING_set(p12->mac->dinfo->digest, mac, maclen))
+ goto err;
+
+ rv = 1;
+
+err:
+ /* Restore old safe if necessary */
+ if (rv == 1) {
+ ASN1_OCTET_STRING_free(p12_data_tmp);
+ } else if (p12_data_tmp != NULL) {
+ ASN1_OCTET_STRING_free(p12->authsafes->d.data);
+ p12->authsafes->d.data = p12_data_tmp;
+ }
+ sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
+ sk_PKCS7_pop_free(asafes, PKCS7_free);
+ sk_PKCS7_pop_free(newsafes, PKCS7_free);
+ return rv;
}
-static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass,
- char *newpass)
+static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *oldpass,
+ const char *newpass)
{
int i;
for (i = 0; i < sk_PKCS12_SAFEBAG_num(bags); i++) {
@@ -197,7 +189,8 @@ static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass,
/* Change password of safebag: only needs handle shrouded keybags */
-static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass)
+static int newpass_bag(PKCS12_SAFEBAG *bag, const char *oldpass,
+ const char *newpass)
{
PKCS8_PRIV_KEY_INFO *p8;
X509_SIG *p8new;
@@ -210,8 +203,10 @@ static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass)
return 0;
if (!alg_get(bag->value.shkeybag->algor, &p8_nid, &p8_iter, &p8_saltlen))
return 0;
- if (!(p8new = PKCS8_encrypt(p8_nid, NULL, newpass, -1, NULL, p8_saltlen,
- p8_iter, p8)))
+ p8new = PKCS8_encrypt(p8_nid, NULL, newpass, -1, NULL, p8_saltlen,
+ p8_iter, p8);
+ PKCS8_PRIV_KEY_INFO_free(p8);
+ if (p8new == NULL)
return 0;
X509_SIG_free(bag->value.shkeybag);
bag->value.shkeybag = p8new;
diff --git a/thirdparty/openssl/crypto/pkcs12/p12_utl.c b/thirdparty/openssl/crypto/pkcs12/p12_utl.c
index a0b992eab6..e466f762ff 100644
--- a/thirdparty/openssl/crypto/pkcs12/p12_utl.c
+++ b/thirdparty/openssl/crypto/pkcs12/p12_utl.c
@@ -91,6 +91,10 @@ char *OPENSSL_uni2asc(unsigned char *uni, int unilen)
{
int asclen, i;
char *asctmp;
+
+ /* string must contain an even number of bytes */
+ if (unilen & 1)
+ return NULL;
asclen = unilen / 2;
/* If no terminating zero allow for one */
if (!unilen || uni[unilen - 1])
diff --git a/thirdparty/openssl/crypto/pkcs7/pk7_doit.c b/thirdparty/openssl/crypto/pkcs7/pk7_doit.c
index 946aaa6543..6cf8253bc2 100644
--- a/thirdparty/openssl/crypto/pkcs7/pk7_doit.c
+++ b/thirdparty/openssl/crypto/pkcs7/pk7_doit.c
@@ -340,7 +340,7 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
ivlen = EVP_CIPHER_iv_length(evp_cipher);
xalg->algorithm = OBJ_nid2obj(EVP_CIPHER_type(evp_cipher));
if (ivlen > 0)
- if (RAND_pseudo_bytes(iv, ivlen) <= 0)
+ if (RAND_bytes(iv, ivlen) <= 0)
goto err;
if (EVP_CipherInit_ex(ctx, evp_cipher, NULL, NULL, NULL, 1) <= 0)
goto err;
@@ -642,6 +642,8 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
} else {
# if 0
bio = BIO_new(BIO_s_mem());
+ if (bio == NULL)
+ goto err;
/*
* We need to set this so that when we have read all the data, the
* encrypt BIO, if present, will read EOF and encode the last few
diff --git a/thirdparty/openssl/crypto/ppccap.c b/thirdparty/openssl/crypto/ppccap.c
index 74af4732b5..60566b1a5f 100644
--- a/thirdparty/openssl/crypto/ppccap.c
+++ b/thirdparty/openssl/crypto/ppccap.c
@@ -7,6 +7,10 @@
#if defined(__linux) || defined(_AIX)
# include <sys/utsname.h>
#endif
+#if defined(__APPLE__) && defined(__MACH__)
+# include <sys/types.h>
+# include <sys/sysctl.h>
+#endif
#include <openssl/crypto.h>
#include <openssl/bn.h>
@@ -123,6 +127,26 @@ void OPENSSL_cpuid_setup(void)
}
#endif
+#if defined(__APPLE__) && defined(__MACH__)
+ {
+ int val;
+ size_t len = sizeof(val);
+
+ if (sysctlbyname("hw.optional.64bitops", &val, &len, NULL, 0) == 0) {
+ if (val)
+ OPENSSL_ppccap_P |= PPC_FPU64;
+ }
+
+ len = sizeof(val);
+ if (sysctlbyname("hw.optional.altivec", &val, &len, NULL, 0) == 0) {
+ if (val)
+ OPENSSL_ppccap_P |= PPC_ALTIVEC;
+ }
+
+ return;
+ }
+#endif
+
memset(&ill_act, 0, sizeof(ill_act));
ill_act.sa_handler = ill_handler;
ill_act.sa_mask = all_masked;
diff --git a/thirdparty/openssl/crypto/rand/md_rand.c b/thirdparty/openssl/crypto/rand/md_rand.c
index 5c13d57765..29e465b075 100644
--- a/thirdparty/openssl/crypto/rand/md_rand.c
+++ b/thirdparty/openssl/crypto/rand/md_rand.c
@@ -136,7 +136,7 @@
/* #define PREDICT 1 */
#define STATE_SIZE 1023
-static int state_num = 0, state_index = 0;
+static size_t state_num = 0, state_index = 0;
static unsigned char state[STATE_SIZE + MD_DIGEST_LENGTH];
static unsigned char md[MD_DIGEST_LENGTH];
static long md_count[2] = { 0, 0 };
@@ -266,17 +266,21 @@ static void ssleay_rand_add(const void *buf, int num, double add)
j = (num - i);
j = (j > MD_DIGEST_LENGTH) ? MD_DIGEST_LENGTH : j;
- MD_Init(&m);
- MD_Update(&m, local_md, MD_DIGEST_LENGTH);
+ if (!MD_Init(&m) ||
+ !MD_Update(&m, local_md, MD_DIGEST_LENGTH))
+ goto err;
k = (st_idx + j) - STATE_SIZE;
if (k > 0) {
- MD_Update(&m, &(state[st_idx]), j - k);
- MD_Update(&m, &(state[0]), k);
+ if (!MD_Update(&m, &(state[st_idx]), j - k) ||
+ !MD_Update(&m, &(state[0]), k))
+ goto err;
} else
- MD_Update(&m, &(state[st_idx]), j);
+ if (!MD_Update(&m, &(state[st_idx]), j))
+ goto err;
/* DO NOT REMOVE THE FOLLOWING CALL TO MD_Update()! */
- MD_Update(&m, buf, j);
+ if (!MD_Update(&m, buf, j))
+ goto err;
/*
* We know that line may cause programs such as purify and valgrind
* to complain about use of uninitialized data. The problem is not,
@@ -285,8 +289,9 @@ static void ssleay_rand_add(const void *buf, int num, double add)
* insecure keys.
*/
- MD_Update(&m, (unsigned char *)&(md_c[0]), sizeof(md_c));
- MD_Final(&m, local_md);
+ if (!MD_Update(&m, (unsigned char *)&(md_c[0]), sizeof(md_c)) ||
+ !MD_Final(&m, local_md))
+ goto err;
md_c[1]++;
buf = (const char *)buf + j;
@@ -305,7 +310,6 @@ static void ssleay_rand_add(const void *buf, int num, double add)
st_idx = 0;
}
}
- EVP_MD_CTX_cleanup(&m);
if (!do_not_lock)
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
@@ -326,6 +330,9 @@ static void ssleay_rand_add(const void *buf, int num, double add)
#if !defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32)
assert(md_c[1] == md_count[1]);
#endif
+
+ err:
+ EVP_MD_CTX_cleanup(&m);
}
static void ssleay_rand_seed(const void *buf, int num)
@@ -336,8 +343,8 @@ static void ssleay_rand_seed(const void *buf, int num)
int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo, int lock)
{
static volatile int stirred_pool = 0;
- int i, j, k, st_num, st_idx;
- int num_ceil;
+ int i, j, k;
+ size_t num_ceil, st_idx, st_num;
int ok;
long md_c[2];
unsigned char local_md[MD_DIGEST_LENGTH];
@@ -469,15 +476,18 @@ int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo, int lock)
/* num_ceil -= MD_DIGEST_LENGTH/2 */
j = (num >= MD_DIGEST_LENGTH / 2) ? MD_DIGEST_LENGTH / 2 : num;
num -= j;
- MD_Init(&m);
+ if (!MD_Init(&m))
+ goto err;
#ifndef GETPID_IS_MEANINGLESS
if (curr_pid) { /* just in the first iteration to save time */
- MD_Update(&m, (unsigned char *)&curr_pid, sizeof curr_pid);
+ if (!MD_Update(&m, (unsigned char *)&curr_pid, sizeof curr_pid))
+ goto err;
curr_pid = 0;
}
#endif
- MD_Update(&m, local_md, MD_DIGEST_LENGTH);
- MD_Update(&m, (unsigned char *)&(md_c[0]), sizeof(md_c));
+ if (!MD_Update(&m, local_md, MD_DIGEST_LENGTH) ||
+ !MD_Update(&m, (unsigned char *)&(md_c[0]), sizeof(md_c)))
+ goto err;
#ifndef PURIFY /* purify complains */
/*
@@ -487,16 +497,21 @@ int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo, int lock)
* builds it is not used: the removal of such a small source of
* entropy has negligible impact on security.
*/
- MD_Update(&m, buf, j);
+ if (!MD_Update(&m, buf, j))
+ goto err;
#endif
k = (st_idx + MD_DIGEST_LENGTH / 2) - st_num;
if (k > 0) {
- MD_Update(&m, &(state[st_idx]), MD_DIGEST_LENGTH / 2 - k);
- MD_Update(&m, &(state[0]), k);
- } else
- MD_Update(&m, &(state[st_idx]), MD_DIGEST_LENGTH / 2);
- MD_Final(&m, local_md);
+ if (!MD_Update(&m, &(state[st_idx]), MD_DIGEST_LENGTH / 2 - k) ||
+ !MD_Update(&m, &(state[0]), k))
+ goto err;
+ } else {
+ if (!MD_Update(&m, &(state[st_idx]), MD_DIGEST_LENGTH / 2))
+ goto err;
+ }
+ if (!MD_Final(&m, local_md))
+ goto err;
for (i = 0; i < MD_DIGEST_LENGTH / 2; i++) {
/* may compete with other threads */
@@ -508,13 +523,18 @@ int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo, int lock)
}
}
- MD_Init(&m);
- MD_Update(&m, (unsigned char *)&(md_c[0]), sizeof(md_c));
- MD_Update(&m, local_md, MD_DIGEST_LENGTH);
+ if (!MD_Init(&m) ||
+ !MD_Update(&m, (unsigned char *)&(md_c[0]), sizeof(md_c)) ||
+ !MD_Update(&m, local_md, MD_DIGEST_LENGTH))
+ goto err;
if (lock)
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
- MD_Update(&m, md, MD_DIGEST_LENGTH);
- MD_Final(&m, md);
+ if (!MD_Update(&m, md, MD_DIGEST_LENGTH) ||
+ !MD_Final(&m, md)) {
+ if (lock)
+ CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
+ goto err;
+ }
if (lock)
CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
@@ -529,6 +549,10 @@ int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo, int lock)
"http://www.openssl.org/support/faq.html");
return (0);
}
+
+ err:
+ EVP_MD_CTX_cleanup(&m);
+ return (0);
}
static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num)
diff --git a/thirdparty/openssl/crypto/rand/rand_unix.c b/thirdparty/openssl/crypto/rand/rand_unix.c
index 266111edda..6c5b65da00 100644
--- a/thirdparty/openssl/crypto/rand/rand_unix.c
+++ b/thirdparty/openssl/crypto/rand/rand_unix.c
@@ -235,7 +235,7 @@ int RAND_poll(void)
rnd >>= 8;
}
RAND_add(buf, sizeof(buf), ENTROPY_NEEDED);
- memset(buf, 0, sizeof(buf));
+ OPENSSL_cleanse(buf, sizeof(buf));
return 1;
}
diff --git a/thirdparty/openssl/crypto/rand/rand_vms.c b/thirdparty/openssl/crypto/rand/rand_vms.c
index 0e10c363e2..be4ff4cc87 100644..100755
--- a/thirdparty/openssl/crypto/rand/rand_vms.c
+++ b/thirdparty/openssl/crypto/rand/rand_vms.c
@@ -3,6 +3,11 @@
* Written by Richard Levitte <richard@levitte.org> for the OpenSSL project
* 2000.
*/
+/*
+ * Modified by VMS Software, Inc (2016)
+ * Eliminate looping through all processes (performance)
+ * Add additional randomizations using rand() function
+ */
/* ====================================================================
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
*
@@ -61,11 +66,11 @@
#include "rand_lcl.h"
#if defined(OPENSSL_SYS_VMS)
-
# include <descrip.h>
# include <jpidef.h>
# include <ssdef.h>
# include <starlet.h>
+# include <efndef>
# ifdef __DECC
# pragma message disable DOLLARID
# endif
@@ -83,77 +88,93 @@
# endif /* __INITIAL_POINTER_SIZE == 64 [else] */
static struct items_data_st {
- short length, code; /* length is amount of bytes */
+ short length, code; /* length is number of bytes */
} items_data[] = {
- {
- 4, JPI$_BUFIO
- },
- {
- 4, JPI$_CPUTIM
- },
- {
- 4, JPI$_DIRIO
- },
- {
- 8, JPI$_LOGINTIM
- },
- {
- 4, JPI$_PAGEFLTS
- },
- {
- 4, JPI$_PID
- },
- {
- 4, JPI$_WSSIZE
- },
- {
- 0, 0
- }
+ {4, JPI$_BUFIO},
+ {4, JPI$_CPUTIM},
+ {4, JPI$_DIRIO},
+ {4, JPI$_IMAGECOUNT},
+ {8, JPI$_LAST_LOGIN_I},
+ {8, JPI$_LOGINTIM},
+ {4, JPI$_PAGEFLTS},
+ {4, JPI$_PID},
+ {4, JPI$_PPGCNT},
+ {4, JPI$_WSPEAK},
+ {4, JPI$_FINALEXC},
+ {0, 0} /* zero terminated */
};
int RAND_poll(void)
{
- long pid, iosb[2];
- int status = 0;
+
+ /* determine the number of items in the JPI array */
+
+ struct items_data_st item_entry;
+ int item_entry_count = sizeof(items_data)/sizeof(item_entry);
+
+ /* Create the JPI itemlist array to hold item_data content */
+
struct {
short length, code;
- long *buffer;
+ int *buffer;
int *retlen;
- } item[32], *pitem;
- unsigned char data_buffer[256];
- short total_length = 0;
- struct items_data_st *pitems_data;
+ } item[item_entry_count], *pitem; /* number of entries in items_data */
+ struct items_data_st *pitems_data;
pitems_data = items_data;
pitem = item;
+ int data_buffer[(item_entry_count*2)+4]; /* 8 bytes per entry max */
+ int iosb[2];
+ int sys_time[2];
+ int *ptr;
+ int i, j ;
+ int tmp_length = 0;
+ int total_length = 0;
+
+ /* Setup itemlist for GETJPI */
- /* Setup */
- while (pitems_data->length && (total_length + pitems_data->length <= 256)) {
+ while (pitems_data->length) {
pitem->length = pitems_data->length;
- pitem->code = pitems_data->code;
- pitem->buffer = (long *)&data_buffer[total_length];
+ pitem->code = pitems_data->code;
+ pitem->buffer = &data_buffer[total_length];
pitem->retlen = 0;
- total_length += pitems_data->length;
+ /* total_length is in longwords */
+ total_length += pitems_data->length/4;
pitems_data++;
pitem ++;
}
pitem->length = pitem->code = 0;
- /*
- * Scan through all the processes in the system and add entropy with
- * results from the processes that were possible to look at.
- * However, view the information as only half trustable.
- */
- pid = -1; /* search context */
- while ((status = sys$getjpiw(0, &pid, 0, item, iosb, 0, 0))
- != SS$_NOMOREPROC) {
- if (status == SS$_NORMAL) {
- RAND_add((PTR_T) data_buffer, total_length, total_length / 2);
+ /* Fill data_buffer with various info bits from this process */
+ /* and twist that data to seed the SSL random number init */
+
+ if (sys$getjpiw(EFN$C_ENF, NULL, NULL, item, &iosb, 0, 0) == SS$_NORMAL) {
+ for (i = 0; i < total_length; i++) {
+ sys$gettim((struct _generic_64 *)&sys_time[0]);
+ srand(sys_time[0] * data_buffer[0] * data_buffer[1] + i);
+
+ if (i == (total_length - 1)) { /* for JPI$_FINALEXC */
+ ptr = &data_buffer[i];
+ for (j = 0; j < 4; j++) {
+ data_buffer[i + j] = ptr[j];
+ /* OK to use rand() just to scramble the seed */
+ data_buffer[i + j] ^= (sys_time[0] ^ rand());
+ tmp_length++;
+ }
+ } else {
+ /* OK to use rand() just to scramble the seed */
+ data_buffer[i] ^= (sys_time[0] ^ rand());
+ }
}
+
+ total_length += (tmp_length - 1);
+
+ /* size of seed is total_length*4 bytes (64bytes) */
+ RAND_add((PTR_T) data_buffer, total_length*4, total_length * 2);
+ } else {
+ return 0;
}
- sys$gettim(iosb);
- RAND_add((PTR_T) iosb, sizeof(iosb), sizeof(iosb) / 2);
+
return 1;
}
-
#endif
diff --git a/thirdparty/openssl/crypto/rand/rand_win.c b/thirdparty/openssl/crypto/rand/rand_win.c
index da4c935a53..cb4093128d 100644
--- a/thirdparty/openssl/crypto/rand/rand_win.c
+++ b/thirdparty/openssl/crypto/rand/rand_win.c
@@ -118,10 +118,10 @@
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0400
# endif
-#ifndef UWP_ENABLED
+#ifndef UWP_ENABLED // -- GODOT --
# include <wincrypt.h>
# include <tlhelp32.h>
-#endif
+#endif // -- GODOT --
/*
* Limit the time spent walking through the heap, processes, threads and
@@ -163,7 +163,7 @@ typedef struct tagCURSORINFO {
# define CURSOR_SHOWING 0x00000001
# endif /* CURSOR_SHOWING */
-# if !defined(OPENSSL_SYS_WINCE) && !defined(UWP_ENABLED)
+# if !defined(OPENSSL_SYS_WINCE) && !defined(UWP_ENABLED) // -- GODOT --
typedef BOOL(WINAPI *CRYPTACQUIRECONTEXTW) (HCRYPTPROV *, LPCWSTR, LPCWSTR,
DWORD, DWORD);
typedef BOOL(WINAPI *CRYPTGENRANDOM) (HCRYPTPROV, DWORD, BYTE *);
@@ -198,7 +198,7 @@ typedef NET_API_STATUS(NET_API_FUNCTION *NETFREE) (LPBYTE);
# endif /* 1 */
# endif /* !OPENSSL_SYS_WINCE */
-#if !defined(UWP_ENABLED)
+#if !defined(UWP_ENABLED) // -- GODOT --
int RAND_poll(void)
{
MEMORYSTATUS m;
@@ -583,7 +583,7 @@ int RAND_poll(void)
return (1);
}
-#endif // UWP_ENABLED
+#endif // UWP_ENABLED // -- GODOT --
int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam)
{
@@ -687,7 +687,7 @@ static void readtimer(void)
static void readscreen(void)
{
-# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN) && !defined(UWP_ENABLED)
+# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN) && !defined(UWP_ENABLED) // -- GODOT --
HDC hScrDC; /* screen DC */
HBITMAP hBitmap; /* handle for our bitmap */
BITMAP bm; /* bitmap properties */
diff --git a/thirdparty/openssl/crypto/rand/randfile.c b/thirdparty/openssl/crypto/rand/randfile.c
index 9537c56a78..728fd0a721 100644
--- a/thirdparty/openssl/crypto/rand/randfile.c
+++ b/thirdparty/openssl/crypto/rand/randfile.c
@@ -56,11 +56,6 @@
* [including the GNU Public Licence.]
*/
-/* We need to define this to get macros like S_IFBLK and S_IFCHR */
-#if !defined(OPENSSL_SYS_VXWORKS)
-# define _XOPEN_SOURCE 500
-#endif
-
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -80,6 +75,29 @@
#ifndef OPENSSL_NO_POSIX_IO
# include <sys/stat.h>
# include <fcntl.h>
+/*
+ * Following should not be needed, and we could have been stricter
+ * and demand S_IS*. But some systems just don't comply... Formally
+ * below macros are "anatomically incorrect", because normally they
+ * would look like ((m) & MASK == TYPE), but since MASK availability
+ * is as questionable, we settle for this poor-man fallback...
+ */
+# if !defined(S_ISBLK)
+# if defined(_S_IFBLK)
+# define S_ISBLK(m) ((m) & _S_IFBLK)
+# elif defined(S_IFBLK)
+# define S_ISBLK(m) ((m) & S_IFBLK)
+# elif defined(_WIN32)
+# define S_ISBLK(m) 0 /* no concept of block devices on Windows */
+# endif
+# endif
+# if !defined(S_ISCHR)
+# if defined(_S_IFCHR)
+# define S_ISCHR(m) ((m) & _S_IFCHR)
+# elif defined(S_IFCHR)
+# define S_ISCHR(m) ((m) & S_IFCHR)
+# endif
+# endif
#endif
#ifdef _WIN32
@@ -93,7 +111,7 @@
#define BUFSIZE 1024
#define RAND_DATA 1024
-#ifdef OPENSSL_SYS_VMS
+#if (defined(OPENSSL_SYS_VMS) && (defined(__alpha) || defined(__ia64)))
/*
* This declaration is a nasty hack to get around vms' extension to fopen for
* passing in sharing options being disabled by our /STANDARD=ANSI89
@@ -122,7 +140,24 @@ int RAND_load_file(const char *file, long bytes)
struct stat sb;
#endif
int i, ret = 0, n;
+/*
+ * If setvbuf() is to be called, then the FILE pointer
+ * to it must be 32 bit.
+*/
+
+#if !defined OPENSSL_NO_SETVBUF_IONBF && defined(OPENSSL_SYS_VMS) && defined(__VMS_VER) && (__VMS_VER >= 70000000)
+ /* For 64-bit-->32 bit API Support*/
+#if __INITIAL_POINTER_SIZE == 64
+#pragma __required_pointer_size __save
+#pragma __required_pointer_size 32
+#endif
+ FILE *in; /* setvbuf() requires 32-bit pointers */
+#if __INITIAL_POINTER_SIZE == 64
+#pragma __required_pointer_size __restore
+#endif
+#else
FILE *in;
+#endif /* OPENSSL_SYS_VMS */
if (file == NULL)
return (0);
@@ -151,8 +186,8 @@ int RAND_load_file(const char *file, long bytes)
#endif
if (in == NULL)
goto err;
-#if defined(S_IFBLK) && defined(S_IFCHR) && !defined(OPENSSL_NO_POSIX_IO)
- if (sb.st_mode & (S_IFBLK | S_IFCHR)) {
+#if defined(S_ISBLK) && defined(S_ISCHR) && !defined(OPENSSL_NO_POSIX_IO)
+ if (S_ISBLK(sb.st_mode) || S_ISCHR(sb.st_mode)) {
/*
* this file is a device. we don't want read an infinite number of
* bytes from a random device, nor do we want to use buffered I/O
@@ -231,7 +266,7 @@ int RAND_write_file(const char *file)
}
#endif
-#ifdef OPENSSL_SYS_VMS
+#if (defined(OPENSSL_SYS_VMS) && (defined(__alpha) || defined(__ia64)))
/*
* VMS NOTE: Prior versions of this routine created a _new_ version of
* the rand file for each call into this routine, then deleted all
diff --git a/thirdparty/openssl/crypto/rsa/rsa_ameth.c b/thirdparty/openssl/crypto/rsa/rsa_ameth.c
index 4e0621827c..951e1d5ca3 100644
--- a/thirdparty/openssl/crypto/rsa/rsa_ameth.c
+++ b/thirdparty/openssl/crypto/rsa/rsa_ameth.c
@@ -68,10 +68,12 @@
#endif
#include "asn1_locl.h"
+#ifndef OPENSSL_NO_CMS
static int rsa_cms_sign(CMS_SignerInfo *si);
static int rsa_cms_verify(CMS_SignerInfo *si);
static int rsa_cms_decrypt(CMS_RecipientInfo *ri);
static int rsa_cms_encrypt(CMS_RecipientInfo *ri);
+#endif
static int rsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
{
@@ -665,6 +667,7 @@ static int rsa_pss_to_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pkctx,
return rv;
}
+#ifndef OPENSSL_NO_CMS
static int rsa_cms_verify(CMS_SignerInfo *si)
{
int nid, nid2;
@@ -683,6 +686,7 @@ static int rsa_cms_verify(CMS_SignerInfo *si)
}
return 0;
}
+#endif
/*
* Customised RSA item verification routine. This is called when a signature
@@ -705,6 +709,7 @@ static int rsa_item_verify(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
return -1;
}
+#ifndef OPENSSL_NO_CMS
static int rsa_cms_sign(CMS_SignerInfo *si)
{
int pad_mode = RSA_PKCS1_PADDING;
@@ -729,6 +734,7 @@ static int rsa_cms_sign(CMS_SignerInfo *si)
X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsassaPss), V_ASN1_SEQUENCE, os);
return 1;
}
+#endif
static int rsa_item_sign(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
X509_ALGOR *alg1, X509_ALGOR *alg2,
@@ -785,6 +791,7 @@ static RSA_OAEP_PARAMS *rsa_oaep_decode(const X509_ALGOR *alg,
return pss;
}
+#ifndef OPENSSL_NO_CMS
static int rsa_cms_decrypt(CMS_RecipientInfo *ri)
{
EVP_PKEY_CTX *pkctx;
@@ -920,6 +927,7 @@ static int rsa_cms_encrypt(CMS_RecipientInfo *ri)
ASN1_STRING_free(os);
return rv;
}
+#endif
const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = {
{
diff --git a/thirdparty/openssl/crypto/rsa/rsa_chk.c b/thirdparty/openssl/crypto/rsa/rsa_chk.c
index 607faa0017..475dfc5628 100644
--- a/thirdparty/openssl/crypto/rsa/rsa_chk.c
+++ b/thirdparty/openssl/crypto/rsa/rsa_chk.c
@@ -56,7 +56,6 @@ int RSA_check_key(const RSA *key)
{
BIGNUM *i, *j, *k, *l, *m;
BN_CTX *ctx;
- int r;
int ret = 1;
if (!key->p || !key->q || !key->n || !key->e || !key->d) {
@@ -70,75 +69,68 @@ int RSA_check_key(const RSA *key)
l = BN_new();
m = BN_new();
ctx = BN_CTX_new();
- if (i == NULL || j == NULL || k == NULL || l == NULL ||
- m == NULL || ctx == NULL) {
+ if (i == NULL || j == NULL || k == NULL || l == NULL
+ || m == NULL || ctx == NULL) {
ret = -1;
RSAerr(RSA_F_RSA_CHECK_KEY, ERR_R_MALLOC_FAILURE);
goto err;
}
+ if (BN_is_one(key->e)) {
+ ret = 0;
+ RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_BAD_E_VALUE);
+ }
+ if (!BN_is_odd(key->e)) {
+ ret = 0;
+ RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_BAD_E_VALUE);
+ }
+
/* p prime? */
- r = BN_is_prime_ex(key->p, BN_prime_checks, NULL, NULL);
- if (r != 1) {
- ret = r;
- if (r != 0)
- goto err;
+ if (BN_is_prime_ex(key->p, BN_prime_checks, NULL, NULL) != 1) {
+ ret = 0;
RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_P_NOT_PRIME);
}
/* q prime? */
- r = BN_is_prime_ex(key->q, BN_prime_checks, NULL, NULL);
- if (r != 1) {
- ret = r;
- if (r != 0)
- goto err;
+ if (BN_is_prime_ex(key->q, BN_prime_checks, NULL, NULL) != 1) {
+ ret = 0;
RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_Q_NOT_PRIME);
}
/* n = p*q? */
- r = BN_mul(i, key->p, key->q, ctx);
- if (!r) {
+ if (!BN_mul(i, key->p, key->q, ctx)) {
ret = -1;
goto err;
}
-
if (BN_cmp(i, key->n) != 0) {
ret = 0;
RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_N_DOES_NOT_EQUAL_P_Q);
}
/* d*e = 1 mod lcm(p-1,q-1)? */
-
- r = BN_sub(i, key->p, BN_value_one());
- if (!r) {
+ if (!BN_sub(i, key->p, BN_value_one())) {
ret = -1;
goto err;
}
- r = BN_sub(j, key->q, BN_value_one());
- if (!r) {
+ if (!BN_sub(j, key->q, BN_value_one())) {
ret = -1;
goto err;
}
/* now compute k = lcm(i,j) */
- r = BN_mul(l, i, j, ctx);
- if (!r) {
+ if (!BN_mul(l, i, j, ctx)) {
ret = -1;
goto err;
}
- r = BN_gcd(m, i, j, ctx);
- if (!r) {
+ if (!BN_gcd(m, i, j, ctx)) {
ret = -1;
goto err;
}
- r = BN_div(k, NULL, l, m, ctx); /* remainder is 0 */
- if (!r) {
+ if (!BN_div(k, NULL, l, m, ctx)) { /* remainder is 0 */
ret = -1;
goto err;
}
-
- r = BN_mod_mul(i, key->d, key->e, k, ctx);
- if (!r) {
+ if (!BN_mod_mul(i, key->d, key->e, k, ctx)) {
ret = -1;
goto err;
}
@@ -150,36 +142,28 @@ int RSA_check_key(const RSA *key)
if (key->dmp1 != NULL && key->dmq1 != NULL && key->iqmp != NULL) {
/* dmp1 = d mod (p-1)? */
- r = BN_sub(i, key->p, BN_value_one());
- if (!r) {
+ if (!BN_sub(i, key->p, BN_value_one())) {
ret = -1;
goto err;
}
-
- r = BN_mod(j, key->d, i, ctx);
- if (!r) {
+ if (!BN_mod(j, key->d, i, ctx)) {
ret = -1;
goto err;
}
-
if (BN_cmp(j, key->dmp1) != 0) {
ret = 0;
RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_DMP1_NOT_CONGRUENT_TO_D);
}
/* dmq1 = d mod (q-1)? */
- r = BN_sub(i, key->q, BN_value_one());
- if (!r) {
+ if (!BN_sub(i, key->q, BN_value_one())) {
ret = -1;
goto err;
}
-
- r = BN_mod(j, key->d, i, ctx);
- if (!r) {
+ if (!BN_mod(j, key->d, i, ctx)) {
ret = -1;
goto err;
}
-
if (BN_cmp(j, key->dmq1) != 0) {
ret = 0;
RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_DMQ1_NOT_CONGRUENT_TO_D);
@@ -190,7 +174,6 @@ int RSA_check_key(const RSA *key)
ret = -1;
goto err;
}
-
if (BN_cmp(i, key->iqmp) != 0) {
ret = 0;
RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_IQMP_NOT_INVERSE_OF_Q);
@@ -198,17 +181,11 @@ int RSA_check_key(const RSA *key)
}
err:
- if (i != NULL)
- BN_free(i);
- if (j != NULL)
- BN_free(j);
- if (k != NULL)
- BN_free(k);
- if (l != NULL)
- BN_free(l);
- if (m != NULL)
- BN_free(m);
- if (ctx != NULL)
- BN_CTX_free(ctx);
- return (ret);
+ BN_free(i);
+ BN_free(j);
+ BN_free(k);
+ BN_free(l);
+ BN_free(m);
+ BN_CTX_free(ctx);
+ return ret;
}
diff --git a/thirdparty/openssl/crypto/rsa/rsa_gen.c b/thirdparty/openssl/crypto/rsa/rsa_gen.c
index 7f7dca39fd..082c8da2ef 100644
--- a/thirdparty/openssl/crypto/rsa/rsa_gen.c
+++ b/thirdparty/openssl/crypto/rsa/rsa_gen.c
@@ -142,7 +142,8 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value,
if (!rsa->iqmp && ((rsa->iqmp = BN_new()) == NULL))
goto err;
- BN_copy(rsa->e, e_value);
+ if (BN_copy(rsa->e, e_value) == NULL)
+ goto err;
/* generate p and q */
for (;;) {
diff --git a/thirdparty/openssl/crypto/rsa/rsa_lib.c b/thirdparty/openssl/crypto/rsa/rsa_lib.c
index a6805debc8..6ea6b40dc6 100644
--- a/thirdparty/openssl/crypto/rsa/rsa_lib.c
+++ b/thirdparty/openssl/crypto/rsa/rsa_lib.c
@@ -143,6 +143,7 @@ RSA *RSA_new_method(ENGINE *engine)
RSAerr(RSA_F_RSA_NEW_METHOD, ERR_R_MALLOC_FAILURE);
return NULL;
}
+ memset(ret,0,sizeof(RSA));
ret->meth = RSA_get_default_method();
#ifndef OPENSSL_NO_ENGINE
diff --git a/thirdparty/openssl/crypto/rsa/rsa_oaep.c b/thirdparty/openssl/crypto/rsa/rsa_oaep.c
index 9c2a943cf7..19d28c6f0e 100644
--- a/thirdparty/openssl/crypto/rsa/rsa_oaep.c
+++ b/thirdparty/openssl/crypto/rsa/rsa_oaep.c
@@ -89,17 +89,21 @@ int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
}
if (PKCS1_MGF1(dbmask, emlen - mdlen, seed, mdlen, mgf1md) < 0)
- return 0;
+ goto err;
for (i = 0; i < emlen - mdlen; i++)
db[i] ^= dbmask[i];
if (PKCS1_MGF1(seedmask, mdlen, db, emlen - mdlen, mgf1md) < 0)
- return 0;
+ goto err;
for (i = 0; i < mdlen; i++)
seed[i] ^= seedmask[i];
OPENSSL_free(dbmask);
return 1;
+
+ err:
+ OPENSSL_free(dbmask);
+ return 0;
}
int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
diff --git a/thirdparty/openssl/crypto/rsa/rsa_pmeth.c b/thirdparty/openssl/crypto/rsa/rsa_pmeth.c
index 203635595f..8896e2e977 100644
--- a/thirdparty/openssl/crypto/rsa/rsa_pmeth.c
+++ b/thirdparty/openssl/crypto/rsa/rsa_pmeth.c
@@ -373,6 +373,10 @@ static int pkey_rsa_verify(EVP_PKEY_CTX *ctx,
if (rctx->pad_mode == RSA_PKCS1_PADDING)
return RSA_verify(EVP_MD_type(rctx->md), tbs, tbslen,
sig, siglen, rsa);
+ if (tbslen != (size_t)EVP_MD_size(rctx->md)) {
+ RSAerr(RSA_F_PKEY_RSA_VERIFY, RSA_R_INVALID_DIGEST_LENGTH);
+ return -1;
+ }
if (rctx->pad_mode == RSA_X931_PADDING) {
if (pkey_rsa_verifyrecover(ctx, NULL, &rslen, sig, siglen) <= 0)
return 0;
@@ -442,19 +446,14 @@ static int pkey_rsa_decrypt(EVP_PKEY_CTX *ctx,
int ret;
RSA_PKEY_CTX *rctx = ctx->data;
if (rctx->pad_mode == RSA_PKCS1_OAEP_PADDING) {
- int i;
if (!setup_tbuf(rctx, ctx))
return -1;
ret = RSA_private_decrypt(inlen, in, rctx->tbuf,
ctx->pkey->pkey.rsa, RSA_NO_PADDING);
if (ret <= 0)
return ret;
- for (i = 0; i < ret; i++) {
- if (rctx->tbuf[i])
- break;
- }
- ret = RSA_padding_check_PKCS1_OAEP_mgf1(out, ret, rctx->tbuf + i,
- ret - i, ret,
+ ret = RSA_padding_check_PKCS1_OAEP_mgf1(out, ret, rctx->tbuf,
+ ret, ret,
rctx->oaep_label,
rctx->oaep_labellen,
rctx->md, rctx->mgf1md);
@@ -545,8 +544,10 @@ static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
return 1;
case EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP:
- if (!p2)
+ if (p2 == NULL || !BN_is_odd((BIGNUM *)p2) || BN_is_one((BIGNUM *)p2)) {
+ RSAerr(RSA_F_PKEY_RSA_CTRL, RSA_R_BAD_E_VALUE);
return -2;
+ }
BN_free(rctx->pub_exp);
rctx->pub_exp = p2;
return 1;
diff --git a/thirdparty/openssl/crypto/rsa/rsa_pss.c b/thirdparty/openssl/crypto/rsa/rsa_pss.c
index 41bc0844e4..2c3fd73b09 100644
--- a/thirdparty/openssl/crypto/rsa/rsa_pss.c
+++ b/thirdparty/openssl/crypto/rsa/rsa_pss.c
@@ -122,7 +122,11 @@ int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
EM++;
emLen--;
}
- if (emLen < (hLen + sLen + 2)) { /* sLen can be small negative */
+ if (emLen < hLen + 2) {
+ RSAerr(RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1, RSA_R_DATA_TOO_LARGE);
+ goto err;
+ }
+ if (sLen > emLen - hLen - 2) { /* sLen can be small negative */
RSAerr(RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1, RSA_R_DATA_TOO_LARGE);
goto err;
}
@@ -222,9 +226,14 @@ int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
*EM++ = 0;
emLen--;
}
+ if (emLen < hLen + 2) {
+ RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1,
+ RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE);
+ goto err;
+ }
if (sLen == -2) {
sLen = emLen - hLen - 2;
- } else if (emLen < (hLen + sLen + 2)) {
+ } else if (sLen > emLen - hLen - 2) {
RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1,
RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE);
goto err;
diff --git a/thirdparty/openssl/crypto/s390xcap.c b/thirdparty/openssl/crypto/s390xcap.c
index 47d6b6ff51..cf8c372c05 100644
--- a/thirdparty/openssl/crypto/s390xcap.c
+++ b/thirdparty/openssl/crypto/s390xcap.c
@@ -3,6 +3,7 @@
#include <string.h>
#include <setjmp.h>
#include <signal.h>
+#include "cryptlib.h"
extern unsigned long OPENSSL_s390xcap_P[];
diff --git a/thirdparty/openssl/crypto/srp/srp_lib.c b/thirdparty/openssl/crypto/srp/srp_lib.c
index e9a2e058f6..6df3b1cee7 100644
--- a/thirdparty/openssl/crypto/srp/srp_lib.c
+++ b/thirdparty/openssl/crypto/srp/srp_lib.c
@@ -159,8 +159,7 @@ BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b,
if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL)
return NULL;
- if ((bn_ctx = BN_CTX_new()) == NULL ||
- (tmp = BN_new()) == NULL || (S = BN_new()) == NULL)
+ if ((bn_ctx = BN_CTX_new()) == NULL || (tmp = BN_new()) == NULL)
goto err;
/* S = (A*v**u) ** b */
@@ -169,8 +168,12 @@ BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b,
goto err;
if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx))
goto err;
- if (!BN_mod_exp(S, tmp, b, N, bn_ctx))
- goto err;
+
+ S = BN_new();
+ if (S != NULL && !BN_mod_exp(S, tmp, b, N, bn_ctx)) {
+ BN_free(S);
+ S = NULL;
+ }
err:
BN_CTX_free(bn_ctx);
BN_clear_free(tmp);
@@ -267,7 +270,7 @@ BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x,
if ((tmp = BN_new()) == NULL ||
(tmp2 = BN_new()) == NULL ||
- (tmp3 = BN_new()) == NULL || (K = BN_new()) == NULL)
+ (tmp3 = BN_new()) == NULL)
goto err;
if (!BN_mod_exp(tmp, g, x, N, bn_ctx))
@@ -279,12 +282,15 @@ BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x,
if (!BN_mod_sub(tmp, B, tmp2, N, bn_ctx))
goto err;
- if (!BN_mod_mul(tmp3, u, x, N, bn_ctx))
+ if (!BN_mul(tmp3, u, x, bn_ctx))
goto err;
- if (!BN_mod_add(tmp2, a, tmp3, N, bn_ctx))
- goto err;
- if (!BN_mod_exp(K, tmp, tmp2, N, bn_ctx))
+ if (!BN_add(tmp2, a, tmp3))
goto err;
+ K = BN_new();
+ if (K != NULL && !BN_mod_exp(K, tmp, tmp2, N, bn_ctx)) {
+ BN_free(K);
+ K = NULL;
+ }
err:
BN_CTX_free(bn_ctx);
diff --git a/thirdparty/openssl/crypto/srp/srp_vfy.c b/thirdparty/openssl/crypto/srp/srp_vfy.c
index 26ad3e07b4..c8bc7a94b2 100644
--- a/thirdparty/openssl/crypto/srp/srp_vfy.c
+++ b/thirdparty/openssl/crypto/srp/srp_vfy.c
@@ -80,15 +80,21 @@ static char b64table[] =
/*
* Convert a base64 string into raw byte array representation.
*/
-static int t_fromb64(unsigned char *a, const char *src)
+static int t_fromb64(unsigned char *a, size_t alen, const char *src)
{
char *loc;
int i, j;
int size;
+ if (alen == 0 || alen > INT_MAX)
+ return -1;
+
while (*src && (*src == ' ' || *src == '\t' || *src == '\n'))
++src;
size = strlen(src);
+ if (size < 0 || size >= (int)alen)
+ return -1;
+
i = 0;
while (i < size) {
loc = strchr(b64table, src[i]);
@@ -124,7 +130,7 @@ static int t_fromb64(unsigned char *a, const char *src)
if (--i < 0)
break;
}
- while (a[j] == 0 && j <= size)
+ while (j <= size && a[j] == 0)
++j;
i = 0;
while (j <= size)
@@ -231,13 +237,25 @@ static int SRP_user_pwd_set_sv(SRP_user_pwd *vinfo, const char *s,
unsigned char tmp[MAX_LEN];
int len;
- if (strlen(s) > MAX_LEN || strlen(v) > MAX_LEN)
+ vinfo->v = NULL;
+ vinfo->s = NULL;
+
+ len = t_fromb64(tmp, sizeof(tmp), v);
+ if (len < 0)
return 0;
- len = t_fromb64(tmp, v);
if (NULL == (vinfo->v = BN_bin2bn(tmp, len, NULL)))
return 0;
- len = t_fromb64(tmp, s);
- return ((vinfo->s = BN_bin2bn(tmp, len, NULL)) != NULL);
+ len = t_fromb64(tmp, sizeof(tmp), s);
+ if (len < 0)
+ goto err;
+ vinfo->s = BN_bin2bn(tmp, len, NULL);
+ if (vinfo->s == NULL)
+ goto err;
+ return 1;
+ err:
+ BN_free(vinfo->v);
+ vinfo->v = NULL;
+ return 0;
}
static int SRP_user_pwd_set_sv_BN(SRP_user_pwd *vinfo, BIGNUM *s, BIGNUM *v)
@@ -307,10 +325,13 @@ static SRP_gN_cache *SRP_gN_new_init(const char *ch)
if (newgN == NULL)
return NULL;
+ len = t_fromb64(tmp, sizeof(tmp), ch);
+ if (len < 0)
+ goto err;
+
if ((newgN->b64_bn = BUF_strdup(ch)) == NULL)
goto err;
- len = t_fromb64(tmp, ch);
if ((newgN->bn = BN_bin2bn(tmp, len, NULL)))
return newgN;
@@ -544,7 +565,7 @@ SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username)
if (!SRP_user_pwd_set_ids(user, username, NULL))
goto err;
- if (RAND_pseudo_bytes(digv, SHA_DIGEST_LENGTH) < 0)
+ if (RAND_bytes(digv, SHA_DIGEST_LENGTH) <= 0)
goto err;
EVP_MD_CTX_init(&ctxt);
EVP_DigestInit_ex(&ctxt, EVP_sha1(), NULL);
@@ -580,10 +601,10 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt,
goto err;
if (N) {
- if (!(len = t_fromb64(tmp, N)))
+ if (!(len = t_fromb64(tmp, sizeof(tmp), N)))
goto err;
N_bn = BN_bin2bn(tmp, len, NULL);
- if (!(len = t_fromb64(tmp, g)))
+ if (!(len = t_fromb64(tmp, sizeof(tmp), g)))
goto err;
g_bn = BN_bin2bn(tmp, len, NULL);
defgNid = "*";
@@ -597,12 +618,12 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt,
}
if (*salt == NULL) {
- if (RAND_pseudo_bytes(tmp2, SRP_RANDOM_SALT_LEN) < 0)
+ if (RAND_bytes(tmp2, SRP_RANDOM_SALT_LEN) <= 0)
goto err;
s = BN_bin2bn(tmp2, SRP_RANDOM_SALT_LEN, NULL);
} else {
- if (!(len = t_fromb64(tmp2, *salt)))
+ if (!(len = t_fromb64(tmp2, sizeof(tmp2), *salt)))
goto err;
s = BN_bin2bn(tmp2, len, NULL);
}
@@ -635,7 +656,8 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt,
BN_free(N_bn);
BN_free(g_bn);
}
- OPENSSL_cleanse(vf, vfsize);
+ if (vf != NULL)
+ OPENSSL_cleanse(vf, vfsize);
OPENSSL_free(vf);
BN_clear_free(s);
BN_clear_free(v);
@@ -670,7 +692,7 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
srp_bn_print(g);
if (*salt == NULL) {
- if (RAND_pseudo_bytes(tmp2, SRP_RANDOM_SALT_LEN) < 0)
+ if (RAND_bytes(tmp2, SRP_RANDOM_SALT_LEN) <= 0)
goto err;
salttmp = BN_bin2bn(tmp2, SRP_RANDOM_SALT_LEN, NULL);
diff --git a/thirdparty/openssl/crypto/threads/netware.bat b/thirdparty/openssl/crypto/threads/netware.bat
deleted file mode 100644
index 0b3eca3caf..0000000000
--- a/thirdparty/openssl/crypto/threads/netware.bat
+++ /dev/null
@@ -1,79 +0,0 @@
-@echo off
-rem batch file to build multi-thread test ( mttest.nlm )
-
-rem command line arguments:
-rem debug => build using debug settings
-
-rem
-rem After building, copy mttest.nlm to the server and run it, you'll probably
-rem want to redirect stdout and stderr. An example command line would be
-rem "mttest.nlm -thread 20 -loops 10 -CAfile \openssl\apps\server.pem >mttest.out 2>mttest.err"
-rem
-
-del mttest.nlm
-
-set BLD_DEBUG=
-set CFLAGS=
-set LFLAGS=
-set LIBS=
-
-if "%1" == "DEBUG" set BLD_DEBUG=YES
-if "%1" == "debug" set BLD_DEBUG=YES
-
-if "%MWCIncludes%" == "" goto inc_error
-if "%PRELUDE%" == "" goto prelude_error
-if "%IMPORTS%" == "" goto imports_error
-
-set CFLAGS=-c -I..\..\outinc_nw -nosyspath -DOPENSSL_SYS_NETWARE -opt off -g -sym internal -maxerrors 20
-
-if "%BLD_DEBUG%" == "YES" set LIBS=..\..\out_nw.dbg\ssl.lib ..\..\out_nw.dbg\crypto.lib
-if "%BLD_DEBUG%" == "" set LIBS=..\..\out_nw\ssl.lib ..\..\out_nw\crypto.lib
-
-set LFLAGS=-msgstyle gcc -zerobss -stacksize 32768 -nostdlib -sym internal
-
-rem generate command file for metrowerks
-echo.
-echo Generating Metrowerks command file: mttest.def
-echo # dynamically generated command file for metrowerks build > mttest.def
-echo IMPORT @%IMPORTS%\clib.imp >> mttest.def
-echo IMPORT @%IMPORTS%\threads.imp >> mttest.def
-echo IMPORT @%IMPORTS%\ws2nlm.imp >> mttest.def
-echo IMPORT GetProcessSwitchCount >> mttest.def
-echo MODULE clib >> mttest.def
-
-rem compile
-echo.
-echo Compiling mttest.c
-mwccnlm.exe mttest.c %CFLAGS%
-if errorlevel 1 goto end
-
-rem link
-echo.
-echo Linking mttest.nlm
-mwldnlm.exe %LFLAGS% -screenname mttest -commandfile mttest.def mttest.o "%PRELUDE%" %LIBS% -o mttest.nlm
-if errorlevel 1 goto end
-
-goto end
-
-:inc_error
-echo.
-echo Environment variable MWCIncludes is not set - see install.nw
-goto end
-
-:prelude_error
-echo.
-echo Environment variable PRELUDE is not set - see install.nw
-goto end
-
-:imports_error
-echo.
-echo Environment variable IMPORTS is not set - see install.nw
-goto end
-
-
-:end
-set BLD_DEBUG=
-set CFLAGS=
-set LFLAGS=
-set LIBS=
-
diff --git a/thirdparty/openssl/crypto/threads/profile.sh b/thirdparty/openssl/crypto/threads/profile.sh
deleted file mode 100644
index 6e3e342fc0..0000000000
--- a/thirdparty/openssl/crypto/threads/profile.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-/bin/rm -f mttest
-cc -p -DSOLARIS -I../../include -g mttest.c -o mttest -L/usr/lib/libc -ldl -L../.. -lthread -lssl -lcrypto -lnsl -lsocket
-
diff --git a/thirdparty/openssl/crypto/threads/ptest.bat b/thirdparty/openssl/crypto/threads/ptest.bat
deleted file mode 100755
index 4071b5ffea..0000000000
--- a/thirdparty/openssl/crypto/threads/ptest.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-del mttest.exe
-
-purify cl /O2 -DWIN32 /MD -I..\..\out mttest.c /Femttest ..\..\out\ssl32.lib ..\..\out\crypt32.lib
-
diff --git a/thirdparty/openssl/crypto/threads/pthread.sh b/thirdparty/openssl/crypto/threads/pthread.sh
deleted file mode 100644
index f1c49821d2..0000000000
--- a/thirdparty/openssl/crypto/threads/pthread.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-#
-# build using pthreads
-#
-# http://www.mit.edu:8001/people/proven/pthreads.html
-#
-/bin/rm -f mttest
-pgcc -DPTHREADS -I../../include -g mttest.c -o mttest -L../.. -lssl -lcrypto
-
diff --git a/thirdparty/openssl/crypto/threads/pthread2.sh b/thirdparty/openssl/crypto/threads/pthread2.sh
deleted file mode 100755
index ec945c451b..0000000000
--- a/thirdparty/openssl/crypto/threads/pthread2.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-#
-# build using pthreads where it's already built into the system
-#
-/bin/rm -f mttest
-gcc -DPTHREADS -I../../include -g mttest.c -o mttest -L../.. -lssl -lcrypto -lpthread -ldl
diff --git a/thirdparty/openssl/crypto/threads/pthreads-vms.com b/thirdparty/openssl/crypto/threads/pthreads-vms.com
deleted file mode 100644
index 1cf92bdf57..0000000000
--- a/thirdparty/openssl/crypto/threads/pthreads-vms.com
+++ /dev/null
@@ -1,14 +0,0 @@
-$! To compile mttest on VMS.
-$!
-$! WARNING: only tested with DEC C so far.
-$
-$ if (f$getsyi("cpu").lt.128)
-$ then
-$ arch := VAX
-$ else
-$ arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
-$ if (arch .eqs. "") then arch = "UNK"
-$ endif
-$ define/user openssl [--.include.openssl]
-$ cc/def=PTHREADS mttest.c
-$ link mttest,[--.'arch'.exe.ssl]libssl/lib,[--.'arch'.exe.crypto]libcrypto/lib
diff --git a/thirdparty/openssl/crypto/threads/purify.sh b/thirdparty/openssl/crypto/threads/purify.sh
deleted file mode 100644
index 6d44fe26b7..0000000000
--- a/thirdparty/openssl/crypto/threads/purify.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-/bin/rm -f mttest
-purify cc -DSOLARIS -I../../include -g mttest.c -o mttest -L../.. -lthread -lssl -lcrypto -lnsl -lsocket
-
diff --git a/thirdparty/openssl/crypto/threads/solaris.sh b/thirdparty/openssl/crypto/threads/solaris.sh
deleted file mode 100644
index bc93094a27..0000000000
--- a/thirdparty/openssl/crypto/threads/solaris.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-/bin/rm -f mttest
-cc -DSOLARIS -I../../include -g mttest.c -o mttest -L../.. -lthread -lssl -lcrypto -lnsl -lsocket
-
diff --git a/thirdparty/openssl/crypto/threads/win32.bat b/thirdparty/openssl/crypto/threads/win32.bat
deleted file mode 100755
index ee6da80a07..0000000000
--- a/thirdparty/openssl/crypto/threads/win32.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-del mttest.exe
-
-cl /O2 -DWIN32 /MD -I..\..\out mttest.c /Femttest ..\..\out\ssleay32.lib ..\..\out\libeay32.lib
-
diff --git a/thirdparty/openssl/crypto/ts/ts_lib.c b/thirdparty/openssl/crypto/ts/ts_lib.c
index c51538a17f..e0f1063537 100644
--- a/thirdparty/openssl/crypto/ts/ts_lib.c
+++ b/thirdparty/openssl/crypto/ts/ts_lib.c
@@ -90,9 +90,8 @@ int TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj)
{
char obj_txt[128];
- int len = OBJ_obj2txt(obj_txt, sizeof(obj_txt), obj, 0);
- BIO_write(bio, obj_txt, len);
- BIO_write(bio, "\n", 1);
+ OBJ_obj2txt(obj_txt, sizeof(obj_txt), obj, 0);
+ BIO_printf(bio, "%s\n", obj_txt);
return 1;
}
diff --git a/thirdparty/openssl/crypto/ts/ts_rsp_verify.c b/thirdparty/openssl/crypto/ts/ts_rsp_verify.c
index 29aa5a497e..7918236287 100644
--- a/thirdparty/openssl/crypto/ts/ts_rsp_verify.c
+++ b/thirdparty/openssl/crypto/ts/ts_rsp_verify.c
@@ -434,51 +434,58 @@ static int int_TS_RESP_verify_token(TS_VERIFY_CTX *ctx,
unsigned char *imprint = NULL;
unsigned imprint_len = 0;
int ret = 0;
+ int flags = ctx->flags;
+
+ /* Some options require us to also check the signature */
+ if (((flags & TS_VFY_SIGNER) && tsa_name != NULL)
+ || (flags & TS_VFY_TSA_NAME)) {
+ flags |= TS_VFY_SIGNATURE;
+ }
/* Verify the signature. */
- if ((ctx->flags & TS_VFY_SIGNATURE)
+ if ((flags & TS_VFY_SIGNATURE)
&& !TS_RESP_verify_signature(token, ctx->certs, ctx->store, &signer))
goto err;
/* Check version number of response. */
- if ((ctx->flags & TS_VFY_VERSION)
+ if ((flags & TS_VFY_VERSION)
&& TS_TST_INFO_get_version(tst_info) != 1) {
TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_UNSUPPORTED_VERSION);
goto err;
}
/* Check policies. */
- if ((ctx->flags & TS_VFY_POLICY)
+ if ((flags & TS_VFY_POLICY)
&& !TS_check_policy(ctx->policy, tst_info))
goto err;
/* Check message imprints. */
- if ((ctx->flags & TS_VFY_IMPRINT)
+ if ((flags & TS_VFY_IMPRINT)
&& !TS_check_imprints(ctx->md_alg, ctx->imprint, ctx->imprint_len,
tst_info))
goto err;
/* Compute and check message imprints. */
- if ((ctx->flags & TS_VFY_DATA)
+ if ((flags & TS_VFY_DATA)
&& (!TS_compute_imprint(ctx->data, tst_info,
&md_alg, &imprint, &imprint_len)
|| !TS_check_imprints(md_alg, imprint, imprint_len, tst_info)))
goto err;
/* Check nonces. */
- if ((ctx->flags & TS_VFY_NONCE)
+ if ((flags & TS_VFY_NONCE)
&& !TS_check_nonces(ctx->nonce, tst_info))
goto err;
/* Check whether TSA name and signer certificate match. */
- if ((ctx->flags & TS_VFY_SIGNER)
+ if ((flags & TS_VFY_SIGNER)
&& tsa_name && !TS_check_signer_name(tsa_name, signer)) {
TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_NAME_MISMATCH);
goto err;
}
/* Check whether the TSA is the expected one. */
- if ((ctx->flags & TS_VFY_TSA_NAME)
+ if ((flags & TS_VFY_TSA_NAME)
&& !TS_check_signer_name(ctx->tsa_name, signer)) {
TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_UNTRUSTED);
goto err;
@@ -548,13 +555,15 @@ static int TS_check_status_info(TS_RESP *response)
static char *TS_get_status_text(STACK_OF(ASN1_UTF8STRING) *text)
{
int i;
- unsigned int length = 0;
+ int length = 0;
char *result = NULL;
char *p;
/* Determine length first. */
for (i = 0; i < sk_ASN1_UTF8STRING_num(text); ++i) {
ASN1_UTF8STRING *current = sk_ASN1_UTF8STRING_value(text, i);
+ if (ASN1_STRING_length(current) > TS_MAX_STATUS_LENGTH - length - 1)
+ return NULL;
length += ASN1_STRING_length(current);
length += 1; /* separator character */
}
diff --git a/thirdparty/openssl/crypto/txt_db/txt_db.c b/thirdparty/openssl/crypto/txt_db/txt_db.c
index f9b42ac6e5..ed02efc261 100644
--- a/thirdparty/openssl/crypto/txt_db/txt_db.c
+++ b/thirdparty/openssl/crypto/txt_db/txt_db.c
@@ -162,6 +162,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
"wrong number of fields on line %ld (looking for field %d, got %d, '%s' left)\n",
ln, num, n, f);
#endif
+ OPENSSL_free(pp);
er = 2;
goto err;
}
@@ -171,6 +172,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
* fix :-( */
fprintf(stderr, "failure in sk_push\n");
#endif
+ OPENSSL_free(pp);
er = 2;
goto err;
}
@@ -222,7 +224,7 @@ int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *),
LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp)
{
LHASH_OF(OPENSSL_STRING) *idx;
- OPENSSL_STRING *r;
+ OPENSSL_STRING *r, *k;
int i, n;
if (field >= db->num_fields) {
@@ -239,13 +241,18 @@ int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *),
r = sk_OPENSSL_PSTRING_value(db->data, i);
if ((qual != NULL) && (qual(r) == 0))
continue;
- if ((r = lh_OPENSSL_STRING_insert(idx, r)) != NULL) {
+ if ((k = lh_OPENSSL_STRING_insert(idx, r)) != NULL) {
db->error = DB_ERROR_INDEX_CLASH;
- db->arg1 = sk_OPENSSL_PSTRING_find(db->data, r);
+ db->arg1 = sk_OPENSSL_PSTRING_find(db->data, k);
db->arg2 = i;
lh_OPENSSL_STRING_free(idx);
return (0);
}
+ if (lh_OPENSSL_STRING_retrieve(idx, r) == NULL) {
+ db->error = DB_ERROR_MALLOC;
+ lh_OPENSSL_STRING_free(idx);
+ return (0);
+ }
}
if (db->index[field] != NULL)
lh_OPENSSL_STRING_free(db->index[field]);
@@ -320,20 +327,29 @@ int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *row)
}
}
}
- /* We have passed the index checks, now just append and insert */
- if (!sk_OPENSSL_PSTRING_push(db->data, row)) {
- db->error = DB_ERROR_MALLOC;
- goto err;
- }
for (i = 0; i < db->num_fields; i++) {
if (db->index[i] != NULL) {
if ((db->qual[i] != NULL) && (db->qual[i] (row) == 0))
continue;
(void)lh_OPENSSL_STRING_insert(db->index[i], row);
+ if (lh_OPENSSL_STRING_retrieve(db->index[i], row) == NULL)
+ goto err1;
}
}
+ if (!sk_OPENSSL_PSTRING_push(db->data, row))
+ goto err1;
return (1);
+
+ err1:
+ db->error = DB_ERROR_MALLOC;
+ while (i-- > 0) {
+ if (db->index[i] != NULL) {
+ if ((db->qual[i] != NULL) && (db->qual[i] (row) == 0))
+ continue;
+ (void)lh_OPENSSL_STRING_delete(db->index[i], row);
+ }
+ }
err:
return (0);
}
diff --git a/thirdparty/openssl/crypto/ui/ui_lib.c b/thirdparty/openssl/crypto/ui/ui_lib.c
index 2f580352ce..643ae59343 100644
--- a/thirdparty/openssl/crypto/ui/ui_lib.c
+++ b/thirdparty/openssl/crypto/ui/ui_lib.c
@@ -164,7 +164,7 @@ static int general_allocate_string(UI *ui, const char *prompt,
UI_STRING *s = general_allocate_prompt(ui, prompt, prompt_freeable,
type, input_flags, result_buf);
- if (s) {
+ if (s != NULL) {
if (allocate_string_stack(ui) >= 0) {
s->_.string_data.result_minsize = minsize;
s->_.string_data.result_maxsize = maxsize;
@@ -197,8 +197,8 @@ static int general_allocate_boolean(UI *ui,
} else if (cancel_chars == NULL) {
UIerr(UI_F_GENERAL_ALLOCATE_BOOLEAN, ERR_R_PASSED_NULL_PARAMETER);
} else {
- for (p = ok_chars; *p; p++) {
- if (strchr(cancel_chars, *p)) {
+ for (p = ok_chars; *p != '\0'; p++) {
+ if (strchr(cancel_chars, *p) != NULL) {
UIerr(UI_F_GENERAL_ALLOCATE_BOOLEAN,
UI_R_COMMON_OK_AND_CANCEL_CHARACTERS);
}
@@ -207,7 +207,7 @@ static int general_allocate_boolean(UI *ui,
s = general_allocate_prompt(ui, prompt, prompt_freeable,
type, input_flags, result_buf);
- if (s) {
+ if (s != NULL) {
if (allocate_string_stack(ui) >= 0) {
s->_.boolean_data.action_desc = action_desc;
s->_.boolean_data.ok_chars = ok_chars;
@@ -243,7 +243,7 @@ int UI_dup_input_string(UI *ui, const char *prompt, int flags,
{
char *prompt_copy = NULL;
- if (prompt) {
+ if (prompt != NULL) {
prompt_copy = BUF_strdup(prompt);
if (prompt_copy == NULL) {
UIerr(UI_F_UI_DUP_INPUT_STRING, ERR_R_MALLOC_FAILURE);
@@ -271,7 +271,7 @@ int UI_dup_verify_string(UI *ui, const char *prompt, int flags,
{
char *prompt_copy = NULL;
- if (prompt) {
+ if (prompt != NULL) {
prompt_copy = BUF_strdup(prompt);
if (prompt_copy == NULL) {
UIerr(UI_F_UI_DUP_VERIFY_STRING, ERR_R_MALLOC_FAILURE);
@@ -302,7 +302,7 @@ int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc,
char *ok_chars_copy = NULL;
char *cancel_chars_copy = NULL;
- if (prompt) {
+ if (prompt != NULL) {
prompt_copy = BUF_strdup(prompt);
if (prompt_copy == NULL) {
UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
@@ -310,7 +310,7 @@ int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc,
}
}
- if (action_desc) {
+ if (action_desc != NULL) {
action_desc_copy = BUF_strdup(action_desc);
if (action_desc_copy == NULL) {
UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
@@ -318,7 +318,7 @@ int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc,
}
}
- if (ok_chars) {
+ if (ok_chars != NULL) {
ok_chars_copy = BUF_strdup(ok_chars);
if (ok_chars_copy == NULL) {
UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
@@ -326,7 +326,7 @@ int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc,
}
}
- if (cancel_chars) {
+ if (cancel_chars != NULL) {
cancel_chars_copy = BUF_strdup(cancel_chars);
if (cancel_chars_copy == NULL) {
UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
@@ -359,7 +359,7 @@ int UI_dup_info_string(UI *ui, const char *text)
{
char *text_copy = NULL;
- if (text) {
+ if (text != NULL) {
text_copy = BUF_strdup(text);
if (text_copy == NULL) {
UIerr(UI_F_UI_DUP_INFO_STRING, ERR_R_MALLOC_FAILURE);
@@ -381,7 +381,7 @@ int UI_dup_error_string(UI *ui, const char *text)
{
char *text_copy = NULL;
- if (text) {
+ if (text != NULL) {
text_copy = BUF_strdup(text);
if (text_copy == NULL) {
UIerr(UI_F_UI_DUP_ERROR_STRING, ERR_R_MALLOC_FAILURE);
@@ -397,7 +397,7 @@ char *UI_construct_prompt(UI *ui, const char *object_desc,
{
char *prompt = NULL;
- if (ui->meth->ui_construct_prompt)
+ if (ui->meth->ui_construct_prompt != NULL)
prompt = ui->meth->ui_construct_prompt(ui, object_desc, object_name);
else {
char prompt1[] = "Enter ";
@@ -408,14 +408,16 @@ char *UI_construct_prompt(UI *ui, const char *object_desc,
if (object_desc == NULL)
return NULL;
len = sizeof(prompt1) - 1 + strlen(object_desc);
- if (object_name)
+ if (object_name != NULL)
len += sizeof(prompt2) - 1 + strlen(object_name);
len += sizeof(prompt3) - 1;
prompt = (char *)OPENSSL_malloc(len + 1);
+ if (prompt == NULL)
+ return NULL;
BUF_strlcpy(prompt, prompt1, len + 1);
BUF_strlcat(prompt, object_desc, len + 1);
- if (object_name) {
+ if (object_name != NULL) {
BUF_strlcat(prompt, prompt2, len + 1);
BUF_strlcat(prompt, object_name, len + 1);
}
@@ -457,7 +459,8 @@ static int print_error(const char *str, size_t len, UI *ui)
uis.type = UIT_ERROR;
uis.out_string = str;
- if (ui->meth->ui_write_string && !ui->meth->ui_write_string(ui, &uis))
+ if (ui->meth->ui_write_string != NULL
+ && ui->meth->ui_write_string(ui, &uis) <= 0)
return -1;
return 0;
}
@@ -466,24 +469,28 @@ int UI_process(UI *ui)
{
int i, ok = 0;
- if (ui->meth->ui_open_session && !ui->meth->ui_open_session(ui))
- return -1;
+ if (ui->meth->ui_open_session != NULL
+ && ui->meth->ui_open_session(ui) <= 0) {
+ ok = -1;
+ goto err;
+ }
if (ui->flags & UI_FLAG_PRINT_ERRORS)
ERR_print_errors_cb((int (*)(const char *, size_t, void *))
print_error, (void *)ui);
for (i = 0; i < sk_UI_STRING_num(ui->strings); i++) {
- if (ui->meth->ui_write_string
- && !ui->meth->ui_write_string(ui,
- sk_UI_STRING_value(ui->strings, i)))
+ if (ui->meth->ui_write_string != NULL
+ && (ui->meth->ui_write_string(ui,
+ sk_UI_STRING_value(ui->strings, i))
+ <= 0))
{
ok = -1;
goto err;
}
}
- if (ui->meth->ui_flush)
+ if (ui->meth->ui_flush != NULL)
switch (ui->meth->ui_flush(ui)) {
case -1: /* Interrupt/Cancel/something... */
ok = -2;
@@ -497,7 +504,7 @@ int UI_process(UI *ui)
}
for (i = 0; i < sk_UI_STRING_num(ui->strings); i++) {
- if (ui->meth->ui_read_string) {
+ if (ui->meth->ui_read_string != NULL) {
switch (ui->meth->ui_read_string(ui,
sk_UI_STRING_value(ui->strings,
i))) {
@@ -514,7 +521,8 @@ int UI_process(UI *ui)
}
}
err:
- if (ui->meth->ui_close_session && !ui->meth->ui_close_session(ui))
+ if (ui->meth->ui_close_session != NULL
+ && ui->meth->ui_close_session(ui) <= 0)
return -1;
return ok;
}
@@ -610,49 +618,49 @@ void UI_destroy_method(UI_METHOD *ui_method)
int UI_method_set_opener(UI_METHOD *method, int (*opener) (UI *ui))
{
- if (method) {
+ if (method != NULL) {
method->ui_open_session = opener;
return 0;
- } else
- return -1;
+ }
+ return -1;
}
int UI_method_set_writer(UI_METHOD *method,
int (*writer) (UI *ui, UI_STRING *uis))
{
- if (method) {
+ if (method != NULL) {
method->ui_write_string = writer;
return 0;
- } else
- return -1;
+ }
+ return -1;
}
int UI_method_set_flusher(UI_METHOD *method, int (*flusher) (UI *ui))
{
- if (method) {
+ if (method != NULL) {
method->ui_flush = flusher;
return 0;
- } else
- return -1;
+ }
+ return -1;
}
int UI_method_set_reader(UI_METHOD *method,
int (*reader) (UI *ui, UI_STRING *uis))
{
- if (method) {
+ if (method != NULL) {
method->ui_read_string = reader;
return 0;
- } else
- return -1;
+ }
+ return -1;
}
int UI_method_set_closer(UI_METHOD *method, int (*closer) (UI *ui))
{
- if (method) {
+ if (method != NULL) {
method->ui_close_session = closer;
return 0;
- } else
- return -1;
+ }
+ return -1;
}
int UI_method_set_prompt_constructor(UI_METHOD *method,
@@ -662,55 +670,55 @@ int UI_method_set_prompt_constructor(UI_METHOD *method,
const char
*object_name))
{
- if (method) {
+ if (method != NULL) {
method->ui_construct_prompt = prompt_constructor;
return 0;
- } else
- return -1;
+ }
+ return -1;
}
-int (*UI_method_get_opener(UI_METHOD *method)) (UI *) {
- if (method)
+int (*UI_method_get_opener(UI_METHOD *method)) (UI *)
+{
+ if (method != NULL)
return method->ui_open_session;
- else
- return NULL;
+ return NULL;
}
-int (*UI_method_get_writer(UI_METHOD *method)) (UI *, UI_STRING *) {
- if (method)
+int (*UI_method_get_writer(UI_METHOD *method)) (UI *, UI_STRING *)
+{
+ if (method != NULL)
return method->ui_write_string;
- else
- return NULL;
+ return NULL;
}
-int (*UI_method_get_flusher(UI_METHOD *method)) (UI *) {
- if (method)
+int (*UI_method_get_flusher(UI_METHOD *method)) (UI *)
+{
+ if (method != NULL)
return method->ui_flush;
- else
- return NULL;
+ return NULL;
}
-int (*UI_method_get_reader(UI_METHOD *method)) (UI *, UI_STRING *) {
- if (method)
+int (*UI_method_get_reader(UI_METHOD *method)) (UI *, UI_STRING *)
+{
+ if (method != NULL)
return method->ui_read_string;
- else
- return NULL;
+ return NULL;
}
-int (*UI_method_get_closer(UI_METHOD *method)) (UI *) {
- if (method)
+int (*UI_method_get_closer(UI_METHOD *method)) (UI *)
+{
+ if (method != NULL)
return method->ui_close_session;
- else
- return NULL;
+ return NULL;
}
char *(*UI_method_get_prompt_constructor(UI_METHOD *method)) (UI *,
const char *,
- const char *) {
- if (method)
+ const char *)
+{
+ if (method != NULL)
return method->ui_construct_prompt;
- else
- return NULL;
+ return NULL;
}
enum UI_string_types UI_get_string_type(UI_STRING *uis)
@@ -739,7 +747,6 @@ const char *UI_get0_action_string(UI_STRING *uis)
if (!uis)
return NULL;
switch (uis->type) {
- case UIT_PROMPT:
case UIT_BOOLEAN:
return uis->_.boolean_data.action_desc;
default:
diff --git a/thirdparty/openssl/crypto/ui/ui_openssl.c b/thirdparty/openssl/crypto/ui/ui_openssl.c
index 9ab259b8f6..17d14f5842 100644
--- a/thirdparty/openssl/crypto/ui/ui_openssl.c
+++ b/thirdparty/openssl/crypto/ui/ui_openssl.c
@@ -440,7 +440,7 @@ static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl)
# else
p = fgets(result, maxsize, tty_in);
# endif
- if (!p)
+ if (p == NULL)
goto error;
if (feof(tty_in))
goto error;
@@ -509,18 +509,31 @@ static int open_console(UI *ui)
is_a_tty = 0;
else
# endif
+# ifdef ENODEV
+ /*
+ * MacOS X returns ENODEV (Operation not supported by device),
+ * which seems appropriate.
+ */
+ if (errno == ENODEV)
+ is_a_tty = 0;
+ else
+# endif
return 0;
}
#endif
#ifdef OPENSSL_SYS_VMS
status = sys$assign(&terminal, &channel, 0, 0);
+
+ /* if there isn't a TT device, something is very wrong */
if (status != SS$_NORMAL)
return 0;
- status =
- sys$qiow(0, channel, IO$_SENSEMODE, &iosb, 0, 0, tty_orig, 12, 0, 0,
- 0, 0);
+
+ status = sys$qiow(0, channel, IO$_SENSEMODE, &iosb, 0, 0, tty_orig, 12,
+ 0, 0, 0, 0);
+
+ /* If IO$_SENSEMODE doesn't work, this is not a terminal device */
if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL))
- return 0;
+ is_a_tty = 0;
#endif
return 1;
}
@@ -537,14 +550,15 @@ static int noecho_console(UI *ui)
return 0;
#endif
#ifdef OPENSSL_SYS_VMS
- tty_new[0] = tty_orig[0];
- tty_new[1] = tty_orig[1] | TT$M_NOECHO;
- tty_new[2] = tty_orig[2];
- status =
- sys$qiow(0, channel, IO$_SETMODE, &iosb, 0, 0, tty_new, 12, 0, 0, 0,
- 0);
- if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL))
- return 0;
+ if (is_a_tty) {
+ tty_new[0] = tty_orig[0];
+ tty_new[1] = tty_orig[1] | TT$M_NOECHO;
+ tty_new[2] = tty_orig[2];
+ status = sys$qiow(0, channel, IO$_SETMODE, &iosb, 0, 0, tty_new, 12,
+ 0, 0, 0, 0);
+ if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL))
+ return 0;
+ }
#endif
return 1;
}
@@ -561,14 +575,15 @@ static int echo_console(UI *ui)
return 0;
#endif
#ifdef OPENSSL_SYS_VMS
- tty_new[0] = tty_orig[0];
- tty_new[1] = tty_orig[1] & ~TT$M_NOECHO;
- tty_new[2] = tty_orig[2];
- status =
- sys$qiow(0, channel, IO$_SETMODE, &iosb, 0, 0, tty_new, 12, 0, 0, 0,
- 0);
- if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL))
- return 0;
+ if (is_a_tty) {
+ tty_new[0] = tty_orig[0];
+ tty_new[1] = tty_orig[1] & ~TT$M_NOECHO;
+ tty_new[2] = tty_orig[2];
+ status = sys$qiow(0, channel, IO$_SETMODE, &iosb, 0, 0, tty_new, 12,
+ 0, 0, 0, 0);
+ if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL))
+ return 0;
+ }
#endif
return 1;
}
@@ -581,6 +596,8 @@ static int close_console(UI *ui)
fclose(tty_out);
#ifdef OPENSSL_SYS_VMS
status = sys$dassgn(channel);
+ if (status != SS$_NORMAL)
+ return 0;
#endif
CRYPTO_w_unlock(CRYPTO_LOCK_UI);
diff --git a/thirdparty/openssl/crypto/whrlpool/wp_dgst.c b/thirdparty/openssl/crypto/whrlpool/wp_dgst.c
index e33bb4f833..807d1c49b2 100644
--- a/thirdparty/openssl/crypto/whrlpool/wp_dgst.c
+++ b/thirdparty/openssl/crypto/whrlpool/wp_dgst.c
@@ -51,6 +51,7 @@
* input. This is done for perfomance.
*/
+#include <openssl/crypto.h>
#include "wp_locl.h"
#include <openssl/crypto.h>
#include <string.h>
@@ -237,7 +238,7 @@ int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c)
if (md) {
memcpy(md, c->H.c, WHIRLPOOL_DIGEST_LENGTH);
- memset(c, 0, sizeof(*c));
+ OPENSSL_cleanse(c, sizeof(*c));
return (1);
}
return (0);
diff --git a/thirdparty/openssl/crypto/x509/by_dir.c b/thirdparty/openssl/crypto/x509/by_dir.c
index 9ee8f8d859..bbc3189381 100644
--- a/thirdparty/openssl/crypto/x509/by_dir.c
+++ b/thirdparty/openssl/crypto/x509/by_dir.c
@@ -401,6 +401,10 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
}
if (!hent) {
hent = OPENSSL_malloc(sizeof(BY_DIR_HASH));
+ if (hent == NULL) {
+ X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_MALLOC_FAILURE);
+ goto finish;
+ }
hent->hash = h;
hent->suffix = k;
if (!sk_BY_DIR_HASH_push(ent->hashes, hent)) {
diff --git a/thirdparty/openssl/crypto/x509/x509_att.c b/thirdparty/openssl/crypto/x509/x509_att.c
index bd59281f9d..2501075307 100644
--- a/thirdparty/openssl/crypto/x509/x509_att.c
+++ b/thirdparty/openssl/crypto/x509/x509_att.c
@@ -296,7 +296,7 @@ int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj)
int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
const void *data, int len)
{
- ASN1_TYPE *ttmp;
+ ASN1_TYPE *ttmp = NULL;
ASN1_STRING *stmp = NULL;
int atype = 0;
if (!attr)
@@ -324,20 +324,26 @@ int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
* least one value but some types use and zero length SET and require
* this.
*/
- if (attrtype == 0)
+ if (attrtype == 0) {
+ ASN1_STRING_free(stmp);
return 1;
+ }
if (!(ttmp = ASN1_TYPE_new()))
goto err;
if ((len == -1) && !(attrtype & MBSTRING_FLAG)) {
if (!ASN1_TYPE_set1(ttmp, attrtype, data))
goto err;
- } else
+ } else {
ASN1_TYPE_set(ttmp, atype, stmp);
+ stmp = NULL;
+ }
if (!sk_ASN1_TYPE_push(attr->value.set, ttmp))
goto err;
return 1;
err:
X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE);
+ ASN1_TYPE_free(ttmp);
+ ASN1_STRING_free(stmp);
return 0;
}
diff --git a/thirdparty/openssl/crypto/x509/x509_err.c b/thirdparty/openssl/crypto/x509/x509_err.c
index 1e779fefd9..a2a8e1b08b 100644
--- a/thirdparty/openssl/crypto/x509/x509_err.c
+++ b/thirdparty/openssl/crypto/x509/x509_err.c
@@ -1,6 +1,6 @@
/* crypto/x509/x509_err.c */
/* ====================================================================
- * Copyright (c) 1999-2012 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2016 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -72,6 +72,7 @@
static ERR_STRING_DATA X509_str_functs[] = {
{ERR_FUNC(X509_F_ADD_CERT_DIR), "ADD_CERT_DIR"},
{ERR_FUNC(X509_F_BY_FILE_CTRL), "BY_FILE_CTRL"},
+ {ERR_FUNC(X509_F_CHECK_NAME_CONSTRAINTS), "CHECK_NAME_CONSTRAINTS"},
{ERR_FUNC(X509_F_CHECK_POLICY), "CHECK_POLICY"},
{ERR_FUNC(X509_F_DIR_CTRL), "DIR_CTRL"},
{ERR_FUNC(X509_F_GET_CERT_BY_SUBJECT), "GET_CERT_BY_SUBJECT"},
diff --git a/thirdparty/openssl/crypto/x509/x509_lu.c b/thirdparty/openssl/crypto/x509/x509_lu.c
index 50120a4d70..b7424809fd 100644
--- a/thirdparty/openssl/crypto/x509/x509_lu.c
+++ b/thirdparty/openssl/crypto/x509/x509_lu.c
@@ -185,14 +185,16 @@ X509_STORE *X509_STORE_new(void)
if ((ret = (X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL)
return NULL;
- ret->objs = sk_X509_OBJECT_new(x509_object_cmp);
+ if ((ret->objs = sk_X509_OBJECT_new(x509_object_cmp)) == NULL)
+ goto err0;
ret->cache = 1;
- ret->get_cert_methods = sk_X509_LOOKUP_new_null();
+ if ((ret->get_cert_methods = sk_X509_LOOKUP_new_null()) == NULL)
+ goto err1;
ret->verify = 0;
ret->verify_cb = 0;
if ((ret->param = X509_VERIFY_PARAM_new()) == NULL)
- return NULL;
+ goto err2;
ret->get_issuer = 0;
ret->check_issued = 0;
@@ -204,14 +206,21 @@ X509_STORE *X509_STORE_new(void)
ret->lookup_crls = 0;
ret->cleanup = 0;
- if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE, ret, &ret->ex_data)) {
- sk_X509_OBJECT_free(ret->objs);
- OPENSSL_free(ret);
- return NULL;
- }
+ if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE, ret, &ret->ex_data))
+ goto err3;
ret->references = 1;
return ret;
+
+ err3:
+ X509_VERIFY_PARAM_free(ret->param);
+ err2:
+ sk_X509_LOOKUP_free(ret->get_cert_methods);
+ err1:
+ sk_X509_OBJECT_free(ret->objs);
+ err0:
+ OPENSSL_free(ret);
+ return NULL;
}
static void cleanup(X509_OBJECT *a)
@@ -360,8 +369,12 @@ int X509_STORE_add_cert(X509_STORE *ctx, X509 *x)
X509err(X509_F_X509_STORE_ADD_CERT,
X509_R_CERT_ALREADY_IN_HASH_TABLE);
ret = 0;
- } else
- sk_X509_OBJECT_push(ctx->objs, obj);
+ } else if (!sk_X509_OBJECT_push(ctx->objs, obj)) {
+ X509_OBJECT_free_contents(obj);
+ OPENSSL_free(obj);
+ X509err(X509_F_X509_STORE_ADD_CERT, ERR_R_MALLOC_FAILURE);
+ ret = 0;
+ }
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
@@ -392,8 +405,12 @@ int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x)
OPENSSL_free(obj);
X509err(X509_F_X509_STORE_ADD_CRL, X509_R_CERT_ALREADY_IN_HASH_TABLE);
ret = 0;
- } else
- sk_X509_OBJECT_push(ctx->objs, obj);
+ } else if (!sk_X509_OBJECT_push(ctx->objs, obj)) {
+ X509_OBJECT_free_contents(obj);
+ OPENSSL_free(obj);
+ X509err(X509_F_X509_STORE_ADD_CRL, ERR_R_MALLOC_FAILURE);
+ ret = 0;
+ }
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
diff --git a/thirdparty/openssl/crypto/x509/x509_obj.c b/thirdparty/openssl/crypto/x509/x509_obj.c
index 3de3ac7204..0a839f3e54 100644
--- a/thirdparty/openssl/crypto/x509/x509_obj.c
+++ b/thirdparty/openssl/crypto/x509/x509_obj.c
@@ -129,7 +129,7 @@ char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
type == V_ASN1_VISIBLESTRING ||
type == V_ASN1_PRINTABLESTRING ||
type == V_ASN1_TELETEXSTRING ||
- type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) {
+ type == V_ASN1_IA5STRING) {
if (num > (int)sizeof(ebcdic_buf))
num = sizeof(ebcdic_buf);
ascii2ebcdic(ebcdic_buf, q, num);
diff --git a/thirdparty/openssl/crypto/x509/x509_r2x.c b/thirdparty/openssl/crypto/x509/x509_r2x.c
index 0ff439c99f..2879569ead 100644
--- a/thirdparty/openssl/crypto/x509/x509_r2x.c
+++ b/thirdparty/openssl/crypto/x509/x509_r2x.c
@@ -70,10 +70,12 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
X509 *ret = NULL;
X509_CINF *xi = NULL;
X509_NAME *xn;
+ EVP_PKEY *pubkey = NULL;
+ int res;
if ((ret = X509_new()) == NULL) {
X509err(X509_F_X509_REQ_TO_X509, ERR_R_MALLOC_FAILURE);
- goto err;
+ return NULL;
}
/* duplicate the request */
@@ -89,9 +91,9 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
}
xn = X509_REQ_get_subject_name(r);
- if (X509_set_subject_name(ret, X509_NAME_dup(xn)) == 0)
+ if (X509_set_subject_name(ret, xn) == 0)
goto err;
- if (X509_set_issuer_name(ret, X509_NAME_dup(xn)) == 0)
+ if (X509_set_issuer_name(ret, xn) == 0)
goto err;
if (X509_gmtime_adj(xi->validity->notBefore, 0) == NULL)
@@ -100,9 +102,11 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
NULL)
goto err;
- X509_set_pubkey(ret, X509_REQ_get_pubkey(r));
+ pubkey = X509_REQ_get_pubkey(r);
+ res = X509_set_pubkey(ret, pubkey);
+ EVP_PKEY_free(pubkey);
- if (!X509_sign(ret, pkey, EVP_md5()))
+ if (!res || !X509_sign(ret, pkey, EVP_md5()))
goto err;
if (0) {
err:
diff --git a/thirdparty/openssl/crypto/x509/x509_txt.c b/thirdparty/openssl/crypto/x509/x509_txt.c
index 3d46d3ff83..35db095591 100644
--- a/thirdparty/openssl/crypto/x509/x509_txt.c
+++ b/thirdparty/openssl/crypto/x509/x509_txt.c
@@ -204,6 +204,13 @@ const char *X509_verify_cert_error_string(long n)
case X509_V_ERR_IP_ADDRESS_MISMATCH:
return ("IP address mismatch");
+ case X509_V_ERR_INVALID_CALL:
+ return ("Invalid certificate verification context");
+ case X509_V_ERR_STORE_LOOKUP:
+ return ("Issuer certificate lookup error");
+ case X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION:
+ return ("proxy subject name violation");
+
default:
BIO_snprintf(buf, sizeof buf, "error number %ld", n);
return (buf);
diff --git a/thirdparty/openssl/crypto/x509/x509_vfy.c b/thirdparty/openssl/crypto/x509/x509_vfy.c
index 4d34dbac93..b1472018ba 100644
--- a/thirdparty/openssl/crypto/x509/x509_vfy.c
+++ b/thirdparty/openssl/crypto/x509/x509_vfy.c
@@ -199,6 +199,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
if (ctx->cert == NULL) {
X509err(X509_F_X509_VERIFY_CERT, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY);
+ ctx->error = X509_V_ERR_INVALID_CALL;
return -1;
}
if (ctx->chain != NULL) {
@@ -207,6 +208,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
* cannot do another one.
*/
X509err(X509_F_X509_VERIFY_CERT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+ ctx->error = X509_V_ERR_INVALID_CALL;
return -1;
}
@@ -219,6 +221,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
if (((ctx->chain = sk_X509_new_null()) == NULL) ||
(!sk_X509_push(ctx->chain, ctx->cert))) {
X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
+ ctx->error = X509_V_ERR_OUT_OF_MEM;
ok = -1;
goto err;
}
@@ -229,6 +232,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
if (ctx->untrusted != NULL
&& (sktmp = sk_X509_dup(ctx->untrusted)) == NULL) {
X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
+ ctx->error = X509_V_ERR_OUT_OF_MEM;
ok = -1;
goto err;
}
@@ -253,8 +257,10 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
*/
if (ctx->param->flags & X509_V_FLAG_TRUSTED_FIRST) {
ok = ctx->get_issuer(&xtmp, ctx, x);
- if (ok < 0)
+ if (ok < 0) {
+ ctx->error = X509_V_ERR_STORE_LOOKUP;
goto err;
+ }
/*
* If successful for now free up cert so it will be picked up
* again later.
@@ -271,6 +277,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
if (xtmp != NULL) {
if (!sk_X509_push(ctx->chain, xtmp)) {
X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
+ ctx->error = X509_V_ERR_OUT_OF_MEM;
ok = -1;
goto err;
}
@@ -352,14 +359,17 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
break;
ok = ctx->get_issuer(&xtmp, ctx, x);
- if (ok < 0)
+ if (ok < 0) {
+ ctx->error = X509_V_ERR_STORE_LOOKUP;
goto err;
+ }
if (ok == 0)
break;
x = xtmp;
if (!sk_X509_push(ctx->chain, x)) {
X509_free(xtmp);
X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
+ ctx->error = X509_V_ERR_OUT_OF_MEM;
ok = -1;
goto err;
}
@@ -386,8 +396,10 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
while (j-- > 1) {
xtmp2 = sk_X509_value(ctx->chain, j - 1);
ok = ctx->get_issuer(&xtmp, ctx, xtmp2);
- if (ok < 0)
+ if (ok < 0) {
+ ctx->error = X509_V_ERR_STORE_LOOKUP;
goto err;
+ }
/* Check if we found an alternate chain */
if (ok > 0) {
/*
@@ -515,6 +527,10 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
sk_X509_free(sktmp);
if (chain_ss != NULL)
X509_free(chain_ss);
+
+ /* Safety net, error returns must set ctx->error */
+ if (ok <= 0 && ctx->error == X509_V_OK)
+ ctx->error = X509_V_ERR_UNSPECIFIED;
return ok;
}
@@ -697,13 +713,27 @@ static int check_chain_extensions(X509_STORE_CTX *ctx)
* the next certificate must be a CA certificate.
*/
if (x->ex_flags & EXFLAG_PROXY) {
- if (x->ex_pcpathlen != -1 && i > x->ex_pcpathlen) {
- ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED;
- ctx->error_depth = i;
- ctx->current_cert = x;
- ok = cb(0, ctx);
- if (!ok)
- goto end;
+ /*
+ * RFC3820, 4.1.3 (b)(1) stipulates that if pCPathLengthConstraint
+ * is less than max_path_length, the former should be copied to
+ * the latter, and 4.1.4 (a) stipulates that max_path_length
+ * should be verified to be larger than zero and decrement it.
+ *
+ * Because we're checking the certs in the reverse order, we start
+ * with verifying that proxy_path_length isn't larger than pcPLC,
+ * and copy the latter to the former if it is, and finally,
+ * increment proxy_path_length.
+ */
+ if (x->ex_pcpathlen != -1) {
+ if (proxy_path_length > x->ex_pcpathlen) {
+ ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED;
+ ctx->error_depth = i;
+ ctx->current_cert = x;
+ ok = cb(0, ctx);
+ if (!ok)
+ goto end;
+ }
+ proxy_path_length = x->ex_pcpathlen;
}
proxy_path_length++;
must_be_ca = 0;
@@ -726,6 +756,81 @@ static int check_name_constraints(X509_STORE_CTX *ctx)
/* Ignore self issued certs unless last in chain */
if (i && (x->ex_flags & EXFLAG_SI))
continue;
+
+ /*
+ * Proxy certificates policy has an extra constraint, where the
+ * certificate subject MUST be the issuer with a single CN entry
+ * added.
+ * (RFC 3820: 3.4, 4.1.3 (a)(4))
+ */
+ if (x->ex_flags & EXFLAG_PROXY) {
+ X509_NAME *tmpsubject = X509_get_subject_name(x);
+ X509_NAME *tmpissuer = X509_get_issuer_name(x);
+ X509_NAME_ENTRY *tmpentry = NULL;
+ int last_object_nid = 0;
+ int err = X509_V_OK;
+ int last_object_loc = X509_NAME_entry_count(tmpsubject) - 1;
+
+ /* Check that there are at least two RDNs */
+ if (last_object_loc < 1) {
+ err = X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION;
+ goto proxy_name_done;
+ }
+
+ /*
+ * Check that there is exactly one more RDN in subject as
+ * there is in issuer.
+ */
+ if (X509_NAME_entry_count(tmpsubject)
+ != X509_NAME_entry_count(tmpissuer) + 1) {
+ err = X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION;
+ goto proxy_name_done;
+ }
+
+ /*
+ * Check that the last subject component isn't part of a
+ * multivalued RDN
+ */
+ if (X509_NAME_get_entry(tmpsubject, last_object_loc)->set
+ == X509_NAME_get_entry(tmpsubject, last_object_loc - 1)->set) {
+ err = X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION;
+ goto proxy_name_done;
+ }
+
+ /*
+ * Check that the last subject RDN is a commonName, and that
+ * all the previous RDNs match the issuer exactly
+ */
+ tmpsubject = X509_NAME_dup(tmpsubject);
+ if (tmpsubject == NULL) {
+ X509err(X509_F_CHECK_NAME_CONSTRAINTS, ERR_R_MALLOC_FAILURE);
+ ctx->error = X509_V_ERR_OUT_OF_MEM;
+ return 0;
+ }
+
+ tmpentry =
+ X509_NAME_delete_entry(tmpsubject, last_object_loc);
+ last_object_nid =
+ OBJ_obj2nid(X509_NAME_ENTRY_get_object(tmpentry));
+
+ if (last_object_nid != NID_commonName
+ || X509_NAME_cmp(tmpsubject, tmpissuer) != 0) {
+ err = X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION;
+ }
+
+ X509_NAME_ENTRY_free(tmpentry);
+ X509_NAME_free(tmpsubject);
+
+ proxy_name_done:
+ if (err != X509_V_OK) {
+ ctx->error = err;
+ ctx->error_depth = i;
+ ctx->current_cert = x;
+ if (!ctx->verify_cb(0, ctx))
+ return 0;
+ }
+ }
+
/*
* Check against constraints for all certificates higher in chain
* including trust anchor. Trust anchor not strictly speaking needed
@@ -736,12 +841,19 @@ static int check_name_constraints(X509_STORE_CTX *ctx)
NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
if (nc) {
rv = NAME_CONSTRAINTS_check(x, nc);
- if (rv != X509_V_OK) {
+ switch (rv) {
+ case X509_V_OK:
+ continue;
+ case X509_V_ERR_OUT_OF_MEM:
+ ctx->error = rv;
+ return 0;
+ default:
ctx->error = rv;
ctx->error_depth = i;
ctx->current_cert = x;
if (!ctx->verify_cb(0, ctx))
return 0;
+ break;
}
}
}
@@ -880,6 +992,8 @@ static int check_cert(X509_STORE_CTX *ctx)
ctx->current_issuer = NULL;
ctx->current_crl_score = 0;
ctx->current_reasons = 0;
+ if (x->ex_flags & EXFLAG_PROXY)
+ return 1;
while (ctx->current_reasons != CRLDP_ALL_REASONS) {
last_reasons = ctx->current_reasons;
/* Try to retrieve relevant CRL */
@@ -1010,13 +1124,25 @@ static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl,
crl = sk_X509_CRL_value(crls, i);
reasons = *preasons;
crl_score = get_crl_score(ctx, &crl_issuer, &reasons, crl, x);
-
- if (crl_score > best_score) {
- best_crl = crl;
- best_crl_issuer = crl_issuer;
- best_score = crl_score;
- best_reasons = reasons;
+ if (crl_score < best_score || crl_score == 0)
+ continue;
+ /* If current CRL is equivalent use it if it is newer */
+ if (crl_score == best_score && best_crl != NULL) {
+ int day, sec;
+ if (ASN1_TIME_diff(&day, &sec, X509_CRL_get_lastUpdate(best_crl),
+ X509_CRL_get_lastUpdate(crl)) == 0)
+ continue;
+ /*
+ * ASN1_TIME_diff never returns inconsistent signs for |day|
+ * and |sec|.
+ */
+ if (day <= 0 && sec <= 0)
+ continue;
}
+ best_crl = crl;
+ best_crl_issuer = crl_issuer;
+ best_score = crl_score;
+ best_reasons = reasons;
}
if (best_crl) {
@@ -1630,6 +1756,7 @@ static int check_policy(X509_STORE_CTX *ctx)
ctx->param->policies, ctx->param->flags);
if (ret == 0) {
X509err(X509_F_CHECK_POLICY, ERR_R_MALLOC_FAILURE);
+ ctx->error = X509_V_ERR_OUT_OF_MEM;
return 0;
}
/* Invalid or inconsistent extensions */
@@ -1658,7 +1785,12 @@ static int check_policy(X509_STORE_CTX *ctx)
if (ctx->param->flags & X509_V_FLAG_NOTIFY_POLICY) {
ctx->current_cert = NULL;
- ctx->error = X509_V_OK;
+ /*
+ * Verification errors need to be "sticky", a callback may have allowed
+ * an SSL handshake to continue despite an error, and we must then
+ * remain in an error state. Therefore, we MUST NOT clear earlier
+ * verification errors by setting the error to X509_V_OK.
+ */
if (!ctx->verify_cb(2, ctx))
return 0;
}
diff --git a/thirdparty/openssl/crypto/x509/x509spki.c b/thirdparty/openssl/crypto/x509/x509spki.c
index 2df84ead9e..5ae5d30a35 100644
--- a/thirdparty/openssl/crypto/x509/x509spki.c
+++ b/thirdparty/openssl/crypto/x509/x509spki.c
@@ -112,6 +112,8 @@ char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki)
der_spki = OPENSSL_malloc(der_len);
b64_str = OPENSSL_malloc(der_len * 2);
if (!der_spki || !b64_str) {
+ OPENSSL_free(der_spki);
+ OPENSSL_free(b64_str);
X509err(X509_F_NETSCAPE_SPKI_B64_ENCODE, ERR_R_MALLOC_FAILURE);
return NULL;
}
diff --git a/thirdparty/openssl/crypto/x509v3/v3_addr.c b/thirdparty/openssl/crypto/x509v3/v3_addr.c
index 94cfed0509..1290dec9bb 100644
--- a/thirdparty/openssl/crypto/x509v3/v3_addr.c
+++ b/thirdparty/openssl/crypto/x509v3/v3_addr.c
@@ -1211,6 +1211,11 @@ int v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b)
/*
* Core code for RFC 3779 2.3 path validation.
+ *
+ * Returns 1 for success, 0 on error.
+ *
+ * When returning 0, ctx->error MUST be set to an appropriate value other than
+ * X509_V_OK.
*/
static int v3_addr_validate_path_internal(X509_STORE_CTX *ctx,
STACK_OF(X509) *chain,
@@ -1245,6 +1250,7 @@ static int v3_addr_validate_path_internal(X509_STORE_CTX *ctx,
if ((child = sk_IPAddressFamily_dup(ext)) == NULL) {
X509V3err(X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL,
ERR_R_MALLOC_FAILURE);
+ ctx->error = X509_V_ERR_OUT_OF_MEM;
ret = 0;
goto done;
}
diff --git a/thirdparty/openssl/crypto/x509v3/v3_alt.c b/thirdparty/openssl/crypto/x509v3/v3_alt.c
index 22ec202846..a0351faf11 100644
--- a/thirdparty/openssl/crypto/x509v3/v3_alt.c
+++ b/thirdparty/openssl/crypto/x509v3/v3_alt.c
@@ -119,32 +119,39 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
int i;
switch (gen->type) {
case GEN_OTHERNAME:
- X509V3_add_value("othername", "<unsupported>", &ret);
+ if (!X509V3_add_value("othername", "<unsupported>", &ret))
+ return NULL;
break;
case GEN_X400:
- X509V3_add_value("X400Name", "<unsupported>", &ret);
+ if (!X509V3_add_value("X400Name", "<unsupported>", &ret))
+ return NULL;
break;
case GEN_EDIPARTY:
- X509V3_add_value("EdiPartyName", "<unsupported>", &ret);
+ if (!X509V3_add_value("EdiPartyName", "<unsupported>", &ret))
+ return NULL;
break;
case GEN_EMAIL:
- X509V3_add_value_uchar("email", gen->d.ia5->data, &ret);
+ if (!X509V3_add_value_uchar("email", gen->d.ia5->data, &ret))
+ return NULL;
break;
case GEN_DNS:
- X509V3_add_value_uchar("DNS", gen->d.ia5->data, &ret);
+ if (!X509V3_add_value_uchar("DNS", gen->d.ia5->data, &ret))
+ return NULL;
break;
case GEN_URI:
- X509V3_add_value_uchar("URI", gen->d.ia5->data, &ret);
+ if (!X509V3_add_value_uchar("URI", gen->d.ia5->data, &ret))
+ return NULL;
break;
case GEN_DIRNAME:
- X509_NAME_oneline(gen->d.dirn, oline, 256);
- X509V3_add_value("DirName", oline, &ret);
+ if (X509_NAME_oneline(gen->d.dirn, oline, 256) == NULL
+ || !X509V3_add_value("DirName", oline, &ret))
+ return NULL;
break;
case GEN_IPADD:
@@ -162,15 +169,18 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
strcat(oline, ":");
}
} else {
- X509V3_add_value("IP Address", "<invalid>", &ret);
+ if (!X509V3_add_value("IP Address", "<invalid>", &ret))
+ return NULL;
break;
}
- X509V3_add_value("IP Address", oline, &ret);
+ if (!X509V3_add_value("IP Address", oline, &ret))
+ return NULL;
break;
case GEN_RID:
i2t_ASN1_OBJECT(oline, 256, gen->d.rid);
- X509V3_add_value("Registered ID", oline, &ret);
+ if (!X509V3_add_value("Registered ID", oline, &ret))
+ return NULL;
break;
}
return ret;
@@ -573,6 +583,8 @@ static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx)
return 0;
objlen = p - value;
objtmp = OPENSSL_malloc(objlen + 1);
+ if (objtmp == NULL)
+ return 0;
strncpy(objtmp, value, objlen);
objtmp[objlen] = 0;
gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0);
diff --git a/thirdparty/openssl/crypto/x509v3/v3_conf.c b/thirdparty/openssl/crypto/x509v3/v3_conf.c
index eeff8bd185..c1b4c1a89f 100644
--- a/thirdparty/openssl/crypto/x509v3/v3_conf.c
+++ b/thirdparty/openssl/crypto/x509v3/v3_conf.c
@@ -135,11 +135,13 @@ static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid,
nval = NCONF_get_section(conf, value + 1);
else
nval = X509V3_parse_list(value);
- if (sk_CONF_VALUE_num(nval) <= 0) {
+ if (nval == NULL || sk_CONF_VALUE_num(nval) <= 0) {
X509V3err(X509V3_F_DO_EXT_NCONF,
X509V3_R_INVALID_EXTENSION_STRING);
ERR_add_error_data(4, "name=", OBJ_nid2sn(ext_nid), ",section=",
value);
+ if (*value != '@')
+ sk_CONF_VALUE_free(nval);
return NULL;
}
ext_struc = method->v2i(method, ctx, nval);
diff --git a/thirdparty/openssl/crypto/x509v3/v3_cpols.c b/thirdparty/openssl/crypto/x509v3/v3_cpols.c
index d97f6226b9..b99269e7f8 100644
--- a/thirdparty/openssl/crypto/x509v3/v3_cpols.c
+++ b/thirdparty/openssl/crypto/x509v3/v3_cpols.c
@@ -390,10 +390,10 @@ static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos)
return 1;
merr:
+ ASN1_INTEGER_free(aint);
X509V3err(X509V3_F_NREF_NOS, ERR_R_MALLOC_FAILURE);
err:
- sk_ASN1_INTEGER_pop_free(nnums, ASN1_STRING_free);
return 0;
}
@@ -458,9 +458,15 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
num = sk_ASN1_INTEGER_value(ref->noticenos, i);
if (i)
BIO_puts(out, ", ");
- tmp = i2s_ASN1_INTEGER(NULL, num);
- BIO_puts(out, tmp);
- OPENSSL_free(tmp);
+ if (num == NULL)
+ BIO_puts(out, "(null)");
+ else {
+ tmp = i2s_ASN1_INTEGER(NULL, num);
+ if (tmp == NULL)
+ return;
+ BIO_puts(out, tmp);
+ OPENSSL_free(tmp);
+ }
}
BIO_puts(out, "\n");
}
diff --git a/thirdparty/openssl/crypto/x509v3/v3_info.c b/thirdparty/openssl/crypto/x509v3/v3_info.c
index e052a34b94..7064c725d9 100644
--- a/thirdparty/openssl/crypto/x509v3/v3_info.c
+++ b/thirdparty/openssl/crypto/x509v3/v3_info.c
@@ -107,29 +107,30 @@ ASN1_ITEM_TEMPLATE_END(AUTHORITY_INFO_ACCESS)
IMPLEMENT_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS)
-static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
- *method, AUTHORITY_INFO_ACCESS
- *ainfo, STACK_OF(CONF_VALUE)
- *ret)
+static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(
+ X509V3_EXT_METHOD *method, AUTHORITY_INFO_ACCESS *ainfo,
+ STACK_OF(CONF_VALUE) *ret)
{
ACCESS_DESCRIPTION *desc;
int i, nlen;
char objtmp[80], *ntmp;
CONF_VALUE *vtmp;
+ STACK_OF(CONF_VALUE) *tret = ret;
+
for (i = 0; i < sk_ACCESS_DESCRIPTION_num(ainfo); i++) {
+ STACK_OF(CONF_VALUE) *tmp;
+
desc = sk_ACCESS_DESCRIPTION_value(ainfo, i);
- ret = i2v_GENERAL_NAME(method, desc->location, ret);
- if (!ret)
- break;
- vtmp = sk_CONF_VALUE_value(ret, i);
+ tmp = i2v_GENERAL_NAME(method, desc->location, tret);
+ if (tmp == NULL)
+ goto err;
+ tret = tmp;
+ vtmp = sk_CONF_VALUE_value(tret, i);
i2t_ASN1_OBJECT(objtmp, sizeof objtmp, desc->method);
nlen = strlen(objtmp) + strlen(vtmp->name) + 5;
ntmp = OPENSSL_malloc(nlen);
- if (!ntmp) {
- X509V3err(X509V3_F_I2V_AUTHORITY_INFO_ACCESS,
- ERR_R_MALLOC_FAILURE);
- return NULL;
- }
+ if (ntmp == NULL)
+ goto err;
BUF_strlcpy(ntmp, objtmp, nlen);
BUF_strlcat(ntmp, " - ", nlen);
BUF_strlcat(ntmp, vtmp->name, nlen);
@@ -137,9 +138,15 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
vtmp->name = ntmp;
}
- if (!ret)
+ if (ret == NULL && tret == NULL)
return sk_CONF_VALUE_new_null();
- return ret;
+
+ return tret;
+ err:
+ X509V3err(X509V3_F_I2V_AUTHORITY_INFO_ACCESS, ERR_R_MALLOC_FAILURE);
+ if (ret == NULL && tret != NULL)
+ sk_CONF_VALUE_pop_free(tret, X509V3_conf_free);
+ return NULL;
}
static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
diff --git a/thirdparty/openssl/crypto/x509v3/v3_purp.c b/thirdparty/openssl/crypto/x509v3/v3_purp.c
index 845be673b7..96e629a930 100644
--- a/thirdparty/openssl/crypto/x509v3/v3_purp.c
+++ b/thirdparty/openssl/crypto/x509v3/v3_purp.c
@@ -321,6 +321,7 @@ int X509_supported_extension(X509_EXTENSION *ex)
NID_subject_alt_name, /* 85 */
NID_basic_constraints, /* 87 */
NID_certificate_policies, /* 89 */
+ NID_crl_distribution_points, /* 103 */
NID_ext_key_usage, /* 126 */
#ifndef OPENSSL_NO_RFC3779
NID_sbgp_ipAddrBlock, /* 290 */
diff --git a/thirdparty/openssl/openssl/bio.h b/thirdparty/openssl/openssl/bio.h
index 6790aed28e..8f2438cdad 100644
--- a/thirdparty/openssl/openssl/bio.h
+++ b/thirdparty/openssl/openssl/bio.h
@@ -559,11 +559,11 @@ int BIO_read_filename(BIO *b, const char *name);
# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp)
# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
# define BIO_set_ssl_renegotiate_bytes(b,num) \
- BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
+ BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL)
# define BIO_get_num_renegotiates(b) \
- BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL);
+ BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL)
# define BIO_set_ssl_renegotiate_timeout(b,seconds) \
- BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
+ BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL)
/* defined in evp.h */
/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */
diff --git a/thirdparty/openssl/openssl/bn.h b/thirdparty/openssl/openssl/bn.h
index 86264ae631..633d1b1f60 100644
--- a/thirdparty/openssl/openssl/bn.h
+++ b/thirdparty/openssl/openssl/bn.h
@@ -842,6 +842,8 @@ int RAND_pseudo_bytes(unsigned char *buf, int num);
if (*(ftl--)) break; \
(a)->top = tmp_top; \
} \
+ if ((a)->top == 0) \
+ (a)->neg = 0; \
bn_pollute(a); \
}
diff --git a/thirdparty/openssl/openssl/comp.h b/thirdparty/openssl/openssl/comp.h
index 60a073404e..df599ba331 100644
--- a/thirdparty/openssl/openssl/comp.h
+++ b/thirdparty/openssl/openssl/comp.h
@@ -14,7 +14,7 @@ extern "C" {
typedef struct comp_ctx_st COMP_CTX;
-typedef struct comp_method_st {
+struct comp_method_st {
int type; /* NID for compression library */
const char *name; /* A text string to identify the library */
int (*init) (COMP_CTX *ctx);
@@ -30,7 +30,7 @@ typedef struct comp_method_st {
*/
long (*ctrl) (void);
long (*callback_ctrl) (void);
-} COMP_METHOD;
+};
struct comp_ctx_st {
COMP_METHOD *meth;
diff --git a/thirdparty/openssl/openssl/conf.h b/thirdparty/openssl/openssl/conf.h
index 8d926d5d82..fe49113080 100644
--- a/thirdparty/openssl/openssl/conf.h
+++ b/thirdparty/openssl/openssl/conf.h
@@ -259,6 +259,7 @@ void ERR_load_CONF_strings(void);
# define CONF_R_NO_VALUE 108
# define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
# define CONF_R_UNKNOWN_MODULE_NAME 113
+# define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116
# define CONF_R_VARIABLE_HAS_NO_VALUE 104
#ifdef __cplusplus
diff --git a/thirdparty/openssl/openssl/dh.h b/thirdparty/openssl/openssl/dh.h
index a5bd9016aa..a228c7a7a4 100644
--- a/thirdparty/openssl/openssl/dh.h
+++ b/thirdparty/openssl/openssl/dh.h
@@ -182,12 +182,29 @@ struct dh_st {
*/
# define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME
-# define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \
- (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x))
-# define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \
- (unsigned char *)(x))
-# define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x)
-# define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)
+# define d2i_DHparams_fp(fp,x) \
+ (DH *)ASN1_d2i_fp((char *(*)())DH_new, \
+ (char *(*)())d2i_DHparams, \
+ (fp), \
+ (unsigned char **)(x))
+# define i2d_DHparams_fp(fp,x) \
+ ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x))
+# define d2i_DHparams_bio(bp,x) \
+ ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x)
+# define i2d_DHparams_bio(bp,x) \
+ ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)
+
+# define d2i_DHxparams_fp(fp,x) \
+ (DH *)ASN1_d2i_fp((char *(*)())DH_new, \
+ (char *(*)())d2i_DHxparams, \
+ (fp), \
+ (unsigned char **)(x))
+# define i2d_DHxparams_fp(fp,x) \
+ ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x))
+# define d2i_DHxparams_bio(bp,x) \
+ ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x)
+# define i2d_DHxparams_bio(bp,x) \
+ ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x)
DH *DHparams_dup(DH *);
diff --git a/thirdparty/openssl/openssl/dtls1.h b/thirdparty/openssl/openssl/dtls1.h
index cdd1e4d86e..81d28c29cd 100644
--- a/thirdparty/openssl/openssl/dtls1.h
+++ b/thirdparty/openssl/openssl/dtls1.h
@@ -69,9 +69,6 @@
# ifdef OPENSSL_SYS_WIN32
/* Needed for struct timeval */
# include <winsock.h>
-#ifdef X509_NAME
-#undef X509_NAME
-#endif
# elif defined(OPENSSL_SYS_NETWARE) && !defined(_WINSOCK2API_)
# include <sys/timeval.h>
# else
@@ -81,9 +78,9 @@
# include <sys/time.h>
# endif
# endif
-#ifdef UWP_ENABLED
+#ifdef UWP_ENABLED // -- GODOT start --
#include <winsock2.h>
-#endif
+#endif // -- GODOT end --
#ifdef __cplusplus
extern "C" {
diff --git a/thirdparty/openssl/openssl/err.h b/thirdparty/openssl/openssl/err.h
index 585aa8ba3d..f42365620d 100644
--- a/thirdparty/openssl/openssl/err.h
+++ b/thirdparty/openssl/openssl/err.h
@@ -258,6 +258,7 @@ typedef struct err_state_st {
# define SYS_F_WSASTARTUP 9/* Winsock stuff */
# define SYS_F_OPENDIR 10
# define SYS_F_FREAD 11
+# define SYS_F_FFLUSH 18
/* reasons */
# define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */
diff --git a/thirdparty/openssl/openssl/evp.h b/thirdparty/openssl/openssl/evp.h
index 39ab7937d2..d258ef870a 100644
--- a/thirdparty/openssl/openssl/evp.h
+++ b/thirdparty/openssl/openssl/evp.h
@@ -1370,6 +1370,7 @@ void EVP_add_alg_module(void);
* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
+
void ERR_load_EVP_strings(void);
/* Error codes for the EVP functions. */
@@ -1489,6 +1490,7 @@ void ERR_load_EVP_strings(void);
# define EVP_R_INPUT_NOT_INITIALIZED 111
# define EVP_R_INVALID_DIGEST 152
# define EVP_R_INVALID_FIPS_MODE 168
+# define EVP_R_INVALID_KEY 171
# define EVP_R_INVALID_KEY_LENGTH 130
# define EVP_R_INVALID_OPERATION 148
# define EVP_R_IV_TOO_LARGE 102
@@ -1528,7 +1530,7 @@ void ERR_load_EVP_strings(void);
# define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109
# define EVP_R_WRONG_PUBLIC_KEY_TYPE 110
-#ifdef __cplusplus
+# ifdef __cplusplus
}
-#endif
+# endif
#endif
diff --git a/thirdparty/openssl/openssl/md5.h b/thirdparty/openssl/openssl/md5.h
index 300d3f3463..2659038abd 100644
--- a/thirdparty/openssl/openssl/md5.h
+++ b/thirdparty/openssl/openssl/md5.h
@@ -107,18 +107,11 @@ typedef struct MD5state_st {
# ifdef OPENSSL_FIPS
int private_MD5_Init(MD5_CTX *c);
# endif
-
-//#define MD5_Init _SSL_MD5_Init
-#define MD5_Final _SSL_MD5_Final
-#define MD5_Update _SSL_MD5_Update
-#define MD5_Transform _SSL_MD5_Transform
-#define MD5_Init private_MD5_Init
-
-int _SSL_MD5_Init(MD5_CTX *c);
-int _SSL_MD5_Update(MD5_CTX *c, const void *data, size_t len);
-int _SSL_MD5_Final(unsigned char *md, MD5_CTX *c);
+int MD5_Init(MD5_CTX *c);
+int MD5_Update(MD5_CTX *c, const void *data, size_t len);
+int MD5_Final(unsigned char *md, MD5_CTX *c);
unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
-void _SSL_MD5_Transform(MD5_CTX *c, const unsigned char *b);
+void MD5_Transform(MD5_CTX *c, const unsigned char *b);
#ifdef __cplusplus
}
#endif
diff --git a/thirdparty/openssl/openssl/opensslconf.h b/thirdparty/openssl/openssl/opensslconf.h
index c86bb60b94..19fad23423 100644
--- a/thirdparty/openssl/openssl/opensslconf.h
+++ b/thirdparty/openssl/openssl/opensslconf.h
@@ -1,37 +1,26 @@
/* opensslconf.h */
/* WARNING: Generated automatically from opensslconf.h.in by Configure. */
-//sorry godot needs a single file for multiple builds
-
#ifdef __cplusplus
extern "C" {
#endif
+/* OpenSSL was configured with the following options: */
+#ifndef OPENSSL_DOING_MAKEDEPEND
-// Check windows
-
-#ifdef USE_64BITS
-//weirder platforms that don't use GCC, LLVM or MSVC must define this
-# define OPENSSL_USE_64_BITS
-#elif _WIN32 || _WIN64
-# if _WIN64
-# define OPENSSL_USE_64_BITS
+// -- GODOT start --
+#if defined(OPENSSL_SYS_WINDOWS)
+# define WIN32_LEAN_AND_MEAN
+// Seems like we have troubles properly using the logic in e_os2.h
+# if defined(_WIN32)
+# define OPENSSL_SYS_WIN32
+# define OPENSSL_SYSNAME_WIN32
# endif
-// Check GCC
-#elif __GNUC__
-# if __x86_64__ || __ppc64__
-# define OPENSSL_USE_64_BITS
+# if defined(_WIN64)
+# define OPENSSL_SYS_WIN64
+# define OPENSSL_SYSNAME_WIN64
# endif
#endif
-
-#ifndef OPENSSL_USE_64_BITS
-//wqerw
-#endif
-
-
-
-/* OpenSSL was configured with the following options: */
-#ifndef OPENSSL_DOING_MAKEDEPEND
-
+// -- GODOT end --
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
# define OPENSSL_NO_EC_NISTP_64_GCC_128
@@ -78,9 +67,6 @@ extern "C" {
#endif /* OPENSSL_DOING_MAKEDEPEND */
-#ifndef OPENSSL_THREADS
-# define OPENSSL_THREADS
-#endif
#ifndef OPENSSL_NO_DYNAMIC_ENGINE
# define OPENSSL_NO_DYNAMIC_ENGINE
#endif
@@ -134,8 +120,6 @@ extern "C" {
# endif
#endif
-//#define OPENSSL_CPUID_OBJ
-
/* crypto/opensslconf.h.in */
/* Generate 80386 code? */
@@ -175,19 +159,14 @@ extern "C" {
* - Intel P6 because partial register stalls are very expensive;
* - elder Alpha because it lacks byte load/store instructions;
*/
-#ifdef OPENSSL_USE_64_BITS
#define RC4_INT unsigned int
-#else
-#define RC4_INT unsigned char
-#endif
-
#endif
#if !defined(RC4_CHUNK)
/*
* This enables code handling data aligned at natural CPU word
* boundary. See crypto/rc4/rc4_enc.c for further details.
*/
-#define RC4_CHUNK unsigned long
+#undef RC4_CHUNK
#endif
#endif
@@ -195,42 +174,20 @@ extern "C" {
/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
* %20 speed up (longs are 8 bytes, int's are 4). */
#ifndef DES_LONG
-#define DES_LONG unsigned int
+#define DES_LONG unsigned long
#endif
#endif
#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
#define CONFIG_HEADER_BN_H
-#ifdef OPENSSL_USE_64_BITS
#undef BN_LLONG
-#else
-#define BN_LLONG
-#endif
/* Should we define BN_DIV2W here? */
/* Only one for the following should be defined */
-
-#ifdef OPENSSL_USE_64_BITS
-
-# ifdef _WIN32
-# undef SIXTY_FOUR_BIT_LONG
-# define SIXTY_FOUR_BIT
-# else
-# define SIXTY_FOUR_BIT_LONG
-# undef SIXTY_FOUR_BIT
-# endif
-#undef THIRTY_TWO_BIT
-
-#else
-
#undef SIXTY_FOUR_BIT_LONG
#undef SIXTY_FOUR_BIT
#define THIRTY_TWO_BIT
-
-#endif
-
-
#endif
#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
@@ -272,7 +229,7 @@ extern "C" {
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
* Very mucy CPU dependant */
#ifndef DES_UNROLL
-#define DES_UNROLL
+#undef DES_UNROLL
#endif
/* These default values were supplied by
diff --git a/thirdparty/openssl/openssl/opensslv.h b/thirdparty/openssl/openssl/opensslv.h
index 13fe440231..825a330abc 100644
--- a/thirdparty/openssl/openssl/opensslv.h
+++ b/thirdparty/openssl/openssl/opensslv.h
@@ -30,11 +30,11 @@ extern "C" {
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
* major minor fix final patch/beta)
*/
-# define OPENSSL_VERSION_NUMBER 0x1000208fL
+# define OPENSSL_VERSION_NUMBER 0x100020cfL
# ifdef OPENSSL_FIPS
-# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2h-fips 3 May 2016"
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2l-fips 25 May 2017"
# else
-# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2h 3 May 2016"
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2l 25 May 2017"
# endif
# define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
diff --git a/thirdparty/openssl/openssl/ossl_typ.h b/thirdparty/openssl/openssl/ossl_typ.h
index 9144ea2cf6..364d26238e 100644
--- a/thirdparty/openssl/openssl/ossl_typ.h
+++ b/thirdparty/openssl/openssl/ossl_typ.h
@@ -178,6 +178,8 @@ typedef struct engine_st ENGINE;
typedef struct ssl_st SSL;
typedef struct ssl_ctx_st SSL_CTX;
+typedef struct comp_method_st COMP_METHOD;
+
typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
diff --git a/thirdparty/openssl/openssl/pem.h b/thirdparty/openssl/openssl/pem.h
index d3b23fc997..aac72fb21e 100644
--- a/thirdparty/openssl/openssl/pem.h
+++ b/thirdparty/openssl/openssl/pem.h
@@ -531,6 +531,7 @@ int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,
* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
+
void ERR_load_PEM_strings(void);
/* Error codes for the PEM functions. */
@@ -592,6 +593,7 @@ void ERR_load_PEM_strings(void);
# define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
# define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119
# define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120
+# define PEM_R_HEADER_TOO_LONG 128
# define PEM_R_INCONSISTENT_HEADER 121
# define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122
# define PEM_R_KEYBLOB_TOO_SHORT 123
@@ -609,7 +611,7 @@ void ERR_load_PEM_strings(void);
# define PEM_R_UNSUPPORTED_ENCRYPTION 114
# define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126
-#ifdef __cplusplus
+# ifdef __cplusplus
}
-#endif
+# endif
#endif
diff --git a/thirdparty/openssl/openssl/pkcs12.h b/thirdparty/openssl/openssl/pkcs12.h
index a39adf5eb5..21f1f62b36 100644
--- a/thirdparty/openssl/openssl/pkcs12.h
+++ b/thirdparty/openssl/openssl/pkcs12.h
@@ -270,7 +270,7 @@ int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12);
int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12);
PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
-int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
+int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass);
/* BEGIN ERROR CODES */
/*
diff --git a/thirdparty/openssl/openssl/rand.h b/thirdparty/openssl/openssl/rand.h
index 66068834eb..2553afda20 100644
--- a/thirdparty/openssl/openssl/rand.h
+++ b/thirdparty/openssl/openssl/rand.h
@@ -64,23 +64,7 @@
# include <openssl/e_os2.h>
# if defined(OPENSSL_SYS_WINDOWS)
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#ifdef OCSP_RESPONSE
-#undef OCSP_RESPONSE
-#endif
-#ifdef OCSP_REQUEST
-#undef OCSP_REQUEST
-#endif
-#ifdef X509_NAME
-#undef X509_NAME
-#undef X509_NAME
-#undef X509_EXTENSIONS
-#undef X509_CERT_PAIR
-#undef PKCS7_ISSUER_AND_SERIAL
-#endif
-
-
+# include <windows.h>
# endif
#ifdef __cplusplus
diff --git a/thirdparty/openssl/openssl/ssl.h b/thirdparty/openssl/openssl/ssl.h
index 5ef56faa50..90aeb0ce4e 100644
--- a/thirdparty/openssl/openssl/ssl.h
+++ b/thirdparty/openssl/openssl/ssl.h
@@ -2532,7 +2532,6 @@ void SSL_set_tmp_ecdh_callback(SSL *ssl,
int keylength));
# endif
-# ifndef OPENSSL_NO_COMP
const COMP_METHOD *SSL_get_current_compression(SSL *s);
const COMP_METHOD *SSL_get_current_expansion(SSL *s);
const char *SSL_COMP_get_name(const COMP_METHOD *comp);
@@ -2541,13 +2540,6 @@ STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)
*meths);
void SSL_COMP_free_compression_methods(void);
int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
-# else
-const void *SSL_get_current_compression(SSL *s);
-const void *SSL_get_current_expansion(SSL *s);
-const char *SSL_COMP_get_name(const void *comp);
-void *SSL_COMP_get_compression_methods(void);
-int SSL_COMP_add_compression_method(int id, void *cm);
-# endif
const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr);
@@ -2623,6 +2615,7 @@ void ERR_load_SSL_strings(void);
# define SSL_F_DTLS1_HEARTBEAT 305
# define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255
# define SSL_F_DTLS1_PREPROCESS_FRAGMENT 288
+# define SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS 424
# define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256
# define SSL_F_DTLS1_PROCESS_RECORD 257
# define SSL_F_DTLS1_READ_BYTES 258
@@ -3114,6 +3107,7 @@ void ERR_load_SSL_strings(void);
# define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157
# define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233
# define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234
+# define SSL_R_TOO_MANY_WARN_ALERTS 409
# define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235
# define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236
# define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 313
diff --git a/thirdparty/openssl/openssl/ts.h b/thirdparty/openssl/openssl/ts.h
index 16eccbb38d..2daa1b2fb5 100644
--- a/thirdparty/openssl/openssl/ts.h
+++ b/thirdparty/openssl/openssl/ts.h
@@ -565,6 +565,9 @@ int TS_RESP_CTX_set_clock_precision_digits(TS_RESP_CTX *ctx,
/* At most we accept usec precision. */
# define TS_MAX_CLOCK_PRECISION_DIGITS 6
+/* Maximum status message length */
+# define TS_MAX_STATUS_LENGTH (1024 * 1024)
+
/* No flags are set by default. */
void TS_RESP_CTX_add_flags(TS_RESP_CTX *ctx, int flags);
diff --git a/thirdparty/openssl/openssl/x509.h b/thirdparty/openssl/openssl/x509.h
index fc613ce635..6fa28ebada 100644
--- a/thirdparty/openssl/openssl/x509.h
+++ b/thirdparty/openssl/openssl/x509.h
@@ -1234,6 +1234,7 @@ int X509_TRUST_get_trust(X509_TRUST *xp);
* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
+
void ERR_load_X509_strings(void);
/* Error codes for the X509 functions. */
@@ -1241,6 +1242,7 @@ void ERR_load_X509_strings(void);
/* Function codes. */
# define X509_F_ADD_CERT_DIR 100
# define X509_F_BY_FILE_CTRL 101
+# define X509_F_CHECK_NAME_CONSTRAINTS 106
# define X509_F_CHECK_POLICY 145
# define X509_F_DIR_CTRL 102
# define X509_F_GET_CERT_BY_SUBJECT 103
@@ -1322,7 +1324,7 @@ void ERR_load_X509_strings(void);
# define X509_R_WRONG_LOOKUP_TYPE 112
# define X509_R_WRONG_TYPE 122
-#ifdef __cplusplus
+# ifdef __cplusplus
}
-#endif
+# endif
#endif
diff --git a/thirdparty/openssl/openssl/x509_vfy.h b/thirdparty/openssl/openssl/x509_vfy.h
index 2663e1c0a3..50626826e0 100644
--- a/thirdparty/openssl/openssl/x509_vfy.h
+++ b/thirdparty/openssl/openssl/x509_vfy.h
@@ -368,6 +368,7 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
# define X509_V_ERR_PERMITTED_VIOLATION 47
# define X509_V_ERR_EXCLUDED_VIOLATION 48
# define X509_V_ERR_SUBTREE_MINMAX 49
+# define X509_V_ERR_APPLICATION_VERIFICATION 50
# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51
# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52
# define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53
@@ -386,8 +387,12 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
# define X509_V_ERR_EMAIL_MISMATCH 63
# define X509_V_ERR_IP_ADDRESS_MISMATCH 64
-/* The application is not happy */
-# define X509_V_ERR_APPLICATION_VERIFICATION 50
+/* Caller error */
+# define X509_V_ERR_INVALID_CALL 65
+/* Issuer lookup error */
+# define X509_V_ERR_STORE_LOOKUP 66
+
+# define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 67
/* Certificate verify flags */
diff --git a/thirdparty/openssl/patches/config_windows.patch b/thirdparty/openssl/patches/config_windows.patch
new file mode 100644
index 0000000000..e69ff1356a
--- /dev/null
+++ b/thirdparty/openssl/patches/config_windows.patch
@@ -0,0 +1,49 @@
+commit 4c8ab8b4415d129d0283d7d0d9a5789163ec8d5e
+Author: Rémi Verschelde <rverschelde@gmail.com>
+Date: Sat May 27 16:38:46 2017 +0200
+
+ openssl: Define WIN32_LEAN_AND_MEAN on Windows
+
+ This avoids namespace collisions with things such as X509_NAME.
+ Also force include of necessary definitions in `crypto/o_str.c`
+ which seem missing on MSVC (but work on MinGW).
+
+diff --git a/thirdparty/openssl/crypto/o_str.c b/thirdparty/openssl/crypto/o_str.c
+index 7e61cde85..1854798e2 100644
+--- a/thirdparty/openssl/crypto/o_str.c
++++ b/thirdparty/openssl/crypto/o_str.c
+@@ -59,6 +59,9 @@
+
+ #include <ctype.h>
+ #include <e_os.h>
++// -- GODOT start --
++#include <openssl/opensslconf.h>
++// -- GODOT end --
+ #include "o_str.h"
+
+ #if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && \
+diff --git a/thirdparty/openssl/openssl/opensslconf.h b/thirdparty/openssl/openssl/opensslconf.h
+index f533508b1..19fad2342 100644
+--- a/thirdparty/openssl/openssl/opensslconf.h
++++ b/thirdparty/openssl/openssl/opensslconf.h
+@@ -7,6 +7,20 @@ extern "C" {
+ /* OpenSSL was configured with the following options: */
+ #ifndef OPENSSL_DOING_MAKEDEPEND
+
++// -- GODOT start --
++#if defined(OPENSSL_SYS_WINDOWS)
++# define WIN32_LEAN_AND_MEAN
++// Seems like we have troubles properly using the logic in e_os2.h
++# if defined(_WIN32)
++# define OPENSSL_SYS_WIN32
++# define OPENSSL_SYSNAME_WIN32
++# endif
++# if defined(_WIN64)
++# define OPENSSL_SYS_WIN64
++# define OPENSSL_SYSNAME_WIN64
++# endif
++#endif
++// -- GODOT end --
+
+ #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
+ # define OPENSSL_NO_EC_NISTP_64_GCC_128
diff --git a/thirdparty/openssl/uwp_fix.patch b/thirdparty/openssl/patches/uwp_fix.patch
index 00d8b64d00..54aeb1f80d 100644
--- a/thirdparty/openssl/uwp_fix.patch
+++ b/thirdparty/openssl/patches/uwp_fix.patch
@@ -1,15 +1,15 @@
-diff --git a/drivers/builtin_openssl2/crypto/rand/rand_win.c b/drivers/builtin_openssl2/crypto/rand/rand_win.c
-index 06670ae..70fd52a 100644
---- a/drivers/builtin_openssl2/crypto/rand/rand_win.c
-+++ b/drivers/builtin_openssl2/crypto/rand/rand_win.c
+diff --git a/thirdparty/openssl/crypto/rand/rand_win.c b/thirdparty/openssl/crypto/rand/rand_win.c
+index 06670ae01..cb4093128 100644
+--- a/thirdparty/openssl/crypto/rand/rand_win.c
++++ b/thirdparty/openssl/crypto/rand/rand_win.c
@@ -118,8 +118,10 @@
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0400
# endif
-+#ifndef UWP_ENABLED
++#ifndef UWP_ENABLED // -- GODOT --
# include <wincrypt.h>
# include <tlhelp32.h>
-+#endif
++#endif // -- GODOT --
/*
* Limit the time spent walking through the heap, processes, threads and
@@ -18,7 +18,7 @@ index 06670ae..70fd52a 100644
# endif /* CURSOR_SHOWING */
-# if !defined(OPENSSL_SYS_WINCE)
-+# if !defined(OPENSSL_SYS_WINCE) && !defined(UWP_ENABLED)
++# if !defined(OPENSSL_SYS_WINCE) && !defined(UWP_ENABLED) // -- GODOT --
typedef BOOL(WINAPI *CRYPTACQUIRECONTEXTW) (HCRYPTPROV *, LPCWSTR, LPCWSTR,
DWORD, DWORD);
typedef BOOL(WINAPI *CRYPTGENRANDOM) (HCRYPTPROV, DWORD, BYTE *);
@@ -26,7 +26,7 @@ index 06670ae..70fd52a 100644
# endif /* 1 */
# endif /* !OPENSSL_SYS_WINCE */
-+#if !defined(UWP_ENABLED)
++#if !defined(UWP_ENABLED) // -- GODOT --
int RAND_poll(void)
{
MEMORYSTATUS m;
@@ -34,7 +34,7 @@ index 06670ae..70fd52a 100644
return (1);
}
-+#endif // UWP_ENABLED
++#endif // UWP_ENABLED // -- GODOT --
+
int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam)
{
@@ -44,21 +44,21 @@ index 06670ae..70fd52a 100644
static void readscreen(void)
{
-# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN)
-+# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN) && !defined(UWP_ENABLED)
++# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN) && !defined(UWP_ENABLED) // -- GODOT --
HDC hScrDC; /* screen DC */
HBITMAP hBitmap; /* handle for our bitmap */
BITMAP bm; /* bitmap properties */
-diff --git a/drivers/builtin_openssl2/openssl/dtls1.h b/drivers/builtin_openssl2/openssl/dtls1.h
-index 64ad3c8..a58aca2 100644
---- a/drivers/builtin_openssl2/openssl/dtls1.h
-+++ b/drivers/builtin_openssl2/openssl/dtls1.h
-@@ -81,6 +81,9 @@
+diff --git a/thirdparty/openssl/openssl/dtls1.h b/thirdparty/openssl/openssl/dtls1.h
+index 30bbcf278..81d28c29c 100644
+--- a/thirdparty/openssl/openssl/dtls1.h
++++ b/thirdparty/openssl/openssl/dtls1.h
+@@ -78,6 +78,9 @@
# include <sys/time.h>
# endif
# endif
-+#ifdef UWP_ENABLED
++#ifdef UWP_ENABLED // -- GODOT start --
+#include <winsock2.h>
-+#endif
++#endif // -- GODOT end --
#ifdef __cplusplus
extern "C" {
diff --git a/thirdparty/openssl/ssl/d1_both.c b/thirdparty/openssl/ssl/d1_both.c
index 5d26c94926..e6bc761e8b 100644
--- a/thirdparty/openssl/ssl/d1_both.c
+++ b/thirdparty/openssl/ssl/d1_both.c
@@ -517,6 +517,17 @@ long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
return i;
}
+ /*
+ * Don't change the *message* read sequence number while listening. For
+ * the *record* write sequence we reflect the ClientHello sequence number
+ * when listening.
+ */
+ if (s->d1->listen)
+ memcpy(s->s3->write_sequence, s->s3->read_sequence,
+ sizeof(s->s3->write_sequence));
+ else
+ s->d1->handshake_read_seq++;
+
if (mt >= 0 && s->s3->tmp.message_type != mt) {
al = SSL_AD_UNEXPECTED_MESSAGE;
SSLerr(SSL_F_DTLS1_GET_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
@@ -544,10 +555,6 @@ long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
memset(msg_hdr, 0x00, sizeof(struct hm_header_st));
- /* Don't change sequence numbers while listening */
- if (!s->d1->listen)
- s->d1->handshake_read_seq++;
-
s->init_msg = s->init_buf->data + DTLS1_HM_HEADER_LENGTH;
return s->init_num;
@@ -581,9 +588,12 @@ static int dtls1_preprocess_fragment(SSL *s, struct hm_header_st *msg_hdr,
/*
* msg_len is limited to 2^24, but is effectively checked against max
* above
+ *
+ * Make buffer slightly larger than message length as a precaution
+ * against small OOB reads e.g. CVE-2016-6306
*/
if (!BUF_MEM_grow_clean
- (s->init_buf, msg_len + DTLS1_HM_HEADER_LENGTH)) {
+ (s->init_buf, msg_len + DTLS1_HM_HEADER_LENGTH + 16)) {
SSLerr(SSL_F_DTLS1_PREPROCESS_FRAGMENT, ERR_R_BUF_LIB);
return SSL_AD_INTERNAL_ERROR;
}
@@ -618,11 +628,23 @@ static int dtls1_retrieve_buffered_fragment(SSL *s, long max, int *ok)
int al;
*ok = 0;
- item = pqueue_peek(s->d1->buffered_messages);
- if (item == NULL)
- return 0;
+ do {
+ item = pqueue_peek(s->d1->buffered_messages);
+ if (item == NULL)
+ return 0;
+
+ frag = (hm_fragment *)item->data;
+
+ if (frag->msg_header.seq < s->d1->handshake_read_seq) {
+ /* This is a stale message that has been buffered so clear it */
+ pqueue_pop(s->d1->buffered_messages);
+ dtls1_hm_fragment_free(frag);
+ pitem_free(item);
+ item = NULL;
+ frag = NULL;
+ }
+ } while (item == NULL);
- frag = (hm_fragment *)item->data;
/* Don't return if reassembly still in progress */
if (frag->reassembly != NULL)
@@ -1053,7 +1075,9 @@ int dtls1_send_change_cipher_spec(SSL *s, int a, int b)
int dtls1_read_failed(SSL *s, int code)
{
if (code > 0) {
+#ifdef TLS_DEBUG
fprintf(stderr, "invalid state reached %s:%d", __FILE__, __LINE__);
+#endif
return 1;
}
@@ -1125,7 +1149,9 @@ int dtls1_retransmit_buffered_messages(SSL *s)
(frag->msg_header.seq,
frag->msg_header.is_ccs), 0,
&found) <= 0 && found) {
+#ifdef TLS_DEBUG
fprintf(stderr, "dtls1_retransmit_message() failed\n");
+#endif
return -1;
}
}
@@ -1211,7 +1237,7 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off,
unsigned long header_length;
unsigned char seq64be[8];
struct dtls1_retransmit_state saved_state;
- unsigned char save_write_sequence[8];
+ unsigned char save_write_sequence[8] = {0, 0, 0, 0, 0, 0, 0, 0};
/*-
OPENSSL_assert(s->init_num == 0);
@@ -1225,7 +1251,9 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off,
item = pqueue_find(s->d1->sent_messages, seq64be);
if (item == NULL) {
+#ifdef TLS_DEBUG
fprintf(stderr, "retransmit: message %d non-existant\n", seq);
+#endif
*found = 0;
return 0;
}
@@ -1296,18 +1324,6 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off,
return ret;
}
-/* call this function when the buffered messages are no longer needed */
-void dtls1_clear_record_buffer(SSL *s)
-{
- pitem *item;
-
- for (item = pqueue_pop(s->d1->sent_messages);
- item != NULL; item = pqueue_pop(s->d1->sent_messages)) {
- dtls1_hm_fragment_free((hm_fragment *)item->data);
- pitem_free(item);
- }
-}
-
unsigned char *dtls1_set_message_header(SSL *s, unsigned char *p,
unsigned char mt, unsigned long len,
unsigned long frag_off,
@@ -1469,7 +1485,7 @@ int dtls1_process_heartbeat(SSL *s)
memcpy(bp, pl, payload);
bp += payload;
/* Random padding */
- if (RAND_pseudo_bytes(bp, padding) < 0) {
+ if (RAND_bytes(bp, padding) <= 0) {
OPENSSL_free(buffer);
return -1;
}
@@ -1546,6 +1562,8 @@ int dtls1_heartbeat(SSL *s)
* - Padding
*/
buf = OPENSSL_malloc(1 + 2 + payload + padding);
+ if (buf == NULL)
+ goto err;
p = buf;
/* Message Type */
*p++ = TLS1_HB_REQUEST;
@@ -1554,11 +1572,11 @@ int dtls1_heartbeat(SSL *s)
/* Sequence number */
s2n(s->tlsext_hb_seq, p);
/* 16 random bytes */
- if (RAND_pseudo_bytes(p, 16) < 0)
+ if (RAND_bytes(p, 16) <= 0)
goto err;
p += 16;
/* Random padding */
- if (RAND_pseudo_bytes(p, padding) < 0)
+ if (RAND_bytes(p, padding) <= 0)
goto err;
ret = dtls1_write_bytes(s, TLS1_RT_HEARTBEAT, buf, 3 + payload + padding);
diff --git a/thirdparty/openssl/ssl/d1_clnt.c b/thirdparty/openssl/ssl/d1_clnt.c
index 3ddfa7bca4..76451a346d 100644
--- a/thirdparty/openssl/ssl/d1_clnt.c
+++ b/thirdparty/openssl/ssl/d1_clnt.c
@@ -320,8 +320,13 @@ int dtls1_connect(SSL *s)
s->shutdown = 0;
/* every DTLS ClientHello resets Finished MAC */
- ssl3_init_finished_mac(s);
+ if (!ssl3_init_finished_mac(s)) {
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
+ }
+ /* fall thru */
case SSL3_ST_CW_CLNT_HELLO_B:
dtls1_start_timer(s);
ret = ssl3_client_hello(s);
@@ -769,6 +774,7 @@ int dtls1_connect(SSL *s)
/* done with handshaking */
s->d1->handshake_read_seq = 0;
s->d1->next_handshake_write_seq = 0;
+ dtls1_clear_received_buffer(s);
goto end;
/* break; */
diff --git a/thirdparty/openssl/ssl/d1_lib.c b/thirdparty/openssl/ssl/d1_lib.c
index ee78921ba8..debd4fd5dc 100644
--- a/thirdparty/openssl/ssl/d1_lib.c
+++ b/thirdparty/openssl/ssl/d1_lib.c
@@ -170,7 +170,6 @@ int dtls1_new(SSL *s)
static void dtls1_clear_queues(SSL *s)
{
pitem *item = NULL;
- hm_fragment *frag = NULL;
DTLS1_RECORD_DATA *rdata;
while ((item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL) {
@@ -191,28 +190,44 @@ static void dtls1_clear_queues(SSL *s)
pitem_free(item);
}
+ while ((item = pqueue_pop(s->d1->buffered_app_data.q)) != NULL) {
+ rdata = (DTLS1_RECORD_DATA *)item->data;
+ if (rdata->rbuf.buf) {
+ OPENSSL_free(rdata->rbuf.buf);
+ }
+ OPENSSL_free(item->data);
+ pitem_free(item);
+ }
+
+ dtls1_clear_received_buffer(s);
+ dtls1_clear_sent_buffer(s);
+}
+
+void dtls1_clear_received_buffer(SSL *s)
+{
+ pitem *item = NULL;
+ hm_fragment *frag = NULL;
+
while ((item = pqueue_pop(s->d1->buffered_messages)) != NULL) {
frag = (hm_fragment *)item->data;
dtls1_hm_fragment_free(frag);
pitem_free(item);
}
+}
+
+void dtls1_clear_sent_buffer(SSL *s)
+{
+ pitem *item = NULL;
+ hm_fragment *frag = NULL;
while ((item = pqueue_pop(s->d1->sent_messages)) != NULL) {
frag = (hm_fragment *)item->data;
dtls1_hm_fragment_free(frag);
pitem_free(item);
}
-
- while ((item = pqueue_pop(s->d1->buffered_app_data.q)) != NULL) {
- rdata = (DTLS1_RECORD_DATA *)item->data;
- if (rdata->rbuf.buf) {
- OPENSSL_free(rdata->rbuf.buf);
- }
- OPENSSL_free(item->data);
- pitem_free(item);
- }
}
+
void dtls1_free(SSL *s)
{
ssl3_free(s);
@@ -456,7 +471,7 @@ void dtls1_stop_timer(SSL *s)
BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0,
&(s->d1->next_timeout));
/* Clear retransmission buffer */
- dtls1_clear_record_buffer(s);
+ dtls1_clear_sent_buffer(s);
}
int dtls1_check_timeout_num(SSL *s)
diff --git a/thirdparty/openssl/ssl/d1_pkt.c b/thirdparty/openssl/ssl/d1_pkt.c
index fe30ec7d00..10586fee54 100644
--- a/thirdparty/openssl/ssl/d1_pkt.c
+++ b/thirdparty/openssl/ssl/d1_pkt.c
@@ -125,7 +125,7 @@
/* mod 128 saturating subtract of two 64-bit values in big-endian order */
static int satsub64be(const unsigned char *v1, const unsigned char *v2)
{
- int ret, sat, brw, i;
+ int ret, i;
if (sizeof(long) == 8)
do {
@@ -157,28 +157,51 @@ static int satsub64be(const unsigned char *v1, const unsigned char *v2)
return (int)l;
} while (0);
- ret = (int)v1[7] - (int)v2[7];
- sat = 0;
- brw = ret >> 8; /* brw is either 0 or -1 */
- if (ret & 0x80) {
- for (i = 6; i >= 0; i--) {
- brw += (int)v1[i] - (int)v2[i];
- sat |= ~brw;
- brw >>= 8;
- }
- } else {
- for (i = 6; i >= 0; i--) {
- brw += (int)v1[i] - (int)v2[i];
- sat |= brw;
- brw >>= 8;
+ ret = 0;
+ for (i=0; i<7; i++) {
+ if (v1[i] > v2[i]) {
+ /* v1 is larger... but by how much? */
+ if (v1[i] != v2[i] + 1)
+ return 128;
+ while (++i <= 6) {
+ if (v1[i] != 0x00 || v2[i] != 0xff)
+ return 128; /* too much */
+ }
+ /* We checked all the way to the penultimate byte,
+ * so despite higher bytes changing we actually
+ * know that it only changed from (e.g.)
+ * ... (xx) ff ff ff ??
+ * to ... (xx+1) 00 00 00 ??
+ * so we add a 'bias' of 256 for the carry that
+ * happened, and will eventually return
+ * 256 + v1[7] - v2[7]. */
+ ret = 256;
+ break;
+ } else if (v2[i] > v1[i]) {
+ /* v2 is larger... but by how much? */
+ if (v2[i] != v1[i] + 1)
+ return -128;
+ while (++i <= 6) {
+ if (v2[i] != 0x00 || v1[i] != 0xff)
+ return -128; /* too much */
+ }
+ /* Similar to the case above, we know it changed
+ * from ... (xx) 00 00 00 ??
+ * to ... (xx-1) ff ff ff ??
+ * so we add a 'bias' of -256 for the borrow,
+ * to return -256 + v1[7] - v2[7]. */
+ ret = -256;
}
}
- brw <<= 8; /* brw is either 0 or -256 */
- if (sat & 0xff)
- return brw | 0x80;
+ ret += (int)v1[7] - (int)v2[7];
+
+ if (ret > 128)
+ return 128;
+ else if (ret < -128)
+ return -128;
else
- return brw + (ret & 0xFF);
+ return ret;
}
static int have_handshake_fragment(SSL *s, int type, unsigned char *buf,
@@ -194,7 +217,7 @@ static int dtls1_record_needs_buffering(SSL *s, SSL3_RECORD *rr,
#endif
static int dtls1_buffer_record(SSL *s, record_pqueue *q,
unsigned char *priority);
-static int dtls1_process_record(SSL *s);
+static int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap);
/* copy buffered record into SSL structure */
static int dtls1_copy_record(SSL *s, pitem *item)
@@ -319,21 +342,70 @@ static int dtls1_retrieve_buffered_record(SSL *s, record_pqueue *queue)
static int dtls1_process_buffered_records(SSL *s)
{
pitem *item;
+ SSL3_BUFFER *rb;
+ SSL3_RECORD *rr;
+ DTLS1_BITMAP *bitmap;
+ unsigned int is_next_epoch;
+ int replayok = 1;
item = pqueue_peek(s->d1->unprocessed_rcds.q);
if (item) {
/* Check if epoch is current. */
if (s->d1->unprocessed_rcds.epoch != s->d1->r_epoch)
- return (1); /* Nothing to do. */
+ return 1; /* Nothing to do. */
+
+ rr = &s->s3->rrec;
+ rb = &s->s3->rbuf;
+
+ if (rb->left > 0) {
+ /*
+ * We've still got data from the current packet to read. There could
+ * be a record from the new epoch in it - so don't overwrite it
+ * with the unprocessed records yet (we'll do it when we've
+ * finished reading the current packet).
+ */
+ return 1;
+ }
+
/* Process all the records. */
while (pqueue_peek(s->d1->unprocessed_rcds.q)) {
dtls1_get_unprocessed_record(s);
- if (!dtls1_process_record(s))
- return (0);
+ bitmap = dtls1_get_bitmap(s, rr, &is_next_epoch);
+ if (bitmap == NULL) {
+ /*
+ * Should not happen. This will only ever be NULL when the
+ * current record is from a different epoch. But that cannot
+ * be the case because we already checked the epoch above
+ */
+ SSLerr(SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS,
+ ERR_R_INTERNAL_ERROR);
+ return 0;
+ }
+#ifndef OPENSSL_NO_SCTP
+ /* Only do replay check if no SCTP bio */
+ if (!BIO_dgram_is_sctp(SSL_get_rbio(s)))
+#endif
+ {
+ /*
+ * Check whether this is a repeat, or aged record. We did this
+ * check once already when we first received the record - but
+ * we might have updated the window since then due to
+ * records we subsequently processed.
+ */
+ replayok = dtls1_record_replay_check(s, bitmap);
+ }
+
+ if (!replayok || !dtls1_process_record(s, bitmap)) {
+ /* dump this record */
+ rr->length = 0;
+ s->packet_length = 0;
+ continue;
+ }
+
if (dtls1_buffer_record(s, &(s->d1->processed_rcds),
s->s3->rrec.seq_num) < 0)
- return -1;
+ return 0;
}
}
@@ -344,7 +416,7 @@ static int dtls1_process_buffered_records(SSL *s)
s->d1->processed_rcds.epoch = s->d1->r_epoch;
s->d1->unprocessed_rcds.epoch = s->d1->r_epoch + 1;
- return (1);
+ return 1;
}
#if 0
@@ -391,7 +463,7 @@ static int dtls1_get_buffered_record(SSL *s)
#endif
-static int dtls1_process_record(SSL *s)
+static int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap)
{
int i, al;
int enc_err;
@@ -551,6 +623,10 @@ static int dtls1_process_record(SSL *s)
/* we have pulled in a full packet so zero things */
s->packet_length = 0;
+
+ /* Mark receipt of record. */
+ dtls1_record_bitmap_update(s, bitmap);
+
return (1);
f_err:
@@ -581,11 +657,12 @@ int dtls1_get_record(SSL *s)
rr = &(s->s3->rrec);
+ again:
/*
* The epoch may have changed. If so, process all the pending records.
* This is a non-blocking operation.
*/
- if (dtls1_process_buffered_records(s) < 0)
+ if (!dtls1_process_buffered_records(s))
return -1;
/* if we're renegotiating, then there may be buffered records */
@@ -593,7 +670,6 @@ int dtls1_get_record(SSL *s)
return 1;
/* get something from the wire */
- again:
/* check if we have the header */
if ((s->rstate != SSL_ST_READ_BODY) ||
(s->packet_length < DTLS1_RT_HEADER_LENGTH)) {
@@ -721,20 +797,17 @@ int dtls1_get_record(SSL *s)
if (dtls1_buffer_record
(s, &(s->d1->unprocessed_rcds), rr->seq_num) < 0)
return -1;
- /* Mark receipt of record. */
- dtls1_record_bitmap_update(s, bitmap);
}
rr->length = 0;
s->packet_length = 0;
goto again;
}
- if (!dtls1_process_record(s)) {
+ if (!dtls1_process_record(s, bitmap)) {
rr->length = 0;
s->packet_length = 0; /* dump this record */
goto again; /* get another record */
}
- dtls1_record_bitmap_update(s, bitmap); /* Mark receipt of record. */
return (1);
@@ -878,6 +951,13 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
goto start;
}
+ /*
+ * Reset the count of consecutive warning alerts if we've got a non-empty
+ * record that isn't an alert.
+ */
+ if (rr->type != SSL3_RT_ALERT && rr->length != 0)
+ s->cert->alert_count = 0;
+
/* we now have a packet which can be read and processed */
if (s->s3->change_cipher_spec /* set when we receive ChangeCipherSpec,
@@ -1144,6 +1224,14 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
if (alert_level == SSL3_AL_WARNING) {
s->s3->warn_alert = alert_descr;
+
+ s->cert->alert_count++;
+ if (s->cert->alert_count == MAX_WARN_ALERT_COUNT) {
+ al = SSL_AD_UNEXPECTED_MESSAGE;
+ SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_TOO_MANY_WARN_ALERTS);
+ goto f_err;
+ }
+
if (alert_descr == SSL_AD_CLOSE_NOTIFY) {
#ifndef OPENSSL_NO_SCTP
/*
@@ -1201,7 +1289,7 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
BIO_snprintf(tmp, sizeof tmp, "%d", alert_descr);
ERR_add_error_data(2, "SSL alert number ", tmp);
s->shutdown |= SSL_RECEIVED_SHUTDOWN;
- SSL_CTX_remove_session(s->ctx, s->session);
+ SSL_CTX_remove_session(s->session_ctx, s->session);
return (0);
} else {
al = SSL_AD_ILLEGAL_PARAMETER;
@@ -1235,9 +1323,9 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
/* XDTLS: check that epoch is consistent */
if ((rr->length != ccs_hdr_len) ||
(rr->off != 0) || (rr->data[0] != SSL3_MT_CCS)) {
- i = SSL_AD_ILLEGAL_PARAMETER;
+ al = SSL_AD_ILLEGAL_PARAMETER;
SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_BAD_CHANGE_CIPHER_SPEC);
- goto err;
+ goto f_err;
}
rr->length = 0;
@@ -1830,8 +1918,13 @@ static DTLS1_BITMAP *dtls1_get_bitmap(SSL *s, SSL3_RECORD *rr,
if (rr->epoch == s->d1->r_epoch)
return &s->d1->bitmap;
- /* Only HM and ALERT messages can be from the next epoch */
+ /*
+ * Only HM and ALERT messages can be from the next epoch and only if we
+ * have already processed all of the unprocessed records from the last
+ * epoch
+ */
else if (rr->epoch == (unsigned long)(s->d1->r_epoch + 1) &&
+ s->d1->unprocessed_rcds.epoch != s->d1->r_epoch &&
(rr->type == SSL3_RT_HANDSHAKE || rr->type == SSL3_RT_ALERT)) {
*is_next_epoch = 1;
return &s->d1->next_bitmap;
@@ -1910,6 +2003,12 @@ void dtls1_reset_seq_numbers(SSL *s, int rw)
s->d1->r_epoch++;
memcpy(&(s->d1->bitmap), &(s->d1->next_bitmap), sizeof(DTLS1_BITMAP));
memset(&(s->d1->next_bitmap), 0x00, sizeof(DTLS1_BITMAP));
+
+ /*
+ * We must not use any buffered messages received from the previous
+ * epoch
+ */
+ dtls1_clear_received_buffer(s);
} else {
seq = s->s3->write_sequence;
memcpy(s->d1->last_write_sequence, seq,
diff --git a/thirdparty/openssl/ssl/d1_srvr.c b/thirdparty/openssl/ssl/d1_srvr.c
index e677d880f0..8502b242e5 100644
--- a/thirdparty/openssl/ssl/d1_srvr.c
+++ b/thirdparty/openssl/ssl/d1_srvr.c
@@ -282,7 +282,12 @@ int dtls1_accept(SSL *s)
goto end;
}
- ssl3_init_finished_mac(s);
+ if (!ssl3_init_finished_mac(s)) {
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
+ }
+
s->state = SSL3_ST_SR_CLNT_HELLO_A;
s->ctx->stats.sess_accept++;
} else if (!s->s3->send_connection_binding &&
@@ -313,7 +318,7 @@ int dtls1_accept(SSL *s)
case SSL3_ST_SW_HELLO_REQ_B:
s->shutdown = 0;
- dtls1_clear_record_buffer(s);
+ dtls1_clear_sent_buffer(s);
dtls1_start_timer(s);
ret = ssl3_send_hello_request(s);
if (ret <= 0)
@@ -322,7 +327,11 @@ int dtls1_accept(SSL *s)
s->state = SSL3_ST_SW_FLUSH;
s->init_num = 0;
- ssl3_init_finished_mac(s);
+ if (!ssl3_init_finished_mac(s)) {
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
+ }
break;
case SSL3_ST_SW_HELLO_REQ_C:
@@ -346,15 +355,6 @@ int dtls1_accept(SSL *s)
s->init_num = 0;
- /*
- * Reflect ClientHello sequence to remain stateless while
- * listening
- */
- if (listen) {
- memcpy(s->s3->write_sequence, s->s3->read_sequence,
- sizeof(s->s3->write_sequence));
- }
-
/* If we're just listening, stop here */
if (listen && s->state == SSL3_ST_SW_SRVR_HELLO_A) {
ret = 2;
@@ -381,7 +381,11 @@ int dtls1_accept(SSL *s)
/* HelloVerifyRequest resets Finished MAC */
if (s->version != DTLS1_BAD_VER)
- ssl3_init_finished_mac(s);
+ if (!ssl3_init_finished_mac(s)) {
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
+ }
break;
#ifndef OPENSSL_NO_SCTP
@@ -894,6 +898,7 @@ int dtls1_accept(SSL *s)
/* next message is server hello */
s->d1->handshake_write_seq = 0;
s->d1->next_handshake_write_seq = 0;
+ dtls1_clear_received_buffer(s);
goto end;
/* break; */
diff --git a/thirdparty/openssl/ssl/install-ssl.com b/thirdparty/openssl/ssl/install-ssl.com
deleted file mode 100755
index afe6967f85..0000000000
--- a/thirdparty/openssl/ssl/install-ssl.com
+++ /dev/null
@@ -1,136 +0,0 @@
-$! INSTALL-SSL.COM -- Installs the files in a given directory tree
-$!
-$! Author: Richard Levitte <richard@levitte.org>
-$! Time of creation: 22-MAY-1998 10:13
-$!
-$! P1 root of the directory tree
-$! P2 "64" for 64-bit pointers.
-$!
-$!
-$! Announce/identify.
-$!
-$ proc = f$environment( "procedure")
-$ write sys$output "@@@ "+ -
- f$parse( proc, , , "name")+ f$parse( proc, , , "type")
-$!
-$ on error then goto tidy
-$ on control_c then goto tidy
-$!
-$ if p1 .eqs. ""
-$ then
-$ write sys$output "First argument missing."
-$ write sys$output -
- "It should be the directory where you want things installed."
-$ exit
-$ endif
-$!
-$ if (f$getsyi( "cpu") .lt. 128)
-$ then
-$ arch = "VAX"
-$ else
-$ arch = f$edit( f$getsyi( "arch_name"), "upcase")
-$ if (arch .eqs. "") then arch = "UNK"
-$ endif
-$!
-$ archd = arch
-$ lib32 = "32"
-$ shr = "_SHR32"
-$!
-$ if (p2 .nes. "")
-$ then
-$ if (p2 .eqs. "64")
-$ then
-$ archd = arch+ "_64"
-$ lib32 = ""
-$ shr = "_SHR"
-$ else
-$ if (p2 .nes. "32")
-$ then
-$ write sys$output "Second argument invalid."
-$ write sys$output "It should be "32", "64", or nothing."
-$ exit
-$ endif
-$ endif
-$ endif
-$!
-$ root = f$parse( p1, "[]A.;0", , , "syntax_only, no_conceal") - "A.;0"
-$ root_dev = f$parse(root,,,"device","syntax_only")
-$ root_dir = f$parse(root,,,"directory","syntax_only") - -
- "[000000." - "][" - "[" - "]"
-$ root = root_dev + "[" + root_dir
-$!
-$ define /nolog wrk_sslroot 'root'.] /trans=conc
-$ define /nolog wrk_sslinclude wrk_sslroot:[include]
-$ define /nolog wrk_sslxexe wrk_sslroot:['archd'_exe]
-$ define /nolog wrk_sslxlib wrk_sslroot:['arch'_lib]
-$!
-$ if f$parse("wrk_sslroot:[000000]") .eqs. "" then -
- create /directory /log wrk_sslroot:[000000]
-$ if f$parse("wrk_sslinclude:") .eqs. "" then -
- create /directory /log wrk_sslinclude:
-$ if f$parse("wrk_sslxexe:") .eqs. "" then -
- create /directory /log wrk_sslxexe:
-$ if f$parse("wrk_sslxlib:") .eqs. "" then -
- create /directory /log wrk_sslxlib:
-$!
-$ exheader := ssl.h, ssl2.h, ssl3.h, ssl23.h, tls1.h, dtls1.h, kssl.h, srtp.h
-$ e_exe := ssl_task
-$ libs := ssl_libssl
-$!
-$ xexe_dir := [-.'archd'.exe.ssl]
-$!
-$ copy /protection = w:re 'exheader' wrk_sslinclude: /log
-$!
-$ i = 0
-$ loop_exe:
-$ e = f$edit( f$element( i, ",", e_exe), "trim")
-$ i = i + 1
-$ if e .eqs. "," then goto loop_exe_end
-$ set noon
-$ file = xexe_dir+ e+ ".exe"
-$ if f$search( file) .nes. ""
-$ then
-$ copy /protection = w:re 'file' wrk_sslxexe: /log
-$ endif
-$ set on
-$ goto loop_exe
-$ loop_exe_end:
-$!
-$ i = 0
-$ loop_lib:
-$ e = f$edit(f$element(i, ",", libs),"trim")
-$ i = i + 1
-$ if e .eqs. "," then goto loop_lib_end
-$ set noon
-$! Object library.
-$ file = xexe_dir+ e+ lib32+ ".olb"
-$ if f$search( file) .nes. ""
-$ then
-$ copy /protection = w:re 'file' wrk_sslxlib: /log
-$ endif
-$! Shareable image.
-$ file = xexe_dir+ e+ shr+ ".exe"
-$ if f$search( file) .nes. ""
-$ then
-$ copy /protection = w:re 'file' wrk_sslxlib: /log
-$ endif
-$ set on
-$ goto loop_lib
-$ loop_lib_end:
-$!
-$ tidy:
-$!
-$ call deass wrk_sslroot
-$ call deass wrk_sslinclude
-$ call deass wrk_sslxexe
-$ call deass wrk_sslxlib
-$!
-$ exit
-$!
-$ deass: subroutine
-$ if (f$trnlnm( p1, "LNM$PROCESS") .nes. "")
-$ then
-$ deassign /process 'p1'
-$ endif
-$ endsubroutine
-$!
diff --git a/thirdparty/openssl/ssl/s23_clnt.c b/thirdparty/openssl/ssl/s23_clnt.c
index f782010c47..b80d1fd8ce 100644
--- a/thirdparty/openssl/ssl/s23_clnt.c
+++ b/thirdparty/openssl/ssl/s23_clnt.c
@@ -204,7 +204,10 @@ int ssl23_connect(SSL *s)
goto end;
}
- ssl3_init_finished_mac(s);
+ if (!ssl3_init_finished_mac(s)) {
+ ret = -1;
+ goto end;
+ }
s->state = SSL23_ST_CW_CLNT_HELLO_A;
s->ctx->stats.sess_connect++;
@@ -289,9 +292,9 @@ int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, int len)
unsigned long Time = (unsigned long)time(NULL);
unsigned char *p = result;
l2n(Time, p);
- return RAND_pseudo_bytes(p, len - 4);
+ return RAND_bytes(p, len - 4);
} else
- return RAND_pseudo_bytes(result, len);
+ return RAND_bytes(result, len);
}
static int ssl23_client_hello(SSL *s)
@@ -466,8 +469,8 @@ static int ssl23_client_hello(SSL *s)
i = ch_len;
s2n(i, d);
memset(&(s->s3->client_random[0]), 0, SSL3_RANDOM_SIZE);
- if (RAND_pseudo_bytes
- (&(s->s3->client_random[SSL3_RANDOM_SIZE - i]), i) <= 0)
+ if (RAND_bytes (&(s->s3->client_random[SSL3_RANDOM_SIZE - i]), i)
+ <= 0)
return -1;
memcpy(p, &(s->s3->client_random[SSL3_RANDOM_SIZE - i]), i);
diff --git a/thirdparty/openssl/ssl/s23_pkt.c b/thirdparty/openssl/ssl/s23_pkt.c
index efc8647841..6544180efe 100644
--- a/thirdparty/openssl/ssl/s23_pkt.c
+++ b/thirdparty/openssl/ssl/s23_pkt.c
@@ -63,6 +63,9 @@
#include <openssl/evp.h>
#include <openssl/buffer.h>
+/*
+ * Return values are as per SSL_write()
+ */
int ssl23_write_bytes(SSL *s)
{
int i, num, tot;
@@ -77,7 +80,7 @@ int ssl23_write_bytes(SSL *s)
if (i <= 0) {
s->init_off = tot;
s->init_num = num;
- return (i);
+ return i;
}
s->rwstate = SSL_NOTHING;
if (i == num)
@@ -88,7 +91,10 @@ int ssl23_write_bytes(SSL *s)
}
}
-/* return regularly only when we have read (at least) 'n' bytes */
+/* return regularly only when we have read (at least) 'n' bytes
+ *
+ * Return values are as per SSL_read()
+ */
int ssl23_read_bytes(SSL *s, int n)
{
unsigned char *p;
@@ -102,7 +108,7 @@ int ssl23_read_bytes(SSL *s, int n)
j = BIO_read(s->rbio, (char *)&(p[s->packet_length]),
n - s->packet_length);
if (j <= 0)
- return (j);
+ return j;
s->rwstate = SSL_NOTHING;
s->packet_length += j;
if (s->packet_length >= (unsigned int)n)
diff --git a/thirdparty/openssl/ssl/s23_srvr.c b/thirdparty/openssl/ssl/s23_srvr.c
index 470bd3d94f..d3f6db15cc 100644
--- a/thirdparty/openssl/ssl/s23_srvr.c
+++ b/thirdparty/openssl/ssl/s23_srvr.c
@@ -195,7 +195,10 @@ int ssl23_accept(SSL *s)
s->init_buf = buf;
}
- ssl3_init_finished_mac(s);
+ if (!ssl3_init_finished_mac(s)) {
+ ret = -1;
+ goto end;
+ }
s->state = SSL23_ST_SR_CLNT_HELLO_A;
s->ctx->stats.sess_accept++;
diff --git a/thirdparty/openssl/ssl/s2_clnt.c b/thirdparty/openssl/ssl/s2_clnt.c
index 69da6b1421..20de1a8217 100644
--- a/thirdparty/openssl/ssl/s2_clnt.c
+++ b/thirdparty/openssl/ssl/s2_clnt.c
@@ -581,7 +581,7 @@ static int client_hello(SSL *s)
/*
* challenge id data
*/
- if (RAND_pseudo_bytes(s->s2->challenge, SSL2_CHALLENGE_LENGTH) <= 0)
+ if (RAND_bytes(s->s2->challenge, SSL2_CHALLENGE_LENGTH) <= 0)
return -1;
memcpy(d, s->s2->challenge, SSL2_CHALLENGE_LENGTH);
d += SSL2_CHALLENGE_LENGTH;
@@ -629,7 +629,7 @@ static int client_master_key(SSL *s)
return -1;
}
if (i > 0)
- if (RAND_pseudo_bytes(sess->key_arg, i) <= 0)
+ if (RAND_bytes(sess->key_arg, i) <= 0)
return -1;
/* make a master key */
diff --git a/thirdparty/openssl/ssl/s2_lib.c b/thirdparty/openssl/ssl/s2_lib.c
index 88e67f083a..cc1360307b 100644
--- a/thirdparty/openssl/ssl/s2_lib.c
+++ b/thirdparty/openssl/ssl/s2_lib.c
@@ -254,7 +254,7 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl2_ciphers[] = {
SSL_3DES,
SSL_MD5,
SSL_SSLV2,
- SSL_NOT_DEFAULT | SSL_NOT_EXP | SSL_HIGH,
+ SSL_NOT_DEFAULT | SSL_NOT_EXP | SSL_MEDIUM,
0,
112,
168,
diff --git a/thirdparty/openssl/ssl/s2_pkt.c b/thirdparty/openssl/ssl/s2_pkt.c
index 7a61888134..e44bc0335a 100644
--- a/thirdparty/openssl/ssl/s2_pkt.c
+++ b/thirdparty/openssl/ssl/s2_pkt.c
@@ -307,6 +307,9 @@ int ssl2_peek(SSL *s, void *buf, int len)
return ssl2_read_internal(s, buf, len, 1);
}
+/*
+ * Return values are as per SSL_read()
+ */
static int read_n(SSL *s, unsigned int n, unsigned int max,
unsigned int extend)
{
@@ -374,7 +377,7 @@ static int read_n(SSL *s, unsigned int n, unsigned int max,
# endif
if (i <= 0) {
s->s2->rbuf_left += newb;
- return (i);
+ return i;
}
newb += i;
}
@@ -441,6 +444,9 @@ int ssl2_write(SSL *s, const void *_buf, int len)
}
}
+/*
+ * Return values are as per SSL_write()
+ */
static int write_pending(SSL *s, const unsigned char *buf, unsigned int len)
{
int i;
@@ -477,7 +483,7 @@ static int write_pending(SSL *s, const unsigned char *buf, unsigned int len)
s->rwstate = SSL_NOTHING;
return (s->s2->wpend_ret);
} else if (i <= 0)
- return (i);
+ return i;
s->s2->wpend_off += i;
s->s2->wpend_len -= i;
}
diff --git a/thirdparty/openssl/ssl/s2_srvr.c b/thirdparty/openssl/ssl/s2_srvr.c
index 07e9df8282..d3b243c27e 100644
--- a/thirdparty/openssl/ssl/s2_srvr.c
+++ b/thirdparty/openssl/ssl/s2_srvr.c
@@ -526,11 +526,8 @@ static int get_client_master_key(SSL *s)
* fails. See https://tools.ietf.org/html/rfc5246#section-7.4.7.1
*/
- /*
- * should be RAND_bytes, but we cannot work around a failure.
- */
- if (RAND_pseudo_bytes(rand_premaster_secret,
- (int)num_encrypted_key_bytes) <= 0)
+ if (RAND_bytes(rand_premaster_secret,
+ (int)num_encrypted_key_bytes) <= 0)
return 0;
i = ssl_rsa_private_decrypt(s->cert, s->s2->tmp.enc,
@@ -822,8 +819,7 @@ static int server_hello(SSL *s)
/* make and send conn_id */
s2n(SSL2_CONNECTION_ID_LENGTH, p); /* add conn_id length */
s->s2->conn_id_length = SSL2_CONNECTION_ID_LENGTH;
- if (RAND_pseudo_bytes(s->s2->conn_id, (int)s->s2->conn_id_length) <=
- 0)
+ if (RAND_bytes(s->s2->conn_id, (int)s->s2->conn_id_length) <= 0)
return -1;
memcpy(d, s->s2->conn_id, SSL2_CONNECTION_ID_LENGTH);
d += SSL2_CONNECTION_ID_LENGTH;
@@ -962,7 +958,7 @@ static int request_certificate(SSL *s)
p = (unsigned char *)s->init_buf->data;
*(p++) = SSL2_MT_REQUEST_CERTIFICATE;
*(p++) = SSL2_AT_MD5_WITH_RSA_ENCRYPTION;
- if (RAND_pseudo_bytes(ccd, SSL2_MIN_CERT_CHALLENGE_LENGTH) <= 0)
+ if (RAND_bytes(ccd, SSL2_MIN_CERT_CHALLENGE_LENGTH) <= 0)
return -1;
memcpy(p, ccd, SSL2_MIN_CERT_CHALLENGE_LENGTH);
diff --git a/thirdparty/openssl/ssl/s3_both.c b/thirdparty/openssl/ssl/s3_both.c
index 09d0661e81..054ded1c99 100644
--- a/thirdparty/openssl/ssl/s3_both.c
+++ b/thirdparty/openssl/ssl/s3_both.c
@@ -356,21 +356,22 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
}
*ok = 1;
s->state = stn;
- s->init_msg = s->init_buf->data + 4;
+ s->init_msg = s->init_buf->data + SSL3_HM_HEADER_LENGTH;
s->init_num = (int)s->s3->tmp.message_size;
return s->init_num;
}
p = (unsigned char *)s->init_buf->data;
- if (s->state == st1) { /* s->init_num < 4 */
+ if (s->state == st1) { /* s->init_num < SSL3_HM_HEADER_LENGTH */
int skip_message;
do {
- while (s->init_num < 4) {
+ while (s->init_num < SSL3_HM_HEADER_LENGTH) {
i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE,
&p[s->init_num],
- 4 - s->init_num, 0);
+ SSL3_HM_HEADER_LENGTH -
+ s->init_num, 0);
if (i <= 0) {
s->rwstate = SSL_READING;
*ok = 0;
@@ -394,12 +395,13 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
if (s->msg_callback)
s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE,
- p, 4, s, s->msg_callback_arg);
+ p, SSL3_HM_HEADER_LENGTH, s,
+ s->msg_callback_arg);
}
}
while (skip_message);
- /* s->init_num == 4 */
+ /* s->init_num == SSL3_HM_HEADER_LENGTH */
if ((mt >= 0) && (*p != mt)) {
al = SSL_AD_UNEXPECTED_MESSAGE;
@@ -415,19 +417,20 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
SSLerr(SSL_F_SSL3_GET_MESSAGE, SSL_R_EXCESSIVE_MESSAGE_SIZE);
goto f_err;
}
- if (l > (INT_MAX - 4)) { /* BUF_MEM_grow takes an 'int' parameter */
- al = SSL_AD_ILLEGAL_PARAMETER;
- SSLerr(SSL_F_SSL3_GET_MESSAGE, SSL_R_EXCESSIVE_MESSAGE_SIZE);
- goto f_err;
- }
- if (l && !BUF_MEM_grow_clean(s->init_buf, (int)l + 4)) {
+ /*
+ * Make buffer slightly larger than message length as a precaution
+ * against small OOB reads e.g. CVE-2016-6306
+ */
+ if (l
+ && !BUF_MEM_grow_clean(s->init_buf,
+ (int)l + SSL3_HM_HEADER_LENGTH + 16)) {
SSLerr(SSL_F_SSL3_GET_MESSAGE, ERR_R_BUF_LIB);
goto err;
}
s->s3->tmp.message_size = l;
s->state = stn;
- s->init_msg = s->init_buf->data + 4;
+ s->init_msg = s->init_buf->data + SSL3_HM_HEADER_LENGTH;
s->init_num = 0;
}
@@ -456,10 +459,12 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
#endif
/* Feed this message into MAC computation. */
- ssl3_finish_mac(s, (unsigned char *)s->init_buf->data, s->init_num + 4);
+ ssl3_finish_mac(s, (unsigned char *)s->init_buf->data,
+ s->init_num + SSL3_HM_HEADER_LENGTH);
if (s->msg_callback)
s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->init_buf->data,
- (size_t)s->init_num + 4, s, s->msg_callback_arg);
+ (size_t)s->init_num + SSL3_HM_HEADER_LENGTH, s,
+ s->msg_callback_arg);
*ok = 1;
return s->init_num;
f_err:
@@ -535,6 +540,9 @@ int ssl_verify_alarm_type(long type)
case X509_V_ERR_CRL_NOT_YET_VALID:
case X509_V_ERR_CERT_UNTRUSTED:
case X509_V_ERR_CERT_REJECTED:
+ case X509_V_ERR_HOSTNAME_MISMATCH:
+ case X509_V_ERR_EMAIL_MISMATCH:
+ case X509_V_ERR_IP_ADDRESS_MISMATCH:
al = SSL_AD_BAD_CERTIFICATE;
break;
case X509_V_ERR_CERT_SIGNATURE_FAILURE:
@@ -548,7 +556,10 @@ int ssl_verify_alarm_type(long type)
case X509_V_ERR_CERT_REVOKED:
al = SSL_AD_CERTIFICATE_REVOKED;
break;
+ case X509_V_ERR_UNSPECIFIED:
case X509_V_ERR_OUT_OF_MEM:
+ case X509_V_ERR_INVALID_CALL:
+ case X509_V_ERR_STORE_LOOKUP:
al = SSL_AD_INTERNAL_ERROR;
break;
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
diff --git a/thirdparty/openssl/ssl/s3_clnt.c b/thirdparty/openssl/ssl/s3_clnt.c
index 19dc8648b9..5b8b2da59f 100644
--- a/thirdparty/openssl/ssl/s3_clnt.c
+++ b/thirdparty/openssl/ssl/s3_clnt.c
@@ -263,6 +263,7 @@ int ssl3_connect(SSL *s)
if (!ssl3_setup_buffers(s)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -275,7 +276,11 @@ int ssl3_connect(SSL *s)
/* don't push the buffering BIO quite yet */
- ssl3_init_finished_mac(s);
+ if (!ssl3_init_finished_mac(s)) {
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
+ }
s->state = SSL3_ST_CW_CLNT_HELLO_A;
s->ctx->stats.sess_connect++;
@@ -1216,6 +1221,12 @@ int ssl3_get_server_certificate(SSL *s)
goto f_err;
}
for (nc = 0; nc < llen;) {
+ if (nc + 3 > llen) {
+ al = SSL_AD_DECODE_ERROR;
+ SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE,
+ SSL_R_CERT_LENGTH_MISMATCH);
+ goto f_err;
+ }
n2l3(p, l);
if ((l + nc + 3) > llen) {
al = SSL_AD_DECODE_ERROR;
@@ -1704,12 +1715,6 @@ int ssl3_get_key_exchange(SSL *s)
}
p += i;
- if (BN_is_zero(dh->p)) {
- SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_P_VALUE);
- goto f_err;
- }
-
-
if (2 > n - param_len) {
SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT);
goto f_err;
@@ -1730,11 +1735,6 @@ int ssl3_get_key_exchange(SSL *s)
}
p += i;
- if (BN_is_zero(dh->g)) {
- SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_G_VALUE);
- goto f_err;
- }
-
if (2 > n - param_len) {
SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT);
goto f_err;
@@ -1761,6 +1761,39 @@ int ssl3_get_key_exchange(SSL *s)
goto f_err;
}
+ /*-
+ * Check that p and g are suitable enough
+ *
+ * p is odd
+ * 1 < g < p - 1
+ */
+ {
+ BIGNUM *tmp = NULL;
+
+ if (!BN_is_odd(dh->p)) {
+ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_P_VALUE);
+ goto f_err;
+ }
+ if (BN_is_negative(dh->g) || BN_is_zero(dh->g)
+ || BN_is_one(dh->g)) {
+ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_G_VALUE);
+ goto f_err;
+ }
+ if ((tmp = BN_new()) == NULL
+ || BN_copy(tmp, dh->p) == NULL
+ || !BN_sub_word(tmp, 1)) {
+ BN_free(tmp);
+ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_BN_LIB);
+ goto err;
+ }
+ if (BN_cmp(dh->g, tmp) >= 0) {
+ BN_free(tmp);
+ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_G_VALUE);
+ goto f_err;
+ }
+ BN_free(tmp);
+ }
+
# ifndef OPENSSL_NO_RSA
if (alg_a & SSL_aRSA)
pkey =
@@ -1836,6 +1869,7 @@ int ssl3_get_key_exchange(SSL *s)
goto err;
}
if (EC_KEY_set_group(ecdh, ngroup) == 0) {
+ EC_GROUP_free(ngroup);
SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_EC_LIB);
goto err;
}
@@ -2111,6 +2145,10 @@ int ssl3_get_certificate_request(SSL *s)
if (ctype_num > SSL3_CT_NUMBER) {
/* If we exceed static buffer copy all to cert structure */
s->cert->ctypes = OPENSSL_malloc(ctype_num);
+ if (s->cert->ctypes == NULL) {
+ SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
memcpy(s->cert->ctypes, p, ctype_num);
s->cert->ctype_num = (size_t)ctype_num;
ctype_num = SSL3_CT_NUMBER;
@@ -2167,6 +2205,11 @@ int ssl3_get_certificate_request(SSL *s)
}
for (nc = 0; nc < llen;) {
+ if (nc + 2 > llen) {
+ ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR);
+ SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, SSL_R_CA_DN_TOO_LONG);
+ goto err;
+ }
n2s(p, l);
if ((l + nc + 2) > llen) {
if ((s->options & SSL_OP_NETSCAPE_CA_DN_BUG))
@@ -2999,19 +3042,6 @@ int ssl3_send_client_key_exchange(SSL *s)
goto err;
}
/*
- * If we have client certificate, use its secret as peer key
- */
- if (s->s3->tmp.cert_req && s->cert->key->privatekey) {
- if (EVP_PKEY_derive_set_peer
- (pkey_ctx, s->cert->key->privatekey) <= 0) {
- /*
- * If there was an error - just ignore it. Ephemeral key
- * * would be used
- */
- ERR_clear_error();
- }
- }
- /*
* Compute shared IV and store it in algorithm-specific context
* data
*/
@@ -3057,12 +3087,6 @@ int ssl3_send_client_key_exchange(SSL *s)
n = msglen + 2;
}
memcpy(p, tmp, msglen);
- /* Check if pubkey from client certificate was used */
- if (EVP_PKEY_CTX_ctrl
- (pkey_ctx, -1, -1, EVP_PKEY_CTRL_PEER_KEY, 2, NULL) > 0) {
- /* Set flag "skip certificate verify" */
- s->s3->flags |= TLS1_FLAGS_SKIP_CERT_VERIFY;
- }
EVP_PKEY_CTX_free(pkey_ctx);
s->session->master_key_length =
s->method->ssl3_enc->generate_master_secret(s,
diff --git a/thirdparty/openssl/ssl/s3_enc.c b/thirdparty/openssl/ssl/s3_enc.c
index 47a0ec9fe0..1eee9d9b21 100644
--- a/thirdparty/openssl/ssl/s3_enc.c
+++ b/thirdparty/openssl/ssl/s3_enc.c
@@ -177,32 +177,34 @@ static int ssl3_generate_key_block(SSL *s, unsigned char *km, int num)
EVP_MD_CTX_init(&s1);
for (i = 0; (int)i < num; i += MD5_DIGEST_LENGTH) {
k++;
- if (k > sizeof buf) {
+ if (k > sizeof(buf))
/* bug: 'buf' is too small for this ciphersuite */
- SSLerr(SSL_F_SSL3_GENERATE_KEY_BLOCK, ERR_R_INTERNAL_ERROR);
- return 0;
- }
+ goto err;
for (j = 0; j < k; j++)
buf[j] = c;
c++;
- EVP_DigestInit_ex(&s1, EVP_sha1(), NULL);
- EVP_DigestUpdate(&s1, buf, k);
- EVP_DigestUpdate(&s1, s->session->master_key,
- s->session->master_key_length);
- EVP_DigestUpdate(&s1, s->s3->server_random, SSL3_RANDOM_SIZE);
- EVP_DigestUpdate(&s1, s->s3->client_random, SSL3_RANDOM_SIZE);
- EVP_DigestFinal_ex(&s1, smd, NULL);
-
- EVP_DigestInit_ex(&m5, EVP_md5(), NULL);
- EVP_DigestUpdate(&m5, s->session->master_key,
- s->session->master_key_length);
- EVP_DigestUpdate(&m5, smd, SHA_DIGEST_LENGTH);
+ if (!EVP_DigestInit_ex(&s1, EVP_sha1(), NULL) ||
+ !EVP_DigestUpdate(&s1, buf, k) ||
+ !EVP_DigestUpdate(&s1, s->session->master_key,
+ s->session->master_key_length) ||
+ !EVP_DigestUpdate(&s1, s->s3->server_random, SSL3_RANDOM_SIZE) ||
+ !EVP_DigestUpdate(&s1, s->s3->client_random, SSL3_RANDOM_SIZE) ||
+ !EVP_DigestFinal_ex(&s1, smd, NULL))
+ goto err2;
+
+ if (!EVP_DigestInit_ex(&m5, EVP_md5(), NULL) ||
+ !EVP_DigestUpdate(&m5, s->session->master_key,
+ s->session->master_key_length) ||
+ !EVP_DigestUpdate(&m5, smd, SHA_DIGEST_LENGTH))
+ goto err2;
if ((int)(i + MD5_DIGEST_LENGTH) > num) {
- EVP_DigestFinal_ex(&m5, smd, NULL);
+ if (!EVP_DigestFinal_ex(&m5, smd, NULL))
+ goto err2;
memcpy(km, smd, (num - i));
} else
- EVP_DigestFinal_ex(&m5, km, NULL);
+ if (!EVP_DigestFinal_ex(&m5, km, NULL))
+ goto err2;
km += MD5_DIGEST_LENGTH;
}
@@ -210,6 +212,12 @@ static int ssl3_generate_key_block(SSL *s, unsigned char *km, int num)
EVP_MD_CTX_cleanup(&m5);
EVP_MD_CTX_cleanup(&s1);
return 1;
+ err:
+ SSLerr(SSL_F_SSL3_GENERATE_KEY_BLOCK, ERR_R_INTERNAL_ERROR);
+ err2:
+ EVP_MD_CTX_cleanup(&m5);
+ EVP_MD_CTX_cleanup(&s1);
+ return 0;
}
int ssl3_change_cipher_state(SSL *s, int which)
@@ -360,25 +368,33 @@ int ssl3_change_cipher_state(SSL *s, int which)
* In here I set both the read and write key/iv to the same value
* since only the correct one will be used :-).
*/
- EVP_DigestInit_ex(&md, EVP_md5(), NULL);
- EVP_DigestUpdate(&md, key, j);
- EVP_DigestUpdate(&md, er1, SSL3_RANDOM_SIZE);
- EVP_DigestUpdate(&md, er2, SSL3_RANDOM_SIZE);
- EVP_DigestFinal_ex(&md, &(exp_key[0]), NULL);
+ if (!EVP_DigestInit_ex(&md, EVP_md5(), NULL) ||
+ !EVP_DigestUpdate(&md, key, j) ||
+ !EVP_DigestUpdate(&md, er1, SSL3_RANDOM_SIZE) ||
+ !EVP_DigestUpdate(&md, er2, SSL3_RANDOM_SIZE) ||
+ !EVP_DigestFinal_ex(&md, &(exp_key[0]), NULL)) {
+ EVP_MD_CTX_cleanup(&md);
+ goto err2;
+ }
key = &(exp_key[0]);
if (k > 0) {
- EVP_DigestInit_ex(&md, EVP_md5(), NULL);
- EVP_DigestUpdate(&md, er1, SSL3_RANDOM_SIZE);
- EVP_DigestUpdate(&md, er2, SSL3_RANDOM_SIZE);
- EVP_DigestFinal_ex(&md, &(exp_iv[0]), NULL);
+ if (!EVP_DigestInit_ex(&md, EVP_md5(), NULL) ||
+ !EVP_DigestUpdate(&md, er1, SSL3_RANDOM_SIZE) ||
+ !EVP_DigestUpdate(&md, er2, SSL3_RANDOM_SIZE) ||
+ !EVP_DigestFinal_ex(&md, &(exp_iv[0]), NULL)) {
+ EVP_MD_CTX_cleanup(&md);
+ goto err2;
+ }
iv = &(exp_iv[0]);
}
}
+ EVP_MD_CTX_cleanup(&md);
s->session->key_arg_length = 0;
- EVP_CipherInit_ex(dd, c, NULL, key, iv, (which & SSL3_CC_WRITE));
+ if (!EVP_CipherInit_ex(dd, c, NULL, key, iv, (which & SSL3_CC_WRITE)))
+ goto err2;
#ifdef OPENSSL_SSL_TRACE_CRYPTO
if (s->msg_callback) {
@@ -399,7 +415,6 @@ int ssl3_change_cipher_state(SSL *s, int which)
OPENSSL_cleanse(&(exp_key[0]), sizeof(exp_key));
OPENSSL_cleanse(&(exp_iv[0]), sizeof(exp_iv));
- EVP_MD_CTX_cleanup(&md);
return (1);
err:
SSLerr(SSL_F_SSL3_CHANGE_CIPHER_STATE, ERR_R_MALLOC_FAILURE);
@@ -555,17 +570,20 @@ int ssl3_enc(SSL *s, int send)
if ((bs != 1) && !send)
return ssl3_cbc_remove_padding(s, rec, bs, mac_size);
}
- return (1);
+ return 1;
}
-void ssl3_init_finished_mac(SSL *s)
+int ssl3_init_finished_mac(SSL *s)
{
if (s->s3->handshake_buffer)
BIO_free(s->s3->handshake_buffer);
if (s->s3->handshake_dgst)
ssl3_free_digest_list(s);
s->s3->handshake_buffer = BIO_new(BIO_s_mem());
+ if (s->s3->handshake_buffer == NULL)
+ return 0;
(void)BIO_set_close(s->s3->handshake_buffer, BIO_CLOSE);
+ return 1;
}
void ssl3_free_digest_list(SSL *s)
@@ -607,6 +625,10 @@ int ssl3_digest_cached_records(SSL *s)
ssl3_free_digest_list(s);
s->s3->handshake_dgst =
OPENSSL_malloc(SSL_MAX_DIGEST * sizeof(EVP_MD_CTX *));
+ if (s->s3->handshake_dgst == NULL) {
+ SSLerr(SSL_F_SSL3_DIGEST_CACHED_RECORDS, ERR_R_MALLOC_FAILURE);
+ return 0;
+ }
memset(s->s3->handshake_dgst, 0, SSL_MAX_DIGEST * sizeof(EVP_MD_CTX *));
hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata);
if (hdatalen <= 0) {
@@ -618,14 +640,22 @@ int ssl3_digest_cached_records(SSL *s)
for (i = 0; ssl_get_handshake_digest(i, &mask, &md); i++) {
if ((mask & ssl_get_algorithm2(s)) && md) {
s->s3->handshake_dgst[i] = EVP_MD_CTX_create();
+ if (s->s3->handshake_dgst[i] == NULL) {
+ SSLerr(SSL_F_SSL3_DIGEST_CACHED_RECORDS, ERR_R_MALLOC_FAILURE);
+ return 0;
+ }
#ifdef OPENSSL_FIPS
if (EVP_MD_nid(md) == NID_md5) {
EVP_MD_CTX_set_flags(s->s3->handshake_dgst[i],
EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
}
#endif
- EVP_DigestInit_ex(s->s3->handshake_dgst[i], md, NULL);
- EVP_DigestUpdate(s->s3->handshake_dgst[i], hdata, hdatalen);
+ if (!EVP_DigestInit_ex(s->s3->handshake_dgst[i], md, NULL)
+ || !EVP_DigestUpdate(s->s3->handshake_dgst[i], hdata,
+ hdatalen)) {
+ SSLerr(SSL_F_SSL3_DIGEST_CACHED_RECORDS, ERR_R_INTERNAL_ERROR);
+ return 0;
+ }
} else {
s->s3->handshake_dgst[i] = NULL;
}
@@ -895,7 +925,7 @@ int ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
s, s->msg_callback_arg);
}
#endif
- OPENSSL_cleanse(buf, sizeof buf);
+ OPENSSL_cleanse(buf, sizeof(buf));
return (ret);
}
diff --git a/thirdparty/openssl/ssl/s3_lib.c b/thirdparty/openssl/ssl/s3_lib.c
index 872e636af9..1014a3fce1 100644
--- a/thirdparty/openssl/ssl/s3_lib.c
+++ b/thirdparty/openssl/ssl/s3_lib.c
@@ -329,7 +329,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_SSLV3,
- SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -382,7 +382,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_SSLV3,
- SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -434,7 +434,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_SSLV3,
- SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -487,7 +487,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_SSLV3,
- SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -539,7 +539,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_SSLV3,
- SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -625,7 +625,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_SSLV3,
- SSL_NOT_DEFAULT | SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_DEFAULT | SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -712,7 +712,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_SSLV3,
- SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -778,7 +778,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_MD5,
SSL_SSLV3,
- SSL_NOT_EXP | SSL_HIGH,
+ SSL_NOT_EXP | SSL_MEDIUM,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -1728,7 +1728,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_TLSV1,
- SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -2120,7 +2120,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_TLSV1,
- SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -2200,7 +2200,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_TLSV1,
- SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -2280,7 +2280,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_TLSV1,
- SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -2360,7 +2360,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_TLSV1,
- SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -2440,7 +2440,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_TLSV1,
- SSL_NOT_DEFAULT | SSL_NOT_EXP | SSL_HIGH | SSL_FIPS,
+ SSL_NOT_DEFAULT | SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -2490,7 +2490,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_TLSV1,
- SSL_NOT_EXP | SSL_HIGH,
+ SSL_NOT_EXP | SSL_MEDIUM,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -2506,7 +2506,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_TLSV1,
- SSL_NOT_EXP | SSL_HIGH,
+ SSL_NOT_EXP | SSL_MEDIUM,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -2522,7 +2522,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = {
SSL_3DES,
SSL_SHA1,
SSL_TLSV1,
- SSL_NOT_EXP | SSL_HIGH,
+ SSL_NOT_EXP | SSL_MEDIUM,
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
112,
168,
@@ -4237,7 +4237,7 @@ int ssl3_get_req_cert_type(SSL *s, unsigned char *p)
return (int)s->cert->ctype_num;
}
/* get configured sigalgs */
- siglen = tls12_get_psigalgs(s, &sig);
+ siglen = tls12_get_psigalgs(s, 1, &sig);
if (s->cert->cert_flags & SSL_CERT_FLAGS_CHECK_TLS_STRICT)
nostrict = 0;
for (i = 0; i < siglen; i += 2, sig += 2) {
@@ -4528,7 +4528,10 @@ int ssl3_renegotiate_check(SSL *s)
*/
long ssl_get_algorithm2(SSL *s)
{
- long alg2 = s->s3->tmp.new_cipher->algorithm2;
+ long alg2;
+ if (s->s3 == NULL || s->s3->tmp.new_cipher == NULL)
+ return -1;
+ alg2 = s->s3->tmp.new_cipher->algorithm2;
if (s->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_SHA256_PRF
&& alg2 == (SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF))
return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256;
diff --git a/thirdparty/openssl/ssl/s3_pkt.c b/thirdparty/openssl/ssl/s3_pkt.c
index 379890237e..0290c991d8 100644
--- a/thirdparty/openssl/ssl/s3_pkt.c
+++ b/thirdparty/openssl/ssl/s3_pkt.c
@@ -136,6 +136,9 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
unsigned int len, int create_empty_fragment);
static int ssl3_get_record(SSL *s);
+/*
+ * Return values are as per SSL_read()
+ */
int ssl3_read_n(SSL *s, int n, int max, int extend)
{
/*
@@ -667,7 +670,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
* promptly send beyond the end of the users buffer ... so we trap and
* report the error in a way the user will notice
*/
- if (len < tot) {
+ if ((len < tot) || ((wb->left != 0) && (len < (tot + s->s3->wpend_tot)))) {
SSLerr(SSL_F_SSL3_WRITE_BYTES, SSL_R_BAD_LENGTH);
return (-1);
}
@@ -696,6 +699,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
len >= 4 * (int)(max_send_fragment = s->max_send_fragment) &&
s->compress == NULL && s->msg_callback == NULL &&
SSL_USE_EXPLICIT_IV(s) &&
+ s->enc_write_ctx != NULL &&
EVP_CIPHER_flags(s->enc_write_ctx->cipher) &
EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK) {
unsigned char aad[13];
@@ -1082,7 +1086,10 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
return -1;
}
-/* if s->s3->wbuf.left != 0, we need to call this */
+/* if s->s3->wbuf.left != 0, we need to call this
+ *
+ * Return values are as per SSL_write(), i.e.
+ */
int ssl3_write_pending(SSL *s, int type, const unsigned char *buf,
unsigned int len)
{
@@ -1122,7 +1129,7 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf,
*/
wb->left = 0;
}
- return (i);
+ return i;
}
wb->offset += i;
wb->left -= i;
@@ -1229,6 +1236,13 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
return (ret);
}
+ /*
+ * Reset the count of consecutive warning alerts if we've got a non-empty
+ * record that isn't an alert.
+ */
+ if (rr->type != SSL3_RT_ALERT && rr->length != 0)
+ s->cert->alert_count = 0;
+
/* we now have a packet which can be read and processed */
if (s->s3->change_cipher_spec /* set when we receive ChangeCipherSpec,
@@ -1443,6 +1457,14 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
if (alert_level == SSL3_AL_WARNING) {
s->s3->warn_alert = alert_descr;
+
+ s->cert->alert_count++;
+ if (s->cert->alert_count == MAX_WARN_ALERT_COUNT) {
+ al = SSL_AD_UNEXPECTED_MESSAGE;
+ SSLerr(SSL_F_SSL3_READ_BYTES, SSL_R_TOO_MANY_WARN_ALERTS);
+ goto f_err;
+ }
+
if (alert_descr == SSL_AD_CLOSE_NOTIFY) {
s->shutdown |= SSL_RECEIVED_SHUTDOWN;
return (0);
@@ -1473,7 +1495,7 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
BIO_snprintf(tmp, sizeof tmp, "%d", alert_descr);
ERR_add_error_data(2, "SSL alert number ", tmp);
s->shutdown |= SSL_RECEIVED_SHUTDOWN;
- SSL_CTX_remove_session(s->ctx, s->session);
+ SSL_CTX_remove_session(s->session_ctx, s->session);
return (0);
} else {
al = SSL_AD_ILLEGAL_PARAMETER;
@@ -1578,16 +1600,13 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
switch (rr->type) {
default:
-#ifndef OPENSSL_NO_TLS
/*
- * TLS up to v1.1 just ignores unknown message types: TLS v1.2 give
- * an unexpected message alert.
+ * TLS 1.0 and 1.1 say you SHOULD ignore unrecognised record types, but
+ * TLS 1.2 says you MUST send an unexpected message alert. We use the
+ * TLS 1.2 behaviour for all protocol versions to prevent issues where
+ * no progress is being made and the peer continually sends unrecognised
+ * record types, using up resources processing them.
*/
- if (s->version >= TLS1_VERSION && s->version <= TLS1_1_VERSION) {
- rr->length = 0;
- goto start;
- }
-#endif
al = SSL_AD_UNEXPECTED_MESSAGE;
SSLerr(SSL_F_SSL3_READ_BYTES, SSL_R_UNEXPECTED_RECORD);
goto f_err;
@@ -1698,7 +1717,7 @@ int ssl3_send_alert(SSL *s, int level, int desc)
return -1;
/* If a fatal one, remove from cache */
if ((level == 2) && (s->session != NULL))
- SSL_CTX_remove_session(s->ctx, s->session);
+ SSL_CTX_remove_session(s->session_ctx, s->session);
s->s3->alert_dispatch = 1;
s->s3->send_alert[0] = level;
diff --git a/thirdparty/openssl/ssl/s3_srvr.c b/thirdparty/openssl/ssl/s3_srvr.c
index ab28702ee9..ba17f1b562 100644
--- a/thirdparty/openssl/ssl/s3_srvr.c
+++ b/thirdparty/openssl/ssl/s3_srvr.c
@@ -311,7 +311,12 @@ int ssl3_accept(SSL *s)
goto end;
}
- ssl3_init_finished_mac(s);
+ if (!ssl3_init_finished_mac(s)) {
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
+ }
+
s->state = SSL3_ST_SR_CLNT_HELLO_A;
s->ctx->stats.sess_accept++;
} else if (!s->s3->send_connection_binding &&
@@ -348,7 +353,11 @@ int ssl3_accept(SSL *s)
s->state = SSL3_ST_SW_FLUSH;
s->init_num = 0;
- ssl3_init_finished_mac(s);
+ if (!ssl3_init_finished_mac(s)) {
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
+ }
break;
case SSL3_ST_SW_HELLO_REQ_C:
@@ -506,7 +515,7 @@ int ssl3_accept(SSL *s)
* if SSL_VERIFY_CLIENT_ONCE is set, don't request cert
* during re-negotiation:
*/
- ((s->session->peer != NULL) &&
+ (s->s3->tmp.finish_md_len != 0 &&
(s->verify_mode & SSL_VERIFY_CLIENT_ONCE)) ||
/*
* never request cert in anonymous ciphersuites (see
@@ -980,7 +989,8 @@ int ssl3_get_client_hello(SSL *s)
session_length = *(p + SSL3_RANDOM_SIZE);
- if (p + SSL3_RANDOM_SIZE + session_length + 1 >= d + n) {
+ if (SSL3_RANDOM_SIZE + session_length + 1
+ >= (unsigned int)((d + n) - p)) {
al = SSL_AD_DECODE_ERROR;
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
goto f_err;
@@ -998,7 +1008,7 @@ int ssl3_get_client_hello(SSL *s)
/* get the session-id */
j = *(p++);
- if (p + j > d + n) {
+ if ((d + n) - p < j) {
al = SSL_AD_DECODE_ERROR;
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
goto f_err;
@@ -1054,14 +1064,14 @@ int ssl3_get_client_hello(SSL *s)
if (SSL_IS_DTLS(s)) {
/* cookie stuff */
- if (p + 1 > d + n) {
+ if ((d + n) - p < 1) {
al = SSL_AD_DECODE_ERROR;
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
goto f_err;
}
cookie_len = *(p++);
- if (p + cookie_len > d + n) {
+ if ((unsigned int)((d + n ) - p) < cookie_len) {
al = SSL_AD_DECODE_ERROR;
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
goto f_err;
@@ -1131,7 +1141,7 @@ int ssl3_get_client_hello(SSL *s)
}
}
- if (p + 2 > d + n) {
+ if ((d + n ) - p < 2) {
al = SSL_AD_DECODE_ERROR;
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
goto f_err;
@@ -1145,7 +1155,7 @@ int ssl3_get_client_hello(SSL *s)
}
/* i bytes of cipher data + 1 byte for compression length later */
- if ((p + i + 1) > (d + n)) {
+ if ((d + n) - p < i + 1) {
/* not enough data */
al = SSL_AD_DECODE_ERROR;
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH);
@@ -1211,7 +1221,7 @@ int ssl3_get_client_hello(SSL *s)
/* compression */
i = *(p++);
- if ((p + i) > (d + n)) {
+ if ((d + n) - p < i) {
/* not enough data */
al = SSL_AD_DECODE_ERROR;
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH);
@@ -1464,9 +1474,9 @@ int ssl3_get_client_hello(SSL *s)
/* Handles TLS extensions that we couldn't check earlier */
if (s->version >= SSL3_VERSION) {
- if (ssl_check_clienthello_tlsext_late(s) <= 0) {
+ if (!ssl_check_clienthello_tlsext_late(s, &al)) {
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_CLIENTHELLO_TLSEXT);
- goto err;
+ goto f_err;
}
}
@@ -1600,6 +1610,9 @@ int ssl3_send_server_key_exchange(SSL *s)
unsigned int u;
#endif
#ifndef OPENSSL_NO_DH
+# ifdef OPENSSL_NO_RSA
+ int j;
+# endif
DH *dh = NULL, *dhp;
#endif
#ifndef OPENSSL_NO_ECDH
@@ -1700,6 +1713,12 @@ int ssl3_send_server_key_exchange(SSL *s)
if (type & SSL_kEECDH) {
const EC_GROUP *group;
+ if (s->s3->tmp.ecdh != NULL) {
+ SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,
+ ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
+
ecdhp = cert->ecdh_tmp;
if (s->cert->ecdh_tmp_auto) {
/* Get NID of appropriate shared curve */
@@ -1720,17 +1739,7 @@ int ssl3_send_server_key_exchange(SSL *s)
goto f_err;
}
- if (s->s3->tmp.ecdh != NULL) {
- SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,
- ERR_R_INTERNAL_ERROR);
- goto err;
- }
-
/* Duplicate the ECDH structure. */
- if (ecdhp == NULL) {
- SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_ECDH_LIB);
- goto err;
- }
if (s->cert->ecdh_tmp_auto)
ecdh = ecdhp;
else if ((ecdh = EC_KEY_dup(ecdhp)) == NULL) {
@@ -1861,6 +1870,16 @@ int ssl3_send_server_key_exchange(SSL *s)
n += 1 + nr[i];
else
#endif
+#ifndef OPENSSL_NO_DH
+ /*
+ * for interoperability with some versions of the Microsoft TLS
+ * stack, we need to zero pad the DHE pub key to the same length
+ * as the prime, so use the length of the prime here
+ */
+ if ((i == 2) && (type & (SSL_kEDH)))
+ n += 2 + nr[0];
+ else
+#endif
n += 2 + nr[i];
}
@@ -1872,6 +1891,11 @@ int ssl3_send_server_key_exchange(SSL *s)
goto f_err;
}
kn = EVP_PKEY_size(pkey);
+ /* Allow space for signature algorithm */
+ if (SSL_USE_SIGALGS(s))
+ kn += 2;
+ /* Allow space for signature length */
+ kn += 2;
} else {
pkey = NULL;
kn = 0;
@@ -1890,6 +1914,20 @@ int ssl3_send_server_key_exchange(SSL *s)
p++;
} else
#endif
+#ifndef OPENSSL_NO_DH
+ /*
+ * for interoperability with some versions of the Microsoft TLS
+ * stack, we need to zero pad the DHE pub key to the same length
+ * as the prime
+ */
+ if ((i == 2) && (type & (SSL_kEDH))) {
+ s2n(nr[0], p);
+ for (j = 0; j < (nr[0] - nr[2]); ++j) {
+ *p = 0;
+ ++p;
+ }
+ } else
+#endif
s2n(nr[i], p);
BN_bn2bin(r[i], p);
p += nr[i];
@@ -2051,7 +2089,7 @@ int ssl3_send_certificate_request(SSL *s)
if (SSL_USE_SIGALGS(s)) {
const unsigned char *psigs;
- nl = tls12_get_psigalgs(s, &psigs);
+ nl = tls12_get_psigalgs(s, 1, &psigs);
s2n(nl, p);
memcpy(p, psigs, nl);
p += nl;
@@ -2229,11 +2267,8 @@ int ssl3_get_client_key_exchange(SSL *s)
* fails. See https://tools.ietf.org/html/rfc5246#section-7.4.7.1
*/
- /*
- * should be RAND_bytes, but we cannot work around a failure.
- */
- if (RAND_pseudo_bytes(rand_premaster_secret,
- sizeof(rand_premaster_secret)) <= 0)
+ if (RAND_bytes(rand_premaster_secret,
+ sizeof(rand_premaster_secret)) <= 0)
goto err;
decrypt_len =
RSA_private_decrypt((int)n, p, p, rsa, RSA_PKCS1_PADDING);
@@ -2323,7 +2358,8 @@ int ssl3_get_client_key_exchange(SSL *s)
if (!(s->options & SSL_OP_SSLEAY_080_CLIENT_DH_BUG)) {
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG);
- goto err;
+ al = SSL_AD_HANDSHAKE_FAILURE;
+ goto f_err;
} else {
p -= 2;
i = (int)n;
@@ -2376,9 +2412,10 @@ int ssl3_get_client_key_exchange(SSL *s)
i = DH_compute_key(p, pub, dh_srvr);
if (i <= 0) {
+ al = SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_DH_LIB);
BN_clear_free(pub);
- goto err;
+ goto f_err;
}
DH_free(s->s3->tmp.dh);
@@ -2676,12 +2713,14 @@ int ssl3_get_client_key_exchange(SSL *s)
i = *p;
p += 1;
if (n != 1 + i) {
- SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_EC_LIB);
- goto err;
+ SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_LENGTH_MISMATCH);
+ al = SSL_AD_DECODE_ERROR;
+ goto f_err;
}
if (EC_POINT_oct2point(group, clnt_ecpoint, p, i, bn_ctx) == 0) {
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_EC_LIB);
- goto err;
+ al = SSL_AD_HANDSHAKE_FAILURE;
+ goto f_err;
}
/*
* p is pointing to somewhere in the buffer currently, so set it
@@ -2984,6 +3023,11 @@ int ssl3_get_cert_verify(SSL *s)
peer = s->session->peer;
pkey = X509_get_pubkey(peer);
+ if (pkey == NULL) {
+ al = SSL_AD_INTERNAL_ERROR;
+ goto f_err;
+ }
+
type = X509_certificate_type(peer, pkey);
if (!(type & EVP_PKT_SIGN)) {
@@ -3120,7 +3164,9 @@ int ssl3_get_cert_verify(SSL *s)
goto f_err;
}
if (i != 64) {
+#ifdef SSL_DEBUG
fprintf(stderr, "GOST signature length is %d", i);
+#endif
}
for (idx = 0; idx < 64; idx++) {
signature[63 - idx] = p[idx];
@@ -3213,6 +3259,12 @@ int ssl3_get_client_certificate(SSL *s)
goto f_err;
}
for (nc = 0; nc < llen;) {
+ if (nc + 3 > llen) {
+ al = SSL_AD_DECODE_ERROR;
+ SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE,
+ SSL_R_CERT_LENGTH_MISMATCH);
+ goto f_err;
+ }
n2l3(p, l);
if ((l + nc + 3) > llen) {
al = SSL_AD_DECODE_ERROR;
@@ -3423,8 +3475,22 @@ int ssl3_send_newsession_ticket(SSL *s)
* all the work otherwise use generated values from parent ctx.
*/
if (tctx->tlsext_ticket_key_cb) {
- if (tctx->tlsext_ticket_key_cb(s, key_name, iv, &ctx,
- &hctx, 1) < 0)
+ /* if 0 is returned, write en empty ticket */
+ int ret = tctx->tlsext_ticket_key_cb(s, key_name, iv, &ctx,
+ &hctx, 1);
+
+ if (ret == 0) {
+ l2n(0, p); /* timeout */
+ s2n(0, p); /* length */
+ ssl_set_handshake_header(s, SSL3_MT_NEWSESSION_TICKET,
+ p - ssl_handshake_start(s));
+ s->state = SSL3_ST_SW_SESSION_TICKET_B;
+ OPENSSL_free(senc);
+ EVP_CIPHER_CTX_cleanup(&ctx);
+ HMAC_CTX_cleanup(&hctx);
+ return ssl_do_write(s);
+ }
+ if (ret < 0)
goto err;
} else {
if (RAND_bytes(iv, 16) <= 0)
@@ -3497,37 +3563,34 @@ int ssl3_send_cert_status(SSL *s)
{
if (s->state == SSL3_ST_SW_CERT_STATUS_A) {
unsigned char *p;
+ size_t msglen;
+
/*-
* Grow buffer if need be: the length calculation is as
- * follows 1 (message type) + 3 (message length) +
+ * follows handshake_header_length +
* 1 (ocsp response type) + 3 (ocsp response length)
* + (ocsp response)
*/
- if (!BUF_MEM_grow(s->init_buf, 8 + s->tlsext_ocsp_resplen)) {
+ msglen = 4 + s->tlsext_ocsp_resplen;
+ if (!BUF_MEM_grow(s->init_buf, SSL_HM_HEADER_LENGTH(s) + msglen)) {
s->state = SSL_ST_ERR;
return -1;
}
- p = (unsigned char *)s->init_buf->data;
+ p = ssl_handshake_start(s);
- /* do the header */
- *(p++) = SSL3_MT_CERTIFICATE_STATUS;
- /* message length */
- l2n3(s->tlsext_ocsp_resplen + 4, p);
/* status type */
*(p++) = s->tlsext_status_type;
/* length of OCSP response */
l2n3(s->tlsext_ocsp_resplen, p);
/* actual response */
memcpy(p, s->tlsext_ocsp_resp, s->tlsext_ocsp_resplen);
- /* number of bytes to write */
- s->init_num = 8 + s->tlsext_ocsp_resplen;
- s->state = SSL3_ST_SW_CERT_STATUS_B;
- s->init_off = 0;
+
+ ssl_set_handshake_header(s, SSL3_MT_CERTIFICATE_STATUS, msglen);
}
/* SSL3_ST_SW_CERT_STATUS_B */
- return (ssl3_do_write(s, SSL3_RT_HANDSHAKE));
+ return (ssl_do_write(s));
}
# ifndef OPENSSL_NO_NEXTPROTONEG
diff --git a/thirdparty/openssl/ssl/ssl-lib.com b/thirdparty/openssl/ssl/ssl-lib.com
deleted file mode 100644
index 43fea17541..0000000000
--- a/thirdparty/openssl/ssl/ssl-lib.com
+++ /dev/null
@@ -1,1229 +0,0 @@
-$!
-$! SSL-LIB.COM
-$! Written By: Robert Byer
-$! Vice-President
-$! A-Com Computing, Inc.
-$! byer@mail.all-net.net
-$!
-$! Changes by Richard Levitte <richard@levitte.org>
-$!
-$! This command file compiles and creates the "[.xxx.EXE.SSL]LIBSSL.OLB"
-$! library for OpenSSL. The "xxx" denotes the machine architecture of
-$! ALPHA, IA64 or VAX.
-$!
-$! It is written to detect what type of machine you are compiling on
-$! (i.e. ALPHA or VAX) and which "C" compiler you have (i.e. VAXC, DECC
-$! or GNU C) or you can specify which compiler to use.
-$!
-$! Specify the following as P1 to build just that part or ALL to just
-$! build everything.
-$!
-$! LIBRARY To just compile the [.xxx.EXE.SSL]LIBSSL.OLB Library.
-$! SSL_TASK To just compile the [.xxx.EXE.SSL]SSL_TASK.EXE
-$!
-$! Specify DEBUG or NODEBUG as P2 to compile with or without debugger
-$! information.
-$!
-$! Specify which compiler at P3 to try to compile under.
-$!
-$! VAXC For VAX C.
-$! DECC For DEC C.
-$! GNUC For GNU C.
-$!
-$! If you don't specify a compiler, it will try to determine which
-$! "C" compiler to use.
-$!
-$! P4, if defined, sets a TCP/IP library to use, through one of the following
-$! keywords:
-$!
-$! UCX for UCX
-$! TCPIP for TCPIP (post UCX)
-$! SOCKETSHR for SOCKETSHR+NETLIB
-$!
-$! P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
-$!
-$! P6, if defined, specifies the C pointer size. Ignored on VAX.
-$! ("64=ARGV" gives more efficient code with HP C V7.3 or newer.)
-$! Supported values are:
-$!
-$! "" Compile with default (/NOPOINTER_SIZE)
-$! 32 Compile with /POINTER_SIZE=32 (SHORT)
-$! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV])
-$! (Automatically select ARGV if compiler supports it.)
-$! 64= Compile with /POINTER_SIZE=64 (LONG).
-$! 64=ARGV Compile with /POINTER_SIZE=64=ARGV (LONG=ARGV).
-$!
-$! P7, if defined, specifies a directory where ZLIB files (zlib.h,
-$! libz.olb) may be found. Optionally, a non-default object library
-$! name may be included ("dev:[dir]libz_64.olb", for example).
-$!
-$!
-$! Announce/identify.
-$!
-$ proc = f$environment( "procedure")
-$ write sys$output "@@@ "+ -
- f$parse( proc, , , "name")+ f$parse( proc, , , "type")
-$!
-$! Define A TCP/IP Library That We Will Need To Link To.
-$! (That Is, If We Need To Link To One.)
-$!
-$ TCPIP_LIB = ""
-$ ZLIB_LIB = ""
-$!
-$! Check What Architecture We Are Using.
-$!
-$ IF (F$GETSYI("CPU").LT.128)
-$ THEN
-$!
-$! The Architecture Is VAX.
-$!
-$ ARCH = "VAX"
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! The Architecture Is Alpha, IA64 or whatever comes in the future.
-$!
-$ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
-$ IF (ARCH .EQS. "") THEN ARCH = "UNK"
-$!
-$! End The Architecture Check.
-$!
-$ ENDIF
-$!
-$ ARCHD = ARCH
-$ LIB32 = "32"
-$ OPT_FILE = ""
-$ POINTER_SIZE = ""
-$!
-$! Check To Make Sure We Have Valid Command Line Parameters.
-$!
-$ GOSUB CHECK_OPTIONS
-$!
-$! Define The OBJ and EXE Directories.
-$!
-$ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.SSL]
-$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.SSL]
-$!
-$! Specify the destination directory in any /MAP option.
-$!
-$ if (LINKMAP .eqs. "MAP")
-$ then
-$ LINKMAP = LINKMAP+ "=''EXE_DIR'"
-$ endif
-$!
-$! Add the location prefix to the linker options file name.
-$!
-$ if (OPT_FILE .nes. "")
-$ then
-$ OPT_FILE = EXE_DIR+ OPT_FILE
-$ endif
-$!
-$! Initialise logical names and such
-$!
-$ GOSUB INITIALISE
-$!
-$! Tell The User What Kind of Machine We Run On.
-$!
-$ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'"
-$!
-$! Check To See If The Architecture Specific OBJ Directory Exists.
-$!
-$ IF (F$PARSE(OBJ_DIR).EQS."")
-$ THEN
-$!
-$! It Dosen't Exist, So Create It.
-$!
-$ CREATE/DIR 'OBJ_DIR'
-$!
-$! End The Architecture Specific OBJ Directory Check.
-$!
-$ ENDIF
-$!
-$! Check To See If The Architecture Specific Directory Exists.
-$!
-$ IF (F$PARSE(EXE_DIR).EQS."")
-$ THEN
-$!
-$! It Dosen't Exist, So Create It.
-$!
-$ CREATE/DIR 'EXE_DIR'
-$!
-$! End The Architecture Specific Directory Check.
-$!
-$ ENDIF
-$!
-$! Define The Library Name.
-$!
-$ SSL_LIB := 'EXE_DIR'SSL_LIBSSL'LIB32'.OLB
-$!
-$! Define The CRYPTO-LIB We Are To Use.
-$!
-$ CRYPTO_LIB := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO'LIB32'.OLB
-$!
-$! Set up exceptional compilations.
-$!
-$ CC5_SHOWN = 0
-$!
-$! Check To See What We Are To Do.
-$!
-$ IF (BUILDALL.EQS."TRUE")
-$ THEN
-$!
-$! Since Nothing Special Was Specified, Do Everything.
-$!
-$ GOSUB LIBRARY
-$ GOSUB SSL_TASK
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Build Just What The User Wants Us To Build.
-$!
-$ GOSUB 'BUILDALL'
-$!
-$! End The BUILDALL Check.
-$!
-$ ENDIF
-$!
-$! Time To EXIT.
-$!
-$ EXIT:
-$ GOSUB CLEANUP
-$ EXIT
-$!
-$! Compile The Library.
-$!
-$ LIBRARY:
-$!
-$! Check To See If We Already Have A "[.xxx.EXE.SSL]SSL_LIBSSL''LIB32'.OLB" Library...
-$!
-$ IF (F$SEARCH(SSL_LIB).EQS."")
-$ THEN
-$!
-$! Guess Not, Create The Library.
-$!
-$ LIBRARY/CREATE/OBJECT 'SSL_LIB'
-$!
-$! End The Library Exist Check.
-$!
-$ ENDIF
-$!
-$! Define The Different SSL "library" Files.
-$!
-$ LIB_SSL = "s2_meth, s2_srvr, s2_clnt, s2_lib, s2_enc, s2_pkt,"+ -
- "s3_meth, s3_srvr, s3_clnt, s3_lib, s3_enc, s3_pkt, s3_both, s3_cbc,"+ -
- "s23_meth,s23_srvr,s23_clnt,s23_lib, s23_pkt,"+ -
- "t1_meth, t1_srvr, t1_clnt, t1_lib, t1_enc, t1_ext,"+ -
- "d1_meth, d1_srvr, d1_clnt, d1_lib, d1_pkt,"+ -
- "d1_both,d1_srtp,"+ -
- "ssl_lib,ssl_err2,ssl_cert,ssl_sess,"+ -
- "ssl_ciph,ssl_stat,ssl_rsa,"+ -
- "ssl_asn1,ssl_txt,ssl_algs,ssl_conf,"+ -
- "bio_ssl,ssl_err,kssl,t1_reneg,tls_srp,t1_trce,ssl_utst"
-$!
-$ COMPILEWITH_CC5 = ""
-$!
-$! Tell The User That We Are Compiling The Library.
-$!
-$ WRITE SYS$OUTPUT "Building The ",SSL_LIB," Library."
-$!
-$! Define A File Counter And Set It To "0"
-$!
-$ FILE_COUNTER = 0
-$!
-$! Top Of The File Loop.
-$!
-$ NEXT_FILE:
-$!
-$! O.K, Extract The File Name From The File List.
-$!
-$ FILE_NAME = F$EDIT(F$ELEMENT(FILE_COUNTER,",",LIB_SSL),"COLLAPSE")
-$!
-$! Check To See If We Are At The End Of The File List.
-$!
-$ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE
-$!
-$! Increment The Counter.
-$!
-$ FILE_COUNTER = FILE_COUNTER + 1
-$!
-$! Create The Source File Name.
-$!
-$ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C"
-$!
-$! Create The Object File Name.
-$!
-$ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ"
-$ ON WARNING THEN GOTO NEXT_FILE
-$!
-$! Check To See If The File We Want To Compile Is Actually There.
-$!
-$ IF (F$SEARCH(SOURCE_FILE).EQS."")
-$ THEN
-$!
-$! Tell The User That The File Dosen't Exist.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Exit The Build.
-$!
-$ EXIT
-$!
-$! End The File Exists Check.
-$!
-$ ENDIF
-$!
-$! Tell The User What File We Are Compiling.
-$!
-$ WRITE SYS$OUTPUT " ",FILE_NAME,".c"
-$!
-$! Compile The File.
-$!
-$ ON ERROR THEN GOTO NEXT_FILE
-$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
-$!
-$! Add It To The Library.
-$!
-$ LIBRARY/REPLACE/OBJECT 'SSL_LIB' 'OBJECT_FILE'
-$!
-$! Time To Clean Up The Object File.
-$!
-$ DELETE 'OBJECT_FILE';*
-$!
-$! Go Back And Get The Next File Name.
-$!
-$ GOTO NEXT_FILE
-$!
-$! All Done With This Library.
-$!
-$ FILE_DONE:
-$!
-$! Tell The User That We Are All Done.
-$!
-$ WRITE SYS$OUTPUT "Library ",SSL_LIB," Compiled."
-$!
-$! Time To RETURN.
-$!
-$ RETURN
-$ SSL_TASK:
-$!
-$! Check To See If We Have The Proper Libraries.
-$!
-$ GOSUB LIB_CHECK
-$!
-$! Check To See If We Have A Linker Option File.
-$!
-$ GOSUB CHECK_OPT_FILE
-$!
-$! Check To See If The File We Want To Compile Is Actually There.
-$!
-$ IF (F$SEARCH("SYS$DISK:[]SSL_TASK.C").EQS."")
-$ THEN
-$!
-$! Tell The User That The File Dosen't Exist.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The File SSL_TASK.C Dosen't Exist."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Exit The Build.
-$!
-$ EXIT
-$!
-$! End The SSL_TASK.C File Check.
-$!
-$ ENDIF
-$!
-$ COMPILEWITH_CC5 = "" !!! ",ssl_task,"
-$!
-$! Tell The User We Are Creating The SSL_TASK.
-$!
-$! Tell The User We Are Creating The SSL_TASK.
-$!
-$ WRITE SYS$OUTPUT "Creating SSL_TASK OSU HTTP SSL Engine."
-$!
-$! Tell The User What File We Are Compiling.
-$!
-$ FILE_NAME = "ssl_task"
-$ WRITE SYS$OUTPUT " ",FILE_NAME,".c"
-$!
-$! Compile The File.
-$!
-$ ON ERROR THEN GOTO SSL_TASK_END
-$!
-$ FILE_NAME0 = ","+ F$ELEMENT(0,".",FILE_NAME)+ ","
-$ IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5
-$ THEN
-$ if (.not. CC5_SHOWN)
-$ then
-$ CC5_SHOWN = 1
-$ write sys$output " \Using special rule (5)"
-$ x = " "+ CC5
-$ write /symbol sys$output x
-$ endif
-$ CC5 /OBJECT='OBJ_DIR''FILE_NAME'.OBJ SYS$DISK:[]'FILE_NAME'.C
-$ ELSE
-$ CC /OBJECT='OBJ_DIR''FILE_NAME'.OBJ SYS$DISK:[]'FILE_NAME'.C
-$ ENDIF
-$!
-$! Link The Program.
-$!
-$ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /EXE='EXE_DIR'SSL_TASK.EXE -
- 'OBJ_DIR'SSL_TASK.OBJ, -
- 'SSL_LIB'/LIBRARY, -
- 'CRYPTO_LIB'/LIBRARY -
- 'TCPIP_LIB' -
- 'ZLIB_LIB' -
- ,'OPT_FILE' /OPTIONS
-$!
-$! Time To Return.
-$!
-$SSL_TASK_END:
-$ RETURN
-$!
-$! Check For The Link Option FIle.
-$!
-$ CHECK_OPT_FILE:
-$!
-$! Check To See If We Need To Make A VAX C Option File.
-$!
-$ IF (COMPILER.EQS."VAXC")
-$ THEN
-$!
-$! Check To See If We Already Have A VAX C Linker Option File.
-$!
-$ IF (F$SEARCH(OPT_FILE).EQS."")
-$ THEN
-$!
-$! We Need A VAX C Linker Option File.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File To Link Against
-! The Sharable VAX C Runtime Library.
-!
-SYS$SHARE:VAXCRTL.EXE/SHARE
-$EOD
-$!
-$! End The Option File Check.
-$!
-$ ENDIF
-$!
-$! End The VAXC Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Need A GNU C Option File.
-$!
-$ IF (COMPILER.EQS."GNUC")
-$ THEN
-$!
-$! Check To See If We Already Have A GNU C Linker Option File.
-$!
-$ IF (F$SEARCH(OPT_FILE).EQS."")
-$ THEN
-$!
-$! We Need A GNU C Linker Option File.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File To Link Against
-! The Sharable C Runtime Library.
-!
-GNU_CC:[000000]GCCLIB/LIBRARY
-SYS$SHARE:VAXCRTL/SHARE
-$EOD
-$!
-$! End The Option File Check.
-$!
-$ ENDIF
-$!
-$! End The GNU C Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Need A DEC C Option File.
-$!
-$ IF (COMPILER.EQS."DECC")
-$ THEN
-$!
-$! Check To See If We Already Have A DEC C Linker Option File.
-$!
-$ IF (F$SEARCH(OPT_FILE).EQS."")
-$ THEN
-$!
-$! Figure Out If We Need A non-VAX Or A VAX Linker Option File.
-$!
-$ IF (ARCH.EQS."VAX")
-$ THEN
-$!
-$! We Need A DEC C Linker Option File For VAX.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File To Link Against
-! The Sharable DEC C Runtime Library.
-!
-SYS$SHARE:DECC$SHR.EXE/SHARE
-$EOD
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Create The non-VAX Linker Option File.
-$!
-$ CREATE 'OPT_FILE'
-$DECK
-!
-! Default System Options File For non-VAX To Link Against
-! The Sharable C Runtime Library.
-!
-SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
-SYS$SHARE:CMA$OPEN_RTL/SHARE
-$EOD
-$!
-$! End The DEC C Option File Check.
-$!
-$ ENDIF
-$!
-$! End The Option File Search.
-$!
-$ ENDIF
-$!
-$! End The DEC C Check.
-$!
-$ ENDIF
-$!
-$! Tell The User What Linker Option File We Are Using.
-$!
-$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
-$!
-$! Time To RETURN.
-$!
-$ RETURN
-$ LIB_CHECK:
-$!
-$! Look For The VAX Library LIBSSL.OLB.
-$!
-$ IF (F$SEARCH(SSL_LIB).EQS."")
-$ THEN
-$!
-$! Tell The User We Can't Find The LIBSSL.OLB Library.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"."
-$ WRITE SYS$OUTPUT "We Can't Link Without It."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Since We Can't Link Without It, Exit.
-$!
-$ EXIT
-$!
-$! End The LIBSSL.OLB Library Check.
-$!
-$ ENDIF
-$!
-$! Look For The Library LIBCRYPTO.OLB.
-$!
-$ IF (F$SEARCH(CRYPTO_LIB).EQS."")
-$ THEN
-$!
-$! Tell The User We Can't Find The LIBCRYPTO.OLB Library.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"."
-$ WRITE SYS$OUTPUT "We Can't Link Without It."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Since We Can't Link Without It, Exit.
-$!
-$ EXIT
-$!
-$! End The LIBCRYPTO.OLB Library Check.
-$!
-$ ENDIF
-$!
-$! Time To Return.
-$!
-$ RETURN
-$!
-$! Check The User's Options.
-$!
-$ CHECK_OPTIONS:
-$!
-$! Check To See If P1 Is Blank.
-$!
-$ IF (P1.EQS."ALL")
-$ THEN
-$!
-$! P1 Is Blank, So Build Everything.
-$!
-$ BUILDALL = "TRUE"
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Else, Check To See If P1 Has A Valid Argument.
-$!
-$ IF (P1.EQS."LIBRARY").OR.(P1.EQS."SSL_TASK")
-$ THEN
-$!
-$! A Valid Argument.
-$!
-$ BUILDALL = P1
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Tell The User We Don't Know What They Want.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " ALL : Just Build Everything."
-$ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.SSL]LIBSSL.OLB Library."
-$ WRITE SYS$OUTPUT " SSL_TASK : To Compile Just The [.xxx.EXE.SSL]SSL_TASK.EXE Program."
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " Where 'xxx' Stands For:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " ALPHA[64]: Alpha Architecture."
-$ WRITE SYS$OUTPUT " IA64[64] : IA64 Architecture."
-$ WRITE SYS$OUTPUT " VAX : VAX Architecture."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$! End The Valid Argument Check.
-$!
-$ ENDIF
-$!
-$! End The P1 Check.
-$!
-$ ENDIF
-$!
-$! Check To See If P2 Is Blank.
-$!
-$ IF (P2.EQS."NODEBUG")
-$ THEN
-$!
-$! P2 Is NODEBUG, So Compile Without Debugger Information.
-$!
-$ DEBUGGER = "NODEBUG"
-$ LINKMAP = "NOMAP"
-$ TRACEBACK = "NOTRACEBACK"
-$ GCC_OPTIMIZE = "OPTIMIZE"
-$ CC_OPTIMIZE = "OPTIMIZE"
-$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
-$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Check To See If We Are To Compile With Debugger Information.
-$!
-$ IF (P2.EQS."DEBUG")
-$ THEN
-$!
-$! Compile With Debugger Information.
-$!
-$ DEBUGGER = "DEBUG"
-$ LINKMAP = "MAP"
-$ TRACEBACK = "TRACEBACK"
-$ GCC_OPTIMIZE = "NOOPTIMIZE"
-$ CC_OPTIMIZE = "NOOPTIMIZE"
-$ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
-$ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
-$ ELSE
-$!
-$! Tell The User Entered An Invalid Option.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
-$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$! End The Valid Argument Check.
-$!
-$ ENDIF
-$!
-$! End The P2 Check.
-$!
-$ ENDIF
-$!
-$! Special Threads For OpenVMS v7.1 Or Later
-$!
-$! Written By: Richard Levitte
-$! richard@levitte.org
-$!
-$!
-$! Check To See If We Have A Option For P5.
-$!
-$ IF (P5.EQS."")
-$ THEN
-$!
-$! Get The Version Of VMS We Are Using.
-$!
-$ ISSEVEN :=
-$ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
-$ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
-$!
-$! Check To See If The VMS Version Is v7.1 Or Later.
-$!
-$ IF (TMP.GE.71)
-$ THEN
-$!
-$! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
-$!
-$ ISSEVEN := ,PTHREAD_USE_D4
-$!
-$! End The VMS Version Check.
-$!
-$ ENDIF
-$!
-$! End The P5 Check.
-$!
-$ ENDIF
-$!
-$! Check P6 (POINTER_SIZE).
-$!
-$ IF (P6 .NES. "") .AND. (ARCH .NES. "VAX")
-$ THEN
-$!
-$ IF (P6 .EQS. "32")
-$ THEN
-$ POINTER_SIZE = " /POINTER_SIZE=32"
-$ ELSE
-$ POINTER_SIZE = F$EDIT( P6, "COLLAPSE, UPCASE")
-$ IF ((POINTER_SIZE .EQS. "64") .OR. -
- (POINTER_SIZE .EQS. "64=") .OR. -
- (POINTER_SIZE .EQS. "64=ARGV"))
-$ THEN
-$ ARCHD = ARCH+ "_64"
-$ LIB32 = ""
-$ POINTER_SIZE = " /POINTER_SIZE=64"
-$ ELSE
-$!
-$! Tell The User Entered An Invalid Option.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ", P6, -
- " Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT -
- " """" : Compile with default (short) pointers."
-$ WRITE SYS$OUTPUT -
- " 32 : Compile with 32-bit (short) pointers."
-$ WRITE SYS$OUTPUT -
- " 64 : Compile with 64-bit (long) pointers (auto ARGV)."
-$ WRITE SYS$OUTPUT -
- " 64= : Compile with 64-bit (long) pointers (no ARGV)."
-$ WRITE SYS$OUTPUT -
- " 64=ARGV : Compile with 64-bit (long) pointers (ARGV)."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$ ENDIF
-$!
-$ ENDIF
-$!
-$! End The P6 (POINTER_SIZE) Check.
-$!
-$ ENDIF
-$!
-$! Set basic C compiler /INCLUDE directories.
-$!
-$ CC_INCLUDES = "SYS$DISK:[-.CRYPTO],SYS$DISK:[-]"
-$!
-$! Check To See If P3 Is Blank.
-$!
-$ IF (P3.EQS."")
-$ THEN
-$!
-$! O.K., The User Didn't Specify A Compiler, Let's Try To
-$! Find Out Which One To Use.
-$!
-$! Check To See If We Have GNU C.
-$!
-$ IF (F$TRNLNM("GNU_CC").NES."")
-$ THEN
-$!
-$! Looks Like GNUC, Set To Use GNUC.
-$!
-$ P3 = "GNUC"
-$!
-$! End The GNU C Compiler Check.
-$!
-$ ELSE
-$!
-$! Check To See If We Have VAXC Or DECC.
-$!
-$ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
-$ THEN
-$!
-$! Looks Like DECC, Set To Use DECC.
-$!
-$ P3 = "DECC"
-$!
-$! Else...
-$!
-$ ELSE
-$!
-$! Looks Like VAXC, Set To Use VAXC.
-$!
-$ P3 = "VAXC"
-$!
-$! End The VAXC Compiler Check.
-$!
-$ ENDIF
-$!
-$! End The DECC & VAXC Compiler Check.
-$!
-$ ENDIF
-$!
-$! End The Compiler Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Have A Option For P4.
-$!
-$ IF (P4.EQS."")
-$ THEN
-$!
-$! Find out what socket library we have available
-$!
-$ IF F$PARSE("SOCKETSHR:") .NES. ""
-$ THEN
-$!
-$! We have SOCKETSHR, and it is my opinion that it's the best to use.
-$!
-$ P4 = "SOCKETSHR"
-$!
-$! Tell the user
-$!
-$ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
-$!
-$! Else, let's look for something else
-$!
-$ ELSE
-$!
-$! Like UCX (the reason to do this before Multinet is that the UCX
-$! emulation is easier to use...)
-$!
-$ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
- .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
- .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
-$ THEN
-$!
-$! Last resort: a UCX or UCX-compatible library
-$!
-$ P4 = "UCX"
-$!
-$! Tell the user
-$!
-$ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
-$!
-$! That was all...
-$!
-$ ENDIF
-$ ENDIF
-$ ENDIF
-$!
-$! Set Up Initial CC Definitions, Possibly With User Ones
-$!
-$ CCDEFS = "TCPIP_TYPE_''P4'"
-$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
-$ CCEXTRAFLAGS = ""
-$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
-$ CCDISABLEWARNINGS = "" !!! "MAYLOSEDATA3" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
-$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. ""
-$ THEN
-$ IF CCDISABLEWARNINGS .NES. THEN CCDISABLEWARNINGS = CCDISABLEWARNINGS + ","
-$ CCDISABLEWARNINGS = CCDISABLEWARNINGS + USER_CCDISABLEWARNINGS
-$ ENDIF
-$!
-$! Check To See If We Have A ZLIB Option.
-$!
-$ ZLIB = P7
-$ IF (ZLIB .NES. "")
-$ THEN
-$!
-$! Check for expected ZLIB files.
-$!
-$ err = 0
-$ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY")
-$ if (f$search( file1) .eqs. "")
-$ then
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
-$ WRITE SYS$OUTPUT " Can't find header: ''file1'"
-$ err = 1
-$ endif
-$ file1 = f$parse( "A.;", ZLIB)- "A.;"
-$!
-$ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY")
-$ if (f$search( file2) .eqs. "")
-$ then
-$ if (err .eq. 0)
-$ then
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
-$ endif
-$ WRITE SYS$OUTPUT " Can't find library: ''file2'"
-$ WRITE SYS$OUTPUT ""
-$ err = err+ 2
-$ endif
-$ if (err .eq. 1)
-$ then
-$ WRITE SYS$OUTPUT ""
-$ endif
-$!
-$ if (err .ne. 0)
-$ then
-$ EXIT
-$ endif
-$!
-$ CCDEFS = """ZLIB=1"", "+ CCDEFS
-$ CC_INCLUDES = CC_INCLUDES+ ", "+ file1
-$ ZLIB_LIB = ", ''file2' /library"
-$!
-$! Print info
-$!
-$ WRITE SYS$OUTPUT "ZLIB library spec: ", file2
-$!
-$! End The ZLIB Check.
-$!
-$ ENDIF
-$!
-$! Check To See If The User Entered A Valid Parameter.
-$!
-$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
-$ THEN
-$!
-$! Check To See If The User Wanted DECC.
-$!
-$ IF (P3.EQS."DECC")
-$ THEN
-$!
-$! Looks Like DECC, Set To Use DECC.
-$!
-$ COMPILER = "DECC"
-$!
-$! Tell The User We Are Using DECC.
-$!
-$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
-$!
-$! Use DECC...
-$!
-$ CC = "CC"
-$ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
- THEN CC = "CC/DECC"
-$ CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ -
- "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + -
- " /INCLUDE=(''CC_INCLUDES') " + CCEXTRAFLAGS
-$!
-$! Define The Linker Options File Name.
-$!
-$ OPT_FILE = "VAX_DECC_OPTIONS.OPT"
-$!
-$! End DECC Check.
-$!
-$ ENDIF
-$!
-$! Check To See If We Are To Use VAXC.
-$!
-$ IF (P3.EQS."VAXC")
-$ THEN
-$!
-$! Looks Like VAXC, Set To Use VAXC.
-$!
-$ COMPILER = "VAXC"
-$!
-$! Tell The User We Are Using VAX C.
-$!
-$ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
-$!
-$! Compile Using VAXC.
-$!
-$ CC = "CC"
-$ IF ARCH.NES."VAX"
-$ THEN
-$ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
-$ EXIT
-$ ENDIF
-$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
-$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
- "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
-$ CCDEFS = CCDEFS + ",""VAXC"""
-$!
-$! Define <sys> As SYS$COMMON:[SYSLIB]
-$!
-$ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
-$!
-$! Define The Linker Options File Name.
-$!
-$ OPT_FILE = "VAX_VAXC_OPTIONS.OPT"
-$!
-$! End VAXC Check
-$!
-$ ENDIF
-$!
-$! Check To See If We Are To Use GNU C.
-$!
-$ IF (P3.EQS."GNUC")
-$ THEN
-$!
-$! Looks Like GNUC, Set To Use GNUC.
-$!
-$ COMPILER = "GNUC"
-$!
-$! Tell The User We Are Using GNUC.
-$!
-$ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
-$!
-$! Use GNU C...
-$!
-$ IF F$TYPE(GCC) .EQS. "" THEN GCC := GCC
-$ CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
- "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
-$!
-$! Define The Linker Options File Name.
-$!
-$ OPT_FILE = "VAX_GNUC_OPTIONS.OPT"
-$!
-$! End The GNU C Check.
-$!
-$ ENDIF
-$!
-$! Set up default defines
-$!
-$ CCDEFS = """FLAT_INC=1""," + CCDEFS
-$!
-$! Finish up the definition of CC.
-$!
-$ IF COMPILER .EQS. "DECC"
-$ THEN
-$! Not all compiler versions support MAYLOSEDATA3.
-$ OPT_TEST = "MAYLOSEDATA3"
-$ DEFINE /USER_MODE SYS$ERROR NL:
-$ DEFINE /USER_MODE SYS$OUTPUT NL:
-$ 'CC' /NOCROSS_REFERENCE /NOLIST /NOOBJECT -
- /WARNINGS = DISABLE = ('OPT_TEST', EMPTYFILE) NL:
-$ IF ($SEVERITY)
-$ THEN
-$ IF CCDISABLEWARNINGS .NES. "" THEN -
- CCDISABLEWARNINGS = CCDISABLEWARNINGS+ ","
-$ CCDISABLEWARNINGS = CCDISABLEWARNINGS+ OPT_TEST
-$ ENDIF
-$ IF CCDISABLEWARNINGS .EQS. ""
-$ THEN
-$ CC4DISABLEWARNINGS = "DOLLARID"
-$ ELSE
-$ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
-$ CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
-$ ENDIF
-$ CC4DISABLEWARNINGS = " /WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
-$ ELSE
-$ CCDISABLEWARNINGS = ""
-$ CC4DISABLEWARNINGS = ""
-$ ENDIF
-$ CC2 = CC + " /DEFINE=(" + CCDEFS + ",_POSIX_C_SOURCE)" + CCDISABLEWARNINGS
-$ CC3 = CC + " /DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS
-$ CC = CC + " /DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
-$ IF COMPILER .EQS. "DECC"
-$ THEN
-$ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
-$ CC5 = CC3 - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
-$ ELSE
-$ CC4 = CC
-$ CC5 = CC3
-$ ENDIF
-$!
-$! Show user the result
-$!
-$ WRITE/SYMBOL SYS$OUTPUT "Main Compiling Command: ",CC
-$!
-$! Else The User Entered An Invalid Argument.
-$!
-$ ELSE
-$!
-$! Tell The User We Don't Know What They Want.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
-$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
-$ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$ ENDIF
-$!
-$! Time to check the contents, and to make sure we get the correct library.
-$!
-$ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" -
- .OR. P4.EQS."TCPIP" .OR. P4.EQS."NONE"
-$ THEN
-$!
-$! Check to see if SOCKETSHR was chosen
-$!
-$ IF P4.EQS."SOCKETSHR"
-$ THEN
-$!
-$! Set the library to use SOCKETSHR
-$!
-$ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS"
-$!
-$! Done with SOCKETSHR
-$!
-$ ENDIF
-$!
-$! Check to see if MULTINET was chosen
-$!
-$ IF P4.EQS."MULTINET"
-$ THEN
-$!
-$! Set the library to use UCX emulation.
-$!
-$ P4 = "UCX"
-$!
-$! Done with MULTINET
-$!
-$ ENDIF
-$!
-$! Check to see if UCX was chosen
-$!
-$ IF P4.EQS."UCX"
-$ THEN
-$!
-$! Set the library to use UCX.
-$!
-$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS"
-$ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
-$ THEN
-$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS"
-$ ELSE
-$ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
- TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS"
-$ ENDIF
-$!
-$! Done with UCX
-$!
-$ ENDIF
-$!
-$! Check to see if TCPIP was chosen
-$!
-$ IF P4.EQS."TCPIP"
-$ THEN
-$!
-$! Set the library to use TCPIP (post UCX).
-$!
-$ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS"
-$!
-$! Done with TCPIP
-$!
-$ ENDIF
-$!
-$! Check to see if NONE was chosen
-$!
-$ IF P4.EQS."NONE"
-$ THEN
-$!
-$! Do not use a TCPIP library.
-$!
-$ TCPIP_LIB = ""
-$!
-$! Done with NONE
-$!
-$ ENDIF
-$!
-$! Print info
-$!
-$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- ","
-$!
-$! Else The User Entered An Invalid Argument.
-$!
-$ ELSE
-$!
-$! Tell The User We Don't Know What They Want.
-$!
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
-$ WRITE SYS$OUTPUT ""
-$ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
-$ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
-$ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
-$ WRITE SYS$OUTPUT ""
-$!
-$! Time To EXIT.
-$!
-$ EXIT
-$!
-$! Done with TCP/IP libraries
-$!
-$ ENDIF
-$!
-$! Time To RETURN...
-$!
-$ RETURN
-$!
-$ INITIALISE:
-$!
-$! Save old value of the logical name OPENSSL
-$!
-$ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
-$!
-$! Save directory information
-$!
-$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
-$ __HERE = F$EDIT(__HERE,"UPCASE")
-$ __TOP = __HERE - "SSL]"
-$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
-$!
-$! Set up the logical name OPENSSL to point at the include directory
-$!
-$ DEFINE OPENSSL/NOLOG '__INCLUDE'
-$!
-$! Done
-$!
-$ RETURN
-$!
-$ CLEANUP:
-$!
-$! Restore the logical name OPENSSL if it had a value
-$!
-$ IF __SAVE_OPENSSL .EQS. ""
-$ THEN
-$ DEASSIGN OPENSSL
-$ ELSE
-$ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL'
-$ ENDIF
-$!
-$! Done
-$!
-$ RETURN
diff --git a/thirdparty/openssl/ssl/ssl_asn1.c b/thirdparty/openssl/ssl/ssl_asn1.c
index 35cc27c5e9..499f0e85ad 100644
--- a/thirdparty/openssl/ssl/ssl_asn1.c
+++ b/thirdparty/openssl/ssl/ssl_asn1.c
@@ -527,6 +527,9 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
if (os.length > SSL_MAX_SID_CTX_LENGTH) {
c.error = SSL_R_BAD_LENGTH;
c.line = __LINE__;
+ OPENSSL_free(os.data);
+ os.data = NULL;
+ os.length = 0;
goto err;
} else {
ret->sid_ctx_length = os.length;
diff --git a/thirdparty/openssl/ssl/ssl_cert.c b/thirdparty/openssl/ssl/ssl_cert.c
index f48ebaecc0..155728d037 100644
--- a/thirdparty/openssl/ssl/ssl_cert.c
+++ b/thirdparty/openssl/ssl/ssl_cert.c
@@ -315,7 +315,7 @@ CERT *ssl_cert_dup(CERT *cert)
OPENSSL_malloc(cert->pkeys[i].serverinfo_length);
if (ret->pkeys[i].serverinfo == NULL) {
SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_MALLOC_FAILURE);
- return NULL;
+ goto err;
}
ret->pkeys[i].serverinfo_length =
cert->pkeys[i].serverinfo_length;
@@ -392,9 +392,7 @@ CERT *ssl_cert_dup(CERT *cert)
return (ret);
-#if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_ECDH)
err:
-#endif
#ifndef OPENSSL_NO_RSA
if (ret->rsa_tmp != NULL)
RSA_free(ret->rsa_tmp);
@@ -414,6 +412,7 @@ CERT *ssl_cert_dup(CERT *cert)
#endif
ssl_cert_clear_certs(ret);
+ OPENSSL_free(ret);
return NULL;
}
diff --git a/thirdparty/openssl/ssl/ssl_ciph.c b/thirdparty/openssl/ssl/ssl_ciph.c
index 302464e643..40021329a9 100644
--- a/thirdparty/openssl/ssl/ssl_ciph.c
+++ b/thirdparty/openssl/ssl/ssl_ciph.c
@@ -1932,17 +1932,27 @@ SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n)
}
#ifdef OPENSSL_NO_COMP
-void *SSL_COMP_get_compression_methods(void)
+STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void)
+{
+ return NULL;
+}
+
+STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)
+ *meths)
{
return NULL;
}
-int SSL_COMP_add_compression_method(int id, void *cm)
+void SSL_COMP_free_compression_methods(void)
+{
+}
+
+int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
{
return 1;
}
-const char *SSL_COMP_get_name(const void *comp)
+const char *SSL_COMP_get_name(const COMP_METHOD *comp)
{
return NULL;
}
@@ -1991,13 +2001,19 @@ int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
if (id < 193 || id > 255) {
SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,
SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);
- return 0;
+ return 1;
}
MemCheck_off();
comp = (SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
+ if (comp == NULL) {
+ MemCheck_on();
+ SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD, ERR_R_MALLOC_FAILURE);
+ return 1;
+ }
comp->id = id;
comp->method = cm;
+ comp->name = cm->name;
load_builtin_compressions();
if (ssl_comp_methods && sk_SSL_COMP_find(ssl_comp_methods, comp) >= 0) {
OPENSSL_free(comp);
diff --git a/thirdparty/openssl/ssl/ssl_err.c b/thirdparty/openssl/ssl/ssl_err.c
index 704088dc46..a4c17a6bf3 100644
--- a/thirdparty/openssl/ssl/ssl_err.c
+++ b/thirdparty/openssl/ssl/ssl_err.c
@@ -1,6 +1,6 @@
/* ssl/ssl_err.c */
/* ====================================================================
- * Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2016 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -93,6 +93,8 @@ static ERR_STRING_DATA SSL_str_functs[] = {
{ERR_FUNC(SSL_F_DTLS1_HEARTBEAT), "dtls1_heartbeat"},
{ERR_FUNC(SSL_F_DTLS1_OUTPUT_CERT_CHAIN), "dtls1_output_cert_chain"},
{ERR_FUNC(SSL_F_DTLS1_PREPROCESS_FRAGMENT), "DTLS1_PREPROCESS_FRAGMENT"},
+ {ERR_FUNC(SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS),
+ "DTLS1_PROCESS_BUFFERED_RECORDS"},
{ERR_FUNC(SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE),
"DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE"},
{ERR_FUNC(SSL_F_DTLS1_PROCESS_RECORD), "DTLS1_PROCESS_RECORD"},
@@ -751,6 +753,7 @@ static ERR_STRING_DATA SSL_str_reasons[] = {
"tls illegal exporter label"},
{ERR_REASON(SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST),
"tls invalid ecpointformat list"},
+ {ERR_REASON(SSL_R_TOO_MANY_WARN_ALERTS), "too many warn alerts"},
{ERR_REASON(SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST),
"tls peer did not respond with certificate list"},
{ERR_REASON(SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG),
diff --git a/thirdparty/openssl/ssl/ssl_lib.c b/thirdparty/openssl/ssl/ssl_lib.c
index fd94325bb3..24be376c9f 100644
--- a/thirdparty/openssl/ssl/ssl_lib.c
+++ b/thirdparty/openssl/ssl/ssl_lib.c
@@ -1828,7 +1828,7 @@ int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
const unsigned char *p, size_t plen,
int use_context)
{
- if (s->version < TLS1_VERSION)
+ if (s->version < TLS1_VERSION && s->version != DTLS1_BAD_VER)
return -1;
return s->method->ssl3_enc->export_keying_material(s, out, olen, label,
@@ -1838,13 +1838,21 @@ int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
static unsigned long ssl_session_hash(const SSL_SESSION *a)
{
+ const unsigned char *session_id = a->session_id;
unsigned long l;
+ unsigned char tmp_storage[4];
+
+ if (a->session_id_length < sizeof(tmp_storage)) {
+ memset(tmp_storage, 0, sizeof(tmp_storage));
+ memcpy(tmp_storage, a->session_id, a->session_id_length);
+ session_id = tmp_storage;
+ }
l = (unsigned long)
- ((unsigned int)a->session_id[0]) |
- ((unsigned int)a->session_id[1] << 8L) |
- ((unsigned long)a->session_id[2] << 16L) |
- ((unsigned long)a->session_id[3] << 24L);
+ ((unsigned long)session_id[0]) |
+ ((unsigned long)session_id[1] << 8L) |
+ ((unsigned long)session_id[2] << 16L) |
+ ((unsigned long)session_id[3] << 24L);
return (l);
}
@@ -2000,7 +2008,7 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth)
ret->tlsext_servername_callback = 0;
ret->tlsext_servername_arg = NULL;
/* Setup RFC4507 ticket keys */
- if ((RAND_pseudo_bytes(ret->tlsext_tick_key_name, 16) <= 0)
+ if ((RAND_bytes(ret->tlsext_tick_key_name, 16) <= 0)
|| (RAND_bytes(ret->tlsext_tick_hmac_key, 16) <= 0)
|| (RAND_bytes(ret->tlsext_tick_aes_key, 16) <= 0))
ret->options |= SSL_OP_NO_TICKET;
@@ -2030,10 +2038,8 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth)
ret->rbuf_freelist->len = 0;
ret->rbuf_freelist->head = NULL;
ret->wbuf_freelist = OPENSSL_malloc(sizeof(SSL3_BUF_FREELIST));
- if (!ret->wbuf_freelist) {
- OPENSSL_free(ret->rbuf_freelist);
+ if (!ret->wbuf_freelist)
goto err;
- }
ret->wbuf_freelist->chunklen = 0;
ret->wbuf_freelist->len = 0;
ret->wbuf_freelist->head = NULL;
@@ -3050,12 +3056,12 @@ const SSL_CIPHER *SSL_get_current_cipher(const SSL *s)
}
#ifdef OPENSSL_NO_COMP
-const void *SSL_get_current_compression(SSL *s)
+const COMP_METHOD *SSL_get_current_compression(SSL *s)
{
return NULL;
}
-const void *SSL_get_current_expansion(SSL *s)
+const COMP_METHOD *SSL_get_current_expansion(SSL *s)
{
return NULL;
}
@@ -3188,6 +3194,9 @@ SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx)
ssl->cert->alpn_proposed_len = ocert->alpn_proposed_len;
ocert->alpn_proposed = NULL;
ssl->cert->alpn_sent = ocert->alpn_sent;
+
+ if (!custom_exts_copy_flags(&ssl->cert->srv_ext, &ocert->srv_ext))
+ return NULL;
#endif
ssl_cert_free(ocert);
}
diff --git a/thirdparty/openssl/ssl/ssl_locl.h b/thirdparty/openssl/ssl/ssl_locl.h
index 747e718a52..aeffc00634 100644
--- a/thirdparty/openssl/ssl/ssl_locl.h
+++ b/thirdparty/openssl/ssl/ssl_locl.h
@@ -491,6 +491,12 @@
# define SSL_CLIENT_USE_TLS1_2_CIPHERS(s) \
((SSL_IS_DTLS(s) && s->client_version <= DTLS1_2_VERSION) || \
(!SSL_IS_DTLS(s) && s->client_version >= TLS1_2_VERSION))
+/*
+ * Determine if a client should send signature algorithms extension:
+ * as with TLS1.2 cipher we can't rely on method flags.
+ */
+# define SSL_CLIENT_USE_SIGALGS(s) \
+ SSL_CLIENT_USE_TLS1_2_CIPHERS(s)
/* Mostly for SSLv3 */
# define SSL_PKEY_RSA_ENC 0
@@ -585,6 +591,8 @@ typedef struct {
*/
# define SSL_EXT_FLAG_SENT 0x2
+# define MAX_WARN_ALERT_COUNT 5
+
typedef struct {
custom_ext_method *meths;
size_t meths_count;
@@ -692,6 +700,8 @@ typedef struct cert_st {
unsigned char *alpn_proposed; /* server */
unsigned int alpn_proposed_len;
int alpn_sent; /* client */
+ /* Count of the number of consecutive warning alerts received */
+ unsigned int alert_count;
} CERT;
typedef struct sess_cert_st {
@@ -1148,7 +1158,7 @@ long ssl2_default_timeout(void);
const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p);
int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p);
-void ssl3_init_finished_mac(SSL *s);
+int ssl3_init_finished_mac(SSL *s);
int ssl3_send_server_certificate(SSL *s);
int ssl3_send_newsession_ticket(SSL *s);
int ssl3_send_cert_status(SSL *s);
@@ -1242,7 +1252,8 @@ int dtls1_retransmit_message(SSL *s, unsigned short seq,
unsigned long frag_off, int *found);
int dtls1_get_queue_priority(unsigned short seq, int is_ccs);
int dtls1_retransmit_buffered_messages(SSL *s);
-void dtls1_clear_record_buffer(SSL *s);
+void dtls1_clear_received_buffer(SSL *s);
+void dtls1_clear_sent_buffer(SSL *s);
void dtls1_get_message_header(unsigned char *data,
struct hm_header_st *msg_hdr);
void dtls1_get_ccs_header(unsigned char *data, struct ccs_header_st *ccs_hdr);
@@ -1373,7 +1384,7 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf,
int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **data,
unsigned char *limit);
int tls1_set_server_sigalgs(SSL *s);
-int ssl_check_clienthello_tlsext_late(SSL *s);
+int ssl_check_clienthello_tlsext_late(SSL *s, int *al);
int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **data,
unsigned char *d, int n);
int ssl_prepare_clienthello_tlsext(SSL *s);
@@ -1419,7 +1430,7 @@ int ssl_parse_clienthello_renegotiate_ext(SSL *s, unsigned char *d, int len,
long ssl_get_algorithm2(SSL *s);
int tls1_save_sigalgs(SSL *s, const unsigned char *data, int dsize);
int tls1_process_sigalgs(SSL *s);
-size_t tls12_get_psigalgs(SSL *s, const unsigned char **psigs);
+size_t tls12_get_psigalgs(SSL *s, int sent, const unsigned char **psigs);
int tls12_check_peer_sigalg(const EVP_MD **pmd, SSL *s,
const unsigned char *sig, EVP_PKEY *pkey);
void ssl_set_client_disabled(SSL *s);
@@ -1471,6 +1482,8 @@ int custom_ext_add(SSL *s, int server,
unsigned char **pret, unsigned char *limit, int *al);
int custom_exts_copy(custom_ext_methods *dst, const custom_ext_methods *src);
+int custom_exts_copy_flags(custom_ext_methods *dst,
+ const custom_ext_methods *src);
void custom_exts_free(custom_ext_methods *exts);
# else
diff --git a/thirdparty/openssl/ssl/ssl_rsa.c b/thirdparty/openssl/ssl/ssl_rsa.c
index 82022470bf..af03d45c2e 100644
--- a/thirdparty/openssl/ssl/ssl_rsa.c
+++ b/thirdparty/openssl/ssl/ssl_rsa.c
@@ -912,6 +912,8 @@ static int serverinfo_process_buffer(const unsigned char *serverinfo,
int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
size_t serverinfo_length)
{
+ unsigned char *new_serverinfo;
+
if (ctx == NULL || serverinfo == NULL || serverinfo_length == 0) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO, ERR_R_PASSED_NULL_PARAMETER);
return 0;
@@ -928,12 +930,13 @@ int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO, ERR_R_INTERNAL_ERROR);
return 0;
}
- ctx->cert->key->serverinfo = OPENSSL_realloc(ctx->cert->key->serverinfo,
- serverinfo_length);
- if (ctx->cert->key->serverinfo == NULL) {
+ new_serverinfo = OPENSSL_realloc(ctx->cert->key->serverinfo,
+ serverinfo_length);
+ if (new_serverinfo == NULL) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO, ERR_R_MALLOC_FAILURE);
return 0;
}
+ ctx->cert->key->serverinfo = new_serverinfo;
memcpy(ctx->cert->key->serverinfo, serverinfo, serverinfo_length);
ctx->cert->key->serverinfo_length = serverinfo_length;
@@ -961,6 +964,7 @@ int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file)
int ret = 0;
BIO *bin = NULL;
size_t num_extensions = 0;
+ unsigned char *new_serverinfo;
if (ctx == NULL || file == NULL) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE,
@@ -1011,12 +1015,13 @@ int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file)
goto end;
}
/* Append the decoded extension to the serverinfo buffer */
- serverinfo =
+ new_serverinfo =
OPENSSL_realloc(serverinfo, serverinfo_length + extension_length);
- if (serverinfo == NULL) {
+ if (new_serverinfo == NULL) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE, ERR_R_MALLOC_FAILURE);
goto end;
}
+ serverinfo = new_serverinfo;
memcpy(serverinfo + serverinfo_length, extension, extension_length);
serverinfo_length += extension_length;
diff --git a/thirdparty/openssl/ssl/ssl_sess.c b/thirdparty/openssl/ssl/ssl_sess.c
index b182998343..f50f514212 100644
--- a/thirdparty/openssl/ssl/ssl_sess.c
+++ b/thirdparty/openssl/ssl/ssl_sess.c
@@ -382,7 +382,7 @@ static int def_generate_session_id(const SSL *ssl, unsigned char *id,
{
unsigned int retry = 0;
do
- if (RAND_pseudo_bytes(id, *id_len) <= 0)
+ if (RAND_bytes(id, *id_len) <= 0)
return 0;
while (SSL_has_matching_session_id(ssl, id, *id_len) &&
(++retry < MAX_SESS_ID_ATTEMPTS)) ;
@@ -573,7 +573,7 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len,
int r;
#endif
- if (session_id + len > limit) {
+ if (limit - session_id < len) {
fatal = 1;
goto err;
}
@@ -769,6 +769,15 @@ int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c)
* obtain the same session from an external cache)
*/
s = NULL;
+ } else if (s == NULL &&
+ lh_SSL_SESSION_retrieve(ctx->sessions, c) == NULL) {
+ /* s == NULL can also mean OOM error in lh_SSL_SESSION_insert ... */
+
+ /*
+ * ... so take back the extra reference and also don't add
+ * the session to the SSL_SESSION_list at this time
+ */
+ s = c;
}
/* Put at the head of the queue unless it is already in the cache */
@@ -919,6 +928,10 @@ int SSL_set_session(SSL *s, SSL_SESSION *session)
session->krb5_client_princ_len > 0) {
s->kssl_ctx->client_princ =
(char *)OPENSSL_malloc(session->krb5_client_princ_len + 1);
+ if (s->kssl_ctx->client_princ == NULL) {
+ SSLerr(SSL_F_SSL_SET_SESSION, ERR_R_MALLOC_FAILURE);
+ return 0;
+ }
memcpy(s->kssl_ctx->client_princ, session->krb5_client_princ,
session->krb5_client_princ_len);
s->kssl_ctx->client_princ[session->krb5_client_princ_len] = '\0';
@@ -993,7 +1006,8 @@ int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx,
return 0;
}
s->sid_ctx_length = sid_ctx_len;
- memcpy(s->sid_ctx, sid_ctx, sid_ctx_len);
+ if (s->sid_ctx != sid_ctx)
+ memcpy(s->sid_ctx, sid_ctx, sid_ctx_len);
return 1;
}
@@ -1123,7 +1137,7 @@ int ssl_clear_bad_session(SSL *s)
if ((s->session != NULL) &&
!(s->shutdown & SSL_SENT_SHUTDOWN) &&
!(SSL_in_init(s) || SSL_in_before(s))) {
- SSL_CTX_remove_session(s->ctx, s->session);
+ SSL_CTX_remove_session(s->session_ctx, s->session);
return (1);
} else
return (0);
diff --git a/thirdparty/openssl/ssl/t1_enc.c b/thirdparty/openssl/ssl/t1_enc.c
index 514fcb3e4e..b6d1ee95a5 100644
--- a/thirdparty/openssl/ssl/t1_enc.c
+++ b/thirdparty/openssl/ssl/t1_enc.c
@@ -673,7 +673,6 @@ int tls1_setup_key_block(SSL *s)
if ((p2 = (unsigned char *)OPENSSL_malloc(num)) == NULL) {
SSLerr(SSL_F_TLS1_SETUP_KEY_BLOCK, ERR_R_MALLOC_FAILURE);
- OPENSSL_free(p1);
goto err;
}
#ifdef TLS_DEBUG
diff --git a/thirdparty/openssl/ssl/t1_ext.c b/thirdparty/openssl/ssl/t1_ext.c
index 724ddf76ac..0f4aba0226 100644
--- a/thirdparty/openssl/ssl/t1_ext.c
+++ b/thirdparty/openssl/ssl/t1_ext.c
@@ -179,6 +179,25 @@ int custom_ext_add(SSL *s, int server,
return 1;
}
+/* Copy the flags from src to dst for any extensions that exist in both */
+int custom_exts_copy_flags(custom_ext_methods *dst,
+ const custom_ext_methods *src)
+{
+ size_t i;
+ custom_ext_method *methsrc = src->meths;
+
+ for (i = 0; i < src->meths_count; i++, methsrc++) {
+ custom_ext_method *methdst = custom_ext_find(dst, methsrc->ext_type);
+
+ if (methdst == NULL)
+ continue;
+
+ methdst->ext_flags = methsrc->ext_flags;
+ }
+
+ return 1;
+}
+
/* Copy table of custom extensions */
int custom_exts_copy(custom_ext_methods *dst, const custom_ext_methods *src)
{
@@ -223,16 +242,14 @@ static int custom_ext_meth_add(custom_ext_methods *exts,
/* Search for duplicate */
if (custom_ext_find(exts, ext_type))
return 0;
- exts->meths = OPENSSL_realloc(exts->meths,
- (exts->meths_count +
- 1) * sizeof(custom_ext_method));
-
- if (!exts->meths) {
- exts->meths_count = 0;
+ meth = OPENSSL_realloc(exts->meths,
+ (exts->meths_count + 1)
+ * sizeof(custom_ext_method));
+ if (meth == NULL)
return 0;
- }
- meth = exts->meths + exts->meths_count;
+ exts->meths = meth;
+ meth += exts->meths_count;
memset(meth, 0, sizeof(custom_ext_method));
meth->parse_cb = parse_cb;
meth->add_cb = add_cb;
@@ -275,7 +292,9 @@ int SSL_extension_supported(unsigned int ext_type)
case TLSEXT_TYPE_ec_point_formats:
case TLSEXT_TYPE_elliptic_curves:
case TLSEXT_TYPE_heartbeat:
+# ifndef OPENSSL_NO_NEXTPROTONEG
case TLSEXT_TYPE_next_proto_neg:
+# endif
case TLSEXT_TYPE_padding:
case TLSEXT_TYPE_renegotiate:
case TLSEXT_TYPE_server_name:
diff --git a/thirdparty/openssl/ssl/t1_lib.c b/thirdparty/openssl/ssl/t1_lib.c
index dd5bd0050d..6587e8bb68 100644
--- a/thirdparty/openssl/ssl/t1_lib.c
+++ b/thirdparty/openssl/ssl/t1_lib.c
@@ -132,6 +132,9 @@ static int ssl_check_clienthello_tlsext_early(SSL *s);
int ssl_check_serverhello_tlsext(SSL *s);
#endif
+#define CHECKLEN(curr, val, limit) \
+ (((curr) >= (limit)) || (size_t)((limit) - (curr)) < (size_t)(val))
+
SSL3_ENC_METHOD TLSv1_enc_data = {
tls1_enc,
tls1_mac,
@@ -1032,7 +1035,7 @@ static unsigned char suiteb_sigalgs[] = {
tlsext_sigalg_ecdsa(TLSEXT_hash_sha384)
};
# endif
-size_t tls12_get_psigalgs(SSL *s, const unsigned char **psigs)
+size_t tls12_get_psigalgs(SSL *s, int sent, const unsigned char **psigs)
{
/*
* If Suite B mode use Suite B sigalgs only, ignore any other
@@ -1054,7 +1057,7 @@ size_t tls12_get_psigalgs(SSL *s, const unsigned char **psigs)
}
# endif
/* If server use client authentication sigalgs if not NULL */
- if (s->server && s->cert->client_sigalgs) {
+ if (s->server == sent && s->cert->client_sigalgs) {
*psigs = s->cert->client_sigalgs;
return s->cert->client_sigalgslen;
} else if (s->cert->conf_sigalgs) {
@@ -1118,7 +1121,7 @@ int tls12_check_peer_sigalg(const EVP_MD **pmd, SSL *s,
# endif
/* Check signature matches a type we sent */
- sent_sigslen = tls12_get_psigalgs(s, &sent_sigs);
+ sent_sigslen = tls12_get_psigalgs(s, 1, &sent_sigs);
for (i = 0; i < sent_sigslen; i += 2, sent_sigs += 2) {
if (sig[0] == sent_sigs[0] && sig[1] == sent_sigs[1])
break;
@@ -1166,7 +1169,7 @@ void ssl_set_client_disabled(SSL *s)
* Now go through all signature algorithms seeing if we support any for
* RSA, DSA, ECDSA. Do this for all versions not just TLS 1.2.
*/
- sigalgslen = tls12_get_psigalgs(s, &sigalgs);
+ sigalgslen = tls12_get_psigalgs(s, 1, &sigalgs);
for (i = 0; i < sigalgslen; i += 2, sigalgs += 2) {
switch (sigalgs[1]) {
# ifndef OPENSSL_NO_RSA
@@ -1263,8 +1266,7 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
if (s->tlsext_hostname != NULL) {
/* Add TLS extension servername to the Client Hello message */
- unsigned long size_str;
- long lenmax;
+ size_t size_str;
/*-
* check for enough space.
@@ -1274,10 +1276,8 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
* 2 for hostname length
* + hostname length
*/
-
- if ((lenmax = limit - ret - 9) < 0
- || (size_str =
- strlen(s->tlsext_hostname)) > (unsigned long)lenmax)
+ size_str = strlen(s->tlsext_hostname);
+ if (CHECKLEN(ret, 9 + size_str, limit))
return NULL;
/* extension type and length */
@@ -1321,7 +1321,7 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
if (s->srp_ctx.login != NULL) { /* Add TLS extension SRP username to the
* Client Hello message */
- int login_len = strlen(s->srp_ctx.login);
+ size_t login_len = strlen(s->srp_ctx.login);
if (login_len > 255 || login_len == 0) {
SSLerr(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT, ERR_R_INTERNAL_ERROR);
return NULL;
@@ -1333,7 +1333,7 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
* 1 for the srp user identity
* + srp user identity length
*/
- if ((limit - ret - 5 - login_len) < 0)
+ if (CHECKLEN(ret, 5 + login_len, limit))
return NULL;
/* fill in the extension */
@@ -1350,20 +1350,23 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
/*
* Add TLS extension ECPointFormats to the ClientHello message
*/
- long lenmax;
const unsigned char *pcurves, *pformats;
size_t num_curves, num_formats, curves_list_len;
tls1_get_formatlist(s, &pformats, &num_formats);
- if ((lenmax = limit - ret - 5) < 0)
- return NULL;
- if (num_formats > (size_t)lenmax)
- return NULL;
if (num_formats > 255) {
SSLerr(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT, ERR_R_INTERNAL_ERROR);
return NULL;
}
+ /*-
+ * check for enough space.
+ * 4 bytes for the ec point formats type and extension length
+ * 1 byte for the length of the formats
+ * + formats length
+ */
+ if (CHECKLEN(ret, 5 + num_formats, limit))
+ return NULL;
s2n(TLSEXT_TYPE_ec_point_formats, ret);
/* The point format list has 1-byte length. */
@@ -1379,15 +1382,20 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
if (!tls1_get_curvelist(s, 0, &pcurves, &num_curves))
return NULL;
- if ((lenmax = limit - ret - 6) < 0)
- return NULL;
- if (num_curves > (size_t)lenmax / 2)
- return NULL;
if (num_curves > 65532 / 2) {
SSLerr(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT, ERR_R_INTERNAL_ERROR);
return NULL;
}
curves_list_len = 2 * num_curves;
+ /*-
+ * check for enough space.
+ * 4 bytes for the ec curves type and extension length
+ * 2 bytes for the curve list length
+ * + curve list length
+ */
+ if (CHECKLEN(ret, 6 + curves_list_len, limit))
+ return NULL;
+
s2n(TLSEXT_TYPE_elliptic_curves, ret);
s2n(curves_list_len + 2, ret);
s2n(curves_list_len, ret);
@@ -1397,7 +1405,7 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
# endif /* OPENSSL_NO_EC */
if (!(SSL_get_options(s) & SSL_OP_NO_TICKET)) {
- int ticklen;
+ size_t ticklen;
if (!s->new_session && s->session && s->session->tlsext_tick)
ticklen = s->session->tlsext_ticklen;
else if (s->session && s->tlsext_session_ticket &&
@@ -1418,22 +1426,29 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
* Check for enough room 2 for extension type, 2 for len rest for
* ticket
*/
- if ((long)(limit - ret - 4 - ticklen) < 0)
+ if (CHECKLEN(ret, 4 + ticklen, limit))
return NULL;
s2n(TLSEXT_TYPE_session_ticket, ret);
s2n(ticklen, ret);
- if (ticklen) {
+ if (ticklen > 0) {
memcpy(ret, s->session->tlsext_tick, ticklen);
ret += ticklen;
}
}
skip_ext:
- if (SSL_USE_SIGALGS(s)) {
+ if (SSL_CLIENT_USE_SIGALGS(s)) {
size_t salglen;
const unsigned char *salg;
- salglen = tls12_get_psigalgs(s, &salg);
- if ((size_t)(limit - ret) < salglen + 6)
+ salglen = tls12_get_psigalgs(s, 1, &salg);
+
+ /*-
+ * check for enough space.
+ * 4 bytes for the sigalgs type and extension length
+ * 2 bytes for the sigalg list length
+ * + sigalg list length
+ */
+ if (CHECKLEN(ret, salglen + 6, limit))
return NULL;
s2n(TLSEXT_TYPE_signature_algorithms, ret);
s2n(salglen + 2, ret);
@@ -1460,30 +1475,42 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
if (s->tlsext_status_type == TLSEXT_STATUSTYPE_ocsp) {
int i;
- long extlen, idlen, itmp;
+ size_t extlen, idlen;
+ int lentmp;
OCSP_RESPID *id;
idlen = 0;
for (i = 0; i < sk_OCSP_RESPID_num(s->tlsext_ocsp_ids); i++) {
id = sk_OCSP_RESPID_value(s->tlsext_ocsp_ids, i);
- itmp = i2d_OCSP_RESPID(id, NULL);
- if (itmp <= 0)
+ lentmp = i2d_OCSP_RESPID(id, NULL);
+ if (lentmp <= 0)
return NULL;
- idlen += itmp + 2;
+ idlen += (size_t)lentmp + 2;
}
if (s->tlsext_ocsp_exts) {
- extlen = i2d_X509_EXTENSIONS(s->tlsext_ocsp_exts, NULL);
- if (extlen < 0)
+ lentmp = i2d_X509_EXTENSIONS(s->tlsext_ocsp_exts, NULL);
+ if (lentmp < 0)
return NULL;
+ extlen = (size_t)lentmp;
} else
extlen = 0;
- if ((long)(limit - ret - 7 - extlen - idlen) < 0)
- return NULL;
- s2n(TLSEXT_TYPE_status_request, ret);
if (extlen + idlen > 0xFFF0)
return NULL;
+ /*
+ * 2 bytes for status request type
+ * 2 bytes for status request len
+ * 1 byte for OCSP request type
+ * 2 bytes for length of ids
+ * 2 bytes for length of extensions
+ * + length of ids
+ * + length of extensions
+ */
+ if (CHECKLEN(ret, 9 + idlen + extlen, limit))
+ return NULL;
+
+ s2n(TLSEXT_TYPE_status_request, ret);
s2n(extlen + idlen + 5, ret);
*(ret++) = TLSEXT_STATUSTYPE_ocsp;
s2n(idlen, ret);
@@ -1493,9 +1520,9 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
id = sk_OCSP_RESPID_value(s->tlsext_ocsp_ids, i);
/* skip over id len */
ret += 2;
- itmp = i2d_OCSP_RESPID(id, &ret);
+ lentmp = i2d_OCSP_RESPID(id, &ret);
/* write id len */
- s2n(itmp, q);
+ s2n(lentmp, q);
}
s2n(extlen, ret);
if (extlen > 0)
@@ -1503,8 +1530,15 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
}
# ifndef OPENSSL_NO_HEARTBEATS
/* Add Heartbeat extension */
- if ((limit - ret - 4 - 1) < 0)
+
+ /*-
+ * check for enough space.
+ * 4 bytes for the heartbeat ext type and extension length
+ * 1 byte for the mode
+ */
+ if (CHECKLEN(ret, 5, limit))
return NULL;
+
s2n(TLSEXT_TYPE_heartbeat, ret);
s2n(1, ret);
/*-
@@ -1524,7 +1558,12 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
* The client advertises an emtpy extension to indicate its support
* for Next Protocol Negotiation
*/
- if (limit - ret - 4 < 0)
+
+ /*-
+ * check for enough space.
+ * 4 bytes for the NPN ext type and extension length
+ */
+ if (CHECKLEN(ret, 4, limit))
return NULL;
s2n(TLSEXT_TYPE_next_proto_neg, ret);
s2n(0, ret);
@@ -1532,7 +1571,13 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
# endif
if (s->alpn_client_proto_list && !s->s3->tmp.finish_md_len) {
- if ((size_t)(limit - ret) < 6 + s->alpn_client_proto_list_len)
+ /*-
+ * check for enough space.
+ * 4 bytes for the ALPN type and extension length
+ * 2 bytes for the ALPN protocol list length
+ * + ALPN protocol list length
+ */
+ if (CHECKLEN(ret, 6 + s->alpn_client_proto_list_len, limit))
return NULL;
s2n(TLSEXT_TYPE_application_layer_protocol_negotiation, ret);
s2n(2 + s->alpn_client_proto_list_len, ret);
@@ -1547,7 +1592,12 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
ssl_add_clienthello_use_srtp_ext(s, 0, &el, 0);
- if ((limit - ret - 4 - el) < 0)
+ /*-
+ * check for enough space.
+ * 4 bytes for the SRTP type and extension length
+ * + SRTP profiles length
+ */
+ if (CHECKLEN(ret, 4 + el, limit))
return NULL;
s2n(TLSEXT_TYPE_use_srtp, ret);
@@ -1587,6 +1637,17 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
else
hlen = 0;
+ /*-
+ * check for enough space. Strictly speaking we know we've already
+ * got enough space because to get here the message size is < 0x200,
+ * but we know that we've allocated far more than that in the buffer
+ * - but for consistency and robustness we're going to check anyway.
+ *
+ * 4 bytes for the padding type and extension length
+ * + padding length
+ */
+ if (CHECKLEN(ret, 4 + hlen, limit))
+ return NULL;
s2n(TLSEXT_TYPE_padding, ret);
s2n(hlen, ret);
memset(ret, 0, hlen);
@@ -1644,7 +1705,12 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf,
return NULL;
}
- if ((limit - ret - 4 - el) < 0)
+ /*-
+ * check for enough space.
+ * 4 bytes for the reneg type and extension length
+ * + reneg data length
+ */
+ if (CHECKLEN(ret, 4 + el, limit))
return NULL;
s2n(TLSEXT_TYPE_renegotiate, ret);
@@ -1664,19 +1730,23 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf,
/*
* Add TLS extension ECPointFormats to the ServerHello message
*/
- long lenmax;
tls1_get_formatlist(s, &plist, &plistlen);
- if ((lenmax = limit - ret - 5) < 0)
- return NULL;
- if (plistlen > (size_t)lenmax)
- return NULL;
if (plistlen > 255) {
SSLerr(SSL_F_SSL_ADD_SERVERHELLO_TLSEXT, ERR_R_INTERNAL_ERROR);
return NULL;
}
+ /*-
+ * check for enough space.
+ * 4 bytes for the ec points format type and extension length
+ * 1 byte for the points format list length
+ * + length of points format list
+ */
+ if (CHECKLEN(ret, 5 + plistlen, limit))
+ return NULL;
+
s2n(TLSEXT_TYPE_ec_point_formats, ret);
s2n(plistlen + 1, ret);
*(ret++) = (unsigned char)plistlen;
@@ -1691,14 +1761,25 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf,
# endif /* OPENSSL_NO_EC */
if (s->tlsext_ticket_expected && !(SSL_get_options(s) & SSL_OP_NO_TICKET)) {
- if ((long)(limit - ret - 4) < 0)
+ /*-
+ * check for enough space.
+ * 4 bytes for the Ticket type and extension length
+ */
+ if (CHECKLEN(ret, 4, limit))
return NULL;
s2n(TLSEXT_TYPE_session_ticket, ret);
s2n(0, ret);
+ } else {
+ /* if we don't add the above TLSEXT, we can't add a session ticket later */
+ s->tlsext_ticket_expected = 0;
}
if (s->tlsext_status_expected) {
- if ((long)(limit - ret - 4) < 0)
+ /*-
+ * check for enough space.
+ * 4 bytes for the Status request type and extension length
+ */
+ if (CHECKLEN(ret, 4, limit))
return NULL;
s2n(TLSEXT_TYPE_status_request, ret);
s2n(0, ret);
@@ -1726,7 +1807,12 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf,
ssl_add_serverhello_use_srtp_ext(s, 0, &el, 0);
- if ((limit - ret - 4 - el) < 0)
+ /*-
+ * check for enough space.
+ * 4 bytes for the SRTP profiles type and extension length
+ * + length of the SRTP profiles list
+ */
+ if (CHECKLEN(ret, 4 + el, limit))
return NULL;
s2n(TLSEXT_TYPE_use_srtp, ret);
@@ -1751,16 +1837,23 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf,
0x2a, 0x85, 0x03, 0x02, 0x02, 0x16, 0x30, 0x08,
0x06, 0x06, 0x2a, 0x85, 0x03, 0x02, 0x02, 0x17
};
- if (limit - ret < 36)
+
+ /* check for enough space. */
+ if (CHECKLEN(ret, sizeof(cryptopro_ext), limit))
return NULL;
- memcpy(ret, cryptopro_ext, 36);
- ret += 36;
+ memcpy(ret, cryptopro_ext, sizeof(cryptopro_ext));
+ ret += sizeof(cryptopro_ext);
}
# ifndef OPENSSL_NO_HEARTBEATS
/* Add Heartbeat extension if we've received one */
if (s->tlsext_heartbeat & SSL_TLSEXT_HB_ENABLED) {
- if ((limit - ret - 4 - 1) < 0)
+ /*-
+ * check for enough space.
+ * 4 bytes for the Heartbeat type and extension length
+ * 1 byte for the mode
+ */
+ if (CHECKLEN(ret, 5, limit))
return NULL;
s2n(TLSEXT_TYPE_heartbeat, ret);
s2n(1, ret);
@@ -1789,7 +1882,12 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf,
s->
ctx->next_protos_advertised_cb_arg);
if (r == SSL_TLSEXT_ERR_OK) {
- if ((long)(limit - ret - 4 - npalen) < 0)
+ /*-
+ * check for enough space.
+ * 4 bytes for the NPN type and extension length
+ * + length of protocols list
+ */
+ if (CHECKLEN(ret, 4 + npalen, limit))
return NULL;
s2n(TLSEXT_TYPE_next_proto_neg, ret);
s2n(npalen, ret);
@@ -1804,9 +1902,16 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf,
if (s->s3->alpn_selected) {
const unsigned char *selected = s->s3->alpn_selected;
- unsigned len = s->s3->alpn_selected_len;
+ size_t len = s->s3->alpn_selected_len;
- if ((long)(limit - ret - 4 - 2 - 1 - len) < 0)
+ /*-
+ * check for enough space.
+ * 4 bytes for the ALPN type and extension length
+ * 2 bytes for ALPN data length
+ * 1 byte for selected protocol length
+ * + length of the selected protocol
+ */
+ if (CHECKLEN(ret, 7 + len, limit))
return NULL;
s2n(TLSEXT_TYPE_application_layer_protocol_negotiation, ret);
s2n(3 + len, ret);
@@ -1867,11 +1972,11 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
0x02, 0x03, /* SHA-1/ECDSA */
};
- if (data >= (limit - 2))
+ if (limit - data <= 2)
return;
data += 2;
- if (data > (limit - 4))
+ if (limit - data < 4)
return;
n2s(data, type);
n2s(data, size);
@@ -1879,7 +1984,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
if (type != TLSEXT_TYPE_server_name)
return;
- if (data + size > limit)
+ if (limit - data < size)
return;
data += size;
@@ -1887,7 +1992,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
const size_t len1 = sizeof(kSafariExtensionsBlock);
const size_t len2 = sizeof(kSafariTLS12ExtensionsBlock);
- if (data + len1 + len2 != limit)
+ if (limit - data != (int)(len1 + len2))
return;
if (memcmp(data, kSafariExtensionsBlock, len1) != 0)
return;
@@ -1896,7 +2001,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
} else {
const size_t len = sizeof(kSafariExtensionsBlock);
- if (data + len != limit)
+ if (limit - data != (int)(len))
return;
if (memcmp(data, kSafariExtensionsBlock, len) != 0)
return;
@@ -1966,11 +2071,10 @@ static int tls1_alpn_handle_client_hello(SSL *s, const unsigned char *data,
/*
* Process the ALPN extension in a ClientHello.
- * ret: a pointer to the TLSEXT return value: SSL_TLSEXT_ERR_*
* al: a pointer to the alert value to send in the event of a failure.
- * returns 1 on success, 0 on failure: al/ret set only on failure
+ * returns 1 on success, 0 on failure: al set only on failure
*/
-static int tls1_alpn_handle_client_hello_late(SSL *s, int *ret, int *al)
+static int tls1_alpn_handle_client_hello_late(SSL *s, int *al)
{
const unsigned char *selected = NULL;
unsigned char selected_len = 0;
@@ -1986,7 +2090,6 @@ static int tls1_alpn_handle_client_hello_late(SSL *s, int *ret, int *al)
s->s3->alpn_selected = OPENSSL_malloc(selected_len);
if (s->s3->alpn_selected == NULL) {
*al = SSL_AD_INTERNAL_ERROR;
- *ret = SSL_TLSEXT_ERR_ALERT_FATAL;
return 0;
}
memcpy(s->s3->alpn_selected, selected, selected_len);
@@ -2053,19 +2156,19 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p,
if (data == limit)
goto ri_check;
- if (data > (limit - 2))
+ if (limit - data < 2)
goto err;
n2s(data, len);
- if (data + len != limit)
+ if (limit - data != len)
goto err;
- while (data <= (limit - 4)) {
+ while (limit - data >= 4) {
n2s(data, type);
n2s(data, size);
- if (data + size > (limit))
+ if (limit - data < size)
goto err;
# if 0
fprintf(stderr, "Received extension type %d size %d\n", type, size);
@@ -2316,6 +2419,23 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p,
size -= 2;
if (dsize > size)
goto err;
+
+ /*
+ * We remove any OCSP_RESPIDs from a previous handshake
+ * to prevent unbounded memory growth - CVE-2016-6304
+ */
+ sk_OCSP_RESPID_pop_free(s->tlsext_ocsp_ids,
+ OCSP_RESPID_free);
+ if (dsize > 0) {
+ s->tlsext_ocsp_ids = sk_OCSP_RESPID_new_null();
+ if (s->tlsext_ocsp_ids == NULL) {
+ *al = SSL_AD_INTERNAL_ERROR;
+ return 0;
+ }
+ } else {
+ s->tlsext_ocsp_ids = NULL;
+ }
+
while (dsize > 0) {
OCSP_RESPID *id;
int idsize;
@@ -2335,13 +2455,6 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p,
OCSP_RESPID_free(id);
goto err;
}
- if (!s->tlsext_ocsp_ids
- && !(s->tlsext_ocsp_ids =
- sk_OCSP_RESPID_new_null())) {
- OCSP_RESPID_free(id);
- *al = SSL_AD_INTERNAL_ERROR;
- return 0;
- }
if (!sk_OCSP_RESPID_push(s->tlsext_ocsp_ids, id)) {
OCSP_RESPID_free(id);
*al = SSL_AD_INTERNAL_ERROR;
@@ -2472,18 +2585,18 @@ static int ssl_scan_clienthello_custom_tlsext(SSL *s,
if (s->hit || s->cert->srv_ext.meths_count == 0)
return 1;
- if (data >= limit - 2)
+ if (limit - data <= 2)
return 1;
n2s(data, len);
- if (data > limit - len)
+ if (limit - data < len)
return 1;
- while (data <= limit - 4) {
+ while (limit - data >= 4) {
n2s(data, type);
n2s(data, size);
- if (data + size > limit)
+ if (limit - data < size)
return 1;
if (custom_ext_parse(s, 1 /* server */ , type, data, size, al) <= 0)
return 0;
@@ -2569,20 +2682,20 @@ static int ssl_scan_serverhello_tlsext(SSL *s, unsigned char **p,
SSL_TLSEXT_HB_DONT_SEND_REQUESTS);
# endif
- if (data >= (d + n - 2))
+ if ((d + n) - data <= 2)
goto ri_check;
n2s(data, length);
- if (data + length != d + n) {
+ if ((d + n) - data != length) {
*al = SSL_AD_DECODE_ERROR;
return 0;
}
- while (data <= (d + n - 4)) {
+ while ((d + n) - data >= 4) {
n2s(data, type);
n2s(data, size);
- if (data + size > (d + n))
+ if ((d + n) - data < size)
goto ri_check;
if (s->tlsext_debug_cb)
@@ -2712,6 +2825,11 @@ static int ssl_scan_serverhello_tlsext(SSL *s, unsigned char **p,
*al = TLS1_AD_INTERNAL_ERROR;
return 0;
}
+ /*
+ * Could be non-NULL if server has sent multiple NPN extensions in
+ * a single Serverhello
+ */
+ OPENSSL_free(s->next_proto_negotiated);
s->next_proto_negotiated = OPENSSL_malloc(selected_len);
if (!s->next_proto_negotiated) {
*al = TLS1_AD_INTERNAL_ERROR;
@@ -3049,10 +3167,12 @@ int tls1_set_server_sigalgs(SSL *s)
return 0;
}
-int ssl_check_clienthello_tlsext_late(SSL *s)
+/*
+ * Upon success, returns 1.
+ * Upon failure, returns 0 and sets |al| to the appropriate fatal alert.
+ */
+int ssl_check_clienthello_tlsext_late(SSL *s, int *al)
{
- int ret = SSL_TLSEXT_ERR_OK;
- int al;
/*
* If status request then ask callback what to do. Note: this must be
@@ -3061,58 +3181,41 @@ int ssl_check_clienthello_tlsext_late(SSL *s)
* influence which certificate is sent
*/
if ((s->tlsext_status_type != -1) && s->ctx && s->ctx->tlsext_status_cb) {
- int r;
+ int ret;
CERT_PKEY *certpkey;
certpkey = ssl_get_server_send_pkey(s);
/* If no certificate can't return certificate status */
- if (certpkey == NULL) {
- s->tlsext_status_expected = 0;
- return 1;
- }
- /*
- * Set current certificate to one we will use so SSL_get_certificate
- * et al can pick it up.
- */
- s->cert->key = certpkey;
- r = s->ctx->tlsext_status_cb(s, s->ctx->tlsext_status_arg);
- switch (r) {
- /* We don't want to send a status request response */
- case SSL_TLSEXT_ERR_NOACK:
- s->tlsext_status_expected = 0;
- break;
- /* status request response should be sent */
- case SSL_TLSEXT_ERR_OK:
- if (s->tlsext_ocsp_resp)
- s->tlsext_status_expected = 1;
- else
+ if (certpkey != NULL) {
+ /*
+ * Set current certificate to one we will use so SSL_get_certificate
+ * et al can pick it up.
+ */
+ s->cert->key = certpkey;
+ ret = s->ctx->tlsext_status_cb(s, s->ctx->tlsext_status_arg);
+ switch (ret) {
+ /* We don't want to send a status request response */
+ case SSL_TLSEXT_ERR_NOACK:
s->tlsext_status_expected = 0;
- break;
- /* something bad happened */
- case SSL_TLSEXT_ERR_ALERT_FATAL:
- ret = SSL_TLSEXT_ERR_ALERT_FATAL;
- al = SSL_AD_INTERNAL_ERROR;
- goto err;
+ break;
+ /* status request response should be sent */
+ case SSL_TLSEXT_ERR_OK:
+ if (s->tlsext_ocsp_resp)
+ s->tlsext_status_expected = 1;
+ break;
+ /* something bad happened */
+ case SSL_TLSEXT_ERR_ALERT_FATAL:
+ default:
+ *al = SSL_AD_INTERNAL_ERROR;
+ return 0;
+ }
}
- } else
- s->tlsext_status_expected = 0;
-
- if (!tls1_alpn_handle_client_hello_late(s, &ret, &al)) {
- goto err;
}
- err:
- switch (ret) {
- case SSL_TLSEXT_ERR_ALERT_FATAL:
- ssl3_send_alert(s, SSL3_AL_FATAL, al);
- return -1;
-
- case SSL_TLSEXT_ERR_ALERT_WARNING:
- ssl3_send_alert(s, SSL3_AL_WARNING, al);
- return 1;
-
- default:
- return 1;
+ if (!tls1_alpn_handle_client_hello_late(s, al)) {
+ return 0;
}
+
+ return 1;
}
int ssl_check_serverhello_tlsext(SSL *s)
@@ -3307,29 +3410,33 @@ int tls1_process_ticket(SSL *s, unsigned char *session_id, int len,
/* Skip past DTLS cookie */
if (SSL_IS_DTLS(s)) {
i = *(p++);
- p += i;
- if (p >= limit)
+
+ if (limit - p <= i)
return -1;
+
+ p += i;
}
/* Skip past cipher list */
n2s(p, i);
- p += i;
- if (p >= limit)
+ if (limit - p <= i)
return -1;
+ p += i;
+
/* Skip past compression algorithm list */
i = *(p++);
- p += i;
- if (p > limit)
+ if (limit - p < i)
return -1;
+ p += i;
+
/* Now at start of extensions */
- if ((p + 2) >= limit)
+ if (limit - p <= 2)
return 0;
n2s(p, i);
- while ((p + 4) <= limit) {
+ while (limit - p >= 4) {
unsigned short type, size;
n2s(p, type);
n2s(p, size);
- if (p + size > limit)
+ if (limit - p < size)
return 0;
if (type == TLSEXT_TYPE_session_ticket) {
int r;
@@ -3397,9 +3504,7 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
HMAC_CTX hctx;
EVP_CIPHER_CTX ctx;
SSL_CTX *tctx = s->initial_ctx;
- /* Need at least keyname + iv + some encrypted data */
- if (eticklen < 48)
- return 2;
+
/* Initialize session ticket encryption and HMAC contexts */
HMAC_CTX_init(&hctx);
EVP_CIPHER_CTX_init(&ctx);
@@ -3433,6 +3538,13 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
if (mlen < 0) {
goto err;
}
+ /* Sanity check ticket length: must exceed keyname + IV + HMAC */
+ if (eticklen <= 16 + EVP_CIPHER_CTX_iv_length(&ctx) + mlen) {
+ HMAC_CTX_cleanup(&hctx);
+ EVP_CIPHER_CTX_cleanup(&ctx);
+ return 2;
+ }
+
eticklen -= mlen;
/* Check HMAC of encrypted ticket */
if (HMAC_Update(&hctx, etick, eticklen) <= 0
@@ -3465,8 +3577,14 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
p = sdec;
sess = d2i_SSL_SESSION(NULL, &p, slen);
+ slen -= p - sdec;
OPENSSL_free(sdec);
if (sess) {
+ /* Some additional consistency checks */
+ if (slen != 0 || sess->session_id_length != 0) {
+ SSL_SESSION_free(sess);
+ return 2;
+ }
/*
* The session ID, if non-empty, is used by some clients to detect
* that the ticket has been accepted. So we copy it to the session
@@ -3694,7 +3812,7 @@ static int tls1_set_shared_sigalgs(SSL *s)
conf = c->conf_sigalgs;
conflen = c->conf_sigalgslen;
} else
- conflen = tls12_get_psigalgs(s, &conf);
+ conflen = tls12_get_psigalgs(s, 0, &conf);
if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE || is_suiteb) {
pref = conf;
preflen = conflen;
@@ -3902,7 +4020,7 @@ int tls1_process_heartbeat(SSL *s)
memcpy(bp, pl, payload);
bp += payload;
/* Random padding */
- if (RAND_pseudo_bytes(bp, padding) < 0) {
+ if (RAND_bytes(bp, padding) <= 0) {
OPENSSL_free(buffer);
return -1;
}
@@ -3980,6 +4098,8 @@ int tls1_heartbeat(SSL *s)
* - Padding
*/
buf = OPENSSL_malloc(1 + 2 + payload + padding);
+ if (buf == NULL)
+ return -1;
p = buf;
/* Message Type */
*p++ = TLS1_HB_REQUEST;
@@ -3988,13 +4108,13 @@ int tls1_heartbeat(SSL *s)
/* Sequence number */
s2n(s->tlsext_hb_seq, p);
/* 16 random bytes */
- if (RAND_pseudo_bytes(p, 16) < 0) {
+ if (RAND_bytes(p, 16) <= 0) {
SSLerr(SSL_F_TLS1_HEARTBEAT, ERR_R_INTERNAL_ERROR);
goto err;
}
p += 16;
/* Random padding */
- if (RAND_pseudo_bytes(p, padding) < 0) {
+ if (RAND_bytes(p, padding) <= 0) {
SSLerr(SSL_F_TLS1_HEARTBEAT, ERR_R_INTERNAL_ERROR);
goto err;
}
diff --git a/thirdparty/opus/celt/arch.h b/thirdparty/opus/celt/arch.h
index 9f74ddd267..8ceab5fe10 100644
--- a/thirdparty/opus/celt/arch.h
+++ b/thirdparty/opus/celt/arch.h
@@ -78,6 +78,15 @@ static OPUS_INLINE void _celt_fatal(const char *str, const char *file, int line)
#define UADD32(a,b) ((a)+(b))
#define USUB32(a,b) ((a)-(b))
+/* Set this if opus_int64 is a native type of the CPU. */
+/* Assume that all LP64 architectures have fast 64-bit types; also x86_64
+ (which can be ILP32 for x32) and Win64 (which is LLP64). */
+#if defined(__x86_64__) || defined(__LP64__) || defined(_WIN64)
+#define OPUS_FAST_INT64 1
+#else
+#define OPUS_FAST_INT64 0
+#endif
+
#define PRINT_MIPS(file)
#ifdef FIXED_POINT
@@ -118,7 +127,9 @@ static OPUS_INLINE opus_int16 SAT16(opus_int32 x) {
#include "fixed_generic.h"
-#ifdef OPUS_ARM_INLINE_EDSP
+#ifdef OPUS_ARM_PRESUME_AARCH64_NEON_INTR
+#include "arm/fixed_arm64.h"
+#elif OPUS_ARM_INLINE_EDSP
#include "arm/fixed_armv5e.h"
#elif defined (OPUS_ARM_INLINE_ASM)
#include "arm/fixed_armv4.h"
diff --git a/thirdparty/opus/celt/arm/arm_celt_map.c b/thirdparty/opus/celt/arm/arm_celt_map.c
index ee6c244786..4d4d069a86 100644
--- a/thirdparty/opus/celt/arm/arm_celt_map.c
+++ b/thirdparty/opus/celt/arm/arm_celt_map.c
@@ -36,6 +36,9 @@
#if defined(OPUS_HAVE_RTCD)
# if defined(FIXED_POINT)
+# if ((defined(OPUS_ARM_MAY_HAVE_NEON) && !defined(OPUS_ARM_PRESUME_NEON)) || \
+ (defined(OPUS_ARM_MAY_HAVE_MEDIA) && !defined(OPUS_ARM_PRESUME_MEDIA)) || \
+ (defined(OPUS_ARM_MAY_HAVE_EDSP) && !defined(OPUS_ARM_PRESUME_EDSP)))
opus_val32 (*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *,
const opus_val16 *, opus_val32 *, int , int) = {
celt_pitch_xcorr_c, /* ARMv4 */
@@ -43,8 +46,10 @@ opus_val32 (*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *,
MAY_HAVE_MEDIA(celt_pitch_xcorr), /* Media */
MAY_HAVE_NEON(celt_pitch_xcorr) /* NEON */
};
+
+# endif
# else /* !FIXED_POINT */
-# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR)
void (*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *,
const opus_val16 *, opus_val32 *, int, int) = {
celt_pitch_xcorr_c, /* ARMv4 */
@@ -55,6 +60,23 @@ void (*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *,
# endif
# endif /* FIXED_POINT */
+#if defined(FIXED_POINT) && defined(OPUS_HAVE_RTCD) && \
+ defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR)
+
+void (*const XCORR_KERNEL_IMPL[OPUS_ARCHMASK + 1])(
+ const opus_val16 *x,
+ const opus_val16 *y,
+ opus_val32 sum[4],
+ int len
+) = {
+ xcorr_kernel_c, /* ARMv4 */
+ xcorr_kernel_c, /* EDSP */
+ xcorr_kernel_c, /* Media */
+ xcorr_kernel_neon_fixed, /* Neon */
+};
+
+#endif
+
# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
# if defined(HAVE_ARM_NE10)
# if defined(CUSTOM_MODES)
diff --git a/thirdparty/opus/celt/arm/armcpu.c b/thirdparty/opus/celt/arm/armcpu.c
index 5e5d10c344..694a63b78e 100644
--- a/thirdparty/opus/celt/arm/armcpu.c
+++ b/thirdparty/opus/celt/arm/armcpu.c
@@ -37,11 +37,12 @@
#include "cpu_support.h"
#include "os_support.h"
#include "opus_types.h"
+#include "arch.h"
-#define OPUS_CPU_ARM_V4 (1)
-#define OPUS_CPU_ARM_EDSP (1<<1)
-#define OPUS_CPU_ARM_MEDIA (1<<2)
-#define OPUS_CPU_ARM_NEON (1<<3)
+#define OPUS_CPU_ARM_V4_FLAG (1<<OPUS_ARCH_ARM_V4)
+#define OPUS_CPU_ARM_EDSP_FLAG (1<<OPUS_ARCH_ARM_EDSP)
+#define OPUS_CPU_ARM_MEDIA_FLAG (1<<OPUS_ARCH_ARM_MEDIA)
+#define OPUS_CPU_ARM_NEON_FLAG (1<<OPUS_ARCH_ARM_NEON)
#if defined(_MSC_VER)
/*For GetExceptionCode() and EXCEPTION_ILLEGAL_INSTRUCTION.*/
@@ -55,20 +56,22 @@ static OPUS_INLINE opus_uint32 opus_cpu_capabilities(void){
/* MSVC has no OPUS_INLINE __asm support for ARM, but it does let you __emit
* instructions via their assembled hex code.
* All of these instructions should be essentially nops. */
-# if defined(OPUS_ARM_MAY_HAVE_EDSP)
+# if defined(OPUS_ARM_MAY_HAVE_EDSP) || defined(OPUS_ARM_MAY_HAVE_MEDIA) \
+ || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
__try{
/*PLD [r13]*/
__emit(0xF5DDF000);
- flags|=OPUS_CPU_ARM_EDSP;
+ flags|=OPUS_CPU_ARM_EDSP_FLAG;
}
__except(GetExceptionCode()==EXCEPTION_ILLEGAL_INSTRUCTION){
/*Ignore exception.*/
}
-# if defined(OPUS_ARM_MAY_HAVE_MEDIA)
+# if defined(OPUS_ARM_MAY_HAVE_MEDIA) \
+ || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
__try{
/*SHADD8 r3,r3,r3*/
__emit(0xE6333F93);
- flags|=OPUS_CPU_ARM_MEDIA;
+ flags|=OPUS_CPU_ARM_MEDIA_FLAG;
}
__except(GetExceptionCode()==EXCEPTION_ILLEGAL_INSTRUCTION){
/*Ignore exception.*/
@@ -77,7 +80,7 @@ static OPUS_INLINE opus_uint32 opus_cpu_capabilities(void){
__try{
/*VORR q0,q0,q0*/
__emit(0xF2200150);
- flags|=OPUS_CPU_ARM_NEON;
+ flags|=OPUS_CPU_ARM_NEON_FLAG;
}
__except(GetExceptionCode()==EXCEPTION_ILLEGAL_INSTRUCTION){
/*Ignore exception.*/
@@ -107,26 +110,26 @@ opus_uint32 opus_cpu_capabilities(void)
while(fgets(buf, 512, cpuinfo) != NULL)
{
-# if defined(OPUS_ARM_MAY_HAVE_EDSP) || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+# if defined(OPUS_ARM_MAY_HAVE_EDSP) || defined(OPUS_ARM_MAY_HAVE_MEDIA) \
+ || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
/* Search for edsp and neon flag */
if(memcmp(buf, "Features", 8) == 0)
{
char *p;
-# if defined(OPUS_ARM_MAY_HAVE_EDSP)
p = strstr(buf, " edsp");
if(p != NULL && (p[5] == ' ' || p[5] == '\n'))
- flags |= OPUS_CPU_ARM_EDSP;
-# endif
+ flags |= OPUS_CPU_ARM_EDSP_FLAG;
# if defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
p = strstr(buf, " neon");
if(p != NULL && (p[5] == ' ' || p[5] == '\n'))
- flags |= OPUS_CPU_ARM_NEON;
+ flags |= OPUS_CPU_ARM_NEON_FLAG;
# endif
}
# endif
-# if defined(OPUS_ARM_MAY_HAVE_MEDIA)
+# if defined(OPUS_ARM_MAY_HAVE_MEDIA) \
+ || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
/* Search for media capabilities (>= ARMv6) */
if(memcmp(buf, "CPU architecture:", 17) == 0)
{
@@ -134,7 +137,7 @@ opus_uint32 opus_cpu_capabilities(void)
version = atoi(buf+17);
if(version >= 6)
- flags |= OPUS_CPU_ARM_MEDIA;
+ flags |= OPUS_CPU_ARM_MEDIA_FLAG;
}
# endif
}
@@ -156,18 +159,26 @@ int opus_select_arch(void)
opus_uint32 flags = opus_cpu_capabilities();
int arch = 0;
- if(!(flags & OPUS_CPU_ARM_EDSP))
+ if(!(flags & OPUS_CPU_ARM_EDSP_FLAG)) {
+ /* Asserts ensure arch values are sequential */
+ celt_assert(arch == OPUS_ARCH_ARM_V4);
return arch;
+ }
arch++;
- if(!(flags & OPUS_CPU_ARM_MEDIA))
+ if(!(flags & OPUS_CPU_ARM_MEDIA_FLAG)) {
+ celt_assert(arch == OPUS_ARCH_ARM_EDSP);
return arch;
+ }
arch++;
- if(!(flags & OPUS_CPU_ARM_NEON))
+ if(!(flags & OPUS_CPU_ARM_NEON_FLAG)) {
+ celt_assert(arch == OPUS_ARCH_ARM_MEDIA);
return arch;
+ }
arch++;
+ celt_assert(arch == OPUS_ARCH_ARM_NEON);
return arch;
}
diff --git a/thirdparty/opus/celt/arm/armcpu.h b/thirdparty/opus/celt/arm/armcpu.h
index ac5744606e..820262ff5f 100644
--- a/thirdparty/opus/celt/arm/armcpu.h
+++ b/thirdparty/opus/celt/arm/armcpu.h
@@ -66,6 +66,12 @@
# if defined(OPUS_HAVE_RTCD)
int opus_select_arch(void);
+
+#define OPUS_ARCH_ARM_V4 (0)
+#define OPUS_ARCH_ARM_EDSP (1)
+#define OPUS_ARCH_ARM_MEDIA (2)
+#define OPUS_ARCH_ARM_NEON (3)
+
# endif
#endif
diff --git a/thirdparty/opus/celt/arm/celt_neon_intr.c b/thirdparty/opus/celt/arm/celt_neon_intr.c
index 47dce15ba5..47bbe3dc22 100644
--- a/thirdparty/opus/celt/arm/celt_neon_intr.c
+++ b/thirdparty/opus/celt/arm/celt_neon_intr.c
@@ -37,7 +37,66 @@
#include <arm_neon.h>
#include "../pitch.h"
-#if !defined(FIXED_POINT)
+#if defined(FIXED_POINT)
+void xcorr_kernel_neon_fixed(const opus_val16 * x, const opus_val16 * y, opus_val32 sum[4], int len)
+{
+ int j;
+ int32x4_t a = vld1q_s32(sum);
+ /* Load y[0...3] */
+ /* This requires len>0 to always be valid (which we assert in the C code). */
+ int16x4_t y0 = vld1_s16(y);
+ y += 4;
+
+ for (j = 0; j + 8 <= len; j += 8)
+ {
+ /* Load x[0...7] */
+ int16x8_t xx = vld1q_s16(x);
+ int16x4_t x0 = vget_low_s16(xx);
+ int16x4_t x4 = vget_high_s16(xx);
+ /* Load y[4...11] */
+ int16x8_t yy = vld1q_s16(y);
+ int16x4_t y4 = vget_low_s16(yy);
+ int16x4_t y8 = vget_high_s16(yy);
+ int32x4_t a0 = vmlal_lane_s16(a, y0, x0, 0);
+ int32x4_t a1 = vmlal_lane_s16(a0, y4, x4, 0);
+
+ int16x4_t y1 = vext_s16(y0, y4, 1);
+ int16x4_t y5 = vext_s16(y4, y8, 1);
+ int32x4_t a2 = vmlal_lane_s16(a1, y1, x0, 1);
+ int32x4_t a3 = vmlal_lane_s16(a2, y5, x4, 1);
+
+ int16x4_t y2 = vext_s16(y0, y4, 2);
+ int16x4_t y6 = vext_s16(y4, y8, 2);
+ int32x4_t a4 = vmlal_lane_s16(a3, y2, x0, 2);
+ int32x4_t a5 = vmlal_lane_s16(a4, y6, x4, 2);
+
+ int16x4_t y3 = vext_s16(y0, y4, 3);
+ int16x4_t y7 = vext_s16(y4, y8, 3);
+ int32x4_t a6 = vmlal_lane_s16(a5, y3, x0, 3);
+ int32x4_t a7 = vmlal_lane_s16(a6, y7, x4, 3);
+
+ y0 = y8;
+ a = a7;
+ x += 8;
+ y += 8;
+ }
+
+ for (; j < len; j++)
+ {
+ int16x4_t x0 = vld1_dup_s16(x); /* load next x */
+ int32x4_t a0 = vmlal_s16(a, y0, x0);
+
+ int16x4_t y4 = vld1_dup_s16(y); /* load next y */
+ y0 = vext_s16(y0, y4, 1);
+ a = a0;
+ x++;
+ y++;
+ }
+
+ vst1q_s32(sum, a);
+}
+
+#else
/*
* Function: xcorr_kernel_neon_float
* ---------------------------------
diff --git a/thirdparty/opus/celt/arm/pitch_arm.h b/thirdparty/opus/celt/arm/pitch_arm.h
index 8626ed75b9..14331169ee 100644
--- a/thirdparty/opus/celt/arm/pitch_arm.h
+++ b/thirdparty/opus/celt/arm/pitch_arm.h
@@ -46,10 +46,53 @@ opus_val32 celt_pitch_xcorr_edsp(const opus_val16 *_x, const opus_val16 *_y,
opus_val32 *xcorr, int len, int max_pitch);
# endif
-# if !defined(OPUS_HAVE_RTCD)
+# if defined(OPUS_HAVE_RTCD) && \
+ ((defined(OPUS_ARM_MAY_HAVE_NEON) && !defined(OPUS_ARM_PRESUME_NEON)) || \
+ (defined(OPUS_ARM_MAY_HAVE_MEDIA) && !defined(OPUS_ARM_PRESUME_MEDIA)) || \
+ (defined(OPUS_ARM_MAY_HAVE_EDSP) && !defined(OPUS_ARM_PRESUME_EDSP)))
+extern opus_val32
+(*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *,
+ const opus_val16 *, opus_val32 *, int, int);
+# define OVERRIDE_PITCH_XCORR (1)
+# define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \
+ ((*CELT_PITCH_XCORR_IMPL[(arch)&OPUS_ARCHMASK])(_x, _y, \
+ xcorr, len, max_pitch))
+
+# elif defined(OPUS_ARM_PRESUME_EDSP) || \
+ defined(OPUS_ARM_PRESUME_MEDIA) || \
+ defined(OPUS_ARM_PRESUME_NEON)
# define OVERRIDE_PITCH_XCORR (1)
# define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \
((void)(arch),PRESUME_NEON(celt_pitch_xcorr)(_x, _y, xcorr, len, max_pitch))
+
+# endif
+
+# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+void xcorr_kernel_neon_fixed(
+ const opus_val16 *x,
+ const opus_val16 *y,
+ opus_val32 sum[4],
+ int len);
+# endif
+
+# if defined(OPUS_HAVE_RTCD) && \
+ (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR))
+
+extern void (*const XCORR_KERNEL_IMPL[OPUS_ARCHMASK + 1])(
+ const opus_val16 *x,
+ const opus_val16 *y,
+ opus_val32 sum[4],
+ int len);
+
+# define OVERRIDE_XCORR_KERNEL (1)
+# define xcorr_kernel(x, y, sum, len, arch) \
+ ((*XCORR_KERNEL_IMPL[(arch) & OPUS_ARCHMASK])(x, y, sum, len))
+
+# elif defined(OPUS_ARM_PRESUME_NEON_INTR)
+# define OVERRIDE_XCORR_KERNEL (1)
+# define xcorr_kernel(x, y, sum, len, arch) \
+ ((void)arch, xcorr_kernel_neon_fixed(x, y, sum, len))
+
# endif
#else /* Start !FIXED_POINT */
@@ -57,12 +100,27 @@ opus_val32 celt_pitch_xcorr_edsp(const opus_val16 *_x, const opus_val16 *_y,
#if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
void celt_pitch_xcorr_float_neon(const opus_val16 *_x, const opus_val16 *_y,
opus_val32 *xcorr, int len, int max_pitch);
-#if !defined(OPUS_HAVE_RTCD) || defined(OPUS_ARM_PRESUME_NEON_INTR)
-#define OVERRIDE_PITCH_XCORR (1)
+#endif
+
+# if defined(OPUS_HAVE_RTCD) && \
+ (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR))
+extern void
+(*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *,
+ const opus_val16 *, opus_val32 *, int, int);
+
+# define OVERRIDE_PITCH_XCORR (1)
+# define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \
+ ((*CELT_PITCH_XCORR_IMPL[(arch)&OPUS_ARCHMASK])(_x, _y, \
+ xcorr, len, max_pitch))
+
+# elif defined(OPUS_ARM_PRESUME_NEON_INTR)
+
+# define OVERRIDE_PITCH_XCORR (1)
# define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \
((void)(arch),celt_pitch_xcorr_float_neon(_x, _y, xcorr, len, max_pitch))
-#endif
-#endif
+
+# endif
#endif /* end !FIXED_POINT */
+
#endif
diff --git a/thirdparty/opus/celt/bands.c b/thirdparty/opus/celt/bands.c
index 25f229e267..87eaa6c031 100644
--- a/thirdparty/opus/celt/bands.c
+++ b/thirdparty/opus/celt/bands.c
@@ -414,7 +414,7 @@ static void stereo_merge(celt_norm * OPUS_RESTRICT X, celt_norm * OPUS_RESTRICT
/* Compensating for the mid normalization */
xp = MULT16_32_Q15(mid, xp);
/* mid and side are in Q15, not Q14 like X and Y */
- mid2 = SHR32(mid, 1);
+ mid2 = SHR16(mid, 1);
El = MULT16_16(mid2, mid2) + side - 2*xp;
Er = MULT16_16(mid2, mid2) + side + 2*xp;
if (Er < QCONST32(6e-4f, 28) || El < QCONST32(6e-4f, 28))
@@ -714,7 +714,7 @@ static void compute_theta(struct band_ctx *ctx, struct split_ctx *sctx,
if (qn!=1)
{
if (encode)
- itheta = (itheta*qn+8192)>>14;
+ itheta = (itheta*(opus_int32)qn+8192)>>14;
/* Entropy coding of the angle. We use a uniform pdf for the
time split, a step for stereo, and a triangular one for the rest. */
diff --git a/thirdparty/opus/celt/celt.h b/thirdparty/opus/celt/celt.h
index a423b95046..d1f7eb690d 100644
--- a/thirdparty/opus/celt/celt.h
+++ b/thirdparty/opus/celt/celt.h
@@ -209,7 +209,7 @@ void comb_filter_const_c(opus_val32 *y, opus_val32 *x, int T, int N,
#endif
#ifndef OVERRIDE_COMB_FILTER_CONST
-# define comb_filter_const(y, x, T, N, g10, g11, g12, arch) \
+# define comb_filter_const(y, x, T, N, g10, g11, g12, arch) \
((void)(arch),comb_filter_const_c(y, x, T, N, g10, g11, g12))
#endif
diff --git a/thirdparty/opus/celt/celt_decoder.c b/thirdparty/opus/celt/celt_decoder.c
index b688f2a4e3..b978bb34d1 100644
--- a/thirdparty/opus/celt/celt_decoder.c
+++ b/thirdparty/opus/celt/celt_decoder.c
@@ -82,6 +82,7 @@ struct OpusCustomDecoder {
int error;
int last_pitch_index;
int loss_count;
+ int skip_plc;
int postfilter_period;
int postfilter_period_old;
opus_val16 postfilter_gain;
@@ -164,8 +165,6 @@ OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_init(CELTDecoder *st, const CELTMod
st->signalling = 1;
st->arch = opus_select_arch();
- st->loss_count = 0;
-
opus_custom_decoder_ctl(st, OPUS_RESET_STATE);
return OPUS_OK;
@@ -447,7 +446,7 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM)
loss_count = st->loss_count;
start = st->start;
- noise_based = loss_count >= 5 || start != 0;
+ noise_based = loss_count >= 5 || start != 0 || st->skip_plc;
if (noise_based)
{
/* Noise-based PLC/CNG */
@@ -832,6 +831,10 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat
return frame_size/st->downsample;
}
+ /* Check if there are at least two packets received consecutively before
+ * turning on the pitch-based PLC */
+ st->skip_plc = st->loss_count != 0;
+
if (dec == NULL)
{
ec_dec_init(&_dec,(unsigned char*)data,len);
@@ -1198,6 +1201,7 @@ int opus_custom_decoder_ctl(CELTDecoder * OPUS_RESTRICT st, int request, ...)
((char*)&st->DECODER_RESET_START - (char*)st));
for (i=0;i<2*st->mode->nbEBands;i++)
oldLogE[i]=oldLogE2[i]=-QCONST16(28.f,DB_SHIFT);
+ st->skip_plc = 1;
}
break;
case OPUS_GET_PITCH_REQUEST:
diff --git a/thirdparty/opus/celt/celt_encoder.c b/thirdparty/opus/celt/celt_encoder.c
index 41fbfd49c8..3ee7a4d3f7 100644
--- a/thirdparty/opus/celt/celt_encoder.c
+++ b/thirdparty/opus/celt/celt_encoder.c
@@ -1175,10 +1175,10 @@ static int run_prefilter(CELTEncoder *st, celt_sig *in, celt_sig *prefilter_mem,
if (N>COMBFILTER_MAXPERIOD)
{
- OPUS_MOVE(prefilter_mem+c*COMBFILTER_MAXPERIOD, pre[c]+N, COMBFILTER_MAXPERIOD);
+ OPUS_COPY(prefilter_mem+c*COMBFILTER_MAXPERIOD, pre[c]+N, COMBFILTER_MAXPERIOD);
} else {
OPUS_MOVE(prefilter_mem+c*COMBFILTER_MAXPERIOD, prefilter_mem+c*COMBFILTER_MAXPERIOD+N, COMBFILTER_MAXPERIOD-N);
- OPUS_MOVE(prefilter_mem+c*COMBFILTER_MAXPERIOD+COMBFILTER_MAXPERIOD-N, pre[c]+COMBFILTER_MAXPERIOD, N);
+ OPUS_COPY(prefilter_mem+c*COMBFILTER_MAXPERIOD+COMBFILTER_MAXPERIOD-N, pre[c]+COMBFILTER_MAXPERIOD, N);
}
} while (++c<CC);
@@ -1281,12 +1281,15 @@ static int compute_vbr(const CELTMode *mode, AnalysisInfo *analysis, opus_int32
if ((!has_surround_mask||lfe) && (constrained_vbr || bitrate<64000))
{
- opus_val16 rate_factor;
+ opus_val16 rate_factor = Q15ONE;
+ if (bitrate < 64000)
+ {
#ifdef FIXED_POINT
- rate_factor = MAX16(0,(bitrate-32000));
+ rate_factor = MAX16(0,(bitrate-32000));
#else
- rate_factor = MAX16(0,(1.f/32768)*(bitrate-32000));
+ rate_factor = MAX16(0,(1.f/32768)*(bitrate-32000));
#endif
+ }
if (constrained_vbr)
rate_factor = MIN16(rate_factor, QCONST16(0.67f, 15));
target = base_target + (opus_int32)MULT16_32_Q15(rate_factor, target-base_target);
diff --git a/thirdparty/opus/celt/celt_lpc.c b/thirdparty/opus/celt/celt_lpc.c
index f02145af0d..b410a21c5f 100644
--- a/thirdparty/opus/celt/celt_lpc.c
+++ b/thirdparty/opus/celt/celt_lpc.c
@@ -49,8 +49,7 @@ int p
float *lpc = _lpc;
#endif
- for (i = 0; i < p; i++)
- lpc[i] = 0;
+ OPUS_CLEAR(lpc, p);
if (ac[0] != 0)
{
for (i = 0; i < p; i++) {
diff --git a/thirdparty/opus/celt/cwrs.c b/thirdparty/opus/celt/cwrs.c
index 2fa9f89cd6..9722f0ac86 100644
--- a/thirdparty/opus/celt/cwrs.c
+++ b/thirdparty/opus/celt/cwrs.c
@@ -74,7 +74,7 @@ int log2_frac(opus_uint32 val, int frac)
/*Although derived separately, the pulse vector coding scheme is equivalent to
a Pyramid Vector Quantizer \cite{Fis86}.
Some additional notes about an early version appear at
- http://people.xiph.org/~tterribe/notes/cwrs.html, but the codebook ordering
+ https://people.xiph.org/~tterribe/notes/cwrs.html, but the codebook ordering
and the definitions of some terms have evolved since that was written.
The conversion from a pulse vector to an integer index (encoding) and back
diff --git a/thirdparty/opus/celt/fixed_generic.h b/thirdparty/opus/celt/fixed_generic.h
index ac67d37ce8..1cfd6d6989 100644
--- a/thirdparty/opus/celt/fixed_generic.h
+++ b/thirdparty/opus/celt/fixed_generic.h
@@ -37,16 +37,32 @@
#define MULT16_16SU(a,b) ((opus_val32)(opus_val16)(a)*(opus_val32)(opus_uint16)(b))
/** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */
+#if OPUS_FAST_INT64
+#define MULT16_32_Q16(a,b) ((opus_val32)SHR((opus_int64)((opus_val16)(a))*(b),16))
+#else
#define MULT16_32_Q16(a,b) ADD32(MULT16_16((a),SHR((b),16)), SHR(MULT16_16SU((a),((b)&0x0000ffff)),16))
+#endif
/** 16x32 multiplication, followed by a 16-bit shift right (round-to-nearest). Results fits in 32 bits */
+#if OPUS_FAST_INT64
+#define MULT16_32_P16(a,b) ((opus_val32)PSHR((opus_int64)((opus_val16)(a))*(b),16))
+#else
#define MULT16_32_P16(a,b) ADD32(MULT16_16((a),SHR((b),16)), PSHR(MULT16_16SU((a),((b)&0x0000ffff)),16))
+#endif
/** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */
+#if OPUS_FAST_INT64
+#define MULT16_32_Q15(a,b) ((opus_val32)SHR((opus_int64)((opus_val16)(a))*(b),15))
+#else
#define MULT16_32_Q15(a,b) ADD32(SHL(MULT16_16((a),SHR((b),16)),1), SHR(MULT16_16SU((a),((b)&0x0000ffff)),15))
+#endif
/** 32x32 multiplication, followed by a 31-bit shift right. Results fits in 32 bits */
+#if OPUS_FAST_INT64
+#define MULT32_32_Q31(a,b) ((opus_val32)SHR((opus_int64)(a)*(opus_int64)(b),31))
+#else
#define MULT32_32_Q31(a,b) ADD32(ADD32(SHL(MULT16_16(SHR((a),16),SHR((b),16)),1), SHR(MULT16_16SU(SHR((a),16),((b)&0x0000ffff)),15)), SHR(MULT16_16SU(SHR((b),16),((a)&0x0000ffff)),15))
+#endif
/** Compile-time conversion of float constant to 16-bit value */
#define QCONST16(x,bits) ((opus_val16)(.5+(x)*(((opus_val32)1)<<(bits))))
diff --git a/thirdparty/opus/celt/kiss_fft.c b/thirdparty/opus/celt/kiss_fft.c
index 4ed37d2bb7..1f8fd05321 100644
--- a/thirdparty/opus/celt/kiss_fft.c
+++ b/thirdparty/opus/celt/kiss_fft.c
@@ -191,7 +191,7 @@ static void kf_bfly3(
kiss_fft_cpx * Fout_beg = Fout;
#ifdef FIXED_POINT
- epi3.r = -16384;
+ /*epi3.r = -16384;*/ /* Unused */
epi3.i = -28378;
#else
epi3 = st->twiddles[fstride*m];
diff --git a/thirdparty/opus/celt/mathops.c b/thirdparty/opus/celt/mathops.c
index 3f8c5dcc0e..21a01f52e4 100644
--- a/thirdparty/opus/celt/mathops.c
+++ b/thirdparty/opus/celt/mathops.c
@@ -164,7 +164,7 @@ opus_val16 celt_cos_norm(opus_val32 x)
{
return _celt_cos_pi_2(EXTRACT16(x));
} else {
- return NEG32(_celt_cos_pi_2(EXTRACT16(65536-x)));
+ return NEG16(_celt_cos_pi_2(EXTRACT16(65536-x)));
}
} else {
if (x&0x0000ffff)
diff --git a/thirdparty/opus/celt/pitch.c b/thirdparty/opus/celt/pitch.c
index 1d89cb0342..bf46e7d562 100644
--- a/thirdparty/opus/celt/pitch.c
+++ b/thirdparty/opus/celt/pitch.c
@@ -412,6 +412,41 @@ void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTR
RESTORE_STACK;
}
+#ifdef FIXED_POINT
+static opus_val16 compute_pitch_gain(opus_val32 xy, opus_val32 xx, opus_val32 yy)
+{
+ opus_val32 x2y2;
+ int sx, sy, shift;
+ opus_val32 g;
+ opus_val16 den;
+ if (xy == 0 || xx == 0 || yy == 0)
+ return 0;
+ sx = celt_ilog2(xx)-14;
+ sy = celt_ilog2(yy)-14;
+ shift = sx + sy;
+ x2y2 = MULT16_16_Q14(VSHR32(xx, sx), VSHR32(yy, sy));
+ if (shift & 1) {
+ if (x2y2 < 32768)
+ {
+ x2y2 <<= 1;
+ shift--;
+ } else {
+ x2y2 >>= 1;
+ shift++;
+ }
+ }
+ den = celt_rsqrt_norm(x2y2);
+ g = MULT16_32_Q15(den, xy);
+ g = VSHR32(g, (shift>>1)-1);
+ return EXTRACT16(MIN32(g, Q15ONE));
+}
+#else
+static opus_val16 compute_pitch_gain(opus_val32 xy, opus_val32 xx, opus_val32 yy)
+{
+ return xy/celt_sqrt(1+xx*yy);
+}
+#endif
+
static const int second_check[16] = {0, 0, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2};
opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
int N, int *T0_, int prev_period, opus_val16 prev_gain, int arch)
@@ -450,18 +485,7 @@ opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
yy = yy_lookup[T0];
best_xy = xy;
best_yy = yy;
-#ifdef FIXED_POINT
- {
- opus_val32 x2y2;
- int sh, t;
- x2y2 = 1+HALF32(MULT32_32_Q31(xx,yy));
- sh = celt_ilog2(x2y2)>>1;
- t = VSHR32(x2y2, 2*(sh-7));
- g = g0 = VSHR32(MULT16_32_Q15(celt_rsqrt_norm(t), xy),sh+1);
- }
-#else
- g = g0 = xy/celt_sqrt(1+xx*yy);
-#endif
+ g = g0 = compute_pitch_gain(xy, xx, yy);
/* Look for any pitch at T/k */
for (k=2;k<=15;k++)
{
@@ -484,24 +508,13 @@ opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
T1b = celt_udiv(2*second_check[k]*T0+k, 2*k);
}
dual_inner_prod(x, &x[-T1], &x[-T1b], N, &xy, &xy2, arch);
- xy += xy2;
- yy = yy_lookup[T1] + yy_lookup[T1b];
-#ifdef FIXED_POINT
- {
- opus_val32 x2y2;
- int sh, t;
- x2y2 = 1+MULT32_32_Q31(xx,yy);
- sh = celt_ilog2(x2y2)>>1;
- t = VSHR32(x2y2, 2*(sh-7));
- g1 = VSHR32(MULT16_32_Q15(celt_rsqrt_norm(t), xy),sh+1);
- }
-#else
- g1 = xy/celt_sqrt(1+2.f*xx*1.f*yy);
-#endif
+ xy = HALF32(xy + xy2);
+ yy = HALF32(yy_lookup[T1] + yy_lookup[T1b]);
+ g1 = compute_pitch_gain(xy, xx, yy);
if (abs(T1-prev_period)<=1)
cont = prev_gain;
else if (abs(T1-prev_period)<=2 && 5*k*k < T0)
- cont = HALF32(prev_gain);
+ cont = HALF16(prev_gain);
else
cont = 0;
thresh = MAX16(QCONST16(.3f,15), MULT16_16_Q15(QCONST16(.7f,15),g0)-cont);
diff --git a/thirdparty/opus/celt/pitch.h b/thirdparty/opus/celt/pitch.h
index 65a77a6ecc..d3503532a0 100644
--- a/thirdparty/opus/celt/pitch.h
+++ b/thirdparty/opus/celt/pitch.h
@@ -187,25 +187,6 @@ celt_pitch_xcorr_c(const opus_val16 *_x, const opus_val16 *_y,
opus_val32 *xcorr, int len, int max_pitch);
#if !defined(OVERRIDE_PITCH_XCORR)
-/*Is run-time CPU detection enabled on this platform?*/
-# if defined(OPUS_HAVE_RTCD) && (defined(OPUS_ARM_ASM) \
- || (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) \
- && !defined(OPUS_ARM_PRESUME_NEON_INTR)))
-extern
-# if defined(FIXED_POINT)
-opus_val32
-# else
-void
-# endif
-(*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *,
- const opus_val16 *, opus_val32 *, int, int);
-
-# define OVERRIDE_PITCH_XCORR
-# define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \
- ((*CELT_PITCH_XCORR_IMPL[(arch)&OPUS_ARCHMASK])(_x, _y, \
- xcorr, len, max_pitch))
-# else
-
#ifdef FIXED_POINT
opus_val32
#else
@@ -214,7 +195,6 @@ void
celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y,
opus_val32 *xcorr, int len, int max_pitch, int arch);
-# endif
#endif
#endif
diff --git a/thirdparty/opus/celt/rate.c b/thirdparty/opus/celt/rate.c
index b28d8feccd..7dfa5be8a6 100644
--- a/thirdparty/opus/celt/rate.c
+++ b/thirdparty/opus/celt/rate.c
@@ -296,7 +296,7 @@ static OPUS_INLINE int interp_bits2pulses(const CELTMode *m, int start, int end,
done = 0;
for (j=end;j-->start;)
{
- int tmp = bits1[j] + (lo*bits2[j]>>ALLOC_STEPS);
+ int tmp = bits1[j] + ((opus_int32)lo*bits2[j]>>ALLOC_STEPS);
if (tmp < thresh[j] && !done)
{
if (tmp >= alloc_floor)
diff --git a/thirdparty/opus/celt/vq.c b/thirdparty/opus/celt/vq.c
index f358396065..d29f38fd8e 100644
--- a/thirdparty/opus/celt/vq.c
+++ b/thirdparty/opus/celt/vq.c
@@ -271,7 +271,7 @@ unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc
best_id = 0;
/* The squared magnitude term gets added anyway, so we might as well
add it outside the loop */
- yy = ADD32(yy, 1);
+ yy = ADD16(yy, 1);
j=0;
do {
opus_val16 Rxy, Ryy;
diff --git a/thirdparty/opus/celt/x86/pitch_sse.h b/thirdparty/opus/celt/x86/pitch_sse.h
index d4cbeb8b9c..e5f87ab51a 100644
--- a/thirdparty/opus/celt/x86/pitch_sse.h
+++ b/thirdparty/opus/celt/x86/pitch_sse.h
@@ -102,21 +102,21 @@ opus_val32 celt_inner_prod_sse(
#if defined(OPUS_X86_PRESUME_SSE4_1) && defined(FIXED_POINT)
#define OVERRIDE_CELT_INNER_PROD
#define celt_inner_prod(x, y, N, arch) \
- ((void)arch, celt_inner_prod_sse4_1(x, y, N))
+ ((void)arch, celt_inner_prod_sse4_1(x, y, N))
#elif defined(OPUS_X86_PRESUME_SSE2) && defined(FIXED_POINT) && !defined(OPUS_X86_MAY_HAVE_SSE4_1)
#define OVERRIDE_CELT_INNER_PROD
#define celt_inner_prod(x, y, N, arch) \
- ((void)arch, celt_inner_prod_sse2(x, y, N))
+ ((void)arch, celt_inner_prod_sse2(x, y, N))
#elif defined(OPUS_X86_PRESUME_SSE) && !defined(FIXED_POINT)
#define OVERRIDE_CELT_INNER_PROD
#define celt_inner_prod(x, y, N, arch) \
- ((void)arch, celt_inner_prod_sse(x, y, N))
+ ((void)arch, celt_inner_prod_sse(x, y, N))
#elif ((defined(OPUS_X86_MAY_HAVE_SSE4_1) || defined(OPUS_X86_MAY_HAVE_SSE2)) && defined(FIXED_POINT)) || \
- (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(FIXED_POINT))
+ (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(FIXED_POINT))
extern opus_val32 (*const CELT_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
const opus_val16 *x,
@@ -138,19 +138,19 @@ extern opus_val32 (*const CELT_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
#undef comb_filter_const
void dual_inner_prod_sse(const opus_val16 *x,
- const opus_val16 *y01,
- const opus_val16 *y02,
- int N,
- opus_val32 *xy1,
- opus_val32 *xy2);
+ const opus_val16 *y01,
+ const opus_val16 *y02,
+ int N,
+ opus_val32 *xy1,
+ opus_val32 *xy2);
void comb_filter_const_sse(opus_val32 *y,
- opus_val32 *x,
- int T,
- int N,
- opus_val16 g10,
- opus_val16 g11,
- opus_val16 g12);
+ opus_val32 *x,
+ int T,
+ int N,
+ opus_val16 g10,
+ opus_val16 g11,
+ opus_val16 g12);
#if defined(OPUS_X86_PRESUME_SSE)
@@ -169,7 +169,7 @@ extern void (*const DUAL_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
opus_val32 *xy1,
opus_val32 *xy2);
-#define dual_inner_prod(x, y01, y02, N, xy1, xy2, arch) \
+#define dual_inner_prod(x, y01, y02, N, xy1, xy2, arch) \
((*DUAL_INNER_PROD_IMPL[(arch) & OPUS_ARCHMASK])(x, y01, y02, N, xy1, xy2))
extern void (*const COMB_FILTER_CONST_IMPL[OPUS_ARCHMASK + 1])(
@@ -181,7 +181,7 @@ extern void (*const COMB_FILTER_CONST_IMPL[OPUS_ARCHMASK + 1])(
opus_val16 g11,
opus_val16 g12);
-#define comb_filter_const(y, x, T, N, g10, g11, g12, arch) \
+#define comb_filter_const(y, x, T, N, g10, g11, g12, arch) \
((*COMB_FILTER_CONST_IMPL[(arch) & OPUS_ARCHMASK])(y, x, T, N, g10, g11, g12))
#define NON_STATIC_COMB_FILTER_CONST_C
diff --git a/thirdparty/opus/celt/x86/x86_celt_map.c b/thirdparty/opus/celt/x86/x86_celt_map.c
index 8e5e449275..47ba41b9ee 100644
--- a/thirdparty/opus/celt/x86/x86_celt_map.c
+++ b/thirdparty/opus/celt/x86/x86_celt_map.c
@@ -72,7 +72,7 @@ void (*const XCORR_KERNEL_IMPL[OPUS_ARCHMASK + 1])(
#endif
#if (defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)) || \
- (!defined(OPUS_X86_MAY_HAVE_SSE_4_1) && defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2))
+ (!defined(OPUS_X86_MAY_HAVE_SSE_4_1) && defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2))
opus_val32 (*const CELT_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
const opus_val16 *x,
diff --git a/thirdparty/opus/celt/x86/x86cpu.c b/thirdparty/opus/celt/x86/x86cpu.c
index 555a576b8a..080eb25e41 100644
--- a/thirdparty/opus/celt/x86/x86cpu.c
+++ b/thirdparty/opus/celt/x86/x86cpu.c
@@ -46,7 +46,7 @@
#include <intrin.h>
static _inline void cpuid(unsigned int CPUInfo[4], unsigned int InfoType)
{
- __cpuid((int*)CPUInfo, InfoType);
+ __cpuid((int*)CPUInfo, InfoType);
}
#else
diff --git a/thirdparty/opus/opus_multistream_encoder.c b/thirdparty/opus/opus_multistream_encoder.c
index e722e31ab8..1698223a16 100644
--- a/thirdparty/opus/opus_multistream_encoder.c
+++ b/thirdparty/opus/opus_multistream_encoder.c
@@ -277,7 +277,7 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b
sum = celt_inner_prod(in, in, frame_size+overlap, 0);
/* This should filter out both NaNs and ridiculous signals that could
cause NaNs further down. */
- if (!(sum < 1e9f) || celt_isnan(sum))
+ if (!(sum < 1e18f) || celt_isnan(sum))
{
OPUS_CLEAR(in, frame_size+overlap);
preemph_mem[c] = 0;
diff --git a/thirdparty/opus/silk/CNG.c b/thirdparty/opus/silk/CNG.c
index 61787c2302..8443ad63bb 100644
--- a/thirdparty/opus/silk/CNG.c
+++ b/thirdparty/opus/silk/CNG.c
@@ -34,9 +34,8 @@ POSSIBILITY OF SUCH DAMAGE.
/* Generates excitation for CNG LPC synthesis */
static OPUS_INLINE void silk_CNG_exc(
- opus_int32 exc_Q10[], /* O CNG excitation signal Q10 */
+ opus_int32 exc_Q14[], /* O CNG excitation signal Q10 */
opus_int32 exc_buf_Q14[], /* I Random samples buffer Q10 */
- opus_int32 Gain_Q16, /* I Gain to apply */
opus_int length, /* I Length */
opus_int32 *rand_seed /* I/O Seed to random index generator */
)
@@ -55,7 +54,7 @@ static OPUS_INLINE void silk_CNG_exc(
idx = (opus_int)( silk_RSHIFT( seed, 24 ) & exc_mask );
silk_assert( idx >= 0 );
silk_assert( idx <= CNG_BUF_MASK_MAX );
- exc_Q10[ i ] = (opus_int16)silk_SAT16( silk_SMULWW( exc_buf_Q14[ idx ], Gain_Q16 >> 4 ) );
+ exc_Q14[ i ] = exc_buf_Q14[ idx ];
}
*rand_seed = seed;
}
@@ -85,7 +84,7 @@ void silk_CNG(
)
{
opus_int i, subfr;
- opus_int32 sum_Q6, max_Gain_Q16, gain_Q16;
+ opus_int32 LPC_pred_Q10, max_Gain_Q16, gain_Q16, gain_Q10;
opus_int16 A_Q12[ MAX_LPC_ORDER ];
silk_CNG_struct *psCNG = &psDec->sCNG;
SAVE_STACK;
@@ -124,8 +123,8 @@ void silk_CNG(
/* Add CNG when packet is lost or during DTX */
if( psDec->lossCnt ) {
- VARDECL( opus_int32, CNG_sig_Q10 );
- ALLOC( CNG_sig_Q10, length + MAX_LPC_ORDER, opus_int32 );
+ VARDECL( opus_int32, CNG_sig_Q14 );
+ ALLOC( CNG_sig_Q14, length + MAX_LPC_ORDER, opus_int32 );
/* Generate CNG excitation */
gain_Q16 = silk_SMULWW( psDec->sPLC.randScale_Q14, psDec->sPLC.prevGain_Q16[1] );
@@ -138,42 +137,46 @@ void silk_CNG(
gain_Q16 = silk_SUB_LSHIFT32(silk_SMULWW( psCNG->CNG_smth_Gain_Q16, psCNG->CNG_smth_Gain_Q16 ), gain_Q16, 5 );
gain_Q16 = silk_LSHIFT32( silk_SQRT_APPROX( gain_Q16 ), 8 );
}
- silk_CNG_exc( CNG_sig_Q10 + MAX_LPC_ORDER, psCNG->CNG_exc_buf_Q14, gain_Q16, length, &psCNG->rand_seed );
+ gain_Q10 = silk_RSHIFT( gain_Q16, 6 );
+
+ silk_CNG_exc( CNG_sig_Q14 + MAX_LPC_ORDER, psCNG->CNG_exc_buf_Q14, length, &psCNG->rand_seed );
/* Convert CNG NLSF to filter representation */
silk_NLSF2A( A_Q12, psCNG->CNG_smth_NLSF_Q15, psDec->LPC_order );
/* Generate CNG signal, by synthesis filtering */
- silk_memcpy( CNG_sig_Q10, psCNG->CNG_synth_state, MAX_LPC_ORDER * sizeof( opus_int32 ) );
+ silk_memcpy( CNG_sig_Q14, psCNG->CNG_synth_state, MAX_LPC_ORDER * sizeof( opus_int32 ) );
for( i = 0; i < length; i++ ) {
silk_assert( psDec->LPC_order == 10 || psDec->LPC_order == 16 );
/* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */
- sum_Q6 = silk_RSHIFT( psDec->LPC_order, 1 );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 1 ], A_Q12[ 0 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 2 ], A_Q12[ 1 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 3 ], A_Q12[ 2 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 4 ], A_Q12[ 3 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 5 ], A_Q12[ 4 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 6 ], A_Q12[ 5 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 7 ], A_Q12[ 6 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 8 ], A_Q12[ 7 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 9 ], A_Q12[ 8 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 10 ], A_Q12[ 9 ] );
+ LPC_pred_Q10 = silk_RSHIFT( psDec->LPC_order, 1 );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 1 ], A_Q12[ 0 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 2 ], A_Q12[ 1 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 3 ], A_Q12[ 2 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 4 ], A_Q12[ 3 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 5 ], A_Q12[ 4 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 6 ], A_Q12[ 5 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 7 ], A_Q12[ 6 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 8 ], A_Q12[ 7 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 9 ], A_Q12[ 8 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 10 ], A_Q12[ 9 ] );
if( psDec->LPC_order == 16 ) {
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 11 ], A_Q12[ 10 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 12 ], A_Q12[ 11 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 13 ], A_Q12[ 12 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 14 ], A_Q12[ 13 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 15 ], A_Q12[ 14 ] );
- sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 16 ], A_Q12[ 15 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 11 ], A_Q12[ 10 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 12 ], A_Q12[ 11 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 13 ], A_Q12[ 12 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 14 ], A_Q12[ 13 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 15 ], A_Q12[ 14 ] );
+ LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 16 ], A_Q12[ 15 ] );
}
/* Update states */
- CNG_sig_Q10[ MAX_LPC_ORDER + i ] = silk_ADD_LSHIFT( CNG_sig_Q10[ MAX_LPC_ORDER + i ], sum_Q6, 4 );
-
- frame[ i ] = silk_ADD_SAT16( frame[ i ], silk_RSHIFT_ROUND( CNG_sig_Q10[ MAX_LPC_ORDER + i ], 10 ) );
+ CNG_sig_Q14[ MAX_LPC_ORDER + i ] = silk_ADD_LSHIFT( CNG_sig_Q14[ MAX_LPC_ORDER + i ], LPC_pred_Q10, 4 );
+
+ /* Scale with Gain and add to input signal */
+ frame[ i ] = (opus_int16)silk_ADD_SAT16( frame[ i ], silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( CNG_sig_Q14[ MAX_LPC_ORDER + i ], gain_Q10 ), 8 ) ) );
+
}
- silk_memcpy( psCNG->CNG_synth_state, &CNG_sig_Q10[ length ], MAX_LPC_ORDER * sizeof( opus_int32 ) );
+ silk_memcpy( psCNG->CNG_synth_state, &CNG_sig_Q14[ length ], MAX_LPC_ORDER * sizeof( opus_int32 ) );
} else {
silk_memset( psCNG->CNG_synth_state, 0, psDec->LPC_order * sizeof( opus_int32 ) );
}
diff --git a/thirdparty/opus/silk/NLSF_del_dec_quant.c b/thirdparty/opus/silk/NLSF_del_dec_quant.c
index c3b9efccfa..de88fee060 100644
--- a/thirdparty/opus/silk/NLSF_del_dec_quant.c
+++ b/thirdparty/opus/silk/NLSF_del_dec_quant.c
@@ -46,8 +46,9 @@ opus_int32 silk_NLSF_del_dec_quant( /* O Returns
)
{
opus_int i, j, nStates, ind_tmp, ind_min_max, ind_max_min, in_Q10, res_Q10;
- opus_int pred_Q10, diff_Q10, out0_Q10, out1_Q10, rate0_Q5, rate1_Q5;
- opus_int32 RD_tmp_Q25, min_Q25, min_max_Q25, max_min_Q25, pred_coef_Q16;
+ opus_int pred_Q10, diff_Q10, rate0_Q5, rate1_Q5;
+ opus_int16 out0_Q10, out1_Q10;
+ opus_int32 RD_tmp_Q25, min_Q25, min_max_Q25, max_min_Q25;
opus_int ind_sort[ NLSF_QUANT_DEL_DEC_STATES ];
opus_int8 ind[ NLSF_QUANT_DEL_DEC_STATES ][ MAX_LPC_ORDER ];
opus_int16 prev_out_Q10[ 2 * NLSF_QUANT_DEL_DEC_STATES ];
@@ -74,8 +75,8 @@ opus_int32 silk_NLSF_del_dec_quant( /* O Returns
out0_Q10 = silk_ADD16( out0_Q10, SILK_FIX_CONST( NLSF_QUANT_LEVEL_ADJ, 10 ) );
out1_Q10 = silk_ADD16( out1_Q10, SILK_FIX_CONST( NLSF_QUANT_LEVEL_ADJ, 10 ) );
}
- out0_Q10_table[ i + NLSF_QUANT_MAX_AMPLITUDE_EXT ] = silk_SMULWB( (opus_int32)out0_Q10, quant_step_size_Q16 );
- out1_Q10_table[ i + NLSF_QUANT_MAX_AMPLITUDE_EXT ] = silk_SMULWB( (opus_int32)out1_Q10, quant_step_size_Q16 );
+ out0_Q10_table[ i + NLSF_QUANT_MAX_AMPLITUDE_EXT ] = silk_RSHIFT( silk_SMULBB( out0_Q10, quant_step_size_Q16 ), 16 );
+ out1_Q10_table[ i + NLSF_QUANT_MAX_AMPLITUDE_EXT ] = silk_RSHIFT( silk_SMULBB( out1_Q10, quant_step_size_Q16 ), 16 );
}
silk_assert( (NLSF_QUANT_DEL_DEC_STATES & (NLSF_QUANT_DEL_DEC_STATES-1)) == 0 ); /* must be power of two */
@@ -85,12 +86,11 @@ opus_int32 silk_NLSF_del_dec_quant( /* O Returns
prev_out_Q10[ 0 ] = 0;
for( i = order - 1; ; i-- ) {
rates_Q5 = &ec_rates_Q5[ ec_ix[ i ] ];
- pred_coef_Q16 = silk_LSHIFT( (opus_int32)pred_coef_Q8[ i ], 8 );
in_Q10 = x_Q10[ i ];
for( j = 0; j < nStates; j++ ) {
- pred_Q10 = silk_SMULWB( pred_coef_Q16, prev_out_Q10[ j ] );
+ pred_Q10 = silk_RSHIFT( silk_SMULBB( (opus_int16)pred_coef_Q8[ i ], prev_out_Q10[ j ] ), 8 );
res_Q10 = silk_SUB16( in_Q10, pred_Q10 );
- ind_tmp = silk_SMULWB( (opus_int32)inv_quant_step_size_Q6, res_Q10 );
+ ind_tmp = silk_RSHIFT( silk_SMULBB( inv_quant_step_size_Q6, res_Q10 ), 16 );
ind_tmp = silk_LIMIT( ind_tmp, -NLSF_QUANT_MAX_AMPLITUDE_EXT, NLSF_QUANT_MAX_AMPLITUDE_EXT-1 );
ind[ j ][ i ] = (opus_int8)ind_tmp;
diff --git a/thirdparty/opus/silk/NLSF_encode.c b/thirdparty/opus/silk/NLSF_encode.c
index 03a036fda2..f03c3f1c35 100644
--- a/thirdparty/opus/silk/NLSF_encode.c
+++ b/thirdparty/opus/silk/NLSF_encode.c
@@ -46,7 +46,7 @@ opus_int32 silk_NLSF_encode( /* O Returns
)
{
opus_int i, s, ind1, bestIndex, prob_Q8, bits_q7;
- opus_int32 W_tmp_Q9;
+ opus_int32 W_tmp_Q9, ret;
VARDECL( opus_int32, err_Q26 );
VARDECL( opus_int32, RD_Q25 );
VARDECL( opus_int, tempIndices1 );
@@ -131,6 +131,7 @@ opus_int32 silk_NLSF_encode( /* O Returns
/* Decode */
silk_NLSF_decode( pNLSF_Q15, NLSFIndices, psNLSF_CB );
+ ret = RD_Q25[ 0 ];
RESTORE_STACK;
- return RD_Q25[ 0 ];
+ return ret;
}
diff --git a/thirdparty/opus/silk/NLSF_stabilize.c b/thirdparty/opus/silk/NLSF_stabilize.c
index 1fa1ea379b..8f3426b91e 100644
--- a/thirdparty/opus/silk/NLSF_stabilize.c
+++ b/thirdparty/opus/silk/NLSF_stabilize.c
@@ -130,7 +130,7 @@ void silk_NLSF_stabilize(
/* Keep delta_min distance between the NLSFs */
for( i = 1; i < L; i++ )
- NLSF_Q15[i] = silk_max_int( NLSF_Q15[i], NLSF_Q15[i-1] + NDeltaMin_Q15[i] );
+ NLSF_Q15[i] = silk_max_int( NLSF_Q15[i], silk_ADD_SAT16( NLSF_Q15[i-1], NDeltaMin_Q15[i] ) );
/* Last NLSF should be no higher than 1 - NDeltaMin[L] */
NLSF_Q15[L-1] = silk_min_int( NLSF_Q15[L-1], (1<<15) - NDeltaMin_Q15[L] );
diff --git a/thirdparty/opus/silk/NSQ.c b/thirdparty/opus/silk/NSQ.c
index a065884070..43e3fee7e0 100644
--- a/thirdparty/opus/silk/NSQ.c
+++ b/thirdparty/opus/silk/NSQ.c
@@ -31,6 +31,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "main.h"
#include "stack_alloc.h"
+#include "NSQ.h"
+
static OPUS_INLINE void silk_nsq_scale_states(
const silk_encoder_state *psEncC, /* I Encoder State */
@@ -66,7 +68,8 @@ static OPUS_INLINE void silk_noise_shape_quantizer(
opus_int offset_Q10, /* I */
opus_int length, /* I Input length */
opus_int shapingLPCOrder, /* I Noise shaping AR filter order */
- opus_int predictLPCOrder /* I Prediction filter order */
+ opus_int predictLPCOrder, /* I Prediction filter order */
+ int arch /* I Architecture */
);
#endif
@@ -155,7 +158,7 @@ void silk_NSQ_c
silk_noise_shape_quantizer( NSQ, psIndices->signalType, x_sc_Q10, pulses, pxq, sLTP_Q15, A_Q12, B_Q14,
AR_shp_Q13, lag, HarmShapeFIRPacked_Q14, Tilt_Q14[ k ], LF_shp_Q14[ k ], Gains_Q16[ k ], Lambda_Q10,
- offset_Q10, psEncC->subfr_length, psEncC->shapingLPCOrder, psEncC->predictLPCOrder );
+ offset_Q10, psEncC->subfr_length, psEncC->shapingLPCOrder, psEncC->predictLPCOrder, psEncC->arch );
x_Q3 += psEncC->subfr_length;
pulses += psEncC->subfr_length;
@@ -198,15 +201,19 @@ void silk_noise_shape_quantizer(
opus_int offset_Q10, /* I */
opus_int length, /* I Input length */
opus_int shapingLPCOrder, /* I Noise shaping AR filter order */
- opus_int predictLPCOrder /* I Prediction filter order */
+ opus_int predictLPCOrder, /* I Prediction filter order */
+ int arch /* I Architecture */
)
{
- opus_int i, j;
+ opus_int i;
opus_int32 LTP_pred_Q13, LPC_pred_Q10, n_AR_Q12, n_LTP_Q13;
opus_int32 n_LF_Q12, r_Q10, rr_Q10, q1_Q0, q1_Q10, q2_Q10, rd1_Q20, rd2_Q20;
opus_int32 exc_Q14, LPC_exc_Q14, xq_Q14, Gain_Q10;
opus_int32 tmp1, tmp2, sLF_AR_shp_Q14;
opus_int32 *psLPC_Q14, *shp_lag_ptr, *pred_lag_ptr;
+#ifdef silk_short_prediction_create_arch_coef
+ opus_int32 a_Q12_arch[MAX_LPC_ORDER];
+#endif
shp_lag_ptr = &NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - lag + HARM_SHAPE_FIR_TAPS / 2 ];
pred_lag_ptr = &sLTP_Q15[ NSQ->sLTP_buf_idx - lag + LTP_ORDER / 2 ];
@@ -215,32 +222,16 @@ void silk_noise_shape_quantizer(
/* Set up short term AR state */
psLPC_Q14 = &NSQ->sLPC_Q14[ NSQ_LPC_BUF_LENGTH - 1 ];
+#ifdef silk_short_prediction_create_arch_coef
+ silk_short_prediction_create_arch_coef(a_Q12_arch, a_Q12, predictLPCOrder);
+#endif
+
for( i = 0; i < length; i++ ) {
/* Generate dither */
NSQ->rand_seed = silk_RAND( NSQ->rand_seed );
/* Short-term prediction */
- silk_assert( predictLPCOrder == 10 || predictLPCOrder == 16 );
- /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */
- LPC_pred_Q10 = silk_RSHIFT( predictLPCOrder, 1 );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ 0 ], a_Q12[ 0 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -1 ], a_Q12[ 1 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -2 ], a_Q12[ 2 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -3 ], a_Q12[ 3 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -4 ], a_Q12[ 4 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -5 ], a_Q12[ 5 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -6 ], a_Q12[ 6 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -7 ], a_Q12[ 7 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -8 ], a_Q12[ 8 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -9 ], a_Q12[ 9 ] );
- if( predictLPCOrder == 16 ) {
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -10 ], a_Q12[ 10 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -11 ], a_Q12[ 11 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -12 ], a_Q12[ 12 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -13 ], a_Q12[ 13 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -14 ], a_Q12[ 14 ] );
- LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -15 ], a_Q12[ 15 ] );
- }
+ LPC_pred_Q10 = silk_noise_shape_quantizer_short_prediction(psLPC_Q14, a_Q12, a_Q12_arch, predictLPCOrder, arch);
/* Long-term prediction */
if( signalType == TYPE_VOICED ) {
@@ -259,23 +250,8 @@ void silk_noise_shape_quantizer(
/* Noise shape feedback */
silk_assert( ( shapingLPCOrder & 1 ) == 0 ); /* check that order is even */
- tmp2 = psLPC_Q14[ 0 ];
- tmp1 = NSQ->sAR2_Q14[ 0 ];
- NSQ->sAR2_Q14[ 0 ] = tmp2;
- n_AR_Q12 = silk_RSHIFT( shapingLPCOrder, 1 );
- n_AR_Q12 = silk_SMLAWB( n_AR_Q12, tmp2, AR_shp_Q13[ 0 ] );
- for( j = 2; j < shapingLPCOrder; j += 2 ) {
- tmp2 = NSQ->sAR2_Q14[ j - 1 ];
- NSQ->sAR2_Q14[ j - 1 ] = tmp1;
- n_AR_Q12 = silk_SMLAWB( n_AR_Q12, tmp1, AR_shp_Q13[ j - 1 ] );
- tmp1 = NSQ->sAR2_Q14[ j + 0 ];
- NSQ->sAR2_Q14[ j + 0 ] = tmp2;
- n_AR_Q12 = silk_SMLAWB( n_AR_Q12, tmp2, AR_shp_Q13[ j ] );
- }
- NSQ->sAR2_Q14[ shapingLPCOrder - 1 ] = tmp1;
- n_AR_Q12 = silk_SMLAWB( n_AR_Q12, tmp1, AR_shp_Q13[ shapingLPCOrder - 1 ] );
+ n_AR_Q12 = silk_NSQ_noise_shape_feedback_loop(psLPC_Q14, NSQ->sAR2_Q14, AR_shp_Q13, shapingLPCOrder, arch);
- n_AR_Q12 = silk_LSHIFT32( n_AR_Q12, 1 ); /* Q11 -> Q12 */
n_AR_Q12 = silk_SMLAWB( n_AR_Q12, NSQ->sLF_AR_shp_Q14, Tilt_Q14 );
n_LF_Q12 = silk_SMULWB( NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - 1 ], LF_shp_Q14 );
diff --git a/thirdparty/opus/silk/NSQ_del_dec.c b/thirdparty/opus/silk/NSQ_del_dec.c
index aff560c221..ab6feeac98 100644
--- a/thirdparty/opus/silk/NSQ_del_dec.c
+++ b/thirdparty/opus/silk/NSQ_del_dec.c
@@ -31,6 +31,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "main.h"
#include "stack_alloc.h"
+#include "NSQ.h"
+
typedef struct {
opus_int32 sLPC_Q14[ MAX_SUB_FRAME_LENGTH + NSQ_LPC_BUF_LENGTH ];
@@ -106,7 +108,8 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec(
opus_int warping_Q16, /* I */
opus_int nStatesDelayedDecision, /* I Number of states in decision tree */
opus_int *smpl_buf_idx, /* I Index to newest samples in buffers */
- opus_int decisionDelay /* I */
+ opus_int decisionDelay, /* I */
+ int arch /* I */
);
void silk_NSQ_del_dec_c(
@@ -260,7 +263,7 @@ void silk_NSQ_del_dec_c(
silk_noise_shape_quantizer_del_dec( NSQ, psDelDec, psIndices->signalType, x_sc_Q10, pulses, pxq, sLTP_Q15,
delayedGain_Q10, A_Q12, B_Q14, AR_shp_Q13, lag, HarmShapeFIRPacked_Q14, Tilt_Q14[ k ], LF_shp_Q14[ k ],
Gains_Q16[ k ], Lambda_Q10, offset_Q10, psEncC->subfr_length, subfr++, psEncC->shapingLPCOrder,
- psEncC->predictLPCOrder, psEncC->warping_Q16, psEncC->nStatesDelayedDecision, &smpl_buf_idx, decisionDelay );
+ psEncC->predictLPCOrder, psEncC->warping_Q16, psEncC->nStatesDelayedDecision, &smpl_buf_idx, decisionDelay, psEncC->arch );
x_Q3 += psEncC->subfr_length;
pulses += psEncC->subfr_length;
@@ -333,7 +336,8 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec(
opus_int warping_Q16, /* I */
opus_int nStatesDelayedDecision, /* I Number of states in decision tree */
opus_int *smpl_buf_idx, /* I Index to newest samples in buffers */
- opus_int decisionDelay /* I */
+ opus_int decisionDelay, /* I */
+ int arch /* I */
)
{
opus_int i, j, k, Winner_ind, RDmin_ind, RDmax_ind, last_smple_idx;
@@ -343,6 +347,10 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec(
opus_int32 q1_Q0, q1_Q10, q2_Q10, exc_Q14, LPC_exc_Q14, xq_Q14, Gain_Q10;
opus_int32 tmp1, tmp2, sLF_AR_shp_Q14;
opus_int32 *pred_lag_ptr, *shp_lag_ptr, *psLPC_Q14;
+#ifdef silk_short_prediction_create_arch_coef
+ opus_int32 a_Q12_arch[MAX_LPC_ORDER];
+#endif
+
VARDECL( NSQ_sample_pair, psSampleState );
NSQ_del_dec_struct *psDD;
NSQ_sample_struct *psSS;
@@ -355,6 +363,10 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec(
pred_lag_ptr = &sLTP_Q15[ NSQ->sLTP_buf_idx - lag + LTP_ORDER / 2 ];
Gain_Q10 = silk_RSHIFT( Gain_Q16, 6 );
+#ifdef silk_short_prediction_create_arch_coef
+ silk_short_prediction_create_arch_coef(a_Q12_arch, a_Q12, predictLPCOrder);
+#endif
+
for( i = 0; i < length; i++ ) {
/* Perform common calculations used in all states */
@@ -398,27 +410,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec(
/* Pointer used in short term prediction and shaping */
psLPC_Q14 = &psDD->sLPC_Q14[ NSQ_LPC_BUF_LENGTH - 1 + i ];
/* Short-term prediction */
- silk_assert( predictLPCOrder == 10 || predictLPCOrder == 16 );
- /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */
- LPC_pred_Q14 = silk_RSHIFT( predictLPCOrder, 1 );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ 0 ], a_Q12[ 0 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -1 ], a_Q12[ 1 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -2 ], a_Q12[ 2 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -3 ], a_Q12[ 3 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -4 ], a_Q12[ 4 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -5 ], a_Q12[ 5 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -6 ], a_Q12[ 6 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -7 ], a_Q12[ 7 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -8 ], a_Q12[ 8 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -9 ], a_Q12[ 9 ] );
- if( predictLPCOrder == 16 ) {
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -10 ], a_Q12[ 10 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -11 ], a_Q12[ 11 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -12 ], a_Q12[ 12 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -13 ], a_Q12[ 13 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -14 ], a_Q12[ 14 ] );
- LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -15 ], a_Q12[ 15 ] );
- }
+ LPC_pred_Q14 = silk_noise_shape_quantizer_short_prediction(psLPC_Q14, a_Q12, a_Q12_arch, predictLPCOrder, arch);
LPC_pred_Q14 = silk_LSHIFT( LPC_pred_Q14, 4 ); /* Q10 -> Q14 */
/* Noise shape feedback */
diff --git a/thirdparty/opus/silk/PLC.c b/thirdparty/opus/silk/PLC.c
index 34a94bc313..fb6ea887b7 100644
--- a/thirdparty/opus/silk/PLC.c
+++ b/thirdparty/opus/silk/PLC.c
@@ -365,7 +365,8 @@ static OPUS_INLINE void silk_PLC_conceal(
}
/* Add prediction to LPC excitation */
- sLPC_Q14_ptr[ MAX_LPC_ORDER + i ] = silk_ADD_LSHIFT32( sLPC_Q14_ptr[ MAX_LPC_ORDER + i ], LPC_pred_Q10, 4 );
+ sLPC_Q14_ptr[ MAX_LPC_ORDER + i ] = silk_ADD_SAT32( sLPC_Q14_ptr[ MAX_LPC_ORDER + i ],
+ silk_LSHIFT_SAT32( LPC_pred_Q10, 4 ));
/* Scale with Gain */
frame[ i ] = (opus_int16)silk_SAT16( silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( sLPC_Q14_ptr[ MAX_LPC_ORDER + i ], prevGain_Q10[ 1 ] ), 8 ) ) );
diff --git a/thirdparty/opus/silk/decode_core.c b/thirdparty/opus/silk/decode_core.c
index b88991e349..e569c0e72b 100644
--- a/thirdparty/opus/silk/decode_core.c
+++ b/thirdparty/opus/silk/decode_core.c
@@ -219,7 +219,7 @@ void silk_decode_core(
}
/* Add prediction to LPC excitation */
- sLPC_Q14[ MAX_LPC_ORDER + i ] = silk_ADD_LSHIFT32( pres_Q14[ i ], LPC_pred_Q10, 4 );
+ sLPC_Q14[ MAX_LPC_ORDER + i ] = silk_ADD_SAT32( pres_Q14[ i ], silk_LSHIFT_SAT32( LPC_pred_Q10, 4 ) );
/* Scale with gain */
pxq[ i ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( sLPC_Q14[ MAX_LPC_ORDER + i ], Gain_Q10 ), 8 ) );
diff --git a/thirdparty/opus/silk/fixed/burg_modified_FIX.c b/thirdparty/opus/silk/fixed/burg_modified_FIX.c
index 4878553b65..17d0e0993c 100644
--- a/thirdparty/opus/silk/fixed/burg_modified_FIX.c
+++ b/thirdparty/opus/silk/fixed/burg_modified_FIX.c
@@ -150,8 +150,11 @@ void silk_burg_modified_c(
C_first_row[ k ] = silk_MLA( C_first_row[ k ], x1, x_ptr[ n - k - 1 ] ); /* Q( -rshifts ) */
C_last_row[ k ] = silk_MLA( C_last_row[ k ], x2, x_ptr[ subfr_length - n + k ] ); /* Q( -rshifts ) */
Atmp1 = silk_RSHIFT_ROUND( Af_QA[ k ], QA - 17 ); /* Q17 */
- tmp1 = silk_MLA( tmp1, x_ptr[ n - k - 1 ], Atmp1 ); /* Q17 */
- tmp2 = silk_MLA( tmp2, x_ptr[ subfr_length - n + k ], Atmp1 ); /* Q17 */
+ /* We sometimes have get overflows in the multiplications (even beyond +/- 2^32),
+ but they cancel each other and the real result seems to always fit in a 32-bit
+ signed integer. This was determined experimentally, not theoretically (unfortunately). */
+ tmp1 = silk_MLA_ovflw( tmp1, x_ptr[ n - k - 1 ], Atmp1 ); /* Q17 */
+ tmp2 = silk_MLA_ovflw( tmp2, x_ptr[ subfr_length - n + k ], Atmp1 ); /* Q17 */
}
tmp1 = -tmp1; /* Q17 */
tmp2 = -tmp2; /* Q17 */
@@ -200,12 +203,14 @@ void silk_burg_modified_c(
/* Max prediction gain exceeded; set reflection coefficient such that max prediction gain is exactly hit */
tmp2 = ( (opus_int32)1 << 30 ) - silk_DIV32_varQ( minInvGain_Q30, invGain_Q30, 30 ); /* Q30 */
rc_Q31 = silk_SQRT_APPROX( tmp2 ); /* Q15 */
- /* Newton-Raphson iteration */
- rc_Q31 = silk_RSHIFT32( rc_Q31 + silk_DIV32( tmp2, rc_Q31 ), 1 ); /* Q15 */
- rc_Q31 = silk_LSHIFT32( rc_Q31, 16 ); /* Q31 */
- if( num < 0 ) {
- /* Ensure adjusted reflection coefficients has the original sign */
- rc_Q31 = -rc_Q31;
+ if( rc_Q31 > 0 ) {
+ /* Newton-Raphson iteration */
+ rc_Q31 = silk_RSHIFT32( rc_Q31 + silk_DIV32( tmp2, rc_Q31 ), 1 ); /* Q15 */
+ rc_Q31 = silk_LSHIFT32( rc_Q31, 16 ); /* Q31 */
+ if( num < 0 ) {
+ /* Ensure adjusted reflection coefficients has the original sign */
+ rc_Q31 = -rc_Q31;
+ }
}
invGain_Q30 = minInvGain_Q30;
reached_max_gain = 1;
diff --git a/thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse.c b/thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse.c
index 3756095fbe..3c3583c5fc 100644
--- a/thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse.c
+++ b/thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse.c
@@ -300,12 +300,14 @@ void silk_burg_modified_sse4_1(
/* Max prediction gain exceeded; set reflection coefficient such that max prediction gain is exactly hit */
tmp2 = ( (opus_int32)1 << 30 ) - silk_DIV32_varQ( minInvGain_Q30, invGain_Q30, 30 ); /* Q30 */
rc_Q31 = silk_SQRT_APPROX( tmp2 ); /* Q15 */
- /* Newton-Raphson iteration */
- rc_Q31 = silk_RSHIFT32( rc_Q31 + silk_DIV32( tmp2, rc_Q31 ), 1 ); /* Q15 */
- rc_Q31 = silk_LSHIFT32( rc_Q31, 16 ); /* Q31 */
- if( num < 0 ) {
- /* Ensure adjusted reflection coefficients has the original sign */
- rc_Q31 = -rc_Q31;
+ if( rc_Q31 > 0 ) {
+ /* Newton-Raphson iteration */
+ rc_Q31 = silk_RSHIFT32( rc_Q31 + silk_DIV32( tmp2, rc_Q31 ), 1 ); /* Q15 */
+ rc_Q31 = silk_LSHIFT32( rc_Q31, 16 ); /* Q31 */
+ if( num < 0 ) {
+ /* Ensure adjusted reflection coefficients has the original sign */
+ rc_Q31 = -rc_Q31;
+ }
}
invGain_Q30 = minInvGain_Q30;
reached_max_gain = 1;
diff --git a/thirdparty/opus/silk/macros.h b/thirdparty/opus/silk/macros.h
index bc30303466..d3ca347520 100644
--- a/thirdparty/opus/silk/macros.h
+++ b/thirdparty/opus/silk/macros.h
@@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "opus_types.h"
#include "opus_defines.h"
+#include "arch.h"
#if OPUS_GNUC_PREREQ(3, 0)
#define opus_likely(x) (__builtin_expect(!!(x), 1))
@@ -43,31 +44,32 @@ POSSIBILITY OF SUCH DAMAGE.
#define opus_unlikely(x) (!!(x))
#endif
-/* Set this if opus_int64 is a native type of the CPU. */
-#define OPUS_FAST_INT64 (defined(__x86_64__) || defined(__LP64__) || defined(_WIN64))
-
/* This is an OPUS_INLINE header file for general platform. */
/* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */
#if OPUS_FAST_INT64
-#define silk_SMULWB(a32, b32) (((a32) * (opus_int64)((opus_int16)(b32))) >> 16)
+#define silk_SMULWB(a32, b32) ((opus_int32)(((a32) * (opus_int64)((opus_int16)(b32))) >> 16))
#else
#define silk_SMULWB(a32, b32) ((((a32) >> 16) * (opus_int32)((opus_int16)(b32))) + ((((a32) & 0x0000FFFF) * (opus_int32)((opus_int16)(b32))) >> 16))
#endif
/* a32 + (b32 * (opus_int32)((opus_int16)(c32))) >> 16 output have to be 32bit int */
#if OPUS_FAST_INT64
-#define silk_SMLAWB(a32, b32, c32) ((a32) + (((b32) * (opus_int64)((opus_int16)(c32))) >> 16))
+#define silk_SMLAWB(a32, b32, c32) ((opus_int32)((a32) + (((b32) * (opus_int64)((opus_int16)(c32))) >> 16)))
#else
#define silk_SMLAWB(a32, b32, c32) ((a32) + ((((b32) >> 16) * (opus_int32)((opus_int16)(c32))) + ((((b32) & 0x0000FFFF) * (opus_int32)((opus_int16)(c32))) >> 16)))
#endif
/* (a32 * (b32 >> 16)) >> 16 */
+#if OPUS_FAST_INT64
+#define silk_SMULWT(a32, b32) ((opus_int32)(((a32) * (opus_int64)((b32) >> 16)) >> 16))
+#else
#define silk_SMULWT(a32, b32) (((a32) >> 16) * ((b32) >> 16) + ((((a32) & 0x0000FFFF) * ((b32) >> 16)) >> 16))
+#endif
/* a32 + (b32 * (c32 >> 16)) >> 16 */
#if OPUS_FAST_INT64
-#define silk_SMLAWT(a32, b32, c32) ((a32) + (((b32) * ((opus_int64)(c32) >> 16)) >> 16))
+#define silk_SMLAWT(a32, b32, c32) ((opus_int32)((a32) + (((b32) * ((opus_int64)(c32) >> 16)) >> 16)))
#else
#define silk_SMLAWT(a32, b32, c32) ((a32) + (((b32) >> 16) * ((c32) >> 16)) + ((((b32) & 0x0000FFFF) * ((c32) >> 16)) >> 16))
#endif
@@ -89,14 +91,14 @@ POSSIBILITY OF SUCH DAMAGE.
/* (a32 * b32) >> 16 */
#if OPUS_FAST_INT64
-#define silk_SMULWW(a32, b32) (((opus_int64)(a32) * (b32)) >> 16)
+#define silk_SMULWW(a32, b32) ((opus_int32)(((opus_int64)(a32) * (b32)) >> 16))
#else
#define silk_SMULWW(a32, b32) silk_MLA(silk_SMULWB((a32), (b32)), (a32), silk_RSHIFT_ROUND((b32), 16))
#endif
/* a32 + ((b32 * c32) >> 16) */
#if OPUS_FAST_INT64
-#define silk_SMLAWW(a32, b32, c32) ((a32) + (((opus_int64)(b32) * (c32)) >> 16))
+#define silk_SMLAWW(a32, b32, c32) ((opus_int32)((a32) + (((opus_int64)(b32) * (c32)) >> 16)))
#else
#define silk_SMLAWW(a32, b32, c32) silk_MLA(silk_SMLAWB((a32), (b32), (c32)), (b32), silk_RSHIFT_ROUND((c32), 16))
#endif
@@ -149,5 +151,9 @@ static OPUS_INLINE opus_int32 silk_CLZ32(opus_int32 in32)
#include "arm/macros_armv5e.h"
#endif
+#ifdef OPUS_ARM_PRESUME_AARCH64_NEON_INTR
+#include "arm/macros_arm64.h"
+#endif
+
#endif /* SILK_MACROS_H */
diff --git a/thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h b/thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h
index f6afd923e8..ad1cfe2a9b 100644
--- a/thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h
+++ b/thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h
@@ -62,7 +62,8 @@ static inline void silk_noise_shape_quantizer_del_dec(
opus_int warping_Q16, /* I */
opus_int nStatesDelayedDecision, /* I Number of states in decision tree */
opus_int *smpl_buf_idx, /* I Index to newest samples in buffers */
- opus_int decisionDelay /* I */
+ opus_int decisionDelay, /* I */
+ int arch /* I */
)
{
opus_int i, j, k, Winner_ind, RDmin_ind, RDmax_ind, last_smple_idx;
@@ -82,6 +83,9 @@ static inline void silk_noise_shape_quantizer_del_dec(
opus_int32 cur, prev, next;
+ /*Unused.*/
+ (void)arch;
+
//Intialize b_Q14 variables
b_Q14_0 = b_Q14[ 0 ];
b_Q14_1 = b_Q14[ 1 ];
diff --git a/thirdparty/opus/silk/process_NLSFs.c b/thirdparty/opus/silk/process_NLSFs.c
index c27cf03046..0ab71f0163 100644
--- a/thirdparty/opus/silk/process_NLSFs.c
+++ b/thirdparty/opus/silk/process_NLSFs.c
@@ -41,7 +41,7 @@ void silk_process_NLSFs(
{
opus_int i, doInterpolate;
opus_int NLSF_mu_Q20;
- opus_int32 i_sqr_Q15;
+ opus_int16 i_sqr_Q15;
opus_int16 pNLSF0_temp_Q15[ MAX_LPC_ORDER ];
opus_int16 pNLSFW_QW[ MAX_LPC_ORDER ];
opus_int16 pNLSFW0_temp_QW[ MAX_LPC_ORDER ];
@@ -79,7 +79,8 @@ void silk_process_NLSFs(
/* Update NLSF weights with contribution from first half */
i_sqr_Q15 = silk_LSHIFT( silk_SMULBB( psEncC->indices.NLSFInterpCoef_Q2, psEncC->indices.NLSFInterpCoef_Q2 ), 11 );
for( i = 0; i < psEncC->predictLPCOrder; i++ ) {
- pNLSFW_QW[ i ] = silk_SMLAWB( silk_RSHIFT( pNLSFW_QW[ i ], 1 ), (opus_int32)pNLSFW0_temp_QW[ i ], i_sqr_Q15 );
+ pNLSFW_QW[ i ] = silk_ADD16( silk_RSHIFT( pNLSFW_QW[ i ], 1 ), silk_RSHIFT(
+ silk_SMULBB( pNLSFW0_temp_QW[ i ], i_sqr_Q15 ), 16) );
silk_assert( pNLSFW_QW[ i ] >= 1 );
}
}
@@ -100,6 +101,7 @@ void silk_process_NLSFs(
} else {
/* Copy LPC coefficients for first half from second half */
+ silk_assert( psEncC->predictLPCOrder <= MAX_LPC_ORDER );
silk_memcpy( PredCoef_Q12[ 0 ], PredCoef_Q12[ 1 ], psEncC->predictLPCOrder * sizeof( opus_int16 ) );
}
}
diff --git a/thirdparty/opus/silk/sort.c b/thirdparty/opus/silk/sort.c
index 8670dbdd02..7187c9efb1 100644
--- a/thirdparty/opus/silk/sort.c
+++ b/thirdparty/opus/silk/sort.c
@@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
/* Best case: O(n) for an already sorted array */
/* Worst case: O(n^2) for an inversely sorted array */
/* */
-/* Shell short: http://en.wikipedia.org/wiki/Shell_sort */
+/* Shell short: https://en.wikipedia.org/wiki/Shell_sort */
#include "SigProc_FIX.h"
diff --git a/thirdparty/opus/silk/stereo_LR_to_MS.c b/thirdparty/opus/silk/stereo_LR_to_MS.c
index 42906e6f67..dda0298de2 100644
--- a/thirdparty/opus/silk/stereo_LR_to_MS.c
+++ b/thirdparty/opus/silk/stereo_LR_to_MS.c
@@ -77,7 +77,7 @@ void silk_stereo_LR_to_MS(
ALLOC( LP_mid, frame_length, opus_int16 );
ALLOC( HP_mid, frame_length, opus_int16 );
for( n = 0; n < frame_length; n++ ) {
- sum = silk_RSHIFT_ROUND( silk_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 2 );
+ sum = silk_RSHIFT_ROUND( silk_ADD_LSHIFT( mid[ n ] + (opus_int32)mid[ n + 2 ], mid[ n + 1 ], 1 ), 2 );
LP_mid[ n ] = sum;
HP_mid[ n ] = mid[ n + 1 ] - sum;
}
@@ -86,7 +86,7 @@ void silk_stereo_LR_to_MS(
ALLOC( LP_side, frame_length, opus_int16 );
ALLOC( HP_side, frame_length, opus_int16 );
for( n = 0; n < frame_length; n++ ) {
- sum = silk_RSHIFT_ROUND( silk_ADD_LSHIFT( side[ n ] + side[ n + 2 ], side[ n + 1 ], 1 ), 2 );
+ sum = silk_RSHIFT_ROUND( silk_ADD_LSHIFT( side[ n ] + (opus_int32)side[ n + 2 ], side[ n + 1 ], 1 ), 2 );
LP_side[ n ] = sum;
HP_side[ n ] = side[ n + 1 ] - sum;
}
@@ -207,7 +207,7 @@ void silk_stereo_LR_to_MS(
pred0_Q13 += delta0_Q13;
pred1_Q13 += delta1_Q13;
w_Q24 += deltaw_Q24;
- sum = silk_LSHIFT( silk_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 ); /* Q11 */
+ sum = silk_LSHIFT( silk_ADD_LSHIFT( mid[ n ] + (opus_int32)mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 ); /* Q11 */
sum = silk_SMLAWB( silk_SMULWB( w_Q24, side[ n + 1 ] ), sum, pred0_Q13 ); /* Q8 */
sum = silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)mid[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */
x2[ n - 1 ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sum, 8 ) );
@@ -217,7 +217,7 @@ void silk_stereo_LR_to_MS(
pred1_Q13 = -pred_Q13[ 1 ];
w_Q24 = silk_LSHIFT( width_Q14, 10 );
for( n = STEREO_INTERP_LEN_MS * fs_kHz; n < frame_length; n++ ) {
- sum = silk_LSHIFT( silk_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 ); /* Q11 */
+ sum = silk_LSHIFT( silk_ADD_LSHIFT( mid[ n ] + (opus_int32)mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 ); /* Q11 */
sum = silk_SMLAWB( silk_SMULWB( w_Q24, side[ n + 1 ] ), sum, pred0_Q13 ); /* Q8 */
sum = silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)mid[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */
x2[ n - 1 ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sum, 8 ) );
diff --git a/thirdparty/opus/silk/x86/NSQ_sse.c b/thirdparty/opus/silk/x86/NSQ_sse.c
index 72f34fd6fc..bb3c5f1955 100644
--- a/thirdparty/opus/silk/x86/NSQ_sse.c
+++ b/thirdparty/opus/silk/x86/NSQ_sse.c
@@ -221,7 +221,7 @@ void silk_NSQ_sse4_1(
{
silk_noise_shape_quantizer( NSQ, psIndices->signalType, x_sc_Q10, pulses, pxq, sLTP_Q15, A_Q12, B_Q14,
AR_shp_Q13, lag, HarmShapeFIRPacked_Q14, Tilt_Q14[ k ], LF_shp_Q14[ k ], Gains_Q16[ k ], Lambda_Q10,
- offset_Q10, psEncC->subfr_length, psEncC->shapingLPCOrder, psEncC->predictLPCOrder );
+ offset_Q10, psEncC->subfr_length, psEncC->shapingLPCOrder, psEncC->predictLPCOrder, psEncC->arch );
}
x_Q3 += psEncC->subfr_length;
diff --git a/thirdparty/opus/silk/x86/main_sse.h b/thirdparty/opus/silk/x86/main_sse.h
index afd5ec26e1..d8d61310ed 100644
--- a/thirdparty/opus/silk/x86/main_sse.h
+++ b/thirdparty/opus/silk/x86/main_sse.h
@@ -207,7 +207,8 @@ void silk_noise_shape_quantizer(
opus_int offset_Q10, /* I */
opus_int length, /* I Input length */
opus_int shapingLPCOrder, /* I Noise shaping AR filter order */
- opus_int predictLPCOrder /* I Prediction filter order */
+ opus_int predictLPCOrder, /* I Prediction filter order */
+ int arch /* I Architecture */
);
/**************************/
diff --git a/thirdparty/rg-etc1/rg_etc1.cpp b/thirdparty/rg-etc1/rg_etc1.cpp
deleted file mode 100644
index 8e28b53f9d..0000000000
--- a/thirdparty/rg-etc1/rg_etc1.cpp
+++ /dev/null
@@ -1,2446 +0,0 @@
-// File: rg_etc1.cpp - Fast, high quality ETC1 block packer/unpacker - Rich Geldreich <richgel99@gmail.com>
-// Please see ZLIB license at the end of rg_etc1.h.
-//
-// For more information Ericsson Texture Compression (ETC/ETC1), see:
-// http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt
-//
-// v1.04 - 5/15/14 - Fix signed vs. unsigned subtraction problem (noticed when compiled with gcc) in pack_etc1_block_init().
-// This issue would cause an assert when this func. was called in debug. (Note this module was developed/testing with MSVC,
-// I still need to test it throughly when compiled with gcc.)
-//
-// v1.03 - 5/12/13 - Initial public release
-#include "rg_etc1.h"
-
-#include <stdlib.h>
-#include <memory.h>
-#include <assert.h>
-//#include <stdio.h>
-#include <math.h>
-
-#pragma warning (disable: 4201) // nonstandard extension used : nameless struct/union
-
-#if defined(_DEBUG) || defined(DEBUG)
-#define RG_ETC1_BUILD_DEBUG
-#endif
-
-#define RG_ETC1_ASSERT assert
-
-namespace rg_etc1
-{
- typedef unsigned char uint8;
- typedef unsigned short uint16;
- typedef unsigned int uint;
- typedef unsigned int uint32;
- typedef long long int64;
- typedef unsigned long long uint64;
-
- const uint32 cUINT32_MAX = 0xFFFFFFFFU;
- const uint64 cUINT64_MAX = 0xFFFFFFFFFFFFFFFFULL; //0xFFFFFFFFFFFFFFFFui64;
-
- template<typename T> inline T minimum(T a, T b) { return (a < b) ? a : b; }
- template<typename T> inline T minimum(T a, T b, T c) { return minimum(minimum(a, b), c); }
- template<typename T> inline T maximum(T a, T b) { return (a > b) ? a : b; }
- template<typename T> inline T maximum(T a, T b, T c) { return maximum(maximum(a, b), c); }
- template<typename T> inline T clamp(T value, T low, T high) { return (value < low) ? low : ((value > high) ? high : value); }
- template<typename T> inline T square(T value) { return value * value; }
- template<typename T> inline void zero_object(T& obj) { memset((void*)&obj, 0, sizeof(obj)); }
- template<typename T> inline void zero_this(T* pObj) { memset((void*)pObj, 0, sizeof(*pObj)); }
-
- template<class T, size_t N> T decay_array_to_subtype(T (&a)[N]);
-
-#define RG_ETC1_ARRAY_SIZE(X) (sizeof(X) / sizeof(decay_array_to_subtype(X)))
-
- enum eNoClamp { cNoClamp };
-
- struct color_quad_u8
- {
- static inline int clamp(int v) { if (v & 0xFFFFFF00U) v = (~(static_cast<int>(v) >> 31)) & 0xFF; return v; }
-
- struct component_traits { enum { cSigned = false, cFloat = false, cMin = 0U, cMax = 255U }; };
-
- public:
- typedef unsigned char component_t;
- typedef int parameter_t;
-
- enum { cNumComps = 4 };
-
- union
- {
- struct
- {
- component_t r;
- component_t g;
- component_t b;
- component_t a;
- };
-
- component_t c[cNumComps];
-
- uint32 m_u32;
- };
-
- inline color_quad_u8()
- {
- }
-
- inline color_quad_u8(const color_quad_u8& other) : m_u32(other.m_u32)
- {
- }
-
- explicit inline color_quad_u8(parameter_t y, parameter_t alpha = component_traits::cMax)
- {
- set(y, alpha);
- }
-
- inline color_quad_u8(parameter_t red, parameter_t green, parameter_t blue, parameter_t alpha = component_traits::cMax)
- {
- set(red, green, blue, alpha);
- }
-
- explicit inline color_quad_u8(eNoClamp, parameter_t y, parameter_t alpha = component_traits::cMax)
- {
- set_noclamp_y_alpha(y, alpha);
- }
-
- inline color_quad_u8(eNoClamp, parameter_t red, parameter_t green, parameter_t blue, parameter_t alpha = component_traits::cMax)
- {
- set_noclamp_rgba(red, green, blue, alpha);
- }
-
- inline void clear()
- {
- m_u32 = 0;
- }
-
- inline color_quad_u8& operator= (const color_quad_u8& other)
- {
- m_u32 = other.m_u32;
- return *this;
- }
-
- inline color_quad_u8& set_rgb(const color_quad_u8& other)
- {
- r = other.r;
- g = other.g;
- b = other.b;
- return *this;
- }
-
- inline color_quad_u8& operator= (parameter_t y)
- {
- set(y, component_traits::cMax);
- return *this;
- }
-
- inline color_quad_u8& set(parameter_t y, parameter_t alpha = component_traits::cMax)
- {
- y = clamp(y);
- alpha = clamp(alpha);
- r = static_cast<component_t>(y);
- g = static_cast<component_t>(y);
- b = static_cast<component_t>(y);
- a = static_cast<component_t>(alpha);
- return *this;
- }
-
- inline color_quad_u8& set_noclamp_y_alpha(parameter_t y, parameter_t alpha = component_traits::cMax)
- {
- RG_ETC1_ASSERT( (y >= component_traits::cMin) && (y <= component_traits::cMax) );
- RG_ETC1_ASSERT( (alpha >= component_traits::cMin) && (alpha <= component_traits::cMax) );
-
- r = static_cast<component_t>(y);
- g = static_cast<component_t>(y);
- b = static_cast<component_t>(y);
- a = static_cast<component_t>(alpha);
- return *this;
- }
-
- inline color_quad_u8& set(parameter_t red, parameter_t green, parameter_t blue, parameter_t alpha = component_traits::cMax)
- {
- r = static_cast<component_t>(clamp(red));
- g = static_cast<component_t>(clamp(green));
- b = static_cast<component_t>(clamp(blue));
- a = static_cast<component_t>(clamp(alpha));
- return *this;
- }
-
- inline color_quad_u8& set_noclamp_rgba(parameter_t red, parameter_t green, parameter_t blue, parameter_t alpha)
- {
- RG_ETC1_ASSERT( (red >= component_traits::cMin) && (red <= component_traits::cMax) );
- RG_ETC1_ASSERT( (green >= component_traits::cMin) && (green <= component_traits::cMax) );
- RG_ETC1_ASSERT( (blue >= component_traits::cMin) && (blue <= component_traits::cMax) );
- RG_ETC1_ASSERT( (alpha >= component_traits::cMin) && (alpha <= component_traits::cMax) );
-
- r = static_cast<component_t>(red);
- g = static_cast<component_t>(green);
- b = static_cast<component_t>(blue);
- a = static_cast<component_t>(alpha);
- return *this;
- }
-
- inline color_quad_u8& set_noclamp_rgb(parameter_t red, parameter_t green, parameter_t blue)
- {
- RG_ETC1_ASSERT( (red >= component_traits::cMin) && (red <= component_traits::cMax) );
- RG_ETC1_ASSERT( (green >= component_traits::cMin) && (green <= component_traits::cMax) );
- RG_ETC1_ASSERT( (blue >= component_traits::cMin) && (blue <= component_traits::cMax) );
-
- r = static_cast<component_t>(red);
- g = static_cast<component_t>(green);
- b = static_cast<component_t>(blue);
- return *this;
- }
-
- static inline parameter_t get_min_comp() { return component_traits::cMin; }
- static inline parameter_t get_max_comp() { return component_traits::cMax; }
- static inline bool get_comps_are_signed() { return component_traits::cSigned; }
-
- inline component_t operator[] (uint i) const { RG_ETC1_ASSERT(i < cNumComps); return c[i]; }
- inline component_t& operator[] (uint i) { RG_ETC1_ASSERT(i < cNumComps); return c[i]; }
-
- inline color_quad_u8& set_component(uint i, parameter_t f)
- {
- RG_ETC1_ASSERT(i < cNumComps);
-
- c[i] = static_cast<component_t>(clamp(f));
-
- return *this;
- }
-
- inline color_quad_u8& set_grayscale(parameter_t l)
- {
- component_t x = static_cast<component_t>(clamp(l));
- c[0] = x;
- c[1] = x;
- c[2] = x;
- return *this;
- }
-
- inline color_quad_u8& clamp(const color_quad_u8& l, const color_quad_u8& h)
- {
- for (uint i = 0; i < cNumComps; i++)
- c[i] = static_cast<component_t>(rg_etc1::clamp<parameter_t>(c[i], l[i], h[i]));
- return *this;
- }
-
- inline color_quad_u8& clamp(parameter_t l, parameter_t h)
- {
- for (uint i = 0; i < cNumComps; i++)
- c[i] = static_cast<component_t>(rg_etc1::clamp<parameter_t>(c[i], l, h));
- return *this;
- }
-
- // Returns CCIR 601 luma (consistent with color_utils::RGB_To_Y).
- inline parameter_t get_luma() const
- {
- return static_cast<parameter_t>((19595U * r + 38470U * g + 7471U * b + 32768U) >> 16U);
- }
-
- // Returns REC 709 luma.
- inline parameter_t get_luma_rec709() const
- {
- return static_cast<parameter_t>((13938U * r + 46869U * g + 4729U * b + 32768U) >> 16U);
- }
-
- inline uint squared_distance_rgb(const color_quad_u8& c) const
- {
- return rg_etc1::square(r - c.r) + rg_etc1::square(g - c.g) + rg_etc1::square(b - c.b);
- }
-
- inline uint squared_distance_rgba(const color_quad_u8& c) const
- {
- return rg_etc1::square(r - c.r) + rg_etc1::square(g - c.g) + rg_etc1::square(b - c.b) + rg_etc1::square(a - c.a);
- }
-
- inline bool rgb_equals(const color_quad_u8& rhs) const
- {
- return (r == rhs.r) && (g == rhs.g) && (b == rhs.b);
- }
-
- inline bool operator== (const color_quad_u8& rhs) const
- {
- return m_u32 == rhs.m_u32;
- }
-
- color_quad_u8& operator+= (const color_quad_u8& other)
- {
- for (uint i = 0; i < 4; i++)
- c[i] = static_cast<component_t>(clamp(c[i] + other.c[i]));
- return *this;
- }
-
- color_quad_u8& operator-= (const color_quad_u8& other)
- {
- for (uint i = 0; i < 4; i++)
- c[i] = static_cast<component_t>(clamp(c[i] - other.c[i]));
- return *this;
- }
-
- friend color_quad_u8 operator+ (const color_quad_u8& lhs, const color_quad_u8& rhs)
- {
- color_quad_u8 result(lhs);
- result += rhs;
- return result;
- }
-
- friend color_quad_u8 operator- (const color_quad_u8& lhs, const color_quad_u8& rhs)
- {
- color_quad_u8 result(lhs);
- result -= rhs;
- return result;
- }
- }; // class color_quad_u8
-
- struct vec3F
- {
- float m_s[3];
-
- inline vec3F() { }
- inline vec3F(float s) { m_s[0] = s; m_s[1] = s; m_s[2] = s; }
- inline vec3F(float x, float y, float z) { m_s[0] = x; m_s[1] = y; m_s[2] = z; }
-
- inline float operator[] (uint i) const { RG_ETC1_ASSERT(i < 3); return m_s[i]; }
-
- inline vec3F& operator += (const vec3F& other) { for (uint i = 0; i < 3; i++) m_s[i] += other.m_s[i]; return *this; }
-
- inline vec3F& operator *= (float s) { for (uint i = 0; i < 3; i++) m_s[i] *= s; return *this; }
- };
-
- enum etc_constants
- {
- cETC1BytesPerBlock = 8U,
-
- cETC1SelectorBits = 2U,
- cETC1SelectorValues = 1U << cETC1SelectorBits,
- cETC1SelectorMask = cETC1SelectorValues - 1U,
-
- cETC1BlockShift = 2U,
- cETC1BlockSize = 1U << cETC1BlockShift,
-
- cETC1LSBSelectorIndicesBitOffset = 0,
- cETC1MSBSelectorIndicesBitOffset = 16,
-
- cETC1FlipBitOffset = 32,
- cETC1DiffBitOffset = 33,
-
- cETC1IntenModifierNumBits = 3,
- cETC1IntenModifierValues = 1 << cETC1IntenModifierNumBits,
- cETC1RightIntenModifierTableBitOffset = 34,
- cETC1LeftIntenModifierTableBitOffset = 37,
-
- // Base+Delta encoding (5 bit bases, 3 bit delta)
- cETC1BaseColorCompNumBits = 5,
- cETC1BaseColorCompMax = 1 << cETC1BaseColorCompNumBits,
-
- cETC1DeltaColorCompNumBits = 3,
- cETC1DeltaColorComp = 1 << cETC1DeltaColorCompNumBits,
- cETC1DeltaColorCompMax = 1 << cETC1DeltaColorCompNumBits,
-
- cETC1BaseColor5RBitOffset = 59,
- cETC1BaseColor5GBitOffset = 51,
- cETC1BaseColor5BBitOffset = 43,
-
- cETC1DeltaColor3RBitOffset = 56,
- cETC1DeltaColor3GBitOffset = 48,
- cETC1DeltaColor3BBitOffset = 40,
-
- // Absolute (non-delta) encoding (two 4-bit per component bases)
- cETC1AbsColorCompNumBits = 4,
- cETC1AbsColorCompMax = 1 << cETC1AbsColorCompNumBits,
-
- cETC1AbsColor4R1BitOffset = 60,
- cETC1AbsColor4G1BitOffset = 52,
- cETC1AbsColor4B1BitOffset = 44,
-
- cETC1AbsColor4R2BitOffset = 56,
- cETC1AbsColor4G2BitOffset = 48,
- cETC1AbsColor4B2BitOffset = 40,
-
- cETC1ColorDeltaMin = -4,
- cETC1ColorDeltaMax = 3,
-
- // Delta3:
- // 0 1 2 3 4 5 6 7
- // 000 001 010 011 100 101 110 111
- // 0 1 2 3 -4 -3 -2 -1
- };
-
- static uint8 g_quant5_tab[256+16];
-
- static const int g_etc1_inten_tables[cETC1IntenModifierValues][cETC1SelectorValues] =
- {
- { -8, -2, 2, 8 }, { -17, -5, 5, 17 }, { -29, -9, 9, 29 }, { -42, -13, 13, 42 },
- { -60, -18, 18, 60 }, { -80, -24, 24, 80 }, { -106, -33, 33, 106 }, { -183, -47, 47, 183 }
- };
-
- static const uint8 g_etc1_to_selector_index[cETC1SelectorValues] = { 2, 3, 1, 0 };
- static const uint8 g_selector_index_to_etc1[cETC1SelectorValues] = { 3, 2, 0, 1 };
-
- // Given an ETC1 diff/inten_table/selector, and an 8-bit desired color, this table encodes the best packed_color in the low byte, and the abs error in the high byte.
- static uint16 g_etc1_inverse_lookup[2*8*4][256]; // [diff/inten_table/selector][desired_color]
-
- // g_color8_to_etc_block_config[color][table_index] = Supplies for each 8-bit color value a list of packed ETC1 diff/intensity table/selectors/packed_colors that map to that color.
- // To pack: diff | (inten << 1) | (selector << 4) | (packed_c << 8)
- static const uint16 g_color8_to_etc_block_config_0_255[2][33] =
- {
- { 0x0000, 0x0010, 0x0002, 0x0012, 0x0004, 0x0014, 0x0006, 0x0016, 0x0008, 0x0018, 0x000A, 0x001A, 0x000C, 0x001C, 0x000E, 0x001E,
- 0x0001, 0x0011, 0x0003, 0x0013, 0x0005, 0x0015, 0x0007, 0x0017, 0x0009, 0x0019, 0x000B, 0x001B, 0x000D, 0x001D, 0x000F, 0x001F, 0xFFFF },
- { 0x0F20, 0x0F30, 0x0E32, 0x0F22, 0x0E34, 0x0F24, 0x0D36, 0x0F26, 0x0C38, 0x0E28, 0x0B3A, 0x0E2A, 0x093C, 0x0E2C, 0x053E, 0x0D2E,
- 0x1E31, 0x1F21, 0x1D33, 0x1F23, 0x1C35, 0x1E25, 0x1A37, 0x1E27, 0x1839, 0x1D29, 0x163B, 0x1C2B, 0x133D, 0x1B2D, 0x093F, 0x1A2F, 0xFFFF },
- };
-
- // Really only [254][11].
- static const uint16 g_color8_to_etc_block_config_1_to_254[254][12] =
- {
- { 0x021C, 0x0D0D, 0xFFFF }, { 0x0020, 0x0021, 0x0A0B, 0x061F, 0xFFFF }, { 0x0113, 0x0217, 0xFFFF }, { 0x0116, 0x031E,
- 0x0B0E, 0x0405, 0xFFFF }, { 0x0022, 0x0204, 0x050A, 0x0023, 0xFFFF }, { 0x0111, 0x0319, 0x0809, 0x170F, 0xFFFF }, {
- 0x0303, 0x0215, 0x0607, 0xFFFF }, { 0x0030, 0x0114, 0x0408, 0x0031, 0x0201, 0x051D, 0xFFFF }, { 0x0100, 0x0024, 0x0306,
- 0x0025, 0x041B, 0x0E0D, 0xFFFF }, { 0x021A, 0x0121, 0x0B0B, 0x071F, 0xFFFF }, { 0x0213, 0x0317, 0xFFFF }, { 0x0112,
- 0x0505, 0xFFFF }, { 0x0026, 0x070C, 0x0123, 0x0027, 0xFFFF }, { 0x0211, 0x0909, 0xFFFF }, { 0x0110, 0x0315, 0x0707,
- 0x0419, 0x180F, 0xFFFF }, { 0x0218, 0x0131, 0x0301, 0x0403, 0x061D, 0xFFFF }, { 0x0032, 0x0202, 0x0033, 0x0125, 0x051B,
- 0x0F0D, 0xFFFF }, { 0x0028, 0x031C, 0x0221, 0x0029, 0xFFFF }, { 0x0120, 0x0313, 0x0C0B, 0x081F, 0xFFFF }, { 0x0605,
- 0x0417, 0xFFFF }, { 0x0216, 0x041E, 0x0C0E, 0x0223, 0x0127, 0xFFFF }, { 0x0122, 0x0304, 0x060A, 0x0311, 0x0A09, 0xFFFF
- }, { 0x0519, 0x190F, 0xFFFF }, { 0x002A, 0x0231, 0x0503, 0x0415, 0x0807, 0x002B, 0x071D, 0xFFFF }, { 0x0130, 0x0214,
- 0x0508, 0x0401, 0x0133, 0x0225, 0x061B, 0xFFFF }, { 0x0200, 0x0124, 0x0406, 0x0321, 0x0129, 0x100D, 0xFFFF }, { 0x031A,
- 0x0D0B, 0x091F, 0xFFFF }, { 0x0413, 0x0705, 0x0517, 0xFFFF }, { 0x0212, 0x0034, 0x0323, 0x0035, 0x0227, 0xFFFF }, {
- 0x0126, 0x080C, 0x0B09, 0xFFFF }, { 0x0411, 0x0619, 0x1A0F, 0xFFFF }, { 0x0210, 0x0331, 0x0603, 0x0515, 0x0907, 0x012B,
- 0xFFFF }, { 0x0318, 0x002C, 0x0501, 0x0233, 0x0325, 0x071B, 0x002D, 0x081D, 0xFFFF }, { 0x0132, 0x0302, 0x0229, 0x110D,
- 0xFFFF }, { 0x0128, 0x041C, 0x0421, 0x0E0B, 0x0A1F, 0xFFFF }, { 0x0220, 0x0513, 0x0617, 0xFFFF }, { 0x0135, 0x0805,
- 0x0327, 0xFFFF }, { 0x0316, 0x051E, 0x0D0E, 0x0423, 0xFFFF }, { 0x0222, 0x0404, 0x070A, 0x0511, 0x0719, 0x0C09, 0x1B0F,
- 0xFFFF }, { 0x0703, 0x0615, 0x0A07, 0x022B, 0xFFFF }, { 0x012A, 0x0431, 0x0601, 0x0333, 0x012D, 0x091D, 0xFFFF }, {
- 0x0230, 0x0314, 0x0036, 0x0608, 0x0425, 0x0037, 0x0329, 0x081B, 0x120D, 0xFFFF }, { 0x0300, 0x0224, 0x0506, 0x0521,
- 0x0F0B, 0x0B1F, 0xFFFF }, { 0x041A, 0x0613, 0x0717, 0xFFFF }, { 0x0235, 0x0905, 0xFFFF }, { 0x0312, 0x0134, 0x0523,
- 0x0427, 0xFFFF }, { 0x0226, 0x090C, 0x002E, 0x0611, 0x0D09, 0x002F, 0xFFFF }, { 0x0715, 0x0B07, 0x0819, 0x032B, 0x1C0F,
- 0xFFFF }, { 0x0310, 0x0531, 0x0701, 0x0803, 0x022D, 0x0A1D, 0xFFFF }, { 0x0418, 0x012C, 0x0433, 0x0525, 0x0137, 0x091B,
- 0x130D, 0xFFFF }, { 0x0232, 0x0402, 0x0621, 0x0429, 0xFFFF }, { 0x0228, 0x051C, 0x0713, 0x100B, 0x0C1F, 0xFFFF }, {
- 0x0320, 0x0335, 0x0A05, 0x0817, 0xFFFF }, { 0x0623, 0x0527, 0xFFFF }, { 0x0416, 0x061E, 0x0E0E, 0x0711, 0x0E09, 0x012F,
- 0xFFFF }, { 0x0322, 0x0504, 0x080A, 0x0919, 0x1D0F, 0xFFFF }, { 0x0631, 0x0903, 0x0815, 0x0C07, 0x042B, 0x032D, 0x0B1D,
- 0xFFFF }, { 0x022A, 0x0801, 0x0533, 0x0625, 0x0237, 0x0A1B, 0xFFFF }, { 0x0330, 0x0414, 0x0136, 0x0708, 0x0721, 0x0529,
- 0x140D, 0xFFFF }, { 0x0400, 0x0324, 0x0606, 0x0038, 0x0039, 0x110B, 0x0D1F, 0xFFFF }, { 0x051A, 0x0813, 0x0B05, 0x0917,
- 0xFFFF }, { 0x0723, 0x0435, 0x0627, 0xFFFF }, { 0x0412, 0x0234, 0x0F09, 0x022F, 0xFFFF }, { 0x0326, 0x0A0C, 0x012E,
- 0x0811, 0x0A19, 0x1E0F, 0xFFFF }, { 0x0731, 0x0A03, 0x0915, 0x0D07, 0x052B, 0xFFFF }, { 0x0410, 0x0901, 0x0633, 0x0725,
- 0x0337, 0x0B1B, 0x042D, 0x0C1D, 0xFFFF }, { 0x0518, 0x022C, 0x0629, 0x150D, 0xFFFF }, { 0x0332, 0x0502, 0x0821, 0x0139,
- 0x120B, 0x0E1F, 0xFFFF }, { 0x0328, 0x061C, 0x0913, 0x0A17, 0xFFFF }, { 0x0420, 0x0535, 0x0C05, 0x0727, 0xFFFF }, {
- 0x0823, 0x032F, 0xFFFF }, { 0x0516, 0x071E, 0x0F0E, 0x0911, 0x0B19, 0x1009, 0x1F0F, 0xFFFF }, { 0x0422, 0x0604, 0x090A,
- 0x0B03, 0x0A15, 0x0E07, 0x062B, 0xFFFF }, { 0x0831, 0x0A01, 0x0733, 0x052D, 0x0D1D, 0xFFFF }, { 0x032A, 0x0825, 0x0437,
- 0x0729, 0x0C1B, 0x160D, 0xFFFF }, { 0x0430, 0x0514, 0x0236, 0x0808, 0x0921, 0x0239, 0x130B, 0x0F1F, 0xFFFF }, { 0x0500,
- 0x0424, 0x0706, 0x0138, 0x0A13, 0x0B17, 0xFFFF }, { 0x061A, 0x0635, 0x0D05, 0xFFFF }, { 0x0923, 0x0827, 0xFFFF }, {
- 0x0512, 0x0334, 0x003A, 0x0A11, 0x1109, 0x003B, 0x042F, 0xFFFF }, { 0x0426, 0x0B0C, 0x022E, 0x0B15, 0x0F07, 0x0C19,
- 0x072B, 0xFFFF }, { 0x0931, 0x0B01, 0x0C03, 0x062D, 0x0E1D, 0xFFFF }, { 0x0510, 0x0833, 0x0925, 0x0537, 0x0D1B, 0x170D,
- 0xFFFF }, { 0x0618, 0x032C, 0x0A21, 0x0339, 0x0829, 0xFFFF }, { 0x0432, 0x0602, 0x0B13, 0x140B, 0x101F, 0xFFFF }, {
- 0x0428, 0x071C, 0x0735, 0x0E05, 0x0C17, 0xFFFF }, { 0x0520, 0x0A23, 0x0927, 0xFFFF }, { 0x0B11, 0x1209, 0x013B, 0x052F,
- 0xFFFF }, { 0x0616, 0x081E, 0x0D19, 0xFFFF }, { 0x0522, 0x0704, 0x0A0A, 0x0A31, 0x0D03, 0x0C15, 0x1007, 0x082B, 0x072D,
- 0x0F1D, 0xFFFF }, { 0x0C01, 0x0933, 0x0A25, 0x0637, 0x0E1B, 0xFFFF }, { 0x042A, 0x0B21, 0x0929, 0x180D, 0xFFFF }, {
- 0x0530, 0x0614, 0x0336, 0x0908, 0x0439, 0x150B, 0x111F, 0xFFFF }, { 0x0600, 0x0524, 0x0806, 0x0238, 0x0C13, 0x0F05,
- 0x0D17, 0xFFFF }, { 0x071A, 0x0B23, 0x0835, 0x0A27, 0xFFFF }, { 0x1309, 0x023B, 0x062F, 0xFFFF }, { 0x0612, 0x0434,
- 0x013A, 0x0C11, 0x0E19, 0xFFFF }, { 0x0526, 0x0C0C, 0x032E, 0x0B31, 0x0E03, 0x0D15, 0x1107, 0x092B, 0xFFFF }, { 0x0D01,
- 0x0A33, 0x0B25, 0x0737, 0x0F1B, 0x082D, 0x101D, 0xFFFF }, { 0x0610, 0x0A29, 0x190D, 0xFFFF }, { 0x0718, 0x042C, 0x0C21,
- 0x0539, 0x160B, 0x121F, 0xFFFF }, { 0x0532, 0x0702, 0x0D13, 0x0E17, 0xFFFF }, { 0x0528, 0x081C, 0x0935, 0x1005, 0x0B27,
- 0xFFFF }, { 0x0620, 0x0C23, 0x033B, 0x072F, 0xFFFF }, { 0x0D11, 0x0F19, 0x1409, 0xFFFF }, { 0x0716, 0x003C, 0x091E,
- 0x0F03, 0x0E15, 0x1207, 0x0A2B, 0x003D, 0xFFFF }, { 0x0622, 0x0804, 0x0B0A, 0x0C31, 0x0E01, 0x0B33, 0x092D, 0x111D,
- 0xFFFF }, { 0x0C25, 0x0837, 0x0B29, 0x101B, 0x1A0D, 0xFFFF }, { 0x052A, 0x0D21, 0x0639, 0x170B, 0x131F, 0xFFFF }, {
- 0x0630, 0x0714, 0x0436, 0x0A08, 0x0E13, 0x0F17, 0xFFFF }, { 0x0700, 0x0624, 0x0906, 0x0338, 0x0A35, 0x1105, 0xFFFF }, {
- 0x081A, 0x0D23, 0x0C27, 0xFFFF }, { 0x0E11, 0x1509, 0x043B, 0x082F, 0xFFFF }, { 0x0712, 0x0534, 0x023A, 0x0F15, 0x1307,
- 0x1019, 0x0B2B, 0x013D, 0xFFFF }, { 0x0626, 0x0D0C, 0x042E, 0x0D31, 0x0F01, 0x1003, 0x0A2D, 0x121D, 0xFFFF }, { 0x0C33,
- 0x0D25, 0x0937, 0x111B, 0x1B0D, 0xFFFF }, { 0x0710, 0x0E21, 0x0739, 0x0C29, 0xFFFF }, { 0x0818, 0x052C, 0x0F13, 0x180B,
- 0x141F, 0xFFFF }, { 0x0632, 0x0802, 0x0B35, 0x1205, 0x1017, 0xFFFF }, { 0x0628, 0x091C, 0x0E23, 0x0D27, 0xFFFF }, {
- 0x0720, 0x0F11, 0x1609, 0x053B, 0x092F, 0xFFFF }, { 0x1119, 0x023D, 0xFFFF }, { 0x0816, 0x013C, 0x0A1E, 0x0E31, 0x1103,
- 0x1015, 0x1407, 0x0C2B, 0x0B2D, 0x131D, 0xFFFF }, { 0x0722, 0x0904, 0x0C0A, 0x1001, 0x0D33, 0x0E25, 0x0A37, 0x121B,
- 0xFFFF }, { 0x0F21, 0x0D29, 0x1C0D, 0xFFFF }, { 0x062A, 0x0839, 0x190B, 0x151F, 0xFFFF }, { 0x0730, 0x0814, 0x0536,
- 0x0B08, 0x1013, 0x1305, 0x1117, 0xFFFF }, { 0x0800, 0x0724, 0x0A06, 0x0438, 0x0F23, 0x0C35, 0x0E27, 0xFFFF }, { 0x091A,
- 0x1709, 0x063B, 0x0A2F, 0xFFFF }, { 0x1011, 0x1219, 0x033D, 0xFFFF }, { 0x0812, 0x0634, 0x033A, 0x0F31, 0x1203, 0x1115,
- 0x1507, 0x0D2B, 0xFFFF }, { 0x0726, 0x0E0C, 0x052E, 0x1101, 0x0E33, 0x0F25, 0x0B37, 0x131B, 0x0C2D, 0x141D, 0xFFFF }, {
- 0x0E29, 0x1D0D, 0xFFFF }, { 0x0810, 0x1021, 0x0939, 0x1A0B, 0x161F, 0xFFFF }, { 0x0918, 0x062C, 0x1113, 0x1217, 0xFFFF
- }, { 0x0732, 0x0902, 0x0D35, 0x1405, 0x0F27, 0xFFFF }, { 0x0728, 0x0A1C, 0x1023, 0x073B, 0x0B2F, 0xFFFF }, { 0x0820,
- 0x1111, 0x1319, 0x1809, 0xFFFF }, { 0x1303, 0x1215, 0x1607, 0x0E2B, 0x043D, 0xFFFF }, { 0x0916, 0x023C, 0x0B1E, 0x1031,
- 0x1201, 0x0F33, 0x0D2D, 0x151D, 0xFFFF }, { 0x0822, 0x0A04, 0x0D0A, 0x1025, 0x0C37, 0x0F29, 0x141B, 0x1E0D, 0xFFFF }, {
- 0x1121, 0x0A39, 0x1B0B, 0x171F, 0xFFFF }, { 0x072A, 0x1213, 0x1317, 0xFFFF }, { 0x0830, 0x0914, 0x0636, 0x0C08, 0x0E35,
- 0x1505, 0xFFFF }, { 0x0900, 0x0824, 0x0B06, 0x0538, 0x1123, 0x1027, 0xFFFF }, { 0x0A1A, 0x1211, 0x1909, 0x083B, 0x0C2F,
- 0xFFFF }, { 0x1315, 0x1707, 0x1419, 0x0F2B, 0x053D, 0xFFFF }, { 0x0912, 0x0734, 0x043A, 0x1131, 0x1301, 0x1403, 0x0E2D,
- 0x161D, 0xFFFF }, { 0x0826, 0x0F0C, 0x062E, 0x1033, 0x1125, 0x0D37, 0x151B, 0x1F0D, 0xFFFF }, { 0x1221, 0x0B39, 0x1029,
- 0xFFFF }, { 0x0910, 0x1313, 0x1C0B, 0x181F, 0xFFFF }, { 0x0A18, 0x072C, 0x0F35, 0x1605, 0x1417, 0xFFFF }, { 0x0832,
- 0x0A02, 0x1223, 0x1127, 0xFFFF }, { 0x0828, 0x0B1C, 0x1311, 0x1A09, 0x093B, 0x0D2F, 0xFFFF }, { 0x0920, 0x1519, 0x063D,
- 0xFFFF }, { 0x1231, 0x1503, 0x1415, 0x1807, 0x102B, 0x0F2D, 0x171D, 0xFFFF }, { 0x0A16, 0x033C, 0x0C1E, 0x1401, 0x1133,
- 0x1225, 0x0E37, 0x161B, 0xFFFF }, { 0x0922, 0x0B04, 0x0E0A, 0x1321, 0x1129, 0xFFFF }, { 0x0C39, 0x1D0B, 0x191F, 0xFFFF
- }, { 0x082A, 0x1413, 0x1705, 0x1517, 0xFFFF }, { 0x0930, 0x0A14, 0x0736, 0x0D08, 0x1323, 0x1035, 0x1227, 0xFFFF }, {
- 0x0A00, 0x0924, 0x0C06, 0x0638, 0x1B09, 0x0A3B, 0x0E2F, 0xFFFF }, { 0x0B1A, 0x1411, 0x1619, 0x073D, 0xFFFF }, { 0x1331,
- 0x1603, 0x1515, 0x1907, 0x112B, 0xFFFF }, { 0x0A12, 0x0834, 0x053A, 0x1501, 0x1233, 0x1325, 0x0F37, 0x171B, 0x102D,
- 0x181D, 0xFFFF }, { 0x0926, 0x072E, 0x1229, 0xFFFF }, { 0x1421, 0x0D39, 0x1E0B, 0x1A1F, 0xFFFF }, { 0x0A10, 0x1513,
- 0x1617, 0xFFFF }, { 0x0B18, 0x082C, 0x1135, 0x1805, 0x1327, 0xFFFF }, { 0x0932, 0x0B02, 0x1423, 0x0B3B, 0x0F2F, 0xFFFF
- }, { 0x0928, 0x0C1C, 0x1511, 0x1719, 0x1C09, 0xFFFF }, { 0x0A20, 0x1703, 0x1615, 0x1A07, 0x122B, 0x083D, 0xFFFF }, {
- 0x1431, 0x1601, 0x1333, 0x112D, 0x191D, 0xFFFF }, { 0x0B16, 0x043C, 0x0D1E, 0x1425, 0x1037, 0x1329, 0x181B, 0xFFFF }, {
- 0x0A22, 0x0C04, 0x0F0A, 0x1521, 0x0E39, 0x1F0B, 0x1B1F, 0xFFFF }, { 0x1613, 0x1717, 0xFFFF }, { 0x092A, 0x1235, 0x1905,
- 0xFFFF }, { 0x0A30, 0x0B14, 0x0836, 0x0E08, 0x1523, 0x1427, 0xFFFF }, { 0x0B00, 0x0A24, 0x0D06, 0x0738, 0x1611, 0x1D09,
- 0x0C3B, 0x102F, 0xFFFF }, { 0x0C1A, 0x1715, 0x1B07, 0x1819, 0x132B, 0x093D, 0xFFFF }, { 0x1531, 0x1701, 0x1803, 0x122D,
- 0x1A1D, 0xFFFF }, { 0x0B12, 0x0934, 0x063A, 0x1433, 0x1525, 0x1137, 0x191B, 0xFFFF }, { 0x0A26, 0x003E, 0x082E, 0x1621,
- 0x0F39, 0x1429, 0x003F, 0xFFFF }, { 0x1713, 0x1C1F, 0xFFFF }, { 0x0B10, 0x1335, 0x1A05, 0x1817, 0xFFFF }, { 0x0C18,
- 0x092C, 0x1623, 0x1527, 0xFFFF }, { 0x0A32, 0x0C02, 0x1711, 0x1E09, 0x0D3B, 0x112F, 0xFFFF }, { 0x0A28, 0x0D1C, 0x1919,
- 0x0A3D, 0xFFFF }, { 0x0B20, 0x1631, 0x1903, 0x1815, 0x1C07, 0x142B, 0x132D, 0x1B1D, 0xFFFF }, { 0x1801, 0x1533, 0x1625,
- 0x1237, 0x1A1B, 0xFFFF }, { 0x0C16, 0x053C, 0x0E1E, 0x1721, 0x1529, 0x013F, 0xFFFF }, { 0x0B22, 0x0D04, 0x1039, 0x1D1F,
- 0xFFFF }, { 0x1813, 0x1B05, 0x1917, 0xFFFF }, { 0x0A2A, 0x1723, 0x1435, 0x1627, 0xFFFF }, { 0x0B30, 0x0C14, 0x0936,
- 0x0F08, 0x1F09, 0x0E3B, 0x122F, 0xFFFF }, { 0x0C00, 0x0B24, 0x0E06, 0x0838, 0x1811, 0x1A19, 0x0B3D, 0xFFFF }, { 0x0D1A,
- 0x1731, 0x1A03, 0x1915, 0x1D07, 0x152B, 0xFFFF }, { 0x1901, 0x1633, 0x1725, 0x1337, 0x1B1B, 0x142D, 0x1C1D, 0xFFFF }, {
- 0x0C12, 0x0A34, 0x073A, 0x1629, 0x023F, 0xFFFF }, { 0x0B26, 0x013E, 0x092E, 0x1821, 0x1139, 0x1E1F, 0xFFFF }, { 0x1913,
- 0x1A17, 0xFFFF }, { 0x0C10, 0x1535, 0x1C05, 0x1727, 0xFFFF }, { 0x0D18, 0x0A2C, 0x1823, 0x0F3B, 0x132F, 0xFFFF }, {
- 0x0B32, 0x0D02, 0x1911, 0x1B19, 0xFFFF }, { 0x0B28, 0x0E1C, 0x1B03, 0x1A15, 0x1E07, 0x162B, 0x0C3D, 0xFFFF }, { 0x0C20,
- 0x1831, 0x1A01, 0x1733, 0x152D, 0x1D1D, 0xFFFF }, { 0x1825, 0x1437, 0x1729, 0x1C1B, 0x033F, 0xFFFF }, { 0x0D16, 0x063C,
- 0x0F1E, 0x1921, 0x1239, 0x1F1F, 0xFFFF }, { 0x0C22, 0x0E04, 0x1A13, 0x1B17, 0xFFFF }, { 0x1635, 0x1D05, 0xFFFF }, {
- 0x0B2A, 0x1923, 0x1827, 0xFFFF }, { 0x0C30, 0x0D14, 0x0A36, 0x1A11, 0x103B, 0x142F, 0xFFFF }, { 0x0D00, 0x0C24, 0x0F06,
- 0x0938, 0x1B15, 0x1F07, 0x1C19, 0x172B, 0x0D3D, 0xFFFF }, { 0x0E1A, 0x1931, 0x1B01, 0x1C03, 0x162D, 0x1E1D, 0xFFFF }, {
- 0x1833, 0x1925, 0x1537, 0x1D1B, 0xFFFF }, { 0x0D12, 0x0B34, 0x083A, 0x1A21, 0x1339, 0x1829, 0x043F, 0xFFFF }, { 0x0C26,
- 0x023E, 0x0A2E, 0x1B13, 0xFFFF }, { 0x1735, 0x1E05, 0x1C17, 0xFFFF }, { 0x0D10, 0x1A23, 0x1927, 0xFFFF }, { 0x0E18,
- 0x0B2C, 0x1B11, 0x113B, 0x152F, 0xFFFF }, { 0x0C32, 0x0E02, 0x1D19, 0x0E3D, 0xFFFF }, { 0x0C28, 0x0F1C, 0x1A31, 0x1D03,
- 0x1C15, 0x182B, 0x172D, 0x1F1D, 0xFFFF }, { 0x0D20, 0x1C01, 0x1933, 0x1A25, 0x1637, 0x1E1B, 0xFFFF }, { 0x1B21, 0x1929,
- 0x053F, 0xFFFF }, { 0x0E16, 0x073C, 0x1439, 0xFFFF }, { 0x0D22, 0x0F04, 0x1C13, 0x1F05, 0x1D17, 0xFFFF }, { 0x1B23,
- 0x1835, 0x1A27, 0xFFFF }, { 0x0C2A, 0x123B, 0x162F, 0xFFFF }, { 0x0D30, 0x0E14, 0x0B36, 0x1C11, 0x1E19, 0x0F3D, 0xFFFF
- }, { 0x0E00, 0x0D24, 0x0A38, 0x1B31, 0x1E03, 0x1D15, 0x192B, 0xFFFF }, { 0x0F1A, 0x1D01, 0x1A33, 0x1B25, 0x1737, 0x1F1B,
- 0x182D, 0xFFFF }, { 0x1A29, 0x063F, 0xFFFF }, { 0x0E12, 0x0C34, 0x093A, 0x1C21, 0x1539, 0xFFFF }, { 0x0D26, 0x033E,
- 0x0B2E, 0x1D13, 0x1E17, 0xFFFF }, { 0x1935, 0x1B27, 0xFFFF }, { 0x0E10, 0x1C23, 0x133B, 0x172F, 0xFFFF }, { 0x0F18,
- 0x0C2C, 0x1D11, 0x1F19, 0xFFFF }, { 0x0D32, 0x0F02, 0x1F03, 0x1E15, 0x1A2B, 0x103D, 0xFFFF }, { 0x0D28, 0x1C31, 0x1E01,
- 0x1B33, 0x192D, 0xFFFF }, { 0x0E20, 0x1C25, 0x1837, 0x1B29, 0x073F, 0xFFFF }, { 0x1D21, 0x1639, 0xFFFF }, { 0x0F16,
- 0x083C, 0x1E13, 0x1F17, 0xFFFF }, { 0x0E22, 0x1A35, 0xFFFF }, { 0x1D23, 0x1C27, 0xFFFF }, { 0x0D2A, 0x1E11, 0x143B,
- 0x182F, 0xFFFF }, { 0x0E30, 0x0F14, 0x0C36, 0x1F15, 0x1B2B, 0x113D, 0xFFFF }, { 0x0F00, 0x0E24, 0x0B38, 0x1D31, 0x1F01,
- 0x1A2D, 0xFFFF }, { 0x1C33, 0x1D25, 0x1937, 0xFFFF }, { 0x1E21, 0x1739, 0x1C29, 0x083F, 0xFFFF }, { 0x0F12, 0x0D34,
- 0x0A3A, 0x1F13, 0xFFFF }, { 0x0E26, 0x043E, 0x0C2E, 0x1B35, 0xFFFF }, { 0x1E23, 0x1D27, 0xFFFF }, { 0x0F10, 0x1F11,
- 0x153B, 0x192F, 0xFFFF }, { 0x0D2C, 0x123D, 0xFFFF },
- };
-
- struct etc1_block
- {
- // big endian uint64:
- // bit ofs: 56 48 40 32 24 16 8 0
- // byte ofs: b0, b1, b2, b3, b4, b5, b6, b7
- union
- {
- uint64 m_uint64;
- uint8 m_bytes[8];
- };
-
- uint8 m_low_color[2];
- uint8 m_high_color[2];
-
- enum { cNumSelectorBytes = 4 };
- uint8 m_selectors[cNumSelectorBytes];
-
- inline void clear()
- {
- zero_this(this);
- }
-
- inline uint get_byte_bits(uint ofs, uint num) const
- {
- RG_ETC1_ASSERT((ofs + num) <= 64U);
- RG_ETC1_ASSERT(num && (num <= 8U));
- RG_ETC1_ASSERT((ofs >> 3) == ((ofs + num - 1) >> 3));
- const uint byte_ofs = 7 - (ofs >> 3);
- const uint byte_bit_ofs = ofs & 7;
- return (m_bytes[byte_ofs] >> byte_bit_ofs) & ((1 << num) - 1);
- }
-
- inline void set_byte_bits(uint ofs, uint num, uint bits)
- {
- RG_ETC1_ASSERT((ofs + num) <= 64U);
- RG_ETC1_ASSERT(num && (num < 32U));
- RG_ETC1_ASSERT((ofs >> 3) == ((ofs + num - 1) >> 3));
- RG_ETC1_ASSERT(bits < (1U << num));
- const uint byte_ofs = 7 - (ofs >> 3);
- const uint byte_bit_ofs = ofs & 7;
- const uint mask = (1 << num) - 1;
- m_bytes[byte_ofs] &= ~(mask << byte_bit_ofs);
- m_bytes[byte_ofs] |= (bits << byte_bit_ofs);
- }
-
- // false = left/right subblocks
- // true = upper/lower subblocks
- inline bool get_flip_bit() const
- {
- return (m_bytes[3] & 1) != 0;
- }
-
- inline void set_flip_bit(bool flip)
- {
- m_bytes[3] &= ~1;
- m_bytes[3] |= static_cast<uint8>(flip);
- }
-
- inline bool get_diff_bit() const
- {
- return (m_bytes[3] & 2) != 0;
- }
-
- inline void set_diff_bit(bool diff)
- {
- m_bytes[3] &= ~2;
- m_bytes[3] |= (static_cast<uint>(diff) << 1);
- }
-
- // Returns intensity modifier table (0-7) used by subblock subblock_id.
- // subblock_id=0 left/top (CW 1), 1=right/bottom (CW 2)
- inline uint get_inten_table(uint subblock_id) const
- {
- RG_ETC1_ASSERT(subblock_id < 2);
- const uint ofs = subblock_id ? 2 : 5;
- return (m_bytes[3] >> ofs) & 7;
- }
-
- // Sets intensity modifier table (0-7) used by subblock subblock_id (0 or 1)
- inline void set_inten_table(uint subblock_id, uint t)
- {
- RG_ETC1_ASSERT(subblock_id < 2);
- RG_ETC1_ASSERT(t < 8);
- const uint ofs = subblock_id ? 2 : 5;
- m_bytes[3] &= ~(7 << ofs);
- m_bytes[3] |= (t << ofs);
- }
-
- // Returned selector value ranges from 0-3 and is a direct index into g_etc1_inten_tables.
- inline uint get_selector(uint x, uint y) const
- {
- RG_ETC1_ASSERT((x | y) < 4);
-
- const uint bit_index = x * 4 + y;
- const uint byte_bit_ofs = bit_index & 7;
- const uint8 *p = &m_bytes[7 - (bit_index >> 3)];
- const uint lsb = (p[0] >> byte_bit_ofs) & 1;
- const uint msb = (p[-2] >> byte_bit_ofs) & 1;
- const uint val = lsb | (msb << 1);
-
- return g_etc1_to_selector_index[val];
- }
-
- // Selector "val" ranges from 0-3 and is a direct index into g_etc1_inten_tables.
- inline void set_selector(uint x, uint y, uint val)
- {
- RG_ETC1_ASSERT((x | y | val) < 4);
- const uint bit_index = x * 4 + y;
-
- uint8 *p = &m_bytes[7 - (bit_index >> 3)];
-
- const uint byte_bit_ofs = bit_index & 7;
- const uint mask = 1 << byte_bit_ofs;
-
- const uint etc1_val = g_selector_index_to_etc1[val];
-
- const uint lsb = etc1_val & 1;
- const uint msb = etc1_val >> 1;
-
- p[0] &= ~mask;
- p[0] |= (lsb << byte_bit_ofs);
-
- p[-2] &= ~mask;
- p[-2] |= (msb << byte_bit_ofs);
- }
-
- inline void set_base4_color(uint idx, uint16 c)
- {
- if (idx)
- {
- set_byte_bits(cETC1AbsColor4R2BitOffset, 4, (c >> 8) & 15);
- set_byte_bits(cETC1AbsColor4G2BitOffset, 4, (c >> 4) & 15);
- set_byte_bits(cETC1AbsColor4B2BitOffset, 4, c & 15);
- }
- else
- {
- set_byte_bits(cETC1AbsColor4R1BitOffset, 4, (c >> 8) & 15);
- set_byte_bits(cETC1AbsColor4G1BitOffset, 4, (c >> 4) & 15);
- set_byte_bits(cETC1AbsColor4B1BitOffset, 4, c & 15);
- }
- }
-
- inline uint16 get_base4_color(uint idx) const
- {
- uint r, g, b;
- if (idx)
- {
- r = get_byte_bits(cETC1AbsColor4R2BitOffset, 4);
- g = get_byte_bits(cETC1AbsColor4G2BitOffset, 4);
- b = get_byte_bits(cETC1AbsColor4B2BitOffset, 4);
- }
- else
- {
- r = get_byte_bits(cETC1AbsColor4R1BitOffset, 4);
- g = get_byte_bits(cETC1AbsColor4G1BitOffset, 4);
- b = get_byte_bits(cETC1AbsColor4B1BitOffset, 4);
- }
- return static_cast<uint16>(b | (g << 4U) | (r << 8U));
- }
-
- inline void set_base5_color(uint16 c)
- {
- set_byte_bits(cETC1BaseColor5RBitOffset, 5, (c >> 10) & 31);
- set_byte_bits(cETC1BaseColor5GBitOffset, 5, (c >> 5) & 31);
- set_byte_bits(cETC1BaseColor5BBitOffset, 5, c & 31);
- }
-
- inline uint16 get_base5_color() const
- {
- const uint r = get_byte_bits(cETC1BaseColor5RBitOffset, 5);
- const uint g = get_byte_bits(cETC1BaseColor5GBitOffset, 5);
- const uint b = get_byte_bits(cETC1BaseColor5BBitOffset, 5);
- return static_cast<uint16>(b | (g << 5U) | (r << 10U));
- }
-
- void set_delta3_color(uint16 c)
- {
- set_byte_bits(cETC1DeltaColor3RBitOffset, 3, (c >> 6) & 7);
- set_byte_bits(cETC1DeltaColor3GBitOffset, 3, (c >> 3) & 7);
- set_byte_bits(cETC1DeltaColor3BBitOffset, 3, c & 7);
- }
-
- inline uint16 get_delta3_color() const
- {
- const uint r = get_byte_bits(cETC1DeltaColor3RBitOffset, 3);
- const uint g = get_byte_bits(cETC1DeltaColor3GBitOffset, 3);
- const uint b = get_byte_bits(cETC1DeltaColor3BBitOffset, 3);
- return static_cast<uint16>(b | (g << 3U) | (r << 6U));
- }
-
- // Base color 5
- static uint16 pack_color5(const color_quad_u8& color, bool scaled, uint bias = 127U);
- static uint16 pack_color5(uint r, uint g, uint b, bool scaled, uint bias = 127U);
-
- static color_quad_u8 unpack_color5(uint16 packed_color5, bool scaled, uint alpha = 255U);
- static void unpack_color5(uint& r, uint& g, uint& b, uint16 packed_color, bool scaled);
-
- static bool unpack_color5(color_quad_u8& result, uint16 packed_color5, uint16 packed_delta3, bool scaled, uint alpha = 255U);
- static bool unpack_color5(uint& r, uint& g, uint& b, uint16 packed_color5, uint16 packed_delta3, bool scaled, uint alpha = 255U);
-
- // Delta color 3
- // Inputs range from -4 to 3 (cETC1ColorDeltaMin to cETC1ColorDeltaMax)
- static uint16 pack_delta3(int r, int g, int b);
-
- // Results range from -4 to 3 (cETC1ColorDeltaMin to cETC1ColorDeltaMax)
- static void unpack_delta3(int& r, int& g, int& b, uint16 packed_delta3);
-
- // Abs color 4
- static uint16 pack_color4(const color_quad_u8& color, bool scaled, uint bias = 127U);
- static uint16 pack_color4(uint r, uint g, uint b, bool scaled, uint bias = 127U);
-
- static color_quad_u8 unpack_color4(uint16 packed_color4, bool scaled, uint alpha = 255U);
- static void unpack_color4(uint& r, uint& g, uint& b, uint16 packed_color4, bool scaled);
-
- // subblock colors
- static void get_diff_subblock_colors(color_quad_u8* pDst, uint16 packed_color5, uint table_idx);
- static bool get_diff_subblock_colors(color_quad_u8* pDst, uint16 packed_color5, uint16 packed_delta3, uint table_idx);
- static void get_abs_subblock_colors(color_quad_u8* pDst, uint16 packed_color4, uint table_idx);
-
- static inline void unscaled_to_scaled_color(color_quad_u8& dst, const color_quad_u8& src, bool color4)
- {
- if (color4)
- {
- dst.r = src.r | (src.r << 4);
- dst.g = src.g | (src.g << 4);
- dst.b = src.b | (src.b << 4);
- }
- else
- {
- dst.r = (src.r >> 2) | (src.r << 3);
- dst.g = (src.g >> 2) | (src.g << 3);
- dst.b = (src.b >> 2) | (src.b << 3);
- }
- dst.a = src.a;
- }
- };
-
- // Returns pointer to sorted array.
- template<typename T, typename Q>
- T* indirect_radix_sort(uint num_indices, T* pIndices0, T* pIndices1, const Q* pKeys, uint key_ofs, uint key_size, bool init_indices)
- {
- RG_ETC1_ASSERT((key_ofs >= 0) && (key_ofs < sizeof(T)));
- RG_ETC1_ASSERT((key_size >= 1) && (key_size <= 4));
-
- if (init_indices)
- {
- T* p = pIndices0;
- T* q = pIndices0 + (num_indices >> 1) * 2;
- uint i;
- for (i = 0; p != q; p += 2, i += 2)
- {
- p[0] = static_cast<T>(i);
- p[1] = static_cast<T>(i + 1);
- }
-
- if (num_indices & 1)
- *p = static_cast<T>(i);
- }
-
- uint hist[256 * 4];
-
- memset(hist, 0, sizeof(hist[0]) * 256 * key_size);
-
-#define RG_ETC1_GET_KEY(p) (*(const uint*)((const uint8*)(pKeys + *(p)) + key_ofs))
-#define RG_ETC1_GET_KEY_FROM_INDEX(i) (*(const uint*)((const uint8*)(pKeys + (i)) + key_ofs))
-
- if (key_size == 4)
- {
- T* p = pIndices0;
- T* q = pIndices0 + num_indices;
- for ( ; p != q; p++)
- {
- const uint key = RG_ETC1_GET_KEY(p);
-
- hist[ key & 0xFF]++;
- hist[256 + ((key >> 8) & 0xFF)]++;
- hist[512 + ((key >> 16) & 0xFF)]++;
- hist[768 + ((key >> 24) & 0xFF)]++;
- }
- }
- else if (key_size == 3)
- {
- T* p = pIndices0;
- T* q = pIndices0 + num_indices;
- for ( ; p != q; p++)
- {
- const uint key = RG_ETC1_GET_KEY(p);
-
- hist[ key & 0xFF]++;
- hist[256 + ((key >> 8) & 0xFF)]++;
- hist[512 + ((key >> 16) & 0xFF)]++;
- }
- }
- else if (key_size == 2)
- {
- T* p = pIndices0;
- T* q = pIndices0 + (num_indices >> 1) * 2;
-
- for ( ; p != q; p += 2)
- {
- const uint key0 = RG_ETC1_GET_KEY(p);
- const uint key1 = RG_ETC1_GET_KEY(p+1);
-
- hist[ key0 & 0xFF]++;
- hist[256 + ((key0 >> 8) & 0xFF)]++;
-
- hist[ key1 & 0xFF]++;
- hist[256 + ((key1 >> 8) & 0xFF)]++;
- }
-
- if (num_indices & 1)
- {
- const uint key = RG_ETC1_GET_KEY(p);
-
- hist[ key & 0xFF]++;
- hist[256 + ((key >> 8) & 0xFF)]++;
- }
- }
- else
- {
- RG_ETC1_ASSERT(key_size == 1);
- if (key_size != 1)
- return NULL;
-
- T* p = pIndices0;
- T* q = pIndices0 + (num_indices >> 1) * 2;
-
- for ( ; p != q; p += 2)
- {
- const uint key0 = RG_ETC1_GET_KEY(p);
- const uint key1 = RG_ETC1_GET_KEY(p+1);
-
- hist[key0 & 0xFF]++;
- hist[key1 & 0xFF]++;
- }
-
- if (num_indices & 1)
- {
- const uint key = RG_ETC1_GET_KEY(p);
-
- hist[key & 0xFF]++;
- }
- }
-
- T* pCur = pIndices0;
- T* pNew = pIndices1;
-
- for (uint pass = 0; pass < key_size; pass++)
- {
- const uint* pHist = &hist[pass << 8];
-
- uint offsets[256];
-
- uint cur_ofs = 0;
- for (uint i = 0; i < 256; i += 2)
- {
- offsets[i] = cur_ofs;
- cur_ofs += pHist[i];
-
- offsets[i+1] = cur_ofs;
- cur_ofs += pHist[i+1];
- }
-
- const uint pass_shift = pass << 3;
-
- T* p = pCur;
- T* q = pCur + (num_indices >> 1) * 2;
-
- for ( ; p != q; p += 2)
- {
- uint index0 = p[0];
- uint index1 = p[1];
-
- uint c0 = (RG_ETC1_GET_KEY_FROM_INDEX(index0) >> pass_shift) & 0xFF;
- uint c1 = (RG_ETC1_GET_KEY_FROM_INDEX(index1) >> pass_shift) & 0xFF;
-
- if (c0 == c1)
- {
- uint dst_offset0 = offsets[c0];
-
- offsets[c0] = dst_offset0 + 2;
-
- pNew[dst_offset0] = static_cast<T>(index0);
- pNew[dst_offset0 + 1] = static_cast<T>(index1);
- }
- else
- {
- uint dst_offset0 = offsets[c0]++;
- uint dst_offset1 = offsets[c1]++;
-
- pNew[dst_offset0] = static_cast<T>(index0);
- pNew[dst_offset1] = static_cast<T>(index1);
- }
- }
-
- if (num_indices & 1)
- {
- uint index = *p;
- uint c = (RG_ETC1_GET_KEY_FROM_INDEX(index) >> pass_shift) & 0xFF;
-
- uint dst_offset = offsets[c];
- offsets[c] = dst_offset + 1;
-
- pNew[dst_offset] = static_cast<T>(index);
- }
-
- T* t = pCur;
- pCur = pNew;
- pNew = t;
- }
-
- return pCur;
- }
-
-#undef RG_ETC1_GET_KEY
-#undef RG_ETC1_GET_KEY_FROM_INDEX
-
- uint16 etc1_block::pack_color5(const color_quad_u8& color, bool scaled, uint bias)
- {
- return pack_color5(color.r, color.g, color.b, scaled, bias);
- }
-
- uint16 etc1_block::pack_color5(uint r, uint g, uint b, bool scaled, uint bias)
- {
- if (scaled)
- {
- r = (r * 31U + bias) / 255U;
- g = (g * 31U + bias) / 255U;
- b = (b * 31U + bias) / 255U;
- }
-
- r = rg_etc1::minimum(r, 31U);
- g = rg_etc1::minimum(g, 31U);
- b = rg_etc1::minimum(b, 31U);
-
- return static_cast<uint16>(b | (g << 5U) | (r << 10U));
- }
-
- color_quad_u8 etc1_block::unpack_color5(uint16 packed_color5, bool scaled, uint alpha)
- {
- uint b = packed_color5 & 31U;
- uint g = (packed_color5 >> 5U) & 31U;
- uint r = (packed_color5 >> 10U) & 31U;
-
- if (scaled)
- {
- b = (b << 3U) | (b >> 2U);
- g = (g << 3U) | (g >> 2U);
- r = (r << 3U) | (r >> 2U);
- }
-
- return color_quad_u8(cNoClamp, r, g, b, rg_etc1::minimum(alpha, 255U));
- }
-
- void etc1_block::unpack_color5(uint& r, uint& g, uint& b, uint16 packed_color5, bool scaled)
- {
- color_quad_u8 c(unpack_color5(packed_color5, scaled, 0));
- r = c.r;
- g = c.g;
- b = c.b;
- }
-
- bool etc1_block::unpack_color5(color_quad_u8& result, uint16 packed_color5, uint16 packed_delta3, bool scaled, uint alpha)
- {
- int dc_r, dc_g, dc_b;
- unpack_delta3(dc_r, dc_g, dc_b, packed_delta3);
-
- int b = (packed_color5 & 31U) + dc_b;
- int g = ((packed_color5 >> 5U) & 31U) + dc_g;
- int r = ((packed_color5 >> 10U) & 31U) + dc_r;
-
- bool success = true;
- if (static_cast<uint>(r | g | b) > 31U)
- {
- success = false;
- r = rg_etc1::clamp<int>(r, 0, 31);
- g = rg_etc1::clamp<int>(g, 0, 31);
- b = rg_etc1::clamp<int>(b, 0, 31);
- }
-
- if (scaled)
- {
- b = (b << 3U) | (b >> 2U);
- g = (g << 3U) | (g >> 2U);
- r = (r << 3U) | (r >> 2U);
- }
-
- result.set_noclamp_rgba(r, g, b, rg_etc1::minimum(alpha, 255U));
- return success;
- }
-
- bool etc1_block::unpack_color5(uint& r, uint& g, uint& b, uint16 packed_color5, uint16 packed_delta3, bool scaled, uint alpha)
- {
- color_quad_u8 result;
- const bool success = unpack_color5(result, packed_color5, packed_delta3, scaled, alpha);
- r = result.r;
- g = result.g;
- b = result.b;
- return success;
- }
-
- uint16 etc1_block::pack_delta3(int r, int g, int b)
- {
- RG_ETC1_ASSERT((r >= cETC1ColorDeltaMin) && (r <= cETC1ColorDeltaMax));
- RG_ETC1_ASSERT((g >= cETC1ColorDeltaMin) && (g <= cETC1ColorDeltaMax));
- RG_ETC1_ASSERT((b >= cETC1ColorDeltaMin) && (b <= cETC1ColorDeltaMax));
- if (r < 0) r += 8;
- if (g < 0) g += 8;
- if (b < 0) b += 8;
- return static_cast<uint16>(b | (g << 3) | (r << 6));
- }
-
- void etc1_block::unpack_delta3(int& r, int& g, int& b, uint16 packed_delta3)
- {
- r = (packed_delta3 >> 6) & 7;
- g = (packed_delta3 >> 3) & 7;
- b = packed_delta3 & 7;
- if (r >= 4) r -= 8;
- if (g >= 4) g -= 8;
- if (b >= 4) b -= 8;
- }
-
- uint16 etc1_block::pack_color4(const color_quad_u8& color, bool scaled, uint bias)
- {
- return pack_color4(color.r, color.g, color.b, scaled, bias);
- }
-
- uint16 etc1_block::pack_color4(uint r, uint g, uint b, bool scaled, uint bias)
- {
- if (scaled)
- {
- r = (r * 15U + bias) / 255U;
- g = (g * 15U + bias) / 255U;
- b = (b * 15U + bias) / 255U;
- }
-
- r = rg_etc1::minimum(r, 15U);
- g = rg_etc1::minimum(g, 15U);
- b = rg_etc1::minimum(b, 15U);
-
- return static_cast<uint16>(b | (g << 4U) | (r << 8U));
- }
-
- color_quad_u8 etc1_block::unpack_color4(uint16 packed_color4, bool scaled, uint alpha)
- {
- uint b = packed_color4 & 15U;
- uint g = (packed_color4 >> 4U) & 15U;
- uint r = (packed_color4 >> 8U) & 15U;
-
- if (scaled)
- {
- b = (b << 4U) | b;
- g = (g << 4U) | g;
- r = (r << 4U) | r;
- }
-
- return color_quad_u8(cNoClamp, r, g, b, rg_etc1::minimum(alpha, 255U));
- }
-
- void etc1_block::unpack_color4(uint& r, uint& g, uint& b, uint16 packed_color4, bool scaled)
- {
- color_quad_u8 c(unpack_color4(packed_color4, scaled, 0));
- r = c.r;
- g = c.g;
- b = c.b;
- }
-
- void etc1_block::get_diff_subblock_colors(color_quad_u8* pDst, uint16 packed_color5, uint table_idx)
- {
- RG_ETC1_ASSERT(table_idx < cETC1IntenModifierValues);
- const int *pInten_modifer_table = &g_etc1_inten_tables[table_idx][0];
-
- uint r, g, b;
- unpack_color5(r, g, b, packed_color5, true);
-
- const int ir = static_cast<int>(r), ig = static_cast<int>(g), ib = static_cast<int>(b);
-
- const int y0 = pInten_modifer_table[0];
- pDst[0].set(ir + y0, ig + y0, ib + y0);
-
- const int y1 = pInten_modifer_table[1];
- pDst[1].set(ir + y1, ig + y1, ib + y1);
-
- const int y2 = pInten_modifer_table[2];
- pDst[2].set(ir + y2, ig + y2, ib + y2);
-
- const int y3 = pInten_modifer_table[3];
- pDst[3].set(ir + y3, ig + y3, ib + y3);
- }
-
- bool etc1_block::get_diff_subblock_colors(color_quad_u8* pDst, uint16 packed_color5, uint16 packed_delta3, uint table_idx)
- {
- RG_ETC1_ASSERT(table_idx < cETC1IntenModifierValues);
- const int *pInten_modifer_table = &g_etc1_inten_tables[table_idx][0];
-
- uint r, g, b;
- bool success = unpack_color5(r, g, b, packed_color5, packed_delta3, true);
-
- const int ir = static_cast<int>(r), ig = static_cast<int>(g), ib = static_cast<int>(b);
-
- const int y0 = pInten_modifer_table[0];
- pDst[0].set(ir + y0, ig + y0, ib + y0);
-
- const int y1 = pInten_modifer_table[1];
- pDst[1].set(ir + y1, ig + y1, ib + y1);
-
- const int y2 = pInten_modifer_table[2];
- pDst[2].set(ir + y2, ig + y2, ib + y2);
-
- const int y3 = pInten_modifer_table[3];
- pDst[3].set(ir + y3, ig + y3, ib + y3);
-
- return success;
- }
-
- void etc1_block::get_abs_subblock_colors(color_quad_u8* pDst, uint16 packed_color4, uint table_idx)
- {
- RG_ETC1_ASSERT(table_idx < cETC1IntenModifierValues);
- const int *pInten_modifer_table = &g_etc1_inten_tables[table_idx][0];
-
- uint r, g, b;
- unpack_color4(r, g, b, packed_color4, true);
-
- const int ir = static_cast<int>(r), ig = static_cast<int>(g), ib = static_cast<int>(b);
-
- const int y0 = pInten_modifer_table[0];
- pDst[0].set(ir + y0, ig + y0, ib + y0);
-
- const int y1 = pInten_modifer_table[1];
- pDst[1].set(ir + y1, ig + y1, ib + y1);
-
- const int y2 = pInten_modifer_table[2];
- pDst[2].set(ir + y2, ig + y2, ib + y2);
-
- const int y3 = pInten_modifer_table[3];
- pDst[3].set(ir + y3, ig + y3, ib + y3);
- }
-
- bool unpack_etc1_block(const void* pETC1_block, unsigned int* pDst_pixels_rgba, bool preserve_alpha)
- {
- color_quad_u8* pDst = reinterpret_cast<color_quad_u8*>(pDst_pixels_rgba);
- const etc1_block& block = *static_cast<const etc1_block*>(pETC1_block);
-
- const bool diff_flag = block.get_diff_bit();
- const bool flip_flag = block.get_flip_bit();
- const uint table_index0 = block.get_inten_table(0);
- const uint table_index1 = block.get_inten_table(1);
-
- color_quad_u8 subblock_colors0[4];
- color_quad_u8 subblock_colors1[4];
- bool success = true;
-
- if (diff_flag)
- {
- const uint16 base_color5 = block.get_base5_color();
- const uint16 delta_color3 = block.get_delta3_color();
- etc1_block::get_diff_subblock_colors(subblock_colors0, base_color5, table_index0);
-
- if (!etc1_block::get_diff_subblock_colors(subblock_colors1, base_color5, delta_color3, table_index1))
- success = false;
- }
- else
- {
- const uint16 base_color4_0 = block.get_base4_color(0);
- etc1_block::get_abs_subblock_colors(subblock_colors0, base_color4_0, table_index0);
-
- const uint16 base_color4_1 = block.get_base4_color(1);
- etc1_block::get_abs_subblock_colors(subblock_colors1, base_color4_1, table_index1);
- }
-
- if (preserve_alpha)
- {
- if (flip_flag)
- {
- for (uint y = 0; y < 2; y++)
- {
- pDst[0].set_rgb(subblock_colors0[block.get_selector(0, y)]);
- pDst[1].set_rgb(subblock_colors0[block.get_selector(1, y)]);
- pDst[2].set_rgb(subblock_colors0[block.get_selector(2, y)]);
- pDst[3].set_rgb(subblock_colors0[block.get_selector(3, y)]);
- pDst += 4;
- }
-
- for (uint y = 2; y < 4; y++)
- {
- pDst[0].set_rgb(subblock_colors1[block.get_selector(0, y)]);
- pDst[1].set_rgb(subblock_colors1[block.get_selector(1, y)]);
- pDst[2].set_rgb(subblock_colors1[block.get_selector(2, y)]);
- pDst[3].set_rgb(subblock_colors1[block.get_selector(3, y)]);
- pDst += 4;
- }
- }
- else
- {
- for (uint y = 0; y < 4; y++)
- {
- pDst[0].set_rgb(subblock_colors0[block.get_selector(0, y)]);
- pDst[1].set_rgb(subblock_colors0[block.get_selector(1, y)]);
- pDst[2].set_rgb(subblock_colors1[block.get_selector(2, y)]);
- pDst[3].set_rgb(subblock_colors1[block.get_selector(3, y)]);
- pDst += 4;
- }
- }
- }
- else
- {
- if (flip_flag)
- {
- // 0000
- // 0000
- // 1111
- // 1111
- for (uint y = 0; y < 2; y++)
- {
- pDst[0] = subblock_colors0[block.get_selector(0, y)];
- pDst[1] = subblock_colors0[block.get_selector(1, y)];
- pDst[2] = subblock_colors0[block.get_selector(2, y)];
- pDst[3] = subblock_colors0[block.get_selector(3, y)];
- pDst += 4;
- }
-
- for (uint y = 2; y < 4; y++)
- {
- pDst[0] = subblock_colors1[block.get_selector(0, y)];
- pDst[1] = subblock_colors1[block.get_selector(1, y)];
- pDst[2] = subblock_colors1[block.get_selector(2, y)];
- pDst[3] = subblock_colors1[block.get_selector(3, y)];
- pDst += 4;
- }
- }
- else
- {
- // 0011
- // 0011
- // 0011
- // 0011
- for (uint y = 0; y < 4; y++)
- {
- pDst[0] = subblock_colors0[block.get_selector(0, y)];
- pDst[1] = subblock_colors0[block.get_selector(1, y)];
- pDst[2] = subblock_colors1[block.get_selector(2, y)];
- pDst[3] = subblock_colors1[block.get_selector(3, y)];
- pDst += 4;
- }
- }
- }
-
- return success;
- }
-
- struct etc1_solution_coordinates
- {
- inline etc1_solution_coordinates() :
- m_unscaled_color(0, 0, 0, 0),
- m_inten_table(0),
- m_color4(false)
- {
- }
-
- inline etc1_solution_coordinates(uint r, uint g, uint b, uint inten_table, bool color4) :
- m_unscaled_color(r, g, b, 255),
- m_inten_table(inten_table),
- m_color4(color4)
- {
- }
-
- inline etc1_solution_coordinates(const color_quad_u8& c, uint inten_table, bool color4) :
- m_unscaled_color(c),
- m_inten_table(inten_table),
- m_color4(color4)
- {
- }
-
- inline etc1_solution_coordinates(const etc1_solution_coordinates& other)
- {
- *this = other;
- }
-
- inline etc1_solution_coordinates& operator= (const etc1_solution_coordinates& rhs)
- {
- m_unscaled_color = rhs.m_unscaled_color;
- m_inten_table = rhs.m_inten_table;
- m_color4 = rhs.m_color4;
- return *this;
- }
-
- inline void clear()
- {
- m_unscaled_color.clear();
- m_inten_table = 0;
- m_color4 = false;
- }
-
- inline color_quad_u8 get_scaled_color() const
- {
- int br, bg, bb;
- if (m_color4)
- {
- br = m_unscaled_color.r | (m_unscaled_color.r << 4);
- bg = m_unscaled_color.g | (m_unscaled_color.g << 4);
- bb = m_unscaled_color.b | (m_unscaled_color.b << 4);
- }
- else
- {
- br = (m_unscaled_color.r >> 2) | (m_unscaled_color.r << 3);
- bg = (m_unscaled_color.g >> 2) | (m_unscaled_color.g << 3);
- bb = (m_unscaled_color.b >> 2) | (m_unscaled_color.b << 3);
- }
- return color_quad_u8(br, bg, bb);
- }
-
- inline void get_block_colors(color_quad_u8* pBlock_colors)
- {
- int br, bg, bb;
- if (m_color4)
- {
- br = m_unscaled_color.r | (m_unscaled_color.r << 4);
- bg = m_unscaled_color.g | (m_unscaled_color.g << 4);
- bb = m_unscaled_color.b | (m_unscaled_color.b << 4);
- }
- else
- {
- br = (m_unscaled_color.r >> 2) | (m_unscaled_color.r << 3);
- bg = (m_unscaled_color.g >> 2) | (m_unscaled_color.g << 3);
- bb = (m_unscaled_color.b >> 2) | (m_unscaled_color.b << 3);
- }
- const int* pInten_table = g_etc1_inten_tables[m_inten_table];
- pBlock_colors[0].set(br + pInten_table[0], bg + pInten_table[0], bb + pInten_table[0]);
- pBlock_colors[1].set(br + pInten_table[1], bg + pInten_table[1], bb + pInten_table[1]);
- pBlock_colors[2].set(br + pInten_table[2], bg + pInten_table[2], bb + pInten_table[2]);
- pBlock_colors[3].set(br + pInten_table[3], bg + pInten_table[3], bb + pInten_table[3]);
- }
-
- color_quad_u8 m_unscaled_color;
- uint m_inten_table;
- bool m_color4;
- };
-
- class etc1_optimizer
- {
- etc1_optimizer(const etc1_optimizer&);
- etc1_optimizer& operator= (const etc1_optimizer&);
-
- public:
- etc1_optimizer()
- {
- clear();
- }
-
- void clear()
- {
- m_pParams = NULL;
- m_pResult = NULL;
- m_pSorted_luma = NULL;
- m_pSorted_luma_indices = NULL;
- }
-
- struct params : etc1_pack_params
- {
- params()
- {
- clear();
- }
-
- params(const etc1_pack_params& base_params) :
- etc1_pack_params(base_params)
- {
- clear_optimizer_params();
- }
-
- void clear()
- {
- etc1_pack_params::clear();
- clear_optimizer_params();
- }
-
- void clear_optimizer_params()
- {
- m_num_src_pixels = 0;
- m_pSrc_pixels = 0;
-
- m_use_color4 = false;
- static const int s_default_scan_delta[] = { 0 };
- m_pScan_deltas = s_default_scan_delta;
- m_scan_delta_size = 1;
-
- m_base_color5.clear();
- m_constrain_against_base_color5 = false;
- }
-
- uint m_num_src_pixels;
- const color_quad_u8* m_pSrc_pixels;
-
- bool m_use_color4;
- const int* m_pScan_deltas;
- uint m_scan_delta_size;
-
- color_quad_u8 m_base_color5;
- bool m_constrain_against_base_color5;
- };
-
- struct results
- {
- uint64 m_error;
- color_quad_u8 m_block_color_unscaled;
- uint m_block_inten_table;
- uint m_n;
- uint8* m_pSelectors;
- bool m_block_color4;
-
- inline results& operator= (const results& rhs)
- {
- m_block_color_unscaled = rhs.m_block_color_unscaled;
- m_block_color4 = rhs.m_block_color4;
- m_block_inten_table = rhs.m_block_inten_table;
- m_error = rhs.m_error;
- RG_ETC1_ASSERT(m_n == rhs.m_n);
- memcpy(m_pSelectors, rhs.m_pSelectors, rhs.m_n);
- return *this;
- }
- };
-
- void init(const params& params, results& result);
- bool compute();
-
- private:
- struct potential_solution
- {
- potential_solution() : m_coords(), m_error(cUINT64_MAX), m_valid(false)
- {
- }
-
- etc1_solution_coordinates m_coords;
- uint8 m_selectors[8];
- uint64 m_error;
- bool m_valid;
-
- void clear()
- {
- m_coords.clear();
- m_error = cUINT64_MAX;
- m_valid = false;
- }
- };
-
- const params* m_pParams;
- results* m_pResult;
-
- int m_limit;
-
- vec3F m_avg_color;
- int m_br, m_bg, m_bb;
- uint16 m_luma[8];
- uint32 m_sorted_luma[2][8];
- const uint32* m_pSorted_luma_indices;
- uint32* m_pSorted_luma;
-
- uint8 m_selectors[8];
- uint8 m_best_selectors[8];
-
- potential_solution m_best_solution;
- potential_solution m_trial_solution;
- uint8 m_temp_selectors[8];
-
- bool evaluate_solution(const etc1_solution_coordinates& coords, potential_solution& trial_solution, potential_solution* pBest_solution);
- bool evaluate_solution_fast(const etc1_solution_coordinates& coords, potential_solution& trial_solution, potential_solution* pBest_solution);
- };
-
- bool etc1_optimizer::compute()
- {
- const uint n = m_pParams->m_num_src_pixels;
- const int scan_delta_size = m_pParams->m_scan_delta_size;
-
- // Scan through a subset of the 3D lattice centered around the avg block color trying each 3D (555 or 444) lattice point as a potential block color.
- // Each time a better solution is found try to refine the current solution's block color based of the current selectors and intensity table index.
- for (int zdi = 0; zdi < scan_delta_size; zdi++)
- {
- const int zd = m_pParams->m_pScan_deltas[zdi];
- const int mbb = m_bb + zd;
- if (mbb < 0) continue; else if (mbb > m_limit) break;
-
- for (int ydi = 0; ydi < scan_delta_size; ydi++)
- {
- const int yd = m_pParams->m_pScan_deltas[ydi];
- const int mbg = m_bg + yd;
- if (mbg < 0) continue; else if (mbg > m_limit) break;
-
- for (int xdi = 0; xdi < scan_delta_size; xdi++)
- {
- const int xd = m_pParams->m_pScan_deltas[xdi];
- const int mbr = m_br + xd;
- if (mbr < 0) continue; else if (mbr > m_limit) break;
-
- etc1_solution_coordinates coords(mbr, mbg, mbb, 0, m_pParams->m_use_color4);
- if (m_pParams->m_quality == cHighQuality)
- {
- if (!evaluate_solution(coords, m_trial_solution, &m_best_solution))
- continue;
- }
- else
- {
- if (!evaluate_solution_fast(coords, m_trial_solution, &m_best_solution))
- continue;
- }
-
- // Now we have the input block, the avg. color of the input pixels, a set of trial selector indices, and the block color+intensity index.
- // Now, for each component, attempt to refine the current solution by solving a simple linear equation. For example, for 4 colors:
- // The goal is:
- // pixel0 - (block_color+inten_table[selector0]) + pixel1 - (block_color+inten_table[selector1]) + pixel2 - (block_color+inten_table[selector2]) + pixel3 - (block_color+inten_table[selector3]) = 0
- // Rearranging this:
- // (pixel0 + pixel1 + pixel2 + pixel3) - (block_color+inten_table[selector0]) - (block_color+inten_table[selector1]) - (block_color+inten_table[selector2]) - (block_color+inten_table[selector3]) = 0
- // (pixel0 + pixel1 + pixel2 + pixel3) - block_color - inten_table[selector0] - block_color-inten_table[selector1] - block_color-inten_table[selector2] - block_color-inten_table[selector3] = 0
- // (pixel0 + pixel1 + pixel2 + pixel3) - 4*block_color - inten_table[selector0] - inten_table[selector1] - inten_table[selector2] - inten_table[selector3] = 0
- // (pixel0 + pixel1 + pixel2 + pixel3) - 4*block_color - (inten_table[selector0] + inten_table[selector1] + inten_table[selector2] + inten_table[selector3]) = 0
- // (pixel0 + pixel1 + pixel2 + pixel3)/4 - block_color - (inten_table[selector0] + inten_table[selector1] + inten_table[selector2] + inten_table[selector3])/4 = 0
- // block_color = (pixel0 + pixel1 + pixel2 + pixel3)/4 - (inten_table[selector0] + inten_table[selector1] + inten_table[selector2] + inten_table[selector3])/4
- // So what this means:
- // optimal_block_color = avg_input - avg_inten_delta
- // So the optimal block color can be computed by taking the average block color and subtracting the current average of the intensity delta.
- // Unfortunately, optimal_block_color must then be quantized to 555 or 444 so it's not always possible to improve matters using this formula.
- // Also, the above formula is for unclamped intensity deltas. The actual implementation takes into account clamping.
-
- const uint max_refinement_trials = (m_pParams->m_quality == cLowQuality) ? 2 : (((xd | yd | zd) == 0) ? 4 : 2);
- for (uint refinement_trial = 0; refinement_trial < max_refinement_trials; refinement_trial++)
- {
- const uint8* pSelectors = m_best_solution.m_selectors;
- const int* pInten_table = g_etc1_inten_tables[m_best_solution.m_coords.m_inten_table];
-
- int delta_sum_r = 0, delta_sum_g = 0, delta_sum_b = 0;
- const color_quad_u8 base_color(m_best_solution.m_coords.get_scaled_color());
- for (uint r = 0; r < n; r++)
- {
- const uint s = *pSelectors++;
- const int yd = pInten_table[s];
- // Compute actual delta being applied to each pixel, taking into account clamping.
- delta_sum_r += rg_etc1::clamp<int>(base_color.r + yd, 0, 255) - base_color.r;
- delta_sum_g += rg_etc1::clamp<int>(base_color.g + yd, 0, 255) - base_color.g;
- delta_sum_b += rg_etc1::clamp<int>(base_color.b + yd, 0, 255) - base_color.b;
- }
- if ((!delta_sum_r) && (!delta_sum_g) && (!delta_sum_b))
- break;
- const float avg_delta_r_f = static_cast<float>(delta_sum_r) / n;
- const float avg_delta_g_f = static_cast<float>(delta_sum_g) / n;
- const float avg_delta_b_f = static_cast<float>(delta_sum_b) / n;
- const int br1 = rg_etc1::clamp<int>(static_cast<uint>((m_avg_color[0] - avg_delta_r_f) * m_limit / 255.0f + .5f), 0, m_limit);
- const int bg1 = rg_etc1::clamp<int>(static_cast<uint>((m_avg_color[1] - avg_delta_g_f) * m_limit / 255.0f + .5f), 0, m_limit);
- const int bb1 = rg_etc1::clamp<int>(static_cast<uint>((m_avg_color[2] - avg_delta_b_f) * m_limit / 255.0f + .5f), 0, m_limit);
-
- bool skip = false;
-
- if ((mbr == br1) && (mbg == bg1) && (mbb == bb1))
- skip = true;
- else if ((br1 == m_best_solution.m_coords.m_unscaled_color.r) && (bg1 == m_best_solution.m_coords.m_unscaled_color.g) && (bb1 == m_best_solution.m_coords.m_unscaled_color.b))
- skip = true;
- else if ((m_br == br1) && (m_bg == bg1) && (m_bb == bb1))
- skip = true;
-
- if (skip)
- break;
-
- etc1_solution_coordinates coords1(br1, bg1, bb1, 0, m_pParams->m_use_color4);
- if (m_pParams->m_quality == cHighQuality)
- {
- if (!evaluate_solution(coords1, m_trial_solution, &m_best_solution))
- break;
- }
- else
- {
- if (!evaluate_solution_fast(coords1, m_trial_solution, &m_best_solution))
- break;
- }
-
- } // refinement_trial
-
- } // xdi
- } // ydi
- } // zdi
-
- if (!m_best_solution.m_valid)
- {
- m_pResult->m_error = cUINT32_MAX;
- return false;
- }
-
- const uint8* pSelectors = m_best_solution.m_selectors;
-
-#ifdef RG_ETC1_BUILD_DEBUG
- {
- color_quad_u8 block_colors[4];
- m_best_solution.m_coords.get_block_colors(block_colors);
-
- const color_quad_u8* pSrc_pixels = m_pParams->m_pSrc_pixels;
- uint64 actual_error = 0;
- for (uint i = 0; i < n; i++)
- actual_error += pSrc_pixels[i].squared_distance_rgb(block_colors[pSelectors[i]]);
-
- RG_ETC1_ASSERT(actual_error == m_best_solution.m_error);
- }
-#endif
-
- m_pResult->m_error = m_best_solution.m_error;
-
- m_pResult->m_block_color_unscaled = m_best_solution.m_coords.m_unscaled_color;
- m_pResult->m_block_color4 = m_best_solution.m_coords.m_color4;
-
- m_pResult->m_block_inten_table = m_best_solution.m_coords.m_inten_table;
- memcpy(m_pResult->m_pSelectors, pSelectors, n);
- m_pResult->m_n = n;
-
- return true;
- }
-
- void etc1_optimizer::init(const params& p, results& r)
- {
- // This version is hardcoded for 8 pixel subblocks.
- RG_ETC1_ASSERT(p.m_num_src_pixels == 8);
-
- m_pParams = &p;
- m_pResult = &r;
-
- const uint n = 8;
-
- m_limit = m_pParams->m_use_color4 ? 15 : 31;
-
- vec3F avg_color(0.0f);
-
- for (uint i = 0; i < n; i++)
- {
- const color_quad_u8& c = m_pParams->m_pSrc_pixels[i];
- const vec3F fc(c.r, c.g, c.b);
-
- avg_color += fc;
-
- m_luma[i] = static_cast<uint16>(c.r + c.g + c.b);
- m_sorted_luma[0][i] = i;
- }
- avg_color *= (1.0f / static_cast<float>(n));
- m_avg_color = avg_color;
-
- m_br = rg_etc1::clamp<int>(static_cast<uint>(m_avg_color[0] * m_limit / 255.0f + .5f), 0, m_limit);
- m_bg = rg_etc1::clamp<int>(static_cast<uint>(m_avg_color[1] * m_limit / 255.0f + .5f), 0, m_limit);
- m_bb = rg_etc1::clamp<int>(static_cast<uint>(m_avg_color[2] * m_limit / 255.0f + .5f), 0, m_limit);
-
- if (m_pParams->m_quality <= cMediumQuality)
- {
- m_pSorted_luma_indices = indirect_radix_sort(n, m_sorted_luma[0], m_sorted_luma[1], m_luma, 0, sizeof(m_luma[0]), false);
- m_pSorted_luma = m_sorted_luma[0];
- if (m_pSorted_luma_indices == m_sorted_luma[0])
- m_pSorted_luma = m_sorted_luma[1];
-
- for (uint i = 0; i < n; i++)
- m_pSorted_luma[i] = m_luma[m_pSorted_luma_indices[i]];
- }
-
- m_best_solution.m_coords.clear();
- m_best_solution.m_valid = false;
- m_best_solution.m_error = cUINT64_MAX;
- }
-
- bool etc1_optimizer::evaluate_solution(const etc1_solution_coordinates& coords, potential_solution& trial_solution, potential_solution* pBest_solution)
- {
- trial_solution.m_valid = false;
-
- if (m_pParams->m_constrain_against_base_color5)
- {
- const int dr = coords.m_unscaled_color.r - m_pParams->m_base_color5.r;
- const int dg = coords.m_unscaled_color.g - m_pParams->m_base_color5.g;
- const int db = coords.m_unscaled_color.b - m_pParams->m_base_color5.b;
-
- if ((rg_etc1::minimum(dr, dg, db) < cETC1ColorDeltaMin) || (rg_etc1::maximum(dr, dg, db) > cETC1ColorDeltaMax))
- return false;
- }
-
- const color_quad_u8 base_color(coords.get_scaled_color());
-
- const uint n = 8;
-
- trial_solution.m_error = cUINT64_MAX;
-
- for (uint inten_table = 0; inten_table < cETC1IntenModifierValues; inten_table++)
- {
- const int* pInten_table = g_etc1_inten_tables[inten_table];
-
- color_quad_u8 block_colors[4];
- for (uint s = 0; s < 4; s++)
- {
- const int yd = pInten_table[s];
- block_colors[s].set(base_color.r + yd, base_color.g + yd, base_color.b + yd, 0);
- }
-
- uint64 total_error = 0;
-
- const color_quad_u8* pSrc_pixels = m_pParams->m_pSrc_pixels;
- for (uint c = 0; c < n; c++)
- {
- const color_quad_u8& src_pixel = *pSrc_pixels++;
-
- uint best_selector_index = 0;
- uint best_error = rg_etc1::square(src_pixel.r - block_colors[0].r) + rg_etc1::square(src_pixel.g - block_colors[0].g) + rg_etc1::square(src_pixel.b - block_colors[0].b);
-
- uint trial_error = rg_etc1::square(src_pixel.r - block_colors[1].r) + rg_etc1::square(src_pixel.g - block_colors[1].g) + rg_etc1::square(src_pixel.b - block_colors[1].b);
- if (trial_error < best_error)
- {
- best_error = trial_error;
- best_selector_index = 1;
- }
-
- trial_error = rg_etc1::square(src_pixel.r - block_colors[2].r) + rg_etc1::square(src_pixel.g - block_colors[2].g) + rg_etc1::square(src_pixel.b - block_colors[2].b);
- if (trial_error < best_error)
- {
- best_error = trial_error;
- best_selector_index = 2;
- }
-
- trial_error = rg_etc1::square(src_pixel.r - block_colors[3].r) + rg_etc1::square(src_pixel.g - block_colors[3].g) + rg_etc1::square(src_pixel.b - block_colors[3].b);
- if (trial_error < best_error)
- {
- best_error = trial_error;
- best_selector_index = 3;
- }
-
- m_temp_selectors[c] = static_cast<uint8>(best_selector_index);
-
- total_error += best_error;
- if (total_error >= trial_solution.m_error)
- break;
- }
-
- if (total_error < trial_solution.m_error)
- {
- trial_solution.m_error = total_error;
- trial_solution.m_coords.m_inten_table = inten_table;
- memcpy(trial_solution.m_selectors, m_temp_selectors, 8);
- trial_solution.m_valid = true;
- }
- }
- trial_solution.m_coords.m_unscaled_color = coords.m_unscaled_color;
- trial_solution.m_coords.m_color4 = m_pParams->m_use_color4;
-
- bool success = false;
- if (pBest_solution)
- {
- if (trial_solution.m_error < pBest_solution->m_error)
- {
- *pBest_solution = trial_solution;
- success = true;
- }
- }
-
- return success;
- }
-
- bool etc1_optimizer::evaluate_solution_fast(const etc1_solution_coordinates& coords, potential_solution& trial_solution, potential_solution* pBest_solution)
- {
- if (m_pParams->m_constrain_against_base_color5)
- {
- const int dr = coords.m_unscaled_color.r - m_pParams->m_base_color5.r;
- const int dg = coords.m_unscaled_color.g - m_pParams->m_base_color5.g;
- const int db = coords.m_unscaled_color.b - m_pParams->m_base_color5.b;
-
- if ((rg_etc1::minimum(dr, dg, db) < cETC1ColorDeltaMin) || (rg_etc1::maximum(dr, dg, db) > cETC1ColorDeltaMax))
- {
- trial_solution.m_valid = false;
- return false;
- }
- }
-
- const color_quad_u8 base_color(coords.get_scaled_color());
-
- const uint n = 8;
-
- trial_solution.m_error = cUINT64_MAX;
-
- for (int inten_table = cETC1IntenModifierValues - 1; inten_table >= 0; --inten_table)
- {
- const int* pInten_table = g_etc1_inten_tables[inten_table];
-
- uint block_inten[4];
- color_quad_u8 block_colors[4];
- for (uint s = 0; s < 4; s++)
- {
- const int yd = pInten_table[s];
- color_quad_u8 block_color(base_color.r + yd, base_color.g + yd, base_color.b + yd, 0);
- block_colors[s] = block_color;
- block_inten[s] = block_color.r + block_color.g + block_color.b;
- }
-
- // evaluate_solution_fast() enforces/assumesd a total ordering of the input colors along the intensity (1,1,1) axis to more quickly classify the inputs to selectors.
- // The inputs colors have been presorted along the projection onto this axis, and ETC1 block colors are always ordered along the intensity axis, so this classification is fast.
- // 0 1 2 3
- // 01 12 23
- const uint block_inten_midpoints[3] = { block_inten[0] + block_inten[1], block_inten[1] + block_inten[2], block_inten[2] + block_inten[3] };
-
- uint64 total_error = 0;
- const color_quad_u8* pSrc_pixels = m_pParams->m_pSrc_pixels;
- if ((m_pSorted_luma[n - 1] * 2) < block_inten_midpoints[0])
- {
- if (block_inten[0] > m_pSorted_luma[n - 1])
- {
- const uint min_error = labs(block_inten[0] - m_pSorted_luma[n - 1]);
- if (min_error >= trial_solution.m_error)
- continue;
- }
-
- memset(&m_temp_selectors[0], 0, n);
-
- for (uint c = 0; c < n; c++)
- total_error += block_colors[0].squared_distance_rgb(pSrc_pixels[c]);
- }
- else if ((m_pSorted_luma[0] * 2) >= block_inten_midpoints[2])
- {
- if (m_pSorted_luma[0] > block_inten[3])
- {
- const uint min_error = labs(m_pSorted_luma[0] - block_inten[3]);
- if (min_error >= trial_solution.m_error)
- continue;
- }
-
- memset(&m_temp_selectors[0], 3, n);
-
- for (uint c = 0; c < n; c++)
- total_error += block_colors[3].squared_distance_rgb(pSrc_pixels[c]);
- }
- else
- {
- uint cur_selector = 0, c;
- for (c = 0; c < n; c++)
- {
- const uint y = m_pSorted_luma[c];
- while ((y * 2) >= block_inten_midpoints[cur_selector])
- if (++cur_selector > 2)
- goto done;
- const uint sorted_pixel_index = m_pSorted_luma_indices[c];
- m_temp_selectors[sorted_pixel_index] = static_cast<uint8>(cur_selector);
- total_error += block_colors[cur_selector].squared_distance_rgb(pSrc_pixels[sorted_pixel_index]);
- }
-done:
- while (c < n)
- {
- const uint sorted_pixel_index = m_pSorted_luma_indices[c];
- m_temp_selectors[sorted_pixel_index] = 3;
- total_error += block_colors[3].squared_distance_rgb(pSrc_pixels[sorted_pixel_index]);
- ++c;
- }
- }
-
- if (total_error < trial_solution.m_error)
- {
- trial_solution.m_error = total_error;
- trial_solution.m_coords.m_inten_table = inten_table;
- memcpy(trial_solution.m_selectors, m_temp_selectors, n);
- trial_solution.m_valid = true;
- if (!total_error)
- break;
- }
- }
- trial_solution.m_coords.m_unscaled_color = coords.m_unscaled_color;
- trial_solution.m_coords.m_color4 = m_pParams->m_use_color4;
-
- bool success = false;
- if (pBest_solution)
- {
- if (trial_solution.m_error < pBest_solution->m_error)
- {
- *pBest_solution = trial_solution;
- success = true;
- }
- }
-
- return success;
- }
-
- static uint etc1_decode_value(uint diff, uint inten, uint selector, uint packed_c)
- {
- const uint limit = diff ? 32 : 16; limit;
- RG_ETC1_ASSERT((diff < 2) && (inten < 8) && (selector < 4) && (packed_c < limit));
- int c;
- if (diff)
- c = (packed_c >> 2) | (packed_c << 3);
- else
- c = packed_c | (packed_c << 4);
- c += g_etc1_inten_tables[inten][selector];
- c = rg_etc1::clamp<int>(c, 0, 255);
- return c;
- }
-
- static inline int mul_8bit(int a, int b) { int t = a*b + 128; return (t + (t >> 8)) >> 8; }
-
- void pack_etc1_block_init()
- {
- for (uint diff = 0; diff < 2; diff++)
- {
- const uint limit = diff ? 32 : 16;
-
- for (uint inten = 0; inten < 8; inten++)
- {
- for (uint selector = 0; selector < 4; selector++)
- {
- const uint inverse_table_index = diff + (inten << 1) + (selector << 4);
- for (uint color = 0; color < 256; color++)
- {
- uint best_error = cUINT32_MAX, best_packed_c = 0;
- for (uint packed_c = 0; packed_c < limit; packed_c++)
- {
- int v = etc1_decode_value(diff, inten, selector, packed_c);
- uint err = labs(v - static_cast<int>(color));
- if (err < best_error)
- {
- best_error = err;
- best_packed_c = packed_c;
- if (!best_error)
- break;
- }
- }
- RG_ETC1_ASSERT(best_error <= 255);
- g_etc1_inverse_lookup[inverse_table_index][color] = static_cast<uint16>(best_packed_c | (best_error << 8));
- }
- }
- }
- }
-
- uint expand5[32];
- for(int i = 0; i < 32; i++)
- expand5[i] = (i << 3) | (i >> 2);
-
- for(int i = 0; i < 256 + 16; i++)
- {
- int v = clamp<int>(i - 8, 0, 255);
- g_quant5_tab[i] = static_cast<uint8>(expand5[mul_8bit(v,31)]);
- }
- }
-
- // Packs solid color blocks efficiently using a set of small precomputed tables.
- // For random 888 inputs, MSE results are better than Erricson's ETC1 packer in "slow" mode ~9.5% of the time, is slightly worse only ~.01% of the time, and is equal the rest of the time.
- static uint64 pack_etc1_block_solid_color(etc1_block& block, const uint8* pColor, etc1_pack_params& pack_params)
- {
- pack_params;
- RG_ETC1_ASSERT(g_etc1_inverse_lookup[0][255]);
-
- static uint s_next_comp[4] = { 1, 2, 0, 1 };
-
- uint best_error = cUINT32_MAX, best_i = 0;
- int best_x = 0, best_packed_c1 = 0, best_packed_c2 = 0;
-
- // For each possible 8-bit value, there is a precomputed list of diff/inten/selector configurations that allow that 8-bit value to be encoded with no error.
- for (uint i = 0; i < 3; i++)
- {
- const uint c1 = pColor[s_next_comp[i]], c2 = pColor[s_next_comp[i + 1]];
-
- const int delta_range = 1;
- for (int delta = -delta_range; delta <= delta_range; delta++)
- {
- const int c_plus_delta = rg_etc1::clamp<int>(pColor[i] + delta, 0, 255);
-
- const uint16* pTable;
- if (!c_plus_delta)
- pTable = g_color8_to_etc_block_config_0_255[0];
- else if (c_plus_delta == 255)
- pTable = g_color8_to_etc_block_config_0_255[1];
- else
- pTable = g_color8_to_etc_block_config_1_to_254[c_plus_delta - 1];
-
- do
- {
- const uint x = *pTable++;
-
-#ifdef RG_ETC1_BUILD_DEBUG
- const uint diff = x & 1;
- const uint inten = (x >> 1) & 7;
- const uint selector = (x >> 4) & 3;
- const uint p0 = (x >> 8) & 255;
- RG_ETC1_ASSERT(etc1_decode_value(diff, inten, selector, p0) == (uint)c_plus_delta);
-#endif
-
- const uint16* pInverse_table = g_etc1_inverse_lookup[x & 0xFF];
- uint16 p1 = pInverse_table[c1];
- uint16 p2 = pInverse_table[c2];
- const uint trial_error = rg_etc1::square(c_plus_delta - pColor[i]) + rg_etc1::square(p1 >> 8) + rg_etc1::square(p2 >> 8);
- if (trial_error < best_error)
- {
- best_error = trial_error;
- best_x = x;
- best_packed_c1 = p1 & 0xFF;
- best_packed_c2 = p2 & 0xFF;
- best_i = i;
- if (!best_error)
- goto found_perfect_match;
- }
- } while (*pTable != 0xFFFF);
- }
- }
-found_perfect_match:
-
- const uint diff = best_x & 1;
- const uint inten = (best_x >> 1) & 7;
-
- block.m_bytes[3] = static_cast<uint8>(((inten | (inten << 3)) << 2) | (diff << 1));
-
- const uint etc1_selector = g_selector_index_to_etc1[(best_x >> 4) & 3];
- *reinterpret_cast<uint16*>(&block.m_bytes[4]) = (etc1_selector & 2) ? 0xFFFF : 0;
- *reinterpret_cast<uint16*>(&block.m_bytes[6]) = (etc1_selector & 1) ? 0xFFFF : 0;
-
- const uint best_packed_c0 = (best_x >> 8) & 255;
- if (diff)
- {
- block.m_bytes[best_i] = static_cast<uint8>(best_packed_c0 << 3);
- block.m_bytes[s_next_comp[best_i]] = static_cast<uint8>(best_packed_c1 << 3);
- block.m_bytes[s_next_comp[best_i+1]] = static_cast<uint8>(best_packed_c2 << 3);
- }
- else
- {
- block.m_bytes[best_i] = static_cast<uint8>(best_packed_c0 | (best_packed_c0 << 4));
- block.m_bytes[s_next_comp[best_i]] = static_cast<uint8>(best_packed_c1 | (best_packed_c1 << 4));
- block.m_bytes[s_next_comp[best_i+1]] = static_cast<uint8>(best_packed_c2 | (best_packed_c2 << 4));
- }
-
- return best_error;
- }
-
- static uint pack_etc1_block_solid_color_constrained(
- etc1_optimizer::results& results,
- uint num_colors, const uint8* pColor,
- etc1_pack_params& pack_params,
- bool use_diff,
- const color_quad_u8* pBase_color5_unscaled)
- {
- RG_ETC1_ASSERT(g_etc1_inverse_lookup[0][255]);
-
- pack_params;
- static uint s_next_comp[4] = { 1, 2, 0, 1 };
-
- uint best_error = cUINT32_MAX, best_i = 0;
- int best_x = 0, best_packed_c1 = 0, best_packed_c2 = 0;
-
- // For each possible 8-bit value, there is a precomputed list of diff/inten/selector configurations that allow that 8-bit value to be encoded with no error.
- for (uint i = 0; i < 3; i++)
- {
- const uint c1 = pColor[s_next_comp[i]], c2 = pColor[s_next_comp[i + 1]];
-
- const int delta_range = 1;
- for (int delta = -delta_range; delta <= delta_range; delta++)
- {
- const int c_plus_delta = rg_etc1::clamp<int>(pColor[i] + delta, 0, 255);
-
- const uint16* pTable;
- if (!c_plus_delta)
- pTable = g_color8_to_etc_block_config_0_255[0];
- else if (c_plus_delta == 255)
- pTable = g_color8_to_etc_block_config_0_255[1];
- else
- pTable = g_color8_to_etc_block_config_1_to_254[c_plus_delta - 1];
-
- do
- {
- const uint x = *pTable++;
- const uint diff = x & 1;
- if (static_cast<uint>(use_diff) != diff)
- {
- if (*pTable == 0xFFFF)
- break;
- continue;
- }
-
- if ((diff) && (pBase_color5_unscaled))
- {
- const int p0 = (x >> 8) & 255;
- int delta = p0 - static_cast<int>(pBase_color5_unscaled->c[i]);
- if ((delta < cETC1ColorDeltaMin) || (delta > cETC1ColorDeltaMax))
- {
- if (*pTable == 0xFFFF)
- break;
- continue;
- }
- }
-
-#ifdef RG_ETC1_BUILD_DEBUG
- {
- const uint inten = (x >> 1) & 7;
- const uint selector = (x >> 4) & 3;
- const uint p0 = (x >> 8) & 255;
- RG_ETC1_ASSERT(etc1_decode_value(diff, inten, selector, p0) == (uint)c_plus_delta);
- }
-#endif
-
- const uint16* pInverse_table = g_etc1_inverse_lookup[x & 0xFF];
- uint16 p1 = pInverse_table[c1];
- uint16 p2 = pInverse_table[c2];
-
- if ((diff) && (pBase_color5_unscaled))
- {
- int delta1 = (p1 & 0xFF) - static_cast<int>(pBase_color5_unscaled->c[s_next_comp[i]]);
- int delta2 = (p2 & 0xFF) - static_cast<int>(pBase_color5_unscaled->c[s_next_comp[i + 1]]);
- if ((delta1 < cETC1ColorDeltaMin) || (delta1 > cETC1ColorDeltaMax) || (delta2 < cETC1ColorDeltaMin) || (delta2 > cETC1ColorDeltaMax))
- {
- if (*pTable == 0xFFFF)
- break;
- continue;
- }
- }
-
- const uint trial_error = rg_etc1::square(c_plus_delta - pColor[i]) + rg_etc1::square(p1 >> 8) + rg_etc1::square(p2 >> 8);
- if (trial_error < best_error)
- {
- best_error = trial_error;
- best_x = x;
- best_packed_c1 = p1 & 0xFF;
- best_packed_c2 = p2 & 0xFF;
- best_i = i;
- if (!best_error)
- goto found_perfect_match;
- }
- } while (*pTable != 0xFFFF);
- }
- }
-found_perfect_match:
-
- if (best_error == cUINT32_MAX)
- return best_error;
-
- best_error *= num_colors;
-
- results.m_n = num_colors;
- results.m_block_color4 = !(best_x & 1);
- results.m_block_inten_table = (best_x >> 1) & 7;
- memset(results.m_pSelectors, (best_x >> 4) & 3, num_colors);
-
- const uint best_packed_c0 = (best_x >> 8) & 255;
- results.m_block_color_unscaled[best_i] = static_cast<uint8>(best_packed_c0);
- results.m_block_color_unscaled[s_next_comp[best_i]] = static_cast<uint8>(best_packed_c1);
- results.m_block_color_unscaled[s_next_comp[best_i + 1]] = static_cast<uint8>(best_packed_c2);
- results.m_error = best_error;
-
- return best_error;
- }
-
- // Function originally from RYG's public domain real-time DXT1 compressor, modified for 555.
- static void dither_block_555(color_quad_u8* dest, const color_quad_u8* block)
- {
- int err[8],*ep1 = err,*ep2 = err+4;
- uint8 *quant = g_quant5_tab+8;
-
- memset(dest, 0xFF, sizeof(color_quad_u8)*16);
-
- // process channels seperately
- for(int ch=0;ch<3;ch++)
- {
- uint8* bp = (uint8*)block;
- uint8* dp = (uint8*)dest;
-
- bp += ch; dp += ch;
-
- memset(err,0, sizeof(err));
- for(int y = 0; y < 4; y++)
- {
- // pixel 0
- dp[ 0] = quant[bp[ 0] + ((3*ep2[1] + 5*ep2[0]) >> 4)];
- ep1[0] = bp[ 0] - dp[ 0];
-
- // pixel 1
- dp[ 4] = quant[bp[ 4] + ((7*ep1[0] + 3*ep2[2] + 5*ep2[1] + ep2[0]) >> 4)];
- ep1[1] = bp[ 4] - dp[ 4];
-
- // pixel 2
- dp[ 8] = quant[bp[ 8] + ((7*ep1[1] + 3*ep2[3] + 5*ep2[2] + ep2[1]) >> 4)];
- ep1[2] = bp[ 8] - dp[ 8];
-
- // pixel 3
- dp[12] = quant[bp[12] + ((7*ep1[2] + 5*ep2[3] + ep2[2]) >> 4)];
- ep1[3] = bp[12] - dp[12];
-
- // advance to next line
- int* tmp = ep1; ep1 = ep2; ep2 = tmp;
- bp += 16;
- dp += 16;
- }
- }
- }
-
- unsigned int pack_etc1_block(void* pETC1_block, const unsigned int* pSrc_pixels_rgba, etc1_pack_params& pack_params)
- {
- const color_quad_u8* pSrc_pixels = reinterpret_cast<const color_quad_u8*>(pSrc_pixels_rgba);
- etc1_block& dst_block = *static_cast<etc1_block*>(pETC1_block);
-
-#ifdef RG_ETC1_BUILD_DEBUG
- // Ensure all alpha values are 0xFF.
- for (uint i = 0; i < 16; i++)
- {
- RG_ETC1_ASSERT(pSrc_pixels[i].a == 255);
- }
-#endif
-
- color_quad_u8 src_pixel0(pSrc_pixels[0]);
-
- // Check for solid block.
- const uint32 first_pixel_u32 = pSrc_pixels->m_u32;
- int r;
- for (r = 15; r >= 1; --r)
- if (pSrc_pixels[r].m_u32 != first_pixel_u32)
- break;
- if (!r)
- return static_cast<unsigned int>(16 * pack_etc1_block_solid_color(dst_block, &pSrc_pixels[0].r, pack_params));
-
- color_quad_u8 dithered_pixels[16];
- if (pack_params.m_dithering)
- {
- dither_block_555(dithered_pixels, pSrc_pixels);
- pSrc_pixels = dithered_pixels;
- }
-
- etc1_optimizer optimizer;
-
- uint64 best_error = cUINT64_MAX;
- uint best_flip = false, best_use_color4 = false;
-
- uint8 best_selectors[2][8];
- etc1_optimizer::results best_results[2];
- for (uint i = 0; i < 2; i++)
- {
- best_results[i].m_n = 8;
- best_results[i].m_pSelectors = best_selectors[i];
- }
-
- uint8 selectors[3][8];
- etc1_optimizer::results results[3];
-
- for (uint i = 0; i < 3; i++)
- {
- results[i].m_n = 8;
- results[i].m_pSelectors = selectors[i];
- }
-
- color_quad_u8 subblock_pixels[8];
-
- etc1_optimizer::params params(pack_params);
- params.m_num_src_pixels = 8;
- params.m_pSrc_pixels = subblock_pixels;
-
- for (uint flip = 0; flip < 2; flip++)
- {
- for (uint use_color4 = 0; use_color4 < 2; use_color4++)
- {
- uint64 trial_error = 0;
-
- uint subblock;
- for (subblock = 0; subblock < 2; subblock++)
- {
- if (flip)
- memcpy(subblock_pixels, pSrc_pixels + subblock * 8, sizeof(color_quad_u8) * 8);
- else
- {
- const color_quad_u8* pSrc_col = pSrc_pixels + subblock * 2;
- subblock_pixels[0] = pSrc_col[0]; subblock_pixels[1] = pSrc_col[4]; subblock_pixels[2] = pSrc_col[8]; subblock_pixels[3] = pSrc_col[12];
- subblock_pixels[4] = pSrc_col[1]; subblock_pixels[5] = pSrc_col[5]; subblock_pixels[6] = pSrc_col[9]; subblock_pixels[7] = pSrc_col[13];
- }
-
- results[2].m_error = cUINT64_MAX;
- if ((params.m_quality >= cMediumQuality) && ((subblock) || (use_color4)))
- {
- const uint32 subblock_pixel0_u32 = subblock_pixels[0].m_u32;
- for (r = 7; r >= 1; --r)
- if (subblock_pixels[r].m_u32 != subblock_pixel0_u32)
- break;
- if (!r)
- {
- pack_etc1_block_solid_color_constrained(results[2], 8, &subblock_pixels[0].r, pack_params, !use_color4, (subblock && !use_color4) ? &results[0].m_block_color_unscaled : NULL);
- }
- }
-
- params.m_use_color4 = (use_color4 != 0);
- params.m_constrain_against_base_color5 = false;
-
- if ((!use_color4) && (subblock))
- {
- params.m_constrain_against_base_color5 = true;
- params.m_base_color5 = results[0].m_block_color_unscaled;
- }
-
- if (params.m_quality == cHighQuality)
- {
- static const int s_scan_delta_0_to_4[] = { -4, -3, -2, -1, 0, 1, 2, 3, 4 };
- params.m_scan_delta_size = RG_ETC1_ARRAY_SIZE(s_scan_delta_0_to_4);
- params.m_pScan_deltas = s_scan_delta_0_to_4;
- }
- else if (params.m_quality == cMediumQuality)
- {
- static const int s_scan_delta_0_to_1[] = { -1, 0, 1 };
- params.m_scan_delta_size = RG_ETC1_ARRAY_SIZE(s_scan_delta_0_to_1);
- params.m_pScan_deltas = s_scan_delta_0_to_1;
- }
- else
- {
- static const int s_scan_delta_0[] = { 0 };
- params.m_scan_delta_size = RG_ETC1_ARRAY_SIZE(s_scan_delta_0);
- params.m_pScan_deltas = s_scan_delta_0;
- }
-
- optimizer.init(params, results[subblock]);
- if (!optimizer.compute())
- break;
-
- if (params.m_quality >= cMediumQuality)
- {
- // TODO: Fix fairly arbitrary/unrefined thresholds that control how far away to scan for potentially better solutions.
- const uint refinement_error_thresh0 = 3000;
- const uint refinement_error_thresh1 = 6000;
- if (results[subblock].m_error > refinement_error_thresh0)
- {
- if (params.m_quality == cMediumQuality)
- {
- static const int s_scan_delta_2_to_3[] = { -3, -2, 2, 3 };
- params.m_scan_delta_size = RG_ETC1_ARRAY_SIZE(s_scan_delta_2_to_3);
- params.m_pScan_deltas = s_scan_delta_2_to_3;
- }
- else
- {
- static const int s_scan_delta_5_to_5[] = { -5, 5 };
- static const int s_scan_delta_5_to_8[] = { -8, -7, -6, -5, 5, 6, 7, 8 };
- if (results[subblock].m_error > refinement_error_thresh1)
- {
- params.m_scan_delta_size = RG_ETC1_ARRAY_SIZE(s_scan_delta_5_to_8);
- params.m_pScan_deltas = s_scan_delta_5_to_8;
- }
- else
- {
- params.m_scan_delta_size = RG_ETC1_ARRAY_SIZE(s_scan_delta_5_to_5);
- params.m_pScan_deltas = s_scan_delta_5_to_5;
- }
- }
-
- if (!optimizer.compute())
- break;
- }
-
- if (results[2].m_error < results[subblock].m_error)
- results[subblock] = results[2];
- }
-
- trial_error += results[subblock].m_error;
- if (trial_error >= best_error)
- break;
- }
-
- if (subblock < 2)
- continue;
-
- best_error = trial_error;
- best_results[0] = results[0];
- best_results[1] = results[1];
- best_flip = flip;
- best_use_color4 = use_color4;
-
- } // use_color4
-
- } // flip
-
- int dr = best_results[1].m_block_color_unscaled.r - best_results[0].m_block_color_unscaled.r;
- int dg = best_results[1].m_block_color_unscaled.g - best_results[0].m_block_color_unscaled.g;
- int db = best_results[1].m_block_color_unscaled.b - best_results[0].m_block_color_unscaled.b;
- RG_ETC1_ASSERT(best_use_color4 || (rg_etc1::minimum(dr, dg, db) >= cETC1ColorDeltaMin) && (rg_etc1::maximum(dr, dg, db) <= cETC1ColorDeltaMax));
-
- if (best_use_color4)
- {
- dst_block.m_bytes[0] = static_cast<uint8>(best_results[1].m_block_color_unscaled.r | (best_results[0].m_block_color_unscaled.r << 4));
- dst_block.m_bytes[1] = static_cast<uint8>(best_results[1].m_block_color_unscaled.g | (best_results[0].m_block_color_unscaled.g << 4));
- dst_block.m_bytes[2] = static_cast<uint8>(best_results[1].m_block_color_unscaled.b | (best_results[0].m_block_color_unscaled.b << 4));
- }
- else
- {
- if (dr < 0) dr += 8; dst_block.m_bytes[0] = static_cast<uint8>((best_results[0].m_block_color_unscaled.r << 3) | dr);
- if (dg < 0) dg += 8; dst_block.m_bytes[1] = static_cast<uint8>((best_results[0].m_block_color_unscaled.g << 3) | dg);
- if (db < 0) db += 8; dst_block.m_bytes[2] = static_cast<uint8>((best_results[0].m_block_color_unscaled.b << 3) | db);
- }
-
- dst_block.m_bytes[3] = static_cast<uint8>( (best_results[1].m_block_inten_table << 2) | (best_results[0].m_block_inten_table << 5) | ((~best_use_color4 & 1) << 1) | best_flip );
-
- uint selector0 = 0, selector1 = 0;
- if (best_flip)
- {
- // flipped:
- // { 0, 0 }, { 1, 0 }, { 2, 0 }, { 3, 0 },
- // { 0, 1 }, { 1, 1 }, { 2, 1 }, { 3, 1 }
- //
- // { 0, 2 }, { 1, 2 }, { 2, 2 }, { 3, 2 },
- // { 0, 3 }, { 1, 3 }, { 2, 3 }, { 3, 3 }
- const uint8* pSelectors0 = best_results[0].m_pSelectors;
- const uint8* pSelectors1 = best_results[1].m_pSelectors;
- for (int x = 3; x >= 0; --x)
- {
- uint b;
- b = g_selector_index_to_etc1[pSelectors1[4 + x]];
- selector0 = (selector0 << 1) | (b & 1); selector1 = (selector1 << 1) | (b >> 1);
-
- b = g_selector_index_to_etc1[pSelectors1[x]];
- selector0 = (selector0 << 1) | (b & 1); selector1 = (selector1 << 1) | (b >> 1);
-
- b = g_selector_index_to_etc1[pSelectors0[4 + x]];
- selector0 = (selector0 << 1) | (b & 1); selector1 = (selector1 << 1) | (b >> 1);
-
- b = g_selector_index_to_etc1[pSelectors0[x]];
- selector0 = (selector0 << 1) | (b & 1); selector1 = (selector1 << 1) | (b >> 1);
- }
- }
- else
- {
- // non-flipped:
- // { 0, 0 }, { 0, 1 }, { 0, 2 }, { 0, 3 },
- // { 1, 0 }, { 1, 1 }, { 1, 2 }, { 1, 3 }
- //
- // { 2, 0 }, { 2, 1 }, { 2, 2 }, { 2, 3 },
- // { 3, 0 }, { 3, 1 }, { 3, 2 }, { 3, 3 }
- for (int subblock = 1; subblock >= 0; --subblock)
- {
- const uint8* pSelectors = best_results[subblock].m_pSelectors + 4;
- for (uint i = 0; i < 2; i++)
- {
- uint b;
- b = g_selector_index_to_etc1[pSelectors[3]];
- selector0 = (selector0 << 1) | (b & 1); selector1 = (selector1 << 1) | (b >> 1);
-
- b = g_selector_index_to_etc1[pSelectors[2]];
- selector0 = (selector0 << 1) | (b & 1); selector1 = (selector1 << 1) | (b >> 1);
-
- b = g_selector_index_to_etc1[pSelectors[1]];
- selector0 = (selector0 << 1) | (b & 1); selector1 = (selector1 << 1) | (b >> 1);
-
- b = g_selector_index_to_etc1[pSelectors[0]];
- selector0 = (selector0 << 1) | (b & 1);selector1 = (selector1 << 1) | (b >> 1);
-
- pSelectors -= 4;
- }
- }
- }
-
- dst_block.m_bytes[4] = static_cast<uint8>(selector1 >> 8); dst_block.m_bytes[5] = static_cast<uint8>(selector1 & 0xFF);
- dst_block.m_bytes[6] = static_cast<uint8>(selector0 >> 8); dst_block.m_bytes[7] = static_cast<uint8>(selector0 & 0xFF);
-
- return static_cast<unsigned int>(best_error);
- }
-
-} // namespace rg_etc1
diff --git a/thirdparty/rg-etc1/rg_etc1.h b/thirdparty/rg-etc1/rg_etc1.h
deleted file mode 100644
index 9ce89a6cc6..0000000000
--- a/thirdparty/rg-etc1/rg_etc1.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// File: rg_etc1.h - Fast, high quality ETC1 block packer/unpacker - Rich Geldreich <richgel99@gmail.com>
-// Please see ZLIB license at the end of this file.
-#pragma once
-
-namespace rg_etc1
-{
- // Unpacks an 8-byte ETC1 compressed block to a block of 4x4 32bpp RGBA pixels.
- // Returns false if the block is invalid. Invalid blocks will still be unpacked with clamping.
- // This function is thread safe, and does not dynamically allocate any memory.
- // If preserve_alpha is true, the alpha channel of the destination pixels will not be overwritten. Otherwise, alpha will be set to 255.
- bool unpack_etc1_block(const void *pETC1_block, unsigned int* pDst_pixels_rgba, bool preserve_alpha = false);
-
- // Quality setting = the higher the quality, the slower.
- // To pack large textures, it is highly recommended to call pack_etc1_block() in parallel, on different blocks, from multiple threads (particularly when using cHighQuality).
- enum etc1_quality
- {
- cLowQuality,
- cMediumQuality,
- cHighQuality,
- };
-
- struct etc1_pack_params
- {
- etc1_quality m_quality;
- bool m_dithering;
-
- inline etc1_pack_params()
- {
- clear();
- }
-
- void clear()
- {
- m_quality = cHighQuality;
- m_dithering = false;
- }
- };
-
- // Important: pack_etc1_block_init() must be called before calling pack_etc1_block().
- void pack_etc1_block_init();
-
- // Packs a 4x4 block of 32bpp RGBA pixels to an 8-byte ETC1 block.
- // 32-bit RGBA pixels must always be arranged as (R,G,B,A) (R first, A last) in memory, independent of platform endianness. A should always be 255.
- // Returns squared error of result.
- // This function is thread safe, and does not dynamically allocate any memory.
- // pack_etc1_block() does not currently support "perceptual" colorspace metrics - it primarily optimizes for RGB RMSE.
- unsigned int pack_etc1_block(void* pETC1_block, const unsigned int* pSrc_pixels_rgba, etc1_pack_params& pack_params);
-
-} // namespace rg_etc1
-
-//------------------------------------------------------------------------------
-//
-// rg_etc1 uses the ZLIB license:
-// http://opensource.org/licenses/Zlib
-//
-// Copyright (c) 2012 Rich Geldreich
-//
-// This software is provided 'as-is', without any express or implied
-// warranty. In no event will the authors be held liable for any damages
-// arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it
-// freely, subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented; you must not
-// claim that you wrote the original software. If you use this software
-// in a product, an acknowledgment in the product documentation would be
-// appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such, and must not be
-// misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-//------------------------------------------------------------------------------
diff --git a/thirdparty/squish/squish.cpp b/thirdparty/squish/squish.cpp
index d3cbabbafd..1d22a64ad6 100644
--- a/thirdparty/squish/squish.cpp
+++ b/thirdparty/squish/squish.cpp
@@ -177,13 +177,17 @@ void CompressImage( u8 const* rgba, int width, int height, int pitch, void* bloc
// fix any bad flags
flags = FixFlags( flags );
- // initialise the block output
- u8* targetBlock = reinterpret_cast< u8* >( blocks );
- int bytesPerBlock = ( ( flags & ( kDxt1 | kBc4 ) ) != 0 ) ? 8 : 16;
-
// loop over blocks
+#ifdef SQUISH_USE_OPENMP
+# pragma omp parallel for
+#endif
for( int y = 0; y < height; y += 4 )
{
+ // initialise the block output
+ u8* targetBlock = reinterpret_cast< u8* >( blocks );
+ int bytesPerBlock = ( ( flags & ( kDxt1 | kBc4 ) ) != 0 ) ? 8 : 16;
+ targetBlock += ( (y / 4) * ( (width + 3) / 4) ) * bytesPerBlock;
+
for( int x = 0; x < width; x += 4 )
{
// build the 4x4 block of pixels
@@ -232,13 +236,17 @@ void DecompressImage( u8* rgba, int width, int height, int pitch, void const* bl
// fix any bad flags
flags = FixFlags( flags );
- // initialise the block input
- u8 const* sourceBlock = reinterpret_cast< u8 const* >( blocks );
- int bytesPerBlock = ( ( flags & ( kDxt1 | kBc4 ) ) != 0 ) ? 8 : 16;
-
// loop over blocks
+#ifdef SQUISH_USE_OPENMP
+# pragma omp parallel for
+#endif
for( int y = 0; y < height; y += 4 )
{
+ // initialise the block input
+ u8 const* sourceBlock = reinterpret_cast< u8 const* >( blocks );
+ int bytesPerBlock = ( ( flags & ( kDxt1 | kBc4 ) ) != 0 ) ? 8 : 16;
+ sourceBlock += ( (y / 4) * ( (width + 3) / 4) ) * bytesPerBlock;
+
for( int x = 0; x < width; x += 4 )
{
// decompress the block
diff --git a/thirdparty/squish/squish.h b/thirdparty/squish/squish.h
index 7c46e37ff1..14c9bb59fb 100644
--- a/thirdparty/squish/squish.h
+++ b/thirdparty/squish/squish.h
@@ -239,6 +239,15 @@ int GetStorageRequirements( int width, int height, int flags );
allows for pixels outside the image to take arbitrary values. The function
squish::GetStorageRequirements can be called to compute the amount of memory
to allocate for the compressed output.
+
+ Note on compression quality: When compressing textures with
+ libsquish it is recommended to apply a gamma-correction
+ beforehand. This will reduce the blockiness in dark areas. The
+ level of necessary gamma-correction is platform dependent. For
+ example, a gamma correction with gamma = 0.5 before compression
+ and gamma = 2.0 after decompression yields good results on the
+ Windows platform but for other platforms like MacOS X a different
+ gamma value may be more suitable.
*/
void CompressImage( u8 const* rgba, int width, int height, int pitch, void* blocks, int flags, float* metric = 0 );
void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags, float* metric = 0 );
diff --git a/thirdparty/tinyexr/tinyexr.cc b/thirdparty/tinyexr/tinyexr.cc
new file mode 100644
index 0000000000..969a6d505d
--- /dev/null
+++ b/thirdparty/tinyexr/tinyexr.cc
@@ -0,0 +1,2 @@
+#define TINYEXR_IMPLEMENTATION
+#include "tinyexr.h"
diff --git a/thirdparty/tinyexr/tinyexr.h b/thirdparty/tinyexr/tinyexr.h
new file mode 100644
index 0000000000..c82768be9a
--- /dev/null
+++ b/thirdparty/tinyexr/tinyexr.h
@@ -0,0 +1,12419 @@
+/*
+Copyright (c) 2014 - 2017, Syoyo Fujita
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Syoyo Fujita nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// TinyEXR contains some OpenEXR code, which is licensed under ------------
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
+// Digital Ltd. LLC
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Industrial Light & Magic nor the names of
+// its contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+///////////////////////////////////////////////////////////////////////////
+
+// End of OpenEXR license -------------------------------------------------
+
+#ifndef TINYEXR_H_
+#define TINYEXR_H_
+
+//
+//
+// Do this:
+// #define TINYEXR_IMPLEMENTATION
+// before you include this file in *one* C or C++ file to create the
+// implementation.
+//
+// // i.e. it should look like this:
+// #include ...
+// #include ...
+// #include ...
+// #define TINYEXR_IMPLEMENTATION
+// #include "tinyexr.h"
+//
+//
+
+#include <stddef.h> // for size_t
+#include <stdint.h> // guess stdint.h is available(C99)
+
+// -- GODOT change for old MinGW on Travis CI --
+#if defined(__MINGW32__)
+#include <_mingw.h> // for __MINGW64_VERSION_MAJOR
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Use embedded miniz or not to decode ZIP format pixel. Linking with zlib
+// required if this flas is 0.
+#ifndef TINYEXR_USE_MINIZ
+#define TINYEXR_USE_MINIZ (1)
+#endif
+
+// Disable PIZ comporession when applying cpplint.
+#ifndef TINYEXR_USE_PIZ
+#define TINYEXR_USE_PIZ (1)
+#endif
+
+#ifndef TINYEXR_USE_ZFP
+#define TINYEXR_USE_ZFP (0) // TinyEXR extension.
+// http://computation.llnl.gov/projects/floating-point-compression
+#endif
+
+#define TINYEXR_SUCCESS (0)
+#define TINYEXR_ERROR_INVALID_MAGIC_NUMBER (-1)
+#define TINYEXR_ERROR_INVALID_EXR_VERSION (-2)
+#define TINYEXR_ERROR_INVALID_ARGUMENT (-3)
+#define TINYEXR_ERROR_INVALID_DATA (-4)
+#define TINYEXR_ERROR_INVALID_FILE (-5)
+#define TINYEXR_ERROR_INVALID_PARAMETER (-5)
+#define TINYEXR_ERROR_CANT_OPEN_FILE (-6)
+#define TINYEXR_ERROR_UNSUPPORTED_FORMAT (-7)
+#define TINYEXR_ERROR_INVALID_HEADER (-8)
+
+// @note { OpenEXR file format: http://www.openexr.com/openexrfilelayout.pdf }
+
+// pixel type: possible values are: UINT = 0 HALF = 1 FLOAT = 2
+#define TINYEXR_PIXELTYPE_UINT (0)
+#define TINYEXR_PIXELTYPE_HALF (1)
+#define TINYEXR_PIXELTYPE_FLOAT (2)
+
+#define TINYEXR_MAX_ATTRIBUTES (128)
+
+#define TINYEXR_COMPRESSIONTYPE_NONE (0)
+#define TINYEXR_COMPRESSIONTYPE_RLE (1)
+#define TINYEXR_COMPRESSIONTYPE_ZIPS (2)
+#define TINYEXR_COMPRESSIONTYPE_ZIP (3)
+#define TINYEXR_COMPRESSIONTYPE_PIZ (4)
+#define TINYEXR_COMPRESSIONTYPE_ZFP (128) // TinyEXR extension
+
+#define TINYEXR_ZFP_COMPRESSIONTYPE_RATE (0)
+#define TINYEXR_ZFP_COMPRESSIONTYPE_PRECISION (1)
+#define TINYEXR_ZFP_COMPRESSIONTYPE_ACCURACY (2)
+
+#define TINYEXR_TILE_ONE_LEVEL (0)
+#define TINYEXR_TILE_MIPMAP_LEVELS (1)
+#define TINYEXR_TILE_RIPMAP_LEVELS (2)
+
+#define TINYEXR_TILE_ROUND_DOWN (0)
+#define TINYEXR_TILE_ROUND_UP (1)
+
+typedef struct _EXRVersion {
+ int version; // this must be 2
+ int tiled; // tile format image
+ int long_name; // long name attribute
+ int non_image; // deep image(EXR 2.0)
+ int multipart; // multi-part(EXR 2.0)
+} EXRVersion;
+
+typedef struct _EXRAttribute {
+ char name[256]; // name and type are up to 255 chars long.
+ char type[256];
+ unsigned char *value; // uint8_t*
+ int size;
+ int pad0;
+} EXRAttribute;
+
+typedef struct _EXRChannelInfo {
+ char name[256]; // less than 255 bytes long
+ int pixel_type;
+ int x_sampling;
+ int y_sampling;
+ unsigned char p_linear;
+ unsigned char pad[3];
+} EXRChannelInfo;
+
+typedef struct _EXRTile {
+ int offset_x;
+ int offset_y;
+ int level_x;
+ int level_y;
+
+ int width; // actual width in a tile.
+ int height; // actual height int a tile.
+
+ unsigned char **images; // image[channels][pixels]
+} EXRTile;
+
+typedef struct _EXRHeader {
+ float pixel_aspect_ratio;
+ int line_order;
+ int data_window[4];
+ int display_window[4];
+ float screen_window_center[2];
+ float screen_window_width;
+
+ int chunk_count;
+
+ // Properties for tiled format(`tiledesc`).
+ int tiled;
+ int tile_size_x;
+ int tile_size_y;
+ int tile_level_mode;
+ int tile_rounding_mode;
+
+ int long_name;
+ int non_image;
+ int multipart;
+ unsigned int header_len;
+
+ // Custom attributes(exludes required attributes(e.g. `channels`,
+ // `compression`, etc)
+ int num_custom_attributes;
+ EXRAttribute custom_attributes[TINYEXR_MAX_ATTRIBUTES];
+
+ EXRChannelInfo *channels; // [num_channels]
+
+ int *pixel_types; // Loaded pixel type(TINYEXR_PIXELTYPE_*) of `images` for
+ // each channel. This is overwritten with `requested_pixel_types` when
+ // loading.
+ int num_channels;
+
+ int compression_type; // compression type(TINYEXR_COMPRESSIONTYPE_*)
+ int *requested_pixel_types; // Filled initially by
+ // ParseEXRHeaderFrom(Meomory|File), then users
+ // can edit it(only valid for HALF pixel type
+ // channel)
+
+} EXRHeader;
+
+typedef struct _EXRMultiPartHeader {
+ int num_headers;
+ EXRHeader *headers;
+
+} EXRMultiPartHeader;
+
+typedef struct _EXRImage {
+ EXRTile *tiles; // Tiled pixel data. The application must reconstruct image
+ // from tiles manually. NULL if scanline format.
+ unsigned char **images; // image[channels][pixels]. NULL if tiled format.
+
+ int width;
+ int height;
+ int num_channels;
+
+ // Properties for tile format.
+ int num_tiles;
+
+} EXRImage;
+
+typedef struct _EXRMultiPartImage {
+ int num_images;
+ EXRImage *images;
+
+} EXRMultiPartImage;
+
+typedef struct _DeepImage {
+ const char **channel_names;
+ float ***image; // image[channels][scanlines][samples]
+ int **offset_table; // offset_table[scanline][offsets]
+ int num_channels;
+ int width;
+ int height;
+ int pad0;
+} DeepImage;
+
+// @deprecated { to be removed. }
+// Loads single-frame OpenEXR image. Assume EXR image contains RGB(A) channels.
+// Application must free image data as returned by `out_rgba`
+// Result image format is: float x RGBA x width x hight
+// Returns negative value and may set error string in `err` when there's an
+// error
+extern int LoadEXR(float **out_rgba, int *width, int *height,
+ const char *filename, const char **err);
+
+// @deprecated { to be removed. }
+// Saves single-frame OpenEXR image. Assume EXR image contains RGB(A) channels.
+// components must be 3(RGB) or 4(RGBA).
+// Result image format is: float x RGB(A) x width x hight
+extern int SaveEXR(const float *data, int width, int height, int components,
+ const char *filename);
+
+// Initialize EXRHeader struct
+extern void InitEXRHeader(EXRHeader *exr_header);
+
+// Initialize EXRImage struct
+extern void InitEXRImage(EXRImage *exr_image);
+
+// Free's internal data of EXRHeader struct
+extern int FreeEXRHeader(EXRHeader *exr_header);
+
+// Free's internal data of EXRImage struct
+extern int FreeEXRImage(EXRImage *exr_image);
+
+// Parse EXR version header of a file.
+extern int ParseEXRVersionFromFile(EXRVersion *version, const char *filename);
+
+// Parse EXR version header from memory-mapped EXR data.
+extern int ParseEXRVersionFromMemory(EXRVersion *version,
+ const unsigned char *memory, size_t size);
+
+// Parse single-part OpenEXR header from a file and initialize `EXRHeader`.
+extern int ParseEXRHeaderFromFile(EXRHeader *header, const EXRVersion *version,
+ const char *filename, const char **err);
+
+// Parse single-part OpenEXR header from a memory and initialize `EXRHeader`.
+extern int ParseEXRHeaderFromMemory(EXRHeader *header,
+ const EXRVersion *version,
+ const unsigned char *memory, size_t size,
+ const char **err);
+
+// Parse multi-part OpenEXR headers from a file and initialize `EXRHeader*`
+// array.
+extern int ParseEXRMultipartHeaderFromFile(EXRHeader ***headers,
+ int *num_headers,
+ const EXRVersion *version,
+ const char *filename,
+ const char **err);
+
+// Parse multi-part OpenEXR headers from a memory and initialize `EXRHeader*`
+// array
+extern int ParseEXRMultipartHeaderFromMemory(EXRHeader ***headers,
+ int *num_headers,
+ const EXRVersion *version,
+ const unsigned char *memory,
+ size_t size, const char **err);
+
+// Loads single-part OpenEXR image from a file.
+// Application must setup `ParseEXRHeaderFromFile` before calling this function.
+// Application can free EXRImage using `FreeEXRImage`
+// Returns negative value and may set error string in `err` when there's an
+// error
+extern int LoadEXRImageFromFile(EXRImage *image, const EXRHeader *header,
+ const char *filename, const char **err);
+
+// Loads single-part OpenEXR image from a memory.
+// Application must setup `EXRHeader` with
+// `ParseEXRHeaderFromMemory` before calling this function.
+// Application can free EXRImage using `FreeEXRImage`
+// Returns negative value and may set error string in `err` when there's an
+// error
+extern int LoadEXRImageFromMemory(EXRImage *image, const EXRHeader *header,
+ const unsigned char *memory,
+ const size_t size, const char **err);
+
+// Loads multi-part OpenEXR image from a file.
+// Application must setup `ParseEXRMultipartHeaderFromFile` before calling this
+// function.
+// Application can free EXRImage using `FreeEXRImage`
+// Returns negative value and may set error string in `err` when there's an
+// error
+extern int LoadEXRMultipartImageFromFile(EXRImage *images,
+ const EXRHeader **headers,
+ unsigned int num_parts,
+ const char *filename,
+ const char **err);
+
+// Loads multi-part OpenEXR image from a memory.
+// Application must setup `EXRHeader*` array with
+// `ParseEXRMultipartHeaderFromMemory` before calling this function.
+// Application can free EXRImage using `FreeEXRImage`
+// Returns negative value and may set error string in `err` when there's an
+// error
+extern int LoadEXRMultipartImageFromMemory(EXRImage *images,
+ const EXRHeader **headers,
+ unsigned int num_parts,
+ const unsigned char *memory,
+ const size_t size, const char **err);
+
+// Saves multi-channel, single-frame OpenEXR image to a file.
+// Returns negative value and may set error string in `err` when there's an
+// error
+extern int SaveEXRImageToFile(const EXRImage *image,
+ const EXRHeader *exr_header, const char *filename,
+ const char **err);
+
+// Saves multi-channel, single-frame OpenEXR image to a memory.
+// Image is compressed using EXRImage.compression value.
+// Return the number of bytes if succes.
+// Returns negative value and may set error string in `err` when there's an
+// error
+extern size_t SaveEXRImageToMemory(const EXRImage *image,
+ const EXRHeader *exr_header,
+ unsigned char **memory, const char **err);
+
+// Loads single-frame OpenEXR deep image.
+// Application must free memory of variables in DeepImage(image, offset_table)
+// Returns negative value and may set error string in `err` when there's an
+// error
+extern int LoadDeepEXR(DeepImage *out_image, const char *filename,
+ const char **err);
+
+// NOT YET IMPLEMENTED:
+// Saves single-frame OpenEXR deep image.
+// Returns negative value and may set error string in `err` when there's an
+// error
+// extern int SaveDeepEXR(const DeepImage *in_image, const char *filename,
+// const char **err);
+
+// NOT YET IMPLEMENTED:
+// Loads multi-part OpenEXR deep image.
+// Application must free memory of variables in DeepImage(image, offset_table)
+// extern int LoadMultiPartDeepEXR(DeepImage **out_image, int num_parts, const
+// char *filename,
+// const char **err);
+
+// For emscripten.
+// Loads single-frame OpenEXR image from memory. Assume EXR image contains
+// RGB(A) channels.
+// `out_rgba` must have enough memory(at least sizeof(float) x 4(RGBA) x width x
+// hight)
+// Returns negative value and may set error string in `err` when there's an
+// error
+extern int LoadEXRFromMemory(float *out_rgba, const unsigned char *memory,
+ size_t size, const char **err);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // TINYEXR_H_
+
+#ifdef TINYEXR_IMPLEMENTATION
+#ifndef TINYEXR_IMPLEMENTATION_DEIFNED
+#define TINYEXR_IMPLEMENTATION_DEIFNED
+
+#include <algorithm>
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <sstream>
+
+#include <string>
+#include <vector>
+
+#if __cplusplus > 199711L
+// C++11
+#include <cstdint>
+#endif // __cplusplus > 199711L
+
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
+#if TINYEXR_USE_MINIZ
+#else
+#include "zlib.h"
+#endif
+
+#if TINYEXR_USE_ZFP
+#include "zfp.h"
+#endif
+
+namespace tinyexr {
+
+#if __cplusplus > 199711L
+// C++11
+typedef uint64_t tinyexr_uint64;
+typedef int64_t tinyexr_int64;
+#else
+// Although `long long` is not a standard type pre C++11, assume it is defined
+// as a compiler's extension.
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++11-long-long"
+#endif
+typedef unsigned long long tinyexr_uint64;
+typedef long long tinyexr_int64;
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+#endif
+
+#if TINYEXR_USE_MINIZ
+
+namespace miniz {
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++11-long-long"
+#pragma clang diagnostic ignored "-Wold-style-cast"
+#pragma clang diagnostic ignored "-Wpadded"
+#pragma clang diagnostic ignored "-Wsign-conversion"
+#pragma clang diagnostic ignored "-Wc++11-extensions"
+#pragma clang diagnostic ignored "-Wconversion"
+#ifdef __APPLE__
+#if __clang_major__ >= 8 && __clang__minor__ > 1
+#pragma clang diagnostic ignored "-Wcomma"
+#endif
+#endif
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
+
+/* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP
+ reading/writing/appending, PNG writing
+ See "unlicense" statement at the end of this file.
+ Rich Geldreich <richgel99@gmail.com>, last updated Oct. 13, 2013
+ Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951:
+ http://www.ietf.org/rfc/rfc1951.txt
+
+ Most API's defined in miniz.c are optional. For example, to disable the
+ archive related functions just define
+ MINIZ_NO_ARCHIVE_APIS, or to get rid of all stdio usage define MINIZ_NO_STDIO
+ (see the list below for more macros).
+
+ * Change History
+ 10/13/13 v1.15 r4 - Interim bugfix release while I work on the next major
+ release with Zip64 support (almost there!):
+ - Critical fix for the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY bug
+ (thanks kahmyong.moon@hp.com) which could cause locate files to not find
+ files. This bug
+ would only have occured in earlier versions if you explicitly used this
+ flag, OR if you used mz_zip_extract_archive_file_to_heap() or
+ mz_zip_add_mem_to_archive_file_in_place()
+ (which used this flag). If you can't switch to v1.15 but want to fix
+ this bug, just remove the uses of this flag from both helper funcs (and of
+ course don't use the flag).
+ - Bugfix in mz_zip_reader_extract_to_mem_no_alloc() from kymoon when
+ pUser_read_buf is not NULL and compressed size is > uncompressed size
+ - Fixing mz_zip_reader_extract_*() funcs so they don't try to extract
+ compressed data from directory entries, to account for weird zipfiles which
+ contain zero-size compressed data on dir entries.
+ Hopefully this fix won't cause any issues on weird zip archives,
+ because it assumes the low 16-bits of zip external attributes are DOS
+ attributes (which I believe they always are in practice).
+ - Fixing mz_zip_reader_is_file_a_directory() so it doesn't check the
+ internal attributes, just the filename and external attributes
+ - mz_zip_reader_init_file() - missing MZ_FCLOSE() call if the seek failed
+ - Added cmake support for Linux builds which builds all the examples,
+ tested with clang v3.3 and gcc v4.6.
+ - Clang fix for tdefl_write_image_to_png_file_in_memory() from toffaletti
+ - Merged MZ_FORCEINLINE fix from hdeanclark
+ - Fix <time.h> include before config #ifdef, thanks emil.brink
+ - Added tdefl_write_image_to_png_file_in_memory_ex(): supports Y flipping
+ (super useful for OpenGL apps), and explicit control over the compression
+ level (so you can
+ set it to 1 for real-time compression).
+ - Merged in some compiler fixes from paulharris's github repro.
+ - Retested this build under Windows (VS 2010, including static analysis),
+ tcc 0.9.26, gcc v4.6 and clang v3.3.
+ - Added example6.c, which dumps an image of the mandelbrot set to a PNG
+ file.
+ - Modified example2 to help test the
+ MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY flag more.
+ - In r3: Bugfix to mz_zip_writer_add_file() found during merge: Fix
+ possible src file fclose() leak if alignment bytes+local header file write
+ faiiled
+ - In r4: Minor bugfix to mz_zip_writer_add_from_zip_reader():
+ Was pushing the wrong central dir header offset, appears harmless in this
+ release, but it became a problem in the zip64 branch
+ 5/20/12 v1.14 - MinGW32/64 GCC 4.6.1 compiler fixes: added MZ_FORCEINLINE,
+ #include <time.h> (thanks fermtect).
+ 5/19/12 v1.13 - From jason@cornsyrup.org and kelwert@mtu.edu - Fix
+ mz_crc32() so it doesn't compute the wrong CRC-32's when mz_ulong is 64-bit.
+ - Temporarily/locally slammed in "typedef unsigned long mz_ulong" and
+ re-ran a randomized regression test on ~500k files.
+ - Eliminated a bunch of warnings when compiling with GCC 32-bit/64.
+ - Ran all examples, miniz.c, and tinfl.c through MSVC 2008's /analyze
+ (static analysis) option and fixed all warnings (except for the silly
+ "Use of the comma-operator in a tested expression.." analysis warning,
+ which I purposely use to work around a MSVC compiler warning).
+ - Created 32-bit and 64-bit Codeblocks projects/workspace. Built and
+ tested Linux executables. The codeblocks workspace is compatible with
+ Linux+Win32/x64.
+ - Added miniz_tester solution/project, which is a useful little app
+ derived from LZHAM's tester app that I use as part of the regression test.
+ - Ran miniz.c and tinfl.c through another series of regression testing on
+ ~500,000 files and archives.
+ - Modified example5.c so it purposely disables a bunch of high-level
+ functionality (MINIZ_NO_STDIO, etc.). (Thanks to corysama for the
+ MINIZ_NO_STDIO bug report.)
+ - Fix ftell() usage in examples so they exit with an error on files which
+ are too large (a limitation of the examples, not miniz itself).
+ 4/12/12 v1.12 - More comments, added low-level example5.c, fixed a couple
+ minor level_and_flags issues in the archive API's.
+ level_and_flags can now be set to MZ_DEFAULT_COMPRESSION. Thanks to Bruce
+ Dawson <bruced@valvesoftware.com> for the feedback/bug report.
+ 5/28/11 v1.11 - Added statement from unlicense.org
+ 5/27/11 v1.10 - Substantial compressor optimizations:
+ - Level 1 is now ~4x faster than before. The L1 compressor's throughput
+ now varies between 70-110MB/sec. on a
+ - Core i7 (actual throughput varies depending on the type of data, and x64
+ vs. x86).
+ - Improved baseline L2-L9 compression perf. Also, greatly improved
+ compression perf. issues on some file types.
+ - Refactored the compression code for better readability and
+ maintainability.
+ - Added level 10 compression level (L10 has slightly better ratio than
+ level 9, but could have a potentially large
+ drop in throughput on some files).
+ 5/15/11 v1.09 - Initial stable release.
+
+ * Low-level Deflate/Inflate implementation notes:
+
+ Compression: Use the "tdefl" API's. The compressor supports raw, static,
+ and dynamic blocks, lazy or
+ greedy parsing, match length filtering, RLE-only, and Huffman-only streams.
+ It performs and compresses
+ approximately as well as zlib.
+
+ Decompression: Use the "tinfl" API's. The entire decompressor is
+ implemented as a single function
+ coroutine: see tinfl_decompress(). It supports decompression into a 32KB
+ (or larger power of 2) wrapping buffer, or into a memory
+ block large enough to hold the entire file.
+
+ The low-level tdefl/tinfl API's do not make any use of dynamic memory
+ allocation.
+
+ * zlib-style API notes:
+
+ miniz.c implements a fairly large subset of zlib. There's enough
+ functionality present for it to be a drop-in
+ zlib replacement in many apps:
+ The z_stream struct, optional memory allocation callbacks
+ deflateInit/deflateInit2/deflate/deflateReset/deflateEnd/deflateBound
+ inflateInit/inflateInit2/inflate/inflateEnd
+ compress, compress2, compressBound, uncompress
+ CRC-32, Adler-32 - Using modern, minimal code size, CPU cache friendly
+ routines.
+ Supports raw deflate streams or standard zlib streams with adler-32
+ checking.
+
+ Limitations:
+ The callback API's are not implemented yet. No support for gzip headers or
+ zlib static dictionaries.
+ I've tried to closely emulate zlib's various flavors of stream flushing
+ and return status codes, but
+ there are no guarantees that miniz.c pulls this off perfectly.
+
+ * PNG writing: See the tdefl_write_image_to_png_file_in_memory() function,
+ originally written by
+ Alex Evans. Supports 1-4 bytes/pixel images.
+
+ * ZIP archive API notes:
+
+ The ZIP archive API's where designed with simplicity and efficiency in
+ mind, with just enough abstraction to
+ get the job done with minimal fuss. There are simple API's to retrieve file
+ information, read files from
+ existing archives, create new archives, append new files to existing
+ archives, or clone archive data from
+ one archive to another. It supports archives located in memory or the heap,
+ on disk (using stdio.h),
+ or you can specify custom file read/write callbacks.
+
+ - Archive reading: Just call this function to read a single file from a
+ disk archive:
+
+ void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const
+ char *pArchive_name,
+ size_t *pSize, mz_uint zip_flags);
+
+ For more complex cases, use the "mz_zip_reader" functions. Upon opening an
+ archive, the entire central
+ directory is located and read as-is into memory, and subsequent file access
+ only occurs when reading individual files.
+
+ - Archives file scanning: The simple way is to use this function to scan a
+ loaded archive for a specific file:
+
+ int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName,
+ const char *pComment, mz_uint flags);
+
+ The locate operation can optionally check file comments too, which (as one
+ example) can be used to identify
+ multiple versions of the same file in an archive. This function uses a
+ simple linear search through the central
+ directory, so it's not very fast.
+
+ Alternately, you can iterate through all the files in an archive (using
+ mz_zip_reader_get_num_files()) and
+ retrieve detailed info on each file by calling mz_zip_reader_file_stat().
+
+ - Archive creation: Use the "mz_zip_writer" functions. The ZIP writer
+ immediately writes compressed file data
+ to disk and builds an exact image of the central directory in memory. The
+ central directory image is written
+ all at once at the end of the archive file when the archive is finalized.
+
+ The archive writer can optionally align each file's local header and file
+ data to any power of 2 alignment,
+ which can be useful when the archive will be read from optical media. Also,
+ the writer supports placing
+ arbitrary data blobs at the very beginning of ZIP archives. Archives
+ written using either feature are still
+ readable by any ZIP tool.
+
+ - Archive appending: The simple way to add a single file to an archive is
+ to call this function:
+
+ mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename,
+ const char *pArchive_name,
+ const void *pBuf, size_t buf_size, const void *pComment, mz_uint16
+ comment_size, mz_uint level_and_flags);
+
+ The archive will be created if it doesn't already exist, otherwise it'll be
+ appended to.
+ Note the appending is done in-place and is not an atomic operation, so if
+ something goes wrong
+ during the operation it's possible the archive could be left without a
+ central directory (although the local
+ file headers and file data will be fine, so the archive will be
+ recoverable).
+
+ For more complex archive modification scenarios:
+ 1. The safest way is to use a mz_zip_reader to read the existing archive,
+ cloning only those bits you want to
+ preserve into a new archive using using the
+ mz_zip_writer_add_from_zip_reader() function (which compiles the
+ compressed file data as-is). When you're done, delete the old archive and
+ rename the newly written archive, and
+ you're done. This is safe but requires a bunch of temporary disk space or
+ heap memory.
+
+ 2. Or, you can convert an mz_zip_reader in-place to an mz_zip_writer using
+ mz_zip_writer_init_from_reader(),
+ append new files as needed, then finalize the archive which will write an
+ updated central directory to the
+ original archive. (This is basically what
+ mz_zip_add_mem_to_archive_file_in_place() does.) There's a
+ possibility that the archive's central directory could be lost with this
+ method if anything goes wrong, though.
+
+ - ZIP archive support limitations:
+ No zip64 or spanning support. Extraction functions can only handle
+ unencrypted, stored or deflated files.
+ Requires streams capable of seeking.
+
+ * This is a header file library, like stb_image.c. To get only a header file,
+ either cut and paste the
+ below header, or create miniz.h, #define MINIZ_HEADER_FILE_ONLY, and then
+ include miniz.c from it.
+
+ * Important: For best perf. be sure to customize the below macros for your
+ target platform:
+ #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
+ #define MINIZ_LITTLE_ENDIAN 1
+ #define MINIZ_HAS_64BIT_REGISTERS 1
+
+ * On platforms using glibc, Be sure to "#define _LARGEFILE64_SOURCE 1" before
+ including miniz.c to ensure miniz
+ uses the 64-bit variants: fopen64(), stat64(), etc. Otherwise you won't be
+ able to process large files
+ (i.e. 32-bit stat() fails for me on files > 0x7FFFFFFF bytes).
+*/
+
+#ifndef MINIZ_HEADER_INCLUDED
+#define MINIZ_HEADER_INCLUDED
+
+//#include <stdlib.h>
+
+// Defines to completely disable specific portions of miniz.c:
+// If all macros here are defined the only functionality remaining will be
+// CRC-32, adler-32, tinfl, and tdefl.
+
+// Define MINIZ_NO_STDIO to disable all usage and any functions which rely on
+// stdio for file I/O.
+//#define MINIZ_NO_STDIO
+
+// If MINIZ_NO_TIME is specified then the ZIP archive functions will not be able
+// to get the current time, or
+// get/set file times, and the C run-time funcs that get/set times won't be
+// called.
+// The current downside is the times written to your archives will be from 1979.
+#define MINIZ_NO_TIME
+
+// Define MINIZ_NO_ARCHIVE_APIS to disable all ZIP archive API's.
+#define MINIZ_NO_ARCHIVE_APIS
+
+// Define MINIZ_NO_ARCHIVE_APIS to disable all writing related ZIP archive
+// API's.
+//#define MINIZ_NO_ARCHIVE_WRITING_APIS
+
+// Define MINIZ_NO_ZLIB_APIS to remove all ZLIB-style compression/decompression
+// API's.
+//#define MINIZ_NO_ZLIB_APIS
+
+// Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent
+// conflicts against stock zlib.
+//#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES
+
+// Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc.
+// Note if MINIZ_NO_MALLOC is defined then the user must always provide custom
+// user alloc/free/realloc
+// callbacks to the zlib and archive API's, and a few stand-alone helper API's
+// which don't provide custom user
+// functions (such as tdefl_compress_mem_to_heap() and
+// tinfl_decompress_mem_to_heap()) won't work.
+//#define MINIZ_NO_MALLOC
+
+#if defined(__TINYC__) && (defined(__linux) || defined(__linux__))
+// TODO: Work around "error: include file 'sys\utime.h' when compiling with tcc
+// on Linux
+#define MINIZ_NO_TIME
+#endif
+
+#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_ARCHIVE_APIS)
+//#include <time.h>
+#endif
+
+#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || \
+ defined(__i386) || defined(__i486__) || defined(__i486) || \
+ defined(i386) || defined(__ia64__) || defined(__x86_64__)
+// MINIZ_X86_OR_X64_CPU is only used to help set the below macros.
+#define MINIZ_X86_OR_X64_CPU 1
+#endif
+
+#if defined(__sparcv9)
+// Big endian
+#else
+#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || MINIZ_X86_OR_X64_CPU
+// Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian.
+#define MINIZ_LITTLE_ENDIAN 1
+#endif
+#endif
+
+#if MINIZ_X86_OR_X64_CPU
+// Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient
+// integer loads and stores from unaligned addresses.
+//#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
+#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES \
+ 0 // disable to suppress compiler warnings
+#endif
+
+#if defined(_M_X64) || defined(_WIN64) || defined(__MINGW64__) || \
+ defined(_LP64) || defined(__LP64__) || defined(__ia64__) || \
+ defined(__x86_64__)
+// Set MINIZ_HAS_64BIT_REGISTERS to 1 if operations on 64-bit integers are
+// reasonably fast (and don't involve compiler generated calls to helper
+// functions).
+#define MINIZ_HAS_64BIT_REGISTERS 1
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// ------------------- zlib-style API Definitions.
+
+// For more compatibility with zlib, miniz.c uses unsigned long for some
+// parameters/struct members. Beware: mz_ulong can be either 32 or 64-bits!
+typedef unsigned long mz_ulong;
+
+// mz_free() internally uses the MZ_FREE() macro (which by default calls free()
+// unless you've modified the MZ_MALLOC macro) to release a block allocated from
+// the heap.
+void mz_free(void *p);
+
+#define MZ_ADLER32_INIT (1)
+// mz_adler32() returns the initial adler-32 value to use when called with
+// ptr==NULL.
+mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len);
+
+#define MZ_CRC32_INIT (0)
+// mz_crc32() returns the initial CRC-32 value to use when called with
+// ptr==NULL.
+mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len);
+
+// Compression strategies.
+enum {
+ MZ_DEFAULT_STRATEGY = 0,
+ MZ_FILTERED = 1,
+ MZ_HUFFMAN_ONLY = 2,
+ MZ_RLE = 3,
+ MZ_FIXED = 4
+};
+
+// Method
+#define MZ_DEFLATED 8
+
+#ifndef MINIZ_NO_ZLIB_APIS
+
+// Heap allocation callbacks.
+// Note that mz_alloc_func parameter types purpsosely differ from zlib's:
+// items/size is size_t, not unsigned long.
+typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size);
+typedef void (*mz_free_func)(void *opaque, void *address);
+typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items,
+ size_t size);
+
+#define MZ_VERSION "9.1.15"
+#define MZ_VERNUM 0x91F0
+#define MZ_VER_MAJOR 9
+#define MZ_VER_MINOR 1
+#define MZ_VER_REVISION 15
+#define MZ_VER_SUBREVISION 0
+
+// Flush values. For typical usage you only need MZ_NO_FLUSH and MZ_FINISH. The
+// other values are for advanced use (refer to the zlib docs).
+enum {
+ MZ_NO_FLUSH = 0,
+ MZ_PARTIAL_FLUSH = 1,
+ MZ_SYNC_FLUSH = 2,
+ MZ_FULL_FLUSH = 3,
+ MZ_FINISH = 4,
+ MZ_BLOCK = 5
+};
+
+// Return status codes. MZ_PARAM_ERROR is non-standard.
+enum {
+ MZ_OK = 0,
+ MZ_STREAM_END = 1,
+ MZ_NEED_DICT = 2,
+ MZ_ERRNO = -1,
+ MZ_STREAM_ERROR = -2,
+ MZ_DATA_ERROR = -3,
+ MZ_MEM_ERROR = -4,
+ MZ_BUF_ERROR = -5,
+ MZ_VERSION_ERROR = -6,
+ MZ_PARAM_ERROR = -10000
+};
+
+// Compression levels: 0-9 are the standard zlib-style levels, 10 is best
+// possible compression (not zlib compatible, and may be very slow),
+// MZ_DEFAULT_COMPRESSION=MZ_DEFAULT_LEVEL.
+enum {
+ MZ_NO_COMPRESSION = 0,
+ MZ_BEST_SPEED = 1,
+ MZ_BEST_COMPRESSION = 9,
+ MZ_UBER_COMPRESSION = 10,
+ MZ_DEFAULT_LEVEL = 6,
+ MZ_DEFAULT_COMPRESSION = -1
+};
+
+// Window bits
+#define MZ_DEFAULT_WINDOW_BITS 15
+
+struct mz_internal_state;
+
+// Compression/decompression stream struct.
+typedef struct mz_stream_s {
+ const unsigned char *next_in; // pointer to next byte to read
+ unsigned int avail_in; // number of bytes available at next_in
+ mz_ulong total_in; // total number of bytes consumed so far
+
+ unsigned char *next_out; // pointer to next byte to write
+ unsigned int avail_out; // number of bytes that can be written to next_out
+ mz_ulong total_out; // total number of bytes produced so far
+
+ char *msg; // error msg (unused)
+ struct mz_internal_state *state; // internal state, allocated by zalloc/zfree
+
+ mz_alloc_func
+ zalloc; // optional heap allocation function (defaults to malloc)
+ mz_free_func zfree; // optional heap free function (defaults to free)
+ void *opaque; // heap alloc function user pointer
+
+ int data_type; // data_type (unused)
+ mz_ulong adler; // adler32 of the source or uncompressed data
+ mz_ulong reserved; // not used
+} mz_stream;
+
+typedef mz_stream *mz_streamp;
+
+// Returns the version string of miniz.c.
+const char *mz_version(void);
+
+// mz_deflateInit() initializes a compressor with default options:
+// Parameters:
+// pStream must point to an initialized mz_stream struct.
+// level must be between [MZ_NO_COMPRESSION, MZ_BEST_COMPRESSION].
+// level 1 enables a specially optimized compression function that's been
+// optimized purely for performance, not ratio.
+// (This special func. is currently only enabled when
+// MINIZ_USE_UNALIGNED_LOADS_AND_STORES and MINIZ_LITTLE_ENDIAN are defined.)
+// Return values:
+// MZ_OK on success.
+// MZ_STREAM_ERROR if the stream is bogus.
+// MZ_PARAM_ERROR if the input parameters are bogus.
+// MZ_MEM_ERROR on out of memory.
+int mz_deflateInit(mz_streamp pStream, int level);
+
+// mz_deflateInit2() is like mz_deflate(), except with more control:
+// Additional parameters:
+// method must be MZ_DEFLATED
+// window_bits must be MZ_DEFAULT_WINDOW_BITS (to wrap the deflate stream with
+// zlib header/adler-32 footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate/no
+// header or footer)
+// mem_level must be between [1, 9] (it's checked but ignored by miniz.c)
+int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits,
+ int mem_level, int strategy);
+
+// Quickly resets a compressor without having to reallocate anything. Same as
+// calling mz_deflateEnd() followed by mz_deflateInit()/mz_deflateInit2().
+int mz_deflateReset(mz_streamp pStream);
+
+// mz_deflate() compresses the input to output, consuming as much of the input
+// and producing as much output as possible.
+// Parameters:
+// pStream is the stream to read from and write to. You must initialize/update
+// the next_in, avail_in, next_out, and avail_out members.
+// flush may be MZ_NO_FLUSH, MZ_PARTIAL_FLUSH/MZ_SYNC_FLUSH, MZ_FULL_FLUSH, or
+// MZ_FINISH.
+// Return values:
+// MZ_OK on success (when flushing, or if more input is needed but not
+// available, and/or there's more output to be written but the output buffer
+// is full).
+// MZ_STREAM_END if all input has been consumed and all output bytes have been
+// written. Don't call mz_deflate() on the stream anymore.
+// MZ_STREAM_ERROR if the stream is bogus.
+// MZ_PARAM_ERROR if one of the parameters is invalid.
+// MZ_BUF_ERROR if no forward progress is possible because the input and/or
+// output buffers are empty. (Fill up the input buffer or free up some output
+// space and try again.)
+int mz_deflate(mz_streamp pStream, int flush);
+
+// mz_deflateEnd() deinitializes a compressor:
+// Return values:
+// MZ_OK on success.
+// MZ_STREAM_ERROR if the stream is bogus.
+int mz_deflateEnd(mz_streamp pStream);
+
+// mz_deflateBound() returns a (very) conservative upper bound on the amount of
+// data that could be generated by deflate(), assuming flush is set to only
+// MZ_NO_FLUSH or MZ_FINISH.
+mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len);
+
+// Single-call compression functions mz_compress() and mz_compress2():
+// Returns MZ_OK on success, or one of the error codes from mz_deflate() on
+// failure.
+int mz_compress(unsigned char *pDest, mz_ulong *pDest_len,
+ const unsigned char *pSource, mz_ulong source_len);
+int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len,
+ const unsigned char *pSource, mz_ulong source_len, int level);
+
+// mz_compressBound() returns a (very) conservative upper bound on the amount of
+// data that could be generated by calling mz_compress().
+mz_ulong mz_compressBound(mz_ulong source_len);
+
+// Initializes a decompressor.
+int mz_inflateInit(mz_streamp pStream);
+
+// mz_inflateInit2() is like mz_inflateInit() with an additional option that
+// controls the window size and whether or not the stream has been wrapped with
+// a zlib header/footer:
+// window_bits must be MZ_DEFAULT_WINDOW_BITS (to parse zlib header/footer) or
+// -MZ_DEFAULT_WINDOW_BITS (raw deflate).
+int mz_inflateInit2(mz_streamp pStream, int window_bits);
+
+// Decompresses the input stream to the output, consuming only as much of the
+// input as needed, and writing as much to the output as possible.
+// Parameters:
+// pStream is the stream to read from and write to. You must initialize/update
+// the next_in, avail_in, next_out, and avail_out members.
+// flush may be MZ_NO_FLUSH, MZ_SYNC_FLUSH, or MZ_FINISH.
+// On the first call, if flush is MZ_FINISH it's assumed the input and output
+// buffers are both sized large enough to decompress the entire stream in a
+// single call (this is slightly faster).
+// MZ_FINISH implies that there are no more source bytes available beside
+// what's already in the input buffer, and that the output buffer is large
+// enough to hold the rest of the decompressed data.
+// Return values:
+// MZ_OK on success. Either more input is needed but not available, and/or
+// there's more output to be written but the output buffer is full.
+// MZ_STREAM_END if all needed input has been consumed and all output bytes
+// have been written. For zlib streams, the adler-32 of the decompressed data
+// has also been verified.
+// MZ_STREAM_ERROR if the stream is bogus.
+// MZ_DATA_ERROR if the deflate stream is invalid.
+// MZ_PARAM_ERROR if one of the parameters is invalid.
+// MZ_BUF_ERROR if no forward progress is possible because the input buffer is
+// empty but the inflater needs more input to continue, or if the output
+// buffer is not large enough. Call mz_inflate() again
+// with more input data, or with more room in the output buffer (except when
+// using single call decompression, described above).
+int mz_inflate(mz_streamp pStream, int flush);
+
+// Deinitializes a decompressor.
+int mz_inflateEnd(mz_streamp pStream);
+
+// Single-call decompression.
+// Returns MZ_OK on success, or one of the error codes from mz_inflate() on
+// failure.
+int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len,
+ const unsigned char *pSource, mz_ulong source_len);
+
+// Returns a string description of the specified error code, or NULL if the
+// error code is invalid.
+const char *mz_error(int err);
+
+// Redefine zlib-compatible names to miniz equivalents, so miniz.c can be used
+// as a drop-in replacement for the subset of zlib that miniz.c supports.
+// Define MINIZ_NO_ZLIB_COMPATIBLE_NAMES to disable zlib-compatibility if you
+// use zlib in the same project.
+#ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES
+typedef unsigned char Byte;
+typedef unsigned int uInt;
+typedef mz_ulong uLong;
+typedef Byte Bytef;
+typedef uInt uIntf;
+typedef char charf;
+typedef int intf;
+typedef void *voidpf;
+typedef uLong uLongf;
+typedef void *voidp;
+typedef void *const voidpc;
+#define Z_NULL 0
+#define Z_NO_FLUSH MZ_NO_FLUSH
+#define Z_PARTIAL_FLUSH MZ_PARTIAL_FLUSH
+#define Z_SYNC_FLUSH MZ_SYNC_FLUSH
+#define Z_FULL_FLUSH MZ_FULL_FLUSH
+#define Z_FINISH MZ_FINISH
+#define Z_BLOCK MZ_BLOCK
+#define Z_OK MZ_OK
+#define Z_STREAM_END MZ_STREAM_END
+#define Z_NEED_DICT MZ_NEED_DICT
+#define Z_ERRNO MZ_ERRNO
+#define Z_STREAM_ERROR MZ_STREAM_ERROR
+#define Z_DATA_ERROR MZ_DATA_ERROR
+#define Z_MEM_ERROR MZ_MEM_ERROR
+#define Z_BUF_ERROR MZ_BUF_ERROR
+#define Z_VERSION_ERROR MZ_VERSION_ERROR
+#define Z_PARAM_ERROR MZ_PARAM_ERROR
+#define Z_NO_COMPRESSION MZ_NO_COMPRESSION
+#define Z_BEST_SPEED MZ_BEST_SPEED
+#define Z_BEST_COMPRESSION MZ_BEST_COMPRESSION
+#define Z_DEFAULT_COMPRESSION MZ_DEFAULT_COMPRESSION
+#define Z_DEFAULT_STRATEGY MZ_DEFAULT_STRATEGY
+#define Z_FILTERED MZ_FILTERED
+#define Z_HUFFMAN_ONLY MZ_HUFFMAN_ONLY
+#define Z_RLE MZ_RLE
+#define Z_FIXED MZ_FIXED
+#define Z_DEFLATED MZ_DEFLATED
+#define Z_DEFAULT_WINDOW_BITS MZ_DEFAULT_WINDOW_BITS
+#define alloc_func mz_alloc_func
+#define free_func mz_free_func
+#define internal_state mz_internal_state
+#define z_stream mz_stream
+#define deflateInit mz_deflateInit
+#define deflateInit2 mz_deflateInit2
+#define deflateReset mz_deflateReset
+#define deflate mz_deflate
+#define deflateEnd mz_deflateEnd
+#define deflateBound mz_deflateBound
+#define compress mz_compress
+#define compress2 mz_compress2
+#define compressBound mz_compressBound
+#define inflateInit mz_inflateInit
+#define inflateInit2 mz_inflateInit2
+#define inflate mz_inflate
+#define inflateEnd mz_inflateEnd
+#define uncompress mz_uncompress
+#define crc32 mz_crc32
+#define adler32 mz_adler32
+#define MAX_WBITS 15
+#define MAX_MEM_LEVEL 9
+#define zError mz_error
+#define ZLIB_VERSION MZ_VERSION
+#define ZLIB_VERNUM MZ_VERNUM
+#define ZLIB_VER_MAJOR MZ_VER_MAJOR
+#define ZLIB_VER_MINOR MZ_VER_MINOR
+#define ZLIB_VER_REVISION MZ_VER_REVISION
+#define ZLIB_VER_SUBREVISION MZ_VER_SUBREVISION
+#define zlibVersion mz_version
+#define zlib_version mz_version()
+#endif // #ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES
+
+#endif // MINIZ_NO_ZLIB_APIS
+
+// ------------------- Types and macros
+
+typedef unsigned char mz_uint8;
+typedef signed short mz_int16;
+typedef unsigned short mz_uint16;
+typedef unsigned int mz_uint32;
+typedef unsigned int mz_uint;
+typedef long long mz_int64;
+typedef unsigned long long mz_uint64;
+typedef int mz_bool;
+
+#define MZ_FALSE (0)
+#define MZ_TRUE (1)
+
+// An attempt to work around MSVC's spammy "warning C4127: conditional
+// expression is constant" message.
+#ifdef _MSC_VER
+#define MZ_MACRO_END while (0, 0)
+#else
+#define MZ_MACRO_END while (0)
+#endif
+
+// ------------------- ZIP archive reading/writing
+
+#ifndef MINIZ_NO_ARCHIVE_APIS
+
+enum {
+ MZ_ZIP_MAX_IO_BUF_SIZE = 64 * 1024,
+ MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE = 260,
+ MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE = 256
+};
+
+typedef struct {
+ mz_uint32 m_file_index;
+ mz_uint32 m_central_dir_ofs;
+ mz_uint16 m_version_made_by;
+ mz_uint16 m_version_needed;
+ mz_uint16 m_bit_flag;
+ mz_uint16 m_method;
+#ifndef MINIZ_NO_TIME
+ time_t m_time;
+#endif
+ mz_uint32 m_crc32;
+ mz_uint64 m_comp_size;
+ mz_uint64 m_uncomp_size;
+ mz_uint16 m_internal_attr;
+ mz_uint32 m_external_attr;
+ mz_uint64 m_local_header_ofs;
+ mz_uint32 m_comment_size;
+ char m_filename[MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE];
+ char m_comment[MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE];
+} mz_zip_archive_file_stat;
+
+typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs,
+ void *pBuf, size_t n);
+typedef size_t (*mz_file_write_func)(void *pOpaque, mz_uint64 file_ofs,
+ const void *pBuf, size_t n);
+
+struct mz_zip_internal_state_tag;
+typedef struct mz_zip_internal_state_tag mz_zip_internal_state;
+
+typedef enum {
+ MZ_ZIP_MODE_INVALID = 0,
+ MZ_ZIP_MODE_READING = 1,
+ MZ_ZIP_MODE_WRITING = 2,
+ MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED = 3
+} mz_zip_mode;
+
+typedef struct mz_zip_archive_tag {
+ mz_uint64 m_archive_size;
+ mz_uint64 m_central_directory_file_ofs;
+ mz_uint m_total_files;
+ mz_zip_mode m_zip_mode;
+
+ mz_uint m_file_offset_alignment;
+
+ mz_alloc_func m_pAlloc;
+ mz_free_func m_pFree;
+ mz_realloc_func m_pRealloc;
+ void *m_pAlloc_opaque;
+
+ mz_file_read_func m_pRead;
+ mz_file_write_func m_pWrite;
+ void *m_pIO_opaque;
+
+ mz_zip_internal_state *m_pState;
+
+} mz_zip_archive;
+
+typedef enum {
+ MZ_ZIP_FLAG_CASE_SENSITIVE = 0x0100,
+ MZ_ZIP_FLAG_IGNORE_PATH = 0x0200,
+ MZ_ZIP_FLAG_COMPRESSED_DATA = 0x0400,
+ MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY = 0x0800
+} mz_zip_flags;
+
+// ZIP archive reading
+
+// Inits a ZIP archive reader.
+// These functions read and validate the archive's central directory.
+mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size,
+ mz_uint32 flags);
+mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem,
+ size_t size, mz_uint32 flags);
+
+#ifndef MINIZ_NO_STDIO
+mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename,
+ mz_uint32 flags);
+#endif
+
+// Returns the total number of files in the archive.
+mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip);
+
+// Returns detailed information about an archive file entry.
+mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index,
+ mz_zip_archive_file_stat *pStat);
+
+// Determines if an archive file entry is a directory entry.
+mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip,
+ mz_uint file_index);
+mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip,
+ mz_uint file_index);
+
+// Retrieves the filename of an archive file entry.
+// Returns the number of bytes written to pFilename, or if filename_buf_size is
+// 0 this function returns the number of bytes needed to fully store the
+// filename.
+mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index,
+ char *pFilename, mz_uint filename_buf_size);
+
+// Attempts to locates a file in the archive's central directory.
+// Valid flags: MZ_ZIP_FLAG_CASE_SENSITIVE, MZ_ZIP_FLAG_IGNORE_PATH
+// Returns -1 if the file cannot be found.
+int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName,
+ const char *pComment, mz_uint flags);
+
+// Extracts a archive file to a memory buffer using no memory allocation.
+mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip,
+ mz_uint file_index, void *pBuf,
+ size_t buf_size, mz_uint flags,
+ void *pUser_read_buf,
+ size_t user_read_buf_size);
+mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(
+ mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size,
+ mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size);
+
+// Extracts a archive file to a memory buffer.
+mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index,
+ void *pBuf, size_t buf_size,
+ mz_uint flags);
+mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip,
+ const char *pFilename, void *pBuf,
+ size_t buf_size, mz_uint flags);
+
+// Extracts a archive file to a dynamically allocated heap buffer.
+void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index,
+ size_t *pSize, mz_uint flags);
+void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip,
+ const char *pFilename, size_t *pSize,
+ mz_uint flags);
+
+// Extracts a archive file using a callback function to output the file's data.
+mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip,
+ mz_uint file_index,
+ mz_file_write_func pCallback,
+ void *pOpaque, mz_uint flags);
+mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip,
+ const char *pFilename,
+ mz_file_write_func pCallback,
+ void *pOpaque, mz_uint flags);
+
+#ifndef MINIZ_NO_STDIO
+// Extracts a archive file to a disk file and sets its last accessed and
+// modified times.
+// This function only extracts files, not archive directory records.
+mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index,
+ const char *pDst_filename, mz_uint flags);
+mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip,
+ const char *pArchive_filename,
+ const char *pDst_filename,
+ mz_uint flags);
+#endif
+
+// Ends archive reading, freeing all allocations, and closing the input archive
+// file if mz_zip_reader_init_file() was used.
+mz_bool mz_zip_reader_end(mz_zip_archive *pZip);
+
+// ZIP archive writing
+
+#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
+
+// Inits a ZIP archive writer.
+mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size);
+mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip,
+ size_t size_to_reserve_at_beginning,
+ size_t initial_allocation_size);
+
+#ifndef MINIZ_NO_STDIO
+mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename,
+ mz_uint64 size_to_reserve_at_beginning);
+#endif
+
+// Converts a ZIP archive reader object into a writer object, to allow efficient
+// in-place file appends to occur on an existing archive.
+// For archives opened using mz_zip_reader_init_file, pFilename must be the
+// archive's filename so it can be reopened for writing. If the file can't be
+// reopened, mz_zip_reader_end() will be called.
+// For archives opened using mz_zip_reader_init_mem, the memory block must be
+// growable using the realloc callback (which defaults to realloc unless you've
+// overridden it).
+// Finally, for archives opened using mz_zip_reader_init, the mz_zip_archive's
+// user provided m_pWrite function cannot be NULL.
+// Note: In-place archive modification is not recommended unless you know what
+// you're doing, because if execution stops or something goes wrong before
+// the archive is finalized the file's central directory will be hosed.
+mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip,
+ const char *pFilename);
+
+// Adds the contents of a memory buffer to an archive. These functions record
+// the current local time into the archive.
+// To add a directory entry, call this method with an archive name ending in a
+// forwardslash with empty buffer.
+// level_and_flags - compression level (0-10, see MZ_BEST_SPEED,
+// MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or
+// just set to MZ_DEFAULT_COMPRESSION.
+mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name,
+ const void *pBuf, size_t buf_size,
+ mz_uint level_and_flags);
+mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip,
+ const char *pArchive_name, const void *pBuf,
+ size_t buf_size, const void *pComment,
+ mz_uint16 comment_size,
+ mz_uint level_and_flags, mz_uint64 uncomp_size,
+ mz_uint32 uncomp_crc32);
+
+#ifndef MINIZ_NO_STDIO
+// Adds the contents of a disk file to an archive. This function also records
+// the disk file's modified time into the archive.
+// level_and_flags - compression level (0-10, see MZ_BEST_SPEED,
+// MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or
+// just set to MZ_DEFAULT_COMPRESSION.
+mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name,
+ const char *pSrc_filename, const void *pComment,
+ mz_uint16 comment_size, mz_uint level_and_flags);
+#endif
+
+// Adds a file to an archive by fully cloning the data from another archive.
+// This function fully clones the source file's compressed data (no
+// recompression), along with its full filename, extra data, and comment fields.
+mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip,
+ mz_zip_archive *pSource_zip,
+ mz_uint file_index);
+
+// Finalizes the archive by writing the central directory records followed by
+// the end of central directory record.
+// After an archive is finalized, the only valid call on the mz_zip_archive
+// struct is mz_zip_writer_end().
+// An archive must be manually finalized by calling this function for it to be
+// valid.
+mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip);
+mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **pBuf,
+ size_t *pSize);
+
+// Ends archive writing, freeing all allocations, and closing the output file if
+// mz_zip_writer_init_file() was used.
+// Note for the archive to be valid, it must have been finalized before ending.
+mz_bool mz_zip_writer_end(mz_zip_archive *pZip);
+
+// Misc. high-level helper functions:
+
+// mz_zip_add_mem_to_archive_file_in_place() efficiently (but not atomically)
+// appends a memory blob to a ZIP archive.
+// level_and_flags - compression level (0-10, see MZ_BEST_SPEED,
+// MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or
+// just set to MZ_DEFAULT_COMPRESSION.
+mz_bool mz_zip_add_mem_to_archive_file_in_place(
+ const char *pZip_filename, const char *pArchive_name, const void *pBuf,
+ size_t buf_size, const void *pComment, mz_uint16 comment_size,
+ mz_uint level_and_flags);
+
+// Reads a single file from an archive into a heap block.
+// Returns NULL on failure.
+void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename,
+ const char *pArchive_name,
+ size_t *pSize, mz_uint zip_flags);
+
+#endif // #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
+
+#endif // #ifndef MINIZ_NO_ARCHIVE_APIS
+
+// ------------------- Low-level Decompression API Definitions
+
+// Decompression flags used by tinfl_decompress().
+// TINFL_FLAG_PARSE_ZLIB_HEADER: If set, the input has a valid zlib header and
+// ends with an adler32 checksum (it's a valid zlib stream). Otherwise, the
+// input is a raw deflate stream.
+// TINFL_FLAG_HAS_MORE_INPUT: If set, there are more input bytes available
+// beyond the end of the supplied input buffer. If clear, the input buffer
+// contains all remaining input.
+// TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF: If set, the output buffer is large
+// enough to hold the entire decompressed stream. If clear, the output buffer is
+// at least the size of the dictionary (typically 32KB).
+// TINFL_FLAG_COMPUTE_ADLER32: Force adler-32 checksum computation of the
+// decompressed bytes.
+enum {
+ TINFL_FLAG_PARSE_ZLIB_HEADER = 1,
+ TINFL_FLAG_HAS_MORE_INPUT = 2,
+ TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4,
+ TINFL_FLAG_COMPUTE_ADLER32 = 8
+};
+
+// High level decompression functions:
+// tinfl_decompress_mem_to_heap() decompresses a block in memory to a heap block
+// allocated via malloc().
+// On entry:
+// pSrc_buf, src_buf_len: Pointer and size of the Deflate or zlib source data
+// to decompress.
+// On return:
+// Function returns a pointer to the decompressed data, or NULL on failure.
+// *pOut_len will be set to the decompressed data's size, which could be larger
+// than src_buf_len on uncompressible data.
+// The caller must call mz_free() on the returned block when it's no longer
+// needed.
+void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len,
+ size_t *pOut_len, int flags);
+
+// tinfl_decompress_mem_to_mem() decompresses a block in memory to another block
+// in memory.
+// Returns TINFL_DECOMPRESS_MEM_TO_MEM_FAILED on failure, or the number of bytes
+// written on success.
+#define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1))
+size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len,
+ const void *pSrc_buf, size_t src_buf_len,
+ int flags);
+
+// tinfl_decompress_mem_to_callback() decompresses a block in memory to an
+// internal 32KB buffer, and a user provided callback function will be called to
+// flush the buffer.
+// Returns 1 on success or 0 on failure.
+typedef int (*tinfl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser);
+int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size,
+ tinfl_put_buf_func_ptr pPut_buf_func,
+ void *pPut_buf_user, int flags);
+
+struct tinfl_decompressor_tag;
+typedef struct tinfl_decompressor_tag tinfl_decompressor;
+
+// Max size of LZ dictionary.
+#define TINFL_LZ_DICT_SIZE 32768
+
+// Return status.
+typedef enum {
+ TINFL_STATUS_BAD_PARAM = -3,
+ TINFL_STATUS_ADLER32_MISMATCH = -2,
+ TINFL_STATUS_FAILED = -1,
+ TINFL_STATUS_DONE = 0,
+ TINFL_STATUS_NEEDS_MORE_INPUT = 1,
+ TINFL_STATUS_HAS_MORE_OUTPUT = 2
+} tinfl_status;
+
+// Initializes the decompressor to its initial state.
+#define tinfl_init(r) \
+ do { \
+ (r)->m_state = 0; \
+ } \
+ MZ_MACRO_END
+#define tinfl_get_adler32(r) (r)->m_check_adler32
+
+// Main low-level decompressor coroutine function. This is the only function
+// actually needed for decompression. All the other functions are just
+// high-level helpers for improved usability.
+// This is a universal API, i.e. it can be used as a building block to build any
+// desired higher level decompression API. In the limit case, it can be called
+// once per every byte input or output.
+tinfl_status tinfl_decompress(tinfl_decompressor *r,
+ const mz_uint8 *pIn_buf_next,
+ size_t *pIn_buf_size, mz_uint8 *pOut_buf_start,
+ mz_uint8 *pOut_buf_next, size_t *pOut_buf_size,
+ const mz_uint32 decomp_flags);
+
+// Internal/private bits follow.
+enum {
+ TINFL_MAX_HUFF_TABLES = 3,
+ TINFL_MAX_HUFF_SYMBOLS_0 = 288,
+ TINFL_MAX_HUFF_SYMBOLS_1 = 32,
+ TINFL_MAX_HUFF_SYMBOLS_2 = 19,
+ TINFL_FAST_LOOKUP_BITS = 10,
+ TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS
+};
+
+typedef struct {
+ mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0];
+ mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE],
+ m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2];
+} tinfl_huff_table;
+
+#if MINIZ_HAS_64BIT_REGISTERS
+#define TINFL_USE_64BIT_BITBUF 1
+#endif
+
+#if TINFL_USE_64BIT_BITBUF
+typedef mz_uint64 tinfl_bit_buf_t;
+#define TINFL_BITBUF_SIZE (64)
+#else
+typedef mz_uint32 tinfl_bit_buf_t;
+#define TINFL_BITBUF_SIZE (32)
+#endif
+
+struct tinfl_decompressor_tag {
+ mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type,
+ m_check_adler32, m_dist, m_counter, m_num_extra,
+ m_table_sizes[TINFL_MAX_HUFF_TABLES];
+ tinfl_bit_buf_t m_bit_buf;
+ size_t m_dist_from_out_buf_start;
+ tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES];
+ mz_uint8 m_raw_header[4],
+ m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137];
+};
+
+// ------------------- Low-level Compression API Definitions
+
+// Set TDEFL_LESS_MEMORY to 1 to use less memory (compression will be slightly
+// slower, and raw/dynamic blocks will be output more frequently).
+#define TDEFL_LESS_MEMORY 0
+
+// tdefl_init() compression flags logically OR'd together (low 12 bits contain
+// the max. number of probes per dictionary search):
+// TDEFL_DEFAULT_MAX_PROBES: The compressor defaults to 128 dictionary probes
+// per dictionary search. 0=Huffman only, 1=Huffman+LZ (fastest/crap
+// compression), 4095=Huffman+LZ (slowest/best compression).
+enum {
+ TDEFL_HUFFMAN_ONLY = 0,
+ TDEFL_DEFAULT_MAX_PROBES = 128,
+ TDEFL_MAX_PROBES_MASK = 0xFFF
+};
+
+// TDEFL_WRITE_ZLIB_HEADER: If set, the compressor outputs a zlib header before
+// the deflate data, and the Adler-32 of the source data at the end. Otherwise,
+// you'll get raw deflate data.
+// TDEFL_COMPUTE_ADLER32: Always compute the adler-32 of the input data (even
+// when not writing zlib headers).
+// TDEFL_GREEDY_PARSING_FLAG: Set to use faster greedy parsing, instead of more
+// efficient lazy parsing.
+// TDEFL_NONDETERMINISTIC_PARSING_FLAG: Enable to decrease the compressor's
+// initialization time to the minimum, but the output may vary from run to run
+// given the same input (depending on the contents of memory).
+// TDEFL_RLE_MATCHES: Only look for RLE matches (matches with a distance of 1)
+// TDEFL_FILTER_MATCHES: Discards matches <= 5 chars if enabled.
+// TDEFL_FORCE_ALL_STATIC_BLOCKS: Disable usage of optimized Huffman tables.
+// TDEFL_FORCE_ALL_RAW_BLOCKS: Only use raw (uncompressed) deflate blocks.
+// The low 12 bits are reserved to control the max # of hash probes per
+// dictionary lookup (see TDEFL_MAX_PROBES_MASK).
+enum {
+ TDEFL_WRITE_ZLIB_HEADER = 0x01000,
+ TDEFL_COMPUTE_ADLER32 = 0x02000,
+ TDEFL_GREEDY_PARSING_FLAG = 0x04000,
+ TDEFL_NONDETERMINISTIC_PARSING_FLAG = 0x08000,
+ TDEFL_RLE_MATCHES = 0x10000,
+ TDEFL_FILTER_MATCHES = 0x20000,
+ TDEFL_FORCE_ALL_STATIC_BLOCKS = 0x40000,
+ TDEFL_FORCE_ALL_RAW_BLOCKS = 0x80000
+};
+
+// High level compression functions:
+// tdefl_compress_mem_to_heap() compresses a block in memory to a heap block
+// allocated via malloc().
+// On entry:
+// pSrc_buf, src_buf_len: Pointer and size of source block to compress.
+// flags: The max match finder probes (default is 128) logically OR'd against
+// the above flags. Higher probes are slower but improve compression.
+// On return:
+// Function returns a pointer to the compressed data, or NULL on failure.
+// *pOut_len will be set to the compressed data's size, which could be larger
+// than src_buf_len on uncompressible data.
+// The caller must free() the returned block when it's no longer needed.
+void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len,
+ size_t *pOut_len, int flags);
+
+// tdefl_compress_mem_to_mem() compresses a block in memory to another block in
+// memory.
+// Returns 0 on failure.
+size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len,
+ const void *pSrc_buf, size_t src_buf_len,
+ int flags);
+
+// Compresses an image to a compressed PNG file in memory.
+// On entry:
+// pImage, w, h, and num_chans describe the image to compress. num_chans may be
+// 1, 2, 3, or 4.
+// The image pitch in bytes per scanline will be w*num_chans. The leftmost
+// pixel on the top scanline is stored first in memory.
+// level may range from [0,10], use MZ_NO_COMPRESSION, MZ_BEST_SPEED,
+// MZ_BEST_COMPRESSION, etc. or a decent default is MZ_DEFAULT_LEVEL
+// If flip is true, the image will be flipped on the Y axis (useful for OpenGL
+// apps).
+// On return:
+// Function returns a pointer to the compressed data, or NULL on failure.
+// *pLen_out will be set to the size of the PNG image file.
+// The caller must mz_free() the returned heap block (which will typically be
+// larger than *pLen_out) when it's no longer needed.
+void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w,
+ int h, int num_chans,
+ size_t *pLen_out,
+ mz_uint level, mz_bool flip);
+void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h,
+ int num_chans, size_t *pLen_out);
+
+// Output stream interface. The compressor uses this interface to write
+// compressed data. It'll typically be called TDEFL_OUT_BUF_SIZE at a time.
+typedef mz_bool (*tdefl_put_buf_func_ptr)(const void *pBuf, int len,
+ void *pUser);
+
+// tdefl_compress_mem_to_output() compresses a block to an output stream. The
+// above helpers use this function internally.
+mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len,
+ tdefl_put_buf_func_ptr pPut_buf_func,
+ void *pPut_buf_user, int flags);
+
+enum {
+ TDEFL_MAX_HUFF_TABLES = 3,
+ TDEFL_MAX_HUFF_SYMBOLS_0 = 288,
+ TDEFL_MAX_HUFF_SYMBOLS_1 = 32,
+ TDEFL_MAX_HUFF_SYMBOLS_2 = 19,
+ TDEFL_LZ_DICT_SIZE = 32768,
+ TDEFL_LZ_DICT_SIZE_MASK = TDEFL_LZ_DICT_SIZE - 1,
+ TDEFL_MIN_MATCH_LEN = 3,
+ TDEFL_MAX_MATCH_LEN = 258
+};
+
+// TDEFL_OUT_BUF_SIZE MUST be large enough to hold a single entire compressed
+// output block (using static/fixed Huffman codes).
+#if TDEFL_LESS_MEMORY
+enum {
+ TDEFL_LZ_CODE_BUF_SIZE = 24 * 1024,
+ TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13) / 10,
+ TDEFL_MAX_HUFF_SYMBOLS = 288,
+ TDEFL_LZ_HASH_BITS = 12,
+ TDEFL_LEVEL1_HASH_SIZE_MASK = 4095,
+ TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3,
+ TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS
+};
+#else
+enum {
+ TDEFL_LZ_CODE_BUF_SIZE = 64 * 1024,
+ TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13) / 10,
+ TDEFL_MAX_HUFF_SYMBOLS = 288,
+ TDEFL_LZ_HASH_BITS = 15,
+ TDEFL_LEVEL1_HASH_SIZE_MASK = 4095,
+ TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3,
+ TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS
+};
+#endif
+
+// The low-level tdefl functions below may be used directly if the above helper
+// functions aren't flexible enough. The low-level functions don't make any heap
+// allocations, unlike the above helper functions.
+typedef enum {
+ TDEFL_STATUS_BAD_PARAM = -2,
+ TDEFL_STATUS_PUT_BUF_FAILED = -1,
+ TDEFL_STATUS_OKAY = 0,
+ TDEFL_STATUS_DONE = 1
+} tdefl_status;
+
+// Must map to MZ_NO_FLUSH, MZ_SYNC_FLUSH, etc. enums
+typedef enum {
+ TDEFL_NO_FLUSH = 0,
+ TDEFL_SYNC_FLUSH = 2,
+ TDEFL_FULL_FLUSH = 3,
+ TDEFL_FINISH = 4
+} tdefl_flush;
+
+// tdefl's compression state structure.
+typedef struct {
+ tdefl_put_buf_func_ptr m_pPut_buf_func;
+ void *m_pPut_buf_user;
+ mz_uint m_flags, m_max_probes[2];
+ int m_greedy_parsing;
+ mz_uint m_adler32, m_lookahead_pos, m_lookahead_size, m_dict_size;
+ mz_uint8 *m_pLZ_code_buf, *m_pLZ_flags, *m_pOutput_buf, *m_pOutput_buf_end;
+ mz_uint m_num_flags_left, m_total_lz_bytes, m_lz_code_buf_dict_pos, m_bits_in,
+ m_bit_buffer;
+ mz_uint m_saved_match_dist, m_saved_match_len, m_saved_lit,
+ m_output_flush_ofs, m_output_flush_remaining, m_finished, m_block_index,
+ m_wants_to_finish;
+ tdefl_status m_prev_return_status;
+ const void *m_pIn_buf;
+ void *m_pOut_buf;
+ size_t *m_pIn_buf_size, *m_pOut_buf_size;
+ tdefl_flush m_flush;
+ const mz_uint8 *m_pSrc;
+ size_t m_src_buf_left, m_out_buf_ofs;
+ mz_uint8 m_dict[TDEFL_LZ_DICT_SIZE + TDEFL_MAX_MATCH_LEN - 1];
+ mz_uint16 m_huff_count[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS];
+ mz_uint16 m_huff_codes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS];
+ mz_uint8 m_huff_code_sizes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS];
+ mz_uint8 m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE];
+ mz_uint16 m_next[TDEFL_LZ_DICT_SIZE];
+ mz_uint16 m_hash[TDEFL_LZ_HASH_SIZE];
+ mz_uint8 m_output_buf[TDEFL_OUT_BUF_SIZE];
+} tdefl_compressor;
+
+// Initializes the compressor.
+// There is no corresponding deinit() function because the tdefl API's do not
+// dynamically allocate memory.
+// pBut_buf_func: If NULL, output data will be supplied to the specified
+// callback. In this case, the user should call the tdefl_compress_buffer() API
+// for compression.
+// If pBut_buf_func is NULL the user should always call the tdefl_compress()
+// API.
+// flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER,
+// etc.)
+tdefl_status tdefl_init(tdefl_compressor *d,
+ tdefl_put_buf_func_ptr pPut_buf_func,
+ void *pPut_buf_user, int flags);
+
+// Compresses a block of data, consuming as much of the specified input buffer
+// as possible, and writing as much compressed data to the specified output
+// buffer as possible.
+tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf,
+ size_t *pIn_buf_size, void *pOut_buf,
+ size_t *pOut_buf_size, tdefl_flush flush);
+
+// tdefl_compress_buffer() is only usable when the tdefl_init() is called with a
+// non-NULL tdefl_put_buf_func_ptr.
+// tdefl_compress_buffer() always consumes the entire input buffer.
+tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf,
+ size_t in_buf_size, tdefl_flush flush);
+
+tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d);
+mz_uint32 tdefl_get_adler32(tdefl_compressor *d);
+
+// Can't use tdefl_create_comp_flags_from_zip_params if MINIZ_NO_ZLIB_APIS isn't
+// defined, because it uses some of its macros.
+#ifndef MINIZ_NO_ZLIB_APIS
+// Create tdefl_compress() flags given zlib-style compression parameters.
+// level may range from [0,10] (where 10 is absolute max compression, but may be
+// much slower on some files)
+// window_bits may be -15 (raw deflate) or 15 (zlib)
+// strategy may be either MZ_DEFAULT_STRATEGY, MZ_FILTERED, MZ_HUFFMAN_ONLY,
+// MZ_RLE, or MZ_FIXED
+mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits,
+ int strategy);
+#endif // #ifndef MINIZ_NO_ZLIB_APIS
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MINIZ_HEADER_INCLUDED
+
+// ------------------- End of Header: Implementation follows. (If you only want
+// the header, define MINIZ_HEADER_FILE_ONLY.)
+
+#ifndef MINIZ_HEADER_FILE_ONLY
+
+typedef unsigned char mz_validate_uint16[sizeof(mz_uint16) == 2 ? 1 : -1];
+typedef unsigned char mz_validate_uint32[sizeof(mz_uint32) == 4 ? 1 : -1];
+typedef unsigned char mz_validate_uint64[sizeof(mz_uint64) == 8 ? 1 : -1];
+
+//#include <assert.h>
+//#include <string.h>
+
+#define MZ_ASSERT(x) assert(x)
+
+#ifdef MINIZ_NO_MALLOC
+#define MZ_MALLOC(x) NULL
+#define MZ_FREE(x) (void)x, ((void)0)
+#define MZ_REALLOC(p, x) NULL
+#else
+#define MZ_MALLOC(x) malloc(x)
+#define MZ_FREE(x) free(x)
+#define MZ_REALLOC(p, x) realloc(p, x)
+#endif
+
+#define MZ_MAX(a, b) (((a) > (b)) ? (a) : (b))
+#define MZ_MIN(a, b) (((a) < (b)) ? (a) : (b))
+#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj))
+
+#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN
+#define MZ_READ_LE16(p) *((const mz_uint16 *)(p))
+#define MZ_READ_LE32(p) *((const mz_uint32 *)(p))
+#else
+#define MZ_READ_LE16(p) \
+ ((mz_uint32)(((const mz_uint8 *)(p))[0]) | \
+ ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U))
+#define MZ_READ_LE32(p) \
+ ((mz_uint32)(((const mz_uint8 *)(p))[0]) | \
+ ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | \
+ ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | \
+ ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U))
+#endif
+
+#ifdef _MSC_VER
+#define MZ_FORCEINLINE __forceinline
+#elif defined(__GNUC__)
+#define MZ_FORCEINLINE inline __attribute__((__always_inline__))
+#else
+#define MZ_FORCEINLINE inline
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// ------------------- zlib-style API's
+
+mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len) {
+ mz_uint32 i, s1 = (mz_uint32)(adler & 0xffff), s2 = (mz_uint32)(adler >> 16);
+ size_t block_len = buf_len % 5552;
+ if (!ptr) return MZ_ADLER32_INIT;
+ while (buf_len) {
+ for (i = 0; i + 7 < block_len; i += 8, ptr += 8) {
+ s1 += ptr[0], s2 += s1;
+ s1 += ptr[1], s2 += s1;
+ s1 += ptr[2], s2 += s1;
+ s1 += ptr[3], s2 += s1;
+ s1 += ptr[4], s2 += s1;
+ s1 += ptr[5], s2 += s1;
+ s1 += ptr[6], s2 += s1;
+ s1 += ptr[7], s2 += s1;
+ }
+ for (; i < block_len; ++i) s1 += *ptr++, s2 += s1;
+ s1 %= 65521U, s2 %= 65521U;
+ buf_len -= block_len;
+ block_len = 5552;
+ }
+ return (s2 << 16) + s1;
+}
+
+// Karl Malbrain's compact CRC-32. See "A compact CCITT crc16 and crc32 C
+// implementation that balances processor cache usage against speed":
+// http://www.geocities.com/malbrain/
+mz_ulong mz_crc32(mz_ulong crc, const mz_uint8 *ptr, size_t buf_len) {
+ static const mz_uint32 s_crc32[16] = {
+ 0, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190, 0x6b6b51f4,
+ 0x4db26158, 0x5005713c, 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c,
+ 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c};
+ mz_uint32 crcu32 = (mz_uint32)crc;
+ if (!ptr) return MZ_CRC32_INIT;
+ crcu32 = ~crcu32;
+ while (buf_len--) {
+ mz_uint8 b = *ptr++;
+ crcu32 = (crcu32 >> 4) ^ s_crc32[(crcu32 & 0xF) ^ (b & 0xF)];
+ crcu32 = (crcu32 >> 4) ^ s_crc32[(crcu32 & 0xF) ^ (b >> 4)];
+ }
+ return ~crcu32;
+}
+
+void mz_free(void *p) { MZ_FREE(p); }
+
+#ifndef MINIZ_NO_ZLIB_APIS
+
+static void *def_alloc_func(void *opaque, size_t items, size_t size) {
+ (void)opaque, (void)items, (void)size;
+ return MZ_MALLOC(items * size);
+}
+static void def_free_func(void *opaque, void *address) {
+ (void)opaque, (void)address;
+ MZ_FREE(address);
+}
+static void *def_realloc_func(void *opaque, void *address, size_t items,
+ size_t size) {
+ (void)opaque, (void)address, (void)items, (void)size;
+ return MZ_REALLOC(address, items * size);
+}
+
+const char *mz_version(void) { return MZ_VERSION; }
+
+int mz_deflateInit(mz_streamp pStream, int level) {
+ return mz_deflateInit2(pStream, level, MZ_DEFLATED, MZ_DEFAULT_WINDOW_BITS, 9,
+ MZ_DEFAULT_STRATEGY);
+}
+
+int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits,
+ int mem_level, int strategy) {
+ tdefl_compressor *pComp;
+ mz_uint comp_flags =
+ TDEFL_COMPUTE_ADLER32 |
+ tdefl_create_comp_flags_from_zip_params(level, window_bits, strategy);
+
+ if (!pStream) return MZ_STREAM_ERROR;
+ if ((method != MZ_DEFLATED) || ((mem_level < 1) || (mem_level > 9)) ||
+ ((window_bits != MZ_DEFAULT_WINDOW_BITS) &&
+ (-window_bits != MZ_DEFAULT_WINDOW_BITS)))
+ return MZ_PARAM_ERROR;
+
+ pStream->data_type = 0;
+ pStream->adler = MZ_ADLER32_INIT;
+ pStream->msg = NULL;
+ pStream->reserved = 0;
+ pStream->total_in = 0;
+ pStream->total_out = 0;
+ if (!pStream->zalloc) pStream->zalloc = def_alloc_func;
+ if (!pStream->zfree) pStream->zfree = def_free_func;
+
+ pComp = (tdefl_compressor *)pStream->zalloc(pStream->opaque, 1,
+ sizeof(tdefl_compressor));
+ if (!pComp) return MZ_MEM_ERROR;
+
+ pStream->state = (struct mz_internal_state *)pComp;
+
+ if (tdefl_init(pComp, NULL, NULL, comp_flags) != TDEFL_STATUS_OKAY) {
+ mz_deflateEnd(pStream);
+ return MZ_PARAM_ERROR;
+ }
+
+ return MZ_OK;
+}
+
+int mz_deflateReset(mz_streamp pStream) {
+ if ((!pStream) || (!pStream->state) || (!pStream->zalloc) ||
+ (!pStream->zfree))
+ return MZ_STREAM_ERROR;
+ pStream->total_in = pStream->total_out = 0;
+ tdefl_init((tdefl_compressor *)pStream->state, NULL, NULL,
+ ((tdefl_compressor *)pStream->state)->m_flags);
+ return MZ_OK;
+}
+
+int mz_deflate(mz_streamp pStream, int flush) {
+ size_t in_bytes, out_bytes;
+ mz_ulong orig_total_in, orig_total_out;
+ int mz_status = MZ_OK;
+
+ if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) ||
+ (!pStream->next_out))
+ return MZ_STREAM_ERROR;
+ if (!pStream->avail_out) return MZ_BUF_ERROR;
+
+ if (flush == MZ_PARTIAL_FLUSH) flush = MZ_SYNC_FLUSH;
+
+ if (((tdefl_compressor *)pStream->state)->m_prev_return_status ==
+ TDEFL_STATUS_DONE)
+ return (flush == MZ_FINISH) ? MZ_STREAM_END : MZ_BUF_ERROR;
+
+ orig_total_in = pStream->total_in;
+ orig_total_out = pStream->total_out;
+ for (;;) {
+ tdefl_status defl_status;
+ in_bytes = pStream->avail_in;
+ out_bytes = pStream->avail_out;
+
+ defl_status = tdefl_compress((tdefl_compressor *)pStream->state,
+ pStream->next_in, &in_bytes, pStream->next_out,
+ &out_bytes, (tdefl_flush)flush);
+ pStream->next_in += (mz_uint)in_bytes;
+ pStream->avail_in -= (mz_uint)in_bytes;
+ pStream->total_in += (mz_uint)in_bytes;
+ pStream->adler = tdefl_get_adler32((tdefl_compressor *)pStream->state);
+
+ pStream->next_out += (mz_uint)out_bytes;
+ pStream->avail_out -= (mz_uint)out_bytes;
+ pStream->total_out += (mz_uint)out_bytes;
+
+ if (defl_status < 0) {
+ mz_status = MZ_STREAM_ERROR;
+ break;
+ } else if (defl_status == TDEFL_STATUS_DONE) {
+ mz_status = MZ_STREAM_END;
+ break;
+ } else if (!pStream->avail_out)
+ break;
+ else if ((!pStream->avail_in) && (flush != MZ_FINISH)) {
+ if ((flush) || (pStream->total_in != orig_total_in) ||
+ (pStream->total_out != orig_total_out))
+ break;
+ return MZ_BUF_ERROR; // Can't make forward progress without some input.
+ }
+ }
+ return mz_status;
+}
+
+int mz_deflateEnd(mz_streamp pStream) {
+ if (!pStream) return MZ_STREAM_ERROR;
+ if (pStream->state) {
+ pStream->zfree(pStream->opaque, pStream->state);
+ pStream->state = NULL;
+ }
+ return MZ_OK;
+}
+
+mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len) {
+ (void)pStream;
+ // This is really over conservative. (And lame, but it's actually pretty
+ // tricky to compute a true upper bound given the way tdefl's blocking works.)
+ return MZ_MAX(128 + (source_len * 110) / 100,
+ 128 + source_len + ((source_len / (31 * 1024)) + 1) * 5);
+}
+
+int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len,
+ const unsigned char *pSource, mz_ulong source_len, int level) {
+ int status;
+ mz_stream stream;
+ memset(&stream, 0, sizeof(stream));
+
+ // In case mz_ulong is 64-bits (argh I hate longs).
+ if ((source_len | *pDest_len) > 0xFFFFFFFFU) return MZ_PARAM_ERROR;
+
+ stream.next_in = pSource;
+ stream.avail_in = (mz_uint32)source_len;
+ stream.next_out = pDest;
+ stream.avail_out = (mz_uint32)*pDest_len;
+
+ status = mz_deflateInit(&stream, level);
+ if (status != MZ_OK) return status;
+
+ status = mz_deflate(&stream, MZ_FINISH);
+ if (status != MZ_STREAM_END) {
+ mz_deflateEnd(&stream);
+ return (status == MZ_OK) ? MZ_BUF_ERROR : status;
+ }
+
+ *pDest_len = stream.total_out;
+ return mz_deflateEnd(&stream);
+}
+
+int mz_compress(unsigned char *pDest, mz_ulong *pDest_len,
+ const unsigned char *pSource, mz_ulong source_len) {
+ return mz_compress2(pDest, pDest_len, pSource, source_len,
+ MZ_DEFAULT_COMPRESSION);
+}
+
+mz_ulong mz_compressBound(mz_ulong source_len) {
+ return mz_deflateBound(NULL, source_len);
+}
+
+typedef struct {
+ tinfl_decompressor m_decomp;
+ mz_uint m_dict_ofs, m_dict_avail, m_first_call, m_has_flushed;
+ int m_window_bits;
+ mz_uint8 m_dict[TINFL_LZ_DICT_SIZE];
+ tinfl_status m_last_status;
+} inflate_state;
+
+int mz_inflateInit2(mz_streamp pStream, int window_bits) {
+ inflate_state *pDecomp;
+ if (!pStream) return MZ_STREAM_ERROR;
+ if ((window_bits != MZ_DEFAULT_WINDOW_BITS) &&
+ (-window_bits != MZ_DEFAULT_WINDOW_BITS))
+ return MZ_PARAM_ERROR;
+
+ pStream->data_type = 0;
+ pStream->adler = 0;
+ pStream->msg = NULL;
+ pStream->total_in = 0;
+ pStream->total_out = 0;
+ pStream->reserved = 0;
+ if (!pStream->zalloc) pStream->zalloc = def_alloc_func;
+ if (!pStream->zfree) pStream->zfree = def_free_func;
+
+ pDecomp = (inflate_state *)pStream->zalloc(pStream->opaque, 1,
+ sizeof(inflate_state));
+ if (!pDecomp) return MZ_MEM_ERROR;
+
+ pStream->state = (struct mz_internal_state *)pDecomp;
+
+ tinfl_init(&pDecomp->m_decomp);
+ pDecomp->m_dict_ofs = 0;
+ pDecomp->m_dict_avail = 0;
+ pDecomp->m_last_status = TINFL_STATUS_NEEDS_MORE_INPUT;
+ pDecomp->m_first_call = 1;
+ pDecomp->m_has_flushed = 0;
+ pDecomp->m_window_bits = window_bits;
+
+ return MZ_OK;
+}
+
+int mz_inflateInit(mz_streamp pStream) {
+ return mz_inflateInit2(pStream, MZ_DEFAULT_WINDOW_BITS);
+}
+
+int mz_inflate(mz_streamp pStream, int flush) {
+ inflate_state *pState;
+ mz_uint n, first_call, decomp_flags = TINFL_FLAG_COMPUTE_ADLER32;
+ size_t in_bytes, out_bytes, orig_avail_in;
+ tinfl_status status;
+
+ if ((!pStream) || (!pStream->state)) return MZ_STREAM_ERROR;
+ if (flush == MZ_PARTIAL_FLUSH) flush = MZ_SYNC_FLUSH;
+ if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH))
+ return MZ_STREAM_ERROR;
+
+ pState = (inflate_state *)pStream->state;
+ if (pState->m_window_bits > 0) decomp_flags |= TINFL_FLAG_PARSE_ZLIB_HEADER;
+ orig_avail_in = pStream->avail_in;
+
+ first_call = pState->m_first_call;
+ pState->m_first_call = 0;
+ if (pState->m_last_status < 0) return MZ_DATA_ERROR;
+
+ if (pState->m_has_flushed && (flush != MZ_FINISH)) return MZ_STREAM_ERROR;
+ pState->m_has_flushed |= (flush == MZ_FINISH);
+
+ if ((flush == MZ_FINISH) && (first_call)) {
+ // MZ_FINISH on the first call implies that the input and output buffers are
+ // large enough to hold the entire compressed/decompressed file.
+ decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF;
+ in_bytes = pStream->avail_in;
+ out_bytes = pStream->avail_out;
+ status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes,
+ pStream->next_out, pStream->next_out, &out_bytes,
+ decomp_flags);
+ pState->m_last_status = status;
+ pStream->next_in += (mz_uint)in_bytes;
+ pStream->avail_in -= (mz_uint)in_bytes;
+ pStream->total_in += (mz_uint)in_bytes;
+ pStream->adler = tinfl_get_adler32(&pState->m_decomp);
+ pStream->next_out += (mz_uint)out_bytes;
+ pStream->avail_out -= (mz_uint)out_bytes;
+ pStream->total_out += (mz_uint)out_bytes;
+
+ if (status < 0)
+ return MZ_DATA_ERROR;
+ else if (status != TINFL_STATUS_DONE) {
+ pState->m_last_status = TINFL_STATUS_FAILED;
+ return MZ_BUF_ERROR;
+ }
+ return MZ_STREAM_END;
+ }
+ // flush != MZ_FINISH then we must assume there's more input.
+ if (flush != MZ_FINISH) decomp_flags |= TINFL_FLAG_HAS_MORE_INPUT;
+
+ if (pState->m_dict_avail) {
+ n = MZ_MIN(pState->m_dict_avail, pStream->avail_out);
+ memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n);
+ pStream->next_out += n;
+ pStream->avail_out -= n;
+ pStream->total_out += n;
+ pState->m_dict_avail -= n;
+ pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1);
+ return ((pState->m_last_status == TINFL_STATUS_DONE) &&
+ (!pState->m_dict_avail))
+ ? MZ_STREAM_END
+ : MZ_OK;
+ }
+
+ for (;;) {
+ in_bytes = pStream->avail_in;
+ out_bytes = TINFL_LZ_DICT_SIZE - pState->m_dict_ofs;
+
+ status = tinfl_decompress(
+ &pState->m_decomp, pStream->next_in, &in_bytes, pState->m_dict,
+ pState->m_dict + pState->m_dict_ofs, &out_bytes, decomp_flags);
+ pState->m_last_status = status;
+
+ pStream->next_in += (mz_uint)in_bytes;
+ pStream->avail_in -= (mz_uint)in_bytes;
+ pStream->total_in += (mz_uint)in_bytes;
+ pStream->adler = tinfl_get_adler32(&pState->m_decomp);
+
+ pState->m_dict_avail = (mz_uint)out_bytes;
+
+ n = MZ_MIN(pState->m_dict_avail, pStream->avail_out);
+ memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n);
+ pStream->next_out += n;
+ pStream->avail_out -= n;
+ pStream->total_out += n;
+ pState->m_dict_avail -= n;
+ pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1);
+
+ if (status < 0)
+ return MZ_DATA_ERROR; // Stream is corrupted (there could be some
+ // uncompressed data left in the output dictionary -
+ // oh well).
+ else if ((status == TINFL_STATUS_NEEDS_MORE_INPUT) && (!orig_avail_in))
+ return MZ_BUF_ERROR; // Signal caller that we can't make forward progress
+ // without supplying more input or by setting flush
+ // to MZ_FINISH.
+ else if (flush == MZ_FINISH) {
+ // The output buffer MUST be large to hold the remaining uncompressed data
+ // when flush==MZ_FINISH.
+ if (status == TINFL_STATUS_DONE)
+ return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END;
+ // status here must be TINFL_STATUS_HAS_MORE_OUTPUT, which means there's
+ // at least 1 more byte on the way. If there's no more room left in the
+ // output buffer then something is wrong.
+ else if (!pStream->avail_out)
+ return MZ_BUF_ERROR;
+ } else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) ||
+ (!pStream->avail_out) || (pState->m_dict_avail))
+ break;
+ }
+
+ return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail))
+ ? MZ_STREAM_END
+ : MZ_OK;
+}
+
+int mz_inflateEnd(mz_streamp pStream) {
+ if (!pStream) return MZ_STREAM_ERROR;
+ if (pStream->state) {
+ pStream->zfree(pStream->opaque, pStream->state);
+ pStream->state = NULL;
+ }
+ return MZ_OK;
+}
+
+int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len,
+ const unsigned char *pSource, mz_ulong source_len) {
+ mz_stream stream;
+ int status;
+ memset(&stream, 0, sizeof(stream));
+
+ // In case mz_ulong is 64-bits (argh I hate longs).
+ if ((source_len | *pDest_len) > 0xFFFFFFFFU) return MZ_PARAM_ERROR;
+
+ stream.next_in = pSource;
+ stream.avail_in = (mz_uint32)source_len;
+ stream.next_out = pDest;
+ stream.avail_out = (mz_uint32)*pDest_len;
+
+ status = mz_inflateInit(&stream);
+ if (status != MZ_OK) return status;
+
+ status = mz_inflate(&stream, MZ_FINISH);
+ if (status != MZ_STREAM_END) {
+ mz_inflateEnd(&stream);
+ return ((status == MZ_BUF_ERROR) && (!stream.avail_in)) ? MZ_DATA_ERROR
+ : status;
+ }
+ *pDest_len = stream.total_out;
+
+ return mz_inflateEnd(&stream);
+}
+
+const char *mz_error(int err) {
+ static struct {
+ int m_err;
+ const char *m_pDesc;
+ } s_error_descs[] = {{MZ_OK, ""},
+ {MZ_STREAM_END, "stream end"},
+ {MZ_NEED_DICT, "need dictionary"},
+ {MZ_ERRNO, "file error"},
+ {MZ_STREAM_ERROR, "stream error"},
+ {MZ_DATA_ERROR, "data error"},
+ {MZ_MEM_ERROR, "out of memory"},
+ {MZ_BUF_ERROR, "buf error"},
+ {MZ_VERSION_ERROR, "version error"},
+ {MZ_PARAM_ERROR, "parameter error"}};
+ mz_uint i;
+ for (i = 0; i < sizeof(s_error_descs) / sizeof(s_error_descs[0]); ++i)
+ if (s_error_descs[i].m_err == err) return s_error_descs[i].m_pDesc;
+ return NULL;
+}
+
+#endif // MINIZ_NO_ZLIB_APIS
+
+// ------------------- Low-level Decompression (completely independent from all
+// compression API's)
+
+#define TINFL_MEMCPY(d, s, l) memcpy(d, s, l)
+#define TINFL_MEMSET(p, c, l) memset(p, c, l)
+
+#define TINFL_CR_BEGIN \
+ switch (r->m_state) { \
+ case 0:
+#define TINFL_CR_RETURN(state_index, result) \
+ do { \
+ status = result; \
+ r->m_state = state_index; \
+ goto common_exit; \
+ case state_index:; \
+ } \
+ MZ_MACRO_END
+#define TINFL_CR_RETURN_FOREVER(state_index, result) \
+ do { \
+ for (;;) { \
+ TINFL_CR_RETURN(state_index, result); \
+ } \
+ } \
+ MZ_MACRO_END
+#define TINFL_CR_FINISH }
+
+// TODO: If the caller has indicated that there's no more input, and we attempt
+// to read beyond the input buf, then something is wrong with the input because
+// the inflator never
+// reads ahead more than it needs to. Currently TINFL_GET_BYTE() pads the end of
+// the stream with 0's in this scenario.
+#define TINFL_GET_BYTE(state_index, c) \
+ do { \
+ if (pIn_buf_cur >= pIn_buf_end) { \
+ for (;;) { \
+ if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) { \
+ TINFL_CR_RETURN(state_index, TINFL_STATUS_NEEDS_MORE_INPUT); \
+ if (pIn_buf_cur < pIn_buf_end) { \
+ c = *pIn_buf_cur++; \
+ break; \
+ } \
+ } else { \
+ c = 0; \
+ break; \
+ } \
+ } \
+ } else \
+ c = *pIn_buf_cur++; \
+ } \
+ MZ_MACRO_END
+
+#define TINFL_NEED_BITS(state_index, n) \
+ do { \
+ mz_uint c; \
+ TINFL_GET_BYTE(state_index, c); \
+ bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); \
+ num_bits += 8; \
+ } while (num_bits < (mz_uint)(n))
+#define TINFL_SKIP_BITS(state_index, n) \
+ do { \
+ if (num_bits < (mz_uint)(n)) { \
+ TINFL_NEED_BITS(state_index, n); \
+ } \
+ bit_buf >>= (n); \
+ num_bits -= (n); \
+ } \
+ MZ_MACRO_END
+#define TINFL_GET_BITS(state_index, b, n) \
+ do { \
+ if (num_bits < (mz_uint)(n)) { \
+ TINFL_NEED_BITS(state_index, n); \
+ } \
+ b = bit_buf & ((1 << (n)) - 1); \
+ bit_buf >>= (n); \
+ num_bits -= (n); \
+ } \
+ MZ_MACRO_END
+
+// TINFL_HUFF_BITBUF_FILL() is only used rarely, when the number of bytes
+// remaining in the input buffer falls below 2.
+// It reads just enough bytes from the input stream that are needed to decode
+// the next Huffman code (and absolutely no more). It works by trying to fully
+// decode a
+// Huffman code by using whatever bits are currently present in the bit buffer.
+// If this fails, it reads another byte, and tries again until it succeeds or
+// until the
+// bit buffer contains >=15 bits (deflate's max. Huffman code size).
+#define TINFL_HUFF_BITBUF_FILL(state_index, pHuff) \
+ do { \
+ temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]; \
+ if (temp >= 0) { \
+ code_len = temp >> 9; \
+ if ((code_len) && (num_bits >= code_len)) break; \
+ } else if (num_bits > TINFL_FAST_LOOKUP_BITS) { \
+ code_len = TINFL_FAST_LOOKUP_BITS; \
+ do { \
+ temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; \
+ } while ((temp < 0) && (num_bits >= (code_len + 1))); \
+ if (temp >= 0) break; \
+ } \
+ TINFL_GET_BYTE(state_index, c); \
+ bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); \
+ num_bits += 8; \
+ } while (num_bits < 15);
+
+// TINFL_HUFF_DECODE() decodes the next Huffman coded symbol. It's more complex
+// than you would initially expect because the zlib API expects the decompressor
+// to never read
+// beyond the final byte of the deflate stream. (In other words, when this macro
+// wants to read another byte from the input, it REALLY needs another byte in
+// order to fully
+// decode the next Huffman code.) Handling this properly is particularly
+// important on raw deflate (non-zlib) streams, which aren't followed by a byte
+// aligned adler-32.
+// The slow path is only executed at the very end of the input buffer.
+#define TINFL_HUFF_DECODE(state_index, sym, pHuff) \
+ do { \
+ int temp; \
+ mz_uint code_len, c; \
+ if (num_bits < 15) { \
+ if ((pIn_buf_end - pIn_buf_cur) < 2) { \
+ TINFL_HUFF_BITBUF_FILL(state_index, pHuff); \
+ } else { \
+ bit_buf |= (((tinfl_bit_buf_t)pIn_buf_cur[0]) << num_bits) | \
+ (((tinfl_bit_buf_t)pIn_buf_cur[1]) << (num_bits + 8)); \
+ pIn_buf_cur += 2; \
+ num_bits += 16; \
+ } \
+ } \
+ if ((temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= \
+ 0) \
+ code_len = temp >> 9, temp &= 511; \
+ else { \
+ code_len = TINFL_FAST_LOOKUP_BITS; \
+ do { \
+ temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; \
+ } while (temp < 0); \
+ } \
+ sym = temp; \
+ bit_buf >>= code_len; \
+ num_bits -= code_len; \
+ } \
+ MZ_MACRO_END
+
+tinfl_status tinfl_decompress(tinfl_decompressor *r,
+ const mz_uint8 *pIn_buf_next,
+ size_t *pIn_buf_size, mz_uint8 *pOut_buf_start,
+ mz_uint8 *pOut_buf_next, size_t *pOut_buf_size,
+ const mz_uint32 decomp_flags) {
+ static const int s_length_base[31] = {
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+ static const int s_length_extra[31] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
+ 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4,
+ 4, 4, 5, 5, 5, 5, 0, 0, 0};
+ static const int s_dist_base[32] = {
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33,
+ 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537,
+ 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0};
+ static const int s_dist_extra[32] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3,
+ 4, 4, 5, 5, 6, 6, 7, 7, 8, 8,
+ 9, 9, 10, 10, 11, 11, 12, 12, 13, 13};
+ static const mz_uint8 s_length_dezigzag[19] = {
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+ static const int s_min_table_sizes[3] = {257, 1, 4};
+
+ tinfl_status status = TINFL_STATUS_FAILED;
+ mz_uint32 num_bits, dist, counter, num_extra;
+ tinfl_bit_buf_t bit_buf;
+ const mz_uint8 *pIn_buf_cur = pIn_buf_next,
+ *const pIn_buf_end = pIn_buf_next + *pIn_buf_size;
+ mz_uint8 *pOut_buf_cur = pOut_buf_next,
+ *const pOut_buf_end = pOut_buf_next + *pOut_buf_size;
+ size_t out_buf_size_mask =
+ (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)
+ ? (size_t)-1
+ : ((pOut_buf_next - pOut_buf_start) + *pOut_buf_size) - 1,
+ dist_from_out_buf_start;
+
+ // Ensure the output buffer's size is a power of 2, unless the output buffer
+ // is large enough to hold the entire output file (in which case it doesn't
+ // matter).
+ if (((out_buf_size_mask + 1) & out_buf_size_mask) ||
+ (pOut_buf_next < pOut_buf_start)) {
+ *pIn_buf_size = *pOut_buf_size = 0;
+ return TINFL_STATUS_BAD_PARAM;
+ }
+
+ num_bits = r->m_num_bits;
+ bit_buf = r->m_bit_buf;
+ dist = r->m_dist;
+ counter = r->m_counter;
+ num_extra = r->m_num_extra;
+ dist_from_out_buf_start = r->m_dist_from_out_buf_start;
+ TINFL_CR_BEGIN
+
+ bit_buf = num_bits = dist = counter = num_extra = r->m_zhdr0 = r->m_zhdr1 = 0;
+ r->m_z_adler32 = r->m_check_adler32 = 1;
+ if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) {
+ TINFL_GET_BYTE(1, r->m_zhdr0);
+ TINFL_GET_BYTE(2, r->m_zhdr1);
+ counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) ||
+ (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8));
+ if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
+ counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) ||
+ ((out_buf_size_mask + 1) <
+ (size_t)(1ULL << (8U + (r->m_zhdr0 >> 4)))));
+ if (counter) {
+ TINFL_CR_RETURN_FOREVER(36, TINFL_STATUS_FAILED);
+ }
+ }
+
+ do {
+ TINFL_GET_BITS(3, r->m_final, 3);
+ r->m_type = r->m_final >> 1;
+ if (r->m_type == 0) {
+ TINFL_SKIP_BITS(5, num_bits & 7);
+ for (counter = 0; counter < 4; ++counter) {
+ if (num_bits)
+ TINFL_GET_BITS(6, r->m_raw_header[counter], 8);
+ else
+ TINFL_GET_BYTE(7, r->m_raw_header[counter]);
+ }
+ if ((counter = (r->m_raw_header[0] | (r->m_raw_header[1] << 8))) !=
+ (mz_uint)(0xFFFF ^
+ (r->m_raw_header[2] | (r->m_raw_header[3] << 8)))) {
+ TINFL_CR_RETURN_FOREVER(39, TINFL_STATUS_FAILED);
+ }
+ while ((counter) && (num_bits)) {
+ TINFL_GET_BITS(51, dist, 8);
+ while (pOut_buf_cur >= pOut_buf_end) {
+ TINFL_CR_RETURN(52, TINFL_STATUS_HAS_MORE_OUTPUT);
+ }
+ *pOut_buf_cur++ = (mz_uint8)dist;
+ counter--;
+ }
+ while (counter) {
+ size_t n;
+ while (pOut_buf_cur >= pOut_buf_end) {
+ TINFL_CR_RETURN(9, TINFL_STATUS_HAS_MORE_OUTPUT);
+ }
+ while (pIn_buf_cur >= pIn_buf_end) {
+ if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) {
+ TINFL_CR_RETURN(38, TINFL_STATUS_NEEDS_MORE_INPUT);
+ } else {
+ TINFL_CR_RETURN_FOREVER(40, TINFL_STATUS_FAILED);
+ }
+ }
+ n = MZ_MIN(MZ_MIN((size_t)(pOut_buf_end - pOut_buf_cur),
+ (size_t)(pIn_buf_end - pIn_buf_cur)),
+ counter);
+ TINFL_MEMCPY(pOut_buf_cur, pIn_buf_cur, n);
+ pIn_buf_cur += n;
+ pOut_buf_cur += n;
+ counter -= (mz_uint)n;
+ }
+ } else if (r->m_type == 3) {
+ TINFL_CR_RETURN_FOREVER(10, TINFL_STATUS_FAILED);
+ } else {
+ if (r->m_type == 1) {
+ mz_uint8 *p = r->m_tables[0].m_code_size;
+ mz_uint i;
+ r->m_table_sizes[0] = 288;
+ r->m_table_sizes[1] = 32;
+ TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32);
+ for (i = 0; i <= 143; ++i) *p++ = 8;
+ for (; i <= 255; ++i) *p++ = 9;
+ for (; i <= 279; ++i) *p++ = 7;
+ for (; i <= 287; ++i) *p++ = 8;
+ } else {
+ for (counter = 0; counter < 3; counter++) {
+ TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]);
+ r->m_table_sizes[counter] += s_min_table_sizes[counter];
+ }
+ MZ_CLEAR_OBJ(r->m_tables[2].m_code_size);
+ for (counter = 0; counter < r->m_table_sizes[2]; counter++) {
+ mz_uint s;
+ TINFL_GET_BITS(14, s, 3);
+ r->m_tables[2].m_code_size[s_length_dezigzag[counter]] = (mz_uint8)s;
+ }
+ r->m_table_sizes[2] = 19;
+ }
+ for (; (int)r->m_type >= 0; r->m_type--) {
+ int tree_next, tree_cur;
+ tinfl_huff_table *pTable;
+ mz_uint i, j, used_syms, total, sym_index, next_code[17],
+ total_syms[16];
+ pTable = &r->m_tables[r->m_type];
+ MZ_CLEAR_OBJ(total_syms);
+ MZ_CLEAR_OBJ(pTable->m_look_up);
+ MZ_CLEAR_OBJ(pTable->m_tree);
+ for (i = 0; i < r->m_table_sizes[r->m_type]; ++i)
+ total_syms[pTable->m_code_size[i]]++;
+ used_syms = 0, total = 0;
+ next_code[0] = next_code[1] = 0;
+ for (i = 1; i <= 15; ++i) {
+ used_syms += total_syms[i];
+ next_code[i + 1] = (total = ((total + total_syms[i]) << 1));
+ }
+ if ((65536 != total) && (used_syms > 1)) {
+ TINFL_CR_RETURN_FOREVER(35, TINFL_STATUS_FAILED);
+ }
+ for (tree_next = -1, sym_index = 0;
+ sym_index < r->m_table_sizes[r->m_type]; ++sym_index) {
+ mz_uint rev_code = 0, l, cur_code,
+ code_size = pTable->m_code_size[sym_index];
+ if (!code_size) continue;
+ cur_code = next_code[code_size]++;
+ for (l = code_size; l > 0; l--, cur_code >>= 1)
+ rev_code = (rev_code << 1) | (cur_code & 1);
+ if (code_size <= TINFL_FAST_LOOKUP_BITS) {
+ mz_int16 k = (mz_int16)((code_size << 9) | sym_index);
+ while (rev_code < TINFL_FAST_LOOKUP_SIZE) {
+ pTable->m_look_up[rev_code] = k;
+ rev_code += (1 << code_size);
+ }
+ continue;
+ }
+ if (0 ==
+ (tree_cur = pTable->m_look_up[rev_code &
+ (TINFL_FAST_LOOKUP_SIZE - 1)])) {
+ pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)] =
+ (mz_int16)tree_next;
+ tree_cur = tree_next;
+ tree_next -= 2;
+ }
+ rev_code >>= (TINFL_FAST_LOOKUP_BITS - 1);
+ for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--) {
+ tree_cur -= ((rev_code >>= 1) & 1);
+ if (!pTable->m_tree[-tree_cur - 1]) {
+ pTable->m_tree[-tree_cur - 1] = (mz_int16)tree_next;
+ tree_cur = tree_next;
+ tree_next -= 2;
+ } else
+ tree_cur = pTable->m_tree[-tree_cur - 1];
+ }
+ tree_cur -= ((rev_code >>= 1) & 1);
+ pTable->m_tree[-tree_cur - 1] = (mz_int16)sym_index;
+ }
+ if (r->m_type == 2) {
+ for (counter = 0;
+ counter < (r->m_table_sizes[0] + r->m_table_sizes[1]);) {
+ mz_uint s;
+ TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
+ if (dist < 16) {
+ r->m_len_codes[counter++] = (mz_uint8)dist;
+ continue;
+ }
+ if ((dist == 16) && (!counter)) {
+ TINFL_CR_RETURN_FOREVER(17, TINFL_STATUS_FAILED);
+ }
+ num_extra = "\02\03\07"[dist - 16];
+ TINFL_GET_BITS(18, s, num_extra);
+ s += "\03\03\013"[dist - 16];
+ TINFL_MEMSET(r->m_len_codes + counter,
+ (dist == 16) ? r->m_len_codes[counter - 1] : 0, s);
+ counter += s;
+ }
+ if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter) {
+ TINFL_CR_RETURN_FOREVER(21, TINFL_STATUS_FAILED);
+ }
+ TINFL_MEMCPY(r->m_tables[0].m_code_size, r->m_len_codes,
+ r->m_table_sizes[0]);
+ TINFL_MEMCPY(r->m_tables[1].m_code_size,
+ r->m_len_codes + r->m_table_sizes[0],
+ r->m_table_sizes[1]);
+ }
+ }
+ for (;;) {
+ mz_uint8 *pSrc;
+ for (;;) {
+ if (((pIn_buf_end - pIn_buf_cur) < 4) ||
+ ((pOut_buf_end - pOut_buf_cur) < 2)) {
+ TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
+ if (counter >= 256) break;
+ while (pOut_buf_cur >= pOut_buf_end) {
+ TINFL_CR_RETURN(24, TINFL_STATUS_HAS_MORE_OUTPUT);
+ }
+ *pOut_buf_cur++ = (mz_uint8)counter;
+ } else {
+ int sym2;
+ mz_uint code_len;
+#if TINFL_USE_64BIT_BITBUF
+ if (num_bits < 30) {
+ bit_buf |=
+ (((tinfl_bit_buf_t)MZ_READ_LE32(pIn_buf_cur)) << num_bits);
+ pIn_buf_cur += 4;
+ num_bits += 32;
+ }
+#else
+ if (num_bits < 15) {
+ bit_buf |=
+ (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits);
+ pIn_buf_cur += 2;
+ num_bits += 16;
+ }
+#endif
+ if ((sym2 =
+ r->m_tables[0]
+ .m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >=
+ 0)
+ code_len = sym2 >> 9;
+ else {
+ code_len = TINFL_FAST_LOOKUP_BITS;
+ do {
+ sym2 = r->m_tables[0]
+ .m_tree[~sym2 + ((bit_buf >> code_len++) & 1)];
+ } while (sym2 < 0);
+ }
+ counter = sym2;
+ bit_buf >>= code_len;
+ num_bits -= code_len;
+ if (counter & 256) break;
+
+#if !TINFL_USE_64BIT_BITBUF
+ if (num_bits < 15) {
+ bit_buf |=
+ (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits);
+ pIn_buf_cur += 2;
+ num_bits += 16;
+ }
+#endif
+ if ((sym2 =
+ r->m_tables[0]
+ .m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >=
+ 0)
+ code_len = sym2 >> 9;
+ else {
+ code_len = TINFL_FAST_LOOKUP_BITS;
+ do {
+ sym2 = r->m_tables[0]
+ .m_tree[~sym2 + ((bit_buf >> code_len++) & 1)];
+ } while (sym2 < 0);
+ }
+ bit_buf >>= code_len;
+ num_bits -= code_len;
+
+ pOut_buf_cur[0] = (mz_uint8)counter;
+ if (sym2 & 256) {
+ pOut_buf_cur++;
+ counter = sym2;
+ break;
+ }
+ pOut_buf_cur[1] = (mz_uint8)sym2;
+ pOut_buf_cur += 2;
+ }
+ }
+ if ((counter &= 511) == 256) break;
+
+ num_extra = s_length_extra[counter - 257];
+ counter = s_length_base[counter - 257];
+ if (num_extra) {
+ mz_uint extra_bits;
+ TINFL_GET_BITS(25, extra_bits, num_extra);
+ counter += extra_bits;
+ }
+
+ TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
+ num_extra = s_dist_extra[dist];
+ dist = s_dist_base[dist];
+ if (num_extra) {
+ mz_uint extra_bits;
+ TINFL_GET_BITS(27, extra_bits, num_extra);
+ dist += extra_bits;
+ }
+
+ dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start;
+ if ((dist > dist_from_out_buf_start) &&
+ (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) {
+ TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED);
+ }
+
+ pSrc = pOut_buf_start +
+ ((dist_from_out_buf_start - dist) & out_buf_size_mask);
+
+ if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end) {
+ while (counter--) {
+ while (pOut_buf_cur >= pOut_buf_end) {
+ TINFL_CR_RETURN(53, TINFL_STATUS_HAS_MORE_OUTPUT);
+ }
+ *pOut_buf_cur++ =
+ pOut_buf_start[(dist_from_out_buf_start++ - dist) &
+ out_buf_size_mask];
+ }
+ continue;
+ }
+#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES
+ else if ((counter >= 9) && (counter <= dist)) {
+ const mz_uint8 *pSrc_end = pSrc + (counter & ~7);
+ do {
+ ((mz_uint32 *)pOut_buf_cur)[0] = ((const mz_uint32 *)pSrc)[0];
+ ((mz_uint32 *)pOut_buf_cur)[1] = ((const mz_uint32 *)pSrc)[1];
+ pOut_buf_cur += 8;
+ } while ((pSrc += 8) < pSrc_end);
+ if ((counter &= 7) < 3) {
+ if (counter) {
+ pOut_buf_cur[0] = pSrc[0];
+ if (counter > 1) pOut_buf_cur[1] = pSrc[1];
+ pOut_buf_cur += counter;
+ }
+ continue;
+ }
+ }
+#endif
+ do {
+ pOut_buf_cur[0] = pSrc[0];
+ pOut_buf_cur[1] = pSrc[1];
+ pOut_buf_cur[2] = pSrc[2];
+ pOut_buf_cur += 3;
+ pSrc += 3;
+ } while ((int)(counter -= 3) > 2);
+ if ((int)counter > 0) {
+ pOut_buf_cur[0] = pSrc[0];
+ if ((int)counter > 1) pOut_buf_cur[1] = pSrc[1];
+ pOut_buf_cur += counter;
+ }
+ }
+ }
+ } while (!(r->m_final & 1));
+ if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) {
+ TINFL_SKIP_BITS(32, num_bits & 7);
+ for (counter = 0; counter < 4; ++counter) {
+ mz_uint s;
+ if (num_bits)
+ TINFL_GET_BITS(41, s, 8);
+ else
+ TINFL_GET_BYTE(42, s);
+ r->m_z_adler32 = (r->m_z_adler32 << 8) | s;
+ }
+ }
+ TINFL_CR_RETURN_FOREVER(34, TINFL_STATUS_DONE);
+ TINFL_CR_FINISH
+
+common_exit:
+ r->m_num_bits = num_bits;
+ r->m_bit_buf = bit_buf;
+ r->m_dist = dist;
+ r->m_counter = counter;
+ r->m_num_extra = num_extra;
+ r->m_dist_from_out_buf_start = dist_from_out_buf_start;
+ *pIn_buf_size = pIn_buf_cur - pIn_buf_next;
+ *pOut_buf_size = pOut_buf_cur - pOut_buf_next;
+ if ((decomp_flags &
+ (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) &&
+ (status >= 0)) {
+ const mz_uint8 *ptr = pOut_buf_next;
+ size_t buf_len = *pOut_buf_size;
+ mz_uint32 i, s1 = r->m_check_adler32 & 0xffff,
+ s2 = r->m_check_adler32 >> 16;
+ size_t block_len = buf_len % 5552;
+ while (buf_len) {
+ for (i = 0; i + 7 < block_len; i += 8, ptr += 8) {
+ s1 += ptr[0], s2 += s1;
+ s1 += ptr[1], s2 += s1;
+ s1 += ptr[2], s2 += s1;
+ s1 += ptr[3], s2 += s1;
+ s1 += ptr[4], s2 += s1;
+ s1 += ptr[5], s2 += s1;
+ s1 += ptr[6], s2 += s1;
+ s1 += ptr[7], s2 += s1;
+ }
+ for (; i < block_len; ++i) s1 += *ptr++, s2 += s1;
+ s1 %= 65521U, s2 %= 65521U;
+ buf_len -= block_len;
+ block_len = 5552;
+ }
+ r->m_check_adler32 = (s2 << 16) + s1;
+ if ((status == TINFL_STATUS_DONE) &&
+ (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) &&
+ (r->m_check_adler32 != r->m_z_adler32))
+ status = TINFL_STATUS_ADLER32_MISMATCH;
+ }
+ return status;
+}
+
+// Higher level helper functions.
+void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len,
+ size_t *pOut_len, int flags) {
+ tinfl_decompressor decomp;
+ void *pBuf = NULL, *pNew_buf;
+ size_t src_buf_ofs = 0, out_buf_capacity = 0;
+ *pOut_len = 0;
+ tinfl_init(&decomp);
+ for (;;) {
+ size_t src_buf_size = src_buf_len - src_buf_ofs,
+ dst_buf_size = out_buf_capacity - *pOut_len, new_out_buf_capacity;
+ tinfl_status status = tinfl_decompress(
+ &decomp, (const mz_uint8 *)pSrc_buf + src_buf_ofs, &src_buf_size,
+ (mz_uint8 *)pBuf, pBuf ? (mz_uint8 *)pBuf + *pOut_len : NULL,
+ &dst_buf_size, (flags & ~TINFL_FLAG_HAS_MORE_INPUT) |
+ TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF);
+ if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT)) {
+ MZ_FREE(pBuf);
+ *pOut_len = 0;
+ return NULL;
+ }
+ src_buf_ofs += src_buf_size;
+ *pOut_len += dst_buf_size;
+ if (status == TINFL_STATUS_DONE) break;
+ new_out_buf_capacity = out_buf_capacity * 2;
+ if (new_out_buf_capacity < 128) new_out_buf_capacity = 128;
+ pNew_buf = MZ_REALLOC(pBuf, new_out_buf_capacity);
+ if (!pNew_buf) {
+ MZ_FREE(pBuf);
+ *pOut_len = 0;
+ return NULL;
+ }
+ pBuf = pNew_buf;
+ out_buf_capacity = new_out_buf_capacity;
+ }
+ return pBuf;
+}
+
+size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len,
+ const void *pSrc_buf, size_t src_buf_len,
+ int flags) {
+ tinfl_decompressor decomp;
+ tinfl_status status;
+ tinfl_init(&decomp);
+ status =
+ tinfl_decompress(&decomp, (const mz_uint8 *)pSrc_buf, &src_buf_len,
+ (mz_uint8 *)pOut_buf, (mz_uint8 *)pOut_buf, &out_buf_len,
+ (flags & ~TINFL_FLAG_HAS_MORE_INPUT) |
+ TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF);
+ return (status != TINFL_STATUS_DONE) ? TINFL_DECOMPRESS_MEM_TO_MEM_FAILED
+ : out_buf_len;
+}
+
+int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size,
+ tinfl_put_buf_func_ptr pPut_buf_func,
+ void *pPut_buf_user, int flags) {
+ int result = 0;
+ tinfl_decompressor decomp;
+ mz_uint8 *pDict = (mz_uint8 *)MZ_MALLOC(TINFL_LZ_DICT_SIZE);
+ size_t in_buf_ofs = 0, dict_ofs = 0;
+ if (!pDict) return TINFL_STATUS_FAILED;
+ tinfl_init(&decomp);
+ for (;;) {
+ size_t in_buf_size = *pIn_buf_size - in_buf_ofs,
+ dst_buf_size = TINFL_LZ_DICT_SIZE - dict_ofs;
+ tinfl_status status =
+ tinfl_decompress(&decomp, (const mz_uint8 *)pIn_buf + in_buf_ofs,
+ &in_buf_size, pDict, pDict + dict_ofs, &dst_buf_size,
+ (flags &
+ ~(TINFL_FLAG_HAS_MORE_INPUT |
+ TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)));
+ in_buf_ofs += in_buf_size;
+ if ((dst_buf_size) &&
+ (!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user)))
+ break;
+ if (status != TINFL_STATUS_HAS_MORE_OUTPUT) {
+ result = (status == TINFL_STATUS_DONE);
+ break;
+ }
+ dict_ofs = (dict_ofs + dst_buf_size) & (TINFL_LZ_DICT_SIZE - 1);
+ }
+ MZ_FREE(pDict);
+ *pIn_buf_size = in_buf_ofs;
+ return result;
+}
+
+// ------------------- Low-level Compression (independent from all decompression
+// API's)
+
+// Purposely making these tables static for faster init and thread safety.
+static const mz_uint16 s_tdefl_len_sym[256] = {
+ 257, 258, 259, 260, 261, 262, 263, 264, 265, 265, 266, 266, 267, 267, 268,
+ 268, 269, 269, 269, 269, 270, 270, 270, 270, 271, 271, 271, 271, 272, 272,
+ 272, 272, 273, 273, 273, 273, 273, 273, 273, 273, 274, 274, 274, 274, 274,
+ 274, 274, 274, 275, 275, 275, 275, 275, 275, 275, 275, 276, 276, 276, 276,
+ 276, 276, 276, 276, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277,
+ 277, 277, 277, 277, 277, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ 278, 278, 278, 278, 278, 278, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 282, 282, 282, 282, 282,
+ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
+ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 283, 283, 283,
+ 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
+ 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 284,
+ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
+ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
+ 285};
+
+static const mz_uint8 s_tdefl_len_extra[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 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, 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,
+ 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, 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, 0};
+
+static const mz_uint8 s_tdefl_small_dist_sym[512] = {
+ 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8,
+ 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17};
+
+static const mz_uint8 s_tdefl_small_dist_extra[512] = {
+ 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 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, 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, 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, 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};
+
+static const mz_uint8 s_tdefl_large_dist_sym[128] = {
+ 0, 0, 18, 19, 20, 20, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24,
+ 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29};
+
+static const mz_uint8 s_tdefl_large_dist_extra[128] = {
+ 0, 0, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13};
+
+// Radix sorts tdefl_sym_freq[] array by 16-bit key m_key. Returns ptr to sorted
+// values.
+typedef struct { mz_uint16 m_key, m_sym_index; } tdefl_sym_freq;
+static tdefl_sym_freq *tdefl_radix_sort_syms(mz_uint num_syms,
+ tdefl_sym_freq *pSyms0,
+ tdefl_sym_freq *pSyms1) {
+ mz_uint32 total_passes = 2, pass_shift, pass, i, hist[256 * 2];
+ tdefl_sym_freq *pCur_syms = pSyms0, *pNew_syms = pSyms1;
+ MZ_CLEAR_OBJ(hist);
+ for (i = 0; i < num_syms; i++) {
+ mz_uint freq = pSyms0[i].m_key;
+ hist[freq & 0xFF]++;
+ hist[256 + ((freq >> 8) & 0xFF)]++;
+ }
+ while ((total_passes > 1) && (num_syms == hist[(total_passes - 1) * 256]))
+ total_passes--;
+ for (pass_shift = 0, pass = 0; pass < total_passes; pass++, pass_shift += 8) {
+ const mz_uint32 *pHist = &hist[pass << 8];
+ mz_uint offsets[256], cur_ofs = 0;
+ for (i = 0; i < 256; i++) {
+ offsets[i] = cur_ofs;
+ cur_ofs += pHist[i];
+ }
+ for (i = 0; i < num_syms; i++)
+ pNew_syms[offsets[(pCur_syms[i].m_key >> pass_shift) & 0xFF]++] =
+ pCur_syms[i];
+ {
+ tdefl_sym_freq *t = pCur_syms;
+ pCur_syms = pNew_syms;
+ pNew_syms = t;
+ }
+ }
+ return pCur_syms;
+}
+
+// tdefl_calculate_minimum_redundancy() originally written by: Alistair Moffat,
+// alistair@cs.mu.oz.au, Jyrki Katajainen, jyrki@diku.dk, November 1996.
+static void tdefl_calculate_minimum_redundancy(tdefl_sym_freq *A, int n) {
+ int root, leaf, next, avbl, used, dpth;
+ if (n == 0)
+ return;
+ else if (n == 1) {
+ A[0].m_key = 1;
+ return;
+ }
+ A[0].m_key += A[1].m_key;
+ root = 0;
+ leaf = 2;
+ for (next = 1; next < n - 1; next++) {
+ if (leaf >= n || A[root].m_key < A[leaf].m_key) {
+ A[next].m_key = A[root].m_key;
+ A[root++].m_key = (mz_uint16)next;
+ } else
+ A[next].m_key = A[leaf++].m_key;
+ if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key)) {
+ A[next].m_key = (mz_uint16)(A[next].m_key + A[root].m_key);
+ A[root++].m_key = (mz_uint16)next;
+ } else
+ A[next].m_key = (mz_uint16)(A[next].m_key + A[leaf++].m_key);
+ }
+ A[n - 2].m_key = 0;
+ for (next = n - 3; next >= 0; next--)
+ A[next].m_key = A[A[next].m_key].m_key + 1;
+ avbl = 1;
+ used = dpth = 0;
+ root = n - 2;
+ next = n - 1;
+ while (avbl > 0) {
+ while (root >= 0 && (int)A[root].m_key == dpth) {
+ used++;
+ root--;
+ }
+ while (avbl > used) {
+ A[next--].m_key = (mz_uint16)(dpth);
+ avbl--;
+ }
+ avbl = 2 * used;
+ dpth++;
+ used = 0;
+ }
+}
+
+// Limits canonical Huffman code table's max code size.
+enum { TDEFL_MAX_SUPPORTED_HUFF_CODESIZE = 32 };
+static void tdefl_huffman_enforce_max_code_size(int *pNum_codes,
+ int code_list_len,
+ int max_code_size) {
+ int i;
+ mz_uint32 total = 0;
+ if (code_list_len <= 1) return;
+ for (i = max_code_size + 1; i <= TDEFL_MAX_SUPPORTED_HUFF_CODESIZE; i++)
+ pNum_codes[max_code_size] += pNum_codes[i];
+ for (i = max_code_size; i > 0; i--)
+ total += (((mz_uint32)pNum_codes[i]) << (max_code_size - i));
+ while (total != (1UL << max_code_size)) {
+ pNum_codes[max_code_size]--;
+ for (i = max_code_size - 1; i > 0; i--)
+ if (pNum_codes[i]) {
+ pNum_codes[i]--;
+ pNum_codes[i + 1] += 2;
+ break;
+ }
+ total--;
+ }
+}
+
+static void tdefl_optimize_huffman_table(tdefl_compressor *d, int table_num,
+ int table_len, int code_size_limit,
+ int static_table) {
+ int i, j, l, num_codes[1 + TDEFL_MAX_SUPPORTED_HUFF_CODESIZE];
+ mz_uint next_code[TDEFL_MAX_SUPPORTED_HUFF_CODESIZE + 1];
+ MZ_CLEAR_OBJ(num_codes);
+ if (static_table) {
+ for (i = 0; i < table_len; i++)
+ num_codes[d->m_huff_code_sizes[table_num][i]]++;
+ } else {
+ tdefl_sym_freq syms0[TDEFL_MAX_HUFF_SYMBOLS], syms1[TDEFL_MAX_HUFF_SYMBOLS],
+ *pSyms;
+ int num_used_syms = 0;
+ const mz_uint16 *pSym_count = &d->m_huff_count[table_num][0];
+ for (i = 0; i < table_len; i++)
+ if (pSym_count[i]) {
+ syms0[num_used_syms].m_key = (mz_uint16)pSym_count[i];
+ syms0[num_used_syms++].m_sym_index = (mz_uint16)i;
+ }
+
+ pSyms = tdefl_radix_sort_syms(num_used_syms, syms0, syms1);
+ tdefl_calculate_minimum_redundancy(pSyms, num_used_syms);
+
+ for (i = 0; i < num_used_syms; i++) num_codes[pSyms[i].m_key]++;
+
+ tdefl_huffman_enforce_max_code_size(num_codes, num_used_syms,
+ code_size_limit);
+
+ MZ_CLEAR_OBJ(d->m_huff_code_sizes[table_num]);
+ MZ_CLEAR_OBJ(d->m_huff_codes[table_num]);
+ for (i = 1, j = num_used_syms; i <= code_size_limit; i++)
+ for (l = num_codes[i]; l > 0; l--)
+ d->m_huff_code_sizes[table_num][pSyms[--j].m_sym_index] = (mz_uint8)(i);
+ }
+
+ next_code[1] = 0;
+ for (j = 0, i = 2; i <= code_size_limit; i++)
+ next_code[i] = j = ((j + num_codes[i - 1]) << 1);
+
+ for (i = 0; i < table_len; i++) {
+ mz_uint rev_code = 0, code, code_size;
+ if ((code_size = d->m_huff_code_sizes[table_num][i]) == 0) continue;
+ code = next_code[code_size]++;
+ for (l = code_size; l > 0; l--, code >>= 1)
+ rev_code = (rev_code << 1) | (code & 1);
+ d->m_huff_codes[table_num][i] = (mz_uint16)rev_code;
+ }
+}
+
+#define TDEFL_PUT_BITS(b, l) \
+ do { \
+ mz_uint bits = b; \
+ mz_uint len = l; \
+ MZ_ASSERT(bits <= ((1U << len) - 1U)); \
+ d->m_bit_buffer |= (bits << d->m_bits_in); \
+ d->m_bits_in += len; \
+ while (d->m_bits_in >= 8) { \
+ if (d->m_pOutput_buf < d->m_pOutput_buf_end) \
+ *d->m_pOutput_buf++ = (mz_uint8)(d->m_bit_buffer); \
+ d->m_bit_buffer >>= 8; \
+ d->m_bits_in -= 8; \
+ } \
+ } \
+ MZ_MACRO_END
+
+#define TDEFL_RLE_PREV_CODE_SIZE() \
+ { \
+ if (rle_repeat_count) { \
+ if (rle_repeat_count < 3) { \
+ d->m_huff_count[2][prev_code_size] = (mz_uint16)( \
+ d->m_huff_count[2][prev_code_size] + rle_repeat_count); \
+ while (rle_repeat_count--) \
+ packed_code_sizes[num_packed_code_sizes++] = prev_code_size; \
+ } else { \
+ d->m_huff_count[2][16] = (mz_uint16)(d->m_huff_count[2][16] + 1); \
+ packed_code_sizes[num_packed_code_sizes++] = 16; \
+ packed_code_sizes[num_packed_code_sizes++] = \
+ (mz_uint8)(rle_repeat_count - 3); \
+ } \
+ rle_repeat_count = 0; \
+ } \
+ }
+
+#define TDEFL_RLE_ZERO_CODE_SIZE() \
+ { \
+ if (rle_z_count) { \
+ if (rle_z_count < 3) { \
+ d->m_huff_count[2][0] = \
+ (mz_uint16)(d->m_huff_count[2][0] + rle_z_count); \
+ while (rle_z_count--) packed_code_sizes[num_packed_code_sizes++] = 0; \
+ } else if (rle_z_count <= 10) { \
+ d->m_huff_count[2][17] = (mz_uint16)(d->m_huff_count[2][17] + 1); \
+ packed_code_sizes[num_packed_code_sizes++] = 17; \
+ packed_code_sizes[num_packed_code_sizes++] = \
+ (mz_uint8)(rle_z_count - 3); \
+ } else { \
+ d->m_huff_count[2][18] = (mz_uint16)(d->m_huff_count[2][18] + 1); \
+ packed_code_sizes[num_packed_code_sizes++] = 18; \
+ packed_code_sizes[num_packed_code_sizes++] = \
+ (mz_uint8)(rle_z_count - 11); \
+ } \
+ rle_z_count = 0; \
+ } \
+ }
+
+static mz_uint8 s_tdefl_packed_code_size_syms_swizzle[] = {
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+static void tdefl_start_dynamic_block(tdefl_compressor *d) {
+ int num_lit_codes, num_dist_codes, num_bit_lengths;
+ mz_uint i, total_code_sizes_to_pack, num_packed_code_sizes, rle_z_count,
+ rle_repeat_count, packed_code_sizes_index;
+ mz_uint8
+ code_sizes_to_pack[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1],
+ packed_code_sizes[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1],
+ prev_code_size = 0xFF;
+
+ d->m_huff_count[0][256] = 1;
+
+ tdefl_optimize_huffman_table(d, 0, TDEFL_MAX_HUFF_SYMBOLS_0, 15, MZ_FALSE);
+ tdefl_optimize_huffman_table(d, 1, TDEFL_MAX_HUFF_SYMBOLS_1, 15, MZ_FALSE);
+
+ for (num_lit_codes = 286; num_lit_codes > 257; num_lit_codes--)
+ if (d->m_huff_code_sizes[0][num_lit_codes - 1]) break;
+ for (num_dist_codes = 30; num_dist_codes > 1; num_dist_codes--)
+ if (d->m_huff_code_sizes[1][num_dist_codes - 1]) break;
+
+ memcpy(code_sizes_to_pack, &d->m_huff_code_sizes[0][0], num_lit_codes);
+ memcpy(code_sizes_to_pack + num_lit_codes, &d->m_huff_code_sizes[1][0],
+ num_dist_codes);
+ total_code_sizes_to_pack = num_lit_codes + num_dist_codes;
+ num_packed_code_sizes = 0;
+ rle_z_count = 0;
+ rle_repeat_count = 0;
+
+ memset(&d->m_huff_count[2][0], 0,
+ sizeof(d->m_huff_count[2][0]) * TDEFL_MAX_HUFF_SYMBOLS_2);
+ for (i = 0; i < total_code_sizes_to_pack; i++) {
+ mz_uint8 code_size = code_sizes_to_pack[i];
+ if (!code_size) {
+ TDEFL_RLE_PREV_CODE_SIZE();
+ if (++rle_z_count == 138) {
+ TDEFL_RLE_ZERO_CODE_SIZE();
+ }
+ } else {
+ TDEFL_RLE_ZERO_CODE_SIZE();
+ if (code_size != prev_code_size) {
+ TDEFL_RLE_PREV_CODE_SIZE();
+ d->m_huff_count[2][code_size] =
+ (mz_uint16)(d->m_huff_count[2][code_size] + 1);
+ packed_code_sizes[num_packed_code_sizes++] = code_size;
+ } else if (++rle_repeat_count == 6) {
+ TDEFL_RLE_PREV_CODE_SIZE();
+ }
+ }
+ prev_code_size = code_size;
+ }
+ if (rle_repeat_count) {
+ TDEFL_RLE_PREV_CODE_SIZE();
+ } else {
+ TDEFL_RLE_ZERO_CODE_SIZE();
+ }
+
+ tdefl_optimize_huffman_table(d, 2, TDEFL_MAX_HUFF_SYMBOLS_2, 7, MZ_FALSE);
+
+ TDEFL_PUT_BITS(2, 2);
+
+ TDEFL_PUT_BITS(num_lit_codes - 257, 5);
+ TDEFL_PUT_BITS(num_dist_codes - 1, 5);
+
+ for (num_bit_lengths = 18; num_bit_lengths >= 0; num_bit_lengths--)
+ if (d->m_huff_code_sizes
+ [2][s_tdefl_packed_code_size_syms_swizzle[num_bit_lengths]])
+ break;
+ num_bit_lengths = MZ_MAX(4, (num_bit_lengths + 1));
+ TDEFL_PUT_BITS(num_bit_lengths - 4, 4);
+ for (i = 0; (int)i < num_bit_lengths; i++)
+ TDEFL_PUT_BITS(
+ d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[i]], 3);
+
+ for (packed_code_sizes_index = 0;
+ packed_code_sizes_index < num_packed_code_sizes;) {
+ mz_uint code = packed_code_sizes[packed_code_sizes_index++];
+ MZ_ASSERT(code < TDEFL_MAX_HUFF_SYMBOLS_2);
+ TDEFL_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]);
+ if (code >= 16)
+ TDEFL_PUT_BITS(packed_code_sizes[packed_code_sizes_index++],
+ "\02\03\07"[code - 16]);
+ }
+}
+
+static void tdefl_start_static_block(tdefl_compressor *d) {
+ mz_uint i;
+ mz_uint8 *p = &d->m_huff_code_sizes[0][0];
+
+ for (i = 0; i <= 143; ++i) *p++ = 8;
+ for (; i <= 255; ++i) *p++ = 9;
+ for (; i <= 279; ++i) *p++ = 7;
+ for (; i <= 287; ++i) *p++ = 8;
+
+ memset(d->m_huff_code_sizes[1], 5, 32);
+
+ tdefl_optimize_huffman_table(d, 0, 288, 15, MZ_TRUE);
+ tdefl_optimize_huffman_table(d, 1, 32, 15, MZ_TRUE);
+
+ TDEFL_PUT_BITS(1, 2);
+}
+
+static const mz_uint mz_bitmasks[17] = {
+ 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF,
+ 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF};
+
+#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN && \
+ MINIZ_HAS_64BIT_REGISTERS
+static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d) {
+ mz_uint flags;
+ mz_uint8 *pLZ_codes;
+ mz_uint8 *pOutput_buf = d->m_pOutput_buf;
+ mz_uint8 *pLZ_code_buf_end = d->m_pLZ_code_buf;
+ mz_uint64 bit_buffer = d->m_bit_buffer;
+ mz_uint bits_in = d->m_bits_in;
+
+#define TDEFL_PUT_BITS_FAST(b, l) \
+ { \
+ bit_buffer |= (((mz_uint64)(b)) << bits_in); \
+ bits_in += (l); \
+ }
+
+ flags = 1;
+ for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < pLZ_code_buf_end;
+ flags >>= 1) {
+ if (flags == 1) flags = *pLZ_codes++ | 0x100;
+
+ if (flags & 1) {
+ mz_uint s0, s1, n0, n1, sym, num_extra_bits;
+ mz_uint match_len = pLZ_codes[0],
+ match_dist = *(const mz_uint16 *)(pLZ_codes + 1);
+ pLZ_codes += 3;
+
+ MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
+ TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][s_tdefl_len_sym[match_len]],
+ d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
+ TDEFL_PUT_BITS_FAST(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]],
+ s_tdefl_len_extra[match_len]);
+
+ // This sequence coaxes MSVC into using cmov's vs. jmp's.
+ s0 = s_tdefl_small_dist_sym[match_dist & 511];
+ n0 = s_tdefl_small_dist_extra[match_dist & 511];
+ s1 = s_tdefl_large_dist_sym[match_dist >> 8];
+ n1 = s_tdefl_large_dist_extra[match_dist >> 8];
+ sym = (match_dist < 512) ? s0 : s1;
+ num_extra_bits = (match_dist < 512) ? n0 : n1;
+
+ MZ_ASSERT(d->m_huff_code_sizes[1][sym]);
+ TDEFL_PUT_BITS_FAST(d->m_huff_codes[1][sym],
+ d->m_huff_code_sizes[1][sym]);
+ TDEFL_PUT_BITS_FAST(match_dist & mz_bitmasks[num_extra_bits],
+ num_extra_bits);
+ } else {
+ mz_uint lit = *pLZ_codes++;
+ MZ_ASSERT(d->m_huff_code_sizes[0][lit]);
+ TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit],
+ d->m_huff_code_sizes[0][lit]);
+
+ if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end)) {
+ flags >>= 1;
+ lit = *pLZ_codes++;
+ MZ_ASSERT(d->m_huff_code_sizes[0][lit]);
+ TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit],
+ d->m_huff_code_sizes[0][lit]);
+
+ if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end)) {
+ flags >>= 1;
+ lit = *pLZ_codes++;
+ MZ_ASSERT(d->m_huff_code_sizes[0][lit]);
+ TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit],
+ d->m_huff_code_sizes[0][lit]);
+ }
+ }
+ }
+
+ if (pOutput_buf >= d->m_pOutput_buf_end) return MZ_FALSE;
+
+ *(mz_uint64 *)pOutput_buf = bit_buffer;
+ pOutput_buf += (bits_in >> 3);
+ bit_buffer >>= (bits_in & ~7);
+ bits_in &= 7;
+ }
+
+#undef TDEFL_PUT_BITS_FAST
+
+ d->m_pOutput_buf = pOutput_buf;
+ d->m_bits_in = 0;
+ d->m_bit_buffer = 0;
+
+ while (bits_in) {
+ mz_uint32 n = MZ_MIN(bits_in, 16);
+ TDEFL_PUT_BITS((mz_uint)bit_buffer & mz_bitmasks[n], n);
+ bit_buffer >>= n;
+ bits_in -= n;
+ }
+
+ TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]);
+
+ return (d->m_pOutput_buf < d->m_pOutput_buf_end);
+}
+#else
+static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d) {
+ mz_uint flags;
+ mz_uint8 *pLZ_codes;
+
+ flags = 1;
+ for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < d->m_pLZ_code_buf;
+ flags >>= 1) {
+ if (flags == 1) flags = *pLZ_codes++ | 0x100;
+ if (flags & 1) {
+ mz_uint sym, num_extra_bits;
+ mz_uint match_len = pLZ_codes[0],
+ match_dist = (pLZ_codes[1] | (pLZ_codes[2] << 8));
+ pLZ_codes += 3;
+
+ MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
+ TDEFL_PUT_BITS(d->m_huff_codes[0][s_tdefl_len_sym[match_len]],
+ d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
+ TDEFL_PUT_BITS(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]],
+ s_tdefl_len_extra[match_len]);
+
+ if (match_dist < 512) {
+ sym = s_tdefl_small_dist_sym[match_dist];
+ num_extra_bits = s_tdefl_small_dist_extra[match_dist];
+ } else {
+ sym = s_tdefl_large_dist_sym[match_dist >> 8];
+ num_extra_bits = s_tdefl_large_dist_extra[match_dist >> 8];
+ }
+ MZ_ASSERT(d->m_huff_code_sizes[1][sym]);
+ TDEFL_PUT_BITS(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]);
+ TDEFL_PUT_BITS(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits);
+ } else {
+ mz_uint lit = *pLZ_codes++;
+ MZ_ASSERT(d->m_huff_code_sizes[0][lit]);
+ TDEFL_PUT_BITS(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]);
+ }
+ }
+
+ TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]);
+
+ return (d->m_pOutput_buf < d->m_pOutput_buf_end);
+}
+#endif // MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN &&
+ // MINIZ_HAS_64BIT_REGISTERS
+
+static mz_bool tdefl_compress_block(tdefl_compressor *d, mz_bool static_block) {
+ if (static_block)
+ tdefl_start_static_block(d);
+ else
+ tdefl_start_dynamic_block(d);
+ return tdefl_compress_lz_codes(d);
+}
+
+static int tdefl_flush_block(tdefl_compressor *d, int flush) {
+ mz_uint saved_bit_buf, saved_bits_in;
+ mz_uint8 *pSaved_output_buf;
+ mz_bool comp_block_succeeded = MZ_FALSE;
+ int n, use_raw_block =
+ ((d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS) != 0) &&
+ (d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size;
+ mz_uint8 *pOutput_buf_start =
+ ((d->m_pPut_buf_func == NULL) &&
+ ((*d->m_pOut_buf_size - d->m_out_buf_ofs) >= TDEFL_OUT_BUF_SIZE))
+ ? ((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs)
+ : d->m_output_buf;
+
+ d->m_pOutput_buf = pOutput_buf_start;
+ d->m_pOutput_buf_end = d->m_pOutput_buf + TDEFL_OUT_BUF_SIZE - 16;
+
+ MZ_ASSERT(!d->m_output_flush_remaining);
+ d->m_output_flush_ofs = 0;
+ d->m_output_flush_remaining = 0;
+
+ *d->m_pLZ_flags = (mz_uint8)(*d->m_pLZ_flags >> d->m_num_flags_left);
+ d->m_pLZ_code_buf -= (d->m_num_flags_left == 8);
+
+ if ((d->m_flags & TDEFL_WRITE_ZLIB_HEADER) && (!d->m_block_index)) {
+ TDEFL_PUT_BITS(0x78, 8);
+ TDEFL_PUT_BITS(0x01, 8);
+ }
+
+ TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1);
+
+ pSaved_output_buf = d->m_pOutput_buf;
+ saved_bit_buf = d->m_bit_buffer;
+ saved_bits_in = d->m_bits_in;
+
+ if (!use_raw_block)
+ comp_block_succeeded =
+ tdefl_compress_block(d, (d->m_flags & TDEFL_FORCE_ALL_STATIC_BLOCKS) ||
+ (d->m_total_lz_bytes < 48));
+
+ // If the block gets expanded, forget the current contents of the output
+ // buffer and send a raw block instead.
+ if (((use_raw_block) ||
+ ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >=
+ d->m_total_lz_bytes))) &&
+ ((d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size)) {
+ mz_uint i;
+ d->m_pOutput_buf = pSaved_output_buf;
+ d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in;
+ TDEFL_PUT_BITS(0, 2);
+ if (d->m_bits_in) {
+ TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
+ }
+ for (i = 2; i; --i, d->m_total_lz_bytes ^= 0xFFFF) {
+ TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16);
+ }
+ for (i = 0; i < d->m_total_lz_bytes; ++i) {
+ TDEFL_PUT_BITS(
+ d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK],
+ 8);
+ }
+ }
+ // Check for the extremely unlikely (if not impossible) case of the compressed
+ // block not fitting into the output buffer when using dynamic codes.
+ else if (!comp_block_succeeded) {
+ d->m_pOutput_buf = pSaved_output_buf;
+ d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in;
+ tdefl_compress_block(d, MZ_TRUE);
+ }
+
+ if (flush) {
+ if (flush == TDEFL_FINISH) {
+ if (d->m_bits_in) {
+ TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
+ }
+ if (d->m_flags & TDEFL_WRITE_ZLIB_HEADER) {
+ mz_uint i, a = d->m_adler32;
+ for (i = 0; i < 4; i++) {
+ TDEFL_PUT_BITS((a >> 24) & 0xFF, 8);
+ a <<= 8;
+ }
+ }
+ } else {
+ mz_uint i, z = 0;
+ TDEFL_PUT_BITS(0, 3);
+ if (d->m_bits_in) {
+ TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
+ }
+ for (i = 2; i; --i, z ^= 0xFFFF) {
+ TDEFL_PUT_BITS(z & 0xFFFF, 16);
+ }
+ }
+ }
+
+ MZ_ASSERT(d->m_pOutput_buf < d->m_pOutput_buf_end);
+
+ memset(&d->m_huff_count[0][0], 0,
+ sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0);
+ memset(&d->m_huff_count[1][0], 0,
+ sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1);
+
+ d->m_pLZ_code_buf = d->m_lz_code_buf + 1;
+ d->m_pLZ_flags = d->m_lz_code_buf;
+ d->m_num_flags_left = 8;
+ d->m_lz_code_buf_dict_pos += d->m_total_lz_bytes;
+ d->m_total_lz_bytes = 0;
+ d->m_block_index++;
+
+ if ((n = (int)(d->m_pOutput_buf - pOutput_buf_start)) != 0) {
+ if (d->m_pPut_buf_func) {
+ *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf;
+ if (!(*d->m_pPut_buf_func)(d->m_output_buf, n, d->m_pPut_buf_user))
+ return (d->m_prev_return_status = TDEFL_STATUS_PUT_BUF_FAILED);
+ } else if (pOutput_buf_start == d->m_output_buf) {
+ int bytes_to_copy = (int)MZ_MIN(
+ (size_t)n, (size_t)(*d->m_pOut_buf_size - d->m_out_buf_ofs));
+ memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf,
+ bytes_to_copy);
+ d->m_out_buf_ofs += bytes_to_copy;
+ if ((n -= bytes_to_copy) != 0) {
+ d->m_output_flush_ofs = bytes_to_copy;
+ d->m_output_flush_remaining = n;
+ }
+ } else {
+ d->m_out_buf_ofs += n;
+ }
+ }
+
+ return d->m_output_flush_remaining;
+}
+
+#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES
+#define TDEFL_READ_UNALIGNED_WORD(p) *(const mz_uint16 *)(p)
+static MZ_FORCEINLINE void tdefl_find_match(
+ tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist,
+ mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len) {
+ mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK,
+ match_len = *pMatch_len, probe_pos = pos, next_probe_pos,
+ probe_len;
+ mz_uint num_probes_left = d->m_max_probes[match_len >= 32];
+ const mz_uint16 *s = (const mz_uint16 *)(d->m_dict + pos), *p, *q;
+ mz_uint16 c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]),
+ s01 = TDEFL_READ_UNALIGNED_WORD(s);
+ MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN);
+ if (max_match_len <= match_len) return;
+ for (;;) {
+ for (;;) {
+ if (--num_probes_left == 0) return;
+#define TDEFL_PROBE \
+ next_probe_pos = d->m_next[probe_pos]; \
+ if ((!next_probe_pos) || \
+ ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) \
+ return; \
+ probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \
+ if (TDEFL_READ_UNALIGNED_WORD(&d->m_dict[probe_pos + match_len - 1]) == c01) \
+ break;
+ TDEFL_PROBE;
+ TDEFL_PROBE;
+ TDEFL_PROBE;
+ }
+ if (!dist) break;
+ q = (const mz_uint16 *)(d->m_dict + probe_pos);
+ if (TDEFL_READ_UNALIGNED_WORD(q) != s01) continue;
+ p = s;
+ probe_len = 32;
+ do {
+ } while (
+ (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) &&
+ (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) &&
+ (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) &&
+ (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) &&
+ (--probe_len > 0));
+ if (!probe_len) {
+ *pMatch_dist = dist;
+ *pMatch_len = MZ_MIN(max_match_len, TDEFL_MAX_MATCH_LEN);
+ break;
+ } else if ((probe_len = ((mz_uint)(p - s) * 2) +
+ (mz_uint)(*(const mz_uint8 *)p ==
+ *(const mz_uint8 *)q)) > match_len) {
+ *pMatch_dist = dist;
+ if ((*pMatch_len = match_len = MZ_MIN(max_match_len, probe_len)) ==
+ max_match_len)
+ break;
+ c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]);
+ }
+ }
+}
+#else
+static MZ_FORCEINLINE void tdefl_find_match(
+ tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist,
+ mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len) {
+ mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK,
+ match_len = *pMatch_len, probe_pos = pos, next_probe_pos,
+ probe_len;
+ mz_uint num_probes_left = d->m_max_probes[match_len >= 32];
+ const mz_uint8 *s = d->m_dict + pos, *p, *q;
+ mz_uint8 c0 = d->m_dict[pos + match_len], c1 = d->m_dict[pos + match_len - 1];
+ MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN);
+ if (max_match_len <= match_len) return;
+ for (;;) {
+ for (;;) {
+ if (--num_probes_left == 0) return;
+#define TDEFL_PROBE \
+ next_probe_pos = d->m_next[probe_pos]; \
+ if ((!next_probe_pos) || \
+ ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) \
+ return; \
+ probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \
+ if ((d->m_dict[probe_pos + match_len] == c0) && \
+ (d->m_dict[probe_pos + match_len - 1] == c1)) \
+ break;
+ TDEFL_PROBE;
+ TDEFL_PROBE;
+ TDEFL_PROBE;
+ }
+ if (!dist) break;
+ p = s;
+ q = d->m_dict + probe_pos;
+ for (probe_len = 0; probe_len < max_match_len; probe_len++)
+ if (*p++ != *q++) break;
+ if (probe_len > match_len) {
+ *pMatch_dist = dist;
+ if ((*pMatch_len = match_len = probe_len) == max_match_len) return;
+ c0 = d->m_dict[pos + match_len];
+ c1 = d->m_dict[pos + match_len - 1];
+ }
+ }
+}
+#endif // #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES
+
+#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN
+static mz_bool tdefl_compress_fast(tdefl_compressor *d) {
+ // Faster, minimally featured LZRW1-style match+parse loop with better
+ // register utilization. Intended for applications where raw throughput is
+ // valued more highly than ratio.
+ mz_uint lookahead_pos = d->m_lookahead_pos,
+ lookahead_size = d->m_lookahead_size, dict_size = d->m_dict_size,
+ total_lz_bytes = d->m_total_lz_bytes,
+ num_flags_left = d->m_num_flags_left;
+ mz_uint8 *pLZ_code_buf = d->m_pLZ_code_buf, *pLZ_flags = d->m_pLZ_flags;
+ mz_uint cur_pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK;
+
+ while ((d->m_src_buf_left) || ((d->m_flush) && (lookahead_size))) {
+ const mz_uint TDEFL_COMP_FAST_LOOKAHEAD_SIZE = 4096;
+ mz_uint dst_pos =
+ (lookahead_pos + lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK;
+ mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(
+ d->m_src_buf_left, TDEFL_COMP_FAST_LOOKAHEAD_SIZE - lookahead_size);
+ d->m_src_buf_left -= num_bytes_to_process;
+ lookahead_size += num_bytes_to_process;
+
+ while (num_bytes_to_process) {
+ mz_uint32 n = MZ_MIN(TDEFL_LZ_DICT_SIZE - dst_pos, num_bytes_to_process);
+ memcpy(d->m_dict + dst_pos, d->m_pSrc, n);
+ if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
+ memcpy(d->m_dict + TDEFL_LZ_DICT_SIZE + dst_pos, d->m_pSrc,
+ MZ_MIN(n, (TDEFL_MAX_MATCH_LEN - 1) - dst_pos));
+ d->m_pSrc += n;
+ dst_pos = (dst_pos + n) & TDEFL_LZ_DICT_SIZE_MASK;
+ num_bytes_to_process -= n;
+ }
+
+ dict_size = MZ_MIN(TDEFL_LZ_DICT_SIZE - lookahead_size, dict_size);
+ if ((!d->m_flush) && (lookahead_size < TDEFL_COMP_FAST_LOOKAHEAD_SIZE))
+ break;
+
+ while (lookahead_size >= 4) {
+ mz_uint cur_match_dist, cur_match_len = 1;
+ mz_uint8 *pCur_dict = d->m_dict + cur_pos;
+ mz_uint first_trigram = (*(const mz_uint32 *)pCur_dict) & 0xFFFFFF;
+ mz_uint hash =
+ (first_trigram ^ (first_trigram >> (24 - (TDEFL_LZ_HASH_BITS - 8)))) &
+ TDEFL_LEVEL1_HASH_SIZE_MASK;
+ mz_uint probe_pos = d->m_hash[hash];
+ d->m_hash[hash] = (mz_uint16)lookahead_pos;
+
+ if (((cur_match_dist = (mz_uint16)(lookahead_pos - probe_pos)) <=
+ dict_size) &&
+ ((*(const mz_uint32 *)(d->m_dict +
+ (probe_pos &= TDEFL_LZ_DICT_SIZE_MASK)) &
+ 0xFFFFFF) == first_trigram)) {
+ const mz_uint16 *p = (const mz_uint16 *)pCur_dict;
+ const mz_uint16 *q = (const mz_uint16 *)(d->m_dict + probe_pos);
+ mz_uint32 probe_len = 32;
+ do {
+ } while ((TDEFL_READ_UNALIGNED_WORD(++p) ==
+ TDEFL_READ_UNALIGNED_WORD(++q)) &&
+ (TDEFL_READ_UNALIGNED_WORD(++p) ==
+ TDEFL_READ_UNALIGNED_WORD(++q)) &&
+ (TDEFL_READ_UNALIGNED_WORD(++p) ==
+ TDEFL_READ_UNALIGNED_WORD(++q)) &&
+ (TDEFL_READ_UNALIGNED_WORD(++p) ==
+ TDEFL_READ_UNALIGNED_WORD(++q)) &&
+ (--probe_len > 0));
+ cur_match_len = ((mz_uint)(p - (const mz_uint16 *)pCur_dict) * 2) +
+ (mz_uint)(*(const mz_uint8 *)p == *(const mz_uint8 *)q);
+ if (!probe_len)
+ cur_match_len = cur_match_dist ? TDEFL_MAX_MATCH_LEN : 0;
+
+ if ((cur_match_len < TDEFL_MIN_MATCH_LEN) ||
+ ((cur_match_len == TDEFL_MIN_MATCH_LEN) &&
+ (cur_match_dist >= 8U * 1024U))) {
+ cur_match_len = 1;
+ *pLZ_code_buf++ = (mz_uint8)first_trigram;
+ *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1);
+ d->m_huff_count[0][(mz_uint8)first_trigram]++;
+ } else {
+ mz_uint32 s0, s1;
+ cur_match_len = MZ_MIN(cur_match_len, lookahead_size);
+
+ MZ_ASSERT((cur_match_len >= TDEFL_MIN_MATCH_LEN) &&
+ (cur_match_dist >= 1) &&
+ (cur_match_dist <= TDEFL_LZ_DICT_SIZE));
+
+ cur_match_dist--;
+
+ pLZ_code_buf[0] = (mz_uint8)(cur_match_len - TDEFL_MIN_MATCH_LEN);
+ *(mz_uint16 *)(&pLZ_code_buf[1]) = (mz_uint16)cur_match_dist;
+ pLZ_code_buf += 3;
+ *pLZ_flags = (mz_uint8)((*pLZ_flags >> 1) | 0x80);
+
+ s0 = s_tdefl_small_dist_sym[cur_match_dist & 511];
+ s1 = s_tdefl_large_dist_sym[cur_match_dist >> 8];
+ d->m_huff_count[1][(cur_match_dist < 512) ? s0 : s1]++;
+
+ d->m_huff_count[0][s_tdefl_len_sym[cur_match_len -
+ TDEFL_MIN_MATCH_LEN]]++;
+ }
+ } else {
+ *pLZ_code_buf++ = (mz_uint8)first_trigram;
+ *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1);
+ d->m_huff_count[0][(mz_uint8)first_trigram]++;
+ }
+
+ if (--num_flags_left == 0) {
+ num_flags_left = 8;
+ pLZ_flags = pLZ_code_buf++;
+ }
+
+ total_lz_bytes += cur_match_len;
+ lookahead_pos += cur_match_len;
+ dict_size = MZ_MIN(dict_size + cur_match_len, TDEFL_LZ_DICT_SIZE);
+ cur_pos = (cur_pos + cur_match_len) & TDEFL_LZ_DICT_SIZE_MASK;
+ MZ_ASSERT(lookahead_size >= cur_match_len);
+ lookahead_size -= cur_match_len;
+
+ if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) {
+ int n;
+ d->m_lookahead_pos = lookahead_pos;
+ d->m_lookahead_size = lookahead_size;
+ d->m_dict_size = dict_size;
+ d->m_total_lz_bytes = total_lz_bytes;
+ d->m_pLZ_code_buf = pLZ_code_buf;
+ d->m_pLZ_flags = pLZ_flags;
+ d->m_num_flags_left = num_flags_left;
+ if ((n = tdefl_flush_block(d, 0)) != 0)
+ return (n < 0) ? MZ_FALSE : MZ_TRUE;
+ total_lz_bytes = d->m_total_lz_bytes;
+ pLZ_code_buf = d->m_pLZ_code_buf;
+ pLZ_flags = d->m_pLZ_flags;
+ num_flags_left = d->m_num_flags_left;
+ }
+ }
+
+ while (lookahead_size) {
+ mz_uint8 lit = d->m_dict[cur_pos];
+
+ total_lz_bytes++;
+ *pLZ_code_buf++ = lit;
+ *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1);
+ if (--num_flags_left == 0) {
+ num_flags_left = 8;
+ pLZ_flags = pLZ_code_buf++;
+ }
+
+ d->m_huff_count[0][lit]++;
+
+ lookahead_pos++;
+ dict_size = MZ_MIN(dict_size + 1, TDEFL_LZ_DICT_SIZE);
+ cur_pos = (cur_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK;
+ lookahead_size--;
+
+ if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) {
+ int n;
+ d->m_lookahead_pos = lookahead_pos;
+ d->m_lookahead_size = lookahead_size;
+ d->m_dict_size = dict_size;
+ d->m_total_lz_bytes = total_lz_bytes;
+ d->m_pLZ_code_buf = pLZ_code_buf;
+ d->m_pLZ_flags = pLZ_flags;
+ d->m_num_flags_left = num_flags_left;
+ if ((n = tdefl_flush_block(d, 0)) != 0)
+ return (n < 0) ? MZ_FALSE : MZ_TRUE;
+ total_lz_bytes = d->m_total_lz_bytes;
+ pLZ_code_buf = d->m_pLZ_code_buf;
+ pLZ_flags = d->m_pLZ_flags;
+ num_flags_left = d->m_num_flags_left;
+ }
+ }
+ }
+
+ d->m_lookahead_pos = lookahead_pos;
+ d->m_lookahead_size = lookahead_size;
+ d->m_dict_size = dict_size;
+ d->m_total_lz_bytes = total_lz_bytes;
+ d->m_pLZ_code_buf = pLZ_code_buf;
+ d->m_pLZ_flags = pLZ_flags;
+ d->m_num_flags_left = num_flags_left;
+ return MZ_TRUE;
+}
+#endif // MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN
+
+static MZ_FORCEINLINE void tdefl_record_literal(tdefl_compressor *d,
+ mz_uint8 lit) {
+ d->m_total_lz_bytes++;
+ *d->m_pLZ_code_buf++ = lit;
+ *d->m_pLZ_flags = (mz_uint8)(*d->m_pLZ_flags >> 1);
+ if (--d->m_num_flags_left == 0) {
+ d->m_num_flags_left = 8;
+ d->m_pLZ_flags = d->m_pLZ_code_buf++;
+ }
+ d->m_huff_count[0][lit]++;
+}
+
+static MZ_FORCEINLINE void tdefl_record_match(tdefl_compressor *d,
+ mz_uint match_len,
+ mz_uint match_dist) {
+ mz_uint32 s0, s1;
+
+ MZ_ASSERT((match_len >= TDEFL_MIN_MATCH_LEN) && (match_dist >= 1) &&
+ (match_dist <= TDEFL_LZ_DICT_SIZE));
+
+ d->m_total_lz_bytes += match_len;
+
+ d->m_pLZ_code_buf[0] = (mz_uint8)(match_len - TDEFL_MIN_MATCH_LEN);
+
+ match_dist -= 1;
+ d->m_pLZ_code_buf[1] = (mz_uint8)(match_dist & 0xFF);
+ d->m_pLZ_code_buf[2] = (mz_uint8)(match_dist >> 8);
+ d->m_pLZ_code_buf += 3;
+
+ *d->m_pLZ_flags = (mz_uint8)((*d->m_pLZ_flags >> 1) | 0x80);
+ if (--d->m_num_flags_left == 0) {
+ d->m_num_flags_left = 8;
+ d->m_pLZ_flags = d->m_pLZ_code_buf++;
+ }
+
+ s0 = s_tdefl_small_dist_sym[match_dist & 511];
+ s1 = s_tdefl_large_dist_sym[(match_dist >> 8) & 127];
+ d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++;
+
+ if (match_len >= TDEFL_MIN_MATCH_LEN)
+ d->m_huff_count[0][s_tdefl_len_sym[match_len - TDEFL_MIN_MATCH_LEN]]++;
+}
+
+static mz_bool tdefl_compress_normal(tdefl_compressor *d) {
+ const mz_uint8 *pSrc = d->m_pSrc;
+ size_t src_buf_left = d->m_src_buf_left;
+ tdefl_flush flush = d->m_flush;
+
+ while ((src_buf_left) || ((flush) && (d->m_lookahead_size))) {
+ mz_uint len_to_move, cur_match_dist, cur_match_len, cur_pos;
+ // Update dictionary and hash chains. Keeps the lookahead size equal to
+ // TDEFL_MAX_MATCH_LEN.
+ if ((d->m_lookahead_size + d->m_dict_size) >= (TDEFL_MIN_MATCH_LEN - 1)) {
+ mz_uint dst_pos = (d->m_lookahead_pos + d->m_lookahead_size) &
+ TDEFL_LZ_DICT_SIZE_MASK,
+ ins_pos = d->m_lookahead_pos + d->m_lookahead_size - 2;
+ mz_uint hash = (d->m_dict[ins_pos & TDEFL_LZ_DICT_SIZE_MASK]
+ << TDEFL_LZ_HASH_SHIFT) ^
+ d->m_dict[(ins_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK];
+ mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(
+ src_buf_left, TDEFL_MAX_MATCH_LEN - d->m_lookahead_size);
+ const mz_uint8 *pSrc_end = pSrc + num_bytes_to_process;
+ src_buf_left -= num_bytes_to_process;
+ d->m_lookahead_size += num_bytes_to_process;
+ while (pSrc != pSrc_end) {
+ mz_uint8 c = *pSrc++;
+ d->m_dict[dst_pos] = c;
+ if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
+ d->m_dict[TDEFL_LZ_DICT_SIZE + dst_pos] = c;
+ hash = ((hash << TDEFL_LZ_HASH_SHIFT) ^ c) & (TDEFL_LZ_HASH_SIZE - 1);
+ d->m_next[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] = d->m_hash[hash];
+ d->m_hash[hash] = (mz_uint16)(ins_pos);
+ dst_pos = (dst_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK;
+ ins_pos++;
+ }
+ } else {
+ while ((src_buf_left) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN)) {
+ mz_uint8 c = *pSrc++;
+ mz_uint dst_pos = (d->m_lookahead_pos + d->m_lookahead_size) &
+ TDEFL_LZ_DICT_SIZE_MASK;
+ src_buf_left--;
+ d->m_dict[dst_pos] = c;
+ if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
+ d->m_dict[TDEFL_LZ_DICT_SIZE + dst_pos] = c;
+ if ((++d->m_lookahead_size + d->m_dict_size) >= TDEFL_MIN_MATCH_LEN) {
+ mz_uint ins_pos = d->m_lookahead_pos + (d->m_lookahead_size - 1) - 2;
+ mz_uint hash = ((d->m_dict[ins_pos & TDEFL_LZ_DICT_SIZE_MASK]
+ << (TDEFL_LZ_HASH_SHIFT * 2)) ^
+ (d->m_dict[(ins_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK]
+ << TDEFL_LZ_HASH_SHIFT) ^
+ c) &
+ (TDEFL_LZ_HASH_SIZE - 1);
+ d->m_next[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] = d->m_hash[hash];
+ d->m_hash[hash] = (mz_uint16)(ins_pos);
+ }
+ }
+ }
+ d->m_dict_size =
+ MZ_MIN(TDEFL_LZ_DICT_SIZE - d->m_lookahead_size, d->m_dict_size);
+ if ((!flush) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN)) break;
+
+ // Simple lazy/greedy parsing state machine.
+ len_to_move = 1;
+ cur_match_dist = 0;
+ cur_match_len =
+ d->m_saved_match_len ? d->m_saved_match_len : (TDEFL_MIN_MATCH_LEN - 1);
+ cur_pos = d->m_lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK;
+ if (d->m_flags & (TDEFL_RLE_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS)) {
+ if ((d->m_dict_size) && (!(d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS))) {
+ mz_uint8 c = d->m_dict[(cur_pos - 1) & TDEFL_LZ_DICT_SIZE_MASK];
+ cur_match_len = 0;
+ while (cur_match_len < d->m_lookahead_size) {
+ if (d->m_dict[cur_pos + cur_match_len] != c) break;
+ cur_match_len++;
+ }
+ if (cur_match_len < TDEFL_MIN_MATCH_LEN)
+ cur_match_len = 0;
+ else
+ cur_match_dist = 1;
+ }
+ } else {
+ tdefl_find_match(d, d->m_lookahead_pos, d->m_dict_size,
+ d->m_lookahead_size, &cur_match_dist, &cur_match_len);
+ }
+ if (((cur_match_len == TDEFL_MIN_MATCH_LEN) &&
+ (cur_match_dist >= 8U * 1024U)) ||
+ (cur_pos == cur_match_dist) ||
+ ((d->m_flags & TDEFL_FILTER_MATCHES) && (cur_match_len <= 5))) {
+ cur_match_dist = cur_match_len = 0;
+ }
+ if (d->m_saved_match_len) {
+ if (cur_match_len > d->m_saved_match_len) {
+ tdefl_record_literal(d, (mz_uint8)d->m_saved_lit);
+ if (cur_match_len >= 128) {
+ tdefl_record_match(d, cur_match_len, cur_match_dist);
+ d->m_saved_match_len = 0;
+ len_to_move = cur_match_len;
+ } else {
+ d->m_saved_lit = d->m_dict[cur_pos];
+ d->m_saved_match_dist = cur_match_dist;
+ d->m_saved_match_len = cur_match_len;
+ }
+ } else {
+ tdefl_record_match(d, d->m_saved_match_len, d->m_saved_match_dist);
+ len_to_move = d->m_saved_match_len - 1;
+ d->m_saved_match_len = 0;
+ }
+ } else if (!cur_match_dist)
+ tdefl_record_literal(d,
+ d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)]);
+ else if ((d->m_greedy_parsing) || (d->m_flags & TDEFL_RLE_MATCHES) ||
+ (cur_match_len >= 128)) {
+ tdefl_record_match(d, cur_match_len, cur_match_dist);
+ len_to_move = cur_match_len;
+ } else {
+ d->m_saved_lit = d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)];
+ d->m_saved_match_dist = cur_match_dist;
+ d->m_saved_match_len = cur_match_len;
+ }
+ // Move the lookahead forward by len_to_move bytes.
+ d->m_lookahead_pos += len_to_move;
+ MZ_ASSERT(d->m_lookahead_size >= len_to_move);
+ d->m_lookahead_size -= len_to_move;
+ d->m_dict_size =
+ MZ_MIN(d->m_dict_size + len_to_move, (mz_uint)TDEFL_LZ_DICT_SIZE);
+ // Check if it's time to flush the current LZ codes to the internal output
+ // buffer.
+ if ((d->m_pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) ||
+ ((d->m_total_lz_bytes > 31 * 1024) &&
+ (((((mz_uint)(d->m_pLZ_code_buf - d->m_lz_code_buf) * 115) >> 7) >=
+ d->m_total_lz_bytes) ||
+ (d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS)))) {
+ int n;
+ d->m_pSrc = pSrc;
+ d->m_src_buf_left = src_buf_left;
+ if ((n = tdefl_flush_block(d, 0)) != 0)
+ return (n < 0) ? MZ_FALSE : MZ_TRUE;
+ }
+ }
+
+ d->m_pSrc = pSrc;
+ d->m_src_buf_left = src_buf_left;
+ return MZ_TRUE;
+}
+
+static tdefl_status tdefl_flush_output_buffer(tdefl_compressor *d) {
+ if (d->m_pIn_buf_size) {
+ *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf;
+ }
+
+ if (d->m_pOut_buf_size) {
+ size_t n = MZ_MIN(*d->m_pOut_buf_size - d->m_out_buf_ofs,
+ d->m_output_flush_remaining);
+ memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs,
+ d->m_output_buf + d->m_output_flush_ofs, n);
+ d->m_output_flush_ofs += (mz_uint)n;
+ d->m_output_flush_remaining -= (mz_uint)n;
+ d->m_out_buf_ofs += n;
+
+ *d->m_pOut_buf_size = d->m_out_buf_ofs;
+ }
+
+ return (d->m_finished && !d->m_output_flush_remaining) ? TDEFL_STATUS_DONE
+ : TDEFL_STATUS_OKAY;
+}
+
+tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf,
+ size_t *pIn_buf_size, void *pOut_buf,
+ size_t *pOut_buf_size, tdefl_flush flush) {
+ if (!d) {
+ if (pIn_buf_size) *pIn_buf_size = 0;
+ if (pOut_buf_size) *pOut_buf_size = 0;
+ return TDEFL_STATUS_BAD_PARAM;
+ }
+
+ d->m_pIn_buf = pIn_buf;
+ d->m_pIn_buf_size = pIn_buf_size;
+ d->m_pOut_buf = pOut_buf;
+ d->m_pOut_buf_size = pOut_buf_size;
+ d->m_pSrc = (const mz_uint8 *)(pIn_buf);
+ d->m_src_buf_left = pIn_buf_size ? *pIn_buf_size : 0;
+ d->m_out_buf_ofs = 0;
+ d->m_flush = flush;
+
+ if (((d->m_pPut_buf_func != NULL) ==
+ ((pOut_buf != NULL) || (pOut_buf_size != NULL))) ||
+ (d->m_prev_return_status != TDEFL_STATUS_OKAY) ||
+ (d->m_wants_to_finish && (flush != TDEFL_FINISH)) ||
+ (pIn_buf_size && *pIn_buf_size && !pIn_buf) ||
+ (pOut_buf_size && *pOut_buf_size && !pOut_buf)) {
+ if (pIn_buf_size) *pIn_buf_size = 0;
+ if (pOut_buf_size) *pOut_buf_size = 0;
+ return (d->m_prev_return_status = TDEFL_STATUS_BAD_PARAM);
+ }
+ d->m_wants_to_finish |= (flush == TDEFL_FINISH);
+
+ if ((d->m_output_flush_remaining) || (d->m_finished))
+ return (d->m_prev_return_status = tdefl_flush_output_buffer(d));
+
+#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN
+ if (((d->m_flags & TDEFL_MAX_PROBES_MASK) == 1) &&
+ ((d->m_flags & TDEFL_GREEDY_PARSING_FLAG) != 0) &&
+ ((d->m_flags & (TDEFL_FILTER_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS |
+ TDEFL_RLE_MATCHES)) == 0)) {
+ if (!tdefl_compress_fast(d)) return d->m_prev_return_status;
+ } else
+#endif // #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN
+ {
+ if (!tdefl_compress_normal(d)) return d->m_prev_return_status;
+ }
+
+ if ((d->m_flags & (TDEFL_WRITE_ZLIB_HEADER | TDEFL_COMPUTE_ADLER32)) &&
+ (pIn_buf))
+ d->m_adler32 =
+ (mz_uint32)mz_adler32(d->m_adler32, (const mz_uint8 *)pIn_buf,
+ d->m_pSrc - (const mz_uint8 *)pIn_buf);
+
+ if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) &&
+ (!d->m_output_flush_remaining)) {
+ if (tdefl_flush_block(d, flush) < 0) return d->m_prev_return_status;
+ d->m_finished = (flush == TDEFL_FINISH);
+ if (flush == TDEFL_FULL_FLUSH) {
+ MZ_CLEAR_OBJ(d->m_hash);
+ MZ_CLEAR_OBJ(d->m_next);
+ d->m_dict_size = 0;
+ }
+ }
+
+ return (d->m_prev_return_status = tdefl_flush_output_buffer(d));
+}
+
+tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf,
+ size_t in_buf_size, tdefl_flush flush) {
+ MZ_ASSERT(d->m_pPut_buf_func);
+ return tdefl_compress(d, pIn_buf, &in_buf_size, NULL, NULL, flush);
+}
+
+tdefl_status tdefl_init(tdefl_compressor *d,
+ tdefl_put_buf_func_ptr pPut_buf_func,
+ void *pPut_buf_user, int flags) {
+ d->m_pPut_buf_func = pPut_buf_func;
+ d->m_pPut_buf_user = pPut_buf_user;
+ d->m_flags = (mz_uint)(flags);
+ d->m_max_probes[0] = 1 + ((flags & 0xFFF) + 2) / 3;
+ d->m_greedy_parsing = (flags & TDEFL_GREEDY_PARSING_FLAG) != 0;
+ d->m_max_probes[1] = 1 + (((flags & 0xFFF) >> 2) + 2) / 3;
+ if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG)) MZ_CLEAR_OBJ(d->m_hash);
+ d->m_lookahead_pos = d->m_lookahead_size = d->m_dict_size =
+ d->m_total_lz_bytes = d->m_lz_code_buf_dict_pos = d->m_bits_in = 0;
+ d->m_output_flush_ofs = d->m_output_flush_remaining = d->m_finished =
+ d->m_block_index = d->m_bit_buffer = d->m_wants_to_finish = 0;
+ d->m_pLZ_code_buf = d->m_lz_code_buf + 1;
+ d->m_pLZ_flags = d->m_lz_code_buf;
+ d->m_num_flags_left = 8;
+ d->m_pOutput_buf = d->m_output_buf;
+ d->m_pOutput_buf_end = d->m_output_buf;
+ d->m_prev_return_status = TDEFL_STATUS_OKAY;
+ d->m_saved_match_dist = d->m_saved_match_len = d->m_saved_lit = 0;
+ d->m_adler32 = 1;
+ d->m_pIn_buf = NULL;
+ d->m_pOut_buf = NULL;
+ d->m_pIn_buf_size = NULL;
+ d->m_pOut_buf_size = NULL;
+ d->m_flush = TDEFL_NO_FLUSH;
+ d->m_pSrc = NULL;
+ d->m_src_buf_left = 0;
+ d->m_out_buf_ofs = 0;
+ memset(&d->m_huff_count[0][0], 0,
+ sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0);
+ memset(&d->m_huff_count[1][0], 0,
+ sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1);
+ return TDEFL_STATUS_OKAY;
+}
+
+tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d) {
+ return d->m_prev_return_status;
+}
+
+mz_uint32 tdefl_get_adler32(tdefl_compressor *d) { return d->m_adler32; }
+
+mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len,
+ tdefl_put_buf_func_ptr pPut_buf_func,
+ void *pPut_buf_user, int flags) {
+ tdefl_compressor *pComp;
+ mz_bool succeeded;
+ if (((buf_len) && (!pBuf)) || (!pPut_buf_func)) return MZ_FALSE;
+ pComp = (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor));
+ if (!pComp) return MZ_FALSE;
+ succeeded = (tdefl_init(pComp, pPut_buf_func, pPut_buf_user, flags) ==
+ TDEFL_STATUS_OKAY);
+ succeeded =
+ succeeded && (tdefl_compress_buffer(pComp, pBuf, buf_len, TDEFL_FINISH) ==
+ TDEFL_STATUS_DONE);
+ MZ_FREE(pComp);
+ return succeeded;
+}
+
+typedef struct {
+ size_t m_size, m_capacity;
+ mz_uint8 *m_pBuf;
+ mz_bool m_expandable;
+} tdefl_output_buffer;
+
+static mz_bool tdefl_output_buffer_putter(const void *pBuf, int len,
+ void *pUser) {
+ tdefl_output_buffer *p = (tdefl_output_buffer *)pUser;
+ size_t new_size = p->m_size + len;
+ if (new_size > p->m_capacity) {
+ size_t new_capacity = p->m_capacity;
+ mz_uint8 *pNew_buf;
+ if (!p->m_expandable) return MZ_FALSE;
+ do {
+ new_capacity = MZ_MAX(128U, new_capacity << 1U);
+ } while (new_size > new_capacity);
+ pNew_buf = (mz_uint8 *)MZ_REALLOC(p->m_pBuf, new_capacity);
+ if (!pNew_buf) return MZ_FALSE;
+ p->m_pBuf = pNew_buf;
+ p->m_capacity = new_capacity;
+ }
+ memcpy((mz_uint8 *)p->m_pBuf + p->m_size, pBuf, len);
+ p->m_size = new_size;
+ return MZ_TRUE;
+}
+
+void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len,
+ size_t *pOut_len, int flags) {
+ tdefl_output_buffer out_buf;
+ MZ_CLEAR_OBJ(out_buf);
+ if (!pOut_len)
+ return MZ_FALSE;
+ else
+ *pOut_len = 0;
+ out_buf.m_expandable = MZ_TRUE;
+ if (!tdefl_compress_mem_to_output(
+ pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags))
+ return NULL;
+ *pOut_len = out_buf.m_size;
+ return out_buf.m_pBuf;
+}
+
+size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len,
+ const void *pSrc_buf, size_t src_buf_len,
+ int flags) {
+ tdefl_output_buffer out_buf;
+ MZ_CLEAR_OBJ(out_buf);
+ if (!pOut_buf) return 0;
+ out_buf.m_pBuf = (mz_uint8 *)pOut_buf;
+ out_buf.m_capacity = out_buf_len;
+ if (!tdefl_compress_mem_to_output(
+ pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags))
+ return 0;
+ return out_buf.m_size;
+}
+
+#ifndef MINIZ_NO_ZLIB_APIS
+static const mz_uint s_tdefl_num_probes[11] = {0, 1, 6, 32, 16, 32,
+ 128, 256, 512, 768, 1500};
+
+// level may actually range from [0,10] (10 is a "hidden" max level, where we
+// want a bit more compression and it's fine if throughput to fall off a cliff
+// on some files).
+mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits,
+ int strategy) {
+ mz_uint comp_flags =
+ s_tdefl_num_probes[(level >= 0) ? MZ_MIN(10, level) : MZ_DEFAULT_LEVEL] |
+ ((level <= 3) ? TDEFL_GREEDY_PARSING_FLAG : 0);
+ if (window_bits > 0) comp_flags |= TDEFL_WRITE_ZLIB_HEADER;
+
+ if (!level)
+ comp_flags |= TDEFL_FORCE_ALL_RAW_BLOCKS;
+ else if (strategy == MZ_FILTERED)
+ comp_flags |= TDEFL_FILTER_MATCHES;
+ else if (strategy == MZ_HUFFMAN_ONLY)
+ comp_flags &= ~TDEFL_MAX_PROBES_MASK;
+ else if (strategy == MZ_FIXED)
+ comp_flags |= TDEFL_FORCE_ALL_STATIC_BLOCKS;
+ else if (strategy == MZ_RLE)
+ comp_flags |= TDEFL_RLE_MATCHES;
+
+ return comp_flags;
+}
+#endif // MINIZ_NO_ZLIB_APIS
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4204) // nonstandard extension used : non-constant
+ // aggregate initializer (also supported by GNU
+ // C and C99, so no big deal)
+#pragma warning(disable : 4244) // 'initializing': conversion from '__int64' to
+ // 'int', possible loss of data
+#pragma warning( \
+ disable : 4267) // 'argument': conversion from '__int64' to 'int',
+ // possible loss of data
+#pragma warning(disable : 4996) // 'strdup': The POSIX name for this item is
+ // deprecated. Instead, use the ISO C and C++
+ // conformant name: _strdup.
+#endif
+
+// Simple PNG writer function by Alex Evans, 2011. Released into the public
+// domain: https://gist.github.com/908299, more context at
+// http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/.
+// This is actually a modification of Alex's original code so PNG files
+// generated by this function pass pngcheck.
+void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w,
+ int h, int num_chans,
+ size_t *pLen_out,
+ mz_uint level, mz_bool flip) {
+ // Using a local copy of this array here in case MINIZ_NO_ZLIB_APIS was
+ // defined.
+ static const mz_uint s_tdefl_png_num_probes[11] = {
+ 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500};
+ tdefl_compressor *pComp =
+ (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor));
+ tdefl_output_buffer out_buf;
+ int i, bpl = w * num_chans, y, z;
+ mz_uint32 c;
+ *pLen_out = 0;
+ if (!pComp) return NULL;
+ MZ_CLEAR_OBJ(out_buf);
+ out_buf.m_expandable = MZ_TRUE;
+ out_buf.m_capacity = 57 + MZ_MAX(64, (1 + bpl) * h);
+ if (NULL == (out_buf.m_pBuf = (mz_uint8 *)MZ_MALLOC(out_buf.m_capacity))) {
+ MZ_FREE(pComp);
+ return NULL;
+ }
+ // write dummy header
+ for (z = 41; z; --z) tdefl_output_buffer_putter(&z, 1, &out_buf);
+ // compress image data
+ tdefl_init(
+ pComp, tdefl_output_buffer_putter, &out_buf,
+ s_tdefl_png_num_probes[MZ_MIN(10, level)] | TDEFL_WRITE_ZLIB_HEADER);
+ for (y = 0; y < h; ++y) {
+ tdefl_compress_buffer(pComp, &z, 1, TDEFL_NO_FLUSH);
+ tdefl_compress_buffer(pComp,
+ (mz_uint8 *)pImage + (flip ? (h - 1 - y) : y) * bpl,
+ bpl, TDEFL_NO_FLUSH);
+ }
+ if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) !=
+ TDEFL_STATUS_DONE) {
+ MZ_FREE(pComp);
+ MZ_FREE(out_buf.m_pBuf);
+ return NULL;
+ }
+ // write real header
+ *pLen_out = out_buf.m_size - 41;
+ {
+ static const mz_uint8 chans[] = {0x00, 0x00, 0x04, 0x02, 0x06};
+ mz_uint8 pnghdr[41] = {0x89,
+ 0x50,
+ 0x4e,
+ 0x47,
+ 0x0d,
+ 0x0a,
+ 0x1a,
+ 0x0a,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x0d,
+ 0x49,
+ 0x48,
+ 0x44,
+ 0x52,
+ 0,
+ 0,
+ (mz_uint8)(w >> 8),
+ (mz_uint8)w,
+ 0,
+ 0,
+ (mz_uint8)(h >> 8),
+ (mz_uint8)h,
+ 8,
+ chans[num_chans],
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ (mz_uint8)(*pLen_out >> 24),
+ (mz_uint8)(*pLen_out >> 16),
+ (mz_uint8)(*pLen_out >> 8),
+ (mz_uint8)*pLen_out,
+ 0x49,
+ 0x44,
+ 0x41,
+ 0x54};
+ c = (mz_uint32)mz_crc32(MZ_CRC32_INIT, pnghdr + 12, 17);
+ for (i = 0; i < 4; ++i, c <<= 8)
+ ((mz_uint8 *)(pnghdr + 29))[i] = (mz_uint8)(c >> 24);
+ memcpy(out_buf.m_pBuf, pnghdr, 41);
+ }
+ // write footer (IDAT CRC-32, followed by IEND chunk)
+ if (!tdefl_output_buffer_putter(
+ "\0\0\0\0\0\0\0\0\x49\x45\x4e\x44\xae\x42\x60\x82", 16, &out_buf)) {
+ *pLen_out = 0;
+ MZ_FREE(pComp);
+ MZ_FREE(out_buf.m_pBuf);
+ return NULL;
+ }
+ c = (mz_uint32)mz_crc32(MZ_CRC32_INIT, out_buf.m_pBuf + 41 - 4,
+ *pLen_out + 4);
+ for (i = 0; i < 4; ++i, c <<= 8)
+ (out_buf.m_pBuf + out_buf.m_size - 16)[i] = (mz_uint8)(c >> 24);
+ // compute final size of file, grab compressed data buffer and return
+ *pLen_out += 57;
+ MZ_FREE(pComp);
+ return out_buf.m_pBuf;
+}
+void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h,
+ int num_chans, size_t *pLen_out) {
+ // Level 6 corresponds to TDEFL_DEFAULT_MAX_PROBES or MZ_DEFAULT_LEVEL (but we
+ // can't depend on MZ_DEFAULT_LEVEL being available in case the zlib API's
+ // where #defined out)
+ return tdefl_write_image_to_png_file_in_memory_ex(pImage, w, h, num_chans,
+ pLen_out, 6, MZ_FALSE);
+}
+
+// ------------------- .ZIP archive reading
+
+#ifndef MINIZ_NO_ARCHIVE_APIS
+#error "No arvhive APIs"
+
+#ifdef MINIZ_NO_STDIO
+#define MZ_FILE void *
+#else
+#include <stdio.h>
+#include <sys/stat.h>
+
+// -- GODOT change for old MinGW on Travis CI --
+//#if defined(_MSC_VER) || defined(__MINGW64__)
+#if defined(_MSC_VER) || (defined(__MINGW32__) && __MINGW64_VERSION_MAJOR >= 3)
+// -- GODOT end --
+static FILE *mz_fopen(const char *pFilename, const char *pMode) {
+ FILE *pFile = NULL;
+ fopen_s(&pFile, pFilename, pMode);
+ return pFile;
+}
+static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream) {
+ FILE *pFile = NULL;
+ if (freopen_s(&pFile, pPath, pMode, pStream)) return NULL;
+ return pFile;
+}
+#ifndef MINIZ_NO_TIME
+#include <sys/utime.h>
+#endif
+#define MZ_FILE FILE
+#define MZ_FOPEN mz_fopen
+#define MZ_FCLOSE fclose
+#define MZ_FREAD fread
+#define MZ_FWRITE fwrite
+#define MZ_FTELL64 _ftelli64
+#define MZ_FSEEK64 _fseeki64
+#define MZ_FILE_STAT_STRUCT _stat
+#define MZ_FILE_STAT _stat
+#define MZ_FFLUSH fflush
+#define MZ_FREOPEN mz_freopen
+#define MZ_DELETE_FILE remove
+#elif defined(__MINGW32__)
+#ifndef MINIZ_NO_TIME
+#include <sys/utime.h>
+#endif
+#define MZ_FILE FILE
+#define MZ_FOPEN(f, m) fopen(f, m)
+#define MZ_FCLOSE fclose
+#define MZ_FREAD fread
+#define MZ_FWRITE fwrite
+#define MZ_FTELL64 ftello64
+#define MZ_FSEEK64 fseeko64
+#define MZ_FILE_STAT_STRUCT _stat
+#define MZ_FILE_STAT _stat
+#define MZ_FFLUSH fflush
+#define MZ_FREOPEN(f, m, s) freopen(f, m, s)
+#define MZ_DELETE_FILE remove
+#elif defined(__TINYC__)
+#ifndef MINIZ_NO_TIME
+#include <sys/utime.h>
+#endif
+#define MZ_FILE FILE
+#define MZ_FOPEN(f, m) fopen(f, m)
+#define MZ_FCLOSE fclose
+#define MZ_FREAD fread
+#define MZ_FWRITE fwrite
+#define MZ_FTELL64 ftell
+#define MZ_FSEEK64 fseek
+#define MZ_FILE_STAT_STRUCT stat
+#define MZ_FILE_STAT stat
+#define MZ_FFLUSH fflush
+#define MZ_FREOPEN(f, m, s) freopen(f, m, s)
+#define MZ_DELETE_FILE remove
+#elif defined(__GNUC__) && defined(_LARGEFILE64_SOURCE) && _LARGEFILE64_SOURCE
+#ifndef MINIZ_NO_TIME
+#include <utime.h>
+#endif
+#define MZ_FILE FILE
+#define MZ_FOPEN(f, m) fopen64(f, m)
+#define MZ_FCLOSE fclose
+#define MZ_FREAD fread
+#define MZ_FWRITE fwrite
+#define MZ_FTELL64 ftello64
+#define MZ_FSEEK64 fseeko64
+#define MZ_FILE_STAT_STRUCT stat64
+#define MZ_FILE_STAT stat64
+#define MZ_FFLUSH fflush
+#define MZ_FREOPEN(p, m, s) freopen64(p, m, s)
+#define MZ_DELETE_FILE remove
+#else
+#ifndef MINIZ_NO_TIME
+#include <utime.h>
+#endif
+#define MZ_FILE FILE
+#define MZ_FOPEN(f, m) fopen(f, m)
+#define MZ_FCLOSE fclose
+#define MZ_FREAD fread
+#define MZ_FWRITE fwrite
+#define MZ_FTELL64 ftello
+#define MZ_FSEEK64 fseeko
+#define MZ_FILE_STAT_STRUCT stat
+#define MZ_FILE_STAT stat
+#define MZ_FFLUSH fflush
+#define MZ_FREOPEN(f, m, s) freopen(f, m, s)
+#define MZ_DELETE_FILE remove
+#endif // #ifdef _MSC_VER
+#endif // #ifdef MINIZ_NO_STDIO
+
+#define MZ_TOLOWER(c) ((((c) >= 'A') && ((c) <= 'Z')) ? ((c) - 'A' + 'a') : (c))
+
+// Various ZIP archive enums. To completely avoid cross platform compiler
+// alignment and platform endian issues, miniz.c doesn't use structs for any of
+// this stuff.
+enum {
+ // ZIP archive identifiers and record sizes
+ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG = 0x06054b50,
+ MZ_ZIP_CENTRAL_DIR_HEADER_SIG = 0x02014b50,
+ MZ_ZIP_LOCAL_DIR_HEADER_SIG = 0x04034b50,
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE = 30,
+ MZ_ZIP_CENTRAL_DIR_HEADER_SIZE = 46,
+ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE = 22,
+ // Central directory header record offsets
+ MZ_ZIP_CDH_SIG_OFS = 0,
+ MZ_ZIP_CDH_VERSION_MADE_BY_OFS = 4,
+ MZ_ZIP_CDH_VERSION_NEEDED_OFS = 6,
+ MZ_ZIP_CDH_BIT_FLAG_OFS = 8,
+ MZ_ZIP_CDH_METHOD_OFS = 10,
+ MZ_ZIP_CDH_FILE_TIME_OFS = 12,
+ MZ_ZIP_CDH_FILE_DATE_OFS = 14,
+ MZ_ZIP_CDH_CRC32_OFS = 16,
+ MZ_ZIP_CDH_COMPRESSED_SIZE_OFS = 20,
+ MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS = 24,
+ MZ_ZIP_CDH_FILENAME_LEN_OFS = 28,
+ MZ_ZIP_CDH_EXTRA_LEN_OFS = 30,
+ MZ_ZIP_CDH_COMMENT_LEN_OFS = 32,
+ MZ_ZIP_CDH_DISK_START_OFS = 34,
+ MZ_ZIP_CDH_INTERNAL_ATTR_OFS = 36,
+ MZ_ZIP_CDH_EXTERNAL_ATTR_OFS = 38,
+ MZ_ZIP_CDH_LOCAL_HEADER_OFS = 42,
+ // Local directory header offsets
+ MZ_ZIP_LDH_SIG_OFS = 0,
+ MZ_ZIP_LDH_VERSION_NEEDED_OFS = 4,
+ MZ_ZIP_LDH_BIT_FLAG_OFS = 6,
+ MZ_ZIP_LDH_METHOD_OFS = 8,
+ MZ_ZIP_LDH_FILE_TIME_OFS = 10,
+ MZ_ZIP_LDH_FILE_DATE_OFS = 12,
+ MZ_ZIP_LDH_CRC32_OFS = 14,
+ MZ_ZIP_LDH_COMPRESSED_SIZE_OFS = 18,
+ MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS = 22,
+ MZ_ZIP_LDH_FILENAME_LEN_OFS = 26,
+ MZ_ZIP_LDH_EXTRA_LEN_OFS = 28,
+ // End of central directory offsets
+ MZ_ZIP_ECDH_SIG_OFS = 0,
+ MZ_ZIP_ECDH_NUM_THIS_DISK_OFS = 4,
+ MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS = 6,
+ MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS = 8,
+ MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS = 10,
+ MZ_ZIP_ECDH_CDIR_SIZE_OFS = 12,
+ MZ_ZIP_ECDH_CDIR_OFS_OFS = 16,
+ MZ_ZIP_ECDH_COMMENT_SIZE_OFS = 20,
+};
+
+typedef struct {
+ void *m_p;
+ size_t m_size, m_capacity;
+ mz_uint m_element_size;
+} mz_zip_array;
+
+struct mz_zip_internal_state_tag {
+ mz_zip_array m_central_dir;
+ mz_zip_array m_central_dir_offsets;
+ mz_zip_array m_sorted_central_dir_offsets;
+ MZ_FILE *m_pFile;
+ void *m_pMem;
+ size_t m_mem_size;
+ size_t m_mem_capacity;
+};
+
+#define MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(array_ptr, element_size) \
+ (array_ptr)->m_element_size = element_size
+#define MZ_ZIP_ARRAY_ELEMENT(array_ptr, element_type, index) \
+ ((element_type *)((array_ptr)->m_p))[index]
+
+static MZ_FORCEINLINE void mz_zip_array_clear(mz_zip_archive *pZip,
+ mz_zip_array *pArray) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pArray->m_p);
+ memset(pArray, 0, sizeof(mz_zip_array));
+}
+
+static mz_bool mz_zip_array_ensure_capacity(mz_zip_archive *pZip,
+ mz_zip_array *pArray,
+ size_t min_new_capacity,
+ mz_uint growing) {
+ void *pNew_p;
+ size_t new_capacity = min_new_capacity;
+ MZ_ASSERT(pArray->m_element_size);
+ if (pArray->m_capacity >= min_new_capacity) return MZ_TRUE;
+ if (growing) {
+ new_capacity = MZ_MAX(1, pArray->m_capacity);
+ while (new_capacity < min_new_capacity) new_capacity *= 2;
+ }
+ if (NULL == (pNew_p = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pArray->m_p,
+ pArray->m_element_size, new_capacity)))
+ return MZ_FALSE;
+ pArray->m_p = pNew_p;
+ pArray->m_capacity = new_capacity;
+ return MZ_TRUE;
+}
+
+static MZ_FORCEINLINE mz_bool mz_zip_array_reserve(mz_zip_archive *pZip,
+ mz_zip_array *pArray,
+ size_t new_capacity,
+ mz_uint growing) {
+ if (new_capacity > pArray->m_capacity) {
+ if (!mz_zip_array_ensure_capacity(pZip, pArray, new_capacity, growing))
+ return MZ_FALSE;
+ }
+ return MZ_TRUE;
+}
+
+static MZ_FORCEINLINE mz_bool mz_zip_array_resize(mz_zip_archive *pZip,
+ mz_zip_array *pArray,
+ size_t new_size,
+ mz_uint growing) {
+ if (new_size > pArray->m_capacity) {
+ if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
+ return MZ_FALSE;
+ }
+ pArray->m_size = new_size;
+ return MZ_TRUE;
+}
+
+static MZ_FORCEINLINE mz_bool mz_zip_array_ensure_room(mz_zip_archive *pZip,
+ mz_zip_array *pArray,
+ size_t n) {
+ return mz_zip_array_reserve(pZip, pArray, pArray->m_size + n, MZ_TRUE);
+}
+
+static MZ_FORCEINLINE mz_bool mz_zip_array_push_back(mz_zip_archive *pZip,
+ mz_zip_array *pArray,
+ const void *pElements,
+ size_t n) {
+ size_t orig_size = pArray->m_size;
+ if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
+ return MZ_FALSE;
+ memcpy((mz_uint8 *)pArray->m_p + orig_size * pArray->m_element_size,
+ pElements, n * pArray->m_element_size);
+ return MZ_TRUE;
+}
+
+#ifndef MINIZ_NO_TIME
+static time_t mz_zip_dos_to_time_t(int dos_time, int dos_date) {
+ struct tm tm;
+ memset(&tm, 0, sizeof(tm));
+ tm.tm_isdst = -1;
+ tm.tm_year = ((dos_date >> 9) & 127) + 1980 - 1900;
+ tm.tm_mon = ((dos_date >> 5) & 15) - 1;
+ tm.tm_mday = dos_date & 31;
+ tm.tm_hour = (dos_time >> 11) & 31;
+ tm.tm_min = (dos_time >> 5) & 63;
+ tm.tm_sec = (dos_time << 1) & 62;
+ return mktime(&tm);
+}
+
+static void mz_zip_time_to_dos_time(time_t time, mz_uint16 *pDOS_time,
+ mz_uint16 *pDOS_date) {
+#ifdef _MSC_VER
+ struct tm tm_struct;
+ struct tm *tm = &tm_struct;
+ errno_t err = localtime_s(tm, &time);
+ if (err) {
+ *pDOS_date = 0;
+ *pDOS_time = 0;
+ return;
+ }
+#else
+ struct tm *tm = localtime(&time);
+#endif
+ *pDOS_time = (mz_uint16)(((tm->tm_hour) << 11) + ((tm->tm_min) << 5) +
+ ((tm->tm_sec) >> 1));
+ *pDOS_date = (mz_uint16)(((tm->tm_year + 1900 - 1980) << 9) +
+ ((tm->tm_mon + 1) << 5) + tm->tm_mday);
+}
+#endif
+
+#ifndef MINIZ_NO_STDIO
+static mz_bool mz_zip_get_file_modified_time(const char *pFilename,
+ mz_uint16 *pDOS_time,
+ mz_uint16 *pDOS_date) {
+#ifdef MINIZ_NO_TIME
+ (void)pFilename;
+ *pDOS_date = *pDOS_time = 0;
+#else
+ struct MZ_FILE_STAT_STRUCT file_stat;
+ // On Linux with x86 glibc, this call will fail on large files (>= 0x80000000
+ // bytes) unless you compiled with _LARGEFILE64_SOURCE. Argh.
+ if (MZ_FILE_STAT(pFilename, &file_stat) != 0) return MZ_FALSE;
+ mz_zip_time_to_dos_time(file_stat.st_mtime, pDOS_time, pDOS_date);
+#endif // #ifdef MINIZ_NO_TIME
+ return MZ_TRUE;
+}
+
+#ifndef MINIZ_NO_TIME
+static mz_bool mz_zip_set_file_times(const char *pFilename, time_t access_time,
+ time_t modified_time) {
+ struct utimbuf t;
+ t.actime = access_time;
+ t.modtime = modified_time;
+ return !utime(pFilename, &t);
+}
+#endif // #ifndef MINIZ_NO_TIME
+#endif // #ifndef MINIZ_NO_STDIO
+
+static mz_bool mz_zip_reader_init_internal(mz_zip_archive *pZip,
+ mz_uint32 flags) {
+ (void)flags;
+ if ((!pZip) || (pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
+ return MZ_FALSE;
+
+ if (!pZip->m_pAlloc) pZip->m_pAlloc = def_alloc_func;
+ if (!pZip->m_pFree) pZip->m_pFree = def_free_func;
+ if (!pZip->m_pRealloc) pZip->m_pRealloc = def_realloc_func;
+
+ pZip->m_zip_mode = MZ_ZIP_MODE_READING;
+ pZip->m_archive_size = 0;
+ pZip->m_central_directory_file_ofs = 0;
+ pZip->m_total_files = 0;
+
+ if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(
+ pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state))))
+ return MZ_FALSE;
+ memset(pZip->m_pState, 0, sizeof(mz_zip_internal_state));
+ MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir,
+ sizeof(mz_uint8));
+ MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir_offsets,
+ sizeof(mz_uint32));
+ MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_sorted_central_dir_offsets,
+ sizeof(mz_uint32));
+ return MZ_TRUE;
+}
+
+static MZ_FORCEINLINE mz_bool
+mz_zip_reader_filename_less(const mz_zip_array *pCentral_dir_array,
+ const mz_zip_array *pCentral_dir_offsets,
+ mz_uint l_index, mz_uint r_index) {
+ const mz_uint8 *pL = &MZ_ZIP_ARRAY_ELEMENT(
+ pCentral_dir_array, mz_uint8,
+ MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32,
+ l_index)),
+ *pE;
+ const mz_uint8 *pR = &MZ_ZIP_ARRAY_ELEMENT(
+ pCentral_dir_array, mz_uint8,
+ MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, r_index));
+ mz_uint l_len = MZ_READ_LE16(pL + MZ_ZIP_CDH_FILENAME_LEN_OFS),
+ r_len = MZ_READ_LE16(pR + MZ_ZIP_CDH_FILENAME_LEN_OFS);
+ mz_uint8 l = 0, r = 0;
+ pL += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE;
+ pR += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE;
+ pE = pL + MZ_MIN(l_len, r_len);
+ while (pL < pE) {
+ if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR))) break;
+ pL++;
+ pR++;
+ }
+ return (pL == pE) ? (l_len < r_len) : (l < r);
+}
+
+#define MZ_SWAP_UINT32(a, b) \
+ do { \
+ mz_uint32 t = a; \
+ a = b; \
+ b = t; \
+ } \
+ MZ_MACRO_END
+
+// Heap sort of lowercased filenames, used to help accelerate plain central
+// directory searches by mz_zip_reader_locate_file(). (Could also use qsort(),
+// but it could allocate memory.)
+static void mz_zip_reader_sort_central_dir_offsets_by_filename(
+ mz_zip_archive *pZip) {
+ mz_zip_internal_state *pState = pZip->m_pState;
+ const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets;
+ const mz_zip_array *pCentral_dir = &pState->m_central_dir;
+ mz_uint32 *pIndices = &MZ_ZIP_ARRAY_ELEMENT(
+ &pState->m_sorted_central_dir_offsets, mz_uint32, 0);
+ const int size = pZip->m_total_files;
+ int start = (size - 2) >> 1, end;
+ while (start >= 0) {
+ int child, root = start;
+ for (;;) {
+ if ((child = (root << 1) + 1) >= size) break;
+ child +=
+ (((child + 1) < size) &&
+ (mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets,
+ pIndices[child], pIndices[child + 1])));
+ if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets,
+ pIndices[root], pIndices[child]))
+ break;
+ MZ_SWAP_UINT32(pIndices[root], pIndices[child]);
+ root = child;
+ }
+ start--;
+ }
+
+ end = size - 1;
+ while (end > 0) {
+ int child, root = 0;
+ MZ_SWAP_UINT32(pIndices[end], pIndices[0]);
+ for (;;) {
+ if ((child = (root << 1) + 1) >= end) break;
+ child +=
+ (((child + 1) < end) &&
+ mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets,
+ pIndices[child], pIndices[child + 1]));
+ if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets,
+ pIndices[root], pIndices[child]))
+ break;
+ MZ_SWAP_UINT32(pIndices[root], pIndices[child]);
+ root = child;
+ }
+ end--;
+ }
+}
+
+static mz_bool mz_zip_reader_read_central_dir(mz_zip_archive *pZip,
+ mz_uint32 flags) {
+ mz_uint cdir_size, num_this_disk, cdir_disk_index;
+ mz_uint64 cdir_ofs;
+ mz_int64 cur_file_ofs;
+ const mz_uint8 *p;
+ mz_uint32 buf_u32[4096 / sizeof(mz_uint32)];
+ mz_uint8 *pBuf = (mz_uint8 *)buf_u32;
+ mz_bool sort_central_dir =
+ ((flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0);
+ // Basic sanity checks - reject files which are too small, and check the first
+ // 4 bytes of the file to make sure a local header is there.
+ if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
+ return MZ_FALSE;
+ // Find the end of central directory record by scanning the file from the end
+ // towards the beginning.
+ cur_file_ofs =
+ MZ_MAX((mz_int64)pZip->m_archive_size - (mz_int64)sizeof(buf_u32), 0);
+ for (;;) {
+ int i,
+ n = (int)MZ_MIN(sizeof(buf_u32), pZip->m_archive_size - cur_file_ofs);
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, n) != (mz_uint)n)
+ return MZ_FALSE;
+ for (i = n - 4; i >= 0; --i)
+ if (MZ_READ_LE32(pBuf + i) == MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG) break;
+ if (i >= 0) {
+ cur_file_ofs += i;
+ break;
+ }
+ if ((!cur_file_ofs) || ((pZip->m_archive_size - cur_file_ofs) >=
+ (0xFFFF + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)))
+ return MZ_FALSE;
+ cur_file_ofs = MZ_MAX(cur_file_ofs - (sizeof(buf_u32) - 3), 0);
+ }
+ // Read and verify the end of central directory record.
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf,
+ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) !=
+ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
+ return MZ_FALSE;
+ if ((MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) !=
+ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG) ||
+ ((pZip->m_total_files =
+ MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS)) !=
+ MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS)))
+ return MZ_FALSE;
+
+ num_this_disk = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_THIS_DISK_OFS);
+ cdir_disk_index = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS);
+ if (((num_this_disk | cdir_disk_index) != 0) &&
+ ((num_this_disk != 1) || (cdir_disk_index != 1)))
+ return MZ_FALSE;
+
+ if ((cdir_size = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_SIZE_OFS)) <
+ pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)
+ return MZ_FALSE;
+
+ cdir_ofs = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_OFS_OFS);
+ if ((cdir_ofs + (mz_uint64)cdir_size) > pZip->m_archive_size) return MZ_FALSE;
+
+ pZip->m_central_directory_file_ofs = cdir_ofs;
+
+ if (pZip->m_total_files) {
+ mz_uint i, n;
+
+ // Read the entire central directory into a heap block, and allocate another
+ // heap block to hold the unsorted central dir file record offsets, and
+ // another to hold the sorted indices.
+ if ((!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir, cdir_size,
+ MZ_FALSE)) ||
+ (!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir_offsets,
+ pZip->m_total_files, MZ_FALSE)))
+ return MZ_FALSE;
+
+ if (sort_central_dir) {
+ if (!mz_zip_array_resize(pZip,
+ &pZip->m_pState->m_sorted_central_dir_offsets,
+ pZip->m_total_files, MZ_FALSE))
+ return MZ_FALSE;
+ }
+
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs,
+ pZip->m_pState->m_central_dir.m_p,
+ cdir_size) != cdir_size)
+ return MZ_FALSE;
+
+ // Now create an index into the central directory file records, do some
+ // basic sanity checking on each record, and check for zip64 entries (which
+ // are not yet supported).
+ p = (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p;
+ for (n = cdir_size, i = 0; i < pZip->m_total_files; ++i) {
+ mz_uint total_header_size, comp_size, decomp_size, disk_index;
+ if ((n < MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) ||
+ (MZ_READ_LE32(p) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG))
+ return MZ_FALSE;
+ MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32,
+ i) =
+ (mz_uint32)(p - (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p);
+ if (sort_central_dir)
+ MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_sorted_central_dir_offsets,
+ mz_uint32, i) = i;
+ comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS);
+ decomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS);
+ if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) &&
+ (decomp_size != comp_size)) ||
+ (decomp_size && !comp_size) || (decomp_size == 0xFFFFFFFF) ||
+ (comp_size == 0xFFFFFFFF))
+ return MZ_FALSE;
+ disk_index = MZ_READ_LE16(p + MZ_ZIP_CDH_DISK_START_OFS);
+ if ((disk_index != num_this_disk) && (disk_index != 1)) return MZ_FALSE;
+ if (((mz_uint64)MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS) +
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE + comp_size) > pZip->m_archive_size)
+ return MZ_FALSE;
+ if ((total_header_size = MZ_ZIP_CENTRAL_DIR_HEADER_SIZE +
+ MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) +
+ MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS) +
+ MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS)) >
+ n)
+ return MZ_FALSE;
+ n -= total_header_size;
+ p += total_header_size;
+ }
+ }
+
+ if (sort_central_dir)
+ mz_zip_reader_sort_central_dir_offsets_by_filename(pZip);
+
+ return MZ_TRUE;
+}
+
+mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size,
+ mz_uint32 flags) {
+ if ((!pZip) || (!pZip->m_pRead)) return MZ_FALSE;
+ if (!mz_zip_reader_init_internal(pZip, flags)) return MZ_FALSE;
+ pZip->m_archive_size = size;
+ if (!mz_zip_reader_read_central_dir(pZip, flags)) {
+ mz_zip_reader_end(pZip);
+ return MZ_FALSE;
+ }
+ return MZ_TRUE;
+}
+
+static size_t mz_zip_mem_read_func(void *pOpaque, mz_uint64 file_ofs,
+ void *pBuf, size_t n) {
+ mz_zip_archive *pZip = (mz_zip_archive *)pOpaque;
+ size_t s = (file_ofs >= pZip->m_archive_size)
+ ? 0
+ : (size_t)MZ_MIN(pZip->m_archive_size - file_ofs, n);
+ memcpy(pBuf, (const mz_uint8 *)pZip->m_pState->m_pMem + file_ofs, s);
+ return s;
+}
+
+mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem,
+ size_t size, mz_uint32 flags) {
+ if (!mz_zip_reader_init_internal(pZip, flags)) return MZ_FALSE;
+ pZip->m_archive_size = size;
+ pZip->m_pRead = mz_zip_mem_read_func;
+ pZip->m_pIO_opaque = pZip;
+#ifdef __cplusplus
+ pZip->m_pState->m_pMem = const_cast<void *>(pMem);
+#else
+ pZip->m_pState->m_pMem = (void *)pMem;
+#endif
+ pZip->m_pState->m_mem_size = size;
+ if (!mz_zip_reader_read_central_dir(pZip, flags)) {
+ mz_zip_reader_end(pZip);
+ return MZ_FALSE;
+ }
+ return MZ_TRUE;
+}
+
+#ifndef MINIZ_NO_STDIO
+static size_t mz_zip_file_read_func(void *pOpaque, mz_uint64 file_ofs,
+ void *pBuf, size_t n) {
+ mz_zip_archive *pZip = (mz_zip_archive *)pOpaque;
+ mz_int64 cur_ofs = MZ_FTELL64(pZip->m_pState->m_pFile);
+ if (((mz_int64)file_ofs < 0) ||
+ (((cur_ofs != (mz_int64)file_ofs)) &&
+ (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET))))
+ return 0;
+ return MZ_FREAD(pBuf, 1, n, pZip->m_pState->m_pFile);
+}
+
+mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename,
+ mz_uint32 flags) {
+ mz_uint64 file_size;
+ MZ_FILE *pFile = MZ_FOPEN(pFilename, "rb");
+ if (!pFile) return MZ_FALSE;
+ if (MZ_FSEEK64(pFile, 0, SEEK_END)) {
+ MZ_FCLOSE(pFile);
+ return MZ_FALSE;
+ }
+ file_size = MZ_FTELL64(pFile);
+ if (!mz_zip_reader_init_internal(pZip, flags)) {
+ MZ_FCLOSE(pFile);
+ return MZ_FALSE;
+ }
+ pZip->m_pRead = mz_zip_file_read_func;
+ pZip->m_pIO_opaque = pZip;
+ pZip->m_pState->m_pFile = pFile;
+ pZip->m_archive_size = file_size;
+ if (!mz_zip_reader_read_central_dir(pZip, flags)) {
+ mz_zip_reader_end(pZip);
+ return MZ_FALSE;
+ }
+ return MZ_TRUE;
+}
+#endif // #ifndef MINIZ_NO_STDIO
+
+mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip) {
+ return pZip ? pZip->m_total_files : 0;
+}
+
+static MZ_FORCEINLINE const mz_uint8 *mz_zip_reader_get_cdh(
+ mz_zip_archive *pZip, mz_uint file_index) {
+ if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files) ||
+ (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
+ return NULL;
+ return &MZ_ZIP_ARRAY_ELEMENT(
+ &pZip->m_pState->m_central_dir, mz_uint8,
+ MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32,
+ file_index));
+}
+
+mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip,
+ mz_uint file_index) {
+ mz_uint m_bit_flag;
+ const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index);
+ if (!p) return MZ_FALSE;
+ m_bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS);
+ return (m_bit_flag & 1);
+}
+
+mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip,
+ mz_uint file_index) {
+ mz_uint filename_len, external_attr;
+ const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index);
+ if (!p) return MZ_FALSE;
+
+ // First see if the filename ends with a '/' character.
+ filename_len = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
+ if (filename_len) {
+ if (*(p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_len - 1) == '/')
+ return MZ_TRUE;
+ }
+
+ // Bugfix: This code was also checking if the internal attribute was non-zero,
+ // which wasn't correct.
+ // Most/all zip writers (hopefully) set DOS file/directory attributes in the
+ // low 16-bits, so check for the DOS directory flag and ignore the source OS
+ // ID in the created by field.
+ // FIXME: Remove this check? Is it necessary - we already check the filename.
+ external_attr = MZ_READ_LE32(p + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS);
+ if ((external_attr & 0x10) != 0) return MZ_TRUE;
+
+ return MZ_FALSE;
+}
+
+mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index,
+ mz_zip_archive_file_stat *pStat) {
+ mz_uint n;
+ const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index);
+ if ((!p) || (!pStat)) return MZ_FALSE;
+
+ // Unpack the central directory record.
+ pStat->m_file_index = file_index;
+ pStat->m_central_dir_ofs = MZ_ZIP_ARRAY_ELEMENT(
+ &pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index);
+ pStat->m_version_made_by = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_MADE_BY_OFS);
+ pStat->m_version_needed = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_NEEDED_OFS);
+ pStat->m_bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS);
+ pStat->m_method = MZ_READ_LE16(p + MZ_ZIP_CDH_METHOD_OFS);
+#ifndef MINIZ_NO_TIME
+ pStat->m_time =
+ mz_zip_dos_to_time_t(MZ_READ_LE16(p + MZ_ZIP_CDH_FILE_TIME_OFS),
+ MZ_READ_LE16(p + MZ_ZIP_CDH_FILE_DATE_OFS));
+#endif
+ pStat->m_crc32 = MZ_READ_LE32(p + MZ_ZIP_CDH_CRC32_OFS);
+ pStat->m_comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS);
+ pStat->m_uncomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS);
+ pStat->m_internal_attr = MZ_READ_LE16(p + MZ_ZIP_CDH_INTERNAL_ATTR_OFS);
+ pStat->m_external_attr = MZ_READ_LE32(p + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS);
+ pStat->m_local_header_ofs = MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS);
+
+ // Copy as much of the filename and comment as possible.
+ n = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
+ n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE - 1);
+ memcpy(pStat->m_filename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n);
+ pStat->m_filename[n] = '\0';
+
+ n = MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS);
+ n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE - 1);
+ pStat->m_comment_size = n;
+ memcpy(pStat->m_comment, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE +
+ MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) +
+ MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS),
+ n);
+ pStat->m_comment[n] = '\0';
+
+ return MZ_TRUE;
+}
+
+mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index,
+ char *pFilename, mz_uint filename_buf_size) {
+ mz_uint n;
+ const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index);
+ if (!p) {
+ if (filename_buf_size) pFilename[0] = '\0';
+ return 0;
+ }
+ n = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
+ if (filename_buf_size) {
+ n = MZ_MIN(n, filename_buf_size - 1);
+ memcpy(pFilename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n);
+ pFilename[n] = '\0';
+ }
+ return n + 1;
+}
+
+static MZ_FORCEINLINE mz_bool mz_zip_reader_string_equal(const char *pA,
+ const char *pB,
+ mz_uint len,
+ mz_uint flags) {
+ mz_uint i;
+ if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE) return 0 == memcmp(pA, pB, len);
+ for (i = 0; i < len; ++i)
+ if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i])) return MZ_FALSE;
+ return MZ_TRUE;
+}
+
+static MZ_FORCEINLINE int mz_zip_reader_filename_compare(
+ const mz_zip_array *pCentral_dir_array,
+ const mz_zip_array *pCentral_dir_offsets, mz_uint l_index, const char *pR,
+ mz_uint r_len) {
+ const mz_uint8 *pL = &MZ_ZIP_ARRAY_ELEMENT(
+ pCentral_dir_array, mz_uint8,
+ MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32,
+ l_index)),
+ *pE;
+ mz_uint l_len = MZ_READ_LE16(pL + MZ_ZIP_CDH_FILENAME_LEN_OFS);
+ mz_uint8 l = 0, r = 0;
+ pL += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE;
+ pE = pL + MZ_MIN(l_len, r_len);
+ while (pL < pE) {
+ if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR))) break;
+ pL++;
+ pR++;
+ }
+ return (pL == pE) ? (int)(l_len - r_len) : (l - r);
+}
+
+static int mz_zip_reader_locate_file_binary_search(mz_zip_archive *pZip,
+ const char *pFilename) {
+ mz_zip_internal_state *pState = pZip->m_pState;
+ const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets;
+ const mz_zip_array *pCentral_dir = &pState->m_central_dir;
+ mz_uint32 *pIndices = &MZ_ZIP_ARRAY_ELEMENT(
+ &pState->m_sorted_central_dir_offsets, mz_uint32, 0);
+ const int size = pZip->m_total_files;
+ const mz_uint filename_len = (mz_uint)strlen(pFilename);
+ int l = 0, h = size - 1;
+ while (l <= h) {
+ int m = (l + h) >> 1, file_index = pIndices[m],
+ comp =
+ mz_zip_reader_filename_compare(pCentral_dir, pCentral_dir_offsets,
+ file_index, pFilename, filename_len);
+ if (!comp)
+ return file_index;
+ else if (comp < 0)
+ l = m + 1;
+ else
+ h = m - 1;
+ }
+ return -1;
+}
+
+int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName,
+ const char *pComment, mz_uint flags) {
+ mz_uint file_index;
+ size_t name_len, comment_len;
+ if ((!pZip) || (!pZip->m_pState) || (!pName) ||
+ (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
+ return -1;
+ if (((flags & (MZ_ZIP_FLAG_IGNORE_PATH | MZ_ZIP_FLAG_CASE_SENSITIVE)) == 0) &&
+ (!pComment) && (pZip->m_pState->m_sorted_central_dir_offsets.m_size))
+ return mz_zip_reader_locate_file_binary_search(pZip, pName);
+ name_len = strlen(pName);
+ if (name_len > 0xFFFF) return -1;
+ comment_len = pComment ? strlen(pComment) : 0;
+ if (comment_len > 0xFFFF) return -1;
+ for (file_index = 0; file_index < pZip->m_total_files; file_index++) {
+ const mz_uint8 *pHeader = &MZ_ZIP_ARRAY_ELEMENT(
+ &pZip->m_pState->m_central_dir, mz_uint8,
+ MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32,
+ file_index));
+ mz_uint filename_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_FILENAME_LEN_OFS);
+ const char *pFilename =
+ (const char *)pHeader + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE;
+ if (filename_len < name_len) continue;
+ if (comment_len) {
+ mz_uint file_extra_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_EXTRA_LEN_OFS),
+ file_comment_len =
+ MZ_READ_LE16(pHeader + MZ_ZIP_CDH_COMMENT_LEN_OFS);
+ const char *pFile_comment = pFilename + filename_len + file_extra_len;
+ if ((file_comment_len != comment_len) ||
+ (!mz_zip_reader_string_equal(pComment, pFile_comment,
+ file_comment_len, flags)))
+ continue;
+ }
+ if ((flags & MZ_ZIP_FLAG_IGNORE_PATH) && (filename_len)) {
+ int ofs = filename_len - 1;
+ do {
+ if ((pFilename[ofs] == '/') || (pFilename[ofs] == '\\') ||
+ (pFilename[ofs] == ':'))
+ break;
+ } while (--ofs >= 0);
+ ofs++;
+ pFilename += ofs;
+ filename_len -= ofs;
+ }
+ if ((filename_len == name_len) &&
+ (mz_zip_reader_string_equal(pName, pFilename, filename_len, flags)))
+ return file_index;
+ }
+ return -1;
+}
+
+mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip,
+ mz_uint file_index, void *pBuf,
+ size_t buf_size, mz_uint flags,
+ void *pUser_read_buf,
+ size_t user_read_buf_size) {
+ int status = TINFL_STATUS_DONE;
+ mz_uint64 needed_size, cur_file_ofs, comp_remaining,
+ out_buf_ofs = 0, read_buf_size, read_buf_ofs = 0, read_buf_avail;
+ mz_zip_archive_file_stat file_stat;
+ void *pRead_buf;
+ mz_uint32
+ local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) /
+ sizeof(mz_uint32)];
+ mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32;
+ tinfl_decompressor inflator;
+
+ if ((buf_size) && (!pBuf)) return MZ_FALSE;
+
+ if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) return MZ_FALSE;
+
+ // Empty file, or a directory (but not always a directory - I've seen odd zips
+ // with directories that have compressed data which inflates to 0 bytes)
+ if (!file_stat.m_comp_size) return MZ_TRUE;
+
+ // Entry is a subdirectory (I've seen old zips with dir entries which have
+ // compressed deflate data which inflates to 0 bytes, but these entries claim
+ // to uncompress to 512 bytes in the headers).
+ // I'm torn how to handle this case - should it fail instead?
+ if (mz_zip_reader_is_file_a_directory(pZip, file_index)) return MZ_TRUE;
+
+ // Encryption and patch files are not supported.
+ if (file_stat.m_bit_flag & (1 | 32)) return MZ_FALSE;
+
+ // This function only supports stored and deflate.
+ if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) &&
+ (file_stat.m_method != MZ_DEFLATED))
+ return MZ_FALSE;
+
+ // Ensure supplied output buffer is large enough.
+ needed_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? file_stat.m_comp_size
+ : file_stat.m_uncomp_size;
+ if (buf_size < needed_size) return MZ_FALSE;
+
+ // Read and parse the local directory entry.
+ cur_file_ofs = file_stat.m_local_header_ofs;
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header,
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE) !=
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
+ return MZ_FALSE;
+ if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
+ return MZ_FALSE;
+
+ cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE +
+ MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) +
+ MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS);
+ if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size)
+ return MZ_FALSE;
+
+ if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method)) {
+ // The file is stored or the caller has requested the compressed data.
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf,
+ (size_t)needed_size) != needed_size)
+ return MZ_FALSE;
+ return ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) != 0) ||
+ (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf,
+ (size_t)file_stat.m_uncomp_size) == file_stat.m_crc32);
+ }
+
+ // Decompress the file either directly from memory or from a file input
+ // buffer.
+ tinfl_init(&inflator);
+
+ if (pZip->m_pState->m_pMem) {
+ // Read directly from the archive in memory.
+ pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + cur_file_ofs;
+ read_buf_size = read_buf_avail = file_stat.m_comp_size;
+ comp_remaining = 0;
+ } else if (pUser_read_buf) {
+ // Use a user provided read buffer.
+ if (!user_read_buf_size) return MZ_FALSE;
+ pRead_buf = (mz_uint8 *)pUser_read_buf;
+ read_buf_size = user_read_buf_size;
+ read_buf_avail = 0;
+ comp_remaining = file_stat.m_comp_size;
+ } else {
+ // Temporarily allocate a read buffer.
+ read_buf_size =
+ MZ_MIN(file_stat.m_comp_size, (mz_uint)MZ_ZIP_MAX_IO_BUF_SIZE);
+#ifdef _MSC_VER
+ if (((0, sizeof(size_t) == sizeof(mz_uint32))) &&
+ (read_buf_size > 0x7FFFFFFF))
+#else
+ if (((sizeof(size_t) == sizeof(mz_uint32))) && (read_buf_size > 0x7FFFFFFF))
+#endif
+ return MZ_FALSE;
+ if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1,
+ (size_t)read_buf_size)))
+ return MZ_FALSE;
+ read_buf_avail = 0;
+ comp_remaining = file_stat.m_comp_size;
+ }
+
+ do {
+ size_t in_buf_size,
+ out_buf_size = (size_t)(file_stat.m_uncomp_size - out_buf_ofs);
+ if ((!read_buf_avail) && (!pZip->m_pState->m_pMem)) {
+ read_buf_avail = MZ_MIN(read_buf_size, comp_remaining);
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf,
+ (size_t)read_buf_avail) != read_buf_avail) {
+ status = TINFL_STATUS_FAILED;
+ break;
+ }
+ cur_file_ofs += read_buf_avail;
+ comp_remaining -= read_buf_avail;
+ read_buf_ofs = 0;
+ }
+ in_buf_size = (size_t)read_buf_avail;
+ status = tinfl_decompress(
+ &inflator, (mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size,
+ (mz_uint8 *)pBuf, (mz_uint8 *)pBuf + out_buf_ofs, &out_buf_size,
+ TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF |
+ (comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0));
+ read_buf_avail -= in_buf_size;
+ read_buf_ofs += in_buf_size;
+ out_buf_ofs += out_buf_size;
+ } while (status == TINFL_STATUS_NEEDS_MORE_INPUT);
+
+ if (status == TINFL_STATUS_DONE) {
+ // Make sure the entire file was decompressed, and check its CRC.
+ if ((out_buf_ofs != file_stat.m_uncomp_size) ||
+ (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf,
+ (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32))
+ status = TINFL_STATUS_FAILED;
+ }
+
+ if ((!pZip->m_pState->m_pMem) && (!pUser_read_buf))
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
+
+ return status == TINFL_STATUS_DONE;
+}
+
+mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(
+ mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size,
+ mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size) {
+ int file_index = mz_zip_reader_locate_file(pZip, pFilename, NULL, flags);
+ if (file_index < 0) return MZ_FALSE;
+ return mz_zip_reader_extract_to_mem_no_alloc(pZip, file_index, pBuf, buf_size,
+ flags, pUser_read_buf,
+ user_read_buf_size);
+}
+
+mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index,
+ void *pBuf, size_t buf_size,
+ mz_uint flags) {
+ return mz_zip_reader_extract_to_mem_no_alloc(pZip, file_index, pBuf, buf_size,
+ flags, NULL, 0);
+}
+
+mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip,
+ const char *pFilename, void *pBuf,
+ size_t buf_size, mz_uint flags) {
+ return mz_zip_reader_extract_file_to_mem_no_alloc(pZip, pFilename, pBuf,
+ buf_size, flags, NULL, 0);
+}
+
+void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index,
+ size_t *pSize, mz_uint flags) {
+ mz_uint64 comp_size, uncomp_size, alloc_size;
+ const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index);
+ void *pBuf;
+
+ if (pSize) *pSize = 0;
+ if (!p) return NULL;
+
+ comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS);
+ uncomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS);
+
+ alloc_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? comp_size : uncomp_size;
+#ifdef _MSC_VER
+ if (((0, sizeof(size_t) == sizeof(mz_uint32))) && (alloc_size > 0x7FFFFFFF))
+#else
+ if (((sizeof(size_t) == sizeof(mz_uint32))) && (alloc_size > 0x7FFFFFFF))
+#endif
+ return NULL;
+ if (NULL ==
+ (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)alloc_size)))
+ return NULL;
+
+ if (!mz_zip_reader_extract_to_mem(pZip, file_index, pBuf, (size_t)alloc_size,
+ flags)) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
+ return NULL;
+ }
+
+ if (pSize) *pSize = (size_t)alloc_size;
+ return pBuf;
+}
+
+void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip,
+ const char *pFilename, size_t *pSize,
+ mz_uint flags) {
+ int file_index = mz_zip_reader_locate_file(pZip, pFilename, NULL, flags);
+ if (file_index < 0) {
+ if (pSize) *pSize = 0;
+ return MZ_FALSE;
+ }
+ return mz_zip_reader_extract_to_heap(pZip, file_index, pSize, flags);
+}
+
+mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip,
+ mz_uint file_index,
+ mz_file_write_func pCallback,
+ void *pOpaque, mz_uint flags) {
+ int status = TINFL_STATUS_DONE;
+ mz_uint file_crc32 = MZ_CRC32_INIT;
+ mz_uint64 read_buf_size, read_buf_ofs = 0, read_buf_avail, comp_remaining,
+ out_buf_ofs = 0, cur_file_ofs;
+ mz_zip_archive_file_stat file_stat;
+ void *pRead_buf = NULL;
+ void *pWrite_buf = NULL;
+ mz_uint32
+ local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) /
+ sizeof(mz_uint32)];
+ mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32;
+
+ if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) return MZ_FALSE;
+
+ // Empty file, or a directory (but not always a directory - I've seen odd zips
+ // with directories that have compressed data which inflates to 0 bytes)
+ if (!file_stat.m_comp_size) return MZ_TRUE;
+
+ // Entry is a subdirectory (I've seen old zips with dir entries which have
+ // compressed deflate data which inflates to 0 bytes, but these entries claim
+ // to uncompress to 512 bytes in the headers).
+ // I'm torn how to handle this case - should it fail instead?
+ if (mz_zip_reader_is_file_a_directory(pZip, file_index)) return MZ_TRUE;
+
+ // Encryption and patch files are not supported.
+ if (file_stat.m_bit_flag & (1 | 32)) return MZ_FALSE;
+
+ // This function only supports stored and deflate.
+ if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) &&
+ (file_stat.m_method != MZ_DEFLATED))
+ return MZ_FALSE;
+
+ // Read and parse the local directory entry.
+ cur_file_ofs = file_stat.m_local_header_ofs;
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header,
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE) !=
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
+ return MZ_FALSE;
+ if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
+ return MZ_FALSE;
+
+ cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE +
+ MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) +
+ MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS);
+ if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size)
+ return MZ_FALSE;
+
+ // Decompress the file either directly from memory or from a file input
+ // buffer.
+ if (pZip->m_pState->m_pMem) {
+ pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + cur_file_ofs;
+ read_buf_size = read_buf_avail = file_stat.m_comp_size;
+ comp_remaining = 0;
+ } else {
+ read_buf_size =
+ MZ_MIN(file_stat.m_comp_size, (mz_uint)MZ_ZIP_MAX_IO_BUF_SIZE);
+ if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1,
+ (size_t)read_buf_size)))
+ return MZ_FALSE;
+ read_buf_avail = 0;
+ comp_remaining = file_stat.m_comp_size;
+ }
+
+ if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method)) {
+ // The file is stored or the caller has requested the compressed data.
+ if (pZip->m_pState->m_pMem) {
+#ifdef _MSC_VER
+ if (((0, sizeof(size_t) == sizeof(mz_uint32))) &&
+ (file_stat.m_comp_size > 0xFFFFFFFF))
+#else
+ if (((sizeof(size_t) == sizeof(mz_uint32))) &&
+ (file_stat.m_comp_size > 0xFFFFFFFF))
+#endif
+ return MZ_FALSE;
+ if (pCallback(pOpaque, out_buf_ofs, pRead_buf,
+ (size_t)file_stat.m_comp_size) != file_stat.m_comp_size)
+ status = TINFL_STATUS_FAILED;
+ else if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
+ file_crc32 =
+ (mz_uint32)mz_crc32(file_crc32, (const mz_uint8 *)pRead_buf,
+ (size_t)file_stat.m_comp_size);
+ cur_file_ofs += file_stat.m_comp_size;
+ out_buf_ofs += file_stat.m_comp_size;
+ comp_remaining = 0;
+ } else {
+ while (comp_remaining) {
+ read_buf_avail = MZ_MIN(read_buf_size, comp_remaining);
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf,
+ (size_t)read_buf_avail) != read_buf_avail) {
+ status = TINFL_STATUS_FAILED;
+ break;
+ }
+
+ if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
+ file_crc32 = (mz_uint32)mz_crc32(
+ file_crc32, (const mz_uint8 *)pRead_buf, (size_t)read_buf_avail);
+
+ if (pCallback(pOpaque, out_buf_ofs, pRead_buf,
+ (size_t)read_buf_avail) != read_buf_avail) {
+ status = TINFL_STATUS_FAILED;
+ break;
+ }
+ cur_file_ofs += read_buf_avail;
+ out_buf_ofs += read_buf_avail;
+ comp_remaining -= read_buf_avail;
+ }
+ }
+ } else {
+ tinfl_decompressor inflator;
+ tinfl_init(&inflator);
+
+ if (NULL == (pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1,
+ TINFL_LZ_DICT_SIZE)))
+ status = TINFL_STATUS_FAILED;
+ else {
+ do {
+ mz_uint8 *pWrite_buf_cur =
+ (mz_uint8 *)pWrite_buf + (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1));
+ size_t in_buf_size,
+ out_buf_size =
+ TINFL_LZ_DICT_SIZE - (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1));
+ if ((!read_buf_avail) && (!pZip->m_pState->m_pMem)) {
+ read_buf_avail = MZ_MIN(read_buf_size, comp_remaining);
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf,
+ (size_t)read_buf_avail) != read_buf_avail) {
+ status = TINFL_STATUS_FAILED;
+ break;
+ }
+ cur_file_ofs += read_buf_avail;
+ comp_remaining -= read_buf_avail;
+ read_buf_ofs = 0;
+ }
+
+ in_buf_size = (size_t)read_buf_avail;
+ status = tinfl_decompress(
+ &inflator, (const mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size,
+ (mz_uint8 *)pWrite_buf, pWrite_buf_cur, &out_buf_size,
+ comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0);
+ read_buf_avail -= in_buf_size;
+ read_buf_ofs += in_buf_size;
+
+ if (out_buf_size) {
+ if (pCallback(pOpaque, out_buf_ofs, pWrite_buf_cur, out_buf_size) !=
+ out_buf_size) {
+ status = TINFL_STATUS_FAILED;
+ break;
+ }
+ file_crc32 =
+ (mz_uint32)mz_crc32(file_crc32, pWrite_buf_cur, out_buf_size);
+ if ((out_buf_ofs += out_buf_size) > file_stat.m_uncomp_size) {
+ status = TINFL_STATUS_FAILED;
+ break;
+ }
+ }
+ } while ((status == TINFL_STATUS_NEEDS_MORE_INPUT) ||
+ (status == TINFL_STATUS_HAS_MORE_OUTPUT));
+ }
+ }
+
+ if ((status == TINFL_STATUS_DONE) &&
+ (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))) {
+ // Make sure the entire file was decompressed, and check its CRC.
+ if ((out_buf_ofs != file_stat.m_uncomp_size) ||
+ (file_crc32 != file_stat.m_crc32))
+ status = TINFL_STATUS_FAILED;
+ }
+
+ if (!pZip->m_pState->m_pMem) pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
+ if (pWrite_buf) pZip->m_pFree(pZip->m_pAlloc_opaque, pWrite_buf);
+
+ return status == TINFL_STATUS_DONE;
+}
+
+mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip,
+ const char *pFilename,
+ mz_file_write_func pCallback,
+ void *pOpaque, mz_uint flags) {
+ int file_index = mz_zip_reader_locate_file(pZip, pFilename, NULL, flags);
+ if (file_index < 0) return MZ_FALSE;
+ return mz_zip_reader_extract_to_callback(pZip, file_index, pCallback, pOpaque,
+ flags);
+}
+
+#ifndef MINIZ_NO_STDIO
+static size_t mz_zip_file_write_callback(void *pOpaque, mz_uint64 ofs,
+ const void *pBuf, size_t n) {
+ (void)ofs;
+ return MZ_FWRITE(pBuf, 1, n, (MZ_FILE *)pOpaque);
+}
+
+mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index,
+ const char *pDst_filename,
+ mz_uint flags) {
+ mz_bool status;
+ mz_zip_archive_file_stat file_stat;
+ MZ_FILE *pFile;
+ if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) return MZ_FALSE;
+ pFile = MZ_FOPEN(pDst_filename, "wb");
+ if (!pFile) return MZ_FALSE;
+ status = mz_zip_reader_extract_to_callback(
+ pZip, file_index, mz_zip_file_write_callback, pFile, flags);
+ if (MZ_FCLOSE(pFile) == EOF) return MZ_FALSE;
+#ifndef MINIZ_NO_TIME
+ if (status)
+ mz_zip_set_file_times(pDst_filename, file_stat.m_time, file_stat.m_time);
+#endif
+ return status;
+}
+#endif // #ifndef MINIZ_NO_STDIO
+
+mz_bool mz_zip_reader_end(mz_zip_archive *pZip) {
+ if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) ||
+ (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
+ return MZ_FALSE;
+
+ if (pZip->m_pState) {
+ mz_zip_internal_state *pState = pZip->m_pState;
+ pZip->m_pState = NULL;
+ mz_zip_array_clear(pZip, &pState->m_central_dir);
+ mz_zip_array_clear(pZip, &pState->m_central_dir_offsets);
+ mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets);
+
+#ifndef MINIZ_NO_STDIO
+ if (pState->m_pFile) {
+ MZ_FCLOSE(pState->m_pFile);
+ pState->m_pFile = NULL;
+ }
+#endif // #ifndef MINIZ_NO_STDIO
+
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
+ }
+ pZip->m_zip_mode = MZ_ZIP_MODE_INVALID;
+
+ return MZ_TRUE;
+}
+
+#ifndef MINIZ_NO_STDIO
+mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip,
+ const char *pArchive_filename,
+ const char *pDst_filename,
+ mz_uint flags) {
+ int file_index =
+ mz_zip_reader_locate_file(pZip, pArchive_filename, NULL, flags);
+ if (file_index < 0) return MZ_FALSE;
+ return mz_zip_reader_extract_to_file(pZip, file_index, pDst_filename, flags);
+}
+#endif
+
+// ------------------- .ZIP archive writing
+
+#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
+
+static void mz_write_le16(mz_uint8 *p, mz_uint16 v) {
+ p[0] = (mz_uint8)v;
+ p[1] = (mz_uint8)(v >> 8);
+}
+static void mz_write_le32(mz_uint8 *p, mz_uint32 v) {
+ p[0] = (mz_uint8)v;
+ p[1] = (mz_uint8)(v >> 8);
+ p[2] = (mz_uint8)(v >> 16);
+ p[3] = (mz_uint8)(v >> 24);
+}
+#define MZ_WRITE_LE16(p, v) mz_write_le16((mz_uint8 *)(p), (mz_uint16)(v))
+#define MZ_WRITE_LE32(p, v) mz_write_le32((mz_uint8 *)(p), (mz_uint32)(v))
+
+mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size) {
+ if ((!pZip) || (pZip->m_pState) || (!pZip->m_pWrite) ||
+ (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
+ return MZ_FALSE;
+
+ if (pZip->m_file_offset_alignment) {
+ // Ensure user specified file offset alignment is a power of 2.
+ if (pZip->m_file_offset_alignment & (pZip->m_file_offset_alignment - 1))
+ return MZ_FALSE;
+ }
+
+ if (!pZip->m_pAlloc) pZip->m_pAlloc = def_alloc_func;
+ if (!pZip->m_pFree) pZip->m_pFree = def_free_func;
+ if (!pZip->m_pRealloc) pZip->m_pRealloc = def_realloc_func;
+
+ pZip->m_zip_mode = MZ_ZIP_MODE_WRITING;
+ pZip->m_archive_size = existing_size;
+ pZip->m_central_directory_file_ofs = 0;
+ pZip->m_total_files = 0;
+
+ if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(
+ pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state))))
+ return MZ_FALSE;
+ memset(pZip->m_pState, 0, sizeof(mz_zip_internal_state));
+ MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir,
+ sizeof(mz_uint8));
+ MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir_offsets,
+ sizeof(mz_uint32));
+ MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_sorted_central_dir_offsets,
+ sizeof(mz_uint32));
+ return MZ_TRUE;
+}
+
+static size_t mz_zip_heap_write_func(void *pOpaque, mz_uint64 file_ofs,
+ const void *pBuf, size_t n) {
+ mz_zip_archive *pZip = (mz_zip_archive *)pOpaque;
+ mz_zip_internal_state *pState = pZip->m_pState;
+ mz_uint64 new_size = MZ_MAX(file_ofs + n, pState->m_mem_size);
+#ifdef _MSC_VER
+ if ((!n) ||
+ ((0, sizeof(size_t) == sizeof(mz_uint32)) && (new_size > 0x7FFFFFFF)))
+#else
+ if ((!n) ||
+ ((sizeof(size_t) == sizeof(mz_uint32)) && (new_size > 0x7FFFFFFF)))
+#endif
+ return 0;
+ if (new_size > pState->m_mem_capacity) {
+ void *pNew_block;
+ size_t new_capacity = MZ_MAX(64, pState->m_mem_capacity);
+ while (new_capacity < new_size) new_capacity *= 2;
+ if (NULL == (pNew_block = pZip->m_pRealloc(
+ pZip->m_pAlloc_opaque, pState->m_pMem, 1, new_capacity)))
+ return 0;
+ pState->m_pMem = pNew_block;
+ pState->m_mem_capacity = new_capacity;
+ }
+ memcpy((mz_uint8 *)pState->m_pMem + file_ofs, pBuf, n);
+ pState->m_mem_size = (size_t)new_size;
+ return n;
+}
+
+mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip,
+ size_t size_to_reserve_at_beginning,
+ size_t initial_allocation_size) {
+ pZip->m_pWrite = mz_zip_heap_write_func;
+ pZip->m_pIO_opaque = pZip;
+ if (!mz_zip_writer_init(pZip, size_to_reserve_at_beginning)) return MZ_FALSE;
+ if (0 != (initial_allocation_size = MZ_MAX(initial_allocation_size,
+ size_to_reserve_at_beginning))) {
+ if (NULL == (pZip->m_pState->m_pMem = pZip->m_pAlloc(
+ pZip->m_pAlloc_opaque, 1, initial_allocation_size))) {
+ mz_zip_writer_end(pZip);
+ return MZ_FALSE;
+ }
+ pZip->m_pState->m_mem_capacity = initial_allocation_size;
+ }
+ return MZ_TRUE;
+}
+
+#ifndef MINIZ_NO_STDIO
+static size_t mz_zip_file_write_func(void *pOpaque, mz_uint64 file_ofs,
+ const void *pBuf, size_t n) {
+ mz_zip_archive *pZip = (mz_zip_archive *)pOpaque;
+ mz_int64 cur_ofs = MZ_FTELL64(pZip->m_pState->m_pFile);
+ if (((mz_int64)file_ofs < 0) ||
+ (((cur_ofs != (mz_int64)file_ofs)) &&
+ (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET))))
+ return 0;
+ return MZ_FWRITE(pBuf, 1, n, pZip->m_pState->m_pFile);
+}
+
+mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename,
+ mz_uint64 size_to_reserve_at_beginning) {
+ MZ_FILE *pFile;
+ pZip->m_pWrite = mz_zip_file_write_func;
+ pZip->m_pIO_opaque = pZip;
+ if (!mz_zip_writer_init(pZip, size_to_reserve_at_beginning)) return MZ_FALSE;
+ if (NULL == (pFile = MZ_FOPEN(pFilename, "wb"))) {
+ mz_zip_writer_end(pZip);
+ return MZ_FALSE;
+ }
+ pZip->m_pState->m_pFile = pFile;
+ if (size_to_reserve_at_beginning) {
+ mz_uint64 cur_ofs = 0;
+ char buf[4096];
+ MZ_CLEAR_OBJ(buf);
+ do {
+ size_t n = (size_t)MZ_MIN(sizeof(buf), size_to_reserve_at_beginning);
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_ofs, buf, n) != n) {
+ mz_zip_writer_end(pZip);
+ return MZ_FALSE;
+ }
+ cur_ofs += n;
+ size_to_reserve_at_beginning -= n;
+ } while (size_to_reserve_at_beginning);
+ }
+ return MZ_TRUE;
+}
+#endif // #ifndef MINIZ_NO_STDIO
+
+mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip,
+ const char *pFilename) {
+ mz_zip_internal_state *pState;
+ if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
+ return MZ_FALSE;
+ // No sense in trying to write to an archive that's already at the support max
+ // size
+ if ((pZip->m_total_files == 0xFFFF) ||
+ ((pZip->m_archive_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE +
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE) > 0xFFFFFFFF))
+ return MZ_FALSE;
+
+ pState = pZip->m_pState;
+
+ if (pState->m_pFile) {
+#ifdef MINIZ_NO_STDIO
+ pFilename;
+ return MZ_FALSE;
+#else
+ // Archive is being read from stdio - try to reopen as writable.
+ if (pZip->m_pIO_opaque != pZip) return MZ_FALSE;
+ if (!pFilename) return MZ_FALSE;
+ pZip->m_pWrite = mz_zip_file_write_func;
+ if (NULL ==
+ (pState->m_pFile = MZ_FREOPEN(pFilename, "r+b", pState->m_pFile))) {
+ // The mz_zip_archive is now in a bogus state because pState->m_pFile is
+ // NULL, so just close it.
+ mz_zip_reader_end(pZip);
+ return MZ_FALSE;
+ }
+#endif // #ifdef MINIZ_NO_STDIO
+ } else if (pState->m_pMem) {
+ // Archive lives in a memory block. Assume it's from the heap that we can
+ // resize using the realloc callback.
+ if (pZip->m_pIO_opaque != pZip) return MZ_FALSE;
+ pState->m_mem_capacity = pState->m_mem_size;
+ pZip->m_pWrite = mz_zip_heap_write_func;
+ }
+ // Archive is being read via a user provided read function - make sure the
+ // user has specified a write function too.
+ else if (!pZip->m_pWrite)
+ return MZ_FALSE;
+
+ // Start writing new files at the archive's current central directory
+ // location.
+ pZip->m_archive_size = pZip->m_central_directory_file_ofs;
+ pZip->m_zip_mode = MZ_ZIP_MODE_WRITING;
+ pZip->m_central_directory_file_ofs = 0;
+
+ return MZ_TRUE;
+}
+
+mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name,
+ const void *pBuf, size_t buf_size,
+ mz_uint level_and_flags) {
+ return mz_zip_writer_add_mem_ex(pZip, pArchive_name, pBuf, buf_size, NULL, 0,
+ level_and_flags, 0, 0);
+}
+
+typedef struct {
+ mz_zip_archive *m_pZip;
+ mz_uint64 m_cur_archive_file_ofs;
+ mz_uint64 m_comp_size;
+} mz_zip_writer_add_state;
+
+static mz_bool mz_zip_writer_add_put_buf_callback(const void *pBuf, int len,
+ void *pUser) {
+ mz_zip_writer_add_state *pState = (mz_zip_writer_add_state *)pUser;
+ if ((int)pState->m_pZip->m_pWrite(pState->m_pZip->m_pIO_opaque,
+ pState->m_cur_archive_file_ofs, pBuf,
+ len) != len)
+ return MZ_FALSE;
+ pState->m_cur_archive_file_ofs += len;
+ pState->m_comp_size += len;
+ return MZ_TRUE;
+}
+
+static mz_bool mz_zip_writer_create_local_dir_header(
+ mz_zip_archive *pZip, mz_uint8 *pDst, mz_uint16 filename_size,
+ mz_uint16 extra_size, mz_uint64 uncomp_size, mz_uint64 comp_size,
+ mz_uint32 uncomp_crc32, mz_uint16 method, mz_uint16 bit_flags,
+ mz_uint16 dos_time, mz_uint16 dos_date) {
+ (void)pZip;
+ memset(pDst, 0, MZ_ZIP_LOCAL_DIR_HEADER_SIZE);
+ MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_SIG_OFS, MZ_ZIP_LOCAL_DIR_HEADER_SIG);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_VERSION_NEEDED_OFS, method ? 20 : 0);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_BIT_FLAG_OFS, bit_flags);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_METHOD_OFS, method);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_TIME_OFS, dos_time);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_DATE_OFS, dos_date);
+ MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_CRC32_OFS, uncomp_crc32);
+ MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS, comp_size);
+ MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS, uncomp_size);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILENAME_LEN_OFS, filename_size);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_EXTRA_LEN_OFS, extra_size);
+ return MZ_TRUE;
+}
+
+static mz_bool mz_zip_writer_create_central_dir_header(
+ mz_zip_archive *pZip, mz_uint8 *pDst, mz_uint16 filename_size,
+ mz_uint16 extra_size, mz_uint16 comment_size, mz_uint64 uncomp_size,
+ mz_uint64 comp_size, mz_uint32 uncomp_crc32, mz_uint16 method,
+ mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date,
+ mz_uint64 local_header_ofs, mz_uint32 ext_attributes) {
+ (void)pZip;
+ memset(pDst, 0, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE);
+ MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_SIG_OFS, MZ_ZIP_CENTRAL_DIR_HEADER_SIG);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_NEEDED_OFS, method ? 20 : 0);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_BIT_FLAG_OFS, bit_flags);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_METHOD_OFS, method);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_TIME_OFS, dos_time);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_DATE_OFS, dos_date);
+ MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_CRC32_OFS, uncomp_crc32);
+ MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS, comp_size);
+ MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS, uncomp_size);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILENAME_LEN_OFS, filename_size);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_EXTRA_LEN_OFS, extra_size);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_COMMENT_LEN_OFS, comment_size);
+ MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS, ext_attributes);
+ MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_LOCAL_HEADER_OFS, local_header_ofs);
+ return MZ_TRUE;
+}
+
+static mz_bool mz_zip_writer_add_to_central_dir(
+ mz_zip_archive *pZip, const char *pFilename, mz_uint16 filename_size,
+ const void *pExtra, mz_uint16 extra_size, const void *pComment,
+ mz_uint16 comment_size, mz_uint64 uncomp_size, mz_uint64 comp_size,
+ mz_uint32 uncomp_crc32, mz_uint16 method, mz_uint16 bit_flags,
+ mz_uint16 dos_time, mz_uint16 dos_date, mz_uint64 local_header_ofs,
+ mz_uint32 ext_attributes) {
+ mz_zip_internal_state *pState = pZip->m_pState;
+ mz_uint32 central_dir_ofs = (mz_uint32)pState->m_central_dir.m_size;
+ size_t orig_central_dir_size = pState->m_central_dir.m_size;
+ mz_uint8 central_dir_header[MZ_ZIP_CENTRAL_DIR_HEADER_SIZE];
+
+ // No zip64 support yet
+ if ((local_header_ofs > 0xFFFFFFFF) ||
+ (((mz_uint64)pState->m_central_dir.m_size +
+ MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + extra_size +
+ comment_size) > 0xFFFFFFFF))
+ return MZ_FALSE;
+
+ if (!mz_zip_writer_create_central_dir_header(
+ pZip, central_dir_header, filename_size, extra_size, comment_size,
+ uncomp_size, comp_size, uncomp_crc32, method, bit_flags, dos_time,
+ dos_date, local_header_ofs, ext_attributes))
+ return MZ_FALSE;
+
+ if ((!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_dir_header,
+ MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)) ||
+ (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pFilename,
+ filename_size)) ||
+ (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pExtra,
+ extra_size)) ||
+ (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pComment,
+ comment_size)) ||
+ (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets,
+ &central_dir_ofs, 1))) {
+ // Try to push the central directory array back into its original state.
+ mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size,
+ MZ_FALSE);
+ return MZ_FALSE;
+ }
+
+ return MZ_TRUE;
+}
+
+static mz_bool mz_zip_writer_validate_archive_name(const char *pArchive_name) {
+ // Basic ZIP archive filename validity checks: Valid filenames cannot start
+ // with a forward slash, cannot contain a drive letter, and cannot use
+ // DOS-style backward slashes.
+ if (*pArchive_name == '/') return MZ_FALSE;
+ while (*pArchive_name) {
+ if ((*pArchive_name == '\\') || (*pArchive_name == ':')) return MZ_FALSE;
+ pArchive_name++;
+ }
+ return MZ_TRUE;
+}
+
+static mz_uint mz_zip_writer_compute_padding_needed_for_file_alignment(
+ mz_zip_archive *pZip) {
+ mz_uint32 n;
+ if (!pZip->m_file_offset_alignment) return 0;
+ n = (mz_uint32)(pZip->m_archive_size & (pZip->m_file_offset_alignment - 1));
+ return (pZip->m_file_offset_alignment - n) &
+ (pZip->m_file_offset_alignment - 1);
+}
+
+static mz_bool mz_zip_writer_write_zeros(mz_zip_archive *pZip,
+ mz_uint64 cur_file_ofs, mz_uint32 n) {
+ char buf[4096];
+ memset(buf, 0, MZ_MIN(sizeof(buf), n));
+ while (n) {
+ mz_uint32 s = MZ_MIN(sizeof(buf), n);
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_file_ofs, buf, s) != s)
+ return MZ_FALSE;
+ cur_file_ofs += s;
+ n -= s;
+ }
+ return MZ_TRUE;
+}
+
+mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip,
+ const char *pArchive_name, const void *pBuf,
+ size_t buf_size, const void *pComment,
+ mz_uint16 comment_size,
+ mz_uint level_and_flags, mz_uint64 uncomp_size,
+ mz_uint32 uncomp_crc32) {
+ mz_uint16 method = 0, dos_time = 0, dos_date = 0;
+ mz_uint level, ext_attributes = 0, num_alignment_padding_bytes;
+ mz_uint64 local_dir_header_ofs = pZip->m_archive_size,
+ cur_archive_file_ofs = pZip->m_archive_size, comp_size = 0;
+ size_t archive_name_size;
+ mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE];
+ tdefl_compressor *pComp = NULL;
+ mz_bool store_data_uncompressed;
+ mz_zip_internal_state *pState;
+
+ if ((int)level_and_flags < 0) level_and_flags = MZ_DEFAULT_LEVEL;
+ level = level_and_flags & 0xF;
+ store_data_uncompressed =
+ ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA));
+
+ if ((!pZip) || (!pZip->m_pState) ||
+ (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) ||
+ (!pArchive_name) || ((comment_size) && (!pComment)) ||
+ (pZip->m_total_files == 0xFFFF) || (level > MZ_UBER_COMPRESSION))
+ return MZ_FALSE;
+
+ pState = pZip->m_pState;
+
+ if ((!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (uncomp_size))
+ return MZ_FALSE;
+ // No zip64 support yet
+ if ((buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF)) return MZ_FALSE;
+ if (!mz_zip_writer_validate_archive_name(pArchive_name)) return MZ_FALSE;
+
+#ifndef MINIZ_NO_TIME
+ {
+ time_t cur_time;
+ time(&cur_time);
+ mz_zip_time_to_dos_time(cur_time, &dos_time, &dos_date);
+ }
+#endif // #ifndef MINIZ_NO_TIME
+
+ archive_name_size = strlen(pArchive_name);
+ if (archive_name_size > 0xFFFF) return MZ_FALSE;
+
+ num_alignment_padding_bytes =
+ mz_zip_writer_compute_padding_needed_for_file_alignment(pZip);
+
+ // no zip64 support yet
+ if ((pZip->m_total_files == 0xFFFF) ||
+ ((pZip->m_archive_size + num_alignment_padding_bytes +
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE +
+ comment_size + archive_name_size) > 0xFFFFFFFF))
+ return MZ_FALSE;
+
+ if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/')) {
+ // Set DOS Subdirectory attribute bit.
+ ext_attributes |= 0x10;
+ // Subdirectories cannot contain data.
+ if ((buf_size) || (uncomp_size)) return MZ_FALSE;
+ }
+
+ // Try to do any allocations before writing to the archive, so if an
+ // allocation fails the file remains unmodified. (A good idea if we're doing
+ // an in-place modification.)
+ if ((!mz_zip_array_ensure_room(
+ pZip, &pState->m_central_dir,
+ MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size)) ||
+ (!mz_zip_array_ensure_room(pZip, &pState->m_central_dir_offsets, 1)))
+ return MZ_FALSE;
+
+ if ((!store_data_uncompressed) && (buf_size)) {
+ if (NULL == (pComp = (tdefl_compressor *)pZip->m_pAlloc(
+ pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor))))
+ return MZ_FALSE;
+ }
+
+ if (!mz_zip_writer_write_zeros(
+ pZip, cur_archive_file_ofs,
+ num_alignment_padding_bytes + sizeof(local_dir_header))) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
+ return MZ_FALSE;
+ }
+ local_dir_header_ofs += num_alignment_padding_bytes;
+ if (pZip->m_file_offset_alignment) {
+ MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) ==
+ 0);
+ }
+ cur_archive_file_ofs +=
+ num_alignment_padding_bytes + sizeof(local_dir_header);
+
+ MZ_CLEAR_OBJ(local_dir_header);
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name,
+ archive_name_size) != archive_name_size) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
+ return MZ_FALSE;
+ }
+ cur_archive_file_ofs += archive_name_size;
+
+ if (!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) {
+ uncomp_crc32 =
+ (mz_uint32)mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, buf_size);
+ uncomp_size = buf_size;
+ if (uncomp_size <= 3) {
+ level = 0;
+ store_data_uncompressed = MZ_TRUE;
+ }
+ }
+
+ if (store_data_uncompressed) {
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pBuf,
+ buf_size) != buf_size) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
+ return MZ_FALSE;
+ }
+
+ cur_archive_file_ofs += buf_size;
+ comp_size = buf_size;
+
+ if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA) method = MZ_DEFLATED;
+ } else if (buf_size) {
+ mz_zip_writer_add_state state;
+
+ state.m_pZip = pZip;
+ state.m_cur_archive_file_ofs = cur_archive_file_ofs;
+ state.m_comp_size = 0;
+
+ if ((tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state,
+ tdefl_create_comp_flags_from_zip_params(
+ level, -15, MZ_DEFAULT_STRATEGY)) !=
+ TDEFL_STATUS_OKAY) ||
+ (tdefl_compress_buffer(pComp, pBuf, buf_size, TDEFL_FINISH) !=
+ TDEFL_STATUS_DONE)) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
+ return MZ_FALSE;
+ }
+
+ comp_size = state.m_comp_size;
+ cur_archive_file_ofs = state.m_cur_archive_file_ofs;
+
+ method = MZ_DEFLATED;
+ }
+
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
+ pComp = NULL;
+
+ // no zip64 support yet
+ if ((comp_size > 0xFFFFFFFF) || (cur_archive_file_ofs > 0xFFFFFFFF))
+ return MZ_FALSE;
+
+ if (!mz_zip_writer_create_local_dir_header(
+ pZip, local_dir_header, (mz_uint16)archive_name_size, 0, uncomp_size,
+ comp_size, uncomp_crc32, method, 0, dos_time, dos_date))
+ return MZ_FALSE;
+
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header,
+ sizeof(local_dir_header)) != sizeof(local_dir_header))
+ return MZ_FALSE;
+
+ if (!mz_zip_writer_add_to_central_dir(
+ pZip, pArchive_name, (mz_uint16)archive_name_size, NULL, 0, pComment,
+ comment_size, uncomp_size, comp_size, uncomp_crc32, method, 0,
+ dos_time, dos_date, local_dir_header_ofs, ext_attributes))
+ return MZ_FALSE;
+
+ pZip->m_total_files++;
+ pZip->m_archive_size = cur_archive_file_ofs;
+
+ return MZ_TRUE;
+}
+
+#ifndef MINIZ_NO_STDIO
+mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name,
+ const char *pSrc_filename, const void *pComment,
+ mz_uint16 comment_size,
+ mz_uint level_and_flags) {
+ mz_uint uncomp_crc32 = MZ_CRC32_INIT, level, num_alignment_padding_bytes;
+ mz_uint16 method = 0, dos_time = 0, dos_date = 0, ext_attributes = 0;
+ mz_uint64 local_dir_header_ofs = pZip->m_archive_size,
+ cur_archive_file_ofs = pZip->m_archive_size, uncomp_size = 0,
+ comp_size = 0;
+ size_t archive_name_size;
+ mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE];
+ MZ_FILE *pSrc_file = NULL;
+
+ if ((int)level_and_flags < 0) level_and_flags = MZ_DEFAULT_LEVEL;
+ level = level_and_flags & 0xF;
+
+ if ((!pZip) || (!pZip->m_pState) ||
+ (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) ||
+ ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
+ return MZ_FALSE;
+ if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA) return MZ_FALSE;
+ if (!mz_zip_writer_validate_archive_name(pArchive_name)) return MZ_FALSE;
+
+ archive_name_size = strlen(pArchive_name);
+ if (archive_name_size > 0xFFFF) return MZ_FALSE;
+
+ num_alignment_padding_bytes =
+ mz_zip_writer_compute_padding_needed_for_file_alignment(pZip);
+
+ // no zip64 support yet
+ if ((pZip->m_total_files == 0xFFFF) ||
+ ((pZip->m_archive_size + num_alignment_padding_bytes +
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE +
+ comment_size + archive_name_size) > 0xFFFFFFFF))
+ return MZ_FALSE;
+
+ if (!mz_zip_get_file_modified_time(pSrc_filename, &dos_time, &dos_date))
+ return MZ_FALSE;
+
+ pSrc_file = MZ_FOPEN(pSrc_filename, "rb");
+ if (!pSrc_file) return MZ_FALSE;
+ MZ_FSEEK64(pSrc_file, 0, SEEK_END);
+ uncomp_size = MZ_FTELL64(pSrc_file);
+ MZ_FSEEK64(pSrc_file, 0, SEEK_SET);
+
+ if (uncomp_size > 0xFFFFFFFF) {
+ // No zip64 support yet
+ MZ_FCLOSE(pSrc_file);
+ return MZ_FALSE;
+ }
+ if (uncomp_size <= 3) level = 0;
+
+ if (!mz_zip_writer_write_zeros(
+ pZip, cur_archive_file_ofs,
+ num_alignment_padding_bytes + sizeof(local_dir_header))) {
+ MZ_FCLOSE(pSrc_file);
+ return MZ_FALSE;
+ }
+ local_dir_header_ofs += num_alignment_padding_bytes;
+ if (pZip->m_file_offset_alignment) {
+ MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) ==
+ 0);
+ }
+ cur_archive_file_ofs +=
+ num_alignment_padding_bytes + sizeof(local_dir_header);
+
+ MZ_CLEAR_OBJ(local_dir_header);
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name,
+ archive_name_size) != archive_name_size) {
+ MZ_FCLOSE(pSrc_file);
+ return MZ_FALSE;
+ }
+ cur_archive_file_ofs += archive_name_size;
+
+ if (uncomp_size) {
+ mz_uint64 uncomp_remaining = uncomp_size;
+ void *pRead_buf =
+ pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, MZ_ZIP_MAX_IO_BUF_SIZE);
+ if (!pRead_buf) {
+ MZ_FCLOSE(pSrc_file);
+ return MZ_FALSE;
+ }
+
+ if (!level) {
+ while (uncomp_remaining) {
+ mz_uint n =
+ (mz_uint)MZ_MIN((mz_uint)MZ_ZIP_MAX_IO_BUF_SIZE, uncomp_remaining);
+ if ((MZ_FREAD(pRead_buf, 1, n, pSrc_file) != n) ||
+ (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pRead_buf,
+ n) != n)) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
+ MZ_FCLOSE(pSrc_file);
+ return MZ_FALSE;
+ }
+ uncomp_crc32 =
+ (mz_uint32)mz_crc32(uncomp_crc32, (const mz_uint8 *)pRead_buf, n);
+ uncomp_remaining -= n;
+ cur_archive_file_ofs += n;
+ }
+ comp_size = uncomp_size;
+ } else {
+ mz_bool result = MZ_FALSE;
+ mz_zip_writer_add_state state;
+ tdefl_compressor *pComp = (tdefl_compressor *)pZip->m_pAlloc(
+ pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor));
+ if (!pComp) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
+ MZ_FCLOSE(pSrc_file);
+ return MZ_FALSE;
+ }
+
+ state.m_pZip = pZip;
+ state.m_cur_archive_file_ofs = cur_archive_file_ofs;
+ state.m_comp_size = 0;
+
+ if (tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state,
+ tdefl_create_comp_flags_from_zip_params(
+ level, -15, MZ_DEFAULT_STRATEGY)) !=
+ TDEFL_STATUS_OKAY) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
+ MZ_FCLOSE(pSrc_file);
+ return MZ_FALSE;
+ }
+
+ for (;;) {
+ size_t in_buf_size = (mz_uint32)MZ_MIN(uncomp_remaining,
+ (mz_uint)MZ_ZIP_MAX_IO_BUF_SIZE);
+ tdefl_status status;
+
+ if (MZ_FREAD(pRead_buf, 1, in_buf_size, pSrc_file) != in_buf_size)
+ break;
+
+ uncomp_crc32 = (mz_uint32)mz_crc32(
+ uncomp_crc32, (const mz_uint8 *)pRead_buf, in_buf_size);
+ uncomp_remaining -= in_buf_size;
+
+ status = tdefl_compress_buffer(
+ pComp, pRead_buf, in_buf_size,
+ uncomp_remaining ? TDEFL_NO_FLUSH : TDEFL_FINISH);
+ if (status == TDEFL_STATUS_DONE) {
+ result = MZ_TRUE;
+ break;
+ } else if (status != TDEFL_STATUS_OKAY)
+ break;
+ }
+
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
+
+ if (!result) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
+ MZ_FCLOSE(pSrc_file);
+ return MZ_FALSE;
+ }
+
+ comp_size = state.m_comp_size;
+ cur_archive_file_ofs = state.m_cur_archive_file_ofs;
+
+ method = MZ_DEFLATED;
+ }
+
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
+ }
+
+ MZ_FCLOSE(pSrc_file);
+ pSrc_file = NULL;
+
+ // no zip64 support yet
+ if ((comp_size > 0xFFFFFFFF) || (cur_archive_file_ofs > 0xFFFFFFFF))
+ return MZ_FALSE;
+
+ if (!mz_zip_writer_create_local_dir_header(
+ pZip, local_dir_header, (mz_uint16)archive_name_size, 0, uncomp_size,
+ comp_size, uncomp_crc32, method, 0, dos_time, dos_date))
+ return MZ_FALSE;
+
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header,
+ sizeof(local_dir_header)) != sizeof(local_dir_header))
+ return MZ_FALSE;
+
+ if (!mz_zip_writer_add_to_central_dir(
+ pZip, pArchive_name, (mz_uint16)archive_name_size, NULL, 0, pComment,
+ comment_size, uncomp_size, comp_size, uncomp_crc32, method, 0,
+ dos_time, dos_date, local_dir_header_ofs, ext_attributes))
+ return MZ_FALSE;
+
+ pZip->m_total_files++;
+ pZip->m_archive_size = cur_archive_file_ofs;
+
+ return MZ_TRUE;
+}
+#endif // #ifndef MINIZ_NO_STDIO
+
+mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip,
+ mz_zip_archive *pSource_zip,
+ mz_uint file_index) {
+ mz_uint n, bit_flags, num_alignment_padding_bytes;
+ mz_uint64 comp_bytes_remaining, local_dir_header_ofs;
+ mz_uint64 cur_src_file_ofs, cur_dst_file_ofs;
+ mz_uint32
+ local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) /
+ sizeof(mz_uint32)];
+ mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32;
+ mz_uint8 central_header[MZ_ZIP_CENTRAL_DIR_HEADER_SIZE];
+ size_t orig_central_dir_size;
+ mz_zip_internal_state *pState;
+ void *pBuf;
+ const mz_uint8 *pSrc_central_header;
+
+ if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING))
+ return MZ_FALSE;
+ if (NULL ==
+ (pSrc_central_header = mz_zip_reader_get_cdh(pSource_zip, file_index)))
+ return MZ_FALSE;
+ pState = pZip->m_pState;
+
+ num_alignment_padding_bytes =
+ mz_zip_writer_compute_padding_needed_for_file_alignment(pZip);
+
+ // no zip64 support yet
+ if ((pZip->m_total_files == 0xFFFF) ||
+ ((pZip->m_archive_size + num_alignment_padding_bytes +
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) >
+ 0xFFFFFFFF))
+ return MZ_FALSE;
+
+ cur_src_file_ofs =
+ MZ_READ_LE32(pSrc_central_header + MZ_ZIP_CDH_LOCAL_HEADER_OFS);
+ cur_dst_file_ofs = pZip->m_archive_size;
+
+ if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs,
+ pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) !=
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
+ return MZ_FALSE;
+ if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
+ return MZ_FALSE;
+ cur_src_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE;
+
+ if (!mz_zip_writer_write_zeros(pZip, cur_dst_file_ofs,
+ num_alignment_padding_bytes))
+ return MZ_FALSE;
+ cur_dst_file_ofs += num_alignment_padding_bytes;
+ local_dir_header_ofs = cur_dst_file_ofs;
+ if (pZip->m_file_offset_alignment) {
+ MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) ==
+ 0);
+ }
+
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pLocal_header,
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE) !=
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
+ return MZ_FALSE;
+ cur_dst_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE;
+
+ n = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) +
+ MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS);
+ comp_bytes_remaining =
+ n + MZ_READ_LE32(pSrc_central_header + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS);
+
+ if (NULL == (pBuf = pZip->m_pAlloc(
+ pZip->m_pAlloc_opaque, 1,
+ (size_t)MZ_MAX(sizeof(mz_uint32) * 4,
+ MZ_MIN((mz_uint)MZ_ZIP_MAX_IO_BUF_SIZE,
+ comp_bytes_remaining)))))
+ return MZ_FALSE;
+
+ while (comp_bytes_remaining) {
+ n = (mz_uint)MZ_MIN((mz_uint)MZ_ZIP_MAX_IO_BUF_SIZE, comp_bytes_remaining);
+ if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf,
+ n) != n) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
+ return MZ_FALSE;
+ }
+ cur_src_file_ofs += n;
+
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
+ return MZ_FALSE;
+ }
+ cur_dst_file_ofs += n;
+
+ comp_bytes_remaining -= n;
+ }
+
+ bit_flags = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_BIT_FLAG_OFS);
+ if (bit_flags & 8) {
+ // Copy data descriptor
+ if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf,
+ sizeof(mz_uint32) * 4) != sizeof(mz_uint32) * 4) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
+ return MZ_FALSE;
+ }
+
+ n = sizeof(mz_uint32) * ((MZ_READ_LE32(pBuf) == 0x08074b50) ? 4 : 3);
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
+ return MZ_FALSE;
+ }
+
+ cur_src_file_ofs += n;
+ cur_dst_file_ofs += n;
+ }
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
+
+ // no zip64 support yet
+ if (cur_dst_file_ofs > 0xFFFFFFFF) return MZ_FALSE;
+
+ orig_central_dir_size = pState->m_central_dir.m_size;
+
+ memcpy(central_header, pSrc_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE);
+ MZ_WRITE_LE32(central_header + MZ_ZIP_CDH_LOCAL_HEADER_OFS,
+ local_dir_header_ofs);
+ if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_header,
+ MZ_ZIP_CENTRAL_DIR_HEADER_SIZE))
+ return MZ_FALSE;
+
+ n = MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_FILENAME_LEN_OFS) +
+ MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_EXTRA_LEN_OFS) +
+ MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_COMMENT_LEN_OFS);
+ if (!mz_zip_array_push_back(
+ pZip, &pState->m_central_dir,
+ pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n)) {
+ mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size,
+ MZ_FALSE);
+ return MZ_FALSE;
+ }
+
+ if (pState->m_central_dir.m_size > 0xFFFFFFFF) return MZ_FALSE;
+ n = (mz_uint32)orig_central_dir_size;
+ if (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, &n, 1)) {
+ mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size,
+ MZ_FALSE);
+ return MZ_FALSE;
+ }
+
+ pZip->m_total_files++;
+ pZip->m_archive_size = cur_dst_file_ofs;
+
+ return MZ_TRUE;
+}
+
+mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip) {
+ mz_zip_internal_state *pState;
+ mz_uint64 central_dir_ofs, central_dir_size;
+ mz_uint8 hdr[MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE];
+
+ if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING))
+ return MZ_FALSE;
+
+ pState = pZip->m_pState;
+
+ // no zip64 support yet
+ if ((pZip->m_total_files > 0xFFFF) ||
+ ((pZip->m_archive_size + pState->m_central_dir.m_size +
+ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) > 0xFFFFFFFF))
+ return MZ_FALSE;
+
+ central_dir_ofs = 0;
+ central_dir_size = 0;
+ if (pZip->m_total_files) {
+ // Write central directory
+ central_dir_ofs = pZip->m_archive_size;
+ central_dir_size = pState->m_central_dir.m_size;
+ pZip->m_central_directory_file_ofs = central_dir_ofs;
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, central_dir_ofs,
+ pState->m_central_dir.m_p,
+ (size_t)central_dir_size) != central_dir_size)
+ return MZ_FALSE;
+ pZip->m_archive_size += central_dir_size;
+ }
+
+ // Write end of central directory record
+ MZ_CLEAR_OBJ(hdr);
+ MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_SIG_OFS,
+ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG);
+ MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS,
+ pZip->m_total_files);
+ MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS, pZip->m_total_files);
+ MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_SIZE_OFS, central_dir_size);
+ MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_OFS_OFS, central_dir_ofs);
+
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr,
+ sizeof(hdr)) != sizeof(hdr))
+ return MZ_FALSE;
+#ifndef MINIZ_NO_STDIO
+ if ((pState->m_pFile) && (MZ_FFLUSH(pState->m_pFile) == EOF)) return MZ_FALSE;
+#endif // #ifndef MINIZ_NO_STDIO
+
+ pZip->m_archive_size += sizeof(hdr);
+
+ pZip->m_zip_mode = MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED;
+ return MZ_TRUE;
+}
+
+mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **pBuf,
+ size_t *pSize) {
+ if ((!pZip) || (!pZip->m_pState) || (!pBuf) || (!pSize)) return MZ_FALSE;
+ if (pZip->m_pWrite != mz_zip_heap_write_func) return MZ_FALSE;
+ if (!mz_zip_writer_finalize_archive(pZip)) return MZ_FALSE;
+
+ *pBuf = pZip->m_pState->m_pMem;
+ *pSize = pZip->m_pState->m_mem_size;
+ pZip->m_pState->m_pMem = NULL;
+ pZip->m_pState->m_mem_size = pZip->m_pState->m_mem_capacity = 0;
+ return MZ_TRUE;
+}
+
+mz_bool mz_zip_writer_end(mz_zip_archive *pZip) {
+ mz_zip_internal_state *pState;
+ mz_bool status = MZ_TRUE;
+ if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) ||
+ ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) &&
+ (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED)))
+ return MZ_FALSE;
+
+ pState = pZip->m_pState;
+ pZip->m_pState = NULL;
+ mz_zip_array_clear(pZip, &pState->m_central_dir);
+ mz_zip_array_clear(pZip, &pState->m_central_dir_offsets);
+ mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets);
+
+#ifndef MINIZ_NO_STDIO
+ if (pState->m_pFile) {
+ MZ_FCLOSE(pState->m_pFile);
+ pState->m_pFile = NULL;
+ }
+#endif // #ifndef MINIZ_NO_STDIO
+
+ if ((pZip->m_pWrite == mz_zip_heap_write_func) && (pState->m_pMem)) {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pState->m_pMem);
+ pState->m_pMem = NULL;
+ }
+
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
+ pZip->m_zip_mode = MZ_ZIP_MODE_INVALID;
+ return status;
+}
+
+#ifndef MINIZ_NO_STDIO
+mz_bool mz_zip_add_mem_to_archive_file_in_place(
+ const char *pZip_filename, const char *pArchive_name, const void *pBuf,
+ size_t buf_size, const void *pComment, mz_uint16 comment_size,
+ mz_uint level_and_flags) {
+ mz_bool status, created_new_archive = MZ_FALSE;
+ mz_zip_archive zip_archive;
+ struct MZ_FILE_STAT_STRUCT file_stat;
+ MZ_CLEAR_OBJ(zip_archive);
+ if ((int)level_and_flags < 0) level_and_flags = MZ_DEFAULT_LEVEL;
+ if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) ||
+ ((comment_size) && (!pComment)) ||
+ ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION))
+ return MZ_FALSE;
+ if (!mz_zip_writer_validate_archive_name(pArchive_name)) return MZ_FALSE;
+ if (MZ_FILE_STAT(pZip_filename, &file_stat) != 0) {
+ // Create a new archive.
+ if (!mz_zip_writer_init_file(&zip_archive, pZip_filename, 0))
+ return MZ_FALSE;
+ created_new_archive = MZ_TRUE;
+ } else {
+ // Append to an existing archive.
+ if (!mz_zip_reader_init_file(
+ &zip_archive, pZip_filename,
+ level_and_flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY))
+ return MZ_FALSE;
+ if (!mz_zip_writer_init_from_reader(&zip_archive, pZip_filename)) {
+ mz_zip_reader_end(&zip_archive);
+ return MZ_FALSE;
+ }
+ }
+ status =
+ mz_zip_writer_add_mem_ex(&zip_archive, pArchive_name, pBuf, buf_size,
+ pComment, comment_size, level_and_flags, 0, 0);
+ // Always finalize, even if adding failed for some reason, so we have a valid
+ // central directory. (This may not always succeed, but we can try.)
+ if (!mz_zip_writer_finalize_archive(&zip_archive)) status = MZ_FALSE;
+ if (!mz_zip_writer_end(&zip_archive)) status = MZ_FALSE;
+ if ((!status) && (created_new_archive)) {
+ // It's a new archive and something went wrong, so just delete it.
+ int ignoredStatus = MZ_DELETE_FILE(pZip_filename);
+ (void)ignoredStatus;
+ }
+ return status;
+}
+
+void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename,
+ const char *pArchive_name,
+ size_t *pSize, mz_uint flags) {
+ int file_index;
+ mz_zip_archive zip_archive;
+ void *p = NULL;
+
+ if (pSize) *pSize = 0;
+
+ if ((!pZip_filename) || (!pArchive_name)) return NULL;
+
+ MZ_CLEAR_OBJ(zip_archive);
+ if (!mz_zip_reader_init_file(
+ &zip_archive, pZip_filename,
+ flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY))
+ return NULL;
+
+ if ((file_index = mz_zip_reader_locate_file(&zip_archive, pArchive_name, NULL,
+ flags)) >= 0)
+ p = mz_zip_reader_extract_to_heap(&zip_archive, file_index, pSize, flags);
+
+ mz_zip_reader_end(&zip_archive);
+ return p;
+}
+
+#endif // #ifndef MINIZ_NO_STDIO
+
+#endif // #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
+
+#endif // #ifndef MINIZ_NO_ARCHIVE_APIS
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MINIZ_HEADER_FILE_ONLY
+
+/*
+ This is free and unencumbered software released into the public domain.
+
+ Anyone is free to copy, modify, publish, use, compile, sell, or
+ distribute this software, either in source code form or as a compiled
+ binary, for any purpose, commercial or non-commercial, and by any
+ means.
+
+ In jurisdictions that recognize copyright laws, the author or authors
+ of this software dedicate any and all copyright interest in the
+ software to the public domain. We make this dedication for the benefit
+ of the public at large and to the detriment of our heirs and
+ successors. We intend this dedication to be an overt act of
+ relinquishment in perpetuity of all present and future rights to this
+ software under copyright law.
+
+ 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 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.
+
+ For more information, please refer to <http://unlicense.org/>
+*/
+
+// ---------------------- end of miniz ----------------------------------------
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+}
+#else
+
+// Reuse MINIZ_LITTE_ENDIAN macro
+
+#if defined(__sparcv9)
+// Big endian
+#else
+#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || MINIZ_X86_OR_X64_CPU
+// Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian.
+#define MINIZ_LITTLE_ENDIAN 1
+#endif
+#endif
+
+#endif // TINYEXR_USE_MINIZ
+
+// static bool IsBigEndian(void) {
+// union {
+// unsigned int i;
+// char c[4];
+// } bint = {0x01020304};
+//
+// return bint.c[0] == 1;
+//}
+
+static const int kEXRVersionSize = 8;
+
+static void swap2(unsigned short *val) {
+#ifdef MINIZ_LITTLE_ENDIAN
+ (void)val;
+#else
+ unsigned short tmp = *val;
+ unsigned char *dst = reinterpret_cast<unsigned char *>(val);
+ unsigned char *src = reinterpret_cast<unsigned char *>(&tmp);
+
+ dst[0] = src[1];
+ dst[1] = src[0];
+#endif
+}
+
+static void swap4(unsigned int *val) {
+#ifdef MINIZ_LITTLE_ENDIAN
+ (void)val;
+#else
+ unsigned int tmp = *val;
+ unsigned char *dst = reinterpret_cast<unsigned char *>(val);
+ unsigned char *src = reinterpret_cast<unsigned char *>(&tmp);
+
+ dst[0] = src[3];
+ dst[1] = src[2];
+ dst[2] = src[1];
+ dst[3] = src[0];
+#endif
+}
+
+static void swap8(tinyexr::tinyexr_uint64 *val) {
+#ifdef MINIZ_LITTLE_ENDIAN
+ (void)val;
+#else
+ tinyexr::tinyexr_uint64 tmp = (*val);
+ unsigned char *dst = reinterpret_cast<unsigned char *>(val);
+ unsigned char *src = reinterpret_cast<unsigned char *>(&tmp);
+
+ dst[0] = src[7];
+ dst[1] = src[6];
+ dst[2] = src[5];
+ dst[3] = src[4];
+ dst[4] = src[3];
+ dst[5] = src[2];
+ dst[6] = src[1];
+ dst[7] = src[0];
+#endif
+}
+
+// https://gist.github.com/rygorous/2156668
+// Reuse MINIZ_LITTLE_ENDIAN flag from miniz.
+union FP32 {
+ unsigned int u;
+ float f;
+ struct {
+#if MINIZ_LITTLE_ENDIAN
+ unsigned int Mantissa : 23;
+ unsigned int Exponent : 8;
+ unsigned int Sign : 1;
+#else
+ unsigned int Sign : 1;
+ unsigned int Exponent : 8;
+ unsigned int Mantissa : 23;
+#endif
+ } s;
+};
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
+
+union FP16 {
+ unsigned short u;
+ struct {
+#if MINIZ_LITTLE_ENDIAN
+ unsigned int Mantissa : 10;
+ unsigned int Exponent : 5;
+ unsigned int Sign : 1;
+#else
+ unsigned int Sign : 1;
+ unsigned int Exponent : 5;
+ unsigned int Mantissa : 10;
+#endif
+ } s;
+};
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+static FP32 half_to_float(FP16 h) {
+ static const FP32 magic = {113 << 23};
+ static const unsigned int shifted_exp = 0x7c00
+ << 13; // exponent mask after shift
+ FP32 o;
+
+ o.u = (h.u & 0x7fffU) << 13U; // exponent/mantissa bits
+ unsigned int exp_ = shifted_exp & o.u; // just the exponent
+ o.u += (127 - 15) << 23; // exponent adjust
+
+ // handle exponent special cases
+ if (exp_ == shifted_exp) // Inf/NaN?
+ o.u += (128 - 16) << 23; // extra exp adjust
+ else if (exp_ == 0) // Zero/Denormal?
+ {
+ o.u += 1 << 23; // extra exp adjust
+ o.f -= magic.f; // renormalize
+ }
+
+ o.u |= (h.u & 0x8000U) << 16U; // sign bit
+ return o;
+}
+
+static FP16 float_to_half_full(FP32 f) {
+ FP16 o = {0};
+
+ // Based on ISPC reference code (with minor modifications)
+ if (f.s.Exponent == 0) // Signed zero/denormal (which will underflow)
+ o.s.Exponent = 0;
+ else if (f.s.Exponent == 255) // Inf or NaN (all exponent bits set)
+ {
+ o.s.Exponent = 31;
+ o.s.Mantissa = f.s.Mantissa ? 0x200 : 0; // NaN->qNaN and Inf->Inf
+ } else // Normalized number
+ {
+ // Exponent unbias the single, then bias the halfp
+ int newexp = f.s.Exponent - 127 + 15;
+ if (newexp >= 31) // Overflow, return signed infinity
+ o.s.Exponent = 31;
+ else if (newexp <= 0) // Underflow
+ {
+ if ((14 - newexp) <= 24) // Mantissa might be non-zero
+ {
+ unsigned int mant = f.s.Mantissa | 0x800000; // Hidden 1 bit
+ o.s.Mantissa = mant >> (14 - newexp);
+ if ((mant >> (13 - newexp)) & 1) // Check for rounding
+ o.u++; // Round, might overflow into exp bit, but this is OK
+ }
+ } else {
+ o.s.Exponent = static_cast<unsigned int>(newexp);
+ o.s.Mantissa = f.s.Mantissa >> 13;
+ if (f.s.Mantissa & 0x1000) // Check for rounding
+ o.u++; // Round, might overflow to inf, this is OK
+ }
+ }
+
+ o.s.Sign = f.s.Sign;
+ return o;
+}
+
+// NOTE: From OpenEXR code
+// #define IMF_INCREASING_Y 0
+// #define IMF_DECREASING_Y 1
+// #define IMF_RAMDOM_Y 2
+//
+// #define IMF_NO_COMPRESSION 0
+// #define IMF_RLE_COMPRESSION 1
+// #define IMF_ZIPS_COMPRESSION 2
+// #define IMF_ZIP_COMPRESSION 3
+// #define IMF_PIZ_COMPRESSION 4
+// #define IMF_PXR24_COMPRESSION 5
+// #define IMF_B44_COMPRESSION 6
+// #define IMF_B44A_COMPRESSION 7
+
+static const char *ReadString(std::string *s, const char *ptr) {
+ // Read untile NULL(\0).
+ const char *p = ptr;
+ const char *q = ptr;
+ while ((*q) != 0) q++;
+
+ (*s) = std::string(p, q);
+
+ return q + 1; // skip '\0'
+}
+
+static bool ReadAttribute(std::string *name, std::string *type,
+ std::vector<unsigned char> *data, size_t *marker_size,
+ const char *marker, size_t size) {
+ size_t name_len = strnlen(marker, size);
+ if (name_len == size) {
+ // String does not have a terminating character.
+ return false;
+ }
+ *name = std::string(marker, name_len);
+
+ marker += name_len + 1;
+ size -= name_len + 1;
+
+ size_t type_len = strnlen(marker, size);
+ if (type_len == size) {
+ return false;
+ }
+ *type = std::string(marker, type_len);
+
+ marker += type_len + 1;
+ size -= type_len + 1;
+
+ if (size < sizeof(uint32_t)) {
+ return false;
+ }
+
+ uint32_t data_len;
+ memcpy(&data_len, marker, sizeof(uint32_t));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&data_len));
+
+ marker += sizeof(uint32_t);
+ size -= sizeof(uint32_t);
+
+ if (size < data_len) {
+ return false;
+ }
+
+ data->resize(static_cast<size_t>(data_len));
+ memcpy(&data->at(0), marker, static_cast<size_t>(data_len));
+
+ *marker_size = name_len + 1 + type_len + 1 + sizeof(uint32_t) + data_len;
+ return true;
+}
+
+static void WriteAttributeToMemory(std::vector<unsigned char> *out,
+ const char *name, const char *type,
+ const unsigned char *data, int len) {
+ out->insert(out->end(), name, name + strlen(name) + 1);
+ out->insert(out->end(), type, type + strlen(type) + 1);
+
+ int outLen = len;
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&outLen));
+ out->insert(out->end(), reinterpret_cast<unsigned char *>(&outLen),
+ reinterpret_cast<unsigned char *>(&outLen) + sizeof(int));
+ out->insert(out->end(), data, data + len);
+}
+
+typedef struct {
+ std::string name; // less than 255 bytes long
+ int pixel_type;
+ int x_sampling;
+ int y_sampling;
+ unsigned char p_linear;
+ unsigned char pad[3];
+} ChannelInfo;
+
+typedef struct {
+ std::vector<tinyexr::ChannelInfo> channels;
+ std::vector<EXRAttribute> attributes;
+
+ int data_window[4];
+ int line_order;
+ int display_window[4];
+ float screen_window_center[2];
+ float screen_window_width;
+ float pixel_aspect_ratio;
+
+ int chunk_count;
+
+ // Tiled format
+ int tile_size_x;
+ int tile_size_y;
+ int tile_level_mode;
+ int tile_rounding_mode;
+
+ unsigned int header_len;
+
+ int compression_type;
+
+ void clear() {
+ channels.clear();
+ attributes.clear();
+
+ data_window[0] = 0;
+ data_window[1] = 0;
+ data_window[2] = 0;
+ data_window[3] = 0;
+ line_order = 0;
+ display_window[0] = 0;
+ display_window[1] = 0;
+ display_window[2] = 0;
+ display_window[3] = 0;
+ screen_window_center[0] = 0.0f;
+ screen_window_center[1] = 0.0f;
+ screen_window_width = 0.0f;
+ pixel_aspect_ratio = 0.0f;
+
+ chunk_count = 0;
+
+ // Tiled format
+ tile_size_x = 0;
+ tile_size_y = 0;
+ tile_level_mode = 0;
+ tile_rounding_mode = 0;
+
+ header_len = 0;
+ compression_type = 0;
+ }
+} HeaderInfo;
+
+static void ReadChannelInfo(std::vector<ChannelInfo> &channels,
+ const std::vector<unsigned char> &data) {
+ const char *p = reinterpret_cast<const char *>(&data.at(0));
+
+ for (;;) {
+ if ((*p) == 0) {
+ break;
+ }
+ ChannelInfo info;
+ p = ReadString(&info.name, p);
+
+ memcpy(&info.pixel_type, p, sizeof(int));
+ p += 4;
+ info.p_linear = static_cast<unsigned char>(p[0]); // uchar
+ p += 1 + 3; // reserved: uchar[3]
+ memcpy(&info.x_sampling, p, sizeof(int)); // int
+ p += 4;
+ memcpy(&info.y_sampling, p, sizeof(int)); // int
+ p += 4;
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&info.pixel_type));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&info.x_sampling));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&info.y_sampling));
+
+ channels.push_back(info);
+ }
+}
+
+static void WriteChannelInfo(std::vector<unsigned char> &data,
+ const std::vector<ChannelInfo> &channels) {
+ size_t sz = 0;
+
+ // Calculate total size.
+ for (size_t c = 0; c < channels.size(); c++) {
+ sz += strlen(channels[c].name.c_str()) + 1; // +1 for \0
+ sz += 16; // 4 * int
+ }
+ data.resize(sz + 1);
+
+ unsigned char *p = &data.at(0);
+
+ for (size_t c = 0; c < channels.size(); c++) {
+ memcpy(p, channels[c].name.c_str(), strlen(channels[c].name.c_str()));
+ p += strlen(channels[c].name.c_str());
+ (*p) = '\0';
+ p++;
+
+ int pixel_type = channels[c].pixel_type;
+ int x_sampling = channels[c].x_sampling;
+ int y_sampling = channels[c].y_sampling;
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&pixel_type));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&x_sampling));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&y_sampling));
+
+ memcpy(p, &pixel_type, sizeof(int));
+ p += sizeof(int);
+
+ (*p) = channels[c].p_linear;
+ p += 4;
+
+ memcpy(p, &x_sampling, sizeof(int));
+ p += sizeof(int);
+
+ memcpy(p, &y_sampling, sizeof(int));
+ p += sizeof(int);
+ }
+
+ (*p) = '\0';
+}
+
+static void CompressZip(unsigned char *dst,
+ tinyexr::tinyexr_uint64 &compressedSize,
+ const unsigned char *src, unsigned long src_size) {
+ std::vector<unsigned char> tmpBuf(src_size);
+
+ //
+ // Apply EXR-specific? postprocess. Grabbed from OpenEXR's
+ // ImfZipCompressor.cpp
+ //
+
+ //
+ // Reorder the pixel data.
+ //
+
+ const char *srcPtr = reinterpret_cast<const char *>(src);
+
+ {
+ char *t1 = reinterpret_cast<char *>(&tmpBuf.at(0));
+ char *t2 = reinterpret_cast<char *>(&tmpBuf.at(0)) + (src_size + 1) / 2;
+ const char *stop = srcPtr + src_size;
+
+ for (;;) {
+ if (srcPtr < stop)
+ *(t1++) = *(srcPtr++);
+ else
+ break;
+
+ if (srcPtr < stop)
+ *(t2++) = *(srcPtr++);
+ else
+ break;
+ }
+ }
+
+ //
+ // Predictor.
+ //
+
+ {
+ unsigned char *t = &tmpBuf.at(0) + 1;
+ unsigned char *stop = &tmpBuf.at(0) + src_size;
+ int p = t[-1];
+
+ while (t < stop) {
+ int d = int(t[0]) - p + (128 + 256);
+ p = t[0];
+ t[0] = static_cast<unsigned char>(d);
+ ++t;
+ }
+ }
+
+#if TINYEXR_USE_MINIZ
+ //
+ // Compress the data using miniz
+ //
+
+ miniz::mz_ulong outSize = miniz::mz_compressBound(src_size);
+ int ret = miniz::mz_compress(
+ dst, &outSize, static_cast<const unsigned char *>(&tmpBuf.at(0)),
+ src_size);
+ assert(ret == miniz::MZ_OK);
+ (void)ret;
+
+ compressedSize = outSize;
+#else
+ uLong outSize = compressBound(static_cast<uLong>(src_size));
+ int ret = compress(dst, &outSize, static_cast<const Bytef *>(&tmpBuf.at(0)),
+ src_size);
+ assert(ret == Z_OK);
+
+ compressedSize = outSize;
+#endif
+}
+
+static void DecompressZip(unsigned char *dst,
+ unsigned long *uncompressed_size /* inout */,
+ const unsigned char *src, unsigned long src_size) {
+ std::vector<unsigned char> tmpBuf(*uncompressed_size);
+
+#if TINYEXR_USE_MINIZ
+ int ret =
+ miniz::mz_uncompress(&tmpBuf.at(0), uncompressed_size, src, src_size);
+ assert(ret == miniz::MZ_OK);
+ (void)ret;
+#else
+ int ret = uncompress(&tmpBuf.at(0), uncompressed_size, src, src_size);
+ assert(ret == Z_OK);
+ (void)ret;
+#endif
+
+ //
+ // Apply EXR-specific? postprocess. Grabbed from OpenEXR's
+ // ImfZipCompressor.cpp
+ //
+
+ // Predictor.
+ {
+ unsigned char *t = &tmpBuf.at(0) + 1;
+ unsigned char *stop = &tmpBuf.at(0) + (*uncompressed_size);
+
+ while (t < stop) {
+ int d = int(t[-1]) + int(t[0]) - 128;
+ t[0] = static_cast<unsigned char>(d);
+ ++t;
+ }
+ }
+
+ // Reorder the pixel data.
+ {
+ const char *t1 = reinterpret_cast<const char *>(&tmpBuf.at(0));
+ const char *t2 = reinterpret_cast<const char *>(&tmpBuf.at(0)) +
+ (*uncompressed_size + 1) / 2;
+ char *s = reinterpret_cast<char *>(dst);
+ char *stop = s + (*uncompressed_size);
+
+ for (;;) {
+ if (s < stop)
+ *(s++) = *(t1++);
+ else
+ break;
+
+ if (s < stop)
+ *(s++) = *(t2++);
+ else
+ break;
+ }
+ }
+}
+
+// RLE code from OpenEXR --------------------------------------
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wsign-conversion"
+#endif
+
+const int MIN_RUN_LENGTH = 3;
+const int MAX_RUN_LENGTH = 127;
+
+//
+// Compress an array of bytes, using run-length encoding,
+// and return the length of the compressed data.
+//
+
+static int rleCompress(int inLength, const char in[], signed char out[]) {
+ const char *inEnd = in + inLength;
+ const char *runStart = in;
+ const char *runEnd = in + 1;
+ signed char *outWrite = out;
+
+ while (runStart < inEnd) {
+ while (runEnd < inEnd && *runStart == *runEnd &&
+ runEnd - runStart - 1 < MAX_RUN_LENGTH) {
+ ++runEnd;
+ }
+
+ if (runEnd - runStart >= MIN_RUN_LENGTH) {
+ //
+ // Compressable run
+ //
+
+ *outWrite++ = static_cast<char>(runEnd - runStart) - 1;
+ *outWrite++ = *(reinterpret_cast<const signed char *>(runStart));
+ runStart = runEnd;
+ } else {
+ //
+ // Uncompressable run
+ //
+
+ while (runEnd < inEnd &&
+ ((runEnd + 1 >= inEnd || *runEnd != *(runEnd + 1)) ||
+ (runEnd + 2 >= inEnd || *(runEnd + 1) != *(runEnd + 2))) &&
+ runEnd - runStart < MAX_RUN_LENGTH) {
+ ++runEnd;
+ }
+
+ *outWrite++ = static_cast<char>(runStart - runEnd);
+
+ while (runStart < runEnd) {
+ *outWrite++ = *(reinterpret_cast<const signed char *>(runStart++));
+ }
+ }
+
+ ++runEnd;
+ }
+
+ return static_cast<int>(outWrite - out);
+}
+
+//
+// Uncompress an array of bytes compressed with rleCompress().
+// Returns the length of the oncompressed data, or 0 if the
+// length of the uncompressed data would be more than maxLength.
+//
+
+static int rleUncompress(int inLength, int maxLength, const signed char in[],
+ char out[]) {
+ char *outStart = out;
+
+ while (inLength > 0) {
+ if (*in < 0) {
+ int count = -(static_cast<int>(*in++));
+ inLength -= count + 1;
+
+ if (0 > (maxLength -= count)) return 0;
+
+ memcpy(out, in, count);
+ out += count;
+ in += count;
+ } else {
+ int count = *in++;
+ inLength -= 2;
+
+ if (0 > (maxLength -= count + 1)) return 0;
+
+ memset(out, *reinterpret_cast<const char *>(in), count + 1);
+ out += count + 1;
+
+ in++;
+ }
+ }
+
+ return static_cast<int>(out - outStart);
+}
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+// End of RLE code from OpenEXR -----------------------------------
+
+static void CompressRle(unsigned char *dst,
+ tinyexr::tinyexr_uint64 &compressedSize,
+ const unsigned char *src, unsigned long src_size) {
+ std::vector<unsigned char> tmpBuf(src_size);
+
+ //
+ // Apply EXR-specific? postprocess. Grabbed from OpenEXR's
+ // ImfRleCompressor.cpp
+ //
+
+ //
+ // Reorder the pixel data.
+ //
+
+ const char *srcPtr = reinterpret_cast<const char *>(src);
+
+ {
+ char *t1 = reinterpret_cast<char *>(&tmpBuf.at(0));
+ char *t2 = reinterpret_cast<char *>(&tmpBuf.at(0)) + (src_size + 1) / 2;
+ const char *stop = srcPtr + src_size;
+
+ for (;;) {
+ if (srcPtr < stop)
+ *(t1++) = *(srcPtr++);
+ else
+ break;
+
+ if (srcPtr < stop)
+ *(t2++) = *(srcPtr++);
+ else
+ break;
+ }
+ }
+
+ //
+ // Predictor.
+ //
+
+ {
+ unsigned char *t = &tmpBuf.at(0) + 1;
+ unsigned char *stop = &tmpBuf.at(0) + src_size;
+ int p = t[-1];
+
+ while (t < stop) {
+ int d = int(t[0]) - p + (128 + 256);
+ p = t[0];
+ t[0] = static_cast<unsigned char>(d);
+ ++t;
+ }
+ }
+
+ // outSize will be (srcSiz * 3) / 2 at max.
+ int outSize = rleCompress(static_cast<int>(src_size),
+ reinterpret_cast<const char *>(&tmpBuf.at(0)),
+ reinterpret_cast<signed char *>(dst));
+ assert(outSize > 0);
+
+ compressedSize = static_cast<tinyexr::tinyexr_uint64>(outSize);
+}
+
+static void DecompressRle(unsigned char *dst,
+ const unsigned long uncompressed_size,
+ const unsigned char *src, unsigned long src_size) {
+ std::vector<unsigned char> tmpBuf(uncompressed_size);
+
+ int ret = rleUncompress(static_cast<int>(src_size),
+ static_cast<int>(uncompressed_size),
+ reinterpret_cast<const signed char *>(src),
+ reinterpret_cast<char *>(&tmpBuf.at(0)));
+ assert(ret == static_cast<int>(uncompressed_size));
+ (void)ret;
+
+ //
+ // Apply EXR-specific? postprocess. Grabbed from OpenEXR's
+ // ImfRleCompressor.cpp
+ //
+
+ // Predictor.
+ {
+ unsigned char *t = &tmpBuf.at(0) + 1;
+ unsigned char *stop = &tmpBuf.at(0) + uncompressed_size;
+
+ while (t < stop) {
+ int d = int(t[-1]) + int(t[0]) - 128;
+ t[0] = static_cast<unsigned char>(d);
+ ++t;
+ }
+ }
+
+ // Reorder the pixel data.
+ {
+ const char *t1 = reinterpret_cast<const char *>(&tmpBuf.at(0));
+ const char *t2 = reinterpret_cast<const char *>(&tmpBuf.at(0)) +
+ (uncompressed_size + 1) / 2;
+ char *s = reinterpret_cast<char *>(dst);
+ char *stop = s + uncompressed_size;
+
+ for (;;) {
+ if (s < stop)
+ *(s++) = *(t1++);
+ else
+ break;
+
+ if (s < stop)
+ *(s++) = *(t2++);
+ else
+ break;
+ }
+ }
+}
+
+#if TINYEXR_USE_PIZ
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++11-long-long"
+#pragma clang diagnostic ignored "-Wold-style-cast"
+#pragma clang diagnostic ignored "-Wpadded"
+#pragma clang diagnostic ignored "-Wsign-conversion"
+#pragma clang diagnostic ignored "-Wc++11-extensions"
+#pragma clang diagnostic ignored "-Wconversion"
+#endif
+
+//
+// PIZ compress/uncompress, based on OpenEXR's ImfPizCompressor.cpp
+//
+// -----------------------------------------------------------------
+// Copyright (c) 2004, Industrial Light & Magic, a division of Lucas
+// Digital Ltd. LLC)
+// (3 clause BSD license)
+//
+
+struct PIZChannelData {
+ unsigned short *start;
+ unsigned short *end;
+ int nx;
+ int ny;
+ int ys;
+ int size;
+};
+
+//-----------------------------------------------------------------------------
+//
+// 16-bit Haar Wavelet encoding and decoding
+//
+// The source code in this file is derived from the encoding
+// and decoding routines written by Christian Rouet for his
+// PIZ image file format.
+//
+//-----------------------------------------------------------------------------
+
+//
+// Wavelet basis functions without modulo arithmetic; they produce
+// the best compression ratios when the wavelet-transformed data are
+// Huffman-encoded, but the wavelet transform works only for 14-bit
+// data (untransformed data values must be less than (1 << 14)).
+//
+
+inline void wenc14(unsigned short a, unsigned short b, unsigned short &l,
+ unsigned short &h) {
+ short as = static_cast<short>(a);
+ short bs = static_cast<short>(b);
+
+ short ms = (as + bs) >> 1;
+ short ds = as - bs;
+
+ l = static_cast<unsigned short>(ms);
+ h = static_cast<unsigned short>(ds);
+}
+
+inline void wdec14(unsigned short l, unsigned short h, unsigned short &a,
+ unsigned short &b) {
+ short ls = static_cast<short>(l);
+ short hs = static_cast<short>(h);
+
+ int hi = hs;
+ int ai = ls + (hi & 1) + (hi >> 1);
+
+ short as = static_cast<short>(ai);
+ short bs = static_cast<short>(ai - hi);
+
+ a = static_cast<unsigned short>(as);
+ b = static_cast<unsigned short>(bs);
+}
+
+//
+// Wavelet basis functions with modulo arithmetic; they work with full
+// 16-bit data, but Huffman-encoding the wavelet-transformed data doesn't
+// compress the data quite as well.
+//
+
+const int NBITS = 16;
+const int A_OFFSET = 1 << (NBITS - 1);
+const int M_OFFSET = 1 << (NBITS - 1);
+const int MOD_MASK = (1 << NBITS) - 1;
+
+inline void wenc16(unsigned short a, unsigned short b, unsigned short &l,
+ unsigned short &h) {
+ int ao = (a + A_OFFSET) & MOD_MASK;
+ int m = ((ao + b) >> 1);
+ int d = ao - b;
+
+ if (d < 0) m = (m + M_OFFSET) & MOD_MASK;
+
+ d &= MOD_MASK;
+
+ l = static_cast<unsigned short>(m);
+ h = static_cast<unsigned short>(d);
+}
+
+inline void wdec16(unsigned short l, unsigned short h, unsigned short &a,
+ unsigned short &b) {
+ int m = l;
+ int d = h;
+ int bb = (m - (d >> 1)) & MOD_MASK;
+ int aa = (d + bb - A_OFFSET) & MOD_MASK;
+ b = static_cast<unsigned short>(bb);
+ a = static_cast<unsigned short>(aa);
+}
+
+//
+// 2D Wavelet encoding:
+//
+
+static void wav2Encode(
+ unsigned short *in, // io: values are transformed in place
+ int nx, // i : x size
+ int ox, // i : x offset
+ int ny, // i : y size
+ int oy, // i : y offset
+ unsigned short mx) // i : maximum in[x][y] value
+{
+ bool w14 = (mx < (1 << 14));
+ int n = (nx > ny) ? ny : nx;
+ int p = 1; // == 1 << level
+ int p2 = 2; // == 1 << (level+1)
+
+ //
+ // Hierachical loop on smaller dimension n
+ //
+
+ while (p2 <= n) {
+ unsigned short *py = in;
+ unsigned short *ey = in + oy * (ny - p2);
+ int oy1 = oy * p;
+ int oy2 = oy * p2;
+ int ox1 = ox * p;
+ int ox2 = ox * p2;
+ unsigned short i00, i01, i10, i11;
+
+ //
+ // Y loop
+ //
+
+ for (; py <= ey; py += oy2) {
+ unsigned short *px = py;
+ unsigned short *ex = py + ox * (nx - p2);
+
+ //
+ // X loop
+ //
+
+ for (; px <= ex; px += ox2) {
+ unsigned short *p01 = px + ox1;
+ unsigned short *p10 = px + oy1;
+ unsigned short *p11 = p10 + ox1;
+
+ //
+ // 2D wavelet encoding
+ //
+
+ if (w14) {
+ wenc14(*px, *p01, i00, i01);
+ wenc14(*p10, *p11, i10, i11);
+ wenc14(i00, i10, *px, *p10);
+ wenc14(i01, i11, *p01, *p11);
+ } else {
+ wenc16(*px, *p01, i00, i01);
+ wenc16(*p10, *p11, i10, i11);
+ wenc16(i00, i10, *px, *p10);
+ wenc16(i01, i11, *p01, *p11);
+ }
+ }
+
+ //
+ // Encode (1D) odd column (still in Y loop)
+ //
+
+ if (nx & p) {
+ unsigned short *p10 = px + oy1;
+
+ if (w14)
+ wenc14(*px, *p10, i00, *p10);
+ else
+ wenc16(*px, *p10, i00, *p10);
+
+ *px = i00;
+ }
+ }
+
+ //
+ // Encode (1D) odd line (must loop in X)
+ //
+
+ if (ny & p) {
+ unsigned short *px = py;
+ unsigned short *ex = py + ox * (nx - p2);
+
+ for (; px <= ex; px += ox2) {
+ unsigned short *p01 = px + ox1;
+
+ if (w14)
+ wenc14(*px, *p01, i00, *p01);
+ else
+ wenc16(*px, *p01, i00, *p01);
+
+ *px = i00;
+ }
+ }
+
+ //
+ // Next level
+ //
+
+ p = p2;
+ p2 <<= 1;
+ }
+}
+
+//
+// 2D Wavelet decoding:
+//
+
+static void wav2Decode(
+ unsigned short *in, // io: values are transformed in place
+ int nx, // i : x size
+ int ox, // i : x offset
+ int ny, // i : y size
+ int oy, // i : y offset
+ unsigned short mx) // i : maximum in[x][y] value
+{
+ bool w14 = (mx < (1 << 14));
+ int n = (nx > ny) ? ny : nx;
+ int p = 1;
+ int p2;
+
+ //
+ // Search max level
+ //
+
+ while (p <= n) p <<= 1;
+
+ p >>= 1;
+ p2 = p;
+ p >>= 1;
+
+ //
+ // Hierarchical loop on smaller dimension n
+ //
+
+ while (p >= 1) {
+ unsigned short *py = in;
+ unsigned short *ey = in + oy * (ny - p2);
+ int oy1 = oy * p;
+ int oy2 = oy * p2;
+ int ox1 = ox * p;
+ int ox2 = ox * p2;
+ unsigned short i00, i01, i10, i11;
+
+ //
+ // Y loop
+ //
+
+ for (; py <= ey; py += oy2) {
+ unsigned short *px = py;
+ unsigned short *ex = py + ox * (nx - p2);
+
+ //
+ // X loop
+ //
+
+ for (; px <= ex; px += ox2) {
+ unsigned short *p01 = px + ox1;
+ unsigned short *p10 = px + oy1;
+ unsigned short *p11 = p10 + ox1;
+
+ //
+ // 2D wavelet decoding
+ //
+
+ if (w14) {
+ wdec14(*px, *p10, i00, i10);
+ wdec14(*p01, *p11, i01, i11);
+ wdec14(i00, i01, *px, *p01);
+ wdec14(i10, i11, *p10, *p11);
+ } else {
+ wdec16(*px, *p10, i00, i10);
+ wdec16(*p01, *p11, i01, i11);
+ wdec16(i00, i01, *px, *p01);
+ wdec16(i10, i11, *p10, *p11);
+ }
+ }
+
+ //
+ // Decode (1D) odd column (still in Y loop)
+ //
+
+ if (nx & p) {
+ unsigned short *p10 = px + oy1;
+
+ if (w14)
+ wdec14(*px, *p10, i00, *p10);
+ else
+ wdec16(*px, *p10, i00, *p10);
+
+ *px = i00;
+ }
+ }
+
+ //
+ // Decode (1D) odd line (must loop in X)
+ //
+
+ if (ny & p) {
+ unsigned short *px = py;
+ unsigned short *ex = py + ox * (nx - p2);
+
+ for (; px <= ex; px += ox2) {
+ unsigned short *p01 = px + ox1;
+
+ if (w14)
+ wdec14(*px, *p01, i00, *p01);
+ else
+ wdec16(*px, *p01, i00, *p01);
+
+ *px = i00;
+ }
+ }
+
+ //
+ // Next level
+ //
+
+ p2 = p;
+ p >>= 1;
+ }
+}
+
+//-----------------------------------------------------------------------------
+//
+// 16-bit Huffman compression and decompression.
+//
+// The source code in this file is derived from the 8-bit
+// Huffman compression and decompression routines written
+// by Christian Rouet for his PIZ image file format.
+//
+//-----------------------------------------------------------------------------
+
+// Adds some modification for tinyexr.
+
+const int HUF_ENCBITS = 16; // literal (value) bit length
+const int HUF_DECBITS = 14; // decoding bit size (>= 8)
+
+const int HUF_ENCSIZE = (1 << HUF_ENCBITS) + 1; // encoding table size
+const int HUF_DECSIZE = 1 << HUF_DECBITS; // decoding table size
+const int HUF_DECMASK = HUF_DECSIZE - 1;
+
+struct HufDec { // short code long code
+ //-------------------------------
+ int len : 8; // code length 0
+ int lit : 24; // lit p size
+ int *p; // 0 lits
+};
+
+inline long long hufLength(long long code) { return code & 63; }
+
+inline long long hufCode(long long code) { return code >> 6; }
+
+inline void outputBits(int nBits, long long bits, long long &c, int &lc,
+ char *&out) {
+ c <<= nBits;
+ lc += nBits;
+
+ c |= bits;
+
+ while (lc >= 8) *out++ = static_cast<char>((c >> (lc -= 8)));
+}
+
+inline long long getBits(int nBits, long long &c, int &lc, const char *&in) {
+ while (lc < nBits) {
+ c = (c << 8) | *(reinterpret_cast<const unsigned char *>(in++));
+ lc += 8;
+ }
+
+ lc -= nBits;
+ return (c >> lc) & ((1 << nBits) - 1);
+}
+
+//
+// ENCODING TABLE BUILDING & (UN)PACKING
+//
+
+//
+// Build a "canonical" Huffman code table:
+// - for each (uncompressed) symbol, hcode contains the length
+// of the corresponding code (in the compressed data)
+// - canonical codes are computed and stored in hcode
+// - the rules for constructing canonical codes are as follows:
+// * shorter codes (if filled with zeroes to the right)
+// have a numerically higher value than longer codes
+// * for codes with the same length, numerical values
+// increase with numerical symbol values
+// - because the canonical code table can be constructed from
+// symbol lengths alone, the code table can be transmitted
+// without sending the actual code values
+// - see http://www.compressconsult.com/huffman/
+//
+
+static void hufCanonicalCodeTable(long long hcode[HUF_ENCSIZE]) {
+ long long n[59];
+
+ //
+ // For each i from 0 through 58, count the
+ // number of different codes of length i, and
+ // store the count in n[i].
+ //
+
+ for (int i = 0; i <= 58; ++i) n[i] = 0;
+
+ for (int i = 0; i < HUF_ENCSIZE; ++i) n[hcode[i]] += 1;
+
+ //
+ // For each i from 58 through 1, compute the
+ // numerically lowest code with length i, and
+ // store that code in n[i].
+ //
+
+ long long c = 0;
+
+ for (int i = 58; i > 0; --i) {
+ long long nc = ((c + n[i]) >> 1);
+ n[i] = c;
+ c = nc;
+ }
+
+ //
+ // hcode[i] contains the length, l, of the
+ // code for symbol i. Assign the next available
+ // code of length l to the symbol and store both
+ // l and the code in hcode[i].
+ //
+
+ for (int i = 0; i < HUF_ENCSIZE; ++i) {
+ int l = static_cast<int>(hcode[i]);
+
+ if (l > 0) hcode[i] = l | (n[l]++ << 6);
+ }
+}
+
+//
+// Compute Huffman codes (based on frq input) and store them in frq:
+// - code structure is : [63:lsb - 6:msb] | [5-0: bit length];
+// - max code length is 58 bits;
+// - codes outside the range [im-iM] have a null length (unused values);
+// - original frequencies are destroyed;
+// - encoding tables are used by hufEncode() and hufBuildDecTable();
+//
+
+struct FHeapCompare {
+ bool operator()(long long *a, long long *b) { return *a > *b; }
+};
+
+static void hufBuildEncTable(
+ long long *frq, // io: input frequencies [HUF_ENCSIZE], output table
+ int *im, // o: min frq index
+ int *iM) // o: max frq index
+{
+ //
+ // This function assumes that when it is called, array frq
+ // indicates the frequency of all possible symbols in the data
+ // that are to be Huffman-encoded. (frq[i] contains the number
+ // of occurrences of symbol i in the data.)
+ //
+ // The loop below does three things:
+ //
+ // 1) Finds the minimum and maximum indices that point
+ // to non-zero entries in frq:
+ //
+ // frq[im] != 0, and frq[i] == 0 for all i < im
+ // frq[iM] != 0, and frq[i] == 0 for all i > iM
+ //
+ // 2) Fills array fHeap with pointers to all non-zero
+ // entries in frq.
+ //
+ // 3) Initializes array hlink such that hlink[i] == i
+ // for all array entries.
+ //
+
+ int hlink[HUF_ENCSIZE];
+ long long *fHeap[HUF_ENCSIZE];
+
+ *im = 0;
+
+ while (!frq[*im]) (*im)++;
+
+ int nf = 0;
+
+ for (int i = *im; i < HUF_ENCSIZE; i++) {
+ hlink[i] = i;
+
+ if (frq[i]) {
+ fHeap[nf] = &frq[i];
+ nf++;
+ *iM = i;
+ }
+ }
+
+ //
+ // Add a pseudo-symbol, with a frequency count of 1, to frq;
+ // adjust the fHeap and hlink array accordingly. Function
+ // hufEncode() uses the pseudo-symbol for run-length encoding.
+ //
+
+ (*iM)++;
+ frq[*iM] = 1;
+ fHeap[nf] = &frq[*iM];
+ nf++;
+
+ //
+ // Build an array, scode, such that scode[i] contains the number
+ // of bits assigned to symbol i. Conceptually this is done by
+ // constructing a tree whose leaves are the symbols with non-zero
+ // frequency:
+ //
+ // Make a heap that contains all symbols with a non-zero frequency,
+ // with the least frequent symbol on top.
+ //
+ // Repeat until only one symbol is left on the heap:
+ //
+ // Take the two least frequent symbols off the top of the heap.
+ // Create a new node that has first two nodes as children, and
+ // whose frequency is the sum of the frequencies of the first
+ // two nodes. Put the new node back into the heap.
+ //
+ // The last node left on the heap is the root of the tree. For each
+ // leaf node, the distance between the root and the leaf is the length
+ // of the code for the corresponding symbol.
+ //
+ // The loop below doesn't actually build the tree; instead we compute
+ // the distances of the leaves from the root on the fly. When a new
+ // node is added to the heap, then that node's descendants are linked
+ // into a single linear list that starts at the new node, and the code
+ // lengths of the descendants (that is, their distance from the root
+ // of the tree) are incremented by one.
+ //
+
+ std::make_heap(&fHeap[0], &fHeap[nf], FHeapCompare());
+
+ long long scode[HUF_ENCSIZE];
+ memset(scode, 0, sizeof(long long) * HUF_ENCSIZE);
+
+ while (nf > 1) {
+ //
+ // Find the indices, mm and m, of the two smallest non-zero frq
+ // values in fHeap, add the smallest frq to the second-smallest
+ // frq, and remove the smallest frq value from fHeap.
+ //
+
+ int mm = fHeap[0] - frq;
+ std::pop_heap(&fHeap[0], &fHeap[nf], FHeapCompare());
+ --nf;
+
+ int m = fHeap[0] - frq;
+ std::pop_heap(&fHeap[0], &fHeap[nf], FHeapCompare());
+
+ frq[m] += frq[mm];
+ std::push_heap(&fHeap[0], &fHeap[nf], FHeapCompare());
+
+ //
+ // The entries in scode are linked into lists with the
+ // entries in hlink serving as "next" pointers and with
+ // the end of a list marked by hlink[j] == j.
+ //
+ // Traverse the lists that start at scode[m] and scode[mm].
+ // For each element visited, increment the length of the
+ // corresponding code by one bit. (If we visit scode[j]
+ // during the traversal, then the code for symbol j becomes
+ // one bit longer.)
+ //
+ // Merge the lists that start at scode[m] and scode[mm]
+ // into a single list that starts at scode[m].
+ //
+
+ //
+ // Add a bit to all codes in the first list.
+ //
+
+ for (int j = m;; j = hlink[j]) {
+ scode[j]++;
+
+ assert(scode[j] <= 58);
+
+ if (hlink[j] == j) {
+ //
+ // Merge the two lists.
+ //
+
+ hlink[j] = mm;
+ break;
+ }
+ }
+
+ //
+ // Add a bit to all codes in the second list
+ //
+
+ for (int j = mm;; j = hlink[j]) {
+ scode[j]++;
+
+ assert(scode[j] <= 58);
+
+ if (hlink[j] == j) break;
+ }
+ }
+
+ //
+ // Build a canonical Huffman code table, replacing the code
+ // lengths in scode with (code, code length) pairs. Copy the
+ // code table from scode into frq.
+ //
+
+ hufCanonicalCodeTable(scode);
+ memcpy(frq, scode, sizeof(long long) * HUF_ENCSIZE);
+}
+
+//
+// Pack an encoding table:
+// - only code lengths, not actual codes, are stored
+// - runs of zeroes are compressed as follows:
+//
+// unpacked packed
+// --------------------------------
+// 1 zero 0 (6 bits)
+// 2 zeroes 59
+// 3 zeroes 60
+// 4 zeroes 61
+// 5 zeroes 62
+// n zeroes (6 or more) 63 n-6 (6 + 8 bits)
+//
+
+const int SHORT_ZEROCODE_RUN = 59;
+const int LONG_ZEROCODE_RUN = 63;
+const int SHORTEST_LONG_RUN = 2 + LONG_ZEROCODE_RUN - SHORT_ZEROCODE_RUN;
+const int LONGEST_LONG_RUN = 255 + SHORTEST_LONG_RUN;
+
+static void hufPackEncTable(
+ const long long *hcode, // i : encoding table [HUF_ENCSIZE]
+ int im, // i : min hcode index
+ int iM, // i : max hcode index
+ char **pcode) // o: ptr to packed table (updated)
+{
+ char *p = *pcode;
+ long long c = 0;
+ int lc = 0;
+
+ for (; im <= iM; im++) {
+ int l = hufLength(hcode[im]);
+
+ if (l == 0) {
+ int zerun = 1;
+
+ while ((im < iM) && (zerun < LONGEST_LONG_RUN)) {
+ if (hufLength(hcode[im + 1]) > 0) break;
+ im++;
+ zerun++;
+ }
+
+ if (zerun >= 2) {
+ if (zerun >= SHORTEST_LONG_RUN) {
+ outputBits(6, LONG_ZEROCODE_RUN, c, lc, p);
+ outputBits(8, zerun - SHORTEST_LONG_RUN, c, lc, p);
+ } else {
+ outputBits(6, SHORT_ZEROCODE_RUN + zerun - 2, c, lc, p);
+ }
+ continue;
+ }
+ }
+
+ outputBits(6, l, c, lc, p);
+ }
+
+ if (lc > 0) *p++ = (unsigned char)(c << (8 - lc));
+
+ *pcode = p;
+}
+
+//
+// Unpack an encoding table packed by hufPackEncTable():
+//
+
+static bool hufUnpackEncTable(
+ const char **pcode, // io: ptr to packed table (updated)
+ int ni, // i : input size (in bytes)
+ int im, // i : min hcode index
+ int iM, // i : max hcode index
+ long long *hcode) // o: encoding table [HUF_ENCSIZE]
+{
+ memset(hcode, 0, sizeof(long long) * HUF_ENCSIZE);
+
+ const char *p = *pcode;
+ long long c = 0;
+ int lc = 0;
+
+ for (; im <= iM; im++) {
+ if (p - *pcode > ni) {
+ return false;
+ }
+
+ long long l = hcode[im] = getBits(6, c, lc, p); // code length
+
+ if (l == (long long)LONG_ZEROCODE_RUN) {
+ if (p - *pcode > ni) {
+ return false;
+ }
+
+ int zerun = getBits(8, c, lc, p) + SHORTEST_LONG_RUN;
+
+ if (im + zerun > iM + 1) {
+ return false;
+ }
+
+ while (zerun--) hcode[im++] = 0;
+
+ im--;
+ } else if (l >= (long long)SHORT_ZEROCODE_RUN) {
+ int zerun = l - SHORT_ZEROCODE_RUN + 2;
+
+ if (im + zerun > iM + 1) {
+ return false;
+ }
+
+ while (zerun--) hcode[im++] = 0;
+
+ im--;
+ }
+ }
+
+ *pcode = const_cast<char *>(p);
+
+ hufCanonicalCodeTable(hcode);
+
+ return true;
+}
+
+//
+// DECODING TABLE BUILDING
+//
+
+//
+// Clear a newly allocated decoding table so that it contains only zeroes.
+//
+
+static void hufClearDecTable(HufDec *hdecod) // io: (allocated by caller)
+// decoding table [HUF_DECSIZE]
+{
+ for (int i = 0; i < HUF_DECSIZE; i++) {
+ hdecod[i].len = 0;
+ hdecod[i].lit = 0;
+ hdecod[i].p = NULL;
+ }
+ // memset(hdecod, 0, sizeof(HufDec) * HUF_DECSIZE);
+}
+
+//
+// Build a decoding hash table based on the encoding table hcode:
+// - short codes (<= HUF_DECBITS) are resolved with a single table access;
+// - long code entry allocations are not optimized, because long codes are
+// unfrequent;
+// - decoding tables are used by hufDecode();
+//
+
+static bool hufBuildDecTable(const long long *hcode, // i : encoding table
+ int im, // i : min index in hcode
+ int iM, // i : max index in hcode
+ HufDec *hdecod) // o: (allocated by caller)
+// decoding table [HUF_DECSIZE]
+{
+ //
+ // Init hashtable & loop on all codes.
+ // Assumes that hufClearDecTable(hdecod) has already been called.
+ //
+
+ for (; im <= iM; im++) {
+ long long c = hufCode(hcode[im]);
+ int l = hufLength(hcode[im]);
+
+ if (c >> l) {
+ //
+ // Error: c is supposed to be an l-bit code,
+ // but c contains a value that is greater
+ // than the largest l-bit number.
+ //
+
+ // invalidTableEntry();
+ return false;
+ }
+
+ if (l > HUF_DECBITS) {
+ //
+ // Long code: add a secondary entry
+ //
+
+ HufDec *pl = hdecod + (c >> (l - HUF_DECBITS));
+
+ if (pl->len) {
+ //
+ // Error: a short code has already
+ // been stored in table entry *pl.
+ //
+
+ // invalidTableEntry();
+ return false;
+ }
+
+ pl->lit++;
+
+ if (pl->p) {
+ int *p = pl->p;
+ pl->p = new int[pl->lit];
+
+ for (int i = 0; i < pl->lit - 1; ++i) pl->p[i] = p[i];
+
+ delete[] p;
+ } else {
+ pl->p = new int[1];
+ }
+
+ pl->p[pl->lit - 1] = im;
+ } else if (l) {
+ //
+ // Short code: init all primary entries
+ //
+
+ HufDec *pl = hdecod + (c << (HUF_DECBITS - l));
+
+ for (long long i = 1ULL << (HUF_DECBITS - l); i > 0; i--, pl++) {
+ if (pl->len || pl->p) {
+ //
+ // Error: a short code or a long code has
+ // already been stored in table entry *pl.
+ //
+
+ // invalidTableEntry();
+ return false;
+ }
+
+ pl->len = l;
+ pl->lit = im;
+ }
+ }
+ }
+
+ return true;
+}
+
+//
+// Free the long code entries of a decoding table built by hufBuildDecTable()
+//
+
+static void hufFreeDecTable(HufDec *hdecod) // io: Decoding table
+{
+ for (int i = 0; i < HUF_DECSIZE; i++) {
+ if (hdecod[i].p) {
+ delete[] hdecod[i].p;
+ hdecod[i].p = 0;
+ }
+ }
+}
+
+//
+// ENCODING
+//
+
+inline void outputCode(long long code, long long &c, int &lc, char *&out) {
+ outputBits(hufLength(code), hufCode(code), c, lc, out);
+}
+
+inline void sendCode(long long sCode, int runCount, long long runCode,
+ long long &c, int &lc, char *&out) {
+ //
+ // Output a run of runCount instances of the symbol sCount.
+ // Output the symbols explicitly, or if that is shorter, output
+ // the sCode symbol once followed by a runCode symbol and runCount
+ // expressed as an 8-bit number.
+ //
+
+ if (hufLength(sCode) + hufLength(runCode) + 8 < hufLength(sCode) * runCount) {
+ outputCode(sCode, c, lc, out);
+ outputCode(runCode, c, lc, out);
+ outputBits(8, runCount, c, lc, out);
+ } else {
+ while (runCount-- >= 0) outputCode(sCode, c, lc, out);
+ }
+}
+
+//
+// Encode (compress) ni values based on the Huffman encoding table hcode:
+//
+
+static int hufEncode // return: output size (in bits)
+ (const long long *hcode, // i : encoding table
+ const unsigned short *in, // i : uncompressed input buffer
+ const int ni, // i : input buffer size (in bytes)
+ int rlc, // i : rl code
+ char *out) // o: compressed output buffer
+{
+ char *outStart = out;
+ long long c = 0; // bits not yet written to out
+ int lc = 0; // number of valid bits in c (LSB)
+ int s = in[0];
+ int cs = 0;
+
+ //
+ // Loop on input values
+ //
+
+ for (int i = 1; i < ni; i++) {
+ //
+ // Count same values or send code
+ //
+
+ if (s == in[i] && cs < 255) {
+ cs++;
+ } else {
+ sendCode(hcode[s], cs, hcode[rlc], c, lc, out);
+ cs = 0;
+ }
+
+ s = in[i];
+ }
+
+ //
+ // Send remaining code
+ //
+
+ sendCode(hcode[s], cs, hcode[rlc], c, lc, out);
+
+ if (lc) *out = (c << (8 - lc)) & 0xff;
+
+ return (out - outStart) * 8 + lc;
+}
+
+//
+// DECODING
+//
+
+//
+// In order to force the compiler to inline them,
+// getChar() and getCode() are implemented as macros
+// instead of "inline" functions.
+//
+
+#define getChar(c, lc, in) \
+ { \
+ c = (c << 8) | *(unsigned char *)(in++); \
+ lc += 8; \
+ }
+
+#define getCode(po, rlc, c, lc, in, out, oe) \
+ { \
+ if (po == rlc) { \
+ if (lc < 8) getChar(c, lc, in); \
+ \
+ lc -= 8; \
+ \
+ unsigned char cs = (c >> lc); \
+ \
+ if (out + cs > oe) return false; \
+ \
+ unsigned short s = out[-1]; \
+ \
+ while (cs-- > 0) *out++ = s; \
+ } else if (out < oe) { \
+ *out++ = po; \
+ } else { \
+ return false; \
+ } \
+ }
+
+//
+// Decode (uncompress) ni bits based on encoding & decoding tables:
+//
+
+static bool hufDecode(const long long *hcode, // i : encoding table
+ const HufDec *hdecod, // i : decoding table
+ const char *in, // i : compressed input buffer
+ int ni, // i : input size (in bits)
+ int rlc, // i : run-length code
+ int no, // i : expected output size (in bytes)
+ unsigned short *out) // o: uncompressed output buffer
+{
+ long long c = 0;
+ int lc = 0;
+ unsigned short *outb = out;
+ unsigned short *oe = out + no;
+ const char *ie = in + (ni + 7) / 8; // input byte size
+
+ //
+ // Loop on input bytes
+ //
+
+ while (in < ie) {
+ getChar(c, lc, in);
+
+ //
+ // Access decoding table
+ //
+
+ while (lc >= HUF_DECBITS) {
+ const HufDec pl = hdecod[(c >> (lc - HUF_DECBITS)) & HUF_DECMASK];
+
+ if (pl.len) {
+ //
+ // Get short code
+ //
+
+ lc -= pl.len;
+ getCode(pl.lit, rlc, c, lc, in, out, oe);
+ } else {
+ if (!pl.p) {
+ return false;
+ }
+ // invalidCode(); // wrong code
+
+ //
+ // Search long code
+ //
+
+ int j;
+
+ for (j = 0; j < pl.lit; j++) {
+ int l = hufLength(hcode[pl.p[j]]);
+
+ while (lc < l && in < ie) // get more bits
+ getChar(c, lc, in);
+
+ if (lc >= l) {
+ if (hufCode(hcode[pl.p[j]]) ==
+ ((c >> (lc - l)) & (((long long)(1) << l) - 1))) {
+ //
+ // Found : get long code
+ //
+
+ lc -= l;
+ getCode(pl.p[j], rlc, c, lc, in, out, oe);
+ break;
+ }
+ }
+ }
+
+ if (j == pl.lit) {
+ return false;
+ // invalidCode(); // Not found
+ }
+ }
+ }
+ }
+
+ //
+ // Get remaining (short) codes
+ //
+
+ int i = (8 - ni) & 7;
+ c >>= i;
+ lc -= i;
+
+ while (lc > 0) {
+ const HufDec pl = hdecod[(c << (HUF_DECBITS - lc)) & HUF_DECMASK];
+
+ if (pl.len) {
+ lc -= pl.len;
+ getCode(pl.lit, rlc, c, lc, in, out, oe);
+ } else {
+ return false;
+ // invalidCode(); // wrong (long) code
+ }
+ }
+
+ if (out - outb != no) {
+ return false;
+ }
+ // notEnoughData ();
+
+ return true;
+}
+
+static void countFrequencies(long long freq[HUF_ENCSIZE],
+ const unsigned short data[/*n*/], int n) {
+ for (int i = 0; i < HUF_ENCSIZE; ++i) freq[i] = 0;
+
+ for (int i = 0; i < n; ++i) ++freq[data[i]];
+}
+
+static void writeUInt(char buf[4], unsigned int i) {
+ unsigned char *b = (unsigned char *)buf;
+
+ b[0] = i;
+ b[1] = i >> 8;
+ b[2] = i >> 16;
+ b[3] = i >> 24;
+}
+
+static unsigned int readUInt(const char buf[4]) {
+ const unsigned char *b = (const unsigned char *)buf;
+
+ return (b[0] & 0x000000ff) | ((b[1] << 8) & 0x0000ff00) |
+ ((b[2] << 16) & 0x00ff0000) | ((b[3] << 24) & 0xff000000);
+}
+
+//
+// EXTERNAL INTERFACE
+//
+
+static int hufCompress(const unsigned short raw[], int nRaw,
+ char compressed[]) {
+ if (nRaw == 0) return 0;
+
+ long long freq[HUF_ENCSIZE];
+
+ countFrequencies(freq, raw, nRaw);
+
+ int im = 0;
+ int iM = 0;
+ hufBuildEncTable(freq, &im, &iM);
+
+ char *tableStart = compressed + 20;
+ char *tableEnd = tableStart;
+ hufPackEncTable(freq, im, iM, &tableEnd);
+ int tableLength = tableEnd - tableStart;
+
+ char *dataStart = tableEnd;
+ int nBits = hufEncode(freq, raw, nRaw, iM, dataStart);
+ int data_length = (nBits + 7) / 8;
+
+ writeUInt(compressed, im);
+ writeUInt(compressed + 4, iM);
+ writeUInt(compressed + 8, tableLength);
+ writeUInt(compressed + 12, nBits);
+ writeUInt(compressed + 16, 0); // room for future extensions
+
+ return dataStart + data_length - compressed;
+}
+
+static bool hufUncompress(const char compressed[], int nCompressed,
+ unsigned short raw[], int nRaw) {
+ if (nCompressed == 0) {
+ if (nRaw != 0) return false;
+
+ return false;
+ }
+
+ int im = readUInt(compressed);
+ int iM = readUInt(compressed + 4);
+ // int tableLength = readUInt (compressed + 8);
+ int nBits = readUInt(compressed + 12);
+
+ if (im < 0 || im >= HUF_ENCSIZE || iM < 0 || iM >= HUF_ENCSIZE) return false;
+
+ const char *ptr = compressed + 20;
+
+ //
+ // Fast decoder needs at least 2x64-bits of compressed data, and
+ // needs to be run-able on this platform. Otherwise, fall back
+ // to the original decoder
+ //
+
+ // if (FastHufDecoder::enabled() && nBits > 128)
+ //{
+ // FastHufDecoder fhd (ptr, nCompressed - (ptr - compressed), im, iM, iM);
+ // fhd.decode ((unsigned char*)ptr, nBits, raw, nRaw);
+ //}
+ // else
+ {
+ std::vector<long long> freq(HUF_ENCSIZE);
+ std::vector<HufDec> hdec(HUF_DECSIZE);
+
+ hufClearDecTable(&hdec.at(0));
+
+ hufUnpackEncTable(&ptr, nCompressed - (ptr - compressed), im, iM,
+ &freq.at(0));
+
+ {
+ if (nBits > 8 * (nCompressed - (ptr - compressed))) {
+ return false;
+ }
+
+ hufBuildDecTable(&freq.at(0), im, iM, &hdec.at(0));
+ hufDecode(&freq.at(0), &hdec.at(0), ptr, nBits, iM, nRaw, raw);
+ }
+ // catch (...)
+ //{
+ // hufFreeDecTable (hdec);
+ // throw;
+ //}
+
+ hufFreeDecTable(&hdec.at(0));
+ }
+
+ return true;
+}
+
+//
+// Functions to compress the range of values in the pixel data
+//
+
+const int USHORT_RANGE = (1 << 16);
+const int BITMAP_SIZE = (USHORT_RANGE >> 3);
+
+static void bitmapFromData(const unsigned short data[/*nData*/], int nData,
+ unsigned char bitmap[BITMAP_SIZE],
+ unsigned short &minNonZero,
+ unsigned short &maxNonZero) {
+ for (int i = 0; i < BITMAP_SIZE; ++i) bitmap[i] = 0;
+
+ for (int i = 0; i < nData; ++i) bitmap[data[i] >> 3] |= (1 << (data[i] & 7));
+
+ bitmap[0] &= ~1; // zero is not explicitly stored in
+ // the bitmap; we assume that the
+ // data always contain zeroes
+ minNonZero = BITMAP_SIZE - 1;
+ maxNonZero = 0;
+
+ for (int i = 0; i < BITMAP_SIZE; ++i) {
+ if (bitmap[i]) {
+ if (minNonZero > i) minNonZero = i;
+ if (maxNonZero < i) maxNonZero = i;
+ }
+ }
+}
+
+static unsigned short forwardLutFromBitmap(
+ const unsigned char bitmap[BITMAP_SIZE], unsigned short lut[USHORT_RANGE]) {
+ int k = 0;
+
+ for (int i = 0; i < USHORT_RANGE; ++i) {
+ if ((i == 0) || (bitmap[i >> 3] & (1 << (i & 7))))
+ lut[i] = k++;
+ else
+ lut[i] = 0;
+ }
+
+ return k - 1; // maximum value stored in lut[],
+} // i.e. number of ones in bitmap minus 1
+
+static unsigned short reverseLutFromBitmap(
+ const unsigned char bitmap[BITMAP_SIZE], unsigned short lut[USHORT_RANGE]) {
+ int k = 0;
+
+ for (int i = 0; i < USHORT_RANGE; ++i) {
+ if ((i == 0) || (bitmap[i >> 3] & (1 << (i & 7)))) lut[k++] = i;
+ }
+
+ int n = k - 1;
+
+ while (k < USHORT_RANGE) lut[k++] = 0;
+
+ return n; // maximum k where lut[k] is non-zero,
+} // i.e. number of ones in bitmap minus 1
+
+static void applyLut(const unsigned short lut[USHORT_RANGE],
+ unsigned short data[/*nData*/], int nData) {
+ for (int i = 0; i < nData; ++i) data[i] = lut[data[i]];
+}
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif // __clang__
+
+static bool CompressPiz(unsigned char *outPtr, unsigned int &outSize,
+ const unsigned char *inPtr, size_t inSize,
+ const std::vector<ChannelInfo> &channelInfo,
+ int data_width, int num_lines) {
+ unsigned char bitmap[BITMAP_SIZE];
+ unsigned short minNonZero;
+ unsigned short maxNonZero;
+
+#if !MINIZ_LITTLE_ENDIAN
+ // @todo { PIZ compression on BigEndian architecture. }
+ assert(0);
+ return false;
+#endif
+
+ // Assume `inSize` is multiple of 2 or 4.
+ std::vector<unsigned short> tmpBuffer(inSize / sizeof(unsigned short));
+
+ std::vector<PIZChannelData> channelData(channelInfo.size());
+ unsigned short *tmpBufferEnd = &tmpBuffer.at(0);
+
+ for (size_t c = 0; c < channelData.size(); c++) {
+ PIZChannelData &cd = channelData[c];
+
+ cd.start = tmpBufferEnd;
+ cd.end = cd.start;
+
+ cd.nx = data_width;
+ cd.ny = num_lines;
+ // cd.ys = c.channel().ySampling;
+
+ size_t pixelSize = sizeof(int); // UINT and FLOAT
+ if (channelInfo[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
+ pixelSize = sizeof(short);
+ }
+
+ cd.size = static_cast<int>(pixelSize / sizeof(short));
+
+ tmpBufferEnd += cd.nx * cd.ny * cd.size;
+ }
+
+ const unsigned char *ptr = inPtr;
+ for (int y = 0; y < num_lines; ++y) {
+ for (size_t i = 0; i < channelData.size(); ++i) {
+ PIZChannelData &cd = channelData[i];
+
+ // if (modp (y, cd.ys) != 0)
+ // continue;
+
+ size_t n = static_cast<size_t>(cd.nx * cd.size);
+ memcpy(cd.end, ptr, n * sizeof(unsigned short));
+ ptr += n * sizeof(unsigned short);
+ cd.end += n;
+ }
+ }
+
+ bitmapFromData(&tmpBuffer.at(0), static_cast<int>(tmpBuffer.size()), bitmap,
+ minNonZero, maxNonZero);
+
+ unsigned short lut[USHORT_RANGE];
+ unsigned short maxValue = forwardLutFromBitmap(bitmap, lut);
+ applyLut(lut, &tmpBuffer.at(0), static_cast<int>(tmpBuffer.size()));
+
+ //
+ // Store range compression info in _outBuffer
+ //
+
+ char *buf = reinterpret_cast<char *>(outPtr);
+
+ memcpy(buf, &minNonZero, sizeof(unsigned short));
+ buf += sizeof(unsigned short);
+ memcpy(buf, &maxNonZero, sizeof(unsigned short));
+ buf += sizeof(unsigned short);
+
+ if (minNonZero <= maxNonZero) {
+ memcpy(buf, reinterpret_cast<char *>(&bitmap[0] + minNonZero),
+ maxNonZero - minNonZero + 1);
+ buf += maxNonZero - minNonZero + 1;
+ }
+
+ //
+ // Apply wavelet encoding
+ //
+
+ for (size_t i = 0; i < channelData.size(); ++i) {
+ PIZChannelData &cd = channelData[i];
+
+ for (int j = 0; j < cd.size; ++j) {
+ wav2Encode(cd.start + j, cd.nx, cd.size, cd.ny, cd.nx * cd.size,
+ maxValue);
+ }
+ }
+
+ //
+ // Apply Huffman encoding; append the result to _outBuffer
+ //
+
+ // length header(4byte), then huff data. Initialize length header with zero,
+ // then later fill it by `length`.
+ char *lengthPtr = buf;
+ int zero = 0;
+ memcpy(buf, &zero, sizeof(int));
+ buf += sizeof(int);
+
+ int length =
+ hufCompress(&tmpBuffer.at(0), static_cast<int>(tmpBuffer.size()), buf);
+ memcpy(lengthPtr, &length, sizeof(int));
+
+ outSize = static_cast<unsigned int>(
+ (reinterpret_cast<unsigned char *>(buf) - outPtr) +
+ static_cast<unsigned int>(length));
+ return true;
+}
+
+static bool DecompressPiz(unsigned char *outPtr, const unsigned char *inPtr,
+ size_t tmpBufSize, int num_channels,
+ const EXRChannelInfo *channels, int data_width,
+ int num_lines) {
+ unsigned char bitmap[BITMAP_SIZE];
+ unsigned short minNonZero;
+ unsigned short maxNonZero;
+
+#if !MINIZ_LITTLE_ENDIAN
+ // @todo { PIZ compression on BigEndian architecture. }
+ assert(0);
+ return false;
+#endif
+
+ memset(bitmap, 0, BITMAP_SIZE);
+
+ const unsigned char *ptr = inPtr;
+ minNonZero = *(reinterpret_cast<const unsigned short *>(ptr));
+ maxNonZero = *(reinterpret_cast<const unsigned short *>(ptr + 2));
+ ptr += 4;
+
+ if (maxNonZero >= BITMAP_SIZE) {
+ return false;
+ }
+
+ if (minNonZero <= maxNonZero) {
+ memcpy(reinterpret_cast<char *>(&bitmap[0] + minNonZero), ptr,
+ maxNonZero - minNonZero + 1);
+ ptr += maxNonZero - minNonZero + 1;
+ }
+
+ unsigned short lut[USHORT_RANGE];
+ memset(lut, 0, sizeof(unsigned short) * USHORT_RANGE);
+ unsigned short maxValue = reverseLutFromBitmap(bitmap, lut);
+
+ //
+ // Huffman decoding
+ //
+
+ int length;
+
+ length = *(reinterpret_cast<const int *>(ptr));
+ ptr += sizeof(int);
+
+ std::vector<unsigned short> tmpBuffer(tmpBufSize);
+ hufUncompress(reinterpret_cast<const char *>(ptr), length, &tmpBuffer.at(0),
+ static_cast<int>(tmpBufSize));
+
+ //
+ // Wavelet decoding
+ //
+
+ std::vector<PIZChannelData> channelData(static_cast<size_t>(num_channels));
+
+ unsigned short *tmpBufferEnd = &tmpBuffer.at(0);
+
+ for (size_t i = 0; i < static_cast<size_t>(num_channels); ++i) {
+ const EXRChannelInfo &chan = channels[i];
+
+ size_t pixelSize = sizeof(int); // UINT and FLOAT
+ if (chan.pixel_type == TINYEXR_PIXELTYPE_HALF) {
+ pixelSize = sizeof(short);
+ }
+
+ channelData[i].start = tmpBufferEnd;
+ channelData[i].end = channelData[i].start;
+ channelData[i].nx = data_width;
+ channelData[i].ny = num_lines;
+ // channelData[i].ys = 1;
+ channelData[i].size = static_cast<int>(pixelSize / sizeof(short));
+
+ tmpBufferEnd += channelData[i].nx * channelData[i].ny * channelData[i].size;
+ }
+
+ for (size_t i = 0; i < channelData.size(); ++i) {
+ PIZChannelData &cd = channelData[i];
+
+ for (int j = 0; j < cd.size; ++j) {
+ wav2Decode(cd.start + j, cd.nx, cd.size, cd.ny, cd.nx * cd.size,
+ maxValue);
+ }
+ }
+
+ //
+ // Expand the pixel data to their original range
+ //
+
+ applyLut(lut, &tmpBuffer.at(0), static_cast<int>(tmpBufSize));
+
+ for (int y = 0; y < num_lines; y++) {
+ for (size_t i = 0; i < channelData.size(); ++i) {
+ PIZChannelData &cd = channelData[i];
+
+ // if (modp (y, cd.ys) != 0)
+ // continue;
+
+ size_t n = static_cast<size_t>(cd.nx * cd.size);
+ memcpy(outPtr, cd.end, static_cast<size_t>(n * sizeof(unsigned short)));
+ outPtr += n * sizeof(unsigned short);
+ cd.end += n;
+ }
+ }
+
+ return true;
+}
+#endif // TINYEXR_USE_PIZ
+
+#if TINYEXR_USE_ZFP
+struct ZFPCompressionParam {
+ double rate;
+ int precision;
+ double tolerance;
+ int type; // TINYEXR_ZFP_COMPRESSIONTYPE_*
+
+ ZFPCompressionParam() {
+ type = TINYEXR_ZFP_COMPRESSIONTYPE_RATE;
+ rate = 2.0;
+ precision = 0;
+ tolerance = 0.0f;
+ }
+};
+
+bool FindZFPCompressionParam(ZFPCompressionParam *param,
+ const EXRAttribute *attributes,
+ int num_attributes) {
+ bool foundType = false;
+
+ for (int i = 0; i < num_attributes; i++) {
+ if ((strcmp(attributes[i].name, "zfpCompressionType") == 0) &&
+ (attributes[i].size == 1)) {
+ param->type = static_cast<int>(attributes[i].value[0]);
+
+ foundType = true;
+ }
+ }
+
+ if (!foundType) {
+ return false;
+ }
+
+ if (param->type == TINYEXR_ZFP_COMPRESSIONTYPE_RATE) {
+ for (int i = 0; i < num_attributes; i++) {
+ if ((strcmp(attributes[i].name, "zfpCompressionRate") == 0) &&
+ (attributes[i].size == 8)) {
+ param->rate = *(reinterpret_cast<double *>(attributes[i].value));
+ return true;
+ }
+ }
+ } else if (param->type == TINYEXR_ZFP_COMPRESSIONTYPE_PRECISION) {
+ for (int i = 0; i < num_attributes; i++) {
+ if ((strcmp(attributes[i].name, "zfpCompressionPrecision") == 0) &&
+ (attributes[i].size == 4)) {
+ param->rate = *(reinterpret_cast<int *>(attributes[i].value));
+ return true;
+ }
+ }
+ } else if (param->type == TINYEXR_ZFP_COMPRESSIONTYPE_ACCURACY) {
+ for (int i = 0; i < num_attributes; i++) {
+ if ((strcmp(attributes[i].name, "zfpCompressionTolerance") == 0) &&
+ (attributes[i].size == 8)) {
+ param->tolerance = *(reinterpret_cast<double *>(attributes[i].value));
+ return true;
+ }
+ }
+ } else {
+ assert(0);
+ }
+
+ return false;
+}
+
+// Assume pixel format is FLOAT for all channels.
+static bool DecompressZfp(float *dst, int dst_width, int dst_num_lines,
+ int num_channels, const unsigned char *src,
+ unsigned long src_size,
+ const ZFPCompressionParam &param) {
+ size_t uncompressed_size = dst_width * dst_num_lines * num_channels;
+
+ zfp_stream *zfp = NULL;
+ zfp_field *field = NULL;
+
+ assert((dst_width % 4) == 0);
+ assert((dst_num_lines % 4) == 0);
+
+ if ((dst_width & 3U) || (dst_num_lines & 3U)) {
+ return false;
+ }
+
+ field =
+ zfp_field_2d(reinterpret_cast<void *>(const_cast<unsigned char *>(src)),
+ zfp_type_float, dst_width, dst_num_lines * num_channels);
+ zfp = zfp_stream_open(NULL);
+
+ if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_RATE) {
+ zfp_stream_set_rate(zfp, param.rate, zfp_type_float, /* dimention */ 2,
+ /* write random access */ 0);
+ } else if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_PRECISION) {
+ zfp_stream_set_precision(zfp, param.precision, zfp_type_float);
+ } else if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_ACCURACY) {
+ zfp_stream_set_accuracy(zfp, param.tolerance, zfp_type_float);
+ } else {
+ assert(0);
+ }
+
+ size_t buf_size = zfp_stream_maximum_size(zfp, field);
+ std::vector<unsigned char> buf(buf_size);
+ memcpy(&buf.at(0), src, src_size);
+
+ bitstream *stream = stream_open(&buf.at(0), buf_size);
+ zfp_stream_set_bit_stream(zfp, stream);
+ zfp_stream_rewind(zfp);
+
+ size_t image_size = dst_width * dst_num_lines;
+
+ for (int c = 0; c < num_channels; c++) {
+ // decompress 4x4 pixel block.
+ for (int y = 0; y < dst_num_lines; y += 4) {
+ for (int x = 0; x < dst_width; x += 4) {
+ float fblock[16];
+ zfp_decode_block_float_2(zfp, fblock);
+ for (int j = 0; j < 4; j++) {
+ for (int i = 0; i < 4; i++) {
+ dst[c * image_size + ((y + j) * dst_width + (x + i))] =
+ fblock[j * 4 + i];
+ }
+ }
+ }
+ }
+ }
+
+ zfp_field_free(field);
+ zfp_stream_close(zfp);
+ stream_close(stream);
+
+ return true;
+}
+
+// Assume pixel format is FLOAT for all channels.
+bool CompressZfp(std::vector<unsigned char> *outBuf, unsigned int *outSize,
+ const float *inPtr, int width, int num_lines, int num_channels,
+ const ZFPCompressionParam &param) {
+ zfp_stream *zfp = NULL;
+ zfp_field *field = NULL;
+
+ assert((width % 4) == 0);
+ assert((num_lines % 4) == 0);
+
+ if ((width & 3U) || (num_lines & 3U)) {
+ return false;
+ }
+
+ // create input array.
+ field = zfp_field_2d(reinterpret_cast<void *>(const_cast<float *>(inPtr)),
+ zfp_type_float, width, num_lines * num_channels);
+
+ zfp = zfp_stream_open(NULL);
+
+ if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_RATE) {
+ zfp_stream_set_rate(zfp, param.rate, zfp_type_float, 2, 0);
+ } else if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_PRECISION) {
+ zfp_stream_set_precision(zfp, param.precision, zfp_type_float);
+ } else if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_ACCURACY) {
+ zfp_stream_set_accuracy(zfp, param.tolerance, zfp_type_float);
+ } else {
+ assert(0);
+ }
+
+ size_t buf_size = zfp_stream_maximum_size(zfp, field);
+
+ outBuf->resize(buf_size);
+
+ bitstream *stream = stream_open(&outBuf->at(0), buf_size);
+ zfp_stream_set_bit_stream(zfp, stream);
+ zfp_field_free(field);
+
+ size_t image_size = width * num_lines;
+
+ for (int c = 0; c < num_channels; c++) {
+ // compress 4x4 pixel block.
+ for (int y = 0; y < num_lines; y += 4) {
+ for (int x = 0; x < width; x += 4) {
+ float fblock[16];
+ for (int j = 0; j < 4; j++) {
+ for (int i = 0; i < 4; i++) {
+ fblock[j * 4 + i] =
+ inPtr[c * image_size + ((y + j) * width + (x + i))];
+ }
+ }
+ zfp_encode_block_float_2(zfp, fblock);
+ }
+ }
+ }
+
+ zfp_stream_flush(zfp);
+ (*outSize) = zfp_stream_compressed_size(zfp);
+
+ zfp_stream_close(zfp);
+
+ return true;
+}
+
+#endif
+
+//
+// -----------------------------------------------------------------
+//
+
+static void DecodePixelData(/* out */ unsigned char **out_images,
+ const int *requested_pixel_types,
+ const unsigned char *data_ptr, size_t data_len,
+ int compression_type, int line_order, int width,
+ int height, int x_stride, int y, int line_no,
+ int num_lines, size_t pixel_data_size,
+ size_t num_attributes,
+ const EXRAttribute *attributes, size_t num_channels,
+ const EXRChannelInfo *channels,
+ const std::vector<size_t> &channel_offset_list) {
+ if (compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) { // PIZ
+#if TINYEXR_USE_PIZ
+ // Allocate original data size.
+ std::vector<unsigned char> outBuf(static_cast<size_t>(
+ static_cast<size_t>(width * num_lines) * pixel_data_size));
+ size_t tmpBufLen = static_cast<size_t>(
+ static_cast<size_t>(width * num_lines) * pixel_data_size);
+
+ bool ret = tinyexr::DecompressPiz(
+ reinterpret_cast<unsigned char *>(&outBuf.at(0)), data_ptr, tmpBufLen,
+ static_cast<int>(num_channels), channels, width, num_lines);
+
+ assert(ret);
+ (void)ret;
+
+ // For PIZ_COMPRESSION:
+ // pixel sample data for channel 0 for scanline 0
+ // pixel sample data for channel 1 for scanline 0
+ // pixel sample data for channel ... for scanline 0
+ // pixel sample data for channel n for scanline 0
+ // pixel sample data for channel 0 for scanline 1
+ // pixel sample data for channel 1 for scanline 1
+ // pixel sample data for channel ... for scanline 1
+ // pixel sample data for channel n for scanline 1
+ // ...
+ for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
+ if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
+ for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
+ const unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
+ &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
+ channel_offset_list[c] * static_cast<size_t>(width)));
+ for (size_t u = 0; u < static_cast<size_t>(width); u++) {
+ FP16 hf;
+
+ hf.u = line_ptr[u];
+
+ tinyexr::swap2(reinterpret_cast<unsigned short *>(&hf.u));
+
+ if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
+ unsigned short *image =
+ reinterpret_cast<unsigned short **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += static_cast<size_t>(
+ (height - 1 - (line_no + static_cast<int>(v)))) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = hf.u;
+ } else { // HALF -> FLOAT
+ FP32 f32 = half_to_float(hf);
+ float *image = reinterpret_cast<float **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += static_cast<size_t>(
+ (height - 1 - (line_no + static_cast<int>(v)))) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = f32.f;
+ }
+ }
+ }
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
+ assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_UINT);
+
+ for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
+ const unsigned int *line_ptr = reinterpret_cast<unsigned int *>(
+ &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
+ channel_offset_list[c] * static_cast<size_t>(width)));
+ for (size_t u = 0; u < static_cast<size_t>(width); u++) {
+ unsigned int val = line_ptr[u];
+
+ tinyexr::swap4(&val);
+
+ unsigned int *image =
+ reinterpret_cast<unsigned int **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += static_cast<size_t>(
+ (height - 1 - (line_no + static_cast<int>(v)))) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = val;
+ }
+ }
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
+ assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT);
+ for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
+ const float *line_ptr = reinterpret_cast<float *>(&outBuf.at(
+ v * pixel_data_size * static_cast<size_t>(x_stride) +
+ channel_offset_list[c] * static_cast<size_t>(x_stride)));
+ for (size_t u = 0; u < static_cast<size_t>(width); u++) {
+ float val = line_ptr[u];
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
+
+ float *image = reinterpret_cast<float **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += static_cast<size_t>(
+ (height - 1 - (line_no + static_cast<int>(v)))) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = val;
+ }
+ }
+ } else {
+ assert(0);
+ }
+ }
+#else
+ assert(0 && "PIZ is enabled in this build");
+#endif
+
+ } else if (compression_type == TINYEXR_COMPRESSIONTYPE_ZIPS ||
+ compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) {
+ // Allocate original data size.
+ std::vector<unsigned char> outBuf(static_cast<size_t>(width) *
+ static_cast<size_t>(num_lines) *
+ pixel_data_size);
+
+ unsigned long dstLen = static_cast<unsigned long>(outBuf.size());
+ assert(dstLen > 0);
+ tinyexr::DecompressZip(reinterpret_cast<unsigned char *>(&outBuf.at(0)),
+ &dstLen, data_ptr,
+ static_cast<unsigned long>(data_len));
+
+ // For ZIP_COMPRESSION:
+ // pixel sample data for channel 0 for scanline 0
+ // pixel sample data for channel 1 for scanline 0
+ // pixel sample data for channel ... for scanline 0
+ // pixel sample data for channel n for scanline 0
+ // pixel sample data for channel 0 for scanline 1
+ // pixel sample data for channel 1 for scanline 1
+ // pixel sample data for channel ... for scanline 1
+ // pixel sample data for channel n for scanline 1
+ // ...
+ for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
+ if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
+ for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
+ const unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
+ &outBuf.at(v * static_cast<size_t>(pixel_data_size) *
+ static_cast<size_t>(width) +
+ channel_offset_list[c] * static_cast<size_t>(width)));
+ for (size_t u = 0; u < static_cast<size_t>(width); u++) {
+ tinyexr::FP16 hf;
+
+ hf.u = line_ptr[u];
+
+ tinyexr::swap2(reinterpret_cast<unsigned short *>(&hf.u));
+
+ if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
+ unsigned short *image =
+ reinterpret_cast<unsigned short **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += (static_cast<size_t>(height) - 1U -
+ (static_cast<size_t>(line_no) + v)) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = hf.u;
+ } else { // HALF -> FLOAT
+ tinyexr::FP32 f32 = half_to_float(hf);
+ float *image = reinterpret_cast<float **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += (static_cast<size_t>(height) - 1U -
+ (static_cast<size_t>(line_no) + v)) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = f32.f;
+ }
+ }
+ }
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
+ assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_UINT);
+
+ for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
+ const unsigned int *line_ptr = reinterpret_cast<unsigned int *>(
+ &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
+ channel_offset_list[c] * static_cast<size_t>(width)));
+ for (size_t u = 0; u < static_cast<size_t>(width); u++) {
+ unsigned int val = line_ptr[u];
+
+ tinyexr::swap4(&val);
+
+ unsigned int *image =
+ reinterpret_cast<unsigned int **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += (static_cast<size_t>(height) - 1U -
+ (static_cast<size_t>(line_no) + v)) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = val;
+ }
+ }
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
+ assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT);
+ for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
+ const float *line_ptr = reinterpret_cast<float *>(
+ &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
+ channel_offset_list[c] * static_cast<size_t>(width)));
+ for (size_t u = 0; u < static_cast<size_t>(width); u++) {
+ float val = line_ptr[u];
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
+
+ float *image = reinterpret_cast<float **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += (static_cast<size_t>(height) - 1U -
+ (static_cast<size_t>(line_no) + v)) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = val;
+ }
+ }
+ } else {
+ assert(0);
+ }
+ }
+ } else if (compression_type == TINYEXR_COMPRESSIONTYPE_RLE) {
+ // Allocate original data size.
+ std::vector<unsigned char> outBuf(static_cast<size_t>(width) *
+ static_cast<size_t>(num_lines) *
+ pixel_data_size);
+
+ unsigned long dstLen = static_cast<unsigned long>(outBuf.size());
+ assert(dstLen > 0);
+ tinyexr::DecompressRle(reinterpret_cast<unsigned char *>(&outBuf.at(0)),
+ dstLen, data_ptr,
+ static_cast<unsigned long>(data_len));
+
+ // For RLE_COMPRESSION:
+ // pixel sample data for channel 0 for scanline 0
+ // pixel sample data for channel 1 for scanline 0
+ // pixel sample data for channel ... for scanline 0
+ // pixel sample data for channel n for scanline 0
+ // pixel sample data for channel 0 for scanline 1
+ // pixel sample data for channel 1 for scanline 1
+ // pixel sample data for channel ... for scanline 1
+ // pixel sample data for channel n for scanline 1
+ // ...
+ for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
+ if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
+ for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
+ const unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
+ &outBuf.at(v * static_cast<size_t>(pixel_data_size) *
+ static_cast<size_t>(width) +
+ channel_offset_list[c] * static_cast<size_t>(width)));
+ for (size_t u = 0; u < static_cast<size_t>(width); u++) {
+ tinyexr::FP16 hf;
+
+ hf.u = line_ptr[u];
+
+ tinyexr::swap2(reinterpret_cast<unsigned short *>(&hf.u));
+
+ if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
+ unsigned short *image =
+ reinterpret_cast<unsigned short **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += (static_cast<size_t>(height) - 1U -
+ (static_cast<size_t>(line_no) + v)) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = hf.u;
+ } else { // HALF -> FLOAT
+ tinyexr::FP32 f32 = half_to_float(hf);
+ float *image = reinterpret_cast<float **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += (static_cast<size_t>(height) - 1U -
+ (static_cast<size_t>(line_no) + v)) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = f32.f;
+ }
+ }
+ }
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
+ assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_UINT);
+
+ for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
+ const unsigned int *line_ptr = reinterpret_cast<unsigned int *>(
+ &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
+ channel_offset_list[c] * static_cast<size_t>(width)));
+ for (size_t u = 0; u < static_cast<size_t>(width); u++) {
+ unsigned int val = line_ptr[u];
+
+ tinyexr::swap4(&val);
+
+ unsigned int *image =
+ reinterpret_cast<unsigned int **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += (static_cast<size_t>(height) - 1U -
+ (static_cast<size_t>(line_no) + v)) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = val;
+ }
+ }
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
+ assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT);
+ for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
+ const float *line_ptr = reinterpret_cast<float *>(
+ &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
+ channel_offset_list[c] * static_cast<size_t>(width)));
+ for (size_t u = 0; u < static_cast<size_t>(width); u++) {
+ float val = line_ptr[u];
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
+
+ float *image = reinterpret_cast<float **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += (static_cast<size_t>(height) - 1U -
+ (static_cast<size_t>(line_no) + v)) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = val;
+ }
+ }
+ } else {
+ assert(0);
+ }
+ }
+ } else if (compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
+#if TINYEXR_USE_ZFP
+ tinyexr::ZFPCompressionParam zfp_compression_param;
+ if (!FindZFPCompressionParam(&zfp_compression_param, attributes,
+ num_attributes)) {
+ assert(0);
+ return;
+ }
+
+ // Allocate original data size.
+ std::vector<unsigned char> outBuf(static_cast<size_t>(width) *
+ static_cast<size_t>(num_lines) *
+ pixel_data_size);
+
+ unsigned long dstLen = outBuf.size();
+ assert(dstLen > 0);
+ tinyexr::DecompressZfp(reinterpret_cast<float *>(&outBuf.at(0)), width,
+ num_lines, num_channels, data_ptr,
+ static_cast<unsigned long>(data_len),
+ zfp_compression_param);
+
+ // For ZFP_COMPRESSION:
+ // pixel sample data for channel 0 for scanline 0
+ // pixel sample data for channel 1 for scanline 0
+ // pixel sample data for channel ... for scanline 0
+ // pixel sample data for channel n for scanline 0
+ // pixel sample data for channel 0 for scanline 1
+ // pixel sample data for channel 1 for scanline 1
+ // pixel sample data for channel ... for scanline 1
+ // pixel sample data for channel n for scanline 1
+ // ...
+ for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
+ assert(channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT);
+ if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
+ assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT);
+ for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
+ const float *line_ptr = reinterpret_cast<float *>(
+ &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
+ channel_offset_list[c] * static_cast<size_t>(width)));
+ for (size_t u = 0; u < static_cast<size_t>(width); u++) {
+ float val = line_ptr[u];
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
+
+ float *image = reinterpret_cast<float **>(out_images)[c];
+ if (line_order == 0) {
+ image += (static_cast<size_t>(line_no) + v) *
+ static_cast<size_t>(x_stride) +
+ u;
+ } else {
+ image += (static_cast<size_t>(height) - 1U -
+ (static_cast<size_t>(line_no) + v)) *
+ static_cast<size_t>(x_stride) +
+ u;
+ }
+ *image = val;
+ }
+ }
+ } else {
+ assert(0);
+ }
+ }
+#else
+ (void)attributes;
+ (void)num_attributes;
+ (void)num_channels;
+ assert(0);
+#endif
+ } else if (compression_type == TINYEXR_COMPRESSIONTYPE_NONE) {
+ for (size_t c = 0; c < num_channels; c++) {
+ if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
+ const unsigned short *line_ptr =
+ reinterpret_cast<const unsigned short *>(
+ data_ptr +
+ c * static_cast<size_t>(width) * sizeof(unsigned short));
+
+ if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
+ unsigned short *outLine =
+ reinterpret_cast<unsigned short *>(out_images[c]);
+ if (line_order == 0) {
+ outLine += y * x_stride;
+ } else {
+ outLine += (height - 1 - y) * x_stride;
+ }
+
+ for (int u = 0; u < width; u++) {
+ tinyexr::FP16 hf;
+
+ hf.u = line_ptr[u];
+
+ tinyexr::swap2(reinterpret_cast<unsigned short *>(&hf.u));
+
+ outLine[u] = hf.u;
+ }
+ } else if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT) {
+ float *outLine = reinterpret_cast<float *>(out_images[c]);
+ if (line_order == 0) {
+ outLine += y * x_stride;
+ } else {
+ outLine += (height - 1 - y) * x_stride;
+ }
+
+ for (int u = 0; u < width; u++) {
+ tinyexr::FP16 hf;
+
+ hf.u = line_ptr[u];
+
+ tinyexr::swap2(reinterpret_cast<unsigned short *>(&hf.u));
+
+ tinyexr::FP32 f32 = half_to_float(hf);
+
+ outLine[u] = f32.f;
+ }
+ } else {
+ assert(0);
+ }
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
+ const float *line_ptr = reinterpret_cast<const float *>(
+ data_ptr + c * static_cast<size_t>(width) * sizeof(float));
+
+ float *outLine = reinterpret_cast<float *>(out_images[c]);
+ if (line_order == 0) {
+ outLine += y * x_stride;
+ } else {
+ outLine += (height - 1 - y) * x_stride;
+ }
+
+ for (int u = 0; u < width; u++) {
+ float val = line_ptr[u];
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
+
+ outLine[u] = val;
+ }
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
+ const unsigned int *line_ptr = reinterpret_cast<const unsigned int *>(
+ data_ptr + c * static_cast<size_t>(width) * sizeof(unsigned int));
+
+ unsigned int *outLine = reinterpret_cast<unsigned int *>(out_images[c]);
+ if (line_order == 0) {
+ outLine += y * x_stride;
+ } else {
+ outLine += (height - 1 - y) * x_stride;
+ }
+
+ for (int u = 0; u < width; u++) {
+ unsigned int val = line_ptr[u];
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
+
+ outLine[u] = val;
+ }
+ }
+ }
+ }
+}
+
+static void DecodeTiledPixelData(
+ unsigned char **out_images, int *width, int *height,
+ const int *requested_pixel_types, const unsigned char *data_ptr,
+ size_t data_len, int compression_type, int line_order, int data_width,
+ int data_height, int tile_offset_x, int tile_offset_y, int tile_size_x,
+ int tile_size_y, size_t pixel_data_size, size_t num_attributes,
+ const EXRAttribute *attributes, size_t num_channels,
+ const EXRChannelInfo *channels,
+ const std::vector<size_t> &channel_offset_list) {
+ assert(tile_offset_x * tile_size_x < data_width);
+ assert(tile_offset_y * tile_size_y < data_height);
+
+ // Compute actual image size in a tile.
+ if ((tile_offset_x + 1) * tile_size_x >= data_width) {
+ (*width) = data_width - (tile_offset_x * tile_size_x);
+ } else {
+ (*width) = tile_size_x;
+ }
+
+ if ((tile_offset_y + 1) * tile_size_y >= data_height) {
+ (*height) = data_height - (tile_offset_y * tile_size_y);
+ } else {
+ (*height) = tile_size_y;
+ }
+
+ // Image size = tile size.
+ DecodePixelData(out_images, requested_pixel_types, data_ptr, data_len,
+ compression_type, line_order, (*width), tile_size_y,
+ /* stride */ tile_size_x, /* y */ 0, /* line_no */ 0,
+ (*height), pixel_data_size, num_attributes, attributes,
+ num_channels, channels, channel_offset_list);
+}
+
+static void ComputeChannelLayout(std::vector<size_t> *channel_offset_list,
+ int *pixel_data_size, size_t *channel_offset,
+ int num_channels,
+ const EXRChannelInfo *channels) {
+ channel_offset_list->resize(static_cast<size_t>(num_channels));
+
+ (*pixel_data_size) = 0;
+ (*channel_offset) = 0;
+
+ for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
+ (*channel_offset_list)[c] = (*channel_offset);
+ if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
+ (*pixel_data_size) += sizeof(unsigned short);
+ (*channel_offset) += sizeof(unsigned short);
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
+ (*pixel_data_size) += sizeof(float);
+ (*channel_offset) += sizeof(float);
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
+ (*pixel_data_size) += sizeof(unsigned int);
+ (*channel_offset) += sizeof(unsigned int);
+ } else {
+ assert(0);
+ }
+ }
+}
+
+static unsigned char **AllocateImage(int num_channels,
+ const EXRChannelInfo *channels,
+ const int *requested_pixel_types,
+ int data_width, int data_height) {
+ unsigned char **images =
+ reinterpret_cast<unsigned char **>(static_cast<float **>(
+ malloc(sizeof(float *) * static_cast<size_t>(num_channels))));
+
+ for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
+ size_t data_len =
+ static_cast<size_t>(data_width) * static_cast<size_t>(data_height);
+ if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
+ // pixel_data_size += sizeof(unsigned short);
+ // channel_offset += sizeof(unsigned short);
+ // Alloc internal image for half type.
+ if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
+ images[c] =
+ reinterpret_cast<unsigned char *>(static_cast<unsigned short *>(
+ malloc(sizeof(unsigned short) * data_len)));
+ } else if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT) {
+ images[c] = reinterpret_cast<unsigned char *>(
+ static_cast<float *>(malloc(sizeof(float) * data_len)));
+ } else {
+ assert(0);
+ }
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
+ // pixel_data_size += sizeof(float);
+ // channel_offset += sizeof(float);
+ images[c] = reinterpret_cast<unsigned char *>(
+ static_cast<float *>(malloc(sizeof(float) * data_len)));
+ } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
+ // pixel_data_size += sizeof(unsigned int);
+ // channel_offset += sizeof(unsigned int);
+ images[c] = reinterpret_cast<unsigned char *>(
+ static_cast<unsigned int *>(malloc(sizeof(unsigned int) * data_len)));
+ } else {
+ assert(0);
+ }
+ }
+
+ return images;
+}
+
+static int ParseEXRHeader(HeaderInfo *info, bool *empty_header,
+ const EXRVersion *version, std::string *err,
+ const unsigned char *buf, size_t size) {
+ const char *marker = reinterpret_cast<const char *>(&buf[0]);
+
+ if (empty_header) {
+ (*empty_header) = false;
+ }
+
+ if (version->multipart) {
+ if (size > 0 && marker[0] == '\0') {
+ // End of header list.
+ if (empty_header) {
+ (*empty_header) = true;
+ }
+ return TINYEXR_SUCCESS;
+ }
+ }
+
+ // According to the spec, the header of every OpenEXR file must contain at
+ // least the following attributes:
+ //
+ // channels chlist
+ // compression compression
+ // dataWindow box2i
+ // displayWindow box2i
+ // lineOrder lineOrder
+ // pixelAspectRatio float
+ // screenWindowCenter v2f
+ // screenWindowWidth float
+ bool has_channels = false;
+ bool has_compression = false;
+ bool has_data_window = false;
+ bool has_display_window = false;
+ bool has_line_order = false;
+ bool has_pixel_aspect_ratio = false;
+ bool has_screen_window_center = false;
+ bool has_screen_window_width = false;
+
+ info->data_window[0] = 0;
+ info->data_window[1] = 0;
+ info->data_window[2] = 0;
+ info->data_window[3] = 0;
+ info->line_order = 0; // @fixme
+ info->display_window[0] = 0;
+ info->display_window[1] = 0;
+ info->display_window[2] = 0;
+ info->display_window[3] = 0;
+ info->screen_window_center[0] = 0.0f;
+ info->screen_window_center[1] = 0.0f;
+ info->screen_window_width = -1.0f;
+ info->pixel_aspect_ratio = -1.0f;
+
+ info->tile_size_x = -1;
+ info->tile_size_y = -1;
+ info->tile_level_mode = -1;
+ info->tile_rounding_mode = -1;
+
+ info->attributes.clear();
+
+ // Read attributes
+ size_t orig_size = size;
+ for (;;) {
+ if (0 == size) {
+ return TINYEXR_ERROR_INVALID_DATA;
+ } else if (marker[0] == '\0') {
+ size--;
+ break;
+ }
+
+ std::string attr_name;
+ std::string attr_type;
+ std::vector<unsigned char> data;
+ size_t marker_size;
+ if (!tinyexr::ReadAttribute(&attr_name, &attr_type, &data, &marker_size,
+ marker, size)) {
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+ marker += marker_size;
+ size -= marker_size;
+
+ if (version->tiled && attr_name.compare("tiles") == 0) {
+ unsigned int x_size, y_size;
+ unsigned char tile_mode;
+ assert(data.size() == 9);
+ memcpy(&x_size, &data.at(0), sizeof(int));
+ memcpy(&y_size, &data.at(4), sizeof(int));
+ tile_mode = data[8];
+ tinyexr::swap4(&x_size);
+ tinyexr::swap4(&y_size);
+
+ info->tile_size_x = static_cast<int>(x_size);
+ info->tile_size_y = static_cast<int>(y_size);
+
+ // mode = levelMode + roundingMode * 16
+ info->tile_level_mode = tile_mode & 0x3;
+ info->tile_rounding_mode = (tile_mode >> 4) & 0x1;
+
+ } else if (attr_name.compare("compression") == 0) {
+ bool ok = false;
+ if ((data[0] >= TINYEXR_COMPRESSIONTYPE_NONE) &&
+ (data[0] < TINYEXR_COMPRESSIONTYPE_PIZ)) {
+ ok = true;
+ }
+
+ if (data[0] == TINYEXR_COMPRESSIONTYPE_PIZ) {
+#if TINYEXR_USE_PIZ
+ ok = true;
+#else
+ if (err) {
+ (*err) = "PIZ compression is not supported.";
+ }
+ return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
+#endif
+ }
+
+ if (data[0] == TINYEXR_COMPRESSIONTYPE_ZFP) {
+#if TINYEXR_USE_ZFP
+ ok = true;
+#else
+ if (err) {
+ (*err) = "ZFP compression is not supported.";
+ }
+ return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
+#endif
+ }
+
+ if (!ok) {
+ if (err) {
+ (*err) = "Unknown compression type.";
+ }
+ return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
+ }
+
+ info->compression_type = static_cast<int>(data[0]);
+ has_compression = true;
+
+ } else if (attr_name.compare("channels") == 0) {
+ // name: zero-terminated string, from 1 to 255 bytes long
+ // pixel type: int, possible values are: UINT = 0 HALF = 1 FLOAT = 2
+ // pLinear: unsigned char, possible values are 0 and 1
+ // reserved: three chars, should be zero
+ // xSampling: int
+ // ySampling: int
+
+ ReadChannelInfo(info->channels, data);
+
+ if (info->channels.size() < 1) {
+ if (err) {
+ (*err) = "# of channels is zero.";
+ }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ has_channels = true;
+
+ } else if (attr_name.compare("dataWindow") == 0) {
+ memcpy(&info->data_window[0], &data.at(0), sizeof(int));
+ memcpy(&info->data_window[1], &data.at(4), sizeof(int));
+ memcpy(&info->data_window[2], &data.at(8), sizeof(int));
+ memcpy(&info->data_window[3], &data.at(12), sizeof(int));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&info->data_window[0]));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&info->data_window[1]));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&info->data_window[2]));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&info->data_window[3]));
+
+ has_data_window = true;
+ } else if (attr_name.compare("displayWindow") == 0) {
+ memcpy(&info->display_window[0], &data.at(0), sizeof(int));
+ memcpy(&info->display_window[1], &data.at(4), sizeof(int));
+ memcpy(&info->display_window[2], &data.at(8), sizeof(int));
+ memcpy(&info->display_window[3], &data.at(12), sizeof(int));
+ tinyexr::swap4(
+ reinterpret_cast<unsigned int *>(&info->display_window[0]));
+ tinyexr::swap4(
+ reinterpret_cast<unsigned int *>(&info->display_window[1]));
+ tinyexr::swap4(
+ reinterpret_cast<unsigned int *>(&info->display_window[2]));
+ tinyexr::swap4(
+ reinterpret_cast<unsigned int *>(&info->display_window[3]));
+
+ has_display_window = true;
+ } else if (attr_name.compare("lineOrder") == 0) {
+ info->line_order = static_cast<int>(data[0]);
+ has_line_order = true;
+ } else if (attr_name.compare("pixelAspectRatio") == 0) {
+ memcpy(&info->pixel_aspect_ratio, &data.at(0), sizeof(float));
+ tinyexr::swap4(
+ reinterpret_cast<unsigned int *>(&info->pixel_aspect_ratio));
+ has_pixel_aspect_ratio = true;
+ } else if (attr_name.compare("screenWindowCenter") == 0) {
+ memcpy(&info->screen_window_center[0], &data.at(0), sizeof(float));
+ memcpy(&info->screen_window_center[1], &data.at(4), sizeof(float));
+ tinyexr::swap4(
+ reinterpret_cast<unsigned int *>(&info->screen_window_center[0]));
+ tinyexr::swap4(
+ reinterpret_cast<unsigned int *>(&info->screen_window_center[1]));
+ has_screen_window_center = true;
+ } else if (attr_name.compare("screenWindowWidth") == 0) {
+ memcpy(&info->screen_window_width, &data.at(0), sizeof(float));
+ tinyexr::swap4(
+ reinterpret_cast<unsigned int *>(&info->screen_window_width));
+
+ has_screen_window_width = true;
+ } else if (attr_name.compare("chunkCount") == 0) {
+ memcpy(&info->chunk_count, &data.at(0), sizeof(int));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&info->chunk_count));
+ } else {
+ // Custom attribute(up to TINYEXR_MAX_ATTRIBUTES)
+ if (info->attributes.size() < TINYEXR_MAX_ATTRIBUTES) {
+ EXRAttribute attrib;
+ strncpy(attrib.name, attr_name.c_str(), 255);
+ attrib.name[255] = '\0';
+ strncpy(attrib.type, attr_type.c_str(), 255);
+ attrib.type[255] = '\0';
+ attrib.size = static_cast<int>(data.size());
+ attrib.value = static_cast<unsigned char *>(malloc(data.size()));
+ memcpy(reinterpret_cast<char *>(attrib.value), &data.at(0),
+ data.size());
+ info->attributes.push_back(attrib);
+ }
+ }
+ }
+
+ // Check if required attributes exist
+ {
+ std::stringstream ss_err;
+
+ if (!has_compression) {
+ ss_err << "\"compression\" attribute not found in the header."
+ << std::endl;
+ }
+
+ if (!has_channels) {
+ ss_err << "\"channels\" attribute not found in the header." << std::endl;
+ }
+
+ if (!has_line_order) {
+ ss_err << "\"lineOrder\" attribute not found in the header." << std::endl;
+ }
+
+ if (!has_display_window) {
+ ss_err << "\"displayWindow\" attribute not found in the header."
+ << std::endl;
+ }
+
+ if (!has_data_window) {
+ ss_err << "\"dataWindow\" attribute not found in the header."
+ << std::endl;
+ }
+
+ if (!has_pixel_aspect_ratio) {
+ ss_err << "\"pixelAspectRatio\" attribute not found in the header."
+ << std::endl;
+ }
+
+ if (!has_screen_window_width) {
+ ss_err << "\"screenWindowWidth\" attribute not found in the header."
+ << std::endl;
+ }
+
+ if (!has_screen_window_center) {
+ ss_err << "\"screenWindowCenter\" attribute not found in the header."
+ << std::endl;
+ }
+
+ if (!(ss_err.str().empty())) {
+ if (err) {
+ (*err) += ss_err.str();
+ }
+ return TINYEXR_ERROR_INVALID_HEADER;
+ }
+ }
+
+ info->header_len = static_cast<unsigned int>(orig_size - size);
+
+ return TINYEXR_SUCCESS;
+}
+
+// C++ HeaderInfo to C EXRHeader conversion.
+static void ConvertHeader(EXRHeader *exr_header, const HeaderInfo &info) {
+ exr_header->pixel_aspect_ratio = info.pixel_aspect_ratio;
+ exr_header->screen_window_center[0] = info.screen_window_center[0];
+ exr_header->screen_window_center[1] = info.screen_window_center[1];
+ exr_header->screen_window_width = info.screen_window_width;
+ exr_header->chunk_count = info.chunk_count;
+ exr_header->display_window[0] = info.display_window[0];
+ exr_header->display_window[1] = info.display_window[1];
+ exr_header->display_window[2] = info.display_window[2];
+ exr_header->display_window[3] = info.display_window[3];
+ exr_header->data_window[0] = info.data_window[0];
+ exr_header->data_window[1] = info.data_window[1];
+ exr_header->data_window[2] = info.data_window[2];
+ exr_header->data_window[3] = info.data_window[3];
+ exr_header->line_order = info.line_order;
+ exr_header->compression_type = info.compression_type;
+
+ exr_header->tile_size_x = info.tile_size_x;
+ exr_header->tile_size_y = info.tile_size_y;
+ exr_header->tile_level_mode = info.tile_level_mode;
+ exr_header->tile_rounding_mode = info.tile_rounding_mode;
+
+ exr_header->num_channels = static_cast<int>(info.channels.size());
+
+ exr_header->channels = static_cast<EXRChannelInfo *>(malloc(
+ sizeof(EXRChannelInfo) * static_cast<size_t>(exr_header->num_channels)));
+ for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
+ strncpy(exr_header->channels[c].name, info.channels[c].name.c_str(), 255);
+ // manually add '\0' for safety.
+ exr_header->channels[c].name[255] = '\0';
+
+ exr_header->channels[c].pixel_type = info.channels[c].pixel_type;
+ exr_header->channels[c].p_linear = info.channels[c].p_linear;
+ exr_header->channels[c].x_sampling = info.channels[c].x_sampling;
+ exr_header->channels[c].y_sampling = info.channels[c].y_sampling;
+ }
+
+ exr_header->pixel_types = static_cast<int *>(
+ malloc(sizeof(int) * static_cast<size_t>(exr_header->num_channels)));
+ for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
+ exr_header->pixel_types[c] = info.channels[c].pixel_type;
+ }
+
+ // Initially fill with values of `pixel_types`
+ exr_header->requested_pixel_types = static_cast<int *>(
+ malloc(sizeof(int) * static_cast<size_t>(exr_header->num_channels)));
+ for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
+ exr_header->requested_pixel_types[c] = info.channels[c].pixel_type;
+ }
+
+ assert(info.attributes.size() < TINYEXR_MAX_ATTRIBUTES);
+ exr_header->num_custom_attributes = static_cast<int>(info.attributes.size());
+
+ for (size_t i = 0; i < info.attributes.size(); i++) {
+ memcpy(exr_header->custom_attributes[i].name, info.attributes[i].name, 256);
+ memcpy(exr_header->custom_attributes[i].type, info.attributes[i].type, 256);
+ exr_header->custom_attributes[i].size = info.attributes[i].size;
+ // Just copy poiner
+ exr_header->custom_attributes[i].value = info.attributes[i].value;
+ }
+
+ exr_header->header_len = info.header_len;
+}
+
+static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header,
+ const std::vector<tinyexr::tinyexr_uint64> &offsets,
+ const unsigned char *head) {
+ int num_channels = exr_header->num_channels;
+
+ int num_scanline_blocks = 1;
+ if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) {
+ num_scanline_blocks = 16;
+ } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
+ num_scanline_blocks = 32;
+ } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
+ num_scanline_blocks = 16;
+ }
+
+ int data_width = exr_header->data_window[2] - exr_header->data_window[0] + 1;
+ int data_height = exr_header->data_window[3] - exr_header->data_window[1] + 1;
+
+ size_t num_blocks = offsets.size();
+
+ std::vector<size_t> channel_offset_list;
+ int pixel_data_size = 0;
+ size_t channel_offset = 0;
+ tinyexr::ComputeChannelLayout(&channel_offset_list, &pixel_data_size,
+ &channel_offset, num_channels,
+ exr_header->channels);
+
+ if (exr_header->tiled) {
+ size_t num_tiles = offsets.size(); // = # of blocks
+
+ exr_image->tiles = static_cast<EXRTile *>(
+ malloc(sizeof(EXRTile) * static_cast<size_t>(num_tiles)));
+
+ for (size_t tile_idx = 0; tile_idx < num_tiles; tile_idx++) {
+ // Allocate memory for each tile.
+ exr_image->tiles[tile_idx].images = tinyexr::AllocateImage(
+ num_channels, exr_header->channels, exr_header->requested_pixel_types,
+ data_width, data_height);
+
+ // 16 byte: tile coordinates
+ // 4 byte : data size
+ // ~ : data(uncompressed or compressed)
+ const unsigned char *data_ptr =
+ reinterpret_cast<const unsigned char *>(head + offsets[tile_idx]);
+
+ int tile_coordinates[4];
+ memcpy(tile_coordinates, data_ptr, sizeof(int) * 4);
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&tile_coordinates[0]));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&tile_coordinates[1]));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&tile_coordinates[2]));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&tile_coordinates[3]));
+
+ // @todo{ LoD }
+ assert(tile_coordinates[2] == 0);
+ assert(tile_coordinates[3] == 0);
+
+ int data_len;
+ memcpy(&data_len, data_ptr + 16,
+ sizeof(int)); // 16 = sizeof(tile_coordinates)
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&data_len));
+ assert(data_len >= 4);
+
+ // Move to data addr: 20 = 16 + 4;
+ data_ptr += 20;
+
+ tinyexr::DecodeTiledPixelData(
+ exr_image->tiles[tile_idx].images,
+ &(exr_image->tiles[tile_idx].width),
+ &(exr_image->tiles[tile_idx].height),
+ exr_header->requested_pixel_types, data_ptr,
+ static_cast<size_t>(data_len), exr_header->compression_type,
+ exr_header->line_order, data_width, data_height, tile_coordinates[0],
+ tile_coordinates[1], exr_header->tile_size_x, exr_header->tile_size_y,
+ static_cast<size_t>(pixel_data_size),
+ static_cast<size_t>(exr_header->num_custom_attributes),
+ exr_header->custom_attributes,
+ static_cast<size_t>(exr_header->num_channels), exr_header->channels,
+ channel_offset_list);
+
+ exr_image->tiles[tile_idx].offset_x = tile_coordinates[0];
+ exr_image->tiles[tile_idx].offset_y = tile_coordinates[1];
+ exr_image->tiles[tile_idx].level_x = tile_coordinates[2];
+ exr_image->tiles[tile_idx].level_y = tile_coordinates[3];
+
+ exr_image->num_tiles = static_cast<int>(num_tiles);
+ }
+ } else { // scanline format
+
+ exr_image->images = tinyexr::AllocateImage(
+ num_channels, exr_header->channels, exr_header->requested_pixel_types,
+ data_width, data_height);
+
+#ifdef _OPENMP
+#pragma omp parallel for
+#endif
+ for (int y = 0; y < static_cast<int>(num_blocks); y++) {
+ size_t y_idx = static_cast<size_t>(y);
+ const unsigned char *data_ptr =
+ reinterpret_cast<const unsigned char *>(head + offsets[y_idx]);
+ // 4 byte: scan line
+ // 4 byte: data size
+ // ~ : pixel data(uncompressed or compressed)
+ int line_no;
+ memcpy(&line_no, data_ptr, sizeof(int));
+ int data_len;
+ memcpy(&data_len, data_ptr + 4, sizeof(int));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&line_no));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&data_len));
+
+ int end_line_no = (std::min)(line_no + num_scanline_blocks,
+ (exr_header->data_window[3] + 1));
+
+ int num_lines = end_line_no - line_no;
+ assert(num_lines > 0);
+
+ // Move to data addr: 8 = 4 + 4;
+ data_ptr += 8;
+
+ // Adjust line_no with data_window.bmin.y
+ line_no -= exr_header->data_window[1];
+
+ tinyexr::DecodePixelData(
+ exr_image->images, exr_header->requested_pixel_types, data_ptr,
+ static_cast<size_t>(data_len), exr_header->compression_type,
+ exr_header->line_order, data_width, data_height, data_width, y,
+ line_no, num_lines, static_cast<size_t>(pixel_data_size),
+ static_cast<size_t>(exr_header->num_custom_attributes),
+ exr_header->custom_attributes,
+ static_cast<size_t>(exr_header->num_channels), exr_header->channels,
+ channel_offset_list);
+ } // omp parallel
+ }
+
+ // Overwrite `pixel_type` with `requested_pixel_type`.
+ {
+ for (int c = 0; c < exr_header->num_channels; c++) {
+ exr_header->pixel_types[c] = exr_header->requested_pixel_types[c];
+ }
+ }
+
+ {
+ exr_image->num_channels = num_channels;
+
+ exr_image->width = data_width;
+ exr_image->height = data_height;
+ }
+
+ return TINYEXR_SUCCESS;
+}
+
+static bool ReconstructLineOffsets(
+ std::vector<tinyexr::tinyexr_uint64> *offsets, size_t n,
+ const unsigned char *head, const unsigned char *marker, const size_t size) {
+ assert(head < marker);
+ assert(offsets->size() == n);
+
+ for (size_t i = 0; i < n; i++) {
+ size_t offset = static_cast<size_t>(marker - head);
+ // Offset should not exceed whole EXR file/data size.
+ if (offset >= size) {
+ return false;
+ }
+
+ int y;
+ unsigned int data_len;
+
+ memcpy(&y, marker, sizeof(int));
+ memcpy(&data_len, marker + 4, sizeof(unsigned int));
+
+ if (data_len >= size) {
+ return false;
+ }
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&y));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&data_len));
+
+ (*offsets)[i] = offset;
+
+ marker += data_len + 8; // 8 = 4 bytes(y) + 4 bytes(data_len)
+ }
+
+ return true;
+}
+
+static int DecodeEXRImage(EXRImage *exr_image, const EXRHeader *exr_header,
+ const unsigned char *head,
+ const unsigned char *marker, const size_t size,
+ const char **err) {
+ if (exr_image == NULL || exr_header == NULL || head == NULL ||
+ marker == NULL || (size <= tinyexr::kEXRVersionSize)) {
+ if (err) {
+ (*err) = "Invalid argument.";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ int num_scanline_blocks = 1;
+ if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) {
+ num_scanline_blocks = 16;
+ } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
+ num_scanline_blocks = 32;
+ } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
+ num_scanline_blocks = 16;
+ }
+
+ int data_width = exr_header->data_window[2] - exr_header->data_window[0] + 1;
+ int data_height = exr_header->data_window[3] - exr_header->data_window[1] + 1;
+
+ // Read offset tables.
+ size_t num_blocks;
+
+ if (exr_header->chunk_count > 0) {
+ // Use `chunkCount` attribute.
+ num_blocks = static_cast<size_t>(exr_header->chunk_count);
+ } else if (exr_header->tiled) {
+ // @todo { LoD }
+ size_t num_x_tiles = static_cast<size_t>(data_width) /
+ static_cast<size_t>(exr_header->tile_size_x);
+ if (num_x_tiles * static_cast<size_t>(exr_header->tile_size_x) <
+ static_cast<size_t>(data_width)) {
+ num_x_tiles++;
+ }
+ size_t num_y_tiles = static_cast<size_t>(data_height) /
+ static_cast<size_t>(exr_header->tile_size_y);
+ if (num_y_tiles * static_cast<size_t>(exr_header->tile_size_y) <
+ static_cast<size_t>(data_height)) {
+ num_y_tiles++;
+ }
+
+ num_blocks = num_x_tiles * num_y_tiles;
+ } else {
+ num_blocks = static_cast<size_t>(data_height) /
+ static_cast<size_t>(num_scanline_blocks);
+ if (num_blocks * static_cast<size_t>(num_scanline_blocks) <
+ static_cast<size_t>(data_height)) {
+ num_blocks++;
+ }
+ }
+
+ std::vector<tinyexr::tinyexr_uint64> offsets(num_blocks);
+
+ for (size_t y = 0; y < num_blocks; y++) {
+ tinyexr::tinyexr_uint64 offset;
+ memcpy(&offset, marker, sizeof(tinyexr::tinyexr_uint64));
+ tinyexr::swap8(&offset);
+ if (offset >= size) {
+ if (err) {
+ (*err) = "Invalid offset value.";
+ }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+ marker += sizeof(tinyexr::tinyexr_uint64); // = 8
+ offsets[y] = offset;
+ }
+
+ // If line offsets are invalid, we try to reconstruct it.
+ // See OpenEXR/IlmImf/ImfScanLineInputFile.cpp::readLineOffsets() for details.
+ for (size_t y = 0; y < num_blocks; y++) {
+ if (offsets[y] <= 0) {
+ // TODO(syoyo) Report as warning?
+ // if (err) {
+ // stringstream ss;
+ // ss << "Incomplete lineOffsets." << std::endl;
+ // (*err) += ss.str();
+ //}
+ bool ret =
+ ReconstructLineOffsets(&offsets, num_blocks, head, marker, size);
+ if (ret) {
+ // OK
+ break;
+ } else {
+ if (err) {
+ (*err) = "Cannot reconstruct lineOffset table.";
+ }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+ }
+ }
+
+ return DecodeChunk(exr_image, exr_header, offsets, head);
+}
+
+} // namespace tinyexr
+
+int LoadEXR(float **out_rgba, int *width, int *height, const char *filename,
+ const char **err) {
+ if (out_rgba == NULL) {
+ if (err) {
+ (*err) = "Invalid argument.\n";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ EXRVersion exr_version;
+ EXRImage exr_image;
+ EXRHeader exr_header;
+ InitEXRHeader(&exr_header);
+ InitEXRImage(&exr_image);
+
+ {
+ int ret = ParseEXRVersionFromFile(&exr_version, filename);
+ if (ret != TINYEXR_SUCCESS) {
+ return ret;
+ }
+
+ if (exr_version.multipart || exr_version.non_image) {
+ if (err) {
+ (*err) = "Loading multipart or DeepImage is not supported yet.\n";
+ }
+ return TINYEXR_ERROR_INVALID_DATA; // @fixme.
+ }
+ }
+
+ {
+ int ret = ParseEXRHeaderFromFile(&exr_header, &exr_version, filename, err);
+ if (ret != TINYEXR_SUCCESS) {
+ return ret;
+ }
+ }
+
+ // Read HALF channel as FLOAT.
+ for (int i = 0; i < exr_header.num_channels; i++) {
+ if (exr_header.pixel_types[i] == TINYEXR_PIXELTYPE_HALF) {
+ exr_header.requested_pixel_types[i] = TINYEXR_PIXELTYPE_FLOAT;
+ }
+ }
+
+ {
+ int ret = LoadEXRImageFromFile(&exr_image, &exr_header, filename, err);
+ if (ret != TINYEXR_SUCCESS) {
+ return ret;
+ }
+ }
+
+ // RGBA
+ int idxR = -1;
+ int idxG = -1;
+ int idxB = -1;
+ int idxA = -1;
+ for (int c = 0; c < exr_header.num_channels; c++) {
+ if (strcmp(exr_header.channels[c].name, "R") == 0) {
+ idxR = c;
+ } else if (strcmp(exr_header.channels[c].name, "G") == 0) {
+ idxG = c;
+ } else if (strcmp(exr_header.channels[c].name, "B") == 0) {
+ idxB = c;
+ } else if (strcmp(exr_header.channels[c].name, "A") == 0) {
+ idxA = c;
+ }
+ }
+
+ if (idxR == -1) {
+ if (err) {
+ (*err) = "R channel not found\n";
+ }
+
+ // @todo { free exr_image }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ if (idxG == -1) {
+ if (err) {
+ (*err) = "G channel not found\n";
+ }
+ // @todo { free exr_image }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ if (idxB == -1) {
+ if (err) {
+ (*err) = "B channel not found\n";
+ }
+ // @todo { free exr_image }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ (*out_rgba) = reinterpret_cast<float *>(
+ malloc(4 * sizeof(float) * static_cast<size_t>(exr_image.width) *
+ static_cast<size_t>(exr_image.height)));
+ for (int i = 0; i < exr_image.width * exr_image.height; i++) {
+ (*out_rgba)[4 * i + 0] =
+ reinterpret_cast<float **>(exr_image.images)[idxR][i];
+ (*out_rgba)[4 * i + 1] =
+ reinterpret_cast<float **>(exr_image.images)[idxG][i];
+ (*out_rgba)[4 * i + 2] =
+ reinterpret_cast<float **>(exr_image.images)[idxB][i];
+ if (idxA != -1) {
+ (*out_rgba)[4 * i + 3] =
+ reinterpret_cast<float **>(exr_image.images)[idxA][i];
+ } else {
+ (*out_rgba)[4 * i + 3] = 1.0;
+ }
+ }
+
+ (*width) = exr_image.width;
+ (*height) = exr_image.height;
+
+ FreeEXRHeader(&exr_header);
+ FreeEXRImage(&exr_image);
+
+ return TINYEXR_SUCCESS;
+}
+
+int ParseEXRHeaderFromMemory(EXRHeader *exr_header, const EXRVersion *version,
+ const unsigned char *memory, size_t size,
+ const char **err) {
+ if (memory == NULL || exr_header == NULL) {
+ if (err) {
+ (*err) = "Invalid argument.\n";
+ }
+
+ // Invalid argument
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ if (size < tinyexr::kEXRVersionSize) {
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ const unsigned char *marker = memory + tinyexr::kEXRVersionSize;
+ size_t marker_size = size - tinyexr::kEXRVersionSize;
+
+ tinyexr::HeaderInfo info;
+ info.clear();
+
+ std::string err_str;
+ int ret = ParseEXRHeader(&info, NULL, version, &err_str, marker, marker_size);
+
+ if (ret != TINYEXR_SUCCESS) {
+ if (err && !err_str.empty()) {
+ (*err) = strdup(err_str.c_str()); // May leak
+ }
+ }
+
+ ConvertHeader(exr_header, info);
+
+ // transfoer `tiled` from version.
+ exr_header->tiled = version->tiled;
+
+ return ret;
+}
+
+int LoadEXRFromMemory(float *out_rgba, const unsigned char *memory, size_t size,
+ const char **err) {
+ if (out_rgba == NULL || memory == NULL) {
+ if (err) {
+ (*err) = "Invalid argument.\n";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ EXRVersion exr_version;
+ EXRImage exr_image;
+ EXRHeader exr_header;
+
+ InitEXRHeader(&exr_header);
+
+ int ret = ParseEXRVersionFromMemory(&exr_version, memory, size);
+ if (ret != TINYEXR_SUCCESS) {
+ return ret;
+ }
+
+ ret = ParseEXRHeaderFromMemory(&exr_header, &exr_version, memory, size, err);
+ if (ret != TINYEXR_SUCCESS) {
+ return ret;
+ }
+
+ InitEXRImage(&exr_image);
+ ret = LoadEXRImageFromMemory(&exr_image, &exr_header, memory, size, err);
+ if (ret != TINYEXR_SUCCESS) {
+ return ret;
+ }
+
+ // RGBA
+ int idxR = -1;
+ int idxG = -1;
+ int idxB = -1;
+ int idxA = -1;
+ for (int c = 0; c < exr_header.num_channels; c++) {
+ if (strcmp(exr_header.channels[c].name, "R") == 0) {
+ idxR = c;
+ } else if (strcmp(exr_header.channels[c].name, "G") == 0) {
+ idxG = c;
+ } else if (strcmp(exr_header.channels[c].name, "B") == 0) {
+ idxB = c;
+ } else if (strcmp(exr_header.channels[c].name, "A") == 0) {
+ idxA = c;
+ }
+ }
+
+ if (idxR == -1) {
+ if (err) {
+ (*err) = "R channel not found\n";
+ }
+
+ // @todo { free exr_image }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ if (idxG == -1) {
+ if (err) {
+ (*err) = "G channel not found\n";
+ }
+ // @todo { free exr_image }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ if (idxB == -1) {
+ if (err) {
+ (*err) = "B channel not found\n";
+ }
+ // @todo { free exr_image }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ // Assume `out_rgba` have enough memory allocated.
+ for (int i = 0; i < exr_image.width * exr_image.height; i++) {
+ out_rgba[4 * i + 0] = reinterpret_cast<float **>(exr_image.images)[idxR][i];
+ out_rgba[4 * i + 1] = reinterpret_cast<float **>(exr_image.images)[idxG][i];
+ out_rgba[4 * i + 2] = reinterpret_cast<float **>(exr_image.images)[idxB][i];
+ if (idxA > 0) {
+ out_rgba[4 * i + 3] =
+ reinterpret_cast<float **>(exr_image.images)[idxA][i];
+ } else {
+ out_rgba[4 * i + 3] = 1.0;
+ }
+ }
+
+ return TINYEXR_SUCCESS;
+}
+
+int LoadEXRImageFromFile(EXRImage *exr_image, const EXRHeader *exr_header,
+ const char *filename, const char **err) {
+ if (exr_image == NULL) {
+ if (err) {
+ (*err) = "Invalid argument.";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+// -- GODOT change for old MinGW on Travis CI --
+//#ifdef _WIN32
+#if defined(_MSC_VER) || (defined(__MINGW32__) && __MINGW64_VERSION_MAJOR >= 3)
+// -- GODOT end --
+ FILE *fp = NULL;
+ fopen_s(&fp, filename, "rb");
+#else
+ FILE *fp = fopen(filename, "rb");
+#endif
+ if (!fp) {
+ if (err) {
+ (*err) = "Cannot read file.";
+ }
+ return TINYEXR_ERROR_CANT_OPEN_FILE;
+ }
+
+ size_t filesize;
+ // Compute size
+ fseek(fp, 0, SEEK_END);
+ filesize = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+
+ std::vector<unsigned char> buf(filesize); // @todo { use mmap }
+ {
+ size_t ret;
+ ret = fread(&buf[0], 1, filesize, fp);
+ assert(ret == filesize);
+ fclose(fp);
+ (void)ret;
+ }
+
+ return LoadEXRImageFromMemory(exr_image, exr_header, &buf.at(0), filesize,
+ err);
+}
+
+int LoadEXRImageFromMemory(EXRImage *exr_image, const EXRHeader *exr_header,
+ const unsigned char *memory, const size_t size,
+ const char **err) {
+ if (exr_image == NULL || memory == NULL ||
+ (size < tinyexr::kEXRVersionSize)) {
+ if (err) {
+ (*err) = "Invalid argument.";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ if (exr_header->header_len == 0) {
+ if (err) {
+ (*err) = "EXRHeader is not initialized.";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ const unsigned char *head = memory;
+ const unsigned char *marker = reinterpret_cast<const unsigned char *>(
+ memory + exr_header->header_len +
+ 8); // +8 for magic number + version header.
+ return tinyexr::DecodeEXRImage(exr_image, exr_header, head, marker, size,
+ err);
+}
+
+size_t SaveEXRImageToMemory(const EXRImage *exr_image,
+ const EXRHeader *exr_header,
+ unsigned char **memory_out, const char **err) {
+ if (exr_image == NULL || memory_out == NULL ||
+ exr_header->compression_type < 0) {
+ if (err) {
+ (*err) = "Invalid argument.";
+ }
+ return 0; // @fixme
+ }
+
+#if !TINYEXR_USE_PIZ
+ if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
+ if (err) {
+ (*err) = "PIZ compression is not supported in this build.";
+ }
+ return 0;
+ }
+#endif
+
+#if !TINYEXR_USE_ZFP
+ if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
+ if (err) {
+ (*err) = "ZFP compression is not supported in this build.";
+ }
+ return 0;
+ }
+#endif
+
+#if TINYEXR_USE_ZFP
+ for (size_t i = 0; i < static_cast<size_t>(exr_header->num_channels); i++) {
+ if (exr_header->requested_pixel_types[i] != TINYEXR_PIXELTYPE_FLOAT) {
+ if (err) {
+ (*err) = "Pixel type must be FLOAT for ZFP compression.";
+ }
+ return 0;
+ }
+ }
+#endif
+
+ std::vector<unsigned char> memory;
+
+ // Header
+ {
+ const char header[] = {0x76, 0x2f, 0x31, 0x01};
+ memory.insert(memory.end(), header, header + 4);
+ }
+
+ // Version, scanline.
+ {
+ char marker[] = {2, 0, 0, 0};
+ /* @todo
+ if (exr_header->tiled) {
+ marker[1] |= 0x2;
+ }
+ if (exr_header->long_name) {
+ marker[1] |= 0x4;
+ }
+ if (exr_header->non_image) {
+ marker[1] |= 0x8;
+ }
+ if (exr_header->multipart) {
+ marker[1] |= 0x10;
+ }
+ */
+ memory.insert(memory.end(), marker, marker + 4);
+ }
+
+ int num_scanlines = 1;
+ if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) {
+ num_scanlines = 16;
+ } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
+ num_scanlines = 32;
+ } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
+ num_scanlines = 16;
+ }
+
+ // Write attributes.
+ std::vector<tinyexr::ChannelInfo> channels;
+ {
+ std::vector<unsigned char> data;
+
+ for (int c = 0; c < exr_header->num_channels; c++) {
+ tinyexr::ChannelInfo info;
+ info.p_linear = 0;
+ info.pixel_type = exr_header->requested_pixel_types[c];
+ info.x_sampling = 1;
+ info.y_sampling = 1;
+ info.name = std::string(exr_header->channels[c].name);
+ channels.push_back(info);
+ }
+
+ tinyexr::WriteChannelInfo(data, channels);
+
+ tinyexr::WriteAttributeToMemory(&memory, "channels", "chlist", &data.at(0),
+ static_cast<int>(data.size()));
+ }
+
+ {
+ int comp = exr_header->compression_type;
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&comp));
+ tinyexr::WriteAttributeToMemory(
+ &memory, "compression", "compression",
+ reinterpret_cast<const unsigned char *>(&comp), 1);
+ }
+
+ {
+ int data[4] = {0, 0, exr_image->width - 1, exr_image->height - 1};
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&data[0]));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&data[1]));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&data[2]));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&data[3]));
+ tinyexr::WriteAttributeToMemory(
+ &memory, "dataWindow", "box2i",
+ reinterpret_cast<const unsigned char *>(data), sizeof(int) * 4);
+ tinyexr::WriteAttributeToMemory(
+ &memory, "displayWindow", "box2i",
+ reinterpret_cast<const unsigned char *>(data), sizeof(int) * 4);
+ }
+
+ {
+ unsigned char line_order = 0; // @fixme { read line_order from EXRHeader }
+ tinyexr::WriteAttributeToMemory(&memory, "lineOrder", "lineOrder",
+ &line_order, 1);
+ }
+
+ {
+ float aspectRatio = 1.0f;
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&aspectRatio));
+ tinyexr::WriteAttributeToMemory(
+ &memory, "pixelAspectRatio", "float",
+ reinterpret_cast<const unsigned char *>(&aspectRatio), sizeof(float));
+ }
+
+ {
+ float center[2] = {0.0f, 0.0f};
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&center[0]));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&center[1]));
+ tinyexr::WriteAttributeToMemory(
+ &memory, "screenWindowCenter", "v2f",
+ reinterpret_cast<const unsigned char *>(center), 2 * sizeof(float));
+ }
+
+ {
+ float w = static_cast<float>(exr_image->width);
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&w));
+ tinyexr::WriteAttributeToMemory(&memory, "screenWindowWidth", "float",
+ reinterpret_cast<const unsigned char *>(&w),
+ sizeof(float));
+ }
+
+ // Custom attributes
+ if (exr_header->num_custom_attributes > 0) {
+ for (int i = 0; i < exr_header->num_custom_attributes; i++) {
+ tinyexr::WriteAttributeToMemory(
+ &memory, exr_header->custom_attributes[i].name,
+ exr_header->custom_attributes[i].type,
+ reinterpret_cast<const unsigned char *>(
+ exr_header->custom_attributes[i].value),
+ exr_header->custom_attributes[i].size);
+ }
+ }
+
+ { // end of header
+ unsigned char e = 0;
+ memory.push_back(e);
+ }
+
+ int num_blocks = exr_image->height / num_scanlines;
+ if (num_blocks * num_scanlines < exr_image->height) {
+ num_blocks++;
+ }
+
+ std::vector<tinyexr::tinyexr_uint64> offsets(static_cast<size_t>(num_blocks));
+
+ size_t headerSize = memory.size();
+ tinyexr::tinyexr_uint64 offset =
+ headerSize +
+ static_cast<size_t>(num_blocks) *
+ sizeof(
+ tinyexr::tinyexr_int64); // sizeof(header) + sizeof(offsetTable)
+
+ std::vector<unsigned char> data;
+
+ std::vector<std::vector<unsigned char> > data_list(
+ static_cast<size_t>(num_blocks));
+ std::vector<size_t> channel_offset_list(
+ static_cast<size_t>(exr_header->num_channels));
+
+ int pixel_data_size = 0;
+ size_t channel_offset = 0;
+ for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
+ channel_offset_list[c] = channel_offset;
+ if (exr_header->requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
+ pixel_data_size += sizeof(unsigned short);
+ channel_offset += sizeof(unsigned short);
+ } else if (exr_header->requested_pixel_types[c] ==
+ TINYEXR_PIXELTYPE_FLOAT) {
+ pixel_data_size += sizeof(float);
+ channel_offset += sizeof(float);
+ } else if (exr_header->requested_pixel_types[c] == TINYEXR_PIXELTYPE_UINT) {
+ pixel_data_size += sizeof(unsigned int);
+ channel_offset += sizeof(unsigned int);
+ } else {
+ assert(0);
+ }
+ }
+
+#if TINYEXR_USE_ZFP
+ tinyexr::ZFPCompressionParam zfp_compression_param;
+
+ // Use ZFP compression parameter from custom attributes(if such a parameter
+ // exists)
+ {
+ bool ret = tinyexr::FindZFPCompressionParam(
+ &zfp_compression_param, exr_header->custom_attributes,
+ exr_header->num_custom_attributes);
+
+ if (!ret) {
+ // Use predefined compression parameter.
+ zfp_compression_param.type = 0;
+ zfp_compression_param.rate = 2;
+ }
+ }
+#endif
+
+// Use signed int since some OpenMP compiler doesn't allow unsigned type for
+// `parallel for`
+#ifdef _OPENMP
+#pragma omp parallel for
+#endif
+ for (int i = 0; i < num_blocks; i++) {
+ size_t ii = static_cast<size_t>(i);
+ int start_y = num_scanlines * i;
+ int endY = (std::min)(num_scanlines * (i + 1), exr_image->height);
+ int h = endY - start_y;
+
+ std::vector<unsigned char> buf(
+ static_cast<size_t>(exr_image->width * h * pixel_data_size));
+
+ for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
+ if (exr_header->pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
+ if (exr_header->requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT) {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < exr_image->width; x++) {
+ tinyexr::FP16 h16;
+ h16.u = reinterpret_cast<unsigned short **>(
+ exr_image->images)[c][(y + start_y) * exr_image->width + x];
+
+ tinyexr::FP32 f32 = half_to_float(h16);
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&f32.f));
+
+ // Assume increasing Y
+ float *line_ptr = reinterpret_cast<float *>(&buf.at(
+ static_cast<size_t>(pixel_data_size * y * exr_image->width) +
+ channel_offset_list[c] *
+ static_cast<size_t>(exr_image->width)));
+ line_ptr[x] = f32.f;
+ }
+ }
+ } else if (exr_header->requested_pixel_types[c] ==
+ TINYEXR_PIXELTYPE_HALF) {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < exr_image->width; x++) {
+ unsigned short val = reinterpret_cast<unsigned short **>(
+ exr_image->images)[c][(y + start_y) * exr_image->width + x];
+
+ tinyexr::swap2(&val);
+
+ // Assume increasing Y
+ unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
+ &buf.at(static_cast<size_t>(pixel_data_size * y *
+ exr_image->width) +
+ channel_offset_list[c] *
+ static_cast<size_t>(exr_image->width)));
+ line_ptr[x] = val;
+ }
+ }
+ } else {
+ assert(0);
+ }
+
+ } else if (exr_header->pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT) {
+ if (exr_header->requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < exr_image->width; x++) {
+ tinyexr::FP32 f32;
+ f32.f = reinterpret_cast<float **>(
+ exr_image->images)[c][(y + start_y) * exr_image->width + x];
+
+ tinyexr::FP16 h16;
+ h16 = float_to_half_full(f32);
+
+ tinyexr::swap2(reinterpret_cast<unsigned short *>(&h16.u));
+
+ // Assume increasing Y
+ unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
+ &buf.at(static_cast<size_t>(pixel_data_size * y *
+ exr_image->width) +
+ channel_offset_list[c] *
+ static_cast<size_t>(exr_image->width)));
+ line_ptr[x] = h16.u;
+ }
+ }
+ } else if (exr_header->requested_pixel_types[c] ==
+ TINYEXR_PIXELTYPE_FLOAT) {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < exr_image->width; x++) {
+ float val = reinterpret_cast<float **>(
+ exr_image->images)[c][(y + start_y) * exr_image->width + x];
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
+
+ // Assume increasing Y
+ float *line_ptr = reinterpret_cast<float *>(&buf.at(
+ static_cast<size_t>(pixel_data_size * y * exr_image->width) +
+ channel_offset_list[c] *
+ static_cast<size_t>(exr_image->width)));
+ line_ptr[x] = val;
+ }
+ }
+ } else {
+ assert(0);
+ }
+ } else if (exr_header->pixel_types[c] == TINYEXR_PIXELTYPE_UINT) {
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < exr_image->width; x++) {
+ unsigned int val = reinterpret_cast<unsigned int **>(
+ exr_image->images)[c][(y + start_y) * exr_image->width + x];
+
+ tinyexr::swap4(&val);
+
+ // Assume increasing Y
+ unsigned int *line_ptr = reinterpret_cast<unsigned int *>(&buf.at(
+ static_cast<size_t>(pixel_data_size * y * exr_image->width) +
+ channel_offset_list[c] *
+ static_cast<size_t>(exr_image->width)));
+ line_ptr[x] = val;
+ }
+ }
+ }
+ }
+
+ if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_NONE) {
+ // 4 byte: scan line
+ // 4 byte: data size
+ // ~ : pixel data(uncompressed)
+ std::vector<unsigned char> header(8);
+ unsigned int data_len = static_cast<unsigned int>(buf.size());
+ memcpy(&header.at(0), &start_y, sizeof(int));
+ memcpy(&header.at(4), &data_len, sizeof(unsigned int));
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&header.at(0)));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&header.at(4)));
+
+ data_list[ii].insert(data_list[ii].end(), header.begin(), header.end());
+ data_list[ii].insert(data_list[ii].end(), buf.begin(),
+ buf.begin() + data_len);
+
+ } else if ((exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZIPS) ||
+ (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZIP)) {
+#if TINYEXR_USE_MINIZ
+ std::vector<unsigned char> block(tinyexr::miniz::mz_compressBound(
+ static_cast<unsigned long>(buf.size())));
+#else
+ std::vector<unsigned char> block(
+ compressBound(static_cast<uLong>(buf.size())));
+#endif
+ tinyexr::tinyexr_uint64 outSize = block.size();
+
+ tinyexr::CompressZip(&block.at(0), outSize,
+ reinterpret_cast<const unsigned char *>(&buf.at(0)),
+ static_cast<unsigned long>(buf.size()));
+
+ // 4 byte: scan line
+ // 4 byte: data size
+ // ~ : pixel data(compressed)
+ std::vector<unsigned char> header(8);
+ unsigned int data_len = static_cast<unsigned int>(outSize); // truncate
+ memcpy(&header.at(0), &start_y, sizeof(int));
+ memcpy(&header.at(4), &data_len, sizeof(unsigned int));
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&header.at(0)));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&header.at(4)));
+
+ data_list[ii].insert(data_list[ii].end(), header.begin(), header.end());
+ data_list[ii].insert(data_list[ii].end(), block.begin(),
+ block.begin() + data_len);
+
+ } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_RLE) {
+ // (buf.size() * 3) / 2 would be enough.
+ std::vector<unsigned char> block((buf.size() * 3) / 2);
+
+ tinyexr::tinyexr_uint64 outSize = block.size();
+
+ tinyexr::CompressRle(&block.at(0), outSize,
+ reinterpret_cast<const unsigned char *>(&buf.at(0)),
+ static_cast<unsigned long>(buf.size()));
+
+ // 4 byte: scan line
+ // 4 byte: data size
+ // ~ : pixel data(compressed)
+ std::vector<unsigned char> header(8);
+ unsigned int data_len = static_cast<unsigned int>(outSize); // truncate
+ memcpy(&header.at(0), &start_y, sizeof(int));
+ memcpy(&header.at(4), &data_len, sizeof(unsigned int));
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&header.at(0)));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&header.at(4)));
+
+ data_list[ii].insert(data_list[ii].end(), header.begin(), header.end());
+ data_list[ii].insert(data_list[ii].end(), block.begin(),
+ block.begin() + data_len);
+
+ } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
+#if TINYEXR_USE_PIZ
+ unsigned int bufLen =
+ 1024 + static_cast<unsigned int>(
+ 1.2 * static_cast<unsigned int>(
+ buf.size())); // @fixme { compute good bound. }
+ std::vector<unsigned char> block(bufLen);
+ unsigned int outSize = static_cast<unsigned int>(block.size());
+
+ CompressPiz(&block.at(0), outSize,
+ reinterpret_cast<const unsigned char *>(&buf.at(0)),
+ buf.size(), channels, exr_image->width, h);
+
+ // 4 byte: scan line
+ // 4 byte: data size
+ // ~ : pixel data(compressed)
+ std::vector<unsigned char> header(8);
+ unsigned int data_len = outSize;
+ memcpy(&header.at(0), &start_y, sizeof(int));
+ memcpy(&header.at(4), &data_len, sizeof(unsigned int));
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&header.at(0)));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&header.at(4)));
+
+ data_list[ii].insert(data_list[ii].end(), header.begin(), header.end());
+ data_list[ii].insert(data_list[ii].end(), block.begin(),
+ block.begin() + data_len);
+
+#else
+ assert(0);
+#endif
+ } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
+#if TINYEXR_USE_ZFP
+ std::vector<unsigned char> block;
+ unsigned int outSize;
+
+ tinyexr::CompressZfp(
+ &block, &outSize, reinterpret_cast<const float *>(&buf.at(0)),
+ exr_image->width, h, exr_header->num_channels, zfp_compression_param);
+
+ // 4 byte: scan line
+ // 4 byte: data size
+ // ~ : pixel data(compressed)
+ std::vector<unsigned char> header(8);
+ unsigned int data_len = outSize;
+ memcpy(&header.at(0), &start_y, sizeof(int));
+ memcpy(&header.at(4), &data_len, sizeof(unsigned int));
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&header.at(0)));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&header.at(4)));
+
+ data_list[ii].insert(data_list[ii].end(), header.begin(), header.end());
+ data_list[ii].insert(data_list[ii].end(), block.begin(),
+ block.begin() + data_len);
+
+#else
+ assert(0);
+#endif
+ } else {
+ assert(0);
+ }
+ } // omp parallel
+
+ for (size_t i = 0; i < static_cast<size_t>(num_blocks); i++) {
+ data.insert(data.end(), data_list[i].begin(), data_list[i].end());
+
+ offsets[i] = offset;
+ tinyexr::swap8(reinterpret_cast<tinyexr::tinyexr_uint64 *>(&offsets[i]));
+ offset += data_list[i].size();
+ }
+
+ {
+ memory.insert(
+ memory.end(), reinterpret_cast<unsigned char *>(&offsets.at(0)),
+ reinterpret_cast<unsigned char *>(&offsets.at(0)) +
+ sizeof(tinyexr::tinyexr_uint64) * static_cast<size_t>(num_blocks));
+ }
+
+ { memory.insert(memory.end(), data.begin(), data.end()); }
+
+ assert(memory.size() > 0);
+
+ (*memory_out) = static_cast<unsigned char *>(malloc(memory.size()));
+ memcpy((*memory_out), &memory.at(0), memory.size());
+
+ return memory.size(); // OK
+}
+
+int SaveEXRImageToFile(const EXRImage *exr_image, const EXRHeader *exr_header,
+ const char *filename, const char **err) {
+ if (exr_image == NULL || filename == NULL ||
+ exr_header->compression_type < 0) {
+ if (err) {
+ (*err) = "Invalid argument.";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+#if !TINYEXR_USE_PIZ
+ if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
+ if (err) {
+ (*err) = "PIZ compression is not supported in this build.";
+ }
+ return 0;
+ }
+#endif
+
+#if !TINYEXR_USE_ZFP
+ if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
+ if (err) {
+ (*err) = "ZFP compression is not supported in this build.";
+ }
+ return 0;
+ }
+#endif
+
+// -- GODOT change for old MinGW on Travis CI --
+//#ifdef _WIN32
+#if defined(_MSC_VER) || (defined(__MINGW32__) && __MINGW64_VERSION_MAJOR >= 3)
+// -- GODOT end --
+ FILE *fp = NULL;
+ fopen_s(&fp, filename, "wb");
+#else
+ FILE *fp = fopen(filename, "wb");
+#endif
+ if (!fp) {
+ if (err) {
+ (*err) = "Cannot write a file.";
+ }
+ return TINYEXR_ERROR_CANT_OPEN_FILE;
+ }
+
+ unsigned char *mem = NULL;
+ size_t mem_size = SaveEXRImageToMemory(exr_image, exr_header, &mem, err);
+
+ if ((mem_size > 0) && mem) {
+ fwrite(mem, 1, mem_size, fp);
+ }
+ free(mem);
+
+ fclose(fp);
+
+ return TINYEXR_SUCCESS;
+}
+
+int LoadDeepEXR(DeepImage *deep_image, const char *filename, const char **err) {
+ if (deep_image == NULL) {
+ if (err) {
+ (*err) = "Invalid argument.";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ FILE *fp = fopen(filename, "rb");
+ if (!fp) {
+ if (err) {
+ (*err) = "Cannot read file.";
+ }
+ return TINYEXR_ERROR_CANT_OPEN_FILE;
+ }
+
+ size_t filesize;
+ // Compute size
+ fseek(fp, 0, SEEK_END);
+ filesize = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+
+ if (filesize == 0) {
+ fclose(fp);
+ if (err) {
+ (*err) = "File size is zero.";
+ }
+ return TINYEXR_ERROR_INVALID_FILE;
+ }
+
+ std::vector<char> buf(filesize); // @todo { use mmap }
+ {
+ size_t ret;
+ ret = fread(&buf[0], 1, filesize, fp);
+ assert(ret == filesize);
+ (void)ret;
+ }
+ fclose(fp);
+
+ const char *head = &buf[0];
+ const char *marker = &buf[0];
+
+ // Header check.
+ {
+ const char header[] = {0x76, 0x2f, 0x31, 0x01};
+
+ if (memcmp(marker, header, 4) != 0) {
+ if (err) {
+ (*err) = "Invalid magic number.";
+ }
+ return TINYEXR_ERROR_INVALID_MAGIC_NUMBER;
+ }
+ marker += 4;
+ }
+
+ // Version, scanline.
+ {
+ // ver 2.0, scanline, deep bit on(0x800)
+ // must be [2, 0, 0, 0]
+ if (marker[0] != 2 || marker[1] != 8 || marker[2] != 0 || marker[3] != 0) {
+ if (err) {
+ (*err) = "Unsupported version or scanline.";
+ }
+ return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
+ }
+
+ marker += 4;
+ }
+
+ int dx = -1;
+ int dy = -1;
+ int dw = -1;
+ int dh = -1;
+ int num_scanline_blocks = 1; // 16 for ZIP compression.
+ int compression_type = -1;
+ int num_channels = -1;
+ std::vector<tinyexr::ChannelInfo> channels;
+
+ // Read attributes
+ size_t size = filesize - tinyexr::kEXRVersionSize;
+ for (;;) {
+ if (0 == size) {
+ return TINYEXR_ERROR_INVALID_DATA;
+ } else if (marker[0] == '\0') {
+ size--;
+ break;
+ }
+
+ std::string attr_name;
+ std::string attr_type;
+ std::vector<unsigned char> data;
+ size_t marker_size;
+ if (!tinyexr::ReadAttribute(&attr_name, &attr_type, &data, &marker_size,
+ marker, size)) {
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+ marker += marker_size;
+ size -= marker_size;
+
+ if (attr_name.compare("compression") == 0) {
+ compression_type = data[0];
+ if (compression_type > TINYEXR_COMPRESSIONTYPE_PIZ) {
+ if (err) {
+ (*err) = "Unsupported compression type.";
+ }
+ return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
+ }
+
+ if (compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) {
+ num_scanline_blocks = 16;
+ }
+
+ } else if (attr_name.compare("channels") == 0) {
+ // name: zero-terminated string, from 1 to 255 bytes long
+ // pixel type: int, possible values are: UINT = 0 HALF = 1 FLOAT = 2
+ // pLinear: unsigned char, possible values are 0 and 1
+ // reserved: three chars, should be zero
+ // xSampling: int
+ // ySampling: int
+
+ tinyexr::ReadChannelInfo(channels, data);
+
+ num_channels = static_cast<int>(channels.size());
+
+ if (num_channels < 1) {
+ if (err) {
+ (*err) = "Invalid channels format.";
+ }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ } else if (attr_name.compare("dataWindow") == 0) {
+ memcpy(&dx, &data.at(0), sizeof(int));
+ memcpy(&dy, &data.at(4), sizeof(int));
+ memcpy(&dw, &data.at(8), sizeof(int));
+ memcpy(&dh, &data.at(12), sizeof(int));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&dx));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&dy));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&dw));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&dh));
+
+ } else if (attr_name.compare("displayWindow") == 0) {
+ int x;
+ int y;
+ int w;
+ int h;
+ memcpy(&x, &data.at(0), sizeof(int));
+ memcpy(&y, &data.at(4), sizeof(int));
+ memcpy(&w, &data.at(8), sizeof(int));
+ memcpy(&h, &data.at(12), sizeof(int));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&x));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&y));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&w));
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&h));
+ }
+ }
+
+ assert(dx >= 0);
+ assert(dy >= 0);
+ assert(dw >= 0);
+ assert(dh >= 0);
+ assert(num_channels >= 1);
+
+ int data_width = dw - dx + 1;
+ int data_height = dh - dy + 1;
+
+ std::vector<float> image(
+ static_cast<size_t>(data_width * data_height * 4)); // 4 = RGBA
+
+ // Read offset tables.
+ int num_blocks = data_height / num_scanline_blocks;
+ if (num_blocks * num_scanline_blocks < data_height) {
+ num_blocks++;
+ }
+
+ std::vector<tinyexr::tinyexr_int64> offsets(static_cast<size_t>(num_blocks));
+
+ for (size_t y = 0; y < static_cast<size_t>(num_blocks); y++) {
+ tinyexr::tinyexr_int64 offset;
+ memcpy(&offset, marker, sizeof(tinyexr::tinyexr_int64));
+ tinyexr::swap8(reinterpret_cast<tinyexr::tinyexr_uint64 *>(&offset));
+ marker += sizeof(tinyexr::tinyexr_int64); // = 8
+ offsets[y] = offset;
+ }
+
+#if TINYEXR_USE_PIZ
+ if ((compression_type == TINYEXR_COMPRESSIONTYPE_NONE) ||
+ (compression_type == TINYEXR_COMPRESSIONTYPE_RLE) ||
+ (compression_type == TINYEXR_COMPRESSIONTYPE_ZIPS) ||
+ (compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) ||
+ (compression_type == TINYEXR_COMPRESSIONTYPE_PIZ)) {
+#else
+ if ((compression_type == TINYEXR_COMPRESSIONTYPE_NONE) ||
+ (compression_type == TINYEXR_COMPRESSIONTYPE_RLE) ||
+ (compression_type == TINYEXR_COMPRESSIONTYPE_ZIPS) ||
+ (compression_type == TINYEXR_COMPRESSIONTYPE_ZIP)) {
+#endif
+ // OK
+ } else {
+ if (err) {
+ (*err) = "Unsupported format.";
+ }
+ return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
+ }
+
+ deep_image->image = static_cast<float ***>(
+ malloc(sizeof(float **) * static_cast<size_t>(num_channels)));
+ for (int c = 0; c < num_channels; c++) {
+ deep_image->image[c] = static_cast<float **>(
+ malloc(sizeof(float *) * static_cast<size_t>(data_height)));
+ for (int y = 0; y < data_height; y++) {
+ }
+ }
+
+ deep_image->offset_table = static_cast<int **>(
+ malloc(sizeof(int *) * static_cast<size_t>(data_height)));
+ for (int y = 0; y < data_height; y++) {
+ deep_image->offset_table[y] = static_cast<int *>(
+ malloc(sizeof(int) * static_cast<size_t>(data_width)));
+ }
+
+ for (size_t y = 0; y < static_cast<size_t>(num_blocks); y++) {
+ const unsigned char *data_ptr =
+ reinterpret_cast<const unsigned char *>(head + offsets[y]);
+
+ // int: y coordinate
+ // int64: packed size of pixel offset table
+ // int64: packed size of sample data
+ // int64: unpacked size of sample data
+ // compressed pixel offset table
+ // compressed sample data
+ int line_no;
+ tinyexr::tinyexr_int64 packedOffsetTableSize;
+ tinyexr::tinyexr_int64 packedSampleDataSize;
+ tinyexr::tinyexr_int64 unpackedSampleDataSize;
+ memcpy(&line_no, data_ptr, sizeof(int));
+ memcpy(&packedOffsetTableSize, data_ptr + 4,
+ sizeof(tinyexr::tinyexr_int64));
+ memcpy(&packedSampleDataSize, data_ptr + 12,
+ sizeof(tinyexr::tinyexr_int64));
+ memcpy(&unpackedSampleDataSize, data_ptr + 20,
+ sizeof(tinyexr::tinyexr_int64));
+
+ tinyexr::swap4(reinterpret_cast<unsigned int *>(&line_no));
+ tinyexr::swap8(
+ reinterpret_cast<tinyexr::tinyexr_uint64 *>(&packedOffsetTableSize));
+ tinyexr::swap8(
+ reinterpret_cast<tinyexr::tinyexr_uint64 *>(&packedSampleDataSize));
+ tinyexr::swap8(
+ reinterpret_cast<tinyexr::tinyexr_uint64 *>(&unpackedSampleDataSize));
+
+ std::vector<int> pixelOffsetTable(static_cast<size_t>(data_width));
+
+ // decode pixel offset table.
+ {
+ unsigned long dstLen =
+ static_cast<unsigned long>(pixelOffsetTable.size() * sizeof(int));
+ tinyexr::DecompressZip(
+ reinterpret_cast<unsigned char *>(&pixelOffsetTable.at(0)), &dstLen,
+ data_ptr + 28, static_cast<unsigned long>(packedOffsetTableSize));
+
+ assert(dstLen == pixelOffsetTable.size() * sizeof(int));
+ for (size_t i = 0; i < static_cast<size_t>(data_width); i++) {
+ deep_image->offset_table[y][i] = pixelOffsetTable[i];
+ }
+ }
+
+ std::vector<unsigned char> sample_data(
+ static_cast<size_t>(unpackedSampleDataSize));
+
+ // decode sample data.
+ {
+ unsigned long dstLen = static_cast<unsigned long>(unpackedSampleDataSize);
+ tinyexr::DecompressZip(
+ reinterpret_cast<unsigned char *>(&sample_data.at(0)), &dstLen,
+ data_ptr + 28 + packedOffsetTableSize,
+ static_cast<unsigned long>(packedSampleDataSize));
+ assert(dstLen == static_cast<unsigned long>(unpackedSampleDataSize));
+ }
+
+ // decode sample
+ int sampleSize = -1;
+ std::vector<int> channel_offset_list(static_cast<size_t>(num_channels));
+ {
+ int channel_offset = 0;
+ for (size_t i = 0; i < static_cast<size_t>(num_channels); i++) {
+ channel_offset_list[i] = channel_offset;
+ if (channels[i].pixel_type == TINYEXR_PIXELTYPE_UINT) { // UINT
+ channel_offset += 4;
+ } else if (channels[i].pixel_type == TINYEXR_PIXELTYPE_HALF) { // half
+ channel_offset += 2;
+ } else if (channels[i].pixel_type ==
+ TINYEXR_PIXELTYPE_FLOAT) { // float
+ channel_offset += 4;
+ } else {
+ assert(0);
+ }
+ }
+ sampleSize = channel_offset;
+ }
+ assert(sampleSize >= 2);
+
+ assert(static_cast<size_t>(
+ pixelOffsetTable[static_cast<size_t>(data_width - 1)] *
+ sampleSize) == sample_data.size());
+ int samples_per_line = static_cast<int>(sample_data.size()) / sampleSize;
+
+ //
+ // Alloc memory
+ //
+
+ //
+ // pixel data is stored as image[channels][pixel_samples]
+ //
+ {
+ tinyexr::tinyexr_uint64 data_offset = 0;
+ for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
+ deep_image->image[c][y] = static_cast<float *>(
+ malloc(sizeof(float) * static_cast<size_t>(samples_per_line)));
+
+ if (channels[c].pixel_type == 0) { // UINT
+ for (size_t x = 0; x < static_cast<size_t>(samples_per_line); x++) {
+ unsigned int ui = *reinterpret_cast<unsigned int *>(
+ &sample_data.at(data_offset + x * sizeof(int)));
+ deep_image->image[c][y][x] = static_cast<float>(ui); // @fixme
+ }
+ data_offset +=
+ sizeof(unsigned int) * static_cast<size_t>(samples_per_line);
+ } else if (channels[c].pixel_type == 1) { // half
+ for (size_t x = 0; x < static_cast<size_t>(samples_per_line); x++) {
+ tinyexr::FP16 f16;
+ f16.u = *reinterpret_cast<unsigned short *>(
+ &sample_data.at(data_offset + x * sizeof(short)));
+ tinyexr::FP32 f32 = half_to_float(f16);
+ deep_image->image[c][y][x] = f32.f;
+ }
+ data_offset += sizeof(short) * static_cast<size_t>(samples_per_line);
+ } else { // float
+ for (size_t x = 0; x < static_cast<size_t>(samples_per_line); x++) {
+ float f = *reinterpret_cast<float *>(
+ &sample_data.at(data_offset + x * sizeof(float)));
+ deep_image->image[c][y][x] = f;
+ }
+ data_offset += sizeof(float) * static_cast<size_t>(samples_per_line);
+ }
+ }
+ }
+ } // y
+
+ deep_image->width = data_width;
+ deep_image->height = data_height;
+
+ deep_image->channel_names = static_cast<const char **>(
+ malloc(sizeof(const char *) * static_cast<size_t>(num_channels)));
+ for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
+#ifdef _WIN32
+ deep_image->channel_names[c] = _strdup(channels[c].name.c_str());
+#else
+ deep_image->channel_names[c] = strdup(channels[c].name.c_str());
+#endif
+ }
+ deep_image->num_channels = num_channels;
+
+ return TINYEXR_SUCCESS;
+}
+
+void InitEXRImage(EXRImage *exr_image) {
+ if (exr_image == NULL) {
+ return;
+ }
+
+ exr_image->width = 0;
+ exr_image->height = 0;
+ exr_image->num_channels = 0;
+
+ exr_image->images = NULL;
+ exr_image->tiles = NULL;
+
+ exr_image->num_tiles = 0;
+}
+
+void InitEXRHeader(EXRHeader *exr_header) {
+ if (exr_header == NULL) {
+ return;
+ }
+
+ memset(exr_header, 0, sizeof(EXRHeader));
+}
+
+int FreeEXRHeader(EXRHeader *exr_header) {
+ if (exr_header == NULL) {
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ if (exr_header->channels) {
+ free(exr_header->channels);
+ }
+
+ if (exr_header->pixel_types) {
+ free(exr_header->pixel_types);
+ }
+
+ if (exr_header->requested_pixel_types) {
+ free(exr_header->requested_pixel_types);
+ }
+
+ for (int i = 0; i < exr_header->num_custom_attributes; i++) {
+ if (exr_header->custom_attributes[i].value) {
+ free(exr_header->custom_attributes[i].value);
+ }
+ }
+
+ return TINYEXR_SUCCESS;
+}
+
+int FreeEXRImage(EXRImage *exr_image) {
+ if (exr_image == NULL) {
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ for (int i = 0; i < exr_image->num_channels; i++) {
+ if (exr_image->images && exr_image->images[i]) {
+ free(exr_image->images[i]);
+ }
+ }
+
+ if (exr_image->images) {
+ free(exr_image->images);
+ }
+
+ if (exr_image->tiles) {
+ for (int tid = 0; tid < exr_image->num_tiles; tid++) {
+ for (int i = 0; i < exr_image->num_channels; i++) {
+ if (exr_image->tiles[tid].images && exr_image->tiles[tid].images[i]) {
+ free(exr_image->tiles[tid].images[i]);
+ }
+ }
+ if (exr_image->tiles[tid].images) {
+ free(exr_image->tiles[tid].images);
+ }
+ }
+ }
+
+ return TINYEXR_SUCCESS;
+}
+
+int ParseEXRHeaderFromFile(EXRHeader *exr_header, const EXRVersion *exr_version,
+ const char *filename, const char **err) {
+ if (exr_header == NULL || exr_version == NULL || filename == NULL) {
+ if (err) {
+ (*err) = "Invalid argument.";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+// -- GODOT change for old MinGW on Travis CI --
+//#ifdef _WIN32
+#if defined(_MSC_VER) || (defined(__MINGW32__) && __MINGW64_VERSION_MAJOR >= 3)
+// -- GODOT end --
+ FILE *fp = NULL;
+ fopen_s(&fp, filename, "rb");
+#else
+ FILE *fp = fopen(filename, "rb");
+#endif
+ if (!fp) {
+ if (err) {
+ (*err) = "Cannot read file.";
+ }
+ return TINYEXR_ERROR_CANT_OPEN_FILE;
+ }
+
+ size_t filesize;
+ // Compute size
+ fseek(fp, 0, SEEK_END);
+ filesize = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+
+ std::vector<unsigned char> buf(filesize); // @todo { use mmap }
+ {
+ size_t ret;
+ ret = fread(&buf[0], 1, filesize, fp);
+ assert(ret == filesize);
+ fclose(fp);
+
+ if (ret != filesize) {
+ if (err) {
+ (*err) = "fread error.";
+ }
+ return TINYEXR_ERROR_INVALID_FILE;
+ }
+ }
+
+ return ParseEXRHeaderFromMemory(exr_header, exr_version, &buf.at(0), filesize,
+ err);
+}
+
+int ParseEXRMultipartHeaderFromMemory(EXRHeader ***exr_headers,
+ int *num_headers,
+ const EXRVersion *exr_version,
+ const unsigned char *memory, size_t size,
+ const char **err) {
+ if (memory == NULL || exr_headers == NULL || num_headers == NULL ||
+ exr_version == NULL) {
+ // Invalid argument
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ if (size < tinyexr::kEXRVersionSize) {
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ const unsigned char *marker = memory + tinyexr::kEXRVersionSize;
+ size_t marker_size = size - tinyexr::kEXRVersionSize;
+
+ std::vector<tinyexr::HeaderInfo> infos;
+
+ for (;;) {
+ tinyexr::HeaderInfo info;
+ info.clear();
+
+ std::string err_str;
+ bool empty_header = false;
+ int ret = ParseEXRHeader(&info, &empty_header, exr_version, &err_str,
+ marker, marker_size);
+
+ if (ret != TINYEXR_SUCCESS) {
+ if (err) {
+ (*err) = strdup(err_str.c_str()); // may leak
+ }
+ return ret;
+ }
+
+ if (empty_header) {
+ marker += 1; // skip '\0'
+ break;
+ }
+
+ // `chunkCount` must exist in the header.
+ if (info.chunk_count == 0) {
+ if (err) {
+ (*err) = "`chunkCount' attribute is not found in the header.";
+ }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ infos.push_back(info);
+
+ // move to next header.
+ marker += info.header_len;
+ size -= info.header_len;
+ }
+
+ // allocate memory for EXRHeader and create array of EXRHeader pointers.
+ (*exr_headers) =
+ static_cast<EXRHeader **>(malloc(sizeof(EXRHeader *) * infos.size()));
+ for (size_t i = 0; i < infos.size(); i++) {
+ EXRHeader *exr_header = static_cast<EXRHeader *>(malloc(sizeof(EXRHeader)));
+
+ ConvertHeader(exr_header, infos[i]);
+
+ // transfoer `tiled` from version.
+ exr_header->tiled = exr_version->tiled;
+
+ (*exr_headers)[i] = exr_header;
+ }
+
+ (*num_headers) = static_cast<int>(infos.size());
+
+ return TINYEXR_SUCCESS;
+}
+
+int ParseEXRMultipartHeaderFromFile(EXRHeader ***exr_headers, int *num_headers,
+ const EXRVersion *exr_version,
+ const char *filename, const char **err) {
+ if (exr_headers == NULL || num_headers == NULL || exr_version == NULL ||
+ filename == NULL) {
+ if (err) {
+ (*err) = "Invalid argument.";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+// -- GODOT change for old MinGW on Travis CI --
+//#ifdef _WIN32
+#if defined(_MSC_VER) || (defined(__MINGW32__) && __MINGW64_VERSION_MAJOR >= 3)
+// -- GODOT end --
+ FILE *fp = NULL;
+ fopen_s(&fp, filename, "rb");
+#else
+ FILE *fp = fopen(filename, "rb");
+#endif
+ if (!fp) {
+ if (err) {
+ (*err) = "Cannot read file.";
+ }
+ return TINYEXR_ERROR_CANT_OPEN_FILE;
+ }
+
+ size_t filesize;
+ // Compute size
+ fseek(fp, 0, SEEK_END);
+ filesize = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+
+ std::vector<unsigned char> buf(filesize); // @todo { use mmap }
+ {
+ size_t ret;
+ ret = fread(&buf[0], 1, filesize, fp);
+ assert(ret == filesize);
+ fclose(fp);
+
+ if (ret != filesize) {
+ if (err) {
+ (*err) = "fread error.";
+ }
+ return TINYEXR_ERROR_INVALID_FILE;
+ }
+ }
+
+ return ParseEXRMultipartHeaderFromMemory(
+ exr_headers, num_headers, exr_version, &buf.at(0), filesize, err);
+}
+
+int ParseEXRVersionFromMemory(EXRVersion *version, const unsigned char *memory,
+ size_t size) {
+ if (version == NULL || memory == NULL) {
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ if (size < tinyexr::kEXRVersionSize) {
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ const unsigned char *marker = memory;
+
+ // Header check.
+ {
+ const char header[] = {0x76, 0x2f, 0x31, 0x01};
+
+ if (memcmp(marker, header, 4) != 0) {
+ return TINYEXR_ERROR_INVALID_MAGIC_NUMBER;
+ }
+ marker += 4;
+ }
+
+ version->tiled = false;
+ version->long_name = false;
+ version->non_image = false;
+ version->multipart = false;
+
+ // Parse version header.
+ {
+ // must be 2
+ if (marker[0] != 2) {
+ return TINYEXR_ERROR_INVALID_EXR_VERSION;
+ }
+
+ if (version == NULL) {
+ return TINYEXR_SUCCESS; // May OK
+ }
+
+ version->version = 2;
+
+ if (marker[1] & 0x2) { // 9th bit
+ version->tiled = true;
+ }
+ if (marker[1] & 0x4) { // 10th bit
+ version->long_name = true;
+ }
+ if (marker[1] & 0x8) { // 11th bit
+ version->non_image = true; // (deep image)
+ }
+ if (marker[1] & 0x10) { // 12th bit
+ version->multipart = true;
+ }
+ }
+
+ return TINYEXR_SUCCESS;
+}
+
+int ParseEXRVersionFromFile(EXRVersion *version, const char *filename) {
+ if (filename == NULL) {
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+// -- GODOT change for old MinGW on Travis CI --
+//#ifdef _WIN32
+#if defined(_MSC_VER) || (defined(__MINGW32__) && __MINGW64_VERSION_MAJOR >= 3)
+// -- GODOT end --
+ FILE *fp = NULL;
+ fopen_s(&fp, filename, "rb");
+#else
+ FILE *fp = fopen(filename, "rb");
+#endif
+ if (!fp) {
+ return TINYEXR_ERROR_CANT_OPEN_FILE;
+ }
+
+ size_t file_size;
+ // Compute size
+ fseek(fp, 0, SEEK_END);
+ file_size = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+
+ if (file_size < tinyexr::kEXRVersionSize) {
+ return TINYEXR_ERROR_INVALID_FILE;
+ }
+
+ unsigned char buf[tinyexr::kEXRVersionSize];
+ size_t ret = fread(&buf[0], 1, tinyexr::kEXRVersionSize, fp);
+ fclose(fp);
+
+ if (ret != tinyexr::kEXRVersionSize) {
+ return TINYEXR_ERROR_INVALID_FILE;
+ }
+
+ return ParseEXRVersionFromMemory(version, buf, tinyexr::kEXRVersionSize);
+}
+
+int LoadEXRMultipartImageFromMemory(EXRImage *exr_images,
+ const EXRHeader **exr_headers,
+ unsigned int num_parts,
+ const unsigned char *memory,
+ const size_t size, const char **err) {
+ if (exr_images == NULL || exr_headers == NULL || num_parts == 0 ||
+ memory == NULL || (size <= tinyexr::kEXRVersionSize)) {
+ if (err) {
+ (*err) = "Invalid argument.";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ // compute total header size.
+ size_t total_header_size = 0;
+ for (unsigned int i = 0; i < num_parts; i++) {
+ if (exr_headers[i]->header_len == 0) {
+ if (err) {
+ (*err) = "EXRHeader is not initialized.";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ total_header_size += exr_headers[i]->header_len;
+ }
+
+ const char *marker = reinterpret_cast<const char *>(
+ memory + total_header_size + 4 +
+ 4); // +8 for magic number and version header.
+
+ marker += 1; // Skip empty header.
+
+ // NOTE 1:
+ // In multipart image, There is 'part number' before chunk data.
+ // 4 byte : part number
+ // 4+ : chunk
+ //
+ // NOTE 2:
+ // EXR spec says 'part number' is 'unsigned long' but actually this is
+ // 'unsigned int(4 bytes)' in OpenEXR implementation...
+ // http://www.openexr.com/openexrfilelayout.pdf
+
+ // Load chunk offset table.
+ std::vector<std::vector<tinyexr::tinyexr_uint64> > chunk_offset_table_list;
+ for (size_t i = 0; i < static_cast<size_t>(num_parts); i++) {
+ std::vector<tinyexr::tinyexr_uint64> offset_table(
+ static_cast<size_t>(exr_headers[i]->chunk_count));
+
+ for (size_t c = 0; c < offset_table.size(); c++) {
+ tinyexr::tinyexr_uint64 offset;
+ memcpy(&offset, marker, 8);
+ tinyexr::swap8(&offset);
+
+ if (offset >= size) {
+ if (err) {
+ (*err) = "Invalid offset size.";
+ }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+
+ offset_table[c] = offset + 4; // +4 to skip 'part number'
+ marker += 8;
+ }
+
+ chunk_offset_table_list.push_back(offset_table);
+ }
+
+ // Decode image.
+ for (size_t i = 0; i < static_cast<size_t>(num_parts); i++) {
+ std::vector<tinyexr::tinyexr_uint64> &offset_table =
+ chunk_offset_table_list[i];
+
+ // First check 'part number' is identitical to 'i'
+ for (size_t c = 0; c < offset_table.size(); c++) {
+ const unsigned char *part_number_addr =
+ memory + offset_table[c] - 4; // -4 to move to 'part number' field.
+ unsigned int part_no;
+ memcpy(&part_no, part_number_addr, sizeof(unsigned int)); // 4
+ tinyexr::swap4(&part_no);
+
+ if (part_no != i) {
+ assert(0);
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+ }
+
+ int ret = tinyexr::DecodeChunk(&exr_images[i], exr_headers[i], offset_table,
+ memory);
+ if (ret != TINYEXR_SUCCESS) {
+ return ret;
+ }
+ }
+
+ return TINYEXR_SUCCESS;
+}
+
+int LoadEXRMultipartImageFromFile(EXRImage *exr_images,
+ const EXRHeader **exr_headers,
+ unsigned int num_parts, const char *filename,
+ const char **err) {
+ if (exr_images == NULL || exr_headers == NULL || num_parts == 0) {
+ if (err) {
+ (*err) = "Invalid argument.";
+ }
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+// -- GODOT change for old MinGW on Travis CI --
+//#ifdef _WIN32
+#if defined(_MSC_VER) || (defined(__MINGW32__) && __MINGW64_VERSION_MAJOR >= 3)
+// -- GODOT end --
+ FILE *fp = NULL;
+ fopen_s(&fp, filename, "rb");
+#else
+ FILE *fp = fopen(filename, "rb");
+#endif
+ if (!fp) {
+ if (err) {
+ (*err) = "Cannot read file.";
+ }
+ return TINYEXR_ERROR_CANT_OPEN_FILE;
+ }
+
+ size_t filesize;
+ // Compute size
+ fseek(fp, 0, SEEK_END);
+ filesize = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+
+ std::vector<unsigned char> buf(filesize); // @todo { use mmap }
+ {
+ size_t ret;
+ ret = fread(&buf[0], 1, filesize, fp);
+ assert(ret == filesize);
+ fclose(fp);
+ (void)ret;
+ }
+
+ return LoadEXRMultipartImageFromMemory(exr_images, exr_headers, num_parts,
+ &buf.at(0), filesize, err);
+}
+
+int SaveEXR(const float *data, int width, int height, int components,
+ const char *outfilename) {
+ if (components == 3 || components == 4) {
+ // OK
+ } else {
+ return TINYEXR_ERROR_INVALID_ARGUMENT;
+ }
+
+ // Assume at least 16x16 pixels.
+ if (width < 16) return TINYEXR_ERROR_INVALID_ARGUMENT;
+ if (height < 16) return TINYEXR_ERROR_INVALID_ARGUMENT;
+
+ EXRHeader header;
+ InitEXRHeader(&header);
+
+ EXRImage image;
+ InitEXRImage(&image);
+
+ image.num_channels = components;
+
+ std::vector<float> images[4];
+ images[0].resize(static_cast<size_t>(width * height));
+ images[1].resize(static_cast<size_t>(width * height));
+ images[2].resize(static_cast<size_t>(width * height));
+ images[3].resize(static_cast<size_t>(width * height));
+
+ // Split RGB(A)RGB(A)RGB(A)... into R, G and B(and A) layers
+ for (size_t i = 0; i < static_cast<size_t>(width * height); i++) {
+ images[0][i] = data[static_cast<size_t>(components) * i + 0];
+ images[1][i] = data[static_cast<size_t>(components) * i + 1];
+ images[2][i] = data[static_cast<size_t>(components) * i + 2];
+ if (components == 4) {
+ images[3][i] = data[static_cast<size_t>(components) * i + 3];
+ }
+ }
+
+ float *image_ptr[4] = {0, 0, 0, 0};
+ if (components == 4) {
+ image_ptr[0] = &(images[3].at(0)); // A
+ image_ptr[1] = &(images[2].at(0)); // B
+ image_ptr[2] = &(images[1].at(0)); // G
+ image_ptr[3] = &(images[0].at(0)); // R
+ } else {
+ image_ptr[0] = &(images[2].at(0)); // B
+ image_ptr[1] = &(images[1].at(0)); // G
+ image_ptr[2] = &(images[0].at(0)); // R
+ }
+
+ image.images = reinterpret_cast<unsigned char **>(image_ptr);
+ image.width = width;
+ image.height = height;
+
+ header.num_channels = components;
+ header.channels = static_cast<EXRChannelInfo *>(malloc(
+ sizeof(EXRChannelInfo) * static_cast<size_t>(header.num_channels)));
+ // Must be (A)BGR order, since most of EXR viewers expect this channel order.
+ if (components == 4) {
+ strncpy(header.channels[0].name, "A", 255);
+ header.channels[0].name[strlen("A")] = '\0';
+ strncpy(header.channels[1].name, "B", 255);
+ header.channels[1].name[strlen("B")] = '\0';
+ strncpy(header.channels[2].name, "G", 255);
+ header.channels[2].name[strlen("G")] = '\0';
+ strncpy(header.channels[3].name, "R", 255);
+ header.channels[3].name[strlen("R")] = '\0';
+ } else {
+ strncpy(header.channels[0].name, "B", 255);
+ header.channels[0].name[strlen("B")] = '\0';
+ strncpy(header.channels[1].name, "G", 255);
+ header.channels[1].name[strlen("G")] = '\0';
+ strncpy(header.channels[2].name, "R", 255);
+ header.channels[2].name[strlen("R")] = '\0';
+ }
+
+ header.pixel_types = static_cast<int *>(
+ malloc(sizeof(int) * static_cast<size_t>(header.num_channels)));
+ header.requested_pixel_types = static_cast<int *>(
+ malloc(sizeof(int) * static_cast<size_t>(header.num_channels)));
+ for (int i = 0; i < header.num_channels; i++) {
+ header.pixel_types[i] =
+ TINYEXR_PIXELTYPE_FLOAT; // pixel type of input image
+ header.requested_pixel_types[i] =
+ TINYEXR_PIXELTYPE_HALF; // pixel type of output image to be stored in
+ // .EXR
+ }
+
+ const char *err;
+ int ret = SaveEXRImageToFile(&image, &header, outfilename, &err);
+ if (ret != TINYEXR_SUCCESS) {
+ return ret;
+ }
+
+ free(header.channels);
+ free(header.pixel_types);
+ free(header.requested_pixel_types);
+
+ return ret;
+}
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+#endif // TINYEXR_IMPLEMENTATION_DEIFNED
+#endif // TINYEXR_IMPLEMENTATION
diff --git a/thirdparty/zstd/LICENSE b/thirdparty/zstd/LICENSE
new file mode 100644
index 0000000000..a793a80289
--- /dev/null
+++ b/thirdparty/zstd/LICENSE
@@ -0,0 +1,30 @@
+BSD License
+
+For Zstandard software
+
+Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name Facebook nor the names of its contributors may be used to
+ endorse or promote products derived from this software without specific
+ prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/thirdparty/zstd/PATENTS b/thirdparty/zstd/PATENTS
new file mode 100644
index 0000000000..15b4a2ea5c
--- /dev/null
+++ b/thirdparty/zstd/PATENTS
@@ -0,0 +1,33 @@
+Additional Grant of Patent Rights Version 2
+
+"Software" means the Zstandard software distributed by Facebook, Inc.
+
+Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software
+("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
+(subject to the termination provision below) license under any Necessary
+Claims, to make, have made, use, sell, offer to sell, import, and otherwise
+transfer the Software. For avoidance of doubt, no license is granted under
+Facebook’s rights in any patent claims that are infringed by (i) modifications
+to the Software made by you or any third party or (ii) the Software in
+combination with any software or other technology.
+
+The license granted hereunder will terminate, automatically and without notice,
+if you (or any of your subsidiaries, corporate affiliates or agents) initiate
+directly or indirectly, or take a direct financial interest in, any Patent
+Assertion: (i) against Facebook or any of its subsidiaries or corporate
+affiliates, (ii) against any party if such Patent Assertion arises in whole or
+in part from any software, technology, product or service of Facebook or any of
+its subsidiaries or corporate affiliates, or (iii) against any party relating
+to the Software. Notwithstanding the foregoing, if Facebook or any of its
+subsidiaries or corporate affiliates files a lawsuit alleging patent
+infringement against you in the first instance, and you respond by filing a
+patent infringement counterclaim in that lawsuit against that party that is
+unrelated to the Software, the license granted hereunder will not terminate
+under section (i) of this paragraph due to such counterclaim.
+
+A "Necessary Claim" is a claim of a patent owned by Facebook that is
+necessarily infringed by the Software standing alone.
+
+A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
+or contributory infringement or inducement to infringe any patent, including a
+cross-claim or counterclaim.
diff --git a/thirdparty/zstd/README.md b/thirdparty/zstd/README.md
new file mode 100644
index 0000000000..f37be4542c
--- /dev/null
+++ b/thirdparty/zstd/README.md
@@ -0,0 +1,153 @@
+ __Zstandard__, or `zstd` as short version, is a fast lossless compression algorithm,
+ targeting real-time compression scenarios at zlib-level and better compression ratios.
+
+It is provided as an open-source BSD-licensed **C** library,
+and a command line utility producing and decoding `.zst` and `.gz` files.
+For other programming languages,
+you can consult a list of known ports on [Zstandard homepage](http://www.zstd.net/#other-languages).
+
+| dev branch status |
+|-------------------|
+| [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] [![Build status][CircleDevBadge]][CircleLink]
+
+[travisDevBadge]: https://travis-ci.org/facebook/zstd.svg?branch=dev "Continuous Integration test suite"
+[travisLink]: https://travis-ci.org/facebook/zstd
+[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/xt38wbdxjk5mrbem/branch/dev?svg=true "Windows test suite"
+[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/zstd-p0yf0
+[CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite"
+[CircleLink]: https://circleci.com/gh/facebook/zstd
+
+
+As a reference, several fast compression algorithms were tested and compared
+on a server running Linux Debian (`Linux version 4.8.0-1-amd64`),
+with a Core i7-6700K CPU @ 4.0GHz,
+using [lzbench], an open-source in-memory benchmark by @inikep
+compiled with GCC 6.3.0,
+on the [Silesia compression corpus].
+
+[lzbench]: https://github.com/inikep/lzbench
+[Silesia compression corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia
+
+| Compressor name | Ratio | Compression| Decompress.|
+| --------------- | ------| -----------| ---------- |
+| **zstd 1.1.3 -1** | 2.877 | 430 MB/s | 1110 MB/s |
+| zlib 1.2.8 -1 | 2.743 | 110 MB/s | 400 MB/s |
+| brotli 0.5.2 -0 | 2.708 | 400 MB/s | 430 MB/s |
+| quicklz 1.5.0 -1 | 2.238 | 550 MB/s | 710 MB/s |
+| lzo1x 2.09 -1 | 2.108 | 650 MB/s | 830 MB/s |
+| lz4 1.7.5 | 2.101 | 720 MB/s | 3600 MB/s |
+| snappy 1.1.3 | 2.091 | 500 MB/s | 1650 MB/s |
+| lzf 3.6 -1 | 2.077 | 400 MB/s | 860 MB/s |
+
+[zlib]:http://www.zlib.net/
+[LZ4]: http://www.lz4.org/
+
+Zstd can also offer stronger compression ratios at the cost of compression speed.
+Speed vs Compression trade-off is configurable by small increments. Decompression speed is preserved and remains roughly the same at all settings, a property shared by most LZ compression algorithms, such as [zlib] or lzma.
+
+The following tests were run
+on a server running Linux Debian (`Linux version 4.8.0-1-amd64`)
+with a Core i7-6700K CPU @ 4.0GHz,
+using [lzbench], an open-source in-memory benchmark by @inikep
+compiled with GCC 6.3.0,
+on the [Silesia compression corpus].
+
+Compression Speed vs Ratio | Decompression Speed
+---------------------------|--------------------
+![Compression Speed vs Ratio](doc/images/Cspeed4.png "Compression Speed vs Ratio") | ![Decompression Speed](doc/images/Dspeed4.png "Decompression Speed")
+
+Several algorithms can produce higher compression ratios, but at slower speeds, falling outside of the graph.
+For a larger picture including very slow modes, [click on this link](doc/images/DCspeed5.png) .
+
+
+### The case for Small Data compression
+
+Previous charts provide results applicable to typical file and stream scenarios (several MB). Small data comes with different perspectives.
+
+The smaller the amount of data to compress, the more difficult it is to compress. This problem is common to all compression algorithms, and reason is, compression algorithms learn from past data how to compress future data. But at the beginning of a new data set, there is no "past" to build upon.
+
+To solve this situation, Zstd offers a __training mode__, which can be used to tune the algorithm for a selected type of data.
+Training Zstandard is achieved by providing it with a few samples (one file per sample). The result of this training is stored in a file called "dictionary", which must be loaded before compression and decompression.
+Using this dictionary, the compression ratio achievable on small data improves dramatically.
+
+The following example uses the `github-users` [sample set](https://github.com/facebook/zstd/releases/tag/v1.1.3), created from [github public API](https://developer.github.com/v3/users/#get-all-users).
+It consists of roughly 10K records weighing about 1KB each.
+
+Compression Ratio | Compression Speed | Decompression Speed
+------------------|-------------------|--------------------
+![Compression Ratio](doc/images/dict-cr.png "Compression Ratio") | ![Compression Speed](doc/images/dict-cs.png "Compression Speed") | ![Decompression Speed](doc/images/dict-ds.png "Decompression Speed")
+
+
+These compression gains are achieved while simultaneously providing _faster_ compression and decompression speeds.
+
+Training works if there is some correlation in a family of small data samples. The more data-specific a dictionary is, the more efficient it is (there is no _universal dictionary_).
+Hence, deploying one dictionary per type of data will provide the greatest benefits.
+Dictionary gains are mostly effective in the first few KB. Then, the compression algorithm will gradually use previously decoded content to better compress the rest of the file.
+
+#### Dictionary compression How To :
+
+1) Create the dictionary
+
+`zstd --train FullPathToTrainingSet/* -o dictionaryName`
+
+2) Compress with dictionary
+
+`zstd -D dictionaryName FILE`
+
+3) Decompress with dictionary
+
+`zstd -D dictionaryName --decompress FILE.zst`
+
+
+### Build
+
+Once you have the repository cloned, there are multiple ways provided to build Zstandard.
+
+#### Makefile
+
+If your system is compatible with a standard `make` (or `gmake`) binary generator,
+you can simply run it at the root directory.
+It will generate `zstd` within root directory.
+
+Other available options include :
+- `make install` : create and install zstd binary, library and man page
+- `make test` : create and run `zstd` and test tools on local platform
+
+#### cmake
+
+A `cmake` project generator is provided within `build/cmake`.
+It can generate Makefiles or other build scripts
+to create `zstd` binary, and `libzstd` dynamic and static libraries.
+
+#### Meson
+
+A Meson project is provided within `contrib/meson`.
+
+#### Visual Studio (Windows)
+
+Going into `build` directory, you will find additional possibilities :
+- Projects for Visual Studio 2005, 2008 and 2010
+ + VS2010 project is compatible with VS2012, VS2013 and VS2015
+- Automated build scripts for Visual compiler by @KrzysFR , in `build/VS_scripts`,
+ which will build `zstd` cli and `libzstd` library without any need to open Visual Studio solution.
+
+
+### Status
+
+Zstandard is currently deployed within Facebook. It is used daily to compress and decompress very large amounts of data in multiple formats and use cases.
+Zstandard is considered safe for production environments.
+
+### License
+
+Zstandard is [BSD-licensed](LICENSE). We also provide an [additional patent grant](PATENTS).
+
+### Contributing
+
+The "dev" branch is the one where all contributions will be merged before reaching "master".
+If you plan to propose a patch, please commit into the "dev" branch or its own feature branch.
+Direct commit to "master" are not permitted.
+For more information, please read [CONTRIBUTING](CONTRIBUTING.md).
+
+### Miscellaneous
+
+Zstd entropy stage is provided by [Huff0 and FSE, from Finite State Entropy library](https://github.com/Cyan4973/FiniteStateEntropy).
diff --git a/thirdparty/zstd/common/bitstream.h b/thirdparty/zstd/common/bitstream.h
new file mode 100644
index 0000000000..07b85026c9
--- /dev/null
+++ b/thirdparty/zstd/common/bitstream.h
@@ -0,0 +1,460 @@
+/* ******************************************************************
+ bitstream
+ Part of FSE library
+ header file (to include)
+ Copyright (C) 2013-2017, Yann Collet.
+
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ You can contact the author at :
+ - Source repository : https://github.com/Cyan4973/FiniteStateEntropy
+****************************************************************** */
+#ifndef BITSTREAM_H_MODULE
+#define BITSTREAM_H_MODULE
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+/*
+* This API consists of small unitary functions, which must be inlined for best performance.
+* Since link-time-optimization is not available for all compilers,
+* these functions are defined into a .h to be included.
+*/
+
+/*-****************************************
+* Dependencies
+******************************************/
+#include "mem.h" /* unaligned access routines */
+#include "error_private.h" /* error codes and messages */
+
+
+/*-*************************************
+* Debug
+***************************************/
+#if defined(BIT_DEBUG) && (BIT_DEBUG>=1)
+# include <assert.h>
+#else
+# ifndef assert
+# define assert(condition) ((void)0)
+# endif
+#endif
+
+
+/*=========================================
+* Target specific
+=========================================*/
+#if defined(__BMI__) && defined(__GNUC__)
+# include <immintrin.h> /* support for bextr (experimental) */
+#endif
+
+#define STREAM_ACCUMULATOR_MIN_32 25
+#define STREAM_ACCUMULATOR_MIN_64 57
+#define STREAM_ACCUMULATOR_MIN ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64))
+
+
+/*-******************************************
+* bitStream encoding API (write forward)
+********************************************/
+/* bitStream can mix input from multiple sources.
+* A critical property of these streams is that they encode and decode in **reverse** direction.
+* So the first bit sequence you add will be the last to be read, like a LIFO stack.
+*/
+typedef struct
+{
+ size_t bitContainer;
+ unsigned bitPos;
+ char* startPtr;
+ char* ptr;
+ char* endPtr;
+} BIT_CStream_t;
+
+MEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC, void* dstBuffer, size_t dstCapacity);
+MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits);
+MEM_STATIC void BIT_flushBits(BIT_CStream_t* bitC);
+MEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC);
+
+/* Start with initCStream, providing the size of buffer to write into.
+* bitStream will never write outside of this buffer.
+* `dstCapacity` must be >= sizeof(bitD->bitContainer), otherwise @return will be an error code.
+*
+* bits are first added to a local register.
+* Local register is size_t, hence 64-bits on 64-bits systems, or 32-bits on 32-bits systems.
+* Writing data into memory is an explicit operation, performed by the flushBits function.
+* Hence keep track how many bits are potentially stored into local register to avoid register overflow.
+* After a flushBits, a maximum of 7 bits might still be stored into local register.
+*
+* Avoid storing elements of more than 24 bits if you want compatibility with 32-bits bitstream readers.
+*
+* Last operation is to close the bitStream.
+* The function returns the final size of CStream in bytes.
+* If data couldn't fit into `dstBuffer`, it will return a 0 ( == not storable)
+*/
+
+
+/*-********************************************
+* bitStream decoding API (read backward)
+**********************************************/
+typedef struct
+{
+ size_t bitContainer;
+ unsigned bitsConsumed;
+ const char* ptr;
+ const char* start;
+ const char* limitPtr;
+} BIT_DStream_t;
+
+typedef enum { BIT_DStream_unfinished = 0,
+ BIT_DStream_endOfBuffer = 1,
+ BIT_DStream_completed = 2,
+ BIT_DStream_overflow = 3 } BIT_DStream_status; /* result of BIT_reloadDStream() */
+ /* 1,2,4,8 would be better for bitmap combinations, but slows down performance a bit ... :( */
+
+MEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize);
+MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);
+MEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);
+MEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* bitD);
+
+
+/* Start by invoking BIT_initDStream().
+* A chunk of the bitStream is then stored into a local register.
+* Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t).
+* You can then retrieve bitFields stored into the local register, **in reverse order**.
+* Local register is explicitly reloaded from memory by the BIT_reloadDStream() method.
+* A reload guarantee a minimum of ((8*sizeof(bitD->bitContainer))-7) bits when its result is BIT_DStream_unfinished.
+* Otherwise, it can be less than that, so proceed accordingly.
+* Checking if DStream has reached its end can be performed with BIT_endOfDStream().
+*/
+
+
+/*-****************************************
+* unsafe API
+******************************************/
+MEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits);
+/* faster, but works only if value is "clean", meaning all high bits above nbBits are 0 */
+
+MEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC);
+/* unsafe version; does not check buffer overflow */
+
+MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);
+/* faster, but works only if nbBits >= 1 */
+
+
+
+/*-**************************************************************
+* Internal functions
+****************************************************************/
+MEM_STATIC unsigned BIT_highbit32 (register U32 val)
+{
+# if defined(_MSC_VER) /* Visual */
+ unsigned long r=0;
+ _BitScanReverse ( &r, val );
+ return (unsigned) r;
+# elif defined(__GNUC__) && (__GNUC__ >= 3) /* Use GCC Intrinsic */
+ return 31 - __builtin_clz (val);
+# else /* Software version */
+ static const unsigned DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29,
+ 11, 14, 16, 18, 22, 25, 3, 30,
+ 8, 12, 20, 28, 15, 17, 24, 7,
+ 19, 27, 23, 6, 26, 5, 4, 31 };
+ U32 v = val;
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+ v |= v >> 16;
+ return DeBruijnClz[ (U32) (v * 0x07C4ACDDU) >> 27];
+# endif
+}
+
+/*===== Local Constants =====*/
+static const unsigned BIT_mask[] = { 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F,
+ 0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF,
+ 0xFFFF, 0x1FFFF, 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF,
+ 0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF }; /* up to 26 bits */
+
+
+/*-**************************************************************
+* bitStream encoding
+****************************************************************/
+/*! BIT_initCStream() :
+ * `dstCapacity` must be > sizeof(size_t)
+ * @return : 0 if success,
+ otherwise an error code (can be tested using ERR_isError() ) */
+MEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC,
+ void* startPtr, size_t dstCapacity)
+{
+ bitC->bitContainer = 0;
+ bitC->bitPos = 0;
+ bitC->startPtr = (char*)startPtr;
+ bitC->ptr = bitC->startPtr;
+ bitC->endPtr = bitC->startPtr + dstCapacity - sizeof(bitC->bitContainer);
+ if (dstCapacity <= sizeof(bitC->bitContainer)) return ERROR(dstSize_tooSmall);
+ return 0;
+}
+
+/*! BIT_addBits() :
+ can add up to 26 bits into `bitC`.
+ Does not check for register overflow ! */
+MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC,
+ size_t value, unsigned nbBits)
+{
+ bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos;
+ bitC->bitPos += nbBits;
+}
+
+/*! BIT_addBitsFast() :
+ * works only if `value` is _clean_, meaning all high bits above nbBits are 0 */
+MEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC,
+ size_t value, unsigned nbBits)
+{
+ assert((value>>nbBits) == 0);
+ bitC->bitContainer |= value << bitC->bitPos;
+ bitC->bitPos += nbBits;
+}
+
+/*! BIT_flushBitsFast() :
+ * assumption : bitContainer has not overflowed
+ * unsafe version; does not check buffer overflow */
+MEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC)
+{
+ size_t const nbBytes = bitC->bitPos >> 3;
+ assert( bitC->bitPos <= (sizeof(bitC->bitContainer)*8) );
+ MEM_writeLEST(bitC->ptr, bitC->bitContainer);
+ bitC->ptr += nbBytes;
+ assert(bitC->ptr <= bitC->endPtr);
+ bitC->bitPos &= 7;
+ bitC->bitContainer >>= nbBytes*8;
+}
+
+/*! BIT_flushBits() :
+ * assumption : bitContainer has not overflowed
+ * safe version; check for buffer overflow, and prevents it.
+ * note : does not signal buffer overflow.
+ * overflow will be revealed later on using BIT_closeCStream() */
+MEM_STATIC void BIT_flushBits(BIT_CStream_t* bitC)
+{
+ size_t const nbBytes = bitC->bitPos >> 3;
+ assert( bitC->bitPos <= (sizeof(bitC->bitContainer)*8) );
+ MEM_writeLEST(bitC->ptr, bitC->bitContainer);
+ bitC->ptr += nbBytes;
+ if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr;
+ bitC->bitPos &= 7;
+ bitC->bitContainer >>= nbBytes*8;
+}
+
+/*! BIT_closeCStream() :
+ * @return : size of CStream, in bytes,
+ or 0 if it could not fit into dstBuffer */
+MEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC)
+{
+ BIT_addBitsFast(bitC, 1, 1); /* endMark */
+ BIT_flushBits(bitC);
+ if (bitC->ptr >= bitC->endPtr) return 0; /* overflow detected */
+ return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);
+}
+
+
+/*-********************************************************
+* bitStream decoding
+**********************************************************/
+/*! BIT_initDStream() :
+* Initialize a BIT_DStream_t.
+* `bitD` : a pointer to an already allocated BIT_DStream_t structure.
+* `srcSize` must be the *exact* size of the bitStream, in bytes.
+* @return : size of stream (== srcSize) or an errorCode if a problem is detected
+*/
+MEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize)
+{
+ if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
+
+ bitD->start = (const char*)srcBuffer;
+ bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
+
+ if (srcSize >= sizeof(bitD->bitContainer)) { /* normal case */
+ bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
+ bitD->bitContainer = MEM_readLEST(bitD->ptr);
+ { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
+ bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0; /* ensures bitsConsumed is always set */
+ if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
+ } else {
+ bitD->ptr = bitD->start;
+ bitD->bitContainer = *(const BYTE*)(bitD->start);
+ switch(srcSize)
+ {
+ case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
+ /* fall-through */
+
+ case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
+ /* fall-through */
+
+ case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
+ /* fall-through */
+
+ case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24;
+ /* fall-through */
+
+ case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16;
+ /* fall-through */
+
+ case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8;
+ /* fall-through */
+
+ default: break;
+ }
+ { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
+ bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;
+ if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
+ bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
+ }
+
+ return srcSize;
+}
+
+MEM_STATIC size_t BIT_getUpperBits(size_t bitContainer, U32 const start)
+{
+ return bitContainer >> start;
+}
+
+MEM_STATIC size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits)
+{
+#if defined(__BMI__) && defined(__GNUC__) && __GNUC__*1000+__GNUC_MINOR__ >= 4008 /* experimental */
+# if defined(__x86_64__)
+ if (sizeof(bitContainer)==8)
+ return _bextr_u64(bitContainer, start, nbBits);
+ else
+# endif
+ return _bextr_u32(bitContainer, start, nbBits);
+#else
+ return (bitContainer >> start) & BIT_mask[nbBits];
+#endif
+}
+
+MEM_STATIC size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits)
+{
+ return bitContainer & BIT_mask[nbBits];
+}
+
+/*! BIT_lookBits() :
+ * Provides next n bits from local register.
+ * local register is not modified.
+ * On 32-bits, maxNbBits==24.
+ * On 64-bits, maxNbBits==56.
+ * @return : value extracted
+ */
+ MEM_STATIC size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits)
+{
+#if defined(__BMI__) && defined(__GNUC__) /* experimental; fails if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8 */
+ return BIT_getMiddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed - nbBits, nbBits);
+#else
+ U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
+ return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask);
+#endif
+}
+
+/*! BIT_lookBitsFast() :
+ * unsafe version; only works if nbBits >= 1 */
+MEM_STATIC size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits)
+{
+ U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
+ assert(nbBits >= 1);
+ return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
+}
+
+MEM_STATIC void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits)
+{
+ bitD->bitsConsumed += nbBits;
+}
+
+/*! BIT_readBits() :
+ * Read (consume) next n bits from local register and update.
+ * Pay attention to not read more than nbBits contained into local register.
+ * @return : extracted value.
+ */
+MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, U32 nbBits)
+{
+ size_t const value = BIT_lookBits(bitD, nbBits);
+ BIT_skipBits(bitD, nbBits);
+ return value;
+}
+
+/*! BIT_readBitsFast() :
+* unsafe version; only works only if nbBits >= 1 */
+MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, U32 nbBits)
+{
+ size_t const value = BIT_lookBitsFast(bitD, nbBits);
+ assert(nbBits >= 1);
+ BIT_skipBits(bitD, nbBits);
+ return value;
+}
+
+/*! BIT_reloadDStream() :
+* Refill `bitD` from buffer previously set in BIT_initDStream() .
+* This function is safe, it guarantees it will not read beyond src buffer.
+* @return : status of `BIT_DStream_t` internal register.
+ if status == BIT_DStream_unfinished, internal register is filled with >= (sizeof(bitD->bitContainer)*8 - 7) bits */
+MEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD)
+{
+ if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8)) /* overflow detected, like end of stream */
+ return BIT_DStream_overflow;
+
+ if (bitD->ptr >= bitD->limitPtr) {
+ bitD->ptr -= bitD->bitsConsumed >> 3;
+ bitD->bitsConsumed &= 7;
+ bitD->bitContainer = MEM_readLEST(bitD->ptr);
+ return BIT_DStream_unfinished;
+ }
+ if (bitD->ptr == bitD->start) {
+ if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
+ return BIT_DStream_completed;
+ }
+ /* start < ptr < limitPtr */
+ { U32 nbBytes = bitD->bitsConsumed >> 3;
+ BIT_DStream_status result = BIT_DStream_unfinished;
+ if (bitD->ptr - nbBytes < bitD->start) {
+ nbBytes = (U32)(bitD->ptr - bitD->start); /* ptr > start */
+ result = BIT_DStream_endOfBuffer;
+ }
+ bitD->ptr -= nbBytes;
+ bitD->bitsConsumed -= nbBytes*8;
+ bitD->bitContainer = MEM_readLEST(bitD->ptr); /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
+ return result;
+ }
+}
+
+/*! BIT_endOfDStream() :
+* @return Tells if DStream has exactly reached its end (all bits consumed).
+*/
+MEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* DStream)
+{
+ return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
+}
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif /* BITSTREAM_H_MODULE */
diff --git a/thirdparty/zstd/common/entropy_common.c b/thirdparty/zstd/common/entropy_common.c
new file mode 100644
index 0000000000..b37a082fee
--- /dev/null
+++ b/thirdparty/zstd/common/entropy_common.c
@@ -0,0 +1,221 @@
+/*
+ Common functions of New Generation Entropy library
+ Copyright (C) 2016, Yann Collet.
+
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ You can contact the author at :
+ - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy
+ - Public forum : https://groups.google.com/forum/#!forum/lz4c
+*************************************************************************** */
+
+/* *************************************
+* Dependencies
+***************************************/
+#include "mem.h"
+#include "error_private.h" /* ERR_*, ERROR */
+#define FSE_STATIC_LINKING_ONLY /* FSE_MIN_TABLELOG */
+#include "fse.h"
+#define HUF_STATIC_LINKING_ONLY /* HUF_TABLELOG_ABSOLUTEMAX */
+#include "huf.h"
+
+
+/*=== Version ===*/
+unsigned FSE_versionNumber(void) { return FSE_VERSION_NUMBER; }
+
+
+/*=== Error Management ===*/
+unsigned FSE_isError(size_t code) { return ERR_isError(code); }
+const char* FSE_getErrorName(size_t code) { return ERR_getErrorName(code); }
+
+unsigned HUF_isError(size_t code) { return ERR_isError(code); }
+const char* HUF_getErrorName(size_t code) { return ERR_getErrorName(code); }
+
+
+/*-**************************************************************
+* FSE NCount encoding-decoding
+****************************************************************/
+size_t FSE_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,
+ const void* headerBuffer, size_t hbSize)
+{
+ const BYTE* const istart = (const BYTE*) headerBuffer;
+ const BYTE* const iend = istart + hbSize;
+ const BYTE* ip = istart;
+ int nbBits;
+ int remaining;
+ int threshold;
+ U32 bitStream;
+ int bitCount;
+ unsigned charnum = 0;
+ int previous0 = 0;
+
+ if (hbSize < 4) return ERROR(srcSize_wrong);
+ bitStream = MEM_readLE32(ip);
+ nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG; /* extract tableLog */
+ if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
+ bitStream >>= 4;
+ bitCount = 4;
+ *tableLogPtr = nbBits;
+ remaining = (1<<nbBits)+1;
+ threshold = 1<<nbBits;
+ nbBits++;
+
+ while ((remaining>1) & (charnum<=*maxSVPtr)) {
+ if (previous0) {
+ unsigned n0 = charnum;
+ while ((bitStream & 0xFFFF) == 0xFFFF) {
+ n0 += 24;
+ if (ip < iend-5) {
+ ip += 2;
+ bitStream = MEM_readLE32(ip) >> bitCount;
+ } else {
+ bitStream >>= 16;
+ bitCount += 16;
+ } }
+ while ((bitStream & 3) == 3) {
+ n0 += 3;
+ bitStream >>= 2;
+ bitCount += 2;
+ }
+ n0 += bitStream & 3;
+ bitCount += 2;
+ if (n0 > *maxSVPtr) return ERROR(maxSymbolValue_tooSmall);
+ while (charnum < n0) normalizedCounter[charnum++] = 0;
+ if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
+ ip += bitCount>>3;
+ bitCount &= 7;
+ bitStream = MEM_readLE32(ip) >> bitCount;
+ } else {
+ bitStream >>= 2;
+ } }
+ { int const max = (2*threshold-1) - remaining;
+ int count;
+
+ if ((bitStream & (threshold-1)) < (U32)max) {
+ count = bitStream & (threshold-1);
+ bitCount += nbBits-1;
+ } else {
+ count = bitStream & (2*threshold-1);
+ if (count >= threshold) count -= max;
+ bitCount += nbBits;
+ }
+
+ count--; /* extra accuracy */
+ remaining -= count < 0 ? -count : count; /* -1 means +1 */
+ normalizedCounter[charnum++] = (short)count;
+ previous0 = !count;
+ while (remaining < threshold) {
+ nbBits--;
+ threshold >>= 1;
+ }
+
+ if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
+ ip += bitCount>>3;
+ bitCount &= 7;
+ } else {
+ bitCount -= (int)(8 * (iend - 4 - ip));
+ ip = iend - 4;
+ }
+ bitStream = MEM_readLE32(ip) >> (bitCount & 31);
+ } } /* while ((remaining>1) & (charnum<=*maxSVPtr)) */
+ if (remaining != 1) return ERROR(corruption_detected);
+ if (bitCount > 32) return ERROR(corruption_detected);
+ *maxSVPtr = charnum-1;
+
+ ip += (bitCount+7)>>3;
+ return ip-istart;
+}
+
+
+/*! HUF_readStats() :
+ Read compact Huffman tree, saved by HUF_writeCTable().
+ `huffWeight` is destination buffer.
+ `rankStats` is assumed to be a table of at least HUF_TABLELOG_MAX U32.
+ @return : size read from `src` , or an error Code .
+ Note : Needed by HUF_readCTable() and HUF_readDTableX?() .
+*/
+size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, U32* rankStats,
+ U32* nbSymbolsPtr, U32* tableLogPtr,
+ const void* src, size_t srcSize)
+{
+ U32 weightTotal;
+ const BYTE* ip = (const BYTE*) src;
+ size_t iSize;
+ size_t oSize;
+
+ if (!srcSize) return ERROR(srcSize_wrong);
+ iSize = ip[0];
+ /* memset(huffWeight, 0, hwSize); *//* is not necessary, even though some analyzer complain ... */
+
+ if (iSize >= 128) { /* special header */
+ oSize = iSize - 127;
+ iSize = ((oSize+1)/2);
+ if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
+ if (oSize >= hwSize) return ERROR(corruption_detected);
+ ip += 1;
+ { U32 n;
+ for (n=0; n<oSize; n+=2) {
+ huffWeight[n] = ip[n/2] >> 4;
+ huffWeight[n+1] = ip[n/2] & 15;
+ } } }
+ else { /* header compressed with FSE (normal case) */
+ FSE_DTable fseWorkspace[FSE_DTABLE_SIZE_U32(6)]; /* 6 is max possible tableLog for HUF header (maybe even 5, to be tested) */
+ if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
+ oSize = FSE_decompress_wksp(huffWeight, hwSize-1, ip+1, iSize, fseWorkspace, 6); /* max (hwSize-1) values decoded, as last one is implied */
+ if (FSE_isError(oSize)) return oSize;
+ }
+
+ /* collect weight stats */
+ memset(rankStats, 0, (HUF_TABLELOG_MAX + 1) * sizeof(U32));
+ weightTotal = 0;
+ { U32 n; for (n=0; n<oSize; n++) {
+ if (huffWeight[n] >= HUF_TABLELOG_MAX) return ERROR(corruption_detected);
+ rankStats[huffWeight[n]]++;
+ weightTotal += (1 << huffWeight[n]) >> 1;
+ } }
+ if (weightTotal == 0) return ERROR(corruption_detected);
+
+ /* get last non-null symbol weight (implied, total must be 2^n) */
+ { U32 const tableLog = BIT_highbit32(weightTotal) + 1;
+ if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
+ *tableLogPtr = tableLog;
+ /* determine last weight */
+ { U32 const total = 1 << tableLog;
+ U32 const rest = total - weightTotal;
+ U32 const verif = 1 << BIT_highbit32(rest);
+ U32 const lastWeight = BIT_highbit32(rest) + 1;
+ if (verif != rest) return ERROR(corruption_detected); /* last value must be a clean power of 2 */
+ huffWeight[oSize] = (BYTE)lastWeight;
+ rankStats[lastWeight]++;
+ } }
+
+ /* check tree construction validity */
+ if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected); /* by construction : at least 2 elts of rank 1, must be even */
+
+ /* results */
+ *nbSymbolsPtr = (U32)(oSize+1);
+ return iSize+1;
+}
diff --git a/thirdparty/zstd/common/error_private.c b/thirdparty/zstd/common/error_private.c
new file mode 100644
index 0000000000..2d752cd23a
--- /dev/null
+++ b/thirdparty/zstd/common/error_private.c
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+/* The purpose of this file is to have a single list of error strings embedded in binary */
+
+#include "error_private.h"
+
+const char* ERR_getErrorString(ERR_enum code)
+{
+ static const char* const notErrorCode = "Unspecified error code";
+ switch( code )
+ {
+ case PREFIX(no_error): return "No error detected";
+ case PREFIX(GENERIC): return "Error (generic)";
+ case PREFIX(prefix_unknown): return "Unknown frame descriptor";
+ case PREFIX(version_unsupported): return "Version not supported";
+ case PREFIX(parameter_unknown): return "Unknown parameter type";
+ case PREFIX(frameParameter_unsupported): return "Unsupported frame parameter";
+ case PREFIX(frameParameter_unsupportedBy32bits): return "Frame parameter unsupported in 32-bits mode";
+ case PREFIX(frameParameter_windowTooLarge): return "Frame requires too much memory for decoding";
+ case PREFIX(compressionParameter_unsupported): return "Compression parameter is not supported";
+ case PREFIX(compressionParameter_outOfBound): return "Compression parameter is out of bound";
+ case PREFIX(init_missing): return "Context should be init first";
+ case PREFIX(memory_allocation): return "Allocation error : not enough memory";
+ case PREFIX(stage_wrong): return "Operation not authorized at current processing stage";
+ case PREFIX(dstSize_tooSmall): return "Destination buffer is too small";
+ case PREFIX(srcSize_wrong): return "Src size is incorrect";
+ case PREFIX(corruption_detected): return "Corrupted block detected";
+ case PREFIX(checksum_wrong): return "Restored data doesn't match checksum";
+ case PREFIX(tableLog_tooLarge): return "tableLog requires too much memory : unsupported";
+ case PREFIX(maxSymbolValue_tooLarge): return "Unsupported max Symbol Value : too large";
+ case PREFIX(maxSymbolValue_tooSmall): return "Specified maxSymbolValue is too small";
+ case PREFIX(dictionary_corrupted): return "Dictionary is corrupted";
+ case PREFIX(dictionary_wrong): return "Dictionary mismatch";
+ case PREFIX(dictionaryCreation_failed): return "Cannot create Dictionary from provided samples";
+ case PREFIX(frameIndex_tooLarge): return "Frame index is too large";
+ case PREFIX(seekableIO): return "An I/O error occurred when reading/seeking";
+ case PREFIX(maxCode):
+ default: return notErrorCode;
+ }
+}
diff --git a/thirdparty/zstd/common/error_private.h b/thirdparty/zstd/common/error_private.h
new file mode 100644
index 0000000000..1bc2e49548
--- /dev/null
+++ b/thirdparty/zstd/common/error_private.h
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+/* Note : this module is expected to remain private, do not expose it */
+
+#ifndef ERROR_H_MODULE
+#define ERROR_H_MODULE
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+
+/* ****************************************
+* Dependencies
+******************************************/
+#include <stddef.h> /* size_t */
+#include "zstd_errors.h" /* enum list */
+
+
+/* ****************************************
+* Compiler-specific
+******************************************/
+#if defined(__GNUC__)
+# define ERR_STATIC static __attribute__((unused))
+#elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)
+# define ERR_STATIC static inline
+#elif defined(_MSC_VER)
+# define ERR_STATIC static __inline
+#else
+# define ERR_STATIC static /* this version may generate warnings for unused static functions; disable the relevant warning */
+#endif
+
+
+/*-****************************************
+* Customization (error_public.h)
+******************************************/
+typedef ZSTD_ErrorCode ERR_enum;
+#define PREFIX(name) ZSTD_error_##name
+
+
+/*-****************************************
+* Error codes handling
+******************************************/
+#ifdef ERROR
+# undef ERROR /* reported already defined on VS 2015 (Rich Geldreich) */
+#endif
+#define ERROR(name) ((size_t)-PREFIX(name))
+
+ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
+
+ERR_STATIC ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); }
+
+
+/*-****************************************
+* Error Strings
+******************************************/
+
+const char* ERR_getErrorString(ERR_enum code); /* error_private.c */
+
+ERR_STATIC const char* ERR_getErrorName(size_t code)
+{
+ return ERR_getErrorString(ERR_getErrorCode(code));
+}
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif /* ERROR_H_MODULE */
diff --git a/thirdparty/zstd/common/fse.h b/thirdparty/zstd/common/fse.h
new file mode 100644
index 0000000000..6d5d41def1
--- /dev/null
+++ b/thirdparty/zstd/common/fse.h
@@ -0,0 +1,698 @@
+/* ******************************************************************
+ FSE : Finite State Entropy codec
+ Public Prototypes declaration
+ Copyright (C) 2013-2016, Yann Collet.
+
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ You can contact the author at :
+ - Source repository : https://github.com/Cyan4973/FiniteStateEntropy
+****************************************************************** */
+#ifndef FSE_H
+#define FSE_H
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+
+/*-*****************************************
+* Dependencies
+******************************************/
+#include <stddef.h> /* size_t, ptrdiff_t */
+
+
+/*-*****************************************
+* FSE_PUBLIC_API : control library symbols visibility
+******************************************/
+#if defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) && defined(__GNUC__) && (__GNUC__ >= 4)
+# define FSE_PUBLIC_API __attribute__ ((visibility ("default")))
+#elif defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) /* Visual expected */
+# define FSE_PUBLIC_API __declspec(dllexport)
+#elif defined(FSE_DLL_IMPORT) && (FSE_DLL_IMPORT==1)
+# define FSE_PUBLIC_API __declspec(dllimport) /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
+#else
+# define FSE_PUBLIC_API
+#endif
+
+/*------ Version ------*/
+#define FSE_VERSION_MAJOR 0
+#define FSE_VERSION_MINOR 9
+#define FSE_VERSION_RELEASE 0
+
+#define FSE_LIB_VERSION FSE_VERSION_MAJOR.FSE_VERSION_MINOR.FSE_VERSION_RELEASE
+#define FSE_QUOTE(str) #str
+#define FSE_EXPAND_AND_QUOTE(str) FSE_QUOTE(str)
+#define FSE_VERSION_STRING FSE_EXPAND_AND_QUOTE(FSE_LIB_VERSION)
+
+#define FSE_VERSION_NUMBER (FSE_VERSION_MAJOR *100*100 + FSE_VERSION_MINOR *100 + FSE_VERSION_RELEASE)
+FSE_PUBLIC_API unsigned FSE_versionNumber(void); /**< library version number; to be used when checking dll version */
+
+/*-****************************************
+* FSE simple functions
+******************************************/
+/*! FSE_compress() :
+ Compress content of buffer 'src', of size 'srcSize', into destination buffer 'dst'.
+ 'dst' buffer must be already allocated. Compression runs faster is dstCapacity >= FSE_compressBound(srcSize).
+ @return : size of compressed data (<= dstCapacity).
+ Special values : if return == 0, srcData is not compressible => Nothing is stored within dst !!!
+ if return == 1, srcData is a single byte symbol * srcSize times. Use RLE compression instead.
+ if FSE_isError(return), compression failed (more details using FSE_getErrorName())
+*/
+FSE_PUBLIC_API size_t FSE_compress(void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize);
+
+/*! FSE_decompress():
+ Decompress FSE data from buffer 'cSrc', of size 'cSrcSize',
+ into already allocated destination buffer 'dst', of size 'dstCapacity'.
+ @return : size of regenerated data (<= maxDstSize),
+ or an error code, which can be tested using FSE_isError() .
+
+ ** Important ** : FSE_decompress() does not decompress non-compressible nor RLE data !!!
+ Why ? : making this distinction requires a header.
+ Header management is intentionally delegated to the user layer, which can better manage special cases.
+*/
+FSE_PUBLIC_API size_t FSE_decompress(void* dst, size_t dstCapacity,
+ const void* cSrc, size_t cSrcSize);
+
+
+/*-*****************************************
+* Tool functions
+******************************************/
+FSE_PUBLIC_API size_t FSE_compressBound(size_t size); /* maximum compressed size */
+
+/* Error Management */
+FSE_PUBLIC_API unsigned FSE_isError(size_t code); /* tells if a return value is an error code */
+FSE_PUBLIC_API const char* FSE_getErrorName(size_t code); /* provides error code string (useful for debugging) */
+
+
+/*-*****************************************
+* FSE advanced functions
+******************************************/
+/*! FSE_compress2() :
+ Same as FSE_compress(), but allows the selection of 'maxSymbolValue' and 'tableLog'
+ Both parameters can be defined as '0' to mean : use default value
+ @return : size of compressed data
+ Special values : if return == 0, srcData is not compressible => Nothing is stored within cSrc !!!
+ if return == 1, srcData is a single byte symbol * srcSize times. Use RLE compression.
+ if FSE_isError(return), it's an error code.
+*/
+FSE_PUBLIC_API size_t FSE_compress2 (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
+
+
+/*-*****************************************
+* FSE detailed API
+******************************************/
+/*!
+FSE_compress() does the following:
+1. count symbol occurrence from source[] into table count[]
+2. normalize counters so that sum(count[]) == Power_of_2 (2^tableLog)
+3. save normalized counters to memory buffer using writeNCount()
+4. build encoding table 'CTable' from normalized counters
+5. encode the data stream using encoding table 'CTable'
+
+FSE_decompress() does the following:
+1. read normalized counters with readNCount()
+2. build decoding table 'DTable' from normalized counters
+3. decode the data stream using decoding table 'DTable'
+
+The following API allows targeting specific sub-functions for advanced tasks.
+For example, it's possible to compress several blocks using the same 'CTable',
+or to save and provide normalized distribution using external method.
+*/
+
+/* *** COMPRESSION *** */
+
+/*! FSE_count():
+ Provides the precise count of each byte within a table 'count'.
+ 'count' is a table of unsigned int, of minimum size (*maxSymbolValuePtr+1).
+ *maxSymbolValuePtr will be updated if detected smaller than initial value.
+ @return : the count of the most frequent symbol (which is not identified).
+ if return == srcSize, there is only one symbol.
+ Can also return an error code, which can be tested with FSE_isError(). */
+FSE_PUBLIC_API size_t FSE_count(unsigned* count, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize);
+
+/*! FSE_optimalTableLog():
+ dynamically downsize 'tableLog' when conditions are met.
+ It saves CPU time, by using smaller tables, while preserving or even improving compression ratio.
+ @return : recommended tableLog (necessarily <= 'maxTableLog') */
+FSE_PUBLIC_API unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);
+
+/*! FSE_normalizeCount():
+ normalize counts so that sum(count[]) == Power_of_2 (2^tableLog)
+ 'normalizedCounter' is a table of short, of minimum size (maxSymbolValue+1).
+ @return : tableLog,
+ or an errorCode, which can be tested using FSE_isError() */
+FSE_PUBLIC_API size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog, const unsigned* count, size_t srcSize, unsigned maxSymbolValue);
+
+/*! FSE_NCountWriteBound():
+ Provides the maximum possible size of an FSE normalized table, given 'maxSymbolValue' and 'tableLog'.
+ Typically useful for allocation purpose. */
+FSE_PUBLIC_API size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);
+
+/*! FSE_writeNCount():
+ Compactly save 'normalizedCounter' into 'buffer'.
+ @return : size of the compressed table,
+ or an errorCode, which can be tested using FSE_isError(). */
+FSE_PUBLIC_API size_t FSE_writeNCount (void* buffer, size_t bufferSize, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
+
+
+/*! Constructor and Destructor of FSE_CTable.
+ Note that FSE_CTable size depends on 'tableLog' and 'maxSymbolValue' */
+typedef unsigned FSE_CTable; /* don't allocate that. It's only meant to be more restrictive than void* */
+FSE_PUBLIC_API FSE_CTable* FSE_createCTable (unsigned tableLog, unsigned maxSymbolValue);
+FSE_PUBLIC_API void FSE_freeCTable (FSE_CTable* ct);
+
+/*! FSE_buildCTable():
+ Builds `ct`, which must be already allocated, using FSE_createCTable().
+ @return : 0, or an errorCode, which can be tested using FSE_isError() */
+FSE_PUBLIC_API size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
+
+/*! FSE_compress_usingCTable():
+ Compress `src` using `ct` into `dst` which must be already allocated.
+ @return : size of compressed data (<= `dstCapacity`),
+ or 0 if compressed data could not fit into `dst`,
+ or an errorCode, which can be tested using FSE_isError() */
+FSE_PUBLIC_API size_t FSE_compress_usingCTable (void* dst, size_t dstCapacity, const void* src, size_t srcSize, const FSE_CTable* ct);
+
+/*!
+Tutorial :
+----------
+The first step is to count all symbols. FSE_count() does this job very fast.
+Result will be saved into 'count', a table of unsigned int, which must be already allocated, and have 'maxSymbolValuePtr[0]+1' cells.
+'src' is a table of bytes of size 'srcSize'. All values within 'src' MUST be <= maxSymbolValuePtr[0]
+maxSymbolValuePtr[0] will be updated, with its real value (necessarily <= original value)
+FSE_count() will return the number of occurrence of the most frequent symbol.
+This can be used to know if there is a single symbol within 'src', and to quickly evaluate its compressibility.
+If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).
+
+The next step is to normalize the frequencies.
+FSE_normalizeCount() will ensure that sum of frequencies is == 2 ^'tableLog'.
+It also guarantees a minimum of 1 to any Symbol with frequency >= 1.
+You can use 'tableLog'==0 to mean "use default tableLog value".
+If you are unsure of which tableLog value to use, you can ask FSE_optimalTableLog(),
+which will provide the optimal valid tableLog given sourceSize, maxSymbolValue, and a user-defined maximum (0 means "default").
+
+The result of FSE_normalizeCount() will be saved into a table,
+called 'normalizedCounter', which is a table of signed short.
+'normalizedCounter' must be already allocated, and have at least 'maxSymbolValue+1' cells.
+The return value is tableLog if everything proceeded as expected.
+It is 0 if there is a single symbol within distribution.
+If there is an error (ex: invalid tableLog value), the function will return an ErrorCode (which can be tested using FSE_isError()).
+
+'normalizedCounter' can be saved in a compact manner to a memory area using FSE_writeNCount().
+'buffer' must be already allocated.
+For guaranteed success, buffer size must be at least FSE_headerBound().
+The result of the function is the number of bytes written into 'buffer'.
+If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError(); ex : buffer size too small).
+
+'normalizedCounter' can then be used to create the compression table 'CTable'.
+The space required by 'CTable' must be already allocated, using FSE_createCTable().
+You can then use FSE_buildCTable() to fill 'CTable'.
+If there is an error, both functions will return an ErrorCode (which can be tested using FSE_isError()).
+
+'CTable' can then be used to compress 'src', with FSE_compress_usingCTable().
+Similar to FSE_count(), the convention is that 'src' is assumed to be a table of char of size 'srcSize'
+The function returns the size of compressed data (without header), necessarily <= `dstCapacity`.
+If it returns '0', compressed data could not fit into 'dst'.
+If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).
+*/
+
+
+/* *** DECOMPRESSION *** */
+
+/*! FSE_readNCount():
+ Read compactly saved 'normalizedCounter' from 'rBuffer'.
+ @return : size read from 'rBuffer',
+ or an errorCode, which can be tested using FSE_isError().
+ maxSymbolValuePtr[0] and tableLogPtr[0] will also be updated with their respective values */
+FSE_PUBLIC_API size_t FSE_readNCount (short* normalizedCounter, unsigned* maxSymbolValuePtr, unsigned* tableLogPtr, const void* rBuffer, size_t rBuffSize);
+
+/*! Constructor and Destructor of FSE_DTable.
+ Note that its size depends on 'tableLog' */
+typedef unsigned FSE_DTable; /* don't allocate that. It's just a way to be more restrictive than void* */
+FSE_PUBLIC_API FSE_DTable* FSE_createDTable(unsigned tableLog);
+FSE_PUBLIC_API void FSE_freeDTable(FSE_DTable* dt);
+
+/*! FSE_buildDTable():
+ Builds 'dt', which must be already allocated, using FSE_createDTable().
+ return : 0, or an errorCode, which can be tested using FSE_isError() */
+FSE_PUBLIC_API size_t FSE_buildDTable (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
+
+/*! FSE_decompress_usingDTable():
+ Decompress compressed source `cSrc` of size `cSrcSize` using `dt`
+ into `dst` which must be already allocated.
+ @return : size of regenerated data (necessarily <= `dstCapacity`),
+ or an errorCode, which can be tested using FSE_isError() */
+FSE_PUBLIC_API size_t FSE_decompress_usingDTable(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, const FSE_DTable* dt);
+
+/*!
+Tutorial :
+----------
+(Note : these functions only decompress FSE-compressed blocks.
+ If block is uncompressed, use memcpy() instead
+ If block is a single repeated byte, use memset() instead )
+
+The first step is to obtain the normalized frequencies of symbols.
+This can be performed by FSE_readNCount() if it was saved using FSE_writeNCount().
+'normalizedCounter' must be already allocated, and have at least 'maxSymbolValuePtr[0]+1' cells of signed short.
+In practice, that means it's necessary to know 'maxSymbolValue' beforehand,
+or size the table to handle worst case situations (typically 256).
+FSE_readNCount() will provide 'tableLog' and 'maxSymbolValue'.
+The result of FSE_readNCount() is the number of bytes read from 'rBuffer'.
+Note that 'rBufferSize' must be at least 4 bytes, even if useful information is less than that.
+If there is an error, the function will return an error code, which can be tested using FSE_isError().
+
+The next step is to build the decompression tables 'FSE_DTable' from 'normalizedCounter'.
+This is performed by the function FSE_buildDTable().
+The space required by 'FSE_DTable' must be already allocated using FSE_createDTable().
+If there is an error, the function will return an error code, which can be tested using FSE_isError().
+
+`FSE_DTable` can then be used to decompress `cSrc`, with FSE_decompress_usingDTable().
+`cSrcSize` must be strictly correct, otherwise decompression will fail.
+FSE_decompress_usingDTable() result will tell how many bytes were regenerated (<=`dstCapacity`).
+If there is an error, the function will return an error code, which can be tested using FSE_isError(). (ex: dst buffer too small)
+*/
+
+
+#ifdef FSE_STATIC_LINKING_ONLY
+
+/* *** Dependency *** */
+#include "bitstream.h"
+
+
+/* *****************************************
+* Static allocation
+*******************************************/
+/* FSE buffer bounds */
+#define FSE_NCOUNTBOUND 512
+#define FSE_BLOCKBOUND(size) (size + (size>>7))
+#define FSE_COMPRESSBOUND(size) (FSE_NCOUNTBOUND + FSE_BLOCKBOUND(size)) /* Macro version, useful for static allocation */
+
+/* It is possible to statically allocate FSE CTable/DTable as a table of FSE_CTable/FSE_DTable using below macros */
+#define FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) (1 + (1<<(maxTableLog-1)) + ((maxSymbolValue+1)*2))
+#define FSE_DTABLE_SIZE_U32(maxTableLog) (1 + (1<<maxTableLog))
+
+/* or use the size to malloc() space directly. Pay attention to alignment restrictions though */
+#define FSE_CTABLE_SIZE(maxTableLog, maxSymbolValue) (FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(FSE_CTable))
+#define FSE_DTABLE_SIZE(maxTableLog) (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))
+
+
+/* *****************************************
+* FSE advanced API
+*******************************************/
+/* FSE_count_wksp() :
+ * Same as FSE_count(), but using an externally provided scratch buffer.
+ * `workSpace` size must be table of >= `1024` unsigned
+ */
+size_t FSE_count_wksp(unsigned* count, unsigned* maxSymbolValuePtr,
+ const void* source, size_t sourceSize, unsigned* workSpace);
+
+/** FSE_countFast() :
+ * same as FSE_count(), but blindly trusts that all byte values within src are <= *maxSymbolValuePtr
+ */
+size_t FSE_countFast(unsigned* count, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize);
+
+/* FSE_countFast_wksp() :
+ * Same as FSE_countFast(), but using an externally provided scratch buffer.
+ * `workSpace` must be a table of minimum `1024` unsigned
+ */
+size_t FSE_countFast_wksp(unsigned* count, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize, unsigned* workSpace);
+
+/*! FSE_count_simple
+ * Same as FSE_countFast(), but does not use any additional memory (not even on stack).
+ * This function is unsafe, and will segfault if any value within `src` is `> *maxSymbolValuePtr` (presuming it's also the size of `count`).
+*/
+size_t FSE_count_simple(unsigned* count, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize);
+
+
+
+unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus);
+/**< same as FSE_optimalTableLog(), which used `minus==2` */
+
+/* FSE_compress_wksp() :
+ * Same as FSE_compress2(), but using an externally allocated scratch buffer (`workSpace`).
+ * FSE_WKSP_SIZE_U32() provides the minimum size required for `workSpace` as a table of FSE_CTable.
+ */
+#define FSE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) ( FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) + ((maxTableLog > 12) ? (1 << (maxTableLog - 2)) : 1024) )
+size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);
+
+size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits);
+/**< build a fake FSE_CTable, designed for a flat distribution, where each symbol uses nbBits */
+
+size_t FSE_buildCTable_rle (FSE_CTable* ct, unsigned char symbolValue);
+/**< build a fake FSE_CTable, designed to compress always the same symbolValue */
+
+/* FSE_buildCTable_wksp() :
+ * Same as FSE_buildCTable(), but using an externally allocated scratch buffer (`workSpace`).
+ * `wkspSize` must be >= `(1<<tableLog)`.
+ */
+size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);
+
+size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits);
+/**< build a fake FSE_DTable, designed to read a flat distribution where each symbol uses nbBits */
+
+size_t FSE_buildDTable_rle (FSE_DTable* dt, unsigned char symbolValue);
+/**< build a fake FSE_DTable, designed to always generate the same symbolValue */
+
+size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, FSE_DTable* workSpace, unsigned maxLog);
+/**< same as FSE_decompress(), using an externally allocated `workSpace` produced with `FSE_DTABLE_SIZE_U32(maxLog)` */
+
+
+/* *****************************************
+* FSE symbol compression API
+*******************************************/
+/*!
+ This API consists of small unitary functions, which highly benefit from being inlined.
+ Hence their body are included in next section.
+*/
+typedef struct {
+ ptrdiff_t value;
+ const void* stateTable;
+ const void* symbolTT;
+ unsigned stateLog;
+} FSE_CState_t;
+
+static void FSE_initCState(FSE_CState_t* CStatePtr, const FSE_CTable* ct);
+
+static void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* CStatePtr, unsigned symbol);
+
+static void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* CStatePtr);
+
+/**<
+These functions are inner components of FSE_compress_usingCTable().
+They allow the creation of custom streams, mixing multiple tables and bit sources.
+
+A key property to keep in mind is that encoding and decoding are done **in reverse direction**.
+So the first symbol you will encode is the last you will decode, like a LIFO stack.
+
+You will need a few variables to track your CStream. They are :
+
+FSE_CTable ct; // Provided by FSE_buildCTable()
+BIT_CStream_t bitStream; // bitStream tracking structure
+FSE_CState_t state; // State tracking structure (can have several)
+
+
+The first thing to do is to init bitStream and state.
+ size_t errorCode = BIT_initCStream(&bitStream, dstBuffer, maxDstSize);
+ FSE_initCState(&state, ct);
+
+Note that BIT_initCStream() can produce an error code, so its result should be tested, using FSE_isError();
+You can then encode your input data, byte after byte.
+FSE_encodeSymbol() outputs a maximum of 'tableLog' bits at a time.
+Remember decoding will be done in reverse direction.
+ FSE_encodeByte(&bitStream, &state, symbol);
+
+At any time, you can also add any bit sequence.
+Note : maximum allowed nbBits is 25, for compatibility with 32-bits decoders
+ BIT_addBits(&bitStream, bitField, nbBits);
+
+The above methods don't commit data to memory, they just store it into local register, for speed.
+Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t).
+Writing data to memory is a manual operation, performed by the flushBits function.
+ BIT_flushBits(&bitStream);
+
+Your last FSE encoding operation shall be to flush your last state value(s).
+ FSE_flushState(&bitStream, &state);
+
+Finally, you must close the bitStream.
+The function returns the size of CStream in bytes.
+If data couldn't fit into dstBuffer, it will return a 0 ( == not compressible)
+If there is an error, it returns an errorCode (which can be tested using FSE_isError()).
+ size_t size = BIT_closeCStream(&bitStream);
+*/
+
+
+/* *****************************************
+* FSE symbol decompression API
+*******************************************/
+typedef struct {
+ size_t state;
+ const void* table; /* precise table may vary, depending on U16 */
+} FSE_DState_t;
+
+
+static void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt);
+
+static unsigned char FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);
+
+static unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr);
+
+/**<
+Let's now decompose FSE_decompress_usingDTable() into its unitary components.
+You will decode FSE-encoded symbols from the bitStream,
+and also any other bitFields you put in, **in reverse order**.
+
+You will need a few variables to track your bitStream. They are :
+
+BIT_DStream_t DStream; // Stream context
+FSE_DState_t DState; // State context. Multiple ones are possible
+FSE_DTable* DTablePtr; // Decoding table, provided by FSE_buildDTable()
+
+The first thing to do is to init the bitStream.
+ errorCode = BIT_initDStream(&DStream, srcBuffer, srcSize);
+
+You should then retrieve your initial state(s)
+(in reverse flushing order if you have several ones) :
+ errorCode = FSE_initDState(&DState, &DStream, DTablePtr);
+
+You can then decode your data, symbol after symbol.
+For information the maximum number of bits read by FSE_decodeSymbol() is 'tableLog'.
+Keep in mind that symbols are decoded in reverse order, like a LIFO stack (last in, first out).
+ unsigned char symbol = FSE_decodeSymbol(&DState, &DStream);
+
+You can retrieve any bitfield you eventually stored into the bitStream (in reverse order)
+Note : maximum allowed nbBits is 25, for 32-bits compatibility
+ size_t bitField = BIT_readBits(&DStream, nbBits);
+
+All above operations only read from local register (which size depends on size_t).
+Refueling the register from memory is manually performed by the reload method.
+ endSignal = FSE_reloadDStream(&DStream);
+
+BIT_reloadDStream() result tells if there is still some more data to read from DStream.
+BIT_DStream_unfinished : there is still some data left into the DStream.
+BIT_DStream_endOfBuffer : Dstream reached end of buffer. Its container may no longer be completely filled.
+BIT_DStream_completed : Dstream reached its exact end, corresponding in general to decompression completed.
+BIT_DStream_tooFar : Dstream went too far. Decompression result is corrupted.
+
+When reaching end of buffer (BIT_DStream_endOfBuffer), progress slowly, notably if you decode multiple symbols per loop,
+to properly detect the exact end of stream.
+After each decoded symbol, check if DStream is fully consumed using this simple test :
+ BIT_reloadDStream(&DStream) >= BIT_DStream_completed
+
+When it's done, verify decompression is fully completed, by checking both DStream and the relevant states.
+Checking if DStream has reached its end is performed by :
+ BIT_endOfDStream(&DStream);
+Check also the states. There might be some symbols left there, if some high probability ones (>50%) are possible.
+ FSE_endOfDState(&DState);
+*/
+
+
+/* *****************************************
+* FSE unsafe API
+*******************************************/
+static unsigned char FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);
+/* faster, but works only if nbBits is always >= 1 (otherwise, result will be corrupted) */
+
+
+/* *****************************************
+* Implementation of inlined functions
+*******************************************/
+typedef struct {
+ int deltaFindState;
+ U32 deltaNbBits;
+} FSE_symbolCompressionTransform; /* total 8 bytes */
+
+MEM_STATIC void FSE_initCState(FSE_CState_t* statePtr, const FSE_CTable* ct)
+{
+ const void* ptr = ct;
+ const U16* u16ptr = (const U16*) ptr;
+ const U32 tableLog = MEM_read16(ptr);
+ statePtr->value = (ptrdiff_t)1<<tableLog;
+ statePtr->stateTable = u16ptr+2;
+ statePtr->symbolTT = ((const U32*)ct + 1 + (tableLog ? (1<<(tableLog-1)) : 1));
+ statePtr->stateLog = tableLog;
+}
+
+
+/*! FSE_initCState2() :
+* Same as FSE_initCState(), but the first symbol to include (which will be the last to be read)
+* uses the smallest state value possible, saving the cost of this symbol */
+MEM_STATIC void FSE_initCState2(FSE_CState_t* statePtr, const FSE_CTable* ct, U32 symbol)
+{
+ FSE_initCState(statePtr, ct);
+ { const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
+ const U16* stateTable = (const U16*)(statePtr->stateTable);
+ U32 nbBitsOut = (U32)((symbolTT.deltaNbBits + (1<<15)) >> 16);
+ statePtr->value = (nbBitsOut << 16) - symbolTT.deltaNbBits;
+ statePtr->value = stateTable[(statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
+ }
+}
+
+MEM_STATIC void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, U32 symbol)
+{
+ FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
+ const U16* const stateTable = (const U16*)(statePtr->stateTable);
+ U32 const nbBitsOut = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16);
+ BIT_addBits(bitC, statePtr->value, nbBitsOut);
+ statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
+}
+
+MEM_STATIC void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePtr)
+{
+ BIT_addBits(bitC, statePtr->value, statePtr->stateLog);
+ BIT_flushBits(bitC);
+}
+
+
+/* ====== Decompression ====== */
+
+typedef struct {
+ U16 tableLog;
+ U16 fastMode;
+} FSE_DTableHeader; /* sizeof U32 */
+
+typedef struct
+{
+ unsigned short newState;
+ unsigned char symbol;
+ unsigned char nbBits;
+} FSE_decode_t; /* size == U32 */
+
+MEM_STATIC void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt)
+{
+ const void* ptr = dt;
+ const FSE_DTableHeader* const DTableH = (const FSE_DTableHeader*)ptr;
+ DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
+ BIT_reloadDStream(bitD);
+ DStatePtr->table = dt + 1;
+}
+
+MEM_STATIC BYTE FSE_peekSymbol(const FSE_DState_t* DStatePtr)
+{
+ FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
+ return DInfo.symbol;
+}
+
+MEM_STATIC void FSE_updateState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
+{
+ FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
+ U32 const nbBits = DInfo.nbBits;
+ size_t const lowBits = BIT_readBits(bitD, nbBits);
+ DStatePtr->state = DInfo.newState + lowBits;
+}
+
+MEM_STATIC BYTE FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
+{
+ FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
+ U32 const nbBits = DInfo.nbBits;
+ BYTE const symbol = DInfo.symbol;
+ size_t const lowBits = BIT_readBits(bitD, nbBits);
+
+ DStatePtr->state = DInfo.newState + lowBits;
+ return symbol;
+}
+
+/*! FSE_decodeSymbolFast() :
+ unsafe, only works if no symbol has a probability > 50% */
+MEM_STATIC BYTE FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
+{
+ FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
+ U32 const nbBits = DInfo.nbBits;
+ BYTE const symbol = DInfo.symbol;
+ size_t const lowBits = BIT_readBitsFast(bitD, nbBits);
+
+ DStatePtr->state = DInfo.newState + lowBits;
+ return symbol;
+}
+
+MEM_STATIC unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr)
+{
+ return DStatePtr->state == 0;
+}
+
+
+
+#ifndef FSE_COMMONDEFS_ONLY
+
+/* **************************************************************
+* Tuning parameters
+****************************************************************/
+/*!MEMORY_USAGE :
+* Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.)
+* Increasing memory usage improves compression ratio
+* Reduced memory usage can improve speed, due to cache effect
+* Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */
+#ifndef FSE_MAX_MEMORY_USAGE
+# define FSE_MAX_MEMORY_USAGE 14
+#endif
+#ifndef FSE_DEFAULT_MEMORY_USAGE
+# define FSE_DEFAULT_MEMORY_USAGE 13
+#endif
+
+/*!FSE_MAX_SYMBOL_VALUE :
+* Maximum symbol value authorized.
+* Required for proper stack allocation */
+#ifndef FSE_MAX_SYMBOL_VALUE
+# define FSE_MAX_SYMBOL_VALUE 255
+#endif
+
+/* **************************************************************
+* template functions type & suffix
+****************************************************************/
+#define FSE_FUNCTION_TYPE BYTE
+#define FSE_FUNCTION_EXTENSION
+#define FSE_DECODE_TYPE FSE_decode_t
+
+
+#endif /* !FSE_COMMONDEFS_ONLY */
+
+
+/* ***************************************************************
+* Constants
+*****************************************************************/
+#define FSE_MAX_TABLELOG (FSE_MAX_MEMORY_USAGE-2)
+#define FSE_MAX_TABLESIZE (1U<<FSE_MAX_TABLELOG)
+#define FSE_MAXTABLESIZE_MASK (FSE_MAX_TABLESIZE-1)
+#define FSE_DEFAULT_TABLELOG (FSE_DEFAULT_MEMORY_USAGE-2)
+#define FSE_MIN_TABLELOG 5
+
+#define FSE_TABLELOG_ABSOLUTE_MAX 15
+#if FSE_MAX_TABLELOG > FSE_TABLELOG_ABSOLUTE_MAX
+# error "FSE_MAX_TABLELOG > FSE_TABLELOG_ABSOLUTE_MAX is not supported"
+#endif
+
+#define FSE_TABLESTEP(tableSize) ((tableSize>>1) + (tableSize>>3) + 3)
+
+
+#endif /* FSE_STATIC_LINKING_ONLY */
+
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif /* FSE_H */
diff --git a/thirdparty/zstd/common/fse_decompress.c b/thirdparty/zstd/common/fse_decompress.c
new file mode 100644
index 0000000000..8474a4c079
--- /dev/null
+++ b/thirdparty/zstd/common/fse_decompress.c
@@ -0,0 +1,328 @@
+/* ******************************************************************
+ FSE : Finite State Entropy decoder
+ Copyright (C) 2013-2015, Yann Collet.
+
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ You can contact the author at :
+ - FSE source repository : https://github.com/Cyan4973/FiniteStateEntropy
+ - Public forum : https://groups.google.com/forum/#!forum/lz4c
+****************************************************************** */
+
+
+/* **************************************************************
+* Compiler specifics
+****************************************************************/
+#ifdef _MSC_VER /* Visual Studio */
+# define FORCE_INLINE static __forceinline
+# include <intrin.h> /* For Visual 2005 */
+# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
+# pragma warning(disable : 4214) /* disable: C4214: non-int bitfields */
+#else
+# if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
+# ifdef __GNUC__
+# define FORCE_INLINE static inline __attribute__((always_inline))
+# else
+# define FORCE_INLINE static inline
+# endif
+# else
+# define FORCE_INLINE static
+# endif /* __STDC_VERSION__ */
+#endif
+
+
+/* **************************************************************
+* Includes
+****************************************************************/
+#include <stdlib.h> /* malloc, free, qsort */
+#include <string.h> /* memcpy, memset */
+#include "bitstream.h"
+#define FSE_STATIC_LINKING_ONLY
+#include "fse.h"
+
+
+/* **************************************************************
+* Error Management
+****************************************************************/
+#define FSE_isError ERR_isError
+#define FSE_STATIC_ASSERT(c) { enum { FSE_static_assert = 1/(int)(!!(c)) }; } /* use only *after* variable declarations */
+
+/* check and forward error code */
+#define CHECK_F(f) { size_t const e = f; if (FSE_isError(e)) return e; }
+
+
+/* **************************************************************
+* Templates
+****************************************************************/
+/*
+ designed to be included
+ for type-specific functions (template emulation in C)
+ Objective is to write these functions only once, for improved maintenance
+*/
+
+/* safety checks */
+#ifndef FSE_FUNCTION_EXTENSION
+# error "FSE_FUNCTION_EXTENSION must be defined"
+#endif
+#ifndef FSE_FUNCTION_TYPE
+# error "FSE_FUNCTION_TYPE must be defined"
+#endif
+
+/* Function names */
+#define FSE_CAT(X,Y) X##Y
+#define FSE_FUNCTION_NAME(X,Y) FSE_CAT(X,Y)
+#define FSE_TYPE_NAME(X,Y) FSE_CAT(X,Y)
+
+
+/* Function templates */
+FSE_DTable* FSE_createDTable (unsigned tableLog)
+{
+ if (tableLog > FSE_TABLELOG_ABSOLUTE_MAX) tableLog = FSE_TABLELOG_ABSOLUTE_MAX;
+ return (FSE_DTable*)malloc( FSE_DTABLE_SIZE_U32(tableLog) * sizeof (U32) );
+}
+
+void FSE_freeDTable (FSE_DTable* dt)
+{
+ free(dt);
+}
+
+size_t FSE_buildDTable(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
+{
+ void* const tdPtr = dt+1; /* because *dt is unsigned, 32-bits aligned on 32-bits */
+ FSE_DECODE_TYPE* const tableDecode = (FSE_DECODE_TYPE*) (tdPtr);
+ U16 symbolNext[FSE_MAX_SYMBOL_VALUE+1];
+
+ U32 const maxSV1 = maxSymbolValue + 1;
+ U32 const tableSize = 1 << tableLog;
+ U32 highThreshold = tableSize-1;
+
+ /* Sanity Checks */
+ if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
+ if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
+
+ /* Init, lay down lowprob symbols */
+ { FSE_DTableHeader DTableH;
+ DTableH.tableLog = (U16)tableLog;
+ DTableH.fastMode = 1;
+ { S16 const largeLimit= (S16)(1 << (tableLog-1));
+ U32 s;
+ for (s=0; s<maxSV1; s++) {
+ if (normalizedCounter[s]==-1) {
+ tableDecode[highThreshold--].symbol = (FSE_FUNCTION_TYPE)s;
+ symbolNext[s] = 1;
+ } else {
+ if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
+ symbolNext[s] = normalizedCounter[s];
+ } } }
+ memcpy(dt, &DTableH, sizeof(DTableH));
+ }
+
+ /* Spread symbols */
+ { U32 const tableMask = tableSize-1;
+ U32 const step = FSE_TABLESTEP(tableSize);
+ U32 s, position = 0;
+ for (s=0; s<maxSV1; s++) {
+ int i;
+ for (i=0; i<normalizedCounter[s]; i++) {
+ tableDecode[position].symbol = (FSE_FUNCTION_TYPE)s;
+ position = (position + step) & tableMask;
+ while (position > highThreshold) position = (position + step) & tableMask; /* lowprob area */
+ } }
+ if (position!=0) return ERROR(GENERIC); /* position must reach all cells once, otherwise normalizedCounter is incorrect */
+ }
+
+ /* Build Decoding table */
+ { U32 u;
+ for (u=0; u<tableSize; u++) {
+ FSE_FUNCTION_TYPE const symbol = (FSE_FUNCTION_TYPE)(tableDecode[u].symbol);
+ U16 nextState = symbolNext[symbol]++;
+ tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32 ((U32)nextState) );
+ tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
+ } }
+
+ return 0;
+}
+
+
+#ifndef FSE_COMMONDEFS_ONLY
+
+/*-*******************************************************
+* Decompression (Byte symbols)
+*********************************************************/
+size_t FSE_buildDTable_rle (FSE_DTable* dt, BYTE symbolValue)
+{
+ void* ptr = dt;
+ FSE_DTableHeader* const DTableH = (FSE_DTableHeader*)ptr;
+ void* dPtr = dt + 1;
+ FSE_decode_t* const cell = (FSE_decode_t*)dPtr;
+
+ DTableH->tableLog = 0;
+ DTableH->fastMode = 0;
+
+ cell->newState = 0;
+ cell->symbol = symbolValue;
+ cell->nbBits = 0;
+
+ return 0;
+}
+
+
+size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits)
+{
+ void* ptr = dt;
+ FSE_DTableHeader* const DTableH = (FSE_DTableHeader*)ptr;
+ void* dPtr = dt + 1;
+ FSE_decode_t* const dinfo = (FSE_decode_t*)dPtr;
+ const unsigned tableSize = 1 << nbBits;
+ const unsigned tableMask = tableSize - 1;
+ const unsigned maxSV1 = tableMask+1;
+ unsigned s;
+
+ /* Sanity checks */
+ if (nbBits < 1) return ERROR(GENERIC); /* min size */
+
+ /* Build Decoding Table */
+ DTableH->tableLog = (U16)nbBits;
+ DTableH->fastMode = 1;
+ for (s=0; s<maxSV1; s++) {
+ dinfo[s].newState = 0;
+ dinfo[s].symbol = (BYTE)s;
+ dinfo[s].nbBits = (BYTE)nbBits;
+ }
+
+ return 0;
+}
+
+FORCE_INLINE size_t FSE_decompress_usingDTable_generic(
+ void* dst, size_t maxDstSize,
+ const void* cSrc, size_t cSrcSize,
+ const FSE_DTable* dt, const unsigned fast)
+{
+ BYTE* const ostart = (BYTE*) dst;
+ BYTE* op = ostart;
+ BYTE* const omax = op + maxDstSize;
+ BYTE* const olimit = omax-3;
+
+ BIT_DStream_t bitD;
+ FSE_DState_t state1;
+ FSE_DState_t state2;
+
+ /* Init */
+ CHECK_F(BIT_initDStream(&bitD, cSrc, cSrcSize));
+
+ FSE_initDState(&state1, &bitD, dt);
+ FSE_initDState(&state2, &bitD, dt);
+
+#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
+
+ /* 4 symbols per loop */
+ for ( ; (BIT_reloadDStream(&bitD)==BIT_DStream_unfinished) & (op<olimit) ; op+=4) {
+ op[0] = FSE_GETSYMBOL(&state1);
+
+ if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8) /* This test must be static */
+ BIT_reloadDStream(&bitD);
+
+ op[1] = FSE_GETSYMBOL(&state2);
+
+ if (FSE_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8) /* This test must be static */
+ { if (BIT_reloadDStream(&bitD) > BIT_DStream_unfinished) { op+=2; break; } }
+
+ op[2] = FSE_GETSYMBOL(&state1);
+
+ if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8) /* This test must be static */
+ BIT_reloadDStream(&bitD);
+
+ op[3] = FSE_GETSYMBOL(&state2);
+ }
+
+ /* tail */
+ /* note : BIT_reloadDStream(&bitD) >= FSE_DStream_partiallyFilled; Ends at exactly BIT_DStream_completed */
+ while (1) {
+ if (op>(omax-2)) return ERROR(dstSize_tooSmall);
+ *op++ = FSE_GETSYMBOL(&state1);
+ if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {
+ *op++ = FSE_GETSYMBOL(&state2);
+ break;
+ }
+
+ if (op>(omax-2)) return ERROR(dstSize_tooSmall);
+ *op++ = FSE_GETSYMBOL(&state2);
+ if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {
+ *op++ = FSE_GETSYMBOL(&state1);
+ break;
+ } }
+
+ return op-ostart;
+}
+
+
+size_t FSE_decompress_usingDTable(void* dst, size_t originalSize,
+ const void* cSrc, size_t cSrcSize,
+ const FSE_DTable* dt)
+{
+ const void* ptr = dt;
+ const FSE_DTableHeader* DTableH = (const FSE_DTableHeader*)ptr;
+ const U32 fastMode = DTableH->fastMode;
+
+ /* select fast mode (static) */
+ if (fastMode) return FSE_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);
+ return FSE_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
+}
+
+
+size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, FSE_DTable* workSpace, unsigned maxLog)
+{
+ const BYTE* const istart = (const BYTE*)cSrc;
+ const BYTE* ip = istart;
+ short counting[FSE_MAX_SYMBOL_VALUE+1];
+ unsigned tableLog;
+ unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE;
+
+ /* normal FSE decoding mode */
+ size_t const NCountLength = FSE_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
+ if (FSE_isError(NCountLength)) return NCountLength;
+ //if (NCountLength >= cSrcSize) return ERROR(srcSize_wrong); /* too small input size; supposed to be already checked in NCountLength, only remaining case : NCountLength==cSrcSize */
+ if (tableLog > maxLog) return ERROR(tableLog_tooLarge);
+ ip += NCountLength;
+ cSrcSize -= NCountLength;
+
+ CHECK_F( FSE_buildDTable (workSpace, counting, maxSymbolValue, tableLog) );
+
+ return FSE_decompress_usingDTable (dst, dstCapacity, ip, cSrcSize, workSpace); /* always return, even if it is an error code */
+}
+
+
+typedef FSE_DTable DTable_max_t[FSE_DTABLE_SIZE_U32(FSE_MAX_TABLELOG)];
+
+size_t FSE_decompress(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize)
+{
+ DTable_max_t dt; /* Static analyzer seems unable to understand this table will be properly initialized later */
+ return FSE_decompress_wksp(dst, dstCapacity, cSrc, cSrcSize, dt, FSE_MAX_TABLELOG);
+}
+
+
+
+#endif /* FSE_COMMONDEFS_ONLY */
diff --git a/thirdparty/zstd/common/huf.h b/thirdparty/zstd/common/huf.h
new file mode 100644
index 0000000000..dabd359915
--- /dev/null
+++ b/thirdparty/zstd/common/huf.h
@@ -0,0 +1,303 @@
+/* ******************************************************************
+ Huffman coder, part of New Generation Entropy library
+ header file
+ Copyright (C) 2013-2016, Yann Collet.
+
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ You can contact the author at :
+ - Source repository : https://github.com/Cyan4973/FiniteStateEntropy
+****************************************************************** */
+#ifndef HUF_H_298734234
+#define HUF_H_298734234
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+
+/* *** Dependencies *** */
+#include <stddef.h> /* size_t */
+
+
+/* *** library symbols visibility *** */
+/* Note : when linking with -fvisibility=hidden on gcc, or by default on Visual,
+ * HUF symbols remain "private" (internal symbols for library only).
+ * Set macro FSE_DLL_EXPORT to 1 if you want HUF symbols visible on DLL interface */
+#if defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) && defined(__GNUC__) && (__GNUC__ >= 4)
+# define HUF_PUBLIC_API __attribute__ ((visibility ("default")))
+#elif defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) /* Visual expected */
+# define HUF_PUBLIC_API __declspec(dllexport)
+#elif defined(FSE_DLL_IMPORT) && (FSE_DLL_IMPORT==1)
+# define HUF_PUBLIC_API __declspec(dllimport) /* not required, just to generate faster code (saves a function pointer load from IAT and an indirect jump) */
+#else
+# define HUF_PUBLIC_API
+#endif
+
+
+/* *** simple functions *** */
+/**
+HUF_compress() :
+ Compress content from buffer 'src', of size 'srcSize', into buffer 'dst'.
+ 'dst' buffer must be already allocated.
+ Compression runs faster if `dstCapacity` >= HUF_compressBound(srcSize).
+ `srcSize` must be <= `HUF_BLOCKSIZE_MAX` == 128 KB.
+ @return : size of compressed data (<= `dstCapacity`).
+ Special values : if return == 0, srcData is not compressible => Nothing is stored within dst !!!
+ if return == 1, srcData is a single repeated byte symbol (RLE compression).
+ if HUF_isError(return), compression failed (more details using HUF_getErrorName())
+*/
+HUF_PUBLIC_API size_t HUF_compress(void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize);
+
+/**
+HUF_decompress() :
+ Decompress HUF data from buffer 'cSrc', of size 'cSrcSize',
+ into already allocated buffer 'dst', of minimum size 'dstSize'.
+ `originalSize` : **must** be the ***exact*** size of original (uncompressed) data.
+ Note : in contrast with FSE, HUF_decompress can regenerate
+ RLE (cSrcSize==1) and uncompressed (cSrcSize==dstSize) data,
+ because it knows size to regenerate.
+ @return : size of regenerated data (== originalSize),
+ or an error code, which can be tested using HUF_isError()
+*/
+HUF_PUBLIC_API size_t HUF_decompress(void* dst, size_t originalSize,
+ const void* cSrc, size_t cSrcSize);
+
+
+/* *** Tool functions *** */
+#define HUF_BLOCKSIZE_MAX (128 * 1024) /**< maximum input size for a single block compressed with HUF_compress */
+HUF_PUBLIC_API size_t HUF_compressBound(size_t size); /**< maximum compressed size (worst case) */
+
+/* Error Management */
+HUF_PUBLIC_API unsigned HUF_isError(size_t code); /**< tells if a return value is an error code */
+HUF_PUBLIC_API const char* HUF_getErrorName(size_t code); /**< provides error code string (useful for debugging) */
+
+
+/* *** Advanced function *** */
+
+/** HUF_compress2() :
+ * Same as HUF_compress(), but offers direct control over `maxSymbolValue` and `tableLog`.
+ * `tableLog` must be `<= HUF_TABLELOG_MAX` . */
+HUF_PUBLIC_API size_t HUF_compress2 (void* dst, size_t dstCapacity, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
+
+/** HUF_compress4X_wksp() :
+ * Same as HUF_compress2(), but uses externally allocated `workSpace`.
+ * `workspace` must have minimum alignment of 4, and be at least as large as following macro */
+#define HUF_WORKSPACE_SIZE (6 << 10)
+#define HUF_WORKSPACE_SIZE_U32 (HUF_WORKSPACE_SIZE / sizeof(U32))
+HUF_PUBLIC_API size_t HUF_compress4X_wksp (void* dst, size_t dstCapacity, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);
+
+/**
+ * The minimum workspace size for the `workSpace` used in
+ * HUF_readDTableX2_wksp() and HUF_readDTableX4_wksp().
+ *
+ * The space used depends on HUF_TABLELOG_MAX, ranging from ~1500 bytes when
+ * HUF_TABLE_LOG_MAX=12 to ~1850 bytes when HUF_TABLE_LOG_MAX=15.
+ * Buffer overflow errors may potentially occur if code modifications result in
+ * a required workspace size greater than that specified in the following
+ * macro.
+ */
+#define HUF_DECOMPRESS_WORKSPACE_SIZE (2 << 10)
+#define HUF_DECOMPRESS_WORKSPACE_SIZE_U32 (HUF_DECOMPRESS_WORKSPACE_SIZE / sizeof(U32))
+
+
+/* ******************************************************************
+ * WARNING !!
+ * The following section contains advanced and experimental definitions
+ * which shall never be used in the context of dll
+ * because they are not guaranteed to remain stable in the future.
+ * Only consider them in association with static linking.
+ *******************************************************************/
+#ifdef HUF_STATIC_LINKING_ONLY
+
+/* *** Dependencies *** */
+#include "mem.h" /* U32 */
+
+
+/* *** Constants *** */
+#define HUF_TABLELOG_MAX 12 /* max configured tableLog (for static allocation); can be modified up to HUF_ABSOLUTEMAX_TABLELOG */
+#define HUF_TABLELOG_DEFAULT 11 /* tableLog by default, when not specified */
+#define HUF_SYMBOLVALUE_MAX 255
+
+#define HUF_TABLELOG_ABSOLUTEMAX 15 /* absolute limit of HUF_MAX_TABLELOG. Beyond that value, code does not work */
+#if (HUF_TABLELOG_MAX > HUF_TABLELOG_ABSOLUTEMAX)
+# error "HUF_TABLELOG_MAX is too large !"
+#endif
+
+
+/* ****************************************
+* Static allocation
+******************************************/
+/* HUF buffer bounds */
+#define HUF_CTABLEBOUND 129
+#define HUF_BLOCKBOUND(size) (size + (size>>8) + 8) /* only true when incompressible is pre-filtered with fast heuristic */
+#define HUF_COMPRESSBOUND(size) (HUF_CTABLEBOUND + HUF_BLOCKBOUND(size)) /* Macro version, useful for static allocation */
+
+/* static allocation of HUF's Compression Table */
+#define HUF_CTABLE_SIZE_U32(maxSymbolValue) ((maxSymbolValue)+1) /* Use tables of U32, for proper alignment */
+#define HUF_CTABLE_SIZE(maxSymbolValue) (HUF_CTABLE_SIZE_U32(maxSymbolValue) * sizeof(U32))
+#define HUF_CREATE_STATIC_CTABLE(name, maxSymbolValue) \
+ U32 name##hb[HUF_CTABLE_SIZE_U32(maxSymbolValue)]; \
+ void* name##hv = &(name##hb); \
+ HUF_CElt* name = (HUF_CElt*)(name##hv) /* no final ; */
+
+/* static allocation of HUF's DTable */
+typedef U32 HUF_DTable;
+#define HUF_DTABLE_SIZE(maxTableLog) (1 + (1<<(maxTableLog)))
+#define HUF_CREATE_STATIC_DTABLEX2(DTable, maxTableLog) \
+ HUF_DTable DTable[HUF_DTABLE_SIZE((maxTableLog)-1)] = { ((U32)((maxTableLog)-1) * 0x01000001) }
+#define HUF_CREATE_STATIC_DTABLEX4(DTable, maxTableLog) \
+ HUF_DTable DTable[HUF_DTABLE_SIZE(maxTableLog)] = { ((U32)(maxTableLog) * 0x01000001) }
+
+
+/* ****************************************
+* Advanced decompression functions
+******************************************/
+size_t HUF_decompress4X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */
+size_t HUF_decompress4X4 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< double-symbols decoder */
+
+size_t HUF_decompress4X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< decodes RLE and uncompressed */
+size_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< considers RLE and uncompressed as errors */
+size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< considers RLE and uncompressed as errors */
+size_t HUF_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */
+size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< single-symbol decoder */
+size_t HUF_decompress4X4_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< double-symbols decoder */
+size_t HUF_decompress4X4_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< double-symbols decoder */
+
+
+/* ****************************************
+* HUF detailed API
+******************************************/
+/*!
+HUF_compress() does the following:
+1. count symbol occurrence from source[] into table count[] using FSE_count()
+2. (optional) refine tableLog using HUF_optimalTableLog()
+3. build Huffman table from count using HUF_buildCTable()
+4. save Huffman table to memory buffer using HUF_writeCTable()
+5. encode the data stream using HUF_compress4X_usingCTable()
+
+The following API allows targeting specific sub-functions for advanced tasks.
+For example, it's possible to compress several blocks using the same 'CTable',
+or to save and regenerate 'CTable' using external methods.
+*/
+/* FSE_count() : find it within "fse.h" */
+unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);
+typedef struct HUF_CElt_s HUF_CElt; /* incomplete type */
+size_t HUF_buildCTable (HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits);
+size_t HUF_writeCTable (void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog);
+size_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);
+
+typedef enum {
+ HUF_repeat_none, /**< Cannot use the previous table */
+ HUF_repeat_check, /**< Can use the previous table but it must be checked. Note : The previous table must have been constructed by HUF_compress{1, 4}X_repeat */
+ HUF_repeat_valid /**< Can use the previous table and it is asumed to be valid */
+ } HUF_repeat;
+/** HUF_compress4X_repeat() :
+* Same as HUF_compress4X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none.
+* If it uses hufTable it does not modify hufTable or repeat.
+* If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used.
+* If preferRepeat then the old table will always be used if valid. */
+size_t HUF_compress4X_repeat(void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize, HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat); /**< `workSpace` must be a table of at least HUF_WORKSPACE_SIZE_U32 unsigned */
+
+/** HUF_buildCTable_wksp() :
+ * Same as HUF_buildCTable(), but using externally allocated scratch buffer.
+ * `workSpace` must be aligned on 4-bytes boundaries, and be at least as large as a table of 1024 unsigned.
+ */
+size_t HUF_buildCTable_wksp (HUF_CElt* tree, const U32* count, U32 maxSymbolValue, U32 maxNbBits, void* workSpace, size_t wkspSize);
+
+/*! HUF_readStats() :
+ Read compact Huffman tree, saved by HUF_writeCTable().
+ `huffWeight` is destination buffer.
+ @return : size read from `src` , or an error Code .
+ Note : Needed by HUF_readCTable() and HUF_readDTableXn() . */
+size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, U32* rankStats,
+ U32* nbSymbolsPtr, U32* tableLogPtr,
+ const void* src, size_t srcSize);
+
+/** HUF_readCTable() :
+* Loading a CTable saved with HUF_writeCTable() */
+size_t HUF_readCTable (HUF_CElt* CTable, unsigned maxSymbolValue, const void* src, size_t srcSize);
+
+
+/*
+HUF_decompress() does the following:
+1. select the decompression algorithm (X2, X4) based on pre-computed heuristics
+2. build Huffman table from save, using HUF_readDTableXn()
+3. decode 1 or 4 segments in parallel using HUF_decompressSXn_usingDTable
+*/
+
+/** HUF_selectDecoder() :
+* Tells which decoder is likely to decode faster,
+* based on a set of pre-determined metrics.
+* @return : 0==HUF_decompress4X2, 1==HUF_decompress4X4 .
+* Assumption : 0 < cSrcSize < dstSize <= 128 KB */
+U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize);
+
+size_t HUF_readDTableX2 (HUF_DTable* DTable, const void* src, size_t srcSize);
+size_t HUF_readDTableX2_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);
+size_t HUF_readDTableX4 (HUF_DTable* DTable, const void* src, size_t srcSize);
+size_t HUF_readDTableX4_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);
+
+size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
+size_t HUF_decompress4X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
+size_t HUF_decompress4X4_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
+
+
+/* single stream variants */
+
+size_t HUF_compress1X (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
+size_t HUF_compress1X_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); /**< `workSpace` must be a table of at least HUF_WORKSPACE_SIZE_U32 unsigned */
+size_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);
+/** HUF_compress1X_repeat() :
+* Same as HUF_compress1X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none.
+* If it uses hufTable it does not modify hufTable or repeat.
+* If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used.
+* If preferRepeat then the old table will always be used if valid. */
+size_t HUF_compress1X_repeat(void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize, HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat); /**< `workSpace` must be a table of at least HUF_WORKSPACE_SIZE_U32 unsigned */
+
+size_t HUF_decompress1X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* single-symbol decoder */
+size_t HUF_decompress1X4 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* double-symbol decoder */
+
+size_t HUF_decompress1X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
+size_t HUF_decompress1X_DCtx_wksp (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
+size_t HUF_decompress1X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */
+size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< single-symbol decoder */
+size_t HUF_decompress1X4_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< double-symbols decoder */
+size_t HUF_decompress1X4_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< double-symbols decoder */
+
+size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); /**< automatic selection of sing or double symbol decoder, based on DTable */
+size_t HUF_decompress1X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
+size_t HUF_decompress1X4_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
+
+#endif /* HUF_STATIC_LINKING_ONLY */
+
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif /* HUF_H_298734234 */
diff --git a/thirdparty/zstd/common/mem.h b/thirdparty/zstd/common/mem.h
new file mode 100644
index 0000000000..b0e5bf60b4
--- /dev/null
+++ b/thirdparty/zstd/common/mem.h
@@ -0,0 +1,359 @@
+/**
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+#ifndef MEM_H_MODULE
+#define MEM_H_MODULE
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+/*-****************************************
+* Dependencies
+******************************************/
+#include <stddef.h> /* size_t, ptrdiff_t */
+#include <string.h> /* memcpy */
+
+
+/*-****************************************
+* Compiler specifics
+******************************************/
+#if defined(_MSC_VER) /* Visual Studio */
+# include <stdlib.h> /* _byteswap_ulong */
+# include <intrin.h> /* _byteswap_* */
+#endif
+#if defined(__GNUC__)
+# define MEM_STATIC static __inline __attribute__((unused))
+#elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)
+# define MEM_STATIC static inline
+#elif defined(_MSC_VER)
+# define MEM_STATIC static __inline
+#else
+# define MEM_STATIC static /* this version may generate warnings for unused static functions; disable the relevant warning */
+#endif
+
+/* code only tested on 32 and 64 bits systems */
+#define MEM_STATIC_ASSERT(c) { enum { MEM_static_assert = 1/(int)(!!(c)) }; }
+MEM_STATIC void MEM_check(void) { MEM_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); }
+
+
+/*-**************************************************************
+* Basic Types
+*****************************************************************/
+#if !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )
+# include <stdint.h>
+ typedef uint8_t BYTE;
+ typedef uint16_t U16;
+ typedef int16_t S16;
+ typedef uint32_t U32;
+ typedef int32_t S32;
+ typedef uint64_t U64;
+ typedef int64_t S64;
+ typedef intptr_t iPtrDiff;
+ typedef uintptr_t uPtrDiff;
+#else
+ typedef unsigned char BYTE;
+ typedef unsigned short U16;
+ typedef signed short S16;
+ typedef unsigned int U32;
+ typedef signed int S32;
+ typedef unsigned long long U64;
+ typedef signed long long S64;
+ typedef ptrdiff_t iPtrDiff;
+ typedef size_t uPtrDiff;
+#endif
+
+
+/*-**************************************************************
+* Memory I/O
+*****************************************************************/
+/* MEM_FORCE_MEMORY_ACCESS :
+ * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable.
+ * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal.
+ * The below switch allow to select different access method for improved performance.
+ * Method 0 (default) : use `memcpy()`. Safe and portable.
+ * Method 1 : `__packed` statement. It depends on compiler extension (i.e., not portable).
+ * This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`.
+ * Method 2 : direct access. This method is portable but violate C standard.
+ * It can generate buggy code on targets depending on alignment.
+ * In some circumstances, it's the only known way to get the most performance (i.e. GCC + ARMv6)
+ * See http://fastcompression.blogspot.fr/2015/08/accessing-unaligned-memory.html for details.
+ * Prefer these methods in priority order (0 > 1 > 2)
+ */
+#ifndef MEM_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */
+# if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) )
+# define MEM_FORCE_MEMORY_ACCESS 2
+# elif defined(__INTEL_COMPILER) || defined(__GNUC__)
+# define MEM_FORCE_MEMORY_ACCESS 1
+# endif
+#endif
+
+MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
+MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
+
+MEM_STATIC unsigned MEM_isLittleEndian(void)
+{
+ const union { U32 u; BYTE c[4]; } one = { 1 }; /* don't use static : performance detrimental */
+ return one.c[0];
+}
+
+#if defined(MEM_FORCE_MEMORY_ACCESS) && (MEM_FORCE_MEMORY_ACCESS==2)
+
+/* violates C standard, by lying on structure alignment.
+Only use if no other choice to achieve best performance on target platform */
+MEM_STATIC U16 MEM_read16(const void* memPtr) { return *(const U16*) memPtr; }
+MEM_STATIC U32 MEM_read32(const void* memPtr) { return *(const U32*) memPtr; }
+MEM_STATIC U64 MEM_read64(const void* memPtr) { return *(const U64*) memPtr; }
+MEM_STATIC U64 MEM_readST(const void* memPtr) { return *(const size_t*) memPtr; }
+
+MEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(U16*)memPtr = value; }
+MEM_STATIC void MEM_write32(void* memPtr, U32 value) { *(U32*)memPtr = value; }
+MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(U64*)memPtr = value; }
+
+#elif defined(MEM_FORCE_MEMORY_ACCESS) && (MEM_FORCE_MEMORY_ACCESS==1)
+
+/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */
+/* currently only defined for gcc and icc */
+#if defined(_MSC_VER) || (defined(__INTEL_COMPILER) && defined(WIN32))
+ __pragma( pack(push, 1) )
+ typedef union { U16 u16; U32 u32; U64 u64; size_t st; } unalign;
+ __pragma( pack(pop) )
+#else
+ typedef union { U16 u16; U32 u32; U64 u64; size_t st; } __attribute__((packed)) unalign;
+#endif
+
+MEM_STATIC U16 MEM_read16(const void* ptr) { return ((const unalign*)ptr)->u16; }
+MEM_STATIC U32 MEM_read32(const void* ptr) { return ((const unalign*)ptr)->u32; }
+MEM_STATIC U64 MEM_read64(const void* ptr) { return ((const unalign*)ptr)->u64; }
+MEM_STATIC U64 MEM_readST(const void* ptr) { return ((const unalign*)ptr)->st; }
+
+MEM_STATIC void MEM_write16(void* memPtr, U16 value) { ((unalign*)memPtr)->u16 = value; }
+MEM_STATIC void MEM_write32(void* memPtr, U32 value) { ((unalign*)memPtr)->u32 = value; }
+MEM_STATIC void MEM_write64(void* memPtr, U64 value) { ((unalign*)memPtr)->u64 = value; }
+
+#else
+
+/* default method, safe and standard.
+ can sometimes prove slower */
+
+MEM_STATIC U16 MEM_read16(const void* memPtr)
+{
+ U16 val; memcpy(&val, memPtr, sizeof(val)); return val;
+}
+
+MEM_STATIC U32 MEM_read32(const void* memPtr)
+{
+ U32 val; memcpy(&val, memPtr, sizeof(val)); return val;
+}
+
+MEM_STATIC U64 MEM_read64(const void* memPtr)
+{
+ U64 val; memcpy(&val, memPtr, sizeof(val)); return val;
+}
+
+MEM_STATIC size_t MEM_readST(const void* memPtr)
+{
+ size_t val; memcpy(&val, memPtr, sizeof(val)); return val;
+}
+
+MEM_STATIC void MEM_write16(void* memPtr, U16 value)
+{
+ memcpy(memPtr, &value, sizeof(value));
+}
+
+MEM_STATIC void MEM_write32(void* memPtr, U32 value)
+{
+ memcpy(memPtr, &value, sizeof(value));
+}
+
+MEM_STATIC void MEM_write64(void* memPtr, U64 value)
+{
+ memcpy(memPtr, &value, sizeof(value));
+}
+
+#endif /* MEM_FORCE_MEMORY_ACCESS */
+
+MEM_STATIC U32 MEM_swap32(U32 in)
+{
+#if defined(_MSC_VER) /* Visual Studio */
+ return _byteswap_ulong(in);
+#elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)
+ return __builtin_bswap32(in);
+#else
+ return ((in << 24) & 0xff000000 ) |
+ ((in << 8) & 0x00ff0000 ) |
+ ((in >> 8) & 0x0000ff00 ) |
+ ((in >> 24) & 0x000000ff );
+#endif
+}
+
+MEM_STATIC U64 MEM_swap64(U64 in)
+{
+#if defined(_MSC_VER) /* Visual Studio */
+ return _byteswap_uint64(in);
+#elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)
+ return __builtin_bswap64(in);
+#else
+ return ((in << 56) & 0xff00000000000000ULL) |
+ ((in << 40) & 0x00ff000000000000ULL) |
+ ((in << 24) & 0x0000ff0000000000ULL) |
+ ((in << 8) & 0x000000ff00000000ULL) |
+ ((in >> 8) & 0x00000000ff000000ULL) |
+ ((in >> 24) & 0x0000000000ff0000ULL) |
+ ((in >> 40) & 0x000000000000ff00ULL) |
+ ((in >> 56) & 0x00000000000000ffULL);
+#endif
+}
+
+MEM_STATIC size_t MEM_swapST(size_t in)
+{
+ if (MEM_32bits())
+ return (size_t)MEM_swap32((U32)in);
+ else
+ return (size_t)MEM_swap64((U64)in);
+}
+
+/*=== Little endian r/w ===*/
+
+MEM_STATIC U16 MEM_readLE16(const void* memPtr)
+{
+ if (MEM_isLittleEndian())
+ return MEM_read16(memPtr);
+ else {
+ const BYTE* p = (const BYTE*)memPtr;
+ return (U16)(p[0] + (p[1]<<8));
+ }
+}
+
+MEM_STATIC void MEM_writeLE16(void* memPtr, U16 val)
+{
+ if (MEM_isLittleEndian()) {
+ MEM_write16(memPtr, val);
+ } else {
+ BYTE* p = (BYTE*)memPtr;
+ p[0] = (BYTE)val;
+ p[1] = (BYTE)(val>>8);
+ }
+}
+
+MEM_STATIC U32 MEM_readLE24(const void* memPtr)
+{
+ return MEM_readLE16(memPtr) + (((const BYTE*)memPtr)[2] << 16);
+}
+
+MEM_STATIC void MEM_writeLE24(void* memPtr, U32 val)
+{
+ MEM_writeLE16(memPtr, (U16)val);
+ ((BYTE*)memPtr)[2] = (BYTE)(val>>16);
+}
+
+MEM_STATIC U32 MEM_readLE32(const void* memPtr)
+{
+ if (MEM_isLittleEndian())
+ return MEM_read32(memPtr);
+ else
+ return MEM_swap32(MEM_read32(memPtr));
+}
+
+MEM_STATIC void MEM_writeLE32(void* memPtr, U32 val32)
+{
+ if (MEM_isLittleEndian())
+ MEM_write32(memPtr, val32);
+ else
+ MEM_write32(memPtr, MEM_swap32(val32));
+}
+
+MEM_STATIC U64 MEM_readLE64(const void* memPtr)
+{
+ if (MEM_isLittleEndian())
+ return MEM_read64(memPtr);
+ else
+ return MEM_swap64(MEM_read64(memPtr));
+}
+
+MEM_STATIC void MEM_writeLE64(void* memPtr, U64 val64)
+{
+ if (MEM_isLittleEndian())
+ MEM_write64(memPtr, val64);
+ else
+ MEM_write64(memPtr, MEM_swap64(val64));
+}
+
+MEM_STATIC size_t MEM_readLEST(const void* memPtr)
+{
+ if (MEM_32bits())
+ return (size_t)MEM_readLE32(memPtr);
+ else
+ return (size_t)MEM_readLE64(memPtr);
+}
+
+MEM_STATIC void MEM_writeLEST(void* memPtr, size_t val)
+{
+ if (MEM_32bits())
+ MEM_writeLE32(memPtr, (U32)val);
+ else
+ MEM_writeLE64(memPtr, (U64)val);
+}
+
+/*=== Big endian r/w ===*/
+
+MEM_STATIC U32 MEM_readBE32(const void* memPtr)
+{
+ if (MEM_isLittleEndian())
+ return MEM_swap32(MEM_read32(memPtr));
+ else
+ return MEM_read32(memPtr);
+}
+
+MEM_STATIC void MEM_writeBE32(void* memPtr, U32 val32)
+{
+ if (MEM_isLittleEndian())
+ MEM_write32(memPtr, MEM_swap32(val32));
+ else
+ MEM_write32(memPtr, val32);
+}
+
+MEM_STATIC U64 MEM_readBE64(const void* memPtr)
+{
+ if (MEM_isLittleEndian())
+ return MEM_swap64(MEM_read64(memPtr));
+ else
+ return MEM_read64(memPtr);
+}
+
+MEM_STATIC void MEM_writeBE64(void* memPtr, U64 val64)
+{
+ if (MEM_isLittleEndian())
+ MEM_write64(memPtr, MEM_swap64(val64));
+ else
+ MEM_write64(memPtr, val64);
+}
+
+MEM_STATIC size_t MEM_readBEST(const void* memPtr)
+{
+ if (MEM_32bits())
+ return (size_t)MEM_readBE32(memPtr);
+ else
+ return (size_t)MEM_readBE64(memPtr);
+}
+
+MEM_STATIC void MEM_writeBEST(void* memPtr, size_t val)
+{
+ if (MEM_32bits())
+ MEM_writeBE32(memPtr, (U32)val);
+ else
+ MEM_writeBE64(memPtr, (U64)val);
+}
+
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif /* MEM_H_MODULE */
diff --git a/thirdparty/zstd/common/pool.c b/thirdparty/zstd/common/pool.c
new file mode 100644
index 0000000000..749fa4f2f7
--- /dev/null
+++ b/thirdparty/zstd/common/pool.c
@@ -0,0 +1,206 @@
+/**
+ * Copyright (c) 2016-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+
+/* ====== Dependencies ======= */
+#include <stddef.h> /* size_t */
+#include <stdlib.h> /* malloc, calloc, free */
+#include "pool.h"
+
+/* ====== Compiler specifics ====== */
+#if defined(_MSC_VER)
+# pragma warning(disable : 4204) /* disable: C4204: non-constant aggregate initializer */
+#endif
+
+
+#ifdef ZSTD_MULTITHREAD
+
+#include "threading.h" /* pthread adaptation */
+
+/* A job is a function and an opaque argument */
+typedef struct POOL_job_s {
+ POOL_function function;
+ void *opaque;
+} POOL_job;
+
+struct POOL_ctx_s {
+ /* Keep track of the threads */
+ pthread_t *threads;
+ size_t numThreads;
+
+ /* The queue is a circular buffer */
+ POOL_job *queue;
+ size_t queueHead;
+ size_t queueTail;
+ size_t queueSize;
+ /* The mutex protects the queue */
+ pthread_mutex_t queueMutex;
+ /* Condition variable for pushers to wait on when the queue is full */
+ pthread_cond_t queuePushCond;
+ /* Condition variables for poppers to wait on when the queue is empty */
+ pthread_cond_t queuePopCond;
+ /* Indicates if the queue is shutting down */
+ int shutdown;
+};
+
+/* POOL_thread() :
+ Work thread for the thread pool.
+ Waits for jobs and executes them.
+ @returns : NULL on failure else non-null.
+*/
+static void* POOL_thread(void* opaque) {
+ POOL_ctx* const ctx = (POOL_ctx*)opaque;
+ if (!ctx) { return NULL; }
+ for (;;) {
+ /* Lock the mutex and wait for a non-empty queue or until shutdown */
+ pthread_mutex_lock(&ctx->queueMutex);
+ while (ctx->queueHead == ctx->queueTail && !ctx->shutdown) {
+ pthread_cond_wait(&ctx->queuePopCond, &ctx->queueMutex);
+ }
+ /* empty => shutting down: so stop */
+ if (ctx->queueHead == ctx->queueTail) {
+ pthread_mutex_unlock(&ctx->queueMutex);
+ return opaque;
+ }
+ /* Pop a job off the queue */
+ { POOL_job const job = ctx->queue[ctx->queueHead];
+ ctx->queueHead = (ctx->queueHead + 1) % ctx->queueSize;
+ /* Unlock the mutex, signal a pusher, and run the job */
+ pthread_mutex_unlock(&ctx->queueMutex);
+ pthread_cond_signal(&ctx->queuePushCond);
+ job.function(job.opaque);
+ }
+ }
+ /* Unreachable */
+}
+
+POOL_ctx *POOL_create(size_t numThreads, size_t queueSize) {
+ POOL_ctx *ctx;
+ /* Check the parameters */
+ if (!numThreads || !queueSize) { return NULL; }
+ /* Allocate the context and zero initialize */
+ ctx = (POOL_ctx *)calloc(1, sizeof(POOL_ctx));
+ if (!ctx) { return NULL; }
+ /* Initialize the job queue.
+ * It needs one extra space since one space is wasted to differentiate empty
+ * and full queues.
+ */
+ ctx->queueSize = queueSize + 1;
+ ctx->queue = (POOL_job *)malloc(ctx->queueSize * sizeof(POOL_job));
+ ctx->queueHead = 0;
+ ctx->queueTail = 0;
+ pthread_mutex_init(&ctx->queueMutex, NULL);
+ pthread_cond_init(&ctx->queuePushCond, NULL);
+ pthread_cond_init(&ctx->queuePopCond, NULL);
+ ctx->shutdown = 0;
+ /* Allocate space for the thread handles */
+ ctx->threads = (pthread_t *)malloc(numThreads * sizeof(pthread_t));
+ ctx->numThreads = 0;
+ /* Check for errors */
+ if (!ctx->threads || !ctx->queue) { POOL_free(ctx); return NULL; }
+ /* Initialize the threads */
+ { size_t i;
+ for (i = 0; i < numThreads; ++i) {
+ if (pthread_create(&ctx->threads[i], NULL, &POOL_thread, ctx)) {
+ ctx->numThreads = i;
+ POOL_free(ctx);
+ return NULL;
+ } }
+ ctx->numThreads = numThreads;
+ }
+ return ctx;
+}
+
+/*! POOL_join() :
+ Shutdown the queue, wake any sleeping threads, and join all of the threads.
+*/
+static void POOL_join(POOL_ctx *ctx) {
+ /* Shut down the queue */
+ pthread_mutex_lock(&ctx->queueMutex);
+ ctx->shutdown = 1;
+ pthread_mutex_unlock(&ctx->queueMutex);
+ /* Wake up sleeping threads */
+ pthread_cond_broadcast(&ctx->queuePushCond);
+ pthread_cond_broadcast(&ctx->queuePopCond);
+ /* Join all of the threads */
+ { size_t i;
+ for (i = 0; i < ctx->numThreads; ++i) {
+ pthread_join(ctx->threads[i], NULL);
+ } }
+}
+
+void POOL_free(POOL_ctx *ctx) {
+ if (!ctx) { return; }
+ POOL_join(ctx);
+ pthread_mutex_destroy(&ctx->queueMutex);
+ pthread_cond_destroy(&ctx->queuePushCond);
+ pthread_cond_destroy(&ctx->queuePopCond);
+ if (ctx->queue) free(ctx->queue);
+ if (ctx->threads) free(ctx->threads);
+ free(ctx);
+}
+
+size_t POOL_sizeof(POOL_ctx *ctx) {
+ if (ctx==NULL) return 0; /* supports sizeof NULL */
+ return sizeof(*ctx)
+ + ctx->queueSize * sizeof(POOL_job)
+ + ctx->numThreads * sizeof(pthread_t);
+}
+
+void POOL_add(void *ctxVoid, POOL_function function, void *opaque) {
+ POOL_ctx *ctx = (POOL_ctx *)ctxVoid;
+ if (!ctx) { return; }
+
+ pthread_mutex_lock(&ctx->queueMutex);
+ { POOL_job const job = {function, opaque};
+ /* Wait until there is space in the queue for the new job */
+ size_t newTail = (ctx->queueTail + 1) % ctx->queueSize;
+ while (ctx->queueHead == newTail && !ctx->shutdown) {
+ pthread_cond_wait(&ctx->queuePushCond, &ctx->queueMutex);
+ newTail = (ctx->queueTail + 1) % ctx->queueSize;
+ }
+ /* The queue is still going => there is space */
+ if (!ctx->shutdown) {
+ ctx->queue[ctx->queueTail] = job;
+ ctx->queueTail = newTail;
+ }
+ }
+ pthread_mutex_unlock(&ctx->queueMutex);
+ pthread_cond_signal(&ctx->queuePopCond);
+}
+
+#else /* ZSTD_MULTITHREAD not defined */
+/* No multi-threading support */
+
+/* We don't need any data, but if it is empty malloc() might return NULL. */
+struct POOL_ctx_s {
+ int data;
+};
+
+POOL_ctx *POOL_create(size_t numThreads, size_t queueSize) {
+ (void)numThreads;
+ (void)queueSize;
+ return (POOL_ctx *)malloc(sizeof(POOL_ctx));
+}
+
+void POOL_free(POOL_ctx *ctx) {
+ if (ctx) free(ctx);
+}
+
+void POOL_add(void *ctx, POOL_function function, void *opaque) {
+ (void)ctx;
+ function(opaque);
+}
+
+size_t POOL_sizeof(POOL_ctx *ctx) {
+ if (ctx==NULL) return 0; /* supports sizeof NULL */
+ return sizeof(*ctx);
+}
+
+#endif /* ZSTD_MULTITHREAD */
diff --git a/thirdparty/zstd/common/pool.h b/thirdparty/zstd/common/pool.h
new file mode 100644
index 0000000000..386cd674b7
--- /dev/null
+++ b/thirdparty/zstd/common/pool.h
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2016-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+#ifndef POOL_H
+#define POOL_H
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+
+#include <stddef.h> /* size_t */
+
+typedef struct POOL_ctx_s POOL_ctx;
+
+/*! POOL_create() :
+ Create a thread pool with at most `numThreads` threads.
+ `numThreads` must be at least 1.
+ The maximum number of queued jobs before blocking is `queueSize`.
+ `queueSize` must be at least 1.
+ @return : The POOL_ctx pointer on success else NULL.
+*/
+POOL_ctx *POOL_create(size_t numThreads, size_t queueSize);
+
+/*! POOL_free() :
+ Free a thread pool returned by POOL_create().
+*/
+void POOL_free(POOL_ctx *ctx);
+
+/*! POOL_sizeof() :
+ return memory usage of pool returned by POOL_create().
+*/
+size_t POOL_sizeof(POOL_ctx *ctx);
+
+/*! POOL_function :
+ The function type that can be added to a thread pool.
+*/
+typedef void (*POOL_function)(void *);
+/*! POOL_add_function :
+ The function type for a generic thread pool add function.
+*/
+typedef void (*POOL_add_function)(void *, POOL_function, void *);
+
+/*! POOL_add() :
+ Add the job `function(opaque)` to the thread pool.
+ Possibly blocks until there is room in the queue.
+ Note : The function may be executed asynchronously, so `opaque` must live until the function has been completed.
+*/
+void POOL_add(void *ctx, POOL_function function, void *opaque);
+
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif
diff --git a/thirdparty/zstd/common/threading.c b/thirdparty/zstd/common/threading.c
new file mode 100644
index 0000000000..141376c561
--- /dev/null
+++ b/thirdparty/zstd/common/threading.c
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2016 Tino Reichardt
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * You can contact the author at:
+ * - zstdmt source repository: https://github.com/mcmilk/zstdmt
+ */
+
+/**
+ * This file will hold wrapper for systems, which do not support pthreads
+ */
+
+/* When ZSTD_MULTITHREAD is not defined, this file would become an empty translation unit.
+* Include some ISO C header code to prevent this and portably avoid related warnings.
+* (Visual C++: C4206 / GCC: -Wpedantic / Clang: -Wempty-translation-unit)
+*/
+#include <stddef.h>
+
+
+#if defined(ZSTD_MULTITHREAD) && defined(_WIN32)
+
+/**
+ * Windows minimalist Pthread Wrapper, based on :
+ * http://www.cse.wustl.edu/~schmidt/win32-cv-1.html
+ */
+
+
+/* === Dependencies === */
+#include <process.h>
+#include <errno.h>
+#include "threading.h"
+
+
+/* === Implementation === */
+
+static unsigned __stdcall worker(void *arg)
+{
+ pthread_t* const thread = (pthread_t*) arg;
+ thread->arg = thread->start_routine(thread->arg);
+ return 0;
+}
+
+int pthread_create(pthread_t* thread, const void* unused,
+ void* (*start_routine) (void*), void* arg)
+{
+ (void)unused;
+ thread->arg = arg;
+ thread->start_routine = start_routine;
+ thread->handle = (HANDLE) _beginthreadex(NULL, 0, worker, thread, 0, NULL);
+
+ if (!thread->handle)
+ return errno;
+ else
+ return 0;
+}
+
+int _pthread_join(pthread_t * thread, void **value_ptr)
+{
+ DWORD result;
+
+ if (!thread->handle) return 0;
+
+ result = WaitForSingleObject(thread->handle, INFINITE);
+ switch (result) {
+ case WAIT_OBJECT_0:
+ if (value_ptr) *value_ptr = thread->arg;
+ return 0;
+ case WAIT_ABANDONED:
+ return EINVAL;
+ default:
+ return GetLastError();
+ }
+}
+
+#endif /* ZSTD_MULTITHREAD */
diff --git a/thirdparty/zstd/common/threading.h b/thirdparty/zstd/common/threading.h
new file mode 100644
index 0000000000..c0086139ea
--- /dev/null
+++ b/thirdparty/zstd/common/threading.h
@@ -0,0 +1,104 @@
+
+/**
+ * Copyright (c) 2016 Tino Reichardt
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * You can contact the author at:
+ * - zstdmt source repository: https://github.com/mcmilk/zstdmt
+ */
+
+#ifndef THREADING_H_938743
+#define THREADING_H_938743
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+#if defined(ZSTD_MULTITHREAD) && defined(_WIN32)
+
+/**
+ * Windows minimalist Pthread Wrapper, based on :
+ * http://www.cse.wustl.edu/~schmidt/win32-cv-1.html
+ */
+#ifdef WINVER
+# undef WINVER
+#endif
+#define WINVER 0x0600
+
+#ifdef _WIN32_WINNT
+# undef _WIN32_WINNT
+#endif
+#define _WIN32_WINNT 0x0600
+
+#ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
+
+#include <windows.h>
+
+/* mutex */
+#define pthread_mutex_t CRITICAL_SECTION
+#define pthread_mutex_init(a,b) InitializeCriticalSection((a))
+#define pthread_mutex_destroy(a) DeleteCriticalSection((a))
+#define pthread_mutex_lock(a) EnterCriticalSection((a))
+#define pthread_mutex_unlock(a) LeaveCriticalSection((a))
+
+/* condition variable */
+#define pthread_cond_t CONDITION_VARIABLE
+#define pthread_cond_init(a, b) InitializeConditionVariable((a))
+#define pthread_cond_destroy(a) /* No delete */
+#define pthread_cond_wait(a, b) SleepConditionVariableCS((a), (b), INFINITE)
+#define pthread_cond_signal(a) WakeConditionVariable((a))
+#define pthread_cond_broadcast(a) WakeAllConditionVariable((a))
+
+/* pthread_create() and pthread_join() */
+typedef struct {
+ HANDLE handle;
+ void* (*start_routine)(void*);
+ void* arg;
+} pthread_t;
+
+int pthread_create(pthread_t* thread, const void* unused,
+ void* (*start_routine) (void*), void* arg);
+
+#define pthread_join(a, b) _pthread_join(&(a), (b))
+int _pthread_join(pthread_t* thread, void** value_ptr);
+
+/**
+ * add here more wrappers as required
+ */
+
+
+#elif defined(ZSTD_MULTITHREAD) /* posix assumed ; need a better detection method */
+/* === POSIX Systems === */
+# include <pthread.h>
+
+#else /* ZSTD_MULTITHREAD not defined */
+/* No multithreading support */
+
+#define pthread_mutex_t int /* #define rather than typedef, as sometimes pthread support is implicit, resulting in duplicated symbols */
+#define pthread_mutex_init(a,b)
+#define pthread_mutex_destroy(a)
+#define pthread_mutex_lock(a)
+#define pthread_mutex_unlock(a)
+
+#define pthread_cond_t int
+#define pthread_cond_init(a,b)
+#define pthread_cond_destroy(a)
+#define pthread_cond_wait(a,b)
+#define pthread_cond_signal(a)
+#define pthread_cond_broadcast(a)
+
+/* do not use pthread_t */
+
+#endif /* ZSTD_MULTITHREAD */
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif /* THREADING_H_938743 */
diff --git a/thirdparty/zstd/common/xxhash.c b/thirdparty/zstd/common/xxhash.c
new file mode 100644
index 0000000000..eb44222c5f
--- /dev/null
+++ b/thirdparty/zstd/common/xxhash.c
@@ -0,0 +1,869 @@
+/*
+* xxHash - Fast Hash algorithm
+* Copyright (C) 2012-2016, Yann Collet
+*
+* BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following disclaimer
+* in the documentation and/or other materials provided with the
+* distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* You can contact the author at :
+* - xxHash homepage: http://www.xxhash.com
+* - xxHash source repository : https://github.com/Cyan4973/xxHash
+*/
+
+
+/* *************************************
+* Tuning parameters
+***************************************/
+/*!XXH_FORCE_MEMORY_ACCESS :
+ * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable.
+ * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal.
+ * The below switch allow to select different access method for improved performance.
+ * Method 0 (default) : use `memcpy()`. Safe and portable.
+ * Method 1 : `__packed` statement. It depends on compiler extension (ie, not portable).
+ * This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`.
+ * Method 2 : direct access. This method doesn't depend on compiler but violate C standard.
+ * It can generate buggy code on targets which do not support unaligned memory accesses.
+ * But in some circumstances, it's the only known way to get the most performance (ie GCC + ARMv6)
+ * See http://stackoverflow.com/a/32095106/646947 for details.
+ * Prefer these methods in priority order (0 > 1 > 2)
+ */
+#ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */
+# if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) )
+# define XXH_FORCE_MEMORY_ACCESS 2
+# elif (defined(__INTEL_COMPILER) && !defined(WIN32)) || \
+ (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) ))
+# define XXH_FORCE_MEMORY_ACCESS 1
+# endif
+#endif
+
+/*!XXH_ACCEPT_NULL_INPUT_POINTER :
+ * If the input pointer is a null pointer, xxHash default behavior is to trigger a memory access error, since it is a bad pointer.
+ * When this option is enabled, xxHash output for null input pointers will be the same as a null-length input.
+ * By default, this option is disabled. To enable it, uncomment below define :
+ */
+/* #define XXH_ACCEPT_NULL_INPUT_POINTER 1 */
+
+/*!XXH_FORCE_NATIVE_FORMAT :
+ * By default, xxHash library provides endian-independant Hash values, based on little-endian convention.
+ * Results are therefore identical for little-endian and big-endian CPU.
+ * This comes at a performance cost for big-endian CPU, since some swapping is required to emulate little-endian format.
+ * Should endian-independance be of no importance for your application, you may set the #define below to 1,
+ * to improve speed for Big-endian CPU.
+ * This option has no impact on Little_Endian CPU.
+ */
+#ifndef XXH_FORCE_NATIVE_FORMAT /* can be defined externally */
+# define XXH_FORCE_NATIVE_FORMAT 0
+#endif
+
+/*!XXH_FORCE_ALIGN_CHECK :
+ * This is a minor performance trick, only useful with lots of very small keys.
+ * It means : check for aligned/unaligned input.
+ * The check costs one initial branch per hash; set to 0 when the input data
+ * is guaranteed to be aligned.
+ */
+#ifndef XXH_FORCE_ALIGN_CHECK /* can be defined externally */
+# if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)
+# define XXH_FORCE_ALIGN_CHECK 0
+# else
+# define XXH_FORCE_ALIGN_CHECK 1
+# endif
+#endif
+
+
+/* *************************************
+* Includes & Memory related functions
+***************************************/
+/* Modify the local functions below should you wish to use some other memory routines */
+/* for malloc(), free() */
+#include <stdlib.h>
+static void* XXH_malloc(size_t s) { return malloc(s); }
+static void XXH_free (void* p) { free(p); }
+/* for memcpy() */
+#include <string.h>
+static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); }
+
+#ifndef XXH_STATIC_LINKING_ONLY
+# define XXH_STATIC_LINKING_ONLY
+#endif
+#include "xxhash.h"
+
+
+/* *************************************
+* Compiler Specific Options
+***************************************/
+#ifdef _MSC_VER /* Visual Studio */
+# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
+# define FORCE_INLINE static __forceinline
+#else
+# if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
+# ifdef __GNUC__
+# define FORCE_INLINE static inline __attribute__((always_inline))
+# else
+# define FORCE_INLINE static inline
+# endif
+# else
+# define FORCE_INLINE static
+# endif /* __STDC_VERSION__ */
+#endif
+
+
+/* *************************************
+* Basic Types
+***************************************/
+#ifndef MEM_MODULE
+# define MEM_MODULE
+# if !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )
+# include <stdint.h>
+ typedef uint8_t BYTE;
+ typedef uint16_t U16;
+ typedef uint32_t U32;
+ typedef int32_t S32;
+ typedef uint64_t U64;
+# else
+ typedef unsigned char BYTE;
+ typedef unsigned short U16;
+ typedef unsigned int U32;
+ typedef signed int S32;
+ typedef unsigned long long U64; /* if your compiler doesn't support unsigned long long, replace by another 64-bit type here. Note that xxhash.h will also need to be updated. */
+# endif
+#endif
+
+
+#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2))
+
+/* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */
+static U32 XXH_read32(const void* memPtr) { return *(const U32*) memPtr; }
+static U64 XXH_read64(const void* memPtr) { return *(const U64*) memPtr; }
+
+#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1))
+
+/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */
+/* currently only defined for gcc and icc */
+typedef union { U32 u32; U64 u64; } __attribute__((packed)) unalign;
+
+static U32 XXH_read32(const void* ptr) { return ((const unalign*)ptr)->u32; }
+static U64 XXH_read64(const void* ptr) { return ((const unalign*)ptr)->u64; }
+
+#else
+
+/* portable and safe solution. Generally efficient.
+ * see : http://stackoverflow.com/a/32095106/646947
+ */
+
+static U32 XXH_read32(const void* memPtr)
+{
+ U32 val;
+ memcpy(&val, memPtr, sizeof(val));
+ return val;
+}
+
+static U64 XXH_read64(const void* memPtr)
+{
+ U64 val;
+ memcpy(&val, memPtr, sizeof(val));
+ return val;
+}
+
+#endif /* XXH_FORCE_DIRECT_MEMORY_ACCESS */
+
+
+/* ****************************************
+* Compiler-specific Functions and Macros
+******************************************/
+#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+
+/* Note : although _rotl exists for minGW (GCC under windows), performance seems poor */
+#if defined(_MSC_VER)
+# define XXH_rotl32(x,r) _rotl(x,r)
+# define XXH_rotl64(x,r) _rotl64(x,r)
+#else
+# define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
+# define XXH_rotl64(x,r) ((x << r) | (x >> (64 - r)))
+#endif
+
+#if defined(_MSC_VER) /* Visual Studio */
+# define XXH_swap32 _byteswap_ulong
+# define XXH_swap64 _byteswap_uint64
+#elif GCC_VERSION >= 403
+# define XXH_swap32 __builtin_bswap32
+# define XXH_swap64 __builtin_bswap64
+#else
+static U32 XXH_swap32 (U32 x)
+{
+ return ((x << 24) & 0xff000000 ) |
+ ((x << 8) & 0x00ff0000 ) |
+ ((x >> 8) & 0x0000ff00 ) |
+ ((x >> 24) & 0x000000ff );
+}
+static U64 XXH_swap64 (U64 x)
+{
+ return ((x << 56) & 0xff00000000000000ULL) |
+ ((x << 40) & 0x00ff000000000000ULL) |
+ ((x << 24) & 0x0000ff0000000000ULL) |
+ ((x << 8) & 0x000000ff00000000ULL) |
+ ((x >> 8) & 0x00000000ff000000ULL) |
+ ((x >> 24) & 0x0000000000ff0000ULL) |
+ ((x >> 40) & 0x000000000000ff00ULL) |
+ ((x >> 56) & 0x00000000000000ffULL);
+}
+#endif
+
+
+/* *************************************
+* Architecture Macros
+***************************************/
+typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess;
+
+/* XXH_CPU_LITTLE_ENDIAN can be defined externally, for example on the compiler command line */
+#ifndef XXH_CPU_LITTLE_ENDIAN
+ static const int g_one = 1;
+# define XXH_CPU_LITTLE_ENDIAN (*(const char*)(&g_one))
+#endif
+
+
+/* ***************************
+* Memory reads
+*****************************/
+typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment;
+
+FORCE_INLINE U32 XXH_readLE32_align(const void* ptr, XXH_endianess endian, XXH_alignment align)
+{
+ if (align==XXH_unaligned)
+ return endian==XXH_littleEndian ? XXH_read32(ptr) : XXH_swap32(XXH_read32(ptr));
+ else
+ return endian==XXH_littleEndian ? *(const U32*)ptr : XXH_swap32(*(const U32*)ptr);
+}
+
+FORCE_INLINE U32 XXH_readLE32(const void* ptr, XXH_endianess endian)
+{
+ return XXH_readLE32_align(ptr, endian, XXH_unaligned);
+}
+
+static U32 XXH_readBE32(const void* ptr)
+{
+ return XXH_CPU_LITTLE_ENDIAN ? XXH_swap32(XXH_read32(ptr)) : XXH_read32(ptr);
+}
+
+FORCE_INLINE U64 XXH_readLE64_align(const void* ptr, XXH_endianess endian, XXH_alignment align)
+{
+ if (align==XXH_unaligned)
+ return endian==XXH_littleEndian ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr));
+ else
+ return endian==XXH_littleEndian ? *(const U64*)ptr : XXH_swap64(*(const U64*)ptr);
+}
+
+FORCE_INLINE U64 XXH_readLE64(const void* ptr, XXH_endianess endian)
+{
+ return XXH_readLE64_align(ptr, endian, XXH_unaligned);
+}
+
+static U64 XXH_readBE64(const void* ptr)
+{
+ return XXH_CPU_LITTLE_ENDIAN ? XXH_swap64(XXH_read64(ptr)) : XXH_read64(ptr);
+}
+
+
+/* *************************************
+* Macros
+***************************************/
+#define XXH_STATIC_ASSERT(c) { enum { XXH_static_assert = 1/(int)(!!(c)) }; } /* use only *after* variable declarations */
+
+
+/* *************************************
+* Constants
+***************************************/
+static const U32 PRIME32_1 = 2654435761U;
+static const U32 PRIME32_2 = 2246822519U;
+static const U32 PRIME32_3 = 3266489917U;
+static const U32 PRIME32_4 = 668265263U;
+static const U32 PRIME32_5 = 374761393U;
+
+static const U64 PRIME64_1 = 11400714785074694791ULL;
+static const U64 PRIME64_2 = 14029467366897019727ULL;
+static const U64 PRIME64_3 = 1609587929392839161ULL;
+static const U64 PRIME64_4 = 9650029242287828579ULL;
+static const U64 PRIME64_5 = 2870177450012600261ULL;
+
+XXH_PUBLIC_API unsigned XXH_versionNumber (void) { return XXH_VERSION_NUMBER; }
+
+
+/* **************************
+* Utils
+****************************/
+XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* restrict dstState, const XXH32_state_t* restrict srcState)
+{
+ memcpy(dstState, srcState, sizeof(*dstState));
+}
+
+XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* restrict dstState, const XXH64_state_t* restrict srcState)
+{
+ memcpy(dstState, srcState, sizeof(*dstState));
+}
+
+
+/* ***************************
+* Simple Hash Functions
+*****************************/
+
+static U32 XXH32_round(U32 seed, U32 input)
+{
+ seed += input * PRIME32_2;
+ seed = XXH_rotl32(seed, 13);
+ seed *= PRIME32_1;
+ return seed;
+}
+
+FORCE_INLINE U32 XXH32_endian_align(const void* input, size_t len, U32 seed, XXH_endianess endian, XXH_alignment align)
+{
+ const BYTE* p = (const BYTE*)input;
+ const BYTE* bEnd = p + len;
+ U32 h32;
+#define XXH_get32bits(p) XXH_readLE32_align(p, endian, align)
+
+#ifdef XXH_ACCEPT_NULL_INPUT_POINTER
+ if (p==NULL) {
+ len=0;
+ bEnd=p=(const BYTE*)(size_t)16;
+ }
+#endif
+
+ if (len>=16) {
+ const BYTE* const limit = bEnd - 16;
+ U32 v1 = seed + PRIME32_1 + PRIME32_2;
+ U32 v2 = seed + PRIME32_2;
+ U32 v3 = seed + 0;
+ U32 v4 = seed - PRIME32_1;
+
+ do {
+ v1 = XXH32_round(v1, XXH_get32bits(p)); p+=4;
+ v2 = XXH32_round(v2, XXH_get32bits(p)); p+=4;
+ v3 = XXH32_round(v3, XXH_get32bits(p)); p+=4;
+ v4 = XXH32_round(v4, XXH_get32bits(p)); p+=4;
+ } while (p<=limit);
+
+ h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);
+ } else {
+ h32 = seed + PRIME32_5;
+ }
+
+ h32 += (U32) len;
+
+ while (p+4<=bEnd) {
+ h32 += XXH_get32bits(p) * PRIME32_3;
+ h32 = XXH_rotl32(h32, 17) * PRIME32_4 ;
+ p+=4;
+ }
+
+ while (p<bEnd) {
+ h32 += (*p) * PRIME32_5;
+ h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;
+ p++;
+ }
+
+ h32 ^= h32 >> 15;
+ h32 *= PRIME32_2;
+ h32 ^= h32 >> 13;
+ h32 *= PRIME32_3;
+ h32 ^= h32 >> 16;
+
+ return h32;
+}
+
+
+XXH_PUBLIC_API unsigned int XXH32 (const void* input, size_t len, unsigned int seed)
+{
+#if 0
+ /* Simple version, good for code maintenance, but unfortunately slow for small inputs */
+ XXH32_CREATESTATE_STATIC(state);
+ XXH32_reset(state, seed);
+ XXH32_update(state, input, len);
+ return XXH32_digest(state);
+#else
+ XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
+
+ if (XXH_FORCE_ALIGN_CHECK) {
+ if ((((size_t)input) & 3) == 0) { /* Input is 4-bytes aligned, leverage the speed benefit */
+ if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
+ return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned);
+ else
+ return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned);
+ } }
+
+ if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
+ return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned);
+ else
+ return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned);
+#endif
+}
+
+
+static U64 XXH64_round(U64 acc, U64 input)
+{
+ acc += input * PRIME64_2;
+ acc = XXH_rotl64(acc, 31);
+ acc *= PRIME64_1;
+ return acc;
+}
+
+static U64 XXH64_mergeRound(U64 acc, U64 val)
+{
+ val = XXH64_round(0, val);
+ acc ^= val;
+ acc = acc * PRIME64_1 + PRIME64_4;
+ return acc;
+}
+
+FORCE_INLINE U64 XXH64_endian_align(const void* input, size_t len, U64 seed, XXH_endianess endian, XXH_alignment align)
+{
+ const BYTE* p = (const BYTE*)input;
+ const BYTE* const bEnd = p + len;
+ U64 h64;
+#define XXH_get64bits(p) XXH_readLE64_align(p, endian, align)
+
+#ifdef XXH_ACCEPT_NULL_INPUT_POINTER
+ if (p==NULL) {
+ len=0;
+ bEnd=p=(const BYTE*)(size_t)32;
+ }
+#endif
+
+ if (len>=32) {
+ const BYTE* const limit = bEnd - 32;
+ U64 v1 = seed + PRIME64_1 + PRIME64_2;
+ U64 v2 = seed + PRIME64_2;
+ U64 v3 = seed + 0;
+ U64 v4 = seed - PRIME64_1;
+
+ do {
+ v1 = XXH64_round(v1, XXH_get64bits(p)); p+=8;
+ v2 = XXH64_round(v2, XXH_get64bits(p)); p+=8;
+ v3 = XXH64_round(v3, XXH_get64bits(p)); p+=8;
+ v4 = XXH64_round(v4, XXH_get64bits(p)); p+=8;
+ } while (p<=limit);
+
+ h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18);
+ h64 = XXH64_mergeRound(h64, v1);
+ h64 = XXH64_mergeRound(h64, v2);
+ h64 = XXH64_mergeRound(h64, v3);
+ h64 = XXH64_mergeRound(h64, v4);
+
+ } else {
+ h64 = seed + PRIME64_5;
+ }
+
+ h64 += (U64) len;
+
+ while (p+8<=bEnd) {
+ U64 const k1 = XXH64_round(0, XXH_get64bits(p));
+ h64 ^= k1;
+ h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4;
+ p+=8;
+ }
+
+ if (p+4<=bEnd) {
+ h64 ^= (U64)(XXH_get32bits(p)) * PRIME64_1;
+ h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3;
+ p+=4;
+ }
+
+ while (p<bEnd) {
+ h64 ^= (*p) * PRIME64_5;
+ h64 = XXH_rotl64(h64, 11) * PRIME64_1;
+ p++;
+ }
+
+ h64 ^= h64 >> 33;
+ h64 *= PRIME64_2;
+ h64 ^= h64 >> 29;
+ h64 *= PRIME64_3;
+ h64 ^= h64 >> 32;
+
+ return h64;
+}
+
+
+XXH_PUBLIC_API unsigned long long XXH64 (const void* input, size_t len, unsigned long long seed)
+{
+#if 0
+ /* Simple version, good for code maintenance, but unfortunately slow for small inputs */
+ XXH64_CREATESTATE_STATIC(state);
+ XXH64_reset(state, seed);
+ XXH64_update(state, input, len);
+ return XXH64_digest(state);
+#else
+ XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
+
+ if (XXH_FORCE_ALIGN_CHECK) {
+ if ((((size_t)input) & 7)==0) { /* Input is aligned, let's leverage the speed advantage */
+ if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
+ return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned);
+ else
+ return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned);
+ } }
+
+ if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
+ return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned);
+ else
+ return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned);
+#endif
+}
+
+
+/* **************************************************
+* Advanced Hash Functions
+****************************************************/
+
+XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void)
+{
+ return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t));
+}
+XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr)
+{
+ XXH_free(statePtr);
+ return XXH_OK;
+}
+
+XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void)
+{
+ return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t));
+}
+XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr)
+{
+ XXH_free(statePtr);
+ return XXH_OK;
+}
+
+
+/*** Hash feed ***/
+
+XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, unsigned int seed)
+{
+ XXH32_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */
+ memset(&state, 0, sizeof(state)-4); /* do not write into reserved, for future removal */
+ state.v1 = seed + PRIME32_1 + PRIME32_2;
+ state.v2 = seed + PRIME32_2;
+ state.v3 = seed + 0;
+ state.v4 = seed - PRIME32_1;
+ memcpy(statePtr, &state, sizeof(state));
+ return XXH_OK;
+}
+
+
+XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, unsigned long long seed)
+{
+ XXH64_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */
+ memset(&state, 0, sizeof(state)-8); /* do not write into reserved, for future removal */
+ state.v1 = seed + PRIME64_1 + PRIME64_2;
+ state.v2 = seed + PRIME64_2;
+ state.v3 = seed + 0;
+ state.v4 = seed - PRIME64_1;
+ memcpy(statePtr, &state, sizeof(state));
+ return XXH_OK;
+}
+
+
+FORCE_INLINE XXH_errorcode XXH32_update_endian (XXH32_state_t* state, const void* input, size_t len, XXH_endianess endian)
+{
+ const BYTE* p = (const BYTE*)input;
+ const BYTE* const bEnd = p + len;
+
+#ifdef XXH_ACCEPT_NULL_INPUT_POINTER
+ if (input==NULL) return XXH_ERROR;
+#endif
+
+ state->total_len_32 += (unsigned)len;
+ state->large_len |= (len>=16) | (state->total_len_32>=16);
+
+ if (state->memsize + len < 16) { /* fill in tmp buffer */
+ XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, len);
+ state->memsize += (unsigned)len;
+ return XXH_OK;
+ }
+
+ if (state->memsize) { /* some data left from previous update */
+ XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, 16-state->memsize);
+ { const U32* p32 = state->mem32;
+ state->v1 = XXH32_round(state->v1, XXH_readLE32(p32, endian)); p32++;
+ state->v2 = XXH32_round(state->v2, XXH_readLE32(p32, endian)); p32++;
+ state->v3 = XXH32_round(state->v3, XXH_readLE32(p32, endian)); p32++;
+ state->v4 = XXH32_round(state->v4, XXH_readLE32(p32, endian)); p32++;
+ }
+ p += 16-state->memsize;
+ state->memsize = 0;
+ }
+
+ if (p <= bEnd-16) {
+ const BYTE* const limit = bEnd - 16;
+ U32 v1 = state->v1;
+ U32 v2 = state->v2;
+ U32 v3 = state->v3;
+ U32 v4 = state->v4;
+
+ do {
+ v1 = XXH32_round(v1, XXH_readLE32(p, endian)); p+=4;
+ v2 = XXH32_round(v2, XXH_readLE32(p, endian)); p+=4;
+ v3 = XXH32_round(v3, XXH_readLE32(p, endian)); p+=4;
+ v4 = XXH32_round(v4, XXH_readLE32(p, endian)); p+=4;
+ } while (p<=limit);
+
+ state->v1 = v1;
+ state->v2 = v2;
+ state->v3 = v3;
+ state->v4 = v4;
+ }
+
+ if (p < bEnd) {
+ XXH_memcpy(state->mem32, p, (size_t)(bEnd-p));
+ state->memsize = (unsigned)(bEnd-p);
+ }
+
+ return XXH_OK;
+}
+
+XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* state_in, const void* input, size_t len)
+{
+ XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
+
+ if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
+ return XXH32_update_endian(state_in, input, len, XXH_littleEndian);
+ else
+ return XXH32_update_endian(state_in, input, len, XXH_bigEndian);
+}
+
+
+
+FORCE_INLINE U32 XXH32_digest_endian (const XXH32_state_t* state, XXH_endianess endian)
+{
+ const BYTE * p = (const BYTE*)state->mem32;
+ const BYTE* const bEnd = (const BYTE*)(state->mem32) + state->memsize;
+ U32 h32;
+
+ if (state->large_len) {
+ h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18);
+ } else {
+ h32 = state->v3 /* == seed */ + PRIME32_5;
+ }
+
+ h32 += state->total_len_32;
+
+ while (p+4<=bEnd) {
+ h32 += XXH_readLE32(p, endian) * PRIME32_3;
+ h32 = XXH_rotl32(h32, 17) * PRIME32_4;
+ p+=4;
+ }
+
+ while (p<bEnd) {
+ h32 += (*p) * PRIME32_5;
+ h32 = XXH_rotl32(h32, 11) * PRIME32_1;
+ p++;
+ }
+
+ h32 ^= h32 >> 15;
+ h32 *= PRIME32_2;
+ h32 ^= h32 >> 13;
+ h32 *= PRIME32_3;
+ h32 ^= h32 >> 16;
+
+ return h32;
+}
+
+
+XXH_PUBLIC_API unsigned int XXH32_digest (const XXH32_state_t* state_in)
+{
+ XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
+
+ if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
+ return XXH32_digest_endian(state_in, XXH_littleEndian);
+ else
+ return XXH32_digest_endian(state_in, XXH_bigEndian);
+}
+
+
+
+/* **** XXH64 **** */
+
+FORCE_INLINE XXH_errorcode XXH64_update_endian (XXH64_state_t* state, const void* input, size_t len, XXH_endianess endian)
+{
+ const BYTE* p = (const BYTE*)input;
+ const BYTE* const bEnd = p + len;
+
+#ifdef XXH_ACCEPT_NULL_INPUT_POINTER
+ if (input==NULL) return XXH_ERROR;
+#endif
+
+ state->total_len += len;
+
+ if (state->memsize + len < 32) { /* fill in tmp buffer */
+ XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, len);
+ state->memsize += (U32)len;
+ return XXH_OK;
+ }
+
+ if (state->memsize) { /* tmp buffer is full */
+ XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, 32-state->memsize);
+ state->v1 = XXH64_round(state->v1, XXH_readLE64(state->mem64+0, endian));
+ state->v2 = XXH64_round(state->v2, XXH_readLE64(state->mem64+1, endian));
+ state->v3 = XXH64_round(state->v3, XXH_readLE64(state->mem64+2, endian));
+ state->v4 = XXH64_round(state->v4, XXH_readLE64(state->mem64+3, endian));
+ p += 32-state->memsize;
+ state->memsize = 0;
+ }
+
+ if (p+32 <= bEnd) {
+ const BYTE* const limit = bEnd - 32;
+ U64 v1 = state->v1;
+ U64 v2 = state->v2;
+ U64 v3 = state->v3;
+ U64 v4 = state->v4;
+
+ do {
+ v1 = XXH64_round(v1, XXH_readLE64(p, endian)); p+=8;
+ v2 = XXH64_round(v2, XXH_readLE64(p, endian)); p+=8;
+ v3 = XXH64_round(v3, XXH_readLE64(p, endian)); p+=8;
+ v4 = XXH64_round(v4, XXH_readLE64(p, endian)); p+=8;
+ } while (p<=limit);
+
+ state->v1 = v1;
+ state->v2 = v2;
+ state->v3 = v3;
+ state->v4 = v4;
+ }
+
+ if (p < bEnd) {
+ XXH_memcpy(state->mem64, p, (size_t)(bEnd-p));
+ state->memsize = (unsigned)(bEnd-p);
+ }
+
+ return XXH_OK;
+}
+
+XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* state_in, const void* input, size_t len)
+{
+ XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
+
+ if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
+ return XXH64_update_endian(state_in, input, len, XXH_littleEndian);
+ else
+ return XXH64_update_endian(state_in, input, len, XXH_bigEndian);
+}
+
+
+
+FORCE_INLINE U64 XXH64_digest_endian (const XXH64_state_t* state, XXH_endianess endian)
+{
+ const BYTE * p = (const BYTE*)state->mem64;
+ const BYTE* const bEnd = (const BYTE*)state->mem64 + state->memsize;
+ U64 h64;
+
+ if (state->total_len >= 32) {
+ U64 const v1 = state->v1;
+ U64 const v2 = state->v2;
+ U64 const v3 = state->v3;
+ U64 const v4 = state->v4;
+
+ h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18);
+ h64 = XXH64_mergeRound(h64, v1);
+ h64 = XXH64_mergeRound(h64, v2);
+ h64 = XXH64_mergeRound(h64, v3);
+ h64 = XXH64_mergeRound(h64, v4);
+ } else {
+ h64 = state->v3 + PRIME64_5;
+ }
+
+ h64 += (U64) state->total_len;
+
+ while (p+8<=bEnd) {
+ U64 const k1 = XXH64_round(0, XXH_readLE64(p, endian));
+ h64 ^= k1;
+ h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4;
+ p+=8;
+ }
+
+ if (p+4<=bEnd) {
+ h64 ^= (U64)(XXH_readLE32(p, endian)) * PRIME64_1;
+ h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3;
+ p+=4;
+ }
+
+ while (p<bEnd) {
+ h64 ^= (*p) * PRIME64_5;
+ h64 = XXH_rotl64(h64, 11) * PRIME64_1;
+ p++;
+ }
+
+ h64 ^= h64 >> 33;
+ h64 *= PRIME64_2;
+ h64 ^= h64 >> 29;
+ h64 *= PRIME64_3;
+ h64 ^= h64 >> 32;
+
+ return h64;
+}
+
+
+XXH_PUBLIC_API unsigned long long XXH64_digest (const XXH64_state_t* state_in)
+{
+ XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
+
+ if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
+ return XXH64_digest_endian(state_in, XXH_littleEndian);
+ else
+ return XXH64_digest_endian(state_in, XXH_bigEndian);
+}
+
+
+/* **************************
+* Canonical representation
+****************************/
+
+/*! Default XXH result types are basic unsigned 32 and 64 bits.
+* The canonical representation follows human-readable write convention, aka big-endian (large digits first).
+* These functions allow transformation of hash result into and from its canonical format.
+* This way, hash values can be written into a file or buffer, and remain comparable across different systems and programs.
+*/
+
+XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash)
+{
+ XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t));
+ if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap32(hash);
+ memcpy(dst, &hash, sizeof(*dst));
+}
+
+XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash)
+{
+ XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t));
+ if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap64(hash);
+ memcpy(dst, &hash, sizeof(*dst));
+}
+
+XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src)
+{
+ return XXH_readBE32(src);
+}
+
+XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src)
+{
+ return XXH_readBE64(src);
+}
diff --git a/thirdparty/zstd/common/xxhash.h b/thirdparty/zstd/common/xxhash.h
new file mode 100644
index 0000000000..9bad1f59f6
--- /dev/null
+++ b/thirdparty/zstd/common/xxhash.h
@@ -0,0 +1,305 @@
+/*
+ xxHash - Extremely Fast Hash algorithm
+ Header File
+ Copyright (C) 2012-2016, Yann Collet.
+
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ You can contact the author at :
+ - xxHash source repository : https://github.com/Cyan4973/xxHash
+*/
+
+/* Notice extracted from xxHash homepage :
+
+xxHash is an extremely fast Hash algorithm, running at RAM speed limits.
+It also successfully passes all tests from the SMHasher suite.
+
+Comparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2 Duo @3GHz)
+
+Name Speed Q.Score Author
+xxHash 5.4 GB/s 10
+CrapWow 3.2 GB/s 2 Andrew
+MumurHash 3a 2.7 GB/s 10 Austin Appleby
+SpookyHash 2.0 GB/s 10 Bob Jenkins
+SBox 1.4 GB/s 9 Bret Mulvey
+Lookup3 1.2 GB/s 9 Bob Jenkins
+SuperFastHash 1.2 GB/s 1 Paul Hsieh
+CityHash64 1.05 GB/s 10 Pike & Alakuijala
+FNV 0.55 GB/s 5 Fowler, Noll, Vo
+CRC32 0.43 GB/s 9
+MD5-32 0.33 GB/s 10 Ronald L. Rivest
+SHA1-32 0.28 GB/s 10
+
+Q.Score is a measure of quality of the hash function.
+It depends on successfully passing SMHasher test set.
+10 is a perfect score.
+
+A 64-bits version, named XXH64, is available since r35.
+It offers much better speed, but for 64-bits applications only.
+Name Speed on 64 bits Speed on 32 bits
+XXH64 13.8 GB/s 1.9 GB/s
+XXH32 6.8 GB/s 6.0 GB/s
+*/
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+#ifndef XXHASH_H_5627135585666179
+#define XXHASH_H_5627135585666179 1
+
+
+/* ****************************
+* Definitions
+******************************/
+#include <stddef.h> /* size_t */
+typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
+
+
+/* ****************************
+* API modifier
+******************************/
+/** XXH_PRIVATE_API
+* This is useful if you want to include xxhash functions in `static` mode
+* in order to inline them, and remove their symbol from the public list.
+* Methodology :
+* #define XXH_PRIVATE_API
+* #include "xxhash.h"
+* `xxhash.c` is automatically included.
+* It's not useful to compile and link it as a separate module anymore.
+*/
+#ifdef XXH_PRIVATE_API
+# ifndef XXH_STATIC_LINKING_ONLY
+# define XXH_STATIC_LINKING_ONLY
+# endif
+# if defined(__GNUC__)
+# define XXH_PUBLIC_API static __inline __attribute__((unused))
+# elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)
+# define XXH_PUBLIC_API static inline
+# elif defined(_MSC_VER)
+# define XXH_PUBLIC_API static __inline
+# else
+# define XXH_PUBLIC_API static /* this version may generate warnings for unused static functions; disable the relevant warning */
+# endif
+#else
+# define XXH_PUBLIC_API /* do nothing */
+#endif /* XXH_PRIVATE_API */
+
+/*!XXH_NAMESPACE, aka Namespace Emulation :
+
+If you want to include _and expose_ xxHash functions from within your own library,
+but also want to avoid symbol collisions with another library which also includes xxHash,
+
+you can use XXH_NAMESPACE, to automatically prefix any public symbol from xxhash library
+with the value of XXH_NAMESPACE (so avoid to keep it NULL and avoid numeric values).
+
+Note that no change is required within the calling program as long as it includes `xxhash.h` :
+regular symbol name will be automatically translated by this header.
+*/
+#ifdef XXH_NAMESPACE
+# define XXH_CAT(A,B) A##B
+# define XXH_NAME2(A,B) XXH_CAT(A,B)
+# define XXH32 XXH_NAME2(XXH_NAMESPACE, XXH32)
+# define XXH64 XXH_NAME2(XXH_NAMESPACE, XXH64)
+# define XXH_versionNumber XXH_NAME2(XXH_NAMESPACE, XXH_versionNumber)
+# define XXH32_createState XXH_NAME2(XXH_NAMESPACE, XXH32_createState)
+# define XXH64_createState XXH_NAME2(XXH_NAMESPACE, XXH64_createState)
+# define XXH32_freeState XXH_NAME2(XXH_NAMESPACE, XXH32_freeState)
+# define XXH64_freeState XXH_NAME2(XXH_NAMESPACE, XXH64_freeState)
+# define XXH32_reset XXH_NAME2(XXH_NAMESPACE, XXH32_reset)
+# define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)
+# define XXH32_update XXH_NAME2(XXH_NAMESPACE, XXH32_update)
+# define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update)
+# define XXH32_digest XXH_NAME2(XXH_NAMESPACE, XXH32_digest)
+# define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest)
+# define XXH32_copyState XXH_NAME2(XXH_NAMESPACE, XXH32_copyState)
+# define XXH64_copyState XXH_NAME2(XXH_NAMESPACE, XXH64_copyState)
+# define XXH32_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH32_canonicalFromHash)
+# define XXH64_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash)
+# define XXH32_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH32_hashFromCanonical)
+# define XXH64_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH64_hashFromCanonical)
+#endif
+
+
+/* *************************************
+* Version
+***************************************/
+#define XXH_VERSION_MAJOR 0
+#define XXH_VERSION_MINOR 6
+#define XXH_VERSION_RELEASE 2
+#define XXH_VERSION_NUMBER (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE)
+XXH_PUBLIC_API unsigned XXH_versionNumber (void);
+
+
+/* ****************************
+* Simple Hash Functions
+******************************/
+typedef unsigned int XXH32_hash_t;
+typedef unsigned long long XXH64_hash_t;
+
+XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed);
+XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed);
+
+/*!
+XXH32() :
+ Calculate the 32-bits hash of sequence "length" bytes stored at memory address "input".
+ The memory between input & input+length must be valid (allocated and read-accessible).
+ "seed" can be used to alter the result predictably.
+ Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s
+XXH64() :
+ Calculate the 64-bits hash of sequence of length "len" stored at memory address "input".
+ "seed" can be used to alter the result predictably.
+ This function runs 2x faster on 64-bits systems, but slower on 32-bits systems (see benchmark).
+*/
+
+
+/* ****************************
+* Streaming Hash Functions
+******************************/
+typedef struct XXH32_state_s XXH32_state_t; /* incomplete type */
+typedef struct XXH64_state_s XXH64_state_t; /* incomplete type */
+
+/*! State allocation, compatible with dynamic libraries */
+
+XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void);
+XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr);
+
+XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void);
+XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr);
+
+
+/* hash streaming */
+
+XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned int seed);
+XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);
+XXH_PUBLIC_API XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr);
+
+XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed);
+XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length);
+XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr);
+
+/*
+These functions generate the xxHash of an input provided in multiple segments.
+Note that, for small input, they are slower than single-call functions, due to state management.
+For small input, prefer `XXH32()` and `XXH64()` .
+
+XXH state must first be allocated, using XXH*_createState() .
+
+Start a new hash by initializing state with a seed, using XXH*_reset().
+
+Then, feed the hash state by calling XXH*_update() as many times as necessary.
+Obviously, input must be allocated and read accessible.
+The function returns an error code, with 0 meaning OK, and any other value meaning there is an error.
+
+Finally, a hash value can be produced anytime, by using XXH*_digest().
+This function returns the nn-bits hash as an int or long long.
+
+It's still possible to continue inserting input into the hash state after a digest,
+and generate some new hashes later on, by calling again XXH*_digest().
+
+When done, free XXH state space if it was allocated dynamically.
+*/
+
+
+/* **************************
+* Utils
+****************************/
+#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) /* ! C99 */
+# define restrict /* disable restrict */
+#endif
+
+XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* restrict dst_state, const XXH32_state_t* restrict src_state);
+XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* restrict dst_state, const XXH64_state_t* restrict src_state);
+
+
+/* **************************
+* Canonical representation
+****************************/
+/* Default result type for XXH functions are primitive unsigned 32 and 64 bits.
+* The canonical representation uses human-readable write convention, aka big-endian (large digits first).
+* These functions allow transformation of hash result into and from its canonical format.
+* This way, hash values can be written into a file / memory, and remain comparable on different systems and programs.
+*/
+typedef struct { unsigned char digest[4]; } XXH32_canonical_t;
+typedef struct { unsigned char digest[8]; } XXH64_canonical_t;
+
+XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash);
+XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash);
+
+XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src);
+XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src);
+
+#endif /* XXHASH_H_5627135585666179 */
+
+
+
+/* ================================================================================================
+ This section contains definitions which are not guaranteed to remain stable.
+ They may change in future versions, becoming incompatible with a different version of the library.
+ They shall only be used with static linking.
+ Never use these definitions in association with dynamic linking !
+=================================================================================================== */
+#if defined(XXH_STATIC_LINKING_ONLY) && !defined(XXH_STATIC_H_3543687687345)
+#define XXH_STATIC_H_3543687687345
+
+/* These definitions are only meant to allow allocation of XXH state
+ statically, on stack, or in a struct for example.
+ Do not use members directly. */
+
+ struct XXH32_state_s {
+ unsigned total_len_32;
+ unsigned large_len;
+ unsigned v1;
+ unsigned v2;
+ unsigned v3;
+ unsigned v4;
+ unsigned mem32[4]; /* buffer defined as U32 for alignment */
+ unsigned memsize;
+ unsigned reserved; /* never read nor write, will be removed in a future version */
+ }; /* typedef'd to XXH32_state_t */
+
+ struct XXH64_state_s {
+ unsigned long long total_len;
+ unsigned long long v1;
+ unsigned long long v2;
+ unsigned long long v3;
+ unsigned long long v4;
+ unsigned long long mem64[4]; /* buffer defined as U64 for alignment */
+ unsigned memsize;
+ unsigned reserved[2]; /* never read nor write, will be removed in a future version */
+ }; /* typedef'd to XXH64_state_t */
+
+
+# ifdef XXH_PRIVATE_API
+# include "xxhash.c" /* include xxhash functions as `static`, for inlining */
+# endif
+
+#endif /* XXH_STATIC_LINKING_ONLY && XXH_STATIC_H_3543687687345 */
+
+
+#if defined (__cplusplus)
+}
+#endif
diff --git a/thirdparty/zstd/common/zstd_common.c b/thirdparty/zstd/common/zstd_common.c
new file mode 100644
index 0000000000..f681672381
--- /dev/null
+++ b/thirdparty/zstd/common/zstd_common.c
@@ -0,0 +1,80 @@
+/**
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+
+
+/*-*************************************
+* Dependencies
+***************************************/
+#include <stdlib.h> /* malloc, calloc, free */
+#include <string.h> /* memset */
+#include "error_private.h"
+#define ZSTD_STATIC_LINKING_ONLY
+#include "zstd.h"
+
+
+/*-****************************************
+* Version
+******************************************/
+unsigned ZSTD_versionNumber(void) { return ZSTD_VERSION_NUMBER; }
+
+const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }
+
+
+/*-****************************************
+* ZSTD Error Management
+******************************************/
+/*! ZSTD_isError() :
+* tells if a return value is an error code */
+unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }
+
+/*! ZSTD_getErrorName() :
+* provides error code string from function result (useful for debugging) */
+const char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); }
+
+/*! ZSTD_getError() :
+* convert a `size_t` function result into a proper ZSTD_errorCode enum */
+ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); }
+
+/*! ZSTD_getErrorString() :
+* provides error code string from enum */
+const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); }
+
+
+/*=**************************************************************
+* Custom allocator
+****************************************************************/
+void* ZSTD_malloc(size_t size, ZSTD_customMem customMem)
+{
+ if (customMem.customAlloc)
+ return customMem.customAlloc(customMem.opaque, size);
+ return malloc(size);
+}
+
+void* ZSTD_calloc(size_t size, ZSTD_customMem customMem)
+{
+ if (customMem.customAlloc) {
+ /* calloc implemented as malloc+memset;
+ * not as efficient as calloc, but next best guess for custom malloc */
+ void* const ptr = customMem.customAlloc(customMem.opaque, size);
+ memset(ptr, 0, size);
+ return ptr;
+ }
+ return calloc(1, size);
+}
+
+void ZSTD_free(void* ptr, ZSTD_customMem customMem)
+{
+ if (ptr!=NULL) {
+ if (customMem.customFree)
+ customMem.customFree(customMem.opaque, ptr);
+ else
+ free(ptr);
+ }
+}
diff --git a/thirdparty/zstd/common/zstd_errors.h b/thirdparty/zstd/common/zstd_errors.h
new file mode 100644
index 0000000000..19f1597aa3
--- /dev/null
+++ b/thirdparty/zstd/common/zstd_errors.h
@@ -0,0 +1,83 @@
+/**
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+#ifndef ZSTD_ERRORS_H_398273423
+#define ZSTD_ERRORS_H_398273423
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+/*===== dependency =====*/
+#include <stddef.h> /* size_t */
+
+
+/* ===== ZSTDERRORLIB_API : control library symbols visibility ===== */
+#ifndef ZSTDERRORLIB_VISIBILITY
+# if defined(__GNUC__) && (__GNUC__ >= 4)
+# define ZSTDERRORLIB_VISIBILITY __attribute__ ((visibility ("default")))
+# else
+# define ZSTDERRORLIB_VISIBILITY
+# endif
+#endif
+#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
+# define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBILITY
+#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
+# define ZSTDERRORLIB_API __declspec(dllimport) ZSTDERRORLIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
+#else
+# define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBILITY
+#endif
+
+/*-****************************************
+ * error codes list
+ * note : this API is still considered unstable
+ * it should not be used with a dynamic library
+ * only static linking is allowed
+ ******************************************/
+typedef enum {
+ ZSTD_error_no_error,
+ ZSTD_error_GENERIC,
+ ZSTD_error_prefix_unknown,
+ ZSTD_error_version_unsupported,
+ ZSTD_error_parameter_unknown,
+ ZSTD_error_frameParameter_unsupported,
+ ZSTD_error_frameParameter_unsupportedBy32bits,
+ ZSTD_error_frameParameter_windowTooLarge,
+ ZSTD_error_compressionParameter_unsupported,
+ ZSTD_error_compressionParameter_outOfBound,
+ ZSTD_error_init_missing,
+ ZSTD_error_memory_allocation,
+ ZSTD_error_stage_wrong,
+ ZSTD_error_dstSize_tooSmall,
+ ZSTD_error_srcSize_wrong,
+ ZSTD_error_corruption_detected,
+ ZSTD_error_checksum_wrong,
+ ZSTD_error_tableLog_tooLarge,
+ ZSTD_error_maxSymbolValue_tooLarge,
+ ZSTD_error_maxSymbolValue_tooSmall,
+ ZSTD_error_dictionary_corrupted,
+ ZSTD_error_dictionary_wrong,
+ ZSTD_error_dictionaryCreation_failed,
+ ZSTD_error_frameIndex_tooLarge,
+ ZSTD_error_seekableIO,
+ ZSTD_error_maxCode
+} ZSTD_ErrorCode;
+
+/*! ZSTD_getErrorCode() :
+ convert a `size_t` function result into a `ZSTD_ErrorCode` enum type,
+ which can be used to compare with enum list published above */
+ZSTDERRORLIB_API ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
+ZSTDERRORLIB_API const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
+
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif /* ZSTD_ERRORS_H_398273423 */
diff --git a/thirdparty/zstd/common/zstd_internal.h b/thirdparty/zstd/common/zstd_internal.h
new file mode 100644
index 0000000000..49a4796476
--- /dev/null
+++ b/thirdparty/zstd/common/zstd_internal.h
@@ -0,0 +1,346 @@
+/**
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+#ifndef ZSTD_CCOMMON_H_MODULE
+#define ZSTD_CCOMMON_H_MODULE
+
+/*-*******************************************************
+* Compiler specifics
+*********************************************************/
+#ifdef _MSC_VER /* Visual Studio */
+# define FORCE_INLINE static __forceinline
+# include <intrin.h> /* For Visual 2005 */
+# pragma warning(disable : 4100) /* disable: C4100: unreferenced formal parameter */
+# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
+# pragma warning(disable : 4204) /* disable: C4204: non-constant aggregate initializer */
+# pragma warning(disable : 4324) /* disable: C4324: padded structure */
+#else
+# if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
+# ifdef __GNUC__
+# define FORCE_INLINE static inline __attribute__((always_inline))
+# else
+# define FORCE_INLINE static inline
+# endif
+# else
+# define FORCE_INLINE static
+# endif /* __STDC_VERSION__ */
+#endif
+
+#ifdef _MSC_VER
+# define FORCE_NOINLINE static __declspec(noinline)
+#else
+# ifdef __GNUC__
+# define FORCE_NOINLINE static __attribute__((__noinline__))
+# else
+# define FORCE_NOINLINE static
+# endif
+#endif
+
+
+/*-*************************************
+* Dependencies
+***************************************/
+#include "mem.h"
+#include "error_private.h"
+#define ZSTD_STATIC_LINKING_ONLY
+#include "zstd.h"
+#ifndef XXH_STATIC_LINKING_ONLY
+# define XXH_STATIC_LINKING_ONLY /* XXH64_state_t */
+#endif
+#include "xxhash.h" /* XXH_reset, update, digest */
+
+
+/*-*************************************
+* Debug
+***************************************/
+#if defined(ZSTD_DEBUG) && (ZSTD_DEBUG>=1)
+# include <assert.h>
+#else
+# ifndef assert
+# define assert(condition) ((void)0)
+# endif
+#endif
+
+#define ZSTD_STATIC_ASSERT(c) { enum { ZSTD_static_assert = 1/(int)(!!(c)) }; }
+
+#if defined(ZSTD_DEBUG) && (ZSTD_DEBUG>=2)
+# include <stdio.h>
+/* recommended values for ZSTD_DEBUG display levels :
+ * 1 : no display, enables assert() only
+ * 2 : reserved for currently active debugging path
+ * 3 : events once per object lifetime (CCtx, CDict)
+ * 4 : events once per frame
+ * 5 : events once per block
+ * 6 : events once per sequence (*very* verbose) */
+# define DEBUGLOG(l, ...) { \
+ if (l<=ZSTD_DEBUG) { \
+ fprintf(stderr, __FILE__ ": "); \
+ fprintf(stderr, __VA_ARGS__); \
+ fprintf(stderr, " \n"); \
+ } }
+#else
+# define DEBUGLOG(l, ...) {} /* disabled */
+#endif
+
+
+/*-*************************************
+* shared macros
+***************************************/
+#undef MIN
+#undef MAX
+#define MIN(a,b) ((a)<(b) ? (a) : (b))
+#define MAX(a,b) ((a)>(b) ? (a) : (b))
+#define CHECK_F(f) { size_t const errcod = f; if (ERR_isError(errcod)) return errcod; } /* check and Forward error code */
+#define CHECK_E(f, e) { size_t const errcod = f; if (ERR_isError(errcod)) return ERROR(e); } /* check and send Error code */
+
+
+/*-*************************************
+* Common constants
+***************************************/
+#define ZSTD_OPT_NUM (1<<12)
+
+#define ZSTD_REP_NUM 3 /* number of repcodes */
+#define ZSTD_REP_CHECK (ZSTD_REP_NUM) /* number of repcodes to check by the optimal parser */
+#define ZSTD_REP_MOVE (ZSTD_REP_NUM-1)
+#define ZSTD_REP_MOVE_OPT (ZSTD_REP_NUM)
+static const U32 repStartValue[ZSTD_REP_NUM] = { 1, 4, 8 };
+
+#define KB *(1 <<10)
+#define MB *(1 <<20)
+#define GB *(1U<<30)
+
+#define BIT7 128
+#define BIT6 64
+#define BIT5 32
+#define BIT4 16
+#define BIT1 2
+#define BIT0 1
+
+#define ZSTD_WINDOWLOG_ABSOLUTEMIN 10
+static const size_t ZSTD_fcs_fieldSize[4] = { 0, 2, 4, 8 };
+static const size_t ZSTD_did_fieldSize[4] = { 0, 1, 2, 4 };
+
+#define ZSTD_BLOCKHEADERSIZE 3 /* C standard doesn't allow `static const` variable to be init using another `static const` variable */
+static const size_t ZSTD_blockHeaderSize = ZSTD_BLOCKHEADERSIZE;
+typedef enum { bt_raw, bt_rle, bt_compressed, bt_reserved } blockType_e;
+
+#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
+#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */) /* for a non-null block */
+
+#define HufLog 12
+typedef enum { set_basic, set_rle, set_compressed, set_repeat } symbolEncodingType_e;
+
+#define LONGNBSEQ 0x7F00
+
+#define MINMATCH 3
+
+#define Litbits 8
+#define MaxLit ((1<<Litbits) - 1)
+#define MaxML 52
+#define MaxLL 35
+#define MaxOff 28
+#define MaxSeq MAX(MaxLL, MaxML) /* Assumption : MaxOff < MaxLL,MaxML */
+#define MLFSELog 9
+#define LLFSELog 9
+#define OffFSELog 8
+
+static const U32 LL_bits[MaxLL+1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 2, 2, 3, 3, 4, 6, 7, 8, 9,10,11,12,
+ 13,14,15,16 };
+static const S16 LL_defaultNorm[MaxLL+1] = { 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 1, 1, 1, 1,
+ -1,-1,-1,-1 };
+#define LL_DEFAULTNORMLOG 6 /* for static allocation */
+static const U32 LL_defaultNormLog = LL_DEFAULTNORMLOG;
+
+static const U32 ML_bits[MaxML+1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 7, 8, 9,10,11,
+ 12,13,14,15,16 };
+static const S16 ML_defaultNorm[MaxML+1] = { 1, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,-1,-1,
+ -1,-1,-1,-1,-1 };
+#define ML_DEFAULTNORMLOG 6 /* for static allocation */
+static const U32 ML_defaultNormLog = ML_DEFAULTNORMLOG;
+
+static const S16 OF_defaultNorm[MaxOff+1] = { 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,-1,-1,-1,-1,-1 };
+#define OF_DEFAULTNORMLOG 5 /* for static allocation */
+static const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG;
+
+
+/*-*******************************************
+* Shared functions to include for inlining
+*********************************************/
+static void ZSTD_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
+#define COPY8(d,s) { ZSTD_copy8(d,s); d+=8; s+=8; }
+
+/*! ZSTD_wildcopy() :
+* custom version of memcpy(), can copy up to 7 bytes too many (8 bytes if length==0) */
+#define WILDCOPY_OVERLENGTH 8
+MEM_STATIC void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length)
+{
+ const BYTE* ip = (const BYTE*)src;
+ BYTE* op = (BYTE*)dst;
+ BYTE* const oend = op + length;
+ do
+ COPY8(op, ip)
+ while (op < oend);
+}
+
+MEM_STATIC void ZSTD_wildcopy_e(void* dst, const void* src, void* dstEnd) /* should be faster for decoding, but strangely, not verified on all platform */
+{
+ const BYTE* ip = (const BYTE*)src;
+ BYTE* op = (BYTE*)dst;
+ BYTE* const oend = (BYTE*)dstEnd;
+ do
+ COPY8(op, ip)
+ while (op < oend);
+}
+
+
+/*-*******************************************
+* Private interfaces
+*********************************************/
+typedef struct ZSTD_stats_s ZSTD_stats_t;
+
+typedef struct {
+ U32 off;
+ U32 len;
+} ZSTD_match_t;
+
+typedef struct {
+ U32 price;
+ U32 off;
+ U32 mlen;
+ U32 litlen;
+ U32 rep[ZSTD_REP_NUM];
+} ZSTD_optimal_t;
+
+
+typedef struct seqDef_s {
+ U32 offset;
+ U16 litLength;
+ U16 matchLength;
+} seqDef;
+
+
+typedef struct {
+ seqDef* sequencesStart;
+ seqDef* sequences;
+ BYTE* litStart;
+ BYTE* lit;
+ BYTE* llCode;
+ BYTE* mlCode;
+ BYTE* ofCode;
+ U32 longLengthID; /* 0 == no longLength; 1 == Lit.longLength; 2 == Match.longLength; */
+ U32 longLengthPos;
+ /* opt */
+ ZSTD_optimal_t* priceTable;
+ ZSTD_match_t* matchTable;
+ U32* matchLengthFreq;
+ U32* litLengthFreq;
+ U32* litFreq;
+ U32* offCodeFreq;
+ U32 matchLengthSum;
+ U32 matchSum;
+ U32 litLengthSum;
+ U32 litSum;
+ U32 offCodeSum;
+ U32 log2matchLengthSum;
+ U32 log2matchSum;
+ U32 log2litLengthSum;
+ U32 log2litSum;
+ U32 log2offCodeSum;
+ U32 factor;
+ U32 staticPrices;
+ U32 cachedPrice;
+ U32 cachedLitLength;
+ const BYTE* cachedLiterals;
+} seqStore_t;
+
+const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx);
+void ZSTD_seqToCodes(const seqStore_t* seqStorePtr);
+
+/* custom memory allocation functions */
+void* ZSTD_malloc(size_t size, ZSTD_customMem customMem);
+void* ZSTD_calloc(size_t size, ZSTD_customMem customMem);
+void ZSTD_free(void* ptr, ZSTD_customMem customMem);
+
+
+/*====== common function ======*/
+
+MEM_STATIC U32 ZSTD_highbit32(U32 val)
+{
+# if defined(_MSC_VER) /* Visual */
+ unsigned long r=0;
+ _BitScanReverse(&r, val);
+ return (unsigned)r;
+# elif defined(__GNUC__) && (__GNUC__ >= 3) /* GCC Intrinsic */
+ return 31 - __builtin_clz(val);
+# else /* Software version */
+ static const int DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 };
+ U32 v = val;
+ int r;
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+ v |= v >> 16;
+ r = DeBruijnClz[(U32)(v * 0x07C4ACDDU) >> 27];
+ return r;
+# endif
+}
+
+
+/* hidden functions */
+
+/* ZSTD_invalidateRepCodes() :
+ * ensures next compression will not use repcodes from previous block.
+ * Note : only works with regular variant;
+ * do not use with extDict variant ! */
+void ZSTD_invalidateRepCodes(ZSTD_CCtx* cctx);
+
+
+/*! ZSTD_initCStream_internal() :
+ * Private use only. Init streaming operation.
+ * expects params to be valid.
+ * must receive dict, or cdict, or none, but not both.
+ * @return : 0, or an error code */
+size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs,
+ const void* dict, size_t dictSize,
+ const ZSTD_CDict* cdict,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize);
+
+/*! ZSTD_compressStream_generic() :
+ * Private use only. To be called from zstdmt_compress.c in single-thread mode. */
+size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs,
+ ZSTD_outBuffer* output,
+ ZSTD_inBuffer* input,
+ ZSTD_EndDirective const flushMode);
+
+/*! ZSTD_getParamsFromCDict() :
+ * as the name implies */
+ZSTD_parameters ZSTD_getParamsFromCDict(const ZSTD_CDict* cdict);
+
+
+typedef struct {
+ blockType_e blockType;
+ U32 lastBlock;
+ U32 origSize;
+} blockProperties_t;
+
+/*! ZSTD_getcBlockSize() :
+ * Provides the size of compressed block from block header `src` */
+ size_t ZSTD_getcBlockSize(const void* src, size_t srcSize,
+ blockProperties_t* bpPtr);
+
+
+#endif /* ZSTD_CCOMMON_H_MODULE */
diff --git a/thirdparty/zstd/compress/fse_compress.c b/thirdparty/zstd/compress/fse_compress.c
new file mode 100644
index 0000000000..26e8052ddc
--- /dev/null
+++ b/thirdparty/zstd/compress/fse_compress.c
@@ -0,0 +1,857 @@
+/* ******************************************************************
+ FSE : Finite State Entropy encoder
+ Copyright (C) 2013-2015, Yann Collet.
+
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ You can contact the author at :
+ - FSE source repository : https://github.com/Cyan4973/FiniteStateEntropy
+ - Public forum : https://groups.google.com/forum/#!forum/lz4c
+****************************************************************** */
+
+/* **************************************************************
+* Compiler specifics
+****************************************************************/
+#ifdef _MSC_VER /* Visual Studio */
+# define FORCE_INLINE static __forceinline
+# include <intrin.h> /* For Visual 2005 */
+# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
+# pragma warning(disable : 4214) /* disable: C4214: non-int bitfields */
+#else
+# if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
+# ifdef __GNUC__
+# define FORCE_INLINE static inline __attribute__((always_inline))
+# else
+# define FORCE_INLINE static inline
+# endif
+# else
+# define FORCE_INLINE static
+# endif /* __STDC_VERSION__ */
+#endif
+
+
+/* **************************************************************
+* Includes
+****************************************************************/
+#include <stdlib.h> /* malloc, free, qsort */
+#include <string.h> /* memcpy, memset */
+#include <stdio.h> /* printf (debug) */
+#include "bitstream.h"
+#define FSE_STATIC_LINKING_ONLY
+#include "fse.h"
+
+
+/* **************************************************************
+* Error Management
+****************************************************************/
+#define FSE_STATIC_ASSERT(c) { enum { FSE_static_assert = 1/(int)(!!(c)) }; } /* use only *after* variable declarations */
+
+
+/* **************************************************************
+* Templates
+****************************************************************/
+/*
+ designed to be included
+ for type-specific functions (template emulation in C)
+ Objective is to write these functions only once, for improved maintenance
+*/
+
+/* safety checks */
+#ifndef FSE_FUNCTION_EXTENSION
+# error "FSE_FUNCTION_EXTENSION must be defined"
+#endif
+#ifndef FSE_FUNCTION_TYPE
+# error "FSE_FUNCTION_TYPE must be defined"
+#endif
+
+/* Function names */
+#define FSE_CAT(X,Y) X##Y
+#define FSE_FUNCTION_NAME(X,Y) FSE_CAT(X,Y)
+#define FSE_TYPE_NAME(X,Y) FSE_CAT(X,Y)
+
+
+/* Function templates */
+
+/* FSE_buildCTable_wksp() :
+ * Same as FSE_buildCTable(), but using an externally allocated scratch buffer (`workSpace`).
+ * wkspSize should be sized to handle worst case situation, which is `1<<max_tableLog * sizeof(FSE_FUNCTION_TYPE)`
+ * workSpace must also be properly aligned with FSE_FUNCTION_TYPE requirements
+ */
+size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize)
+{
+ U32 const tableSize = 1 << tableLog;
+ U32 const tableMask = tableSize - 1;
+ void* const ptr = ct;
+ U16* const tableU16 = ( (U16*) ptr) + 2;
+ void* const FSCT = ((U32*)ptr) + 1 /* header */ + (tableLog ? tableSize>>1 : 1) ;
+ FSE_symbolCompressionTransform* const symbolTT = (FSE_symbolCompressionTransform*) (FSCT);
+ U32 const step = FSE_TABLESTEP(tableSize);
+ U32 cumul[FSE_MAX_SYMBOL_VALUE+2];
+
+ FSE_FUNCTION_TYPE* const tableSymbol = (FSE_FUNCTION_TYPE*)workSpace;
+ U32 highThreshold = tableSize-1;
+
+ /* CTable header */
+ if (((size_t)1 << tableLog) * sizeof(FSE_FUNCTION_TYPE) > wkspSize) return ERROR(tableLog_tooLarge);
+ tableU16[-2] = (U16) tableLog;
+ tableU16[-1] = (U16) maxSymbolValue;
+
+ /* For explanations on how to distribute symbol values over the table :
+ * http://fastcompression.blogspot.fr/2014/02/fse-distributing-symbol-values.html */
+
+ /* symbol start positions */
+ { U32 u;
+ cumul[0] = 0;
+ for (u=1; u<=maxSymbolValue+1; u++) {
+ if (normalizedCounter[u-1]==-1) { /* Low proba symbol */
+ cumul[u] = cumul[u-1] + 1;
+ tableSymbol[highThreshold--] = (FSE_FUNCTION_TYPE)(u-1);
+ } else {
+ cumul[u] = cumul[u-1] + normalizedCounter[u-1];
+ } }
+ cumul[maxSymbolValue+1] = tableSize+1;
+ }
+
+ /* Spread symbols */
+ { U32 position = 0;
+ U32 symbol;
+ for (symbol=0; symbol<=maxSymbolValue; symbol++) {
+ int nbOccurences;
+ for (nbOccurences=0; nbOccurences<normalizedCounter[symbol]; nbOccurences++) {
+ tableSymbol[position] = (FSE_FUNCTION_TYPE)symbol;
+ position = (position + step) & tableMask;
+ while (position > highThreshold) position = (position + step) & tableMask; /* Low proba area */
+ } }
+
+ if (position!=0) return ERROR(GENERIC); /* Must have gone through all positions */
+ }
+
+ /* Build table */
+ { U32 u; for (u=0; u<tableSize; u++) {
+ FSE_FUNCTION_TYPE s = tableSymbol[u]; /* note : static analyzer may not understand tableSymbol is properly initialized */
+ tableU16[cumul[s]++] = (U16) (tableSize+u); /* TableU16 : sorted by symbol order; gives next state value */
+ } }
+
+ /* Build Symbol Transformation Table */
+ { unsigned total = 0;
+ unsigned s;
+ for (s=0; s<=maxSymbolValue; s++) {
+ switch (normalizedCounter[s])
+ {
+ case 0: break;
+
+ case -1:
+ case 1:
+ symbolTT[s].deltaNbBits = (tableLog << 16) - (1<<tableLog);
+ symbolTT[s].deltaFindState = total - 1;
+ total ++;
+ break;
+ default :
+ {
+ U32 const maxBitsOut = tableLog - BIT_highbit32 (normalizedCounter[s]-1);
+ U32 const minStatePlus = normalizedCounter[s] << maxBitsOut;
+ symbolTT[s].deltaNbBits = (maxBitsOut << 16) - minStatePlus;
+ symbolTT[s].deltaFindState = total - normalizedCounter[s];
+ total += normalizedCounter[s];
+ } } } }
+
+ return 0;
+}
+
+
+size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
+{
+ FSE_FUNCTION_TYPE tableSymbol[FSE_MAX_TABLESIZE]; /* memset() is not necessary, even if static analyzer complain about it */
+ return FSE_buildCTable_wksp(ct, normalizedCounter, maxSymbolValue, tableLog, tableSymbol, sizeof(tableSymbol));
+}
+
+
+
+#ifndef FSE_COMMONDEFS_ONLY
+
+/*-**************************************************************
+* FSE NCount encoding-decoding
+****************************************************************/
+size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog)
+{
+ size_t const maxHeaderSize = (((maxSymbolValue+1) * tableLog) >> 3) + 3;
+ return maxSymbolValue ? maxHeaderSize : FSE_NCOUNTBOUND; /* maxSymbolValue==0 ? use default */
+}
+
+static size_t FSE_writeNCount_generic (void* header, size_t headerBufferSize,
+ const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog,
+ unsigned writeIsSafe)
+{
+ BYTE* const ostart = (BYTE*) header;
+ BYTE* out = ostart;
+ BYTE* const oend = ostart + headerBufferSize;
+ int nbBits;
+ const int tableSize = 1 << tableLog;
+ int remaining;
+ int threshold;
+ U32 bitStream;
+ int bitCount;
+ unsigned charnum = 0;
+ int previous0 = 0;
+
+ bitStream = 0;
+ bitCount = 0;
+ /* Table Size */
+ bitStream += (tableLog-FSE_MIN_TABLELOG) << bitCount;
+ bitCount += 4;
+
+ /* Init */
+ remaining = tableSize+1; /* +1 for extra accuracy */
+ threshold = tableSize;
+ nbBits = tableLog+1;
+
+ while (remaining>1) { /* stops at 1 */
+ if (previous0) {
+ unsigned start = charnum;
+ while (!normalizedCounter[charnum]) charnum++;
+ while (charnum >= start+24) {
+ start+=24;
+ bitStream += 0xFFFFU << bitCount;
+ if ((!writeIsSafe) && (out > oend-2)) return ERROR(dstSize_tooSmall); /* Buffer overflow */
+ out[0] = (BYTE) bitStream;
+ out[1] = (BYTE)(bitStream>>8);
+ out+=2;
+ bitStream>>=16;
+ }
+ while (charnum >= start+3) {
+ start+=3;
+ bitStream += 3 << bitCount;
+ bitCount += 2;
+ }
+ bitStream += (charnum-start) << bitCount;
+ bitCount += 2;
+ if (bitCount>16) {
+ if ((!writeIsSafe) && (out > oend - 2)) return ERROR(dstSize_tooSmall); /* Buffer overflow */
+ out[0] = (BYTE)bitStream;
+ out[1] = (BYTE)(bitStream>>8);
+ out += 2;
+ bitStream >>= 16;
+ bitCount -= 16;
+ } }
+ { int count = normalizedCounter[charnum++];
+ int const max = (2*threshold-1)-remaining;
+ remaining -= count < 0 ? -count : count;
+ count++; /* +1 for extra accuracy */
+ if (count>=threshold) count += max; /* [0..max[ [max..threshold[ (...) [threshold+max 2*threshold[ */
+ bitStream += count << bitCount;
+ bitCount += nbBits;
+ bitCount -= (count<max);
+ previous0 = (count==1);
+ if (remaining<1) return ERROR(GENERIC);
+ while (remaining<threshold) nbBits--, threshold>>=1;
+ }
+ if (bitCount>16) {
+ if ((!writeIsSafe) && (out > oend - 2)) return ERROR(dstSize_tooSmall); /* Buffer overflow */
+ out[0] = (BYTE)bitStream;
+ out[1] = (BYTE)(bitStream>>8);
+ out += 2;
+ bitStream >>= 16;
+ bitCount -= 16;
+ } }
+
+ /* flush remaining bitStream */
+ if ((!writeIsSafe) && (out > oend - 2)) return ERROR(dstSize_tooSmall); /* Buffer overflow */
+ out[0] = (BYTE)bitStream;
+ out[1] = (BYTE)(bitStream>>8);
+ out+= (bitCount+7) /8;
+
+ if (charnum > maxSymbolValue + 1) return ERROR(GENERIC);
+
+ return (out-ostart);
+}
+
+
+size_t FSE_writeNCount (void* buffer, size_t bufferSize, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
+{
+ if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported */
+ if (tableLog < FSE_MIN_TABLELOG) return ERROR(GENERIC); /* Unsupported */
+
+ if (bufferSize < FSE_NCountWriteBound(maxSymbolValue, tableLog))
+ return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 0);
+
+ return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 1);
+}
+
+
+
+/*-**************************************************************
+* Counting histogram
+****************************************************************/
+/*! FSE_count_simple
+ This function counts byte values within `src`, and store the histogram into table `count`.
+ It doesn't use any additional memory.
+ But this function is unsafe : it doesn't check that all values within `src` can fit into `count`.
+ For this reason, prefer using a table `count` with 256 elements.
+ @return : count of most numerous element
+*/
+size_t FSE_count_simple(unsigned* count, unsigned* maxSymbolValuePtr,
+ const void* src, size_t srcSize)
+{
+ const BYTE* ip = (const BYTE*)src;
+ const BYTE* const end = ip + srcSize;
+ unsigned maxSymbolValue = *maxSymbolValuePtr;
+ unsigned max=0;
+
+ memset(count, 0, (maxSymbolValue+1)*sizeof(*count));
+ if (srcSize==0) { *maxSymbolValuePtr = 0; return 0; }
+
+ while (ip<end) count[*ip++]++;
+
+ while (!count[maxSymbolValue]) maxSymbolValue--;
+ *maxSymbolValuePtr = maxSymbolValue;
+
+ { U32 s; for (s=0; s<=maxSymbolValue; s++) if (count[s] > max) max = count[s]; }
+
+ return (size_t)max;
+}
+
+
+/* FSE_count_parallel_wksp() :
+ * Same as FSE_count_parallel(), but using an externally provided scratch buffer.
+ * `workSpace` size must be a minimum of `1024 * sizeof(unsigned)`` */
+static size_t FSE_count_parallel_wksp(
+ unsigned* count, unsigned* maxSymbolValuePtr,
+ const void* source, size_t sourceSize,
+ unsigned checkMax, unsigned* const workSpace)
+{
+ const BYTE* ip = (const BYTE*)source;
+ const BYTE* const iend = ip+sourceSize;
+ unsigned maxSymbolValue = *maxSymbolValuePtr;
+ unsigned max=0;
+ U32* const Counting1 = workSpace;
+ U32* const Counting2 = Counting1 + 256;
+ U32* const Counting3 = Counting2 + 256;
+ U32* const Counting4 = Counting3 + 256;
+
+ memset(Counting1, 0, 4*256*sizeof(unsigned));
+
+ /* safety checks */
+ if (!sourceSize) {
+ memset(count, 0, maxSymbolValue + 1);
+ *maxSymbolValuePtr = 0;
+ return 0;
+ }
+ if (!maxSymbolValue) maxSymbolValue = 255; /* 0 == default */
+
+ /* by stripes of 16 bytes */
+ { U32 cached = MEM_read32(ip); ip += 4;
+ while (ip < iend-15) {
+ U32 c = cached; cached = MEM_read32(ip); ip += 4;
+ Counting1[(BYTE) c ]++;
+ Counting2[(BYTE)(c>>8) ]++;
+ Counting3[(BYTE)(c>>16)]++;
+ Counting4[ c>>24 ]++;
+ c = cached; cached = MEM_read32(ip); ip += 4;
+ Counting1[(BYTE) c ]++;
+ Counting2[(BYTE)(c>>8) ]++;
+ Counting3[(BYTE)(c>>16)]++;
+ Counting4[ c>>24 ]++;
+ c = cached; cached = MEM_read32(ip); ip += 4;
+ Counting1[(BYTE) c ]++;
+ Counting2[(BYTE)(c>>8) ]++;
+ Counting3[(BYTE)(c>>16)]++;
+ Counting4[ c>>24 ]++;
+ c = cached; cached = MEM_read32(ip); ip += 4;
+ Counting1[(BYTE) c ]++;
+ Counting2[(BYTE)(c>>8) ]++;
+ Counting3[(BYTE)(c>>16)]++;
+ Counting4[ c>>24 ]++;
+ }
+ ip-=4;
+ }
+
+ /* finish last symbols */
+ while (ip<iend) Counting1[*ip++]++;
+
+ if (checkMax) { /* verify stats will fit into destination table */
+ U32 s; for (s=255; s>maxSymbolValue; s--) {
+ Counting1[s] += Counting2[s] + Counting3[s] + Counting4[s];
+ if (Counting1[s]) return ERROR(maxSymbolValue_tooSmall);
+ } }
+
+ { U32 s; for (s=0; s<=maxSymbolValue; s++) {
+ count[s] = Counting1[s] + Counting2[s] + Counting3[s] + Counting4[s];
+ if (count[s] > max) max = count[s];
+ } }
+
+ while (!count[maxSymbolValue]) maxSymbolValue--;
+ *maxSymbolValuePtr = maxSymbolValue;
+ return (size_t)max;
+}
+
+/* FSE_countFast_wksp() :
+ * Same as FSE_countFast(), but using an externally provided scratch buffer.
+ * `workSpace` size must be table of >= `1024` unsigned */
+size_t FSE_countFast_wksp(unsigned* count, unsigned* maxSymbolValuePtr,
+ const void* source, size_t sourceSize, unsigned* workSpace)
+{
+ if (sourceSize < 1500) return FSE_count_simple(count, maxSymbolValuePtr, source, sourceSize);
+ return FSE_count_parallel_wksp(count, maxSymbolValuePtr, source, sourceSize, 0, workSpace);
+}
+
+/* fast variant (unsafe : won't check if src contains values beyond count[] limit) */
+size_t FSE_countFast(unsigned* count, unsigned* maxSymbolValuePtr,
+ const void* source, size_t sourceSize)
+{
+ unsigned tmpCounters[1024];
+ return FSE_countFast_wksp(count, maxSymbolValuePtr, source, sourceSize, tmpCounters);
+}
+
+/* FSE_count_wksp() :
+ * Same as FSE_count(), but using an externally provided scratch buffer.
+ * `workSpace` size must be table of >= `1024` unsigned */
+size_t FSE_count_wksp(unsigned* count, unsigned* maxSymbolValuePtr,
+ const void* source, size_t sourceSize, unsigned* workSpace)
+{
+ if (*maxSymbolValuePtr < 255)
+ return FSE_count_parallel_wksp(count, maxSymbolValuePtr, source, sourceSize, 1, workSpace);
+ *maxSymbolValuePtr = 255;
+ return FSE_countFast_wksp(count, maxSymbolValuePtr, source, sourceSize, workSpace);
+}
+
+size_t FSE_count(unsigned* count, unsigned* maxSymbolValuePtr,
+ const void* src, size_t srcSize)
+{
+ unsigned tmpCounters[1024];
+ return FSE_count_wksp(count, maxSymbolValuePtr, src, srcSize, tmpCounters);
+}
+
+
+
+/*-**************************************************************
+* FSE Compression Code
+****************************************************************/
+/*! FSE_sizeof_CTable() :
+ FSE_CTable is a variable size structure which contains :
+ `U16 tableLog;`
+ `U16 maxSymbolValue;`
+ `U16 nextStateNumber[1 << tableLog];` // This size is variable
+ `FSE_symbolCompressionTransform symbolTT[maxSymbolValue+1];` // This size is variable
+Allocation is manual (C standard does not support variable-size structures).
+*/
+size_t FSE_sizeof_CTable (unsigned maxSymbolValue, unsigned tableLog)
+{
+ if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
+ return FSE_CTABLE_SIZE_U32 (tableLog, maxSymbolValue) * sizeof(U32);
+}
+
+FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog)
+{
+ size_t size;
+ if (tableLog > FSE_TABLELOG_ABSOLUTE_MAX) tableLog = FSE_TABLELOG_ABSOLUTE_MAX;
+ size = FSE_CTABLE_SIZE_U32 (tableLog, maxSymbolValue) * sizeof(U32);
+ return (FSE_CTable*)malloc(size);
+}
+
+void FSE_freeCTable (FSE_CTable* ct) { free(ct); }
+
+/* provides the minimum logSize to safely represent a distribution */
+static unsigned FSE_minTableLog(size_t srcSize, unsigned maxSymbolValue)
+{
+ U32 minBitsSrc = BIT_highbit32((U32)(srcSize - 1)) + 1;
+ U32 minBitsSymbols = BIT_highbit32(maxSymbolValue) + 2;
+ U32 minBits = minBitsSrc < minBitsSymbols ? minBitsSrc : minBitsSymbols;
+ return minBits;
+}
+
+unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus)
+{
+ U32 maxBitsSrc = BIT_highbit32((U32)(srcSize - 1)) - minus;
+ U32 tableLog = maxTableLog;
+ U32 minBits = FSE_minTableLog(srcSize, maxSymbolValue);
+ if (tableLog==0) tableLog = FSE_DEFAULT_TABLELOG;
+ if (maxBitsSrc < tableLog) tableLog = maxBitsSrc; /* Accuracy can be reduced */
+ if (minBits > tableLog) tableLog = minBits; /* Need a minimum to safely represent all symbol values */
+ if (tableLog < FSE_MIN_TABLELOG) tableLog = FSE_MIN_TABLELOG;
+ if (tableLog > FSE_MAX_TABLELOG) tableLog = FSE_MAX_TABLELOG;
+ return tableLog;
+}
+
+unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue)
+{
+ return FSE_optimalTableLog_internal(maxTableLog, srcSize, maxSymbolValue, 2);
+}
+
+
+/* Secondary normalization method.
+ To be used when primary method fails. */
+
+static size_t FSE_normalizeM2(short* norm, U32 tableLog, const unsigned* count, size_t total, U32 maxSymbolValue)
+{
+ short const NOT_YET_ASSIGNED = -2;
+ U32 s;
+ U32 distributed = 0;
+ U32 ToDistribute;
+
+ /* Init */
+ U32 const lowThreshold = (U32)(total >> tableLog);
+ U32 lowOne = (U32)((total * 3) >> (tableLog + 1));
+
+ for (s=0; s<=maxSymbolValue; s++) {
+ if (count[s] == 0) {
+ norm[s]=0;
+ continue;
+ }
+ if (count[s] <= lowThreshold) {
+ norm[s] = -1;
+ distributed++;
+ total -= count[s];
+ continue;
+ }
+ if (count[s] <= lowOne) {
+ norm[s] = 1;
+ distributed++;
+ total -= count[s];
+ continue;
+ }
+
+ norm[s]=NOT_YET_ASSIGNED;
+ }
+ ToDistribute = (1 << tableLog) - distributed;
+
+ if ((total / ToDistribute) > lowOne) {
+ /* risk of rounding to zero */
+ lowOne = (U32)((total * 3) / (ToDistribute * 2));
+ for (s=0; s<=maxSymbolValue; s++) {
+ if ((norm[s] == NOT_YET_ASSIGNED) && (count[s] <= lowOne)) {
+ norm[s] = 1;
+ distributed++;
+ total -= count[s];
+ continue;
+ } }
+ ToDistribute = (1 << tableLog) - distributed;
+ }
+
+ if (distributed == maxSymbolValue+1) {
+ /* all values are pretty poor;
+ probably incompressible data (should have already been detected);
+ find max, then give all remaining points to max */
+ U32 maxV = 0, maxC = 0;
+ for (s=0; s<=maxSymbolValue; s++)
+ if (count[s] > maxC) maxV=s, maxC=count[s];
+ norm[maxV] += (short)ToDistribute;
+ return 0;
+ }
+
+ if (total == 0) {
+ /* all of the symbols were low enough for the lowOne or lowThreshold */
+ for (s=0; ToDistribute > 0; s = (s+1)%(maxSymbolValue+1))
+ if (norm[s] > 0) ToDistribute--, norm[s]++;
+ return 0;
+ }
+
+ { U64 const vStepLog = 62 - tableLog;
+ U64 const mid = (1ULL << (vStepLog-1)) - 1;
+ U64 const rStep = ((((U64)1<<vStepLog) * ToDistribute) + mid) / total; /* scale on remaining */
+ U64 tmpTotal = mid;
+ for (s=0; s<=maxSymbolValue; s++) {
+ if (norm[s]==NOT_YET_ASSIGNED) {
+ U64 const end = tmpTotal + (count[s] * rStep);
+ U32 const sStart = (U32)(tmpTotal >> vStepLog);
+ U32 const sEnd = (U32)(end >> vStepLog);
+ U32 const weight = sEnd - sStart;
+ if (weight < 1)
+ return ERROR(GENERIC);
+ norm[s] = (short)weight;
+ tmpTotal = end;
+ } } }
+
+ return 0;
+}
+
+
+size_t FSE_normalizeCount (short* normalizedCounter, unsigned tableLog,
+ const unsigned* count, size_t total,
+ unsigned maxSymbolValue)
+{
+ /* Sanity checks */
+ if (tableLog==0) tableLog = FSE_DEFAULT_TABLELOG;
+ if (tableLog < FSE_MIN_TABLELOG) return ERROR(GENERIC); /* Unsupported size */
+ if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported size */
+ if (tableLog < FSE_minTableLog(total, maxSymbolValue)) return ERROR(GENERIC); /* Too small tableLog, compression potentially impossible */
+
+ { U32 const rtbTable[] = { 0, 473195, 504333, 520860, 550000, 700000, 750000, 830000 };
+ U64 const scale = 62 - tableLog;
+ U64 const step = ((U64)1<<62) / total; /* <== here, one division ! */
+ U64 const vStep = 1ULL<<(scale-20);
+ int stillToDistribute = 1<<tableLog;
+ unsigned s;
+ unsigned largest=0;
+ short largestP=0;
+ U32 lowThreshold = (U32)(total >> tableLog);
+
+ for (s=0; s<=maxSymbolValue; s++) {
+ if (count[s] == total) return 0; /* rle special case */
+ if (count[s] == 0) { normalizedCounter[s]=0; continue; }
+ if (count[s] <= lowThreshold) {
+ normalizedCounter[s] = -1;
+ stillToDistribute--;
+ } else {
+ short proba = (short)((count[s]*step) >> scale);
+ if (proba<8) {
+ U64 restToBeat = vStep * rtbTable[proba];
+ proba += (count[s]*step) - ((U64)proba<<scale) > restToBeat;
+ }
+ if (proba > largestP) largestP=proba, largest=s;
+ normalizedCounter[s] = proba;
+ stillToDistribute -= proba;
+ } }
+ if (-stillToDistribute >= (normalizedCounter[largest] >> 1)) {
+ /* corner case, need another normalization method */
+ size_t const errorCode = FSE_normalizeM2(normalizedCounter, tableLog, count, total, maxSymbolValue);
+ if (FSE_isError(errorCode)) return errorCode;
+ }
+ else normalizedCounter[largest] += (short)stillToDistribute;
+ }
+
+#if 0
+ { /* Print Table (debug) */
+ U32 s;
+ U32 nTotal = 0;
+ for (s=0; s<=maxSymbolValue; s++)
+ printf("%3i: %4i \n", s, normalizedCounter[s]);
+ for (s=0; s<=maxSymbolValue; s++)
+ nTotal += abs(normalizedCounter[s]);
+ if (nTotal != (1U<<tableLog))
+ printf("Warning !!! Total == %u != %u !!!", nTotal, 1U<<tableLog);
+ getchar();
+ }
+#endif
+
+ return tableLog;
+}
+
+
+/* fake FSE_CTable, for raw (uncompressed) input */
+size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits)
+{
+ const unsigned tableSize = 1 << nbBits;
+ const unsigned tableMask = tableSize - 1;
+ const unsigned maxSymbolValue = tableMask;
+ void* const ptr = ct;
+ U16* const tableU16 = ( (U16*) ptr) + 2;
+ void* const FSCT = ((U32*)ptr) + 1 /* header */ + (tableSize>>1); /* assumption : tableLog >= 1 */
+ FSE_symbolCompressionTransform* const symbolTT = (FSE_symbolCompressionTransform*) (FSCT);
+ unsigned s;
+
+ /* Sanity checks */
+ if (nbBits < 1) return ERROR(GENERIC); /* min size */
+
+ /* header */
+ tableU16[-2] = (U16) nbBits;
+ tableU16[-1] = (U16) maxSymbolValue;
+
+ /* Build table */
+ for (s=0; s<tableSize; s++)
+ tableU16[s] = (U16)(tableSize + s);
+
+ /* Build Symbol Transformation Table */
+ { const U32 deltaNbBits = (nbBits << 16) - (1 << nbBits);
+ for (s=0; s<=maxSymbolValue; s++) {
+ symbolTT[s].deltaNbBits = deltaNbBits;
+ symbolTT[s].deltaFindState = s-1;
+ } }
+
+ return 0;
+}
+
+/* fake FSE_CTable, for rle input (always same symbol) */
+size_t FSE_buildCTable_rle (FSE_CTable* ct, BYTE symbolValue)
+{
+ void* ptr = ct;
+ U16* tableU16 = ( (U16*) ptr) + 2;
+ void* FSCTptr = (U32*)ptr + 2;
+ FSE_symbolCompressionTransform* symbolTT = (FSE_symbolCompressionTransform*) FSCTptr;
+
+ /* header */
+ tableU16[-2] = (U16) 0;
+ tableU16[-1] = (U16) symbolValue;
+
+ /* Build table */
+ tableU16[0] = 0;
+ tableU16[1] = 0; /* just in case */
+
+ /* Build Symbol Transformation Table */
+ symbolTT[symbolValue].deltaNbBits = 0;
+ symbolTT[symbolValue].deltaFindState = 0;
+
+ return 0;
+}
+
+
+static size_t FSE_compress_usingCTable_generic (void* dst, size_t dstSize,
+ const void* src, size_t srcSize,
+ const FSE_CTable* ct, const unsigned fast)
+{
+ const BYTE* const istart = (const BYTE*) src;
+ const BYTE* const iend = istart + srcSize;
+ const BYTE* ip=iend;
+
+ BIT_CStream_t bitC;
+ FSE_CState_t CState1, CState2;
+
+ /* init */
+ if (srcSize <= 2) return 0;
+ { size_t const initError = BIT_initCStream(&bitC, dst, dstSize);
+ if (FSE_isError(initError)) return 0; /* not enough space available to write a bitstream */ }
+
+#define FSE_FLUSHBITS(s) (fast ? BIT_flushBitsFast(s) : BIT_flushBits(s))
+
+ if (srcSize & 1) {
+ FSE_initCState2(&CState1, ct, *--ip);
+ FSE_initCState2(&CState2, ct, *--ip);
+ FSE_encodeSymbol(&bitC, &CState1, *--ip);
+ FSE_FLUSHBITS(&bitC);
+ } else {
+ FSE_initCState2(&CState2, ct, *--ip);
+ FSE_initCState2(&CState1, ct, *--ip);
+ }
+
+ /* join to mod 4 */
+ srcSize -= 2;
+ if ((sizeof(bitC.bitContainer)*8 > FSE_MAX_TABLELOG*4+7 ) && (srcSize & 2)) { /* test bit 2 */
+ FSE_encodeSymbol(&bitC, &CState2, *--ip);
+ FSE_encodeSymbol(&bitC, &CState1, *--ip);
+ FSE_FLUSHBITS(&bitC);
+ }
+
+ /* 2 or 4 encoding per loop */
+ while ( ip>istart ) {
+
+ FSE_encodeSymbol(&bitC, &CState2, *--ip);
+
+ if (sizeof(bitC.bitContainer)*8 < FSE_MAX_TABLELOG*2+7 ) /* this test must be static */
+ FSE_FLUSHBITS(&bitC);
+
+ FSE_encodeSymbol(&bitC, &CState1, *--ip);
+
+ if (sizeof(bitC.bitContainer)*8 > FSE_MAX_TABLELOG*4+7 ) { /* this test must be static */
+ FSE_encodeSymbol(&bitC, &CState2, *--ip);
+ FSE_encodeSymbol(&bitC, &CState1, *--ip);
+ }
+
+ FSE_FLUSHBITS(&bitC);
+ }
+
+ FSE_flushCState(&bitC, &CState2);
+ FSE_flushCState(&bitC, &CState1);
+ return BIT_closeCStream(&bitC);
+}
+
+size_t FSE_compress_usingCTable (void* dst, size_t dstSize,
+ const void* src, size_t srcSize,
+ const FSE_CTable* ct)
+{
+ unsigned const fast = (dstSize >= FSE_BLOCKBOUND(srcSize));
+
+ if (fast)
+ return FSE_compress_usingCTable_generic(dst, dstSize, src, srcSize, ct, 1);
+ else
+ return FSE_compress_usingCTable_generic(dst, dstSize, src, srcSize, ct, 0);
+}
+
+
+size_t FSE_compressBound(size_t size) { return FSE_COMPRESSBOUND(size); }
+
+#define CHECK_V_F(e, f) size_t const e = f; if (ERR_isError(e)) return f
+#define CHECK_F(f) { CHECK_V_F(_var_err__, f); }
+
+/* FSE_compress_wksp() :
+ * Same as FSE_compress2(), but using an externally allocated scratch buffer (`workSpace`).
+ * `wkspSize` size must be `(1<<tableLog)`.
+ */
+size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize)
+{
+ BYTE* const ostart = (BYTE*) dst;
+ BYTE* op = ostart;
+ BYTE* const oend = ostart + dstSize;
+
+ U32 count[FSE_MAX_SYMBOL_VALUE+1];
+ S16 norm[FSE_MAX_SYMBOL_VALUE+1];
+ FSE_CTable* CTable = (FSE_CTable*)workSpace;
+ size_t const CTableSize = FSE_CTABLE_SIZE_U32(tableLog, maxSymbolValue);
+ void* scratchBuffer = (void*)(CTable + CTableSize);
+ size_t const scratchBufferSize = wkspSize - (CTableSize * sizeof(FSE_CTable));
+
+ /* init conditions */
+ if (wkspSize < FSE_WKSP_SIZE_U32(tableLog, maxSymbolValue)) return ERROR(tableLog_tooLarge);
+ if (srcSize <= 1) return 0; /* Not compressible */
+ if (!maxSymbolValue) maxSymbolValue = FSE_MAX_SYMBOL_VALUE;
+ if (!tableLog) tableLog = FSE_DEFAULT_TABLELOG;
+
+ /* Scan input and build symbol stats */
+ { CHECK_V_F(maxCount, FSE_count_wksp(count, &maxSymbolValue, src, srcSize, (unsigned*)scratchBuffer) );
+ if (maxCount == srcSize) return 1; /* only a single symbol in src : rle */
+ if (maxCount == 1) return 0; /* each symbol present maximum once => not compressible */
+ if (maxCount < (srcSize >> 7)) return 0; /* Heuristic : not compressible enough */
+ }
+
+ tableLog = FSE_optimalTableLog(tableLog, srcSize, maxSymbolValue);
+ CHECK_F( FSE_normalizeCount(norm, tableLog, count, srcSize, maxSymbolValue) );
+
+ /* Write table description header */
+ { CHECK_V_F(nc_err, FSE_writeNCount(op, oend-op, norm, maxSymbolValue, tableLog) );
+ op += nc_err;
+ }
+
+ /* Compress */
+ CHECK_F( FSE_buildCTable_wksp(CTable, norm, maxSymbolValue, tableLog, scratchBuffer, scratchBufferSize) );
+ { CHECK_V_F(cSize, FSE_compress_usingCTable(op, oend - op, src, srcSize, CTable) );
+ if (cSize == 0) return 0; /* not enough space for compressed data */
+ op += cSize;
+ }
+
+ /* check compressibility */
+ if ( (size_t)(op-ostart) >= srcSize-1 ) return 0;
+
+ return op-ostart;
+}
+
+typedef struct {
+ FSE_CTable CTable_max[FSE_CTABLE_SIZE_U32(FSE_MAX_TABLELOG, FSE_MAX_SYMBOL_VALUE)];
+ BYTE scratchBuffer[1 << FSE_MAX_TABLELOG];
+} fseWkspMax_t;
+
+size_t FSE_compress2 (void* dst, size_t dstCapacity, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog)
+{
+ fseWkspMax_t scratchBuffer;
+ FSE_STATIC_ASSERT(sizeof(scratchBuffer) >= FSE_WKSP_SIZE_U32(FSE_MAX_TABLELOG, FSE_MAX_SYMBOL_VALUE)); /* compilation failures here means scratchBuffer is not large enough */
+ if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
+ return FSE_compress_wksp(dst, dstCapacity, src, srcSize, maxSymbolValue, tableLog, &scratchBuffer, sizeof(scratchBuffer));
+}
+
+size_t FSE_compress (void* dst, size_t dstCapacity, const void* src, size_t srcSize)
+{
+ return FSE_compress2(dst, dstCapacity, src, srcSize, FSE_MAX_SYMBOL_VALUE, FSE_DEFAULT_TABLELOG);
+}
+
+
+#endif /* FSE_COMMONDEFS_ONLY */
diff --git a/thirdparty/zstd/compress/huf_compress.c b/thirdparty/zstd/compress/huf_compress.c
new file mode 100644
index 0000000000..7af0789a9c
--- /dev/null
+++ b/thirdparty/zstd/compress/huf_compress.c
@@ -0,0 +1,688 @@
+/* ******************************************************************
+ Huffman encoder, part of New Generation Entropy library
+ Copyright (C) 2013-2016, Yann Collet.
+
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ You can contact the author at :
+ - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy
+ - Public forum : https://groups.google.com/forum/#!forum/lz4c
+****************************************************************** */
+
+/* **************************************************************
+* Compiler specifics
+****************************************************************/
+#ifdef _MSC_VER /* Visual Studio */
+# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
+#endif
+
+
+/* **************************************************************
+* Includes
+****************************************************************/
+#include <string.h> /* memcpy, memset */
+#include <stdio.h> /* printf (debug) */
+#include "bitstream.h"
+#define FSE_STATIC_LINKING_ONLY /* FSE_optimalTableLog_internal */
+#include "fse.h" /* header compression */
+#define HUF_STATIC_LINKING_ONLY
+#include "huf.h"
+
+
+/* **************************************************************
+* Error Management
+****************************************************************/
+#define HUF_STATIC_ASSERT(c) { enum { HUF_static_assert = 1/(int)(!!(c)) }; } /* use only *after* variable declarations */
+#define CHECK_V_F(e, f) size_t const e = f; if (ERR_isError(e)) return f
+#define CHECK_F(f) { CHECK_V_F(_var_err__, f); }
+
+
+/* **************************************************************
+* Utils
+****************************************************************/
+unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue)
+{
+ return FSE_optimalTableLog_internal(maxTableLog, srcSize, maxSymbolValue, 1);
+}
+
+
+/* *******************************************************
+* HUF : Huffman block compression
+*********************************************************/
+/* HUF_compressWeights() :
+ * Same as FSE_compress(), but dedicated to huff0's weights compression.
+ * The use case needs much less stack memory.
+ * Note : all elements within weightTable are supposed to be <= HUF_TABLELOG_MAX.
+ */
+#define MAX_FSE_TABLELOG_FOR_HUFF_HEADER 6
+size_t HUF_compressWeights (void* dst, size_t dstSize, const void* weightTable, size_t wtSize)
+{
+ BYTE* const ostart = (BYTE*) dst;
+ BYTE* op = ostart;
+ BYTE* const oend = ostart + dstSize;
+
+ U32 maxSymbolValue = HUF_TABLELOG_MAX;
+ U32 tableLog = MAX_FSE_TABLELOG_FOR_HUFF_HEADER;
+
+ FSE_CTable CTable[FSE_CTABLE_SIZE_U32(MAX_FSE_TABLELOG_FOR_HUFF_HEADER, HUF_TABLELOG_MAX)];
+ BYTE scratchBuffer[1<<MAX_FSE_TABLELOG_FOR_HUFF_HEADER];
+
+ U32 count[HUF_TABLELOG_MAX+1];
+ S16 norm[HUF_TABLELOG_MAX+1];
+
+ /* init conditions */
+ if (wtSize <= 1) return 0; /* Not compressible */
+
+ /* Scan input and build symbol stats */
+ { CHECK_V_F(maxCount, FSE_count_simple(count, &maxSymbolValue, weightTable, wtSize) );
+ if (maxCount == wtSize) return 1; /* only a single symbol in src : rle */
+ if (maxCount == 1) return 0; /* each symbol present maximum once => not compressible */
+ }
+
+ tableLog = FSE_optimalTableLog(tableLog, wtSize, maxSymbolValue);
+ CHECK_F( FSE_normalizeCount(norm, tableLog, count, wtSize, maxSymbolValue) );
+
+ /* Write table description header */
+ { CHECK_V_F(hSize, FSE_writeNCount(op, oend-op, norm, maxSymbolValue, tableLog) );
+ op += hSize;
+ }
+
+ /* Compress */
+ CHECK_F( FSE_buildCTable_wksp(CTable, norm, maxSymbolValue, tableLog, scratchBuffer, sizeof(scratchBuffer)) );
+ { CHECK_V_F(cSize, FSE_compress_usingCTable(op, oend - op, weightTable, wtSize, CTable) );
+ if (cSize == 0) return 0; /* not enough space for compressed data */
+ op += cSize;
+ }
+
+ return op-ostart;
+}
+
+
+struct HUF_CElt_s {
+ U16 val;
+ BYTE nbBits;
+}; /* typedef'd to HUF_CElt within "huf.h" */
+
+/*! HUF_writeCTable() :
+ `CTable` : Huffman tree to save, using huf representation.
+ @return : size of saved CTable */
+size_t HUF_writeCTable (void* dst, size_t maxDstSize,
+ const HUF_CElt* CTable, U32 maxSymbolValue, U32 huffLog)
+{
+ BYTE bitsToWeight[HUF_TABLELOG_MAX + 1]; /* precomputed conversion table */
+ BYTE huffWeight[HUF_SYMBOLVALUE_MAX];
+ BYTE* op = (BYTE*)dst;
+ U32 n;
+
+ /* check conditions */
+ if (maxSymbolValue > HUF_SYMBOLVALUE_MAX) return ERROR(maxSymbolValue_tooLarge);
+
+ /* convert to weight */
+ bitsToWeight[0] = 0;
+ for (n=1; n<huffLog+1; n++)
+ bitsToWeight[n] = (BYTE)(huffLog + 1 - n);
+ for (n=0; n<maxSymbolValue; n++)
+ huffWeight[n] = bitsToWeight[CTable[n].nbBits];
+
+ /* attempt weights compression by FSE */
+ { CHECK_V_F(hSize, HUF_compressWeights(op+1, maxDstSize-1, huffWeight, maxSymbolValue) );
+ if ((hSize>1) & (hSize < maxSymbolValue/2)) { /* FSE compressed */
+ op[0] = (BYTE)hSize;
+ return hSize+1;
+ } }
+
+ /* write raw values as 4-bits (max : 15) */
+ if (maxSymbolValue > (256-128)) return ERROR(GENERIC); /* should not happen : likely means source cannot be compressed */
+ if (((maxSymbolValue+1)/2) + 1 > maxDstSize) return ERROR(dstSize_tooSmall); /* not enough space within dst buffer */
+ op[0] = (BYTE)(128 /*special case*/ + (maxSymbolValue-1));
+ huffWeight[maxSymbolValue] = 0; /* to be sure it doesn't cause msan issue in final combination */
+ for (n=0; n<maxSymbolValue; n+=2)
+ op[(n/2)+1] = (BYTE)((huffWeight[n] << 4) + huffWeight[n+1]);
+ return ((maxSymbolValue+1)/2) + 1;
+}
+
+
+size_t HUF_readCTable (HUF_CElt* CTable, U32 maxSymbolValue, const void* src, size_t srcSize)
+{
+ BYTE huffWeight[HUF_SYMBOLVALUE_MAX + 1]; /* init not required, even though some static analyzer may complain */
+ U32 rankVal[HUF_TABLELOG_ABSOLUTEMAX + 1]; /* large enough for values from 0 to 16 */
+ U32 tableLog = 0;
+ U32 nbSymbols = 0;
+
+ /* get symbol weights */
+ CHECK_V_F(readSize, HUF_readStats(huffWeight, HUF_SYMBOLVALUE_MAX+1, rankVal, &nbSymbols, &tableLog, src, srcSize));
+
+ /* check result */
+ if (tableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge);
+ if (nbSymbols > maxSymbolValue+1) return ERROR(maxSymbolValue_tooSmall);
+
+ /* Prepare base value per rank */
+ { U32 n, nextRankStart = 0;
+ for (n=1; n<=tableLog; n++) {
+ U32 current = nextRankStart;
+ nextRankStart += (rankVal[n] << (n-1));
+ rankVal[n] = current;
+ } }
+
+ /* fill nbBits */
+ { U32 n; for (n=0; n<nbSymbols; n++) {
+ const U32 w = huffWeight[n];
+ CTable[n].nbBits = (BYTE)(tableLog + 1 - w);
+ } }
+
+ /* fill val */
+ { U16 nbPerRank[HUF_TABLELOG_MAX+2] = {0}; /* support w=0=>n=tableLog+1 */
+ U16 valPerRank[HUF_TABLELOG_MAX+2] = {0};
+ { U32 n; for (n=0; n<nbSymbols; n++) nbPerRank[CTable[n].nbBits]++; }
+ /* determine stating value per rank */
+ valPerRank[tableLog+1] = 0; /* for w==0 */
+ { U16 min = 0;
+ U32 n; for (n=tableLog; n>0; n--) { /* start at n=tablelog <-> w=1 */
+ valPerRank[n] = min; /* get starting value within each rank */
+ min += nbPerRank[n];
+ min >>= 1;
+ } }
+ /* assign value within rank, symbol order */
+ { U32 n; for (n=0; n<=maxSymbolValue; n++) CTable[n].val = valPerRank[CTable[n].nbBits]++; }
+ }
+
+ return readSize;
+}
+
+
+typedef struct nodeElt_s {
+ U32 count;
+ U16 parent;
+ BYTE byte;
+ BYTE nbBits;
+} nodeElt;
+
+static U32 HUF_setMaxHeight(nodeElt* huffNode, U32 lastNonNull, U32 maxNbBits)
+{
+ const U32 largestBits = huffNode[lastNonNull].nbBits;
+ if (largestBits <= maxNbBits) return largestBits; /* early exit : no elt > maxNbBits */
+
+ /* there are several too large elements (at least >= 2) */
+ { int totalCost = 0;
+ const U32 baseCost = 1 << (largestBits - maxNbBits);
+ U32 n = lastNonNull;
+
+ while (huffNode[n].nbBits > maxNbBits) {
+ totalCost += baseCost - (1 << (largestBits - huffNode[n].nbBits));
+ huffNode[n].nbBits = (BYTE)maxNbBits;
+ n --;
+ } /* n stops at huffNode[n].nbBits <= maxNbBits */
+ while (huffNode[n].nbBits == maxNbBits) n--; /* n end at index of smallest symbol using < maxNbBits */
+
+ /* renorm totalCost */
+ totalCost >>= (largestBits - maxNbBits); /* note : totalCost is necessarily a multiple of baseCost */
+
+ /* repay normalized cost */
+ { U32 const noSymbol = 0xF0F0F0F0;
+ U32 rankLast[HUF_TABLELOG_MAX+2];
+ int pos;
+
+ /* Get pos of last (smallest) symbol per rank */
+ memset(rankLast, 0xF0, sizeof(rankLast));
+ { U32 currentNbBits = maxNbBits;
+ for (pos=n ; pos >= 0; pos--) {
+ if (huffNode[pos].nbBits >= currentNbBits) continue;
+ currentNbBits = huffNode[pos].nbBits; /* < maxNbBits */
+ rankLast[maxNbBits-currentNbBits] = pos;
+ } }
+
+ while (totalCost > 0) {
+ U32 nBitsToDecrease = BIT_highbit32(totalCost) + 1;
+ for ( ; nBitsToDecrease > 1; nBitsToDecrease--) {
+ U32 highPos = rankLast[nBitsToDecrease];
+ U32 lowPos = rankLast[nBitsToDecrease-1];
+ if (highPos == noSymbol) continue;
+ if (lowPos == noSymbol) break;
+ { U32 const highTotal = huffNode[highPos].count;
+ U32 const lowTotal = 2 * huffNode[lowPos].count;
+ if (highTotal <= lowTotal) break;
+ } }
+ /* only triggered when no more rank 1 symbol left => find closest one (note : there is necessarily at least one !) */
+ /* HUF_MAX_TABLELOG test just to please gcc 5+; but it should not be necessary */
+ while ((nBitsToDecrease<=HUF_TABLELOG_MAX) && (rankLast[nBitsToDecrease] == noSymbol))
+ nBitsToDecrease ++;
+ totalCost -= 1 << (nBitsToDecrease-1);
+ if (rankLast[nBitsToDecrease-1] == noSymbol)
+ rankLast[nBitsToDecrease-1] = rankLast[nBitsToDecrease]; /* this rank is no longer empty */
+ huffNode[rankLast[nBitsToDecrease]].nbBits ++;
+ if (rankLast[nBitsToDecrease] == 0) /* special case, reached largest symbol */
+ rankLast[nBitsToDecrease] = noSymbol;
+ else {
+ rankLast[nBitsToDecrease]--;
+ if (huffNode[rankLast[nBitsToDecrease]].nbBits != maxNbBits-nBitsToDecrease)
+ rankLast[nBitsToDecrease] = noSymbol; /* this rank is now empty */
+ } } /* while (totalCost > 0) */
+
+ while (totalCost < 0) { /* Sometimes, cost correction overshoot */
+ if (rankLast[1] == noSymbol) { /* special case : no rank 1 symbol (using maxNbBits-1); let's create one from largest rank 0 (using maxNbBits) */
+ while (huffNode[n].nbBits == maxNbBits) n--;
+ huffNode[n+1].nbBits--;
+ rankLast[1] = n+1;
+ totalCost++;
+ continue;
+ }
+ huffNode[ rankLast[1] + 1 ].nbBits--;
+ rankLast[1]++;
+ totalCost ++;
+ } } } /* there are several too large elements (at least >= 2) */
+
+ return maxNbBits;
+}
+
+
+typedef struct {
+ U32 base;
+ U32 current;
+} rankPos;
+
+static void HUF_sort(nodeElt* huffNode, const U32* count, U32 maxSymbolValue)
+{
+ rankPos rank[32];
+ U32 n;
+
+ memset(rank, 0, sizeof(rank));
+ for (n=0; n<=maxSymbolValue; n++) {
+ U32 r = BIT_highbit32(count[n] + 1);
+ rank[r].base ++;
+ }
+ for (n=30; n>0; n--) rank[n-1].base += rank[n].base;
+ for (n=0; n<32; n++) rank[n].current = rank[n].base;
+ for (n=0; n<=maxSymbolValue; n++) {
+ U32 const c = count[n];
+ U32 const r = BIT_highbit32(c+1) + 1;
+ U32 pos = rank[r].current++;
+ while ((pos > rank[r].base) && (c > huffNode[pos-1].count)) huffNode[pos]=huffNode[pos-1], pos--;
+ huffNode[pos].count = c;
+ huffNode[pos].byte = (BYTE)n;
+ }
+}
+
+
+/** HUF_buildCTable_wksp() :
+ * Same as HUF_buildCTable(), but using externally allocated scratch buffer.
+ * `workSpace` must be aligned on 4-bytes boundaries, and be at least as large as a table of 1024 unsigned.
+ */
+#define STARTNODE (HUF_SYMBOLVALUE_MAX+1)
+typedef nodeElt huffNodeTable[2*HUF_SYMBOLVALUE_MAX+1 +1];
+size_t HUF_buildCTable_wksp (HUF_CElt* tree, const U32* count, U32 maxSymbolValue, U32 maxNbBits, void* workSpace, size_t wkspSize)
+{
+ nodeElt* const huffNode0 = (nodeElt*)workSpace;
+ nodeElt* const huffNode = huffNode0+1;
+ U32 n, nonNullRank;
+ int lowS, lowN;
+ U16 nodeNb = STARTNODE;
+ U32 nodeRoot;
+
+ /* safety checks */
+ if (wkspSize < sizeof(huffNodeTable)) return ERROR(GENERIC); /* workSpace is not large enough */
+ if (maxNbBits == 0) maxNbBits = HUF_TABLELOG_DEFAULT;
+ if (maxSymbolValue > HUF_SYMBOLVALUE_MAX) return ERROR(GENERIC);
+ memset(huffNode0, 0, sizeof(huffNodeTable));
+
+ /* sort, decreasing order */
+ HUF_sort(huffNode, count, maxSymbolValue);
+
+ /* init for parents */
+ nonNullRank = maxSymbolValue;
+ while(huffNode[nonNullRank].count == 0) nonNullRank--;
+ lowS = nonNullRank; nodeRoot = nodeNb + lowS - 1; lowN = nodeNb;
+ huffNode[nodeNb].count = huffNode[lowS].count + huffNode[lowS-1].count;
+ huffNode[lowS].parent = huffNode[lowS-1].parent = nodeNb;
+ nodeNb++; lowS-=2;
+ for (n=nodeNb; n<=nodeRoot; n++) huffNode[n].count = (U32)(1U<<30);
+ huffNode0[0].count = (U32)(1U<<31); /* fake entry, strong barrier */
+
+ /* create parents */
+ while (nodeNb <= nodeRoot) {
+ U32 n1 = (huffNode[lowS].count < huffNode[lowN].count) ? lowS-- : lowN++;
+ U32 n2 = (huffNode[lowS].count < huffNode[lowN].count) ? lowS-- : lowN++;
+ huffNode[nodeNb].count = huffNode[n1].count + huffNode[n2].count;
+ huffNode[n1].parent = huffNode[n2].parent = nodeNb;
+ nodeNb++;
+ }
+
+ /* distribute weights (unlimited tree height) */
+ huffNode[nodeRoot].nbBits = 0;
+ for (n=nodeRoot-1; n>=STARTNODE; n--)
+ huffNode[n].nbBits = huffNode[ huffNode[n].parent ].nbBits + 1;
+ for (n=0; n<=nonNullRank; n++)
+ huffNode[n].nbBits = huffNode[ huffNode[n].parent ].nbBits + 1;
+
+ /* enforce maxTableLog */
+ maxNbBits = HUF_setMaxHeight(huffNode, nonNullRank, maxNbBits);
+
+ /* fill result into tree (val, nbBits) */
+ { U16 nbPerRank[HUF_TABLELOG_MAX+1] = {0};
+ U16 valPerRank[HUF_TABLELOG_MAX+1] = {0};
+ if (maxNbBits > HUF_TABLELOG_MAX) return ERROR(GENERIC); /* check fit into table */
+ for (n=0; n<=nonNullRank; n++)
+ nbPerRank[huffNode[n].nbBits]++;
+ /* determine stating value per rank */
+ { U16 min = 0;
+ for (n=maxNbBits; n>0; n--) {
+ valPerRank[n] = min; /* get starting value within each rank */
+ min += nbPerRank[n];
+ min >>= 1;
+ } }
+ for (n=0; n<=maxSymbolValue; n++)
+ tree[huffNode[n].byte].nbBits = huffNode[n].nbBits; /* push nbBits per symbol, symbol order */
+ for (n=0; n<=maxSymbolValue; n++)
+ tree[n].val = valPerRank[tree[n].nbBits]++; /* assign value within rank, symbol order */
+ }
+
+ return maxNbBits;
+}
+
+/** HUF_buildCTable() :
+ * Note : count is used before tree is written, so they can safely overlap
+ */
+size_t HUF_buildCTable (HUF_CElt* tree, const U32* count, U32 maxSymbolValue, U32 maxNbBits)
+{
+ huffNodeTable nodeTable;
+ return HUF_buildCTable_wksp(tree, count, maxSymbolValue, maxNbBits, nodeTable, sizeof(nodeTable));
+}
+
+static size_t HUF_estimateCompressedSize(HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue)
+{
+ size_t nbBits = 0;
+ int s;
+ for (s = 0; s <= (int)maxSymbolValue; ++s) {
+ nbBits += CTable[s].nbBits * count[s];
+ }
+ return nbBits >> 3;
+}
+
+static int HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue) {
+ int bad = 0;
+ int s;
+ for (s = 0; s <= (int)maxSymbolValue; ++s) {
+ bad |= (count[s] != 0) & (CTable[s].nbBits == 0);
+ }
+ return !bad;
+}
+
+static void HUF_encodeSymbol(BIT_CStream_t* bitCPtr, U32 symbol, const HUF_CElt* CTable)
+{
+ BIT_addBitsFast(bitCPtr, CTable[symbol].val, CTable[symbol].nbBits);
+}
+
+size_t HUF_compressBound(size_t size) { return HUF_COMPRESSBOUND(size); }
+
+#define HUF_FLUSHBITS(s) (fast ? BIT_flushBitsFast(s) : BIT_flushBits(s))
+
+#define HUF_FLUSHBITS_1(stream) \
+ if (sizeof((stream)->bitContainer)*8 < HUF_TABLELOG_MAX*2+7) HUF_FLUSHBITS(stream)
+
+#define HUF_FLUSHBITS_2(stream) \
+ if (sizeof((stream)->bitContainer)*8 < HUF_TABLELOG_MAX*4+7) HUF_FLUSHBITS(stream)
+
+size_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable)
+{
+ const BYTE* ip = (const BYTE*) src;
+ BYTE* const ostart = (BYTE*)dst;
+ BYTE* const oend = ostart + dstSize;
+ BYTE* op = ostart;
+ size_t n;
+ const unsigned fast = (dstSize >= HUF_BLOCKBOUND(srcSize));
+ BIT_CStream_t bitC;
+
+ /* init */
+ if (dstSize < 8) return 0; /* not enough space to compress */
+ { size_t const initErr = BIT_initCStream(&bitC, op, oend-op);
+ if (HUF_isError(initErr)) return 0; }
+
+ n = srcSize & ~3; /* join to mod 4 */
+ switch (srcSize & 3)
+ {
+ case 3 : HUF_encodeSymbol(&bitC, ip[n+ 2], CTable);
+ HUF_FLUSHBITS_2(&bitC);
+ /* fall-through */
+ case 2 : HUF_encodeSymbol(&bitC, ip[n+ 1], CTable);
+ HUF_FLUSHBITS_1(&bitC);
+ /* fall-through */
+ case 1 : HUF_encodeSymbol(&bitC, ip[n+ 0], CTable);
+ HUF_FLUSHBITS(&bitC);
+ /* fall-through */
+ case 0 : /* fall-through */
+ default: break;
+ }
+
+ for (; n>0; n-=4) { /* note : n&3==0 at this stage */
+ HUF_encodeSymbol(&bitC, ip[n- 1], CTable);
+ HUF_FLUSHBITS_1(&bitC);
+ HUF_encodeSymbol(&bitC, ip[n- 2], CTable);
+ HUF_FLUSHBITS_2(&bitC);
+ HUF_encodeSymbol(&bitC, ip[n- 3], CTable);
+ HUF_FLUSHBITS_1(&bitC);
+ HUF_encodeSymbol(&bitC, ip[n- 4], CTable);
+ HUF_FLUSHBITS(&bitC);
+ }
+
+ return BIT_closeCStream(&bitC);
+}
+
+
+size_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable)
+{
+ size_t const segmentSize = (srcSize+3)/4; /* first 3 segments */
+ const BYTE* ip = (const BYTE*) src;
+ const BYTE* const iend = ip + srcSize;
+ BYTE* const ostart = (BYTE*) dst;
+ BYTE* const oend = ostart + dstSize;
+ BYTE* op = ostart;
+
+ if (dstSize < 6 + 1 + 1 + 1 + 8) return 0; /* minimum space to compress successfully */
+ if (srcSize < 12) return 0; /* no saving possible : too small input */
+ op += 6; /* jumpTable */
+
+ { CHECK_V_F(cSize, HUF_compress1X_usingCTable(op, oend-op, ip, segmentSize, CTable) );
+ if (cSize==0) return 0;
+ MEM_writeLE16(ostart, (U16)cSize);
+ op += cSize;
+ }
+
+ ip += segmentSize;
+ { CHECK_V_F(cSize, HUF_compress1X_usingCTable(op, oend-op, ip, segmentSize, CTable) );
+ if (cSize==0) return 0;
+ MEM_writeLE16(ostart+2, (U16)cSize);
+ op += cSize;
+ }
+
+ ip += segmentSize;
+ { CHECK_V_F(cSize, HUF_compress1X_usingCTable(op, oend-op, ip, segmentSize, CTable) );
+ if (cSize==0) return 0;
+ MEM_writeLE16(ostart+4, (U16)cSize);
+ op += cSize;
+ }
+
+ ip += segmentSize;
+ { CHECK_V_F(cSize, HUF_compress1X_usingCTable(op, oend-op, ip, iend-ip, CTable) );
+ if (cSize==0) return 0;
+ op += cSize;
+ }
+
+ return op-ostart;
+}
+
+
+static size_t HUF_compressCTable_internal(
+ BYTE* const ostart, BYTE* op, BYTE* const oend,
+ const void* src, size_t srcSize,
+ unsigned singleStream, const HUF_CElt* CTable)
+{
+ size_t const cSize = singleStream ?
+ HUF_compress1X_usingCTable(op, oend - op, src, srcSize, CTable) :
+ HUF_compress4X_usingCTable(op, oend - op, src, srcSize, CTable);
+ if (HUF_isError(cSize)) { return cSize; }
+ if (cSize==0) { return 0; } /* uncompressible */
+ op += cSize;
+ /* check compressibility */
+ if ((size_t)(op-ostart) >= srcSize-1) { return 0; }
+ return op-ostart;
+}
+
+
+/* `workSpace` must a table of at least 1024 unsigned */
+static size_t HUF_compress_internal (
+ void* dst, size_t dstSize,
+ const void* src, size_t srcSize,
+ unsigned maxSymbolValue, unsigned huffLog,
+ unsigned singleStream,
+ void* workSpace, size_t wkspSize,
+ HUF_CElt* oldHufTable, HUF_repeat* repeat, int preferRepeat)
+{
+ BYTE* const ostart = (BYTE*)dst;
+ BYTE* const oend = ostart + dstSize;
+ BYTE* op = ostart;
+
+ U32* count;
+ size_t const countSize = sizeof(U32) * (HUF_SYMBOLVALUE_MAX + 1);
+ HUF_CElt* CTable;
+ size_t const CTableSize = sizeof(HUF_CElt) * (HUF_SYMBOLVALUE_MAX + 1);
+
+ /* checks & inits */
+ if (wkspSize < sizeof(huffNodeTable) + countSize + CTableSize) return ERROR(GENERIC);
+ if (!srcSize) return 0; /* Uncompressed (note : 1 means rle, so first byte must be correct) */
+ if (!dstSize) return 0; /* cannot fit within dst budget */
+ if (srcSize > HUF_BLOCKSIZE_MAX) return ERROR(srcSize_wrong); /* current block size limit */
+ if (huffLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge);
+ if (!maxSymbolValue) maxSymbolValue = HUF_SYMBOLVALUE_MAX;
+ if (!huffLog) huffLog = HUF_TABLELOG_DEFAULT;
+
+ count = (U32*)workSpace;
+ workSpace = (BYTE*)workSpace + countSize;
+ wkspSize -= countSize;
+ CTable = (HUF_CElt*)workSpace;
+ workSpace = (BYTE*)workSpace + CTableSize;
+ wkspSize -= CTableSize;
+
+ /* Heuristic : If we don't need to check the validity of the old table use the old table for small inputs */
+ if (preferRepeat && repeat && *repeat == HUF_repeat_valid) {
+ return HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, oldHufTable);
+ }
+
+ /* Scan input and build symbol stats */
+ { CHECK_V_F(largest, FSE_count_wksp (count, &maxSymbolValue, (const BYTE*)src, srcSize, (U32*)workSpace) );
+ if (largest == srcSize) { *ostart = ((const BYTE*)src)[0]; return 1; } /* single symbol, rle */
+ if (largest <= (srcSize >> 7)+1) return 0; /* Fast heuristic : not compressible enough */
+ }
+
+ /* Check validity of previous table */
+ if (repeat && *repeat == HUF_repeat_check && !HUF_validateCTable(oldHufTable, count, maxSymbolValue)) {
+ *repeat = HUF_repeat_none;
+ }
+ /* Heuristic : use existing table for small inputs */
+ if (preferRepeat && repeat && *repeat != HUF_repeat_none) {
+ return HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, oldHufTable);
+ }
+
+ /* Build Huffman Tree */
+ huffLog = HUF_optimalTableLog(huffLog, srcSize, maxSymbolValue);
+ { CHECK_V_F(maxBits, HUF_buildCTable_wksp (CTable, count, maxSymbolValue, huffLog, workSpace, wkspSize) );
+ huffLog = (U32)maxBits;
+ /* Zero the unused symbols so we can check it for validity */
+ memset(CTable + maxSymbolValue + 1, 0, CTableSize - (maxSymbolValue + 1) * sizeof(HUF_CElt));
+ }
+
+ /* Write table description header */
+ { CHECK_V_F(hSize, HUF_writeCTable (op, dstSize, CTable, maxSymbolValue, huffLog) );
+ /* Check if using the previous table will be beneficial */
+ if (repeat && *repeat != HUF_repeat_none) {
+ size_t const oldSize = HUF_estimateCompressedSize(oldHufTable, count, maxSymbolValue);
+ size_t const newSize = HUF_estimateCompressedSize(CTable, count, maxSymbolValue);
+ if (oldSize <= hSize + newSize || hSize + 12 >= srcSize) {
+ return HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, oldHufTable);
+ }
+ }
+ /* Use the new table */
+ if (hSize + 12ul >= srcSize) { return 0; }
+ op += hSize;
+ if (repeat) { *repeat = HUF_repeat_none; }
+ if (oldHufTable) { memcpy(oldHufTable, CTable, CTableSize); } /* Save the new table */
+ }
+ return HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, CTable);
+}
+
+
+size_t HUF_compress1X_wksp (void* dst, size_t dstSize,
+ const void* src, size_t srcSize,
+ unsigned maxSymbolValue, unsigned huffLog,
+ void* workSpace, size_t wkspSize)
+{
+ return HUF_compress_internal(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, 1 /* single stream */, workSpace, wkspSize, NULL, NULL, 0);
+}
+
+size_t HUF_compress1X_repeat (void* dst, size_t dstSize,
+ const void* src, size_t srcSize,
+ unsigned maxSymbolValue, unsigned huffLog,
+ void* workSpace, size_t wkspSize,
+ HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat)
+{
+ return HUF_compress_internal(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, 1 /* single stream */, workSpace, wkspSize, hufTable, repeat, preferRepeat);
+}
+
+size_t HUF_compress1X (void* dst, size_t dstSize,
+ const void* src, size_t srcSize,
+ unsigned maxSymbolValue, unsigned huffLog)
+{
+ unsigned workSpace[1024];
+ return HUF_compress1X_wksp(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, workSpace, sizeof(workSpace));
+}
+
+size_t HUF_compress4X_wksp (void* dst, size_t dstSize,
+ const void* src, size_t srcSize,
+ unsigned maxSymbolValue, unsigned huffLog,
+ void* workSpace, size_t wkspSize)
+{
+ return HUF_compress_internal(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, 0 /* 4 streams */, workSpace, wkspSize, NULL, NULL, 0);
+}
+
+size_t HUF_compress4X_repeat (void* dst, size_t dstSize,
+ const void* src, size_t srcSize,
+ unsigned maxSymbolValue, unsigned huffLog,
+ void* workSpace, size_t wkspSize,
+ HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat)
+{
+ return HUF_compress_internal(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, 0 /* 4 streams */, workSpace, wkspSize, hufTable, repeat, preferRepeat);
+}
+
+size_t HUF_compress2 (void* dst, size_t dstSize,
+ const void* src, size_t srcSize,
+ unsigned maxSymbolValue, unsigned huffLog)
+{
+ unsigned workSpace[1024];
+ return HUF_compress4X_wksp(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, workSpace, sizeof(workSpace));
+}
+
+size_t HUF_compress (void* dst, size_t maxDstSize, const void* src, size_t srcSize)
+{
+ return HUF_compress2(dst, maxDstSize, src, (U32)srcSize, 255, HUF_TABLELOG_DEFAULT);
+}
diff --git a/thirdparty/zstd/compress/zstd_compress.c b/thirdparty/zstd/compress/zstd_compress.c
new file mode 100644
index 0000000000..9300357f2d
--- /dev/null
+++ b/thirdparty/zstd/compress/zstd_compress.c
@@ -0,0 +1,4193 @@
+/**
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+
+/*-*************************************
+* Tuning parameters
+***************************************/
+#ifndef ZSTD_CLEVEL_DEFAULT
+# define ZSTD_CLEVEL_DEFAULT 3
+#endif
+
+
+/*-*************************************
+* Dependencies
+***************************************/
+#include <string.h> /* memset */
+#include "mem.h"
+#define FSE_STATIC_LINKING_ONLY /* FSE_encodeSymbol */
+#include "fse.h"
+#define HUF_STATIC_LINKING_ONLY
+#include "huf.h"
+#include "zstd_internal.h" /* includes zstd.h */
+#include "zstdmt_compress.h"
+
+
+/*-*************************************
+* Constants
+***************************************/
+static const U32 g_searchStrength = 8; /* control skip over incompressible data */
+#define HASH_READ_SIZE 8
+typedef enum { ZSTDcs_created=0, ZSTDcs_init, ZSTDcs_ongoing, ZSTDcs_ending } ZSTD_compressionStage_e;
+
+/* entropy tables always have same size */
+static size_t const hufCTable_size = HUF_CTABLE_SIZE(255);
+static size_t const litlengthCTable_size = FSE_CTABLE_SIZE(LLFSELog, MaxLL);
+static size_t const offcodeCTable_size = FSE_CTABLE_SIZE(OffFSELog, MaxOff);
+static size_t const matchlengthCTable_size = FSE_CTABLE_SIZE(MLFSELog, MaxML);
+static size_t const entropyScratchSpace_size = HUF_WORKSPACE_SIZE;
+
+
+/*-*************************************
+* Helper functions
+***************************************/
+size_t ZSTD_compressBound(size_t srcSize) {
+ size_t const lowLimit = 256 KB;
+ size_t const margin = (srcSize < lowLimit) ? (lowLimit-srcSize) >> 12 : 0; /* from 64 to 0 */
+ return srcSize + (srcSize >> 8) + margin;
+}
+
+
+/*-*************************************
+* Sequence storage
+***************************************/
+static void ZSTD_resetSeqStore(seqStore_t* ssPtr)
+{
+ ssPtr->lit = ssPtr->litStart;
+ ssPtr->sequences = ssPtr->sequencesStart;
+ ssPtr->longLengthID = 0;
+}
+
+
+/*-*************************************
+* Context memory management
+***************************************/
+typedef enum { zcss_init=0, zcss_load, zcss_flush } ZSTD_cStreamStage;
+
+struct ZSTD_CDict_s {
+ void* dictBuffer;
+ const void* dictContent;
+ size_t dictContentSize;
+ ZSTD_CCtx* refContext;
+}; /* typedef'd to ZSTD_CDict within "zstd.h" */
+
+struct ZSTD_CCtx_s {
+ const BYTE* nextSrc; /* next block here to continue on current prefix */
+ const BYTE* base; /* All regular indexes relative to this position */
+ const BYTE* dictBase; /* extDict indexes relative to this position */
+ U32 dictLimit; /* below that point, need extDict */
+ U32 lowLimit; /* below that point, no more data */
+ U32 nextToUpdate; /* index from which to continue dictionary update */
+ U32 nextToUpdate3; /* index from which to continue dictionary update */
+ U32 hashLog3; /* dispatch table : larger == faster, more memory */
+ U32 loadedDictEnd; /* index of end of dictionary */
+ U32 forceWindow; /* force back-references to respect limit of 1<<wLog, even for dictionary */
+ ZSTD_compressionStage_e stage;
+ U32 rep[ZSTD_REP_NUM];
+ U32 repToConfirm[ZSTD_REP_NUM];
+ U32 dictID;
+ int compressionLevel;
+ ZSTD_parameters requestedParams;
+ ZSTD_parameters appliedParams;
+ void* workSpace;
+ size_t workSpaceSize;
+ size_t blockSize;
+ U64 pledgedSrcSizePlusOne; /* this way, 0 (default) == unknown */
+ U64 consumedSrcSize;
+ XXH64_state_t xxhState;
+ ZSTD_customMem customMem;
+ size_t staticSize;
+
+ seqStore_t seqStore; /* sequences storage ptrs */
+ U32* hashTable;
+ U32* hashTable3;
+ U32* chainTable;
+ HUF_repeat hufCTable_repeatMode;
+ HUF_CElt* hufCTable;
+ U32 fseCTables_ready;
+ FSE_CTable* offcodeCTable;
+ FSE_CTable* matchlengthCTable;
+ FSE_CTable* litlengthCTable;
+ unsigned* entropyScratchSpace;
+
+ /* streaming */
+ char* inBuff;
+ size_t inBuffSize;
+ size_t inToCompress;
+ size_t inBuffPos;
+ size_t inBuffTarget;
+ char* outBuff;
+ size_t outBuffSize;
+ size_t outBuffContentSize;
+ size_t outBuffFlushedSize;
+ ZSTD_cStreamStage streamStage;
+ U32 frameEnded;
+
+ /* Dictionary */
+ ZSTD_dictMode_e dictMode; /* select restricting dictionary to "rawContent" or "fullDict" only */
+ U32 dictContentByRef;
+ ZSTD_CDict* cdictLocal;
+ const ZSTD_CDict* cdict;
+ const void* prefix;
+ size_t prefixSize;
+
+ /* Multi-threading */
+ U32 nbThreads;
+ ZSTDMT_CCtx* mtctx;
+};
+
+
+ZSTD_CCtx* ZSTD_createCCtx(void)
+{
+ return ZSTD_createCCtx_advanced(ZSTD_defaultCMem);
+}
+
+ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem)
+{
+ ZSTD_CCtx* cctx;
+
+ if (!customMem.customAlloc ^ !customMem.customFree) return NULL;
+
+ cctx = (ZSTD_CCtx*) ZSTD_calloc(sizeof(ZSTD_CCtx), customMem);
+ if (!cctx) return NULL;
+ cctx->customMem = customMem;
+ cctx->compressionLevel = ZSTD_CLEVEL_DEFAULT;
+ ZSTD_STATIC_ASSERT(zcss_init==0);
+ ZSTD_STATIC_ASSERT(ZSTD_CONTENTSIZE_UNKNOWN==(0ULL - 1));
+ return cctx;
+}
+
+ZSTD_CCtx* ZSTD_initStaticCCtx(void *workspace, size_t workspaceSize)
+{
+ ZSTD_CCtx* cctx = (ZSTD_CCtx*) workspace;
+ if (workspaceSize <= sizeof(ZSTD_CCtx)) return NULL; /* minimum size */
+ if ((size_t)workspace & 7) return NULL; /* must be 8-aligned */
+ memset(workspace, 0, workspaceSize); /* may be a bit generous, could memset be smaller ? */
+ cctx->staticSize = workspaceSize;
+ cctx->workSpace = (void*)(cctx+1);
+ cctx->workSpaceSize = workspaceSize - sizeof(ZSTD_CCtx);
+
+ /* entropy space (never moves) */
+ /* note : this code should be shared with resetCCtx, rather than copy/pasted */
+ { void* ptr = cctx->workSpace;
+ cctx->hufCTable = (HUF_CElt*)ptr;
+ ptr = (char*)cctx->hufCTable + hufCTable_size;
+ cctx->offcodeCTable = (FSE_CTable*) ptr;
+ ptr = (char*)ptr + offcodeCTable_size;
+ cctx->matchlengthCTable = (FSE_CTable*) ptr;
+ ptr = (char*)ptr + matchlengthCTable_size;
+ cctx->litlengthCTable = (FSE_CTable*) ptr;
+ ptr = (char*)ptr + litlengthCTable_size;
+ assert(((size_t)ptr & 3) == 0); /* ensure correct alignment */
+ cctx->entropyScratchSpace = (unsigned*) ptr;
+ }
+
+ return cctx;
+}
+
+size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx)
+{
+ if (cctx==NULL) return 0; /* support free on NULL */
+ if (cctx->staticSize) return ERROR(memory_allocation); /* not compatible with static CCtx */
+ ZSTD_free(cctx->workSpace, cctx->customMem);
+ cctx->workSpace = NULL;
+ ZSTD_freeCDict(cctx->cdictLocal);
+ cctx->cdictLocal = NULL;
+ ZSTDMT_freeCCtx(cctx->mtctx);
+ cctx->mtctx = NULL;
+ ZSTD_free(cctx, cctx->customMem);
+ return 0; /* reserved as a potential error code in the future */
+}
+
+size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx)
+{
+ if (cctx==NULL) return 0; /* support sizeof on NULL */
+ DEBUGLOG(5, "sizeof(*cctx) : %u", (U32)sizeof(*cctx));
+ DEBUGLOG(5, "workSpaceSize : %u", (U32)cctx->workSpaceSize);
+ DEBUGLOG(5, "streaming buffers : %u", (U32)(cctx->outBuffSize + cctx->inBuffSize));
+ DEBUGLOG(5, "inner MTCTX : %u", (U32)ZSTDMT_sizeof_CCtx(cctx->mtctx));
+ return sizeof(*cctx) + cctx->workSpaceSize
+ + ZSTD_sizeof_CDict(cctx->cdictLocal)
+ + cctx->outBuffSize + cctx->inBuffSize
+ + ZSTDMT_sizeof_CCtx(cctx->mtctx);
+}
+
+size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs)
+{
+ return ZSTD_sizeof_CCtx(zcs); /* same object */
+}
+
+/* private API call, for dictBuilder only */
+const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx) { return &(ctx->seqStore); }
+
+static ZSTD_parameters ZSTD_getParamsFromCCtx(const ZSTD_CCtx* cctx) { return cctx->appliedParams; }
+
+/* older variant; will be deprecated */
+size_t ZSTD_setCCtxParameter(ZSTD_CCtx* cctx, ZSTD_CCtxParameter param, unsigned value)
+{
+ switch(param)
+ {
+ case ZSTD_p_forceWindow : cctx->forceWindow = value>0; cctx->loadedDictEnd = 0; return 0;
+ ZSTD_STATIC_ASSERT(ZSTD_dm_auto==0);
+ ZSTD_STATIC_ASSERT(ZSTD_dm_rawContent==1);
+ case ZSTD_p_forceRawDict : cctx->dictMode = (ZSTD_dictMode_e)(value>0); return 0;
+ default: return ERROR(parameter_unknown);
+ }
+}
+
+
+#define ZSTD_CLEVEL_CUSTOM 999
+static void ZSTD_cLevelToCParams(ZSTD_CCtx* cctx)
+{
+ if (cctx->compressionLevel==ZSTD_CLEVEL_CUSTOM) return;
+ cctx->requestedParams.cParams = ZSTD_getCParams(cctx->compressionLevel,
+ cctx->pledgedSrcSizePlusOne-1, 0);
+ cctx->compressionLevel = ZSTD_CLEVEL_CUSTOM;
+}
+
+#define CLAMPCHECK(val,min,max) { \
+ if (((val)<(min)) | ((val)>(max))) { \
+ return ERROR(compressionParameter_outOfBound); \
+} }
+
+size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned value)
+{
+ if (cctx->streamStage != zcss_init) return ERROR(stage_wrong);
+
+ switch(param)
+ {
+ case ZSTD_p_compressionLevel :
+ if ((int)value > ZSTD_maxCLevel()) value = ZSTD_maxCLevel(); /* cap max compression level */
+ if (value == 0) return 0; /* special value : 0 means "don't change anything" */
+ if (cctx->cdict) return ERROR(stage_wrong);
+ cctx->compressionLevel = value;
+ return 0;
+
+ case ZSTD_p_windowLog :
+ DEBUGLOG(5, "setting ZSTD_p_windowLog = %u (cdict:%u)",
+ value, (cctx->cdict!=NULL));
+ if (value == 0) return 0; /* special value : 0 means "don't change anything" */
+ if (cctx->cdict) return ERROR(stage_wrong);
+ CLAMPCHECK(value, ZSTD_WINDOWLOG_MIN, ZSTD_WINDOWLOG_MAX);
+ ZSTD_cLevelToCParams(cctx);
+ cctx->requestedParams.cParams.windowLog = value;
+ return 0;
+
+ case ZSTD_p_hashLog :
+ if (value == 0) return 0; /* special value : 0 means "don't change anything" */
+ if (cctx->cdict) return ERROR(stage_wrong);
+ CLAMPCHECK(value, ZSTD_HASHLOG_MIN, ZSTD_HASHLOG_MAX);
+ ZSTD_cLevelToCParams(cctx);
+ cctx->requestedParams.cParams.hashLog = value;
+ return 0;
+
+ case ZSTD_p_chainLog :
+ if (value == 0) return 0; /* special value : 0 means "don't change anything" */
+ if (cctx->cdict) return ERROR(stage_wrong);
+ CLAMPCHECK(value, ZSTD_CHAINLOG_MIN, ZSTD_CHAINLOG_MAX);
+ ZSTD_cLevelToCParams(cctx);
+ cctx->requestedParams.cParams.chainLog = value;
+ return 0;
+
+ case ZSTD_p_searchLog :
+ if (value == 0) return 0; /* special value : 0 means "don't change anything" */
+ if (cctx->cdict) return ERROR(stage_wrong);
+ CLAMPCHECK(value, ZSTD_SEARCHLOG_MIN, ZSTD_SEARCHLOG_MAX);
+ ZSTD_cLevelToCParams(cctx);
+ cctx->requestedParams.cParams.searchLog = value;
+ return 0;
+
+ case ZSTD_p_minMatch :
+ if (value == 0) return 0; /* special value : 0 means "don't change anything" */
+ if (cctx->cdict) return ERROR(stage_wrong);
+ CLAMPCHECK(value, ZSTD_SEARCHLENGTH_MIN, ZSTD_SEARCHLENGTH_MAX);
+ ZSTD_cLevelToCParams(cctx);
+ cctx->requestedParams.cParams.searchLength = value;
+ return 0;
+
+ case ZSTD_p_targetLength :
+ if (value == 0) return 0; /* special value : 0 means "don't change anything" */
+ if (cctx->cdict) return ERROR(stage_wrong);
+ CLAMPCHECK(value, ZSTD_TARGETLENGTH_MIN, ZSTD_TARGETLENGTH_MAX);
+ ZSTD_cLevelToCParams(cctx);
+ cctx->requestedParams.cParams.targetLength = value;
+ return 0;
+
+ case ZSTD_p_compressionStrategy :
+ if (value == 0) return 0; /* special value : 0 means "don't change anything" */
+ if (cctx->cdict) return ERROR(stage_wrong);
+ CLAMPCHECK(value, (unsigned)ZSTD_fast, (unsigned)ZSTD_btultra);
+ ZSTD_cLevelToCParams(cctx);
+ cctx->requestedParams.cParams.strategy = (ZSTD_strategy)value;
+ return 0;
+
+ case ZSTD_p_contentSizeFlag :
+ DEBUGLOG(5, "set content size flag = %u", (value>0));
+ /* Content size written in frame header _when known_ (default:1) */
+ cctx->requestedParams.fParams.contentSizeFlag = value>0;
+ return 0;
+
+ case ZSTD_p_checksumFlag :
+ /* A 32-bits content checksum will be calculated and written at end of frame (default:0) */
+ cctx->requestedParams.fParams.checksumFlag = value>0;
+ return 0;
+
+ case ZSTD_p_dictIDFlag : /* When applicable, dictionary's dictID is provided in frame header (default:1) */
+ DEBUGLOG(5, "set dictIDFlag = %u", (value>0));
+ cctx->requestedParams.fParams.noDictIDFlag = (value==0);
+ return 0;
+
+ /* Dictionary parameters */
+ case ZSTD_p_dictMode :
+ if (cctx->cdict) return ERROR(stage_wrong); /* must be set before loading */
+ /* restrict dictionary mode, to "rawContent" or "fullDict" only */
+ ZSTD_STATIC_ASSERT((U32)ZSTD_dm_fullDict > (U32)ZSTD_dm_rawContent);
+ if (value > (unsigned)ZSTD_dm_fullDict)
+ return ERROR(compressionParameter_outOfBound);
+ cctx->dictMode = (ZSTD_dictMode_e)value;
+ return 0;
+
+ case ZSTD_p_refDictContent :
+ if (cctx->cdict) return ERROR(stage_wrong); /* must be set before loading */
+ /* dictionary content will be referenced, instead of copied */
+ cctx->dictContentByRef = value>0;
+ return 0;
+
+ case ZSTD_p_forceMaxWindow : /* Force back-references to remain < windowSize,
+ * even when referencing into Dictionary content
+ * default : 0 when using a CDict, 1 when using a Prefix */
+ cctx->forceWindow = value>0;
+ cctx->loadedDictEnd = 0;
+ return 0;
+
+ case ZSTD_p_nbThreads:
+ if (value==0) return 0;
+ DEBUGLOG(5, " setting nbThreads : %u", value);
+#ifndef ZSTD_MULTITHREAD
+ if (value > 1) return ERROR(compressionParameter_unsupported);
+#endif
+ if ((value>1) && (cctx->nbThreads != value)) {
+ if (cctx->staticSize) /* MT not compatible with static alloc */
+ return ERROR(compressionParameter_unsupported);
+ ZSTDMT_freeCCtx(cctx->mtctx);
+ cctx->nbThreads = 1;
+ cctx->mtctx = ZSTDMT_createCCtx(value);
+ if (cctx->mtctx == NULL) return ERROR(memory_allocation);
+ }
+ cctx->nbThreads = value;
+ return 0;
+
+ case ZSTD_p_jobSize:
+ if (cctx->nbThreads <= 1) return ERROR(compressionParameter_unsupported);
+ assert(cctx->mtctx != NULL);
+ return ZSTDMT_setMTCtxParameter(cctx->mtctx, ZSTDMT_p_sectionSize, value);
+
+ case ZSTD_p_overlapSizeLog:
+ DEBUGLOG(5, " setting overlap with nbThreads == %u", cctx->nbThreads);
+ if (cctx->nbThreads <= 1) return ERROR(compressionParameter_unsupported);
+ assert(cctx->mtctx != NULL);
+ return ZSTDMT_setMTCtxParameter(cctx->mtctx, ZSTDMT_p_overlapSectionLog, value);
+
+ default: return ERROR(parameter_unknown);
+ }
+}
+
+ZSTDLIB_API size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize)
+{
+ DEBUGLOG(5, " setting pledgedSrcSize to %u", (U32)pledgedSrcSize);
+ if (cctx->streamStage != zcss_init) return ERROR(stage_wrong);
+ cctx->pledgedSrcSizePlusOne = pledgedSrcSize+1;
+ return 0;
+}
+
+ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize)
+{
+ if (cctx->streamStage != zcss_init) return ERROR(stage_wrong);
+ if (cctx->staticSize) return ERROR(memory_allocation); /* no malloc for static CCtx */
+ DEBUGLOG(5, "load dictionary of size %u", (U32)dictSize);
+ ZSTD_freeCDict(cctx->cdictLocal); /* in case one already exists */
+ if (dict==NULL || dictSize==0) { /* no dictionary mode */
+ cctx->cdictLocal = NULL;
+ cctx->cdict = NULL;
+ } else {
+ ZSTD_compressionParameters const cParams =
+ cctx->compressionLevel == ZSTD_CLEVEL_CUSTOM ?
+ cctx->requestedParams.cParams :
+ ZSTD_getCParams(cctx->compressionLevel, 0, dictSize);
+ cctx->cdictLocal = ZSTD_createCDict_advanced(
+ dict, dictSize,
+ cctx->dictContentByRef, cctx->dictMode,
+ cParams, cctx->customMem);
+ cctx->cdict = cctx->cdictLocal;
+ if (cctx->cdictLocal == NULL)
+ return ERROR(memory_allocation);
+ }
+ return 0;
+}
+
+size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict)
+{
+ if (cctx->streamStage != zcss_init) return ERROR(stage_wrong);
+ cctx->cdict = cdict;
+ cctx->prefix = NULL; /* exclusive */
+ cctx->prefixSize = 0;
+ return 0;
+}
+
+size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize)
+{
+ if (cctx->streamStage != zcss_init) return ERROR(stage_wrong);
+ cctx->cdict = NULL; /* prefix discards any prior cdict */
+ cctx->prefix = prefix;
+ cctx->prefixSize = prefixSize;
+ return 0;
+}
+
+static void ZSTD_startNewCompression(ZSTD_CCtx* cctx)
+{
+ cctx->streamStage = zcss_init;
+ cctx->pledgedSrcSizePlusOne = 0;
+}
+
+/*! ZSTD_CCtx_reset() :
+ * Also dumps dictionary */
+void ZSTD_CCtx_reset(ZSTD_CCtx* cctx)
+{
+ ZSTD_startNewCompression(cctx);
+ cctx->cdict = NULL;
+}
+
+/** ZSTD_checkCParams() :
+ control CParam values remain within authorized range.
+ @return : 0, or an error code if one value is beyond authorized range */
+size_t ZSTD_checkCParams(ZSTD_compressionParameters cParams)
+{
+ CLAMPCHECK(cParams.windowLog, ZSTD_WINDOWLOG_MIN, ZSTD_WINDOWLOG_MAX);
+ CLAMPCHECK(cParams.chainLog, ZSTD_CHAINLOG_MIN, ZSTD_CHAINLOG_MAX);
+ CLAMPCHECK(cParams.hashLog, ZSTD_HASHLOG_MIN, ZSTD_HASHLOG_MAX);
+ CLAMPCHECK(cParams.searchLog, ZSTD_SEARCHLOG_MIN, ZSTD_SEARCHLOG_MAX);
+ CLAMPCHECK(cParams.searchLength, ZSTD_SEARCHLENGTH_MIN, ZSTD_SEARCHLENGTH_MAX);
+ CLAMPCHECK(cParams.targetLength, ZSTD_TARGETLENGTH_MIN, ZSTD_TARGETLENGTH_MAX);
+ if ((U32)(cParams.strategy) > (U32)ZSTD_btultra) return ERROR(compressionParameter_unsupported);
+ return 0;
+}
+
+/** ZSTD_clampCParams() :
+ * make CParam values within valid range.
+ * @return : valid CParams */
+static ZSTD_compressionParameters ZSTD_clampCParams(ZSTD_compressionParameters cParams)
+{
+# define CLAMP(val,min,max) { \
+ if (val<min) val=min; \
+ else if (val>max) val=max; \
+ }
+ CLAMP(cParams.windowLog, ZSTD_WINDOWLOG_MIN, ZSTD_WINDOWLOG_MAX);
+ CLAMP(cParams.chainLog, ZSTD_CHAINLOG_MIN, ZSTD_CHAINLOG_MAX);
+ CLAMP(cParams.hashLog, ZSTD_HASHLOG_MIN, ZSTD_HASHLOG_MAX);
+ CLAMP(cParams.searchLog, ZSTD_SEARCHLOG_MIN, ZSTD_SEARCHLOG_MAX);
+ CLAMP(cParams.searchLength, ZSTD_SEARCHLENGTH_MIN, ZSTD_SEARCHLENGTH_MAX);
+ CLAMP(cParams.targetLength, ZSTD_TARGETLENGTH_MIN, ZSTD_TARGETLENGTH_MAX);
+ if ((U32)(cParams.strategy) > (U32)ZSTD_btultra) cParams.strategy = ZSTD_btultra;
+ return cParams;
+}
+
+/** ZSTD_cycleLog() :
+ * condition for correct operation : hashLog > 1 */
+static U32 ZSTD_cycleLog(U32 hashLog, ZSTD_strategy strat)
+{
+ U32 const btScale = ((U32)strat >= (U32)ZSTD_btlazy2);
+ return hashLog - btScale;
+}
+
+/** ZSTD_adjustCParams_internal() :
+ optimize `cPar` for a given input (`srcSize` and `dictSize`).
+ mostly downsizing to reduce memory consumption and initialization.
+ Both `srcSize` and `dictSize` are optional (use 0 if unknown),
+ but if both are 0, no optimization can be done.
+ Note : cPar is considered validated at this stage. Use ZSTD_checkParams() to ensure that. */
+ZSTD_compressionParameters ZSTD_adjustCParams_internal(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize)
+{
+ assert(ZSTD_checkCParams(cPar)==0);
+ if (srcSize+dictSize == 0) return cPar; /* no size information available : no adjustment */
+
+ /* resize params, to use less memory when necessary */
+ { U32 const minSrcSize = (srcSize==0) ? 500 : 0;
+ U64 const rSize = srcSize + dictSize + minSrcSize;
+ if (rSize < ((U64)1<<ZSTD_WINDOWLOG_MAX)) {
+ U32 const srcLog = MAX(ZSTD_HASHLOG_MIN, ZSTD_highbit32((U32)(rSize)-1) + 1);
+ if (cPar.windowLog > srcLog) cPar.windowLog = srcLog;
+ } }
+ if (cPar.hashLog > cPar.windowLog) cPar.hashLog = cPar.windowLog;
+ { U32 const cycleLog = ZSTD_cycleLog(cPar.chainLog, cPar.strategy);
+ if (cycleLog > cPar.windowLog) cPar.chainLog -= (cycleLog - cPar.windowLog);
+ }
+
+ if (cPar.windowLog < ZSTD_WINDOWLOG_ABSOLUTEMIN) cPar.windowLog = ZSTD_WINDOWLOG_ABSOLUTEMIN; /* required for frame header */
+
+ return cPar;
+}
+
+ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize)
+{
+ cPar = ZSTD_clampCParams(cPar);
+ return ZSTD_adjustCParams_internal(cPar, srcSize, dictSize);
+}
+
+
+size_t ZSTD_estimateCCtxSize_advanced(ZSTD_compressionParameters cParams)
+{
+ size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, (size_t)1 << cParams.windowLog);
+ U32 const divider = (cParams.searchLength==3) ? 3 : 4;
+ size_t const maxNbSeq = blockSize / divider;
+ size_t const tokenSpace = blockSize + 11*maxNbSeq;
+
+ size_t const chainSize = (cParams.strategy == ZSTD_fast) ? 0 : (1 << cParams.chainLog);
+ size_t const hSize = ((size_t)1) << cParams.hashLog;
+ U32 const hashLog3 = (cParams.searchLength>3) ? 0 : MIN(ZSTD_HASHLOG3_MAX, cParams.windowLog);
+ size_t const h3Size = ((size_t)1) << hashLog3;
+ size_t const entropySpace = hufCTable_size + litlengthCTable_size
+ + offcodeCTable_size + matchlengthCTable_size
+ + entropyScratchSpace_size;
+ size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32);
+
+ size_t const optBudget = ((MaxML+1) + (MaxLL+1) + (MaxOff+1) + (1<<Litbits))*sizeof(U32)
+ + (ZSTD_OPT_NUM+1)*(sizeof(ZSTD_match_t) + sizeof(ZSTD_optimal_t));
+ size_t const optSpace = ((cParams.strategy == ZSTD_btopt) || (cParams.strategy == ZSTD_btultra)) ? optBudget : 0;
+ size_t const neededSpace = entropySpace + tableSpace + tokenSpace + optSpace;
+
+ DEBUGLOG(5, "sizeof(ZSTD_CCtx) : %u", (U32)sizeof(ZSTD_CCtx));
+ DEBUGLOG(5, "estimate workSpace : %u", (U32)neededSpace);
+ return sizeof(ZSTD_CCtx) + neededSpace;
+}
+
+size_t ZSTD_estimateCCtxSize(int compressionLevel)
+{
+ ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, 0, 0);
+ return ZSTD_estimateCCtxSize_advanced(cParams);
+}
+
+size_t ZSTD_estimateCStreamSize_advanced(ZSTD_compressionParameters cParams)
+{
+ size_t const CCtxSize = ZSTD_estimateCCtxSize_advanced(cParams);
+ size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, (size_t)1 << cParams.windowLog);
+ size_t const inBuffSize = ((size_t)1 << cParams.windowLog) + blockSize;
+ size_t const outBuffSize = ZSTD_compressBound(blockSize) + 1;
+ size_t const streamingSize = inBuffSize + outBuffSize;
+
+ return CCtxSize + streamingSize;
+}
+
+size_t ZSTD_estimateCStreamSize(int compressionLevel) {
+ ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, 0, 0);
+ return ZSTD_estimateCStreamSize_advanced(cParams);
+}
+
+
+static U32 ZSTD_equivalentParams(ZSTD_compressionParameters cParams1,
+ ZSTD_compressionParameters cParams2)
+{
+ U32 bslog1 = MIN(cParams1.windowLog, ZSTD_BLOCKSIZELOG_MAX);
+ U32 bslog2 = MIN(cParams2.windowLog, ZSTD_BLOCKSIZELOG_MAX);
+ return (bslog1 == bslog2) /* same block size */
+ & (cParams1.hashLog == cParams2.hashLog)
+ & (cParams1.chainLog == cParams2.chainLog)
+ & (cParams1.strategy == cParams2.strategy) /* opt parser space */
+ & ((cParams1.searchLength==3) == (cParams2.searchLength==3)); /* hashlog3 space */
+}
+
+/*! ZSTD_continueCCtx() :
+ * reuse CCtx without reset (note : requires no dictionary) */
+static size_t ZSTD_continueCCtx(ZSTD_CCtx* cctx, ZSTD_parameters params, U64 pledgedSrcSize)
+{
+ U32 const end = (U32)(cctx->nextSrc - cctx->base);
+ DEBUGLOG(5, "continue mode");
+ cctx->appliedParams = params;
+ cctx->pledgedSrcSizePlusOne = pledgedSrcSize+1;
+ cctx->consumedSrcSize = 0;
+ if (pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN)
+ cctx->appliedParams.fParams.contentSizeFlag = 0;
+ DEBUGLOG(5, "pledged content size : %u ; flag : %u",
+ (U32)pledgedSrcSize, cctx->appliedParams.fParams.contentSizeFlag);
+ cctx->lowLimit = end;
+ cctx->dictLimit = end;
+ cctx->nextToUpdate = end+1;
+ cctx->stage = ZSTDcs_init;
+ cctx->dictID = 0;
+ cctx->loadedDictEnd = 0;
+ { int i; for (i=0; i<ZSTD_REP_NUM; i++) cctx->rep[i] = repStartValue[i]; }
+ cctx->seqStore.litLengthSum = 0; /* force reset of btopt stats */
+ XXH64_reset(&cctx->xxhState, 0);
+ return 0;
+}
+
+typedef enum { ZSTDcrp_continue, ZSTDcrp_noMemset } ZSTD_compResetPolicy_e;
+typedef enum { ZSTDb_not_buffered, ZSTDb_buffered } ZSTD_buffered_policy_e;
+
+/*! ZSTD_resetCCtx_internal() :
+ note : `params` are assumed fully validated at this stage */
+static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc,
+ ZSTD_parameters params, U64 pledgedSrcSize,
+ ZSTD_compResetPolicy_e const crp,
+ ZSTD_buffered_policy_e const zbuff)
+{
+ assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams)));
+
+ if (crp == ZSTDcrp_continue) {
+ if (ZSTD_equivalentParams(params.cParams, zc->appliedParams.cParams)) {
+ DEBUGLOG(5, "ZSTD_equivalentParams()==1");
+ zc->fseCTables_ready = 0;
+ zc->hufCTable_repeatMode = HUF_repeat_none;
+ return ZSTD_continueCCtx(zc, params, pledgedSrcSize);
+ } }
+
+ { size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, (size_t)1 << params.cParams.windowLog);
+ U32 const divider = (params.cParams.searchLength==3) ? 3 : 4;
+ size_t const maxNbSeq = blockSize / divider;
+ size_t const tokenSpace = blockSize + 11*maxNbSeq;
+ size_t const chainSize = (params.cParams.strategy == ZSTD_fast) ?
+ 0 : (1 << params.cParams.chainLog);
+ size_t const hSize = ((size_t)1) << params.cParams.hashLog;
+ U32 const hashLog3 = (params.cParams.searchLength>3) ?
+ 0 : MIN(ZSTD_HASHLOG3_MAX, params.cParams.windowLog);
+ size_t const h3Size = ((size_t)1) << hashLog3;
+ size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32);
+ size_t const buffOutSize = (zbuff==ZSTDb_buffered) ? ZSTD_compressBound(blockSize)+1 : 0;
+ size_t const buffInSize = (zbuff==ZSTDb_buffered) ? ((size_t)1 << params.cParams.windowLog) + blockSize : 0;
+ void* ptr;
+
+ /* Check if workSpace is large enough, alloc a new one if needed */
+ { size_t const entropySpace = hufCTable_size + litlengthCTable_size
+ + offcodeCTable_size + matchlengthCTable_size
+ + entropyScratchSpace_size;
+ size_t const optPotentialSpace = ((MaxML+1) + (MaxLL+1) + (MaxOff+1) + (1<<Litbits)) * sizeof(U32)
+ + (ZSTD_OPT_NUM+1) * (sizeof(ZSTD_match_t)+sizeof(ZSTD_optimal_t));
+ size_t const optSpace = ( (params.cParams.strategy == ZSTD_btopt)
+ || (params.cParams.strategy == ZSTD_btultra)) ?
+ optPotentialSpace : 0;
+ size_t const bufferSpace = buffInSize + buffOutSize;
+ size_t const neededSpace = entropySpace + optSpace + tableSpace
+ + tokenSpace + bufferSpace;
+
+ if (zc->workSpaceSize < neededSpace) { /* too small : resize /*/
+ DEBUGLOG(5, "Need to update workSpaceSize from %uK to %uK \n",
+ (unsigned)zc->workSpaceSize>>10,
+ (unsigned)neededSpace>>10);
+ /* static cctx : no resize, error out */
+ if (zc->staticSize) return ERROR(memory_allocation);
+
+ zc->workSpaceSize = 0;
+ ZSTD_free(zc->workSpace, zc->customMem);
+ zc->workSpace = ZSTD_malloc(neededSpace, zc->customMem);
+ if (zc->workSpace == NULL) return ERROR(memory_allocation);
+ zc->workSpaceSize = neededSpace;
+ ptr = zc->workSpace;
+
+ /* entropy space */
+ zc->hufCTable = (HUF_CElt*)ptr;
+ ptr = (char*)zc->hufCTable + hufCTable_size; /* note : HUF_CElt* is incomplete type, size is estimated via macro */
+ zc->offcodeCTable = (FSE_CTable*) ptr;
+ ptr = (char*)ptr + offcodeCTable_size;
+ zc->matchlengthCTable = (FSE_CTable*) ptr;
+ ptr = (char*)ptr + matchlengthCTable_size;
+ zc->litlengthCTable = (FSE_CTable*) ptr;
+ ptr = (char*)ptr + litlengthCTable_size;
+ assert(((size_t)ptr & 3) == 0); /* ensure correct alignment */
+ zc->entropyScratchSpace = (unsigned*) ptr;
+ } }
+
+ /* init params */
+ zc->appliedParams = params;
+ zc->pledgedSrcSizePlusOne = pledgedSrcSize+1;
+ zc->consumedSrcSize = 0;
+ if (pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN)
+ zc->appliedParams.fParams.contentSizeFlag = 0;
+ DEBUGLOG(5, "pledged content size : %u ; flag : %u",
+ (U32)pledgedSrcSize, zc->appliedParams.fParams.contentSizeFlag);
+ zc->blockSize = blockSize;
+
+ XXH64_reset(&zc->xxhState, 0);
+ zc->stage = ZSTDcs_init;
+ zc->dictID = 0;
+ zc->loadedDictEnd = 0;
+ zc->fseCTables_ready = 0;
+ zc->hufCTable_repeatMode = HUF_repeat_none;
+ zc->nextToUpdate = 1;
+ zc->nextSrc = NULL;
+ zc->base = NULL;
+ zc->dictBase = NULL;
+ zc->dictLimit = 0;
+ zc->lowLimit = 0;
+ { int i; for (i=0; i<ZSTD_REP_NUM; i++) zc->rep[i] = repStartValue[i]; }
+ zc->hashLog3 = hashLog3;
+ zc->seqStore.litLengthSum = 0;
+
+ /* ensure entropy tables are close together at the beginning */
+ assert((void*)zc->hufCTable == zc->workSpace);
+ assert((char*)zc->offcodeCTable == (char*)zc->hufCTable + hufCTable_size);
+ assert((char*)zc->matchlengthCTable == (char*)zc->offcodeCTable + offcodeCTable_size);
+ assert((char*)zc->litlengthCTable == (char*)zc->matchlengthCTable + matchlengthCTable_size);
+ assert((char*)zc->entropyScratchSpace == (char*)zc->litlengthCTable + litlengthCTable_size);
+ ptr = (char*)zc->entropyScratchSpace + entropyScratchSpace_size;
+
+ /* opt parser space */
+ if ((params.cParams.strategy == ZSTD_btopt) || (params.cParams.strategy == ZSTD_btultra)) {
+ DEBUGLOG(5, "reserving optimal parser space");
+ assert(((size_t)ptr & 3) == 0); /* ensure ptr is properly aligned */
+ zc->seqStore.litFreq = (U32*)ptr;
+ zc->seqStore.litLengthFreq = zc->seqStore.litFreq + (1<<Litbits);
+ zc->seqStore.matchLengthFreq = zc->seqStore.litLengthFreq + (MaxLL+1);
+ zc->seqStore.offCodeFreq = zc->seqStore.matchLengthFreq + (MaxML+1);
+ ptr = zc->seqStore.offCodeFreq + (MaxOff+1);
+ zc->seqStore.matchTable = (ZSTD_match_t*)ptr;
+ ptr = zc->seqStore.matchTable + ZSTD_OPT_NUM+1;
+ zc->seqStore.priceTable = (ZSTD_optimal_t*)ptr;
+ ptr = zc->seqStore.priceTable + ZSTD_OPT_NUM+1;
+ }
+
+ /* table Space */
+ if (crp!=ZSTDcrp_noMemset) memset(ptr, 0, tableSpace); /* reset tables only */
+ assert(((size_t)ptr & 3) == 0); /* ensure ptr is properly aligned */
+ zc->hashTable = (U32*)(ptr);
+ zc->chainTable = zc->hashTable + hSize;
+ zc->hashTable3 = zc->chainTable + chainSize;
+ ptr = zc->hashTable3 + h3Size;
+
+ /* sequences storage */
+ zc->seqStore.sequencesStart = (seqDef*)ptr;
+ ptr = zc->seqStore.sequencesStart + maxNbSeq;
+ zc->seqStore.llCode = (BYTE*) ptr;
+ zc->seqStore.mlCode = zc->seqStore.llCode + maxNbSeq;
+ zc->seqStore.ofCode = zc->seqStore.mlCode + maxNbSeq;
+ zc->seqStore.litStart = zc->seqStore.ofCode + maxNbSeq;
+ ptr = zc->seqStore.litStart + blockSize;
+
+ /* buffers */
+ zc->inBuffSize = buffInSize;
+ zc->inBuff = (char*)ptr;
+ zc->outBuffSize = buffOutSize;
+ zc->outBuff = zc->inBuff + buffInSize;
+
+ return 0;
+ }
+}
+
+/* ZSTD_invalidateRepCodes() :
+ * ensures next compression will not use repcodes from previous block.
+ * Note : only works with regular variant;
+ * do not use with extDict variant ! */
+void ZSTD_invalidateRepCodes(ZSTD_CCtx* cctx) {
+ int i;
+ for (i=0; i<ZSTD_REP_NUM; i++) cctx->rep[i] = 0;
+}
+
+
+/*! ZSTD_copyCCtx_internal() :
+ * Duplicate an existing context `srcCCtx` into another one `dstCCtx`.
+ * Only works during stage ZSTDcs_init (i.e. after creation, but before first call to ZSTD_compressContinue()).
+ * pledgedSrcSize=0 means "empty" if fParams.contentSizeFlag=1
+ * @return : 0, or an error code */
+static size_t ZSTD_copyCCtx_internal(ZSTD_CCtx* dstCCtx,
+ const ZSTD_CCtx* srcCCtx,
+ ZSTD_frameParameters fParams,
+ unsigned long long pledgedSrcSize,
+ ZSTD_buffered_policy_e zbuff)
+{
+ DEBUGLOG(5, "ZSTD_copyCCtx_internal");
+ if (srcCCtx->stage!=ZSTDcs_init) return ERROR(stage_wrong);
+
+ memcpy(&dstCCtx->customMem, &srcCCtx->customMem, sizeof(ZSTD_customMem));
+ { ZSTD_parameters params = srcCCtx->appliedParams;
+ params.fParams = fParams;
+ ZSTD_resetCCtx_internal(dstCCtx, params, pledgedSrcSize,
+ ZSTDcrp_noMemset, zbuff);
+ }
+
+ /* copy tables */
+ { size_t const chainSize = (srcCCtx->appliedParams.cParams.strategy == ZSTD_fast) ? 0 : (1 << srcCCtx->appliedParams.cParams.chainLog);
+ size_t const hSize = (size_t)1 << srcCCtx->appliedParams.cParams.hashLog;
+ size_t const h3Size = (size_t)1 << srcCCtx->hashLog3;
+ size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32);
+ assert((U32*)dstCCtx->chainTable == (U32*)dstCCtx->hashTable + hSize); /* chainTable must follow hashTable */
+ assert((U32*)dstCCtx->hashTable3 == (U32*)dstCCtx->chainTable + chainSize);
+ memcpy(dstCCtx->hashTable, srcCCtx->hashTable, tableSpace); /* presumes all tables follow each other */
+ }
+
+ /* copy dictionary offsets */
+ dstCCtx->nextToUpdate = srcCCtx->nextToUpdate;
+ dstCCtx->nextToUpdate3= srcCCtx->nextToUpdate3;
+ dstCCtx->nextSrc = srcCCtx->nextSrc;
+ dstCCtx->base = srcCCtx->base;
+ dstCCtx->dictBase = srcCCtx->dictBase;
+ dstCCtx->dictLimit = srcCCtx->dictLimit;
+ dstCCtx->lowLimit = srcCCtx->lowLimit;
+ dstCCtx->loadedDictEnd= srcCCtx->loadedDictEnd;
+ dstCCtx->dictID = srcCCtx->dictID;
+
+ /* copy entropy tables */
+ dstCCtx->fseCTables_ready = srcCCtx->fseCTables_ready;
+ if (srcCCtx->fseCTables_ready) {
+ memcpy(dstCCtx->litlengthCTable, srcCCtx->litlengthCTable, litlengthCTable_size);
+ memcpy(dstCCtx->matchlengthCTable, srcCCtx->matchlengthCTable, matchlengthCTable_size);
+ memcpy(dstCCtx->offcodeCTable, srcCCtx->offcodeCTable, offcodeCTable_size);
+ }
+ dstCCtx->hufCTable_repeatMode = srcCCtx->hufCTable_repeatMode;
+ if (srcCCtx->hufCTable_repeatMode) {
+ memcpy(dstCCtx->hufCTable, srcCCtx->hufCTable, hufCTable_size);
+ }
+
+ return 0;
+}
+
+/*! ZSTD_copyCCtx() :
+ * Duplicate an existing context `srcCCtx` into another one `dstCCtx`.
+ * Only works during stage ZSTDcs_init (i.e. after creation, but before first call to ZSTD_compressContinue()).
+ * pledgedSrcSize==0 means "unknown".
+* @return : 0, or an error code */
+size_t ZSTD_copyCCtx(ZSTD_CCtx* dstCCtx, const ZSTD_CCtx* srcCCtx, unsigned long long pledgedSrcSize)
+{
+ ZSTD_frameParameters fParams = { 1 /*content*/, 0 /*checksum*/, 0 /*noDictID*/ };
+ ZSTD_buffered_policy_e const zbuff = (ZSTD_buffered_policy_e)(srcCCtx->inBuffSize>0);
+ ZSTD_STATIC_ASSERT((U32)ZSTDb_buffered==1);
+ fParams.contentSizeFlag = pledgedSrcSize>0;
+
+ return ZSTD_copyCCtx_internal(dstCCtx, srcCCtx, fParams, pledgedSrcSize, zbuff);
+}
+
+
+/*! ZSTD_reduceTable() :
+ * reduce table indexes by `reducerValue` */
+static void ZSTD_reduceTable (U32* const table, U32 const size, U32 const reducerValue)
+{
+ U32 u;
+ for (u=0 ; u < size ; u++) {
+ if (table[u] < reducerValue) table[u] = 0;
+ else table[u] -= reducerValue;
+ }
+}
+
+/*! ZSTD_reduceIndex() :
+* rescale all indexes to avoid future overflow (indexes are U32) */
+static void ZSTD_reduceIndex (ZSTD_CCtx* zc, const U32 reducerValue)
+{
+ { U32 const hSize = 1 << zc->appliedParams.cParams.hashLog;
+ ZSTD_reduceTable(zc->hashTable, hSize, reducerValue); }
+
+ { U32 const chainSize = (zc->appliedParams.cParams.strategy == ZSTD_fast) ? 0 : (1 << zc->appliedParams.cParams.chainLog);
+ ZSTD_reduceTable(zc->chainTable, chainSize, reducerValue); }
+
+ { U32 const h3Size = (zc->hashLog3) ? 1 << zc->hashLog3 : 0;
+ ZSTD_reduceTable(zc->hashTable3, h3Size, reducerValue); }
+}
+
+
+/*-*******************************************************
+* Block entropic compression
+*********************************************************/
+
+/* See doc/zstd_compression_format.md for detailed format description */
+
+size_t ZSTD_noCompressBlock (void* dst, size_t dstCapacity, const void* src, size_t srcSize)
+{
+ if (srcSize + ZSTD_blockHeaderSize > dstCapacity) return ERROR(dstSize_tooSmall);
+ memcpy((BYTE*)dst + ZSTD_blockHeaderSize, src, srcSize);
+ MEM_writeLE24(dst, (U32)(srcSize << 2) + (U32)bt_raw);
+ return ZSTD_blockHeaderSize+srcSize;
+}
+
+
+static size_t ZSTD_noCompressLiterals (void* dst, size_t dstCapacity, const void* src, size_t srcSize)
+{
+ BYTE* const ostart = (BYTE* const)dst;
+ U32 const flSize = 1 + (srcSize>31) + (srcSize>4095);
+
+ if (srcSize + flSize > dstCapacity) return ERROR(dstSize_tooSmall);
+
+ switch(flSize)
+ {
+ case 1: /* 2 - 1 - 5 */
+ ostart[0] = (BYTE)((U32)set_basic + (srcSize<<3));
+ break;
+ case 2: /* 2 - 2 - 12 */
+ MEM_writeLE16(ostart, (U16)((U32)set_basic + (1<<2) + (srcSize<<4)));
+ break;
+ case 3: /* 2 - 2 - 20 */
+ MEM_writeLE32(ostart, (U32)((U32)set_basic + (3<<2) + (srcSize<<4)));
+ break;
+ default: /* not necessary : flSize is {1,2,3} */
+ assert(0);
+ }
+
+ memcpy(ostart + flSize, src, srcSize);
+ return srcSize + flSize;
+}
+
+static size_t ZSTD_compressRleLiteralsBlock (void* dst, size_t dstCapacity, const void* src, size_t srcSize)
+{
+ BYTE* const ostart = (BYTE* const)dst;
+ U32 const flSize = 1 + (srcSize>31) + (srcSize>4095);
+
+ (void)dstCapacity; /* dstCapacity already guaranteed to be >=4, hence large enough */
+
+ switch(flSize)
+ {
+ case 1: /* 2 - 1 - 5 */
+ ostart[0] = (BYTE)((U32)set_rle + (srcSize<<3));
+ break;
+ case 2: /* 2 - 2 - 12 */
+ MEM_writeLE16(ostart, (U16)((U32)set_rle + (1<<2) + (srcSize<<4)));
+ break;
+ case 3: /* 2 - 2 - 20 */
+ MEM_writeLE32(ostart, (U32)((U32)set_rle + (3<<2) + (srcSize<<4)));
+ break;
+ default: /* not necessary : flSize is {1,2,3} */
+ assert(0);
+ }
+
+ ostart[flSize] = *(const BYTE*)src;
+ return flSize+1;
+}
+
+
+static size_t ZSTD_minGain(size_t srcSize) { return (srcSize >> 6) + 2; }
+
+static size_t ZSTD_compressLiterals (ZSTD_CCtx* zc,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize)
+{
+ size_t const minGain = ZSTD_minGain(srcSize);
+ size_t const lhSize = 3 + (srcSize >= 1 KB) + (srcSize >= 16 KB);
+ BYTE* const ostart = (BYTE*)dst;
+ U32 singleStream = srcSize < 256;
+ symbolEncodingType_e hType = set_compressed;
+ size_t cLitSize;
+
+
+ /* small ? don't even attempt compression (speed opt) */
+# define LITERAL_NOENTROPY 63
+ { size_t const minLitSize = zc->hufCTable_repeatMode == HUF_repeat_valid ? 6 : LITERAL_NOENTROPY;
+ if (srcSize <= minLitSize) return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize);
+ }
+
+ if (dstCapacity < lhSize+1) return ERROR(dstSize_tooSmall); /* not enough space for compression */
+ { HUF_repeat repeat = zc->hufCTable_repeatMode;
+ int const preferRepeat = zc->appliedParams.cParams.strategy < ZSTD_lazy ? srcSize <= 1024 : 0;
+ if (repeat == HUF_repeat_valid && lhSize == 3) singleStream = 1;
+ cLitSize = singleStream ? HUF_compress1X_repeat(ostart+lhSize, dstCapacity-lhSize, src, srcSize, 255, 11,
+ zc->entropyScratchSpace, entropyScratchSpace_size, zc->hufCTable, &repeat, preferRepeat)
+ : HUF_compress4X_repeat(ostart+lhSize, dstCapacity-lhSize, src, srcSize, 255, 11,
+ zc->entropyScratchSpace, entropyScratchSpace_size, zc->hufCTable, &repeat, preferRepeat);
+ if (repeat != HUF_repeat_none) { hType = set_repeat; } /* reused the existing table */
+ else { zc->hufCTable_repeatMode = HUF_repeat_check; } /* now have a table to reuse */
+ }
+
+ if ((cLitSize==0) | (cLitSize >= srcSize - minGain)) {
+ zc->hufCTable_repeatMode = HUF_repeat_none;
+ return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize);
+ }
+ if (cLitSize==1) {
+ zc->hufCTable_repeatMode = HUF_repeat_none;
+ return ZSTD_compressRleLiteralsBlock(dst, dstCapacity, src, srcSize);
+ }
+
+ /* Build header */
+ switch(lhSize)
+ {
+ case 3: /* 2 - 2 - 10 - 10 */
+ { U32 const lhc = hType + ((!singleStream) << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<14);
+ MEM_writeLE24(ostart, lhc);
+ break;
+ }
+ case 4: /* 2 - 2 - 14 - 14 */
+ { U32 const lhc = hType + (2 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<18);
+ MEM_writeLE32(ostart, lhc);
+ break;
+ }
+ case 5: /* 2 - 2 - 18 - 18 */
+ { U32 const lhc = hType + (3 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<22);
+ MEM_writeLE32(ostart, lhc);
+ ostart[4] = (BYTE)(cLitSize >> 10);
+ break;
+ }
+ default: /* not possible : lhSize is {3,4,5} */
+ assert(0);
+ }
+ return lhSize+cLitSize;
+}
+
+static const BYTE LL_Code[64] = { 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 16, 17, 17, 18, 18, 19, 19,
+ 20, 20, 20, 20, 21, 21, 21, 21,
+ 22, 22, 22, 22, 22, 22, 22, 22,
+ 23, 23, 23, 23, 23, 23, 23, 23,
+ 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24 };
+
+static const BYTE ML_Code[128] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37,
+ 38, 38, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 39, 39,
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 };
+
+
+void ZSTD_seqToCodes(const seqStore_t* seqStorePtr)
+{
+ BYTE const LL_deltaCode = 19;
+ BYTE const ML_deltaCode = 36;
+ const seqDef* const sequences = seqStorePtr->sequencesStart;
+ BYTE* const llCodeTable = seqStorePtr->llCode;
+ BYTE* const ofCodeTable = seqStorePtr->ofCode;
+ BYTE* const mlCodeTable = seqStorePtr->mlCode;
+ U32 const nbSeq = (U32)(seqStorePtr->sequences - seqStorePtr->sequencesStart);
+ U32 u;
+ for (u=0; u<nbSeq; u++) {
+ U32 const llv = sequences[u].litLength;
+ U32 const mlv = sequences[u].matchLength;
+ llCodeTable[u] = (llv> 63) ? (BYTE)ZSTD_highbit32(llv) + LL_deltaCode : LL_Code[llv];
+ ofCodeTable[u] = (BYTE)ZSTD_highbit32(sequences[u].offset);
+ mlCodeTable[u] = (mlv>127) ? (BYTE)ZSTD_highbit32(mlv) + ML_deltaCode : ML_Code[mlv];
+ }
+ if (seqStorePtr->longLengthID==1)
+ llCodeTable[seqStorePtr->longLengthPos] = MaxLL;
+ if (seqStorePtr->longLengthID==2)
+ mlCodeTable[seqStorePtr->longLengthPos] = MaxML;
+}
+
+MEM_STATIC size_t ZSTD_compressSequences (ZSTD_CCtx* zc,
+ void* dst, size_t dstCapacity,
+ size_t srcSize)
+{
+ const int longOffsets = zc->appliedParams.cParams.windowLog > STREAM_ACCUMULATOR_MIN;
+ const seqStore_t* seqStorePtr = &(zc->seqStore);
+ U32 count[MaxSeq+1];
+ S16 norm[MaxSeq+1];
+ FSE_CTable* CTable_LitLength = zc->litlengthCTable;
+ FSE_CTable* CTable_OffsetBits = zc->offcodeCTable;
+ FSE_CTable* CTable_MatchLength = zc->matchlengthCTable;
+ U32 LLtype, Offtype, MLtype; /* compressed, raw or rle */
+ const seqDef* const sequences = seqStorePtr->sequencesStart;
+ const BYTE* const ofCodeTable = seqStorePtr->ofCode;
+ const BYTE* const llCodeTable = seqStorePtr->llCode;
+ const BYTE* const mlCodeTable = seqStorePtr->mlCode;
+ BYTE* const ostart = (BYTE*)dst;
+ BYTE* const oend = ostart + dstCapacity;
+ BYTE* op = ostart;
+ size_t const nbSeq = seqStorePtr->sequences - seqStorePtr->sequencesStart;
+ BYTE* seqHead;
+ BYTE scratchBuffer[1<<MAX(MLFSELog,LLFSELog)];
+
+ /* Compress literals */
+ { const BYTE* const literals = seqStorePtr->litStart;
+ size_t const litSize = seqStorePtr->lit - literals;
+ size_t const cSize = ZSTD_compressLiterals(zc, op, dstCapacity, literals, litSize);
+ if (ZSTD_isError(cSize)) return cSize;
+ op += cSize;
+ }
+
+ /* Sequences Header */
+ if ((oend-op) < 3 /*max nbSeq Size*/ + 1 /*seqHead */) return ERROR(dstSize_tooSmall);
+ if (nbSeq < 0x7F) *op++ = (BYTE)nbSeq;
+ else if (nbSeq < LONGNBSEQ) op[0] = (BYTE)((nbSeq>>8) + 0x80), op[1] = (BYTE)nbSeq, op+=2;
+ else op[0]=0xFF, MEM_writeLE16(op+1, (U16)(nbSeq - LONGNBSEQ)), op+=3;
+ if (nbSeq==0) goto _check_compressibility;
+
+ /* seqHead : flags for FSE encoding type */
+ seqHead = op++;
+
+#define MIN_SEQ_FOR_DYNAMIC_FSE 64
+#define MAX_SEQ_FOR_STATIC_FSE 1000
+
+ /* convert length/distances into codes */
+ ZSTD_seqToCodes(seqStorePtr);
+
+ /* CTable for Literal Lengths */
+ { U32 max = MaxLL;
+ size_t const mostFrequent = FSE_countFast_wksp(count, &max, llCodeTable, nbSeq, zc->entropyScratchSpace);
+ if ((mostFrequent == nbSeq) && (nbSeq > 2)) {
+ *op++ = llCodeTable[0];
+ FSE_buildCTable_rle(CTable_LitLength, (BYTE)max);
+ LLtype = set_rle;
+ } else if ((zc->fseCTables_ready) && (nbSeq < MAX_SEQ_FOR_STATIC_FSE)) {
+ LLtype = set_repeat;
+ } else if ((nbSeq < MIN_SEQ_FOR_DYNAMIC_FSE) || (mostFrequent < (nbSeq >> (LL_defaultNormLog-1)))) {
+ FSE_buildCTable_wksp(CTable_LitLength, LL_defaultNorm, MaxLL, LL_defaultNormLog, scratchBuffer, sizeof(scratchBuffer));
+ LLtype = set_basic;
+ } else {
+ size_t nbSeq_1 = nbSeq;
+ const U32 tableLog = FSE_optimalTableLog(LLFSELog, nbSeq, max);
+ if (count[llCodeTable[nbSeq-1]]>1) { count[llCodeTable[nbSeq-1]]--; nbSeq_1--; }
+ FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max);
+ { size_t const NCountSize = FSE_writeNCount(op, oend-op, norm, max, tableLog); /* overflow protected */
+ if (FSE_isError(NCountSize)) return NCountSize;
+ op += NCountSize; }
+ FSE_buildCTable_wksp(CTable_LitLength, norm, max, tableLog, scratchBuffer, sizeof(scratchBuffer));
+ LLtype = set_compressed;
+ } }
+
+ /* CTable for Offsets */
+ { U32 max = MaxOff;
+ size_t const mostFrequent = FSE_countFast_wksp(count, &max, ofCodeTable, nbSeq, zc->entropyScratchSpace);
+ if ((mostFrequent == nbSeq) && (nbSeq > 2)) {
+ *op++ = ofCodeTable[0];
+ FSE_buildCTable_rle(CTable_OffsetBits, (BYTE)max);
+ Offtype = set_rle;
+ } else if ((zc->fseCTables_ready) && (nbSeq < MAX_SEQ_FOR_STATIC_FSE)) {
+ Offtype = set_repeat;
+ } else if ((nbSeq < MIN_SEQ_FOR_DYNAMIC_FSE) || (mostFrequent < (nbSeq >> (OF_defaultNormLog-1)))) {
+ FSE_buildCTable_wksp(CTable_OffsetBits, OF_defaultNorm, MaxOff, OF_defaultNormLog, scratchBuffer, sizeof(scratchBuffer));
+ Offtype = set_basic;
+ } else {
+ size_t nbSeq_1 = nbSeq;
+ const U32 tableLog = FSE_optimalTableLog(OffFSELog, nbSeq, max);
+ if (count[ofCodeTable[nbSeq-1]]>1) { count[ofCodeTable[nbSeq-1]]--; nbSeq_1--; }
+ FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max);
+ { size_t const NCountSize = FSE_writeNCount(op, oend-op, norm, max, tableLog); /* overflow protected */
+ if (FSE_isError(NCountSize)) return NCountSize;
+ op += NCountSize; }
+ FSE_buildCTable_wksp(CTable_OffsetBits, norm, max, tableLog, scratchBuffer, sizeof(scratchBuffer));
+ Offtype = set_compressed;
+ } }
+
+ /* CTable for MatchLengths */
+ { U32 max = MaxML;
+ size_t const mostFrequent = FSE_countFast_wksp(count, &max, mlCodeTable, nbSeq, zc->entropyScratchSpace);
+ if ((mostFrequent == nbSeq) && (nbSeq > 2)) {
+ *op++ = *mlCodeTable;
+ FSE_buildCTable_rle(CTable_MatchLength, (BYTE)max);
+ MLtype = set_rle;
+ } else if ((zc->fseCTables_ready) && (nbSeq < MAX_SEQ_FOR_STATIC_FSE)) {
+ MLtype = set_repeat;
+ } else if ((nbSeq < MIN_SEQ_FOR_DYNAMIC_FSE) || (mostFrequent < (nbSeq >> (ML_defaultNormLog-1)))) {
+ FSE_buildCTable_wksp(CTable_MatchLength, ML_defaultNorm, MaxML, ML_defaultNormLog, scratchBuffer, sizeof(scratchBuffer));
+ MLtype = set_basic;
+ } else {
+ size_t nbSeq_1 = nbSeq;
+ const U32 tableLog = FSE_optimalTableLog(MLFSELog, nbSeq, max);
+ if (count[mlCodeTable[nbSeq-1]]>1) { count[mlCodeTable[nbSeq-1]]--; nbSeq_1--; }
+ FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max);
+ { size_t const NCountSize = FSE_writeNCount(op, oend-op, norm, max, tableLog); /* overflow protected */
+ if (FSE_isError(NCountSize)) return NCountSize;
+ op += NCountSize; }
+ FSE_buildCTable_wksp(CTable_MatchLength, norm, max, tableLog, scratchBuffer, sizeof(scratchBuffer));
+ MLtype = set_compressed;
+ } }
+
+ *seqHead = (BYTE)((LLtype<<6) + (Offtype<<4) + (MLtype<<2));
+ zc->fseCTables_ready = 0;
+
+ /* Encoding Sequences */
+ { BIT_CStream_t blockStream;
+ FSE_CState_t stateMatchLength;
+ FSE_CState_t stateOffsetBits;
+ FSE_CState_t stateLitLength;
+
+ CHECK_E(BIT_initCStream(&blockStream, op, oend-op), dstSize_tooSmall); /* not enough space remaining */
+
+ /* first symbols */
+ FSE_initCState2(&stateMatchLength, CTable_MatchLength, mlCodeTable[nbSeq-1]);
+ FSE_initCState2(&stateOffsetBits, CTable_OffsetBits, ofCodeTable[nbSeq-1]);
+ FSE_initCState2(&stateLitLength, CTable_LitLength, llCodeTable[nbSeq-1]);
+ BIT_addBits(&blockStream, sequences[nbSeq-1].litLength, LL_bits[llCodeTable[nbSeq-1]]);
+ if (MEM_32bits()) BIT_flushBits(&blockStream);
+ BIT_addBits(&blockStream, sequences[nbSeq-1].matchLength, ML_bits[mlCodeTable[nbSeq-1]]);
+ if (MEM_32bits()) BIT_flushBits(&blockStream);
+ if (longOffsets) {
+ U32 const ofBits = ofCodeTable[nbSeq-1];
+ int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1);
+ if (extraBits) {
+ BIT_addBits(&blockStream, sequences[nbSeq-1].offset, extraBits);
+ BIT_flushBits(&blockStream);
+ }
+ BIT_addBits(&blockStream, sequences[nbSeq-1].offset >> extraBits,
+ ofBits - extraBits);
+ } else {
+ BIT_addBits(&blockStream, sequences[nbSeq-1].offset, ofCodeTable[nbSeq-1]);
+ }
+ BIT_flushBits(&blockStream);
+
+ { size_t n;
+ for (n=nbSeq-2 ; n<nbSeq ; n--) { /* intentional underflow */
+ BYTE const llCode = llCodeTable[n];
+ BYTE const ofCode = ofCodeTable[n];
+ BYTE const mlCode = mlCodeTable[n];
+ U32 const llBits = LL_bits[llCode];
+ U32 const ofBits = ofCode; /* 32b*/ /* 64b*/
+ U32 const mlBits = ML_bits[mlCode];
+ /* (7)*/ /* (7)*/
+ FSE_encodeSymbol(&blockStream, &stateOffsetBits, ofCode); /* 15 */ /* 15 */
+ FSE_encodeSymbol(&blockStream, &stateMatchLength, mlCode); /* 24 */ /* 24 */
+ if (MEM_32bits()) BIT_flushBits(&blockStream); /* (7)*/
+ FSE_encodeSymbol(&blockStream, &stateLitLength, llCode); /* 16 */ /* 33 */
+ if (MEM_32bits() || (ofBits+mlBits+llBits >= 64-7-(LLFSELog+MLFSELog+OffFSELog)))
+ BIT_flushBits(&blockStream); /* (7)*/
+ BIT_addBits(&blockStream, sequences[n].litLength, llBits);
+ if (MEM_32bits() && ((llBits+mlBits)>24)) BIT_flushBits(&blockStream);
+ BIT_addBits(&blockStream, sequences[n].matchLength, mlBits);
+ if (MEM_32bits()) BIT_flushBits(&blockStream); /* (7)*/
+ if (longOffsets) {
+ int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1);
+ if (extraBits) {
+ BIT_addBits(&blockStream, sequences[n].offset, extraBits);
+ BIT_flushBits(&blockStream); /* (7)*/
+ }
+ BIT_addBits(&blockStream, sequences[n].offset >> extraBits,
+ ofBits - extraBits); /* 31 */
+ } else {
+ BIT_addBits(&blockStream, sequences[n].offset, ofBits); /* 31 */
+ }
+ BIT_flushBits(&blockStream); /* (7)*/
+ } }
+
+ FSE_flushCState(&blockStream, &stateMatchLength);
+ FSE_flushCState(&blockStream, &stateOffsetBits);
+ FSE_flushCState(&blockStream, &stateLitLength);
+
+ { size_t const streamSize = BIT_closeCStream(&blockStream);
+ if (streamSize==0) return ERROR(dstSize_tooSmall); /* not enough space */
+ op += streamSize;
+ } }
+
+ /* check compressibility */
+_check_compressibility:
+ { size_t const minGain = ZSTD_minGain(srcSize);
+ size_t const maxCSize = srcSize - minGain;
+ if ((size_t)(op-ostart) >= maxCSize) {
+ zc->hufCTable_repeatMode = HUF_repeat_none;
+ return 0;
+ } }
+
+ /* confirm repcodes */
+ { int i; for (i=0; i<ZSTD_REP_NUM; i++) zc->rep[i] = zc->repToConfirm[i]; }
+
+ return op - ostart;
+}
+
+
+/*! ZSTD_storeSeq() :
+ Store a sequence (literal length, literals, offset code and match length code) into seqStore_t.
+ `offsetCode` : distance to match, or 0 == repCode.
+ `matchCode` : matchLength - MINMATCH
+*/
+MEM_STATIC void ZSTD_storeSeq(seqStore_t* seqStorePtr, size_t litLength, const void* literals, U32 offsetCode, size_t matchCode)
+{
+#if defined(ZSTD_DEBUG) && (ZSTD_DEBUG >= 6)
+ static const BYTE* g_start = NULL;
+ U32 const pos = (U32)((const BYTE*)literals - g_start);
+ if (g_start==NULL) g_start = (const BYTE*)literals;
+ if ((pos > 0) && (pos < 1000000000))
+ DEBUGLOG(6, "Cpos %6u :%5u literals & match %3u bytes at distance %6u",
+ pos, (U32)litLength, (U32)matchCode+MINMATCH, (U32)offsetCode);
+#endif
+ /* copy Literals */
+ assert(seqStorePtr->lit + litLength <= seqStorePtr->litStart + 128 KB);
+ ZSTD_wildcopy(seqStorePtr->lit, literals, litLength);
+ seqStorePtr->lit += litLength;
+
+ /* literal Length */
+ if (litLength>0xFFFF) {
+ seqStorePtr->longLengthID = 1;
+ seqStorePtr->longLengthPos = (U32)(seqStorePtr->sequences - seqStorePtr->sequencesStart);
+ }
+ seqStorePtr->sequences[0].litLength = (U16)litLength;
+
+ /* match offset */
+ seqStorePtr->sequences[0].offset = offsetCode + 1;
+
+ /* match Length */
+ if (matchCode>0xFFFF) {
+ seqStorePtr->longLengthID = 2;
+ seqStorePtr->longLengthPos = (U32)(seqStorePtr->sequences - seqStorePtr->sequencesStart);
+ }
+ seqStorePtr->sequences[0].matchLength = (U16)matchCode;
+
+ seqStorePtr->sequences++;
+}
+
+
+/*-*************************************
+* Match length counter
+***************************************/
+static unsigned ZSTD_NbCommonBytes (register size_t val)
+{
+ if (MEM_isLittleEndian()) {
+ if (MEM_64bits()) {
+# if defined(_MSC_VER) && defined(_WIN64)
+ unsigned long r = 0;
+ _BitScanForward64( &r, (U64)val );
+ return (unsigned)(r>>3);
+# elif defined(__GNUC__) && (__GNUC__ >= 3)
+ return (__builtin_ctzll((U64)val) >> 3);
+# else
+ static const int DeBruijnBytePos[64] = { 0, 0, 0, 0, 0, 1, 1, 2,
+ 0, 3, 1, 3, 1, 4, 2, 7,
+ 0, 2, 3, 6, 1, 5, 3, 5,
+ 1, 3, 4, 4, 2, 5, 6, 7,
+ 7, 0, 1, 2, 3, 3, 4, 6,
+ 2, 6, 5, 5, 3, 4, 5, 6,
+ 7, 1, 2, 4, 6, 4, 4, 5,
+ 7, 2, 6, 5, 7, 6, 7, 7 };
+ return DeBruijnBytePos[((U64)((val & -(long long)val) * 0x0218A392CDABBD3FULL)) >> 58];
+# endif
+ } else { /* 32 bits */
+# if defined(_MSC_VER)
+ unsigned long r=0;
+ _BitScanForward( &r, (U32)val );
+ return (unsigned)(r>>3);
+# elif defined(__GNUC__) && (__GNUC__ >= 3)
+ return (__builtin_ctz((U32)val) >> 3);
+# else
+ static const int DeBruijnBytePos[32] = { 0, 0, 3, 0, 3, 1, 3, 0,
+ 3, 2, 2, 1, 3, 2, 0, 1,
+ 3, 3, 1, 2, 2, 2, 2, 0,
+ 3, 1, 2, 0, 1, 0, 1, 1 };
+ return DeBruijnBytePos[((U32)((val & -(S32)val) * 0x077CB531U)) >> 27];
+# endif
+ }
+ } else { /* Big Endian CPU */
+ if (MEM_64bits()) {
+# if defined(_MSC_VER) && defined(_WIN64)
+ unsigned long r = 0;
+ _BitScanReverse64( &r, val );
+ return (unsigned)(r>>3);
+# elif defined(__GNUC__) && (__GNUC__ >= 3)
+ return (__builtin_clzll(val) >> 3);
+# else
+ unsigned r;
+ const unsigned n32 = sizeof(size_t)*4; /* calculate this way due to compiler complaining in 32-bits mode */
+ if (!(val>>n32)) { r=4; } else { r=0; val>>=n32; }
+ if (!(val>>16)) { r+=2; val>>=8; } else { val>>=24; }
+ r += (!val);
+ return r;
+# endif
+ } else { /* 32 bits */
+# if defined(_MSC_VER)
+ unsigned long r = 0;
+ _BitScanReverse( &r, (unsigned long)val );
+ return (unsigned)(r>>3);
+# elif defined(__GNUC__) && (__GNUC__ >= 3)
+ return (__builtin_clz((U32)val) >> 3);
+# else
+ unsigned r;
+ if (!(val>>16)) { r=2; val>>=8; } else { r=0; val>>=24; }
+ r += (!val);
+ return r;
+# endif
+ } }
+}
+
+
+static size_t ZSTD_count(const BYTE* pIn, const BYTE* pMatch, const BYTE* const pInLimit)
+{
+ const BYTE* const pStart = pIn;
+ const BYTE* const pInLoopLimit = pInLimit - (sizeof(size_t)-1);
+
+ while (pIn < pInLoopLimit) {
+ size_t const diff = MEM_readST(pMatch) ^ MEM_readST(pIn);
+ if (!diff) { pIn+=sizeof(size_t); pMatch+=sizeof(size_t); continue; }
+ pIn += ZSTD_NbCommonBytes(diff);
+ return (size_t)(pIn - pStart);
+ }
+ if (MEM_64bits()) if ((pIn<(pInLimit-3)) && (MEM_read32(pMatch) == MEM_read32(pIn))) { pIn+=4; pMatch+=4; }
+ if ((pIn<(pInLimit-1)) && (MEM_read16(pMatch) == MEM_read16(pIn))) { pIn+=2; pMatch+=2; }
+ if ((pIn<pInLimit) && (*pMatch == *pIn)) pIn++;
+ return (size_t)(pIn - pStart);
+}
+
+/** ZSTD_count_2segments() :
+* can count match length with `ip` & `match` in 2 different segments.
+* convention : on reaching mEnd, match count continue starting from iStart
+*/
+static size_t ZSTD_count_2segments(const BYTE* ip, const BYTE* match, const BYTE* iEnd, const BYTE* mEnd, const BYTE* iStart)
+{
+ const BYTE* const vEnd = MIN( ip + (mEnd - match), iEnd);
+ size_t const matchLength = ZSTD_count(ip, match, vEnd);
+ if (match + matchLength != mEnd) return matchLength;
+ return matchLength + ZSTD_count(ip+matchLength, iStart, iEnd);
+}
+
+
+/*-*************************************
+* Hashes
+***************************************/
+static const U32 prime3bytes = 506832829U;
+static U32 ZSTD_hash3(U32 u, U32 h) { return ((u << (32-24)) * prime3bytes) >> (32-h) ; }
+MEM_STATIC size_t ZSTD_hash3Ptr(const void* ptr, U32 h) { return ZSTD_hash3(MEM_readLE32(ptr), h); } /* only in zstd_opt.h */
+
+static const U32 prime4bytes = 2654435761U;
+static U32 ZSTD_hash4(U32 u, U32 h) { return (u * prime4bytes) >> (32-h) ; }
+static size_t ZSTD_hash4Ptr(const void* ptr, U32 h) { return ZSTD_hash4(MEM_read32(ptr), h); }
+
+static const U64 prime5bytes = 889523592379ULL;
+static size_t ZSTD_hash5(U64 u, U32 h) { return (size_t)(((u << (64-40)) * prime5bytes) >> (64-h)) ; }
+static size_t ZSTD_hash5Ptr(const void* p, U32 h) { return ZSTD_hash5(MEM_readLE64(p), h); }
+
+static const U64 prime6bytes = 227718039650203ULL;
+static size_t ZSTD_hash6(U64 u, U32 h) { return (size_t)(((u << (64-48)) * prime6bytes) >> (64-h)) ; }
+static size_t ZSTD_hash6Ptr(const void* p, U32 h) { return ZSTD_hash6(MEM_readLE64(p), h); }
+
+static const U64 prime7bytes = 58295818150454627ULL;
+static size_t ZSTD_hash7(U64 u, U32 h) { return (size_t)(((u << (64-56)) * prime7bytes) >> (64-h)) ; }
+static size_t ZSTD_hash7Ptr(const void* p, U32 h) { return ZSTD_hash7(MEM_readLE64(p), h); }
+
+static const U64 prime8bytes = 0xCF1BBCDCB7A56463ULL;
+static size_t ZSTD_hash8(U64 u, U32 h) { return (size_t)(((u) * prime8bytes) >> (64-h)) ; }
+static size_t ZSTD_hash8Ptr(const void* p, U32 h) { return ZSTD_hash8(MEM_readLE64(p), h); }
+
+static size_t ZSTD_hashPtr(const void* p, U32 hBits, U32 mls)
+{
+ switch(mls)
+ {
+ default:
+ case 4: return ZSTD_hash4Ptr(p, hBits);
+ case 5: return ZSTD_hash5Ptr(p, hBits);
+ case 6: return ZSTD_hash6Ptr(p, hBits);
+ case 7: return ZSTD_hash7Ptr(p, hBits);
+ case 8: return ZSTD_hash8Ptr(p, hBits);
+ }
+}
+
+
+/*-*************************************
+* Fast Scan
+***************************************/
+static void ZSTD_fillHashTable (ZSTD_CCtx* zc, const void* end, const U32 mls)
+{
+ U32* const hashTable = zc->hashTable;
+ U32 const hBits = zc->appliedParams.cParams.hashLog;
+ const BYTE* const base = zc->base;
+ const BYTE* ip = base + zc->nextToUpdate;
+ const BYTE* const iend = ((const BYTE*)end) - HASH_READ_SIZE;
+ const size_t fastHashFillStep = 3;
+
+ while(ip <= iend) {
+ hashTable[ZSTD_hashPtr(ip, hBits, mls)] = (U32)(ip - base);
+ ip += fastHashFillStep;
+ }
+}
+
+
+FORCE_INLINE
+void ZSTD_compressBlock_fast_generic(ZSTD_CCtx* cctx,
+ const void* src, size_t srcSize,
+ const U32 mls)
+{
+ U32* const hashTable = cctx->hashTable;
+ U32 const hBits = cctx->appliedParams.cParams.hashLog;
+ seqStore_t* seqStorePtr = &(cctx->seqStore);
+ const BYTE* const base = cctx->base;
+ const BYTE* const istart = (const BYTE*)src;
+ const BYTE* ip = istart;
+ const BYTE* anchor = istart;
+ const U32 lowestIndex = cctx->dictLimit;
+ const BYTE* const lowest = base + lowestIndex;
+ const BYTE* const iend = istart + srcSize;
+ const BYTE* const ilimit = iend - HASH_READ_SIZE;
+ U32 offset_1=cctx->rep[0], offset_2=cctx->rep[1];
+ U32 offsetSaved = 0;
+
+ /* init */
+ ip += (ip==lowest);
+ { U32 const maxRep = (U32)(ip-lowest);
+ if (offset_2 > maxRep) offsetSaved = offset_2, offset_2 = 0;
+ if (offset_1 > maxRep) offsetSaved = offset_1, offset_1 = 0;
+ }
+
+ /* Main Search Loop */
+ while (ip < ilimit) { /* < instead of <=, because repcode check at (ip+1) */
+ size_t mLength;
+ size_t const h = ZSTD_hashPtr(ip, hBits, mls);
+ U32 const current = (U32)(ip-base);
+ U32 const matchIndex = hashTable[h];
+ const BYTE* match = base + matchIndex;
+ hashTable[h] = current; /* update hash table */
+
+ if ((offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1))) {
+ mLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4;
+ ip++;
+ ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH);
+ } else {
+ U32 offset;
+ if ( (matchIndex <= lowestIndex) || (MEM_read32(match) != MEM_read32(ip)) ) {
+ ip += ((ip-anchor) >> g_searchStrength) + 1;
+ continue;
+ }
+ mLength = ZSTD_count(ip+4, match+4, iend) + 4;
+ offset = (U32)(ip-match);
+ while (((ip>anchor) & (match>lowest)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */
+ offset_2 = offset_1;
+ offset_1 = offset;
+
+ ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH);
+ }
+
+ /* match found */
+ ip += mLength;
+ anchor = ip;
+
+ if (ip <= ilimit) {
+ /* Fill Table */
+ hashTable[ZSTD_hashPtr(base+current+2, hBits, mls)] = current+2; /* here because current+2 could be > iend-8 */
+ hashTable[ZSTD_hashPtr(ip-2, hBits, mls)] = (U32)(ip-2-base);
+ /* check immediate repcode */
+ while ( (ip <= ilimit)
+ && ( (offset_2>0)
+ & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) {
+ /* store sequence */
+ size_t const rLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4;
+ { U32 const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff; } /* swap offset_2 <=> offset_1 */
+ hashTable[ZSTD_hashPtr(ip, hBits, mls)] = (U32)(ip-base);
+ ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, rLength-MINMATCH);
+ ip += rLength;
+ anchor = ip;
+ continue; /* faster when present ... (?) */
+ } } }
+
+ /* save reps for next block */
+ cctx->repToConfirm[0] = offset_1 ? offset_1 : offsetSaved;
+ cctx->repToConfirm[1] = offset_2 ? offset_2 : offsetSaved;
+
+ /* Last Literals */
+ { size_t const lastLLSize = iend - anchor;
+ memcpy(seqStorePtr->lit, anchor, lastLLSize);
+ seqStorePtr->lit += lastLLSize;
+ }
+}
+
+
+static void ZSTD_compressBlock_fast(ZSTD_CCtx* ctx,
+ const void* src, size_t srcSize)
+{
+ const U32 mls = ctx->appliedParams.cParams.searchLength;
+ switch(mls)
+ {
+ default: /* includes case 3 */
+ case 4 :
+ ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 4); return;
+ case 5 :
+ ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 5); return;
+ case 6 :
+ ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 6); return;
+ case 7 :
+ ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 7); return;
+ }
+}
+
+
+static void ZSTD_compressBlock_fast_extDict_generic(ZSTD_CCtx* ctx,
+ const void* src, size_t srcSize,
+ const U32 mls)
+{
+ U32* hashTable = ctx->hashTable;
+ const U32 hBits = ctx->appliedParams.cParams.hashLog;
+ seqStore_t* seqStorePtr = &(ctx->seqStore);
+ const BYTE* const base = ctx->base;
+ const BYTE* const dictBase = ctx->dictBase;
+ const BYTE* const istart = (const BYTE*)src;
+ const BYTE* ip = istart;
+ const BYTE* anchor = istart;
+ const U32 lowestIndex = ctx->lowLimit;
+ const BYTE* const dictStart = dictBase + lowestIndex;
+ const U32 dictLimit = ctx->dictLimit;
+ const BYTE* const lowPrefixPtr = base + dictLimit;
+ const BYTE* const dictEnd = dictBase + dictLimit;
+ const BYTE* const iend = istart + srcSize;
+ const BYTE* const ilimit = iend - 8;
+ U32 offset_1=ctx->rep[0], offset_2=ctx->rep[1];
+
+ /* Search Loop */
+ while (ip < ilimit) { /* < instead of <=, because (ip+1) */
+ const size_t h = ZSTD_hashPtr(ip, hBits, mls);
+ const U32 matchIndex = hashTable[h];
+ const BYTE* matchBase = matchIndex < dictLimit ? dictBase : base;
+ const BYTE* match = matchBase + matchIndex;
+ const U32 current = (U32)(ip-base);
+ const U32 repIndex = current + 1 - offset_1; /* offset_1 expected <= current +1 */
+ const BYTE* repBase = repIndex < dictLimit ? dictBase : base;
+ const BYTE* repMatch = repBase + repIndex;
+ size_t mLength;
+ hashTable[h] = current; /* update hash table */
+
+ if ( (((U32)((dictLimit-1) - repIndex) >= 3) /* intentional underflow */ & (repIndex > lowestIndex))
+ && (MEM_read32(repMatch) == MEM_read32(ip+1)) ) {
+ const BYTE* repMatchEnd = repIndex < dictLimit ? dictEnd : iend;
+ mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, lowPrefixPtr) + 4;
+ ip++;
+ ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH);
+ } else {
+ if ( (matchIndex < lowestIndex) ||
+ (MEM_read32(match) != MEM_read32(ip)) ) {
+ ip += ((ip-anchor) >> g_searchStrength) + 1;
+ continue;
+ }
+ { const BYTE* matchEnd = matchIndex < dictLimit ? dictEnd : iend;
+ const BYTE* lowMatchPtr = matchIndex < dictLimit ? dictStart : lowPrefixPtr;
+ U32 offset;
+ mLength = ZSTD_count_2segments(ip+4, match+4, iend, matchEnd, lowPrefixPtr) + 4;
+ while (((ip>anchor) & (match>lowMatchPtr)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */
+ offset = current - matchIndex;
+ offset_2 = offset_1;
+ offset_1 = offset;
+ ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH);
+ } }
+
+ /* found a match : store it */
+ ip += mLength;
+ anchor = ip;
+
+ if (ip <= ilimit) {
+ /* Fill Table */
+ hashTable[ZSTD_hashPtr(base+current+2, hBits, mls)] = current+2;
+ hashTable[ZSTD_hashPtr(ip-2, hBits, mls)] = (U32)(ip-2-base);
+ /* check immediate repcode */
+ while (ip <= ilimit) {
+ U32 const current2 = (U32)(ip-base);
+ U32 const repIndex2 = current2 - offset_2;
+ const BYTE* repMatch2 = repIndex2 < dictLimit ? dictBase + repIndex2 : base + repIndex2;
+ if ( (((U32)((dictLimit-1) - repIndex2) >= 3) & (repIndex2 > lowestIndex)) /* intentional overflow */
+ && (MEM_read32(repMatch2) == MEM_read32(ip)) ) {
+ const BYTE* const repEnd2 = repIndex2 < dictLimit ? dictEnd : iend;
+ size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, lowPrefixPtr) + 4;
+ U32 tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; /* swap offset_2 <=> offset_1 */
+ ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, repLength2-MINMATCH);
+ hashTable[ZSTD_hashPtr(ip, hBits, mls)] = current2;
+ ip += repLength2;
+ anchor = ip;
+ continue;
+ }
+ break;
+ } } }
+
+ /* save reps for next block */
+ ctx->repToConfirm[0] = offset_1; ctx->repToConfirm[1] = offset_2;
+
+ /* Last Literals */
+ { size_t const lastLLSize = iend - anchor;
+ memcpy(seqStorePtr->lit, anchor, lastLLSize);
+ seqStorePtr->lit += lastLLSize;
+ }
+}
+
+
+static void ZSTD_compressBlock_fast_extDict(ZSTD_CCtx* ctx,
+ const void* src, size_t srcSize)
+{
+ U32 const mls = ctx->appliedParams.cParams.searchLength;
+ switch(mls)
+ {
+ default: /* includes case 3 */
+ case 4 :
+ ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 4); return;
+ case 5 :
+ ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 5); return;
+ case 6 :
+ ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 6); return;
+ case 7 :
+ ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 7); return;
+ }
+}
+
+
+/*-*************************************
+* Double Fast
+***************************************/
+static void ZSTD_fillDoubleHashTable (ZSTD_CCtx* cctx, const void* end, const U32 mls)
+{
+ U32* const hashLarge = cctx->hashTable;
+ U32 const hBitsL = cctx->appliedParams.cParams.hashLog;
+ U32* const hashSmall = cctx->chainTable;
+ U32 const hBitsS = cctx->appliedParams.cParams.chainLog;
+ const BYTE* const base = cctx->base;
+ const BYTE* ip = base + cctx->nextToUpdate;
+ const BYTE* const iend = ((const BYTE*)end) - HASH_READ_SIZE;
+ const size_t fastHashFillStep = 3;
+
+ while(ip <= iend) {
+ hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = (U32)(ip - base);
+ hashLarge[ZSTD_hashPtr(ip, hBitsL, 8)] = (U32)(ip - base);
+ ip += fastHashFillStep;
+ }
+}
+
+
+FORCE_INLINE
+void ZSTD_compressBlock_doubleFast_generic(ZSTD_CCtx* cctx,
+ const void* src, size_t srcSize,
+ const U32 mls)
+{
+ U32* const hashLong = cctx->hashTable;
+ const U32 hBitsL = cctx->appliedParams.cParams.hashLog;
+ U32* const hashSmall = cctx->chainTable;
+ const U32 hBitsS = cctx->appliedParams.cParams.chainLog;
+ seqStore_t* seqStorePtr = &(cctx->seqStore);
+ const BYTE* const base = cctx->base;
+ const BYTE* const istart = (const BYTE*)src;
+ const BYTE* ip = istart;
+ const BYTE* anchor = istart;
+ const U32 lowestIndex = cctx->dictLimit;
+ const BYTE* const lowest = base + lowestIndex;
+ const BYTE* const iend = istart + srcSize;
+ const BYTE* const ilimit = iend - HASH_READ_SIZE;
+ U32 offset_1=cctx->rep[0], offset_2=cctx->rep[1];
+ U32 offsetSaved = 0;
+
+ /* init */
+ ip += (ip==lowest);
+ { U32 const maxRep = (U32)(ip-lowest);
+ if (offset_2 > maxRep) offsetSaved = offset_2, offset_2 = 0;
+ if (offset_1 > maxRep) offsetSaved = offset_1, offset_1 = 0;
+ }
+
+ /* Main Search Loop */
+ while (ip < ilimit) { /* < instead of <=, because repcode check at (ip+1) */
+ size_t mLength;
+ size_t const h2 = ZSTD_hashPtr(ip, hBitsL, 8);
+ size_t const h = ZSTD_hashPtr(ip, hBitsS, mls);
+ U32 const current = (U32)(ip-base);
+ U32 const matchIndexL = hashLong[h2];
+ U32 const matchIndexS = hashSmall[h];
+ const BYTE* matchLong = base + matchIndexL;
+ const BYTE* match = base + matchIndexS;
+ hashLong[h2] = hashSmall[h] = current; /* update hash tables */
+
+ assert(offset_1 <= current); /* supposed guaranteed by construction */
+ if ((offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1))) {
+ /* favor repcode */
+ mLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4;
+ ip++;
+ ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH);
+ } else {
+ U32 offset;
+ if ( (matchIndexL > lowestIndex) && (MEM_read64(matchLong) == MEM_read64(ip)) ) {
+ mLength = ZSTD_count(ip+8, matchLong+8, iend) + 8;
+ offset = (U32)(ip-matchLong);
+ while (((ip>anchor) & (matchLong>lowest)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; } /* catch up */
+ } else if ( (matchIndexS > lowestIndex) && (MEM_read32(match) == MEM_read32(ip)) ) {
+ size_t const hl3 = ZSTD_hashPtr(ip+1, hBitsL, 8);
+ U32 const matchIndexL3 = hashLong[hl3];
+ const BYTE* matchL3 = base + matchIndexL3;
+ hashLong[hl3] = current + 1;
+ if ( (matchIndexL3 > lowestIndex) && (MEM_read64(matchL3) == MEM_read64(ip+1)) ) {
+ mLength = ZSTD_count(ip+9, matchL3+8, iend) + 8;
+ ip++;
+ offset = (U32)(ip-matchL3);
+ while (((ip>anchor) & (matchL3>lowest)) && (ip[-1] == matchL3[-1])) { ip--; matchL3--; mLength++; } /* catch up */
+ } else {
+ mLength = ZSTD_count(ip+4, match+4, iend) + 4;
+ offset = (U32)(ip-match);
+ while (((ip>anchor) & (match>lowest)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */
+ }
+ } else {
+ ip += ((ip-anchor) >> g_searchStrength) + 1;
+ continue;
+ }
+
+ offset_2 = offset_1;
+ offset_1 = offset;
+
+ ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH);
+ }
+
+ /* match found */
+ ip += mLength;
+ anchor = ip;
+
+ if (ip <= ilimit) {
+ /* Fill Table */
+ hashLong[ZSTD_hashPtr(base+current+2, hBitsL, 8)] =
+ hashSmall[ZSTD_hashPtr(base+current+2, hBitsS, mls)] = current+2; /* here because current+2 could be > iend-8 */
+ hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] =
+ hashSmall[ZSTD_hashPtr(ip-2, hBitsS, mls)] = (U32)(ip-2-base);
+
+ /* check immediate repcode */
+ while ( (ip <= ilimit)
+ && ( (offset_2>0)
+ & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) {
+ /* store sequence */
+ size_t const rLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4;
+ { U32 const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff; } /* swap offset_2 <=> offset_1 */
+ hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = (U32)(ip-base);
+ hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = (U32)(ip-base);
+ ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, rLength-MINMATCH);
+ ip += rLength;
+ anchor = ip;
+ continue; /* faster when present ... (?) */
+ } } }
+
+ /* save reps for next block */
+ cctx->repToConfirm[0] = offset_1 ? offset_1 : offsetSaved;
+ cctx->repToConfirm[1] = offset_2 ? offset_2 : offsetSaved;
+
+ /* Last Literals */
+ { size_t const lastLLSize = iend - anchor;
+ memcpy(seqStorePtr->lit, anchor, lastLLSize);
+ seqStorePtr->lit += lastLLSize;
+ }
+}
+
+
+static void ZSTD_compressBlock_doubleFast(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+ const U32 mls = ctx->appliedParams.cParams.searchLength;
+ switch(mls)
+ {
+ default: /* includes case 3 */
+ case 4 :
+ ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 4); return;
+ case 5 :
+ ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 5); return;
+ case 6 :
+ ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 6); return;
+ case 7 :
+ ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 7); return;
+ }
+}
+
+
+static void ZSTD_compressBlock_doubleFast_extDict_generic(ZSTD_CCtx* ctx,
+ const void* src, size_t srcSize,
+ const U32 mls)
+{
+ U32* const hashLong = ctx->hashTable;
+ U32 const hBitsL = ctx->appliedParams.cParams.hashLog;
+ U32* const hashSmall = ctx->chainTable;
+ U32 const hBitsS = ctx->appliedParams.cParams.chainLog;
+ seqStore_t* seqStorePtr = &(ctx->seqStore);
+ const BYTE* const base = ctx->base;
+ const BYTE* const dictBase = ctx->dictBase;
+ const BYTE* const istart = (const BYTE*)src;
+ const BYTE* ip = istart;
+ const BYTE* anchor = istart;
+ const U32 lowestIndex = ctx->lowLimit;
+ const BYTE* const dictStart = dictBase + lowestIndex;
+ const U32 dictLimit = ctx->dictLimit;
+ const BYTE* const lowPrefixPtr = base + dictLimit;
+ const BYTE* const dictEnd = dictBase + dictLimit;
+ const BYTE* const iend = istart + srcSize;
+ const BYTE* const ilimit = iend - 8;
+ U32 offset_1=ctx->rep[0], offset_2=ctx->rep[1];
+
+ /* Search Loop */
+ while (ip < ilimit) { /* < instead of <=, because (ip+1) */
+ const size_t hSmall = ZSTD_hashPtr(ip, hBitsS, mls);
+ const U32 matchIndex = hashSmall[hSmall];
+ const BYTE* matchBase = matchIndex < dictLimit ? dictBase : base;
+ const BYTE* match = matchBase + matchIndex;
+
+ const size_t hLong = ZSTD_hashPtr(ip, hBitsL, 8);
+ const U32 matchLongIndex = hashLong[hLong];
+ const BYTE* matchLongBase = matchLongIndex < dictLimit ? dictBase : base;
+ const BYTE* matchLong = matchLongBase + matchLongIndex;
+
+ const U32 current = (U32)(ip-base);
+ const U32 repIndex = current + 1 - offset_1; /* offset_1 expected <= current +1 */
+ const BYTE* repBase = repIndex < dictLimit ? dictBase : base;
+ const BYTE* repMatch = repBase + repIndex;
+ size_t mLength;
+ hashSmall[hSmall] = hashLong[hLong] = current; /* update hash table */
+
+ if ( (((U32)((dictLimit-1) - repIndex) >= 3) /* intentional underflow */ & (repIndex > lowestIndex))
+ && (MEM_read32(repMatch) == MEM_read32(ip+1)) ) {
+ const BYTE* repMatchEnd = repIndex < dictLimit ? dictEnd : iend;
+ mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, lowPrefixPtr) + 4;
+ ip++;
+ ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH);
+ } else {
+ if ((matchLongIndex > lowestIndex) && (MEM_read64(matchLong) == MEM_read64(ip))) {
+ const BYTE* matchEnd = matchLongIndex < dictLimit ? dictEnd : iend;
+ const BYTE* lowMatchPtr = matchLongIndex < dictLimit ? dictStart : lowPrefixPtr;
+ U32 offset;
+ mLength = ZSTD_count_2segments(ip+8, matchLong+8, iend, matchEnd, lowPrefixPtr) + 8;
+ offset = current - matchLongIndex;
+ while (((ip>anchor) & (matchLong>lowMatchPtr)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; } /* catch up */
+ offset_2 = offset_1;
+ offset_1 = offset;
+ ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH);
+
+ } else if ((matchIndex > lowestIndex) && (MEM_read32(match) == MEM_read32(ip))) {
+ size_t const h3 = ZSTD_hashPtr(ip+1, hBitsL, 8);
+ U32 const matchIndex3 = hashLong[h3];
+ const BYTE* const match3Base = matchIndex3 < dictLimit ? dictBase : base;
+ const BYTE* match3 = match3Base + matchIndex3;
+ U32 offset;
+ hashLong[h3] = current + 1;
+ if ( (matchIndex3 > lowestIndex) && (MEM_read64(match3) == MEM_read64(ip+1)) ) {
+ const BYTE* matchEnd = matchIndex3 < dictLimit ? dictEnd : iend;
+ const BYTE* lowMatchPtr = matchIndex3 < dictLimit ? dictStart : lowPrefixPtr;
+ mLength = ZSTD_count_2segments(ip+9, match3+8, iend, matchEnd, lowPrefixPtr) + 8;
+ ip++;
+ offset = current+1 - matchIndex3;
+ while (((ip>anchor) & (match3>lowMatchPtr)) && (ip[-1] == match3[-1])) { ip--; match3--; mLength++; } /* catch up */
+ } else {
+ const BYTE* matchEnd = matchIndex < dictLimit ? dictEnd : iend;
+ const BYTE* lowMatchPtr = matchIndex < dictLimit ? dictStart : lowPrefixPtr;
+ mLength = ZSTD_count_2segments(ip+4, match+4, iend, matchEnd, lowPrefixPtr) + 4;
+ offset = current - matchIndex;
+ while (((ip>anchor) & (match>lowMatchPtr)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */
+ }
+ offset_2 = offset_1;
+ offset_1 = offset;
+ ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH);
+
+ } else {
+ ip += ((ip-anchor) >> g_searchStrength) + 1;
+ continue;
+ } }
+
+ /* found a match : store it */
+ ip += mLength;
+ anchor = ip;
+
+ if (ip <= ilimit) {
+ /* Fill Table */
+ hashSmall[ZSTD_hashPtr(base+current+2, hBitsS, mls)] = current+2;
+ hashLong[ZSTD_hashPtr(base+current+2, hBitsL, 8)] = current+2;
+ hashSmall[ZSTD_hashPtr(ip-2, hBitsS, mls)] = (U32)(ip-2-base);
+ hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base);
+ /* check immediate repcode */
+ while (ip <= ilimit) {
+ U32 const current2 = (U32)(ip-base);
+ U32 const repIndex2 = current2 - offset_2;
+ const BYTE* repMatch2 = repIndex2 < dictLimit ? dictBase + repIndex2 : base + repIndex2;
+ if ( (((U32)((dictLimit-1) - repIndex2) >= 3) & (repIndex2 > lowestIndex)) /* intentional overflow */
+ && (MEM_read32(repMatch2) == MEM_read32(ip)) ) {
+ const BYTE* const repEnd2 = repIndex2 < dictLimit ? dictEnd : iend;
+ size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, lowPrefixPtr) + 4;
+ U32 tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; /* swap offset_2 <=> offset_1 */
+ ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, repLength2-MINMATCH);
+ hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = current2;
+ hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = current2;
+ ip += repLength2;
+ anchor = ip;
+ continue;
+ }
+ break;
+ } } }
+
+ /* save reps for next block */
+ ctx->repToConfirm[0] = offset_1; ctx->repToConfirm[1] = offset_2;
+
+ /* Last Literals */
+ { size_t const lastLLSize = iend - anchor;
+ memcpy(seqStorePtr->lit, anchor, lastLLSize);
+ seqStorePtr->lit += lastLLSize;
+ }
+}
+
+
+static void ZSTD_compressBlock_doubleFast_extDict(ZSTD_CCtx* ctx,
+ const void* src, size_t srcSize)
+{
+ U32 const mls = ctx->appliedParams.cParams.searchLength;
+ switch(mls)
+ {
+ default: /* includes case 3 */
+ case 4 :
+ ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 4); return;
+ case 5 :
+ ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 5); return;
+ case 6 :
+ ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 6); return;
+ case 7 :
+ ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 7); return;
+ }
+}
+
+
+/*-*************************************
+* Binary Tree search
+***************************************/
+/** ZSTD_insertBt1() : add one or multiple positions to tree.
+* ip : assumed <= iend-8 .
+* @return : nb of positions added */
+static U32 ZSTD_insertBt1(ZSTD_CCtx* zc, const BYTE* const ip, const U32 mls, const BYTE* const iend, U32 nbCompares,
+ U32 extDict)
+{
+ U32* const hashTable = zc->hashTable;
+ U32 const hashLog = zc->appliedParams.cParams.hashLog;
+ size_t const h = ZSTD_hashPtr(ip, hashLog, mls);
+ U32* const bt = zc->chainTable;
+ U32 const btLog = zc->appliedParams.cParams.chainLog - 1;
+ U32 const btMask = (1 << btLog) - 1;
+ U32 matchIndex = hashTable[h];
+ size_t commonLengthSmaller=0, commonLengthLarger=0;
+ const BYTE* const base = zc->base;
+ const BYTE* const dictBase = zc->dictBase;
+ const U32 dictLimit = zc->dictLimit;
+ const BYTE* const dictEnd = dictBase + dictLimit;
+ const BYTE* const prefixStart = base + dictLimit;
+ const BYTE* match;
+ const U32 current = (U32)(ip-base);
+ const U32 btLow = btMask >= current ? 0 : current - btMask;
+ U32* smallerPtr = bt + 2*(current&btMask);
+ U32* largerPtr = smallerPtr + 1;
+ U32 dummy32; /* to be nullified at the end */
+ U32 const windowLow = zc->lowLimit;
+ U32 matchEndIdx = current+8;
+ size_t bestLength = 8;
+#ifdef ZSTD_C_PREDICT
+ U32 predictedSmall = *(bt + 2*((current-1)&btMask) + 0);
+ U32 predictedLarge = *(bt + 2*((current-1)&btMask) + 1);
+ predictedSmall += (predictedSmall>0);
+ predictedLarge += (predictedLarge>0);
+#endif /* ZSTD_C_PREDICT */
+
+ hashTable[h] = current; /* Update Hash Table */
+
+ while (nbCompares-- && (matchIndex > windowLow)) {
+ U32* const nextPtr = bt + 2*(matchIndex & btMask);
+ size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */
+
+#ifdef ZSTD_C_PREDICT /* note : can create issues when hlog small <= 11 */
+ const U32* predictPtr = bt + 2*((matchIndex-1) & btMask); /* written this way, as bt is a roll buffer */
+ if (matchIndex == predictedSmall) {
+ /* no need to check length, result known */
+ *smallerPtr = matchIndex;
+ if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop the search */
+ smallerPtr = nextPtr+1; /* new "smaller" => larger of match */
+ matchIndex = nextPtr[1]; /* new matchIndex larger than previous (closer to current) */
+ predictedSmall = predictPtr[1] + (predictPtr[1]>0);
+ continue;
+ }
+ if (matchIndex == predictedLarge) {
+ *largerPtr = matchIndex;
+ if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop the search */
+ largerPtr = nextPtr;
+ matchIndex = nextPtr[0];
+ predictedLarge = predictPtr[0] + (predictPtr[0]>0);
+ continue;
+ }
+#endif
+ if ((!extDict) || (matchIndex+matchLength >= dictLimit)) {
+ match = base + matchIndex;
+ if (match[matchLength] == ip[matchLength])
+ matchLength += ZSTD_count(ip+matchLength+1, match+matchLength+1, iend) +1;
+ } else {
+ match = dictBase + matchIndex;
+ matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iend, dictEnd, prefixStart);
+ if (matchIndex+matchLength >= dictLimit)
+ match = base + matchIndex; /* to prepare for next usage of match[matchLength] */
+ }
+
+ if (matchLength > bestLength) {
+ bestLength = matchLength;
+ if (matchLength > matchEndIdx - matchIndex)
+ matchEndIdx = matchIndex + (U32)matchLength;
+ }
+
+ if (ip+matchLength == iend) /* equal : no way to know if inf or sup */
+ break; /* drop , to guarantee consistency ; miss a bit of compression, but other solutions can corrupt the tree */
+
+ if (match[matchLength] < ip[matchLength]) { /* necessarily within correct buffer */
+ /* match is smaller than current */
+ *smallerPtr = matchIndex; /* update smaller idx */
+ commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */
+ if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop the search */
+ smallerPtr = nextPtr+1; /* new "smaller" => larger of match */
+ matchIndex = nextPtr[1]; /* new matchIndex larger than previous (closer to current) */
+ } else {
+ /* match is larger than current */
+ *largerPtr = matchIndex;
+ commonLengthLarger = matchLength;
+ if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop the search */
+ largerPtr = nextPtr;
+ matchIndex = nextPtr[0];
+ } }
+
+ *smallerPtr = *largerPtr = 0;
+ if (bestLength > 384) return MIN(192, (U32)(bestLength - 384)); /* speed optimization */
+ if (matchEndIdx > current + 8) return matchEndIdx - current - 8;
+ return 1;
+}
+
+
+static size_t ZSTD_insertBtAndFindBestMatch (
+ ZSTD_CCtx* zc,
+ const BYTE* const ip, const BYTE* const iend,
+ size_t* offsetPtr,
+ U32 nbCompares, const U32 mls,
+ U32 extDict)
+{
+ U32* const hashTable = zc->hashTable;
+ U32 const hashLog = zc->appliedParams.cParams.hashLog;
+ size_t const h = ZSTD_hashPtr(ip, hashLog, mls);
+ U32* const bt = zc->chainTable;
+ U32 const btLog = zc->appliedParams.cParams.chainLog - 1;
+ U32 const btMask = (1 << btLog) - 1;
+ U32 matchIndex = hashTable[h];
+ size_t commonLengthSmaller=0, commonLengthLarger=0;
+ const BYTE* const base = zc->base;
+ const BYTE* const dictBase = zc->dictBase;
+ const U32 dictLimit = zc->dictLimit;
+ const BYTE* const dictEnd = dictBase + dictLimit;
+ const BYTE* const prefixStart = base + dictLimit;
+ const U32 current = (U32)(ip-base);
+ const U32 btLow = btMask >= current ? 0 : current - btMask;
+ const U32 windowLow = zc->lowLimit;
+ U32* smallerPtr = bt + 2*(current&btMask);
+ U32* largerPtr = bt + 2*(current&btMask) + 1;
+ U32 matchEndIdx = current+8;
+ U32 dummy32; /* to be nullified at the end */
+ size_t bestLength = 0;
+
+ hashTable[h] = current; /* Update Hash Table */
+
+ while (nbCompares-- && (matchIndex > windowLow)) {
+ U32* const nextPtr = bt + 2*(matchIndex & btMask);
+ size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */
+ const BYTE* match;
+
+ if ((!extDict) || (matchIndex+matchLength >= dictLimit)) {
+ match = base + matchIndex;
+ if (match[matchLength] == ip[matchLength])
+ matchLength += ZSTD_count(ip+matchLength+1, match+matchLength+1, iend) +1;
+ } else {
+ match = dictBase + matchIndex;
+ matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iend, dictEnd, prefixStart);
+ if (matchIndex+matchLength >= dictLimit)
+ match = base + matchIndex; /* to prepare for next usage of match[matchLength] */
+ }
+
+ if (matchLength > bestLength) {
+ if (matchLength > matchEndIdx - matchIndex)
+ matchEndIdx = matchIndex + (U32)matchLength;
+ if ( (4*(int)(matchLength-bestLength)) > (int)(ZSTD_highbit32(current-matchIndex+1) - ZSTD_highbit32((U32)offsetPtr[0]+1)) )
+ bestLength = matchLength, *offsetPtr = ZSTD_REP_MOVE + current - matchIndex;
+ if (ip+matchLength == iend) /* equal : no way to know if inf or sup */
+ break; /* drop, to guarantee consistency (miss a little bit of compression) */
+ }
+
+ if (match[matchLength] < ip[matchLength]) {
+ /* match is smaller than current */
+ *smallerPtr = matchIndex; /* update smaller idx */
+ commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */
+ if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop the search */
+ smallerPtr = nextPtr+1; /* new "smaller" => larger of match */
+ matchIndex = nextPtr[1]; /* new matchIndex larger than previous (closer to current) */
+ } else {
+ /* match is larger than current */
+ *largerPtr = matchIndex;
+ commonLengthLarger = matchLength;
+ if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop the search */
+ largerPtr = nextPtr;
+ matchIndex = nextPtr[0];
+ } }
+
+ *smallerPtr = *largerPtr = 0;
+
+ zc->nextToUpdate = (matchEndIdx > current + 8) ? matchEndIdx - 8 : current+1;
+ return bestLength;
+}
+
+
+static void ZSTD_updateTree(ZSTD_CCtx* zc, const BYTE* const ip, const BYTE* const iend, const U32 nbCompares, const U32 mls)
+{
+ const BYTE* const base = zc->base;
+ const U32 target = (U32)(ip - base);
+ U32 idx = zc->nextToUpdate;
+
+ while(idx < target)
+ idx += ZSTD_insertBt1(zc, base+idx, mls, iend, nbCompares, 0);
+}
+
+/** ZSTD_BtFindBestMatch() : Tree updater, providing best match */
+static size_t ZSTD_BtFindBestMatch (
+ ZSTD_CCtx* zc,
+ const BYTE* const ip, const BYTE* const iLimit,
+ size_t* offsetPtr,
+ const U32 maxNbAttempts, const U32 mls)
+{
+ if (ip < zc->base + zc->nextToUpdate) return 0; /* skipped area */
+ ZSTD_updateTree(zc, ip, iLimit, maxNbAttempts, mls);
+ return ZSTD_insertBtAndFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, mls, 0);
+}
+
+
+static size_t ZSTD_BtFindBestMatch_selectMLS (
+ ZSTD_CCtx* zc, /* Index table will be updated */
+ const BYTE* ip, const BYTE* const iLimit,
+ size_t* offsetPtr,
+ const U32 maxNbAttempts, const U32 matchLengthSearch)
+{
+ switch(matchLengthSearch)
+ {
+ default : /* includes case 3 */
+ case 4 : return ZSTD_BtFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4);
+ case 5 : return ZSTD_BtFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5);
+ case 7 :
+ case 6 : return ZSTD_BtFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6);
+ }
+}
+
+
+static void ZSTD_updateTree_extDict(ZSTD_CCtx* zc, const BYTE* const ip, const BYTE* const iend, const U32 nbCompares, const U32 mls)
+{
+ const BYTE* const base = zc->base;
+ const U32 target = (U32)(ip - base);
+ U32 idx = zc->nextToUpdate;
+
+ while (idx < target) idx += ZSTD_insertBt1(zc, base+idx, mls, iend, nbCompares, 1);
+}
+
+
+/** Tree updater, providing best match */
+static size_t ZSTD_BtFindBestMatch_extDict (
+ ZSTD_CCtx* zc,
+ const BYTE* const ip, const BYTE* const iLimit,
+ size_t* offsetPtr,
+ const U32 maxNbAttempts, const U32 mls)
+{
+ if (ip < zc->base + zc->nextToUpdate) return 0; /* skipped area */
+ ZSTD_updateTree_extDict(zc, ip, iLimit, maxNbAttempts, mls);
+ return ZSTD_insertBtAndFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, mls, 1);
+}
+
+
+static size_t ZSTD_BtFindBestMatch_selectMLS_extDict (
+ ZSTD_CCtx* zc, /* Index table will be updated */
+ const BYTE* ip, const BYTE* const iLimit,
+ size_t* offsetPtr,
+ const U32 maxNbAttempts, const U32 matchLengthSearch)
+{
+ switch(matchLengthSearch)
+ {
+ default : /* includes case 3 */
+ case 4 : return ZSTD_BtFindBestMatch_extDict(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4);
+ case 5 : return ZSTD_BtFindBestMatch_extDict(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5);
+ case 7 :
+ case 6 : return ZSTD_BtFindBestMatch_extDict(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6);
+ }
+}
+
+
+
+/* *********************************
+* Hash Chain
+***********************************/
+#define NEXT_IN_CHAIN(d, mask) chainTable[(d) & mask]
+
+/* Update chains up to ip (excluded)
+ Assumption : always within prefix (i.e. not within extDict) */
+FORCE_INLINE
+U32 ZSTD_insertAndFindFirstIndex (ZSTD_CCtx* zc, const BYTE* ip, U32 mls)
+{
+ U32* const hashTable = zc->hashTable;
+ const U32 hashLog = zc->appliedParams.cParams.hashLog;
+ U32* const chainTable = zc->chainTable;
+ const U32 chainMask = (1 << zc->appliedParams.cParams.chainLog) - 1;
+ const BYTE* const base = zc->base;
+ const U32 target = (U32)(ip - base);
+ U32 idx = zc->nextToUpdate;
+
+ while(idx < target) { /* catch up */
+ size_t const h = ZSTD_hashPtr(base+idx, hashLog, mls);
+ NEXT_IN_CHAIN(idx, chainMask) = hashTable[h];
+ hashTable[h] = idx;
+ idx++;
+ }
+
+ zc->nextToUpdate = target;
+ return hashTable[ZSTD_hashPtr(ip, hashLog, mls)];
+}
+
+
+/* inlining is important to hardwire a hot branch (template emulation) */
+FORCE_INLINE
+size_t ZSTD_HcFindBestMatch_generic (
+ ZSTD_CCtx* zc, /* Index table will be updated */
+ const BYTE* const ip, const BYTE* const iLimit,
+ size_t* offsetPtr,
+ const U32 maxNbAttempts, const U32 mls, const U32 extDict)
+{
+ U32* const chainTable = zc->chainTable;
+ const U32 chainSize = (1 << zc->appliedParams.cParams.chainLog);
+ const U32 chainMask = chainSize-1;
+ const BYTE* const base = zc->base;
+ const BYTE* const dictBase = zc->dictBase;
+ const U32 dictLimit = zc->dictLimit;
+ const BYTE* const prefixStart = base + dictLimit;
+ const BYTE* const dictEnd = dictBase + dictLimit;
+ const U32 lowLimit = zc->lowLimit;
+ const U32 current = (U32)(ip-base);
+ const U32 minChain = current > chainSize ? current - chainSize : 0;
+ int nbAttempts=maxNbAttempts;
+ size_t ml=4-1;
+
+ /* HC4 match finder */
+ U32 matchIndex = ZSTD_insertAndFindFirstIndex (zc, ip, mls);
+
+ for ( ; (matchIndex>lowLimit) & (nbAttempts>0) ; nbAttempts--) {
+ const BYTE* match;
+ size_t currentMl=0;
+ if ((!extDict) || matchIndex >= dictLimit) {
+ match = base + matchIndex;
+ if (match[ml] == ip[ml]) /* potentially better */
+ currentMl = ZSTD_count(ip, match, iLimit);
+ } else {
+ match = dictBase + matchIndex;
+ if (MEM_read32(match) == MEM_read32(ip)) /* assumption : matchIndex <= dictLimit-4 (by table construction) */
+ currentMl = ZSTD_count_2segments(ip+4, match+4, iLimit, dictEnd, prefixStart) + 4;
+ }
+
+ /* save best solution */
+ if (currentMl > ml) {
+ ml = currentMl;
+ *offsetPtr = current - matchIndex + ZSTD_REP_MOVE;
+ if (ip+currentMl == iLimit) break; /* best possible, avoids read overflow on next attempt */
+ }
+
+ if (matchIndex <= minChain) break;
+ matchIndex = NEXT_IN_CHAIN(matchIndex, chainMask);
+ }
+
+ return ml;
+}
+
+
+FORCE_INLINE size_t ZSTD_HcFindBestMatch_selectMLS (
+ ZSTD_CCtx* zc,
+ const BYTE* ip, const BYTE* const iLimit,
+ size_t* offsetPtr,
+ const U32 maxNbAttempts, const U32 matchLengthSearch)
+{
+ switch(matchLengthSearch)
+ {
+ default : /* includes case 3 */
+ case 4 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4, 0);
+ case 5 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5, 0);
+ case 7 :
+ case 6 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6, 0);
+ }
+}
+
+
+FORCE_INLINE size_t ZSTD_HcFindBestMatch_extDict_selectMLS (
+ ZSTD_CCtx* zc,
+ const BYTE* ip, const BYTE* const iLimit,
+ size_t* offsetPtr,
+ const U32 maxNbAttempts, const U32 matchLengthSearch)
+{
+ switch(matchLengthSearch)
+ {
+ default : /* includes case 3 */
+ case 4 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4, 1);
+ case 5 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5, 1);
+ case 7 :
+ case 6 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6, 1);
+ }
+}
+
+
+/* *******************************
+* Common parser - lazy strategy
+*********************************/
+FORCE_INLINE
+void ZSTD_compressBlock_lazy_generic(ZSTD_CCtx* ctx,
+ const void* src, size_t srcSize,
+ const U32 searchMethod, const U32 depth)
+{
+ seqStore_t* seqStorePtr = &(ctx->seqStore);
+ const BYTE* const istart = (const BYTE*)src;
+ const BYTE* ip = istart;
+ const BYTE* anchor = istart;
+ const BYTE* const iend = istart + srcSize;
+ const BYTE* const ilimit = iend - 8;
+ const BYTE* const base = ctx->base + ctx->dictLimit;
+
+ U32 const maxSearches = 1 << ctx->appliedParams.cParams.searchLog;
+ U32 const mls = ctx->appliedParams.cParams.searchLength;
+
+ typedef size_t (*searchMax_f)(ZSTD_CCtx* zc, const BYTE* ip, const BYTE* iLimit,
+ size_t* offsetPtr,
+ U32 maxNbAttempts, U32 matchLengthSearch);
+ searchMax_f const searchMax = searchMethod ? ZSTD_BtFindBestMatch_selectMLS : ZSTD_HcFindBestMatch_selectMLS;
+ U32 offset_1 = ctx->rep[0], offset_2 = ctx->rep[1], savedOffset=0;
+
+ /* init */
+ ip += (ip==base);
+ ctx->nextToUpdate3 = ctx->nextToUpdate;
+ { U32 const maxRep = (U32)(ip-base);
+ if (offset_2 > maxRep) savedOffset = offset_2, offset_2 = 0;
+ if (offset_1 > maxRep) savedOffset = offset_1, offset_1 = 0;
+ }
+
+ /* Match Loop */
+ while (ip < ilimit) {
+ size_t matchLength=0;
+ size_t offset=0;
+ const BYTE* start=ip+1;
+
+ /* check repCode */
+ if ((offset_1>0) & (MEM_read32(ip+1) == MEM_read32(ip+1 - offset_1))) {
+ /* repcode : we take it */
+ matchLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4;
+ if (depth==0) goto _storeSequence;
+ }
+
+ /* first search (depth 0) */
+ { size_t offsetFound = 99999999;
+ size_t const ml2 = searchMax(ctx, ip, iend, &offsetFound, maxSearches, mls);
+ if (ml2 > matchLength)
+ matchLength = ml2, start = ip, offset=offsetFound;
+ }
+
+ if (matchLength < 4) {
+ ip += ((ip-anchor) >> g_searchStrength) + 1; /* jump faster over incompressible sections */
+ continue;
+ }
+
+ /* let's try to find a better solution */
+ if (depth>=1)
+ while (ip<ilimit) {
+ ip ++;
+ if ((offset) && ((offset_1>0) & (MEM_read32(ip) == MEM_read32(ip - offset_1)))) {
+ size_t const mlRep = ZSTD_count(ip+4, ip+4-offset_1, iend) + 4;
+ int const gain2 = (int)(mlRep * 3);
+ int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)offset+1) + 1);
+ if ((mlRep >= 4) && (gain2 > gain1))
+ matchLength = mlRep, offset = 0, start = ip;
+ }
+ { size_t offset2=99999999;
+ size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls);
+ int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */
+ int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 4);
+ if ((ml2 >= 4) && (gain2 > gain1)) {
+ matchLength = ml2, offset = offset2, start = ip;
+ continue; /* search a better one */
+ } }
+
+ /* let's find an even better one */
+ if ((depth==2) && (ip<ilimit)) {
+ ip ++;
+ if ((offset) && ((offset_1>0) & (MEM_read32(ip) == MEM_read32(ip - offset_1)))) {
+ size_t const ml2 = ZSTD_count(ip+4, ip+4-offset_1, iend) + 4;
+ int const gain2 = (int)(ml2 * 4);
+ int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 1);
+ if ((ml2 >= 4) && (gain2 > gain1))
+ matchLength = ml2, offset = 0, start = ip;
+ }
+ { size_t offset2=99999999;
+ size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls);
+ int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */
+ int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 7);
+ if ((ml2 >= 4) && (gain2 > gain1)) {
+ matchLength = ml2, offset = offset2, start = ip;
+ continue;
+ } } }
+ break; /* nothing found : store previous solution */
+ }
+
+ /* NOTE:
+ * start[-offset+ZSTD_REP_MOVE-1] is undefined behavior.
+ * (-offset+ZSTD_REP_MOVE-1) is unsigned, and is added to start, which
+ * overflows the pointer, which is undefined behavior.
+ */
+ /* catch up */
+ if (offset) {
+ while ( (start > anchor)
+ && (start > base+offset-ZSTD_REP_MOVE)
+ && (start[-1] == (start-offset+ZSTD_REP_MOVE)[-1]) ) /* only search for offset within prefix */
+ { start--; matchLength++; }
+ offset_2 = offset_1; offset_1 = (U32)(offset - ZSTD_REP_MOVE);
+ }
+ /* store sequence */
+_storeSequence:
+ { size_t const litLength = start - anchor;
+ ZSTD_storeSeq(seqStorePtr, litLength, anchor, (U32)offset, matchLength-MINMATCH);
+ anchor = ip = start + matchLength;
+ }
+
+ /* check immediate repcode */
+ while ( (ip <= ilimit)
+ && ((offset_2>0)
+ & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) {
+ /* store sequence */
+ matchLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4;
+ offset = offset_2; offset_2 = offset_1; offset_1 = (U32)offset; /* swap repcodes */
+ ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, matchLength-MINMATCH);
+ ip += matchLength;
+ anchor = ip;
+ continue; /* faster when present ... (?) */
+ } }
+
+ /* Save reps for next block */
+ ctx->repToConfirm[0] = offset_1 ? offset_1 : savedOffset;
+ ctx->repToConfirm[1] = offset_2 ? offset_2 : savedOffset;
+
+ /* Last Literals */
+ { size_t const lastLLSize = iend - anchor;
+ memcpy(seqStorePtr->lit, anchor, lastLLSize);
+ seqStorePtr->lit += lastLLSize;
+ }
+}
+
+
+static void ZSTD_compressBlock_btlazy2(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+ ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 1, 2);
+}
+
+static void ZSTD_compressBlock_lazy2(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+ ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 0, 2);
+}
+
+static void ZSTD_compressBlock_lazy(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+ ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 0, 1);
+}
+
+static void ZSTD_compressBlock_greedy(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+ ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 0, 0);
+}
+
+
+FORCE_INLINE
+void ZSTD_compressBlock_lazy_extDict_generic(ZSTD_CCtx* ctx,
+ const void* src, size_t srcSize,
+ const U32 searchMethod, const U32 depth)
+{
+ seqStore_t* seqStorePtr = &(ctx->seqStore);
+ const BYTE* const istart = (const BYTE*)src;
+ const BYTE* ip = istart;
+ const BYTE* anchor = istart;
+ const BYTE* const iend = istart + srcSize;
+ const BYTE* const ilimit = iend - 8;
+ const BYTE* const base = ctx->base;
+ const U32 dictLimit = ctx->dictLimit;
+ const U32 lowestIndex = ctx->lowLimit;
+ const BYTE* const prefixStart = base + dictLimit;
+ const BYTE* const dictBase = ctx->dictBase;
+ const BYTE* const dictEnd = dictBase + dictLimit;
+ const BYTE* const dictStart = dictBase + ctx->lowLimit;
+
+ const U32 maxSearches = 1 << ctx->appliedParams.cParams.searchLog;
+ const U32 mls = ctx->appliedParams.cParams.searchLength;
+
+ typedef size_t (*searchMax_f)(ZSTD_CCtx* zc, const BYTE* ip, const BYTE* iLimit,
+ size_t* offsetPtr,
+ U32 maxNbAttempts, U32 matchLengthSearch);
+ searchMax_f searchMax = searchMethod ? ZSTD_BtFindBestMatch_selectMLS_extDict : ZSTD_HcFindBestMatch_extDict_selectMLS;
+
+ U32 offset_1 = ctx->rep[0], offset_2 = ctx->rep[1];
+
+ /* init */
+ ctx->nextToUpdate3 = ctx->nextToUpdate;
+ ip += (ip == prefixStart);
+
+ /* Match Loop */
+ while (ip < ilimit) {
+ size_t matchLength=0;
+ size_t offset=0;
+ const BYTE* start=ip+1;
+ U32 current = (U32)(ip-base);
+
+ /* check repCode */
+ { const U32 repIndex = (U32)(current+1 - offset_1);
+ const BYTE* const repBase = repIndex < dictLimit ? dictBase : base;
+ const BYTE* const repMatch = repBase + repIndex;
+ if (((U32)((dictLimit-1) - repIndex) >= 3) & (repIndex > lowestIndex)) /* intentional overflow */
+ if (MEM_read32(ip+1) == MEM_read32(repMatch)) {
+ /* repcode detected we should take it */
+ const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend;
+ matchLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repEnd, prefixStart) + 4;
+ if (depth==0) goto _storeSequence;
+ } }
+
+ /* first search (depth 0) */
+ { size_t offsetFound = 99999999;
+ size_t const ml2 = searchMax(ctx, ip, iend, &offsetFound, maxSearches, mls);
+ if (ml2 > matchLength)
+ matchLength = ml2, start = ip, offset=offsetFound;
+ }
+
+ if (matchLength < 4) {
+ ip += ((ip-anchor) >> g_searchStrength) + 1; /* jump faster over incompressible sections */
+ continue;
+ }
+
+ /* let's try to find a better solution */
+ if (depth>=1)
+ while (ip<ilimit) {
+ ip ++;
+ current++;
+ /* check repCode */
+ if (offset) {
+ const U32 repIndex = (U32)(current - offset_1);
+ const BYTE* const repBase = repIndex < dictLimit ? dictBase : base;
+ const BYTE* const repMatch = repBase + repIndex;
+ if (((U32)((dictLimit-1) - repIndex) >= 3) & (repIndex > lowestIndex)) /* intentional overflow */
+ if (MEM_read32(ip) == MEM_read32(repMatch)) {
+ /* repcode detected */
+ const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend;
+ size_t const repLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd, prefixStart) + 4;
+ int const gain2 = (int)(repLength * 3);
+ int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)offset+1) + 1);
+ if ((repLength >= 4) && (gain2 > gain1))
+ matchLength = repLength, offset = 0, start = ip;
+ } }
+
+ /* search match, depth 1 */
+ { size_t offset2=99999999;
+ size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls);
+ int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */
+ int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 4);
+ if ((ml2 >= 4) && (gain2 > gain1)) {
+ matchLength = ml2, offset = offset2, start = ip;
+ continue; /* search a better one */
+ } }
+
+ /* let's find an even better one */
+ if ((depth==2) && (ip<ilimit)) {
+ ip ++;
+ current++;
+ /* check repCode */
+ if (offset) {
+ const U32 repIndex = (U32)(current - offset_1);
+ const BYTE* const repBase = repIndex < dictLimit ? dictBase : base;
+ const BYTE* const repMatch = repBase + repIndex;
+ if (((U32)((dictLimit-1) - repIndex) >= 3) & (repIndex > lowestIndex)) /* intentional overflow */
+ if (MEM_read32(ip) == MEM_read32(repMatch)) {
+ /* repcode detected */
+ const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend;
+ size_t const repLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd, prefixStart) + 4;
+ int const gain2 = (int)(repLength * 4);
+ int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 1);
+ if ((repLength >= 4) && (gain2 > gain1))
+ matchLength = repLength, offset = 0, start = ip;
+ } }
+
+ /* search match, depth 2 */
+ { size_t offset2=99999999;
+ size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls);
+ int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */
+ int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 7);
+ if ((ml2 >= 4) && (gain2 > gain1)) {
+ matchLength = ml2, offset = offset2, start = ip;
+ continue;
+ } } }
+ break; /* nothing found : store previous solution */
+ }
+
+ /* catch up */
+ if (offset) {
+ U32 const matchIndex = (U32)((start-base) - (offset - ZSTD_REP_MOVE));
+ const BYTE* match = (matchIndex < dictLimit) ? dictBase + matchIndex : base + matchIndex;
+ const BYTE* const mStart = (matchIndex < dictLimit) ? dictStart : prefixStart;
+ while ((start>anchor) && (match>mStart) && (start[-1] == match[-1])) { start--; match--; matchLength++; } /* catch up */
+ offset_2 = offset_1; offset_1 = (U32)(offset - ZSTD_REP_MOVE);
+ }
+
+ /* store sequence */
+_storeSequence:
+ { size_t const litLength = start - anchor;
+ ZSTD_storeSeq(seqStorePtr, litLength, anchor, (U32)offset, matchLength-MINMATCH);
+ anchor = ip = start + matchLength;
+ }
+
+ /* check immediate repcode */
+ while (ip <= ilimit) {
+ const U32 repIndex = (U32)((ip-base) - offset_2);
+ const BYTE* const repBase = repIndex < dictLimit ? dictBase : base;
+ const BYTE* const repMatch = repBase + repIndex;
+ if (((U32)((dictLimit-1) - repIndex) >= 3) & (repIndex > lowestIndex)) /* intentional overflow */
+ if (MEM_read32(ip) == MEM_read32(repMatch)) {
+ /* repcode detected we should take it */
+ const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend;
+ matchLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd, prefixStart) + 4;
+ offset = offset_2; offset_2 = offset_1; offset_1 = (U32)offset; /* swap offset history */
+ ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, matchLength-MINMATCH);
+ ip += matchLength;
+ anchor = ip;
+ continue; /* faster when present ... (?) */
+ }
+ break;
+ } }
+
+ /* Save reps for next block */
+ ctx->repToConfirm[0] = offset_1; ctx->repToConfirm[1] = offset_2;
+
+ /* Last Literals */
+ { size_t const lastLLSize = iend - anchor;
+ memcpy(seqStorePtr->lit, anchor, lastLLSize);
+ seqStorePtr->lit += lastLLSize;
+ }
+}
+
+
+void ZSTD_compressBlock_greedy_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+ ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 0, 0);
+}
+
+static void ZSTD_compressBlock_lazy_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+ ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 0, 1);
+}
+
+static void ZSTD_compressBlock_lazy2_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+ ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 0, 2);
+}
+
+static void ZSTD_compressBlock_btlazy2_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+ ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 1, 2);
+}
+
+
+/* The optimal parser */
+#include "zstd_opt.h"
+
+static void ZSTD_compressBlock_btopt(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+#ifdef ZSTD_OPT_H_91842398743
+ ZSTD_compressBlock_opt_generic(ctx, src, srcSize, 0);
+#else
+ (void)ctx; (void)src; (void)srcSize;
+ return;
+#endif
+}
+
+static void ZSTD_compressBlock_btultra(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+#ifdef ZSTD_OPT_H_91842398743
+ ZSTD_compressBlock_opt_generic(ctx, src, srcSize, 1);
+#else
+ (void)ctx; (void)src; (void)srcSize;
+ return;
+#endif
+}
+
+static void ZSTD_compressBlock_btopt_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+#ifdef ZSTD_OPT_H_91842398743
+ ZSTD_compressBlock_opt_extDict_generic(ctx, src, srcSize, 0);
+#else
+ (void)ctx; (void)src; (void)srcSize;
+ return;
+#endif
+}
+
+static void ZSTD_compressBlock_btultra_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize)
+{
+#ifdef ZSTD_OPT_H_91842398743
+ ZSTD_compressBlock_opt_extDict_generic(ctx, src, srcSize, 1);
+#else
+ (void)ctx; (void)src; (void)srcSize;
+ return;
+#endif
+}
+
+
+/* ZSTD_selectBlockCompressor() :
+ * assumption : strat is a valid strategy */
+typedef void (*ZSTD_blockCompressor) (ZSTD_CCtx* ctx, const void* src, size_t srcSize);
+static ZSTD_blockCompressor ZSTD_selectBlockCompressor(ZSTD_strategy strat, int extDict)
+{
+ static const ZSTD_blockCompressor blockCompressor[2][(unsigned)ZSTD_btultra+1] = {
+ { ZSTD_compressBlock_fast /* default for 0 */,
+ ZSTD_compressBlock_fast, ZSTD_compressBlock_doubleFast, ZSTD_compressBlock_greedy,
+ ZSTD_compressBlock_lazy, ZSTD_compressBlock_lazy2, ZSTD_compressBlock_btlazy2,
+ ZSTD_compressBlock_btopt, ZSTD_compressBlock_btultra },
+ { ZSTD_compressBlock_fast_extDict /* default for 0 */,
+ ZSTD_compressBlock_fast_extDict, ZSTD_compressBlock_doubleFast_extDict, ZSTD_compressBlock_greedy_extDict,
+ ZSTD_compressBlock_lazy_extDict,ZSTD_compressBlock_lazy2_extDict, ZSTD_compressBlock_btlazy2_extDict,
+ ZSTD_compressBlock_btopt_extDict, ZSTD_compressBlock_btultra_extDict }
+ };
+ ZSTD_STATIC_ASSERT((unsigned)ZSTD_fast == 1);
+ assert((U32)strat >= (U32)ZSTD_fast);
+ assert((U32)strat <= (U32)ZSTD_btultra);
+
+ return blockCompressor[extDict!=0][(U32)strat];
+}
+
+
+static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc, void* dst, size_t dstCapacity, const void* src, size_t srcSize)
+{
+ ZSTD_blockCompressor const blockCompressor = ZSTD_selectBlockCompressor(zc->appliedParams.cParams.strategy, zc->lowLimit < zc->dictLimit);
+ const BYTE* const base = zc->base;
+ const BYTE* const istart = (const BYTE*)src;
+ const U32 current = (U32)(istart-base);
+ if (srcSize < MIN_CBLOCK_SIZE+ZSTD_blockHeaderSize+1) return 0; /* don't even attempt compression below a certain srcSize */
+ ZSTD_resetSeqStore(&(zc->seqStore));
+ if (current > zc->nextToUpdate + 384)
+ zc->nextToUpdate = current - MIN(192, (U32)(current - zc->nextToUpdate - 384)); /* limited update after finding a very long match */
+ blockCompressor(zc, src, srcSize);
+ return ZSTD_compressSequences(zc, dst, dstCapacity, srcSize);
+}
+
+
+/*! ZSTD_compress_frameChunk() :
+* Compress a chunk of data into one or multiple blocks.
+* All blocks will be terminated, all input will be consumed.
+* Function will issue an error if there is not enough `dstCapacity` to hold the compressed content.
+* Frame is supposed already started (header already produced)
+* @return : compressed size, or an error code
+*/
+static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ U32 lastFrameChunk)
+{
+ size_t blockSize = cctx->blockSize;
+ size_t remaining = srcSize;
+ const BYTE* ip = (const BYTE*)src;
+ BYTE* const ostart = (BYTE*)dst;
+ BYTE* op = ostart;
+ U32 const maxDist = 1 << cctx->appliedParams.cParams.windowLog;
+
+ if (cctx->appliedParams.fParams.checksumFlag && srcSize)
+ XXH64_update(&cctx->xxhState, src, srcSize);
+
+ while (remaining) {
+ U32 const lastBlock = lastFrameChunk & (blockSize >= remaining);
+ size_t cSize;
+
+ if (dstCapacity < ZSTD_blockHeaderSize + MIN_CBLOCK_SIZE)
+ return ERROR(dstSize_tooSmall); /* not enough space to store compressed block */
+ if (remaining < blockSize) blockSize = remaining;
+
+ /* preemptive overflow correction */
+ if (cctx->lowLimit > (3U<<29)) {
+ U32 const cycleMask = (1 << ZSTD_cycleLog(cctx->appliedParams.cParams.hashLog, cctx->appliedParams.cParams.strategy)) - 1;
+ U32 const current = (U32)(ip - cctx->base);
+ U32 const newCurrent = (current & cycleMask) + (1 << cctx->appliedParams.cParams.windowLog);
+ U32 const correction = current - newCurrent;
+ ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX_64 <= 30);
+ ZSTD_reduceIndex(cctx, correction);
+ cctx->base += correction;
+ cctx->dictBase += correction;
+ cctx->lowLimit -= correction;
+ cctx->dictLimit -= correction;
+ if (cctx->nextToUpdate < correction) cctx->nextToUpdate = 0;
+ else cctx->nextToUpdate -= correction;
+ }
+
+ if ((U32)(ip+blockSize - cctx->base) > cctx->loadedDictEnd + maxDist) {
+ /* enforce maxDist */
+ U32 const newLowLimit = (U32)(ip+blockSize - cctx->base) - maxDist;
+ if (cctx->lowLimit < newLowLimit) cctx->lowLimit = newLowLimit;
+ if (cctx->dictLimit < cctx->lowLimit) cctx->dictLimit = cctx->lowLimit;
+ }
+
+ cSize = ZSTD_compressBlock_internal(cctx, op+ZSTD_blockHeaderSize, dstCapacity-ZSTD_blockHeaderSize, ip, blockSize);
+ if (ZSTD_isError(cSize)) return cSize;
+
+ if (cSize == 0) { /* block is not compressible */
+ U32 const cBlockHeader24 = lastBlock + (((U32)bt_raw)<<1) + (U32)(blockSize << 3);
+ if (blockSize + ZSTD_blockHeaderSize > dstCapacity) return ERROR(dstSize_tooSmall);
+ MEM_writeLE32(op, cBlockHeader24); /* no pb, 4th byte will be overwritten */
+ memcpy(op + ZSTD_blockHeaderSize, ip, blockSize);
+ cSize = ZSTD_blockHeaderSize+blockSize;
+ } else {
+ U32 const cBlockHeader24 = lastBlock + (((U32)bt_compressed)<<1) + (U32)(cSize << 3);
+ MEM_writeLE24(op, cBlockHeader24);
+ cSize += ZSTD_blockHeaderSize;
+ }
+
+ remaining -= blockSize;
+ dstCapacity -= cSize;
+ ip += blockSize;
+ op += cSize;
+ }
+
+ if (lastFrameChunk && (op>ostart)) cctx->stage = ZSTDcs_ending;
+ return op-ostart;
+}
+
+
+static size_t ZSTD_writeFrameHeader(void* dst, size_t dstCapacity,
+ ZSTD_parameters params, U64 pledgedSrcSize, U32 dictID)
+{ BYTE* const op = (BYTE*)dst;
+ U32 const dictIDSizeCodeLength = (dictID>0) + (dictID>=256) + (dictID>=65536); /* 0-3 */
+ U32 const dictIDSizeCode = params.fParams.noDictIDFlag ? 0 : dictIDSizeCodeLength; /* 0-3 */
+ U32 const checksumFlag = params.fParams.checksumFlag>0;
+ U32 const windowSize = 1U << params.cParams.windowLog;
+ U32 const singleSegment = params.fParams.contentSizeFlag && (windowSize >= pledgedSrcSize);
+ BYTE const windowLogByte = (BYTE)((params.cParams.windowLog - ZSTD_WINDOWLOG_ABSOLUTEMIN) << 3);
+ U32 const fcsCode = params.fParams.contentSizeFlag ?
+ (pledgedSrcSize>=256) + (pledgedSrcSize>=65536+256) + (pledgedSrcSize>=0xFFFFFFFFU) : 0; /* 0-3 */
+ BYTE const frameHeaderDecriptionByte = (BYTE)(dictIDSizeCode + (checksumFlag<<2) + (singleSegment<<5) + (fcsCode<<6) );
+ size_t pos;
+
+ if (dstCapacity < ZSTD_frameHeaderSize_max) return ERROR(dstSize_tooSmall);
+ DEBUGLOG(5, "ZSTD_writeFrameHeader : dictIDFlag : %u ; dictID : %u ; dictIDSizeCode : %u",
+ !params.fParams.noDictIDFlag, dictID, dictIDSizeCode);
+
+ MEM_writeLE32(dst, ZSTD_MAGICNUMBER);
+ op[4] = frameHeaderDecriptionByte; pos=5;
+ if (!singleSegment) op[pos++] = windowLogByte;
+ switch(dictIDSizeCode)
+ {
+ default: assert(0); /* impossible */
+ case 0 : break;
+ case 1 : op[pos] = (BYTE)(dictID); pos++; break;
+ case 2 : MEM_writeLE16(op+pos, (U16)dictID); pos+=2; break;
+ case 3 : MEM_writeLE32(op+pos, dictID); pos+=4; break;
+ }
+ switch(fcsCode)
+ {
+ default: assert(0); /* impossible */
+ case 0 : if (singleSegment) op[pos++] = (BYTE)(pledgedSrcSize); break;
+ case 1 : MEM_writeLE16(op+pos, (U16)(pledgedSrcSize-256)); pos+=2; break;
+ case 2 : MEM_writeLE32(op+pos, (U32)(pledgedSrcSize)); pos+=4; break;
+ case 3 : MEM_writeLE64(op+pos, (U64)(pledgedSrcSize)); pos+=8; break;
+ }
+ return pos;
+}
+
+
+static size_t ZSTD_compressContinue_internal (ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ U32 frame, U32 lastFrameChunk)
+{
+ const BYTE* const ip = (const BYTE*) src;
+ size_t fhSize = 0;
+
+ DEBUGLOG(5, "ZSTD_compressContinue_internal");
+ DEBUGLOG(5, "stage: %u", cctx->stage);
+ if (cctx->stage==ZSTDcs_created) return ERROR(stage_wrong); /* missing init (ZSTD_compressBegin) */
+
+ if (frame && (cctx->stage==ZSTDcs_init)) {
+ fhSize = ZSTD_writeFrameHeader(dst, dstCapacity, cctx->appliedParams,
+ cctx->pledgedSrcSizePlusOne-1, cctx->dictID);
+ if (ZSTD_isError(fhSize)) return fhSize;
+ dstCapacity -= fhSize;
+ dst = (char*)dst + fhSize;
+ cctx->stage = ZSTDcs_ongoing;
+ }
+
+ /* Check if blocks follow each other */
+ if (src != cctx->nextSrc) {
+ /* not contiguous */
+ ptrdiff_t const delta = cctx->nextSrc - ip;
+ cctx->lowLimit = cctx->dictLimit;
+ cctx->dictLimit = (U32)(cctx->nextSrc - cctx->base);
+ cctx->dictBase = cctx->base;
+ cctx->base -= delta;
+ cctx->nextToUpdate = cctx->dictLimit;
+ if (cctx->dictLimit - cctx->lowLimit < HASH_READ_SIZE) cctx->lowLimit = cctx->dictLimit; /* too small extDict */
+ }
+
+ /* if input and dictionary overlap : reduce dictionary (area presumed modified by input) */
+ if ((ip+srcSize > cctx->dictBase + cctx->lowLimit) & (ip < cctx->dictBase + cctx->dictLimit)) {
+ ptrdiff_t const highInputIdx = (ip + srcSize) - cctx->dictBase;
+ U32 const lowLimitMax = (highInputIdx > (ptrdiff_t)cctx->dictLimit) ? cctx->dictLimit : (U32)highInputIdx;
+ cctx->lowLimit = lowLimitMax;
+ }
+
+ cctx->nextSrc = ip + srcSize;
+
+ if (srcSize) {
+ size_t const cSize = frame ?
+ ZSTD_compress_frameChunk (cctx, dst, dstCapacity, src, srcSize, lastFrameChunk) :
+ ZSTD_compressBlock_internal (cctx, dst, dstCapacity, src, srcSize);
+ if (ZSTD_isError(cSize)) return cSize;
+ cctx->consumedSrcSize += srcSize;
+ return cSize + fhSize;
+ } else
+ return fhSize;
+}
+
+
+size_t ZSTD_compressContinue (ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize)
+{
+ return ZSTD_compressContinue_internal(cctx, dst, dstCapacity, src, srcSize, 1 /* frame mode */, 0 /* last chunk */);
+}
+
+
+size_t ZSTD_getBlockSize(const ZSTD_CCtx* cctx)
+{
+ U32 const cLevel = cctx->compressionLevel;
+ ZSTD_compressionParameters cParams = (cLevel == ZSTD_CLEVEL_CUSTOM) ?
+ cctx->appliedParams.cParams :
+ ZSTD_getCParams(cLevel, 0, 0);
+ return MIN (ZSTD_BLOCKSIZE_MAX, 1 << cParams.windowLog);
+}
+
+size_t ZSTD_compressBlock(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize)
+{
+ size_t const blockSizeMax = ZSTD_getBlockSize(cctx);
+ if (srcSize > blockSizeMax) return ERROR(srcSize_wrong);
+ return ZSTD_compressContinue_internal(cctx, dst, dstCapacity, src, srcSize, 0 /* frame mode */, 0 /* last chunk */);
+}
+
+/*! ZSTD_loadDictionaryContent() :
+ * @return : 0, or an error code
+ */
+static size_t ZSTD_loadDictionaryContent(ZSTD_CCtx* zc, const void* src, size_t srcSize)
+{
+ const BYTE* const ip = (const BYTE*) src;
+ const BYTE* const iend = ip + srcSize;
+
+ /* input becomes current prefix */
+ zc->lowLimit = zc->dictLimit;
+ zc->dictLimit = (U32)(zc->nextSrc - zc->base);
+ zc->dictBase = zc->base;
+ zc->base += ip - zc->nextSrc;
+ zc->nextToUpdate = zc->dictLimit;
+ zc->loadedDictEnd = zc->forceWindow ? 0 : (U32)(iend - zc->base);
+
+ zc->nextSrc = iend;
+ if (srcSize <= HASH_READ_SIZE) return 0;
+
+ switch(zc->appliedParams.cParams.strategy)
+ {
+ case ZSTD_fast:
+ ZSTD_fillHashTable (zc, iend, zc->appliedParams.cParams.searchLength);
+ break;
+
+ case ZSTD_dfast:
+ ZSTD_fillDoubleHashTable (zc, iend, zc->appliedParams.cParams.searchLength);
+ break;
+
+ case ZSTD_greedy:
+ case ZSTD_lazy:
+ case ZSTD_lazy2:
+ if (srcSize >= HASH_READ_SIZE)
+ ZSTD_insertAndFindFirstIndex(zc, iend-HASH_READ_SIZE, zc->appliedParams.cParams.searchLength);
+ break;
+
+ case ZSTD_btlazy2:
+ case ZSTD_btopt:
+ case ZSTD_btultra:
+ if (srcSize >= HASH_READ_SIZE)
+ ZSTD_updateTree(zc, iend-HASH_READ_SIZE, iend, 1 << zc->appliedParams.cParams.searchLog, zc->appliedParams.cParams.searchLength);
+ break;
+
+ default:
+ assert(0); /* not possible : not a valid strategy id */
+ }
+
+ zc->nextToUpdate = (U32)(iend - zc->base);
+ return 0;
+}
+
+
+/* Dictionaries that assign zero probability to symbols that show up causes problems
+ when FSE encoding. Refuse dictionaries that assign zero probability to symbols
+ that we may encounter during compression.
+ NOTE: This behavior is not standard and could be improved in the future. */
+static size_t ZSTD_checkDictNCount(short* normalizedCounter, unsigned dictMaxSymbolValue, unsigned maxSymbolValue) {
+ U32 s;
+ if (dictMaxSymbolValue < maxSymbolValue) return ERROR(dictionary_corrupted);
+ for (s = 0; s <= maxSymbolValue; ++s) {
+ if (normalizedCounter[s] == 0) return ERROR(dictionary_corrupted);
+ }
+ return 0;
+}
+
+
+/* Dictionary format :
+ * See :
+ * https://github.com/facebook/zstd/blob/master/doc/zstd_compression_format.md#dictionary-format
+ */
+/*! ZSTD_loadZstdDictionary() :
+ * @return : 0, or an error code
+ * assumptions : magic number supposed already checked
+ * dictSize supposed > 8
+ */
+static size_t ZSTD_loadZstdDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize)
+{
+ const BYTE* dictPtr = (const BYTE*)dict;
+ const BYTE* const dictEnd = dictPtr + dictSize;
+ short offcodeNCount[MaxOff+1];
+ unsigned offcodeMaxValue = MaxOff;
+ BYTE scratchBuffer[1<<MAX(MLFSELog,LLFSELog)];
+
+ dictPtr += 4; /* skip magic number */
+ cctx->dictID = cctx->appliedParams.fParams.noDictIDFlag ? 0 : MEM_readLE32(dictPtr);
+ dictPtr += 4;
+
+ { size_t const hufHeaderSize = HUF_readCTable(cctx->hufCTable, 255, dictPtr, dictEnd-dictPtr);
+ if (HUF_isError(hufHeaderSize)) return ERROR(dictionary_corrupted);
+ dictPtr += hufHeaderSize;
+ }
+
+ { unsigned offcodeLog;
+ size_t const offcodeHeaderSize = FSE_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dictPtr, dictEnd-dictPtr);
+ if (FSE_isError(offcodeHeaderSize)) return ERROR(dictionary_corrupted);
+ if (offcodeLog > OffFSELog) return ERROR(dictionary_corrupted);
+ /* Defer checking offcodeMaxValue because we need to know the size of the dictionary content */
+ CHECK_E( FSE_buildCTable_wksp(cctx->offcodeCTable, offcodeNCount, offcodeMaxValue, offcodeLog, scratchBuffer, sizeof(scratchBuffer)),
+ dictionary_corrupted);
+ dictPtr += offcodeHeaderSize;
+ }
+
+ { short matchlengthNCount[MaxML+1];
+ unsigned matchlengthMaxValue = MaxML, matchlengthLog;
+ size_t const matchlengthHeaderSize = FSE_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dictPtr, dictEnd-dictPtr);
+ if (FSE_isError(matchlengthHeaderSize)) return ERROR(dictionary_corrupted);
+ if (matchlengthLog > MLFSELog) return ERROR(dictionary_corrupted);
+ /* Every match length code must have non-zero probability */
+ CHECK_F( ZSTD_checkDictNCount(matchlengthNCount, matchlengthMaxValue, MaxML));
+ CHECK_E( FSE_buildCTable_wksp(cctx->matchlengthCTable, matchlengthNCount, matchlengthMaxValue, matchlengthLog, scratchBuffer, sizeof(scratchBuffer)),
+ dictionary_corrupted);
+ dictPtr += matchlengthHeaderSize;
+ }
+
+ { short litlengthNCount[MaxLL+1];
+ unsigned litlengthMaxValue = MaxLL, litlengthLog;
+ size_t const litlengthHeaderSize = FSE_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dictPtr, dictEnd-dictPtr);
+ if (FSE_isError(litlengthHeaderSize)) return ERROR(dictionary_corrupted);
+ if (litlengthLog > LLFSELog) return ERROR(dictionary_corrupted);
+ /* Every literal length code must have non-zero probability */
+ CHECK_F( ZSTD_checkDictNCount(litlengthNCount, litlengthMaxValue, MaxLL));
+ CHECK_E( FSE_buildCTable_wksp(cctx->litlengthCTable, litlengthNCount, litlengthMaxValue, litlengthLog, scratchBuffer, sizeof(scratchBuffer)),
+ dictionary_corrupted);
+ dictPtr += litlengthHeaderSize;
+ }
+
+ if (dictPtr+12 > dictEnd) return ERROR(dictionary_corrupted);
+ cctx->rep[0] = MEM_readLE32(dictPtr+0);
+ cctx->rep[1] = MEM_readLE32(dictPtr+4);
+ cctx->rep[2] = MEM_readLE32(dictPtr+8);
+ dictPtr += 12;
+
+ { size_t const dictContentSize = (size_t)(dictEnd - dictPtr);
+ U32 offcodeMax = MaxOff;
+ if (dictContentSize <= ((U32)-1) - 128 KB) {
+ U32 const maxOffset = (U32)dictContentSize + 128 KB; /* The maximum offset that must be supported */
+ offcodeMax = ZSTD_highbit32(maxOffset); /* Calculate minimum offset code required to represent maxOffset */
+ }
+ /* All offset values <= dictContentSize + 128 KB must be representable */
+ CHECK_F (ZSTD_checkDictNCount(offcodeNCount, offcodeMaxValue, MIN(offcodeMax, MaxOff)));
+ /* All repCodes must be <= dictContentSize and != 0*/
+ { U32 u;
+ for (u=0; u<3; u++) {
+ if (cctx->rep[u] == 0) return ERROR(dictionary_corrupted);
+ if (cctx->rep[u] > dictContentSize) return ERROR(dictionary_corrupted);
+ } }
+
+ cctx->fseCTables_ready = 1;
+ cctx->hufCTable_repeatMode = HUF_repeat_valid;
+ return ZSTD_loadDictionaryContent(cctx, dictPtr, dictContentSize);
+ }
+}
+
+/** ZSTD_compress_insertDictionary() :
+* @return : 0, or an error code */
+static size_t ZSTD_compress_insertDictionary(ZSTD_CCtx* cctx,
+ const void* dict, size_t dictSize,
+ ZSTD_dictMode_e dictMode)
+{
+ DEBUGLOG(5, "ZSTD_compress_insertDictionary");
+ if ((dict==NULL) || (dictSize<=8)) return 0;
+
+ /* dict restricted modes */
+ if (dictMode==ZSTD_dm_rawContent)
+ return ZSTD_loadDictionaryContent(cctx, dict, dictSize);
+
+ if (MEM_readLE32(dict) != ZSTD_MAGIC_DICTIONARY) {
+ if (dictMode == ZSTD_dm_auto) {
+ DEBUGLOG(5, "raw content dictionary detected");
+ return ZSTD_loadDictionaryContent(cctx, dict, dictSize);
+ }
+ if (dictMode == ZSTD_dm_fullDict)
+ return ERROR(dictionary_wrong);
+ assert(0); /* impossible */
+ }
+
+ /* dict as full zstd dictionary */
+ return ZSTD_loadZstdDictionary(cctx, dict, dictSize);
+}
+
+/*! ZSTD_compressBegin_internal() :
+ * @return : 0, or an error code */
+static size_t ZSTD_compressBegin_internal(ZSTD_CCtx* cctx,
+ const void* dict, size_t dictSize,
+ ZSTD_dictMode_e dictMode,
+ const ZSTD_CDict* cdict,
+ ZSTD_parameters params, U64 pledgedSrcSize,
+ ZSTD_buffered_policy_e zbuff)
+{
+ DEBUGLOG(4, "ZSTD_compressBegin_internal");
+ DEBUGLOG(4, "dict ? %s", dict ? "dict" : (cdict ? "cdict" : "none"));
+ DEBUGLOG(4, "dictMode : %u", (U32)dictMode);
+ /* params are supposed to be fully validated at this point */
+ assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams)));
+ assert(!((dict) && (cdict))); /* either dict or cdict, not both */
+
+ if (cdict && cdict->dictContentSize>0) {
+ return ZSTD_copyCCtx_internal(cctx, cdict->refContext,
+ params.fParams, pledgedSrcSize,
+ zbuff);
+ }
+
+ CHECK_F( ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize,
+ ZSTDcrp_continue, zbuff) );
+ return ZSTD_compress_insertDictionary(cctx, dict, dictSize, dictMode);
+}
+
+
+/*! ZSTD_compressBegin_advanced() :
+* @return : 0, or an error code */
+size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx,
+ const void* dict, size_t dictSize,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize)
+{
+ /* compression parameters verification and optimization */
+ CHECK_F(ZSTD_checkCParams(params.cParams));
+ return ZSTD_compressBegin_internal(cctx, dict, dictSize, ZSTD_dm_auto, NULL,
+ params, pledgedSrcSize, ZSTDb_not_buffered);
+}
+
+
+size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel)
+{
+ ZSTD_parameters const params = ZSTD_getParams(compressionLevel, 0, dictSize);
+ return ZSTD_compressBegin_internal(cctx, dict, dictSize, ZSTD_dm_auto, NULL,
+ params, 0, ZSTDb_not_buffered);
+}
+
+
+size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel)
+{
+ return ZSTD_compressBegin_usingDict(cctx, NULL, 0, compressionLevel);
+}
+
+
+/*! ZSTD_writeEpilogue() :
+* Ends a frame.
+* @return : nb of bytes written into dst (or an error code) */
+static size_t ZSTD_writeEpilogue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity)
+{
+ BYTE* const ostart = (BYTE*)dst;
+ BYTE* op = ostart;
+ size_t fhSize = 0;
+
+ DEBUGLOG(5, "ZSTD_writeEpilogue");
+ if (cctx->stage == ZSTDcs_created) return ERROR(stage_wrong); /* init missing */
+
+ /* special case : empty frame */
+ if (cctx->stage == ZSTDcs_init) {
+ fhSize = ZSTD_writeFrameHeader(dst, dstCapacity, cctx->appliedParams, 0, 0);
+ if (ZSTD_isError(fhSize)) return fhSize;
+ dstCapacity -= fhSize;
+ op += fhSize;
+ cctx->stage = ZSTDcs_ongoing;
+ }
+
+ if (cctx->stage != ZSTDcs_ending) {
+ /* write one last empty block, make it the "last" block */
+ U32 const cBlockHeader24 = 1 /* last block */ + (((U32)bt_raw)<<1) + 0;
+ if (dstCapacity<4) return ERROR(dstSize_tooSmall);
+ MEM_writeLE32(op, cBlockHeader24);
+ op += ZSTD_blockHeaderSize;
+ dstCapacity -= ZSTD_blockHeaderSize;
+ }
+
+ if (cctx->appliedParams.fParams.checksumFlag) {
+ U32 const checksum = (U32) XXH64_digest(&cctx->xxhState);
+ if (dstCapacity<4) return ERROR(dstSize_tooSmall);
+ MEM_writeLE32(op, checksum);
+ op += 4;
+ }
+
+ cctx->stage = ZSTDcs_created; /* return to "created but no init" status */
+ return op-ostart;
+}
+
+
+size_t ZSTD_compressEnd (ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize)
+{
+ size_t endResult;
+ size_t const cSize = ZSTD_compressContinue_internal(cctx,
+ dst, dstCapacity, src, srcSize,
+ 1 /* frame mode */, 1 /* last chunk */);
+ if (ZSTD_isError(cSize)) return cSize;
+ endResult = ZSTD_writeEpilogue(cctx, (char*)dst + cSize, dstCapacity-cSize);
+ if (ZSTD_isError(endResult)) return endResult;
+ if (cctx->appliedParams.fParams.contentSizeFlag) { /* control src size */
+ DEBUGLOG(5, "end of frame : controlling src size");
+ if (cctx->pledgedSrcSizePlusOne != cctx->consumedSrcSize+1) {
+ DEBUGLOG(5, "error : pledgedSrcSize = %u, while realSrcSize = %u",
+ (U32)cctx->pledgedSrcSizePlusOne-1, (U32)cctx->consumedSrcSize);
+ return ERROR(srcSize_wrong);
+ } }
+ return cSize + endResult;
+}
+
+
+static size_t ZSTD_compress_internal (ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const void* dict,size_t dictSize,
+ ZSTD_parameters params)
+{
+ CHECK_F( ZSTD_compressBegin_internal(cctx, dict, dictSize, ZSTD_dm_auto, NULL,
+ params, srcSize, ZSTDb_not_buffered) );
+ return ZSTD_compressEnd(cctx, dst, dstCapacity, src, srcSize);
+}
+
+size_t ZSTD_compress_advanced (ZSTD_CCtx* ctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const void* dict,size_t dictSize,
+ ZSTD_parameters params)
+{
+ CHECK_F(ZSTD_checkCParams(params.cParams));
+ return ZSTD_compress_internal(ctx, dst, dstCapacity, src, srcSize, dict, dictSize, params);
+}
+
+size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize,
+ const void* dict, size_t dictSize, int compressionLevel)
+{
+ ZSTD_parameters params = ZSTD_getParams(compressionLevel, srcSize, dict ? dictSize : 0);
+ params.fParams.contentSizeFlag = 1;
+ return ZSTD_compress_internal(ctx, dst, dstCapacity, src, srcSize, dict, dictSize, params);
+}
+
+size_t ZSTD_compressCCtx (ZSTD_CCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel)
+{
+ return ZSTD_compress_usingDict(ctx, dst, dstCapacity, src, srcSize, NULL, 0, compressionLevel);
+}
+
+size_t ZSTD_compress(void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel)
+{
+ size_t result;
+ ZSTD_CCtx ctxBody;
+ memset(&ctxBody, 0, sizeof(ctxBody));
+ ctxBody.customMem = ZSTD_defaultCMem;
+ result = ZSTD_compressCCtx(&ctxBody, dst, dstCapacity, src, srcSize, compressionLevel);
+ ZSTD_free(ctxBody.workSpace, ZSTD_defaultCMem); /* can't free ctxBody itself, as it's on stack; free only heap content */
+ return result;
+}
+
+
+/* ===== Dictionary API ===== */
+
+/*! ZSTD_estimateCDictSize_advanced() :
+ * Estimate amount of memory that will be needed to create a dictionary with following arguments */
+size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, unsigned byReference)
+{
+ DEBUGLOG(5, "sizeof(ZSTD_CDict) : %u", (U32)sizeof(ZSTD_CDict));
+ DEBUGLOG(5, "CCtx estimate : %u", (U32)ZSTD_estimateCCtxSize_advanced(cParams));
+ return sizeof(ZSTD_CDict) + ZSTD_estimateCCtxSize_advanced(cParams)
+ + (byReference ? 0 : dictSize);
+}
+
+size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel)
+{
+ ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, 0, dictSize);
+ return ZSTD_estimateCDictSize_advanced(dictSize, cParams, 0);
+}
+
+size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict)
+{
+ if (cdict==NULL) return 0; /* support sizeof on NULL */
+ DEBUGLOG(5, "sizeof(*cdict) : %u", (U32)sizeof(*cdict));
+ DEBUGLOG(5, "ZSTD_sizeof_CCtx : %u", (U32)ZSTD_sizeof_CCtx(cdict->refContext));
+ return ZSTD_sizeof_CCtx(cdict->refContext) + (cdict->dictBuffer ? cdict->dictContentSize : 0) + sizeof(*cdict);
+}
+
+static ZSTD_parameters ZSTD_makeParams(ZSTD_compressionParameters cParams, ZSTD_frameParameters fParams)
+{
+ ZSTD_parameters params;
+ params.cParams = cParams;
+ params.fParams = fParams;
+ return params;
+}
+
+static size_t ZSTD_initCDict_internal(
+ ZSTD_CDict* cdict,
+ const void* dictBuffer, size_t dictSize,
+ unsigned byReference, ZSTD_dictMode_e dictMode,
+ ZSTD_compressionParameters cParams)
+{
+ DEBUGLOG(5, "ZSTD_initCDict_internal, mode %u", (U32)dictMode);
+ if ((byReference) || (!dictBuffer) || (!dictSize)) {
+ cdict->dictBuffer = NULL;
+ cdict->dictContent = dictBuffer;
+ } else {
+ void* const internalBuffer = ZSTD_malloc(dictSize, cdict->refContext->customMem);
+ cdict->dictBuffer = internalBuffer;
+ cdict->dictContent = internalBuffer;
+ if (!internalBuffer) return ERROR(memory_allocation);
+ memcpy(internalBuffer, dictBuffer, dictSize);
+ }
+ cdict->dictContentSize = dictSize;
+
+ { ZSTD_frameParameters const fParams = { 0 /* contentSizeFlag */,
+ 0 /* checksumFlag */, 0 /* noDictIDFlag */ }; /* dummy */
+ ZSTD_parameters const params = ZSTD_makeParams(cParams, fParams);
+ CHECK_F( ZSTD_compressBegin_internal(cdict->refContext,
+ cdict->dictContent, dictSize, dictMode,
+ NULL,
+ params, ZSTD_CONTENTSIZE_UNKNOWN,
+ ZSTDb_not_buffered) );
+ }
+
+ return 0;
+}
+
+ZSTD_CDict* ZSTD_createCDict_advanced(const void* dictBuffer, size_t dictSize,
+ unsigned byReference, ZSTD_dictMode_e dictMode,
+ ZSTD_compressionParameters cParams, ZSTD_customMem customMem)
+{
+ DEBUGLOG(5, "ZSTD_createCDict_advanced, mode %u", (U32)dictMode);
+ if (!customMem.customAlloc ^ !customMem.customFree) return NULL;
+
+ { ZSTD_CDict* const cdict = (ZSTD_CDict*)ZSTD_malloc(sizeof(ZSTD_CDict), customMem);
+ ZSTD_CCtx* const cctx = ZSTD_createCCtx_advanced(customMem);
+
+ if (!cdict || !cctx) {
+ ZSTD_free(cdict, customMem);
+ ZSTD_freeCCtx(cctx);
+ return NULL;
+ }
+ cdict->refContext = cctx;
+
+ if (ZSTD_isError( ZSTD_initCDict_internal(cdict,
+ dictBuffer, dictSize,
+ byReference, dictMode,
+ cParams) )) {
+ ZSTD_freeCDict(cdict);
+ return NULL;
+ }
+
+ return cdict;
+ }
+}
+
+ZSTD_CDict* ZSTD_createCDict(const void* dict, size_t dictSize, int compressionLevel)
+{
+ ZSTD_compressionParameters cParams = ZSTD_getCParams(compressionLevel, 0, dictSize);
+ return ZSTD_createCDict_advanced(dict, dictSize,
+ 0 /* byReference */, ZSTD_dm_auto,
+ cParams, ZSTD_defaultCMem);
+}
+
+ZSTD_CDict* ZSTD_createCDict_byReference(const void* dict, size_t dictSize, int compressionLevel)
+{
+ ZSTD_compressionParameters cParams = ZSTD_getCParams(compressionLevel, 0, dictSize);
+ return ZSTD_createCDict_advanced(dict, dictSize,
+ 1 /* byReference */, ZSTD_dm_auto,
+ cParams, ZSTD_defaultCMem);
+}
+
+size_t ZSTD_freeCDict(ZSTD_CDict* cdict)
+{
+ if (cdict==NULL) return 0; /* support free on NULL */
+ { ZSTD_customMem const cMem = cdict->refContext->customMem;
+ ZSTD_freeCCtx(cdict->refContext);
+ ZSTD_free(cdict->dictBuffer, cMem);
+ ZSTD_free(cdict, cMem);
+ return 0;
+ }
+}
+
+/*! ZSTD_initStaticCDict_advanced() :
+ * Generate a digested dictionary in provided memory area.
+ * workspace: The memory area to emplace the dictionary into.
+ * Provided pointer must 8-bytes aligned.
+ * It must outlive dictionary usage.
+ * workspaceSize: Use ZSTD_estimateCDictSize()
+ * to determine how large workspace must be.
+ * cParams : use ZSTD_getCParams() to transform a compression level
+ * into its relevants cParams.
+ * @return : pointer to ZSTD_CDict*, or NULL if error (size too small)
+ * Note : there is no corresponding "free" function.
+ * Since workspace was allocated externally, it must be freed externally.
+ */
+ZSTD_CDict* ZSTD_initStaticCDict(void* workspace, size_t workspaceSize,
+ const void* dict, size_t dictSize,
+ unsigned byReference, ZSTD_dictMode_e dictMode,
+ ZSTD_compressionParameters cParams)
+{
+ size_t const cctxSize = ZSTD_estimateCCtxSize_advanced(cParams);
+ size_t const neededSize = sizeof(ZSTD_CDict) + (byReference ? 0 : dictSize)
+ + cctxSize;
+ ZSTD_CDict* const cdict = (ZSTD_CDict*) workspace;
+ void* ptr;
+ DEBUGLOG(5, "(size_t)workspace & 7 : %u", (U32)(size_t)workspace & 7);
+ if ((size_t)workspace & 7) return NULL; /* 8-aligned */
+ DEBUGLOG(5, "(workspaceSize < neededSize) : (%u < %u) => %u",
+ (U32)workspaceSize, (U32)neededSize, (U32)(workspaceSize < neededSize));
+ if (workspaceSize < neededSize) return NULL;
+
+ if (!byReference) {
+ memcpy(cdict+1, dict, dictSize);
+ dict = cdict+1;
+ ptr = (char*)workspace + sizeof(ZSTD_CDict) + dictSize;
+ } else {
+ ptr = cdict+1;
+ }
+ cdict->refContext = ZSTD_initStaticCCtx(ptr, cctxSize);
+
+ if (ZSTD_isError( ZSTD_initCDict_internal(cdict,
+ dict, dictSize,
+ 1 /* byReference */, dictMode,
+ cParams) ))
+ return NULL;
+
+ return cdict;
+}
+
+ZSTD_parameters ZSTD_getParamsFromCDict(const ZSTD_CDict* cdict) {
+ return ZSTD_getParamsFromCCtx(cdict->refContext);
+}
+
+/* ZSTD_compressBegin_usingCDict_advanced() :
+ * cdict must be != NULL */
+size_t ZSTD_compressBegin_usingCDict_advanced(
+ ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict,
+ ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize)
+{
+ if (cdict==NULL) return ERROR(dictionary_wrong);
+ { ZSTD_parameters params = cdict->refContext->appliedParams;
+ params.fParams = fParams;
+ DEBUGLOG(5, "ZSTD_compressBegin_usingCDict_advanced");
+ return ZSTD_compressBegin_internal(cctx,
+ NULL, 0, ZSTD_dm_auto,
+ cdict,
+ params, pledgedSrcSize,
+ ZSTDb_not_buffered);
+ }
+}
+
+/* ZSTD_compressBegin_usingCDict() :
+ * pledgedSrcSize=0 means "unknown"
+ * if pledgedSrcSize>0, it will enable contentSizeFlag */
+size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict)
+{
+ ZSTD_frameParameters const fParams = { 0 /*content*/, 0 /*checksum*/, 0 /*noDictID*/ };
+ DEBUGLOG(5, "ZSTD_compressBegin_usingCDict : dictIDFlag == %u", !fParams.noDictIDFlag);
+ return ZSTD_compressBegin_usingCDict_advanced(cctx, cdict, fParams, 0);
+}
+
+size_t ZSTD_compress_usingCDict_advanced(ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const ZSTD_CDict* cdict, ZSTD_frameParameters fParams)
+{
+ CHECK_F (ZSTD_compressBegin_usingCDict_advanced(cctx, cdict, fParams, srcSize)); /* will check if cdict != NULL */
+ return ZSTD_compressEnd(cctx, dst, dstCapacity, src, srcSize);
+}
+
+/*! ZSTD_compress_usingCDict() :
+ * Compression using a digested Dictionary.
+ * Faster startup than ZSTD_compress_usingDict(), recommended when same dictionary is used multiple times.
+ * Note that compression parameters are decided at CDict creation time
+ * while frame parameters are hardcoded */
+size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const ZSTD_CDict* cdict)
+{
+ ZSTD_frameParameters const fParams = { 1 /*content*/, 0 /*checksum*/, 0 /*noDictID*/ };
+ return ZSTD_compress_usingCDict_advanced(cctx, dst, dstCapacity, src, srcSize, cdict, fParams);
+}
+
+
+
+/* ******************************************************************
+* Streaming
+********************************************************************/
+
+ZSTD_CStream* ZSTD_createCStream(void)
+{
+ return ZSTD_createCStream_advanced(ZSTD_defaultCMem);
+}
+
+ZSTD_CStream* ZSTD_initStaticCStream(void *workspace, size_t workspaceSize)
+{
+ return ZSTD_initStaticCCtx(workspace, workspaceSize);
+}
+
+ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem)
+{ /* CStream and CCtx are now same object */
+ return ZSTD_createCCtx_advanced(customMem);
+}
+
+size_t ZSTD_freeCStream(ZSTD_CStream* zcs)
+{
+ return ZSTD_freeCCtx(zcs); /* same object */
+}
+
+
+
+/*====== Initialization ======*/
+
+size_t ZSTD_CStreamInSize(void) { return ZSTD_BLOCKSIZE_MAX; }
+
+size_t ZSTD_CStreamOutSize(void)
+{
+ return ZSTD_compressBound(ZSTD_BLOCKSIZE_MAX) + ZSTD_blockHeaderSize + 4 /* 32-bits hash */ ;
+}
+
+static size_t ZSTD_resetCStream_internal(ZSTD_CStream* zcs,
+ const void* dict, size_t dictSize, ZSTD_dictMode_e dictMode,
+ const ZSTD_CDict* cdict,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize)
+{
+ DEBUGLOG(4, "ZSTD_resetCStream_internal");
+ /* params are supposed to be fully validated at this point */
+ assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams)));
+ assert(!((dict) && (cdict))); /* either dict or cdict, not both */
+
+ CHECK_F( ZSTD_compressBegin_internal(zcs,
+ dict, dictSize, dictMode,
+ cdict,
+ params, pledgedSrcSize,
+ ZSTDb_buffered) );
+
+ zcs->inToCompress = 0;
+ zcs->inBuffPos = 0;
+ zcs->inBuffTarget = zcs->blockSize;
+ zcs->outBuffContentSize = zcs->outBuffFlushedSize = 0;
+ zcs->streamStage = zcss_load;
+ zcs->frameEnded = 0;
+ return 0; /* ready to go */
+}
+
+size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize)
+{
+ ZSTD_parameters params = zcs->requestedParams;
+ params.fParams.contentSizeFlag = (pledgedSrcSize > 0);
+ DEBUGLOG(5, "ZSTD_resetCStream");
+ if (zcs->compressionLevel != ZSTD_CLEVEL_CUSTOM) {
+ params.cParams = ZSTD_getCParams(zcs->compressionLevel, pledgedSrcSize, 0 /* dictSize */);
+ }
+ return ZSTD_resetCStream_internal(zcs, NULL, 0, zcs->dictMode, zcs->cdict, params, pledgedSrcSize);
+}
+
+/*! ZSTD_initCStream_internal() :
+ * Note : not static, but hidden (not exposed). Used by zstdmt_compress.c
+ * Assumption 1 : params are valid
+ * Assumption 2 : either dict, or cdict, is defined, not both */
+size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs,
+ const void* dict, size_t dictSize, const ZSTD_CDict* cdict,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize)
+{
+ DEBUGLOG(5, "ZSTD_initCStream_internal");
+ assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams)));
+ assert(!((dict) && (cdict))); /* either dict or cdict, not both */
+
+ if (dict && dictSize >= 8) {
+ DEBUGLOG(5, "loading dictionary of size %u", (U32)dictSize);
+ if (zcs->staticSize) { /* static CCtx : never uses malloc */
+ /* incompatible with internal cdict creation */
+ return ERROR(memory_allocation);
+ }
+ ZSTD_freeCDict(zcs->cdictLocal);
+ zcs->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize,
+ zcs->dictContentByRef, zcs->dictMode,
+ params.cParams, zcs->customMem);
+ zcs->cdict = zcs->cdictLocal;
+ if (zcs->cdictLocal == NULL) return ERROR(memory_allocation);
+ } else {
+ if (cdict) {
+ ZSTD_parameters const cdictParams = ZSTD_getParamsFromCDict(cdict);
+ params.cParams = cdictParams.cParams; /* cParams are enforced from cdict */
+ }
+ ZSTD_freeCDict(zcs->cdictLocal);
+ zcs->cdictLocal = NULL;
+ zcs->cdict = cdict;
+ }
+
+ zcs->requestedParams = params;
+ zcs->compressionLevel = ZSTD_CLEVEL_CUSTOM;
+ return ZSTD_resetCStream_internal(zcs, NULL, 0, zcs->dictMode, zcs->cdict, params, pledgedSrcSize);
+}
+
+/* ZSTD_initCStream_usingCDict_advanced() :
+ * same as ZSTD_initCStream_usingCDict(), with control over frame parameters */
+size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs,
+ const ZSTD_CDict* cdict,
+ ZSTD_frameParameters fParams,
+ unsigned long long pledgedSrcSize)
+{ /* cannot handle NULL cdict (does not know what to do) */
+ if (!cdict) return ERROR(dictionary_wrong);
+ { ZSTD_parameters params = ZSTD_getParamsFromCDict(cdict);
+ params.fParams = fParams;
+ return ZSTD_initCStream_internal(zcs,
+ NULL, 0, cdict,
+ params, pledgedSrcSize);
+ }
+}
+
+/* note : cdict must outlive compression session */
+size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict)
+{
+ ZSTD_frameParameters const fParams = { 0 /* contentSize */, 0 /* checksum */, 0 /* hideDictID */ };
+ return ZSTD_initCStream_usingCDict_advanced(zcs, cdict, fParams, 0); /* note : will check that cdict != NULL */
+}
+
+size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs,
+ const void* dict, size_t dictSize,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize)
+{
+ CHECK_F( ZSTD_checkCParams(params.cParams) );
+ zcs->requestedParams = params;
+ zcs->compressionLevel = ZSTD_CLEVEL_CUSTOM;
+ return ZSTD_initCStream_internal(zcs, dict, dictSize, NULL, params, pledgedSrcSize);
+}
+
+size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel)
+{
+ ZSTD_parameters const params = ZSTD_getParams(compressionLevel, 0, dictSize);
+ zcs->compressionLevel = compressionLevel;
+ return ZSTD_initCStream_internal(zcs, dict, dictSize, NULL, params, 0);
+}
+
+size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize)
+{
+ ZSTD_parameters params = ZSTD_getParams(compressionLevel, pledgedSrcSize, 0);
+ params.fParams.contentSizeFlag = (pledgedSrcSize>0);
+ return ZSTD_initCStream_internal(zcs, NULL, 0, NULL, params, pledgedSrcSize);
+}
+
+size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel)
+{
+ ZSTD_parameters const params = ZSTD_getParams(compressionLevel, 0, 0);
+ return ZSTD_initCStream_internal(zcs, NULL, 0, NULL, params, 0);
+}
+
+/*====== Compression ======*/
+
+MEM_STATIC size_t ZSTD_limitCopy(void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize)
+{
+ size_t const length = MIN(dstCapacity, srcSize);
+ if (length) memcpy(dst, src, length);
+ return length;
+}
+
+/** ZSTD_compressStream_generic():
+ * internal function for all *compressStream*() variants and *compress_generic()
+ * @return : hint size for next input */
+size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs,
+ ZSTD_outBuffer* output,
+ ZSTD_inBuffer* input,
+ ZSTD_EndDirective const flushMode)
+{
+ const char* const istart = (const char*)input->src;
+ const char* const iend = istart + input->size;
+ const char* ip = istart + input->pos;
+ char* const ostart = (char*)output->dst;
+ char* const oend = ostart + output->size;
+ char* op = ostart + output->pos;
+ U32 someMoreWork = 1;
+
+ /* check expectations */
+ DEBUGLOG(5, "ZSTD_compressStream_generic, flush=%u", (U32)flushMode);
+ assert(zcs->inBuff != NULL);
+ assert(zcs->inBuffSize>0);
+ assert(zcs->outBuff!= NULL);
+ assert(zcs->outBuffSize>0);
+ assert(output->pos <= output->size);
+ assert(input->pos <= input->size);
+
+ while (someMoreWork) {
+ switch(zcs->streamStage)
+ {
+ case zcss_init:
+ /* call ZSTD_initCStream() first ! */
+ return ERROR(init_missing);
+
+ case zcss_load:
+ if ( (flushMode == ZSTD_e_end)
+ && ((size_t)(oend-op) >= ZSTD_compressBound(iend-ip)) /* enough dstCapacity */
+ && (zcs->inBuffPos == 0) ) {
+ /* shortcut to compression pass directly into output buffer */
+ size_t const cSize = ZSTD_compressEnd(zcs,
+ op, oend-op, ip, iend-ip);
+ DEBUGLOG(4, "ZSTD_compressEnd : %u", (U32)cSize);
+ if (ZSTD_isError(cSize)) return cSize;
+ ip = iend;
+ op += cSize;
+ zcs->frameEnded = 1;
+ ZSTD_startNewCompression(zcs);
+ someMoreWork = 0; break;
+ }
+ /* complete loading into inBuffer */
+ { size_t const toLoad = zcs->inBuffTarget - zcs->inBuffPos;
+ size_t const loaded = ZSTD_limitCopy(
+ zcs->inBuff + zcs->inBuffPos, toLoad,
+ ip, iend-ip);
+ zcs->inBuffPos += loaded;
+ ip += loaded;
+ if ( (flushMode == ZSTD_e_continue)
+ && (zcs->inBuffPos < zcs->inBuffTarget) ) {
+ /* not enough input to fill full block : stop here */
+ someMoreWork = 0; break;
+ }
+ if ( (flushMode == ZSTD_e_flush)
+ && (zcs->inBuffPos == zcs->inToCompress) ) {
+ /* empty */
+ someMoreWork = 0; break;
+ }
+ }
+ /* compress current block (note : this stage cannot be stopped in the middle) */
+ DEBUGLOG(5, "stream compression stage (flushMode==%u)", flushMode);
+ { void* cDst;
+ size_t cSize;
+ size_t const iSize = zcs->inBuffPos - zcs->inToCompress;
+ size_t oSize = oend-op;
+ unsigned const lastBlock = (flushMode == ZSTD_e_end) && (ip==iend);
+ if (oSize >= ZSTD_compressBound(iSize))
+ cDst = op; /* compress into output buffer, to skip flush stage */
+ else
+ cDst = zcs->outBuff, oSize = zcs->outBuffSize;
+ cSize = lastBlock ?
+ ZSTD_compressEnd(zcs, cDst, oSize,
+ zcs->inBuff + zcs->inToCompress, iSize) :
+ ZSTD_compressContinue(zcs, cDst, oSize,
+ zcs->inBuff + zcs->inToCompress, iSize);
+ if (ZSTD_isError(cSize)) return cSize;
+ zcs->frameEnded = lastBlock;
+ /* prepare next block */
+ zcs->inBuffTarget = zcs->inBuffPos + zcs->blockSize;
+ if (zcs->inBuffTarget > zcs->inBuffSize)
+ zcs->inBuffPos = 0, zcs->inBuffTarget = zcs->blockSize;
+ DEBUGLOG(5, "inBuffTarget:%u / inBuffSize:%u",
+ (U32)zcs->inBuffTarget, (U32)zcs->inBuffSize);
+ if (!lastBlock)
+ assert(zcs->inBuffTarget <= zcs->inBuffSize);
+ zcs->inToCompress = zcs->inBuffPos;
+ if (cDst == op) { /* no need to flush */
+ op += cSize;
+ if (zcs->frameEnded) {
+ DEBUGLOG(5, "Frame completed directly in outBuffer");
+ someMoreWork = 0;
+ ZSTD_startNewCompression(zcs);
+ }
+ break;
+ }
+ zcs->outBuffContentSize = cSize;
+ zcs->outBuffFlushedSize = 0;
+ zcs->streamStage = zcss_flush; /* pass-through to flush stage */
+ }
+ /* fall-through */
+ case zcss_flush:
+ DEBUGLOG(5, "flush stage");
+ { size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize;
+ size_t const flushed = ZSTD_limitCopy(op, oend-op,
+ zcs->outBuff + zcs->outBuffFlushedSize, toFlush);
+ DEBUGLOG(5, "toFlush: %u into %u ==> flushed: %u",
+ (U32)toFlush, (U32)(oend-op), (U32)flushed);
+ op += flushed;
+ zcs->outBuffFlushedSize += flushed;
+ if (toFlush!=flushed) {
+ /* flush not fully completed, presumably because dst is too small */
+ assert(op==oend);
+ someMoreWork = 0;
+ break;
+ }
+ zcs->outBuffContentSize = zcs->outBuffFlushedSize = 0;
+ if (zcs->frameEnded) {
+ DEBUGLOG(5, "Frame completed on flush");
+ someMoreWork = 0;
+ ZSTD_startNewCompression(zcs);
+ break;
+ }
+ zcs->streamStage = zcss_load;
+ break;
+ }
+
+ default: /* impossible */
+ assert(0);
+ }
+ }
+
+ input->pos = ip - istart;
+ output->pos = op - ostart;
+ if (zcs->frameEnded) return 0;
+ { size_t hintInSize = zcs->inBuffTarget - zcs->inBuffPos;
+ if (hintInSize==0) hintInSize = zcs->blockSize;
+ return hintInSize;
+ }
+}
+
+size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input)
+{
+ /* check conditions */
+ if (output->pos > output->size) return ERROR(GENERIC);
+ if (input->pos > input->size) return ERROR(GENERIC);
+
+ return ZSTD_compressStream_generic(zcs, output, input, ZSTD_e_continue);
+}
+
+/*! ZSTDMT_initCStream_internal() :
+ * Private use only. Init streaming operation.
+ * expects params to be valid.
+ * must receive dict, or cdict, or none, but not both.
+ * @return : 0, or an error code */
+size_t ZSTDMT_initCStream_internal(ZSTDMT_CCtx* zcs,
+ const void* dict, size_t dictSize, const ZSTD_CDict* cdict,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize);
+
+
+size_t ZSTD_compress_generic (ZSTD_CCtx* cctx,
+ ZSTD_outBuffer* output,
+ ZSTD_inBuffer* input,
+ ZSTD_EndDirective endOp)
+{
+ /* check conditions */
+ if (output->pos > output->size) return ERROR(GENERIC);
+ if (input->pos > input->size) return ERROR(GENERIC);
+ assert(cctx!=NULL);
+
+ /* transparent initialization stage */
+ if (cctx->streamStage == zcss_init) {
+ const void* const prefix = cctx->prefix;
+ size_t const prefixSize = cctx->prefixSize;
+ ZSTD_parameters params = cctx->requestedParams;
+ if (cctx->compressionLevel != ZSTD_CLEVEL_CUSTOM)
+ params.cParams = ZSTD_getCParams(cctx->compressionLevel,
+ cctx->pledgedSrcSizePlusOne-1, 0 /*dictSize*/);
+ cctx->prefix = NULL; cctx->prefixSize = 0; /* single usage */
+ assert(prefix==NULL || cctx->cdict==NULL); /* only one can be set */
+
+#ifdef ZSTD_MULTITHREAD
+ if (cctx->nbThreads > 1) {
+ DEBUGLOG(4, "call ZSTDMT_initCStream_internal as nbThreads=%u", cctx->nbThreads);
+ CHECK_F( ZSTDMT_initCStream_internal(cctx->mtctx, prefix, prefixSize, cctx->cdict, params, cctx->pledgedSrcSizePlusOne-1) );
+ cctx->streamStage = zcss_load;
+ } else
+#endif
+ {
+ CHECK_F( ZSTD_resetCStream_internal(cctx, prefix, prefixSize, cctx->dictMode, cctx->cdict, params, cctx->pledgedSrcSizePlusOne-1) );
+ } }
+
+ /* compression stage */
+#ifdef ZSTD_MULTITHREAD
+ if (cctx->nbThreads > 1) {
+ size_t const flushMin = ZSTDMT_compressStream_generic(cctx->mtctx, output, input, endOp);
+ DEBUGLOG(5, "ZSTDMT_compressStream_generic : %u", (U32)flushMin);
+ if ( ZSTD_isError(flushMin)
+ || (endOp == ZSTD_e_end && flushMin == 0) ) { /* compression completed */
+ ZSTD_startNewCompression(cctx);
+ }
+ return flushMin;
+ }
+#endif
+
+ CHECK_F( ZSTD_compressStream_generic(cctx, output, input, endOp) );
+ DEBUGLOG(5, "completed ZSTD_compress_generic");
+ return cctx->outBuffContentSize - cctx->outBuffFlushedSize; /* remaining to flush */
+}
+
+size_t ZSTD_compress_generic_simpleArgs (
+ ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity, size_t* dstPos,
+ const void* src, size_t srcSize, size_t* srcPos,
+ ZSTD_EndDirective endOp)
+{
+ ZSTD_outBuffer output = { dst, dstCapacity, *dstPos };
+ ZSTD_inBuffer input = { src, srcSize, *srcPos };
+ /* ZSTD_compress_generic() will check validity of dstPos and srcPos */
+ size_t const cErr = ZSTD_compress_generic(cctx, &output, &input, endOp);
+ *dstPos = output.pos;
+ *srcPos = input.pos;
+ return cErr;
+}
+
+
+/*====== Finalize ======*/
+
+/*! ZSTD_flushStream() :
+* @return : amount of data remaining to flush */
+size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output)
+{
+ ZSTD_inBuffer input = { NULL, 0, 0 };
+ if (output->pos > output->size) return ERROR(GENERIC);
+ CHECK_F( ZSTD_compressStream_generic(zcs, output, &input, ZSTD_e_flush) );
+ return zcs->outBuffContentSize - zcs->outBuffFlushedSize; /* remaining to flush */
+}
+
+
+size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output)
+{
+ ZSTD_inBuffer input = { NULL, 0, 0 };
+ if (output->pos > output->size) return ERROR(GENERIC);
+ CHECK_F( ZSTD_compressStream_generic(zcs, output, &input, ZSTD_e_end) );
+ { size_t const lastBlockSize = zcs->frameEnded ? 0 : ZSTD_BLOCKHEADERSIZE;
+ size_t const checksumSize = zcs->frameEnded ? 0 : zcs->appliedParams.fParams.checksumFlag * 4;
+ size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize + lastBlockSize + checksumSize;
+ DEBUGLOG(5, "ZSTD_endStream : remaining to flush : %u",
+ (unsigned)toFlush);
+ return toFlush;
+ }
+}
+
+
+/*-===== Pre-defined compression levels =====-*/
+
+#define ZSTD_MAX_CLEVEL 22
+int ZSTD_maxCLevel(void) { return ZSTD_MAX_CLEVEL; }
+
+static const ZSTD_compressionParameters ZSTD_defaultCParameters[4][ZSTD_MAX_CLEVEL+1] = {
+{ /* "default" - guarantees a monotonically increasing memory budget */
+ /* W, C, H, S, L, TL, strat */
+ { 18, 12, 12, 1, 7, 16, ZSTD_fast }, /* level 0 - never used */
+ { 19, 13, 14, 1, 7, 16, ZSTD_fast }, /* level 1 */
+ { 19, 15, 16, 1, 6, 16, ZSTD_fast }, /* level 2 */
+ { 20, 16, 17, 1, 5, 16, ZSTD_dfast }, /* level 3 */
+ { 20, 17, 18, 1, 5, 16, ZSTD_dfast }, /* level 4 */
+ { 20, 17, 18, 2, 5, 16, ZSTD_greedy }, /* level 5 */
+ { 21, 17, 19, 2, 5, 16, ZSTD_lazy }, /* level 6 */
+ { 21, 18, 19, 3, 5, 16, ZSTD_lazy }, /* level 7 */
+ { 21, 18, 20, 3, 5, 16, ZSTD_lazy2 }, /* level 8 */
+ { 21, 19, 20, 3, 5, 16, ZSTD_lazy2 }, /* level 9 */
+ { 21, 19, 21, 4, 5, 16, ZSTD_lazy2 }, /* level 10 */
+ { 22, 20, 22, 4, 5, 16, ZSTD_lazy2 }, /* level 11 */
+ { 22, 20, 22, 5, 5, 16, ZSTD_lazy2 }, /* level 12 */
+ { 22, 21, 22, 5, 5, 16, ZSTD_lazy2 }, /* level 13 */
+ { 22, 21, 22, 6, 5, 16, ZSTD_lazy2 }, /* level 14 */
+ { 22, 21, 22, 5, 5, 16, ZSTD_btlazy2 }, /* level 15 */
+ { 23, 22, 22, 5, 5, 16, ZSTD_btlazy2 }, /* level 16 */
+ { 23, 22, 22, 4, 5, 24, ZSTD_btopt }, /* level 17 */
+ { 23, 22, 22, 5, 4, 32, ZSTD_btopt }, /* level 18 */
+ { 23, 23, 22, 6, 3, 48, ZSTD_btopt }, /* level 19 */
+ { 25, 25, 23, 7, 3, 64, ZSTD_btultra }, /* level 20 */
+ { 26, 26, 24, 7, 3,256, ZSTD_btultra }, /* level 21 */
+ { 27, 27, 25, 9, 3,512, ZSTD_btultra }, /* level 22 */
+},
+{ /* for srcSize <= 256 KB */
+ /* W, C, H, S, L, T, strat */
+ { 0, 0, 0, 0, 0, 0, ZSTD_fast }, /* level 0 - not used */
+ { 18, 13, 14, 1, 6, 8, ZSTD_fast }, /* level 1 */
+ { 18, 14, 13, 1, 5, 8, ZSTD_dfast }, /* level 2 */
+ { 18, 16, 15, 1, 5, 8, ZSTD_dfast }, /* level 3 */
+ { 18, 15, 17, 1, 5, 8, ZSTD_greedy }, /* level 4.*/
+ { 18, 16, 17, 4, 5, 8, ZSTD_greedy }, /* level 5.*/
+ { 18, 16, 17, 3, 5, 8, ZSTD_lazy }, /* level 6.*/
+ { 18, 17, 17, 4, 4, 8, ZSTD_lazy }, /* level 7 */
+ { 18, 17, 17, 4, 4, 8, ZSTD_lazy2 }, /* level 8 */
+ { 18, 17, 17, 5, 4, 8, ZSTD_lazy2 }, /* level 9 */
+ { 18, 17, 17, 6, 4, 8, ZSTD_lazy2 }, /* level 10 */
+ { 18, 18, 17, 6, 4, 8, ZSTD_lazy2 }, /* level 11.*/
+ { 18, 18, 17, 7, 4, 8, ZSTD_lazy2 }, /* level 12.*/
+ { 18, 19, 17, 6, 4, 8, ZSTD_btlazy2 }, /* level 13 */
+ { 18, 18, 18, 4, 4, 16, ZSTD_btopt }, /* level 14.*/
+ { 18, 18, 18, 4, 3, 16, ZSTD_btopt }, /* level 15.*/
+ { 18, 19, 18, 6, 3, 32, ZSTD_btopt }, /* level 16.*/
+ { 18, 19, 18, 8, 3, 64, ZSTD_btopt }, /* level 17.*/
+ { 18, 19, 18, 9, 3,128, ZSTD_btopt }, /* level 18.*/
+ { 18, 19, 18, 10, 3,256, ZSTD_btopt }, /* level 19.*/
+ { 18, 19, 18, 11, 3,512, ZSTD_btultra }, /* level 20.*/
+ { 18, 19, 18, 12, 3,512, ZSTD_btultra }, /* level 21.*/
+ { 18, 19, 18, 13, 3,512, ZSTD_btultra }, /* level 22.*/
+},
+{ /* for srcSize <= 128 KB */
+ /* W, C, H, S, L, T, strat */
+ { 17, 12, 12, 1, 7, 8, ZSTD_fast }, /* level 0 - not used */
+ { 17, 12, 13, 1, 6, 8, ZSTD_fast }, /* level 1 */
+ { 17, 13, 16, 1, 5, 8, ZSTD_fast }, /* level 2 */
+ { 17, 16, 16, 2, 5, 8, ZSTD_dfast }, /* level 3 */
+ { 17, 13, 15, 3, 4, 8, ZSTD_greedy }, /* level 4 */
+ { 17, 15, 17, 4, 4, 8, ZSTD_greedy }, /* level 5 */
+ { 17, 16, 17, 3, 4, 8, ZSTD_lazy }, /* level 6 */
+ { 17, 15, 17, 4, 4, 8, ZSTD_lazy2 }, /* level 7 */
+ { 17, 17, 17, 4, 4, 8, ZSTD_lazy2 }, /* level 8 */
+ { 17, 17, 17, 5, 4, 8, ZSTD_lazy2 }, /* level 9 */
+ { 17, 17, 17, 6, 4, 8, ZSTD_lazy2 }, /* level 10 */
+ { 17, 17, 17, 7, 4, 8, ZSTD_lazy2 }, /* level 11 */
+ { 17, 17, 17, 8, 4, 8, ZSTD_lazy2 }, /* level 12 */
+ { 17, 18, 17, 6, 4, 8, ZSTD_btlazy2 }, /* level 13.*/
+ { 17, 17, 17, 7, 3, 8, ZSTD_btopt }, /* level 14.*/
+ { 17, 17, 17, 7, 3, 16, ZSTD_btopt }, /* level 15.*/
+ { 17, 18, 17, 7, 3, 32, ZSTD_btopt }, /* level 16.*/
+ { 17, 18, 17, 7, 3, 64, ZSTD_btopt }, /* level 17.*/
+ { 17, 18, 17, 7, 3,256, ZSTD_btopt }, /* level 18.*/
+ { 17, 18, 17, 8, 3,256, ZSTD_btopt }, /* level 19.*/
+ { 17, 18, 17, 9, 3,256, ZSTD_btultra }, /* level 20.*/
+ { 17, 18, 17, 10, 3,256, ZSTD_btultra }, /* level 21.*/
+ { 17, 18, 17, 11, 3,512, ZSTD_btultra }, /* level 22.*/
+},
+{ /* for srcSize <= 16 KB */
+ /* W, C, H, S, L, T, strat */
+ { 14, 12, 12, 1, 7, 6, ZSTD_fast }, /* level 0 - not used */
+ { 14, 14, 14, 1, 6, 6, ZSTD_fast }, /* level 1 */
+ { 14, 14, 14, 1, 4, 6, ZSTD_fast }, /* level 2 */
+ { 14, 14, 14, 1, 4, 6, ZSTD_dfast }, /* level 3.*/
+ { 14, 14, 14, 4, 4, 6, ZSTD_greedy }, /* level 4.*/
+ { 14, 14, 14, 3, 4, 6, ZSTD_lazy }, /* level 5.*/
+ { 14, 14, 14, 4, 4, 6, ZSTD_lazy2 }, /* level 6 */
+ { 14, 14, 14, 5, 4, 6, ZSTD_lazy2 }, /* level 7 */
+ { 14, 14, 14, 6, 4, 6, ZSTD_lazy2 }, /* level 8.*/
+ { 14, 15, 14, 6, 4, 6, ZSTD_btlazy2 }, /* level 9.*/
+ { 14, 15, 14, 3, 3, 6, ZSTD_btopt }, /* level 10.*/
+ { 14, 15, 14, 6, 3, 8, ZSTD_btopt }, /* level 11.*/
+ { 14, 15, 14, 6, 3, 16, ZSTD_btopt }, /* level 12.*/
+ { 14, 15, 14, 6, 3, 24, ZSTD_btopt }, /* level 13.*/
+ { 14, 15, 15, 6, 3, 48, ZSTD_btopt }, /* level 14.*/
+ { 14, 15, 15, 6, 3, 64, ZSTD_btopt }, /* level 15.*/
+ { 14, 15, 15, 6, 3, 96, ZSTD_btopt }, /* level 16.*/
+ { 14, 15, 15, 6, 3,128, ZSTD_btopt }, /* level 17.*/
+ { 14, 15, 15, 6, 3,256, ZSTD_btopt }, /* level 18.*/
+ { 14, 15, 15, 7, 3,256, ZSTD_btopt }, /* level 19.*/
+ { 14, 15, 15, 8, 3,256, ZSTD_btultra }, /* level 20.*/
+ { 14, 15, 15, 9, 3,256, ZSTD_btultra }, /* level 21.*/
+ { 14, 15, 15, 10, 3,256, ZSTD_btultra }, /* level 22.*/
+},
+};
+
+#if defined(ZSTD_DEBUG) && (ZSTD_DEBUG>=1)
+/* This function just controls
+ * the monotonic memory budget increase of ZSTD_defaultCParameters[0].
+ * Run once, on first ZSTD_getCParams() usage, if ZSTD_DEBUG is enabled
+ */
+MEM_STATIC void ZSTD_check_compressionLevel_monotonicIncrease_memoryBudget(void)
+{
+ int level;
+ for (level=1; level<ZSTD_maxCLevel(); level++) {
+ ZSTD_compressionParameters const c1 = ZSTD_defaultCParameters[0][level];
+ ZSTD_compressionParameters const c2 = ZSTD_defaultCParameters[0][level+1];
+ assert(c1.windowLog <= c2.windowLog);
+# define ZSTD_TABLECOST(h,c) ((1<<(h)) + (1<<(c)))
+ assert(ZSTD_TABLECOST(c1.hashLog, c1.chainLog) <= ZSTD_TABLECOST(c2.hashLog, c2.chainLog));
+ }
+}
+#endif
+
+/*! ZSTD_getCParams() :
+* @return ZSTD_compressionParameters structure for a selected compression level, `srcSize` and `dictSize`.
+* Size values are optional, provide 0 if not known or unused */
+ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long srcSizeHint, size_t dictSize)
+{
+ size_t const addedSize = srcSizeHint ? 0 : 500;
+ U64 const rSize = srcSizeHint+dictSize ? srcSizeHint+dictSize+addedSize : (U64)-1;
+ U32 const tableID = (rSize <= 256 KB) + (rSize <= 128 KB) + (rSize <= 16 KB); /* intentional underflow for srcSizeHint == 0 */
+
+#if defined(ZSTD_DEBUG) && (ZSTD_DEBUG>=1)
+ static int g_monotonicTest = 1;
+ if (g_monotonicTest) {
+ ZSTD_check_compressionLevel_monotonicIncrease_memoryBudget();
+ g_monotonicTest=0;
+ }
+#endif
+
+ if (compressionLevel <= 0) compressionLevel = ZSTD_CLEVEL_DEFAULT; /* 0 == default; no negative compressionLevel yet */
+ if (compressionLevel > ZSTD_MAX_CLEVEL) compressionLevel = ZSTD_MAX_CLEVEL;
+ { ZSTD_compressionParameters const cp = ZSTD_defaultCParameters[tableID][compressionLevel];
+ return ZSTD_adjustCParams_internal(cp, srcSizeHint, dictSize); }
+}
+
+/*! ZSTD_getParams() :
+* same as ZSTD_getCParams(), but @return a `ZSTD_parameters` object (instead of `ZSTD_compressionParameters`).
+* All fields of `ZSTD_frameParameters` are set to default (0) */
+ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long srcSizeHint, size_t dictSize) {
+ ZSTD_parameters params;
+ ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, srcSizeHint, dictSize);
+ memset(&params, 0, sizeof(params));
+ params.cParams = cParams;
+ return params;
+}
diff --git a/thirdparty/zstd/compress/zstd_opt.h b/thirdparty/zstd/compress/zstd_opt.h
new file mode 100644
index 0000000000..e8e98915ea
--- /dev/null
+++ b/thirdparty/zstd/compress/zstd_opt.h
@@ -0,0 +1,936 @@
+/**
+ * Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+
+/* Note : this file is intended to be included within zstd_compress.c */
+
+
+#ifndef ZSTD_OPT_H_91842398743
+#define ZSTD_OPT_H_91842398743
+
+
+#define ZSTD_LITFREQ_ADD 2
+#define ZSTD_FREQ_DIV 4
+#define ZSTD_MAX_PRICE (1<<30)
+
+/*-*************************************
+* Price functions for optimal parser
+***************************************/
+FORCE_INLINE void ZSTD_setLog2Prices(seqStore_t* ssPtr)
+{
+ ssPtr->log2matchLengthSum = ZSTD_highbit32(ssPtr->matchLengthSum+1);
+ ssPtr->log2litLengthSum = ZSTD_highbit32(ssPtr->litLengthSum+1);
+ ssPtr->log2litSum = ZSTD_highbit32(ssPtr->litSum+1);
+ ssPtr->log2offCodeSum = ZSTD_highbit32(ssPtr->offCodeSum+1);
+ ssPtr->factor = 1 + ((ssPtr->litSum>>5) / ssPtr->litLengthSum) + ((ssPtr->litSum<<1) / (ssPtr->litSum + ssPtr->matchSum));
+}
+
+
+MEM_STATIC void ZSTD_rescaleFreqs(seqStore_t* ssPtr, const BYTE* src, size_t srcSize)
+{
+ unsigned u;
+
+ ssPtr->cachedLiterals = NULL;
+ ssPtr->cachedPrice = ssPtr->cachedLitLength = 0;
+ ssPtr->staticPrices = 0;
+
+ if (ssPtr->litLengthSum == 0) {
+ if (srcSize <= 1024) ssPtr->staticPrices = 1;
+
+ assert(ssPtr->litFreq!=NULL);
+ for (u=0; u<=MaxLit; u++)
+ ssPtr->litFreq[u] = 0;
+ for (u=0; u<srcSize; u++)
+ ssPtr->litFreq[src[u]]++;
+
+ ssPtr->litSum = 0;
+ ssPtr->litLengthSum = MaxLL+1;
+ ssPtr->matchLengthSum = MaxML+1;
+ ssPtr->offCodeSum = (MaxOff+1);
+ ssPtr->matchSum = (ZSTD_LITFREQ_ADD<<Litbits);
+
+ for (u=0; u<=MaxLit; u++) {
+ ssPtr->litFreq[u] = 1 + (ssPtr->litFreq[u]>>ZSTD_FREQ_DIV);
+ ssPtr->litSum += ssPtr->litFreq[u];
+ }
+ for (u=0; u<=MaxLL; u++)
+ ssPtr->litLengthFreq[u] = 1;
+ for (u=0; u<=MaxML; u++)
+ ssPtr->matchLengthFreq[u] = 1;
+ for (u=0; u<=MaxOff; u++)
+ ssPtr->offCodeFreq[u] = 1;
+ } else {
+ ssPtr->matchLengthSum = 0;
+ ssPtr->litLengthSum = 0;
+ ssPtr->offCodeSum = 0;
+ ssPtr->matchSum = 0;
+ ssPtr->litSum = 0;
+
+ for (u=0; u<=MaxLit; u++) {
+ ssPtr->litFreq[u] = 1 + (ssPtr->litFreq[u]>>(ZSTD_FREQ_DIV+1));
+ ssPtr->litSum += ssPtr->litFreq[u];
+ }
+ for (u=0; u<=MaxLL; u++) {
+ ssPtr->litLengthFreq[u] = 1 + (ssPtr->litLengthFreq[u]>>(ZSTD_FREQ_DIV+1));
+ ssPtr->litLengthSum += ssPtr->litLengthFreq[u];
+ }
+ for (u=0; u<=MaxML; u++) {
+ ssPtr->matchLengthFreq[u] = 1 + (ssPtr->matchLengthFreq[u]>>ZSTD_FREQ_DIV);
+ ssPtr->matchLengthSum += ssPtr->matchLengthFreq[u];
+ ssPtr->matchSum += ssPtr->matchLengthFreq[u] * (u + 3);
+ }
+ ssPtr->matchSum *= ZSTD_LITFREQ_ADD;
+ for (u=0; u<=MaxOff; u++) {
+ ssPtr->offCodeFreq[u] = 1 + (ssPtr->offCodeFreq[u]>>ZSTD_FREQ_DIV);
+ ssPtr->offCodeSum += ssPtr->offCodeFreq[u];
+ }
+ }
+
+ ZSTD_setLog2Prices(ssPtr);
+}
+
+
+FORCE_INLINE U32 ZSTD_getLiteralPrice(seqStore_t* ssPtr, U32 litLength, const BYTE* literals)
+{
+ U32 price, u;
+
+ if (ssPtr->staticPrices)
+ return ZSTD_highbit32((U32)litLength+1) + (litLength*6);
+
+ if (litLength == 0)
+ return ssPtr->log2litLengthSum - ZSTD_highbit32(ssPtr->litLengthFreq[0]+1);
+
+ /* literals */
+ if (ssPtr->cachedLiterals == literals) {
+ U32 const additional = litLength - ssPtr->cachedLitLength;
+ const BYTE* literals2 = ssPtr->cachedLiterals + ssPtr->cachedLitLength;
+ price = ssPtr->cachedPrice + additional * ssPtr->log2litSum;
+ for (u=0; u < additional; u++)
+ price -= ZSTD_highbit32(ssPtr->litFreq[literals2[u]]+1);
+ ssPtr->cachedPrice = price;
+ ssPtr->cachedLitLength = litLength;
+ } else {
+ price = litLength * ssPtr->log2litSum;
+ for (u=0; u < litLength; u++)
+ price -= ZSTD_highbit32(ssPtr->litFreq[literals[u]]+1);
+
+ if (litLength >= 12) {
+ ssPtr->cachedLiterals = literals;
+ ssPtr->cachedPrice = price;
+ ssPtr->cachedLitLength = litLength;
+ }
+ }
+
+ /* literal Length */
+ { const BYTE LL_deltaCode = 19;
+ const BYTE llCode = (litLength>63) ? (BYTE)ZSTD_highbit32(litLength) + LL_deltaCode : LL_Code[litLength];
+ price += LL_bits[llCode] + ssPtr->log2litLengthSum - ZSTD_highbit32(ssPtr->litLengthFreq[llCode]+1);
+ }
+
+ return price;
+}
+
+
+FORCE_INLINE U32 ZSTD_getPrice(seqStore_t* seqStorePtr, U32 litLength, const BYTE* literals, U32 offset, U32 matchLength, const int ultra)
+{
+ /* offset */
+ U32 price;
+ BYTE const offCode = (BYTE)ZSTD_highbit32(offset+1);
+
+ if (seqStorePtr->staticPrices)
+ return ZSTD_getLiteralPrice(seqStorePtr, litLength, literals) + ZSTD_highbit32((U32)matchLength+1) + 16 + offCode;
+
+ price = offCode + seqStorePtr->log2offCodeSum - ZSTD_highbit32(seqStorePtr->offCodeFreq[offCode]+1);
+ if (!ultra && offCode >= 20) price += (offCode-19)*2;
+
+ /* match Length */
+ { const BYTE ML_deltaCode = 36;
+ const BYTE mlCode = (matchLength>127) ? (BYTE)ZSTD_highbit32(matchLength) + ML_deltaCode : ML_Code[matchLength];
+ price += ML_bits[mlCode] + seqStorePtr->log2matchLengthSum - ZSTD_highbit32(seqStorePtr->matchLengthFreq[mlCode]+1);
+ }
+
+ return price + ZSTD_getLiteralPrice(seqStorePtr, litLength, literals) + seqStorePtr->factor;
+}
+
+
+MEM_STATIC void ZSTD_updatePrice(seqStore_t* seqStorePtr, U32 litLength, const BYTE* literals, U32 offset, U32 matchLength)
+{
+ U32 u;
+
+ /* literals */
+ seqStorePtr->litSum += litLength*ZSTD_LITFREQ_ADD;
+ for (u=0; u < litLength; u++)
+ seqStorePtr->litFreq[literals[u]] += ZSTD_LITFREQ_ADD;
+
+ /* literal Length */
+ { const BYTE LL_deltaCode = 19;
+ const BYTE llCode = (litLength>63) ? (BYTE)ZSTD_highbit32(litLength) + LL_deltaCode : LL_Code[litLength];
+ seqStorePtr->litLengthFreq[llCode]++;
+ seqStorePtr->litLengthSum++;
+ }
+
+ /* match offset */
+ { BYTE const offCode = (BYTE)ZSTD_highbit32(offset+1);
+ seqStorePtr->offCodeSum++;
+ seqStorePtr->offCodeFreq[offCode]++;
+ }
+
+ /* match Length */
+ { const BYTE ML_deltaCode = 36;
+ const BYTE mlCode = (matchLength>127) ? (BYTE)ZSTD_highbit32(matchLength) + ML_deltaCode : ML_Code[matchLength];
+ seqStorePtr->matchLengthFreq[mlCode]++;
+ seqStorePtr->matchLengthSum++;
+ }
+
+ ZSTD_setLog2Prices(seqStorePtr);
+}
+
+
+#define SET_PRICE(pos, mlen_, offset_, litlen_, price_) \
+ { \
+ while (last_pos < pos) { opt[last_pos+1].price = ZSTD_MAX_PRICE; last_pos++; } \
+ opt[pos].mlen = mlen_; \
+ opt[pos].off = offset_; \
+ opt[pos].litlen = litlen_; \
+ opt[pos].price = price_; \
+ }
+
+
+/* function safe only for comparisons */
+MEM_STATIC U32 ZSTD_readMINMATCH(const void* memPtr, U32 length)
+{
+ switch (length)
+ {
+ default :
+ case 4 : return MEM_read32(memPtr);
+ case 3 : if (MEM_isLittleEndian())
+ return MEM_read32(memPtr)<<8;
+ else
+ return MEM_read32(memPtr)>>8;
+ }
+}
+
+
+/* Update hashTable3 up to ip (excluded)
+ Assumption : always within prefix (i.e. not within extDict) */
+FORCE_INLINE
+U32 ZSTD_insertAndFindFirstIndexHash3 (ZSTD_CCtx* zc, const BYTE* ip)
+{
+ U32* const hashTable3 = zc->hashTable3;
+ U32 const hashLog3 = zc->hashLog3;
+ const BYTE* const base = zc->base;
+ U32 idx = zc->nextToUpdate3;
+ const U32 target = zc->nextToUpdate3 = (U32)(ip - base);
+ const size_t hash3 = ZSTD_hash3Ptr(ip, hashLog3);
+
+ while(idx < target) {
+ hashTable3[ZSTD_hash3Ptr(base+idx, hashLog3)] = idx;
+ idx++;
+ }
+
+ return hashTable3[hash3];
+}
+
+
+/*-*************************************
+* Binary Tree search
+***************************************/
+static U32 ZSTD_insertBtAndGetAllMatches (
+ ZSTD_CCtx* zc,
+ const BYTE* const ip, const BYTE* const iLimit,
+ U32 nbCompares, const U32 mls,
+ U32 extDict, ZSTD_match_t* matches, const U32 minMatchLen)
+{
+ const BYTE* const base = zc->base;
+ const U32 current = (U32)(ip-base);
+ const U32 hashLog = zc->appliedParams.cParams.hashLog;
+ const size_t h = ZSTD_hashPtr(ip, hashLog, mls);
+ U32* const hashTable = zc->hashTable;
+ U32 matchIndex = hashTable[h];
+ U32* const bt = zc->chainTable;
+ const U32 btLog = zc->appliedParams.cParams.chainLog - 1;
+ const U32 btMask= (1U << btLog) - 1;
+ size_t commonLengthSmaller=0, commonLengthLarger=0;
+ const BYTE* const dictBase = zc->dictBase;
+ const U32 dictLimit = zc->dictLimit;
+ const BYTE* const dictEnd = dictBase + dictLimit;
+ const BYTE* const prefixStart = base + dictLimit;
+ const U32 btLow = btMask >= current ? 0 : current - btMask;
+ const U32 windowLow = zc->lowLimit;
+ U32* smallerPtr = bt + 2*(current&btMask);
+ U32* largerPtr = bt + 2*(current&btMask) + 1;
+ U32 matchEndIdx = current+8;
+ U32 dummy32; /* to be nullified at the end */
+ U32 mnum = 0;
+
+ const U32 minMatch = (mls == 3) ? 3 : 4;
+ size_t bestLength = minMatchLen-1;
+
+ if (minMatch == 3) { /* HC3 match finder */
+ U32 const matchIndex3 = ZSTD_insertAndFindFirstIndexHash3 (zc, ip);
+ if (matchIndex3>windowLow && (current - matchIndex3 < (1<<18))) {
+ const BYTE* match;
+ size_t currentMl=0;
+ if ((!extDict) || matchIndex3 >= dictLimit) {
+ match = base + matchIndex3;
+ if (match[bestLength] == ip[bestLength]) currentMl = ZSTD_count(ip, match, iLimit);
+ } else {
+ match = dictBase + matchIndex3;
+ if (ZSTD_readMINMATCH(match, MINMATCH) == ZSTD_readMINMATCH(ip, MINMATCH)) /* assumption : matchIndex3 <= dictLimit-4 (by table construction) */
+ currentMl = ZSTD_count_2segments(ip+MINMATCH, match+MINMATCH, iLimit, dictEnd, prefixStart) + MINMATCH;
+ }
+
+ /* save best solution */
+ if (currentMl > bestLength) {
+ bestLength = currentMl;
+ matches[mnum].off = ZSTD_REP_MOVE_OPT + current - matchIndex3;
+ matches[mnum].len = (U32)currentMl;
+ mnum++;
+ if (currentMl > ZSTD_OPT_NUM) goto update;
+ if (ip+currentMl == iLimit) goto update; /* best possible, and avoid read overflow*/
+ }
+ }
+ }
+
+ hashTable[h] = current; /* Update Hash Table */
+
+ while (nbCompares-- && (matchIndex > windowLow)) {
+ U32* nextPtr = bt + 2*(matchIndex & btMask);
+ size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */
+ const BYTE* match;
+
+ if ((!extDict) || (matchIndex+matchLength >= dictLimit)) {
+ match = base + matchIndex;
+ if (match[matchLength] == ip[matchLength]) {
+ matchLength += ZSTD_count(ip+matchLength+1, match+matchLength+1, iLimit) +1;
+ }
+ } else {
+ match = dictBase + matchIndex;
+ matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iLimit, dictEnd, prefixStart);
+ if (matchIndex+matchLength >= dictLimit)
+ match = base + matchIndex; /* to prepare for next usage of match[matchLength] */
+ }
+
+ if (matchLength > bestLength) {
+ if (matchLength > matchEndIdx - matchIndex) matchEndIdx = matchIndex + (U32)matchLength;
+ bestLength = matchLength;
+ matches[mnum].off = ZSTD_REP_MOVE_OPT + current - matchIndex;
+ matches[mnum].len = (U32)matchLength;
+ mnum++;
+ if (matchLength > ZSTD_OPT_NUM) break;
+ if (ip+matchLength == iLimit) /* equal : no way to know if inf or sup */
+ break; /* drop, to guarantee consistency (miss a little bit of compression) */
+ }
+
+ if (match[matchLength] < ip[matchLength]) {
+ /* match is smaller than current */
+ *smallerPtr = matchIndex; /* update smaller idx */
+ commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */
+ if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop the search */
+ smallerPtr = nextPtr+1; /* new "smaller" => larger of match */
+ matchIndex = nextPtr[1]; /* new matchIndex larger than previous (closer to current) */
+ } else {
+ /* match is larger than current */
+ *largerPtr = matchIndex;
+ commonLengthLarger = matchLength;
+ if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop the search */
+ largerPtr = nextPtr;
+ matchIndex = nextPtr[0];
+ } }
+
+ *smallerPtr = *largerPtr = 0;
+
+update:
+ zc->nextToUpdate = (matchEndIdx > current + 8) ? matchEndIdx - 8 : current+1;
+ return mnum;
+}
+
+
+/** Tree updater, providing best match */
+static U32 ZSTD_BtGetAllMatches (
+ ZSTD_CCtx* zc,
+ const BYTE* const ip, const BYTE* const iLimit,
+ const U32 maxNbAttempts, const U32 mls, ZSTD_match_t* matches, const U32 minMatchLen)
+{
+ if (ip < zc->base + zc->nextToUpdate) return 0; /* skipped area */
+ ZSTD_updateTree(zc, ip, iLimit, maxNbAttempts, mls);
+ return ZSTD_insertBtAndGetAllMatches(zc, ip, iLimit, maxNbAttempts, mls, 0, matches, minMatchLen);
+}
+
+
+static U32 ZSTD_BtGetAllMatches_selectMLS (
+ ZSTD_CCtx* zc, /* Index table will be updated */
+ const BYTE* ip, const BYTE* const iHighLimit,
+ const U32 maxNbAttempts, const U32 matchLengthSearch, ZSTD_match_t* matches, const U32 minMatchLen)
+{
+ switch(matchLengthSearch)
+ {
+ case 3 : return ZSTD_BtGetAllMatches(zc, ip, iHighLimit, maxNbAttempts, 3, matches, minMatchLen);
+ default :
+ case 4 : return ZSTD_BtGetAllMatches(zc, ip, iHighLimit, maxNbAttempts, 4, matches, minMatchLen);
+ case 5 : return ZSTD_BtGetAllMatches(zc, ip, iHighLimit, maxNbAttempts, 5, matches, minMatchLen);
+ case 7 :
+ case 6 : return ZSTD_BtGetAllMatches(zc, ip, iHighLimit, maxNbAttempts, 6, matches, minMatchLen);
+ }
+}
+
+/** Tree updater, providing best match */
+static U32 ZSTD_BtGetAllMatches_extDict (
+ ZSTD_CCtx* zc,
+ const BYTE* const ip, const BYTE* const iLimit,
+ const U32 maxNbAttempts, const U32 mls, ZSTD_match_t* matches, const U32 minMatchLen)
+{
+ if (ip < zc->base + zc->nextToUpdate) return 0; /* skipped area */
+ ZSTD_updateTree_extDict(zc, ip, iLimit, maxNbAttempts, mls);
+ return ZSTD_insertBtAndGetAllMatches(zc, ip, iLimit, maxNbAttempts, mls, 1, matches, minMatchLen);
+}
+
+
+static U32 ZSTD_BtGetAllMatches_selectMLS_extDict (
+ ZSTD_CCtx* zc, /* Index table will be updated */
+ const BYTE* ip, const BYTE* const iHighLimit,
+ const U32 maxNbAttempts, const U32 matchLengthSearch, ZSTD_match_t* matches, const U32 minMatchLen)
+{
+ switch(matchLengthSearch)
+ {
+ case 3 : return ZSTD_BtGetAllMatches_extDict(zc, ip, iHighLimit, maxNbAttempts, 3, matches, minMatchLen);
+ default :
+ case 4 : return ZSTD_BtGetAllMatches_extDict(zc, ip, iHighLimit, maxNbAttempts, 4, matches, minMatchLen);
+ case 5 : return ZSTD_BtGetAllMatches_extDict(zc, ip, iHighLimit, maxNbAttempts, 5, matches, minMatchLen);
+ case 7 :
+ case 6 : return ZSTD_BtGetAllMatches_extDict(zc, ip, iHighLimit, maxNbAttempts, 6, matches, minMatchLen);
+ }
+}
+
+
+/*-*******************************
+* Optimal parser
+*********************************/
+FORCE_INLINE
+void ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx,
+ const void* src, size_t srcSize, const int ultra)
+{
+ seqStore_t* seqStorePtr = &(ctx->seqStore);
+ const BYTE* const istart = (const BYTE*)src;
+ const BYTE* ip = istart;
+ const BYTE* anchor = istart;
+ const BYTE* const iend = istart + srcSize;
+ const BYTE* const ilimit = iend - 8;
+ const BYTE* const base = ctx->base;
+ const BYTE* const prefixStart = base + ctx->dictLimit;
+
+ const U32 maxSearches = 1U << ctx->appliedParams.cParams.searchLog;
+ const U32 sufficient_len = ctx->appliedParams.cParams.targetLength;
+ const U32 mls = ctx->appliedParams.cParams.searchLength;
+ const U32 minMatch = (ctx->appliedParams.cParams.searchLength == 3) ? 3 : 4;
+
+ ZSTD_optimal_t* opt = seqStorePtr->priceTable;
+ ZSTD_match_t* matches = seqStorePtr->matchTable;
+ const BYTE* inr;
+ U32 offset, rep[ZSTD_REP_NUM];
+
+ /* init */
+ ctx->nextToUpdate3 = ctx->nextToUpdate;
+ ZSTD_rescaleFreqs(seqStorePtr, (const BYTE*)src, srcSize);
+ ip += (ip==prefixStart);
+ { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) rep[i]=ctx->rep[i]; }
+
+ /* Match Loop */
+ while (ip < ilimit) {
+ U32 cur, match_num, last_pos, litlen, price;
+ U32 u, mlen, best_mlen, best_off, litLength;
+ memset(opt, 0, sizeof(ZSTD_optimal_t));
+ last_pos = 0;
+ litlen = (U32)(ip - anchor);
+
+ /* check repCode */
+ { U32 i, last_i = ZSTD_REP_CHECK + (ip==anchor);
+ for (i=(ip == anchor); i<last_i; i++) {
+ const S32 repCur = (i==ZSTD_REP_MOVE_OPT) ? (rep[0] - 1) : rep[i];
+ if ( (repCur > 0) && (repCur < (S32)(ip-prefixStart))
+ && (ZSTD_readMINMATCH(ip, minMatch) == ZSTD_readMINMATCH(ip - repCur, minMatch))) {
+ mlen = (U32)ZSTD_count(ip+minMatch, ip+minMatch-repCur, iend) + minMatch;
+ if (mlen > sufficient_len || mlen >= ZSTD_OPT_NUM) {
+ best_mlen = mlen; best_off = i; cur = 0; last_pos = 1;
+ goto _storeSequence;
+ }
+ best_off = i - (ip == anchor);
+ do {
+ price = ZSTD_getPrice(seqStorePtr, litlen, anchor, best_off, mlen - MINMATCH, ultra);
+ if (mlen > last_pos || price < opt[mlen].price)
+ SET_PRICE(mlen, mlen, i, litlen, price); /* note : macro modifies last_pos */
+ mlen--;
+ } while (mlen >= minMatch);
+ } } }
+
+ match_num = ZSTD_BtGetAllMatches_selectMLS(ctx, ip, iend, maxSearches, mls, matches, minMatch);
+
+ if (!last_pos && !match_num) { ip++; continue; }
+
+ if (match_num && (matches[match_num-1].len > sufficient_len || matches[match_num-1].len >= ZSTD_OPT_NUM)) {
+ best_mlen = matches[match_num-1].len;
+ best_off = matches[match_num-1].off;
+ cur = 0;
+ last_pos = 1;
+ goto _storeSequence;
+ }
+
+ /* set prices using matches at position = 0 */
+ best_mlen = (last_pos) ? last_pos : minMatch;
+ for (u = 0; u < match_num; u++) {
+ mlen = (u>0) ? matches[u-1].len+1 : best_mlen;
+ best_mlen = matches[u].len;
+ while (mlen <= best_mlen) {
+ price = ZSTD_getPrice(seqStorePtr, litlen, anchor, matches[u].off-1, mlen - MINMATCH, ultra);
+ if (mlen > last_pos || price < opt[mlen].price)
+ SET_PRICE(mlen, mlen, matches[u].off, litlen, price); /* note : macro modifies last_pos */
+ mlen++;
+ } }
+
+ if (last_pos < minMatch) { ip++; continue; }
+
+ /* initialize opt[0] */
+ { U32 i ; for (i=0; i<ZSTD_REP_NUM; i++) opt[0].rep[i] = rep[i]; }
+ opt[0].mlen = 1;
+ opt[0].litlen = litlen;
+
+ /* check further positions */
+ for (cur = 1; cur <= last_pos; cur++) {
+ inr = ip + cur;
+
+ if (opt[cur-1].mlen == 1) {
+ litlen = opt[cur-1].litlen + 1;
+ if (cur > litlen) {
+ price = opt[cur - litlen].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr-litlen);
+ } else
+ price = ZSTD_getLiteralPrice(seqStorePtr, litlen, anchor);
+ } else {
+ litlen = 1;
+ price = opt[cur - 1].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr-1);
+ }
+
+ if (cur > last_pos || price <= opt[cur].price)
+ SET_PRICE(cur, 1, 0, litlen, price);
+
+ if (cur == last_pos) break;
+
+ if (inr > ilimit) /* last match must start at a minimum distance of 8 from oend */
+ continue;
+
+ mlen = opt[cur].mlen;
+ if (opt[cur].off > ZSTD_REP_MOVE_OPT) {
+ opt[cur].rep[2] = opt[cur-mlen].rep[1];
+ opt[cur].rep[1] = opt[cur-mlen].rep[0];
+ opt[cur].rep[0] = opt[cur].off - ZSTD_REP_MOVE_OPT;
+ } else {
+ opt[cur].rep[2] = (opt[cur].off > 1) ? opt[cur-mlen].rep[1] : opt[cur-mlen].rep[2];
+ opt[cur].rep[1] = (opt[cur].off > 0) ? opt[cur-mlen].rep[0] : opt[cur-mlen].rep[1];
+ opt[cur].rep[0] = ((opt[cur].off==ZSTD_REP_MOVE_OPT) && (mlen != 1)) ? (opt[cur-mlen].rep[0] - 1) : (opt[cur-mlen].rep[opt[cur].off]);
+ }
+
+ best_mlen = minMatch;
+ { U32 i, last_i = ZSTD_REP_CHECK + (mlen != 1);
+ for (i=(opt[cur].mlen != 1); i<last_i; i++) { /* check rep */
+ const S32 repCur = (i==ZSTD_REP_MOVE_OPT) ? (opt[cur].rep[0] - 1) : opt[cur].rep[i];
+ if ( (repCur > 0) && (repCur < (S32)(inr-prefixStart))
+ && (ZSTD_readMINMATCH(inr, minMatch) == ZSTD_readMINMATCH(inr - repCur, minMatch))) {
+ mlen = (U32)ZSTD_count(inr+minMatch, inr+minMatch - repCur, iend) + minMatch;
+
+ if (mlen > sufficient_len || cur + mlen >= ZSTD_OPT_NUM) {
+ best_mlen = mlen; best_off = i; last_pos = cur + 1;
+ goto _storeSequence;
+ }
+
+ best_off = i - (opt[cur].mlen != 1);
+ if (mlen > best_mlen) best_mlen = mlen;
+
+ do {
+ if (opt[cur].mlen == 1) {
+ litlen = opt[cur].litlen;
+ if (cur > litlen) {
+ price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, inr-litlen, best_off, mlen - MINMATCH, ultra);
+ } else
+ price = ZSTD_getPrice(seqStorePtr, litlen, anchor, best_off, mlen - MINMATCH, ultra);
+ } else {
+ litlen = 0;
+ price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, best_off, mlen - MINMATCH, ultra);
+ }
+
+ if (cur + mlen > last_pos || price <= opt[cur + mlen].price)
+ SET_PRICE(cur + mlen, mlen, i, litlen, price);
+ mlen--;
+ } while (mlen >= minMatch);
+ } } }
+
+ match_num = ZSTD_BtGetAllMatches_selectMLS(ctx, inr, iend, maxSearches, mls, matches, best_mlen);
+
+ if (match_num > 0 && (matches[match_num-1].len > sufficient_len || cur + matches[match_num-1].len >= ZSTD_OPT_NUM)) {
+ best_mlen = matches[match_num-1].len;
+ best_off = matches[match_num-1].off;
+ last_pos = cur + 1;
+ goto _storeSequence;
+ }
+
+ /* set prices using matches at position = cur */
+ for (u = 0; u < match_num; u++) {
+ mlen = (u>0) ? matches[u-1].len+1 : best_mlen;
+ best_mlen = matches[u].len;
+
+ while (mlen <= best_mlen) {
+ if (opt[cur].mlen == 1) {
+ litlen = opt[cur].litlen;
+ if (cur > litlen)
+ price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, ip+cur-litlen, matches[u].off-1, mlen - MINMATCH, ultra);
+ else
+ price = ZSTD_getPrice(seqStorePtr, litlen, anchor, matches[u].off-1, mlen - MINMATCH, ultra);
+ } else {
+ litlen = 0;
+ price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, matches[u].off-1, mlen - MINMATCH, ultra);
+ }
+
+ if (cur + mlen > last_pos || (price < opt[cur + mlen].price))
+ SET_PRICE(cur + mlen, mlen, matches[u].off, litlen, price);
+
+ mlen++;
+ } } }
+
+ best_mlen = opt[last_pos].mlen;
+ best_off = opt[last_pos].off;
+ cur = last_pos - best_mlen;
+
+ /* store sequence */
+_storeSequence: /* cur, last_pos, best_mlen, best_off have to be set */
+ opt[0].mlen = 1;
+
+ while (1) {
+ mlen = opt[cur].mlen;
+ offset = opt[cur].off;
+ opt[cur].mlen = best_mlen;
+ opt[cur].off = best_off;
+ best_mlen = mlen;
+ best_off = offset;
+ if (mlen > cur) break;
+ cur -= mlen;
+ }
+
+ for (u = 0; u <= last_pos;) {
+ u += opt[u].mlen;
+ }
+
+ for (cur=0; cur < last_pos; ) {
+ mlen = opt[cur].mlen;
+ if (mlen == 1) { ip++; cur++; continue; }
+ offset = opt[cur].off;
+ cur += mlen;
+ litLength = (U32)(ip - anchor);
+
+ if (offset > ZSTD_REP_MOVE_OPT) {
+ rep[2] = rep[1];
+ rep[1] = rep[0];
+ rep[0] = offset - ZSTD_REP_MOVE_OPT;
+ offset--;
+ } else {
+ if (offset != 0) {
+ best_off = (offset==ZSTD_REP_MOVE_OPT) ? (rep[0] - 1) : (rep[offset]);
+ if (offset != 1) rep[2] = rep[1];
+ rep[1] = rep[0];
+ rep[0] = best_off;
+ }
+ if (litLength==0) offset--;
+ }
+
+ ZSTD_updatePrice(seqStorePtr, litLength, anchor, offset, mlen-MINMATCH);
+ ZSTD_storeSeq(seqStorePtr, litLength, anchor, offset, mlen-MINMATCH);
+ anchor = ip = ip + mlen;
+ } } /* for (cur=0; cur < last_pos; ) */
+
+ /* Save reps for next block */
+ { int i; for (i=0; i<ZSTD_REP_NUM; i++) ctx->repToConfirm[i] = rep[i]; }
+
+ /* Last Literals */
+ { size_t const lastLLSize = iend - anchor;
+ memcpy(seqStorePtr->lit, anchor, lastLLSize);
+ seqStorePtr->lit += lastLLSize;
+ }
+}
+
+
+FORCE_INLINE
+void ZSTD_compressBlock_opt_extDict_generic(ZSTD_CCtx* ctx,
+ const void* src, size_t srcSize, const int ultra)
+{
+ seqStore_t* seqStorePtr = &(ctx->seqStore);
+ const BYTE* const istart = (const BYTE*)src;
+ const BYTE* ip = istart;
+ const BYTE* anchor = istart;
+ const BYTE* const iend = istart + srcSize;
+ const BYTE* const ilimit = iend - 8;
+ const BYTE* const base = ctx->base;
+ const U32 lowestIndex = ctx->lowLimit;
+ const U32 dictLimit = ctx->dictLimit;
+ const BYTE* const prefixStart = base + dictLimit;
+ const BYTE* const dictBase = ctx->dictBase;
+ const BYTE* const dictEnd = dictBase + dictLimit;
+
+ const U32 maxSearches = 1U << ctx->appliedParams.cParams.searchLog;
+ const U32 sufficient_len = ctx->appliedParams.cParams.targetLength;
+ const U32 mls = ctx->appliedParams.cParams.searchLength;
+ const U32 minMatch = (ctx->appliedParams.cParams.searchLength == 3) ? 3 : 4;
+
+ ZSTD_optimal_t* opt = seqStorePtr->priceTable;
+ ZSTD_match_t* matches = seqStorePtr->matchTable;
+ const BYTE* inr;
+
+ /* init */
+ U32 offset, rep[ZSTD_REP_NUM];
+ { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) rep[i]=ctx->rep[i]; }
+
+ ctx->nextToUpdate3 = ctx->nextToUpdate;
+ ZSTD_rescaleFreqs(seqStorePtr, (const BYTE*)src, srcSize);
+ ip += (ip==prefixStart);
+
+ /* Match Loop */
+ while (ip < ilimit) {
+ U32 cur, match_num, last_pos, litlen, price;
+ U32 u, mlen, best_mlen, best_off, litLength;
+ U32 current = (U32)(ip-base);
+ memset(opt, 0, sizeof(ZSTD_optimal_t));
+ last_pos = 0;
+ opt[0].litlen = (U32)(ip - anchor);
+
+ /* check repCode */
+ { U32 i, last_i = ZSTD_REP_CHECK + (ip==anchor);
+ for (i = (ip==anchor); i<last_i; i++) {
+ const S32 repCur = (i==ZSTD_REP_MOVE_OPT) ? (rep[0] - 1) : rep[i];
+ const U32 repIndex = (U32)(current - repCur);
+ const BYTE* const repBase = repIndex < dictLimit ? dictBase : base;
+ const BYTE* const repMatch = repBase + repIndex;
+ if ( (repCur > 0 && repCur <= (S32)current)
+ && (((U32)((dictLimit-1) - repIndex) >= 3) & (repIndex>lowestIndex)) /* intentional overflow */
+ && (ZSTD_readMINMATCH(ip, minMatch) == ZSTD_readMINMATCH(repMatch, minMatch)) ) {
+ /* repcode detected we should take it */
+ const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend;
+ mlen = (U32)ZSTD_count_2segments(ip+minMatch, repMatch+minMatch, iend, repEnd, prefixStart) + minMatch;
+
+ if (mlen > sufficient_len || mlen >= ZSTD_OPT_NUM) {
+ best_mlen = mlen; best_off = i; cur = 0; last_pos = 1;
+ goto _storeSequence;
+ }
+
+ best_off = i - (ip==anchor);
+ litlen = opt[0].litlen;
+ do {
+ price = ZSTD_getPrice(seqStorePtr, litlen, anchor, best_off, mlen - MINMATCH, ultra);
+ if (mlen > last_pos || price < opt[mlen].price)
+ SET_PRICE(mlen, mlen, i, litlen, price); /* note : macro modifies last_pos */
+ mlen--;
+ } while (mlen >= minMatch);
+ } } }
+
+ match_num = ZSTD_BtGetAllMatches_selectMLS_extDict(ctx, ip, iend, maxSearches, mls, matches, minMatch); /* first search (depth 0) */
+
+ if (!last_pos && !match_num) { ip++; continue; }
+
+ { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) opt[0].rep[i] = rep[i]; }
+ opt[0].mlen = 1;
+
+ if (match_num && (matches[match_num-1].len > sufficient_len || matches[match_num-1].len >= ZSTD_OPT_NUM)) {
+ best_mlen = matches[match_num-1].len;
+ best_off = matches[match_num-1].off;
+ cur = 0;
+ last_pos = 1;
+ goto _storeSequence;
+ }
+
+ best_mlen = (last_pos) ? last_pos : minMatch;
+
+ /* set prices using matches at position = 0 */
+ for (u = 0; u < match_num; u++) {
+ mlen = (u>0) ? matches[u-1].len+1 : best_mlen;
+ best_mlen = matches[u].len;
+ litlen = opt[0].litlen;
+ while (mlen <= best_mlen) {
+ price = ZSTD_getPrice(seqStorePtr, litlen, anchor, matches[u].off-1, mlen - MINMATCH, ultra);
+ if (mlen > last_pos || price < opt[mlen].price)
+ SET_PRICE(mlen, mlen, matches[u].off, litlen, price);
+ mlen++;
+ } }
+
+ if (last_pos < minMatch) {
+ ip++; continue;
+ }
+
+ /* check further positions */
+ for (cur = 1; cur <= last_pos; cur++) {
+ inr = ip + cur;
+
+ if (opt[cur-1].mlen == 1) {
+ litlen = opt[cur-1].litlen + 1;
+ if (cur > litlen) {
+ price = opt[cur - litlen].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr-litlen);
+ } else
+ price = ZSTD_getLiteralPrice(seqStorePtr, litlen, anchor);
+ } else {
+ litlen = 1;
+ price = opt[cur - 1].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr-1);
+ }
+
+ if (cur > last_pos || price <= opt[cur].price)
+ SET_PRICE(cur, 1, 0, litlen, price);
+
+ if (cur == last_pos) break;
+
+ if (inr > ilimit) /* last match must start at a minimum distance of 8 from oend */
+ continue;
+
+ mlen = opt[cur].mlen;
+ if (opt[cur].off > ZSTD_REP_MOVE_OPT) {
+ opt[cur].rep[2] = opt[cur-mlen].rep[1];
+ opt[cur].rep[1] = opt[cur-mlen].rep[0];
+ opt[cur].rep[0] = opt[cur].off - ZSTD_REP_MOVE_OPT;
+ } else {
+ opt[cur].rep[2] = (opt[cur].off > 1) ? opt[cur-mlen].rep[1] : opt[cur-mlen].rep[2];
+ opt[cur].rep[1] = (opt[cur].off > 0) ? opt[cur-mlen].rep[0] : opt[cur-mlen].rep[1];
+ opt[cur].rep[0] = ((opt[cur].off==ZSTD_REP_MOVE_OPT) && (mlen != 1)) ? (opt[cur-mlen].rep[0] - 1) : (opt[cur-mlen].rep[opt[cur].off]);
+ }
+
+ best_mlen = minMatch;
+ { U32 i, last_i = ZSTD_REP_CHECK + (mlen != 1);
+ for (i = (mlen != 1); i<last_i; i++) {
+ const S32 repCur = (i==ZSTD_REP_MOVE_OPT) ? (opt[cur].rep[0] - 1) : opt[cur].rep[i];
+ const U32 repIndex = (U32)(current+cur - repCur);
+ const BYTE* const repBase = repIndex < dictLimit ? dictBase : base;
+ const BYTE* const repMatch = repBase + repIndex;
+ if ( (repCur > 0 && repCur <= (S32)(current+cur))
+ && (((U32)((dictLimit-1) - repIndex) >= 3) & (repIndex>lowestIndex)) /* intentional overflow */
+ && (ZSTD_readMINMATCH(inr, minMatch) == ZSTD_readMINMATCH(repMatch, minMatch)) ) {
+ /* repcode detected */
+ const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend;
+ mlen = (U32)ZSTD_count_2segments(inr+minMatch, repMatch+minMatch, iend, repEnd, prefixStart) + minMatch;
+
+ if (mlen > sufficient_len || cur + mlen >= ZSTD_OPT_NUM) {
+ best_mlen = mlen; best_off = i; last_pos = cur + 1;
+ goto _storeSequence;
+ }
+
+ best_off = i - (opt[cur].mlen != 1);
+ if (mlen > best_mlen) best_mlen = mlen;
+
+ do {
+ if (opt[cur].mlen == 1) {
+ litlen = opt[cur].litlen;
+ if (cur > litlen) {
+ price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, inr-litlen, best_off, mlen - MINMATCH, ultra);
+ } else
+ price = ZSTD_getPrice(seqStorePtr, litlen, anchor, best_off, mlen - MINMATCH, ultra);
+ } else {
+ litlen = 0;
+ price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, best_off, mlen - MINMATCH, ultra);
+ }
+
+ if (cur + mlen > last_pos || price <= opt[cur + mlen].price)
+ SET_PRICE(cur + mlen, mlen, i, litlen, price);
+ mlen--;
+ } while (mlen >= minMatch);
+ } } }
+
+ match_num = ZSTD_BtGetAllMatches_selectMLS_extDict(ctx, inr, iend, maxSearches, mls, matches, minMatch);
+
+ if (match_num > 0 && (matches[match_num-1].len > sufficient_len || cur + matches[match_num-1].len >= ZSTD_OPT_NUM)) {
+ best_mlen = matches[match_num-1].len;
+ best_off = matches[match_num-1].off;
+ last_pos = cur + 1;
+ goto _storeSequence;
+ }
+
+ /* set prices using matches at position = cur */
+ for (u = 0; u < match_num; u++) {
+ mlen = (u>0) ? matches[u-1].len+1 : best_mlen;
+ best_mlen = matches[u].len;
+
+ while (mlen <= best_mlen) {
+ if (opt[cur].mlen == 1) {
+ litlen = opt[cur].litlen;
+ if (cur > litlen)
+ price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, ip+cur-litlen, matches[u].off-1, mlen - MINMATCH, ultra);
+ else
+ price = ZSTD_getPrice(seqStorePtr, litlen, anchor, matches[u].off-1, mlen - MINMATCH, ultra);
+ } else {
+ litlen = 0;
+ price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, matches[u].off-1, mlen - MINMATCH, ultra);
+ }
+
+ if (cur + mlen > last_pos || (price < opt[cur + mlen].price))
+ SET_PRICE(cur + mlen, mlen, matches[u].off, litlen, price);
+
+ mlen++;
+ } } } /* for (cur = 1; cur <= last_pos; cur++) */
+
+ best_mlen = opt[last_pos].mlen;
+ best_off = opt[last_pos].off;
+ cur = last_pos - best_mlen;
+
+ /* store sequence */
+_storeSequence: /* cur, last_pos, best_mlen, best_off have to be set */
+ opt[0].mlen = 1;
+
+ while (1) {
+ mlen = opt[cur].mlen;
+ offset = opt[cur].off;
+ opt[cur].mlen = best_mlen;
+ opt[cur].off = best_off;
+ best_mlen = mlen;
+ best_off = offset;
+ if (mlen > cur) break;
+ cur -= mlen;
+ }
+
+ for (u = 0; u <= last_pos; ) {
+ u += opt[u].mlen;
+ }
+
+ for (cur=0; cur < last_pos; ) {
+ mlen = opt[cur].mlen;
+ if (mlen == 1) { ip++; cur++; continue; }
+ offset = opt[cur].off;
+ cur += mlen;
+ litLength = (U32)(ip - anchor);
+
+ if (offset > ZSTD_REP_MOVE_OPT) {
+ rep[2] = rep[1];
+ rep[1] = rep[0];
+ rep[0] = offset - ZSTD_REP_MOVE_OPT;
+ offset--;
+ } else {
+ if (offset != 0) {
+ best_off = (offset==ZSTD_REP_MOVE_OPT) ? (rep[0] - 1) : (rep[offset]);
+ if (offset != 1) rep[2] = rep[1];
+ rep[1] = rep[0];
+ rep[0] = best_off;
+ }
+
+ if (litLength==0) offset--;
+ }
+
+ ZSTD_updatePrice(seqStorePtr, litLength, anchor, offset, mlen-MINMATCH);
+ ZSTD_storeSeq(seqStorePtr, litLength, anchor, offset, mlen-MINMATCH);
+ anchor = ip = ip + mlen;
+ } } /* for (cur=0; cur < last_pos; ) */
+
+ /* Save reps for next block */
+ { int i; for (i=0; i<ZSTD_REP_NUM; i++) ctx->repToConfirm[i] = rep[i]; }
+
+ /* Last Literals */
+ { size_t lastLLSize = iend - anchor;
+ memcpy(seqStorePtr->lit, anchor, lastLLSize);
+ seqStorePtr->lit += lastLLSize;
+ }
+}
+
+#endif /* ZSTD_OPT_H_91842398743 */
diff --git a/thirdparty/zstd/compress/zstdmt_compress.c b/thirdparty/zstd/compress/zstdmt_compress.c
new file mode 100644
index 0000000000..0cee01eacb
--- /dev/null
+++ b/thirdparty/zstd/compress/zstdmt_compress.c
@@ -0,0 +1,955 @@
+/**
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+
+/* ====== Tuning parameters ====== */
+#define ZSTDMT_NBTHREADS_MAX 128
+
+
+/* ====== Compiler specifics ====== */
+#if defined(_MSC_VER)
+# pragma warning(disable : 4204) /* disable: C4204: non-constant aggregate initializer */
+#endif
+
+
+/* ====== Dependencies ====== */
+#include <string.h> /* memcpy, memset */
+#include "pool.h" /* threadpool */
+#include "threading.h" /* mutex */
+#include "zstd_internal.h" /* MIN, ERROR, ZSTD_*, ZSTD_highbit32 */
+#include "zstdmt_compress.h"
+
+
+/* ====== Debug ====== */
+#if defined(ZSTD_DEBUG) && (ZSTD_DEBUG>=2)
+
+# include <stdio.h>
+# include <unistd.h>
+# include <sys/times.h>
+# define DEBUGLOGRAW(l, ...) if (l<=ZSTD_DEBUG) { fprintf(stderr, __VA_ARGS__); }
+
+# define DEBUG_PRINTHEX(l,p,n) { \
+ unsigned debug_u; \
+ for (debug_u=0; debug_u<(n); debug_u++) \
+ DEBUGLOGRAW(l, "%02X ", ((const unsigned char*)(p))[debug_u]); \
+ DEBUGLOGRAW(l, " \n"); \
+}
+
+static unsigned long long GetCurrentClockTimeMicroseconds(void)
+{
+ static clock_t _ticksPerSecond = 0;
+ if (_ticksPerSecond <= 0) _ticksPerSecond = sysconf(_SC_CLK_TCK);
+
+ { struct tms junk; clock_t newTicks = (clock_t) times(&junk);
+ return ((((unsigned long long)newTicks)*(1000000))/_ticksPerSecond); }
+}
+
+#define MUTEX_WAIT_TIME_DLEVEL 6
+#define PTHREAD_MUTEX_LOCK(mutex) { \
+ if (ZSTD_DEBUG>=MUTEX_WAIT_TIME_DLEVEL) { \
+ unsigned long long const beforeTime = GetCurrentClockTimeMicroseconds(); \
+ pthread_mutex_lock(mutex); \
+ { unsigned long long const afterTime = GetCurrentClockTimeMicroseconds(); \
+ unsigned long long const elapsedTime = (afterTime-beforeTime); \
+ if (elapsedTime > 1000) { /* or whatever threshold you like; I'm using 1 millisecond here */ \
+ DEBUGLOG(MUTEX_WAIT_TIME_DLEVEL, "Thread took %llu microseconds to acquire mutex %s \n", \
+ elapsedTime, #mutex); \
+ } } \
+ } else pthread_mutex_lock(mutex); \
+}
+
+#else
+
+# define PTHREAD_MUTEX_LOCK(m) pthread_mutex_lock(m)
+# define DEBUG_PRINTHEX(l,p,n) {}
+
+#endif
+
+
+/* ===== Buffer Pool ===== */
+
+typedef struct buffer_s {
+ void* start;
+ size_t size;
+} buffer_t;
+
+static const buffer_t g_nullBuffer = { NULL, 0 };
+
+typedef struct ZSTDMT_bufferPool_s {
+ unsigned totalBuffers;
+ unsigned nbBuffers;
+ ZSTD_customMem cMem;
+ buffer_t bTable[1]; /* variable size */
+} ZSTDMT_bufferPool;
+
+static ZSTDMT_bufferPool* ZSTDMT_createBufferPool(unsigned nbThreads, ZSTD_customMem cMem)
+{
+ unsigned const maxNbBuffers = 2*nbThreads + 2;
+ ZSTDMT_bufferPool* const bufPool = (ZSTDMT_bufferPool*)ZSTD_calloc(
+ sizeof(ZSTDMT_bufferPool) + (maxNbBuffers-1) * sizeof(buffer_t), cMem);
+ if (bufPool==NULL) return NULL;
+ bufPool->totalBuffers = maxNbBuffers;
+ bufPool->nbBuffers = 0;
+ bufPool->cMem = cMem;
+ return bufPool;
+}
+
+static void ZSTDMT_freeBufferPool(ZSTDMT_bufferPool* bufPool)
+{
+ unsigned u;
+ if (!bufPool) return; /* compatibility with free on NULL */
+ for (u=0; u<bufPool->totalBuffers; u++)
+ ZSTD_free(bufPool->bTable[u].start, bufPool->cMem);
+ ZSTD_free(bufPool, bufPool->cMem);
+}
+
+/* only works at initialization, not during compression */
+static size_t ZSTDMT_sizeof_bufferPool(ZSTDMT_bufferPool* bufPool)
+{
+ size_t const poolSize = sizeof(*bufPool)
+ + (bufPool->totalBuffers - 1) * sizeof(buffer_t);
+ unsigned u;
+ size_t totalBufferSize = 0;
+ for (u=0; u<bufPool->totalBuffers; u++)
+ totalBufferSize += bufPool->bTable[u].size;
+
+ return poolSize + totalBufferSize;
+}
+
+/** ZSTDMT_getBuffer() :
+ * assumption : invocation from main thread only ! */
+static buffer_t ZSTDMT_getBuffer(ZSTDMT_bufferPool* pool, size_t bSize)
+{
+ if (pool->nbBuffers) { /* try to use an existing buffer */
+ buffer_t const buf = pool->bTable[--(pool->nbBuffers)];
+ size_t const availBufferSize = buf.size;
+ if ((availBufferSize >= bSize) & (availBufferSize <= 10*bSize))
+ /* large enough, but not too much */
+ return buf;
+ /* size conditions not respected : scratch this buffer, create new one */
+ ZSTD_free(buf.start, pool->cMem);
+ }
+ /* create new buffer */
+ { buffer_t buffer;
+ void* const start = ZSTD_malloc(bSize, pool->cMem);
+ if (start==NULL) bSize = 0;
+ buffer.start = start; /* note : start can be NULL if malloc fails ! */
+ buffer.size = bSize;
+ return buffer;
+ }
+}
+
+/* store buffer for later re-use, up to pool capacity */
+static void ZSTDMT_releaseBuffer(ZSTDMT_bufferPool* pool, buffer_t buf)
+{
+ if (buf.start == NULL) return; /* release on NULL */
+ if (pool->nbBuffers < pool->totalBuffers) {
+ pool->bTable[pool->nbBuffers++] = buf; /* store for later re-use */
+ return;
+ }
+ /* Reached bufferPool capacity (should not happen) */
+ ZSTD_free(buf.start, pool->cMem);
+}
+
+
+/* ===== CCtx Pool ===== */
+
+typedef struct {
+ unsigned totalCCtx;
+ unsigned availCCtx;
+ ZSTD_customMem cMem;
+ ZSTD_CCtx* cctx[1]; /* variable size */
+} ZSTDMT_CCtxPool;
+
+/* assumption : CCtxPool invocation only from main thread */
+
+/* note : all CCtx borrowed from the pool should be released back to the pool _before_ freeing the pool */
+static void ZSTDMT_freeCCtxPool(ZSTDMT_CCtxPool* pool)
+{
+ unsigned u;
+ for (u=0; u<pool->totalCCtx; u++)
+ ZSTD_freeCCtx(pool->cctx[u]); /* note : compatible with free on NULL */
+ ZSTD_free(pool, pool->cMem);
+}
+
+/* ZSTDMT_createCCtxPool() :
+ * implies nbThreads >= 1 , checked by caller ZSTDMT_createCCtx() */
+static ZSTDMT_CCtxPool* ZSTDMT_createCCtxPool(unsigned nbThreads,
+ ZSTD_customMem cMem)
+{
+ ZSTDMT_CCtxPool* const cctxPool = (ZSTDMT_CCtxPool*) ZSTD_calloc(
+ sizeof(ZSTDMT_CCtxPool) + (nbThreads-1)*sizeof(ZSTD_CCtx*), cMem);
+ if (!cctxPool) return NULL;
+ cctxPool->cMem = cMem;
+ cctxPool->totalCCtx = nbThreads;
+ cctxPool->availCCtx = 1; /* at least one cctx for single-thread mode */
+ cctxPool->cctx[0] = ZSTD_createCCtx_advanced(cMem);
+ if (!cctxPool->cctx[0]) { ZSTDMT_freeCCtxPool(cctxPool); return NULL; }
+ DEBUGLOG(3, "cctxPool created, with %u threads", nbThreads);
+ return cctxPool;
+}
+
+/* only works during initialization phase, not during compression */
+static size_t ZSTDMT_sizeof_CCtxPool(ZSTDMT_CCtxPool* cctxPool)
+{
+ unsigned const nbThreads = cctxPool->totalCCtx;
+ size_t const poolSize = sizeof(*cctxPool)
+ + (nbThreads-1)*sizeof(ZSTD_CCtx*);
+ unsigned u;
+ size_t totalCCtxSize = 0;
+ for (u=0; u<nbThreads; u++)
+ totalCCtxSize += ZSTD_sizeof_CCtx(cctxPool->cctx[u]);
+
+ return poolSize + totalCCtxSize;
+}
+
+static ZSTD_CCtx* ZSTDMT_getCCtx(ZSTDMT_CCtxPool* pool)
+{
+ if (pool->availCCtx) {
+ pool->availCCtx--;
+ return pool->cctx[pool->availCCtx];
+ }
+ return ZSTD_createCCtx(); /* note : can be NULL, when creation fails ! */
+}
+
+static void ZSTDMT_releaseCCtx(ZSTDMT_CCtxPool* pool, ZSTD_CCtx* cctx)
+{
+ if (cctx==NULL) return; /* compatibility with release on NULL */
+ if (pool->availCCtx < pool->totalCCtx)
+ pool->cctx[pool->availCCtx++] = cctx;
+ else
+ /* pool overflow : should not happen, since totalCCtx==nbThreads */
+ ZSTD_freeCCtx(cctx);
+}
+
+
+/* ===== Thread worker ===== */
+
+typedef struct {
+ buffer_t buffer;
+ size_t filled;
+} inBuff_t;
+
+typedef struct {
+ ZSTD_CCtx* cctx;
+ buffer_t src;
+ const void* srcStart;
+ size_t srcSize;
+ size_t dictSize;
+ buffer_t dstBuff;
+ size_t cSize;
+ size_t dstFlushed;
+ unsigned firstChunk;
+ unsigned lastChunk;
+ unsigned jobCompleted;
+ unsigned jobScanned;
+ pthread_mutex_t* jobCompleted_mutex;
+ pthread_cond_t* jobCompleted_cond;
+ ZSTD_parameters params;
+ const ZSTD_CDict* cdict;
+ unsigned long long fullFrameSize;
+} ZSTDMT_jobDescription;
+
+/* ZSTDMT_compressChunk() : POOL_function type */
+void ZSTDMT_compressChunk(void* jobDescription)
+{
+ ZSTDMT_jobDescription* const job = (ZSTDMT_jobDescription*)jobDescription;
+ const void* const src = (const char*)job->srcStart + job->dictSize;
+ buffer_t const dstBuff = job->dstBuff;
+ DEBUGLOG(5, "job (first:%u) (last:%u) : dictSize %u, srcSize %u",
+ job->firstChunk, job->lastChunk, (U32)job->dictSize, (U32)job->srcSize);
+ if (job->cdict) { /* should only happen for first segment */
+ size_t const initError = ZSTD_compressBegin_usingCDict_advanced(job->cctx, job->cdict, job->params.fParams, job->fullFrameSize);
+ DEBUGLOG(5, "using CDict");
+ if (ZSTD_isError(initError)) { job->cSize = initError; goto _endJob; }
+ } else { /* srcStart points at reloaded section */
+ if (!job->firstChunk) job->params.fParams.contentSizeFlag = 0; /* ensure no srcSize control */
+ { size_t const dictModeError = ZSTD_setCCtxParameter(job->cctx, ZSTD_p_forceRawDict, 1); /* Force loading dictionary in "content-only" mode (no header analysis) */
+ size_t const initError = ZSTD_compressBegin_advanced(job->cctx, job->srcStart, job->dictSize, job->params, job->fullFrameSize);
+ if (ZSTD_isError(initError) || ZSTD_isError(dictModeError)) { job->cSize = initError; goto _endJob; }
+ ZSTD_setCCtxParameter(job->cctx, ZSTD_p_forceWindow, 1);
+ } }
+ if (!job->firstChunk) { /* flush and overwrite frame header when it's not first segment */
+ size_t const hSize = ZSTD_compressContinue(job->cctx, dstBuff.start, dstBuff.size, src, 0);
+ if (ZSTD_isError(hSize)) { job->cSize = hSize; goto _endJob; }
+ ZSTD_invalidateRepCodes(job->cctx);
+ }
+
+ DEBUGLOG(5, "Compressing : ");
+ DEBUG_PRINTHEX(4, job->srcStart, 12);
+ job->cSize = (job->lastChunk) ?
+ ZSTD_compressEnd (job->cctx, dstBuff.start, dstBuff.size, src, job->srcSize) :
+ ZSTD_compressContinue(job->cctx, dstBuff.start, dstBuff.size, src, job->srcSize);
+ DEBUGLOG(5, "compressed %u bytes into %u bytes (first:%u) (last:%u)",
+ (unsigned)job->srcSize, (unsigned)job->cSize, job->firstChunk, job->lastChunk);
+ DEBUGLOG(5, "dstBuff.size : %u ; => %s", (U32)dstBuff.size, ZSTD_getErrorName(job->cSize));
+
+_endJob:
+ PTHREAD_MUTEX_LOCK(job->jobCompleted_mutex);
+ job->jobCompleted = 1;
+ job->jobScanned = 0;
+ pthread_cond_signal(job->jobCompleted_cond);
+ pthread_mutex_unlock(job->jobCompleted_mutex);
+}
+
+
+/* ------------------------------------------ */
+/* ===== Multi-threaded compression ===== */
+/* ------------------------------------------ */
+
+struct ZSTDMT_CCtx_s {
+ POOL_ctx* factory;
+ ZSTDMT_jobDescription* jobs;
+ ZSTDMT_bufferPool* buffPool;
+ ZSTDMT_CCtxPool* cctxPool;
+ pthread_mutex_t jobCompleted_mutex;
+ pthread_cond_t jobCompleted_cond;
+ size_t targetSectionSize;
+ size_t marginSize;
+ size_t inBuffSize;
+ size_t dictSize;
+ size_t targetDictSize;
+ inBuff_t inBuff;
+ ZSTD_parameters params;
+ XXH64_state_t xxhState;
+ unsigned nbThreads;
+ unsigned jobIDMask;
+ unsigned doneJobID;
+ unsigned nextJobID;
+ unsigned frameEnded;
+ unsigned allJobsCompleted;
+ unsigned overlapRLog;
+ unsigned long long frameContentSize;
+ size_t sectionSize;
+ ZSTD_customMem cMem;
+ ZSTD_CDict* cdictLocal;
+ const ZSTD_CDict* cdict;
+};
+
+static ZSTDMT_jobDescription* ZSTDMT_allocJobsTable(U32* nbJobsPtr, ZSTD_customMem cMem)
+{
+ U32 const nbJobsLog2 = ZSTD_highbit32(*nbJobsPtr) + 1;
+ U32 const nbJobs = 1 << nbJobsLog2;
+ *nbJobsPtr = nbJobs;
+ return (ZSTDMT_jobDescription*) ZSTD_calloc(
+ nbJobs * sizeof(ZSTDMT_jobDescription), cMem);
+}
+
+ZSTDMT_CCtx* ZSTDMT_createCCtx_advanced(unsigned nbThreads, ZSTD_customMem cMem)
+{
+ ZSTDMT_CCtx* mtctx;
+ U32 nbJobs = nbThreads + 2;
+ DEBUGLOG(3, "ZSTDMT_createCCtx_advanced");
+
+ if ((nbThreads < 1) | (nbThreads > ZSTDMT_NBTHREADS_MAX)) return NULL;
+ if ((cMem.customAlloc!=NULL) ^ (cMem.customFree!=NULL))
+ /* invalid custom allocator */
+ return NULL;
+
+ mtctx = (ZSTDMT_CCtx*) ZSTD_calloc(sizeof(ZSTDMT_CCtx), cMem);
+ if (!mtctx) return NULL;
+ mtctx->cMem = cMem;
+ mtctx->nbThreads = nbThreads;
+ mtctx->allJobsCompleted = 1;
+ mtctx->sectionSize = 0;
+ mtctx->overlapRLog = 3;
+ mtctx->factory = POOL_create(nbThreads, 1);
+ mtctx->jobs = ZSTDMT_allocJobsTable(&nbJobs, cMem);
+ mtctx->jobIDMask = nbJobs - 1;
+ mtctx->buffPool = ZSTDMT_createBufferPool(nbThreads, cMem);
+ mtctx->cctxPool = ZSTDMT_createCCtxPool(nbThreads, cMem);
+ if (!mtctx->factory | !mtctx->jobs | !mtctx->buffPool | !mtctx->cctxPool) {
+ ZSTDMT_freeCCtx(mtctx);
+ return NULL;
+ }
+ pthread_mutex_init(&mtctx->jobCompleted_mutex, NULL); /* Todo : check init function return */
+ pthread_cond_init(&mtctx->jobCompleted_cond, NULL);
+ DEBUGLOG(3, "mt_cctx created, for %u threads", nbThreads);
+ return mtctx;
+}
+
+ZSTDMT_CCtx* ZSTDMT_createCCtx(unsigned nbThreads)
+{
+ return ZSTDMT_createCCtx_advanced(nbThreads, ZSTD_defaultCMem);
+}
+
+/* ZSTDMT_releaseAllJobResources() :
+ * note : ensure all workers are killed first ! */
+static void ZSTDMT_releaseAllJobResources(ZSTDMT_CCtx* mtctx)
+{
+ unsigned jobID;
+ DEBUGLOG(3, "ZSTDMT_releaseAllJobResources");
+ for (jobID=0; jobID <= mtctx->jobIDMask; jobID++) {
+ ZSTDMT_releaseBuffer(mtctx->buffPool, mtctx->jobs[jobID].dstBuff);
+ mtctx->jobs[jobID].dstBuff = g_nullBuffer;
+ ZSTDMT_releaseBuffer(mtctx->buffPool, mtctx->jobs[jobID].src);
+ mtctx->jobs[jobID].src = g_nullBuffer;
+ ZSTDMT_releaseCCtx(mtctx->cctxPool, mtctx->jobs[jobID].cctx);
+ mtctx->jobs[jobID].cctx = NULL;
+ }
+ memset(mtctx->jobs, 0, (mtctx->jobIDMask+1)*sizeof(ZSTDMT_jobDescription));
+ ZSTDMT_releaseBuffer(mtctx->buffPool, mtctx->inBuff.buffer);
+ mtctx->inBuff.buffer = g_nullBuffer;
+ mtctx->allJobsCompleted = 1;
+}
+
+size_t ZSTDMT_freeCCtx(ZSTDMT_CCtx* mtctx)
+{
+ if (mtctx==NULL) return 0; /* compatible with free on NULL */
+ POOL_free(mtctx->factory);
+ if (!mtctx->allJobsCompleted) ZSTDMT_releaseAllJobResources(mtctx); /* stop workers first */
+ ZSTDMT_freeBufferPool(mtctx->buffPool); /* release job resources into pools first */
+ ZSTD_free(mtctx->jobs, mtctx->cMem);
+ ZSTDMT_freeCCtxPool(mtctx->cctxPool);
+ ZSTD_freeCDict(mtctx->cdictLocal);
+ pthread_mutex_destroy(&mtctx->jobCompleted_mutex);
+ pthread_cond_destroy(&mtctx->jobCompleted_cond);
+ ZSTD_free(mtctx, mtctx->cMem);
+ return 0;
+}
+
+size_t ZSTDMT_sizeof_CCtx(ZSTDMT_CCtx* mtctx)
+{
+ if (mtctx == NULL) return 0; /* supports sizeof NULL */
+ return sizeof(*mtctx)
+ + POOL_sizeof(mtctx->factory)
+ + ZSTDMT_sizeof_bufferPool(mtctx->buffPool)
+ + (mtctx->jobIDMask+1) * sizeof(ZSTDMT_jobDescription)
+ + ZSTDMT_sizeof_CCtxPool(mtctx->cctxPool)
+ + ZSTD_sizeof_CDict(mtctx->cdictLocal);
+}
+
+size_t ZSTDMT_setMTCtxParameter(ZSTDMT_CCtx* mtctx, ZSDTMT_parameter parameter, unsigned value)
+{
+ switch(parameter)
+ {
+ case ZSTDMT_p_sectionSize :
+ mtctx->sectionSize = value;
+ return 0;
+ case ZSTDMT_p_overlapSectionLog :
+ DEBUGLOG(5, "ZSTDMT_p_overlapSectionLog : %u", value);
+ mtctx->overlapRLog = (value >= 9) ? 0 : 9 - value;
+ return 0;
+ default :
+ return ERROR(compressionParameter_unsupported);
+ }
+}
+
+
+/* ------------------------------------------ */
+/* ===== Multi-threaded compression ===== */
+/* ------------------------------------------ */
+
+static unsigned computeNbChunks(size_t srcSize, unsigned windowLog, unsigned nbThreads) {
+ size_t const chunkSizeTarget = (size_t)1 << (windowLog + 2);
+ size_t const chunkMaxSize = chunkSizeTarget << 2;
+ size_t const passSizeMax = chunkMaxSize * nbThreads;
+ unsigned const multiplier = (unsigned)(srcSize / passSizeMax) + 1;
+ unsigned const nbChunksLarge = multiplier * nbThreads;
+ unsigned const nbChunksMax = (unsigned)(srcSize / chunkSizeTarget) + 1;
+ unsigned const nbChunksSmall = MIN(nbChunksMax, nbThreads);
+ return (multiplier>1) ? nbChunksLarge : nbChunksSmall;
+}
+
+
+size_t ZSTDMT_compress_advanced(ZSTDMT_CCtx* mtctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const ZSTD_CDict* cdict,
+ ZSTD_parameters const params,
+ unsigned overlapRLog)
+{
+ size_t const overlapSize = (overlapRLog>=9) ? 0 : (size_t)1 << (params.cParams.windowLog - overlapRLog);
+ unsigned nbChunks = computeNbChunks(srcSize, params.cParams.windowLog, mtctx->nbThreads);
+ size_t const proposedChunkSize = (srcSize + (nbChunks-1)) / nbChunks;
+ size_t const avgChunkSize = ((proposedChunkSize & 0x1FFFF) < 0x7FFF) ? proposedChunkSize + 0xFFFF : proposedChunkSize; /* avoid too small last block */
+ const char* const srcStart = (const char*)src;
+ size_t remainingSrcSize = srcSize;
+ unsigned const compressWithinDst = (dstCapacity >= ZSTD_compressBound(srcSize)) ? nbChunks : (unsigned)(dstCapacity / ZSTD_compressBound(avgChunkSize)); /* presumes avgChunkSize >= 256 KB, which should be the case */
+ size_t frameStartPos = 0, dstBufferPos = 0;
+
+ DEBUGLOG(4, "nbChunks : %2u (chunkSize : %u bytes) ", nbChunks, (U32)avgChunkSize);
+ if (nbChunks==1) { /* fallback to single-thread mode */
+ ZSTD_CCtx* const cctx = mtctx->cctxPool->cctx[0];
+ if (cdict) return ZSTD_compress_usingCDict_advanced(cctx, dst, dstCapacity, src, srcSize, cdict, params.fParams);
+ return ZSTD_compress_advanced(cctx, dst, dstCapacity, src, srcSize, NULL, 0, params);
+ }
+ assert(avgChunkSize >= 256 KB); /* condition for ZSTD_compressBound(A) + ZSTD_compressBound(B) <= ZSTD_compressBound(A+B), which is useful to avoid allocating extra buffers */
+
+ if (nbChunks > mtctx->jobIDMask+1) { /* enlarge job table */
+ U32 nbJobs = nbChunks;
+ ZSTD_free(mtctx->jobs, mtctx->cMem);
+ mtctx->jobIDMask = 0;
+ mtctx->jobs = ZSTDMT_allocJobsTable(&nbJobs, mtctx->cMem);
+ if (mtctx->jobs==NULL) return ERROR(memory_allocation);
+ mtctx->jobIDMask = nbJobs - 1;
+ }
+
+ { unsigned u;
+ for (u=0; u<nbChunks; u++) {
+ size_t const chunkSize = MIN(remainingSrcSize, avgChunkSize);
+ size_t const dstBufferCapacity = ZSTD_compressBound(chunkSize);
+ buffer_t const dstAsBuffer = { (char*)dst + dstBufferPos, dstBufferCapacity };
+ buffer_t const dstBuffer = u < compressWithinDst ? dstAsBuffer : ZSTDMT_getBuffer(mtctx->buffPool, dstBufferCapacity);
+ ZSTD_CCtx* const cctx = ZSTDMT_getCCtx(mtctx->cctxPool);
+ size_t dictSize = u ? overlapSize : 0;
+
+ if ((cctx==NULL) || (dstBuffer.start==NULL)) {
+ mtctx->jobs[u].cSize = ERROR(memory_allocation); /* job result */
+ mtctx->jobs[u].jobCompleted = 1;
+ nbChunks = u+1; /* only wait and free u jobs, instead of initially expected nbChunks ones */
+ break; /* let's wait for previous jobs to complete, but don't start new ones */
+ }
+
+ mtctx->jobs[u].srcStart = srcStart + frameStartPos - dictSize;
+ mtctx->jobs[u].dictSize = dictSize;
+ mtctx->jobs[u].srcSize = chunkSize;
+ mtctx->jobs[u].cdict = mtctx->nextJobID==0 ? cdict : NULL;
+ mtctx->jobs[u].fullFrameSize = srcSize;
+ mtctx->jobs[u].params = params;
+ /* do not calculate checksum within sections, but write it in header for first section */
+ if (u!=0) mtctx->jobs[u].params.fParams.checksumFlag = 0;
+ mtctx->jobs[u].dstBuff = dstBuffer;
+ mtctx->jobs[u].cctx = cctx;
+ mtctx->jobs[u].firstChunk = (u==0);
+ mtctx->jobs[u].lastChunk = (u==nbChunks-1);
+ mtctx->jobs[u].jobCompleted = 0;
+ mtctx->jobs[u].jobCompleted_mutex = &mtctx->jobCompleted_mutex;
+ mtctx->jobs[u].jobCompleted_cond = &mtctx->jobCompleted_cond;
+
+ DEBUGLOG(5, "posting job %u (%u bytes)", u, (U32)chunkSize);
+ DEBUG_PRINTHEX(6, mtctx->jobs[u].srcStart, 12);
+ POOL_add(mtctx->factory, ZSTDMT_compressChunk, &mtctx->jobs[u]);
+
+ frameStartPos += chunkSize;
+ dstBufferPos += dstBufferCapacity;
+ remainingSrcSize -= chunkSize;
+ } }
+
+ /* collect result */
+ { unsigned chunkID;
+ size_t error = 0, dstPos = 0;
+ for (chunkID=0; chunkID<nbChunks; chunkID++) {
+ DEBUGLOG(5, "waiting for chunk %u ", chunkID);
+ PTHREAD_MUTEX_LOCK(&mtctx->jobCompleted_mutex);
+ while (mtctx->jobs[chunkID].jobCompleted==0) {
+ DEBUGLOG(5, "waiting for jobCompleted signal from chunk %u", chunkID);
+ pthread_cond_wait(&mtctx->jobCompleted_cond, &mtctx->jobCompleted_mutex);
+ }
+ pthread_mutex_unlock(&mtctx->jobCompleted_mutex);
+ DEBUGLOG(5, "ready to write chunk %u ", chunkID);
+
+ ZSTDMT_releaseCCtx(mtctx->cctxPool, mtctx->jobs[chunkID].cctx);
+ mtctx->jobs[chunkID].cctx = NULL;
+ mtctx->jobs[chunkID].srcStart = NULL;
+ { size_t const cSize = mtctx->jobs[chunkID].cSize;
+ if (ZSTD_isError(cSize)) error = cSize;
+ if ((!error) && (dstPos + cSize > dstCapacity)) error = ERROR(dstSize_tooSmall);
+ if (chunkID) { /* note : chunk 0 is written directly at dst, which is correct position */
+ if (!error)
+ memmove((char*)dst + dstPos, mtctx->jobs[chunkID].dstBuff.start, cSize); /* may overlap when chunk compressed within dst */
+ if (chunkID >= compressWithinDst) { /* chunk compressed into its own buffer, which must be released */
+ DEBUGLOG(5, "releasing buffer %u>=%u", chunkID, compressWithinDst);
+ ZSTDMT_releaseBuffer(mtctx->buffPool, mtctx->jobs[chunkID].dstBuff);
+ }
+ mtctx->jobs[chunkID].dstBuff = g_nullBuffer;
+ }
+ dstPos += cSize ;
+ }
+ }
+ if (!error) DEBUGLOG(4, "compressed size : %u ", (U32)dstPos);
+ return error ? error : dstPos;
+ }
+}
+
+
+size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx* mtctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ int compressionLevel)
+{
+ U32 const overlapRLog = (compressionLevel >= ZSTD_maxCLevel()) ? 0 : 3;
+ ZSTD_parameters params = ZSTD_getParams(compressionLevel, srcSize, 0);
+ params.fParams.contentSizeFlag = 1;
+ return ZSTDMT_compress_advanced(mtctx, dst, dstCapacity, src, srcSize, NULL, params, overlapRLog);
+}
+
+
+/* ====================================== */
+/* ======= Streaming API ======= */
+/* ====================================== */
+
+static void ZSTDMT_waitForAllJobsCompleted(ZSTDMT_CCtx* zcs)
+{
+ DEBUGLOG(4, "ZSTDMT_waitForAllJobsCompleted");
+ while (zcs->doneJobID < zcs->nextJobID) {
+ unsigned const jobID = zcs->doneJobID & zcs->jobIDMask;
+ PTHREAD_MUTEX_LOCK(&zcs->jobCompleted_mutex);
+ while (zcs->jobs[jobID].jobCompleted==0) {
+ DEBUGLOG(5, "waiting for jobCompleted signal from chunk %u", zcs->doneJobID); /* we want to block when waiting for data to flush */
+ pthread_cond_wait(&zcs->jobCompleted_cond, &zcs->jobCompleted_mutex);
+ }
+ pthread_mutex_unlock(&zcs->jobCompleted_mutex);
+ zcs->doneJobID++;
+ }
+}
+
+
+/** ZSTDMT_initCStream_internal() :
+ * internal usage only */
+size_t ZSTDMT_initCStream_internal(ZSTDMT_CCtx* zcs,
+ const void* dict, size_t dictSize, const ZSTD_CDict* cdict,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize)
+{
+ DEBUGLOG(4, "ZSTDMT_initCStream_internal");
+ /* params are supposed to be fully validated at this point */
+ assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams)));
+ assert(!((dict) && (cdict))); /* either dict or cdict, not both */
+
+ if (zcs->nbThreads==1) {
+ DEBUGLOG(4, "single thread mode");
+ return ZSTD_initCStream_internal(zcs->cctxPool->cctx[0],
+ dict, dictSize, cdict,
+ params, pledgedSrcSize);
+ }
+
+ if (zcs->allJobsCompleted == 0) { /* previous compression not correctly finished */
+ ZSTDMT_waitForAllJobsCompleted(zcs);
+ ZSTDMT_releaseAllJobResources(zcs);
+ zcs->allJobsCompleted = 1;
+ }
+
+ zcs->params = params;
+ zcs->frameContentSize = pledgedSrcSize;
+ if (dict) {
+ DEBUGLOG(4,"cdictLocal: %08X", (U32)(size_t)zcs->cdictLocal);
+ ZSTD_freeCDict(zcs->cdictLocal);
+ zcs->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize,
+ 0 /* byRef */, ZSTD_dm_auto, /* note : a loadPrefix becomes an internal CDict */
+ params.cParams, zcs->cMem);
+ zcs->cdict = zcs->cdictLocal;
+ if (zcs->cdictLocal == NULL) return ERROR(memory_allocation);
+ } else {
+ DEBUGLOG(4,"cdictLocal: %08X", (U32)(size_t)zcs->cdictLocal);
+ ZSTD_freeCDict(zcs->cdictLocal);
+ zcs->cdictLocal = NULL;
+ zcs->cdict = cdict;
+ }
+
+ zcs->targetDictSize = (zcs->overlapRLog>=9) ? 0 : (size_t)1 << (zcs->params.cParams.windowLog - zcs->overlapRLog);
+ DEBUGLOG(4, "overlapRLog : %u ", zcs->overlapRLog);
+ DEBUGLOG(4, "overlap Size : %u KB", (U32)(zcs->targetDictSize>>10));
+ zcs->targetSectionSize = zcs->sectionSize ? zcs->sectionSize : (size_t)1 << (zcs->params.cParams.windowLog + 2);
+ zcs->targetSectionSize = MAX(ZSTDMT_SECTION_SIZE_MIN, zcs->targetSectionSize);
+ zcs->targetSectionSize = MAX(zcs->targetDictSize, zcs->targetSectionSize);
+ DEBUGLOG(4, "Section Size : %u KB", (U32)(zcs->targetSectionSize>>10));
+ zcs->marginSize = zcs->targetSectionSize >> 2;
+ zcs->inBuffSize = zcs->targetDictSize + zcs->targetSectionSize + zcs->marginSize;
+ zcs->inBuff.buffer = ZSTDMT_getBuffer(zcs->buffPool, zcs->inBuffSize);
+ if (zcs->inBuff.buffer.start == NULL) return ERROR(memory_allocation);
+ zcs->inBuff.filled = 0;
+ zcs->dictSize = 0;
+ zcs->doneJobID = 0;
+ zcs->nextJobID = 0;
+ zcs->frameEnded = 0;
+ zcs->allJobsCompleted = 0;
+ if (params.fParams.checksumFlag) XXH64_reset(&zcs->xxhState, 0);
+ return 0;
+}
+
+size_t ZSTDMT_initCStream_advanced(ZSTDMT_CCtx* mtctx,
+ const void* dict, size_t dictSize,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize)
+{
+ DEBUGLOG(5, "ZSTDMT_initCStream_advanced");
+ return ZSTDMT_initCStream_internal(mtctx, dict, dictSize, NULL, params, pledgedSrcSize);
+}
+
+size_t ZSTDMT_initCStream_usingCDict(ZSTDMT_CCtx* mtctx,
+ const ZSTD_CDict* cdict,
+ ZSTD_frameParameters fParams,
+ unsigned long long pledgedSrcSize)
+{
+ ZSTD_parameters params = ZSTD_getParamsFromCDict(cdict);
+ if (cdict==NULL) return ERROR(dictionary_wrong); /* method incompatible with NULL cdict */
+ params.fParams = fParams;
+ return ZSTDMT_initCStream_internal(mtctx, NULL, 0 /*dictSize*/, cdict,
+ params, pledgedSrcSize);
+}
+
+
+/* ZSTDMT_resetCStream() :
+ * pledgedSrcSize is optional and can be zero == unknown */
+size_t ZSTDMT_resetCStream(ZSTDMT_CCtx* zcs, unsigned long long pledgedSrcSize)
+{
+ if (zcs->nbThreads==1)
+ return ZSTD_resetCStream(zcs->cctxPool->cctx[0], pledgedSrcSize);
+ return ZSTDMT_initCStream_internal(zcs, NULL, 0, 0, zcs->params, pledgedSrcSize);
+}
+
+size_t ZSTDMT_initCStream(ZSTDMT_CCtx* zcs, int compressionLevel) {
+ ZSTD_parameters const params = ZSTD_getParams(compressionLevel, 0, 0);
+ return ZSTDMT_initCStream_internal(zcs, NULL, 0, NULL, params, 0);
+}
+
+
+static size_t ZSTDMT_createCompressionJob(ZSTDMT_CCtx* zcs, size_t srcSize, unsigned endFrame)
+{
+ size_t const dstBufferCapacity = ZSTD_compressBound(srcSize);
+ buffer_t const dstBuffer = ZSTDMT_getBuffer(zcs->buffPool, dstBufferCapacity);
+ ZSTD_CCtx* const cctx = ZSTDMT_getCCtx(zcs->cctxPool);
+ unsigned const jobID = zcs->nextJobID & zcs->jobIDMask;
+
+ if ((cctx==NULL) || (dstBuffer.start==NULL)) {
+ zcs->jobs[jobID].jobCompleted = 1;
+ zcs->nextJobID++;
+ ZSTDMT_waitForAllJobsCompleted(zcs);
+ ZSTDMT_releaseAllJobResources(zcs);
+ return ERROR(memory_allocation);
+ }
+
+ DEBUGLOG(4, "preparing job %u to compress %u bytes with %u preload ",
+ zcs->nextJobID, (U32)srcSize, (U32)zcs->dictSize);
+ zcs->jobs[jobID].src = zcs->inBuff.buffer;
+ zcs->jobs[jobID].srcStart = zcs->inBuff.buffer.start;
+ zcs->jobs[jobID].srcSize = srcSize;
+ zcs->jobs[jobID].dictSize = zcs->dictSize;
+ assert(zcs->inBuff.filled >= srcSize + zcs->dictSize);
+ zcs->jobs[jobID].params = zcs->params;
+ /* do not calculate checksum within sections, but write it in header for first section */
+ if (zcs->nextJobID) zcs->jobs[jobID].params.fParams.checksumFlag = 0;
+ zcs->jobs[jobID].cdict = zcs->nextJobID==0 ? zcs->cdict : NULL;
+ zcs->jobs[jobID].fullFrameSize = zcs->frameContentSize;
+ zcs->jobs[jobID].dstBuff = dstBuffer;
+ zcs->jobs[jobID].cctx = cctx;
+ zcs->jobs[jobID].firstChunk = (zcs->nextJobID==0);
+ zcs->jobs[jobID].lastChunk = endFrame;
+ zcs->jobs[jobID].jobCompleted = 0;
+ zcs->jobs[jobID].dstFlushed = 0;
+ zcs->jobs[jobID].jobCompleted_mutex = &zcs->jobCompleted_mutex;
+ zcs->jobs[jobID].jobCompleted_cond = &zcs->jobCompleted_cond;
+
+ /* get a new buffer for next input */
+ if (!endFrame) {
+ size_t const newDictSize = MIN(srcSize + zcs->dictSize, zcs->targetDictSize);
+ DEBUGLOG(5, "ZSTDMT_createCompressionJob::endFrame = %u", endFrame);
+ zcs->inBuff.buffer = ZSTDMT_getBuffer(zcs->buffPool, zcs->inBuffSize);
+ if (zcs->inBuff.buffer.start == NULL) { /* not enough memory to allocate next input buffer */
+ zcs->jobs[jobID].jobCompleted = 1;
+ zcs->nextJobID++;
+ ZSTDMT_waitForAllJobsCompleted(zcs);
+ ZSTDMT_releaseAllJobResources(zcs);
+ return ERROR(memory_allocation);
+ }
+ DEBUGLOG(5, "inBuff currently filled to %u", (U32)zcs->inBuff.filled);
+ zcs->inBuff.filled -= srcSize + zcs->dictSize - newDictSize;
+ DEBUGLOG(5, "new job : inBuff filled to %u, with %u dict and %u src",
+ (U32)zcs->inBuff.filled, (U32)newDictSize,
+ (U32)(zcs->inBuff.filled - newDictSize));
+ memmove(zcs->inBuff.buffer.start,
+ (const char*)zcs->jobs[jobID].srcStart + zcs->dictSize + srcSize - newDictSize,
+ zcs->inBuff.filled);
+ DEBUGLOG(5, "new inBuff pre-filled");
+ zcs->dictSize = newDictSize;
+ } else { /* if (endFrame==1) */
+ DEBUGLOG(5, "ZSTDMT_createCompressionJob::endFrame = %u", endFrame);
+ zcs->inBuff.buffer = g_nullBuffer;
+ zcs->inBuff.filled = 0;
+ zcs->dictSize = 0;
+ zcs->frameEnded = 1;
+ if (zcs->nextJobID == 0)
+ /* single chunk exception : checksum is calculated directly within worker thread */
+ zcs->params.fParams.checksumFlag = 0;
+ }
+
+ DEBUGLOG(4, "posting job %u : %u bytes (end:%u) (note : doneJob = %u=>%u)",
+ zcs->nextJobID,
+ (U32)zcs->jobs[jobID].srcSize,
+ zcs->jobs[jobID].lastChunk,
+ zcs->doneJobID,
+ zcs->doneJobID & zcs->jobIDMask);
+ POOL_add(zcs->factory, ZSTDMT_compressChunk, &zcs->jobs[jobID]); /* this call is blocking when thread worker pool is exhausted */
+ zcs->nextJobID++;
+ return 0;
+}
+
+
+/* ZSTDMT_flushNextJob() :
+ * output : will be updated with amount of data flushed .
+ * blockToFlush : if >0, the function will block and wait if there is no data available to flush .
+ * @return : amount of data remaining within internal buffer, 1 if unknown but > 0, 0 if no more, or an error code */
+static size_t ZSTDMT_flushNextJob(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output, unsigned blockToFlush)
+{
+ unsigned const wJobID = zcs->doneJobID & zcs->jobIDMask;
+ if (zcs->doneJobID == zcs->nextJobID) return 0; /* all flushed ! */
+ PTHREAD_MUTEX_LOCK(&zcs->jobCompleted_mutex);
+ while (zcs->jobs[wJobID].jobCompleted==0) {
+ DEBUGLOG(5, "waiting for jobCompleted signal from job %u", zcs->doneJobID);
+ if (!blockToFlush) { pthread_mutex_unlock(&zcs->jobCompleted_mutex); return 0; } /* nothing ready to be flushed => skip */
+ pthread_cond_wait(&zcs->jobCompleted_cond, &zcs->jobCompleted_mutex); /* block when nothing available to flush */
+ }
+ pthread_mutex_unlock(&zcs->jobCompleted_mutex);
+ /* compression job completed : output can be flushed */
+ { ZSTDMT_jobDescription job = zcs->jobs[wJobID];
+ if (!job.jobScanned) {
+ if (ZSTD_isError(job.cSize)) {
+ DEBUGLOG(5, "compression error detected ");
+ ZSTDMT_waitForAllJobsCompleted(zcs);
+ ZSTDMT_releaseAllJobResources(zcs);
+ return job.cSize;
+ }
+ ZSTDMT_releaseCCtx(zcs->cctxPool, job.cctx);
+ zcs->jobs[wJobID].cctx = NULL;
+ DEBUGLOG(5, "zcs->params.fParams.checksumFlag : %u ", zcs->params.fParams.checksumFlag);
+ if (zcs->params.fParams.checksumFlag) {
+ XXH64_update(&zcs->xxhState, (const char*)job.srcStart + job.dictSize, job.srcSize);
+ if (zcs->frameEnded && (zcs->doneJobID+1 == zcs->nextJobID)) { /* write checksum at end of last section */
+ U32 const checksum = (U32)XXH64_digest(&zcs->xxhState);
+ DEBUGLOG(5, "writing checksum : %08X \n", checksum);
+ MEM_writeLE32((char*)job.dstBuff.start + job.cSize, checksum);
+ job.cSize += 4;
+ zcs->jobs[wJobID].cSize += 4;
+ } }
+ ZSTDMT_releaseBuffer(zcs->buffPool, job.src);
+ zcs->jobs[wJobID].srcStart = NULL;
+ zcs->jobs[wJobID].src = g_nullBuffer;
+ zcs->jobs[wJobID].jobScanned = 1;
+ }
+ { size_t const toWrite = MIN(job.cSize - job.dstFlushed, output->size - output->pos);
+ DEBUGLOG(5, "Flushing %u bytes from job %u ", (U32)toWrite, zcs->doneJobID);
+ memcpy((char*)output->dst + output->pos, (const char*)job.dstBuff.start + job.dstFlushed, toWrite);
+ output->pos += toWrite;
+ job.dstFlushed += toWrite;
+ }
+ if (job.dstFlushed == job.cSize) { /* output buffer fully flushed => move to next one */
+ ZSTDMT_releaseBuffer(zcs->buffPool, job.dstBuff);
+ zcs->jobs[wJobID].dstBuff = g_nullBuffer;
+ zcs->jobs[wJobID].jobCompleted = 0;
+ zcs->doneJobID++;
+ } else {
+ zcs->jobs[wJobID].dstFlushed = job.dstFlushed;
+ }
+ /* return value : how many bytes left in buffer ; fake it to 1 if unknown but >0 */
+ if (job.cSize > job.dstFlushed) return (job.cSize - job.dstFlushed);
+ if (zcs->doneJobID < zcs->nextJobID) return 1; /* still some buffer to flush */
+ zcs->allJobsCompleted = zcs->frameEnded; /* frame completed and entirely flushed */
+ return 0; /* everything flushed */
+} }
+
+
+/** ZSTDMT_compressStream_generic() :
+ * internal use only
+ * assumption : output and input are valid (pos <= size)
+ * @return : minimum amount of data remaining to flush, 0 if none */
+size_t ZSTDMT_compressStream_generic(ZSTDMT_CCtx* mtctx,
+ ZSTD_outBuffer* output,
+ ZSTD_inBuffer* input,
+ ZSTD_EndDirective endOp)
+{
+ size_t const newJobThreshold = mtctx->dictSize + mtctx->targetSectionSize + mtctx->marginSize;
+ assert(output->pos <= output->size);
+ assert(input->pos <= input->size);
+ if ((mtctx->frameEnded) && (endOp==ZSTD_e_continue)) {
+ /* current frame being ended. Only flush/end are allowed. Or start new frame with init */
+ return ERROR(stage_wrong);
+ }
+ if (mtctx->nbThreads==1) {
+ return ZSTD_compressStream_generic(mtctx->cctxPool->cctx[0], output, input, endOp);
+ }
+
+ /* single-pass shortcut (note : this is blocking-mode) */
+ if ( (mtctx->nextJobID==0) /* just started */
+ && (mtctx->inBuff.filled==0) /* nothing buffered */
+ && (endOp==ZSTD_e_end) /* end order */
+ && (output->size - output->pos >= ZSTD_compressBound(input->size - input->pos)) ) { /* enough room */
+ size_t const cSize = ZSTDMT_compress_advanced(mtctx,
+ (char*)output->dst + output->pos, output->size - output->pos,
+ (const char*)input->src + input->pos, input->size - input->pos,
+ mtctx->cdict, mtctx->params, mtctx->overlapRLog);
+ if (ZSTD_isError(cSize)) return cSize;
+ input->pos = input->size;
+ output->pos += cSize;
+ ZSTDMT_releaseBuffer(mtctx->buffPool, mtctx->inBuff.buffer); /* was allocated in initStream */
+ mtctx->allJobsCompleted = 1;
+ mtctx->frameEnded = 1;
+ return 0;
+ }
+
+ /* fill input buffer */
+ if ((input->src) && (mtctx->inBuff.buffer.start)) { /* support NULL input */
+ size_t const toLoad = MIN(input->size - input->pos, mtctx->inBuffSize - mtctx->inBuff.filled);
+ DEBUGLOG(2, "inBuff:%08X; inBuffSize=%u; ToCopy=%u", (U32)(size_t)mtctx->inBuff.buffer.start, (U32)mtctx->inBuffSize, (U32)toLoad);
+ memcpy((char*)mtctx->inBuff.buffer.start + mtctx->inBuff.filled, (const char*)input->src + input->pos, toLoad);
+ input->pos += toLoad;
+ mtctx->inBuff.filled += toLoad;
+ }
+
+ if ( (mtctx->inBuff.filled >= newJobThreshold) /* filled enough : let's compress */
+ && (mtctx->nextJobID <= mtctx->doneJobID + mtctx->jobIDMask) ) { /* avoid overwriting job round buffer */
+ CHECK_F( ZSTDMT_createCompressionJob(mtctx, mtctx->targetSectionSize, 0 /* endFrame */) );
+ }
+
+ /* check for potential compressed data ready to be flushed */
+ CHECK_F( ZSTDMT_flushNextJob(mtctx, output, (mtctx->inBuff.filled == mtctx->inBuffSize) /* blockToFlush */) ); /* block if it wasn't possible to create new job due to saturation */
+
+ if (input->pos < input->size) /* input not consumed : do not flush yet */
+ endOp = ZSTD_e_continue;
+
+ switch(endOp)
+ {
+ case ZSTD_e_flush:
+ return ZSTDMT_flushStream(mtctx, output);
+ case ZSTD_e_end:
+ return ZSTDMT_endStream(mtctx, output);
+ case ZSTD_e_continue:
+ return 1;
+ default:
+ return ERROR(GENERIC); /* invalid endDirective */
+ }
+}
+
+
+size_t ZSTDMT_compressStream(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input)
+{
+ CHECK_F( ZSTDMT_compressStream_generic(zcs, output, input, ZSTD_e_continue) );
+
+ /* recommended next input size : fill current input buffer */
+ return zcs->inBuffSize - zcs->inBuff.filled; /* note : could be zero when input buffer is fully filled and no more availability to create new job */
+}
+
+
+static size_t ZSTDMT_flushStream_internal(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output, unsigned endFrame)
+{
+ size_t const srcSize = zcs->inBuff.filled - zcs->dictSize;
+
+ if ( ((srcSize > 0) || (endFrame && !zcs->frameEnded))
+ && (zcs->nextJobID <= zcs->doneJobID + zcs->jobIDMask) ) {
+ CHECK_F( ZSTDMT_createCompressionJob(zcs, srcSize, endFrame) );
+ }
+
+ /* check if there is any data available to flush */
+ return ZSTDMT_flushNextJob(zcs, output, 1 /* blockToFlush */);
+}
+
+
+size_t ZSTDMT_flushStream(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output)
+{
+ DEBUGLOG(5, "ZSTDMT_flushStream");
+ if (zcs->nbThreads==1)
+ return ZSTD_flushStream(zcs->cctxPool->cctx[0], output);
+ return ZSTDMT_flushStream_internal(zcs, output, 0 /* endFrame */);
+}
+
+size_t ZSTDMT_endStream(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output)
+{
+ DEBUGLOG(4, "ZSTDMT_endStream");
+ if (zcs->nbThreads==1)
+ return ZSTD_endStream(zcs->cctxPool->cctx[0], output);
+ return ZSTDMT_flushStream_internal(zcs, output, 1 /* endFrame */);
+}
diff --git a/thirdparty/zstd/compress/zstdmt_compress.h b/thirdparty/zstd/compress/zstdmt_compress.h
new file mode 100644
index 0000000000..fad63b6d86
--- /dev/null
+++ b/thirdparty/zstd/compress/zstdmt_compress.h
@@ -0,0 +1,114 @@
+/**
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+ #ifndef ZSTDMT_COMPRESS_H
+ #define ZSTDMT_COMPRESS_H
+
+ #if defined (__cplusplus)
+ extern "C" {
+ #endif
+
+
+/* Note : All prototypes defined in this file are labelled experimental.
+ * No guarantee of API continuity is provided on any of them.
+ * In fact, the expectation is that these prototypes will be replaced
+ * by ZSTD_compress_generic() API in the near future */
+
+/* === Dependencies === */
+#include <stddef.h> /* size_t */
+#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_parameters */
+#include "zstd.h" /* ZSTD_inBuffer, ZSTD_outBuffer, ZSTDLIB_API */
+
+
+/* === Memory management === */
+typedef struct ZSTDMT_CCtx_s ZSTDMT_CCtx;
+ZSTDLIB_API ZSTDMT_CCtx* ZSTDMT_createCCtx(unsigned nbThreads);
+ZSTDLIB_API ZSTDMT_CCtx* ZSTDMT_createCCtx_advanced(unsigned nbThreads,
+ ZSTD_customMem cMem);
+ZSTDLIB_API size_t ZSTDMT_freeCCtx(ZSTDMT_CCtx* mtctx);
+
+ZSTDLIB_API size_t ZSTDMT_sizeof_CCtx(ZSTDMT_CCtx* mtctx);
+
+
+/* === Simple buffer-to-butter one-pass function === */
+
+ZSTDLIB_API size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx* mtctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ int compressionLevel);
+
+
+
+/* === Streaming functions === */
+
+ZSTDLIB_API size_t ZSTDMT_initCStream(ZSTDMT_CCtx* mtctx, int compressionLevel);
+ZSTDLIB_API size_t ZSTDMT_resetCStream(ZSTDMT_CCtx* mtctx, unsigned long long pledgedSrcSize); /**< pledgedSrcSize is optional and can be zero == unknown */
+
+ZSTDLIB_API size_t ZSTDMT_compressStream(ZSTDMT_CCtx* mtctx, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
+
+ZSTDLIB_API size_t ZSTDMT_flushStream(ZSTDMT_CCtx* mtctx, ZSTD_outBuffer* output); /**< @return : 0 == all flushed; >0 : still some data to be flushed; or an error code (ZSTD_isError()) */
+ZSTDLIB_API size_t ZSTDMT_endStream(ZSTDMT_CCtx* mtctx, ZSTD_outBuffer* output); /**< @return : 0 == all flushed; >0 : still some data to be flushed; or an error code (ZSTD_isError()) */
+
+
+/* === Advanced functions and parameters === */
+
+#ifndef ZSTDMT_SECTION_SIZE_MIN
+# define ZSTDMT_SECTION_SIZE_MIN (1U << 20) /* 1 MB - Minimum size of each compression job */
+#endif
+
+ZSTDLIB_API size_t ZSTDMT_compress_advanced(ZSTDMT_CCtx* mtctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const ZSTD_CDict* cdict,
+ ZSTD_parameters const params,
+ unsigned overlapRLog);
+
+ZSTDLIB_API size_t ZSTDMT_initCStream_advanced(ZSTDMT_CCtx* mtctx,
+ const void* dict, size_t dictSize, /* dict can be released after init, a local copy is preserved within zcs */
+ ZSTD_parameters params,
+ unsigned long long pledgedSrcSize); /* pledgedSrcSize is optional and can be zero == unknown */
+
+ZSTDLIB_API size_t ZSTDMT_initCStream_usingCDict(ZSTDMT_CCtx* mtctx,
+ const ZSTD_CDict* cdict,
+ ZSTD_frameParameters fparams,
+ unsigned long long pledgedSrcSize); /* note : zero means empty */
+
+/* ZSDTMT_parameter :
+ * List of parameters that can be set using ZSTDMT_setMTCtxParameter() */
+typedef enum {
+ ZSTDMT_p_sectionSize, /* size of input "section". Each section is compressed in parallel. 0 means default, which is dynamically determined within compression functions */
+ ZSTDMT_p_overlapSectionLog /* Log of overlapped section; 0 == no overlap, 6(default) == use 1/8th of window, >=9 == use full window */
+} ZSDTMT_parameter;
+
+/* ZSTDMT_setMTCtxParameter() :
+ * allow setting individual parameters, one at a time, among a list of enums defined in ZSTDMT_parameter.
+ * The function must be called typically after ZSTD_createCCtx().
+ * Parameters not explicitly reset by ZSTDMT_init*() remain the same in consecutive compression sessions.
+ * @return : 0, or an error code (which can be tested using ZSTD_isError()) */
+ZSTDLIB_API size_t ZSTDMT_setMTCtxParameter(ZSTDMT_CCtx* mtctx, ZSDTMT_parameter parameter, unsigned value);
+
+
+/*! ZSTDMT_compressStream_generic() :
+ * Combines ZSTDMT_compressStream() with ZSTDMT_flushStream() or ZSTDMT_endStream()
+ * depending on flush directive.
+ * @return : minimum amount of data still to be flushed
+ * 0 if fully flushed
+ * or an error code */
+ZSTDLIB_API size_t ZSTDMT_compressStream_generic(ZSTDMT_CCtx* mtctx,
+ ZSTD_outBuffer* output,
+ ZSTD_inBuffer* input,
+ ZSTD_EndDirective endOp);
+
+
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif /* ZSTDMT_COMPRESS_H */
diff --git a/thirdparty/zstd/decompress/huf_decompress.c b/thirdparty/zstd/decompress/huf_decompress.c
new file mode 100644
index 0000000000..2a1b70ea5e
--- /dev/null
+++ b/thirdparty/zstd/decompress/huf_decompress.c
@@ -0,0 +1,1012 @@
+/* ******************************************************************
+ Huffman decoder, part of New Generation Entropy library
+ Copyright (C) 2013-2016, Yann Collet.
+
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ You can contact the author at :
+ - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy
+ - Public forum : https://groups.google.com/forum/#!forum/lz4c
+****************************************************************** */
+
+/* **************************************************************
+* Compiler specifics
+****************************************************************/
+#ifdef _MSC_VER /* Visual Studio */
+# define FORCE_INLINE static __forceinline
+# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
+#else
+# if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
+# ifdef __GNUC__
+# define FORCE_INLINE static inline __attribute__((always_inline))
+# else
+# define FORCE_INLINE static inline
+# endif
+# else
+# define FORCE_INLINE static
+# endif /* __STDC_VERSION__ */
+#endif
+
+
+/* **************************************************************
+* Dependencies
+****************************************************************/
+#include <string.h> /* memcpy, memset */
+#include "bitstream.h" /* BIT_* */
+#include "fse.h" /* header compression */
+#define HUF_STATIC_LINKING_ONLY
+#include "huf.h"
+
+
+/* **************************************************************
+* Error Management
+****************************************************************/
+#define HUF_STATIC_ASSERT(c) { enum { HUF_static_assert = 1/(int)(!!(c)) }; } /* use only *after* variable declarations */
+
+
+/* **************************************************************
+* Byte alignment for workSpace management
+****************************************************************/
+#define HUF_ALIGN(x, a) HUF_ALIGN_MASK((x), (a) - 1)
+#define HUF_ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
+
+/*-***************************/
+/* generic DTableDesc */
+/*-***************************/
+
+typedef struct { BYTE maxTableLog; BYTE tableType; BYTE tableLog; BYTE reserved; } DTableDesc;
+
+static DTableDesc HUF_getDTableDesc(const HUF_DTable* table)
+{
+ DTableDesc dtd;
+ memcpy(&dtd, table, sizeof(dtd));
+ return dtd;
+}
+
+
+/*-***************************/
+/* single-symbol decoding */
+/*-***************************/
+
+typedef struct { BYTE byte; BYTE nbBits; } HUF_DEltX2; /* single-symbol decoding */
+
+size_t HUF_readDTableX2_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize)
+{
+ U32 tableLog = 0;
+ U32 nbSymbols = 0;
+ size_t iSize;
+ void* const dtPtr = DTable + 1;
+ HUF_DEltX2* const dt = (HUF_DEltX2*)dtPtr;
+
+ U32* rankVal;
+ BYTE* huffWeight;
+ size_t spaceUsed32 = 0;
+
+ rankVal = (U32 *)workSpace + spaceUsed32;
+ spaceUsed32 += HUF_TABLELOG_ABSOLUTEMAX + 1;
+ huffWeight = (BYTE *)((U32 *)workSpace + spaceUsed32);
+ spaceUsed32 += HUF_ALIGN(HUF_SYMBOLVALUE_MAX + 1, sizeof(U32)) >> 2;
+
+ if ((spaceUsed32 << 2) > wkspSize)
+ return ERROR(tableLog_tooLarge);
+ workSpace = (U32 *)workSpace + spaceUsed32;
+ wkspSize -= (spaceUsed32 << 2);
+
+ HUF_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUF_DTable));
+ /* memset(huffWeight, 0, sizeof(huffWeight)); */ /* is not necessary, even though some analyzer complain ... */
+
+ iSize = HUF_readStats(huffWeight, HUF_SYMBOLVALUE_MAX + 1, rankVal, &nbSymbols, &tableLog, src, srcSize);
+ if (HUF_isError(iSize)) return iSize;
+
+ /* Table header */
+ { DTableDesc dtd = HUF_getDTableDesc(DTable);
+ if (tableLog > (U32)(dtd.maxTableLog+1)) return ERROR(tableLog_tooLarge); /* DTable too small, Huffman tree cannot fit in */
+ dtd.tableType = 0;
+ dtd.tableLog = (BYTE)tableLog;
+ memcpy(DTable, &dtd, sizeof(dtd));
+ }
+
+ /* Calculate starting value for each rank */
+ { U32 n, nextRankStart = 0;
+ for (n=1; n<tableLog+1; n++) {
+ U32 const current = nextRankStart;
+ nextRankStart += (rankVal[n] << (n-1));
+ rankVal[n] = current;
+ } }
+
+ /* fill DTable */
+ { U32 n;
+ for (n=0; n<nbSymbols; n++) {
+ U32 const w = huffWeight[n];
+ U32 const length = (1 << w) >> 1;
+ U32 u;
+ HUF_DEltX2 D;
+ D.byte = (BYTE)n; D.nbBits = (BYTE)(tableLog + 1 - w);
+ for (u = rankVal[w]; u < rankVal[w] + length; u++)
+ dt[u] = D;
+ rankVal[w] += length;
+ } }
+
+ return iSize;
+}
+
+size_t HUF_readDTableX2(HUF_DTable* DTable, const void* src, size_t srcSize)
+{
+ U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];
+ return HUF_readDTableX2_wksp(DTable, src, srcSize,
+ workSpace, sizeof(workSpace));
+}
+
+
+static BYTE HUF_decodeSymbolX2(BIT_DStream_t* Dstream, const HUF_DEltX2* dt, const U32 dtLog)
+{
+ size_t const val = BIT_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
+ BYTE const c = dt[val].byte;
+ BIT_skipBits(Dstream, dt[val].nbBits);
+ return c;
+}
+
+#define HUF_DECODE_SYMBOLX2_0(ptr, DStreamPtr) \
+ *ptr++ = HUF_decodeSymbolX2(DStreamPtr, dt, dtLog)
+
+#define HUF_DECODE_SYMBOLX2_1(ptr, DStreamPtr) \
+ if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \
+ HUF_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
+
+#define HUF_DECODE_SYMBOLX2_2(ptr, DStreamPtr) \
+ if (MEM_64bits()) \
+ HUF_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
+
+FORCE_INLINE size_t HUF_decodeStreamX2(BYTE* p, BIT_DStream_t* const bitDPtr, BYTE* const pEnd, const HUF_DEltX2* const dt, const U32 dtLog)
+{
+ BYTE* const pStart = p;
+
+ /* up to 4 symbols at a time */
+ while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) && (p <= pEnd-4)) {
+ HUF_DECODE_SYMBOLX2_2(p, bitDPtr);
+ HUF_DECODE_SYMBOLX2_1(p, bitDPtr);
+ HUF_DECODE_SYMBOLX2_2(p, bitDPtr);
+ HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
+ }
+
+ /* closer to the end */
+ while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) && (p < pEnd))
+ HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
+
+ /* no more data to retrieve from bitstream, hence no need to reload */
+ while (p < pEnd)
+ HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
+
+ return pEnd-pStart;
+}
+
+static size_t HUF_decompress1X2_usingDTable_internal(
+ void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ const HUF_DTable* DTable)
+{
+ BYTE* op = (BYTE*)dst;
+ BYTE* const oend = op + dstSize;
+ const void* dtPtr = DTable + 1;
+ const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;
+ BIT_DStream_t bitD;
+ DTableDesc const dtd = HUF_getDTableDesc(DTable);
+ U32 const dtLog = dtd.tableLog;
+
+ { size_t const errorCode = BIT_initDStream(&bitD, cSrc, cSrcSize);
+ if (HUF_isError(errorCode)) return errorCode; }
+
+ HUF_decodeStreamX2(op, &bitD, oend, dt, dtLog);
+
+ /* check */
+ if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected);
+
+ return dstSize;
+}
+
+size_t HUF_decompress1X2_usingDTable(
+ void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ const HUF_DTable* DTable)
+{
+ DTableDesc dtd = HUF_getDTableDesc(DTable);
+ if (dtd.tableType != 0) return ERROR(GENERIC);
+ return HUF_decompress1X2_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable);
+}
+
+size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ void* workSpace, size_t wkspSize)
+{
+ const BYTE* ip = (const BYTE*) cSrc;
+
+ size_t const hSize = HUF_readDTableX2_wksp(DCtx, cSrc, cSrcSize, workSpace, wkspSize);
+ if (HUF_isError(hSize)) return hSize;
+ if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
+ ip += hSize; cSrcSize -= hSize;
+
+ return HUF_decompress1X2_usingDTable_internal (dst, dstSize, ip, cSrcSize, DCtx);
+}
+
+
+size_t HUF_decompress1X2_DCtx(HUF_DTable* DCtx, void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize)
+{
+ U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];
+ return HUF_decompress1X2_DCtx_wksp(DCtx, dst, dstSize, cSrc, cSrcSize,
+ workSpace, sizeof(workSpace));
+}
+
+size_t HUF_decompress1X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ HUF_CREATE_STATIC_DTABLEX2(DTable, HUF_TABLELOG_MAX);
+ return HUF_decompress1X2_DCtx (DTable, dst, dstSize, cSrc, cSrcSize);
+}
+
+
+static size_t HUF_decompress4X2_usingDTable_internal(
+ void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ const HUF_DTable* DTable)
+{
+ /* Check */
+ if (cSrcSize < 10) return ERROR(corruption_detected); /* strict minimum : jump table + 1 byte per stream */
+
+ { const BYTE* const istart = (const BYTE*) cSrc;
+ BYTE* const ostart = (BYTE*) dst;
+ BYTE* const oend = ostart + dstSize;
+ const void* const dtPtr = DTable + 1;
+ const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;
+
+ /* Init */
+ BIT_DStream_t bitD1;
+ BIT_DStream_t bitD2;
+ BIT_DStream_t bitD3;
+ BIT_DStream_t bitD4;
+ size_t const length1 = MEM_readLE16(istart);
+ size_t const length2 = MEM_readLE16(istart+2);
+ size_t const length3 = MEM_readLE16(istart+4);
+ size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
+ const BYTE* const istart1 = istart + 6; /* jumpTable */
+ const BYTE* const istart2 = istart1 + length1;
+ const BYTE* const istart3 = istart2 + length2;
+ const BYTE* const istart4 = istart3 + length3;
+ const size_t segmentSize = (dstSize+3) / 4;
+ BYTE* const opStart2 = ostart + segmentSize;
+ BYTE* const opStart3 = opStart2 + segmentSize;
+ BYTE* const opStart4 = opStart3 + segmentSize;
+ BYTE* op1 = ostart;
+ BYTE* op2 = opStart2;
+ BYTE* op3 = opStart3;
+ BYTE* op4 = opStart4;
+ U32 endSignal;
+ DTableDesc const dtd = HUF_getDTableDesc(DTable);
+ U32 const dtLog = dtd.tableLog;
+
+ if (length4 > cSrcSize) return ERROR(corruption_detected); /* overflow */
+ { size_t const errorCode = BIT_initDStream(&bitD1, istart1, length1);
+ if (HUF_isError(errorCode)) return errorCode; }
+ { size_t const errorCode = BIT_initDStream(&bitD2, istart2, length2);
+ if (HUF_isError(errorCode)) return errorCode; }
+ { size_t const errorCode = BIT_initDStream(&bitD3, istart3, length3);
+ if (HUF_isError(errorCode)) return errorCode; }
+ { size_t const errorCode = BIT_initDStream(&bitD4, istart4, length4);
+ if (HUF_isError(errorCode)) return errorCode; }
+
+ /* 16-32 symbols per loop (4-8 symbols per stream) */
+ endSignal = BIT_reloadDStream(&bitD1) | BIT_reloadDStream(&bitD2) | BIT_reloadDStream(&bitD3) | BIT_reloadDStream(&bitD4);
+ for ( ; (endSignal==BIT_DStream_unfinished) && (op4<(oend-7)) ; ) {
+ HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
+ HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
+ HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
+ HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
+ HUF_DECODE_SYMBOLX2_1(op1, &bitD1);
+ HUF_DECODE_SYMBOLX2_1(op2, &bitD2);
+ HUF_DECODE_SYMBOLX2_1(op3, &bitD3);
+ HUF_DECODE_SYMBOLX2_1(op4, &bitD4);
+ HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
+ HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
+ HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
+ HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
+ HUF_DECODE_SYMBOLX2_0(op1, &bitD1);
+ HUF_DECODE_SYMBOLX2_0(op2, &bitD2);
+ HUF_DECODE_SYMBOLX2_0(op3, &bitD3);
+ HUF_DECODE_SYMBOLX2_0(op4, &bitD4);
+ endSignal = BIT_reloadDStream(&bitD1) | BIT_reloadDStream(&bitD2) | BIT_reloadDStream(&bitD3) | BIT_reloadDStream(&bitD4);
+ }
+
+ /* check corruption */
+ if (op1 > opStart2) return ERROR(corruption_detected);
+ if (op2 > opStart3) return ERROR(corruption_detected);
+ if (op3 > opStart4) return ERROR(corruption_detected);
+ /* note : op4 supposed already verified within main loop */
+
+ /* finish bitStreams one by one */
+ HUF_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
+ HUF_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
+ HUF_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
+ HUF_decodeStreamX2(op4, &bitD4, oend, dt, dtLog);
+
+ /* check */
+ endSignal = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
+ if (!endSignal) return ERROR(corruption_detected);
+
+ /* decoded size */
+ return dstSize;
+ }
+}
+
+
+size_t HUF_decompress4X2_usingDTable(
+ void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ const HUF_DTable* DTable)
+{
+ DTableDesc dtd = HUF_getDTableDesc(DTable);
+ if (dtd.tableType != 0) return ERROR(GENERIC);
+ return HUF_decompress4X2_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable);
+}
+
+
+size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ void* workSpace, size_t wkspSize)
+{
+ const BYTE* ip = (const BYTE*) cSrc;
+
+ size_t const hSize = HUF_readDTableX2_wksp (dctx, cSrc, cSrcSize,
+ workSpace, wkspSize);
+ if (HUF_isError(hSize)) return hSize;
+ if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
+ ip += hSize; cSrcSize -= hSize;
+
+ return HUF_decompress4X2_usingDTable_internal (dst, dstSize, ip, cSrcSize, dctx);
+}
+
+
+size_t HUF_decompress4X2_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];
+ return HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize,
+ workSpace, sizeof(workSpace));
+}
+size_t HUF_decompress4X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ HUF_CREATE_STATIC_DTABLEX2(DTable, HUF_TABLELOG_MAX);
+ return HUF_decompress4X2_DCtx(DTable, dst, dstSize, cSrc, cSrcSize);
+}
+
+
+/* *************************/
+/* double-symbols decoding */
+/* *************************/
+typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUF_DEltX4; /* double-symbols decoding */
+
+typedef struct { BYTE symbol; BYTE weight; } sortedSymbol_t;
+
+/* HUF_fillDTableX4Level2() :
+ * `rankValOrigin` must be a table of at least (HUF_TABLELOG_MAX + 1) U32 */
+static void HUF_fillDTableX4Level2(HUF_DEltX4* DTable, U32 sizeLog, const U32 consumed,
+ const U32* rankValOrigin, const int minWeight,
+ const sortedSymbol_t* sortedSymbols, const U32 sortedListSize,
+ U32 nbBitsBaseline, U16 baseSeq)
+{
+ HUF_DEltX4 DElt;
+ U32 rankVal[HUF_TABLELOG_MAX + 1];
+
+ /* get pre-calculated rankVal */
+ memcpy(rankVal, rankValOrigin, sizeof(rankVal));
+
+ /* fill skipped values */
+ if (minWeight>1) {
+ U32 i, skipSize = rankVal[minWeight];
+ MEM_writeLE16(&(DElt.sequence), baseSeq);
+ DElt.nbBits = (BYTE)(consumed);
+ DElt.length = 1;
+ for (i = 0; i < skipSize; i++)
+ DTable[i] = DElt;
+ }
+
+ /* fill DTable */
+ { U32 s; for (s=0; s<sortedListSize; s++) { /* note : sortedSymbols already skipped */
+ const U32 symbol = sortedSymbols[s].symbol;
+ const U32 weight = sortedSymbols[s].weight;
+ const U32 nbBits = nbBitsBaseline - weight;
+ const U32 length = 1 << (sizeLog-nbBits);
+ const U32 start = rankVal[weight];
+ U32 i = start;
+ const U32 end = start + length;
+
+ MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));
+ DElt.nbBits = (BYTE)(nbBits + consumed);
+ DElt.length = 2;
+ do { DTable[i++] = DElt; } while (i<end); /* since length >= 1 */
+
+ rankVal[weight] += length;
+ } }
+}
+
+typedef U32 rankValCol_t[HUF_TABLELOG_MAX + 1];
+typedef rankValCol_t rankVal_t[HUF_TABLELOG_MAX];
+
+static void HUF_fillDTableX4(HUF_DEltX4* DTable, const U32 targetLog,
+ const sortedSymbol_t* sortedList, const U32 sortedListSize,
+ const U32* rankStart, rankVal_t rankValOrigin, const U32 maxWeight,
+ const U32 nbBitsBaseline)
+{
+ U32 rankVal[HUF_TABLELOG_MAX + 1];
+ const int scaleLog = nbBitsBaseline - targetLog; /* note : targetLog >= srcLog, hence scaleLog <= 1 */
+ const U32 minBits = nbBitsBaseline - maxWeight;
+ U32 s;
+
+ memcpy(rankVal, rankValOrigin, sizeof(rankVal));
+
+ /* fill DTable */
+ for (s=0; s<sortedListSize; s++) {
+ const U16 symbol = sortedList[s].symbol;
+ const U32 weight = sortedList[s].weight;
+ const U32 nbBits = nbBitsBaseline - weight;
+ const U32 start = rankVal[weight];
+ const U32 length = 1 << (targetLog-nbBits);
+
+ if (targetLog-nbBits >= minBits) { /* enough room for a second symbol */
+ U32 sortedRank;
+ int minWeight = nbBits + scaleLog;
+ if (minWeight < 1) minWeight = 1;
+ sortedRank = rankStart[minWeight];
+ HUF_fillDTableX4Level2(DTable+start, targetLog-nbBits, nbBits,
+ rankValOrigin[nbBits], minWeight,
+ sortedList+sortedRank, sortedListSize-sortedRank,
+ nbBitsBaseline, symbol);
+ } else {
+ HUF_DEltX4 DElt;
+ MEM_writeLE16(&(DElt.sequence), symbol);
+ DElt.nbBits = (BYTE)(nbBits);
+ DElt.length = 1;
+ { U32 const end = start + length;
+ U32 u;
+ for (u = start; u < end; u++) DTable[u] = DElt;
+ } }
+ rankVal[weight] += length;
+ }
+}
+
+size_t HUF_readDTableX4_wksp(HUF_DTable* DTable, const void* src,
+ size_t srcSize, void* workSpace,
+ size_t wkspSize)
+{
+ U32 tableLog, maxW, sizeOfSort, nbSymbols;
+ DTableDesc dtd = HUF_getDTableDesc(DTable);
+ U32 const maxTableLog = dtd.maxTableLog;
+ size_t iSize;
+ void* dtPtr = DTable+1; /* force compiler to avoid strict-aliasing */
+ HUF_DEltX4* const dt = (HUF_DEltX4*)dtPtr;
+ U32 *rankStart;
+
+ rankValCol_t* rankVal;
+ U32* rankStats;
+ U32* rankStart0;
+ sortedSymbol_t* sortedSymbol;
+ BYTE* weightList;
+ size_t spaceUsed32 = 0;
+
+ rankVal = (rankValCol_t *)((U32 *)workSpace + spaceUsed32);
+ spaceUsed32 += (sizeof(rankValCol_t) * HUF_TABLELOG_MAX) >> 2;
+ rankStats = (U32 *)workSpace + spaceUsed32;
+ spaceUsed32 += HUF_TABLELOG_MAX + 1;
+ rankStart0 = (U32 *)workSpace + spaceUsed32;
+ spaceUsed32 += HUF_TABLELOG_MAX + 2;
+ sortedSymbol = (sortedSymbol_t *)workSpace + (spaceUsed32 * sizeof(U32)) / sizeof(sortedSymbol_t);
+ spaceUsed32 += HUF_ALIGN(sizeof(sortedSymbol_t) * (HUF_SYMBOLVALUE_MAX + 1), sizeof(U32)) >> 2;
+ weightList = (BYTE *)((U32 *)workSpace + spaceUsed32);
+ spaceUsed32 += HUF_ALIGN(HUF_SYMBOLVALUE_MAX + 1, sizeof(U32)) >> 2;
+
+ if ((spaceUsed32 << 2) > wkspSize)
+ return ERROR(tableLog_tooLarge);
+ workSpace = (U32 *)workSpace + spaceUsed32;
+ wkspSize -= (spaceUsed32 << 2);
+
+ rankStart = rankStart0 + 1;
+ memset(rankStats, 0, sizeof(U32) * (2 * HUF_TABLELOG_MAX + 2 + 1));
+
+ HUF_STATIC_ASSERT(sizeof(HUF_DEltX4) == sizeof(HUF_DTable)); /* if compiler fails here, assertion is wrong */
+ if (maxTableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge);
+ /* memset(weightList, 0, sizeof(weightList)); */ /* is not necessary, even though some analyzer complain ... */
+
+ iSize = HUF_readStats(weightList, HUF_SYMBOLVALUE_MAX + 1, rankStats, &nbSymbols, &tableLog, src, srcSize);
+ if (HUF_isError(iSize)) return iSize;
+
+ /* check result */
+ if (tableLog > maxTableLog) return ERROR(tableLog_tooLarge); /* DTable can't fit code depth */
+
+ /* find maxWeight */
+ for (maxW = tableLog; rankStats[maxW]==0; maxW--) {} /* necessarily finds a solution before 0 */
+
+ /* Get start index of each weight */
+ { U32 w, nextRankStart = 0;
+ for (w=1; w<maxW+1; w++) {
+ U32 current = nextRankStart;
+ nextRankStart += rankStats[w];
+ rankStart[w] = current;
+ }
+ rankStart[0] = nextRankStart; /* put all 0w symbols at the end of sorted list*/
+ sizeOfSort = nextRankStart;
+ }
+
+ /* sort symbols by weight */
+ { U32 s;
+ for (s=0; s<nbSymbols; s++) {
+ U32 const w = weightList[s];
+ U32 const r = rankStart[w]++;
+ sortedSymbol[r].symbol = (BYTE)s;
+ sortedSymbol[r].weight = (BYTE)w;
+ }
+ rankStart[0] = 0; /* forget 0w symbols; this is beginning of weight(1) */
+ }
+
+ /* Build rankVal */
+ { U32* const rankVal0 = rankVal[0];
+ { int const rescale = (maxTableLog-tableLog) - 1; /* tableLog <= maxTableLog */
+ U32 nextRankVal = 0;
+ U32 w;
+ for (w=1; w<maxW+1; w++) {
+ U32 current = nextRankVal;
+ nextRankVal += rankStats[w] << (w+rescale);
+ rankVal0[w] = current;
+ } }
+ { U32 const minBits = tableLog+1 - maxW;
+ U32 consumed;
+ for (consumed = minBits; consumed < maxTableLog - minBits + 1; consumed++) {
+ U32* const rankValPtr = rankVal[consumed];
+ U32 w;
+ for (w = 1; w < maxW+1; w++) {
+ rankValPtr[w] = rankVal0[w] >> consumed;
+ } } } }
+
+ HUF_fillDTableX4(dt, maxTableLog,
+ sortedSymbol, sizeOfSort,
+ rankStart0, rankVal, maxW,
+ tableLog+1);
+
+ dtd.tableLog = (BYTE)maxTableLog;
+ dtd.tableType = 1;
+ memcpy(DTable, &dtd, sizeof(dtd));
+ return iSize;
+}
+
+size_t HUF_readDTableX4(HUF_DTable* DTable, const void* src, size_t srcSize)
+{
+ U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];
+ return HUF_readDTableX4_wksp(DTable, src, srcSize,
+ workSpace, sizeof(workSpace));
+}
+
+static U32 HUF_decodeSymbolX4(void* op, BIT_DStream_t* DStream, const HUF_DEltX4* dt, const U32 dtLog)
+{
+ size_t const val = BIT_lookBitsFast(DStream, dtLog); /* note : dtLog >= 1 */
+ memcpy(op, dt+val, 2);
+ BIT_skipBits(DStream, dt[val].nbBits);
+ return dt[val].length;
+}
+
+static U32 HUF_decodeLastSymbolX4(void* op, BIT_DStream_t* DStream, const HUF_DEltX4* dt, const U32 dtLog)
+{
+ size_t const val = BIT_lookBitsFast(DStream, dtLog); /* note : dtLog >= 1 */
+ memcpy(op, dt+val, 1);
+ if (dt[val].length==1) BIT_skipBits(DStream, dt[val].nbBits);
+ else {
+ if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {
+ BIT_skipBits(DStream, dt[val].nbBits);
+ if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))
+ /* ugly hack; works only because it's the last symbol. Note : can't easily extract nbBits from just this symbol */
+ DStream->bitsConsumed = (sizeof(DStream->bitContainer)*8);
+ } }
+ return 1;
+}
+
+
+#define HUF_DECODE_SYMBOLX4_0(ptr, DStreamPtr) \
+ ptr += HUF_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
+
+#define HUF_DECODE_SYMBOLX4_1(ptr, DStreamPtr) \
+ if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \
+ ptr += HUF_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
+
+#define HUF_DECODE_SYMBOLX4_2(ptr, DStreamPtr) \
+ if (MEM_64bits()) \
+ ptr += HUF_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
+
+FORCE_INLINE size_t HUF_decodeStreamX4(BYTE* p, BIT_DStream_t* bitDPtr, BYTE* const pEnd, const HUF_DEltX4* const dt, const U32 dtLog)
+{
+ BYTE* const pStart = p;
+
+ /* up to 8 symbols at a time */
+ while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-(sizeof(bitDPtr->bitContainer)-1))) {
+ HUF_DECODE_SYMBOLX4_2(p, bitDPtr);
+ HUF_DECODE_SYMBOLX4_1(p, bitDPtr);
+ HUF_DECODE_SYMBOLX4_2(p, bitDPtr);
+ HUF_DECODE_SYMBOLX4_0(p, bitDPtr);
+ }
+
+ /* closer to end : up to 2 symbols at a time */
+ while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p <= pEnd-2))
+ HUF_DECODE_SYMBOLX4_0(p, bitDPtr);
+
+ while (p <= pEnd-2)
+ HUF_DECODE_SYMBOLX4_0(p, bitDPtr); /* no need to reload : reached the end of DStream */
+
+ if (p < pEnd)
+ p += HUF_decodeLastSymbolX4(p, bitDPtr, dt, dtLog);
+
+ return p-pStart;
+}
+
+
+static size_t HUF_decompress1X4_usingDTable_internal(
+ void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ const HUF_DTable* DTable)
+{
+ BIT_DStream_t bitD;
+
+ /* Init */
+ { size_t const errorCode = BIT_initDStream(&bitD, cSrc, cSrcSize);
+ if (HUF_isError(errorCode)) return errorCode;
+ }
+
+ /* decode */
+ { BYTE* const ostart = (BYTE*) dst;
+ BYTE* const oend = ostart + dstSize;
+ const void* const dtPtr = DTable+1; /* force compiler to not use strict-aliasing */
+ const HUF_DEltX4* const dt = (const HUF_DEltX4*)dtPtr;
+ DTableDesc const dtd = HUF_getDTableDesc(DTable);
+ HUF_decodeStreamX4(ostart, &bitD, oend, dt, dtd.tableLog);
+ }
+
+ /* check */
+ if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected);
+
+ /* decoded size */
+ return dstSize;
+}
+
+size_t HUF_decompress1X4_usingDTable(
+ void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ const HUF_DTable* DTable)
+{
+ DTableDesc dtd = HUF_getDTableDesc(DTable);
+ if (dtd.tableType != 1) return ERROR(GENERIC);
+ return HUF_decompress1X4_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable);
+}
+
+size_t HUF_decompress1X4_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ void* workSpace, size_t wkspSize)
+{
+ const BYTE* ip = (const BYTE*) cSrc;
+
+ size_t const hSize = HUF_readDTableX4_wksp(DCtx, cSrc, cSrcSize,
+ workSpace, wkspSize);
+ if (HUF_isError(hSize)) return hSize;
+ if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
+ ip += hSize; cSrcSize -= hSize;
+
+ return HUF_decompress1X4_usingDTable_internal (dst, dstSize, ip, cSrcSize, DCtx);
+}
+
+
+size_t HUF_decompress1X4_DCtx(HUF_DTable* DCtx, void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize)
+{
+ U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];
+ return HUF_decompress1X4_DCtx_wksp(DCtx, dst, dstSize, cSrc, cSrcSize,
+ workSpace, sizeof(workSpace));
+}
+
+size_t HUF_decompress1X4 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ HUF_CREATE_STATIC_DTABLEX4(DTable, HUF_TABLELOG_MAX);
+ return HUF_decompress1X4_DCtx(DTable, dst, dstSize, cSrc, cSrcSize);
+}
+
+static size_t HUF_decompress4X4_usingDTable_internal(
+ void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ const HUF_DTable* DTable)
+{
+ if (cSrcSize < 10) return ERROR(corruption_detected); /* strict minimum : jump table + 1 byte per stream */
+
+ { const BYTE* const istart = (const BYTE*) cSrc;
+ BYTE* const ostart = (BYTE*) dst;
+ BYTE* const oend = ostart + dstSize;
+ const void* const dtPtr = DTable+1;
+ const HUF_DEltX4* const dt = (const HUF_DEltX4*)dtPtr;
+
+ /* Init */
+ BIT_DStream_t bitD1;
+ BIT_DStream_t bitD2;
+ BIT_DStream_t bitD3;
+ BIT_DStream_t bitD4;
+ size_t const length1 = MEM_readLE16(istart);
+ size_t const length2 = MEM_readLE16(istart+2);
+ size_t const length3 = MEM_readLE16(istart+4);
+ size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
+ const BYTE* const istart1 = istart + 6; /* jumpTable */
+ const BYTE* const istart2 = istart1 + length1;
+ const BYTE* const istart3 = istart2 + length2;
+ const BYTE* const istart4 = istart3 + length3;
+ size_t const segmentSize = (dstSize+3) / 4;
+ BYTE* const opStart2 = ostart + segmentSize;
+ BYTE* const opStart3 = opStart2 + segmentSize;
+ BYTE* const opStart4 = opStart3 + segmentSize;
+ BYTE* op1 = ostart;
+ BYTE* op2 = opStart2;
+ BYTE* op3 = opStart3;
+ BYTE* op4 = opStart4;
+ U32 endSignal;
+ DTableDesc const dtd = HUF_getDTableDesc(DTable);
+ U32 const dtLog = dtd.tableLog;
+
+ if (length4 > cSrcSize) return ERROR(corruption_detected); /* overflow */
+ { size_t const errorCode = BIT_initDStream(&bitD1, istart1, length1);
+ if (HUF_isError(errorCode)) return errorCode; }
+ { size_t const errorCode = BIT_initDStream(&bitD2, istart2, length2);
+ if (HUF_isError(errorCode)) return errorCode; }
+ { size_t const errorCode = BIT_initDStream(&bitD3, istart3, length3);
+ if (HUF_isError(errorCode)) return errorCode; }
+ { size_t const errorCode = BIT_initDStream(&bitD4, istart4, length4);
+ if (HUF_isError(errorCode)) return errorCode; }
+
+ /* 16-32 symbols per loop (4-8 symbols per stream) */
+ endSignal = BIT_reloadDStream(&bitD1) | BIT_reloadDStream(&bitD2) | BIT_reloadDStream(&bitD3) | BIT_reloadDStream(&bitD4);
+ for ( ; (endSignal==BIT_DStream_unfinished) & (op4<(oend-(sizeof(bitD4.bitContainer)-1))) ; ) {
+ HUF_DECODE_SYMBOLX4_2(op1, &bitD1);
+ HUF_DECODE_SYMBOLX4_2(op2, &bitD2);
+ HUF_DECODE_SYMBOLX4_2(op3, &bitD3);
+ HUF_DECODE_SYMBOLX4_2(op4, &bitD4);
+ HUF_DECODE_SYMBOLX4_1(op1, &bitD1);
+ HUF_DECODE_SYMBOLX4_1(op2, &bitD2);
+ HUF_DECODE_SYMBOLX4_1(op3, &bitD3);
+ HUF_DECODE_SYMBOLX4_1(op4, &bitD4);
+ HUF_DECODE_SYMBOLX4_2(op1, &bitD1);
+ HUF_DECODE_SYMBOLX4_2(op2, &bitD2);
+ HUF_DECODE_SYMBOLX4_2(op3, &bitD3);
+ HUF_DECODE_SYMBOLX4_2(op4, &bitD4);
+ HUF_DECODE_SYMBOLX4_0(op1, &bitD1);
+ HUF_DECODE_SYMBOLX4_0(op2, &bitD2);
+ HUF_DECODE_SYMBOLX4_0(op3, &bitD3);
+ HUF_DECODE_SYMBOLX4_0(op4, &bitD4);
+
+ endSignal = BIT_reloadDStream(&bitD1) | BIT_reloadDStream(&bitD2) | BIT_reloadDStream(&bitD3) | BIT_reloadDStream(&bitD4);
+ }
+
+ /* check corruption */
+ if (op1 > opStart2) return ERROR(corruption_detected);
+ if (op2 > opStart3) return ERROR(corruption_detected);
+ if (op3 > opStart4) return ERROR(corruption_detected);
+ /* note : op4 already verified within main loop */
+
+ /* finish bitStreams one by one */
+ HUF_decodeStreamX4(op1, &bitD1, opStart2, dt, dtLog);
+ HUF_decodeStreamX4(op2, &bitD2, opStart3, dt, dtLog);
+ HUF_decodeStreamX4(op3, &bitD3, opStart4, dt, dtLog);
+ HUF_decodeStreamX4(op4, &bitD4, oend, dt, dtLog);
+
+ /* check */
+ { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
+ if (!endCheck) return ERROR(corruption_detected); }
+
+ /* decoded size */
+ return dstSize;
+ }
+}
+
+
+size_t HUF_decompress4X4_usingDTable(
+ void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ const HUF_DTable* DTable)
+{
+ DTableDesc dtd = HUF_getDTableDesc(DTable);
+ if (dtd.tableType != 1) return ERROR(GENERIC);
+ return HUF_decompress4X4_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable);
+}
+
+
+size_t HUF_decompress4X4_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ void* workSpace, size_t wkspSize)
+{
+ const BYTE* ip = (const BYTE*) cSrc;
+
+ size_t hSize = HUF_readDTableX4_wksp(dctx, cSrc, cSrcSize,
+ workSpace, wkspSize);
+ if (HUF_isError(hSize)) return hSize;
+ if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
+ ip += hSize; cSrcSize -= hSize;
+
+ return HUF_decompress4X4_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx);
+}
+
+
+size_t HUF_decompress4X4_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize)
+{
+ U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];
+ return HUF_decompress4X4_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize,
+ workSpace, sizeof(workSpace));
+}
+
+size_t HUF_decompress4X4 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ HUF_CREATE_STATIC_DTABLEX4(DTable, HUF_TABLELOG_MAX);
+ return HUF_decompress4X4_DCtx(DTable, dst, dstSize, cSrc, cSrcSize);
+}
+
+
+/* ********************************/
+/* Generic decompression selector */
+/* ********************************/
+
+size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize,
+ const void* cSrc, size_t cSrcSize,
+ const HUF_DTable* DTable)
+{
+ DTableDesc const dtd = HUF_getDTableDesc(DTable);
+ return dtd.tableType ? HUF_decompress1X4_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable) :
+ HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable);
+}
+
+size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize,
+ const void* cSrc, size_t cSrcSize,
+ const HUF_DTable* DTable)
+{
+ DTableDesc const dtd = HUF_getDTableDesc(DTable);
+ return dtd.tableType ? HUF_decompress4X4_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable) :
+ HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable);
+}
+
+
+typedef struct { U32 tableTime; U32 decode256Time; } algo_time_t;
+static const algo_time_t algoTime[16 /* Quantization */][3 /* single, double, quad */] =
+{
+ /* single, double, quad */
+ {{0,0}, {1,1}, {2,2}}, /* Q==0 : impossible */
+ {{0,0}, {1,1}, {2,2}}, /* Q==1 : impossible */
+ {{ 38,130}, {1313, 74}, {2151, 38}}, /* Q == 2 : 12-18% */
+ {{ 448,128}, {1353, 74}, {2238, 41}}, /* Q == 3 : 18-25% */
+ {{ 556,128}, {1353, 74}, {2238, 47}}, /* Q == 4 : 25-32% */
+ {{ 714,128}, {1418, 74}, {2436, 53}}, /* Q == 5 : 32-38% */
+ {{ 883,128}, {1437, 74}, {2464, 61}}, /* Q == 6 : 38-44% */
+ {{ 897,128}, {1515, 75}, {2622, 68}}, /* Q == 7 : 44-50% */
+ {{ 926,128}, {1613, 75}, {2730, 75}}, /* Q == 8 : 50-56% */
+ {{ 947,128}, {1729, 77}, {3359, 77}}, /* Q == 9 : 56-62% */
+ {{1107,128}, {2083, 81}, {4006, 84}}, /* Q ==10 : 62-69% */
+ {{1177,128}, {2379, 87}, {4785, 88}}, /* Q ==11 : 69-75% */
+ {{1242,128}, {2415, 93}, {5155, 84}}, /* Q ==12 : 75-81% */
+ {{1349,128}, {2644,106}, {5260,106}}, /* Q ==13 : 81-87% */
+ {{1455,128}, {2422,124}, {4174,124}}, /* Q ==14 : 87-93% */
+ {{ 722,128}, {1891,145}, {1936,146}}, /* Q ==15 : 93-99% */
+};
+
+/** HUF_selectDecoder() :
+* Tells which decoder is likely to decode faster,
+* based on a set of pre-determined metrics.
+* @return : 0==HUF_decompress4X2, 1==HUF_decompress4X4 .
+* Assumption : 0 < cSrcSize < dstSize <= 128 KB */
+U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize)
+{
+ /* decoder timing evaluation */
+ U32 const Q = (U32)(cSrcSize * 16 / dstSize); /* Q < 16 since dstSize > cSrcSize */
+ U32 const D256 = (U32)(dstSize >> 8);
+ U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256);
+ U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256);
+ DTime1 += DTime1 >> 3; /* advantage to algorithm using less memory, for cache eviction */
+
+ return DTime1 < DTime0;
+}
+
+
+typedef size_t (*decompressionAlgo)(void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
+
+size_t HUF_decompress (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ static const decompressionAlgo decompress[2] = { HUF_decompress4X2, HUF_decompress4X4 };
+
+ /* validation checks */
+ if (dstSize == 0) return ERROR(dstSize_tooSmall);
+ if (cSrcSize > dstSize) return ERROR(corruption_detected); /* invalid */
+ if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; } /* not compressed */
+ if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; } /* RLE */
+
+ { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
+ return decompress[algoNb](dst, dstSize, cSrc, cSrcSize);
+ }
+}
+
+size_t HUF_decompress4X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ /* validation checks */
+ if (dstSize == 0) return ERROR(dstSize_tooSmall);
+ if (cSrcSize > dstSize) return ERROR(corruption_detected); /* invalid */
+ if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; } /* not compressed */
+ if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; } /* RLE */
+
+ { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
+ return algoNb ? HUF_decompress4X4_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) :
+ HUF_decompress4X2_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) ;
+ }
+}
+
+size_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];
+ return HUF_decompress4X_hufOnly_wksp(dctx, dst, dstSize, cSrc, cSrcSize,
+ workSpace, sizeof(workSpace));
+}
+
+
+size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst,
+ size_t dstSize, const void* cSrc,
+ size_t cSrcSize, void* workSpace,
+ size_t wkspSize)
+{
+ /* validation checks */
+ if (dstSize == 0) return ERROR(dstSize_tooSmall);
+ if ((cSrcSize >= dstSize) || (cSrcSize <= 1)) return ERROR(corruption_detected); /* invalid */
+
+ { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
+ return algoNb ? HUF_decompress4X4_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize):
+ HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize);
+ }
+}
+
+size_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize,
+ void* workSpace, size_t wkspSize)
+{
+ /* validation checks */
+ if (dstSize == 0) return ERROR(dstSize_tooSmall);
+ if (cSrcSize > dstSize) return ERROR(corruption_detected); /* invalid */
+ if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; } /* not compressed */
+ if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; } /* RLE */
+
+ { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
+ return algoNb ? HUF_decompress1X4_DCtx_wksp(dctx, dst, dstSize, cSrc,
+ cSrcSize, workSpace, wkspSize):
+ HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc,
+ cSrcSize, workSpace, wkspSize);
+ }
+}
+
+size_t HUF_decompress1X_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize,
+ const void* cSrc, size_t cSrcSize)
+{
+ U32 workSpace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];
+ return HUF_decompress1X_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize,
+ workSpace, sizeof(workSpace));
+}
diff --git a/thirdparty/zstd/decompress/zstd_decompress.c b/thirdparty/zstd/decompress/zstd_decompress.c
new file mode 100644
index 0000000000..465bcc20b5
--- /dev/null
+++ b/thirdparty/zstd/decompress/zstd_decompress.c
@@ -0,0 +1,2491 @@
+/**
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+
+/* ***************************************************************
+* Tuning parameters
+*****************************************************************/
+/*!
+ * HEAPMODE :
+ * Select how default decompression function ZSTD_decompress() will allocate memory,
+ * in memory stack (0), or in memory heap (1, requires malloc())
+ */
+#ifndef ZSTD_HEAPMODE
+# define ZSTD_HEAPMODE 1
+#endif
+
+/*!
+* LEGACY_SUPPORT :
+* if set to 1, ZSTD_decompress() can decode older formats (v0.1+)
+*/
+#ifndef ZSTD_LEGACY_SUPPORT
+# define ZSTD_LEGACY_SUPPORT 0
+#endif
+
+/*!
+* MAXWINDOWSIZE_DEFAULT :
+* maximum window size accepted by DStream, by default.
+* Frames requiring more memory will be rejected.
+*/
+#ifndef ZSTD_MAXWINDOWSIZE_DEFAULT
+# define ZSTD_MAXWINDOWSIZE_DEFAULT ((1 << ZSTD_WINDOWLOG_MAX) + 1) /* defined within zstd.h */
+#endif
+
+
+/*-*******************************************************
+* Dependencies
+*********************************************************/
+#include <string.h> /* memcpy, memmove, memset */
+#include "mem.h" /* low level memory routines */
+#define FSE_STATIC_LINKING_ONLY
+#include "fse.h"
+#define HUF_STATIC_LINKING_ONLY
+#include "huf.h"
+#include "zstd_internal.h"
+
+#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
+# include "zstd_legacy.h"
+#endif
+
+#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86)) /* _mm_prefetch() is not defined outside of x86/x64 */
+# include <mmintrin.h> /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */
+# define ZSTD_PREFETCH(ptr) _mm_prefetch((const char*)ptr, _MM_HINT_T0)
+#elif defined(__GNUC__)
+# define ZSTD_PREFETCH(ptr) __builtin_prefetch(ptr, 0, 0)
+#else
+# define ZSTD_PREFETCH(ptr) /* disabled */
+#endif
+
+
+/*-*************************************
+* Errors
+***************************************/
+#define ZSTD_isError ERR_isError /* for inlining */
+#define FSE_isError ERR_isError
+#define HUF_isError ERR_isError
+
+
+/*_*******************************************************
+* Memory operations
+**********************************************************/
+static void ZSTD_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
+
+
+/*-*************************************************************
+* Context management
+***************************************************************/
+typedef enum { ZSTDds_getFrameHeaderSize, ZSTDds_decodeFrameHeader,
+ ZSTDds_decodeBlockHeader, ZSTDds_decompressBlock,
+ ZSTDds_decompressLastBlock, ZSTDds_checkChecksum,
+ ZSTDds_decodeSkippableHeader, ZSTDds_skipFrame } ZSTD_dStage;
+
+typedef enum { zdss_init=0, zdss_loadHeader,
+ zdss_read, zdss_load, zdss_flush } ZSTD_dStreamStage;
+
+typedef struct {
+ FSE_DTable LLTable[FSE_DTABLE_SIZE_U32(LLFSELog)];
+ FSE_DTable OFTable[FSE_DTABLE_SIZE_U32(OffFSELog)];
+ FSE_DTable MLTable[FSE_DTABLE_SIZE_U32(MLFSELog)];
+ HUF_DTable hufTable[HUF_DTABLE_SIZE(HufLog)]; /* can accommodate HUF_decompress4X */
+ U32 workspace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];
+ U32 rep[ZSTD_REP_NUM];
+} ZSTD_entropyTables_t;
+
+struct ZSTD_DCtx_s
+{
+ const FSE_DTable* LLTptr;
+ const FSE_DTable* MLTptr;
+ const FSE_DTable* OFTptr;
+ const HUF_DTable* HUFptr;
+ ZSTD_entropyTables_t entropy;
+ const void* previousDstEnd; /* detect continuity */
+ const void* base; /* start of current segment */
+ const void* vBase; /* virtual start of previous segment if it was just before current one */
+ const void* dictEnd; /* end of previous segment */
+ size_t expected;
+ ZSTD_frameHeader fParams;
+ blockType_e bType; /* used in ZSTD_decompressContinue(), to transfer blockType between header decoding and block decoding stages */
+ ZSTD_dStage stage;
+ U32 litEntropy;
+ U32 fseEntropy;
+ XXH64_state_t xxhState;
+ size_t headerSize;
+ U32 dictID;
+ const BYTE* litPtr;
+ ZSTD_customMem customMem;
+ size_t litSize;
+ size_t rleSize;
+ size_t staticSize;
+
+ /* streaming */
+ ZSTD_DDict* ddictLocal;
+ const ZSTD_DDict* ddict;
+ ZSTD_dStreamStage streamStage;
+ char* inBuff;
+ size_t inBuffSize;
+ size_t inPos;
+ size_t maxWindowSize;
+ char* outBuff;
+ size_t outBuffSize;
+ size_t outStart;
+ size_t outEnd;
+ size_t blockSize;
+ size_t lhSize;
+ void* legacyContext;
+ U32 previousLegacyVersion;
+ U32 legacyVersion;
+ U32 hostageByte;
+
+ /* workspace */
+ BYTE litBuffer[ZSTD_BLOCKSIZE_MAX + WILDCOPY_OVERLENGTH];
+ BYTE headerBuffer[ZSTD_FRAMEHEADERSIZE_MAX];
+}; /* typedef'd to ZSTD_DCtx within "zstd.h" */
+
+size_t ZSTD_sizeof_DCtx (const ZSTD_DCtx* dctx)
+{
+ if (dctx==NULL) return 0; /* support sizeof NULL */
+ return sizeof(*dctx)
+ + ZSTD_sizeof_DDict(dctx->ddictLocal)
+ + dctx->inBuffSize + dctx->outBuffSize;
+}
+
+size_t ZSTD_estimateDCtxSize(void) { return sizeof(ZSTD_DCtx); }
+
+size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx)
+{
+ dctx->expected = ZSTD_frameHeaderSize_prefix;
+ dctx->stage = ZSTDds_getFrameHeaderSize;
+ dctx->previousDstEnd = NULL;
+ dctx->base = NULL;
+ dctx->vBase = NULL;
+ dctx->dictEnd = NULL;
+ dctx->entropy.hufTable[0] = (HUF_DTable)((HufLog)*0x1000001); /* cover both little and big endian */
+ dctx->litEntropy = dctx->fseEntropy = 0;
+ dctx->dictID = 0;
+ MEM_STATIC_ASSERT(sizeof(dctx->entropy.rep) == sizeof(repStartValue));
+ memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue)); /* initial repcodes */
+ dctx->LLTptr = dctx->entropy.LLTable;
+ dctx->MLTptr = dctx->entropy.MLTable;
+ dctx->OFTptr = dctx->entropy.OFTable;
+ dctx->HUFptr = dctx->entropy.hufTable;
+ return 0;
+}
+
+static void ZSTD_initDCtx_internal(ZSTD_DCtx* dctx)
+{
+ ZSTD_decompressBegin(dctx); /* cannot fail */
+ dctx->staticSize = 0;
+ dctx->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT;
+ dctx->ddict = NULL;
+ dctx->ddictLocal = NULL;
+ dctx->inBuff = NULL;
+ dctx->inBuffSize = 0;
+ dctx->outBuffSize= 0;
+ dctx->streamStage = zdss_init;
+}
+
+ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem)
+{
+ if (!customMem.customAlloc ^ !customMem.customFree) return NULL;
+
+ { ZSTD_DCtx* const dctx = (ZSTD_DCtx*)ZSTD_malloc(sizeof(*dctx), customMem);
+ if (!dctx) return NULL;
+ dctx->customMem = customMem;
+ dctx->legacyContext = NULL;
+ dctx->previousLegacyVersion = 0;
+ ZSTD_initDCtx_internal(dctx);
+ return dctx;
+ }
+}
+
+ZSTD_DCtx* ZSTD_initStaticDCtx(void *workspace, size_t workspaceSize)
+{
+ ZSTD_DCtx* dctx = (ZSTD_DCtx*) workspace;
+
+ if ((size_t)workspace & 7) return NULL; /* 8-aligned */
+ if (workspaceSize < sizeof(ZSTD_DCtx)) return NULL; /* minimum size */
+
+ ZSTD_initDCtx_internal(dctx);
+ dctx->staticSize = workspaceSize;
+ dctx->inBuff = (char*)(dctx+1);
+ return dctx;
+}
+
+ZSTD_DCtx* ZSTD_createDCtx(void)
+{
+ return ZSTD_createDCtx_advanced(ZSTD_defaultCMem);
+}
+
+size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx)
+{
+ if (dctx==NULL) return 0; /* support free on NULL */
+ if (dctx->staticSize) return ERROR(memory_allocation); /* not compatible with static DCtx */
+ { ZSTD_customMem const cMem = dctx->customMem;
+ ZSTD_freeDDict(dctx->ddictLocal);
+ dctx->ddictLocal = NULL;
+ ZSTD_free(dctx->inBuff, cMem);
+ dctx->inBuff = NULL;
+#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
+ if (dctx->legacyContext)
+ ZSTD_freeLegacyStreamContext(dctx->legacyContext, dctx->previousLegacyVersion);
+#endif
+ ZSTD_free(dctx, cMem);
+ return 0;
+ }
+}
+
+/* no longer useful */
+void ZSTD_copyDCtx(ZSTD_DCtx* dstDCtx, const ZSTD_DCtx* srcDCtx)
+{
+ size_t const toCopy = (size_t)((char*)(&dstDCtx->inBuff) - (char*)dstDCtx);
+ memcpy(dstDCtx, srcDCtx, toCopy); /* no need to copy workspace */
+}
+
+
+/*-*************************************************************
+* Decompression section
+***************************************************************/
+
+/*! ZSTD_isFrame() :
+ * Tells if the content of `buffer` starts with a valid Frame Identifier.
+ * Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0.
+ * Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled.
+ * Note 3 : Skippable Frame Identifiers are considered valid. */
+unsigned ZSTD_isFrame(const void* buffer, size_t size)
+{
+ if (size < 4) return 0;
+ { U32 const magic = MEM_readLE32(buffer);
+ if (magic == ZSTD_MAGICNUMBER) return 1;
+ if ((magic & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) return 1;
+ }
+#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
+ if (ZSTD_isLegacy(buffer, size)) return 1;
+#endif
+ return 0;
+}
+
+
+/** ZSTD_frameHeaderSize() :
+* srcSize must be >= ZSTD_frameHeaderSize_prefix.
+* @return : size of the Frame Header */
+size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize)
+{
+ if (srcSize < ZSTD_frameHeaderSize_prefix) return ERROR(srcSize_wrong);
+ { BYTE const fhd = ((const BYTE*)src)[4];
+ U32 const dictID= fhd & 3;
+ U32 const singleSegment = (fhd >> 5) & 1;
+ U32 const fcsId = fhd >> 6;
+ return ZSTD_frameHeaderSize_prefix + !singleSegment + ZSTD_did_fieldSize[dictID] + ZSTD_fcs_fieldSize[fcsId]
+ + (singleSegment && !fcsId);
+ }
+}
+
+
+/** ZSTD_getFrameHeader() :
+* decode Frame Header, or require larger `srcSize`.
+* @return : 0, `zfhPtr` is correctly filled,
+* >0, `srcSize` is too small, result is expected `srcSize`,
+* or an error code, which can be tested using ZSTD_isError() */
+size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize)
+{
+ const BYTE* ip = (const BYTE*)src;
+ if (srcSize < ZSTD_frameHeaderSize_prefix) return ZSTD_frameHeaderSize_prefix;
+
+ if (MEM_readLE32(src) != ZSTD_MAGICNUMBER) {
+ if ((MEM_readLE32(src) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) {
+ /* skippable frame */
+ if (srcSize < ZSTD_skippableHeaderSize)
+ return ZSTD_skippableHeaderSize; /* magic number + frame length */
+ memset(zfhPtr, 0, sizeof(*zfhPtr));
+ zfhPtr->frameContentSize = MEM_readLE32((const char *)src + 4);
+ zfhPtr->windowSize = 0; /* windowSize==0 means a frame is skippable */
+ return 0;
+ }
+ return ERROR(prefix_unknown);
+ }
+
+ /* ensure there is enough `srcSize` to fully read/decode frame header */
+ { size_t const fhsize = ZSTD_frameHeaderSize(src, srcSize);
+ if (srcSize < fhsize) return fhsize; }
+
+ { BYTE const fhdByte = ip[4];
+ size_t pos = 5;
+ U32 const dictIDSizeCode = fhdByte&3;
+ U32 const checksumFlag = (fhdByte>>2)&1;
+ U32 const singleSegment = (fhdByte>>5)&1;
+ U32 const fcsID = fhdByte>>6;
+ U32 const windowSizeMax = 1U << ZSTD_WINDOWLOG_MAX;
+ U32 windowSize = 0;
+ U32 dictID = 0;
+ U64 frameContentSize = 0;
+ if ((fhdByte & 0x08) != 0)
+ return ERROR(frameParameter_unsupported); /* reserved bits, must be zero */
+ if (!singleSegment) {
+ BYTE const wlByte = ip[pos++];
+ U32 const windowLog = (wlByte >> 3) + ZSTD_WINDOWLOG_ABSOLUTEMIN;
+ if (windowLog > ZSTD_WINDOWLOG_MAX)
+ return ERROR(frameParameter_windowTooLarge);
+ windowSize = (1U << windowLog);
+ windowSize += (windowSize >> 3) * (wlByte&7);
+ }
+
+ switch(dictIDSizeCode)
+ {
+ default: /* impossible */
+ case 0 : break;
+ case 1 : dictID = ip[pos]; pos++; break;
+ case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;
+ case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;
+ }
+ switch(fcsID)
+ {
+ default: /* impossible */
+ case 0 : if (singleSegment) frameContentSize = ip[pos]; break;
+ case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;
+ case 2 : frameContentSize = MEM_readLE32(ip+pos); break;
+ case 3 : frameContentSize = MEM_readLE64(ip+pos); break;
+ }
+ if (!windowSize) windowSize = (U32)frameContentSize;
+ if (windowSize > windowSizeMax) return ERROR(frameParameter_windowTooLarge);
+ zfhPtr->frameContentSize = frameContentSize;
+ zfhPtr->windowSize = windowSize;
+ zfhPtr->dictID = dictID;
+ zfhPtr->checksumFlag = checksumFlag;
+ }
+ return 0;
+}
+
+/** ZSTD_getFrameContentSize() :
+* compatible with legacy mode
+* @return : decompressed size of the single frame pointed to be `src` if known, otherwise
+* - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined
+* - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small) */
+unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize)
+{
+#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
+ if (ZSTD_isLegacy(src, srcSize)) {
+ unsigned long long const ret = ZSTD_getDecompressedSize_legacy(src, srcSize);
+ return ret == 0 ? ZSTD_CONTENTSIZE_UNKNOWN : ret;
+ }
+#endif
+ { ZSTD_frameHeader fParams;
+ if (ZSTD_getFrameHeader(&fParams, src, srcSize) != 0) return ZSTD_CONTENTSIZE_ERROR;
+ if (fParams.windowSize == 0) {
+ /* Either skippable or empty frame, size == 0 either way */
+ return 0;
+ } else if (fParams.frameContentSize != 0) {
+ return fParams.frameContentSize;
+ } else {
+ return ZSTD_CONTENTSIZE_UNKNOWN;
+ }
+ }
+}
+
+/** ZSTD_findDecompressedSize() :
+ * compatible with legacy mode
+ * `srcSize` must be the exact length of some number of ZSTD compressed and/or
+ * skippable frames
+ * @return : decompressed size of the frames contained */
+unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize)
+{
+ unsigned long long totalDstSize = 0;
+
+ while (srcSize >= ZSTD_frameHeaderSize_prefix) {
+ const U32 magicNumber = MEM_readLE32(src);
+
+ if ((magicNumber & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) {
+ size_t skippableSize;
+ if (srcSize < ZSTD_skippableHeaderSize)
+ return ERROR(srcSize_wrong);
+ skippableSize = MEM_readLE32((const BYTE *)src + 4) +
+ ZSTD_skippableHeaderSize;
+ if (srcSize < skippableSize) {
+ return ZSTD_CONTENTSIZE_ERROR;
+ }
+
+ src = (const BYTE *)src + skippableSize;
+ srcSize -= skippableSize;
+ continue;
+ }
+
+ { unsigned long long const ret = ZSTD_getFrameContentSize(src, srcSize);
+ if (ret >= ZSTD_CONTENTSIZE_ERROR) return ret;
+
+ /* check for overflow */
+ if (totalDstSize + ret < totalDstSize) return ZSTD_CONTENTSIZE_ERROR;
+ totalDstSize += ret;
+ }
+ { size_t const frameSrcSize = ZSTD_findFrameCompressedSize(src, srcSize);
+ if (ZSTD_isError(frameSrcSize)) {
+ return ZSTD_CONTENTSIZE_ERROR;
+ }
+
+ src = (const BYTE *)src + frameSrcSize;
+ srcSize -= frameSrcSize;
+ }
+ }
+
+ if (srcSize) {
+ return ZSTD_CONTENTSIZE_ERROR;
+ }
+
+ return totalDstSize;
+}
+
+/** ZSTD_getDecompressedSize() :
+* compatible with legacy mode
+* @return : decompressed size if known, 0 otherwise
+ note : 0 can mean any of the following :
+ - decompressed size is not present within frame header
+ - frame header unknown / not supported
+ - frame header not complete (`srcSize` too small) */
+unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize)
+{
+ unsigned long long const ret = ZSTD_getFrameContentSize(src, srcSize);
+ return ret >= ZSTD_CONTENTSIZE_ERROR ? 0 : ret;
+}
+
+
+/** ZSTD_decodeFrameHeader() :
+* `headerSize` must be the size provided by ZSTD_frameHeaderSize().
+* @return : 0 if success, or an error code, which can be tested using ZSTD_isError() */
+static size_t ZSTD_decodeFrameHeader(ZSTD_DCtx* dctx, const void* src, size_t headerSize)
+{
+ size_t const result = ZSTD_getFrameHeader(&(dctx->fParams), src, headerSize);
+ if (ZSTD_isError(result)) return result; /* invalid header */
+ if (result>0) return ERROR(srcSize_wrong); /* headerSize too small */
+ if (dctx->fParams.dictID && (dctx->dictID != dctx->fParams.dictID)) return ERROR(dictionary_wrong);
+ if (dctx->fParams.checksumFlag) XXH64_reset(&dctx->xxhState, 0);
+ return 0;
+}
+
+
+/*! ZSTD_getcBlockSize() :
+* Provides the size of compressed block from block header `src` */
+size_t ZSTD_getcBlockSize(const void* src, size_t srcSize,
+ blockProperties_t* bpPtr)
+{
+ if (srcSize < ZSTD_blockHeaderSize) return ERROR(srcSize_wrong);
+ { U32 const cBlockHeader = MEM_readLE24(src);
+ U32 const cSize = cBlockHeader >> 3;
+ bpPtr->lastBlock = cBlockHeader & 1;
+ bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3);
+ bpPtr->origSize = cSize; /* only useful for RLE */
+ if (bpPtr->blockType == bt_rle) return 1;
+ if (bpPtr->blockType == bt_reserved) return ERROR(corruption_detected);
+ return cSize;
+ }
+}
+
+
+static size_t ZSTD_copyRawBlock(void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize)
+{
+ if (srcSize > dstCapacity) return ERROR(dstSize_tooSmall);
+ memcpy(dst, src, srcSize);
+ return srcSize;
+}
+
+
+static size_t ZSTD_setRleBlock(void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ size_t regenSize)
+{
+ if (srcSize != 1) return ERROR(srcSize_wrong);
+ if (regenSize > dstCapacity) return ERROR(dstSize_tooSmall);
+ memset(dst, *(const BYTE*)src, regenSize);
+ return regenSize;
+}
+
+/*! ZSTD_decodeLiteralsBlock() :
+ @return : nb of bytes read from src (< srcSize ) */
+size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
+ const void* src, size_t srcSize) /* note : srcSize < BLOCKSIZE */
+{
+ if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
+
+ { const BYTE* const istart = (const BYTE*) src;
+ symbolEncodingType_e const litEncType = (symbolEncodingType_e)(istart[0] & 3);
+
+ switch(litEncType)
+ {
+ case set_repeat:
+ if (dctx->litEntropy==0) return ERROR(dictionary_corrupted);
+ /* fall-through */
+ case set_compressed:
+ if (srcSize < 5) return ERROR(corruption_detected); /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for case 3 */
+ { size_t lhSize, litSize, litCSize;
+ U32 singleStream=0;
+ U32 const lhlCode = (istart[0] >> 2) & 3;
+ U32 const lhc = MEM_readLE32(istart);
+ switch(lhlCode)
+ {
+ case 0: case 1: default: /* note : default is impossible, since lhlCode into [0..3] */
+ /* 2 - 2 - 10 - 10 */
+ singleStream = !lhlCode;
+ lhSize = 3;
+ litSize = (lhc >> 4) & 0x3FF;
+ litCSize = (lhc >> 14) & 0x3FF;
+ break;
+ case 2:
+ /* 2 - 2 - 14 - 14 */
+ lhSize = 4;
+ litSize = (lhc >> 4) & 0x3FFF;
+ litCSize = lhc >> 18;
+ break;
+ case 3:
+ /* 2 - 2 - 18 - 18 */
+ lhSize = 5;
+ litSize = (lhc >> 4) & 0x3FFFF;
+ litCSize = (lhc >> 22) + (istart[4] << 10);
+ break;
+ }
+ if (litSize > ZSTD_BLOCKSIZE_MAX) return ERROR(corruption_detected);
+ if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
+
+ if (HUF_isError((litEncType==set_repeat) ?
+ ( singleStream ?
+ HUF_decompress1X_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->HUFptr) :
+ HUF_decompress4X_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->HUFptr) ) :
+ ( singleStream ?
+ HUF_decompress1X2_DCtx_wksp(dctx->entropy.hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize,
+ dctx->entropy.workspace, sizeof(dctx->entropy.workspace)) :
+ HUF_decompress4X_hufOnly_wksp(dctx->entropy.hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize,
+ dctx->entropy.workspace, sizeof(dctx->entropy.workspace)))))
+ return ERROR(corruption_detected);
+
+ dctx->litPtr = dctx->litBuffer;
+ dctx->litSize = litSize;
+ dctx->litEntropy = 1;
+ if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable;
+ memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
+ return litCSize + lhSize;
+ }
+
+ case set_basic:
+ { size_t litSize, lhSize;
+ U32 const lhlCode = ((istart[0]) >> 2) & 3;
+ switch(lhlCode)
+ {
+ case 0: case 2: default: /* note : default is impossible, since lhlCode into [0..3] */
+ lhSize = 1;
+ litSize = istart[0] >> 3;
+ break;
+ case 1:
+ lhSize = 2;
+ litSize = MEM_readLE16(istart) >> 4;
+ break;
+ case 3:
+ lhSize = 3;
+ litSize = MEM_readLE24(istart) >> 4;
+ break;
+ }
+
+ if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) { /* risk reading beyond src buffer with wildcopy */
+ if (litSize+lhSize > srcSize) return ERROR(corruption_detected);
+ memcpy(dctx->litBuffer, istart+lhSize, litSize);
+ dctx->litPtr = dctx->litBuffer;
+ dctx->litSize = litSize;
+ memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
+ return lhSize+litSize;
+ }
+ /* direct reference into compressed stream */
+ dctx->litPtr = istart+lhSize;
+ dctx->litSize = litSize;
+ return lhSize+litSize;
+ }
+
+ case set_rle:
+ { U32 const lhlCode = ((istart[0]) >> 2) & 3;
+ size_t litSize, lhSize;
+ switch(lhlCode)
+ {
+ case 0: case 2: default: /* note : default is impossible, since lhlCode into [0..3] */
+ lhSize = 1;
+ litSize = istart[0] >> 3;
+ break;
+ case 1:
+ lhSize = 2;
+ litSize = MEM_readLE16(istart) >> 4;
+ break;
+ case 3:
+ lhSize = 3;
+ litSize = MEM_readLE24(istart) >> 4;
+ if (srcSize<4) return ERROR(corruption_detected); /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need lhSize+1 = 4 */
+ break;
+ }
+ if (litSize > ZSTD_BLOCKSIZE_MAX) return ERROR(corruption_detected);
+ memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);
+ dctx->litPtr = dctx->litBuffer;
+ dctx->litSize = litSize;
+ return lhSize+1;
+ }
+ default:
+ return ERROR(corruption_detected); /* impossible */
+ }
+ }
+}
+
+
+typedef union {
+ FSE_decode_t realData;
+ U32 alignedBy4;
+} FSE_decode_t4;
+
+/* Default FSE distribution table for Literal Lengths */
+static const FSE_decode_t4 LL_defaultDTable[(1<<LL_DEFAULTNORMLOG)+1] = {
+ { { LL_DEFAULTNORMLOG, 1, 1 } }, /* header : tableLog, fastMode, fastMode */
+ /* base, symbol, bits */
+ { { 0, 0, 4 } }, { { 16, 0, 4 } }, { { 32, 1, 5 } }, { { 0, 3, 5 } },
+ { { 0, 4, 5 } }, { { 0, 6, 5 } }, { { 0, 7, 5 } }, { { 0, 9, 5 } },
+ { { 0, 10, 5 } }, { { 0, 12, 5 } }, { { 0, 14, 6 } }, { { 0, 16, 5 } },
+ { { 0, 18, 5 } }, { { 0, 19, 5 } }, { { 0, 21, 5 } }, { { 0, 22, 5 } },
+ { { 0, 24, 5 } }, { { 32, 25, 5 } }, { { 0, 26, 5 } }, { { 0, 27, 6 } },
+ { { 0, 29, 6 } }, { { 0, 31, 6 } }, { { 32, 0, 4 } }, { { 0, 1, 4 } },
+ { { 0, 2, 5 } }, { { 32, 4, 5 } }, { { 0, 5, 5 } }, { { 32, 7, 5 } },
+ { { 0, 8, 5 } }, { { 32, 10, 5 } }, { { 0, 11, 5 } }, { { 0, 13, 6 } },
+ { { 32, 16, 5 } }, { { 0, 17, 5 } }, { { 32, 19, 5 } }, { { 0, 20, 5 } },
+ { { 32, 22, 5 } }, { { 0, 23, 5 } }, { { 0, 25, 4 } }, { { 16, 25, 4 } },
+ { { 32, 26, 5 } }, { { 0, 28, 6 } }, { { 0, 30, 6 } }, { { 48, 0, 4 } },
+ { { 16, 1, 4 } }, { { 32, 2, 5 } }, { { 32, 3, 5 } }, { { 32, 5, 5 } },
+ { { 32, 6, 5 } }, { { 32, 8, 5 } }, { { 32, 9, 5 } }, { { 32, 11, 5 } },
+ { { 32, 12, 5 } }, { { 0, 15, 6 } }, { { 32, 17, 5 } }, { { 32, 18, 5 } },
+ { { 32, 20, 5 } }, { { 32, 21, 5 } }, { { 32, 23, 5 } }, { { 32, 24, 5 } },
+ { { 0, 35, 6 } }, { { 0, 34, 6 } }, { { 0, 33, 6 } }, { { 0, 32, 6 } },
+}; /* LL_defaultDTable */
+
+/* Default FSE distribution table for Match Lengths */
+static const FSE_decode_t4 ML_defaultDTable[(1<<ML_DEFAULTNORMLOG)+1] = {
+ { { ML_DEFAULTNORMLOG, 1, 1 } }, /* header : tableLog, fastMode, fastMode */
+ /* base, symbol, bits */
+ { { 0, 0, 6 } }, { { 0, 1, 4 } }, { { 32, 2, 5 } }, { { 0, 3, 5 } },
+ { { 0, 5, 5 } }, { { 0, 6, 5 } }, { { 0, 8, 5 } }, { { 0, 10, 6 } },
+ { { 0, 13, 6 } }, { { 0, 16, 6 } }, { { 0, 19, 6 } }, { { 0, 22, 6 } },
+ { { 0, 25, 6 } }, { { 0, 28, 6 } }, { { 0, 31, 6 } }, { { 0, 33, 6 } },
+ { { 0, 35, 6 } }, { { 0, 37, 6 } }, { { 0, 39, 6 } }, { { 0, 41, 6 } },
+ { { 0, 43, 6 } }, { { 0, 45, 6 } }, { { 16, 1, 4 } }, { { 0, 2, 4 } },
+ { { 32, 3, 5 } }, { { 0, 4, 5 } }, { { 32, 6, 5 } }, { { 0, 7, 5 } },
+ { { 0, 9, 6 } }, { { 0, 12, 6 } }, { { 0, 15, 6 } }, { { 0, 18, 6 } },
+ { { 0, 21, 6 } }, { { 0, 24, 6 } }, { { 0, 27, 6 } }, { { 0, 30, 6 } },
+ { { 0, 32, 6 } }, { { 0, 34, 6 } }, { { 0, 36, 6 } }, { { 0, 38, 6 } },
+ { { 0, 40, 6 } }, { { 0, 42, 6 } }, { { 0, 44, 6 } }, { { 32, 1, 4 } },
+ { { 48, 1, 4 } }, { { 16, 2, 4 } }, { { 32, 4, 5 } }, { { 32, 5, 5 } },
+ { { 32, 7, 5 } }, { { 32, 8, 5 } }, { { 0, 11, 6 } }, { { 0, 14, 6 } },
+ { { 0, 17, 6 } }, { { 0, 20, 6 } }, { { 0, 23, 6 } }, { { 0, 26, 6 } },
+ { { 0, 29, 6 } }, { { 0, 52, 6 } }, { { 0, 51, 6 } }, { { 0, 50, 6 } },
+ { { 0, 49, 6 } }, { { 0, 48, 6 } }, { { 0, 47, 6 } }, { { 0, 46, 6 } },
+}; /* ML_defaultDTable */
+
+/* Default FSE distribution table for Offset Codes */
+static const FSE_decode_t4 OF_defaultDTable[(1<<OF_DEFAULTNORMLOG)+1] = {
+ { { OF_DEFAULTNORMLOG, 1, 1 } }, /* header : tableLog, fastMode, fastMode */
+ /* base, symbol, bits */
+ { { 0, 0, 5 } }, { { 0, 6, 4 } },
+ { { 0, 9, 5 } }, { { 0, 15, 5 } },
+ { { 0, 21, 5 } }, { { 0, 3, 5 } },
+ { { 0, 7, 4 } }, { { 0, 12, 5 } },
+ { { 0, 18, 5 } }, { { 0, 23, 5 } },
+ { { 0, 5, 5 } }, { { 0, 8, 4 } },
+ { { 0, 14, 5 } }, { { 0, 20, 5 } },
+ { { 0, 2, 5 } }, { { 16, 7, 4 } },
+ { { 0, 11, 5 } }, { { 0, 17, 5 } },
+ { { 0, 22, 5 } }, { { 0, 4, 5 } },
+ { { 16, 8, 4 } }, { { 0, 13, 5 } },
+ { { 0, 19, 5 } }, { { 0, 1, 5 } },
+ { { 16, 6, 4 } }, { { 0, 10, 5 } },
+ { { 0, 16, 5 } }, { { 0, 28, 5 } },
+ { { 0, 27, 5 } }, { { 0, 26, 5 } },
+ { { 0, 25, 5 } }, { { 0, 24, 5 } },
+}; /* OF_defaultDTable */
+
+/*! ZSTD_buildSeqTable() :
+ @return : nb bytes read from src,
+ or an error code if it fails, testable with ZSTD_isError()
+*/
+static size_t ZSTD_buildSeqTable(FSE_DTable* DTableSpace, const FSE_DTable** DTablePtr,
+ symbolEncodingType_e type, U32 max, U32 maxLog,
+ const void* src, size_t srcSize,
+ const FSE_decode_t4* defaultTable, U32 flagRepeatTable)
+{
+ const void* const tmpPtr = defaultTable; /* bypass strict aliasing */
+ switch(type)
+ {
+ case set_rle :
+ if (!srcSize) return ERROR(srcSize_wrong);
+ if ( (*(const BYTE*)src) > max) return ERROR(corruption_detected);
+ FSE_buildDTable_rle(DTableSpace, *(const BYTE*)src);
+ *DTablePtr = DTableSpace;
+ return 1;
+ case set_basic :
+ *DTablePtr = (const FSE_DTable*)tmpPtr;
+ return 0;
+ case set_repeat:
+ if (!flagRepeatTable) return ERROR(corruption_detected);
+ return 0;
+ default : /* impossible */
+ case set_compressed :
+ { U32 tableLog;
+ S16 norm[MaxSeq+1];
+ size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize);
+ if (FSE_isError(headerSize)) return ERROR(corruption_detected);
+ if (tableLog > maxLog) return ERROR(corruption_detected);
+ FSE_buildDTable(DTableSpace, norm, max, tableLog);
+ *DTablePtr = DTableSpace;
+ return headerSize;
+ } }
+}
+
+size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr,
+ const void* src, size_t srcSize)
+{
+ const BYTE* const istart = (const BYTE* const)src;
+ const BYTE* const iend = istart + srcSize;
+ const BYTE* ip = istart;
+ DEBUGLOG(5, "ZSTD_decodeSeqHeaders");
+
+ /* check */
+ if (srcSize < MIN_SEQUENCES_SIZE) return ERROR(srcSize_wrong);
+
+ /* SeqHead */
+ { int nbSeq = *ip++;
+ if (!nbSeq) { *nbSeqPtr=0; return 1; }
+ if (nbSeq > 0x7F) {
+ if (nbSeq == 0xFF) {
+ if (ip+2 > iend) return ERROR(srcSize_wrong);
+ nbSeq = MEM_readLE16(ip) + LONGNBSEQ, ip+=2;
+ } else {
+ if (ip >= iend) return ERROR(srcSize_wrong);
+ nbSeq = ((nbSeq-0x80)<<8) + *ip++;
+ }
+ }
+ *nbSeqPtr = nbSeq;
+ }
+
+ /* FSE table descriptors */
+ if (ip+4 > iend) return ERROR(srcSize_wrong); /* minimum possible size */
+ { symbolEncodingType_e const LLtype = (symbolEncodingType_e)(*ip >> 6);
+ symbolEncodingType_e const OFtype = (symbolEncodingType_e)((*ip >> 4) & 3);
+ symbolEncodingType_e const MLtype = (symbolEncodingType_e)((*ip >> 2) & 3);
+ ip++;
+
+ /* Build DTables */
+ { size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr,
+ LLtype, MaxLL, LLFSELog,
+ ip, iend-ip, LL_defaultDTable, dctx->fseEntropy);
+ if (ZSTD_isError(llhSize)) return ERROR(corruption_detected);
+ ip += llhSize;
+ }
+ { size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr,
+ OFtype, MaxOff, OffFSELog,
+ ip, iend-ip, OF_defaultDTable, dctx->fseEntropy);
+ if (ZSTD_isError(ofhSize)) return ERROR(corruption_detected);
+ ip += ofhSize;
+ }
+ { size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr,
+ MLtype, MaxML, MLFSELog,
+ ip, iend-ip, ML_defaultDTable, dctx->fseEntropy);
+ if (ZSTD_isError(mlhSize)) return ERROR(corruption_detected);
+ ip += mlhSize;
+ }
+ }
+
+ return ip-istart;
+}
+
+
+typedef struct {
+ size_t litLength;
+ size_t matchLength;
+ size_t offset;
+ const BYTE* match;
+} seq_t;
+
+typedef struct {
+ BIT_DStream_t DStream;
+ FSE_DState_t stateLL;
+ FSE_DState_t stateOffb;
+ FSE_DState_t stateML;
+ size_t prevOffset[ZSTD_REP_NUM];
+ const BYTE* base;
+ size_t pos;
+ uPtrDiff gotoDict;
+} seqState_t;
+
+
+FORCE_NOINLINE
+size_t ZSTD_execSequenceLast7(BYTE* op,
+ BYTE* const oend, seq_t sequence,
+ const BYTE** litPtr, const BYTE* const litLimit,
+ const BYTE* const base, const BYTE* const vBase, const BYTE* const dictEnd)
+{
+ BYTE* const oLitEnd = op + sequence.litLength;
+ size_t const sequenceLength = sequence.litLength + sequence.matchLength;
+ BYTE* const oMatchEnd = op + sequenceLength; /* risk : address space overflow (32-bits) */
+ BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;
+ const BYTE* const iLitEnd = *litPtr + sequence.litLength;
+ const BYTE* match = oLitEnd - sequence.offset;
+
+ /* check */
+ if (oMatchEnd>oend) return ERROR(dstSize_tooSmall); /* last match must start at a minimum distance of WILDCOPY_OVERLENGTH from oend */
+ if (iLitEnd > litLimit) return ERROR(corruption_detected); /* over-read beyond lit buffer */
+ if (oLitEnd <= oend_w) return ERROR(GENERIC); /* Precondition */
+
+ /* copy literals */
+ if (op < oend_w) {
+ ZSTD_wildcopy(op, *litPtr, oend_w - op);
+ *litPtr += oend_w - op;
+ op = oend_w;
+ }
+ while (op < oLitEnd) *op++ = *(*litPtr)++;
+
+ /* copy Match */
+ if (sequence.offset > (size_t)(oLitEnd - base)) {
+ /* offset beyond prefix */
+ if (sequence.offset > (size_t)(oLitEnd - vBase)) return ERROR(corruption_detected);
+ match = dictEnd - (base-match);
+ if (match + sequence.matchLength <= dictEnd) {
+ memmove(oLitEnd, match, sequence.matchLength);
+ return sequenceLength;
+ }
+ /* span extDict & currentPrefixSegment */
+ { size_t const length1 = dictEnd - match;
+ memmove(oLitEnd, match, length1);
+ op = oLitEnd + length1;
+ sequence.matchLength -= length1;
+ match = base;
+ } }
+ while (op < oMatchEnd) *op++ = *match++;
+ return sequenceLength;
+}
+
+
+static seq_t ZSTD_decodeSequence(seqState_t* seqState)
+{
+ seq_t seq;
+
+ U32 const llCode = FSE_peekSymbol(&seqState->stateLL);
+ U32 const mlCode = FSE_peekSymbol(&seqState->stateML);
+ U32 const ofCode = FSE_peekSymbol(&seqState->stateOffb); /* <= maxOff, by table construction */
+
+ U32 const llBits = LL_bits[llCode];
+ U32 const mlBits = ML_bits[mlCode];
+ U32 const ofBits = ofCode;
+ U32 const totalBits = llBits+mlBits+ofBits;
+
+ static const U32 LL_base[MaxLL+1] = {
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 18, 20, 22, 24, 28, 32, 40,
+ 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
+ 0x2000, 0x4000, 0x8000, 0x10000 };
+
+ static const U32 ML_base[MaxML+1] = {
+ 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 18,
+ 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 37, 39, 41, 43, 47, 51, 59,
+ 67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803,
+ 0x1003, 0x2003, 0x4003, 0x8003, 0x10003 };
+
+ static const U32 OF_base[MaxOff+1] = {
+ 0, 1, 1, 5, 0xD, 0x1D, 0x3D, 0x7D,
+ 0xFD, 0x1FD, 0x3FD, 0x7FD, 0xFFD, 0x1FFD, 0x3FFD, 0x7FFD,
+ 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD,
+ 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD };
+
+ /* sequence */
+ { size_t offset;
+ if (!ofCode)
+ offset = 0;
+ else {
+ offset = OF_base[ofCode] + BIT_readBitsFast(&seqState->DStream, ofBits); /* <= (ZSTD_WINDOWLOG_MAX-1) bits */
+ if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
+ }
+
+ if (ofCode <= 1) {
+ offset += (llCode==0);
+ if (offset) {
+ size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];
+ temp += !temp; /* 0 is not valid; input is corrupted; force offset to 1 */
+ if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
+ seqState->prevOffset[1] = seqState->prevOffset[0];
+ seqState->prevOffset[0] = offset = temp;
+ } else {
+ offset = seqState->prevOffset[0];
+ }
+ } else {
+ seqState->prevOffset[2] = seqState->prevOffset[1];
+ seqState->prevOffset[1] = seqState->prevOffset[0];
+ seqState->prevOffset[0] = offset;
+ }
+ seq.offset = offset;
+ }
+
+ seq.matchLength = ML_base[mlCode]
+ + ((mlCode>31) ? BIT_readBitsFast(&seqState->DStream, mlBits) : 0); /* <= 16 bits */
+ if (MEM_32bits() && (mlBits+llBits>24)) BIT_reloadDStream(&seqState->DStream);
+
+ seq.litLength = LL_base[llCode]
+ + ((llCode>15) ? BIT_readBitsFast(&seqState->DStream, llBits) : 0); /* <= 16 bits */
+ if ( MEM_32bits()
+ || (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) )
+ BIT_reloadDStream(&seqState->DStream);
+
+ DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u",
+ (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);
+
+ /* ANS state update */
+ FSE_updateState(&seqState->stateLL, &seqState->DStream); /* <= 9 bits */
+ FSE_updateState(&seqState->stateML, &seqState->DStream); /* <= 9 bits */
+ if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); /* <= 18 bits */
+ FSE_updateState(&seqState->stateOffb, &seqState->DStream); /* <= 8 bits */
+
+ return seq;
+}
+
+
+FORCE_INLINE
+size_t ZSTD_execSequence(BYTE* op,
+ BYTE* const oend, seq_t sequence,
+ const BYTE** litPtr, const BYTE* const litLimit,
+ const BYTE* const base, const BYTE* const vBase, const BYTE* const dictEnd)
+{
+ BYTE* const oLitEnd = op + sequence.litLength;
+ size_t const sequenceLength = sequence.litLength + sequence.matchLength;
+ BYTE* const oMatchEnd = op + sequenceLength; /* risk : address space overflow (32-bits) */
+ BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;
+ const BYTE* const iLitEnd = *litPtr + sequence.litLength;
+ const BYTE* match = oLitEnd - sequence.offset;
+
+ /* check */
+ if (oMatchEnd>oend) return ERROR(dstSize_tooSmall); /* last match must start at a minimum distance of WILDCOPY_OVERLENGTH from oend */
+ if (iLitEnd > litLimit) return ERROR(corruption_detected); /* over-read beyond lit buffer */
+ if (oLitEnd>oend_w) return ZSTD_execSequenceLast7(op, oend, sequence, litPtr, litLimit, base, vBase, dictEnd);
+
+ /* copy Literals */
+ ZSTD_copy8(op, *litPtr);
+ if (sequence.litLength > 8)
+ ZSTD_wildcopy(op+8, (*litPtr)+8, sequence.litLength - 8); /* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */
+ op = oLitEnd;
+ *litPtr = iLitEnd; /* update for next sequence */
+
+ /* copy Match */
+ if (sequence.offset > (size_t)(oLitEnd - base)) {
+ /* offset beyond prefix -> go into extDict */
+ if (sequence.offset > (size_t)(oLitEnd - vBase))
+ return ERROR(corruption_detected);
+ match = dictEnd + (match - base);
+ if (match + sequence.matchLength <= dictEnd) {
+ memmove(oLitEnd, match, sequence.matchLength);
+ return sequenceLength;
+ }
+ /* span extDict & currentPrefixSegment */
+ { size_t const length1 = dictEnd - match;
+ memmove(oLitEnd, match, length1);
+ op = oLitEnd + length1;
+ sequence.matchLength -= length1;
+ match = base;
+ if (op > oend_w || sequence.matchLength < MINMATCH) {
+ U32 i;
+ for (i = 0; i < sequence.matchLength; ++i) op[i] = match[i];
+ return sequenceLength;
+ }
+ } }
+ /* Requirement: op <= oend_w && sequence.matchLength >= MINMATCH */
+
+ /* match within prefix */
+ if (sequence.offset < 8) {
+ /* close range match, overlap */
+ static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 }; /* added */
+ static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 }; /* subtracted */
+ int const sub2 = dec64table[sequence.offset];
+ op[0] = match[0];
+ op[1] = match[1];
+ op[2] = match[2];
+ op[3] = match[3];
+ match += dec32table[sequence.offset];
+ ZSTD_copy4(op+4, match);
+ match -= sub2;
+ } else {
+ ZSTD_copy8(op, match);
+ }
+ op += 8; match += 8;
+
+ if (oMatchEnd > oend-(16-MINMATCH)) {
+ if (op < oend_w) {
+ ZSTD_wildcopy(op, match, oend_w - op);
+ match += oend_w - op;
+ op = oend_w;
+ }
+ while (op < oMatchEnd) *op++ = *match++;
+ } else {
+ ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8); /* works even if matchLength < 8 */
+ }
+ return sequenceLength;
+}
+
+
+static size_t ZSTD_decompressSequences(
+ ZSTD_DCtx* dctx,
+ void* dst, size_t maxDstSize,
+ const void* seqStart, size_t seqSize)
+{
+ const BYTE* ip = (const BYTE*)seqStart;
+ const BYTE* const iend = ip + seqSize;
+ BYTE* const ostart = (BYTE* const)dst;
+ BYTE* const oend = ostart + maxDstSize;
+ BYTE* op = ostart;
+ const BYTE* litPtr = dctx->litPtr;
+ const BYTE* const litEnd = litPtr + dctx->litSize;
+ const BYTE* const base = (const BYTE*) (dctx->base);
+ const BYTE* const vBase = (const BYTE*) (dctx->vBase);
+ const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
+ int nbSeq;
+ DEBUGLOG(5, "ZSTD_decompressSequences");
+
+ /* Build Decoding Tables */
+ { size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, seqSize);
+ DEBUGLOG(5, "ZSTD_decodeSeqHeaders: size=%u, nbSeq=%i",
+ (U32)seqHSize, nbSeq);
+ if (ZSTD_isError(seqHSize)) return seqHSize;
+ ip += seqHSize;
+ }
+
+ /* Regen sequences */
+ if (nbSeq) {
+ seqState_t seqState;
+ dctx->fseEntropy = 1;
+ { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
+ CHECK_E(BIT_initDStream(&seqState.DStream, ip, iend-ip), corruption_detected);
+ FSE_initDState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
+ FSE_initDState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
+ FSE_initDState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
+
+ for ( ; (BIT_reloadDStream(&(seqState.DStream)) <= BIT_DStream_completed) && nbSeq ; ) {
+ nbSeq--;
+ { seq_t const sequence = ZSTD_decodeSequence(&seqState);
+ size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
+ DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
+ if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
+ op += oneSeqSize;
+ } }
+
+ /* check if reached exact end */
+ DEBUGLOG(5, "after decode loop, remaining nbSeq : %i", nbSeq);
+ if (nbSeq) return ERROR(corruption_detected);
+ /* save reps for next block */
+ { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
+ }
+
+ /* last literal segment */
+ { size_t const lastLLSize = litEnd - litPtr;
+ if (lastLLSize > (size_t)(oend-op)) return ERROR(dstSize_tooSmall);
+ memcpy(op, litPtr, lastLLSize);
+ op += lastLLSize;
+ }
+
+ return op-ostart;
+}
+
+
+FORCE_INLINE seq_t ZSTD_decodeSequenceLong_generic(seqState_t* seqState, int const longOffsets)
+{
+ seq_t seq;
+
+ U32 const llCode = FSE_peekSymbol(&seqState->stateLL);
+ U32 const mlCode = FSE_peekSymbol(&seqState->stateML);
+ U32 const ofCode = FSE_peekSymbol(&seqState->stateOffb); /* <= maxOff, by table construction */
+
+ U32 const llBits = LL_bits[llCode];
+ U32 const mlBits = ML_bits[mlCode];
+ U32 const ofBits = ofCode;
+ U32 const totalBits = llBits+mlBits+ofBits;
+
+ static const U32 LL_base[MaxLL+1] = {
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 18, 20, 22, 24, 28, 32, 40,
+ 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
+ 0x2000, 0x4000, 0x8000, 0x10000 };
+
+ static const U32 ML_base[MaxML+1] = {
+ 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 18,
+ 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 37, 39, 41, 43, 47, 51, 59,
+ 67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803,
+ 0x1003, 0x2003, 0x4003, 0x8003, 0x10003 };
+
+ static const U32 OF_base[MaxOff+1] = {
+ 0, 1, 1, 5, 0xD, 0x1D, 0x3D, 0x7D,
+ 0xFD, 0x1FD, 0x3FD, 0x7FD, 0xFFD, 0x1FFD, 0x3FFD, 0x7FFD,
+ 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD,
+ 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD };
+
+ /* sequence */
+ { size_t offset;
+ if (!ofCode)
+ offset = 0;
+ else {
+ if (longOffsets) {
+ int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN);
+ offset = OF_base[ofCode] + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits);
+ if (MEM_32bits() || extraBits) BIT_reloadDStream(&seqState->DStream);
+ if (extraBits) offset += BIT_readBitsFast(&seqState->DStream, extraBits);
+ } else {
+ offset = OF_base[ofCode] + BIT_readBitsFast(&seqState->DStream, ofBits); /* <= (ZSTD_WINDOWLOG_MAX-1) bits */
+ if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
+ }
+ }
+
+ if (ofCode <= 1) {
+ offset += (llCode==0);
+ if (offset) {
+ size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];
+ temp += !temp; /* 0 is not valid; input is corrupted; force offset to 1 */
+ if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
+ seqState->prevOffset[1] = seqState->prevOffset[0];
+ seqState->prevOffset[0] = offset = temp;
+ } else {
+ offset = seqState->prevOffset[0];
+ }
+ } else {
+ seqState->prevOffset[2] = seqState->prevOffset[1];
+ seqState->prevOffset[1] = seqState->prevOffset[0];
+ seqState->prevOffset[0] = offset;
+ }
+ seq.offset = offset;
+ }
+
+ seq.matchLength = ML_base[mlCode] + ((mlCode>31) ? BIT_readBitsFast(&seqState->DStream, mlBits) : 0); /* <= 16 bits */
+ if (MEM_32bits() && (mlBits+llBits>24)) BIT_reloadDStream(&seqState->DStream);
+
+ seq.litLength = LL_base[llCode] + ((llCode>15) ? BIT_readBitsFast(&seqState->DStream, llBits) : 0); /* <= 16 bits */
+ if (MEM_32bits() ||
+ (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BIT_reloadDStream(&seqState->DStream);
+
+ { size_t const pos = seqState->pos + seq.litLength;
+ seq.match = seqState->base + pos - seq.offset; /* single memory segment */
+ if (seq.offset > pos) seq.match += seqState->gotoDict; /* separate memory segment */
+ seqState->pos = pos + seq.matchLength;
+ }
+
+ /* ANS state update */
+ FSE_updateState(&seqState->stateLL, &seqState->DStream); /* <= 9 bits */
+ FSE_updateState(&seqState->stateML, &seqState->DStream); /* <= 9 bits */
+ if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); /* <= 18 bits */
+ FSE_updateState(&seqState->stateOffb, &seqState->DStream); /* <= 8 bits */
+
+ return seq;
+}
+
+static seq_t ZSTD_decodeSequenceLong(seqState_t* seqState, unsigned const windowSize) {
+ if (ZSTD_highbit32(windowSize) > STREAM_ACCUMULATOR_MIN) {
+ return ZSTD_decodeSequenceLong_generic(seqState, 1);
+ } else {
+ return ZSTD_decodeSequenceLong_generic(seqState, 0);
+ }
+}
+
+FORCE_INLINE
+size_t ZSTD_execSequenceLong(BYTE* op,
+ BYTE* const oend, seq_t sequence,
+ const BYTE** litPtr, const BYTE* const litLimit,
+ const BYTE* const base, const BYTE* const vBase, const BYTE* const dictEnd)
+{
+ BYTE* const oLitEnd = op + sequence.litLength;
+ size_t const sequenceLength = sequence.litLength + sequence.matchLength;
+ BYTE* const oMatchEnd = op + sequenceLength; /* risk : address space overflow (32-bits) */
+ BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;
+ const BYTE* const iLitEnd = *litPtr + sequence.litLength;
+ const BYTE* match = sequence.match;
+
+ /* check */
+#if 1
+ if (oMatchEnd>oend) return ERROR(dstSize_tooSmall); /* last match must start at a minimum distance of WILDCOPY_OVERLENGTH from oend */
+ if (iLitEnd > litLimit) return ERROR(corruption_detected); /* over-read beyond lit buffer */
+ if (oLitEnd>oend_w) return ZSTD_execSequenceLast7(op, oend, sequence, litPtr, litLimit, base, vBase, dictEnd);
+#endif
+
+ /* copy Literals */
+ ZSTD_copy8(op, *litPtr);
+ if (sequence.litLength > 8)
+ ZSTD_wildcopy(op+8, (*litPtr)+8, sequence.litLength - 8); /* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */
+ op = oLitEnd;
+ *litPtr = iLitEnd; /* update for next sequence */
+
+ /* copy Match */
+#if 1
+ if (sequence.offset > (size_t)(oLitEnd - base)) {
+ /* offset beyond prefix */
+ if (sequence.offset > (size_t)(oLitEnd - vBase)) return ERROR(corruption_detected);
+ if (match + sequence.matchLength <= dictEnd) {
+ memmove(oLitEnd, match, sequence.matchLength);
+ return sequenceLength;
+ }
+ /* span extDict & currentPrefixSegment */
+ { size_t const length1 = dictEnd - match;
+ memmove(oLitEnd, match, length1);
+ op = oLitEnd + length1;
+ sequence.matchLength -= length1;
+ match = base;
+ if (op > oend_w || sequence.matchLength < MINMATCH) {
+ U32 i;
+ for (i = 0; i < sequence.matchLength; ++i) op[i] = match[i];
+ return sequenceLength;
+ }
+ } }
+ /* Requirement: op <= oend_w && sequence.matchLength >= MINMATCH */
+#endif
+
+ /* match within prefix */
+ if (sequence.offset < 8) {
+ /* close range match, overlap */
+ static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 }; /* added */
+ static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 }; /* subtracted */
+ int const sub2 = dec64table[sequence.offset];
+ op[0] = match[0];
+ op[1] = match[1];
+ op[2] = match[2];
+ op[3] = match[3];
+ match += dec32table[sequence.offset];
+ ZSTD_copy4(op+4, match);
+ match -= sub2;
+ } else {
+ ZSTD_copy8(op, match);
+ }
+ op += 8; match += 8;
+
+ if (oMatchEnd > oend-(16-MINMATCH)) {
+ if (op < oend_w) {
+ ZSTD_wildcopy(op, match, oend_w - op);
+ match += oend_w - op;
+ op = oend_w;
+ }
+ while (op < oMatchEnd) *op++ = *match++;
+ } else {
+ ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8); /* works even if matchLength < 8 */
+ }
+ return sequenceLength;
+}
+
+static size_t ZSTD_decompressSequencesLong(
+ ZSTD_DCtx* dctx,
+ void* dst, size_t maxDstSize,
+ const void* seqStart, size_t seqSize)
+{
+ const BYTE* ip = (const BYTE*)seqStart;
+ const BYTE* const iend = ip + seqSize;
+ BYTE* const ostart = (BYTE* const)dst;
+ BYTE* const oend = ostart + maxDstSize;
+ BYTE* op = ostart;
+ const BYTE* litPtr = dctx->litPtr;
+ const BYTE* const litEnd = litPtr + dctx->litSize;
+ const BYTE* const base = (const BYTE*) (dctx->base);
+ const BYTE* const vBase = (const BYTE*) (dctx->vBase);
+ const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
+ unsigned const windowSize32 = (unsigned)dctx->fParams.windowSize;
+ int nbSeq;
+
+ /* Build Decoding Tables */
+ { size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, seqSize);
+ if (ZSTD_isError(seqHSize)) return seqHSize;
+ ip += seqHSize;
+ }
+
+ /* Regen sequences */
+ if (nbSeq) {
+#define STORED_SEQS 4
+#define STOSEQ_MASK (STORED_SEQS-1)
+#define ADVANCED_SEQS 4
+ seq_t sequences[STORED_SEQS];
+ int const seqAdvance = MIN(nbSeq, ADVANCED_SEQS);
+ seqState_t seqState;
+ int seqNb;
+ dctx->fseEntropy = 1;
+ { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
+ seqState.base = base;
+ seqState.pos = (size_t)(op-base);
+ seqState.gotoDict = (uPtrDiff)dictEnd - (uPtrDiff)base; /* cast to avoid undefined behaviour */
+ CHECK_E(BIT_initDStream(&seqState.DStream, ip, iend-ip), corruption_detected);
+ FSE_initDState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
+ FSE_initDState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
+ FSE_initDState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
+
+ /* prepare in advance */
+ for (seqNb=0; (BIT_reloadDStream(&seqState.DStream) <= BIT_DStream_completed) && seqNb<seqAdvance; seqNb++) {
+ sequences[seqNb] = ZSTD_decodeSequenceLong(&seqState, windowSize32);
+ }
+ if (seqNb<seqAdvance) return ERROR(corruption_detected);
+
+ /* decode and decompress */
+ for ( ; (BIT_reloadDStream(&(seqState.DStream)) <= BIT_DStream_completed) && seqNb<nbSeq ; seqNb++) {
+ seq_t const sequence = ZSTD_decodeSequenceLong(&seqState, windowSize32);
+ size_t const oneSeqSize = ZSTD_execSequenceLong(op, oend, sequences[(seqNb-ADVANCED_SEQS) & STOSEQ_MASK], &litPtr, litEnd, base, vBase, dictEnd);
+ if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
+ ZSTD_PREFETCH(sequence.match);
+ sequences[seqNb&STOSEQ_MASK] = sequence;
+ op += oneSeqSize;
+ }
+ if (seqNb<nbSeq) return ERROR(corruption_detected);
+
+ /* finish queue */
+ seqNb -= seqAdvance;
+ for ( ; seqNb<nbSeq ; seqNb++) {
+ size_t const oneSeqSize = ZSTD_execSequenceLong(op, oend, sequences[seqNb&STOSEQ_MASK], &litPtr, litEnd, base, vBase, dictEnd);
+ if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
+ op += oneSeqSize;
+ }
+
+ /* save reps for next block */
+ { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
+ }
+
+ /* last literal segment */
+ { size_t const lastLLSize = litEnd - litPtr;
+ if (lastLLSize > (size_t)(oend-op)) return ERROR(dstSize_tooSmall);
+ memcpy(op, litPtr, lastLLSize);
+ op += lastLLSize;
+ }
+
+ return op-ostart;
+}
+
+
+static size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize)
+{ /* blockType == blockCompressed */
+ const BYTE* ip = (const BYTE*)src;
+ DEBUGLOG(5, "ZSTD_decompressBlock_internal");
+
+ if (srcSize >= ZSTD_BLOCKSIZE_MAX) return ERROR(srcSize_wrong);
+
+ /* Decode literals section */
+ { size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize);
+ DEBUGLOG(5, "ZSTD_decodeLiteralsBlock : %u", (U32)litCSize);
+ if (ZSTD_isError(litCSize)) return litCSize;
+ ip += litCSize;
+ srcSize -= litCSize;
+ }
+ if (sizeof(size_t) > 4) /* do not enable prefetching on 32-bits x86, as it's performance detrimental */
+ /* likely because of register pressure */
+ /* if that's the correct cause, then 32-bits ARM should be affected differently */
+ /* it would be good to test this on ARM real hardware, to see if prefetch version improves speed */
+ if (dctx->fParams.windowSize > (1<<23))
+ return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize);
+ return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
+}
+
+
+static void ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst)
+{
+ if (dst != dctx->previousDstEnd) { /* not contiguous */
+ dctx->dictEnd = dctx->previousDstEnd;
+ dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
+ dctx->base = dst;
+ dctx->previousDstEnd = dst;
+ }
+}
+
+size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize)
+{
+ size_t dSize;
+ ZSTD_checkContinuity(dctx, dst);
+ dSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize);
+ dctx->previousDstEnd = (char*)dst + dSize;
+ return dSize;
+}
+
+
+/** ZSTD_insertBlock() :
+ insert `src` block into `dctx` history. Useful to track uncompressed blocks. */
+ZSTDLIB_API size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize)
+{
+ ZSTD_checkContinuity(dctx, blockStart);
+ dctx->previousDstEnd = (const char*)blockStart + blockSize;
+ return blockSize;
+}
+
+
+size_t ZSTD_generateNxBytes(void* dst, size_t dstCapacity, BYTE byte, size_t length)
+{
+ if (length > dstCapacity) return ERROR(dstSize_tooSmall);
+ memset(dst, byte, length);
+ return length;
+}
+
+/** ZSTD_findFrameCompressedSize() :
+ * compatible with legacy mode
+ * `src` must point to the start of a ZSTD frame, ZSTD legacy frame, or skippable frame
+ * `srcSize` must be at least as large as the frame contained
+ * @return : the compressed size of the frame starting at `src` */
+size_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize)
+{
+#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
+ if (ZSTD_isLegacy(src, srcSize)) return ZSTD_findFrameCompressedSizeLegacy(src, srcSize);
+#endif
+ if (srcSize >= ZSTD_skippableHeaderSize &&
+ (MEM_readLE32(src) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) {
+ return ZSTD_skippableHeaderSize + MEM_readLE32((const BYTE*)src + 4);
+ } else {
+ const BYTE* ip = (const BYTE*)src;
+ const BYTE* const ipstart = ip;
+ size_t remainingSize = srcSize;
+ ZSTD_frameHeader fParams;
+
+ size_t const headerSize = ZSTD_frameHeaderSize(ip, remainingSize);
+ if (ZSTD_isError(headerSize)) return headerSize;
+
+ /* Frame Header */
+ { size_t const ret = ZSTD_getFrameHeader(&fParams, ip, remainingSize);
+ if (ZSTD_isError(ret)) return ret;
+ if (ret > 0) return ERROR(srcSize_wrong);
+ }
+
+ ip += headerSize;
+ remainingSize -= headerSize;
+
+ /* Loop on each block */
+ while (1) {
+ blockProperties_t blockProperties;
+ size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSize, &blockProperties);
+ if (ZSTD_isError(cBlockSize)) return cBlockSize;
+
+ if (ZSTD_blockHeaderSize + cBlockSize > remainingSize) return ERROR(srcSize_wrong);
+
+ ip += ZSTD_blockHeaderSize + cBlockSize;
+ remainingSize -= ZSTD_blockHeaderSize + cBlockSize;
+
+ if (blockProperties.lastBlock) break;
+ }
+
+ if (fParams.checksumFlag) { /* Frame content checksum */
+ if (remainingSize < 4) return ERROR(srcSize_wrong);
+ ip += 4;
+ remainingSize -= 4;
+ }
+
+ return ip - ipstart;
+ }
+}
+
+/*! ZSTD_decompressFrame() :
+* @dctx must be properly initialized */
+static size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx,
+ void* dst, size_t dstCapacity,
+ const void** srcPtr, size_t *srcSizePtr)
+{
+ const BYTE* ip = (const BYTE*)(*srcPtr);
+ BYTE* const ostart = (BYTE* const)dst;
+ BYTE* const oend = ostart + dstCapacity;
+ BYTE* op = ostart;
+ size_t remainingSize = *srcSizePtr;
+
+ /* check */
+ if (remainingSize < ZSTD_frameHeaderSize_min+ZSTD_blockHeaderSize) return ERROR(srcSize_wrong);
+
+ /* Frame Header */
+ { size_t const frameHeaderSize = ZSTD_frameHeaderSize(ip, ZSTD_frameHeaderSize_prefix);
+ if (ZSTD_isError(frameHeaderSize)) return frameHeaderSize;
+ if (remainingSize < frameHeaderSize+ZSTD_blockHeaderSize) return ERROR(srcSize_wrong);
+ CHECK_F(ZSTD_decodeFrameHeader(dctx, ip, frameHeaderSize));
+ ip += frameHeaderSize; remainingSize -= frameHeaderSize;
+ }
+
+ /* Loop on each block */
+ while (1) {
+ size_t decodedSize;
+ blockProperties_t blockProperties;
+ size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSize, &blockProperties);
+ if (ZSTD_isError(cBlockSize)) return cBlockSize;
+
+ ip += ZSTD_blockHeaderSize;
+ remainingSize -= ZSTD_blockHeaderSize;
+ if (cBlockSize > remainingSize) return ERROR(srcSize_wrong);
+
+ switch(blockProperties.blockType)
+ {
+ case bt_compressed:
+ decodedSize = ZSTD_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
+ break;
+ case bt_raw :
+ decodedSize = ZSTD_copyRawBlock(op, oend-op, ip, cBlockSize);
+ break;
+ case bt_rle :
+ decodedSize = ZSTD_generateNxBytes(op, oend-op, *ip, blockProperties.origSize);
+ break;
+ case bt_reserved :
+ default:
+ return ERROR(corruption_detected);
+ }
+
+ if (ZSTD_isError(decodedSize)) return decodedSize;
+ if (dctx->fParams.checksumFlag) XXH64_update(&dctx->xxhState, op, decodedSize);
+ op += decodedSize;
+ ip += cBlockSize;
+ remainingSize -= cBlockSize;
+ if (blockProperties.lastBlock) break;
+ }
+
+ if (dctx->fParams.checksumFlag) { /* Frame content checksum verification */
+ U32 const checkCalc = (U32)XXH64_digest(&dctx->xxhState);
+ U32 checkRead;
+ if (remainingSize<4) return ERROR(checksum_wrong);
+ checkRead = MEM_readLE32(ip);
+ if (checkRead != checkCalc) return ERROR(checksum_wrong);
+ ip += 4;
+ remainingSize -= 4;
+ }
+
+ /* Allow caller to get size read */
+ *srcPtr = ip;
+ *srcSizePtr = remainingSize;
+ return op-ostart;
+}
+
+static const void* ZSTD_DDictDictContent(const ZSTD_DDict* ddict);
+static size_t ZSTD_DDictDictSize(const ZSTD_DDict* ddict);
+
+static size_t ZSTD_decompressMultiFrame(ZSTD_DCtx* dctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const void *dict, size_t dictSize,
+ const ZSTD_DDict* ddict)
+{
+ void* const dststart = dst;
+
+ if (ddict) {
+ if (dict) {
+ /* programmer error, these two cases should be mutually exclusive */
+ return ERROR(GENERIC);
+ }
+
+ dict = ZSTD_DDictDictContent(ddict);
+ dictSize = ZSTD_DDictDictSize(ddict);
+ }
+
+ while (srcSize >= ZSTD_frameHeaderSize_prefix) {
+ U32 magicNumber;
+
+#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
+ if (ZSTD_isLegacy(src, srcSize)) {
+ size_t decodedSize;
+ size_t const frameSize = ZSTD_findFrameCompressedSizeLegacy(src, srcSize);
+ if (ZSTD_isError(frameSize)) return frameSize;
+ /* legacy support is incompatible with static dctx */
+ if (dctx->staticSize) return ERROR(memory_allocation);
+
+ decodedSize = ZSTD_decompressLegacy(dst, dstCapacity, src, frameSize, dict, dictSize);
+
+ dst = (BYTE*)dst + decodedSize;
+ dstCapacity -= decodedSize;
+
+ src = (const BYTE*)src + frameSize;
+ srcSize -= frameSize;
+
+ continue;
+ }
+#endif
+
+ magicNumber = MEM_readLE32(src);
+ if (magicNumber != ZSTD_MAGICNUMBER) {
+ if ((magicNumber & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) {
+ size_t skippableSize;
+ if (srcSize < ZSTD_skippableHeaderSize)
+ return ERROR(srcSize_wrong);
+ skippableSize = MEM_readLE32((const BYTE *)src + 4) +
+ ZSTD_skippableHeaderSize;
+ if (srcSize < skippableSize) {
+ return ERROR(srcSize_wrong);
+ }
+
+ src = (const BYTE *)src + skippableSize;
+ srcSize -= skippableSize;
+ continue;
+ } else {
+ return ERROR(prefix_unknown);
+ }
+ }
+
+ if (ddict) {
+ /* we were called from ZSTD_decompress_usingDDict */
+ CHECK_F(ZSTD_decompressBegin_usingDDict(dctx, ddict));
+ } else {
+ /* this will initialize correctly with no dict if dict == NULL, so
+ * use this in all cases but ddict */
+ CHECK_F(ZSTD_decompressBegin_usingDict(dctx, dict, dictSize));
+ }
+ ZSTD_checkContinuity(dctx, dst);
+
+ { const size_t res = ZSTD_decompressFrame(dctx, dst, dstCapacity,
+ &src, &srcSize);
+ if (ZSTD_isError(res)) return res;
+ /* don't need to bounds check this, ZSTD_decompressFrame will have
+ * already */
+ dst = (BYTE*)dst + res;
+ dstCapacity -= res;
+ }
+ }
+
+ if (srcSize) return ERROR(srcSize_wrong); /* input not entirely consumed */
+
+ return (BYTE*)dst - (BYTE*)dststart;
+}
+
+size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const void* dict, size_t dictSize)
+{
+ return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize, dict, dictSize, NULL);
+}
+
+
+size_t ZSTD_decompressDCtx(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize)
+{
+ return ZSTD_decompress_usingDict(dctx, dst, dstCapacity, src, srcSize, NULL, 0);
+}
+
+
+size_t ZSTD_decompress(void* dst, size_t dstCapacity, const void* src, size_t srcSize)
+{
+#if defined(ZSTD_HEAPMODE) && (ZSTD_HEAPMODE>=1)
+ size_t regenSize;
+ ZSTD_DCtx* const dctx = ZSTD_createDCtx();
+ if (dctx==NULL) return ERROR(memory_allocation);
+ regenSize = ZSTD_decompressDCtx(dctx, dst, dstCapacity, src, srcSize);
+ ZSTD_freeDCtx(dctx);
+ return regenSize;
+#else /* stack mode */
+ ZSTD_DCtx dctx;
+ return ZSTD_decompressDCtx(&dctx, dst, dstCapacity, src, srcSize);
+#endif
+}
+
+
+/*-**************************************
+* Advanced Streaming Decompression API
+* Bufferless and synchronous
+****************************************/
+size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx) { return dctx->expected; }
+
+ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx) {
+ switch(dctx->stage)
+ {
+ default: /* should not happen */
+ assert(0);
+ case ZSTDds_getFrameHeaderSize:
+ case ZSTDds_decodeFrameHeader:
+ return ZSTDnit_frameHeader;
+ case ZSTDds_decodeBlockHeader:
+ return ZSTDnit_blockHeader;
+ case ZSTDds_decompressBlock:
+ return ZSTDnit_block;
+ case ZSTDds_decompressLastBlock:
+ return ZSTDnit_lastBlock;
+ case ZSTDds_checkChecksum:
+ return ZSTDnit_checksum;
+ case ZSTDds_decodeSkippableHeader:
+ case ZSTDds_skipFrame:
+ return ZSTDnit_skippableFrame;
+ }
+}
+
+static int ZSTD_isSkipFrame(ZSTD_DCtx* dctx) { return dctx->stage == ZSTDds_skipFrame; }
+
+/** ZSTD_decompressContinue() :
+ * srcSize : must be the exact nb of bytes expected (see ZSTD_nextSrcSizeToDecompress())
+ * @return : nb of bytes generated into `dst` (necessarily <= `dstCapacity)
+ * or an error code, which can be tested using ZSTD_isError() */
+size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize)
+{
+ DEBUGLOG(5, "ZSTD_decompressContinue");
+ /* Sanity check */
+ if (srcSize != dctx->expected) return ERROR(srcSize_wrong); /* unauthorized */
+ if (dstCapacity) ZSTD_checkContinuity(dctx, dst);
+
+ switch (dctx->stage)
+ {
+ case ZSTDds_getFrameHeaderSize :
+ if (srcSize != ZSTD_frameHeaderSize_prefix) return ERROR(srcSize_wrong); /* unauthorized */
+ assert(src != NULL);
+ if ((MEM_readLE32(src) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) { /* skippable frame */
+ memcpy(dctx->headerBuffer, src, ZSTD_frameHeaderSize_prefix);
+ dctx->expected = ZSTD_skippableHeaderSize - ZSTD_frameHeaderSize_prefix; /* magic number + skippable frame length */
+ dctx->stage = ZSTDds_decodeSkippableHeader;
+ return 0;
+ }
+ dctx->headerSize = ZSTD_frameHeaderSize(src, ZSTD_frameHeaderSize_prefix);
+ if (ZSTD_isError(dctx->headerSize)) return dctx->headerSize;
+ memcpy(dctx->headerBuffer, src, ZSTD_frameHeaderSize_prefix);
+ if (dctx->headerSize > ZSTD_frameHeaderSize_prefix) {
+ dctx->expected = dctx->headerSize - ZSTD_frameHeaderSize_prefix;
+ dctx->stage = ZSTDds_decodeFrameHeader;
+ return 0;
+ }
+ dctx->expected = 0; /* not necessary to copy more */
+
+ case ZSTDds_decodeFrameHeader:
+ assert(src != NULL);
+ memcpy(dctx->headerBuffer + ZSTD_frameHeaderSize_prefix, src, dctx->expected);
+ CHECK_F(ZSTD_decodeFrameHeader(dctx, dctx->headerBuffer, dctx->headerSize));
+ dctx->expected = ZSTD_blockHeaderSize;
+ dctx->stage = ZSTDds_decodeBlockHeader;
+ return 0;
+
+ case ZSTDds_decodeBlockHeader:
+ { blockProperties_t bp;
+ size_t const cBlockSize = ZSTD_getcBlockSize(src, ZSTD_blockHeaderSize, &bp);
+ if (ZSTD_isError(cBlockSize)) return cBlockSize;
+ dctx->expected = cBlockSize;
+ dctx->bType = bp.blockType;
+ dctx->rleSize = bp.origSize;
+ if (cBlockSize) {
+ dctx->stage = bp.lastBlock ? ZSTDds_decompressLastBlock : ZSTDds_decompressBlock;
+ return 0;
+ }
+ /* empty block */
+ if (bp.lastBlock) {
+ if (dctx->fParams.checksumFlag) {
+ dctx->expected = 4;
+ dctx->stage = ZSTDds_checkChecksum;
+ } else {
+ dctx->expected = 0; /* end of frame */
+ dctx->stage = ZSTDds_getFrameHeaderSize;
+ }
+ } else {
+ dctx->expected = ZSTD_blockHeaderSize; /* jump to next header */
+ dctx->stage = ZSTDds_decodeBlockHeader;
+ }
+ return 0;
+ }
+ case ZSTDds_decompressLastBlock:
+ case ZSTDds_decompressBlock:
+ DEBUGLOG(5, "case ZSTDds_decompressBlock");
+ { size_t rSize;
+ switch(dctx->bType)
+ {
+ case bt_compressed:
+ DEBUGLOG(5, "case bt_compressed");
+ rSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize);
+ break;
+ case bt_raw :
+ rSize = ZSTD_copyRawBlock(dst, dstCapacity, src, srcSize);
+ break;
+ case bt_rle :
+ rSize = ZSTD_setRleBlock(dst, dstCapacity, src, srcSize, dctx->rleSize);
+ break;
+ case bt_reserved : /* should never happen */
+ default:
+ return ERROR(corruption_detected);
+ }
+ if (ZSTD_isError(rSize)) return rSize;
+ if (dctx->fParams.checksumFlag) XXH64_update(&dctx->xxhState, dst, rSize);
+
+ if (dctx->stage == ZSTDds_decompressLastBlock) { /* end of frame */
+ if (dctx->fParams.checksumFlag) { /* another round for frame checksum */
+ dctx->expected = 4;
+ dctx->stage = ZSTDds_checkChecksum;
+ } else {
+ dctx->expected = 0; /* ends here */
+ dctx->stage = ZSTDds_getFrameHeaderSize;
+ }
+ } else {
+ dctx->stage = ZSTDds_decodeBlockHeader;
+ dctx->expected = ZSTD_blockHeaderSize;
+ dctx->previousDstEnd = (char*)dst + rSize;
+ }
+ return rSize;
+ }
+ case ZSTDds_checkChecksum:
+ { U32 const h32 = (U32)XXH64_digest(&dctx->xxhState);
+ U32 const check32 = MEM_readLE32(src); /* srcSize == 4, guaranteed by dctx->expected */
+ if (check32 != h32) return ERROR(checksum_wrong);
+ dctx->expected = 0;
+ dctx->stage = ZSTDds_getFrameHeaderSize;
+ return 0;
+ }
+ case ZSTDds_decodeSkippableHeader:
+ { assert(src != NULL);
+ memcpy(dctx->headerBuffer + ZSTD_frameHeaderSize_prefix, src, dctx->expected);
+ dctx->expected = MEM_readLE32(dctx->headerBuffer + 4);
+ dctx->stage = ZSTDds_skipFrame;
+ return 0;
+ }
+ case ZSTDds_skipFrame:
+ { dctx->expected = 0;
+ dctx->stage = ZSTDds_getFrameHeaderSize;
+ return 0;
+ }
+ default:
+ return ERROR(GENERIC); /* impossible */
+ }
+}
+
+
+static size_t ZSTD_refDictContent(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)
+{
+ dctx->dictEnd = dctx->previousDstEnd;
+ dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
+ dctx->base = dict;
+ dctx->previousDstEnd = (const char*)dict + dictSize;
+ return 0;
+}
+
+/* ZSTD_loadEntropy() :
+ * dict : must point at beginning of a valid zstd dictionary
+ * @return : size of entropy tables read */
+static size_t ZSTD_loadEntropy(ZSTD_entropyTables_t* entropy, const void* const dict, size_t const dictSize)
+{
+ const BYTE* dictPtr = (const BYTE*)dict;
+ const BYTE* const dictEnd = dictPtr + dictSize;
+
+ if (dictSize <= 8) return ERROR(dictionary_corrupted);
+ dictPtr += 8; /* skip header = magic + dictID */
+
+
+ { size_t const hSize = HUF_readDTableX4_wksp(
+ entropy->hufTable, dictPtr, dictEnd - dictPtr,
+ entropy->workspace, sizeof(entropy->workspace));
+ if (HUF_isError(hSize)) return ERROR(dictionary_corrupted);
+ dictPtr += hSize;
+ }
+
+ { short offcodeNCount[MaxOff+1];
+ U32 offcodeMaxValue = MaxOff, offcodeLog;
+ size_t const offcodeHeaderSize = FSE_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dictPtr, dictEnd-dictPtr);
+ if (FSE_isError(offcodeHeaderSize)) return ERROR(dictionary_corrupted);
+ if (offcodeLog > OffFSELog) return ERROR(dictionary_corrupted);
+ CHECK_E(FSE_buildDTable(entropy->OFTable, offcodeNCount, offcodeMaxValue, offcodeLog), dictionary_corrupted);
+ dictPtr += offcodeHeaderSize;
+ }
+
+ { short matchlengthNCount[MaxML+1];
+ unsigned matchlengthMaxValue = MaxML, matchlengthLog;
+ size_t const matchlengthHeaderSize = FSE_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dictPtr, dictEnd-dictPtr);
+ if (FSE_isError(matchlengthHeaderSize)) return ERROR(dictionary_corrupted);
+ if (matchlengthLog > MLFSELog) return ERROR(dictionary_corrupted);
+ CHECK_E(FSE_buildDTable(entropy->MLTable, matchlengthNCount, matchlengthMaxValue, matchlengthLog), dictionary_corrupted);
+ dictPtr += matchlengthHeaderSize;
+ }
+
+ { short litlengthNCount[MaxLL+1];
+ unsigned litlengthMaxValue = MaxLL, litlengthLog;
+ size_t const litlengthHeaderSize = FSE_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dictPtr, dictEnd-dictPtr);
+ if (FSE_isError(litlengthHeaderSize)) return ERROR(dictionary_corrupted);
+ if (litlengthLog > LLFSELog) return ERROR(dictionary_corrupted);
+ CHECK_E(FSE_buildDTable(entropy->LLTable, litlengthNCount, litlengthMaxValue, litlengthLog), dictionary_corrupted);
+ dictPtr += litlengthHeaderSize;
+ }
+
+ if (dictPtr+12 > dictEnd) return ERROR(dictionary_corrupted);
+ { int i;
+ size_t const dictContentSize = (size_t)(dictEnd - (dictPtr+12));
+ for (i=0; i<3; i++) {
+ U32 const rep = MEM_readLE32(dictPtr); dictPtr += 4;
+ if (rep==0 || rep >= dictContentSize) return ERROR(dictionary_corrupted);
+ entropy->rep[i] = rep;
+ } }
+
+ return dictPtr - (const BYTE*)dict;
+}
+
+static size_t ZSTD_decompress_insertDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)
+{
+ if (dictSize < 8) return ZSTD_refDictContent(dctx, dict, dictSize);
+ { U32 const magic = MEM_readLE32(dict);
+ if (magic != ZSTD_MAGIC_DICTIONARY) {
+ return ZSTD_refDictContent(dctx, dict, dictSize); /* pure content mode */
+ } }
+ dctx->dictID = MEM_readLE32((const char*)dict + 4);
+
+ /* load entropy tables */
+ { size_t const eSize = ZSTD_loadEntropy(&dctx->entropy, dict, dictSize);
+ if (ZSTD_isError(eSize)) return ERROR(dictionary_corrupted);
+ dict = (const char*)dict + eSize;
+ dictSize -= eSize;
+ }
+ dctx->litEntropy = dctx->fseEntropy = 1;
+
+ /* reference dictionary content */
+ return ZSTD_refDictContent(dctx, dict, dictSize);
+}
+
+size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)
+{
+ CHECK_F(ZSTD_decompressBegin(dctx));
+ if (dict && dictSize) CHECK_E(ZSTD_decompress_insertDictionary(dctx, dict, dictSize), dictionary_corrupted);
+ return 0;
+}
+
+
+/* ====== ZSTD_DDict ====== */
+
+struct ZSTD_DDict_s {
+ void* dictBuffer;
+ const void* dictContent;
+ size_t dictSize;
+ ZSTD_entropyTables_t entropy;
+ U32 dictID;
+ U32 entropyPresent;
+ ZSTD_customMem cMem;
+}; /* typedef'd to ZSTD_DDict within "zstd.h" */
+
+static const void* ZSTD_DDictDictContent(const ZSTD_DDict* ddict)
+{
+ return ddict->dictContent;
+}
+
+static size_t ZSTD_DDictDictSize(const ZSTD_DDict* ddict)
+{
+ return ddict->dictSize;
+}
+
+size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dstDCtx, const ZSTD_DDict* ddict)
+{
+ CHECK_F(ZSTD_decompressBegin(dstDCtx));
+ if (ddict) { /* support begin on NULL */
+ dstDCtx->dictID = ddict->dictID;
+ dstDCtx->base = ddict->dictContent;
+ dstDCtx->vBase = ddict->dictContent;
+ dstDCtx->dictEnd = (const BYTE*)ddict->dictContent + ddict->dictSize;
+ dstDCtx->previousDstEnd = dstDCtx->dictEnd;
+ if (ddict->entropyPresent) {
+ dstDCtx->litEntropy = 1;
+ dstDCtx->fseEntropy = 1;
+ dstDCtx->LLTptr = ddict->entropy.LLTable;
+ dstDCtx->MLTptr = ddict->entropy.MLTable;
+ dstDCtx->OFTptr = ddict->entropy.OFTable;
+ dstDCtx->HUFptr = ddict->entropy.hufTable;
+ dstDCtx->entropy.rep[0] = ddict->entropy.rep[0];
+ dstDCtx->entropy.rep[1] = ddict->entropy.rep[1];
+ dstDCtx->entropy.rep[2] = ddict->entropy.rep[2];
+ } else {
+ dstDCtx->litEntropy = 0;
+ dstDCtx->fseEntropy = 0;
+ }
+ }
+ return 0;
+}
+
+static size_t ZSTD_loadEntropy_inDDict(ZSTD_DDict* ddict)
+{
+ ddict->dictID = 0;
+ ddict->entropyPresent = 0;
+ if (ddict->dictSize < 8) return 0;
+ { U32 const magic = MEM_readLE32(ddict->dictContent);
+ if (magic != ZSTD_MAGIC_DICTIONARY) return 0; /* pure content mode */
+ }
+ ddict->dictID = MEM_readLE32((const char*)ddict->dictContent + 4);
+
+ /* load entropy tables */
+ CHECK_E( ZSTD_loadEntropy(&ddict->entropy, ddict->dictContent, ddict->dictSize), dictionary_corrupted );
+ ddict->entropyPresent = 1;
+ return 0;
+}
+
+
+static size_t ZSTD_initDDict_internal(ZSTD_DDict* ddict, const void* dict, size_t dictSize, unsigned byReference)
+{
+ if ((byReference) || (!dict) || (!dictSize)) {
+ ddict->dictBuffer = NULL;
+ ddict->dictContent = dict;
+ } else {
+ void* const internalBuffer = ZSTD_malloc(dictSize, ddict->cMem);
+ ddict->dictBuffer = internalBuffer;
+ ddict->dictContent = internalBuffer;
+ if (!internalBuffer) return ERROR(memory_allocation);
+ memcpy(internalBuffer, dict, dictSize);
+ }
+ ddict->dictSize = dictSize;
+ ddict->entropy.hufTable[0] = (HUF_DTable)((HufLog)*0x1000001); /* cover both little and big endian */
+
+ /* parse dictionary content */
+ CHECK_F( ZSTD_loadEntropy_inDDict(ddict) );
+
+ return 0;
+}
+
+ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize, unsigned byReference, ZSTD_customMem customMem)
+{
+ if (!customMem.customAlloc ^ !customMem.customFree) return NULL;
+
+ { ZSTD_DDict* const ddict = (ZSTD_DDict*) ZSTD_malloc(sizeof(ZSTD_DDict), customMem);
+ if (!ddict) return NULL;
+ ddict->cMem = customMem;
+
+ if (ZSTD_isError( ZSTD_initDDict_internal(ddict, dict, dictSize, byReference) )) {
+ ZSTD_freeDDict(ddict);
+ return NULL;
+ }
+
+ return ddict;
+ }
+}
+
+/*! ZSTD_createDDict() :
+* Create a digested dictionary, to start decompression without startup delay.
+* `dict` content is copied inside DDict.
+* Consequently, `dict` can be released after `ZSTD_DDict` creation */
+ZSTD_DDict* ZSTD_createDDict(const void* dict, size_t dictSize)
+{
+ ZSTD_customMem const allocator = { NULL, NULL, NULL };
+ return ZSTD_createDDict_advanced(dict, dictSize, 0, allocator);
+}
+
+/*! ZSTD_createDDict_byReference() :
+ * Create a digested dictionary, to start decompression without startup delay.
+ * Dictionary content is simply referenced, it will be accessed during decompression.
+ * Warning : dictBuffer must outlive DDict (DDict must be freed before dictBuffer) */
+ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize)
+{
+ ZSTD_customMem const allocator = { NULL, NULL, NULL };
+ return ZSTD_createDDict_advanced(dictBuffer, dictSize, 1, allocator);
+}
+
+
+ZSTD_DDict* ZSTD_initStaticDDict(void* workspace, size_t workspaceSize,
+ const void* dict, size_t dictSize,
+ unsigned byReference)
+{
+ size_t const neededSpace = sizeof(ZSTD_DDict) + (byReference ? 0 : dictSize);
+ ZSTD_DDict* const ddict = (ZSTD_DDict*)workspace;
+ assert(workspace != NULL);
+ assert(dict != NULL);
+ if ((size_t)workspace & 7) return NULL; /* 8-aligned */
+ if (workspaceSize < neededSpace) return NULL;
+ if (!byReference) {
+ memcpy(ddict+1, dict, dictSize); /* local copy */
+ dict = ddict+1;
+ }
+ if (ZSTD_isError( ZSTD_initDDict_internal(ddict, dict, dictSize, 1 /* byRef */) ))
+ return NULL;
+ return ddict;
+}
+
+
+size_t ZSTD_freeDDict(ZSTD_DDict* ddict)
+{
+ if (ddict==NULL) return 0; /* support free on NULL */
+ { ZSTD_customMem const cMem = ddict->cMem;
+ ZSTD_free(ddict->dictBuffer, cMem);
+ ZSTD_free(ddict, cMem);
+ return 0;
+ }
+}
+
+/*! ZSTD_estimateDDictSize() :
+ * Estimate amount of memory that will be needed to create a dictionary for decompression.
+ * Note : dictionary created "byReference" are smaller */
+size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference)
+{
+ return sizeof(ZSTD_DDict) + (byReference ? 0 : dictSize);
+}
+
+size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict)
+{
+ if (ddict==NULL) return 0; /* support sizeof on NULL */
+ return sizeof(*ddict) + (ddict->dictBuffer ? ddict->dictSize : 0) ;
+}
+
+/*! ZSTD_getDictID_fromDict() :
+ * Provides the dictID stored within dictionary.
+ * if @return == 0, the dictionary is not conformant with Zstandard specification.
+ * It can still be loaded, but as a content-only dictionary. */
+unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize)
+{
+ if (dictSize < 8) return 0;
+ if (MEM_readLE32(dict) != ZSTD_MAGIC_DICTIONARY) return 0;
+ return MEM_readLE32((const char*)dict + 4);
+}
+
+/*! ZSTD_getDictID_fromDDict() :
+ * Provides the dictID of the dictionary loaded into `ddict`.
+ * If @return == 0, the dictionary is not conformant to Zstandard specification, or empty.
+ * Non-conformant dictionaries can still be loaded, but as content-only dictionaries. */
+unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict)
+{
+ if (ddict==NULL) return 0;
+ return ZSTD_getDictID_fromDict(ddict->dictContent, ddict->dictSize);
+}
+
+/*! ZSTD_getDictID_fromFrame() :
+ * Provides the dictID required to decompresse frame stored within `src`.
+ * If @return == 0, the dictID could not be decoded.
+ * This could for one of the following reasons :
+ * - The frame does not require a dictionary (most common case).
+ * - The frame was built with dictID intentionally removed.
+ * Needed dictionary is a hidden information.
+ * Note : this use case also happens when using a non-conformant dictionary.
+ * - `srcSize` is too small, and as a result, frame header could not be decoded.
+ * Note : possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`.
+ * - This is not a Zstandard frame.
+ * When identifying the exact failure cause, it's possible to use
+ * ZSTD_getFrameHeader(), which will provide a more precise error code. */
+unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize)
+{
+ ZSTD_frameHeader zfp = { 0 , 0 , 0 , 0 };
+ size_t const hError = ZSTD_getFrameHeader(&zfp, src, srcSize);
+ if (ZSTD_isError(hError)) return 0;
+ return zfp.dictID;
+}
+
+
+/*! ZSTD_decompress_usingDDict() :
+* Decompression using a pre-digested Dictionary
+* Use dictionary without significant overhead. */
+size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const ZSTD_DDict* ddict)
+{
+ /* pass content and size in case legacy frames are encountered */
+ return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize,
+ NULL, 0,
+ ddict);
+}
+
+
+/*=====================================
+* Streaming decompression
+*====================================*/
+
+ZSTD_DStream* ZSTD_createDStream(void)
+{
+ return ZSTD_createDStream_advanced(ZSTD_defaultCMem);
+}
+
+ZSTD_DStream* ZSTD_initStaticDStream(void *workspace, size_t workspaceSize)
+{
+ return ZSTD_initStaticDCtx(workspace, workspaceSize);
+}
+
+ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem)
+{
+ return ZSTD_createDCtx_advanced(customMem);
+}
+
+size_t ZSTD_freeDStream(ZSTD_DStream* zds)
+{
+ return ZSTD_freeDCtx(zds);
+}
+
+
+/* *** Initialization *** */
+
+size_t ZSTD_DStreamInSize(void) { return ZSTD_BLOCKSIZE_MAX + ZSTD_blockHeaderSize; }
+size_t ZSTD_DStreamOutSize(void) { return ZSTD_BLOCKSIZE_MAX; }
+
+size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize)
+{
+ zds->streamStage = zdss_loadHeader;
+ zds->lhSize = zds->inPos = zds->outStart = zds->outEnd = 0;
+ ZSTD_freeDDict(zds->ddictLocal);
+ if (dict && dictSize >= 8) {
+ zds->ddictLocal = ZSTD_createDDict(dict, dictSize);
+ if (zds->ddictLocal == NULL) return ERROR(memory_allocation);
+ } else zds->ddictLocal = NULL;
+ zds->ddict = zds->ddictLocal;
+ zds->legacyVersion = 0;
+ zds->hostageByte = 0;
+ return ZSTD_frameHeaderSize_prefix;
+}
+
+size_t ZSTD_initDStream(ZSTD_DStream* zds)
+{
+ return ZSTD_initDStream_usingDict(zds, NULL, 0);
+}
+
+/* ZSTD_initDStream_usingDDict() :
+ * ddict will just be referenced, and must outlive decompression session */
+size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict)
+{
+ size_t const initResult = ZSTD_initDStream(zds);
+ zds->ddict = ddict;
+ return initResult;
+}
+
+size_t ZSTD_resetDStream(ZSTD_DStream* zds)
+{
+ zds->streamStage = zdss_loadHeader;
+ zds->lhSize = zds->inPos = zds->outStart = zds->outEnd = 0;
+ zds->legacyVersion = 0;
+ zds->hostageByte = 0;
+ return ZSTD_frameHeaderSize_prefix;
+}
+
+size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds,
+ ZSTD_DStreamParameter_e paramType, unsigned paramValue)
+{
+ switch(paramType)
+ {
+ default : return ERROR(parameter_unknown);
+ case DStream_p_maxWindowSize : zds->maxWindowSize = paramValue ? paramValue : (U32)(-1); break;
+ }
+ return 0;
+}
+
+
+size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds)
+{
+ return ZSTD_sizeof_DCtx(zds);
+}
+
+size_t ZSTD_estimateDStreamSize(size_t windowSize)
+{
+ size_t const blockSize = MIN(windowSize, ZSTD_BLOCKSIZE_MAX);
+ size_t const inBuffSize = blockSize; /* no block can be larger */
+ size_t const outBuffSize = windowSize + blockSize + (WILDCOPY_OVERLENGTH * 2);
+ return sizeof(ZSTD_DStream) + ZSTD_estimateDCtxSize() + inBuffSize + outBuffSize;
+}
+
+ZSTDLIB_API size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize)
+{
+ ZSTD_frameHeader fh;
+ size_t const err = ZSTD_getFrameHeader(&fh, src, srcSize);
+ if (ZSTD_isError(err)) return err;
+ if (err>0) return ERROR(srcSize_wrong);
+ return ZSTD_estimateDStreamSize(fh.windowSize);
+}
+
+
+/* ***** Decompression ***** */
+
+MEM_STATIC size_t ZSTD_limitCopy(void* dst, size_t dstCapacity, const void* src, size_t srcSize)
+{
+ size_t const length = MIN(dstCapacity, srcSize);
+ memcpy(dst, src, length);
+ return length;
+}
+
+
+size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input)
+{
+ const char* const istart = (const char*)(input->src) + input->pos;
+ const char* const iend = (const char*)(input->src) + input->size;
+ const char* ip = istart;
+ char* const ostart = (char*)(output->dst) + output->pos;
+ char* const oend = (char*)(output->dst) + output->size;
+ char* op = ostart;
+ U32 someMoreWork = 1;
+
+ DEBUGLOG(5, "ZSTD_decompressStream");
+ DEBUGLOG(5, "input size : %u", (U32)(input->size - input->pos));
+#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
+ if (zds->legacyVersion) {
+ /* legacy support is incompatible with static dctx */
+ if (zds->staticSize) return ERROR(memory_allocation);
+ return ZSTD_decompressLegacyStream(zds->legacyContext, zds->legacyVersion, output, input);
+ }
+#endif
+
+ while (someMoreWork) {
+ switch(zds->streamStage)
+ {
+ case zdss_init :
+ ZSTD_resetDStream(zds); /* transparent reset on starting decoding a new frame */
+ /* fall-through */
+
+ case zdss_loadHeader :
+ { size_t const hSize = ZSTD_getFrameHeader(&zds->fParams, zds->headerBuffer, zds->lhSize);
+ if (ZSTD_isError(hSize)) {
+#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
+ U32 const legacyVersion = ZSTD_isLegacy(istart, iend-istart);
+ if (legacyVersion) {
+ const void* const dict = zds->ddict ? zds->ddict->dictContent : NULL;
+ size_t const dictSize = zds->ddict ? zds->ddict->dictSize : 0;
+ /* legacy support is incompatible with static dctx */
+ if (zds->staticSize) return ERROR(memory_allocation);
+ CHECK_F(ZSTD_initLegacyStream(&zds->legacyContext, zds->previousLegacyVersion, legacyVersion,
+ dict, dictSize));
+ zds->legacyVersion = zds->previousLegacyVersion = legacyVersion;
+ return ZSTD_decompressLegacyStream(zds->legacyContext, zds->legacyVersion, output, input);
+ } else {
+ return hSize; /* error */
+ }
+#else
+ return hSize;
+#endif
+ }
+ if (hSize != 0) { /* need more input */
+ size_t const toLoad = hSize - zds->lhSize; /* if hSize!=0, hSize > zds->lhSize */
+ if (toLoad > (size_t)(iend-ip)) { /* not enough input to load full header */
+ if (iend-ip > 0) {
+ memcpy(zds->headerBuffer + zds->lhSize, ip, iend-ip);
+ zds->lhSize += iend-ip;
+ }
+ input->pos = input->size;
+ return (MAX(ZSTD_frameHeaderSize_min, hSize) - zds->lhSize) + ZSTD_blockHeaderSize; /* remaining header bytes + next block header */
+ }
+ assert(ip != NULL);
+ memcpy(zds->headerBuffer + zds->lhSize, ip, toLoad); zds->lhSize = hSize; ip += toLoad;
+ break;
+ } }
+
+ /* check for single-pass mode opportunity */
+ if (zds->fParams.frameContentSize && zds->fParams.windowSize /* skippable frame if == 0 */
+ && (U64)(size_t)(oend-op) >= zds->fParams.frameContentSize) {
+ size_t const cSize = ZSTD_findFrameCompressedSize(istart, iend-istart);
+ if (cSize <= (size_t)(iend-istart)) {
+ size_t const decompressedSize = ZSTD_decompress_usingDDict(zds, op, oend-op, istart, cSize, zds->ddict);
+ if (ZSTD_isError(decompressedSize)) return decompressedSize;
+ ip = istart + cSize;
+ op += decompressedSize;
+ zds->expected = 0;
+ zds->streamStage = zdss_init;
+ someMoreWork = 0;
+ break;
+ } }
+
+ /* Consume header (see ZSTDds_decodeFrameHeader) */
+ DEBUGLOG(4, "Consume header");
+ CHECK_F(ZSTD_decompressBegin_usingDDict(zds, zds->ddict));
+
+ if ((MEM_readLE32(zds->headerBuffer) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) { /* skippable frame */
+ zds->expected = MEM_readLE32(zds->headerBuffer + 4);
+ zds->stage = ZSTDds_skipFrame;
+ } else {
+ CHECK_F(ZSTD_decodeFrameHeader(zds, zds->headerBuffer, zds->lhSize));
+ zds->expected = ZSTD_blockHeaderSize;
+ zds->stage = ZSTDds_decodeBlockHeader;
+ }
+
+ /* control buffer memory usage */
+ DEBUGLOG(4, "Control max buffer memory usage");
+ zds->fParams.windowSize = MAX(zds->fParams.windowSize, 1U << ZSTD_WINDOWLOG_ABSOLUTEMIN);
+ if (zds->fParams.windowSize > zds->maxWindowSize) return ERROR(frameParameter_windowTooLarge);
+
+ /* Adapt buffer sizes to frame header instructions */
+ { size_t const blockSize = MIN(zds->fParams.windowSize, ZSTD_BLOCKSIZE_MAX);
+ size_t const neededOutSize = zds->fParams.windowSize + blockSize + WILDCOPY_OVERLENGTH * 2;
+ zds->blockSize = blockSize;
+ if ((zds->inBuffSize < blockSize) || (zds->outBuffSize < neededOutSize)) {
+ size_t const bufferSize = blockSize + neededOutSize;
+ DEBUGLOG(4, "inBuff : from %u to %u",
+ (U32)zds->inBuffSize, (U32)blockSize);
+ DEBUGLOG(4, "outBuff : from %u to %u",
+ (U32)zds->outBuffSize, (U32)neededOutSize);
+ if (zds->staticSize) { /* static DCtx */
+ DEBUGLOG(4, "staticSize : %u", (U32)zds->staticSize);
+ assert(zds->staticSize >= sizeof(ZSTD_DCtx)); /* controlled at init */
+ if (bufferSize > zds->staticSize - sizeof(ZSTD_DCtx))
+ return ERROR(memory_allocation);
+ } else {
+ ZSTD_free(zds->inBuff, zds->customMem);
+ zds->inBuffSize = 0;
+ zds->outBuffSize = 0;
+ zds->inBuff = (char*)ZSTD_malloc(bufferSize, zds->customMem);
+ if (zds->inBuff == NULL) return ERROR(memory_allocation);
+ }
+ zds->inBuffSize = blockSize;
+ zds->outBuff = zds->inBuff + zds->inBuffSize;
+ zds->outBuffSize = neededOutSize;
+ } }
+ zds->streamStage = zdss_read;
+ /* pass-through */
+
+ case zdss_read:
+ DEBUGLOG(5, "stage zdss_read");
+ { size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds);
+ DEBUGLOG(5, "neededInSize = %u", (U32)neededInSize);
+ if (neededInSize==0) { /* end of frame */
+ zds->streamStage = zdss_init;
+ someMoreWork = 0;
+ break;
+ }
+ if ((size_t)(iend-ip) >= neededInSize) { /* decode directly from src */
+ int const isSkipFrame = ZSTD_isSkipFrame(zds);
+ size_t const decodedSize = ZSTD_decompressContinue(zds,
+ zds->outBuff + zds->outStart, (isSkipFrame ? 0 : zds->outBuffSize - zds->outStart),
+ ip, neededInSize);
+ if (ZSTD_isError(decodedSize)) return decodedSize;
+ ip += neededInSize;
+ if (!decodedSize && !isSkipFrame) break; /* this was just a header */
+ zds->outEnd = zds->outStart + decodedSize;
+ zds->streamStage = zdss_flush;
+ break;
+ } }
+ if (ip==iend) { someMoreWork = 0; break; } /* no more input */
+ zds->streamStage = zdss_load;
+ /* pass-through */
+
+ case zdss_load:
+ { size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds);
+ size_t const toLoad = neededInSize - zds->inPos; /* should always be <= remaining space within inBuff */
+ size_t loadedSize;
+ if (toLoad > zds->inBuffSize - zds->inPos) return ERROR(corruption_detected); /* should never happen */
+ loadedSize = ZSTD_limitCopy(zds->inBuff + zds->inPos, toLoad, ip, iend-ip);
+ ip += loadedSize;
+ zds->inPos += loadedSize;
+ if (loadedSize < toLoad) { someMoreWork = 0; break; } /* not enough input, wait for more */
+
+ /* decode loaded input */
+ { const int isSkipFrame = ZSTD_isSkipFrame(zds);
+ size_t const decodedSize = ZSTD_decompressContinue(zds,
+ zds->outBuff + zds->outStart, zds->outBuffSize - zds->outStart,
+ zds->inBuff, neededInSize);
+ if (ZSTD_isError(decodedSize)) return decodedSize;
+ zds->inPos = 0; /* input is consumed */
+ if (!decodedSize && !isSkipFrame) { zds->streamStage = zdss_read; break; } /* this was just a header */
+ zds->outEnd = zds->outStart + decodedSize;
+ } }
+ zds->streamStage = zdss_flush;
+ /* pass-through */
+
+ case zdss_flush:
+ { size_t const toFlushSize = zds->outEnd - zds->outStart;
+ size_t const flushedSize = ZSTD_limitCopy(op, oend-op, zds->outBuff + zds->outStart, toFlushSize);
+ op += flushedSize;
+ zds->outStart += flushedSize;
+ if (flushedSize == toFlushSize) { /* flush completed */
+ zds->streamStage = zdss_read;
+ if (zds->outStart + zds->blockSize > zds->outBuffSize)
+ zds->outStart = zds->outEnd = 0;
+ break;
+ } }
+ /* cannot complete flush */
+ someMoreWork = 0;
+ break;
+
+ default: return ERROR(GENERIC); /* impossible */
+ } }
+
+ /* result */
+ input->pos += (size_t)(ip-istart);
+ output->pos += (size_t)(op-ostart);
+ { size_t nextSrcSizeHint = ZSTD_nextSrcSizeToDecompress(zds);
+ if (!nextSrcSizeHint) { /* frame fully decoded */
+ if (zds->outEnd == zds->outStart) { /* output fully flushed */
+ if (zds->hostageByte) {
+ if (input->pos >= input->size) {
+ /* can't release hostage (not present) */
+ zds->streamStage = zdss_read;
+ return 1;
+ }
+ input->pos++; /* release hostage */
+ } /* zds->hostageByte */
+ return 0;
+ } /* zds->outEnd == zds->outStart */
+ if (!zds->hostageByte) { /* output not fully flushed; keep last byte as hostage; will be released when all output is flushed */
+ input->pos--; /* note : pos > 0, otherwise, impossible to finish reading last block */
+ zds->hostageByte=1;
+ }
+ return 1;
+ } /* nextSrcSizeHint==0 */
+ nextSrcSizeHint += ZSTD_blockHeaderSize * (ZSTD_nextInputType(zds) == ZSTDnit_block); /* preload header of next block */
+ if (zds->inPos > nextSrcSizeHint) return ERROR(GENERIC); /* should never happen */
+ nextSrcSizeHint -= zds->inPos; /* already loaded*/
+ return nextSrcSizeHint;
+ }
+}
diff --git a/thirdparty/zstd/zstd.h b/thirdparty/zstd/zstd.h
new file mode 100644
index 0000000000..58e9a5606d
--- /dev/null
+++ b/thirdparty/zstd/zstd.h
@@ -0,0 +1,1136 @@
+/*
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+#ifndef ZSTD_H_235446
+#define ZSTD_H_235446
+
+/* ====== Dependency ======*/
+#include <stddef.h> /* size_t */
+
+
+/* ===== ZSTDLIB_API : control library symbols visibility ===== */
+#ifndef ZSTDLIB_VISIBILITY
+# if defined(__GNUC__) && (__GNUC__ >= 4)
+# define ZSTDLIB_VISIBILITY __attribute__ ((visibility ("default")))
+# else
+# define ZSTDLIB_VISIBILITY
+# endif
+#endif
+#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
+# define ZSTDLIB_API __declspec(dllexport) ZSTDLIB_VISIBILITY
+#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
+# define ZSTDLIB_API __declspec(dllimport) ZSTDLIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
+#else
+# define ZSTDLIB_API ZSTDLIB_VISIBILITY
+#endif
+
+
+/*******************************************************************************************************
+ Introduction
+
+ zstd, short for Zstandard, is a fast lossless compression algorithm,
+ targeting real-time compression scenarios at zlib-level and better compression ratios.
+ The zstd compression library provides in-memory compression and decompression functions.
+ The library supports compression levels from 1 up to ZSTD_maxCLevel() which is currently 22.
+ Levels >= 20, labeled `--ultra`, should be used with caution, as they require more memory.
+ Compression can be done in:
+ - a single step (described as Simple API)
+ - a single step, reusing a context (described as Explicit memory management)
+ - unbounded multiple steps (described as Streaming compression)
+ The compression ratio achievable on small data can be highly improved using a dictionary in:
+ - a single step (described as Simple dictionary API)
+ - a single step, reusing a dictionary (described as Fast dictionary API)
+
+ Advanced experimental functions can be accessed using #define ZSTD_STATIC_LINKING_ONLY before including zstd.h.
+ Advanced experimental APIs shall never be used with a dynamic library.
+ They are not "stable", their definition may change in the future. Only static linking is allowed.
+*********************************************************************************************************/
+
+/*------ Version ------*/
+#define ZSTD_VERSION_MAJOR 1
+#define ZSTD_VERSION_MINOR 3
+#define ZSTD_VERSION_RELEASE 0
+
+#define ZSTD_VERSION_NUMBER (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)
+ZSTDLIB_API unsigned ZSTD_versionNumber(void); /**< useful to check dll version */
+
+#define ZSTD_LIB_VERSION ZSTD_VERSION_MAJOR.ZSTD_VERSION_MINOR.ZSTD_VERSION_RELEASE
+#define ZSTD_QUOTE(str) #str
+#define ZSTD_EXPAND_AND_QUOTE(str) ZSTD_QUOTE(str)
+#define ZSTD_VERSION_STRING ZSTD_EXPAND_AND_QUOTE(ZSTD_LIB_VERSION)
+ZSTDLIB_API const char* ZSTD_versionString(void); /* v1.3.0 */
+
+
+/***************************************
+* Simple API
+***************************************/
+/*! ZSTD_compress() :
+ * Compresses `src` content as a single zstd compressed frame into already allocated `dst`.
+ * Hint : compression runs faster if `dstCapacity` >= `ZSTD_compressBound(srcSize)`.
+ * @return : compressed size written into `dst` (<= `dstCapacity),
+ * or an error code if it fails (which can be tested using ZSTD_isError()). */
+ZSTDLIB_API size_t ZSTD_compress( void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ int compressionLevel);
+
+/*! ZSTD_decompress() :
+ * `compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames.
+ * `dstCapacity` is an upper bound of originalSize to regenerate.
+ * If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data.
+ * @return : the number of bytes decompressed into `dst` (<= `dstCapacity`),
+ * or an errorCode if it fails (which can be tested using ZSTD_isError()). */
+ZSTDLIB_API size_t ZSTD_decompress( void* dst, size_t dstCapacity,
+ const void* src, size_t compressedSize);
+
+/*! ZSTD_getFrameContentSize() : v1.3.0
+ * `src` should point to the start of a ZSTD encoded frame.
+ * `srcSize` must be at least as large as the frame header.
+ * hint : any size >= `ZSTD_frameHeaderSize_max` is large enough.
+ * @return : - decompressed size of the frame in `src`, if known
+ * - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined
+ * - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small)
+ * note 1 : a 0 return value means the frame is valid but "empty".
+ * note 2 : decompressed size is an optional field, it may not be present, typically in streaming mode.
+ * When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size.
+ * In which case, it's necessary to use streaming mode to decompress data.
+ * Optionally, application can rely on some implicit limit,
+ * as ZSTD_decompress() only needs an upper bound of decompressed size.
+ * (For example, data could be necessarily cut into blocks <= 16 KB).
+ * note 3 : decompressed size is always present when compression is done with ZSTD_compress()
+ * note 4 : decompressed size can be very large (64-bits value),
+ * potentially larger than what local system can handle as a single memory segment.
+ * In which case, it's necessary to use streaming mode to decompress data.
+ * note 5 : If source is untrusted, decompressed size could be wrong or intentionally modified.
+ * Always ensure return value fits within application's authorized limits.
+ * Each application can set its own limits.
+ * note 6 : This function replaces ZSTD_getDecompressedSize() */
+#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
+#define ZSTD_CONTENTSIZE_ERROR (0ULL - 2)
+ZSTDLIB_API unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);
+
+/*! ZSTD_getDecompressedSize() :
+ * NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize().
+ * Both functions work the same way,
+ * but ZSTD_getDecompressedSize() blends
+ * "empty", "unknown" and "error" results in the same return value (0),
+ * while ZSTD_getFrameContentSize() distinguishes them.
+ *
+ * 'src' is the start of a zstd compressed frame.
+ * @return : content size to be decompressed, as a 64-bits value _if known and not empty_, 0 otherwise. */
+ZSTDLIB_API unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
+
+
+/*====== Helper functions ======*/
+ZSTDLIB_API int ZSTD_maxCLevel(void); /*!< maximum compression level available */
+ZSTDLIB_API size_t ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case scenario */
+ZSTDLIB_API unsigned ZSTD_isError(size_t code); /*!< tells if a `size_t` function result is an error code */
+ZSTDLIB_API const char* ZSTD_getErrorName(size_t code); /*!< provides readable string from an error code */
+
+
+/***************************************
+* Explicit memory management
+***************************************/
+/*= Compression context
+ * When compressing many times,
+ * it is recommended to allocate a context just once, and re-use it for each successive compression operation.
+ * This will make workload friendlier for system's memory.
+ * Use one context per thread for parallel execution in multi-threaded environments. */
+typedef struct ZSTD_CCtx_s ZSTD_CCtx;
+ZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx(void);
+ZSTDLIB_API size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx);
+
+/*! ZSTD_compressCCtx() :
+ * Same as ZSTD_compress(), requires an allocated ZSTD_CCtx (see ZSTD_createCCtx()). */
+ZSTDLIB_API size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ int compressionLevel);
+
+/*= Decompression context
+ * When decompressing many times,
+ * it is recommended to allocate a context only once,
+ * and re-use it for each successive compression operation.
+ * This will make workload friendlier for system's memory.
+ * Use one context per thread for parallel execution. */
+typedef struct ZSTD_DCtx_s ZSTD_DCtx;
+ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx(void);
+ZSTDLIB_API size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx);
+
+/*! ZSTD_decompressDCtx() :
+ * Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx (see ZSTD_createDCtx()) */
+ZSTDLIB_API size_t ZSTD_decompressDCtx(ZSTD_DCtx* ctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize);
+
+
+/**************************
+* Simple dictionary API
+***************************/
+/*! ZSTD_compress_usingDict() :
+ * Compression using a predefined Dictionary (see dictBuilder/zdict.h).
+ * Note : This function loads the dictionary, resulting in significant startup delay.
+ * Note : When `dict == NULL || dictSize < 8` no dictionary is used. */
+ZSTDLIB_API size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const void* dict,size_t dictSize,
+ int compressionLevel);
+
+/*! ZSTD_decompress_usingDict() :
+ * Decompression using a predefined Dictionary (see dictBuilder/zdict.h).
+ * Dictionary must be identical to the one used during compression.
+ * Note : This function loads the dictionary, resulting in significant startup delay.
+ * Note : When `dict == NULL || dictSize < 8` no dictionary is used. */
+ZSTDLIB_API size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const void* dict,size_t dictSize);
+
+
+/**********************************
+ * Bulk processing dictionary API
+ *********************************/
+typedef struct ZSTD_CDict_s ZSTD_CDict;
+
+/*! ZSTD_createCDict() :
+ * When compressing multiple messages / blocks with the same dictionary, it's recommended to load it just once.
+ * ZSTD_createCDict() will create a digested dictionary, ready to start future compression operations without startup delay.
+ * ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only.
+ * `dictBuffer` can be released after ZSTD_CDict creation, since its content is copied within CDict */
+ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,
+ int compressionLevel);
+
+/*! ZSTD_freeCDict() :
+ * Function frees memory allocated by ZSTD_createCDict(). */
+ZSTDLIB_API size_t ZSTD_freeCDict(ZSTD_CDict* CDict);
+
+/*! ZSTD_compress_usingCDict() :
+ * Compression using a digested Dictionary.
+ * Faster startup than ZSTD_compress_usingDict(), recommended when same dictionary is used multiple times.
+ * Note that compression level is decided during dictionary creation.
+ * Frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no) */
+ZSTDLIB_API size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const ZSTD_CDict* cdict);
+
+
+typedef struct ZSTD_DDict_s ZSTD_DDict;
+
+/*! ZSTD_createDDict() :
+ * Create a digested dictionary, ready to start decompression operation without startup delay.
+ * dictBuffer can be released after DDict creation, as its content is copied inside DDict */
+ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict(const void* dictBuffer, size_t dictSize);
+
+/*! ZSTD_freeDDict() :
+ * Function frees memory allocated with ZSTD_createDDict() */
+ZSTDLIB_API size_t ZSTD_freeDDict(ZSTD_DDict* ddict);
+
+/*! ZSTD_decompress_usingDDict() :
+ * Decompression using a digested Dictionary.
+ * Faster startup than ZSTD_decompress_usingDict(), recommended when same dictionary is used multiple times. */
+ZSTDLIB_API size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const ZSTD_DDict* ddict);
+
+
+/****************************
+* Streaming
+****************************/
+
+typedef struct ZSTD_inBuffer_s {
+ const void* src; /**< start of input buffer */
+ size_t size; /**< size of input buffer */
+ size_t pos; /**< position where reading stopped. Will be updated. Necessarily 0 <= pos <= size */
+} ZSTD_inBuffer;
+
+typedef struct ZSTD_outBuffer_s {
+ void* dst; /**< start of output buffer */
+ size_t size; /**< size of output buffer */
+ size_t pos; /**< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size */
+} ZSTD_outBuffer;
+
+
+
+/*-***********************************************************************
+* Streaming compression - HowTo
+*
+* A ZSTD_CStream object is required to track streaming operation.
+* Use ZSTD_createCStream() and ZSTD_freeCStream() to create/release resources.
+* ZSTD_CStream objects can be reused multiple times on consecutive compression operations.
+* It is recommended to re-use ZSTD_CStream in situations where many streaming operations will be achieved consecutively,
+* since it will play nicer with system's memory, by re-using already allocated memory.
+* Use one separate ZSTD_CStream per thread for parallel execution.
+*
+* Start a new compression by initializing ZSTD_CStream.
+* Use ZSTD_initCStream() to start a new compression operation.
+* Use ZSTD_initCStream_usingDict() or ZSTD_initCStream_usingCDict() for a compression which requires a dictionary (experimental section)
+*
+* Use ZSTD_compressStream() repetitively to consume input stream.
+* The function will automatically update both `pos` fields.
+* Note that it may not consume the entire input, in which case `pos < size`,
+* and it's up to the caller to present again remaining data.
+* @return : a size hint, preferred nb of bytes to use as input for next function call
+* or an error code, which can be tested using ZSTD_isError().
+* Note 1 : it's just a hint, to help latency a little, any other value will work fine.
+* Note 2 : size hint is guaranteed to be <= ZSTD_CStreamInSize()
+*
+* At any moment, it's possible to flush whatever data remains within internal buffer, using ZSTD_flushStream().
+* `output->pos` will be updated.
+* Note that some content might still be left within internal buffer if `output->size` is too small.
+* @return : nb of bytes still present within internal buffer (0 if it's empty)
+* or an error code, which can be tested using ZSTD_isError().
+*
+* ZSTD_endStream() instructs to finish a frame.
+* It will perform a flush and write frame epilogue.
+* The epilogue is required for decoders to consider a frame completed.
+* ZSTD_endStream() may not be able to flush full data if `output->size` is too small.
+* In which case, call again ZSTD_endStream() to complete the flush.
+* @return : 0 if frame fully completed and fully flushed,
+ or >0 if some data is still present within internal buffer
+ (value is minimum size estimation for remaining data to flush, but it could be more)
+* or an error code, which can be tested using ZSTD_isError().
+*
+* *******************************************************************/
+
+typedef ZSTD_CCtx ZSTD_CStream; /**< CCtx and CStream are now effectively same object (>= v1.3.0) */
+ /* Continue to distinguish them for compatibility with versions <= v1.2.0 */
+/*===== ZSTD_CStream management functions =====*/
+ZSTDLIB_API ZSTD_CStream* ZSTD_createCStream(void);
+ZSTDLIB_API size_t ZSTD_freeCStream(ZSTD_CStream* zcs);
+
+/*===== Streaming compression functions =====*/
+ZSTDLIB_API size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
+ZSTDLIB_API size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
+ZSTDLIB_API size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
+ZSTDLIB_API size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
+
+ZSTDLIB_API size_t ZSTD_CStreamInSize(void); /**< recommended size for input buffer */
+ZSTDLIB_API size_t ZSTD_CStreamOutSize(void); /**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block in all circumstances. */
+
+
+
+/*-***************************************************************************
+* Streaming decompression - HowTo
+*
+* A ZSTD_DStream object is required to track streaming operations.
+* Use ZSTD_createDStream() and ZSTD_freeDStream() to create/release resources.
+* ZSTD_DStream objects can be re-used multiple times.
+*
+* Use ZSTD_initDStream() to start a new decompression operation,
+* or ZSTD_initDStream_usingDict() if decompression requires a dictionary.
+* @return : recommended first input size
+*
+* Use ZSTD_decompressStream() repetitively to consume your input.
+* The function will update both `pos` fields.
+* If `input.pos < input.size`, some input has not been consumed.
+* It's up to the caller to present again remaining data.
+* If `output.pos < output.size`, decoder has flushed everything it could.
+* @return : 0 when a frame is completely decoded and fully flushed,
+* an error code, which can be tested using ZSTD_isError(),
+* any other value > 0, which means there is still some decoding to do to complete current frame.
+* The return value is a suggested next input size (a hint to improve latency) that will never load more than the current frame.
+* *******************************************************************************/
+
+typedef ZSTD_DCtx ZSTD_DStream; /**< DCtx and DStream are now effectively same object (>= v1.3.0) */
+ /* Continue to distinguish them for compatibility with versions <= v1.2.0 */
+/*===== ZSTD_DStream management functions =====*/
+ZSTDLIB_API ZSTD_DStream* ZSTD_createDStream(void);
+ZSTDLIB_API size_t ZSTD_freeDStream(ZSTD_DStream* zds);
+
+/*===== Streaming decompression functions =====*/
+ZSTDLIB_API size_t ZSTD_initDStream(ZSTD_DStream* zds);
+ZSTDLIB_API size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
+
+ZSTDLIB_API size_t ZSTD_DStreamInSize(void); /*!< recommended size for input buffer */
+ZSTDLIB_API size_t ZSTD_DStreamOutSize(void); /*!< recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances. */
+
+#endif /* ZSTD_H_235446 */
+
+
+
+/****************************************************************************************
+ * START OF ADVANCED AND EXPERIMENTAL FUNCTIONS
+ * The definitions in this section are considered experimental.
+ * They should never be used with a dynamic library, as prototypes may change in the future.
+ * They are provided for advanced scenarios.
+ * Use them only in association with static linking.
+ * ***************************************************************************************/
+
+#if defined(ZSTD_STATIC_LINKING_ONLY) && !defined(ZSTD_H_ZSTD_STATIC_LINKING_ONLY)
+#define ZSTD_H_ZSTD_STATIC_LINKING_ONLY
+
+/* --- Constants ---*/
+#define ZSTD_MAGICNUMBER 0xFD2FB528 /* >= v0.8.0 */
+#define ZSTD_MAGIC_SKIPPABLE_START 0x184D2A50U
+#define ZSTD_MAGIC_DICTIONARY 0xEC30A437 /* v0.7+ */
+
+#define ZSTD_WINDOWLOG_MAX_32 27
+#define ZSTD_WINDOWLOG_MAX_64 27
+#define ZSTD_WINDOWLOG_MAX ((unsigned)(sizeof(size_t) == 4 ? ZSTD_WINDOWLOG_MAX_32 : ZSTD_WINDOWLOG_MAX_64))
+#define ZSTD_WINDOWLOG_MIN 10
+#define ZSTD_HASHLOG_MAX ZSTD_WINDOWLOG_MAX
+#define ZSTD_HASHLOG_MIN 6
+#define ZSTD_CHAINLOG_MAX (ZSTD_WINDOWLOG_MAX+1)
+#define ZSTD_CHAINLOG_MIN ZSTD_HASHLOG_MIN
+#define ZSTD_HASHLOG3_MAX 17
+#define ZSTD_SEARCHLOG_MAX (ZSTD_WINDOWLOG_MAX-1)
+#define ZSTD_SEARCHLOG_MIN 1
+#define ZSTD_SEARCHLENGTH_MAX 7 /* only for ZSTD_fast, other strategies are limited to 6 */
+#define ZSTD_SEARCHLENGTH_MIN 3 /* only for ZSTD_btopt, other strategies are limited to 4 */
+#define ZSTD_TARGETLENGTH_MIN 4
+#define ZSTD_TARGETLENGTH_MAX 999
+
+#define ZSTD_FRAMEHEADERSIZE_MAX 18 /* for static allocation */
+#define ZSTD_FRAMEHEADERSIZE_MIN 6
+static const size_t ZSTD_frameHeaderSize_prefix = 5; /* minimum input size to know frame header size */
+static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX;
+static const size_t ZSTD_frameHeaderSize_min = ZSTD_FRAMEHEADERSIZE_MIN;
+static const size_t ZSTD_skippableHeaderSize = 8; /* magic number + skippable frame length */
+
+
+/*--- Advanced types ---*/
+typedef enum { ZSTD_fast=1, ZSTD_dfast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2,
+ ZSTD_btlazy2, ZSTD_btopt, ZSTD_btultra } ZSTD_strategy; /* from faster to stronger */
+
+typedef struct {
+ unsigned windowLog; /**< largest match distance : larger == more compression, more memory needed during decompression */
+ unsigned chainLog; /**< fully searched segment : larger == more compression, slower, more memory (useless for fast) */
+ unsigned hashLog; /**< dispatch table : larger == faster, more memory */
+ unsigned searchLog; /**< nb of searches : larger == more compression, slower */
+ unsigned searchLength; /**< match length searched : larger == faster decompression, sometimes less compression */
+ unsigned targetLength; /**< acceptable match size for optimal parser (only) : larger == more compression, slower */
+ ZSTD_strategy strategy;
+} ZSTD_compressionParameters;
+
+typedef struct {
+ unsigned contentSizeFlag; /**< 1: content size will be in frame header (when known) */
+ unsigned checksumFlag; /**< 1: generate a 32-bits checksum at end of frame, for error detection */
+ unsigned noDictIDFlag; /**< 1: no dictID will be saved into frame header (if dictionary compression) */
+} ZSTD_frameParameters;
+
+typedef struct {
+ ZSTD_compressionParameters cParams;
+ ZSTD_frameParameters fParams;
+} ZSTD_parameters;
+
+typedef struct {
+ unsigned long long frameContentSize;
+ size_t windowSize;
+ unsigned dictID;
+ unsigned checksumFlag;
+} ZSTD_frameHeader;
+
+/*= Custom memory allocation functions */
+typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);
+typedef void (*ZSTD_freeFunction) (void* opaque, void* address);
+typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;
+/* use this constant to defer to stdlib's functions */
+static const ZSTD_customMem ZSTD_defaultCMem = { NULL, NULL, NULL };
+
+
+/***************************************
+* Frame size functions
+***************************************/
+
+/*! ZSTD_findFrameCompressedSize() :
+ * `src` should point to the start of a ZSTD encoded frame or skippable frame
+ * `srcSize` must be at least as large as the frame
+ * @return : the compressed size of the first frame starting at `src`,
+ * suitable to pass to `ZSTD_decompress` or similar,
+ * or an error code if input is invalid */
+ZSTDLIB_API size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
+
+/*! ZSTD_findDecompressedSize() :
+ * `src` should point the start of a series of ZSTD encoded and/or skippable frames
+ * `srcSize` must be the _exact_ size of this series
+ * (i.e. there should be a frame boundary exactly at `srcSize` bytes after `src`)
+ * @return : - decompressed size of all data in all successive frames
+ * - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN
+ * - if an error occurred: ZSTD_CONTENTSIZE_ERROR
+ *
+ * note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode.
+ * When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size.
+ * In which case, it's necessary to use streaming mode to decompress data.
+ * note 2 : decompressed size is always present when compression is done with ZSTD_compress()
+ * note 3 : decompressed size can be very large (64-bits value),
+ * potentially larger than what local system can handle as a single memory segment.
+ * In which case, it's necessary to use streaming mode to decompress data.
+ * note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified.
+ * Always ensure result fits within application's authorized limits.
+ * Each application can set its own limits.
+ * note 5 : ZSTD_findDecompressedSize handles multiple frames, and so it must traverse the input to
+ * read each contained frame header. This is fast as most of the data is skipped,
+ * however it does mean that all frame data must be present and valid. */
+ZSTDLIB_API unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);
+
+/*! ZSTD_frameHeaderSize() :
+* `src` should point to the start of a ZSTD frame
+* `srcSize` must be >= ZSTD_frameHeaderSize_prefix.
+* @return : size of the Frame Header */
+ZSTDLIB_API size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
+
+
+/***************************************
+* Context memory usage
+***************************************/
+
+/*! ZSTD_sizeof_*() :
+ * These functions give the current memory usage of selected object.
+ * Object memory usage can evolve if it's re-used multiple times. */
+ZSTDLIB_API size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
+ZSTDLIB_API size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
+ZSTDLIB_API size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);
+ZSTDLIB_API size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
+ZSTDLIB_API size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
+ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
+
+/*! ZSTD_estimate*() :
+ * These functions make it possible to estimate memory usage
+ * of a future {D,C}Ctx, before its creation.
+ * ZSTD_estimateCCtxSize() will provide a budget large enough for any compression level up to selected one.
+ * It will also consider src size to be arbitrarily "large", which is worst case.
+ * If srcSize is known to always be small, ZSTD_estimateCCtxSize_advanced() can provide a tighter estimation.
+ * ZSTD_estimateCCtxSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel.
+ * Note : CCtx estimation is only correct for single-threaded compression */
+ZSTDLIB_API size_t ZSTD_estimateCCtxSize(int compressionLevel);
+ZSTDLIB_API size_t ZSTD_estimateCCtxSize_advanced(ZSTD_compressionParameters cParams);
+ZSTDLIB_API size_t ZSTD_estimateDCtxSize(void);
+
+/*! ZSTD_estimate?StreamSize() :
+ * ZSTD_estimateCStreamSize() will provide a budget large enough for any compression level up to selected one.
+ * It will also consider src size to be arbitrarily "large", which is worst case.
+ * If srcSize is known to always be small, ZSTD_estimateCStreamSize_advanced() can provide a tighter estimation.
+ * ZSTD_estimateCStreamSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel.
+ * Note : CStream estimation is only correct for single-threaded compression.
+ * ZSTD_DStream memory budget depends on window Size.
+ * This information can be passed manually, using ZSTD_estimateDStreamSize,
+ * or deducted from a valid frame Header, using ZSTD_estimateDStreamSize_fromFrame();
+ * Note : if streaming is init with function ZSTD_init?Stream_usingDict(),
+ * an internal ?Dict will be created, which additional size is not estimated here.
+ * In this case, get total size by adding ZSTD_estimate?DictSize */
+ZSTDLIB_API size_t ZSTD_estimateCStreamSize(int compressionLevel);
+ZSTDLIB_API size_t ZSTD_estimateCStreamSize_advanced(ZSTD_compressionParameters cParams);
+ZSTDLIB_API size_t ZSTD_estimateDStreamSize(size_t windowSize);
+ZSTDLIB_API size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize);
+
+/*! ZSTD_estimate?DictSize() :
+ * ZSTD_estimateCDictSize() will bet that src size is relatively "small", and content is copied, like ZSTD_createCDict().
+ * ZSTD_estimateCStreamSize_advanced() makes it possible to control precisely compression parameters, like ZSTD_createCDict_advanced().
+ * Note : dictionary created "byReference" are smaller */
+ZSTDLIB_API size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel);
+ZSTDLIB_API size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, unsigned byReference);
+ZSTDLIB_API size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference);
+
+
+/***************************************
+* Advanced compression functions
+***************************************/
+/*! ZSTD_createCCtx_advanced() :
+ * Create a ZSTD compression context using external alloc and free functions */
+ZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem);
+
+/*! ZSTD_initStaticCCtx() : initialize a fixed-size zstd compression context
+ * workspace: The memory area to emplace the context into.
+ * Provided pointer must 8-bytes aligned.
+ * It must outlive context usage.
+ * workspaceSize: Use ZSTD_estimateCCtxSize() or ZSTD_estimateCStreamSize()
+ * to determine how large workspace must be to support scenario.
+ * @return : pointer to ZSTD_CCtx*, or NULL if error (size too small)
+ * Note : zstd will never resize nor malloc() when using a static cctx.
+ * If it needs more memory than available, it will simply error out.
+ * Note 2 : there is no corresponding "free" function.
+ * Since workspace was allocated externally, it must be freed externally too.
+ * Limitation 1 : currently not compatible with internal CDict creation, such as
+ * ZSTD_CCtx_loadDictionary() or ZSTD_initCStream_usingDict().
+ * Limitation 2 : currently not compatible with multi-threading
+ */
+ZSTDLIB_API ZSTD_CCtx* ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize);
+
+
+/* !!! To be deprecated !!! */
+typedef enum {
+ ZSTD_p_forceWindow, /* Force back-references to remain < windowSize, even when referencing Dictionary content (default:0) */
+ ZSTD_p_forceRawDict /* Force loading dictionary in "content-only" mode (no header analysis) */
+} ZSTD_CCtxParameter;
+/*! ZSTD_setCCtxParameter() :
+ * Set advanced parameters, selected through enum ZSTD_CCtxParameter
+ * @result : 0, or an error code (which can be tested with ZSTD_isError()) */
+ZSTDLIB_API size_t ZSTD_setCCtxParameter(ZSTD_CCtx* cctx, ZSTD_CCtxParameter param, unsigned value);
+
+
+/*! ZSTD_createCDict_byReference() :
+ * Create a digested dictionary for compression
+ * Dictionary content is simply referenced, and therefore stays in dictBuffer.
+ * It is important that dictBuffer outlives CDict, it must remain read accessible throughout the lifetime of CDict */
+ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel);
+
+
+typedef enum { ZSTD_dm_auto=0, /* dictionary is "full" if it starts with ZSTD_MAGIC_DICTIONARY, otherwise it is "rawContent" */
+ ZSTD_dm_rawContent, /* ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY */
+ ZSTD_dm_fullDict /* refuses to load a dictionary if it does not respect Zstandard's specification */
+} ZSTD_dictMode_e;
+/*! ZSTD_createCDict_advanced() :
+ * Create a ZSTD_CDict using external alloc and free, and customized compression parameters */
+ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize,
+ unsigned byReference, ZSTD_dictMode_e dictMode,
+ ZSTD_compressionParameters cParams,
+ ZSTD_customMem customMem);
+
+/*! ZSTD_initStaticCDict_advanced() :
+ * Generate a digested dictionary in provided memory area.
+ * workspace: The memory area to emplace the dictionary into.
+ * Provided pointer must 8-bytes aligned.
+ * It must outlive dictionary usage.
+ * workspaceSize: Use ZSTD_estimateCDictSize()
+ * to determine how large workspace must be.
+ * cParams : use ZSTD_getCParams() to transform a compression level
+ * into its relevants cParams.
+ * @return : pointer to ZSTD_CDict*, or NULL if error (size too small)
+ * Note : there is no corresponding "free" function.
+ * Since workspace was allocated externally, it must be freed externally.
+ */
+ZSTDLIB_API ZSTD_CDict* ZSTD_initStaticCDict(
+ void* workspace, size_t workspaceSize,
+ const void* dict, size_t dictSize,
+ unsigned byReference, ZSTD_dictMode_e dictMode,
+ ZSTD_compressionParameters cParams);
+
+/*! ZSTD_getCParams() :
+* @return ZSTD_compressionParameters structure for a selected compression level and estimated srcSize.
+* `estimatedSrcSize` value is optional, select 0 if not known */
+ZSTDLIB_API ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);
+
+/*! ZSTD_getParams() :
+* same as ZSTD_getCParams(), but @return a full `ZSTD_parameters` object instead of sub-component `ZSTD_compressionParameters`.
+* All fields of `ZSTD_frameParameters` are set to default (0) */
+ZSTDLIB_API ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);
+
+/*! ZSTD_checkCParams() :
+* Ensure param values remain within authorized range */
+ZSTDLIB_API size_t ZSTD_checkCParams(ZSTD_compressionParameters params);
+
+/*! ZSTD_adjustCParams() :
+ * optimize params for a given `srcSize` and `dictSize`.
+ * both values are optional, select `0` if unknown. */
+ZSTDLIB_API ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize);
+
+/*! ZSTD_compress_advanced() :
+* Same as ZSTD_compress_usingDict(), with fine-tune control over each compression parameter */
+ZSTDLIB_API size_t ZSTD_compress_advanced (ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const void* dict,size_t dictSize,
+ ZSTD_parameters params);
+
+/*! ZSTD_compress_usingCDict_advanced() :
+* Same as ZSTD_compress_usingCDict(), with fine-tune control over frame parameters */
+ZSTDLIB_API size_t ZSTD_compress_usingCDict_advanced(ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ const ZSTD_CDict* cdict, ZSTD_frameParameters fParams);
+
+
+/*--- Advanced decompression functions ---*/
+
+/*! ZSTD_isFrame() :
+ * Tells if the content of `buffer` starts with a valid Frame Identifier.
+ * Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0.
+ * Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled.
+ * Note 3 : Skippable Frame Identifiers are considered valid. */
+ZSTDLIB_API unsigned ZSTD_isFrame(const void* buffer, size_t size);
+
+/*! ZSTD_createDCtx_advanced() :
+ * Create a ZSTD decompression context using external alloc and free functions */
+ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
+
+/*! ZSTD_initStaticDCtx() : initialize a fixed-size zstd decompression context
+ * workspace: The memory area to emplace the context into.
+ * Provided pointer must 8-bytes aligned.
+ * It must outlive context usage.
+ * workspaceSize: Use ZSTD_estimateDCtxSize() or ZSTD_estimateDStreamSize()
+ * to determine how large workspace must be to support scenario.
+ * @return : pointer to ZSTD_DCtx*, or NULL if error (size too small)
+ * Note : zstd will never resize nor malloc() when using a static dctx.
+ * If it needs more memory than available, it will simply error out.
+ * Note 2 : static dctx is incompatible with legacy support
+ * Note 3 : there is no corresponding "free" function.
+ * Since workspace was allocated externally, it must be freed externally.
+ * Limitation : currently not compatible with internal DDict creation,
+ * such as ZSTD_initDStream_usingDict().
+ */
+ZSTDLIB_API ZSTD_DCtx* ZSTD_initStaticDCtx(void* workspace, size_t workspaceSize);
+
+/*! ZSTD_createDDict_byReference() :
+ * Create a digested dictionary, ready to start decompression operation without startup delay.
+ * Dictionary content is referenced, and therefore stays in dictBuffer.
+ * It is important that dictBuffer outlives DDict,
+ * it must remain read accessible throughout the lifetime of DDict */
+ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize);
+
+/*! ZSTD_createDDict_advanced() :
+ * Create a ZSTD_DDict using external alloc and free, optionally by reference */
+ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
+ unsigned byReference, ZSTD_customMem customMem);
+
+/*! ZSTD_initStaticDDict() :
+ * Generate a digested dictionary in provided memory area.
+ * workspace: The memory area to emplace the dictionary into.
+ * Provided pointer must 8-bytes aligned.
+ * It must outlive dictionary usage.
+ * workspaceSize: Use ZSTD_estimateDDictSize()
+ * to determine how large workspace must be.
+ * @return : pointer to ZSTD_DDict*, or NULL if error (size too small)
+ * Note : there is no corresponding "free" function.
+ * Since workspace was allocated externally, it must be freed externally.
+ */
+ZSTDLIB_API ZSTD_DDict* ZSTD_initStaticDDict(void* workspace, size_t workspaceSize,
+ const void* dict, size_t dictSize,
+ unsigned byReference);
+
+/*! ZSTD_getDictID_fromDict() :
+ * Provides the dictID stored within dictionary.
+ * if @return == 0, the dictionary is not conformant with Zstandard specification.
+ * It can still be loaded, but as a content-only dictionary. */
+ZSTDLIB_API unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);
+
+/*! ZSTD_getDictID_fromDDict() :
+ * Provides the dictID of the dictionary loaded into `ddict`.
+ * If @return == 0, the dictionary is not conformant to Zstandard specification, or empty.
+ * Non-conformant dictionaries can still be loaded, but as content-only dictionaries. */
+ZSTDLIB_API unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict);
+
+/*! ZSTD_getDictID_fromFrame() :
+ * Provides the dictID required to decompressed the frame stored within `src`.
+ * If @return == 0, the dictID could not be decoded.
+ * This could for one of the following reasons :
+ * - The frame does not require a dictionary to be decoded (most common case).
+ * - The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden information.
+ * Note : this use case also happens when using a non-conformant dictionary.
+ * - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`).
+ * - This is not a Zstandard frame.
+ * When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code. */
+ZSTDLIB_API unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize);
+
+
+/********************************************************************
+* Advanced streaming functions
+********************************************************************/
+
+/*===== Advanced Streaming compression functions =====*/
+ZSTDLIB_API ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);
+ZSTDLIB_API ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize); /**< same as ZSTD_initStaticCCtx() */
+ZSTDLIB_API size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize); /**< pledgedSrcSize must be correct, a size of 0 means unknown. for a frame size of 0 use initCStream_advanced */
+ZSTDLIB_API size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); /**< creates of an internal CDict (incompatible with static CCtx), except if dict == NULL or dictSize < 8, in which case no dict is used. */
+ZSTDLIB_API size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize is optional and can be 0 (meaning unknown). note: if the contentSizeFlag is set, pledgedSrcSize == 0 means the source size is actually 0 */
+ZSTDLIB_API size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict); /**< note : cdict will just be referenced, and must outlive compression session */
+ZSTDLIB_API size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize); /**< same as ZSTD_initCStream_usingCDict(), with control over frame parameters */
+
+/*! ZSTD_resetCStream() :
+ * start a new compression job, using same parameters from previous job.
+ * This is typically useful to skip dictionary loading stage, since it will re-use it in-place..
+ * Note that zcs must be init at least once before using ZSTD_resetCStream().
+ * pledgedSrcSize==0 means "srcSize unknown".
+ * If pledgedSrcSize > 0, its value must be correct, as it will be written in header, and controlled at the end.
+ * @return : 0, or an error code (which can be tested using ZSTD_isError()) */
+ZSTDLIB_API size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);
+
+
+/*===== Advanced Streaming decompression functions =====*/
+typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e;
+ZSTDLIB_API ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);
+ZSTDLIB_API ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize); /**< same as ZSTD_initStaticDCtx() */
+ZSTDLIB_API size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue);
+ZSTDLIB_API size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: a dict will not be used if dict == NULL or dictSize < 8 */
+ZSTDLIB_API size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict); /**< note : ddict will just be referenced, and must outlive decompression session */
+ZSTDLIB_API size_t ZSTD_resetDStream(ZSTD_DStream* zds); /**< re-use decompression parameters from previous init; saves dictionary loading */
+
+
+/*********************************************************************
+* Buffer-less and synchronous inner streaming functions
+*
+* This is an advanced API, giving full control over buffer management, for users which need direct control over memory.
+* But it's also a complex one, with many restrictions (documented below).
+* Prefer using normal streaming API for an easier experience
+********************************************************************* */
+
+/**
+ Buffer-less streaming compression (synchronous mode)
+
+ A ZSTD_CCtx object is required to track streaming operations.
+ Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource.
+ ZSTD_CCtx object can be re-used multiple times within successive compression operations.
+
+ Start by initializing a context.
+ Use ZSTD_compressBegin(), or ZSTD_compressBegin_usingDict() for dictionary compression,
+ or ZSTD_compressBegin_advanced(), for finer parameter control.
+ It's also possible to duplicate a reference context which has already been initialized, using ZSTD_copyCCtx()
+
+ Then, consume your input using ZSTD_compressContinue().
+ There are some important considerations to keep in mind when using this advanced function :
+ - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffer only.
+ - Interface is synchronous : input is consumed entirely and produce 1+ (or more) compressed blocks.
+ - Caller must ensure there is enough space in `dst` to store compressed data under worst case scenario.
+ Worst case evaluation is provided by ZSTD_compressBound().
+ ZSTD_compressContinue() doesn't guarantee recover after a failed compression.
+ - ZSTD_compressContinue() presumes prior input ***is still accessible and unmodified*** (up to maximum distance size, see WindowLog).
+ It remembers all previous contiguous blocks, plus one separated memory segment (which can itself consists of multiple contiguous blocks)
+ - ZSTD_compressContinue() detects that prior input has been overwritten when `src` buffer overlaps.
+ In which case, it will "discard" the relevant memory section from its history.
+
+ Finish a frame with ZSTD_compressEnd(), which will write the last block(s) and optional checksum.
+ It's possible to use srcSize==0, in which case, it will write a final empty block to end the frame.
+ Without last block mark, frames will be considered unfinished (corrupted) by decoders.
+
+ `ZSTD_CCtx` object can be re-used (ZSTD_compressBegin()) to compress some new frame.
+*/
+
+/*===== Buffer-less streaming compression functions =====*/
+ZSTDLIB_API size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel);
+ZSTDLIB_API size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel);
+ZSTDLIB_API size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize is optional and can be 0 (meaning unknown). note: if the contentSizeFlag is set, pledgedSrcSize == 0 means the source size is actually 0 */
+ZSTDLIB_API size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict); /**< note: fails if cdict==NULL */
+ZSTDLIB_API size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize); /* compression parameters are already set within cdict. pledgedSrcSize=0 means null-size */
+ZSTDLIB_API size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize); /**< note: if pledgedSrcSize can be 0, indicating unknown size. if it is non-zero, it must be accurate. for 0 size frames, use compressBegin_advanced */
+
+ZSTDLIB_API size_t ZSTD_compressContinue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
+ZSTDLIB_API size_t ZSTD_compressEnd(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
+
+
+
+/*-
+ Buffer-less streaming decompression (synchronous mode)
+
+ A ZSTD_DCtx object is required to track streaming operations.
+ Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it.
+ A ZSTD_DCtx object can be re-used multiple times.
+
+ First typical operation is to retrieve frame parameters, using ZSTD_getFrameHeader().
+ It fills a ZSTD_frameHeader structure with important information to correctly decode the frame,
+ such as minimum rolling buffer size to allocate to decompress data (`windowSize`),
+ and the dictionary ID in use.
+ (Note : content size is optional, it may not be present. 0 means : content size unknown).
+ Note that these values could be wrong, either because of data malformation, or because an attacker is spoofing deliberate false information.
+ As a consequence, check that values remain within valid application range, especially `windowSize`, before allocation.
+ Each application can set its own limit, depending on local restrictions.
+ For extended interoperability, it is recommended to support windowSize of at least 8 MB.
+ Frame header is extracted from the beginning of compressed frame, so providing only the frame's beginning is enough.
+ Data fragment must be large enough to ensure successful decoding.
+ `ZSTD_frameHeaderSize_max` bytes is guaranteed to always be large enough.
+ @result : 0 : successful decoding, the `ZSTD_frameHeader` structure is correctly filled.
+ >0 : `srcSize` is too small, please provide at least @result bytes on next attempt.
+ errorCode, which can be tested using ZSTD_isError().
+
+ Start decompression, with ZSTD_decompressBegin().
+ If decompression requires a dictionary, use ZSTD_decompressBegin_usingDict() or ZSTD_decompressBegin_usingDDict().
+ Alternatively, you can copy a prepared context, using ZSTD_copyDCtx().
+
+ Then use ZSTD_nextSrcSizeToDecompress() and ZSTD_decompressContinue() alternatively.
+ ZSTD_nextSrcSizeToDecompress() tells how many bytes to provide as 'srcSize' to ZSTD_decompressContinue().
+ ZSTD_decompressContinue() requires this _exact_ amount of bytes, or it will fail.
+
+ @result of ZSTD_decompressContinue() is the number of bytes regenerated within 'dst' (necessarily <= dstCapacity).
+ It can be zero, which is not an error; it just means ZSTD_decompressContinue() has decoded some metadata item.
+ It can also be an error code, which can be tested with ZSTD_isError().
+
+ ZSTD_decompressContinue() needs previous data blocks during decompression, up to `windowSize`.
+ They should preferably be located contiguously, prior to current block.
+ Alternatively, a round buffer of sufficient size is also possible. Sufficient size is determined by frame parameters.
+ ZSTD_decompressContinue() is very sensitive to contiguity,
+ if 2 blocks don't follow each other, make sure that either the compressor breaks contiguity at the same place,
+ or that previous contiguous segment is large enough to properly handle maximum back-reference.
+
+ A frame is fully decoded when ZSTD_nextSrcSizeToDecompress() returns zero.
+ Context can then be reset to start a new decompression.
+
+ Note : it's possible to know if next input to present is a header or a block, using ZSTD_nextInputType().
+ This information is not required to properly decode a frame.
+
+ == Special case : skippable frames ==
+
+ Skippable frames allow integration of user-defined data into a flow of concatenated frames.
+ Skippable frames will be ignored (skipped) by a decompressor. The format of skippable frames is as follows :
+ a) Skippable frame ID - 4 Bytes, Little endian format, any value from 0x184D2A50 to 0x184D2A5F
+ b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits
+ c) Frame Content - any content (User Data) of length equal to Frame Size
+ For skippable frames ZSTD_decompressContinue() always returns 0.
+ For skippable frames ZSTD_getFrameHeader() returns fparamsPtr->windowLog==0 what means that a frame is skippable.
+ Note : If fparamsPtr->frameContentSize==0, it is ambiguous: the frame might actually be a Zstd encoded frame with no content.
+ For purposes of decompression, it is valid in both cases to skip the frame using
+ ZSTD_findFrameCompressedSize to find its size in bytes.
+ It also returns Frame Size as fparamsPtr->frameContentSize.
+*/
+
+/*===== Buffer-less streaming decompression functions =====*/
+ZSTDLIB_API size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize); /**< doesn't consume input */
+ZSTDLIB_API size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx);
+ZSTDLIB_API size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
+ZSTDLIB_API size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);
+ZSTDLIB_API void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
+
+ZSTDLIB_API size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx);
+ZSTDLIB_API size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
+typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
+ZSTDLIB_API ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx);
+
+
+
+/*=== New advanced API (experimental, and compression only) ===*/
+
+/* notes on API design :
+ * In this proposal, parameters are pushed one by one into an existing CCtx,
+ * and then applied on all subsequent compression jobs.
+ * When no parameter is ever provided, CCtx is created with compression level ZSTD_CLEVEL_DEFAULT.
+ *
+ * This API is intended to replace all others experimental API.
+ * It can basically do all other use cases, and even new ones.
+ * It stands a good chance to become "stable",
+ * after a reasonable testing period.
+ */
+
+/* note on naming convention :
+ * Initially, the API favored names like ZSTD_setCCtxParameter() .
+ * In this proposal, convention is changed towards ZSTD_CCtx_setParameter() .
+ * The main driver is that it identifies more clearly the target object type.
+ * It feels clearer in light of potential variants :
+ * ZSTD_CDict_setParameter() (rather than ZSTD_setCDictParameter())
+ * ZSTD_DCtx_setParameter() (rather than ZSTD_setDCtxParameter() )
+ * Left variant feels easier to distinguish.
+ */
+
+/* note on enum design :
+ * All enum will be manually set to explicit values before reaching "stable API" status */
+
+typedef enum {
+ /* compression parameters */
+ ZSTD_p_compressionLevel=100, /* Update all compression parameters according to pre-defined cLevel table
+ * Default level is ZSTD_CLEVEL_DEFAULT==3.
+ * Special: value 0 means "do not change cLevel". */
+ ZSTD_p_windowLog, /* Maximum allowed back-reference distance, expressed as power of 2.
+ * Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX.
+ * Special: value 0 means "do not change windowLog". */
+ ZSTD_p_hashLog, /* Size of the probe table, as a power of 2.
+ * Resulting table size is (1 << (hashLog+2)).
+ * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX.
+ * Larger tables improve compression ratio of strategies <= dFast,
+ * and improve speed of strategies > dFast.
+ * Special: value 0 means "do not change hashLog". */
+ ZSTD_p_chainLog, /* Size of the full-search table, as a power of 2.
+ * Resulting table size is (1 << (chainLog+2)).
+ * Larger tables result in better and slower compression.
+ * This parameter is useless when using "fast" strategy.
+ * Special: value 0 means "do not change chainLog". */
+ ZSTD_p_searchLog, /* Number of search attempts, as a power of 2.
+ * More attempts result in better and slower compression.
+ * This parameter is useless when using "fast" and "dFast" strategies.
+ * Special: value 0 means "do not change searchLog". */
+ ZSTD_p_minMatch, /* Minimum size of searched matches (note : repCode matches can be smaller).
+ * Larger values make faster compression and decompression, but decrease ratio.
+ * Must be clamped between ZSTD_SEARCHLENGTH_MIN and ZSTD_SEARCHLENGTH_MAX.
+ * Note that currently, for all strategies < btopt, effective minimum is 4.
+ * Note that currently, for all strategies > fast, effective maximum is 6.
+ * Special: value 0 means "do not change minMatchLength". */
+ ZSTD_p_targetLength, /* Only useful for strategies >= btopt.
+ * Length of Match considered "good enough" to stop search.
+ * Larger values make compression stronger and slower.
+ * Special: value 0 means "do not change targetLength". */
+ ZSTD_p_compressionStrategy, /* See ZSTD_strategy enum definition.
+ * Cast selected strategy as unsigned for ZSTD_CCtx_setParameter() compatibility.
+ * The higher the value of selected strategy, the more complex it is,
+ * resulting in stronger and slower compression.
+ * Special: value 0 means "do not change strategy". */
+
+ /* frame parameters */
+ ZSTD_p_contentSizeFlag=200, /* Content size is written into frame header _whenever known_ (default:1) */
+ ZSTD_p_checksumFlag, /* A 32-bits checksum of content is written at end of frame (default:0) */
+ ZSTD_p_dictIDFlag, /* When applicable, dictID of dictionary is provided in frame header (default:1) */
+
+ /* dictionary parameters (must be set before ZSTD_CCtx_loadDictionary) */
+ ZSTD_p_dictMode=300, /* Select how dictionary content must be interpreted. Value must be from type ZSTD_dictMode_e.
+ * default : 0==auto : dictionary will be "full" if it respects specification, otherwise it will be "rawContent" */
+ ZSTD_p_refDictContent, /* Dictionary content will be referenced, instead of copied (default:0==byCopy).
+ * It requires that dictionary buffer outlives its users */
+
+ /* multi-threading parameters */
+ ZSTD_p_nbThreads=400, /* Select how many threads a compression job can spawn (default:1)
+ * More threads improve speed, but also increase memory usage.
+ * Can only receive a value > 1 if ZSTD_MULTITHREAD is enabled.
+ * Special: value 0 means "do not change nbThreads" */
+ ZSTD_p_jobSize, /* Size of a compression job. Each compression job is completed in parallel.
+ * 0 means default, which is dynamically determined based on compression parameters.
+ * Job size must be a minimum of overlapSize, or 1 KB, whichever is largest
+ * The minimum size is automatically and transparently enforced */
+ ZSTD_p_overlapSizeLog, /* Size of previous input reloaded at the beginning of each job.
+ * 0 => no overlap, 6(default) => use 1/8th of windowSize, >=9 => use full windowSize */
+
+ /* advanced parameters - may not remain available after API update */
+ ZSTD_p_forceMaxWindow=1100, /* Force back-reference distances to remain < windowSize,
+ * even when referencing into Dictionary content (default:0) */
+
+} ZSTD_cParameter;
+
+
+/*! ZSTD_CCtx_setParameter() :
+ * Set one compression parameter, selected by enum ZSTD_cParameter.
+ * Note : when `value` is an enum, cast it to unsigned for proper type checking.
+ * @result : 0, or an error code (which can be tested with ZSTD_isError()). */
+ZSTDLIB_API size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned value);
+
+/*! ZSTD_CCtx_setPledgedSrcSize() :
+ * Total input data size to be compressed as a single frame.
+ * This value will be controlled at the end, and result in error if not respected.
+ * @result : 0, or an error code (which can be tested with ZSTD_isError()).
+ * Note 1 : 0 means zero, empty.
+ * In order to mean "unknown content size", pass constant ZSTD_CONTENTSIZE_UNKNOWN.
+ * Note that ZSTD_CONTENTSIZE_UNKNOWN is default value for new compression jobs.
+ * Note 2 : If all data is provided and consumed in a single round,
+ * this value is overriden by srcSize instead. */
+ZSTDLIB_API size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize);
+
+/*! ZSTD_CCtx_loadDictionary() :
+ * Create an internal CDict from dict buffer.
+ * Decompression will have to use same buffer.
+ * @result : 0, or an error code (which can be tested with ZSTD_isError()).
+ * Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary,
+ * meaning "return to no-dictionary mode".
+ * Note 1 : `dict` content will be copied internally,
+ * except if ZSTD_p_refDictContent is set before loading.
+ * Note 2 : Loading a dictionary involves building tables, which are dependent on compression parameters.
+ * For this reason, compression parameters cannot be changed anymore after loading a dictionary.
+ * It's also a CPU-heavy operation, with non-negligible impact on latency.
+ * Note 3 : Dictionary will be used for all future compression jobs.
+ * To return to "no-dictionary" situation, load a NULL dictionary */
+ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
+
+/*! ZSTD_CCtx_refCDict() :
+ * Reference a prepared dictionary, to be used for all next compression jobs.
+ * Note that compression parameters are enforced from within CDict,
+ * and supercede any compression parameter previously set within CCtx.
+ * The dictionary will remain valid for future compression jobs using same CCtx.
+ * @result : 0, or an error code (which can be tested with ZSTD_isError()).
+ * Special : adding a NULL CDict means "return to no-dictionary mode".
+ * Note 1 : Currently, only one dictionary can be managed.
+ * Adding a new dictionary effectively "discards" any previous one.
+ * Note 2 : CDict is just referenced, its lifetime must outlive CCtx.
+ */
+ZSTDLIB_API size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
+
+/*! ZSTD_CCtx_refPrefix() :
+ * Reference a prefix (single-usage dictionary) for next compression job.
+ * Decompression need same prefix to properly regenerate data.
+ * Prefix is **only used once**. Tables are discarded at end of compression job.
+ * Subsequent compression jobs will be done without prefix (if none is explicitly referenced).
+ * If there is a need to use same prefix multiple times, consider embedding it into a ZSTD_CDict instead.
+ * @result : 0, or an error code (which can be tested with ZSTD_isError()).
+ * Special : Adding any prefix (including NULL) invalidates any previous prefix or dictionary
+ * Note 1 : Prefix buffer is referenced. It must outlive compression job.
+ * Note 2 : Referencing a prefix involves building tables, which are dependent on compression parameters.
+ * It's a CPU-heavy operation, with non-negligible impact on latency.
+ * Note 3 : it's possible to alter ZSTD_p_dictMode using ZSTD_CCtx_setParameter() */
+ZSTDLIB_API size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize);
+
+
+
+typedef enum {
+ ZSTD_e_continue=0, /* collect more data, encoder transparently decides when to output result, for optimal conditions */
+ ZSTD_e_flush, /* flush any data provided so far - frame will continue, future data can still reference previous data for better compression */
+ ZSTD_e_end /* flush any remaining data and ends current frame. Any future compression starts a new frame. */
+} ZSTD_EndDirective;
+
+/*! ZSTD_compress_generic() :
+ * Behave about the same as ZSTD_compressStream. To note :
+ * - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_setParameter()
+ * - Compression parameters cannot be changed once compression is started.
+ * - *dstPos must be <= dstCapacity, *srcPos must be <= srcSize
+ * - *dspPos and *srcPos will be updated. They are guaranteed to remain below their respective limit.
+ * - @return provides the minimum amount of data still to flush from internal buffers
+ * or an error code, which can be tested using ZSTD_isError().
+ * if @return != 0, flush is not fully completed, there is some data left within internal buffers.
+ * - after a ZSTD_e_end directive, if internal buffer is not fully flushed,
+ * only ZSTD_e_end or ZSTD_e_flush operations are allowed.
+ * It is necessary to fully flush internal buffers
+ * before starting a new compression job, or changing compression parameters.
+ */
+ZSTDLIB_API size_t ZSTD_compress_generic (ZSTD_CCtx* cctx,
+ ZSTD_outBuffer* output,
+ ZSTD_inBuffer* input,
+ ZSTD_EndDirective endOp);
+
+/*! ZSTD_CCtx_reset() :
+ * Return a CCtx to clean state.
+ * Useful after an error, or to interrupt an ongoing compression job and start a new one.
+ * Any internal data not yet flushed is cancelled.
+ * Dictionary (if any) is dropped.
+ * It's possible to modify compression parameters after a reset.
+ */
+ZSTDLIB_API void ZSTD_CCtx_reset(ZSTD_CCtx* cctx); /* Not ready yet ! */
+
+
+/*! ZSTD_compress_generic_simpleArgs() :
+ * Same as ZSTD_compress_generic(),
+ * but using only integral types as arguments.
+ * Argument list is larger and less expressive than ZSTD_{in,out}Buffer,
+ * but can be helpful for binders from dynamic languages
+ * which have troubles handling structures containing memory pointers.
+ */
+size_t ZSTD_compress_generic_simpleArgs (
+ ZSTD_CCtx* cctx,
+ void* dst, size_t dstCapacity, size_t* dstPos,
+ const void* src, size_t srcSize, size_t* srcPos,
+ ZSTD_EndDirective endOp);
+
+
+
+/**
+ Block functions
+
+ Block functions produce and decode raw zstd blocks, without frame metadata.
+ Frame metadata cost is typically ~18 bytes, which can be non-negligible for very small blocks (< 100 bytes).
+ User will have to take in charge required information to regenerate data, such as compressed and content sizes.
+
+ A few rules to respect :
+ - Compressing and decompressing require a context structure
+ + Use ZSTD_createCCtx() and ZSTD_createDCtx()
+ - It is necessary to init context before starting
+ + compression : any ZSTD_compressBegin*() variant, including with dictionary
+ + decompression : any ZSTD_decompressBegin*() variant, including with dictionary
+ + copyCCtx() and copyDCtx() can be used too
+ - Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX
+ + If input is larger than a block size, it's necessary to split input data into multiple blocks
+ + For inputs larger than a single block size, consider using the regular ZSTD_compress() instead.
+ Frame metadata is not that costly, and quickly becomes negligible as source size grows larger.
+ - When a block is considered not compressible enough, ZSTD_compressBlock() result will be zero.
+ In which case, nothing is produced into `dst`.
+ + User must test for such outcome and deal directly with uncompressed data
+ + ZSTD_decompressBlock() doesn't accept uncompressed data as input !!!
+ + In case of multiple successive blocks, should some of them be uncompressed,
+ decoder must be informed of their existence in order to follow proper history.
+ Use ZSTD_insertBlock() for such a case.
+*/
+
+#define ZSTD_BLOCKSIZELOG_MAX 17
+#define ZSTD_BLOCKSIZE_MAX (1<<ZSTD_BLOCKSIZELOG_MAX) /* define, for static allocation */
+/*===== Raw zstd block functions =====*/
+ZSTDLIB_API size_t ZSTD_getBlockSize (const ZSTD_CCtx* cctx);
+ZSTDLIB_API size_t ZSTD_compressBlock (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
+ZSTDLIB_API size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
+ZSTDLIB_API size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize); /**< insert block into `dctx` history. Useful for uncompressed blocks */
+
+
+#endif /* ZSTD_H_ZSTD_STATIC_LINKING_ONLY */
+
+#if defined (__cplusplus)
+}
+#endif